Skip to content

draw.io is a JavaScript, client-side editor for general diagramming.

31.4.6 release

David Benson744cb5420fdf
diff --git a/ChangeLog b/ChangeLog
index 6c1eea6dc..e41ee5788 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+16-SEP-2026: 31.4.6
+
+- Updates stable channel to 31.4.4
+- Updates drawio-mermaid bundle to 0.1.0+commit.39bf997
+- Updates drawio-mermaid bundle to 0.1.0+commit.7003579
+- Backfills the six dia.txt keys missing from every language file and checks for it on preprod [jgraph/drawio-dev#671]
+- Stops Chromium on Android from scrolling the diagram when Ctrl is pressed with a physical keyboard [jgraph/drawio#5316]
+- Gives the native clipboard element a real font size so its caret is never empty [jgraph/drawio#5316]
+- Waits for the images and fonts of the math print preview before printing, as in the non-math path
+- Makes the Microsoft 365 client opt-in for embed mode and disables it in lockdown mode [DID-20281]
+- Makes the viewer link tooltip readable on dark host pages [DID-20253]
+- Updates the vendored drawio-plantuml bundle to commit 8f6f23c
+- Updates the vendored drawio-plantuml bundle to commit 14161d9
+- Stops URL parameters setting the AI endpoint and API keys [GHSA-v2pv-rjf8-9w9v]
+- Stops a URL parameter setting the export service [GHSA-ff67-v9r9-6877]
+- Add the migration report strings the Confluence apps need [DID-20276]
+- Add the integrity check summary caveat string [DID-20276]
+- Updates stable channel to 31.4.6
+- Adds a value to the Toggle Style action and repaints removed transient styles
+- Adds a style-key picker to the Set Style and Toggle Style fields
+- Opens a fresh action editor for another cell instead of refocusing the open one
+- Lets a layout run replace the live layout of every selected layout container
+- Updates drawio-elk bundle to 0.1.0+commit.09eed5e
+- Keeps the model order of tied siblings in flow layout containers
+- Adds a child for every hover arrow in flow layout containers
+- Restores the cells a preview faded after the session started
+- Keeps the preview's final state on the canvas until Reset
+- Adds a descendants flag to the cell selector of custom actions
+- Makes the preprod build's AI test plan robust to long replies
+- Starts the GAE Cloud Build from the release push instead of the trigger that never fired
+- Requires the served version id in the release monitor's deploy poll and shows the GAE build on the dashboard
+
08-SEP-2026: 31.4.5
- Fixes AWS4 arrow templates and stale palette ids
diff --git a/VERSION b/VERSION
index 840d463b5..26b67657a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-31.4.5
\ No newline at end of file
+31.4.6
\ No newline at end of file
diff --git a/docs/claude/animations.md b/docs/claude/animations.md
index 5b059ad8a..f9bd1b1f0 100644
--- a/docs/claude/animations.md
+++ b/docs/claude/animations.md
@@ -29,8 +29,18 @@ cells via `cells`/`tags`/`layers`/`excludeCells` selectors (incl. `"*"`
wildcard). `layers` holds layer cell IDs; all descendants resolve in via
`getCellsForLayers`, so later-added cells are picked up. Exception: visibility
actions (`toggle`/`show`/`hide`) with `transient:false` flip the layer cell's
-own `visible` (`getLayerCells`). Multiple keys in one step run in parallel;
-consecutive steps are sequential unless `immediate:true`.
+own `visible` (`getLayerCells`). `descendants: true` (Sept 2026) adds every
+descendant of the resolved cells in `getCellsForAction`, looked up at
+execution time, so an effect on a group or container reaches its contents
+and follows children added later; without it only the listed cells are
+affected (a bare group has no visible shape, so a fade on it shows nothing —
+Kym, 2026-08-28). Gaudenz chose the explicit flag over expanding groups
+implicitly, which would have made a frame-only fade impossible. Dialog: a
+"Descendants" toggle in the Cells chip menu (reuses the `descendants`
+resource), the chip shows "+ Descendants" while on; the preview snapshot
+covers the descendants since it resolves through the same call. Multiple
+keys in one step run in parallel; consecutive steps are sequential unless
+`immediate:true`.
```json
{"animation": {"loop": false, "steps": [
@@ -97,7 +107,17 @@ Either default is overridden per action with an explicit
(`toggleCellsTransient` flips SVG opacity ↔ `toggleCells` flips
`cell.visible`), `show`/`hide` (`setOpacityForNodes` ↔ + `setCellsVisible`),
`style` (`setCellStylesTransient` ↔ `setCellStyles`), `toggleStyle`
- (`toggleCellStylesTransient` ↔ `toggleCellStyles`).
+ (`toggleCellStylesTransient` ↔ `toggleCellStyleValues`).
+
+**`toggleStyle` value semantics** (`Graph.nextToggleStyleValue`, Sept 2026):
+with `value` the key flips between `value` and `defaultValue` — no default
+REMOVES the key so the stylesheet default applies (`strokeWidth 10` toggles
+10 ↔ 1, `fontStyle 2` italic ↔ plain). Without `value` it is the legacy
+boolean toggle ('0' ↔ '1'; `defaultValue` is what a missing key counts as),
+now with the string `'0'` counted as off — the old `truthy ? 0 : 1` test
+made a toggle on a missing key write 0 forever. The dialog shows Key /
+Value / Default value; the model path keeps mxGraph's first-cell-decides
+rule, the transient path toggles per cell.
`scroll`/`viewbox` with `smooth:true` are the only viewport actions that
**block the chain** (~600 ms): the dispatcher bumps `waitCounter` and resumes
@@ -211,7 +231,11 @@ toggleFlowAnimation bug).
Transient helpers on `Graph.prototype` (Editor.js): `toggleCellsTransient`,
`setCellStylesTransient`, `toggleCellStylesTransient` — all reverted by
`graph.refresh()` (next `view.validate()` re-reads `state.style` from
-`cell.style`). The player only hides `show`/`hide`-referenced cells (records
+`cell.style`). The style helpers repaint through `redrawTransientStyle`
+(resetStyles + `cellRenderer.configureShape` + redraw, the renderer's own
+style-change sequence) — a bare `shape.apply` keeps the previously painted
+field value, so a REMOVED key (toggle-off without default, `style` with an
+empty value) never took effect visually. The player only hides `show`/`hide`-referenced cells (records
original opacity, `stop()` restores exactly); the model is never mutated.
## Dialog — `AnimationDialog` (Dialogs.js)
@@ -247,6 +271,27 @@ errors in the text view resolve V8's "at position N" to a line/column suffix
`immediate` toggle per row: ⏩ + "Immediate" (on) / ⏱ + "Wait" (off); each
glyph carries U+FE0E to force monochrome. Hidden on row 0.
+**Style-key picker** (Sept 2026): the Key field of Set Style / Toggle Style
+(`styleKey: true` in `CustomActionDialog.SCHEMAS`) gets a `<datalist>` of
+common keys labelled with the Format panel resources
+(`AnimationDialog.STYLE_KEYS`, one datalist per dialog inside the dialog
+element so it goes away with it, options rebuilt on language change via
+`staticRefreshers`) and a "use selected
+cells" icon button that lists the selected cell's raw `key=value` pairs
+(`AnimationDialog.getStylePairs`) in a `selectorChips.openMenuPopover`;
+picking one writes the key and — when the schema has a `value` field — the
+value, then `refresh()` re-renders the row. Replaces the idea of appending
+style keys to the Format panel tooltips (many controls map to several keys).
+
+**One action editor at a time**: `LinkDialog.editCustomAction` keeps a single
+`editorUi.actionWindow`. Edit… for the SAME cells (the LinkDialog's
+`graph.getSelectionCells()` at click time, compared by identity) refocuses it;
+for other cells it calls the dialog's `requestClose(onClosed)` — the Cancel
+button's discard prompt when dirty, nothing happens if the user keeps the
+open editor — and opens a fresh one bound to the new cells. Before, the
+reuse guard silently refocused the window bound to the OTHER cell's save
+callback (Kym, 2026-08-28), so edits would have saved onto the wrong cell.
+
**Preview cleanup (`endPreviewSession`)** — order matters: (1)
`previewSession.restoreOpacity()` (undoes opacity-only effects:
`opacity`/`fadeIn`/`fadeOut`/`fadeTo`/`show`/`hide`); (2)
@@ -255,7 +300,21 @@ glyph carries U+FE0E to force monochrome. Hidden on row 0.
`style`/`toggleStyle`/`toggle`/`show`/`hide` mutations). Opacity restore is
first because the SVG group's inline `style.opacity` survives
`shape.clear()`. Page-switch and chromeless replay re-render from scratch and
-skip this.
+skip this. `startPreviewSession` snapshots on EVERY preview (the session
+player keeps the live `data`, and `snapshotOpacity` only adds nodes not yet
+recorded, keeping the first value) — before, only the cells referenced at
+the session's first preview were recorded, so a Set Opacity step added or
+retargeted later left its cell faded after Reset/close with nothing in the
+editor able to clear an inline node opacity (Kym, 2026-09-02). Transient
+effects otherwise stay until another action changes them — by design, no
+model edit resets them. The **Preview button** seeds `player.snapshot = []`
+so the player's restore-on-done is a no-op and the canvas stays at the final
+state until Reset — `play()` therefore only snapshots when `snapshot ==
+null` (the loop restore nulls it, so a looping lightbox player still
+snapshots per pass). Before that guard the loop snapshotted unconditionally
+and undid every opacity effect (a `toggle` on the edited cell) the moment
+the last step finished, while transient style steps stayed visible
+(Gaudenz, 2026-09-16).
**Multi-corner resize** (every resizable mxWindow + every modal `Dialog`, in
grapheditor/Editor.js): `installDialogEdgeResizeHandles(container, addHandle)`
diff --git a/docs/claude/layouts.md b/docs/claude/layouts.md
index 78f75df41..ada3c4440 100644
--- a/docs/claude/layouts.md
+++ b/docs/claude/layouts.md
@@ -65,16 +65,25 @@ the laid-out XML.
## Layout runs retarget a selected layout container
-With exactly one vertex selected whose style carries a replaceable
-`childLayout` (not the structural `tableLayout`/`stackLayout`/`rack`), the
-user-gesture layout runs (`ElkLayout.run`, `LibavoidRouting.run`, the
-Parallels and circle menu items, the custom layout dialog, and
-`executeLayoutSpec` ONLY with its `retargetSelection` flag — passed by Run
-Last Layout; the programmatic callers (embed layout action, `#create`,
-desktop `--layout`) stay whole-page so a transient selection can't hijack a
-host-triggered run) rewrite the container's `childLayout` to that spec instead
-of running one-shot — `EditorUi.getSelectedLayoutContainer` +
-`EditorUi.setContainerChildLayout` (diagramly/EditorUi.js). The style write
+When every selected VERTEX carries a replaceable `childLayout` (not the
+structural `tableLayout`/`stackLayout`/`rack`; selected edges are ignored, any
+other selected vertex keeps the legacy one-shot run — Sept 2026, before that
+exactly one selected cell), the user-gesture layout runs (`ElkLayout.run`,
+`LibavoidRouting.run`, the Parallels and circle menu items, the custom layout
+dialog, and `executeLayoutSpec` ONLY with its `retargetSelection` flag —
+passed by Run Last Layout; the programmatic callers (embed layout action,
+`#create`, desktop `--layout`) stay whole-page so a transient selection can't
+hijack a host-triggered run) rewrite EACH container's `childLayout` to that
+spec in one undoable edit instead of running one-shot —
+`EditorUi.getSelectedLayoutContainers` +
+`EditorUi.applyLayoutToSelectedContainers` (returns false when nothing was
+retargeted so the caller runs its one-shot path) +
+`EditorUi.setContainerChildLayout` (diagramly/EditorUi.js). With several
+containers or Select All the old code ran a one-shot layout INSIDE the first
+selected container, which its own live layout immediately reverted ("it
+rearranges, then snaps back" — Kym, 2026-08-18). Because the layout can be
+swapped this way, the Advanced sidebar containers are all labelled
+"Layout Container" rather than by their initial layout. The style write
triggers the layout manager, so the new layout runs in the same undoable edit
(mxStyleChange → `addCellsWithLayout(cell)` includes the cell's own layout);
an unchanged value produces no model change, so the helper re-runs via
@@ -170,7 +179,42 @@ transparentBounds is toggled off. The sidebar seed cells are authored at the
exact positions ELK computes — the layout can't run for the palette thumbnail,
and a drop then converges without moving anything; with the anchor only the
RELATIVE positions must match ELK's output. When ELK output changes
-(spacing/defaults), re-measure and update those seeds.
+(spacing/defaults), re-measure and update those seeds (headless: a stub-graph
+run of the vendored bundle as in drawio-elk's test/verify-bridge-transparent.mjs).
+The flow seeds list the two tied Task siblings in the order the model-order
+tie-break places them (first on top / left, see below).
+
+## Flow containers keep model order (Sept 2026)
+
+A shape dropped onto a branch used to land in an arbitrary slot: layered
+crossing minimization has no preference between tied siblings, and the
+drawio-elk port picked whichever randomized try came first (the last-added
+node ended on top). The flow containers now set
+`elk.layered.considerModelOrder.strategy=NODES_AND_EDGES`
+(`Menus.flowModelOrder`, in `Menus.layoutContainers` and as an absent-only
+elkLayered default in `setContainerChildLayout`): model order — the mxGraph
+child order, ie. insertion order — breaks ties AFTER crossing minimization and
+never adds crossings, the layered counterpart of the tree containers'
+geometry-based sibling order. Two drawio-elk fixes make the option effective
+(both repos uncommitted as of 2026-09-11): `LayerSweepCrossingMinimizer` now
+sets `FIRST_TRY_WITH_INITIAL_ORDER` and keeps the SortByInputModel order for
+the first try like upstream (before, every try was randomized so the option
+was inert — `elkjs` honoured it, the port did not), and the bridge's
+`applyMermaidElkPolicy` no longer strips an EXPLICIT
+`considerModelOrder`/`forceNodeModelOrder` option (it still drops the
+DEFAULTS' pins). drawio-mermaid's `PREFER_EDGES` for wide fan-outs therefore
+takes effect too — its suite passed unchanged. Rebuild via `ant bundles` after
+committing drawio-elk (the bundle header carries the sibling commit).
+
+**Hover arrows in flow containers add a child.** All Insert > Layout and
+Advanced containers carry `containerType=tree` for the Trees.js subtree
+delete/move semantics, which also brought its arrow rules: arrow along the
+tree direction = child, opposite = insert parent, perpendicular = sibling
+(connected from the hovered cell's parent — Kym read that as "added to the
+previous shape"). `isFlowContainer` in Trees.js' `connectVertex` override
+routes every arrow of an elkLayered (or legacy `flowLayout`) container to
+`addChild`; tree, radial and organic containers keep the tree rules, and the
+keyboard (Tab child / Enter sibling) is unchanged.
## Sync by default, async fallback
diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js
index e3bd2dafc..e7584cb7a 100644
--- a/src/main/webapp/js/app.min.js
+++ b/src/main/webapp/js/app.min.js
@@ -65,13 +65,13 @@ if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap
lang.substring(0,dash));0<=window.mxLanguages.indexOf(lang)&&(window.mxLanguage=lang)}}"1"==urlParams.extAuth&&/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent)&&(urlParams.gapi="0",urlParams.noDevice="1","1"!=urlParams.lightbox&&(urlParams.lightbox="1",urlParams.layers="1",urlParams.viewerOnlyMsg="1"));"viewer.diagrams.net"==window.location.hostname&&(urlParams.lightbox="1");"1"==urlParams.lightbox&&(urlParams.chrome="0");
"1"==urlParams.embedInline&&(urlParams.embed="1",urlParams.ui="sketch",urlParams.plugins="0",urlParams.proto="json",urlParams.prefetchFonts="1",null==urlParams.pv&&(urlParams.pv="0"));function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)}
window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;"1"==urlParams.extAuth&&(a="sketch");if(null==a&&isLocalStorage&&"undefined"!==typeof JSON&&"1"!=urlParams.lightbox)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}"dark"==urlParams.ui&&null==urlParams.dark&&(urlParams.dark="1");"sketch"==a&&null==urlParams.sketch&&"ac.draw.io"===window.location.hostname&&(urlParams.sketch="1");return a}();
-(function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams["export"];null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,
-8)&&(a="http://"+a),EXPORT_URL=a);a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,
-b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0";
-"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
+(function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,
+8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");
+if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.ms365="0";
+"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.ms365="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],FORBID_ATTR:["data-icon","data-icon-content"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ALLOW_DATA_ATTR:!1,ADD_ATTR:"target content pointer-events requiredFeatures data-font-src data-action data-title data-message data-link data-effect data-lucid-type data-lucid-content".split(" ")};
window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL="undefined"===typeof window.EXPORT_URL?"/export":window.EXPORT_URL;window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
-window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"31.4.5",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"31.4.6",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),
IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&
0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),
@@ -2310,7 +2310,8 @@ EditorUi.prototype.hideShapePicker=function(a){null!=this.shapePicker&&(this.sha
EditorUi.prototype.onKeyDown=function(a){var b=this.editor.graph;if(9==a.which&&b.isEnabled()&&!mxEvent.isControlDown(a)){if(b.isEditing())if(mxEvent.isAltDown(a))b.stopEditing(!1);else try{var d=b.cellEditor.isContentEditing()&&b.cellEditor.isTextSelected();if(window.getSelection&&b.cellEditor.isContentEditing()&&!d){var e=window.getSelection(),g=0<e.rangeCount?e.getRangeAt(0).commonAncestorContainer:null;d=null!=g&&("LI"==g.nodeName||null!=g.parentNode&&"LI"==g.parentNode.nodeName)}d?document.execCommand(mxEvent.isShiftDown(a)?
"outdent":"indent",!1,null):mxEvent.isShiftDown(a)?b.stopEditing(!1):b.cellEditor.insertTab(b.cellEditor.isContentEditing()?null:4)}catch(c){}else mxEvent.isAltDown(a)?b.selectParentCell():b.selectCell(!mxEvent.isShiftDown(a));mxEvent.consume(a)}};
EditorUi.prototype.onKeyPress=function(a){var b=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(a)===this.typingShim||!this.isImmediateEditingEvent(a)||b.isEditing()||b.isSelectionEmpty()||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(null==a.key||1!==a.key.length)&&229!==a.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(a)||(b.escape(),b.cellEditor.editByTyping=!0,b.startEditing())};
-EditorUi.prototype.installTypingShim=function(){var a=this.editor.graph,b=document.createElement("textarea");b.setAttribute("autocomplete","off");b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&b.setAttribute("inputmode","none");b.tabIndex=-1;b.className="mxTypingShim";b.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";
+EditorUi.prototype.isVirtualKeyboardDevice=function(){return mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints};
+EditorUi.prototype.installTypingShim=function(){var a=this.editor.graph,b=document.createElement("textarea");b.setAttribute("autocomplete","off");b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");this.isVirtualKeyboardDevice()&&b.setAttribute("inputmode","none");b.tabIndex=-1;b.className="mxTypingShim";b.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";
this.typingShim=b;var d=!1,e=mxUtils.bind(this,function(){if(!d&&0<b.value.length){var c=b.value;b.value="";this.hideTypingShim();a.escape();a.cellEditor.editByTyping=!0;a.startEditing(null,c)}});mxEvent.addListener(b,"compositionstart",function(){d=!0});mxEvent.addListener(b,"compositionend",function(){d=!1;e()});mxEvent.addListener(b,"input",function(){e()});mxEvent.addListener(b,"keydown",mxUtils.bind(this,function(c){229!==c.keyCode&&(mxEvent.isControlDown(c)||mxEvent.isMetaDown(c)||(null==c.key||
1!==c.key.length||mxEvent.isAltDown(c)?c.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(c)&&c.preventDefault()))}));a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));a.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));a.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,
function(){this.updateTypingShim()}),0)}));if(null==a.container.tabIndex||0>a.container.tabIndex)a.container.tabIndex=-1;mxEvent.addListener(a.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var g=a.cellEditor.focusContainer;a.cellEditor.focusContainer=mxUtils.bind(this,function(){a.isSelectionEmpty()||a.isEditing()?g.apply(a.cellEditor):this.updateTypingShim()})};
@@ -4743,12 +4744,12 @@ q=!0}}q||m.apply(this,arguments)}})();(function(){Sidebar.prototype.addActiveDir
40,50,"","Windows Server",!1,null,this.getTagsForStencil("ms active directory ","windows server","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/wiring_hub.svg;",50,34,"","Wiring Hub",!1,null,this.getTagsForStencil("ms active directory ","wiring hub","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/workspace_site.svg;",
50,48.5,"","Workspace Site",!1,null,this.getTagsForStencil("ms active directory ","workspace site","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/workstation_client.svg;",42.5,50,"","Workstation Client",!1,null,this.getTagsForStencil("ms active directory ","workstation client","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/writer.svg;",
48,50,"","Writer",!1,null,this.getTagsForStencil("ms active directory ","writer","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/writing.svg;",49,50,"","Writing",!1,null,this.getTagsForStencil("ms active directory ","writing","ibm").join(" "))];this.addPalette("active_directory","Active Directory",!1,mxUtils.bind(this,function(c){for(var e=0;e<a.length;e++)c.appendChild(a[e](c))}));
-this.setCurrentSearchEntryLibrary()}})();(function(){var a=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){this.setCurrentSearchEntryLibrary("general","advanced");var c=a.apply(this,arguments),e=this,b=Menus.layoutContainerEdgeStyle+"edgeStyle=orthogonalEdgeStyle;",d=function(f,g,h,m,k){return e.addEntry(f,function(){var l=Menus.layoutContainers[h],n=Menus.layoutContainers[h];n=new mxCell(g,new mxGeometry(0,0,0,0),n.sidebarStyle);n.vertex=!0;for(var p=[],q=0;q<m.length;q++){var r=new mxCell(m[q][0],
-new mxGeometry(m[q][1],m[q][2],100,40),"whiteSpace=wrap;html=1;");r.vertex=!0;p.push(n.insert(r))}for(q=0;q<k.length;q++)r=new mxCell("",new mxGeometry,b),r.geometry.relative=!0,r.edge=!0,p[k[q][0]].insertEdge(r,!0),p[k[q][1]].insertEdge(r,!1),n.insert(r);return e.createVertexTemplateFromCells([n],l.width,l.height,g,!0)})};c=c.concat([this.addDataEntry("container swimlane pool horizontal",480,380,"Horizontal Pool 1","zZRBbsMgEEVPwx4Gt+o6bptNIkXKCVA8CqhgIiCNndMXG2iUNk6rqq2ysMT8+Z/xvAWE16abO7GTS9ugJvyJ8NpZG9LJdDVqTYCqhvBHAkDjR+B5osvGLt0Jh234TgBS4FXoPSZlZa1Oog+9zqI/KKNFG6vZRirdLERv98MAH8TmpVQzh14dcVWmsw/SUnRRpVGV1qmjbYPQ2RbvcWEdnbGGc8d6GFFywZRE/nF0AbvJ5Ucpbz5HazC4PloOqgkyOaqHBIhKVFuZY7yIwidh+549sYyHjPMyWv4J7WIgCJRdw3sFxA8ZwGUGfe7mTb9CwuAXkFRTSOCWkLDqP5ncTTHht8QE7v+QSSxPL97YO3sQ3wA="),
+this.setCurrentSearchEntryLibrary()}})();(function(){var a=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){this.setCurrentSearchEntryLibrary("general","advanced");var c=a.apply(this,arguments),e=this,b=Menus.layoutContainerEdgeStyle+"edgeStyle=orthogonalEdgeStyle;",d=function(f,g,h,m,k){return e.addEntry(f,function(){var l=Menus.layoutContainers[h],n=Menus.layoutContainers[h];n=new mxCell("Layout Container",new mxGeometry(0,0,0,0),n.sidebarStyle);n.vertex=!0;for(var p=[],q=0;q<m.length;q++){var r=
+new mxCell(m[q][0],new mxGeometry(m[q][1],m[q][2],100,40),"whiteSpace=wrap;html=1;");r.vertex=!0;p.push(n.insert(r))}for(q=0;q<k.length;q++)r=new mxCell("",new mxGeometry,b),r.geometry.relative=!0,r.edge=!0,p[k[q][0]].insertEdge(r,!0),p[k[q][1]].insertEdge(r,!1),n.insert(r);return e.createVertexTemplateFromCells([n],l.width,l.height,g,!0)})};c=c.concat([this.addDataEntry("container swimlane pool horizontal",480,380,"Horizontal Pool 1","zZRBbsMgEEVPwx4Gt+o6bptNIkXKCVA8CqhgIiCNndMXG2iUNk6rqq2ysMT8+Z/xvAWE16abO7GTS9ugJvyJ8NpZG9LJdDVqTYCqhvBHAkDjR+B5osvGLt0Jh234TgBS4FXoPSZlZa1Oog+9zqI/KKNFG6vZRirdLERv98MAH8TmpVQzh14dcVWmsw/SUnRRpVGV1qmjbYPQ2RbvcWEdnbGGc8d6GFFywZRE/nF0AbvJ5Ucpbz5HazC4PloOqgkyOaqHBIhKVFuZY7yIwidh+549sYyHjPMyWv4J7WIgCJRdw3sFxA8ZwGUGfe7mTb9CwuAXkFRTSOCWkLDqP5ncTTHht8QE7v+QSSxPL97YO3sQ3wA="),
this.addDataEntry("container swimlane pool horizontal",480,360,"Horizontal Pool 2","zZRRb8IgEMc/De/06MyerZsvmpj4CYi9CBkUA6itn360UE1da5ZlW3wg4f53f477hUBYoeul5QexNiUqwt4IK6wxPu50XaBSBKgsCVsQABoWgfeJbNZl6YFbrPx3DBANJ66OGJWNMSqKzjcqie4steJViOY7IVW54o05tg2c57uPPppbdPKCm757dieteR1UGlRhrLyYynOVhHCO9dtQGWIYVmzbFr3Pa5UOThdH67GeHL6T0uRLNBq9bULJWZZexIr8NQKiAuVeJBubJZG7KOyv3hvLsEk4x9GyL2hXLUGg2SO8D0D8kAGMM0iG9D4GSGYjSDL4BST5FBJ4RiTN3eT/guhlChF7YkSQ/yGiEN7+wy43+C4/AQ=="),this.addDataEntry("container swimlane pool horizontal",
360,480,"Vertical Pool 1","xZTRbsIgFIafhsstcKC11zrnjSYmewJiT4SMiqE42z39aMGZabss2bJekHD+n//A+S4gfFE1KyePamNLNIQvCV84a33cVc0CjSFAdUn4EwGgYRF4HnFZ79KjdHjwPwlADLxJc8KobK01Uax9a5JYn3Vl5CFU853SplzL1p66C2ovd6+Xau6w1u+4vdzObqSNbIJKgxpizr8EI9TQCcpXJiXSi9B5bEan6qU00gpthd614UgKiMdMzMSMZ7QocpELhg+MxyZnXXoVT/E8sqEK9V6lxqJIoqyjsP/sfsUYNonkMFV+R3XdwQPKviP7aygwDKVNLr0jwGCIQP4HBMQYAZiCQHMz7hREsjEifEIiIP6PSCiv/1rvffn2PgA="),this.addDataEntry("container swimlane pool vertical",380,480,"Vertical Pool 2","vZRBbsIwEEVP470zTquuSVs2ICFxAouMsFUnRrYpCafvJHYILaRiQxaRPG/8Pfnfkpkoqmbp5EGtbYmGiQ8mCmdtiKuqKdAYBlyXTLwzAE4fg8+JbtZ3+UE6rMMjAoiCb2mOGMnGWhOhD61J0J90ZWRN1WKntClXsrXHboAPcvc1VAuHXp9xM0zP/qC1bIhyoiRzYUsNqqEDyjp9tnWQJu0YwbYbkU5Lf4suYDPpuEfJ7hJthcG1tOWky6DiDvEWU+EK9V4lWT5A6SPYX7RjgLRIGd7PU9zkuepiA579l+lNHA/5hPs+kyBd/LXtDJ5lO5+yDXPbzvI5fb9M+RazX/frE31TOT5Jfe/Xi/UD"),
-d("vertical tree layout","Vertical Tree Layout","verticalTree",[["Root",90,40],["Child 1",20,120],["Child 2",160,120]],[[0,1],[0,2]]),d("horizontal tree layout","Horizontal Tree Layout","horizontalTree",[["Root",40,60],["Child 1",180,20],["Child 2",180,100]],[[0,1],[0,2]]),d("vertical flow layout","Vertical Flow Layout","verticalFlow",[["Start",36.67,40],["Task",150,130],["Task",20,130],["End",36.67,220]],[[0,1],[0,2],[1,3],[2,3]]),d("horizontal flow layout","Horizontal Flow Layout","horizontalFlow",
-[["Start",40,26.67],["Task",190,90],["Task",190,20],["End",340,26.67]],[[0,1],[0,2],[1,3],[2,3]])]);this.setCurrentSearchEntryLibrary();return c}})();(function(){Sidebar.prototype.addAlibabaCloudPalette=function(){this.setCurrentSearchEntryLibrary("alibaba_cloud","alibaba_cloud");this.addAlibabaCloudGeneralPalette(30,"alibaba cloud",this,"points=[];aspect=fixed;html=1;align=center;shadow=0;dashed=0;fillColor=#FF6A00;strokeColor=none;shape=mxgraph.alibaba_cloud.");this.setCurrentSearchEntryLibrary()};Sidebar.prototype.addAlibabaCloudGeneralPalette=function(a,c,e,b){var d=[this.createVertexTemplateEntry(b+"abap_business_application_platform;",1.82*
+d("vertical tree layout","Vertical Tree Layout","verticalTree",[["Root",90,40],["Child 1",20,120],["Child 2",160,120]],[[0,1],[0,2]]),d("horizontal tree layout","Horizontal Tree Layout","horizontalTree",[["Root",40,60],["Child 1",180,20],["Child 2",180,100]],[[0,1],[0,2]]),d("vertical flow layout","Vertical Flow Layout","verticalFlow",[["Start",36.67,40],["Task",20,130],["Task",150,130],["End",36.67,220]],[[0,1],[0,2],[1,3],[2,3]]),d("horizontal flow layout","Horizontal Flow Layout","horizontalFlow",
+[["Start",40,26.67],["Task",190,20],["Task",190,90],["End",340,26.67]],[[0,1],[0,2],[1,3],[2,3]])]);this.setCurrentSearchEntryLibrary();return c}})();(function(){Sidebar.prototype.addAlibabaCloudPalette=function(){this.setCurrentSearchEntryLibrary("alibaba_cloud","alibaba_cloud");this.addAlibabaCloudGeneralPalette(30,"alibaba cloud",this,"points=[];aspect=fixed;html=1;align=center;shadow=0;dashed=0;fillColor=#FF6A00;strokeColor=none;shape=mxgraph.alibaba_cloud.");this.setCurrentSearchEntryLibrary()};Sidebar.prototype.addAlibabaCloudGeneralPalette=function(a,c,e,b){var d=[this.createVertexTemplateEntry(b+"abap_business_application_platform;",1.82*
a,1.65*a,"","ABAP Business Application Platform",!1,null,this.getTagsForStencil("buildings","abap business application platform",c).join(" ")),this.createVertexTemplateEntry(b+"acms_application_configuration_manangement;",1.7*a,1.58*a,"","ACMS Application Configuration Manangement",!1,null,this.getTagsForStencil("buildings","acms application configuration manangement",c).join(" ")),this.createVertexTemplateEntry(b+"acr_cloud_container_registry;",1.62*a,1.88*a,"","ACR Cloud Container Registry",!1,
null,this.getTagsForStencil("buildings","acr cloud container registry",c).join(" ")),this.createVertexTemplateEntry(b+"actiontrail;",1.67*a,1.67*a,"","ActionTrail",!1,null,this.getTagsForStencil("buildings","actiontrail",c).join(" ")),this.createVertexTemplateEntry(b+"adam_advanced_database_and_application_migration;",1.43*a,1.71*a,"","ADAM Advanced Database and Application Migration",!1,null,this.getTagsForStencil("buildings","adam advanced database and application migration",c).join(" ")),this.createVertexTemplateEntry(b+
"adb_analyticdb_for_mysql;",1.63*a,1.83*a,"","ADB AnalyticDB for MySQL",!1,null,this.getTagsForStencil("buildings","adb analyticdb for mysql my sql",c).join(" ")),this.createVertexTemplateEntry(b+"address_purification;",1.69*a,1.79*a,"","Address Purification",!1,null,this.getTagsForStencil("buildings","address purification",c).join(" ")),this.createVertexTemplateEntry(b+"afs_fraud_service;",1.47*a,1.66*a,"","AFS Fraud Service",!1,null,this.getTagsForStencil("buildings","afs fraud service",c).join(" ")),
@@ -13023,26 +13024,26 @@ DrawioFile.prototype.synchronizeFile=function(b,k,m){EditorUi.debug("DrawioFile.
k&&k(z))}),x=mxUtils.bind(this,function(){return!g});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(z){g&&(window.clearTimeout(q),this.sync.cleanup(b,k,z))}),u,x):this.updateFile(mxUtils.bind(this,function(){g&&(window.clearTimeout(q),null!=b&&b())}),u,x,null,null,m)}};
DrawioFile.prototype.updateFile=function(b,k,m,g,q,u){if(null==m||!m())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",q,"invalidChecksum",this.invalidChecksum,"latestFile",[u]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=k&&k();else{var x=mxUtils.bind(this,function(z){try{null!=m&&m()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[z]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=k&&k():null!=z?this.mergeFile(z,
b,k,g,q):this.reloadFile(b,k))}catch(F){null!=k&&k(F)}});null!=u?x(u):this.getLatestVersion(x,k)}};
-DrawioFile.prototype.mergeFile=function(b,k,m,g,q){try{var u=b.getShadowPages();if(null!=u&&0<u.length){var x=this.getShadowPages(),z=[this.ui.diffPages(null!=g?g:x,u)];g=null;try{var F=mxUtils.parseXml(b.initialData).documentElement;null!=F&&"mxfile"==F.nodeName&&(g=F.getAttribute("vars"))}catch(t){}g!=this.getShadowVars()&&(z[0][EditorUi.DIFF_FILE]={vars:g});var J=this.ignorePatches(z);if(J)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),
-EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",J),null!=k&&k();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var H=this.isModified()?this.ui.diffPages(x,this.isRealtime()?this.ownPages:this.ui.pages):null,D=this.ui.patchPages(this.ui.clonePages(x),z[0]),c=this.ui.getHashValueForPages(D,{}),f=this.ui.getHashValueForPages(u,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",x,"pages",u,"patched",D,"patches",z,"changes",H,"checksum",
+DrawioFile.prototype.mergeFile=function(b,k,m,g,q){try{var u=b.getShadowPages();if(null!=u&&0<u.length){var x=this.getShadowPages(),z=[this.ui.diffPages(null!=g?g:x,u)];g=null;try{var F=mxUtils.parseXml(b.initialData).documentElement;null!=F&&"mxfile"==F.nodeName&&(g=F.getAttribute("vars"))}catch(t){}g!=this.getShadowVars()&&(z[0][EditorUi.DIFF_FILE]={vars:g});var I=this.ignorePatches(z);if(I)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),
+EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",I),null!=k&&k();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var H=this.isModified()?this.ui.diffPages(x,this.isRealtime()?this.ownPages:this.ui.pages):null,D=this.ui.patchPages(this.ui.clonePages(x),z[0]),c=this.ui.getHashValueForPages(D,{}),f=this.ui.getHashValueForPages(u,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",x,"pages",u,"patched",D,"patches",z,"changes",H,"checksum",
c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",q);if(null!=c&&c!=f)this.checksumError(m,z,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(u,g);if(null!=this.sync){var l=this.sync.patchRealtime(z,DrawioFile.LAST_WRITE_WINS?H:null,null,q);null==l||mxUtils.isEmptyObject(l)||z.push(l)}this.patch(z,DrawioFile.LAST_WRITE_WINS?H:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());
this.descriptorChanged();null!=k&&k()}}catch(t){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=m&&m(t);try{if(!(t instanceof DOMException&&"InvalidCharacterError"==t.name)){var n=this.getCurrentUser(),r=null!=n?n.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),r,t)}}catch(v){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(t){null!=m&&m(t)}};
DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var k=new mxCodec(mxUtils.createXmlDocument()),m=k.document.createElement("mxfile");if(null!=b)for(var g=0;g<b.length;g++){var q=k.encode(new mxGraphModel(b[g].root));"1"!=urlParams.dev&&(q=this.ui.anonymizeNode(q,!0));q.setAttribute("id",b[g].getId());b[g].viewState&&this.ui.editor.graph.saveViewState(b[g].viewState,q,!0);m.appendChild(q)}return mxUtils.getPrettyXml(m)};
DrawioFile.prototype.compressReportData=function(b,k,m){k=null!=k?k:1E4;null!=m&&null!=b&&b.length>m?b=b.substring(0,m)+"[...]":null!=b&&b.length>k&&(b=Graph.compress(b)+"\n");return b};
-DrawioFile.prototype.checksumError=function(b,k,m,g,q,u,x,z){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var F=this.getCurrentUser(),J=null!=F?F.id:"unknown",H=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",D=JSON.stringify(k).length,c=null;if(null!=k&&1E3>D){b=[];for(m=0;m<k.length;m++)b.push(this.ui.anonymizePatch(k[m]));c=JSON.stringify(b);c=null!=c&&1E3>
+DrawioFile.prototype.checksumError=function(b,k,m,g,q,u,x,z){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var F=this.getCurrentUser(),I=null!=F?F.id:"unknown",H=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",D=JSON.stringify(k).length,c=null;if(null!=k&&1E3>D){b=[];for(m=0;m<k.length;m++)b.push(this.ui.anonymizePatch(k[m]));c=JSON.stringify(b);c=null!=c&&1E3>
c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(f){try{var l=null!=c?"report":"error",n=this.ui.getHashValueForPages(f.getShadowPages()),r="unknown",t="unknown",v="unknown";try{var B=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=B&&(null!=B.getAttribute("version")&&(r=B.getAttribute("version")),null!=B.getAttribute("agent")&&(t=B.getAttribute("agent")),null!=B.getAttribute("type")&&(v=B.getAttribute("type")))}catch(E){}EditorUi.logError("Checksum "+
-l+" in "+q,null,this.getMode()+"."+H,"user_"+J+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+D+"-patches_"+k.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=u?"-expected_"+u:"")+(null!=x?"-current_"+x:"")+(null!=z?"-rev_"+this.ui.hashValue(z):"")+(null!=n?"-latest_"+n:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+r)+("-latestAgent_"+t)+("-latestType_"+v));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+H,action:q,label:"user_"+
-J+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+D+"-patches_"+k.length+"-size_"+this.getSize()})}catch(E){}}),function(){})}catch(f){}};
-DrawioFile.prototype.sendErrorReport=function(b,k,m,g){try{var q=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),u=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),x=this.getCurrentUser(),z=null!=x?this.ui.hashValue(x.id):"unknown",F=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",J=this.getTitle(),H=J.lastIndexOf(".");x="xml";0<H&&(x=J.substring(H));var D=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+
+l+" in "+q,null,this.getMode()+"."+H,"user_"+I+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+D+"-patches_"+k.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=u?"-expected_"+u:"")+(null!=x?"-current_"+x:"")+(null!=z?"-rev_"+this.ui.hashValue(z):"")+(null!=n?"-latest_"+n:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+r)+("-latestAgent_"+t)+("-latestType_"+v));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+H,action:q,label:"user_"+
+I+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+D+"-patches_"+k.length+"-size_"+this.getSize()})}catch(E){}}),function(){})}catch(f){}};
+DrawioFile.prototype.sendErrorReport=function(b,k,m,g){try{var q=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),u=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),x=this.getCurrentUser(),z=null!=x?this.ui.hashValue(x.id):"unknown",F=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",I=this.getTitle(),H=I.lastIndexOf(".");x="xml";0<H&&(x=I.substring(H));var D=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+
":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+x+")\nUser="+z+F+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=k?"\n\n"+k:
"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+D+"\n\nShadow:\n"+q+"\n\nData:\n"+u,g)}catch(c){}};
DrawioFile.prototype.reloadFile=function(b,k){try{this.stats.fileReloaded++;var m=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),g=this.ui.editor.graph,q=g.getSelectionCells(),u=g.getViewState(),x=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(z){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[m],"viewState",[u],"latestFile",z);null!=z?(this.ui.replaceFileData(z.getData(),
[m]),this.ui.restoreViewState(x,u,q),this.setDescriptor(z.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var F=this.ui.getCurrentFile();null!=F&&(F.stats=this.stats,F.patch([m]),F.fileChanged());this.ui.restoreViewState(x,u,q);null!=b&&b()}else null!=k&&k(this.ui.fileLoadedError)}),!0))}),k)}catch(z){null!=k&&k(z)}};
DrawioFile.prototype.copyFile=function(b,k){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var k=!0;if(null!=b)for(var m=0;m<b.length&&k;m++)k=k&&mxUtils.isEmptyObject(b[m]);return k};
-DrawioFile.prototype.patch=function(b,k,m,g){if(null!=b){EditorUi.debug("DrawioFile.patch",[this],"patches",b,"undoable",m,"realtime",this.isRealtime(),"modified",this.isModified());var q=this.ui.editor.undoManager,u=q.history.slice(),x=q.indexOfNextAdd,z=this.ui.editor.graph;z.container.style.visibility="hidden";var F=this.changeListenerEnabled;this.changeListenerEnabled=m;var J=z.foldingEnabled,H=z.mathEnabled,D=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);
+DrawioFile.prototype.patch=function(b,k,m,g){if(null!=b){EditorUi.debug("DrawioFile.patch",[this],"patches",b,"undoable",m,"realtime",this.isRealtime(),"modified",this.isModified());var q=this.ui.editor.undoManager,u=q.history.slice(),x=q.indexOfNextAdd,z=this.ui.editor.graph;z.container.style.visibility="hidden";var F=this.changeListenerEnabled;this.changeListenerEnabled=m;var I=z.foldingEnabled,H=z.mathEnabled,D=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);
var c=z.cellRenderer.redraw;z.cellRenderer.redraw=function(v){v.view.graph.isEditing(v.cell)&&(v.view.graph.scrollCellToVisible(v.cell),v.view.graph.cellEditor.resize());c.apply(this,arguments)};z.model.beginUpdate();try{if(m){for(var f=this.ui.pages.slice(),l=this.ui.currentPage,n=this.ui.applyPatches(this.ui.pages,b,!0,k,this.isModified()),r=0;r<n.length;r++){var t=mxUtils.indexOf(this.ui.pages,n[r]);0>t?this.ui.insertPage(n[r],Math.min(r,this.ui.pages.length)):this.ui.movePage(t,r)}for(r=0;r<f.length;r++)0>
mxUtils.indexOf(n,f[r])&&this.ui.removePage(f[r]);0<=mxUtils.indexOf(this.ui.pages,l)&&this.ui.selectPage(l,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,k,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);z.checkDefaultParent()}finally{z.container.style.visibility="",z.model.endUpdate(),z.cellRenderer.redraw=c,this.changeListenerEnabled=F,m||(q.history=
-u,q.indexOfNextAdd=x,q.fireEvent(new mxEventObject(mxEvent.CLEAR))),q=D!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),(u=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&H!=z.mathEnabled?(this.ui.editor.updateGraphComponents(),z.refresh()):q?z.refresh():u&&(J!=z.foldingEnabled?z.view.revalidate():z.view.validate(),z.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!g&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?
+u,q.indexOfNextAdd=x,q.fireEvent(new mxEventObject(mxEvent.CLEAR))),q=D!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),(u=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&H!=z.mathEnabled?(this.ui.editor.updateGraphComponents(),z.refresh()):q?z.refresh():u&&(I!=z.foldingEnabled?z.view.revalidate():z.view.validate(),z.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!g&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?
this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",k,"undoable",m)}return b};
DrawioFile.prototype.loadFonts=function(b){if(this.ui.getCurrentFile()==this&&/(\.svg)$/i.test(this.getTitle())&&this.ui.getSvgFileProperties(this.ui.fileNode).embedFonts){var k=null,m=!1,g=function(){m||(m=!0,window.clearTimeout(k),b())};k=window.setTimeout(g,this.loadFontsTimeout);try{this.ui.editor.loadFonts(mxUtils.bind(this,function(){this.ui.editor.embedExtFonts(g)}))}catch(q){g()}}else b()};
DrawioFile.prototype.save=function(b,k,m,g,q,u){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",g,"overwrite",q,"manual",u,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!q&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else{this.clearAutosave();var x=mxUtils.bind(this,function(){try{this.updateFileData(),null!=k&&k()}catch(z){if(null!=
@@ -13096,8 +13097,8 @@ DrawioFile.prototype.compressionChanged=function(b){var k=null!=this.ownPages?th
DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=new Date;this.setModified(!0);EditorUi.debug("DrawioFile.fileChanged",[this],"autosaveDelay",this.autosaveDelay,"autosave",this.isAutosave(),"saving",this.savingFile);this.isAutosave()?(null!=this.savingStatusKey&&this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"...")})),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),
this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(k){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(k){this.handleFileError(k)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};
DrawioFile.prototype.createSecret=function(b){var k=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(k,mxUtils.bind(this,function(m){EditorUi.debug("DrawioFile.createSecret",[this],"secret",k,"token",m);b(k,m)}),mxUtils.bind(this,function(){b(k)})):b(k)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};
-DrawioFile.prototype.fileSaved=function(b,k,m,g,q,u,x){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;u=null!=u?u:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(u),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=m&&m()):this.sync.fileSaved(u,k,m,g,q,x)}catch(J){this.invalidChecksum=
-this.inConflictState=!0;this.descriptorChanged();null!=g&&g(J);try{var z=this.getCurrentUser(),F=null!=z?z.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),F,J)}catch(H){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[k],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(J){this.descriptorChanged(),null!=g&&g(J)}};
+DrawioFile.prototype.fileSaved=function(b,k,m,g,q,u,x){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;u=null!=u?u:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(u),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=m&&m()):this.sync.fileSaved(u,k,m,g,q,x)}catch(I){this.invalidChecksum=
+this.inConflictState=!0;this.descriptorChanged();null!=g&&g(I);try{var z=this.getCurrentUser(),F=null!=z?z.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),F,I)}catch(H){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[k],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(I){this.descriptorChanged(),null!=g&&g(I)}};
DrawioFile.prototype.autosave=function(b,k,m,g){null==this.lastAutosave&&(this.lastAutosave=Date.now());var q=Date.now()-this.lastAutosave<k?b:0;this.clearAutosave();var u=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==u&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",u,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var x=this.isAutosaveRevision();
x&&(this.lastAutosaveRevision=(new Date).getTime());this.save(x,mxUtils.bind(this,function(z){this.autosaveCompleted();null!=m&&m(z)}),mxUtils.bind(this,function(z){null!=g&&g(z)}))}else this.isModified()||this.ui.clearStatus(),null!=m&&m(null)}catch(z){null!=g&&g(z)}}),q);this.autosaveThread=u;EditorUi.debug("DrawioFile.autosave",[this],"thread",u,"delay",b,"maxDelay",k,"actualDelay",q,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};
DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};
@@ -13108,9 +13109,9 @@ DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototyp
LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,k,m,g,q){this.saveAs(this.title,k,m,g,q)};LocalFile.prototype.saveAs=function(b,k,m,g,q){this.saveFile(b,!1,k,m,null,g,q)};
LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,k){null==this.fileHandle?null!=k&&k({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,k)};
LocalFile.prototype.saveFile=function(b,k,m,g,q,u,x){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;var z=mxUtils.bind(this,function(H,D){var c=mxUtils.bind(this,function(){var f=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var l=this.getData();if(f){var n=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(r){H(r,l,f)}),D,this.ui.getCurrentFile()!=this?l:null,n.scale,n.border)}else H(l,
-l,f)});q||u?(q||this.updateFileData(),c()):this.loadFonts(mxUtils.bind(this,function(){this.updateFileData();c()}))}),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()});if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=!0;var J=mxUtils.bind(this,function(H,D){this.savingFile=!1;null!=D&&D.abort().then(function(){},function(){});null!=g&&g({error:H})});this.fileHandle.createWritable().then(mxUtils.bind(this,
+l,f)});q||u?(q||this.updateFileData(),c()):this.loadFonts(mxUtils.bind(this,function(){this.updateFileData();c()}))}),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()});if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=!0;var I=mxUtils.bind(this,function(H,D){this.savingFile=!1;null!=D&&D.abort().then(function(){},function(){});null!=g&&g({error:H})});this.fileHandle.createWritable().then(mxUtils.bind(this,
function(H){z(mxUtils.bind(this,function(D,c,f){this.saveDraft(c);this.fileHandle.getFile().then(mxUtils.bind(this,function(l){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[l],"conflict",this.desc.lastModified!=l.lastModified);x||this.desc.lastModified==l.lastModified?H.write(f?this.ui.base64ToBlob(D,"image/png"):D).then(mxUtils.bind(this,function(){H.close().then(mxUtils.bind(this,function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(n){try{var r=
-this.desc;this.savingFile=!1;this.desc=n;this.fileSaved(c,r,F,J);this.removeDraft()}catch(t){J(t)}}),J)}),J)}),mxUtils.bind(this,function(n){J(n,H)})):(this.inConflictState=!0,J(null,H))}),mxUtils.bind(this,function(l){this.invalidFileHandle=!0;J(l,H)}))}),mxUtils.bind(this,function(D){J(D,H)}))}),J)}}else z(mxUtils.bind(this,function(H,D,c){this.ui.isOfflineApp()||this.ui.isLocalFileSave()?this.ui.doSaveLocalFile(H,b,c?"image/png":"text/xml",c):H.length<MAX_REQUEST_SIZE?(D=b.lastIndexOf("."),D=0<
+this.desc;this.savingFile=!1;this.desc=n;this.fileSaved(c,r,F,I);this.removeDraft()}catch(t){I(t)}}),I)}),I)}),mxUtils.bind(this,function(n){I(n,H)})):(this.inConflictState=!0,I(null,H))}),mxUtils.bind(this,function(l){this.invalidFileHandle=!0;I(l,H)}))}),mxUtils.bind(this,function(D){I(D,H)}))}),I)}}else z(mxUtils.bind(this,function(H,D,c){this.ui.isOfflineApp()||this.ui.isLocalFileSave()?this.ui.doSaveLocalFile(H,b,c?"image/png":"text/xml",c):H.length<MAX_REQUEST_SIZE?(D=b.lastIndexOf("."),D=0<
D?b.substring(D+1):"xml",(new mxXmlRequest(SAVE_URL,"format="+D+"&xml="+encodeURIComponent(H)+"&filename="+encodeURIComponent(b)+(c?"&binary=1":""))).simulate(document,"_blank")):this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(H)}));F()}),g)};LocalFile.prototype.rename=function(b,k,m){this.title=b;this.descriptorChanged();null!=k&&k()};LocalLibrary=function(b,k,m){LocalFile.call(this,b,k,m)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,k,m){this.saveFile(b,!1,k,m)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,k,m){DrawioFile.call(this,b,k);this.title=m;this.etag=this.getEtag(k)};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.getEtag=function(b){return this.ui.hashValue(null!=b?b:"")};StorageFile.prototype.autosaveDelay=500;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.maxRetries=5;StorageFile.prototype.type="F";StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isSyncSupported=function(){return!0};
StorageFile.prototype.isPolling=function(){return this.isSyncSupported()};StorageFile.prototype.getPollingInterval=function(){return 1E4};StorageFile.prototype.loadDescriptor=function(b,k){this.getLatestVersionId(b,k)};StorageFile.prototype.getLatestVersionId=function(b,k){StorageFile.getFileContent(this.ui,this.title,mxUtils.bind(this,function(m){b(this.getEtag(m))}),k)};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};
StorageFile.prototype.getTitle=function(){return this.title};StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.getDescriptor=function(){return this.etag};StorageFile.prototype.setDescriptor=function(b){this.etag=b};StorageFile.prototype.getDescriptorEtag=function(b){return b};StorageFile.prototype.save=function(b,k,m){DrawioFile.prototype.save.apply(this,[!1,mxUtils.bind(this,function(){this.saveFile(this.getTitle(),!1,k,m)}),m])};
@@ -13132,44 +13133,44 @@ var StorageDialog=function(b,k,m){function g(D,c,f,l,n,r){function t(){mxEvent.a
(b.setMode(f,!0),k())})}z++;++x>m&&(mxUtils.br(F),x=1);var v=document.createElement("a");v.style.overflow="hidden";v.style.display="inline-block";v.className="geBaseButton";v.style.boxSizing="border-box";v.style.fontSize="11px";v.style.position="relative";v.style.margin="4px";v.style.marginTop="8px";v.style.marginBottom="0px";v.style.padding="8px 10px 8px 10px";v.style.width="88px";v.style.height="100px";v.style.whiteSpace="nowrap";v.setAttribute("title",c);var B=document.createElement("div");B.style.textOverflow=
"ellipsis";B.style.overflow="hidden";B.style.position="absolute";B.style.bottom="8px";B.style.left="0px";B.style.right="0px";mxUtils.write(B,c);v.appendChild(B);if(null!=D){var E=document.createElement("img");E.setAttribute("src",D);E.setAttribute("border","0");E.setAttribute("align","absmiddle");E.style.width="60px";E.style.height="60px";E.style.paddingBottom="6px";v.appendChild(E)}else B.style.paddingTop="5px",B.style.whiteSpace="normal",mxClient.IS_IOS?(v.style.padding="0px 10px 20px 10px",v.style.top=
"6px"):mxClient.IS_FF&&(B.style.paddingTop="0px",B.style.marginTop="-2px");if(null!=n)for(D=0;D<n.length;D++)mxUtils.br(B),mxUtils.write(B,n[D]);if(null!=l&&null==b[l]){E.style.visibility="hidden";mxUtils.setOpacity(B,10);var K=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});K.spin(v);var C=window.setTimeout(function(){null==b[l]&&(K.stop(),v.style.display="none")},3E4);b.addListener("clientLoaded",
-mxUtils.bind(this,function(R,M){null!=b[l]&&M.getProperty("client")==b[l]&&(window.clearTimeout(C),mxUtils.setOpacity(B,100),E.style.visibility="",K.stop(),t(),"drive"==l&&null!=J.parentNode&&J.parentNode.removeChild(J))}))}else t();F.appendChild(v)}m=null!=m?m:2;var q=document.createElement("div");q.style.textAlign="center";q.style.whiteSpace="nowrap";q.style.paddingTop="0px";q.style.paddingBottom="20px";var u=document.createElement("div");u.style.border="1px solid #d3d3d3";u.style.borderWidth="1px 0px 1px 0px";
-u.style.padding="10px 0px 20px 0px";var x=0,z=0,F=document.createElement("div");F.style.paddingTop="2px";u.appendChild(F);var J=document.createElement("p"),H=document.createElement("p");H.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(H,mxResources.get("saveDiagramsTo")+":");q.appendChild(H);q.appendChild(u);x=0;"function"===typeof window.DriveClient&&g(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&
+mxUtils.bind(this,function(R,M){null!=b[l]&&M.getProperty("client")==b[l]&&(window.clearTimeout(C),mxUtils.setOpacity(B,100),E.style.visibility="",K.stop(),t(),"drive"==l&&null!=I.parentNode&&I.parentNode.removeChild(I))}))}else t();F.appendChild(v)}m=null!=m?m:2;var q=document.createElement("div");q.style.textAlign="center";q.style.whiteSpace="nowrap";q.style.paddingTop="0px";q.style.paddingBottom="20px";var u=document.createElement("div");u.style.border="1px solid #d3d3d3";u.style.borderWidth="1px 0px 1px 0px";
+u.style.padding="10px 0px 20px 0px";var x=0,z=0,F=document.createElement("div");F.style.paddingTop="2px";u.appendChild(F);var I=document.createElement("p"),H=document.createElement("p");H.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(H,mxResources.get("saveDiagramsTo")+":");q.appendChild(H);q.appendChild(u);x=0;"function"===typeof window.DriveClient&&g(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&
g(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365");"1"!=urlParams.noDevice&&g(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||g(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.OneDriveClient&&g(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");null!=b.gitHub&&g(IMAGE_PATH+"/github-logo.svg",
mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=b.gitLab&&g(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");u=document.createElement("span");u.style.position="absolute";u.style.cursor="pointer";u.style.bottom="27px";u.style.color="gray";u.style.userSelect="none";u.style.textAlign="center";u.style.left="50%";mxUtils.setPrefixedStyle(u.style,"transform","translate(-50%,0)");mxUtils.write(u,mxResources.get("decideLater"));q.appendChild(u);mxEvent.addListener(u,
-"click",function(){b.hideDialog();var D=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=D});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(J.style.padding="7px",J.style.fontSize="9pt",J.style.marginTop="-14px",J.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://www.drawio.com/doc/faq/google-drive-connection-problems" target="_blank"><img border="0" src="'+
-mxGraph.prototype.warningImage.src+'" align="absmiddle" style="margin-top:-4px"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",q.appendChild(J))},5E3);this.container=q},SplashDialog=function(b){var k=document.createElement("div");k.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var m=b.addLanguageMenu(k,!1,"28px");null!=m&&(m.style.bottom="24px")}var g=document.createElement("img");g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width=
+"click",function(){b.hideDialog();var D=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=D});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(I.style.padding="7px",I.style.fontSize="9pt",I.style.marginTop="-14px",I.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://www.drawio.com/doc/faq/google-drive-connection-problems" target="_blank"><img border="0" src="'+
+mxGraph.prototype.warningImage.src+'" align="absmiddle" style="margin-top:-4px"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",q.appendChild(I))},5E3);this.container=q},SplashDialog=function(b){var k=document.createElement("div");k.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var m=b.addLanguageMenu(k,!1,"28px");null!=m&&(m.style.bottom="24px")}var g=document.createElement("img");g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width=
"32px";g.style.height="32px";g.style.marginRight="8px";g.style.marginTop="-4px";var q=document.createElement("div");q.style.margin="8px 0px 0px 0px";q.style.padding="18px 0px 24px 0px";m="";b.mode==App.MODE_GOOGLE?(g.src=IMAGE_PATH+"/google-drive-logo.svg",m=mxResources.get("googleDrive")):b.mode==App.MODE_DROPBOX?(g.src=IMAGE_PATH+"/dropbox-logo.svg",m=mxResources.get("dropbox")):b.mode==App.MODE_ONEDRIVE?(g.src=IMAGE_PATH+"/onedrive-logo.svg",m=mxResources.get("oneDrive")):b.mode==App.MODE_M365?
(g.src=IMAGE_PATH+"/onedrive-logo.svg",m=mxResources.get("m365")):b.mode==App.MODE_GITHUB?(g.src=IMAGE_PATH+"/github-logo.svg",m=mxResources.get("github")):b.mode==App.MODE_GITLAB?(g.src=IMAGE_PATH+"/gitlab-logo.svg",m=mxResources.get("gitlab")):b.mode==App.MODE_BROWSER?(g.src=IMAGE_PATH+"/osa_database.png",m=mxResources.get("browser")):b.mode==App.MODE_TRELLO?(g.src=IMAGE_PATH+"/trello-logo.svg",m=mxResources.get("trello")):(g.src=IMAGE_PATH+"/osa_drive-harddisk.png",q.style.paddingBottom="10px",
q.style.paddingTop="30px",m=mxResources.get("device"));var u=document.createElement("button");u.className="geBigButton";u.style.marginBottom="8px";u.style.fontSize="18px";u.style.padding="10px";u.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)q.style.padding="42px 0px 10px 0px",u.style.marginBottom="12px";else{q.style.border="1px solid #d3d3d3";q.style.borderWidth="1px 0px 1px 0px";var x=document.createElement("table"),z=document.createElement("tbody"),F=document.createElement("tr"),
-J=document.createElement("td"),H=document.createElement("td");x.setAttribute("align","center");J.appendChild(g);g=document.createElement("div");g.style.fontSize="22px";g.style.paddingBottom="6px";g.style.color="gray";mxUtils.write(g,m);H.style.textAlign="left";H.appendChild(g);F.appendChild(J);F.appendChild(H);z.appendChild(F);x.appendChild(z);k.appendChild(x);m=document.createElement("span");m.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";
+I=document.createElement("td"),H=document.createElement("td");x.setAttribute("align","center");I.appendChild(g);g=document.createElement("div");g.style.fontSize="22px";g.style.paddingBottom="6px";g.style.color="gray";mxUtils.write(g,m);H.style.textAlign="left";H.appendChild(g);F.appendChild(I);F.appendChild(H);z.appendChild(F);x.appendChild(z);k.appendChild(x);m=document.createElement("span");m.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";
mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,0)");mxUtils.write(m,mxResources.get("changeStorage"));mxEvent.addListener(m,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});k.appendChild(m)}mxUtils.write(u,mxResources.get("createNewDiagram"));mxEvent.addListener(u,"click",function(){b.hideDialog();b.actions.get("new").funct()});q.appendChild(u);mxUtils.br(q);u=document.createElement("button");u.className="geBigButton";u.style.marginBottom="22px";u.style.fontSize=
"18px";u.style.padding="10px";u.style.width="340px";mxUtils.write(u,mxResources.get("openExistingDiagram"));mxEvent.addListener(u,"click",function(){b.actions.get("open").funct()});q.appendChild(u);b.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):b.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):b.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):b.mode==App.MODE_GITHUB?mxResources.get("github"):b.mode==App.MODE_GITLAB?mxResources.get("gitlab"):b.mode==App.MODE_TRELLO?mxResources.get("trello"):
b.mode==App.MODE_DEVICE?mxResources.get("device"):b.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp)if(m=function(f){u.style.marginBottom="24px";var l=document.createElement("a");l.style.display="inline-block";l.style.color="gray";l.style.cursor="pointer";l.style.marginTop="6px";mxUtils.write(l,mxResources.get("signOut"));u.style.marginBottom="16px";q.style.paddingBottom="18px";mxEvent.addListener(l,"click",function(){b.confirm(mxResources.get("areYouSure"),
function(){f()})});q.appendChild(l)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var D=b.drive.getUsersList();if(0<D.length){g=document.createElement("span");g.style.marginTop="6px";mxUtils.write(g,mxResources.get("changeUser")+":");u.style.marginBottom="16px";q.style.paddingBottom="18px";q.appendChild(g);var c=document.createElement("select");c.style.marginLeft="4px";c.style.width="140px";for(m=0;m<D.length;m++)x=document.createElement("option"),mxUtils.write(x,D[m].displayName),x.value=m,c.appendChild(x),
x=document.createElement("option"),x.innerHTML="&nbsp;&nbsp;&nbsp;",mxUtils.write(x,"<"+D[m].email+">"),x.setAttribute("disabled","disabled"),c.appendChild(x);x=document.createElement("option");mxUtils.write(x,mxResources.get("addAccount"));x.value=D.length;c.appendChild(x);mxEvent.addListener(c,"change",function(){var f=c.value,l=D.length!=f;l&&b.drive.setUser(D[f]);b.drive.authorize(l,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(n){b.handleError(n,null,function(){b.hideDialog();
b.showSplash()})},!0)});q.appendChild(c)}else m(function(){b.drive.logout()})}else b.mode!=App.MODE_ONEDRIVE||null==b.oneDrive||b.oneDrive.noLogout?b.mode==App.MODE_GITHUB&&null!=b.gitHub?m(function(){b.gitHub.logout();b.openLink("https://www.github.com/logout")}):b.mode==App.MODE_GITLAB&&null!=b.gitLab?m(function(){b.gitLab.logout();var f=document.createElement("form");f.setAttribute("method","post");f.setAttribute("action",DRAWIO_GITLAB_URL+"/users/sign_out");f.setAttribute("target","_blank");document.body.appendChild(f);
-f.submit();f.parentNode.removeChild(f)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&m(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&m(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):m(function(){b.oneDrive.logout()});k.appendChild(q);this.container=k},EmbedDialog=function(b,k,m,g,q,u,x,z,F,J){g=document.createElement("div");g.style.height="100%";g.style.display="flex";g.style.flexDirection="column";var H=EmbedDialog.maxSize,
+f.submit();f.parentNode.removeChild(f)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&m(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&m(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):m(function(){b.oneDrive.logout()});k.appendChild(q);this.container=k},EmbedDialog=function(b,k,m,g,q,u,x,z,F,I){g=document.createElement("div");g.style.height="100%";g.style.display="flex";g.style.flexDirection="column";var H=EmbedDialog.maxSize,
D=/^https?:\/\//.test(k)||/^mailto:\/\//.test(k);x=document.createElement("div");x.style.flexShrink="0";x.style.position="relative";null!=u?mxUtils.write(x,u):mxUtils.write(x,mxResources.get(k.length<H?D?"link":"mainEmbedNotice":"preview")+":");u=document.createElement("span");u.style.cssFloat="right";u.style.color="gray";mxUtils.write(u,b.formatFileSize(k.length));x.appendChild(u);g.appendChild(x);var c=document.createElement("textarea");c.setAttribute("autocomplete","off");c.setAttribute("autocorrect",
"off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");c.style.fontFamily="monospace";c.style.wordBreak="break-all";c.style.marginTop="10px";c.style.resize="none";c.style.flex="1";c.style.width="100%";c.style.boxSizing="border-box";c.value=mxResources.get("updatingDocument");g.appendChild(c);this.init=function(){window.setTimeout(function(){k.length<H?(c.value=k,c.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",
!1,null)):(c.setAttribute("readonly","true"),c.value=mxResources.get("tooLargeUseDownload"))},0)};u=document.createElement("div");u.style.flexShrink="0";u.style.textAlign="right";u.style.paddingTop="14px";u.style.whiteSpace="nowrap";x=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&D&&(x=mxUtils.button(null!=z?z:mxResources.get(k.length<H?"preview":"openInNewWindow"),function(){var f=k.length<H?c.value:k;if(null!=q)q(f);else if(D)try{var l=b.openLink(f);null!=l&&(null==m||
0<m)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=l&&null!=l.location.href&&l.location.href.substring(0,8)!=f.substring(0,8)&&(l.close(),b.handleError({message:mxResources.get("drawingTooLarge")}))}catch(r){}}),m||500)}catch(r){b.handleError({message:r.message||mxResources.get("drawingTooLarge")})}else{var n=window.open();n=null!=n?n.document:null;null!=n?(n.writeln("<html><head><title>"+mxUtils.htmlEntities(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+("<iframe"==
-k.substring(0,7)?k:mxUtils.htmlEntities(k))+"</body></html>"),n.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),x.className="geBtn",u.appendChild(x));J||(z=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=F?F:"embed.txt","txt",k,"text/plain")}),z.className="geBtn",u.appendChild(z));!b.isOffline()&&k.length<H&&(z=mxUtils.button("",function(){try{var f="mailto:?subject="+encodeURIComponent(F||b.defaultFilename)+"&body="+encodeURIComponent(c.value);
-b.openLink(f)}catch(l){b.handleError({message:l.message||mxResources.get("drawingTooLarge")})}}),J=document.createElement("img"),J.className="geAdaptiveAsset",J.setAttribute("src",Editor.mailImage),J.setAttribute("width","18"),J.setAttribute("height","18"),J.setAttribute("border","0"),J.style.marginBottom="5px",z.appendChild(J),z.style.verticalAlign="bottom",z.style.paddingTop="4px",z.style.minWidth="46px",z.className="geBtn",u.appendChild(z));z=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});
-z.className="geBtn";u.appendChild(z);J=mxUtils.button(mxResources.get("copy"),function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});k.length<H?mxClient.IS_SF||null!=document.documentMode?z.className="geBtn gePrimaryBtn":(u.appendChild(J),J.className="geBtn gePrimaryBtn"):null!=x&&(u.appendChild(x),x.className="geBtn gePrimaryBtn");g.appendChild(u);
+k.substring(0,7)?k:mxUtils.htmlEntities(k))+"</body></html>"),n.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),x.className="geBtn",u.appendChild(x));I||(z=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=F?F:"embed.txt","txt",k,"text/plain")}),z.className="geBtn",u.appendChild(z));!b.isOffline()&&k.length<H&&(z=mxUtils.button("",function(){try{var f="mailto:?subject="+encodeURIComponent(F||b.defaultFilename)+"&body="+encodeURIComponent(c.value);
+b.openLink(f)}catch(l){b.handleError({message:l.message||mxResources.get("drawingTooLarge")})}}),I=document.createElement("img"),I.className="geAdaptiveAsset",I.setAttribute("src",Editor.mailImage),I.setAttribute("width","18"),I.setAttribute("height","18"),I.setAttribute("border","0"),I.style.marginBottom="5px",z.appendChild(I),z.style.verticalAlign="bottom",z.style.paddingTop="4px",z.style.minWidth="46px",z.className="geBtn",u.appendChild(z));z=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});
+z.className="geBtn";u.appendChild(z);I=mxUtils.button(mxResources.get("copy"),function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});k.length<H?mxClient.IS_SF||null!=document.documentMode?z.className="geBtn gePrimaryBtn":(u.appendChild(I),I.className="geBtn gePrimaryBtn"):null!=x&&(u.appendChild(x),x.className="geBtn gePrimaryBtn");g.appendChild(u);
this.container=g};EmbedDialog.showPreviewOption=!0;EmbedDialog.maxSize=5E5;
var BackgroundImageDialog=function(b,k,m,g,q){function u(){if(null==U||U==mxConstants.NONE)O.style.display="none",M.checked=!1;else{var V=mxUtils.getLightDarkColor(U);mxUtils.isLightDarkColor(U)&&V.light!=V.dark?O.style.background="linear-gradient(to right bottom, "+V.cssText+" 50%, "+mxUtils.invertLightDarkColor(V).cssText+" 50.3%)":(O.style.background="",O.style.backgroundColor=V.cssText);O.style.display="";M.checked=!0}}var x=document.createElement("div"),z=document.createElement("h3");mxUtils.write(z,
-mxResources.get("background"));x.appendChild(z);var F=null!=m&&null!=m.originalSrc;z=!1;var J=document.createElement("input");J.setAttribute("value","url");J.setAttribute("type","radio");J.setAttribute("name","geBackgroundImageDialogOption");var H=document.createElement("input");H.setAttribute("value","url");H.setAttribute("type","radio");H.setAttribute("name","geBackgroundImageDialogOption");var D=document.createElement("input");D.setAttribute("type","text");D.style.flex="1";D.style.minWidth="0";
+mxResources.get("background"));x.appendChild(z);var F=null!=m&&null!=m.originalSrc;z=!1;var I=document.createElement("input");I.setAttribute("value","url");I.setAttribute("type","radio");I.setAttribute("name","geBackgroundImageDialogOption");var H=document.createElement("input");H.setAttribute("value","url");H.setAttribute("type","radio");H.setAttribute("name","geBackgroundImageDialogOption");var D=document.createElement("input");D.setAttribute("type","text");D.style.flex="1";D.style.minWidth="0";
D.value=F||null==m?"":m.src;var c=document.createElement("select");c.style.flex="1";c.style.minWidth="0";c.style.marginLeft="0";if(null!=b.pages)for(var f=0;f<b.pages.length;f++){var l=document.createElement("option");mxUtils.write(l,b.pages[f].getName()||mxResources.get("pageWithNumber",[f+1]));l.setAttribute("value","data:page/id,"+b.pages[f].getId());b.pages[f]==b.currentPage&&l.setAttribute("disabled","disabled");null!=m&&m.originalSrc==l.getAttribute("value")&&(l.setAttribute("selected","selected"),
-z=!0);c.appendChild(l)}F||null!=b.pages&&1!=b.pages.length||(J.style.display="none",H.style.display="none",c.style.display="none");var n=document.createElement("option"),r=!1,t=!1,v=function(V,fa){r||null!=V&&t||(H.checked?null!=fa&&fa(n.selected?null:c.value):""==D.value||b.isOffline()?(C.value="",R.value="",null!=fa&&fa("")):(D.value=mxUtils.trim(D.value),b.loadImage(D.value,function(y){C.value=y.width;R.value=y.height;null!=fa&&fa(D.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),
-mxResources.get("ok"));C.value="";R.value="";null!=fa&&fa(null)})))},B=mxUtils.bind(this,function(V){b.importFiles(V,0,0,b.maxBackgroundSize,function(fa,y,d,p,A,G){D.value=fa;v();D.focus()},function(){},function(fa){return"image/"==fa.type.substring(0,6)},function(fa){for(var y=0;y<fa.length;y++)fa[y]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){F?c.focus():D.focus();mxEvent.addListener(c,"focus",function(){J.removeAttribute("checked");H.setAttribute("checked","checked");
-H.checked=!0});mxEvent.addListener(D,"focus",function(){H.removeAttribute("checked");J.setAttribute("checked","checked");J.checked=!0});if(Graph.fileSupport){D.setAttribute("placeholder",mxResources.get("dragImagesHere"));var V=x.parentNode,fa=null;mxEvent.addListener(V,"dragleave",function(y){null!=fa&&(fa.parentNode.removeChild(fa),fa=null);y.stopPropagation();y.preventDefault()});mxEvent.addListener(V,"dragover",mxUtils.bind(this,function(y){null==fa&&(fa=b.highlightElement(V));y.stopPropagation();
+z=!0);c.appendChild(l)}F||null!=b.pages&&1!=b.pages.length||(I.style.display="none",H.style.display="none",c.style.display="none");var n=document.createElement("option"),r=!1,t=!1,v=function(V,fa){r||null!=V&&t||(H.checked?null!=fa&&fa(n.selected?null:c.value):""==D.value||b.isOffline()?(C.value="",R.value="",null!=fa&&fa("")):(D.value=mxUtils.trim(D.value),b.loadImage(D.value,function(y){C.value=y.width;R.value=y.height;null!=fa&&fa(D.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),
+mxResources.get("ok"));C.value="";R.value="";null!=fa&&fa(null)})))},B=mxUtils.bind(this,function(V){b.importFiles(V,0,0,b.maxBackgroundSize,function(fa,y,d,p,A,G){D.value=fa;v();D.focus()},function(){},function(fa){return"image/"==fa.type.substring(0,6)},function(fa){for(var y=0;y<fa.length;y++)fa[y]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){F?c.focus():D.focus();mxEvent.addListener(c,"focus",function(){I.removeAttribute("checked");H.setAttribute("checked","checked");
+H.checked=!0});mxEvent.addListener(D,"focus",function(){H.removeAttribute("checked");I.setAttribute("checked","checked");I.checked=!0});if(Graph.fileSupport){D.setAttribute("placeholder",mxResources.get("dragImagesHere"));var V=x.parentNode,fa=null;mxEvent.addListener(V,"dragleave",function(y){null!=fa&&(fa.parentNode.removeChild(fa),fa=null);y.stopPropagation();y.preventDefault()});mxEvent.addListener(V,"dragover",mxUtils.bind(this,function(y){null==fa&&(fa=b.highlightElement(V));y.stopPropagation();
y.preventDefault()}));mxEvent.addListener(V,"drop",mxUtils.bind(this,function(y){null!=fa&&(fa.parentNode.removeChild(fa),fa=null);if(0<y.dataTransfer.files.length)B(y.dataTransfer.files);else if(0<=mxUtils.indexOf(y.dataTransfer.types,"text/uri-list")){var d=y.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)&&(D.value=decodeURIComponent(d),v())}y.stopPropagation();y.preventDefault()}),!1)}};f=document.createElement("div");f.className="geDialogSection";l=document.createElement("div");
-l.className="geDialogCheckRow";l.appendChild(J);l.appendChild(D);f.appendChild(l);l=document.createElement("div");l.className="geDialogInlineFields";l.style.marginTop="6px";l.style.paddingLeft="24px";var E=document.createElement("div");E.className="geDialogInlineField";var K=document.createElement("label");mxUtils.write(K,mxResources.get("width"));E.appendChild(K);var C=document.createElement("input");C.setAttribute("type","text");C.value=null==m||F?"":m.width;E.appendChild(C);l.appendChild(E);E=
+l.className="geDialogCheckRow";l.appendChild(I);l.appendChild(D);f.appendChild(l);l=document.createElement("div");l.className="geDialogInlineFields";l.style.marginTop="6px";l.style.paddingLeft="24px";var E=document.createElement("div");E.className="geDialogInlineField";var K=document.createElement("label");mxUtils.write(K,mxResources.get("width"));E.appendChild(K);var C=document.createElement("input");C.setAttribute("type","text");C.value=null==m||F?"":m.width;E.appendChild(C);l.appendChild(E);E=
document.createElement("div");E.className="geDialogInlineField";K=document.createElement("label");mxUtils.write(K,mxResources.get("height"));E.appendChild(K);var R=document.createElement("input");R.setAttribute("type","text");R.value=null==m||F?"":m.height;E.appendChild(R);l.appendChild(E);f.appendChild(l);mxEvent.addListener(D,"change",v);ImageDialog.filePicked=function(V){V.action==google.picker.Action.PICKED&&null!=V.docs[0].thumbnails&&(V=V.docs[0].thumbnails[V.docs[0].thumbnails.length-1],null!=
-V&&(D.value=V.url,v()));D.focus()};m=document.createElement("div");m.className="geDialogCheckRow";m.style.marginTop="6px";m.appendChild(H);m.appendChild(c);f.appendChild(m);x.appendChild(f);F?(H.setAttribute("checked","checked"),H.checked=!0):(J.setAttribute("checked","checked"),J.checked=!0);!z&&H.checked&&(mxUtils.write(n,mxResources.get("pageNotFound")),n.setAttribute("disabled","disabled"),n.setAttribute("selected","selected"),n.setAttribute("value","pageNotFound"),c.appendChild(n),mxEvent.addListener(c,
+V&&(D.value=V.url,v()));D.focus()};m=document.createElement("div");m.className="geDialogCheckRow";m.style.marginTop="6px";m.appendChild(H);m.appendChild(c);f.appendChild(m);x.appendChild(f);F?(H.setAttribute("checked","checked"),H.checked=!0):(I.setAttribute("checked","checked"),I.checked=!0);!z&&H.checked&&(mxUtils.write(n,mxResources.get("pageNotFound")),n.setAttribute("disabled","disabled"),n.setAttribute("selected","selected"),n.setAttribute("value","pageNotFound"),c.appendChild(n),mxEvent.addListener(c,
"change",function(){null==n.parentNode||n.selected||n.parentNode.removeChild(n)}));m=document.createElement("div");m.className="geDialogSection";m.style.display=q?"":"none";q=document.createElement("div");q.className="geDialogCheckRow";q.style.cursor="default";var M=document.createElement("input");M.setAttribute("type","checkbox");M.defaultChecked=g!=mxConstants.NONE&&null!=g;M.checked=M.defaultChecked;q.appendChild(M);z=document.createElement("label");mxUtils.write(z,mxResources.get("fillColor"));
q.appendChild(z);var O=document.createElement("button");O.style.width="36px";O.style.height="18px";O.style.cursor="pointer";O.style.marginLeft="10px";O.style.backgroundPosition="center center";O.style.backgroundRepeat="no-repeat";O.className="geColorBtn";var U=g;u();mxEvent.addListener(q,"click",function(V){mxEvent.getSource(V)!=M&&(M.checked=!M.checked);U=M.checked?b.editor.graph.defaultPageBackgroundColor:null;u()});mxEvent.addListener(O,"click",function(V){b.pickColor(U||"none",function(fa){U=
-fa;u()});mxEvent.consume(V)});q.appendChild(O);m.appendChild(q);x.appendChild(m);g=document.createElement("div");g.style.marginTop="34px";g.style.textAlign="right";q=mxUtils.button(mxResources.get("cancel"),function(){r=!0;b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&g.appendChild(q);m=mxUtils.button(mxResources.get("reset"),function(){D.value="";C.value="";R.value="";J.checked=!0;U=mxConstants.NONE;u();r=!1});mxEvent.addGestureListeners(m,function(){r=!0});m.className="geBtn";g.appendChild(m);
+fa;u()});mxEvent.consume(V)});q.appendChild(O);m.appendChild(q);x.appendChild(m);g=document.createElement("div");g.style.marginTop="34px";g.style.textAlign="right";q=mxUtils.button(mxResources.get("cancel"),function(){r=!0;b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&g.appendChild(q);m=mxUtils.button(mxResources.get("reset"),function(){D.value="";C.value="";R.value="";I.checked=!0;U=mxConstants.NONE;u();r=!1});mxEvent.addGestureListeners(m,function(){r=!0});m.className="geBtn";g.appendChild(m);
if(Graph.fileSupport){var T=document.createElement("input");T.setAttribute("multiple","multiple");T.setAttribute("type","file");mxEvent.addListener(T,"change",function(V){null!=T.files&&(B(T.files),T.type="",T.type="file",T.value="")});T.style.display="none";x.appendChild(T);m=mxUtils.button(mxResources.get("open"),function(){T.click()});m.className="geBtn";g.appendChild(m)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();v(null,function(V){k(""!=V&&null!=V?new mxImage(V,
C.value,R.value):null,null==V,U)})});mxEvent.addGestureListeners(applyBtn,function(){t=!0});applyBtn.className="geBtn gePrimaryBtn";g.appendChild(applyBtn);b.editor.cancelFirst||g.appendChild(q);x.appendChild(g);this.container=x},ParseDialog=function(b,k,m){function g(f,l,n){if("plantUmlDiagram"==l||"plantUmlImage"==l){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var r=mxUtils.bind(this,function(V,fa){b.spinner.stop();b.hideDialog();var y=b.editor.graph;y.getModel().beginUpdate();
try{var d=b.importXml(V,Math.max(u.x,20),Math.max(u.y,20),!0,null,null,!0);y.setSelectionCells(d)}finally{y.getModel().endUpdate()}y.scrollCellToVisible(y.getSelectionCell());b.showPlantUmlWarnings(fa)});n=mxUtils.bind(this,function(V){b.spinner.stop();b.handleError(V)});"plantUmlImage"==l?b.parsePlantUmlImage(f,r,n):b.parsePlantUmlDiagram(f,null,mxUtils.bind(this,function(V,fa){r(mxPlantUmlToDrawio.wrapGroup(V,f,null),fa)}),n)}}else if("mermaid"==l||"mermaidImage"==l){if(b.spinner.spin(document.body,
@@ -13184,67 +13185,67 @@ K.vertex=!0,C=M.getPreferredSizeForCell(K),null!=C&&K.geometry.width<C.width&&(K
function(V){var fa=U[V];null==fa&&(fa=new mxCell(V,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),fa.vertex=!0,U[V]=fa,B.push(fa));return fa};v=f.split("\n");var U={};B=[];for(n=0;n<v.length;n++)if(";"!=v[n].charAt(0)){var T=v[n].split("->");2<=T.length&&(R=M(T[0]),O=M(T[T.length-1]),T=new mxCell(2<T.length?T[1]:"",new mxGeometry),T.edge=!0,T.geometry.relative=!0,R.insertEdge(T,!0),O.insertEdge(T,!1),B.push(T))}if(0<B.length){v=document.createElement("div");v.style.visibility="hidden";document.body.appendChild(v);
M=new Graph(v);M.getModel().beginUpdate();try{B=M.importCells(B);for(n=0;n<B.length;n++)M.getModel().isVertex(B[n])&&(C=M.getPreferredSizeForCell(B[n]),B[n].geometry.width=Math.max(B[n].geometry.width,C.width),B[n].geometry.height=Math.max(B[n].geometry.height,C.height));n=!0;"horizontalFlow"==l||"verticalFlow"==l?((new mxHierarchicalLayout(M,"horizontalFlow"==l?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(M.getDefaultParent(),B),n=!1):"circle"==l?(new mxCircleLayout(M)).execute(M.getDefaultParent()):
(E=new mxFastOrganicLayout(M),E.disableEdgeStyle=!1,E.forceConstant=180,E.execute(M.getDefaultParent()));n&&(K=new mxParallelEdgeLayout(M),K.spacing=30,K.execute(M.getDefaultParent()))}finally{M.getModel().endUpdate()}M.clearCellOverlays();C=[];b.editor.graph.getModel().beginUpdate();try{B=M.getModel().getChildren(M.getDefaultParent()),C=b.editor.graph.importCells(B,u.x,u.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",C))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(C);
-b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());M.destroy();v.parentNode.removeChild(v)}}}function q(){return"list"==J.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==J.value||"mermaidImage"==J.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==J.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":
-"plantUmlDiagram"==J.value||"plantUmlImage"==J.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var u=b.editor.graph.getFreeInsertPoint(),x=document.createElement("div");x.style.display="flex";x.style.flexDirection="column";x.style.height="100%";x.style.boxSizing="border-box";
-x.style.overflow="visible";var z=document.createElement("h3");mxUtils.write(z,k||mxResources.get("insert"));x.appendChild(z);var F=document.createElement("textarea");F.style.flex="1";F.style.minHeight="0";F.style.width="100%";F.style.boxSizing="border-box";F.style.resize="none";F.setAttribute("wrap","off");F.setAttribute("spellcheck","false");F.setAttribute("autocorrect","off");F.setAttribute("autocomplete","off");F.setAttribute("autocapitalize","off");var J=document.createElement("select");J.className=
-"geBtn";if("formatSql"==m||("mermaid"==m||"plantUml"==m)&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())J.style.display="none";k=document.createElement("option");k.setAttribute("value","list");mxUtils.write(k,mxResources.get("list"));"plantUml"!=m&&"mermaid"!=m&&J.appendChild(k);null!=m&&"fromText"!=m||k.setAttribute("selected","selected");k=document.createElement("option");k.setAttribute("value","table");mxUtils.write(k,mxResources.get("formatSql"));"formatSql"==m&&(J.appendChild(k),
-k.setAttribute("selected","selected"));"mermaid"==m&&(k=document.createElement("option"),k.setAttribute("value","mermaid"),k.setAttribute("selected","selected"),mxUtils.write(k,mxResources.get("diagram")),J.appendChild(k),k=document.createElement("option"),k.setAttribute("value","mermaidImage"),mxUtils.write(k,mxResources.get("image")),J.appendChild(k));k=document.createElement("option");k.setAttribute("value","diagram");mxUtils.write(k,mxResources.get("diagram"));z=document.createElement("option");
-z.setAttribute("value","circle");mxUtils.write(z,mxResources.get("circle"));var H=document.createElement("option");H.setAttribute("value","horizontalFlow");mxUtils.write(H,mxResources.get("horizontalFlow"));var D=document.createElement("option");D.setAttribute("value","verticalFlow");mxUtils.write(D,mxResources.get("verticalFlow"));"plantUml"!=m&&"mermaid"!=m&&(J.appendChild(k),J.appendChild(z),J.appendChild(H),J.appendChild(D));"plantUml"==m&&(k=document.createElement("option"),k.setAttribute("value",
-"plantUmlDiagram"),k.setAttribute("selected","selected"),mxUtils.write(k,mxResources.get("diagram")),J.appendChild(k),k=document.createElement("option"),k.setAttribute("value","plantUmlImage"),mxUtils.write(k,mxResources.get("image")),J.appendChild(k));var c=q();F.value=c;x.appendChild(F);k=document.createElement("div");k.style.display="flex";k.style.justifyContent="end";k.style.alignItems="center";k.style.marginTop="14px";k.style.flexShrink="0";this.init=function(){F.focus()};Graph.fileSupport&&
+b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());M.destroy();v.parentNode.removeChild(v)}}}function q(){return"list"==I.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==I.value||"mermaidImage"==I.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==I.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":
+"plantUmlDiagram"==I.value||"plantUmlImage"==I.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var u=b.editor.graph.getFreeInsertPoint(),x=document.createElement("div");x.style.display="flex";x.style.flexDirection="column";x.style.height="100%";x.style.boxSizing="border-box";
+x.style.overflow="visible";var z=document.createElement("h3");mxUtils.write(z,k||mxResources.get("insert"));x.appendChild(z);var F=document.createElement("textarea");F.style.flex="1";F.style.minHeight="0";F.style.width="100%";F.style.boxSizing="border-box";F.style.resize="none";F.setAttribute("wrap","off");F.setAttribute("spellcheck","false");F.setAttribute("autocorrect","off");F.setAttribute("autocomplete","off");F.setAttribute("autocapitalize","off");var I=document.createElement("select");I.className=
+"geBtn";if("formatSql"==m||("mermaid"==m||"plantUml"==m)&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())I.style.display="none";k=document.createElement("option");k.setAttribute("value","list");mxUtils.write(k,mxResources.get("list"));"plantUml"!=m&&"mermaid"!=m&&I.appendChild(k);null!=m&&"fromText"!=m||k.setAttribute("selected","selected");k=document.createElement("option");k.setAttribute("value","table");mxUtils.write(k,mxResources.get("formatSql"));"formatSql"==m&&(I.appendChild(k),
+k.setAttribute("selected","selected"));"mermaid"==m&&(k=document.createElement("option"),k.setAttribute("value","mermaid"),k.setAttribute("selected","selected"),mxUtils.write(k,mxResources.get("diagram")),I.appendChild(k),k=document.createElement("option"),k.setAttribute("value","mermaidImage"),mxUtils.write(k,mxResources.get("image")),I.appendChild(k));k=document.createElement("option");k.setAttribute("value","diagram");mxUtils.write(k,mxResources.get("diagram"));z=document.createElement("option");
+z.setAttribute("value","circle");mxUtils.write(z,mxResources.get("circle"));var H=document.createElement("option");H.setAttribute("value","horizontalFlow");mxUtils.write(H,mxResources.get("horizontalFlow"));var D=document.createElement("option");D.setAttribute("value","verticalFlow");mxUtils.write(D,mxResources.get("verticalFlow"));"plantUml"!=m&&"mermaid"!=m&&(I.appendChild(k),I.appendChild(z),I.appendChild(H),I.appendChild(D));"plantUml"==m&&(k=document.createElement("option"),k.setAttribute("value",
+"plantUmlDiagram"),k.setAttribute("selected","selected"),mxUtils.write(k,mxResources.get("diagram")),I.appendChild(k),k=document.createElement("option"),k.setAttribute("value","plantUmlImage"),mxUtils.write(k,mxResources.get("image")),I.appendChild(k));var c=q();F.value=c;x.appendChild(F);k=document.createElement("div");k.style.display="flex";k.style.justifyContent="end";k.style.alignItems="center";k.style.marginTop="14px";k.style.flexShrink="0";this.init=function(){F.focus()};Graph.fileSupport&&
(F.addEventListener("dragover",function(f){f.stopPropagation();f.preventDefault()},!1),F.addEventListener("drop",function(f){f.stopPropagation();f.preventDefault();if(0<f.dataTransfer.files.length){f=f.dataTransfer.files[0];var l=new FileReader;l.onload=function(n){F.value=n.target.result};l.readAsText(f)}},!1));"plantUml"==m&&(z=document.createElement("div"),z.style.display="inline-block",z.style.color="#c00",z.style.fontSize="12px",z.style.marginRight="10px",z.style.display="flex",z.style.alignItems=
-"center",z.innerHTML='<a href="https://github.com/jgraph/drawio/issues" target="_blank" rel="noopener noreferrer">Report any PlantUML issues</a>',k.appendChild(z));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=m&&"plantUml"!=m||k.appendChild(b.createHelpIcon("mermaid"==m?"https://www.drawio.com/docs/manual/mermaid/":"https://plantuml.com/"));k.appendChild(J);mxEvent.addListener(J,"change",function(){var f=q();if(0==F.value.length||F.value==c)c=f,F.value=c});null==b.sidebar||"mermaid"!=m&&"plantUml"!=
-m||(z=mxUtils.button(mxResources.get("preview"),function(f){if(b.spinner.spin(document.body,mxResources.get("loading"))){var l=function(r){b.spinner.stop();b.showPreviewTooltip(r,f)},n=function(r){b.spinner.stop();b.handleError(r)};"mermaid"==m?b.parseMermaidDiagram(F.value,"mermaidImage"!=J.value||EditorUi.isMermaidConfigured()?null:mxUtils.clone(EditorUi.legacyMermaidConfig),l,n):b.parsePlantUmlDiagram(F.value,null,function(r,t){l(r);b.showPlantUmlWarnings(t)},n)}}),z.className="geBtn",k.appendChild(z));
-z=mxUtils.button(mxResources.get("close"),function(){F.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});z.className="geBtn";b.editor.cancelFirst&&k.appendChild(z);H=mxUtils.button(mxResources.get("insert"),function(f){try{"mermaid"!=J.value&&"mermaidImage"!=J.value&&"plantUmlDiagram"!=J.value&&"plantUmlImage"!=J.value&&b.hideDialog(),g(F.value,J.value,f)}catch(l){b.handleError(l)}});H.className="geBtn gePrimaryBtn";k.appendChild(H);b.editor.cancelFirst||
-k.appendChild(z);x.appendChild(k);this.container=x},NewDialog=function(b,k,m,g,q,u,x,z,F,J,H,D,c,f,l,n,r,t,v,B){function E(Ga){null!=Ga&&(bb=ab=Ga?135:140);Ga=!0;if(null!=cb)for(;Y<cb.length&&(Ga||0!=mxUtils.mod(Y,30));){var Pa=cb[Y++];Pa=y(Pa.url,Pa.libs,Pa.title,Pa.tooltip?Pa.tooltip:Pa.title,Pa.select,Pa.imgUrl,Pa.info,Pa.onClick,Pa.preview,Pa.noImg,Pa.clibs,Pa.type);Ga&&Pa.click();Ga=!1}}function K(Ga,Pa,La,Ta,Qa,Ra){if(null!=Ga&&mxUtils.isAncestorNode(document.body,Ta)){Ga=mxUtils.parseXml(Ga);
-Ga=Editor.parseDiagramNode(Ga.documentElement,null,!0);var Xa=new mxCodec(Ga.ownerDocument),gb=new mxGraphModel;Xa.decode(Ga,gb);b.sidebar.createTooltip(Ta,gb.root.children,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=Qa?mxResources.get(Qa):null,!0,new mxPoint(Pa,La),!0,function(){N=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;
-null!=Ra&&R(Ta,null,null,Ra,infoObj,clibs)},!0,!1)}}function C(){if(Aa==tb&&null==na&&null!=Sa&&null!=rb&&""!=mxUtils.trim(rb.value))g&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+rb.value+"'")&&(A=!0,b.hideDialog()),Sa.click();else if(A&&b.spinner.stop(),ha&&null!=f)m||A||b.hideDialog(),f(ha,xa,Q.value);else if(g)m||A||b.hideDialog(),g(na,Q.value,la,ia);else{var Ga=Q.value;if(null!=Ga&&0<Ga.length){var Pa=function(Ta,Qa,Ra){b.createFile(Ra,na,null!=ia&&0<ia.length?ia:null,Ta,function(){A||
-b.hideDialog()},null,Qa,null,null!=ja&&0<ja.length?ja:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var La=new SaveDialog(b,Ga,mxUtils.bind(this,function(Ta,Qa,Ra){Pa(Qa,Ra,Ta.value)}),null,null,null,null,b.mode);b.showDialog(La.container,420,162,!0,!1);La.init()}else b.pickFolder(b.mode,function(Ta){Pa(b.mode,Ta,Ga)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function R(Ga,Pa,La,Ta,Qa,Ra,Xa){return Aa!=Ga?(null!=Aa&&(Aa.classList.remove("geTemplateSelected"),
-Aa==tb&&(jb.style.display="none",hb.style.display="",kb.style.visibility="hidden",Ua.style.visibility=null!=Ca?"visible":"hidden")),Ga==tb&&(Pa=Ca,null!=Pa?(Ua.style.visibility="visible",Ua.style.visibility=null!=Ca?"visible":"hidden",kb.style.visibility="visible"):(jb.style.display="",kb.style.visibility="hidden",Ua.style.visibility="hidden")),ca.removeAttribute("disabled"),na=Pa,ia=La,ja=Ra,Aa=Ga,ha=Ta,la=Xa,xa=Qa,Aa.classList.add("geTemplateSelected"),!0):!1}function M(){jb.style.display="";hb.style.display=
-"none";kb.style.visibility="hidden";Ua.style.visibility="hidden";rb.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?rb.select():document.execCommand("selectAll",!1,null)}function O(){""!=rb.value?Sa.removeAttribute("disabled"):Sa.setAttribute("disabled","disabled")}function U(){hb.style.backgroundImage=yb;hb.style.backgroundSize="contain"}function T(){U();jb.style.display="none";hb.style.display="";kb.style.visibility="visible";Ua.style.visibility="visible"}function V(){lb=!0;hb.style.backgroundImage=
-"url("+Editor.spinImage+")";hb.style.backgroundSize="12px 12px";hb.style.display="";jb.style.display="none"}function fa(Ga){if(!lb){var Pa=mxUtils.trim(rb.value);Ga||""==Pa?null!=pa&&(rb.value=pa,T()):(V(),b.generateOpenAiMermaidDiagram(Pa,function(La){lb=!1;Aa==tb&&"none"==jb.style.display?(yb="url("+Editor.createSvgDataUri(mxUtils.getXml(b.getSvgForXml(La)))+")",tb.setAttribute("title",Pa),Ua.style.display="",Ca=na=La,pa=Pa,b.lastGenerateXml=La,b.lastGenerateTitle=Pa,b.lastGenerateBackground=yb,
-T(),A&&C()):U()},mxUtils.bind(this,function(La){lb=!1;U();if(Aa==tb){jb.style.display="";hb.style.display="none";kb.style.visibility="hidden";Ua.style.visibility="hidden";if(null!=La&&null!=La.retry){var Ta=La.retry;La.retry=function(){V();Ta()}}b.handleError(La)}})))}}function y(Ga,Pa,La,Ta,Qa,Ra,Xa,gb,ib,zb,xb,Jb){function mb(Oa,db){null==ta?(ya=Oa,ya=/^https?:\/\//.test(ya)?b.editor.isCorsEnabledForUrl(ya)?ya:PROXY_URL+"?url="+encodeURIComponent(ya):TEMPLATE_PATH+"/"+ya,mxUtils.get(ya,mxUtils.bind(this,
-function(ob){200<=ob.getStatus()&&299>=ob.getStatus()&&(ta=ob.getText());db(ta,ya)}))):db(ta,ya)}function Fb(Oa,db){if(null==Ga||Z||b.sidebar.currentElt==Ya)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=da){var ob="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+da.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+da.naturalWidth+'" height="'+da.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+
-"</diagram></mxfile>";K(ob,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),La,Ga)}else b.sidebar.currentElt=Ya,Z=!0,mb(Ga,function(ub){if(Z&&b.sidebar.currentElt==Ya)try{K(ub,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),Ya,db)}catch(Bb){b.sidebar.currentElt=null,b.handleError(Bb)}Z=!1})}var Ya=null;if("generative"!=Jb||null==tb){Ya=document.createElement("div");Ya.className="geTemplate";var ta=null,ya=Ga;null!=La?Ya.setAttribute("title",mxResources.get(La,null,La)):null!=Ta&&0<Ta.length&&Ya.setAttribute("title",
-Ta)}else Ya=tb;var Ea=document.createElement("span");Ea.className="geAdaptiveAsset";mxUtils.write(Ea,mxResources.get(La,null,La));if(null!=Ra){Ya.style.display="inline-flex";Ya.style.justifyContent="center";Ya.style.alignItems="center";ib=document.createElement("img");ib.setAttribute("src",Ra);ib.setAttribute("alt",Ta);ib.style.maxWidth=bb+"px";ib.style.maxHeight=ab+"px";da=ib;var Ka=Ra.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ya.appendChild(ib);ib.onerror=function(){this.src!=
-Ka?this.src=Ka:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ya,mxUtils.bind(this,function(Oa){R(Ya,null,null,Ga,Xa,xb)}),null,null);mxEvent.addListener(Ya,"dblclick",function(Oa){C();mxEvent.consume(Oa)})}else if(!zb&&null!=Ga&&0<Ga.length){var Ja=function(Oa){W.spin(oa)&&mb(Ga,function(db,ob){W.stop();null!=db&&(R(Ya,db,Pa,null,null,xb,ob),Oa&&C())})};Ra=ib||TEMPLATE_PATH+"/"+Ga.substring(0,Ga.length-4)+".png";ib=hb.cloneNode(!1);ib.style.backgroundImage="url("+Ra+
-")";ib.style.display="";Ya.appendChild(ib);null!=La&&Ya.appendChild(Ea);mxEvent.addGestureListeners(Ya,mxUtils.bind(this,function(Oa){Ja()}),null,null);mxEvent.addListener(Ya,"dblclick",function(Oa){Ja(!0);mxEvent.consume(Oa)})}else Ya.appendChild(Ea),"generative"==Jb&&null==tb&&(Ya.appendChild(hb),Ya.appendChild(jb),Ya.appendChild(Ua),Ya.appendChild(kb),tb=Ya,null!=Ca&&(Ya.setAttribute("title",pa),rb.value=pa,O(),Ua.style.display="")),Qa&&R(Ya),null!=gb?(mxEvent.addGestureListeners(Ya,null,null,
-mxUtils.bind(this,function(Oa){R(Ya,null,null,Ga,Xa)})),mxEvent.addListener(Ya,"click",gb)):(mxEvent.addListener(Ya,"click",function(Oa){R(Ya,null,null,Ga,Xa)&&"generative"==Jb&&null==Ca&&M()}),mxEvent.addListener(Ya,"dblclick",function(Oa){"generative"!=Jb?C():"none"==jb.style.display&&M();mxEvent.consume(Oa)}));null!=Ga&&(Ra=S.cloneNode(!0),Ya.appendChild(Ra),mxEvent.addGestureListeners(Ra,mxUtils.bind(this,function(Oa){N=b.sidebar.currentElt==Ya}),null,null),mxEvent.addListener(Ra,"click",mxUtils.bind(this,
-function(Oa){N||Fb(Oa,null!=La?La:Ta);mxEvent.consume(Oa)})));oa.appendChild(Ya);return Ya}function d(){function Ga(mb,Fb){mb=mxResources.get(mb,null,mb.substring(0,1).toUpperCase()+mb.substring(1));18<mb.length&&(mb=mb.substring(0,18)+"&hellip;");return mb+(null!=Fb?" ("+Fb.length+")":"")}function Pa(mb,Fb,Ya){mxEvent.addListener(Fb,"click",function(){eb!=Fb&&(null!=eb&&(eb.style.backgroundColor=""),eb=Fb,eb.style.backgroundColor=x,oa.scrollTop=0,oa.innerText="",Y=0,null!=Za[mb].content?(oa.appendChild(Za[mb].content),
-na=Ca,cb=null,null!=Za[mb].content.init&&Za[mb].content.init()):(cb=Ya?Hb[mb][Ya]:Za[mb],ea=null,E(!1)))})}fb&&(fb=!1,mxEvent.addListener(oa,"scroll",function(mb){oa.scrollTop+oa.clientHeight>=oa.scrollHeight&&(E(),mxEvent.consume(mb))}));if(0<Cb){var La=document.createElement("div");La.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(La,mxResources.get("custom"));Ma.appendChild(La);for(var Ta in Db){var Qa=document.createElement("div");
-La=Ta;var Ra=Db[Ta];18<La.length&&(La=La.substring(0,18)+"&hellip;");Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";Qa.setAttribute("title",La+" ("+Ra.length+")");mxUtils.write(Qa,Qa.getAttribute("title"));null!=J&&(Qa.style.padding=J);Ma.appendChild(Qa);(function(mb,Fb){mxEvent.addListener(Qa,"click",function(){eb!=Fb&&(eb.style.backgroundColor="",eb=Fb,eb.style.backgroundColor=x,oa.scrollTop=
-0,oa.innerText="",Y=0,cb=Db[mb],ea=null,E(!1))})})(Ta,Qa)}La=document.createElement("div");La.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(La,"draw.io");Ma.appendChild(La)}for(Ta in Za){La=Ra=null;if(null!=Za[Ta].content)Qa=document.createElement(Xa?"ul":"div"),La=Ga(Ta),Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",
-Qa.setAttribute("title",La),mxUtils.write(Qa,La),Ma.appendChild(Qa),La=Qa;else{var Xa=Hb[Ta];La=Qa=document.createElement(Xa?"ul":"div");Ra=Za[Ta];var gb=Ga(Ta,Ra);if(null!=Xa){Ra=document.createElement("li");var ib=document.createElement("div");ib.className="geTempTreeCaret";ib.setAttribute("title",gb);mxUtils.write(ib,gb);La=ib;Ra.appendChild(ib);gb=document.createElement("ul");gb.className="geTempTreeNested";gb.style.visibility="hidden";for(var zb in Xa){var xb=document.createElement("li"),Jb=
-Ga(zb,Xa[zb]);xb.setAttribute("title",Jb);mxUtils.write(xb,Jb);Pa(Ta,xb,zb);gb.appendChild(xb)}Ra.appendChild(gb);Qa.className="geTempTree";Qa.appendChild(Ra);(function(mb,Fb){mxEvent.addListener(Fb,"click",function(){mb.style.visibility="visible";mb.classList.toggle("geTempTreeActive");mb.classList.toggle("geTempTreeNested")&&setTimeout(function(){mb.style.visibility="hidden"},550);Fb.classList.toggle("geTempTreeCaret-down")})})(gb,ib)}else Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",
-Qa.setAttribute("title",gb),mxUtils.write(Qa,gb);null!=J&&(Qa.style.padding=J);Ma.appendChild(Qa)}Pa(Ta,La);null==eb&&La.click()}E(!1)}var p=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);m=null!=m?m:!0;q=null!=q?q:!1;x=null!=x?x:"light-dark(#ebf2f9, "+Editor.darkColor+")";H=null!=H?H:EditorUi.templateFile;var A=!1,G=document.createElement("div");G.style.userSelect="none";G.style.height="100%";var I=document.createElement("div");I.style.whiteSpace="nowrap";
-I.style.height="46px";m&&G.appendChild(I);var L=document.createElement("img");L.setAttribute("border","0");L.setAttribute("align","absmiddle");L.style.width="40px";L.style.height="40px";L.style.marginRight="10px";L.style.paddingBottom="4px";L.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_M365?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH+
-"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";k||p||!m||I.appendChild(L);m&&mxUtils.write(I,(p?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var P=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?P=b.drive.extension:b.mode==
+"center",z.innerHTML='<a href="https://github.com/jgraph/drawio/issues" target="_blank" rel="noopener noreferrer">Report any PlantUML issues</a>',k.appendChild(z));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=m&&"plantUml"!=m||k.appendChild(b.createHelpIcon("mermaid"==m?"https://www.drawio.com/docs/manual/mermaid/":"https://plantuml.com/"));k.appendChild(I);mxEvent.addListener(I,"change",function(){var f=q();if(0==F.value.length||F.value==c)c=f,F.value=c});null==b.sidebar||"mermaid"!=m&&"plantUml"!=
+m||(z=mxUtils.button(mxResources.get("preview"),function(f){if(b.spinner.spin(document.body,mxResources.get("loading"))){var l=function(r){b.spinner.stop();b.showPreviewTooltip(r,f)},n=function(r){b.spinner.stop();b.handleError(r)};"mermaid"==m?b.parseMermaidDiagram(F.value,"mermaidImage"!=I.value||EditorUi.isMermaidConfigured()?null:mxUtils.clone(EditorUi.legacyMermaidConfig),l,n):b.parsePlantUmlDiagram(F.value,null,function(r,t){l(r);b.showPlantUmlWarnings(t)},n)}}),z.className="geBtn",k.appendChild(z));
+z=mxUtils.button(mxResources.get("close"),function(){F.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});z.className="geBtn";b.editor.cancelFirst&&k.appendChild(z);H=mxUtils.button(mxResources.get("insert"),function(f){try{"mermaid"!=I.value&&"mermaidImage"!=I.value&&"plantUmlDiagram"!=I.value&&"plantUmlImage"!=I.value&&b.hideDialog(),g(F.value,I.value,f)}catch(l){b.handleError(l)}});H.className="geBtn gePrimaryBtn";k.appendChild(H);b.editor.cancelFirst||
+k.appendChild(z);x.appendChild(k);this.container=x},NewDialog=function(b,k,m,g,q,u,x,z,F,I,H,D,c,f,l,n,r,t,v,B){function E(Fa){null!=Fa&&(eb=bb=Fa?135:140);Fa=!0;if(null!=db)for(;Y<db.length&&(Fa||0!=mxUtils.mod(Y,30));){var Na=db[Y++];Na=y(Na.url,Na.libs,Na.title,Na.tooltip?Na.tooltip:Na.title,Na.select,Na.imgUrl,Na.info,Na.onClick,Na.preview,Na.noImg,Na.clibs,Na.type);Fa&&Na.click();Fa=!1}}function K(Fa,Na,Ka,Ta,Qa,Ra){if(null!=Fa&&mxUtils.isAncestorNode(document.body,Ta)){Fa=mxUtils.parseXml(Fa);
+Fa=Editor.parseDiagramNode(Fa.documentElement,null,!0);var $a=new mxCodec(Fa.ownerDocument),ab=new mxGraphModel;$a.decode(Fa,ab);b.sidebar.createTooltip(Ta,ab.root.children,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=Qa?mxResources.get(Qa):null,!0,new mxPoint(Na,Ka),!0,function(){N=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;
+null!=Ra&&R(Ta,null,null,Ra,infoObj,clibs)},!0,!1)}}function C(){if(Aa==tb&&null==na&&null!=Sa&&null!=wb&&""!=mxUtils.trim(wb.value))g&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+wb.value+"'")&&(A=!0,b.hideDialog()),Sa.click();else if(A&&b.spinner.stop(),ha&&null!=f)m||A||b.hideDialog(),f(ha,ya,Q.value);else if(g)m||A||b.hideDialog(),g(na,Q.value,la,ia);else{var Fa=Q.value;if(null!=Fa&&0<Fa.length){var Na=function(Ta,Qa,Ra){b.createFile(Ra,na,null!=ia&&0<ia.length?ia:null,Ta,function(){A||
+b.hideDialog()},null,Qa,null,null!=ja&&0<ja.length?ja:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var Ka=new SaveDialog(b,Fa,mxUtils.bind(this,function(Ta,Qa,Ra){Na(Qa,Ra,Ta.value)}),null,null,null,null,b.mode);b.showDialog(Ka.container,420,162,!0,!1);Ka.init()}else b.pickFolder(b.mode,function(Ta){Na(b.mode,Ta,Fa)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function R(Fa,Na,Ka,Ta,Qa,Ra,$a){return Aa!=Fa?(null!=Aa&&(Aa.classList.remove("geTemplateSelected"),
+Aa==tb&&(cb.style.display="none",gb.style.display="",pb.style.visibility="hidden",Xa.style.visibility=null!=Ca?"visible":"hidden")),Fa==tb&&(Na=Ca,null!=Na?(Xa.style.visibility="visible",Xa.style.visibility=null!=Ca?"visible":"hidden",pb.style.visibility="visible"):(cb.style.display="",pb.style.visibility="hidden",Xa.style.visibility="hidden")),ca.removeAttribute("disabled"),na=Na,ia=Ka,ja=Ra,Aa=Fa,ha=Ta,la=$a,ya=Qa,Aa.classList.add("geTemplateSelected"),!0):!1}function M(){cb.style.display="";gb.style.display=
+"none";pb.style.visibility="hidden";Xa.style.visibility="hidden";wb.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?wb.select():document.execCommand("selectAll",!1,null)}function O(){""!=wb.value?Sa.removeAttribute("disabled"):Sa.setAttribute("disabled","disabled")}function U(){gb.style.backgroundImage=Db;gb.style.backgroundSize="contain"}function T(){U();cb.style.display="none";gb.style.display="";pb.style.visibility="visible";Xa.style.visibility="visible"}function V(){qb=!0;gb.style.backgroundImage=
+"url("+Editor.spinImage+")";gb.style.backgroundSize="12px 12px";gb.style.display="";cb.style.display="none"}function fa(Fa){if(!qb){var Na=mxUtils.trim(wb.value);Fa||""==Na?null!=pa&&(wb.value=pa,T()):(V(),b.generateOpenAiMermaidDiagram(Na,function(Ka){qb=!1;Aa==tb&&"none"==cb.style.display?(Db="url("+Editor.createSvgDataUri(mxUtils.getXml(b.getSvgForXml(Ka)))+")",tb.setAttribute("title",Na),Xa.style.display="",Ca=na=Ka,pa=Na,b.lastGenerateXml=Ka,b.lastGenerateTitle=Na,b.lastGenerateBackground=Db,
+T(),A&&C()):U()},mxUtils.bind(this,function(Ka){qb=!1;U();if(Aa==tb){cb.style.display="";gb.style.display="none";pb.style.visibility="hidden";Xa.style.visibility="hidden";if(null!=Ka&&null!=Ka.retry){var Ta=Ka.retry;Ka.retry=function(){V();Ta()}}b.handleError(Ka)}})))}}function y(Fa,Na,Ka,Ta,Qa,Ra,$a,ab,mb,sb,zb,Eb){function hb(Da,Ia){null==Ob?(Kb=Da,Kb=/^https?:\/\//.test(Kb)?b.editor.isCorsEnabledForUrl(Kb)?Kb:PROXY_URL+"?url="+encodeURIComponent(Kb):TEMPLATE_PATH+"/"+Kb,mxUtils.get(Kb,mxUtils.bind(this,
+function(La){200<=La.getStatus()&&299>=La.getStatus()&&(Ob=La.getText());Ia(Ob,Kb)}))):Ia(Ob,Kb)}function Fb(Da,Ia){if(null==Fa||Z||b.sidebar.currentElt==Ya)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=da){var La="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+da.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+da.naturalWidth+'" height="'+da.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+
+"</diagram></mxfile>";K(La,mxEvent.getClientX(Da),mxEvent.getClientY(Da),Ka,Fa)}else b.sidebar.currentElt=Ya,Z=!0,hb(Fa,function(Ua){if(Z&&b.sidebar.currentElt==Ya)try{K(Ua,mxEvent.getClientX(Da),mxEvent.getClientY(Da),Ya,Ia)}catch(Va){b.sidebar.currentElt=null,b.handleError(Va)}Z=!1})}var Ya=null;if("generative"!=Eb||null==tb){Ya=document.createElement("div");Ya.className="geTemplate";var Ob=null,Kb=Fa;null!=Ka?Ya.setAttribute("title",mxResources.get(Ka,null,Ka)):null!=Ta&&0<Ta.length&&Ya.setAttribute("title",
+Ta)}else Ya=tb;var Nb=document.createElement("span");Nb.className="geAdaptiveAsset";mxUtils.write(Nb,mxResources.get(Ka,null,Ka));if(null!=Ra){Ya.style.display="inline-flex";Ya.style.justifyContent="center";Ya.style.alignItems="center";mb=document.createElement("img");mb.setAttribute("src",Ra);mb.setAttribute("alt",Ta);mb.style.maxWidth=eb+"px";mb.style.maxHeight=bb+"px";da=mb;var ta=Ra.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ya.appendChild(mb);mb.onerror=function(){this.src!=
+ta?this.src=ta:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ya,mxUtils.bind(this,function(Da){R(Ya,null,null,Fa,$a,zb)}),null,null);mxEvent.addListener(Ya,"dblclick",function(Da){C();mxEvent.consume(Da)})}else if(!sb&&null!=Fa&&0<Fa.length){var xa=function(Da){X.spin(oa)&&hb(Fa,function(Ia,La){X.stop();null!=Ia&&(R(Ya,Ia,Na,null,null,zb,La),Da&&C())})};Ra=mb||TEMPLATE_PATH+"/"+Fa.substring(0,Fa.length-4)+".png";mb=gb.cloneNode(!1);mb.style.backgroundImage="url("+Ra+
+")";mb.style.display="";Ya.appendChild(mb);null!=Ka&&Ya.appendChild(Nb);mxEvent.addGestureListeners(Ya,mxUtils.bind(this,function(Da){xa()}),null,null);mxEvent.addListener(Ya,"dblclick",function(Da){xa(!0);mxEvent.consume(Da)})}else Ya.appendChild(Nb),"generative"==Eb&&null==tb&&(Ya.appendChild(gb),Ya.appendChild(cb),Ya.appendChild(Xa),Ya.appendChild(pb),tb=Ya,null!=Ca&&(Ya.setAttribute("title",pa),wb.value=pa,O(),Xa.style.display="")),Qa&&R(Ya),null!=ab?(mxEvent.addGestureListeners(Ya,null,null,
+mxUtils.bind(this,function(Da){R(Ya,null,null,Fa,$a)})),mxEvent.addListener(Ya,"click",ab)):(mxEvent.addListener(Ya,"click",function(Da){R(Ya,null,null,Fa,$a)&&"generative"==Eb&&null==Ca&&M()}),mxEvent.addListener(Ya,"dblclick",function(Da){"generative"!=Eb?C():"none"==cb.style.display&&M();mxEvent.consume(Da)}));null!=Fa&&(Ra=S.cloneNode(!0),Ya.appendChild(Ra),mxEvent.addGestureListeners(Ra,mxUtils.bind(this,function(Da){N=b.sidebar.currentElt==Ya}),null,null),mxEvent.addListener(Ra,"click",mxUtils.bind(this,
+function(Da){N||Fb(Da,null!=Ka?Ka:Ta);mxEvent.consume(Da)})));oa.appendChild(Ya);return Ya}function d(){function Fa(hb,Fb){hb=mxResources.get(hb,null,hb.substring(0,1).toUpperCase()+hb.substring(1));18<hb.length&&(hb=hb.substring(0,18)+"&hellip;");return hb+(null!=Fb?" ("+Fb.length+")":"")}function Na(hb,Fb,Ya){mxEvent.addListener(Fb,"click",function(){ib!=Fb&&(null!=ib&&(ib.style.backgroundColor=""),ib=Fb,ib.style.backgroundColor=x,oa.scrollTop=0,oa.innerText="",Y=0,null!=Za[hb].content?(oa.appendChild(Za[hb].content),
+na=Ca,db=null,null!=Za[hb].content.init&&Za[hb].content.init()):(db=Ya?Jb[hb][Ya]:Za[hb],ea=null,E(!1)))})}fb&&(fb=!1,mxEvent.addListener(oa,"scroll",function(hb){oa.scrollTop+oa.clientHeight>=oa.scrollHeight&&(E(),mxEvent.consume(hb))}));if(0<yb){var Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,mxResources.get("custom"));Ma.appendChild(Ka);for(var Ta in Ab){var Qa=document.createElement("div");
+Ka=Ta;var Ra=Ab[Ta];18<Ka.length&&(Ka=Ka.substring(0,18)+"&hellip;");Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";Qa.setAttribute("title",Ka+" ("+Ra.length+")");mxUtils.write(Qa,Qa.getAttribute("title"));null!=I&&(Qa.style.padding=I);Ma.appendChild(Qa);(function(hb,Fb){mxEvent.addListener(Qa,"click",function(){ib!=Fb&&(ib.style.backgroundColor="",ib=Fb,ib.style.backgroundColor=x,oa.scrollTop=
+0,oa.innerText="",Y=0,db=Ab[hb],ea=null,E(!1))})})(Ta,Qa)}Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,"draw.io");Ma.appendChild(Ka)}for(Ta in Za){Ka=Ra=null;if(null!=Za[Ta].content)Qa=document.createElement($a?"ul":"div"),Ka=Fa(Ta),Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",
+Qa.setAttribute("title",Ka),mxUtils.write(Qa,Ka),Ma.appendChild(Qa),Ka=Qa;else{var $a=Jb[Ta];Ka=Qa=document.createElement($a?"ul":"div");Ra=Za[Ta];var ab=Fa(Ta,Ra);if(null!=$a){Ra=document.createElement("li");var mb=document.createElement("div");mb.className="geTempTreeCaret";mb.setAttribute("title",ab);mxUtils.write(mb,ab);Ka=mb;Ra.appendChild(mb);ab=document.createElement("ul");ab.className="geTempTreeNested";ab.style.visibility="hidden";for(var sb in $a){var zb=document.createElement("li"),Eb=
+Fa(sb,$a[sb]);zb.setAttribute("title",Eb);mxUtils.write(zb,Eb);Na(Ta,zb,sb);ab.appendChild(zb)}Ra.appendChild(ab);Qa.className="geTempTree";Qa.appendChild(Ra);(function(hb,Fb){mxEvent.addListener(Fb,"click",function(){hb.style.visibility="visible";hb.classList.toggle("geTempTreeActive");hb.classList.toggle("geTempTreeNested")&&setTimeout(function(){hb.style.visibility="hidden"},550);Fb.classList.toggle("geTempTreeCaret-down")})})(ab,mb)}else Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",
+Qa.setAttribute("title",ab),mxUtils.write(Qa,ab);null!=I&&(Qa.style.padding=I);Ma.appendChild(Qa)}Na(Ta,Ka);null==ib&&Ka.click()}E(!1)}var p=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);m=null!=m?m:!0;q=null!=q?q:!1;x=null!=x?x:"light-dark(#ebf2f9, "+Editor.darkColor+")";H=null!=H?H:EditorUi.templateFile;var A=!1,G=document.createElement("div");G.style.userSelect="none";G.style.height="100%";var J=document.createElement("div");J.style.whiteSpace="nowrap";
+J.style.height="46px";m&&G.appendChild(J);var L=document.createElement("img");L.setAttribute("border","0");L.setAttribute("align","absmiddle");L.style.width="40px";L.style.height="40px";L.style.marginRight="10px";L.style.paddingBottom="4px";L.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_M365?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH+
+"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";k||p||!m||J.appendChild(L);m&&mxUtils.write(J,(p?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var P=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?P=b.drive.extension:b.mode==
App.MODE_DROPBOX&&null!=b.dropbox?P=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?P=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?P=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?P=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(P=b.trello.extension);var Q=document.createElement("input");Q.setAttribute("value",b.defaultFilename+P);Q.style.marginLeft="10px";Q.style.width=k||p?"144px":"244px";this.init=function(){m&&Editor.selectFilename(Q);
-null!=oa.parentNode&&null!=oa.parentNode.parentNode&&mxEvent.addGestureListeners(oa.parentNode.parentNode,mxUtils.bind(this,function(Ga){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(m)if(I.appendChild(Q),t)Q.style.width=k||p?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var ba=FilenameDialog.createFileTypes(b,Q,b.editor.diagramFileTypes);ba.style.marginLeft="6px";ba.style.width=k||p?"80px":"180px";I.appendChild(ba)}var X=!1,Y=0,W=new Spinner({lines:12,length:10,width:5,radius:10,
+null!=oa.parentNode&&null!=oa.parentNode.parentNode&&mxEvent.addGestureListeners(oa.parentNode.parentNode,mxUtils.bind(this,function(Fa){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(m)if(J.appendChild(Q),t)Q.style.width=k||p?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var ba=FilenameDialog.createFileTypes(b,Q,b.editor.diagramFileTypes);ba.style.marginLeft="6px";ba.style.width=k||p?"80px":"180px";J.appendChild(ba)}var W=!1,Y=0,X=new Spinner({lines:12,length:10,width:5,radius:10,
rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),ca=mxUtils.button(n||mxResources.get("create"),function(){ca.setAttribute("disabled","disabled");C();ca.removeAttribute("disabled")});ca.className="geBtn gePrimaryBtn";var S=document.createElement("img");S.setAttribute("src",Editor.magnifyImage);S.setAttribute("title",mxResources.get("preview"));S.className="geButton geRoundButton";var Z=!1,da=null,N=!1;if(D||c){var aa=[],ea=null,ka=null,ra=
-null,sa=function(Ga){ca.setAttribute("disabled","disabled");for(var Pa=0;Pa<aa.length;Pa++)aa[Pa].className=Pa==Ga?"geBtn gePrimaryBtn":"geBtn"};X=!0;var ma=document.createElement("div");ma.style.whiteSpace="nowrap";ma.style.height="30px";G.appendChild(ma);var wa=mxUtils.button(mxResources.get("templates"),function(){Ma.style.display="";Fa.style.display="";oa.style.left="160px";sa(0);oa.scrollTop=0;oa.innerText="";Y=0;ea!=cb&&(cb=ea,Za=ka,Cb=ra,Ma.innerText="",d(),ea=null)});aa.push(wa);ma.appendChild(wa);
-var va=function(Ga){Ma.style.display="none";Fa.style.display="none";oa.style.left="30px";sa(Ga?-1:1);null==ea&&(ea=cb);oa.scrollTop=0;oa.innerText="";W.spin(oa);var Pa=function(La,Ta,Qa){Y=0;W.stop();cb=La;Qa=Qa||{};var Ra=0,Xa;for(Xa in Qa)Ra+=Qa[Xa].length;if(Ta)oa.innerText=Ta;else if(0==La.length&&0==Ra)oa.innerText=mxResources.get("noDiagrams");else if(oa.innerText="",0<Ra){Ma.style.display="";oa.style.left="160px";Ma.innerText="";Cb=0;Za={"draw.io":La};for(Xa in Qa)Za[Xa]=Qa[Xa];d()}else E(!0)};
-Ga?c(ua.value,Pa):D(Pa)};if(D){var za=mxUtils.button(mxResources.get("recent"),function(){va()});ma.appendChild(za);aa.push(za)}if(c){var Ba=document.createElement("span");Ba.style.marginLeft="10px";Ba.innerText=mxResources.get("search")+":";ma.appendChild(Ba);var ua=document.createElement("input");ua.style.marginRight="10px";ua.style.marginLeft="10px";ua.style.width="220px";mxEvent.addListener(ua,"keypress",function(Ga){13==Ga.keyCode&&va(!0)});ma.appendChild(ua);var qa=mxUtils.button(mxResources.get("search"),
-function(){va(!0)});qa.className="geBtn";ma.appendChild(qa)}sa(0)}var ia=null,ja=null,na=null,Aa=null,ha=null,la=null,xa=null,Ca=b.lastGenerateXml,pa=b.lastGenerateTitle,oa=document.createElement("div");oa.style.border="1px solid #d3d3d3";oa.style.position="absolute";oa.style.left="160px";oa.style.right="34px";var Da=(m?72:40)+(X?30:0);oa.style.top=Da+"px";oa.style.bottom="68px";oa.style.margin="6px 0 0 -1px";oa.style.padding="6px";oa.style.overflow="auto";var Fa=document.createElement("div");Fa.style.cssText=
-"position:absolute;left:30px;width:128px;top:"+Da+"px;height:22px;margin-top: 6px;white-space: nowrap;";var Ia=document.createElement("input");Ia.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";Ia.setAttribute("placeholder",mxResources.get("search"));Ia.setAttribute("type","text");Fa.appendChild(Ia);var Ha=document.createElement("img");Ha.setAttribute("src",Editor.magnifyImage);Ha.setAttribute("title",mxResources.get("search"));
-Ha.className="geAdaptiveAsset";Ha.style.position="relative";Ha.style.cursor="pointer";Ha.style.outline="none";Ha.style.opacity="0.5";Ha.style.height="16px";Ha.style.left="-20px";Ha.style.top="4px";Fa.appendChild(Ha);mxEvent.addListener(Ha,"click",function(){Ha.getAttribute("src")!=Editor.magnifyImage&&(Ha.setAttribute("src",Editor.magnifyImage),Ha.setAttribute("title",mxResources.get("search")),Ia.value="",null!=Wa&&(Wa.click(),Wa=null));Ia.focus()});mxEvent.addListener(Ia,"keydown",mxUtils.bind(this,
-function(Ga){if(13==Ga.keyCode){var Pa=Ia.value;if(""==Pa)null!=Wa&&(Wa.click(),Wa=null);else{if(null==NewDialog.tagsList[H]){var La=Object.create(null);for(xb in Za)if(null==Za[xb].content)for(var Ta=Za[xb],Qa=0;Qa<Ta.length;Qa++){var Ra=Ta[Qa];if(null!=Ra.tags)for(var Xa=Ra.tags.toLowerCase().split(";"),gb=0;gb<Xa.length;gb++)null==La[Xa[gb]]&&(La[Xa[gb]]=[]),La[Xa[gb]].push(Ra)}NewDialog.tagsList[H]=La}var ib=Pa.toLowerCase().split(" ");La=NewDialog.tagsList[H];if(0<Cb&&null==La.__tagsList__){for(xb in Db)for(Ta=
-Db[xb],Qa=0;Qa<Ta.length;Qa++)for(Ra=Ta[Qa],Xa=Ra.title.split(" "),Xa.push(xb),gb=0;gb<Xa.length;gb++){var zb=Xa[gb].toLowerCase();null==La[zb]&&(La[zb]=[]);La[zb].push(Ra)}La.__tagsList__=!0}var xb=[];Ta={};for(Qa=Xa=0;Qa<ib.length;Qa++)if(0<ib[Qa].length){zb=La[ib[Qa]];var Jb={};xb=[];if(null!=zb)for(gb=0;gb<zb.length;gb++)Ra=zb[gb],0==Xa==(null==Ta[Ra.url])&&(Jb[Ra.url]=!0,xb.push(Ra));Ta=Jb;Xa++}oa.scrollTop=0;oa.innerText="";Y=0;La=document.createElement("div");La.style.padding="6px";La.style.whiteSpace=
-"nowrap";La.style.overflow="hidden";La.style.textOverflow="ellipsis";Ra=mxResources.get(0==xb.length?"noResultsFor":"resultsFor",[Pa]);La.setAttribute("title",Ra);mxUtils.write(La,Ra);oa.appendChild(La);null!=eb&&null==Wa&&(eb.style.backgroundColor="",Wa=eb,eb=La);cb=xb;ea=null;E(!1)}mxEvent.consume(Ga)}}));mxEvent.addListener(Ia,"keyup",mxUtils.bind(this,function(Ga){""==Ia.value?(Ha.setAttribute("src",Editor.magnifyImage),Ha.setAttribute("title",mxResources.get("search"))):(Ha.setAttribute("src",
-Editor.crossImage),Ha.setAttribute("title",mxResources.get("reset")))}));Da+=23;var Ma=document.createElement("div");Ma.style.cssText="position:absolute;left:30px;width:128px;top:"+Da+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(oa,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var bb=140,ab=bb,tb=null,yb=null!=b.lastGenerateBackground?b.lastGenerateBackground:"url("+Editor.thinSparklesImage+")",jb=document.createElement("div");jb.className=
-"geGenerateDiagramForm";jb.style.position="absolute";jb.style.width="100%";jb.style.height="100%";var hb=document.createElement("div");hb.className="geTemplatePreview geAdaptiveAsset";hb.style.backgroundImage=yb;var rb=document.createElement("textarea");rb.setAttribute("placeholder",mxResources.get("describeYourDiagram"));rb.className="geGenerateDiagramDescription";var Sa=document.createElement("button");Sa.className="geBtn gePrimaryBtn geGenerateDiagramButton";Sa.setAttribute("disabled","disabled");
-Sa.setAttribute("title",mxResources.get("ok"));mxUtils.write(Sa,mxResources.get("ok"));var Ua=S.cloneNode(!0);Ua.style.display="none";var vb=!1;mxEvent.addGestureListeners(Ua,function(Ga){vb=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Ga){if(!vb&&null!=Ca){var Pa="<mxfile><diagram>"+Graph.compress(Ca)+"</diagram></mxfile>";K(Pa,mxEvent.getClientX(Ga),mxEvent.getClientY(Ga),tb,pa)}});var kb=S.cloneNode(!0);kb.setAttribute("src",Editor.editImage);kb.setAttribute("title",
-mxResources.get("edit"));kb.style.visibility="hidden";kb.style.left="0px";var qb=S.cloneNode(!0);qb.setAttribute("src",Editor.helpImage);qb.setAttribute("title",mxResources.get("help"));mxEvent.addListener(qb,"click",function(Ga){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Ga)});jb.appendChild(rb);jb.appendChild(Sa);jb.appendChild(qb);jb.style.display="none";mxEvent.addListener(kb,"click",M);mxEvent.addListener(rb,"input",O);var lb=!1;mxEvent.addListener(Sa,
-"click",function(){fa()});mxEvent.addListener(rb,"keydown",function(Ga){13!=Ga.keyCode||mxEvent.isShiftDown(Ga)?27==Ga.keyCode&&(fa(!0),mxEvent.consume(Ga)):(fa(),mxEvent.consume(Ga))});var Za={},Hb={},Db={},Cb=0,fb=!0,eb=null,Wa=null;Za.basic=B?[]:[{title:"blankDiagram"}];var cb=Za.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&EditorUi.isMermaidSupported()&&Za.basic.push({title:"generate",type:"generative"});if(!k){var Gb=function(){mxUtils.get(Eb,function(Ga){if(!wb){wb=
-!0;Ga=Ga.getXml().documentElement.firstChild;for(var Pa={};null!=Ga;){if("undefined"!==typeof Ga.getAttribute)if("parsererror"==Ga.nodeName)null!=window.console&&console.log("Parser error in "+H+": "+Ga.textContent);else if("clibs"==Ga.nodeName){for(var La=Ga.getAttribute("name"),Ta=Ga.getElementsByTagName("add"),Qa=[],Ra=0;Ra<Ta.length;Ra++)Qa.push(encodeURIComponent(mxUtils.getTextContent(Ta[Ra])));null!=La&&0<Qa.length&&(Pa[La]=Qa.join(";"))}else sb({url:Ga.getAttribute("url"),section:Ga.getAttribute("section"),
-subsection:Ga.getAttribute("subsection"),libs:Ga.getAttribute("libs"),clibs:Ga.getAttribute("clibs"),title:Ga.getAttribute("title"),name:Ga.getAttribute("name"),preview:Ga.getAttribute("preview"),tags:Ga.getAttribute("tags")},Pa);Ga=Ga.nextSibling}if(Array.isArray(EditorUi.customTemplates))for(Ra=0;Ra<EditorUi.customTemplates.length;Ra++)null!=EditorUi.customTemplates[Ra]&&sb(EditorUi.customTemplates[Ra],Pa);W.stop();d()}})},sb=function(Ga,Pa){var La=Ga.url;if(null!=La){var Ta=Ga.section,Qa=Ga.subsection;
-if(null==Ta){var Ra=La.indexOf("/");Ta=La.substring(0,Ra);if(null==Qa){var Xa=La.indexOf("/",Ra+1);-1<Xa&&(Qa=La.substring(Ra+1,Xa))}}if(null==EditorUi.enabledTemplateSections||0<=mxUtils.indexOf(EditorUi.enabledTemplateSections,Ta))La=Za[Ta],null==La&&(La=[],Za[Ta]=La),Ra=Ga.clibs,null!=Pa[Ra]&&(Ra=Pa[Ra]),Ga={url:Ga.url,libs:Ga.libs,title:Ga.title,tooltip:Ga.name||Ga.url,preview:Ga.preview,clibs:Ra,tags:Ga.tags},La.push(Ga),null!=Qa&&(Pa=Hb[Ta],null==Pa&&(Pa={},Hb[Ta]=Pa),Ta=Pa[Qa],null==Ta&&(Ta=
-[],Pa[Qa]=Ta),Ta.push(Ga))}};G.appendChild(Fa);G.appendChild(Ma);G.appendChild(oa);var wb=!1,Eb=H;/^https?:\/\//.test(Eb)&&!b.editor.isCorsEnabledForUrl(Eb)&&(Eb=PROXY_URL+"?url="+encodeURIComponent(Eb));W.spin(oa);null!=r?r(function(Ga,Pa){Db=Ga;ra=Cb=Pa;Gb()},Gb):Gb();ka=Za}mxEvent.addListener(Q,"keypress",function(Ga){b.dialog.container.firstChild==G&&13==Ga.keyCode&&C()});var pb=document.createElement("div");pb.style.marginTop=k?"4px":"16px";pb.style.textAlign="right";pb.style.position="absolute";
-pb.style.left="40px";pb.style.bottom="24px";pb.style.right="40px";var Ab=mxUtils.button(mxResources.get("cancel"),function(){null!=u&&u();b.hideDialog(!0)});Ab.className="geBtn";!b.editor.cancelFirst||q&&null==u||pb.appendChild(Ab);if(!(k||"1"==urlParams.embed||q||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Ib=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Ga=new FilenameDialog(b,"",mxResources.get("create"),function(Pa){null!=Pa&&0<Pa.length&&b.editor.loadUrl(b.editor.getProxiedUrl(Pa),
-function(La){na=La;ia=null;templateRealURl=Pa;b.hideDialog();C()},function(La){b.handleError(La)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Ga.container,300,80,!0,!0);Ga.init()});Ib.className="geBtn";pb.appendChild(Ib)}if(Graph.fileSupport&&l){var Lb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Ga=document.createElement("input");Ga.setAttribute("multiple","multiple");Ga.setAttribute("type","file");mxEvent.addListener(Ga,"change",function(Pa){b.openFiles(Ga.files,
-!0);Ga.value=""});Ga.style.display="none";document.body.appendChild(Ga);b.newDlgFileInputElt=Ga}b.newDlgFileInputElt.click()});Lb.className="geBtn";pb.appendChild(Lb)}pb.appendChild(ca);b.editor.cancelFirst||null!=g||q&&null==u||pb.appendChild(Ab);G.appendChild(pb);this.container=G};NewDialog.tagsList=Object.create(null);
-var SaveDialog=function(b,k,m,g,q,u,x,z,F,J,H){function D(y,d,p,A,G,I){var L=null;if(y!=App.MODE_DROPBOX&&(null==g||0>mxUtils.indexOf(g,y))&&(null==F||y==F)&&(null==J||0<=mxUtils.indexOf(J,y))){G=null!=G?G:b.getTitleForService(y);var P=0<=mxUtils.indexOf(U,y);if(P||null!=b.getServiceForName(y)){L=document.createElement("option");var Q="";!P&&b.isOffline(y==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(L.setAttribute("disabled","disabled"),Q=" ("+mxResources.get("offline")+")");if("pick"==I)L.innerHTML=
-mxUtils.htmlEntities(G)+"&nbsp;&nbsp;&#8211&nbsp;&nbsp;"+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+Q,L.setAttribute("value","pickFolder-"+y),L.setAttribute("title",G+" - "+mxResources.get("pickFolder")+"...");else{P=y+(null!=p?"-"+p:"");var ba=V[P];null!=ba&&null!=ba.option&&ba.option.parentNode.removeChild(ba.option);ba=null;if(null!=d){"/"==d.charAt(d.length-1)&&(d=d.substring(0,d.length-1));"/"==d.charAt(0)&&(d=d.substring(1));ba=d;if(y!=App.MODE_GITHUB&&y==App.MODE_GITLAB){var X=
-ba.lastIndexOf("/");0<=X&&(ba=ba.substring(X+1))}40<ba.length&&(ba=ba.substring(0,20)+"..."+ba.substring(ba.length-20))}L.innerHTML=mxUtils.htmlEntities(G)+(null!=ba?"&nbsp;&nbsp;&#8211&nbsp;&nbsp;"+mxUtils.htmlEntities(ba):"")+Q;L.setAttribute("title",G+(null!=d?" ("+d+")":"")+(null!=p&&decodeURIComponent(p)!=d?" ["+p+"]":""));L.setAttribute("value",P);V[P]={option:L,mode:y,path:d,id:p};SaveDialog.lastValue==P&&null==z&&"disabled"==!L.getAttribute("disabled")?A=!0:null==A&&("root"==I?A=null==z&&
+null,sa=function(Fa){ca.setAttribute("disabled","disabled");for(var Na=0;Na<aa.length;Na++)aa[Na].className=Na==Fa?"geBtn gePrimaryBtn":"geBtn"};W=!0;var ma=document.createElement("div");ma.style.whiteSpace="nowrap";ma.style.height="30px";G.appendChild(ma);var wa=mxUtils.button(mxResources.get("templates"),function(){Ma.style.display="";Ga.style.display="";oa.style.left="160px";sa(0);oa.scrollTop=0;oa.innerText="";Y=0;ea!=db&&(db=ea,Za=ka,yb=ra,Ma.innerText="",d(),ea=null)});aa.push(wa);ma.appendChild(wa);
+var va=function(Fa){Ma.style.display="none";Ga.style.display="none";oa.style.left="30px";sa(Fa?-1:1);null==ea&&(ea=db);oa.scrollTop=0;oa.innerText="";X.spin(oa);var Na=function(Ka,Ta,Qa){Y=0;X.stop();db=Ka;Qa=Qa||{};var Ra=0,$a;for($a in Qa)Ra+=Qa[$a].length;if(Ta)oa.innerText=Ta;else if(0==Ka.length&&0==Ra)oa.innerText=mxResources.get("noDiagrams");else if(oa.innerText="",0<Ra){Ma.style.display="";oa.style.left="160px";Ma.innerText="";yb=0;Za={"draw.io":Ka};for($a in Qa)Za[$a]=Qa[$a];d()}else E(!0)};
+Fa?c(ua.value,Na):D(Na)};if(D){var za=mxUtils.button(mxResources.get("recent"),function(){va()});ma.appendChild(za);aa.push(za)}if(c){var Ba=document.createElement("span");Ba.style.marginLeft="10px";Ba.innerText=mxResources.get("search")+":";ma.appendChild(Ba);var ua=document.createElement("input");ua.style.marginRight="10px";ua.style.marginLeft="10px";ua.style.width="220px";mxEvent.addListener(ua,"keypress",function(Fa){13==Fa.keyCode&&va(!0)});ma.appendChild(ua);var qa=mxUtils.button(mxResources.get("search"),
+function(){va(!0)});qa.className="geBtn";ma.appendChild(qa)}sa(0)}var ia=null,ja=null,na=null,Aa=null,ha=null,la=null,ya=null,Ca=b.lastGenerateXml,pa=b.lastGenerateTitle,oa=document.createElement("div");oa.style.border="1px solid #d3d3d3";oa.style.position="absolute";oa.style.left="160px";oa.style.right="34px";var Ea=(m?72:40)+(W?30:0);oa.style.top=Ea+"px";oa.style.bottom="68px";oa.style.margin="6px 0 0 -1px";oa.style.padding="6px";oa.style.overflow="auto";var Ga=document.createElement("div");Ga.style.cssText=
+"position:absolute;left:30px;width:128px;top:"+Ea+"px;height:22px;margin-top: 6px;white-space: nowrap;";var Ja=document.createElement("input");Ja.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";Ja.setAttribute("placeholder",mxResources.get("search"));Ja.setAttribute("type","text");Ga.appendChild(Ja);var Ha=document.createElement("img");Ha.setAttribute("src",Editor.magnifyImage);Ha.setAttribute("title",mxResources.get("search"));
+Ha.className="geAdaptiveAsset";Ha.style.position="relative";Ha.style.cursor="pointer";Ha.style.outline="none";Ha.style.opacity="0.5";Ha.style.height="16px";Ha.style.left="-20px";Ha.style.top="4px";Ga.appendChild(Ha);mxEvent.addListener(Ha,"click",function(){Ha.getAttribute("src")!=Editor.magnifyImage&&(Ha.setAttribute("src",Editor.magnifyImage),Ha.setAttribute("title",mxResources.get("search")),Ja.value="",null!=Wa&&(Wa.click(),Wa=null));Ja.focus()});mxEvent.addListener(Ja,"keydown",mxUtils.bind(this,
+function(Fa){if(13==Fa.keyCode){var Na=Ja.value;if(""==Na)null!=Wa&&(Wa.click(),Wa=null);else{if(null==NewDialog.tagsList[H]){var Ka=Object.create(null);for(zb in Za)if(null==Za[zb].content)for(var Ta=Za[zb],Qa=0;Qa<Ta.length;Qa++){var Ra=Ta[Qa];if(null!=Ra.tags)for(var $a=Ra.tags.toLowerCase().split(";"),ab=0;ab<$a.length;ab++)null==Ka[$a[ab]]&&(Ka[$a[ab]]=[]),Ka[$a[ab]].push(Ra)}NewDialog.tagsList[H]=Ka}var mb=Na.toLowerCase().split(" ");Ka=NewDialog.tagsList[H];if(0<yb&&null==Ka.__tagsList__){for(zb in Ab)for(Ta=
+Ab[zb],Qa=0;Qa<Ta.length;Qa++)for(Ra=Ta[Qa],$a=Ra.title.split(" "),$a.push(zb),ab=0;ab<$a.length;ab++){var sb=$a[ab].toLowerCase();null==Ka[sb]&&(Ka[sb]=[]);Ka[sb].push(Ra)}Ka.__tagsList__=!0}var zb=[];Ta={};for(Qa=$a=0;Qa<mb.length;Qa++)if(0<mb[Qa].length){sb=Ka[mb[Qa]];var Eb={};zb=[];if(null!=sb)for(ab=0;ab<sb.length;ab++)Ra=sb[ab],0==$a==(null==Ta[Ra.url])&&(Eb[Ra.url]=!0,zb.push(Ra));Ta=Eb;$a++}oa.scrollTop=0;oa.innerText="";Y=0;Ka=document.createElement("div");Ka.style.padding="6px";Ka.style.whiteSpace=
+"nowrap";Ka.style.overflow="hidden";Ka.style.textOverflow="ellipsis";Ra=mxResources.get(0==zb.length?"noResultsFor":"resultsFor",[Na]);Ka.setAttribute("title",Ra);mxUtils.write(Ka,Ra);oa.appendChild(Ka);null!=ib&&null==Wa&&(ib.style.backgroundColor="",Wa=ib,ib=Ka);db=zb;ea=null;E(!1)}mxEvent.consume(Fa)}}));mxEvent.addListener(Ja,"keyup",mxUtils.bind(this,function(Fa){""==Ja.value?(Ha.setAttribute("src",Editor.magnifyImage),Ha.setAttribute("title",mxResources.get("search"))):(Ha.setAttribute("src",
+Editor.crossImage),Ha.setAttribute("title",mxResources.get("reset")))}));Ea+=23;var Ma=document.createElement("div");Ma.style.cssText="position:absolute;left:30px;width:128px;top:"+Ea+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(oa,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var eb=140,bb=eb,tb=null,Db=null!=b.lastGenerateBackground?b.lastGenerateBackground:"url("+Editor.thinSparklesImage+")",cb=document.createElement("div");cb.className=
+"geGenerateDiagramForm";cb.style.position="absolute";cb.style.width="100%";cb.style.height="100%";var gb=document.createElement("div");gb.className="geTemplatePreview geAdaptiveAsset";gb.style.backgroundImage=Db;var wb=document.createElement("textarea");wb.setAttribute("placeholder",mxResources.get("describeYourDiagram"));wb.className="geGenerateDiagramDescription";var Sa=document.createElement("button");Sa.className="geBtn gePrimaryBtn geGenerateDiagramButton";Sa.setAttribute("disabled","disabled");
+Sa.setAttribute("title",mxResources.get("ok"));mxUtils.write(Sa,mxResources.get("ok"));var Xa=S.cloneNode(!0);Xa.style.display="none";var vb=!1;mxEvent.addGestureListeners(Xa,function(Fa){vb=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Fa){if(!vb&&null!=Ca){var Na="<mxfile><diagram>"+Graph.compress(Ca)+"</diagram></mxfile>";K(Na,mxEvent.getClientX(Fa),mxEvent.getClientY(Fa),tb,pa)}});var pb=S.cloneNode(!0);pb.setAttribute("src",Editor.editImage);pb.setAttribute("title",
+mxResources.get("edit"));pb.style.visibility="hidden";pb.style.left="0px";var jb=S.cloneNode(!0);jb.setAttribute("src",Editor.helpImage);jb.setAttribute("title",mxResources.get("help"));mxEvent.addListener(jb,"click",function(Fa){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Fa)});cb.appendChild(wb);cb.appendChild(Sa);cb.appendChild(jb);cb.style.display="none";mxEvent.addListener(pb,"click",M);mxEvent.addListener(wb,"input",O);var qb=!1;mxEvent.addListener(Sa,
+"click",function(){fa()});mxEvent.addListener(wb,"keydown",function(Fa){13!=Fa.keyCode||mxEvent.isShiftDown(Fa)?27==Fa.keyCode&&(fa(!0),mxEvent.consume(Fa)):(fa(),mxEvent.consume(Fa))});var Za={},Jb={},Ab={},yb=0,fb=!0,ib=null,Wa=null;Za.basic=B?[]:[{title:"blankDiagram"}];var db=Za.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&EditorUi.isMermaidSupported()&&Za.basic.push({title:"generate",type:"generative"});if(!k){var Hb=function(){mxUtils.get(Bb,function(Fa){if(!xb){xb=
+!0;Fa=Fa.getXml().documentElement.firstChild;for(var Na={};null!=Fa;){if("undefined"!==typeof Fa.getAttribute)if("parsererror"==Fa.nodeName)null!=window.console&&console.log("Parser error in "+H+": "+Fa.textContent);else if("clibs"==Fa.nodeName){for(var Ka=Fa.getAttribute("name"),Ta=Fa.getElementsByTagName("add"),Qa=[],Ra=0;Ra<Ta.length;Ra++)Qa.push(encodeURIComponent(mxUtils.getTextContent(Ta[Ra])));null!=Ka&&0<Qa.length&&(Na[Ka]=Qa.join(";"))}else ub({url:Fa.getAttribute("url"),section:Fa.getAttribute("section"),
+subsection:Fa.getAttribute("subsection"),libs:Fa.getAttribute("libs"),clibs:Fa.getAttribute("clibs"),title:Fa.getAttribute("title"),name:Fa.getAttribute("name"),preview:Fa.getAttribute("preview"),tags:Fa.getAttribute("tags")},Na);Fa=Fa.nextSibling}if(Array.isArray(EditorUi.customTemplates))for(Ra=0;Ra<EditorUi.customTemplates.length;Ra++)null!=EditorUi.customTemplates[Ra]&&ub(EditorUi.customTemplates[Ra],Na);X.stop();d()}})},ub=function(Fa,Na){var Ka=Fa.url;if(null!=Ka){var Ta=Fa.section,Qa=Fa.subsection;
+if(null==Ta){var Ra=Ka.indexOf("/");Ta=Ka.substring(0,Ra);if(null==Qa){var $a=Ka.indexOf("/",Ra+1);-1<$a&&(Qa=Ka.substring(Ra+1,$a))}}if(null==EditorUi.enabledTemplateSections||0<=mxUtils.indexOf(EditorUi.enabledTemplateSections,Ta))Ka=Za[Ta],null==Ka&&(Ka=[],Za[Ta]=Ka),Ra=Fa.clibs,null!=Na[Ra]&&(Ra=Na[Ra]),Fa={url:Fa.url,libs:Fa.libs,title:Fa.title,tooltip:Fa.name||Fa.url,preview:Fa.preview,clibs:Ra,tags:Fa.tags},Ka.push(Fa),null!=Qa&&(Na=Jb[Ta],null==Na&&(Na={},Jb[Ta]=Na),Ta=Na[Qa],null==Ta&&(Ta=
+[],Na[Qa]=Ta),Ta.push(Fa))}};G.appendChild(Ga);G.appendChild(Ma);G.appendChild(oa);var xb=!1,Bb=H;/^https?:\/\//.test(Bb)&&!b.editor.isCorsEnabledForUrl(Bb)&&(Bb=PROXY_URL+"?url="+encodeURIComponent(Bb));X.spin(oa);null!=r?r(function(Fa,Na){Ab=Fa;ra=yb=Na;Hb()},Hb):Hb();ka=Za}mxEvent.addListener(Q,"keypress",function(Fa){b.dialog.container.firstChild==G&&13==Fa.keyCode&&C()});var lb=document.createElement("div");lb.style.marginTop=k?"4px":"16px";lb.style.textAlign="right";lb.style.position="absolute";
+lb.style.left="40px";lb.style.bottom="24px";lb.style.right="40px";var Gb=mxUtils.button(mxResources.get("cancel"),function(){null!=u&&u();b.hideDialog(!0)});Gb.className="geBtn";!b.editor.cancelFirst||q&&null==u||lb.appendChild(Gb);if(!(k||"1"==urlParams.embed||q||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Mb=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Fa=new FilenameDialog(b,"",mxResources.get("create"),function(Na){null!=Na&&0<Na.length&&b.editor.loadUrl(b.editor.getProxiedUrl(Na),
+function(Ka){na=Ka;ia=null;templateRealURl=Na;b.hideDialog();C()},function(Ka){b.handleError(Ka)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Fa.container,300,80,!0,!0);Fa.init()});Mb.className="geBtn";lb.appendChild(Mb)}if(Graph.fileSupport&&l){var Qb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Fa=document.createElement("input");Fa.setAttribute("multiple","multiple");Fa.setAttribute("type","file");mxEvent.addListener(Fa,"change",function(Na){b.openFiles(Fa.files,
+!0);Fa.value=""});Fa.style.display="none";document.body.appendChild(Fa);b.newDlgFileInputElt=Fa}b.newDlgFileInputElt.click()});Qb.className="geBtn";lb.appendChild(Qb)}lb.appendChild(ca);b.editor.cancelFirst||null!=g||q&&null==u||lb.appendChild(Gb);G.appendChild(lb);this.container=G};NewDialog.tagsList=Object.create(null);
+var SaveDialog=function(b,k,m,g,q,u,x,z,F,I,H){function D(y,d,p,A,G,J){var L=null;if(y!=App.MODE_DROPBOX&&(null==g||0>mxUtils.indexOf(g,y))&&(null==F||y==F)&&(null==I||0<=mxUtils.indexOf(I,y))){G=null!=G?G:b.getTitleForService(y);var P=0<=mxUtils.indexOf(U,y);if(P||null!=b.getServiceForName(y)){L=document.createElement("option");var Q="";!P&&b.isOffline(y==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(L.setAttribute("disabled","disabled"),Q=" ("+mxResources.get("offline")+")");if("pick"==J)L.innerHTML=
+mxUtils.htmlEntities(G)+"&nbsp;&nbsp;&#8211&nbsp;&nbsp;"+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+Q,L.setAttribute("value","pickFolder-"+y),L.setAttribute("title",G+" - "+mxResources.get("pickFolder")+"...");else{P=y+(null!=p?"-"+p:"");var ba=V[P];null!=ba&&null!=ba.option&&ba.option.parentNode.removeChild(ba.option);ba=null;if(null!=d){"/"==d.charAt(d.length-1)&&(d=d.substring(0,d.length-1));"/"==d.charAt(0)&&(d=d.substring(1));ba=d;if(y!=App.MODE_GITHUB&&y==App.MODE_GITLAB){var W=
+ba.lastIndexOf("/");0<=W&&(ba=ba.substring(W+1))}40<ba.length&&(ba=ba.substring(0,20)+"..."+ba.substring(ba.length-20))}L.innerHTML=mxUtils.htmlEntities(G)+(null!=ba?"&nbsp;&nbsp;&#8211&nbsp;&nbsp;"+mxUtils.htmlEntities(ba):"")+Q;L.setAttribute("title",G+(null!=d?" ("+d+")":"")+(null!=p&&decodeURIComponent(p)!=d?" ["+p+"]":""));L.setAttribute("value",P);V[P]={option:L,mode:y,path:d,id:p};SaveDialog.lastValue==P&&null==z&&"disabled"==!L.getAttribute("disabled")?A=!0:null==A&&("root"==J?A=null==z&&
b.mode==y||null!=y&&y==z:"pickFolder-"==O.value.substring(0,11)&&(A=!0));A&&L.setAttribute("selected","selected")}O.appendChild(L)}}return L}function c(y){b.pickFolder(y,function(d){var p=null;y==App.MODE_GOOGLE&&null!=d.docs&&0<d.docs.length?p={mode:y,path:d.docs[0].name,id:d.docs[0].id}:y==App.MODE_ONEDRIVE&&null!=d.value&&0<d.value.length?p={mode:y,path:d.value[0].name,id:OneDriveFile.prototype.getIdOf(d.value[0])}:y==App.MODE_M365&&null!=d.value&&0<d.value.length?p={mode:y,path:d.value[0].name,
id:OneDriveFile.prototype.getIdOf(d.value[0])}:(y==App.MODE_GITHUB||y==App.MODE_GITLAB)&&null!=d&&0<d.length&&(p={mode:y,path:decodeURIComponent(d),id:d});null!=p&&(b.addRecent(p,"Folders",5),d=D(p.mode,p.path,p.id,!0),O.innerHTML="",V={},f(),p=O.selectedIndex,O.value=d.value,0>O.selectedIndex&&(O.selectedIndex=p))},!0,!0,!0,!0)}function f(){var y=b.getRecent("Folders"),d=0;if(null!=y&&0<y.length)for(var p=0;p<y.length;p++)null!=D(y[p].mode,y[p].path,y[p].id)&&d++;D(App.MODE_GOOGLE,mxResources.get("myDrive"),
"root",null,null,"root");D(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(D(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),D(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.m365&&D(App.MODE_M365,null,null,null,null,"pick");D(App.MODE_GITHUB,null,null,null,null,"pick");D(App.MODE_GITLAB,null,null,null,null,"pick");D(App.MODE_TRELLO);y="1"!=urlParams.noDevice&&(!Editor.useLocalStorage||"device"==urlParams.storage||
@@ -13258,8 +13259,8 @@ document.createElement("div");E.style.display="flex";E.style.padding="1px";E.sty
k);R.style.boxSizing="border-box";R.style.width="100%";C.appendChild(R);null==F&&(r.appendChild(E),r.appendChild(C));var M=null;null!=b.editor.diagramFileTypes&&null==u&&null==F&&(E=E.cloneNode(!1),C=C.cloneNode(!1),mxUtils.write(E,mxResources.get("type")+":"),M=FilenameDialog.createFileTypes(b,R,b.editor.diagramFileTypes),M.style.boxSizing="border-box",M.style.width="100%",C.appendChild(M),r.appendChild(E),r.appendChild(C));E=E.cloneNode(!1);C=C.cloneNode(!1);mxUtils.write(E,mxResources.get("where")+
":");var O=document.createElement("select");O.style.textOverflow="ellipsis";O.style.gridColumn="1";var U=["browser","device","download","_blank"],T=null,V={};B=mxUtils.button(mxResources.get("reset"),function(){R.value=k;R.dispatchEvent(new Event("change"));b.resetRecent("Folders");O.innerHTML="";O.value="";pickFolderOption=null;V={};f()},null,"geBtn");var fa=mxUtils.button("",function(){SaveDialog.lastValue=O.value;var y=V[SaveDialog.lastValue];null!=y&&m(R,y.mode,y.id)},null,"geBtn gePrimaryBtn");
mxEvent.addListener(R,"keypress",function(y){13==y.keyCode&&("copy"==z&&null!=v?v.click():fa.click())});mxEvent.addListener(O,"change",l);f();C.appendChild(O);null!=SaveDialog.lastValue&&null!=V[SaveDialog.lastValue]&&(O.value=SaveDialog.lastValue);l();r.appendChild(E);r.appendChild(C);n.appendChild(r);null!=t&&n.appendChild(t);r=document.createElement("div");r.style.flexBasis="100%";r.style.textAlign="right";r.style.marginTop="20px";b.isOffline()&&!mxClient.IS_CHROMEAPP||r.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));
-t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&r.appendChild(t);r.appendChild(B);"copy"==z&&null!=v?(v.className="geBtn gePrimaryBtn",fa.className="geBtn",r.appendChild(fa),r.appendChild(v)):(null!=v&&r.appendChild(v),r.appendChild(fa));b.editor.cancelFirst||r.appendChild(t);n.appendChild(r);this.init=function(){Editor.selectFilename(R)};this.container=n},CreateDialog=function(b,k,m,g,q,u,x,z,F,J,H,D,c,f,l,n,r){function t(O,U,T,V){function fa(){mxEvent.addListener(y,
-"click",function(){var I=T;if(x){var L=E.value,P=L.lastIndexOf(".");if(0>k.lastIndexOf(".")&&0>P){I=null!=I?I:M.value;var Q="";I==App.MODE_GOOGLE?Q=b.drive.extension:I==App.MODE_GITHUB?Q=b.gitHub.extension:I==App.MODE_GITLAB?Q=b.gitLab.extension:I==App.MODE_TRELLO?Q=b.trello.extension:I==App.MODE_DROPBOX?Q=b.dropbox.extension:I==App.MODE_ONEDRIVE?Q=b.oneDrive.extension:I==App.MODE_DEVICE&&(Q=".drawio");0<=P&&(L=L.substring(0,P));E.value=L+Q}}v(T)})}var y=document.createElement("a");y.style.overflow=
+t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&r.appendChild(t);r.appendChild(B);"copy"==z&&null!=v?(v.className="geBtn gePrimaryBtn",fa.className="geBtn",r.appendChild(fa),r.appendChild(v)):(null!=v&&r.appendChild(v),r.appendChild(fa));b.editor.cancelFirst||r.appendChild(t);n.appendChild(r);this.init=function(){Editor.selectFilename(R)};this.container=n},CreateDialog=function(b,k,m,g,q,u,x,z,F,I,H,D,c,f,l,n,r){function t(O,U,T,V){function fa(){mxEvent.addListener(y,
+"click",function(){var J=T;if(x){var L=E.value,P=L.lastIndexOf(".");if(0>k.lastIndexOf(".")&&0>P){J=null!=J?J:M.value;var Q="";J==App.MODE_GOOGLE?Q=b.drive.extension:J==App.MODE_GITHUB?Q=b.gitHub.extension:J==App.MODE_GITLAB?Q=b.gitLab.extension:J==App.MODE_TRELLO?Q=b.trello.extension:J==App.MODE_DROPBOX?Q=b.dropbox.extension:J==App.MODE_ONEDRIVE?Q=b.oneDrive.extension:J==App.MODE_DEVICE&&(Q=".drawio");0<=P&&(L=L.substring(0,P));E.value=L+Q}}v(T)})}var y=document.createElement("a");y.style.overflow=
"hidden";var d=document.createElement("img");d.src=O;d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width="60px";d.style.height="60px";d.style.paddingBottom="6px";y.style.display="inline-block";y.className="geBaseButton";y.style.position="relative";y.style.margin="4px";y.style.padding="8px 8px 10px 8px";y.style.whiteSpace="nowrap";y.appendChild(d);y.style.color="gray";y.style.fontSize="11px";var p=document.createElement("div");y.appendChild(p);mxUtils.write(p,U);if(null!=
V&&null==b[V]){d.style.visibility="hidden";mxUtils.setOpacity(p,10);var A=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});A.spin(y);var G=window.setTimeout(function(){null==b[V]&&(A.stop(),y.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[V]&&(window.clearTimeout(G),mxUtils.setOpacity(p,100),d.style.visibility="",A.stop(),fa())}))}else fa();C.appendChild(y);
++R==D&&(mxUtils.br(C),R=0)}function v(O){var U=E.value;if(null==O||null!=U&&0<U.length)r&&b.hideDialog(),m(U,O,E)}H="1"==urlParams.noDevice?!1:H;x=null!=x?x:!0;z=null!=z?z:!0;D=null!=D?D:4;r=null!=r?r:!0;u=document.createElement("div");u.style.whiteSpace="nowrap";null==g&&b.addLanguageMenu(u);var B=document.createElement("h2");mxUtils.write(B,q||mxResources.get("create"));B.style.marginTop="0px";B.style.marginBottom="24px";u.appendChild(B);q=document.createElement("span");mxUtils.write(q,mxResources.get("filename")+
@@ -13271,15 +13272,15 @@ mxUtils.write(c,mxResources.get("googleDrive")),M.appendChild(c),t(IMAGE_PATH+"/
null!=b.m365&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_M365),mxUtils.write(c,mxResources.get("m365")),M.appendChild(c),b.mode==App.MODE_M365&&c.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365")),null!=b.gitHub&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITHUB),mxUtils.write(c,mxResources.get("github")),M.appendChild(c),t(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,
"gitHub")),null!=b.gitLab&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITLAB),mxUtils.write(c,mxResources.get("gitlab")),M.appendChild(c),t(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_TRELLO),mxUtils.write(c,mxResources.get("trello")),M.appendChild(c),t(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));
if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)c=document.createElement("option"),c.setAttribute("value",App.MODE_DEVICE),mxUtils.write(c,mxResources.get("device")),M.appendChild(c),b.mode!=App.MODE_DEVICE&&z||c.setAttribute("selected","selected"),H&&t(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);z&&isLocalStorage&&"0"!=urlParams.browser&&(z=document.createElement("option"),z.setAttribute("value",App.MODE_BROWSER),
-mxUtils.write(z,mxResources.get("browser")),M.appendChild(z),b.mode==App.MODE_BROWSER&&z.setAttribute("selected","selected"),t(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));z=document.createElement("div");z.style.marginTop="26px";z.style.textAlign="center";null!=J&&(H=mxUtils.button(mxResources.get("help"),function(){b.openLink(J)}),H.className="geBtn",z.appendChild(H));H=mxUtils.button(mxResources.get(null!=g?"close":"cancel"),function(){null!=g?g():(b.fileLoaded(null),
+mxUtils.write(z,mxResources.get("browser")),M.appendChild(z),b.mode==App.MODE_BROWSER&&z.setAttribute("selected","selected"),t(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));z=document.createElement("div");z.style.marginTop="26px";z.style.textAlign="center";null!=I&&(H=mxUtils.button(mxResources.get("help"),function(){b.openLink(I)}),H.className="geBtn",z.appendChild(H));H=mxUtils.button(mxResources.get(null!=g?"close":"cancel"),function(){null!=g?g():(b.fileLoaded(null),
b.hideDialog(),window.close(),window.location.href=b.getUrl())});H.className="geBtn";b.editor.cancelFirst&&null==g&&z.appendChild(H);null==g&&(c=mxUtils.button(mxResources.get("decideLater"),function(){v(null)}),c.className="geBtn",z.appendChild(c));F&&Editor.popupsAllowed&&(F=mxUtils.button(mxResources.get("openInNewWindow"),function(){v("_blank")}),F.className="geBtn",z.appendChild(F));CreateDialog.showDownloadButton&&(F=mxUtils.button(mxResources.get("download"),function(){v("download")}),F.className=
"geBtn",z.appendChild(F),null!=n&&(F.style.marginTop="6px",z.style.marginTop="6px"));null!=n&&(mxUtils.br(z),z.appendChild(n));b.editor.cancelFirst&&null==g||z.appendChild(H);mxEvent.addListener(E,"keypress",function(O){13==O.keyCode?v(App.MODE_DEVICE):27==O.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});u.appendChild(z);this.container=u};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;
var PopupDialog=function(b,k,m,g,q){q=null!=q?q:!0;var u=document.createElement("div");u.style.textAlign="center";u.style.height="100%";mxUtils.write(u,mxResources.get("fileOpenLocation"));mxUtils.br(u);mxUtils.br(u);var x=mxUtils.button(mxResources.get("openInThisWindow"),function(){q&&b.hideDialog();null!=g&&g()});x.className="geBtn";x.style.marginBottom="8px";x.style.width="280px";u.appendChild(x);mxUtils.br(u);var z=mxUtils.button(mxResources.get("openInNewWindow"),function(){q&&b.hideDialog();
-null!=m&&m();b.openLink(k,null,!0)});z.className="geBtn gePrimaryBtn";z.style.width=x.style.width;u.appendChild(z);mxUtils.br(u);mxUtils.br(u);mxUtils.write(u,mxResources.get("allowPopups"));this.container=u},ImageDialog=function(b,k,m,g,q,u,x,z){function F(){0<D.value.length?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled");"data:"!=D.value.substring(0,5)?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}u=null!=u?u:!0;var J=b.editor.graph,H=document.createElement("div");
+null!=m&&m();b.openLink(k,null,!0)});z.className="geBtn gePrimaryBtn";z.style.width=x.style.width;u.appendChild(z);mxUtils.br(u);mxUtils.br(u);mxUtils.write(u,mxResources.get("allowPopups"));this.container=u},ImageDialog=function(b,k,m,g,q,u,x,z){function F(){0<D.value.length?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled");"data:"!=D.value.substring(0,5)?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}u=null!=u?u:!0;var I=b.editor.graph,H=document.createElement("div");
mxUtils.write(H,k);k=document.createElement("div");k.className="geTitle";k.style.backgroundColor="transparent";k.style.borderColor="transparent";k.style.whiteSpace="nowrap";k.style.textOverflow="clip";k.style.cursor="default";k.style.paddingRight="20px";var D=document.createElement("input");D.setAttribute("value",m);D.setAttribute("type","text");D.setAttribute("spellcheck","false");D.setAttribute("autocorrect","off");D.setAttribute("autocomplete","off");D.setAttribute("autocapitalize","off");D.style.marginTop=
"6px";D.style.width=(Graph.fileSupport?460:340)-20+"px";D.style.backgroundImage="url('"+Editor.crossImage+"')";D.style.backgroundRepeat="no-repeat";D.style.backgroundPosition="100% 50%";D.style.paddingRight="14px";m=document.createElement("div");m.setAttribute("title",mxResources.get("reset"));m.style.position="relative";m.style.left="-16px";m.style.width="12px";m.style.height="14px";m.style.cursor="pointer";m.style.display="inline-block";m.style.top="3px";m.style.background="url('"+b.editor.transparentImage+
"')";mxEvent.addListener(m,"click",function(){D.value="";D.focus()});k.appendChild(D);k.appendChild(m);H.appendChild(k);var c=z,f,l,n=function(E,K,C,R){var M="data:"==E.substring(0,5);!b.isOffline()||M&&"undefined"===typeof chrome?0<E.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(E,function(O){b.spinner.stop();b.hideDialog();var U=!1===R?1:null!=K&&null!=C?Math.max(K/O.width,C/O.height):Math.min(1,Math.min(520/O.width,520/O.height));u&&(E=b.convertDataUri(E));g(E,
-Math.round(Number(O.width)*U),Math.round(Number(O.height)*U),c,f,l)},function(){b.spinner.stop();g(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),g(E,null,null,c,f,l)):(E=b.convertDataUri(E),K=null==K?120:K,C=null==C?100:C,b.hideDialog(),g(E,K,C,c,f,l))},r=function(E,K){if(null!=E){var C=q?null:J.getModel().getGeometry(J.getSelectionCell());null!=C?n(E,C.width,C.height,K):n(E,null,null,K)}else b.hideDialog(),g(null)};this.init=function(){D.focus();
+Math.round(Number(O.width)*U),Math.round(Number(O.height)*U),c,f,l)},function(){b.spinner.stop();g(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),g(E,null,null,c,f,l)):(E=b.convertDataUri(E),K=null==K?120:K,C=null==C?100:C,b.hideDialog(),g(E,K,C,c,f,l))},r=function(E,K){if(null!=E){var C=q?null:I.getModel().getGeometry(I.getSelectionCell());null!=C?n(E,C.width,C.height,K):n(E,null,null,K)}else b.hideDialog(),g(null)};this.init=function(){D.focus();
if(Graph.fileSupport){D.setAttribute("placeholder",mxResources.get("dragImagesHere"));var E=H.parentNode,K=null;mxEvent.addListener(E,"dragleave",function(C){null!=K&&(K.parentNode.removeChild(K),K=null);C.stopPropagation();C.preventDefault()});mxEvent.addListener(E,"dragover",mxUtils.bind(this,function(C){null==K&&(K=b.highlightElement(E));C.stopPropagation();C.preventDefault()}));mxEvent.addListener(E,"drop",mxUtils.bind(this,function(C){null!=K&&(K.parentNode.removeChild(K),K=null);if(0<C.dataTransfer.files.length)b.importFiles(C.dataTransfer.files,
0,0,b.maxImageSize,function(M,O,U,T,V,fa,y,d){r(M,d)},function(){},function(M){return"image/"==M.type.substring(0,6)},function(M){for(var O=0;O<M.length;O++)M[O]()},!mxEvent.isControlDown(C),null,null,!0);else if(0<=mxUtils.indexOf(C.dataTransfer.types,"text/uri-list")){var R=C.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(R)&&r(decodeURIComponent(R))}C.stopPropagation();C.preventDefault()}),!1)}};z=document.createElement("div");z.style.marginTop="14px";z.style.textAlign=
"center";m=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});m.className="geBtn";b.editor.cancelFirst&&z.appendChild(m);ImageDialog.filePicked=function(E){E.action==google.picker.Action.PICKED&&null!=E.docs[0].thumbnails&&(E=E.docs[0].thumbnails[E.docs[0].thumbnails.length-1],null!=E&&(D.value=E.url));D.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var t=document.createElement("input");t.setAttribute("multiple","multiple");t.setAttribute("type",
@@ -13288,133 +13289,134 @@ if(Graph.fileSupport){D.setAttribute("placeholder",mxResources.get("dragImagesHe
K=new Image;K.onload=function(){b.editor.convertImageToDataUri(E,function(C){b.confirmImageResize(function(R){b.resizeImage(K,C,mxUtils.bind(this,function(M,O,U){b.spinner.stop();null!=M&&M.length<b.maxImageBytes?(D.value=M,F()):b.handleError({message:mxResources.get("imageTooBig")})}),R,b.maxImageSize)},K.width>b.maxImageSize||K.height>b.maxImageSize||C.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};K.onerror=function(){b.spinner.stop();
b.handleError({message:mxResources.get("fileNotFound")})};K.src=E}});B.className="geBtn";mxEvent.addListener(D,"change",function(E){c=null;F()});F();z.appendChild(B);x=mxUtils.button(mxResources.get("apply"),function(){r(D.value)});x.className="geBtn gePrimaryBtn";z.appendChild(x);b.editor.cancelFirst||z.appendChild(m);Graph.fileSupport&&(z.style.marginTop="120px",H.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",H.style.backgroundPosition="center 65%",H.style.backgroundRepeat="no-repeat",
x=document.createElement("div"),x.style.position="absolute",x.style.width="420px",x.style.top="58%",x.style.textAlign="center",x.style.fontSize="18px",x.style.color="#a0c3ff",mxUtils.write(x,mxResources.get("dragImagesHere")),H.appendChild(x));H.appendChild(z);this.container=H},LinkDialog=function(b,k,m,g,q,u,x){function z(M,O){var U=document.createElement("option");mxUtils.write(U,mxResources.get(M));U.value=M;C.appendChild(U);R[M]=O}var F=document.createElement("div");F.style.paddingBottom="10px";
-var J=document.createElement("h3");mxUtils.write(J,mxResources.get("editLink"));F.appendChild(J);var H=document.createElement("input");H.setAttribute("value","url");H.setAttribute("type","radio");H.setAttribute("name","geLinkDialogOption");var D=document.createElement("input");D.setAttribute("value","url");D.setAttribute("type","radio");D.setAttribute("name","geLinkDialogOption");var c=document.createElement("input");c.setAttribute("value","action");c.setAttribute("type","radio");c.setAttribute("name",
+var I=document.createElement("h3");mxUtils.write(I,mxResources.get("editLink"));F.appendChild(I);var H=document.createElement("input");H.setAttribute("value","url");H.setAttribute("type","radio");H.setAttribute("name","geLinkDialogOption");var D=document.createElement("input");D.setAttribute("value","url");D.setAttribute("type","radio");D.setAttribute("name","geLinkDialogOption");var c=document.createElement("input");c.setAttribute("value","action");c.setAttribute("type","radio");c.setAttribute("name",
"geLinkDialogOption");var f=null!=k&&"data:action/json,"==k.substring(0,17)?k:null,l=document.createElement("input");l.setAttribute("placeholder",mxResources.get("dragUrlsHere"));l.setAttribute("type","text");l.style.flex="1";l.style.minWidth="0";var n=document.createElement("div");n.setAttribute("title",mxResources.get("reset"));n.style.backgroundImage="url("+Editor.crossImage+")";n.className="geAdaptiveAsset";n.style.width="12px";n.style.height="14px";n.style.cursor="pointer";n.style.flexShrink=
-"0";n.style.marginLeft="-20px";n.style.marginRight="8px";mxEvent.addListener(n,"click",function(){l.value="";l.focus()});var r=document.createElement("select");r.style.flex="1";r.style.minWidth="0";r.style.marginLeft="0";var t=document.createElement("input");t.setAttribute("type","checkbox");null!=x&&(t.setAttribute("checked","checked"),t.defaultChecked=!0);x=null!=x?x:"_blank";t.setAttribute("title",x);J=document.createElement("div");J.className="geDialogSection";if(q&&null!=b.pages){null!=f?(c.setAttribute("checked",
+"0";n.style.marginLeft="-20px";n.style.marginRight="8px";mxEvent.addListener(n,"click",function(){l.value="";l.focus()});var r=document.createElement("select");r.style.flex="1";r.style.minWidth="0";r.style.marginLeft="0";var t=document.createElement("input");t.setAttribute("type","checkbox");null!=x&&(t.setAttribute("checked","checked"),t.defaultChecked=!0);x=null!=x?x:"_blank";t.setAttribute("title",x);I=document.createElement("div");I.className="geDialogSection";if(q&&null!=b.pages){null!=f?(c.setAttribute("checked",
"checked"),c.defaultChecked=!0):null!=k&&Graph.isPageLink(k)?(D.setAttribute("checked","checked"),D.defaultChecked=!0):(l.setAttribute("value",k),H.setAttribute("checked","checked"),H.defaultChecked=!0);q=document.createElement("div");q.className="geDialogCheckRow";q.appendChild(H);q.appendChild(l);q.appendChild(n);u&&(u=document.createElement("label"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px",u.style.marginLeft="8px",u.style.whiteSpace="nowrap",u.style.fontSize="13px",
-u.appendChild(t),mxUtils.write(u,mxResources.get("openInNewWindow")),q.appendChild(u));J.appendChild(q);u=!1;for(q=0;q<b.pages.length;q++)n=document.createElement("option"),mxUtils.write(n,b.pages[q].getName()||mxResources.get("pageWithNumber",[q+1])),n.setAttribute("value","data:page/id,"+b.pages[q].getId()),k==n.getAttribute("value")&&(n.setAttribute("selected","selected"),u=!0),r.appendChild(n);if(!u&&D.checked){var v=document.createElement("option");mxUtils.write(v,mxResources.get("pageNotFound"));
-v.setAttribute("disabled","disabled");v.setAttribute("selected","selected");v.setAttribute("value","pageNotFound");r.appendChild(v);mxEvent.addListener(r,"change",function(){null==v.parentNode||v.selected||v.parentNode.removeChild(v)})}u=document.createElement("div");u.className="geDialogCheckRow";u.style.marginTop="6px";u.appendChild(D);u.appendChild(r);J.appendChild(u);u=document.createElement("div");u.className="geDialogCheckRow";u.style.marginTop="6px";u.appendChild(c);var B=document.createElement("span");
-B.style.cssText="flex:1;min-width:0;font-size:13px;line-height:1.5;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px";var E=mxUtils.button("",function(){c.checked=!0;LinkDialog.editCustomAction(b,f,function(M){f=M;g(M,LinkDialog.selectedDocs,t.checked?x:null)})});E.className="geBtn";(function(){B.textContent="";if(null==f)mxUtils.write(B,mxResources.get("action")),E.textContent=mxResources.get("insert");
-else{E.textContent=mxResources.get("edit");try{var M=JSON.parse(f.substring(17));if("string"==typeof M.title&&""!=M.title.trim())var O=M.title.trim();else{var U=0<(null!=M.actions?M.actions.length:0)?Object.keys(M.actions[0])[0]:"";if("animation"==U&&null!=M.actions[0].animation.steps){var T=M.actions[0].animation.steps.length;O=mxResources.get("effects")+" ("+T+")"}else if(""!=U){var V=null!=CustomActionDialog?CustomActionDialog.SCHEMAS[U]:null;O=mxResources.get(null!=V&&V.labelKey?V.labelKey:U,
-null,null!=V?V.label:U)}else O=mxResources.get("action")}mxUtils.write(B,O)}catch(fa){mxUtils.write(B,"("+mxResources.get("invalid")+")")}}})();u.appendChild(B);E.style.marginLeft="8px";u.appendChild(E);J.appendChild(u)}else l.setAttribute("value",k),q=document.createElement("div"),q.className="geDialogFormRow",q.appendChild(l),q.appendChild(n),J.appendChild(q);F.appendChild(J);var K=mxUtils.button(m,function(){b.hideDialog();g(c.checked?null!=f?f:k:D.checked?"pageNotFound"!==r.value?r.value:k:l.value,
-LinkDialog.selectedDocs,t.checked?x:null)});K.style.verticalAlign="middle";K.className="geBtn gePrimaryBtn";this.init=function(){D.checked?r.focus():(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(r,"focus",function(){H.removeAttribute("checked");D.setAttribute("checked","checked");D.checked=!0});mxEvent.addListener(l,"focus",function(){D.removeAttribute("checked");H.setAttribute("checked","checked");H.checked=
-!0});if(Graph.fileSupport&&null!=F.parentNode){var M=F.parentNode,O=null;mxEvent.addListener(M,"dragleave",function(U){null!=O&&(O.parentNode.removeChild(O),O=null);U.stopPropagation();U.preventDefault()});mxEvent.addListener(M,"dragover",mxUtils.bind(this,function(U){null==O&&(O=b.highlightElement(M));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(M,"drop",mxUtils.bind(this,function(U){try{null!=O&&(O.parentNode.removeChild(O),O=null),0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")&&
-(l.value=decodeURIComponent(U.dataTransfer.getData("text/uri-list")),H.setAttribute("checked","checked"),H.checked=!0,K.click())}catch(T){b.handleError(T)}U.stopPropagation();U.preventDefault()}),!1)}};m=document.createElement("div");m.style.marginTop="34px";m.style.textAlign="right";b.isOffline()||m.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));J=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});J.style.verticalAlign="middle";J.className="geBtn";
-b.editor.cancelFirst&&m.appendChild(J);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(M){if(M.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=M.docs;var O=M.docs[0].url;"application/mxe"==M.docs[0].mimeType||null!=M.docs[0].mimeType&&"application/vnd.jgraph."==M.docs[0].mimeType.substring(0,23)?O="https://app.diagrams.net/#G"+M.docs[0].id:"application/vnd.google-apps.folder"==M.docs[0].mimeType&&(O="https://drive.google.com/#folders/"+M.docs[0].id);l.value=O;l.focus()}else LinkDialog.selectedDocs=
+u.appendChild(t),mxUtils.write(u,mxResources.get("openInNewWindow")),q.appendChild(u));I.appendChild(q);u=!1;for(q=0;q<b.pages.length;q++)n=document.createElement("option"),mxUtils.write(n,b.pages[q].getName()||mxResources.get("pageWithNumber",[q+1])),n.setAttribute("value","data:page/id,"+b.pages[q].getId()),k==n.getAttribute("value")&&(n.setAttribute("selected","selected"),u=!0),r.appendChild(n);if(!u&&D.checked){var v=document.createElement("option");mxUtils.write(v,mxResources.get("pageNotFound"));
+v.setAttribute("disabled","disabled");v.setAttribute("selected","selected");v.setAttribute("value","pageNotFound");r.appendChild(v);mxEvent.addListener(r,"change",function(){null==v.parentNode||v.selected||v.parentNode.removeChild(v)})}u=document.createElement("div");u.className="geDialogCheckRow";u.style.marginTop="6px";u.appendChild(D);u.appendChild(r);I.appendChild(u);u=document.createElement("div");u.className="geDialogCheckRow";u.style.marginTop="6px";u.appendChild(c);var B=document.createElement("span");
+B.style.cssText="flex:1;min-width:0;font-size:13px;line-height:1.5;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px";var E=mxUtils.button("",function(){c.checked=!0;LinkDialog.editCustomAction(b,f,function(M){f=M;g(M,LinkDialog.selectedDocs,t.checked?x:null)},b.editor.graph.getSelectionCells())});E.className="geBtn";(function(){B.textContent="";if(null==f)mxUtils.write(B,mxResources.get("action")),E.textContent=
+mxResources.get("insert");else{E.textContent=mxResources.get("edit");try{var M=JSON.parse(f.substring(17));if("string"==typeof M.title&&""!=M.title.trim())var O=M.title.trim();else{var U=0<(null!=M.actions?M.actions.length:0)?Object.keys(M.actions[0])[0]:"";if("animation"==U&&null!=M.actions[0].animation.steps){var T=M.actions[0].animation.steps.length;O=mxResources.get("effects")+" ("+T+")"}else if(""!=U){var V=null!=CustomActionDialog?CustomActionDialog.SCHEMAS[U]:null;O=mxResources.get(null!=V&&
+V.labelKey?V.labelKey:U,null,null!=V?V.label:U)}else O=mxResources.get("action")}mxUtils.write(B,O)}catch(fa){mxUtils.write(B,"("+mxResources.get("invalid")+")")}}})();u.appendChild(B);E.style.marginLeft="8px";u.appendChild(E);I.appendChild(u)}else l.setAttribute("value",k),q=document.createElement("div"),q.className="geDialogFormRow",q.appendChild(l),q.appendChild(n),I.appendChild(q);F.appendChild(I);var K=mxUtils.button(m,function(){b.hideDialog();g(c.checked?null!=f?f:k:D.checked?"pageNotFound"!==
+r.value?r.value:k:l.value,LinkDialog.selectedDocs,t.checked?x:null)});K.style.verticalAlign="middle";K.className="geBtn gePrimaryBtn";this.init=function(){D.checked?r.focus():(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(r,"focus",function(){H.removeAttribute("checked");D.setAttribute("checked","checked");D.checked=!0});mxEvent.addListener(l,"focus",function(){D.removeAttribute("checked");H.setAttribute("checked",
+"checked");H.checked=!0});if(Graph.fileSupport&&null!=F.parentNode){var M=F.parentNode,O=null;mxEvent.addListener(M,"dragleave",function(U){null!=O&&(O.parentNode.removeChild(O),O=null);U.stopPropagation();U.preventDefault()});mxEvent.addListener(M,"dragover",mxUtils.bind(this,function(U){null==O&&(O=b.highlightElement(M));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(M,"drop",mxUtils.bind(this,function(U){try{null!=O&&(O.parentNode.removeChild(O),O=null),0<=mxUtils.indexOf(U.dataTransfer.types,
+"text/uri-list")&&(l.value=decodeURIComponent(U.dataTransfer.getData("text/uri-list")),H.setAttribute("checked","checked"),H.checked=!0,K.click())}catch(T){b.handleError(T)}U.stopPropagation();U.preventDefault()}),!1)}};m=document.createElement("div");m.style.marginTop="34px";m.style.textAlign="right";b.isOffline()||m.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));I=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});I.style.verticalAlign="middle";I.className=
+"geBtn";b.editor.cancelFirst&&m.appendChild(I);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(M){if(M.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=M.docs;var O=M.docs[0].url;"application/mxe"==M.docs[0].mimeType||null!=M.docs[0].mimeType&&"application/vnd.jgraph."==M.docs[0].mimeType.substring(0,23)?O="https://app.diagrams.net/#G"+M.docs[0].id:"application/vnd.google-apps.folder"==M.docs[0].mimeType&&(O="https://drive.google.com/#folders/"+M.docs[0].id);l.value=O;l.focus()}else LinkDialog.selectedDocs=
null;l.focus()};var C=document.createElement("select");C.className="geBtn";C.style.position="relative";C.style.top="1px";C.style.maxWidth="120px";var R={};u=document.createElement("option");mxUtils.write(u,mxResources.get("select")+"...");u.value="";C.appendChild(u);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&z("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==
b.linkPicker){var M=b.drive.createLinkPicker();b.linkPicker=M.setCallback(function(O){LinkDialog.filePicked(O)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&z("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(M){l.value=M[0].link;l.focus()}})});null!=b.oneDrive&&z("oneDrive",function(){b.oneDrive.pickFile(function(M,O){null!=O&&null!=O.value&&0<O.value.length&&(l.value=O.value[0].webUrl,l.focus())},
!0)});null!=b.gitHub&&z("github",function(){b.gitHub.pickFile(function(M){if(null!=M){M=M.split("/");var O=M[0],U=M[1],T=M[2];M=M.slice(3,M.length).join("/");l.value="https://github.com/"+O+"/"+U+"/blob/"+T+"/"+M;l.focus()}})});null!=b.gitLab&&z("gitlab",function(){b.gitLab.pickFile(function(M){if(null!=M){M=M.split("/");var O=M[0],U=M[1],T=M[2];M=M.slice(3,M.length).join("/");l.value=DRAWIO_GITLAB_URL+"/"+O+"/"+U+"/blob/"+T+"/"+M;l.focus()}})});1<C.children.length&&(m.appendChild(C),mxEvent.addListener(C,
-"change",function(M){null!=R[C.value]&&(R[C.value](),C.value="")}));mxEvent.addListener(l,"keypress",function(M){13==M.keyCode&&K.click()});m.appendChild(K);b.editor.cancelFirst||m.appendChild(J);F.appendChild(m);this.urlInput=l;this.container=F};
-LinkDialog.editCustomAction=function(b,k,m){b.hideDialog();null!=b.actionWindow&&null!=b.actionWindow.window&&b.actionWindow.window.isVisible()?(b.actionWindow.window.setVisible(!0),b.actionWindow.window.activate()):(b.actionWindow=new CustomActionDialog(b,k,m),b.actionWindow.window.addListener("hide",function(){b.actionWindow=null}))};
-var ANIMATION_HELP_URL="https://www.drawio.com/docs/manual/links-tooltips-tags/animations-custom-actions/",SELECTOR_ICONS={arrowDown:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8M4.5 6.5L8 10l3.5-3.5M3 13h10"/></svg>',target:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
-asterisk:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M4 5.5l8 5M4 10.5l8-5"/></svg>'};
-function installCustomActionStyles(){if(!installCustomActionStyles._done){installCustomActionStyles._done=!0;var b=document.createElement("style");b.setAttribute("data-source","customActionDialog");b.textContent='.geSelField{display:inline-flex;align-items:center;gap:6px;font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}.geSelFieldLabel{color:light-dark(var(--secondary-text-color), var(--dark-secondary-text-color));font-weight:500;letter-spacing:0.01em}.geSelChip{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:2px 10px;border-radius:999px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:light-dark(var(--soft-color), var(--dark-card-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font:inherit;font-weight:500;flex:0 0 auto;max-width:100%;white-space:nowrap;user-select:none;transition:background-color .15s,border-color .15s,box-shadow .15s}.geSelChipReadOnly{cursor:default}button.geSelChip,a.geSelChip{cursor:pointer}button.geSelChip:hover,a.geSelChip:hover{background:light-dark(var(--soft-hover-color), var(--dark-soft-hover-color));border-color:light-dark(var(--strong-border-color), var(--dark-strong-border-color))}button.geSelChip:focus-visible{outline:2px solid light-dark(var(--focus-color), var(--dark-focus-color));outline-offset:1px}.geSelChipEmpty{color:light-dark(var(--faint-text-color), var(--dark-faint-text-color));border-style:dashed;background:transparent}.geSelChipAll{background:light-dark(var(--mention-background-color), var(--dark-mention-background-color));border-color:light-dark(#a3c4f8,#2a5aa8);color:light-dark(var(--mention-color), var(--dark-mention-color))}.geSelChipTags{padding:2px 6px;gap:3px}.geSelChipExpandable::after{content:"";display:inline-block;width:5px;height:5px;margin-left:6px;border:solid currentColor;border-width:0 1.4px 1.4px 0;transform:translateY(-2px) rotate(45deg);opacity:.55}.geSelIconBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:6px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--text-color), var(--dark-text-color));cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}.geSelIconBtn:hover{background:light-dark(var(--soft-color), var(--dark-card-color));border-color:light-dark(var(--strong-border-color), var(--dark-strong-border-color));color:light-dark(var(--focus-color), var(--dark-focus-color))}.geSelIconBtn:focus-visible{outline:2px solid light-dark(var(--focus-color), var(--dark-focus-color));outline-offset:1px}.geSelIconBtn:active{background:light-dark(var(--inactive-color), var(--dark-soft-color))}.geSelIconBtnActive{background:light-dark(var(--focus-color), var(--dark-focus-color));border-color:light-dark(var(--focus-color), var(--dark-focus-color));color:#ffffff}.geSelIconBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff);color:#ffffff}.geSelIconBtn svg{display:block}.geTagPicker{position:fixed;z-index:10000;min-width:220px;max-width:300px;background:light-dark(var(--field-color), var(--dark-field-color));border:1px solid light-dark(#d0d0d0,#505050);border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,0.15);font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));opacity:0;transform:scale(0);transition:transform .2s cubic-bezier(0.34,1.56,0.64,1),opacity .1s ease-out}.geTagPickerOpen{opacity:1;transform:scale(1)}.geTagPickerArrow{position:absolute;top:-7px;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid light-dark(var(--field-border-color), var(--dark-field-border-color));pointer-events:none}.geTagPickerArrow::after{content:"";position:absolute;top:1px;left:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid light-dark(var(--field-color), var(--dark-field-color))}.geTagPickerArrowBottom{top:auto;bottom:-7px;border-bottom:none;border-top:7px solid light-dark(var(--field-border-color), var(--dark-field-border-color))}.geTagPickerArrowBottom::after{top:auto;bottom:1px;border-bottom:none;border-top:6px solid light-dark(var(--field-color), var(--dark-field-color))}.geTagPickerHeader{padding:10px 14px 6px;font-weight:600;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-size:12px;letter-spacing:.02em;text-transform:uppercase;opacity:.8}.geTagPickerEmpty{padding:14px 18px;color:light-dark(var(--faint-text-color), var(--dark-faint-text-color));font-style:italic;text-align:center}.geTagPickerFooter{padding:4px;border-top:1px solid light-dark(var(--inactive-color), var(--dark-soft-color))}.geTagPickerModeBar{display:flex;align-items:center;gap:6px;padding:6px 10px 4px}.geTagPickerModeLabel{font-size:11px;font-weight:500;color:light-dark(var(--secondary-text-color), var(--dark-secondary-text-color));margin-right:4px}.geTagPickerModeBtn{padding:2px 10px;border-radius:999px;font:inherit;font-size:11px;font-weight:500;cursor:pointer;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:transparent;color:light-dark(var(--text-color), var(--dark-text-color));transition:background-color .12s,color .12s,border-color .12s}.geTagPickerModeBtn:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geTagPickerModeBtnActive{background:light-dark(var(--focus-color), var(--dark-focus-color));border-color:light-dark(var(--focus-color), var(--dark-focus-color));color:#ffffff}.geTagPickerModeBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff)}.geTagPickerCloud{display:flex;flex-wrap:wrap;gap:6px;padding:8px 10px 12px;max-height:320px;overflow:auto;max-width:320px}.geTagCloudPill{display:inline-block;padding:3px 10px;border-radius:999px;cursor:pointer;font:inherit;font-size:11px;font-weight:500;line-height:1.4;background:light-dark(var(--inactive-color), var(--dark-field-border-color));color:light-dark(var(--text-color), var(--dark-text-color));border:1px solid transparent;white-space:nowrap;transition:background-color .12s,color .12s,border-color .12s}.geTagCloudPill:hover{background:light-dark(#d5d5da,#5a5a5e)}.geTagCloudPillActive{background:light-dark(#d4f0db,#1c4530);color:light-dark(#1f7a3e,#86e0a3);border-color:light-dark(#a8e0b8,#2d6849)}.geTagCloudPillActive:hover{background:light-dark(#c4e8ce,#235c3d)}.geLayerPickerList{display:flex;flex-direction:column;gap:2px;padding:6px 6px 10px;max-height:320px;overflow:auto;min-width:220px}.geLayerPickerRow{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));transition:background-color .1s}.geLayerPickerRow:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geLayerPickerRow input[type="checkbox"]{margin:0;flex:0 0 auto}.geLayerPickerRowLabel{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}option.geDeleteOpt{color:light-dark(#d70015,#ff453a);font-weight:500}.geNoSpin{-moz-appearance:textfield;flex:0 0 60px;width:60px;max-width:60px;box-sizing:border-box}.geNoSpin::-webkit-outer-spin-button,.geNoSpin::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.geActionMenuList{padding:4px;min-width:180px}.geActionMenuItem{display:block;width:100%;padding:6px 12px;background:none;border:0;border-radius:6px;text-align:left;font:inherit;font-size:13px;cursor:pointer;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));transition:background-color .1s}.geActionMenuItem:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geActionMenuItemActive{color:light-dark(var(--focus-color), var(--dark-focus-color));font-weight:600}.geActionMenuItemDanger{color:light-dark(#d70015,#ff453a)}.geActionMenuItemDanger:hover{background:light-dark(#fdf0f0,#3a2020)}.geActionMenuItemDisabled{color:light-dark(#aeaeb2,#636366);cursor:default;pointer-events:none}.geActionMenuSeparator{height:1px;margin:4px 6px;background:light-dark(var(--inactive-color), var(--dark-soft-color))}.geAnimationStepActive{background:light-dark(color-mix(in srgb, var(--focus-color) 10%, transparent), color-mix(in srgb, var(--dark-focus-color) 18%, transparent))}.geAnimationStepSelected{background:light-dark(color-mix(in srgb, var(--focus-color) 6%, transparent), color-mix(in srgb, var(--dark-focus-color) 10%, transparent))}.geAnimationStepActive.geAnimationStepSelected{background:light-dark(color-mix(in srgb, var(--focus-color) 16%, transparent), color-mix(in srgb, var(--dark-focus-color) 28%, transparent))}';document.head.appendChild(b)}}
-function installDialogDocking(b,k){var m=EditorUi.windowed;EditorUi.windowed=!0;try{b.installResizeHandler(k,!0)}finally{EditorUi.windowed=m}}function containDragEvents(b){for(var k="dragstart dragenter dragover dragleave drop dragend".split(" "),m=0;m<k.length;m++)b.addEventListener(k[m],function(g){g.stopPropagation()})}
-var SelectorChips={create:function(b,k){function m(z,F,J,H,D){for(var c=(Array.isArray(F())?F():[]).slice(),f="function"==typeof b.getAllTags?b.getAllTags():[],l=0;l<c.length;l++)0>f.indexOf(c[l])&&f.push(c[l]);f.sort();F=document.createElement("div");if(0==f.length)f=document.createElement("div"),f.className="geTagPickerEmpty",mxUtils.write(f,mxResources.get("noTagsInDiagram",null,"No tags in this diagram yet.")),F.appendChild(f);else{var n="function"==typeof H?H()||"and":null;if("function"==typeof D){H=
+"change",function(M){null!=R[C.value]&&(R[C.value](),C.value="")}));mxEvent.addListener(l,"keypress",function(M){13==M.keyCode&&K.click()});m.appendChild(K);b.editor.cancelFirst||m.appendChild(I);F.appendChild(m);this.urlInput=l;this.container=F};
+LinkDialog.editCustomAction=function(b,k,m,g){b.hideDialog();var q=function(){b.actionWindow=new CustomActionDialog(b,k,m);b.actionWindow.cells=g;b.actionWindow.window.addListener("hide",function(){b.actionWindow=null})},u=b.actionWindow;if(null!=u&&null!=u.window&&u.window.isVisible()){if(LinkDialog.sameCells(u.cells,g)){u.window.setVisible(!0);u.window.activate();return}if(null!=u.requestClose){u.requestClose(q);return}}q()};
+LinkDialog.sameCells=function(b,k){if(null==b||null==k||b.length!=k.length)return!1;for(var m=0;m<b.length;m++)if(b[m]!=k[m])return!1;return!0};
+var ANIMATION_HELP_URL="https://www.drawio.com/docs/manual/links-tooltips-tags/animations-custom-actions/",SELECTOR_ICONS={arrowDown:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8M4.5 6.5L8 10l3.5-3.5M3 13h10"/></svg>',target:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',asterisk:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M4 5.5l8 5M4 10.5l8-5"/></svg>'};
+function installCustomActionStyles(){if(!installCustomActionStyles._done){installCustomActionStyles._done=!0;var b=document.createElement("style");b.setAttribute("data-source","customActionDialog");b.textContent='.geSelField{display:inline-flex;align-items:center;gap:6px;font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}.geSelFieldLabel{color:light-dark(var(--secondary-text-color), var(--dark-secondary-text-color));font-weight:500;letter-spacing:0.01em}.geSelChip{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:2px 10px;border-radius:999px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:light-dark(var(--soft-color), var(--dark-card-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font:inherit;font-weight:500;flex:0 0 auto;max-width:100%;white-space:nowrap;user-select:none;transition:background-color .15s,border-color .15s,box-shadow .15s}.geSelChipReadOnly{cursor:default}button.geSelChip,a.geSelChip{cursor:pointer}button.geSelChip:hover,a.geSelChip:hover{background:light-dark(var(--soft-hover-color), var(--dark-soft-hover-color));border-color:light-dark(var(--strong-border-color), var(--dark-strong-border-color))}button.geSelChip:focus-visible{outline:2px solid light-dark(var(--focus-color), var(--dark-focus-color));outline-offset:1px}.geSelChipEmpty{color:light-dark(var(--faint-text-color), var(--dark-faint-text-color));border-style:dashed;background:transparent}.geSelChipAll{background:light-dark(var(--mention-background-color), var(--dark-mention-background-color));border-color:light-dark(#a3c4f8,#2a5aa8);color:light-dark(var(--mention-color), var(--dark-mention-color))}.geSelChipTags{padding:2px 6px;gap:3px}.geSelChipExpandable::after{content:"";display:inline-block;width:5px;height:5px;margin-left:6px;border:solid currentColor;border-width:0 1.4px 1.4px 0;transform:translateY(-2px) rotate(45deg);opacity:.55}.geSelIconBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:6px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--text-color), var(--dark-text-color));cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}.geSelIconBtn:hover{background:light-dark(var(--soft-color), var(--dark-card-color));border-color:light-dark(var(--strong-border-color), var(--dark-strong-border-color));color:light-dark(var(--focus-color), var(--dark-focus-color))}.geSelIconBtn:focus-visible{outline:2px solid light-dark(var(--focus-color), var(--dark-focus-color));outline-offset:1px}.geSelIconBtn:active{background:light-dark(var(--inactive-color), var(--dark-soft-color))}.geSelIconBtnActive{background:light-dark(var(--focus-color), var(--dark-focus-color));border-color:light-dark(var(--focus-color), var(--dark-focus-color));color:#ffffff}.geSelIconBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff);color:#ffffff}.geSelIconBtn svg{display:block}.geTagPicker{position:fixed;z-index:10000;min-width:220px;max-width:300px;background:light-dark(var(--field-color), var(--dark-field-color));border:1px solid light-dark(#d0d0d0,#505050);border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,0.15);font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));opacity:0;transform:scale(0);transition:transform .2s cubic-bezier(0.34,1.56,0.64,1),opacity .1s ease-out}.geTagPickerOpen{opacity:1;transform:scale(1)}.geTagPickerArrow{position:absolute;top:-7px;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid light-dark(var(--field-border-color), var(--dark-field-border-color));pointer-events:none}.geTagPickerArrow::after{content:"";position:absolute;top:1px;left:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid light-dark(var(--field-color), var(--dark-field-color))}.geTagPickerArrowBottom{top:auto;bottom:-7px;border-bottom:none;border-top:7px solid light-dark(var(--field-border-color), var(--dark-field-border-color))}.geTagPickerArrowBottom::after{top:auto;bottom:1px;border-bottom:none;border-top:6px solid light-dark(var(--field-color), var(--dark-field-color))}.geTagPickerHeader{padding:10px 14px 6px;font-weight:600;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-size:12px;letter-spacing:.02em;text-transform:uppercase;opacity:.8}.geTagPickerEmpty{padding:14px 18px;color:light-dark(var(--faint-text-color), var(--dark-faint-text-color));font-style:italic;text-align:center}.geTagPickerFooter{padding:4px;border-top:1px solid light-dark(var(--inactive-color), var(--dark-soft-color))}.geTagPickerModeBar{display:flex;align-items:center;gap:6px;padding:6px 10px 4px}.geTagPickerModeLabel{font-size:11px;font-weight:500;color:light-dark(var(--secondary-text-color), var(--dark-secondary-text-color));margin-right:4px}.geTagPickerModeBtn{padding:2px 10px;border-radius:999px;font:inherit;font-size:11px;font-weight:500;cursor:pointer;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:transparent;color:light-dark(var(--text-color), var(--dark-text-color));transition:background-color .12s,color .12s,border-color .12s}.geTagPickerModeBtn:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geTagPickerModeBtnActive{background:light-dark(var(--focus-color), var(--dark-focus-color));border-color:light-dark(var(--focus-color), var(--dark-focus-color));color:#ffffff}.geTagPickerModeBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff)}.geTagPickerCloud{display:flex;flex-wrap:wrap;gap:6px;padding:8px 10px 12px;max-height:320px;overflow:auto;max-width:320px}.geTagCloudPill{display:inline-block;padding:3px 10px;border-radius:999px;cursor:pointer;font:inherit;font-size:11px;font-weight:500;line-height:1.4;background:light-dark(var(--inactive-color), var(--dark-field-border-color));color:light-dark(var(--text-color), var(--dark-text-color));border:1px solid transparent;white-space:nowrap;transition:background-color .12s,color .12s,border-color .12s}.geTagCloudPill:hover{background:light-dark(#d5d5da,#5a5a5e)}.geTagCloudPillActive{background:light-dark(#d4f0db,#1c4530);color:light-dark(#1f7a3e,#86e0a3);border-color:light-dark(#a8e0b8,#2d6849)}.geTagCloudPillActive:hover{background:light-dark(#c4e8ce,#235c3d)}.geLayerPickerList{display:flex;flex-direction:column;gap:2px;padding:6px 6px 10px;max-height:320px;overflow:auto;min-width:220px}.geLayerPickerRow{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));transition:background-color .1s}.geLayerPickerRow:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geLayerPickerRow input[type="checkbox"]{margin:0;flex:0 0 auto}.geLayerPickerRowLabel{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}option.geDeleteOpt{color:light-dark(#d70015,#ff453a);font-weight:500}.geNoSpin{-moz-appearance:textfield;flex:0 0 60px;width:60px;max-width:60px;box-sizing:border-box}.geNoSpin::-webkit-outer-spin-button,.geNoSpin::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.geActionMenuList{padding:4px;min-width:180px}.geActionMenuItem{display:block;width:100%;padding:6px 12px;background:none;border:0;border-radius:6px;text-align:left;font:inherit;font-size:13px;cursor:pointer;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));transition:background-color .1s}.geActionMenuItem:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geActionMenuItemActive{color:light-dark(var(--focus-color), var(--dark-focus-color));font-weight:600}.geActionMenuItemDanger{color:light-dark(#d70015,#ff453a)}.geActionMenuItemDanger:hover{background:light-dark(#fdf0f0,#3a2020)}.geActionMenuItemDisabled{color:light-dark(#aeaeb2,#636366);cursor:default;pointer-events:none}.geActionMenuSeparator{height:1px;margin:4px 6px;background:light-dark(var(--inactive-color), var(--dark-soft-color))}.geAnimationStepActive{background:light-dark(color-mix(in srgb, var(--focus-color) 10%, transparent), color-mix(in srgb, var(--dark-focus-color) 18%, transparent))}.geAnimationStepSelected{background:light-dark(color-mix(in srgb, var(--focus-color) 6%, transparent), color-mix(in srgb, var(--dark-focus-color) 10%, transparent))}.geAnimationStepActive.geAnimationStepSelected{background:light-dark(color-mix(in srgb, var(--focus-color) 16%, transparent), color-mix(in srgb, var(--dark-focus-color) 28%, transparent))}';
+document.head.appendChild(b)}}function installDialogDocking(b,k){var m=EditorUi.windowed;EditorUi.windowed=!0;try{b.installResizeHandler(k,!0)}finally{EditorUi.windowed=m}}function containDragEvents(b){for(var k="dragstart dragenter dragover dragleave drop dragend".split(" "),m=0;m<k.length;m++)b.addEventListener(k[m],function(g){g.stopPropagation()})}
+var SelectorChips={create:function(b,k){function m(z,F,I,H,D){for(var c=(Array.isArray(F())?F():[]).slice(),f="function"==typeof b.getAllTags?b.getAllTags():[],l=0;l<c.length;l++)0>f.indexOf(c[l])&&f.push(c[l]);f.sort();F=document.createElement("div");if(0==f.length)f=document.createElement("div"),f.className="geTagPickerEmpty",mxUtils.write(f,mxResources.get("noTagsInDiagram",null,"No tags in this diagram yet.")),F.appendChild(f);else{var n="function"==typeof H?H()||"and":null;if("function"==typeof D){H=
document.createElement("div");H.className="geTagPickerModeBar";l=document.createElement("span");l.className="geTagPickerModeLabel";mxUtils.write(l,mxResources.get("match")+":");H.appendChild(l);var r=document.createElement("button");r.type="button";r.className="geTagPickerModeBtn";mxUtils.write(r,mxResources.get("matchAll"));r.title=mxResources.get("matchAllHint",null,"Match cells that have every selected tag (AND)");var t=document.createElement("button");t.type="button";t.className="geTagPickerModeBtn";
mxUtils.write(t,mxResources.get("matchAny"));t.title=mxResources.get("matchAnyHint",null,"Match cells that have at least one selected tag (OR)");var v=function(){r.classList.toggle("geTagPickerModeBtnActive","and"===n);t.classList.toggle("geTagPickerModeBtnActive","or"===n)};v();r.addEventListener("click",function(M){M.preventDefault();n="and";D("and");v()});t.addEventListener("click",function(M){M.preventDefault();n="or";D("or");v()});H.appendChild(r);H.appendChild(t);F.appendChild(H)}var B=document.createElement("div");
-B.className="geTagPickerCloud";var E=[];for(l=0;l<f.length;l++)(function(M){var O=document.createElement("button");O.type="button";O.className="geTagCloudPill";O.title=M;O.textContent=M;var U=function(){O.classList.toggle("geTagCloudPillActive",0<=c.indexOf(M))};U();E.push(U);O.addEventListener("click",function(T){T.preventDefault();T=c.indexOf(M);0<=T?c.splice(T,1):c.push(M);J(c.slice());U();R()});B.appendChild(O)})(f[l]);F.appendChild(B);f=document.createElement("div");f.className="geTagPickerFooter";
+B.className="geTagPickerCloud";var E=[];for(l=0;l<f.length;l++)(function(M){var O=document.createElement("button");O.type="button";O.className="geTagCloudPill";O.title=M;O.textContent=M;var U=function(){O.classList.toggle("geTagCloudPillActive",0<=c.indexOf(M))};U();E.push(U);O.addEventListener("click",function(T){T.preventDefault();T=c.indexOf(M);0<=T?c.splice(T,1):c.push(M);I(c.slice());U();R()});B.appendChild(O)})(f[l]);F.appendChild(B);f=document.createElement("div");f.className="geTagPickerFooter";
var K=document.createElement("button");K.type="button";K.className="geActionMenuItem";mxUtils.write(K,mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"));K.addEventListener("click",function(M){M.preventDefault();0!=c.length&&(M="function"==typeof b.getCellsForTags?b.getCellsForTags(c,null,null,!0,n):[],0<M.length?b.setSelectionCells(M):b.clearSelection())});f.appendChild(K);var C=document.createElement("button");C.type="button";C.className="geActionMenuItem geActionMenuItemDanger";
-mxUtils.write(C,mxResources.get("reset"));C.addEventListener("click",function(M){M.preventDefault();c=[];J([]);for(M=0;M<E.length;M++)E[M]();R()});f.appendChild(C);F.appendChild(f);var R=function(){var M=0==c.length;K.classList.toggle("geActionMenuItemDisabled",M);K.disabled=M;C.classList.toggle("geActionMenuItemDisabled",M);C.disabled=M};R()}u(z,mxResources.get("tags"),F)}function g(){for(var z=b.getModel(),F=z.getRoot(),J=z.getChildCount(F),H=[],D=0;D<J;D++){var c=z.getChildAt(F,D);if(null!=c){var f=
-b.convertValueToString(c);if(null==f||""===f)f=0==D?mxResources.get("background",null,"Background"):mxResources.get("untitledLayer",null,"Untitled Layer");H.push({id:c.id,name:f,cell:c})}}return H}function q(z,F,J){var H=(Array.isArray(F())?F():[]).slice(),D=g();F=document.createElement("div");var c=document.createElement("div");c.className="geLayerPickerList";for(var f=[],l=0;l<D.length;l++)(function(v){var B=document.createElement("label");B.className="geLayerPickerRow";B.title=v.name;var E=document.createElement("input");
-E.type="checkbox";E.checked=0<=H.indexOf(v.id);B.appendChild(E);var K=document.createElement("span");K.className="geLayerPickerRowLabel";mxUtils.write(K,v.name);B.appendChild(K);f.push(function(){E.checked=0<=H.indexOf(v.id)});E.addEventListener("change",function(){var C=H.indexOf(v.id);E.checked&&0>C?H.push(v.id):!E.checked&&0<=C&&H.splice(C,1);J(H.slice());t()});c.appendChild(B)})(D[l]);F.appendChild(c);D=document.createElement("div");D.className="geTagPickerFooter";var n=document.createElement("button");
+mxUtils.write(C,mxResources.get("reset"));C.addEventListener("click",function(M){M.preventDefault();c=[];I([]);for(M=0;M<E.length;M++)E[M]();R()});f.appendChild(C);F.appendChild(f);var R=function(){var M=0==c.length;K.classList.toggle("geActionMenuItemDisabled",M);K.disabled=M;C.classList.toggle("geActionMenuItemDisabled",M);C.disabled=M};R()}u(z,mxResources.get("tags"),F)}function g(){for(var z=b.getModel(),F=z.getRoot(),I=z.getChildCount(F),H=[],D=0;D<I;D++){var c=z.getChildAt(F,D);if(null!=c){var f=
+b.convertValueToString(c);if(null==f||""===f)f=0==D?mxResources.get("background",null,"Background"):mxResources.get("untitledLayer",null,"Untitled Layer");H.push({id:c.id,name:f,cell:c})}}return H}function q(z,F,I){var H=(Array.isArray(F())?F():[]).slice(),D=g();F=document.createElement("div");var c=document.createElement("div");c.className="geLayerPickerList";for(var f=[],l=0;l<D.length;l++)(function(v){var B=document.createElement("label");B.className="geLayerPickerRow";B.title=v.name;var E=document.createElement("input");
+E.type="checkbox";E.checked=0<=H.indexOf(v.id);B.appendChild(E);var K=document.createElement("span");K.className="geLayerPickerRowLabel";mxUtils.write(K,v.name);B.appendChild(K);f.push(function(){E.checked=0<=H.indexOf(v.id)});E.addEventListener("change",function(){var C=H.indexOf(v.id);E.checked&&0>C?H.push(v.id):!E.checked&&0<=C&&H.splice(C,1);I(H.slice());t()});c.appendChild(B)})(D[l]);F.appendChild(c);D=document.createElement("div");D.className="geTagPickerFooter";var n=document.createElement("button");
n.type="button";n.className="geActionMenuItem";mxUtils.write(n,mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"));n.addEventListener("click",function(v){v.preventDefault();0!=H.length&&(v="function"==typeof b.getCellsForLayers?b.getCellsForLayers(H):[],0<v.length?b.setSelectionCells(v):b.clearSelection())});D.appendChild(n);var r=document.createElement("button");r.type="button";r.className="geActionMenuItem geActionMenuItemDanger";mxUtils.write(r,mxResources.get("reset"));r.addEventListener("click",
-function(v){v.preventDefault();H=[];J([]);for(v=0;v<f.length;v++)f[v]();t()});D.appendChild(r);F.appendChild(D);var t=function(){var v=0==H.length;n.classList.toggle("geActionMenuItemDisabled",v);n.disabled=v;r.classList.toggle("geActionMenuItemDisabled",v);r.disabled=v};t();u(z,mxResources.get("selectLayers"),F)}function u(z,F,J){function H(){document.removeEventListener("mousedown",D,!0);window.removeEventListener("resize",H);window.removeEventListener("scroll",H,!0);c.parentNode&&c.parentNode.removeChild(c);
-u._open===v&&(u._open=null)}function D(B){c.contains(B.target)||z.contains(B.target)||null!=b.container&&b.container.contains(B.target)||H()}null!=u._open&&u._open.close();var c=document.createElement("div");c.className="geTagPicker";var f=document.createElement("div");f.className="geTagPickerArrow";c.appendChild(f);if(F){var l=document.createElement("div");l.className="geTagPickerHeader";mxUtils.write(l,F);c.appendChild(l)}c.appendChild(J);document.body.appendChild(c);l=z.getBoundingClientRect();
-var n=c.offsetWidth;F=c.offsetHeight;var r=l.bottom+6;J=!1;r+F>window.innerHeight-12&&(r=Math.max(8,l.top-F-6),f.classList.add("geTagPickerArrowBottom"),J=!0);var t=l.left;t+n>window.innerWidth-8&&(t=Math.max(8,window.innerWidth-n-8));c.style.top=r+"px";c.style.left=t+"px";l=Math.min(n-24,Math.max(12,l.left+l.width/2-t-6));f.style.left=l+"px";c.style.transformOrigin=l+6+"px "+(J?F+"px":"0px");requestAnimationFrame(function(){c.classList.add("geTagPickerOpen")});document.addEventListener("mousedown",
-D,!0);window.addEventListener("resize",H);window.addEventListener("scroll",H,!0);var v={close:H,anchor:z};return u._open=v}function x(z,F){var J=document.createElement("div");J.className="geActionMenuList";for(var H=[],D,c=0;c<F.length;c++)(function(n){if(n.separator){var r=document.createElement("div");r.className="geActionMenuSeparator";J.appendChild(r)}else{var t=document.createElement("button");t.type="button";t.className="geActionMenuItem";n.danger&&t.classList.add("geActionMenuItemDanger");
-n.active&&t.classList.add("geActionMenuItemActive");var v=function(){return"function"==typeof n.disabled?!!n.disabled():!!n.disabled};r=function(){var B=v();t.classList.toggle("geActionMenuItemDisabled",B);t.disabled=B};r();H.push(r);mxUtils.write(t,n.label);t.addEventListener("click",function(B){B.preventDefault();v()||(D&&D.close(),n.onClick(z))});J.appendChild(t)}})(F[c]);D=u(z,null,J);var f=function(){for(var n=0;n<H.length;n++)H[n]()};b.getSelectionModel().addListener(mxEvent.CHANGE,f);var l=
-D.close;D.close=function(){b.getSelectionModel().removeListener(f);l()};return D}installCustomActionStyles();return{cellListField:function(z,F,J,H){H=H||{};var D=H.singularKey||"cell",c=H.pluralKey||"cells",f=H.singularFallback||"cell",l=H.pluralFallback||"cells",n=H.emptyKey||"select",r=H.emptyFallback||"Select",t=document.createElement("div");t.className="geSelField";if(z){var v=document.createElement("span");v.className="geSelFieldLabel";mxUtils.write(v,z);t.appendChild(v)}var B=document.createElement("button");
-B.type="button";B.className="geSelChip geSelChipExpandable";var E=null,K=function(){var M=F();return Array.isArray(M)&&1==M.length&&"*"===M[0]},C=function(){var M=F();return Array.isArray(M)&&0<M.length},R=function(){var M=F(),O=Array.isArray(M)&&!K()?M.length:0;B.textContent="";B.classList.remove("geSelChipEmpty","geSelChipAll");B.title="";K()?(B.classList.add("geSelChipAll"),mxUtils.write(B,mxResources.get("allCells"))):0==O?(B.classList.add("geSelChipEmpty"),mxUtils.write(B,mxResources.get(n,null,
-r))):(mxUtils.write(B,O+" "+(1==O?mxResources.get(D,null,f):mxResources.get(c,null,l))),B.title=M.join("\n"))};B.addEventListener("click",function(M){M.preventDefault();if(null!=u._open&&u._open.anchor===B)u._open.close();else{M=[];M.push({label:mxResources.get("useSelection"),disabled:function(){return 0==b.getSelectionCount()},onClick:function(){var U=b.getSelectionCells();0!=U.length&&(J(U.map(function(T){return T.id})),R())}});H.allowWildcard&&M.push({label:mxResources.get("allCells"),active:K(),
-onClick:function(){if(K())J(E),E=null;else{var U=F();E=Array.isArray(U)?U.slice():null;J(["*"])}R()}});C()&&(M.push({label:mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"),onClick:function(){for(var U=F(),T=[],V=0;V<U.length;V++){if("*"===U[V]){T=b.model.getDescendants(b.model.getRoot());break}var fa=b.model.getCell(U[V]);null!=fa&&T.push(fa)}0<T.length?b.setSelectionCells(T):b.clearSelection()}}),M.push({separator:!0}),M.push({label:mxResources.get("reset"),danger:!0,onClick:function(){J(null);
-E=null;R()}}));if(Array.isArray(H.extraMenuItems)&&0<H.extraMenuItems.length){0<M.length&&!M[M.length-1].separator&&M.push({separator:!0});for(var O=0;O<H.extraMenuItems.length;O++)M.push(H.extraMenuItems[O])}x(B,M)}});t.appendChild(B);R();return t},tagListField:function(z,F,J,H){H=H||{};var D=document.createElement("div");D.className="geSelField";if(z){var c=document.createElement("span");c.className="geSelFieldLabel";mxUtils.write(c,z);D.appendChild(c)}var f=document.createElement("button");f.type=
-"button";f.className="geSelChip geSelChipExpandable";var l=function(){var n=F(),r=Array.isArray(n)?n.length:0;f.textContent="";f.classList.remove("geSelChipEmpty");f.title="";0==r?(f.classList.add("geSelChipEmpty"),mxUtils.write(f,mxResources.get("tags"))):(mxUtils.write(f,r+" "+(1==r?mxResources.get("tag"):mxResources.get("tags"))),f.title=n.join("\n"))};f.addEventListener("click",function(n){n.preventDefault();null!=u._open&&u._open.anchor===f?u._open.close():m(f,F,function(r){J(r);l()},H.getMode,
-H.setMode)});D.appendChild(f);l();return D},layerListField:function(z,F,J){var H=document.createElement("div");H.className="geSelField";if(z){var D=document.createElement("span");D.className="geSelFieldLabel";mxUtils.write(D,z);H.appendChild(D)}var c=document.createElement("button");c.type="button";c.className="geSelChip geSelChipExpandable";var f=function(){var l=F(),n=Array.isArray(l)?l.length:0;c.textContent="";c.classList.remove("geSelChipEmpty");c.title="";if(0==n)c.classList.add("geSelChipEmpty"),
-mxUtils.write(c,mxResources.get("layers"));else{mxUtils.write(c,n+" "+(1==n?mxResources.get("layer"):mxResources.get("layers")));n=[];for(var r=b.getModel(),t=0;t<l.length;t++){var v=r.getCell(l[t]);null!=v?(v=b.convertValueToString(v),n.push(null!=v&&""!==v?v:l[t])):n.push(l[t])}c.title=n.join("\n")}};c.addEventListener("click",function(l){l.preventDefault();null!=u._open&&u._open.anchor===c?u._open.close():q(c,F,function(n){J(n);f()})});H.appendChild(c);f();return H},iconButton:function(z,F,J){var H=
-document.createElement("button");H.type="button";H.title=F;H.className="geSelIconBtn";H.innerHTML=SELECTOR_ICONS[z];H.addEventListener("click",function(D){D.preventDefault();J(D)});return H},openTagPicker:m,openLayerPicker:q,closePopover:function(){null!=u._open&&u._open.close()}}}},CustomActionDialog=function(b,k,m){installCustomActionStyles();var g={steps:[]};if(null!=k&&"data:action/json,"==k.substring(0,17))try{var q=JSON.parse(k.substring(17));if(Array.isArray(q.actions)){k=[];for(var u=0;u<
-q.actions.length;u++){var x=q.actions[u];if(x&&x.animation&&Array.isArray(x.animation.steps))for(var z=0;z<x.animation.steps.length;z++)k.push(x.animation.steps[z]);else k.push(x)}g.steps=k}"string"==typeof q.title&&""!==q.title&&(g.title=q.title)}catch(F){}q=mxSettings.getWindowState("customAction");x=null!=q&&null!=q.w?q.w:700;g=new AnimationDialog(b,null!=q&&null!=q.x?q.x:Math.max(40,(document.body.offsetWidth-x)/2),null!=q&&null!=q.y?q.y:80,x,null!=q&&null!=q.h?q.h:560,{kind:"action",showTitle:!0,
-windowTitleKey:"action",windowTitleFallback:"Action",initial:g,save:function(F){var J={actions:F.steps};F.title&&(J.title=F.title);m("data:action/json,"+JSON.stringify(J))}});b.installWindowPersistence("customAction",g);null!=q&&(b.restoreWindowState("customAction",g),g.window.setVisible(!0));return g};
+function(v){v.preventDefault();H=[];I([]);for(v=0;v<f.length;v++)f[v]();t()});D.appendChild(r);F.appendChild(D);var t=function(){var v=0==H.length;n.classList.toggle("geActionMenuItemDisabled",v);n.disabled=v;r.classList.toggle("geActionMenuItemDisabled",v);r.disabled=v};t();u(z,mxResources.get("selectLayers"),F)}function u(z,F,I){function H(){document.removeEventListener("mousedown",D,!0);window.removeEventListener("resize",H);window.removeEventListener("scroll",H,!0);c.parentNode&&c.parentNode.removeChild(c);
+u._open===v&&(u._open=null)}function D(B){c.contains(B.target)||z.contains(B.target)||null!=b.container&&b.container.contains(B.target)||H()}null!=u._open&&u._open.close();var c=document.createElement("div");c.className="geTagPicker";var f=document.createElement("div");f.className="geTagPickerArrow";c.appendChild(f);if(F){var l=document.createElement("div");l.className="geTagPickerHeader";mxUtils.write(l,F);c.appendChild(l)}c.appendChild(I);document.body.appendChild(c);l=z.getBoundingClientRect();
+var n=c.offsetWidth;F=c.offsetHeight;var r=l.bottom+6;I=!1;r+F>window.innerHeight-12&&(r=Math.max(8,l.top-F-6),f.classList.add("geTagPickerArrowBottom"),I=!0);var t=l.left;t+n>window.innerWidth-8&&(t=Math.max(8,window.innerWidth-n-8));c.style.top=r+"px";c.style.left=t+"px";l=Math.min(n-24,Math.max(12,l.left+l.width/2-t-6));f.style.left=l+"px";c.style.transformOrigin=l+6+"px "+(I?F+"px":"0px");requestAnimationFrame(function(){c.classList.add("geTagPickerOpen")});document.addEventListener("mousedown",
+D,!0);window.addEventListener("resize",H);window.addEventListener("scroll",H,!0);var v={close:H,anchor:z};return u._open=v}function x(z,F){var I=document.createElement("div");I.className="geActionMenuList";for(var H=[],D,c=0;c<F.length;c++)(function(n){if(n.separator){var r=document.createElement("div");r.className="geActionMenuSeparator";I.appendChild(r)}else{var t=document.createElement("button");t.type="button";t.className="geActionMenuItem";n.danger&&t.classList.add("geActionMenuItemDanger");
+n.active&&t.classList.add("geActionMenuItemActive");var v=function(){return"function"==typeof n.disabled?!!n.disabled():!!n.disabled};r=function(){var B=v();t.classList.toggle("geActionMenuItemDisabled",B);t.disabled=B};r();H.push(r);mxUtils.write(t,n.label);t.addEventListener("click",function(B){B.preventDefault();v()||(D&&D.close(),n.onClick(z))});I.appendChild(t)}})(F[c]);D=u(z,null,I);var f=function(){for(var n=0;n<H.length;n++)H[n]()};b.getSelectionModel().addListener(mxEvent.CHANGE,f);var l=
+D.close;D.close=function(){b.getSelectionModel().removeListener(f);l()};return D}installCustomActionStyles();return{cellListField:function(z,F,I,H){H=H||{};var D=H.singularKey||"cell",c=H.pluralKey||"cells",f=H.singularFallback||"cell",l=H.pluralFallback||"cells",n=H.emptyKey||"select",r=H.emptyFallback||"Select",t=document.createElement("div");t.className="geSelField";if(z){var v=document.createElement("span");v.className="geSelFieldLabel";mxUtils.write(v,z);t.appendChild(v)}var B=document.createElement("button");
+B.type="button";B.className="geSelChip geSelChipExpandable";var E=null,K=function(){var M=F();return Array.isArray(M)&&1==M.length&&"*"===M[0]},C=function(){var M=F();return Array.isArray(M)&&0<M.length},R=function(){var M=F(),O=Array.isArray(M)&&!K()?M.length:0,U="function"==typeof H.suffix?H.suffix()||"":"";B.textContent="";B.classList.remove("geSelChipEmpty","geSelChipAll");B.title="";K()?(B.classList.add("geSelChipAll"),mxUtils.write(B,mxResources.get("allCells")+U)):0==O?(B.classList.add("geSelChipEmpty"),
+mxUtils.write(B,mxResources.get(n,null,r)+U)):(mxUtils.write(B,O+" "+(1==O?mxResources.get(D,null,f):mxResources.get(c,null,l))+U),B.title=M.join("\n"))};B.addEventListener("click",function(M){M.preventDefault();if(null!=u._open&&u._open.anchor===B)u._open.close();else{M=[];M.push({label:mxResources.get("useSelection"),disabled:function(){return 0==b.getSelectionCount()},onClick:function(){var U=b.getSelectionCells();0!=U.length&&(I(U.map(function(T){return T.id})),R())}});H.allowWildcard&&M.push({label:mxResources.get("allCells"),
+active:K(),onClick:function(){if(K())I(E),E=null;else{var U=F();E=Array.isArray(U)?U.slice():null;I(["*"])}R()}});C()&&(M.push({label:mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"),onClick:function(){for(var U=F(),T=[],V=0;V<U.length;V++){if("*"===U[V]){T=b.model.getDescendants(b.model.getRoot());break}var fa=b.model.getCell(U[V]);null!=fa&&T.push(fa)}0<T.length?b.setSelectionCells(T):b.clearSelection()}}),M.push({separator:!0}),M.push({label:mxResources.get("reset"),danger:!0,
+onClick:function(){I(null);E=null;R()}}));if(Array.isArray(H.extraMenuItems)&&0<H.extraMenuItems.length){0<M.length&&!M[M.length-1].separator&&M.push({separator:!0});for(var O=0;O<H.extraMenuItems.length;O++)M.push(H.extraMenuItems[O])}x(B,M)}});t.appendChild(B);R();return t},tagListField:function(z,F,I,H){H=H||{};var D=document.createElement("div");D.className="geSelField";if(z){var c=document.createElement("span");c.className="geSelFieldLabel";mxUtils.write(c,z);D.appendChild(c)}var f=document.createElement("button");
+f.type="button";f.className="geSelChip geSelChipExpandable";var l=function(){var n=F(),r=Array.isArray(n)?n.length:0;f.textContent="";f.classList.remove("geSelChipEmpty");f.title="";0==r?(f.classList.add("geSelChipEmpty"),mxUtils.write(f,mxResources.get("tags"))):(mxUtils.write(f,r+" "+(1==r?mxResources.get("tag"):mxResources.get("tags"))),f.title=n.join("\n"))};f.addEventListener("click",function(n){n.preventDefault();null!=u._open&&u._open.anchor===f?u._open.close():m(f,F,function(r){I(r);l()},
+H.getMode,H.setMode)});D.appendChild(f);l();return D},layerListField:function(z,F,I){var H=document.createElement("div");H.className="geSelField";if(z){var D=document.createElement("span");D.className="geSelFieldLabel";mxUtils.write(D,z);H.appendChild(D)}var c=document.createElement("button");c.type="button";c.className="geSelChip geSelChipExpandable";var f=function(){var l=F(),n=Array.isArray(l)?l.length:0;c.textContent="";c.classList.remove("geSelChipEmpty");c.title="";if(0==n)c.classList.add("geSelChipEmpty"),
+mxUtils.write(c,mxResources.get("layers"));else{mxUtils.write(c,n+" "+(1==n?mxResources.get("layer"):mxResources.get("layers")));n=[];for(var r=b.getModel(),t=0;t<l.length;t++){var v=r.getCell(l[t]);null!=v?(v=b.convertValueToString(v),n.push(null!=v&&""!==v?v:l[t])):n.push(l[t])}c.title=n.join("\n")}};c.addEventListener("click",function(l){l.preventDefault();null!=u._open&&u._open.anchor===c?u._open.close():q(c,F,function(n){I(n);f()})});H.appendChild(c);f();return H},iconButton:function(z,F,I){var H=
+document.createElement("button");H.type="button";H.title=F;H.className="geSelIconBtn";H.innerHTML=SELECTOR_ICONS[z];H.addEventListener("click",function(D){D.preventDefault();I(D)});return H},openTagPicker:m,openLayerPicker:q,openPopover:u,openMenuPopover:x,closePopover:function(){null!=u._open&&u._open.close()}}}},CustomActionDialog=function(b,k,m){installCustomActionStyles();var g={steps:[]};if(null!=k&&"data:action/json,"==k.substring(0,17))try{var q=JSON.parse(k.substring(17));if(Array.isArray(q.actions)){k=
+[];for(var u=0;u<q.actions.length;u++){var x=q.actions[u];if(x&&x.animation&&Array.isArray(x.animation.steps))for(var z=0;z<x.animation.steps.length;z++)k.push(x.animation.steps[z]);else k.push(x)}g.steps=k}"string"==typeof q.title&&""!==q.title&&(g.title=q.title)}catch(F){}q=mxSettings.getWindowState("customAction");x=null!=q&&null!=q.w?q.w:700;g=new AnimationDialog(b,null!=q&&null!=q.x?q.x:Math.max(40,(document.body.offsetWidth-x)/2),null!=q&&null!=q.y?q.y:80,x,null!=q&&null!=q.h?q.h:560,{kind:"action",
+showTitle:!0,windowTitleKey:"action",windowTitleFallback:"Action",initial:g,save:function(F){var I={actions:F.steps};F.title&&(I.title=F.title);m("data:action/json,"+JSON.stringify(I))}});b.installWindowPersistence("customAction",g);null!=q&&(b.restoreWindowState("customAction",g),g.window.setVisible(!0));return g};
CustomActionDialog.SCHEMAS={toggle:{label:"Toggle",icon:"⇄",selector:!0,allowLayers:!0},show:{label:"Show",icon:"✓",selector:!0,allowLayers:!0},hide:{label:"Hide",icon:"✗",selector:!0,allowLayers:!0},select:{label:"Select",icon:"☑",selector:!0,allowLayers:!0},scroll:{label:"Scroll To",icon:"↓",selector:!0,allowLayers:!0,fields:[{name:"border",type:"number",placeholder:"0",width:36,label:"",titleKey:"border",title:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},
opacity:{label:"Set Opacity",icon:"◐",selector:!0,allowLayers:!0,fields:[{name:"value",type:"number",min:0,max:1,step:.1,def:"1",width:50,label:"",titleKey:"opacity",title:"Opacity"}]},fadeIn:{label:"Fade In",icon:"↗",selector:!0,allowLayers:!0,fields:[{name:"delay",type:"number",min:0,step:100,width:50,placeholder:"400",label:"ms",titleKey:"duration",title:"Duration (ms)"}]},fadeOut:{label:"Fade Out",icon:"↘",selector:!0,allowLayers:!0,fields:[{name:"delay",type:"number",min:0,step:100,width:50,
placeholder:"400",label:"ms",titleKey:"duration",title:"Duration (ms)"}]},fadeTo:{label:"Fade To",icon:"◐",selector:!0,allowLayers:!0,fields:[{name:"value",type:"number",min:0,max:1,step:.1,def:"0.5",width:50,label:"",titleKey:"opacity",title:"Opacity"},{name:"delay",type:"number",min:0,step:100,width:50,placeholder:"400",label:"ms",titleKey:"duration",title:"Duration (ms)"}]},wipeIn:{label:"Wipe In",icon:"→",selector:!0,allowLayers:!0},wipeOut:{label:"Wipe Out",icon:"←",selector:!0,allowLayers:!0},
popIn:{label:"Pop In",icon:"✨",selector:!0,allowLayers:!0},popOut:{label:"Pop Out",icon:"\ud83d\udca8",selector:!0,allowLayers:!0},highlight:{label:"Highlight",icon:"\ud83c\udf1f",selector:!0,allowLayers:!0,fields:[{name:"color",type:"color",def:"#00FF00",width:36,label:"",title:"Color"},{name:"duration",type:"number",min:0,step:100,width:50,placeholder:"1000",label:"ms",titleKey:"duration",title:"Duration (ms)"},{name:"opacity",type:"number",min:0,max:100,step:10,placeholder:"100",width:50,label:"%",
-titleKey:"opacity",title:"Opacity"}]},style:{label:"Set Style",icon:"\ud83c\udfa8",selector:!0,allowLayers:!0,fields:[{name:"key",type:"text",placeholder:"flowAnimation",width:90,label:"",title:"Key"},{name:"value",type:"text",placeholder:"1",width:50,label:"",title:"Value"}]},toggleStyle:{label:"Toggle Style",icon:"\ud83d\udd00",selector:!0,allowLayers:!0,fields:[{name:"key",type:"text",placeholder:"flowAnimation",width:90,label:"",title:"Key"},{name:"defaultValue",type:"text",placeholder:"0",width:50,
-label:"",title:"Default value"}]},flow:{label:"Flow",icon:"➡",selector:!0,allowLayers:!0,fields:[{name:"start",type:"select",options:[{value:"",label:"(toggle)"},{value:"true",label:"On"},{value:"false",label:"Off"}],label:""}]},wait:{label:"Wait",icon:"⏱",noSelector:!0,primary:{name:"value",type:"number",min:0,step:100,width:60,def:"1000",label:"ms",titleKey:"wait",title:"Wait"}},open:{label:"Open Link",icon:"\ud83d\udd17",noSelector:!0,primary:{name:"value",type:"text",placeholder:"https://… or data:page/id,…",
-label:"",title:"URL"}},viewbox:{label:"View",labelKey:"view",icon:"⊞",selector:!0,allowLayers:!0,fields:[{name:"x",type:"number",placeholder:"x",width:36,label:"",title:"X",staticOnly:!0},{name:"y",type:"number",placeholder:"y",width:36,label:"",title:"Y",staticOnly:!0},{name:"width",type:"number",placeholder:"w",width:36,label:"",titleKey:"width",title:"Width",staticOnly:!0},{name:"height",type:"number",placeholder:"h",width:36,label:"",titleKey:"height",title:"Height",staticOnly:!0},{name:"border",
-type:"number",placeholder:"b",width:36,label:"",titleKey:"border",title:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},tags:{label:"Toggle Tags",icon:"\ud83c\udff7",noSelector:!0,fields:[{name:"toggle",type:"tagList",labelKey:"toggle",label:"Toggle",modeField:"toggleMatch"},{name:"hidden",type:"tagList",labelKey:"hide",label:"Hide",modeField:"hiddenMatch"},{name:"visible",type:"tagList",labelKey:"show",label:"Show",modeField:"visibleMatch"}]}};
+titleKey:"opacity",title:"Opacity"}]},style:{label:"Set Style",icon:"\ud83c\udfa8",selector:!0,allowLayers:!0,fields:[{name:"key",type:"text",placeholder:"flowAnimation",width:90,label:"",title:"Key",styleKey:!0},{name:"value",type:"text",placeholder:"1",width:50,label:"",title:"Value"}]},toggleStyle:{label:"Toggle Style",icon:"\ud83d\udd00",selector:!0,allowLayers:!0,fields:[{name:"key",type:"text",placeholder:"flowAnimation",width:90,label:"",title:"Key",styleKey:!0},{name:"value",type:"text",placeholder:"1",
+width:50,label:"",title:"Value"},{name:"defaultValue",type:"text",placeholder:"0",width:50,label:"",title:"Default value"}]},flow:{label:"Flow",icon:"➡",selector:!0,allowLayers:!0,fields:[{name:"start",type:"select",options:[{value:"",label:"(toggle)"},{value:"true",label:"On"},{value:"false",label:"Off"}],label:""}]},wait:{label:"Wait",icon:"⏱",noSelector:!0,primary:{name:"value",type:"number",min:0,step:100,width:60,def:"1000",label:"ms",titleKey:"wait",title:"Wait"}},open:{label:"Open Link",icon:"\ud83d\udd17",
+noSelector:!0,primary:{name:"value",type:"text",placeholder:"https://… or data:page/id,…",label:"",title:"URL"}},viewbox:{label:"View",labelKey:"view",icon:"⊞",selector:!0,allowLayers:!0,fields:[{name:"x",type:"number",placeholder:"x",width:36,label:"",title:"X",staticOnly:!0},{name:"y",type:"number",placeholder:"y",width:36,label:"",title:"Y",staticOnly:!0},{name:"width",type:"number",placeholder:"w",width:36,label:"",titleKey:"width",title:"Width",staticOnly:!0},{name:"height",type:"number",placeholder:"h",
+width:36,label:"",titleKey:"height",title:"Height",staticOnly:!0},{name:"border",type:"number",placeholder:"b",width:36,label:"",titleKey:"border",title:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},tags:{label:"Toggle Tags",icon:"\ud83c\udff7",noSelector:!0,fields:[{name:"toggle",type:"tagList",labelKey:"toggle",label:"Toggle",modeField:"toggleMatch"},{name:"hidden",type:"tagList",labelKey:"hide",label:"Hide",modeField:"hiddenMatch"},{name:"visible",type:"tagList",
+labelKey:"show",label:"Show",modeField:"visibleMatch"}]}};
var RevisionDialog=function(b,k,m){var g=document.createElement("div"),q=document.createElement("h3");q.style.marginTop="3px";mxUtils.write(q,mxResources.get("revisionHistory"));g.appendChild(q);q=document.createElement("div");q.style.position="absolute";q.style.overflow="auto";q.style.width="170px";q.style.height="378px";g.appendChild(q);var u=document.createElement("div");u.style.position="absolute";u.style.left="200px";u.style.width="470px";u.style.height="376px";u.style.overflow="hidden";u.style.borderWidth=
"1px";u.style.borderStyle="solid";var x=document.createElement("div");x.style.position="absolute";x.style.display="none";x.style.textAlign="center";x.style.padding="8px";x.style.borderRadius="8px";x.style.left="50%";x.style.top="50%";x.style.whiteSpace="nowrap";x.style.transform="translate(-50%, -50%)";x.style.background="inherit";x.style.border="1px solid";u.appendChild(x);mxEvent.disableContextMenu(u);g.appendChild(u);var z=new Graph(u);z.setTooltips(!1);z.setEnabled(!1);z.setPanning(!0);z.panningHandler.ignoreCell=
-!0;z.panningHandler.useLeftButtonForPanning=!0;z.minFitScale=null;z.maxFitScale=null;z.centerZoom=!0;var F=0,J=null,H=0,D=z.getGlobalVariable;z.getGlobalVariable=function(Y){return"page"==Y&&null!=J&&null!=J[H]?J[H].getAttribute("name"):"pagenumber"==Y?H+1:"pagecount"==Y?null!=J?J.length:1:D.apply(this,arguments)};z.getLinkForCell=function(){return null};for(var c=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,
+!0;z.panningHandler.useLeftButtonForPanning=!0;z.minFitScale=null;z.maxFitScale=null;z.centerZoom=!0;var F=0,I=null,H=0,D=z.getGlobalVariable;z.getGlobalVariable=function(Y){return"page"==Y&&null!=I&&null!=I[H]?I[H].getAttribute("name"):"pagenumber"==Y?H+1:"pagecount"==Y?null!=I?I.length:1:D.apply(this,arguments)};z.getLinkForCell=function(){return null};for(var c=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,
shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),f=b.getCurrentFile(),l=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),n={},r=0;r<l.length;r++)n[l[r].getAttribute("id")]=l[r];var t=null,v=null,B=null,E=null,K=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=B&&z.zoomIn()},20);K.setAttribute("disabled","disabled");var C=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=B&&z.zoomOut()},20);C.setAttribute("disabled",
"disabled");var R=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=B&&(1==z.view.scale?(z.maxFitScale=8,z.fit(8)):z.zoomActual(),z.center())},20);R.setAttribute("disabled","disabled");var M=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));M.setAttribute("disabled","disabled");var O=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));O.setAttribute("disabled","disabled");var U=u.cloneNode(!1);U.style.pointerEvent="none";u.parentNode.appendChild(U);
var T=new Graph(U);T.setTooltips(!1);T.setEnabled(!1);T.setPanning(!0);T.panningHandler.ignoreCell=!0;T.panningHandler.useLeftButtonForPanning=!0;T.minFitScale=null;T.maxFitScale=null;T.centerZoom=!0;var V=document.createElement("div");V.style.textAlign="left";V.style.color="gray";V.style.backgroundColor="transparent";V.style.overflow="hidden";V.style.textOverflow="ellipsis";V.style.whiteSpace="nowrap";V.style.cursor="default";V.style.height="100%";V.style.display="inline-flex";V.style.alignItems=
-"center";V.style.flexGrow="1";mxEvent.addListener(V,"click",function(){var Y=mxUtils.getTextContent(V);""!=Y&&b.alert(Y)});var fa=null;mxEvent.addGestureListeners(M,function(Y){try{var W=null!=J[F]?n[J[F].getAttribute("id")]:null;mxUtils.setOpacity(M,20);x.innerText="";if(null==W)x.style.display="inline-block",mxUtils.write(x,mxResources.get("pageNotFound"));else{fa=V.innerHTML;V.innerHTML=mxResources.get("current");u.style.display="none";U.style.display="";U.style.backgroundColor=u.style.backgroundColor;
-var ca=Editor.parseDiagramNode(W);(new mxCodec(ca.ownerDocument)).decode(ca,T.getModel());T.view.scaleAndTranslate(z.view.scale,z.view.translate.x,z.view.translate.y);T.mathEnabled="1"==ca.getAttribute("math");T.setAdaptiveColors(ca.getAttribute("adaptiveColors"));Editor.MathJaxRender&&T.mathEnabled&&Editor.MathJaxRender(T.container)}}catch(S){x.style.display="inline-block",x.innerText="",mxUtils.write(x,mxResources.get("pageNotFound")+": "+S.message)}},null,function(){mxUtils.setOpacity(M,60);x.style.display=
-"none";x.innerText="";"none"==u.style.display&&(u.style.display="",V.innerHTML=fa,U.style.display="none")});mxEvent.addListener(O,"click",mxUtils.bind(this,function(Y){if(null!=B){Y=b.getPagesForNode(B.documentElement);var W=b.diffPages(b.pages,Y);Y=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(W,null,2),function(ca){try{if(0<ca.length&&b.editor.graph.isEnabled()){var S=[JSON.parse(ca)];b.confirm(mxResources.get("areYouSure"),function(){try{f.patch(S,null,!0,!0),b.hideDialog(),
-b.hideDialog()}catch(Z){b.handleError(Z)}})}else b.hideDialog()}catch(Z){b.handleError(Z)}},null,null,null,null,function(ca,S){if(null!=W[EditorUi.DIFF_UPDATE]){var Z=document.createElement("select"),da=document.createElement("option");mxUtils.write(da,mxResources.get("allPages"));da.setAttribute("value","allPages");Z.appendChild(da);for(var N in W[EditorUi.DIFF_UPDATE]){da=document.createElement("option");var aa=b.getPageById(N);null!=aa&&(mxUtils.write(da,aa.getName()),da.setAttribute("value","page-"+
-N),Z.appendChild(da))}Z.style.marginRight="8px";Z.style.order="-1";mxEvent.addListener(Z,"change",function(ea){ea=null;if("allPages"!=Z.value){var ka=Z.value.substring(5);null!=W[EditorUi.DIFF_UPDATE][ka]&&(ea={},ea[EditorUi.DIFF_UPDATE]={},ea[EditorUi.DIFF_UPDATE][ka]=W[EditorUi.DIFF_UPDATE][ka])}S.value=JSON.stringify(null==ea?W:ea,null,2)});2<Z.children.length&&ca.appendChild(Z)}},!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close"));b.showDialog(Y.container,620,460,!0,!0,null,null,
-null,new mxRectangle(0,0,440,280));Y.init()}}));var y=mxUtils.button(mxResources.get("restore"),function(Y){null!=B&&null!=E&&b.confirm(mxResources.get("areYouSure"),function(){null!=m?m(E):b.spinner.spin(document.body,mxResources.get("restoring"))&&(y.setAttribute("disabled","disabled"),f.save(!0,function(W){b.spinner.stop();y.removeAttribute("disabled");b.replaceFileData(E);b.hideDialog()},function(W){b.spinner.stop();y.removeAttribute("disabled");b.clearStatus();b.handleError(W,null!=W?mxResources.get("errorSavingFile"):
+"center";V.style.flexGrow="1";mxEvent.addListener(V,"click",function(){var Y=mxUtils.getTextContent(V);""!=Y&&b.alert(Y)});var fa=null;mxEvent.addGestureListeners(M,function(Y){try{var X=null!=I[F]?n[I[F].getAttribute("id")]:null;mxUtils.setOpacity(M,20);x.innerText="";if(null==X)x.style.display="inline-block",mxUtils.write(x,mxResources.get("pageNotFound"));else{fa=V.innerHTML;V.innerHTML=mxResources.get("current");u.style.display="none";U.style.display="";U.style.backgroundColor=u.style.backgroundColor;
+var ca=Editor.parseDiagramNode(X);(new mxCodec(ca.ownerDocument)).decode(ca,T.getModel());T.view.scaleAndTranslate(z.view.scale,z.view.translate.x,z.view.translate.y);T.mathEnabled="1"==ca.getAttribute("math");T.setAdaptiveColors(ca.getAttribute("adaptiveColors"));Editor.MathJaxRender&&T.mathEnabled&&Editor.MathJaxRender(T.container)}}catch(S){x.style.display="inline-block",x.innerText="",mxUtils.write(x,mxResources.get("pageNotFound")+": "+S.message)}},null,function(){mxUtils.setOpacity(M,60);x.style.display=
+"none";x.innerText="";"none"==u.style.display&&(u.style.display="",V.innerHTML=fa,U.style.display="none")});mxEvent.addListener(O,"click",mxUtils.bind(this,function(Y){if(null!=B){Y=b.getPagesForNode(B.documentElement);var X=b.diffPages(b.pages,Y);Y=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(X,null,2),function(ca){try{if(0<ca.length&&b.editor.graph.isEnabled()){var S=[JSON.parse(ca)];b.confirm(mxResources.get("areYouSure"),function(){try{f.patch(S,null,!0,!0),b.hideDialog(),
+b.hideDialog()}catch(Z){b.handleError(Z)}})}else b.hideDialog()}catch(Z){b.handleError(Z)}},null,null,null,null,function(ca,S){if(null!=X[EditorUi.DIFF_UPDATE]){var Z=document.createElement("select"),da=document.createElement("option");mxUtils.write(da,mxResources.get("allPages"));da.setAttribute("value","allPages");Z.appendChild(da);for(var N in X[EditorUi.DIFF_UPDATE]){da=document.createElement("option");var aa=b.getPageById(N);null!=aa&&(mxUtils.write(da,aa.getName()),da.setAttribute("value","page-"+
+N),Z.appendChild(da))}Z.style.marginRight="8px";Z.style.order="-1";mxEvent.addListener(Z,"change",function(ea){ea=null;if("allPages"!=Z.value){var ka=Z.value.substring(5);null!=X[EditorUi.DIFF_UPDATE][ka]&&(ea={},ea[EditorUi.DIFF_UPDATE]={},ea[EditorUi.DIFF_UPDATE][ka]=X[EditorUi.DIFF_UPDATE][ka])}S.value=JSON.stringify(null==ea?X:ea,null,2)});2<Z.children.length&&ca.appendChild(Z)}},!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close"));b.showDialog(Y.container,620,460,!0,!0,null,null,
+null,new mxRectangle(0,0,440,280));Y.init()}}));var y=mxUtils.button(mxResources.get("restore"),function(Y){null!=B&&null!=E&&b.confirm(mxResources.get("areYouSure"),function(){null!=m?m(E):b.spinner.spin(document.body,mxResources.get("restoring"))&&(y.setAttribute("disabled","disabled"),f.save(!0,function(X){b.spinner.stop();y.removeAttribute("disabled");b.replaceFileData(E);b.hideDialog()},function(X){b.spinner.stop();y.removeAttribute("disabled");b.clearStatus();b.handleError(X,null!=X?mxResources.get("errorSavingFile"):
null)}))})});y.className="geBtn gePrimaryBtn";y.setAttribute("disabled","disabled");var d=document.createElement("select");d.setAttribute("disabled","disabled");d.style.userSelect="none";d.style.maxWidth="100px";d.style.marginLeft="10px";d.style.display="none";var p=null;mxEvent.addListener(d,"change",function(Y){null!=p&&(p(Y),mxEvent.consume(Y))});var A=mxUtils.button(mxResources.get("open"),function(){null!=B&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(B.documentElement)),
-b.openLink(b.getUrl(),null,!0))});A.className="geBtn";A.setAttribute("disabled","disabled");var G=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});G.className="geBtn";G.setAttribute("disabled","disabled");null!=m&&(A.style.display="none");l=document.createElement("div");l.style.position="absolute";l.style.top="482px";l.style.right="28px";l.style.left="32px";l.style.justifyContent="end";l.style.display="flex";var I=document.createElement("div");I.className=
-"geToolbarContainer";I.style.backgroundColor="transparent";I.style.left="32px";I.style.right="32px";I.style.border="none";I.style.top="442px";var L=null;if(null!=k&&0<k.length){u.style.cursor="move";var P=document.createElement("table");P.style.borderWidth="1px";P.style.borderStyle="solid";P.style.borderCollapse="collapse";P.style.borderSpacing="0px";P.style.width="100%";var Q=document.createElement("tbody"),ba=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(F=mxUtils.indexOf(b.pages,
-b.currentPage));for(r=k.length-1;0<=r;r--){var X=function(Y){var W=new Date(Y.modifiedDate),ca=null;if(0<=W.getTime()){var S=function(da){c.stop();x.innerText="";var N=mxUtils.parseXml(da),aa=b.editor.extractGraphModel(N.documentElement,!0);if(null!=aa){var ea=function(wa){null!=wa&&(wa=ka(Editor.parseDiagramNode(wa)));return wa},ka=function(wa){var va=wa.getAttribute("background");if(null==va||""==va||va==mxConstants.NONE)va=z.defaultPageBackgroundColor;u.style.backgroundColor=mxUtils.getLightDarkColor(va);
-(new mxCodec(wa.ownerDocument)).decode(wa,z.getModel());z.maxFitScale=1;z.fit(8);z.center();z.mathEnabled="1"==wa.getAttribute("math");z.setAdaptiveColors(wa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&z.mathEnabled&&Editor.MathJaxRender(z.container);return wa};d.style.display="none";d.innerText="";B=N;E=da;J=parseSelectFunction=null;H=0;if("mxfile"==aa.nodeName){N=aa.getElementsByTagName("diagram");J=[];for(da=0;da<N.length;da++)J.push(N[da]);H=Math.min(F,J.length-1);0<J.length&&ea(J[H]);
-if(1<J.length)for(d.removeAttribute("disabled"),d.style.display="",da=0;da<J.length;da++){N=document.createElement("option");N.setAttribute("title",ra+" ("+J[da].getAttribute("id")+")");N.setAttribute("value",da);var ra=J[da].getAttribute("name")||mxResources.get("pageWithNumber",[da+1]);aa=b.getPageById(J[da].getAttribute("id"));var sa="";if(null!=aa){var ma=new DiagramPage(J[da]);b.getHashValueForPages([aa])!=b.getHashValueForPages([ma])&&(sa=" (M)")}else sa=" (X)";mxUtils.write(N,ra+sa);da==H&&
-N.setAttribute("selected","selected");d.appendChild(N)}p=function(){try{var wa=parseInt(d.value);H=F=wa;ea(J[wa])}catch(va){d.value=F,b.handleError(va)}}}else ka(aa);ra=Y.lastModifyingUserName;null!=ra&&20<ra.length&&(ra=ra.substring(0,20)+"...");V.innerText="";mxUtils.write(V,(null!=ra?ra+" ":"")+W.toLocaleDateString()+" "+W.toLocaleTimeString());V.setAttribute("title",ca.getAttribute("title"));K.removeAttribute("disabled");C.removeAttribute("disabled");R.removeAttribute("disabled");M.removeAttribute("disabled");
+b.openLink(b.getUrl(),null,!0))});A.className="geBtn";A.setAttribute("disabled","disabled");var G=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});G.className="geBtn";G.setAttribute("disabled","disabled");null!=m&&(A.style.display="none");l=document.createElement("div");l.style.position="absolute";l.style.top="482px";l.style.right="28px";l.style.left="32px";l.style.justifyContent="end";l.style.display="flex";var J=document.createElement("div");J.className=
+"geToolbarContainer";J.style.backgroundColor="transparent";J.style.left="32px";J.style.right="32px";J.style.border="none";J.style.top="442px";var L=null;if(null!=k&&0<k.length){u.style.cursor="move";var P=document.createElement("table");P.style.borderWidth="1px";P.style.borderStyle="solid";P.style.borderCollapse="collapse";P.style.borderSpacing="0px";P.style.width="100%";var Q=document.createElement("tbody"),ba=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(F=mxUtils.indexOf(b.pages,
+b.currentPage));for(r=k.length-1;0<=r;r--){var W=function(Y){var X=new Date(Y.modifiedDate),ca=null;if(0<=X.getTime()){var S=function(da){c.stop();x.innerText="";var N=mxUtils.parseXml(da),aa=b.editor.extractGraphModel(N.documentElement,!0);if(null!=aa){var ea=function(wa){null!=wa&&(wa=ka(Editor.parseDiagramNode(wa)));return wa},ka=function(wa){var va=wa.getAttribute("background");if(null==va||""==va||va==mxConstants.NONE)va=z.defaultPageBackgroundColor;u.style.backgroundColor=mxUtils.getLightDarkColor(va);
+(new mxCodec(wa.ownerDocument)).decode(wa,z.getModel());z.maxFitScale=1;z.fit(8);z.center();z.mathEnabled="1"==wa.getAttribute("math");z.setAdaptiveColors(wa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&z.mathEnabled&&Editor.MathJaxRender(z.container);return wa};d.style.display="none";d.innerText="";B=N;E=da;I=parseSelectFunction=null;H=0;if("mxfile"==aa.nodeName){N=aa.getElementsByTagName("diagram");I=[];for(da=0;da<N.length;da++)I.push(N[da]);H=Math.min(F,I.length-1);0<I.length&&ea(I[H]);
+if(1<I.length)for(d.removeAttribute("disabled"),d.style.display="",da=0;da<I.length;da++){N=document.createElement("option");N.setAttribute("title",ra+" ("+I[da].getAttribute("id")+")");N.setAttribute("value",da);var ra=I[da].getAttribute("name")||mxResources.get("pageWithNumber",[da+1]);aa=b.getPageById(I[da].getAttribute("id"));var sa="";if(null!=aa){var ma=new DiagramPage(I[da]);b.getHashValueForPages([aa])!=b.getHashValueForPages([ma])&&(sa=" (M)")}else sa=" (X)";mxUtils.write(N,ra+sa);da==H&&
+N.setAttribute("selected","selected");d.appendChild(N)}p=function(){try{var wa=parseInt(d.value);H=F=wa;ea(I[wa])}catch(va){d.value=F,b.handleError(va)}}}else ka(aa);ra=Y.lastModifyingUserName;null!=ra&&20<ra.length&&(ra=ra.substring(0,20)+"...");V.innerText="";mxUtils.write(V,(null!=ra?ra+" ":"")+X.toLocaleDateString()+" "+X.toLocaleTimeString());V.setAttribute("title",ca.getAttribute("title"));K.removeAttribute("disabled");C.removeAttribute("disabled");R.removeAttribute("disabled");M.removeAttribute("disabled");
O.removeAttribute("disabled");null!=f&&f.isRestricted()||(b.editor.graph.isEnabled()&&y.removeAttribute("disabled"),A.removeAttribute("disabled"),G.removeAttribute("disabled"));mxUtils.setOpacity(K,60);mxUtils.setOpacity(C,60);mxUtils.setOpacity(R,60);mxUtils.setOpacity(M,60);mxUtils.setOpacity(O,60)}else d.style.display="none",d.innerText="",V.innerText="",x.innerText="",mxUtils.write(V,mxResources.get("errorLoadingFile")),mxUtils.write(x,mxResources.get("errorLoadingFile"))};ca=document.createElement("tr");
-ca.style.borderBottomWidth="1px";ca.style.borderBottomStyle="solid";ca.style.fontSize="12px";ca.style.cursor="pointer";var Z=document.createElement("td");Z.style.padding="6px";Z.style.whiteSpace="nowrap";Y==k[k.length-1]?mxUtils.write(Z,mxResources.get("current")):W.toDateString()===ba?mxUtils.write(Z,W.toLocaleTimeString()):mxUtils.write(Z,W.toLocaleDateString()+" "+W.toLocaleTimeString());ca.appendChild(Z);ca.setAttribute("title",W.toLocaleDateString()+" "+W.toLocaleTimeString()+(null!=Y.fileSize?
+ca.style.borderBottomWidth="1px";ca.style.borderBottomStyle="solid";ca.style.fontSize="12px";ca.style.cursor="pointer";var Z=document.createElement("td");Z.style.padding="6px";Z.style.whiteSpace="nowrap";Y==k[k.length-1]?mxUtils.write(Z,mxResources.get("current")):X.toDateString()===ba?mxUtils.write(Z,X.toLocaleTimeString()):mxUtils.write(Z,X.toLocaleDateString()+" "+X.toLocaleTimeString());ca.appendChild(Z);ca.setAttribute("title",X.toLocaleDateString()+" "+X.toLocaleTimeString()+(null!=Y.fileSize?
" "+b.formatFileSize(parseInt(Y.fileSize)):"")+(null!=Y.lastModifyingUserName?" "+Y.lastModifyingUserName:""));mxEvent.addListener(ca,"click",function(da){v!=Y&&(c.stop(),null!=t&&(t.style.backgroundColor=""),v=Y,t=ca,t.style.backgroundColor="light-dark(#ebf2f9, #000000)",E=B=null,V.removeAttribute("title"),V.innerText=mxResources.get("loading")+"...",u.style.backgroundColor=z.defaultPageBackgroundColor,x.innerText="",z.getModel().clear(),y.setAttribute("disabled","disabled"),K.setAttribute("disabled",
"disabled"),C.setAttribute("disabled","disabled"),R.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),d.setAttribute("disabled","disabled"),mxUtils.setOpacity(K,20),mxUtils.setOpacity(C,20),mxUtils.setOpacity(R,20),mxUtils.setOpacity(M,20),mxUtils.setOpacity(O,20),c.spin(u),Y.getXml(function(N){if(v==Y)try{S(N)}catch(aa){V.innerText=mxResources.get("error")+": "+aa.message}},function(N){c.stop();d.style.display=
-"none";d.innerText="";V.innerText="";mxUtils.write(V,mxResources.get("errorLoadingFile"));mxUtils.write(x,mxResources.get("errorLoadingFile"))}),mxEvent.consume(da))});mxEvent.addListener(ca,"dblclick",function(da){A.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(da)},!1);Q.appendChild(ca)}return ca}(k[r]);null!=X&&r==k.length-1&&(L=X)}P.appendChild(Q);q.appendChild(P)}else null==f||null==b.drive&&f.constructor==window.DriveFile||
-null==b.dropbox&&f.constructor==window.DropboxFile?(u.style.display="none",I.style.display="none",mxUtils.write(q,mxResources.get("notAvailable"))):(u.style.display="none",I.style.display="none",mxUtils.write(q,mxResources.get("noRevisions")));this.init=function(){null!=L&&L.click()};q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";I.appendChild(V);I.appendChild(M);I.appendChild(C);I.appendChild(R);I.appendChild(K);I.appendChild(d);I.appendChild(O);b.editor.cancelFirst&&
-l.appendChild(q);l.appendChild(A);null!=f&&f.constructor==DriveFile&&l.appendChild(G);l.appendChild(y);b.editor.cancelFirst||l.appendChild(q);g.appendChild(l);g.appendChild(I);this.container=g},RecoveryDialog=function(b,k,m,g){var q=document.createElement("div");q.style.paddingBottom="10px";b=document.createElement("h3");mxUtils.write(b,mxResources.get("recoverTitle"));q.appendChild(b);b=function(x){var z=document.createElement("div");z.className="geDialogSection";z.style.cursor="pointer";z.style.marginBottom=
+"none";d.innerText="";V.innerText="";mxUtils.write(V,mxResources.get("errorLoadingFile"));mxUtils.write(x,mxResources.get("errorLoadingFile"))}),mxEvent.consume(da))});mxEvent.addListener(ca,"dblclick",function(da){A.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(da)},!1);Q.appendChild(ca)}return ca}(k[r]);null!=W&&r==k.length-1&&(L=W)}P.appendChild(Q);q.appendChild(P)}else null==f||null==b.drive&&f.constructor==window.DriveFile||
+null==b.dropbox&&f.constructor==window.DropboxFile?(u.style.display="none",J.style.display="none",mxUtils.write(q,mxResources.get("notAvailable"))):(u.style.display="none",J.style.display="none",mxUtils.write(q,mxResources.get("noRevisions")));this.init=function(){null!=L&&L.click()};q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";J.appendChild(V);J.appendChild(M);J.appendChild(C);J.appendChild(R);J.appendChild(K);J.appendChild(d);J.appendChild(O);b.editor.cancelFirst&&
+l.appendChild(q);l.appendChild(A);null!=f&&f.constructor==DriveFile&&l.appendChild(G);l.appendChild(y);b.editor.cancelFirst||l.appendChild(q);g.appendChild(l);g.appendChild(J);this.container=g},RecoveryDialog=function(b,k,m,g){var q=document.createElement("div");q.style.paddingBottom="10px";b=document.createElement("h3");mxUtils.write(b,mxResources.get("recoverTitle"));q.appendChild(b);b=function(x){var z=document.createElement("div");z.className="geDialogSection";z.style.cursor="pointer";z.style.marginBottom=
"8px";z.style.padding="10px";var F=document.createElement("div");F.style.fontWeight="600";F.style.marginBottom="4px";mxUtils.write(F,x.label);z.appendChild(F);null!=x.description&&(F=document.createElement("div"),F.style.fontSize="12px",F.style.opacity="0.75",mxUtils.write(F,x.description),z.appendChild(F));mxEvent.addListener(z,"click",function(){m(x)});q.appendChild(z)};for(var u=0;u<k.length;u++)b(k[u]);k=document.createElement("div");k.style.marginTop="34px";k.style.textAlign="right";b=mxUtils.button(mxResources.get("cancel"),
-function(){null!=g&&g()});b.className="geBtn";k.appendChild(b);q.appendChild(k);this.container=q},DraftDialog=function(b,k,m,g,q,u,x,z,F){var J=document.createElement("div"),H=document.createElement("div");H.style.marginTop="0px";H.style.whiteSpace="nowrap";H.style.overflow="auto";H.style.lineHeight="normal";mxUtils.write(H,k);J.appendChild(H);var D=document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==D.value?(D.value=D.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),
+function(){null!=g&&g()});b.className="geBtn";k.appendChild(b);q.appendChild(k);this.container=q},DraftDialog=function(b,k,m,g,q,u,x,z,F){var I=document.createElement("div"),H=document.createElement("div");H.style.marginTop="0px";H.style.whiteSpace="nowrap";H.style.overflow="auto";H.style.lineHeight="normal";mxUtils.write(H,k);I.appendChild(H);var D=document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==D.value?(D.value=D.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),
null,mxUtils.bind(this,function(){var M=this,O;return $jscomp.asyncExecutePromiseGeneratorProgram(function(U){for(O=0;O<F.length;O++)q.apply(M,[O,mxUtils.bind(M,function(){})]);b.hideDialog(!0);U.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(v=mxUtils.parseXml(F[D.value].data),B=b.editor.extractGraphModel(v.documentElement,!0),E=0,this.init())});if(null!=F){D.style.marginLeft="4px";for(k=0;k<F.length;k++){var f=document.createElement("option");f.setAttribute("value",k);var l=new Date(F[k].created),
n=new Date(F[k].modified);mxUtils.write(f,l.toLocaleDateString()+" "+l.toLocaleTimeString()+" - "+(l.toDateString(),n.toDateString(),n.toLocaleDateString())+" "+n.toLocaleTimeString());D.appendChild(f)}f=document.createElement("option");f.setAttribute("value","-1");mxUtils.write(f,mxResources.get("deleteAll"));D.appendChild(f);H.appendChild(D);mxEvent.addListener(D,"change",c)}null==m&&(m=F[0].data);var r=document.createElement("div");r.style.position="absolute";r.style.border="1px solid lightGray";
-r.style.marginTop="10px";r.style.left="40px";r.style.right="40px";r.style.top="46px";r.style.bottom="74px";r.style.overflow="hidden";mxEvent.disableContextMenu(r);J.appendChild(r);var t=new Graph(r);t.setEnabled(!1);t.setPanning(!0);t.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";t.panningHandler.ignoreCell=!0;t.panningHandler.useLeftButtonForPanning=!0;t.minFitScale=null;t.maxFitScale=null;t.centerZoom=!0;var v=mxUtils.parseXml(m),B=b.editor.extractGraphModel(v.documentElement,!0),E=0,K=null,
+r.style.marginTop="10px";r.style.left="40px";r.style.right="40px";r.style.top="46px";r.style.bottom="74px";r.style.overflow="hidden";mxEvent.disableContextMenu(r);I.appendChild(r);var t=new Graph(r);t.setEnabled(!1);t.setPanning(!0);t.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";t.panningHandler.ignoreCell=!0;t.panningHandler.useLeftButtonForPanning=!0;t.minFitScale=null;t.maxFitScale=null;t.centerZoom=!0;var v=mxUtils.parseXml(m),B=b.editor.extractGraphModel(v.documentElement,!0),E=0,K=null,
C=t.getGlobalVariable;t.getGlobalVariable=function(M){return"page"==M&&null!=K&&null!=K[E]?K[E].getAttribute("name"):"pagenumber"==M?E+1:"pagecount"==M?null!=K?K.length:1:C.apply(this,arguments)};t.getLinkForCell=function(){return null};m=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){t.zoomIn()},20);H=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){t.zoomOut()},20);k=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==
t.view.scale?(t.maxFitScale=8,t.fit(8)):t.zoomActual();t.center()},20);x=mxUtils.button(x||mxResources.get("discard"),function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var M=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(O){q.apply(M,[D.value,mxUtils.bind(M,function(){null!=D.parentNode&&(D.options[D.selectedIndex].parentNode.removeChild(D.options[D.selectedIndex]),1<D.options.length?(D.value=D.options[0].value,c()):b.hideDialog(!0))})]);O.jumpToEnd()})}),
mxResources.get("no"),mxResources.get("yes"))});x.className="geBtn";var R=document.createElement("select");R.style.maxWidth="80px";R.style.position="relative";R.style.top="-2px";R.style.verticalAlign="bottom";R.style.marginRight="6px";R.style.display="none";u=mxUtils.button(u||mxResources.get("edit"),function(){g.apply(this,[D.value])});u.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.position="absolute";f.style.bottom="30px";f.style.right="40px";f.style.textAlign="right";
l=document.createElement("div");l.className="geToolbarContainer";l.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function M(V){if(null!=V){var fa=V.getAttribute("background");if(null==fa||""==fa||fa==mxConstants.NONE)fa="light-dark(#ffffff, transparent)";r.style.backgroundColor=fa;(new mxCodec(V.ownerDocument)).decode(V,t.getModel());t.maxFitScale=1;t.fit(8);t.center()}return V}function O(V){if(null!=
V)try{V=M(Editor.parseDiagramNode(V))}catch(fa){b.handleError(fa)}return V}mxEvent.addListener(R,"change",function(V){E=parseInt(R.value);O(K[E]);mxEvent.consume(V)});if("mxfile"==B.nodeName){var U=B.getElementsByTagName("diagram");K=[];for(var T=0;T<U.length;T++)K.push(U[T]);0<K.length&&O(K[E]);R.innerText="";if(1<K.length)for(R.style.display="",T=0;T<K.length;T++)U=document.createElement("option"),mxUtils.write(U,K[T].getAttribute("name")||mxResources.get("pageWithNumber",[T+1])),U.setAttribute("value",
T),T==E&&U.setAttribute("selected","selected"),R.appendChild(U);else R.style.display="none"}else M(B)};l.appendChild(R);l.appendChild(m);l.appendChild(H);l.appendChild(k);m=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});m.className="geBtn";z=null!=z?mxUtils.button(mxResources.get("ignore"),z):null;null!=z&&(z.className="geBtn");b.editor.cancelFirst?(f.appendChild(m),null!=z&&f.appendChild(z),f.appendChild(x),f.appendChild(u)):(f.appendChild(u),f.appendChild(x),null!=z&&f.appendChild(z),
-f.appendChild(m));J.appendChild(f);J.appendChild(l);this.container=J},FindWindow=function(b,k,m,g,q,u){function x(p,A,G){if("object"===typeof A.value&&null!=A.value.attributes){A=A.value.attributes;for(var I=0;I<A.length;I++)if("label"!=A[I].nodeName){var L=mxUtils.trim(A[I].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==p&&0<=L.indexOf(G)||null!=p&&p.test(L))return!0}}return!1}function z(){f?(fa.removeAttribute("disabled"),y.removeAttribute("disabled")):(fa.setAttribute("disabled",
-"disabled"),y.setAttribute("disabled","disabled"));E.value?d.removeAttribute("disabled"):d.setAttribute("disabled","disabled")}function F(p,A,G){T.innerText="";var I=H.model.getDescendants(H.model.getRoot()),L=E.value.toLowerCase(),P=C.checked?new RegExp(L):null,Q=null;n=null;D!=L&&(D=L,c=null,l=!1);var ba=null==c;if(0<L.length){if(l){l=!1;for(var X,Y=0;Y<b.pages.length;Y++)if(b.currentPage==b.pages[Y]){X=Y;break}p=(X+1)%b.pages.length;c=null;do l=!1,L=b.pages[p],H=b.createTemporaryGraph(H.getStylesheet()),
-b.updatePageRoot(L),H.model.setRoot(L.root),p=(p+1)%b.pages.length;while(!F(!0,A,G)&&p!=X);c&&(c=null,G?b.editor.graph.model.execute(new SelectPage(b,L)):b.selectPage(L));l=!1;H=b.editor.graph;return F(!0,A,G)}for(Y=0;Y<I.length;Y++){X=H.view.getState(I[Y]);A&&(ba=ba||X==c);if(null!=X&&null!=X.cell.value&&(ba||null==Q)&&(H.model.isVertex(X.cell)||H.model.isEdge(X.cell))){null!=X.style&&"1"==X.style.html?(M.innerHTML=H.sanitizeHtml(H.getLabel(X.cell)),label=mxUtils.extractTextWithWhitespace([M])):
-label=H.getLabel(X.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var W=0;A&&u&&X==c&&(label=label.substr(r),W=r);var ca=null==K||""==K.value;if(null==P&&(0<=label.indexOf(L)||ca&&x(P,X.cell,L))||null!=P&&(P.test(label)||ca&&x(P,X.cell,L)))if(u&&(null!=P?(ca=label.match(P),null!=ca&&0<ca.length&&(n=ca[0].toLowerCase(),r=W+ca.index+n.length)):(n=L,r=W+label.indexOf(L)+n.length)),ba){Q=X;break}else null==Q&&(Q=X)}ba=ba||X==c}}if(null!=Q){if(Y==I.length&&R.checked)return c=
-null,l=!0,F(!0,A,G);c=Q;A=H.container;(null==A||c.x<A.scrollLeft||c.y<A.scrollTop||c.x+c.width>A.scrollLeft+A.clientWidth||c.y+c.height>A.scrollTop+A.clientHeight)&&H.scrollCellToVisible(c.cell,!0);H.isEnabled()&&!H.isCellLocked(c.cell)?G||H.getSelectionCell()==c.cell&&1==H.getSelectionCount()||H.setSelectionCell(c.cell):H.highlightCell(c.cell)}else{if(!p&&R.checked)return l=!0,F(!0,A,G);H.isEnabled()&&!G&&H.clearSelection()}f=null!=Q;u&&!p&&z();return 0==L.length||null!=Q}var J=b.actions.get("findReplace"),
+f.appendChild(m));I.appendChild(f);I.appendChild(l);this.container=I},FindWindow=function(b,k,m,g,q,u){function x(p,A,G){if("object"===typeof A.value&&null!=A.value.attributes){A=A.value.attributes;for(var J=0;J<A.length;J++)if("label"!=A[J].nodeName){var L=mxUtils.trim(A[J].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==p&&0<=L.indexOf(G)||null!=p&&p.test(L))return!0}}return!1}function z(){f?(fa.removeAttribute("disabled"),y.removeAttribute("disabled")):(fa.setAttribute("disabled",
+"disabled"),y.setAttribute("disabled","disabled"));E.value?d.removeAttribute("disabled"):d.setAttribute("disabled","disabled")}function F(p,A,G){T.innerText="";var J=H.model.getDescendants(H.model.getRoot()),L=E.value.toLowerCase(),P=C.checked?new RegExp(L):null,Q=null;n=null;D!=L&&(D=L,c=null,l=!1);var ba=null==c;if(0<L.length){if(l){l=!1;for(var W,Y=0;Y<b.pages.length;Y++)if(b.currentPage==b.pages[Y]){W=Y;break}p=(W+1)%b.pages.length;c=null;do l=!1,L=b.pages[p],H=b.createTemporaryGraph(H.getStylesheet()),
+b.updatePageRoot(L),H.model.setRoot(L.root),p=(p+1)%b.pages.length;while(!F(!0,A,G)&&p!=W);c&&(c=null,G?b.editor.graph.model.execute(new SelectPage(b,L)):b.selectPage(L));l=!1;H=b.editor.graph;return F(!0,A,G)}for(Y=0;Y<J.length;Y++){W=H.view.getState(J[Y]);A&&(ba=ba||W==c);if(null!=W&&null!=W.cell.value&&(ba||null==Q)&&(H.model.isVertex(W.cell)||H.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(M.innerHTML=H.sanitizeHtml(H.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([M])):
+label=H.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var X=0;A&&u&&W==c&&(label=label.substr(r),X=r);var ca=null==K||""==K.value;if(null==P&&(0<=label.indexOf(L)||ca&&x(P,W.cell,L))||null!=P&&(P.test(label)||ca&&x(P,W.cell,L)))if(u&&(null!=P?(ca=label.match(P),null!=ca&&0<ca.length&&(n=ca[0].toLowerCase(),r=X+ca.index+n.length)):(n=L,r=X+label.indexOf(L)+n.length)),ba){Q=W;break}else null==Q&&(Q=W)}ba=ba||W==c}}if(null!=Q){if(Y==J.length&&R.checked)return c=
+null,l=!0,F(!0,A,G);c=Q;A=H.container;(null==A||c.x<A.scrollLeft||c.y<A.scrollTop||c.x+c.width>A.scrollLeft+A.clientWidth||c.y+c.height>A.scrollTop+A.clientHeight)&&H.scrollCellToVisible(c.cell,!0);H.isEnabled()&&!H.isCellLocked(c.cell)?G||H.getSelectionCell()==c.cell&&1==H.getSelectionCount()||H.setSelectionCell(c.cell):H.highlightCell(c.cell)}else{if(!p&&R.checked)return l=!0,F(!0,A,G);H.isEnabled()&&!G&&H.clearSelection()}f=null!=Q;u&&!p&&z();return 0==L.length||null!=Q}var I=b.actions.get("findReplace"),
H=b.editor.graph,D=null,c=null,f=!1,l=!1,n=null,r=0,t=1,v=document.createElement("div");v.style.userSelect="none";v.style.overflow="hidden";v.style.padding="10px";v.style.height="100%";var B=u?"260px":"200px",E=document.createElement("input");E.setAttribute("placeholder",mxResources.get("find"));E.setAttribute("type","text");E.style.marginTop="4px";E.style.marginBottom="6px";E.style.width=B;E.style.fontSize="12px";E.style.borderRadius="4px";E.style.padding="6px";v.appendChild(E);mxUtils.br(v);if(u){var K=
document.createElement("input");K.setAttribute("placeholder",mxResources.get("replaceWith"));K.setAttribute("type","text");K.style.marginTop="4px";K.style.marginBottom="6px";K.style.width=B;K.style.fontSize="12px";K.style.borderRadius="4px";K.style.padding="6px";v.appendChild(K);mxUtils.br(v);mxEvent.addListener(K,"input",z)}var C=document.createElement("input");C.setAttribute("id","geFindWinRegExChck");C.setAttribute("type","checkbox");C.style.marginRight="4px";v.appendChild(C);B=document.createElement("label");
B.setAttribute("for","geFindWinRegExChck");v.appendChild(B);mxUtils.write(B,mxResources.get("regularExpression"));v.appendChild(B);B=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");B.style.position="relative";B.style.marginLeft="6px";v.appendChild(B);mxUtils.br(v);var R=document.createElement("input");R.setAttribute("id","geFindWinAllPagesChck");R.setAttribute("type","checkbox");R.style.marginRight="4px";v.appendChild(R);B=document.createElement("label");B.setAttribute("for",
"geFindWinAllPagesChck");v.appendChild(B);mxUtils.write(B,mxResources.get("allPages"));v.appendChild(B);var M=document.createElement("div");mxUtils.br(v);B=document.createElement("div");B.style.left="0px";B.style.right="0px";B.style.marginTop="6px";B.style.padding="0 6px 0 6px";v.appendChild(B);var O=mxUtils.button(mxResources.get("reset"),function(){T.innerText="";E.value="";E.style.backgroundColor="";u&&(K.value="",z());D=c=null;l=!1;E.focus()});O.setAttribute("title",mxResources.get("reset"));
O.style.float="none";O.style.width="120px";O.style.marginTop="6px";O.style.marginLeft="8px";O.style.overflow="hidden";O.style.textOverflow="ellipsis";O.className="geBtn";u||B.appendChild(O);var U=mxUtils.button(mxResources.get("find"),function(){try{E.style.backgroundColor=F()?"":"light-dark(#ffcfcf, #ff0000)"}catch(p){b.handleError(p)}});U.setAttribute("title",mxResources.get("find")+" (Enter)");U.style.float="none";U.style.width="120px";U.style.marginTop="6px";U.style.marginLeft="8px";U.style.overflow=
-"hidden";U.style.textOverflow="ellipsis";U.className="geBtn gePrimaryBtn";B.appendChild(U);var T=document.createElement("div");T.style.marginTop="10px";if(u){var V=function(p,A,G,I,L){if(null==L||"1"!=L.html)return I=p.toLowerCase().indexOf(A,I),0>I?p:p.substr(0,I)+G+p.substr(I+A.length);var P=p;A=mxUtils.htmlEntities(A,!1,!1,!1);L=[];var Q=-1;for(p=p.replace(/<br>/ig,"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(Q=p.indexOf("<",Q+1));)L.push(Q);
-Q=p.match(/<[^>]*>/g);p=p.replace(/<[^>]*>/g,"");I=p.toLowerCase().indexOf(A,I);if(0>I)return P;P=I+A.length;G=mxUtils.htmlEntities(G);p=p.substr(0,I)+G+p.substr(P);for(var ba=0,X=0;X<L.length;X++){if(L[X]-ba<I)p=p.substr(0,L[X])+Q[X]+p.substr(L[X]);else{var Y=L[X]-ba<P?I+ba:L[X]+(G.length-A.length);p=p.substr(0,Y)+Q[X]+p.substr(Y)}ba+=Q[X].length}return p.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};B.style.textAlign="center";var fa=mxUtils.button(mxResources.get("replFind"),
+"hidden";U.style.textOverflow="ellipsis";U.className="geBtn gePrimaryBtn";B.appendChild(U);var T=document.createElement("div");T.style.marginTop="10px";if(u){var V=function(p,A,G,J,L){if(null==L||"1"!=L.html)return J=p.toLowerCase().indexOf(A,J),0>J?p:p.substr(0,J)+G+p.substr(J+A.length);var P=p;A=mxUtils.htmlEntities(A,!1,!1,!1);L=[];var Q=-1;for(p=p.replace(/<br>/ig,"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(Q=p.indexOf("<",Q+1));)L.push(Q);
+Q=p.match(/<[^>]*>/g);p=p.replace(/<[^>]*>/g,"");J=p.toLowerCase().indexOf(A,J);if(0>J)return P;P=J+A.length;G=mxUtils.htmlEntities(G);p=p.substr(0,J)+G+p.substr(P);for(var ba=0,W=0;W<L.length;W++){if(L[W]-ba<J)p=p.substr(0,L[W])+Q[W]+p.substr(L[W]);else{var Y=L[W]-ba<P?J+ba:L[W]+(G.length-A.length);p=p.substr(0,Y)+Q[W]+p.substr(Y)}ba+=Q[W].length}return p.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};B.style.textAlign="center";var fa=mxUtils.button(mxResources.get("replFind"),
function(){try{if(null!=n&&null!=c){var p=c.cell,A=H.getLabel(p);H.isCellEditable(p)&&H.model.setValue(p,V(A,n,K.value,r-n.length,H.getCurrentCellStyle(p)));E.style.backgroundColor=F(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(G){b.handleError(G)}});fa.setAttribute("title",mxResources.get("replFind"));fa.style.float="none";fa.style.width="120px";fa.style.marginTop="6px";fa.style.marginLeft="8px";fa.style.overflow="hidden";fa.style.textOverflow="ellipsis";fa.className="geBtn gePrimaryBtn";fa.setAttribute("disabled",
"disabled");B.appendChild(fa);mxUtils.br(B);var y=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=n&&null!=c){var p=c.cell,A=H.getLabel(p);H.model.setValue(p,V(A,n,K.value,r-n.length,H.getCurrentCellStyle(p)));fa.setAttribute("disabled","disabled");y.setAttribute("disabled","disabled")}}catch(G){b.handleError(G)}});y.setAttribute("title",mxResources.get("replace"));y.style.float="none";y.style.width="120px";y.style.marginTop="6px";y.style.marginLeft="8px";y.style.overflow="hidden";
-y.style.textOverflow="ellipsis";y.className="geBtn gePrimaryBtn";y.setAttribute("disabled","disabled");B.appendChild(y);var d=mxUtils.button(mxResources.get("replaceAll"),function(){T.innerText="";D=null;var p=b.currentPage,A=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;H.getModel().beginUpdate();try{for(var G=0,I={};F(!1,!0,!0)&&100>G;){var L=c.cell,P=H.getLabel(L),Q=I[L.id];if(Q&&Q.replAllMrk==t&&Q.replAllPos>=r)break;I[L.id]={replAllMrk:t,replAllPos:r};H.isCellEditable(L)&&(H.model.setValue(L,
+y.style.textOverflow="ellipsis";y.className="geBtn gePrimaryBtn";y.setAttribute("disabled","disabled");B.appendChild(y);var d=mxUtils.button(mxResources.get("replaceAll"),function(){T.innerText="";D=null;var p=b.currentPage,A=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;H.getModel().beginUpdate();try{for(var G=0,J={};F(!1,!0,!0)&&100>G;){var L=c.cell,P=H.getLabel(L),Q=J[L.id];if(Q&&Q.replAllMrk==t&&Q.replAllPos>=r)break;J[L.id]={replAllMrk:t,replAllPos:r};H.isCellEditable(L)&&(H.model.setValue(L,
V(P,n,K.value,r-n.length,H.getCurrentCellStyle(L))),G++)}p!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,p));mxUtils.write(T,mxResources.get("matchesRepl",[G]))}catch(ba){b.handleError(ba)}finally{H.getModel().endUpdate(),b.editor.graph.setSelectionCells(A),b.editor.graph.rendering=!0}t++});d.setAttribute("title",mxResources.get("replaceAll"));d.style.float="none";d.style.width="120px";d.style.marginTop="6px";d.style.marginLeft="8px";d.style.overflow="hidden";d.style.textOverflow=
"ellipsis";d.className="geBtn gePrimaryBtn";d.setAttribute("disabled","disabled");B.appendChild(d);mxUtils.br(B);B.appendChild(O);O=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));O.setAttribute("title",mxResources.get("close"));O.style.float="none";O.style.width="120px";O.style.marginTop="6px";O.style.marginLeft="8px";O.style.overflow="hidden";O.style.textOverflow="ellipsis";O.className="geBtn";B.appendChild(O);mxUtils.br(B);B.appendChild(T)}else B.style.display=
-"flex",B.style.alignItems="center",O.style.width="",U.style.width="";mxEvent.addListener(E,"keyup",function(p){if(91==p.keyCode||93==p.keyCode||17==p.keyCode)mxEvent.consume(p);else if(27==p.keyCode)J.funct();else if(D!=E.value.toLowerCase()||13==p.keyCode)try{E.style.backgroundColor=F()?"":"light-dark(#ffcfcf, #ff0000)"}catch(A){E.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(v,"keydown",function(p){70==p.keyCode&&b.keyHandler.isControlDown(p)&&!mxEvent.isShiftDown(p)&&
-(J.funct(),mxEvent.consume(p))});this.window=new mxWindow(mxResources.get("find")+(u?"/"+mxResources.get("replace"):""),v,k,m,g,q,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(E.focus(),mxClient.IS_GC||mxClient.IS_FF?E.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?R.removeAttribute("disabled"):
+"flex",B.style.alignItems="center",O.style.width="",U.style.width="";mxEvent.addListener(E,"keyup",function(p){if(91==p.keyCode||93==p.keyCode||17==p.keyCode)mxEvent.consume(p);else if(27==p.keyCode)I.funct();else if(D!=E.value.toLowerCase()||13==p.keyCode)try{E.style.backgroundColor=F()?"":"light-dark(#ffcfcf, #ff0000)"}catch(A){E.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(v,"keydown",function(p){70==p.keyCode&&b.keyHandler.isControlDown(p)&&!mxEvent.isShiftDown(p)&&
+(I.funct(),mxEvent.consume(p))});this.window=new mxWindow(mxResources.get("find")+(u?"/"+mxResources.get("replace"):""),v,k,m,g,q,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(E.focus(),mxClient.IS_GC||mxClient.IS_FF?E.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?R.removeAttribute("disabled"):
(R.checked=!1,R.setAttribute("disabled","disabled"))):H.container.focus()}));b.installResizeHandler(this,!1);this.doSearch=function(p){E.focus();E.value=p;U.click()}},FreehandWindow=function(b,k,m,g,q,u){var x=b.editor.graph,z=document.createElement("div");z.style.textAlign="center";z.style.userSelect="none";z.style.overflow="hidden";z.style.height="100%";if(u){var F=function(){var f=x.freehand.getStrokeColor(!0);null!=f&&f!=mxConstants.NONE&&1<f.length&&"string"===typeof f&&("default"==f?f=mxResources.get("useBlackAndWhite"):
-(f="#"==f.charAt(0)?f.substring(1).toUpperCase():f,f=ColorDialog.prototype.colorNames[f]),null!=f&&H.setAttribute("title",f))},J=document.createElement("input");J.setAttribute("id","geFreehandBrush");J.setAttribute("type","checkbox");J.checked=x.freehand.isPerfectFreehandMode();J.style.margin="10px 5px 0px 10px";J.style.float="left";z.appendChild(J);x.freehand.setPerfectFreehandMode(J.checked);u=document.createElement("label");u.setAttribute("for","geFreehandBrush");u.style.float="left";u.style.marginTop=
+(f="#"==f.charAt(0)?f.substring(1).toUpperCase():f,f=ColorDialog.prototype.colorNames[f]),null!=f&&H.setAttribute("title",f))},I=document.createElement("input");I.setAttribute("id","geFreehandBrush");I.setAttribute("type","checkbox");I.checked=x.freehand.isPerfectFreehandMode();I.style.margin="10px 5px 0px 10px";I.style.float="left";z.appendChild(I);x.freehand.setPerfectFreehandMode(I.checked);u=document.createElement("label");u.setAttribute("for","geFreehandBrush");u.style.float="left";u.style.marginTop=
"10px";z.appendChild(u);mxUtils.write(u,mxResources.get("brush"));z.appendChild(u);var H=document.createElement("tempDiv");H.style.display="block";H.style.width="100%";H.style.height="100%";H.style.borderRadius="2px";H.style.boxSizing="border-box";H.style.border="1px solid black";H.style.backgroundColor=x.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){H.style.backgroundColor=x.freehand.getStrokeColor()});F();u=mxUtils.button("",mxUtils.bind(this,function(f){b.pickColor(x.freehand.getStrokeColor(!0),
function(l){x.freehand.setStrokeColor(l);H.style.backgroundColor=x.freehand.getStrokeColor();F()},"default");mxEvent.consume(f)}));u.style.position="absolute";u.style.boxSizing="border-box";u.style.padding="2px";u.style.top="8px";u.style.right="8px";u.style.width="28px";u.style.height="18px";u.className="geColorBtn";u.innerText="";u.appendChild(H);z.appendChild(u);u=document.createElement("img");u.setAttribute("title",mxResources.get("settings"));u.setAttribute("src",Editor.gearImage);u.className=
"geButton";u.style.position="absolute";u.style.boxSizing="border-box";u.style.padding="2px";u.style.top="8px";u.style.right="38px";u.style.width="18px";u.style.height="18px";u.style.opacity="0.6";z.appendChild(u);mxEvent.addListener(u,"click",mxUtils.bind(this,function(f){f=x.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",f,function(l){!isNaN(l)&&0<l&&20>=l&&x.freehand.setSmoothing(parseInt(l))})}));mxUtils.br(z);var D=document.createElement("input");D.setAttribute("type",
-"range");D.setAttribute("min","2");D.setAttribute("max","30");D.setAttribute("value",x.freehand.getBrushSize());D.style.width="90%";D.style.visibility="hidden";z.appendChild(D);mxUtils.br(z);u=function(){x.freehand.setPerfectFreehandMode(J.checked);D.style.visibility=J.checked?"visible":"hidden"};mxEvent.addListener(J,"change",u);u();mxEvent.addListener(D,"change",function(){x.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){x.freehand.isDrawing()?
+"range");D.setAttribute("min","2");D.setAttribute("max","30");D.setAttribute("value",x.freehand.getBrushSize());D.style.width="90%";D.style.visibility="hidden";z.appendChild(D);mxUtils.br(z);u=function(){x.freehand.setPerfectFreehandMode(I.checked);D.style.visibility=I.checked?"visible":"hidden"};mxEvent.addListener(I,"change",u);u();mxEvent.addListener(D,"change",function(){x.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){x.freehand.isDrawing()?
x.freehand.stopDrawing():x.freehand.startDrawing()});c.setAttribute("title",mxResources.get("startDrawing")+" (X)");c.style.width="90%";c.style.marginLeft="0px";c.style.position="relative";c.className="geBtn gePrimaryBtn";z.appendChild(c);this.window=new mxWindow(mxResources.get("freehand"),z,k,m,g,q,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);x.addListener("freehandStateChanged",mxUtils.bind(this,function(){c.innerText=
"";mxUtils.write(c,mxResources.get(x.freehand.isDrawing()?"stopDrawing":"startDrawing"));var f=document.createElement("span");f.className="geShortcutKey";f.style.margin="0 2px 4px 0";mxUtils.write(f,"X");c.appendChild(f);c.setAttribute("title",mxResources.get(x.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");c.className="geBtn"+(x.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,
function(){x.freehand.isDrawing()&&x.freehand.stopDrawing()}));b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,k,m,g,q){var u=b.editor.graph,x=document.createElement("div");x.style.userSelect="none";x.style.overflow="hidden";x.style.boxSizing="border-box";x.style.padding="12px";x.style.height="100%";var z=function(){x.style.colorScheme=null!=Editor.isDarkMode&&Editor.isDarkMode()?"dark":"light"};z();b.addListener("darkModeChanged",z);z=document.createElement("div");z.className="geDialogSection";
-var F=b.addCheckbox(z,mxResources.get("background"),!0,null,null,null,null,null,!0),J=b.addCheckbox(z,mxResources.get("labels"),!0,null,null,null,null,null,!0);x.appendChild(z);z=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),function(){b.removeUserDefinedDarkColors(u.isSelectionEmpty()?u.getVerticesAndEdges():u.getSelectionCells(),J.checked,F.checked)});z.className="geBtn gePrimaryBtn";z.style.boxSizing="border-box";z.style.margin="0";z.style.width="100%";x.appendChild(z);
+var F=b.addCheckbox(z,mxResources.get("background"),!0,null,null,null,null,null,!0),I=b.addCheckbox(z,mxResources.get("labels"),!0,null,null,null,null,null,!0);x.appendChild(z);z=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),function(){b.removeUserDefinedDarkColors(u.isSelectionEmpty()?u.getVerticesAndEdges():u.getSelectionCells(),I.checked,F.checked)});z.className="geBtn gePrimaryBtn";z.style.boxSizing="border-box";z.style.margin="0";z.style.width="100%";x.appendChild(z);
this.window=new mxWindow(mxResources.get("adaptiveColors"),x,k,m,g,q,!0,!0);this.window.destroyOnClose=!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,k,m,g,q){function u(){var ia={title:null,turns:[],el:document.createElement("div"),lastContext:null},ja=document.createElement("a");ja.style.display=
"flex";ja.style.alignItems="center";ja.style.gap="4px";ja.style.padding="5px 6px";ja.style.borderRadius="8px";ja.style.fontSize="11px";ja.style.cursor="default";ja.style.overflow="hidden";ia.item=ja;var na=document.createElement("span");na.style.flexGrow="1";na.style.overflow="hidden";na.style.textOverflow="ellipsis";na.style.whiteSpace="nowrap";ja.appendChild(na);ia.label=na;var Aa=document.createElement("img");Aa.className="geAdaptiveAsset";Aa.setAttribute("src",Editor.trashImage);Aa.setAttribute("title",
mxResources.get("delete"));Aa.style.width="13px";Aa.style.flexShrink="0";Aa.style.cursor="pointer";Aa.style.opacity="0.6";Aa.style.display="none";ja.appendChild(Aa);ia.del=Aa;mxEvent.addListener(ja,"mouseenter",function(){ia.active||(ja.style.backgroundColor="light-dark(#ececec, #333333)")});mxEvent.addListener(ja,"mouseleave",function(){ia.active||(ja.style.backgroundColor="transparent")});mxEvent.addListener(ja,"click",function(ha){mxEvent.getSource(ha)==Aa?b.confirm(mxResources.get("areYouSure"),
function(){M(ia)}):ia!=E&&C(ia);mxEvent.consume(ha)});R(ia,null);t.insertBefore(ja,t.firstChild);B.splice(0,0,ia);return ia}function x(){var ia=document.createElement("div");ia.style.textAlign="left";ia.style.padding="6px";ia.style.margin="6px 0";return ia}function z(ia){var ja=document.createElement("div");ja.style.whiteSpace="pre-wrap";ja.style.overflow="auto";ja.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(ia,!1).replace(/\n*^##### (.+)$\n*/gm,"<h5>$1</h5>").replace(/\n*^#### (.+)$\n*/gm,
"<h4>$1</h4>").replace(/\n*^### (.+)$\n*/gm,"<h3>$1</h3>").replace(/\n*^## (.+)$\n*/gm,"<h2>$1</h2>").replace(/\n*^# (.+)$\n*/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>"));return ja}function F(ia,ja){var na=mxResources.get("error")+": ",Aa=document.createElement("div");Aa.style.whiteSpace="pre-wrap";ia=null!=ia&&null!=ia.message?ia.message:"string"===typeof ia?ia:mxResources.get("unknownError");"string"!==
-typeof ia&&(ia=String(ia));ia.substring(0,na.length)!=na&&(ia=na+ia);mxUtils.write(Aa,ia);if(null!=ja){na=Aa.appendChild;ia=document.createElement("div");ia.style.display="flex";var ha=document.createElement("img");ha.className="geAdaptiveAsset geLibraryButton";ha.setAttribute("src",Editor.refreshImage);ha.setAttribute("title",mxResources.get("retry"));ia.appendChild(ha);mxEvent.addListener(ha,"click",ja);na.call(Aa,ia)}return Aa}function J(){null!=ba&&ba();var ia=mxUtils.trim(d.value),ja=P();if(""!=
+typeof ia&&(ia=String(ia));ia.substring(0,na.length)!=na&&(ia=na+ia);mxUtils.write(Aa,ia);if(null!=ja){na=Aa.appendChild;ia=document.createElement("div");ia.style.display="flex";var ha=document.createElement("img");ha.className="geAdaptiveAsset geLibraryButton";ha.setAttribute("src",Editor.refreshImage);ha.setAttribute("title",mxResources.get("retry"));ia.appendChild(ha);mxEvent.addListener(ha,"click",ja);na.call(Aa,ia)}return Aa}function I(){null!=ba&&ba();var ia=mxUtils.trim(d.value),ja=P();if(""!=
ia||"clipboard"==ja.kind&&null!=V)try{var na=V;V=null;fa();null==E.title&&""!=ia&&R(E,40<ia.length?ia.substring(0,40)+"…":ia);qa(E,ia,na,ja);d.value="";p();ra()}catch(Aa){EditorUi.debug("EditorUi.ChatWindow.send","error",Aa)}}var H=b.editor.graph,D=[];if(0<=mxUtils.indexOf(Editor.aiActions,"create")||0<=mxUtils.indexOf(Editor.aiActions,"update")||0<=mxUtils.indexOf(Editor.aiActions,"assist"))for(var c=0;c<Editor.aiModels.length;c++){var f=Editor.aiModels[c];null!=Editor.aiConfigs[f.config]&&null!=
Editor.aiGlobals[Editor.aiConfigs[f.config].apiKey]&&D.push({id:"model-"+f.name,kind:"model",label:f.name,model:f})}b.isExternalDataComms()&&EditorUi.isMermaidSupported()&&0<=mxUtils.indexOf(Editor.aiActions,"createPublic")&&(0==D.length||1==urlParams.test)&&D.push({id:"public",kind:"public",label:mxResources.get("draw.io")});D.push({id:"clipboard",kind:"clipboard",label:mxResources.get("clipboard")});var l=document.createElement("div");l.style.display="flex";l.style.overflow="hidden";l.style.height=
"100%";l.style.boxSizing="border-box";var n=function(){l.style.colorScheme=null!=Editor.isDarkMode&&Editor.isDarkMode()?"dark":"light"};n();b.addListener("darkModeChanged",n);mxEvent.addGestureListeners(l,function(ia){null!=b.sidebar&&b.sidebar.hideTooltip()},null,null);var r=document.createElement("div");r.style.display="flex";r.style.flexDirection="column";r.style.flexShrink="0";r.style.width="150px";r.style.boxSizing="border-box";r.style.padding="8px 6px 20px 6px";r.style.borderRight="1px solid light-dark(#e5e5e5, #505050)";
@@ -13429,11 +13431,11 @@ mxResources.get("file"),ja.data=b.getFileData(!0,null,null,null,!0,!1,null,null,
d.focus()}catch(ha){b.handleError(ha)}},d=document.createElement("textarea");d.setAttribute("rows","1");d.setAttribute("placeholder",mxResources.get("describeYourDiagram"));d.style.width="100%";d.style.outline="none";d.style.border="none";d.style.resize="none";d.style.background="transparent";d.style.fontFamily="inherit";d.style.fontSize="12px";d.style.padding="4px 2px";d.style.margin="0";d.style.boxSizing="border-box";d.style.maxHeight="92px";d.style.overflow="auto";r.appendChild(d);var p=function(){d.style.height=
"auto";d.style.height=Math.min(92,d.scrollHeight)+"px"};mxEvent.addListener(d,"input",function(){p();ra()});U=document.createElement("div");U.style.display="flex";U.style.alignItems="center";U.style.gap="6px";U.style.marginTop="2px";r.appendChild(U);var A=document.createElement("img");A.className="geAdaptiveAsset";A.setAttribute("src",Editor.thinAddCircleImage);A.setAttribute("title",mxResources.get("add"));A.style.width="18px";A.style.cursor="pointer";A.style.opacity="0.7";A.style.flexShrink="0";
U.appendChild(A);mxEvent.addListener(A,"click",function(ia){var ja=mxUtils.getOffset(A);b.showPopupMenu(function(na,Aa){na.addItem(mxResources.get("file"),null,function(){y("file")},Aa,null,null!=b.pages&&1<b.pages.length||!b.isDiagramEmpty());na.addItem(mxResources.get("page"),null,function(){y("page")},Aa,null,!b.isDiagramEmpty());na.addItem(mxResources.get("selection"),null,function(){y("selection")},Aa,null,!H.isSelectionEmpty())},ja.x,ja.y+A.offsetHeight+4,ia)});var G=mxUtils.button(mxResources.get("paste"),
-function(){ua(E)});G.className="geBtn";G.setAttribute("title",mxResources.get("pasteResponse"));G.style.margin="0";G.style.fontSize="11px";G.style.minWidth="0";G.style.padding="2px 8px";U.appendChild(G);c=document.createElement("div");c.style.flexGrow="1";U.appendChild(c);var I=document.createElement("select");I.style.borderColor="transparent";I.style.background="light-dark(var(--highlight-color), var(--dark-soft-color))";I.style.textOverflow="ellipsis";I.style.fontSize="11px";I.style.opacity="0.8";
-I.style.maxWidth="60%";I.style.minWidth="0";I.style.padding="2px";for(c=0;c<D.length;c++){var L=document.createElement("option");L.setAttribute("value",D[c].id);mxUtils.write(L,D[c].label);I.appendChild(L)}I.value=D[0].id;U.appendChild(I);var P=function(){for(var ia=0;ia<D.length;ia++)if(D[ia].id==I.value)return D[ia];return D[D.length-1]};c=function(){G.style.display="clipboard"==P().kind?"":"none";ra()};mxEvent.addListener(I,"change",c);var Q=window.SpeechRecognition||window.webkitSpeechRecognition,
-ba=null;if(null!=Q){var X=document.createElement("img");X.className="geAdaptiveAsset";X.setAttribute("src",Editor.micImage);X.setAttribute("title",mxResources.get("dictate"));X.style.width="18px";X.style.cursor="pointer";X.style.opacity="0.7";X.style.flexShrink="0";X.style.borderRadius="50%";U.appendChild(X);var Y=null;ba=function(){if(null!=Y){var ia=Y;Y=null;try{ia.stop()}catch(ja){}}X.style.backgroundColor="";X.style.opacity="0.7"};mxEvent.addListener(X,"click",function(){if(null!=Y)ba();else try{var ia=
-new Q;ia.continuous=!0;ia.interimResults=!0;var ja=d.value;ia.onresult=function(na){for(var Aa="",ha=0;ha<na.results.length;ha++)Aa+=na.results[ha][0].transcript;d.value=ja+(""!=ja&&""!=Aa&&" "!=ja.charAt(ja.length-1)?" ":"")+Aa;p()};ia.onerror=function(na){Y==ia&&(ba(),null==na||"not-allowed"!=na.error&&"service-not-allowed"!=na.error||b.alert(mxResources.get("error")+": "+na.error))};ia.onend=function(){Y==ia&&ba()};Y=ia;X.style.backgroundColor="light-dark(#fbd2d2, #7a3a3a)";X.style.opacity="1";
-ia.start()}catch(na){ba(),b.handleError(na)}})}var W=function(ia,ja){for(var na=[],Aa=0;Aa<ia.length;Aa++)na.push(("assistant"==ia[Aa].role?"Assistant: ":"User: ")+ia[Aa].content);return 0<na.length?"Previous conversation:\n\n"+na.join("\n\n")+"\n\nRequest: "+ja:ja},ca=function(){var ia=mxUtils.trim(d.value)+(null!=V?"\n\nDiagram XML:\n"+V.data:"");return null!=E?W(E.turns,ia).length:ia.length},S=document.createElement("span");S.style.display="none";S.style.alignItems="center";S.style.justifyContent=
+function(){ua(E)});G.className="geBtn";G.setAttribute("title",mxResources.get("pasteResponse"));G.style.margin="0";G.style.fontSize="11px";G.style.minWidth="0";G.style.padding="2px 8px";U.appendChild(G);c=document.createElement("div");c.style.flexGrow="1";U.appendChild(c);var J=document.createElement("select");J.style.borderColor="transparent";J.style.background="light-dark(var(--highlight-color), var(--dark-soft-color))";J.style.textOverflow="ellipsis";J.style.fontSize="11px";J.style.opacity="0.8";
+J.style.maxWidth="60%";J.style.minWidth="0";J.style.padding="2px";for(c=0;c<D.length;c++){var L=document.createElement("option");L.setAttribute("value",D[c].id);mxUtils.write(L,D[c].label);J.appendChild(L)}J.value=D[0].id;U.appendChild(J);var P=function(){for(var ia=0;ia<D.length;ia++)if(D[ia].id==J.value)return D[ia];return D[D.length-1]};c=function(){G.style.display="clipboard"==P().kind?"":"none";ra()};mxEvent.addListener(J,"change",c);var Q=window.SpeechRecognition||window.webkitSpeechRecognition,
+ba=null;if(null!=Q){var W=document.createElement("img");W.className="geAdaptiveAsset";W.setAttribute("src",Editor.micImage);W.setAttribute("title",mxResources.get("dictate"));W.style.width="18px";W.style.cursor="pointer";W.style.opacity="0.7";W.style.flexShrink="0";W.style.borderRadius="50%";U.appendChild(W);var Y=null;ba=function(){if(null!=Y){var ia=Y;Y=null;try{ia.stop()}catch(ja){}}W.style.backgroundColor="";W.style.opacity="0.7"};mxEvent.addListener(W,"click",function(){if(null!=Y)ba();else try{var ia=
+new Q;ia.continuous=!0;ia.interimResults=!0;var ja=d.value;ia.onresult=function(na){for(var Aa="",ha=0;ha<na.results.length;ha++)Aa+=na.results[ha][0].transcript;d.value=ja+(""!=ja&&""!=Aa&&" "!=ja.charAt(ja.length-1)?" ":"")+Aa;p()};ia.onerror=function(na){Y==ia&&(ba(),null==na||"not-allowed"!=na.error&&"service-not-allowed"!=na.error||b.alert(mxResources.get("error")+": "+na.error))};ia.onend=function(){Y==ia&&ba()};Y=ia;W.style.backgroundColor="light-dark(#fbd2d2, #7a3a3a)";W.style.opacity="1";
+ia.start()}catch(na){ba(),b.handleError(na)}})}var X=function(ia,ja){for(var na=[],Aa=0;Aa<ia.length;Aa++)na.push(("assistant"==ia[Aa].role?"Assistant: ":"User: ")+ia[Aa].content);return 0<na.length?"Previous conversation:\n\n"+na.join("\n\n")+"\n\nRequest: "+ja:ja},ca=function(){var ia=mxUtils.trim(d.value)+(null!=V?"\n\nDiagram XML:\n"+V.data:"");return null!=E?X(E.turns,ia).length:ia.length},S=document.createElement("span");S.style.display="none";S.style.alignItems="center";S.style.justifyContent=
"center";S.style.flexShrink="0";S.style.cursor="pointer";S.style.padding="3px";S.style.borderRadius="50%";S.style.lineHeight="0";mxEvent.addListener(S,"mouseenter",function(){S.style.backgroundColor="light-dark(#0000000f, #ffffff24)"});mxEvent.addListener(S,"mouseleave",function(){S.style.backgroundColor=""});L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("width","13");L.setAttribute("height","13");L.setAttribute("viewBox","0 0 36 36");L.style.display="block";var Z=
document.createElementNS("http://www.w3.org/2000/svg","circle");Z.setAttribute("cx","18");Z.setAttribute("cy","18");Z.setAttribute("r","14");Z.setAttribute("fill","none");Z.setAttribute("stroke","light-dark(#d8d8d8, #555555)");Z.setAttribute("stroke-width","5");L.appendChild(Z);var da=document.createElementNS("http://www.w3.org/2000/svg","circle");da.setAttribute("cx","18");da.setAttribute("cy","18");da.setAttribute("r","14");da.setAttribute("fill","none");da.setAttribute("stroke-width","5");da.setAttribute("stroke-linecap",
"round");da.setAttribute("pathLength","100");da.setAttribute("transform","rotate(-90 18 18)");L.appendChild(da);S.appendChild(L);U.appendChild(S);var N=document.createElement("div");N.style.position="fixed";N.style.display="none";N.style.zIndex="10000";N.style.width="210px";N.style.boxSizing="border-box";N.style.padding="10px 12px";N.style.borderRadius="8px";N.style.fontSize="11px";N.style.lineHeight="1.5";N.style.background="light-dark(#ffffff, #2a2a2a)";N.style.color="light-dark(#000000, #f0f0f0)";
@@ -13442,105 +13444,113 @@ ja.toLocaleString()+" / "+ia.toLocaleString()+" ("+na+"%)");N.appendChild(ha);ia
N.style.display&&(N.style.display="none",mxEvent.removeListener(document,"mousedown",ka))};mxEvent.addListener(S,"click",function(ia){if("none"==N.style.display){ea();N.style.display="block";var ja=S.getBoundingClientRect(),na=N.getBoundingClientRect();N.style.left=Math.max(8,ja.right-na.width)+"px";N.style.top=(8>ja.top-na.height-8?ja.bottom+8:ja.top-na.height-8)+"px";mxEvent.addListener(document,"mousedown",ka)}else aa();mxEvent.consume(ia)});var ra=function(){var ia=Editor.maxPublicPromptLength;
if("public"!=P().kind||0>=ia)S.style.display="none",aa();else{var ja=ca();if(0==ja)S.style.display="none",aa();else{var na=ja/ia;da.setAttribute("stroke-dasharray",100*Math.max(0,Math.min(1,na))+" 100");da.setAttribute("stroke",1<na?"#e53935":.8<=na?"#f9a825":"#4d90fe");S.setAttribute("title",mxResources.get("charactersRemaining",[(ia-ja).toLocaleString()])+" — "+ja.toLocaleString()+"/"+ia.toLocaleString()+" ("+Math.round(100*na)+"%)");S.style.display="flex";"none"!=N.style.display&&ea()}}};L=document.createElement("img");
L.setAttribute("src",Editor.sendImage);L.setAttribute("title",mxResources.get("sendMessage"));L.className="geAdaptiveAsset";L.style.cursor="pointer";L.style.opacity="0.6";L.style.height="19px";L.style.flexShrink="0";U.appendChild(L);f.appendChild(r);c();var sa=function(ia){var ja=new mxCodec(mxUtils.createXmlDocument());ja.isObjectIgnored=function(na){return na.constructor==mxCell&&!H.model.isRoot(na)&&!H.model.isLayer(na)&&!(null!=na.id&&ia[na.id])};ja=ja.encode(H.getModel());ja.ownerDocument.appendChild(ja);
-return ja},ma=function(ia,ja,na){var Aa=null;if(null!=ja&&1<ja.length&&0<ja[1].length)try{if(Aa=b.stringToCells(ja[1]),0==Aa.length){var ha=Editor.extractGraphModelFromText(ja[1]);null!=ha&&0<ha[1].length&&ha[1]!=ja[1]&&(Aa=b.stringToCells(ha[1]))}}catch(Fa){throw Error(Fa.toString()+"\n\n"+ja[1]);}ia.innerHTML="";if(null!=Aa&&0<Aa.length){var la=H.getBoundingBoxFromGeometry(Aa);b.sidebar.graph.moveCells(Aa,-la.x,-la.y);var xa=null,Ca=function(){var Fa=H.getFreeInsertPoint();Fa=H.importCells(Aa,Fa.x,
-Fa.y);H.setSelectionCells(Fa);return Fa};ha=function(Fa){null!=b.sidebar&&b.sidebar.hideTooltip();var Ia=null;H.model.beginUpdate();try{Ia=Ca()}finally{H.model.endUpdate()}if(null!=na.onInsert)na.onInsert(Ia);null!=H.getSelectionCell()&&H.scrollCellToVisible(H.getSelectionCell());null!=Fa&&mxEvent.consume(Fa)};var pa=null==na.applyCtx?null:function(Fa){null!=b.sidebar&&b.sidebar.hideTooltip();try{var Ia=na.applyCtx.page,Ha=null;if(na.applyCtx.fresh){var Ma=(new mxCodec(mxUtils.createXmlDocument())).encode(H.getModel());
-Ma.ownerDocument.appendChild(Ma);var bb=new mxCodec(Ma.ownerDocument);Ha=new mxGraphModel;bb.decode(Ma,Ha);Ia=b.currentPage}else{if(null==xa){var ab=new mxCodec(na.applyCtx.xmlNode.ownerDocument);xa=new mxGraphModel;ab.decode(na.applyCtx.xmlNode,xa)}Ha=xa}Ma=null;H.model.beginUpdate();try{if(null!=Ha&&null!=Ia&&null!=b.getPageIndex(Ia)){b.selectPage(Ia);var tb=mxUtils.parseXml(ja[1]),yb=new mxCodec(tb),jb=new mxGraphModel;yb.decode(tb.documentElement,jb);var hb=b.diffCells(Ha.root,jb.root);b.patchPage(Ia,
-hb,null,!0);EditorUi.debug("EditorUi.ChatWindow.apply","base",Ha,"receivedModel",jb,"patch",hb);if(null!=na.onApplied)na.onApplied(tb.documentElement,Ia)}else Ma=Ca()}finally{H.model.endUpdate()}if(null!=Ma&&null!=na.onInsert)na.onInsert(Ma);null!=H.getSelectionCell()&&H.scrollCellToVisible(H.getSelectionCell())}catch(rb){b.handleError(rb)}null!=Fa&&mxEvent.consume(Fa)};0<ja[0].length&&ia.appendChild(z(ja[0]));var oa=b.getSvgForXml(ja[1]);oa.style.overflow="visible";oa.style.padding="1px";oa.style.cursor=
-"move";oa.style.width="160px";oa.style.height="auto";oa.style.maxHeight="460px";var Da=document.createElement("a");Da.className="geItem";Da.style.padding="4px";Da.style.borderRadius="10px";Da.appendChild(oa);ia.appendChild(Da);b.sidebar.createItem(Aa,na.prompt,!0,!0,la.width,la.height,!0,!0,null!=pa?pa:ha,null,null,null,null,null,Da);null!=na.infoLabel&&Da.setAttribute("title",na.infoLabel);na.partial&&(la=document.createElement("div"),la.style.opacity="0.7",la.style.fontSize="11px",mxUtils.write(la,
-mxResources.get("partialResponse")),ia.appendChild(la));la=document.createElement("div");la.style.display="flex";oa=document.createElement("img");oa.className="geAdaptiveAsset geLibraryButton";oa.setAttribute("src",Editor.copyImage);oa.setAttribute("title",mxResources.get("copy"));la.appendChild(oa);mxEvent.addListener(oa,"click",function(){b.writeTextToClipboard(ja[1],function(Fa){b.handleError(Fa)})});"draw.io"==b.getServiceName()&&(oa=oa.cloneNode(),oa.setAttribute("src",Editor.shareImage),oa.setAttribute("title",
-mxResources.get(b.isStandaloneApp()?"export":"openInNewWindow")),la.appendChild(oa),mxEvent.addListener(oa,"click",function(Fa){b.isStandaloneApp()?b.saveData("export.xml","xml",ja[1],"text/xml"):b.editor.editAsNew(mxUtils.getXml(H.encodeCells(Aa)))}));oa=oa.cloneNode();oa.setAttribute("src",Editor.magnifyImage);oa.setAttribute("title",mxResources.get("preview"));la.appendChild(oa);mxEvent.addListener(oa,"click",function(Fa){b.sidebar.createTooltip(ia,Aa,Math.min((window.innerWidth||document.documentElement.clientWidth||
-document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,1200),na.prompt,!0,new mxPoint(mxEvent.getClientX(Fa),mxEvent.getClientY(Fa)),!0,null,!0,!1)});oa=oa.cloneNode();oa.setAttribute("src",Editor.plusImage);oa.setAttribute("title",mxResources.get("insert"));la.appendChild(oa);mxEvent.addListener(oa,"click",ha);null!=pa&&(oa=oa.cloneNode(),oa.setAttribute("src",Editor.checkImage),oa.setAttribute("title",mxResources.get("apply")),
+return ja},ma=function(ia,ja,na){var Aa=null;if(null!=ja&&1<ja.length&&0<ja[1].length)try{if(Aa=b.stringToCells(ja[1]),0==Aa.length){var ha=Editor.extractGraphModelFromText(ja[1]);null!=ha&&0<ha[1].length&&ha[1]!=ja[1]&&(Aa=b.stringToCells(ha[1]))}}catch(Ga){throw Error(Ga.toString()+"\n\n"+ja[1]);}ia.innerHTML="";if(null!=Aa&&0<Aa.length){var la=H.getBoundingBoxFromGeometry(Aa);b.sidebar.graph.moveCells(Aa,-la.x,-la.y);var ya=null,Ca=function(){var Ga=H.getFreeInsertPoint();Ga=H.importCells(Aa,Ga.x,
+Ga.y);H.setSelectionCells(Ga);return Ga};ha=function(Ga){null!=b.sidebar&&b.sidebar.hideTooltip();var Ja=null;H.model.beginUpdate();try{Ja=Ca()}finally{H.model.endUpdate()}if(null!=na.onInsert)na.onInsert(Ja);null!=H.getSelectionCell()&&H.scrollCellToVisible(H.getSelectionCell());null!=Ga&&mxEvent.consume(Ga)};var pa=null==na.applyCtx?null:function(Ga){null!=b.sidebar&&b.sidebar.hideTooltip();try{var Ja=na.applyCtx.page,Ha=null;if(na.applyCtx.fresh){var Ma=(new mxCodec(mxUtils.createXmlDocument())).encode(H.getModel());
+Ma.ownerDocument.appendChild(Ma);var eb=new mxCodec(Ma.ownerDocument);Ha=new mxGraphModel;eb.decode(Ma,Ha);Ja=b.currentPage}else{if(null==ya){var bb=new mxCodec(na.applyCtx.xmlNode.ownerDocument);ya=new mxGraphModel;bb.decode(na.applyCtx.xmlNode,ya)}Ha=ya}Ma=null;H.model.beginUpdate();try{if(null!=Ha&&null!=Ja&&null!=b.getPageIndex(Ja)){b.selectPage(Ja);var tb=mxUtils.parseXml(ja[1]),Db=new mxCodec(tb),cb=new mxGraphModel;Db.decode(tb.documentElement,cb);var gb=b.diffCells(Ha.root,cb.root);b.patchPage(Ja,
+gb,null,!0);EditorUi.debug("EditorUi.ChatWindow.apply","base",Ha,"receivedModel",cb,"patch",gb);if(null!=na.onApplied)na.onApplied(tb.documentElement,Ja)}else Ma=Ca()}finally{H.model.endUpdate()}if(null!=Ma&&null!=na.onInsert)na.onInsert(Ma);null!=H.getSelectionCell()&&H.scrollCellToVisible(H.getSelectionCell())}catch(wb){b.handleError(wb)}null!=Ga&&mxEvent.consume(Ga)};0<ja[0].length&&ia.appendChild(z(ja[0]));var oa=b.getSvgForXml(ja[1]);oa.style.overflow="visible";oa.style.padding="1px";oa.style.cursor=
+"move";oa.style.width="160px";oa.style.height="auto";oa.style.maxHeight="460px";var Ea=document.createElement("a");Ea.className="geItem";Ea.style.padding="4px";Ea.style.borderRadius="10px";Ea.appendChild(oa);ia.appendChild(Ea);b.sidebar.createItem(Aa,na.prompt,!0,!0,la.width,la.height,!0,!0,null!=pa?pa:ha,null,null,null,null,null,Ea);null!=na.infoLabel&&Ea.setAttribute("title",na.infoLabel);na.partial&&(la=document.createElement("div"),la.style.opacity="0.7",la.style.fontSize="11px",mxUtils.write(la,
+mxResources.get("partialResponse")),ia.appendChild(la));la=document.createElement("div");la.style.display="flex";oa=document.createElement("img");oa.className="geAdaptiveAsset geLibraryButton";oa.setAttribute("src",Editor.copyImage);oa.setAttribute("title",mxResources.get("copy"));la.appendChild(oa);mxEvent.addListener(oa,"click",function(){b.writeTextToClipboard(ja[1],function(Ga){b.handleError(Ga)})});"draw.io"==b.getServiceName()&&(oa=oa.cloneNode(),oa.setAttribute("src",Editor.shareImage),oa.setAttribute("title",
+mxResources.get(b.isStandaloneApp()?"export":"openInNewWindow")),la.appendChild(oa),mxEvent.addListener(oa,"click",function(Ga){b.isStandaloneApp()?b.saveData("export.xml","xml",ja[1],"text/xml"):b.editor.editAsNew(mxUtils.getXml(H.encodeCells(Aa)))}));oa=oa.cloneNode();oa.setAttribute("src",Editor.magnifyImage);oa.setAttribute("title",mxResources.get("preview"));la.appendChild(oa);mxEvent.addListener(oa,"click",function(Ga){b.sidebar.createTooltip(ia,Aa,Math.min((window.innerWidth||document.documentElement.clientWidth||
+document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,1200),na.prompt,!0,new mxPoint(mxEvent.getClientX(Ga),mxEvent.getClientY(Ga)),!0,null,!0,!1)});oa=oa.cloneNode();oa.setAttribute("src",Editor.plusImage);oa.setAttribute("title",mxResources.get("insert"));la.appendChild(oa);mxEvent.addListener(oa,"click",ha);null!=pa&&(oa=oa.cloneNode(),oa.setAttribute("src",Editor.checkImage),oa.setAttribute("title",mxResources.get("apply")),
la.appendChild(oa),mxEvent.addListener(oa,"click",pa));ia.appendChild(la);0<ja[2].length&&ia.appendChild(z(ja[2]))}else null==ja||null!=ja[1]&&0<ja[1].length?(null!=ja&&null!=ja[0]&&0<ja[0].length&&ia.appendChild(z(ja[0])),ia.appendChild(F({message:mxResources.get("errShowingDiag")},na.retryFn))):(ia.style.whiteSpace="pre-wrap",ia.appendChild(z(ja[0])),null!=ja[2]&&0<ja[2].length&&ia.appendChild(z(ja[2])));ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},wa=function(ia,ja,na,Aa){var ha=
-b.extractMermaidDeclaration(ja);if(null==ha){var la=Editor.extractGraphModelFromText(ja);if(""==la[1]&&0<=ja.indexOf("<mxGraphModel")){var xa=Editor.repairTruncatedXml(ja);null!=xa&&(xa=Editor.extractGraphModelFromText(xa),""!=xa[1]&&(na.partial=!0,la=xa))}ma(ia,la,na);null!=na.recordTurn&&na.recordTurn(ja)}else b.parseMermaidDiagram(ha,null,function(Ca){try{ma(ia,["",mxMermaidToDrawio.wrapGroup(Ca,ha,EditorUi.getInsertMermaidConfig()),""],na),null!=na.recordTurn&&na.recordTurn("```mermaid\n"+ha+
+b.extractMermaidDeclaration(ja);if(null==ha){var la=Editor.extractGraphModelFromText(ja);if(""==la[1]&&0<=ja.indexOf("<mxGraphModel")){var ya=Editor.repairTruncatedXml(ja);null!=ya&&(ya=Editor.extractGraphModelFromText(ya),""!=ya[1]&&(na.partial=!0,la=ya))}ma(ia,la,na);null!=na.recordTurn&&na.recordTurn(ja)}else b.parseMermaidDiagram(ha,null,function(Ca){try{ma(ia,["",mxMermaidToDrawio.wrapGroup(Ca,ha,EditorUi.getInsertMermaidConfig()),""],na),null!=na.recordTurn&&na.recordTurn("```mermaid\n"+ha+
"\n```\n\nThe same diagram as draw.io XML, use this as the basis for changes:\n\n```xml\n"+Ca+"\n```")}catch(pa){Aa(pa)}},Aa)},va=function(ia,ja,na){var Aa=null,ha=null;return{record:function(la){null!=ja.parentNode&&(null==ha?(Aa={role:"user",content:na},ha={role:"assistant",content:la},ia.turns.push(Aa,ha)):ha.content=la,ra())},amend:function(la){null!=ha&&(ha.content=la,ra())}}},za=function(ia,ja){var na=new ia.constructor,Aa;for(Aa in ia){var ha=ia[Aa];na[Aa]="object"===typeof ha?za(ha,ja):"string"===
typeof ha?Editor.replacePlaceholders(ha,ja):ha}return na},Ba=function(ia,ja){if(null!=ia&&null!=ja&&0<ja.length)if(Array.isArray(ia.messages)&&0<ia.messages.length){for(var na=ia.messages[ia.messages.length-1],Aa=ia.messages.slice(0,ia.messages.length-1),ha=[],la=0;la<ja.length;la++)ha.push({role:ja[la].role,content:ja[la].content});ia.messages=Aa.concat(ha,[na])}else if(Array.isArray(ia.contents)&&0<ia.contents.length){na=ia.contents[ia.contents.length-1];na.role="user";Aa=ia.contents.slice(0,ia.contents.length-
1);ha=[];for(la=0;la<ja.length;la++)ha.push({role:"assistant"==ja[la].role?"model":"user",parts:[{text:ja[la].content}]});ia.contents=Aa.concat(ha,[na])}},ua=function(ia){var ja=x();ja.className="geSidebar";ia.el.appendChild(ja);K();var na=function(Aa){ja.innerHTML="";ja.appendChild(F(Aa,null));ja.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};try{navigator.clipboard.readText().then(function(Aa){try{wa(ja,mxUtils.trim(Aa),{prompt:mxResources.get("paste"),applyCtx:{fresh:!0}},na)}catch(ha){na(ha)}})["catch"](na)}catch(Aa){na(Aa)}},
qa=function(ia,ja,na,Aa){var ha=x();ha.style.whiteSpace="pre-wrap";ha.style.marginBottom="2px";ha.style.marginLeft="40%";ha.style.borderRadius="10px";ha.style.backgroundColor="light-dark(var(--highlight-color), var(--dark-soft-color))";mxUtils.write(ha,""!=ja?ja:na.label);ia.el.appendChild(ha);K();if(null!=na&&""!=ja){var la=document.createElement("div");la.style.fontSize="10px";la.style.opacity="0.7";la.style.marginTop="4px";mxUtils.write(la,"+ "+na.label);ha.appendChild(la)}""!=ja&&(ha=document.createElement("div"),
ha.className="geInlineButtons",ha.style.display="flex",ha.style.justifyContent="end",ia.el.appendChild(ha),la=document.createElement("img"),la.className="geAdaptiveAsset geLibraryButton",la.setAttribute("src",Editor.copyImage),la.setAttribute("title",mxResources.get("copy")),ha.appendChild(la),mxEvent.addListener(la,"click",function(){b.writeTextToClipboard(ja,function(Sa){b.handleError(Sa)},function(){b.alert(mxResources.get("copiedToClipboard"))})}),la=la.cloneNode(),la.setAttribute("src",Editor.editImage),
-la.setAttribute("title",mxResources.get("edit")),ha.appendChild(la),mxEvent.addListener(la,"click",function(){d.value=ja;p();d.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?d.select():document.execCommand("selectAll",!1,null)}));var xa=x();xa.className="geSidebar";xa.style.marginTop="2px";ia.el.appendChild(xa);var Ca=va(ia,xa,null==na?ja:(""!=ja?ja+"\n\n":"")+"Diagram XML:\n```xml\n"+na.data+"\n```"),pa=null;null!=na?"file"==na.kind?ia.lastContext=null:(pa={xmlNode:na.xmlNode,page:na.page},
-ia.lastContext=pa):pa=ia.lastContext;var oa=function(Sa){try{if(null!=Sa&&0!=Sa.length){for(var Ua={},vb=function(lb){null!=lb.id&&(Ua[lb.id]=!0);for(var Za=0;Za<H.model.getChildCount(lb);Za++)vb(H.model.getChildAt(lb,Za))},kb=0;kb<Sa.length;kb++)vb(Sa[kb]);var qb=sa(Ua);ia.lastContext={xmlNode:qb,page:b.currentPage};Ca.amend("The current diagram as draw.io XML (keep these cell ids when modifying it):\n```xml\n"+mxUtils.getXml(qb)+"\n```")}}catch(lb){EditorUi.debug("EditorUi.ChatWindow.onInsert",
-"error",lb)}},Da=function(Sa,Ua){ia.lastContext={xmlNode:Sa,page:Ua}};ha=ia.turns.slice();var Fa=Date.now(),Ia=null,Ha=function(Sa){xa.innerHTML="";xa.appendChild(F(Sa,Ia));xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",Sa);null!=window.console&&console.error(Sa)},Ma=function(){xa.innerHTML="";var Sa=document.createElement("div");Sa.style.display="flex";Sa.style.alignItems="center";mxUtils.write(Sa,mxResources.get("loading")+
-"...");var Ua=document.createElement("img");Ua.className="geAdaptiveAsset";Ua.setAttribute("src",Editor.svgSpinImage);Ua.style.width="16px";Ua.style.height="16px";Ua.style.marginLeft="6px";Sa.appendChild(Ua);xa.appendChild(Sa);xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};if("model"==Aa.kind){var bb=Aa.model,ab=Editor.aiConfigs[bb.config],tb=function(Sa){var Ua=null;"prompt"==Sa?Ua=ja:"data"==Sa&&null!=na?Ua=na.data:"model"==Sa?Ua=bb.model:"apiKey"==Sa?Sa=ab.apiKey:"action"==
-Sa&&(Sa=null!=na?"update":"create");null==Ua&&(Ua=Editor.replacePlaceholders(Editor.aiGlobals[Sa],tb));return Ua},yb=za(ab.request,tb);Ba(yb,ha);Ia=function(){Ma();b.createTimeout(b.editor.generateTimeout,function(Sa){var Ua=function(qb){Sa.clear();Ha(qb)},vb=Editor.replacePlaceholders(ab.endpoint,tb),kb=new mxXmlRequest(vb,JSON.stringify(yb),"POST");kb.setRequestHeaders=function(qb,lb){qb.setRequestHeader("Content-Type","application/json");for(var Za in ab.requestHeaders)qb.setRequestHeader(Za,Editor.replacePlaceholders(ab.requestHeaders[Za],
-tb))};EditorUi.debug("EditorUi.ChatWindow.send","url",vb,"params",yb,"aiModel",bb,"config",ab);kb.send(function(qb){if(Sa.clear())try{if(200<=qb.getStatus()&&299>=qb.getStatus()){var lb=JSON.parse(qb.getText()),Za=Editor.executeSimpleJsonPath(lb,ab.responsePath),Hb=mxUtils.trim(0<Za.length?Za[0]:qb.getText()),Db=Date.now()-Fa;EditorUi.debug("EditorUi.ChatWindow.response","params",yb,"response",lb,"text",[Hb],"time",Db);wa(xa,Hb,{prompt:ja,applyCtx:pa,retryFn:Ia,recordTurn:Ca.record,onInsert:oa,onApplied:Da,
-infoLabel:1==urlParams.test?Aa.label+" ("+Db+" ms)":null},Ua)}else{Za="Error: "+qb.getStatus();try{var Cb=JSON.parse(qb.getText());null!=Cb&&null!=Cb.error&&null!=Cb.error.message&&(Za=Cb.error.message)}catch(fb){}Ha({message:Za})}}catch(fb){Ua(fb)}},Ua)},Ha)};Ia()}else if("public"==Aa.kind){var jb=W(ha,ja+(null!=na?"\n\nDiagram XML:\n"+na.data:""));Ia=function(){var Sa=Editor.maxPublicPromptLength;0<Sa&&jb.length>Sa?(xa.innerHTML="",xa.appendChild(F({message:mxResources.get("promptTooLarge",[Sa])},
-null)),xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):(Ma(),b.generateOpenAiMermaidDiagram(jb,function(Ua,vb){try{var kb=Date.now()-Fa;ma(xa,["",Ua,""],{prompt:ja,applyCtx:pa,retryFn:Ia,partial:vb,onInsert:oa,onApplied:Da,infoLabel:1==urlParams.test?Aa.label+" ("+kb+" ms)":null});Ca.record(Ua)}catch(qb){Ha(qb)}},Ha))};Ia()}else{ha=null;ha=""==ja&&null!=na?na.data:Editor.replacePlaceholders(Editor.aiGlobals[null!=na?"update":"create"],function(Sa){return"data"==Sa&&null!=na?na.data:
-null})+"\n\n"+ja;var hb=null,rb=function(){var Sa=mxUtils.button(mxResources.get("pasteResponse"),function(){try{navigator.clipboard.readText().then(function(Ua){try{xa.innerHTML="",wa(xa,mxUtils.trim(Ua),{prompt:""!=ja?ja:na.label,applyCtx:pa,recordTurn:Ca.record,onInsert:oa,onApplied:Da},hb)}catch(vb){hb(vb)}})["catch"](hb)}catch(Ua){hb(Ua)}});Sa.className="geBtn";Sa.style.margin="6px 0 0 0";xa.appendChild(Sa)};hb=function(Sa){xa.innerHTML="";xa.appendChild(F(Sa,null));rb();xa.scrollIntoView({behavior:"smooth",
-block:"end",inline:"nearest"})};b.writeTextToClipboard(ha,function(Sa){Ha(Sa)},function(){xa.innerHTML="";var Sa=document.createElement("div");mxUtils.write(Sa,mxResources.get("copiedToClipboard"));xa.appendChild(Sa);rb();xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})}};mxEvent.addListener(L,"click",J);mxEvent.addListener(d,"keydown",function(ia){13!=ia.keyCode||mxEvent.isShiftDown(ia)||(J(),mxEvent.consume(ia))});this.generate=mxUtils.bind(this,function(ia){null!=E&&null==
-E.el.firstChild||C(u());d.value=ia;p();J()});C(u());this.window=new mxWindow(mxResources.get("generate"),l,k,m,g,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,280,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);b.isOffline()||(k=b.createHelpIcon("https://www.drawio.com/doc/faq/configure-ai-options"),k.style.cursor="help",k.style.opacity="0.5",this.window.buttons.insertBefore(k,this.window.buttons.firstChild));this.window.addListener("show",
+la.setAttribute("title",mxResources.get("edit")),ha.appendChild(la),mxEvent.addListener(la,"click",function(){d.value=ja;p();d.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?d.select():document.execCommand("selectAll",!1,null)}));var ya=x();ya.className="geSidebar";ya.style.marginTop="2px";ia.el.appendChild(ya);var Ca=va(ia,ya,null==na?ja:(""!=ja?ja+"\n\n":"")+"Diagram XML:\n```xml\n"+na.data+"\n```"),pa=null;null!=na?"file"==na.kind?ia.lastContext=null:(pa={xmlNode:na.xmlNode,page:na.page},
+ia.lastContext=pa):pa=ia.lastContext;var oa=function(Sa){try{if(null!=Sa&&0!=Sa.length){for(var Xa={},vb=function(qb){null!=qb.id&&(Xa[qb.id]=!0);for(var Za=0;Za<H.model.getChildCount(qb);Za++)vb(H.model.getChildAt(qb,Za))},pb=0;pb<Sa.length;pb++)vb(Sa[pb]);var jb=sa(Xa);ia.lastContext={xmlNode:jb,page:b.currentPage};Ca.amend("The current diagram as draw.io XML (keep these cell ids when modifying it):\n```xml\n"+mxUtils.getXml(jb)+"\n```")}}catch(qb){EditorUi.debug("EditorUi.ChatWindow.onInsert",
+"error",qb)}},Ea=function(Sa,Xa){ia.lastContext={xmlNode:Sa,page:Xa}};ha=ia.turns.slice();var Ga=Date.now(),Ja=null,Ha=function(Sa){ya.innerHTML="";ya.appendChild(F(Sa,Ja));ya.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",Sa);null!=window.console&&console.error(Sa)},Ma=function(){ya.innerHTML="";var Sa=document.createElement("div");Sa.style.display="flex";Sa.style.alignItems="center";mxUtils.write(Sa,mxResources.get("loading")+
+"...");var Xa=document.createElement("img");Xa.className="geAdaptiveAsset";Xa.setAttribute("src",Editor.svgSpinImage);Xa.style.width="16px";Xa.style.height="16px";Xa.style.marginLeft="6px";Sa.appendChild(Xa);ya.appendChild(Sa);ya.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};if("model"==Aa.kind){var eb=Aa.model,bb=Editor.aiConfigs[eb.config],tb=function(Sa){var Xa=null;"prompt"==Sa?Xa=ja:"data"==Sa&&null!=na?Xa=na.data:"model"==Sa?Xa=eb.model:"apiKey"==Sa?Sa=bb.apiKey:"action"==
+Sa&&(Sa=null!=na?"update":"create");null==Xa&&(Xa=Editor.replacePlaceholders(Editor.aiGlobals[Sa],tb));return Xa},Db=za(bb.request,tb);Ba(Db,ha);Ja=function(){Ma();b.createTimeout(b.editor.generateTimeout,function(Sa){var Xa=function(jb){Sa.clear();Ha(jb)},vb=Editor.replacePlaceholders(bb.endpoint,tb),pb=new mxXmlRequest(vb,JSON.stringify(Db),"POST");pb.setRequestHeaders=function(jb,qb){jb.setRequestHeader("Content-Type","application/json");for(var Za in bb.requestHeaders)jb.setRequestHeader(Za,Editor.replacePlaceholders(bb.requestHeaders[Za],
+tb))};EditorUi.debug("EditorUi.ChatWindow.send","url",vb,"params",Db,"aiModel",eb,"config",bb);pb.send(function(jb){if(Sa.clear())try{if(200<=jb.getStatus()&&299>=jb.getStatus()){var qb=JSON.parse(jb.getText()),Za=Editor.executeSimpleJsonPath(qb,bb.responsePath),Jb=mxUtils.trim(0<Za.length?Za[0]:jb.getText()),Ab=Date.now()-Ga;EditorUi.debug("EditorUi.ChatWindow.response","params",Db,"response",qb,"text",[Jb],"time",Ab);wa(ya,Jb,{prompt:ja,applyCtx:pa,retryFn:Ja,recordTurn:Ca.record,onInsert:oa,onApplied:Ea,
+infoLabel:1==urlParams.test?Aa.label+" ("+Ab+" ms)":null},Xa)}else{Za="Error: "+jb.getStatus();try{var yb=JSON.parse(jb.getText());null!=yb&&null!=yb.error&&null!=yb.error.message&&(Za=yb.error.message)}catch(fb){}Ha({message:Za})}}catch(fb){Xa(fb)}},Xa)},Ha)};Ja()}else if("public"==Aa.kind){var cb=X(ha,ja+(null!=na?"\n\nDiagram XML:\n"+na.data:""));Ja=function(){var Sa=Editor.maxPublicPromptLength;0<Sa&&cb.length>Sa?(ya.innerHTML="",ya.appendChild(F({message:mxResources.get("promptTooLarge",[Sa])},
+null)),ya.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):(Ma(),b.generateOpenAiMermaidDiagram(cb,function(Xa,vb){try{var pb=Date.now()-Ga;ma(ya,["",Xa,""],{prompt:ja,applyCtx:pa,retryFn:Ja,partial:vb,onInsert:oa,onApplied:Ea,infoLabel:1==urlParams.test?Aa.label+" ("+pb+" ms)":null});Ca.record(Xa)}catch(jb){Ha(jb)}},Ha))};Ja()}else{ha=null;ha=""==ja&&null!=na?na.data:Editor.replacePlaceholders(Editor.aiGlobals[null!=na?"update":"create"],function(Sa){return"data"==Sa&&null!=na?na.data:
+null})+"\n\n"+ja;var gb=null,wb=function(){var Sa=mxUtils.button(mxResources.get("pasteResponse"),function(){try{navigator.clipboard.readText().then(function(Xa){try{ya.innerHTML="",wa(ya,mxUtils.trim(Xa),{prompt:""!=ja?ja:na.label,applyCtx:pa,recordTurn:Ca.record,onInsert:oa,onApplied:Ea},gb)}catch(vb){gb(vb)}})["catch"](gb)}catch(Xa){gb(Xa)}});Sa.className="geBtn";Sa.style.margin="6px 0 0 0";ya.appendChild(Sa)};gb=function(Sa){ya.innerHTML="";ya.appendChild(F(Sa,null));wb();ya.scrollIntoView({behavior:"smooth",
+block:"end",inline:"nearest"})};b.writeTextToClipboard(ha,function(Sa){Ha(Sa)},function(){ya.innerHTML="";var Sa=document.createElement("div");mxUtils.write(Sa,mxResources.get("copiedToClipboard"));ya.appendChild(Sa);wb();ya.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})}};mxEvent.addListener(L,"click",I);mxEvent.addListener(d,"keydown",function(ia){13!=ia.keyCode||mxEvent.isShiftDown(ia)||(I(),mxEvent.consume(ia))});this.generate=mxUtils.bind(this,function(ia){null!=E&&null==
+E.el.firstChild||C(u());d.value=ia;p();I()});C(u());this.window=new mxWindow(mxResources.get("generate"),l,k,m,g,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,280,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);b.isOffline()||(k=b.createHelpIcon("https://www.drawio.com/doc/faq/configure-ai-options"),k.style.cursor="help",k.style.opacity="0.5",this.window.buttons.insertBefore(k,this.window.buttons.firstChild));this.window.addListener("show",
mxUtils.bind(this,function(){this.window.fit();d.focus()}));this.window.addListener("hide",function(){aa()});this.window.addListener(mxEvent.DESTROY,function(){aa();b.removeListener(n);null!=N.parentNode&&N.parentNode.removeChild(N)});b.installResizeHandler(this,!0)},TagsWindow=function(b,k,m,g,q){var u=b.editor.graph,x=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)x=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var z=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),
-null,function(F,J){if(u.isEnabled()){var H=new FilenameDialog(b,"",mxResources.get("add"),function(D){b.hideDialog();if(null!=D&&0<D.length){D=D.split(" ");for(var c=[],f=[],l=0;l<D.length;l++){var n=mxUtils.trim(D[l]);""!=n&&(f.push(n),0>mxUtils.indexOf(F,n)&&c.push(n))}u.isSelectionEmpty()?J(F.concat(c)):u.addTagsForCells(u.getSelectionCells(),f)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(H.container,320,80,!0,!0);H.init()}},x);x=z.div;this.window=
-new mxWindow(mxResources.get("tags"),x,k,m,g,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){z.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AnimationDialog=function(b,k,m,g,q,u){u=u||{};var x=u.kind||"page",z=b.editor.graph,F=SelectorChips.create(z,b),J=new Set,H=[],D=function(){return u.windowTitleKey?
+null,function(F,I){if(u.isEnabled()){var H=new FilenameDialog(b,"",mxResources.get("add"),function(D){b.hideDialog();if(null!=D&&0<D.length){D=D.split(" ");for(var c=[],f=[],l=0;l<D.length;l++){var n=mxUtils.trim(D[l]);""!=n&&(f.push(n),0>mxUtils.indexOf(F,n)&&c.push(n))}u.isSelectionEmpty()?I(F.concat(c)):u.addTagsForCells(u.getSelectionCells(),f)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(H.container,320,80,!0,!0);H.init()}},x);x=z.div;this.window=
+new mxWindow(mxResources.get("tags"),x,k,m,g,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){z.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AnimationDialog=function(b,k,m,g,q,u){u=u||{};var x=u.kind||"page",z=b.editor.graph,F=SelectorChips.create(z,b),I=new Set,H=[],D=function(){return u.windowTitleKey?
mxResources.get(u.windowTitleKey,null,u.windowTitleFallback||"Animation"):mxResources.get("animation")},c=document.createElement("div");c.style.cssText="padding:18px;box-sizing:border-box;height:100%;display:flex;flex-direction:column;font-size:13px;overflow:hidden;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";var f=null,l=null;if(u.showTitle){var n=document.createElement("div");n.style.cssText="display:flex;align-items:center;gap:8px;margin-bottom:8px;flex:0 0 auto";
l=document.createElement("span");l.style.cssText="font-weight:600;flex:0 0 auto";var r=function(){l.textContent="";mxUtils.write(l,mxResources.get("title")+":")};r();H.push(r);n.appendChild(l);f=document.createElement("input");f.type="text";f.style.cssText="flex:1;padding:4px 6px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:4px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";
var t=function(){f.placeholder=mxResources.get("optional");f.title=mxResources.get("title")};t();H.push(t);n.appendChild(f);c.appendChild(n)}var v=document.createElement("div");v.style.cssText="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;flex:0 0 auto";var B=null,E=null;if("page"==x){var K=document.createElement("label");K.className="geDialogHint";K.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";B=document.createElement("input");B.type="checkbox";
B.style.margin="0";K.appendChild(B);var C=document.createElement("span"),R=function(){C.textContent="";mxUtils.write(C,mxResources.get("loop"))};R();H.push(R);K.appendChild(C);v.appendChild(K);var M=document.createElement("span");M.style.cssText="flex:1;display:flex;justify-content:center";var O=document.createElement("label");O.className="geDialogHint";O.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";E=document.createElement("input");E.type="checkbox";E.style.margin="0";O.appendChild(E);
var U=document.createElement("span"),T=function(){U.textContent="";mxUtils.write(U,mxResources.get("disabled",null,"Disabled"))};T();H.push(T);O.appendChild(U);M.appendChild(O);v.appendChild(M)}else{var V=document.createElement("span");v.appendChild(V)}var fa=document.createElement("label");fa.className="geDialogHint";fa.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";var y=document.createElement("input");y.type="checkbox";y.style.margin="0";fa.appendChild(y);var d=document.createElement("span"),
p=function(){d.textContent="";mxUtils.write(d,mxResources.get("editText",null,"Edit Text"))};p();H.push(p);fa.appendChild(d);v.appendChild(fa);c.appendChild(v);var A=document.createElement("div");A.style.cssText="flex:1 1 0;min-height:0;overflow:auto;padding:4px;box-sizing:border-box;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:6px;background:light-dark(var(--field-color), var(--dark-field-color))";containDragEvents(A);c.appendChild(A);var G=
-document.createElement("textarea");G.spellcheck=!1;G.style.cssText="display:none;width:100%;flex:1 1 0;min-height:0;resize:none;font-family:monospace;font-size:12px;padding:8px;box-sizing:border-box;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:6px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";c.appendChild(G);var I=document.createElement("div");I.style.cssText=
-"display:none;flex:0 0 auto;margin-top:6px;padding:6px 8px;border-radius:6px;font-size:12px;background:light-dark(#fde7e9,#3a1d1f);color:light-dark(#b3261e,#ffb4ab);border:1px solid light-dark(#f1aeb5,#7a2e2e);white-space:pre-wrap;word-break:break-word";c.appendChild(I);var L=!0,P=function(ta){L=null==ta;I.style.display=null==ta?"none":"block";null!=ta&&(I.textContent=ta)},Q=function(ta,ya){ya=null!=ya&&null!=ya.message?ya.message:String(ya);if(!/line \d+/i.test(ya)){var Ea=ya.match(/at position (\d+)/i);
-null!=Ea&&(Ea=Math.min(parseInt(Ea[1],10),ta.length),ta=ta.substring(0,Ea).split("\n"),ya+=" (line "+ta.length+" column "+(ta[ta.length-1].length+1)+")")}return mxResources.get("error")+": "+ya},ba=function(){try{Editor.parseAnimationData(G.value),P(null)}catch(ta){P(Q(G.value,ta))}},X={steps:[]},Y=z.getModel().getRoot(),W=function(){if("page"==x){var ta=z.getAttributeForCell(Y,"animation");try{X=Editor.parseAnimationData(ta)}catch(ya){X=Editor.parseAnimationData(null)}}else ta=u.initial,X=Array.isArray(ta)?
-{steps:JSON.parse(JSON.stringify(ta))}:null!=ta&&"object"==typeof ta?JSON.parse(JSON.stringify(ta)):{steps:[]};null==X.steps&&(X.steps=[]);"page"!=x&&(null!=X.loop&&delete X.loop,null!=X.enabled&&delete X.enabled);G.value=JSON.stringify(X,null,2);null!=f&&(f.value=X.title||"");null!=B&&(B.checked=null==X.loop?!0:!!X.loop);null!=E&&(E.checked=null==X.enabled?!1:!X.enabled)};W();var ca=!1,S=null,Z=null,da=function(ta){ca=ta;null!=S&&(S.className="geBtn"+(ca?" gePrimaryBtn":""));null!=Z&&(Z.className=
-"geBtn"+(ca?"":" gePrimaryBtn"))};null!=E&&E.addEventListener("change",function(){X.enabled=!E.checked;G.value=JSON.stringify(X,null,2);da(!0)});null!=B&&B.addEventListener("change",function(){X.loop=!!B.checked;G.value=JSON.stringify(X,null,2);da(!0)});null!=f&&(f.addEventListener("input",function(){f.value?X.title=f.value:delete X.title;da(!0)}),f.addEventListener("keydown",function(ta){13!==ta.keyCode||ta.shiftKey||ta.isComposing||null==S||(ta.preventDefault(),S.click())}));var N="wait fadeIn fadeOut fadeTo opacity wipeIn wipeOut popIn popOut flow toggle show hide select style toggleStyle highlight scroll viewbox open tags".split(" "),
-aa=function(ta){for(var ya=0;ya<N.length;ya++)if(void 0!==ta[N[ya]])return N[ya];return null},ea=function(ta){var ya=aa(ta);return null==ya||"wait"==ya?null:ta[ya]},ka=function(ta){var ya=aa(ta);if("fadeTo"==ya)return ya=ta.fadeTo.value,1===ya?{icon:"↗",text:mxResources.get("fadeIn",null,"Fade In")}:0===ya?{icon:"↘",text:mxResources.get("fadeOut",null,"Fade Out")}:{icon:"◐",text:mxResources.get("fadeTo",null,"Fade To")};if("flow"==ya)return!0===ta.flow.start?{icon:"➡",text:mxResources.get("flowOn",
-null,"Flow On")}:!1===ta.flow.start?{icon:"⏸",text:mxResources.get("flowOff",null,"Flow Off")}:{icon:"➡",text:mxResources.get("flowOn",null,"Flow Toggle")};if("opacity"==ya)return{icon:"◐",text:mxResources.get("setOpacity",null,"Set Opacity")};ta=null!=ya?CustomActionDialog.SCHEMAS[ya]:null;return null!=ta?{icon:ta.icon||"?",text:mxResources.get(ta.labelKey||ya,null,ta.label||ya)}:{icon:"?",text:ya||"?"}},ra=function(){G.value=JSON.stringify(X,null,2);da(!0);Ha()},sa=function(){G.value=JSON.stringify(X,
-null,2);da(!0)},ma=new Set,wa=null,va=null,za=null,Ba=null,ua=null,qa=function(ta,ya){null!=ta&&(ta.disabled=!ya,ta.style.opacity=ya?"":"0.3",ta.style.cursor=ya?"pointer":"default")},ia=function(){var ta=AnimationDialog.stepsClipboard;qa(va,0<ma.size);qa(Ba,0<ma.size);qa(ua,0<ma.size);qa(za,null!=ta&&0<ta.length)},ja=function(){return Array.from(ma).sort(function(ta,ya){return ta-ya})},na=function(){if(0!=ma.size){for(var ta=ja(),ya=[],Ea=0;Ea<ta.length;Ea++)ya.push(JSON.parse(JSON.stringify(X.steps[ta[Ea]])));
-AnimationDialog.stepsClipboard=ya;if(null!=navigator.clipboard&&null!=navigator.clipboard.writeText)navigator.clipboard.writeText(JSON.stringify(ya,null,2))["catch"](function(){});ia()}},Aa=function(ta,ya){ta=JSON.parse(JSON.stringify(ta));Array.prototype.splice.apply(X.steps,[ya,0].concat(ta));ma.clear();for(var Ea=0;Ea<ta.length;Ea++)ma.add(ya+Ea);wa=ya;ra();ya=A.querySelector('[data-step-idx="'+ya+'"]');null!=ya&&null!=ya.scrollIntoView&&ya.scrollIntoView({block:"nearest"})},ha=function(){var ta=
-AnimationDialog.stepsClipboard;if(null!=ta&&0!=ta.length){var ya=ja();Aa(ta,0<ya.length?ya[ya.length-1]+1:X.steps.length)}},la=function(){if(0!=ma.size){for(var ta=ja(),ya=[],Ea=0;Ea<ta.length;Ea++)ya.push(X.steps[ta[Ea]]);Aa(ya,ta[ta.length-1]+1)}},xa=function(){if(0!=ma.size){for(var ta=ja(),ya=ta.length-1;0<=ya;ya--)X.steps.splice(ta[ya],1);ma.clear();wa=null;ra()}},Ca=null,pa=function(ta,ya){var Ea=document.createElement("span");Ea.style.cssText="flex:0 0 14px;text-align:center;font-size:14px;line-height:1;color:light-dark(#86868b,#86868b);cursor:grab;user-select:none";
-Ea.title=mxResources.get("reorder");Ea.textContent="⋮⋮";Ea.addEventListener("mousedown",function(){ta.draggable=!0});Ea.addEventListener("mouseup",function(){ta.draggable=!1});ta.addEventListener("dragstart",function(Ka){Ca={sourceIndex:ya};Ka.dataTransfer.effectAllowed="move";Ka.dataTransfer.setData("text/plain","animstep");ta.style.opacity="0.4"});ta.addEventListener("dragend",function(){ta.draggable=!1;ta.style.opacity="";for(var Ka=A.querySelectorAll("div"),Ja=0;Ja<Ka.length;Ja++)Ka[Ja].style.borderTop=
-"",Ka[Ja].style.borderBottom="";Ca=null});return Ea},oa=function(ta,ya){ta.addEventListener("dragover",function(Ea){if(null!=Ca){var Ka=ta.getBoundingClientRect(),Ja=(Ka=Ea.clientY>Ka.top+Ka.height/2)?ya+1:ya,Oa=Ca.sourceIndex;Ja==Oa||Ja==Oa+1?(ta.style.borderTop="",ta.style.borderBottom=""):(Ea.preventDefault(),Ea.dataTransfer.dropEffect="move",ta._dropInsertAt=Ja,Ka?(ta.style.borderTop="",ta.style.borderBottom="2px solid light-dark(var(--focus-color), var(--dark-focus-color))"):(ta.style.borderBottom=
-"",ta.style.borderTop="2px solid light-dark(var(--focus-color), var(--dark-focus-color))"))}});ta.addEventListener("dragleave",function(){ta.style.borderTop="";ta.style.borderBottom=""});ta.addEventListener("drop",function(Ea){if(null!=Ca){Ea.preventDefault();Ea.stopPropagation();ta.style.borderTop="";ta.style.borderBottom="";Ea=Ca.sourceIndex;var Ka=null!=ta._dropInsertAt?ta._dropInsertAt:ya;if(Ka!=Ea&&Ka!=Ea+1){var Ja=X.steps.splice(Ea,1)[0];Ea<Ka&&Ka--;X.steps.splice(Ka,0,Ja);ma.clear();wa=null;
-ra()}}})},Da=function(ta,ya,Ea,Ka){var Ja=document.createElement("button");Ja.type="button";Ja.title=ya;Ja.style.cssText="flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";Ea||(Ja.disabled=!0,Ja.style.opacity="0.3",Ja.style.cursor="default");mxUtils.write(Ja,ta);Ea&&Ja.addEventListener("click",
-Ka);return Ja},Fa=function(ta,ya){ya=ya||{};var Ea=document.createElement("input");Ea.type="number";null!=ya.min&&(Ea.min=ya.min);null!=ya.max&&(Ea.max=ya.max);null!=ya.step&&(Ea.step=ya.step);null!=ya.placeholder&&(Ea.placeholder=ya.placeholder);null!=ta&&(Ea.value=ta);Ea.className="geNoSpin";Ea.style.cssText="padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";
-return Ea},Ia=function(ta,ya,Ea,Ka){if(null!=Ka){Ka=document.createElement("span");Ka.style.cssText="display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:6px";var Ja=function($a){return{get:function(){var Na=X.steps[ya]&&X.steps[ya][Ea];return Na&&Array.isArray(Na[$a])?Na[$a]:null},set:function(Na){var Va=X.steps[ya][Ea];Va&&"object"==typeof Va||(Va=X.steps[ya][Ea]={});Na&&Na.length?Va[$a]=Na:delete Va[$a];ra()}}},Oa=Ja("tags"),db=function(){var $a=X.steps[ya]&&X.steps[ya][Ea];return $a&&
-"or"===$a.tagsMatch?"or":"and"},ob=function($a){var Na=X.steps[ya][Ea];Na&&"object"==typeof Na||(Na=X.steps[ya][Ea]={});"or"===$a?Na.tagsMatch="or":delete Na.tagsMatch;ra()},ub=Ja("layers"),Bb=CustomActionDialog.SCHEMAS[Ea],nb=[];null!=Bb&&Bb.allowLayers&&nb.push({label:mxResources.get("selectLayers")+"…",disabled:function(){return 0==z.getModel().getChildCount(z.getModel().getRoot())},onClick:function($a){F.openLayerPicker($a,ub.get,ub.set)}});nb.push({label:mxResources.get("selectByTags",null,"Select by tags")+
-"…",onClick:function($a){F.openTagPicker($a,Oa.get,Oa.set,db,ob)}});nb.push({label:mxResources.get("excludeSelection",null,"Exclude selected cells"),disabled:function(){return 0==z.getSelectionCount()},onClick:function(){var $a=z.getSelectionCells();if(0!=$a.length){var Na=X.steps[ya][Ea];Na&&"object"==typeof Na||(Na=X.steps[ya][Ea]={});for(var Va=Array.isArray(Na.excludeCells)?Na.excludeCells.slice():[],Mb={},Kb=0;Kb<Va.length;Kb++)Mb[Va[Kb]]=!0;for(Kb=0;Kb<$a.length;Kb++)Mb[$a[Kb].id]||(Va.push($a[Kb].id),
-Mb[$a[Kb].id]=!0);Na.excludeCells=Va;ra()}}});Bb=Ja("cells");Ka.appendChild(F.cellListField("",Bb.get,Bb.set,{allowWildcard:!0,extraMenuItems:nb}));nb=ub.get();Array.isArray(nb)&&0<nb.length&&Ka.appendChild(F.layerListField("",ub.get,ub.set));nb=Oa.get();Array.isArray(nb)&&0<nb.length&&Ka.appendChild(F.tagListField("",Oa.get,Oa.set,{getMode:db,setMode:ob}));Ja=Ja("excludeCells");nb=Ja.get();Array.isArray(nb)&&0<nb.length&&Ka.appendChild(F.cellListField("",Ja.get,Ja.set,{allowWildcard:!1,singularKey:"excluded",
-pluralKey:"excluded",singularFallback:"Excluded",pluralFallback:"Excluded"}));ta.appendChild(Ka)}},Ha=function(){A.innerHTML="";if(0==X.steps.length){var ta=document.createElement("div");ta.style.cssText="padding:12px;text-align:center;color:light-dark(#86868b,#86868b);font-size:12px";mxUtils.write(ta,mxResources.get("noStepsYet",null,"No steps yet. Add the first step below."));A.appendChild(ta)}else for(ta=0;ta<X.steps.length;ta++)A.appendChild(hb(X.steps[ta],ta,ta==X.steps.length-1));ia()},Ma=function(ta){var ya=
-document.createElement("div");ya.style.cssText="display:flex;align-items:center;gap:6px;min-width:max-content;padding:6px 4px;border-radius:4px;border-bottom:1px solid light-dark(rgba(0,0,0,0.05),rgba(255,255,255,0.05))";ta&&(ya.style.borderBottom="none");return ya},bb=function(ta){var ya=document.createElement("span");ya.style.cssText="flex:1 1 auto;min-width:0";ta.appendChild(ya)},ab=function(ta,ya){var Ea=document.createElement("span");Ea.style.cssText="flex:0 0 18px;text-align:center;font-size:14px";
-mxUtils.write(Ea,ya);ta.appendChild(Ea);return Ea},tb=function(ta,ya){var Ea=document.createElement("span");Ea.style.cssText="flex:0 0 70px;font-weight:500;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis";Ea.title=ya;mxUtils.write(Ea,ya);ta.appendChild(Ea)},yb=function(ta){return null!=ta.titleKey?mxResources.get(ta.titleKey,null,ta.title||""):null!=ta.title?ta.title:null!=ta.placeholderKey?mxResources.get(ta.placeholderKey,null,ta.placeholder||""):null!=ta.placeholder?ta.placeholder:
-null},jb=function(ta,ya,Ea,Ka,Ja,Oa){if(Ja){Ja=function(){return X.steps[ya][Ea]};var db=function(Na){X.steps[ya][Ea]=null==Na||""===Na?"number"==Ka.type?0:"":Na;sa()}}else Ja=function(){var Na=X.steps[ya][Ea];return null!=Na&&"object"==typeof Na?Na[Ka.name]:void 0},db=function(Na){var Va=X.steps[ya][Ea];if(null==Va||"object"!=typeof Va)Va=X.steps[ya][Ea]={};null==Na||""===Na?delete Va[Ka.name]:Va[Ka.name]=Na;sa()};var ob=yb(Ka);if("checkbox"==Ka.type){Oa=document.createElement("label");Oa.style.cssText=
-"flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));user-select:none";ob&&(Oa.title=ob);var ub=document.createElement("input");ub.type="checkbox";ub.checked=!!Ja();ub.style.cssText="margin:0;accent-color:light-dark(var(--focus-color), var(--dark-focus-color))";ub.addEventListener("change",function(){ub.checked?db(!0):db(void 0)});Oa.appendChild(ub);if(Ka.labelKey||Ka.label)Ja=document.createElement("span"),
-mxUtils.write(Ja,Ka.labelKey?mxResources.get(Ka.labelKey,null,Ka.label||""):Ka.label||""),Oa.appendChild(Ja);ta.appendChild(Oa)}else if("tagList"==Ka.type)ob=Ka.labelKey?mxResources.get(Ka.labelKey,null,Ka.label||""):Ka.label||"",ta.appendChild(F.tagListField(ob,Ja,function(Na){Array.isArray(Na)&&0!=Na.length?db(Na):db(void 0)},(Ka.modeField?{getMode:function(){var Na=X.steps[ya][Ea];return Na&&"or"===Na[Ka.modeField]?"or":"and"},setMode:function(Na){var Va=X.steps[ya][Ea];if(null==Va||"object"!=
-typeof Va)Va=X.steps[ya][Ea]={};"or"===Na?Va[Ka.modeField]="or":delete Va[Ka.modeField];sa()}}:null)||void 0));else if("select"==Ka.type){var Bb=document.createElement("select");Bb.style.cssText="flex:0 0 auto;padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";for(Oa=0;Oa<Ka.options.length;Oa++){var nb=
-document.createElement("option");nb.value=Ka.options[Oa].value;nb.textContent=Ka.options[Oa].label;Bb.appendChild(nb)}Ja=Ja();null!=Ja&&(Bb.value=String(Ja));ob&&(Bb.title=ob);Bb.addEventListener("change",function(){var Na=Bb.value;""===Na?db(void 0):"true"===Na?db(!0):"false"===Na?db(!1):db(Na)});ta.appendChild(Bb);Ka.label&&(Ja=document.createElement("span"),Ja.className="geDialogHint",Ja.style.cssText="flex:0 0 auto",mxUtils.write(Ja,Ka.label),ta.appendChild(Ja))}else{if("number"==Ka.type){nb=
-null!=Ka.placeholderKey?mxResources.get(Ka.placeholderKey,null,Ka.placeholder||""):Ka.placeholder;var $a=Fa(Ja(),{min:Ka.min,max:Ka.max,step:Ka.step,width:Ka.width||55,placeholder:nb})}else{$a=document.createElement("input");$a.type=Ka.type||"text";nb=Ka.width||("color"==Ka.type?36:80);$a.style.cssText="color"==Ka.type?"flex:0 0 "+nb+"px;min-width:0;height:22px;padding:1px;cursor:pointer;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color))":
-"flex:0 0 "+nb+"px;min-width:0;padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";if(nb=null!=Ka.placeholderKey?mxResources.get(Ka.placeholderKey,null,Ka.placeholder||""):Ka.placeholder)$a.placeholder=nb;Ja=Ja();null!=Ja&&($a.value=String(Ja))}ob&&($a.title=ob);Oa&&($a.disabled=!0,$a.style.opacity=
-"0.4");Ja=function(){var Na=$a.value;"number"==Ka.type?""===Na?db(void 0):(Na=parseFloat(Na),isNaN(Na)?db(void 0):db(Na)):db(""===Na?void 0:Na)};$a.addEventListener("change",Ja);$a.addEventListener("input",Ja);ta.appendChild($a);Ka.label&&(Ja=document.createElement("span"),Ja.className="geDialogHint",Ja.style.cssText="flex:0 0 auto",mxUtils.write(Ja,Ka.label),ta.appendChild(Ja))}},hb=function(ta,ya,Ea){var Ka=ka(ta),Ja=aa(ta),Oa=null!=Ja?CustomActionDialog.SCHEMAS[Ja]:null,db=ea(ta);Ea=Ma(Ea);Ea.setAttribute("data-step-idx",
-ya);J.has(ya)&&Ea.classList.add("geAnimationStepActive");ma.has(ya)&&Ea.classList.add("geAnimationStepSelected");var ob=document.createElement("input");ob.type="checkbox";ob.setAttribute("data-step-select","1");ob.checked=ma.has(ya);ob.title=mxResources.get("select");ob.style.cssText="flex:0 0 auto;margin:0;accent-color:light-dark(var(--focus-color), var(--dark-focus-color))";ob.addEventListener("click",function(Na){if(Na.shiftKey&&null!=wa){Na=Math.max(wa,ya);for(var Va=Math.min(wa,ya);Va<=Na;Va++)ma.add(Va)}else{if(ob.checked)ma.add(ya);
-else ma["delete"](ya);wa=ya}Na=A.querySelectorAll("[data-step-idx]");for(Va=0;Va<Na.length;Va++){var Mb=parseInt(Na[Va].getAttribute("data-step-idx"),10);Mb=ma.has(Mb);Na[Va].classList.toggle("geAnimationStepSelected",Mb);var Kb=Na[Va].querySelector("input[data-step-select]");null!=Kb&&(Kb.checked=Mb)}ia()});Ea.appendChild(ob);Ea.appendChild(pa(Ea,ya));oa(Ea,ya);var ub=document.createElement("button");ub.type="button";var Bb=function(){ub.textContent="";!0===ta.immediate?(mxUtils.write(ub,"⏩︎"),ub.title=
-mxResources.get("immediate",null,"Immediate")):(mxUtils.write(ub,"⏱︎"),ub.title=mxResources.get("wait",null,"Wait"))};ub.style.cssText='flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-family:"Segoe UI Symbol","Apple Symbols",sans-serif;font-variant-emoji:text;filter:grayscale(1) contrast(2)';
-Bb();0===ya&&(ub.style.visibility="hidden");ub.addEventListener("click",function(){!0===ta.immediate?(delete X.steps[ya].immediate,ta.immediate=void 0):(X.steps[ya].immediate=!0,ta.immediate=!0);Bb();sa()});Ea.appendChild(ub);ab(Ea,Ka.icon);tb(Ea,Ka.text);if(null!=Oa&&null!=Oa.primary)bb(Ea),jb(Ea,ya,Ja,Oa.primary,!0);else{(null==Oa||Oa.selector)&&Ia(Ea,ya,Ja,db);bb(Ea);if(null!=Oa&&Array.isArray(Oa.fields)){Ka=null!=db&&(Array.isArray(db.cells)&&0<db.cells.length||Array.isArray(db.tags)&&0<db.tags.length||
-Array.isArray(db.layers)&&0<db.layers.length);for(var nb=0;nb<Oa.fields.length;nb++)jb(Ea,ya,Ja,Oa.fields[nb],!1,!0===Oa.fields[nb].staticOnly&&Ka)}if(null!=Oa&&Oa.selector&&("wipeIn"==Ja||"wipeOut"==Ja||"popIn"==Ja||"popOut"==Ja)){var $a=Fa(db.delay,{min:0,step:100,width:55,placeholder:"900"});$a.title=mxResources.get("duration");$a.addEventListener("change",function(){var Na=parseFloat($a.value);Na=""===$a.value||isNaN(Na)||0>Na?void 0:Na;null==Na?delete X.steps[ya][Ja].delay:X.steps[ya][Ja].delay=
-Na;sa()});Ea.appendChild($a);Oa=document.createElement("span");Oa.className="geDialogHint";Oa.style.cssText="flex:0 0 auto";mxUtils.write(Oa,"ms");Ea.appendChild(Oa)}"viewbox"==Ja&&(Oa=document.createElement("button"),Oa.type="button",Oa.className="geBtn",Oa.style.cssText="flex:0 0 auto;padding:2px 8px;font-size:11px;min-width:0",Oa.textContent=mxResources.get("useCurrent"),Oa.title=Oa.textContent,Oa.addEventListener("click",function(Na){Na.preventDefault();Na=Eb();var Va=X.steps[ya].viewbox;if(null==
-Va||"object"!=typeof Va)Va=X.steps[ya].viewbox={};Va.x=Na.x;Va.y=Na.y;Va.width=Na.width;Va.height=Na.height;null==Va.border&&(Va.border=Na.border);delete Va.cells;delete Va.tags;delete Va.tagsMatch;delete Va.layers;delete Va.excludeCells;ra()}),Ea.appendChild(Oa))}Oa=Da("▶",mxResources.get("preview"),!0,function(){Pa();var Na=JSON.parse(JSON.stringify(Graph.flattenAnimationActions([ta])));z.executeCustomActions(Na)});Ea.appendChild(Oa);return Ea};y.addEventListener("change",function(){y.checked?(A.style.display=
-"none",G.style.display="block",ba()):(G.style.display="none",A.style.display="block",P(null),Ha())});G.addEventListener("input",function(){da(!0);try{var ta=Editor.parseAnimationData(G.value);null!=ta&&Array.isArray(ta.steps)&&(X=ta,ma.clear(),wa=null,P(null),null!=B&&(B.checked=!!X.loop),null!=E&&(E.checked=!X.enabled),y.checked||Ha())}catch(ya){P(Q(G.value,ya))}});Ha();var rb=document.createElement("div");rb.className="geDialogSection";rb.style.cssText="margin-top:10px;margin-bottom:0;flex:0 0 auto;display:flex;flex-direction:column;gap:8px";
-var Sa=document.createElement("div");Sa.style.cssText="display:flex;align-items:center;gap:8px;flex-wrap:wrap";rb.appendChild(Sa);var Ua=document.createElement("select");Ua.style.cssText="flex:1 1 200px;min-width:180px;padding:5px 6px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:4px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-size:13px";var vb=
-[],kb=document.createElement("option");kb.value="";kb.disabled=!0;kb.selected=!0;var qb=function(){kb.textContent=mxResources.get("add")+"…"};qb();H.push(qb);Ua.appendChild(kb);for(var lb=[{labelKey:"visibilityActions",label:"Visibility",keys:["toggle","show","hide"]},{labelKey:"effects",label:"Effects",keys:"fadeIn fadeOut fadeTo wipeIn wipeOut popIn popOut".split(" ")},{labelKey:"style",label:"Style",keys:["opacity","style","toggleStyle","highlight","flow"]},{labelKey:"navigation",label:"Navigation",
-keys:["select","scroll","viewbox","open"]},{labelKey:"tags",label:"Tags",keys:["tags"]},{labelKey:"timing",label:"Timing",keys:["wait"]}],Za=0;Za<lb.length;Za++){var Hb=document.createElement("optgroup");Hb.label=mxResources.get(lb[Za].labelKey,null,lb[Za].label);vb.push({el:Hb,prop:"label",key:lb[Za].labelKey,fallback:lb[Za].label});for(var Db=0;Db<lb[Za].keys.length;Db++){var Cb=lb[Za].keys[Db],fb=CustomActionDialog.SCHEMAS[Cb];if(null!=fb){var eb=document.createElement("option");eb.value=Cb;var Wa=
-fb.labelKey||Cb;eb.textContent=mxResources.get(Wa,null,fb.label);vb.push({el:eb,prop:"textContent",key:Wa,fallback:fb.label});Hb.appendChild(eb)}}Ua.appendChild(Hb)}var cb=document.createElement("optgroup");cb.label="──────";var Gb=document.createElement("option");Gb.value="__deleteAll__";Gb.className="geDeleteOpt";Gb.textContent=mxResources.get("deleteAll");vb.push({el:Gb,prop:"textContent",key:"deleteAll",fallback:"Delete All"});cb.appendChild(Gb);Ua.appendChild(cb);H.push(function(){for(var ta=
-0;ta<vb.length;ta++){var ya=vb[ta];ya.el[ya.prop]=mxResources.get(ya.key,null,ya.fallback)}});Sa.appendChild(Ua);var sb=[],wb=function(ta,ya,Ea,Ka){var Ja=mxResources.get(ya,null,Ea);Ka=Da("",Ja,!0,Ka);Ja=document.createElement("img");Ja.className="geAdaptiveAsset";Ja.setAttribute("src",ta);Ja.style.cssText="width:14px;height:14px;vertical-align:middle";Ka.appendChild(Ja);sb.push({el:Ka,key:ya,fallback:Ea});Sa.appendChild(Ka);return Ka};va=wb(Editor.copyImage,"copy","Copy",na);za=wb(Editor.pasteImage,
-"paste","Paste",ha);Ba=wb(Editor.duplicateImage,"duplicate","Duplicate",la);ua=wb(Editor.trashImage,"delete","Delete",xa);ia();H.push(function(){for(var ta=0;ta<sb.length;ta++){var ya=sb[ta];ya.el.title=mxResources.get(ya.key,null,ya.fallback)}});c.addEventListener("keydown",function(ta){var ya=ta.target,Ea=null!=ya&&null!=ya.tagName?ya.tagName.toLowerCase():"";"textarea"==Ea||"select"==Ea||"input"==Ea&&"checkbox"!=ya.type||null!=ya&&ya.isContentEditable||(ya=null!=ta.key?ta.key.toLowerCase():"",
-Ea=!1,!("delete"!=ya&&"backspace"!=ya||ta.metaKey||ta.ctrlKey||ta.altKey)&&0<ma.size?(xa(),Ea=!0):(mxClient.IS_MAC?ta.metaKey:ta.ctrlKey)&&!ta.altKey&&("c"==ya&&0<ma.size&&""==window.getSelection().toString()?(na(),Ea=!0):"v"==ya&&null!=AnimationDialog.stepsClipboard&&0<AnimationDialog.stepsClipboard.length?(ha(),Ea=!0):"d"==ya&&0<ma.size&&(la(),Ea=!0)),Ea&&(ta.preventDefault(),ta.stopPropagation()))});c.appendChild(rb);var Eb=function(){var ta=z.view,ya=z.container,Ea=ta.scale;ta=ta.translate;return{x:Math.round(ya.scrollLeft/
-Ea-ta.x),y:Math.round(ya.scrollTop/Ea-ta.y),width:Math.round(ya.clientWidth/Ea),height:Math.round(ya.clientHeight/Ea),border:0}},pb=function(ta,ya){var Ea=CustomActionDialog.SCHEMAS[ta];if(null==Ea)return null;var Ka={};if(null!=Ea.primary){var Ja=Ea.primary.def;Ka[ta]=null!=Ja?"number"==Ea.primary.type?parseFloat(Ja):Ja:"number"==Ea.primary.type?0:""}else{Ja={};Ea.selector&&Array.isArray(ya)&&0<ya.length&&(Ja.cells=ya.slice());if(Array.isArray(Ea.fields))for(ya=0;ya<Ea.fields.length;ya++){var Oa=
-Ea.fields[ya];null!=Oa.def&&(Ja[Oa.name]="number"==Oa.type?parseFloat(Oa.def):Oa.def)}"viewbox"==ta&&null==Ja.cells&&(Ea=Eb(),null==Ja.x&&(Ja.x=Ea.x),null==Ja.y&&(Ja.y=Ea.y),null==Ja.width&&(Ja.width=Ea.width),null==Ja.height&&(Ja.height=Ea.height),null==Ja.border&&(Ja.border=Ea.border));Ka[ta]=Ja}return Ka};Ua.addEventListener("change",function(){var ta=Ua.value;Ua.value="";if(ta)if("__deleteAll__"==ta)0!=X.steps.length&&b.confirm(mxResources.get("areYouSure",null,"Are you sure?"),function(){X.steps=
-[];ma.clear();wa=null;ra()});else{var ya=CustomActionDialog.SCHEMAS[ta];if(null!=ya){var Ea=null;ya.selector&&(ya=z.getSelectionCells(),Ea=0<ya.length?ya.map(function(Ka){return Ka.id}):"viewbox"==ta?null:[Editor.ANIMATION_ALL]);ta=pb(ta,Ea);null!=ta&&(X.steps.push(ta),ra(),A.scrollTop=A.scrollHeight)}}});var Ab=null,Ib=null,Lb=null,Ga=function(){if(null!=Lb){var ta=null!=Ib;Lb.disabled=!ta;Lb.style.opacity=ta?"":"0.4";Lb.style.cursor=ta?"":"default"}},Pa=function(){null==Ib&&(Ib=new Editor.AnimationPlayer(z,
-X),Ib.snapshotOpacity(),Ga())},La=function(){if(null!=Ib){Ib.restoreOpacity();for(var ta=Ib.collectReferencedCells(),ya=[],Ea=0;Ea<ta.length;Ea++)z.getModel().isEdge(ta[Ea])&&ya.push(ta[Ea]);0<ya.length&&Editor.toggleFlowAnimation(z,ya,"stop");z.refresh();Ib=null;Ga()}},Ta=function(){null!=Ab&&(Ab.stop(),Ab=null)},Qa=document.createElement("div");Qa.style.cssText="margin-top:20px;display:flex;gap:6px;flex:0 0 auto";var Ra=function(ta,ya){var Ea=new Set;if(null!=ta&&0<=ta)for(ya=null!=ya?ya:ta+1;ta<
-ya;ta++)Ea.add(ta);if(Ea.size===J.size){ta=!0;ya=$jscomp.makeIterator(Ea);for(var Ka=ya.next();!Ka.done;Ka=ya.next())if(!J.has(Ka.value)){ta=!1;break}if(ta)return}J=Ea;Ea=A.querySelectorAll("[data-step-idx]");for(ta=0;ta<Ea.length;ta++)ya=parseInt(Ea[ta].getAttribute("data-step-idx"),10),Ea[ta].classList.toggle("geAnimationStepActive",J.has(ya))};Qa.appendChild(b.createHelpIcon(ANIMATION_HELP_URL));var Xa=this,gb=function(){if("page"==x){var ta=z.getModel().getRoot(),ya={steps:X.steps};!1===X.loop&&
-(ya.loop=!1);!1===X.enabled&&(ya.enabled=!1);ya=0<ya.steps.length?JSON.stringify({animation:ya}):null;z.setAttributeForCell(ta,"animation",ya);z.setAttributeForCell(ta,"animationHideInitial",null)}else"function"==typeof u.save&&u.save(X);da(!1)};Z=mxUtils.button(mxResources.get("preview"),function(){Ta();Pa();Ab=new Editor.AnimationPlayer(z,X);Ab.snapshot=[];Ab.play({done:function(){Ab=null;Ra(-1)},onStep:function(ta,ya){Ra(ta,ya)}})});Z.className="geBtn";H.push(function(){Z.textContent=mxResources.get("preview");
-Z.title=mxResources.get("preview")});Z.title=mxResources.get("preview");Qa.appendChild(Z);var ib=mxUtils.button(mxResources.get("reset"),function(){Ta();Ra(-1);La()});ib.className="geBtn";H.push(function(){var ta=mxResources.get("reset");ib.textContent=ta;ib.title=ta});ib.title=mxResources.get("reset");Lb=ib;Ga();Qa.appendChild(ib);V=document.createElement("span");V.style.flex="1 1 auto";Qa.appendChild(V);var zb=mxUtils.button(mxResources.get("cancel"),function(){ca?mb():Xa.window.setVisible(!1)});
-zb.className="geBtn";H.push(function(){zb.textContent=mxResources.get("cancel");zb.title=mxResources.get("cancel")});zb.title=mxResources.get("cancel");Qa.appendChild(zb);S=mxUtils.button(mxResources.get("save"),function(){y.checked&&!L?(ba(),G.focus()):(gb(),Xa.window.setVisible(!1))});S.className="geBtn gePrimaryBtn";H.push(function(){S.textContent=mxResources.get("save");S.title=mxResources.get("save")});S.title=mxResources.get("save");Qa.appendChild(S);c.appendChild(Qa);this.window=new mxWindow(D(),
-c,k,m,g,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,360,360);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);var xb=function(){"function"==typeof F.closePopover&&F.closePopover()};this.window.addListener(mxEvent.MOVE,xb);this.window.addListener(mxEvent.RESIZE,xb);var Jb=function(){for(var ta=0;ta<H.length;ta++)try{H[ta]()}catch(ya){}null!=Xa.window&&null!=Xa.window.title&&(Xa.window.title.innerHTML=mxUtils.htmlEntities(D()));
-Ha()};b.addListener("languageChanged",Jb);this.window.addListener(mxEvent.DESTROY,function(){b.removeListener(Jb)});var mb=function(){b.confirm(mxResources.get("allChangesLost"),null,function(){da(!1);Xa.window.setVisible(!1)},mxResources.get("cancel"),mxResources.get("discardChanges"))},Fb=Xa.window.setVisible.bind(Xa.window);Xa.window.setVisible=function(ta){!1===ta&&ca&&gb();Fb(ta)};this.window.addListener("hide",function(){Ta();Ra(-1);La()});"page"==x&&z.addListener(mxEvent.ROOT,function(){var ta=
-z.getModel().getRoot();if(ta!=Y){if(ca){var ya={steps:X.steps};!1===X.loop&&(ya.loop=!1);!1===X.enabled&&(ya.enabled=!1);ya=0<X.steps.length?JSON.stringify({animation:ya}):null;z.setAttributeForCell(Y,"animation",ya)}Y=ta;W();da(!1);ma.clear();wa=null;Ha();Ta()}});var Ya=function(){da(!1);Xa.window.setVisible(!1)};b.editor.addListener("fileLoaded",Ya);this.window.addListener(mxEvent.DESTROY,function(){b.editor.removeListener(Ya)});installDialogDocking(b,this);this.window.setVisible(!0);window.setTimeout(mxUtils.bind(this,
-function(){null==this.window||null==this.window.div||this.window.minimized||null!=this.window.dockState||this.window.setLocation(this.window.getX(),this.window.getY())}),0)};AnimationDialog.stepsClipboard=null;
+document.createElement("textarea");G.spellcheck=!1;G.style.cssText="display:none;width:100%;flex:1 1 0;min-height:0;resize:none;font-family:monospace;font-size:12px;padding:8px;box-sizing:border-box;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:6px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";c.appendChild(G);var J=document.createElement("div");J.style.cssText=
+"display:none;flex:0 0 auto;margin-top:6px;padding:6px 8px;border-radius:6px;font-size:12px;background:light-dark(#fde7e9,#3a1d1f);color:light-dark(#b3261e,#ffb4ab);border:1px solid light-dark(#f1aeb5,#7a2e2e);white-space:pre-wrap;word-break:break-word";c.appendChild(J);var L=!0,P=function(ta){L=null==ta;J.style.display=null==ta?"none":"block";null!=ta&&(J.textContent=ta)},Q=function(ta,xa){xa=null!=xa&&null!=xa.message?xa.message:String(xa);if(!/line \d+/i.test(xa)){var Da=xa.match(/at position (\d+)/i);
+null!=Da&&(Da=Math.min(parseInt(Da[1],10),ta.length),ta=ta.substring(0,Da).split("\n"),xa+=" (line "+ta.length+" column "+(ta[ta.length-1].length+1)+")")}return mxResources.get("error")+": "+xa},ba=function(){try{Editor.parseAnimationData(G.value),P(null)}catch(ta){P(Q(G.value,ta))}},W={steps:[]},Y=z.getModel().getRoot(),X=function(){if("page"==x){var ta=z.getAttributeForCell(Y,"animation");try{W=Editor.parseAnimationData(ta)}catch(xa){W=Editor.parseAnimationData(null)}}else ta=u.initial,W=Array.isArray(ta)?
+{steps:JSON.parse(JSON.stringify(ta))}:null!=ta&&"object"==typeof ta?JSON.parse(JSON.stringify(ta)):{steps:[]};null==W.steps&&(W.steps=[]);"page"!=x&&(null!=W.loop&&delete W.loop,null!=W.enabled&&delete W.enabled);G.value=JSON.stringify(W,null,2);null!=f&&(f.value=W.title||"");null!=B&&(B.checked=null==W.loop?!0:!!W.loop);null!=E&&(E.checked=null==W.enabled?!1:!W.enabled)};X();var ca=!1,S=null,Z=null,da=function(ta){ca=ta;null!=S&&(S.className="geBtn"+(ca?" gePrimaryBtn":""));null!=Z&&(Z.className=
+"geBtn"+(ca?"":" gePrimaryBtn"))};null!=E&&E.addEventListener("change",function(){W.enabled=!E.checked;G.value=JSON.stringify(W,null,2);da(!0)});null!=B&&B.addEventListener("change",function(){W.loop=!!B.checked;G.value=JSON.stringify(W,null,2);da(!0)});null!=f&&(f.addEventListener("input",function(){f.value?W.title=f.value:delete W.title;da(!0)}),f.addEventListener("keydown",function(ta){13!==ta.keyCode||ta.shiftKey||ta.isComposing||null==S||(ta.preventDefault(),S.click())}));var N="wait fadeIn fadeOut fadeTo opacity wipeIn wipeOut popIn popOut flow toggle show hide select style toggleStyle highlight scroll viewbox open tags".split(" "),
+aa=function(ta){for(var xa=0;xa<N.length;xa++)if(void 0!==ta[N[xa]])return N[xa];return null},ea=function(ta){var xa=aa(ta);return null==xa||"wait"==xa?null:ta[xa]},ka=function(ta){var xa=aa(ta);if("fadeTo"==xa)return xa=ta.fadeTo.value,1===xa?{icon:"↗",text:mxResources.get("fadeIn",null,"Fade In")}:0===xa?{icon:"↘",text:mxResources.get("fadeOut",null,"Fade Out")}:{icon:"◐",text:mxResources.get("fadeTo",null,"Fade To")};if("flow"==xa)return!0===ta.flow.start?{icon:"➡",text:mxResources.get("flowOn",
+null,"Flow On")}:!1===ta.flow.start?{icon:"⏸",text:mxResources.get("flowOff",null,"Flow Off")}:{icon:"➡",text:mxResources.get("flowOn",null,"Flow Toggle")};if("opacity"==xa)return{icon:"◐",text:mxResources.get("setOpacity",null,"Set Opacity")};ta=null!=xa?CustomActionDialog.SCHEMAS[xa]:null;return null!=ta?{icon:ta.icon||"?",text:mxResources.get(ta.labelKey||xa,null,ta.label||xa)}:{icon:"?",text:xa||"?"}},ra=function(){G.value=JSON.stringify(W,null,2);da(!0);Ha()},sa=function(){G.value=JSON.stringify(W,
+null,2);da(!0)},ma=new Set,wa=null,va=null,za=null,Ba=null,ua=null,qa=function(ta,xa){null!=ta&&(ta.disabled=!xa,ta.style.opacity=xa?"":"0.3",ta.style.cursor=xa?"pointer":"default")},ia=function(){var ta=AnimationDialog.stepsClipboard;qa(va,0<ma.size);qa(Ba,0<ma.size);qa(ua,0<ma.size);qa(za,null!=ta&&0<ta.length)},ja=function(){return Array.from(ma).sort(function(ta,xa){return ta-xa})},na=function(){if(0!=ma.size){for(var ta=ja(),xa=[],Da=0;Da<ta.length;Da++)xa.push(JSON.parse(JSON.stringify(W.steps[ta[Da]])));
+AnimationDialog.stepsClipboard=xa;if(null!=navigator.clipboard&&null!=navigator.clipboard.writeText)navigator.clipboard.writeText(JSON.stringify(xa,null,2))["catch"](function(){});ia()}},Aa=function(ta,xa){ta=JSON.parse(JSON.stringify(ta));Array.prototype.splice.apply(W.steps,[xa,0].concat(ta));ma.clear();for(var Da=0;Da<ta.length;Da++)ma.add(xa+Da);wa=xa;ra();xa=A.querySelector('[data-step-idx="'+xa+'"]');null!=xa&&null!=xa.scrollIntoView&&xa.scrollIntoView({block:"nearest"})},ha=function(){var ta=
+AnimationDialog.stepsClipboard;if(null!=ta&&0!=ta.length){var xa=ja();Aa(ta,0<xa.length?xa[xa.length-1]+1:W.steps.length)}},la=function(){if(0!=ma.size){for(var ta=ja(),xa=[],Da=0;Da<ta.length;Da++)xa.push(W.steps[ta[Da]]);Aa(xa,ta[ta.length-1]+1)}},ya=function(){if(0!=ma.size){for(var ta=ja(),xa=ta.length-1;0<=xa;xa--)W.steps.splice(ta[xa],1);ma.clear();wa=null;ra()}},Ca=null,pa=function(ta,xa){var Da=document.createElement("span");Da.style.cssText="flex:0 0 14px;text-align:center;font-size:14px;line-height:1;color:light-dark(#86868b,#86868b);cursor:grab;user-select:none";
+Da.title=mxResources.get("reorder");Da.textContent="⋮⋮";Da.addEventListener("mousedown",function(){ta.draggable=!0});Da.addEventListener("mouseup",function(){ta.draggable=!1});ta.addEventListener("dragstart",function(Ia){Ca={sourceIndex:xa};Ia.dataTransfer.effectAllowed="move";Ia.dataTransfer.setData("text/plain","animstep");ta.style.opacity="0.4"});ta.addEventListener("dragend",function(){ta.draggable=!1;ta.style.opacity="";for(var Ia=A.querySelectorAll("div"),La=0;La<Ia.length;La++)Ia[La].style.borderTop=
+"",Ia[La].style.borderBottom="";Ca=null});return Da},oa=function(ta,xa){ta.addEventListener("dragover",function(Da){if(null!=Ca){var Ia=ta.getBoundingClientRect(),La=(Ia=Da.clientY>Ia.top+Ia.height/2)?xa+1:xa,Ua=Ca.sourceIndex;La==Ua||La==Ua+1?(ta.style.borderTop="",ta.style.borderBottom=""):(Da.preventDefault(),Da.dataTransfer.dropEffect="move",ta._dropInsertAt=La,Ia?(ta.style.borderTop="",ta.style.borderBottom="2px solid light-dark(var(--focus-color), var(--dark-focus-color))"):(ta.style.borderBottom=
+"",ta.style.borderTop="2px solid light-dark(var(--focus-color), var(--dark-focus-color))"))}});ta.addEventListener("dragleave",function(){ta.style.borderTop="";ta.style.borderBottom=""});ta.addEventListener("drop",function(Da){if(null!=Ca){Da.preventDefault();Da.stopPropagation();ta.style.borderTop="";ta.style.borderBottom="";Da=Ca.sourceIndex;var Ia=null!=ta._dropInsertAt?ta._dropInsertAt:xa;if(Ia!=Da&&Ia!=Da+1){var La=W.steps.splice(Da,1)[0];Da<Ia&&Ia--;W.steps.splice(Ia,0,La);ma.clear();wa=null;
+ra()}}})},Ea=function(ta,xa,Da,Ia){var La=document.createElement("button");La.type="button";La.title=xa;La.style.cssText="flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";Da||(La.disabled=!0,La.style.opacity="0.3",La.style.cursor="default");mxUtils.write(La,ta);Da&&La.addEventListener("click",
+Ia);return La},Ga=function(ta,xa){xa=xa||{};var Da=document.createElement("input");Da.type="number";null!=xa.min&&(Da.min=xa.min);null!=xa.max&&(Da.max=xa.max);null!=xa.step&&(Da.step=xa.step);null!=xa.placeholder&&(Da.placeholder=xa.placeholder);null!=ta&&(Da.value=ta);Da.className="geNoSpin";Da.style.cssText="padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";
+return Da},Ja=function(ta,xa,Da,Ia){if(null!=Ia){Ia=document.createElement("span");Ia.style.cssText="display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:6px";var La=function(Pa){return{get:function(){var Oa=W.steps[xa]&&W.steps[xa][Da];return Oa&&Array.isArray(Oa[Pa])?Oa[Pa]:null},set:function(Oa){var rb=W.steps[xa][Da];rb&&"object"==typeof rb||(rb=W.steps[xa][Da]={});Oa&&Oa.length?rb[Pa]=Oa:delete rb[Pa];ra()}}},Ua=La("tags"),Va=function(){var Pa=W.steps[xa]&&W.steps[xa][Da];return Pa&&
+"or"===Pa.tagsMatch?"or":"and"},nb=function(Pa){var Oa=W.steps[xa][Da];Oa&&"object"==typeof Oa||(Oa=W.steps[xa][Da]={});"or"===Pa?Oa.tagsMatch="or":delete Oa.tagsMatch;ra()},ob=La("layers"),Cb=CustomActionDialog.SCHEMAS[Da],kb=[];null!=Cb&&Cb.allowLayers&&kb.push({label:mxResources.get("selectLayers")+"…",disabled:function(){return 0==z.getModel().getChildCount(z.getModel().getRoot())},onClick:function(Pa){F.openLayerPicker(Pa,ob.get,ob.set)}});kb.push({label:mxResources.get("selectByTags",null,"Select by tags")+
+"…",onClick:function(Pa){F.openTagPicker(Pa,Ua.get,Ua.set,Va,nb)}});kb.push({label:mxResources.get("excludeSelection",null,"Exclude selected cells"),disabled:function(){return 0==z.getSelectionCount()},onClick:function(){var Pa=z.getSelectionCells();if(0!=Pa.length){var Oa=W.steps[xa][Da];Oa&&"object"==typeof Oa||(Oa=W.steps[xa][Da]={});for(var rb=Array.isArray(Oa.excludeCells)?Oa.excludeCells.slice():[],Pb={},Lb=0;Lb<rb.length;Lb++)Pb[rb[Lb]]=!0;for(Lb=0;Lb<Pa.length;Lb++)Pb[Pa[Lb].id]||(rb.push(Pa[Lb].id),
+Pb[Pa[Lb].id]=!0);Oa.excludeCells=rb;ra()}}});var Ib=function(){var Pa=W.steps[xa][Da];return null!=Pa&&"object"==typeof Pa&&!0===Pa.descendants};kb.push({label:mxResources.get("descendants"),active:Ib(),onClick:function(){var Pa=W.steps[xa][Da];Pa&&"object"==typeof Pa||(Pa=W.steps[xa][Da]={});!0===Pa.descendants?delete Pa.descendants:Pa.descendants=!0;ra()}});Cb=La("cells");Ia.appendChild(F.cellListField("",Cb.get,Cb.set,{allowWildcard:!0,extraMenuItems:kb,suffix:function(){return Ib()?" + "+mxResources.get("descendants"):
+""}}));kb=ob.get();Array.isArray(kb)&&0<kb.length&&Ia.appendChild(F.layerListField("",ob.get,ob.set));kb=Ua.get();Array.isArray(kb)&&0<kb.length&&Ia.appendChild(F.tagListField("",Ua.get,Ua.set,{getMode:Va,setMode:nb}));La=La("excludeCells");kb=La.get();Array.isArray(kb)&&0<kb.length&&Ia.appendChild(F.cellListField("",La.get,La.set,{allowWildcard:!1,singularKey:"excluded",pluralKey:"excluded",singularFallback:"Excluded",pluralFallback:"Excluded"}));ta.appendChild(Ia)}},Ha=function(){A.innerHTML="";
+if(0==W.steps.length){var ta=document.createElement("div");ta.style.cssText="padding:12px;text-align:center;color:light-dark(#86868b,#86868b);font-size:12px";mxUtils.write(ta,mxResources.get("noStepsYet",null,"No steps yet. Add the first step below."));A.appendChild(ta)}else for(ta=0;ta<W.steps.length;ta++)A.appendChild(Xa(W.steps[ta],ta,ta==W.steps.length-1));ia()},Ma=function(ta){var xa=document.createElement("div");xa.style.cssText="display:flex;align-items:center;gap:6px;min-width:max-content;padding:6px 4px;border-radius:4px;border-bottom:1px solid light-dark(rgba(0,0,0,0.05),rgba(255,255,255,0.05))";
+ta&&(xa.style.borderBottom="none");return xa},eb=function(ta){var xa=document.createElement("span");xa.style.cssText="flex:1 1 auto;min-width:0";ta.appendChild(xa)},bb=function(ta,xa){var Da=document.createElement("span");Da.style.cssText="flex:0 0 18px;text-align:center;font-size:14px";mxUtils.write(Da,xa);ta.appendChild(Da);return Da},tb=function(ta,xa){var Da=document.createElement("span");Da.style.cssText="flex:0 0 70px;font-weight:500;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis";
+Da.title=xa;mxUtils.write(Da,xa);ta.appendChild(Da)},Db=function(ta){return null!=ta.titleKey?mxResources.get(ta.titleKey,null,ta.title||""):null!=ta.title?ta.title:null!=ta.placeholderKey?mxResources.get(ta.placeholderKey,null,ta.placeholder||""):null!=ta.placeholder?ta.placeholder:null},cb=null,gb=function(){for(;null!=cb.firstChild;)cb.removeChild(cb.firstChild);for(var ta=0;ta<AnimationDialog.STYLE_KEYS.length;ta++){var xa=AnimationDialog.STYLE_KEYS[ta],Da=document.createElement("option");Da.value=
+xa.key;Da.label="function"==typeof xa.label?xa.label():mxResources.get(xa.label,null,xa.fallback);cb.appendChild(Da)}},wb=function(ta,xa,Da){var Ia=ta.setAttribute;null==cb&&(cb=document.createElement("datalist"),cb.id="geStyleKeys"+ ++AnimationDialog.styleKeyListCount,gb(),c.appendChild(cb),H.push(gb));Ia.call(ta,"list",cb.id);ta=CustomActionDialog.SCHEMAS[Da];var La=!1;if(null!=ta&&Array.isArray(ta.fields))for(Ia=0;Ia<ta.fields.length;Ia++)La=La||"value"==ta.fields[Ia].name;var Ua=F.iconButton("arrowDown",
+mxResources.get("useSelection"),function(){var Va=z.getSelectionCell(),nb=null!=Va?AnimationDialog.getStylePairs(z.model.getStyle(Va)):[],ob=[];0==nb.length&&ob.push({label:mxResources.get(null==Va?"nothingIsSelected":"none"),disabled:!0});for(Va=0;Va<nb.length;Va++)(function(Cb){ob.push({label:Cb.key+" = "+Cb.value,onClick:function(){var kb=W.steps[xa][Da];if(null==kb||"object"!=typeof kb)kb=W.steps[xa][Da]={};kb.key=Cb.key;La&&(kb.value=Cb.value);ra()}})})(nb[Va]);F.openMenuPopover(Ua,ob)});return Ua},
+Sa=function(ta,xa,Da,Ia,La,Ua){if(La){var Va=function(){return W.steps[xa][Da]};var nb=function(Oa){W.steps[xa][Da]=null==Oa||""===Oa?"number"==Ia.type?0:"":Oa;sa()}}else Va=function(){var Oa=W.steps[xa][Da];return null!=Oa&&"object"==typeof Oa?Oa[Ia.name]:void 0},nb=function(Oa){var rb=W.steps[xa][Da];if(null==rb||"object"!=typeof rb)rb=W.steps[xa][Da]={};null==Oa||""===Oa?delete rb[Ia.name]:rb[Ia.name]=Oa;sa()};var ob=Db(Ia);if("checkbox"==Ia.type){La=document.createElement("label");La.style.cssText=
+"flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));user-select:none";ob&&(La.title=ob);var Cb=document.createElement("input");Cb.type="checkbox";Cb.checked=!!Va();Cb.style.cssText="margin:0;accent-color:light-dark(var(--focus-color), var(--dark-focus-color))";Cb.addEventListener("change",function(){Cb.checked?nb(!0):nb(void 0)});La.appendChild(Cb);if(Ia.labelKey||Ia.label)Va=document.createElement("span"),
+mxUtils.write(Va,Ia.labelKey?mxResources.get(Ia.labelKey,null,Ia.label||""):Ia.label||""),La.appendChild(Va);ta.appendChild(La)}else if("tagList"==Ia.type)ob=Ia.labelKey?mxResources.get(Ia.labelKey,null,Ia.label||""):Ia.label||"",ta.appendChild(F.tagListField(ob,Va,function(Oa){Array.isArray(Oa)&&0!=Oa.length?nb(Oa):nb(void 0)},(Ia.modeField?{getMode:function(){var Oa=W.steps[xa][Da];return Oa&&"or"===Oa[Ia.modeField]?"or":"and"},setMode:function(Oa){var rb=W.steps[xa][Da];if(null==rb||"object"!=
+typeof rb)rb=W.steps[xa][Da]={};"or"===Oa?rb[Ia.modeField]="or":delete rb[Ia.modeField];sa()}}:null)||void 0));else if("select"==Ia.type){var kb=document.createElement("select");kb.style.cssText="flex:0 0 auto;padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";for(La=0;La<Ia.options.length;La++)Ua=
+document.createElement("option"),Ua.value=Ia.options[La].value,Ua.textContent=Ia.options[La].label,kb.appendChild(Ua);Va=Va();null!=Va&&(kb.value=String(Va));ob&&(kb.title=ob);kb.addEventListener("change",function(){var Oa=kb.value;""===Oa?nb(void 0):"true"===Oa?nb(!0):"false"===Oa?nb(!1):nb(Oa)});ta.appendChild(kb);Ia.label&&(Va=document.createElement("span"),Va.className="geDialogHint",Va.style.cssText="flex:0 0 auto",mxUtils.write(Va,Ia.label),ta.appendChild(Va))}else{if("number"==Ia.type){var Ib=
+null!=Ia.placeholderKey?mxResources.get(Ia.placeholderKey,null,Ia.placeholder||""):Ia.placeholder;var Pa=Ga(Va(),{min:Ia.min,max:Ia.max,step:Ia.step,width:Ia.width||55,placeholder:Ib})}else{Pa=document.createElement("input");Pa.type=Ia.type||"text";Ib=Ia.width||("color"==Ia.type?36:80);Pa.style.cssText="color"==Ia.type?"flex:0 0 "+Ib+"px;min-width:0;height:22px;padding:1px;cursor:pointer;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color))":
+"flex:0 0 "+Ib+"px;min-width:0;padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";if(Ib=null!=Ia.placeholderKey?mxResources.get(Ia.placeholderKey,null,Ia.placeholder||""):Ia.placeholder)Pa.placeholder=Ib;Va=Va();null!=Va&&(Pa.value=String(Va))}ob&&(Pa.title=ob);Ua&&(Pa.disabled=!0,Pa.style.opacity=
+"0.4");Va=function(){var Oa=Pa.value;"number"==Ia.type?""===Oa?nb(void 0):(Oa=parseFloat(Oa),isNaN(Oa)?nb(void 0):nb(Oa)):nb(""===Oa?void 0:Oa)};Pa.addEventListener("change",Va);Pa.addEventListener("input",Va);ta.appendChild(Pa);Ia.styleKey&&!La&&ta.appendChild(wb(Pa,xa,Da));Ia.label&&(Va=document.createElement("span"),Va.className="geDialogHint",Va.style.cssText="flex:0 0 auto",mxUtils.write(Va,Ia.label),ta.appendChild(Va))}},Xa=function(ta,xa,Da){var Ia=ka(ta),La=aa(ta),Ua=null!=La?CustomActionDialog.SCHEMAS[La]:
+null,Va=ea(ta);Da=Ma(Da);Da.setAttribute("data-step-idx",xa);I.has(xa)&&Da.classList.add("geAnimationStepActive");ma.has(xa)&&Da.classList.add("geAnimationStepSelected");var nb=document.createElement("input");nb.type="checkbox";nb.setAttribute("data-step-select","1");nb.checked=ma.has(xa);nb.title=mxResources.get("select");nb.style.cssText="flex:0 0 auto;margin:0;accent-color:light-dark(var(--focus-color), var(--dark-focus-color))";nb.addEventListener("click",function(Pa){if(Pa.shiftKey&&null!=wa){Pa=
+Math.max(wa,xa);for(var Oa=Math.min(wa,xa);Oa<=Pa;Oa++)ma.add(Oa)}else{if(nb.checked)ma.add(xa);else ma["delete"](xa);wa=xa}Pa=A.querySelectorAll("[data-step-idx]");for(Oa=0;Oa<Pa.length;Oa++){var rb=parseInt(Pa[Oa].getAttribute("data-step-idx"),10);rb=ma.has(rb);Pa[Oa].classList.toggle("geAnimationStepSelected",rb);var Pb=Pa[Oa].querySelector("input[data-step-select]");null!=Pb&&(Pb.checked=rb)}ia()});Da.appendChild(nb);Da.appendChild(pa(Da,xa));oa(Da,xa);var ob=document.createElement("button");
+ob.type="button";var Cb=function(){ob.textContent="";!0===ta.immediate?(mxUtils.write(ob,"⏩︎"),ob.title=mxResources.get("immediate",null,"Immediate")):(mxUtils.write(ob,"⏱︎"),ob.title=mxResources.get("wait",null,"Wait"))};ob.style.cssText='flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-family:"Segoe UI Symbol","Apple Symbols",sans-serif;font-variant-emoji:text;filter:grayscale(1) contrast(2)';
+Cb();0===xa&&(ob.style.visibility="hidden");ob.addEventListener("click",function(){!0===ta.immediate?(delete W.steps[xa].immediate,ta.immediate=void 0):(W.steps[xa].immediate=!0,ta.immediate=!0);Cb();sa()});Da.appendChild(ob);bb(Da,Ia.icon);tb(Da,Ia.text);if(null!=Ua&&null!=Ua.primary)eb(Da),Sa(Da,xa,La,Ua.primary,!0);else{(null==Ua||Ua.selector)&&Ja(Da,xa,La,Va);eb(Da);if(null!=Ua&&Array.isArray(Ua.fields)){Ia=null!=Va&&(Array.isArray(Va.cells)&&0<Va.cells.length||Array.isArray(Va.tags)&&0<Va.tags.length||
+Array.isArray(Va.layers)&&0<Va.layers.length);for(var kb=0;kb<Ua.fields.length;kb++)Sa(Da,xa,La,Ua.fields[kb],!1,!0===Ua.fields[kb].staticOnly&&Ia)}if(null!=Ua&&Ua.selector&&("wipeIn"==La||"wipeOut"==La||"popIn"==La||"popOut"==La)){var Ib=Ga(Va.delay,{min:0,step:100,width:55,placeholder:"900"});Ib.title=mxResources.get("duration");Ib.addEventListener("change",function(){var Pa=parseFloat(Ib.value);Pa=""===Ib.value||isNaN(Pa)||0>Pa?void 0:Pa;null==Pa?delete W.steps[xa][La].delay:W.steps[xa][La].delay=
+Pa;sa()});Da.appendChild(Ib);Ua=document.createElement("span");Ua.className="geDialogHint";Ua.style.cssText="flex:0 0 auto";mxUtils.write(Ua,"ms");Da.appendChild(Ua)}"viewbox"==La&&(Ua=document.createElement("button"),Ua.type="button",Ua.className="geBtn",Ua.style.cssText="flex:0 0 auto;padding:2px 8px;font-size:11px;min-width:0",Ua.textContent=mxResources.get("useCurrent"),Ua.title=Ua.textContent,Ua.addEventListener("click",function(Pa){Pa.preventDefault();Pa=Mb();var Oa=W.steps[xa].viewbox;if(null==
+Oa||"object"!=typeof Oa)Oa=W.steps[xa].viewbox={};Oa.x=Pa.x;Oa.y=Pa.y;Oa.width=Pa.width;Oa.height=Pa.height;null==Oa.border&&(Oa.border=Pa.border);delete Oa.cells;delete Oa.tags;delete Oa.tagsMatch;delete Oa.layers;delete Oa.excludeCells;ra()}),Da.appendChild(Ua))}Ua=Ea("▶",mxResources.get("preview"),!0,function(){Qa();var Pa=JSON.parse(JSON.stringify(Graph.flattenAnimationActions([ta])));z.executeCustomActions(Pa)});Da.appendChild(Ua);return Da};y.addEventListener("change",function(){y.checked?(A.style.display=
+"none",G.style.display="block",ba()):(G.style.display="none",A.style.display="block",P(null),Ha())});G.addEventListener("input",function(){da(!0);try{var ta=Editor.parseAnimationData(G.value);null!=ta&&Array.isArray(ta.steps)&&(W=ta,ma.clear(),wa=null,P(null),null!=B&&(B.checked=!!W.loop),null!=E&&(E.checked=!W.enabled),y.checked||Ha())}catch(xa){P(Q(G.value,xa))}});Ha();var vb=document.createElement("div");vb.className="geDialogSection";vb.style.cssText="margin-top:10px;margin-bottom:0;flex:0 0 auto;display:flex;flex-direction:column;gap:8px";
+var pb=document.createElement("div");pb.style.cssText="display:flex;align-items:center;gap:8px;flex-wrap:wrap";vb.appendChild(pb);var jb=document.createElement("select");jb.style.cssText="flex:1 1 200px;min-width:180px;padding:5px 6px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:4px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-size:13px";var qb=
+[],Za=document.createElement("option");Za.value="";Za.disabled=!0;Za.selected=!0;var Jb=function(){Za.textContent=mxResources.get("add")+"…"};Jb();H.push(Jb);jb.appendChild(Za);for(var Ab=[{labelKey:"visibilityActions",label:"Visibility",keys:["toggle","show","hide"]},{labelKey:"effects",label:"Effects",keys:"fadeIn fadeOut fadeTo wipeIn wipeOut popIn popOut".split(" ")},{labelKey:"style",label:"Style",keys:["opacity","style","toggleStyle","highlight","flow"]},{labelKey:"navigation",label:"Navigation",
+keys:["select","scroll","viewbox","open"]},{labelKey:"tags",label:"Tags",keys:["tags"]},{labelKey:"timing",label:"Timing",keys:["wait"]}],yb=0;yb<Ab.length;yb++){var fb=document.createElement("optgroup");fb.label=mxResources.get(Ab[yb].labelKey,null,Ab[yb].label);qb.push({el:fb,prop:"label",key:Ab[yb].labelKey,fallback:Ab[yb].label});for(var ib=0;ib<Ab[yb].keys.length;ib++){var Wa=Ab[yb].keys[ib],db=CustomActionDialog.SCHEMAS[Wa];if(null!=db){var Hb=document.createElement("option");Hb.value=Wa;var ub=
+db.labelKey||Wa;Hb.textContent=mxResources.get(ub,null,db.label);qb.push({el:Hb,prop:"textContent",key:ub,fallback:db.label});fb.appendChild(Hb)}}jb.appendChild(fb)}var xb=document.createElement("optgroup");xb.label="──────";var Bb=document.createElement("option");Bb.value="__deleteAll__";Bb.className="geDeleteOpt";Bb.textContent=mxResources.get("deleteAll");qb.push({el:Bb,prop:"textContent",key:"deleteAll",fallback:"Delete All"});xb.appendChild(Bb);jb.appendChild(xb);H.push(function(){for(var ta=
+0;ta<qb.length;ta++){var xa=qb[ta];xa.el[xa.prop]=mxResources.get(xa.key,null,xa.fallback)}});pb.appendChild(jb);var lb=[],Gb=function(ta,xa,Da,Ia){var La=mxResources.get(xa,null,Da);Ia=Ea("",La,!0,Ia);La=document.createElement("img");La.className="geAdaptiveAsset";La.setAttribute("src",ta);La.style.cssText="width:14px;height:14px;vertical-align:middle";Ia.appendChild(La);lb.push({el:Ia,key:xa,fallback:Da});pb.appendChild(Ia);return Ia};va=Gb(Editor.copyImage,"copy","Copy",na);za=Gb(Editor.pasteImage,
+"paste","Paste",ha);Ba=Gb(Editor.duplicateImage,"duplicate","Duplicate",la);ua=Gb(Editor.trashImage,"delete","Delete",ya);ia();H.push(function(){for(var ta=0;ta<lb.length;ta++){var xa=lb[ta];xa.el.title=mxResources.get(xa.key,null,xa.fallback)}});c.addEventListener("keydown",function(ta){var xa=ta.target,Da=null!=xa&&null!=xa.tagName?xa.tagName.toLowerCase():"";"textarea"==Da||"select"==Da||"input"==Da&&"checkbox"!=xa.type||null!=xa&&xa.isContentEditable||(xa=null!=ta.key?ta.key.toLowerCase():"",
+Da=!1,!("delete"!=xa&&"backspace"!=xa||ta.metaKey||ta.ctrlKey||ta.altKey)&&0<ma.size?(ya(),Da=!0):(mxClient.IS_MAC?ta.metaKey:ta.ctrlKey)&&!ta.altKey&&("c"==xa&&0<ma.size&&""==window.getSelection().toString()?(na(),Da=!0):"v"==xa&&null!=AnimationDialog.stepsClipboard&&0<AnimationDialog.stepsClipboard.length?(ha(),Da=!0):"d"==xa&&0<ma.size&&(la(),Da=!0)),Da&&(ta.preventDefault(),ta.stopPropagation()))});c.appendChild(vb);var Mb=function(){var ta=z.view,xa=z.container,Da=ta.scale;ta=ta.translate;return{x:Math.round(xa.scrollLeft/
+Da-ta.x),y:Math.round(xa.scrollTop/Da-ta.y),width:Math.round(xa.clientWidth/Da),height:Math.round(xa.clientHeight/Da),border:0}},Qb=function(ta,xa){var Da=CustomActionDialog.SCHEMAS[ta];if(null==Da)return null;var Ia={};if(null!=Da.primary){var La=Da.primary.def;Ia[ta]=null!=La?"number"==Da.primary.type?parseFloat(La):La:"number"==Da.primary.type?0:""}else{La={};Da.selector&&Array.isArray(xa)&&0<xa.length&&(La.cells=xa.slice());if(Array.isArray(Da.fields))for(xa=0;xa<Da.fields.length;xa++){var Ua=
+Da.fields[xa];null!=Ua.def&&(La[Ua.name]="number"==Ua.type?parseFloat(Ua.def):Ua.def)}"viewbox"==ta&&null==La.cells&&(Da=Mb(),null==La.x&&(La.x=Da.x),null==La.y&&(La.y=Da.y),null==La.width&&(La.width=Da.width),null==La.height&&(La.height=Da.height),null==La.border&&(La.border=Da.border));Ia[ta]=La}return Ia};jb.addEventListener("change",function(){var ta=jb.value;jb.value="";if(ta)if("__deleteAll__"==ta)0!=W.steps.length&&b.confirm(mxResources.get("areYouSure",null,"Are you sure?"),function(){W.steps=
+[];ma.clear();wa=null;ra()});else{var xa=CustomActionDialog.SCHEMAS[ta];if(null!=xa){var Da=null;xa.selector&&(xa=z.getSelectionCells(),Da=0<xa.length?xa.map(function(Ia){return Ia.id}):"viewbox"==ta?null:[Editor.ANIMATION_ALL]);ta=Qb(ta,Da);null!=ta&&(W.steps.push(ta),ra(),A.scrollTop=A.scrollHeight)}}});var Fa=null,Na=null,Ka=null,Ta=function(){if(null!=Ka){var ta=null!=Na;Ka.disabled=!ta;Ka.style.opacity=ta?"":"0.4";Ka.style.cursor=ta?"":"default"}},Qa=function(){null==Na&&(Na=new Editor.AnimationPlayer(z,
+W));Na.snapshotOpacity();Ta()},Ra=function(){if(null!=Na){Na.restoreOpacity();for(var ta=Na.collectReferencedCells(),xa=[],Da=0;Da<ta.length;Da++)z.getModel().isEdge(ta[Da])&&xa.push(ta[Da]);0<xa.length&&Editor.toggleFlowAnimation(z,xa,"stop");z.refresh();Na=null;Ta()}},$a=function(){null!=Fa&&(Fa.stop(),Fa=null)},ab=document.createElement("div");ab.style.cssText="margin-top:20px;display:flex;gap:6px;flex:0 0 auto";var mb=function(ta,xa){var Da=new Set;if(null!=ta&&0<=ta)for(xa=null!=xa?xa:ta+1;ta<
+xa;ta++)Da.add(ta);if(Da.size===I.size){ta=!0;xa=$jscomp.makeIterator(Da);for(var Ia=xa.next();!Ia.done;Ia=xa.next())if(!I.has(Ia.value)){ta=!1;break}if(ta)return}I=Da;Da=A.querySelectorAll("[data-step-idx]");for(ta=0;ta<Da.length;ta++)xa=parseInt(Da[ta].getAttribute("data-step-idx"),10),Da[ta].classList.toggle("geAnimationStepActive",I.has(xa))};ab.appendChild(b.createHelpIcon(ANIMATION_HELP_URL));var sb=this,zb=function(){if("page"==x){var ta=z.getModel().getRoot(),xa={steps:W.steps};!1===W.loop&&
+(xa.loop=!1);!1===W.enabled&&(xa.enabled=!1);xa=0<xa.steps.length?JSON.stringify({animation:xa}):null;z.setAttributeForCell(ta,"animation",xa);z.setAttributeForCell(ta,"animationHideInitial",null)}else"function"==typeof u.save&&u.save(W);da(!1)};Z=mxUtils.button(mxResources.get("preview"),function(){$a();Qa();Fa=new Editor.AnimationPlayer(z,W);Fa.snapshot=[];Fa.play({done:function(){Fa=null;mb(-1)},onStep:function(ta,xa){mb(ta,xa)}})});Z.className="geBtn";H.push(function(){Z.textContent=mxResources.get("preview");
+Z.title=mxResources.get("preview")});Z.title=mxResources.get("preview");ab.appendChild(Z);var Eb=mxUtils.button(mxResources.get("reset"),function(){$a();mb(-1);Ra()});Eb.className="geBtn";H.push(function(){var ta=mxResources.get("reset");Eb.textContent=ta;Eb.title=ta});Eb.title=mxResources.get("reset");Ka=Eb;Ta();ab.appendChild(Eb);V=document.createElement("span");V.style.flex="1 1 auto";ab.appendChild(V);var hb=mxUtils.button(mxResources.get("cancel"),function(){ca?Ob():sb.window.setVisible(!1)});
+hb.className="geBtn";H.push(function(){hb.textContent=mxResources.get("cancel");hb.title=mxResources.get("cancel")});hb.title=mxResources.get("cancel");ab.appendChild(hb);S=mxUtils.button(mxResources.get("save"),function(){y.checked&&!L?(ba(),G.focus()):(zb(),sb.window.setVisible(!1))});S.className="geBtn gePrimaryBtn";H.push(function(){S.textContent=mxResources.get("save");S.title=mxResources.get("save")});S.title=mxResources.get("save");ab.appendChild(S);c.appendChild(ab);this.window=new mxWindow(D(),
+c,k,m,g,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,360,360);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);var Fb=function(){"function"==typeof F.closePopover&&F.closePopover()};this.window.addListener(mxEvent.MOVE,Fb);this.window.addListener(mxEvent.RESIZE,Fb);var Ya=function(){for(var ta=0;ta<H.length;ta++)try{H[ta]()}catch(xa){}null!=sb.window&&null!=sb.window.title&&(sb.window.title.innerHTML=mxUtils.htmlEntities(D()));
+Ha()};b.addListener("languageChanged",Ya);this.window.addListener(mxEvent.DESTROY,function(){b.removeListener(Ya)});var Ob=function(){b.confirm(mxResources.get("allChangesLost"),null,function(){da(!1);sb.window.setVisible(!1)},mxResources.get("cancel"),mxResources.get("discardChanges"))};this.requestClose=function(ta){ca?b.confirm(mxResources.get("allChangesLost"),null,function(){da(!1);sb.window.setVisible(!1);null!=ta&&ta()},mxResources.get("cancel"),mxResources.get("discardChanges")):(sb.window.setVisible(!1),
+null!=ta&&ta())};var Kb=sb.window.setVisible.bind(sb.window);sb.window.setVisible=function(ta){!1===ta&&ca&&zb();Kb(ta)};this.window.addListener("hide",function(){$a();mb(-1);Ra()});"page"==x&&z.addListener(mxEvent.ROOT,function(){var ta=z.getModel().getRoot();if(ta!=Y){if(ca){var xa={steps:W.steps};!1===W.loop&&(xa.loop=!1);!1===W.enabled&&(xa.enabled=!1);xa=0<W.steps.length?JSON.stringify({animation:xa}):null;z.setAttributeForCell(Y,"animation",xa)}Y=ta;X();da(!1);ma.clear();wa=null;Ha();$a()}});
+var Nb=function(){da(!1);sb.window.setVisible(!1)};b.editor.addListener("fileLoaded",Nb);this.window.addListener(mxEvent.DESTROY,function(){b.editor.removeListener(Nb)});installDialogDocking(b,this);this.window.setVisible(!0);window.setTimeout(mxUtils.bind(this,function(){null==this.window||null==this.window.div||this.window.minimized||null!=this.window.dockState||this.window.setLocation(this.window.getX(),this.window.getY())}),0)};AnimationDialog.stepsClipboard=null;
+AnimationDialog.styleKeyListCount=0;
+AnimationDialog.STYLE_KEYS=[{key:"strokeWidth",label:"linewidth",fallback:"Linewidth"},{key:"strokeColor",label:"strokeColor",fallback:"Line Color"},{key:"fillColor",label:"fillColor",fallback:"Fill Color"},{key:"gradientColor",label:"gradient",fallback:"Gradient"},{key:"opacity",label:"opacity",fallback:"Opacity"},{key:"fontColor",label:"fontColor",fallback:"Font Color"},{key:"fontSize",label:"fontSize",fallback:"Font Size"},{key:"fontFamily",label:"fontFamily",fallback:"Font Family"},{key:"fontStyle",
+label:function(){return mxResources.get("font")+": 1 "+mxResources.get("bold")+", 2 "+mxResources.get("italic")+", 4 "+mxResources.get("underline")}},{key:"textOpacity",label:"textOpacity",fallback:"Text Opacity"},{key:"labelBackgroundColor",label:"backgroundColor",fallback:"Background Color"},{key:"labelBorderColor",label:"borderColor",fallback:"Border Color"},{key:"align",label:"align",fallback:"Align"},{key:"spacing",label:"spacing",fallback:"Spacing"},{key:"dashed",label:"dashed",fallback:"Dashed"},
+{key:"rounded",label:"rounded",fallback:"Rounded"},{key:"curved",label:"curved",fallback:"Curved"},{key:"startArrow",label:"linestart",fallback:"Line Start"},{key:"endArrow",label:"lineend",fallback:"Line End"},{key:"flowAnimation",label:"flowAnimation",fallback:"Flow Animation"},{key:"shadow",label:"shadow",fallback:"Shadow"},{key:"glass",label:"glass",fallback:"Glass"},{key:"sketch",label:"sketch",fallback:"Sketch"},{key:"comic",label:"comic",fallback:"Comic"},{key:"rotation",label:"rotation",fallback:"Rotation"},
+{key:"perimeterSpacing",label:"perimeter",fallback:"Perimeter"}];AnimationDialog.getStylePairs=function(b){var k=[];b=null!=b?String(b).split(";"):[];for(var m=0;m<b.length;m++){var g=b[m].indexOf("=");0<g&&k.push({key:b[m].substring(0,g),value:b[m].substring(g+1)})}return k};
var CustomGitLabUrlWarningDialog=function(b,k){var m=document.createElement("div"),g=document.createElement("h3");mxUtils.write(g,mxResources.get("customGitlabUrlTitle"));m.appendChild(g);g=document.createElement("p");mxUtils.write(g,mxResources.get("customGitlabUrlWarning"));m.appendChild(g);g=document.createElement("p");var q=document.createElement("strong");mxUtils.write(q,mxResources.get("customGitlabUrlServer")+" ");g.appendChild(q);q=document.createElement("code");mxUtils.write(q,k);g.appendChild(q);
m.appendChild(g);k=document.createElement("p");g=document.createElement("a");g.setAttribute("href","https://github.com/jgraph/drawio/issues/493");g.setAttribute("target","_blank");g.setAttribute("rel","noopener noreferrer");mxUtils.write(g,mxResources.get("customGitlabUrlLearnMore"));k.appendChild(g);m.appendChild(k);this.container=(new CustomDialog(b,m,null,null,mxResources.get("close"),null,null,!0)).container},AuthDialog=function(b,k,m,g){var q=document.createElement("div");q.style.textAlign="center";
var u=document.createElement("p");u.style.fontSize="16pt";u.style.padding="0px";u.style.margin="0px";u.style.color="gray";mxUtils.write(u,mxResources.get("authorizationRequired"));var x="Unknown",z=document.createElement("img");z.setAttribute("border","0");z.setAttribute("align","absmiddle");z.style.marginRight="10px";k==b.drive?(x=mxResources.get("googleDrive"),z.src=IMAGE_PATH+"/google-drive-logo-white.svg"):k==b.dropbox?(x=mxResources.get("dropbox"),z.src=IMAGE_PATH+"/dropbox-logo-white.svg"):
k==b.oneDrive?(x=mxResources.get("oneDrive"),z.src=IMAGE_PATH+"/onedrive-logo-white.svg"):k==b.gitHub?(x=mxResources.get("github"),z.src=IMAGE_PATH+"/github-logo-white.svg"):k==b.gitLab?(x=mxResources.get("gitlab"),z.src=IMAGE_PATH+"/gitlab-logo.svg",z.style.width="32px"):k==b.trello?(x=mxResources.get("trello"),z.src=IMAGE_PATH+"/trello-logo-white.svg"):k==b.m365&&(x=mxResources.get("m365"),z.src=IMAGE_PATH+"/onedrive-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",
[x]));var F=document.createElement("input");F.setAttribute("type","checkbox");x=mxUtils.button(mxResources.get("authorize"),function(){g(F.checked)});x.insertBefore(z,x.firstChild);x.style.marginTop="6px";x.className="geBigButton";x.style.fontSize="18px";x.style.padding="14px";q.appendChild(u);q.appendChild(b);q.appendChild(x);m&&(m=document.createElement("p"),m.style.marginTop="20px",m.appendChild(F),u=document.createElement("span"),mxUtils.write(u," "+mxResources.get("rememberMe")),m.appendChild(u),
-q.appendChild(m),F.checked=!0,F.defaultChecked=!0,mxEvent.addListener(u,"click",function(J){F.checked=!F.checked;mxEvent.consume(J)}));this.container=q},MoreShapesDialog=function(b,k,m){m=null!=m?m:b.sidebar.entries;var g=document.createElement("div"),q=[];if(null!=b.sidebar.customEntries)for(var u=0;u<b.sidebar.customEntries.length;u++){for(var x=b.sidebar.customEntries[u]||{},z={title:b.getResource(x.title),entries:[]},F=0;null!=x.entries&&F<x.entries.length;F++){var J=x.entries[F];z.entries.push({id:J.id,
-title:b.getResource(J.title),desc:b.getResource(J.desc),image:J.preview})}0<z.entries.length&&q.push(z)}for(u=0;u<m.length;u++)if(null==b.sidebar.enabledLibraries)q.push(m[u]);else{z={title:m[u].title,entries:[]};for(F=0;F<m[u].entries.length;F++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,m[u].entries[F].id)&&z.entries.push(m[u].entries[F]);0<z.entries.length&&q.push(z)}m=q;if(k){u=mxUtils.bind(this,function(K){for(var C=0;C<K.length;C++)(function(R){var M=document.createElement("div");M.className=
+q.appendChild(m),F.checked=!0,F.defaultChecked=!0,mxEvent.addListener(u,"click",function(I){F.checked=!F.checked;mxEvent.consume(I)}));this.container=q},MoreShapesDialog=function(b,k,m){m=null!=m?m:b.sidebar.entries;var g=document.createElement("div"),q=[];if(null!=b.sidebar.customEntries)for(var u=0;u<b.sidebar.customEntries.length;u++){for(var x=b.sidebar.customEntries[u]||{},z={title:b.getResource(x.title),entries:[]},F=0;null!=x.entries&&F<x.entries.length;F++){var I=x.entries[F];z.entries.push({id:I.id,
+title:b.getResource(I.title),desc:b.getResource(I.desc),image:I.preview})}0<z.entries.length&&q.push(z)}for(u=0;u<m.length;u++)if(null==b.sidebar.enabledLibraries)q.push(m[u]);else{z={title:m[u].title,entries:[]};for(F=0;F<m[u].entries.length;F++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,m[u].entries[F].id)&&z.entries.push(m[u].entries[F]);0<z.entries.length&&q.push(z)}m=q;if(k){u=mxUtils.bind(this,function(K){for(var C=0;C<K.length;C++)(function(R){var M=document.createElement("div");M.className=
"geMoreShapesSectionHeader";mxUtils.write(M,R.title);H.appendChild(M);for(var O=0;O<R.entries.length;O++)(function(U){var T=document.createElement("div");T.className="geMoreShapesItem";T.setAttribute("title",U.title+" ("+U.id+")");var V=document.createElement("input");V.setAttribute("type","checkbox");V.checked=b.sidebar.isEntryVisible(U.id);V.defaultChecked=V.checked;T.appendChild(V);var fa=document.createElement("span");mxUtils.write(fa,U.title);T.appendChild(fa);H.appendChild(T);fa=function(y){if(null==
y||"INPUT"!=mxEvent.getSource(y).nodeName){D.style.textAlign="center";D.style.padding="0px";D.style.color="";D.innerText="";if(null!=U.desc){var d=document.createElement("pre");d.style.boxSizing="border-box";d.style.fontFamily="inherit";d.style.margin="20px";d.style.right="0px";d.style.textAlign="left";mxUtils.write(d,U.desc);D.appendChild(d)}null!=U.imageCallback?U.imageCallback(D):null!=U.image?(d=document.createElement("img"),d.setAttribute("border","0"),d.style.maxWidth="100%",d.setAttribute("src",
U.image),D.appendChild(d)):null==U.desc&&(D.style.padding="20px",D.style.color="rgb(179, 179, 179)",mxUtils.write(D,mxResources.get("noPreview")));null!=c&&c.classList.remove("geMoreShapesItemSelected");c=T;c.classList.add("geMoreShapesItemSelected");null!=y&&mxEvent.consume(y)}};mxEvent.addListener(T,"click",fa);mxEvent.addListener(T,"dblclick",function(y){V.checked=!V.checked;mxEvent.consume(y)});f.push(function(){return V.checked?U.id:null});0==C&&0==O&&fa()})(R.entries[O])})(K[C])});F=document.createElement("div");
@@ -13553,77 +13563,77 @@ Editor.currentTheme||!Editor.isSettingsEnabled()||(C=mxUtils.indexOf(K,".scratch
r.appendChild(M);M.checked=b.sidebar.isEntryVisible(R);var O=document.createElement("span");mxUtils.write(O,C);C=document.createElement("div");C.style.display="block";C.appendChild(M);C.appendChild(O);mxEvent.addListener(O,"click",function(U){M.checked=!M.checked;mxEvent.consume(U)});K.appendChild(C);return function(){return M.checked?R:null}});F.appendChild(k);F.appendChild(q);F.appendChild(x);u.appendChild(F);r.appendChild(u);f=[];var v=0;for(u=0;u<m.length;u++)for(F=0;F<m[u].entries.length;F++)v++;
var B=[k,q,x],E=0;for(u=0;u<m.length;u++)(function(K){for(var C=0;C<K.entries.length;C++){var R=K.entries[C];f.push(t(B[Math.floor(E/(v/3))],R.title,R.id));E++}})(m[u]);g.appendChild(r);m=document.createElement("div");m.style.marginTop="18px";m.style.textAlign="center";n=document.createElement("input");isLocalStorage&&(n.setAttribute("type","checkbox"),n.checked=!0,n.defaultChecked=!0,m.appendChild(n),u=document.createElement("span"),mxUtils.write(u," "+mxResources.get("rememberThisSetting")),m.appendChild(u),
mxEvent.addListener(u,"click",function(K){n.checked=!n.checked;mxEvent.consume(K)}));g.appendChild(m);u=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});u.className="geBtn";F=mxUtils.button(mxResources.get("apply"),function(){for(var K=["search"],C=0;C<f.length;C++){var R=f[C].apply(this,arguments);null!=R&&K.push(R)}b.sidebar.showEntries(0<K.length?K.join(";"):"",n.checked);b.hideDialog()});F.className="geBtn gePrimaryBtn";m=document.createElement("div");m.style.marginTop="26px";
-m.style.textAlign="right";b.editor.cancelFirst?(m.appendChild(u),m.appendChild(F)):(m.appendChild(F),m.appendChild(u))}g.appendChild(m);this.container=g},PluginsDialog=function(b,k,m,g){function q(){H=!0;if(0==J.length){F.innerText="";var t=document.createElement("div");t.className="geDialogHint";mxUtils.write(t,mxResources.get("noPlugins"));F.appendChild(t)}else for(F.innerText="",t=0;t<J.length;t++){var v=document.createElement("span");v.style.display="flex";v.style.alignItems="center";v.style.whiteSpace=
-"nowrap";v.style.minHeight="26px";var B=document.createElement("img");B.src=Editor.trashImage;B.style.cursor="pointer";B.style.marginRight="8px";B.style.width="16px";B.style.flexShrink="0";B.setAttribute("title",mxResources.get("delete"));v.appendChild(B);var E=document.createElement("span");E.style.overflow="hidden";E.style.textOverflow="ellipsis";mxUtils.write(E,J[t]);v.appendChild(E);F.appendChild(v);mxEvent.addListener(B,"click",function(K){return function(){b.confirm(mxResources.get("delete")+
-' "'+J[K]+'"?',function(){null!=m&&m(J[K]);J.splice(K,1);q()})}}(t))}}function u(){if(null!=D){D.innerText="";var t=document.createElement("option");t.value="";mxUtils.write(t,mxResources.get("chooseAnOption")||"Choose…");D.appendChild(t);for(t=0;t<App.publicPlugin.length;t++){var v=App.publicPlugin[t],B=App.pluginRegistry[v],E=document.createElement("option");mxUtils.write(E,v);E.value=v;if(null==B||0<=mxUtils.indexOf(J,B))E.disabled=!0;D.appendChild(E)}null!=c&&(c.disabled=!0)}}var x=document.createElement("div"),
-z=document.createElement("h3");mxUtils.write(z,mxResources.get("plugins"));x.appendChild(z);var F=document.createElement("div");F.className="geDialogSection";F.style.height="160px";F.style.overflow="auto";F.style.fontSize="13px";var J=mxSettings.getPlugins().slice(),H=!1;x.appendChild(F);q();H=!1;var D=null,c=null;if(null==k){z=document.createElement("div");z.style.display="flex";z.style.alignItems="center";z.style.gap="8px";z.style.marginTop="10px";D=document.createElement("select");D.style.flex=
-"1";D.style.minWidth="0";z.appendChild(D);c=mxUtils.button(mxResources.get("add"),function(){var t=D.value;""!=t&&(t=App.pluginRegistry[t],null!=t&&0>mxUtils.indexOf(J,t)&&(J.push(t),q()))});c.className="geBtn";c.style.margin="0";c.disabled=!0;z.appendChild(c);mxEvent.addListener(D,"change",function(){c.disabled=""==D.value});if(ALLOW_CUSTOM_PLUGINS){var f=mxUtils.button(mxResources.get("custom")+"...",function(){var t=new FilenameDialog(b,"",mxResources.get("add"),function(v){b.hideDialog();if(null!=
-v&&0<v.length){v=v.split(";");for(var B=0;B<v.length;B++){var E=v[B],K=App.pluginRegistry[E];null!=K&&(E=K);0<E.length&&0>mxUtils.indexOf(J,E)&&J.push(E)}q()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(t.container,300,80,!0,!0);t.init()});f.className="geBtn";f.style.margin="0";z.appendChild(f)}x.appendChild(z)}var l=q;q=function(){l();u()};u();z=null;null!=k&&(z=mxUtils.button(mxResources.get("add"),function(){k(function(t){t&&0>mxUtils.indexOf(J,t)&&J.push(t);q()})}),
-z.className="geBtn");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";var n=mxUtils.button(g?mxResources.get("close"):mxResources.get("apply"),function(){H?(mxSettings.setPlugins(J),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});n.className="geBtn gePrimaryBtn";var r=document.createElement("div");r.style.marginTop="14px";r.style.textAlign="right";b.isOffline()||r.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));
+m.style.textAlign="right";b.editor.cancelFirst?(m.appendChild(u),m.appendChild(F)):(m.appendChild(F),m.appendChild(u))}g.appendChild(m);this.container=g},PluginsDialog=function(b,k,m,g){function q(){H=!0;if(0==I.length){F.innerText="";var t=document.createElement("div");t.className="geDialogHint";mxUtils.write(t,mxResources.get("noPlugins"));F.appendChild(t)}else for(F.innerText="",t=0;t<I.length;t++){var v=document.createElement("span");v.style.display="flex";v.style.alignItems="center";v.style.whiteSpace=
+"nowrap";v.style.minHeight="26px";var B=document.createElement("img");B.src=Editor.trashImage;B.style.cursor="pointer";B.style.marginRight="8px";B.style.width="16px";B.style.flexShrink="0";B.setAttribute("title",mxResources.get("delete"));v.appendChild(B);var E=document.createElement("span");E.style.overflow="hidden";E.style.textOverflow="ellipsis";mxUtils.write(E,I[t]);v.appendChild(E);F.appendChild(v);mxEvent.addListener(B,"click",function(K){return function(){b.confirm(mxResources.get("delete")+
+' "'+I[K]+'"?',function(){null!=m&&m(I[K]);I.splice(K,1);q()})}}(t))}}function u(){if(null!=D){D.innerText="";var t=document.createElement("option");t.value="";mxUtils.write(t,mxResources.get("chooseAnOption")||"Choose…");D.appendChild(t);for(t=0;t<App.publicPlugin.length;t++){var v=App.publicPlugin[t],B=App.pluginRegistry[v],E=document.createElement("option");mxUtils.write(E,v);E.value=v;if(null==B||0<=mxUtils.indexOf(I,B))E.disabled=!0;D.appendChild(E)}null!=c&&(c.disabled=!0)}}var x=document.createElement("div"),
+z=document.createElement("h3");mxUtils.write(z,mxResources.get("plugins"));x.appendChild(z);var F=document.createElement("div");F.className="geDialogSection";F.style.height="160px";F.style.overflow="auto";F.style.fontSize="13px";var I=mxSettings.getPlugins().slice(),H=!1;x.appendChild(F);q();H=!1;var D=null,c=null;if(null==k){z=document.createElement("div");z.style.display="flex";z.style.alignItems="center";z.style.gap="8px";z.style.marginTop="10px";D=document.createElement("select");D.style.flex=
+"1";D.style.minWidth="0";z.appendChild(D);c=mxUtils.button(mxResources.get("add"),function(){var t=D.value;""!=t&&(t=App.pluginRegistry[t],null!=t&&0>mxUtils.indexOf(I,t)&&(I.push(t),q()))});c.className="geBtn";c.style.margin="0";c.disabled=!0;z.appendChild(c);mxEvent.addListener(D,"change",function(){c.disabled=""==D.value});if(ALLOW_CUSTOM_PLUGINS){var f=mxUtils.button(mxResources.get("custom")+"...",function(){var t=new FilenameDialog(b,"",mxResources.get("add"),function(v){b.hideDialog();if(null!=
+v&&0<v.length){v=v.split(";");for(var B=0;B<v.length;B++){var E=v[B],K=App.pluginRegistry[E];null!=K&&(E=K);0<E.length&&0>mxUtils.indexOf(I,E)&&I.push(E)}q()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(t.container,300,80,!0,!0);t.init()});f.className="geBtn";f.style.margin="0";z.appendChild(f)}x.appendChild(z)}var l=q;q=function(){l();u()};u();z=null;null!=k&&(z=mxUtils.button(mxResources.get("add"),function(){k(function(t){t&&0>mxUtils.indexOf(I,t)&&I.push(t);q()})}),
+z.className="geBtn");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";var n=mxUtils.button(g?mxResources.get("close"):mxResources.get("apply"),function(){H?(mxSettings.setPlugins(I),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});n.className="geBtn gePrimaryBtn";var r=document.createElement("div");r.style.marginTop="14px";r.style.textAlign="right";b.isOffline()||r.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));
b.editor.cancelFirst?(g||r.appendChild(f),null!=z&&r.appendChild(z),r.appendChild(n)):(null!=z&&r.appendChild(z),r.appendChild(n),g||r.appendChild(f));x.appendChild(r);this.container=x},CropImageDialog=function(b,k,m,g){function q(){null!=f&&(D.style.overflow="hidden",f.maxFitScale=null,f.fit(8),f.center(),D.style.overflow="auto")}function u(L){var P=document.createElement("span");P.style.marginLeft="6px";P.style.fontSize="11px";mxUtils.write(P,L);M.appendChild(P);L=document.createElement("input");
-L.setAttribute("type","text");L.style.cssText="width:46px;margin:0 2px;text-align:right;";M.appendChild(L);return L}function x(){var L=t.geometry;U.value=Math.round(L.x);T.value=Math.round(L.y);V.value=Math.round(L.width);fa.value=Math.round(L.height)}function z(){if(null!=f){var L=parseFloat(U.value),P=parseFloat(T.value),Q=parseFloat(V.value),ba=parseFloat(fa.value);if(isFinite(L)&&isFinite(P)&&isFinite(Q)&&isFinite(ba)&&0<Q&&0<ba){var X=t.geometry.clone();X.x=L;X.y=P;X.width=Q;X.height=ba;f.model.setGeometry(t,
-X);f.model.setStyle(t,E+F());f.selectAll()}}}function F(){var L=d.checked,P=p.checked,Q=t.geometry;0>Q.x?(Q.width+=Q.x,Q.x=0):Q.x+Q.width>v&&(Q.width=v-Q.x,Q.x=Math.min(Q.x,v));0>Q.y?(Q.height+=Q.y,Q.y=0):Q.y+Q.height>B&&(Q.height=B-Q.y,Q.y=Math.min(Q.y,B));var ba=Q.x/v*100,X=100-(Q.x+Q.width)/v*100,Y=100-(Q.y+Q.height)/B*100;return"inset("+mxUtils.format(Q.y/B*100)+"% "+mxUtils.format(X)+"% "+mxUtils.format(Y)+"% "+mxUtils.format(ba)+"%"+(L?" round "+r+"%":P?" round 50%":"")+")"}function J(L){null!=
+L.setAttribute("type","text");L.style.cssText="width:46px;margin:0 2px;text-align:right;";M.appendChild(L);return L}function x(){var L=t.geometry;U.value=Math.round(L.x);T.value=Math.round(L.y);V.value=Math.round(L.width);fa.value=Math.round(L.height)}function z(){if(null!=f){var L=parseFloat(U.value),P=parseFloat(T.value),Q=parseFloat(V.value),ba=parseFloat(fa.value);if(isFinite(L)&&isFinite(P)&&isFinite(Q)&&isFinite(ba)&&0<Q&&0<ba){var W=t.geometry.clone();W.x=L;W.y=P;W.width=Q;W.height=ba;f.model.setGeometry(t,
+W);f.model.setStyle(t,E+F());f.selectAll()}}}function F(){var L=d.checked,P=p.checked,Q=t.geometry;0>Q.x?(Q.width+=Q.x,Q.x=0):Q.x+Q.width>v&&(Q.width=v-Q.x,Q.x=Math.min(Q.x,v));0>Q.y?(Q.height+=Q.y,Q.y=0):Q.y+Q.height>B&&(Q.height=B-Q.y,Q.y=Math.min(Q.y,B));var ba=Q.x/v*100,W=100-(Q.x+Q.width)/v*100,Y=100-(Q.y+Q.height)/B*100;return"inset("+mxUtils.format(Q.y/B*100)+"% "+mxUtils.format(W)+"% "+mxUtils.format(Y)+"% "+mxUtils.format(ba)+"%"+(L?" round "+r+"%":P?" round 50%":"")+")"}function I(L){null!=
f&&(!0!==L&&(f.model.setGeometry(t,n.clone()),r=5,G.value=r),f.model.setStyle(t,E+F()),f.selectAll(),x(),A.style.visibility=d.checked?"visible":"hidden")}var H=document.createElement("div");H.style.display="flex";H.style.flexDirection="column";H.style.height="100%";var D=document.createElement("div");D.style.flex="1";D.style.minHeight="0";D.style.overflow="auto";D.style.border="1px solid";H.appendChild(D);var c=k.replace(";base64",""),f=null,l=null,n=null,r=5,t=new mxCell("",new mxGeometry(0,0,1,
1),""),v=0,B=0,E="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+c+";clipPath=",K="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;opacity=40;image="+c+";",C="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;image="+c+";",R=new Image;R.onload=function(){function L(){f.model.setStyle(t,E+F());x()}v=R.naturalWidth;B=R.naturalHeight;n=new mxGeometry(.15*v,.15*B,.7*v,.7*B);t.geometry=
n.clone();f=new Graph(D);f.autoExtend=!1;f.autoScroll=!1;f.setGridEnabled(!1);f.setEnabled(!0);f.setPanning(!0);f.setConnectable(!1);f.getRubberband().setEnabled(!1);f.graphHandler.allowLivePreview=!1;f.centerZoom=!0;f.background="#ffffff";var P=f.createVertexHandler;f.createVertexHandler=function(){var aa=P.apply(this,arguments);aa.livePreview=!1;return aa};var Q=f.isCellSelectable;f.isCellSelectable=function(aa){return aa===t&&Q.apply(this,arguments)};l=new mxCell("",new mxGeometry(0,0,v,B),K);
-l.vertex=!0;f.addCell(l);if(null!=m)try{if("inset"==m.substring(0,5)){var ba=t.geometry,X=m.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),Y=parseFloat(X[0]),W=parseFloat(X[1]),ca=parseFloat(X[2]),S=parseFloat(X[3]);isFinite(Y)&&isFinite(W)&&isFinite(ca)&&isFinite(S)?(ba.x=S/100*v,ba.y=Y/100*B,ba.width=(100-W)/100*v-ba.x,ba.height=(100-ca)/100*B-ba.y,"round"==X[4]?"50%"==X[5]?p.setAttribute("checked","checked"):(r=parseInt(X[5]),G.value=r,d.setAttribute("checked","checked"),A.style.visibility="visible"):
+l.vertex=!0;f.addCell(l);if(null!=m)try{if("inset"==m.substring(0,5)){var ba=t.geometry,W=m.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),Y=parseFloat(W[0]),X=parseFloat(W[1]),ca=parseFloat(W[2]),S=parseFloat(W[3]);isFinite(Y)&&isFinite(X)&&isFinite(ca)&&isFinite(S)?(ba.x=S/100*v,ba.y=Y/100*B,ba.width=(100-X)/100*v-ba.x,ba.height=(100-ca)/100*B-ba.y,"round"==W[4]?"50%"==W[5]?p.setAttribute("checked","checked"):(r=parseInt(W[5]),G.value=r,d.setAttribute("checked","checked"),A.style.visibility="visible"):
y.setAttribute("checked","checked")):m=null}else m=null}catch(aa){}t.style=E+(m?m:F());t.vertex=!0;f.addCell(t);f.selectAll();f.addListener(mxEvent.CELLS_MOVED,L);f.addListener(mxEvent.CELLS_RESIZED,L);var Z=f.graphHandler.mouseUp,da=f.graphHandler.mouseDown;f.graphHandler.mouseUp=function(){Z.apply(this,arguments);null!=l&&f.model.setStyle(l,K)};f.graphHandler.mouseDown=function(){da.apply(this,arguments);null!=l&&f.model.setStyle(l,C)};f.dblClick=function(){};var N=f.getSelectionModel().changeSelection;
f.getSelectionModel().changeSelection=function(){N.call(this,[t],[t])};x();q()};R.onerror=function(){R.onload=null;R.src=Editor.errorImage};R.src=k;var M=document.createElement("div");M.style.display="flex";M.style.flexShrink="0";M.style.alignItems="center";M.style.justifyContent="center";M.style.paddingTop="6px";k=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=f&&f.zoomIn()});c=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=
f&&f.zoomOut()});var O=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){q()});M.appendChild(k);M.appendChild(c);M.appendChild(O);var U=u("X"),T=u("Y"),V=u("W"),fa=u("H");mxEvent.addListener(U,"change",z);mxEvent.addListener(T,"change",z);mxEvent.addListener(V,"change",z);mxEvent.addListener(fa,"change",z);H.appendChild(M);k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.display="flex";k.style.flexShrink="0";k.style.alignItems="center";k.style.justifyContent=
"center";var y=document.createElement("input");y.setAttribute("type","radio");y.setAttribute("id","croppingRect");y.setAttribute("name","croppingShape");y.setAttribute("checked","checked");y.style.margin="5px";k.appendChild(y);c=document.createElement("label");c.setAttribute("for","croppingRect");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rectangle"));k.appendChild(c);var d=document.createElement("input");d.setAttribute("type",
"radio");d.setAttribute("id","croppingRounded");d.setAttribute("name","croppingShape");d.style.margin="5px";k.appendChild(d);c=document.createElement("label");c.setAttribute("for","croppingRounded");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rounded"));k.appendChild(c);var p=document.createElement("input");p.setAttribute("type","radio");p.setAttribute("id","croppingEllipse");p.setAttribute("name","croppingShape");p.style.margin=
-"5px";k.appendChild(p);c=document.createElement("label");c.setAttribute("for","croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("ellipse"));k.appendChild(c);H.appendChild(k);mxEvent.addListener(y,"change",J);mxEvent.addListener(d,"change",J);mxEvent.addListener(p,"change",J);var A=document.createElement("div");A.style.textAlign="center";A.style.flexShrink="0";A.style.visibility="hidden";var G=document.createElement("input");
-G.setAttribute("type","range");G.setAttribute("min","1");G.setAttribute("max","49");G.setAttribute("value",r);G.setAttribute("title",mxResources.get("arcSize"));A.appendChild(G);H.appendChild(A);mxEvent.addListener(G,"change",function(){r=this.value;J(!0)});k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});k.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){g(F(),t.geometry.width,t.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";O=mxUtils.button(mxResources.get("reset"),
-function(){g(null,v,B);b.hideDialog()});O.className="geBtn";var I=document.createElement("div");I.style.flexShrink="0";I.style.marginTop="10px";I.style.whiteSpace="nowrap";I.style.display="flex";I.style.justifyContent="flex-end";b.editor.cancelFirst?(I.appendChild(k),I.appendChild(O),I.appendChild(c)):(I.appendChild(O),I.appendChild(c),I.appendChild(k));H.appendChild(I);this.container=H},EditGeometryDialog=function(b,k){function m(v,B){var E=document.createElement("div");E.className="geDialogInlineField";
+"5px";k.appendChild(p);c=document.createElement("label");c.setAttribute("for","croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("ellipse"));k.appendChild(c);H.appendChild(k);mxEvent.addListener(y,"change",I);mxEvent.addListener(d,"change",I);mxEvent.addListener(p,"change",I);var A=document.createElement("div");A.style.textAlign="center";A.style.flexShrink="0";A.style.visibility="hidden";var G=document.createElement("input");
+G.setAttribute("type","range");G.setAttribute("min","1");G.setAttribute("max","49");G.setAttribute("value",r);G.setAttribute("title",mxResources.get("arcSize"));A.appendChild(G);H.appendChild(A);mxEvent.addListener(G,"change",function(){r=this.value;I(!0)});k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});k.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){g(F(),t.geometry.width,t.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";O=mxUtils.button(mxResources.get("reset"),
+function(){g(null,v,B);b.hideDialog()});O.className="geBtn";var J=document.createElement("div");J.style.flexShrink="0";J.style.marginTop="10px";J.style.whiteSpace="nowrap";J.style.display="flex";J.style.justifyContent="flex-end";b.editor.cancelFirst?(J.appendChild(k),J.appendChild(O),J.appendChild(c)):(J.appendChild(O),J.appendChild(c),J.appendChild(k));H.appendChild(J);this.container=H},EditGeometryDialog=function(b,k){function m(v,B){var E=document.createElement("div");E.className="geDialogInlineField";
var K=document.createElement("label");mxUtils.write(K,v);E.appendChild(K);v=document.createElement("input");v.setAttribute("type","text");v.value=null!=B?B:"";E.appendChild(v);E.input=v;return E}var g=b.editor.graph,q=1==k.length?g.getCellGeometry(k[0]):null,u=document.createElement("div"),x=document.createElement("h3");mxUtils.write(x,mxResources.get("editGeometry"));u.appendChild(x);x=document.createElement("div");x.className="geDialogSection";var z=document.createElement("div");z.className="geDialogCheckRow";
-var F=document.createElement("input");F.setAttribute("type","checkbox");F.setAttribute("id","geEditGeoRelative");null!=q&&q.relative&&(F.setAttribute("checked","checked"),F.defaultChecked=!0);z.appendChild(F);var J=document.createElement("label");J.setAttribute("for","geEditGeoRelative");mxUtils.write(J,mxResources.get("relative"));z.appendChild(J);x.appendChild(z);z=document.createElement("div");z.className="geDialogInlineFields";J=m(mxResources.get("left"),null!=q?q.x:null);var H=J.input;z.appendChild(J);
-J=m(mxResources.get("top"),null!=q?q.y:null);var D=J.input;z.appendChild(J);x.appendChild(z);z=document.createElement("div");z.className="geDialogInlineFields";z.style.marginTop="6px";J=m(mxResources.get("dx"),null!=q&&null!=q.offset?q.offset.x:null);var c=J.input;z.appendChild(J);J=m(mxResources.get("dy"),null!=q&&null!=q.offset?q.offset.y:null);var f=J.input;z.appendChild(J);x.appendChild(z);u.appendChild(x);x=document.createElement("div");x.className="geDialogSection";z=document.createElement("div");
-z.className="geDialogInlineFields";J=m(mxResources.get("width"),null!=q?q.width:null);var l=J.input;z.appendChild(J);q=m(mxResources.get("height"),null!=q?q.height:null);var n=q.input;z.appendChild(q);x.appendChild(z);u.appendChild(x);q=document.createElement("div");q.className="geDialogSection";x=document.createElement("div");x.className="geDialogFormRow";z=document.createElement("span");z.className="geDialogFormLabel";mxUtils.write(z,mxResources.get("rotation")+":");x.appendChild(z);var r=document.createElement("input");
+var F=document.createElement("input");F.setAttribute("type","checkbox");F.setAttribute("id","geEditGeoRelative");null!=q&&q.relative&&(F.setAttribute("checked","checked"),F.defaultChecked=!0);z.appendChild(F);var I=document.createElement("label");I.setAttribute("for","geEditGeoRelative");mxUtils.write(I,mxResources.get("relative"));z.appendChild(I);x.appendChild(z);z=document.createElement("div");z.className="geDialogInlineFields";I=m(mxResources.get("left"),null!=q?q.x:null);var H=I.input;z.appendChild(I);
+I=m(mxResources.get("top"),null!=q?q.y:null);var D=I.input;z.appendChild(I);x.appendChild(z);z=document.createElement("div");z.className="geDialogInlineFields";z.style.marginTop="6px";I=m(mxResources.get("dx"),null!=q&&null!=q.offset?q.offset.x:null);var c=I.input;z.appendChild(I);I=m(mxResources.get("dy"),null!=q&&null!=q.offset?q.offset.y:null);var f=I.input;z.appendChild(I);x.appendChild(z);u.appendChild(x);x=document.createElement("div");x.className="geDialogSection";z=document.createElement("div");
+z.className="geDialogInlineFields";I=m(mxResources.get("width"),null!=q?q.width:null);var l=I.input;z.appendChild(I);q=m(mxResources.get("height"),null!=q?q.height:null);var n=q.input;z.appendChild(q);x.appendChild(z);u.appendChild(x);q=document.createElement("div");q.className="geDialogSection";x=document.createElement("div");x.className="geDialogFormRow";z=document.createElement("span");z.className="geDialogFormLabel";mxUtils.write(z,mxResources.get("rotation")+":");x.appendChild(z);var r=document.createElement("input");
r.setAttribute("type","text");r.value=1==k.length?mxUtils.getValue(g.getCellStyle(k[0]),mxConstants.STYLE_ROTATION,0):"";x.appendChild(r);q.appendChild(x);u.appendChild(q);this.init=function(){H.focus();H.select()};var t=function(){g.getModel().beginUpdate();try{for(var v=0;v<k.length;v++){var B=g.getCellGeometry(k[v]);null!=B&&(B=B.clone(),g.isCellMovable(k[v])&&(B.relative=F.checked,0<mxUtils.trim(H.value).length&&(B.x=Number(H.value)),0<mxUtils.trim(D.value).length&&(B.y=Number(D.value)),0<mxUtils.trim(c.value).length&&
(null==B.offset&&(B.offset=new mxPoint),B.offset.x=Number(c.value)),0<mxUtils.trim(f.value).length&&(null==B.offset&&(B.offset=new mxPoint),B.offset.y=Number(f.value))),g.isCellResizable(k[v])&&(0<mxUtils.trim(l.value).length&&(B.width=Number(l.value)),0<mxUtils.trim(n.value).length&&(B.height=Number(n.value))),g.getModel().setGeometry(k[v],B));0<mxUtils.trim(r.value).length&&g.setCellRotation(k[v],Number(r.value))}}finally{g.getModel().endUpdate()}};this.container=(new CustomDialog(b,u,t,null,mxResources.get("apply"))).container;
-mxEvent.addListener(this.container,"keypress",function(v){13==v.keyCode&&(t(),b.hideDialog())})},LibraryDialog=function(b,k,m,g,q,u,x){function z(T){for(T=document.elementFromPoint(T.clientX,T.clientY);null!=T&&T.parentNode!=t;)T=T.parentNode;var V=null;if(null!=T){var fa=t.firstChild;for(V=0;null!=fa&&fa!=T;)fa=fa.nextSibling,V++}return V}function F(T,V,fa,y,d,p,A,G,I){try{if(b.spinner.stop(),null==V||"image/"==V.substring(0,6))if(null==T&&null!=A||null==B[T]){var L=function(){S.innerText="";S.style.cursor=
-"pointer";S.style.whiteSpace="nowrap";S.style.textOverflow="ellipsis";mxUtils.write(S,null!=Z.title&&0<Z.title.length?Z.title:mxResources.get("untitled"));S.style.color=null==Z.title||0==Z.title.length?"#d0d0d0":""};t.style.backgroundImage="";v.style.display="none";var P=d,Q=p;if(d>b.maxImageSize||p>b.maxImageSize){var ba=Math.min(1,Math.min(b.maxImageSize/Math.max(1,d)),b.maxImageSize/Math.max(1,p));d*=ba;p*=ba}P>Q?(Q=Math.round(100*Q/P),P=100):(P=Math.round(100*P/Q),Q=100);var X=document.createElement("div");
-X.setAttribute("draggable","true");X.style.display="inline-block";X.style.position="relative";X.style.padding="0 12px";X.style.cursor="move";mxUtils.setPrefixedStyle(X.style,"transition","transform .1s ease-in-out");if(null!=T){var Y=document.createElement("img");Y.setAttribute("src",R.convert(T));Y.style.width=P+"px";Y.style.height=Q+"px";Y.style.margin="10px";Y.style.paddingBottom=Math.floor((100-Q)/2)+"px";Y.style.paddingLeft=Math.floor((100-P)/2)+"px";X.appendChild(Y)}else if(null!=A){var W=b.stringToCells("<"==
-A.xml.charAt(0)?A.xml:Graph.decompress(A.xml));0<W.length&&(b.sidebar.createThumb(W,100,100,X,null,!0,!1,null,null,c.shapeBackgroundColor),X.firstChild.style.display="inline-block",X.firstChild.style.cursor="")}var ca=document.createElement("img");ca.setAttribute("src",Editor.closeBlackImage);ca.setAttribute("border","0");ca.setAttribute("title",mxResources.get("delete"));ca.setAttribute("align","top");ca.style.paddingTop="4px";ca.style.position="absolute";ca.style.marginLeft="-12px";ca.style.zIndex=
-"1";ca.style.cursor="pointer";mxEvent.addListener(ca,"dragstart",function(ka){mxEvent.consume(ka)});(function(ka,ra,sa){mxEvent.addListener(ca,"click",function(ma){B[ra]=null;for(var wa=0;wa<D.length;wa++)if(null!=D[wa].data&&D[wa].data==ra||null!=D[wa].xml&&null!=sa&&D[wa].xml==sa.xml){D.splice(wa,1);break}X.parentNode.removeChild(ka);0==D.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",v.style.display="");mxEvent.consume(ma)});mxEvent.addListener(ca,"dblclick",function(ma){mxEvent.consume(ma)})})(X,
-T,A);X.appendChild(ca);X.style.marginBottom="30px";var S=document.createElement("div");S.style.position="absolute";S.style.boxSizing="border-box";S.style.bottom="-18px";S.style.left="10px";S.style.right="10px";S.style.backgroundColor="light-dark(#ffffff, transparent)";S.style.overflow="hidden";S.style.textAlign="center";S.setAttribute("title",mxResources.get("rename"));var Z=null;null!=T?(Z={data:T,w:d,h:p,title:I},null!=G&&(Z.aspect=G),B[T]=Y,D.push(Z)):null!=A&&(A.aspect="fixed",D.push(A),Z=A);
-mxEvent.addListener(S,"keydown",function(ka){13==ka.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(ka))});L();X.appendChild(S);mxEvent.addListener(S,"mousedown",function(ka){"true"!=S.getAttribute("contentEditable")&&mxEvent.consume(ka)});W=function(ka){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ra=new FilenameDialog(b,Z.title||"",mxResources.get("ok"),function(sa){null!=sa&&(Z.title=sa,L())},mxResources.get("enterValue"));b.showDialog(ra.container,
+mxEvent.addListener(this.container,"keypress",function(v){13==v.keyCode&&(t(),b.hideDialog())})},LibraryDialog=function(b,k,m,g,q,u,x){function z(T){for(T=document.elementFromPoint(T.clientX,T.clientY);null!=T&&T.parentNode!=t;)T=T.parentNode;var V=null;if(null!=T){var fa=t.firstChild;for(V=0;null!=fa&&fa!=T;)fa=fa.nextSibling,V++}return V}function F(T,V,fa,y,d,p,A,G,J){try{if(b.spinner.stop(),null==V||"image/"==V.substring(0,6))if(null==T&&null!=A||null==B[T]){var L=function(){S.innerText="";S.style.cursor=
+"pointer";S.style.whiteSpace="nowrap";S.style.textOverflow="ellipsis";mxUtils.write(S,null!=Z.title&&0<Z.title.length?Z.title:mxResources.get("untitled"));S.style.color=null==Z.title||0==Z.title.length?"#d0d0d0":""};t.style.backgroundImage="";v.style.display="none";var P=d,Q=p;if(d>b.maxImageSize||p>b.maxImageSize){var ba=Math.min(1,Math.min(b.maxImageSize/Math.max(1,d)),b.maxImageSize/Math.max(1,p));d*=ba;p*=ba}P>Q?(Q=Math.round(100*Q/P),P=100):(P=Math.round(100*P/Q),Q=100);var W=document.createElement("div");
+W.setAttribute("draggable","true");W.style.display="inline-block";W.style.position="relative";W.style.padding="0 12px";W.style.cursor="move";mxUtils.setPrefixedStyle(W.style,"transition","transform .1s ease-in-out");if(null!=T){var Y=document.createElement("img");Y.setAttribute("src",R.convert(T));Y.style.width=P+"px";Y.style.height=Q+"px";Y.style.margin="10px";Y.style.paddingBottom=Math.floor((100-Q)/2)+"px";Y.style.paddingLeft=Math.floor((100-P)/2)+"px";W.appendChild(Y)}else if(null!=A){var X=b.stringToCells("<"==
+A.xml.charAt(0)?A.xml:Graph.decompress(A.xml));0<X.length&&(b.sidebar.createThumb(X,100,100,W,null,!0,!1,null,null,c.shapeBackgroundColor),W.firstChild.style.display="inline-block",W.firstChild.style.cursor="")}var ca=document.createElement("img");ca.setAttribute("src",Editor.closeBlackImage);ca.setAttribute("border","0");ca.setAttribute("title",mxResources.get("delete"));ca.setAttribute("align","top");ca.style.paddingTop="4px";ca.style.position="absolute";ca.style.marginLeft="-12px";ca.style.zIndex=
+"1";ca.style.cursor="pointer";mxEvent.addListener(ca,"dragstart",function(ka){mxEvent.consume(ka)});(function(ka,ra,sa){mxEvent.addListener(ca,"click",function(ma){B[ra]=null;for(var wa=0;wa<D.length;wa++)if(null!=D[wa].data&&D[wa].data==ra||null!=D[wa].xml&&null!=sa&&D[wa].xml==sa.xml){D.splice(wa,1);break}W.parentNode.removeChild(ka);0==D.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",v.style.display="");mxEvent.consume(ma)});mxEvent.addListener(ca,"dblclick",function(ma){mxEvent.consume(ma)})})(W,
+T,A);W.appendChild(ca);W.style.marginBottom="30px";var S=document.createElement("div");S.style.position="absolute";S.style.boxSizing="border-box";S.style.bottom="-18px";S.style.left="10px";S.style.right="10px";S.style.backgroundColor="light-dark(#ffffff, transparent)";S.style.overflow="hidden";S.style.textAlign="center";S.setAttribute("title",mxResources.get("rename"));var Z=null;null!=T?(Z={data:T,w:d,h:p,title:J},null!=G&&(Z.aspect=G),B[T]=Y,D.push(Z)):null!=A&&(A.aspect="fixed",D.push(A),Z=A);
+mxEvent.addListener(S,"keydown",function(ka){13==ka.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(ka))});L();W.appendChild(S);mxEvent.addListener(S,"mousedown",function(ka){"true"!=S.getAttribute("contentEditable")&&mxEvent.consume(ka)});X=function(ka){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ra=new FilenameDialog(b,Z.title||"",mxResources.get("ok"),function(sa){null!=sa&&(Z.title=sa,L())},mxResources.get("enterValue"));b.showDialog(ra.container,
300,80,!0,!0);ra.init();mxEvent.consume(ka)}else if("true"!=S.getAttribute("contentEditable")){null!=C&&(C(),C=null);if(null==Z.title||0==Z.title.length)S.innerText="";S.style.textOverflow="";S.style.whiteSpace="";S.style.cursor="text";S.style.color="";S.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(S.style,"user-select","text");S.focus();document.execCommand("selectAll",!1,null);C=function(){S.removeAttribute("contentEditable");S.style.cursor="pointer";Z.title=mxUtils.getTextContent(S);
-L()};mxEvent.consume(ka)}};mxEvent.addListener(S,"click",W);mxEvent.addListener(X,"dblclick",W);t.appendChild(X);mxEvent.addListener(X,"dragstart",function(ka){null==C&&(null==T&&null!=A&&(ca.style.visibility="hidden",S.style.visibility="hidden"),mxClient.IS_FF&&null!=A.xml&&ka.dataTransfer.setData("Text",A.xml),E=z(ka),mxClient.IS_GC&&(X.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(X.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(X,30);ca.style.visibility="";
-S.style.visibility=""},0))});mxEvent.addListener(X,"dragend",function(ka){"hidden"==ca.style.visibility&&(ca.style.visibility="",S.style.visibility="");E=null;mxUtils.setOpacity(X,100);mxUtils.setPrefixedStyle(X.style,"transform",null)})}else M||(M=!0,b.handleError({message:mxResources.get("fileExists")}));else{d=!1;try{if(P=mxUtils.parseXml(T),"mxlibrary"==P.documentElement.nodeName){Q=JSON.parse(mxUtils.getTextContent(P.documentElement));if(null!=Q&&0<Q.length)for(var da=0;da<Q.length;da++)null!=
-Q[da].xml?F(null,null,0,0,0,0,Q[da]):F(Q[da].data,null,0,0,Q[da].w,Q[da].h,null,"fixed",Q[da].title);d=!0}else if("mxfile"==P.documentElement.nodeName){var N=P.documentElement.getElementsByTagName("diagram");for(da=0;da<N.length;da++){var aa=Editor.getDiagramNodeXml(N[da]);W=b.stringToCells(aa);if(0<W.length){var ea=b.editor.graph.getBoundingBoxFromGeometry(W);null!=ea&&F(null,null,0,0,0,0,{xml:aa,w:ea.width,h:ea.height})}}d=!0}}catch(ka){null!=window.console&&console.error("Error in library dialog: "+
-ka)}d||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ka){null!=window.console&&console.log("Error in library dialog: "+ka)}return null}function J(T){T.dataTransfer.dropEffect=null!=E?"move":"copy";T.stopPropagation();T.preventDefault()}function H(T){T.stopPropagation();T.preventDefault();M=!1;K=z(T);if(null!=E)null!=K&&K<t.children.length?(D.splice(K>E?K-1:K,0,D.splice(E,1)[0]),t.insertBefore(t.children[E],t.children[K])):(D.push(D.splice(E,1)[0]),t.appendChild(t.children[E]));
+L()};mxEvent.consume(ka)}};mxEvent.addListener(S,"click",X);mxEvent.addListener(W,"dblclick",X);t.appendChild(W);mxEvent.addListener(W,"dragstart",function(ka){null==C&&(null==T&&null!=A&&(ca.style.visibility="hidden",S.style.visibility="hidden"),mxClient.IS_FF&&null!=A.xml&&ka.dataTransfer.setData("Text",A.xml),E=z(ka),mxClient.IS_GC&&(W.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(W.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(W,30);ca.style.visibility="";
+S.style.visibility=""},0))});mxEvent.addListener(W,"dragend",function(ka){"hidden"==ca.style.visibility&&(ca.style.visibility="",S.style.visibility="");E=null;mxUtils.setOpacity(W,100);mxUtils.setPrefixedStyle(W.style,"transform",null)})}else M||(M=!0,b.handleError({message:mxResources.get("fileExists")}));else{d=!1;try{if(P=mxUtils.parseXml(T),"mxlibrary"==P.documentElement.nodeName){Q=JSON.parse(mxUtils.getTextContent(P.documentElement));if(null!=Q&&0<Q.length)for(var da=0;da<Q.length;da++)null!=
+Q[da].xml?F(null,null,0,0,0,0,Q[da]):F(Q[da].data,null,0,0,Q[da].w,Q[da].h,null,"fixed",Q[da].title);d=!0}else if("mxfile"==P.documentElement.nodeName){var N=P.documentElement.getElementsByTagName("diagram");for(da=0;da<N.length;da++){var aa=Editor.getDiagramNodeXml(N[da]);X=b.stringToCells(aa);if(0<X.length){var ea=b.editor.graph.getBoundingBoxFromGeometry(X);null!=ea&&F(null,null,0,0,0,0,{xml:aa,w:ea.width,h:ea.height})}}d=!0}}catch(ka){null!=window.console&&console.error("Error in library dialog: "+
+ka)}d||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ka){null!=window.console&&console.log("Error in library dialog: "+ka)}return null}function I(T){T.dataTransfer.dropEffect=null!=E?"move":"copy";T.stopPropagation();T.preventDefault()}function H(T){T.stopPropagation();T.preventDefault();M=!1;K=z(T);if(null!=E)null!=K&&K<t.children.length?(D.splice(K>E?K-1:K,0,D.splice(E,1)[0]),t.insertBefore(t.children[E],t.children[K])):(D.push(D.splice(E,1)[0]),t.appendChild(t.children[E]));
else if(0<T.dataTransfer.files.length)b.importFiles(T.dataTransfer.files,0,0,b.maxImageSize,O(T));else if(0<=mxUtils.indexOf(T.dataTransfer.types,"text/uri-list")){var V=decodeURIComponent(T.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(V)||/(\.png)($|\?)/i.test(V)||/(\.gif)($|\?)/i.test(V)||/(\.svg)($|\?)/i.test(V))&&b.loadImage(V,function(fa){F(V,null,0,0,fa.width,fa.height);t.scrollTop=t.scrollHeight})}T.stopPropagation();T.preventDefault()}var D=[],c=b.editor.graph;m=document.createElement("div");
m.style.height="100%";m.style.display="flex";m.style.flexDirection="column";var f=document.createElement("div");f.className="geDialogSection";f.style.flexShrink="0";var l=document.createElement("div");l.className="geDialogFormRow";var n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("filename")+":");l.appendChild(n);null==k&&(k=b.defaultLibraryName+".xml");var r=document.createElement("input");r.setAttribute("type","text");r.setAttribute("value",k);
null==q||q.isRenamable()||r.setAttribute("disabled","true");l.appendChild(r);f.appendChild(l);Editor.enableUncompressedLibraries&&(k=document.createElement("div"),k.className="geDialogCheckRow",l=document.createElement("input"),l.setAttribute("type","checkbox"),l.setAttribute("id","geLibCompressed"),k.appendChild(l),l=document.createElement("label"),l.setAttribute("for","geLibCompressed"),mxUtils.write(l,mxResources.get("compressed")),k.appendChild(l),f.appendChild(k));m.appendChild(f);this.init=
function(){if(null==q||q.isRenamable())r.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?r.select():document.execCommand("selectAll",!1,null)};var t=document.createElement("div");t.style.border="light-dark(1px solid rgba(0, 0, 0, 0.15), 1px solid rgba(255, 255, 255, 0.15))";t.style.borderRadius="8px";t.style.marginTop="10px";t.style.overflow="auto";t.style.flex="1";t.style.minHeight="0";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==D.length&&Graph.fileSupport&&
(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var v=document.createElement("div");v.style.position="absolute";v.style.left="0";v.style.right="0";v.style.top="260px";v.style.textAlign="center";v.style.fontSize="22px";v.style.color="#a0c3ff";mxUtils.write(v,mxResources.get("dragImagesHere"));m.appendChild(v);var B={},E=null,K=null,C=null;f=function(T){"true"!=mxEvent.getSource(T).getAttribute("contentEditable")&&null!=C&&(C(),C=null,mxEvent.consume(T))};mxEvent.addListener(t,"mousedown",
-f);mxEvent.addListener(t,"pointerdown",f);mxEvent.addListener(t,"touchstart",f);var R=new mxUrlConverter,M=!1;if(null!=g)for(f=0;f<g.length;f++)k=g[f],F(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(t,"dragleave",function(T){v.style.cursor="";for(var V=mxEvent.getSource(T);null!=V;){if(V==t||V==v){T.stopPropagation();T.preventDefault();break}V=V.parentNode}});var O=function(T){return function(V,fa,y,d,p,A,G,I,L){null!=L&&EditorUi.isVisioFilename(L.name)?b.importVisio(L,mxUtils.bind(this,
+f);mxEvent.addListener(t,"pointerdown",f);mxEvent.addListener(t,"touchstart",f);var R=new mxUrlConverter,M=!1;if(null!=g)for(f=0;f<g.length;f++)k=g[f],F(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(t,"dragleave",function(T){v.style.cursor="";for(var V=mxEvent.getSource(T);null!=V;){if(V==t||V==v){T.stopPropagation();T.preventDefault();break}V=V.parentNode}});var O=function(T){return function(V,fa,y,d,p,A,G,J,L){null!=L&&EditorUi.isVisioFilename(L.name)?b.importVisio(L,mxUtils.bind(this,
function(P){F(P,fa,y,d,p,A,G,"fixed",mxEvent.isAltDown(T)?null:G.substring(0,G.lastIndexOf(".")).replace(/_/g," "))})):null!=L&&b.isGliffyData(V,L.name)?b.importGliffy(V,mxUtils.bind(this,function(P){b.spinner.stop();F(P,fa,y,d,p,A,G,"fixed",mxEvent.isAltDown(T)?null:G.substring(0,G.lastIndexOf(".")).replace(/_/g," "));t.scrollTop=t.scrollHeight}),mxUtils.bind(this,function(P){b.spinner.stop();b.showError(mxResources.get("error"),null!=P&&413==P.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))}),
-L.name):(F(V,fa,y,d,p,A,G,"fixed",mxEvent.isAltDown(T)?null:G.substring(0,G.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",J);mxEvent.addListener(t,"drop",H);mxEvent.addListener(v,"dragover",J);mxEvent.addListener(v,"drop",H);m.appendChild(t);g=document.createElement("div");g.style.textAlign="right";g.style.marginTop="14px";g.style.flexShrink="0";f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});f.setAttribute("id","btnCancel");
+L.name):(F(V,fa,y,d,p,A,G,"fixed",mxEvent.isAltDown(T)?null:G.substring(0,G.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",I);mxEvent.addListener(t,"drop",H);mxEvent.addListener(v,"dragover",I);mxEvent.addListener(v,"drop",H);m.appendChild(t);g=document.createElement("div");g.style.textAlign="right";g.style.marginTop="14px";g.style.flexShrink="0";f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});f.setAttribute("id","btnCancel");
f.className="geBtn";b.editor.cancelFirst&&g.appendChild(f);"draw.io"!=b.getServiceName()||null==q||q.constructor!=DriveLibrary&&q.constructor!=GitHubLibrary||(k=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(q,function(T){if(null!=T){var V=b.getSearch("create title mode url drive splash state clibs ui".split(" "));V+=(0==V.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(T);T=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+V,null,null,null,null,"Check out the library I made using @drawio");
b.showDialog(T.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));T.init()}else q.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(q.getId(),q)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),k.className="geBtn",g.appendChild(k));k=mxUtils.button(mxResources.get("export"),function(){var T=
b.createLibraryDataFromImages(D),V=r.value;/(\.xml)$/i.test(V)||(V+=".xml");b.isLocalFileSave()?b.saveLocalFile(T,V,"text/xml",null,null,null!=x?x:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(V)+"&format=xml&xml="+encodeURIComponent(T))).simulate(document,"_blank")});k.setAttribute("id","btnDownload");k.className="geBtn";g.appendChild(k);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var U=document.createElement("input");U.setAttribute("multiple","multiple");U.setAttribute("type",
-"file");mxEvent.addListener(U,"change",function(T){M=!1;b.importFiles(U.files,0,0,b.maxImageSize,function(V,fa,y,d,p,A,G,I,L){null!=U.files&&(O(T)(V,fa,y,d,p,A,G,I,L),U.type="",U.type="file",U.value="")});t.scrollTop=t.scrollHeight});U.style.display="none";document.body.appendChild(U);b.libDlgFileInputElt=U}k=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null);b.libDlgFileInputElt.click()});k.setAttribute("id","btnAddImage");k.className="geBtn";g.appendChild(k)}k=mxUtils.button(mxResources.get("addImages"),
+"file");mxEvent.addListener(U,"change",function(T){M=!1;b.importFiles(U.files,0,0,b.maxImageSize,function(V,fa,y,d,p,A,G,J,L){null!=U.files&&(O(T)(V,fa,y,d,p,A,G,J,L),U.type="",U.type="file",U.value="")});t.scrollTop=t.scrollHeight});U.style.display="none";document.body.appendChild(U);b.libDlgFileInputElt=U}k=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null);b.libDlgFileInputElt.click()});k.setAttribute("id","btnAddImage");k.className="geBtn";g.appendChild(k)}k=mxUtils.button(mxResources.get("addImages"),
function(){null!=C&&(C(),C=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(T,V,fa){M=!1;if(null!=T){if("data:image/"==T.substring(0,11)){var y=T.indexOf(",");0<y&&(T=T.substring(0,y)+";base64,"+T.substring(y+1))}F(T,null,0,0,V,fa);t.scrollTop=t.scrollHeight}})});k.setAttribute("id","btnAddImageUrl");k.className="geBtn";g.appendChild(k);this.saveBtnClickHandler=function(T,V,fa,y){b.saveLibrary(T,V,fa,y)};k=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=
C&&(C(),C=null);this.saveBtnClickHandler(r.value,D,q,u)}));k.setAttribute("id","btnSave");k.className="geBtn gePrimaryBtn";g.appendChild(k);b.editor.cancelFirst||g.appendChild(f);m.appendChild(g);this.container=m},EditShapeDialog=function(b,k,m){var g=document.createElement("div");g.style.position="absolute";g.style.left="30px";g.style.right="30px";g.style.top="30px";g.style.bottom="30px";var q=document.createElement("div");q.style.position="absolute";q.style.top="0px";mxUtils.write(q,m);g.appendChild(q);
m=document.createElement("div");m.style.position="absolute";m.style.width="100%";m.style.display="flex";m.style.alignItems="stretch";m.style.top="24px";m.style.bottom="50px";var u=document.createElement("textarea");u.style.outline="none";u.style.resize="horizontal";u.style.width="430px";u.style.maxWidth="calc(100% - 100px)";u.style.flexShrink="0";u.style.borderRadius="4px";u.style.marginRight="4px";m.appendChild(u);var x=document.createElement("div");x.style.borderWidth="1px";x.style.borderStyle=
-"solid";x.style.padding="20px";x.style.flexGrow="1";x.style.borderRadius="4px";mxEvent.disableContextMenu(x);m.appendChild(x);var z=new Graph(x);z.setEnabled(!1);var F=b.editor.graph.cloneCell(k);z.addCells([F]);q=z.view.getState(F);var J="";null!=q.shape&&null!=q.shape.stencil&&(J=mxUtils.getPrettyXml(q.shape.stencil.desc));mxUtils.write(u,J||"");g.appendChild(m);m=document.createElement("div");m.style.position="absolute";m.style.display="flex";m.style.alignItems="center";m.style.justifyContent=
+"solid";x.style.padding="20px";x.style.flexGrow="1";x.style.borderRadius="4px";mxEvent.disableContextMenu(x);m.appendChild(x);var z=new Graph(x);z.setEnabled(!1);var F=b.editor.graph.cloneCell(k);z.addCells([F]);q=z.view.getState(F);var I="";null!=q.shape&&null!=q.shape.stencil&&(I=mxUtils.getPrettyXml(q.shape.stencil.desc));mxUtils.write(u,I||"");g.appendChild(m);m=document.createElement("div");m.style.position="absolute";m.style.display="flex";m.style.alignItems="center";m.style.justifyContent=
"end";m.style.bottom="6px";m.style.height="30px";m.style.width="100%";b.isOffline()||m.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&m.appendChild(q);var H=function(c,f,l){var n=u.value,r=mxUtils.parseXml(n);n=mxUtils.getPrettyXml(r.documentElement);r=r.documentElement.getElementsByTagName("parsererror");if(null!=r&&0<r.length)b.showError(mxResources.get("error"),
-mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(l&&b.hideDialog(),r=!c.model.contains(f),!l||r||n!=J){n=Graph.compress(n);c.getModel().beginUpdate();try{if(r){var t=b.editor.graph.getFreeInsertPoint();f.geometry.x=t.x;f.geometry.y=t.y;c.addCell(f)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+n+")",[f])}catch(v){throw v;}finally{c.getModel().endUpdate()}r&&(c.setSelectionCell(f),c.scrollCellToVisible(f))}},D=mxUtils.button(mxResources.get("preview"),function(){H(z,
-F,!1);z.fit()});D.className="geBtn";m.appendChild(D);D=mxUtils.button(mxResources.get("apply"),function(){H(b.editor.graph,k,!0)});D.className="geBtn gePrimaryBtn";m.appendChild(D);b.editor.cancelFirst||m.appendChild(q);g.appendChild(m);this.init=function(){u.focus();u.scrollTop=0;z.fit();x.style.overflow="auto";z.fit()};this.container=g},CustomDialog=function(b,k,m,g,q,u,x,z,F,J,H,D){var c=document.createElement("div");c.style.display="flex";c.style.flexDirection="column";c.style.minHeight="0";c.style.paddingBottom=
+mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(l&&b.hideDialog(),r=!c.model.contains(f),!l||r||n!=I){n=Graph.compress(n);c.getModel().beginUpdate();try{if(r){var t=b.editor.graph.getFreeInsertPoint();f.geometry.x=t.x;f.geometry.y=t.y;c.addCell(f)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+n+")",[f])}catch(v){throw v;}finally{c.getModel().endUpdate()}r&&(c.setSelectionCell(f),c.scrollCellToVisible(f))}},D=mxUtils.button(mxResources.get("preview"),function(){H(z,
+F,!1);z.fit()});D.className="geBtn";m.appendChild(D);D=mxUtils.button(mxResources.get("apply"),function(){H(b.editor.graph,k,!0)});D.className="geBtn gePrimaryBtn";m.appendChild(D);b.editor.cancelFirst||m.appendChild(q);g.appendChild(m);this.init=function(){u.focus();u.scrollTop=0;z.fit();x.style.overflow="auto";z.fit()};this.container=g},CustomDialog=function(b,k,m,g,q,u,x,z,F,I,H,D){var c=document.createElement("div");c.style.display="flex";c.style.flexDirection="column";c.style.minHeight="0";c.style.paddingBottom=
"10px";var f=document.createElement("div");f.style.flex="1 1 auto";f.style.minHeight="0";f.style.overflowY="auto";f.appendChild(k);c.appendChild(f);var l=document.createElement("div");l.style.flex="0 0 auto";l.style.marginTop=null!=D?D:"34px";l.style.textAlign="right";b.isOffline()||null==u||l.appendChild(b.createHelpIcon(u));null!=x&&l.appendChild(x);k=mxUtils.button(F||mxResources.get("cancel"),function(){b.hideDialog();null!=g&&g()});k.className="geBtn";z&&(k.style.display="none");b.editor.cancelFirst&&
-l.appendChild(k);q=mxUtils.button(q||mxResources.get("ok"),mxUtils.bind(this,function(){J||b.hideDialog(null,null,this.container);if(null!=m){var n=m();if("string"===typeof n){b.showError(mxResources.get("error"),n);return}}J&&b.hideDialog(null,null,this.container)}));l.appendChild(q);q.className="geBtn gePrimaryBtn";b.editor.cancelFirst||l.appendChild(k);if(null!=H)for(z=0;z<H.length;z++)(function(n,r,t){n=mxUtils.button(n,function(v){r(v)});null!=t&&n.setAttribute("title",t);n.className="geBtn";
+l.appendChild(k);q=mxUtils.button(q||mxResources.get("ok"),mxUtils.bind(this,function(){I||b.hideDialog(null,null,this.container);if(null!=m){var n=m();if("string"===typeof n){b.showError(mxResources.get("error"),n);return}}I&&b.hideDialog(null,null,this.container)}));l.appendChild(q);q.className="geBtn gePrimaryBtn";b.editor.cancelFirst||l.appendChild(k);if(null!=H)for(z=0;z<H.length;z++)(function(n,r,t){n=mxUtils.button(n,function(v){r(v)});null!=t&&n.setAttribute("title",t);n.className="geBtn";
l.appendChild(n)})(H[z][0],H[z][1],H[z][2]);c.appendChild(l);this.cancelBtn=k;this.okButton=q;this.container=c},BtnDialog=function(b,k,m,g){var q=document.createElement("div");q.style.textAlign="center";var u=document.createElement("p");u.style.fontSize="16pt";u.style.padding="0px";u.style.margin="0px";u.style.color="gray";mxUtils.write(u,mxResources.get("done"));var x="Unknown",z=document.createElement("img");z.setAttribute("border","0");z.setAttribute("align","absmiddle");z.style.marginRight="10px";
k==b.drive?(x=mxResources.get("googleDrive"),z.src=IMAGE_PATH+"/google-drive-logo-white.svg"):k==b.dropbox?(x=mxResources.get("dropbox"),z.src=IMAGE_PATH+"/dropbox-logo-white.svg"):k==b.oneDrive?(x=mxResources.get("oneDrive"),z.src=IMAGE_PATH+"/onedrive-logo-white.svg"):k==b.gitHub?(x=mxResources.get("github"),z.src=IMAGE_PATH+"/github-logo-white.svg"):k==b.gitLab?(x=mxResources.get("gitlab"),z.src=IMAGE_PATH+"/gitlab-logo.svg"):k==b.trello&&(x=mxResources.get("trello"),z.src=IMAGE_PATH+"/trello-logo-white.svg");
b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[x],"You are now authorized in {1}"));m=mxUtils.button(m,g);m.insertBefore(z,m.firstChild);m.style.marginTop="6px";m.className="geBigButton";m.style.fontSize="18px";m.style.padding="14px";q.appendChild(u);q.appendChild(b);q.appendChild(m);this.container=q},FontDialog=function(b,k,m,g,q){function u(E,K,C){var R=document.createElement("div");R.className="geDialogFormRow";R.style.paddingLeft="24px";var M=document.createElement("span");
-M.className="geDialogFormLabel";mxUtils.write(M,K+":");R.appendChild(M);R.appendChild(C);E.appendChild(R);return R}function x(E){this.style.border="";13==E.keyCode&&B.click()}var z=document.createElement("div"),F=document.createElement("h3");mxUtils.write(F,mxResources.get("font"));z.appendChild(F);F=document.createElement("div");F.className="geDialogSection";var J=b.addCheckbox(F,mxResources.get("sysFonts"),!1,null,null,null,!0,"current-fontdialog",!0),H=document.createElement("input");H.setAttribute("type",
+M.className="geDialogFormLabel";mxUtils.write(M,K+":");R.appendChild(M);R.appendChild(C);E.appendChild(R);return R}function x(E){this.style.border="";13==E.keyCode&&B.click()}var z=document.createElement("div"),F=document.createElement("h3");mxUtils.write(F,mxResources.get("font"));z.appendChild(F);F=document.createElement("div");F.className="geDialogSection";var I=b.addCheckbox(F,mxResources.get("sysFonts"),!1,null,null,null,!0,"current-fontdialog",!0),H=document.createElement("input");H.setAttribute("type",
"text");"s"==g&&H.setAttribute("value",k);H.className="dlg_fontName_s";var D=null;if(null!=Editor.localFonts){D=document.createElement("datalist");D.id="fontdialog-localfonts";for(var c=0;c<Editor.localFonts.length;c++){var f=document.createElement("option");f.value=Editor.localFonts[c];D.appendChild(f)}H.setAttribute("list","fontdialog-localfonts")}c=u(F,mxResources.get("fontname"),H);null!=D&&c.appendChild(D);z.appendChild(F);F=document.createElement("div");F.className="geDialogSection";var l=b.addCheckbox(F,
mxResources.get("googleFonts"),!1,null,null,null,!0,"current-fontdialog",!0);b.isOffline()&&!EditorUi.isElectronApp||l.checkRow.appendChild(b.createHelpIcon("https://fonts.google.com/"));var n=document.createElement("input");n.setAttribute("type","text");"g"==g&&n.setAttribute("value",k);n.className="dlg_fontName_g";u(F,mxResources.get("fontname"),n);"0"!=urlParams.isGoogleFontsEnabled&&z.appendChild(F);F=document.createElement("div");F.className="geDialogSection";var r=b.addCheckbox(F,mxResources.get("webfonts"),
!1,null,null,null,!0,"current-fontdialog",!0),t=document.createElement("input");t.setAttribute("type","text");"w"==g&&(Editor.enableWebFonts?t.setAttribute("value",k):H.setAttribute("value",k));t.className="dlg_fontName_w";u(F,mxResources.get("fontname"),t);var v=document.createElement("input");v.setAttribute("type","text");v.setAttribute("value",m||"");v.className="dlg_fontUrl";u(F,mxResources.get("fontUrl"),v);Editor.enableWebFonts&&z.appendChild(F);this.init=function(){var E=H;"g"==g?E=n:"w"==
g&&Editor.enableWebFonts&&(E=t);E.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?E.select():document.execCommand("selectAll",!1,null)};z.style.paddingBottom="10px";k=document.createElement("div");k.style.marginTop="34px";k.style.textAlign="right";k.style.whiteSpace="nowrap";b.isOffline()||k.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));m=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();q()});m.className="geBtn";var B=mxUtils.button(mxResources.get("apply"),
-function(){if(J.checked){var E=H.value;var K="s"}else if(l.checked){E=n.value;var C=Editor.GOOGLE_FONTS+encodeURIComponent(E).replace(/%20/g,"+");K="g"}else r.checked&&(E=t.value,C=v.value,K="w");var R=E;var M=C,O=K,U=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,T=z.querySelector(".dlg_fontName_"+O);null==T||null!=R&&0!=R.length?(T=z.querySelector(".dlg_fontUrl"),null==T||"w"!=O||U.test(M)?R=!0:(T.style.border="1px solid red",R=!1)):(T.style.border="1px solid red",
-R=!1);R&&(q(E,C,K),b.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(H,"keypress",x);mxEvent.addListener(n,"keypress",x);mxEvent.addListener(t,"keypress",x);mxEvent.addListener(v,"keypress",x);mxEvent.addListener(H,"focus",function(){J.setAttribute("checked","checked");J.checked=!0});mxEvent.addListener(n,"focus",function(){l.setAttribute("checked","checked");l.checked=!0});mxEvent.addListener(t,"focus",function(){r.setAttribute("checked","checked");r.checked=!0});mxEvent.addListener(v,
+function(){if(I.checked){var E=H.value;var K="s"}else if(l.checked){E=n.value;var C=Editor.GOOGLE_FONTS+encodeURIComponent(E).replace(/%20/g,"+");K="g"}else r.checked&&(E=t.value,C=v.value,K="w");var R=E;var M=C,O=K,U=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,T=z.querySelector(".dlg_fontName_"+O);null==T||null!=R&&0!=R.length?(T=z.querySelector(".dlg_fontUrl"),null==T||"w"!=O||U.test(M)?R=!0:(T.style.border="1px solid red",R=!1)):(T.style.border="1px solid red",
+R=!1);R&&(q(E,C,K),b.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(H,"keypress",x);mxEvent.addListener(n,"keypress",x);mxEvent.addListener(t,"keypress",x);mxEvent.addListener(v,"keypress",x);mxEvent.addListener(H,"focus",function(){I.setAttribute("checked","checked");I.checked=!0});mxEvent.addListener(n,"focus",function(){l.setAttribute("checked","checked");l.checked=!0});mxEvent.addListener(t,"focus",function(){r.setAttribute("checked","checked");r.checked=!0});mxEvent.addListener(v,
"focus",function(){r.setAttribute("checked","checked");r.checked=!0});b.editor.cancelFirst?(k.appendChild(m),k.appendChild(B)):(k.appendChild(B),k.appendChild(m));z.appendChild(k);this.container=z};
function AspectDialog(b,k,m,g,q){this.aspect={pageId:k||(b.pages?b.pages[0].getId():null),layerIds:m||[]};k=document.createElement("div");var u=document.createElement("h5");u.style.margin="0 0 10px";mxUtils.write(u,mxResources.get("pages"));k.appendChild(u);m=document.createElement("div");m.className="geAspectDlgList";k.appendChild(m);u=document.createElement("h5");u.style.margin="0 0 10px";mxUtils.write(u,mxResources.get("layers"));k.appendChild(u);u=document.createElement("div");u.className="geAspectDlgList";
k.appendChild(u);this.pagesContainer=m;this.layersContainer=u;this.ui=b;m=document.createElement("div");m.style.marginTop="16px";m.style.textAlign="center";u=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=q&&q()});u.className="geBtn";b.editor.cancelFirst&&m.appendChild(u);var x=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();g({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));m.appendChild(x);x.className="geBtn gePrimaryBtn";
@@ -13635,9 +13645,9 @@ this.selectedPage=b;g.className+=" geAspectDlgListItemSelected";this.layersConta
AspectDialog.prototype.createLayerItem=function(b,k,m,g){k=m.convertValueToString(b)||mxResources.get("background")||"Background";var q=document.createElement("div");q.setAttribute("data-layer-id",b.id);q.className="geAspectDlgListItem";q.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(k)+"</div>";this.layersContainer.appendChild(q);this.createViewer(q.childNodes[0],g,b.id);g=mxUtils.bind(this,function(){0<=q.className.indexOf("geAspectDlgListItemSelected")?
(q.className="geAspectDlgListItem",delete this.selectedLayers[b.id],mxUtils.isEmptyObject(this.selectedLayers)&&this.okBtn.setAttribute("disabled","disabled")):(q.className+=" geAspectDlgListItemSelected",this.selectedLayers[b.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(q,"click",g);-1!=this.aspect.layerIds.indexOf(b.id)&&g()};
var FilePropertiesDialog=function(b,k){function m(R){var M=H;H=function(O,U){try{R(function(){M(O,U)},U)}catch(T){U(T)}}}function g(R,M,O){var U=document.createElement("div");U.className="geDialogFormRow";var T=document.createElement("span");T.className="geDialogFormLabel";mxUtils.write(T,M+":");U.appendChild(T);U.appendChild(O);R.appendChild(U);return U}var q=document.createElement("div"),u=document.createElement("h3");mxUtils.write(u,mxResources.get("properties"));q.appendChild(u);var x=b.getCurrentFile(),
-z=null!=x&&null!=x.getTitle()?x.getTitle():b.defaultFilename,F=/(\.png)$/i.test(z);u=/(\.svg)$/i.test(z);var J=/(\.pdf)$/i.test(z),H=function(R,M){R()},D=document.createElement("div");D.className="geDialogSection";if(J&&EditorUi.isElectronApp){var c=b.getPdfFileProperties(b.fileNode).notes,f=b.addCheckbox(D,mxResources.get("notes"),c,null,null,null,null,null,!0);this.init=this.init||function(){f.focus()};m(function(R,M){null!=b.fileNode&&c!=f.checked&&(b.fileNode.setAttribute("notes",f.checked?"true":
-"false"),null!=x&&x.fileChanged());R()})}if(F||u){z=1;F=0;J=b.fileNode;null!=J&&(J.hasAttribute("scale")&&(z=parseFloat(J.getAttribute("scale"))),J.hasAttribute("border")&&(F=parseInt(J.getAttribute("border"))));var l=document.createElement("input");l.setAttribute("type","text");l.setAttribute("value",100*z+"%");g(D,mxResources.get("zoom"),l);var n=document.createElement("input");n.setAttribute("type","text");n.setAttribute("value",F);g(D,mxResources.get("borderWidth"),n);var r=null;u&&(r=b.addCheckbox(D,
-mxResources.get("embedFonts"),b.getSvgFileProperties(J).embedFonts,null,null,null,null,null,!0));this.init=this.init||function(){l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null)};m(function(R,M){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(l.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(n.value))),null!=r&&b.fileNode.setAttribute("embedFonts",r.checked?"true":"false"),null!=x&&x.fileChanged());
+z=null!=x&&null!=x.getTitle()?x.getTitle():b.defaultFilename,F=/(\.png)$/i.test(z);u=/(\.svg)$/i.test(z);var I=/(\.pdf)$/i.test(z),H=function(R,M){R()},D=document.createElement("div");D.className="geDialogSection";if(I&&EditorUi.isElectronApp){var c=b.getPdfFileProperties(b.fileNode).notes,f=b.addCheckbox(D,mxResources.get("notes"),c,null,null,null,null,null,!0);this.init=this.init||function(){f.focus()};m(function(R,M){null!=b.fileNode&&c!=f.checked&&(b.fileNode.setAttribute("notes",f.checked?"true":
+"false"),null!=x&&x.fileChanged());R()})}if(F||u){z=1;F=0;I=b.fileNode;null!=I&&(I.hasAttribute("scale")&&(z=parseFloat(I.getAttribute("scale"))),I.hasAttribute("border")&&(F=parseInt(I.getAttribute("border"))));var l=document.createElement("input");l.setAttribute("type","text");l.setAttribute("value",100*z+"%");g(D,mxResources.get("zoom"),l);var n=document.createElement("input");n.setAttribute("type","text");n.setAttribute("value",F);g(D,mxResources.get("borderWidth"),n);var r=null;u&&(r=b.addCheckbox(D,
+mxResources.get("embedFonts"),b.getSvgFileProperties(I).embedFonts,null,null,null,null,null,!0));this.init=this.init||function(){l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null)};m(function(R,M){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(l.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(n.value))),null!=r&&b.fileNode.setAttribute("embedFonts",r.checked?"true":"false"),null!=x&&x.fileChanged());
R()})}else if(!/(\.html)$/i.test(z)&&!/(\.svg)$/i.test(z)){var t=null!=x?x.isCompressed():Editor.defaultCompressed,v=b.addCheckbox(D,mxResources.get("compressed"),t,null,null,null,null,null,!0);this.init=this.init||function(){v.focus()};m(function(R,M){null!=b.fileNode&&t!=v.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",v.checked?"true":"false");null!=x&&(x.compressionChanged(v.checked),x.fileChanged());R()},0):R()})}var B=null!=x?x.isLocked():!1,E=b.addCheckbox(D,mxResources.get("locked"),
B,null,null,null,null,null,!0);this.init=this.init||function(){E.focus()};m(function(R,M){null!=b.fileNode&&B!=E.checked?window.setTimeout(function(){null!=x&&x.setLocked(E.checked);R()},0):R()});if(null!=x&&x.isRealtimeOptional()){var K="disabled"!=b.drive.getCustomProperty(x.desc,"collaboration"),C=b.addCheckbox(D,mxResources.get("realtimeCollaboration"),K,null,null,null,null,null,!0);C.checkRow.appendChild(b.menus.createHelpLink("https://www.drawio.com/docs/manual/collaboration/concurrent-editing/#disable-real-time-collaboration"));
m(function(R,M){C.checked!=K?x.setRealtimeEnabled(C.checked,R,M):R()});this.init=null!=this.init?this.init:function(){C.focus()}}q.appendChild(D);u=document.createElement("div");u.className="geDialogSection";D=!1;null!=x&&"draw.io"==b.getServiceName()&&0<x.getSize()&&"1"!=urlParams.embed&&(D=b.formatFileSize(x.getSize()),z=document.createElement("input"),z.setAttribute("type","text"),z.setAttribute("title",D),z.setAttribute("value",D),z.setAttribute("disabled","disabled"),g(u,mxResources.get("size"),
@@ -13647,63 +13657,63 @@ mxResources.get("updatingDocument"))&&H(function(){b.spinner.stop();b.hideDialog
R[O]);R=b.createTemporaryGraph(b.editor.graph.getStylesheet());var U=new mxCell(M);R.getModel().add(R.getDefaultParent(),U);R.getModel().addListener(mxEvent.CHANGE,function(T,V){T=V.getProperty("edit").changes;for(V=0;V<T.length;V++)if(T[V]instanceof mxValueChange&&T[V].cell===U){for(var fa={},y=T[V].value.attributes,d=0;d<y.length;d++)"label"!=y[d].nodeName&&(fa[y[d].nodeName]=y[d].nodeValue);fa=JSON.stringify(fa);"{}"==fa?b.fileNode.removeAttribute("vars"):b.fileNode.setAttribute("vars",fa);b.updateFileVars();
b.editor.graph.refresh();fa=b.getCurrentFile();null!=fa&&fa.fileChanged()}});R=new EditDataDialog(b,U,R);b.showDialog(R.container,480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,220));R.init()}),F.className="geBtn");b.editor.cancelFirst?(u.appendChild(D),null!=F&&u.appendChild(F),u.appendChild(z)):(null!=F&&u.appendChild(F),u.appendChild(z),u.appendChild(D));q.appendChild(u);this.container=q},ConnectionPointsDialog=function(b,k){function m(){null!=q&&q.destroy()}var g=document.createElement("div");
g.style.userSelect="none";g.style.display="flex";g.style.flexDirection="column";g.style.height="100%";var q=null;this.init=function(){function u(d,p,A){var G="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="+b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)+";";d=new mxCell("",new mxGeometry(d,p,6,6),G);d.vertex=!0;d.cp=!0;d.constObj=A;return c.addCell(d)}function x(d){d=c.getSelectionCells();c.deleteCells(d)}function z(){var d=parseFloat(O.value)||0;d=0>
-d?0:100<d?100:d;O.value=d;var p=parseFloat(T.value)||0;p=0>p?0:100<p?100:p;T.value=p;var A=parseInt(U.value)||0,G=parseInt(V.value)||0,I=c.getSelectionCell(),L=null!=I&&null!=I.constObj?I.constObj.perimeter:!1;p=new mxConnectionConstraint(new mxPoint(parseFloat((d/100).toFixed(6)),parseFloat((p/100).toFixed(6))),L,null,A,G);d=c.getConnectionPoint(n,p);null!=I&&(I.constObj=p,p=I.geometry.clone(),A=c.view.scale,G=c.view.translate,p.x=(d.x-3*A)/A-G.x,p.y=(d.y-3*A)/A-G.y,c.model.setGeometry(I,p))}function F(d){if(d.constObj)return{x:d.constObj.point.x,
-y:d.constObj.point.y,perimeter:d.constObj.perimeter,dx:d.constObj.dx,dy:d.constObj.dy};var p=0,A=0,G=f.geometry,I=parseFloat(((d.geometry.x+3-G.x)/G.width).toFixed(6));d=parseFloat(((d.geometry.y+3-G.y)/G.height).toFixed(6));0>I?(p=I*G.width,I=0):1<I&&(p=(I-1)*G.width,I=1);0>d?(A=d*G.height,d=0):1<d&&(A=(d-1)*G.height,d=1);return{x:I,y:d,perimeter:!1,dx:parseInt(p),dy:parseInt(A)}}function J(d){if(1==c.getSelectionCount()){var p=c.getSelectionCell();d&&(p.constObj=null);d=F(p);O.value=parseFloat((100*
+d?0:100<d?100:d;O.value=d;var p=parseFloat(T.value)||0;p=0>p?0:100<p?100:p;T.value=p;var A=parseInt(U.value)||0,G=parseInt(V.value)||0,J=c.getSelectionCell(),L=null!=J&&null!=J.constObj?J.constObj.perimeter:!1;p=new mxConnectionConstraint(new mxPoint(parseFloat((d/100).toFixed(6)),parseFloat((p/100).toFixed(6))),L,null,A,G);d=c.getConnectionPoint(n,p);null!=J&&(J.constObj=p,p=J.geometry.clone(),A=c.view.scale,G=c.view.translate,p.x=(d.x-3*A)/A-G.x,p.y=(d.y-3*A)/A-G.y,c.model.setGeometry(J,p))}function F(d){if(d.constObj)return{x:d.constObj.point.x,
+y:d.constObj.point.y,perimeter:d.constObj.perimeter,dx:d.constObj.dx,dy:d.constObj.dy};var p=0,A=0,G=f.geometry,J=parseFloat(((d.geometry.x+3-G.x)/G.width).toFixed(6));d=parseFloat(((d.geometry.y+3-G.y)/G.height).toFixed(6));0>J?(p=J*G.width,J=0):1<J&&(p=(J-1)*G.width,J=1);0>d?(A=d*G.height,d=0):1<d&&(A=(d-1)*G.height,d=1);return{x:J,y:d,perimeter:!1,dx:parseInt(p),dy:parseInt(A)}}function I(d){if(1==c.getSelectionCount()){var p=c.getSelectionCell();d&&(p.constObj=null);d=F(p);O.value=parseFloat((100*
d.x).toFixed(4));T.value=parseFloat((100*d.y).toFixed(4));U.value=d.dx;V.value=d.dy;M.style.visibility=""}else M.style.visibility="hidden"}function H(){y.checked!=fa&&b.editor.graph.setCellStyles("connectable",y.checked?"1":"0",[k])}var D=document.createElement("div");D.style.flex="1";D.style.minHeight="0";D.style.overflow="hidden";D.style.borderStyle="solid";D.style.borderWidth="1px";D.style.boxSizing="border-box";mxEvent.disableContextMenu(D);g.appendChild(D);var c=new Graph(D);c.transparentBackground=
!1;c.autoExtend=!1;c.autoScroll=!1;c.setGridEnabled(!1);c.setEnabled(!0);c.setPanning(!0);c.setConnectable(!1);c.setTooltips(!1);c.minFitScale=null;c.maxFitScale=null;c.centerZoom=!0;c.maxFitScale=2;D=k.geometry;var f=new mxCell(k.value,new mxGeometry(0,0,D.width,D.height),k.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;opacity=50;");f.vertex=!0;c.addCell(f);c.dblClick=function(d,p){if(null!=p&&p!=f)c.setSelectionCell(p);else{p=mxUtils.convertPoint(c.container,mxEvent.getClientX(d),
mxEvent.getClientY(d));mxEvent.consume(d);d=c.view.scale;var A=c.view.translate;c.setSelectionCell(u((p.x-3*d)/d-A.x,(p.y-3*d)/d-A.y))}};q=new mxKeyHandler(c);q.bindKey(46,x);q.bindKey(8,x);c.getRubberband().isForceRubberbandEvent=function(d){return 0==d.evt.button&&(null==d.getCell()||d.getCell()==f)};c.panningHandler.isForcePanningEvent=function(d){return 2==d.evt.button};var l=c.isCellSelectable;c.isCellSelectable=function(d){return d==f?!1:l.apply(this,arguments)};c.getLinkForCell=function(){return null};
var n=c.view.getState(f);D=c.getAllConnectionConstraints(n);for(var r=0;null!=D&&r<D.length;r++){var t=c.getConnectionPoint(n,D[r]);u(t.x-3,t.y-3,D[r])}r=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){c.zoomIn()});t=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){c.zoomOut()});var v=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==c.view.scale?(c.maxFitScale=8,c.fit(8)):c.zoomActual();c.center()}),B=function(){b.prompt(mxResources.get("gridSize"),
c.gridSize,function(d){!isNaN(d)&&0<d&&(c.setGridSize(d),c.setGridEnabled(!0),c.refresh())})},E=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(d){mxEvent.isShiftDown(d)?B():(c.setGridEnabled(!c.isGridEnabled()),c.refresh())});mxEvent.addListener(E,"dblclick",B);var K=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),x);mxUtils.setOpacity(K,10);D=document.createElement("div");D.style.display="flex";D.style.flexShrink="0";D.style.alignItems="center";D.style.paddingTop=
"6px";D.appendChild(r);D.appendChild(t);D.appendChild(v);D.appendChild(E);D.appendChild(K);g.appendChild(D);var C=document.createElement("input");C.setAttribute("type","number");C.setAttribute("min","1");C.setAttribute("value","1");C.style.width="45px";C.style.position="relative";C.style.margin="0 4px 0 4px";var R=document.createElement("select");R.style.position="relative";t=["left","right","top","bottom"];for(r=0;r<t.length;r++)v=t[r],E=document.createElement("option"),mxUtils.write(E,mxResources.get(v)),
-E.value=v,R.appendChild(E);r=mxUtils.button(mxResources.get("add"),function(){var d=parseInt(C.value);d=isNaN(d)?1:1>d?1:100<d?100:d;C.value=d;var p=R.value,A=f.geometry,G="top"==p||"bottom"==p,I=[0,1];for(Q in c.model.cells){var L=c.model.cells[Q];if(L.cp&&(L=F(L),"left"==p&&0==L.x||"right"==p&&1==L.x||"top"==p&&0==L.y||"bottom"==p&&1==L.y)){var P=parseFloat(G?L.x:L.y);isFinite(P)&&0<P&&1>P&&I.push(P)}}I.sort(function(X,Y){return X-Y});var Q=[];for(L=1;L<I.length;L++)I[L]>I[L-1]&&Q.push({start:I[L-
-1],len:I[L]-I[L-1],count:0});for(L=0;L<d;L++){P=Q[0];for(I=1;I<Q.length;I++)Q[I].len/(Q[I].count+1)>P.len/(P.count+1)&&(P=Q[I]);P.count++}d=[];for(L=0;L<Q.length;L++)for(I=1;I<=Q[L].count;I++){P=parseFloat((Q[L].start+I*Q[L].len/(Q[L].count+1)).toFixed(6));var ba=G?P:"left"==p?0:1;P=G?"top"==p?0:1:P;d.push(u(A.x+ba*A.width-3,A.y+P*A.height-3,new mxConnectionConstraint(new mxPoint(ba,P),!1)))}c.setSelectionCells(d)});r.style.marginLeft="auto";D.appendChild(r);D.appendChild(C);D.appendChild(R);var M=
+E.value=v,R.appendChild(E);r=mxUtils.button(mxResources.get("add"),function(){var d=parseInt(C.value);d=isNaN(d)?1:1>d?1:100<d?100:d;C.value=d;var p=R.value,A=f.geometry,G="top"==p||"bottom"==p,J=[0,1];for(Q in c.model.cells){var L=c.model.cells[Q];if(L.cp&&(L=F(L),"left"==p&&0==L.x||"right"==p&&1==L.x||"top"==p&&0==L.y||"bottom"==p&&1==L.y)){var P=parseFloat(G?L.x:L.y);isFinite(P)&&0<P&&1>P&&J.push(P)}}J.sort(function(W,Y){return W-Y});var Q=[];for(L=1;L<J.length;L++)J[L]>J[L-1]&&Q.push({start:J[L-
+1],len:J[L]-J[L-1],count:0});for(L=0;L<d;L++){P=Q[0];for(J=1;J<Q.length;J++)Q[J].len/(Q[J].count+1)>P.len/(P.count+1)&&(P=Q[J]);P.count++}d=[];for(L=0;L<Q.length;L++)for(J=1;J<=Q[L].count;J++){P=parseFloat((Q[L].start+J*Q[L].len/(Q[L].count+1)).toFixed(6));var ba=G?P:"left"==p?0:1;P=G?"top"==p?0:1:P;d.push(u(A.x+ba*A.width-3,A.y+P*A.height-3,new mxConnectionConstraint(new mxPoint(ba,P),!1)))}c.setSelectionCells(d)});r.style.marginLeft="auto";D.appendChild(r);D.appendChild(C);D.appendChild(R);var M=
document.createElement("div");M.style.flexShrink="0";M.style.margin="4px 0px 8px 0px";M.style.whiteSpace="nowrap";M.style.height="24px";D=document.createElement("span");mxUtils.write(D,mxResources.get("dx"));M.appendChild(D);var O=document.createElement("input");O.setAttribute("type","number");O.setAttribute("min","0");O.setAttribute("max","100");O.setAttribute("step","any");O.style.width="45px";O.style.margin="0 4px 0 4px";M.appendChild(O);mxUtils.write(M,"%");var U=document.createElement("input");
U.setAttribute("type","number");U.style.width="45px";U.style.margin="0 4px 0 4px";M.appendChild(U);mxUtils.write(M,"pt");D=document.createElement("span");mxUtils.write(D,mxResources.get("dy"));D.style.marginLeft="12px";M.appendChild(D);var T=document.createElement("input");T.setAttribute("type","number");T.setAttribute("min","0");T.setAttribute("max","100");T.setAttribute("step","any");T.style.width="45px";T.style.margin="0 4px 0 4px";M.appendChild(T);mxUtils.write(M,"%");var V=document.createElement("input");
-V.setAttribute("type","number");V.style.width="45px";V.style.margin="0 4px 0 4px";M.appendChild(V);mxUtils.write(M,"pt");g.appendChild(M);J();c.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<c.getSelectionCount()?mxUtils.setOpacity(K,60):mxUtils.setOpacity(K,10);J()});c.addListener(mxEvent.CELLS_MOVED,J);mxEvent.addListener(O,"change",z);mxEvent.addListener(T,"change",z);mxEvent.addListener(U,"change",z);mxEvent.addListener(V,"change",z);var fa=b.editor.graph.isCellConnectable(k),y=document.createElement("input");
+V.setAttribute("type","number");V.style.width="45px";V.style.margin="0 4px 0 4px";M.appendChild(V);mxUtils.write(M,"pt");g.appendChild(M);I();c.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<c.getSelectionCount()?mxUtils.setOpacity(K,60):mxUtils.setOpacity(K,10);I()});c.addListener(mxEvent.CELLS_MOVED,I);mxEvent.addListener(O,"change",z);mxEvent.addListener(T,"change",z);mxEvent.addListener(U,"change",z);mxEvent.addListener(V,"change",z);var fa=b.editor.graph.isCellConnectable(k),y=document.createElement("input");
y.setAttribute("type","checkbox");y.style.verticalAlign="middle";y.style.marginRight="6px";y.checked=fa;D=mxUtils.button(mxResources.get("cancel"),function(){m();b.hideDialog()});D.className="geBtn";r=mxUtils.button(mxResources.get("apply"),function(){function d(P,Q){P=c.getConnectionPoint(n,new mxConnectionConstraint(new mxPoint(P.x,P.y),P.perimeter,null,P.dx,P.dy));Q=c.getConnectionPoint(n,new mxConnectionConstraint(new mxPoint(Q.x,Q.y),Q.perimeter,null,Q.dx,Q.dy));return P.x==Q.x&&P.y==Q.y}var p=
-c.model.cells,A=[],G=[];for(L in p){var I=p[L];I.cp&&G.push(F(I))}G.sort(function(P,Q){return P.x!=Q.x?P.x-Q.x:P.y!=Q.y?P.y-Q.y:P.dx!=Q.dx?P.dx-Q.dx:P.dy!=Q.dy?P.dy-Q.dy:(Q.perimeter?1:0)-(P.perimeter?1:0)});for(p=0;p<G.length;p++){var L=G[p];0<p&&L.x==G[p-1].x&&L.y==G[p-1].y&&L.dx==G[p-1].dx&&L.dy==G[p-1].dy&&(L.perimeter==G[p-1].perimeter||d(L,G[p-1]))||A.push("["+L.x+","+L.y+","+(L.perimeter?"1":"0")+","+L.dx+","+L.dy+"]")}G=b.editor.graph;G.getModel().beginUpdate();try{G.setCellStyles("points",
+c.model.cells,A=[],G=[];for(L in p){var J=p[L];J.cp&&G.push(F(J))}G.sort(function(P,Q){return P.x!=Q.x?P.x-Q.x:P.y!=Q.y?P.y-Q.y:P.dx!=Q.dx?P.dx-Q.dx:P.dy!=Q.dy?P.dy-Q.dy:(Q.perimeter?1:0)-(P.perimeter?1:0)});for(p=0;p<G.length;p++){var L=G[p];0<p&&L.x==G[p-1].x&&L.y==G[p-1].y&&L.dx==G[p-1].dx&&L.dy==G[p-1].dy&&(L.perimeter==G[p-1].perimeter||d(L,G[p-1]))||A.push("["+L.x+","+L.y+","+(L.perimeter?"1":"0")+","+L.dx+","+L.dy+"]")}G=b.editor.graph;G.getModel().beginUpdate();try{G.setCellStyles("points",
"["+A.join(",")+"]",[k]),H()}finally{G.getModel().endUpdate()}m();b.hideDialog()});r.className="geBtn gePrimaryBtn";t=mxUtils.button(mxResources.get("reset"),function(){var d=b.editor.graph;d.getModel().beginUpdate();try{d.setCellStyles("points",null,[k]),H()}finally{d.getModel().endUpdate()}m();b.hideDialog()});t.className="geBtn";v=document.createElement("div");v.style.flexShrink="0";v.style.marginTop="10px";v.style.textAlign="right";b.isOffline()||v.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));
-E=document.createElement("label");E.style.cssFloat="left";E.style.marginTop="8px";E.appendChild(y);mxUtils.write(E,mxResources.get("connectable",null,"Connectable"));v.appendChild(E);b.editor.cancelFirst&&v.appendChild(D);v.appendChild(t);v.appendChild(r);b.editor.cancelFirst||v.appendChild(D);g.appendChild(v);c.fit(8);c.center()};this.destroy=m;this.container=g},PolygonDialog=function(b,k,m){function g(ha){var la=ca.getBoundingClientRect();if(0<la.width&&0<la.height){var xa=M+U/2,Ca=O+T/2;V=Math.max(.05,
-Math.min(5,ha));U=la.width*V;T=la.height*V;M=xa-U/2;O=Ca-T/2;q()}}function q(){ca.setAttribute("viewBox",M+" "+O+" "+U+" "+T);var ha=W.getBoundingClientRect();if(!(0>=ha.width||0>=ha.height)){var la=ha.width-12,xa=Math.max(20,la*Math.min(1,U/1200)),Ca=1200-U;Ca=0<Ca?(M- -400)/Ca:.5;Ca=Math.max(0,Math.min(1,Ca));ka.style.width=xa+"px";ka.style.left=Ca*(la-xa)+"px";ha=ha.height-12;la=Math.max(20,ha*Math.min(1,T/1200));xa=1200-T;xa=0<xa?(O- -400)/xa:.5;xa=Math.max(0,Math.min(1,xa));sa.style.height=la+
-"px";sa.style.top=xa*(ha-la)+"px"}}function u(ha){var la=ca.getBoundingClientRect(),xa=M+((null!=ha.touches?ha.touches[0].clientX:ha.clientX)-la.left)/la.width*U;la=O+((null!=ha.touches?ha.touches[0].clientY:ha.clientY)-la.top)/la.height*T;ha=mxEvent.isAltDown(ha);return{x:t&&!ha?20*Math.round(xa/20):Math.round(xa),y:t&&!ha?20*Math.round(la/20):Math.round(la)}}function x(ha){var la=ca.getBoundingClientRect(),xa=M+((null!=ha.touches?ha.touches[0].clientX:ha.clientX)-la.left)/la.width*U;ha=O+((null!=
-ha.touches?ha.touches[0].clientY:ha.clientY)-la.top)/la.height*T;la=U/400*9;if(r&&2<l.length&&"Q"===l[0].type){var Ca=l[0].cx-xa,pa=l[0].cy-ha;if(Math.sqrt(Ca*Ca+pa*pa)<=la)return{type:"control",index:0}}for(var oa=1;oa<l.length;oa++)if("Q"===l[oa].type&&(Ca=l[oa].cx-xa,pa=l[oa].cy-ha,Math.sqrt(Ca*Ca+pa*pa)<=la))return{type:"control",index:oa};for(oa=0;oa<l.length;oa++)if(Ca=l[oa].x-xa,pa=l[oa].y-ha,Math.sqrt(Ca*Ca+pa*pa)<=la)return{type:"vertex",index:oa};return null}function z(){v.push(JSON.stringify(l));
-B=[];H()}function F(){0<v.length&&(B.push(JSON.stringify(l)),l=JSON.parse(v.pop()),n=Math.min(n,l.length-1),D(),H())}function J(){0<B.length&&(v.push(JSON.stringify(l)),l=JSON.parse(B.pop()),n=Math.min(n,l.length-1),D(),H())}function H(){null!=na&&(na.style.opacity=0<v.length?"1":"0.3",na.style.pointerEvents=0<v.length?"":"none");null!=Aa&&(Aa.style.opacity=0<B.length?"1":"0.3",Aa.style.pointerEvents=0<B.length?"":"none")}function D(){for(var ha="",la=0;la<l.length;la++)ha=0===la?ha+("M"+l[la].x+
+E=document.createElement("label");E.style.cssFloat="left";E.style.marginTop="8px";E.appendChild(y);mxUtils.write(E,mxResources.get("connectable",null,"Connectable"));v.appendChild(E);b.editor.cancelFirst&&v.appendChild(D);v.appendChild(t);v.appendChild(r);b.editor.cancelFirst||v.appendChild(D);g.appendChild(v);c.fit(8);c.center()};this.destroy=m;this.container=g},PolygonDialog=function(b,k,m){function g(ha){var la=ca.getBoundingClientRect();if(0<la.width&&0<la.height){var ya=M+U/2,Ca=O+T/2;V=Math.max(.05,
+Math.min(5,ha));U=la.width*V;T=la.height*V;M=ya-U/2;O=Ca-T/2;q()}}function q(){ca.setAttribute("viewBox",M+" "+O+" "+U+" "+T);var ha=X.getBoundingClientRect();if(!(0>=ha.width||0>=ha.height)){var la=ha.width-12,ya=Math.max(20,la*Math.min(1,U/1200)),Ca=1200-U;Ca=0<Ca?(M- -400)/Ca:.5;Ca=Math.max(0,Math.min(1,Ca));ka.style.width=ya+"px";ka.style.left=Ca*(la-ya)+"px";ha=ha.height-12;la=Math.max(20,ha*Math.min(1,T/1200));ya=1200-T;ya=0<ya?(O- -400)/ya:.5;ya=Math.max(0,Math.min(1,ya));sa.style.height=la+
+"px";sa.style.top=ya*(ha-la)+"px"}}function u(ha){var la=ca.getBoundingClientRect(),ya=M+((null!=ha.touches?ha.touches[0].clientX:ha.clientX)-la.left)/la.width*U;la=O+((null!=ha.touches?ha.touches[0].clientY:ha.clientY)-la.top)/la.height*T;ha=mxEvent.isAltDown(ha);return{x:t&&!ha?20*Math.round(ya/20):Math.round(ya),y:t&&!ha?20*Math.round(la/20):Math.round(la)}}function x(ha){var la=ca.getBoundingClientRect(),ya=M+((null!=ha.touches?ha.touches[0].clientX:ha.clientX)-la.left)/la.width*U;ha=O+((null!=
+ha.touches?ha.touches[0].clientY:ha.clientY)-la.top)/la.height*T;la=U/400*9;if(r&&2<l.length&&"Q"===l[0].type){var Ca=l[0].cx-ya,pa=l[0].cy-ha;if(Math.sqrt(Ca*Ca+pa*pa)<=la)return{type:"control",index:0}}for(var oa=1;oa<l.length;oa++)if("Q"===l[oa].type&&(Ca=l[oa].cx-ya,pa=l[oa].cy-ha,Math.sqrt(Ca*Ca+pa*pa)<=la))return{type:"control",index:oa};for(oa=0;oa<l.length;oa++)if(Ca=l[oa].x-ya,pa=l[oa].y-ha,Math.sqrt(Ca*Ca+pa*pa)<=la)return{type:"vertex",index:oa};return null}function z(){v.push(JSON.stringify(l));
+B=[];H()}function F(){0<v.length&&(B.push(JSON.stringify(l)),l=JSON.parse(v.pop()),n=Math.min(n,l.length-1),D(),H())}function I(){0<B.length&&(v.push(JSON.stringify(l)),l=JSON.parse(B.pop()),n=Math.min(n,l.length-1),D(),H())}function H(){null!=na&&(na.style.opacity=0<v.length?"1":"0.3",na.style.pointerEvents=0<v.length?"":"none");null!=Aa&&(Aa.style.opacity=0<B.length?"1":"0.3",Aa.style.pointerEvents=0<B.length?"":"none")}function D(){for(var ha="",la=0;la<l.length;la++)ha=0===la?ha+("M"+l[la].x+
" "+l[la].y):"Q"===l[la].type?ha+("Q"+l[la].cx+" "+l[la].cy+" "+l[la].x+" "+l[la].y):ha+("L"+l[la].x+" "+l[la].y);r&&2<l.length&&("Q"===l[0].type&&(ha+="Q"+l[0].cx+" "+l[0].cy+" "+l[0].x+" "+l[0].y),ha+="Z");Z.setAttribute("d",ha);for(Z.setAttribute("fill",r&&2<l.length?"rgba(66, 133, 244, 0.1)":"none");da.firstChild;)da.removeChild(da.firstChild);for(la=1;la<l.length;la++)"Q"===l[la].type&&(ha=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ha.setAttribute("points",l[la-1].x+","+
l[la-1].y+" "+l[la].cx+","+l[la].cy+" "+l[la].x+","+l[la].y),ha.setAttribute("fill","none"),ha.setAttribute("stroke","#f0a030"),ha.setAttribute("stroke-width","1"),ha.setAttribute("stroke-dasharray","4,3"),da.appendChild(ha));r&&2<l.length&&"Q"===l[0].type&&(la=document.createElementNS("http://www.w3.org/2000/svg","polyline"),la.setAttribute("points",l[l.length-1].x+","+l[l.length-1].y+" "+l[0].cx+","+l[0].cy+" "+l[0].x+","+l[0].y),la.setAttribute("fill","none"),la.setAttribute("stroke","#f0a030"),
la.setAttribute("stroke-width","1"),la.setAttribute("stroke-dasharray","4,3"),da.appendChild(la));for(;N.firstChild;)N.removeChild(N.firstChild);for(la=0;la<l.length;la++)ha=document.createElementNS("http://www.w3.org/2000/svg","circle"),ha.setAttribute("cx",l[la].x),ha.setAttribute("cy",l[la].y),ha.setAttribute("r",5),ha.setAttribute("fill",la===n?"#ff4444":"#4285f4"),ha.setAttribute("stroke","#fff"),ha.setAttribute("stroke-width","1.5"),ha.style.cursor="move",N.appendChild(ha);for(;aa.firstChild;)aa.removeChild(aa.firstChild);
for(la=1;la<l.length;la++)"Q"===l[la].type&&(ha=document.createElementNS("http://www.w3.org/2000/svg","rect"),ha.setAttribute("x",l[la].cx-5),ha.setAttribute("y",l[la].cy-5),ha.setAttribute("width",10),ha.setAttribute("height",10),ha.setAttribute("fill",la===n?"#ff8800":"#f0a030"),ha.setAttribute("stroke","#fff"),ha.setAttribute("stroke-width","1.5"),ha.style.cursor="move",aa.appendChild(ha));r&&2<l.length&&"Q"===l[0].type&&(la=document.createElementNS("http://www.w3.org/2000/svg","rect"),la.setAttribute("x",
l[0].cx-5),la.setAttribute("y",l[0].cy-5),la.setAttribute("width",10),la.setAttribute("height",10),la.setAttribute("fill",0===n?"#ff8800":"#f0a030"),la.setAttribute("stroke","#fff"),la.setAttribute("stroke-width","1.5"),la.style.cursor="move",aa.appendChild(la));c()}function c(){qa.innerHTML="";if(0===l.length){var ha=document.createElement("div");ha.style.padding="20px 10px";ha.style.textAlign="center";ha.style.opacity="0.5";ha.style.fontSize="12px";mxUtils.write(ha,mxResources.get("clickToAdd"));
-qa.appendChild(ha)}else for(ha=0;ha<l.length;ha++)(function(la){var xa=document.createElement("div");xa.style.display="flex";xa.style.alignItems="center";xa.style.padding="2px 4px";xa.style.gap="4px";xa.style.borderRadius="3px";xa.style.marginBottom="2px";xa.style.fontSize="12px";xa.setAttribute("draggable","true");xa.setAttribute("data-idx",la);la===n&&(xa.style.backgroundColor="rgba(66, 133, 244, 0.15)");xa.style.cursor="pointer";mxEvent.addListener(xa,"click",function(){n=la;D()});var Ca=document.createElement("span");
-Ca.innerHTML="&#9776;";Ca.style.cursor="grab";Ca.style.fontSize="11px";Ca.style.opacity="0.4";Ca.style.flexShrink="0";xa.appendChild(Ca);Ca=document.createElement("span");Ca.style.minWidth="18px";Ca.style.fontWeight="bold";mxUtils.write(Ca,la+1+"");xa.appendChild(Ca);Ca=document.createElement("input");Ca.type="number";Ca.value=Math.round(l[la].x);Ca.style.width="48px";Ca.style.fontSize="11px";Ca.style.padding="1px 3px";Ca.title="X";mxEvent.addListener(Ca,"change",function(){z();l[la].x=parseInt(this.value)||
-0;D()});mxEvent.addListener(Ca,"click",function(oa){oa.stopPropagation()});xa.appendChild(Ca);Ca=document.createElement("input");Ca.type="number";Ca.value=Math.round(l[la].y);Ca.style.width="48px";Ca.style.fontSize="11px";Ca.style.padding="1px 3px";Ca.title="Y";mxEvent.addListener(Ca,"change",function(){z();l[la].y=parseInt(this.value)||0;D()});mxEvent.addListener(Ca,"click",function(oa){oa.stopPropagation()});xa.appendChild(Ca);if(0<la||0===la&&r&&2<l.length){Ca=document.createElement("label");Ca.style.display=
-"flex";Ca.style.alignItems="center";Ca.style.cursor="pointer";Ca.style.flexShrink="0";Ca.title=mxResources.get("curved");var pa=document.createElement("input");pa.type="checkbox";pa.checked="Q"===l[la].type;pa.style.margin="0";mxEvent.addListener(pa,"click",function(oa){oa.stopPropagation()});mxEvent.addListener(pa,"change",function(){z();if("Q"===l[la].type)l[la].type="L",delete l[la].cx,delete l[la].cy;else{var oa=0<la?l[la-1]:l[l.length-1];var Da=l[la];var Fa=(oa.x+Da.x)/2;var Ia=(oa.y+Da.y)/2;
-var Ha=Da.x-oa.x,Ma=Da.y-oa.y;oa=Math.sqrt(Ha*Ha+Ma*Ma);0!==oa&&(Da=.25*oa,Fa=Math.round(Fa+-Ma/oa*Da),Ia=Math.round(Ia+Ha/oa*Da));l[la].type="Q";l[la].cx=Fa;l[la].cy=Ia}D()});Ca.appendChild(pa);xa.appendChild(Ca)}Ca=document.createElement("img");Ca.setAttribute("src",Editor.trashImage);Ca.style.cursor="pointer";Ca.style.marginLeft="auto";Ca.style.width="14px";Ca.style.height="14px";Ca.style.opacity="0.5";Ca.style.flexShrink="0";Ca.title=mxResources.get("delete");Editor.isDarkMode()&&(Ca.style.filter=
-"invert(1)");mxEvent.addListener(Ca,"click",function(oa){oa.stopPropagation();z();l.splice(la,1);n>=l.length&&(n=l.length-1);D()});xa.appendChild(Ca);mxEvent.addListener(xa,"dragstart",function(oa){I=la;xa.style.opacity="0.4";oa.dataTransfer.effectAllowed="move";oa.dataTransfer.setData("text/plain",""+la);oa.stopPropagation()});mxEvent.addListener(xa,"dragover",function(oa){oa.preventDefault();oa.stopPropagation();oa.dataTransfer.dropEffect="move";oa=parseInt(xa.getAttribute("data-idx"));null!==I&&
-oa!==I&&(xa.style.borderTop=oa<I?"2px solid #4285f4":"",xa.style.borderBottom=oa>I?"2px solid #4285f4":"")});mxEvent.addListener(xa,"dragleave",function(oa){xa.style.borderTop="";xa.style.borderBottom=""});mxEvent.addListener(xa,"drop",function(oa){oa.preventDefault();oa.stopPropagation();xa.style.borderTop="";xa.style.borderBottom="";var Da=parseInt(xa.getAttribute("data-idx"));null!==I&&Da!==I&&(z(),oa=l.splice(I,1)[0],Da=Da>I?Da-1:Da,l.splice(Da,0,oa),n===I?n=Da:I<n&&Da>=n?n--:I>n&&Da<=n&&n++,
-D());I=null});mxEvent.addListener(xa,"dragend",function(oa){xa.style.opacity="";xa.style.borderTop="";xa.style.borderBottom="";I=null});qa.appendChild(xa)})(ha)}var f=b.editor.graph,l=[],n=-1,r=!0,t=!0,v=[],B=[],E=-1,K=null,C=!1,R=!1,M=0,O=0,U=400,T=400,V=1,fa=!1,y=0,d=0,p=0,A=0,G=!1,I=null,L=f.view.getState(k);if(null!=L)try{var P=JSON.parse(mxUtils.getValue(L.style,"polyCoords","[]")),Q=JSON.parse(mxUtils.getValue(L.style,"polyCurves","[]")),ba=mxUtils.getValue(L.style,"polyline",0);r=!(1==ba||
-!0===ba||"true"===ba||"1"===ba);for(L=0;L<P.length;L++){var X={x:Math.round(400*P[L][0]),y:Math.round(400*P[L][1]),type:"L"};0<L&&Q.length>L-1&&null!=Q[L-1]&&3<=Q[L-1].length&&"Q"===Q[L-1][0]&&(X.type="Q",X.cx=Math.round(400*Q[L-1][1]),X.cy=Math.round(400*Q[L-1][2]));l.push(X)}r&&2<P.length&&Q.length>=P.length&&null!=Q[P.length-1]&&3<=Q[P.length-1].length&&"Q"===Q[P.length-1][0]&&(l[0].type="Q",l[0].cx=Math.round(400*Q[P.length-1][1]),l[0].cy=Math.round(400*Q[P.length-1][2]))}catch(ha){}var Y=document.createElement("div");
-Y.style.userSelect="none";Y.setAttribute("tabindex","0");Y.style.outline="none";Y.style.position="absolute";Y.style.left="30px";Y.style.right="30px";Y.style.top="30px";Y.style.bottom="30px";P=document.createElement("div");P.style.display="flex";P.style.gap="10px";P.style.position="absolute";P.style.left="0px";P.style.right="0px";P.style.top="0px";P.style.bottom="40px";Y.appendChild(P);var W=document.createElement("div");W.style.border="1px solid";W.style.borderColor="inherit";W.style.borderRadius=
-"4px";W.style.flexGrow="1";W.style.flexShrink="1";W.style.minWidth="200px";W.style.position="relative";W.style.overflow="hidden";P.appendChild(W);var ca=document.createElementNS("http://www.w3.org/2000/svg","svg");ca.setAttribute("width","100%");ca.setAttribute("height","100%");ca.setAttribute("viewBox","0 0 400 400");ca.style.display="block";ca.style.cursor="crosshair";Q=document.createElementNS("http://www.w3.org/2000/svg","defs");X=document.createElementNS("http://www.w3.org/2000/svg","pattern");
-L="polygonGrid_"+Date.now();X.setAttribute("id",L);X.setAttribute("width",20);X.setAttribute("height",20);X.setAttribute("patternUnits","userSpaceOnUse");ba=document.createElementNS("http://www.w3.org/2000/svg","path");ba.setAttribute("d","M 20 0 L 0 0 0 20");ba.setAttribute("fill","none");ba.setAttribute("stroke","#e0e0e0");ba.setAttribute("stroke-width","0.5");X.appendChild(ba);Q.appendChild(X);ca.appendChild(Q);var S=document.createElementNS("http://www.w3.org/2000/svg","rect");S.setAttribute("x",
+qa.appendChild(ha)}else for(ha=0;ha<l.length;ha++)(function(la){var ya=document.createElement("div");ya.style.display="flex";ya.style.alignItems="center";ya.style.padding="2px 4px";ya.style.gap="4px";ya.style.borderRadius="3px";ya.style.marginBottom="2px";ya.style.fontSize="12px";ya.setAttribute("draggable","true");ya.setAttribute("data-idx",la);la===n&&(ya.style.backgroundColor="rgba(66, 133, 244, 0.15)");ya.style.cursor="pointer";mxEvent.addListener(ya,"click",function(){n=la;D()});var Ca=document.createElement("span");
+Ca.innerHTML="&#9776;";Ca.style.cursor="grab";Ca.style.fontSize="11px";Ca.style.opacity="0.4";Ca.style.flexShrink="0";ya.appendChild(Ca);Ca=document.createElement("span");Ca.style.minWidth="18px";Ca.style.fontWeight="bold";mxUtils.write(Ca,la+1+"");ya.appendChild(Ca);Ca=document.createElement("input");Ca.type="number";Ca.value=Math.round(l[la].x);Ca.style.width="48px";Ca.style.fontSize="11px";Ca.style.padding="1px 3px";Ca.title="X";mxEvent.addListener(Ca,"change",function(){z();l[la].x=parseInt(this.value)||
+0;D()});mxEvent.addListener(Ca,"click",function(oa){oa.stopPropagation()});ya.appendChild(Ca);Ca=document.createElement("input");Ca.type="number";Ca.value=Math.round(l[la].y);Ca.style.width="48px";Ca.style.fontSize="11px";Ca.style.padding="1px 3px";Ca.title="Y";mxEvent.addListener(Ca,"change",function(){z();l[la].y=parseInt(this.value)||0;D()});mxEvent.addListener(Ca,"click",function(oa){oa.stopPropagation()});ya.appendChild(Ca);if(0<la||0===la&&r&&2<l.length){Ca=document.createElement("label");Ca.style.display=
+"flex";Ca.style.alignItems="center";Ca.style.cursor="pointer";Ca.style.flexShrink="0";Ca.title=mxResources.get("curved");var pa=document.createElement("input");pa.type="checkbox";pa.checked="Q"===l[la].type;pa.style.margin="0";mxEvent.addListener(pa,"click",function(oa){oa.stopPropagation()});mxEvent.addListener(pa,"change",function(){z();if("Q"===l[la].type)l[la].type="L",delete l[la].cx,delete l[la].cy;else{var oa=0<la?l[la-1]:l[l.length-1];var Ea=l[la];var Ga=(oa.x+Ea.x)/2;var Ja=(oa.y+Ea.y)/2;
+var Ha=Ea.x-oa.x,Ma=Ea.y-oa.y;oa=Math.sqrt(Ha*Ha+Ma*Ma);0!==oa&&(Ea=.25*oa,Ga=Math.round(Ga+-Ma/oa*Ea),Ja=Math.round(Ja+Ha/oa*Ea));l[la].type="Q";l[la].cx=Ga;l[la].cy=Ja}D()});Ca.appendChild(pa);ya.appendChild(Ca)}Ca=document.createElement("img");Ca.setAttribute("src",Editor.trashImage);Ca.style.cursor="pointer";Ca.style.marginLeft="auto";Ca.style.width="14px";Ca.style.height="14px";Ca.style.opacity="0.5";Ca.style.flexShrink="0";Ca.title=mxResources.get("delete");Editor.isDarkMode()&&(Ca.style.filter=
+"invert(1)");mxEvent.addListener(Ca,"click",function(oa){oa.stopPropagation();z();l.splice(la,1);n>=l.length&&(n=l.length-1);D()});ya.appendChild(Ca);mxEvent.addListener(ya,"dragstart",function(oa){J=la;ya.style.opacity="0.4";oa.dataTransfer.effectAllowed="move";oa.dataTransfer.setData("text/plain",""+la);oa.stopPropagation()});mxEvent.addListener(ya,"dragover",function(oa){oa.preventDefault();oa.stopPropagation();oa.dataTransfer.dropEffect="move";oa=parseInt(ya.getAttribute("data-idx"));null!==J&&
+oa!==J&&(ya.style.borderTop=oa<J?"2px solid #4285f4":"",ya.style.borderBottom=oa>J?"2px solid #4285f4":"")});mxEvent.addListener(ya,"dragleave",function(oa){ya.style.borderTop="";ya.style.borderBottom=""});mxEvent.addListener(ya,"drop",function(oa){oa.preventDefault();oa.stopPropagation();ya.style.borderTop="";ya.style.borderBottom="";var Ea=parseInt(ya.getAttribute("data-idx"));null!==J&&Ea!==J&&(z(),oa=l.splice(J,1)[0],Ea=Ea>J?Ea-1:Ea,l.splice(Ea,0,oa),n===J?n=Ea:J<n&&Ea>=n?n--:J>n&&Ea<=n&&n++,
+D());J=null});mxEvent.addListener(ya,"dragend",function(oa){ya.style.opacity="";ya.style.borderTop="";ya.style.borderBottom="";J=null});qa.appendChild(ya)})(ha)}var f=b.editor.graph,l=[],n=-1,r=!0,t=!0,v=[],B=[],E=-1,K=null,C=!1,R=!1,M=0,O=0,U=400,T=400,V=1,fa=!1,y=0,d=0,p=0,A=0,G=!1,J=null,L=f.view.getState(k);if(null!=L)try{var P=JSON.parse(mxUtils.getValue(L.style,"polyCoords","[]")),Q=JSON.parse(mxUtils.getValue(L.style,"polyCurves","[]")),ba=mxUtils.getValue(L.style,"polyline",0);r=!(1==ba||
+!0===ba||"true"===ba||"1"===ba);for(L=0;L<P.length;L++){var W={x:Math.round(400*P[L][0]),y:Math.round(400*P[L][1]),type:"L"};0<L&&Q.length>L-1&&null!=Q[L-1]&&3<=Q[L-1].length&&"Q"===Q[L-1][0]&&(W.type="Q",W.cx=Math.round(400*Q[L-1][1]),W.cy=Math.round(400*Q[L-1][2]));l.push(W)}r&&2<P.length&&Q.length>=P.length&&null!=Q[P.length-1]&&3<=Q[P.length-1].length&&"Q"===Q[P.length-1][0]&&(l[0].type="Q",l[0].cx=Math.round(400*Q[P.length-1][1]),l[0].cy=Math.round(400*Q[P.length-1][2]))}catch(ha){}var Y=document.createElement("div");
+Y.style.userSelect="none";Y.setAttribute("tabindex","0");Y.style.outline="none";Y.style.position="absolute";Y.style.left="30px";Y.style.right="30px";Y.style.top="30px";Y.style.bottom="30px";P=document.createElement("div");P.style.display="flex";P.style.gap="10px";P.style.position="absolute";P.style.left="0px";P.style.right="0px";P.style.top="0px";P.style.bottom="40px";Y.appendChild(P);var X=document.createElement("div");X.style.border="1px solid";X.style.borderColor="inherit";X.style.borderRadius=
+"4px";X.style.flexGrow="1";X.style.flexShrink="1";X.style.minWidth="200px";X.style.position="relative";X.style.overflow="hidden";P.appendChild(X);var ca=document.createElementNS("http://www.w3.org/2000/svg","svg");ca.setAttribute("width","100%");ca.setAttribute("height","100%");ca.setAttribute("viewBox","0 0 400 400");ca.style.display="block";ca.style.cursor="crosshair";Q=document.createElementNS("http://www.w3.org/2000/svg","defs");W=document.createElementNS("http://www.w3.org/2000/svg","pattern");
+L="polygonGrid_"+Date.now();W.setAttribute("id",L);W.setAttribute("width",20);W.setAttribute("height",20);W.setAttribute("patternUnits","userSpaceOnUse");ba=document.createElementNS("http://www.w3.org/2000/svg","path");ba.setAttribute("d","M 20 0 L 0 0 0 20");ba.setAttribute("fill","none");ba.setAttribute("stroke","#e0e0e0");ba.setAttribute("stroke-width","0.5");W.appendChild(ba);Q.appendChild(W);ca.appendChild(Q);var S=document.createElementNS("http://www.w3.org/2000/svg","rect");S.setAttribute("x",
"-5000");S.setAttribute("y","-5000");S.setAttribute("width","10000");S.setAttribute("height","10000");S.setAttribute("fill","url(#"+L+")");ca.appendChild(S);var Z=document.createElementNS("http://www.w3.org/2000/svg","path");Z.setAttribute("fill","rgba(66, 133, 244, 0.1)");Z.setAttribute("stroke","#4285f4");Z.setAttribute("stroke-width","2");ca.appendChild(Z);var da=document.createElementNS("http://www.w3.org/2000/svg","g");ca.appendChild(da);var N=document.createElementNS("http://www.w3.org/2000/svg",
-"g");ca.appendChild(N);var aa=document.createElementNS("http://www.w3.org/2000/svg","g");ca.appendChild(aa);W.appendChild(ca);var ea=document.createElement("div");ea.style.position="absolute";ea.style.bottom="0px";ea.style.left="0px";ea.style.right="12px";ea.style.height="12px";ea.style.backgroundColor="rgba(128,128,128,0.08)";var ka=document.createElement("div");ka.style.position="absolute";ka.style.top="2px";ka.style.height="8px";ka.style.borderRadius="4px";ka.style.backgroundColor="rgba(128,128,128,0.35)";
-ka.style.cursor="pointer";ka.style.minWidth="20px";ea.appendChild(ka);W.appendChild(ea);var ra=document.createElement("div");ra.style.position="absolute";ra.style.top="0px";ra.style.right="0px";ra.style.bottom="12px";ra.style.width="12px";ra.style.backgroundColor="rgba(128,128,128,0.08)";var sa=document.createElement("div");sa.style.position="absolute";sa.style.left="2px";sa.style.width="8px";sa.style.borderRadius="4px";sa.style.backgroundColor="rgba(128,128,128,0.35)";sa.style.cursor="pointer";sa.style.minHeight=
-"20px";ra.appendChild(sa);W.appendChild(ra);var ma=!1,wa=!1,va=0,za=0;mxEvent.addListener(ka,"mousedown",function(ha){ma=!0;va=ha.clientX;za=M;ha.preventDefault();ha.stopPropagation()});mxEvent.addListener(sa,"mousedown",function(ha){wa=!0;va=ha.clientY;za=O;ha.preventDefault();ha.stopPropagation()});mxEvent.addListener(ea,"mousedown",function(ha){if(ha.target===ea){var la=ea.getBoundingClientRect().width,xa=ha.clientX-ea.getBoundingClientRect().left,Ca=1200-U;0<Ca&&(M=-400+xa/la*Ca,q());ha.preventDefault();
-ha.stopPropagation()}});mxEvent.addListener(ra,"mousedown",function(ha){if(ha.target===ra){var la=ra.getBoundingClientRect().height,xa=ha.clientY-ra.getBoundingClientRect().top,Ca=1200-T;0<Ca&&(O=-400+xa/la*Ca,q());ha.preventDefault();ha.stopPropagation()}});var Ba=function(ha){if(ma){var la=W.getBoundingClientRect().width-12,xa=parseFloat(ka.style.width)||20,Ca=1200-U;la>xa&&0<Ca&&(M=za+(ha.clientX-va)/(la-xa)*Ca,q());ha.preventDefault()}wa&&(la=W.getBoundingClientRect().height-12,xa=parseFloat(sa.style.height)||
-20,Ca=1200-T,la>xa&&0<Ca&&(O=za+(ha.clientY-va)/(la-xa)*Ca,q()),ha.preventDefault())},ua=function(ha){wa=ma=!1};mxEvent.addListener(document,"mousemove",Ba);mxEvent.addListener(document,"mouseup",ua);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var ha=ca.getBoundingClientRect();if(0<ha.width&&0<ha.height){var la=M+U/2,xa=O+T/2;U=ha.width*V;T=ha.height*V;M=la-U/2;O=xa-T/2;q()}})).observe(W);var qa=document.createElement("div");qa.style.width="200px";qa.style.flexShrink="0";qa.style.overflowY=
-"auto";qa.style.border="1px solid";qa.style.borderColor="inherit";qa.style.borderRadius="4px";qa.style.padding="4px";P.appendChild(qa);mxEvent.addGestureListeners(ca,function(ha){if(!G&&1!==ha.button&&2!==ha.button){var la=x(ha);if(null!=la)E=la.index,K=la.type,C=!0,R=!1,n=la.index;else{la=u(ha);z();if(2>l.length)l.push({x:la.x,y:la.y,type:"L"}),n=l.length-1;else{for(var xa=Infinity,Ca=l.length-1,pa=r?l.length:l.length-1,oa=0;oa<pa;oa++){var Da=(oa+1)%l.length;Da=mxUtils.ptSegDistSq(l[oa].x,l[oa].y,
-l[Da].x,l[Da].y,la.x,la.y);Da<xa&&(xa=Da,Ca=oa)}l.splice(Ca+1,0,{x:la.x,y:la.y,type:"L"});n=Ca+1}E=n;K="vertex";R=C=!0}D();mxEvent.consume(ha)}},function(ha){if(C&&0<=E&&E<l.length){R||(z(),R=!0);var la=u(ha);"control"===K?(l[E].cx=la.x,l[E].cy=la.y):(l[E].x=la.x,l[E].y=la.y);D();mxEvent.consume(ha)}},function(ha){!G&&1!==ha.button&&2!==ha.button&&C&&0<=E&&(C=!1,E=-1,K=null,mxEvent.consume(ha))});mxEvent.addListener(ca,"wheel",function(ha){ha.preventDefault();var la=ca.getBoundingClientRect(),xa=
-(ha.clientX-la.left)/la.width,Ca=(ha.clientY-la.top)/la.height,pa=M+xa*U,oa=O+Ca*T;V=Math.max(.05,Math.min(5,V*(0<ha.deltaY?1.15:1/1.15)));U=la.width*V;T=la.height*V;M=pa-xa*U;O=oa-Ca*T;q()});mxEvent.addListener(ca,"contextmenu",function(ha){ha.preventDefault()});mxEvent.addListener(ca,"mousedown",function(ha){if(1===ha.button||2===ha.button||0===ha.button&&G)fa=!0,y=ha.clientX,d=ha.clientY,p=M,A=O,ca.style.cursor="grabbing",ha.preventDefault()});var ia=function(ha){if(fa){var la=ca.getBoundingClientRect();
+"g");ca.appendChild(N);var aa=document.createElementNS("http://www.w3.org/2000/svg","g");ca.appendChild(aa);X.appendChild(ca);var ea=document.createElement("div");ea.style.position="absolute";ea.style.bottom="0px";ea.style.left="0px";ea.style.right="12px";ea.style.height="12px";ea.style.backgroundColor="rgba(128,128,128,0.08)";var ka=document.createElement("div");ka.style.position="absolute";ka.style.top="2px";ka.style.height="8px";ka.style.borderRadius="4px";ka.style.backgroundColor="rgba(128,128,128,0.35)";
+ka.style.cursor="pointer";ka.style.minWidth="20px";ea.appendChild(ka);X.appendChild(ea);var ra=document.createElement("div");ra.style.position="absolute";ra.style.top="0px";ra.style.right="0px";ra.style.bottom="12px";ra.style.width="12px";ra.style.backgroundColor="rgba(128,128,128,0.08)";var sa=document.createElement("div");sa.style.position="absolute";sa.style.left="2px";sa.style.width="8px";sa.style.borderRadius="4px";sa.style.backgroundColor="rgba(128,128,128,0.35)";sa.style.cursor="pointer";sa.style.minHeight=
+"20px";ra.appendChild(sa);X.appendChild(ra);var ma=!1,wa=!1,va=0,za=0;mxEvent.addListener(ka,"mousedown",function(ha){ma=!0;va=ha.clientX;za=M;ha.preventDefault();ha.stopPropagation()});mxEvent.addListener(sa,"mousedown",function(ha){wa=!0;va=ha.clientY;za=O;ha.preventDefault();ha.stopPropagation()});mxEvent.addListener(ea,"mousedown",function(ha){if(ha.target===ea){var la=ea.getBoundingClientRect().width,ya=ha.clientX-ea.getBoundingClientRect().left,Ca=1200-U;0<Ca&&(M=-400+ya/la*Ca,q());ha.preventDefault();
+ha.stopPropagation()}});mxEvent.addListener(ra,"mousedown",function(ha){if(ha.target===ra){var la=ra.getBoundingClientRect().height,ya=ha.clientY-ra.getBoundingClientRect().top,Ca=1200-T;0<Ca&&(O=-400+ya/la*Ca,q());ha.preventDefault();ha.stopPropagation()}});var Ba=function(ha){if(ma){var la=X.getBoundingClientRect().width-12,ya=parseFloat(ka.style.width)||20,Ca=1200-U;la>ya&&0<Ca&&(M=za+(ha.clientX-va)/(la-ya)*Ca,q());ha.preventDefault()}wa&&(la=X.getBoundingClientRect().height-12,ya=parseFloat(sa.style.height)||
+20,Ca=1200-T,la>ya&&0<Ca&&(O=za+(ha.clientY-va)/(la-ya)*Ca,q()),ha.preventDefault())},ua=function(ha){wa=ma=!1};mxEvent.addListener(document,"mousemove",Ba);mxEvent.addListener(document,"mouseup",ua);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var ha=ca.getBoundingClientRect();if(0<ha.width&&0<ha.height){var la=M+U/2,ya=O+T/2;U=ha.width*V;T=ha.height*V;M=la-U/2;O=ya-T/2;q()}})).observe(X);var qa=document.createElement("div");qa.style.width="200px";qa.style.flexShrink="0";qa.style.overflowY=
+"auto";qa.style.border="1px solid";qa.style.borderColor="inherit";qa.style.borderRadius="4px";qa.style.padding="4px";P.appendChild(qa);mxEvent.addGestureListeners(ca,function(ha){if(!G&&1!==ha.button&&2!==ha.button){var la=x(ha);if(null!=la)E=la.index,K=la.type,C=!0,R=!1,n=la.index;else{la=u(ha);z();if(2>l.length)l.push({x:la.x,y:la.y,type:"L"}),n=l.length-1;else{for(var ya=Infinity,Ca=l.length-1,pa=r?l.length:l.length-1,oa=0;oa<pa;oa++){var Ea=(oa+1)%l.length;Ea=mxUtils.ptSegDistSq(l[oa].x,l[oa].y,
+l[Ea].x,l[Ea].y,la.x,la.y);Ea<ya&&(ya=Ea,Ca=oa)}l.splice(Ca+1,0,{x:la.x,y:la.y,type:"L"});n=Ca+1}E=n;K="vertex";R=C=!0}D();mxEvent.consume(ha)}},function(ha){if(C&&0<=E&&E<l.length){R||(z(),R=!0);var la=u(ha);"control"===K?(l[E].cx=la.x,l[E].cy=la.y):(l[E].x=la.x,l[E].y=la.y);D();mxEvent.consume(ha)}},function(ha){!G&&1!==ha.button&&2!==ha.button&&C&&0<=E&&(C=!1,E=-1,K=null,mxEvent.consume(ha))});mxEvent.addListener(ca,"wheel",function(ha){ha.preventDefault();var la=ca.getBoundingClientRect(),ya=
+(ha.clientX-la.left)/la.width,Ca=(ha.clientY-la.top)/la.height,pa=M+ya*U,oa=O+Ca*T;V=Math.max(.05,Math.min(5,V*(0<ha.deltaY?1.15:1/1.15)));U=la.width*V;T=la.height*V;M=pa-ya*U;O=oa-Ca*T;q()});mxEvent.addListener(ca,"contextmenu",function(ha){ha.preventDefault()});mxEvent.addListener(ca,"mousedown",function(ha){if(1===ha.button||2===ha.button||0===ha.button&&G)fa=!0,y=ha.clientX,d=ha.clientY,p=M,A=O,ca.style.cursor="grabbing",ha.preventDefault()});var ia=function(ha){if(fa){var la=ca.getBoundingClientRect();
M=p-(ha.clientX-y)/la.width*U;O=A-(ha.clientY-d)/la.height*T;q();ha.preventDefault()}},ja=function(ha){fa&&(fa=!1,ca.style.cursor=G?"grab":"crosshair")};mxEvent.addListener(document,"mousemove",ia);mxEvent.addListener(document,"mouseup",ja);P=document.createElement("div");P.style.display="flex";P.style.alignItems="center";P.style.gap="6px";P.style.position="absolute";P.style.left="0px";P.style.right="0px";P.style.bottom="0px";P.style.height="34px";var na=b.createToolbarButton(Editor.undoImage,mxResources.get("undo"),
-function(){F()});P.appendChild(na);var Aa=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){J()});P.appendChild(Aa);Q=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){g(V/1.15)});P.appendChild(Q);Q=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){g(1.15*V)});P.appendChild(Q);Q=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var ha=ca.getBoundingClientRect();if(0<ha.width&&0<ha.height){if(1==
-V)if(0<l.length){for(var la=l[0].x,xa=l[0].y,Ca=l[0].x,pa=l[0].y,oa=1;oa<l.length;oa++)la=Math.min(la,l[oa].x),xa=Math.min(xa,l[oa].y),Ca=Math.max(Ca,l[oa].x),pa=Math.max(pa,l[oa].y),"Q"===l[oa].type&&(la=Math.min(la,l[oa].cx),xa=Math.min(xa,l[oa].cy),Ca=Math.max(Ca,l[oa].cx),pa=Math.max(pa,l[oa].cy));Ca=Ca-la+40;pa=pa-xa+40;V=1/Math.min(ha.width/Ca,ha.height/pa);U=ha.width*V;T=ha.height*V;M=la-20+(Ca-U)/2;O=xa-20+(pa-T)/2}else V=1,U=ha.width,T=ha.height,M=(400-U)/2,O=(400-T)/2;else V=1,U=ha.width*
-V,T=ha.height*V,M=(400-U)/2,O=(400-T)/2;q()}});P.appendChild(Q);Q=mxUtils.button(mxResources.get("deleteAll"),function(){0<l.length&&(z(),l=[],n=-1,D())});Q.className="geBtn";Q.style.padding="2px 10px";Q.style.fontSize="12px";P.appendChild(Q);Q=document.createElement("span");Q.style.flexGrow="1";P.appendChild(Q);Q=document.createElement("label");Q.style.display="flex";Q.style.alignItems="center";Q.style.gap="4px";Q.style.fontSize="12px";Q.style.cursor="pointer";Q.style.whiteSpace="nowrap";X=document.createElement("input");
-X.type="checkbox";X.checked=t;mxEvent.addListener(X,"change",function(){t=this.checked;S.style.display=t?"":"none"});Q.appendChild(X);mxUtils.write(Q,mxResources.get("grid"));P.appendChild(Q);Q=document.createElement("label");Q.style.display="flex";Q.style.alignItems="center";Q.style.gap="4px";Q.style.fontSize="12px";Q.style.cursor="pointer";Q.style.whiteSpace="nowrap";X=document.createElement("input");X.type="checkbox";X.checked=r;mxEvent.addListener(X,"change",function(){r=this.checked;D()});Q.appendChild(X);
-mxUtils.write(Q,mxResources.get("closePath"));P.appendChild(Q);Q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});Q.className="geBtn";X=mxUtils.button(mxResources.get("apply"),function(){if(2>l.length)b.showError(mxResources.get("error"),mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var ha=l[0].x,la=l[0].x,xa=l[0].y,Ca=l[0].y,pa=0;pa<l.length;pa++)ha=Math.min(ha,l[pa].x),la=Math.max(la,l[pa].x),xa=Math.min(xa,l[pa].y),Ca=Math.max(Ca,l[pa].y),"Q"===l[pa].type&&
-(ha=Math.min(ha,l[pa].cx),la=Math.max(la,l[pa].cx),xa=Math.min(xa,l[pa].cy),Ca=Math.max(Ca,l[pa].cy));var oa=la-ha,Da=Ca-xa,Fa=function(Ha){return 0<oa?Math.round((Ha-ha)/oa*1E5)/1E5:.5},Ia=function(Ha){return 0<Da?Math.round((Ha-xa)/Da*1E5)/1E5:.5};la=[];Ca=[];for(pa=0;pa<l.length;pa++)la.push([Fa(l[pa].x),Ia(l[pa].y)]),0<pa&&("Q"===l[pa].type?Ca.push(["Q",Fa(l[pa].cx),Ia(l[pa].cy)]):Ca.push([]));r&&2<l.length&&"Q"===l[0].type&&Ca.push(["Q",Fa(l[0].cx),Ia(l[0].cy)]);if(null!=m)pa="shape=mxgraph.basic.polygon;polyCoords="+
-JSON.stringify(la)+";polyCurves="+JSON.stringify(Ca)+";polyline="+(r?"0":"1")+";whiteSpace=wrap;html=1;",m(pa);else{pa=f.getCellGeometry(k);null!=pa&&(pa=pa.clone(),0<oa&&(pa.x+=ha/400*pa.width,pa.width*=oa/400),0<Da&&(pa.y+=xa/400*pa.height,pa.height*=Da/400));f.getModel().beginUpdate();try{null!=pa&&f.getModel().setGeometry(k,pa),f.setCellStyles("polyCoords",JSON.stringify(la),[k]),f.setCellStyles("polyCurves",JSON.stringify(Ca),[k]),f.setCellStyles("polyline",r?"0":"1",[k])}finally{f.getModel().endUpdate()}}b.hideDialog()}});
-X.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(P.appendChild(Q),P.appendChild(X)):(P.appendChild(X),P.appendChild(Q));Y.appendChild(P);mxEvent.addListener(Y,"keydown",function(ha){32===ha.keyCode?(G||(G=!0,ca.style.cursor="grab"),mxEvent.consume(ha)):46===ha.keyCode||8===ha.keyCode?0<=n&&n<l.length&&"INPUT"!==ha.target.tagName&&(z(),l.splice(n,1),n>=l.length&&(n=l.length-1),D(),mxEvent.consume(ha)):90===ha.keyCode&&(ha.ctrlKey||ha.metaKey)?(ha.shiftKey?J():F(),mxEvent.consume(ha)):89===ha.keyCode&&
-(ha.ctrlKey||ha.metaKey)&&(J(),mxEvent.consume(ha))});mxEvent.addListener(Y,"keyup",function(ha){32===ha.keyCode&&(G=!1,fa||(ca.style.cursor="crosshair"))});D();H();this.init=function(){Y.focus();var ha=ca.getBoundingClientRect();0<ha.width&&0<ha.height&&(V=1,U=ha.width*V,T=ha.height*V,M=(400-U)/2,O=(400-T)/2,q())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",Ba);mxEvent.removeListener(document,"mouseup",ua);mxEvent.removeListener(document,"mousemove",ia);mxEvent.removeListener(document,
+function(){F()});P.appendChild(na);var Aa=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){I()});P.appendChild(Aa);Q=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){g(V/1.15)});P.appendChild(Q);Q=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){g(1.15*V)});P.appendChild(Q);Q=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var ha=ca.getBoundingClientRect();if(0<ha.width&&0<ha.height){if(1==
+V)if(0<l.length){for(var la=l[0].x,ya=l[0].y,Ca=l[0].x,pa=l[0].y,oa=1;oa<l.length;oa++)la=Math.min(la,l[oa].x),ya=Math.min(ya,l[oa].y),Ca=Math.max(Ca,l[oa].x),pa=Math.max(pa,l[oa].y),"Q"===l[oa].type&&(la=Math.min(la,l[oa].cx),ya=Math.min(ya,l[oa].cy),Ca=Math.max(Ca,l[oa].cx),pa=Math.max(pa,l[oa].cy));Ca=Ca-la+40;pa=pa-ya+40;V=1/Math.min(ha.width/Ca,ha.height/pa);U=ha.width*V;T=ha.height*V;M=la-20+(Ca-U)/2;O=ya-20+(pa-T)/2}else V=1,U=ha.width,T=ha.height,M=(400-U)/2,O=(400-T)/2;else V=1,U=ha.width*
+V,T=ha.height*V,M=(400-U)/2,O=(400-T)/2;q()}});P.appendChild(Q);Q=mxUtils.button(mxResources.get("deleteAll"),function(){0<l.length&&(z(),l=[],n=-1,D())});Q.className="geBtn";Q.style.padding="2px 10px";Q.style.fontSize="12px";P.appendChild(Q);Q=document.createElement("span");Q.style.flexGrow="1";P.appendChild(Q);Q=document.createElement("label");Q.style.display="flex";Q.style.alignItems="center";Q.style.gap="4px";Q.style.fontSize="12px";Q.style.cursor="pointer";Q.style.whiteSpace="nowrap";W=document.createElement("input");
+W.type="checkbox";W.checked=t;mxEvent.addListener(W,"change",function(){t=this.checked;S.style.display=t?"":"none"});Q.appendChild(W);mxUtils.write(Q,mxResources.get("grid"));P.appendChild(Q);Q=document.createElement("label");Q.style.display="flex";Q.style.alignItems="center";Q.style.gap="4px";Q.style.fontSize="12px";Q.style.cursor="pointer";Q.style.whiteSpace="nowrap";W=document.createElement("input");W.type="checkbox";W.checked=r;mxEvent.addListener(W,"change",function(){r=this.checked;D()});Q.appendChild(W);
+mxUtils.write(Q,mxResources.get("closePath"));P.appendChild(Q);Q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});Q.className="geBtn";W=mxUtils.button(mxResources.get("apply"),function(){if(2>l.length)b.showError(mxResources.get("error"),mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var ha=l[0].x,la=l[0].x,ya=l[0].y,Ca=l[0].y,pa=0;pa<l.length;pa++)ha=Math.min(ha,l[pa].x),la=Math.max(la,l[pa].x),ya=Math.min(ya,l[pa].y),Ca=Math.max(Ca,l[pa].y),"Q"===l[pa].type&&
+(ha=Math.min(ha,l[pa].cx),la=Math.max(la,l[pa].cx),ya=Math.min(ya,l[pa].cy),Ca=Math.max(Ca,l[pa].cy));var oa=la-ha,Ea=Ca-ya,Ga=function(Ha){return 0<oa?Math.round((Ha-ha)/oa*1E5)/1E5:.5},Ja=function(Ha){return 0<Ea?Math.round((Ha-ya)/Ea*1E5)/1E5:.5};la=[];Ca=[];for(pa=0;pa<l.length;pa++)la.push([Ga(l[pa].x),Ja(l[pa].y)]),0<pa&&("Q"===l[pa].type?Ca.push(["Q",Ga(l[pa].cx),Ja(l[pa].cy)]):Ca.push([]));r&&2<l.length&&"Q"===l[0].type&&Ca.push(["Q",Ga(l[0].cx),Ja(l[0].cy)]);if(null!=m)pa="shape=mxgraph.basic.polygon;polyCoords="+
+JSON.stringify(la)+";polyCurves="+JSON.stringify(Ca)+";polyline="+(r?"0":"1")+";whiteSpace=wrap;html=1;",m(pa);else{pa=f.getCellGeometry(k);null!=pa&&(pa=pa.clone(),0<oa&&(pa.x+=ha/400*pa.width,pa.width*=oa/400),0<Ea&&(pa.y+=ya/400*pa.height,pa.height*=Ea/400));f.getModel().beginUpdate();try{null!=pa&&f.getModel().setGeometry(k,pa),f.setCellStyles("polyCoords",JSON.stringify(la),[k]),f.setCellStyles("polyCurves",JSON.stringify(Ca),[k]),f.setCellStyles("polyline",r?"0":"1",[k])}finally{f.getModel().endUpdate()}}b.hideDialog()}});
+W.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(P.appendChild(Q),P.appendChild(W)):(P.appendChild(W),P.appendChild(Q));Y.appendChild(P);mxEvent.addListener(Y,"keydown",function(ha){32===ha.keyCode?(G||(G=!0,ca.style.cursor="grab"),mxEvent.consume(ha)):46===ha.keyCode||8===ha.keyCode?0<=n&&n<l.length&&"INPUT"!==ha.target.tagName&&(z(),l.splice(n,1),n>=l.length&&(n=l.length-1),D(),mxEvent.consume(ha)):90===ha.keyCode&&(ha.ctrlKey||ha.metaKey)?(ha.shiftKey?I():F(),mxEvent.consume(ha)):89===ha.keyCode&&
+(ha.ctrlKey||ha.metaKey)&&(I(),mxEvent.consume(ha))});mxEvent.addListener(Y,"keyup",function(ha){32===ha.keyCode&&(G=!1,fa||(ca.style.cursor="crosshair"))});D();H();this.init=function(){Y.focus();var ha=ca.getBoundingClientRect();0<ha.width&&0<ha.height&&(V=1,U=ha.width*V,T=ha.height*V,M=(400-U)/2,O=(400-T)/2,q())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",Ba);mxEvent.removeListener(document,"mouseup",ua);mxEvent.removeListener(document,"mousemove",ia);mxEvent.removeListener(document,
"mouseup",ja)};this.container=Y};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage=
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";
Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";
@@ -13754,15 +13764,14 @@ Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.tweetImage=IMAGE_PATH+"/t
!0;Editor.enableSimpleTheme=!0;Editor.enableHashObjects=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"1"!=urlParams.embed&&window.top==window.self;Editor.defaultIncludeDiagram=!0;Editor.enableServiceWorker="0"!=urlParams.pwa&&"serviceWorker"in navigator&&("1"==urlParams.offline||"1"==urlParams.enableSW||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.draw\.io$/.test(window.location.hostname));try{Editor.enableServiceWorker&&navigator.serviceWorker}catch(d){Editor.enableServiceWorker=
!1}Editor.defaultLanguages=null;Editor.enableWebFonts=!window.mxIsElectron;Editor.enableLocalFonts=!1;Editor.localFonts=null;Editor.enableShadowOption=!mxClient.IS_SF;Editor.enableExportUrl=!0;Editor.enableRealtime=!0;Editor.enableRealtimeCache=!0;Editor.p2pSyncNotify=!1;Editor.compressXml=!0;Editor.defaultCompressed=!1;Editor.oneDriveInlinePicker=null!=window.urlParams&&"0"==window.urlParams.inlinePicker?!1:!0;Editor.globalVars=null;Editor.defaultBorder=5;Editor.addSvgMetadata=!1;Editor.mathOutputSize=
!0;Editor.enableAnimations=!0;Editor.insertAnimations=!0;Editor.enableWindowDocking="1"!=urlParams.embedInline;Editor.pasteAtMousePointer=!0;Editor.fitDiagramOnLoad=!0;Editor.fitDiagramOnPage=!0;Editor.showLinkIcons=!1;Editor.showTooltipIcons=!1;Editor.showNoteIcons=!0;Editor.tooltipFontSize=null;Editor.tooltipMaxWidth=360;Editor.expandPatternsForPrint=!0;Editor.defaultTextStyle="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;";Editor.defaultNoteStyle=
-"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;autosizeText=1;";Editor.enableAi=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.aiActions=["createPublic","create","update","assist"];Editor.gptApiKey=null!=urlParams["gpt-api-key"]?
-decodeURIComponent(urlParams["gpt-api-key"]):null;Editor.geminiApiKey=null!=urlParams["gemini-api-key"]?decodeURIComponent(urlParams["gemini-api-key"]):null;Editor.claudeApiKey=null!=urlParams["claude-api-key"]?decodeURIComponent(urlParams["claude-api-key"]):null;Editor.gptUrl=null!=urlParams["gpt-url"]?decodeURIComponent(urlParams["gpt-url"]):"https://api.openai.com/v1/chat/completions";Editor.aiGlobals={gptApiKey:Editor.gptApiKey,geminiApiKey:Editor.geminiApiKey,claudeApiKey:Editor.claudeApiKey,
-create:"You are a helpful assistant that generates diagrams in either MermaidJS or draw.io XML format based on the given prompt. Begin with a concise checklist (3-7 bullets) of what you will do; keep items conceptual, not implementation-level. Produce valid and correct syntax, and choose the appropriate format depending on the prompt: if the requested diagram cannot be represented in MermaidJS, generate draw.io XML instead but do not use indentation and newlines. When asked to modify a diagram that is given in the conversation as draw.io XML, return the complete updated diagram as draw.io XML, not MermaidJS, and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. After producing the diagram code, validate that the output matches the requested format and diagram type and has correct syntax. Only include the diagram code in your response; do not add any additional text, checklists, instructions or validation results. If the prompt is a question or does not ask for a diagram, answer it as plain text without any diagram code instead.",
+"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;autosizeText=1;";Editor.enableAi=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.aiActions=["createPublic","create","update","assist"];Editor.gptApiKey=null;Editor.geminiApiKey=
+null;Editor.claudeApiKey=null;Editor.gptUrl="https://api.openai.com/v1/chat/completions";Editor.aiGlobals={gptApiKey:Editor.gptApiKey,geminiApiKey:Editor.geminiApiKey,claudeApiKey:Editor.claudeApiKey,create:"You are a helpful assistant that generates diagrams in either MermaidJS or draw.io XML format based on the given prompt. Begin with a concise checklist (3-7 bullets) of what you will do; keep items conceptual, not implementation-level. Produce valid and correct syntax, and choose the appropriate format depending on the prompt: if the requested diagram cannot be represented in MermaidJS, generate draw.io XML instead but do not use indentation and newlines. When asked to modify a diagram that is given in the conversation as draw.io XML, return the complete updated diagram as draw.io XML, not MermaidJS, and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. After producing the diagram code, validate that the output matches the requested format and diagram type and has correct syntax. Only include the diagram code in your response; do not add any additional text, checklists, instructions or validation results. If the prompt is a question or does not ask for a diagram, answer it as plain text without any diagram code instead.",
update:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. When asked to modify the diagram, return the complete updated diagram as draw.io XML without indentation and newlines - never as MermaidJS or any other format - and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. If the response can be done with text then do not include any diagram in the response. Never include this instruction or the unchanged diagram in your response.\n{data}",
assist:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."};Editor.aiConfigs={gpt:{apiKey:"gptApiKey",endpoint:Editor.gptUrl,requestHeaders:{Authorization:"Bearer {apiKey}"},request:{model:"{model}",messages:[{role:"system",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.choices[0].message.content"},gemini:{apiKey:"geminiApiKey",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",
requestHeaders:{"X-Goog-Api-Key":"{apiKey}"},request:{system_instruction:{parts:[{text:"{action}"}]},contents:[{parts:[{text:"{prompt}"}]}]},responsePath:"$.candidates[0].content.parts[0].text"},claude:{apiKey:"claudeApiKey",endpoint:"https://api.anthropic.com/v1/messages",requestHeaders:{"X-API-Key":"{apiKey}","Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},request:{max_tokens:8192,model:"{model}",system:"{action}",messages:[{role:"user",content:"{prompt}"}]},
responsePath:"$.content[0].text"}};Editor.aiModels=[{name:"Claude 4.8 Opus",model:"claude-opus-4-8",config:"claude"},{name:"Claude 4.6 Opus",model:"claude-opus-4-6",config:"claude"},{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.maxPublicPromptLength=1E4;if("ac.draw.io"==window.location.hostname||
"aj.draw.io"==window.location.hostname||/\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname)||/\.cdn\.prod\.atlassian-dev-us-gov-mod\.net$/.test(window.location.hostname))Editor.maxPublicPromptLength=window.DRAWIO_ATLASSIAN_PROMPT_LENGTH;Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.embedSvgFonts=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(d,p){return{name:p,
-dispName:d,type:"bool",defVal:!1,isVisible:function(A,G){return 1==A.vertices.length?(G=G.editorUi.editor.graph.model,A=G.getParent(A.vertices[0]),G.isEdge(A)||G.isVertex(A)):!1},getValue:function(A,G){return"inherit"==mxUtils.getValue(A.style,p)},valueChanged:function(A,G,I,L){G=L.editorUi.editor.graph;"1"==A?G.setCellStyles(p,"inherit",I.vertices):G.setCellStyles(p,null,I.vertices)}}};Editor.isPatternFillStyle=function(d){d=mxUtils.getValue(d,"fillStyle","auto");return"auto"!=d&&"solid"!=d};Editor.commonProperties=
+dispName:d,type:"bool",defVal:!1,isVisible:function(A,G){return 1==A.vertices.length?(G=G.editorUi.editor.graph.model,A=G.getParent(A.vertices[0]),G.isEdge(A)||G.isVertex(A)):!1},getValue:function(A,G){return"inherit"==mxUtils.getValue(A.style,p)},valueChanged:function(A,G,J,L){G=L.editorUi.editor.graph;"1"==A?G.setCellStyles(p,"inherit",J.vertices):G.setCellStyles(p,null,J.vertices)}}};Editor.isPatternFillStyle=function(d){d=mxUtils.getValue(d,"fillStyle","auto");return"auto"!=d&&"solid"!=d};Editor.commonProperties=
[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(d){d.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(d,p){return"1"==mxUtils.getValue(d.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(d,p){return"1"!=mxUtils.getValue(d.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(d,p){return"1"==mxUtils.getValue(d.style,"comic",
"0")||"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(d,p){return("1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(d.style))&&0<d.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(d,p){return("1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(d.style))&&
0<d.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(d,p){return("1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(d.style)&&"dots"!=mxUtils.getValue(d.style,"fillStyle","auto"))&&0<d.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(d,p){return"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",
@@ -13802,36 +13811,36 @@ mxUtils.getValue(d.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValu
Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",mxConstants.STYLE_FONTCOLOR),Editor.createInheritProperty("Inherit Fill Color",mxConstants.STYLE_FILLCOLOR),Editor.createInheritProperty("Inherit Stroke Color",mxConstants.STYLE_STROKECOLOR)].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart, the ELK shorthands\n## elkRadial, elkOrganic, elkStress, libavoid (orthogonal edge routing), parallels\n## (spread overlapping parallel edges), or a JSON string as used in Layout, Apply.\n## Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';
Editor.canvasSupported=!1;(function(){try{var d=document.createElement("canvas");Editor.canvasSupported=!(!d.getContext||!d.getContext("2d"))}catch(p){}})();Editor.useCanvasForExport=!1;(function(){try{var d=document.createElement("canvas"),p=new Image;p.onload=function(){try{d.getContext("2d").drawImage(p,0,0);var A=d.toDataURL("image/png");Editor.useCanvasForExport=null!=A&&6<A.length}catch(G){}};p.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(A){}})();
Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var d=document.createElement("canvas");d.width=d.height=1;var p=d.toDataURL("image/jpeg");Editor.jpgSupported=null!==p.match("image/jpeg");p=d.toDataURL("image/webp");Editor.webpSupported=null!==p.match("image/webp")}catch(A){}})();Editor.loadCompatibleCss=function(d){mxUtils.lightDarkColorSupported||mxUtils.get(d||"styles/grapheditor.css",mxUtils.bind(this,function(p){if(200<=p.getStatus()&&299>=p.getStatus()){var A=document.createElement("style");
-A.type="text/css";var G=A.appendChild,I=document,L=I.createTextNode;p=p.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(p=p.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(P){}G.call(A,L.call(I,p));document.head.appendChild(A)}}))};Editor.replacePlaceholders=function(d,
-p){var A=[];if(null!=d&&null!=p){for(var G=RegExp("{([^{}\"'=;]+)}","g"),I,L=0;I=G.exec(d);){var P=I[0];if(2<P.length){var Q=p(P.substring(1,P.length-1)),ba=P;null!=Q&&(ba=Q);A.push(d.substring(L,I.index)+ba);L=I.index+P.length}}A.push(d.substring(L))}return A.join("")};Editor.executeSimpleJsonPath=function(d,p){p=p.replace(/^\$\.?/,"").split(".");p=$jscomp.makeIterator(p);for(var A=p.next();!A.done;A=p.next()){var G=A.value;if(!d)return[];if(A=G.match(/([^\[]+)\[(\d+)\]/))if(G=A[1],A=parseInt(A[2]),
-d=d[G],Array.isArray(d)&&A<d.length)d=d[A];else return[];else d=d[G]}return void 0!==d?[d]:[]};Editor.createRoughCanvas=function(d){var p=rough.canvas({getContext:function(){return d}});p.draw=function(A){var G=A.sets||[];A=A.options||this.getDefaultOptions();for(var I=0;I<G.length;I++){var L=G[I];switch(L.type){case "path":null!=A.stroke&&this._drawToContext(d,L,A);break;case "fillPath":this._drawToContext(d,L,A);break;case "fillSketch":this.fillSketch(d,L,A)}}};p.fillSketch=function(A,G,I){var L=
-d.state.strokeColor,P=d.state.strokeWidth,Q=d.state.strokeAlpha,ba=d.state.dashed,X=I.fillWeight;0>X&&(X=I.strokeWidth/2);d.setStrokeAlpha(d.state.fillAlpha);d.setStrokeColor(I.fill||"");d.setStrokeWidth(X);d.setDashed(!1);X=null!=A.root?A.root.lastChild:null;this._drawToContext(A,G,I);null!=A.root&&null!=A.root.lastChild&&A.root.lastChild!=X&&"path"==A.root.lastChild.nodeName&&A.root.lastChild.setAttribute("data-rough-fill","1");d.setDashed(ba);d.setStrokeWidth(P);d.setStrokeColor(L);d.setStrokeAlpha(Q)};
-p._drawToContext=function(A,G,I){A.begin();for(var L=0;L<G.ops.length;L++){var P=G.ops[L],Q=P.data;switch(P.op){case "move":A.moveTo(Q[0],Q[1]);break;case "bcurveTo":A.curveTo(Q[0],Q[1],Q[2],Q[3],Q[4],Q[5]);break;case "lineTo":A.lineTo(Q[0],Q[1])}}A.end();"fillPath"===G.type&&I.filled?A.fill():A.stroke()};return p};(function(){function d(L,P,Q){this.canvas=L;this.rc=P;this.shape=Q;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=
+A.type="text/css";var G=A.appendChild,J=document,L=J.createTextNode;p=p.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(p=p.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(P){}G.call(A,L.call(J,p));document.head.appendChild(A)}}))};Editor.replacePlaceholders=function(d,
+p){var A=[];if(null!=d&&null!=p){for(var G=RegExp("{([^{}\"'=;]+)}","g"),J,L=0;J=G.exec(d);){var P=J[0];if(2<P.length){var Q=p(P.substring(1,P.length-1)),ba=P;null!=Q&&(ba=Q);A.push(d.substring(L,J.index)+ba);L=J.index+P.length}}A.push(d.substring(L))}return A.join("")};Editor.executeSimpleJsonPath=function(d,p){p=p.replace(/^\$\.?/,"").split(".");p=$jscomp.makeIterator(p);for(var A=p.next();!A.done;A=p.next()){var G=A.value;if(!d)return[];if(A=G.match(/([^\[]+)\[(\d+)\]/))if(G=A[1],A=parseInt(A[2]),
+d=d[G],Array.isArray(d)&&A<d.length)d=d[A];else return[];else d=d[G]}return void 0!==d?[d]:[]};Editor.createRoughCanvas=function(d){var p=rough.canvas({getContext:function(){return d}});p.draw=function(A){var G=A.sets||[];A=A.options||this.getDefaultOptions();for(var J=0;J<G.length;J++){var L=G[J];switch(L.type){case "path":null!=A.stroke&&this._drawToContext(d,L,A);break;case "fillPath":this._drawToContext(d,L,A);break;case "fillSketch":this.fillSketch(d,L,A)}}};p.fillSketch=function(A,G,J){var L=
+d.state.strokeColor,P=d.state.strokeWidth,Q=d.state.strokeAlpha,ba=d.state.dashed,W=J.fillWeight;0>W&&(W=J.strokeWidth/2);d.setStrokeAlpha(d.state.fillAlpha);d.setStrokeColor(J.fill||"");d.setStrokeWidth(W);d.setDashed(!1);W=null!=A.root?A.root.lastChild:null;this._drawToContext(A,G,J);null!=A.root&&null!=A.root.lastChild&&A.root.lastChild!=W&&"path"==A.root.lastChild.nodeName&&A.root.lastChild.setAttribute("data-rough-fill","1");d.setDashed(ba);d.setStrokeWidth(P);d.setStrokeColor(L);d.setStrokeAlpha(Q)};
+p._drawToContext=function(A,G,J){A.begin();for(var L=0;L<G.ops.length;L++){var P=G.ops[L],Q=P.data;switch(P.op){case "move":A.moveTo(Q[0],Q[1]);break;case "bcurveTo":A.curveTo(Q[0],Q[1],Q[2],Q[3],Q[4],Q[5]);break;case "lineTo":A.lineTo(Q[0],Q[1])}}A.end();"fillPath"===G.type&&J.filled?A.fill():A.stroke()};return p};(function(){function d(L,P,Q){this.canvas=L;this.rc=P;this.shape=Q;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=
mxUtils.bind(this,d.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,d.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,d.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,d.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,d.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,d.prototype.lineTo);
this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,d.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,d.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,d.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,d.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,d.prototype.close);this.originalFill=this.canvas.fill;
this.canvas.fill=mxUtils.bind(this,d.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,d.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,d.prototype.fillAndStroke);this.path=[];this.passThrough=!1}d.prototype.moveOp="M";d.prototype.lineOp="L";d.prototype.quadOp="Q";d.prototype.curveOp="C";d.prototype.closeOp="Z";d.prototype.getStyle=function(L,P){var Q=1;if(null!=this.shape.state){var ba=this.shape.state.cell.id;
-if(null!=ba)for(var X=0;X<ba.length;X++)Q=(Q<<5)-Q+ba.charCodeAt(X)<<0}Q={strokeWidth:this.canvas.state.strokeWidth,seed:Q,preserveVertices:!0};ba=this.rc.getDefaultOptions();Q.stroke=L?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;L=null;(Q.filled=P)?(Q.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,L=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):Q.fill="";
+if(null!=ba)for(var W=0;W<ba.length;W++)Q=(Q<<5)-Q+ba.charCodeAt(W)<<0}Q={strokeWidth:this.canvas.state.strokeWidth,seed:Q,preserveVertices:!0};ba=this.rc.getDefaultOptions();Q.stroke=L?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;L=null;(Q.filled=P)?(Q.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,L=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):Q.fill="";
Q.bowing=mxUtils.getValue(this.shape.style,"bowing",ba.bowing);Q.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ba.hachureAngle);Q.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ba.curveFitting);Q.roughness=mxUtils.getValue(this.shape.style,"jiggle",ba.roughness);Q.simplification=mxUtils.getValue(this.shape.style,"simplification",ba.simplification);Q.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ba.disableMultiStroke);Q.disableMultiStrokeFill=
mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ba.disableMultiStrokeFill);P=mxUtils.getValue(this.shape.style,"hachureGap",-1);Q.hachureGap="auto"==P?-1:P;Q.dashGap=mxUtils.getValue(this.shape.style,"dashGap",P);Q.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",P);Q.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",P);P=mxUtils.getValue(this.shape.style,"fillWeight",-1);Q.fillWeight="auto"==P?-1:P;P=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==P&&
-(P="auto");if("auto"==P){var Y=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;P=function(W){mxUtils.isLightDarkColor(W)&&(W=mxUtils.parseLightDarkColor(W),W=Y?W.dark:W.light);return mxUtils.hex2rgb(W)};X=[P("#ffffff")];null!=this.shape.state&&X.push(P(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&X.push(P(Editor.darkColor));P=null!=Q.fill&&(null!=L||0<=mxUtils.indexOf(X,P(Q.fill)))?"solid":ba.fillStyle}Q.fillStyle=P;return Q};d.prototype.begin=
+(P="auto");if("auto"==P){var Y=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;P=function(X){mxUtils.isLightDarkColor(X)&&(X=mxUtils.parseLightDarkColor(X),X=Y?X.dark:X.light);return mxUtils.hex2rgb(X)};W=[P("#ffffff")];null!=this.shape.state&&W.push(P(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&W.push(P(Editor.darkColor));P=null!=Q.fill&&(null!=L||0<=mxUtils.indexOf(W,P(Q.fill)))?"solid":ba.fillStyle}Q.fillStyle=P;return Q};d.prototype.begin=
function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};d.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};d.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var L=2;L<arguments.length;L+=2)this.lastX=arguments[L-1],this.lastY=arguments[L],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};d.prototype.lineTo=function(L,P){this.passThrough?
this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,L,P),this.lastX=L,this.lastY=P)};d.prototype.moveTo=function(L,P){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,L,P),this.lastX=L,this.lastY=P,this.firstX=L,this.firstY=P)};d.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};d.prototype.quadTo=function(L,P,Q,ba){this.passThrough?this.originalQuadTo.apply(this.canvas,
-arguments):(this.addOp(this.quadOp,L,P,Q,ba),this.lastX=Q,this.lastY=ba)};d.prototype.curveTo=function(L,P,Q,ba,X,Y){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,L,P,Q,ba,X,Y),this.lastX=X,this.lastY=Y)};d.prototype.arcTo=function(L,P,Q,ba,X,Y,W){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var ca=mxUtils.arcToCurves(this.lastX,this.lastY,L,P,Q,ba,X,Y,W);if(null!=ca)for(var S=0;S<ca.length;S+=6)this.curveTo(ca[S],ca[S+1],ca[S+
-2],ca[S+3],ca[S+4],ca[S+5]);this.lastX=Y;this.lastY=W}};d.prototype.rect=function(L,P,Q,ba){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(L,P,Q,ba,this.getStyle(!0,!0)))};d.prototype.ellipse=function(L,P,Q,ba){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(L+Q/2,P+ba/2,Q,ba,this.getStyle(!0,!0)))};d.prototype.roundrect=function(L,P,Q,ba,X,Y){this.passThrough?
-this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(L+X,P),this.lineTo(L+Q-X,P),this.quadTo(L+Q,P,L+Q,P+Y),this.lineTo(L+Q,P+ba-Y),this.quadTo(L+Q,P+ba,L+Q-X,P+ba),this.lineTo(L+X,P+ba),this.quadTo(L,P+ba,L,P+ba-Y),this.lineTo(L,P+Y),this.quadTo(L,P,L+X,P))};d.prototype.drawPath=function(L){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),L)}catch(Q){}this.passThrough=!1}else if(null!=this.nextShape){for(var P in L)this.nextShape.options[P]=
+arguments):(this.addOp(this.quadOp,L,P,Q,ba),this.lastX=Q,this.lastY=ba)};d.prototype.curveTo=function(L,P,Q,ba,W,Y){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,L,P,Q,ba,W,Y),this.lastX=W,this.lastY=Y)};d.prototype.arcTo=function(L,P,Q,ba,W,Y,X){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var ca=mxUtils.arcToCurves(this.lastX,this.lastY,L,P,Q,ba,W,Y,X);if(null!=ca)for(var S=0;S<ca.length;S+=6)this.curveTo(ca[S],ca[S+1],ca[S+
+2],ca[S+3],ca[S+4],ca[S+5]);this.lastX=Y;this.lastY=X}};d.prototype.rect=function(L,P,Q,ba){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(L,P,Q,ba,this.getStyle(!0,!0)))};d.prototype.ellipse=function(L,P,Q,ba){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(L+Q/2,P+ba/2,Q,ba,this.getStyle(!0,!0)))};d.prototype.roundrect=function(L,P,Q,ba,W,Y){this.passThrough?
+this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(L+W,P),this.lineTo(L+Q-W,P),this.quadTo(L+Q,P,L+Q,P+Y),this.lineTo(L+Q,P+ba-Y),this.quadTo(L+Q,P+ba,L+Q-W,P+ba),this.lineTo(L+W,P+ba),this.quadTo(L,P+ba,L,P+ba-Y),this.lineTo(L,P+Y),this.quadTo(L,P,L+W,P))};d.prototype.drawPath=function(L){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),L)}catch(Q){}this.passThrough=!1}else if(null!=this.nextShape){for(var P in L)this.nextShape.options[P]=
L[P];L.stroke!=mxConstants.NONE&&null!=L.stroke||delete this.nextShape.options.stroke;L.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};d.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};d.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};d.prototype.fillAndStroke=function(){this.passThrough?
this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};d.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;
this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(L){return new d(L,Editor.createRoughCanvas(L),this)};var p=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(L){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?p.apply(this,arguments):"comic"==mxUtils.getValue(this.style,
-"sketchStyle","rough")?this.createComicCanvas(L):this.createRoughCanvas(L)};var A=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(L,P,Q,ba,X){null!=L.handJiggle&&L.handJiggle.passThrough||A.apply(this,arguments)};var G=mxShape.prototype.paint;mxShape.prototype.paint=function(L){var P=L.addTolerance,Q=!0;null!=this.style&&(Q="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=L.handJiggle&&L.handJiggle.constructor==d&&!this.outline){L.save();
-var ba=this.fill,X=this.stroke;this.stroke=this.fill=null;var Y=this.configurePointerEvents,W=L.setStrokeColor;L.setStrokeColor=function(){};var ca=L.setFillColor;L.setFillColor=function(){};Q||null==ba||(this.configurePointerEvents=function(){});L.handJiggle.passThrough=!0;G.apply(this,arguments);L.handJiggle.passThrough=!1;L.setFillColor=ca;L.setStrokeColor=W;this.configurePointerEvents=Y;this.stroke=X;this.fill=ba;L.restore();Q&&null!=ba&&(L.addTolerance=function(){})}G.apply(this,arguments);L.addTolerance=
-P};var I=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(L,P,Q,ba,X,Y){null!=L.handJiggle&&L.handJiggle.constructor==d?(L.handJiggle.passThrough=!0,I.apply(this,arguments),L.handJiggle.passThrough=!1):I.apply(this,arguments)}})();Editor.fastCompress=function(d){return null==d||0==d.length||"undefined"===typeof pako?d:Graph.arrayBufferToString(pako.deflateRaw(d))};Editor.fastDecompress=function(d){return null==d||0==d.length||"undefined"===typeof pako?d:pako.inflateRaw(Graph.stringToArrayBuffer(atob(d)),
-{to:"string"})};Editor.extractGraphModel=function(d,p,A){if(null!=d&&"undefined"!==typeof pako){var G=d.ownerDocument.getElementsByTagName("div"),I=[];if(null!=G&&0<G.length)for(var L=0;L<G.length;L++)if("mxgraph"==G[L].getAttribute("class")){I.push(G[L]);break}0<I.length&&(G=I[0].getAttribute("data-mxgraph"),null!=G?(I=JSON.parse(G),null!=I&&null!=I.xml&&(d=mxUtils.parseXml(I.xml),d=d.documentElement)):(I=I[0].getElementsByTagName("div"),0<I.length&&(G=mxUtils.getTextContent(I[0]),G=Graph.decompress(G,
-null,A),0<G.length&&(d=mxUtils.parseXml(G),d=d.documentElement))))}if(null!=d&&"svg"==d.nodeName)if(G=d.getAttribute("content"),null!=G&&"<"!=G.charAt(0)&&"%"!=G.charAt(0)&&(G=unescape(window.atob?atob(G):Base64.decode(cont,G))),null!=G&&"%"==G.charAt(0)&&(G=decodeURIComponent(G)),null!=G&&0<G.length)d=mxUtils.parseXml(G).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==d||p||(I=null,"diagram"==d.nodeName?I=d:"mxfile"==d.nodeName&&(G=d.getElementsByTagName("diagram"),0<
-G.length&&(I=G[Math.max(0,Math.min(G.length-1,urlParams.page||0))])),null!=I&&(d=Editor.parseDiagramNode(I,A)));null==d||"mxGraphModel"==d.nodeName||p&&"mxfile"==d.nodeName||(d=null);return d};Editor.parseDiagramNode=function(d,p,A){Editor.validateDiagramNode(d);var G=mxUtils.trim(mxUtils.getTextContent(d)),I=null;0<G.length?(p=Graph.decompress(G,null,p),null!=p&&0<p.length&&(I=mxUtils.parseXml(p).documentElement)):(d=mxUtils.getChildNodes(d),0<d.length&&(I=d[0],A&&(I=Editor.parseDiagramNode(I,p,
-!1)),p=mxUtils.createXmlDocument(),p.appendChild(p.importNode(I,!0)),I=p.documentElement));return I};Editor.getDiagramNodeXml=function(d){Editor.validateDiagramNode(d);var p=mxUtils.getNodeValue(d),A=null;0<p.length?A=Graph.decompress(p):(d=d.getElementsByTagName("mxGraphModel"),null!=d&&0<d.length&&(A=mxUtils.getXml(d[0])));return A};Editor.validateDiagramNode=function(d){if(0==mxUtils.trim(mxUtils.getTextContent(d)).length&&0==mxUtils.getChildNodes(d).length){var p=new mxCodec,A=new mxGraphModel;
-d.appendChild(p.encode(A))}return d};Editor.extractGraphModelFromPdf=function(d){var p=null;d=d.substring(d.indexOf(",")+1);d=window.atob&&!mxClient.IS_SF?atob(d):Base64.decode(d,!0);if("%PDF-1.7"==d.substring(0,8)){for(var A=d.indexOf("EmbeddedFile");-1<A;){var G=d.indexOf("stream",A)+9;if(0<d.substring(A,G).indexOf("application#2Fvnd.jgraph.mxfile")){var I=d.indexOf("endstream",G-1);try{return pako.inflateRaw(Graph.stringToArrayBuffer(d.substring(G,I)),{to:"string"})}catch(W){}}A=d.indexOf("EmbeddedFile",
-A+1)}for(A=d.indexOf("/ObjStm");0<A;){G=d.indexOf("stream",A)+9;I=d.indexOf("endstream",G-1);try{var L=pako.inflateRaw(Graph.stringToArrayBuffer(d.substring(G,I)),{to:"string"}),P=L.indexOf("/Subject <");if(0<P){var Q=L.substring(P+14,L.indexOf(">",P));if(null!=Q){G=Q;I=[];for(var ba=0;ba<G.length;ba+=2){var X=G.substr(ba,2);"00"!=X&&I.push(String.fromCharCode(parseInt(X,16)))}p=I.join("")}break}}catch(W){}A=d.indexOf("/ObjStm",A+1)}}if(null==p&&"%PDF-"==d.substring(0,5)){L="";Q=P=0;var Y=[];for(X=
-null;Q<d.length;){A=d.charCodeAt(Q);Q+=1;10!=A&&(L+=String.fromCharCode(A));A=="/Subject (%3Cmxfile".charCodeAt(P)?P++:P=0;if(19==P&&(G=d.indexOf("%3C%2Fmxfile%3E",Q)+15,Q-=9,G>Q)){p=d.substring(Q,G);break}10==A&&("endobj"==L?X=null:"obj"==L.substring(L.length-3,L.length)||"xref"==L||"trailer"==L?(X=[],Y[L.split(" ")[0]]=X):null!=X&&X.push(L),L="")}}null==p&&null!=Y&&(p=Editor.extractGraphModelFromXref(Y));null!=p&&(p=decodeURIComponent(p.replace(/\\([\\()])/g,"$1").replace(/\\\(/g,"(").replace(/\\\)/g,
+"sketchStyle","rough")?this.createComicCanvas(L):this.createRoughCanvas(L)};var A=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(L,P,Q,ba,W){null!=L.handJiggle&&L.handJiggle.passThrough||A.apply(this,arguments)};var G=mxShape.prototype.paint;mxShape.prototype.paint=function(L){var P=L.addTolerance,Q=!0;null!=this.style&&(Q="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=L.handJiggle&&L.handJiggle.constructor==d&&!this.outline){L.save();
+var ba=this.fill,W=this.stroke;this.stroke=this.fill=null;var Y=this.configurePointerEvents,X=L.setStrokeColor;L.setStrokeColor=function(){};var ca=L.setFillColor;L.setFillColor=function(){};Q||null==ba||(this.configurePointerEvents=function(){});L.handJiggle.passThrough=!0;G.apply(this,arguments);L.handJiggle.passThrough=!1;L.setFillColor=ca;L.setStrokeColor=X;this.configurePointerEvents=Y;this.stroke=W;this.fill=ba;L.restore();Q&&null!=ba&&(L.addTolerance=function(){})}G.apply(this,arguments);L.addTolerance=
+P};var J=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(L,P,Q,ba,W,Y){null!=L.handJiggle&&L.handJiggle.constructor==d?(L.handJiggle.passThrough=!0,J.apply(this,arguments),L.handJiggle.passThrough=!1):J.apply(this,arguments)}})();Editor.fastCompress=function(d){return null==d||0==d.length||"undefined"===typeof pako?d:Graph.arrayBufferToString(pako.deflateRaw(d))};Editor.fastDecompress=function(d){return null==d||0==d.length||"undefined"===typeof pako?d:pako.inflateRaw(Graph.stringToArrayBuffer(atob(d)),
+{to:"string"})};Editor.extractGraphModel=function(d,p,A){if(null!=d&&"undefined"!==typeof pako){var G=d.ownerDocument.getElementsByTagName("div"),J=[];if(null!=G&&0<G.length)for(var L=0;L<G.length;L++)if("mxgraph"==G[L].getAttribute("class")){J.push(G[L]);break}0<J.length&&(G=J[0].getAttribute("data-mxgraph"),null!=G?(J=JSON.parse(G),null!=J&&null!=J.xml&&(d=mxUtils.parseXml(J.xml),d=d.documentElement)):(J=J[0].getElementsByTagName("div"),0<J.length&&(G=mxUtils.getTextContent(J[0]),G=Graph.decompress(G,
+null,A),0<G.length&&(d=mxUtils.parseXml(G),d=d.documentElement))))}if(null!=d&&"svg"==d.nodeName)if(G=d.getAttribute("content"),null!=G&&"<"!=G.charAt(0)&&"%"!=G.charAt(0)&&(G=unescape(window.atob?atob(G):Base64.decode(cont,G))),null!=G&&"%"==G.charAt(0)&&(G=decodeURIComponent(G)),null!=G&&0<G.length)d=mxUtils.parseXml(G).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==d||p||(J=null,"diagram"==d.nodeName?J=d:"mxfile"==d.nodeName&&(G=d.getElementsByTagName("diagram"),0<
+G.length&&(J=G[Math.max(0,Math.min(G.length-1,urlParams.page||0))])),null!=J&&(d=Editor.parseDiagramNode(J,A)));null==d||"mxGraphModel"==d.nodeName||p&&"mxfile"==d.nodeName||(d=null);return d};Editor.parseDiagramNode=function(d,p,A){Editor.validateDiagramNode(d);var G=mxUtils.trim(mxUtils.getTextContent(d)),J=null;0<G.length?(p=Graph.decompress(G,null,p),null!=p&&0<p.length&&(J=mxUtils.parseXml(p).documentElement)):(d=mxUtils.getChildNodes(d),0<d.length&&(J=d[0],A&&(J=Editor.parseDiagramNode(J,p,
+!1)),p=mxUtils.createXmlDocument(),p.appendChild(p.importNode(J,!0)),J=p.documentElement));return J};Editor.getDiagramNodeXml=function(d){Editor.validateDiagramNode(d);var p=mxUtils.getNodeValue(d),A=null;0<p.length?A=Graph.decompress(p):(d=d.getElementsByTagName("mxGraphModel"),null!=d&&0<d.length&&(A=mxUtils.getXml(d[0])));return A};Editor.validateDiagramNode=function(d){if(0==mxUtils.trim(mxUtils.getTextContent(d)).length&&0==mxUtils.getChildNodes(d).length){var p=new mxCodec,A=new mxGraphModel;
+d.appendChild(p.encode(A))}return d};Editor.extractGraphModelFromPdf=function(d){var p=null;d=d.substring(d.indexOf(",")+1);d=window.atob&&!mxClient.IS_SF?atob(d):Base64.decode(d,!0);if("%PDF-1.7"==d.substring(0,8)){for(var A=d.indexOf("EmbeddedFile");-1<A;){var G=d.indexOf("stream",A)+9;if(0<d.substring(A,G).indexOf("application#2Fvnd.jgraph.mxfile")){var J=d.indexOf("endstream",G-1);try{return pako.inflateRaw(Graph.stringToArrayBuffer(d.substring(G,J)),{to:"string"})}catch(X){}}A=d.indexOf("EmbeddedFile",
+A+1)}for(A=d.indexOf("/ObjStm");0<A;){G=d.indexOf("stream",A)+9;J=d.indexOf("endstream",G-1);try{var L=pako.inflateRaw(Graph.stringToArrayBuffer(d.substring(G,J)),{to:"string"}),P=L.indexOf("/Subject <");if(0<P){var Q=L.substring(P+14,L.indexOf(">",P));if(null!=Q){G=Q;J=[];for(var ba=0;ba<G.length;ba+=2){var W=G.substr(ba,2);"00"!=W&&J.push(String.fromCharCode(parseInt(W,16)))}p=J.join("")}break}}catch(X){}A=d.indexOf("/ObjStm",A+1)}}if(null==p&&"%PDF-"==d.substring(0,5)){L="";Q=P=0;var Y=[];for(W=
+null;Q<d.length;){A=d.charCodeAt(Q);Q+=1;10!=A&&(L+=String.fromCharCode(A));A=="/Subject (%3Cmxfile".charCodeAt(P)?P++:P=0;if(19==P&&(G=d.indexOf("%3C%2Fmxfile%3E",Q)+15,Q-=9,G>Q)){p=d.substring(Q,G);break}10==A&&("endobj"==L?W=null:"obj"==L.substring(L.length-3,L.length)||"xref"==L||"trailer"==L?(W=[],Y[L.split(" ")[0]]=W):null!=W&&W.push(L),L="")}}null==p&&null!=Y&&(p=Editor.extractGraphModelFromXref(Y));null!=p&&(p=decodeURIComponent(p.replace(/\\([\\()])/g,"$1").replace(/\\\(/g,"(").replace(/\\\)/g,
")")));return p};Editor.extractGraphModelFromXref=function(d){var p=d.trailer,A=null;null!=p&&(p=/.* \/Info (\d+) (\d+) R/g.exec(p.join("\n")),null!=p&&0<p.length&&(p=d[p[1]],null!=p&&(p=/.* \/Subject (\d+) (\d+) R/g.exec(p.join("\n")),null!=p&&0<p.length&&(d=d[p[1]],null!=d&&(d=d.join("\n"),A=d.substring(1,d.length-1))))));return A};Editor.extractParserError=function(d,p){var A=null;d=null!=d?d.getElementsByTagName("parsererror"):null;null!=d&&0<d.length&&(A=p||mxResources.get("invalidChars"),p=
d[0].getElementsByTagName("div"),0<p.length&&(A=mxUtils.getTextContent(p[0])));return null!=A?mxUtils.trim(A):A};Editor.addRetryToError=function(d,p){null!=d&&(d=null!=d.error?d.error:d,null==d.retry&&(d.retry=p))};Editor.mermaidToDrawio=function(d,p,A){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(d,p,A)};Editor.configure=function(d){if(null!=d){Editor.config=d;Editor.configVersion=d.version;d.debug&&(urlParams.test="1");d.passiveScroll&&(Editor.passiveScroll=!0);d.noResizers&&
(Editor.noResizers=!0);d.preserveViewState&&(Editor.preserveViewState=!0);null!=d.passThroughKeys&&(Editor.passThroughKeys=d.passThroughKeys);null!=d.keyboardShortcuts&&(Array.isArray(d.keyboardShortcuts)?Editor.keyboardShortcuts=d.keyboardShortcuts:EditorUi.debug("Configuration Error: Array expected for keyboardShortcuts"));d.suppressNewWindows&&(Editor.suppressNewWindows=!0,Editor.popupsAllowed=!1);d.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=d.useInternalClipboard);if(null!=
@@ -13858,80 +13867,80 @@ d.thumbWidth);null!=d.thumbHeight&&(Sidebar.prototype.thumbHeight=d.thumbHeight)
(EditorUi.prototype.maxImageBytes=d.maxImageBytes);null!=d.maxImageSize&&(EditorUi.prototype.maxImageSize=d.maxImageSize);null!=d.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=d.shareCursorPosition);null!=d.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=d.showRemoteCursors);null!=d.restrictExport&&(DrawioFile.RESTRICT_EXPORT=d.restrictExport);null!=d.removeImageMetadata&&(Editor.removeImageMetadata=d.removeImageMetadata);null!=d.defaultTextStyle&&(Editor.defaultTextStyle=
d.defaultTextStyle);null!=d.replaceSvgDataUris&&(Editor.replaceSvgDataUris=d.replaceSvgDataUris);null!=d.foreignObjectImages&&(Editor.foreignObjectImages=d.foreignObjectImages);null!=d.embedSvgFonts&&(Editor.embedSvgFonts=d.embedSvgFonts);null!=d.shadowColor&&(mxConstants.SHADOW_COLOR=d.shadowColor);null!=d.shadowOpacity&&(mxConstants.SHADOW_OPACITY=d.shadowOpacity);null!=d.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=d.shadowOffsetX);null!=d.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=d.shadowOffsetY);
null!=d.shadowBlur&&(mxConstants.SHADOW_BLUR=d.shadowBlur);null!=d.enableAnimations&&(Editor.enableAnimations=d.enableAnimations);null!=d.insertAnimations&&(Editor.insertAnimations=d.insertAnimations);null!=d.enableWindowDocking&&(Editor.enableWindowDocking=d.enableWindowDocking);null!=d.compact&&(EditorUi.prototype.defaultCompact=d.compact);null!=d.noAutoFocus&&(EditorUi.prototype.noAutoFocus=d.noAutoFocus);if(null!=d.hideMenuItems)if(Array.isArray(d.hideMenuItems))for(Menus.prototype.hiddenMenuItems=
-{},p=0;p<d.hideMenuItems.length;p++)Menus.prototype.hiddenMenuItems[d.hideMenuItems[p]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=d.hideMenus)if(Array.isArray(d.hideMenus)){var G={};for(p=0;p<d.hideMenus.length;p++)G[d.hideMenus[p]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(I){return!G[I]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=d.enableAi&&(Editor.enableAi=d.enableAi);
+{},p=0;p<d.hideMenuItems.length;p++)Menus.prototype.hiddenMenuItems[d.hideMenuItems[p]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=d.hideMenus)if(Array.isArray(d.hideMenus)){var G={};for(p=0;p<d.hideMenus.length;p++)G[d.hideMenus[p]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(J){return!G[J]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=d.enableAi&&(Editor.enableAi=d.enableAi);
null!=d.enableChatGpt&&(Editor.enableAi=d.enableChatGpt);null!=d.gptApiKey&&(Editor.aiGlobals.gptApiKey=d.gptApiKey);null!=d.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=d.geminiApiKey);null!=d.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=d.claudeApiKey);null!=d.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=d.gptUrl);null!=d.aiActions&&(Editor.aiActions=d.aiActions);null!=d.aiGlobals&&(Editor.aiGlobals=d.aiGlobals);null!=d.aiConfigs&&(Editor.aiConfigs=d.aiConfigs);null!=d.aiModels&&
(Editor.aiModels=d.aiModels)}};Editor.applyCustomResources=function(){if(null!=Editor.customResources){var d=null!=mxClient.language?mxClient.language.toLowerCase():null,p=null!=d?d.indexOf("-"):-1,A;for(A in Editor.customResources){var G=Editor.customResources[A];null!=G&&"object"===typeof G&&(G=(null!=d?G[d]:null)||(0<p?G[d.substring(0,p)]:null)||G.main);"string"===typeof G&&(mxResources.resources[A]=G)}}};var b=mxResources.parse;mxResources.parse=function(d){b.apply(this,arguments);Editor.applyCustomResources()};
-Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=function(d){function p(ba,X){ba=ba.getAttribute("fill");if(null==ba||0!==ba.indexOf("url("))return null;ba=ba.match(/url\([^#]*#([^)"]+)\)?/);if(null==ba)return null;ba=ba[1];try{var Y=X.querySelector("#"+CSS.escape(ba));return null!=Y&&"pattern"===Y.nodeName?Y:null}catch(W){return null}}function A(ba,X,Y){var W,ca,S;try{var Z=ba.getBBox()}catch(ia){return}if(0!==
-Z.width&&0!==Z.height){var da=parseFloat(X.getAttribute("width")),N=parseFloat(X.getAttribute("height"));if(!(isNaN(da)||isNaN(N)||0>=da||0>=N)){var aa=X.getAttribute("patternTransform");var ea=ca=W=0;var ka=S=1;if(null!=aa){var ra=aa.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=ra&&(W=parseFloat(ra[1]),ca=parseFloat(ra[2]));ra=aa.match(/rotate\(\s*([^)]+)\)/);null!=ra&&(ea=parseFloat(ra[1])*Math.PI/180);aa=aa.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=aa&&(S=parseFloat(aa[1]),
-ka=null!=aa[2]?parseFloat(aa[2]):S)}var sa=[{x:Z.x,y:Z.y},{x:Z.x+Z.width,y:Z.y},{x:Z.x+Z.width,y:Z.y+Z.height},{x:Z.x,y:Z.y+Z.height}],ma=Infinity;Z=Infinity;ra=aa=-Infinity;for(var wa=0;wa<sa.length;wa++){var va=sa[wa].x-W;var za=sa[wa].y-ca,Ba=Math.cos(-ea),ua=Math.sin(-ea);var qa=(va*Ba-za*ua)/S;va=(va*ua+za*Ba)/ka;ma=Math.min(ma,qa);Z=Math.min(Z,va);aa=Math.max(aa,qa);ra=Math.max(ra,va)}ma=Math.floor(ma/da)-1;Z=Math.floor(Z/N)-1;aa=Math.ceil(aa/da)+1;qa=Math.ceil(ra/N)+1;if(!(1E4<(aa-ma)*(qa-
-Z))){wa=I+ ++G;ra=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");ra.setAttribute("id",wa);sa=ba.cloneNode(!0);sa.removeAttribute("fill");sa.removeAttribute("fill-opacity");sa.removeAttribute("stroke");sa.removeAttribute("stroke-width");sa.removeAttribute("stroke-opacity");sa.removeAttribute("style");sa.removeAttribute("pointer-events");sa.setAttribute("fill","black");ra.appendChild(sa);sa=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");sa.setAttribute("clip-path",
-"url(#"+wa+")");wa=ba.getAttribute("fill-opacity");null!=wa&&sa.setAttribute("opacity",wa);wa=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");wa.setAttribute("transform","translate("+W+","+ca+")"+(0!==ea?" rotate("+180*ea/Math.PI+")":"")+" scale("+S+(ka!==S?","+ka:"")+")");ca=I+ ++G;W=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");W.setAttribute("id",ca);ea=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect");ea.setAttribute("x","0");ea.setAttribute("y",
-"0");ea.setAttribute("width",da);ea.setAttribute("height",N);W.appendChild(ea);X=X.childNodes;for(ea=ma;ea<aa;ea++)for(S=Z;S<qa;S++){ka=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");ka.setAttribute("transform","translate("+ea*da+","+S*N+")");ka.setAttribute("clip-path","url(#"+ca+")");for(ma=0;ma<X.length;ma++)1===X[ma].nodeType&&ka.appendChild(X[ma].cloneNode(!0));wa.appendChild(ka)}sa.appendChild(wa);da=Y.querySelector("defs");null==da&&(da=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
-"defs"),Y.insertBefore(da,Y.firstChild));da.appendChild(ra);da.appendChild(W);ba.parentNode.insertBefore(sa,ba.nextSibling);ba.setAttribute("fill","none");ba.style.fill=""}}}}for(var G=0,I="expand-pattern-clip-"+Editor.guid(8)+"-",L=d.querySelectorAll('[fill^="url("]'),P=0;P<L.length;P++){var Q=p(L[P],d);null!=Q&&A(L[P],Q,d)}L=d.querySelectorAll("[style]");for(P=0;P<L.length;P++)Q=L[P].getAttribute("style"),null!=Q&&-1!==Q.indexOf("url(")&&(Q=p(L[P],d),null!=Q&&A(L[P],Q,d))};Editor.addAllowedFontUrl=
+Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=function(d){function p(ba,W){ba=ba.getAttribute("fill");if(null==ba||0!==ba.indexOf("url("))return null;ba=ba.match(/url\([^#]*#([^)"]+)\)?/);if(null==ba)return null;ba=ba[1];try{var Y=W.querySelector("#"+CSS.escape(ba));return null!=Y&&"pattern"===Y.nodeName?Y:null}catch(X){return null}}function A(ba,W,Y){var X,ca,S;try{var Z=ba.getBBox()}catch(ia){return}if(0!==
+Z.width&&0!==Z.height){var da=parseFloat(W.getAttribute("width")),N=parseFloat(W.getAttribute("height"));if(!(isNaN(da)||isNaN(N)||0>=da||0>=N)){var aa=W.getAttribute("patternTransform");var ea=ca=X=0;var ka=S=1;if(null!=aa){var ra=aa.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=ra&&(X=parseFloat(ra[1]),ca=parseFloat(ra[2]));ra=aa.match(/rotate\(\s*([^)]+)\)/);null!=ra&&(ea=parseFloat(ra[1])*Math.PI/180);aa=aa.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=aa&&(S=parseFloat(aa[1]),
+ka=null!=aa[2]?parseFloat(aa[2]):S)}var sa=[{x:Z.x,y:Z.y},{x:Z.x+Z.width,y:Z.y},{x:Z.x+Z.width,y:Z.y+Z.height},{x:Z.x,y:Z.y+Z.height}],ma=Infinity;Z=Infinity;ra=aa=-Infinity;for(var wa=0;wa<sa.length;wa++){var va=sa[wa].x-X;var za=sa[wa].y-ca,Ba=Math.cos(-ea),ua=Math.sin(-ea);var qa=(va*Ba-za*ua)/S;va=(va*ua+za*Ba)/ka;ma=Math.min(ma,qa);Z=Math.min(Z,va);aa=Math.max(aa,qa);ra=Math.max(ra,va)}ma=Math.floor(ma/da)-1;Z=Math.floor(Z/N)-1;aa=Math.ceil(aa/da)+1;qa=Math.ceil(ra/N)+1;if(!(1E4<(aa-ma)*(qa-
+Z))){wa=J+ ++G;ra=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");ra.setAttribute("id",wa);sa=ba.cloneNode(!0);sa.removeAttribute("fill");sa.removeAttribute("fill-opacity");sa.removeAttribute("stroke");sa.removeAttribute("stroke-width");sa.removeAttribute("stroke-opacity");sa.removeAttribute("style");sa.removeAttribute("pointer-events");sa.setAttribute("fill","black");ra.appendChild(sa);sa=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");sa.setAttribute("clip-path",
+"url(#"+wa+")");wa=ba.getAttribute("fill-opacity");null!=wa&&sa.setAttribute("opacity",wa);wa=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");wa.setAttribute("transform","translate("+X+","+ca+")"+(0!==ea?" rotate("+180*ea/Math.PI+")":"")+" scale("+S+(ka!==S?","+ka:"")+")");ca=J+ ++G;X=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");X.setAttribute("id",ca);ea=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect");ea.setAttribute("x","0");ea.setAttribute("y",
+"0");ea.setAttribute("width",da);ea.setAttribute("height",N);X.appendChild(ea);W=W.childNodes;for(ea=ma;ea<aa;ea++)for(S=Z;S<qa;S++){ka=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");ka.setAttribute("transform","translate("+ea*da+","+S*N+")");ka.setAttribute("clip-path","url(#"+ca+")");for(ma=0;ma<W.length;ma++)1===W[ma].nodeType&&ka.appendChild(W[ma].cloneNode(!0));wa.appendChild(ka)}sa.appendChild(wa);da=Y.querySelector("defs");null==da&&(da=Y.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
+"defs"),Y.insertBefore(da,Y.firstChild));da.appendChild(ra);da.appendChild(X);ba.parentNode.insertBefore(sa,ba.nextSibling);ba.setAttribute("fill","none");ba.style.fill=""}}}}for(var G=0,J="expand-pattern-clip-"+Editor.guid(8)+"-",L=d.querySelectorAll('[fill^="url("]'),P=0;P<L.length;P++){var Q=p(L[P],d);null!=Q&&A(L[P],Q,d)}L=d.querySelectorAll("[style]");for(P=0;P<L.length;P++)Q=L[P].getAttribute("style"),null!=Q&&-1!==Q.indexOf("url(")&&(Q=p(L[P],d),null!=Q&&A(L[P],Q,d))};Editor.addAllowedFontUrl=
function(d){"string"===typeof d&&0<d.length&&(Graph.allowedFontUrls[d]=!0)};Editor.addAllowedFontUrls=function(d){if(Array.isArray(d))for(var p=0;p<d.length;p++)null!=d[p]&&"object"===typeof d[p]&&Editor.addAllowedFontUrl(d[p].fontUrl)};Editor.configureFontCss=function(d){if(null!=d){Editor.prototype.fontCss=d;for(var p=d.split("url("),A=1;A<p.length;A++){var G=p[A].indexOf(")");0<G&&Editor.addAllowedFontUrl(Editor.trimCssUrl(p[A].substring(0,G)))}p=document.getElementsByTagName("script")[0];if(null!=
-p&&null!=p.parentNode)for(A=document.createElement("style"),A.setAttribute("type","text/css"),A.appendChild(document.createTextNode(d)),p.parentNode.insertBefore(A,p),d=d.split("url("),A=1;A<d.length;A++){G=d[A].indexOf(")");G=Editor.trimCssUrl(d[A].substring(0,G));var I=document.createElement("link");I.setAttribute("rel","preload");I.setAttribute("href",G);I.setAttribute("as","font");I.setAttribute("crossorigin","");p.parentNode.insertBefore(I,p)}}};Editor.trimCssUrl=function(d){return d.replace(RegExp("^[\\s\"']+",
+p&&null!=p.parentNode)for(A=document.createElement("style"),A.setAttribute("type","text/css"),A.appendChild(document.createTextNode(d)),p.parentNode.insertBefore(A,p),d=d.split("url("),A=1;A<d.length;A++){G=d[A].indexOf(")");G=Editor.trimCssUrl(d[A].substring(0,G));var J=document.createElement("link");J.setAttribute("rel","preload");J.setAttribute("href",G);J.setAttribute("as","font");J.setAttribute("crossorigin","");p.parentNode.insertBefore(J,p)}}};Editor.trimCssUrl=function(d){return d.replace(RegExp("^[\\s\"']+",
"g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(d){d=null!=d?d:Editor.GUID_LENGTH;for(var p=[],A=0;A<d;A++)p.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return p.join("")};Editor.updateStatusInterval=
1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",
title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.generateTimeout=9E4;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!0;var k=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(d){d=null!=d&&"mxlibrary"!=d.nodeName?this.extractGraphModel(d):null;if(null!=d){var p=Editor.extractParserError(d,mxResources.get("invalidOrMissingFile"));
if(p)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[d],"cause",[p]),Error(mxResources.get("notADiagramFile")+" ("+p+")");if("mxGraphModel"==d.nodeName){p=d.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=p&&""!=p)p!=this.graph.currentStyle&&(A=null!=this.graph.themes?this.graph.themes[p]:mxUtils.load(STYLE_PATH+"/"+p+".xml").getDocumentElement(),null!=A&&(G=new mxCodec(A.ownerDocument),G.decode(A,this.graph.getStylesheet())));else{var A=null!=this.graph.themes?
this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=A){var G=new mxCodec(A.ownerDocument);G.decode(A,this.graph.getStylesheet())}}this.graph.currentStyle=p;this.graph.mathEnabled="1"==urlParams.math||"1"==d.getAttribute("math");this.graph.setAdaptiveColors(d.getAttribute("adaptiveColors"));p=d.getAttribute("backgroundImage");null!=p?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(p)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=
-!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==d.getAttribute("shadow"),!1);if(p=d.getAttribute("extFonts"))try{for(p=p.split("|").map(function(I){I=I.split("^");return{name:I[0],url:I[1]}}),A=0;A<p.length;A++)this.graph.addExtFont(p[A].name,p[A].url)}catch(I){console.log("ExtFonts format error: "+I.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}k.apply(this,
+!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==d.getAttribute("shadow"),!1);if(p=d.getAttribute("extFonts"))try{for(p=p.split("|").map(function(J){J=J.split("^");return{name:J[0],url:J[1]}}),A=0;A<p.length;A++)this.graph.addExtFont(p[A].name,p[A].url)}catch(J){console.log("ExtFonts format error: "+J.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}k.apply(this,
arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var m=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(d,p){d=null!=d?d:!0;var A=m.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&A.setAttribute("style",this.graph.currentStyle);var G=this.graph.getBackgroundImageObject(this.graph.backgroundImage,p);null!=G&&A.setAttribute("backgroundImage",JSON.stringify(G));
-A.setAttribute("math",this.graph.mathEnabled?"1":"0");A.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?A.setAttribute("adaptiveColors",this.graph.adaptiveColors):A.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(G=this.graph.extFonts.map(function(I){return I.name+"^"+I.url}),A.setAttribute("extFonts",G.join("|")));return A};Editor.prototype.isDataSvg=function(d){try{var p=mxUtils.parseXml(d).documentElement.getAttribute("content");
+A.setAttribute("math",this.graph.mathEnabled?"1":"0");A.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?A.setAttribute("adaptiveColors",this.graph.adaptiveColors):A.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(G=this.graph.extFonts.map(function(J){return J.name+"^"+J.url}),A.setAttribute("extFonts",G.join("|")));return A};Editor.prototype.isDataSvg=function(d){try{var p=mxUtils.parseXml(d).documentElement.getAttribute("content");
if(null!=p&&(null!=p&&"<"!=p.charAt(0)&&"%"!=p.charAt(0)&&(p=unescape(window.atob?atob(p):Base64.decode(cont,p))),null!=p&&"%"==p.charAt(0)&&(p=decodeURIComponent(p)),null!=p&&0<p.length)){var A=mxUtils.parseXml(p).documentElement;return"mxfile"==A.nodeName||"mxGraphModel"==A.nodeName}}catch(G){}return!1};Editor.prototype.extractGraphModel=function(d,p,A){return Editor.extractGraphModel.apply(this,arguments)};var g=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled=
"1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();g.apply(this,arguments)};var q=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){q.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};
Editor.safeMathJaxFilterUrl=function(d,p){var A=(p.replace(/[\t\n\r]/g,"").replace(/^[\u0000-\u0020]+/,"").match(/^([a-z][a-z0-9+.\-]*):/i)||[null,""])[1].toLowerCase(),G=d.allow.URLs;return"all"===G||"safe"===G&&(d.options.safeProtocols[A]||!A)?p:null};Editor.safeMathJaxFilterUrl.drawioPatched=!0;Editor.patchMathJaxUrlFilter=function(d){d=null!=d?d:"undefined"!==typeof MathJax?MathJax:null;if(null!=d){var p=null!=d._&&null!=d._.ui&&null!=d._.ui.safe&&null!=d._.ui.safe.SafeMethods?d._.ui.safe.SafeMethods.SafeMethods:
-null;null==p||null==p.filterURL||p.filterURL.drawioPatched||(p.filterURL=Editor.safeMathJaxFilterUrl);d=null!=d.startup?d.startup.document:null;null==d||null==d.safe||null==d.safe.filterMethods||null==d.safe.filterMethods.filterURL||d.safe.filterMethods.filterURL.drawioPatched||(d.safe.filterMethods.filterURL=Editor.safeMathJaxFilterUrl)}};Editor.safeMathJaxDataMacro=function(d,p,A,G){var I=d.setAttribute;d.setAttribute=function(L,P,Q){if("string"!==typeof P||"data-"!==P.substring(0,5)||P.match(Editor.safeMathJaxDataPattern))return I.apply(this,
-arguments)};try{return p.apply(this,[A,G])}finally{d.setAttribute=I}};Editor.safeMathJaxDataPattern=/^data-mjx-/;Editor.patchMathJaxDataMacro=function(d){d=null!=d?d:"undefined"!==typeof MathJax?MathJax:null;d=null!=d&&null!=d._&&null!=d._.input?d._.input.tex:null;if(null!=d&&null!=d.MapHandler&&null!=d.NodeUtil){var p=d.MapHandler.MapHandler.getMap("html_macros");p=null!=p&&null!=p.lookup?p.lookup("data"):null;if(null!=p&&null!=p._func&&!p._func.drawioPatched){var A=d.NodeUtil["default"],G=p._func;
-d=function(I,L){return Editor.safeMathJaxDataMacro(A,G,I,L)};d.drawioPatched=!0;p._func=d}}};Editor.patchMathJaxSafeFilters=function(d){Editor.patchMathJaxUrlFilter(d);Editor.patchMathJaxDataMacro(d)};Editor.initMath=function(d,p){if("undefined"===typeof window.MathJax){var A=function(){G=null;Editor.mathJaxRendering=!1;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};d=null!=d?d:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var G=
+null;null==p||null==p.filterURL||p.filterURL.drawioPatched||(p.filterURL=Editor.safeMathJaxFilterUrl);d=null!=d.startup?d.startup.document:null;null==d||null==d.safe||null==d.safe.filterMethods||null==d.safe.filterMethods.filterURL||d.safe.filterMethods.filterURL.drawioPatched||(d.safe.filterMethods.filterURL=Editor.safeMathJaxFilterUrl)}};Editor.safeMathJaxDataMacro=function(d,p,A,G){var J=d.setAttribute;d.setAttribute=function(L,P,Q){if("string"!==typeof P||"data-"!==P.substring(0,5)||P.match(Editor.safeMathJaxDataPattern))return J.apply(this,
+arguments)};try{return p.apply(this,[A,G])}finally{d.setAttribute=J}};Editor.safeMathJaxDataPattern=/^data-mjx-/;Editor.patchMathJaxDataMacro=function(d){d=null!=d?d:"undefined"!==typeof MathJax?MathJax:null;d=null!=d&&null!=d._&&null!=d._.input?d._.input.tex:null;if(null!=d&&null!=d.MapHandler&&null!=d.NodeUtil){var p=d.MapHandler.MapHandler.getMap("html_macros");p=null!=p&&null!=p.lookup?p.lookup("data"):null;if(null!=p&&null!=p._func&&!p._func.drawioPatched){var A=d.NodeUtil["default"],G=p._func;
+d=function(J,L){return Editor.safeMathJaxDataMacro(A,G,J,L)};d.drawioPatched=!0;p._func=d}}};Editor.patchMathJaxSafeFilters=function(d){Editor.patchMathJaxUrlFilter(d);Editor.patchMathJaxDataMacro(d)};Editor.initMath=function(d,p){if("undefined"===typeof window.MathJax){var A=function(){G=null;Editor.mathJaxRendering=!1;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};d=null!=d?d:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var G=
null;Editor.mathJaxRendering=!1;Editor.doMathJaxRender=function(P){Editor.patchMathJaxSafeFilters();null!=MathJax.startup&&null!=MathJax.startup.output&&null!=MathJax.startup.output.options&&null!=MathJax.startup.output.options.linebreaks&&(MathJax.startup.output.options.linebreaks.inline=!1);try{null==G?(MathJax.typesetClear([P]),MathJax.typeset([P]),A()):G!=P&&Editor.mathJaxQueue.push(P)}catch(Q){MathJax.typesetClear([P]),null!=Q.retry?(G=P,Editor.mathJaxRendering=!0,Q.retry.then(function(){MathJax.typesetPromise([P]).then(A)["catch"](function(ba){console.log("Error in MathJax.typesetPromise: "+
ba.toString());A()})})["catch"](function(ba){console.log("Error in MathJax.retry: "+ba.toString());A()})):null!=window.console&&console.log("Error in MathJax.typeset: "+Q.toString())}};window.MathJax=null!=p?p:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe","[tex]/html"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var P=
-0;P<Editor.mathJaxQueue.length;P++)Editor.doMathJaxRender(Editor.mathJaxQueue[P])}}};Editor.MathJaxRender=function(P){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(P):Editor.mathJaxQueue.push(P)};Editor.onMathJaxDone=function(){};var I=Editor.prototype.init;Editor.prototype.init=function(){I.apply(this,arguments);var P=mxUtils.bind(this,function(X,Y){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility=
+0;P<Editor.mathJaxQueue.length;P++)Editor.doMathJaxRender(Editor.mathJaxQueue[P])}}};Editor.MathJaxRender=function(P){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(P):Editor.mathJaxQueue.push(P)};Editor.onMathJaxDone=function(){};var J=Editor.prototype.init;Editor.prototype.init=function(){J.apply(this,arguments);var P=mxUtils.bind(this,function(W,Y){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility=
"hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,P);this.graph.addListener(mxEvent.REFRESH,P);var Q=this.graph,ba=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){null!=ba&&ba.apply(this,arguments);Editor.mathOutputSize&&null!=Q&&Q.mathEnabled&&(Q.refreshMathBounds(),null!=Q.container&&(Q.container.style.visibility=""))}};p=document.getElementsByTagName("script");if(null!=p&&0<p.length){var L=document.createElement("script");L.setAttribute("type",
-"text/javascript");L.setAttribute("src",d);p[0].parentNode.appendChild(L)}}};Editor.containsMath=function(d){return null!=d&&(0<=d.indexOf("$")||0<=d.indexOf("\\(")||0<=d.indexOf("\\[")||0<=d.indexOf("\\begin{"))};(function(){var d=Graph.prototype.getPreferredSizeForCell,p=null;Graph.prototype.getPreferredSizeForCell=function(A,G,I){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(A))return d.apply(this,arguments);var L=
-this.view.createState(A);L=null!=L?this.cellRenderer.getLabelValue(L):null;if(null==L||0===L.length||!Editor.containsMath(L))return d.apply(this,arguments);var P=mxUtils.getSizeForString;mxUtils.getSizeForString=function(Q,ba,X,Y){null==p&&(p=document.createElement("div"),p.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(p));p.style.fontSize=ba+"px";p.style.fontFamily=X;null!=Y&&0<Y?(p.style.width=Y+"px",p.style.whiteSpace=
-"normal"):(p.style.width="",p.style.whiteSpace="nowrap");MathJax.typesetClear([p]);p.innerHTML=Graph.sanitizeHtml(Q);try{MathJax.typeset([p]);var W=p.getBoundingClientRect();return new mxRectangle(0,0,W.width,W.height)}catch(ca){return P.apply(this,arguments)}};try{return d.apply(this,arguments)}finally{mxUtils.getSizeForString=P}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var d=this.view,p=!1;d.states.visit(mxUtils.bind(this,function(G,I){null!=
-I&&null!=I.text&&(G=this.cellRenderer.getLabelValue(I),"string"===typeof G&&Editor.containsMath(G)&&(I.text.updateBoundingBox(),p=!0))}));if(p){var A=null!=d.currentRoot?d.currentRoot:this.model.getRoot();A=d.getState(A);null!=A&&(A=d.getBoundingBox(A,!0,!1),d.setGraphBounds(null!=A?A:d.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var d=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(p){d.apply(this,arguments);
-var A=this.editor.graph;if(Editor.mathOutputSize&&null!=A&&A.mathEnabled){var G=arguments,I=this,L=!1,P=function(){L||(L=!0,A.removeListener(P),A.zoomTo(1),I.resetScrollbars(),d.apply(I,G))};A.addListener("mathRefreshed",P);Promise.resolve().then(function(){L||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||A.removeListener(P)})}}})();Editor.prototype.csvToArray=function(d){if(0<d.length){var p="",
-A=[""],G=0,I=!0,L;d=$jscomp.makeIterator(d);for(L=d.next();!L.done;L=d.next())L=L.value,'"'===L?(I&&L===p&&(A[G]+=L),I=!I):","===L&&I?L=A[++G]="":A[G]+=L,p=L;return A}return[]};Editor.prototype.getProxiedUrl=function(d){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(d)){var p=EditorUi.isVisioFilename(d);p=/\.png$/i.test(d)||/\.pdf$/i.test(d)||p;var A="t="+(new Date).getTime();d=PROXY_URL+"?url="+encodeURIComponent(d)+
+"text/javascript");L.setAttribute("src",d);p[0].parentNode.appendChild(L)}}};Editor.containsMath=function(d){return null!=d&&(0<=d.indexOf("$")||0<=d.indexOf("\\(")||0<=d.indexOf("\\[")||0<=d.indexOf("\\begin{"))};(function(){var d=Graph.prototype.getPreferredSizeForCell,p=null;Graph.prototype.getPreferredSizeForCell=function(A,G,J){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(A))return d.apply(this,arguments);var L=
+this.view.createState(A);L=null!=L?this.cellRenderer.getLabelValue(L):null;if(null==L||0===L.length||!Editor.containsMath(L))return d.apply(this,arguments);var P=mxUtils.getSizeForString;mxUtils.getSizeForString=function(Q,ba,W,Y){null==p&&(p=document.createElement("div"),p.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(p));p.style.fontSize=ba+"px";p.style.fontFamily=W;null!=Y&&0<Y?(p.style.width=Y+"px",p.style.whiteSpace=
+"normal"):(p.style.width="",p.style.whiteSpace="nowrap");MathJax.typesetClear([p]);p.innerHTML=Graph.sanitizeHtml(Q);try{MathJax.typeset([p]);var X=p.getBoundingClientRect();return new mxRectangle(0,0,X.width,X.height)}catch(ca){return P.apply(this,arguments)}};try{return d.apply(this,arguments)}finally{mxUtils.getSizeForString=P}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var d=this.view,p=!1;d.states.visit(mxUtils.bind(this,function(G,J){null!=
+J&&null!=J.text&&(G=this.cellRenderer.getLabelValue(J),"string"===typeof G&&Editor.containsMath(G)&&(J.text.updateBoundingBox(),p=!0))}));if(p){var A=null!=d.currentRoot?d.currentRoot:this.model.getRoot();A=d.getState(A);null!=A&&(A=d.getBoundingBox(A,!0,!1),d.setGraphBounds(null!=A?A:d.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var d=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(p){d.apply(this,arguments);
+var A=this.editor.graph;if(Editor.mathOutputSize&&null!=A&&A.mathEnabled){var G=arguments,J=this,L=!1,P=function(){L||(L=!0,A.removeListener(P),A.zoomTo(1),J.resetScrollbars(),d.apply(J,G))};A.addListener("mathRefreshed",P);Promise.resolve().then(function(){L||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||A.removeListener(P)})}}})();Editor.prototype.csvToArray=function(d){if(0<d.length){var p="",
+A=[""],G=0,J=!0,L;d=$jscomp.makeIterator(d);for(L=d.next();!L.done;L=d.next())L=L.value,'"'===L?(J&&L===p&&(A[G]+=L),J=!J):","===L&&J?L=A[++G]="":A[G]+=L,p=L;return A}return[]};Editor.prototype.getProxiedUrl=function(d){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(d)){var p=EditorUi.isVisioFilename(d);p=/\.png$/i.test(d)||/\.pdf$/i.test(d)||p;var A="t="+(new Date).getTime();d=PROXY_URL+"?url="+encodeURIComponent(d)+
"&"+A+(p?"&base64=1":"")}return d};Editor.prototype.isCorsEnabledForUrl=function(d){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||d.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(d)||"https://raw.githubusercontent.com/"===d.substring(0,34)||"https://icons.diagrams.net/"===d.substring(0,27)||"https://fonts.googleapis.com/"===
d.substring(0,29)||"https://fonts.gstatic.com/"===d.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var d=new mxUrlConverter;d.updateBaseUrl();var p=d.convert,A=this;d.convert=function(G){null!=G&&navigator.onLine&&("http://"!=G.substring(0,7)&&"https://"!=G.substring(0,8)||G.substring(0,d.baseUrl.length)==d.baseUrl||A.crossOriginImages&&A.isCorsEnabledForUrl(G)?"chrome-extension://"!=G.substring(0,19)&&(G=p.apply(this,arguments)):G=PROXY_URL+"?url="+encodeURIComponent(G));return G};
-return d};Editor.createSvgDataUri=function(d){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(d)))};Editor.prototype.convertImageToDataUri=function(d,p,A,G,I){try{var L=!0,P=window.setTimeout(mxUtils.bind(this,function(){L=!1;p(d)}),this.timeout),Q=mxUtils.bind(this,function(){null!=G?this.convertImageToDataUri(d,p,A,G,!0):p(d)});if(/(\.svg)$/i.test(d)&&!I)mxUtils.get(d,mxUtils.bind(this,function(X){window.clearTimeout(P);L&&(200>X.getStatus()||299<X.getStatus()?Q():p(Editor.createSvgDataUri(X.getText())))}),
-mxUtils.bind(this,function(){window.clearTimeout(P);L&&Q()}));else{var ba=new Image;this.crossOriginImages&&(ba.crossOrigin="anonymous");ba.onload=function(){window.clearTimeout(P);if(L)try{G=null!=G&&I?G:1;var X=document.createElement("canvas");X.height=ba.height*G;X.width=ba.width*G;var Y=X.getContext("2d");Y.scale(G,G);Y.drawImage(ba,0,0);p(X.toDataURL())}catch(W){p(d)}};ba.onerror=function(){window.clearTimeout(P);L&&(null!=A?A():p(d))};ba.src=d}}catch(X){null!=A?A():p(d)}};Editor.prototype.convertImages=
-function(d,p,A,G){function I(){0<L.length?L.shift()():p(d)}null==G&&(G=this.createImageUrlConverter());var L=[],P=A||{};A=mxUtils.bind(this,function(W,ca){W=d.getElementsByTagName(W);for(var S=0;S<W.length;S++)mxUtils.bind(this,function(Z){L.push(mxUtils.bind(this,function(){try{if(null!=Z){var da=G.convert(Z.getAttribute(ca));if(null!=da&&"data:"!=da.substring(0,5)){var N=P[da];null==N?this.convertImageToDataUri(da,function(aa){null!=aa&&(P[da]=aa,Z.setAttribute(ca,aa));I()},null,Editor.svgRasterScale):
-(Z.setAttribute(ca,N),I())}else null!=da&&Z.setAttribute(ca,da),I()}}catch(aa){I()}}))})(W[S])});var Q={},ba=function(){var W=d.getElementsByTagName("defs")[0];null==W&&(W=d.ownerDocument,W=null!=W.createElementNS?W.createElementNS(mxConstants.NS_SVG,"defs"):W.createElement("defs"),d.insertBefore(W,d.firstChild));return W},X=mxUtils.bind(this,function(){for(var W=d.getElementsByTagName("use"),ca=0;ca<W.length;ca++)mxUtils.bind(this,function(S){L.push(mxUtils.bind(this,function(){try{var Z=S.getAttribute("href");
-null==Z&&(Z=S.getAttribute("xlink:href"));if(null!=Z&&"#"!=Z.charAt(0)&&"data:"!=Z.substring(0,5)){var da=G.convert(Z),N=function(ea){ea=Graph.createSvgImageSymbol(ba(),Q,ea,!0);null!=ea&&(S.setAttribute("href","#"+ea),S.setAttribute("xlink:href","#"+ea));I()},aa=P[da];null==aa?this.convertImageToDataUri(da,function(ea){null!=ea&&ea!=da&&(P[da]=ea);N(ea)}):N(aa)}else I()}catch(ea){I()}}))})(W[ca])}),Y=mxUtils.bind(this,function(){L.push(mxUtils.bind(this,function(){try{for(var W=d.getElementsByTagName("image"),
-ca=[],S=0;S<W.length;S++)ca.push(W[S]);var Z={},da={},N=[],aa=function(){for(var Ba=d.getElementsByTagName("use"),ua=0;ua<Ba.length;ua++){var qa=Ba[ua].getAttribute("href");null==qa&&(qa=Ba[ua].getAttribute("xlink:href"));null!=qa&&null!=Z[qa]&&(Ba[ua].setAttribute("href","#"+Z[qa]),Ba[ua].setAttribute("xlink:href","#"+Z[qa]))}},ea=function(Ba,ua){for(var qa=null!=d.ownerDocument.createElementNS?d.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):d.ownerDocument.createElement("use"),ia=Ba.attributes,
-ja=0;ja<ia.length;ja++){var na=ia[ja].name;"href"!=na&&"xlink:href"!=na&&"preserveAspectRatio"!=na&&qa.setAttribute(na,ia[ja].value)}qa.setAttribute("href","#"+ua);qa.setAttribute("xlink:href","#"+ua);Ba.parentNode.replaceChild(qa,Ba)};for(S=0;S<ca.length;S++){var ka=ca[S];W=ka;var ra=!0;if("symbol"==ka.parentNode.nodeName)if(null==ka.getAttribute("id")&&"mx-image-"==String(ka.parentNode.getAttribute("id")||"").substring(0,9))W=ka.parentNode,ra=!1;else continue;else"mx-image-"==String(ka.getAttribute("id")||
-"").substring(0,9)&&(ra=!1);var sa=ka.getAttribute("xlink:href");if(null!=sa&&"data:"==sa.substring(0,5)){var ma=W.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==sa.substring(0,18)){var wa="mx-symbol-"+mxUtils.hashCode(sa+"|"+("none"!=ma)),va=d.querySelector('[id="'+wa+'"]');if(null!=va&&"symbol"==va.nodeName){ra?ea(ka,wa):(Z["#"+W.getAttribute("id")]=wa,W.parentNode.removeChild(W));continue}}null==da[sa]&&(da[sa]={},N.push(sa));null==da[sa][ma]&&(da[sa][ma]=[]);da[sa][ma].push({node:W,
-inline:ra})}}aa();var za=function(){for(var Ba=null,ua=null;0<N.length&&null==Ba;){Ba=N.pop();ua=da[Ba];var qa=0,ia=0,ja;for(ja in ua)qa++,ia=Math.max(ia,ua[ja].length);2>qa&&2>ia&&(Ba=null)}if(null==Ba)I();else{var na=new Image;na.onload=function(){try{var Aa=na.naturalWidth,ha=na.naturalHeight;if(0<Aa&&0<ha){var la=d.ownerDocument,xa=0,Ca;for(Ca in ua)xa++;var pa=function(ab){return null!=la.createElementNS?la.createElementNS(mxConstants.NS_SVG,ab):la.createElement(ab)},oa=function(){var ab=pa("image");
-ab.setAttribute("width",Aa);ab.setAttribute("height",ha);null==ab.setAttributeNS?ab.setAttribute("xlink:href",Ba):ab.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Ba);return ab},Da=null;if(1<xa){for(Da="mx-data-"+mxUtils.hashCode(Ba);null!=d.querySelector('[id="'+Da+'"]');)Da+="-1";var Fa=oa();Fa.setAttribute("id",Da);ba().appendChild(Fa)}for(Ca in ua){var Ia=ua[Ca];xa=null;for(Fa=0;Fa<Ia.length&&null==xa;Fa++)Ia[Fa].inline||(xa=Ia[Fa].node.getAttribute("id"));if(null==xa)for(xa="mx-image-"+mxUtils.hashCode(Ba+
-"|"+Ca);null!=d.querySelector('[id="'+xa+'"]');)xa+="-1";var Ha=pa("symbol");Ha.setAttribute("id",xa);Ha.setAttribute("viewBox","0 0 "+Aa+" "+ha);""!=Ca&&Ha.setAttribute("preserveAspectRatio",Ca);if(null!=Da){var Ma=pa("use");Ma.setAttribute("href","#"+Da);Ma.setAttribute("xlink:href","#"+Da);Ha.appendChild(Ma)}else Ha.appendChild(oa());ba().appendChild(Ha);for(Fa=0;Fa<Ia.length;Fa++){var bb=Ia[Fa].node;Ia[Fa].inline?ea(bb,xa):(bb.getAttribute("id")!=xa&&(Z["#"+bb.getAttribute("id")]=xa),bb.parentNode.removeChild(bb))}}aa()}}catch(ab){}za()};
-na.onerror=function(){za()};na.src=Ba}};za()}catch(Ba){I()}}))});A("image","xlink:href");A("img","src");X();Y();I()};Editor.base64Encode=function(d){for(var p="",A=0,G=d.length,I,L,P;A<G;){I=d.charCodeAt(A++)&255;if(A==G){p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(I>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((I&3)<<4);p+="==";break}L=d.charCodeAt(A++);if(A==G){p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(I>>
-2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((I&3)<<4|(L&240)>>4);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((L&15)<<2);p+="=";break}P=d.charCodeAt(A++);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(I>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((I&3)<<4|(L&240)>>4);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((L&15)<<2|(P&192)>>6);
-p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P&63)}return p};Editor.prototype.loadUrl=function(d,p,A,G,I,L,P,Q){try{var ba=!P&&(G||/(\.png)($|\?)/i.test(d)||/(\.jpe?g)($|\?)/i.test(d)||/(\.gif)($|\?)/i.test(d)||/(\.pdf)($|\?)/i.test(d));I=null!=I?I:!0;var X=mxUtils.bind(this,function(){mxUtils.get(d,mxUtils.bind(this,function(Y){200<=Y.getStatus()&&299>=Y.getStatus()?null!=p&&(Y=Y.getText(),ba&&(L=null!=L?L:"data:image/png;base64,",Y=L+Editor.base64Encode(Y)),p(Y)):
-null!=A&&(0==Y.getStatus()?A({message:mxResources.get("accessDenied")},Y):404==Y.getStatus()?A({message:mxResources.get("fileNotFound"),code:Y.getStatus()},Y):A({message:this.getErrorMessage(Y)},Y))}),function(Y){null!=A&&A({message:mxResources.get("error")+" "+Y.getStatus()})},ba,this.timeout,function(){I&&null!=A&&A({code:App.ERROR_TIMEOUT,retry:X})},Q)});X()}catch(Y){null!=A&&A(Y)}};Editor.prototype.getErrorMessage=function(d){var p=mxResources.get("error")+" "+d.getStatus();try{var A=d.getText(),
-G=JSON.parse(A);null!=G&&null!=G.error&&null!=G.error.message&&(p=G.error.message+" ("+p+")")}catch(I){}return p};Editor.prototype.absoluteCssFonts=function(d){var p=null;if(null!=d){var A=d.split("url(");if(0<A.length){p=[A[0]];d=window.location.pathname;var G=null!=d?d.lastIndexOf("/"):-1;0<=G&&(d=d.substring(0,G+1));G=document.getElementsByTagName("base");var I=null;null!=G&&0<G.length&&(I=G[0].getAttribute("href"));for(var L=1;L<A.length;L++)if(G=A[L].indexOf(")"),0<G){var P=Editor.trimCssUrl(A[L].substring(0,
-G));this.graph.isRelativeUrl(P)&&(P=null!=I?I+P:window.location.protocol+"//"+window.location.hostname+("/"==P.charAt(0)?"":d)+P);p.push('url("'+P+'"'+A[L].substring(G))}else p.push(A[L])}else p=[d]}return null!=p?p.join(""):null};Editor.prototype.mapFontUrl=function(d,p,A){/^https?:\/\//.test(p)&&!this.isCorsEnabledForUrl(p)&&(p=PROXY_URL+"?url="+encodeURIComponent(p));A(d,p)};Editor.prototype.embedCssFonts=function(d,p){var A=d.split("url("),G=0;null==this.cachedFonts&&(this.cachedFonts=Object.create(null));
-var I=mxUtils.bind(this,function(){if(0==G){for(var ba=[A[0]],X=1;X<A.length;X++){var Y=A[X].indexOf(")");ba.push('url("');ba.push(this.cachedFonts[Editor.trimCssUrl(A[X].substring(0,Y))]);ba.push('"'+A[X].substring(Y))}p(ba.join(""))}});if(0<A.length){for(d=1;d<A.length;d++){var L=A[d].indexOf(")"),P=null,Q=A[d].indexOf("format(",L);0<Q&&(P=Editor.trimCssUrl(A[d].substring(Q+7,A[d].indexOf(")",Q))));mxUtils.bind(this,function(ba){var X=this.cachedFonts[ba];if(null==X){var Y=[];this.cachedFonts[ba]=
-Y;G++;X="application/x-font-ttf";if("svg"==P||/(\.svg)($|\?)/i.test(ba))X="image/svg+xml";else if("otf"==P||"embedded-opentype"==P||/(\.otf)($|\?)/i.test(ba))X="application/x-font-opentype";else if("woff"==P||/(\.woff)($|\?)/i.test(ba))X="application/font-woff";else if("woff2"==P||/(\.woff2)($|\?)/i.test(ba))X="application/font-woff2";else if("eot"==P||/(\.eot)($|\?)/i.test(ba))X="application/vnd.ms-fontobject";else if("sfnt"==P||/(\.sfnt)($|\?)/i.test(ba))X="application/font-sfnt";var W=mxUtils.bind(this,
-function(ca){this.cachedFonts[ba]=ca;G--;I();for(ca=0;ca<Y.length;ca++)Y[ca]()});this.mapFontUrl(X,ba,mxUtils.bind(this,function(ca,S){this.loadUrl(S,function(Z){W(Z)},function(Z){W(ba)},!0,null,"data:"+ca+";charset=utf-8;base64,")}))}else"string"!=typeof X&&(G++,X.push(function(){G--;I()}))})(Editor.trimCssUrl(A[d].substring(0,L)),P)}I()}else p(d)};Editor.prototype.loadFonts=function(d){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(p){this.resolvedFontCss=
-p;null!=d&&d()})):null!=d&&d()};Editor.prototype.createGoogleFontCache=function(){var d={},p;for(p in Graph.fontMapping)Graph.isCssFontUrl(p)&&(d[p]=Graph.fontMapping[p]);return d};Editor.prototype.embedExtFonts=function(d,p){p=this.graph.getCustomFonts(p);if(0<p.length){var A=[],G=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var I=mxUtils.bind(this,function(){0==G&&this.embedCssFonts(A.join(""),d)}),L=0;L<p.length;L++)mxUtils.bind(this,function(P,Q){Graph.isCssFontUrl(Q)?
-null==this.cachedGoogleFonts[Q]?(G++,this.loadUrl(Graph.rewriteGoogleFontUrl(Q),mxUtils.bind(this,function(ba){this.cachedGoogleFonts[Q]=ba;A.push(ba+"\n");G--;I()}),mxUtils.bind(this,function(ba){G--;A.push('@import url("'+Graph.escapeCssString(Q)+'");\n');I()}))):A.push(this.cachedGoogleFonts[Q]+"\n"):A.push('@font-face {font-family: "'+Graph.escapeCssString(P)+'";src: url("'+Graph.escapeCssString(Q)+'")}\n')})(p[L].name,p[L].url);I()}else d()};Editor.prototype.addMathCss=function(d){d=d.getElementsByTagName("defs");
-if(null!=d&&0<d.length)for(var p=document.getElementsByTagName("style"),A=0;A<p.length;A++){var G=mxUtils.getTextContent(p[A]);0>G.indexOf("mxPageSelector")&&0<G.indexOf("MathJax")&&d[0].appendChild(p[A].cloneNode(!0))}};Editor.prototype.addFontCss=function(d,p){p=null!=p?p:this.absoluteCssFonts(this.fontCss);if(null!=p){var A=mxUtils.getSvgDefs(d),G=p.split("\n");p=[];for(var I=[],L=0;L<G.length;L++)"@import"==G[L].substring(0,7)?p.push(G[L]):I.push(G[L]);d=d.ownerDocument;d=null!=d.createElementNS?
-d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");0<p.length&&(mxUtils.setTextContent(d,p.join("\n")),A.appendChild(d));0<I.length&&(d=d.cloneNode(!1),mxUtils.setTextContent(d,I.join("\n")),A.appendChild(d))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(d,p,A){var G=mxClient.IS_FF?8192:16384;return Math.min(A,Math.min(G/d,G/p))};Editor.prototype.exportToCanvas=
-function(d,p,A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z,da,N,aa){try{L=null!=L?L:!0;P=null!=P?P:!0;W=null!=W?W:this.graph;ca=null!=ca?ca:0;var ea=ba?null:W.background;ea==mxConstants.NONE&&(ea=null);null==ea&&(ea=G);null==ea&&0==ba&&(ea=Editor.getDefaultPageBackgroundColor());this.convertImages(W.getSvg(null,null,ca,S,null,P,null,null,null,X,null,da,N,aa),mxUtils.bind(this,function(ka){try{ka.style.setProperty("-webkit-font-smoothing","antialiased");ka.style.setProperty("-moz-osx-font-smoothing","grayscale");var ra=
+return d};Editor.createSvgDataUri=function(d){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(d)))};Editor.prototype.convertImageToDataUri=function(d,p,A,G,J){try{var L=!0,P=window.setTimeout(mxUtils.bind(this,function(){L=!1;p(d)}),this.timeout),Q=mxUtils.bind(this,function(){null!=G?this.convertImageToDataUri(d,p,A,G,!0):p(d)});if(/(\.svg)$/i.test(d)&&!J)mxUtils.get(d,mxUtils.bind(this,function(W){window.clearTimeout(P);L&&(200>W.getStatus()||299<W.getStatus()?Q():p(Editor.createSvgDataUri(W.getText())))}),
+mxUtils.bind(this,function(){window.clearTimeout(P);L&&Q()}));else{var ba=new Image;this.crossOriginImages&&(ba.crossOrigin="anonymous");ba.onload=function(){window.clearTimeout(P);if(L)try{G=null!=G&&J?G:1;var W=document.createElement("canvas");W.height=ba.height*G;W.width=ba.width*G;var Y=W.getContext("2d");Y.scale(G,G);Y.drawImage(ba,0,0);p(W.toDataURL())}catch(X){p(d)}};ba.onerror=function(){window.clearTimeout(P);L&&(null!=A?A():p(d))};ba.src=d}}catch(W){null!=A?A():p(d)}};Editor.prototype.convertImages=
+function(d,p,A,G){function J(){0<L.length?L.shift()():p(d)}null==G&&(G=this.createImageUrlConverter());var L=[],P=A||{};A=mxUtils.bind(this,function(X,ca){X=d.getElementsByTagName(X);for(var S=0;S<X.length;S++)mxUtils.bind(this,function(Z){L.push(mxUtils.bind(this,function(){try{if(null!=Z){var da=G.convert(Z.getAttribute(ca));if(null!=da&&"data:"!=da.substring(0,5)){var N=P[da];null==N?this.convertImageToDataUri(da,function(aa){null!=aa&&(P[da]=aa,Z.setAttribute(ca,aa));J()},null,Editor.svgRasterScale):
+(Z.setAttribute(ca,N),J())}else null!=da&&Z.setAttribute(ca,da),J()}}catch(aa){J()}}))})(X[S])});var Q={},ba=function(){var X=d.getElementsByTagName("defs")[0];null==X&&(X=d.ownerDocument,X=null!=X.createElementNS?X.createElementNS(mxConstants.NS_SVG,"defs"):X.createElement("defs"),d.insertBefore(X,d.firstChild));return X},W=mxUtils.bind(this,function(){for(var X=d.getElementsByTagName("use"),ca=0;ca<X.length;ca++)mxUtils.bind(this,function(S){L.push(mxUtils.bind(this,function(){try{var Z=S.getAttribute("href");
+null==Z&&(Z=S.getAttribute("xlink:href"));if(null!=Z&&"#"!=Z.charAt(0)&&"data:"!=Z.substring(0,5)){var da=G.convert(Z),N=function(ea){ea=Graph.createSvgImageSymbol(ba(),Q,ea,!0);null!=ea&&(S.setAttribute("href","#"+ea),S.setAttribute("xlink:href","#"+ea));J()},aa=P[da];null==aa?this.convertImageToDataUri(da,function(ea){null!=ea&&ea!=da&&(P[da]=ea);N(ea)}):N(aa)}else J()}catch(ea){J()}}))})(X[ca])}),Y=mxUtils.bind(this,function(){L.push(mxUtils.bind(this,function(){try{for(var X=d.getElementsByTagName("image"),
+ca=[],S=0;S<X.length;S++)ca.push(X[S]);var Z={},da={},N=[],aa=function(){for(var Ba=d.getElementsByTagName("use"),ua=0;ua<Ba.length;ua++){var qa=Ba[ua].getAttribute("href");null==qa&&(qa=Ba[ua].getAttribute("xlink:href"));null!=qa&&null!=Z[qa]&&(Ba[ua].setAttribute("href","#"+Z[qa]),Ba[ua].setAttribute("xlink:href","#"+Z[qa]))}},ea=function(Ba,ua){for(var qa=null!=d.ownerDocument.createElementNS?d.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):d.ownerDocument.createElement("use"),ia=Ba.attributes,
+ja=0;ja<ia.length;ja++){var na=ia[ja].name;"href"!=na&&"xlink:href"!=na&&"preserveAspectRatio"!=na&&qa.setAttribute(na,ia[ja].value)}qa.setAttribute("href","#"+ua);qa.setAttribute("xlink:href","#"+ua);Ba.parentNode.replaceChild(qa,Ba)};for(S=0;S<ca.length;S++){var ka=ca[S];X=ka;var ra=!0;if("symbol"==ka.parentNode.nodeName)if(null==ka.getAttribute("id")&&"mx-image-"==String(ka.parentNode.getAttribute("id")||"").substring(0,9))X=ka.parentNode,ra=!1;else continue;else"mx-image-"==String(ka.getAttribute("id")||
+"").substring(0,9)&&(ra=!1);var sa=ka.getAttribute("xlink:href");if(null!=sa&&"data:"==sa.substring(0,5)){var ma=X.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==sa.substring(0,18)){var wa="mx-symbol-"+mxUtils.hashCode(sa+"|"+("none"!=ma)),va=d.querySelector('[id="'+wa+'"]');if(null!=va&&"symbol"==va.nodeName){ra?ea(ka,wa):(Z["#"+X.getAttribute("id")]=wa,X.parentNode.removeChild(X));continue}}null==da[sa]&&(da[sa]={},N.push(sa));null==da[sa][ma]&&(da[sa][ma]=[]);da[sa][ma].push({node:X,
+inline:ra})}}aa();var za=function(){for(var Ba=null,ua=null;0<N.length&&null==Ba;){Ba=N.pop();ua=da[Ba];var qa=0,ia=0,ja;for(ja in ua)qa++,ia=Math.max(ia,ua[ja].length);2>qa&&2>ia&&(Ba=null)}if(null==Ba)J();else{var na=new Image;na.onload=function(){try{var Aa=na.naturalWidth,ha=na.naturalHeight;if(0<Aa&&0<ha){var la=d.ownerDocument,ya=0,Ca;for(Ca in ua)ya++;var pa=function(bb){return null!=la.createElementNS?la.createElementNS(mxConstants.NS_SVG,bb):la.createElement(bb)},oa=function(){var bb=pa("image");
+bb.setAttribute("width",Aa);bb.setAttribute("height",ha);null==bb.setAttributeNS?bb.setAttribute("xlink:href",Ba):bb.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Ba);return bb},Ea=null;if(1<ya){for(Ea="mx-data-"+mxUtils.hashCode(Ba);null!=d.querySelector('[id="'+Ea+'"]');)Ea+="-1";var Ga=oa();Ga.setAttribute("id",Ea);ba().appendChild(Ga)}for(Ca in ua){var Ja=ua[Ca];ya=null;for(Ga=0;Ga<Ja.length&&null==ya;Ga++)Ja[Ga].inline||(ya=Ja[Ga].node.getAttribute("id"));if(null==ya)for(ya="mx-image-"+mxUtils.hashCode(Ba+
+"|"+Ca);null!=d.querySelector('[id="'+ya+'"]');)ya+="-1";var Ha=pa("symbol");Ha.setAttribute("id",ya);Ha.setAttribute("viewBox","0 0 "+Aa+" "+ha);""!=Ca&&Ha.setAttribute("preserveAspectRatio",Ca);if(null!=Ea){var Ma=pa("use");Ma.setAttribute("href","#"+Ea);Ma.setAttribute("xlink:href","#"+Ea);Ha.appendChild(Ma)}else Ha.appendChild(oa());ba().appendChild(Ha);for(Ga=0;Ga<Ja.length;Ga++){var eb=Ja[Ga].node;Ja[Ga].inline?ea(eb,ya):(eb.getAttribute("id")!=ya&&(Z["#"+eb.getAttribute("id")]=ya),eb.parentNode.removeChild(eb))}}aa()}}catch(bb){}za()};
+na.onerror=function(){za()};na.src=Ba}};za()}catch(Ba){J()}}))});A("image","xlink:href");A("img","src");W();Y();J()};Editor.base64Encode=function(d){for(var p="",A=0,G=d.length,J,L,P;A<G;){J=d.charCodeAt(A++)&255;if(A==G){p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(J>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((J&3)<<4);p+="==";break}L=d.charCodeAt(A++);if(A==G){p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(J>>
+2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((J&3)<<4|(L&240)>>4);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((L&15)<<2);p+="=";break}P=d.charCodeAt(A++);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(J>>2);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((J&3)<<4|(L&240)>>4);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((L&15)<<2|(P&192)>>6);
+p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P&63)}return p};Editor.prototype.loadUrl=function(d,p,A,G,J,L,P,Q){try{var ba=!P&&(G||/(\.png)($|\?)/i.test(d)||/(\.jpe?g)($|\?)/i.test(d)||/(\.gif)($|\?)/i.test(d)||/(\.pdf)($|\?)/i.test(d));J=null!=J?J:!0;var W=mxUtils.bind(this,function(){mxUtils.get(d,mxUtils.bind(this,function(Y){200<=Y.getStatus()&&299>=Y.getStatus()?null!=p&&(Y=Y.getText(),ba&&(L=null!=L?L:"data:image/png;base64,",Y=L+Editor.base64Encode(Y)),p(Y)):
+null!=A&&(0==Y.getStatus()?A({message:mxResources.get("accessDenied")},Y):404==Y.getStatus()?A({message:mxResources.get("fileNotFound"),code:Y.getStatus()},Y):A({message:this.getErrorMessage(Y)},Y))}),function(Y){null!=A&&A({message:mxResources.get("error")+" "+Y.getStatus()})},ba,this.timeout,function(){J&&null!=A&&A({code:App.ERROR_TIMEOUT,retry:W})},Q)});W()}catch(Y){null!=A&&A(Y)}};Editor.prototype.getErrorMessage=function(d){var p=mxResources.get("error")+" "+d.getStatus();try{var A=d.getText(),
+G=JSON.parse(A);null!=G&&null!=G.error&&null!=G.error.message&&(p=G.error.message+" ("+p+")")}catch(J){}return p};Editor.prototype.absoluteCssFonts=function(d){var p=null;if(null!=d){var A=d.split("url(");if(0<A.length){p=[A[0]];d=window.location.pathname;var G=null!=d?d.lastIndexOf("/"):-1;0<=G&&(d=d.substring(0,G+1));G=document.getElementsByTagName("base");var J=null;null!=G&&0<G.length&&(J=G[0].getAttribute("href"));for(var L=1;L<A.length;L++)if(G=A[L].indexOf(")"),0<G){var P=Editor.trimCssUrl(A[L].substring(0,
+G));this.graph.isRelativeUrl(P)&&(P=null!=J?J+P:window.location.protocol+"//"+window.location.hostname+("/"==P.charAt(0)?"":d)+P);p.push('url("'+P+'"'+A[L].substring(G))}else p.push(A[L])}else p=[d]}return null!=p?p.join(""):null};Editor.prototype.mapFontUrl=function(d,p,A){/^https?:\/\//.test(p)&&!this.isCorsEnabledForUrl(p)&&(p=PROXY_URL+"?url="+encodeURIComponent(p));A(d,p)};Editor.prototype.embedCssFonts=function(d,p){var A=d.split("url("),G=0;null==this.cachedFonts&&(this.cachedFonts=Object.create(null));
+var J=mxUtils.bind(this,function(){if(0==G){for(var ba=[A[0]],W=1;W<A.length;W++){var Y=A[W].indexOf(")");ba.push('url("');ba.push(this.cachedFonts[Editor.trimCssUrl(A[W].substring(0,Y))]);ba.push('"'+A[W].substring(Y))}p(ba.join(""))}});if(0<A.length){for(d=1;d<A.length;d++){var L=A[d].indexOf(")"),P=null,Q=A[d].indexOf("format(",L);0<Q&&(P=Editor.trimCssUrl(A[d].substring(Q+7,A[d].indexOf(")",Q))));mxUtils.bind(this,function(ba){var W=this.cachedFonts[ba];if(null==W){var Y=[];this.cachedFonts[ba]=
+Y;G++;W="application/x-font-ttf";if("svg"==P||/(\.svg)($|\?)/i.test(ba))W="image/svg+xml";else if("otf"==P||"embedded-opentype"==P||/(\.otf)($|\?)/i.test(ba))W="application/x-font-opentype";else if("woff"==P||/(\.woff)($|\?)/i.test(ba))W="application/font-woff";else if("woff2"==P||/(\.woff2)($|\?)/i.test(ba))W="application/font-woff2";else if("eot"==P||/(\.eot)($|\?)/i.test(ba))W="application/vnd.ms-fontobject";else if("sfnt"==P||/(\.sfnt)($|\?)/i.test(ba))W="application/font-sfnt";var X=mxUtils.bind(this,
+function(ca){this.cachedFonts[ba]=ca;G--;J();for(ca=0;ca<Y.length;ca++)Y[ca]()});this.mapFontUrl(W,ba,mxUtils.bind(this,function(ca,S){this.loadUrl(S,function(Z){X(Z)},function(Z){X(ba)},!0,null,"data:"+ca+";charset=utf-8;base64,")}))}else"string"!=typeof W&&(G++,W.push(function(){G--;J()}))})(Editor.trimCssUrl(A[d].substring(0,L)),P)}J()}else p(d)};Editor.prototype.loadFonts=function(d){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(p){this.resolvedFontCss=
+p;null!=d&&d()})):null!=d&&d()};Editor.prototype.createGoogleFontCache=function(){var d={},p;for(p in Graph.fontMapping)Graph.isCssFontUrl(p)&&(d[p]=Graph.fontMapping[p]);return d};Editor.prototype.embedExtFonts=function(d,p){p=this.graph.getCustomFonts(p);if(0<p.length){var A=[],G=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var J=mxUtils.bind(this,function(){0==G&&this.embedCssFonts(A.join(""),d)}),L=0;L<p.length;L++)mxUtils.bind(this,function(P,Q){Graph.isCssFontUrl(Q)?
+null==this.cachedGoogleFonts[Q]?(G++,this.loadUrl(Graph.rewriteGoogleFontUrl(Q),mxUtils.bind(this,function(ba){this.cachedGoogleFonts[Q]=ba;A.push(ba+"\n");G--;J()}),mxUtils.bind(this,function(ba){G--;A.push('@import url("'+Graph.escapeCssString(Q)+'");\n');J()}))):A.push(this.cachedGoogleFonts[Q]+"\n"):A.push('@font-face {font-family: "'+Graph.escapeCssString(P)+'";src: url("'+Graph.escapeCssString(Q)+'")}\n')})(p[L].name,p[L].url);J()}else d()};Editor.prototype.addMathCss=function(d){d=d.getElementsByTagName("defs");
+if(null!=d&&0<d.length)for(var p=document.getElementsByTagName("style"),A=0;A<p.length;A++){var G=mxUtils.getTextContent(p[A]);0>G.indexOf("mxPageSelector")&&0<G.indexOf("MathJax")&&d[0].appendChild(p[A].cloneNode(!0))}};Editor.prototype.addFontCss=function(d,p){p=null!=p?p:this.absoluteCssFonts(this.fontCss);if(null!=p){var A=mxUtils.getSvgDefs(d),G=p.split("\n");p=[];for(var J=[],L=0;L<G.length;L++)"@import"==G[L].substring(0,7)?p.push(G[L]):J.push(G[L]);d=d.ownerDocument;d=null!=d.createElementNS?
+d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");0<p.length&&(mxUtils.setTextContent(d,p.join("\n")),A.appendChild(d));0<J.length&&(d=d.cloneNode(!1),mxUtils.setTextContent(d,J.join("\n")),A.appendChild(d))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(d,p,A){var G=mxClient.IS_FF?8192:16384;return Math.min(A,Math.min(G/d,G/p))};Editor.prototype.exportToCanvas=
+function(d,p,A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z,da,N,aa){try{L=null!=L?L:!0;P=null!=P?P:!0;X=null!=X?X:this.graph;ca=null!=ca?ca:0;var ea=ba?null:X.background;ea==mxConstants.NONE&&(ea=null);null==ea&&(ea=G);null==ea&&0==ba&&(ea=Editor.getDefaultPageBackgroundColor());this.convertImages(X.getSvg(null,null,ca,S,null,P,null,null,null,W,null,da,N,aa),mxUtils.bind(this,function(ka){try{ka.style.setProperty("-webkit-font-smoothing","antialiased");ka.style.setProperty("-moz-osx-font-smoothing","grayscale");var ra=
new Image;ra.onload=mxUtils.bind(this,function(){try{var ma=function(){mxClient.IS_SF?window.setTimeout(function(){Ba.drawImage(ra,0,0);d(wa,ka)},0):(Ba.drawImage(ra,0,0),d(wa,ka))},wa=document.createElement("canvas"),va=parseInt(ka.getAttribute("width")),za=parseInt(ka.getAttribute("height"));Q=null!=Q?Q:1;null!=p&&(Q=L?Math.min(1,Math.min(3*p/(4*za),p/va)):p/va);Q=this.getMaxCanvasScale(va,za,Q);va=Math.ceil(Q*va);za=Math.ceil(Q*za);wa.setAttribute("width",va);wa.setAttribute("height",za);var Ba=
-wa.getContext("2d");if(null!=ea){var ua=mxUtils.getLightDarkColor(ea);Ba.beginPath();Ba.rect(0,0,va,za);Ba.fillStyle="dark"==da&&"none"!=W.getAdaptiveColors()?ua.dark:ua.light;Ba.fill()}1!=Q&&Ba.scale(Q,Q);if(Z){var qa=W.view,ia=qa.scale;qa.scale=1;var ja=btoa(unescape(encodeURIComponent(qa.createSvgGrid(qa.gridColor))));qa.scale=ia;ja="data:image/svg+xml;base64,"+ja;var na=W.gridSize*qa.gridSteps*Q,Aa=W.getGraphBounds(),ha=qa.translate.x*ia,la=qa.translate.y*ia,xa=ha+(Aa.x-ha)/ia-ca,Ca=la+(Aa.y-
-la)/ia-ca,pa=new Image;pa.onload=function(){try{for(var oa=-Math.round(na-mxUtils.mod((ha-xa)*Q,na)),Da=-Math.round(na-mxUtils.mod((la-Ca)*Q,na));oa<va;oa+=na)for(var Fa=Da;Fa<za;Fa+=na)Ba.drawImage(pa,oa/Q,Fa/Q);ma()}catch(Ia){null!=I&&I(Ia)}};pa.onerror=function(oa){null!=I&&I(oa)};pa.src=ja}else ma()}catch(oa){null!=I&&I(oa)}});ra.onerror=function(ma){null!=I&&I(ma)};X&&this.graph.addSvgShadow(ka);this.graph.mathEnabled&&this.addMathCss(ka);var sa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&
-this.addFontCss(ka,this.resolvedFontCss),ra.src=Editor.createSvgDataUri(mxUtils.getXml(ka))}catch(ma){null!=I&&I(ma)}});this.embedExtFonts(mxUtils.bind(this,function(ma){try{null!=ma&&this.addFontCss(ka,ma),this.loadFonts(sa)}catch(wa){null!=I&&I(wa)}}))}catch(ma){null!=I&&I(ma)}}),A,Y)}catch(ka){null!=I&&I(ka)}};Editor.crcTable=[];for(var u=0;256>u;u++)for(var x=u,z=0;8>z;z++)x=1==(x&1)?3988292384^x>>>1:x>>>1,Editor.crcTable[u]=x;Editor.updateCRC=function(d,p,A,G){for(var I=0;I<G;I++)d=Editor.crcTable[(d^
-p.charCodeAt(A+I))&255]^d>>>8;return d};Editor.crc32=function(d){for(var p=-1,A=0;A<d.length;A++)p=p>>>8^Editor.crcTable[(p^d.charCodeAt(A))&255];return(p^-1)>>>0};Editor.writeGraphModelToPng=function(d,p,A,G,I){function L(Y,W){var ca=ba;ba+=W;return Y.substring(ca,ba)}function P(Y){Y=L(Y,4);return Y.charCodeAt(3)+(Y.charCodeAt(2)<<8)+(Y.charCodeAt(1)<<16)+(Y.charCodeAt(0)<<24)}function Q(Y){return String.fromCharCode(Y>>24&255,Y>>16&255,Y>>8&255,Y&255)}d=d.substring(d.indexOf(",")+1);d=window.atob?
-atob(d):Base64.decode(d,!0);var ba=0;if(L(d,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=I&&I();else if(L(d,4),"IHDR"!=L(d,4))null!=I&&I();else{L(d,17);I=d.substring(0,ba);do{var X=P(d);if("IDAT"==L(d,4)){I=d.substring(0,ba-8);"pHYs"==p&&"dpi"==A?(A=Math.round(G/.0254),A=Q(A)+Q(A)+String.fromCharCode(1)):A=A+String.fromCharCode(0)+("zTXt"==p?String.fromCharCode(0):"")+G;G=4294967295;G=Editor.updateCRC(G,p,0,4);G=Editor.updateCRC(G,A,0,A.length);I+=Q(A.length)+p+A+Q(G^
-4294967295);I+=d.substring(ba-8,d.length);break}I+=d.substring(ba-8,ba-4+X);L(d,X);L(d,4)}while(X);return"data:image/png;base64,"+(window.btoa?btoa(I):Base64.encode(I,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var F=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(d,p){F.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var J=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=
-function(){J.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(d,p,A){var G=null;if(null!=A)return null;null!=d.editor.graph.getModel().getParent(p)?G=p.getId():null!=d.currentPage&&(G=d.currentPage.getId());return G});if(null!=window.StyleFormatPanel){var H=Format.prototype.init;Format.prototype.init=function(){H.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",
+wa.getContext("2d");if(null!=ea){var ua=mxUtils.getLightDarkColor(ea);Ba.beginPath();Ba.rect(0,0,va,za);Ba.fillStyle="dark"==da&&"none"!=X.getAdaptiveColors()?ua.dark:ua.light;Ba.fill()}1!=Q&&Ba.scale(Q,Q);if(Z){var qa=X.view,ia=qa.scale;qa.scale=1;var ja=btoa(unescape(encodeURIComponent(qa.createSvgGrid(qa.gridColor))));qa.scale=ia;ja="data:image/svg+xml;base64,"+ja;var na=X.gridSize*qa.gridSteps*Q,Aa=X.getGraphBounds(),ha=qa.translate.x*ia,la=qa.translate.y*ia,ya=ha+(Aa.x-ha)/ia-ca,Ca=la+(Aa.y-
+la)/ia-ca,pa=new Image;pa.onload=function(){try{for(var oa=-Math.round(na-mxUtils.mod((ha-ya)*Q,na)),Ea=-Math.round(na-mxUtils.mod((la-Ca)*Q,na));oa<va;oa+=na)for(var Ga=Ea;Ga<za;Ga+=na)Ba.drawImage(pa,oa/Q,Ga/Q);ma()}catch(Ja){null!=J&&J(Ja)}};pa.onerror=function(oa){null!=J&&J(oa)};pa.src=ja}else ma()}catch(oa){null!=J&&J(oa)}});ra.onerror=function(ma){null!=J&&J(ma)};W&&this.graph.addSvgShadow(ka);this.graph.mathEnabled&&this.addMathCss(ka);var sa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&
+this.addFontCss(ka,this.resolvedFontCss),ra.src=Editor.createSvgDataUri(mxUtils.getXml(ka))}catch(ma){null!=J&&J(ma)}});this.embedExtFonts(mxUtils.bind(this,function(ma){try{null!=ma&&this.addFontCss(ka,ma),this.loadFonts(sa)}catch(wa){null!=J&&J(wa)}}))}catch(ma){null!=J&&J(ma)}}),A,Y)}catch(ka){null!=J&&J(ka)}};Editor.crcTable=[];for(var u=0;256>u;u++)for(var x=u,z=0;8>z;z++)x=1==(x&1)?3988292384^x>>>1:x>>>1,Editor.crcTable[u]=x;Editor.updateCRC=function(d,p,A,G){for(var J=0;J<G;J++)d=Editor.crcTable[(d^
+p.charCodeAt(A+J))&255]^d>>>8;return d};Editor.crc32=function(d){for(var p=-1,A=0;A<d.length;A++)p=p>>>8^Editor.crcTable[(p^d.charCodeAt(A))&255];return(p^-1)>>>0};Editor.writeGraphModelToPng=function(d,p,A,G,J){function L(Y,X){var ca=ba;ba+=X;return Y.substring(ca,ba)}function P(Y){Y=L(Y,4);return Y.charCodeAt(3)+(Y.charCodeAt(2)<<8)+(Y.charCodeAt(1)<<16)+(Y.charCodeAt(0)<<24)}function Q(Y){return String.fromCharCode(Y>>24&255,Y>>16&255,Y>>8&255,Y&255)}d=d.substring(d.indexOf(",")+1);d=window.atob?
+atob(d):Base64.decode(d,!0);var ba=0;if(L(d,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=J&&J();else if(L(d,4),"IHDR"!=L(d,4))null!=J&&J();else{L(d,17);J=d.substring(0,ba);do{var W=P(d);if("IDAT"==L(d,4)){J=d.substring(0,ba-8);"pHYs"==p&&"dpi"==A?(A=Math.round(G/.0254),A=Q(A)+Q(A)+String.fromCharCode(1)):A=A+String.fromCharCode(0)+("zTXt"==p?String.fromCharCode(0):"")+G;G=4294967295;G=Editor.updateCRC(G,p,0,4);G=Editor.updateCRC(G,A,0,A.length);J+=Q(A.length)+p+A+Q(G^
+4294967295);J+=d.substring(ba-8,d.length);break}J+=d.substring(ba-8,ba-4+W);L(d,W);L(d,4)}while(W);return"data:image/png;base64,"+(window.btoa?btoa(J):Base64.encode(J,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var F=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(d,p){F.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var I=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=
+function(){I.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(d,p,A){var G=null;if(null!=A)return null;null!=d.editor.graph.getModel().getParent(p)?G=p.getId():null!=d.currentPage&&(G=d.currentPage.getId());return G});if(null!=window.StyleFormatPanel){var H=Format.prototype.init;Format.prototype.init=function(){H.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",
this.update)};var D=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?D.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(d){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(d){d=c.apply(this,arguments);var p=this.editorUi,
A=p.editor.graph;if(A.isEnabled()){var G=p.getCurrentFile();null!=G&&G.isAutosaveOptional()&&d.appendChild(this.createOption(mxResources.get("autosave"),function(){return p.editor.autosave},function(L){p.editor.setAutosave(L);p.editor.autosave&&G.isModified()&&G.fileChanged()},{install:function(L){this.listener=function(){L(p.editor.autosave)};p.editor.addListener("autosaveChanged",this.listener)},destroy:function(){p.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&A.isEnabled()&&
-"undefined"!==typeof MathJax){var I=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return A.mathEnabled},function(L){p.actions.get("mathematicalTypesetting").funct()},{install:function(L){this.listener=function(){L(A.mathEnabled)};p.addListener("mathEnabledChanged",this.listener)},destroy:function(){p.removeListener(this.listener)}});d.appendChild(I);(!p.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&I.appendChild(p.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return d};
+"undefined"!==typeof MathJax){var J=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return A.mathEnabled},function(L){p.actions.get("mathematicalTypesetting").funct()},{install:function(L){this.listener=function(){L(A.mathEnabled)};p.addListener("mathEnabledChanged",this.listener)},destroy:function(){p.removeListener(this.listener)}});d.appendChild(J);(!p.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&J.appendChild(p.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return d};
mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(d,p){return 0<mxUtils.getValue(d.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=
[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(d,p){return 0<mxUtils.getValue(d.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=
[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",
@@ -13961,30 +13970,30 @@ font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2"
{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",
gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",
stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var d=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<d.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);null!=d.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),
-d.customProperties,d))};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(d){var p=this.editorUi.getSelectionState();1==p.cells.length?this.addActions(d,["copyStyle","pasteStyle"]):1<=p.cells.length&&this.addActions(d,["pasteStyle","pasteData"]);l.apply(this,arguments);return d};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(d,p,A,G){function I(Ba,ua,qa,ia,ja){if(null!=qa.valueChanged)qa.valueChanged(ua,ja,A,W);
+d.customProperties,d))};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(d){var p=this.editorUi.getSelectionState();1==p.cells.length?this.addActions(d,["copyStyle","pasteStyle"]):1<=p.cells.length&&this.addActions(d,["pasteStyle","pasteData"]);l.apply(this,arguments);return d};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(d,p,A,G){function J(Ba,ua,qa,ia,ja){if(null!=qa.valueChanged)qa.valueChanged(ua,ja,A,X);
else{ca.getModel().beginUpdate();try{ja=[];var na=[];if(null!=qa.index){for(var Aa=[],ha=qa.parentRow.nextSibling;ha&&ha.getAttribute("data-pName")==Ba;)Aa.push(ha.getAttribute("data-pValue")),ha=ha.nextSibling;qa.index<Aa.length?null!=ia?Aa.splice(ia,1):Aa[qa.index]=ua:Aa.push(ua);null!=qa.size&&Aa.length>qa.size&&(Aa=Aa.slice(0,qa.size));ua=Aa.join(",");null!=qa.countProperty&&(ca.setCellStyles(qa.countProperty,Aa.length,ca.getSelectionCells()),ja.push(qa.countProperty),na.push(Aa.length))}ca.setCellStyles(Ba,
-ua,ca.getSelectionCells());ja.push(Ba);na.push(ua);if(null!=qa.dependentProps)for(Ba=0;Ba<qa.dependentProps.length;Ba++){var la=qa.dependentPropsDefVal[Ba],xa=qa.dependentPropsVals[Ba];if(xa.length>ua)xa=xa.slice(0,ua);else for(var Ca=xa.length;Ca<ua;Ca++)xa.push(la);xa=xa.join(",");ca.setCellStyles(qa.dependentProps[Ba],xa,ca.getSelectionCells());ja.push(qa.dependentProps[Ba]);na.push(xa)}if("function"==typeof qa.onChange)qa.onChange(ca,ua);W.editorUi.fireEvent(new mxEventObject("styleChanged","keys",
+ua,ca.getSelectionCells());ja.push(Ba);na.push(ua);if(null!=qa.dependentProps)for(Ba=0;Ba<qa.dependentProps.length;Ba++){var la=qa.dependentPropsDefVal[Ba],ya=qa.dependentPropsVals[Ba];if(ya.length>ua)ya=ya.slice(0,ua);else for(var Ca=ya.length;Ca<ua;Ca++)ya.push(la);ya=ya.join(",");ca.setCellStyles(qa.dependentProps[Ba],ya,ca.getSelectionCells());ja.push(qa.dependentProps[Ba]);na.push(ya)}if("function"==typeof qa.onChange)qa.onChange(ca,ua);X.editorUi.fireEvent(new mxEventObject("styleChanged","keys",
ja,"values",na,"cells",ca.getSelectionCells()))}finally{ca.getModel().endUpdate()}}}function L(Ba,ua){ua.style.left="0px";ua.style.top="0px";ua.style.position="relative";ua.style.right="0px";ua.style.bottom="0px";ua.style.width="100%";ua.style.maxWidth="100%";ua.style.maxHeight="100%";ua.style.textAlign="left"}function P(Ba,ua,qa){function ia(na){if(null==na||na==mxConstants.NONE)ja.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==na)ja.style.background="";else{var Aa=
-mxUtils.getLightDarkColor(na);mxUtils.isLightDarkColor(na)&&Aa.light!=Aa.dark?ja.style.background="linear-gradient(to right bottom, "+Aa.cssText+" 50%, "+mxUtils.invertLightDarkColor(Aa).cssText+" 50.3%)":ja.style.background=na}}var ja=document.createElement("div");ja.style.width="32px";ja.style.height="8px";ja.style.margin="2px";ja.style.borderStyle="solid";ja.style.borderWidth="1px";ia(ua);btn=mxUtils.button("",mxUtils.bind(W,function(na){this.editorUi.pickColor(ua,function(Aa){I(Ba,Aa,qa);ia(Aa)});
-mxEvent.consume(na)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(ja);return btn}function Q(Ba,ua,qa,ia,ja,na,Aa){null!=ua&&(ua=ua.split(","),S.push({name:Ba,values:ua,type:qa,defVal:ia,countProperty:ja,parentRow:na,isDeletable:!0,flipBkg:Aa}));btn=mxUtils.button("+",mxUtils.bind(W,function(ha){for(var la=na,xa=0;null!=la.nextSibling;)if(la.nextSibling.getAttribute("data-pName")==Ba)la=la.nextSibling,
-xa++;else break;var Ca={type:qa,parentRow:na,index:xa,isDeletable:!0,defVal:ia,countProperty:ja};xa=Y(Ba,"",Ca,0==xa%2,Aa);I(Ba,ia,Ca);la.parentNode.insertBefore(xa,la.nextSibling);mxEvent.consume(ha)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ba(Ba,ua,qa,ia,ja,na,Aa){if(0<ja){var ha=Array(ja);ua=null!=ua?ua.split(","):[];for(var la=0;la<ja;la++)ha[la]=null!=ua[la]?ua[la]:null!=ia?ia:"";S.push({name:Ba,values:ha,type:qa,defVal:ia,parentRow:na,
-flipBkg:Aa,size:ja})}return document.createElement("div")}function X(Ba,ua,qa){var ia=document.createElement("input");ia.type="checkbox";ia.checked="1"==ua;mxEvent.addListener(ia,"change",function(){I(Ba,ia.checked?"1":"0",qa,null,ia)});return ia}function Y(Ba,ua,qa,ia,ja){var na=qa.dispName,Aa=qa.type,ha=document.createElement("tr");ha.className="gePropRow"+(ja?"Dark":"")+(ia?"Alt":"")+" gePropNonHeaderRow";ha.setAttribute("data-pName",Ba);ha.setAttribute("data-pValue",ua);ia=!1;null!=qa.index&&
-(ha.setAttribute("data-index",qa.index),na=(null!=na?na:"")+"["+qa.index+"]",ia=!0);var la=document.createElement("td");la.className="gePropRowCell";na=mxResources.get(na,null,na);mxUtils.write(la,na);la.setAttribute("title",na);ia&&(la.style.textAlign="right");ha.appendChild(la);la=document.createElement("td");la.className="gePropRowCell";la.setAttribute("title",null!=ua?mxUtils.safeDecodeURIComponent(ua):mxResources.get("none"));mxEvent.addListener(la,"click",mxUtils.bind(W,function(oa){!mxUtils.isAncestorNode(ha,
-document.activeElement)&&mxUtils.isAncestorNode(ha.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(oa))}));if("color"==Aa)la.appendChild(P(Ba,ua,qa));else if("bool"==Aa||"boolean"==Aa)la.appendChild(X(Ba,ua,qa));else if("enum"==Aa){var xa=qa.enumList;la.innerHTML="";var Ca=document.createElement("div");Ca.className="gePropValue";la.appendChild(Ca);for(ja=0;ja<xa.length;ja++)if(na=xa[ja],na.val==ua){mxUtils.write(Ca,
-mxResources.get(na.dispName,null,na.dispName));break}mxEvent.addListener(la,"click",mxUtils.bind(W,function(oa){var Da=mxEvent.getSource(oa);if(!(Da!=la&&Da!=Ca||mxEvent.isConsumed(oa))){Ca.innerHTML="";var Fa=document.createElement("select"),Ia=null;L(la,Fa);Fa.style.boxSizing="border-box";Fa.style.height="100%";Fa.style.padding="0";Fa.style.margin="0";Fa.style.border="0";for(oa=0;oa<xa.length;oa++){Da=xa[oa];var Ha=document.createElement("option");Ha.value=mxUtils.htmlEntities(Da.val);mxUtils.write(Ha,
-mxResources.get(Da.dispName,null,Da.dispName));Fa.appendChild(Ha);null==Da.val&&(Ha.value="null",Ia=Ha)}Fa.value=null==ua&&null!=Ia?"null":ua;Ca.appendChild(Fa);mxEvent.addListener(Fa,"change",function(){var Ma=mxUtils.htmlEntities(Fa.value);if(Fa[Fa.selectedIndex]==Ia||"null"==Ma.value)Ma=null;I(Ba,Ma,qa)});Fa.focus();mxEvent.addListener(Fa,"blur",function(){Ca.innerHTML="";for(var Ma=Fa[Fa.selectedIndex]==Ia||"null"==Fa.value?null:Fa.value,bb=0;bb<xa.length;bb++){var ab=xa[bb];if(ab.val==Ma){mxUtils.write(Ca,
-mxResources.get(ab.dispName,null,ab.dispName));break}}})}}))}else if("dynamicArr"==Aa)la.appendChild(Q(Ba,ua,qa.subType,qa.subDefVal,qa.countProperty,ha,ja));else if("staticArr"==Aa)la.appendChild(ba(Ba,ua,qa.subType,qa.subDefVal,qa.size,ha,ja));else if("readOnly"==Aa)ja=document.createElement("input"),ja.setAttribute("readonly",""),ja.value=ua,ja.style.borderWidth="0px","id"==Ba||"shape"==Ba?(ha.firstChild.innerHTML="",ha.firstChild.setAttribute("colspan","2"),ja.style.flexGrow="1",ja.style.marginLeft=
+mxUtils.getLightDarkColor(na);mxUtils.isLightDarkColor(na)&&Aa.light!=Aa.dark?ja.style.background="linear-gradient(to right bottom, "+Aa.cssText+" 50%, "+mxUtils.invertLightDarkColor(Aa).cssText+" 50.3%)":ja.style.background=na}}var ja=document.createElement("div");ja.style.width="32px";ja.style.height="8px";ja.style.margin="2px";ja.style.borderStyle="solid";ja.style.borderWidth="1px";ia(ua);btn=mxUtils.button("",mxUtils.bind(X,function(na){this.editorUi.pickColor(ua,function(Aa){J(Ba,Aa,qa);ia(Aa)});
+mxEvent.consume(na)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(ja);return btn}function Q(Ba,ua,qa,ia,ja,na,Aa){null!=ua&&(ua=ua.split(","),S.push({name:Ba,values:ua,type:qa,defVal:ia,countProperty:ja,parentRow:na,isDeletable:!0,flipBkg:Aa}));btn=mxUtils.button("+",mxUtils.bind(X,function(ha){for(var la=na,ya=0;null!=la.nextSibling;)if(la.nextSibling.getAttribute("data-pName")==Ba)la=la.nextSibling,
+ya++;else break;var Ca={type:qa,parentRow:na,index:ya,isDeletable:!0,defVal:ia,countProperty:ja};ya=Y(Ba,"",Ca,0==ya%2,Aa);J(Ba,ia,Ca);la.parentNode.insertBefore(ya,la.nextSibling);mxEvent.consume(ha)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ba(Ba,ua,qa,ia,ja,na,Aa){if(0<ja){var ha=Array(ja);ua=null!=ua?ua.split(","):[];for(var la=0;la<ja;la++)ha[la]=null!=ua[la]?ua[la]:null!=ia?ia:"";S.push({name:Ba,values:ha,type:qa,defVal:ia,parentRow:na,
+flipBkg:Aa,size:ja})}return document.createElement("div")}function W(Ba,ua,qa){var ia=document.createElement("input");ia.type="checkbox";ia.checked="1"==ua;mxEvent.addListener(ia,"change",function(){J(Ba,ia.checked?"1":"0",qa,null,ia)});return ia}function Y(Ba,ua,qa,ia,ja){var na=qa.dispName,Aa=qa.type,ha=document.createElement("tr");ha.className="gePropRow"+(ja?"Dark":"")+(ia?"Alt":"")+" gePropNonHeaderRow";ha.setAttribute("data-pName",Ba);ha.setAttribute("data-pValue",ua);ia=!1;null!=qa.index&&
+(ha.setAttribute("data-index",qa.index),na=(null!=na?na:"")+"["+qa.index+"]",ia=!0);var la=document.createElement("td");la.className="gePropRowCell";na=mxResources.get(na,null,na);mxUtils.write(la,na);la.setAttribute("title",na);ia&&(la.style.textAlign="right");ha.appendChild(la);la=document.createElement("td");la.className="gePropRowCell";la.setAttribute("title",null!=ua?mxUtils.safeDecodeURIComponent(ua):mxResources.get("none"));mxEvent.addListener(la,"click",mxUtils.bind(X,function(oa){!mxUtils.isAncestorNode(ha,
+document.activeElement)&&mxUtils.isAncestorNode(ha.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(oa))}));if("color"==Aa)la.appendChild(P(Ba,ua,qa));else if("bool"==Aa||"boolean"==Aa)la.appendChild(W(Ba,ua,qa));else if("enum"==Aa){var ya=qa.enumList;la.innerHTML="";var Ca=document.createElement("div");Ca.className="gePropValue";la.appendChild(Ca);for(ja=0;ja<ya.length;ja++)if(na=ya[ja],na.val==ua){mxUtils.write(Ca,
+mxResources.get(na.dispName,null,na.dispName));break}mxEvent.addListener(la,"click",mxUtils.bind(X,function(oa){var Ea=mxEvent.getSource(oa);if(!(Ea!=la&&Ea!=Ca||mxEvent.isConsumed(oa))){Ca.innerHTML="";var Ga=document.createElement("select"),Ja=null;L(la,Ga);Ga.style.boxSizing="border-box";Ga.style.height="100%";Ga.style.padding="0";Ga.style.margin="0";Ga.style.border="0";for(oa=0;oa<ya.length;oa++){Ea=ya[oa];var Ha=document.createElement("option");Ha.value=mxUtils.htmlEntities(Ea.val);mxUtils.write(Ha,
+mxResources.get(Ea.dispName,null,Ea.dispName));Ga.appendChild(Ha);null==Ea.val&&(Ha.value="null",Ja=Ha)}Ga.value=null==ua&&null!=Ja?"null":ua;Ca.appendChild(Ga);mxEvent.addListener(Ga,"change",function(){var Ma=mxUtils.htmlEntities(Ga.value);if(Ga[Ga.selectedIndex]==Ja||"null"==Ma.value)Ma=null;J(Ba,Ma,qa)});Ga.focus();mxEvent.addListener(Ga,"blur",function(){Ca.innerHTML="";for(var Ma=Ga[Ga.selectedIndex]==Ja||"null"==Ga.value?null:Ga.value,eb=0;eb<ya.length;eb++){var bb=ya[eb];if(bb.val==Ma){mxUtils.write(Ca,
+mxResources.get(bb.dispName,null,bb.dispName));break}}})}}))}else if("dynamicArr"==Aa)la.appendChild(Q(Ba,ua,qa.subType,qa.subDefVal,qa.countProperty,ha,ja));else if("staticArr"==Aa)la.appendChild(ba(Ba,ua,qa.subType,qa.subDefVal,qa.size,ha,ja));else if("readOnly"==Aa)ja=document.createElement("input"),ja.setAttribute("readonly",""),ja.value=ua,ja.style.borderWidth="0px","id"==Ba||"shape"==Ba?(ha.firstChild.innerHTML="",ha.firstChild.setAttribute("colspan","2"),ja.style.flexGrow="1",ja.style.marginLeft=
"4px",ja.style.textAlign="id"==Ba?"center":"left",ja.setAttribute("title",ua),na=document.createElement("div"),mxUtils.write(na,mxResources.get(Ba)+":"),na.style.display="inline-flex",na.style.alignItems="center",na.style.width="100%",na.appendChild(ja),ha.firstChild.appendChild(na)):(ja.style.width="96px",la.appendChild(ja));else{la.innerHTML="";var pa=document.createElement("div");pa.className="gePropValue";la.appendChild(pa);pa.innerHTML=mxUtils.htmlEntities(mxUtils.safeDecodeURIComponent(ua));
-mxEvent.addListener(la,"click",mxUtils.bind(W,function(oa){function Da(){var Ha=Ia.value,Ma=Aa;Ha=0==Ha.trim().length&&"string"!=Ma&&"numbers"!=Ma?qa.allowAuto?"auto":0:Ha;qa.allowAuto&&(null!=Ha.trim&&"auto"==Ha.trim().toLowerCase()?(Ha="auto",Ma="string"):(Ha=parseFloat(Ha),Ha=isNaN(Ha)?0:Ha));null!=qa.min&&Ha<qa.min?Ha=qa.min:null!=qa.max&&Ha>qa.max&&(Ha=qa.max);var bb=null;try{bb="numbers"==Ma?Ha.match(/\d*\.?\d+/g).map(Number).join(" "):"auto"===Ha&&qa.allowAuto&&"auto"==qa.defVal?null:encodeURIComponent(("int"==
-Ma?parseInt(Ha):Ha)+"")}catch(ab){}I(Ba,bb,qa,null,Ia)}var Fa=mxEvent.getSource(oa);if(!(Fa!=la&&Fa!=pa||mxEvent.isConsumed(oa))){pa.innerHTML="";var Ia=document.createElement("input");L(pa,Ia);Ia.value=mxUtils.safeDecodeURIComponent(ua);Ia.className="gePropEditor";"int"!=Aa&&"float"!=Aa||qa.allowAuto||(Ia.type="number",Ia.step="int"==Aa?"1":"any",null!=qa.min&&(Ia.min=parseFloat(qa.min)),null!=qa.max&&(Ia.max=parseFloat(qa.max)));pa.appendChild(Ia);mxEvent.addListener(Ia,"keypress",function(Ha){13==
-Ha.keyCode&&Da()});Ia.focus();mxEvent.addListener(Ia,"blur",function(){Da()})}}))}qa.isDeletable&&(ja=mxUtils.button("-",mxUtils.bind(W,function(oa){I(Ba,"",qa,qa.index);mxEvent.consume(oa)})),ja.style.height="16px",ja.style.width="25px",ja.style.float="right",ja.className="geColorBtn",la.appendChild(ja));ha.appendChild(la);return ha}var W=this,ca=this.editorUi.editor.graph,S=[],Z=document.createElement("table");Z.className="geProperties geFullWidthElement";var da=document.createElement("tr");da.className=
-"gePropHeader";var N=document.createElement("th");N.className="gePropHeaderCell";N.style.paddingLeft="16px";N.style.backgroundRepeat="no-repeat";N.style.backgroundPosition="-2px 50%";N.style.backgroundSize="20px";mxUtils.write(N,mxResources.get("property"));da.style.cursor="pointer";var aa=function(){var Ba=Z.querySelectorAll(".gePropNonHeaderRow");if(W.editorUi.propertiesCollapsed){N.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ua="none";for(var qa=d.childNodes.length-1;0<=qa;qa--)try{var ia=
-d.childNodes[qa],ja=ia.nodeName.toUpperCase();"INPUT"!=ja&&"SELECT"!=ja||d.removeChild(ia)}catch(na){}}else N.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ua="";for(qa=0;qa<Ba.length;qa++)Ba[qa].style.display=ua};mxEvent.addListener(da,"click",function(){W.editorUi.propertiesCollapsed=!W.editorUi.propertiesCollapsed;aa()});da.appendChild(N);var ea=document.createElement("th");ea.className="gePropHeaderCell";ea.style.paddingLeft="4px";mxUtils.write(ea,mxResources.get("value"));da.appendChild(ea);
+mxEvent.addListener(la,"click",mxUtils.bind(X,function(oa){function Ea(){var Ha=Ja.value,Ma=Aa;Ha=0==Ha.trim().length&&"string"!=Ma&&"numbers"!=Ma?qa.allowAuto?"auto":0:Ha;qa.allowAuto&&(null!=Ha.trim&&"auto"==Ha.trim().toLowerCase()?(Ha="auto",Ma="string"):(Ha=parseFloat(Ha),Ha=isNaN(Ha)?0:Ha));null!=qa.min&&Ha<qa.min?Ha=qa.min:null!=qa.max&&Ha>qa.max&&(Ha=qa.max);var eb=null;try{eb="numbers"==Ma?Ha.match(/\d*\.?\d+/g).map(Number).join(" "):"auto"===Ha&&qa.allowAuto&&"auto"==qa.defVal?null:encodeURIComponent(("int"==
+Ma?parseInt(Ha):Ha)+"")}catch(bb){}J(Ba,eb,qa,null,Ja)}var Ga=mxEvent.getSource(oa);if(!(Ga!=la&&Ga!=pa||mxEvent.isConsumed(oa))){pa.innerHTML="";var Ja=document.createElement("input");L(pa,Ja);Ja.value=mxUtils.safeDecodeURIComponent(ua);Ja.className="gePropEditor";"int"!=Aa&&"float"!=Aa||qa.allowAuto||(Ja.type="number",Ja.step="int"==Aa?"1":"any",null!=qa.min&&(Ja.min=parseFloat(qa.min)),null!=qa.max&&(Ja.max=parseFloat(qa.max)));pa.appendChild(Ja);mxEvent.addListener(Ja,"keypress",function(Ha){13==
+Ha.keyCode&&Ea()});Ja.focus();mxEvent.addListener(Ja,"blur",function(){Ea()})}}))}qa.isDeletable&&(ja=mxUtils.button("-",mxUtils.bind(X,function(oa){J(Ba,"",qa,qa.index);mxEvent.consume(oa)})),ja.style.height="16px",ja.style.width="25px",ja.style.float="right",ja.className="geColorBtn",la.appendChild(ja));ha.appendChild(la);return ha}var X=this,ca=this.editorUi.editor.graph,S=[],Z=document.createElement("table");Z.className="geProperties geFullWidthElement";var da=document.createElement("tr");da.className=
+"gePropHeader";var N=document.createElement("th");N.className="gePropHeaderCell";N.style.paddingLeft="16px";N.style.backgroundRepeat="no-repeat";N.style.backgroundPosition="-2px 50%";N.style.backgroundSize="20px";mxUtils.write(N,mxResources.get("property"));da.style.cursor="pointer";var aa=function(){var Ba=Z.querySelectorAll(".gePropNonHeaderRow");if(X.editorUi.propertiesCollapsed){N.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ua="none";for(var qa=d.childNodes.length-1;0<=qa;qa--)try{var ia=
+d.childNodes[qa],ja=ia.nodeName.toUpperCase();"INPUT"!=ja&&"SELECT"!=ja||d.removeChild(ia)}catch(na){}}else N.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ua="";for(qa=0;qa<Ba.length;qa++)Ba[qa].style.display=ua};mxEvent.addListener(da,"click",function(){X.editorUi.propertiesCollapsed=!X.editorUi.propertiesCollapsed;aa()});da.appendChild(N);var ea=document.createElement("th");ea.className="gePropHeaderCell";ea.style.paddingLeft="4px";mxUtils.write(ea,mxResources.get("value"));da.appendChild(ea);
Z.appendChild(da);var ka=ea=!1;da=null;1==A.vertices.length&&0==A.edges.length?da=A.vertices[0].id:0==A.vertices.length&&1==A.edges.length&&(da=A.edges[0].id);null==da||G||(Z.appendChild(Y("id",mxUtils.htmlEntities(da),{dispName:"id",type:"readOnly"},!0,!1)),null!=A.style&&null!=A.style.shape&&Z.appendChild(Y("shape",mxUtils.htmlEntities(A.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var ra in p)if(G=p[ra],("function"!=typeof G.isVisible||G.isVisible(A,this))&&!G.primary){var sa=null!=
G.getValue?G.getValue(A,this):null!=A.style[ra]?mxUtils.htmlEntities(A.style[ra]+""):null!=G.getDefaultValue?G.getDefaultValue(A,this):G.defVal;if("separator"==G.type)ka=!ka;else{if("staticArr"==G.type)G.size=parseInt(A.style[G.sizeProperty]||p[G.sizeProperty].defVal)||0;else if(null!=G.dependentProps){var ma=G.dependentProps,wa=[],va=[];for(da=0;da<ma.length;da++)if(null!=p[ma[da]]){var za=A.style[ma[da]];va.push(p[ma[da]].subDefVal);wa.push(null!=za?za.split(","):[])}G.dependentPropsDefVal=va;G.dependentPropsVals=
wa}Z.appendChild(Y(ra,sa,G,ea,ka));ea=!ea}}for(da=0;da<S.length;da++)for(G=S[da],p=G.parentRow,ra=0;ra<G.values.length;ra++)ea=Y(G.name,G.values[ra],{type:G.type,parentRow:G.parentRow,isDeletable:G.isDeletable,index:ra,defVal:G.defVal,countProperty:G.countProperty,size:G.size},0==ra%2,G.flipBkg),p.parentNode.insertBefore(ea,p.nextSibling),p=ea;d.appendChild(Z);aa();return d};StyleFormatPanel.prototype.addStyles=function(d){if(null!=this.defaultColorSchemes){var p=this.editorUi,A=p.editor.graph,G=
-document.createElement("div");G.style.padding="6px 20px 0 24px";d.appendChild(G);var I=document.createElement("div");I.className="geSwitcher";I.style.padding="4px 18px 6px 0px";for(var L=[],P=0;P<this.defaultColorSchemes.length;P++){var Q=document.createElement("div");Q.className="geSwitcherDot";mxUtils.bind(this,function(ca){mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){ba(ca)}))})(P);L.push(Q);I.appendChild(Q)}var ba=mxUtils.bind(this,function(ca){null!=L[ca]&&(null!=this.format.currentScheme&&
-null!=L[this.format.currentScheme]&&(L[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=ca,X(this.defaultColorSchemes[this.format.currentScheme]),L[this.format.currentScheme].style.background="#84d7ff")}),X=mxUtils.bind(this,function(ca){var S=mxUtils.clone(A.defaultVertexStyle);S[mxConstants.STYLE_STROKECOLOR]=null!=S[mxConstants.STYLE_STROKECOLOR]?S[mxConstants.STYLE_STROKECOLOR]:"default";S[mxConstants.STYLE_FILLCOLOR]=null!=S[mxConstants.STYLE_FILLCOLOR]?S[mxConstants.STYLE_FILLCOLOR]:
+document.createElement("div");G.style.padding="6px 20px 0 24px";d.appendChild(G);var J=document.createElement("div");J.className="geSwitcher";J.style.padding="4px 18px 6px 0px";for(var L=[],P=0;P<this.defaultColorSchemes.length;P++){var Q=document.createElement("div");Q.className="geSwitcherDot";mxUtils.bind(this,function(ca){mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){ba(ca)}))})(P);L.push(Q);J.appendChild(Q)}var ba=mxUtils.bind(this,function(ca){null!=L[ca]&&(null!=this.format.currentScheme&&
+null!=L[this.format.currentScheme]&&(L[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=ca,W(this.defaultColorSchemes[this.format.currentScheme]),L[this.format.currentScheme].style.background="#84d7ff")}),W=mxUtils.bind(this,function(ca){var S=mxUtils.clone(A.defaultVertexStyle);S[mxConstants.STYLE_STROKECOLOR]=null!=S[mxConstants.STYLE_STROKECOLOR]?S[mxConstants.STYLE_STROKECOLOR]:"default";S[mxConstants.STYLE_FILLCOLOR]=null!=S[mxConstants.STYLE_FILLCOLOR]?S[mxConstants.STYLE_FILLCOLOR]:
"default";S[mxConstants.STYLE_FONTCOLOR]=null!=S[mxConstants.STYLE_FONTCOLOR]?S[mxConstants.STYLE_FONTCOLOR]:"default";A.replaceDefaultColors(new mxCell,S);var Z=mxUtils.bind(this,function(N){var aa=mxUtils.button("",mxUtils.bind(this,function(ra){A.getModel().beginUpdate();try{for(var sa=p.getSelectionState().cells,ma=A.getModel(),wa=[],va=0<sa.length,za=0;za<sa.length;za++){var Ba=ma.isVertex(sa[za])&&ma.isEdge(ma.getParent(sa[za])),ua=A.getCellStyle(sa[za]),qa=null!=ua&&"image"==ua.shape,ia=A.getCellGeometry(sa[za]);
wa.push({isLabel:qa||Ba&&(null==ia||0>=ia.width||0>=ia.height)});Ba||qa||(va=!1)}for(za=0;za<sa.length;za++){var ja=wa[za];if(va||!ja.isLabel){var na=ja.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,Aa=ja.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,ha=ma.getStyle(sa[za]);null!=ha&&"string"!==typeof ha&&(ha=String(ha));null!=N?(mxEvent.isShiftDown(ra)||(ha=""==N.fill||null==N.fill?mxUtils.setStyle(ha,na,null):mxUtils.setStyle(ha,na,N.fill),
ja.isLabel||(ha=""==N.gradient||null==N.gradient?mxUtils.setStyle(ha,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ha,mxConstants.STYLE_GRADIENTCOLOR,N.gradient)),mxEvent.isControlDown(ra)||mxClient.IS_MAC&&mxEvent.isMetaDown(ra)||!ma.isVertex(sa[za])||(ha=""==N.font||null==N.font?mxUtils.setStyle(ha,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ha,mxConstants.STYLE_FONTCOLOR,N.font))),mxEvent.isAltDown(ra)||(ha=""==N.stroke||null==N.stroke?mxUtils.setStyle(ha,Aa,null):mxUtils.setStyle(ha,
@@ -13993,130 +14002,131 @@ if(null!=N.gradient)aa.style.backgroundImage="linear-gradient("+mxUtils.getLight
ka.cssText+" 50%, "+ka.light+" 50.3%)"}null==N.stroke||N.stroke==mxConstants.NONE?aa.style.border=ea+" transparent":""==N.stroke?aa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(S,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ka=mxUtils.getLightDarkColor(N.stroke),aa.style.border=ea+" "+ka.cssText,aa.style.borderRightColor=ka.light,aa.style.borderBottomColor=aa.style.borderRightColor);null!=N.title&&aa.setAttribute("title",N.title)}else ea=mxUtils.getValue(S,mxConstants.STYLE_FILLCOLOR,
"#ffffff"),ka=mxUtils.getValue(S,mxConstants.STYLE_STROKECOLOR,"#000000"),aa.style.backgroundColor=ea,aa.style.border="1px solid "+ka;aa.style.borderRadius="0";G.appendChild(aa);null!=N&&null!=N.gradient&&(ea=aa.cloneNode(!1),ea.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(N.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(N.gradient).light+") 100%)",ea.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",ea.style.backgroundColor=
"transparent",G.appendChild(ea),ea.style.marginLeft="-42px",mxEvent.addListener(ea,"click",function(){aa.click()}))});G.innerText="";if(null!=ca)for(var da=0;da<ca.length;da++)0<da&&0==mxUtils.mod(da,4)&&mxUtils.br(G),Z(ca[da])});null==this.format.currentScheme?ba(Math.min(L.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ba(this.format.currentScheme);P=10>=this.defaultColorSchemes.length?43:23;var Y=document.createElement("div");Y.className="geButton";Y.style.cssText="position:absolute;left:0px;bottom:"+
-P+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(Y,"click",mxUtils.bind(this,function(){ba(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var W=document.createElement("div");W.className="geButton";W.style.cssText="position:absolute;left:186px;bottom:"+P+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(d.appendChild(Y),d.appendChild(W));mxEvent.addListener(W,"click",mxUtils.bind(this,
-function(){ba(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));X(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&d.appendChild(I)}return d}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements=Object.create(null);Graph.allowedFontUrls=Object.create(null);
+P+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(Y,"click",mxUtils.bind(this,function(){ba(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var X=document.createElement("div");X.className="geButton";X.style.cssText="position:absolute;left:186px;bottom:"+P+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(d.appendChild(Y),d.appendChild(X));mxEvent.addListener(X,"click",mxUtils.bind(this,
+function(){ba(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));W(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&d.appendChild(J)}return d}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements=Object.create(null);Graph.allowedFontUrls=Object.create(null);
Graph.isValidFontUrl=function(d){if("string"!==typeof d||0==d.length)return!1;if(Graph.allowedFontUrls[d])return!0;d=d.replace(/^[\x00-\x20]+/,"").replace(/[\x00-\x20]+$/,"").replace(/[\t\n\r]/g,"");return/^https?:\/\//i.test(d)||/^data:/i.test(d)||!/^[a-zA-Z][a-zA-Z0-9+.\-]*:/.test(d)&&!/^[\\\/]/.test(d)};Graph.isGoogleFontUrl=function(d){return d.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||d.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=
function(d){return Graph.isGoogleFontUrl(d)};Graph.rewriteGoogleFontUrl=function(d){null!=d&&d.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(d=Editor.GOOGLE_FONTS_CSS2+d.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return d};Graph.escapeCssString=function(d){return null!=d?String(d).replace(/[\x00-\x1f\x7f"\\]/g,function(p){return"\\"+p.charCodeAt(0).toString(16)+" "}):d};Graph.createFontElement=function(d,p){var A=Graph.fontMapping[p];null==A&&Graph.isCssFontUrl(p)?(d=
document.createElement("link"),d.setAttribute("rel","stylesheet"),d.setAttribute("type","text/css"),d.setAttribute("charset","UTF-8"),d.setAttribute("href",Graph.rewriteGoogleFontUrl(p))):(null==A&&(A='@font-face {\nfont-family: "'+Graph.escapeCssString(d)+'";\nsrc: url("'+Graph.escapeCssString(p)+'");\n}'),d=document.createElement("style"),mxUtils.write(d,A));return d};Graph.addRecentCustomFont=function(d,p){};Graph.addFont=function(d,p,A,G){if(null!=d&&0<d.length&&Graph.isValidFontUrl(p)){G=null!=
-G?G:Graph.customFontElements;var I=d.toLowerCase();if("helvetica"!=I&&"arial"!=d&&"sans-serif"!=I){var L=G[I];null!=L&&L.url!=p&&(null!=L.elt.parentNode&&L.elt.parentNode.removeChild(L.elt),L=null);null==L?(L=p,"http:"==p.substring(0,5)&&(L=PROXY_URL+"?url="+encodeURIComponent(p)),L={name:d,url:p,elt:Graph.createFontElement(d,L)},G[I]=L,p=G==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=A&&("link"==L.elt.nodeName.toLowerCase()?(L.elt.onload=A,L.elt.onerror=A):A()),null!=
+G?G:Graph.customFontElements;var J=d.toLowerCase();if("helvetica"!=J&&"arial"!=d&&"sans-serif"!=J){var L=G[J];null!=L&&L.url!=p&&(null!=L.elt.parentNode&&L.elt.parentNode.removeChild(L.elt),L=null);null==L?(L=p,"http:"==p.substring(0,5)&&(L=PROXY_URL+"?url="+encodeURIComponent(p)),L={name:d,url:p,elt:Graph.createFontElement(d,L)},G[J]=L,p=G==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=A&&("link"==L.elt.nodeName.toLowerCase()?(L.elt.onload=A,L.elt.onerror=A):A()),null!=
p&&p.appendChild(L.elt)):null!=A&&A()}else null!=A&&A()}else null!=A&&A();return d};Graph.getFontUrl=function(d,p){d=Graph.customFontElements[d.toLowerCase()];null!=d&&(p=d.url);return p};Graph.processFontAttributes=function(d){d=d.getElementsByTagName("*");for(var p=0;p<d.length;p++){var A=d[p].getAttribute("data-font-src");if(null!=A){var G="FONT"==d[p].nodeName.toUpperCase()?d[p].getAttribute("face"):d[p].style.fontFamily;null!=G&&Graph.addFont(G,A)}}};Graph.processFontStyle=function(d){if(null!=
d){var p=mxUtils.getValue(d,"fontSource",null);if(null!=p){var A=mxUtils.getValue(d,mxConstants.STYLE_FONTFAMILY,null);if(null!=A)try{Graph.addFont(A,decodeURIComponent(p))}catch(G){}}}return d};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;Graph.prototype.svgShadowColor=
-"#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var n=Graph.prototype.init;Graph.prototype.init=function(){function d(I){p=I}n.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var p=null;mxEvent.addListener(this.container,"mouseenter",d);mxEvent.addListener(this.container,"mousemove",d);mxEvent.addListener(this.container,
-"mouseleave",function(I){p=null});this.isMouseInsertPoint=function(){return null!=p};var A=this.getInsertPoint;this.getInsertPoint=function(I){return null==p||I?A.apply(this,arguments):this.getPointForEvent(p)};var G=this.layoutManager.getLayout;this.layoutManager.getLayout=function(I){var L=this.graph.getCellStyle(I);if(null!=L&&"rack"==L.childLayout){var P=new mxStackLayout(this.graph,!1);P.gridSize=null!=L.rackUnitSize?parseFloat(L.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:
+"#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var n=Graph.prototype.init;Graph.prototype.init=function(){function d(J){p=J}n.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var p=null;mxEvent.addListener(this.container,"mouseenter",d);mxEvent.addListener(this.container,"mousemove",d);mxEvent.addListener(this.container,
+"mouseleave",function(J){p=null});this.isMouseInsertPoint=function(){return null!=p};var A=this.getInsertPoint;this.getInsertPoint=function(J){return null==p||J?A.apply(this,arguments):this.getPointForEvent(p)};var G=this.layoutManager.getLayout;this.layoutManager.getLayout=function(J){var L=this.graph.getCellStyle(J);if(null!=L&&"rack"==L.childLayout){var P=new mxStackLayout(this.graph,!1);P.gridSize=null!=L.rackUnitSize?parseFloat(L.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:
20;P.marginLeft=L.marginLeft||0;P.marginRight=L.marginRight||0;P.marginTop=L.marginTop||0;P.marginBottom=L.marginBottom||0;P.allowGaps=L.allowGaps||0;P.horizontal="1"==mxUtils.getValue(L,"horizontalRack","0");P.resizeParent=!1;P.fill=!0;return P}return G.apply(this,arguments)};this.updateGlobalUrlVariables()};var r=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(d,p){return Graph.processFontStyle(r.apply(this,arguments))};var t=mxSvgCanvas2D.prototype.updateTextNodes;
-mxSvgCanvas2D.prototype.updateTextNodes=function(d,p,A,G,I,L,P,Q,ba,X,Y,W){t.apply(this,arguments);Graph.processFontAttributes(W)};var v=mxText.prototype.redraw;mxText.prototype.redraw=function(){v.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(d,p,A,G){function I(){for(var da=Q.getSelectionCells(),N=[],aa=0;aa<da.length;aa++)Q.isCellVisible(da[aa])&&N.push(da[aa]);Q.setSelectionCells(N)}function L(da){Q.setHiddenTags(da?
-[]:ba.slice());I();Q.refresh()}function P(da,N){Y.innerText="";if(0<da.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ea=document.createElement("tbody");if(null!=da&&0<da.length)for(var ka=0;ka<da.length;ka++)(function(ra){function sa(){var ua=Q.getCellsForTags([ra],null,null,!0);Q.isEnabled()?Q.setSelectionCells(ua):Q.highlightCells(ua,null,null,70)}var ma=0>mxUtils.indexOf(Q.hiddenTags,
+mxSvgCanvas2D.prototype.updateTextNodes=function(d,p,A,G,J,L,P,Q,ba,W,Y,X){t.apply(this,arguments);Graph.processFontAttributes(X)};var v=mxText.prototype.redraw;mxText.prototype.redraw=function(){v.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(d,p,A,G){function J(){for(var da=Q.getSelectionCells(),N=[],aa=0;aa<da.length;aa++)Q.isCellVisible(da[aa])&&N.push(da[aa]);Q.setSelectionCells(N)}function L(da){Q.setHiddenTags(da?
+[]:ba.slice());J();Q.refresh()}function P(da,N){Y.innerText="";if(0<da.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ea=document.createElement("tbody");if(null!=da&&0<da.length)for(var ka=0;ka<da.length;ka++)(function(ra){function sa(){var ua=Q.getCellsForTags([ra],null,null,!0);Q.isEnabled()?Q.setSelectionCells(ua):Q.highlightCells(ua,null,null,70)}var ma=0>mxUtils.indexOf(Q.hiddenTags,
ra),wa=document.createElement("tr"),va=document.createElement("td");va.style.align="center";va.style.width="16px";var za=document.createElement("img");za.setAttribute("src",ma?Editor.visibleImage:Editor.hiddenImage);za.setAttribute("title",mxResources.get(ma?"hideIt":"show",[ra])+"\n"+mxResources.get("shiftClickShowOnly",[ra]));mxUtils.setOpacity(za,ma?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width="16px";if(p||Editor.isDarkMode())za.style.filter=
-"invert(100%)";va.appendChild(za);mxEvent.addListener(za,"click",function(ua){if(mxEvent.isShiftDown(ua)){for(var qa=[],ia=0;ia<ba.length;ia++)ba[ia]!==ra&&qa.push(ba[ia]);var ja=0<qa.length;for(ia=0;ia<qa.length;ia++)if(0>mxUtils.indexOf(Q.hiddenTags,qa[ia])){ja=!1;break}ja&&0>mxUtils.indexOf(Q.hiddenTags,ra)?Q.setHiddenTags([]):Q.setHiddenTags(qa)}else Q.toggleHiddenTag(ra);I();Q.refresh();mxEvent.consume(ua)});wa.appendChild(va);va=document.createElement("td");va.style.align="center";va.style.width=
+"invert(100%)";va.appendChild(za);mxEvent.addListener(za,"click",function(ua){if(mxEvent.isShiftDown(ua)){for(var qa=[],ia=0;ia<ba.length;ia++)ba[ia]!==ra&&qa.push(ba[ia]);var ja=0<qa.length;for(ia=0;ia<qa.length;ia++)if(0>mxUtils.indexOf(Q.hiddenTags,qa[ia])){ja=!1;break}ja&&0>mxUtils.indexOf(Q.hiddenTags,ra)?Q.setHiddenTags([]):Q.setHiddenTags(qa)}else Q.toggleHiddenTag(ra);J();Q.refresh();mxEvent.consume(ua)});wa.appendChild(va);va=document.createElement("td");va.style.align="center";va.style.width=
"16px";za=document.createElement("img");za.setAttribute("src",Editor.selectImage);za.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(za,ma?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width="16px";if(p||Editor.isDarkMode())za.style.filter="invert(100%)";mxEvent.addListener(za,"click",function(ua){L(!0);sa();mxEvent.consume(ua)});va.appendChild(za);wa.appendChild(va);va=document.createElement("td");va.style.overflow="hidden";
va.style.whiteSpace="nowrap";va.style.textOverflow="ellipsis";va.style.verticalAlign="middle";va.style.cursor="pointer";va.setAttribute("title",ra);a=document.createElement("a");mxUtils.write(a,ra);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,ma?100:40);va.appendChild(a);mxEvent.addListener(va,"click",function(ua){if(mxEvent.isShiftDown(ua))L(!0),sa();else if(ma&&0<Q.hiddenTags.length)L(!0);else{var qa=ba.slice(),ia=mxUtils.indexOf(qa,ra);qa.splice(ia,1);Q.setHiddenTags(qa);
-I();Q.refresh()}mxEvent.consume(ua)});wa.appendChild(va);if(Q.isEnabled()){va=document.createElement("td");va.style.verticalAlign="middle";va.style.textAlign="center";va.style.width="18px";if(null==N){va.style.align="center";va.style.width="16px";za=document.createElement("img");za.setAttribute("src",Editor.trashImage);za.setAttribute("title",mxResources.get("removeIt",[ra]));mxUtils.setOpacity(za,ma?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width=
+J();Q.refresh()}mxEvent.consume(ua)});wa.appendChild(va);if(Q.isEnabled()){va=document.createElement("td");va.style.verticalAlign="middle";va.style.textAlign="center";va.style.width="18px";if(null==N){va.style.align="center";va.style.width="16px";za=document.createElement("img");za.setAttribute("src",Editor.trashImage);za.setAttribute("title",mxResources.get("removeIt",[ra]));mxUtils.setOpacity(za,ma?75:25);za.className="geAdaptiveAsset";za.style.verticalAlign="middle";za.style.cursor="pointer";za.style.width=
"16px";if(p||Editor.isDarkMode())za.style.filter="invert(100%)";mxEvent.addListener(za,"click",function(ua){var qa=mxUtils.indexOf(ba,ra);0<=qa&&ba.splice(qa,1);Q.removeTagsForCells(Q.model.getDescendants(Q.model.getRoot()),[ra]);Q.refresh();mxEvent.consume(ua)});va.appendChild(za)}else{var Ba=document.createElement("input");Ba.setAttribute("type","checkbox");Ba.style.margin="0px";Ba.defaultChecked=null!=N&&0<=mxUtils.indexOf(N,ra);Ba.checked=Ba.defaultChecked;Ba.style.background="transparent";Ba.setAttribute("title",
-mxResources.get(Ba.defaultChecked?"removeIt":"add",[ra]));mxEvent.addListener(Ba,"change",function(ua){Ba.checked?Q.addTagsForCells(Q.getSelectionCells(),[ra]):Q.removeTagsForCells(Q.getSelectionCells(),[ra]);mxEvent.consume(ua)});va.appendChild(Ba)}wa.appendChild(va)}ea.appendChild(wa)})(da[ka]);aa.appendChild(ea);Y.appendChild(aa)}}var Q=this,ba=Q.hiddenTags.slice(),X=document.createElement("div");X.style.userSelect="none";X.style.overflow="hidden";X.style.padding="10px";X.style.height="100%";var Y=
-document.createElement("div");Y.style.position="absolute";Y.style.boxSizing="border-box";Y.style.userSelect="none";Y.style.overflow="auto";Y.style.padding="3px";Y.style.left="0px";Y.style.right="0px";Y.style.top="0px";Y.style.bottom="0px";X.appendChild(Y);Q.addListener(mxEvent.ROOT,function(){ba=Q.hiddenTags.slice()});var W=mxUtils.bind(this,function(da,N){if(d()){da=Q.getAllTags();for(N=0;N<da.length;N++)0>mxUtils.indexOf(ba,da[N])&&ba.push(da[N]);ba.sort();Q.isSelectionEmpty()?P(ba):P(ba,Q.getCommonTagsForCells(Q.getSelectionCells()))}});
-Q.selectionModel.addListener(mxEvent.CHANGE,W);Q.model.addListener(mxEvent.CHANGE,W);Q.addListener(mxEvent.REFRESH,W);var ca=document.createElement("div");ca.className="geToolbarContainer geDialogToolbar";ca.style.position="absolute";ca.style.display="flex";ca.style.bottom="0px";ca.style.left="0px";ca.style.right="0px";ca.style.height="32px";ca.style.overflow="hidden";ca.style.padding="3px 4px 4px 4px";ca.style.borderWidth="1px 0px 0px 0px";ca.style.borderStyle="solid";ca.style.whiteSpace="nowrap";
-if(Q.isEnabled()){Y.style.bottom="32px";var S=document.createElement("a");S.className="geButton";var Z=S.cloneNode(!1);Z.style.backgroundImage="url("+Editor.visibleImage+")";Z.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(Z,"click",function(da){Q.setHiddenTags([]);mxEvent.isShiftDown(da)||(ba=Q.hiddenTags.slice());I();Q.refresh();mxEvent.consume(da)});ca.appendChild(Z);null!=A&&(S=S.cloneNode(!1),S.style.backgroundImage="url("+Editor.plusImage+")",S.setAttribute("title",mxResources.get("add")),
-mxEvent.addListener(S,"click",function(da){A(ba,function(N){ba=N;W()});mxEvent.consume(da)}),ca.appendChild(S));X.appendChild(ca)}null!=G&&ca.appendChild(G);return{div:X,refresh:W}};Graph.prototype.getCustomFonts=function(d){d=null!=d?d:Graph.customFontElements;var p=[];if(null!=this.extFonts)for(var A=0;A<this.extFonts.length;A++)Graph.isValidFontUrl(this.extFonts[A].url)&&p.push(this.extFonts[A]);for(var G in d)A=d[G],Graph.isValidFontUrl(A.url)&&p.push({name:A.name,url:A.url});return p};Graph.prototype.getExtFontCss=
-function(d){d=this.getCustomFonts(d);for(var p="",A="",G=0;G<d.length;G++){var I=d[G].name,L=d[G].url;Graph.isCssFontUrl(L)?p+='@import url("'+Graph.escapeCssString(Graph.rewriteGoogleFontUrl(L))+'");\n':A+='@font-face {\nfont-family: "'+Graph.escapeCssString(I)+'";\nsrc: url("'+Graph.escapeCssString(L)+'");\n}\n'}return p+A};Graph.prototype.setFont=function(d,p){Graph.addFont(d,p);var A=Editor.guid();document.execCommand("fontname",!1,A);for(var G=this.cellEditor.textarea.getElementsByTagName("font"),
-I=!1,L=0;L<G.length;L++)G[L].getAttribute("face")==A&&(I=!0,G[L].setAttribute("face",d),null!=p?G[L].setAttribute("data-font-src",p):G[L].removeAttribute("data-font-src"));I||document.execCommand("fontname",!1,d)};var B=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return B.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=
+mxResources.get(Ba.defaultChecked?"removeIt":"add",[ra]));mxEvent.addListener(Ba,"change",function(ua){Ba.checked?Q.addTagsForCells(Q.getSelectionCells(),[ra]):Q.removeTagsForCells(Q.getSelectionCells(),[ra]);mxEvent.consume(ua)});va.appendChild(Ba)}wa.appendChild(va)}ea.appendChild(wa)})(da[ka]);aa.appendChild(ea);Y.appendChild(aa)}}var Q=this,ba=Q.hiddenTags.slice(),W=document.createElement("div");W.style.userSelect="none";W.style.overflow="hidden";W.style.padding="10px";W.style.height="100%";var Y=
+document.createElement("div");Y.style.position="absolute";Y.style.boxSizing="border-box";Y.style.userSelect="none";Y.style.overflow="auto";Y.style.padding="3px";Y.style.left="0px";Y.style.right="0px";Y.style.top="0px";Y.style.bottom="0px";W.appendChild(Y);Q.addListener(mxEvent.ROOT,function(){ba=Q.hiddenTags.slice()});var X=mxUtils.bind(this,function(da,N){if(d()){da=Q.getAllTags();for(N=0;N<da.length;N++)0>mxUtils.indexOf(ba,da[N])&&ba.push(da[N]);ba.sort();Q.isSelectionEmpty()?P(ba):P(ba,Q.getCommonTagsForCells(Q.getSelectionCells()))}});
+Q.selectionModel.addListener(mxEvent.CHANGE,X);Q.model.addListener(mxEvent.CHANGE,X);Q.addListener(mxEvent.REFRESH,X);var ca=document.createElement("div");ca.className="geToolbarContainer geDialogToolbar";ca.style.position="absolute";ca.style.display="flex";ca.style.bottom="0px";ca.style.left="0px";ca.style.right="0px";ca.style.height="32px";ca.style.overflow="hidden";ca.style.padding="3px 4px 4px 4px";ca.style.borderWidth="1px 0px 0px 0px";ca.style.borderStyle="solid";ca.style.whiteSpace="nowrap";
+if(Q.isEnabled()){Y.style.bottom="32px";var S=document.createElement("a");S.className="geButton";var Z=S.cloneNode(!1);Z.style.backgroundImage="url("+Editor.visibleImage+")";Z.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(Z,"click",function(da){Q.setHiddenTags([]);mxEvent.isShiftDown(da)||(ba=Q.hiddenTags.slice());J();Q.refresh();mxEvent.consume(da)});ca.appendChild(Z);null!=A&&(S=S.cloneNode(!1),S.style.backgroundImage="url("+Editor.plusImage+")",S.setAttribute("title",mxResources.get("add")),
+mxEvent.addListener(S,"click",function(da){A(ba,function(N){ba=N;X()});mxEvent.consume(da)}),ca.appendChild(S));W.appendChild(ca)}null!=G&&ca.appendChild(G);return{div:W,refresh:X}};Graph.prototype.getCustomFonts=function(d){d=null!=d?d:Graph.customFontElements;var p=[];if(null!=this.extFonts)for(var A=0;A<this.extFonts.length;A++)Graph.isValidFontUrl(this.extFonts[A].url)&&p.push(this.extFonts[A]);for(var G in d)A=d[G],Graph.isValidFontUrl(A.url)&&p.push({name:A.name,url:A.url});return p};Graph.prototype.getExtFontCss=
+function(d){d=this.getCustomFonts(d);for(var p="",A="",G=0;G<d.length;G++){var J=d[G].name,L=d[G].url;Graph.isCssFontUrl(L)?p+='@import url("'+Graph.escapeCssString(Graph.rewriteGoogleFontUrl(L))+'");\n':A+='@font-face {\nfont-family: "'+Graph.escapeCssString(J)+'";\nsrc: url("'+Graph.escapeCssString(L)+'");\n}\n'}return p+A};Graph.prototype.setFont=function(d,p){Graph.addFont(d,p);var A=Editor.guid();document.execCommand("fontname",!1,A);for(var G=this.cellEditor.textarea.getElementsByTagName("font"),
+J=!1,L=0;L<G.length;L++)G[L].getAttribute("face")==A&&(J=!0,G[L].setAttribute("face",d),null!=p?G[L].setAttribute("data-font-src",p):G[L].removeAttribute("data-font-src"));J||document.execCommand("fontname",!1,d)};var B=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return B.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=
null!=this.globalVars?mxUtils.clone(this.globalVars):{};var d=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=d)for(var p in d)this.globalVars[p]=d[p]}catch(A){null!=window.console&&console.log("Error in vars URL parameter: "+A)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var E=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(d){var p=E.apply(this,arguments);null==p&&null!=this.globalVars&&(p=this.globalVars[d]);
-return p};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var d=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(d.ownerDocument)).decode(d)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var K=Graph.prototype.getSvg;Graph.prototype.getSvg=function(d,p,A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z,da,N){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==
-typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(sa){}this.refreshMathBounds()}var aa=K.apply(this,arguments);if(null!=W){var ea=aa.getAttribute("style");null==ea&&(ea="");W="auto"==W||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":W;aa.setAttribute("style",ea+(" color-scheme: "+W+";"))}var ka=Y?this.getExtFontCss():"";if(0<ka.length){var ra=aa.ownerDocument;
+return p};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var d=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(d.ownerDocument)).decode(d)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var K=Graph.prototype.getSvg;Graph.prototype.getSvg=function(d,p,A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z,da,N){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==
+typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(sa){}this.refreshMathBounds()}var aa=K.apply(this,arguments);if(null!=X){var ea=aa.getAttribute("style");null==ea&&(ea="");X="auto"==X||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":X;aa.setAttribute("style",ea+(" color-scheme: "+X+";"))}var ka=Y?this.getExtFontCss():"";if(0<ka.length){var ra=aa.ownerDocument;
ea=null!=ra.createElementNS?ra.createElementNS(mxConstants.NS_SVG,"style"):ra.createElement("style");null!=ra.setAttributeNS?ea.setAttributeNS("type","text/css"):ea.setAttribute("type","text/css");ea.appendChild(ra.createTextNode(ka));aa.getElementsByTagName("defs")[0].appendChild(ea)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(aa);this.mathEnabled&&(document.body.appendChild(aa),Editor.MathJaxRender(aa),aa.parentNode.removeChild(aa),
ea=aa.ownerDocument.getElementById("MJX-SVG-styles"),null!=ea&&aa.getElementsByTagName("defs")[0].appendChild(ea.cloneNode(!0)));return aa};var C=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(d){C.apply(this,arguments);null!=d.secondLabel&&(d.secondLabel.destroy(),d.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(d){return[d.shape,d.text,d.secondLabel,d.control]};var R=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=
function(){R.apply(this,arguments);this.enumerationState=0};var M=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(d){null!=d.shape&&this.redrawEnumerationState(d);return M.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(d){d=mxUtils.safeDecodeURIComponent(mxUtils.getValue(d.style,"enumerateValue",""));""==d&&(d=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(d)+
"</div>"};mxGraphView.prototype.redrawEnumerationState=function(d){var p="1"==mxUtils.getValue(d.style,"enumerate",0);p&&null==d.secondLabel?(d.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),d.secondLabel.size=12,d.secondLabel.state=d,d.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(d,d.secondLabel)):p||null==d.secondLabel||(d.secondLabel.destroy(),d.secondLabel=null);p=d.secondLabel;if(null!=p){var A=d.view.scale,
G=this.createEnumerationValue(d);d=this.graph.model.isVertex(d.cell)?new mxRectangle(d.x+d.width-4*A,d.y+4*A,0,0):mxRectangle.fromPoint(d.view.getPoint(d));p.bounds.equals(d)&&p.value==G&&p.scale==A||(p.bounds=d,p.value=G,p.scale=A,p.redraw())}};var O=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();O.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),
this.view.validateBackgroundImage())};var U=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){U.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(d,p){"data:action/json,"==d.substring(0,17)&&(d=JSON.parse(d.substring(17)),null!=d.actions&&this.executeCustomActions(Graph.flattenAnimationActions(d.actions),null,p))};Graph.flattenAnimationActions=function(d){if(!Array.isArray(d))return d;for(var p=[],A=0;A<d.length;A++){var G=d[A];
-if(null!=G&&null!=G.animation&&Array.isArray(G.animation.steps)){G=Graph.flattenAnimationActions(G.animation.steps);for(var I=0;I<G.length;I++)p.push(G[I])}else p.push(G)}return p};Graph.smoothScrollContainer=function(d,p,A,G,I,L){L=L||600;if(p!==G||A!==I){d.scrollLeft=p;d.scrollTop=A;var P="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),Q=G-p,ba=I-A,X=function(Y){Y=Math.min(1,(Y-P)/L);var W=1-Math.pow(1-Y,3);d.scrollLeft=p+Q*W;d.scrollTop=A+ba*W;1>Y&&window.requestAnimationFrame(X)};
-window.requestAnimationFrame(X)}};Graph.applyTransformTransition=function(d,p){p=p||600;var A=d.view.getDrawPane(),G=null!=A?A.parentNode:null;if(null!=G){var I=G.style.transition;G.style.transition="transform "+p+"ms cubic-bezier(0.16, 1, 0.3, 1)";d.armTransformTransition=!0;var L=function(){G.style.transition=I||"";d.armTransformTransition=!1;G.removeEventListener("transitionend",L)};G.addEventListener("transitionend",L);window.setTimeout(L,p+100)}};Graph.prototype.fitBoundsCssTransform=function(d,
-p){var A=null!=p?p:10;p=this.view.graphBounds;var G=Math.max(p.x,d.x),I=Math.max(p.y,d.y),L=Math.max(1,Math.min(p.x+p.width,d.x+d.width)-G),P=Math.max(1,Math.min(p.y+p.height,d.y+d.height)-I),Q=this.container.clientWidth-A,ba=this.container.clientHeight-A;d=Math.floor(20*Math.min(Q/L,ba/P))/20;this.view.scaleAndTranslate(d,-p.x,-p.y);G=(G-p.x)*d-Math.max((Q-L*d)/2+A/2,0);A=(I-p.y)*d-Math.max((ba-P*d)/2+A/2,0);L=this.getBorder();I=p.width*d+2*L-this.container.clientWidth;p=p.height*d+2*L-this.container.clientHeight;
-this.container.scrollLeft=0>I?0:Math.max(0,Math.min(G,I));this.container.scrollTop=0>p?0:Math.max(0,Math.min(A,p))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(d,p,A){if(this.isGraphTornDown())null!=A&&A();else{var G=this.container,I=G.scrollLeft,L=G.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(d,p)):this.fitWindow(d,p);Graph.smoothScrollContainer(G,I,L,
-G.scrollLeft,G.scrollTop,600);null!=A&&window.setTimeout(A,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(d,p){var A=this.view.getState(d);if(null!=A){var G=this.view.graphBounds,I=this.view.scale;this.view.translate.x===-G.x&&this.view.translate.y===-G.y||this.view.scaleAndTranslate(I,-G.x,-G.y);d=this.container.clientWidth;var L=this.container.clientHeight,P=this.getBorder(),Q=G.width*I+2*P-d;P=G.height*I+2*P-L;if(null!=p){var ba=(A.x-G.x)*I,X=(A.y-G.y)*I,Y=(A.x+A.width-G.x)*I;
-G=(A.y+A.height-G.y)*I;var W=this.container.scrollLeft;A=this.container.scrollTop;ba-p<W?W=ba-p:Y+p>W+d&&(W=Y+p-d);X-p<A?A=X-p:G+p>A+L&&(A=G+p-L)}else W=(A.x+A.width/2-G.x)*I-d/2,A=(A.y+A.height/2-G.y)*I-L/2;this.container.scrollLeft=0>Q?0:Math.max(0,Math.min(W,Q));this.container.scrollTop=0>P?0:Math.max(0,Math.min(A,P))}};Graph.prototype.scrollCellToVisibleBorder=function(d,p){null==p?this.scrollCellToVisible(d):(d=this.view.getState(d),null!=d&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+
-d.x-p,-this.view.translate.y+d.y-p,d.width+2*p,d.height+2*p)))};Graph.prototype.smoothScrollCellToVisible=function(d,p,A){if(this.isGraphTornDown())null!=A&&A();else{var G=this.container,I=G.scrollLeft,L=G.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(d,p):this.scrollCellToVisibleBorder(d,p);Graph.smoothScrollContainer(G,I,L,G.scrollLeft,G.scrollTop,600);null!=A&&window.setTimeout(A,600)}};Graph.prototype.toggleCellsTransient=function(d){d=this.getNodesForCells(d);for(var p=
-0;p<d.length;p++){var A=d[p].style.opacity;A=""===A||null===A||0<parseFloat(A);d[p].style.opacity=A?0:1}};Graph.prototype.setCellStylesTransient=function(d,p,A){for(var G=0;G<A.length;G++){var I=this.view.getState(A[G]);null!=I&&null!=I.style&&(null==p?delete I.style[d]:I.style[d]=p,null!=I.shape&&(I.shape.apply(I),I.shape.redraw()),null!=I.text&&(I.text.apply(I),I.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(d,p,A){null==p&&(p="0");for(var G=0;G<A.length;G++){var I=this.view.getState(A[G]);
-if(null!=I&&null!=I.style){var L=mxUtils.getValue(I.style,d,p)?"0":"1";I.style[d]=L;null!=I.shape&&(I.shape.apply(I),I.shape.redraw());null!=I.text&&(I.text.apply(I),I.text.redraw())}}};Graph.prototype.executeCustomActions=function(d,p,A){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));
-else{this.executingCustomActions=!0;var G=!1,I=0,L=0,P=mxUtils.bind(this,function(){G||(G=!0,this.model.beginUpdate())}),Q=mxUtils.bind(this,function(){G&&(G=!1,this.model.endUpdate())}),ba=null==A,X=function(S){return null!=S.transient?S.transient:ba},Y=mxUtils.bind(this,function(){0<I&&I--;0==I&&ca()}),W=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=p&&p();else if(L<d.length){do{var S=this.stoppingCustomActions,Z=d[L++],da=
-[];if(null!=Z.open)if(Q(),this.isCustomLink(Z.open)){if(!this.customLinkClicked(Z.open,A)){this.stoppingCustomActions=this.executingCustomActions=!1;null!=p&&p();return}}else this.openLink(Z.open);null==Z.wait||S||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;Y()}),I++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Z.wait?parseInt(Z.wait):1E3),Q());null!=Z.opacity&&null!=Z.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Z.opacity,
-!0)),Z.opacity.value);null!=Z.fadeIn&&(I++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeIn,!0)),0,1,Y,S?0:Z.fadeIn.delay));null!=Z.fadeOut&&(I++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeOut,!0)),1,0,Y,S?0:Z.fadeOut.delay));if(null!=Z.fadeTo&&null!=Z.fadeTo.value){I++;var N=this.getNodesForCells(this.getCellsForAction(Z.fadeTo,!0)),aa=S?0:null!=Z.fadeTo.delay?Z.fadeTo.delay:1E3;Graph.setTransitionForNodes(N,"all "+aa+"ms ease-in-out");Graph.setOpacityForNodes(N,
-Z.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(N,null);Y()},aa)}null!=Z.flow&&(aa=this.getCellsForAction(Z.flow,!0),Editor.toggleFlowAnimation(this,aa,!1===Z.flow.start?"stop":!0===Z.flow.start?"start":"toggle"));null!=Z.wipeIn&&(da=da.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeIn,!0),!0)));null!=Z.wipeOut&&(da=da.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeOut,!0),!1)));null!=Z.popIn&&(da=da.concat(this.createPopAnimations(this.getCellsForAction(Z.popIn,
-!0),!0)));null!=Z.popOut&&(da=da.concat(this.createPopAnimations(this.getCellsForAction(Z.popOut,!0),!1)));null!=Z.toggle&&(X(Z.toggle)?this.toggleCellsTransient(this.getCellsForAction(Z.toggle,!0)):(P(),this.toggleCells(this.getCellsForAction(Z.toggle,!0,!0))));null!=Z.show&&(aa=this.getCellsForAction(Z.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(aa),1),X(Z.show)||(P(),this.setCellsVisible(this.getCellsForAction(Z.show,!0,!0),!0)));null!=Z.hide&&(aa=this.getCellsForAction(Z.hide,!0),
-Graph.setOpacityForNodes(this.getNodesForCells(aa),0),X(Z.hide)||(P(),this.setCellsVisible(this.getCellsForAction(Z.hide,!0,!0),!1)));if(null!=Z.toggleStyle&&null!=Z.toggleStyle.key){aa=this.getCellsForAction(Z.toggleStyle,!0);var ea=null!=Z.toggleStyle.defaultValue?Z.toggleStyle.defaultValue:"0";X(Z.toggleStyle)?this.toggleCellStylesTransient(Z.toggleStyle.key,ea,aa):(P(),this.toggleCellStyles(Z.toggleStyle.key,ea,aa))}null!=Z.style&&null!=Z.style.key&&(aa=this.getCellsForAction(Z.style,!0),X(Z.style)?
-this.setCellStylesTransient(Z.style.key,Z.style.value,aa):(P(),this.setCellStyles(Z.style.key,Z.style.value,aa)));aa=[];null!=Z.select&&this.isEnabled()&&(aa=this.getCellsForAction(Z.select),this.setSelectionCells(aa));null!=Z.highlight&&(aa=this.getCellsForAction(Z.highlight),this.highlightCells(aa,Z.highlight.color,Z.highlight.duration,Z.highlight.opacity));null!=Z.scroll&&(aa=this.getCellsForAction(Z.scroll));if(null!=Z.viewbox){ea=Z.viewbox;if(null!=ea.cells||null!=ea.tags||null!=ea.layers){var ka=
-this.getBoundingBox(this.getCellsForAction(ea));if(null!=ka){var ra=this.useCssTransforms?1:this.view.scale,sa=this.useCssTransforms?new mxPoint(0,0):this.view.translate,ma=null==ea.border||""===ea.border||isNaN(parseFloat(ea.border))?null:2*parseFloat(ea.border);ea={x:ka.x/ra-sa.x,y:ka.y/ra-sa.y,width:Math.max(1,ka.width/ra),height:Math.max(1,ka.height/ra),border:ma,smooth:ea.smooth}}else ea=null}null!=ea&&(!0!==ea.smooth||S?this.useCssTransforms?this.fitBoundsCssTransform(ea,ea.border):this.fitWindow(ea,
-ea.border):(I++,this.smoothFitWindow(ea,ea.border,Y)))}0<aa.length&&(ea=null==Z.scroll||null==Z.scroll.border||""===Z.scroll.border||isNaN(parseFloat(Z.scroll.border))?null:parseFloat(Z.scroll.border),null==Z.scroll||!0!==Z.scroll.smooth||S?this.useCssTransforms?this.scrollCellToVisibleCssTransform(aa[0],ea):this.scrollCellToVisibleBorder(aa[0],ea):(I++,this.smoothScrollCellToVisible(aa[0],ea,Y)));null!=A&&null!=Z.explore&&Graph.exploreFromCell(this,A,Z.explore);if(null!=Z.tags){if(null!=Z.tags.toggle)for(ea=
-Z.tags.toggle,0==ea.length&&(ea=this.getAllTags()),aa=0;aa<ea.length;aa++)this.toggleHiddenTag(ea[aa]);ea=null;null!=Z.tags.hidden&&(null==ea&&(ea=[]),ea=ea.concat(Z.tags.hidden));if(null!=Z.tags.visible)for(null==ea&&(ea=[]),ka=this.getAllTags(),aa=0;aa<ka.length;aa++)0>mxUtils.indexOf(Z.tags.visible,ka[aa])&&0>mxUtils.indexOf(ea,ka[aa])&&ea.push(ka[aa]);null!=ea&&this.setHiddenTags(ea);this.refresh()}if(0<da.length){I++;aa=null!=Z.steps?Z.steps:30;ea=Z.delay;ka=["wipeIn","wipeOut","popIn","popOut"];
-ra=null;for(sa=0;sa<ka.length;sa++)ma=Z[ka[sa]],null!=ma&&null!=ma.delay&&(ra=null==ra?ma.delay:Math.max(ra,ma.delay));null!=ra&&(ea=ra/aa);this.executeAnimations(da,Y,S?1:aa,S?0:ea)}}while(L<d.length&&!0===d[L].immediate&&!this.stoppingCustomActions);0==I?ca():Q()}else this.stoppingCustomActions=this.executingCustomActions=!1,Q(),null!=p&&p()}),ca=mxUtils.bind(this,function(){try{W()}catch(S){throw this.stoppingCustomActions=this.executingCustomActions=!1,Q(),S;}});ca()}};Graph.prototype.doUpdateCustomLinksForCell=
-function(d,p){var A=this.getLinkForCell(p);null!=A&&"data:action/json,"==A.substring(0,17)&&this.setLinkForCell(p,this.updateCustomLink(d,A));if(this.isHtmlLabel(p)){var G=document.createElement("div");G.innerHTML=Graph.sanitizeHtml(this.getLabel(p));for(var I=G.getElementsByTagName("a"),L=!1,P=0;P<I.length;P++)A=I[P].getAttribute("href"),null!=A&&"data:action/json,"==A.substring(0,17)&&(I[P].setAttribute("href",this.updateCustomLink(d,A)),L=!0);L&&this.labelChanged(p,G.innerHTML)}};Graph.prototype.updateCustomLink=
-function(d,p){if("data:action/json,"==p.substring(0,17))try{var A=JSON.parse(p.substring(17));null!=A.actions&&(this.updateCustomLinkActions(d,A.actions),p="data:action/json,"+JSON.stringify(A))}catch(G){}return p};Graph.prototype.updateCustomLinkActions=function(d,p){for(var A=0;A<p.length;A++){var G=p[A],I;for(I in G)this.updateCustomLinkAction(d,G[I],"cells"),this.updateCustomLinkAction(d,G[I],"excludeCells"),this.updateCustomLinkAction(d,G[I],"layers")}};Graph.prototype.updateCustomLinkAction=
-function(d,p,A){if(null!=p&&null!=p[A]){for(var G=[],I=0;I<p[A].length;I++)if("*"==p[A][I])G.push(p[A][I]);else{var L=d[p[A][I]];null!=L?""!=L&&G.push(L):G.push(p[A][I])}p[A]=G}};Graph.prototype.getCellsForAction=function(d,p,A){var G="or"===d.tagsMatch?"or":"and",I={},L=[],P=function(Q){for(var ba=0;ba<Q.length;ba++){var X=Q[ba].id;I[X]||(I[X]=!0,L.push(Q[ba]))}};P(this.getCellsById(d.cells));P(this.getCellsForTags(d.tags,null,p,!1,G));P(A?this.getLayerCells(d.layers):this.getCellsForLayers(d.layers));
-if(null!=d.excludeCells&&0<d.excludeCells.length){p={};G=!1;for(A=0;A<d.excludeCells.length;A++){if("*"===d.excludeCells[A]){G=!0;break}p[d.excludeCells[A]]=!0}if(G)return[];d=[];for(A=0;A<L.length;A++)p[L[A].id]||d.push(L[A]);return d}return L};Graph.prototype.getCellsById=function(d){var p=[];if(null!=d)for(var A=0;A<d.length;A++)if("*"==d[A]){var G=this.model.getRoot();p=p.concat(this.model.filterDescendants(function(L){return L!=G},G))}else{var I=this.model.getCell(d[A]);null!=I&&p.push(I)}return p};
-Graph.prototype.getCellsForLayers=function(d){var p=[];if(Array.isArray(d))for(var A=0;A<d.length;A++){var G=this.model.getCell(d[A]);null!=G&&(p=p.concat(this.model.filterDescendants(function(I){return I!=G},G)))}return p};Graph.prototype.getLayerCells=function(d){var p=[];if(Array.isArray(d))for(var A=0;A<d.length;A++){var G=this.model.getCell(d[A]);null!=G&&p.push(G)}return p};var T=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(d){return T.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(d))};
-Graph.prototype.setHiddenTags=function(d){this.hiddenTags=d;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(d){var p=mxUtils.indexOf(this.hiddenTags,d);0>p?this.hiddenTags.push(d):0<=p&&this.hiddenTags.splice(p,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(d){if(null==d||0==d.length||0==this.hiddenTags.length)return!1;d=d.split(" ");if(d.length>this.hiddenTags.length)return!1;for(var p=0;p<d.length;p++)if(0>
-mxUtils.indexOf(this.hiddenTags,d[p]))return!1;return!0};Graph.prototype.getCellsForTags=function(d,p,A,G,I){var L=[];I="or"===I;if(null!=d){p=null!=p?p:this.model.getDescendants(this.model.getRoot());for(var P=0,Q={},ba=0;ba<d.length;ba++)0<d[ba].length&&(Q[d[ba]]=!0,P++);for(ba=0;ba<p.length;ba++)if(A&&this.model.getParent(p[ba])==this.model.root||this.model.isVertex(p[ba])||this.model.isEdge(p[ba])){var X=this.getTagsForCell(p[ba]),Y=!1;if(0<X.length&&(X=X.split(" "),I||X.length>=d.length)){for(var W=
-Y=0;W<X.length&&Y<P;W++)null!=Q[X[W]]&&Y++;Y=I?0<Y:Y==P}Y&&(1!=G||this.isCellVisible(p[ba]))&&L.push(p[ba])}}return L};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(d){for(var p=null,A=[],G=0;G<d.length;G++){var I=this.getTagsForCell(d[G]);A=[];if(0<I.length){I=I.split(" ");for(var L={},P=0;P<I.length;P++)if(null==p||null!=p[I[P]])L[I[P]]=!0,A.push(I[P]);p=L}else return[]}return A};
-Graph.prototype.getTagsForCells=function(d){for(var p=[],A={},G=0;G<d.length;G++){var I=this.getTagsForCell(d[G]);if(0<I.length){I=I.split(" ");for(var L=0;L<I.length;L++)null==A[I[L]]&&(A[I[L]]=!0,p.push(I[L]))}}return p};Graph.prototype.getTagsForCell=function(d){return this.getAttributeForCell(d,"tags","")};Graph.prototype.addTagsForCells=function(d,p){if(0<d.length&&0<p.length){this.model.beginUpdate();try{for(var A=0;A<d.length;A++){for(var G=this.getTagsForCell(d[A]),I=G.split(" "),L=!1,P=0;P<
-p.length;P++){var Q=mxUtils.trim(p[P]);""!=Q&&0>mxUtils.indexOf(I,Q)&&(G=0<G.length?G+" "+Q:Q,L=!0)}L&&this.setAttributeForCell(d[A],"tags",G)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(d,p){if(0<d.length&&0<p.length){this.model.beginUpdate();try{for(var A=0;A<d.length;A++){var G=this.getTagsForCell(d[A]);if(0<G.length){for(var I=G.split(" "),L=!1,P=0;P<p.length;P++){var Q=mxUtils.indexOf(I,p[P]);0<=Q&&(I.splice(Q,1),L=!0)}L&&this.setAttributeForCell(d[A],"tags",
-I.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(d){this.model.beginUpdate();try{for(var p=0;p<d.length;p++)this.model.setVisible(d[p],!this.model.isVisible(d[p]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(d,p){this.model.beginUpdate();try{for(var A=0;A<d.length;A++)this.model.setVisible(d[A],p)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(d,p,A,G){for(var I=0;I<d.length;I++)this.highlightCell(d[I],p,
-A,G)};Graph.prototype.highlightCell=function(d,p,A,G,I){p=null!=p?p:mxConstants.DEFAULT_VALID_COLOR;A=null!=A?A:1E3;d=this.view.getState(d);var L=null;null!=d&&(I=null!=I?I:4,I=Math.max(I+1,mxUtils.getValue(d.style,mxConstants.STYLE_STROKEWIDTH,1)+I),L=new mxCellHighlight(this,p,I,!1),null!=G&&(L.opacity=G),L.highlight(d),window.setTimeout(function(){null!=L.shape&&(mxUtils.setPrefixedStyle(L.shape.node.style,"transition","all 1200ms ease-in-out"),L.shape.node.style.opacity=0);window.setTimeout(function(){L.destroy()},
-1200)},A));return L};Graph.prototype.addSvgShadow=function(d,p,A,G){G=null!=G?G:!0;var I=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=A&&A||(p=null!=p?p:d.getElementsByTagName("g")[0],null!=p&&(this.updateShadowFilter(p,!0),!isNaN(parseInt(d.getAttribute("width")))&&G&&(d.setAttribute("width",parseInt(d.getAttribute("width"))+I),d.setAttribute("height",parseInt(d.getAttribute("height"))+I),p=d.getAttribute("viewBox"),null!=p&&0<p.length&&(p=p.split(" "),3<p.length&&(w=parseFloat(p[2])+I,
-h=parseFloat(p[3])+I,d.setAttribute("viewBox",p[0]+" "+p[1]+" "+w+" "+h))))));return I};Graph.prototype.updateShadowFilter=function(d,p){mxClient.IS_SF||(p?(p=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),d.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+p.cssText+")"):d.style.filter="")};Graph.prototype.setShadowVisible=function(d,p){p=null!=p?p:!0;this.shadowVisible=
-d;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);p&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var d=this.model.getChildCount(this.model.root),p=0;do var A=this.model.getChildAt(this.model.root,
-p);while(p++<d&&"1"==mxUtils.getValue(this.getCellStyle(A),"locked","0"));null!=A&&this.setDefaultParent(A)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=
-[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",
-STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",
-STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=
-[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=
-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=
-[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];
-mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+
-"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=
-[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate4=[SHAPES_PATH+"/mxArchiMate3.js",SHAPES_PATH+"/mxArchiMate4.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",
-STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.atlassian2=[SHAPES_PATH+"/mxAtlassian2.js",STENCIL_PATH+"/atlassian2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+
-"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
-[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(d){var p=null;null!=d&&0<d.length&&("ER"==d.substring(0,2)?p="mxgraph.er":"sysML"==d.substring(0,5)&&(p="mxgraph.sysml"));return p};var V=mxMarker.createMarker;mxMarker.createMarker=function(d,p,A,G,I,L,P,
-Q,ba,X){if(null!=A&&null==mxMarker.markers[A]){var Y=this.getPackageForType(A);null!=Y&&mxStencilRegistry.getStencil(Y)}return V.apply(this,arguments)};var fa=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(d,p,A,G,I,L){"1"==mxUtils.getValue(p.style,"lineShape",null)&&d.setFillColor(mxUtils.getValue(p.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return fa.apply(this,arguments)};PrintDialog.prototype.create=function(d,p,A,G){function I(){aa.value=Math.max(1,Math.min(ca,Math.max(parseInt(aa.value),
-parseInt(N.value))));N.value=Math.max(1,Math.min(ca,Math.min(parseInt(aa.value),parseInt(N.value))))}function L(Ha){d.lastPrintPagesRadioChecked=da.checked;d.lastPrintSelectionOnlyChecked=ea.checked;d.lastPrintCropRadioChecked=ra.checked;d.lastPrintFitRadioChecked=sa.checked;da.checked&&N.value<aa.value?(d.lastPrintPagesFromInput=N.value,d.lastPrintPagesToInput=aa.value):(d.lastPrintPagesFromInput=null,d.lastPrintPagesToInput=null);la.value=Math.max(1,Math.min(1600,parseInt(la.value)))+"%";d.lastPrintZoom=
-la.value;d.lastPrintBorder=ha.value;d.lastPrintGrid=xa.checked;d.lastPrintShadow=Ca.checked;d.lastPrintTransparent=pa.checked;d.lastPrintInclude=oa.checked;d.lastPrintIcons=Da.checked;d.lastPrintSheetsAcross=na.value;d.lastPrintSheetsDown=Aa.value;var Ma={};Ma.border=parseInt(ha.value);Ma.scale=parseInt(la.value)/100;Ma.grid=xa.checked;Ma.shadows=Ca.checked;Ma.transparent=pa.checked;Ma.includeCopy=oa.checked;Ma.icons=Da.checked&&EditorUi.isElectronApp;Ma.sheetsAcross=parseInt(na.value);Ma.sheetsDown=
-parseInt(Aa.value);Ma.pagesFrom=parseInt(N.value);Ma.pagesTo=parseInt(aa.value);Ma.allPages=S.checked;Ma.selection=ea.checked;Ma.pageView=ka.checked;Ma.crop=ra.checked;Ma.fit=sa.checked;return null!=A?A(!Ha,Ma):d.print(!Ha,Ma)}function P(Ha){try{d.hideDialog(),null!=A?L(Ha):d.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{L(Ha),d.spinner.stop()}catch(Ma){d.handleError(Ma)}},0)}catch(Ma){d.handleError(Ma)}}var Q=d.editor.graph,ba=document.createElement("div");
-ba.style.display="flex";ba.style.flexDirection="column";ba.style.minHeight="0";var X=document.createElement("div");X.style.flex="1 1 auto";X.style.minHeight="0";X.style.overflowY="auto";ba.appendChild(X);var Y=document.createElement("h3");mxUtils.write(Y,p||mxResources.get("print"));X.appendChild(Y);var W=1,ca=1;Y=document.createElement("div");Y.className="geDialogSection";Y.style.whiteSpace="nowrap";var S=document.createElement("input");S.style.marginRight="8px";S.setAttribute("type","radio");S.setAttribute("name",
-"pages-printdialog");S.setAttribute("id","gePrintDlgAllPages");var Z=document.createElement("div");Z.className="geDialogCheckRow";Z.appendChild(S);p=document.createElement("label");p.setAttribute("for","gePrintDlgAllPages");mxUtils.write(p,mxResources.get("allPages"));Z.appendChild(p);Y.appendChild(Z);var da=document.createElement("input");da.style.marginRight="8px";da.setAttribute("type","radio");da.setAttribute("name","pages-printdialog");da.setAttribute("id","gePrintDlgPages");Z=document.createElement("div");
-Z.className="geDialogCheckRow";Z.appendChild(da);p=document.createElement("label");p.setAttribute("for","gePrintDlgPages");mxUtils.write(p,mxResources.get("pages")+":");Z.appendChild(p);var N=document.createElement("input");N.style.margin="0 4px";N.setAttribute("value","1");N.setAttribute("type","number");N.setAttribute("min","1");N.style.width="40px";Z.appendChild(N);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));Z.appendChild(p);var aa=N.cloneNode(!0);Z.appendChild(aa);
-mxEvent.addListener(N,"focus",function(){da.checked=!0});mxEvent.addListener(aa,"focus",function(){da.checked=!0});mxEvent.addListener(N,"change",I);mxEvent.addListener(aa,"change",I);if(null!=d.pages&&(ca=d.pages.length,null!=d.currentPage))for(p=0;p<ca;p++)if(d.currentPage==d.pages[p]){W=p+1;break}null!=d.lastPrintPagesFromInput&&null!=d.lastPrintPagesToInput?(N.value=Math.min(ca,Math.max(1,d.lastPrintPagesFromInput)),aa.value=Math.min(ca,Math.max(1,d.lastPrintPagesToInput))):(N.value=W,aa.value=
-W);N.setAttribute("max",ca);aa.setAttribute("max",ca);p=mxUtils.button(mxResources.get("currentPage"),function(Ha){N.value=W;aa.value=W;da.checked=!0});p.className="geBtn";p.setAttribute("title",mxResources.get("currentPage"));p.style.marginLeft="4px";p.style.maxWidth="100px";Z.appendChild(p);Y.appendChild(Z);1<ca&&X.appendChild(Y);Z=document.createElement("div");Z.className="geDialogCheckRow";var ea=document.createElement("input");ea.setAttribute("name","pages-printdialog");ea.setAttribute("type",
-1==ca?"checkbox":"radio");ea.setAttribute("id","gePrintDlgSelectionOnly");ea.style.marginRight="8px";Q.isSelectionEmpty()&&ea.setAttribute("disabled","disabled");Q.isEnabled()&&(Z.appendChild(ea),p=document.createElement("label"),p.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(p,mxResources.get("selectionOnly")),Z.appendChild(p));Q.isEnabled()&&(1<ca?Y.appendChild(Z):(p=document.createElement("div"),p.className="geDialogSection",p.appendChild(Z),X.appendChild(p)));!d.isPagesEnabled()||
-d.lastPrintPagesRadioChecked?da.checked=!0:!Q.isSelectionEmpty()&&d.lastPrintSelectionOnlyChecked?ea.checked=!0:S.checked=!0;Q=d.addAdvancedSection(X);X=Q.content;Y=document.createElement("div");Y.className="geDialogCheckRow";var ka=document.createElement("input");ka.style.marginRight="8px";ka.setAttribute("type","radio");ka.setAttribute("name","printSize");ka.setAttribute("id","gePrintDlgPageView");Y.appendChild(ka);p=document.createElement("label");p.setAttribute("for","gePrintDlgPageView");mxUtils.write(p,
-mxResources.get("pageView"));Y.appendChild(p);mxEvent.addListener(Y,"click",function(){ka.checked=!0});X.appendChild(Y);Y=document.createElement("div");Y.className="geDialogCheckRow";var ra=document.createElement("input");ra.style.marginRight="8px";ra.setAttribute("type","radio");ra.setAttribute("name","printSize");ra.setAttribute("id","gePrintDlgCrop");Y.appendChild(ra);p=document.createElement("label");p.setAttribute("for","gePrintDlgCrop");mxUtils.write(p,mxResources.get("crop"));Y.appendChild(p);
-mxEvent.addListener(Y,"click",function(){ra.checked=!0});X.appendChild(Y);Y=document.createElement("div");Y.className="geDialogCheckRow";Y.style.alignItems="flex-start";var sa=document.createElement("input");sa.style.marginTop="4px";sa.setAttribute("type","radio");sa.setAttribute("name","printSize");Y.appendChild(sa);Z=document.createElement("table");Z.style.display="inline-block";Z.style.borderSpacing="0";var ma=document.createElement("tbody"),wa=document.createElement("tr"),va=wa.cloneNode(!0),
-za=document.createElement("td"),Ba=za.cloneNode(!0),ua=za.cloneNode(!0),qa=za.cloneNode(!0),ia=za.cloneNode(!0),ja=za.cloneNode(!0);za.style.textAlign="right";qa.style.textAlign="right";mxUtils.write(za,mxResources.get("fitTo"));mxEvent.addListener(Y,"click",function(Ha){mxEvent.getSource(Ha)!=sa&&(sa.checked=!sa.checked)});var na=document.createElement("input");na.style.margin="0 2px";na.style.boxSizing="border-box";na.setAttribute("value",d.lastPrintSheetsAcross||"1");na.setAttribute("min","1");
-na.setAttribute("type","number");na.style.width="40px";Ba.appendChild(na);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));ua.appendChild(p);mxUtils.write(qa,mxResources.get("fitToBy"));var Aa=na.cloneNode(!0);Aa.setAttribute("value",d.lastPrintSheetsDown||"1");ia.appendChild(Aa);mxEvent.addListener(na,"click",function(Ha){sa.checked=!0;mxEvent.consume(Ha)});mxEvent.addListener(Aa,"click",function(Ha){sa.checked=!0;mxEvent.consume(Ha)});d.lastPrintCropRadioChecked?
-ra.checked=!0:d.lastPrintFitRadioChecked?sa.checked=!0:ka.checked=!0;p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));ja.appendChild(p);wa.appendChild(za);wa.appendChild(Ba);wa.appendChild(ua);va.appendChild(qa);va.appendChild(ia);va.appendChild(ja);ma.appendChild(wa);ma.appendChild(va);Z.appendChild(ma);Y.appendChild(Z);X.appendChild(Y);X=document.createElement("div");X.className="geDialogSection";p=document.createElement("div");p.className="geDialogFormRow";Y=
-document.createElement("label");Y.className="geDialogFormLabel";Y.setAttribute("for","gePrintDlgBorder");mxUtils.write(Y,mxResources.get("borderWidth"));p.appendChild(Y);var ha=document.createElement("input");ha.setAttribute("type","number");ha.setAttribute("min","0");ha.setAttribute("id","gePrintDlgBorder");ha.style.width="40px";ha.value=null!=d.lastPrintBorder?d.lastPrintBorder:mxPrintPreview.prototype.pageMargin;p.appendChild(ha);Y=document.createElement("label");Y.setAttribute("for","gePrintDlgZoom");
-Y.style.marginLeft="12px";Y.style.marginRight="4px";mxUtils.write(Y,mxResources.get("zoom"));p.appendChild(Y);var la=document.createElement("input");la.setAttribute("id","gePrintDlgZoom");la.style.width="60px";la.value=null!=d.lastPrintZoom?d.lastPrintZoom:"100%";p.appendChild(la);X.appendChild(p);Y=document.createElement("div");Y.className="geDialogCheckRow";var xa=document.createElement("input");xa.setAttribute("type","checkbox");xa.setAttribute("id","gePrintDlgGrid");xa.style.marginRight="8px";
-xa.checked=null!=d.lastPrintGrid?d.lastPrintGrid:!1;Y.appendChild(xa);p=document.createElement("label");p.setAttribute("for","gePrintDlgGrid");mxUtils.write(p,mxResources.get("grid"));Y.appendChild(p);X.appendChild(Y);Y=document.createElement("div");Y.className="geDialogCheckRow";var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.setAttribute("id","gePrintDlgShadows");Ca.style.marginRight="8px";Ca.checked=null!=d.lastPrintShadow?d.lastPrintShadow:!1;Y.appendChild(Ca);p=document.createElement("label");
-p.setAttribute("for","gePrintDlgShadows");mxUtils.write(p,mxResources.get("shadows"));Y.appendChild(p);d.isOffline()&&!mxClient.IS_CHROMEAPP||Y.appendChild(d.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(Y.style.display="none");X.appendChild(Y);var pa=document.createElement("input");pa.setAttribute("type","checkbox");pa.setAttribute("id","gePrintDlgTransparent");pa.style.marginRight="8px";pa.checked=null!=d.lastPrintTransparent?
-d.lastPrintTransparent:!1;null!=A&&(Y=document.createElement("div"),Y.className="geDialogCheckRow",Y.appendChild(pa),p=document.createElement("label"),p.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(p,mxResources.get("transparentBackground")),Y.appendChild(p),X.appendChild(Y));var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.setAttribute("id","gePrintDlgInclude");oa.style.marginRight="8px";oa.checked=null!=d.lastPrintInclude?d.lastPrintInclude:Editor.defaultIncludeDiagram;
-null==A||mxClient.IS_CHROMEAPP||"draw.io"!=d.getServiceName()||(Y=document.createElement("div"),Y.className="geDialogCheckRow",Y.appendChild(oa),p=document.createElement("label"),p.setAttribute("for","gePrintDlgInclude"),mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram")),Y.appendChild(p),X.appendChild(Y));var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.setAttribute("id","gePrintDlgIcons");Da.style.marginRight="8px";Da.checked=null!=d.lastPrintIcons?d.lastPrintIcons:
-!1;null!=A&&EditorUi.isElectronApp&&(Y=document.createElement("div"),Y.className="geDialogCheckRow",Y.appendChild(Da),p=document.createElement("label"),p.setAttribute("for","gePrintDlgIcons"),mxUtils.write(p,mxResources.get("notes")),Y.appendChild(p),X.appendChild(Y));Q.wrapper.appendChild(X);p=document.createElement("div");p.style.flex="0 0 auto";p.style.marginTop="16px";p.style.textAlign="right";p.style.whiteSpace="nowrap";d.isOffline()&&!mxClient.IS_CHROMEAPP||null!=A||p.appendChild(d.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));
-Q=mxUtils.button(mxResources.get("cancel"),function(){d.hideDialog()});Q.className="geBtn";d.editor.cancelFirst&&p.appendChild(Q);PrintDialog.previewEnabled&&null==A&&(X=mxUtils.button(mxResources.get("preview"),function(){P(!1)}),X.className="geBtn",p.appendChild(X));G=null!=G?G:null!=A?"export":PrintDialog.previewEnabled?"print":"ok";G=mxUtils.button(mxResources.get(G),function(){P(!0)});G.className="geBtn gePrimaryBtn";p.appendChild(G);d.editor.cancelFirst||p.appendChild(Q);ba.appendChild(p);if(d.editor.isChromelessView()){var Fa=
-function(){Editor.isDarkMode()?(ba.classList.add("geDarkMode"),ba.style.colorScheme="dark"):(ba.classList.remove("geDarkMode"),ba.style.colorScheme="light")};d.addListener("darkModeChanged",Fa);Fa();var Ia=function(Ha,Ma){Ha=Ma.getProperty("dialog");ba.parentNode==Ha.container&&(d.editor.removeListener(Ia),d.removeListener(Fa))};d.editor.addListener("hideDialog",Ia)}this.container=ba};var y=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=
-this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var d=this.image;null!=d&&null!=d.src&&Graph.isPageLink(d.src)&&(d={originalSrc:d.src});this.page.viewState.backgroundImage=d}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);
-null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else y.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(d=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=d?d:"default"),null!=this.shadowVisible&&this.shadowVisible!=
-this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(d){var p=[];if(null==d)return p;var A=function(ba){if(null!=ba)return ba=parseFloat(ba),!isNaN(ba)&&0<=ba?ba:void 0},G={fade:!0,pop:!0,wipe:!0};d=d.split("\n");for(var I=0;I<d.length;I++){var L=mxUtils.trim(d[I]);if(""!=L&&"#"!=L.charAt(0)){L=L.split(/\s+/);var P={action:L[0],cell:L[1],arg:L[2]};if("wait"==P.action){if(P.delay=
-parseFloat(P.cell),isNaN(P.delay)||0>P.delay)P.delay=1E3}else if("setOpacity"==P.action)P.opacity=parseFloat(L[2]),isNaN(P.opacity)&&(P.opacity=1),P.opacity=Math.max(0,Math.min(1,P.opacity)),P.duration=A(L[3]),P.arg=void 0;else if("show"==P.action){if(null!=P.arg&&!G[P.arg]){var Q=A(P.arg);null!=Q&&(P.duration=Q,P.arg=void 0)}null==P.duration&&(P.duration=A(L[3]))}else"hide"==P.action&&(P.duration=A(L[2]),P.arg=void 0);p.push(P)}}return p};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=
-function(d,p){return d.action!=p.action||"wait"==d.action||(d.arg||"")!=(p.arg||"")||(null!=d.opacity?d.opacity:"")!=(null!=p.opacity?p.opacity:"")||(null!=d.duration?d.duration:"")!=(null!=p.duration?p.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(d){if("wait"==d.action)return{wait:d.delay};var p="all"==d.cell?"*":d.cell;if(null==p)return null;var A={cells:[p]};if(null!=d.duration)A.delay=d.duration;else if("show"==d.action&&"fade"==d.arg)A.delay=Editor.animationFadeDelay;else if("hide"==
-d.action||"setOpacity"==d.action)A.delay=Editor.animationFadeDelay;return"show"==d.action?"fade"==d.arg?{fadeIn:A}:"pop"==d.arg?{popIn:A}:{wipeIn:A}:"hide"==d.action?{fadeOut:A}:"setOpacity"==d.action?(A.value=d.opacity,{fadeTo:A}):"flow"==d.action?(p={cells:[p]},"start"==d.arg?p.start=!0:"stop"==d.arg&&(p.start=!1),{flow:p}):null};Editor.convertLegacyAnimation=function(d){d=Editor.parseAnimationScript(d);for(var p=[{opacity:{cells:["*"],value:0}}],A=null,G=function(){null!=A&&(p.push(A),A=null)},
-I=function(Q){null==A&&(A={});for(var ba in Q){var X=Q[ba],Y;if(Y=null!=A[ba]&&null!=X&&Array.isArray(A[ba].cells)&&Array.isArray(X.cells))Y=A[ba],Y=Y.delay===X.delay&&Y.value===X.value&&Y.start===X.start;if(Y)for(Y=0;Y<X.cells.length;Y++)A[ba].cells.push(X.cells[Y]);else null!=A[ba]&&(G(),A={}),A[ba]=X}},L=0;L<d.length;L++){var P=Editor.convertLegacyAnimationStep(d[L]);null!=P&&(null!=P.wait?(G(),p.push(P)):I(P))}G();return{animation:{steps:p}}};Editor.parseAnimationData=function(d){var p=function(G){null==
-G&&(G={});Array.isArray(G.steps)||(G.steps=[]);G.loop=null==G.loop?!0:!!G.loop;G.enabled=null==G.enabled?!0:!!G.enabled;return G};if(null==d||""===d)return p({steps:[]});if("string"==typeof d){var A=mxUtils.trim(d);return"{"==A.charAt(0)||"["==A.charAt(0)?Editor.parseAnimationData(JSON.parse(A)):p(Editor.convertLegacyAnimation(d).animation)}return null!=d.animation&&null!=d.animation.steps?p(d.animation):Array.isArray(d.steps)?p(d):p({steps:[]})};Editor.AnimationPlayer=function(d,p){this.graph=d;
-this.data=Editor.parseAnimationData(p);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(d){var p=[],A;for(A in d.cells){var G=d.cells[A];(d.isVertex(G)||d.isEdge(G))&&p.push(G)}return p};Editor.AnimationPlayer.prototype.collectReferencedCells=function(){for(var d=this.data.steps||[],p={},A=[],G=0;G<d.length;G++){var I=d[G],L;for(L in I)if("wait"!=L&&"open"!=L){var P=I[L];if("object"===typeof P&&null!=P){P=this.graph.getCellsForAction(P,
-!0);for(var Q=0;Q<P.length;Q++)p[P[Q].id]||(p[P[Q].id]=!0,A.push(P[Q]))}}}return A};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var d=this.collectReferencedCells();d=this.graph.getNodesForCells(d);this.snapshot=[];for(var p=0;p<d.length;p++)this.snapshot.push({node:d[p],opacity:d[p].style.opacity})};Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var d=0;d<this.snapshot.length;d++)Graph.setTransitionForNodes([this.snapshot[d].node],null),this.snapshot[d].node.style.opacity=
-this.snapshot[d].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(d){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){d=d||{};this.running=!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var p=this,A=this.data.steps||[],G=function(L,P){if(null==p.graph||p.graph.isGraphTornDown())p.running=!1;else if(p.cancelled||L>=A.length)P();else{for(var Q=L+1;Q<A.length&&!0===A[Q].immediate&&!p.cancelled;)Q++;if("function"==typeof d.onStep)try{d.onStep(L,
-Q)}catch(ba){}p.graph.executeCustomActions(Graph.flattenAnimationActions(A.slice(L,Q)),function(){G(Q,P)},null)}},I=function(){null==p.graph||p.graph.isGraphTornDown()?p.running=!1:p.cancelled?(p.restoreOpacity(),p.running=!1):(p.snapshotOpacity(),G(0,function(){if(p.cancelled)p.restoreOpacity(),p.running=!1;else{if("function"==typeof d.onStep)try{d.onStep(-1)}catch(L){}d.loop?(p.graph.refresh(),p.restoreOpacity(),window.setTimeout(I,0)):(p.running=!1,p.restoreOpacity(),null!=d.done&&d.done())}}))};
-d.defer?window.setTimeout(I,0):I()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var d=[],p=this.collectReferencedCells(),A=0;A<p.length;A++)this.graph.getModel().isEdge(p[A])&&d.push(p[A]);0<d.length&&Editor.toggleFlowAnimation(this.graph,d,"stop")};Editor.toggleFlowAnimation=function(d,p,A){A=A||"toggle";for(var G=0;G<p.length;G++)if(d.getModel().isEdge(p[G])){var I=d.view.getState(p[G]);if(null!=I&&null!=I.shape){var L=
-null!=I.shape.getFlowAnimationPath?I.shape.getFlowAnimationPath():null;if(null!=L){var P="mxEdgeFlow"==L.getAttribute("class"),Q="start"==A||"toggle"==A&&!P;P="stop"==A||"toggle"==A&&P;I="1"==mxUtils.getValue(I.style,mxConstants.STYLE_DASHED,"0");P?(L.removeAttribute("class"),I||L.removeAttribute("stroke-dasharray")):Q&&(L.setAttribute("class","mxEdgeFlow"),I||L.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(d,p){var A=d.getModel().getRoot(),G=null;null!=A.value&&"object"==
-typeof A.value&&(G=A.value.getAttribute("animation"));if(null==G||""==G)return null;try{var I=Editor.parseAnimationData(G)}catch(P){return null}if(!I.steps||0==I.steps.length||!1===I.enabled)return null;A={};if(null!=p)for(var L in p)A[L]=p[L];null==A.loop&&(A.loop=I.loop);null==A.defer&&(A.defer=!0);d=new Editor.AnimationPlayer(d,I);d.play(A);return d};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var d=document.createElement("style");
-d.type="text/css";d.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));document.getElementsByTagName("head")[0].appendChild(d)}catch(p){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="31.4.5";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",
+if(null!=G&&null!=G.animation&&Array.isArray(G.animation.steps)){G=Graph.flattenAnimationActions(G.animation.steps);for(var J=0;J<G.length;J++)p.push(G[J])}else p.push(G)}return p};Graph.smoothScrollContainer=function(d,p,A,G,J,L){L=L||600;if(p!==G||A!==J){d.scrollLeft=p;d.scrollTop=A;var P="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),Q=G-p,ba=J-A,W=function(Y){Y=Math.min(1,(Y-P)/L);var X=1-Math.pow(1-Y,3);d.scrollLeft=p+Q*X;d.scrollTop=A+ba*X;1>Y&&window.requestAnimationFrame(W)};
+window.requestAnimationFrame(W)}};Graph.applyTransformTransition=function(d,p){p=p||600;var A=d.view.getDrawPane(),G=null!=A?A.parentNode:null;if(null!=G){var J=G.style.transition;G.style.transition="transform "+p+"ms cubic-bezier(0.16, 1, 0.3, 1)";d.armTransformTransition=!0;var L=function(){G.style.transition=J||"";d.armTransformTransition=!1;G.removeEventListener("transitionend",L)};G.addEventListener("transitionend",L);window.setTimeout(L,p+100)}};Graph.prototype.fitBoundsCssTransform=function(d,
+p){var A=null!=p?p:10;p=this.view.graphBounds;var G=Math.max(p.x,d.x),J=Math.max(p.y,d.y),L=Math.max(1,Math.min(p.x+p.width,d.x+d.width)-G),P=Math.max(1,Math.min(p.y+p.height,d.y+d.height)-J),Q=this.container.clientWidth-A,ba=this.container.clientHeight-A;d=Math.floor(20*Math.min(Q/L,ba/P))/20;this.view.scaleAndTranslate(d,-p.x,-p.y);G=(G-p.x)*d-Math.max((Q-L*d)/2+A/2,0);A=(J-p.y)*d-Math.max((ba-P*d)/2+A/2,0);L=this.getBorder();J=p.width*d+2*L-this.container.clientWidth;p=p.height*d+2*L-this.container.clientHeight;
+this.container.scrollLeft=0>J?0:Math.max(0,Math.min(G,J));this.container.scrollTop=0>p?0:Math.max(0,Math.min(A,p))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(d,p,A){if(this.isGraphTornDown())null!=A&&A();else{var G=this.container,J=G.scrollLeft,L=G.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(d,p)):this.fitWindow(d,p);Graph.smoothScrollContainer(G,J,L,
+G.scrollLeft,G.scrollTop,600);null!=A&&window.setTimeout(A,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(d,p){var A=this.view.getState(d);if(null!=A){var G=this.view.graphBounds,J=this.view.scale;this.view.translate.x===-G.x&&this.view.translate.y===-G.y||this.view.scaleAndTranslate(J,-G.x,-G.y);d=this.container.clientWidth;var L=this.container.clientHeight,P=this.getBorder(),Q=G.width*J+2*P-d;P=G.height*J+2*P-L;if(null!=p){var ba=(A.x-G.x)*J,W=(A.y-G.y)*J,Y=(A.x+A.width-G.x)*J;
+G=(A.y+A.height-G.y)*J;var X=this.container.scrollLeft;A=this.container.scrollTop;ba-p<X?X=ba-p:Y+p>X+d&&(X=Y+p-d);W-p<A?A=W-p:G+p>A+L&&(A=G+p-L)}else X=(A.x+A.width/2-G.x)*J-d/2,A=(A.y+A.height/2-G.y)*J-L/2;this.container.scrollLeft=0>Q?0:Math.max(0,Math.min(X,Q));this.container.scrollTop=0>P?0:Math.max(0,Math.min(A,P))}};Graph.prototype.scrollCellToVisibleBorder=function(d,p){null==p?this.scrollCellToVisible(d):(d=this.view.getState(d),null!=d&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+
+d.x-p,-this.view.translate.y+d.y-p,d.width+2*p,d.height+2*p)))};Graph.prototype.smoothScrollCellToVisible=function(d,p,A){if(this.isGraphTornDown())null!=A&&A();else{var G=this.container,J=G.scrollLeft,L=G.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(d,p):this.scrollCellToVisibleBorder(d,p);Graph.smoothScrollContainer(G,J,L,G.scrollLeft,G.scrollTop,600);null!=A&&window.setTimeout(A,600)}};Graph.prototype.toggleCellsTransient=function(d){d=this.getNodesForCells(d);for(var p=
+0;p<d.length;p++){var A=d[p].style.opacity;A=""===A||null===A||0<parseFloat(A);d[p].style.opacity=A?0:1}};Graph.prototype.setCellStylesTransient=function(d,p,A){for(var G=0;G<A.length;G++){var J=this.view.getState(A[G]);null!=J&&null!=J.style&&(null==p?delete J.style[d]:J.style[d]=p,this.redrawTransientStyle(J))}};Graph.prototype.redrawTransientStyle=function(d){null!=d.shape&&(d.shape.resetStyles(),this.cellRenderer.configureShape(d),d.shape.redraw());null!=d.text&&(d.text.resetStyles(),d.text.apply(d),
+d.text.valign=this.getVerticalAlign(d),d.text.redraw())};Graph.nextToggleStyleValue=function(d,p,A){return null!=p&&""!==p?null!=d&&String(d)==String(p)?A:p:null!=d&&""!==d&&0!=d&&"false"!==d?"0":"1"};Graph.prototype.toggleCellStyleValues=function(d,p,A,G){if(null!=G&&0<G.length){var J=mxUtils.getValue(this.getCurrentCellStyle(G[0]),d,A);this.setCellStyles(d,Graph.nextToggleStyleValue(J,p,A),G)}};Graph.prototype.toggleCellStylesTransient=function(d,p,A,G){for(var J=0;J<A.length;J++){var L=this.view.getState(A[J]);
+if(null!=L&&null!=L.style){var P=Graph.nextToggleStyleValue(mxUtils.getValue(L.style,d,p),G,p);null==P||""===P?delete L.style[d]:L.style[d]=P;this.redrawTransientStyle(L)}}};Graph.prototype.executeCustomActions=function(d,p,A){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=
+!0;var G=!1,J=0,L=0,P=mxUtils.bind(this,function(){G||(G=!0,this.model.beginUpdate())}),Q=mxUtils.bind(this,function(){G&&(G=!1,this.model.endUpdate())}),ba=null==A,W=function(S){return null!=S.transient?S.transient:ba},Y=mxUtils.bind(this,function(){0<J&&J--;0==J&&ca()}),X=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=p&&p();else if(L<d.length){do{var S=this.stoppingCustomActions,Z=d[L++],da=[];if(null!=Z.open)if(Q(),this.isCustomLink(Z.open)){if(!this.customLinkClicked(Z.open,
+A)){this.stoppingCustomActions=this.executingCustomActions=!1;null!=p&&p();return}}else this.openLink(Z.open);null==Z.wait||S||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;Y()}),J++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Z.wait?parseInt(Z.wait):1E3),Q());null!=Z.opacity&&null!=Z.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Z.opacity,!0)),Z.opacity.value);
+null!=Z.fadeIn&&(J++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeIn,!0)),0,1,Y,S?0:Z.fadeIn.delay));null!=Z.fadeOut&&(J++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeOut,!0)),1,0,Y,S?0:Z.fadeOut.delay));if(null!=Z.fadeTo&&null!=Z.fadeTo.value){J++;var N=this.getNodesForCells(this.getCellsForAction(Z.fadeTo,!0)),aa=S?0:null!=Z.fadeTo.delay?Z.fadeTo.delay:1E3;Graph.setTransitionForNodes(N,"all "+aa+"ms ease-in-out");Graph.setOpacityForNodes(N,Z.fadeTo.value);
+window.setTimeout(function(){Graph.setTransitionForNodes(N,null);Y()},aa)}null!=Z.flow&&(aa=this.getCellsForAction(Z.flow,!0),Editor.toggleFlowAnimation(this,aa,!1===Z.flow.start?"stop":!0===Z.flow.start?"start":"toggle"));null!=Z.wipeIn&&(da=da.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeIn,!0),!0)));null!=Z.wipeOut&&(da=da.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeOut,!0),!1)));null!=Z.popIn&&(da=da.concat(this.createPopAnimations(this.getCellsForAction(Z.popIn,
+!0),!0)));null!=Z.popOut&&(da=da.concat(this.createPopAnimations(this.getCellsForAction(Z.popOut,!0),!1)));null!=Z.toggle&&(W(Z.toggle)?this.toggleCellsTransient(this.getCellsForAction(Z.toggle,!0)):(P(),this.toggleCells(this.getCellsForAction(Z.toggle,!0,!0))));null!=Z.show&&(aa=this.getCellsForAction(Z.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(aa),1),W(Z.show)||(P(),this.setCellsVisible(this.getCellsForAction(Z.show,!0,!0),!0)));null!=Z.hide&&(aa=this.getCellsForAction(Z.hide,!0),
+Graph.setOpacityForNodes(this.getNodesForCells(aa),0),W(Z.hide)||(P(),this.setCellsVisible(this.getCellsForAction(Z.hide,!0,!0),!1)));if(null!=Z.toggleStyle&&null!=Z.toggleStyle.key){aa=this.getCellsForAction(Z.toggleStyle,!0);var ea=Z.toggleStyle.value,ka=""!==Z.toggleStyle.defaultValue?Z.toggleStyle.defaultValue:null;W(Z.toggleStyle)?this.toggleCellStylesTransient(Z.toggleStyle.key,ka,aa,ea):(P(),this.toggleCellStyleValues(Z.toggleStyle.key,ea,ka,aa))}null!=Z.style&&null!=Z.style.key&&(aa=this.getCellsForAction(Z.style,
+!0),W(Z.style)?this.setCellStylesTransient(Z.style.key,Z.style.value,aa):(P(),this.setCellStyles(Z.style.key,Z.style.value,aa)));aa=[];null!=Z.select&&this.isEnabled()&&(aa=this.getCellsForAction(Z.select),this.setSelectionCells(aa));null!=Z.highlight&&(aa=this.getCellsForAction(Z.highlight),this.highlightCells(aa,Z.highlight.color,Z.highlight.duration,Z.highlight.opacity));null!=Z.scroll&&(aa=this.getCellsForAction(Z.scroll));if(null!=Z.viewbox){ea=Z.viewbox;if(null!=ea.cells||null!=ea.tags||null!=
+ea.layers)if(ka=this.getBoundingBox(this.getCellsForAction(ea)),null!=ka){var ra=this.useCssTransforms?1:this.view.scale,sa=this.useCssTransforms?new mxPoint(0,0):this.view.translate,ma=null==ea.border||""===ea.border||isNaN(parseFloat(ea.border))?null:2*parseFloat(ea.border);ea={x:ka.x/ra-sa.x,y:ka.y/ra-sa.y,width:Math.max(1,ka.width/ra),height:Math.max(1,ka.height/ra),border:ma,smooth:ea.smooth}}else ea=null;null!=ea&&(!0!==ea.smooth||S?this.useCssTransforms?this.fitBoundsCssTransform(ea,ea.border):
+this.fitWindow(ea,ea.border):(J++,this.smoothFitWindow(ea,ea.border,Y)))}0<aa.length&&(ea=null==Z.scroll||null==Z.scroll.border||""===Z.scroll.border||isNaN(parseFloat(Z.scroll.border))?null:parseFloat(Z.scroll.border),null==Z.scroll||!0!==Z.scroll.smooth||S?this.useCssTransforms?this.scrollCellToVisibleCssTransform(aa[0],ea):this.scrollCellToVisibleBorder(aa[0],ea):(J++,this.smoothScrollCellToVisible(aa[0],ea,Y)));null!=A&&null!=Z.explore&&Graph.exploreFromCell(this,A,Z.explore);if(null!=Z.tags){if(null!=
+Z.tags.toggle)for(ea=Z.tags.toggle,0==ea.length&&(ea=this.getAllTags()),aa=0;aa<ea.length;aa++)this.toggleHiddenTag(ea[aa]);ea=null;null!=Z.tags.hidden&&(null==ea&&(ea=[]),ea=ea.concat(Z.tags.hidden));if(null!=Z.tags.visible)for(null==ea&&(ea=[]),ka=this.getAllTags(),aa=0;aa<ka.length;aa++)0>mxUtils.indexOf(Z.tags.visible,ka[aa])&&0>mxUtils.indexOf(ea,ka[aa])&&ea.push(ka[aa]);null!=ea&&this.setHiddenTags(ea);this.refresh()}if(0<da.length){J++;aa=null!=Z.steps?Z.steps:30;ea=Z.delay;ka=["wipeIn","wipeOut",
+"popIn","popOut"];ra=null;for(sa=0;sa<ka.length;sa++)ma=Z[ka[sa]],null!=ma&&null!=ma.delay&&(ra=null==ra?ma.delay:Math.max(ra,ma.delay));null!=ra&&(ea=ra/aa);this.executeAnimations(da,Y,S?1:aa,S?0:ea)}}while(L<d.length&&!0===d[L].immediate&&!this.stoppingCustomActions);0==J?ca():Q()}else this.stoppingCustomActions=this.executingCustomActions=!1,Q(),null!=p&&p()}),ca=mxUtils.bind(this,function(){try{X()}catch(S){throw this.stoppingCustomActions=this.executingCustomActions=!1,Q(),S;}});ca()}};Graph.prototype.doUpdateCustomLinksForCell=
+function(d,p){var A=this.getLinkForCell(p);null!=A&&"data:action/json,"==A.substring(0,17)&&this.setLinkForCell(p,this.updateCustomLink(d,A));if(this.isHtmlLabel(p)){var G=document.createElement("div");G.innerHTML=Graph.sanitizeHtml(this.getLabel(p));for(var J=G.getElementsByTagName("a"),L=!1,P=0;P<J.length;P++)A=J[P].getAttribute("href"),null!=A&&"data:action/json,"==A.substring(0,17)&&(J[P].setAttribute("href",this.updateCustomLink(d,A)),L=!0);L&&this.labelChanged(p,G.innerHTML)}};Graph.prototype.updateCustomLink=
+function(d,p){if("data:action/json,"==p.substring(0,17))try{var A=JSON.parse(p.substring(17));null!=A.actions&&(this.updateCustomLinkActions(d,A.actions),p="data:action/json,"+JSON.stringify(A))}catch(G){}return p};Graph.prototype.updateCustomLinkActions=function(d,p){for(var A=0;A<p.length;A++){var G=p[A],J;for(J in G)this.updateCustomLinkAction(d,G[J],"cells"),this.updateCustomLinkAction(d,G[J],"excludeCells"),this.updateCustomLinkAction(d,G[J],"layers")}};Graph.prototype.updateCustomLinkAction=
+function(d,p,A){if(null!=p&&null!=p[A]){for(var G=[],J=0;J<p[A].length;J++)if("*"==p[A][J])G.push(p[A][J]);else{var L=d[p[A][J]];null!=L?""!=L&&G.push(L):G.push(p[A][J])}p[A]=G}};Graph.prototype.getCellsForAction=function(d,p,A){var G="or"===d.tagsMatch?"or":"and",J={},L=[],P=function(Q){for(var ba=0;ba<Q.length;ba++){var W=Q[ba].id;J[W]||(J[W]=!0,L.push(Q[ba]))}};P(this.getCellsById(d.cells));P(this.getCellsForTags(d.tags,null,p,!1,G));P(A?this.getLayerCells(d.layers):this.getCellsForLayers(d.layers));
+if(!0===d.descendants)for(A=L.slice(),p=0;p<A.length;p++)P(this.model.getDescendants(A[p]));if(null!=d.excludeCells&&0<d.excludeCells.length){P={};A=!1;for(p=0;p<d.excludeCells.length;p++){if("*"===d.excludeCells[p]){A=!0;break}P[d.excludeCells[p]]=!0}if(A)return[];d=[];for(p=0;p<L.length;p++)P[L[p].id]||d.push(L[p]);return d}return L};Graph.prototype.getCellsById=function(d){var p=[];if(null!=d)for(var A=0;A<d.length;A++)if("*"==d[A]){var G=this.model.getRoot();p=p.concat(this.model.filterDescendants(function(L){return L!=
+G},G))}else{var J=this.model.getCell(d[A]);null!=J&&p.push(J)}return p};Graph.prototype.getCellsForLayers=function(d){var p=[];if(Array.isArray(d))for(var A=0;A<d.length;A++){var G=this.model.getCell(d[A]);null!=G&&(p=p.concat(this.model.filterDescendants(function(J){return J!=G},G)))}return p};Graph.prototype.getLayerCells=function(d){var p=[];if(Array.isArray(d))for(var A=0;A<d.length;A++){var G=this.model.getCell(d[A]);null!=G&&p.push(G)}return p};var T=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=
+function(d){return T.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(d))};Graph.prototype.setHiddenTags=function(d){this.hiddenTags=d;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(d){var p=mxUtils.indexOf(this.hiddenTags,d);0>p?this.hiddenTags.push(d):0<=p&&this.hiddenTags.splice(p,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(d){if(null==d||0==d.length||0==this.hiddenTags.length)return!1;
+d=d.split(" ");if(d.length>this.hiddenTags.length)return!1;for(var p=0;p<d.length;p++)if(0>mxUtils.indexOf(this.hiddenTags,d[p]))return!1;return!0};Graph.prototype.getCellsForTags=function(d,p,A,G,J){var L=[];J="or"===J;if(null!=d){p=null!=p?p:this.model.getDescendants(this.model.getRoot());for(var P=0,Q={},ba=0;ba<d.length;ba++)0<d[ba].length&&(Q[d[ba]]=!0,P++);for(ba=0;ba<p.length;ba++)if(A&&this.model.getParent(p[ba])==this.model.root||this.model.isVertex(p[ba])||this.model.isEdge(p[ba])){var W=
+this.getTagsForCell(p[ba]),Y=!1;if(0<W.length&&(W=W.split(" "),J||W.length>=d.length)){for(var X=Y=0;X<W.length&&Y<P;X++)null!=Q[W[X]]&&Y++;Y=J?0<Y:Y==P}Y&&(1!=G||this.isCellVisible(p[ba]))&&L.push(p[ba])}}return L};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(d){for(var p=null,A=[],G=0;G<d.length;G++){var J=this.getTagsForCell(d[G]);A=[];if(0<J.length){J=J.split(" ");for(var L={},
+P=0;P<J.length;P++)if(null==p||null!=p[J[P]])L[J[P]]=!0,A.push(J[P]);p=L}else return[]}return A};Graph.prototype.getTagsForCells=function(d){for(var p=[],A={},G=0;G<d.length;G++){var J=this.getTagsForCell(d[G]);if(0<J.length){J=J.split(" ");for(var L=0;L<J.length;L++)null==A[J[L]]&&(A[J[L]]=!0,p.push(J[L]))}}return p};Graph.prototype.getTagsForCell=function(d){return this.getAttributeForCell(d,"tags","")};Graph.prototype.addTagsForCells=function(d,p){if(0<d.length&&0<p.length){this.model.beginUpdate();
+try{for(var A=0;A<d.length;A++){for(var G=this.getTagsForCell(d[A]),J=G.split(" "),L=!1,P=0;P<p.length;P++){var Q=mxUtils.trim(p[P]);""!=Q&&0>mxUtils.indexOf(J,Q)&&(G=0<G.length?G+" "+Q:Q,L=!0)}L&&this.setAttributeForCell(d[A],"tags",G)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(d,p){if(0<d.length&&0<p.length){this.model.beginUpdate();try{for(var A=0;A<d.length;A++){var G=this.getTagsForCell(d[A]);if(0<G.length){for(var J=G.split(" "),L=!1,P=0;P<p.length;P++){var Q=
+mxUtils.indexOf(J,p[P]);0<=Q&&(J.splice(Q,1),L=!0)}L&&this.setAttributeForCell(d[A],"tags",J.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(d){this.model.beginUpdate();try{for(var p=0;p<d.length;p++)this.model.setVisible(d[p],!this.model.isVisible(d[p]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(d,p){this.model.beginUpdate();try{for(var A=0;A<d.length;A++)this.model.setVisible(d[A],p)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=
+function(d,p,A,G){for(var J=0;J<d.length;J++)this.highlightCell(d[J],p,A,G)};Graph.prototype.highlightCell=function(d,p,A,G,J){p=null!=p?p:mxConstants.DEFAULT_VALID_COLOR;A=null!=A?A:1E3;d=this.view.getState(d);var L=null;null!=d&&(J=null!=J?J:4,J=Math.max(J+1,mxUtils.getValue(d.style,mxConstants.STYLE_STROKEWIDTH,1)+J),L=new mxCellHighlight(this,p,J,!1),null!=G&&(L.opacity=G),L.highlight(d),window.setTimeout(function(){null!=L.shape&&(mxUtils.setPrefixedStyle(L.shape.node.style,"transition","all 1200ms ease-in-out"),
+L.shape.node.style.opacity=0);window.setTimeout(function(){L.destroy()},1200)},A));return L};Graph.prototype.addSvgShadow=function(d,p,A,G){G=null!=G?G:!0;var J=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=A&&A||(p=null!=p?p:d.getElementsByTagName("g")[0],null!=p&&(this.updateShadowFilter(p,!0),!isNaN(parseInt(d.getAttribute("width")))&&G&&(d.setAttribute("width",parseInt(d.getAttribute("width"))+J),d.setAttribute("height",parseInt(d.getAttribute("height"))+J),p=d.getAttribute("viewBox"),
+null!=p&&0<p.length&&(p=p.split(" "),3<p.length&&(w=parseFloat(p[2])+J,h=parseFloat(p[3])+J,d.setAttribute("viewBox",p[0]+" "+p[1]+" "+w+" "+h))))));return J};Graph.prototype.updateShadowFilter=function(d,p){mxClient.IS_SF||(p?(p=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),d.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+p.cssText+")"):d.style.filter="")};Graph.prototype.setShadowVisible=
+function(d,p){p=null!=p?p:!0;this.shadowVisible=d;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);p&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var d=this.model.getChildCount(this.model.root),
+p=0;do var A=this.model.getChildAt(this.model.root,p);while(p++<d&&"1"==mxUtils.getValue(this.getCellStyle(A),"locked","0"));null!=A&&this.setDefaultParent(A)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+
+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+
+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];
+mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",
+STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",
+STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=
+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",
+STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",
+STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=
+[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate4=[SHAPES_PATH+"/mxArchiMate3.js",SHAPES_PATH+"/mxArchiMate4.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",
+STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.atlassian2=[SHAPES_PATH+"/mxAtlassian2.js",STENCIL_PATH+"/atlassian2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=
+[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=
+[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(d){var p=null;null!=d&&0<d.length&&("ER"==d.substring(0,2)?p="mxgraph.er":"sysML"==d.substring(0,5)&&(p="mxgraph.sysml"));return p};
+var V=mxMarker.createMarker;mxMarker.createMarker=function(d,p,A,G,J,L,P,Q,ba,W){if(null!=A&&null==mxMarker.markers[A]){var Y=this.getPackageForType(A);null!=Y&&mxStencilRegistry.getStencil(Y)}return V.apply(this,arguments)};var fa=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(d,p,A,G,J,L){"1"==mxUtils.getValue(p.style,"lineShape",null)&&d.setFillColor(mxUtils.getValue(p.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return fa.apply(this,arguments)};PrintDialog.prototype.create=
+function(d,p,A,G){function J(){aa.value=Math.max(1,Math.min(ca,Math.max(parseInt(aa.value),parseInt(N.value))));N.value=Math.max(1,Math.min(ca,Math.min(parseInt(aa.value),parseInt(N.value))))}function L(Ha){d.lastPrintPagesRadioChecked=da.checked;d.lastPrintSelectionOnlyChecked=ea.checked;d.lastPrintCropRadioChecked=ra.checked;d.lastPrintFitRadioChecked=sa.checked;da.checked&&N.value<aa.value?(d.lastPrintPagesFromInput=N.value,d.lastPrintPagesToInput=aa.value):(d.lastPrintPagesFromInput=null,d.lastPrintPagesToInput=
+null);la.value=Math.max(1,Math.min(1600,parseInt(la.value)))+"%";d.lastPrintZoom=la.value;d.lastPrintBorder=ha.value;d.lastPrintGrid=ya.checked;d.lastPrintShadow=Ca.checked;d.lastPrintTransparent=pa.checked;d.lastPrintInclude=oa.checked;d.lastPrintIcons=Ea.checked;d.lastPrintSheetsAcross=na.value;d.lastPrintSheetsDown=Aa.value;var Ma={};Ma.border=parseInt(ha.value);Ma.scale=parseInt(la.value)/100;Ma.grid=ya.checked;Ma.shadows=Ca.checked;Ma.transparent=pa.checked;Ma.includeCopy=oa.checked;Ma.icons=
+Ea.checked&&EditorUi.isElectronApp;Ma.sheetsAcross=parseInt(na.value);Ma.sheetsDown=parseInt(Aa.value);Ma.pagesFrom=parseInt(N.value);Ma.pagesTo=parseInt(aa.value);Ma.allPages=S.checked;Ma.selection=ea.checked;Ma.pageView=ka.checked;Ma.crop=ra.checked;Ma.fit=sa.checked;return null!=A?A(!Ha,Ma):d.print(!Ha,Ma)}function P(Ha){try{d.hideDialog(),null!=A?L(Ha):d.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{L(Ha),d.spinner.stop()}catch(Ma){d.handleError(Ma)}},
+0)}catch(Ma){d.handleError(Ma)}}var Q=d.editor.graph,ba=document.createElement("div");ba.style.display="flex";ba.style.flexDirection="column";ba.style.minHeight="0";var W=document.createElement("div");W.style.flex="1 1 auto";W.style.minHeight="0";W.style.overflowY="auto";ba.appendChild(W);var Y=document.createElement("h3");mxUtils.write(Y,p||mxResources.get("print"));W.appendChild(Y);var X=1,ca=1;Y=document.createElement("div");Y.className="geDialogSection";Y.style.whiteSpace="nowrap";var S=document.createElement("input");
+S.style.marginRight="8px";S.setAttribute("type","radio");S.setAttribute("name","pages-printdialog");S.setAttribute("id","gePrintDlgAllPages");var Z=document.createElement("div");Z.className="geDialogCheckRow";Z.appendChild(S);p=document.createElement("label");p.setAttribute("for","gePrintDlgAllPages");mxUtils.write(p,mxResources.get("allPages"));Z.appendChild(p);Y.appendChild(Z);var da=document.createElement("input");da.style.marginRight="8px";da.setAttribute("type","radio");da.setAttribute("name",
+"pages-printdialog");da.setAttribute("id","gePrintDlgPages");Z=document.createElement("div");Z.className="geDialogCheckRow";Z.appendChild(da);p=document.createElement("label");p.setAttribute("for","gePrintDlgPages");mxUtils.write(p,mxResources.get("pages")+":");Z.appendChild(p);var N=document.createElement("input");N.style.margin="0 4px";N.setAttribute("value","1");N.setAttribute("type","number");N.setAttribute("min","1");N.style.width="40px";Z.appendChild(N);p=document.createElement("span");mxUtils.write(p,
+mxResources.get("to"));Z.appendChild(p);var aa=N.cloneNode(!0);Z.appendChild(aa);mxEvent.addListener(N,"focus",function(){da.checked=!0});mxEvent.addListener(aa,"focus",function(){da.checked=!0});mxEvent.addListener(N,"change",J);mxEvent.addListener(aa,"change",J);if(null!=d.pages&&(ca=d.pages.length,null!=d.currentPage))for(p=0;p<ca;p++)if(d.currentPage==d.pages[p]){X=p+1;break}null!=d.lastPrintPagesFromInput&&null!=d.lastPrintPagesToInput?(N.value=Math.min(ca,Math.max(1,d.lastPrintPagesFromInput)),
+aa.value=Math.min(ca,Math.max(1,d.lastPrintPagesToInput))):(N.value=X,aa.value=X);N.setAttribute("max",ca);aa.setAttribute("max",ca);p=mxUtils.button(mxResources.get("currentPage"),function(Ha){N.value=X;aa.value=X;da.checked=!0});p.className="geBtn";p.setAttribute("title",mxResources.get("currentPage"));p.style.marginLeft="4px";p.style.maxWidth="100px";Z.appendChild(p);Y.appendChild(Z);1<ca&&W.appendChild(Y);Z=document.createElement("div");Z.className="geDialogCheckRow";var ea=document.createElement("input");
+ea.setAttribute("name","pages-printdialog");ea.setAttribute("type",1==ca?"checkbox":"radio");ea.setAttribute("id","gePrintDlgSelectionOnly");ea.style.marginRight="8px";Q.isSelectionEmpty()&&ea.setAttribute("disabled","disabled");Q.isEnabled()&&(Z.appendChild(ea),p=document.createElement("label"),p.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(p,mxResources.get("selectionOnly")),Z.appendChild(p));Q.isEnabled()&&(1<ca?Y.appendChild(Z):(p=document.createElement("div"),p.className="geDialogSection",
+p.appendChild(Z),W.appendChild(p)));!d.isPagesEnabled()||d.lastPrintPagesRadioChecked?da.checked=!0:!Q.isSelectionEmpty()&&d.lastPrintSelectionOnlyChecked?ea.checked=!0:S.checked=!0;Q=d.addAdvancedSection(W);W=Q.content;Y=document.createElement("div");Y.className="geDialogCheckRow";var ka=document.createElement("input");ka.style.marginRight="8px";ka.setAttribute("type","radio");ka.setAttribute("name","printSize");ka.setAttribute("id","gePrintDlgPageView");Y.appendChild(ka);p=document.createElement("label");
+p.setAttribute("for","gePrintDlgPageView");mxUtils.write(p,mxResources.get("pageView"));Y.appendChild(p);mxEvent.addListener(Y,"click",function(){ka.checked=!0});W.appendChild(Y);Y=document.createElement("div");Y.className="geDialogCheckRow";var ra=document.createElement("input");ra.style.marginRight="8px";ra.setAttribute("type","radio");ra.setAttribute("name","printSize");ra.setAttribute("id","gePrintDlgCrop");Y.appendChild(ra);p=document.createElement("label");p.setAttribute("for","gePrintDlgCrop");
+mxUtils.write(p,mxResources.get("crop"));Y.appendChild(p);mxEvent.addListener(Y,"click",function(){ra.checked=!0});W.appendChild(Y);Y=document.createElement("div");Y.className="geDialogCheckRow";Y.style.alignItems="flex-start";var sa=document.createElement("input");sa.style.marginTop="4px";sa.setAttribute("type","radio");sa.setAttribute("name","printSize");Y.appendChild(sa);Z=document.createElement("table");Z.style.display="inline-block";Z.style.borderSpacing="0";var ma=document.createElement("tbody"),
+wa=document.createElement("tr"),va=wa.cloneNode(!0),za=document.createElement("td"),Ba=za.cloneNode(!0),ua=za.cloneNode(!0),qa=za.cloneNode(!0),ia=za.cloneNode(!0),ja=za.cloneNode(!0);za.style.textAlign="right";qa.style.textAlign="right";mxUtils.write(za,mxResources.get("fitTo"));mxEvent.addListener(Y,"click",function(Ha){mxEvent.getSource(Ha)!=sa&&(sa.checked=!sa.checked)});var na=document.createElement("input");na.style.margin="0 2px";na.style.boxSizing="border-box";na.setAttribute("value",d.lastPrintSheetsAcross||
+"1");na.setAttribute("min","1");na.setAttribute("type","number");na.style.width="40px";Ba.appendChild(na);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));ua.appendChild(p);mxUtils.write(qa,mxResources.get("fitToBy"));var Aa=na.cloneNode(!0);Aa.setAttribute("value",d.lastPrintSheetsDown||"1");ia.appendChild(Aa);mxEvent.addListener(na,"click",function(Ha){sa.checked=!0;mxEvent.consume(Ha)});mxEvent.addListener(Aa,"click",function(Ha){sa.checked=!0;mxEvent.consume(Ha)});
+d.lastPrintCropRadioChecked?ra.checked=!0:d.lastPrintFitRadioChecked?sa.checked=!0:ka.checked=!0;p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));ja.appendChild(p);wa.appendChild(za);wa.appendChild(Ba);wa.appendChild(ua);va.appendChild(qa);va.appendChild(ia);va.appendChild(ja);ma.appendChild(wa);ma.appendChild(va);Z.appendChild(ma);Y.appendChild(Z);W.appendChild(Y);W=document.createElement("div");W.className="geDialogSection";p=document.createElement("div");p.className=
+"geDialogFormRow";Y=document.createElement("label");Y.className="geDialogFormLabel";Y.setAttribute("for","gePrintDlgBorder");mxUtils.write(Y,mxResources.get("borderWidth"));p.appendChild(Y);var ha=document.createElement("input");ha.setAttribute("type","number");ha.setAttribute("min","0");ha.setAttribute("id","gePrintDlgBorder");ha.style.width="40px";ha.value=null!=d.lastPrintBorder?d.lastPrintBorder:mxPrintPreview.prototype.pageMargin;p.appendChild(ha);Y=document.createElement("label");Y.setAttribute("for",
+"gePrintDlgZoom");Y.style.marginLeft="12px";Y.style.marginRight="4px";mxUtils.write(Y,mxResources.get("zoom"));p.appendChild(Y);var la=document.createElement("input");la.setAttribute("id","gePrintDlgZoom");la.style.width="60px";la.value=null!=d.lastPrintZoom?d.lastPrintZoom:"100%";p.appendChild(la);W.appendChild(p);Y=document.createElement("div");Y.className="geDialogCheckRow";var ya=document.createElement("input");ya.setAttribute("type","checkbox");ya.setAttribute("id","gePrintDlgGrid");ya.style.marginRight=
+"8px";ya.checked=null!=d.lastPrintGrid?d.lastPrintGrid:!1;Y.appendChild(ya);p=document.createElement("label");p.setAttribute("for","gePrintDlgGrid");mxUtils.write(p,mxResources.get("grid"));Y.appendChild(p);W.appendChild(Y);Y=document.createElement("div");Y.className="geDialogCheckRow";var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.setAttribute("id","gePrintDlgShadows");Ca.style.marginRight="8px";Ca.checked=null!=d.lastPrintShadow?d.lastPrintShadow:!1;Y.appendChild(Ca);
+p=document.createElement("label");p.setAttribute("for","gePrintDlgShadows");mxUtils.write(p,mxResources.get("shadows"));Y.appendChild(p);d.isOffline()&&!mxClient.IS_CHROMEAPP||Y.appendChild(d.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(Y.style.display="none");W.appendChild(Y);var pa=document.createElement("input");pa.setAttribute("type","checkbox");pa.setAttribute("id","gePrintDlgTransparent");pa.style.marginRight=
+"8px";pa.checked=null!=d.lastPrintTransparent?d.lastPrintTransparent:!1;null!=A&&(Y=document.createElement("div"),Y.className="geDialogCheckRow",Y.appendChild(pa),p=document.createElement("label"),p.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(p,mxResources.get("transparentBackground")),Y.appendChild(p),W.appendChild(Y));var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.setAttribute("id","gePrintDlgInclude");oa.style.marginRight="8px";oa.checked=null!=d.lastPrintInclude?
+d.lastPrintInclude:Editor.defaultIncludeDiagram;null==A||mxClient.IS_CHROMEAPP||"draw.io"!=d.getServiceName()||(Y=document.createElement("div"),Y.className="geDialogCheckRow",Y.appendChild(oa),p=document.createElement("label"),p.setAttribute("for","gePrintDlgInclude"),mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram")),Y.appendChild(p),W.appendChild(Y));var Ea=document.createElement("input");Ea.setAttribute("type","checkbox");Ea.setAttribute("id","gePrintDlgIcons");Ea.style.marginRight="8px";
+Ea.checked=null!=d.lastPrintIcons?d.lastPrintIcons:!1;null!=A&&EditorUi.isElectronApp&&(Y=document.createElement("div"),Y.className="geDialogCheckRow",Y.appendChild(Ea),p=document.createElement("label"),p.setAttribute("for","gePrintDlgIcons"),mxUtils.write(p,mxResources.get("notes")),Y.appendChild(p),W.appendChild(Y));Q.wrapper.appendChild(W);p=document.createElement("div");p.style.flex="0 0 auto";p.style.marginTop="16px";p.style.textAlign="right";p.style.whiteSpace="nowrap";d.isOffline()&&!mxClient.IS_CHROMEAPP||
+null!=A||p.appendChild(d.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));Q=mxUtils.button(mxResources.get("cancel"),function(){d.hideDialog()});Q.className="geBtn";d.editor.cancelFirst&&p.appendChild(Q);PrintDialog.previewEnabled&&null==A&&(W=mxUtils.button(mxResources.get("preview"),function(){P(!1)}),W.className="geBtn",p.appendChild(W));G=null!=G?G:null!=A?"export":PrintDialog.previewEnabled?"print":"ok";G=mxUtils.button(mxResources.get(G),function(){P(!0)});G.className="geBtn gePrimaryBtn";
+p.appendChild(G);d.editor.cancelFirst||p.appendChild(Q);ba.appendChild(p);if(d.editor.isChromelessView()){var Ga=function(){Editor.isDarkMode()?(ba.classList.add("geDarkMode"),ba.style.colorScheme="dark"):(ba.classList.remove("geDarkMode"),ba.style.colorScheme="light")};d.addListener("darkModeChanged",Ga);Ga();var Ja=function(Ha,Ma){Ha=Ma.getProperty("dialog");ba.parentNode==Ha.container&&(d.editor.removeListener(Ja),d.removeListener(Ga))};d.editor.addListener("hideDialog",Ja)}this.container=ba};
+var y=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var d=this.image;null!=d&&null!=d.src&&Graph.isPageLink(d.src)&&(d={originalSrc:d.src});this.page.viewState.backgroundImage=d}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=
+this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else y.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(d=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),
+this.adaptiveColors=null!=d?d:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(d){var p=[];if(null==d)return p;var A=function(ba){if(null!=ba)return ba=parseFloat(ba),!isNaN(ba)&&0<=ba?ba:void 0},G={fade:!0,pop:!0,wipe:!0};d=d.split("\n");for(var J=0;J<d.length;J++){var L=mxUtils.trim(d[J]);if(""!=L&&"#"!=L.charAt(0)){L=
+L.split(/\s+/);var P={action:L[0],cell:L[1],arg:L[2]};if("wait"==P.action){if(P.delay=parseFloat(P.cell),isNaN(P.delay)||0>P.delay)P.delay=1E3}else if("setOpacity"==P.action)P.opacity=parseFloat(L[2]),isNaN(P.opacity)&&(P.opacity=1),P.opacity=Math.max(0,Math.min(1,P.opacity)),P.duration=A(L[3]),P.arg=void 0;else if("show"==P.action){if(null!=P.arg&&!G[P.arg]){var Q=A(P.arg);null!=Q&&(P.duration=Q,P.arg=void 0)}null==P.duration&&(P.duration=A(L[3]))}else"hide"==P.action&&(P.duration=A(L[2]),P.arg=
+void 0);p.push(P)}}return p};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(d,p){return d.action!=p.action||"wait"==d.action||(d.arg||"")!=(p.arg||"")||(null!=d.opacity?d.opacity:"")!=(null!=p.opacity?p.opacity:"")||(null!=d.duration?d.duration:"")!=(null!=p.duration?p.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(d){if("wait"==d.action)return{wait:d.delay};var p="all"==d.cell?"*":d.cell;if(null==p)return null;var A={cells:[p]};if(null!=d.duration)A.delay=d.duration;
+else if("show"==d.action&&"fade"==d.arg)A.delay=Editor.animationFadeDelay;else if("hide"==d.action||"setOpacity"==d.action)A.delay=Editor.animationFadeDelay;return"show"==d.action?"fade"==d.arg?{fadeIn:A}:"pop"==d.arg?{popIn:A}:{wipeIn:A}:"hide"==d.action?{fadeOut:A}:"setOpacity"==d.action?(A.value=d.opacity,{fadeTo:A}):"flow"==d.action?(p={cells:[p]},"start"==d.arg?p.start=!0:"stop"==d.arg&&(p.start=!1),{flow:p}):null};Editor.convertLegacyAnimation=function(d){d=Editor.parseAnimationScript(d);for(var p=
+[{opacity:{cells:["*"],value:0}}],A=null,G=function(){null!=A&&(p.push(A),A=null)},J=function(Q){null==A&&(A={});for(var ba in Q){var W=Q[ba],Y;if(Y=null!=A[ba]&&null!=W&&Array.isArray(A[ba].cells)&&Array.isArray(W.cells))Y=A[ba],Y=Y.delay===W.delay&&Y.value===W.value&&Y.start===W.start;if(Y)for(Y=0;Y<W.cells.length;Y++)A[ba].cells.push(W.cells[Y]);else null!=A[ba]&&(G(),A={}),A[ba]=W}},L=0;L<d.length;L++){var P=Editor.convertLegacyAnimationStep(d[L]);null!=P&&(null!=P.wait?(G(),p.push(P)):J(P))}G();
+return{animation:{steps:p}}};Editor.parseAnimationData=function(d){var p=function(G){null==G&&(G={});Array.isArray(G.steps)||(G.steps=[]);G.loop=null==G.loop?!0:!!G.loop;G.enabled=null==G.enabled?!0:!!G.enabled;return G};if(null==d||""===d)return p({steps:[]});if("string"==typeof d){var A=mxUtils.trim(d);return"{"==A.charAt(0)||"["==A.charAt(0)?Editor.parseAnimationData(JSON.parse(A)):p(Editor.convertLegacyAnimation(d).animation)}return null!=d.animation&&null!=d.animation.steps?p(d.animation):Array.isArray(d.steps)?
+p(d):p({steps:[]})};Editor.AnimationPlayer=function(d,p){this.graph=d;this.data=Editor.parseAnimationData(p);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(d){var p=[],A;for(A in d.cells){var G=d.cells[A];(d.isVertex(G)||d.isEdge(G))&&p.push(G)}return p};Editor.AnimationPlayer.prototype.collectReferencedCells=function(){for(var d=this.data.steps||[],p={},A=[],G=0;G<d.length;G++){var J=d[G],L;for(L in J)if("wait"!=L&&"open"!=L){var P=
+J[L];if("object"===typeof P&&null!=P){P=this.graph.getCellsForAction(P,!0);for(var Q=0;Q<P.length;Q++)p[P[Q].id]||(p[P[Q].id]=!0,A.push(P[Q]))}}}return A};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var d=this.collectReferencedCells();d=this.graph.getNodesForCells(d);var p=new Set;if(null==this.snapshot)this.snapshot=[];else for(var A=0;A<this.snapshot.length;A++)p.add(this.snapshot[A].node);for(A=0;A<d.length;A++)p.has(d[A])||(p.add(d[A]),this.snapshot.push({node:d[A],opacity:d[A].style.opacity}))};
+Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var d=0;d<this.snapshot.length;d++)Graph.setTransitionForNodes([this.snapshot[d].node],null),this.snapshot[d].node.style.opacity=this.snapshot[d].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(d){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){d=d||{};this.running=!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var p=this,A=this.data.steps||
+[],G=function(L,P){if(null==p.graph||p.graph.isGraphTornDown())p.running=!1;else if(p.cancelled||L>=A.length)P();else{for(var Q=L+1;Q<A.length&&!0===A[Q].immediate&&!p.cancelled;)Q++;if("function"==typeof d.onStep)try{d.onStep(L,Q)}catch(ba){}p.graph.executeCustomActions(Graph.flattenAnimationActions(A.slice(L,Q)),function(){G(Q,P)},null)}},J=function(){null==p.graph||p.graph.isGraphTornDown()?p.running=!1:p.cancelled?(p.restoreOpacity(),p.running=!1):(null==p.snapshot&&p.snapshotOpacity(),G(0,function(){if(p.cancelled)p.restoreOpacity(),
+p.running=!1;else{if("function"==typeof d.onStep)try{d.onStep(-1)}catch(L){}d.loop?(p.graph.refresh(),p.restoreOpacity(),window.setTimeout(J,0)):(p.running=!1,p.restoreOpacity(),null!=d.done&&d.done())}}))};d.defer?window.setTimeout(J,0):J()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var d=[],p=this.collectReferencedCells(),A=0;A<p.length;A++)this.graph.getModel().isEdge(p[A])&&d.push(p[A]);0<d.length&&Editor.toggleFlowAnimation(this.graph,
+d,"stop")};Editor.toggleFlowAnimation=function(d,p,A){A=A||"toggle";for(var G=0;G<p.length;G++)if(d.getModel().isEdge(p[G])){var J=d.view.getState(p[G]);if(null!=J&&null!=J.shape){var L=null!=J.shape.getFlowAnimationPath?J.shape.getFlowAnimationPath():null;if(null!=L){var P="mxEdgeFlow"==L.getAttribute("class"),Q="start"==A||"toggle"==A&&!P;P="stop"==A||"toggle"==A&&P;J="1"==mxUtils.getValue(J.style,mxConstants.STYLE_DASHED,"0");P?(L.removeAttribute("class"),J||L.removeAttribute("stroke-dasharray")):
+Q&&(L.setAttribute("class","mxEdgeFlow"),J||L.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(d,p){var A=d.getModel().getRoot(),G=null;null!=A.value&&"object"==typeof A.value&&(G=A.value.getAttribute("animation"));if(null==G||""==G)return null;try{var J=Editor.parseAnimationData(G)}catch(P){return null}if(!J.steps||0==J.steps.length||!1===J.enabled)return null;A={};if(null!=p)for(var L in p)A[L]=p[L];null==A.loop&&(A.loop=J.loop);null==A.defer&&(A.defer=!0);d=new Editor.AnimationPlayer(d,
+J);d.play(A);return d};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var d=document.createElement("style");d.type="text/css";d.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));document.getElementsByTagName("head")[0].appendChild(d)}catch(p){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="31.4.6";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",
"elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},elkRadial:{layout:"elkRadial",config:{edgeStyle:"elkCompat"}},elkOrganic:{layout:"elkOrganic",config:{edgeStyle:"elkCompat"}},elkStress:{layout:"elkStress",config:{edgeStyle:"elkCompat"}}};EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging=
"1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars=
"\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.enabledTemplateSections=null;EditorUi.customTemplates=null;EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&
@@ -14190,11 +14200,11 @@ l[n].getElementsByTagName("mxCell");f.cells+=r.length;for(var t={},v=0;v<r.lengt
0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T,V,fa){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var y=this.getBaseFilename(!r),d=y+("xml"==c||"pdf"==c&&C?".drawio":"")+"."+c;if("xml"==c){var p=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,r,null,null,null,f);this.saveData(d,c,p,"text/xml")}else if("html"==c)p=this.getHtml2(this.getFileData(!0),this.editor.graph,
y),this.saveData(d,c,p,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?d=y+".png":"jpeg"==c&&(d=y+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var A=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(d,c,n,"1",v,r,B,E,K,C,R,void 0,void 0,!t,M,O,U,T,V,fa).send(mxUtils.bind(this,function(Q){this.spinner.stop();
if(200<=Q.getStatus()&&299>=Q.getStatus()){var ba=this.createLoadMessage("export");ba.format=c;ba.filename=d;ba.data="data:application/pdf;base64,"+Q.getText();ba.xml=this.getFileData(!0);A.postMessage(JSON.stringify(ba),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(d,c,mxUtils.bind(this,function(Q,ba){try{return this.createDownloadRequest(Q,
-c,n,ba,v,r,B,E,K,C,R,void 0,void 0,!t,M,O,U,T,V,fa)}catch(X){this.handleError(X)}}));else{var G=null,I=mxUtils.bind(this,function(Q){Q.length<=MAX_REQUEST_SIZE?this.saveData(d,"svg",Q,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(G)}))});if("svg"==c){var L=this.editor.graph.background;if(v||L==mxConstants.NONE)L=null;var P=this.editor.graph.getSvg(L,null,null,null,null,n);l&&this.editor.graph.addSvgShadow(P);
-this.editor.convertImages(P,mxUtils.bind(this,mxUtils.bind(this,function(Q){this.spinner.stop();I(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(Q))})))}else d=y+".svg",G=this.getFileData(!1,!0,null,mxUtils.bind(this,function(Q){this.spinner.stop();I(Q)}),n)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T,V,fa,y,d){c=this.downloadRequestBuilder(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T,V,fa,y,d);f="";for(var p in c)l=c[p],null!=
-l&&(f+=p+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T,V,fa,y,d){var p=this.editor.graph,A=p.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==t?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var G=null,I=null,L=null;if(!EditorUi.isElectronApp&&(A.width*A.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};K=K?"1":"0";"pdf"==
-f&&(null!=C?(G=C.from,I=C.to):0==t&&(L="1"));"xmlpng"==f&&(K="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(t=0;t<this.pages.length;t++)if(this.pages[t]==this.currentPage){G=t;break}t=p.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!r?r||null!=t&&t!=mxConstants.NONE||(t="#ffffff"):t=mxConstants.NONE;r={globalVars:p.getExportVariables()};null!=C&&null!=C.from&&(r.globalVars.pagenumber=C.from+1);E&&(r.grid={size:p.gridSize,steps:p.view.gridSteps,color:Editor.isDarkMode()&&
-"pdf"==f?mxGraphView.prototype.defaultGridColor:p.view.gridColor});Graph.translateDiagram&&(r.diagramLanguage=Graph.diagramLanguage);E=this.getHiddenTagsMap();null!=E&&(r.hiddenTags=E);return{format:f,from:G,to:I,allPages:L,bg:null!=t?t:mxConstants.NONE,base64:n,embedXml:K,xml:l,filename:null!=c?c:"",extras:JSON.stringify(r),scale:v,border:B,pageMargin:U,w:R&&isFinite(R)?R:null,h:M&&isFinite(M)?M:null,crop:null!=O&&O?"1":"0",fit:null!=T&&T?"1":"0",shadows:null!=y&&y?"1":"0",sheetsAcross:V,sheetsDown:fa,
+c,n,ba,v,r,B,E,K,C,R,void 0,void 0,!t,M,O,U,T,V,fa)}catch(W){this.handleError(W)}}));else{var G=null,J=mxUtils.bind(this,function(Q){Q.length<=MAX_REQUEST_SIZE?this.saveData(d,"svg",Q,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(G)}))});if("svg"==c){var L=this.editor.graph.background;if(v||L==mxConstants.NONE)L=null;var P=this.editor.graph.getSvg(L,null,null,null,null,n);l&&this.editor.graph.addSvgShadow(P);
+this.editor.convertImages(P,mxUtils.bind(this,mxUtils.bind(this,function(Q){this.spinner.stop();J(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(Q))})))}else d=y+".svg",G=this.getFileData(!1,!0,null,mxUtils.bind(this,function(Q){this.spinner.stop();J(Q)}),n)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T,V,fa,y,d){c=this.downloadRequestBuilder(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T,V,fa,y,d);f="";for(var p in c)l=c[p],null!=
+l&&(f+=p+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T,V,fa,y,d){var p=this.editor.graph,A=p.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==t?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var G=null,J=null,L=null;if(!EditorUi.isElectronApp&&(A.width*A.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};K=K?"1":"0";"pdf"==
+f&&(null!=C?(G=C.from,J=C.to):0==t&&(L="1"));"xmlpng"==f&&(K="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(t=0;t<this.pages.length;t++)if(this.pages[t]==this.currentPage){G=t;break}t=p.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!r?r||null!=t&&t!=mxConstants.NONE||(t="#ffffff"):t=mxConstants.NONE;r={globalVars:p.getExportVariables()};null!=C&&null!=C.from&&(r.globalVars.pagenumber=C.from+1);E&&(r.grid={size:p.gridSize,steps:p.view.gridSteps,color:Editor.isDarkMode()&&
+"pdf"==f?mxGraphView.prototype.defaultGridColor:p.view.gridColor});Graph.translateDiagram&&(r.diagramLanguage=Graph.diagramLanguage);E=this.getHiddenTagsMap();null!=E&&(r.hiddenTags=E);return{format:f,from:G,to:J,allPages:L,bg:null!=t?t:mxConstants.NONE,base64:n,embedXml:K,xml:l,filename:null!=c?c:"",extras:JSON.stringify(r),scale:v,border:B,pageMargin:U,w:R&&isFinite(R)?R:null,h:M&&isFinite(M)?M:null,crop:null!=O&&O?"1":"0",fit:null!=T&&T?"1":"0",shadows:null!=y&&y?"1":"0",sheetsAcross:V,sheetsDown:fa,
icons:null!=d&&d?"1":"0"}};EditorUi.prototype.getHiddenTagsMap=function(){var c=this.editor.graph,f={},l=!1;if(null!=this.pages)for(var n=0;n<this.pages.length;n++){var r=this.pages[n],t=r==this.currentPage?c.hiddenTags:null!=r.viewState?r.viewState.hiddenTags:null;null!=t&&0<t.length&&(f[r.getId()]=t,l=!0)}else null!=c.hiddenTags&&0<c.hiddenTags.length&&(f[0]=c.hiddenTags,l=!0);return l?f:null};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=
window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");if(0<l){c=decodeURIComponent(c.substring(l+1));try{f=JSON.parse(c)}catch(n){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();
c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var l=f.lastIndexOf("#");0<l&&(f=f.substring(0,l));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(n){}0<l&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,l){var n=window.location.hash,
@@ -14230,30 +14240,30 @@ null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIn
"relative";var R=document.createElement("img");R.className="geLibraryButton";R.setAttribute("src",Editor.crossImage);R.setAttribute("title",mxResources.get("close"));var M=null;if(".scratchpad"!=c.title||this.closableScratchpad)C.appendChild(R),mxEvent.addListener(R,"click",mxUtils.bind(this,function(y){if(!mxEvent.isConsumed(y)){var d=mxUtils.bind(this,function(){null!=t&&mxUtils.remove(t,this.openLibraries);this.closeLibrary(c)});null!=M?this.confirm(mxResources.get("allChangesLost"),null,d,mxResources.get("cancel"),
mxResources.get("discardChanges")):d();mxEvent.consume(y)}}));if(c.isEditable()){var O=this.editor.graph,U=null;l=mxUtils.bind(this,function(y){this.showLibraryDialog(c.getTitle(),K,f,c,c.getMode());mxEvent.consume(y)});var T=mxUtils.bind(this,function(y){c.setModified(!0);c.isAutosave()?(null!=U&&null!=U.parentNode&&U.parentNode.removeChild(U),U=R.cloneNode(!1),U.setAttribute("src",Editor.spinImage),U.setAttribute("title",mxResources.get("saving")),U.style.cursor="default",U.style.marginRight="2px",
U.style.marginTop="-2px",C.insertBefore(U,C.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=U&&null!=U.parentNode&&U.parentNode.removeChild(U)})):null==M&&(M=R.cloneNode(!1),M.setAttribute("src",Editor.saveImage),M.setAttribute("title",mxResources.get("save")),C.insertBefore(M,C.firstChild),mxEvent.addListener(M,"click",mxUtils.bind(this,function(d){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==M||c.isModified()||(M.parentNode.removeChild(M),
-M=null)});mxEvent.consume(d)})))}),V=mxUtils.bind(this,function(y,d,p,A){y=O.cloneCells(mxUtils.sortCells(O.model.getTopmostCells(y)));for(var G=0;G<y.length;G++){var I=O.getCellGeometry(y[G]);null!=I&&I.translate(-d.x,-d.y)}K.appendChild(this.sidebar.createVertexTemplateFromCells(y,d.width,d.height,A||"",!0,null,!1));y=mxUtils.getXml(this.editor.graph.encodeCells(y));Editor.defaultCompressed&&(y=Graph.compress(y));d={xml:y,w:d.width,h:d.height};null!=A&&(d.title=A);f.push(d);T(p);null!=B&&null!=
+M=null)});mxEvent.consume(d)})))}),V=mxUtils.bind(this,function(y,d,p,A){y=O.cloneCells(mxUtils.sortCells(O.model.getTopmostCells(y)));for(var G=0;G<y.length;G++){var J=O.getCellGeometry(y[G]);null!=J&&J.translate(-d.x,-d.y)}K.appendChild(this.sidebar.createVertexTemplateFromCells(y,d.width,d.height,A||"",!0,null,!1));y=mxUtils.getXml(this.editor.graph.encodeCells(y));Editor.defaultCompressed&&(y=Graph.compress(y));d={xml:y,w:d.width,h:d.height};null!=A&&(d.title=A);f.push(d);T(p);null!=B&&null!=
B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)}),fa=mxUtils.bind(this,function(y){if(O.isSelectionEmpty())O.getRubberband().isActive()?(O.getRubberband().execute(y),O.getRubberband().reset()):null!=y&&null!=mxEvent.getSource(y)&&mxEvent.getSource(y).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var d=O.getSelectionCells(),p=O.view.getBounds(d);if(null!=p&&0<p.width&&0<p.height){var A=
O.view.scale;p.x/=A;p.y/=A;p.width/=A;p.height/=A;p.x-=O.view.translate.x;p.y-=O.view.translate.y;V(d,p)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(y)});mxEvent.addGestureListeners(K,function(){},mxUtils.bind(this,function(y){O.isMouseDown&&null!=O.panningManager&&null!=O.graphHandler.first&&(O.graphHandler.suspend(),null!=O.graphHandler.hint&&(O.graphHandler.hint.style.visibility="hidden"),K.style.backgroundColor="light-dark(#fefefe, #000000)",
K.style.cursor="copy",O.panningManager.stop(),O.autoScroll=!1,mxEvent.consume(y))}),mxUtils.bind(this,function(y){O.isMouseDown&&null!=O.panningManager&&null!=O.graphHandler&&(K.style.backgroundColor="",K.style.cursor="default",this.sidebar.showTooltips=!0,O.panningManager.stop(),O.graphHandler.reset(),O.isMouseDown=!1,O.autoScroll=!0,fa(y),mxEvent.consume(y))}));mxEvent.addListener(K,"mouseleave",mxUtils.bind(this,function(y){O.isMouseDown&&null!=O.graphHandler.first&&(O.graphHandler.resume(),null!=
O.graphHandler.hint&&(O.graphHandler.hint.style.visibility="visible"),K.style.backgroundColor="",K.style.cursor="",O.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(K,"dragover",mxUtils.bind(this,function(y){K.style.backgroundColor="light-dark(#fefefe, #000000)";y.dataTransfer.dropEffect="copy";K.style.cursor="copy";this.sidebar.hideTooltip();y.stopPropagation();y.preventDefault()})),mxEvent.addListener(K,"drop",mxUtils.bind(this,function(y){K.style.cursor="";K.style.backgroundColor="";
-0<y.dataTransfer.files.length&&this.importFiles(y.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(d,p,A,G,I,L,P,Q,ba){if(null!=d&&"image/"==p.substring(0,6))d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(d),d=[new mxCell("",new mxGeometry(0,0,I,L),d)],d[0].vertex=!0,V(d,new mxRectangle(0,0,I,L),y,mxEvent.isAltDown(y)?null:P.substring(0,P.lastIndexOf(".")).replace(/_/g," ")),null!=B&&null!=B.parentNode&&0<f.length&&
-(B.parentNode.removeChild(B),B=null);else{var X=!1,Y=mxUtils.bind(this,function(W,ca){null!=W&&"application/pdf"==ca&&(ca=Editor.extractGraphModelFromPdf(W),null!=ca&&0<ca.length&&(W=ca));if(null!=W)if(W=mxUtils.parseXml(W),"mxlibrary"==W.documentElement.nodeName)try{var S=JSON.parse(mxUtils.getTextContent(W.documentElement));E(S,K);f=f.concat(S);T(y);this.spinner.stop();X=!0}catch(aa){}else if("mxfile"==W.documentElement.nodeName)try{var Z=W.documentElement.getElementsByTagName("diagram");for(S=
-0;S<Z.length;S++){var da=this.stringToCells(Editor.getDiagramNodeXml(Z[S])),N=this.editor.graph.getBoundingBoxFromGeometry(da);null!=N&&V(da,new mxRectangle(0,0,N.width,N.height),y)}X=!0}catch(aa){null!=window.console&&console.log("error in drop handler:",aa)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)});null!=ba&&null!=P&&EditorUi.isVisioFilename(P)?this.importVisio(ba,function(W){Y(W,
-"text/xml")},null,P):this.isGliffyData(d,P)&&null!=ba?this.importGliffy(d,mxUtils.bind(this,function(W){this.spinner.stop();Y(W,"text/xml")}),mxUtils.bind(this,function(W){this.spinner.stop();this.handleError({message:mxResources.get(null!=W&&413==W.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}),P):Y(d,p)}}));y.stopPropagation();y.preventDefault()})),mxEvent.addListener(K,"dragleave",function(y){K.style.cursor="";K.style.backgroundColor="";y.stopPropagation();
+0<y.dataTransfer.files.length&&this.importFiles(y.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(d,p,A,G,J,L,P,Q,ba){if(null!=d&&"image/"==p.substring(0,6))d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(d),d=[new mxCell("",new mxGeometry(0,0,J,L),d)],d[0].vertex=!0,V(d,new mxRectangle(0,0,J,L),y,mxEvent.isAltDown(y)?null:P.substring(0,P.lastIndexOf(".")).replace(/_/g," ")),null!=B&&null!=B.parentNode&&0<f.length&&
+(B.parentNode.removeChild(B),B=null);else{var W=!1,Y=mxUtils.bind(this,function(X,ca){null!=X&&"application/pdf"==ca&&(ca=Editor.extractGraphModelFromPdf(X),null!=ca&&0<ca.length&&(X=ca));if(null!=X)if(X=mxUtils.parseXml(X),"mxlibrary"==X.documentElement.nodeName)try{var S=JSON.parse(mxUtils.getTextContent(X.documentElement));E(S,K);f=f.concat(S);T(y);this.spinner.stop();W=!0}catch(aa){}else if("mxfile"==X.documentElement.nodeName)try{var Z=X.documentElement.getElementsByTagName("diagram");for(S=
+0;S<Z.length;S++){var da=this.stringToCells(Editor.getDiagramNodeXml(Z[S])),N=this.editor.graph.getBoundingBoxFromGeometry(da);null!=N&&V(da,new mxRectangle(0,0,N.width,N.height),y)}W=!0}catch(aa){null!=window.console&&console.log("error in drop handler:",aa)}W||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)});null!=ba&&null!=P&&EditorUi.isVisioFilename(P)?this.importVisio(ba,function(X){Y(X,
+"text/xml")},null,P):this.isGliffyData(d,P)&&null!=ba?this.importGliffy(d,mxUtils.bind(this,function(X){this.spinner.stop();Y(X,"text/xml")}),mxUtils.bind(this,function(X){this.spinner.stop();this.handleError({message:mxResources.get(null!=X&&413==X.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}),P):Y(d,p)}}));y.stopPropagation();y.preventDefault()})),mxEvent.addListener(K,"dragleave",function(y){K.style.cursor="";K.style.backgroundColor="";y.stopPropagation();
y.preventDefault()}));R=R.cloneNode(!1);R.setAttribute("src",Editor.editImage);R.setAttribute("title",mxResources.get("edit"));C.insertBefore(R,C.firstChild);mxEvent.addListener(R,"click",l);l=R.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));C.insertBefore(l,C.firstChild);mxEvent.addListener(l,"click",fa);".scratchpad"==c.title&&(this.addSelectionToScratchpad=fa);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,
!0),l.className="geLibraryButton",C.insertBefore(l,C.firstChild))}n.appendChild(C);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var l=0;l<c.length;l++)try{var n=c[l],r=n.data;if(null!=r){r="data:"==r.substring(0,5)?this.convertDataUri(r):r;var t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==n.aspect&&(t+="aspect=fixed;");t=t+"image="+r+";";null!=n.style&&(t+=n.style);f.appendChild(this.sidebar.createVertexTemplate(t,
n.w,n.h,"",n.title||"",!1,null,!0))}else if(null!=n.xml){var v=this.stringToCells("<"==n.xml.charAt(0)?n.xml:Graph.decompress(n.xml)),B=0==v.length?mxResources.get("drawingEmpty"):null!=n.title?n.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(v,n.w,n.h,B,!0,null,!0))}}catch(E){B=null!=E.message?mxResources.get("error")+": "+E.message:String(E),t=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,B,!0,null,!0),f.appendChild(t)}};EditorUi.prototype.getResource=function(c){return null!=
c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,l,n,r,t,v){c=new ImageDialog(this,c,f,l,n,r,t,v);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,
!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,l,n,r,t){var v=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=v?JSON.stringify(JSON.parse(v),null,2):"",mxUtils.bind(this,function(B){if(null!=B)try{if(null!=t&&t(B),B==v)this.hideDialog();else{if(0<B.length){var E=JSON.parse(B);localStorage.setItem(f,JSON.stringify(E))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(K){this.handleError(K)}}),null,mxResources.get("close"),
-null,null,null,!0,null,null,r,l,n);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=function(c,f,l,n){function r(Q){U?K.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges")):Q()}function t(){T=!0;K.hideDialog()}function v(Q,ba){var X=document.createElement("div");X.style.padding="4px 16px";X.style.cursor="pointer";X.style.fontSize=
-"13px";X.style.borderBottom=ba?"2px solid #29b6f2":"2px solid transparent";X.style.fontWeight=ba?"bold":"normal";X.style.color=ba?"":"#888";X.style.userSelect="none";mxUtils.write(X,Q);return X}function B(Q,ba){Q.style.borderBottomColor=ba?"#29b6f2":"transparent";Q.style.fontWeight=ba?"bold":"normal";Q.style.color=ba?"":"#888"}function E(Q){if(Q!==O){if("json"===O)try{var ba=JSON.parse(I.value);M=ba;A.setConfig(ba)}catch(X){}else"json"===Q&&null!=M&&(I.value=JSON.stringify(M,null,2));d.style.display=
-"editor"===Q?"":"none";G.style.display="json"===Q?"":"none";B(fa,"editor"===Q);B(y,"json"===Q);"json"===Q&&I.focus();O=Q}}var K=this,C=localStorage.getItem(f),R={};try{null!=C&&(R=JSON.parse(C))}catch(Q){}var M=R,O="editor",U=!1,T=!1;c=document.createElement("div");c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right="20px";var V=document.createElement("div");V.style.position="absolute";V.style.left="0";V.style.right="0";V.style.top="0";V.style.height=
+null,null,null,!0,null,null,r,l,n);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=function(c,f,l,n){function r(Q){U?K.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges")):Q()}function t(){T=!0;K.hideDialog()}function v(Q,ba){var W=document.createElement("div");W.style.padding="4px 16px";W.style.cursor="pointer";W.style.fontSize=
+"13px";W.style.borderBottom=ba?"2px solid #29b6f2":"2px solid transparent";W.style.fontWeight=ba?"bold":"normal";W.style.color=ba?"":"#888";W.style.userSelect="none";mxUtils.write(W,Q);return W}function B(Q,ba){Q.style.borderBottomColor=ba?"#29b6f2":"transparent";Q.style.fontWeight=ba?"bold":"normal";Q.style.color=ba?"":"#888"}function E(Q){if(Q!==O){if("json"===O)try{var ba=JSON.parse(J.value);M=ba;A.setConfig(ba)}catch(W){}else"json"===Q&&null!=M&&(J.value=JSON.stringify(M,null,2));d.style.display=
+"editor"===Q?"":"none";G.style.display="json"===Q?"":"none";B(fa,"editor"===Q);B(y,"json"===Q);"json"===Q&&J.focus();O=Q}}var K=this,C=localStorage.getItem(f),R={};try{null!=C&&(R=JSON.parse(C))}catch(Q){}var M=R,O="editor",U=!1,T=!1;c=document.createElement("div");c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right="20px";var V=document.createElement("div");V.style.position="absolute";V.style.left="0";V.style.right="0";V.style.top="0";V.style.height=
"28px";V.style.display="flex";V.style.alignItems="end";V.style.borderBottom="1px solid #d0d0d0";var fa=v(mxResources.get("editor"),!0),y=v(mxResources.get("formatJson"),!1);V.appendChild(fa);V.appendChild(y);c.appendChild(V);var d=document.createElement("div");d.style.position="absolute";d.style.left="0";d.style.right="0";d.style.top="30px";d.style.bottom="50px";V={};try{var p=K.editor.graph;null!=p.currentVertexStyle&&(V.currentVertexStyle=p.currentVertexStyle);null!=p.currentEdgeStyle&&(V.currentEdgeStyle=
-p.currentEdgeStyle)}catch(Q){}var A=DrawioConfigEditor.install(d,{initialConfig:R,editorContext:V,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:K.isHighContrast(),onConfigChanged:function(Q){M=Q;U=!0}}),G=document.createElement("div");G.style.position="absolute";G.style.left="0";G.style.right="0";G.style.top="30px";G.style.bottom="50px";G.style.display="none";var I=document.createElement("textarea");I.setAttribute("wrap","off");I.setAttribute("spellcheck","false");I.setAttribute("autocorrect",
-"off");I.setAttribute("autocomplete","off");I.setAttribute("autocapitalize","off");I.style.resize="none";I.style.outline="none";I.style.boxSizing="border-box";I.style.width="100%";I.style.height="100%";try{I.value=null!=C?JSON.stringify(JSON.parse(C),null,2):""}catch(Q){I.value=C||""}mxEvent.addListener(I,"input",function(){U=!0});G.appendChild(I);c.appendChild(d);c.appendChild(G);mxEvent.addListener(fa,"click",function(){E("editor")});mxEvent.addListener(y,"click",function(){E("json")});var L=document.createElement("div");
-L.style.position="absolute";L.style.left="0";L.style.right="0";L.style.bottom="0";L.style.height="46px";L.style.display="flex";L.style.whiteSpace="nowrap";L.style.alignItems="center";L.style.justifyContent="end";L.style.paddingTop="10px";L.style.paddingBottom="10px";L.style.boxSizing="border-box";null==n||K.isOffline()||L.appendChild(K.createHelpIcon(n));if(null!=l)for(n=0;n<l.length;n++)(function(Q,ba,X){Q=mxUtils.button(Q,function(Y){"json"!==O&&null!=M&&(I.value=JSON.stringify(M,null,2));ba(Y,
-I)});null!=X&&Q.setAttribute("title",X);Q.className="geBtn";L.appendChild(Q)})(l[n][0],l[n][1],l[n][2]);n=mxUtils.button(mxResources.get("close"),function(){r(t)});n.setAttribute("title","Escape");n.className="geBtn";var P=mxUtils.button(mxResources.get("apply"),function(){if(U){if("json"!==O){var Q=A.getInvalidFields();if(0<Q.length){K.handleError({message:mxResources.get("invalidInput")+": "+Q.join(", ")});return}Q=null!=M&&0<Object.keys(M).length?JSON.stringify(M,null,2):""}else Q=I.value;try{if(Q==
-C)U=!1,t();else{if(0<Q.length){var ba=JSON.parse(Q);localStorage.setItem(f,JSON.stringify(ba))}else localStorage.removeItem(f);U=!1;t();K.alert(mxResources.get("restartForChangeRequired"))}}catch(X){K.handleError(X)}}else t()});P.className="geBtn gePrimaryBtn";K.editor.cancelFirst?(L.appendChild(n),L.appendChild(P)):(L.appendChild(P),L.appendChild(n));c.appendChild(L);mxEvent.addListener(c,"keydown",function(Q){13===Q.keyCode&&mxEvent.isControlDown(Q)&&P.click()});K.showDialog(c,800,600,!0,!1,function(Q,
-ba){if(!T&&U)return r(t),!1},null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,400));I.scrollTop=0};EditorUi.prototype.showLanguageDialog=function(){function c(){var E=mxLanguage;null==urlParams.lang&&isLocalStorage&&(E=mxSettings.settings.language);for(var K=!1===navigator.onLine,C=Object.create(null),R=0;R<r.length;R++){var M=r[R];C[M.code]=M.box.checked;M.box.disabled="en"==M.code||M.code==E&&M.box.checked||K&&!M.box.checked;M.box.style.cursor=M.box.disabled?"":"pointer";M.row.style.cursor=
+p.currentEdgeStyle)}catch(Q){}var A=DrawioConfigEditor.install(d,{initialConfig:R,editorContext:V,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:K.isHighContrast(),onConfigChanged:function(Q){M=Q;U=!0}}),G=document.createElement("div");G.style.position="absolute";G.style.left="0";G.style.right="0";G.style.top="30px";G.style.bottom="50px";G.style.display="none";var J=document.createElement("textarea");J.setAttribute("wrap","off");J.setAttribute("spellcheck","false");J.setAttribute("autocorrect",
+"off");J.setAttribute("autocomplete","off");J.setAttribute("autocapitalize","off");J.style.resize="none";J.style.outline="none";J.style.boxSizing="border-box";J.style.width="100%";J.style.height="100%";try{J.value=null!=C?JSON.stringify(JSON.parse(C),null,2):""}catch(Q){J.value=C||""}mxEvent.addListener(J,"input",function(){U=!0});G.appendChild(J);c.appendChild(d);c.appendChild(G);mxEvent.addListener(fa,"click",function(){E("editor")});mxEvent.addListener(y,"click",function(){E("json")});var L=document.createElement("div");
+L.style.position="absolute";L.style.left="0";L.style.right="0";L.style.bottom="0";L.style.height="46px";L.style.display="flex";L.style.whiteSpace="nowrap";L.style.alignItems="center";L.style.justifyContent="end";L.style.paddingTop="10px";L.style.paddingBottom="10px";L.style.boxSizing="border-box";null==n||K.isOffline()||L.appendChild(K.createHelpIcon(n));if(null!=l)for(n=0;n<l.length;n++)(function(Q,ba,W){Q=mxUtils.button(Q,function(Y){"json"!==O&&null!=M&&(J.value=JSON.stringify(M,null,2));ba(Y,
+J)});null!=W&&Q.setAttribute("title",W);Q.className="geBtn";L.appendChild(Q)})(l[n][0],l[n][1],l[n][2]);n=mxUtils.button(mxResources.get("close"),function(){r(t)});n.setAttribute("title","Escape");n.className="geBtn";var P=mxUtils.button(mxResources.get("apply"),function(){if(U){if("json"!==O){var Q=A.getInvalidFields();if(0<Q.length){K.handleError({message:mxResources.get("invalidInput")+": "+Q.join(", ")});return}Q=null!=M&&0<Object.keys(M).length?JSON.stringify(M,null,2):""}else Q=J.value;try{if(Q==
+C)U=!1,t();else{if(0<Q.length){var ba=JSON.parse(Q);localStorage.setItem(f,JSON.stringify(ba))}else localStorage.removeItem(f);U=!1;t();K.alert(mxResources.get("restartForChangeRequired"))}}catch(W){K.handleError(W)}}else t()});P.className="geBtn gePrimaryBtn";K.editor.cancelFirst?(L.appendChild(n),L.appendChild(P)):(L.appendChild(P),L.appendChild(n));c.appendChild(L);mxEvent.addListener(c,"keydown",function(Q){13===Q.keyCode&&mxEvent.isControlDown(Q)&&P.click()});K.showDialog(c,800,600,!0,!1,function(Q,
+ba){if(!T&&U)return r(t),!1},null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,400));J.scrollTop=0};EditorUi.prototype.showLanguageDialog=function(){function c(){var E=mxLanguage;null==urlParams.lang&&isLocalStorage&&(E=mxSettings.settings.language);for(var K=!1===navigator.onLine,C=Object.create(null),R=0;R<r.length;R++){var M=r[R];C[M.code]=M.box.checked;M.box.disabled="en"==M.code||M.code==E&&M.box.checked||K&&!M.box.checked;M.box.style.cursor=M.box.disabled?"":"pointer";M.row.style.cursor=
M.box.disabled?"default":"pointer";K&&!M.box.checked?M.row.setAttribute("title",mxResources.get("notInOffline")):M.row.removeAttribute("title")}}var f=this,l=document.createElement("div");l.style.position="absolute";l.style.top="10px";l.style.bottom="10px";l.style.left="16px";l.style.right="16px";var n=document.createElement("div");n.style.position="absolute";n.style.left="0";n.style.right="0";n.style.top="0";n.style.bottom="46px";n.style.overflow="auto";l.appendChild(n);var r=[];f.getOfflineLanguages(function(E){for(var K=
Object.create(null),C=0;C<E.length;C++)K[E[C]]=!0;E=[];for(var R in mxLanguageMap)"i18n"!=R&&""!=mxLanguageMap[R]&&E.push({code:R,name:mxLanguageMap[R]});E.sort(function(O,U){return O.name.localeCompare(U.name)});C=document.createElement("div");C.style.padding="8px 4px 0 4px";C.style.color="#888";mxUtils.write(C,mxResources.get("offlineLanguages",null,"Languages available offline"));n.appendChild(C);var M=document.createElement("div");M.style.display="grid";M.style.gridTemplateColumns="repeat(auto-fill, minmax(170px, 1fr))";
M.style.gap="2px 16px";M.style.padding="8px 4px";M.style.cursor="pointer";for(C=0;C<E.length;C++)(function(O,U){var T=document.createElement("label");T.style.display="flex";T.style.alignItems="center";T.style.padding="4px";T.style.overflow="hidden";T.style.whiteSpace="nowrap";var V=document.createElement("span");V.style.display="inline-flex";V.style.alignItems="center";V.style.justifyContent="center";V.style.position="relative";V.style.width="16px";V.style.height="16px";V.style.margin="0 8px 0 0";
@@ -14312,15 +14322,15 @@ EditorUi.prototype.exportFile=function(c,f,l,n,r,t){};EditorUi.prototype.getServ
c.ownerDocument;l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"style"):f.createElement("style");l.appendChild(f.createTextNode(".geSvgPopup { display: inline-block; box-sizing: border-box; max-width: 100%; max-height: 100%; overflow: auto; background-color: #ffffff; border: 1px solid #c0c0c0; border-radius: 4px; box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.25); padding: 8px; color: #000000; font-family: Helvetica, Arial, sans-serif; font-size: 12px; word-break: break-word; } @media (prefers-color-scheme: dark) { .geSvgPopup { background-color: #2a252f; border-color: #505050; color: #ffffff; } } @media print { [data-icon], .geSvgPopup { display: none; } }"));
c.appendChild(l);l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"script"):f.createElement("script");l.setAttribute("type","text/javascript");var n='(function() {\nvar svg = document.documentElement;\nvar fo = null, active = null, pinned = false, thread = null;\nfunction hide() {\nif (fo != null && fo.parentNode != null) { fo.parentNode.removeChild(fo); }\nfo = null; active = null; pinned = false;\n}\nfunction cancel() {\nif (thread != null) { window.clearTimeout(thread); thread = null; }\n}\nfunction schedule() {\ncancel();\nif (!pinned) { thread = window.setTimeout(hide, 300); }\n}\nfunction show(icon) {\ncancel();\nif (active == icon) { return; }\nhide();\nvar content = icon.getAttribute("data-icon-content");\nif (content == null || content == "") { return; }\nvar x = parseFloat(icon.getAttribute("x"));\nvar y = parseFloat(icon.getAttribute("y"));\nvar w = parseFloat(icon.getAttribute("width"));\nif (isNaN(x) || isNaN(y)) {\ntry { var bb = icon.getBBox(); x = bb.x; y = bb.y; w = bb.width; }\ncatch (e) { x = 0; y = 0; }\n}\nif (isNaN(w) || w <= 0) { w = 16; }\nvar vb = (svg.viewBox != null && svg.viewBox.baseVal != null &&\nsvg.viewBox.baseVal.width > 0) ? svg.viewBox.baseVal : null;\nvar maxW = (vb != null) ? vb.width : (svg.clientWidth || 800);\nvar maxH = (vb != null) ? vb.height : (svg.clientHeight || 600);\nvar pw = Math.max(60, Math.min(320, maxW - 4));\nvar ph = Math.max(40, Math.min(220, maxH - 4));\nfo = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");\nfo.setAttribute("width", pw);\nfo.setAttribute("height", ph);\nvar div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");\ndiv.setAttribute("class", "geSvgPopup");\ndiv.innerHTML = content;\ndiv.addEventListener("mouseenter", cancel);\ndiv.addEventListener("mouseleave", schedule);\nfo.appendChild(div);\nsvg.appendChild(fo);\nvar mw = div.offsetWidth;\nvar mh = div.offsetHeight;\nif (mw > 0) { pw = Math.min(pw, mw + 2); }\nif (mh > 0) { ph = Math.min(ph, mh + 2); }\nvar px = x + w + 4;\nvar py = y;\nif (vb != null) {\npx = Math.max(vb.x, Math.min(px, vb.x + vb.width - pw - 2));\npy = Math.max(vb.y, Math.min(py, vb.y + vb.height - ph - 2));\n}\nfo.setAttribute("x", px);\nfo.setAttribute("y", py);\nfo.setAttribute("width", pw);\nfo.setAttribute("height", ph);\nactive = icon;\n}\nvar icons = document.querySelectorAll("g[data-icon][data-icon-content]");\nfor (var i = 0; i < icons.length; i++) {\n(function(icon) {\nicon.addEventListener("click", function(evt) {\nif (active == icon) { hide(); }\nelse { show(icon); pinned = true; }\nevt.preventDefault();\nevt.stopPropagation();\n});\nicon.addEventListener("mouseenter", function() {\nif (pinned) { cancel(); }\nelse { show(icon); }\n});\nicon.addEventListener("mouseleave", schedule);\n})(icons[i]);\n}\ndocument.addEventListener("mousedown", function(evt) {\nif (fo != null && (active == null || !active.contains(evt.target)) &&\n!fo.contains(evt.target)) { hide(); }\n});\ndocument.addEventListener("keydown", function(evt) {\nif (evt.keyCode == 27) { hide(); }\n});\n})();'.replace(/\n/g,
" ");l.appendChild(f.createCDATASection(n));c.appendChild(l)}};EditorUi.prototype.exportSvg=function(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T,V){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(Y){Editor.addRetryToError(Y,mxUtils.bind(this,function(){this.exportSvg(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T,V)}));this.handleError(Y)})))try{var fa=this.editor.graph.isSelectionEmpty();l=null!=l?l:fa;var y=f?null:this.editor.graph.background;y==mxConstants.NONE&&(y=null);null==
-y&&0==f&&(y=this.editor.graph.shapeBackgroundColor);var d=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var p=mxUtils.lightDarkColorSupported,A=mxUtils.preferDarkColor;if("light"==C||"dark"==C)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==C;V&&(v=Math.max(null!=v?v:0,Math.ceil(16*c)));var G=this.editor.graph.createSvgImageExport(r,U,V,"self"==K?"_top":"_blank"),I=Object.create(null),L=this.getSvgWithFontLookup(I,
+y&&0==f&&(y=this.editor.graph.shapeBackgroundColor);var d=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var p=mxUtils.lightDarkColorSupported,A=mxUtils.preferDarkColor;if("light"==C||"dark"==C)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==C;V&&(v=Math.max(null!=v?v:0,Math.ceil(16*c)));var G=this.editor.graph.createSvgImageExport(r,U,V,"self"==K?"_top":"_blank"),J=Object.create(null),L=this.getSvgWithFontLookup(J,
G,mxUtils.bind(this,function(){return this.editor.graph.getSvg(y,c,v,B,null,l,null,G,"blank"==K?"_blank":"self"==K?"_top":null,null,null,C,R,null,null,null,T)}));mxUtils.lightDarkColorSupported=p;mxUtils.preferDarkColor=A;this.editor.graph.addForeignObjectWarning=d;n&&this.editor.graph.addSvgShadow(L);V&&this.addSvgIconHandlers(L);var P=this.getBaseFilename()+(r?".drawio":"")+".svg";O=null!=O?O:mxUtils.bind(this,function(Y){this.isLocalFileSave()||Y.length<=MAX_REQUEST_SIZE?this.saveData(P,"svg",
Y,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Y)}))});var Q=mxUtils.bind(this,function(Y){this.spinner.stop();r&&Y.setAttribute("content",this.getFileData(!0,null,null,null,l,E,null,null,null,null,null,c,v));O(Graph.xmlDeclaration+"\n"+(r?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(Y))});this.editor.graph.mathEnabled&&this.editor.addMathCss(L);var ba=mxUtils.bind(this,function(Y){Editor.replaceSvgDataUris&&
-t&&EditorUi.embedSvgImages(Y);Editor.foreignObjectImages&&M?this.replaceAlternateContent(Y,C,Q):Q(Y)}),X=mxUtils.bind(this,function(Y){t&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(Y,ba,this.thumbImageCache)):ba(Y)});this.embedFonts(L,X,M?!0:!1,I)}catch(Y){this.handleError(Y)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function n(R,M,O,U,T){var V=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,
+t&&EditorUi.embedSvgImages(Y);Editor.foreignObjectImages&&M?this.replaceAlternateContent(Y,C,Q):Q(Y)}),W=mxUtils.bind(this,function(Y){t&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(Y,ba,this.thumbImageCache)):ba(Y)});this.embedFonts(L,W,M?!0:!1,J)}catch(Y){this.handleError(Y)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function n(R,M,O,U,T){var V=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,
"image");V.setAttribute("x",M);V.setAttribute("y",O+.5);V.setAttribute("width",U.width);V.setAttribute("height",U.height);null==V.setAttributeNS?V.setAttribute("xlink:href",T):V.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",T);R.replaceChild(V,R.lastChild);B()}function r(){if(v<C.length)C[v++](r)}var t="";f=c.getElementsByTagName("style");for(var v=0;v<f.length;v++)t+=f[v].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var B=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),
E={},K={},C=[];for(v=0;v<f.length;v++)mxUtils.bind(this,function(R){var M=R.getElementsByTagName("div");if(0<M.length)try{var O=M[0].cloneNode(!0),U=parseInt(O.style.marginLeft),T=parseInt(O.style.paddingTop),V=O.getElementsByTagName("div")[1],fa=M=!1,y=O.style.alignItems,d=O.style.justifyContent;if(null!=O.style.writingMode){var p=O.style.writingMode;fa="vertical-"==p.substring(0,9);M="-rl"==p.substring(p.length-3)}var A=!fa&&"1px"==O.style.width||fa&&"1px"==O.style.height;if(!fa&&"1px"==O.style.height||
-fa&&"1px"==O.style.width)O.style.alignItems=fa&&M?"unsafe flex-end":"unsafe flex-start";A&&(O.style.justifyContent="unsafe flex-start");O.style.paddingTop="";O.style.marginLeft="";var G=O.outerHTML,I=E[G];null==I&&(O.style.position="absolute",O.style.visibility="hidden",document.body.appendChild(O),p=1,p="1px"==O.style.width?V.offsetWidth:parseInt(O.style.width),A=1,A="1px"==O.style.height?V.offsetHeight:parseInt(O.style.height),document.body.removeChild(O),I=new mxRectangle(U,T,p,A),E[G]=I);"1px"==
-O.style.height&&("unsafe center"==y?T-=I.height/2:"unsafe flex-end"==y&&(T-=I.height));if("1px"==O.style.width)if(!fa&&"unsafe center"==d||fa&&"unsafe center"==y)U-=I.width/2;else if(!fa&&"unsafe flex-end"==d||fa&&(!M&&"unsafe flex-end"==y||M&&"unsafe flex-start"==y))U-=I.width;I=new mxRectangle(U,T,I.width,I.height+parseInt(V.style.fontSize)/4);C.push(mxUtils.bind(this,function(L){var P=K[G];null==P?Graph.htmlToPng(G,I.width,I.height,mxUtils.bind(this,function(Q){n(R,U,T,I,Q);K[G]=Q;L()}),t):(n(R,
-U,T,I,P),L())}))}catch(L){B()}else B()})(f[v]);0==counter&&l(c);v=0;r()};EditorUi.prototype.addRadiobox=function(c,f,l,n,r,t,v){return this.addCheckbox(c,l,n,r,t,v,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,n,r,t,v,B,E){t=null!=t?t:!0;var K=document.createElement("input");K.style.marginRight="8px";K.setAttribute("type",v?"radio":"checkbox");v="geCheckbox-"+Editor.guid();K.id=v;null!=B&&K.setAttribute("name",B);l&&(K.setAttribute("checked","checked"),K.defaultChecked=!0);n&&K.setAttribute("disabled",
+fa&&"1px"==O.style.width)O.style.alignItems=fa&&M?"unsafe flex-end":"unsafe flex-start";A&&(O.style.justifyContent="unsafe flex-start");O.style.paddingTop="";O.style.marginLeft="";var G=O.outerHTML,J=E[G];null==J&&(O.style.position="absolute",O.style.visibility="hidden",document.body.appendChild(O),p=1,p="1px"==O.style.width?V.offsetWidth:parseInt(O.style.width),A=1,A="1px"==O.style.height?V.offsetHeight:parseInt(O.style.height),document.body.removeChild(O),J=new mxRectangle(U,T,p,A),E[G]=J);"1px"==
+O.style.height&&("unsafe center"==y?T-=J.height/2:"unsafe flex-end"==y&&(T-=J.height));if("1px"==O.style.width)if(!fa&&"unsafe center"==d||fa&&"unsafe center"==y)U-=J.width/2;else if(!fa&&"unsafe flex-end"==d||fa&&(!M&&"unsafe flex-end"==y||M&&"unsafe flex-start"==y))U-=J.width;J=new mxRectangle(U,T,J.width,J.height+parseInt(V.style.fontSize)/4);C.push(mxUtils.bind(this,function(L){var P=K[G];null==P?Graph.htmlToPng(G,J.width,J.height,mxUtils.bind(this,function(Q){n(R,U,T,J,Q);K[G]=Q;L()}),t):(n(R,
+U,T,J,P),L())}))}catch(L){B()}else B()})(f[v]);0==counter&&l(c);v=0;r()};EditorUi.prototype.addRadiobox=function(c,f,l,n,r,t,v){return this.addCheckbox(c,l,n,r,t,v,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,n,r,t,v,B,E){t=null!=t?t:!0;var K=document.createElement("input");K.style.marginRight="8px";K.setAttribute("type",v?"radio":"checkbox");v="geCheckbox-"+Editor.guid();K.id=v;null!=B&&K.setAttribute("name",B);l&&(K.setAttribute("checked","checked"),K.defaultChecked=!0);n&&K.setAttribute("disabled",
"disabled");t&&(E?(r=document.createElement("div"),r.className="geDialogCheckRow",r.appendChild(K),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",v),r.appendChild(l),c.appendChild(r),K.checkRow=r):(K.style.marginTop="16px",c.appendChild(K),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",v),c.appendChild(l),r||mxUtils.br(c)));return K};EditorUi.prototype.addAdvancedSection=function(c,f){var l=document.createElement("div");l.className="geCollapsibleTitle";
mxUtils.write(l,mxResources.get(f||"advanced"));var n=document.createElement("div");n.className="geCollapsibleContent geCollapsed";f=document.createElement("div");f.className="geDialogSection";n.appendChild(f);var r=function(t){if(t!==l.classList.contains("geExpanded")&&(l.classList.toggle("geExpanded"),n.classList.toggle("geCollapsed"),t=l.closest(".geDialog"),null!=t)){var v=t.firstElementChild;null!=v&&(t.style.height="",t.style.height=v.scrollHeight+48+"px")}};mxEvent.addListener(l,"click",function(){r(!l.classList.contains("geExpanded"))});
c.appendChild(l);c.appendChild(n);return{content:f,wrapper:n,expand:function(){r(!0)},collapse:function(){r(!1)},isExpanded:function(){return l.classList.contains("geExpanded")}}};EditorUi.prototype.addEditButton=function(c,f){var l=document.createElement("div");l.className="geDialogCheckRow";var n=document.createElement("span");n.className="geDialogFormLabel";n.style.display="flex";n.style.alignItems="center";var r=this.addCheckbox(n,mxResources.get("edit")+":",!0,null,!0);r.style.marginTop="0px";
@@ -14343,20 +14353,20 @@ t.style.marginBottom="8px";var E=document.createElement("a");E.style.color="gray
R.setAttribute("type","checkbox");R.setAttribute("checked","checked");R.defaultChecked=!0;R.style.marginRight="8px";E.appendChild(R);var M=document.createElement("label");mxUtils.write(M,mxResources.get("zoom")+":");E.appendChild(M);var O=document.createElement("input");O.setAttribute("type","text");O.style.width="60px";O.style.marginLeft="4px";O.value="100%";E.appendChild(O);t.appendChild(E);var U=this.addCheckbox(t,mxResources.get("fit"),!0,null,null,null,null,null,!0),T=this.addCheckbox(t,mxResources.get("lightbox"),
!0,null,null,null,null,null,!0);r.appendChild(t);t=this.addAdvancedSection(r).content;var V=document.createElement("select");V.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","light");mxUtils.write(E,mxResources.get("light"));V.appendChild(E);E=document.createElement("option");E.setAttribute("value","dark");mxUtils.write(E,mxResources.get("dark"));V.appendChild(E);E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));
E.setAttribute("selected","selected");V.appendChild(E);E=document.createElement("div");E.className="geDialogFormRow";M=document.createElement("span");M.className="geDialogFormLabel";mxUtils.write(M,mxResources.get("appearance")+":");E.appendChild(M);E.appendChild(V);t.appendChild(E);var fa=null;if(EditorUi.enableHtmlEditOption){fa=this.addEditButton(t,T);var y=fa.getEditInput();mxEvent.addListener(T,"change",function(){T.checked?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled");
-y.checked&&T.checked?fa.getEditSelect().removeAttribute("disabled"):fa.getEditSelect().setAttribute("disabled","disabled")})}var d=this.addCheckbox(t,mxResources.get("layers"),!0,null,null,null,null,null,!0),p=this.addCheckbox(t,mxResources.get("tags"),!0,null,null,null,null,null,!0),A=this.addCheckbox(t,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);A.checkRow.style.paddingLeft="24px";var G=this.addCheckbox(t,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),I=this.addCheckbox(t,
-mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(p,"change",function(){p.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")});mxEvent.addListener(T,"change",function(){T.checked?(G.removeAttribute("disabled"),I.removeAttribute("disabled")):(G.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"))});c=new CustomDialog(this,r,mxUtils.bind(this,function(){n("url"==v.value?l:null,R.checked,O.value,K.getTarget(),K.getColor(),
-U.checked,null!=C.row&&"allPages"==C.select.value,d.checked,p.checked,T.checked,null!=fa?fa.getLink():null,null!=V?V.value:null,p.checked&&A.checked,G.checked,I.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);v.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,f,l,n,r,t,v,B,E,K,C,R){var M=document.createElement("div");M.style.whiteSpace="nowrap";var O=document.createElement("h3");mxUtils.write(O,c||mxResources.get("publish"));M.appendChild(O);var U=document.createElement("select");
+y.checked&&T.checked?fa.getEditSelect().removeAttribute("disabled"):fa.getEditSelect().setAttribute("disabled","disabled")})}var d=this.addCheckbox(t,mxResources.get("layers"),!0,null,null,null,null,null,!0),p=this.addCheckbox(t,mxResources.get("tags"),!0,null,null,null,null,null,!0),A=this.addCheckbox(t,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);A.checkRow.style.paddingLeft="24px";var G=this.addCheckbox(t,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),J=this.addCheckbox(t,
+mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(p,"change",function(){p.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")});mxEvent.addListener(T,"change",function(){T.checked?(G.removeAttribute("disabled"),J.removeAttribute("disabled")):(G.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"))});c=new CustomDialog(this,r,mxUtils.bind(this,function(){n("url"==v.value?l:null,R.checked,O.value,K.getTarget(),K.getColor(),
+U.checked,null!=C.row&&"allPages"==C.select.value,d.checked,p.checked,T.checked,null!=fa?fa.getLink():null,null!=V?V.value:null,p.checked&&A.checked,G.checked,J.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);v.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,f,l,n,r,t,v,B,E,K,C,R){var M=document.createElement("div");M.style.whiteSpace="nowrap";var O=document.createElement("h3");mxUtils.write(O,c||mxResources.get("publish"));M.appendChild(O);var U=document.createElement("select");
U.className="geBtn";U.style.margin="0 4px 8px 4px";U.style.width="calc(100% - 8px)";U.style.boxSizing="border-box";r=null!=r?r:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");mxUtils.write(c,mxResources.get("includeCopyOfMyDiagram"));c.setAttribute("value","copy");U.appendChild(c);c=document.createElement("option");mxUtils.write(c,mxResources.get("authorizationRequired"));c.setAttribute("value","auth");U.appendChild(c);null==B||""==B.getHash()||B.getMode()==
App.MODE_DEVICE||B.getMode()==App.MODE_BROWSER?c.setAttribute("disabled","disabled"):U.value="auth";B=document.createElement("option");B.setAttribute("value","public");U.appendChild(B);null!=v?(mxUtils.write(B,mxResources.get("publicDiagramUrl")),B.setAttribute("title",v),U.value="public"):(mxUtils.write(B,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),B.setAttribute("disabled","disabled"));M.appendChild(U);mxUtils.br(M);v=document.createElement("div");v.className=
"geDialogSection";var T=null,V=null;if(null!=f||null!=l)f=document.createElement("div"),f.className="geDialogInlineFields",B=document.createElement("div"),B.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("width")+":"),B.appendChild(c),T=document.createElement("input"),T.setAttribute("type","text"),T.value="100%",B.appendChild(T),f.appendChild(B),B=document.createElement("div"),B.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,
mxResources.get("height")+":"),B.appendChild(c),V=document.createElement("input"),V.setAttribute("type","text"),V.value=l+"px",B.appendChild(V),f.appendChild(B),v.appendChild(f);var fa=this.addLinkSection(v,n),y=K?this.addCheckbox(v,mxResources.get("transparentBackground"),!1,null,null,null,null,null,!0):null,d=this.addPagesRow(v),p=d.select;null==d.row||R||(l=function(){d.row.style.display="copy"==U.value?"":"none"},mxEvent.addListener(U,"change",l),l());var A=null;if(null!=this.pages&&1<this.pages.length){l=
document.createElement("div");l.className="geDialogFormRow";K=document.createElement("span");K.className="geDialogFormLabel";mxUtils.write(K,mxResources.get("initialPage",null,"Initial Page")+":");l.appendChild(K);A=document.createElement("select");A.style.maxWidth="260px";for(K=0;K<this.pages.length;K++)R=document.createElement("option"),mxUtils.write(R,this.pages[K].getName()),R.setAttribute("value",K),this.pages[K]==this.currentPage&&R.setAttribute("selected","selected"),A.appendChild(R);l.appendChild(A);
-v.appendChild(l);l=function(){"none"!=d.row.style.display&&"currentPage"==p.value?A.setAttribute("disabled","disabled"):A.removeAttribute("disabled")};mxEvent.addListener(p,"change",l);mxEvent.addListener(U,"change",l);l()}var G=this.addCheckbox(v,mxResources.get("lightbox"),!0,null,null,!n,null,null,!0);n&&null!=G.checkRow&&(G.checkRow.style.display="none");M.appendChild(v);n=this.addAdvancedSection(M).content;var I=document.createElement("select");I.style.maxWidth="260px";l=document.createElement("option");
-l.setAttribute("value","0");mxUtils.write(l,mxResources.get("light"));I.appendChild(l);l=document.createElement("option");l.setAttribute("value","1");mxUtils.write(l,mxResources.get("dark"));I.appendChild(l);l=document.createElement("option");l.setAttribute("value","auto");mxUtils.write(l,mxResources.get("automatic"));l.setAttribute("selected","selected");I.appendChild(l);C&&(C=document.createElement("div"),C.className="geDialogFormRow",l=document.createElement("span"),l.className="geDialogFormLabel",
-mxUtils.write(l,mxResources.get("appearance")+":"),C.appendChild(l),C.appendChild(I),n.appendChild(C));var L=this.addEditButton(n,G),P=L.getEditInput(),Q=this.addCheckbox(n,mxResources.get("layers"),!0,null,null,null,null,null,!0),ba=this.addCheckbox(n,mxResources.get("tags"),!0,null,null,null,null,null,!0),X=this.addCheckbox(n,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);X.checkRow.style.paddingLeft="24px";var Y=this.addCheckbox(n,mxResources.get("linkIcons"),!1,null,null,
-null,null,null,!0),W=this.addCheckbox(n,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ba,"change",function(){ba.checked?X.removeAttribute("disabled"):X.setAttribute("disabled","disabled")});mxEvent.addListener(G,"change",function(){G.checked?(Q.removeAttribute("disabled"),P.removeAttribute("disabled"),ba.removeAttribute("disabled"),Y.removeAttribute("disabled"),W.removeAttribute("disabled"),ba.checked&&X.removeAttribute("disabled")):(Q.setAttribute("disabled",
-"disabled"),P.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"),Y.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"));P.checked&&G.checked?L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")});r=new CustomDialog(this,M,mxUtils.bind(this,function(){E(fa.getTarget(),fa.getColor(),null==A||0>=A.selectedIndex||null!=A.getAttribute("disabled")?null:this.pages[A.selectedIndex],
-G.checked,L.getLink(),Q.checked,null!=T?T.value:null,null!=V?V.value:null,ba.checked,U.value,null!=y?y.checked:!1,I.value,"allPages"==p.value,ba.checked&&X.checked,Y.checked,W.checked)}),null,mxResources.get("create"),r,t);this.showDialog(r.container,360,null,!0,!0);null!=T?(T.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?T.select():document.execCommand("selectAll",!1,null)):U.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,n,r){var t=document.createElement("div");
+v.appendChild(l);l=function(){"none"!=d.row.style.display&&"currentPage"==p.value?A.setAttribute("disabled","disabled"):A.removeAttribute("disabled")};mxEvent.addListener(p,"change",l);mxEvent.addListener(U,"change",l);l()}var G=this.addCheckbox(v,mxResources.get("lightbox"),!0,null,null,!n,null,null,!0);n&&null!=G.checkRow&&(G.checkRow.style.display="none");M.appendChild(v);n=this.addAdvancedSection(M).content;var J=document.createElement("select");J.style.maxWidth="260px";l=document.createElement("option");
+l.setAttribute("value","0");mxUtils.write(l,mxResources.get("light"));J.appendChild(l);l=document.createElement("option");l.setAttribute("value","1");mxUtils.write(l,mxResources.get("dark"));J.appendChild(l);l=document.createElement("option");l.setAttribute("value","auto");mxUtils.write(l,mxResources.get("automatic"));l.setAttribute("selected","selected");J.appendChild(l);C&&(C=document.createElement("div"),C.className="geDialogFormRow",l=document.createElement("span"),l.className="geDialogFormLabel",
+mxUtils.write(l,mxResources.get("appearance")+":"),C.appendChild(l),C.appendChild(J),n.appendChild(C));var L=this.addEditButton(n,G),P=L.getEditInput(),Q=this.addCheckbox(n,mxResources.get("layers"),!0,null,null,null,null,null,!0),ba=this.addCheckbox(n,mxResources.get("tags"),!0,null,null,null,null,null,!0),W=this.addCheckbox(n,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);W.checkRow.style.paddingLeft="24px";var Y=this.addCheckbox(n,mxResources.get("linkIcons"),!1,null,null,
+null,null,null,!0),X=this.addCheckbox(n,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ba,"change",function(){ba.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")});mxEvent.addListener(G,"change",function(){G.checked?(Q.removeAttribute("disabled"),P.removeAttribute("disabled"),ba.removeAttribute("disabled"),Y.removeAttribute("disabled"),X.removeAttribute("disabled"),ba.checked&&W.removeAttribute("disabled")):(Q.setAttribute("disabled",
+"disabled"),P.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"),Y.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"));P.checked&&G.checked?L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")});r=new CustomDialog(this,M,mxUtils.bind(this,function(){E(fa.getTarget(),fa.getColor(),null==A||0>=A.selectedIndex||null!=A.getAttribute("disabled")?null:this.pages[A.selectedIndex],
+G.checked,L.getLink(),Q.checked,null!=T?T.value:null,null!=V?V.value:null,ba.checked,U.value,null!=y?y.checked:!1,J.value,"allPages"==p.value,ba.checked&&W.checked,Y.checked,X.checked)}),null,mxResources.get("create"),r,t);this.showDialog(r.container,360,null,!0,!0);null!=T?(T.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?T.select():document.execCommand("selectAll",!1,null)):U.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,n,r){var t=document.createElement("div");
t.style.whiteSpace="nowrap";var v=document.createElement("h3");mxUtils.write(v,mxResources.get("image"));t.appendChild(v);if(r){v=document.createElement("div");v.className="geDialogSection";var B=document.createElement("div");B.className="geDialogFormRow";var E=document.createElement("span");E.className="geDialogFormLabel";mxUtils.write(E,mxResources.get("zoom")+":");B.appendChild(E);var K=document.createElement("input");K.setAttribute("type","text");K.value=this.lastExportZoom||"100%";B.appendChild(K);
v.appendChild(B);B=document.createElement("div");B.className="geDialogFormRow";E=document.createElement("span");E.className="geDialogFormLabel";mxUtils.write(E,mxResources.get("borderWidth")+":");B.appendChild(E);var C=document.createElement("input");C.setAttribute("type","text");C.value=this.lastExportBorder||"0";B.appendChild(C);v.appendChild(B);t.appendChild(v)}v=document.createElement("div");v.className="geDialogSection";var R=this.addCheckbox(v,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&
!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),M=n?null:this.addCheckbox(v,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,null,null,null,null,null,!0);B=this.editor.graph;var O=B.background==mxConstants.NONE||null==B.background,U=n?null:this.addCheckbox(v,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?this.lastExportTransparent:O,null,null,null,null,null,!0);t.appendChild(v);c=new CustomDialog(this,
@@ -14365,11 +14375,11 @@ K();da.value=Math.floor(ca*Ba);N.value=Math.floor(S*Ba)}v=null!=v?v:Editor.defau
var T=document.createElement("input");T.setAttribute("type","text");T.value=this.lastExportZoom||"100%";O.appendChild(T);c.appendChild(O);R.appendChild(c);c=document.createElement("div");c.className="geDialogSection";var V=this.addCheckbox(c,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!M.isSelectionEmpty(),M.isSelectionEmpty(),null,null,null,null,!0),fa=document.createElement("input");fa.setAttribute("disabled","disabled");fa.setAttribute("type","checkbox");var y=document.createElement("select");
y.style.marginLeft="8px";var d=["selectionOnly","diagram","page"];O={};for(U=0;U<d.length;U++)if(!M.isSelectionEmpty()||"selectionOnly"!=d[U]){var p=document.createElement("option");mxUtils.write(p,mxResources.get(d[U]));p.setAttribute("value",d[U]);y.appendChild(p);O[d[U]]=p}E?(U=document.createElement("div"),U.className="geDialogFormRow",t=document.createElement("span"),t.className="geDialogFormLabel",mxUtils.write(t,mxResources.get("size")+":"),U.appendChild(t),y.style.marginLeft="0",U.appendChild(y),
c.appendChild(U),mxEvent.addListener(y,"change",function(){"selectionOnly"==y.value&&(V.checked=!0)})):t&&(t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(fa),U=document.createElement("label"),mxUtils.write(U,mxResources.get("crop")),t.appendChild(U),c.appendChild(t),mxEvent.addListener(V,"change",function(){V.checked?fa.removeAttribute("disabled"):fa.setAttribute("disabled","disabled")}));M.isSelectionEmpty()?E&&null!=V.checkRow&&null!=V.checkRow.parentNode&&V.checkRow.parentNode.removeChild(V.checkRow):
-(y.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",fa.setAttribute("checked","checked"),fa.defaultChecked=!0,mxEvent.addListener(V,"change",function(){y.value=V.checked?"selectionOnly":"diagram"}));var A=!M.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";E&&null!=this.lastExportType&&null!=O[this.lastExportType]&&(y.value=this.lastExportType,"selectionOnly"==this.lastExportType&&(V.checked=!0));var G="jpeg"!=B&&"webp"!=B,I=this.addCheckbox(c,mxResources.get("transparentBackground"),
+(y.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",fa.setAttribute("checked","checked"),fa.defaultChecked=!0,mxEvent.addListener(V,"change",function(){y.value=V.checked?"selectionOnly":"diagram"}));var A=!M.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";E&&null!=this.lastExportType&&null!=O[this.lastExportType]&&(y.value=this.lastExportType,"selectionOnly"==this.lastExportType&&(V.checked=!0));var G="jpeg"!=B&&"webp"!=B,J=this.addCheckbox(c,mxResources.get("transparentBackground"),
G&&null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,G,null,null,!0);R.appendChild(c);c=document.createElement("div");c.className="geDialogSection";O=!1;t=null!=this.pages?this.pages.length:1;var L=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<t?":":""),v,null,null,"jpeg"!=B&&"webp"!=B,null,null,!0);"jpeg"!=B&&"webp"!=B&&(O=!0);var P=document.createElement("select");P.style.maxWidth="260px";if("png"==B||"svg"==B)v=function(){L.checked?P.removeAttribute("disabled"):
P.setAttribute("disabled","disabled")},U=document.createElement("option"),U.setAttribute("value","allPages"),mxUtils.write(U,mxResources.get("allPages")),P.appendChild(U),U=document.createElement("option"),U.setAttribute("value","currentPage"),mxUtils.write(U,mxResources.get("currentPage")),P.appendChild(U),1<t&&(t=document.createElement("div"),t.style.paddingLeft="24px",t.appendChild(P),c.appendChild(t)),null!=this.lastEmbedInclude&&(P.value=this.lastEmbedInclude),mxEvent.addListener(L,"change",
-v),v();var Q=document.createElement("input");Q.setAttribute("type","checkbox");Q.id="geCheckbox-"+Editor.guid();var ba=document.createElement("input");ba.setAttribute("type","checkbox");ba.id="geCheckbox-"+Editor.guid();var X=document.createElement("input");X.setAttribute("type","checkbox");X.id="geCheckbox-"+Editor.guid();var Y=document.createElement("input");Y.setAttribute("type","checkbox");Y.id="geCheckbox-"+Editor.guid();var W=document.createElement("select");W.style.maxWidth="260px";v=document.createElement("option");
-v.setAttribute("value","auto");mxUtils.write(v,mxResources.get("automatic"));W.appendChild(v);v=document.createElement("option");v.setAttribute("value","blank");mxUtils.write(v,mxResources.get("openInNewWindow"));W.appendChild(v);v=document.createElement("option");v.setAttribute("value","self");mxUtils.write(v,mxResources.get("openInThisWindow"));W.appendChild(v);"svg"==B&&null!=this.lastExportLinkTarget&&(W.value=this.lastExportLinkTarget,0>W.selectedIndex&&(W.value="auto"));t=document.createElement("div");
+v),v();var Q=document.createElement("input");Q.setAttribute("type","checkbox");Q.id="geCheckbox-"+Editor.guid();var ba=document.createElement("input");ba.setAttribute("type","checkbox");ba.id="geCheckbox-"+Editor.guid();var W=document.createElement("input");W.setAttribute("type","checkbox");W.id="geCheckbox-"+Editor.guid();var Y=document.createElement("input");Y.setAttribute("type","checkbox");Y.id="geCheckbox-"+Editor.guid();var X=document.createElement("select");X.style.maxWidth="260px";v=document.createElement("option");
+v.setAttribute("value","auto");mxUtils.write(v,mxResources.get("automatic"));X.appendChild(v);v=document.createElement("option");v.setAttribute("value","blank");mxUtils.write(v,mxResources.get("openInNewWindow"));X.appendChild(v);v=document.createElement("option");v.setAttribute("value","self");mxUtils.write(v,mxResources.get("openInThisWindow"));X.appendChild(v);"svg"==B&&null!=this.lastExportLinkTarget&&(X.value=this.lastExportLinkTarget,0>X.selectedIndex&&(X.value="auto"));t=document.createElement("div");
mxUtils.write(t,mxResources.get("LinksLost"));t.style.margin="7px";t.style.display="none";O&&R.appendChild(c);v=this.addAdvancedSection(R).content;c=M.getGraphBounds();O=M.view.scale;var ca=Math.max(1,Math.ceil(c.width/O)),S=Math.max(1,Math.ceil(c.height/O)),Z=!1;U=document.createElement("div");U.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";O=document.createElement("label");mxUtils.write(O,mxResources.get("width")+":");c.appendChild(O);var da=
document.createElement("input");da.setAttribute("type","number");da.value=Math.floor(ca*K());c.appendChild(da);U.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";O=document.createElement("label");mxUtils.write(O,mxResources.get("height")+":");c.appendChild(O);var N=document.createElement("input");N.setAttribute("type","number");N.value=Math.floor(S*K());c.appendChild(N);U.appendChild(c);v.appendChild(U);mxEvent.addListener(T,"change",function(){Z=!0;T.value=parseFloat((100*
K()).toFixed(2))+"%";C()});mxEvent.addListener(da,"change",function(){var Ba=parseInt(da.value)/ca;0<Ba&&(T.value=parseFloat((100*Ba).toFixed(2))+"%",N.value=Math.floor(S*Ba))});mxEvent.addListener(N,"change",function(){var Ba=parseInt(N.value)/S;0<Ba&&(T.value=parseFloat((100*Ba).toFixed(2))+"%",da.value=Math.floor(ca*Ba))});var aa=document.createElement("select"),ea=document.createElement("input");if("png"==B){c=["100","200","300","400"];for(U=0;U<c.length;U++)O=document.createElement("option"),
@@ -14377,13 +14387,13 @@ O.setAttribute("value",c[U]),mxUtils.write(O,c[U]+"dpi"),aa.appendChild(O);c=doc
":");c.appendChild(O);c.appendChild(aa);c.appendChild(ea);v.appendChild(c);null!=this.lastExportDpi&&(ea.value=this.lastExportDpi,aa.value=this.lastExportDpi,0>aa.selectedIndex&&(aa.value="custom",aa.style.display="none",ea.style.display=""));mxEvent.addListener(aa,"change",function(){"custom"==aa.value?(aa.style.display="none",ea.style.display="",ea.focus()):(ea.value=aa.value,Z||(T.value=aa.value+"%",C()))});mxEvent.addListener(ea,"change",function(){var Ba=parseInt(ea.value);isNaN(Ba)||0>=Ba?ea.style.backgroundColor=
"red":(ea.style.backgroundColor="",Z||(T.value=Ba+"%",C()))})}c=document.createElement("div");c.className="geDialogFormRow";O=document.createElement("span");O.className="geDialogFormLabel";mxUtils.write(O,mxResources.get("borderWidth")+":");c.appendChild(O);var ka=document.createElement("input");ka.setAttribute("type","text");ka.value=this.lastExportBorder||"0";c.appendChild(ka);v.appendChild(c);var ra=document.createElement("select");ra.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value",
"light");mxUtils.write(c,mxResources.get("light"));ra.appendChild(c);c=document.createElement("option");c.setAttribute("value","dark");mxUtils.write(c,mxResources.get("dark"));ra.appendChild(c);var sa=Editor.isDarkMode()?"dark":"light";"svg"==B&&mxUtils.lightDarkColorSupported&&(c=document.createElement("option"),c.setAttribute("value","auto"),mxUtils.write(c,mxResources.get("automatic")),ra.appendChild(c),sa="auto");ra.value=null!=this.lastExportTheme?this.lastExportTheme:sa;0>ra.selectedIndex&&
-(ra.value=sa);c=document.createElement("div");c.className="geDialogFormRow";O=document.createElement("span");O.className="geDialogFormLabel";mxUtils.write(O,mxResources.get("appearance")+":");c.appendChild(O);c.appendChild(ra);v.appendChild(c);"svg"==B&&(c=document.createElement("div"),c.className="geDialogFormRow",O=document.createElement("span"),O.className="geDialogFormLabel",mxUtils.write(O,mxResources.get("links")+":"),c.appendChild(O),c.appendChild(W),v.appendChild(c),v.appendChild(t));var ma=
+(ra.value=sa);c=document.createElement("div");c.className="geDialogFormRow";O=document.createElement("span");O.className="geDialogFormLabel";mxUtils.write(O,mxResources.get("appearance")+":");c.appendChild(O);c.appendChild(ra);v.appendChild(c);"svg"==B&&(c=document.createElement("div"),c.className="geDialogFormRow",O=document.createElement("span"),O.className="geDialogFormLabel",mxUtils.write(O,mxResources.get("links")+":"),c.appendChild(O),c.appendChild(X),v.appendChild(c),v.appendChild(t));var ma=
1==M.shadowVisible,wa=this.addCheckbox(v,mxResources.get("shadow"),null!=this.lastExportShadow?this.lastExportShadow:ma,null,null,null,null,null,!0),va=null,za="svg"!=B&&(this.isOffline()||!Editor.canvasSupported);if("png"==B||"jpeg"==B||"webp"==B||"svg"==B)va=this.addCheckbox(v,mxResources.get("grid"),za||null==this.lastExportGrid?!1:this.lastExportGrid,za,!1,!0,null,null,!0);f&&(Q.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,t=document.createElement("div"),t.className="geDialogCheckRow",
-t.appendChild(Q),M=document.createElement("label"),mxUtils.write(M,mxResources.get("embedImages")),M.setAttribute("for",Q.id),t.appendChild(M),v.appendChild(t),ba.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(ba),M=document.createElement("label"),mxUtils.write(M,mxResources.get("embedFonts")),M.setAttribute("for",ba.id),t.appendChild(M),v.appendChild(t),X.checked=null!=this.lastEmbedCellMetadata?
-this.lastEmbedCellMetadata:!1,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(X),M=document.createElement("label"),mxUtils.write(M,mxResources.get("embedCellMetadata")),M.setAttribute("for",X.id),t.appendChild(M),v.appendChild(t),Y.checked=null!=this.lastEmbedIcons?this.lastEmbedIcons:!1,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(Y),M=document.createElement("label"),mxUtils.write(M,mxResources.get("icons")),M.setAttribute("for",Y.id),
-t.appendChild(M),v.appendChild(t));l=new CustomDialog(this,R,mxUtils.bind(this,function(){this.lastExportSelectionOnly=V.checked;this.lastExportBorder=ka.value;this.lastExportZoom=T.value;G&&(this.lastExportTransparent=0==I.checked?null:I.checked);this.lastExportTheme=ra.value==sa?null:ra.value;this.lastExportShadow=wa.checked==ma?null:wa.checked;null==va||za||(this.lastExportGrid=va.checked?!0:null);"svg"==B&&(this.lastExportLinkTarget="auto"==W.value?null:W.value);if("png"==B){var Ba=parseInt(ea.value);
-this.lastExportDpi=!isNaN(Ba)&&0<Ba&&100!=Ba?Ba:null}E&&(this.lastExportType=y.value==A?null:y.value);f&&(this.lastEmbedImages=Q.checked,this.lastEmbedFonts=ba.checked,this.lastEmbedCellMetadata=X.checked,this.lastEmbedIcons=Y.checked);if("png"==B||"svg"==B)this.lastEmbedInclude=P.value;null!=r&&r(T.value,I.checked,!V.checked,wa.checked,L.checked,Q.checked&&f,ka.value,fa.checked,("png"==B||"svg"==B)&&"currentPage"==P.value,W.value,null!=va?va.checked:null,null!=ra?ra.value:null,y.value,ba.checked,
-X.checked&&f,"png"==B&&0<parseInt(ea.value)&&100!=parseInt(ea.value)?parseInt(ea.value):null,Y.checked&&f)}),null,l,n);this.showDialog(l.container,360,null,!0,!0,null,null,null,null,!0);T.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?T.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,n,r,t,v){var B=document.createElement("div"),E=this.editor.graph;if(null!=f){var K=document.createElement("h3");mxUtils.write(K,f);B.appendChild(K)}f=
+t.appendChild(Q),M=document.createElement("label"),mxUtils.write(M,mxResources.get("embedImages")),M.setAttribute("for",Q.id),t.appendChild(M),v.appendChild(t),ba.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(ba),M=document.createElement("label"),mxUtils.write(M,mxResources.get("embedFonts")),M.setAttribute("for",ba.id),t.appendChild(M),v.appendChild(t),W.checked=null!=this.lastEmbedCellMetadata?
+this.lastEmbedCellMetadata:!1,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(W),M=document.createElement("label"),mxUtils.write(M,mxResources.get("embedCellMetadata")),M.setAttribute("for",W.id),t.appendChild(M),v.appendChild(t),Y.checked=null!=this.lastEmbedIcons?this.lastEmbedIcons:!1,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(Y),M=document.createElement("label"),mxUtils.write(M,mxResources.get("icons")),M.setAttribute("for",Y.id),
+t.appendChild(M),v.appendChild(t));l=new CustomDialog(this,R,mxUtils.bind(this,function(){this.lastExportSelectionOnly=V.checked;this.lastExportBorder=ka.value;this.lastExportZoom=T.value;G&&(this.lastExportTransparent=0==J.checked?null:J.checked);this.lastExportTheme=ra.value==sa?null:ra.value;this.lastExportShadow=wa.checked==ma?null:wa.checked;null==va||za||(this.lastExportGrid=va.checked?!0:null);"svg"==B&&(this.lastExportLinkTarget="auto"==X.value?null:X.value);if("png"==B){var Ba=parseInt(ea.value);
+this.lastExportDpi=!isNaN(Ba)&&0<Ba&&100!=Ba?Ba:null}E&&(this.lastExportType=y.value==A?null:y.value);f&&(this.lastEmbedImages=Q.checked,this.lastEmbedFonts=ba.checked,this.lastEmbedCellMetadata=W.checked,this.lastEmbedIcons=Y.checked);if("png"==B||"svg"==B)this.lastEmbedInclude=P.value;null!=r&&r(T.value,J.checked,!V.checked,wa.checked,L.checked,Q.checked&&f,ka.value,fa.checked,("png"==B||"svg"==B)&&"currentPage"==P.value,X.value,null!=va?va.checked:null,null!=ra?ra.value:null,y.value,ba.checked,
+W.checked&&f,"png"==B&&0<parseInt(ea.value)&&100!=parseInt(ea.value)?parseInt(ea.value):null,Y.checked&&f)}),null,l,n);this.showDialog(l.container,360,null,!0,!0,null,null,null,null,!0);T.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?T.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,n,r,t,v){var B=document.createElement("div"),E=this.editor.graph;if(null!=f){var K=document.createElement("h3");mxUtils.write(K,f);B.appendChild(K)}f=
document.createElement("div");f.className="geDialogSection";var C=v?this.addPagesRow(f):null,R=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),M=this.addCheckbox(f,mxResources.get("shadow"),E.shadowVisible&&n,!n,null,null,null,null,!0),O=this.addCheckbox(f,l,!1,null,null,null,null,null,!0),U=this.addCheckbox(f,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);B.appendChild(f);l=this.addAdvancedSection(B).content;var T=null;t&&(T=document.createElement("select"),
T.style.maxWidth="260px",t=document.createElement("option"),t.setAttribute("value","light"),mxUtils.write(t,mxResources.get("light")),T.appendChild(t),t=document.createElement("option"),t.setAttribute("value","dark"),mxUtils.write(t,mxResources.get("dark")),T.appendChild(t),mxUtils.lightDarkColorSupported?(t=document.createElement("option"),t.setAttribute("value","auto"),mxUtils.write(t,mxResources.get("automatic")),T.appendChild(t),T.value="auto"):T.value=Editor.isDarkMode()?"dark":"light",t=document.createElement("div"),
t.className="geDialogFormRow",n=document.createElement("span"),n.className="geDialogFormLabel",mxUtils.write(n,mxResources.get("appearance")+":"),t.appendChild(n),t.appendChild(T),l.appendChild(t));var V=this.addEditButton(l,U),fa=V.getEditInput(),y=1<E.model.getChildCount(E.model.getRoot()),d=this.addCheckbox(l,mxResources.get("layers"),y,!y,null,null,null,null,!0),p=this.addCheckbox(l,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),A=this.addCheckbox(l,mxResources.get("tooltipIcons"),
@@ -14474,73 +14484,73 @@ null!=C&&0<C.length&&(O=this.importXml(C,l,n,K,null,null!=R?mxEvent.isControlDow
!0,this.importGraphML(c,U);else if(null!=E&&null!=v&&EditorUi.isVisioFilename(v))M=!0,this.importVisio(E,U);else if(this.isGliffyData(c,v)){M=!0;var T=mxUtils.bind(this,function(fa){this.importGliffy(fa,U,mxUtils.bind(this,function(y){null!=B&&(B(null),this.showError(mxResources.get("error"),null!=y&&413==y.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")))}),v)});if(null!=c)T(c);else{var V=new FileReader;V.onload=function(){T(V.result)};V.readAsText(E)}}else 0==c.indexOf("PK")&&
null!=E?(M=!0,this.importZipFile(E,U,mxUtils.bind(this,function(){O=this.insertTextAt(this.validateFileData(c),l,n,!0,null,K);B(O)}))):/(\.v(sd|dx))($|\?)/i.test(v)||/(\.vs(s|x))($|\?)/i.test(v)||(O=this.insertTextAt(this.validateFileData(c),l,n,!0,null,K,null,null!=R?mxEvent.isControlDown(R):null));M||null==B||B(O);return O};EditorUi.prototype.importFiles=function(c,f,l,n,r,t,v,B,E,K,C,R,M){n=null!=n?n:this.maxImageSize;K=null!=K?K:this.maxImageBytes;var O=null!=f&&null!=l,U=!0;f=null!=f?f:0;l=null!=
l?l:0;var T=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var V=C||this.resampleThreshold,fa=0;fa<c.length;fa++)if("image/svg"!==c[fa].type.substring(0,9)&&"image/"===c[fa].type.substring(0,6)&&c[fa].size>V){T=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[l],"maxSize",[n],"maxBytes",[K],"resampleThreshold",[this.resampleThreshold],"largeImages",[T],"crop",[O],"resizeImages",[U],"ignoreEmbeddedXml",[R],"evt",[M]);var y=mxUtils.bind(this,function(){var d=this.editor.graph,
-p=d.gridSize;r=null!=r?r:mxUtils.bind(this,function(ba,X,Y,W,ca,S,Z,da,N){try{if(null!=ba&&"<mxlibrary"==ba.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ba,Z)),this.showSidebar(),null;this.isCompatibleString(ba)&&1==c.length&&null!=M&&"drop"==M.type&&this.isBlankFile()&&!this.canUndo()&&(O=!1,W=Y=0);return this.importFile(ba,X,Y,W,ca,S,Z,da,N,O,R,M)}catch(aa){return this.handleError(aa),null}});t=null!=t?t:mxUtils.bind(this,function(ba){d.setSelectionCells(ba)});
-if(this.spinner.spin(document.body,mxResources.get("loading")))for(var A=this.currentPage,G=c.length,I=G,L=[],P=mxUtils.bind(this,function(ba,X){L[ba]=X;if(0==--I){this.spinner.stop();if(null!=B)B(L);else{var Y=[];d.getModel().beginUpdate();try{for(ba=0;ba<L.length;ba++){var W=L[ba]();null!=W&&(Y=Y.concat(W))}}finally{d.getModel().endUpdate()}}A!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);t(Y)}}),Q=0;Q<G;Q++)mxUtils.bind(this,function(ba){var X=
-c[ba];if(null!=X){var Y=new FileReader;Y.onload=mxUtils.bind(this,function(W){if(null==v||v(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var ca=Graph.clipSvgDataUri(W.target.result),S=ca.indexOf(","),Z=decodeURIComponent(escape(atob(ca.substring(S+1)))),da=mxUtils.parseXml(Z),N=da.getElementsByTagName("svg");if(0<N.length){var aa=N[0],ea=R?null:aa.getAttribute("content");null!=ea&&"<"!=ea.charAt(0)&&"%"!=ea.charAt(0)&&(ea=unescape(window.atob?atob(ea):Base64.decode(ea,
+p=d.gridSize;r=null!=r?r:mxUtils.bind(this,function(ba,W,Y,X,ca,S,Z,da,N){try{if(null!=ba&&"<mxlibrary"==ba.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ba,Z)),this.showSidebar(),null;this.isCompatibleString(ba)&&1==c.length&&null!=M&&"drop"==M.type&&this.isBlankFile()&&!this.canUndo()&&(O=!1,X=Y=0);return this.importFile(ba,W,Y,X,ca,S,Z,da,N,O,R,M)}catch(aa){return this.handleError(aa),null}});t=null!=t?t:mxUtils.bind(this,function(ba){d.setSelectionCells(ba)});
+if(this.spinner.spin(document.body,mxResources.get("loading")))for(var A=this.currentPage,G=c.length,J=G,L=[],P=mxUtils.bind(this,function(ba,W){L[ba]=W;if(0==--J){this.spinner.stop();if(null!=B)B(L);else{var Y=[];d.getModel().beginUpdate();try{for(ba=0;ba<L.length;ba++){var X=L[ba]();null!=X&&(Y=Y.concat(X))}}finally{d.getModel().endUpdate()}}A!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);t(Y)}}),Q=0;Q<G;Q++)mxUtils.bind(this,function(ba){var W=
+c[ba];if(null!=W){var Y=new FileReader;Y.onload=mxUtils.bind(this,function(X){if(null==v||v(W))try{if("image/"==W.type.substring(0,6))if("image/svg"==W.type.substring(0,9)){var ca=Graph.clipSvgDataUri(X.target.result),S=ca.indexOf(","),Z=decodeURIComponent(escape(atob(ca.substring(S+1)))),da=mxUtils.parseXml(Z),N=da.getElementsByTagName("svg");if(0<N.length){var aa=N[0],ea=R?null:aa.getAttribute("content");null!=ea&&"<"!=ea.charAt(0)&&"%"!=ea.charAt(0)&&(ea=unescape(window.atob?atob(ea):Base64.decode(ea,
!0)));null!=ea&&"%"==ea.charAt(0)&&(ea=decodeURIComponent(ea));null==ea||"<mxfile "!==ea.substring(0,8)&&"<mxGraphModel>"!==ea.substring(0,14)&&"<mxGraphModel "!==ea.substring(0,14)?P(ba,mxUtils.bind(this,function(){try{if(null!=da){var sa=da.getElementsByTagName("svg");if(0<sa.length){var ma=sa[0],wa=ma.getAttribute("width"),va=ma.getAttribute("height");wa=null!=wa&&"%"!=wa.charAt(wa.length-1)?parseFloat(wa):NaN;va=null!=va&&"%"!=va.charAt(va.length-1)?parseFloat(va):NaN;var za=ma.getAttribute("viewBox");
-if(null==za||0==za.length)ma.setAttribute("viewBox","0 0 "+wa+" "+va);else if(isNaN(wa)||isNaN(va)){var Ba=za.split(" ");3<Ba.length&&(wa=parseFloat(Ba[2]),va=parseFloat(Ba[3]))}ca=Editor.createSvgDataUri(mxUtils.getXml(ma));var ua=Math.min(1,Math.min(n/Math.max(1,wa)),n/Math.max(1,va)),qa=r(ca,X.type,f+ba*p,l+ba*p,Math.max(1,Math.round(wa*ua)),Math.max(1,Math.round(va*ua)),X.name);if(null!=qa&&(isNaN(wa)||isNaN(va))){var ia=new Image;ia.onload=mxUtils.bind(this,function(){wa=Math.max(1,ia.width);
-va=Math.max(1,ia.height);qa[0].geometry.width=wa;qa[0].geometry.height=va;ma.setAttribute("viewBox","0 0 "+wa+" "+va);ca=Editor.createSvgDataUri(mxUtils.getXml(ma));var ja=ca.indexOf(";");0<ja&&(ca=ca.substring(0,ja)+ca.substring(ca.indexOf(",",ja+1)));d.setCellStyles("image",ca,[qa[0]])});ia.src=Editor.createSvgDataUri(mxUtils.getXml(ma))}return qa}}}catch(ja){}return null})):P(ba,mxUtils.bind(this,function(){return r(ea,"text/xml",f+ba*p,l+ba*p,0,0,X.name)}))}else P(ba,mxUtils.bind(this,function(){return null}))}else{S=
-!1;if("image/png"==X.type){var ka=R?null:this.extractGraphModelFromPng(W.target.result);if(null!=ka&&0<ka.length){var ra=new Image;ra.src=W.target.result;P(ba,mxUtils.bind(this,function(){return r(ka,"text/xml",f+ba*p,l+ba*p,ra.width,ra.height,X.name)}));S=!0}}S||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):
-this.loadImage(W.target.result,mxUtils.bind(this,function(sa){this.resizeImage(sa,Editor.stripImageMetadata(W.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(ma,wa,va){P(ba,mxUtils.bind(this,function(){if(null!=ma&&ma.length<K){var za=U&&this.isResampleImageSize(X.size,C)?Math.min(1,Math.min(n/wa,n/va)):1;return r(ma,X.type,f+ba*p,l+ba*p,Math.round(wa*za),Math.round(va*za),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),U,n,C,X.size)}),mxUtils.bind(this,
-function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ca=W.target.result,r(ca,X.type,f+ba*p,l+ba*p,240,160,X.name,function(sa){P(ba,function(){return sa})},X)}catch(sa){P(ba,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(sa,X)}else P(ba,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?r(null,X.type,f+ba*p,l+ba*p,240,160,X.name,function(W){P(ba,function(){return W})},X):"image"==X.type.substring(0,5)||
-"application/pdf"==X.type?Y.readAsDataURL(X):Y.readAsText(X)}})(Q)});if(T){T=[];for(fa=0;fa<c.length;fa++)T.push(c[fa]);c=T;this.confirmImageResize(function(d){U=d;y()},E)}else y()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var l=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},
+if(null==za||0==za.length)ma.setAttribute("viewBox","0 0 "+wa+" "+va);else if(isNaN(wa)||isNaN(va)){var Ba=za.split(" ");3<Ba.length&&(wa=parseFloat(Ba[2]),va=parseFloat(Ba[3]))}ca=Editor.createSvgDataUri(mxUtils.getXml(ma));var ua=Math.min(1,Math.min(n/Math.max(1,wa)),n/Math.max(1,va)),qa=r(ca,W.type,f+ba*p,l+ba*p,Math.max(1,Math.round(wa*ua)),Math.max(1,Math.round(va*ua)),W.name);if(null!=qa&&(isNaN(wa)||isNaN(va))){var ia=new Image;ia.onload=mxUtils.bind(this,function(){wa=Math.max(1,ia.width);
+va=Math.max(1,ia.height);qa[0].geometry.width=wa;qa[0].geometry.height=va;ma.setAttribute("viewBox","0 0 "+wa+" "+va);ca=Editor.createSvgDataUri(mxUtils.getXml(ma));var ja=ca.indexOf(";");0<ja&&(ca=ca.substring(0,ja)+ca.substring(ca.indexOf(",",ja+1)));d.setCellStyles("image",ca,[qa[0]])});ia.src=Editor.createSvgDataUri(mxUtils.getXml(ma))}return qa}}}catch(ja){}return null})):P(ba,mxUtils.bind(this,function(){return r(ea,"text/xml",f+ba*p,l+ba*p,0,0,W.name)}))}else P(ba,mxUtils.bind(this,function(){return null}))}else{S=
+!1;if("image/png"==W.type){var ka=R?null:this.extractGraphModelFromPng(X.target.result);if(null!=ka&&0<ka.length){var ra=new Image;ra.src=X.target.result;P(ba,mxUtils.bind(this,function(){return r(ka,"text/xml",f+ba*p,l+ba*p,ra.width,ra.height,W.name)}));S=!0}}S||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):
+this.loadImage(X.target.result,mxUtils.bind(this,function(sa){this.resizeImage(sa,Editor.stripImageMetadata(X.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(ma,wa,va){P(ba,mxUtils.bind(this,function(){if(null!=ma&&ma.length<K){var za=U&&this.isResampleImageSize(W.size,C)?Math.min(1,Math.min(n/wa,n/va)):1;return r(ma,W.type,f+ba*p,l+ba*p,Math.round(wa*za),Math.round(va*za),W.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),U,n,C,W.size)}),mxUtils.bind(this,
+function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else ca=X.target.result,r(ca,W.type,f+ba*p,l+ba*p,240,160,W.name,function(sa){P(ba,function(){return sa})},W)}catch(sa){P(ba,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(sa,W)}else P(ba,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(W.name)?r(null,W.type,f+ba*p,l+ba*p,240,160,W.name,function(X){P(ba,function(){return X})},W):"image"==W.type.substring(0,5)||
+"application/pdf"==W.type?Y.readAsDataURL(W):Y.readAsText(W)}})(Q)});if(T){T=[];for(fa=0;fa<c.length;fa++)T.push(c[fa]);c=T;this.confirmImageResize(function(d){U=d;y()},E)}else y()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var l=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},
n=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,r=function(t,v){if(t||f)mxSettings.setResizeImages(t?v:null),mxSettings.save();l();c(v)};null==n||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(t){r(t,!0)},function(t){r(t,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,
340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):r(!1,n)};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,l,n,r,t,v){r=null!=r?r:this.maxImageSize;var B=Math.max(1,c.width),E=Math.max(1,c.height),K=f;if(n&&this.isResampleImageSize(null!=v?v:f.length,t))try{var C=Math.max(B/r,E/r);if(1<C){var R=Math.round(B/C),M=Math.round(E/C),O=document.createElement("canvas");O.width=R;O.height=M;O.getContext("2d").drawImage(c,
0,0,R,M);var U=O.toDataURL();if(U.length<f.length){var T=document.createElement("canvas");T.width=R;T.height=M;var V=T.toDataURL();U!==V&&(f=U,B=R,E=M)}}}catch(fa){}n&&K!=f&&r>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,n,r/1.5,t,v):l(f,B,E)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,l){try{var n=new Image;n.onload=function(){n.width=0<n.width?n.width:120;n.height=0<n.height?
n.height:120;f(n)};null!=l&&(n.onerror=l);n.src=c}catch(r){if(null!=l)l(r);else throw r;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var q=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){if(Editor.isSettingsEnabled()){null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles);this.formatWidth=mxSettings.getFormatWidth();var c=mxSettings.getSidebarWidth();
null!=c&&(this.hsplitPosition=parseInt(c))}this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);q.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var u=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,
-f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(W,ca){ca.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var l=
-null,n=function(){var W=f.getModel().getRoot();if(W===l&&null!=c.chromelessAnimationPlayer)return!0;l=W;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};n();this.editor.addListener("fileLoaded",n);f.addListener(mxEvent.ROOT,n)}var r=f.isEnabled;f.isEnabled=function(){return r.apply(this,arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];
-f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];f.showNoteIcons=Editor.showNoteIcons&&"0"!=urlParams["note-icons"];var t=this;f.editTooltip=function(W){null!=W&&t.actions.get("editTooltip").funct()};f.editNote=function(W){null!=W&&t.actions.get("editNote").funct()};f.getLinkOverlayTooltip=function(W){if(Graph.isPageLink(W)&&null!=t.pages){var ca=W.substring(W.indexOf(",")+1);ca=t.getPageById(ca);if(null!=ca)return ca.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(t.pages,
-ca)+1])}else if(this.isCustomLink(W))return this.getLinkTitle(W);return W};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(W){var ca=W.getEvent();return null==W.getState()&&!mxEvent.isMouseEvent(ca)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(ca)&&(null==W.getState()||mxEvent.isControlDown(ca)||mxEvent.isShiftDown(ca))});var v=function(W){W=/(?:^|;)groupPadding=([^;]*)/.exec(null!=W?W:"");return null!=W?W[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(W,ca){W=ca.getProperty("edit");
-if(null!=W&&null!=W.changes){ca=W.changes.length;for(var S=[],Z=0;Z<ca;Z++){var da=W.changes[Z];da instanceof mxStyleChange&&null!=da.cell&&f.model.isVertex(da.cell)&&v(da.style)!=v(da.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=da.style?da.style:"")&&(null!=f.getAttributeForCell(da.cell,"mermaidData")||null!=f.getAttributeForCell(da.cell,"plantUmlData"))&&0>mxUtils.indexOf(S,da.cell)&&S.push(da.cell)}for(Z=0;Z<S.length;Z++)c.refreshMermaidImage(S[Z])}});var B=function(W){var ca=!1;c.showDialog(W.container,
-640,420,!0,!0,function(S,Z){if(!ca&&W.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){ca=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);W.init()};f.cellEditor.editPlantUmlData=function(W,ca,S){var Z=JSON.parse(S);ca=f.getCurrentCellStyle(W);var da=mxUtils.getValue(ca,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,N=null==Z.format&&!da;ca="draw.io"==c.getServiceName()||"atlassian"==
+f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(X,ca){ca.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var l=
+null,n=function(){var X=f.getModel().getRoot();if(X===l&&null!=c.chromelessAnimationPlayer)return!0;l=X;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};n();this.editor.addListener("fileLoaded",n);f.addListener(mxEvent.ROOT,n)}var r=f.isEnabled;f.isEnabled=function(){return r.apply(this,arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];
+f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];f.showNoteIcons=Editor.showNoteIcons&&"0"!=urlParams["note-icons"];var t=this;f.editTooltip=function(X){null!=X&&t.actions.get("editTooltip").funct()};f.editNote=function(X){null!=X&&t.actions.get("editNote").funct()};f.getLinkOverlayTooltip=function(X){if(Graph.isPageLink(X)&&null!=t.pages){var ca=X.substring(X.indexOf(",")+1);ca=t.getPageById(ca);if(null!=ca)return ca.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(t.pages,
+ca)+1])}else if(this.isCustomLink(X))return this.getLinkTitle(X);return X};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(X){var ca=X.getEvent();return null==X.getState()&&!mxEvent.isMouseEvent(ca)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(ca)&&(null==X.getState()||mxEvent.isControlDown(ca)||mxEvent.isShiftDown(ca))});var v=function(X){X=/(?:^|;)groupPadding=([^;]*)/.exec(null!=X?X:"");return null!=X?X[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(X,ca){X=ca.getProperty("edit");
+if(null!=X&&null!=X.changes){ca=X.changes.length;for(var S=[],Z=0;Z<ca;Z++){var da=X.changes[Z];da instanceof mxStyleChange&&null!=da.cell&&f.model.isVertex(da.cell)&&v(da.style)!=v(da.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=da.style?da.style:"")&&(null!=f.getAttributeForCell(da.cell,"mermaidData")||null!=f.getAttributeForCell(da.cell,"plantUmlData"))&&0>mxUtils.indexOf(S,da.cell)&&S.push(da.cell)}for(Z=0;Z<S.length;Z++)c.refreshMermaidImage(S[Z])}});var B=function(X){var ca=!1;c.showDialog(X.container,
+640,420,!0,!0,function(S,Z){if(!ca&&X.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){ca=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);X.init()};f.cellEditor.editPlantUmlData=function(X,ca,S){var Z=JSON.parse(S);ca=f.getCurrentCellStyle(X);var da=mxUtils.getValue(ca,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,N=null==Z.format&&!da;ca="draw.io"==c.getServiceName()||"atlassian"==
c.getServiceName();var aa=document.createElement("select");aa.className="geBtn";S=document.createElement("option");S.setAttribute("value","plantUmlDiagram");mxUtils.write(S,mxResources.get("diagram"));aa.appendChild(S);S=document.createElement("option");S.setAttribute("value","plantUmlImage");mxUtils.write(S,mxResources.get("image"));aa.appendChild(S);aa.value=da?"plantUmlImage":"plantUmlDiagram";var ea=new SimpleTextareaDialog(c,Z.data,function(ka){if(null!=ka&&c.spinner.spin(document.body,mxResources.get("inserting"))){var ra=
-"plantUmlImage"==aa.value,sa=N?Z.config:null;c.parsePlantUmlDiagram(ka,sa,function(ma,wa){c.spinner.stop();ea.hide();try{f.getModel().beginUpdate();try{if(da&&ra)c.updateMermaidImage(W,ka,null,ma,c.getMermaidImageBorder(W,Z.border),"plantUmlData");else if(N&&!ra)c.replaceLockedGroupChildren(W,ma,ka,sa,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var va=c.getMermaidImageBorder(W,Z.border),za=c.replaceMermaidCell(W,ra?c.createMermaidImageXml(ka,null,ma,
+"plantUmlImage"==aa.value,sa=N?Z.config:null;c.parsePlantUmlDiagram(ka,sa,function(ma,wa){c.spinner.stop();ea.hide();try{f.getModel().beginUpdate();try{if(da&&ra)c.updateMermaidImage(X,ka,null,ma,c.getMermaidImageBorder(X,Z.border),"plantUmlData");else if(N&&!ra)c.replaceLockedGroupChildren(X,ma,ka,sa,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var va=c.getMermaidImageBorder(X,Z.border),za=c.replaceMermaidCell(X,ra?c.createMermaidImageXml(ka,null,ma,
null,va,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(ma,ka,sa));ra||null==va||f.setCellStyles("groupPadding",va,za)}}finally{f.getModel().endUpdate()}c.showPlantUmlWarnings(wa)}catch(Ba){c.handleError(Ba)}},function(ma){c.spinner.stop();c.handleError(ma)})}},null,null,ca?aa:null,!0,null==c.sidebar?null:function(ka,ra){c.spinner.spin(document.body,mxResources.get("loading"))&&c.parsePlantUmlDiagram(ka,N?Z.config:null,function(sa,ma){c.spinner.stop();c.showPreviewTooltip(sa,ra);c.showPlantUmlWarnings(ma)},
-function(sa){c.spinner.stop();c.handleError(sa)})});B(ea)};f.cellEditor.editMermaidData=function(W,ca,S){var Z=JSON.parse(S);ca=f.getCurrentCellStyle(W);var da=mxUtils.getValue(ca,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,N=da&&null==Z.config;ca="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var aa=document.createElement("select");aa.className="geBtn";S=document.createElement("option");S.setAttribute("value","mermaid");mxUtils.write(S,mxResources.get("diagram"));aa.appendChild(S);
+function(sa){c.spinner.stop();c.handleError(sa)})});B(ea)};f.cellEditor.editMermaidData=function(X,ca,S){var Z=JSON.parse(S);ca=f.getCurrentCellStyle(X);var da=mxUtils.getValue(ca,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,N=da&&null==Z.config;ca="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var aa=document.createElement("select");aa.className="geBtn";S=document.createElement("option");S.setAttribute("value","mermaid");mxUtils.write(S,mxResources.get("diagram"));aa.appendChild(S);
S=document.createElement("option");S.setAttribute("value","mermaidImage");mxUtils.write(S,mxResources.get("image"));aa.appendChild(S);aa.value=da?"mermaidImage":"mermaid";var ea=new SimpleTextareaDialog(c,Z.data,function(ka){if(null!=ka&&c.spinner.spin(document.body,mxResources.get("inserting"))){var ra="mermaidImage"==aa.value;if(ra&&N){var sa=EditorUi.legacyMermaidConfig;var ma=null}else ma=sa=null!=Z.config?Z.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(ka,mxUtils.clone(sa),function(wa){c.spinner.stop();
-ea.hide();try{f.getModel().beginUpdate();try{if(da&&ra)c.updateMermaidImage(W,ka,ma,wa,c.getMermaidImageBorder(W,Z.border));else if(da||ra){var va=c.getMermaidImageBorder(W,Z.border),za=c.replaceMermaidCell(W,ra?c.createMermaidImageXml(ka,ma,wa,null,va):mxMermaidToDrawio.wrapGroup(wa,ka,ma));ra||null==va||f.setCellStyles("groupPadding",va,za)}else c.replaceLockedGroupChildren(W,wa,ka,ma)}finally{f.getModel().endUpdate()}}catch(Ba){c.handleError(Ba)}},function(wa){c.spinner.stop();c.handleError(wa)})}},
-null,null,ca?aa:null,!0,null==c.sidebar?null:function(ka,ra){if(c.spinner.spin(document.body,mxResources.get("loading"))){var sa="mermaidImage"==aa.value&&N?EditorUi.legacyMermaidConfig:null!=Z.config?Z.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(ka,mxUtils.clone(sa),function(ma){c.spinner.stop();c.showPreviewTooltip(ma,ra)},function(ma){c.spinner.stop();c.handleError(ma)})}});B(ea)};var E=f.cellEditor.startEditing;f.cellEditor.startEditing=function(W,ca,S){try{var Z=this.graph.getLockedGroupAncestor(W);
-null!=Z&&(W=Z);var da=this.graph.getAttributeForCell(W,"plantUmlData");if(null!=da)this.editPlantUmlData(W,ca,da);else if(da=this.graph.getAttributeForCell(W,"mermaidData"),null!=da&&EditorUi.isMermaidSupported())this.editMermaidData(W,ca,da);else{var N=f.getCellStyle(W);"1"==mxUtils.getValue(N,"metaEdit","0")?c.showDataDialog(W):E.call(this,W,ca,S)}}catch(aa){c.handleError(aa)}};f.getLinkTitle=function(W){return c.getLinkTitle(W)};f.customLinkClicked=function(W,ca){var S=!1;try{var Z=this.view.graphBounds,
-da=null!=Z?new mxRectangle(Z.x,Z.y,Z.width,Z.height):null;c.handleCustomLink(W,ca);S=!0;var N=this.view.graphBounds;c.chromelessResize&&null!=da&&null!=N&&!da.equals(N)&&(c.chromelessResize(),this.scrollCellToVisible(ca))}catch(aa){c.handleError(aa)}return S};var K=f.parseBackgroundImage;f.parseBackgroundImage=function(W){var ca=K.apply(this,arguments);null!=ca&&null!=ca.src&&Graph.isPageLink(ca.src)&&(ca={originalSrc:ca.src});return ca};var C=f.setBackgroundImage;f.setBackgroundImage=function(W){null!=
-W&&null!=W.originalSrc&&(W=c.createImageForPageLink(W.originalSrc,c.currentPage,this));C.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(W,ca){W=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=W){var S=W.indexOf(",");if(0<S)for(W=W.substring(S+1),ca=
-ca.getProperty("patches"),S=0;S<ca.length;S++)if(null!=ca[S][EditorUi.DIFF_UPDATE]&&null!=ca[S][EditorUi.DIFF_UPDATE][W]||null!=ca[S][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(ca[S][EditorUi.DIFF_REMOVE],W)){f.refreshBackgroundImage();break}}}));var R=f.getBackgroundImageObject;f.getBackgroundImageObject=function(W,ca,S){var Z=R.apply(this,arguments);null!=Z&&null!=Z.originalSrc&&(Z=ca?c.createImageForPageLink(Z.originalSrc,S,null,!0):{src:Z.originalSrc});return Z};this.isOffline()||"undefined"===
-typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var M=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(W){W=null!=W?W:"";"1"==urlParams.dev&&(W+=(0<W.length?"&":"?")+"dev=1");"1"==urlParams.test&&(W+=(0<W.length?"&":"?")+"test=1");return M.apply(this,
-arguments)};var O=f.addClickHandler;f.addClickHandler=function(W,ca,S){var Z=ca;ca=function(da,N,aa){if(null==N){var ea=mxEvent.getSource(da);"a"==ea.nodeName.toLowerCase()&&(N=ea.getAttribute("href"))}null!=N&&f.isCustomLink(N)&&(mxEvent.isTouchEvent(da)||!mxEvent.isPopupTrigger(da))&&f.customLinkClicked(N,aa)&&mxEvent.consume(da);null!=Z&&Z(da,N,aa)};O.call(this,W,ca,S)};u.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,
-null,!0);if(null!=this.menus){var U=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(W,ca,S){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(W,["zoomIn","zoomOut","-"],null,S);if(Editor.passiveScroll&&null!=S){var Z=mxUtils.convertPoint(f.container,mxEvent.getClientX(S),mxEvent.getClientY(S));f._contextMenuPoint=new mxPoint(f.snap(Z.x/f.view.scale-f.view.translate.x),f.snap(Z.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,
-mxEvent.getClientX(S),mxEvent.getClientY(S))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",W,null),W.addSeparator());U.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(W,["-","addToScratchpad"],null,S);if(0<f.getSelectionCount()&&c.commentsSupported()&&c.anchoredCommentsSupported()&&c.canComment()&&null!=this.showCommentsWindow){var da=f.getSelectionCells(),N=this;W.addSeparator();W.addItem(mxResources.get("comment")+
-"...",null,function(){if(null!=c.currentPage){if(1==da.length)var aa=da[0].id;else{aa=[];for(var ea=0;ea<da.length;ea++)aa.push(da[ea].id)}N.showCommentsWindow(null,{p:c.currentPage.getId(),c:aa})}})}f.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(W,["-","exitGroup","home"],null,S)};var T=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(W,ca,S){if(c.editor.graph.isSelectionEmpty())T.apply(this,arguments),c.menus.addMenuItems(W,["copyAsImage","copyAsSvg"],
-null,S);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(W,ca,S):this.addPopupMenuArrangeItems(W,ca,S),this.addMenuItems(W,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,S),Editor.passiveScroll&&(1==f.getSelectionCount()?this.addMenuItems(W,["-","copyStyle","pasteStyle","copyTextStyle","pasteTextStyle"],null,S):this.addMenuItems(W,["-","pasteStyle","pasteTextStyle"],null,S)),this.addMenuItems(W,["-"],null,S),this.isShowCellEditItems()||this.addPopupDeleteItem(W,ca,S),this.addMenuItems(W,
-["lockUnlock","-"],null,S),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(ca)&&f.isCellEditable(ca)&&(this.addSubmenu("editCell",W,null,mxResources.get("edit")),W.addSeparator(),f.getModel().isEdge(ca))){this.addSubmenu("line",W);var Z=f.getModel().getGeometry(ca);null!=Z&&null!=Z.points&&0<Z.points.length&&this.addMenuItems(W,["clearWaypoints"],null,S)}1==f.getSelectionCount()&&this.addMenuItems(W,["enterGroup"],null,S);Z=c.getSelectionState();null!=Z.mergeCell?this.addMenuItem(W,
-"mergeCells"):(1<Z.style.colspan||1<Z.style.rowspan)&&this.addMenuItem(W,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}n=mxUtils.bind(this,function(){this.updateCommentOverlays()});this.addListener("commentsChanged",
-n);this.addListener("darkModeChanged",n);this.editor.addListener("pageSelected",n);this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){this.commentOverlays=null;this.refreshCommentCache()}));if(Editor.passiveScroll){var V=f.getCenterInsertPoint;f.getCenterInsertPoint=function(W){if(null!=this._contextMenuPoint){var ca=this._contextMenuPoint;W=null!=W?W:new mxRectangle;return new mxPoint(f.snap(ca.x-(W.width||0)/2),f.snap(ca.y-(W.height||0)/2))}return V.apply(this,arguments)};var fa=
-f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){fa.apply(this,arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var y=f.getExportVariables;f.getExportVariables=function(){var W=y.apply(this,arguments),ca=c.getCurrentFile();null!=ca&&(W.filename=ca.getTitle());c.updateFileVars();
-if(null!=c.fileVars)for(var S in c.fileVars)null==W[S]&&(W[S]=c.fileVars[S]);W.pagecount=null!=c.pages?c.pages.length:1;W.page=null!=c.currentPage?c.currentPage.getName():"";W.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return W};var d=f.getGlobalVariable;f.getGlobalVariable=function(W){var ca=c.getCurrentFile();if("filename"==W&&null!=ca)return ca.getTitle();if("page"==W&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==W)return null!=
-c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==W)return null!=c.pages?c.pages.length:1;ca=d.apply(this,arguments);null==ca&&(c.updateFileVars(),null!=c.fileVars&&(ca=c.fileVars[W]));return ca};var p=null,A=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var W=this.getCurrentFile(),ca=null!=W&&null!=W.getTitle()?W.getTitle():this.defaultFilename;p!=ca&&W==A&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());
-p=ca;A=W}));var G=f.labelLinkClicked;f.labelLinkClicked=function(W,ca,S){var Z=ca.getAttribute("href");if(null==Z||!f.isCustomLink(Z)||!mxEvent.isTouchEvent(S)&&mxEvent.isPopupTrigger(S))G.apply(this,arguments);else{if(!f.isEnabled()||null!=W&&f.isCellLocked(W.cell))f.customLinkClicked(Z),f.getRubberband().reset();mxEvent.consume(S)}};this.editor.getOrCreateFilename=function(){var W=c.defaultFilename,ca=c.getCurrentFile();null!=ca&&(W=null!=ca.getTitle()?ca.getTitle():W);return W};n=this.actions.get("print");
+ea.hide();try{f.getModel().beginUpdate();try{if(da&&ra)c.updateMermaidImage(X,ka,ma,wa,c.getMermaidImageBorder(X,Z.border));else if(da||ra){var va=c.getMermaidImageBorder(X,Z.border),za=c.replaceMermaidCell(X,ra?c.createMermaidImageXml(ka,ma,wa,null,va):mxMermaidToDrawio.wrapGroup(wa,ka,ma));ra||null==va||f.setCellStyles("groupPadding",va,za)}else c.replaceLockedGroupChildren(X,wa,ka,ma)}finally{f.getModel().endUpdate()}}catch(Ba){c.handleError(Ba)}},function(wa){c.spinner.stop();c.handleError(wa)})}},
+null,null,ca?aa:null,!0,null==c.sidebar?null:function(ka,ra){if(c.spinner.spin(document.body,mxResources.get("loading"))){var sa="mermaidImage"==aa.value&&N?EditorUi.legacyMermaidConfig:null!=Z.config?Z.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(ka,mxUtils.clone(sa),function(ma){c.spinner.stop();c.showPreviewTooltip(ma,ra)},function(ma){c.spinner.stop();c.handleError(ma)})}});B(ea)};var E=f.cellEditor.startEditing;f.cellEditor.startEditing=function(X,ca,S){try{var Z=this.graph.getLockedGroupAncestor(X);
+null!=Z&&(X=Z);var da=this.graph.getAttributeForCell(X,"plantUmlData");if(null!=da)this.editPlantUmlData(X,ca,da);else if(da=this.graph.getAttributeForCell(X,"mermaidData"),null!=da&&EditorUi.isMermaidSupported())this.editMermaidData(X,ca,da);else{var N=f.getCellStyle(X);"1"==mxUtils.getValue(N,"metaEdit","0")?c.showDataDialog(X):E.call(this,X,ca,S)}}catch(aa){c.handleError(aa)}};f.getLinkTitle=function(X){return c.getLinkTitle(X)};f.customLinkClicked=function(X,ca){var S=!1;try{var Z=this.view.graphBounds,
+da=null!=Z?new mxRectangle(Z.x,Z.y,Z.width,Z.height):null;c.handleCustomLink(X,ca);S=!0;var N=this.view.graphBounds;c.chromelessResize&&null!=da&&null!=N&&!da.equals(N)&&(c.chromelessResize(),this.scrollCellToVisible(ca))}catch(aa){c.handleError(aa)}return S};var K=f.parseBackgroundImage;f.parseBackgroundImage=function(X){var ca=K.apply(this,arguments);null!=ca&&null!=ca.src&&Graph.isPageLink(ca.src)&&(ca={originalSrc:ca.src});return ca};var C=f.setBackgroundImage;f.setBackgroundImage=function(X){null!=
+X&&null!=X.originalSrc&&(X=c.createImageForPageLink(X.originalSrc,c.currentPage,this));C.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(X,ca){X=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=X){var S=X.indexOf(",");if(0<S)for(X=X.substring(S+1),ca=
+ca.getProperty("patches"),S=0;S<ca.length;S++)if(null!=ca[S][EditorUi.DIFF_UPDATE]&&null!=ca[S][EditorUi.DIFF_UPDATE][X]||null!=ca[S][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(ca[S][EditorUi.DIFF_REMOVE],X)){f.refreshBackgroundImage();break}}}));var R=f.getBackgroundImageObject;f.getBackgroundImageObject=function(X,ca,S){var Z=R.apply(this,arguments);null!=Z&&null!=Z.originalSrc&&(Z=ca?c.createImageForPageLink(Z.originalSrc,S,null,!0):{src:Z.originalSrc});return Z};this.isOffline()||"undefined"===
+typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var M=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(X){X=null!=X?X:"";"1"==urlParams.dev&&(X+=(0<X.length?"&":"?")+"dev=1");"1"==urlParams.test&&(X+=(0<X.length?"&":"?")+"test=1");return M.apply(this,
+arguments)};var O=f.addClickHandler;f.addClickHandler=function(X,ca,S){var Z=ca;ca=function(da,N,aa){if(null==N){var ea=mxEvent.getSource(da);"a"==ea.nodeName.toLowerCase()&&(N=ea.getAttribute("href"))}null!=N&&f.isCustomLink(N)&&(mxEvent.isTouchEvent(da)||!mxEvent.isPopupTrigger(da))&&f.customLinkClicked(N,aa)&&mxEvent.consume(da);null!=Z&&Z(da,N,aa)};O.call(this,X,ca,S)};u.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,
+null,!0);if(null!=this.menus){var U=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(X,ca,S){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(X,["zoomIn","zoomOut","-"],null,S);if(Editor.passiveScroll&&null!=S){var Z=mxUtils.convertPoint(f.container,mxEvent.getClientX(S),mxEvent.getClientY(S));f._contextMenuPoint=new mxPoint(f.snap(Z.x/f.view.scale-f.view.translate.x),f.snap(Z.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,
+mxEvent.getClientX(S),mxEvent.getClientY(S))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",X,null),X.addSeparator());U.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(X,["-","addToScratchpad"],null,S);if(0<f.getSelectionCount()&&c.commentsSupported()&&c.anchoredCommentsSupported()&&c.canComment()&&null!=this.showCommentsWindow){var da=f.getSelectionCells(),N=this;X.addSeparator();X.addItem(mxResources.get("comment")+
+"...",null,function(){if(null!=c.currentPage){if(1==da.length)var aa=da[0].id;else{aa=[];for(var ea=0;ea<da.length;ea++)aa.push(da[ea].id)}N.showCommentsWindow(null,{p:c.currentPage.getId(),c:aa})}})}f.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(X,["-","exitGroup","home"],null,S)};var T=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(X,ca,S){if(c.editor.graph.isSelectionEmpty())T.apply(this,arguments),c.menus.addMenuItems(X,["copyAsImage","copyAsSvg"],
+null,S);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(X,ca,S):this.addPopupMenuArrangeItems(X,ca,S),this.addMenuItems(X,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,S),Editor.passiveScroll&&(1==f.getSelectionCount()?this.addMenuItems(X,["-","copyStyle","pasteStyle","copyTextStyle","pasteTextStyle"],null,S):this.addMenuItems(X,["-","pasteStyle","pasteTextStyle"],null,S)),this.addMenuItems(X,["-"],null,S),this.isShowCellEditItems()||this.addPopupDeleteItem(X,ca,S),this.addMenuItems(X,
+["lockUnlock","-"],null,S),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(ca)&&f.isCellEditable(ca)&&(this.addSubmenu("editCell",X,null,mxResources.get("edit")),X.addSeparator(),f.getModel().isEdge(ca))){this.addSubmenu("line",X);var Z=f.getModel().getGeometry(ca);null!=Z&&null!=Z.points&&0<Z.points.length&&this.addMenuItems(X,["clearWaypoints"],null,S)}1==f.getSelectionCount()&&this.addMenuItems(X,["enterGroup"],null,S);Z=c.getSelectionState();null!=Z.mergeCell?this.addMenuItem(X,
+"mergeCells"):(1<Z.style.colspan||1<Z.style.rowspan)&&this.addMenuItem(X,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}n=mxUtils.bind(this,function(){this.updateCommentOverlays()});this.addListener("commentsChanged",
+n);this.addListener("darkModeChanged",n);this.editor.addListener("pageSelected",n);this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){this.commentOverlays=null;this.refreshCommentCache()}));if(Editor.passiveScroll){var V=f.getCenterInsertPoint;f.getCenterInsertPoint=function(X){if(null!=this._contextMenuPoint){var ca=this._contextMenuPoint;X=null!=X?X:new mxRectangle;return new mxPoint(f.snap(ca.x-(X.width||0)/2),f.snap(ca.y-(X.height||0)/2))}return V.apply(this,arguments)};var fa=
+f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){fa.apply(this,arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var y=f.getExportVariables;f.getExportVariables=function(){var X=y.apply(this,arguments),ca=c.getCurrentFile();null!=ca&&(X.filename=ca.getTitle());c.updateFileVars();
+if(null!=c.fileVars)for(var S in c.fileVars)null==X[S]&&(X[S]=c.fileVars[S]);X.pagecount=null!=c.pages?c.pages.length:1;X.page=null!=c.currentPage?c.currentPage.getName():"";X.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return X};var d=f.getGlobalVariable;f.getGlobalVariable=function(X){var ca=c.getCurrentFile();if("filename"==X&&null!=ca)return ca.getTitle();if("page"==X&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==X)return null!=
+c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==X)return null!=c.pages?c.pages.length:1;ca=d.apply(this,arguments);null==ca&&(c.updateFileVars(),null!=c.fileVars&&(ca=c.fileVars[X]));return ca};var p=null,A=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var X=this.getCurrentFile(),ca=null!=X&&null!=X.getTitle()?X.getTitle():this.defaultFilename;p!=ca&&X==A&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());
+p=ca;A=X}));var G=f.labelLinkClicked;f.labelLinkClicked=function(X,ca,S){var Z=ca.getAttribute("href");if(null==Z||!f.isCustomLink(Z)||!mxEvent.isTouchEvent(S)&&mxEvent.isPopupTrigger(S))G.apply(this,arguments);else{if(!f.isEnabled()||null!=X&&f.isCellLocked(X.cell))f.customLinkClicked(Z),f.getRubberband().reset();mxEvent.consume(S)}};this.editor.getOrCreateFilename=function(){var X=c.defaultFilename,ca=c.getCurrentFile();null!=ca&&(X=null!=ca.getTitle()?ca.getTitle():X);return X};n=this.actions.get("print");
n.setEnabled(!mxClient.IS_IOS||!navigator.standalone);n.visible=n.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),
this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.ctrlAltActions[84]="runLastLayout",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),
-Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(W,ca){null!=ca&&f.isEnabled()&&!f.isEditing()&&null!=ca.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(W){var ca=
+Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(X,ca){null!=ca&&f.isEnabled()&&!f.isEditing()&&null!=ca.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(X){var ca=
f.cellEditor.text2,S=null;null!=ca&&(mxEvent.addListener(ca,"dragleave",function(Z){null!=S&&(S.parentNode.removeChild(S),S=null);Z.stopPropagation();Z.preventDefault()}),mxEvent.addListener(ca,"dragover",mxUtils.bind(this,function(Z){null==S&&(S=this.highlightElement(ca));Z.stopPropagation();Z.preventDefault()})),mxEvent.addListener(ca,"drop",mxUtils.bind(this,function(Z){null!=S&&(S.parentNode.removeChild(S),S=null);if(0<Z.dataTransfer.files.length)this.importFiles(Z.dataTransfer.files,0,0,this.maxImageSize,
function(N,aa,ea,ka,ra,sa){f.insertImage(N,ra,sa)},function(){},function(N){return"image/"==N.type.substring(0,6)},function(N){for(var aa=0;aa<N.length;aa++)N[aa]()},mxEvent.isControlDown(Z));else if(0<=mxUtils.indexOf(Z.dataTransfer.types,"text/uri-list")){var da=Z.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(da)?this.loadImage(decodeURIComponent(da),mxUtils.bind(this,function(N){var aa=Math.max(1,N.width);N=Math.max(1,N.height);var ea=this.maxImageSize;ea=Math.min(1,
Math.min(ea/Math.max(1,aa)),ea/Math.max(1,N));f.insertImage(decodeURIComponent(da),aa*ea,N*ea)})):document.execCommand("insertHTML",!1,Z.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(Z.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,Z.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(Z.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,Z.dataTransfer.getData("text/plain"));Z.stopPropagation();Z.preventDefault()})))}));if(Editor.isSettingsEnabled()){n=
-this.editor.graph.view;var I=mxSettings.getUnit();n.setUnit(I);Editor.pageSizeUnit=I;n.addListener("unitChanged",function(W,ca){W=ca.getProperty("unit");mxSettings.setUnit(W);mxSettings.save();Editor.pageSizeUnit=W});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,n.unit);this.refresh()}if("1"==urlParams.styledev){n=document.getElementById("geFooter");null!=
+this.editor.graph.view;var J=mxSettings.getUnit();n.setUnit(J);Editor.pageSizeUnit=J;n.addListener("unitChanged",function(X,ca){X=ca.getProperty("unit");mxSettings.setUnit(X);mxSettings.save();Editor.pageSizeUnit=X});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,n.unit);this.refresh()}if("1"==urlParams.styledev){n=document.getElementById("geFooter");null!=
n&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),n.appendChild(this.styleInput),
-this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(W,ca){0<this.editor.graph.getSelectionCount()?(W=this.editor.graph.getSelectionCell(),W=this.editor.graph.getModel().getStyle(W),this.styleInput.value=W||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var L=this.isSelectionAllowed;this.isSelectionAllowed=function(W){return mxEvent.getSource(W)==this.styleInput?!0:L.apply(this,arguments)}}n=document.getElementById("geInfo");
-null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var P=null;mxEvent.addListener(f.container,"dragleave",function(W){f.isEnabled()&&(null!=P&&(P.parentNode.removeChild(P),P=null),W.stopPropagation(),W.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(W){null==P&&(P=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();W.stopPropagation();W.preventDefault()}));mxEvent.addListener(f.container,
-"drop",mxUtils.bind(this,function(W){null!=P&&(P.parentNode.removeChild(P),P=null);if(f.isEnabled()){var ca=mxUtils.convertPoint(f.container,mxEvent.getClientX(W),mxEvent.getClientY(W)),S=W.dataTransfer.files,Z=f.view.translate,da=f.view.scale,N=ca.x/da-Z.x,aa=ca.y/da-Z.y;if(0<S.length)ca=this.isBlankFile()&&!this.canUndo(),Z=1==S.length&&(EditorUi.isVisioFilename(S[0].name)||/(\.drawio)$/i.test(S[0].name)||/(\.xml)$/i.test(S[0].name)),"1"!=urlParams.embed&&ca&&(Z||mxEvent.isShiftDown(W))?(ca=this.getCurrentFile(),
-null!=ca&&ca.isModified()||this.fileLoaded(null,!0),this.openFiles(S,!0,mxUtils.bind(this,function(){var wa=this.getCurrentFile();null!=wa&&wa.fileChanged()}))):(mxEvent.isAltDown(W)&&(aa=N=null),this.importFiles(S,N,aa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(W),null,null,mxEvent.isShiftDown(W),W));else{mxEvent.isAltDown(W)&&(aa=N=0);var ea=0<=mxUtils.indexOf(W.dataTransfer.types,"text/uri-list")?W.dataTransfer.getData("text/uri-list"):null;S=this.extractGraphModelFromEvent(W,
-null!=this.pages);if(null!=S)f.setSelectionCells(this.importXml(S,N,aa,!0));else if(0<=mxUtils.indexOf(W.dataTransfer.types,"text/html")){var ka=W.dataTransfer.getData("text/html");S=document.createElement("div");S.innerHTML=Graph.sanitizeHtml(ka);var ra=null;ca=S.getElementsByTagName("img");null!=ca&&1==ca.length?(ka=ca[0].getAttribute("src"),null==ka&&(ka=ca[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ka)||(ra=!0)):(ca=S.getElementsByTagName("a"),null!=ca&&1==ca.length?ka=
-ca[0].getAttribute("href"):(S=S.getElementsByTagName("pre"),null!=S&&1==S.length&&(ka=mxUtils.getTextContent(S[0]))));var sa=!0,ma=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(ka,N,aa,!0,ra,null,sa,mxEvent.isControlDown(W)))});ra&&null!=ka&&ka.length>this.resampleThreshold?this.confirmImageResize(function(wa){sa=wa;ma()},mxEvent.isControlDown(W)):ma()}else null!=ea&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ea)?this.loadImage(decodeURIComponent(ea),mxUtils.bind(this,function(wa){var va=
-Math.max(1,wa.width);wa=Math.max(1,wa.height);var za=this.maxImageSize;za=Math.min(1,Math.min(za/Math.max(1,va)),za/Math.max(1,wa));f.setSelectionCell(f.insertVertex(null,null,"",N,aa,va*za,wa*za,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ea+";"))}),mxUtils.bind(this,function(wa){f.setSelectionCells(this.insertTextAt(ea,N,aa,!0))})):0<=mxUtils.indexOf(W.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(W.dataTransfer.getData("text/plain"),
-N,aa,!0))}}W.stopPropagation();W.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});
-f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var W=parseInt(this.div.offsetLeft),ca=parseInt(this.div.offsetWidth),S=c.embedViewport.x+c.embedViewport.width,Z=parseInt(this.div.offsetTop),da=parseInt(this.div.offsetHeight),N=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,
-Math.min(W,S-ca))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(Z,N-da))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var Q=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(W,ca){Q.call(this,W,ca);c.hideCurrentMenu()};var ba=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(W,ca){ba.call(this,W,ca);c.hideCurrentMenu()};
-if(!this.editor.chromeless||this.editor.editable){n=Editor.currentTheme;if("simple"==n||"sketch"==n)this.doSetCurrentTheme(n,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(I=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,I<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==n&&I<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==n&&(this.lastWindowWidth=I)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();
-"kennedy"==n&&(I=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,I<Editor.smallScreenWidth&&(this.formatWidth=0),I<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=I)}n=!1;if(null!=urlParams.dark)n=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)n="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||n&&"auto"!=mxSettings.settings.darkMode||(n=mxSettings.settings.darkMode);"auto"==n&&this.isAutoDarkModeSupported()&&
-(n=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof n?"1"==n:n);if(this.isAutoDarkModeSupported())try{var X=window.matchMedia("(prefers-color-scheme: dark)"),Y=mxUtils.bind(this,function(W){this.isAutoDarkMode()&&this.setDarkMode(W.matches)});X.addEventListener("change",Y);this.destroyFunctions.push(function(){X.removeEventListener("change",Y)})}catch(W){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):
-Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&this.setHighContrast(!0);Editor.isSettingsEnabled()&&null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages);this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(W,ca){f.enableFlowAnimation=
+this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(X,ca){0<this.editor.graph.getSelectionCount()?(X=this.editor.graph.getSelectionCell(),X=this.editor.graph.getModel().getStyle(X),this.styleInput.value=X||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var L=this.isSelectionAllowed;this.isSelectionAllowed=function(X){return mxEvent.getSource(X)==this.styleInput?!0:L.apply(this,arguments)}}n=document.getElementById("geInfo");
+null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var P=null;mxEvent.addListener(f.container,"dragleave",function(X){f.isEnabled()&&(null!=P&&(P.parentNode.removeChild(P),P=null),X.stopPropagation(),X.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(X){null==P&&(P=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();X.stopPropagation();X.preventDefault()}));mxEvent.addListener(f.container,
+"drop",mxUtils.bind(this,function(X){null!=P&&(P.parentNode.removeChild(P),P=null);if(f.isEnabled()){var ca=mxUtils.convertPoint(f.container,mxEvent.getClientX(X),mxEvent.getClientY(X)),S=X.dataTransfer.files,Z=f.view.translate,da=f.view.scale,N=ca.x/da-Z.x,aa=ca.y/da-Z.y;if(0<S.length)ca=this.isBlankFile()&&!this.canUndo(),Z=1==S.length&&(EditorUi.isVisioFilename(S[0].name)||/(\.drawio)$/i.test(S[0].name)||/(\.xml)$/i.test(S[0].name)),"1"!=urlParams.embed&&ca&&(Z||mxEvent.isShiftDown(X))?(ca=this.getCurrentFile(),
+null!=ca&&ca.isModified()||this.fileLoaded(null,!0),this.openFiles(S,!0,mxUtils.bind(this,function(){var wa=this.getCurrentFile();null!=wa&&wa.fileChanged()}))):(mxEvent.isAltDown(X)&&(aa=N=null),this.importFiles(S,N,aa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(X),null,null,mxEvent.isShiftDown(X),X));else{mxEvent.isAltDown(X)&&(aa=N=0);var ea=0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")?X.dataTransfer.getData("text/uri-list"):null;S=this.extractGraphModelFromEvent(X,
+null!=this.pages);if(null!=S)f.setSelectionCells(this.importXml(S,N,aa,!0));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")){var ka=X.dataTransfer.getData("text/html");S=document.createElement("div");S.innerHTML=Graph.sanitizeHtml(ka);var ra=null;ca=S.getElementsByTagName("img");null!=ca&&1==ca.length?(ka=ca[0].getAttribute("src"),null==ka&&(ka=ca[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ka)||(ra=!0)):(ca=S.getElementsByTagName("a"),null!=ca&&1==ca.length?ka=
+ca[0].getAttribute("href"):(S=S.getElementsByTagName("pre"),null!=S&&1==S.length&&(ka=mxUtils.getTextContent(S[0]))));var sa=!0,ma=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(ka,N,aa,!0,ra,null,sa,mxEvent.isControlDown(X)))});ra&&null!=ka&&ka.length>this.resampleThreshold?this.confirmImageResize(function(wa){sa=wa;ma()},mxEvent.isControlDown(X)):ma()}else null!=ea&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ea)?this.loadImage(decodeURIComponent(ea),mxUtils.bind(this,function(wa){var va=
+Math.max(1,wa.width);wa=Math.max(1,wa.height);var za=this.maxImageSize;za=Math.min(1,Math.min(za/Math.max(1,va)),za/Math.max(1,wa));f.setSelectionCell(f.insertVertex(null,null,"",N,aa,va*za,wa*za,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ea+";"))}),mxUtils.bind(this,function(wa){f.setSelectionCells(this.insertTextAt(ea,N,aa,!0))})):0<=mxUtils.indexOf(X.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(X.dataTransfer.getData("text/plain"),
+N,aa,!0))}}X.stopPropagation();X.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});
+f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var X=parseInt(this.div.offsetLeft),ca=parseInt(this.div.offsetWidth),S=c.embedViewport.x+c.embedViewport.width,Z=parseInt(this.div.offsetTop),da=parseInt(this.div.offsetHeight),N=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,
+Math.min(X,S-ca))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(Z,N-da))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var Q=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(X,ca){Q.call(this,X,ca);c.hideCurrentMenu()};var ba=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(X,ca){ba.call(this,X,ca);c.hideCurrentMenu()};
+if(!this.editor.chromeless||this.editor.editable){n=Editor.currentTheme;if("simple"==n||"sketch"==n)this.doSetCurrentTheme(n,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==n&&J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==n&&(this.lastWindowWidth=J)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();
+"kennedy"==n&&(J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,J<Editor.smallScreenWidth&&(this.formatWidth=0),J<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=J)}n=!1;if(null!=urlParams.dark)n=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)n="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||n&&"auto"!=mxSettings.settings.darkMode||(n=mxSettings.settings.darkMode);"auto"==n&&this.isAutoDarkModeSupported()&&
+(n=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof n?"1"==n:n);if(this.isAutoDarkModeSupported())try{var W=window.matchMedia("(prefers-color-scheme: dark)"),Y=mxUtils.bind(this,function(X){this.isAutoDarkMode()&&this.setDarkMode(X.matches)});W.addEventListener("change",Y);this.destroyFunctions.push(function(){W.removeEventListener("change",Y)})}catch(X){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):
+Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&this.setHighContrast(!0);Editor.isSettingsEnabled()&&null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages);this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(X,ca){f.enableFlowAnimation=
Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var x=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,
f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));f=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&
this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}x.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,n=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(K){mxEvent.getSource(K)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(K),
@@ -14549,21 +14559,21 @@ v=mxEvent.getClientY(K);n.popupMenuHandler.hideMenu();mxEvent.consume(K)}));r=r.
Math.max(20,B+mxEvent.getClientX(K)-t)+"px",C=!0);null!=v&&(this.diagramContainer.style.height=Math.max(20,E+mxEvent.getClientY(K)-v)+"px",C=!0);C&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(K){null==t&&null==v||mxEvent.consume(K);v=t=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius=
"4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(K){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(K){this.diagramContainer.style.width="10px";this.diagramContainer.style.height=
"10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){l.innerHTML="&nbsp;";l.focus();try{var t=document.createRange();t.selectNodeContents(l);var v=window.getSelection();
-null!=v&&(v.removeAllRanges(),v.addRange(t))}catch(B){}},0)}var f=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position="absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";
-l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML="&nbsp;";this.clipboardElt=l;var n=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(t){var v=mxEvent.getSource(t);null==f.container||!f.isEnabled()||f.isMouseDown||
-f.isEditing()||null!=this.dialog||"INPUT"==v.nodeName||"TEXTAREA"==v.nodeName&&v!==this.typingShim||"true"==v.contentEditable||224!=t.keyCode&&(mxClient.IS_MAC||17!=t.keyCode)&&(!mxClient.IS_MAC||91!=t.keyCode&&93!=t.keyCode)||n||(l.style.left=f.container.scrollLeft+10+"px",l.style.top=f.container.scrollTop+10+"px",t=f.container.scrollLeft,v=f.container.scrollTop,f.container.appendChild(l),n=!0,l.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=t,f.container.scrollTop=v)}));
-mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(t){var v=t.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=v&&17!=v&&91!=v&&93!=v||(n=!1,l.parentNode.removeChild(l),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(v){this.handleError(v)}}));mxEvent.addListener(l,"cut",
-mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(v){this.handleError(v)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(t){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML="&nbsp;",l.focus(),null!=t.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(t,l,!0,!0)),!mxEvent.isConsumed(t)){var v=f.container.scrollLeft,B=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=
-v,f.container.scrollTop=B,Graph.removePasteFormatting(l.firstChild),this.pasteCells(t,l,!1,!0)}catch(E){this.handleError(E)}}),0)}}catch(E){this.handleError(E)}}),!0);var r=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==l?!0:r.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==
-c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),
-this.restoreScrollState(f);return l};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,n=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,n-=this.embedViewport.y):(l+=this.embedViewport.x,n+=this.embedViewport.y));f={x:l,y:n,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=
-this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var n=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-n.x;c.y-=c.boundingRect.y-n.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&
-(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var n=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=n&&null!=n.getAttribute("class");if(!f&&null!=n){n=n.getAttribute("title");var r=this.getCurrentFile();
-r=null!=r?r.savingStatusKey:DrawioFile.prototype.savingStatusKey;n==mxResources.get(r)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(r))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";n=32>=c.clientWidth;c.style.visibility=n&&""==this.editor.getStatus()?"hidden":"";if(n||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=
-0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=
-function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),f=0;f<
-c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=
-null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=
+null!=v&&(v.removeAllRanges(),v.addRange(t))}catch(B){}},0)}var f=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");this.isVirtualKeyboardDevice()&&l.setAttribute("inputmode","none");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position=
+"absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1px";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML="&nbsp;";this.clipboardElt=l;var n=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(t){var v=
+mxEvent.getSource(t);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==v.nodeName||"TEXTAREA"==v.nodeName&&v!==this.typingShim||"true"==v.contentEditable||224!=t.keyCode&&(mxClient.IS_MAC||17!=t.keyCode)&&(!mxClient.IS_MAC||91!=t.keyCode&&93!=t.keyCode)||n||(l.style.left=f.container.scrollLeft+10+"px",l.style.top=f.container.scrollTop+10+"px",t=f.container.scrollLeft,v=f.container.scrollTop,f.container.appendChild(l),n=!0,l.focus({preventScroll:!0}),document.execCommand("selectAll",
+!1,null),f.container.scrollLeft=t,f.container.scrollTop=v)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(t){var v=t.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=v&&17!=v&&91!=v&&93!=v||(n=!1,l.parentNode.removeChild(l),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),
+c()}catch(v){this.handleError(v)}}));mxEvent.addListener(l,"cut",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(v){this.handleError(v)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(t){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML="&nbsp;",l.focus(),null!=t.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(t,l,!0,!0)),!mxEvent.isConsumed(t)){var v=f.container.scrollLeft,B=f.container.scrollTop;
+window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=v,f.container.scrollTop=B,Graph.removePasteFormatting(l.firstChild),this.pasteCells(t,l,!1,!0)}catch(E){this.handleError(E)}}),0)}}catch(E){this.handleError(E)}}),!0);var r=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==l?!0:r.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};
+EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),
+this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return l};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,n=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,n-=this.embedViewport.y):(l+=this.embedViewport.x,n+=this.embedViewport.y));f={x:l,y:n,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};
+EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var n=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-n.x;c.y-=c.boundingRect.y-n.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,
+function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var n=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=n&&null!=n.getAttribute("class");
+if(!f&&null!=n){n=n.getAttribute("title");var r=this.getCurrentFile();r=null!=r?r.savingStatusKey:DrawioFile.prototype.savingStatusKey;n==mxResources.get(r)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(r))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";n=32>=c.clientWidth;c.style.visibility=n&&""==this.editor.getStatus()?"hidden":"";if(n||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?
+(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),
+this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=
+function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),
+this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=
null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.restoreVisibleWindows=function(){if(Editor.isSettingsEnabled()){var c={layers:"layers",outline:"outline",tags:"tags"},f;for(f in c){var l=mxSettings.getWindowState(f);null!=
l&&l.visible&&(l=this.actions.get(c[f]),null!=l&&l.funct())}}};EditorUi.prototype.saveWindowState=function(c,f){f=f.window;var l=f.minimized&&null!=f.height?parseInt(f.height):parseInt(f.div.style.height);mxSettings.setWindowState(c,{x:f.getX(),y:f.getY(),w:parseInt(f.div.style.width),h:l,visible:f.isVisible(),minimized:f.minimized||!1,dockState:f.dockState||null,dockAnchorRight:f._dockAnchorRight||null,dockAnchorBottom:f._dockAnchorBottom||null,dockOffsetX:f._dockOffsetX||null,dockOffsetY:f._dockOffsetY||
null});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,
@@ -14595,7 +14605,7 @@ this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSi
this.formatWindow.window.setVisible(!0);(1E3>E||690>K)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var F=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):F.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,
this.defaultSidebarWidth));var n=this.hsplitPosition,r=mxUtils.bind(this,function(){this.hsplitPosition=t;this.refresh();f||(this.diagramContainer.scrollLeft-=n-this.hsplitPosition)}),t=c?l:0,v=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(0)":"translateX(-100%)");0!=t&&r();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,
"transition","transform "+v+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==t&&r();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*v)}),0)}};EditorUi.prototype.isShapesPanelVisible=
-function(){return 0<this.hsplitPosition};var J=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():J.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(v,B){var E=this.menus.get(v);v=this.createMenuElement(B,mxUtils.bind(this,function(){E.funct.apply(this,arguments)}));v.setAttribute("title",B);v.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";
+function(){return 0<this.hsplitPosition};var I=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():I.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(v,B){var E=this.menus.get(v);v=this.createMenuElement(B,mxUtils.bind(this,function(){E.funct.apply(this,arguments)}));v.setAttribute("title",B);v.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";
v.className="geButton";c.parentNode.appendChild(v);return v});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),
f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=f("newLibrary","");l.style.left="0px";l.style.right="50%";var n=document.createElement("span");l.appendChild(n);var r=f("openLibraryFrom","");r.style.borderLeftWidth="1px";r.style.left="50%";r.style.right="0px";var t=document.createElement("span");r.appendChild(t);this.dependsOnLanguage(mxUtils.bind(this,
function(){n.innerHTML="";mxUtils.write(n,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));t.innerHTML="";mxUtils.write(t,mxResources.get("openLibraryFrom"));r.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-
@@ -14659,15 +14669,15 @@ v)})["catch"](function(){l(null)});else v.text().then(mxUtils.bind(this,function
if(null!=l)for(;0<l.length;)l[0].parentNode.removeChild(l[0]);if(null!=f.firstChild&&f.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=f.firstChild.nextSibling&&f.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==f.firstChild.nodeName&&"A"==f.firstChild.nextSibling.nodeName&&null==f.firstChild.nextSibling.nextSibling){var n=null==f.firstChild.nextSibling.innerText?mxUtils.getTextContent(f.firstChild.nextSibling):f.firstChild.nextSibling.innerText;n==f.firstChild.nextSibling.getAttribute("href")&&
(mxUtils.setTextContent(f,n),asHtml=!1)}if(""==f.textContent&&(l=f.getElementsByTagName("img"),1==l.length&&(n=l[0].getAttribute("src"),l=null,null!=n))){if(Editor.isPngDataUrl(n)){var r=Editor.extractGraphModelFromPng(n);null!=r&&0<r.length&&(l=r)}else if("data:image/svg+xml;base64,"==n.substring(0,26)){img=this.base64ToBlob(n.substring(n.indexOf(",")+1),"image/svg+xml");n=Graph.getSvgFromDataUri(n);try{r=mxUtils.parseXml(n).documentElement.getAttribute("content"),this.isCompatibleString(r)&&(l=
r)}catch(t){}}null!=l&&(mxUtils.setTextContent(f,l),asHtml=!1)}asHtml?Graph.removePasteFormatting(f):f.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,l){this.showDialog((new PrintDialog(this,c,f,l)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var l=this.editor,n=l.graph,r=this.getPageIndex(this.currentPage),t=null!=r?r+1:1,v=mxUtils.bind(this,
-function(d,p,A,G){var I=d.useCssTransforms,L=d.currentTranslate,P=d.currentScale,Q=d.view.translate,ba=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var X=d.getGraphBounds(),Y=0,W=0,ca=mxRectangle.fromRectangle(d.pageFormat),S=f.fit||f.crop||!d.pageVisible,Z=f.scale;ca.width*=d.pageScale;ca.height*=d.pageScale;var da=1;if(f.fit){da=f.sheetsAcross;var N=f.sheetsDown;isNaN(Z)||(ca.width=
-Math.ceil(ca.width*Z),ca.height=Math.ceil(ca.height*Z));da=Math.min(ca.height*N/(X.height/d.view.scale),ca.width*da/(X.width/d.view.scale))}else da=isNaN(Z)?1:Z;da*=1;!S&&d.pageVisible?(Z=d.getPageLayout(),Y-=Z.x*ca.width,W-=Z.y*ca.height):S=!0;f.crop&&(f.selection&&(X=n.getBoundingBox(n.getSelectionCells())),ca.width=(X.width+1)*da/d.view.scale,ca.height=(X.height+1)*da/d.view.scale);ca.width*=1;ca.height*=1;G=null!=G?"page/id,"+G:null;X=f.selection?d.getBoundingBox(d.getSelectionCells()):d.getGraphBounds();
-if(null!=X){Z=d.view.scale/da;N=X.width;var aa=X.height,ea=Y,ka=W;S||(ea-=d.view.translate.x*da,ka-=d.view.translate.y*da,N+=X.x,aa+=X.y);C+=Math.max(1,Math.ceil((N/Z+ea)/(ca.width+1)))*Math.max(1,Math.ceil((aa/Z+ka)/(ca.height+1)))}R=R||C>this.maxPrintPageCount;if(!R)if(null==p){p=PrintDialog.createPrintPreview(d,da,null,0,Y,W,S);p.title=this.getBaseFilename(!0);p.pageSelector=!1;p.mathEnabled=!1;Y=f.border;isNaN(Y)||(p.pageMargin=Y);var ra=p.writeHead;p.writeHead=function(wa,va){va=null!=va?va:
+function(d,p,A,G){var J=d.useCssTransforms,L=d.currentTranslate,P=d.currentScale,Q=d.view.translate,ba=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var W=d.getGraphBounds(),Y=0,X=0,ca=mxRectangle.fromRectangle(d.pageFormat),S=f.fit||f.crop||!d.pageVisible,Z=f.scale;ca.width*=d.pageScale;ca.height*=d.pageScale;var da=1;if(f.fit){da=f.sheetsAcross;var N=f.sheetsDown;isNaN(Z)||(ca.width=
+Math.ceil(ca.width*Z),ca.height=Math.ceil(ca.height*Z));da=Math.min(ca.height*N/(W.height/d.view.scale),ca.width*da/(W.width/d.view.scale))}else da=isNaN(Z)?1:Z;da*=1;!S&&d.pageVisible?(Z=d.getPageLayout(),Y-=Z.x*ca.width,X-=Z.y*ca.height):S=!0;f.crop&&(f.selection&&(W=n.getBoundingBox(n.getSelectionCells())),ca.width=(W.width+1)*da/d.view.scale,ca.height=(W.height+1)*da/d.view.scale);ca.width*=1;ca.height*=1;G=null!=G?"page/id,"+G:null;W=f.selection?d.getBoundingBox(d.getSelectionCells()):d.getGraphBounds();
+if(null!=W){Z=d.view.scale/da;N=W.width;var aa=W.height,ea=Y,ka=X;S||(ea-=d.view.translate.x*da,ka-=d.view.translate.y*da,N+=W.x,aa+=W.y);C+=Math.max(1,Math.ceil((N/Z+ea)/(ca.width+1)))*Math.max(1,Math.ceil((aa/Z+ka)/(ca.height+1)))}R=R||C>this.maxPrintPageCount;if(!R)if(null==p){p=PrintDialog.createPrintPreview(d,da,null,0,Y,X,S);p.title=this.getBaseFilename(!0);p.pageSelector=!1;p.mathEnabled=!1;Y=f.border;isNaN(Y)||(p.pageMargin=Y);var ra=p.writeHead;p.writeHead=function(wa,va){va=null!=va?va:
"";f.shadows||(va+='g[style*="filter: drop-shadow("] {\n filter: none !important;\n}\n');mxClient.IS_GC&&(va+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=l.fontCss&&(va+=l.fontCss);ra.apply(this,arguments);for(var za=d.getCustomFonts(),Ba=0;Ba<za.length;Ba++){var ua=za[Ba].name,qa=za[Ba].url;Graph.isCssFontUrl(qa)?wa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(qa))+'" charset="UTF-8" type="text/css">'):(wa.writeln('<style type="text/css">'),
wa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(ua))+'";\nsrc: url("'+mxUtils.htmlEntities(Graph.escapeCssString(qa))+'");\n}'),wa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var sa=p.drawBackgroundImage;p.drawBackgroundImage=function(wa){sa.apply(this,arguments);null!=wa.node&&(EditorUi.embedSvgImages(wa.node),n.disableSvgLinks(wa.node,function(va){va.setAttribute("href","javascript:void(0)")}))}}var ma=p.addGraphFragment;p.addGraphFragment=function(wa,
va,za,Ba,ua,qa){ma.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:ua.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var ia=ua.getElementsByTagName("svg"),ja=0;ja<ia.length;ja++)d.addSvgShadow(ia[ja])};f.grid&&(p.gridSize=d.gridSize,p.gridSteps=d.view.gridSteps,p.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:d.view.gridColor);p.isCellVisible=f.selection?function(wa){return d.isCellSelected(wa)&&d.isCellVisible(wa)}:function(wa){return d.isCellVisible(wa)};
-p.open(null,null,A,!0,G,ca,f.selection?d.getSelectionCells():null)}else{X=d.background;if(null==X||""==X||X==mxConstants.NONE)X="#ffffff";p.backgroundColor=X;p.autoOrigin=S;f.grid&&(p.gridSize=d.gridSize,p.gridSteps=d.view.gridSteps,p.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:d.view.gridColor);p.isCellVisible=f.selection?function(wa){return d.isCellSelected(wa)&&d.isCellVisible(wa)}:function(wa){return d.isCellVisible(wa)};p.appendGraph(d,da,Y,W,A,!0,G,ca,f.selection?d.getSelectionCells():
-null);A=d.getCustomFonts();if(null!=p.wnd)for(ca=0;ca<A.length;ca++)Y=A[ca].name,W=A[ca].url,Graph.isCssFontUrl(W)?p.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(W))+'" charset="UTF-8" type="text/css">'):(p.wnd.document.writeln('<style type="text/css">'),p.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(Y))+'";\nsrc: url("'+mxUtils.htmlEntities(Graph.escapeCssString(W))+'");\n}'),p.wnd.document.writeln("</style>"))}I&&
-(d.useCssTransforms=I,d.currentTranslate=L,d.currentScale=P,d.view.translate=Q,d.view.scale=ba);return p}),B=f.pagesFrom,E=f.pagesTo,K=!f.allPages,C=0,R=!1;r=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{K&&(K=f.selection||B==t&&E==t);if(!K&&null!=this.pages&&this.pages.length){K=0;t=this.pages.length-1;f.allPages||(K=parseInt(B)-1,t=parseInt(E)-1);for(var M=K;M<=t&&!R;M++){var O=this.pages[M];B=O==this.currentPage?n:null;if(null==B){B=this.createTemporaryGraph(n.stylesheet);
+p.open(null,null,A,!0,G,ca,f.selection?d.getSelectionCells():null)}else{W=d.background;if(null==W||""==W||W==mxConstants.NONE)W="#ffffff";p.backgroundColor=W;p.autoOrigin=S;f.grid&&(p.gridSize=d.gridSize,p.gridSteps=d.view.gridSteps,p.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:d.view.gridColor);p.isCellVisible=f.selection?function(wa){return d.isCellSelected(wa)&&d.isCellVisible(wa)}:function(wa){return d.isCellVisible(wa)};p.appendGraph(d,da,Y,X,A,!0,G,ca,f.selection?d.getSelectionCells():
+null);A=d.getCustomFonts();if(null!=p.wnd)for(ca=0;ca<A.length;ca++)Y=A[ca].name,X=A[ca].url,Graph.isCssFontUrl(X)?p.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(X))+'" charset="UTF-8" type="text/css">'):(p.wnd.document.writeln('<style type="text/css">'),p.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(Y))+'";\nsrc: url("'+mxUtils.htmlEntities(Graph.escapeCssString(X))+'");\n}'),p.wnd.document.writeln("</style>"))}J&&
+(d.useCssTransforms=J,d.currentTranslate=L,d.currentScale=P,d.view.translate=Q,d.view.scale=ba);return p}),B=f.pagesFrom,E=f.pagesTo,K=!f.allPages,C=0,R=!1;r=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{K&&(K=f.selection||B==t&&E==t);if(!K&&null!=this.pages&&this.pages.length){K=0;t=this.pages.length-1;f.allPages||(K=parseInt(B)-1,t=parseInt(E)-1);for(var M=K;M<=t&&!R;M++){var O=this.pages[M];B=O==this.currentPage?n:null;if(null==B){B=this.createTemporaryGraph(n.stylesheet);
B.shapeForegroundColor=n.shapeForegroundColor;B.shapeBackgroundColor=n.shapeBackgroundColor;E=!0;var U=K=!1,T=null,V=null;null==O.viewState&&null==O.root&&this.updatePageRoot(O);null!=O.viewState&&(E=O.viewState.pageVisible,K=O.viewState.mathEnabled,U=O.viewState.shadowVisible,T=O.viewState.background,V=O.viewState.backgroundImage,B.pageFormat=O.viewState.pageFormat,B.gridSize=O.viewState.gridSize,B.hiddenTags=O.viewState.hiddenTags||[]);null!=V&&null!=V.originalSrc&&(V=this.createImageForPageLink(V.originalSrc,
O));B.background=T;B.backgroundImage=null!=V?new mxImage(V.src,V.width,V.height,V.x,V.y):null;B.pageVisible=E;B.mathEnabled=K;B.shadowVisible=U;var fa=B.getGraphBounds;B.getGraphBounds=function(){var d=fa.apply(this,arguments),p=this.backgroundImage;if(null!=p&&null!=p.width&&null!=p.height){var A=this.view.translate,G=this.view.scale;d=mxRectangle.fromRectangle(d);d.add(new mxRectangle((A.x+p.x)*G,(A.y+p.y)*G,p.width*G,p.height*G))}return d};var y=B.getGlobalVariable;B.getGlobalVariable=function(d){return"page"==
d?O.getName():"pagenumber"==d?M+1:"pagecount"==d?null!=this.pages?this.pages.length:1:y.apply(this,arguments)};document.body.appendChild(B.container);this.updatePageRoot(O);B.model.setRoot(O.root)}r=v(B,r,M!=t,O.getId());B!=n&&B.container.parentNode.removeChild(B.container)}}else r=v(n);if(R)return null!=r&&null!=r.wnd&&r.wnd!=window&&r.wnd.close(),this.handleError({message:mxResources.get("drawingTooLarge")}),null;if(null==r||null==r.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});
@@ -14699,165 +14709,165 @@ n-r.x,y:l.y/n-r.y,width:l.width/n,height:l.height/n},containerSize:{width:f.cont
this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(r){l.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(r)}),"*")}),null,null,!0,n,1,this.embedExportBorder,null,this.embedExportTheme)}else c||l.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),
this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(r){c||this.handleError(r)}};EditorUi.prototype.whenScriptReady=function(c,f,l){if(c())f();else var n=0,r=window.setInterval(function(){c()?(window.clearInterval(r),f()):100<=++n&&(window.clearInterval(r),null!=l&&l())},100)};EditorUi.prototype.lastLayoutSpec=null;EditorUi.prototype.resolveLayoutList=function(c){if("string"===typeof c){c=
mxUtils.trim(c);if("["==c.charAt(0))return JSON.parse(c);if("undefined"===typeof LibavoidRouting||c!==LibavoidRouting.SHORTHAND&&c!==LibavoidRouting.LAYOUT_NAME){if("parallels"===c)return[{layout:"mxParallelEdgeLayout",config:{checkOverlap:!0}}];if("undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS&&null!=ElkLayout.MENU_PRESETS[c]){c=ElkLayout.MENU_PRESETS[c];var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),
-config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainer=function(){var c=this.editor.graph,f=1==c.getSelectionCount()?c.getSelectionCell():null;return null!=f&&c.model.isVertex(f)&&(c=c.getCellStyle(f).childLayout,null!=c&&"tableLayout"!=c&&"stackLayout"!=c&&"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var l=this.editor.graph,n=f,r=null,
-t=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));n=[];for(var v=0;v<f.length;v++){var B=f[v];if(null!=B&&("mxRadialTreeLayout"==B.layout||"mxOrgChartLayout"==B.layout||"mxFastOrganicLayout"==B.layout||"mxCircleLayout"==B.layout))throw Error("Not supported as childLayout: "+B.layout);if(null!=B&&null!=Graph.elkLayoutAlgorithms[B.layout]){var E={},K;for(K in B.config)E[K]=B.config[K];delete E.rootCellIds;delete E.preserveOrigin;
-null==E.resizeNodes&&(E.resizeNodes=!1);null==E.resizeLayoutRoot&&(E.resizeLayoutRoot=!0);"elkLayered"==B.layout&&null==E.extractIsolated&&(E.extractIsolated=!1);null!=E.corners&&(t=E.corners);if(null!=E.groupPadding&&(r=String(E.groupPadding),/[;=]/.test(r)))throw Error("Invalid groupPadding: "+r);B={layout:B.layout,config:E}}n.push(B)}l.createLayouts(n);n=Graph.encodeChildLayout(n)}if(0<=n.indexOf(";"))throw Error("Invalid childLayout: "+n);l.model.beginUpdate();try{var C=l.model.getStyle(c);l.setCellStyles("childLayout",
-n,[c]);null!=r&&l.setCellStyles("groupPadding",r,[c]);null!=t&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(l,c,t);l.model.getStyle(c)==C&&null!=l.layoutManager&&l.layoutManager.executeLayout(c,!1)}finally{l.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,l){var n=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS},function(){try{var r=n.resolveLayoutList(c);if(null!=r){n.lastLayoutSpec=
-r;var t=l?n.getSelectedLayoutContainer():null;null!=t&&Array.isArray(r)&&0<r.length?(n.setContainerChildLayout(t,r),null!=f&&f()):n.executeLayouts(n.editor.graph.createLayouts(r),f)}else n.handleError(Error("Unknown layout: "+c))}catch(v){n.handleError(v)}},function(){n.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.applyChildLayouts=function(c){var f=this.editor.graph,l=function(){try{f.executeAllChildLayouts()}catch(n){null!=window.console&&console.error(n)}null!=
-c&&c()};(function(){if("undefined"!==typeof ElkLayout)return!1;for(var n=f.getChildLayoutCells(),r=0;r<n.length;r++)try{for(var t=Graph.decodeChildLayout(f.getCellStyle(n[r]).childLayout),v=0;null!=t&&v<t.length;v++)if(null!=t[v]&&"string"===typeof Graph.elkLayoutAlgorithms[t[v].layout])return!0}catch(B){}return!1})()?this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout},l,l):l()};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&null==this.passThroughKeysListener&&
-(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,l=c.ctrlKey||c.metaKey,n=null!=c.key?c.key.toLowerCase():"",r=0;r<f.length;r++){var t=f[r];if(n===String(t.key).toLowerCase()&&l===!!t.ctrl&&c.shiftKey===!!t.shift&&c.altKey===!!t.alt){c.preventDefault();c.stopImmediatePropagation();null!=t.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:t.command}),"*");break}}}),window.addEventListener("keydown",
-this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};
-EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===typeof c.keyCode&&1==c.keyCode.length,l=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(l))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var n=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:c.shift?this.altShiftActions:this.altActions;null!=c.action?n[l]=c.action:delete n[l]}else null!=c.action?(n=mxUtils.bind(this,function(){var r=this.actions.get(c.action);
-null!=r&&r.isEnabled()&&r.funct.apply(this,arguments)}),c.control?c.shift?this.keyHandler.bindControlShiftKey(l,n):this.keyHandler.bindControlKey(l,n):c.shift?this.keyHandler.bindShiftKey(l,n):this.keyHandler.bindKey(l,n)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:this.keyHandler.normalKeys)[l];null!=c.action&&(n=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=l&&57>=l||65<=l&&90>=l?String.fromCharCode(l):EditorUi.keyNames[l],
-null!=n&&null!=f&&(n.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,l=!1,n=!1,r=null,t=null;this.installPassThroughKeys();var v=mxUtils.bind(this,function(K,C){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});
-this.editor.graph.model.addListener(mxEvent.CHANGE,v);mxEvent.addListener(window,"message",mxUtils.bind(this,function(K){if(K.source==(this.embedMessageSource||window.opener||window.parent)){var C=K.data,R=null,M=null,O=mxUtils.bind(this,function(pa){if(null!=pa&&"function"===typeof pa.charAt&&"<"!=pa.charAt(0))try{Editor.isPngDataUrl(pa)?pa=Editor.extractGraphModelFromPng(pa):"data:image/svg+xml;base64,"==pa.substring(0,26)?pa=atob(pa.substring(26)):"data:image/svg+xml;utf8,"==pa.substring(0,24)&&
-(pa=pa.substring(24)),null!=pa&&(""==pa.trim()?pa=null:"%"==pa.charAt(0)?pa=decodeURIComponent(pa):"<"!=pa.charAt(0)&&(pa=Graph.decompress(pa)))}catch(oa){}return pa});if("json"==urlParams.proto){var U=!1;try{C=JSON.parse(C),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[K],"data",[C])}catch(pa){C=null}try{var T=C;if(null==C)return;if("dialog"==C.action){this.showError(null!=C.titleKey?mxResources.get(C.titleKey):C.title,null!=C.messageKey?mxResources.get(C.messageKey):mxUtils.htmlEntities(C.message),
-null!=C.buttonKey?mxResources.get(C.buttonKey):C.button);null!=C.modified&&(this.editor.modified=C.modified);return}if("layout"==C.action){this.executeLayoutSpec(C.layouts,mxUtils.bind(this,function(){var pa=this.createLoadMessage("layout");pa.message=C;B.postMessage(JSON.stringify(pa),"*")}));return}if("prompt"==C.action){this.spinner.stop();var V=new FilenameDialog(this,C.defaultValue||"",null!=C.okKey?mxResources.get(C.okKey):C.ok,function(pa){null!=pa?B.postMessage(JSON.stringify({event:"prompt",
-value:pa,message:C}),"*"):B.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")},null!=C.titleKey?mxResources.get(C.titleKey):C.title,null,null,null,null,function(){B.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")});this.showDialog(V.container,300,80,!0,!1);V.init();return}if("draft"==C.action){var fa=O(C.xml);this.spinner.stop();V=new DraftDialog(this,mxResources.get("draftFound",[C.name||this.defaultFilename]),fa,mxUtils.bind(this,function(){this.hideDialog();
-B.postMessage(JSON.stringify({event:"draft",result:"edit",message:C}),"*")}),mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"discard",message:C}),"*")}),C.editKey?mxResources.get(C.editKey):null,C.discardKey?mxResources.get(C.discardKey):null,C.ignore?mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"ignore",message:C}),"*")}):null);this.showDialog(V.container,640,480,!0,!1,mxUtils.bind(this,function(pa){pa&&
-this.actions.get("exit").funct()}));try{V.init()}catch(pa){B.postMessage(JSON.stringify({event:"draft",error:pa.toString(),message:C}),"*")}return}if("template"==C.action){this.spinner.stop();var y=1==C.enableRecent,d=1==C.enableSearch,p=1==C.enableCustomTemp;V=new NewDialog(this,!1,C.templatesOnly?!1:null!=C.callback,mxUtils.bind(this,function(pa,oa,Da,Fa){pa=pa||this.emptyDiagramXml;null!=C.callback?B.postMessage(JSON.stringify({event:"template",xml:pa,blank:pa==this.emptyDiagramXml,name:oa,tempUrl:Da,
-libs:Fa,builtIn:!0,message:C}),"*"):(c(pa,K,pa!=this.emptyDiagramXml,C.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,y?mxUtils.bind(this,function(pa){this.remoteInvoke("getRecentDiagrams",[null],null,pa,function(){pa(null,"Network Error!")})}):null,d?mxUtils.bind(this,function(pa,oa){this.remoteInvoke("searchDiagrams",[pa,null],null,oa,function(){oa(null,"Network Error!")})}):null,mxUtils.bind(this,function(pa,oa,Da){B.postMessage(JSON.stringify({event:"template",
-docUrl:pa,info:oa,name:Da}),"*")}),null,null,p?mxUtils.bind(this,function(pa){this.remoteInvoke("getCustomTemplates",null,null,pa,function(){pa({},0)})}):null,1==C.withoutType,null,C.templatesOnly);this.showDialog(V.container,620,460,!0,!1,mxUtils.bind(this,function(pa){null!=this.sidebar&&this.sidebar.hideTooltip();pa&&!C.noExitOnCancel&&this.actions.get("exit").funct()}));V.init();return}if("textContent"==C.action){var A=this.getDiagramTextContent();B.postMessage(JSON.stringify({event:"textContent",
-data:A,message:C}),"*");return}if("status"==C.action){this.updateStatus(mxUtils.bind(this,function(){null!=C.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(C.messageKey))):null!=C.message&&this.editor.setStatus(mxUtils.htmlEntities(C.message))}));null!=C.modified&&(this.editor.modified=C.modified);return}if("spinner"==C.action){var G=null!=C.messageKey?mxResources.get(C.messageKey):C.message;null==C.show||C.show?this.spinner.spin(document.body,G):this.spinner.stop();return}if("exit"==
-C.action){this.actions.get("exit").funct();return}if("viewport"==C.action){if(null!=C.viewport){var I=this.editor.graph,L=I.view.translate.x,P=I.view.translate.y;this.embedViewport=C.viewport;I.refresh();this.diagramContainer.scrollTop-=(P-I.view.translate.y)*I.view.scale;this.diagramContainer.scrollLeft-=(L-I.view.translate.x)*I.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==C.action){var Q=this.actions.get(C.actionName);null!=Q&&Q.funct();return}if("resetEditor"==
-C.action){I=this.editor.graph;I.isEditing()&&I.stopEditing(!1);this.hideCurrentMenu();I.popupMenuHandler.hideMenu();I.clearSelection();return}if("fit"==C.action){I=this.editor.graph;var ba=I.maxFitScale;I.maxFitScale=null!=C.maxScale?C.maxScale:1;I.fit(null!=C.border?C.border:16,null,null,null,null,!0);I.maxFitScale=ba;G=this.createLoadMessage("fit");G.message=C;B.postMessage(JSON.stringify(G),"*");return}if("viewbox"==C.action){var X=EditorUi.parseViewBox(C.viewbox);null!=X&&this.applyViewBox(X);
-G=this.createLoadMessage("viewbox");G.message=C;B.postMessage(JSON.stringify(G),"*");return}if("fullscreenChanged"==C.action){var Y=null;try{var W=this.diagramContainer.getAttribute("data-scrollState");null!=W&&(this.diagramContainer.removeAttribute("data-scrollState"),Y=JSON.parse(W))}catch(pa){}Editor.inlineFullscreen=C.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=Y&&this.restoreScrollState(Y);return}if("snapshot"==C.action){this.sendEmbeddedSvgExport(!0);return}if("export"==
-C.action){if("png"==C.format||"xmlpng"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){var ca=null!=C.xml?C.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);I=this.editor.graph;var S=mxUtils.bind(this,function(pa,oa){if(C.withSvg)C.withSvg=!1,this.getEmbeddedSvg(ca,this.editor.graph,null,!0,function(Fa){S(pa,Fa)},null,null,C.embedImages,this.editor.graph.background,C.scale,C.border,C.shadow,"auto",null,C.embedFonts);
-else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Da=this.createLoadMessage("export");Da.format=C.format;Da.message=T;Da.data=pa;Da.svg=oa;Da.xml=ca;B.postMessage(JSON.stringify(Da),"*")}}),Z=mxUtils.bind(this,function(pa){null==pa&&(pa=Editor.blankImage);"xmlpng"==C.format&&(pa=Editor.writeGraphModelToPng(pa,"tEXt","mxfile",encodeURIComponent(ca)));I!=this.editor.graph&&I.container.parentNode.removeChild(I.container);S(pa)}),da=C.pageId||(null!=this.pages?C.currentPage?this.currentPage.getId():
-this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var N=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=da){var pa=I.getGlobalVariable;I=this.createTemporaryGraph(I.getStylesheet());for(var oa,Da=0;Da<this.pages.length;Da++)if(this.pages[Da].getId()==da){oa=this.updatePageRoot(this.pages[Da]);break}null==oa&&(oa=this.currentPage);I.getGlobalVariable=function(Ma){return"page"==Ma?oa.getName():"pagenumber"==Ma?1:pa.apply(this,arguments)};document.body.appendChild(I.container);
-I.model.setRoot(oa.root)}if(null!=C.layerIds){var Fa=I.model,Ia=Fa.getChildCells(Fa.getRoot()),Ha=Object.create(null);for(Da=0;Da<C.layerIds.length;Da++)Ha[C.layerIds[Da]]=!0;for(Da=0;Da<Ia.length;Da++)Fa.setVisible(Ia[Da],Ha[Ia[Da].id]||!1)}Da=null;C.keepTheme&&(Da=Editor.isDarkMode()?"dark":"light");null==C.width&&0<this.maxCanvasExportArea&&(Ia=I.getGraphBounds(),Ha=null!=C.border?C.border:0,Fa=Math.ceil(Ia.width/I.view.scale)+2*Ha,Ia=Math.ceil(Ia.height/I.view.scale)+2*Ha,Ha=null!=C.scale?C.scale:
-1,Fa*Ia*Ha*Ha>this.maxCanvasExportArea&&(C.scale=Math.sqrt(this.maxCanvasExportArea/(Fa*Ia))));this.editor.exportToCanvas(mxUtils.bind(this,function(Ma){Z(Ma.toDataURL("image/png"))}),C.width,null,C.background,mxUtils.bind(this,function(){Z(null)}),null,null,C.scale,C.transparent,C.shadow,null,I,C.border,null,C.grid,Da,C.size)});null!=C.xml&&0<C.xml.length&&(l=!0,this.setFileData(ca),l=!1);N()}else this.isRemoteExportEnabled()?(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==C.format?
-"1":"0")+(null!=da?"&pageId="+da:"")+(null!=C.layerIds&&0<C.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:C.layerIds})):"")+(null!=C.scale?"&scale="+C.scale:"")+"&base64=1&xml="+encodeURIComponent(ca))).send(mxUtils.bind(this,function(pa){200<=pa.getStatus()&&299>=pa.getStatus()?S("data:image/png;base64,"+pa.getText()):Z(null)}),mxUtils.bind(this,function(){Z(null)})):Z(null)}}else if(N=mxUtils.bind(this,function(){var pa=this.createLoadMessage("export");pa.message=C;if("html2"==
-C.format||"html"==C.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var oa=this.getXmlFileData();pa.xml=mxUtils.getXml(oa);pa.data=this.getFileData(null,null,!0,null,null,null,oa);pa.format=C.format}else if("html"==C.format)oa=this.editor.getGraphXml(),pa.data=this.getHtml(oa,this.editor.graph),pa.xml=mxUtils.getXml(oa),pa.format=C.format;else{if("xml"==C.format)pa.xml=this.getFileData(!0),pa.format=C.format,B.postMessage(JSON.stringify(pa),"*");else if("json"==C.format)pa.format=
-C.format,pa.data=this.createJsonForExport(0!=C.allPages,1==C.includeData,1==C.compressed,1==C.selection),B.postMessage(JSON.stringify(pa),"*");else{mxSvgCanvas2D.prototype.foAltText=null;var Da=null!=C.background?C.background:this.editor.graph.background;Da==mxConstants.NONE&&(Da=null);pa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);pa.format="svg";var Fa=mxUtils.bind(this,function(bb){this.editor.graph.setEnabled(!0);this.spinner.stop();pa.data=C.asText?bb:Editor.createSvgDataUri(bb);
-B.postMessage(JSON.stringify(pa),"*")}),Ia="auto";C.keepTheme&&(Ia=Editor.isDarkMode()?"dark":"light");null!=C.theme&&(Ia=C.theme);if("xmlsvg"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){Ia=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ia="auto";null!=C.theme&&(Ia=C.theme);this.getEmbeddedSvg(pa.xml,this.editor.graph,null,!0,Fa,null,null,C.embedImages,Da,C.scale,C.border,C.shadow,Ia,C.embedCellMetadata,C.embedFonts)}}else if(null==
-C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){this.editor.graph.setEnabled(!1);var Ha=this.editor.graph.createSvgImageExport(!1,C.embedCellMetadata?!0:!1);oa=Object.create(null);var Ma=this.getSvgWithFontLookup(oa,Ha,mxUtils.bind(this,function(){return this.editor.graph.getSvg(Da,C.scale,C.border,null,null,null,null,Ha,null,this.editor.graph.shadowVisible||C.shadow,null,Ia)}));(this.editor.graph.shadowVisible||C.shadow)&&this.editor.graph.addSvgShadow(Ma);
-this.embedFonts(Ma,mxUtils.bind(this,function(bb){C.embedImages||null==C.embedImages?this.editor.convertImages(bb,mxUtils.bind(this,function(ab){Fa(mxUtils.getXml(ab))})):Fa(mxUtils.getXml(bb))}),C.embedFonts,oa)}}return}B.postMessage(JSON.stringify(pa),"*")}),null!=C.xml&&0<C.xml.length){if(this.editor.graph.mathEnabled){var aa=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){aa.apply(this,arguments);N()}}l=!0;this.setFileData(C.xml);l=!1;this.editor.graph.mathEnabled||N()}else N();return}if("load"==
-C.action){U=C.toSketch;n=1==C.autosave;this.embedDiffSync=null!=C.diffSync&&!1!==C.diffSync;this.embedDiffSyncPatchOnly="object"===typeof C.diffSync&&null!=C.diffSync&&1==C.diffSync.patchOnly;this.embedExportProtocol=1==C.exportProtocol;var ea=C.sourceMetadata||null;M=null!=C.layout?C.layout:null;this.hideDialog();null!=C.modified&&null==urlParams.modified&&(urlParams.modified=C.modified);null!=C.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=C.saveAndExit);if("1"==urlParams.saveAndExit||
-"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=C.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=C.noSaveBtn);if(null!=C.rough){var ka=Editor.sketchMode;this.doSetSketchMode(C.rough);ka!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=
-C.dark&&this.setDarkMode(C.dark);null!=C.border&&(this.embedExportBorder=C.border);null!=C.theme&&(this.embedExportTheme=C.theme);null!=C.background&&(this.embedExportBackground=C.background);null!=C.viewport&&(this.embedViewport=C.viewport);this.embedExitPoint=null;var ra=EditorUi.parseViewBox(C.viewbox);null==ra&&null==C.viewbox&&null==C.scale&&null==C.fit&&(ra=EditorUi.getViewBoxParam());if(null!=ra)R=mxUtils.bind(this,function(){this.applyViewBox(ra)});else if(null!=C.scale){var sa=C.scale,ma=
-null!=C.scaleBorder?C.scaleBorder:this.embedExportBorder||0,wa=null!=C.border?C.border:0;R=mxUtils.bind(this,function(){var pa=this.editor.graph,oa=pa.getGraphBounds();if(0<oa.width&&0<oa.height){var Da=pa.view.scale;pa.view.scaleAndTranslate(sa,pa.view.translate.x+wa-oa.x/Da+ma/sa,pa.view.translate.y+wa-oa.y/Da+ma/sa)}})}else if(null!=C.fit){var va=null!=C.border?C.border:0,za=C.maxFitScale||1;R=mxUtils.bind(this,function(){var pa=this.editor.graph,oa=pa.maxFitScale;pa.maxFitScale=za;pa.fit(va,null,
-null,null,null,!0);pa.maxFitScale=oa})}if(null!=C.scroll&&null!=C.scroll.x&&null!=C.scroll.y){var Ba=C.scroll,ua=R;R=mxUtils.bind(this,function(){null!=ua&&ua();var pa=this.editor.graph,oa=pa.view.scale,Da=pa.view.translate;mxUtils.hasScrollbars(pa.container)?(pa.container.scrollLeft=(Da.x+Ba.x)*oa,pa.container.scrollTop=(Da.y+Ba.y)*oa):pa.view.setTranslate(-Ba.x,-Ba.y)})}if(null!=C.rect){wa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,C.rect.left)+"px";this.diagramContainer.style.top=
-Math.max(40,C.rect.top)+"px";this.minInlineWidth=C.minWidth;this.minInlineHeight=C.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var qa=C.maxFitScale,ia=C.rect.width+2*wa,ja=C.rect.height+2*wa;R=mxUtils.bind(this,function(){var pa=mxUtils.getDocumentSize();ia=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ia):ia,pa.width-80);pa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,
-ja):ja,pa.height-80);this.diagramContainer.style.width=ia+"px";this.diagramContainer.style.height=pa+"px";var oa=this.editor.graph;pa=oa.maxFitScale;oa.maxFitScale=qa;oa.fit(2*wa,null,null,null,null,null,ja);this.setPageVisible("1"==urlParams.pv);if(null!=this.minInlineWidth&&oa.getGraphBounds().width<this.minInlineWidth){var Da=oa.container.scrollTop;this.resetScrollbars();oa.container.scrollTop=Da}oa.maxFitScale=pa;oa.container.scrollTop-=wa;oa.container.scrollLeft-=wa;window.setTimeout(mxUtils.bind(this,
-function(){this.fireEvent(new mxEventObject("editInlineStart","data",[C]));oa.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=oa.container.style.top);var Fa=oa.getGraphBounds();oa.container.clientWidth>Fa.width+2*wa&&(oa.container.scrollLeft=Fa.x+(Fa.width+wa-oa.container.clientWidth)/2)}),10)})}null!=C.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=C.noExitBtn);null!=C.title&&null!=
-this.buttonContainer&&this.setEmbedTitle(C.title);try{C.libs&&this.sidebar.showEntries(C.libs)}catch(pa){}if(null!=C.xmlpng)C=this.extractGraphModelFromPng(C.xmlpng);else if(null!=C.descriptor){if(C=C.descriptor,"mermaid"==C.format){if(EditorUi.isMermaidSupported()){var na=mxUtils.bind(this,function(pa){c(pa,K,null,U);pa=this.createLoadMessage("load");pa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);pa.message=T;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(pa),
-"*");if(null!=ea&&null!=ea.key&&null!=ea.value){pa=this.editor.graph;var oa=pa.getModel().getRoot();if(null!=oa){pa.getModel().beginUpdate();try{pa.setAttributeForCell(oa,ea.key,ea.value)}finally{pa.getModel().endUpdate()}}}}),Aa=mxUtils.bind(this,function(pa){this.handleError(pa)});C.image?this.parseMermaidImage(C.data,na,Aa):this.parseMermaidDiagram(C.data,null,mxUtils.bind(this,function(pa){C.wrap&&(pa=mxMermaidToDrawio.wrapGroup(pa,C.data,EditorUi.getInsertMermaidConfig(),{normalize:!0}));na(pa)}),
-Aa)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else C=C.xml}else{if("merge"==C.action){var ha=this.getCurrentFile();null!=ha&&(fa=O(C.xml),null!=fa&&""!=fa&&ha.mergeFile(new LocalFile(this,fa),mxUtils.bind(this,function(){this.embedDiffSync&&(t=this.clonePages(this.pages),r=xa());B.postMessage(JSON.stringify({event:"merge",message:C}),"*")}),function(pa){B.postMessage(JSON.stringify({event:"merge",message:C,error:pa}),
-"*")}))}else if("patch"==C.action){if(ha=this.getCurrentFile(),null!=ha&&null!=C.patch)try{l=!0,ha.patch([C.patch]),this.embedDiffSync&&null!=t&&(t=this.applyPatches(t,[C.patch])),r=xa(),l=!1,W={event:"patch",message:C},Y=this.getHashValueForPages(this.pages),W.checksum=Y,null!=C.checksum&&C.checksum!=Y&&(W.checksumMismatch=!0),B.postMessage(JSON.stringify(W),"*")}catch(pa){l=!1,B.postMessage(JSON.stringify({event:"patch",message:C,error:pa.message||pa.toString()}),"*")}}else if("getDiff"==C.action){G=
-{event:"getDiff",message:C};if(this.embedDiffSync&&null!=t){var la=this.clonePages(this.pages);G.patch=this.diffPages(t,la);G.checksum=this.getHashValueForPages(la)}else G.xml=xa();B.postMessage(JSON.stringify(G),"*")}else"resetDiff"==C.action?this.embedDiffSync&&(null!=C.xml?(fa=O(C.xml),ha=this.getCurrentFile(),null!=fa&&""!=fa&&null!=ha&&ha.mergeFile(new LocalFile(this,fa),mxUtils.bind(this,function(){t=this.clonePages(this.pages);r=xa();B.postMessage(JSON.stringify({event:"resetDiff",message:C,
-checksum:this.getHashValueForPages(this.pages)}),"*")}),function(pa){B.postMessage(JSON.stringify({event:"resetDiff",message:C,error:pa}),"*")})):(t=this.clonePages(this.pages),r=xa(),B.postMessage(JSON.stringify({event:"resetDiff",message:C,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==C.action?this.handleRemoteInvokeReady(B):"remoteInvoke"==C.action?this.handleRemoteInvoke(C,K.origin):"remoteInvokeResponse"==C.action?this.handleRemoteInvokeResponse(C):B.postMessage(JSON.stringify({error:"unknownMessage",
-data:JSON.stringify(C)}),"*");return}}catch(pa){this.handleError(pa)}}var xa=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Ca=mxUtils.bind(this,function(pa,oa){l=!0;try{c(pa,oa,null,U)}catch(Da){this.handleError(Da)}l=!1;this.editor.graph.model.prefix=Editor.guid()+"-";oa=mxUtils.bind(this,function(){null!=urlParams.modified&&this.clearStatus();r=xa();this.embedDiffSync&&(t=this.clonePages(this.pages));
-n&&null==f&&(f=mxUtils.bind(this,function(Fa,Ia){Fa=xa();if(Fa!=r&&!l){Ia=this.createLoadMessage("autosave");Ia.message=T;if(this.embedDiffSync&&null!=t){var Ha=this.clonePages(this.pages),Ma=this.diffPages(t,Ha);mxUtils.isEmptyObject(Ma)?Ia.xml=Fa:(Ia.patch=Ma,Ia.checksum=this.getHashValueForPages(Ha),this.embedDiffSyncPatchOnly||(Ia.xml=Fa));t=Ha}else Ia.xml=Fa;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Ia),"*")}r=Fa}),this.editor.graph.model.addListener(mxEvent.CHANGE,
-f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("tooltipsEnabledChanged",f),this.addListener("pageViewChanged",
-f),this.addListener("connectionPointsChanged",f),this.addListener("connectionArrowsChanged",f));null!=R&&R();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var Da=this.createLoadMessage("load");Da.xml=null!=M?xa():pa;this.embedDiffSync&&null!=this.pages&&(Da.checksum=this.getHashValueForPages(this.pages));B.postMessage(JSON.stringify(Da),"*")}});null!=M?this.executeLayoutSpec(M,oa):oa()});null!=C&&"function"===typeof C.substring&&"data:application/vnd.visio;base64,"==C.substring(0,34)?(O=
-"0M8R4KGxGuE"==C.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(C.substring(C.indexOf(",")+1)),function(pa){Ca(pa,K)},mxUtils.bind(this,function(pa){this.handleError(pa)}),O)):null!=C&&"function"===typeof C.substring&&this.isGliffyData(C,"")?this.importGliffy(C,mxUtils.bind(this,function(pa){"<mxGraphModel"==pa.substring(0,13)?Ca(pa,K):this.handleError({message:mxResources.get("unknownError")})}),mxUtils.bind(this,function(pa){this.handleError({message:null!=pa&&413==pa.status?
-mxResources.get("diagramTooLarge"):mxResources.get("unknownError")})}),""):null!=C&&"function"===typeof C.substring&&this.isLucidChartData(C)?this.convertLucidChart(C,mxUtils.bind(this,function(pa){Ca(pa)}),mxUtils.bind(this,function(pa){this.handleError(pa)})):null==C||"object"!==typeof C||null==C.format||null==C.data&&null==C.url?(C=O(C),Ca(C,K)):this.loadDescriptor(C,mxUtils.bind(this,function(pa){Ca(xa(),K)}),mxUtils.bind(this,function(pa){this.handleError(pa,mxResources.get("errorLoadingFile"))}))}}));
-var B=this.embedMessageSource||window.opener||window.parent;v="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";B.postMessage(v,"*");if("json"==urlParams.proto){var E=this.editor.graph.openLink;this.editor.graph.openLink=function(K,C,R){E.apply(this,arguments);B.postMessage(JSON.stringify({event:"openLink",href:K,target:C,allowOpener:R}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(K){for(var C=mxEvent.getSource(K);null!=
-C&&"A"!=C.nodeName;)C=C.parentNode;if(null!=C){var R=C.getAttribute("href");null==R||"#"==R.charAt(0)||"javascript:"==R.substring(0,11)||this.editor.graph.isCustomLink(R)||(K.preventDefault(),this.editor.graph.openLink(R,C.getAttribute("target")))}}),!0)}};EditorUi.prototype.createEmbedButton=function(c,f,l,n){var r=document.createElement("button");r.className="geEmbedBtn geBtn";r.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(r,c);n&&r.classList.add("gePrimaryBtn");mxEvent.addListener(r,
-"click",f);return r};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==
-this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),
-mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};
-EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,
-function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var n=JSON.parse(l),r=this.getSelectedLayoutContainer();null!=r&&Array.isArray(n)&&0<n.length?this.setContainerChildLayout(r,n):this.executeLayouts(this.editor.graph.createLayouts(n));this.lastLayoutSpec=this.customLayoutConfig=n;this.hideDialog()}catch(t){this.handleError(t)}}),null,null,null,null,mxUtils.bind(this,function(l,n){var r=this.createLayoutAddSelect(n);l.appendChild(r);
-r=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var t=n.value;n.value=JSON.stringify(JSON.parse(t));n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));n.value=t}catch(v){this.handleError(v)}}));r.setAttribute("title","copy");r.className="geBtn";l.appendChild(r)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,
-620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var l={},n=0;n<f.length;n++)null!=f[n]&&(l[f[n].id]=!0);var r=function(t){return null!=t&&!0===l[t.id]};for(n=0;n<c.length;n++)f=c[n],"undefined"!==typeof ElkLayout&&f instanceof ElkLayout||void 0!==f.cellFilter?f.cellFilter=r:"function"===typeof f.isVertexIgnored&&function(t){var v=
-t.isVertexIgnored;t.isVertexIgnored=function(B){return v.apply(this,arguments)||!r(B)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,l=document.createElement("select");l.className="geBtn";l.style.marginRight="8px";l.style.maxWidth="180px";var n=document.createElement("option");n.value="";mxUtils.write(n,mxResources.get("add")+"...");n.disabled=!0;n.selected=!0;l.appendChild(n);var r=[];"undefined"!==typeof ElkLayout&&(n=function(v,B){var E=ElkLayout.MENU_PRESETS[v];return{label:v,
-kind:"elk",algo:E.algorithm,preset:E.options,layoutName:B}},r.push(n("verticalFlow","elkLayered")),r.push(n("horizontalFlow","elkLayered")),r.push(n("verticalTree","elkTree")),r.push(n("horizontalTree","elkTree")),r.push(n("radialTree","elkRadial")),r.push(n("organic","elkOrganic")));r.push({label:"orgChart",kind:"orgchart"});r.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});r.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});
-"undefined"!==typeof LibavoidRouting&&r.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(n=0;n<r.length;n++){var t=document.createElement("option");t.value=String(n);mxUtils.write(t,mxResources.get(r[n].label)+("elk"===r[n].kind||"orgchart"===r[n].kind?"...":""));l.appendChild(t)}mxEvent.addListener(l,"change",mxUtils.bind(this,function(){var v=parseInt(l.value);l.selectedIndex=0;if(!(isNaN(v)||0>v||v>=r.length)){var B=r[v],E=c.value;if(0===mxUtils.trim(E).length)var K=
-[];else{try{K=JSON.parse(E)}catch(R){f.handleError(R);return}if(!Array.isArray(K)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var C=mxUtils.bind(this,function(R){K.push(R);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(K,null,2))});v=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(E)});"elk"===B.kind?(f.hideDialog(),ElkLayout.runWithDialog(f,B.algo,B.preset,mxResources.get(B.label),function(R,M){R=Graph.elkOptionsToConfig(R,M);C({layout:B.layoutName,
-config:R})},v)):"orgchart"===B.kind?(f.hideDialog(),f.showOrgChartConfigDialog(C,v)):C({layout:B.layoutName,config:B.config||{}})}}));return l};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var l=2,n=20,r=20,t=document.createElement("div"),v=function(O,U){var T=document.createElement("div");T.style.marginTop="6px";T.style.display="inline-block";T.style.width="180px";mxUtils.write(T,mxResources.get(O)+": ");t.appendChild(T);t.appendChild(U)},B=document.createElement("select");B.style.width=
-"160px";B.style.boxSizing="border-box";for(var E=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],K=0;K<E.length;K++){var C=document.createElement("option");mxUtils.write(C,E[K]);C.value=K;2===K&&C.setAttribute("selected","selected");B.appendChild(C)}mxEvent.addListener(B,"change",function(){l=parseInt(B.value)});v("orgChartType",
-B);var R=document.createElement("input");R.type="number";R.value=n;R.style.width="160px";R.style.boxSizing="border-box";mxEvent.addListener(R,"change",function(){n=parseInt(R.value)});v("parentChildSpacing",R);var M=document.createElement("input");M.type="number";M.value=r;M.style.width="160px";M.style.boxSizing="border-box";mxEvent.addListener(M,"change",function(){r=parseInt(M.value)});v("siblingSpacing",M);f=new CustomDialog(this,t,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:l,
-parentChildSpacing:n,siblingSpacing:r}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(l){var n=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),r=mxUtils.bind(this,function(t){this.loadingOrgChart=!1;l.clear()&&this.handleError(t)});
-if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))n();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",n,null,null,null,r)},null,null,null,r)},null,null,null,r)},null,null,null,r):mxscript(window.DRAWIO_SERVER_URL+
-"js/orgchart.min.js",n,null,null,null,r)}),onerror)};EditorUi.prototype.importCsv=function(c,f,l,n){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,l)}),n)};EditorUi.prototype.doImportCsv=function(c,f,l){try{var n=c.split("\n"),r=[],t=[],v=[],B=Object.create(null);if(0<n.length){var E=Object.create(null);l=null!=l?l:this.editor.graph;var K=null,C=null,R=null,M=null,O=null,U=null,T=null,V="whiteSpace=wrap;html=1;",fa=null,y=null,d="",p="auto",A="auto",G=!1,I=null,L=null,
-P=40,Q=40,ba=100,X=0,Y=mxUtils.bind(this,function(){null!=f?f(Da):(l.setSelectionCells(Da),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),W=l.getFreeInsertPoint(!0),ca=W.x,S=W.y;W=S;var Z=null,da="auto";y=null;for(var N=[],aa=null,ea=null,ka=0;ka<n.length&&"#"==n[ka].charAt(0);){c=n[ka].replace(/\r$/,"");for(ka++;ka<n.length&&"\\"==c.charAt(c.length-1)&&"#"==n[ka].charAt(0);)c=c.substring(0,
-c.length-1)+mxUtils.trim(n[ka].substring(1)),ka++;if("#"!=c.charAt(1)){var ra=c.indexOf(":");if(0<ra){var sa=mxUtils.trim(c.substring(1,ra)),ma=mxUtils.trim(c.substring(ra+1));"label"==sa?Z=Graph.sanitizeHtml(ma):"labelname"==sa&&0<ma.length&&"-"!=ma?O=ma:"labels"==sa&&0<ma.length&&"-"!=ma?T=JSON.parse(ma):"style"==sa?C=ma:"parentstyle"==sa?V=ma:"unknownStyle"==sa&&"-"!=ma?U=ma:"stylename"==sa&&0<ma.length&&"-"!=ma?M=ma:"styles"==sa&&0<ma.length&&"-"!=ma?R=JSON.parse(ma):"vars"==sa&&0<ma.length&&
-"-"!=ma?K=JSON.parse(ma):"identity"==sa&&0<ma.length&&"-"!=ma?fa=ma:"parent"==sa&&0<ma.length&&"-"!=ma?y=ma:"namespace"==sa&&0<ma.length&&"-"!=ma?d=ma:"width"==sa?p=ma:"height"==sa?A=ma:"collapsed"==sa&&"-"!=ma?G="true"==ma:"left"==sa&&0<ma.length?I=ma:"top"==sa&&0<ma.length?L=ma:"ignore"==sa?ea=ma.split(","):"connect"==sa?N.push(JSON.parse(ma)):"link"==sa?aa=ma:"padding"==sa?X=parseFloat(ma):"edgespacing"==sa?P=parseFloat(ma):"nodespacing"==sa?Q=parseFloat(ma):"levelspacing"==sa?ba=parseFloat(ma):
-"layout"==sa&&(da=ma)}}}if(null==n[ka])throw Error(mxResources.get("invalidOrMissingFile"));var wa=this.editor.csvToArray(n[ka].replace(/\r$/,""));ra=c=null;sa=[];for(ma=0;ma<wa.length;ma++)fa==wa[ma]&&(c=ma),y==wa[ma]&&(ra=ma),sa.push(mxUtils.trim(wa[ma]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Z&&(Z="%"+sa[0]+"%");if(null!=N)for(var va=0;va<N.length;va++)null==E[N[va].to]&&(E[N[va].to]=Object.create(null));fa=[];for(ma=ka+1;ma<n.length;ma++){var za=this.editor.csvToArray(n[ma].replace(/\r$/,
-""));if(null==za){var Ba=40<n[ma].length?n[ma].substring(0,40)+"...":n[ma];throw Error(Ba+" ("+ma+"):\n"+mxResources.get("containsValidationErrors"));}0<za.length&&fa.push(za)}l.model.beginUpdate();try{for(ma=0;ma<fa.length;ma++){za=fa[ma];var ua=null,qa=null!=c?d+za[c]:null;n=!1;null!=qa&&(ua=l.model.getCell(qa),n=null==ua||0<=mxUtils.indexOf(r,ua));var ia=new mxCell(Z,new mxGeometry(ca,W,0,0),C||"whiteSpace=wrap;html=1;");ia.collapsed=G;ia.vertex=!0;ia.id=qa;null==ua||n||l.model.setCollapsed(ua,
-G);for(var ja=0;ja<za.length;ja++)l.setAttributeForCell(ia,sa[ja],za[ja]),null==ua||n||l.setAttributeForCell(ua,sa[ja],za[ja]);if(null!=O&&null!=T){var na=ia.getAttribute(O),Aa=null!=na&&Object.prototype.hasOwnProperty.call(T,na)?T[na]:null;null!=Aa&&(l.labelChanged(ia,Aa),null==ua||n||l.cellLabelChanged(ua,Aa))}if(null!=M&&null!=R){var ha=ia.getAttribute(M),la=null!=ha&&Object.prototype.hasOwnProperty.call(R,ha)?R[ha]:null;null!=la&&(ia.style=la)}l.setAttributeForCell(ia,"placeholders","1");ia.style=
-l.replacePlaceholders(ia,ia.style,K);null==ua||n?l.fireEvent(new mxEventObject("cellsInserted","cells",[ia])):(l.model.setStyle(ua,ia.style),0>mxUtils.indexOf(v,ua)&&v.push(ua),l.fireEvent(new mxEventObject("cellsInserted","cells",[ua])));n=null!=ua;ua=ia;if(!n)for(va=0;va<N.length;va++)E[N[va].to][ua.getAttribute(N[va].to)]=ua;null!=aa&&"link"!=aa&&(l.setLinkForCell(ua,ua.getAttribute(aa)),l.setAttributeForCell(ua,aa,null));var xa=l.getPreferredSizeForCell(ua);y=null!=ra?l.model.getCell(d+za[ra]):
-null;if(ua.vertex){Ba=null!=y?0:ca;ka=null!=y?0:S;null!=I&&null!=ua.getAttribute(I)&&(ua.geometry.x=Ba+parseFloat(ua.getAttribute(I)));null!=L&&null!=ua.getAttribute(L)&&(ua.geometry.y=ka+parseFloat(ua.getAttribute(L)));var Ca="@"==p.charAt(0)?ua.getAttribute(p.substring(1)):null;ua.geometry.width=null!=Ca&&"auto"!=Ca?parseFloat(ua.getAttribute(p.substring(1))):"auto"==p||"auto"==Ca?xa.width+X:parseFloat(p);var pa="@"==A.charAt(0)?ua.getAttribute(A.substring(1)):null;ua.geometry.height=null!=pa&&
-"auto"!=pa&&"width"!=A?parseFloat(pa):"auto"==A||"auto"==pa?xa.height+X:"width"==A?ua.geometry.width:parseFloat(A);W+=ua.geometry.height+Q}n?(null==B[qa]&&(B[qa]=[]),B[qa].push(ua)):(r.push(ua),null!=y?(y.style=l.replacePlaceholders(y,V,K),l.addCell(ua,y),t.push(y)):v.push(l.addCell(ua)))}for(ma=0;ma<t.length;ma++)Ca="@"==p.charAt(0)?t[ma].getAttribute(p.substring(1)):null,pa="@"==A.charAt(0)?t[ma].getAttribute(A.substring(1)):null,"auto"!=p&&"auto"!=Ca||"auto"!=A&&"auto"!=pa||l.updateGroupBounds([t[ma]],
-X,!0);var oa=v.slice(),Da=v.slice();for(va=0;va<N.length;va++){var Fa=N[va];for(ma=0;ma<r.length;ma++){ua=r[ma];var Ia=mxUtils.bind(this,function(fb,eb,Wa){var cb=eb.getAttribute(Wa.from);if(null!=cb&&""!=cb){cb=cb.split(",");for(var Gb=0;Gb<cb.length;Gb++){var sb=E[Wa.to][cb[Gb]];if(null==sb&&null!=U){sb=new mxCell(cb[Gb],new mxGeometry(ca,S,0,0),U);sb.style=l.replacePlaceholders(eb,sb.style,K);var wb=l.getPreferredSizeForCell(sb);sb.geometry.width=wb.width+X;sb.geometry.height=wb.height+X;E[Wa.to][cb[Gb]]=
-sb;sb.vertex=!0;sb.id=cb[Gb];v.push(l.addCell(sb))}if(null!=sb){wb=Wa.label;null!=Wa.fromlabel&&(wb=(eb.getAttribute(Wa.fromlabel)||"")+(wb||""));null!=Wa.sourcelabel&&(wb=l.replacePlaceholders(eb,Wa.sourcelabel,K)+(wb||""));null!=Wa.tolabel&&(wb=(wb||"")+(sb.getAttribute(Wa.tolabel)||""));null!=Wa.targetlabel&&(wb=(wb||"")+l.replacePlaceholders(sb,Wa.targetlabel,K));var Eb="target"==Wa.placeholders==!Wa.invert?sb:fb;Eb=null!=Wa.style?l.replacePlaceholders(Eb,Wa.style,K):l.createCurrentEdgeStyle();
-wb=l.insertEdge(null,null,wb||"",Wa.invert?sb:fb,Wa.invert?fb:sb,Eb);if(null!=Wa.labels)for(Eb=0;Eb<Wa.labels.length;Eb++){var pb=Wa.labels[Eb],Ab=new mxCell(pb.label||Eb,new mxGeometry(null!=pb.x?pb.x:0,null!=pb.y?pb.y:0,0,0),"resizable=0;html=1;");Ab.vertex=!0;Ab.connectable=!1;Ab.geometry.relative=!0;null!=pb.placeholders&&(Ab.value=l.replacePlaceholders("target"==pb.placeholders==!Wa.invert?sb:fb,Ab.value,K));if(null!=pb.dx||null!=pb.dy)Ab.geometry.offset=new mxPoint(null!=pb.dx?pb.dx:0,null!=
-pb.dy?pb.dy:0);wb.insert(Ab)}if(null!=Wa.data)for(var Ib in Wa.data)l.setAttributeForCell(wb,Ib,Wa.data[Ib]);Da.push(wb);mxUtils.remove(Wa.invert?fb:sb,oa)}}}});Ia(ua,ua,Fa);if(null!=B[ua.id])for(ja=0;ja<B[ua.id].length;ja++)Ia(ua,B[ua.id][ja],Fa)}}if(null!=ea)for(ma=0;ma<r.length;ma++)for(ua=r[ma],ja=0;ja<ea.length;ja++)l.setAttributeForCell(ua,mxUtils.trim(ea[ja]),null);if(0<v.length){var Ha=new mxParallelEdgeLayout(l);Ha.spacing=P;Ha.checkOverlap=!0;var Ma=function(){0<Ha.spacing&&Ha.execute(l.getDefaultParent());
-var fb=0,eb=0;0<v.length&&(eb=l.getCellGeometry(v[0]),fb=Math.round(l.snap(eb.x))-eb.x,eb=Math.round(l.snap(eb.y))-eb.y);for(var Wa=0;Wa<v.length;Wa++){var cb=l.getCellGeometry(v[Wa]);cb.x=Math.round(cb.x+fb);cb.y=Math.round(cb.y+eb);"auto"==p&&(cb.width=Math.round(l.snap(cb.width)));"auto"==A&&(cb.height=Math.round(l.snap(cb.height)))}};"auto"==da&&1==oa.length&&(da=Da.length==2*v.length-1?"verticaltree":"verticalflow");var bb="organic"==da||null!=EditorUi.CSV_ELK_LAYOUTS[da]?null:this.resolveLayoutList(da);
-if(null!=bb){var ab=Y;l.view.validate();var tb=l.createLayouts(bb);this.scopeLayoutsToCells(tb,Da);this.executeLayouts(tb,function(){Ma();ab()});Y=null}else if("circle"==da){var yb=new mxCircleLayout(l);yb.disableEdgeStyle=!1;yb.resetEdges=!1;var jb=yb.isVertexIgnored;yb.isVertexIgnored=function(fb){return jb.apply(this,arguments)||0>mxUtils.indexOf(v,fb)};this.executeLayout(function(){yb.execute(l.getDefaultParent());Ma()},!0,Y);Y=null}else if("verticaltree"==da||"horizontaltree"==da){l.view.validate();
-var hb=new mxCompactTreeLayout(l,"horizontaltree"==da);hb.levelDistance=Q;hb.edgeRouting=!1;hb.resetEdges=!1;hb.sortEdges=!0;var rb=hb.isVertexIgnored;hb.isVertexIgnored=function(fb){return rb.apply(this,arguments)||0>mxUtils.indexOf(v,fb)};this.executeLayout(function(){hb.execute(l.getDefaultParent(),0<oa.length?oa[0]:null)},!0,Y);Y=null}else if("orgchart"==da){l.view.validate();var Sa=new mxOrgChartLayout(l,2,ba,Q),Ua=Sa.isVertexIgnored;Sa.isVertexIgnored=function(fb){return Ua.apply(this,arguments)||
-0>mxUtils.indexOf(v,fb)};this.executeLayout(function(){Sa.execute(l.getDefaultParent());Ma()},!0,Y);Y=null}else if("organic"==da||"auto"==da&&Da.length>v.length){l.view.validate();var vb=new mxFastOrganicLayout(l);vb.forceConstant=3*Q;vb.disableEdgeStyle=!1;vb.resetEdges=!1;var kb=vb.isVertexIgnored;vb.isVertexIgnored=function(fb){return kb.apply(this,arguments)||0>mxUtils.indexOf(v,fb)};this.executeLayout(function(){vb.execute(l.getDefaultParent());Ma()},!0,Y);Y=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[da]){l.view.validate();
-ab=Y;var qb=EditorUi.CSV_ELK_LAYOUTS[da],lb=mxUtils.clone(qb.config);lb["elk.spacing.nodeNode"]=Q;lb["elk.layered.spacing.nodeNodeBetweenLayers"]=ba;lb["elk.spacing.edgeEdge"]=P;lb["elk.layered.spacing.edgeEdgeBetweenLayers"]=P;var Za=l.createLayouts([{layout:qb.layout,config:lb}]);this.scopeLayoutsToCells(Za,Da);l.model.beginUpdate();var Hb=!1,Db=function(){Hb||(Hb=!0,l.model.endUpdate())},Cb=this;try{Za[0].prepare(l.getDefaultParent(),function(fb,eb){null!=fb?(Db(),Cb.handleError(fb)):Cb.executeLayout(function(){eb();
-var Wa=l.getBoundingBoxFromGeometry(Da);null!=Wa&&l.moveCells(Da,ca-Wa.x,S-Wa.y)},!0,function(){Db();ab()})})}catch(fb){throw Db(),fb;}Y=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=Y&&Y()}}catch(fb){this.handleError(fb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(f+=l+n+"="+urlParams[n],l="&")}else f=window.location.search;
-return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),n;for(n in urlParams)0>mxUtils.indexOf(l,n)&&(c=0==f?c+"?":c+"&",null!=urlParams[n]&&(c+=n+"="+urlParams[n],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,l,n,r){c=new LinkDialog(this,c,f,l,!0,n,r);this.showDialog(c.container,
-440,null,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=
-this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();
-this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);
-this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||
-"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var H=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){H.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),l=this.getSelectionState(),n=this.isDiagramActive(),
-r="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&r);this.actions.get("redo").setEnabled(this.canRedo()&&r);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(n&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(n&&
-0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(n&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(n&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(n&&l.image&&0<l.cells.length);this.actions.get("pageSetup").setEnabled(n);this.actions.get("shadowVisible").setEnabled(n);this.actions.get("connectionArrows").setEnabled(n);this.actions.get("connectionPoints").setEnabled(n);this.actions.get("copyStyle").setEnabled(n&&
-!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&n&&0<l.cells.length);this.actions.get("copyTextStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&n&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length&&!l.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<l.cells.length);this.actions.get("createShape").setEnabled(n);this.actions.get("createRevision").setEnabled(n);
-this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);
-this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):
-"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(n&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var D=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);D.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,n,r,t,v,B){var E=c.editor.graph;
-if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(E.getSvg(n,r,t)),"image/svg+xml");else{var K=c.getFileData(!0,null,null,null,null,!0),C=E.getGraphBounds(),R=Math.floor(C.width*r/E.view.scale),M=Math.floor(C.height*r/E.view.scale);if(K.length<=MAX_REQUEST_SIZE&&R*M<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas())if(c.isRemoteExportEnabled()){var O=
-{globalVars:E.getExportVariables()};B&&(O.grid={size:E.gridSize,steps:E.view.gridSteps,color:E.view.gridColor});c.saveRequest(f,l,function(U,T){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(T||"0")+(null!=U?"&filename="+encodeURIComponent(U):"")+"&extras="+encodeURIComponent(JSON.stringify(O))+(0<v?"&dpi="+v:"")+"&bg="+(null!=n?n:"none")+"&w="+R+"&h="+M+"&border="+t+"&xml="+encodeURIComponent(K))})}else c.handleError({message:mxResources.get("notAvailable")});else"png"==l?c.exportImage(r,
-null==n||"none"==n,!0,!1,!1,t,!0,!1,null,B,v):c.exportImage(r,!1,!0,!1,!1,t,!0,!1,"jpeg",B);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var n=c;this.currentPage!=this.pages[l]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),n.model.setRoot(this.pages[l].root));f+=this.pages[l].getName()+
-" "+n.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,l){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){l.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));l.html=f;return}l.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var l={id:c.getId()};l.type=f?"layer":c.edge?"edge":
-c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(l.parent=f.getId()));c.edge&&(null!=c.source&&(l.source=c.source.getId()),null!=c.target&&(l.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),l);c=f.attributes;f={};for(var n=0,r=0;r<c.length;r++){var t=c[r].nodeName;"label"!=t&&"placeholders"!=t&&"id"!=t&&(f[t]=c[r].nodeValue,n++)}0<n&&(l.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,l);return l};EditorUi.prototype.getJsonForPage=
-function(c,f){var l=this.editor.graph.getModel();var n=null==c||c==this.currentPage?l.getRoot():this.updatePageRoot(c).root;var r=[],t=mxUtils.bind(this,function(C,R){r.push(this.getJsonForExportCell(C,R));R=C.getChildCount();for(var M=0;M<R;M++)t(C.getChildAt(M),!1)});if(null!=f){n={};for(var v=0;v<f.length;v++)n[f[v].getId()]=!0;for(v=0;v<f.length;v++){for(var B=f[v],E=B.getParent(),K=!1;null!=E;){if(n[E.getId()]){K=!0;break}E=E.getParent()}K||t(B,l.isLayer(B))}}else for(f=n.getChildCount(),v=0;v<
-f;v++)t(n.getChildAt(v),!0);v={};null!=c&&(v.id=c.getId(),v.name=c.getName());v.cells=r;return v};EditorUi.prototype.createJsonForExport=function(c,f,l,n){var r={version:EditorUi.VERSION};f&&(r.data=mxUtils.getXml(this.getXmlFileData(!n,!c,!l)));f=[];if(n)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));r.pages=
-f;return r};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},l=document.createElement("div");l.style.whiteSpace="nowrap";var n=document.createElement("h3");mxUtils.write(n,mxUtils.htmlEntities(c));l.appendChild(n);var r=document.createElement("div");r.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";r.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var t={};try{var v=mxSettings.getCustomLibraries();for(c=0;c<
-v.length;c++){var B=v[c];if("R"==B.substring(0,1)){var E=JSON.parse(decodeURIComponent(B.substring(1)));t[E[0]]={id:E[0],title:E[1],downloadUrl:E[2]}}}}catch(K){}this.remoteInvoke("getCustomLibraries",null,null,function(K){r.innerText="";if(0==K.length)r.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var C=0;C<K.length;C++){var R=K[C];t[R.id]&&(f[R.id]=R);var M=this.addCheckbox(r,R.title,t[R.id]);(function(O,
-U){mxEvent.addListener(U,"change",function(){this.checked?f[O.id]=O:delete f[O.id]})})(R,M)}},mxUtils.bind(this,function(K){r.innerText="";var C=document.createElement("div");C.style.padding="8px";C.style.textAlign="center";mxUtils.write(C,mxResources.get("error")+": ");mxUtils.write(C,null!=K&&null!=K.message?K.message:mxResources.get("unknownError"));r.appendChild(C)}));l.appendChild(r);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));
-var K=0,C;for(C in f)null==t[C]&&(K++,mxUtils.bind(this,function(R){this.remoteInvoke("getFileContent",[R.downloadUrl],null,mxUtils.bind(this,function(M){K--;0==K&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,M,R)),this.showSidebar()}catch(O){this.handleError(O,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){K--;0==K&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[C]));for(C in t)f[C]||this.closeLibrary(new RemoteLibrary(this,
-null,t[C]));0==K&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=
-[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=null!=f?f.callbackId:null,n="number"===typeof l&&0<=l&&l<this.remoteInvokeCallbacks.length?this.remoteInvokeCallbacks[l]:null;if(null==n)throw Error("No callback for "+(null!=f?f.callbackId:
-"null"));c.error?n.error&&n.error(c.error.errResp):n.callback&&n.callback.apply(this,c.resp);this.remoteInvokeCallbacks[l]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,n,r){var t=!0,v=window.setTimeout(mxUtils.bind(this,function(){t=!1;r({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),B=mxUtils.bind(this,function(){window.clearTimeout(v);t&&n.apply(this,arguments)}),E=mxUtils.bind(this,function(){window.clearTimeout(v);t&&r.apply(this,arguments)});l=l||{};l.callbackId=
-this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:B,error:E});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var l=mxUtils.bind(this,function(K,C){var R={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=C?R.error={errResp:C}:null!=K&&(R.resp=K);this.remoteWin.postMessage(JSON.stringify(R),
-"*")});try{var n=c.funtionName,r=null!=n&&Object.prototype.hasOwnProperty.call(this.remoteInvokableFns,n)?this.remoteInvokableFns[n]:null;if(null!=r&&"function"===typeof this[n]){if(r.allowedDomains){for(var t=!1,v=0;v<r.allowedDomains.length;v++)if(f=="https://"+r.allowedDomains[v]){t=!0;break}if(!t){l(null,"Invalid Call: "+n+" is not allowed.");return}}var B=c.functionArgs;Array.isArray(B)||(B=[]);if(r.isAsync)B.push(function(){l(Array.prototype.slice.apply(arguments))}),B.push(function(K){l(null,
-K||"Unkown Error")}),this[n].apply(this,B);else{var E=this[n].apply(this,B);l([E])}}else l(null,"Invalid Call: "+n+" is not found.")}catch(K){l(null,"Invalid Call: An error occurred, "+K.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var n=l.open("database",2);n.onupgradeneeded=function(r){try{var t=n.result;1>r.oldVersion&&t.createObjectStore("objects",{keyPath:"key"});2>r.oldVersion&&
-(t.createObjectStore("files",{keyPath:"title"}),t.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(v){null!=f&&f(v)}};n.onsuccess=mxUtils.bind(this,function(r){try{var t=n.result;this.database=t;EditorUi.migrateStorageFiles&&(StorageFile.migrate(t),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(v){if((!v||
-"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var B=document.createElement("iframe");B.style.display="none";B.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(B);var E=!0,K=!1,C,R=0,M=mxUtils.bind(this,function(){K=!0;this.setDatabaseItem(".drawioMigrated3",!0);B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),O=mxUtils.bind(this,function(){R++;U()}),
-U=mxUtils.bind(this,function(){try{if(R>=C.length)M();else{var V=C[R];StorageFile.getFileContent(this,V,mxUtils.bind(this,function(fa){null==fa||".scratchpad"==V&&fa==this.emptyLibraryXml?B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[V]}),"*"):O()}),O)}}catch(fa){console.log(fa)}}),T=mxUtils.bind(this,function(V){try{this.setDatabaseItem(null,[{title:V.title,size:V.data.length,lastModified:Date.now(),type:V.isLib?"L":"F"},{title:V.title,
-data:V.data}],O,O,["filesInfo","files"])}catch(fa){console.log(fa)}});v=mxUtils.bind(this,function(V){try{if(V.source==B.contentWindow){var fa={};try{fa=JSON.parse(V.data)}catch(y){}"init"==fa.event?(B.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=fa.event||K||(E?null!=fa.resp&&0<fa.resp.length&&null!=fa.resp[0]?(C=fa.resp[0],E=!1,U()):
-M():null!=fa.resp&&0<fa.resp.length&&null!=fa.resp[0]?T(fa.resp[0]):O())}}catch(y){console.log(y)}});window.addEventListener("message",v)}})));c(t);t.onversionchange=function(){t.close()}}catch(v){null!=f?f(v):null!=window.console&&console.warn(v)}});n.onerror=f;n.onblocked=function(){}}catch(r){null!=f?f(r):null!=window.console&&console.error(r)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,l,n,r){this.openDatabase(mxUtils.bind(this,
-function(t){try{r=r||"objects";Array.isArray(r)||(r=[r],c=[c],f=[f]);var v=t.transaction(r,"readwrite");v.oncomplete=l;v.onerror=n;for(t=0;t<r.length;t++)v.objectStore(r[t]).put(null!=c&&null!=c[t]?{key:c[t],data:f[t]}:f[t])}catch(B){null!=n&&n(B)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,n){this.openDatabase(mxUtils.bind(this,function(r){try{n=n||"objects";Array.isArray(n)||(n=[n],c=[c]);var t=r.transaction(n,"readwrite");t.oncomplete=f;t.onerror=l;for(r=0;r<n.length;r++)t.objectStore(n[r]).delete(c[r])}catch(v){null!=
-l&&l(v)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,n){this.openDatabase(mxUtils.bind(this,function(r){try{n=n||"objects";var t=r.transaction([n],"readonly").objectStore(n).get(c);t.onsuccess=function(){f(t.result)};t.onerror=l}catch(v){null!=l&&l(v)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(n){try{l=l||"objects";var r=n.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),t=[];r.onsuccess=function(v){null==
-v.target.result?c(t):(t.push(v.target.result.value),v.target.result.continue())};r.onerror=f}catch(v){null!=f&&f(v)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(n){try{l=l||"objects";var r=n.transaction([l],"readonly").objectStore(l).getAllKeys();r.onsuccess=function(){c(r.result)};r.onerror=f}catch(t){null!=f&&f(t)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};
-EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var l=this.getCurrentFile();null!=l?l.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,l){var n=this.getCurrentFile();null!=n?n.addComment(c,f,l):f(Date.now())};EditorUi.prototype.canReplyToReplies=
-function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.anchoredCommentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.anchoredCommentsSupported():!1};EditorUi.prototype.mentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionsSupported():!1};EditorUi.prototype.freeMentionsSupported=function(){var c=this.getCurrentFile();
-return null!=c?c.freeMentionsSupported():!1};EditorUi.prototype.mentionsLiveSearch=function(){var c=this.getCurrentFile();return null!=c?c.mentionsLiveSearch():!1};EditorUi.prototype.mentionNotificationsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionNotificationsSupported():!0};EditorUi.prototype.getMentionCandidates=function(c,f,l){var n=this.getCurrentFile();null!=n?n.getMentionCandidates(c,f,l):c([])};EditorUi.prototype.serializeMention=function(c){return"+"+c.email};
-EditorUi.prototype.parseMentionTokens=function(c){for(var f=/[+@]([A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,})/g,l=[],n=0,r;null!=(r=f.exec(c));)r.index>n&&l.push(c.substring(n,r.index)),l.push({email:r[1]}),n=r.index+r[0].length;n<c.length&&l.push(c.substring(n));return l};EditorUi.prototype.getCommentCacheTarget=function(){var c=this.getCurrentFile();return null!=c?c:this};EditorUi.prototype.refreshCommentCache=function(c,f){if(this.commentsSupported()){var l=this.getCommentCacheTarget();
-if(null!=l.commentCacheCallbacks)l.commentCacheCallbacks.push([c,f]);else{l.commentCacheCallbacks=[[c,f]];var n=mxUtils.bind(this,function(r,t){var v=l.commentCacheCallbacks;l.commentCacheCallbacks=null;for(var B=0;null!=v&&B<v.length;B++)if(null!=v[B][r])v[B][r](t)});this.getComments(mxUtils.bind(this,function(r){this.getCommentCacheTarget()==l&&(l.commentCache=r,this.fireEvent(new mxEventObject("commentsChanged")));n(0,r)}),mxUtils.bind(this,function(r){n(1,r)}))}}else null!=c&&c(null)};EditorUi.prototype.commentsUpdated=
-function(){if(this.commentsSupported()){var c=this.getCurrentFile();null!=c&&null!=c.sync&&c.sync.sendCommentsChangedMessage();this.refreshCommentCache()}};EditorUi.prototype.getUnresolvedCommentCount=function(){var c=this.getCommentCacheTarget().commentCache,f=0;if(null!=c)for(var l=0;l<c.length;l++)c[l].isResolved||f++;return f};EditorUi.prototype.getCommentAnchorCells=function(c){var f=c.getAnchorCellIds(),l=[];if(null!=f&&0<f.length){c=c.getAnchorPageId();var n=null==c?this.currentPage:this.getPageById(c);
-if(null!=n)if(n==this.currentPage)for(c=0;c<f.length;c++)n=this.editor.graph.model.getCell(f[c]),null!=n&&l.push(n);else{try{this.updatePageRoot(n)}catch(B){return l}if(null!=n.root){var r={},t=0;for(c=0;c<f.length;c++)r[f[c]]||(r[f[c]]=!0,t++);var v=function(B){if(0<t){r[B.getId()]&&(r[B.getId()]=!1,l.push(B),t--);for(var E=0;E<B.getChildCount();E++)v(B.getChildAt(E))}};v(n.root)}}}return l};EditorUi.prototype.gotoCommentAnchor=function(c){var f=c.getAnchorPageId();if(null!=f&&null!=this.currentPage&&
-f!=this.currentPage.getId()){f=this.getPageById(f);if(null==f)return!1;this.selectPage(f)}f=this.editor.graph;var l=c.getAnchorCellIds();if(null!=l&&0<l.length){c=[];for(var n=0;n<l.length;n++){var r=f.model.getCell(l[n]);null!=r&&c.push(r)}return 0<c.length?(f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c,"#0071e3",2E3),f.scrollCellToVisible(c[0]),!0):!1}l=c.getAnchorRect();null!=l&&0<l.w&&0<l.h&&f.fitWindow(new mxRectangle(l.x,l.y,l.w,l.h),0);c=c.getAnchorPoint();if(null!=c){l=f.view.scale;
-n=f.view.translate;f=f.container;f.scrollLeft=Math.round((c.x+n.x)*l-f.clientWidth/2);f.scrollTop=Math.round((c.y+n.y)*l-f.clientHeight/2);var t=document.createElement("div");t.className="geCommentAnchorMarker";t.style.left=Math.round((c.x+n.x)*l)+"px";t.style.top=Math.round((c.y+n.y)*l)+"px";f.appendChild(t);window.setTimeout(function(){null!=t.parentNode&&t.parentNode.removeChild(t)},2E3)}return!0};EditorUi.prototype.addCommentsBadge=function(c){var f=document.createElement("span");f.className=
-"geCommentsBadge";f.style.display="none";c.appendChild(f);c=mxUtils.bind(this,function(){var l=this.getUnresolvedCommentCount();f.style.display=0<l?"":"none";f.innerText="";mxUtils.write(f,99<l?"99+":String(l))});this.addListener("commentsChanged",c);this.editor.addListener("fileLoaded",c);c();return f};EditorUi.prototype.installCommentDragSource=function(c){var f=this,l=document.createElement("div");l.style.width="24px";l.style.height="24px";l.style.backgroundImage="url("+Editor.lightDarkCommentImage+
-")";l.style.backgroundSize="100% 100%";l.style.opacity="0.9";c=mxUtils.makeDraggable(c,function(){return f.editor.graph},function(r,t,v,B,E){null!=f.currentPage&&null!=f.menus&&null!=f.menus.showCommentsWindow&&(r=null!=v?{p:f.currentPage.getId(),c:v.id}:{p:f.currentPage.getId(),pt:{x:Math.round(B),y:Math.round(E)}},f.menus.showCommentsWindow(null,r))},l);var n=c.mouseDown;c.mouseDown=function(r){mxEvent.isMouseEvent(r)&&!mxEvent.isPopupTrigger(r)&&f.commentsSupported()&&f.anchoredCommentsSupported()&&
-f.canComment()&&n.apply(this,arguments)};return c};EditorUi.prototype.updateCommentOverlays=function(){var c=this.editor.graph;if(null!=this.commentOverlays)for(var f=0;f<this.commentOverlays.length;f++)c.removeCellOverlay(this.commentOverlays[f].cell,this.commentOverlays[f].overlay);this.commentOverlays=null;var l=this.getCurrentFile();if(null!=l&&l.anchoredCommentsSupported()&&null!=l.commentCache&&!this.editor.isChromelessView()){var n=null!=this.currentPage?this.currentPage.getId():null,r={};
-for(f=0;f<l.commentCache.length;f++){var t=l.commentCache[f],v=t.getAnchorCellIds();if(!t.isResolved&&null!=v&&t.getAnchorPageId()==n)for(t=0;t<v.length;t++)r[v[t]]=!0}this.commentOverlays=[];for(var B in r)mxUtils.bind(this,function(E){var K=c.model.getCell(E);if(null!=K){var C=new mxCellOverlay(new mxImage(Editor.lightDarkCommentImage,16,16),mxResources.get("comments"),mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,new mxPoint(8,8));C.isCommentOverlay=!0;C.cursor="pointer";C.addListener(mxEvent.CLICK,
-mxUtils.bind(this,function(){null!=this.menus&&null!=this.menus.showCommentsWindow&&this.menus.showCommentsWindow(E)}));c.addCellOverlay(K,C);this.commentOverlays.push({cell:K,overlay:C})}})(B)}};EditorUi.prototype.newComment=function(c,f){var l=this.getCurrentFile();return null!=l?l.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=
-function(c,f){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=
-function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,n,r,t,v,B){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,n,r,t,v,B)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=
-function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");
-return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,n)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=
-function(c,f,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,l,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,l,n,r){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,l,n,r)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=
-urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var l=localStorage.key(f),n=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<n.length){var r="<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(r||n)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;
-var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
-var CommentsWindow=function(b,k,m,g,q,u){function x(){for(var N=I.getElementsByTagName("div"),aa=0,ea=0;ea<N.length;ea++)"none"!=N[ea].style.display&&N[ea].parentNode==I&&aa++;L.style.display=0==aa?"block":"none"}function z(N){for(var aa=0;aa<y.length;aa++)if(null!=y[aa].email&&null!=N&&y[aa].email.toLowerCase()==N.toLowerCase())return y[aa].displayName||N;return N}function F(N){var aa=document.createElement("span");aa.className="geCommentMention";aa.setAttribute("data-mention",b.serializeMention(N));
-null!=N.email&&aa.setAttribute("data-email",N.email);aa.contentEditable="false";mxUtils.write(aa,"@"+(N.displayName||(null!=N.email?z(N.email):N.id)));return aa}function J(N,aa){N.innerText="";aa=null!=aa?aa:"";if(O){aa=b.parseMentionTokens(aa);for(var ea=0;ea<aa.length;ea++)"string"===typeof aa[ea]?mxUtils.write(N,aa[ea]):N.appendChild(F(aa[ea]))}else mxUtils.write(N,aa)}function H(N,aa,ea,ka){function ra(oa){for(var Da in Aa)for(var Fa=0;Fa<Aa[Da].length;Fa++)oa(Aa[Da][Fa],"down"==Da?xa:"move"==
-Da?Ca:pa)}function sa(oa){oa=mxUtils.convertPoint(za,mxEvent.getClientX(oa),mxEvent.getClientY(oa));return new mxPoint(oa.x/va.view.scale-va.view.translate.x,oa.y/va.view.scale-va.view.translate.y)}function ma(){ra(function(oa,Da){document.removeEventListener(oa,Da,!0)});document.removeEventListener("keydown",la,!0);window.setTimeout(function(){document.removeEventListener("click",ha,!0)},0);za.classList.remove("geCommentAnchorPicking");va.setEnabled(Ba);null!=ua&&null!=ua.parentNode&&ua.parentNode.removeChild(ua)}
+config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainers=function(){for(var c=this.editor.graph,f=c.getSelectionCells(),l=[],n=0;n<f.length;n++)if(c.model.isVertex(f[n])){var r=c.getCellStyle(f[n]).childLayout;if(null!=r&&"tableLayout"!=r&&"stackLayout"!=r&&"rack"!=r)l.push(f[n]);else return[]}return l};EditorUi.prototype.applyLayoutToSelectedContainers=function(c){var f=
+this.getSelectedLayoutContainers();if(0==f.length)return!1;var l=this.editor.graph.model;l.beginUpdate();try{for(var n=0;n<f.length;n++)this.setContainerChildLayout(f[n],c)}finally{l.endUpdate()}return!0};EditorUi.prototype.setContainerChildLayout=function(c,f){var l=this.editor.graph,n=f,r=null,t=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));n=[];for(var v=0;v<f.length;v++){var B=f[v];if(null!=B&&("mxRadialTreeLayout"==B.layout||
+"mxOrgChartLayout"==B.layout||"mxFastOrganicLayout"==B.layout||"mxCircleLayout"==B.layout))throw Error("Not supported as childLayout: "+B.layout);if(null!=B&&null!=Graph.elkLayoutAlgorithms[B.layout]){var E={},K;for(K in B.config)E[K]=B.config[K];delete E.rootCellIds;delete E.preserveOrigin;null==E.resizeNodes&&(E.resizeNodes=!1);null==E.resizeLayoutRoot&&(E.resizeLayoutRoot=!0);"elkLayered"==B.layout&&(null==E.extractIsolated&&(E.extractIsolated=!1),null==E["elk.layered.considerModelOrder.strategy"]&&
+(E["elk.layered.considerModelOrder.strategy"]=Menus.flowModelOrder));null!=E.corners&&(t=E.corners);if(null!=E.groupPadding&&(r=String(E.groupPadding),/[;=]/.test(r)))throw Error("Invalid groupPadding: "+r);B={layout:B.layout,config:E}}n.push(B)}l.createLayouts(n);n=Graph.encodeChildLayout(n)}if(0<=n.indexOf(";"))throw Error("Invalid childLayout: "+n);l.model.beginUpdate();try{var C=l.model.getStyle(c);l.setCellStyles("childLayout",n,[c]);null!=r&&l.setCellStyles("groupPadding",r,[c]);null!=t&&"undefined"!==
+typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(l,c,t);l.model.getStyle(c)==C&&null!=l.layoutManager&&l.layoutManager.executeLayout(c,!1)}finally{l.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,l){var n=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS},function(){try{var r=n.resolveLayoutList(c);null!=r?(n.lastLayoutSpec=r,l&&Array.isArray(r)&&0<r.length&&n.applyLayoutToSelectedContainers(r)?
+null!=f&&f():n.executeLayouts(n.editor.graph.createLayouts(r),f)):n.handleError(Error("Unknown layout: "+c))}catch(t){n.handleError(t)}},function(){n.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.applyChildLayouts=function(c){var f=this.editor.graph,l=function(){try{f.executeAllChildLayouts()}catch(n){null!=window.console&&console.error(n)}null!=c&&c()};(function(){if("undefined"!==typeof ElkLayout)return!1;for(var n=f.getChildLayoutCells(),r=0;r<n.length;r++)try{for(var t=
+Graph.decodeChildLayout(f.getCellStyle(n[r]).childLayout),v=0;null!=t&&v<t.length;v++)if(null!=t[v]&&"string"===typeof Graph.elkLayoutAlgorithms[t[v].layout])return!0}catch(B){}return!1})()?this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout},l,l):l()};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,l=c.ctrlKey||c.metaKey,
+n=null!=c.key?c.key.toLowerCase():"",r=0;r<f.length;r++){var t=f[r];if(n===String(t.key).toLowerCase()&&l===!!t.ctrl&&c.shiftKey===!!t.shift&&c.altKey===!!t.alt){c.preventDefault();c.stopImmediatePropagation();null!=t.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:t.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",
+34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===
+typeof c.keyCode&&1==c.keyCode.length,l=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(l))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var n=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:c.shift?this.altShiftActions:this.altActions;null!=c.action?n[l]=c.action:delete n[l]}else null!=c.action?(n=mxUtils.bind(this,function(){var r=this.actions.get(c.action);null!=r&&r.isEnabled()&&r.funct.apply(this,arguments)}),
+c.control?c.shift?this.keyHandler.bindControlShiftKey(l,n):this.keyHandler.bindControlKey(l,n):c.shift?this.keyHandler.bindShiftKey(l,n):this.keyHandler.bindKey(l,n)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:this.keyHandler.normalKeys)[l];null!=c.action&&(n=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=l&&57>=l||65<=l&&90>=l?String.fromCharCode(l):EditorUi.keyNames[l],null!=n&&null!=f&&(n.shortcut=(c.control?
+Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,l=!1,n=!1,r=null,t=null;this.installPassThroughKeys();var v=mxUtils.bind(this,function(K,C){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,
+v);mxEvent.addListener(window,"message",mxUtils.bind(this,function(K){if(K.source==(this.embedMessageSource||window.opener||window.parent)){var C=K.data,R=null,M=null,O=mxUtils.bind(this,function(pa){if(null!=pa&&"function"===typeof pa.charAt&&"<"!=pa.charAt(0))try{Editor.isPngDataUrl(pa)?pa=Editor.extractGraphModelFromPng(pa):"data:image/svg+xml;base64,"==pa.substring(0,26)?pa=atob(pa.substring(26)):"data:image/svg+xml;utf8,"==pa.substring(0,24)&&(pa=pa.substring(24)),null!=pa&&(""==pa.trim()?pa=
+null:"%"==pa.charAt(0)?pa=decodeURIComponent(pa):"<"!=pa.charAt(0)&&(pa=Graph.decompress(pa)))}catch(oa){}return pa});if("json"==urlParams.proto){var U=!1;try{C=JSON.parse(C),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[K],"data",[C])}catch(pa){C=null}try{var T=C;if(null==C)return;if("dialog"==C.action){this.showError(null!=C.titleKey?mxResources.get(C.titleKey):C.title,null!=C.messageKey?mxResources.get(C.messageKey):mxUtils.htmlEntities(C.message),null!=C.buttonKey?mxResources.get(C.buttonKey):
+C.button);null!=C.modified&&(this.editor.modified=C.modified);return}if("layout"==C.action){this.executeLayoutSpec(C.layouts,mxUtils.bind(this,function(){var pa=this.createLoadMessage("layout");pa.message=C;B.postMessage(JSON.stringify(pa),"*")}));return}if("prompt"==C.action){this.spinner.stop();var V=new FilenameDialog(this,C.defaultValue||"",null!=C.okKey?mxResources.get(C.okKey):C.ok,function(pa){null!=pa?B.postMessage(JSON.stringify({event:"prompt",value:pa,message:C}),"*"):B.postMessage(JSON.stringify({event:"prompt-cancel",
+message:C}),"*")},null!=C.titleKey?mxResources.get(C.titleKey):C.title,null,null,null,null,function(){B.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")});this.showDialog(V.container,300,80,!0,!1);V.init();return}if("draft"==C.action){var fa=O(C.xml);this.spinner.stop();V=new DraftDialog(this,mxResources.get("draftFound",[C.name||this.defaultFilename]),fa,mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"edit",message:C}),"*")}),mxUtils.bind(this,
+function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"discard",message:C}),"*")}),C.editKey?mxResources.get(C.editKey):null,C.discardKey?mxResources.get(C.discardKey):null,C.ignore?mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"ignore",message:C}),"*")}):null);this.showDialog(V.container,640,480,!0,!1,mxUtils.bind(this,function(pa){pa&&this.actions.get("exit").funct()}));try{V.init()}catch(pa){B.postMessage(JSON.stringify({event:"draft",
+error:pa.toString(),message:C}),"*")}return}if("template"==C.action){this.spinner.stop();var y=1==C.enableRecent,d=1==C.enableSearch,p=1==C.enableCustomTemp;V=new NewDialog(this,!1,C.templatesOnly?!1:null!=C.callback,mxUtils.bind(this,function(pa,oa,Ea,Ga){pa=pa||this.emptyDiagramXml;null!=C.callback?B.postMessage(JSON.stringify({event:"template",xml:pa,blank:pa==this.emptyDiagramXml,name:oa,tempUrl:Ea,libs:Ga,builtIn:!0,message:C}),"*"):(c(pa,K,pa!=this.emptyDiagramXml,C.toSketch),this.editor.modified||
+this.clearStatus())}),null,null,null,null,null,null,null,y?mxUtils.bind(this,function(pa){this.remoteInvoke("getRecentDiagrams",[null],null,pa,function(){pa(null,"Network Error!")})}):null,d?mxUtils.bind(this,function(pa,oa){this.remoteInvoke("searchDiagrams",[pa,null],null,oa,function(){oa(null,"Network Error!")})}):null,mxUtils.bind(this,function(pa,oa,Ea){B.postMessage(JSON.stringify({event:"template",docUrl:pa,info:oa,name:Ea}),"*")}),null,null,p?mxUtils.bind(this,function(pa){this.remoteInvoke("getCustomTemplates",
+null,null,pa,function(){pa({},0)})}):null,1==C.withoutType,null,C.templatesOnly);this.showDialog(V.container,620,460,!0,!1,mxUtils.bind(this,function(pa){null!=this.sidebar&&this.sidebar.hideTooltip();pa&&!C.noExitOnCancel&&this.actions.get("exit").funct()}));V.init();return}if("textContent"==C.action){var A=this.getDiagramTextContent();B.postMessage(JSON.stringify({event:"textContent",data:A,message:C}),"*");return}if("status"==C.action){this.updateStatus(mxUtils.bind(this,function(){null!=C.messageKey?
+this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(C.messageKey))):null!=C.message&&this.editor.setStatus(mxUtils.htmlEntities(C.message))}));null!=C.modified&&(this.editor.modified=C.modified);return}if("spinner"==C.action){var G=null!=C.messageKey?mxResources.get(C.messageKey):C.message;null==C.show||C.show?this.spinner.spin(document.body,G):this.spinner.stop();return}if("exit"==C.action){this.actions.get("exit").funct();return}if("viewport"==C.action){if(null!=C.viewport){var J=this.editor.graph,
+L=J.view.translate.x,P=J.view.translate.y;this.embedViewport=C.viewport;J.refresh();this.diagramContainer.scrollTop-=(P-J.view.translate.y)*J.view.scale;this.diagramContainer.scrollLeft-=(L-J.view.translate.x)*J.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==C.action){var Q=this.actions.get(C.actionName);null!=Q&&Q.funct();return}if("resetEditor"==C.action){J=this.editor.graph;J.isEditing()&&J.stopEditing(!1);this.hideCurrentMenu();J.popupMenuHandler.hideMenu();
+J.clearSelection();return}if("fit"==C.action){J=this.editor.graph;var ba=J.maxFitScale;J.maxFitScale=null!=C.maxScale?C.maxScale:1;J.fit(null!=C.border?C.border:16,null,null,null,null,!0);J.maxFitScale=ba;G=this.createLoadMessage("fit");G.message=C;B.postMessage(JSON.stringify(G),"*");return}if("viewbox"==C.action){var W=EditorUi.parseViewBox(C.viewbox);null!=W&&this.applyViewBox(W);G=this.createLoadMessage("viewbox");G.message=C;B.postMessage(JSON.stringify(G),"*");return}if("fullscreenChanged"==
+C.action){var Y=null;try{var X=this.diagramContainer.getAttribute("data-scrollState");null!=X&&(this.diagramContainer.removeAttribute("data-scrollState"),Y=JSON.parse(X))}catch(pa){}Editor.inlineFullscreen=C.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=Y&&this.restoreScrollState(Y);return}if("snapshot"==C.action){this.sendEmbeddedSvgExport(!0);return}if("export"==C.action){if("png"==C.format||"xmlpng"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,
+null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){var ca=null!=C.xml?C.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);J=this.editor.graph;var S=mxUtils.bind(this,function(pa,oa){if(C.withSvg)C.withSvg=!1,this.getEmbeddedSvg(ca,this.editor.graph,null,!0,function(Ga){S(pa,Ga)},null,null,C.embedImages,this.editor.graph.background,C.scale,C.border,C.shadow,"auto",null,C.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ea=this.createLoadMessage("export");Ea.format=
+C.format;Ea.message=T;Ea.data=pa;Ea.svg=oa;Ea.xml=ca;B.postMessage(JSON.stringify(Ea),"*")}}),Z=mxUtils.bind(this,function(pa){null==pa&&(pa=Editor.blankImage);"xmlpng"==C.format&&(pa=Editor.writeGraphModelToPng(pa,"tEXt","mxfile",encodeURIComponent(ca)));J!=this.editor.graph&&J.container.parentNode.removeChild(J.container);S(pa)}),da=C.pageId||(null!=this.pages?C.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var N=mxUtils.bind(this,function(){if(null!=
+this.pages&&this.currentPage.getId()!=da){var pa=J.getGlobalVariable;J=this.createTemporaryGraph(J.getStylesheet());for(var oa,Ea=0;Ea<this.pages.length;Ea++)if(this.pages[Ea].getId()==da){oa=this.updatePageRoot(this.pages[Ea]);break}null==oa&&(oa=this.currentPage);J.getGlobalVariable=function(Ma){return"page"==Ma?oa.getName():"pagenumber"==Ma?1:pa.apply(this,arguments)};document.body.appendChild(J.container);J.model.setRoot(oa.root)}if(null!=C.layerIds){var Ga=J.model,Ja=Ga.getChildCells(Ga.getRoot()),
+Ha=Object.create(null);for(Ea=0;Ea<C.layerIds.length;Ea++)Ha[C.layerIds[Ea]]=!0;for(Ea=0;Ea<Ja.length;Ea++)Ga.setVisible(Ja[Ea],Ha[Ja[Ea].id]||!1)}Ea=null;C.keepTheme&&(Ea=Editor.isDarkMode()?"dark":"light");null==C.width&&0<this.maxCanvasExportArea&&(Ja=J.getGraphBounds(),Ha=null!=C.border?C.border:0,Ga=Math.ceil(Ja.width/J.view.scale)+2*Ha,Ja=Math.ceil(Ja.height/J.view.scale)+2*Ha,Ha=null!=C.scale?C.scale:1,Ga*Ja*Ha*Ha>this.maxCanvasExportArea&&(C.scale=Math.sqrt(this.maxCanvasExportArea/(Ga*Ja))));
+this.editor.exportToCanvas(mxUtils.bind(this,function(Ma){Z(Ma.toDataURL("image/png"))}),C.width,null,C.background,mxUtils.bind(this,function(){Z(null)}),null,null,C.scale,C.transparent,C.shadow,null,J,C.border,null,C.grid,Ea,C.size)});null!=C.xml&&0<C.xml.length&&(l=!0,this.setFileData(ca),l=!1);N()}else this.isRemoteExportEnabled()?(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==C.format?"1":"0")+(null!=da?"&pageId="+da:"")+(null!=C.layerIds&&0<C.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:C.layerIds})):
+"")+(null!=C.scale?"&scale="+C.scale:"")+"&base64=1&xml="+encodeURIComponent(ca))).send(mxUtils.bind(this,function(pa){200<=pa.getStatus()&&299>=pa.getStatus()?S("data:image/png;base64,"+pa.getText()):Z(null)}),mxUtils.bind(this,function(){Z(null)})):Z(null)}}else if(N=mxUtils.bind(this,function(){var pa=this.createLoadMessage("export");pa.message=C;if("html2"==C.format||"html"==C.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var oa=this.getXmlFileData();pa.xml=mxUtils.getXml(oa);
+pa.data=this.getFileData(null,null,!0,null,null,null,oa);pa.format=C.format}else if("html"==C.format)oa=this.editor.getGraphXml(),pa.data=this.getHtml(oa,this.editor.graph),pa.xml=mxUtils.getXml(oa),pa.format=C.format;else{if("xml"==C.format)pa.xml=this.getFileData(!0),pa.format=C.format,B.postMessage(JSON.stringify(pa),"*");else if("json"==C.format)pa.format=C.format,pa.data=this.createJsonForExport(0!=C.allPages,1==C.includeData,1==C.compressed,1==C.selection),B.postMessage(JSON.stringify(pa),"*");
+else{mxSvgCanvas2D.prototype.foAltText=null;var Ea=null!=C.background?C.background:this.editor.graph.background;Ea==mxConstants.NONE&&(Ea=null);pa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);pa.format="svg";var Ga=mxUtils.bind(this,function(eb){this.editor.graph.setEnabled(!0);this.spinner.stop();pa.data=C.asText?eb:Editor.createSvgDataUri(eb);B.postMessage(JSON.stringify(pa),"*")}),Ja="auto";C.keepTheme&&(Ja=Editor.isDarkMode()?"dark":"light");null!=C.theme&&(Ja=C.theme);
+if("xmlsvg"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){Ja=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ja="auto";null!=C.theme&&(Ja=C.theme);this.getEmbeddedSvg(pa.xml,this.editor.graph,null,!0,Ga,null,null,C.embedImages,Ea,C.scale,C.border,C.shadow,Ja,C.embedCellMetadata,C.embedFonts)}}else if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){this.editor.graph.setEnabled(!1);
+var Ha=this.editor.graph.createSvgImageExport(!1,C.embedCellMetadata?!0:!1);oa=Object.create(null);var Ma=this.getSvgWithFontLookup(oa,Ha,mxUtils.bind(this,function(){return this.editor.graph.getSvg(Ea,C.scale,C.border,null,null,null,null,Ha,null,this.editor.graph.shadowVisible||C.shadow,null,Ja)}));(this.editor.graph.shadowVisible||C.shadow)&&this.editor.graph.addSvgShadow(Ma);this.embedFonts(Ma,mxUtils.bind(this,function(eb){C.embedImages||null==C.embedImages?this.editor.convertImages(eb,mxUtils.bind(this,
+function(bb){Ga(mxUtils.getXml(bb))})):Ga(mxUtils.getXml(eb))}),C.embedFonts,oa)}}return}B.postMessage(JSON.stringify(pa),"*")}),null!=C.xml&&0<C.xml.length){if(this.editor.graph.mathEnabled){var aa=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){aa.apply(this,arguments);N()}}l=!0;this.setFileData(C.xml);l=!1;this.editor.graph.mathEnabled||N()}else N();return}if("load"==C.action){U=C.toSketch;n=1==C.autosave;this.embedDiffSync=null!=C.diffSync&&!1!==C.diffSync;this.embedDiffSyncPatchOnly="object"===
+typeof C.diffSync&&null!=C.diffSync&&1==C.diffSync.patchOnly;this.embedExportProtocol=1==C.exportProtocol;var ea=C.sourceMetadata||null;M=null!=C.layout?C.layout:null;this.hideDialog();null!=C.modified&&null==urlParams.modified&&(urlParams.modified=C.modified);null!=C.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=C.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,
+!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=C.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=C.noSaveBtn);if(null!=C.rough){var ka=Editor.sketchMode;this.doSetSketchMode(C.rough);ka!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=C.dark&&this.setDarkMode(C.dark);null!=C.border&&(this.embedExportBorder=C.border);null!=C.theme&&(this.embedExportTheme=
+C.theme);null!=C.background&&(this.embedExportBackground=C.background);null!=C.viewport&&(this.embedViewport=C.viewport);this.embedExitPoint=null;var ra=EditorUi.parseViewBox(C.viewbox);null==ra&&null==C.viewbox&&null==C.scale&&null==C.fit&&(ra=EditorUi.getViewBoxParam());if(null!=ra)R=mxUtils.bind(this,function(){this.applyViewBox(ra)});else if(null!=C.scale){var sa=C.scale,ma=null!=C.scaleBorder?C.scaleBorder:this.embedExportBorder||0,wa=null!=C.border?C.border:0;R=mxUtils.bind(this,function(){var pa=
+this.editor.graph,oa=pa.getGraphBounds();if(0<oa.width&&0<oa.height){var Ea=pa.view.scale;pa.view.scaleAndTranslate(sa,pa.view.translate.x+wa-oa.x/Ea+ma/sa,pa.view.translate.y+wa-oa.y/Ea+ma/sa)}})}else if(null!=C.fit){var va=null!=C.border?C.border:0,za=C.maxFitScale||1;R=mxUtils.bind(this,function(){var pa=this.editor.graph,oa=pa.maxFitScale;pa.maxFitScale=za;pa.fit(va,null,null,null,null,!0);pa.maxFitScale=oa})}if(null!=C.scroll&&null!=C.scroll.x&&null!=C.scroll.y){var Ba=C.scroll,ua=R;R=mxUtils.bind(this,
+function(){null!=ua&&ua();var pa=this.editor.graph,oa=pa.view.scale,Ea=pa.view.translate;mxUtils.hasScrollbars(pa.container)?(pa.container.scrollLeft=(Ea.x+Ba.x)*oa,pa.container.scrollTop=(Ea.y+Ba.y)*oa):pa.view.setTranslate(-Ba.x,-Ba.y)})}if(null!=C.rect){wa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,C.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,C.rect.top)+"px";this.minInlineWidth=C.minWidth;this.minInlineHeight=C.minHeight;this.diagramContainer.style.border=
+"2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var qa=C.maxFitScale,ia=C.rect.width+2*wa,ja=C.rect.height+2*wa;R=mxUtils.bind(this,function(){var pa=mxUtils.getDocumentSize();ia=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ia):ia,pa.width-80);pa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ja):ja,pa.height-80);this.diagramContainer.style.width=ia+"px";this.diagramContainer.style.height=pa+"px";var oa=this.editor.graph;
+pa=oa.maxFitScale;oa.maxFitScale=qa;oa.fit(2*wa,null,null,null,null,null,ja);this.setPageVisible("1"==urlParams.pv);if(null!=this.minInlineWidth&&oa.getGraphBounds().width<this.minInlineWidth){var Ea=oa.container.scrollTop;this.resetScrollbars();oa.container.scrollTop=Ea}oa.maxFitScale=pa;oa.container.scrollTop-=wa;oa.container.scrollLeft-=wa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[C]));oa.container.focus();null!=this.formatWindow&&
+null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=oa.container.style.top);var Ga=oa.getGraphBounds();oa.container.clientWidth>Ga.width+2*wa&&(oa.container.scrollLeft=Ga.x+(Ga.width+wa-oa.container.clientWidth)/2)}),10)})}null!=C.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=C.noExitBtn);null!=C.title&&null!=this.buttonContainer&&this.setEmbedTitle(C.title);try{C.libs&&this.sidebar.showEntries(C.libs)}catch(pa){}if(null!=C.xmlpng)C=
+this.extractGraphModelFromPng(C.xmlpng);else if(null!=C.descriptor){if(C=C.descriptor,"mermaid"==C.format){if(EditorUi.isMermaidSupported()){var na=mxUtils.bind(this,function(pa){c(pa,K,null,U);pa=this.createLoadMessage("load");pa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);pa.message=T;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(pa),"*");if(null!=ea&&null!=ea.key&&null!=ea.value){pa=this.editor.graph;var oa=pa.getModel().getRoot();if(null!=
+oa){pa.getModel().beginUpdate();try{pa.setAttributeForCell(oa,ea.key,ea.value)}finally{pa.getModel().endUpdate()}}}}),Aa=mxUtils.bind(this,function(pa){this.handleError(pa)});C.image?this.parseMermaidImage(C.data,na,Aa):this.parseMermaidDiagram(C.data,null,mxUtils.bind(this,function(pa){C.wrap&&(pa=mxMermaidToDrawio.wrapGroup(pa,C.data,EditorUi.getInsertMermaidConfig(),{normalize:!0}));na(pa)}),Aa)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));
+return}}else C=C.xml}else{if("merge"==C.action){var ha=this.getCurrentFile();null!=ha&&(fa=O(C.xml),null!=fa&&""!=fa&&ha.mergeFile(new LocalFile(this,fa),mxUtils.bind(this,function(){this.embedDiffSync&&(t=this.clonePages(this.pages),r=ya());B.postMessage(JSON.stringify({event:"merge",message:C}),"*")}),function(pa){B.postMessage(JSON.stringify({event:"merge",message:C,error:pa}),"*")}))}else if("patch"==C.action){if(ha=this.getCurrentFile(),null!=ha&&null!=C.patch)try{l=!0,ha.patch([C.patch]),this.embedDiffSync&&
+null!=t&&(t=this.applyPatches(t,[C.patch])),r=ya(),l=!1,X={event:"patch",message:C},Y=this.getHashValueForPages(this.pages),X.checksum=Y,null!=C.checksum&&C.checksum!=Y&&(X.checksumMismatch=!0),B.postMessage(JSON.stringify(X),"*")}catch(pa){l=!1,B.postMessage(JSON.stringify({event:"patch",message:C,error:pa.message||pa.toString()}),"*")}}else if("getDiff"==C.action){G={event:"getDiff",message:C};if(this.embedDiffSync&&null!=t){var la=this.clonePages(this.pages);G.patch=this.diffPages(t,la);G.checksum=
+this.getHashValueForPages(la)}else G.xml=ya();B.postMessage(JSON.stringify(G),"*")}else"resetDiff"==C.action?this.embedDiffSync&&(null!=C.xml?(fa=O(C.xml),ha=this.getCurrentFile(),null!=fa&&""!=fa&&null!=ha&&ha.mergeFile(new LocalFile(this,fa),mxUtils.bind(this,function(){t=this.clonePages(this.pages);r=ya();B.postMessage(JSON.stringify({event:"resetDiff",message:C,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(pa){B.postMessage(JSON.stringify({event:"resetDiff",message:C,error:pa}),
+"*")})):(t=this.clonePages(this.pages),r=ya(),B.postMessage(JSON.stringify({event:"resetDiff",message:C,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==C.action?this.handleRemoteInvokeReady(B):"remoteInvoke"==C.action?this.handleRemoteInvoke(C,K.origin):"remoteInvokeResponse"==C.action?this.handleRemoteInvokeResponse(C):B.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(C)}),"*");return}}catch(pa){this.handleError(pa)}}var ya=mxUtils.bind(this,function(){return"0"!=
+urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Ca=mxUtils.bind(this,function(pa,oa){l=!0;try{c(pa,oa,null,U)}catch(Ea){this.handleError(Ea)}l=!1;this.editor.graph.model.prefix=Editor.guid()+"-";oa=mxUtils.bind(this,function(){null!=urlParams.modified&&this.clearStatus();r=ya();this.embedDiffSync&&(t=this.clonePages(this.pages));n&&null==f&&(f=mxUtils.bind(this,function(Ga,Ja){Ga=ya();if(Ga!=r&&!l){Ja=this.createLoadMessage("autosave");
+Ja.message=T;if(this.embedDiffSync&&null!=t){var Ha=this.clonePages(this.pages),Ma=this.diffPages(t,Ha);mxUtils.isEmptyObject(Ma)?Ja.xml=Ga:(Ja.patch=Ma,Ja.checksum=this.getHashValueForPages(Ha),this.embedDiffSyncPatchOnly||(Ja.xml=Ga));t=Ha}else Ja.xml=Ga;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Ja),"*")}r=Ga}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",
+f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("tooltipsEnabledChanged",f),this.addListener("pageViewChanged",f),this.addListener("connectionPointsChanged",f),this.addListener("connectionArrowsChanged",
+f));null!=R&&R();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var Ea=this.createLoadMessage("load");Ea.xml=null!=M?ya():pa;this.embedDiffSync&&null!=this.pages&&(Ea.checksum=this.getHashValueForPages(this.pages));B.postMessage(JSON.stringify(Ea),"*")}});null!=M?this.executeLayoutSpec(M,oa):oa()});null!=C&&"function"===typeof C.substring&&"data:application/vnd.visio;base64,"==C.substring(0,34)?(O="0M8R4KGxGuE"==C.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(C.substring(C.indexOf(",")+
+1)),function(pa){Ca(pa,K)},mxUtils.bind(this,function(pa){this.handleError(pa)}),O)):null!=C&&"function"===typeof C.substring&&this.isGliffyData(C,"")?this.importGliffy(C,mxUtils.bind(this,function(pa){"<mxGraphModel"==pa.substring(0,13)?Ca(pa,K):this.handleError({message:mxResources.get("unknownError")})}),mxUtils.bind(this,function(pa){this.handleError({message:null!=pa&&413==pa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")})}),""):null!=C&&"function"===typeof C.substring&&
+this.isLucidChartData(C)?this.convertLucidChart(C,mxUtils.bind(this,function(pa){Ca(pa)}),mxUtils.bind(this,function(pa){this.handleError(pa)})):null==C||"object"!==typeof C||null==C.format||null==C.data&&null==C.url?(C=O(C),Ca(C,K)):this.loadDescriptor(C,mxUtils.bind(this,function(pa){Ca(ya(),K)}),mxUtils.bind(this,function(pa){this.handleError(pa,mxResources.get("errorLoadingFile"))}))}}));var B=this.embedMessageSource||window.opener||window.parent;v="json"==urlParams.proto?JSON.stringify({event:"init"}):
+urlParams.ready||"ready";B.postMessage(v,"*");if("json"==urlParams.proto){var E=this.editor.graph.openLink;this.editor.graph.openLink=function(K,C,R){E.apply(this,arguments);B.postMessage(JSON.stringify({event:"openLink",href:K,target:C,allowOpener:R}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(K){for(var C=mxEvent.getSource(K);null!=C&&"A"!=C.nodeName;)C=C.parentNode;if(null!=C){var R=C.getAttribute("href");null==R||"#"==R.charAt(0)||"javascript:"==
+R.substring(0,11)||this.editor.graph.isCustomLink(R)||(K.preventDefault(),this.editor.graph.openLink(R,C.getAttribute("target")))}}),!0)}};EditorUi.prototype.createEmbedButton=function(c,f,l,n){var r=document.createElement("button");r.className="geEmbedBtn geBtn";r.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(r,c);n&&r.classList.add("gePrimaryBtn");mxEvent.addListener(r,"click",f);return r};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&
+this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);
+this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),
+"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=
+function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,
+mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var n=JSON.parse(l);Array.isArray(n)&&0<n.length&&this.applyLayoutToSelectedContainers(n)||this.executeLayouts(this.editor.graph.createLayouts(n));this.lastLayoutSpec=this.customLayoutConfig=n;this.hideDialog()}catch(r){this.handleError(r)}}),null,null,null,null,mxUtils.bind(this,function(l,n){var r=this.createLayoutAddSelect(n);l.appendChild(r);r=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var t=
+n.value;n.value=JSON.stringify(JSON.parse(t));n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));n.value=t}catch(v){this.handleError(v)}}));r.setAttribute("title","copy");r.className="geBtn";l.appendChild(r)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};
+EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var l={},n=0;n<f.length;n++)null!=f[n]&&(l[f[n].id]=!0);var r=function(t){return null!=t&&!0===l[t.id]};for(n=0;n<c.length;n++)f=c[n],"undefined"!==typeof ElkLayout&&f instanceof ElkLayout||void 0!==f.cellFilter?f.cellFilter=r:"function"===typeof f.isVertexIgnored&&function(t){var v=t.isVertexIgnored;t.isVertexIgnored=function(B){return v.apply(this,
+arguments)||!r(B)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,l=document.createElement("select");l.className="geBtn";l.style.marginRight="8px";l.style.maxWidth="180px";var n=document.createElement("option");n.value="";mxUtils.write(n,mxResources.get("add")+"...");n.disabled=!0;n.selected=!0;l.appendChild(n);var r=[];"undefined"!==typeof ElkLayout&&(n=function(v,B){var E=ElkLayout.MENU_PRESETS[v];return{label:v,kind:"elk",algo:E.algorithm,preset:E.options,layoutName:B}},r.push(n("verticalFlow",
+"elkLayered")),r.push(n("horizontalFlow","elkLayered")),r.push(n("verticalTree","elkTree")),r.push(n("horizontalTree","elkTree")),r.push(n("radialTree","elkRadial")),r.push(n("organic","elkOrganic")));r.push({label:"orgChart",kind:"orgchart"});r.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});r.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&r.push({label:"orthogonalRouting",
+kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(n=0;n<r.length;n++){var t=document.createElement("option");t.value=String(n);mxUtils.write(t,mxResources.get(r[n].label)+("elk"===r[n].kind||"orgchart"===r[n].kind?"...":""));l.appendChild(t)}mxEvent.addListener(l,"change",mxUtils.bind(this,function(){var v=parseInt(l.value);l.selectedIndex=0;if(!(isNaN(v)||0>v||v>=r.length)){var B=r[v],E=c.value;if(0===mxUtils.trim(E).length)var K=[];else{try{K=JSON.parse(E)}catch(R){f.handleError(R);
+return}if(!Array.isArray(K)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var C=mxUtils.bind(this,function(R){K.push(R);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(K,null,2))});v=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(E)});"elk"===B.kind?(f.hideDialog(),ElkLayout.runWithDialog(f,B.algo,B.preset,mxResources.get(B.label),function(R,M){R=Graph.elkOptionsToConfig(R,M);C({layout:B.layoutName,config:R})},v)):"orgchart"===B.kind?
+(f.hideDialog(),f.showOrgChartConfigDialog(C,v)):C({layout:B.layoutName,config:B.config||{}})}}));return l};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var l=2,n=20,r=20,t=document.createElement("div"),v=function(O,U){var T=document.createElement("div");T.style.marginTop="6px";T.style.display="inline-block";T.style.width="180px";mxUtils.write(T,mxResources.get(O)+": ");t.appendChild(T);t.appendChild(U)},B=document.createElement("select");B.style.width="160px";B.style.boxSizing="border-box";
+for(var E=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],K=0;K<E.length;K++){var C=document.createElement("option");mxUtils.write(C,E[K]);C.value=K;2===K&&C.setAttribute("selected","selected");B.appendChild(C)}mxEvent.addListener(B,"change",function(){l=parseInt(B.value)});v("orgChartType",B);var R=document.createElement("input");
+R.type="number";R.value=n;R.style.width="160px";R.style.boxSizing="border-box";mxEvent.addListener(R,"change",function(){n=parseInt(R.value)});v("parentChildSpacing",R);var M=document.createElement("input");M.type="number";M.value=r;M.style.width="160px";M.style.boxSizing="border-box";mxEvent.addListener(M,"change",function(){r=parseInt(M.value)});v("siblingSpacing",M);f=new CustomDialog(this,t,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:l,parentChildSpacing:n,siblingSpacing:r}})},
+f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(l){var n=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),r=mxUtils.bind(this,function(t){this.loadingOrgChart=!1;l.clear()&&this.handleError(t)});if("undefined"!==typeof mxOrgChartLayout||
+this.loadingOrgChart||this.isOffline(!0))n();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",n,null,null,null,r)},null,null,null,r)},null,null,null,r)},null,null,null,r):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",n,
+null,null,null,r)}),onerror)};EditorUi.prototype.importCsv=function(c,f,l,n){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,l)}),n)};EditorUi.prototype.doImportCsv=function(c,f,l){try{var n=c.split("\n"),r=[],t=[],v=[],B=Object.create(null);if(0<n.length){var E=Object.create(null);l=null!=l?l:this.editor.graph;var K=null,C=null,R=null,M=null,O=null,U=null,T=null,V="whiteSpace=wrap;html=1;",fa=null,y=null,d="",p="auto",A="auto",G=!1,J=null,L=null,P=40,Q=40,ba=100,W=0,Y=
+mxUtils.bind(this,function(){null!=f?f(Ea):(l.setSelectionCells(Ea),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),X=l.getFreeInsertPoint(!0),ca=X.x,S=X.y;X=S;var Z=null,da="auto";y=null;for(var N=[],aa=null,ea=null,ka=0;ka<n.length&&"#"==n[ka].charAt(0);){c=n[ka].replace(/\r$/,"");for(ka++;ka<n.length&&"\\"==c.charAt(c.length-1)&&"#"==n[ka].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(n[ka].substring(1)),
+ka++;if("#"!=c.charAt(1)){var ra=c.indexOf(":");if(0<ra){var sa=mxUtils.trim(c.substring(1,ra)),ma=mxUtils.trim(c.substring(ra+1));"label"==sa?Z=Graph.sanitizeHtml(ma):"labelname"==sa&&0<ma.length&&"-"!=ma?O=ma:"labels"==sa&&0<ma.length&&"-"!=ma?T=JSON.parse(ma):"style"==sa?C=ma:"parentstyle"==sa?V=ma:"unknownStyle"==sa&&"-"!=ma?U=ma:"stylename"==sa&&0<ma.length&&"-"!=ma?M=ma:"styles"==sa&&0<ma.length&&"-"!=ma?R=JSON.parse(ma):"vars"==sa&&0<ma.length&&"-"!=ma?K=JSON.parse(ma):"identity"==sa&&0<ma.length&&
+"-"!=ma?fa=ma:"parent"==sa&&0<ma.length&&"-"!=ma?y=ma:"namespace"==sa&&0<ma.length&&"-"!=ma?d=ma:"width"==sa?p=ma:"height"==sa?A=ma:"collapsed"==sa&&"-"!=ma?G="true"==ma:"left"==sa&&0<ma.length?J=ma:"top"==sa&&0<ma.length?L=ma:"ignore"==sa?ea=ma.split(","):"connect"==sa?N.push(JSON.parse(ma)):"link"==sa?aa=ma:"padding"==sa?W=parseFloat(ma):"edgespacing"==sa?P=parseFloat(ma):"nodespacing"==sa?Q=parseFloat(ma):"levelspacing"==sa?ba=parseFloat(ma):"layout"==sa&&(da=ma)}}}if(null==n[ka])throw Error(mxResources.get("invalidOrMissingFile"));
+var wa=this.editor.csvToArray(n[ka].replace(/\r$/,""));ra=c=null;sa=[];for(ma=0;ma<wa.length;ma++)fa==wa[ma]&&(c=ma),y==wa[ma]&&(ra=ma),sa.push(mxUtils.trim(wa[ma]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Z&&(Z="%"+sa[0]+"%");if(null!=N)for(var va=0;va<N.length;va++)null==E[N[va].to]&&(E[N[va].to]=Object.create(null));fa=[];for(ma=ka+1;ma<n.length;ma++){var za=this.editor.csvToArray(n[ma].replace(/\r$/,""));if(null==za){var Ba=40<n[ma].length?n[ma].substring(0,40)+
+"...":n[ma];throw Error(Ba+" ("+ma+"):\n"+mxResources.get("containsValidationErrors"));}0<za.length&&fa.push(za)}l.model.beginUpdate();try{for(ma=0;ma<fa.length;ma++){za=fa[ma];var ua=null,qa=null!=c?d+za[c]:null;n=!1;null!=qa&&(ua=l.model.getCell(qa),n=null==ua||0<=mxUtils.indexOf(r,ua));var ia=new mxCell(Z,new mxGeometry(ca,X,0,0),C||"whiteSpace=wrap;html=1;");ia.collapsed=G;ia.vertex=!0;ia.id=qa;null==ua||n||l.model.setCollapsed(ua,G);for(var ja=0;ja<za.length;ja++)l.setAttributeForCell(ia,sa[ja],
+za[ja]),null==ua||n||l.setAttributeForCell(ua,sa[ja],za[ja]);if(null!=O&&null!=T){var na=ia.getAttribute(O),Aa=null!=na&&Object.prototype.hasOwnProperty.call(T,na)?T[na]:null;null!=Aa&&(l.labelChanged(ia,Aa),null==ua||n||l.cellLabelChanged(ua,Aa))}if(null!=M&&null!=R){var ha=ia.getAttribute(M),la=null!=ha&&Object.prototype.hasOwnProperty.call(R,ha)?R[ha]:null;null!=la&&(ia.style=la)}l.setAttributeForCell(ia,"placeholders","1");ia.style=l.replacePlaceholders(ia,ia.style,K);null==ua||n?l.fireEvent(new mxEventObject("cellsInserted",
+"cells",[ia])):(l.model.setStyle(ua,ia.style),0>mxUtils.indexOf(v,ua)&&v.push(ua),l.fireEvent(new mxEventObject("cellsInserted","cells",[ua])));n=null!=ua;ua=ia;if(!n)for(va=0;va<N.length;va++)E[N[va].to][ua.getAttribute(N[va].to)]=ua;null!=aa&&"link"!=aa&&(l.setLinkForCell(ua,ua.getAttribute(aa)),l.setAttributeForCell(ua,aa,null));var ya=l.getPreferredSizeForCell(ua);y=null!=ra?l.model.getCell(d+za[ra]):null;if(ua.vertex){Ba=null!=y?0:ca;ka=null!=y?0:S;null!=J&&null!=ua.getAttribute(J)&&(ua.geometry.x=
+Ba+parseFloat(ua.getAttribute(J)));null!=L&&null!=ua.getAttribute(L)&&(ua.geometry.y=ka+parseFloat(ua.getAttribute(L)));var Ca="@"==p.charAt(0)?ua.getAttribute(p.substring(1)):null;ua.geometry.width=null!=Ca&&"auto"!=Ca?parseFloat(ua.getAttribute(p.substring(1))):"auto"==p||"auto"==Ca?ya.width+W:parseFloat(p);var pa="@"==A.charAt(0)?ua.getAttribute(A.substring(1)):null;ua.geometry.height=null!=pa&&"auto"!=pa&&"width"!=A?parseFloat(pa):"auto"==A||"auto"==pa?ya.height+W:"width"==A?ua.geometry.width:
+parseFloat(A);X+=ua.geometry.height+Q}n?(null==B[qa]&&(B[qa]=[]),B[qa].push(ua)):(r.push(ua),null!=y?(y.style=l.replacePlaceholders(y,V,K),l.addCell(ua,y),t.push(y)):v.push(l.addCell(ua)))}for(ma=0;ma<t.length;ma++)Ca="@"==p.charAt(0)?t[ma].getAttribute(p.substring(1)):null,pa="@"==A.charAt(0)?t[ma].getAttribute(A.substring(1)):null,"auto"!=p&&"auto"!=Ca||"auto"!=A&&"auto"!=pa||l.updateGroupBounds([t[ma]],W,!0);var oa=v.slice(),Ea=v.slice();for(va=0;va<N.length;va++){var Ga=N[va];for(ma=0;ma<r.length;ma++){ua=
+r[ma];var Ja=mxUtils.bind(this,function(fb,ib,Wa){var db=ib.getAttribute(Wa.from);if(null!=db&&""!=db){db=db.split(",");for(var Hb=0;Hb<db.length;Hb++){var ub=E[Wa.to][db[Hb]];if(null==ub&&null!=U){ub=new mxCell(db[Hb],new mxGeometry(ca,S,0,0),U);ub.style=l.replacePlaceholders(ib,ub.style,K);var xb=l.getPreferredSizeForCell(ub);ub.geometry.width=xb.width+W;ub.geometry.height=xb.height+W;E[Wa.to][db[Hb]]=ub;ub.vertex=!0;ub.id=db[Hb];v.push(l.addCell(ub))}if(null!=ub){xb=Wa.label;null!=Wa.fromlabel&&
+(xb=(ib.getAttribute(Wa.fromlabel)||"")+(xb||""));null!=Wa.sourcelabel&&(xb=l.replacePlaceholders(ib,Wa.sourcelabel,K)+(xb||""));null!=Wa.tolabel&&(xb=(xb||"")+(ub.getAttribute(Wa.tolabel)||""));null!=Wa.targetlabel&&(xb=(xb||"")+l.replacePlaceholders(ub,Wa.targetlabel,K));var Bb="target"==Wa.placeholders==!Wa.invert?ub:fb;Bb=null!=Wa.style?l.replacePlaceholders(Bb,Wa.style,K):l.createCurrentEdgeStyle();xb=l.insertEdge(null,null,xb||"",Wa.invert?ub:fb,Wa.invert?fb:ub,Bb);if(null!=Wa.labels)for(Bb=
+0;Bb<Wa.labels.length;Bb++){var lb=Wa.labels[Bb],Gb=new mxCell(lb.label||Bb,new mxGeometry(null!=lb.x?lb.x:0,null!=lb.y?lb.y:0,0,0),"resizable=0;html=1;");Gb.vertex=!0;Gb.connectable=!1;Gb.geometry.relative=!0;null!=lb.placeholders&&(Gb.value=l.replacePlaceholders("target"==lb.placeholders==!Wa.invert?ub:fb,Gb.value,K));if(null!=lb.dx||null!=lb.dy)Gb.geometry.offset=new mxPoint(null!=lb.dx?lb.dx:0,null!=lb.dy?lb.dy:0);xb.insert(Gb)}if(null!=Wa.data)for(var Mb in Wa.data)l.setAttributeForCell(xb,Mb,
+Wa.data[Mb]);Ea.push(xb);mxUtils.remove(Wa.invert?fb:ub,oa)}}}});Ja(ua,ua,Ga);if(null!=B[ua.id])for(ja=0;ja<B[ua.id].length;ja++)Ja(ua,B[ua.id][ja],Ga)}}if(null!=ea)for(ma=0;ma<r.length;ma++)for(ua=r[ma],ja=0;ja<ea.length;ja++)l.setAttributeForCell(ua,mxUtils.trim(ea[ja]),null);if(0<v.length){var Ha=new mxParallelEdgeLayout(l);Ha.spacing=P;Ha.checkOverlap=!0;var Ma=function(){0<Ha.spacing&&Ha.execute(l.getDefaultParent());var fb=0,ib=0;0<v.length&&(ib=l.getCellGeometry(v[0]),fb=Math.round(l.snap(ib.x))-
+ib.x,ib=Math.round(l.snap(ib.y))-ib.y);for(var Wa=0;Wa<v.length;Wa++){var db=l.getCellGeometry(v[Wa]);db.x=Math.round(db.x+fb);db.y=Math.round(db.y+ib);"auto"==p&&(db.width=Math.round(l.snap(db.width)));"auto"==A&&(db.height=Math.round(l.snap(db.height)))}};"auto"==da&&1==oa.length&&(da=Ea.length==2*v.length-1?"verticaltree":"verticalflow");var eb="organic"==da||null!=EditorUi.CSV_ELK_LAYOUTS[da]?null:this.resolveLayoutList(da);if(null!=eb){var bb=Y;l.view.validate();var tb=l.createLayouts(eb);this.scopeLayoutsToCells(tb,
+Ea);this.executeLayouts(tb,function(){Ma();bb()});Y=null}else if("circle"==da){var Db=new mxCircleLayout(l);Db.disableEdgeStyle=!1;Db.resetEdges=!1;var cb=Db.isVertexIgnored;Db.isVertexIgnored=function(fb){return cb.apply(this,arguments)||0>mxUtils.indexOf(v,fb)};this.executeLayout(function(){Db.execute(l.getDefaultParent());Ma()},!0,Y);Y=null}else if("verticaltree"==da||"horizontaltree"==da){l.view.validate();var gb=new mxCompactTreeLayout(l,"horizontaltree"==da);gb.levelDistance=Q;gb.edgeRouting=
+!1;gb.resetEdges=!1;gb.sortEdges=!0;var wb=gb.isVertexIgnored;gb.isVertexIgnored=function(fb){return wb.apply(this,arguments)||0>mxUtils.indexOf(v,fb)};this.executeLayout(function(){gb.execute(l.getDefaultParent(),0<oa.length?oa[0]:null)},!0,Y);Y=null}else if("orgchart"==da){l.view.validate();var Sa=new mxOrgChartLayout(l,2,ba,Q),Xa=Sa.isVertexIgnored;Sa.isVertexIgnored=function(fb){return Xa.apply(this,arguments)||0>mxUtils.indexOf(v,fb)};this.executeLayout(function(){Sa.execute(l.getDefaultParent());
+Ma()},!0,Y);Y=null}else if("organic"==da||"auto"==da&&Ea.length>v.length){l.view.validate();var vb=new mxFastOrganicLayout(l);vb.forceConstant=3*Q;vb.disableEdgeStyle=!1;vb.resetEdges=!1;var pb=vb.isVertexIgnored;vb.isVertexIgnored=function(fb){return pb.apply(this,arguments)||0>mxUtils.indexOf(v,fb)};this.executeLayout(function(){vb.execute(l.getDefaultParent());Ma()},!0,Y);Y=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[da]){l.view.validate();bb=Y;var jb=EditorUi.CSV_ELK_LAYOUTS[da],qb=mxUtils.clone(jb.config);
+qb["elk.spacing.nodeNode"]=Q;qb["elk.layered.spacing.nodeNodeBetweenLayers"]=ba;qb["elk.spacing.edgeEdge"]=P;qb["elk.layered.spacing.edgeEdgeBetweenLayers"]=P;var Za=l.createLayouts([{layout:jb.layout,config:qb}]);this.scopeLayoutsToCells(Za,Ea);l.model.beginUpdate();var Jb=!1,Ab=function(){Jb||(Jb=!0,l.model.endUpdate())},yb=this;try{Za[0].prepare(l.getDefaultParent(),function(fb,ib){null!=fb?(Ab(),yb.handleError(fb)):yb.executeLayout(function(){ib();var Wa=l.getBoundingBoxFromGeometry(Ea);null!=
+Wa&&l.moveCells(Ea,ca-Wa.x,S-Wa.y)},!0,function(){Ab();bb()})})}catch(fb){throw Ab(),fb;}Y=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=Y&&Y()}}catch(fb){this.handleError(fb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(f+=l+n+"="+urlParams[n],l="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=
+function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),n;for(n in urlParams)0>mxUtils.indexOf(l,n)&&(c=0==f?c+"?":c+"&",null!=urlParams[n]&&(c+=n+"="+urlParams[n],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,l,n,r){c=new LinkDialog(this,c,f,l,!0,n,r);this.showDialog(c.container,440,null,!0,!0);c.init()};
+EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=
+c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);
+Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(c);
+this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};
+EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var H=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){H.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),l=this.getSelectionState(),n=this.isDiagramActive(),r="1"==urlParams.embed&&this.editor.graph.isEnabled()||
+null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&r);this.actions.get("redo").setEnabled(this.canRedo()&&r);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(n&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(n&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(n&&
+1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(n&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(n&&l.image&&0<l.cells.length);this.actions.get("pageSetup").setEnabled(n);this.actions.get("shadowVisible").setEnabled(n);this.actions.get("connectionArrows").setEnabled(n);this.actions.get("connectionPoints").setEnabled(n);this.actions.get("copyStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=
+this.copiedStyle&&n&&0<l.cells.length);this.actions.get("copyTextStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&n&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length&&!l.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<l.cells.length);this.actions.get("createShape").setEnabled(n);this.actions.get("createRevision").setEnabled(n);this.actions.get("moveToFolder").setEnabled(null!=
+f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=
+this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(n&&
+null!=c&&null!=c.shape&&null!=c.shape.stencil)};var D=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);D.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,n,r,t,v,B){var E=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");
+else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(E.getSvg(n,r,t)),"image/svg+xml");else{var K=c.getFileData(!0,null,null,null,null,!0),C=E.getGraphBounds(),R=Math.floor(C.width*r/E.view.scale),M=Math.floor(C.height*r/E.view.scale);if(K.length<=MAX_REQUEST_SIZE&&R*M<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas())if(c.isRemoteExportEnabled()){var O={globalVars:E.getExportVariables()};B&&(O.grid={size:E.gridSize,steps:E.view.gridSteps,color:E.view.gridColor});
+c.saveRequest(f,l,function(U,T){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(T||"0")+(null!=U?"&filename="+encodeURIComponent(U):"")+"&extras="+encodeURIComponent(JSON.stringify(O))+(0<v?"&dpi="+v:"")+"&bg="+(null!=n?n:"none")+"&w="+R+"&h="+M+"&border="+t+"&xml="+encodeURIComponent(K))})}else c.handleError({message:mxResources.get("notAvailable")});else"png"==l?c.exportImage(r,null==n||"none"==n,!0,!1,!1,t,!0,!1,null,B,v):c.exportImage(r,!1,!0,!1,!1,t,!0,!1,"jpeg",B);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});
+EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var n=c;this.currentPage!=this.pages[l]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),n.model.setRoot(this.pages[l].root));f+=this.pages[l].getName()+" "+n.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,
+f,l){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){l.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));l.html=f;return}l.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var l={id:c.getId()};l.type=f?"layer":c.edge?"edge":c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(l.parent=f.getId()));c.edge&&(null!=c.source&&(l.source=c.source.getId()),null!=c.target&&
+(l.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),l);c=f.attributes;f={};for(var n=0,r=0;r<c.length;r++){var t=c[r].nodeName;"label"!=t&&"placeholders"!=t&&"id"!=t&&(f[t]=c[r].nodeValue,n++)}0<n&&(l.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,l);return l};EditorUi.prototype.getJsonForPage=function(c,f){var l=this.editor.graph.getModel();var n=null==c||c==this.currentPage?l.getRoot():this.updatePageRoot(c).root;var r=
+[],t=mxUtils.bind(this,function(C,R){r.push(this.getJsonForExportCell(C,R));R=C.getChildCount();for(var M=0;M<R;M++)t(C.getChildAt(M),!1)});if(null!=f){n={};for(var v=0;v<f.length;v++)n[f[v].getId()]=!0;for(v=0;v<f.length;v++){for(var B=f[v],E=B.getParent(),K=!1;null!=E;){if(n[E.getId()]){K=!0;break}E=E.getParent()}K||t(B,l.isLayer(B))}}else for(f=n.getChildCount(),v=0;v<f;v++)t(n.getChildAt(v),!0);v={};null!=c&&(v.id=c.getId(),v.name=c.getName());v.cells=r;return v};EditorUi.prototype.createJsonForExport=
+function(c,f,l,n){var r={version:EditorUi.VERSION};f&&(r.data=mxUtils.getXml(this.getXmlFileData(!n,!c,!l)));f=[];if(n)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));r.pages=f;return r};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},l=document.createElement("div");l.style.whiteSpace="nowrap";
+var n=document.createElement("h3");mxUtils.write(n,mxUtils.htmlEntities(c));l.appendChild(n);var r=document.createElement("div");r.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";r.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var t={};try{var v=mxSettings.getCustomLibraries();for(c=0;c<v.length;c++){var B=v[c];if("R"==B.substring(0,1)){var E=JSON.parse(decodeURIComponent(B.substring(1)));t[E[0]]={id:E[0],title:E[1],downloadUrl:E[2]}}}}catch(K){}this.remoteInvoke("getCustomLibraries",
+null,null,function(K){r.innerText="";if(0==K.length)r.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var C=0;C<K.length;C++){var R=K[C];t[R.id]&&(f[R.id]=R);var M=this.addCheckbox(r,R.title,t[R.id]);(function(O,U){mxEvent.addListener(U,"change",function(){this.checked?f[O.id]=O:delete f[O.id]})})(R,M)}},mxUtils.bind(this,function(K){r.innerText="";var C=document.createElement("div");C.style.padding="8px";
+C.style.textAlign="center";mxUtils.write(C,mxResources.get("error")+": ");mxUtils.write(C,null!=K&&null!=K.message?K.message:mxResources.get("unknownError"));r.appendChild(C)}));l.appendChild(r);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var K=0,C;for(C in f)null==t[C]&&(K++,mxUtils.bind(this,function(R){this.remoteInvoke("getFileContent",[R.downloadUrl],null,mxUtils.bind(this,function(M){K--;0==K&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,
+M,R)),this.showSidebar()}catch(O){this.handleError(O,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){K--;0==K&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[C]));for(C in t)f[C]||this.closeLibrary(new RemoteLibrary(this,null,t[C]));0==K&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns=
+{getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=
+[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=null!=f?f.callbackId:null,n="number"===typeof l&&0<=l&&l<this.remoteInvokeCallbacks.length?this.remoteInvokeCallbacks[l]:null;if(null==n)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?n.error&&n.error(c.error.errResp):n.callback&&n.callback.apply(this,c.resp);this.remoteInvokeCallbacks[l]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,n,r){var t=!0,v=window.setTimeout(mxUtils.bind(this,
+function(){t=!1;r({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),B=mxUtils.bind(this,function(){window.clearTimeout(v);t&&n.apply(this,arguments)}),E=mxUtils.bind(this,function(){window.clearTimeout(v);t&&r.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:B,error:E});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,
+"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var l=mxUtils.bind(this,function(K,C){var R={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=C?R.error={errResp:C}:null!=K&&(R.resp=K);this.remoteWin.postMessage(JSON.stringify(R),"*")});try{var n=c.funtionName,r=null!=n&&Object.prototype.hasOwnProperty.call(this.remoteInvokableFns,n)?this.remoteInvokableFns[n]:null;if(null!=r&&"function"===typeof this[n]){if(r.allowedDomains){for(var t=!1,v=0;v<r.allowedDomains.length;v++)if(f==
+"https://"+r.allowedDomains[v]){t=!0;break}if(!t){l(null,"Invalid Call: "+n+" is not allowed.");return}}var B=c.functionArgs;Array.isArray(B)||(B=[]);if(r.isAsync)B.push(function(){l(Array.prototype.slice.apply(arguments))}),B.push(function(K){l(null,K||"Unkown Error")}),this[n].apply(this,B);else{var E=this[n].apply(this,B);l([E])}}else l(null,"Invalid Call: "+n+" is not found.")}catch(K){l(null,"Invalid Call: An error occurred, "+K.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==
+this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var n=l.open("database",2);n.onupgradeneeded=function(r){try{var t=n.result;1>r.oldVersion&&t.createObjectStore("objects",{keyPath:"key"});2>r.oldVersion&&(t.createObjectStore("files",{keyPath:"title"}),t.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(v){null!=f&&f(v)}};n.onsuccess=mxUtils.bind(this,function(r){try{var t=n.result;this.database=t;EditorUi.migrateStorageFiles&&
+(StorageFile.migrate(t),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(v){if((!v||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var B=document.createElement("iframe");B.style.display="none";B.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(B);var E=!0,K=!1,
+C,R=0,M=mxUtils.bind(this,function(){K=!0;this.setDatabaseItem(".drawioMigrated3",!0);B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),O=mxUtils.bind(this,function(){R++;U()}),U=mxUtils.bind(this,function(){try{if(R>=C.length)M();else{var V=C[R];StorageFile.getFileContent(this,V,mxUtils.bind(this,function(fa){null==fa||".scratchpad"==V&&fa==this.emptyLibraryXml?B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",
+functionArgs:[V]}),"*"):O()}),O)}}catch(fa){console.log(fa)}}),T=mxUtils.bind(this,function(V){try{this.setDatabaseItem(null,[{title:V.title,size:V.data.length,lastModified:Date.now(),type:V.isLib?"L":"F"},{title:V.title,data:V.data}],O,O,["filesInfo","files"])}catch(fa){console.log(fa)}});v=mxUtils.bind(this,function(V){try{if(V.source==B.contentWindow){var fa={};try{fa=JSON.parse(V.data)}catch(y){}"init"==fa.event?(B.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",
+funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=fa.event||K||(E?null!=fa.resp&&0<fa.resp.length&&null!=fa.resp[0]?(C=fa.resp[0],E=!1,U()):M():null!=fa.resp&&0<fa.resp.length&&null!=fa.resp[0]?T(fa.resp[0]):O())}}catch(y){console.log(y)}});window.addEventListener("message",v)}})));c(t);t.onversionchange=function(){t.close()}}catch(v){null!=f?f(v):null!=window.console&&console.warn(v)}});n.onerror=f;n.onblocked=function(){}}catch(r){null!=f?f(r):null!=window.console&&console.error(r)}else null!=
+f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,l,n,r){this.openDatabase(mxUtils.bind(this,function(t){try{r=r||"objects";Array.isArray(r)||(r=[r],c=[c],f=[f]);var v=t.transaction(r,"readwrite");v.oncomplete=l;v.onerror=n;for(t=0;t<r.length;t++)v.objectStore(r[t]).put(null!=c&&null!=c[t]?{key:c[t],data:f[t]}:f[t])}catch(B){null!=n&&n(B)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,n){this.openDatabase(mxUtils.bind(this,function(r){try{n=
+n||"objects";Array.isArray(n)||(n=[n],c=[c]);var t=r.transaction(n,"readwrite");t.oncomplete=f;t.onerror=l;for(r=0;r<n.length;r++)t.objectStore(n[r]).delete(c[r])}catch(v){null!=l&&l(v)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,n){this.openDatabase(mxUtils.bind(this,function(r){try{n=n||"objects";var t=r.transaction([n],"readonly").objectStore(n).get(c);t.onsuccess=function(){f(t.result)};t.onerror=l}catch(v){null!=l&&l(v)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,
+function(n){try{l=l||"objects";var r=n.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),t=[];r.onsuccess=function(v){null==v.target.result?c(t):(t.push(v.target.result.value),v.target.result.continue())};r.onerror=f}catch(v){null!=f&&f(v)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(n){try{l=l||"objects";var r=n.transaction([l],"readonly").objectStore(l).getAllKeys();r.onsuccess=function(){c(r.result)};r.onerror=
+f}catch(t){null!=f&&f(t)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var l=this.getCurrentFile();null!=l?l.getComments(c,f):c([])};EditorUi.prototype.addComment=
+function(c,f,l){var n=this.getCurrentFile();null!=n?n.addComment(c,f,l):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.anchoredCommentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.anchoredCommentsSupported():!1};EditorUi.prototype.mentionsSupported=function(){var c=this.getCurrentFile();
+return null!=c?c.mentionsSupported():!1};EditorUi.prototype.freeMentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.freeMentionsSupported():!1};EditorUi.prototype.mentionsLiveSearch=function(){var c=this.getCurrentFile();return null!=c?c.mentionsLiveSearch():!1};EditorUi.prototype.mentionNotificationsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionNotificationsSupported():!0};EditorUi.prototype.getMentionCandidates=function(c,f,l){var n=this.getCurrentFile();
+null!=n?n.getMentionCandidates(c,f,l):c([])};EditorUi.prototype.serializeMention=function(c){return"+"+c.email};EditorUi.prototype.parseMentionTokens=function(c){for(var f=/[+@]([A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,})/g,l=[],n=0,r;null!=(r=f.exec(c));)r.index>n&&l.push(c.substring(n,r.index)),l.push({email:r[1]}),n=r.index+r[0].length;n<c.length&&l.push(c.substring(n));return l};EditorUi.prototype.getCommentCacheTarget=function(){var c=this.getCurrentFile();return null!=c?
+c:this};EditorUi.prototype.refreshCommentCache=function(c,f){if(this.commentsSupported()){var l=this.getCommentCacheTarget();if(null!=l.commentCacheCallbacks)l.commentCacheCallbacks.push([c,f]);else{l.commentCacheCallbacks=[[c,f]];var n=mxUtils.bind(this,function(r,t){var v=l.commentCacheCallbacks;l.commentCacheCallbacks=null;for(var B=0;null!=v&&B<v.length;B++)if(null!=v[B][r])v[B][r](t)});this.getComments(mxUtils.bind(this,function(r){this.getCommentCacheTarget()==l&&(l.commentCache=r,this.fireEvent(new mxEventObject("commentsChanged")));
+n(0,r)}),mxUtils.bind(this,function(r){n(1,r)}))}}else null!=c&&c(null)};EditorUi.prototype.commentsUpdated=function(){if(this.commentsSupported()){var c=this.getCurrentFile();null!=c&&null!=c.sync&&c.sync.sendCommentsChangedMessage();this.refreshCommentCache()}};EditorUi.prototype.getUnresolvedCommentCount=function(){var c=this.getCommentCacheTarget().commentCache,f=0;if(null!=c)for(var l=0;l<c.length;l++)c[l].isResolved||f++;return f};EditorUi.prototype.getCommentAnchorCells=function(c){var f=c.getAnchorCellIds(),
+l=[];if(null!=f&&0<f.length){c=c.getAnchorPageId();var n=null==c?this.currentPage:this.getPageById(c);if(null!=n)if(n==this.currentPage)for(c=0;c<f.length;c++)n=this.editor.graph.model.getCell(f[c]),null!=n&&l.push(n);else{try{this.updatePageRoot(n)}catch(B){return l}if(null!=n.root){var r={},t=0;for(c=0;c<f.length;c++)r[f[c]]||(r[f[c]]=!0,t++);var v=function(B){if(0<t){r[B.getId()]&&(r[B.getId()]=!1,l.push(B),t--);for(var E=0;E<B.getChildCount();E++)v(B.getChildAt(E))}};v(n.root)}}}return l};EditorUi.prototype.gotoCommentAnchor=
+function(c){var f=c.getAnchorPageId();if(null!=f&&null!=this.currentPage&&f!=this.currentPage.getId()){f=this.getPageById(f);if(null==f)return!1;this.selectPage(f)}f=this.editor.graph;var l=c.getAnchorCellIds();if(null!=l&&0<l.length){c=[];for(var n=0;n<l.length;n++){var r=f.model.getCell(l[n]);null!=r&&c.push(r)}return 0<c.length?(f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c,"#0071e3",2E3),f.scrollCellToVisible(c[0]),!0):!1}l=c.getAnchorRect();null!=l&&0<l.w&&0<l.h&&f.fitWindow(new mxRectangle(l.x,
+l.y,l.w,l.h),0);c=c.getAnchorPoint();if(null!=c){l=f.view.scale;n=f.view.translate;f=f.container;f.scrollLeft=Math.round((c.x+n.x)*l-f.clientWidth/2);f.scrollTop=Math.round((c.y+n.y)*l-f.clientHeight/2);var t=document.createElement("div");t.className="geCommentAnchorMarker";t.style.left=Math.round((c.x+n.x)*l)+"px";t.style.top=Math.round((c.y+n.y)*l)+"px";f.appendChild(t);window.setTimeout(function(){null!=t.parentNode&&t.parentNode.removeChild(t)},2E3)}return!0};EditorUi.prototype.addCommentsBadge=
+function(c){var f=document.createElement("span");f.className="geCommentsBadge";f.style.display="none";c.appendChild(f);c=mxUtils.bind(this,function(){var l=this.getUnresolvedCommentCount();f.style.display=0<l?"":"none";f.innerText="";mxUtils.write(f,99<l?"99+":String(l))});this.addListener("commentsChanged",c);this.editor.addListener("fileLoaded",c);c();return f};EditorUi.prototype.installCommentDragSource=function(c){var f=this,l=document.createElement("div");l.style.width="24px";l.style.height=
+"24px";l.style.backgroundImage="url("+Editor.lightDarkCommentImage+")";l.style.backgroundSize="100% 100%";l.style.opacity="0.9";c=mxUtils.makeDraggable(c,function(){return f.editor.graph},function(r,t,v,B,E){null!=f.currentPage&&null!=f.menus&&null!=f.menus.showCommentsWindow&&(r=null!=v?{p:f.currentPage.getId(),c:v.id}:{p:f.currentPage.getId(),pt:{x:Math.round(B),y:Math.round(E)}},f.menus.showCommentsWindow(null,r))},l);var n=c.mouseDown;c.mouseDown=function(r){mxEvent.isMouseEvent(r)&&!mxEvent.isPopupTrigger(r)&&
+f.commentsSupported()&&f.anchoredCommentsSupported()&&f.canComment()&&n.apply(this,arguments)};return c};EditorUi.prototype.updateCommentOverlays=function(){var c=this.editor.graph;if(null!=this.commentOverlays)for(var f=0;f<this.commentOverlays.length;f++)c.removeCellOverlay(this.commentOverlays[f].cell,this.commentOverlays[f].overlay);this.commentOverlays=null;var l=this.getCurrentFile();if(null!=l&&l.anchoredCommentsSupported()&&null!=l.commentCache&&!this.editor.isChromelessView()){var n=null!=
+this.currentPage?this.currentPage.getId():null,r={};for(f=0;f<l.commentCache.length;f++){var t=l.commentCache[f],v=t.getAnchorCellIds();if(!t.isResolved&&null!=v&&t.getAnchorPageId()==n)for(t=0;t<v.length;t++)r[v[t]]=!0}this.commentOverlays=[];for(var B in r)mxUtils.bind(this,function(E){var K=c.model.getCell(E);if(null!=K){var C=new mxCellOverlay(new mxImage(Editor.lightDarkCommentImage,16,16),mxResources.get("comments"),mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,new mxPoint(8,8));C.isCommentOverlay=
+!0;C.cursor="pointer";C.addListener(mxEvent.CLICK,mxUtils.bind(this,function(){null!=this.menus&&null!=this.menus.showCommentsWindow&&this.menus.showCommentsWindow(E)}));c.addCellOverlay(K,C);this.commentOverlays.push({cell:K,overlay:C})}})(B)}};EditorUi.prototype.newComment=function(c,f){var l=this.getCurrentFile();return null!=l?l.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=
+c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};
+EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,n,r,t,v,B){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,n,r,t,v,B)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");
+return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,n,r,t,v,B,E,K,C,R,M,O,U,T){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,n,r,t,v,B,
+E,K,C,R,M,O,U,T)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,n)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};
+EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,l,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,l,n,r){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,
+f,l,n,r)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var l=localStorage.key(f),n=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<n.length){var r="<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(r||n)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=
+function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
+var CommentsWindow=function(b,k,m,g,q,u){function x(){for(var N=J.getElementsByTagName("div"),aa=0,ea=0;ea<N.length;ea++)"none"!=N[ea].style.display&&N[ea].parentNode==J&&aa++;L.style.display=0==aa?"block":"none"}function z(N){for(var aa=0;aa<y.length;aa++)if(null!=y[aa].email&&null!=N&&y[aa].email.toLowerCase()==N.toLowerCase())return y[aa].displayName||N;return N}function F(N){var aa=document.createElement("span");aa.className="geCommentMention";aa.setAttribute("data-mention",b.serializeMention(N));
+null!=N.email&&aa.setAttribute("data-email",N.email);aa.contentEditable="false";mxUtils.write(aa,"@"+(N.displayName||(null!=N.email?z(N.email):N.id)));return aa}function I(N,aa){N.innerText="";aa=null!=aa?aa:"";if(O){aa=b.parseMentionTokens(aa);for(var ea=0;ea<aa.length;ea++)"string"===typeof aa[ea]?mxUtils.write(N,aa[ea]):N.appendChild(F(aa[ea]))}else mxUtils.write(N,aa)}function H(N,aa,ea,ka){function ra(oa){for(var Ea in Aa)for(var Ga=0;Ga<Aa[Ea].length;Ga++)oa(Aa[Ea][Ga],"down"==Ea?ya:"move"==
+Ea?Ca:pa)}function sa(oa){oa=mxUtils.convertPoint(za,mxEvent.getClientX(oa),mxEvent.getClientY(oa));return new mxPoint(oa.x/va.view.scale-va.view.translate.x,oa.y/va.view.scale-va.view.translate.y)}function ma(){ra(function(oa,Ea){document.removeEventListener(oa,Ea,!0)});document.removeEventListener("keydown",la,!0);window.setTimeout(function(){document.removeEventListener("click",ha,!0)},0);za.classList.remove("geCommentAnchorPicking");va.setEnabled(Ba);null!=ua&&null!=ua.parentNode&&ua.parentNode.removeChild(ua)}
function wa(oa){ma();null!=oa&&(N.anchor=oa,f(N,aa,ea))}var va=b.editor.graph,za=va.container,Ba=va.isEnabled(),ua=null,qa=null,ia=null,ja=null,na=null;va.setEnabled(!1);za.classList.add("geCommentAnchorPicking");var Aa=mxClient.IS_POINTER?{down:["pointerdown"],move:["pointermove"],up:["pointerup"]}:{down:["mousedown","touchstart"],move:["mousemove","touchmove"],up:["mouseup","touchend"]},ha=function(oa){za.contains(mxEvent.getSource(oa))&&mxEvent.consume(oa)},la=function(oa){27==oa.keyCode&&(wa(null),
-mxEvent.consume(oa))},xa=function(oa){za.contains(mxEvent.getSource(oa))?(qa=sa(oa),ia=new mxPoint(mxEvent.getClientX(oa),mxEvent.getClientY(oa)),ka&&(ua=document.createElement("div"),ua.className="geCommentAnchorPickPreview",za.appendChild(ua)),mxEvent.consume(oa)):wa(null)},Ca=function(oa){if(null!=qa&&(ja=sa(oa),na=new mxPoint(mxEvent.getClientX(oa),mxEvent.getClientY(oa)),null!=ua)){var Da=va.view.scale,Fa=va.view.translate;ua.style.left=Math.round((Math.min(qa.x,ja.x)+Fa.x)*Da)+"px";ua.style.top=
-Math.round((Math.min(qa.y,ja.y)+Fa.y)*Da)+"px";ua.style.width=Math.round(Math.abs(ja.x-qa.x)*Da)+"px";ua.style.height=Math.round(Math.abs(ja.y-qa.y)*Da)+"px";mxEvent.consume(oa)}},pa=function(oa){if(null!=qa)if(null==b.currentPage)wa(null);else{var Da=b.currentPage.getId();if(ka){var Fa=ja,Ia=na;try{Fa=sa(oa),Ia=new mxPoint(mxEvent.getClientX(oa),mxEvent.getClientY(oa))}catch(Ha){}null==Fa||null==Ia||4>Math.abs(Ia.x-ia.x)&&4>Math.abs(Ia.y-ia.y)?wa(null):wa({p:Da,r:{x:Math.round(Math.min(qa.x,Fa.x)),
-y:Math.round(Math.min(qa.y,Fa.y)),w:Math.round(Math.abs(Fa.x-qa.x)),h:Math.round(Math.abs(Fa.y-qa.y))}})}else wa({p:Da,pt:{x:Math.round(qa.x),y:Math.round(qa.y)}});mxEvent.consume(oa)}};window.setTimeout(function(){ra(function(oa,Da){document.addEventListener(oa,Da,!0)});document.addEventListener("click",ha,!0);document.addEventListener("keydown",la,!0)},0)}function D(N){N=null!=N?mxUtils.trim(N.replace(/\s+/g," ")):"";25<N.length&&(N=N.substring(0,25)+"…");return N}function c(N){var aa="";try{var ea=
+mxEvent.consume(oa))},ya=function(oa){za.contains(mxEvent.getSource(oa))?(qa=sa(oa),ia=new mxPoint(mxEvent.getClientX(oa),mxEvent.getClientY(oa)),ka&&(ua=document.createElement("div"),ua.className="geCommentAnchorPickPreview",za.appendChild(ua)),mxEvent.consume(oa)):wa(null)},Ca=function(oa){if(null!=qa&&(ja=sa(oa),na=new mxPoint(mxEvent.getClientX(oa),mxEvent.getClientY(oa)),null!=ua)){var Ea=va.view.scale,Ga=va.view.translate;ua.style.left=Math.round((Math.min(qa.x,ja.x)+Ga.x)*Ea)+"px";ua.style.top=
+Math.round((Math.min(qa.y,ja.y)+Ga.y)*Ea)+"px";ua.style.width=Math.round(Math.abs(ja.x-qa.x)*Ea)+"px";ua.style.height=Math.round(Math.abs(ja.y-qa.y)*Ea)+"px";mxEvent.consume(oa)}},pa=function(oa){if(null!=qa)if(null==b.currentPage)wa(null);else{var Ea=b.currentPage.getId();if(ka){var Ga=ja,Ja=na;try{Ga=sa(oa),Ja=new mxPoint(mxEvent.getClientX(oa),mxEvent.getClientY(oa))}catch(Ha){}null==Ga||null==Ja||4>Math.abs(Ja.x-ia.x)&&4>Math.abs(Ja.y-ia.y)?wa(null):wa({p:Ea,r:{x:Math.round(Math.min(qa.x,Ga.x)),
+y:Math.round(Math.min(qa.y,Ga.y)),w:Math.round(Math.abs(Ga.x-qa.x)),h:Math.round(Math.abs(Ga.y-qa.y))}})}else wa({p:Ea,pt:{x:Math.round(qa.x),y:Math.round(qa.y)}});mxEvent.consume(oa)}};window.setTimeout(function(){ra(function(oa,Ea){document.addEventListener(oa,Ea,!0)});document.addEventListener("click",ha,!0);document.addEventListener("keydown",la,!0)},0)}function D(N){N=null!=N?mxUtils.trim(N.replace(/\s+/g," ")):"";25<N.length&&(N=N.substring(0,25)+"…");return N}function c(N){var aa="";try{var ea=
b.editor.graph.getLabel(N);"string"===typeof ea&&(aa=Editor.convertHtmlToText(ea))}catch(ka){}return D(aa)||mxResources.get("shape")}function f(N,aa,ea){function ka(ja){if(ea){var na=document.createElement("span");na.className="geCommentAnchorRemove";na.setAttribute("title",mxResources.get("remove"));mxUtils.write(na,"×");mxEvent.addListener(na,"click",function(Aa){N.anchor=null;f(N,aa,ea);Aa.preventDefault();mxEvent.consume(Aa)});ja.appendChild(na)}}function ra(ja,na,Aa,ha){var la=document.createElement(ha?
-"span":"a");la.className="geCommentAnchorChip"+(ha?" geCommentAnchorChipDeleted":"");la.innerHTML=ja;ja=document.createElement("span");mxUtils.write(ja,na);la.appendChild(ja);ha||(null!=Aa&&la.setAttribute("title",Aa),mxEvent.addListener(la,"click",function(xa){b.gotoCommentAnchor(N);xa.preventDefault();mxEvent.consume(xa)}));ka(la);aa.appendChild(la)}aa.innerText="";aa.style.display="";if(null!=N.getAnchorCellId()){var sa=b.getCommentAnchorCells(N),ma=null,wa=null;if(0==sa.length)ma=mxResources.get("shapeDeleted");
+"span":"a");la.className="geCommentAnchorChip"+(ha?" geCommentAnchorChipDeleted":"");la.innerHTML=ja;ja=document.createElement("span");mxUtils.write(ja,na);la.appendChild(ja);ha||(null!=Aa&&la.setAttribute("title",Aa),mxEvent.addListener(la,"click",function(ya){b.gotoCommentAnchor(N);ya.preventDefault();mxEvent.consume(ya)}));ka(la);aa.appendChild(la)}aa.innerText="";aa.style.display="";if(null!=N.getAnchorCellId()){var sa=b.getCommentAnchorCells(N),ma=null,wa=null;if(0==sa.length)ma=mxResources.get("shapeDeleted");
else if(1==sa.length)ma=c(sa[0]),wa=mxResources.get("shape");else{ma=sa.length+" "+mxResources.get("cells");wa=[];for(var va=0;va<sa.length;va++)wa.push(c(sa[va]));wa=wa.join("\n")}ra('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',ma,
wa,0==sa.length)}else if(null!=N.getAnchorPageId())sa=b.getPageById(N.getAnchorPageId()),wa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 1.5h5.5L12.5 4.5v10h-8.5z M9.5 1.5v3h3"/></svg>',ma=null,null!=N.getAnchorRect()?(wa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="8" rx="1" stroke-dasharray="2.6 2.2"/></svg>',
ma="area"):null!=N.getAnchorPoint()&&(wa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',ma="point"),ma=null==sa?mxResources.get("pageNotFound"):null!=ma?mxResources.get(ma):D(sa.getName())||mxResources.get("page"),ra(wa,ma,null!=sa?sa.getName()||
@@ -14865,7 +14875,7 @@ mxResources.get("page"):null,null==sa);else if(ea&&null!=b.currentPage){var za=f
"mousedown",ia),ia=null)},ua=document.createElement("a");ua.className="geCommentAnchorChip geCommentAnchorAttach";ua.setAttribute("title",mxResources.get("attach"));ua.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8M4.5 6.5L8 10l3.5-3.5M3 13h10"/></svg>';ma=document.createElement("span");mxUtils.write(ma,mxResources.get("attach"));ua.appendChild(ma);var qa=
null,ia=null;mxEvent.addListener(ua,"click",function(ja){if(null!=qa)Ba();else if(null!=b.currentPage){var na=b.editor.graph,Aa=b.currentPage.getId();qa=document.createElement("div");qa.className="geCommentMentionMenu";1==na.getSelectionCount()?za('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
c(na.getSelectionCell()),function(){N.anchor={p:Aa,c:na.getSelectionCell().id}}):1<na.getSelectionCount()&&za('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',na.getSelectionCount()+" "+mxResources.get("cells"),function(){for(var ha=na.getSelectionCells(),
-la=[],xa=0;xa<ha.length;xa++)la.push(ha[xa].id);N.anchor={p:Aa,c:la}});za('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',mxResources.get("point")+"…",function(){H(N,aa,ea,!1)});za('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="8" rx="1" stroke-dasharray="2.6 2.2"/></svg>',
+la=[],ya=0;ya<ha.length;ya++)la.push(ha[ya].id);N.anchor={p:Aa,c:la}});za('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',mxResources.get("point")+"…",function(){H(N,aa,ea,!1)});za('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="8" rx="1" stroke-dasharray="2.6 2.2"/></svg>',
mxResources.get("area")+"…",function(){H(N,aa,ea,!0)});za('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 1.5h5.5L12.5 4.5v10h-8.5z M9.5 1.5v3h3"/></svg>',mxResources.get("currentPage"),function(){N.anchor={p:Aa}});qa.style.left=ua.offsetLeft+"px";qa.style.top=ua.offsetTop+ua.offsetHeight+2+"px";aa.parentNode.insertBefore(qa,aa.nextSibling);ia=function(ha){ha=mxEvent.getSource(ha);
null==qa||ha==ua||ua.contains(ha)||qa.contains(ha)||Ba()};mxEvent.addListener(document,"mousedown",ia)}ja.preventDefault();mxEvent.consume(ja)});aa.appendChild(ua)}else aa.style.display="none"}function l(N){if("TEXTAREA"==N.nodeName)return N.value;var aa=[],ea=function(ka){for(ka=ka.firstChild;null!=ka;ka=ka.nextSibling)3==ka.nodeType?aa.push(ka.nodeValue):1==ka.nodeType&&("BR"==ka.nodeName?aa.push("\n"):null!=ka.getAttribute&&null!=ka.getAttribute("data-mention")?aa.push(ka.getAttribute("data-mention")):
(("DIV"==ka.nodeName||"P"==ka.nodeName)&&0<aa.length&&"\n"!=aa[aa.length-1]&&!/\n$/.test(aa[aa.length-1])&&aa.push("\n"),ea(ka)))};ea(N);return aa.join("").replace(/\u00a0/g," ")}function n(N){function aa(){null!=ma&&null!=ma.parentNode&&ma.parentNode.removeChild(ma);za=ma=null}function ea(){var qa=window.getSelection();if(null==qa||0==qa.rangeCount)return null;qa=qa.getRangeAt(0);if(!qa.collapsed||3!=qa.startContainer.nodeType||!N.contains(qa.startContainer))return null;var ia=qa.startContainer.nodeValue.substring(0,
@@ -14876,38 +14886,38 @@ qa;if(0==va.length)aa();else for(wa=Math.min(wa,va.length-1),null==ma&&(ma=docum
ja.className="geCommentMentionImg",ja.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="6" cy="5.5" r="2.4"/><path d="M1.5 13.5c0-2.6 2-3.9 4.5-3.9s4.5 1.3 4.5 3.9"/><circle cx="11.3" cy="6" r="2"/><path d="M12.3 10.1c1.6.5 2.2 1.6 2.2 3.4"/></svg>'):(ja=document.createElement("img"),ja.className="geCommentMentionImg",ja.src=null!=ia.pictureUrl?ia.pictureUrl:
Editor.userImage);na.appendChild(ja);ja=document.createElement("span");mxUtils.write(ja,ia.displayName||ia.email);na.appendChild(ja);ia.isGroup&&(ja=document.createElement("span"),ja.className="geCommentMentionGroupTag",mxUtils.write(ja,mxResources.get("group")),na.appendChild(ja));null!=ia.displayName&&null!=ia.email&&(ja=document.createElement("span"),ja.className="geCommentMentionMail",mxUtils.write(ja,ia.email),na.appendChild(ja));mxEvent.addListener(na,"mousedown",function(Aa){ka(ia);Aa.preventDefault();
mxEvent.consume(Aa)});ma.appendChild(na)})(va[qa],qa)}var ma=null,wa=0,va=[],za=null,Ba=null,ua=null;mxEvent.addListener(N,"keydown",function(qa){null==ma||mxEvent.isConsumed(qa)||(40==qa.keyCode||38==qa.keyCode?(wa=(wa+(40==qa.keyCode?1:va.length-1))%va.length,ra(),qa.preventDefault(),mxEvent.consume(qa)):13!=qa.keyCode&&9!=qa.keyCode||mxEvent.isControlDown(qa)||mxEvent.isMetaDown(qa)?27==qa.keyCode&&(aa(),qa.preventDefault(),mxEvent.consume(qa)):(ka(va[wa]),qa.preventDefault(),mxEvent.consume(qa)))});
-mxEvent.addListener(N,"input",ra);mxEvent.addListener(N,"keyup",function(qa){37!=qa.keyCode&&39!=qa.keyCode&&35!=qa.keyCode&&36!=qa.keyCode||ra()});mxEvent.addListener(N,"blur",function(){window.setTimeout(aa,200)});mxEvent.addListener(N,"paste",function(qa){qa.preventDefault();qa=null!=qa.clipboardData?qa.clipboardData.getData("text/plain"):null;null!=qa&&0<qa.length&&document.execCommand("insertText",!1,qa)})}function r(N,aa){if(O){var ea=document.createElement("div");ea.contentEditable=!0;J(ea,
+mxEvent.addListener(N,"input",ra);mxEvent.addListener(N,"keyup",function(qa){37!=qa.keyCode&&39!=qa.keyCode&&35!=qa.keyCode&&36!=qa.keyCode||ra()});mxEvent.addListener(N,"blur",function(){window.setTimeout(aa,200)});mxEvent.addListener(N,"paste",function(qa){qa.preventDefault();qa=null!=qa.clipboardData?qa.clipboardData.getData("text/plain"):null;null!=qa&&0<qa.length&&document.execCommand("insertText",!1,qa)})}function r(N,aa){if(O){var ea=document.createElement("div");ea.contentEditable=!0;I(ea,
N);n(ea)}else ea=document.createElement("textarea"),ea.value=N;ea.className="geCommentEditTxtArea";ea.style.minHeight=aa+"px";return ea}function t(N,aa,ea,ka){function ra(){aa.removeChild(za);aa.removeChild(ua);ma.style.display="block";sa.style.display="block"}p={div:aa,comment:N,saveCallback:ea,deleteOnCancel:ka};for(var sa=aa.querySelector(".geCommentTxt"),ma=aa.querySelector(".geCommentActionsList"),wa=aa.querySelectorAll(".geCommentEditTxtArea, .geCommentEditBtns, .geCommentAnchorRowEdit"),va=
0;va<wa.length;va++)wa[va].parentNode==aa&&aa.removeChild(wa[va]);var za=r(N.content,sa.offsetHeight);aa.insertBefore(za,sa);var Ba=null;fa&&null==N.id&&null==N.pCommentId&&(Ba=document.createElement("div"),Ba.className="geCommentAnchorRow geCommentAnchorRowEdit",f(N,Ba,!0),aa.insertBefore(Ba,sa));var ua=document.createElement("div");ua.className="geCommentEditBtns";var qa=mxUtils.button(mxResources.get("cancel"),function(){ka?(aa.parentNode.removeChild(aa),x()):ra();p=null});qa.className="geCommentEditBtn";
-ua.appendChild(qa);var ia=mxUtils.button(mxResources.get("save"),function(){N.content=l(za);J(sa,N.content);ra();null!=Ba&&f(N,Ba,!1);ea(N);p=null});mxEvent.addListener(za,"keydown",mxUtils.bind(this,function(ja){mxEvent.isConsumed(ja)||((mxEvent.isControlDown(ja)||mxClient.IS_MAC&&mxEvent.isMetaDown(ja))&&13==ja.keyCode?(ia.click(),mxEvent.consume(ja)):27==ja.keyCode&&(qa.click(),mxEvent.consume(ja)))}));ia.focus();ia.className="geCommentEditBtn gePrimaryBtn";ua.appendChild(ia);aa.insertBefore(ua,
+ua.appendChild(qa);var ia=mxUtils.button(mxResources.get("save"),function(){N.content=l(za);I(sa,N.content);ra();null!=Ba&&f(N,Ba,!1);ea(N);p=null});mxEvent.addListener(za,"keydown",mxUtils.bind(this,function(ja){mxEvent.isConsumed(ja)||((mxEvent.isControlDown(ja)||mxClient.IS_MAC&&mxEvent.isMetaDown(ja))&&13==ja.keyCode?(ia.click(),mxEvent.consume(ja)):27==ja.keyCode&&(qa.click(),mxEvent.consume(ja)))}));ia.focus();ia.className="geCommentEditBtn gePrimaryBtn";ua.appendChild(ia);aa.insertBefore(ua,
sa);ma.style.display="none";sa.style.display="none";za.focus()}function v(N,aa){aa.innerText="";N=new Date(N.modifiedDate);var ea=b.timeSince(N);null==ea&&(ea=mxResources.get("lessThanAMinute"));mxUtils.write(aa,mxResources.get("timeAgo",[ea],"{1} ago"));aa.setAttribute("title",N.toLocaleDateString()+" "+N.toLocaleTimeString())}function B(N){var aa=document.createElement("img");aa.className="geCommentBusyImg";aa.src=IMAGE_PATH+"/spin.gif";N.appendChild(aa);N.busyImg=aa}function E(N){N.style.border=
"1px solid red";N.busyImg.parentNode==N&&N.removeChild(N.busyImg)}function K(N){N.style.border="";N.busyImg.parentNode==N&&N.removeChild(N.busyImg)}function C(N,aa,ea,ka,ra){function sa(ia,ja,na){var Aa=document.createElement("li");Aa.className="geCommentAction";var ha=document.createElement("a");ha.className="geCommentActionLnk";mxUtils.write(ha,ia);Aa.appendChild(ha);mxEvent.addListener(ha,"click",function(la){ja(la,N);la.preventDefault();mxEvent.consume(la)});qa.appendChild(Aa);na&&(Aa.style.display=
-"none")}function ma(){function ia(Aa){ja.push(na);if(null!=Aa.replies)for(var ha=0;ha<Aa.replies.length;ha++)na=na.nextSibling,ia(Aa.replies[ha])}var ja=[],na=va;ia(N);return{pdiv:na,replies:ja}}function wa(ia,ja,na,Aa,ha){function la(){B(oa);N.addReply(pa,function(Da){pa.id=Da;N.replies.push(pa);K(oa);na&&na();b.commentsUpdated()},function(Da){xa();E(oa);b.handleError(Da,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Aa,ha)}function xa(){t(pa,oa,function(Da){la()},!0)}var Ca=
-ma().pdiv,pa=b.newComment(ia,b.getCurrentUser());pa.pCommentId=N.id;null==N.replies&&(N.replies=[]);var oa=C(pa,N.replies,Ca,ka+1);ja?xa():la()}if(ra||!N.isResolved){L.style.display="none";var va=document.createElement("div");va.className="geCommentContainer";va.setAttribute("data-commentId",N.id);va.style.marginLeft=20*ka+5+"px";N.isResolved&&(A.style.opacity="0.7");var za=document.createElement("div");za.className="geCommentHeader";var Ba=document.createElement("img");Ba.className="geCommentUserImg";
+"none")}function ma(){function ia(Aa){ja.push(na);if(null!=Aa.replies)for(var ha=0;ha<Aa.replies.length;ha++)na=na.nextSibling,ia(Aa.replies[ha])}var ja=[],na=va;ia(N);return{pdiv:na,replies:ja}}function wa(ia,ja,na,Aa,ha){function la(){B(oa);N.addReply(pa,function(Ea){pa.id=Ea;N.replies.push(pa);K(oa);na&&na();b.commentsUpdated()},function(Ea){ya();E(oa);b.handleError(Ea,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Aa,ha)}function ya(){t(pa,oa,function(Ea){la()},!0)}var Ca=
+ma().pdiv,pa=b.newComment(ia,b.getCurrentUser());pa.pCommentId=N.id;null==N.replies&&(N.replies=[]);var oa=C(pa,N.replies,Ca,ka+1);ja?ya():la()}if(ra||!N.isResolved){L.style.display="none";var va=document.createElement("div");va.className="geCommentContainer";va.setAttribute("data-commentId",N.id);va.style.marginLeft=20*ka+5+"px";N.isResolved&&(A.style.opacity="0.7");var za=document.createElement("div");za.className="geCommentHeader";var Ba=document.createElement("img");Ba.className="geCommentUserImg";
Ba.src=null!=N.user&&null!=N.user.pictureUrl?N.user.pictureUrl:Editor.userImage;za.appendChild(Ba);Ba=document.createElement("div");Ba.className="geCommentHeaderTxt";za.appendChild(Ba);var ua=document.createElement("div");ua.className="geCommentUsername";mxUtils.write(ua,null!=N.user?N.user.displayName:mxResources.get("unknownUser"));Ba.appendChild(ua);ua=document.createElement("div");ua.className="geCommentDate";ua.setAttribute("data-commentId",N.id);v(N,ua);Ba.appendChild(ua);va.appendChild(za);
-fa&&0==ka&&null!=N.getAnchorCellId&&null!=N.anchor&&(null!=N.getAnchorCellIds()&&va.setAttribute("data-anchor-cell",N.getAnchorCellIds().join(",")),null!=N.id&&(za=document.createElement("div"),za.className="geCommentAnchorRow",f(N,za,!1),va.appendChild(za)));za=document.createElement("div");za.className="geCommentTxt";J(za,N.content);va.appendChild(za);N.isLocked&&(va.style.opacity="0.5");za=document.createElement("div");za.className="geCommentActions";var qa=document.createElement("ul");qa.className=
+fa&&0==ka&&null!=N.getAnchorCellId&&null!=N.anchor&&(null!=N.getAnchorCellIds()&&va.setAttribute("data-anchor-cell",N.getAnchorCellIds().join(",")),null!=N.id&&(za=document.createElement("div"),za.className="geCommentAnchorRow",f(N,za,!1),va.appendChild(za)));za=document.createElement("div");za.className="geCommentTxt";I(za,N.content);va.appendChild(za);N.isLocked&&(va.style.opacity="0.5");za=document.createElement("div");za.className="geCommentActions";var qa=document.createElement("ul");qa.className=
"geCommentActionsList";za.appendChild(qa);R||N.isLocked||0!=ka&&!M||sa(mxResources.get("reply"),function(){wa("",!0)},N.isResolved);Ba=b.getCurrentUser();null==Ba||null==N.user||Ba.id!=N.user.id||R||N.isLocked||(sa(mxResources.get("edit"),function(){function ia(){t(N,va,function(){B(va);N.editComment(N.content,function(){K(va);b.commentsUpdated()},function(ja){E(va);ia();b.handleError(ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}ia()},N.isResolved),sa(mxResources.get("delete"),
-function(){b.confirm(mxResources.get("areYouSure"),function(){B(va);N.deleteComment(function(ia){if(!0===ia){ia=va.querySelector(".geCommentTxt");ia.innerText="";mxUtils.write(ia,mxResources.get("msgDeleted"));var ja=va.querySelectorAll(".geCommentAction");for(ia=0;ia<ja.length;ia++)ja[ia].parentNode.removeChild(ja[ia]);K(va);va.style.opacity="0.5"}else{ja=ma(N).replies;for(ia=0;ia<ja.length;ia++)I.removeChild(ja[ia]);for(ia=0;ia<aa.length;ia++)if(aa[ia]==N){aa.splice(ia,1);break}L.style.display=
-0==I.getElementsByTagName("div").length?"block":"none"}b.commentsUpdated()},function(ia){E(va);b.handleError(ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},N.isResolved));R||N.isLocked||0!=ka||sa(N.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(ia){function ja(){var na=ia.target;na.innerText="";N.isResolved=!N.isResolved;mxUtils.write(na,N.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Aa=N.isResolved?"none":"",ha=
-ma(N).replies,la="light-dark("+(N.isResolved?"ghostWhite":"white")+", transparent)",xa=0;xa<ha.length;xa++){ha[xa].style.backgroundColor=la;for(var Ca=ha[xa].querySelectorAll(".geCommentAction"),pa=0;pa<Ca.length;pa++)Ca[pa]!=na.parentNode&&(Ca[pa].style.display=Aa);Y||(ha[xa].style.display="none")}x()}N.isResolved?wa(mxResources.get("reOpened")+": ",!0,ja,!1,!0):wa(mxResources.get("markedAsResolved"),!1,ja,!0)});va.appendChild(za);null!=ea?I.insertBefore(va,ea.nextSibling):I.appendChild(va);for(ea=
-0;null!=N.replies&&ea<N.replies.length;ea++)za=N.replies[ea],za.isResolved=N.isResolved,C(za,N.replies,null,ka+1,ra);null!=p&&(p.comment.id==N.id?(ra=N.content,N.content=p.comment.content,t(N,va,p.saveCallback,p.deleteOnCancel),N.content=ra):null==p.comment.id&&p.comment.pCommentId==N.id&&(I.appendChild(p.div),t(p.comment,p.div,p.saveCallback,p.deleteOnCancel)));return va}}var R=!b.canComment(),M=b.canReplyToReplies(),O=b.mentionsSupported(),U=O&&b.mentionsLiveSearch(),T=O&&b.freeMentionsSupported(),
-V=!O||b.mentionNotificationsSupported(),fa=b.anchoredCommentsSupported(),y=[],d=null,p=null,A=document.createElement("div");A.className="geCommentsWin";var G=EditorUi.compactUi?"26px":"30px",I=document.createElement("div");I.className="geCommentsList";I.style.bottom=parseInt(G)+7+"px";A.appendChild(I);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(L,mxResources.get("noCommentsFound"));var P=document.createElement("div");P.className=
-"geToolbarContainer geCommentsToolbar";P.style.height=G;P.style.padding="3px 4px 4px 4px";G=document.createElement("a");G.className="geButton";O&&!U&&b.getMentionCandidates(function(N){y=N;N=I.querySelectorAll(".geCommentMention[data-email]");for(var aa=0;aa<N.length;aa++)N[aa].innerText="",mxUtils.write(N[aa],"@"+z(N[aa].getAttribute("data-email")))},function(){});var Q=mxUtils.bind(this,function(N){function aa(){t(ea,ka,function(ra){B(ka);b.addComment(ra,function(sa){ra.id=sa;W.push(ra);K(ka);b.commentsUpdated()},
-function(sa){E(ka);aa();b.handleError(sa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}if(!R){var ea=b.newComment("",b.getCurrentUser());ea.anchor=null!=N?N:null;var ka=C(ea,W,null,0);aa()}});this.startNewComment=Q;if(!R){var ba=G.cloneNode();ba.style.backgroundImage="url("+Editor.plusImage+")";ba.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(ba,"click",function(N){Q();N.preventDefault();mxEvent.consume(N)});P.appendChild(ba)}var X=G.cloneNode();
-X.style.backgroundImage="url("+Editor.checkImage+")";X.setAttribute("title",mxResources.get("showResolved"));var Y=!1;mxEvent.addListener(X,"click",function(N){(Y=!Y)?X.classList.add("geActiveItem"):X.classList.remove("geActiveItem");Z();N.preventDefault();mxEvent.consume(N)});P.appendChild(X);b.commentsRefreshNeeded()&&(ba=G.cloneNode(),ba.style.backgroundImage="url("+Editor.refreshImage+")",ba.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(ba,"click",function(N){Z();N.preventDefault();
-mxEvent.consume(N)}),P.appendChild(ba));b.commentsSaveNeeded()&&(G=G.cloneNode(),G.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',G.setAttribute("title",mxResources.get("save")),G.className="geButton geAdaptiveAsset",mxEvent.addListener(G,"click",function(N){u();N.preventDefault();mxEvent.consume(N)}),P.appendChild(G));A.appendChild(P);var W=[],ca=function(N){if(null!=d){for(var aa=I.childNodes,ea=0;ea<aa.length;ea++)if(null!=aa[ea].getAttribute&&null!=aa[ea].getAttribute("data-anchor-cell")&&
-0<=mxUtils.indexOf(aa[ea].getAttribute("data-anchor-cell").split(","),d)){I.scrollTop=aa[ea].offsetTop-I.offsetTop;d=null;break}N&&(d=null)}};this.scrollToCell=function(N){d=N;ca(!1)};var S=mxUtils.bind(this,function(N){function aa(ka){if(null!=ka){ka.sort(function(sa,ma){return new Date(sa.modifiedDate)-new Date(ma.modifiedDate)});for(var ra=0;ra<ka.length;ra++)aa(ka[ra].replies)}}N.sort(function(ka,ra){return new Date(ka.modifiedDate)-new Date(ra.modifiedDate)});if(null!=p){var ea=p.div.querySelector(".geCommentEditTxtArea");
-null!=ea&&(p.comment.content=l(ea))}ea=I.scrollTop;I.innerText="";I.appendChild(L);L.style.display="block";W=N;for(N=0;N<W.length;N++)aa(W[N].replies),C(W[N],W,null,0,Y);null!=p&&null==p.comment.id&&null==p.comment.pCommentId&&(I.appendChild(p.div),t(p.comment,p.div,p.saveCallback,p.deleteOnCancel));I.scrollTop=ea;ca(!0)}),Z=mxUtils.bind(this,function(){this.hasError=!1;if(null!=p)try{p.div=p.div.cloneNode(!0);var N=p.div.querySelector(".geCommentEditTxtArea"),aa=p.div.querySelector(".geCommentEditBtns");
-p.comment.content=l(N);N.parentNode.removeChild(N);aa.parentNode.removeChild(aa)}catch(ea){b.handleError(ea)}M=b.canReplyToReplies();b.commentsSupported()?(null!=b.getCommentCacheTarget().commentCache?null==p&&S(b.getCommentCacheTarget().commentCache):I.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>",b.refreshCommentCache(mxUtils.bind(this,function(ea){null!=ea&&null!=p&&
-S(ea)}),mxUtils.bind(this,function(ea){null==b.getCommentCacheTarget().commentCache&&(I.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ea&&ea.message?": "+ea.message:"")),this.hasError=!0)}))):I.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))}),da=mxUtils.bind(this,function(){if(null==p){var N=b.getCommentCacheTarget().commentCache;null!=N&&(this.hasError=!1,S(N))}});b.addListener("commentsChanged",da);Z();this.refreshComments=Z;P=mxUtils.bind(this,function(){function N(sa){var ma=
-ea[sa.id];if(null!=ma)for(v(sa,ma),ma=0;null!=sa.replies&&ma<sa.replies.length;ma++)N(sa.replies[ma])}if(this.window.isVisible()){for(var aa=I.querySelectorAll(".geCommentDate"),ea={},ka=0;ka<aa.length;ka++){var ra=aa[ka];ea[ra.getAttribute("data-commentId")]=ra}for(ka=0;ka<W.length;ka++)N(W[ka])}});setInterval(P,6E4);this.refreshCommentsTime=P;this.window=new mxWindow(mxResources.get("comments"),A,k,m,g,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
-this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0,function(){b.removeListener(da)})},ConfirmDialog=function(b,k,m,g,q,u,x,z,F,J,H){var D=document.createElement("div");D.style.textAlign="center";H=null!=H?H:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=H+"px";c.style.lineHeight="1.2em";mxUtils.write(c,
-k);D.appendChild(c);null!=J&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",k=document.createElement("img"),k.setAttribute("src",J),c.appendChild(k),D.appendChild(c));J=document.createElement("div");J.style.textAlign="center";J.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");u=mxUtils.button(u||mxResources.get("cancel"),function(){b.hideDialog();null!=g&&g(f.checked)});u.className="geBtn";null!=z&&(u.innerHTML=z+"<br>"+u.innerHTML,
-u.style.display="inline-block",u.style.paddingBottom="8px",u.style.paddingTop="8px",u.style.height="auto",u.style.width="40%");b.editor.cancelFirst&&J.appendChild(u);var l=mxUtils.button(q||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});J.appendChild(l);null!=x?(l.innerHTML=x+"<br>"+l.innerHTML+"<br>",l.style.display="inline-block",l.style.paddingBottom="8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";
-b.editor.cancelFirst||J.appendChild(u);D.appendChild(J);F?(J.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(f),q=document.createElement("span"),mxUtils.write(q," "+mxResources.get("rememberThisSetting")),c.appendChild(q),D.appendChild(c),mxEvent.addListener(q,"click",function(n){f.checked=!f.checked;mxEvent.consume(n)})):J.style.marginTop="12px";this.init=function(){l.focus()};this.container=D},HeadlessEditorUi=function(){EditorUi.call(this,
+function(){b.confirm(mxResources.get("areYouSure"),function(){B(va);N.deleteComment(function(ia){if(!0===ia){ia=va.querySelector(".geCommentTxt");ia.innerText="";mxUtils.write(ia,mxResources.get("msgDeleted"));var ja=va.querySelectorAll(".geCommentAction");for(ia=0;ia<ja.length;ia++)ja[ia].parentNode.removeChild(ja[ia]);K(va);va.style.opacity="0.5"}else{ja=ma(N).replies;for(ia=0;ia<ja.length;ia++)J.removeChild(ja[ia]);for(ia=0;ia<aa.length;ia++)if(aa[ia]==N){aa.splice(ia,1);break}L.style.display=
+0==J.getElementsByTagName("div").length?"block":"none"}b.commentsUpdated()},function(ia){E(va);b.handleError(ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},N.isResolved));R||N.isLocked||0!=ka||sa(N.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(ia){function ja(){var na=ia.target;na.innerText="";N.isResolved=!N.isResolved;mxUtils.write(na,N.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Aa=N.isResolved?"none":"",ha=
+ma(N).replies,la="light-dark("+(N.isResolved?"ghostWhite":"white")+", transparent)",ya=0;ya<ha.length;ya++){ha[ya].style.backgroundColor=la;for(var Ca=ha[ya].querySelectorAll(".geCommentAction"),pa=0;pa<Ca.length;pa++)Ca[pa]!=na.parentNode&&(Ca[pa].style.display=Aa);Y||(ha[ya].style.display="none")}x()}N.isResolved?wa(mxResources.get("reOpened")+": ",!0,ja,!1,!0):wa(mxResources.get("markedAsResolved"),!1,ja,!0)});va.appendChild(za);null!=ea?J.insertBefore(va,ea.nextSibling):J.appendChild(va);for(ea=
+0;null!=N.replies&&ea<N.replies.length;ea++)za=N.replies[ea],za.isResolved=N.isResolved,C(za,N.replies,null,ka+1,ra);null!=p&&(p.comment.id==N.id?(ra=N.content,N.content=p.comment.content,t(N,va,p.saveCallback,p.deleteOnCancel),N.content=ra):null==p.comment.id&&p.comment.pCommentId==N.id&&(J.appendChild(p.div),t(p.comment,p.div,p.saveCallback,p.deleteOnCancel)));return va}}var R=!b.canComment(),M=b.canReplyToReplies(),O=b.mentionsSupported(),U=O&&b.mentionsLiveSearch(),T=O&&b.freeMentionsSupported(),
+V=!O||b.mentionNotificationsSupported(),fa=b.anchoredCommentsSupported(),y=[],d=null,p=null,A=document.createElement("div");A.className="geCommentsWin";var G=EditorUi.compactUi?"26px":"30px",J=document.createElement("div");J.className="geCommentsList";J.style.bottom=parseInt(G)+7+"px";A.appendChild(J);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(L,mxResources.get("noCommentsFound"));var P=document.createElement("div");P.className=
+"geToolbarContainer geCommentsToolbar";P.style.height=G;P.style.padding="3px 4px 4px 4px";G=document.createElement("a");G.className="geButton";O&&!U&&b.getMentionCandidates(function(N){y=N;N=J.querySelectorAll(".geCommentMention[data-email]");for(var aa=0;aa<N.length;aa++)N[aa].innerText="",mxUtils.write(N[aa],"@"+z(N[aa].getAttribute("data-email")))},function(){});var Q=mxUtils.bind(this,function(N){function aa(){t(ea,ka,function(ra){B(ka);b.addComment(ra,function(sa){ra.id=sa;X.push(ra);K(ka);b.commentsUpdated()},
+function(sa){E(ka);aa();b.handleError(sa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}if(!R){var ea=b.newComment("",b.getCurrentUser());ea.anchor=null!=N?N:null;var ka=C(ea,X,null,0);aa()}});this.startNewComment=Q;if(!R){var ba=G.cloneNode();ba.style.backgroundImage="url("+Editor.plusImage+")";ba.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(ba,"click",function(N){Q();N.preventDefault();mxEvent.consume(N)});P.appendChild(ba)}var W=G.cloneNode();
+W.style.backgroundImage="url("+Editor.checkImage+")";W.setAttribute("title",mxResources.get("showResolved"));var Y=!1;mxEvent.addListener(W,"click",function(N){(Y=!Y)?W.classList.add("geActiveItem"):W.classList.remove("geActiveItem");Z();N.preventDefault();mxEvent.consume(N)});P.appendChild(W);b.commentsRefreshNeeded()&&(ba=G.cloneNode(),ba.style.backgroundImage="url("+Editor.refreshImage+")",ba.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(ba,"click",function(N){Z();N.preventDefault();
+mxEvent.consume(N)}),P.appendChild(ba));b.commentsSaveNeeded()&&(G=G.cloneNode(),G.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',G.setAttribute("title",mxResources.get("save")),G.className="geButton geAdaptiveAsset",mxEvent.addListener(G,"click",function(N){u();N.preventDefault();mxEvent.consume(N)}),P.appendChild(G));A.appendChild(P);var X=[],ca=function(N){if(null!=d){for(var aa=J.childNodes,ea=0;ea<aa.length;ea++)if(null!=aa[ea].getAttribute&&null!=aa[ea].getAttribute("data-anchor-cell")&&
+0<=mxUtils.indexOf(aa[ea].getAttribute("data-anchor-cell").split(","),d)){J.scrollTop=aa[ea].offsetTop-J.offsetTop;d=null;break}N&&(d=null)}};this.scrollToCell=function(N){d=N;ca(!1)};var S=mxUtils.bind(this,function(N){function aa(ka){if(null!=ka){ka.sort(function(sa,ma){return new Date(sa.modifiedDate)-new Date(ma.modifiedDate)});for(var ra=0;ra<ka.length;ra++)aa(ka[ra].replies)}}N.sort(function(ka,ra){return new Date(ka.modifiedDate)-new Date(ra.modifiedDate)});if(null!=p){var ea=p.div.querySelector(".geCommentEditTxtArea");
+null!=ea&&(p.comment.content=l(ea))}ea=J.scrollTop;J.innerText="";J.appendChild(L);L.style.display="block";X=N;for(N=0;N<X.length;N++)aa(X[N].replies),C(X[N],X,null,0,Y);null!=p&&null==p.comment.id&&null==p.comment.pCommentId&&(J.appendChild(p.div),t(p.comment,p.div,p.saveCallback,p.deleteOnCancel));J.scrollTop=ea;ca(!0)}),Z=mxUtils.bind(this,function(){this.hasError=!1;if(null!=p)try{p.div=p.div.cloneNode(!0);var N=p.div.querySelector(".geCommentEditTxtArea"),aa=p.div.querySelector(".geCommentEditBtns");
+p.comment.content=l(N);N.parentNode.removeChild(N);aa.parentNode.removeChild(aa)}catch(ea){b.handleError(ea)}M=b.canReplyToReplies();b.commentsSupported()?(null!=b.getCommentCacheTarget().commentCache?null==p&&S(b.getCommentCacheTarget().commentCache):J.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>",b.refreshCommentCache(mxUtils.bind(this,function(ea){null!=ea&&null!=p&&
+S(ea)}),mxUtils.bind(this,function(ea){null==b.getCommentCacheTarget().commentCache&&(J.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ea&&ea.message?": "+ea.message:"")),this.hasError=!0)}))):J.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))}),da=mxUtils.bind(this,function(){if(null==p){var N=b.getCommentCacheTarget().commentCache;null!=N&&(this.hasError=!1,S(N))}});b.addListener("commentsChanged",da);Z();this.refreshComments=Z;P=mxUtils.bind(this,function(){function N(sa){var ma=
+ea[sa.id];if(null!=ma)for(v(sa,ma),ma=0;null!=sa.replies&&ma<sa.replies.length;ma++)N(sa.replies[ma])}if(this.window.isVisible()){for(var aa=J.querySelectorAll(".geCommentDate"),ea={},ka=0;ka<aa.length;ka++){var ra=aa[ka];ea[ra.getAttribute("data-commentId")]=ra}for(ka=0;ka<X.length;ka++)N(X[ka])}});setInterval(P,6E4);this.refreshCommentsTime=P;this.window=new mxWindow(mxResources.get("comments"),A,k,m,g,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
+this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0,function(){b.removeListener(da)})},ConfirmDialog=function(b,k,m,g,q,u,x,z,F,I,H){var D=document.createElement("div");D.style.textAlign="center";H=null!=H?H:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=H+"px";c.style.lineHeight="1.2em";mxUtils.write(c,
+k);D.appendChild(c);null!=I&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",k=document.createElement("img"),k.setAttribute("src",I),c.appendChild(k),D.appendChild(c));I=document.createElement("div");I.style.textAlign="center";I.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");u=mxUtils.button(u||mxResources.get("cancel"),function(){b.hideDialog();null!=g&&g(f.checked)});u.className="geBtn";null!=z&&(u.innerHTML=z+"<br>"+u.innerHTML,
+u.style.display="inline-block",u.style.paddingBottom="8px",u.style.paddingTop="8px",u.style.height="auto",u.style.width="40%");b.editor.cancelFirst&&I.appendChild(u);var l=mxUtils.button(q||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});I.appendChild(l);null!=x?(l.innerHTML=x+"<br>"+l.innerHTML+"<br>",l.style.display="inline-block",l.style.paddingBottom="8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";
+b.editor.cancelFirst||I.appendChild(u);D.appendChild(I);F?(I.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(f),q=document.createElement("span"),mxUtils.write(q," "+mxResources.get("rememberThisSetting")),c.appendChild(q),D.appendChild(c),mxEvent.addListener(q,"click",function(n){f.checked=!f.checked;mxEvent.consume(n)})):I.style.marginTop="12px";this.init=function(){l.focus()};this.container=D},HeadlessEditorUi=function(){EditorUi.call(this,
new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};var DrawioConfigEditor={installCss:function(){if(null==document.getElementById("geConfigEditorStyle")){var b=document.createElement("style");b.id="geConfigEditorStyle";b.textContent=DrawioConfigEditor.css;document.head.appendChild(b)}},install:function(b,k){function m(){if("function"===typeof k.onConfigChanged)k.onConfigChanged(JSON.parse(JSON.stringify(V)))}function g(S){var Z=document.createElement("div");Z.appendChild(document.createTextNode(S));return Z.innerHTML}function q(S){return b.querySelector(S)}
-function u(S){return b.querySelectorAll(S)}function x(S){if("undefined"!==typeof mxResources){var Z=mxResources.get(S);if(null!=Z&&0<Z.length&&Z!=S)return Z}return null}function z(S){var Z=x(S);return null!=Z?Z:S}function F(S){return"cfg"+S.charAt(0).toUpperCase()+S.substring(1)}function J(S,Z){null!=S.firstChild&&3==S.firstChild.nodeType||S.insertBefore(S.ownerDocument.createTextNode(""),S.firstChild);S.firstChild.nodeValue=Z}function H(){Object.keys(L).forEach(function(S){var Z=u("#"+S+" .toggle-field");
-L[S].forEach(function(da,N){N=Z[N];if(null!=N){da=da.i18n||F(da.key);var aa=x(da),ea=x(da+"Help");J(N.querySelector(".toggle-field__name"),null!=aa?aa:da);J(N.querySelector(".toggle-field__help"),null!=ea?ea+" ":"");da=N.querySelector(".toggle-field__experimental");null!=da&&da.setAttribute("title",z("cfgExperimental"));N=N.querySelectorAll(".tri-toggle button");da=[z("cfgNotSet"),z("cfgEnabled"),z("disabled")];for(aa=0;aa<N.length;aa++)N[aa].setAttribute("title",da[aa])}})})}function D(S){delete A[S.getAttribute("data-key")];
+function u(S){return b.querySelectorAll(S)}function x(S){if("undefined"!==typeof mxResources){var Z=mxResources.get(S);if(null!=Z&&0<Z.length&&Z!=S)return Z}return null}function z(S){var Z=x(S);return null!=Z?Z:S}function F(S){return"cfg"+S.charAt(0).toUpperCase()+S.substring(1)}function I(S,Z){null!=S.firstChild&&3==S.firstChild.nodeType||S.insertBefore(S.ownerDocument.createTextNode(""),S.firstChild);S.firstChild.nodeValue=Z}function H(){Object.keys(L).forEach(function(S){var Z=u("#"+S+" .toggle-field");
+L[S].forEach(function(da,N){N=Z[N];if(null!=N){da=da.i18n||F(da.key);var aa=x(da),ea=x(da+"Help");I(N.querySelector(".toggle-field__name"),null!=aa?aa:da);I(N.querySelector(".toggle-field__help"),null!=ea?ea+" ":"");da=N.querySelector(".toggle-field__experimental");null!=da&&da.setAttribute("title",z("cfgExperimental"));N=N.querySelectorAll(".tri-toggle button");da=[z("cfgNotSet"),z("cfgEnabled"),z("disabled")];for(aa=0;aa<N.length;aa++)N[aa].setAttribute("title",da[aa])}})})}function D(S){delete A[S.getAttribute("data-key")];
S.classList.remove("input--invalid");S.removeAttribute("aria-invalid");S=S.nextElementSibling;null!=S&&S.classList.contains("field__error")&&S.parentNode.removeChild(S)}function c(S){var Z=q("#"+S+"-tags"),da="";fa[S].forEach(function(N,aa){var ea=null!==N&&"object"===typeof N,ka=ea?String(N.fontFamily||""):String(N);N=ea&&N.fontUrl?String(N.fontUrl):null;da+='<span class="tag"'+(null!=N?' title="'+g(N).replace(/"/g,"&quot;").replace(/'/g,"&#39;")+'"':"")+"><span>"+g(ka)+"</span>"+(null!=N?'<span class="tag__link">&#8599;</span>':
"")+'<button type="button" class="tag__remove" data-list="'+S+'" data-index="'+aa+'">&times;</button></span>'});Z.innerHTML=da;Z.querySelectorAll(".tag__remove").forEach(function(N){N.addEventListener("click",function(){fa[N.getAttribute("data-list")].splice(parseInt(N.getAttribute("data-index")),1);f(N.getAttribute("data-list"));c(N.getAttribute("data-list"))})})}function f(S){0<fa[S].length?V[S]=fa[S].slice():delete V[S];m()}function l(S){function Z(){var ea=N.value.trim(),ka=aa.value.trim();ea&&
(fa[S].push(ka?{fontFamily:ea,fontUrl:ka}:ea),N.value="",aa.value="",f(S),c(S))}function da(ea){"Enter"===ea.key&&(ea.preventDefault(),Z())}var N=q("#"+S+"-input"),aa=q("#"+S+"-url");q("#"+S+"-add").addEventListener("click",Z);N.addEventListener("keydown",da);aa.addEventListener("keydown",da);c(S)}function n(S){var Z=q("#"+S+"-list");Z.innerHTML="";y[S].forEach(function(da,N){var aa="none"===da||"null"===da,ea=document.createElement("div");ea.className="color-swatch";ea.title=aa?da:"#"+da;aa?ea.style.cssText=
@@ -14916,7 +14926,7 @@ ka.value.substring(1).toUpperCase();y[S][ra]=sa;ea.style.background="#"+sa;ea.ti
ea||"null"===ea?(y[S].push(ea),N.value="",r(S),n(S)):/^[0-9A-Fa-f]{3,8}$/.test(ea)&&(y[S].push(ea.toUpperCase()),N.value="",r(S),n(S))}var da=q("#"+S+"-picker"),N=q("#"+S+"-input"),aa=q("#"+S+"-add");da.addEventListener("input",function(){N.value=da.value.substring(1).toUpperCase()});aa.addEventListener("click",Z);N.addEventListener("keydown",function(ea){"Enter"===ea.key&&(ea.preventDefault(),Z())});n(S)}function v(S){var Z=q("#"+S+"-editor");Z.innerHTML="";p[S].forEach(function(da,N){var aa=document.createElement("div");
aa.className="color-scheme-row";var ea=document.createElement("span");ea.className="color-scheme-row__label";ea.textContent=N+1;aa.appendChild(ea);da.forEach(function(ma,wa){if(null===ma){var va=document.createElement("span");va.className="color-scheme-entry";va.innerHTML='<span style="color: var(--color-text-secondary); font-style: italic;">default</span>';var za=document.createElement("button");za.className="color-scheme-entry__remove";za.textContent="×";za.addEventListener("click",function(Ba,
ua){return function(){p[S][Ba].splice(ua,1);B(S);v(S)}}(N,wa));va.appendChild(za);aa.appendChild(va)}else P.forEach(function(Ba){if(ma[Ba]){var ua=document.createElement("span");ua.className="color-scheme-entry";var qa=document.createElement("span");qa.className="color-scheme-entry__swatch";qa.style.background=ma[Ba];var ia=document.createElement("input");ia.type="color";ia.value=ma[Ba];ia.addEventListener("input",function(Aa,ha,la){return function(){p[S][Aa][ha][la]=ia.value;qa.style.background=
-ia.value;B(S)}}(N,wa,Ba));qa.appendChild(ia);var ja=document.createElement("span");ja.className="color-scheme-entry__key";ja.textContent=Ba.charAt(0).toUpperCase();ja.title=Ba;var na=document.createElement("button");na.className="color-scheme-entry__remove";na.textContent="×";na.addEventListener("click",function(Aa,ha,la){return function(){delete p[S][Aa][ha][la];0===Object.keys(p[S][Aa][ha]).filter(function(xa){return-1<P.indexOf(xa)}).length&&p[S][Aa].splice(ha,1);B(S);v(S)}}(N,wa,Ba));ua.appendChild(qa);
+ia.value;B(S)}}(N,wa,Ba));qa.appendChild(ia);var ja=document.createElement("span");ja.className="color-scheme-entry__key";ja.textContent=Ba.charAt(0).toUpperCase();ja.title=Ba;var na=document.createElement("button");na.className="color-scheme-entry__remove";na.textContent="×";na.addEventListener("click",function(Aa,ha,la){return function(){delete p[S][Aa][ha][la];0===Object.keys(p[S][Aa][ha]).filter(function(ya){return-1<P.indexOf(ya)}).length&&p[S][Aa].splice(ha,1);B(S);v(S)}}(N,wa,Ba));ua.appendChild(qa);
ua.appendChild(ja);ua.appendChild(na);aa.appendChild(ua)}})});da=document.createElement("span");da.className="color-scheme-row__actions";ea=document.createElement("button");ea.className="color-scheme-row__btn";ea.textContent="+";ea.title="Add colour entry";ea.addEventListener("click",function(ma){return function(){p[S][ma].push({fill:"#dae8fc",stroke:"#6c8ebf"});B(S);v(S)}}(N));var ka=document.createElement("button");ka.className="color-scheme-row__btn";ka.textContent="ø";ka.title="Add default (null) entry";
ka.addEventListener("click",function(ma){return function(){p[S][ma].unshift(null);B(S);v(S)}}(N));var ra=document.createElement("button");ra.className="color-scheme-row__btn";ra.title="Add colour key to last entry";ra.textContent="key";ra.addEventListener("click",function(ma){return function(){for(var wa=p[S][ma],va=null,za=wa.length-1;0<=za;za--)if(null!==wa[za]){va=wa[za];break}if(va){wa=null;for(za=0;za<P.length;za++)if(!va[P[za]]){wa=P[za];break}wa&&(va[wa]="#888888",B(S),v(S))}}}(N));var sa=
document.createElement("button");sa.className="color-scheme-row__btn";sa.textContent="−";sa.title="Remove row";sa.addEventListener("click",function(ma){return function(){p[S].splice(ma,1);B(S);v(S)}}(N));da.appendChild(ka);da.appendChild(ea);da.appendChild(ra);da.appendChild(sa);aa.appendChild(da);Z.appendChild(aa)})}function B(S){0<p[S].length?V[S]=JSON.parse(JSON.stringify(p[S])):delete V[S];m()}function E(S){q("#"+S+"-addRow").addEventListener("click",function(){p[S].push([null,{fill:"#f5f5f5",
@@ -14927,16 +14937,16 @@ customColorSchemes:[]};Object.keys(S).forEach(function(Z){var da=S[Z];"defaultFo
Z||"defaultLanguages"===Z?Array.isArray(da)&&(d[Z]=da.map(function(N){return String(N)}),V[Z]=da):V[Z]=da});U()}function U(){u(".input--invalid").forEach(D);A={};u("[data-key]").forEach(function(N){if(!N.closest(".tri-toggle")){var aa=N.getAttribute("data-key"),ea="json"===N.getAttribute("data-type");N.value=void 0!==V[aa]?ea?JSON.stringify(V[aa],null,2):V[aa]:""}});var S=q("#cfg-tooltipMaxWidth"),Z=q("#cfg-tooltipMaxWidthEnabled");if(void 0!==V.tooltipMaxWidth){var da=0<V.tooltipMaxWidth;Z.checked=
da;S.disabled=!da;S.value=da?V.tooltipMaxWidth:""}else Z.checked=!0,S.disabled=!1,S.value="";V.pageFormat?(q("#cfg-pageFormatWidth").value=V.pageFormat.width||"",q("#cfg-pageFormatHeight").value=V.pageFormat.height||""):(q("#cfg-pageFormatWidth").value="",q("#cfg-pageFormatHeight").value="");S=V.darkColor||"";/^#[0-9A-Fa-f]{6}$/.test(S)&&(q("#cfg-darkColorPicker").value=S);S=V.shadowColor||"";/^#[0-9A-Fa-f]{6}$/.test(S)&&(q("#cfg-shadowColorPicker").value=S);["defaultGridColor","defaultDarkGridColor",
"defaultPageBackgroundColor","defaultDarkPageBackgroundColor"].forEach(function(N){var aa=V[N]||"";/^#[0-9A-Fa-f]{6}$/.test(aa)&&(q("#cfg-"+N+"Picker").value=aa)});u(".tri-toggle").forEach(function(N){var aa=N.getAttribute("data-key");aa=V[aa];N.querySelectorAll("button").forEach(function(ea){ea.className=""});!0===aa?N.querySelector('[data-value="true"]').className="active--true":!1===aa?N.querySelector('[data-value="false"]').className="active--false":N.querySelector('[data-value="unset"]').className=
-"active--unset"});["defaultFonts","customFonts"].forEach(c);["presetColors","customPresetColors","defaultColors"].forEach(n);"enabledLibraries defaultCustomLibraries hideMenuItems hideMenus enabledTemplateSections defaultLanguages".split(" ").forEach(K);["defaultColorSchemes","customColorSchemes"].forEach(v);ba.forEach(M)}function T(S){if(S=S.trim().toLowerCase()){var Z=S.split(/\s+/),da=new Set,N=new Set,aa=0;W.forEach(function(ea){Z.every(function(ka){return-1<ea.keywords.indexOf(ka)})&&(N.add(ea.element),
-da.add(ea.section),"section-title"!==ea.type&&aa++)});u(".config-section").forEach(function(ea){ea.classList.toggle("search-hidden",!da.has(ea))});W.forEach(function(ea){if("section-title"!==ea.type&&da.has(ea.section)){var ka=!1;W.forEach(function(ra){"section-title"===ra.type&&ra.section===ea.section&&N.has(ra.element)&&(ka=!0)});ka?ea.element.classList.remove("search-hidden"):ea.element.classList.toggle("search-hidden",!N.has(ea.element))}});Y.textContent=aa+" result"+(1!==aa?"s":"")}else u(".config-section, .toggle-field, .field, .field-row").forEach(function(ea){ea.classList.remove("search-hidden")}),
-Y.textContent=""}k=k||{};DrawioConfigEditor.installCss();b.classList.add("geConfigEditor");b.innerHTML=DrawioConfigEditor.html;var V={},fa={defaultFonts:[],customFonts:[]},y={presetColors:[],customPresetColors:[],defaultColors:[]},d={enabledLibraries:[],defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[],enabledTemplateSections:[],defaultLanguages:[]},p={defaultColorSchemes:[],customColorSchemes:[]},A={},G=k.editorContext||{},I=null!=k.isDesktop?k.isDesktop:0<=navigator.userAgent.indexOf("Electron");
+"active--unset"});["defaultFonts","customFonts"].forEach(c);["presetColors","customPresetColors","defaultColors"].forEach(n);"enabledLibraries defaultCustomLibraries hideMenuItems hideMenus enabledTemplateSections defaultLanguages".split(" ").forEach(K);["defaultColorSchemes","customColorSchemes"].forEach(v);ba.forEach(M)}function T(S){if(S=S.trim().toLowerCase()){var Z=S.split(/\s+/),da=new Set,N=new Set,aa=0;X.forEach(function(ea){Z.every(function(ka){return-1<ea.keywords.indexOf(ka)})&&(N.add(ea.element),
+da.add(ea.section),"section-title"!==ea.type&&aa++)});u(".config-section").forEach(function(ea){ea.classList.toggle("search-hidden",!da.has(ea))});X.forEach(function(ea){if("section-title"!==ea.type&&da.has(ea.section)){var ka=!1;X.forEach(function(ra){"section-title"===ra.type&&ra.section===ea.section&&N.has(ra.element)&&(ka=!0)});ka?ea.element.classList.remove("search-hidden"):ea.element.classList.toggle("search-hidden",!N.has(ea.element))}});Y.textContent=aa+" result"+(1!==aa?"s":"")}else u(".config-section, .toggle-field, .field, .field-row").forEach(function(ea){ea.classList.remove("search-hidden")}),
+Y.textContent=""}k=k||{};DrawioConfigEditor.installCss();b.classList.add("geConfigEditor");b.innerHTML=DrawioConfigEditor.html;var V={},fa={defaultFonts:[],customFonts:[]},y={presetColors:[],customPresetColors:[],defaultColors:[]},d={enabledLibraries:[],defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[],enabledTemplateSections:[],defaultLanguages:[]},p={defaultColorSchemes:[],customColorSchemes:[]},A={},G=k.editorContext||{},J=null!=k.isDesktop?k.isDesktop:0<=navigator.userAgent.indexOf("Electron");
(function(){u('label[for^="cfg-"]').forEach(function(da){var N=F(da.getAttribute("for").substring(4));N=null!=x(N+"Field")?N+"Field":N;var aa=x(N);null!=aa?da.textContent=aa:""===da.textContent&&(da.textContent=N);da=da.closest(".field");da=null!=da?da.querySelector(".field__help"):null;N=x(N+"Help");null!=da&&null!=N&&(da.textContent=N)});u("[data-i18n]").forEach(function(da){da.textContent=z(da.getAttribute("data-i18n"))});var S=q("#searchInput"),Z=x("cfgSearchSettings");null!=S&&null!=Z&&S.setAttribute("placeholder",
Z)})();var L={"general-toggles":[{key:"override"},{key:"compact"},{key:"noAutoFocus"},{key:"showSplashOnStart"},{key:"updateDefaultStyle"},{key:"mathOutputSize"},{key:"browserTranslate"}],"canvas-toggles":[{key:"defaultPageVisible"},{key:"defaultGridEnabled"},{key:"enablePositionGuides"},{key:"enableDistanceGuides"},{key:"enableSizeGuides"},{key:"defaultConnectable"},{key:"defaultConnectionArrowsEnabled"},{key:"copyOnConnect"},{key:"defaultFoldingEnabled"},{key:"defaultTransparentGroups"},{key:"zoomWheel"},
{key:"simpleLabels"},{key:"optimizeHtmlLabels"},{key:"stopEditingOnEnter"},{key:"pasteAtMousePointer"},{key:"fitDiagramOnLoad"},{key:"fitDiagramOnPage"},{key:"selectParentLayer"},{key:"enableInlineToolbar"},{key:"enableWindowDocking"},{key:"showLinkIcons"},{key:"showTooltipIcons"},{key:"showNoteIcons"},{key:"showConnectHandle"},{key:"intersectionSelect"},{key:"swimlaneSelectionEnabled"}],"appearance-toggles":[{key:"enableCssDarkMode"},{key:"enableLightDarkColors"},{key:"enableAnimations"},{key:"insertAnimations"}],
"sidebar-toggles":[{key:"sidebarTitles"},{key:"expandLibraries"}],"library-toggles":[{key:"enableCustomLibraries"},{key:"inlineExtIcons"},{key:"appendCustomLibraries"}],"export-toggles":[{key:"compressXml"},{key:"compressStyles",experimental:!0,helpLink:"https://www.drawio.com/docs/reference/style-compression/"},{key:"includeDiagram"},{key:"enableExportUrl"},{key:"lockdown"},{key:"restrictExport"},{key:"enableNativeClipboard"},{key:"replaceSvgDataUris"},{key:"foreignObjectImages"},{key:"embedSvgFonts"},
{key:"removeImageMetadata"},{key:"expandPatternsForPrint"}],"advanced-toggles":[{key:"shareCursorPosition"},{key:"showRemoteCursors"},{key:"oneDriveInlinePicker"},{key:"enableCustomGitLabUrl"}],"embedding-toggles":[{key:"passiveScroll"},{key:"noResizers"},{key:"preserveViewState"},{key:"useInternalClipboard"}],"ai-toggles":[{key:"enableAi"}],"confluence-cloud-toggles":[{key:"simpleViewer"},{key:"disableVersioning"},{key:"hiResPreview"},{key:"autoCropViewer"},{key:"enableCssDarkMode",i18n:"cfgEnableCssDarkMode2"},
-{key:"viewerCanExceedPageWidth"},{key:"inplaceEdits"},{key:"lockdown"},{key:"translateDiagrams"},{key:"generateSVGs"},{key:"debug"}],"confluence-toggles":[{key:"debug"},{key:"inplaceEdits"},{key:"forceSimpleViewer"}]};I&&(L["font-toggles"]=[{key:"enableLocalFonts"}],L["desktop-toggles"]=[{key:"desktopAutoSync"}]);var P=["fill","stroke","gradient","font"],Q={"cfg-dmp":{selects:["toolbarStyle","links"],numbers:["width"],booleans:["border","lightbox","simpleViewer"]},"cfg-cdmp":{selects:["tbstyle","links"],
-numbers:["zoom"],booleans:["lbox","simple","pCenter","hiResPreview"]}},ba=["cfg-cdmp","cfg-dmp"],X=q("#searchInput"),Y=q("#searchCount"),W=[],ca;X.addEventListener("input",function(){clearTimeout(ca);ca=setTimeout(function(){T(X.value)},150)});X.addEventListener("keydown",function(S){"Escape"===S.key&&(X.value="",T(""),X.blur())});(function(){Object.keys(L).forEach(function(S){var Z=q("#"+S);if(Z){Z.classList.add("toggle-list");var da="";L[S].forEach(function(N){da+='<div class="toggle-field"><div class="toggle-field__label"><span class="toggle-field__name">'+
+{key:"viewerCanExceedPageWidth"},{key:"inplaceEdits"},{key:"lockdown"},{key:"translateDiagrams"},{key:"generateSVGs"},{key:"debug"}],"confluence-toggles":[{key:"debug"},{key:"inplaceEdits"},{key:"forceSimpleViewer"}]};J&&(L["font-toggles"]=[{key:"enableLocalFonts"}],L["desktop-toggles"]=[{key:"desktopAutoSync"}]);var P=["fill","stroke","gradient","font"],Q={"cfg-dmp":{selects:["toolbarStyle","links"],numbers:["width"],booleans:["border","lightbox","simpleViewer"]},"cfg-cdmp":{selects:["tbstyle","links"],
+numbers:["zoom"],booleans:["lbox","simple","pCenter","hiResPreview"]}},ba=["cfg-cdmp","cfg-dmp"],W=q("#searchInput"),Y=q("#searchCount"),X=[],ca;W.addEventListener("input",function(){clearTimeout(ca);ca=setTimeout(function(){T(W.value)},150)});W.addEventListener("keydown",function(S){"Escape"===S.key&&(W.value="",T(""),W.blur())});(function(){Object.keys(L).forEach(function(S){var Z=q("#"+S);if(Z){Z.classList.add("toggle-list");var da="";L[S].forEach(function(N){da+='<div class="toggle-field"><div class="toggle-field__label"><span class="toggle-field__name">'+
(N.experimental?' <span class="toggle-field__experimental" title="Experimental feature">experimental</span>':"")+'</span><span class="toggle-field__help"><code>'+N.key+"</code>"+(N.helpLink?' <a class="toggle-field__helplink" href="'+N.helpLink+'" target="_blank" rel="noopener" title="Learn more">?</a>':"")+'</span></div><div class="tri-toggle" data-key="'+N.key+'"><button type="button" data-value="unset" class="active--unset" title="Not set (use default)">&#8212;</button><button type="button" data-value="true" title="Enabled">On</button><button type="button" data-value="false" title="Disabled">Off</button></div></div>'});
Z.innerHTML=da}});H();u(".tri-toggle").forEach(function(S){S.querySelectorAll("button").forEach(function(Z){Z.addEventListener("click",function(){var da=S.getAttribute("data-key"),N=Z.getAttribute("data-value");u('.tri-toggle[data-key="'+da+'"]').forEach(function(aa){aa.querySelectorAll("button").forEach(function(ea){ea.className=""});aa.querySelector('[data-value="'+N+'"]').className="active--"+N});"unset"===N?delete V[da]:V[da]="true"===N;m()})})})})();(function(){u("[data-key]").forEach(function(S){if(!S.classList.contains("tri-toggle")&&
!S.closest(".tri-toggle")){var Z=S.getAttribute("data-key"),da="json"===S.getAttribute("data-type");S.addEventListener("input",function(){var N=S.value.trim();if(""===N)delete V[Z],da&&D(S);else if("number"===S.type)N=parseFloat(N),isNaN(N)||(V[Z]=N);else if(da)try{V[Z]=JSON.parse(N),D(S)}catch(ka){N=A;var aa=S.getAttribute("data-key");var ea=S.closest(".field");ea=null!=ea?ea.querySelector("label"):null;ea=null!=ea?ea.textContent:S.getAttribute("data-key");N[aa]=ea;S.classList.add("input--invalid");
@@ -14947,33 +14957,33 @@ function(){/^#[0-9A-Fa-f]{6}$/.test(da.value)&&(Z.value=da.value)})})})();(funct
{};da.selects.forEach(function(aa){var ea=q("#"+S+"-"+aa);ea.value?N[aa]=ea.value:delete N[aa]});da.numbers.forEach(function(aa){var ea=q("#"+S+"-"+aa);ea.value?N[aa]=parseInt(ea.value):delete N[aa]});da.booleans.forEach(function(aa){var ea=q("#"+S+"-"+aa);!1===ea.indeterminate?N[aa]=ea.checked:delete N[aa]});0<Object.keys(N).length?V.defaultMacroParameters=N:delete V.defaultMacroParameters;ba.forEach(function(aa){aa!==S&&M(aa)});m()}var da=Q[S];da.booleans.forEach(function(N){var aa=q("#"+S+"-"+
N);aa.indeterminate=!0;aa.dataset.cycleState="indeterminate";aa.addEventListener("click",function(){"indeterminate"===aa.dataset.cycleState?(aa.checked=!0,aa.indeterminate=!1,aa.dataset.cycleState="checked"):"checked"===aa.dataset.cycleState?(aa.checked=!1,aa.indeterminate=!1,aa.dataset.cycleState="unchecked"):(aa.checked=!1,aa.indeterminate=!0,aa.dataset.cycleState="indeterminate");Z()});aa.addEventListener("mousedown",function(ea){ea.preventDefault()})});da.selects.forEach(function(N){q("#"+S+"-"+
N).addEventListener("change",Z)});da.numbers.forEach(function(N){q("#"+S+"-"+N).addEventListener("input",Z)})});(function(){[{btnId:"useCurrentVertexStyle",textareaId:"cfg-defaultVertexStyle",key:"currentVertexStyle"},{btnId:"useCurrentEdgeStyle",textareaId:"cfg-defaultEdgeStyle",key:"currentEdgeStyle"}].forEach(function(S){var Z=G[S.key];if(null!=Z&&"object"===typeof Z&&0<Object.keys(Z).length){var da=q("#"+S.btnId);da.style.display="";da.addEventListener("click",function(){var N=q("#"+S.textareaId);
-N.value=JSON.stringify(Z,null,2);N.dispatchEvent(new Event("input"))})}})})();(function(){W=[];u(".toggle-field").forEach(function(S){var Z=S.querySelector(".tri-toggle"),da=Z?Z.getAttribute("data-key"):"",N=S.querySelector(".toggle-field__name"),aa=S.querySelector(".toggle-field__help");Z=S.closest(".config-section");da=(da+" "+(N?N.textContent:"")+" "+(aa?aa.textContent:"")).toLowerCase();W.push({element:S,section:Z,keywords:da,type:"toggle"})});u(".config-section .field").forEach(function(S){if(!S.parentElement.classList.contains("field-row")){var Z=
-S.closest(".config-section"),da=S.textContent.toLowerCase();S.querySelectorAll("[data-key]").forEach(function(N){da+=" "+N.getAttribute("data-key").toLowerCase()});S.hasAttribute("data-search")&&(da+=" "+S.getAttribute("data-search").toLowerCase());W.push({element:S,section:Z,keywords:da,type:"field"})}});u(".config-section .field-row").forEach(function(S){var Z=S.closest(".config-section"),da=S.textContent.toLowerCase();S.querySelectorAll("[data-key]").forEach(function(N){da+=" "+N.getAttribute("data-key").toLowerCase()});
-S.querySelectorAll("input, select, textarea").forEach(function(N){N.id&&(da+=" "+N.id.replace("cfg-","").replace("cfg-dmp-","").toLowerCase())});S.hasAttribute("data-search")&&(da+=" "+S.getAttribute("data-search").toLowerCase());W.push({element:S,section:Z,keywords:da,type:"field-row"})});u(".config-section").forEach(function(S){var Z=S.querySelector(".card__title");Z&&W.push({element:S,section:S,keywords:Z.textContent.toLowerCase(),type:"section-title"})})})();O(k.initialConfig||{});k.darkMode&&
+N.value=JSON.stringify(Z,null,2);N.dispatchEvent(new Event("input"))})}})})();(function(){X=[];u(".toggle-field").forEach(function(S){var Z=S.querySelector(".tri-toggle"),da=Z?Z.getAttribute("data-key"):"",N=S.querySelector(".toggle-field__name"),aa=S.querySelector(".toggle-field__help");Z=S.closest(".config-section");da=(da+" "+(N?N.textContent:"")+" "+(aa?aa.textContent:"")).toLowerCase();X.push({element:S,section:Z,keywords:da,type:"toggle"})});u(".config-section .field").forEach(function(S){if(!S.parentElement.classList.contains("field-row")){var Z=
+S.closest(".config-section"),da=S.textContent.toLowerCase();S.querySelectorAll("[data-key]").forEach(function(N){da+=" "+N.getAttribute("data-key").toLowerCase()});S.hasAttribute("data-search")&&(da+=" "+S.getAttribute("data-search").toLowerCase());X.push({element:S,section:Z,keywords:da,type:"field"})}});u(".config-section .field-row").forEach(function(S){var Z=S.closest(".config-section"),da=S.textContent.toLowerCase();S.querySelectorAll("[data-key]").forEach(function(N){da+=" "+N.getAttribute("data-key").toLowerCase()});
+S.querySelectorAll("input, select, textarea").forEach(function(N){N.id&&(da+=" "+N.id.replace("cfg-","").replace("cfg-dmp-","").toLowerCase())});S.hasAttribute("data-search")&&(da+=" "+S.getAttribute("data-search").toLowerCase());X.push({element:S,section:Z,keywords:da,type:"field-row"})});u(".config-section").forEach(function(S){var Z=S.querySelector(".card__title");Z&&X.push({element:S,section:S,keywords:Z.textContent.toLowerCase(),type:"section-title"})})})();O(k.initialConfig||{});k.darkMode&&
b.classList.add("dark");k.highContrast&&b.classList.add("high-contrast");return{setConfig:function(S){O(S||{})},getConfig:function(){return JSON.parse(JSON.stringify(V))},getInvalidFields:function(){return Object.keys(A).map(function(S){return A[S]})},setDarkMode:function(S){b.classList.toggle("dark",!!S)},setHighContrast:function(S){b.classList.toggle("high-contrast",!!S)}}},css:'.geConfigEditor {\n --drawio-blue: #29b6f2;\n --drawio-blue-hover: #1aa3e0;\n --color-bg: #f0f0f0;\n --color-bg-dark: #2a2a2a;\n --color-bg-secondary: #e4e4e4;\n --color-bg-secondary-dark: #333333;\n --color-bg-tertiary: #dadada;\n --color-bg-tertiary-dark: #3d3d3d;\n --color-input: #ffffff;\n --color-input-dark: #1e2022;\n --color-text: #3F3F3F;\n --color-text-dark: #C0C0C0;\n --color-text-secondary: #6c757d;\n --color-text-secondary-dark: #999999;\n --color-border: #dadada;\n --color-border-dark: #404040;\n --color-border-focus: var(--drawio-blue);\n --color-success: #198754;\n --color-error: #dc3545;\n --color-warning-bg: #fff3cd;\n --color-scrollbar: #e2e2e2;\n --color-scrollbar-dark: #3d3d3d;\n --color-scrollbar-hover: #959798;\n --color-scrollbar-hover-dark: #555555;\n --spacing-xs: 4px;\n --spacing-sm: 8px;\n --spacing-md: 12px;\n --spacing-lg: 16px;\n --radius-sm: 4px;\n --radius-md: 6px;\n --radius-lg: 8px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n --font-family-mono: ui-monospace, SFMono-Regular, Consolas, monospace;\n --font-size-xs: 11px;\n --font-size-sm: 12px;\n --font-size-base: 13px;\n --transition-fast: 150ms ease;\n font-family: var(--font-family);\n font-size: var(--font-size-base);\n background: light-dark(var(--color-bg), var(--color-bg-dark));\n color: light-dark(var(--color-text), var(--color-text-dark));\n line-height: 1.5;\n overflow-y: auto;\n padding: 0 8px;\n}\n.geConfigEditor { box-sizing: border-box; margin: 0; }\n.geConfigEditor *, .geConfigEditor *::before, .geConfigEditor *::after { box-sizing: border-box; margin: 0; padding: 0; }\n.geConfigEditor.dark { color-scheme: dark; }\n.geConfigEditor::-webkit-scrollbar, .geConfigEditor ::-webkit-scrollbar { width: 10px; height: 10px; }\n.geConfigEditor::-webkit-scrollbar-track, .geConfigEditor ::-webkit-scrollbar-track { background-clip: padding-box; border: solid transparent; border-width: 1px; }\n.geConfigEditor::-webkit-scrollbar-corner, .geConfigEditor ::-webkit-scrollbar-corner { background-color: transparent; }\n.geConfigEditor::-webkit-scrollbar-thumb, .geConfigEditor ::-webkit-scrollbar-thumb { background-color: light-dark(var(--color-scrollbar), var(--color-scrollbar-dark)); background-clip: padding-box; border: solid transparent; border-radius: 4px; }\n.geConfigEditor::-webkit-scrollbar-thumb:hover, .geConfigEditor ::-webkit-scrollbar-thumb:hover { background-color: light-dark(var(--color-scrollbar-hover), var(--color-scrollbar-hover-dark)); }\n.geConfigEditor input[type="text"], .geConfigEditor input[type="url"], .geConfigEditor input[type="number"], .geConfigEditor textarea, .geConfigEditor select {\n font-family: inherit;\n font-size: var(--font-size-base);\n padding: 5px 8px;\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-md);\n background: light-dark(var(--color-input), var(--color-input-dark));\n color: light-dark(var(--color-text), var(--color-text-dark));\n width: 100%;\n transition: border-color var(--transition-fast);\n}\n.geConfigEditor input:focus, .geConfigEditor textarea:focus, .geConfigEditor select:focus {\n outline: none;\n border-color: var(--color-border-focus);\n box-shadow: 0 0 0 2px rgba(41, 182, 242, 0.15);\n}\n.geConfigEditor textarea { font-family: var(--font-family-mono); resize: vertical; min-height: 60px; }\n.geConfigEditor input.input--invalid, .geConfigEditor textarea.input--invalid { border-color: var(--color-error); }\n.geConfigEditor input.input--invalid:focus, .geConfigEditor textarea.input--invalid:focus { border-color: var(--color-error); box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15); }\n.geConfigEditor label { display: block; font-weight: 500; margin-bottom: 2px; font-size: var(--font-size-sm); }\n.geConfigEditor .btn {\n display: inline-flex; align-items: center; padding: 4px 8px;\n font-family: inherit; font-size: var(--font-size-xs); font-weight: 500;\n border: none; border-radius: var(--radius-md); cursor: pointer;\n}\n.geConfigEditor .btn--secondary { background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark)); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); }\n.geConfigEditor .btn--secondary:hover { background: light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor .btn--sm { padding: 3px 6px; font-size: var(--font-size-xs); }\n.geConfigEditor .btn-group { display: flex; flex-wrap: wrap; gap: 4px; }\n.geConfigEditor .card {\n background: light-dark(var(--color-bg), var(--color-bg-dark)); border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--spacing-lg);\n}\n.geConfigEditor .card__header {\n padding: 6px var(--spacing-md); border-bottom: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n background: light-dark(var(--color-bg-secondary), var(--color-bg-secondary-dark));\n}\n.geConfigEditor .card__title { font-size: var(--font-size-base); font-weight: 600; margin: 0; }\n.geConfigEditor .card__body { padding: var(--spacing-md); display: flex; flex-direction: column; gap: var(--spacing-md); }\n.geConfigEditor .field { display: flex; flex-direction: column; gap: 2px; }\n.geConfigEditor .field__help { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); margin: 0; line-height: 1.3; }\n.geConfigEditor .field__error { font-size: var(--font-size-xs); color: var(--color-error); margin: 0; line-height: 1.3; font-weight: 500; }\n.geConfigEditor .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); }\n.geConfigEditor .toggle-field {\n display: flex; align-items: center; justify-content: space-between;\n padding: 4px 0; border-bottom: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n}\n.geConfigEditor .toggle-field:last-child { border-bottom: none; }\n.geConfigEditor .card__body > * + .toggle-list { border-top: 1px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor .toggle-field__label { display: flex; flex-direction: column; gap: 1px; flex: 1; margin-bottom: 0; }\n.geConfigEditor .toggle-field__name { font-weight: 500; font-size: var(--font-size-sm); }\n.geConfigEditor .toggle-field__help { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); }\n.geConfigEditor .toggle-field__experimental {\n display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 8px; vertical-align: middle;\n font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;\n color: light-dark(#8a5a00, #f0b429); background: light-dark(#fff3d6, rgba(240, 180, 41, 0.15));\n}\n.geConfigEditor .toggle-field__helplink {\n display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px;\n margin-left: 4px; border-radius: 50%; vertical-align: middle; text-decoration: none;\n font-size: 9px; font-weight: 700; line-height: 1;\n color: light-dark(#fff, #1a1a1a); background: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark));\n}\n.geConfigEditor .tri-toggle {\n display: inline-flex; border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0;\n}\n.geConfigEditor .tri-toggle button {\n padding: 3px 8px; font-size: var(--font-size-xs); border: none;\n background: light-dark(var(--color-input), var(--color-input-dark)); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark));\n cursor: pointer; font-family: inherit; transition: all var(--transition-fast);\n}\n.geConfigEditor .tri-toggle button + button { border-left: 1px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor .tri-toggle button.active--unset { background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark)); color: light-dark(var(--color-text), var(--color-text-dark)); font-weight: 500; }\n.geConfigEditor .tri-toggle button.active--true { background: var(--color-success); color: #fff; font-weight: 500; }\n.geConfigEditor .tri-toggle button.active--false { background: var(--color-error); color: #fff; font-weight: 500; }\n.geConfigEditor .color-list { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px 0; min-height: 24px; }\n.geConfigEditor .color-swatch {\n width: 22px; height: 22px; border-radius: var(--radius-sm);\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark)); cursor: pointer; position: relative;\n transition: transform var(--transition-fast);\n}\n.geConfigEditor .color-swatch:hover { transform: scale(1.15); box-shadow: 0 0 0 2px var(--drawio-blue); }\n.geConfigEditor .color-swatch__delete {\n position: absolute; top: -5px; right: -5px; width: 12px; height: 12px;\n background: var(--color-error); color: #fff; border: none; border-radius: 50%;\n font-size: 9px; line-height: 12px; text-align: center; cursor: pointer; display: none; padding: 0;\n}\n.geConfigEditor .color-swatch:hover .color-swatch__delete { display: block; }\n.geConfigEditor .color-swatch__picker {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n opacity: 0; cursor: pointer; border: none; padding: 0;\n}\n.geConfigEditor .color-scheme-editor { display: flex; flex-direction: column; gap: 4px; }\n.geConfigEditor .color-scheme-row {\n display: flex; flex-wrap: wrap; gap: 3px; align-items: center;\n padding: 3px 6px; background: light-dark(var(--color-bg-secondary), var(--color-bg-secondary-dark));\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark)); border-radius: var(--radius-sm);\n}\n.geConfigEditor .color-scheme-row__label { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); min-width: 20px; text-align: center; }\n.geConfigEditor .color-scheme-entry {\n display: flex; align-items: center; gap: 3px; padding: 1px 4px;\n background: light-dark(var(--color-bg), var(--color-bg-dark)); border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-sm); font-size: var(--font-size-xs);\n}\n.geConfigEditor .color-scheme-entry__swatch {\n width: 14px; height: 14px; border-radius: 2px;\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark)); position: relative; cursor: pointer; flex-shrink: 0;\n}\n.geConfigEditor .color-scheme-entry__swatch input[type="color"] {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n opacity: 0; cursor: pointer; border: none; padding: 0;\n}\n.geConfigEditor .color-scheme-entry__key { color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); }\n.geConfigEditor .color-scheme-entry__remove {\n background: none; border: none; cursor: pointer;\n color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); font-size: 11px; padding: 0 1px; line-height: 1;\n}\n.geConfigEditor .color-scheme-entry__remove:hover { color: var(--color-error); }\n.geConfigEditor .color-scheme-row__actions { display: flex; gap: 2px; margin-left: auto; }\n.geConfigEditor .color-scheme-row__btn {\n background: none; border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-sm); cursor: pointer;\n font-size: var(--font-size-xs); padding: 1px 5px; color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark));\n}\n.geConfigEditor .color-scheme-row__btn:hover { background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark)); color: light-dark(var(--color-text), var(--color-text-dark)); }\n.geConfigEditor .tag-list { display: flex; flex-wrap: wrap; gap: 3px; }\n.geConfigEditor .tag {\n display: inline-flex; align-items: center; gap: 3px;\n padding: 1px 6px; background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark));\n border-radius: var(--radius-sm); font-size: var(--font-size-xs);\n}\n.geConfigEditor .tag__remove {\n background: none; border: none; cursor: pointer;\n color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); font-size: 13px; padding: 0 1px; line-height: 1;\n}\n.geConfigEditor .tag__remove:hover { color: var(--color-error); }\n.geConfigEditor .tag__link { color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); font-size: 9px; line-height: 1; }\n.geConfigEditor .tag-input-wrap { display: flex; gap: 4px; margin-top: 4px; }\n.geConfigEditor .tag-input-wrap input { flex: 1; }\n.geConfigEditor .search-box { position: sticky; top: 0; z-index: 50; background: light-dark(var(--color-bg), var(--color-bg-dark)); padding: 6px 0 8px; }\n.geConfigEditor .search-box input { font-size: var(--font-size-base); padding: 6px 10px; }\n.geConfigEditor .search-box__count { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); margin-top: 2px; }\n.geConfigEditor .config-section.search-hidden, .geConfigEditor .toggle-field.search-hidden,\n.geConfigEditor .field.search-hidden, .geConfigEditor .field-row.search-hidden { display: none; }\n.geConfigEditor .mt-sm { margin-top: 4px; }\n.geConfigEditor .mb-sm { margin-bottom: 4px; }\n.geConfigEditor .checkbox { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }\n.geConfigEditor .checkbox input { width: auto; margin: 0; }\n@supports (scrollbar-color: auto) {\n .geConfigEditor { scrollbar-color: light-dark(var(--color-scrollbar), var(--color-scrollbar-dark)) transparent; scrollbar-width: thin; }\n}\n@media (prefers-contrast: more) {\n .geConfigEditor {\n --color-bg: #ffffff;\n --color-bg-dark: #000000;\n --color-bg-secondary: #e0e0e0;\n --color-bg-secondary-dark: #1a1a1a;\n --color-bg-tertiary: #cccccc;\n --color-bg-tertiary-dark: #2a2a2a;\n --color-input: #ffffff;\n --color-input-dark: #111111;\n --color-text: #000000;\n --color-text-dark: #ffffff;\n --color-text-secondary: #333333;\n --color-text-secondary-dark: #cccccc;\n --color-border: #666666;\n --color-border-dark: #999999;\n --color-success: #006633;\n --color-error: #cc0000;\n }\n .geConfigEditor input[type="text"], .geConfigEditor input[type="url"], .geConfigEditor input[type="number"], .geConfigEditor textarea, .geConfigEditor select {\n border: 2px solid light-dark(var(--color-border), var(--color-border-dark));\n }\n .geConfigEditor .tri-toggle { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .tri-toggle button { font-weight: 600; }\n .geConfigEditor .tri-toggle button + button { border-left: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .card { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .card__header { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .toggle-field { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .card__body > * + .toggle-list { border-top: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n}\n.geConfigEditor.high-contrast {\n --color-bg: #ffffff;\n --color-bg-dark: #000000;\n --color-bg-secondary: #e0e0e0;\n --color-bg-secondary-dark: #1a1a1a;\n --color-bg-tertiary: #cccccc;\n --color-bg-tertiary-dark: #2a2a2a;\n --color-input: #ffffff;\n --color-input-dark: #111111;\n --color-text: #000000;\n --color-text-dark: #ffffff;\n --color-text-secondary: #333333;\n --color-text-secondary-dark: #cccccc;\n --color-border: #666666;\n --color-border-dark: #999999;\n --color-success: #006633;\n --color-error: #cc0000;\n}\n.geConfigEditor.high-contrast input[type="text"],\n.geConfigEditor.high-contrast input[type="url"],\n.geConfigEditor.high-contrast input[type="number"],\n.geConfigEditor.high-contrast textarea,\n.geConfigEditor.high-contrast select {\n border: 2px solid light-dark(var(--color-border), var(--color-border-dark));\n}\n.geConfigEditor.high-contrast .tri-toggle { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .tri-toggle button { font-weight: 600; }\n.geConfigEditor.high-contrast .tri-toggle button + button { border-left: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .card { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .card__header { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .toggle-field { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .card__body > * + .toggle-list { border-top: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n@media (forced-colors: active) {\n .geConfigEditor input[type="text"], .geConfigEditor input[type="url"], .geConfigEditor input[type="number"], .geConfigEditor textarea, .geConfigEditor select {\n border: 2px solid ButtonText;\n background: Field;\n color: FieldText;\n }\n .geConfigEditor .card { border: 2px solid ButtonText; }\n .geConfigEditor .card__header { background: Canvas; border-bottom: 2px solid ButtonText; forced-color-adjust: none; }\n .geConfigEditor .tri-toggle { border: 2px solid ButtonText; }\n .geConfigEditor .tri-toggle button { background: ButtonFace; color: ButtonText; border-color: ButtonText; }\n .geConfigEditor .tri-toggle button.active--true,\n .geConfigEditor .tri-toggle button.active--false { background: Highlight; color: HighlightText; }\n .geConfigEditor .tri-toggle button.active--unset { background: ButtonFace; color: ButtonText; outline: 2px solid Highlight; outline-offset: -2px; }\n .geConfigEditor .btn--secondary { border: 1px solid ButtonText; }\n .geConfigEditor .toggle-field { border-bottom: 1px solid ButtonText; }\n .geConfigEditor .card__body > * + .toggle-list { border-top: 1px solid ButtonText; }\n .geConfigEditor .search-box { background: Canvas; }\n .geConfigEditor { background: Canvas; color: CanvasText; }\n}',
html:'<div class="search-box" id="searchBox">\n <input type="text" id="searchInput" placeholder="">\n <div class="search-box__count" id="searchCount"></div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionGeneral"></h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-version"></label>\n <input type="text" id="cfg-version" data-key="version" placeholder="e.g. 1.0">\n <p class="field__help"></p>\n </div>\n <div class="field">\n <label for="cfg-settingsName"></label>\n <input type="text" id="cfg-settingsName" data-key="settingsName" placeholder=".drawio-config">\n <p class="field__help"></p>\n </div>\n </div>\n <div class="field">\n <label for="cfg-keyboardShortcuts"></label>\n <textarea id="cfg-keyboardShortcuts" data-key="keyboardShortcuts" data-type="json" placeholder=\'[{"keyCode": "T", "control": true, "shift": true, "action": "tags"}]\' style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n <div class="field">\n <label for="cfg-resources"></label>\n <textarea id="cfg-resources" data-key="resources" data-type="json" placeholder=\'{"saveAs": {"main": "Save a Copy", "de": "Kopie speichern"}, "myKey": "My Text"}\' style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n <div class="field">\n <label data-i18n="cfgDefaultLanguages"></label>\n <div class="tag-list" id="defaultLanguages-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="defaultLanguages-input" placeholder="e.g. de, fr">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultLanguages-add" data-i18n="add"></button>\n </div>\n <p class="field__help" data-i18n="cfgDefaultLanguagesHelp"></p>\n </div>\n <div id="general-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionCanvasGrid"></h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-defaultGridSize"></label>\n <input type="number" id="cfg-defaultGridSize" data-key="defaultGridSize" placeholder="10" min="1">\n </div>\n <div class="field">\n <label for="cfg-gridSteps"></label>\n <input type="number" id="cfg-gridSteps" data-key="gridSteps" placeholder="e.g. 4" min="1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-defaultGridColor"></label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-defaultGridColorPicker" value="#E6E6E6" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-defaultGridColor" data-key="defaultGridColor" placeholder="#E6E6E6" style="flex: 1;">\n </div>\n </div>\n <div class="field">\n <label for="cfg-defaultDarkGridColor"></label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-defaultDarkGridColorPicker" value="#424242" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-defaultDarkGridColor" data-key="defaultDarkGridColor" placeholder="#424242" style="flex: 1;">\n </div>\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-zoomFactor"></label>\n <input type="number" id="cfg-zoomFactor" data-key="zoomFactor" placeholder="1.2" min="1.01" step="0.05">\n </div>\n <div class="field">\n <label for="cfg-defaultEdgeLength"></label>\n <input type="number" id="cfg-defaultEdgeLength" data-key="defaultEdgeLength" placeholder="80" min="1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-foldingIconSize"></label>\n <input type="number" id="cfg-foldingIconSize" data-key="foldingIconSize" placeholder="9" min="1">\n </div>\n <div class="field"></div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-tooltipFontSize"></label>\n <input type="number" id="cfg-tooltipFontSize" data-key="tooltipFontSize" placeholder="11" min="1">\n </div>\n <div class="field">\n <label for="cfg-tooltipMaxWidth"></label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="number" id="cfg-tooltipMaxWidth" placeholder="360" min="1" style="flex: 1;">\n <label class="checkbox" style="white-space: nowrap;"><input type="checkbox" id="cfg-tooltipMaxWidthEnabled"> <span>Limit</span></label>\n </div>\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-pageFormatWidth"></label>\n <input type="number" id="cfg-pageFormatWidth" placeholder="850" min="1">\n </div>\n <div class="field">\n <label for="cfg-pageFormatHeight"></label>\n <input type="number" id="cfg-pageFormatHeight" placeholder="1100" min="1">\n </div>\n </div>\n <p class="field__help" data-i18n="cfgPageFormatHeightHelp"></p>\n <div class="field-row">\n <div class="field">\n <label for="cfg-defaultPageBackgroundColor"></label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-defaultPageBackgroundColorPicker" value="#FFFFFF" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-defaultPageBackgroundColor" data-key="defaultPageBackgroundColor" placeholder="#FFFFFF" style="flex: 1;">\n </div>\n </div>\n <div class="field">\n <label for="cfg-defaultDarkPageBackgroundColor"></label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-defaultDarkPageBackgroundColorPicker" value="#121212" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-defaultDarkPageBackgroundColor" data-key="defaultDarkPageBackgroundColor" placeholder="#121212" style="flex: 1;">\n </div>\n </div>\n </div>\n <div id="canvas-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionAppearance"></h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-darkColor"></label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-darkColorPicker" value="#2A2A2A" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-darkColor" data-key="darkColor" placeholder="#2A2A2A" style="flex: 1;">\n </div>\n </div>\n <div class="field">\n <label for="cfg-defaultAdaptiveColors"></label>\n <select id="cfg-defaultAdaptiveColors" data-key="defaultAdaptiveColors">\n <option value="">- Not set -</option>\n <option value="auto">auto</option>\n <option value="simple">simple</option>\n <option value="none">none</option>\n </select>\n </div>\n </div>\n <div class="field">\n <label for="cfg-darkColorVar"></label>\n <input type="text" id="cfg-darkColorVar" data-key="darkColorVar" placeholder="--ge-dark-color">\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-shadowColor"></label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-shadowColorPicker" value="#808080" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-shadowColor" data-key="shadowColor" placeholder="#808080" style="flex: 1;">\n </div>\n </div>\n <div class="field">\n <label for="cfg-shadowOpacity"></label>\n <input type="number" id="cfg-shadowOpacity" data-key="shadowOpacity" placeholder="1" min="0" max="1" step="0.1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-shadowOffsetX"></label>\n <input type="number" id="cfg-shadowOffsetX" data-key="shadowOffsetX" placeholder="e.g. 2">\n </div>\n <div class="field">\n <label for="cfg-shadowOffsetY"></label>\n <input type="number" id="cfg-shadowOffsetY" data-key="shadowOffsetY" placeholder="e.g. 3">\n </div>\n </div>\n <div class="field">\n <label for="cfg-shadowBlur"></label>\n <input type="number" id="cfg-shadowBlur" data-key="shadowBlur" placeholder="e.g. 6" min="0">\n </div>\n <div id="appearance-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionSidebarPanels"></h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-thumbWidth"></label>\n <input type="number" id="cfg-thumbWidth" data-key="thumbWidth" placeholder="46" min="1">\n </div>\n <div class="field">\n <label for="cfg-thumbHeight"></label>\n <input type="number" id="cfg-thumbHeight" data-key="thumbHeight" placeholder="46" min="1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-sidebarWidth"></label>\n <input type="number" id="cfg-sidebarWidth" data-key="sidebarWidth" placeholder="e.g. 250" min="1">\n </div>\n <div class="field">\n <label for="cfg-sidebarTitleSize"></label>\n <input type="number" id="cfg-sidebarTitleSize" data-key="sidebarTitleSize" placeholder="8" min="1">\n </div>\n </div>\n <div class="field">\n <label for="cfg-shapePicker"></label>\n <textarea id="cfg-shapePicker" data-key="shapePicker" data-type="json" placeholder=\'{"shapes": [...]}\' style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n <div id="sidebar-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionLibraries"></h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-defaultLibraries"></label>\n <input type="text" id="cfg-defaultLibraries" data-key="defaultLibraries" placeholder="general;uml;er;bpmn;flowchart;basic;arrows2">\n <p class="field__help"></p>\n </div>\n <div class="field">\n <label>Enabled Libraries</label>\n <div class="tag-list" id="enabledLibraries-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="enabledLibraries-input" placeholder="Add library key (e.g. general, uml)...">\n <button type="button" class="btn btn--secondary btn--sm" id="enabledLibraries-add">Add</button>\n </div>\n <p class="field__help">Libraries available in More Shapes dialog. Leave empty for all.</p>\n </div>\n <div class="field">\n <label>Default Custom Libraries</label>\n <div class="tag-list" id="defaultCustomLibraries-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="defaultCustomLibraries-input" placeholder="Add library ID or URL...">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultCustomLibraries-add">Add</button>\n </div>\n <p class="field__help">IDs or URLs of custom libraries to load on startup</p>\n </div>\n <div class="field">\n <label for="cfg-templateFile"></label>\n <input type="url" id="cfg-templateFile" data-key="templateFile" placeholder="https://app.diagrams.net/templates/index.xml">\n </div>\n <div class="field">\n <label>Template Sections</label>\n <div class="tag-list" id="enabledTemplateSections-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="enabledTemplateSections-input" placeholder="Add section (e.g. business, charts)...">\n <button type="button" class="btn btn--secondary btn--sm" id="enabledTemplateSections-add">Add</button>\n </div>\n <p class="field__help" data-i18n="cfgTemplateFileHelp"></p>\n </div>\n <div class="field">\n <label for="cfg-customTemplates"></label>\n <textarea id="cfg-customTemplates" data-key="customTemplates" data-type="json" placeholder=\'[{"section": "basic", "url": "https://example.com/template.xml", "title": "My Template", "preview": "https://example.com/template.png"}]\' style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n <div class="field">\n <label for="cfg-libraries"></label>\n <textarea id="cfg-libraries" data-key="libraries" data-type="json" placeholder=\'[{"title": {"main": "Company"}, "entries": [...]}]\' style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n <div id="library-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionFonts"></h3></div>\n <div class="card__body">\n <div class="field">\n <label>Default Fonts</label>\n <div class="tag-list" id="defaultFonts-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="defaultFonts-input" placeholder="Add font name...">\n <input type="text" id="defaultFonts-url" placeholder="Font URL (optional)">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultFonts-add">Add</button>\n </div>\n <p class="field__help">Font names for the format panel font picker; add a URL for web fonts (e.g. a Google Fonts CSS link)</p>\n </div>\n <div class="field">\n <label>Custom Fonts</label>\n <div class="tag-list" id="customFonts-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="customFonts-input" placeholder="Add font name...">\n <input type="text" id="customFonts-url" placeholder="Font URL (optional)">\n <button type="button" class="btn btn--secondary btn--sm" id="customFonts-add">Add</button>\n </div>\n <p class="field__help">Additional fonts added before default fonts; add a URL for web fonts (e.g. a Google Fonts CSS link)</p>\n </div>\n <div class="field">\n <label for="cfg-fontCss"></label>\n <textarea id="cfg-fontCss" data-key="fontCss" placeholder="@font-face { font-family: \'MyFont\'; src: url(\'...\'); }" style="min-height: 60px;"></textarea>\n </div>\n <div id="font-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionColors"></h3></div>\n <div class="card__body">\n <div class="field">\n <label>Preset Colors (upper palette)</label>\n <div class="color-list" id="presetColors-list"></div>\n <div class="tag-input-wrap">\n <input type="color" id="presetColors-picker" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="presetColors-input" placeholder="Hex without # (e.g. E6D0DE)" style="flex: 1;">\n <button type="button" class="btn btn--secondary btn--sm" id="presetColors-add">Add</button>\n </div>\n </div>\n <div class="field">\n <label>Custom Preset Colors</label>\n <div class="color-list" id="customPresetColors-list"></div>\n <div class="tag-input-wrap">\n <input type="color" id="customPresetColors-picker" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="customPresetColors-input" placeholder="Hex without # (e.g. FF5733)" style="flex: 1;">\n <button type="button" class="btn btn--secondary btn--sm" id="customPresetColors-add">Add</button>\n </div>\n <p class="field__help" data-i18n="cfgFontCssHelp"></p>\n </div>\n <div class="field">\n <label>Default Colors (lower palette)</label>\n <div class="color-list" id="defaultColors-list"></div>\n <div class="tag-input-wrap">\n <input type="color" id="defaultColors-picker" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="defaultColors-input" placeholder="Hex without # or \'none\'" style="flex: 1;">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultColors-add">Add</button>\n </div>\n </div>\n <div class="field">\n <label for="cfg-colorNames"></label>\n <textarea id="cfg-colorNames" data-key="colorNames" data-type="json" placeholder=\'{"FFFFFF": "White", "000000": "Black"}\' style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionColorSchemes"></h3></div>\n <div class="card__body">\n <div class="field">\n <label>Default Color Schemes</label>\n <div class="color-scheme-editor" id="defaultColorSchemes-editor"></div>\n <div class="btn-group mt-sm">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultColorSchemes-addRow">Add Row</button>\n </div>\n <p class="field__help">Colour schemes for the Style section. Each row is a scheme group.</p>\n </div>\n <div class="field">\n <label>Custom Color Schemes</label>\n <div class="color-scheme-editor" id="customColorSchemes-editor"></div>\n <div class="btn-group mt-sm">\n <button type="button" class="btn btn--secondary btn--sm" id="customColorSchemes-addRow">Add Row</button>\n </div>\n <p class="field__help">Additional colour schemes added before default schemes</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionDefaultStyles"></h3></div>\n <div class="card__body">\n <div class="field" data-search="font fontFamily fontSize fontColor">\n <label for="cfg-defaultTextStyle"></label>\n <input type="text" id="cfg-defaultTextStyle" data-key="defaultTextStyle" placeholder="text;html=1;whiteSpace=wrap;...">\n </div>\n <div class="field" data-search="font fontFamily fontSize fontColor fillColor strokeColor rounded shape">\n <div style="display: flex; align-items: center; justify-content: space-between;">\n <label for="cfg-defaultVertexStyle" style="margin-bottom: 0;">Default Vertex Style (JSON)</label>\n <button type="button" class="btn btn--secondary btn--sm" id="useCurrentVertexStyle" style="display: none;">Use Current</button>\n </div>\n <textarea id="cfg-defaultVertexStyle" data-key="defaultVertexStyle" data-type="json" placeholder=\'{"fontFamily": "Arial"}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field" data-search="font fontFamily fontSize fontColor edgeStyle orthogonal endArrow connection">\n <div style="display: flex; align-items: center; justify-content: space-between;">\n <label for="cfg-defaultEdgeStyle" style="margin-bottom: 0;">Default Edge Style (JSON)</label>\n <button type="button" class="btn btn--secondary btn--sm" id="useCurrentEdgeStyle" style="display: none;">Use Current</button>\n </div>\n <textarea id="cfg-defaultEdgeStyle" data-key="defaultEdgeStyle" data-type="json" placeholder=\'{"edgeStyle": "orthogonalEdgeStyle"}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-styles"></label>\n <textarea id="cfg-styles" data-key="styles" data-type="json" placeholder=\'[{}, {"commonStyle": {"fontColor": "#5C5C5C"}}]\' style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n <div class="field" data-search="mermaid theme themeVariables flowchart sequence">\n <label for="cfg-mermaid"></label>\n <textarea id="cfg-mermaid" data-key="mermaid" data-type="json" placeholder=\'{"theme": "neutral"}\' style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionCustomCSS"></h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-css"></label>\n <textarea id="cfg-css" data-key="css" placeholder=".geMenubarContainer { background-color: #2A2A2A !important; }" style="min-height: 80px;"></textarea>\n <p class="field__help"></p>\n </div>\n <div class="field">\n <label for="cfg-customCss"></label>\n <textarea id="cfg-customCss" data-key="customCss" placeholder="Additional CSS rules..." style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionEmbedding"></h3></div>\n <div class="card__body">\n <div id="embedding-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionMenuCustomization"></h3></div>\n <div class="card__body">\n <div class="field">\n <label>Hidden Menu Items</label>\n <div class="tag-list" id="hideMenuItems-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="hideMenuItems-input" placeholder="Add action name (e.g. print, exportPdf)...">\n <button type="button" class="btn btn--secondary btn--sm" id="hideMenuItems-add">Add</button>\n </div>\n <p class="field__help">Action names of menu items to hide</p>\n </div>\n <div class="field">\n <label>Hidden Menus</label>\n <div class="tag-list" id="hideMenus-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="hideMenus-input" placeholder="Add menu name (e.g. extras, help)...">\n <button type="button" class="btn btn--secondary btn--sm" id="hideMenus-add">Add</button>\n </div>\n <p class="field__help">Names of top-level menus to hide</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionAIConfiguration"></h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-gptApiKey"></label>\n <input type="text" id="cfg-gptApiKey" data-key="gptApiKey" placeholder="sk-...">\n </div>\n <div class="field">\n <label for="cfg-gptUrl"></label>\n <input type="url" id="cfg-gptUrl" data-key="gptUrl" placeholder="https://api.openai.com/v1/chat/completions">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-geminiApiKey"></label>\n <input type="text" id="cfg-geminiApiKey" data-key="geminiApiKey" placeholder="AI...">\n </div>\n <div class="field">\n <label for="cfg-claudeApiKey"></label>\n <input type="text" id="cfg-claudeApiKey" data-key="claudeApiKey" placeholder="sk-ant-...">\n </div>\n </div>\n <div class="field">\n <label for="cfg-aiActions"></label>\n <textarea id="cfg-aiActions" data-key="aiActions" data-type="json" placeholder=\'{"myAction": {"prompt": "..."}}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-aiGlobals"></label>\n <textarea id="cfg-aiGlobals" data-key="aiGlobals" data-type="json" placeholder=\'{}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-aiConfigs"></label>\n <textarea id="cfg-aiConfigs" data-key="aiConfigs" data-type="json" placeholder=\'{}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-aiModels"></label>\n <textarea id="cfg-aiModels" data-key="aiModels" data-type="json" placeholder=\'{}\' style="min-height: 60px;"></textarea>\n </div>\n <div id="ai-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionExportSecurity"></h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-maxImageBytes"></label>\n <input type="number" id="cfg-maxImageBytes" data-key="maxImageBytes" placeholder="1000000" min="0">\n </div>\n <div class="field">\n <label for="cfg-maxImageSize"></label>\n <input type="number" id="cfg-maxImageSize" data-key="maxImageSize" placeholder="520" min="0">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-autosaveDelay"></label>\n <input type="number" id="cfg-autosaveDelay" data-key="autosaveDelay" placeholder="e.g. 2000" min="0">\n </div>\n <div class="field">\n <label for="cfg-defaultFileType"></label>\n <select id="cfg-defaultFileType" data-key="defaultFileType">\n <option value="">- Not set -</option>\n <option value="drawio">XML (.drawio)</option>\n <option value="png">Editable PNG (.drawio.png)</option>\n <option value="svg">Editable SVG (.drawio.svg)</option>\n <option value="html">HTML (.drawio.html)</option>\n </select>\n </div>\n </div>\n <div id="export-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionCollaborationAdvanced"></h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-globalVars"></label>\n <textarea id="cfg-globalVars" data-key="globalVars" data-type="json" placeholder=\'{"companyName": "Acme Corp"}\' style="min-height: 60px;"></textarea>\n <p class="field__help"></p>\n </div>\n <div class="field">\n <label for="cfg-emptyDiagramXml"></label>\n <textarea id="cfg-emptyDiagramXml" data-key="emptyDiagramXml" placeholder="<mxGraphModel>...</mxGraphModel>" style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-emptyLibraryXml"></label>\n <textarea id="cfg-emptyLibraryXml" data-key="emptyLibraryXml" placeholder="<mxlibrary>[]</mxlibrary>" style="min-height: 60px;"></textarea>\n </div>\n <div id="advanced-toggles"></div>\n <div id="desktop-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionConfluenceCloud"></h3></div>\n <div class="card__body">\n <p class="field__help mb-sm">These options only apply to <strong>Confluence Cloud</strong>.</p>\n <div class="field">\n <label for="cfg-ui"></label>\n <select id="cfg-ui" data-key="ui">\n <option value="">- Not set -</option>\n <option value="kennedy">Kennedy</option>\n <option value="atlas">Atlas (default)</option>\n <option value="min">Minimal</option>\n <option value="sketch">Sketch</option>\n <option value="simple">Simple</option>\n </select>\n </div>\n <div id="confluence-cloud-toggles"></div>\n <div class="field">\n <label for="cfg-viewerTimeout"></label>\n <input type="number" id="cfg-viewerTimeout" data-key="viewerTimeout" placeholder="e.g. 30000" min="0">\n <p class="field__help">Timeout in milliseconds before the viewer gives up loading <code>viewerTimeout</code></p>\n </div>\n <div class="field">\n <label>Default Macro Parameters</label>\n <div class="field-row">\n <div class="field">\n <label for="cfg-cdmp-tbstyle" style="font-weight: normal;">Toolbar Style</label>\n <select id="cfg-cdmp-tbstyle">\n <option value="">- Not set -</option>\n <option value="top">top</option>\n <option value="inline">inline</option>\n <option value="hidden">hidden</option>\n </select>\n </div>\n <div class="field">\n <label for="cfg-cdmp-links" style="font-weight: normal;">Links</label>\n <select id="cfg-cdmp-links">\n <option value="">- Not set -</option>\n <option value="auto">auto</option>\n <option value="blank">blank</option>\n <option value="self">self</option>\n </select>\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-cdmp-zoom" style="font-weight: normal;">Zoom</label>\n <input type="number" id="cfg-cdmp-zoom" placeholder="e.g. 100" min="1">\n </div>\n <div class="field" style="padding-top: 16px;">\n <div id="cdmp-toggles-container"></div>\n </div>\n </div>\n <div style="display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px;" id="cdmp-booleans">\n <label class="checkbox"><input type="checkbox" id="cfg-cdmp-lbox" data-tristate="true"> <span>Lightbox</span></label>\n <label class="checkbox"><input type="checkbox" id="cfg-cdmp-simple" data-tristate="true"> <span>Simple Viewer</span></label>\n <label class="checkbox"><input type="checkbox" id="cfg-cdmp-pCenter" data-tristate="true"> <span>Center</span></label>\n <label class="checkbox"><input type="checkbox" id="cfg-cdmp-hiResPreview" data-tristate="true"> <span>High Resolution Preview</span></label>\n </div>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title" data-i18n="cfgSectionConfluenceServerDataCenter"></h3></div>\n <div class="card__body">\n <p class="field__help mb-sm">These options only apply to <strong>Confluence Server / Data Center</strong>.</p>\n <div id="confluence-toggles"></div>\n <div class="field">\n <label>Default Macro Parameters</label>\n <div class="field-row">\n <div class="field">\n <label for="cfg-dmp-toolbarStyle" style="font-weight: normal;">Toolbar Style</label>\n <select id="cfg-dmp-toolbarStyle">\n <option value="">- Not set -</option>\n <option value="top">top</option>\n <option value="inline">inline</option>\n <option value="hidden">hidden</option>\n </select>\n </div>\n <div class="field">\n <label for="cfg-dmp-links" style="font-weight: normal;">Links</label>\n <select id="cfg-dmp-links">\n <option value="">- Not set -</option>\n <option value="auto">auto</option>\n <option value="blank">blank</option>\n <option value="self">self</option>\n </select>\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-dmp-width" style="font-weight: normal;">Width</label>\n <input type="number" id="cfg-dmp-width" placeholder="e.g. 800" min="1">\n </div>\n <div class="field" style="padding-top: 16px;">\n <div id="dmp-toggles-container"></div>\n </div>\n </div>\n <div style="display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px;" id="dmp-booleans">\n <label class="checkbox"><input type="checkbox" id="cfg-dmp-border" data-tristate="true"> <span>Border</span></label>\n <label class="checkbox"><input type="checkbox" id="cfg-dmp-lightbox" data-tristate="true"> <span>Lightbox</span></label>\n <label class="checkbox"><input type="checkbox" id="cfg-dmp-simpleViewer" data-tristate="true"> <span>Simple Viewer</span></label>\n </div>\n </div>\n </div>\n </div>\n</div>'};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.DIFF_FILE="f";EditorUi.transientViewStateProperties="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0,extFonts:!0,adaptiveColors:!0};
EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,overlays:!0,mxObjectId:!0,mxTransient:!0};EditorUi.isPrototypePollutionKey=function(b){return"__proto__"==b||"constructor"==b||"prototype"==b};EditorUi.prototype.codec=new mxCodec;
EditorUi.prototype.applyPatches=function(b,k,m,g,q){if(null!=k)for(var u=0;u<k.length;u++)null!=k[u]&&(b=this.patchPages(b,k[u],m,g,q));return b};EditorUi.prototype.patchFileNode=function(b){var k=!1;if(null!=this.fileNode&&null!=b)for(var m=0;m<b.length;m++)if(null!=b[m]&&null!=b[m][EditorUi.DIFF_FILE])for(var g in b[m][EditorUi.DIFF_FILE])k=b[m][EditorUi.DIFF_FILE][g],null!=k?this.fileNode.setAttribute(g,k):this.fileNode.removeAttribute(g),k=!0;return k};
-EditorUi.prototype.patchPages=function(b,k,m,g,q){var u=Object.create(null),x=[],z=Object.create(null),F=Object.create(null),J=Object.create(null),H=Object.create(null);if(null!=g&&null!=g[EditorUi.DIFF_UPDATE])for(var D in g[EditorUi.DIFF_UPDATE])u[D]=g[EditorUi.DIFF_UPDATE][D];if(null!=k[EditorUi.DIFF_REMOVE])for(g=0;g<k[EditorUi.DIFF_REMOVE].length;g++)F[k[EditorUi.DIFF_REMOVE][g]]=!0;if(null!=k[EditorUi.DIFF_INSERT])for(g=0;g<k[EditorUi.DIFF_INSERT].length;g++)z[k[EditorUi.DIFF_INSERT][g].previous]=
-k[EditorUi.DIFF_INSERT][g];if(null!=k[EditorUi.DIFF_UPDATE])for(D in k[EditorUi.DIFF_UPDATE])g=k[EditorUi.DIFF_UPDATE][D],null!=g.previous&&(H[g.previous]=D);if(null!=b){var c="";for(g=0;g<b.length;g++){var f=b[g].getId();J[f]=b[g];null!=H[c]||F[f]||null!=k[EditorUi.DIFF_UPDATE]&&null!=k[EditorUi.DIFF_UPDATE][f]&&null!=k[EditorUi.DIFF_UPDATE][f].previous||(H[c]=f);c=f}}var l=Object.create(null),n=mxUtils.bind(this,function(t){var v=null!=t?t.getId():"";if(null!=t&&!l[v]){l[v]=!0;x.push(t);var B=null!=
-k[EditorUi.DIFF_UPDATE]?k[EditorUi.DIFF_UPDATE][v]:null;null!=B&&(this.updatePageRoot(t),null!=B.name&&t.setName(B.name),null!=B.viewBox&&(""==B.viewBox?t.node.removeAttribute("viewBox"):t.node.setAttribute("viewBox",B.viewBox)),null!=B.view&&this.patchViewState(t,B.view),null!=B.cells&&this.patchPage(t,B.cells,u[t.getId()],q),!m||null==B.cells&&null==B.view||(t.needsUpdate=!0))}t=H[v];null!=t&&(delete H[v],n(J[t]));t=z[v];null!=t&&(delete z[v],r(t))}),r=mxUtils.bind(this,function(t){t=mxUtils.parseXml(t.data).documentElement;
-t=new DiagramPage(t);this.updatePageRoot(t);var v=J[t.getId()];null==v?n(t):(this.patchPage(v,this.diffPages([v],[t]),u[v.getId()],q),m&&(v.needsUpdate=!0))});n();for(D in H)n(J[H[D]]),delete H[D];for(D in z)r(z[D]),delete z[D];return x};
+EditorUi.prototype.patchPages=function(b,k,m,g,q){var u=Object.create(null),x=[],z=Object.create(null),F=Object.create(null),I=Object.create(null),H=Object.create(null);if(null!=g&&null!=g[EditorUi.DIFF_UPDATE])for(var D in g[EditorUi.DIFF_UPDATE])u[D]=g[EditorUi.DIFF_UPDATE][D];if(null!=k[EditorUi.DIFF_REMOVE])for(g=0;g<k[EditorUi.DIFF_REMOVE].length;g++)F[k[EditorUi.DIFF_REMOVE][g]]=!0;if(null!=k[EditorUi.DIFF_INSERT])for(g=0;g<k[EditorUi.DIFF_INSERT].length;g++)z[k[EditorUi.DIFF_INSERT][g].previous]=
+k[EditorUi.DIFF_INSERT][g];if(null!=k[EditorUi.DIFF_UPDATE])for(D in k[EditorUi.DIFF_UPDATE])g=k[EditorUi.DIFF_UPDATE][D],null!=g.previous&&(H[g.previous]=D);if(null!=b){var c="";for(g=0;g<b.length;g++){var f=b[g].getId();I[f]=b[g];null!=H[c]||F[f]||null!=k[EditorUi.DIFF_UPDATE]&&null!=k[EditorUi.DIFF_UPDATE][f]&&null!=k[EditorUi.DIFF_UPDATE][f].previous||(H[c]=f);c=f}}var l=Object.create(null),n=mxUtils.bind(this,function(t){var v=null!=t?t.getId():"";if(null!=t&&!l[v]){l[v]=!0;x.push(t);var B=null!=
+k[EditorUi.DIFF_UPDATE]?k[EditorUi.DIFF_UPDATE][v]:null;null!=B&&(this.updatePageRoot(t),null!=B.name&&t.setName(B.name),null!=B.viewBox&&(""==B.viewBox?t.node.removeAttribute("viewBox"):t.node.setAttribute("viewBox",B.viewBox)),null!=B.view&&this.patchViewState(t,B.view),null!=B.cells&&this.patchPage(t,B.cells,u[t.getId()],q),!m||null==B.cells&&null==B.view||(t.needsUpdate=!0))}t=H[v];null!=t&&(delete H[v],n(I[t]));t=z[v];null!=t&&(delete z[v],r(t))}),r=mxUtils.bind(this,function(t){t=mxUtils.parseXml(t.data).documentElement;
+t=new DiagramPage(t);this.updatePageRoot(t);var v=I[t.getId()];null==v?n(t):(this.patchPage(v,this.diffPages([v],[t]),u[v.getId()],q),m&&(v.needsUpdate=!0))});n();for(D in H)n(I[H[D]]),delete H[D];for(D in z)r(z[D]),delete z[D];return x};
EditorUi.prototype.patchViewState=function(b,k){if(null!=k){if(null==b.viewState){var m=mxUtils.createXmlDocument();b.viewState=this.editor.graph.createViewState(m.createElement("mxGraphModel"))}b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var g in k)if(!EditorUi.isPrototypePollutionKey(g))try{this.patchViewStateProperty(b,k,g)}catch(q){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};
EditorUi.prototype.patchViewStateProperty=function(b,k,m){b.viewState[m]=JSON.parse(k[m])};
-EditorUi.prototype.createParentLookup=function(b,k){function m(J){var H=g[J];null==H&&(H={inserted:Object.create(null),moved:Object.create(null)},g[J]=H);return H}var g=Object.create(null);if(null!=k[EditorUi.DIFF_INSERT])for(var q=0;q<k[EditorUi.DIFF_INSERT].length;q++){var u=k[EditorUi.DIFF_INSERT][q],x=null!=u.parent?u.parent:"",z=null!=u.previous?u.previous:"";m(x).inserted[z]=u}if(null!=k[EditorUi.DIFF_UPDATE])for(var F in k[EditorUi.DIFF_UPDATE])u=k[EditorUi.DIFF_UPDATE][F],null!=u.previous&&
+EditorUi.prototype.createParentLookup=function(b,k){function m(I){var H=g[I];null==H&&(H={inserted:Object.create(null),moved:Object.create(null)},g[I]=H);return H}var g=Object.create(null);if(null!=k[EditorUi.DIFF_INSERT])for(var q=0;q<k[EditorUi.DIFF_INSERT].length;q++){var u=k[EditorUi.DIFF_INSERT][q],x=null!=u.parent?u.parent:"",z=null!=u.previous?u.previous:"";m(x).inserted[z]=u}if(null!=k[EditorUi.DIFF_UPDATE])for(var F in k[EditorUi.DIFF_UPDATE])u=k[EditorUi.DIFF_UPDATE][F],null!=u.previous&&
(x=u.parent,null==x&&(q=b.getCell(F),null!=q&&(q=b.getParent(q),null!=q&&(x=q.getId()))),null!=x&&(m(x).moved[u.previous]=F));return g};
-EditorUi.prototype.patchPage=function(b,k,m,g){var q=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),u=this.createParentLookup(q,k);q.beginUpdate();try{var x=q.updateEdgeParent,z=new mxDictionary,F=[];q.updateEdgeParent=function(r,t){!z.get(r)&&g&&(z.put(r,!0),F.push(r))};var J=u[""],H=null!=J&&null!=J.inserted?J.inserted[""]:null,D=null;null!=H&&(D=this.getCellForJson(H));if(null==D){var c=null!=J&&null!=J.moved?J.moved[""]:null;null!=c&&(D=q.getCell(c))}null!=D&&(q.setRoot(D),
+EditorUi.prototype.patchPage=function(b,k,m,g){var q=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),u=this.createParentLookup(q,k);q.beginUpdate();try{var x=q.updateEdgeParent,z=new mxDictionary,F=[];q.updateEdgeParent=function(r,t){!z.get(r)&&g&&(z.put(r,!0),F.push(r))};var I=u[""],H=null!=I&&null!=I.inserted?I.inserted[""]:null,D=null;null!=H&&(D=this.getCellForJson(H));if(null==D){var c=null!=I&&null!=I.moved?I.moved[""]:null;null!=c&&(D=q.getCell(c))}null!=D&&(q.setRoot(D),
b.root=D,EditorUi.debug("EditorUi.patchPage: Root changed",D.id));this.patchCellRecursive(b,q,q.root,u,k);if(null!=k[EditorUi.DIFF_REMOVE])for(var f=0;f<k[EditorUi.DIFF_REMOVE].length;f++){c=k[EditorUi.DIFF_REMOVE][f];var l=q.getCell(c);null!=l&&q.remove(l)}if(null!=k[EditorUi.DIFF_UPDATE]){var n=null!=m&&null!=m.cells?m.cells[EditorUi.DIFF_UPDATE]:null;for(c in k[EditorUi.DIFF_UPDATE])l=q.getCell(c),null!=l?this.patchCell(q,l,k[EditorUi.DIFF_UPDATE][c],null!=n?n[c]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",
c,"diff",[k[EditorUi.DIFF_UPDATE][c]])}if(null!=k[EditorUi.DIFF_INSERT])for(f=0;f<k[EditorUi.DIFF_INSERT].length;f++)H=k[EditorUi.DIFF_INSERT][f],l=q.getCell(H.id),null!=l&&(q.setTerminal(l,q.getCell(H.source),!0),q.setTerminal(l,q.getCell(H.target),!1));q.updateEdgeParent=x;if(g&&0<F.length)for(f=0;f<F.length;f++)q.contains(F[f])&&q.updateEdgeParent(F[f])}finally{q.endUpdate()}};
-EditorUi.prototype.patchCellRecursive=function(b,k,m,g,q){if(null!=m){var u=g[m.getId()],x=null!=u&&null!=u.inserted?u.inserted:Object.create(null);u=null!=u&&null!=u.moved?u.moved:Object.create(null);for(var z=0,F=k.getChildCount(m),J="",H=0;H<F;H++){var D=k.getChildAt(m,H).getId();null==u[J]&&(null==q[EditorUi.DIFF_UPDATE]||null==q[EditorUi.DIFF_UPDATE][D]||null==q[EditorUi.DIFF_UPDATE][D].previous&&null==q[EditorUi.DIFF_UPDATE][D].parent)&&(u[J]=D);J=D}F=mxUtils.bind(this,function(c,f){var l=null!=
-c?c.getId():"";null==l&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id","cell",c);null!=c&&f&&(f=k.getCell(l),null!=f&&f!=c&&(c=null));null!=c&&(k.getChildAt(m,z)!=c&&k.add(m,c,z),this.patchCellRecursive(b,k,c,g,q),z++);return l});for(J=[null];0<J.length;)if(H=J.shift(),H=F(null!=H?H.child:null,null!=H?H.insert:!1),D=u[H],null!=D&&(delete u[H],J.push({child:k.getCell(D)})),D=x[H],null!=D&&(delete x[H],J.push({child:this.getCellForJson(D),insert:!0})),0==J.length){for(H in u)J.push({child:k.getCell(u[H])}),
-delete u[H];for(H in x)J.push({child:this.getCellForJson(x[H]),insert:!0}),delete x[H]}}};
+EditorUi.prototype.patchCellRecursive=function(b,k,m,g,q){if(null!=m){var u=g[m.getId()],x=null!=u&&null!=u.inserted?u.inserted:Object.create(null);u=null!=u&&null!=u.moved?u.moved:Object.create(null);for(var z=0,F=k.getChildCount(m),I="",H=0;H<F;H++){var D=k.getChildAt(m,H).getId();null==u[I]&&(null==q[EditorUi.DIFF_UPDATE]||null==q[EditorUi.DIFF_UPDATE][D]||null==q[EditorUi.DIFF_UPDATE][D].previous&&null==q[EditorUi.DIFF_UPDATE][D].parent)&&(u[I]=D);I=D}F=mxUtils.bind(this,function(c,f){var l=null!=
+c?c.getId():"";null==l&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id","cell",c);null!=c&&f&&(f=k.getCell(l),null!=f&&f!=c&&(c=null));null!=c&&(k.getChildAt(m,z)!=c&&k.add(m,c,z),this.patchCellRecursive(b,k,c,g,q),z++);return l});for(I=[null];0<I.length;)if(H=I.shift(),H=F(null!=H?H.child:null,null!=H?H.insert:!1),D=u[H],null!=D&&(delete u[H],I.push({child:k.getCell(D)})),D=x[H],null!=D&&(delete x[H],I.push({child:this.getCellForJson(D),insert:!0})),0==I.length){for(H in u)I.push({child:k.getCell(u[H])}),
+delete u[H];for(H in x)I.push({child:this.getCellForJson(x[H]),insert:!0}),delete x[H]}}};
EditorUi.prototype.patchCell=function(b,k,m,g){if(null!=k&&null!=m){if(null==g||null==g.xmlValue&&(null==g.value||""==g.value))"value"in m?b.setValue(k,m.value):null!=m.xmlValue&&b.setValue(k,mxUtils.parseXml(m.xmlValue).documentElement);(null==g||null==g.style)&&"style"in m&&b.setStyle(k,m.style);null!=m.visible&&b.setVisible(k,1==m.visible);null!=m.collapsed&&b.setCollapsed(k,1==m.collapsed);null!=m.vertex&&(k.vertex=1==m.vertex);null!=m.edge&&(k.edge=1==m.edge);null!=m.connectable&&(k.connectable=
1==m.connectable);"string"==typeof m.geometry&&b.setGeometry(k,this.codec.decode(mxUtils.parseXml(m.geometry).documentElement));null!=m.source&&b.setTerminal(k,b.getCell(m.source),!0);null!=m.target&&b.setTerminal(k,b.getCell(m.target),!1);for(var q in m)this.cellProperties[q]||EditorUi.isPrototypePollutionKey(q)||(k[q]=m[q])}};EditorUi.prototype.getXmlForPages=function(b){b=this.getNodeForPages(b);var k=null;null!=b&&(k=mxUtils.getXml(b));return k};
EditorUi.prototype.getNodeForPages=function(b){var k=null;if(null!=this.fileNode&&null!=b){k=this.fileNode.cloneNode(!1);for(var m=0;m<b.length;m++){var g=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b[m].root));this.editor.graph.saveViewState(b[m].viewState,g);var q=b[m].node.cloneNode(!1);q.appendChild(g);k.appendChild(q)}}return k};EditorUi.prototype.getPagesForXml=function(b,k){b=mxUtils.parseXml(b);return this.getPagesForNode(b.documentElement,null,k)};
EditorUi.prototype.getPagesForNode=function(b,k,m){var g=this.editor.extractGraphModel(b,!0,!0);null!=g&&(b=g);k=b.getElementsByTagName(k||"diagram");g=[];if(0<k.length)for(b=0;b<k.length;b++){var q=new DiagramPage(k[b]);try{this.updatePageRoot(q,!0)}catch(u){if(!m)throw u;q=null}g.push(q)}else"mxGraphModel"==b.nodeName&&(q=new DiagramPage(b.ownerDocument.createElement("diagram")),q.setName(mxResources.get("pageWithNumber",[1])),q.node.appendChild(b.cloneNode(!0)),g.push(q));return g};
-EditorUi.prototype.diffPages=function(b,k){var m=[],g=[],q=Object.create(null),u=Object.create(null),x=Object.create(null),z=null;if(null!=b&&null!=k){for(var F=0;F<k.length;F++)null!=k[F]&&(u[k[F].getId()]={page:k[F],prev:z},z=k[F]);z=null;for(F=0;F<b.length;F++)if(null!=b[F]){var J=b[F].getId(),H=u[J];if(null==H)g.push(J);else{this.updatePageRoot(b[F]);this.updatePageRoot(H.page);var D=this.diffCells(b[F].root,H.page.root);k={};mxUtils.isEmptyObject(D)||(k.cells=D);D=this.diffViewState(b[F],H.page);
-mxUtils.isEmptyObject(D)||(k.view=D);if((null!=H.prev?null==z:null!=z)||null!=z&&null!=H.prev&&z.getId()!=H.prev.getId())k.previous=null!=H.prev?H.prev.getId():"";null!=H.page.getName()&&b[F].getName()!=H.page.getName()&&(k.name=H.page.getName());z=b[F].node.getAttribute("viewBox");H=H.page.node.getAttribute("viewBox");H!=z&&(k.viewBox=null!=H?H:"");mxUtils.isEmptyObject(k)||(x[J]=k)}delete u[b[F].getId()];z=b[F]}for(J in u)H=u[J],m.push({id:H.page.getId(),data:mxUtils.getXml(H.page.node),previous:null!=
+EditorUi.prototype.diffPages=function(b,k){var m=[],g=[],q=Object.create(null),u=Object.create(null),x=Object.create(null),z=null;if(null!=b&&null!=k){for(var F=0;F<k.length;F++)null!=k[F]&&(u[k[F].getId()]={page:k[F],prev:z},z=k[F]);z=null;for(F=0;F<b.length;F++)if(null!=b[F]){var I=b[F].getId(),H=u[I];if(null==H)g.push(I);else{this.updatePageRoot(b[F]);this.updatePageRoot(H.page);var D=this.diffCells(b[F].root,H.page.root);k={};mxUtils.isEmptyObject(D)||(k.cells=D);D=this.diffViewState(b[F],H.page);
+mxUtils.isEmptyObject(D)||(k.view=D);if((null!=H.prev?null==z:null!=z)||null!=z&&null!=H.prev&&z.getId()!=H.prev.getId())k.previous=null!=H.prev?H.prev.getId():"";null!=H.page.getName()&&b[F].getName()!=H.page.getName()&&(k.name=H.page.getName());z=b[F].node.getAttribute("viewBox");H=H.page.node.getAttribute("viewBox");H!=z&&(k.viewBox=null!=H?H:"");mxUtils.isEmptyObject(k)||(x[I]=k)}delete u[b[F].getId()];z=b[F]}for(I in u)H=u[I],m.push({id:H.page.getId(),data:mxUtils.getXml(H.page.node),previous:null!=
H.prev?H.prev.getId():""});mxUtils.isEmptyObject(x)||(q[EditorUi.DIFF_UPDATE]=x);0<g.length&&(q[EditorUi.DIFF_REMOVE]=g);0<m.length&&(q[EditorUi.DIFF_INSERT]=m)}return q};EditorUi.prototype.createCellLookup=function(b,k,m){m=null!=m?m:Object.create(null);null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):m[b.getId()]={cell:b,prev:k};var g=b.getChildCount();k=null;for(var q=0;q<g;q++){var u=b.getChildAt(q);this.createCellLookup(u,k,m);k=u}return m};
EditorUi.prototype.diffCellRecursive=function(b,k,m,g,q){g=null!=g?g:{};var u=m[b.getId()];delete m[b.getId()];if(null==u)null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored removed cell with no id",b):q.push(b.getId());else{var x=this.diffCell(b,u.cell);if(null!=x.parent||(null!=u.prev?null==k:null!=k)||null!=k&&null!=u.prev&&k.getId()!=u.prev.getId())x.previous=null!=u.prev?u.prev.getId():"";mxUtils.isEmptyObject(x)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",
b,"diff",x):g[b.getId()]=x)}u=b.getChildCount();k=null;for(x=0;x<u;x++){var z=b.getChildAt(x);this.diffCellRecursive(z,k,m,g,q);k=z}return g};
@@ -15060,9 +15070,9 @@ DrawioFileSync.prototype.sendUnconfirmedChanges=function(){try{if(this.file.isRe
DrawioFileSync.prototype.sendLocalChanges=function(){try{if(this.file.isRealtime()&&this.localFileWasChanged){var b=this.ui.clonePages(this.ui.pages),k=this.ui.diffPages(this.snapshot,b),m=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;m!=this.snapshotVars&&(k[EditorUi.DIFF_FILE]={vars:m});this.snapshotVars=m;this.file.ownPages=this.ui.patchPages(this.file.ownPages,k,!0);this.snapshot=b;var g=this.ui.resolveCrossReferences(k,this.ui.diffPages(this.file.ownPages,this.ui.pages));
this.file.ownPages=this.ui.patchPages(this.file.ownPages,g,!0);this.isRealtimeActive()&&this.doSendLocalChanges([g,k])}this.localFileWasChanged=!1}catch(q){b=this.file.getCurrentUser(),b=null!=b?b.id:"unknown",EditorUi.logError("Error in sendLocalChanges",null,this.file.getMode()+"."+this.file.getId(),b,q)}};
DrawioFileSync.prototype.doReceiveRemoteChanges=function(b){this.file.isRealtime()&&this.isRealtimeActive()&&(this.sendLocalChanges(),this.file.patch(b),this.file.theirPages=this.ui.applyPatches(this.file.theirPages,b),this.scheduleCleanup(),EditorUi.debug("DrawioFileSync.doReceiveRemoteChanges",[this],"changes",b))};
-DrawioFileSync.prototype.merge=function(b,k,m,g,q,u,x){try{this.file.stats.merged++;this.lastModified=new Date;var z=this.file.getDescriptorRevisionId(m);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var F=this.ui.clonePages(this.file.getShadowPages()),J=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(F,this.ui.pages):null,H=this.file.isRealtime()?this.ui.diffPages(F,this.file.ownPages):null;F=this.ui.applyPatches(F,b);var D=null==k?null:this.ui.getHashValueForPages(F);
-EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",J,"pending",H,"checksum",k,"current",D,"valid",k==D,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",z,"etag",this.file.getDescriptorEtag(m),"immediate",x);if(null!=k&&k!=D){this.reload(mxUtils.bind(this,function(){null!=g&&g()}),mxUtils.bind(this,function(){null!=q&&q()}),u,null,x);return}var c=this.file.getShadowVars();for(k=0;k<b.length;k++)null!=b[k]&&null!=b[k][EditorUi.DIFF_FILE]&&
-void 0!==b[k][EditorUi.DIFF_FILE].vars&&(c=b[k][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(F,c);if(null==this.patchRealtime(b,null,H,x))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?J:null);else{var f=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var l=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;f!=l&&(this.ui.editor.graph.refresh(),this.snapshotVars=l);if(!this.isRealtimeConnected()){var n=[this.ui.diffPages(this.ui.pages,
+DrawioFileSync.prototype.merge=function(b,k,m,g,q,u,x){try{this.file.stats.merged++;this.lastModified=new Date;var z=this.file.getDescriptorRevisionId(m);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var F=this.ui.clonePages(this.file.getShadowPages()),I=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(F,this.ui.pages):null,H=this.file.isRealtime()?this.ui.diffPages(F,this.file.ownPages):null;F=this.ui.applyPatches(F,b);var D=null==k?null:this.ui.getHashValueForPages(F);
+EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",I,"pending",H,"checksum",k,"current",D,"valid",k==D,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",z,"etag",this.file.getDescriptorEtag(m),"immediate",x);if(null!=k&&k!=D){this.reload(mxUtils.bind(this,function(){null!=g&&g()}),mxUtils.bind(this,function(){null!=q&&q()}),u,null,x);return}var c=this.file.getShadowVars();for(k=0;k<b.length;k++)null!=b[k]&&null!=b[k][EditorUi.DIFF_FILE]&&
+void 0!==b[k][EditorUi.DIFF_FILE].vars&&(c=b[k][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(F,c);if(null==this.patchRealtime(b,null,H,x))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?I:null);else{var f=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var l=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;f!=l&&(this.ui.editor.graph.refresh(),this.snapshotVars=l);if(!this.isRealtimeConnected()){var n=[this.ui.diffPages(this.ui.pages,
this.file.ownPages)];this.file.ignorePatches(n)||(this.file.theirPages=this.ui.clonePages(this.file.ownPages),this.file.patch(n))}}}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),m);null!=g&&g(!0)}catch(v){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=q&&q(v);try{var r=this.file.getCurrentUser(),t=null!=r?r.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),
t,v)}catch(B){}}};
DrawioFileSync.prototype.fileChanged=function(b,k,m,g,q){var u=window.setTimeout(mxUtils.bind(this,function(){null!=m&&m()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",g,"immediate",q,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(x){null!=m&&m()||(this.isValidState()?this.catchup(x,b,k,m,q):null!=k&&k())}),k)):null!=k&&k())}),g?this.cacheReadyDelay:0);return this.notifyThread=
@@ -15072,10 +15082,10 @@ this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;k=this.cleanupThread
DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(b){null!=b?(this.file.setDescriptorRevisionId(b,this.file.getCurrentRevisionId()),this.updateDescriptor(b),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(b){this.file.inConflictState=!0;this.file.handleFileError(b)}))};
DrawioFileSync.prototype.updateDescriptor=function(b){this.file.setDescriptor(b);this.file.descriptorChanged();this.start()};
DrawioFileSync.prototype.catchup=function(b,k,m,g,q){if(null!=b&&(null==g||!g())){var u=this.file.getCurrentRevisionId(),x=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",u,"to",x,"immediate",q,"valid",this.isValidState());if(u==x)this.file.patchDescriptor(this.file.getDescriptor(),b),"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.catchup",[this],"up to date","cleanup",this.cleanupThread,"checksum",this.ui.getHashValueForPages(this.ui.pages)),
-document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=k&&k(!0);else if(this.isValidState()){var z=this.file.getDescriptorChecksum(b),F=this.file.getDescriptorSecret(b);if(null!=z&&z==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=k&&k(!0);else if(Editor.enableRealtimeCache&&null!=F&&"1"!=urlParams.lockdown){var J=0,H=!1,D=mxUtils.bind(this,function(){if(null==g||!g())if(u!=this.file.getCurrentRevisionId())null!=k&&
+document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=k&&k(!0);else if(this.isValidState()){var z=this.file.getDescriptorChecksum(b),F=this.file.getDescriptorSecret(b);if(null!=z&&z==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=k&&k(!0);else if(Editor.enableRealtimeCache&&null!=F&&"1"!=urlParams.lockdown){var I=0,H=!1,D=mxUtils.bind(this,function(){if(null==g||!g())if(u!=this.file.getCurrentRevisionId())null!=k&&
k(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var c=!0,f=window.setTimeout(mxUtils.bind(this,function(){c=!1;this.reload(k,m,g,null,q)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(u)+"&to="+encodeURIComponent(x)+(null!=F?"&secret="+encodeURIComponent(F):""),mxUtils.bind(this,function(l){this.file.stats.bytesReceived+=l.getText().length;window.clearTimeout(f);if(c&&(null==g||!g()))if(u!=this.file.getCurrentRevisionId())null!=
-k&&k(!0);else if(this.isValidState()){var n=null,r=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[l],"status",l.getStatus(),"cacheReadyRetryCount",J,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=l.getStatus()&&299>=l.getStatus()&&0<l.getText().length)try{var t=JSON.parse(l.getText());if(null!=t&&0<t.length)for(var v=0;v<t.length;v++){var B=this.stringToObject(t[v]);if(B.v>DrawioFileSync.PROTOCOL){H=!0;r=[];break}else if(B.v===DrawioFileSync.PROTOCOL&&null!=B.d)n=B.d.checksum,
-r.push(B.d.patch);else{H=!0;r=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[t],"status",H?"failed":"ok","temp",r,"checksum",n)}catch(E){r=[],null!=window.console&&"1"==urlParams.test&&console.log(E)}try{0<r.length?(this.file.stats.cacheHits++,this.merge(r,n,b,k,m,g,q)):J<=this.maxCacheReadyRetries-1&&!H&&401!=l.getStatus()&&503!=l.getStatus()&&410!=l.getStatus()?(J++,this.file.stats.cacheMiss++,window.setTimeout(D,(J+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,
+k&&k(!0);else if(this.isValidState()){var n=null,r=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[l],"status",l.getStatus(),"cacheReadyRetryCount",I,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=l.getStatus()&&299>=l.getStatus()&&0<l.getText().length)try{var t=JSON.parse(l.getText());if(null!=t&&0<t.length)for(var v=0;v<t.length;v++){var B=this.stringToObject(t[v]);if(B.v>DrawioFileSync.PROTOCOL){H=!0;r=[];break}else if(B.v===DrawioFileSync.PROTOCOL&&null!=B.d)n=B.d.checksum,
+r.push(B.d.patch);else{H=!0;r=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[t],"status",H?"failed":"ok","temp",r,"checksum",n)}catch(E){r=[],null!=window.console&&"1"==urlParams.test&&console.log(E)}try{0<r.length?(this.file.stats.cacheHits++,this.merge(r,n,b,k,m,g,q)):I<=this.maxCacheReadyRetries-1&&!H&&401!=l.getStatus()&&503!=l.getStatus()&&410!=l.getStatus()?(I++,this.file.stats.cacheMiss++,window.setTimeout(D,(I+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,
this.reload(k,m,g,null,q))}catch(E){null!=m&&m(E)}}else null!=m&&m()}),m)}else null!=m&&m()});window.setTimeout(D,this.cacheReadyDelay)}else this.reload(k,m,g,null,q)}else null!=m&&m()}};DrawioFileSync.prototype.reload=function(b,k,m,g,q){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",q);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(u){null!=k&&k(u)}),m,g,q)};
DrawioFileSync.prototype.descriptorChanged=function(b){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId&&Editor.enableRealtimeCache){var k=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),m=this.file.getCurrentRevisionId(),g=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(b)+"&to="+encodeURIComponent(m)+"&msg="+encodeURIComponent(k)+"&data="+encodeURIComponent(g));this.file.stats.bytesSent+=
g.length;this.file.stats.msgSent++;EditorUi.debug("DrawioFileSync.descriptorChanged",[this],"from",b,"to",m)}this.updateStatus()};DrawioFileSync.encryptionAvailable=null;
@@ -15083,10 +15093,10 @@ DrawioFileSync.prototype.isEncryptionAvailable=function(){if(null==this.key||"un
DrawioFileSync.prototype.objectToString=function(b){b=Graph.compress(JSON.stringify(b));if(null!=this.key&&"undefined"!==typeof CryptoJS){if(!this.isEncryptionAvailable())throw Error("No CSPRNG for realtime encryption");b=CryptoJS.AES.encrypt(b,this.key).toString()}return b};DrawioFileSync.prototype.stringToObject=function(b){null!=this.key&&"undefined"!==typeof CryptoJS&&(b=CryptoJS.AES.decrypt(b,this.key).toString(CryptoJS.enc.Utf8));return JSON.parse(Graph.decompress(b))};
DrawioFileSync.prototype.createToken=function(b,k,m){var g=!0,q=window.setTimeout(mxUtils.bind(this,function(){g=!1;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&secret="+encodeURIComponent(b),mxUtils.bind(this,function(u){window.clearTimeout(q);g&&(200<=u.getStatus()&&299>=u.getStatus()?k(u.getText()):m({code:u.getStatus(),message:"Token Error "+u.getStatus()}))}),m)};
DrawioFileSync.prototype.fileSaving=function(){this.file.isOptimisticSync()&&this.notify(this.createMessage({m:Date.now(),type:"optimistic"}));EditorUi.debug("DrawioFileSync.fileSaving",[this],"optimistic",this.file.isOptimisticSync())};DrawioFileSync.prototype.fileDataUpdated=function(){this.scheduleCleanup(!0);EditorUi.debug("DrawioFileSync.fileDataUpdated",[this])};
-DrawioFileSync.prototype.fileSaved=function(b,k,m,g,q,u){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline(!0)&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var x=this.file.getDescriptorSecret(this.file.getDescriptor()),z=this.createMessage({m:this.lastModified.getTime()}),F=this.file.getDescriptorRevisionId(k),J=this.file.getCurrentRevisionId();if(null!=x&&null!=q&&
+DrawioFileSync.prototype.fileSaved=function(b,k,m,g,q,u){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline(!0)&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var x=this.file.getDescriptorSecret(this.file.getDescriptor()),z=this.createMessage({m:this.lastModified.getTime()}),F=this.file.getDescriptorRevisionId(k),I=this.file.getCurrentRevisionId();if(null!=x&&null!=q&&
"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var H=this.ui.diffPages(this.file.getShadowPages(),b),D=this.file.getShadowVars(),c=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;c!=D&&(H[EditorUi.DIFF_FILE]={vars:c});k=this.file.getDescriptorSecret(k);u=null!=u?u:this.ui.getHashValueForPages(b);D=this.objectToString(this.createMessage({patch:H,checksum:u}));this.file.stats.bytesSent+=D.length;this.file.stats.msgSent++;var f=!0,l=window.setTimeout(mxUtils.bind(this,function(){f=
-!1;g({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(F)+"&to="+encodeURIComponent(J)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(z)))+(null!=x?"&secret="+encodeURIComponent(x):"")+(null!=k?"&last-secret="+encodeURIComponent(k):"")+(D.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(D):"")+(null!=q?"&token="+encodeURIComponent(q):""),mxUtils.bind(this,
-function(n){window.clearTimeout(l);f&&(200<=n.getStatus()&&299>=n.getStatus()?(Editor.p2pSyncNotify&&this.notify(z),null!=m&&m()):g({message:mxResources.get("realtimeCollaboration")+(0!=n.getStatus()?": "+n.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",F,"to",J,"etag",this.file.getCurrentEtag(),"diff",H,D.length,"bytes","msg",z,"checksum",u)}else this.notify(z),null!=m&&m(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",F,"to",J,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);
+!1;g({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(F)+"&to="+encodeURIComponent(I)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(z)))+(null!=x?"&secret="+encodeURIComponent(x):"")+(null!=k?"&last-secret="+encodeURIComponent(k):"")+(D.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(D):"")+(null!=q?"&token="+encodeURIComponent(q):""),mxUtils.bind(this,
+function(n){window.clearTimeout(l);f&&(200<=n.getStatus()&&299>=n.getStatus()?(Editor.p2pSyncNotify&&this.notify(z),null!=m&&m()):g({message:mxResources.get("realtimeCollaboration")+(0!=n.getStatus()?": "+n.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",F,"to",I,"etag",this.file.getCurrentEtag(),"diff",H,D.length,"bytes","msg",z,"checksum",u)}else this.notify(z),null!=m&&m(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",F,"to",I,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);
this.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.scheduleCleanup()};DrawioFileSync.prototype.getIdParameters=function(){var b="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(b+="&sid="+this.pusher.connection.socket_id);return b};DrawioFileSync.prototype.createMessage=function(b){return{v:DrawioFileSync.PROTOCOL,d:b,c:this.clientId}};
DrawioFileSync.prototype.fileConflict=function(b,k,m){this.catchupRetryCount++;EditorUi.debug("DrawioFileSync.fileConflict",[this],"desc",[b],"catchupRetryCount",this.catchupRetryCount,"maxCatchupRetries",this.maxCatchupRetries);this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=b?this.catchup(b,k,m):this.fileChanged(k,m)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=m&&m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")}))};
DrawioFileSync.prototype.stop=function(){null!=this.pusher?(null!=this.pusher.connection&&(this.pusher.connection.unbind("state_change",this.connectionListener),this.pusher.connection.unbind("error",this.pusherErrorListener)),null!=this.channel&&(this.channel.unbind("changed",this.changeListener),this.channel=null),this.pusher.disconnect(),this.pusher=null,null!=this.p2pCollab&&(this.p2pCollab.destroy(),this.p2pCollab=null),EditorUi.debug("DrawioFileSync.stop",[this])):null!=this.polling&&(this.polling.stop(),
@@ -15099,7 +15109,7 @@ mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.wai
mxAsyncCanvas.prototype.setAlpha=function(b){this.state.alpha=b};mxAsyncCanvas.prototype.setFontColor=function(b){this.state.fontColor=b};mxAsyncCanvas.prototype.setFontBackgroundColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBackgroundColor=b};mxAsyncCanvas.prototype.setFontBorderColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBorderColor=b};mxAsyncCanvas.prototype.setFontSize=function(b){this.state.fontSize=b};
mxAsyncCanvas.prototype.setFontFamily=function(b){this.state.fontFamily=b};mxAsyncCanvas.prototype.setFontStyle=function(b){this.state.fontStyle=b};mxAsyncCanvas.prototype.rect=function(b,k,m,g){};mxAsyncCanvas.prototype.roundrect=function(b,k,m,g,q,u){};mxAsyncCanvas.prototype.ellipse=function(b,k,m,g){};mxAsyncCanvas.prototype.rewriteImageSource=function(b){if("http://"==b.substring(0,7)||"https://"==b.substring(0,8))b="/proxy?url="+encodeURIComponent(b);return b};
mxAsyncCanvas.prototype.image=function(b,k,m,g,q,u,x,z){q=this.rewriteImageSource(q);b=this.htmlCanvas.images[q];null==b&&(b=new Image,b.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),b.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[q]=b,b.src=q)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};
-mxAsyncCanvas.prototype.text=function(b,k,m,g,q,u,x,z,F,J,H,D){if(null!=q&&0!=q.length&&(b=this.state.scale,"html"==F&&"function"===typeof html2canvas)){this.incWaitCounter();var c=this.canvasIndex++;html2canvas(q,{onrendered:mxUtils.bind(this,function(f){this.htmlCanvas.subCanvas[c]=f;this.decWaitCounter()}),scale:b,logging:!0})}};mxAsyncCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function mxJsCanvas(b){mxAbstractCanvas2D.call(this);this.ctx=b.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;
+mxAsyncCanvas.prototype.text=function(b,k,m,g,q,u,x,z,F,I,H,D){if(null!=q&&0!=q.length&&(b=this.state.scale,"html"==F&&"function"===typeof html2canvas)){this.incWaitCounter();var c=this.canvasIndex++;html2canvas(q,{onrendered:mxUtils.bind(this,function(f){this.htmlCanvas.subCanvas[c]=f;this.decWaitCounter()}),scale:b,logging:!0})}};mxAsyncCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function mxJsCanvas(b){mxAbstractCanvas2D.call(this);this.ctx=b.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;
mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(b){b=b.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(k,m,g,q){return m+m+g+g+q+q});return(b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(b))?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++};
mxJsCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxJsCanvas.prototype.updateFont=function(){var b="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(b+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(b+="italic ");this.ctx.font=b+this.state.fontSize+"px "+this.state.fontFamily};
mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(b){this.state.scale*=b;this.state.strokeWidth*=b;this.ctx.scale(b,b)};mxJsCanvas.prototype.translate=function(b,k){this.state.dx+=b;this.state.dy+=k;this.ctx.translate(b,k)};
@@ -15114,9 +15124,9 @@ mxJsCanvas.prototype.setShadowOffset=function(b,k){this.state.shadowDx=b;this.st
mxJsCanvas.prototype.arcTo=function(b,k,m,g,q,u,x){b=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,b,k,m,g,q,u,x);if(null!=b)for(k=0;k<b.length;k+=6)this.curveTo(b[k],b[k+1],b[k+2],b[k+3],b[k+4],b[k+5])};mxJsCanvas.prototype.curveTo=function(b,k,m,g,q,u){this.ctx.bezierCurveTo(b,k,m,g,q,u);this.lastMoveX=q;this.lastMoveY=u};mxJsCanvas.prototype.rect=function(b,k,m,g){this.begin();this.moveTo(b,k);this.lineTo(b+m,k);this.lineTo(b+m,k+g);this.lineTo(b,k+g);this.close()};
mxJsCanvas.prototype.roundrect=function(b,k,m,g,q,u){this.begin();this.moveTo(b+q,k);this.lineTo(b+m-q,k);this.quadTo(b+m,k,b+m,k+u);this.lineTo(b+m,k+g-u);this.quadTo(b+m,k+g,b+m-q,k+g);this.lineTo(b+q,k+g);this.quadTo(b,k+g,b,k+g-u);this.lineTo(b,k+u);this.quadTo(b,k,b+q,k)};mxJsCanvas.prototype.ellipse=function(b,k,m,g){this.ctx.save();this.ctx.translate(b+m/2,k+g/2);this.ctx.scale(m/2,g/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()};
mxJsCanvas.prototype.rewriteImageSource=function(b){if("http://"==b.substring(0,7)||"https://"==b.substring(0,8))b="/proxy?url="+encodeURIComponent(b);return b};
-mxJsCanvas.prototype.image=function(b,k,m,g,q,u,x,z){q=this.rewriteImageSource(q);q=this.images[q];if(null!=q&&0<q.height&&0<q.width){var F=this.ctx;F.save();if(u){u=q.width;var J=q.height,H=Math.min(m/u,g/J);b+=(m-u*H)/2;k+=(g-J*H)/2;m=u*H;g=J*H}x&&(F.translate(2*b+m,0),F.scale(-1,1));z&&(F.translate(0,2*k+g),F.scale(1,-1));F.drawImage(q,b,k,m,g);F.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};
+mxJsCanvas.prototype.image=function(b,k,m,g,q,u,x,z){q=this.rewriteImageSource(q);q=this.images[q];if(null!=q&&0<q.height&&0<q.width){var F=this.ctx;F.save();if(u){u=q.width;var I=q.height,H=Math.min(m/u,g/I);b+=(m-u*H)/2;k+=(g-I*H)/2;m=u*H;g=I*H}x&&(F.translate(2*b+m,0),F.scale(-1,1));z&&(F.translate(0,2*k+g),F.scale(1,-1));F.drawImage(q,b,k,m,g);F.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};
mxJsCanvas.prototype.fill=function(){this.ctx.fill()};mxJsCanvas.prototype.stroke=function(){this.ctx.stroke()};mxJsCanvas.prototype.fillAndStroke=function(){if(this.state.shadow){this.ctx.stroke();this.ctx.fill();var b=this.ctx.shadowColor,k=this.ctx.shadowOffsetX,m=this.ctx.shadowOffsetY;this.ctx.shadowColor="transparent";this.ctx.shadowOffsetX=0;this.ctx.shadowOffsetY=0;this.ctx.stroke();this.ctx.shadowColor=b;this.ctx.shadowOffsetX=k;this.ctx.shadowOffsetY=m}else this.ctx.fill(),this.ctx.stroke()};
-mxJsCanvas.prototype.text=function(b,k,m,g,q,u,x,z,F,J,H,D){if(null!=q&&0!=q.length){m=this.state.scale;0!=D&&(this.ctx.translate(Math.round(b),Math.round(k)),this.ctx.rotate(D*Math.PI/180),this.ctx.translate(Math.round(-b),Math.round(-k)));if("html"==F){q=this.subCanvas[this.canvasIndex++];F=q.height;D=q.width;switch(x){case mxConstants.ALIGN_MIDDLE:k-=F/2/m;break;case mxConstants.ALIGN_BOTTOM:k-=F/m}switch(u){case mxConstants.ALIGN_CENTER:b-=D/2/m;break;case mxConstants.ALIGN_RIGHT:b-=D/m}this.ctx.save();
+mxJsCanvas.prototype.text=function(b,k,m,g,q,u,x,z,F,I,H,D){if(null!=q&&0!=q.length){m=this.state.scale;0!=D&&(this.ctx.translate(Math.round(b),Math.round(k)),this.ctx.rotate(D*Math.PI/180),this.ctx.translate(Math.round(-b),Math.round(-k)));if("html"==F){q=this.subCanvas[this.canvasIndex++];F=q.height;D=q.width;switch(x){case mxConstants.ALIGN_MIDDLE:k-=F/2/m;break;case mxConstants.ALIGN_BOTTOM:k-=F/m}switch(u){case mxConstants.ALIGN_CENTER:b-=D/2/m;break;case mxConstants.ALIGN_RIGHT:b-=D/m}this.ctx.save();
if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor)null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(Math.round(b)-.5,Math.round(k)-.5,Math.round(q.width/m),Math.round(q.height/m))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(b)-.5,Math.round(k)-.5,Math.round(q.width/m),Math.round(q.height/m)));this.ctx.scale(1/m,1/m);this.ctx.drawImage(q,
Math.round(b*m),Math.round(k*m))}else{this.ctx.save();this.updateFont();D=document.createElement("div");D.innerHTML=q;D.style.position="absolute";D.style.top="-9999px";D.style.left="-9999px";D.style.fontFamily=this.state.fontFamily;D.style.fontWeight="bold";D.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(D);F=[D.offsetWidth,D.offsetHeight];document.body.removeChild(D);q=q.split("\n");D=F[1];this.ctx.textBaseline="top";F=k;switch(x){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=
"middle";k-=(q.length-1)*D/2;F=k-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",k-=D*(q.length-1),F=k-this.state.fontSize}x=[];D=[];for(m=0;m<q.length;m++)D[m]=b,x[m]=this.ctx.measureText(q[m]).width,null!=u&&u!=mxConstants.ALIGN_LEFT&&(D[m]-=x[m],u==mxConstants.ALIGN_CENTER&&(D[m]+=x[m]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){b=D[0];u=x[0];for(m=1;m<q.length;m++)b=Math.min(b,D[m]),u=Math.max(u,x[m]);this.ctx.save();
@@ -15130,15 +15140,15 @@ GifEncoder.prototype.writeImageDescriptor=function(){this.out.push(44);this.writ
GifEncoder.prototype.writeShort=function(b){this.out.push(b&255);this.out.push(b>>8&255)};GifEncoder.prototype.writeString=function(b){for(var k=0;k<b.length;k++)this.out.push(b.charCodeAt(k))};GifEncoder.colorTableSizeFor=function(b){for(var k=0;2<<k<b;)k++;return Math.min(k,7)};GifEncoder.colorTableEntries=function(b){for(var k=2;k<b;)k*=2;return Math.min(k,256)};GifEncoder.colorDepthFor=function(b){for(var k=1;1<<k<b;)k++;return k};
GifEncoder.quantize=function(b,k,m){var g=b.length/4,q=-1;m&&--k;for(var u=[],x=1E5<g?Math.floor(g/5E4):1,z=0;z<g;z+=x){var F=4*z;128>b[F+3]||u.push([b[F],b[F+1],b[F+2]])}u.length<=k?(x=GifEncoder.uniqueColors(u),x.length>k&&(x=GifEncoder.medianCut(u,k))):x=GifEncoder.medianCut(u,k);for(;2>x.length;)x.push([0,0,0]);m&&(q=x.length,x.push([0,0,0]));k=new Uint8Array(g);for(z=0;z<g;z++)F=4*z,k[z]=m&&128>b[F+3]?q:GifEncoder.findClosest(x,b[F],b[F+1],b[F+2],q);return{palette:x,indexedPixels:k,transparentIndex:q}};
GifEncoder.uniqueColors=function(b){for(var k={},m=[],g=0;g<b.length;g++){var q=b[g][0]<<16|b[g][1]<<8|b[g][2];null==k[q]&&(k[q]=!0,m.push(b[g]))}return m};
-GifEncoder.medianCut=function(b,k){if(0==b.length)return[[0,0,0]];for(b=[b];b.length<k;){for(var m=-1,g=0,q=0;q<b.length;q++)if(!(1>=b[q].length)){var u=GifEncoder.colorRange(b[q]);u.maxRange>m&&(m=u.maxRange,g=q)}if(0>=m)break;q=b[g];u=GifEncoder.colorRange(q);q.sort(function(J,H){return J[u.channel]-H[u.channel]});m=Math.floor(q.length/2);b.splice(g,1,q.slice(0,m),q.slice(m))}k=[];for(q=0;q<b.length;q++){g=b[q];for(var x=m=0,z=0,F=0;F<g.length;F++)m+=g[F][0],x+=g[F][1],z+=g[F][2];k.push([Math.round(m/
+GifEncoder.medianCut=function(b,k){if(0==b.length)return[[0,0,0]];for(b=[b];b.length<k;){for(var m=-1,g=0,q=0;q<b.length;q++)if(!(1>=b[q].length)){var u=GifEncoder.colorRange(b[q]);u.maxRange>m&&(m=u.maxRange,g=q)}if(0>=m)break;q=b[g];u=GifEncoder.colorRange(q);q.sort(function(I,H){return I[u.channel]-H[u.channel]});m=Math.floor(q.length/2);b.splice(g,1,q.slice(0,m),q.slice(m))}k=[];for(q=0;q<b.length;q++){g=b[q];for(var x=m=0,z=0,F=0;F<g.length;F++)m+=g[F][0],x+=g[F][1],z+=g[F][2];k.push([Math.round(m/
g.length),Math.round(x/g.length),Math.round(z/g.length)])}return k};GifEncoder.colorRange=function(b){for(var k=255,m=0,g=255,q=0,u=255,x=0,z=0;z<b.length;z++){var F=b[z];F[0]<k&&(k=F[0]);F[0]>m&&(m=F[0]);F[1]<g&&(g=F[1]);F[1]>q&&(q=F[1]);F[2]<u&&(u=F[2]);F[2]>x&&(x=F[2])}b=m-k;g=q-g;u=x-u;return b>=g&&b>=u?{channel:0,maxRange:b}:g>=b&&g>=u?{channel:1,maxRange:g}:{channel:2,maxRange:u}};
-GifEncoder.findClosest=function(b,k,m,g,q){for(var u=Infinity,x=0,z=0;z<b.length;z++)if(z!==q){var F=k-b[z][0],J=m-b[z][1],H=g-b[z][2];F=F*F+J*J+H*H;F<u&&(u=F,x=z)}return x};
-GifEncoder.lzwEncode=function(b,k){for(var m=1<<k,g=m+1,q=k+1,u=g+1,x=1<<q,z={},F=0;F<m;F++)z[String(F)]=F;var J=0,H=0,D=[],c=function(n){J|=n<<H;for(H+=q;8<=H;)D.push(J&255),J>>=8,H-=8};c(m);if(0==b.length)return c(g),0<H&&D.push(J&255),new Uint8Array(D);var f=String(b[0]);for(F=1;F<b.length;F++){var l=f+","+b[F];if(null!=z[l])f=l;else{c(z[f]);if(4096>u)z[l]=u,u++,u>x&&12>q&&(q++,x=1<<q);else{c(m);z={};for(u=0;u<m;u++)z[String(u)]=u;q=k+1;u=g+1;x=1<<q}f=String(b[F])}}c(z[f]);c(g);0<H&&D.push(J&255);
+GifEncoder.findClosest=function(b,k,m,g,q){for(var u=Infinity,x=0,z=0;z<b.length;z++)if(z!==q){var F=k-b[z][0],I=m-b[z][1],H=g-b[z][2];F=F*F+I*I+H*H;F<u&&(u=F,x=z)}return x};
+GifEncoder.lzwEncode=function(b,k){for(var m=1<<k,g=m+1,q=k+1,u=g+1,x=1<<q,z={},F=0;F<m;F++)z[String(F)]=F;var I=0,H=0,D=[],c=function(n){I|=n<<H;for(H+=q;8<=H;)D.push(I&255),I>>=8,H-=8};c(m);if(0==b.length)return c(g),0<H&&D.push(I&255),new Uint8Array(D);var f=String(b[0]);for(F=1;F<b.length;F++){var l=f+","+b[F];if(null!=z[l])f=l;else{c(z[f]);if(4096>u)z[l]=u,u++,u>x&&12>q&&(q++,x=1<<q);else{c(m);z={};for(u=0;u<m;u++)z[String(u)]=u;q=k+1;u=g+1;x=1<<q}f=String(b[F])}}c(z[f]);c(g);0<H&&D.push(I&255);
return new Uint8Array(D)};function AnimatedGifExport(b){this.editorUi=b}
-AnimatedGifExport.prototype.doExport=function(b,k,m){var g=this.editorUi.editor.graph,q=this.editorUi.editor;b=b||{};var u=b.fps||15,x=b.scale||1,z=b.border||0,F=b.transparent||!1,J=null!=b.repeat?b.repeat:0,H=F?null:null!=b.background&&b.background!=mxConstants.NONE?b.background:Editor.getDefaultPageBackgroundColor(),D=b.theme||null;try{var c=g.getSvg(H,x,z,!0,null,!0,null,null,null,g.shadowVisible,null,D),f=AnimatedGifExport.findAnimatedPaths(c);if(0==f.length)null!=m&&m(Error(mxResources.get("noAnimationsInDiagram")));
-else{var l=b.duration||AnimatedGifExport.detectDuration(f)||1E3,n=Math.max(2,Math.round(u*l/1E3));AnimatedGifExport.removeAnimationCss(c,f);q.convertImages(c,mxUtils.bind(this,function(r){try{this.renderFrames(r,f,n,u,x,F,J,H,D,k,m)}catch(t){null!=m&&m(t)}}),null,q.createImageUrlConverter())}}catch(r){null!=m&&m(r)}};
-AnimatedGifExport.prototype.renderFrames=function(b,k,m,g,q,u,x,z,F,J,H){var D=parseInt(b.getAttribute("width")),c=parseInt(b.getAttribute("height"));if(isNaN(D)||isNaN(c)||0>=D||0>=c)null!=H&&H(Error("Invalid SVG dimensions"));else{var f=this.editorUi.editor.getMaxCanvasScale(D,c,1);1>f&&(D=Math.ceil(D*f),c=Math.ceil(c*f));var l=new GifEncoder(D,c);l.setDelay(Math.round(1E3/g));l.setRepeat(x);l.setTransparent(u);var n=null;null!=z&&(g=mxUtils.getLightDarkColor(z),n="dark"==F&&"none"!=this.editorUi.editor.graph.getAdaptiveColors()?
-g.dark:g.light);var r=0,t=mxUtils.bind(this,function(){if(r>=m)try{var v=l.finish();J(v)}catch(R){null!=H&&H(R)}else{v=1<m?r/m:0;for(var B=0;B<k.length;B++){var E=k[B];if("alternate"===E.direction||"alternate-reverse"===E.direction){var K=.5>v?2*v:2*(1-v);K="alternate"===E.direction?E.dashSum*(1-K):E.dashSum*K}else K="reverse"===E.direction?E.dashSum*v:E.dashSum*(1-v);E.node.style.strokeDashoffset=K}v=Editor.createSvgDataUri(mxUtils.getXml(b));var C=new Image;C.onload=function(){try{var R=document.createElement("canvas");
+AnimatedGifExport.prototype.doExport=function(b,k,m){var g=this.editorUi.editor.graph,q=this.editorUi.editor;b=b||{};var u=b.fps||15,x=b.scale||1,z=b.border||0,F=b.transparent||!1,I=null!=b.repeat?b.repeat:0,H=F?null:null!=b.background&&b.background!=mxConstants.NONE?b.background:Editor.getDefaultPageBackgroundColor(),D=b.theme||null;try{var c=g.getSvg(H,x,z,!0,null,!0,null,null,null,g.shadowVisible,null,D),f=AnimatedGifExport.findAnimatedPaths(c);if(0==f.length)null!=m&&m(Error(mxResources.get("noAnimationsInDiagram")));
+else{var l=b.duration||AnimatedGifExport.detectDuration(f)||1E3,n=Math.max(2,Math.round(u*l/1E3));AnimatedGifExport.removeAnimationCss(c,f);q.convertImages(c,mxUtils.bind(this,function(r){try{this.renderFrames(r,f,n,u,x,F,I,H,D,k,m)}catch(t){null!=m&&m(t)}}),null,q.createImageUrlConverter())}}catch(r){null!=m&&m(r)}};
+AnimatedGifExport.prototype.renderFrames=function(b,k,m,g,q,u,x,z,F,I,H){var D=parseInt(b.getAttribute("width")),c=parseInt(b.getAttribute("height"));if(isNaN(D)||isNaN(c)||0>=D||0>=c)null!=H&&H(Error("Invalid SVG dimensions"));else{var f=this.editorUi.editor.getMaxCanvasScale(D,c,1);1>f&&(D=Math.ceil(D*f),c=Math.ceil(c*f));var l=new GifEncoder(D,c);l.setDelay(Math.round(1E3/g));l.setRepeat(x);l.setTransparent(u);var n=null;null!=z&&(g=mxUtils.getLightDarkColor(z),n="dark"==F&&"none"!=this.editorUi.editor.graph.getAdaptiveColors()?
+g.dark:g.light);var r=0,t=mxUtils.bind(this,function(){if(r>=m)try{var v=l.finish();I(v)}catch(R){null!=H&&H(R)}else{v=1<m?r/m:0;for(var B=0;B<k.length;B++){var E=k[B];if("alternate"===E.direction||"alternate-reverse"===E.direction){var K=.5>v?2*v:2*(1-v);K="alternate"===E.direction?E.dashSum*(1-K):E.dashSum*K}else K="reverse"===E.direction?E.dashSum*v:E.dashSum*(1-v);E.node.style.strokeDashoffset=K}v=Editor.createSvgDataUri(mxUtils.getXml(b));var C=new Image;C.onload=function(){try{var R=document.createElement("canvas");
R.width=D;R.height=c;var M=R.getContext("2d");null!=n&&(M.fillStyle=n,M.fillRect(0,0,D,c));1>f&&M.scale(f,f);M.drawImage(C,0,0);l.addFrame(R);r++;setTimeout(t,0)}catch(O){null!=H&&H(O)}};C.onerror=function(){null!=H&&H(Error("Failed to render SVG frame"))};C.src=v}});t()}};
AnimatedGifExport.findAnimatedPaths=function(b){var k=[];b=b.getElementsByTagName("path");for(var m=0;m<b.length;m++){var g=b[m],q=g.style.animation||g.getAttribute("style");if(null!=q&&0<=q.indexOf("ge-flow-animation")){var u=parseFloat(g.style.strokeDashoffset);isNaN(u)&&(u=parseFloat(g.getAttribute("stroke-dashoffset")));if(!isNaN(u)&&0<u){var x="normal";"string"===typeof q&&(0<=q.indexOf("alternate-reverse")?x="alternate-reverse":0<=q.indexOf("alternate")?x="alternate":0<=q.indexOf("reverse")&&
(x="reverse"));var z=500;q="string"===typeof q?q.match(/(\d+)ms/):null;null!=q&&(z=parseInt(q[1]));k.push({node:g,dashSum:u,duration:z,direction:x})}}}return k};AnimatedGifExport.detectDuration=function(b){for(var k=0,m=0;m<b.length;m++)b[m].duration>k&&(k=b[m].duration);return k};
@@ -15150,9 +15160,9 @@ DriveFile.prototype.isConflict=function(b){return null!=b&&null!=b.error&&412==b
DriveFile.prototype.getFolderUrl=function(){return null!=this.desc.labels&&this.desc.labels.trashed?"https://drive.google.com/drive/trash":null!=this.desc.parents&&0<this.desc.parents.length?"https://drive.google.com/drive/folders/"+this.desc.parents[0].id:null};
DriveFile.prototype.getPublicUrl=function(b){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions?supportsAllDrives=true"},mxUtils.bind(this,function(k){if(null!=k&&null!=k.items)for(var m=0;m<k.items.length;m++)if("anyoneWithLink"===k.items[m].id||"anyone"===k.items[m].id){b(this.desc.webContentLink);return}b(null)}),mxUtils.bind(this,function(){b(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};
DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.isTrashed=function(){return this.desc.labels.trashed};DriveFile.prototype.save=function(b,k,m,g,q){DrawioFile.prototype.save.apply(this,[b,mxUtils.bind(this,function(){this.saveFile(null,b,k,m,g,q)}),m,g,q])};
-DriveFile.prototype.saveFile=function(b,k,m,g,q,u){b=this.savingFile;try{this.isEditable()?this.savingFile?null!=g&&g({code:App.ERROR_BUSY,message:mxResources.get("busy")}):(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(x,z){var F=mxUtils.bind(this,function(J,H){try{var D=this.desc;null!=this.sync&&this.sync.fileSaving();this.ui.drive.saveFile(this,H,mxUtils.bind(this,function(c,f,l,n){try{this.savingFile=!1,0!=c?(this.setModified(this.getShadowModified()),
+DriveFile.prototype.saveFile=function(b,k,m,g,q,u){b=this.savingFile;try{this.isEditable()?this.savingFile?null!=g&&g({code:App.ERROR_BUSY,message:mxResources.get("busy")}):(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(x,z){var F=mxUtils.bind(this,function(I,H){try{var D=this.desc;null!=this.sync&&this.sync.fileSaving();this.ui.drive.saveFile(this,H,mxUtils.bind(this,function(c,f,l,n){try{this.savingFile=!1,0!=c?(this.setModified(this.getShadowModified()),
k&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=Math.round(Math.min(1E4,Math.max(DriveFile.prototype.autosaveDelay,this.saveDelay))),this.desc=c,this.fileSaved(f,D,mxUtils.bind(this,function(){this.contentChanged();"function"===typeof m&&m(c)}),g,z,l,n)):null!=g&&g(c)}catch(r){if(this.savingFile=!1,null!=g)g(r);else throw r;}}),mxUtils.bind(this,function(c,f){try{this.savingFile=!1,this.isConflict(c)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(f,
-mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();this.setShadowModified(!1);F(J,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=g&&g()}))):null!=g&&g()):null!=g&&g(c)}catch(l){if(this.savingFile=!1,null!=g)g(l);else throw l;}}),q,q,J,null,x)}catch(c){if(this.savingFile=!1,null!=g)g(c);else throw c;}});F(u,k)}))):null!=m&&m()}catch(x){if(b||(this.savingFile=!1),null!=g)g(x);else throw x;}};
+mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();this.setShadowModified(!1);F(I,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=g&&g()}))):null!=g&&g()):null!=g&&g(c)}catch(l){if(this.savingFile=!1,null!=g)g(l);else throw l;}}),q,q,I,null,x)}catch(c){if(this.savingFile=!1,null!=g)g(c);else throw c;}});F(u,k)}))):null!=m&&m()}catch(x){if(b||(this.savingFile=!1),null!=g)g(x);else throw x;}};
DriveFile.prototype.copyFile=function(b,k,m){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,b,k)}catch(g){k(g)}}),k,null!=m?m:this.ui.getCopyFilename(this,!0))};
DriveFile.prototype.makeCopy=function(b,k,m){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(m,mxUtils.bind(this,function(g){null!=this.sync&&(this.sync.stop(),this.sync.channelId=null,this.sync.key=null);this.desc=g;null!=this.sync&&this.sync.start();this.ui.spinner.stop();this.setModified(!1);this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();b()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=k&&k()}))};
DriveFile.prototype.saveAs=function(b,k,m){this.ui.drive.copyFile(this.getId(),b,k,m)};DriveFile.prototype.rename=function(b,k,m){var g=this.getCurrentRevisionId();this.ui.drive.renameFile(this.getId(),b,mxUtils.bind(this,function(q){this.hasSameExtension(b,this.getTitle())?(this.desc=q,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(g),null!=k&&k(q)):(this.desc=q,null!=this.sync&&this.sync.descriptorChanged(g),this.save(!0,k,m))}),m)};
@@ -15166,8 +15176,8 @@ DriveFile.prototype.getDescriptor=function(){return this.desc};DriveFile.prototy
DriveFile.prototype.setDescriptorRevisionId=function(b,k){b.headRevisionId=k};DriveFile.prototype.getDescriptorRevisionId=function(b){return b.headRevisionId};DriveFile.prototype.getDescriptorEtag=function(b){return b.etag};DriveFile.prototype.setDescriptorEtag=function(b,k){b.etag=k};DriveFile.prototype.loadPatchDescriptor=function(b,k){this.ui.drive.executeRequest({url:"/files/"+this.getId()+"?supportsAllDrives=true&fields="+this.ui.drive.catchupFields},mxUtils.bind(this,function(m){b(m)}),k)};
DriveFile.prototype.patchDescriptor=function(b,k){b.headRevisionId=k.headRevisionId;b.modifiedDate=k.modifiedDate;DrawioFile.prototype.patchDescriptor.apply(this,arguments)};DriveFile.prototype.loadDescriptor=function(b,k){this.ui.drive.loadDescriptor(this.getId(),b,k)};DriveFile.prototype.commentsSupported=function(){return!0};DriveFile.prototype.anchoredCommentsSupported=function(){return!0};DriveFile.prototype.mentionsSupported=function(){return!0};DriveFile.prototype.commentFields="id,content,createdTime,modifiedTime,deleted,resolved,anchor,author(displayName,photoLink,me),replies(id,content,createdTime,modifiedTime,deleted,author(displayName,photoLink,me))";
DriveFile.prototype.getCommentUrl=function(b,k){return this.ui.drive.GDriveV3BaseUrl+"/files/"+this.getId()+"/comments"+b+(null!=k?"?fields="+encodeURIComponent(k):"")};DriveFile.prototype.encodeCommentAnchor=function(b){return JSON.stringify({r:"head",a:[{drawio:b}]})};DriveFile.prototype.decodeCommentAnchor=function(b){try{if(null!=b){var k=JSON.parse(b);if(null!=k&&null!=k.a&&0<k.a.length)for(b=0;b<k.a.length;b++)if(null!=k.a[b]&&"object"===typeof k.a[b].drawio&&null!==k.a[b].drawio)return k.a[b].drawio}}catch(m){}return null};
-DriveFile.prototype.getComments=function(b,k){function m(z,F){if(z.deleted)return null;var J=new DriveComment(q,z.id,z.content,z.modifiedTime,z.createdTime,1==z.resolved,null!=z.author&&z.author.me?g:new DrawioUser(null,null,null!=z.author?z.author.displayName:null,null!=z.author?z.author.photoLink:null),F);null==F&&(J.anchor=q.decodeCommentAnchor(z.anchor));for(F=0;null!=z.replies&&F<z.replies.length;F++)J.addReplyDirect(m(z.replies[F],z.id));return J}var g=this.ui.getCurrentUser(),q=this,u=[],x=
-mxUtils.bind(this,function(z){this.ui.drive.executeRequest({fullUrl:this.getCommentUrl("","nextPageToken,comments("+this.commentFields+")")+"&pageSize=100"+(null!=z?"&pageToken="+encodeURIComponent(z):"")},mxUtils.bind(this,function(F){for(var J=null!=F&&null!=F.comments?F.comments:[],H=0;H<J.length;H++){var D=m(J[H]);null!=D&&u.push(D)}null!=F&&null!=F.nextPageToken?x(F.nextPageToken):b(u)}),k)});x(null)};
+DriveFile.prototype.getComments=function(b,k){function m(z,F){if(z.deleted)return null;var I=new DriveComment(q,z.id,z.content,z.modifiedTime,z.createdTime,1==z.resolved,null!=z.author&&z.author.me?g:new DrawioUser(null,null,null!=z.author?z.author.displayName:null,null!=z.author?z.author.photoLink:null),F);null==F&&(I.anchor=q.decodeCommentAnchor(z.anchor));for(F=0;null!=z.replies&&F<z.replies.length;F++)I.addReplyDirect(m(z.replies[F],z.id));return I}var g=this.ui.getCurrentUser(),q=this,u=[],x=
+mxUtils.bind(this,function(z){this.ui.drive.executeRequest({fullUrl:this.getCommentUrl("","nextPageToken,comments("+this.commentFields+")")+"&pageSize=100"+(null!=z?"&pageToken="+encodeURIComponent(z):"")},mxUtils.bind(this,function(F){for(var I=null!=F&&null!=F.comments?F.comments:[],H=0;H<I.length;H++){var D=m(I[H]);null!=D&&u.push(D)}null!=F&&null!=F.nextPageToken?x(F.nextPageToken):b(u)}),k)});x(null)};
DriveFile.prototype.addComment=function(b,k,m){var g={content:b.content};null!=b.anchor&&(g.anchor=this.encodeCommentAnchor(b.anchor));this.ui.drive.executeRequest({fullUrl:this.getCommentUrl("","id"),method:"POST",params:g},mxUtils.bind(this,function(q){k(q.id)}),m)};
DriveFile.prototype.getMentionCandidates=function(b,k){if(null!=this.mentionCandidates)b(this.mentionCandidates);else{var m=[],g=mxUtils.bind(this,function(q){this.ui.drive.executeRequest({fullUrl:this.ui.drive.GDriveV3BaseUrl+"/files/"+this.getId()+"/permissions?supportsAllDrives=true&pageSize=100&fields="+encodeURIComponent("nextPageToken,permissions(type,deleted,emailAddress,displayName,photoLink)")+(null!=q?"&pageToken="+encodeURIComponent(q):"")},mxUtils.bind(this,function(u){for(var x=null!=
u&&null!=u.permissions?u.permissions:[],z=0;z<x.length;z++)if(("user"==x[z].type||"group"==x[z].type)&&!x[z].deleted&&null!=x[z].emailAddress){var F=new DrawioUser(null,x[z].emailAddress,x[z].displayName,x[z].photoLink);F.isGroup="group"==x[z].type;m.push(F)}null!=u&&null!=u.nextPageToken?g(u.nextPageToken):(this.mentionCandidates=m,b(m))}),k)});g(null)}};DriveFile.prototype.canReplyToReplies=function(){return!1};DriveFile.prototype.canComment=function(){return this.desc.canComment};
@@ -15180,57 +15190,57 @@ null;DriveClient.prototype.sameWinAuthMode=!1;DriveClient.prototype.sameWinRedir
function(){return this.user};DriveClient.prototype.getUsersList=function(){var m=[],g=JSON.parse(this.getPersistentToken(!0)),q=null;if(null!=g){null!=g.current&&(q=g.current.userId,m.push(g[q].user),m[0].isCurrent=!0);for(var u in g)"current"!=u&&u!=q&&m.push(g[u].user)}return m};DriveClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&userId="+this.userId+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();
this.setUser(null);b=null};DriveClient.prototype.execute=function(m){var g=mxUtils.bind(this,function(q){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(u,x){this.authorize(!1,mxUtils.bind(this,function(){null!=x&&x();m()}),mxUtils.bind(this,function(z){var F=null!=z.message?z.message:mxResources.get("cannotLogin");null!=z&&null!=z.error&&403==z.error.code&&null!=z.error.data&&0<z.error.data.length&&"domainPolicy"==z.error.data[0].reason&&(F=z.error.message);this.logout();this.ui.showError(mxResources.get("error"),
F,mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/doc/faq/gsuite-authorisation-troubleshoot")}),null,mxResources.get("ok"))}),u)}))});this.authorize(!0,m,g)};DriveClient.prototype.executeRequest=function(m,g,q){try{var u=!0,x=null,z=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var F=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=m;null!=x&&window.clearTimeout(x);x=window.setTimeout(mxUtils.bind(this,
-function(){u=!1;null!=q&&q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:F})}),this.ui.timeout);var J=null,H=!1;"string"===typeof m.params?J=m.params:null!=m.params&&(J=JSON.stringify(m.params),H=!0);var D=m.fullUrl||this.GDriveBaseUrl+m.url;H&&(D+=(0<D.indexOf("?")?"&":"?")+"alt=json");var c=new mxXmlRequest(D,J,m.method||"GET");c.setRequestHeaders=mxUtils.bind(this,function(f,l){if(null!=m.headers)for(var n in m.headers)f.setRequestHeader(n,m.headers[n]);else null!=m.contentType?
+function(){u=!1;null!=q&&q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:F})}),this.ui.timeout);var I=null,H=!1;"string"===typeof m.params?I=m.params:null!=m.params&&(I=JSON.stringify(m.params),H=!0);var D=m.fullUrl||this.GDriveBaseUrl+m.url;H&&(D+=(0<D.indexOf("?")?"&":"?")+"alt=json");var c=new mxXmlRequest(D,I,m.method||"GET");c.setRequestHeaders=mxUtils.bind(this,function(f,l){if(null!=m.headers)for(var n in m.headers)f.setRequestHeader(n,m.headers[n]);else null!=m.contentType?
f.setRequestHeader("Content-Type",m.contentType):H&&f.setRequestHeader("Content-Type","application/json");f.setRequestHeader("Authorization","Bearer "+b)});c.send(mxUtils.bind(this,function(f){try{if(window.clearTimeout(x),u){try{var l=JSON.parse(f.getText())}catch(t){l=null}if(200<=f.getStatus()&&299>=f.getStatus())null!=g&&g(l);else{var n=null!=l&&null!=l.error?null!=l.error.data?l.error.data:l.error.errors:null,r=null!=n&&0<n.length?n[0].reason:null;null==q||null==l||null==l.error||-1!=l.error.code&&
(403!=l.error.code||"domainPolicy"!=r&&"The requested mime type change is forbidden."!=l.error.message)?null!=l&&null!=l.error&&(401==l.error.code||403==l.error.code&&"rateLimitExceeded"!=r)?403==l.error.code&&this.retryAuth||401==l.error.code&&this.retryAuth&&"authError"==r?(null!=q&&q(l),this.retryAuth=!1):(this.retryAuth=!0,this.execute(F)):null!=l&&null!=l.error&&412!=l.error.code&&404!=l.error.code&&400!=l.error.code&&this.currentRequest==m&&z<this.maxRetries?(z++,this.requestThread=window.setTimeout(F,
-Math.round(Math.pow(2,z)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=q&&q(l):q(l)}}}catch(t){if(null!=q)q(t);else throw t;}}))}catch(f){if(null!=q)q(f);else throw f;}});null!=b&&this.authCalled?F():this.execute(F)}catch(J){if(null!=q)q(J);else throw J;}};DriveClient.prototype.createAuthWin=function(m){return window.open(m?m:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};
+Math.round(Math.pow(2,z)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=q&&q(l):q(l)}}}catch(t){if(null!=q)q(t);else throw t;}}))}catch(f){if(null!=q)q(f);else throw f;}});null!=b&&this.authCalled?F():this.execute(F)}catch(I){if(null!=q)q(I);else throw I;}};DriveClient.prototype.createAuthWin=function(m){return window.open(m?m:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};
DriveClient.prototype.authorize=function(m,g,q,u,x){this.isExtAuth&&!m?window.parent.driveAuth(mxUtils.bind(this,function(z){this.updateAuthInfo(z,!0,!0,g,q)}),q):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(z){200<=z.getStatus()&&299>=z.getStatus()?this.authorizeStep2(z.getText(),m,g,q,u,x):null!=q&&q(z)}),q)};DriveClient.prototype.updateAuthInfo=function(m,g,q,u,x){b=m.access_token;delete m.access_token;m.expires=Date.now()+1E3*parseInt(m.expires_in);
m.remember=g;this.resetTokenRefresh(m);this.authCalled=!0;if(q||null==this.user){var z=JSON.stringify(m);this.updateUser(mxUtils.bind(this,function(){var F=JSON.parse(z);this.setPersistentToken(F,!g);null!=u&&u()}),x)}else null!=u&&(this.setPersistentToken(m,!g),u())};DriveClient.prototype.authorizeStep2=function(m,g,q,u,x,z){try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId=this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));if(null==this.userId){var F=
JSON.parse(this.getPersistentToken(!0));F&&null!=F.current&&(this.userId=F.current.userId)}if(g&&null==this.userId)null!=u&&u();else if(g)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+m)+"&userId="+this.userId,null,"GET")).send(mxUtils.bind(this,function(H){try{if(200<=H.getStatus()&&299>=H.getStatus()){var D=JSON.parse(H.getText());this.updateAuthInfo(D,!0,!1,q,u)}else 0!=H.getStatus()&&this.logout(),null!=u&&u(H)}catch(c){if(null!=
-window.console&&console.log("DriveClient.authorizeStep2",c),null!=u)u(c);else throw c;}}),u);else{var J="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(x?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+m+(this.sameWinRedirectUrl?
-"&redirect="+this.sameWinRedirectUrl:""));this.sameWinAuthMode?(window.location.assign(J),z=null):null==z?z=this.createAuthWin(J):z.location=J;null!=z?(window.onGoogleDriveCallback=mxUtils.bind(this,function(H,D){window.onGoogleDriveCallback=null;try{null==H?null!=u&&u({message:mxResources.get("accessDenied")}):this.updateAuthInfo(H,x,!0,q,u)}catch(c){null!=u&&u(c)}finally{null!=D&&D.close()}}),z.focus()):null!=u&&u({message:mxResources.get("allowPopups")})}}catch(H){if(null!=u)u(H);else throw H;
+window.console&&console.log("DriveClient.authorizeStep2",c),null!=u)u(c);else throw c;}}),u);else{var I="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(x?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+m+(this.sameWinRedirectUrl?
+"&redirect="+this.sameWinRedirectUrl:""));this.sameWinAuthMode?(window.location.assign(I),z=null):null==z?z=this.createAuthWin(I):z.location=I;null!=z?(window.onGoogleDriveCallback=mxUtils.bind(this,function(H,D){window.onGoogleDriveCallback=null;try{null==H?null!=u&&u({message:mxResources.get("accessDenied")}):this.updateAuthInfo(H,x,!0,q,u)}catch(c){null!=u&&u(c)}finally{null!=D&&D.close()}}),z.focus()):null!=u&&u({message:mxResources.get("allowPopups")})}}catch(H){if(null!=u)u(H);else throw H;
}};DriveClient.prototype.resetTokenRefresh=function(m){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);null!=m&&null==m.error&&0<m.expires_in&&(this.tokenRefreshInterval=1E3*parseInt(m.expires_in),this.lastTokenRefresh=Date.now(),this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authorize(!0,mxUtils.bind(this,function(){}),mxUtils.bind(this,function(){}))}),900*m.expires_in))};DriveClient.prototype.checkToken=function(m){var g=
0<this.lastTokenRefresh;Date.now()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){m();g&&this.fireEvent(new mxEventObject("disconnected"))})):m()};DriveClient.prototype.updateUser=function(m,g){try{var q={Authorization:"Bearer "+b};this.ui.editor.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json",mxUtils.bind(this,function(u){try{var x=JSON.parse(u);this.executeRequest({url:"/about"},mxUtils.bind(this,function(z){var F=
-mxResources.get("notAvailable"),J=F,H=null;null!=z&&null!=z.user&&(F=z.user.emailAddress,J=z.user.displayName,H=null!=z.user.picture?z.user.picture.url:null);this.setUser(new DrawioUser(x.id,F,J,H,x.locale));this.userId=x.id;null!=m&&m()}),g)}catch(z){null!=g&&g(z)}}),g,null,null,null,null,q)}catch(u){if(null!=g)g(u);else throw u;}};DriveClient.prototype.copyFile=function(m,g,q,u){null!=m&&null!=g&&this.executeRequest({url:"/files/"+m+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true&enforceSingleParent=true",
+mxResources.get("notAvailable"),I=F,H=null;null!=z&&null!=z.user&&(F=z.user.emailAddress,I=z.user.displayName,H=null!=z.user.picture?z.user.picture.url:null);this.setUser(new DrawioUser(x.id,F,I,H,x.locale));this.userId=x.id;null!=m&&m()}),g)}catch(z){null!=g&&g(z)}}),g,null,null,null,null,q)}catch(u){if(null!=g)g(u);else throw u;}};DriveClient.prototype.copyFile=function(m,g,q,u){null!=m&&null!=g&&this.executeRequest({url:"/files/"+m+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true&enforceSingleParent=true",
method:"POST",params:{title:g,properties:[{key:"channel",value:Editor.guid()}]}},q,u)};DriveClient.prototype.renameFile=function(m,g,q,u){null!=m&&null!=g&&this.executeRequest(this.createDriveRequest(m,{title:g}),q,u)};DriveClient.prototype.moveFile=function(m,g,q,u){null!=m&&null!=g&&this.executeRequest(this.createDriveRequest(m,{parents:[{kind:"drive#fileLink",id:g}]}),q,u)};DriveClient.prototype.createDriveRequest=function(m,g){return{url:"/files/"+m+"?uploadType=multipart&supportsAllDrives=true",
method:"PUT",contentType:"application/json; charset=UTF-8",params:g}};DriveClient.prototype.getLibrary=function(m,g,q){return this.getFile(m,g,q,!0,!0)};DriveClient.prototype.loadDescriptor=function(m,g,q,u){this.executeRequest({url:"/files/"+m+"?supportsAllDrives=true&fields="+(null!=u?u:this.allFields)},g,q)};DriveClient.prototype.listFiles=function(m,g,q,u,x){this.executeRequest({url:"/files?supportsAllDrives=true&includeItemsFromAllDrives=true&q="+encodeURIComponent("(mimeType contains '"+this.xmlMimeType+
"') "+(m?" and (title contains '"+m+"')":"")+(g?" and (modifiedDate > '"+g.toISOString()+"')":"")+(q?" and ('me' in owners)":""))+"&orderBy=modifiedDate desc,title"},u,x)};DriveClient.prototype.getCustomProperty=function(m,g){m=m.properties;var q=null;if(null!=m)for(var u=0;u<m.length;u++)if(m[u].key==g){q=m[u].value;break}return q};DriveClient.prototype.getFile=function(m,g,q,u,x){u=null!=u?u:!1;x=null!=x?x:!1;null!=urlParams.rev?this.executeRequest({url:"/files/"+m+"/revisions/"+urlParams.rev+"?supportsAllDrives=true"},
mxUtils.bind(this,function(z){z.title=z.originalFilename;z.headRevisionId=z.id;z.id=m;this.getXmlFile(z,g,q)}),q):this.loadDescriptor(m,mxUtils.bind(this,function(z){try{if(null!=this.user){var F=/\.png$/i.test(z.title);/\.v(dx|sdx?)$/i.test(z.title)||/\.gliffy$/i.test(z.title)||!Editor.useCanvasForExport&&F?this.ui.convertFile(z.downloadUrl,z.title,z.mimeType,this.extension,g,q,null,{Authorization:"Bearer "+b}):u||x||z.mimeType==this.libraryMimeType||z.mimeType==this.xmlMimeType?this.getXmlFile(z,
-g,q,!0,x):this.getXmlFile(z,g,q)}else q({message:mxResources.get("loggedOut")})}catch(J){if(null!=q)q(J);else throw J;}}),q)};DriveClient.prototype.isGoogleRealtimeMimeType=function(m){return null!=m&&"application/vnd.jgraph.mxfile."==m.substring(0,30)};DriveClient.prototype.getXmlFile=function(m,g,q,u,x){try{var z={Authorization:"Bearer "+b},F=m.downloadUrl;if(null==F)null!=q&&q({message:mxResources.get("exportOptionsDisabledDetails")});else{var J=0,H=mxUtils.bind(this,function(){this.ui.editor.loadUrl(F,
+g,q,!0,x):this.getXmlFile(z,g,q)}else q({message:mxResources.get("loggedOut")})}catch(I){if(null!=q)q(I);else throw I;}}),q)};DriveClient.prototype.isGoogleRealtimeMimeType=function(m){return null!=m&&"application/vnd.jgraph.mxfile."==m.substring(0,30)};DriveClient.prototype.getXmlFile=function(m,g,q,u,x){try{var z={Authorization:"Bearer "+b},F=m.downloadUrl;if(null==F)null!=q&&q({message:mxResources.get("exportOptionsDisabledDetails")});else{var I=0,H=mxUtils.bind(this,function(){this.ui.editor.loadUrl(F,
mxUtils.bind(this,function(D){try{if(null==D)q({message:mxResources.get("invalidOrMissingFile")});else if(m.mimeType==this.libraryMimeType||x)m.mimeType!=this.libraryMimeType||x?g(new DriveLibrary(this.ui,D,m)):q({message:mxResources.get("notADiagramFile")});else{var c=!1;if(/\.png$/i.test(m.title)){var f=D.lastIndexOf(",");if(0<f){var l=this.ui.extractGraphModelFromPng(D);if(null!=l&&0<l.length)D=l;else try{l=D.substring(f+1);var n=window.atob?atob(l):Base64.decode(l),r=this.ui.editor.extractGraphModel(mxUtils.parseXml(n).documentElement,
!0);null==r||0<r.getElementsByTagName("parsererror").length?c=!0:D=n}catch(t){c=!0}}}else/\.pdf$/i.test(m.title)?(l=Editor.extractGraphModelFromPdf(D),null!=l&&0<l.length&&(c=!0,D=l)):"data:image/png;base64,PG14ZmlsZS"==D.substring(0,32)&&(n=D.substring(22),D=window.atob&&!mxClient.IS_SF?atob(n):Base64.decode(n));Graph.fileSupport&&this.ui.isGliffyData(D,F)?this.ui.importGliffy(D,mxUtils.bind(this,function(t){try{g(new LocalFile(this.ui,t,m.title+this.extension,!0))}catch(v){if(null!=q)q(v);else throw v;
-}}),mxUtils.bind(this,function(t){null!=q&&q({message:mxResources.get("errorLoadingFile")})}),m.title):g(c?new LocalFile(this.ui,D,m.title,!0):new DriveFile(this.ui,D,m))}}catch(t){if(null!=q)q(t);else throw t;}}),mxUtils.bind(this,function(D,c){if(J<this.maxRetries&&null!=c&&403==c.getStatus())J++,window.setTimeout(H,2*J*this.coolOff*(1+.1*(Math.random()-.5)));else if(null!=q)q(D);else throw D;}),null!=m.mimeType&&"image/"==m.mimeType.substring(0,6)&&"image/svg"!=m.mimeType.substring(0,9)||/\.png$/i.test(m.title)||
-/\.jpe?g$/i.test(m.title)||/\.pdf$/i.test(m.title),null,null,null,z)});H()}}catch(D){if(null!=q)q(D);else throw D;}};DriveClient.prototype.saveFile=function(m,g,q,u,x,z,F,J,H){try{var D=0;m.saveLevel=1;var c=mxUtils.bind(this,function(R){if(null!=u)u(R);else throw R;}),f=mxUtils.bind(this,function(R){c(R);try{EditorUi.logError(R.message,null,null,null,R)}catch(M){}});if(m.isEditable()&&null!=m.desc){var l=Date.now(),n=m.desc.etag,r=m.desc.modifiedDate,t=m.desc.headRevisionId,v=Editor.useCanvasForExport&&
-/(\.png)$/i.test(m.getTitle());z=null!=z?z:!1;var B=null,E=!1,K={mimeType:m.desc.mimeType,title:m.getTitle()};if(this.isGoogleRealtimeMimeType(K.mimeType))K.mimeType=this.xmlMimeType,B=m.desc,E=g=!0;else if("application/octet-stream"==K.mimeType||"1"==urlParams["override-mime"]&&K.mimeType!=this.xmlMimeType)K.mimeType=this.xmlMimeType;var C=mxUtils.bind(this,function(R,M,O){try{m.saveLevel=3;var U=m.getData(),T=null,V=null;m.constructor==DriveFile&&(null==J&&(J=[]),null==m.getChannelId()&&J.push({key:"channel",
-value:Editor.guid(32)}),null==m.getChannelKey()&&J.push({key:"key",value:Editor.guid(32)}),H=null!=H?H:Editor.guid(32),J.push({key:"secret",value:H}),V=this.ui.getPagesForXml(U,!0),T=this.ui.getHashValueForPages(V),J.push({key:"checksum",value:H+":"+T}));O||(null!=R||z||(R=this.placeholderThumbnail,M=this.placeholderMimeType),null!=R&&null!=M&&(K.thumbnail={image:R,mimeType:M}));var fa=mxUtils.bind(this,function(p){try{if(m.saveDelay=Date.now()-l,m.saveLevel=null,q(p,U,V,T),null!=B){this.executeRequest({url:"/files/"+
+}}),mxUtils.bind(this,function(t){null!=q&&q({message:mxResources.get("errorLoadingFile")})}),m.title):g(c?new LocalFile(this.ui,D,m.title,!0):new DriveFile(this.ui,D,m))}}catch(t){if(null!=q)q(t);else throw t;}}),mxUtils.bind(this,function(D,c){if(I<this.maxRetries&&null!=c&&403==c.getStatus())I++,window.setTimeout(H,2*I*this.coolOff*(1+.1*(Math.random()-.5)));else if(null!=q)q(D);else throw D;}),null!=m.mimeType&&"image/"==m.mimeType.substring(0,6)&&"image/svg"!=m.mimeType.substring(0,9)||/\.png$/i.test(m.title)||
+/\.jpe?g$/i.test(m.title)||/\.pdf$/i.test(m.title),null,null,null,z)});H()}}catch(D){if(null!=q)q(D);else throw D;}};DriveClient.prototype.saveFile=function(m,g,q,u,x,z,F,I,H){try{var D=0;m.saveLevel=1;var c=mxUtils.bind(this,function(R){if(null!=u)u(R);else throw R;}),f=mxUtils.bind(this,function(R){c(R);try{EditorUi.logError(R.message,null,null,null,R)}catch(M){}});if(m.isEditable()&&null!=m.desc){var l=Date.now(),n=m.desc.etag,r=m.desc.modifiedDate,t=m.desc.headRevisionId,v=Editor.useCanvasForExport&&
+/(\.png)$/i.test(m.getTitle());z=null!=z?z:!1;var B=null,E=!1,K={mimeType:m.desc.mimeType,title:m.getTitle()};if(this.isGoogleRealtimeMimeType(K.mimeType))K.mimeType=this.xmlMimeType,B=m.desc,E=g=!0;else if("application/octet-stream"==K.mimeType||"1"==urlParams["override-mime"]&&K.mimeType!=this.xmlMimeType)K.mimeType=this.xmlMimeType;var C=mxUtils.bind(this,function(R,M,O){try{m.saveLevel=3;var U=m.getData(),T=null,V=null;m.constructor==DriveFile&&(null==I&&(I=[]),null==m.getChannelId()&&I.push({key:"channel",
+value:Editor.guid(32)}),null==m.getChannelKey()&&I.push({key:"key",value:Editor.guid(32)}),H=null!=H?H:Editor.guid(32),I.push({key:"secret",value:H}),V=this.ui.getPagesForXml(U,!0),T=this.ui.getHashValueForPages(V),I.push({key:"checksum",value:H+":"+T}));O||(null!=R||z||(R=this.placeholderThumbnail,M=this.placeholderMimeType),null!=R&&null!=M&&(K.thumbnail={image:R,mimeType:M}));var fa=mxUtils.bind(this,function(p){try{if(m.saveDelay=Date.now()-l,m.saveLevel=null,q(p,U,V,T),null!=B){this.executeRequest({url:"/files/"+
B.id+"/revisions/"+B.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(A){A.pinned=!0;this.executeRequest({url:"/files/"+B.id+"/revisions/"+B.headRevisionId,method:"PUT",params:A})})));try{EditorUi.logEvent({category:m.convertedFrom+"-CONVERT-FILE-"+m.getHash(),action:"from_"+B.id+"."+B.headRevisionId+"-to_"+m.desc.id+"."+m.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=m.sync?"-client_"+m.sync.clientId:"nosync")})}catch(A){}}}catch(A){f(A)}}),
-y=mxUtils.bind(this,function(p,A){m.saveLevel=4;try{null!=J&&(K.properties=J);var G=F||m.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:m.getCurrentEtag(),I=mxUtils.bind(this,function(Q){m.saveLevel=5;try{var ba=m.desc.mimeType!=this.xmlMimeType&&m.desc.mimeType!=this.mimeType&&m.desc.mimeType!=this.libraryMimeType,X=!0,Y=null;try{Y=window.setTimeout(mxUtils.bind(this,function(){X=!1;c({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(W){}this.executeRequest(this.createUploadRequest(m.getId(),
-K,p,g||Q||ba,A,Q?null:G,E),mxUtils.bind(this,function(W){window.clearTimeout(Y);if(X){var ca=null!=W?(new Date(W.modifiedDate)).getTime()-(new Date(r)).getTime():0;if(0>=ca||n==W.etag||g&&t==W.headRevisionId){var S=[];null==W?S.push("Empty response"):(0>=ca&&S.push("Invalid modified time"),n==W.etag&&S.push("Stale etag"),g&&t==W.headRevisionId&&S.push("Stale revision"),G=W.etag);0==S.length&&S.push(mxResources.get("unknownError"));ca=S.join(", ");if(D<this.staleEtagMaxRetries)D++,S=Math.round(Math.pow(2,
-D)*this.coolOff*(1+.1*(Math.random()-.5))),window.setTimeout(I,S),"1"==urlParams.test&&EditorUi.debug("DriveClient: Invalid response","retry",D,"delay",S,"rev",null!=W?W.headRevisionId:"null","errors",ca);else{m.saveLevel=12;c({message:mxResources.get("error")+": "+ca},W);try{EditorUi.logError("Saving to Google Drive failed",null,"id-"+m.desc.id+"-from-"+t+"."+r+"-"+this.ui.hashValue(n)+"-to-"+W.headRevisionId+"."+W.modifiedDate+"-"+this.ui.hashValue(W.etag)+(0<ca.length?"-errors-"+ca:""),"user-"+
-(null!=this.user?this.user.id:"nouser")+(null!=m.sync?"-client_"+m.sync.clientId:"-nosync")+"-retries-"+D+"-delay-"+(Date.now()-l))}catch(Z){}}}else fa(W)}}),mxUtils.bind(this,function(W){window.clearTimeout(Y);if(X){m.saveLevel=6;try{m.isConflict(W)?this.executeRequest({url:"/files/"+m.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(ca){m.saveLevel=7;try{if(null!=ca&&ca.etag==G)if(D<this.staleEtagMaxRetries){D++;var S=Math.round(2*D*this.coolOff*(1+.1*(Math.random()-
+y=mxUtils.bind(this,function(p,A){m.saveLevel=4;try{null!=I&&(K.properties=I);var G=F||m.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:m.getCurrentEtag(),J=mxUtils.bind(this,function(Q){m.saveLevel=5;try{var ba=m.desc.mimeType!=this.xmlMimeType&&m.desc.mimeType!=this.mimeType&&m.desc.mimeType!=this.libraryMimeType,W=!0,Y=null;try{Y=window.setTimeout(mxUtils.bind(this,function(){W=!1;c({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(X){}this.executeRequest(this.createUploadRequest(m.getId(),
+K,p,g||Q||ba,A,Q?null:G,E),mxUtils.bind(this,function(X){window.clearTimeout(Y);if(W){var ca=null!=X?(new Date(X.modifiedDate)).getTime()-(new Date(r)).getTime():0;if(0>=ca||n==X.etag||g&&t==X.headRevisionId){var S=[];null==X?S.push("Empty response"):(0>=ca&&S.push("Invalid modified time"),n==X.etag&&S.push("Stale etag"),g&&t==X.headRevisionId&&S.push("Stale revision"),G=X.etag);0==S.length&&S.push(mxResources.get("unknownError"));ca=S.join(", ");if(D<this.staleEtagMaxRetries)D++,S=Math.round(Math.pow(2,
+D)*this.coolOff*(1+.1*(Math.random()-.5))),window.setTimeout(J,S),"1"==urlParams.test&&EditorUi.debug("DriveClient: Invalid response","retry",D,"delay",S,"rev",null!=X?X.headRevisionId:"null","errors",ca);else{m.saveLevel=12;c({message:mxResources.get("error")+": "+ca},X);try{EditorUi.logError("Saving to Google Drive failed",null,"id-"+m.desc.id+"-from-"+t+"."+r+"-"+this.ui.hashValue(n)+"-to-"+X.headRevisionId+"."+X.modifiedDate+"-"+this.ui.hashValue(X.etag)+(0<ca.length?"-errors-"+ca:""),"user-"+
+(null!=this.user?this.user.id:"nouser")+(null!=m.sync?"-client_"+m.sync.clientId:"-nosync")+"-retries-"+D+"-delay-"+(Date.now()-l))}catch(Z){}}}else fa(X)}}),mxUtils.bind(this,function(X){window.clearTimeout(Y);if(W){m.saveLevel=6;try{m.isConflict(X)?this.executeRequest({url:"/files/"+m.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(ca){m.saveLevel=7;try{if(null!=ca&&ca.etag==G)if(D<this.staleEtagMaxRetries){D++;var S=Math.round(2*D*this.coolOff*(1+.1*(Math.random()-
.5)));window.setTimeout(L,S);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",D,"delay",S)}else{L(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+m.getHash(),action:"rev_"+m.desc.headRevisionId+"-mod_"+m.desc.modifiedDate+"-size_"+m.getSize()+"-mime_"+m.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(m.isAutosave()?"":"-noauto")+(m.changeListenerEnabled?"":"-nolisten")+(m.inConflictState?"-conflict":"")+(m.invalidChecksum?"-invalid":""),label:(null!=
-this.user?"user_"+this.user.id:"nouser")+(null!=m.sync?"-client_"+m.sync.clientId:"-nosync")})}catch(Z){}}else"1"==urlParams.test&&ca.headRevisionId==t&&EditorUi.debug("DriveClient: Remote Etag Changed","local",G,"remote",ca.etag,"rev",m.desc.headRevisionId,"response",[ca],"file",[m]),c(W,ca)}catch(Z){f(Z)}}),mxUtils.bind(this,function(){c(W)})):c(W)}catch(ca){f(ca)}}}))}catch(W){f(W)}}),L=mxUtils.bind(this,function(Q){m.saveLevel=9;if(Q||null==G)I(Q);else{var ba=!0,X=null;try{X=window.setTimeout(mxUtils.bind(this,
-function(){ba=!1;c({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(Y){}this.executeRequest({url:"/files/"+m.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(Y){window.clearTimeout(X);if(ba){m.saveLevel=10;try{null!=Y&&Y.headRevisionId==t?("1"==urlParams.test&&G!=Y.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",G,"to",Y.etag,"rev",m.desc.headRevisionId,"response",[Y],"file",[m]),G=Y.etag,I(Q)):c({error:{code:412}},Y)}catch(W){f(W)}}}),
-mxUtils.bind(this,function(Y){window.clearTimeout(X);ba&&(m.saveLevel=11,c(Y))}))}});if(v&&null==R){m.saveLevel=8;var P=new Image;P.onload=mxUtils.bind(this,function(){try{var Q=this.thumbnailWidth/P.width,ba=document.createElement("canvas");ba.width=this.thumbnailWidth;ba.height=Math.floor(P.height*Q);ba.getContext("2d").drawImage(P,0,0,ba.width,ba.height);var X=ba.toDataURL();X=X.substring(X.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");K.thumbnail={image:X,mimeType:"image/png"};L(!1)}catch(Y){try{L(!1)}catch(W){f(W)}}});
+this.user?"user_"+this.user.id:"nouser")+(null!=m.sync?"-client_"+m.sync.clientId:"-nosync")})}catch(Z){}}else"1"==urlParams.test&&ca.headRevisionId==t&&EditorUi.debug("DriveClient: Remote Etag Changed","local",G,"remote",ca.etag,"rev",m.desc.headRevisionId,"response",[ca],"file",[m]),c(X,ca)}catch(Z){f(Z)}}),mxUtils.bind(this,function(){c(X)})):c(X)}catch(ca){f(ca)}}}))}catch(X){f(X)}}),L=mxUtils.bind(this,function(Q){m.saveLevel=9;if(Q||null==G)J(Q);else{var ba=!0,W=null;try{W=window.setTimeout(mxUtils.bind(this,
+function(){ba=!1;c({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(Y){}this.executeRequest({url:"/files/"+m.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(Y){window.clearTimeout(W);if(ba){m.saveLevel=10;try{null!=Y&&Y.headRevisionId==t?("1"==urlParams.test&&G!=Y.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",G,"to",Y.etag,"rev",m.desc.headRevisionId,"response",[Y],"file",[m]),G=Y.etag,J(Q)):c({error:{code:412}},Y)}catch(X){f(X)}}}),
+mxUtils.bind(this,function(Y){window.clearTimeout(W);ba&&(m.saveLevel=11,c(Y))}))}});if(v&&null==R){m.saveLevel=8;var P=new Image;P.onload=mxUtils.bind(this,function(){try{var Q=this.thumbnailWidth/P.width,ba=document.createElement("canvas");ba.width=this.thumbnailWidth;ba.height=Math.floor(P.height*Q);ba.getContext("2d").drawImage(P,0,0,ba.width,ba.height);var W=ba.toDataURL();W=W.substring(W.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");K.thumbnail={image:W,mimeType:"image/png"};L(!1)}catch(Y){try{L(!1)}catch(X){f(X)}}});
P.src="data:image/png;base64,"+p}else L(!1)}catch(Q){f(Q)}});if(v){var d=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(p){y(p,!0)}),c,this.ui.getCurrentFile()!=m?U:null,d.scale,d.border)}else y(U,!1)}catch(p){f(p)}});try{m.saveLevel=2,(z||v||m.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=K.mimeType&&"application/vnd.jgraph.mxfile"!=K.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,
function(R){try{var M=null;try{null!=R&&(M=R.toDataURL("image/png")),null!=M&&(M=M.length>this.maxThumbnailSize?null:M.substring(M.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(O){M=null}C(M,"image/png")}catch(O){f(O)}}),20))&&C(null,null,m.constructor!=DriveLibrary)}catch(R){f(R)}}else this.ui.editor.graph.reset(),c({message:mxResources.get("readOnly")})}catch(R){f(R)}};DriveClient.prototype.insertFile=function(m,g,q,u,x,z,F){z=null!=z?z:this.xmlMimeType;m={mimeType:z,title:m};null!=
-q&&(m.parents=[{kind:"drive#fileLink",id:q}]);this.executeRequest(this.createUploadRequest(null,m,g,!1,F),mxUtils.bind(this,function(J){z==this.libraryMimeType?u(new DriveLibrary(this.ui,g,J)):0==J?null!=x&&x({message:mxResources.get("errorSavingFile")}):u(new DriveFile(this.ui,g,J))}),x)};DriveClient.prototype.createUploadRequest=function(m,g,q,u,x,z,F){x=null!=x?x:!1;var J={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=z&&(J["If-Match"]=z);m={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+
-(null!=m?"/"+m:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=m?"PUT":"POST",headers:J,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(g)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=q?x?q:window.btoa?Graph.base64EncodeUnicode(q):Base64.encode(q):"")+"\r\n---------314159265358979323846--"};u||(m.fullUrl+=
+q&&(m.parents=[{kind:"drive#fileLink",id:q}]);this.executeRequest(this.createUploadRequest(null,m,g,!1,F),mxUtils.bind(this,function(I){z==this.libraryMimeType?u(new DriveLibrary(this.ui,g,I)):0==I?null!=x&&x({message:mxResources.get("errorSavingFile")}):u(new DriveFile(this.ui,g,I))}),x)};DriveClient.prototype.createUploadRequest=function(m,g,q,u,x,z,F){x=null!=x?x:!1;var I={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=z&&(I["If-Match"]=z);m={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+
+(null!=m?"/"+m:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=m?"PUT":"POST",headers:I,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(g)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=q?x?q:window.btoa?Graph.base64EncodeUnicode(q):Base64.encode(q):"")+"\r\n---------314159265358979323846--"};u||(m.fullUrl+=
"&newRevision=false");F&&(m.fullUrl+="&pinned=true");return m};DriveClient.prototype.createLinkPicker=function(){var m=k.linkPicker;if(null==m||k.linkPickerToken!=b){k.linkPickerToken=b;m=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0);var g=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),q=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0);m=(new google.picker.PickerBuilder).setAppId(this.appId).setLocale(mxLanguage).setOAuthToken(k.linkPickerToken).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(m).addView(g).addView(q).addView(google.picker.ViewId.RECENTLY_PICKED)}return m};
DriveClient.prototype.pickFile=function(m,g,q){this.filePickerCallback=null!=m?m:mxUtils.bind(this,function(u){this.ui.loadFile("G"+u)});this.filePicked=mxUtils.bind(this,function(u){u.action==google.picker.Action.PICKED&&this.filePickerCallback(u.docs[0].id,u.docs[0])});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var u=g?"genericPicker":"filePicker",x=mxUtils.bind(this,function(c){"picker modal-dialog-bg picker-dialog-bg"==
-mxEvent.getSource(c).className&&(mxEvent.removeListener(document,"click",x),this[u].setVisible(!1),q&&q())});if(null==k[u]||k[u+"Token"]!=b){k[u+"Token"]=b;var z=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),F=(new google.picker.DocsView).setIncludeFolders(!0),J=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),H=(new google.picker.DocsUploadView).setIncludeFolders(!0);g?(z.setMimeTypes("*/*"),F.setMimeTypes("*/*"),J.setMimeTypes("*/*")):
-(z.setMimeTypes(this.mimeTypes),F.setMimeTypes(this.mimeTypes),J.setMimeTypes(this.mimeTypes));k[u]=(new google.picker.PickerBuilder).setOAuthToken(k[u+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(z).addView(F).addView(J).addView(google.picker.ViewId.RECENTLY_PICKED).addView(H);if(urlParams.gPickerSize){var D=urlParams.gPickerSize.split(",");k[u]=k[u].setSize(D[0],D[1])}urlParams.topBaseUrl&&(k[u]=k[u].setOrigin(decodeURIComponent(urlParams.topBaseUrl)));
+mxEvent.getSource(c).className&&(mxEvent.removeListener(document,"click",x),this[u].setVisible(!1),q&&q())});if(null==k[u]||k[u+"Token"]!=b){k[u+"Token"]=b;var z=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),F=(new google.picker.DocsView).setIncludeFolders(!0),I=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),H=(new google.picker.DocsUploadView).setIncludeFolders(!0);g?(z.setMimeTypes("*/*"),F.setMimeTypes("*/*"),I.setMimeTypes("*/*")):
+(z.setMimeTypes(this.mimeTypes),F.setMimeTypes(this.mimeTypes),I.setMimeTypes(this.mimeTypes));k[u]=(new google.picker.PickerBuilder).setOAuthToken(k[u+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(z).addView(F).addView(I).addView(google.picker.ViewId.RECENTLY_PICKED).addView(H);if(urlParams.gPickerSize){var D=urlParams.gPickerSize.split(",");k[u]=k[u].setSize(D[0],D[1])}urlParams.topBaseUrl&&(k[u]=k[u].setOrigin(decodeURIComponent(urlParams.topBaseUrl)));
k[u]=k[u].setCallback(mxUtils.bind(this,function(c){if(c.action==google.picker.Action.PICKED||c.action==google.picker.Action.CANCEL)mxEvent.removeListener(document,"click",x),q&&c.action==google.picker.Action.CANCEL&&q();c.action==google.picker.Action.PICKED&&this.filePicked(c)})).build()}mxEvent.addListener(document,"click",x);k[u].setVisible(!0)}catch(c){this.ui.spinner.stop(),this.ui.handleError(c)}}))};DriveClient.prototype.pickFolder=function(m,g){this.folderPickerCallback=m;var q=mxUtils.bind(this,
function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var u=mxUtils.bind(this,function(H){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(H).className&&(mxEvent.removeListener(document,"click",u),k.folderPicker.setVisible(!1))});if(null==k.folderPicker||k.folderPickerToken!=b){k.folderPickerToken=b;var x=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),
z=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),F=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");k.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(k.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(x).addView(z).addView(F).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder"));
-if(urlParams.gPickerSize){var J=urlParams.gPickerSize.split(",");k.folderPicker=k.folderPicker.setSize(J[0],J[1])}urlParams.topBaseUrl&&(k.folderPicker=k.folderPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));k.folderPicker=k.folderPicker.setCallback(mxUtils.bind(this,function(H){H.action!=google.picker.Action.PICKED&&H.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",u);this.folderPickerCallback(H)})).build()}mxEvent.addListener(document,"click",u);k.folderPicker.setVisible(!0)}catch(H){this.ui.spinner.stop(),
+if(urlParams.gPickerSize){var I=urlParams.gPickerSize.split(",");k.folderPicker=k.folderPicker.setSize(I[0],I[1])}urlParams.topBaseUrl&&(k.folderPicker=k.folderPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));k.folderPicker=k.folderPicker.setCallback(mxUtils.bind(this,function(H){H.action!=google.picker.Action.PICKED&&H.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",u);this.folderPickerCallback(H)})).build()}mxEvent.addListener(document,"click",u);k.folderPicker.setVisible(!0)}catch(H){this.ui.spinner.stop(),
this.ui.handleError(H)}}))}catch(u){this.ui.handleError(u)}});g?q():this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop(),this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",id:"root"}]})}),mxUtils.bind(this,function(){q()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)}catch(u){this.ui.handleError(u)}}))};
-DriveClient.prototype.pickLibrary=function(m){this.filePickerCallback=m;this.filePicked=mxUtils.bind(this,function(g){g.action==google.picker.Action.PICKED?this.filePickerCallback(g.docs[0].id):g.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var g=mxUtils.bind(this,function(J){"picker modal-dialog-bg picker-dialog-bg"==
-mxEvent.getSource(J).className&&(mxEvent.removeListener(document,"click",g),k.libraryPicker.setVisible(!1))});if(null==k.libraryPicker||k.libraryPickerToken!=b){k.libraryPickerToken=b;var q=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),u=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),
+DriveClient.prototype.pickLibrary=function(m){this.filePickerCallback=m;this.filePicked=mxUtils.bind(this,function(g){g.action==google.picker.Action.PICKED?this.filePickerCallback(g.docs[0].id):g.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var g=mxUtils.bind(this,function(I){"picker modal-dialog-bg picker-dialog-bg"==
+mxEvent.getSource(I).className&&(mxEvent.removeListener(document,"click",g),k.libraryPicker.setVisible(!1))});if(null==k.libraryPicker||k.libraryPickerToken!=b){k.libraryPickerToken=b;var q=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),u=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),
x=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),z=(new google.picker.DocsUploadView).setIncludeFolders(!0);k.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(k.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(q).addView(u).addView(x).addView(google.picker.ViewId.RECENTLY_PICKED).addView(z);if(urlParams.gPickerSize){var F=
-urlParams.gPickerSize.split(",");k.libraryPicker=k.libraryPicker.setSize(F[0],F[1])}urlParams.topBaseUrl&&(k.libraryPicker=k.libraryPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));k.libraryPicker=k.libraryPicker.setCallback(mxUtils.bind(this,function(J){J.action!=google.picker.Action.PICKED&&J.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",g);J.action==google.picker.Action.PICKED&&this.filePicked(J)})).build()}mxEvent.addListener(document,"click",g);k.libraryPicker.setVisible(!0)}catch(J){this.ui.spinner.stop(),
-this.ui.handleError(J)}}))};DriveClient.prototype.showPermissions=function(m,g){var q=mxUtils.bind(this,function(){var u=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){var x=null!=g?g.getFolderUrl():"https://drive.google.com/open?id="+m;this.ui.editor.graph.openLink(x)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(u.container,400,150,!0,!0);u.init()});this.sharingFailed?q():this.checkToken(mxUtils.bind(this,
-function(){try{var u=new gapi.drive.share.ShareClient(this.appId);u.setOAuthToken(b);u.setItemIds([m]);u.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(x){for(var z=!1,F=0;F<x.length;F++)for(var J=0;J<x[F].addedNodes.length;J++){var H=x[F].addedNodes[J];"BUTTON"==H.nodeName&&"ok"==H.getAttribute("name")&&null!=H.parentNode&&null!=H.parentNode.parentNode&&
+urlParams.gPickerSize.split(",");k.libraryPicker=k.libraryPicker.setSize(F[0],F[1])}urlParams.topBaseUrl&&(k.libraryPicker=k.libraryPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));k.libraryPicker=k.libraryPicker.setCallback(mxUtils.bind(this,function(I){I.action!=google.picker.Action.PICKED&&I.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",g);I.action==google.picker.Action.PICKED&&this.filePicked(I)})).build()}mxEvent.addListener(document,"click",g);k.libraryPicker.setVisible(!0)}catch(I){this.ui.spinner.stop(),
+this.ui.handleError(I)}}))};DriveClient.prototype.showPermissions=function(m,g){var q=mxUtils.bind(this,function(){var u=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){var x=null!=g?g.getFolderUrl():"https://drive.google.com/open?id="+m;this.ui.editor.graph.openLink(x)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(u.container,400,150,!0,!0);u.init()});this.sharingFailed?q():this.checkToken(mxUtils.bind(this,
+function(){try{var u=new gapi.drive.share.ShareClient(this.appId);u.setOAuthToken(b);u.setItemIds([m]);u.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(x){for(var z=!1,F=0;F<x.length;F++)for(var I=0;I<x[F].addedNodes.length;I++){var H=x[F].addedNodes[I];"BUTTON"==H.nodeName&&"ok"==H.getAttribute("name")&&null!=H.parentNode&&null!=H.parentNode.parentNode&&
"dialog"==H.parentNode.parentNode.getAttribute("role")?(this.sharingFailed=!0,H.click(),q(),z=!0):"DIV"==H.nodeName&&"shr-q-shr-r-shr-xb"==H.className&&(z=!0)}z&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(x){this.ui.handleError(x)}}))};DriveClient.prototype.clearPersistentToken=function(){var m=JSON.parse(this.getPersistentToken(!0))||{};delete m.current;delete m[this.userId];for(var g in m){m.current={userId:g,
expires:0};break}DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(m))};DriveClient.prototype.setPersistentToken=function(m,g){var q=JSON.parse(this.getPersistentToken(!0))||{};m.userId=this.userId;q.current=m;q[this.userId]={user:this.user};DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(q),g)}})();DropboxFile=function(b,k,m){DrawioFile.call(this,b,k);this.stat=m};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.isEditable=function(){return!1};
DropboxFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.ui.editor.isChromelessView()||this.ui.showBanner("DropboxDeprecationFooter","Dropbox support is ending. Click here to move this diagram.",mxUtils.bind(this,function(){this.ui.actions.get("saveAs").funct()}))};DropboxFile.prototype.getTitle=function(){return this.stat.name};DropboxFile.prototype.isRenamable=function(){return!1};DropboxFile.prototype.getSize=function(){return this.stat.size};
@@ -15238,29 +15248,29 @@ DropboxFile.prototype.isRevisionHistorySupported=function(){return!0};DropboxFil
DropboxFile.prototype.getRevisions=function(b,k){var m=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});m.then(mxUtils.bind(this,function(g){try{for(var q=[],u=g.entries.length-1;0<=u;u--)mxUtils.bind(this,function(x){q.push({modifiedDate:x.client_modified,fileSize:x.size,getXml:mxUtils.bind(this,function(z,F){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:x.rev},z,F)}),getUrl:mxUtils.bind(this,function(z){return this.ui.getUrl(window.location.pathname+"?rev="+
x.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=z?"&page="+z:""))+window.location.hash})})})(g.entries[u]);b(q)}catch(x){k(x)}}));m["catch"](function(g){k(g)})};DropboxFile.prototype.getLatestVersion=function(b,k){this.ui.dropbox.getFile(this.getId(),b,k)};DropboxFile.prototype.updateDescriptor=function(b){this.stat=b.stat};DropboxFile.prototype.save=function(b,k,m,g,q){this.doSave(this.getTitle(),b,k,m,g,q)};DropboxFile.prototype.saveAs=function(b,k,m){this.doSave(b,!1,k,m)};
DropboxFile.prototype.doSave=function(b,k,m,g,q,u){var x=this.stat.name;this.stat.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.stat.name=x;this.saveFile(b,k,m,g,q,u)}),g,q,u])};
-DropboxFile.prototype.saveFile=function(b,k,m,g){this.isEditable()?this.savingFile?null!=g&&g({code:App.ERROR_BUSY}):(k=mxUtils.bind(this,function(q){if(q)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var u=mxUtils.bind(this,function(z){var F=this.stat.path_display.lastIndexOf("/");F=1<F?this.stat.path_display.substring(1,F+1):null;this.ui.dropbox.saveFile(b,z,mxUtils.bind(this,function(J){this.setModified(this.getShadowModified());this.savingFile=!1;this.stat=J;this.contentChanged();
-null!=m&&m()}),mxUtils.bind(this,function(J){this.savingFile=!1;null!=g&&g(J)}),F)});if(Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())){var x=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(z){u(this.ui.base64ToBlob(z,"image/png"))}),g,this.ui.getCurrentFile()!=this?this.getData():null,x.scale,x.border)}else u(this.getData())}catch(z){if(this.savingFile=!1,null!=g)g(z);else throw z;}else null!=g&&g()}),this.getTitle()==b?k(!0):this.ui.dropbox.checkExists(b,
+DropboxFile.prototype.saveFile=function(b,k,m,g){this.isEditable()?this.savingFile?null!=g&&g({code:App.ERROR_BUSY}):(k=mxUtils.bind(this,function(q){if(q)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var u=mxUtils.bind(this,function(z){var F=this.stat.path_display.lastIndexOf("/");F=1<F?this.stat.path_display.substring(1,F+1):null;this.ui.dropbox.saveFile(b,z,mxUtils.bind(this,function(I){this.setModified(this.getShadowModified());this.savingFile=!1;this.stat=I;this.contentChanged();
+null!=m&&m()}),mxUtils.bind(this,function(I){this.savingFile=!1;null!=g&&g(I)}),F)});if(Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())){var x=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(z){u(this.ui.base64ToBlob(z,"image/png"))}),g,this.ui.getCurrentFile()!=this?this.getData():null,x.scale,x.border)}else u(this.getData())}catch(z){if(this.savingFile=!1,null!=g)g(z);else throw z;}else null!=g&&g()}),this.getTitle()==b?k(!0):this.ui.dropbox.checkExists(b,
k)):null!=m&&m()};DropboxFile.prototype.rename=function(b,k,m){this.ui.dropbox.renameFile(this,b,mxUtils.bind(this,function(g){this.hasSameExtension(b,this.getTitle())?(this.stat=g,this.descriptorChanged(),null!=k&&k()):(this.stat=g,this.descriptorChanged(),this.save(!0,k,m))}),m)};DropboxLibrary=function(b,k,m){DropboxFile.call(this,b,k,m)};mxUtils.extend(DropboxLibrary,DropboxFile);DropboxLibrary.prototype.isAutosave=function(){return!0};DropboxLibrary.prototype.doSave=function(b,k,m){this.saveFile(b,!1,k,m)};DropboxLibrary.prototype.open=function(){};(function(){var b=null;window.DropboxClient=function(k){DrawioClient.call(this,k,"dbauth");this.client=new Dropbox({clientId:this.clientId})};mxUtils.extend(DropboxClient,DrawioClient);DropboxClient.prototype.appPath="/drawio-diagrams/";DropboxClient.prototype.extension=".drawio";DropboxClient.prototype.writingFile=!1;DropboxClient.prototype.maxRetries=4;DropboxClient.prototype.clientId=window.DRAWIO_DROPBOX_ID;DropboxClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"dropbox";DropboxClient.prototype.logout=
function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();this.setUser(null);b=null;this.client.authTokenRevoke().then(mxUtils.bind(this,function(){this.client.setAccessToken(null)}))};DropboxClient.prototype.updateUser=function(k,m,g){var q=!0,u=window.setTimeout(mxUtils.bind(this,function(){q=!1;m({code:App.ERROR_TIMEOUT})}),this.ui.timeout),x=this.client.usersGetCurrentAccount();
x.then(mxUtils.bind(this,function(z){window.clearTimeout(u);q&&(this.setUser(new DrawioUser(z.account_id,z.email,z.name.display_name)),k())}));x["catch"](mxUtils.bind(this,function(z){window.clearTimeout(u);q&&(null==z||401!==z.status||g?m({message:mxResources.get("accessDenied")}):(this.setUser(null),this.client.setAccessToken(null),b=null,this.authenticate(mxUtils.bind(this,function(){this.updateUser(k,m,!0)}),m)))}))};DropboxClient.prototype.authenticate=function(k,m){(new mxXmlRequest(this.redirectUri+
"?getState=1",null,"GET")).send(mxUtils.bind(this,function(g){200<=g.getStatus()&&299>=g.getStatus()?this.authenticateStep2(g.getText(),k,m):null!=m&&m(g)}),m)};DropboxClient.prototype.authenticateStep2=function(k,m,g){if(null==window.onDropboxCallback){var q=mxUtils.bind(this,function(){var u=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),null,"GET")).send(mxUtils.bind(this,function(x){if(200<=
x.getStatus()&&299>=x.getStatus())try{b=JSON.parse(x.getText()).access_token,this.client.setAccessToken(b),this.setUser(null),m()}catch(z){g({message:mxResources.get("authFailed"),retry:q})}else this.clearPersistentToken(),this.setUser(null),b=null,this.client.setAccessToken(null),401==x.getStatus()?q():g({message:mxResources.get("accessDenied"),retry:q})}),g):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(x,z){null!=window.open("https://www.dropbox.com/oauth2/authorize?client_id="+this.clientId+
-(x?"&token_access_type=offline":"")+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(F,J){if(u){window.onDropboxCallback=null;u=!1;try{null==F?g({message:mxResources.get("accessDenied"),retry:q}):(null!=z&&z(),b=F.access_token,this.client.setAccessToken(b),this.setUser(null),x&&this.setPersistentToken("remembered"),m())}catch(H){g(H)}finally{null!=
-J&&J.close()}}else null!=J&&J.close()}):g({message:mxResources.get("serviceUnavailableOrBlocked"),retry:q})}),mxUtils.bind(this,function(){u&&(window.onDropboxCallback=null,u=!1,g({message:mxResources.get("accessDenied"),retry:q}))}))});q()}else g({code:App.ERROR_BUSY})};DropboxClient.prototype.getErrorMessage=function(k){return null!=k&&null!=k.status?mxResources.get("error")+" "+k.status:mxResources.get("noResponse")};DropboxClient.prototype.executePromise=function(k,m,g){var q=mxUtils.bind(this,
-function(x){var z=!0,F=window.setTimeout(mxUtils.bind(this,function(){z=!1;g({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout),J=k();J.then(mxUtils.bind(this,function(H){window.clearTimeout(F);z&&null!=m&&m(H)}));J["catch"](mxUtils.bind(this,function(H){window.clearTimeout(F);z&&(null==H||500!=H.status&&400!=H.status&&401!=H.status?g({message:this.getErrorMessage(H)}):(this.setUser(null),this.client.setAccessToken(null),b=null,x?g({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,
+(x?"&token_access_type=offline":"")+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(F,I){if(u){window.onDropboxCallback=null;u=!1;try{null==F?g({message:mxResources.get("accessDenied"),retry:q}):(null!=z&&z(),b=F.access_token,this.client.setAccessToken(b),this.setUser(null),x&&this.setPersistentToken("remembered"),m())}catch(H){g(H)}finally{null!=
+I&&I.close()}}else null!=I&&I.close()}):g({message:mxResources.get("serviceUnavailableOrBlocked"),retry:q})}),mxUtils.bind(this,function(){u&&(window.onDropboxCallback=null,u=!1,g({message:mxResources.get("accessDenied"),retry:q}))}))});q()}else g({code:App.ERROR_BUSY})};DropboxClient.prototype.getErrorMessage=function(k){return null!=k&&null!=k.status?mxResources.get("error")+" "+k.status:mxResources.get("noResponse")};DropboxClient.prototype.executePromise=function(k,m,g){var q=mxUtils.bind(this,
+function(x){var z=!0,F=window.setTimeout(mxUtils.bind(this,function(){z=!1;g({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout),I=k();I.then(mxUtils.bind(this,function(H){window.clearTimeout(F);z&&null!=m&&m(H)}));I["catch"](mxUtils.bind(this,function(H){window.clearTimeout(F);z&&(null==H||500!=H.status&&400!=H.status&&401!=H.status?g({message:this.getErrorMessage(H)}):(this.setUser(null),this.client.setAccessToken(null),b=null,x?g({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,
function(){this.authenticate(function(){u(!0)},g)})}):this.authenticate(function(){q(!0)},g)))}))}),u=mxUtils.bind(this,function(x){null==this.user?this.updateUser(function(){u(!0)},g,x):q(x)});null==b?this.authenticate(function(){u(!0)},g):u(!1)};DropboxClient.prototype.getLibrary=function(k,m,g){this.getFile(k,m,g,!0)};DropboxClient.prototype.getFile=function(k,m,g,q){q=null!=q?q:!1;var u=/\.png$/i.test(k);if(/^https:\/\//i.test(k)||/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||
-!Editor.useCanvasForExport&&u){var x=mxUtils.bind(this,function(){var z=k.split("/");this.ui.convertFile(k,0<z.length?z[z.length-1]:k,null,this.extension,m,g)});null!=b?x():this.authenticate(x,g)}else x={path:"/"+k},null!=urlParams.rev&&(x.rev=urlParams.rev),this.readFile(x,mxUtils.bind(this,function(z,F){var J=null;if(0<(u?z.lastIndexOf(","):-1)){var H=this.ui.extractGraphModelFromPng(z);null!=H&&0<H.length?z=H:J=new LocalFile(this,z,k,!0)}m(null!=J?J:q?new DropboxLibrary(this.ui,z,F):new DropboxFile(this.ui,
-z,F))}),g,u)};DropboxClient.prototype.readFile=function(k,m,g,q){var u=mxUtils.bind(this,function(z){var F=!0,J=window.setTimeout(mxUtils.bind(this,function(){F=!1;g({code:App.ERROR_TIMEOUT})}),this.ui.timeout),H=this.client.filesGetMetadata({path:"/"+k.path.substring(1),include_deleted:!1});H.then(mxUtils.bind(this,function(D){}));H["catch"](function(D){window.clearTimeout(J);F&&null!=D&&409==D.status&&(F=!1,g({message:mxResources.get("fileNotFound")}))});H=this.client.filesDownload(k);H.then(mxUtils.bind(this,
-function(D){window.clearTimeout(J);if(F){F=!1;try{var c=new FileReader;c.onload=mxUtils.bind(this,function(f){m(c.result,D)});q?c.readAsDataURL(D.fileBlob):c.readAsText(D.fileBlob)}catch(f){g(f)}}}));H["catch"](mxUtils.bind(this,function(D){window.clearTimeout(J);F&&(F=!1,null==D||500!=D.status&&400!=D.status&&401!=D.status?g({message:this.getErrorMessage(D)}):(this.client.setAccessToken(null),this.setUser(null),b=null,z?g({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){x(!0)},
+!Editor.useCanvasForExport&&u){var x=mxUtils.bind(this,function(){var z=k.split("/");this.ui.convertFile(k,0<z.length?z[z.length-1]:k,null,this.extension,m,g)});null!=b?x():this.authenticate(x,g)}else x={path:"/"+k},null!=urlParams.rev&&(x.rev=urlParams.rev),this.readFile(x,mxUtils.bind(this,function(z,F){var I=null;if(0<(u?z.lastIndexOf(","):-1)){var H=this.ui.extractGraphModelFromPng(z);null!=H&&0<H.length?z=H:I=new LocalFile(this,z,k,!0)}m(null!=I?I:q?new DropboxLibrary(this.ui,z,F):new DropboxFile(this.ui,
+z,F))}),g,u)};DropboxClient.prototype.readFile=function(k,m,g,q){var u=mxUtils.bind(this,function(z){var F=!0,I=window.setTimeout(mxUtils.bind(this,function(){F=!1;g({code:App.ERROR_TIMEOUT})}),this.ui.timeout),H=this.client.filesGetMetadata({path:"/"+k.path.substring(1),include_deleted:!1});H.then(mxUtils.bind(this,function(D){}));H["catch"](function(D){window.clearTimeout(I);F&&null!=D&&409==D.status&&(F=!1,g({message:mxResources.get("fileNotFound")}))});H=this.client.filesDownload(k);H.then(mxUtils.bind(this,
+function(D){window.clearTimeout(I);if(F){F=!1;try{var c=new FileReader;c.onload=mxUtils.bind(this,function(f){m(c.result,D)});q?c.readAsDataURL(D.fileBlob):c.readAsText(D.fileBlob)}catch(f){g(f)}}}));H["catch"](mxUtils.bind(this,function(D){window.clearTimeout(I);F&&(F=!1,null==D||500!=D.status&&400!=D.status&&401!=D.status?g({message:this.getErrorMessage(D)}):(this.client.setAccessToken(null),this.setUser(null),b=null,z?g({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){x(!0)},
g)})}):this.authenticate(function(){u(!0)},g)))}))}),x=mxUtils.bind(this,function(z){null==this.user?this.updateUser(function(){x(!0)},g,z):u(z)});null==b?this.authenticate(function(){x(!0)},g):x(!1)};DropboxClient.prototype.checkExists=function(k,m,g){var q=mxUtils.bind(this,function(){return this.client.filesGetMetadata({path:"/"+k.toLowerCase(),include_deleted:!1})});this.executePromise(q,mxUtils.bind(this,function(u){g?m(!1,!0,u):this.ui.confirm(mxResources.get("replaceIt",[k]),function(){m(!0,
-!0,u)},function(){m(!1,!0,u)})}),function(u){m(!0,!1)})};DropboxClient.prototype.renameFile=function(k,m,g,q){if(/[\\\/:\?\*"\|]/.test(m))q({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=k&&null!=m){var u=k.stat.path_display.substring(1),x=u.lastIndexOf("/");0<x&&(m=u.substring(0,x+1)+m)}null!=k&&null!=m&&k.stat.path_lower.substring(1)!==m.toLowerCase()?this.checkExists(m,mxUtils.bind(this,function(z,F,J){z?(z=mxUtils.bind(this,function(H){H=mxUtils.bind(this,function(){return this.client.filesMove({from_path:k.stat.path_display,
-to_path:"/"+m,autorename:!1})});this.executePromise(H,g,q)}),F&&J.path_lower.substring(1)!==m.toLowerCase()?(F=mxUtils.bind(this,function(){return this.client.filesDelete({path:"/"+m.toLowerCase()})}),this.executePromise(F,z,q)):z()):q()})):q({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(k,m,g,q){this.insertFile(k,m,g,q,!0)};DropboxClient.prototype.insertFile=function(k,m,g,q,u){u=null!=u?u:!1;this.checkExists(k,mxUtils.bind(this,function(x){x?this.saveFile(k,
+!0,u)},function(){m(!1,!0,u)})}),function(u){m(!0,!1)})};DropboxClient.prototype.renameFile=function(k,m,g,q){if(/[\\\/:\?\*"\|]/.test(m))q({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=k&&null!=m){var u=k.stat.path_display.substring(1),x=u.lastIndexOf("/");0<x&&(m=u.substring(0,x+1)+m)}null!=k&&null!=m&&k.stat.path_lower.substring(1)!==m.toLowerCase()?this.checkExists(m,mxUtils.bind(this,function(z,F,I){z?(z=mxUtils.bind(this,function(H){H=mxUtils.bind(this,function(){return this.client.filesMove({from_path:k.stat.path_display,
+to_path:"/"+m,autorename:!1})});this.executePromise(H,g,q)}),F&&I.path_lower.substring(1)!==m.toLowerCase()?(F=mxUtils.bind(this,function(){return this.client.filesDelete({path:"/"+m.toLowerCase()})}),this.executePromise(F,z,q)):z()):q()})):q({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(k,m,g,q){this.insertFile(k,m,g,q,!0)};DropboxClient.prototype.insertFile=function(k,m,g,q,u){u=null!=u?u:!1;this.checkExists(k,mxUtils.bind(this,function(x){x?this.saveFile(k,
m,mxUtils.bind(this,function(z){u?g(new DropboxLibrary(this.ui,m,z)):g(new DropboxFile(this.ui,m,z))}),q):q()}))};DropboxClient.prototype.saveFile=function(k,m,g,q,u){if(/[\\\/:\?\*"\|]/.test(k))q({message:mxResources.get("dropboxCharsNotAllowed")});else if(15E7<=m.length)q({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(m.length)+" / 150 MB)"});else{u=null!=u?u:"";var x=mxUtils.bind(this,function(){return this.client.filesUpload({path:"/"+u+k,mode:{".tag":"overwrite"},mute:!0,
contents:new Blob([m],{type:"text/plain"})})});this.executePromise(x,g,q)}};DropboxClient.prototype.pickLibrary=function(k){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(m){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var g=mxUtils.bind(this,function(x){this.ui.spinner.stop();this.ui.handleError(x)}),q=null!=m[0].link?m[0].link.indexOf(this.appPath):-1;if(0<q){var u=decodeURIComponent(m[0].link.substring(q+this.appPath.length-
1));this.readFile({path:u},mxUtils.bind(this,function(x,z){if(null!=z&&z.id==m[0].id)try{this.ui.spinner.stop(),k(u.substring(1),new DropboxLibrary(this.ui,x,z))}catch(F){this.ui.handleError(F)}else this.createLibrary(m[0],k,g)}),g)}else this.createLibrary(m[0],k,g)}})})};DropboxClient.prototype.createLibrary=function(k,m,g){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[k.name]),mxUtils.bind(this,function(){this.ui.editor.loadUrl(k.link,mxUtils.bind(this,
function(q){this.insertFile(k.name,q,mxUtils.bind(this,function(u){try{this.ui.spinner.stop(),m(u.getHash().substring(1),u)}catch(x){g(x)}}),g,!0)}),g)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))};DropboxClient.prototype.pickFile=function(k,m){null!=Dropbox.choose?(k=null!=k?k:mxUtils.bind(this,function(g,q){this.ui.loadFile(null!=g?"D"+encodeURIComponent(g):q.getHash(),null,q)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(g){if(this.ui.spinner.spin(document.body,
-mxResources.get("loading")))if(m)this.ui.spinner.stop(),k(g[0].link);else{var q=mxUtils.bind(this,function(J){this.ui.spinner.stop();this.ui.handleError(J)}),u=mxUtils.bind(this,function(J,H){this.ui.spinner.stop();k(J,H)}),x=/\.png$/i.test(g[0].name);if(/\.vsdx$/i.test(g[0].name)||/\.gliffy$/i.test(g[0].name)||!Editor.useCanvasForExport&&x)u(g[0].link);else{var z=null!=g[0].link?g[0].link.indexOf(this.appPath):-1;if(0<z){var F=decodeURIComponent(g[0].link.substring(z+this.appPath.length-1));this.readFile({path:F},
-mxUtils.bind(this,function(J,H){if(null!=H&&H.id==g[0].id){var D=x?J.lastIndexOf(","):-1;this.ui.spinner.stop();var c=null;0<D&&(D=this.ui.extractGraphModelFromPng(J),null!=D&&0<D.length?J=D:c=new LocalFile(this,J,F,!0));k(F.substring(1),null!=c?c:new DropboxFile(this.ui,J,H))}else this.createFile(g[0],u,q)}),q,x)}else this.createFile(g[0],u,q)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};DropboxClient.prototype.createFile=function(k,m,g){var q=/(\.png)$/i.test(k.name);
+mxResources.get("loading")))if(m)this.ui.spinner.stop(),k(g[0].link);else{var q=mxUtils.bind(this,function(I){this.ui.spinner.stop();this.ui.handleError(I)}),u=mxUtils.bind(this,function(I,H){this.ui.spinner.stop();k(I,H)}),x=/\.png$/i.test(g[0].name);if(/\.vsdx$/i.test(g[0].name)||/\.gliffy$/i.test(g[0].name)||!Editor.useCanvasForExport&&x)u(g[0].link);else{var z=null!=g[0].link?g[0].link.indexOf(this.appPath):-1;if(0<z){var F=decodeURIComponent(g[0].link.substring(z+this.appPath.length-1));this.readFile({path:F},
+mxUtils.bind(this,function(I,H){if(null!=H&&H.id==g[0].id){var D=x?I.lastIndexOf(","):-1;this.ui.spinner.stop();var c=null;0<D&&(D=this.ui.extractGraphModelFromPng(I),null!=D&&0<D.length?I=D:c=new LocalFile(this,I,F,!0));k(F.substring(1),null!=c?c:new DropboxFile(this.ui,I,H))}else this.createFile(g[0],u,q)}),q,x)}else this.createFile(g[0],u,q)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};DropboxClient.prototype.createFile=function(k,m,g){var q=/(\.png)$/i.test(k.name);
this.ui.editor.loadUrl(k.link,mxUtils.bind(this,function(u){null!=u&&0<u.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[k.name]),mxUtils.bind(this,function(){var x=q?u.lastIndexOf(","):-1;0<x&&(x=this.ui.extractGraphModelFromPng(u.substring(x+1)),null!=x&&0<x.length&&(u=x));this.insertFile(k.name,u,mxUtils.bind(this,function(z){m(k.name,z)}),g)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):(this.ui.spinner.stop(),g({message:mxResources.get("errorLoadingFile")}))}),
g,q)}})();OneDriveFile=function(b,k,m,g){DrawioFile.call(this,b,k);this.meta=m;this.isSP=g};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.autosaveDelay=500;OneDriveFile.prototype.isRealtimeSupported=function(){return!0};
OneDriveFile.prototype.getFileUrl=function(){var b=this.meta.webUrl;b=b.substring(0,b.lastIndexOf("/"));if(null!=this.meta.parentReference)try{if("personal"==this.meta.parentReference.driveType)b="https://onedrive.live.com/?cid="+encodeURIComponent(this.meta.parentReference.driveId)+"&id="+encodeURIComponent(this.meta.id);else if("documentLibrary"==this.meta.parentReference.driveType){var k=this.meta.parentReference.path;k=k.substring(k.indexOf("/root:")+6);var m=this.meta.webUrl;b=m.substring(0,
@@ -15273,9 +15283,9 @@ OneDriveFile.prototype.loadDescriptor=function(b,k){var m=this.isSP?this.ui.m365
OneDriveFile.prototype.setDescriptor=function(b){this.meta=b};OneDriveFile.prototype.getDescriptorEtag=function(b){return b.eTag};OneDriveFile.prototype.setDescriptorEtag=function(b,k){b.eTag=k};OneDriveFile.prototype.loadPatchDescriptor=function(b,k){var m=this.isSP?this.ui.m365:this.ui.oneDrive,g=m.getItemURL(this.getId());m.executeRequest(g+"?select=etag,file",mxUtils.bind(this,function(q){200<=q.getStatus()&&299>=q.getStatus()?b(JSON.parse(q.getText())):k(m.parseRequestText(q))}),k)};
OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(b,k,m,g,q){this.doSave(this.getTitle(),b,k,m,g,q)};OneDriveFile.prototype.saveAs=function(b,k,m){this.doSave(b,!1,k,m)};
OneDriveFile.prototype.doSave=function(b,k,m,g,q,u){var x=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=x;this.saveFile(b,k,m,g,q,u)}),g,q,u])};
-OneDriveFile.prototype.saveFile=function(b,k,m,g,q,u){if(!this.isEditable())null!=m&&m();else if(!this.savingFile)if(this.getTitle()==b){var x=mxUtils.bind(this,function(){try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var z=u||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),F=this.meta;null!=this.sync&&this.sync.fileSaving();(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(J,
-H){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=J;this.fileSaved(H,F,mxUtils.bind(this,function(){this.contentChanged();null!=m&&m()}),g)}),mxUtils.bind(this,function(J,H){try{this.savingFile=!1,this.isConflict(H)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();x()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=
-!1;null!=g&&g()}))):null!=g&&g()):null!=g&&g(J)}catch(D){if(this.savingFile=!1,null!=g)g(D);else throw D;}}),z)}catch(J){if(this.savingFile=!1,null!=g)g(J);else throw J;}});x()}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,(this.isSP?this.ui.m365:this.ui.oneDrive).insertFile(b,this.getData(),mxUtils.bind(this,function(z){this.setModified(this.getShadowModified());this.savingFile=!1;null!=m&&m();this.ui.fileLoaded(z)}),mxUtils.bind(this,function(){this.savingFile=
+OneDriveFile.prototype.saveFile=function(b,k,m,g,q,u){if(!this.isEditable())null!=m&&m();else if(!this.savingFile)if(this.getTitle()==b){var x=mxUtils.bind(this,function(){try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var z=u||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),F=this.meta;null!=this.sync&&this.sync.fileSaving();(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(I,
+H){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=I;this.fileSaved(H,F,mxUtils.bind(this,function(){this.contentChanged();null!=m&&m()}),g)}),mxUtils.bind(this,function(I,H){try{this.savingFile=!1,this.isConflict(H)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();x()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=
+!1;null!=g&&g()}))):null!=g&&g()):null!=g&&g(I)}catch(D){if(this.savingFile=!1,null!=g)g(D);else throw D;}}),z)}catch(I){if(this.savingFile=!1,null!=g)g(I);else throw I;}});x()}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,(this.isSP?this.ui.m365:this.ui.oneDrive).insertFile(b,this.getData(),mxUtils.bind(this,function(z){this.setModified(this.getShadowModified());this.savingFile=!1;null!=m&&m();this.ui.fileLoaded(z)}),mxUtils.bind(this,function(){this.savingFile=
!1;null!=g&&g()}))};OneDriveFile.prototype.rename=function(b,k,m){var g=this.getCurrentRevisionId();(this.isSP?this.ui.m365:this.ui.oneDrive).renameFile(this,b,mxUtils.bind(this,function(q){this.hasSameExtension(b,this.getTitle())?(this.meta=q,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(g),null!=k&&k(q)):(this.meta=q,null!=this.sync&&this.sync.descriptorChanged(g),this.save(!0,k,m))}),m)};
OneDriveFile.prototype.move=function(b,k,m){(this.isSP?this.ui.m365:this.ui.oneDrive).moveFile(this.getId(),b,mxUtils.bind(this,function(g){this.meta=g;this.descriptorChanged();null!=k&&k(g)}),m)};OneDriveLibrary=function(b,k,m,g){OneDriveFile.call(this,b,k,m,g)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(b,k,m){(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(g){this.desc=g;null!=k&&k(g)}),m)};OneDriveLibrary.prototype.open=function(){};(function(){var b=null,k=null,m=null,g=null,q=null,u=null,x=null,z=null;window.OneDriveClient=function(D,c,f,l,n){this.sharepointMode=!0===n;null==c&&null!=window.urlParams&&"1"==window.urlParams.extAuth&&(c=!0);null==f&&(f=null!=window.Editor?Editor.oneDriveInlinePicker:!0);null==l&&null!=window.urlParams&&"1"==window.urlParams.noLogoutOD&&(l=!0);DrawioClient.call(this,D,c?"oneDriveExtAuthInfo":this.sharepointMode?"ms365AuthInfo":"oneDriveAuthInfo");this.isExtAuth=c;this.inlinePicker=f;this.noLogout=
l;D=JSON.parse(this.token);null!=D&&(this.endpointHint=null!=D.endpointHint?D.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):D.endpointHint);this.sharepointMode&&(this.redirectUri=window.DRAWIO_SERVER_URL+"ms365")};mxUtils.extend(OneDriveClient,DrawioClient);OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"95e4b4ed-ed5c-4a05-935b-b411b4562ef2":"24b129a6-117b-4394-bdc8-3b9955e5cdef");OneDriveClient.prototype.clientId="app.diagrams.net"==
@@ -15313,8 +15323,8 @@ R):this.authenticate(function(){v(!0)},r,B,this.sharepointMode))}),mxUtils.bind(
c.error&&(c.error.status=c.status,c.error.code=c.status)}catch(f){}return c};OneDriveClient.prototype.pickLibrary=function(D){this.pickFile(function(c){D(c)})};OneDriveClient.prototype.createInlinePicker=function(D,c,f){return mxUtils.bind(this,function(){var l=null,n=document.createElement("div");n.style.position="relative";var r=new CustomDialog(this.ui,n,mxUtils.bind(this,function(){var t=l.getSelectedItem();if(null!=t)if(c&&"object"==typeof t.folder)D({value:[t]});else{if(!t.folder&&this.ui.spinner.spin(document.body,
mxResources.get("loading"))){var v=OneDriveFile.prototype.getIdOf(t);this.executeRequest(this.getItemURL(v),mxUtils.bind(this,function(B){this.ui.spinner.stop();200<=B.getStatus()&&299>=B.getStatus()?(B=JSON.parse(B.getText()),D(v,{value:[B]})):this.ui.handleError({code:B.getStatus()})}),mxUtils.bind(this,function(B){this.ui.spinner.stop();this.ui.handleError(B)}))}}else return mxResources.get("invalidSel")}),null,mxResources.get(c?"select":"open"),null,null,null,null,!0);this.ui.showDialog(r.container,
550,500,!0,!0);n.style.width=parseInt(r.container.parentNode.style.width)-60+"px";n.style.height=parseInt(r.container.parentNode.style.height)-120+"px";l=new mxODPicker(n,null,mxUtils.bind(this,function(t,v,B,E){this.executeRequest(E?t:this.baseUrl+t,function(K){v(JSON.parse(K.getText()))},B)}),mxUtils.bind(this,function(t,v,B,E){this.executeRequest(this.baseUrl+"/drives/"+v+"/items/"+t,function(K){B(JSON.parse(K.getText()))},E)}),null,null,function(t){c?D({value:[t]}):D(OneDriveFile.prototype.getIdOf(t))},
-mxUtils.bind(this,function(t){this.ui.showError(mxResources.get("error"),t)}),c,null,null,null,null,f)})};var F=function(){null!=z&&(clearInterval(z),z=null);if(null!=x){try{window.removeEventListener("message",x)}catch(D){}x=null}if(null!=q){try{q.close&&q.close()}catch(D){}q=null}if(null!=u)try{u.closed||u.close()}catch(D){}u=null},J=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(D){var c=16*Math.random()|0;return("x"===D?c:c&3|8).toString(16)})};OneDriveClient.prototype.createPickerConfig=
-function(D,c){return{sdk:this.PICKER_SDK_VERSION,entry:{sharePoint:{byPath:{web:c}}},authentication:{},messaging:{origin:location.origin,channelId:J()},typesAndSources:Object.assign({},{mode:D},"files"===D&&{filters:this.FILE_EXTENSIONS},{pivots:{oneDrive:!0,recent:!0,shared:!1,sharedLibraries:!0,myOrganization:!1,site:!0}}),selection:{mode:"single"},theme:Editor.isDarkMode()?"dark":"default"}};OneDriveClient.prototype.setupPickerMessageListener=function(D,c){if(null!=x){try{window.removeEventListener("message",
+mxUtils.bind(this,function(t){this.ui.showError(mxResources.get("error"),t)}),c,null,null,null,null,f)})};var F=function(){null!=z&&(clearInterval(z),z=null);if(null!=x){try{window.removeEventListener("message",x)}catch(D){}x=null}if(null!=q){try{q.close&&q.close()}catch(D){}q=null}if(null!=u)try{u.closed||u.close()}catch(D){}u=null},I=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(D){var c=16*Math.random()|0;return("x"===D?c:c&3|8).toString(16)})};OneDriveClient.prototype.createPickerConfig=
+function(D,c){return{sdk:this.PICKER_SDK_VERSION,entry:{sharePoint:{byPath:{web:c}}},authentication:{},messaging:{origin:location.origin,channelId:I()},typesAndSources:Object.assign({},{mode:D},"files"===D&&{filters:this.FILE_EXTENSIONS},{pivots:{oneDrive:!0,recent:!0,shared:!1,sharedLibraries:!0,myOrganization:!1,site:!0}}),selection:{mode:"single"},theme:Editor.isDarkMode()?"dark":"default"}};OneDriveClient.prototype.setupPickerMessageListener=function(D,c){if(null!=x){try{window.removeEventListener("message",
x)}catch(l){}x=null}var f=function(l){if(l.source&&l.source===u){var n=l.data;"initialize"===n.type&&n.channelId===D&&(q=l.ports[0],q.addEventListener("message",c),q.start(),q.postMessage({type:"activate"}))}};x=f;window.addEventListener("message",f)};var H=function(D,c){var f,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){q.postMessage({type:"acknowledge",id:D.id});f=D.data;try{switch(f.command){case "authenticate":if(l=m)q.postMessage({type:"result",id:D.id,data:{result:"token",
token:l}});else throw Error("Could not get auth token for command: "+JSON.stringify(f));break;case "close":F();break;case "pick":q.postMessage({type:"result",id:D.id,data:{result:"success"}});F();c(f);break;default:console.warn("Unsupported command: "+JSON.stringify(f)),q.postMessage({type:"result",id:D.id,data:{result:"error",error:{code:"unsupportedCommand",message:f.command},isExpected:!0}})}}catch(r){console.error("Error handling picker command:",r),q.postMessage({type:"result",id:D.id,data:{result:"error",
error:{code:"commandError",message:r.message},isExpected:!0}})}n.jumpToEnd()})};OneDriveClient.prototype.handleFolderPickerMessage=function(D){var c,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=D;f=c.data;switch(f.type){case "command":return l.jumpTo(2)}return l.jumpTo(0)}return 4!=l.nextAddress?l.yield(H(f,function(n){g({value:n.items})}),4):l.jumpTo(0)})};OneDriveClient.prototype.handleFilePickerMessage=function(D){var c,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==
@@ -15333,30 +15343,30 @@ GitHubFile.prototype.getFolderUrl=function(){return"https://github.com/"+encodeU
GitHubFile.prototype.getPublicUrl=function(b){if(null!=this.meta.download_url)try{""!=(new URL(this.meta.download_url)).search?b(null):mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(k){b(200<=k.getStatus()&&299>=k.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){b(null)}))}catch(k){b(null)}else b(null)};GitHubFile.prototype.isConflict=function(b){return null!=b&&409==b.status};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};
GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name};GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(b,k){this.peer.getFile(this.getId(),b,k)};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(b){this.meta=b};GitHubFile.prototype.getDescriptorEtag=function(b){return b.sha};
GitHubFile.prototype.setDescriptorEtag=function(b,k){b.sha=k};GitHubFile.prototype.save=function(b,k,m,g,q,u){this.doSave(this.getTitle(),k,m,g,q,u)};GitHubFile.prototype.saveAs=function(b,k,m){this.doSave(b,k,m)};GitHubFile.prototype.doSave=function(b,k,m,g,q,u){var x=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=x;this.saveFile(b,!1,k,m,g,q,u)}),m,g,q])};
-GitHubFile.prototype.saveFile=function(b,k,m,g,q,u,x){if(this.isEditable())if(this.savingFile)null!=g&&g({code:App.ERROR_BUSY});else{var z=mxUtils.bind(this,function(F){if(this.getTitle()==b)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var J=this.getCurrentEtag(),H=this.data;this.peer.saveFile(this,mxUtils.bind(this,function(D){this.setModified(this.getShadowModified());this.savingFile=!1;this.setDescriptorEtag(this.meta,D);this.fileSaved(H,J,mxUtils.bind(this,function(){this.contentChanged();
+GitHubFile.prototype.saveFile=function(b,k,m,g,q,u,x){if(this.isEditable())if(this.savingFile)null!=g&&g({code:App.ERROR_BUSY});else{var z=mxUtils.bind(this,function(F){if(this.getTitle()==b)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var I=this.getCurrentEtag(),H=this.data;this.peer.saveFile(this,mxUtils.bind(this,function(D){this.setModified(this.getShadowModified());this.savingFile=!1;this.setDescriptorEtag(this.meta,D);this.fileSaved(H,I,mxUtils.bind(this,function(){this.contentChanged();
null!=m&&m()}),g)}),mxUtils.bind(this,function(D){this.savingFile=!1;this.isConflict(D)?(this.inConflictState=!0,null!=g&&(D.commitMessage=F,g(D))):null!=g&&g(D)}),u,F)}catch(D){if(this.savingFile=!1,null!=g)g(D);else throw D;}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(D){this.peer.insertFile(b,this.getData(),mxUtils.bind(this,function(c){this.setModified(this.getShadowModified());this.savingFile=!1;
null!=m&&m();this.ui.fileLoaded(c)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=g&&g()}),!1,D,F)}))});null!=x?z(x):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(F){z(F)}),g)}else null!=m&&m()};GitHubLibrary=function(b,k,m){GitHubFile.call(this,b,k,m)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(b,k,m){this.saveFile(b,!1,k,m)};GitHubLibrary.prototype.open=function(){};(function(){var b=null;window.GitHubClient=function(k,m){DrawioClient.call(this,k,m||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"Iv1.1218f5567fbc258a":window.DRAWIO_GITHUB_ID;GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl=DRAWIO_GITHUB_API_URL;GitHubClient.prototype.baseHostUrl=DRAWIO_GITHUB_URL;GitHubClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"github2";GitHubClient.prototype.maxFileSize=
-5E7;GitHubClient.prototype.authToken="token";GitHubClient.prototype.setToken=function(k){b=k};GitHubClient.prototype.updateUser=function(k,m,g){var q=!0,u=window.setTimeout(mxUtils.bind(this,function(){q=!1;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),x=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),z=this.authToken+" "+b;x.setRequestHeaders=function(F,J){F.setRequestHeader("Authorization",z)};x.send(mxUtils.bind(this,function(){window.clearTimeout(u);q&&(401===
+5E7;GitHubClient.prototype.authToken="token";GitHubClient.prototype.setToken=function(k){b=k};GitHubClient.prototype.updateUser=function(k,m,g){var q=!0,u=window.setTimeout(mxUtils.bind(this,function(){q=!1;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),x=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),z=this.authToken+" "+b;x.setRequestHeaders=function(F,I){F.setRequestHeader("Authorization",z)};x.send(mxUtils.bind(this,function(){window.clearTimeout(u);q&&(401===
x.getStatus()?g?m({code:x.getStatus(),message:this.getErrorMessage(x,mxResources.get("accessDenied"))}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(k,m,!0)}),m)):200>x.getStatus()||300<=x.getStatus()?m({message:mxResources.get("accessDenied")}):(this.setUser(this.createUser(JSON.parse(x.getText()))),k()))}),m)};GitHubClient.prototype.createUser=function(k){return new DrawioUser(k.id,k.email,k.name)};GitHubClient.prototype.authenticate=function(k,m){(new mxXmlRequest(this.redirectUri+
"?getState=1",null,"GET")).send(mxUtils.bind(this,function(g){200<=g.getStatus()&&299>=g.getStatus()?this.authenticateStep2(g.getText(),k,m):null!=m&&m(g)}),m)};GitHubClient.prototype.authenticateStep2=function(k,m,g){if(null==window.onGitHubCallback){var q=mxUtils.bind(this,function(){var u=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),null,"GET")).send(mxUtils.bind(this,function(x){if(200<=
x.getStatus()&&299>=x.getStatus())try{b=JSON.parse(x.getText()).access_token,this.setUser(null),m()}catch(z){g({message:mxResources.get("authFailed"),retry:q})}else this.clearPersistentToken(),this.setUser(null),b=null,401==x.getStatus()?q():g({message:mxResources.get("accessDenied"),retry:q})}),g):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(x,z){null!=window.open(this.baseHostUrl+"/login/oauth/authorize?client_id="+this.clientId+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+
-window.location.host+"&token="+k),"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(F,J){u?(window.onGitHubCallback=null,u=!1,null==F?g({message:mxResources.get("accessDenied"),retry:q}):(null!=z&&z(),b=F.access_token,this.setUser(null),x&&this.setPersistentToken("remembered"),m(),null!=J&&J.close())):null!=J&&J.close()}):g({message:mxResources.get("serviceUnavailableOrBlocked"),retry:q})}),mxUtils.bind(this,function(){u&&(window.onGitHubCallback=null,u=!1,g({message:mxResources.get("accessDenied"),
+window.location.host+"&token="+k),"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(F,I){u?(window.onGitHubCallback=null,u=!1,null==F?g({message:mxResources.get("accessDenied"),retry:q}):(null!=z&&z(),b=F.access_token,this.setUser(null),x&&this.setPersistentToken("remembered"),m(),null!=I&&I.close())):null!=I&&I.close()}):g({message:mxResources.get("serviceUnavailableOrBlocked"),retry:q})}),mxUtils.bind(this,function(){u&&(window.onGitHubCallback=null,u=!1,g({message:mxResources.get("accessDenied"),
retry:q}))}))});q()}else g({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(k,m){try{var g=JSON.parse(k.getText());null!=g&&null!=g.message&&(m=g.message)}catch(q){}return m};GitHubClient.prototype.showAuthorizeDialog=function(k,m){this.ui.showError(mxResources.get("accessDenied"),mxResources.get("authorizationRequired"),mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/blog/single-repository-diagrams")}),k,mxResources.get("authorize"),
-mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")}),mxResources.get("cancel"),m,480,null,!1)};GitHubClient.prototype.executeRequest=function(k,m,g,q,u){var x=mxUtils.bind(this,function(F){var J=!0,H=window.setTimeout(mxUtils.bind(this,function(){J=!1;g({code:App.ERROR_TIMEOUT,retry:z})}),this.ui.timeout),D=this.authToken+" "+b;k.setRequestHeaders=function(c,f){c.setRequestHeader("Authorization",
-D)};k.send(mxUtils.bind(this,function(){window.clearTimeout(H);var c=mxUtils.bind(this,function(){var n=this.ui.spinner.pause();this.showAuthorizeDialog(mxUtils.bind(this,function(){n();z()}),mxUtils.bind(this,function(){this.ui.hideDialog();g({name:"AbortError"})}))});if(J)if(200<=k.getStatus()&&299>=k.getStatus()||q&&404==k.getStatus())m(k);else if(401===k.getStatus())F?g({code:k.getStatus(),message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){z(!0)},
+mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")}),mxResources.get("cancel"),m,480,null,!1)};GitHubClient.prototype.executeRequest=function(k,m,g,q,u){var x=mxUtils.bind(this,function(F){var I=!0,H=window.setTimeout(mxUtils.bind(this,function(){I=!1;g({code:App.ERROR_TIMEOUT,retry:z})}),this.ui.timeout),D=this.authToken+" "+b;k.setRequestHeaders=function(c,f){c.setRequestHeader("Authorization",
+D)};k.send(mxUtils.bind(this,function(){window.clearTimeout(H);var c=mxUtils.bind(this,function(){var n=this.ui.spinner.pause();this.showAuthorizeDialog(mxUtils.bind(this,function(){n();z()}),mxUtils.bind(this,function(){this.ui.hideDialog();g({name:"AbortError"})}))});if(I)if(200<=k.getStatus()&&299>=k.getStatus()||q&&404==k.getStatus())m(k);else if(401===k.getStatus())F?g({code:k.getStatus(),message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){z(!0)},
g)})}):this.authenticate(function(){x(!0)},g);else if(403===k.getStatus()){var f=!1;try{var l=JSON.parse(k.getText());null!=l&&"Resource not accessible by integration"==l.message?c():(null!=l&&null!=l.errors&&0<l.errors.length&&(f="too_large"==l.errors[0].code),g({message:mxResources.get(f?"drawingTooLarge":"forbidden")}))}catch(n){g({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}}else 404===k.getStatus()?u?g({code:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("fileNotFound"))}):
-c():409===k.getStatus()?g({code:k.getStatus(),status:409}):g({code:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("error")+" "+k.getStatus())})}),mxUtils.bind(this,function(c){window.clearTimeout(H);J&&g(c)}))}),z=mxUtils.bind(this,function(F){null==this.user?this.updateUser(function(){z(!0)},g,F):x(F)});null==b?this.authenticate(function(){z(!0)},g):z(!1)};GitHubClient.prototype.getLibrary=function(k,m,g){this.getFile(k,m,g,!0)};GitHubClient.prototype.getSha=function(k,m,g,q,u,x,z){var F=
-"&t="+(new Date).getTime();k=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+g+"?ref="+q+F,null,"HEAD");this.executeRequest(k,mxUtils.bind(this,function(J){try{u(J.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(H){x(H)}}),x,null,z)};GitHubClient.prototype.getFile=function(k,m,g,q,u){q=null!=q?q:!1;var x=k.split("/"),z=x[0],F=x[1],J=x[2];k=x.slice(3,x.length).join("/");x=/\.png$/i.test(k);if(!u&&(/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||!Editor.useCanvasForExport&&
-x))if(null!=b){u=this.baseUrl+"/repos/"+z+"/"+F+"/contents/"+k+"?ref="+J;var H={Authorization:"token "+b};x=k.split("/");this.ui.convertFile(u,0<x.length?x[x.length-1]:k,null,this.extension,m,g,null,H)}else g({message:mxResources.get("accessDenied")});else x="&t="+(new Date).getTime(),k=new mxXmlRequest(this.baseUrl+"/repos/"+z+"/"+F+"/contents/"+k+"?ref="+J+x,null,"GET"),this.executeRequest(k,mxUtils.bind(this,function(D){try{var c=JSON.parse(D.getText());if(""==c.content&&null!=c.git_url){var f=
-new mxXmlRequest(c.git_url,null,"GET");this.executeRequest(f,mxUtils.bind(this,function(l){l=JSON.parse(l.getText());""!=l.content?(c.content=l.content,c.encoding=l.encoding,m(this.createGitHubFile(z,F,J,c,q))):g({message:mxResources.get("errorLoadingFile")})}),g)}else m(this.createGitHubFile(z,F,J,c,q))}catch(l){g(l)}}),g)};GitHubClient.prototype.createGitHubFile=function(k,m,g,q,u){k={org:k,repo:m,ref:g,name:q.name,path:q.path,sha:q.sha,html_url:q.html_url,download_url:q.download_url};m=q.content;
+c():409===k.getStatus()?g({code:k.getStatus(),status:409}):g({code:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("error")+" "+k.getStatus())})}),mxUtils.bind(this,function(c){window.clearTimeout(H);I&&g(c)}))}),z=mxUtils.bind(this,function(F){null==this.user?this.updateUser(function(){z(!0)},g,F):x(F)});null==b?this.authenticate(function(){z(!0)},g):z(!1)};GitHubClient.prototype.getLibrary=function(k,m,g){this.getFile(k,m,g,!0)};GitHubClient.prototype.getSha=function(k,m,g,q,u,x,z){var F=
+"&t="+(new Date).getTime();k=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+g+"?ref="+q+F,null,"HEAD");this.executeRequest(k,mxUtils.bind(this,function(I){try{u(I.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(H){x(H)}}),x,null,z)};GitHubClient.prototype.getFile=function(k,m,g,q,u){q=null!=q?q:!1;var x=k.split("/"),z=x[0],F=x[1],I=x[2];k=x.slice(3,x.length).join("/");x=/\.png$/i.test(k);if(!u&&(/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||!Editor.useCanvasForExport&&
+x))if(null!=b){u=this.baseUrl+"/repos/"+z+"/"+F+"/contents/"+k+"?ref="+I;var H={Authorization:"token "+b};x=k.split("/");this.ui.convertFile(u,0<x.length?x[x.length-1]:k,null,this.extension,m,g,null,H)}else g({message:mxResources.get("accessDenied")});else x="&t="+(new Date).getTime(),k=new mxXmlRequest(this.baseUrl+"/repos/"+z+"/"+F+"/contents/"+k+"?ref="+I+x,null,"GET"),this.executeRequest(k,mxUtils.bind(this,function(D){try{var c=JSON.parse(D.getText());if(""==c.content&&null!=c.git_url){var f=
+new mxXmlRequest(c.git_url,null,"GET");this.executeRequest(f,mxUtils.bind(this,function(l){l=JSON.parse(l.getText());""!=l.content?(c.content=l.content,c.encoding=l.encoding,m(this.createGitHubFile(z,F,I,c,q))):g({message:mxResources.get("errorLoadingFile")})}),g)}else m(this.createGitHubFile(z,F,I,c,q))}catch(l){g(l)}}),g)};GitHubClient.prototype.createGitHubFile=function(k,m,g,q,u){k={org:k,repo:m,ref:g,name:q.name,path:q.path,sha:q.sha,html_url:q.html_url,download_url:q.download_url};m=q.content;
"base64"===q.encoding&&(/\.jpe?g$/i.test(q.name)?m="data:image/jpeg;base64,"+m:/\.gif$/i.test(q.name)?m="data:image/gif;base64,"+m:/\.png$/i.test(q.name)?(q=this.ui.extractGraphModelFromPng(m),m=null!=q&&0<q.length?q:"data:image/png;base64,"+m):m=Base64.decode(m));return u?new GitHubLibrary(this.ui,m,k):new GitHubFile(this.ui,m,k)};GitHubClient.prototype.insertLibrary=function(k,m,g,q,u){this.insertFile(k,m,g,q,!0,u,!1)};GitHubClient.prototype.insertFile=function(k,m,g,q,u,x,z){u=null!=u?u:!1;x=x.split("/");
-var F=x[0],J=x[1],H=x[2],D=x.slice(3,x.length).join("/");0<D.length&&(D+="/");D+=k;this.checkExists(F+"/"+J+"/"+H+"/"+D,!0,mxUtils.bind(this,function(c,f){c?u?(z||(m=Base64.encode(m)),this.showCommitDialog(k,!0,mxUtils.bind(this,function(l){this.writeFile(F,J,H,D,l,m,f,mxUtils.bind(this,function(n){try{var r=JSON.parse(n.getText());g(this.createGitHubFile(F,J,H,r.content,u))}catch(t){q(t)}}),q)}),q)):g(new GitHubFile(this.ui,m,{org:F,repo:J,ref:H,name:k,path:D,sha:f,isNew:!0})):q()}))};GitHubClient.prototype.showCommitDialog=
-function(k,m,g,q){var u=this.ui.spinner.pause();k=new FilenameDialog(this.ui,mxResources.get(m?"addedFile":"updateFile",[k]),mxResources.get("ok"),mxUtils.bind(this,function(x){u(function(){g(x)})}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){q()}));this.ui.showDialog(k.container,400,80,!0,!1);k.init()};GitHubClient.prototype.writeFile=function(k,m,g,q,u,x,z,F,J){x.length>=this.maxFileSize?J({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(x.length)+
-" / 1 MB)"}):(g={path:q,branch:decodeURIComponent(g),message:u,content:x},null!=z&&(g.sha=z),k=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+q,JSON.stringify(g),"PUT"),this.executeRequest(k,mxUtils.bind(this,function(H){F(H)}),mxUtils.bind(this,function(H){404==H.code&&(H.helpLink=this.baseHostUrl+"/settings/connections/applications/"+this.clientId,H.code=null);J(H)})))};GitHubClient.prototype.checkExists=function(k,m,g){var q=k.split("/"),u=q[0],x=q[1],z=q[2];k=q.slice(3,q.length).join("/");
-this.getSha(u,x,k,z,mxUtils.bind(this,function(F){if(m){var J=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[k]),function(){J();g(!0,F)},function(){J();g(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){g(!1)})}),mxUtils.bind(this,function(F){g(!0)}),!0)};GitHubClient.prototype.saveFile=function(k,m,g,q,u){var x=k.meta.org,z=k.meta.repo,F=k.meta.ref,J=k.meta.path,H=mxUtils.bind(this,function(c,
-f){this.writeFile(x,z,F,J,u,f,c,mxUtils.bind(this,function(l){delete k.meta.isNew;m(JSON.parse(l.getText()).content.sha)}),mxUtils.bind(this,function(l){g(l)}))}),D=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(J)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(f){H(k.meta.sha,f)}),g,this.ui.getCurrentFile()!=k?k.getData():null,c.scale,c.border)}else H(k.meta.sha,Base64.encode(k.getData()))});q?this.getSha(x,z,J,
+var F=x[0],I=x[1],H=x[2],D=x.slice(3,x.length).join("/");0<D.length&&(D+="/");D+=k;this.checkExists(F+"/"+I+"/"+H+"/"+D,!0,mxUtils.bind(this,function(c,f){c?u?(z||(m=Base64.encode(m)),this.showCommitDialog(k,!0,mxUtils.bind(this,function(l){this.writeFile(F,I,H,D,l,m,f,mxUtils.bind(this,function(n){try{var r=JSON.parse(n.getText());g(this.createGitHubFile(F,I,H,r.content,u))}catch(t){q(t)}}),q)}),q)):g(new GitHubFile(this.ui,m,{org:F,repo:I,ref:H,name:k,path:D,sha:f,isNew:!0})):q()}))};GitHubClient.prototype.showCommitDialog=
+function(k,m,g,q){var u=this.ui.spinner.pause();k=new FilenameDialog(this.ui,mxResources.get(m?"addedFile":"updateFile",[k]),mxResources.get("ok"),mxUtils.bind(this,function(x){u(function(){g(x)})}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){q()}));this.ui.showDialog(k.container,400,80,!0,!1);k.init()};GitHubClient.prototype.writeFile=function(k,m,g,q,u,x,z,F,I){x.length>=this.maxFileSize?I({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(x.length)+
+" / 1 MB)"}):(g={path:q,branch:decodeURIComponent(g),message:u,content:x},null!=z&&(g.sha=z),k=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+q,JSON.stringify(g),"PUT"),this.executeRequest(k,mxUtils.bind(this,function(H){F(H)}),mxUtils.bind(this,function(H){404==H.code&&(H.helpLink=this.baseHostUrl+"/settings/connections/applications/"+this.clientId,H.code=null);I(H)})))};GitHubClient.prototype.checkExists=function(k,m,g){var q=k.split("/"),u=q[0],x=q[1],z=q[2];k=q.slice(3,q.length).join("/");
+this.getSha(u,x,k,z,mxUtils.bind(this,function(F){if(m){var I=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[k]),function(){I();g(!0,F)},function(){I();g(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){g(!1)})}),mxUtils.bind(this,function(F){g(!0)}),!0)};GitHubClient.prototype.saveFile=function(k,m,g,q,u){var x=k.meta.org,z=k.meta.repo,F=k.meta.ref,I=k.meta.path,H=mxUtils.bind(this,function(c,
+f){this.writeFile(x,z,F,I,u,f,c,mxUtils.bind(this,function(l){delete k.meta.isNew;m(JSON.parse(l.getText()).content.sha)}),mxUtils.bind(this,function(l){g(l)}))}),D=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(I)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(f){H(k.meta.sha,f)}),g,this.ui.getCurrentFile()!=k?k.getData():null,c.scale,c.border)}else H(k.meta.sha,Base64.encode(k.getData()))});q?this.getSha(x,z,I,
F,mxUtils.bind(this,function(c){k.meta.sha=c;D()}),g):D()};GitHubClient.prototype.pickLibrary=function(k){this.pickFile(k)};GitHubClient.prototype.pickFolder=function(k){this.showGitHubDialog(!1,k,!0)};GitHubClient.prototype.pickFile=function(k){k=null!=k?k:mxUtils.bind(this,function(m){this.ui.loadFile("H"+encodeURIComponent(m))});this.showGitHubDialog(!0,k)};GitHubClient.prototype.showGitHubDialog=function(k,m,g){var q=null,u=null,x=null,z=null,F=document.createElement("div");F.style.whiteSpace=
-"nowrap";F.style.overflow="hidden";F.style.height="320px";var J=document.createElement("h3");mxUtils.write(J,mxResources.get(k?"selectFile":"selectFolder"));F.appendChild(J);J=this.ui.createToolbarButton(Editor.refreshImage,mxResources.get("refresh"),mxUtils.bind(this,function(){E()}));J.style.position="absolute";J.style.right="40px";J.style.top="26px";F.appendChild(J);var H=document.createElement("div");H.style.whiteSpace="nowrap";H.style.border="1px solid lightgray";H.style.boxSizing="border-box";
+"nowrap";F.style.overflow="hidden";F.style.height="320px";var I=document.createElement("h3");mxUtils.write(I,mxResources.get(k?"selectFile":"selectFolder"));F.appendChild(I);I=this.ui.createToolbarButton(Editor.refreshImage,mxResources.get("refresh"),mxUtils.bind(this,function(){E()}));I.style.position="absolute";I.style.right="40px";I.style.top="26px";F.appendChild(I);var H=document.createElement("div");H.style.whiteSpace="nowrap";H.style.border="1px solid lightgray";H.style.boxSizing="border-box";
H.style.padding="4px";H.style.overflow="auto";H.style.lineHeight="1.2em";H.style.height="290px";F.appendChild(H);var D=document.createElement("div");D.style.textOverflow="ellipsis";D.style.boxSizing="border-box";D.style.overflow="hidden";D.style.padding="4px";D.style.width="100%";var c=new CustomDialog(this.ui,F,mxUtils.bind(this,function(){m(q+"/"+u+"/"+encodeURIComponent(x)+"/"+z)}),null,null,"https://www.drawio.com/blog/single-repository-diagrams",null,null,null,null,[[mxResources.get("authorize"),
mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")})]],"16px");this.ui.showDialog(c.container,420,370,!0,!0);k&&c.okButton.parentNode.removeChild(c.okButton);var f=mxUtils.bind(this,function(K,C,R,M){var O=document.createElement("a");O.setAttribute("title",K);O.style.cursor="pointer";mxUtils.write(O,K);mxEvent.addListener(O,"click",C);M&&(O.style.textDecoration="underline");null!=
R&&(K=D.cloneNode(),K.style.padding=R,K.appendChild(O),O=K);return O}),l=mxUtils.bind(this,function(K){var C=document.createElement("div");C.style.marginBottom="8px";C.appendChild(f(q+"/"+u,mxUtils.bind(this,function(){z=null;E()}),null,!0));K||(mxUtils.write(C," / "),C.appendChild(f(decodeURIComponent(x),mxUtils.bind(this,function(){z=null;B()}),null,!0)));if(null!=z&&0<z.length){var R=z.split("/");for(K=0;K<R.length;K++)(function(M){mxUtils.write(C," / ");C.appendChild(f(R[M],mxUtils.bind(this,
@@ -15376,44 +15386,44 @@ TrelloFile.prototype.saveFile=function(b,k,m,g){this.isEditable()?this.savingFil
function(q){this.savingFile=!1;null!=g&&g(q)})):this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(q){this.ui.trello.insertFile(b,this.getData(),mxUtils.bind(this,function(u){this.savingFile=!1;null!=m&&m();this.ui.fileLoaded(u);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(b,k,m,g))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=g&&g()}),!1,q)}))):null!=m&&m()};TrelloLibrary=function(b,k,m){TrelloFile.call(this,b,k,m)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(b,k,m){this.saveFile(b,!1,k,m)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(b){DrawioClient.call(this,b,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e89d109082298ce91f6576f82f458551";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml";
TrelloClient.prototype.authenticate=function(b,k,m){m&&this.logout();m=mxUtils.bind(this,function(g,q){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:g?"never":"1hour",success:function(){localStorage.setItem("drawio_trello_token",localStorage.trello_token);null!=q&&q();b()},error:function(){null!=q&&q();null!=k&&k(mxResources.get("loggedOut"))}})});this.isAuthorized()?m(!0):this.ui.showAuthDialog(this,!0,m)};
TrelloClient.prototype.getLibrary=function(b,k,m){this.getFile(b,k,m,!1,!0)};
-TrelloClient.prototype.getFile=function(b,k,m,g,q){q=null!=q?q:!1;var u=mxUtils.bind(this,function(){var x=b.split(this.SEPARATOR),z=!0,F=window.setTimeout(mxUtils.bind(this,function(){z=!1;m({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout);Trello.cards.get(x[0]+"/attachments/"+x[1],mxUtils.bind(this,function(J){window.clearTimeout(F);if(z){var H=/\.png$/i.test(J.name),D={Authorization:'OAuth oauth_consumer_key="'+Trello.key()+'", oauth_token="'+Trello.token()+'"'};/\.v(dx|sdx?)$/i.test(J.name)||
-/\.gliffy$/i.test(J.name)||!Editor.useCanvasForExport&&H?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(J.url),J.name,J.mimeType,this.extension,k,m,null,D):(z=!0,F=window.setTimeout(mxUtils.bind(this,function(){z=!1;m({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(J.url),mxUtils.bind(this,function(c){window.clearTimeout(F);if(z){J.compoundId=b;if(0<(H?c.lastIndexOf(","):-1)){var f=this.ui.extractGraphModelFromPng(c);null!=f&&0<f.length&&
-(c=f)}q?k(new TrelloLibrary(this.ui,c,J)):k(new TrelloFile(this.ui,c,J))}}),mxUtils.bind(this,function(c,f){window.clearTimeout(F);z&&(401==f.status?this.authenticate(u,m,!0):m())}),H||null!=J.mimeType&&"image/"==J.mimeType.substring(0,6),null,null,null,D))}}),mxUtils.bind(this,function(J){window.clearTimeout(F);z&&(null!=J&&401==J.status?this.authenticate(u,m,!0):m())}))});this.authenticate(u,m)};TrelloClient.prototype.insertLibrary=function(b,k,m,g,q){this.insertFile(b,k,m,g,!0,q)};
-TrelloClient.prototype.insertFile=function(b,k,m,g,q,u){q=null!=q?q:!1;var x=mxUtils.bind(this,function(){var z=mxUtils.bind(this,function(F){this.writeFile(b,F,u,mxUtils.bind(this,function(J){q?m(new TrelloLibrary(this.ui,k,J)):m(new TrelloFile(this.ui,k,J))}),g)});Editor.useCanvasForExport&&/(\.png)$/i.test(b)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(F){z(this.ui.base64ToBlob(F,"image/png"))}),g,k):z(k)});this.authenticate(x,g)};
+TrelloClient.prototype.getFile=function(b,k,m,g,q){q=null!=q?q:!1;var u=mxUtils.bind(this,function(){var x=b.split(this.SEPARATOR),z=!0,F=window.setTimeout(mxUtils.bind(this,function(){z=!1;m({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout);Trello.cards.get(x[0]+"/attachments/"+x[1],mxUtils.bind(this,function(I){window.clearTimeout(F);if(z){var H=/\.png$/i.test(I.name),D={Authorization:'OAuth oauth_consumer_key="'+Trello.key()+'", oauth_token="'+Trello.token()+'"'};/\.v(dx|sdx?)$/i.test(I.name)||
+/\.gliffy$/i.test(I.name)||!Editor.useCanvasForExport&&H?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(I.url),I.name,I.mimeType,this.extension,k,m,null,D):(z=!0,F=window.setTimeout(mxUtils.bind(this,function(){z=!1;m({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(I.url),mxUtils.bind(this,function(c){window.clearTimeout(F);if(z){I.compoundId=b;if(0<(H?c.lastIndexOf(","):-1)){var f=this.ui.extractGraphModelFromPng(c);null!=f&&0<f.length&&
+(c=f)}q?k(new TrelloLibrary(this.ui,c,I)):k(new TrelloFile(this.ui,c,I))}}),mxUtils.bind(this,function(c,f){window.clearTimeout(F);z&&(401==f.status?this.authenticate(u,m,!0):m())}),H||null!=I.mimeType&&"image/"==I.mimeType.substring(0,6),null,null,null,D))}}),mxUtils.bind(this,function(I){window.clearTimeout(F);z&&(null!=I&&401==I.status?this.authenticate(u,m,!0):m())}))});this.authenticate(u,m)};TrelloClient.prototype.insertLibrary=function(b,k,m,g,q){this.insertFile(b,k,m,g,!0,q)};
+TrelloClient.prototype.insertFile=function(b,k,m,g,q,u){q=null!=q?q:!1;var x=mxUtils.bind(this,function(){var z=mxUtils.bind(this,function(F){this.writeFile(b,F,u,mxUtils.bind(this,function(I){q?m(new TrelloLibrary(this.ui,k,I)):m(new TrelloFile(this.ui,k,I))}),g)});Editor.useCanvasForExport&&/(\.png)$/i.test(b)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(F){z(this.ui.base64ToBlob(F,"image/png"))}),g,k):z(k)});this.authenticate(x,g)};
TrelloClient.prototype.saveFile=function(b,k,m){var g=b.meta.compoundId.split(this.SEPARATOR),q=mxUtils.bind(this,function(x){this.writeFile(b.meta.name,x,g[0],function(z){Trello.del("cards/"+g[0]+"/attachments/"+g[1],mxUtils.bind(this,function(){k(z)}),mxUtils.bind(this,function(F){null!=F&&401==F.status?this.authenticate(u,m,!0):m()}))},m)}),u=mxUtils.bind(this,function(){Editor.useCanvasForExport&&/(\.png)$/i.test(b.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(x){q(this.ui.base64ToBlob(x,
"image/png"))}),m,this.ui.getCurrentFile()!=b?b.getData():null):q(b.getData())});this.authenticate(u,m)};
TrelloClient.prototype.writeFile=function(b,k,m,g,q){if(null!=b&&null!=k)if(k.length>=this.maxFileSize)q({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(k.length)+" / 10 MB)"});else{var u=mxUtils.bind(this,function(){var x=!0,z=window.setTimeout(mxUtils.bind(this,function(){x=!1;q({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout),F=new FormData;F.append("key",Trello.key());F.append("token",Trello.token());F.append("file","string"===typeof k?new Blob([k]):k,b);F.append("name",
-b);var J=new XMLHttpRequest;J.responseType="json";J.onreadystatechange=mxUtils.bind(this,function(){if(4===J.readyState&&(window.clearTimeout(z),x))if(200==J.status){var H=J.response;H.compoundId=m+this.SEPARATOR+H.id;g(H)}else 401==J.status?this.authenticate(u,q,!0):q()});J.open("POST",this.baseUrl+"cards/"+m+"/attachments");J.send(F)});this.authenticate(u,q)}else q({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(b){this.pickFile(b)};
+b);var I=new XMLHttpRequest;I.responseType="json";I.onreadystatechange=mxUtils.bind(this,function(){if(4===I.readyState&&(window.clearTimeout(z),x))if(200==I.status){var H=I.response;H.compoundId=m+this.SEPARATOR+H.id;g(H)}else 401==I.status?this.authenticate(u,q,!0):q()});I.open("POST",this.baseUrl+"cards/"+m+"/attachments");I.send(F)});this.authenticate(u,q)}else q({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(b){this.pickFile(b)};
TrelloClient.prototype.pickFolder=function(b){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,b)}),mxUtils.bind(this,function(k){this.ui.showError(mxResources.get("error"),k)}))};TrelloClient.prototype.pickFile=function(b,k){b=null!=b?b:mxUtils.bind(this,function(m){this.ui.loadFile("T"+encodeURIComponent(m))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,b)}),mxUtils.bind(this,function(m){this.ui.showError(mxResources.get("error"),m,mxResources.get("ok"))}))};
TrelloClient.prototype.showTrelloDialog=function(b,k){var m=null,g="@me",q=0,u=document.createElement("div");u.style.whiteSpace="nowrap";u.style.overflow="hidden";u.style.height="224px";var x=document.createElement("h3");mxUtils.write(x,b?mxResources.get("selectFile"):mxResources.get("selectCard"));u.appendChild(x);var z=document.createElement("div");z.style.whiteSpace="nowrap";z.style.overflow="auto";z.style.height="194px";u.appendChild(z);u=new CustomDialog(this.ui,u);this.ui.showDialog(u.container,
340,290,!0,!0);u.okButton.parentNode.removeChild(u.okButton);var F=mxUtils.bind(this,function(l,n,r){q++;var t=document.createElement("div");t.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;padding:2px 0 2px 0;background:"+(0==q%2?Editor.isDarkMode()?"#000":"#eee":Editor.isDarkMode()?"":"#fff");var v=document.createElement("a");v.style.cursor="pointer";if(null!=r){var B=document.createElement("img");B.src=r.url;B.width=r.width;B.height=r.height;B.style="border: 1px solid black;margin:5px;vertical-align:middle";
-v.appendChild(B)}mxUtils.write(v,l);mxEvent.addListener(v,"click",n);t.appendChild(v);return t}),J=mxUtils.bind(this,function(l){this.ui.handleError(l,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),H=mxUtils.bind(this,function(){q=0;z.innerText="";this.ui.spinner.spin(z,mxResources.get("loading"));var l=mxUtils.bind(this,function(){Trello.cards.get(m+"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(n){this.ui.spinner.stop();z.appendChild(F("../ [Up]",
-mxUtils.bind(this,function(){f()})));mxUtils.br(z);null==n||0==n.length?mxUtils.write(z,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var r=0;r<n.length;r++)mxUtils.bind(this,function(t){z.appendChild(F(t.name,mxUtils.bind(this,function(){this.ui.hideDialog();k(m+this.SEPARATOR+t.id)}),null!=t.previews?t.previews[0]:null))})(n[r])})()}),mxUtils.bind(this,function(n){401==n.status?this.authenticate(l,J,!0):null!=J&&J(n)}))});l()}),D=null,c=null,f=mxUtils.bind(this,function(l){null==
+v.appendChild(B)}mxUtils.write(v,l);mxEvent.addListener(v,"click",n);t.appendChild(v);return t}),I=mxUtils.bind(this,function(l){this.ui.handleError(l,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),H=mxUtils.bind(this,function(){q=0;z.innerText="";this.ui.spinner.spin(z,mxResources.get("loading"));var l=mxUtils.bind(this,function(){Trello.cards.get(m+"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(n){this.ui.spinner.stop();z.appendChild(F("../ [Up]",
+mxUtils.bind(this,function(){f()})));mxUtils.br(z);null==n||0==n.length?mxUtils.write(z,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var r=0;r<n.length;r++)mxUtils.bind(this,function(t){z.appendChild(F(t.name,mxUtils.bind(this,function(){this.ui.hideDialog();k(m+this.SEPARATOR+t.id)}),null!=t.previews?t.previews[0]:null))})(n[r])})()}),mxUtils.bind(this,function(n){401==n.status?this.authenticate(l,I,!0):null!=I&&I(n)}))});l()}),D=null,c=null,f=mxUtils.bind(this,function(l){null==
l&&(q=0,z.innerText="",l=1);this.ui.spinner.spin(z,mxResources.get("loading"));null!=D&&null!=D.parentNode&&D.parentNode.removeChild(D);D=document.createElement("a");D.style.display="block";D.style.cursor="pointer";mxUtils.write(D,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){mxEvent.removeListener(z,"scroll",c);f(l+1)});mxEvent.addListener(D,"click",n);var r=mxUtils.bind(this,function(){Trello.get("search",{query:""==mxUtils.trim(g)?"is:open":g,cards_limit:100,cards_page:l-1},
mxUtils.bind(this,function(t){this.ui.spinner.stop();t=null!=t?t.cards:null;if(null==t||0==t.length)mxUtils.write(z,mxResources.get("noFiles"));else{1==l&&(z.appendChild(F(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var B=new FilenameDialog(this.ui,g,mxResources.get("ok"),mxUtils.bind(this,function(E){null!=E&&(g=E,f())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");this.ui.showDialog(B.container,300,80,!0,!1);
-B.init()}))),mxUtils.br(z));for(var v=0;v<t.length;v++)mxUtils.bind(this,function(B){z.appendChild(F(B.name,mxUtils.bind(this,function(){b?(m=B.id,H()):(this.ui.hideDialog(),k(B.id))})))})(t[v]);100==t.length&&(z.appendChild(D),c=function(){z.scrollTop>=z.scrollHeight-z.offsetHeight&&n()},mxEvent.addListener(z,"scroll",c))}}),mxUtils.bind(this,function(t){401==t.status?this.authenticate(r,J,!0):null!=J&&J({message:t.responseText})}))});r()});f()};
+B.init()}))),mxUtils.br(z));for(var v=0;v<t.length;v++)mxUtils.bind(this,function(B){z.appendChild(F(B.name,mxUtils.bind(this,function(){b?(m=B.id,H()):(this.ui.hideDialog(),k(B.id))})))})(t[v]);100==t.length&&(z.appendChild(D),c=function(){z.scrollTop>=z.scrollHeight-z.offsetHeight&&n()},mxEvent.addListener(z,"scroll",c))}}),mxUtils.bind(this,function(t){401==t.status?this.authenticate(r,I,!0):null!=I&&I({message:t.responseText})}))});r()});f()};
TrelloClient.prototype.isAuthorized=function(){try{var b=localStorage.trello_token;null==b&&(b=localStorage.drawio_trello_token,null!=b&&localStorage.setItem("trello_token",b));return null!=b}catch(k){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("drawio_trello_token");Trello.deauthorize()};GitLabFile=function(b,k,m){GitHubFile.call(this,b,k,m);this.peer=this.ui.gitLab};mxUtils.extend(GitLabFile,GitHubFile);GitLabFile.prototype.getFileUrl=function(){return this.meta.html_url};GitLabFile.prototype.getFolderUrl=function(){var b=this.getFileUrl();return b.substring(0,b.lastIndexOf("/"))};GitLabFile.prototype.share=function(){this.ui.editor.graph.openLink(DRAWIO_GITLAB_URL+"/"+this.meta.org+"/"+encodeURIComponent(this.meta.repo)+"/-/project_members")};
GitLabFile.prototype.getId=function(){return this.meta.org+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitLabFile.prototype.getHash=function(){return encodeURIComponent("A"+this.getId())};GitLabFile.prototype.isConflict=function(b){return null!=b&&400==b.status};GitLabFile.prototype.getMode=function(){return App.MODE_GITLAB};GitLabFile.prototype.getDescriptorEtag=function(b){return b.last_commit_id};
GitLabFile.prototype.setDescriptorEtag=function(b,k){b.last_commit_id=k};GitLabLibrary=function(b,k,m){GitLabFile.call(this,b,k,m)};mxUtils.extend(GitLabLibrary,GitLabFile);GitLabLibrary.prototype.doSave=function(b,k,m){this.saveFile(b,!1,k,m)};GitLabLibrary.prototype.open=function(){};(function(){var b=null;window.GitLabClient=function(k){GitHubClient.call(this,k,"gitlabauth")};mxUtils.extend(GitLabClient,GitHubClient);GitLabClient.DEFAULT_URL="https://gitlab.com";GitLabClient.prototype.clientId=DRAWIO_GITLAB_ID;GitLabClient.prototype.scope="api%20read_repository%20write_repository";GitLabClient.prototype.baseUrl=DRAWIO_GITLAB_URL+"/api/v4";GitLabClient.prototype.maxFileSize=1E7;GitLabClient.prototype.authToken="Bearer";GitLabClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+
"gitlab";GitLabClient.prototype.authenticate=function(k,m){DRAWIO_GITLAB_URL===GitLabClient.DEFAULT_URL||Editor.enableCustomGitLabUrl?(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(g){200<=g.getStatus()&&299>=g.getStatus()?this.authenticateStep2(g.getText(),k,m):null!=m&&m(g)}),m):(this.ui.showDialog((new CustomGitLabUrlWarningDialog(this.ui,DRAWIO_GITLAB_URL)).container,420,null,!0,!0),null!=m&&m({message:mxResources.get("accessDenied")}))};GitLabClient.prototype.authenticateStep2=
function(k,m,g){if(null==window.onGitLabCallback){var q=mxUtils.bind(this,function(){var u=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),null,"GET")).send(mxUtils.bind(this,function(x){if(200<=x.getStatus()&&299>=x.getStatus())try{b=JSON.parse(x.getText()).access_token,this.setToken(b),this.setUser(null),m()}catch(z){g({message:mxResources.get("authFailed"),retry:q})}else this.clearPersistentToken(),
this.setUser(null),b=null,this.setToken(null),401==x.getStatus()?q():g({message:mxResources.get("accessDenied"),retry:q})}),g):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(x,z){null!=window.open(DRAWIO_GITLAB_URL+"/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),"gitlabauth")?window.onGitLabCallback=mxUtils.bind(this,
-function(F,J){u?(window.onGitLabCallback=null,u=!1,null==F?g({message:mxResources.get("accessDenied"),retry:q}):(null!=z&&z(),b=F.access_token,this.setToken(b),this.setUser(null),x&&this.setPersistentToken("remembered"),m(),null!=J&&J.close())):null!=J&&J.close()}):g({message:mxResources.get("serviceUnavailableOrBlocked"),retry:q})}),mxUtils.bind(this,function(){u&&(window.onGitLabCallback=null,u=!1,g({message:mxResources.get("accessDenied"),retry:q}))}))});q()}else g({code:App.ERROR_BUSY})};GitLabClient.prototype.executeRequest=
-function(k,m,g,q){var u=mxUtils.bind(this,function(z){var F=!0,J=window.setTimeout(mxUtils.bind(this,function(){F=!1;g({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),H=this.authToken+" "+b;k.setRequestHeaders=function(D,c){D.setRequestHeader("Authorization",H);D.setRequestHeader("PRIVATE_TOKEN",H);D.setRequestHeader("Content-Type","application/json")};k.send(mxUtils.bind(this,function(){window.clearTimeout(J);if(F)if(200<=k.getStatus()&&299>=k.getStatus()||q&&404==
+function(F,I){u?(window.onGitLabCallback=null,u=!1,null==F?g({message:mxResources.get("accessDenied"),retry:q}):(null!=z&&z(),b=F.access_token,this.setToken(b),this.setUser(null),x&&this.setPersistentToken("remembered"),m(),null!=I&&I.close())):null!=I&&I.close()}):g({message:mxResources.get("serviceUnavailableOrBlocked"),retry:q})}),mxUtils.bind(this,function(){u&&(window.onGitLabCallback=null,u=!1,g({message:mxResources.get("accessDenied"),retry:q}))}))});q()}else g({code:App.ERROR_BUSY})};GitLabClient.prototype.executeRequest=
+function(k,m,g,q){var u=mxUtils.bind(this,function(z){var F=!0,I=window.setTimeout(mxUtils.bind(this,function(){F=!1;g({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),H=this.authToken+" "+b;k.setRequestHeaders=function(D,c){D.setRequestHeader("Authorization",H);D.setRequestHeader("PRIVATE_TOKEN",H);D.setRequestHeader("Content-Type","application/json")};k.send(mxUtils.bind(this,function(){window.clearTimeout(I);if(F)if(200<=k.getStatus()&&299>=k.getStatus()||q&&404==
k.getStatus())m(k);else if(401===k.getStatus())z?g({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){x(!0)},g)})}):this.authenticate(function(){u(!0)},g);else if(403===k.getStatus()){var D=!1;try{var c=JSON.parse(k.getText());null!=c&&null!=c.errors&&0<c.errors.length&&(D="too_large"==c.errors[0].code)}catch(f){}g({message:mxResources.get(D?"drawingTooLarge":"forbidden")})}else 404===k.getStatus()?g({message:this.getErrorMessage(k,mxResources.get("fileNotFound"))}):
-g({status:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("error")+" "+k.getStatus())})}),mxUtils.bind(this,function(D){window.clearTimeout(J);F&&g(D)}))}),x=mxUtils.bind(this,function(z){null==this.user?this.updateUser(function(){x(!0)},g,z):u(z)});null==b?this.authenticate(function(){x(!0)},g):x(!1)};GitLabClient.prototype.getRefIndex=function(k,m,g,q,u,x){if(null!=u)g(k,u);else{var z=k.length-2,F=mxUtils.bind(this,function(){if(2>z)q({message:mxResources.get("fileNotFound")});else{var J=
-Math.max(z-1,0),H=k.slice(0,J).join("/");J=k[J];var D=k[z],c=k.slice(z+1,k.length).join("/");H=this.baseUrl+"/projects/"+encodeURIComponent(H+"/"+J)+"/repository/"+(m?x?"branches?per_page=1&page=1&ref="+D:"tree?path="+c+"&ref="+D:"files/"+encodeURIComponent(c)+"?ref="+D);var f=new mxXmlRequest(H,null,"HEAD");this.executeRequest(f,mxUtils.bind(this,function(){200==f.getStatus()?g(k,z):q({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==f.getStatus()?(z--,F()):q({message:mxResources.get("fileNotFound")})}))}});
-F()}};GitLabClient.prototype.getFile=function(k,m,g,q,u,x){q=null!=q?q:!1;this.getRefIndex(k.split("/"),!1,mxUtils.bind(this,function(z,F){var J=Math.max(F-1,0),H=z.slice(0,J).join("/"),D=z[J],c=z[F];k=z.slice(F+1,z.length).join("/");z=/\.png$/i.test(k);if(!u&&(/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||!Editor.useCanvasForExport&&z))if(null!=b){J="&t="+(new Date).getTime();var f=this.baseUrl+"/projects/"+encodeURIComponent(H+"/"+D)+"/repository/files/"+encodeURIComponent(k)+
-"?ref="+c;z=k.split("/");this.ui.convertFile(f+J,0<z.length?z[z.length-1]:k,null,this.extension,m,g,mxUtils.bind(this,function(l,n,r){l=new mxXmlRequest(l,null,"GET");this.executeRequest(l,mxUtils.bind(this,function(t){try{n(this.getFileContent(JSON.parse(t.getText())))}catch(v){r(v)}}),r)}))}else g({message:mxResources.get("accessDenied")});else J="&t="+(new Date).getTime(),f=this.baseUrl+"/projects/"+encodeURIComponent(H+"/"+D)+"/repository/files/"+encodeURIComponent(k)+"?ref="+c,z=new mxXmlRequest(f+
-J,null,"GET"),this.executeRequest(z,mxUtils.bind(this,function(l){try{m(this.createGitLabFile(H,D,c,JSON.parse(l.getText()),q,F))}catch(n){g(n)}}),g)}),g,x)};GitLabClient.prototype.getFileContent=function(k){var m=k.file_name,g=k.content;"base64"===k.encoding&&(/\.jpe?g$/i.test(m)?g="data:image/jpeg;base64,"+g:/\.gif$/i.test(m)?g="data:image/gif;base64,"+g:/\.pdf$/i.test(m)?g="data:application/pdf;base64,"+g:/\.png$/i.test(m)?(k=this.ui.extractGraphModelFromPng(g),g=null!=k&&0<k.length?k:"data:image/png;base64,"+
+g({status:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("error")+" "+k.getStatus())})}),mxUtils.bind(this,function(D){window.clearTimeout(I);F&&g(D)}))}),x=mxUtils.bind(this,function(z){null==this.user?this.updateUser(function(){x(!0)},g,z):u(z)});null==b?this.authenticate(function(){x(!0)},g):x(!1)};GitLabClient.prototype.getRefIndex=function(k,m,g,q,u,x){if(null!=u)g(k,u);else{var z=k.length-2,F=mxUtils.bind(this,function(){if(2>z)q({message:mxResources.get("fileNotFound")});else{var I=
+Math.max(z-1,0),H=k.slice(0,I).join("/");I=k[I];var D=k[z],c=k.slice(z+1,k.length).join("/");H=this.baseUrl+"/projects/"+encodeURIComponent(H+"/"+I)+"/repository/"+(m?x?"branches?per_page=1&page=1&ref="+D:"tree?path="+c+"&ref="+D:"files/"+encodeURIComponent(c)+"?ref="+D);var f=new mxXmlRequest(H,null,"HEAD");this.executeRequest(f,mxUtils.bind(this,function(){200==f.getStatus()?g(k,z):q({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==f.getStatus()?(z--,F()):q({message:mxResources.get("fileNotFound")})}))}});
+F()}};GitLabClient.prototype.getFile=function(k,m,g,q,u,x){q=null!=q?q:!1;this.getRefIndex(k.split("/"),!1,mxUtils.bind(this,function(z,F){var I=Math.max(F-1,0),H=z.slice(0,I).join("/"),D=z[I],c=z[F];k=z.slice(F+1,z.length).join("/");z=/\.png$/i.test(k);if(!u&&(/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||!Editor.useCanvasForExport&&z))if(null!=b){I="&t="+(new Date).getTime();var f=this.baseUrl+"/projects/"+encodeURIComponent(H+"/"+D)+"/repository/files/"+encodeURIComponent(k)+
+"?ref="+c;z=k.split("/");this.ui.convertFile(f+I,0<z.length?z[z.length-1]:k,null,this.extension,m,g,mxUtils.bind(this,function(l,n,r){l=new mxXmlRequest(l,null,"GET");this.executeRequest(l,mxUtils.bind(this,function(t){try{n(this.getFileContent(JSON.parse(t.getText())))}catch(v){r(v)}}),r)}))}else g({message:mxResources.get("accessDenied")});else I="&t="+(new Date).getTime(),f=this.baseUrl+"/projects/"+encodeURIComponent(H+"/"+D)+"/repository/files/"+encodeURIComponent(k)+"?ref="+c,z=new mxXmlRequest(f+
+I,null,"GET"),this.executeRequest(z,mxUtils.bind(this,function(l){try{m(this.createGitLabFile(H,D,c,JSON.parse(l.getText()),q,F))}catch(n){g(n)}}),g)}),g,x)};GitLabClient.prototype.getFileContent=function(k){var m=k.file_name,g=k.content;"base64"===k.encoding&&(/\.jpe?g$/i.test(m)?g="data:image/jpeg;base64,"+g:/\.gif$/i.test(m)?g="data:image/gif;base64,"+g:/\.pdf$/i.test(m)?g="data:application/pdf;base64,"+g:/\.png$/i.test(m)?(k=this.ui.extractGraphModelFromPng(g),g=null!=k&&0<k.length?k:"data:image/png;base64,"+
g):g=Base64.decode(g));return g};GitLabClient.prototype.createGitLabFile=function(k,m,g,q,u,x){var z=DRAWIO_GITLAB_URL+"/";k={org:k,repo:m,ref:g,name:q.file_name,path:q.file_path,html_url:z+k+"/"+m+"/blob/"+g+"/"+q.file_path,download_url:z+k+"/"+m+"/raw/"+g+"/"+q.file_path+"?inline=false",last_commit_id:q.last_commit_id,refPos:x};q=this.getFileContent(q);return u?new GitLabLibrary(this.ui,q,k):new GitLabFile(this.ui,q,k)};GitLabClient.prototype.insertFile=function(k,m,g,q,u,x,z){u=null!=u?u:!1;x=
-x.split("/");this.getRefIndex(x,!0,mxUtils.bind(this,function(F,J){var H=Math.max(J-1,0),D=F.slice(0,H).join("/"),c=F[H],f=F[J];path=F.slice(J+1,F.length).join("/");0<path.length&&(path+="/");path+=k;this.checkExists(D+"/"+c+"/"+f+"/"+path,!0,mxUtils.bind(this,function(l,n){l?u?(z||(m=Base64.encode(m)),this.showCommitDialog(k,!0,mxUtils.bind(this,function(r){this.writeFile(D,c,f,path,r,m,n,mxUtils.bind(this,function(t){try{var v=JSON.parse(t.getText());g(this.createGitLabFile(D,c,f,null!=v.content?
-v.content:v,u,J))}catch(B){q(B)}}),q)}),q)):(l=DRAWIO_GITLAB_URL+"/",g(new GitLabFile(this.ui,m,{org:D,repo:c,ref:f,name:k,path:path,html_url:l+D+"/"+c+"/blob/"+f+"/"+path,download_url:l+D+"/"+c+"/raw/"+f+"/"+path+"?inline=false",refPos:J,last_commit_id:n,isNew:!0}))):q()}))}),q,null,4>=x.length)};GitLabClient.prototype.checkExists=function(k,m,g){this.getFile(k,mxUtils.bind(this,function(q){if(m){var u=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[k]),function(){u();g(!0,q.getCurrentEtag())},
-function(){u();g(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){g(!1)})}),mxUtils.bind(this,function(q){g(!0)}),null,!0)};GitLabClient.prototype.writeFile=function(k,m,g,q,u,x,z,F,J){if(x.length>=this.maxFileSize)J({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(x.length)+" / 10 MB)"});else{var H="POST";g={path:encodeURIComponent(q),branch:decodeURIComponent(g),commit_message:u,content:x,
-encoding:"base64"};null!=z&&(g.last_commit_id=z,H="PUT");k=this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+m)+"/repository/files/"+encodeURIComponent(q);H=new mxXmlRequest(k,JSON.stringify(g),H);this.executeRequest(H,mxUtils.bind(this,function(D){F(D)}),J)}};GitLabClient.prototype.saveFile=function(k,m,g,q,u){var x=k.meta.org,z=k.meta.repo,F=k.meta.ref,J=k.meta.path,H=mxUtils.bind(this,function(c,f){this.writeFile(x,z,F,J,u,f,c,mxUtils.bind(this,function(l){delete k.meta.isNew;this.getFile(x+"/"+
-z+"/"+F+"/"+J,mxUtils.bind(this,function(n){n.getData()==k.getData()?m(n.getCurrentEtag()):m({content:k.getCurrentEtag()})}),g,null,null,k.meta.refPos)}),g)}),D=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(J)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(f){H(k.meta.last_commit_id,f)}),g,this.ui.getCurrentFile()!=k?k.getData():null,c.scale,c.border)}else H(k.meta.last_commit_id,Base64.encode(k.getData()))});q?
-this.getFile(x+"/"+z+"/"+F+"/"+J,mxUtils.bind(this,function(c){k.meta.last_commit_id=c.meta.last_commit_id;D()}),g):D()};GitLabClient.prototype.pickFolder=function(k){this.showGitLabDialog(!1,k,!0)};GitLabClient.prototype.pickFile=function(k){k=null!=k?k:mxUtils.bind(this,function(m){this.ui.loadFile("A"+encodeURIComponent(m))});this.showGitLabDialog(!0,k)};GitLabClient.prototype.showGitLabDialog=function(k,m,g){var q=null,u=null,x=null,z=null,F=document.createElement("div");F.style.whiteSpace="nowrap";
-F.style.overflow="hidden";F.style.height="304px";var J=document.createElement("h3");mxUtils.write(J,mxResources.get(k?"selectFile":"selectFolder"));F.appendChild(J);var H=document.createElement("div");H.style.whiteSpace="nowrap";H.style.border="1px solid lightgray";H.style.boxSizing="border-box";H.style.padding="4px";H.style.overflow="auto";H.style.lineHeight="1.2em";H.style.height="274px";F.appendChild(H);var D=document.createElement("div");D.style.textOverflow="ellipsis";D.style.boxSizing="border-box";
+x.split("/");this.getRefIndex(x,!0,mxUtils.bind(this,function(F,I){var H=Math.max(I-1,0),D=F.slice(0,H).join("/"),c=F[H],f=F[I];path=F.slice(I+1,F.length).join("/");0<path.length&&(path+="/");path+=k;this.checkExists(D+"/"+c+"/"+f+"/"+path,!0,mxUtils.bind(this,function(l,n){l?u?(z||(m=Base64.encode(m)),this.showCommitDialog(k,!0,mxUtils.bind(this,function(r){this.writeFile(D,c,f,path,r,m,n,mxUtils.bind(this,function(t){try{var v=JSON.parse(t.getText());g(this.createGitLabFile(D,c,f,null!=v.content?
+v.content:v,u,I))}catch(B){q(B)}}),q)}),q)):(l=DRAWIO_GITLAB_URL+"/",g(new GitLabFile(this.ui,m,{org:D,repo:c,ref:f,name:k,path:path,html_url:l+D+"/"+c+"/blob/"+f+"/"+path,download_url:l+D+"/"+c+"/raw/"+f+"/"+path+"?inline=false",refPos:I,last_commit_id:n,isNew:!0}))):q()}))}),q,null,4>=x.length)};GitLabClient.prototype.checkExists=function(k,m,g){this.getFile(k,mxUtils.bind(this,function(q){if(m){var u=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[k]),function(){u();g(!0,q.getCurrentEtag())},
+function(){u();g(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){g(!1)})}),mxUtils.bind(this,function(q){g(!0)}),null,!0)};GitLabClient.prototype.writeFile=function(k,m,g,q,u,x,z,F,I){if(x.length>=this.maxFileSize)I({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(x.length)+" / 10 MB)"});else{var H="POST";g={path:encodeURIComponent(q),branch:decodeURIComponent(g),commit_message:u,content:x,
+encoding:"base64"};null!=z&&(g.last_commit_id=z,H="PUT");k=this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+m)+"/repository/files/"+encodeURIComponent(q);H=new mxXmlRequest(k,JSON.stringify(g),H);this.executeRequest(H,mxUtils.bind(this,function(D){F(D)}),I)}};GitLabClient.prototype.saveFile=function(k,m,g,q,u){var x=k.meta.org,z=k.meta.repo,F=k.meta.ref,I=k.meta.path,H=mxUtils.bind(this,function(c,f){this.writeFile(x,z,F,I,u,f,c,mxUtils.bind(this,function(l){delete k.meta.isNew;this.getFile(x+"/"+
+z+"/"+F+"/"+I,mxUtils.bind(this,function(n){n.getData()==k.getData()?m(n.getCurrentEtag()):m({content:k.getCurrentEtag()})}),g,null,null,k.meta.refPos)}),g)}),D=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(I)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(f){H(k.meta.last_commit_id,f)}),g,this.ui.getCurrentFile()!=k?k.getData():null,c.scale,c.border)}else H(k.meta.last_commit_id,Base64.encode(k.getData()))});q?
+this.getFile(x+"/"+z+"/"+F+"/"+I,mxUtils.bind(this,function(c){k.meta.last_commit_id=c.meta.last_commit_id;D()}),g):D()};GitLabClient.prototype.pickFolder=function(k){this.showGitLabDialog(!1,k,!0)};GitLabClient.prototype.pickFile=function(k){k=null!=k?k:mxUtils.bind(this,function(m){this.ui.loadFile("A"+encodeURIComponent(m))});this.showGitLabDialog(!0,k)};GitLabClient.prototype.showGitLabDialog=function(k,m,g){var q=null,u=null,x=null,z=null,F=document.createElement("div");F.style.whiteSpace="nowrap";
+F.style.overflow="hidden";F.style.height="304px";var I=document.createElement("h3");mxUtils.write(I,mxResources.get(k?"selectFile":"selectFolder"));F.appendChild(I);var H=document.createElement("div");H.style.whiteSpace="nowrap";H.style.border="1px solid lightgray";H.style.boxSizing="border-box";H.style.padding="4px";H.style.overflow="auto";H.style.lineHeight="1.2em";H.style.height="274px";F.appendChild(H);var D=document.createElement("div");D.style.textOverflow="ellipsis";D.style.boxSizing="border-box";
D.style.overflow="hidden";D.style.padding="4px";D.style.width="100%";var c=new CustomDialog(this.ui,F,mxUtils.bind(this,function(){m(q+"/"+u+"/"+encodeURIComponent(x)+"/"+z)}));this.ui.showDialog(c.container,420,370,!0,!0);k&&c.okButton.parentNode.removeChild(c.okButton);var f=mxUtils.bind(this,function(K,C,R,M){var O=document.createElement("a");O.setAttribute("title",K);O.style.cursor="pointer";mxUtils.write(O,K);mxEvent.addListener(O,"click",C);M&&(O.style.textDecoration="underline");null!=R&&(K=
D.cloneNode(),K.style.padding=R,K.appendChild(O),O=K);return O}),l=mxUtils.bind(this,function(K){var C=document.createElement("div");C.style.marginBottom="8px";C.appendChild(f(q+"/"+u,mxUtils.bind(this,function(){z=null;E()}),null,!0));K||(mxUtils.write(C," / "),C.appendChild(f(decodeURIComponent(x),mxUtils.bind(this,function(){z=null;B()}),null,!0)));if(null!=z&&0<z.length){var R=z.split("/");for(K=0;K<R.length;K++)(function(M){mxUtils.write(C," / ");C.appendChild(f(R[M],mxUtils.bind(this,function(){z=
R.slice(0,M+1).join("/");v()}),null,!0))})(K)}H.appendChild(C)}),n=mxUtils.bind(this,function(K){this.ui.handleError(K,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(z=x=u=q=null,E()):this.ui.hideDialog()}))}),r=null,t=null,v=mxUtils.bind(this,function(K){null==K&&(H.innerText="",K=1);var C=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(q+"/"+u)+"/repository/tree?path="+z+"&ref="+x+"&per_page=100&page="+K,null,"GET");this.ui.spinner.spin(H,mxResources.get("loading"));
@@ -15426,34 +15436,34 @@ z="",v();else{for(var T=0;T<U.length;T++)mxUtils.bind(this,function(V,fa){var y=
mxResources.get("loading"));var E=mxUtils.bind(this,function(K){var C=this.ui.spinner,R=0;this.ui.spinner.stop();var M=function(){C.spin(H,mxResources.get("loading"));R+=1},O=function(){--R;0===R&&C.stop()};null==K&&(H.innerText="",K=1);null!=t&&(mxEvent.removeListener(H,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var U=mxUtils.bind(this,function(){0===
R&&E(K+1)});mxEvent.addListener(r,"click",U);var T=mxUtils.bind(this,function(fa){M();var y=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(y,mxUtils.bind(this,function(d){this.ui.tryAndHandle(mxUtils.bind(this,function(){fa(JSON.parse(d.getText()));O()}))}),n)}),V=mxUtils.bind(this,function(fa,y){M();var d=new mxXmlRequest(this.baseUrl+"/groups/"+fa.id+"/projects?per_page=100",null,"GET");this.executeRequest(d,mxUtils.bind(this,function(p){this.ui.tryAndHandle(mxUtils.bind(this,
function(){404==p.getStatus()?y(fa,[]):y(fa,JSON.parse(p.getText()));O()}))}),n,!0)});T(mxUtils.bind(this,function(fa){if(null==this.user)mxUtils.write(H,mxResources.get("loggedOut"));else{M();var y=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+K,null,"GET");this.executeRequest(y,mxUtils.bind(this,function(d){d=JSON.parse(d.getText());if(null!=d&&0!=d.length||null!=fa&&0!=fa.length){1==K&&(H.appendChild(f(mxResources.get("enterValue")+"...",mxUtils.bind(this,
-function(){if(0===R){var G=new FilenameDialog(this.ui,"group/project",mxResources.get("ok"),mxUtils.bind(this,function(I){null!=I&&(I=I.split("/"),1<I.length?(q=I.slice(0,I.length-1).join("/"),u=I[I.length-1],z="",B(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(G.container,300,80,!0,!1);G.init()}}))),mxUtils.br(H),mxUtils.br(H));for(var p=!0,A=0;A<d.length;A++)mxUtils.bind(this,function(G){var I=
-D.cloneNode();I.style.backgroundColor=p?Editor.isDarkMode()?"#000000":"#eeeeee":"";p=!p;I.appendChild(f(G.name_with_namespace,mxUtils.bind(this,function(){0===R&&(q=G.owner.username,u=G.path,z="",B(null,!0))})));H.appendChild(I)})(d[A]);for(A=0;A<fa.length;A++)M(),V(fa[A],mxUtils.bind(this,function(G,I){O();for(var L=0;L<I.length;L++){var P=D.cloneNode();P.style.backgroundColor=p?Editor.isDarkMode()?"#000000":"#eeeeee":"";p=!p;mxUtils.bind(this,function(Q){P.appendChild(f(Q.name_with_namespace,mxUtils.bind(this,
-function(){0===R&&(q=G.full_path,u=Q.path,z="",B(null,!0))})));H.appendChild(P)})(I[L])}}));O()}else O(),mxUtils.br(H),mxUtils.write(H,mxResources.get("repositoryNotFound"));100==d.length&&(H.appendChild(r),t=function(){H.scrollTop>=H.scrollHeight-H.offsetHeight&&U()},mxEvent.addListener(H,"scroll",t))}),n)}}))});b?this.user?E():this.updateUser(function(){E()},n,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){E()},n,!0)}),n)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+
+function(){if(0===R){var G=new FilenameDialog(this.ui,"group/project",mxResources.get("ok"),mxUtils.bind(this,function(J){null!=J&&(J=J.split("/"),1<J.length?(q=J.slice(0,J.length-1).join("/"),u=J[J.length-1],z="",B(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(G.container,300,80,!0,!1);G.init()}}))),mxUtils.br(H),mxUtils.br(H));for(var p=!0,A=0;A<d.length;A++)mxUtils.bind(this,function(G){var J=
+D.cloneNode();J.style.backgroundColor=p?Editor.isDarkMode()?"#000000":"#eeeeee":"";p=!p;J.appendChild(f(G.name_with_namespace,mxUtils.bind(this,function(){0===R&&(q=G.owner.username,u=G.path,z="",B(null,!0))})));H.appendChild(J)})(d[A]);for(A=0;A<fa.length;A++)M(),V(fa[A],mxUtils.bind(this,function(G,J){O();for(var L=0;L<J.length;L++){var P=D.cloneNode();P.style.backgroundColor=p?Editor.isDarkMode()?"#000000":"#eeeeee":"";p=!p;mxUtils.bind(this,function(Q){P.appendChild(f(Q.name_with_namespace,mxUtils.bind(this,
+function(){0===R&&(q=G.full_path,u=Q.path,z="",B(null,!0))})));H.appendChild(P)})(J[L])}}));O()}else O(),mxUtils.br(H),mxUtils.write(H,mxResources.get("repositoryNotFound"));100==d.length&&(H.appendChild(r),t=function(){H.scrollTop>=H.scrollHeight-H.offsetHeight&&U()},mxEvent.addListener(H,"scroll",t))}),n)}}))});b?this.user?E():this.updateUser(function(){E()},n,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){E()},n,!0)}),n)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+
"?doLogout=1&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();this.setUser(null);b=null;this.setToken(null)}})();DrawioComment=function(b,k,m,g,q,u,x){this.file=b;this.id=k;this.content=m;this.modifiedDate=g;this.createdDate=q;this.isResolved=u;this.user=x;this.anchor=null;this.replies=[]};DrawioComment.prototype.getAnchorPageId=function(){return null!=this.anchor?this.anchor.p:null};DrawioComment.prototype.getAnchorCellIds=function(){var b=null!=this.anchor?this.anchor.c:null;return null==b?null:b instanceof Array?b:[b]};
DrawioComment.prototype.getAnchorCellId=function(){var b=this.getAnchorCellIds();return null!=b&&0<b.length?b[0]:null};DrawioComment.prototype.getAnchorRect=function(){return null!=this.anchor?this.anchor.r:null};DrawioComment.prototype.getAnchorPoint=function(){return null!=this.anchor?this.anchor.pt:null};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,k,m,g,q){k()};DrawioComment.prototype.editComment=function(b,k,m){k()};
DrawioComment.prototype.deleteComment=function(b,k){b()};DriveComment=function(b,k,m,g,q,u,x,z){DrawioComment.call(this,b,k,m,g,q,u,x);this.pCommentId=z};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(b,k,m,g,q){b={content:b.content};g?b.action="resolve":q&&(b.action="reopen");this.file.ui.drive.executeRequest({fullUrl:this.file.getCommentUrl("/"+this.id+"/replies","id"),params:b,method:"POST"},mxUtils.bind(this,function(u){k(u.id)}),m)};
-DriveComment.prototype.editComment=function(b,k,m){this.content=b;b={content:b};this.file.ui.drive.executeRequest({fullUrl:this.pCommentId?this.file.getCommentUrl("/"+this.pCommentId+"/replies/"+this.id,"id"):this.file.getCommentUrl("/"+this.id,"id"),params:b,method:"PATCH"},k,m)};DriveComment.prototype.deleteComment=function(b,k){this.file.ui.drive.executeRequest({fullUrl:this.file.getCommentUrl((this.pCommentId?"/"+this.pCommentId+"/replies":"")+"/"+this.id),method:"DELETE"},b,k)};function mxODPicker(b,k,m,g,q,u,x,z,F,J,H,D,c,f){function l(Y,W){W=W||document;return W.querySelector(Y)}function n(Y){return Y.name||(null!=Y.remoteItem?Y.remoteItem.name:null)}function r(Y){return Y.folder||(null!=Y.remoteItem?Y.remoteItem.folder:null)}function t(Y,W,ca){if(null==Y["@microsoft.graph.downloadUrl"])if(null==Y.parentReference)ca();else{g(Y.id,Y.parentReference.driveId,function(da){t(da,W,ca)},ca);return}var S=new XMLHttpRequest;S.open("GET",Y["@microsoft.graph.downloadUrl"]);var Z=
+DriveComment.prototype.editComment=function(b,k,m){this.content=b;b={content:b};this.file.ui.drive.executeRequest({fullUrl:this.pCommentId?this.file.getCommentUrl("/"+this.pCommentId+"/replies/"+this.id,"id"):this.file.getCommentUrl("/"+this.id,"id"),params:b,method:"PATCH"},k,m)};DriveComment.prototype.deleteComment=function(b,k){this.file.ui.drive.executeRequest({fullUrl:this.file.getCommentUrl((this.pCommentId?"/"+this.pCommentId+"/replies":"")+"/"+this.id),method:"DELETE"},b,k)};function mxODPicker(b,k,m,g,q,u,x,z,F,I,H,D,c,f){function l(Y,X){X=X||document;return X.querySelector(Y)}function n(Y){return Y.name||(null!=Y.remoteItem?Y.remoteItem.name:null)}function r(Y){return Y.folder||(null!=Y.remoteItem?Y.remoteItem.folder:null)}function t(Y,X,ca){if(null==Y["@microsoft.graph.downloadUrl"])if(null==Y.parentReference)ca();else{g(Y.id,Y.parentReference.driveId,function(da){t(da,X,ca)},ca);return}var S=new XMLHttpRequest;S.open("GET",Y["@microsoft.graph.downloadUrl"]);var Z=
Y.file?"image/png"==Y.file.mimeType:!1;S.onreadystatechange=function(){if(4==this.readyState){if(200<=this.status&&299>=this.status)try{var da=S.responseText;Z?(da="data:image/png;base64,"+Editor.base64Encode(da),da=Editor.extractGraphModelFromPng(da)):/\.pdf$/.test(Y.name)&&(da="data:application/pdf;base64,"+Editor.base64Encode(da),da=Editor.extractGraphModelFromPdf(da));var N=mxUtils.parseXml(da),aa="mxlibrary"==N.documentElement.nodeName?N.documentElement:Editor.extractGraphModel(N.documentElement);
-if(null!=aa){W(aa.ownerDocument);return}}catch(ea){}ca()}};(Z||/\.pdf$/.test(Y.name))&&S.overrideMimeType&&S.overrideMimeType("text/plain; charset=x-user-defined");S.send()}function v(){null!=y&&null!=y.remoteItem&&(y=y.remoteItem);D&&null!=fa?V.exportToCanvas(function(Y){Y=EditorUi.prototype.createImageDataUri(Y,null,"png");x(y,Y);u(y)},400,null,null,function(Y){console.log(Y)},600,null,null,null,null,null,fa):(x(y,void 0),u(y))}function B(Y){function W(ca){Q.style.background="transparent";Q.innerText=
-"";var S=document.createElement("div");S.className="odPreviewStatus";mxUtils.write(S,ca);Q.appendChild(S);T.stop()}if(null!=Q)if(Q.style.background="transparent",Q.innerText="",null==Y||null!=r(Y)||/\.drawiolib$/.test(n(Y)))W(mxResources.get("noPreview"));else try{null!=Y.remoteItem&&(Y=Y.remoteItem),I=Y,T.spin(Q),t(Y,function(ca){T.stop();if(I==Y)if("mxlibrary"==ca.documentElement.nodeName)W(mxResources.get("noPreview"));else{var S=ca.getElementsByTagName("diagram");fa=AspectDialog.prototype.createViewer(Q,
-0==S.length?ca.documentElement:S[0],null,"transparent")}},function(){y=null;W(mxResources.get("notADiagramFile"))})}catch(ca){y=null,W(mxResources.get("notADiagramFile"))}}function E(){var Y=l(".odFilesBreadcrumb");if(null!=Y){Y.innerText="";for(var W=0;W<A.length-1;W++){var ca=document.createElement("span");ca.className="odBCFolder";ca.innerHTML=mxUtils.htmlEntities(A[W].name||mxResources.get("home"));Y.appendChild(ca);(function(Z,da){ca.addEventListener("click",function(){k(null);A=A.slice(0,da);
-C(Z.driveId,Z.folderId,Z.siteId,Z.name)})})(A[W],W);var S=document.createElement("span");S.innerHTML=" &gt; ";Y.appendChild(S)}null!=A[A.length-1]&&(W=document.createElement("span"),W.innerHTML=mxUtils.htmlEntities(1==A.length?mxResources.get(F?"selectFolder":"officeSelDiag"):A[A.length-1].name||mxResources.get("home")),Y.appendChild(W))}}function K(){if(null!=y&&!p)if("sharepoint"==d)C("site",null,y.id,y.displayName);else if("site"==d)C("subsite",null,y.id,y.name);else{var Y=null!=r(y);y=y.remoteItem?
-y.remoteItem:y;var W=(y.parentReference?y.parentReference.driveId:null)||d,ca=y.id;Y?C(W,ca,null,y.name):v()}}function C(Y,W,ca,S,Z){function da(Ba){T.stop();var ua=document.createElement("table");ua.className="odFileListGrid";for(var qa=null,ia=0,ja=0;null!=Ba&&ja<Ba.length;ja++){var na=Ba[ja];if(1!=ea||!na.webUrl||0<na.webUrl.indexOf("sharepoint.com/sites/")||0>na.webUrl.indexOf("sharepoint.com/")){var Aa=na.displayName||n(na),ha=mxUtils.htmlEntities(na.description||Aa);ea&&(na.folder=2==ea?{isRoot:!0}:
-!0);var la=null!=r(na);if(!F||la){var xa=document.createElement("tr");xa.className=ia++%2?"odOddRow":"odEvenRow";var Ca=document.createElement("td");Ca.style.width="36px";var pa=document.createElement("img");pa.src="/images/"+(la?"folder.png":"file.png");pa.className="odFileImg";Ca.appendChild(pa);xa.appendChild(Ca);Ca=document.createElement("td");la=document.createElement("div");la.className="odFileTitle";la.innerHTML=mxUtils.htmlEntities(Aa);la.setAttribute("title",ha);Ca.appendChild(la);xa.appendChild(Ca);
-ua.appendChild(xa);null==qa&&(qa=xa,qa.className+=" odRowSelected",y=na,d=Y,f||k(y));(function(oa,Da){xa.addEventListener("dblclick",K);xa.addEventListener("click",function(){qa!=Da&&(qa.className=qa.className.replace("odRowSelected",""),qa=Da,qa.className+=" odRowSelected",y=oa,d=Y,f||k(y))})})(na,xa)}}}0==ia?(Ba=document.createElement("div"),Ba.className="odEmptyFolder",Ba.innerHTML=mxUtils.htmlEntities(1==ea&&Z?mxResources.get("noResultsFor",[Z],"No results for '"+Z+"'"):mxResources.get("folderEmpty")),
+if(null!=aa){X(aa.ownerDocument);return}}catch(ea){}ca()}};(Z||/\.pdf$/.test(Y.name))&&S.overrideMimeType&&S.overrideMimeType("text/plain; charset=x-user-defined");S.send()}function v(){null!=y&&null!=y.remoteItem&&(y=y.remoteItem);D&&null!=fa?V.exportToCanvas(function(Y){Y=EditorUi.prototype.createImageDataUri(Y,null,"png");x(y,Y);u(y)},400,null,null,function(Y){console.log(Y)},600,null,null,null,null,null,fa):(x(y,void 0),u(y))}function B(Y){function X(ca){Q.style.background="transparent";Q.innerText=
+"";var S=document.createElement("div");S.className="odPreviewStatus";mxUtils.write(S,ca);Q.appendChild(S);T.stop()}if(null!=Q)if(Q.style.background="transparent",Q.innerText="",null==Y||null!=r(Y)||/\.drawiolib$/.test(n(Y)))X(mxResources.get("noPreview"));else try{null!=Y.remoteItem&&(Y=Y.remoteItem),J=Y,T.spin(Q),t(Y,function(ca){T.stop();if(J==Y)if("mxlibrary"==ca.documentElement.nodeName)X(mxResources.get("noPreview"));else{var S=ca.getElementsByTagName("diagram");fa=AspectDialog.prototype.createViewer(Q,
+0==S.length?ca.documentElement:S[0],null,"transparent")}},function(){y=null;X(mxResources.get("notADiagramFile"))})}catch(ca){y=null,X(mxResources.get("notADiagramFile"))}}function E(){var Y=l(".odFilesBreadcrumb");if(null!=Y){Y.innerText="";for(var X=0;X<A.length-1;X++){var ca=document.createElement("span");ca.className="odBCFolder";ca.innerHTML=mxUtils.htmlEntities(A[X].name||mxResources.get("home"));Y.appendChild(ca);(function(Z,da){ca.addEventListener("click",function(){k(null);A=A.slice(0,da);
+C(Z.driveId,Z.folderId,Z.siteId,Z.name)})})(A[X],X);var S=document.createElement("span");S.innerHTML=" &gt; ";Y.appendChild(S)}null!=A[A.length-1]&&(X=document.createElement("span"),X.innerHTML=mxUtils.htmlEntities(1==A.length?mxResources.get(F?"selectFolder":"officeSelDiag"):A[A.length-1].name||mxResources.get("home")),Y.appendChild(X))}}function K(){if(null!=y&&!p)if("sharepoint"==d)C("site",null,y.id,y.displayName);else if("site"==d)C("subsite",null,y.id,y.name);else{var Y=null!=r(y);y=y.remoteItem?
+y.remoteItem:y;var X=(y.parentReference?y.parentReference.driveId:null)||d,ca=y.id;Y?C(X,ca,null,y.name):v()}}function C(Y,X,ca,S,Z){function da(Ba){T.stop();var ua=document.createElement("table");ua.className="odFileListGrid";for(var qa=null,ia=0,ja=0;null!=Ba&&ja<Ba.length;ja++){var na=Ba[ja];if(1!=ea||!na.webUrl||0<na.webUrl.indexOf("sharepoint.com/sites/")||0>na.webUrl.indexOf("sharepoint.com/")){var Aa=na.displayName||n(na),ha=mxUtils.htmlEntities(na.description||Aa);ea&&(na.folder=2==ea?{isRoot:!0}:
+!0);var la=null!=r(na);if(!F||la){var ya=document.createElement("tr");ya.className=ia++%2?"odOddRow":"odEvenRow";var Ca=document.createElement("td");Ca.style.width="36px";var pa=document.createElement("img");pa.src="/images/"+(la?"folder.png":"file.png");pa.className="odFileImg";Ca.appendChild(pa);ya.appendChild(Ca);Ca=document.createElement("td");la=document.createElement("div");la.className="odFileTitle";la.innerHTML=mxUtils.htmlEntities(Aa);la.setAttribute("title",ha);Ca.appendChild(la);ya.appendChild(Ca);
+ua.appendChild(ya);null==qa&&(qa=ya,qa.className+=" odRowSelected",y=na,d=Y,f||k(y));(function(oa,Ea){ya.addEventListener("dblclick",K);ya.addEventListener("click",function(){qa!=Ea&&(qa.className=qa.className.replace("odRowSelected",""),qa=Ea,qa.className+=" odRowSelected",y=oa,d=Y,f||k(y))})})(na,ya)}}}0==ia?(Ba=document.createElement("div"),Ba.className="odEmptyFolder",Ba.innerHTML=mxUtils.htmlEntities(1==ea&&Z?mxResources.get("noResultsFor",[Z],"No results for '"+Z+"'"):mxResources.get("folderEmpty")),
ra.appendChild(Ba)):ra.appendChild(ua);E();p=!1}function N(Ba){m(Ba?Ba:va,function(ua){if(aa){var qa=ua.value||[];if(f||ea)Array.prototype.push.apply(za,qa);else{for(var ia=0;ia<qa.length;ia++){var ja=qa[ia],na=ja.file||(null!=ja.remoteItem?ja.remoteItem.file:null);na=null!=na?na.mimeType:null;var Aa=n(ja);(null!=r(ja)||"text/html"==na||"text/xml"==na||"application/xml"==na||"image/png"==na||/\.svg$/.test(Aa)||/\.html$/.test(Aa)||/\.xml$/.test(Aa)||/\.png$/.test(Aa)||/\.drawio$/.test(Aa)||/\.drawiolib$/.test(Aa)||
-/\.pdf$/.test(Aa))&&za.push(ja)}za.sort(function(ha,la){var xa=(n(ha)||"").toLowerCase(),Ca=(n(la)||"").toLowerCase();ha=null!=r(ha);la=null!=r(la);return ha&&!la?-1:!ha&&la?1:xa<Ca?-1:xa>Ca?1:0})}ua["@odata.nextLink"]&&1E3>za.length?N(ua["@odata.nextLink"]):(clearTimeout(ka),da(za))}},function(ua){if(aa){clearTimeout(ka);var qa=null;try{qa=JSON.parse(ua.responseText).error.message}catch(ia){}z(mxResources.get("errorFetchingFolder")+(null!=qa?" ("+qa+")":""));p=!1;T.stop()}},null!=Ba)}if(!p){l(".odCatsList").style.display=
+/\.pdf$/.test(Aa))&&za.push(ja)}za.sort(function(ha,la){var ya=(n(ha)||"").toLowerCase(),Ca=(n(la)||"").toLowerCase();ha=null!=r(ha);la=null!=r(la);return ha&&!la?-1:!ha&&la?1:ya<Ca?-1:ya>Ca?1:0})}ua["@odata.nextLink"]&&1E3>za.length?N(ua["@odata.nextLink"]):(clearTimeout(ka),da(za))}},function(ua){if(aa){clearTimeout(ka);var qa=null;try{qa=JSON.parse(ua.responseText).error.message}catch(ia){}z(mxResources.get("errorFetchingFolder")+(null!=qa?" ("+qa+")":""));p=!1;T.stop()}},null!=Ba)}if(!p){l(".odCatsList").style.display=
"block";l(".odFilesSec").style.display="block";l(".searchBar").style.display="sharepoint"==Y?"":"none";if("sharepoint"!=Y||null==Z)l("#odSearchBox").value="";null!=Q&&(Q.innerText="",Q.style.top="50%");var aa=p=!0,ea=0;G=arguments;var ka=setTimeout(function(){p=aa=!1;T.stop();z(mxResources.get("timeout"))},2E4),ra=l(".odFilesList");ra.innerText="";T.spin(ra);switch(Y){case "recent":A=[{name:mxResources.get("recent"),driveId:Y}];var sa=q()||{},ma=[],wa;for(wa in sa)ma.push(sa[wa]);clearTimeout(ka);
-da(ma);return;case "shared":var va="/me/drive/sharedWithMe";A=[{name:mxResources.get("sharedWithMe"),driveId:Y}];break;case "sharepoint":va="/sites?search="+(null!=Z?encodeURIComponent(Z):"");A=[{name:mxResources.get("sharepointSites"),driveId:Y}];ea=1;break;case "site":A.push({name:S,driveId:Y,folderId:W,siteId:ca});va="/sites/"+ca+"/drives";ea=2;break;case "subsite":A.push({name:S,driveId:Y,folderId:W,siteId:ca});va="/drives/"+ca+(W?"/items/"+W:"/root")+"/children";break;case "search":Y=d;A=[{driveId:Y,
-name:mxResources.get("back")}];Z=encodeURIComponent(Z.replace(/'/g,"\\'"));va=Y?"/drives/"+Y+"/root/search(q='"+Z+"')":"/me/drive/root/search(q='"+Z+"')";break;default:null==W?A=[{driveId:Y}]:A.push({name:S,driveId:Y,folderId:W}),va=(Y?"/drives/"+Y:"/me/drive")+(W?"/items/"+W:"/root")+"/children"}ea||(va+=(0<va.indexOf("?")?"&":"?")+"select=id,name,description,parentReference,file,createdBy,lastModifiedBy,lastModifiedDateTime,size,folder,remoteItem,@microsoft.graph.downloadUrl");var za=[];N()}}function R(Y){ba.className=
-ba.className.replace("odCatSelected","");ba=Y;ba.className+=" odCatSelected"}function M(Y){X=null;null!=G&&"sharepoint"==G[0]&&(p?X=setTimeout(function(){M(Y)},500):C("sharepoint",null,null,null,Y))}var O="";null==k&&(k=B,O='<div style="text-align: center;" class="odPreview"></div>');null==q&&(q=function(){var Y=null;try{Y=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(W){}return Y});null==u&&(u=function(Y){if(null!=Y){var W=q()||{};delete Y["@microsoft.graph.downloadUrl"];W[Y.id]=
-Y;localStorage.setItem("mxODPickerRecentList",JSON.stringify(W))}});O='<div class="odCatsList"><div class="odCatsListLbl">OneDrive</div><div id="odFiles" class="odCatListTitle odCatSelected">'+mxUtils.htmlEntities(mxResources.get("files"))+'</div><div id="odRecent" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("recent"))+'</div><div id="odShared" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("shared"))+'</div><div id="odSharepoint" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("sharepoint"))+
-'</div></div><div class="odFilesSec"><div class="searchBar" style="display:none"><input type="search" id="odSearchBox" placeholder="'+mxUtils.htmlEntities(mxResources.get("search"))+'"></div><div class="odFilesBreadcrumb"></div><div id="refreshOD" class="odRefreshButton"><img class="geAdaptiveAsset" src="/images/update32.png" width="16" height="16" title="'+mxUtils.htmlEntities(mxResources.get("refresh"))+'Refresh" border="0"/></div><div class="odFilesList"></div></div>'+O+(J?'<div id="odBackBtn" class="odLinkBtn">&lt; '+
+da(ma);return;case "shared":var va="/me/drive/sharedWithMe";A=[{name:mxResources.get("sharedWithMe"),driveId:Y}];break;case "sharepoint":va="/sites?search="+(null!=Z?encodeURIComponent(Z):"");A=[{name:mxResources.get("sharepointSites"),driveId:Y}];ea=1;break;case "site":A.push({name:S,driveId:Y,folderId:X,siteId:ca});va="/sites/"+ca+"/drives";ea=2;break;case "subsite":A.push({name:S,driveId:Y,folderId:X,siteId:ca});va="/drives/"+ca+(X?"/items/"+X:"/root")+"/children";break;case "search":Y=d;A=[{driveId:Y,
+name:mxResources.get("back")}];Z=encodeURIComponent(Z.replace(/'/g,"\\'"));va=Y?"/drives/"+Y+"/root/search(q='"+Z+"')":"/me/drive/root/search(q='"+Z+"')";break;default:null==X?A=[{driveId:Y}]:A.push({name:S,driveId:Y,folderId:X}),va=(Y?"/drives/"+Y:"/me/drive")+(X?"/items/"+X:"/root")+"/children"}ea||(va+=(0<va.indexOf("?")?"&":"?")+"select=id,name,description,parentReference,file,createdBy,lastModifiedBy,lastModifiedDateTime,size,folder,remoteItem,@microsoft.graph.downloadUrl");var za=[];N()}}function R(Y){ba.className=
+ba.className.replace("odCatSelected","");ba=Y;ba.className+=" odCatSelected"}function M(Y){W=null;null!=G&&"sharepoint"==G[0]&&(p?W=setTimeout(function(){M(Y)},500):C("sharepoint",null,null,null,Y))}var O="";null==k&&(k=B,O='<div style="text-align: center;" class="odPreview"></div>');null==q&&(q=function(){var Y=null;try{Y=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(X){}return Y});null==u&&(u=function(Y){if(null!=Y){var X=q()||{};delete Y["@microsoft.graph.downloadUrl"];X[Y.id]=
+Y;localStorage.setItem("mxODPickerRecentList",JSON.stringify(X))}});O='<div class="odCatsList"><div class="odCatsListLbl">OneDrive</div><div id="odFiles" class="odCatListTitle odCatSelected">'+mxUtils.htmlEntities(mxResources.get("files"))+'</div><div id="odRecent" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("recent"))+'</div><div id="odShared" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("shared"))+'</div><div id="odSharepoint" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("sharepoint"))+
+'</div></div><div class="odFilesSec"><div class="searchBar" style="display:none"><input type="search" id="odSearchBox" placeholder="'+mxUtils.htmlEntities(mxResources.get("search"))+'"></div><div class="odFilesBreadcrumb"></div><div id="refreshOD" class="odRefreshButton"><img class="geAdaptiveAsset" src="/images/update32.png" width="16" height="16" title="'+mxUtils.htmlEntities(mxResources.get("refresh"))+'Refresh" border="0"/></div><div class="odFilesList"></div></div>'+O+(I?'<div id="odBackBtn" class="odLinkBtn">&lt; '+
mxUtils.htmlEntities(mxResources.get("back"))+"</div>":"")+(H?'<button id="odSubmitBtn" class="odSubmitBtn">'+mxUtils.htmlEntities(mxResources.get(F?"select":"open"))+"</button>":"");var U=null!=window.Editor&&null!=Editor.isDarkMode&&Editor.isDarkMode();U=".odCatsList *, .odFilesSec * { user-select: none; }.odCatsList {\tbox-sizing: border-box;\tposition:absolute;\ttop:0px;\tbottom:50%;\twidth:30%;\tborder: 1px solid #CCCCCC;\tborder-bottom:none;\tdisplay: inline-block;\toverflow-x: hidden;\toverflow-y: auto;}.odCatsListLbl {\theight: 17px;\tcolor: #6D6D6D;\tfont-size: 14px;\tfont-weight: bold;\tline-height: 17px;\tmargin: 10px 0 3px 5px;}.odFilesSec {\tbox-sizing: border-box;\tposition:absolute;\tleft:30%;\ttop:0px;\tbottom:50%;\twidth: 70%;\tborder: 1px solid #CCCCCC;\tborder-left:none;\tborder-bottom:none;\tdisplay: inline-block;\toverflow: hidden;}.odFilesBreadcrumb {\tbox-sizing: border-box;\tposition:absolute;\tmin-height: 32px;\tleft:0px;\tright:20px;\ttext-overflow:ellipsis;\toverflow:hidden;\tfont-size: 13px;\tcolor: #6D6D6D;\tpadding: 5px;}.odRefreshButton {\tbox-sizing: border-box;\tposition:absolute;\tright:0px;\ttop:0px;\tpadding: 4px;\tmargin: 1px;\theight:24px;\tcursor:default;}.odRefreshButton>img {\topacity:0.5;}.odRefreshButton:hover {\tbackground-color:#ddd;\tborder-radius:50%;}.odRefreshButton:active {\topacity:0.7;}.searchBar {\tposition:absolute;\ttop:4px;\tright:30px;\tz-index:1;}.searchBar > input {\tbox-sizing: border-box;\twidth: 140px;\tfont-size: 13px;}.odFilesList {\tbox-sizing: border-box;\tposition:absolute;\ttop:32px;\tbottom:0px;\twidth: 100%;\toverflow-x: hidden;\toverflow-y: auto;}.odFileImg {\twidth: 24px;\tpadding-left: 5px;\tpadding-right: 5px;}.odFileTitle {\tcursor: default;\tfont-weight: normal;\tcolor: #666666 !important;\twidth: calc(100% - 20px);\twhite-space: nowrap;\toverflow: hidden;\ttext-overflow: ellipsis;}.odFileListGrid {\twidth: 100%;\twhite-space: nowrap;\tfont-size: 13px; box-sizing: border-box; border-spacing: 0;}.odOddRow {"+
(U?"":"\tbackground-color: #eeeeee;")+"}.odEvenRow {"+(U?"":"\tbackground-color: #FFFFFF;")+"}.odRowSelected {\tbackground-color: #cadfff;}.odCatListTitle {\tbox-sizing: border-box;\theight: 17px;\tcursor: default;\tcolor: #666666;\tfont-size: 14px;\tline-height: 17px;\tmargin: 5px 0 5px 0px; padding-left: 10px;}.odCatSelected {\tfont-weight: bold;\tbackground-color: #cadfff;}.odEmptyFolder {\theight: 17px;\tcolor: #6D6D6D;\tfont-size: 14px;\tfont-weight: bold;\tline-height: 17px;\tmargin: 10px 0 3px 5px;\twidth: 100%; text-align: center;}.odBCFolder {\tcursor: pointer;\tcolor: #0432ff;}.odPreviewStatus {\tposition:absolute;\ttext-align:center;\twidth:100%;\ttop:50%;\ttransform: translateY(-50%);\tfont-size:13px;\topacity:0.5;}.odPreview { position:absolute;\t overflow:hidden;\t border: 1px solid #CCCCCC; bottom:0px; top: 50%; left:0px; right:0px;}.odLinkBtn { position: absolute;\tfont-size: 12px;\tcursor: pointer;\tcolor: #6D6D6D;\tleft: 5px;\tbottom: 3px;}.odSubmitBtn { position: absolute;\tcolor: #333;\tright: 5px;\tbottom: 5px;}";
-var T=new Spinner({left:"50%",lines:12,length:8,width:3,radius:5,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9}),V=new Editor,fa=null,y=null,d=null,p=!1,A=[],G=null,I=null;this.getSelectedItem=function(){null!=y&&(y=y.remoteItem?y.remoteItem:y,u(y));return y};if(null==l("#mxODPickerCss")){var L=document.head||document.getElementsByTagName("head")[0],P=document.createElement("style");L.appendChild(P);P.type="text/css";P.id="mxODPickerCss";
-P.appendChild(document.createTextNode(U))}b.innerHTML=O;var Q=l(".odPreview"),ba=l("#odFiles");b=function(Y,W){W=W||document;return W.querySelectorAll(Y)}(".odCatListTitle");for(O=0;O<b.length;O++)b[O].addEventListener("click",function(){y=I=null;if(!p)switch(R(this),this.id){case "odFiles":C();break;case "odRecent":C("recent");break;case "odShared":C("shared");break;case "odSharepoint":C("sharepoint")}});var X=null;b=l("#odSearchBox");b.addEventListener("input",function(){var Y=this.value;null!=
-X&&clearTimeout(X);X=setTimeout(function(){M(Y)},500)});b.addEventListener("keyup",function(Y){13==Y.keyCode&&(null!=X&&clearTimeout(X),M(this.value))});l("#refreshOD").addEventListener("click",function(){if(null!=G){k(null);var Y=A.slice();C.apply(this,G);A=Y}});J&&l("#odBackBtn").addEventListener("click",J);H&&l("#odSubmitBtn").addEventListener("click",v);null!=c?(J=c.pop(),"sharepoint"==c[0].driveId&&R(l("#odSharepoint")),A=c,C(J.driveId,J.folderId,J.siteId,J.name)):C()};App=function(b,k,m){EditorUi.call(this,b,k,null!=m?m:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var g=this.getCurrentFile();null!=g&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+g.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?"on":"off")})}));if(Editor.enableServiceWorker&&"serviceWorker"in navigator)try{navigator.serviceWorker.addEventListener("controllerchange",
+var T=new Spinner({left:"50%",lines:12,length:8,width:3,radius:5,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9}),V=new Editor,fa=null,y=null,d=null,p=!1,A=[],G=null,J=null;this.getSelectedItem=function(){null!=y&&(y=y.remoteItem?y.remoteItem:y,u(y));return y};if(null==l("#mxODPickerCss")){var L=document.head||document.getElementsByTagName("head")[0],P=document.createElement("style");L.appendChild(P);P.type="text/css";P.id="mxODPickerCss";
+P.appendChild(document.createTextNode(U))}b.innerHTML=O;var Q=l(".odPreview"),ba=l("#odFiles");b=function(Y,X){X=X||document;return X.querySelectorAll(Y)}(".odCatListTitle");for(O=0;O<b.length;O++)b[O].addEventListener("click",function(){y=J=null;if(!p)switch(R(this),this.id){case "odFiles":C();break;case "odRecent":C("recent");break;case "odShared":C("shared");break;case "odSharepoint":C("sharepoint")}});var W=null;b=l("#odSearchBox");b.addEventListener("input",function(){var Y=this.value;null!=
+W&&clearTimeout(W);W=setTimeout(function(){M(Y)},500)});b.addEventListener("keyup",function(Y){13==Y.keyCode&&(null!=W&&clearTimeout(W),M(this.value))});l("#refreshOD").addEventListener("click",function(){if(null!=G){k(null);var Y=A.slice();C.apply(this,G);A=Y}});I&&l("#odBackBtn").addEventListener("click",I);H&&l("#odSubmitBtn").addEventListener("click",v);null!=c?(I=c.pop(),"sharepoint"==c[0].driveId&&R(l("#odSharepoint")),A=c,C(I.driveId,I.folderId,I.siteId,I.name)):C()};App=function(b,k,m){EditorUi.call(this,b,k,null!=m?m:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var g=this.getCurrentFile();null!=g&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+g.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?"on":"off")})}));if(Editor.enableServiceWorker&&"serviceWorker"in navigator)try{navigator.serviceWorker.addEventListener("controllerchange",
mxUtils.bind(this,function(){try{var g=parseInt(localStorage.getItem(".drawio-channel-switch-ts"),10),q=Date.now()-g;!isNaN(q)&&0<=q&&6E5>q&&(null==this.getCurrentFile()||!this.getCurrentFile().isModified())&&window.location.reload()}catch(u){}}))}catch(g){}mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":
(new Image).src=mxGraph.prototype.warningImage.src;window.geOpenWindow=mxUtils.bind(this,function(g,q,u){if("1"==urlParams.openInSameWin||navigator.standalone)null!=u&&u();else{var x=null;try{x=window.open(g)}catch(z){}null==x||void 0===x?this.showDialog((new PopupDialog(this,g,q,u)).container,340,140,!0,!0):null!=q&&q()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(g){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(g)});this.editor.chromeless&&
!this.editor.editable||this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(b=0;b<App.DrawPlugins.length;b++)try{App.DrawPlugins[b](this)}catch(g){null!=window.console&&console.log("Plugin Error:",g,App.DrawPlugins[b])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(g){try{g(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=
@@ -15478,39 +15488,39 @@ mxLanguage))}catch(c){document.body.innerHTML="",D=document.createElement("pre")
"jgraph.github.io"===window.location.hostname||/drawio-dev\.pages\.dev$/.test(window.location.hostname))&&App.isSimpleThemePreferred()&&(Editor.currentTheme="simple")}catch(v){}"kennedy"!=Editor.currentTheme&&0>mxUtils.indexOf(Editor.themes,Editor.currentTheme)&&(Editor.currentTheme="kennedy");"1"==urlParams.transparent&&(document.body.style.background="transparent");var t=null!=k?k():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));"launchQueue"in window&&
"1"!=urlParams.embed&&window.launchQueue.setConsumer(function(v){null!=v.files&&0<v.files.length&&t.loadFileSystemEntry(v.files[0])});null!=window.mxscript&&("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},
"dropboxjs",App.DROPBOX_APPKEY)}):"undefined"===typeof window.Dropbox&&(window.DropboxClient=null),"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=
-null),"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null));null!=b&&b(t);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,t,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",
-EXPORT_URL))}catch(v){EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(v.stack)):(EditorUi.logError(v.message,null,null,null,v),window.setTimeout(function(){alert(v.message)},1))}}mxResources.parse(D[0].getText());try{"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(t){if(null!=t.active&&(t.active.postMessage({warmLazy:H,warmDev:"1"==urlParams.dev}),null!=Editor.defaultLanguages))for(var v=0;v<Editor.defaultLanguages.length;v++){var B=Editor.defaultLanguages[v];"string"===
-typeof B&&/^[a-z0-9-]+$/.test(B)&&t.active.postMessage({warmLazy:"resources/dia_"+B+".txt"})}})}catch(t){}if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var f=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=f){EditorUi.debug("Setting configuration",JSON.stringify(f));if(null!=f.merge){var l=localStorage.getItem(Editor.configurationKey);if(null!=l)try{var n=JSON.parse(l),r;for(r in f.merge)n[r]=f.merge[r];
-f=n}catch(t){window.location.hash="",alert(t)}else f=f.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(f)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(t){window.location.hash="",alert(t)}1<D.length&&(Graph.prototype.defaultThemes["default-style2"]=D[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=D[1].getDocumentElement());"1"==urlParams.dev||
-EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],c,function(t){document.body.innerHTML="";var v=document.createElement("pre");mxUtils.write(v,t.stack);document.body.appendChild(v)}))},function(D){D=document.getElementById("geStatus");null!=D&&(D.innerHTML="Error loading page. <a>Please try refreshing.</a>",D.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";g(mxResources.getDefaultBundle(RESOURCE_BASE,
-mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})};if(!App.isMainCalled)if(mxIsElectron&&"undefined"===typeof electron)alert("Runtime Environment not found."),document.body.innerHTML='<div style="grid-column:1 / -1;grid-row:1 / -1;margin-top:10%;text-align:center;"><img src="mxgraph/images/warning.png" align="top" style="padding-right:6px;"/>Runtime Environment not found.</div>';else{Editor.loadCompatibleCss();App.isMainCalled=!0;if("1"==urlParams.android||"0"!=urlParams.android&&
-!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC&&1<navigator.maxTouchPoints)mxClient.IS_ANDROID=!0;window.onerror=function(H,D,c,f,l){EditorUi.logError("Global: "+(null!=H?H:""),D,c,f,l,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",H,"\nURL:",D,"\nLine:",c,"\nColumn:",f,"\nError:",l)):console.error("Message:",H,"\nURL:",D,"\nLine:",c,"\nColumn:",f,"\nError:",l);window.setTimeout(function(){alert("Error: "+(null!=H?H:""))},100)};if(window.top!=window.self||
-"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&
-("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(H){var D="stable"==App.getReleaseChannel();D&&14<=App.getServiceWorkerFailures()&&(EditorUi.debug("App.main","Stable channel failing, reverting to beta"),
-App.setReleaseChannel(null),App.resetServiceWorkerFailures(),D=!1);var c=D?"stable/service-worker.js":"service-worker.js",f=null!=H?H.active||H.waiting||H.installing:null;null!=f&&D==/\/stable\/service-worker\.js$/.test(f.scriptURL)?(EditorUi.debug("App.main","Updating service worker"),H.update().then(function(){App.resetServiceWorkerFailures()})["catch"](function(l){App.logServiceWorkerError(c,l)})):null!=f||null!=App.getReleaseChannel()||!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||
-"1"==urlParams.enableSW?(EditorUi.debug("App.main","Installing service worker",c),navigator.serviceWorker.register(c,{scope:"./"}).then(function(){App.resetServiceWorkerFailures()})["catch"](function(l){App.logServiceWorkerError(c,l)})):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(H){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"1"==urlParams.local||
-"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var u=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var x=JSON.parse(localStorage.getItem(mxSettings.key));null!=x&&(u=x.plugins)}catch(H){}x=urlParams.p;App.initPluginCallback();null!=x&&App.loadPlugins(x.split(";"));
-if(null!=u&&0<u.length&&"0"!=urlParams.plugins)for(q=0;q<u.length;q++)try{("/"==u[q].charAt(0)&&(u[q]=PLUGINS_BASE_PATH+u[q]),App.isSameDomain(u[q]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(u[q])?null==App.pluginsLoaded[u[q]]&&(App.pluginsLoaded[u[q]]=!0,App.embedModePluginsCount++,mxscript(u[q])):null!=window.console&&console.log("Unknown plugin:",u[q]):null!=window.console&&console.log("Blocked plugin:",u[q])}catch(H){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=
-urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var z=window.opener||window.parent,F=function(H){if(H.source==z)try{var D=JSON.parse(H.data);null!=
-D&&"configure"==D.action&&(mxEvent.removeListener(window,"message",F),Editor.configure(D.config),mxSettings.load(),null!=D.config.darkColor&&document.body.style.setProperty("--dark-color",D.config.darkColor),D.colorSchemeMeta&&mxmeta("color-scheme","dark light"),m())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,H.data)}};mxEvent.addListener(window,"message",F);z.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",
-window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(H){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(H.stack)):console.error(H)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var J=localStorage.getItem(Editor.configurationKey);if(null!=J)try{J=JSON.parse(J),null!=J&&(EditorUi.debug("Using local configuration",J),Editor.configure(J),mxSettings.load())}catch(H){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(H.stack)):
-console.error(H)}}}m()}}else document.body.innerHTML='<div style="grid-column:1 / -1;grid-row:1 / -1;margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}}catch(H){document.body.innerHTML="",u=document.createElement("pre"),mxUtils.write(u,H.stack),document.body.appendChild(u)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;
-App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;
+null),"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null));null!=b&&b(t);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,t,(new Date).getTime()-t0.getTime()+"ms"]),EditorUi.debug("Export:",EXPORT_URL))}catch(v){EditorUi.isElectronApp?
+(mxLog.show(),mxLog.debug(v.stack)):(EditorUi.logError(v.message,null,null,null,v),window.setTimeout(function(){alert(v.message)},1))}}mxResources.parse(D[0].getText());try{"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(t){if(null!=t.active&&(t.active.postMessage({warmLazy:H,warmDev:"1"==urlParams.dev}),null!=Editor.defaultLanguages))for(var v=0;v<Editor.defaultLanguages.length;v++){var B=Editor.defaultLanguages[v];"string"===typeof B&&/^[a-z0-9-]+$/.test(B)&&t.active.postMessage({warmLazy:"resources/dia_"+
+B+".txt"})}})}catch(t){}if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var f=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=f){EditorUi.debug("Setting configuration",JSON.stringify(f));if(null!=f.merge){var l=localStorage.getItem(Editor.configurationKey);if(null!=l)try{var n=JSON.parse(l),r;for(r in f.merge)n[r]=f.merge[r];f=n}catch(t){window.location.hash="",alert(t)}else f=f.merge}confirm(mxResources.get("configLinkWarn"))&&
+confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(f)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(t){window.location.hash="",alert(t)}1<D.length&&(Graph.prototype.defaultThemes["default-style2"]=D[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=D[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js",
+"js/stencils.min.js","js/extensions.min.js"],c,function(t){document.body.innerHTML="";var v=document.createElement("pre");mxUtils.write(v,t.stack);document.body.appendChild(v)}))},function(D){D=document.getElementById("geStatus");null!=D&&(D.innerHTML="Error loading page. <a>Please try refreshing.</a>",D.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";g(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})};if(!App.isMainCalled)if(mxIsElectron&&
+"undefined"===typeof electron)alert("Runtime Environment not found."),document.body.innerHTML='<div style="grid-column:1 / -1;grid-row:1 / -1;margin-top:10%;text-align:center;"><img src="mxgraph/images/warning.png" align="top" style="padding-right:6px;"/>Runtime Environment not found.</div>';else{Editor.loadCompatibleCss();App.isMainCalled=!0;if("1"==urlParams.android||"0"!=urlParams.android&&!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC&&1<navigator.maxTouchPoints)mxClient.IS_ANDROID=!0;
+window.onerror=function(H,D,c,f,l){EditorUi.logError("Global: "+(null!=H?H:""),D,c,f,l,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",H,"\nURL:",D,"\nLine:",c,"\nColumn:",f,"\nError:",l)):console.error("Message:",H,"\nURL:",D,"\nLine:",c,"\nColumn:",f,"\nError:",l);window.setTimeout(function(){alert("Error: "+(null!=H?H:""))},100)};if(window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==
+window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=
+urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(H){var D="stable"==App.getReleaseChannel();D&&14<=App.getServiceWorkerFailures()&&(EditorUi.debug("App.main","Stable channel failing, reverting to beta"),App.setReleaseChannel(null),App.resetServiceWorkerFailures(),
+D=!1);var c=D?"stable/service-worker.js":"service-worker.js",f=null!=H?H.active||H.waiting||H.installing:null;null!=f&&D==/\/stable\/service-worker\.js$/.test(f.scriptURL)?(EditorUi.debug("App.main","Updating service worker"),H.update().then(function(){App.resetServiceWorkerFailures()})["catch"](function(l){App.logServiceWorkerError(c,l)})):null!=f||null!=App.getReleaseChannel()||!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main",
+"Installing service worker",c),navigator.serviceWorker.register(c,{scope:"./"}).then(function(){App.resetServiceWorkerFailures()})["catch"](function(l){App.logServiceWorkerError(c,l)})):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(H){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==
+urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var u=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var x=JSON.parse(localStorage.getItem(mxSettings.key));null!=x&&(u=x.plugins)}catch(H){}x=urlParams.p;App.initPluginCallback();null!=x&&App.loadPlugins(x.split(";"));if(null!=u&&0<u.length&&
+"0"!=urlParams.plugins)for(q=0;q<u.length;q++)try{("/"==u[q].charAt(0)&&(u[q]=PLUGINS_BASE_PATH+u[q]),App.isSameDomain(u[q]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(u[q])?null==App.pluginsLoaded[u[q]]&&(App.pluginsLoaded[u[q]]=!0,App.embedModePluginsCount++,mxscript(u[q])):null!=window.console&&console.log("Unknown plugin:",u[q]):null!=window.console&&console.log("Blocked plugin:",u[q])}catch(H){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||
+"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var z=window.opener||window.parent,F=function(H){if(H.source==z)try{var D=JSON.parse(H.data);null!=D&&"configure"==D.action&&(mxEvent.removeListener(window,
+"message",F),Editor.configure(D.config),mxSettings.load(),null!=D.config.darkColor&&document.body.style.setProperty("--dark-color",D.config.darkColor),D.colorSchemeMeta&&mxmeta("color-scheme","dark light"),m())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,H.data)}};mxEvent.addListener(window,"message",F);z.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),
+Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(H){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(H.stack)):console.error(H)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var I=localStorage.getItem(Editor.configurationKey);if(null!=I)try{I=JSON.parse(I),null!=I&&(EditorUi.debug("Using local configuration",I),Editor.configure(I),mxSettings.load())}catch(H){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(H.stack)):console.error(H)}}}m()}}else document.body.innerHTML=
+'<div style="grid-column:1 / -1;grid-row:1 / -1;margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}}catch(H){document.body.innerHTML="",u=document.createElement("pre"),mxUtils.write(u,H.stack),document.body.appendChild(u)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};
+App.pluginsLoaded={};App.embedModePluginsCount=0;
App.loadPlugins=function(b,k){EditorUi.debug("Loading plugins",b);for(var m=0;m<b.length;m++)if(null!=b[m]&&0<b[m].length)try{if(null!=App.pluginRegistry[b[m]]){var g=PLUGINS_BASE_PATH+App.pluginRegistry[b[m]];null==App.pluginsLoaded[g]&&(App.pluginsLoaded[g]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?k?mxinclude(g):mxscript(g):k?mxinclude(g):mxscript(drawDevUrl+g))}else null!=window.console&&console.log("Unknown plugin:",b[m])}catch(q){null!=window.console&&console.log("Error loading plugin:",
b[m],q)}};App.prototype.initializeEmbedMode=function(){"1"==urlParams.embed&&("app.diagrams.net"==window.location.hostname&&this.showBanner("EmbedDeprecationFooter","app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net."),0<App.embedModePluginsCount||this.initEmbedDone||(this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments)))};
App.prototype.initializeViewerMode=function(){var b=window.opener||window.parent;null!=b&&this.editor.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){b.postMessage(JSON.stringify(this.createLoadMessage("size")),"*")}))};
App.prototype.init=function(){if(!App.blockedAncestorFrames()){this.buttonContainer=this.createButtonContainer();EditorUi.prototype.init.apply(this,arguments);this.descriptorChangedListener=mxUtils.bind(this,this.descriptorChanged);this.addListener("currentThemeChanged",mxUtils.bind(this,function(){this.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(!0)}));Editor.isSettingsEnabled()&&null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode);
Editor.isSettingsEnabled()&&(null!=mxSettings.settings.shareCursorPosition&&(this.shareCursorPosition=mxSettings.settings.shareCursorPosition),null!=mxSettings.settings.showRemoteCursors&&(this.showRemoteCursors=mxSettings.settings.showRemoteCursors));try{this.gitHub="0"==urlParams.gh||"1"==urlParams.embed&&"1"!=urlParams.gh?null:new GitHubClient(this),null!=this.gitHub&&this.gitHub.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()}))}catch(u){null!=
window.console&&console.log("GitHubClient disabled: "+u.message)}try{this.gitLab="0"==urlParams.gl||"1"==urlParams.embed&&"1"!=urlParams.gl?null:new GitLabClient(this),null!=this.gitLab&&this.gitLab.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()}))}catch(u){null!=window.console&&console.log("GitLabClient disabled: "+u.message)}if("1"!=urlParams.embed||"1"==urlParams.od){var b=mxUtils.bind(this,function(){if("undefined"!==typeof OneDrive)try{this.oneDrive=
-new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();this.checkReleaseChannel(this.oneDrive)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))}catch(u){null!=window.console&&console.log("OneDriveClient disabled: "+u.message)}else null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=b)});b()}if("0"!=urlParams.ms365&&!EditorUi.isElectronApp)try{this.m365=new OneDriveClient(this,
-!1,!1,!1,!0),this.m365.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();this.checkReleaseChannel(this.m365)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.m365))}catch(u){null!=window.console&&console.log("M365Client disabled: "+u.message)}if("1"!=urlParams.embed||"1"==urlParams.tr){var k=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=new TrelloClient(this),this.trello.addListener("userChanged",
-mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(u){null!=window.console&&console.log("TrelloClient disabled: "+u.message)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=k)});k()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var m=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var u=mxUtils.bind(this,function(){try{this.drive=new DriveClient(this),
-this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense();this.checkReleaseChannel(this.drive)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(x){null!=window.console&&console.log("DriveClient disabled: "+x.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,u),window.DrawGapiClientCallback=null):u()}else null==
-window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=m)});m()}if("1"!=urlParams.embed||"1"==urlParams.db){var g=mxUtils.bind(this,function(){if("function"===typeof Dropbox){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(u){null!=window.console&&console.log("DropboxClient disabled: "+
-u.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=g)});g()}"1"!=urlParams.embed&&(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(u){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),mxUtils.bind(this,function(){u.prompt()}),
-!0,!0)})),!this.isOwnGDriveDomain()||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var u=this.getCurrentFile();u=null!=u?u.getMode():null;mxClient.IS_CHROMEAPP||mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||u!=App.MODE_DEVICE&&u!=App.MODE_BROWSER||this.showDownloadDesktopBanner();Editor.fitDiagramOnLoad&&this.fitInitialView()})),DrawioFileSync.checkCacheAlive(this));
-this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var q=mxUtils.bind(this,function(){"1"!=urlParams.embed?this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});this.addListener("languageChanged",q);this.addListener("currentThemeChanged",q);q()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&"1"!=urlParams.embed)&&this.setCompactMode(!0);
-if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.className="geSmallAppIcon","1"!=urlParams.embed&&(this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(u){this.appIconClicked(u)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&
+new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();this.checkReleaseChannel(this.oneDrive)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))}catch(u){null!=window.console&&console.log("OneDriveClient disabled: "+u.message)}else null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=b)});b()}if("0"!=urlParams.ms365&&!EditorUi.isElectronApp&&("1"!=urlParams.embed||
+"1"==urlParams.ms365))try{this.m365=new OneDriveClient(this,!1,!1,!1,!0),this.m365.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();this.checkReleaseChannel(this.m365)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.m365))}catch(u){null!=window.console&&console.log("M365Client disabled: "+u.message)}if("1"!=urlParams.embed||"1"==urlParams.tr){var k=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=
+new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(u){null!=window.console&&console.log("TrelloClient disabled: "+u.message)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=k)});k()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var m=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var u=mxUtils.bind(this,
+function(){try{this.drive=new DriveClient(this),this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense();this.checkReleaseChannel(this.drive)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(x){null!=window.console&&console.log("DriveClient disabled: "+x.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,u),
+window.DrawGapiClientCallback=null):u()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=m)});m()}if("1"!=urlParams.embed||"1"==urlParams.db){var g=mxUtils.bind(this,function(){if("function"===typeof Dropbox){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(u){null!=
+window.console&&console.log("DropboxClient disabled: "+u.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=g)});g()}"1"!=urlParams.embed&&(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(u){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),
+mxUtils.bind(this,function(){u.prompt()}),!0,!0)})),!this.isOwnGDriveDomain()||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var u=this.getCurrentFile();u=null!=u?u.getMode():null;mxClient.IS_CHROMEAPP||mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||u!=App.MODE_DEVICE&&u!=App.MODE_BROWSER||this.showDownloadDesktopBanner();Editor.fitDiagramOnLoad&&this.fitInitialView()})),
+DrawioFileSync.checkCacheAlive(this));this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var q=mxUtils.bind(this,function(){"1"!=urlParams.embed?this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});this.addListener("languageChanged",q);this.addListener("currentThemeChanged",q);q()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&
+"1"!=urlParams.embed)&&this.setCompactMode(!0);if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.className="geSmallAppIcon","1"!=urlParams.embed&&(this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(u){this.appIconClicked(u)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&
this.initializeViewerMode()}};App.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&b.substring(0,b.length-1);b="";for(var k=0;k<window.location.ancestorOrigins.length;k++)if(b+=" -> "+window.location.ancestorOrigins[k],b.endsWith("dan6v7pm1f1a1.cloudfront.net")||b.endsWith("confluence-cloud-excalidraw-2-ll3likebca-uc.a.run.app"))return!0}}catch(m){}return!1};
App.prototype.scheduleSanityCheck=function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=this.sanityCheckThread||(this.sanityCheckThread=window.setTimeout(mxUtils.bind(this,function(){this.sanityCheckThread=null;this.sanityCheck()}),this.warnInterval))};App.prototype.stopSanityCheck=function(){null!=this.sanityCheckThread&&(window.clearTimeout(this.sanityCheckThread),this.sanityCheckThread=null)};
App.prototype.sanityCheck=function(){var b=this.getCurrentFile();if(null!=b&&b.isModified()&&b.isAutosave()&&b.isOverdue()){b.getHash();b.savingFile&&null!=b.savingFileTime&&(Date.now(),b.savingFileTime.getTime());null!=b.ageStart&&(Date.now(),b.ageStart.getTime());b.isAutosave();null!=b.opened&&(Date.now(),b.opened.getTime());null!=b.lastSaved&&(Date.now(),b.lastSaved.getTime());null!=b.lastChanged&&(Date.now(),b.lastChanged.getTime());Date.now();App.startTime.getTime();var k=null!=b.sync?"client_"+
@@ -15529,7 +15539,7 @@ b.appendChild(u);this.bannerShowing=!0;var x=mxUtils.bind(this,function(){null!=
function(z){mxEvent.consume(z);x()}));mxEvent.addListener(q,"click",mxUtils.bind(this,function(z){mxEvent.consume(z);x()}));mxEvent.addListener(u,"click",mxUtils.bind(this,function(z){mxEvent.consume(z);window.open("https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence?hosting=datacenter&tab=reviews");x()}));k=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,120%)");window.setTimeout(mxUtils.bind(this,function(){x()}),1E3)});window.setTimeout(mxUtils.bind(this,
function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,0%)")}),500);window.setTimeout(k,6E4)}};
App.prototype.checkReleaseChannel=function(b){try{var k=null!=b?b.getUser():null,m=null!=k?k.email:null,g=null!=m?m.lastIndexOf("@"):-1;if(!(0>g)&&isLocalStorage&&Editor.enableServiceWorker&&"serviceWorker"in navigator&&null==urlParams.channel){var q=parseInt(localStorage.getItem(".drawio-channel-ts"),10),u=Date.now()-q;if(!(!isNaN(q)&&0<=u&&864E5>u)){localStorage.setItem(".drawio-channel-ts",String(Date.now()));var x=new XMLHttpRequest;x.open("POST","channel");x.setRequestHeader("Content-Type","application/json");
-x.onload=mxUtils.bind(this,function(){try{var z=null;if(404==x.status||405==x.status)z="beta";else if(200<=x.status&&299>=x.status){var F=JSON.parse(x.responseText);null==F||"stable"!=F.channel&&"beta"!=F.channel||(z=F.channel)}null!=z&&(F="stable"==z?"stable":null,F!=App.getReleaseChannel()&&(EditorUi.debug("App.checkReleaseChannel","Switching channel",z),App.setReleaseChannel(F),this.switchReleaseChannel()))}catch(J){}});x.send(JSON.stringify({domain:m.substring(g+1)}))}}}catch(z){}};
+x.onload=mxUtils.bind(this,function(){try{var z=null;if(404==x.status||405==x.status)z="beta";else if(200<=x.status&&299>=x.status){var F=JSON.parse(x.responseText);null==F||"stable"!=F.channel&&"beta"!=F.channel||(z=F.channel)}null!=z&&(F="stable"==z?"stable":null,F!=App.getReleaseChannel()&&(EditorUi.debug("App.checkReleaseChannel","Switching channel",z),App.setReleaseChannel(F),this.switchReleaseChannel()))}catch(I){}});x.send(JSON.stringify({domain:m.substring(g+1)}))}}}catch(z){}};
App.prototype.switchReleaseChannel=function(){try{var b="stable"==App.getReleaseChannel()?"stable/service-worker.js":"service-worker.js";localStorage.setItem(".drawio-channel-switch-ts",String(Date.now()));navigator.serviceWorker.register(b,{scope:"./"}).then(mxUtils.bind(this,function(k){var m=mxUtils.bind(this,function(g){null!=g&&g.addEventListener("statechange",mxUtils.bind(this,function(){"activated"!=g.state||null!=this.getCurrentFile()&&this.getCurrentFile().isModified()||window.location.reload()}))});
null!=k.installing?m(k.installing):k.addEventListener("updatefound",function(){m(k.installing)})}),function(k){})}catch(k){}};
App.prototype.checkLicense=function(){var b=this.drive.getUser(),k=null!=b?b.email:null;if(!this.isOffline()&&!this.editor.chromeless&&null!=k&&null!=b.id){var m=k.lastIndexOf("@"),g=0<=m?k.substring(m+1):"";b=Editor.crc32(b.id);"gmail.com"!==g.toLowerCase()&&mxUtils.post("/license","domain="+encodeURIComponent(g)+"&id="+encodeURIComponent(b)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(q){try{if(200<=q.getStatus()&&299>=q.getStatus()){var u=q.getText();if(0<u.length){var x=JSON.parse(u);
@@ -15538,8 +15548,8 @@ App.prototype.addRecent=function(b,k,m){if(isLocalStorage&&null!=localStorage){k
App.prototype.resetRecent=function(b){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent"+(null!=b?b:""))}catch(k){}};
App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");this.unloading=!0;var b=this.getCurrentFile();if(null!=b)if(b.constructor!=LocalFile||""!=b.getHash()||b.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()||null!=b.fileHandle){if(b.isModified())return this.logIfModified(b),mxResources.get("allChangesLost");b.close(!0)}else return mxResources.get("ensureDataSaved")};
App.prototype.updateDocumentTitle=function(){var b=this.editor.appName,k=this.getCurrentFile();null==k||!this.editor.graph.isLightboxView()&&"simple"!=Editor.currentTheme||null==this.pages||null==this.currentPage?this.isOfflineApp()&&(b+=" app"):b=this.getShortPageName(this.currentPage);null!=k&&(b=(null!=k.getTitle()?k.getTitle():this.defaultFilename)+" - "+b);document.title!=b&&(document.title=b)};
-App.prototype.getThumbnail=function(b,k,m){m=null!=m?m:0;var g=!1;try{var q=!0,u=window.setTimeout(mxUtils.bind(this,function(){q=!1;k(null)}),this.timeout),x=mxUtils.bind(this,function(M){window.clearTimeout(u);q&&k(M)});null==this.thumbImageCache&&(this.thumbImageCache={});var z=this.editor.graph,F=z.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var J=z.getGlobalVariable;z=this.createTemporaryGraph(z.getStylesheet());z.setBackgroundImage=this.editor.graph.setBackgroundImage;
-var H=this.pages[0];this.currentPage==H?(z.mathEnabled=this.editor.graph.mathEnabled,z.setBackgroundImage(F)):null!=H.viewState&&null!=H.viewState&&(z.mathEnabled=H.viewState.mathEnabled,F=H.viewState.backgroundImage,z.setBackgroundImage(F));z.getGlobalVariable=function(M){return"page"==M?H.getName():"pagenumber"==M?1:J.apply(this,arguments)};z.getGlobalVariable=J;document.body.appendChild(z.container);z.model.setRoot(H.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,
+App.prototype.getThumbnail=function(b,k,m){m=null!=m?m:0;var g=!1;try{var q=!0,u=window.setTimeout(mxUtils.bind(this,function(){q=!1;k(null)}),this.timeout),x=mxUtils.bind(this,function(M){window.clearTimeout(u);q&&k(M)});null==this.thumbImageCache&&(this.thumbImageCache={});var z=this.editor.graph,F=z.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var I=z.getGlobalVariable;z=this.createTemporaryGraph(z.getStylesheet());z.setBackgroundImage=this.editor.graph.setBackgroundImage;
+var H=this.pages[0];this.currentPage==H?(z.mathEnabled=this.editor.graph.mathEnabled,z.setBackgroundImage(F)):null!=H.viewState&&null!=H.viewState&&(z.mathEnabled=H.viewState.mathEnabled,F=H.viewState.backgroundImage,z.setBackgroundImage(F));z.getGlobalVariable=function(M){return"page"==M?H.getName():"pagenumber"==M?1:I.apply(this,arguments)};z.getGlobalVariable=I;document.body.appendChild(z.container);z.model.setRoot(H.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,
function(M){try{z!=this.editor.graph&&null!=z.container.parentNode&&z.container.parentNode.removeChild(z.container)}catch(O){M=null}x(M)}),b,this.thumbImageCache,"#ffffff",function(){x()},null,null,null,null,null,null,z,m,null,null,null,"diagram",null),g=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var D=document.createElement("canvas"),c=z.getGraphBounds(),f=z.view.translate,l=z.view.scale;null!=F&&(c=mxRectangle.fromRectangle(c),c.add(new mxRectangle((f.x+F.x)*l,(f.y+F.y)*l,F.width*
l,F.height*l)));var n=b/c.width;n=Math.min(1,Math.min(3*b/(4*c.height),n));var r=Math.floor(c.x),t=Math.floor(c.y);D.setAttribute("width",Math.ceil(n*(c.width+4)));D.setAttribute("height",Math.ceil(n*(c.height+4)));var v=D.getContext("2d");v.scale(n,n);v.translate(-r,-t);var B=z.background;if(null==B||""==B||B==mxConstants.NONE)B="#ffffff";v.save();v.fillStyle=B;v.fillRect(r,t,Math.ceil(c.width+4),Math.ceil(c.height+4));v.restore();if(null!=F){var E=new Image;E.src=F.src;v.drawImage(E,F.x*n,F.y*n,
F.width*n,F.height*n)}var K=new mxJsCanvas(D),C=new mxAsyncCanvas(this.thumbImageCache);K.images=this.thumbImageCache.images;var R=new mxImageExport;R.drawShape=function(M,O){M.shape instanceof mxShape&&M.shape.checkBounds()&&(O.save(),O.translate(.5,.5),M.shape.paint(O),O.translate(-.5,-.5),O.restore())};R.drawText=function(M,O){};R.drawState(z.getView().getState(z.model.root),C);C.finish(mxUtils.bind(this,function(){try{R.drawState(z.getView().getState(z.model.root),K),z!=this.editor.graph&&null!=
@@ -15558,22 +15568,22 @@ App.prototype.showRefreshDialog=function(b,k){this.showingRefreshDialog||(this.s
App.prototype.showAlert=function(b){if(null!=b&&0<b.length){var k=document.createElement("div");k.className="geAlert";k.style.zIndex=2E9;k.style.left="50%";k.style.top="-100%";k.style.maxWidth="80%";k.style.width="max-content";k.style.whiteSpace="pre-wrap";mxUtils.setPrefixedStyle(k.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(k.style,"transition","all 1s ease");k.innerHTML=b;b=document.createElement("a");b.className="geAlertLink";b.style.textAlign="right";b.style.marginTop="20px";
b.style.display="block";b.setAttribute("title",mxResources.get("close"));b.innerHTML=mxResources.get("close");k.appendChild(b);mxEvent.addListener(b,"click",function(m){null!=k.parentNode&&(k.parentNode.removeChild(k),mxEvent.consume(m))});document.body.appendChild(k);window.setTimeout(function(){k.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(k.style,"transition","all 2s ease");k.style.opacity="0";window.setTimeout(function(){null!=k.parentNode&&k.parentNode.removeChild(k)},
2E3)},15E3)}};
-App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(x,z,F,J,H){"ResizeObserver loop limit exceeded"!=x&&((null==x||0>x.indexOf("Invalid or unexpected token"))&&EditorUi.logError("Uncaught: "+(null!=x?x:""),z,F,J,H,null,!0),b.handleError({message:x},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(x){var z=
-this.getCurrentFile();EditorUi.debug("storage event",[x],[z]);null!=z&&".draft-alive-check"==x.key&&null!=x.newValue&&null!=z.draftId&&(this.draftAliveCheck=x.newValue,z.saveDraft())}))}catch(x){}var k=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(x){try{var z=this.getDiagramId();if(z!=k){k=z;var F=this.getCurrentFile();null!=F&&F.getHash()==z||this.loadFile(z,!0)}else{var J=this.getHashObject();if(null!=J&&null!=J.pageId&&null!=this.currentPage&&J.pageId!=
-this.currentPage.getId()){var H=this.getPageById(J.pageId);null!=H&&this.selectPage(H)}}}catch(D){null!=document.body&&this.handleError(D,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.desc)try{this.loadDescriptor(JSON.parse(Graph.decompress(urlParams.desc)),null,mxUtils.bind(this,function(x){this.handleError(x,mxResources.get("errorLoadingFile"))}))}catch(x){this.handleError(x,
-mxResources.get("errorLoadingFile"))}else if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var m=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var x=mxUtils.bind(this,function(J){Editor.isPngDataUrl(J)&&(J=Editor.extractGraphModelFromPng(J));var H=urlParams.title;H=null!=H?decodeURIComponent(H):
-this.defaultFilename;J=new LocalFile(this,J,H,!0);this.fileLoaded(J);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(J.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),z=window.opener||window.parent;if(z!=window){var F=urlParams.create;null!=F?x(z[decodeURIComponent(F)]):(F=urlParams.data,null!=F?x(decodeURIComponent(F)):this.spinner.spin(document.body,mxResources.get("loading"))&&
-this.createTimeout(2E3,mxUtils.bind(this,function(J){this.installMessageHandler(mxUtils.bind(this,function(H,D){D.source==z&&J.clear()&&(this.spinner.stop(),x(H))}))}),mxUtils.bind(this,function(J){this.handleError(J)})))}}else if(null==this.dialog)if("1"==urlParams.demo)F=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=F;else{F=!1;try{F=null!=window.opener&&null!=window.opener.openFile}catch(J){}F?this.spinner.spin(document.body,
-mxResources.get("loading")):(F=this.getDiagramId(),!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=F&&0!=F.length||this.editor.isChromelessView()?null!=F&&0<F.length?this.loadFile(F,null,null,mxUtils.bind(this,function(){var J=EditorUi.getViewBoxParam();null!=J&&this.applyViewBox(J)})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.checkDrafts())}}),
+App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(x,z,F,I,H){"ResizeObserver loop limit exceeded"!=x&&((null==x||0>x.indexOf("Invalid or unexpected token"))&&EditorUi.logError("Uncaught: "+(null!=x?x:""),z,F,I,H,null,!0),b.handleError({message:x},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(x){var z=
+this.getCurrentFile();EditorUi.debug("storage event",[x],[z]);null!=z&&".draft-alive-check"==x.key&&null!=x.newValue&&null!=z.draftId&&(this.draftAliveCheck=x.newValue,z.saveDraft())}))}catch(x){}var k=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(x){try{var z=this.getDiagramId();if(z!=k){k=z;var F=this.getCurrentFile();null!=F&&F.getHash()==z||this.loadFile(z,!0)}else{var I=this.getHashObject();if(null!=I&&null!=I.pageId&&null!=this.currentPage&&I.pageId!=
+this.currentPage.getId()){var H=this.getPageById(I.pageId);null!=H&&this.selectPage(H)}}}catch(D){null!=document.body&&this.handleError(D,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.desc)try{this.loadDescriptor(JSON.parse(Graph.decompress(urlParams.desc)),null,mxUtils.bind(this,function(x){this.handleError(x,mxResources.get("errorLoadingFile"))}))}catch(x){this.handleError(x,
+mxResources.get("errorLoadingFile"))}else if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var m=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var x=mxUtils.bind(this,function(I){Editor.isPngDataUrl(I)&&(I=Editor.extractGraphModelFromPng(I));var H=urlParams.title;H=null!=H?decodeURIComponent(H):
+this.defaultFilename;I=new LocalFile(this,I,H,!0);this.fileLoaded(I);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(I.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),z=window.opener||window.parent;if(z!=window){var F=urlParams.create;null!=F?x(z[decodeURIComponent(F)]):(F=urlParams.data,null!=F?x(decodeURIComponent(F)):this.spinner.spin(document.body,mxResources.get("loading"))&&
+this.createTimeout(2E3,mxUtils.bind(this,function(I){this.installMessageHandler(mxUtils.bind(this,function(H,D){D.source==z&&I.clear()&&(this.spinner.stop(),x(H))}))}),mxUtils.bind(this,function(I){this.handleError(I)})))}}else if(null==this.dialog)if("1"==urlParams.demo)F=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=F;else{F=!1;try{F=null!=window.opener&&null!=window.opener.openFile}catch(I){}F?this.spinner.spin(document.body,
+mxResources.get("loading")):(F=this.getDiagramId(),!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=F&&0!=F.length||this.editor.isChromelessView()?null!=F&&0<F.length?this.loadFile(F,null,null,mxUtils.bind(this,function(){var I=EditorUi.getViewBoxParam();null!=I&&this.applyViewBox(I)})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.checkDrafts())}}),
g=decodeURIComponent(urlParams.create||"");null!=window.location.hash&&"#create="==window.location.hash.substring(0,8)&&(g=decodeURIComponent(window.location.hash.substring(8)));null!=urlParams["smart-template"]&&(null==window.location.hash||1>=window.location.hash.length)&&(g=JSON.stringify({type:"generate",data:decodeURIComponent(urlParams["smart-template"])}));if((null==window.location.hash||1>=window.location.hash.length)&&0<g.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var q=
mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),u=mxUtils.bind(this,function(x){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,x,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var z=urlParams.title;z=null!=z?decodeURIComponent(z):this.defaultFilename;x=this.getServiceCount(!0);isLocalStorage&&x++;var F=4>=x?2:6<x?4:3;z=new CreateDialog(this,
-z,mxUtils.bind(this,function(J,H){try{if(null==H){this.hideDialog();var D=Editor.useLocalStorage;this.createFile(0<J.length?J:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=D}else this.pickFolder(H,mxUtils.bind(this,function(c){try{this.createFile(J,this.getFileData(!0),null,H,null,!0,c)}catch(f){this.handleError(f)}}))}catch(c){this.handleError(c)}}),null,null,null,null,"1"==urlParams.browser,null,null,!0,F,null,null,null,this.editor.fileExtensions);this.showDialog(z.container,
-420,x>F?390:280,!0,!1,mxUtils.bind(this,function(J){J&&null==this.getCurrentFile()&&this.showSplash()}));z.init()}});if("http://"!=g.substring(0,7)&&"https://"!=g.substring(0,8))try{if("{"==g.charAt(0))this.executeCreateObject(JSON.parse(decodeURIComponent(g)),mxUtils.bind(this,function(){window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]))}));else if(null!=window.opener&&null!=window.opener[g])u(window.opener[g]);else throw Error(mxResources.get("invalidCallFnNotFound",
+z,mxUtils.bind(this,function(I,H){try{if(null==H){this.hideDialog();var D=Editor.useLocalStorage;this.createFile(0<I.length?I:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=D}else this.pickFolder(H,mxUtils.bind(this,function(c){try{this.createFile(I,this.getFileData(!0),null,H,null,!0,c)}catch(f){this.handleError(f)}}))}catch(c){this.handleError(c)}}),null,null,null,null,"1"==urlParams.browser,null,null,!0,F,null,null,null,this.editor.fileExtensions);this.showDialog(z.container,
+420,x>F?390:280,!0,!1,mxUtils.bind(this,function(I){I&&null==this.getCurrentFile()&&this.showSplash()}));z.init()}});if("http://"!=g.substring(0,7)&&"https://"!=g.substring(0,8))try{if("{"==g.charAt(0))this.executeCreateObject(JSON.parse(decodeURIComponent(g)),mxUtils.bind(this,function(){window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]))}));else if(null!=window.opener&&null!=window.opener[g])u(window.opener[g]);else throw Error(mxResources.get("invalidCallFnNotFound",
["window.opener."+g]));}catch(x){this.handleError(x,mxResources.get("errorLoadingFile"))}else this.loadTemplate(g,function(x){u(x)},mxUtils.bind(this,function(x){this.handleError(x,mxResources.get("errorLoadingFile"),q)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action?null!=this.stateArg.ids&&(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state",
"splash"])),window.location.hash="G"+this.stateArg.ids[0]):(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),this.setMode(App.MODE_GOOGLE),"0"==urlParams.splash?this.createFile(null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename):this.actions.get("new").funct()):
(null!=urlParams.open&&window.history&&window.history.replaceState&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["open","sketch"])),window.location.hash=urlParams.open),m())}}catch(x){this.handleError(x)}};
-App.prototype.executeCreateObject=function(b,k){try{EditorUi.debug("App.executeCreateObject",[this],"value",[b]);var m=mxUtils.bind(this,function(x){this.spinner.stop();this.createFile(null!=b.filename?b.filename:this.defaultFilename,x,null,null,mxUtils.bind(this,function(){null!=urlParams.pv&&this.setPageVisible("1"==urlParams.pv);null!=urlParams.grid&&this.editor.graph.setGridEnabled("1"==urlParams.grid);var z=mxUtils.bind(this,function(){this.initialFitDiagram(1.2);if("pop"==b.effect){var J=this.editor.graph,
-H=J.model.getDescendants(J.model.getRoot()),D=J.getNodesForCells(H);Graph.setOpacityForNodes(D,0);window.setTimeout(mxUtils.bind(this,function(){var c=J.createPopAnimations(H,!0);J.executeAnimations(c)}),200)}null!=k&&k();b.type="xml";b.compressed=!0;b.data=Graph.compress(null!=b.layout||b.applyLayouts?mxUtils.getXml(this.editor.getGraphXml()):x);delete b.layout;delete b.applyLayouts;window.location.hash="create="+encodeURIComponent(JSON.stringify(b))}),F=mxUtils.bind(this,function(){null!=b.layout?
+App.prototype.executeCreateObject=function(b,k){try{EditorUi.debug("App.executeCreateObject",[this],"value",[b]);var m=mxUtils.bind(this,function(x){this.spinner.stop();this.createFile(null!=b.filename?b.filename:this.defaultFilename,x,null,null,mxUtils.bind(this,function(){null!=urlParams.pv&&this.setPageVisible("1"==urlParams.pv);null!=urlParams.grid&&this.editor.graph.setGridEnabled("1"==urlParams.grid);var z=mxUtils.bind(this,function(){this.initialFitDiagram(1.2);if("pop"==b.effect){var I=this.editor.graph,
+H=I.model.getDescendants(I.model.getRoot()),D=I.getNodesForCells(H);Graph.setOpacityForNodes(D,0);window.setTimeout(mxUtils.bind(this,function(){var c=I.createPopAnimations(H,!0);I.executeAnimations(c)}),200)}null!=k&&k();b.type="xml";b.compressed=!0;b.data=Graph.compress(null!=b.layout||b.applyLayouts?mxUtils.getXml(this.editor.getGraphXml()):x);delete b.layout;delete b.applyLayouts;window.location.hash="create="+encodeURIComponent(JSON.stringify(b))}),F=mxUtils.bind(this,function(){null!=b.layout?
this.executeLayoutSpec(b.layout,z):z()});b.applyLayouts?this.applyChildLayouts(F):F()}),!0,null,!0)}),g=b.data;b.compressed&&(g=Graph.decompress(g));if("mermaid"==b.type)if(EditorUi.isMermaidSupported()){var q=mxUtils.bind(this,function(x){this.handleError(x)});b.image?this.parseMermaidImage(g,mxUtils.bind(this,function(x){m(x)}),q):this.parseMermaidDiagram(g,null,mxUtils.bind(this,function(x){m(mxMermaidToDrawio.wrapGroup(x,g,EditorUi.getInsertMermaidConfig()))}),q)}else throw Error(mxResources.get("serviceUnavailableOrBlocked"));
else if("generate"==b.type&&this.spinner.spin(document.body,mxResources.get("generate")+" '"+g+"'"))this.generateOpenAiMermaidDiagram(g,function(x){m(x)},mxUtils.bind(this,function(x){this.handleError(x,mxResources.get("errorLoadingFile"))}),{complexity:"high"});else if("csv"==b.type){var u=this.createTemporaryGraph(this.editor.graph.getStylesheet());this.importCsv(g,mxUtils.bind(this,function(){var x=new mxCodec;m(mxUtils.getXml(x.encode(u.getModel())))}),u,!0)}else if("xml"==b.type)m(g);else throw Error(mxResources.get("invalidCallFnNotFound",
[b.type]));}catch(x){this.handleError(x,mxResources.get("errorLoadingFile"))}};
@@ -15581,7 +15591,7 @@ App.prototype.openGenerateDialog=function(b){if(null==this.chatWindow){var k=mxS
this.chatWindow);null!=k&&null==b?this.restoreWindowState("chat",this.chatWindow):this.chatWindow.window.setVisible(!0);this.fireEvent(new mxEventObject("chat"))}else this.chatWindow.window.setVisible(!0);null!=b&&this.chatWindow.generate(b)};
App.prototype.openTemplateDialog=function(b){var k=this.editor.graph;k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&(b=new NewDialog(this,null,!1,mxUtils.bind(this,function(m){this.hideDialog();if(null!=m){var g=this.editor.graph.getFreeInsertPoint(!0);k.setSelectionCells(this.importXml(m,Math.max(g.x,20),Math.max(g.y,20),!0,null,null,!0));k.scrollCellToVisible(k.getSelectionCell())}}),null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"),null,null,b),this.showDialog(b.container,
620,460,!0,!0,mxUtils.bind(this,function(){this.sidebar.hideTooltip()})),b.init())};App.prototype.loadDraft=function(b,k){this.createFile(this.defaultFilename,b,null,null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){var m=this.getCurrentFile();null!=m&&(m.fileChanged(),null!=k&&k())}),0)}),null,null,!0)};
-App.prototype.filterDrafts=function(b,k,m){function g(){m(q)}var q=[];try{this.getDatabaseItems(mxUtils.bind(this,function(u){EditorUi.debug("App.filterDrafts",[this],"items",u);for(var x=0;x<u.length;x++)try{var z=u[x].key;if(null!=z&&".draft_"==z.substring(0,7)){var F=JSON.parse(u[x].data);null!=F&&"draft"==F.type&&F.aliveCheck!=k&&(null==b&&null==F.fileObject||null!=F.fileObject&&F.fileObject.path==b)&&(this.isDiagramDataEmpty(F.data)?this.removeDatabaseItem(z):(F.key=z,q.push(F)))}}catch(J){}g()}),
+App.prototype.filterDrafts=function(b,k,m){function g(){m(q)}var q=[];try{this.getDatabaseItems(mxUtils.bind(this,function(u){EditorUi.debug("App.filterDrafts",[this],"items",u);for(var x=0;x<u.length;x++)try{var z=u[x].key;if(null!=z&&".draft_"==z.substring(0,7)){var F=JSON.parse(u[x].data);null!=F&&"draft"==F.type&&F.aliveCheck!=k&&(null==b&&null==F.fileObject||null!=F.fileObject&&F.fileObject.path==b)&&(this.isDiagramDataEmpty(F.data)?this.removeDatabaseItem(z):(F.key=z,q.push(F)))}}catch(I){}g()}),
g)}catch(u){g()}};
App.prototype.checkDrafts=function(){try{var b=Editor.guid();localStorage.setItem(".draft-alive-check",b);window.setTimeout(mxUtils.bind(this,function(){localStorage.removeItem(".draft-alive-check");this.filterDrafts(null,b,mxUtils.bind(this,function(k){if(1==k.length)this.loadDraft(k[0].data,mxUtils.bind(this,function(){this.removeDatabaseItem(k[0].key)}));else if(1<k.length){var m=new Date(k[0].modified);m=new DraftDialog(this,1<k.length?mxResources.get("selectDraft"):mxResources.get("draftFound",[m.toLocaleDateString()+
" "+m.toLocaleTimeString()]),1<k.length?null:k[0].data,mxUtils.bind(this,function(g){this.hideDialog();g=""!=g&&null!=k[g]?g:0;this.loadDraft(k[g].data,mxUtils.bind(this,function(){this.removeDatabaseItem(k[g].key)}))}),mxUtils.bind(this,function(g,q){this.removeDatabaseItem(k[""!=g?g:0].key);null!=q&&q()}),null,null,null,1<k.length?k:null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(g){if(g)if("0"!=urlParams.splash)this.loadFile();else try{this.createFile(this.defaultFilename,
@@ -15591,14 +15601,14 @@ mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash
App.prototype.addLanguageMenu=function(b,k,m){var g=null;null!=this.menus.get("language")&&(g=document.createElement("div"),this.setElementTitle(g,"language"),g.className="geAdaptiveAsset",g.style.backgroundImage="url("+Editor.globeImage+")",g.style.backgroundPosition="right center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="19px 19px",g.style.width="19px",g.style.height="19px",mxUtils.setOpacity(g,40),g.style.position="absolute",g.style.cursor="pointer",g.style.bottom="20px",g.style.right=
null!=m?m:"22px",k&&(g.style.direction="rtl",g.style.textAlign="right",g.style.right=null!=m?m:"24px",k=document.createElement("span"),k.style.display="inline-block",k.style.fontSize="12px",k.style.margin="2px 24px 0 0",k.style.userSelect="none",mxUtils.write(k,mxResources.get("language")),g.appendChild(k),k.className="geAdaptiveAsset"),mxEvent.addListener(g,"click",mxUtils.bind(this,function(q){this.editor.graph.popupMenuHandler.hideMenu();var u=new mxPopupMenu(this.menus.get("language").funct);
u.smartSeparators=!0;u.showDisabled=!0;u.autoExpand=!0;u.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(u,arguments);u.destroy()});var x=mxUtils.getOffset(g);u.popup(x.x,x.y+g.offsetHeight,null,q);this.setCurrentMenu(u)})),b.appendChild(g));return g};
-App.prototype.loadFileSystemEntry=function(b,k,m){m=null!=m?m:mxUtils.bind(this,function(g){this.handleError(g)});try{b.getFile().then(mxUtils.bind(this,function(g){var q=new FileReader;q.onload=mxUtils.bind(this,function(u){var x=mxUtils.bind(this,function(z){try{if(null!=k){var F=u.target.result;"image/png"==g.type&&(F=this.extractGraphModelFromPng(F));k(new LocalFile(this,F,g.name,null,b,g,z))}else this.openFileHandle(u.target.result,g.name,g,!1,b,z)}catch(J){m(J)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,
+App.prototype.loadFileSystemEntry=function(b,k,m){m=null!=m?m:mxUtils.bind(this,function(g){this.handleError(g)});try{b.getFile().then(mxUtils.bind(this,function(g){var q=new FileReader;q.onload=mxUtils.bind(this,function(u){var x=mxUtils.bind(this,function(z){try{if(null!=k){var F=u.target.result;"image/png"==g.type&&(F=this.extractGraphModelFromPng(F));k(new LocalFile(this,F,g.name,null,b,g,z))}else this.openFileHandle(u.target.result,g.name,g,!1,b,z)}catch(I){m(I)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,
function(z){x("denied"!==z)})):b.createWritable().then(mxUtils.bind(this,function(){x(!0)}),mxUtils.bind(this,function(z){x(!1)}))});q.onerror=m;"image"!==g.type.substring(0,5)&&"application/pdf"!==g.type||"image/svg"===g.type.substring(0,9)?q.readAsText(g):q.readAsDataURL(g)}),m)}catch(g){m(g)}};
App.prototype.createFileSystemOptions=function(b){var k=[],m=null;if(null!=b){var g=b.lastIndexOf(".");0<g&&(m=b.substring(g+1))}for(g=0;g<this.editor.diagramFileTypes.length;g++){var q={description:mxResources.get(this.editor.diagramFileTypes[g].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[g].extension+")":""),accept:{}};q.accept[this.editor.diagramFileTypes[g].mimeType]=["."+this.editor.diagramFileTypes[g].extension];this.editor.diagramFileTypes[g].extension==m?k.splice(0,0,
q):this.editor.diagramFileTypes[g].extension==m?k.splice(0,0,q):k.push(q)}return{types:k,suggestedName:b}};App.prototype.showSaveFilePicker=function(b,k,m){k=null!=k?k:mxUtils.bind(this,function(g){"AbortError"!=g.name&&this.handleError(g)});m=null!=m?m:this.createFileSystemOptions();window.showSaveFilePicker(m).then(mxUtils.bind(this,function(g){null!=g&&g.getFile().then(mxUtils.bind(this,function(q){b(g,q)}),k)}),k)};
App.prototype.pickFile=function(b){try{if(b=null!=b?b:this.mode,b==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var k=this.getServiceForName(b);if(null!=k)k.pickFile();else if(b==App.MODE_DEVICE&&EditorUi.nativeFileSupport)window.showOpenFilePicker().then(mxUtils.bind(this,function(x){null!=x&&0<x.length&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(x[0])}),
mxUtils.bind(this,function(x){"AbortError"!=x.name&&this.handleError(x)}));else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var m=document.createElement("input");m.setAttribute("type","file");mxEvent.addListener(m,"change",mxUtils.bind(this,function(){null!=m.files&&(this.openFiles(m.files),m.type="",m.type="file",m.value="")}));m.style.display="none";document.body.appendChild(m);this.openFileInputElt=m}this.openFileInputElt.click()}else{this.hideDialog();window.openNew=
null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(x,z){StorageFile.listFiles(this,"F",x,z)});window.openBrowserFile=mxUtils.bind(this,function(x,z,F){StorageFile.getFileContent(this,x,z,F)});window.deleteBrowserFile=mxUtils.bind(this,function(x,z,F){StorageFile.deleteFile(this,x,z,F)});var g=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,
-function(x,z,F){var J=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=z.substring(z.length-4)||(z=z.substring(0,z.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,x,z):new LocalFile(this,x,z,F));var D=this.getCurrentFile();F&&null!=D&&D.fileChanged()}),H=this.getCurrentFile();null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),null,J,mxResources.get("cancel"),mxResources.get("discardChanges")):J()}));var q=this.dialog,u=q.close;this.dialog.close=
+function(x,z,F){var I=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=z.substring(z.length-4)||(z=z.substring(0,z.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,x,z):new LocalFile(this,x,z,F));var D=this.getCurrentFile();F&&null!=D&&D.fileChanged()}),H=this.getCurrentFile();null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):I()}));var q=this.dialog,u=q.close;this.dialog.close=
mxUtils.bind(this,function(x){Editor.useLocalStorage=g;u.apply(q,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(x){this.handleError(x)}};
App.prototype.pickLibrary=function(b){b=null!=b?b:this.mode;var k=mxUtils.bind(this,function(u){try{this.loadLibrary(u);this.showSidebar();try{this.sidebar.palettes[u.getHash()][0].scrollIntoView({behavior:"smooth"})}catch(x){}}catch(x){this.handleError(x,mxResources.get("errorLoadingFile"))}});if(b==App.MODE_GOOGLE||b==App.MODE_DROPBOX||b==App.MODE_ONEDRIVE||b==App.MODE_GITHUB||b==App.MODE_GITLAB||b==App.MODE_TRELLO){var m=b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_GITHUB?
this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:this.dropbox;null!=m&&m.pickLibrary(mxUtils.bind(this,function(u,x){null!=x?k(x):this.spinner.spin(document.body,mxResources.get("loading"))&&m.getLibrary(u,mxUtils.bind(this,function(z){this.spinner.stop();k(z)}),mxUtils.bind(this,function(z){this.handleError(z,null!=z?mxResources.get("errorLoadingFile"):null)}))}))}else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var g=document.createElement("input");
@@ -15609,33 +15619,33 @@ App.prototype.saveLibrary=function(b,k,m,g,q,u,x){try{g=null!=g?g:this.mode;q=nu
this.drive.insertFile(b,z,D,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),F,this.drive.libraryMimeType):g==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,z,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),F,D):g==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,
z,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),F,D):g==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,z,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),F,D):g==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,z,mxUtils.bind(this,function(c){this.spinner.stop();
this.hideDialog(!0);this.libraryLoaded(c,k)}),F,D):g==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,z,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),F,D):g==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,z,b),mxUtils.bind(this,function(c){this.hideDialog(!0);this.libraryLoaded(c,k)}),F):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));
-else if(q||this.spinner.spin(document.body,mxResources.get("saving"))){m.setData(z);var J=mxUtils.bind(this,function(){m.save(!0,mxUtils.bind(this,function(D){this.spinner.stop();this.hideDialog(!0);u||this.libraryLoaded(m,k);null!=x&&x()}),F)});if(b!=m.getTitle()){var H=m.getHash();m.rename(b,mxUtils.bind(this,function(D){m.constructor!=LocalLibrary&&H!=m.getHash()&&(mxSettings.removeCustomLibrary(H),mxSettings.addCustomLibrary(m.getHash()));this.removeLibrarySidebar(H);J()}),F)}else J()}}catch(D){this.handleError(D)}};
+else if(q||this.spinner.spin(document.body,mxResources.get("saving"))){m.setData(z);var I=mxUtils.bind(this,function(){m.save(!0,mxUtils.bind(this,function(D){this.spinner.stop();this.hideDialog(!0);u||this.libraryLoaded(m,k);null!=x&&x()}),F)});if(b!=m.getTitle()){var H=m.getHash();m.rename(b,mxUtils.bind(this,function(D){m.constructor!=LocalLibrary&&H!=m.getHash()&&(mxSettings.removeCustomLibrary(H),mxSettings.addCustomLibrary(m.getHash()));this.removeLibrarySidebar(H);I()}),F)}else I()}}catch(D){this.handleError(D)}};
App.prototype.saveFile=function(b,k){var m=this.getCurrentFile(),g=this.mode;if(null!=m){var q=mxUtils.bind(this,function(){EditorUi.enableDrafts&&m.removeDraft();this.getCurrentFile()==m||m.isModified()||(m.getMode()!=App.MODE_DEVICE?this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))})):this.clearStatus());null!=k&&k()});if(b||null==m.getTitle()||null!=m.invalidFileHandle||null==this.mode)if(null!=m&&m.constructor==LocalFile&&
-null!=m.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(F,J){m.invalidFileHandle=null;m.fileHandle=F;m.title=J.name;m.desc=J;m.editable=null;this.save(J.name,q)}),null,this.createFileSystemOptions(m.getTitle()));else{var u=null!=m.getTitle()?m.getTitle():this.defaultFilename,x=mxUtils.bind(this,function(F,J,H,D){if(null!=F&&0<F.length)if(/(\.pdf)$/i.test(F))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),
-mxUtils.bind(this,function(){H.value=F.split(".").slice(0,-1).join(".");H.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?H.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==g&&J==App.MODE_DEVICE)null!=m&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(f,l){m.fileHandle=f;m.mode=App.MODE_DEVICE;m.title=l.name;m.desc=l;this.setMode(App.MODE_DEVICE);this.save(l.name,q)}),mxUtils.bind(this,
-function(f){"AbortError"!=f.name&&this.handleError(f)}),this.createFileSystemOptions(F)):(this.setMode(App.MODE_DEVICE),this.save(F,q));else if("download"==J)(new LocalFile(this,null,F)).save();else if("_blank"==J)window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0);else if(b||g!=J){var c=mxUtils.bind(this,function(f){try{var l=this.editor.graph,n=l.getSelectionCells(),r=l.getViewState(),
-t=this.currentPage,v=this.getCurrentFile(),B=null==this.mode||null==v||null==v.mode;this.createFile(F,this.getFileData(/(\.xml)$/i.test(F)||0>F.indexOf(".")||/(\.drawio)$/i.test(F),/(\.svg)$/i.test(F),/(\.html)$/i.test(F)),null,J,q,B,f,null,null,mxUtils.bind(this,function(){this.restoreViewState(t,r,n)}))}catch(E){this.handleError(E)}});null!=D?c(D):this.pickFolder(J,c)}else null!=J&&this.save(F,q)}),z=!mxClient.IS_IOS||!navigator.standalone;u=new SaveDialog(this,u,mxUtils.bind(this,function(F,J,
-H){try{x(F.value,J,F,H),this.hideDialog()}catch(D){this.handleError(D)}}),z?null:["_blank"]);this.showDialog(u.container,420,162,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));u.init()}else this.save(m.getTitle(),q)}};
-App.prototype.loadTemplate=function(b,k,m,g,q){var u=!1,x=b,z=null!=g?g:b;g=/\.png$/i.test(z)||/\.pdf$/i.test(z);var F=EditorUi.isVisioFilename(z);this.editor.isCorsEnabledForUrl(x)||(u=g||F,x="t="+(new Date).getTime(),x=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+x+(u?"&base64=1":""));this.editor.loadUrl(x,mxUtils.bind(this,function(J){try{var H=u?window.atob?atob(J):Base64.decode(J):J;if(F||this.isVisioData(H))F||(z=q?this.isRemoteVisioData(H)?"raw.vss":"raw.vssx":this.isRemoteVisioData(H)?"raw.vsd":
-"raw.vsdx"),this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(D){k(D)},m,z);else if(this.isGliffyData(H,z))this.importGliffy(H,mxUtils.bind(this,function(D){"<mxGraphModel"==D.substring(0,13)?k(D):m()}),m,b);else if(this.isLucidChartData(H))this.convertLucidChart(H,mxUtils.bind(this,function(D){k(D)}),mxUtils.bind(this,function(D){m(D)}));else{if(/(\.png)($|\?)/i.test(z)||Editor.isPngData(H))H=Editor.extractGraphModelFromPng(J);k(H)}}catch(D){m(D)}}),m,/(\.png)($|\?)/i.test(z)||
+null!=m.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(F,I){m.invalidFileHandle=null;m.fileHandle=F;m.title=I.name;m.desc=I;m.editable=null;this.save(I.name,q)}),null,this.createFileSystemOptions(m.getTitle()));else{var u=null!=m.getTitle()?m.getTitle():this.defaultFilename,x=mxUtils.bind(this,function(F,I,H,D){if(null!=F&&0<F.length)if(/(\.pdf)$/i.test(F))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),
+mxUtils.bind(this,function(){H.value=F.split(".").slice(0,-1).join(".");H.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?H.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==g&&I==App.MODE_DEVICE)null!=m&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(f,l){m.fileHandle=f;m.mode=App.MODE_DEVICE;m.title=l.name;m.desc=l;this.setMode(App.MODE_DEVICE);this.save(l.name,q)}),mxUtils.bind(this,
+function(f){"AbortError"!=f.name&&this.handleError(f)}),this.createFileSystemOptions(F)):(this.setMode(App.MODE_DEVICE),this.save(F,q));else if("download"==I)(new LocalFile(this,null,F)).save();else if("_blank"==I)window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0);else if(b||g!=I){var c=mxUtils.bind(this,function(f){try{var l=this.editor.graph,n=l.getSelectionCells(),r=l.getViewState(),
+t=this.currentPage,v=this.getCurrentFile(),B=null==this.mode||null==v||null==v.mode;this.createFile(F,this.getFileData(/(\.xml)$/i.test(F)||0>F.indexOf(".")||/(\.drawio)$/i.test(F),/(\.svg)$/i.test(F),/(\.html)$/i.test(F)),null,I,q,B,f,null,null,mxUtils.bind(this,function(){this.restoreViewState(t,r,n)}))}catch(E){this.handleError(E)}});null!=D?c(D):this.pickFolder(I,c)}else null!=I&&this.save(F,q)}),z=!mxClient.IS_IOS||!navigator.standalone;u=new SaveDialog(this,u,mxUtils.bind(this,function(F,I,
+H){try{x(F.value,I,F,H),this.hideDialog()}catch(D){this.handleError(D)}}),z?null:["_blank"]);this.showDialog(u.container,420,162,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));u.init()}else this.save(m.getTitle(),q)}};
+App.prototype.loadTemplate=function(b,k,m,g,q){var u=!1,x=b,z=null!=g?g:b;g=/\.png$/i.test(z)||/\.pdf$/i.test(z);var F=EditorUi.isVisioFilename(z);this.editor.isCorsEnabledForUrl(x)||(u=g||F,x="t="+(new Date).getTime(),x=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+x+(u?"&base64=1":""));this.editor.loadUrl(x,mxUtils.bind(this,function(I){try{var H=u?window.atob?atob(I):Base64.decode(I):I;if(F||this.isVisioData(H))F||(z=q?this.isRemoteVisioData(H)?"raw.vss":"raw.vssx":this.isRemoteVisioData(H)?"raw.vsd":
+"raw.vsdx"),this.importVisio(this.base64ToBlob(I.substring(I.indexOf(",")+1)),function(D){k(D)},m,z);else if(this.isGliffyData(H,z))this.importGliffy(H,mxUtils.bind(this,function(D){"<mxGraphModel"==D.substring(0,13)?k(D):m()}),m,b);else if(this.isLucidChartData(H))this.convertLucidChart(H,mxUtils.bind(this,function(D){k(D)}),mxUtils.bind(this,function(D){m(D)}));else{if(/(\.png)($|\?)/i.test(z)||Editor.isPngData(H))H=Editor.extractGraphModelFromPng(I);k(H)}}catch(D){m(D)}}),m,/(\.png)($|\?)/i.test(z)||
F,null,null,u)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"M"==b?App.MODE_M365:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};
App.prototype.isModeEnabled=function(b){return b==App.MODE_GOOGLE?"function"===typeof window.DriveClient&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode):b==App.MODE_GITHUB?null!=this.gitHub:b==App.MODE_GITLAB?null!=this.gitLab:b==App.MODE_DROPBOX?"function"===typeof window.DropboxClient&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&
mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):b==App.MODE_ONEDRIVE?"function"===typeof window.OneDriveClient&&("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"app.diagrams.net"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!mxClient.IS_IOS&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode):b==App.MODE_TRELLO?"function"===
typeof window.TrelloClient&&"1"==urlParams.tr&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):b==App.MODE_M365?null!=this.m365:!1};App.prototype.isModeReady=function(b){return null!=this.getServiceForName(b)&&(b!=App.MODE_DROPBOX||"undefined"!==typeof Dropbox.choose)};
App.prototype.uncompressPages=function(b){if(null!=b)try{var k=mxUtils.parseXml(b);if("mxfile"==k.documentElement.nodeName){for(var m=k.documentElement.getElementsByTagName("diagram"),g=0;g<m.length;g++){var q=Editor.parseDiagramNode(m[g],!0);null!=q&&(mxUtils.setTextContent(m[g],""),m[g].appendChild(q))}b=mxUtils.getPrettyXml(k.documentElement)}}catch(u){}return b};
-App.prototype.createFile=function(b,k,m,g,q,u,x,z,F,J){EditorUi.debug("App.createFile",[this],"title",[b],"data",[k],"libs",[m],"mode",[g]);g=z?null:null!=g?g:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){k=null!=k?k:this.emptyDiagramXml;null==k||Editor.defaultCompressed||(k=this.uncompressPages(k));var H=mxUtils.bind(this,function(){this.spinner.stop()}),D=mxUtils.bind(this,function(f){H();null==f&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():
-null!=f&&this.handleError(f)});try{var c=mxUtils.bind(this,function(f){H();this.fileCreated(f,m,u,q,F,J)});g==App.MODE_GOOGLE&&null!=this.drive?(null==x&&null!=this.stateArg&&null!=this.stateArg.folderId&&(x=this.stateArg.folderId),this.drive.insertFile(b,k,x,c,D)):g==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,k,c,D,!1,x):g==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,k,c,D,!1,x):g==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,k,c,D,!1,x):g==App.MODE_DROPBOX&&
-null!=this.dropbox?this.dropbox.insertFile(b,k,c,D):g==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,k,c,D,!1,x):g==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,k,c,D,!1,x):g==App.MODE_BROWSER?StorageFile.insertFile(this,b,k,c,D):!z&&g==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(H(),this.showSaveFilePicker(mxUtils.bind(this,function(f,l){var n=new LocalFile(this,k,l.name,null,f,l);n.saveFile(l.name,!1,mxUtils.bind(this,function(){this.fileCreated(n,m,u,q,F,J)}),D,!0)}),
-mxUtils.bind(this,function(f){"AbortError"!=f.name&&D(f)}),this.createFileSystemOptions(b))):(H(),this.fileCreated(new LocalFile(this,k,b,null==g),m,u,q,F,J))}catch(f){H(),this.handleError(f)}}};
+App.prototype.createFile=function(b,k,m,g,q,u,x,z,F,I){EditorUi.debug("App.createFile",[this],"title",[b],"data",[k],"libs",[m],"mode",[g]);g=z?null:null!=g?g:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){k=null!=k?k:this.emptyDiagramXml;null==k||Editor.defaultCompressed||(k=this.uncompressPages(k));var H=mxUtils.bind(this,function(){this.spinner.stop()}),D=mxUtils.bind(this,function(f){H();null==f&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():
+null!=f&&this.handleError(f)});try{var c=mxUtils.bind(this,function(f){H();this.fileCreated(f,m,u,q,F,I)});g==App.MODE_GOOGLE&&null!=this.drive?(null==x&&null!=this.stateArg&&null!=this.stateArg.folderId&&(x=this.stateArg.folderId),this.drive.insertFile(b,k,x,c,D)):g==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,k,c,D,!1,x):g==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,k,c,D,!1,x):g==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,k,c,D,!1,x):g==App.MODE_DROPBOX&&
+null!=this.dropbox?this.dropbox.insertFile(b,k,c,D):g==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,k,c,D,!1,x):g==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,k,c,D,!1,x):g==App.MODE_BROWSER?StorageFile.insertFile(this,b,k,c,D):!z&&g==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(H(),this.showSaveFilePicker(mxUtils.bind(this,function(f,l){var n=new LocalFile(this,k,l.name,null,f,l);n.saveFile(l.name,!1,mxUtils.bind(this,function(){this.fileCreated(n,m,u,q,F,I)}),D,!0)}),
+mxUtils.bind(this,function(f){"AbortError"!=f.name&&D(f)}),this.createFileSystemOptions(b))):(H(),this.fileCreated(new LocalFile(this,k,b,null==g),m,u,q,F,I))}catch(f){H(),this.handleError(f)}}};
App.prototype.fileCreated=function(b,k,m,g,q,u){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[k],"replace",[m]);var x=window.location.pathname;null!=k&&0<k.length&&(x+="?libs="+k);null!=q&&0<q.length&&(x+="?clibs="+q);x=this.getUrl(x);b.getMode()!=App.MODE_DEVICE&&(x+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var z=b.getData();z=0<z.length?this.editor.extractGraphModel(mxUtils.parseXml(z).documentElement,!0):null;var F=window.location.protocol+
-"//"+window.location.hostname+x,J=z,H=null;null!=z&&/\.svg$/i.test(b.getTitle())&&(H=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(H.container),J=this.decodeNodeIntoGraph(J,H));b.setData(this.createFileData(z,H,b,F));null!=H&&H.container.parentNode.removeChild(H.container);var D=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){D();var f=this.getCurrentFile();null==m&&null!=f&&(m=!f.isModified()&&(null==f.getMode()||EditorUi.isElectronApp));
+"//"+window.location.hostname+x,I=z,H=null;null!=z&&/\.svg$/i.test(b.getTitle())&&(H=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(H.container),I=this.decodeNodeIntoGraph(I,H));b.setData(this.createFileData(z,H,b,F));null!=H&&H.container.parentNode.removeChild(H.container);var D=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){D();var f=this.getCurrentFile();null==m&&null!=f&&(m=!f.isModified()&&(null==f.getMode()||EditorUi.isElectronApp));
var l=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,u);m&&this.updateStatus(mxUtils.bind(this,function(){b.addAllSavedStatus()}));null!=k&&this.sidebar.showEntries(k);if(null!=q){for(var r=[],t=q.split(";"),v=0;v<t.length;v++)r.push(decodeURIComponent(t[v]));this.loadLibraries(r)}null!=g&&g()}),n=mxUtils.bind(this,function(){m||null==f||!f.isModified()?l():this.confirm(mxResources.get("allChangesLost"),null,l,mxResources.get("cancel"),mxResources.get("discardChanges"))});
null==m||m?n():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(x,null,n))});b.constructor==LocalFile?c():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){c()}),mxUtils.bind(this,function(f){D();null!=f&&"AbortError"==f.name||this.handleError(f)}))}};
App.prototype.loadFile=function(b,k,m,g,q){if("1"==urlParams.openInSameWin||navigator.standalone)k=!0;this.hideDialog();var u=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var F=mxUtils.bind(this,function(r){this.handleError(r,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var t=this.getCurrentFile();window.location.hash=
null!=t?t.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(r){null!=r?(this.fileLoaded(new StorageFile(this,r,b)),null!=g&&g()):F({message:mxResources.get("fileNotFound")})}),F)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var r=this.getCurrentFile();window.location.hash=null!=r?r.getHash():""}));else if(null!=m)this.spinner.stop(),this.fileLoaded(m),
-null!=g&&g();else if("S"==b.charAt(0))this.spinner.stop(),this.alert("[Deprecation] #S is no longer supported, go to https://app.diagrams.net/?desc="+b.substring(1).substring(0,10),mxUtils.bind(this,function(){window.location.href="https://app.diagrams.net/?desc="+b.substring(1)}));else if("create="==b.substring(0,7))try{var J=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==J.type){var H=window.opener||window.parent,D=mxUtils.bind(this,function(r){EditorUi.debug("EditorUi.createMessageHandler",
-[this],"evt",[r]);if(r.source==H)try{"create"==r.data.action&&null!=r.data.data&&(mxEvent.removeListener(window,"message",D),this.executeCreateObject(r.data.data))}catch(t){c=null}});mxEvent.addListener(window,"message",D);H.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(J)}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));
-J=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);J.getHash=function(){return b};this.fileLoaded(J);null!=g&&g()}else if("E"==b.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(r,t){this.spinner.stop();this.fileLoaded(new EmbedFile(this,r,t));null!=g&&g()}),mxUtils.bind(this,
+null!=g&&g();else if("S"==b.charAt(0))this.spinner.stop(),this.alert("[Deprecation] #S is no longer supported, go to https://app.diagrams.net/?desc="+b.substring(1).substring(0,10),mxUtils.bind(this,function(){window.location.href="https://app.diagrams.net/?desc="+b.substring(1)}));else if("create="==b.substring(0,7))try{var I=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==I.type){var H=window.opener||window.parent,D=mxUtils.bind(this,function(r){EditorUi.debug("EditorUi.createMessageHandler",
+[this],"evt",[r]);if(r.source==H)try{"create"==r.data.action&&null!=r.data.data&&(mxEvent.removeListener(window,"message",D),this.executeCreateObject(r.data.data))}catch(t){c=null}});mxEvent.addListener(window,"message",D);H.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(I)}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));
+I=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);I.getHash=function(){return b};this.fileLoaded(I);null!=g&&g()}else if("E"==b.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(r,t){this.spinner.stop();this.fileLoaded(new EmbedFile(this,r,t));null!=g&&g()}),mxUtils.bind(this,
function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))}));else if("U"==b.charAt(0)){var f=decodeURIComponent(b.substring(1)),l=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=f.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var r=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var t=f.substring(31,f.lastIndexOf("&ex"));this.loadFile("G"+
t,k,null,mxUtils.bind(this,function(){var v=this.getCurrentFile();null!=v&&this.editor.chromeless&&!this.editor.editable&&(v.getHash=function(){return"G"+t},window.location.hash="#"+v.getHash());null!=g&&g()}));return!0}return!1});!r()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",r);return!0});this.loadTemplate(f,mxUtils.bind(this,function(r){this.spinner.stop();if(null!=r&&0<r.length){var t=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var v=
f,B=f.lastIndexOf("."),E=v.lastIndexOf("/");B>E&&0<E&&(v=v.substring(E+1,B),B=f.substring(B),Editor.useCanvasForExport||".png"!=B||(B=".drawio"),".svg"===B||".xml"===B||".html"===B||".png"===B||".drawio"===B)&&(t=v+B)}r=new LocalFile(this,r,null!=urlParams.title?decodeURIComponent(urlParams.title):t,!0);r.getHash=function(){return b};this.fileLoaded(r,!0)?null!=g&&g():l()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else l()||this.handleError({message:mxResources.get("fileNotFound")},
@@ -15646,28 +15656,28 @@ window.location.hash="#"+E.getHash()});null==v||"AbortError"!=v.name?this.handle
this.isBlankFile()?z():null==x||k?z():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+b,null,z)).container,340,140,!0,!0)};
App.prototype.getLibraryStorageHint=function(b){var k=b.getTitle();b.constructor!=LocalLibrary&&(k+="\n"+b.getHash());b.constructor==DriveLibrary?k+=" ("+mxResources.get("googleDrive")+")":b.constructor==GitHubLibrary?k+=" ("+mxResources.get("github")+")":b.constructor==TrelloLibrary?k+=" ("+mxResources.get("trello")+")":b.constructor==DropboxLibrary?k+=" ("+mxResources.get("dropbox")+")":b.constructor==OneDriveLibrary?k+=" ("+mxResources.get("oneDrive")+")":b.constructor==StorageLibrary?k+=" ("+
mxResources.get("browser")+")":b.constructor==LocalLibrary&&(k+=" ("+mxResources.get("device")+")");return k};App.prototype.restoreLibraries=function(){function b(m){for(var g=0;g<m.length;g++)""!=m[g]&&0>mxUtils.indexOf(k,m[g])&&k.push(m[g])}var k=[];b(mxSettings.getCustomLibraries());b((urlParams.clibs||"").split(";"));this.loadLibraries(k)};
-App.prototype.loadLibraries=function(b,k){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var m=mxUtils.bind(this,function(J,H){H||mxSettings.removeCustomLibrary(J);delete this.loadedLibraries[J]}),g=0,q=[],u=0<b.length&&"L.scratchpad"==b[0]?1:0,x=mxUtils.bind(this,function(){if(0==g){if(null!=b)for(var J=this.sidebar.appendCustomLibraries,H=0;H<b.length;H++){var D=J?H:b.length-1-H;if(null!=q[D])try{this.loadLibrary(q[D],D<=u)}catch(c){}}null!=k&&k()}});if(null!=b)for(var z=
-0;z<b.length;z++){var F=encodeURIComponent(decodeURIComponent(b[z]));mxUtils.bind(this,function(J,H){if(null!=J&&0<J.length&&null==this.loadedLibraries[J]&&null==this.sidebar.palettes[J]){this.loadedLibraries[J]=!0;g++;var D=mxUtils.bind(this,function(t){q[H]=t;g--;x()}),c=mxUtils.bind(this,function(t){m(J,t);g--;x()}),f=J.substring(0,1);if("L"==f)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var t=decodeURIComponent(J.substring(1));StorageFile.getFileContent(this,
-t,mxUtils.bind(this,function(v){".scratchpad"!=t||null!=v&&"<mxfile"!=v.substring(0,7)||(v=this.emptyLibraryXml);null!=v?D(new StorageLibrary(this,v,t)):c()}),c)}catch(v){c()}}),0);else if("U"==f){var l=decodeURIComponent(J.substring(1));this.isOffline()?c(!0):this.loadTemplate(l,mxUtils.bind(this,function(t){null!=t&&0<t.length?D(new UrlLibrary(this,t,l)):c()}),function(){c()},null,!0)}else if("R"==f){f=decodeURIComponent(J.substring(1));try{f=JSON.parse(f);var n={id:f[0],title:f[1],downloadUrl:f[2]};
-this.remoteInvoke("getFileContent",[n.downloadUrl],null,mxUtils.bind(this,function(t){try{D(new RemoteLibrary(this,t,n))}catch(v){c()}}),function(){c()})}catch(t){c()}}else if("S"==f&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(J.substring(1)),function(t){D(t)},c)}catch(t){c()}else{var r=null;"G"==f?null!=this.drive&&null!=this.drive.user&&(r=this.drive):"H"==f?null!=this.gitHub&&null!=this.gitHub.getUser()&&(r=this.gitHub):"T"==f?null!=this.trello&&this.trello.isAuthorized()&&
-(r=this.trello):"D"==f?null!=this.dropbox&&null!=this.dropbox.getUser()&&(r=this.dropbox):"W"==f&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(r=this.oneDrive);null!=r?r.getLibrary(decodeURIComponent(J.substring(1)),mxUtils.bind(this,function(t){try{D(t)}catch(v){c()}}),function(t){c()}):c(!0)}}})(F,z)}x()}};
+App.prototype.loadLibraries=function(b,k){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var m=mxUtils.bind(this,function(I,H){H||mxSettings.removeCustomLibrary(I);delete this.loadedLibraries[I]}),g=0,q=[],u=0<b.length&&"L.scratchpad"==b[0]?1:0,x=mxUtils.bind(this,function(){if(0==g){if(null!=b)for(var I=this.sidebar.appendCustomLibraries,H=0;H<b.length;H++){var D=I?H:b.length-1-H;if(null!=q[D])try{this.loadLibrary(q[D],D<=u)}catch(c){}}null!=k&&k()}});if(null!=b)for(var z=
+0;z<b.length;z++){var F=encodeURIComponent(decodeURIComponent(b[z]));mxUtils.bind(this,function(I,H){if(null!=I&&0<I.length&&null==this.loadedLibraries[I]&&null==this.sidebar.palettes[I]){this.loadedLibraries[I]=!0;g++;var D=mxUtils.bind(this,function(t){q[H]=t;g--;x()}),c=mxUtils.bind(this,function(t){m(I,t);g--;x()}),f=I.substring(0,1);if("L"==f)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var t=decodeURIComponent(I.substring(1));StorageFile.getFileContent(this,
+t,mxUtils.bind(this,function(v){".scratchpad"!=t||null!=v&&"<mxfile"!=v.substring(0,7)||(v=this.emptyLibraryXml);null!=v?D(new StorageLibrary(this,v,t)):c()}),c)}catch(v){c()}}),0);else if("U"==f){var l=decodeURIComponent(I.substring(1));this.isOffline()?c(!0):this.loadTemplate(l,mxUtils.bind(this,function(t){null!=t&&0<t.length?D(new UrlLibrary(this,t,l)):c()}),function(){c()},null,!0)}else if("R"==f){f=decodeURIComponent(I.substring(1));try{f=JSON.parse(f);var n={id:f[0],title:f[1],downloadUrl:f[2]};
+this.remoteInvoke("getFileContent",[n.downloadUrl],null,mxUtils.bind(this,function(t){try{D(new RemoteLibrary(this,t,n))}catch(v){c()}}),function(){c()})}catch(t){c()}}else if("S"==f&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(I.substring(1)),function(t){D(t)},c)}catch(t){c()}else{var r=null;"G"==f?null!=this.drive&&null!=this.drive.user&&(r=this.drive):"H"==f?null!=this.gitHub&&null!=this.gitHub.getUser()&&(r=this.gitHub):"T"==f?null!=this.trello&&this.trello.isAuthorized()&&
+(r=this.trello):"D"==f?null!=this.dropbox&&null!=this.dropbox.getUser()&&(r=this.dropbox):"W"==f&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(r=this.oneDrive);null!=r?r.getLibrary(decodeURIComponent(I.substring(1)),mxUtils.bind(this,function(t){try{D(t)}catch(v){c()}}),function(t){c()}):c(!0)}}})(F,z)}x()}};
App.prototype.updateButtonContainer=function(b){if(null!=this.buttonContainer)if(EditorUi.isElectronApp||this.isOffline()||b||(null!=urlParams.notif?this.fetchAndShowNotification(urlParams.notif):"1"!=urlParams.extAuth&&"atlas"!=Editor.currentTheme&&this.fetchAndShowNotification("online",this.mode)),this.isStandaloneApp()||"simple"==Editor.currentTheme&&"1"!=urlParams.embed)this.buttonContainer.style.display="none",null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.sketchMenubarElt&&
this.sketchMenubarElt.appendChild(this.notificationBtn);else{this.buttonContainer.style.display="";b=this.getCurrentFile();null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.buttonContainer&&this.buttonContainer.appendChild(this.notificationBtn);"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&(null==this.commentButton&&(this.commentButton=document.createElement("a"),this.setElementTitle(this.commentButton,"comments"),this.commentButton.className="geButton geRoundButton",
this.commentButton.style.backgroundImage="url("+Editor.commentImage+")",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,function(){this.actions.get("comments").funct()})),this.buttonContainer.appendChild(this.commentButton),this.addCommentsBadge(this.commentButton),this.installCommentDragSource(this.commentButton)),this.commentButton.style.display=this.commentsSupported()?"":"none");if(null==this.shareButton){this.shareButton=document.createElement("button");this.shareButton.className=
"geBtn gePrimaryBtn";var k=document.createElement("div");k.className="geButton";k.style.backgroundImage="url("+Editor.groupImage+")";this.shareButton.appendChild(k);this.dependsOnLanguage(mxUtils.bind(this,function(){k.innerHTML="";mxUtils.write(k,mxResources.get("share"));this.shareButton.setAttribute("title",mxResources.get("share"))}));mxEvent.addListener(this.shareButton,"click",mxUtils.bind(this,function(){this.actions.get("share").funct()}));this.buttonContainer.appendChild(this.shareButton)}this.shareButton.style.display=
-null!=b&&"kennedy"==Editor.currentTheme&&"1"!=urlParams.embed?"":"none";if("simple"!=Editor.currentTheme){if(null==this.userButton){this.userButton=document.createElement("a");this.userButton.className="geButton geRoundButton";var m=document.createElement("div");m.className="geUserAvatar";this.userButton.appendChild(m);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(z){this.toggleUserPanel();var F=this.userButton.getBoundingClientRect(),J=window.innerWidth||document.documentElement.clientWidth;
-this.userPanel.style.top=F.bottom+"px";this.userPanel.style.right=J-F.right+"px";mxEvent.consume(z)}));var g=document.createElement("img");g.style.position="absolute";g.style.width="10px";this.userButton.appendChild(g);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){m=this.userButton.getElementsByClassName("geUserAvatar")[0];g=this.userButton.getElementsByTagName("img")[0];var q=mxResources.get("changeUser"),u=this.getMainUser();null!=u&&null!=u.displayName&&(q=u.displayName);
+null!=b&&"kennedy"==Editor.currentTheme&&"1"!=urlParams.embed?"":"none";if("simple"!=Editor.currentTheme){if(null==this.userButton){this.userButton=document.createElement("a");this.userButton.className="geButton geRoundButton";var m=document.createElement("div");m.className="geUserAvatar";this.userButton.appendChild(m);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(z){this.toggleUserPanel();var F=this.userButton.getBoundingClientRect(),I=window.innerWidth||document.documentElement.clientWidth;
+this.userPanel.style.top=F.bottom+"px";this.userPanel.style.right=I-F.right+"px";mxEvent.consume(z)}));var g=document.createElement("img");g.style.position="absolute";g.style.width="10px";this.userButton.appendChild(g);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){m=this.userButton.getElementsByClassName("geUserAvatar")[0];g=this.userButton.getElementsByTagName("img")[0];var q=mxResources.get("changeUser"),u=this.getMainUser();null!=u&&null!=u.displayName&&(q=u.displayName);
null!=u&&null!=u.pictureUrl?(m.classList.remove("geAdaptiveAsset"),m.classList.add("geUserPhoto"),m.style.backgroundImage="url("+u.pictureUrl+")",g.style.top="3px",g.style.right="0"):(m.classList.remove("geUserPhoto"),m.classList.add("geAdaptiveAsset"),m.style.backgroundImage="url("+Editor.userImage+")",g.style.top="6px",g.style.right="4px");if(null!=b&&b.isRealtimeEnabled()&&b.isRealtimeSupported()){g.style.display="";m=b.getRealtimeError();var x=b.getRealtimeState();q+=" (";1==x?(g.src=Editor.syncImage,
q+=mxResources.get("online")):(g.src=Editor.syncProblemImage,q=null!=m&&null!=m.message?q+m.message:q+mxResources.get("disconnected"));q+=")"}else g.style.display="none",g.src=Editor.cloudImage;this.userButton.setAttribute("title",q);this.userButton.style.display="draw.io"!=this.getServiceName()||null==u||"1"==urlParams.embed||this.isStandaloneApp()||null==b?"none":""}}}};
App.prototype.fetchAndShowNotification=function(b,k){if(!this.fetchingNotif&&null!=NOTIFICATIONS_URL){b=b||"online";var m=null,g=mxUtils.bind(this,function(q){q=q.filter(function(F){return!F.targets||-1<F.targets.indexOf(b)||null!=k&&-1<F.targets.indexOf(k)});for(var u=b+"NotifReadTS",x=isLocalStorage?parseInt(localStorage.getItem(u)):!0,z=0;z<q.length;z++)q[z].isNew=!x||q[z].timestamp>x;this.showNotification(q,u)});try{isLocalStorage&&(m=JSON.parse(localStorage.getItem(".notifCache")))}catch(q){}null==
m||m.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(q){if(200<=q.getStatus()&&299>=q.getStatus())try{var u=JSON.parse(q.getText());u.sort(function(x,z){return z.timestamp-x.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:u}));this.fetchingNotif=!1;g(u)}catch(x){}}))):g(m.notifs)}};
-App.prototype.showNotification=function(b,k){function m(J){var H=document.querySelector(".geNotification-count");null!=H&&(H.innerHTML=J,H.style.display=0==J?"none":"",H=document.querySelector(".geNotification-bell"),H.style.animation=0==J?"none":"",H.className="geNotification-bell"+(0==J?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==J?"none":"")}var g=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var q=g=0;q<b.length;q++)b[q].isNew&&
-g++;if(0==g)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var u=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var J=this.notificationWin.querySelectorAll(".circle.active"),H=0;H<J.length;H++)J[H].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(k,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className=
+App.prototype.showNotification=function(b,k){function m(I){var H=document.querySelector(".geNotification-count");null!=H&&(H.innerHTML=I,H.style.display=0==I?"none":"",H=document.querySelector(".geNotification-bell"),H.style.animation=0==I?"none":"",H.className="geNotification-bell"+(0==I?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==I?"none":"")}var g=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var q=g=0;q<b.length;q++)b[q].isNew&&
+g++;if(0==g)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var u=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var I=this.notificationWin.querySelectorAll(".circle.active"),H=0;H<I.length;H++)I[H].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(k,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className=
"geNotification-box";g=document.createElement("span");g.className="geNotification-count";this.notificationBtn.appendChild(g);this.notifCount=g;g=document.createElement("div");g.className="geNotification-bell";q=document.createElement("span");q.className="geBell-top";g.appendChild(q);q=document.createElement("span");q.className="geBell-middle";g.appendChild(q);q=document.createElement("span");q.className="geBell-bottom";g.appendChild(q);q=document.createElement("span");q.className="geBell-rad";g.appendChild(q);
this.notificationBtn.appendChild(g);this.notificationWin=document.createElement("div");this.notificationWin.className="geNotifPanel";this.notificationWin.style.display="none";document.body.appendChild(this.notificationWin);q=document.createElement("div");q.className="header";g=document.createElement("span");g.className="title";g.textContent=mxResources.get("notifications");q.appendChild(g);g=document.createElement("span");g.className="closeBtn";g.textContent="x";q.appendChild(g);this.notificationWin.appendChild(q);
-q=document.createElement("div");q.className="notifications clearfix";var x=document.createElement("div");x.setAttribute("id","geNotifList");x.style.position="relative";q.appendChild(x);this.notificationWin.appendChild(q);mxEvent.addListener(this.notificationBtn,"click",mxUtils.bind(this,function(){if("none"==this.notificationWin.style.display){this.notificationWin.style.display="";document.querySelector(".notifications").scrollTop=0;var J=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=
-J.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=J.right-this.notificationWin.clientWidth+"px";m(0)}else u()}));mxEvent.addListener(g,"click",u)}else this.notificationBtn.style.display="";var z=0,F=document.getElementById("geNotifList");if(null!=F){F.innerHTML='<div class="line"></div>';for(q=0;q<b.length;q++)(function(J,H){H.isNew&&z++;var D=document.createElement("div");D.className="notification";J=J.timeSince(new Date(H.timestamp));null==J&&(J=mxResources.get("lessThanAMinute"));
-D.innerHTML='<div class="circle'+(H.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[J],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(H.content)+"</p>";H.link&&mxEvent.addListener(D,"click",function(){window.open(H.link,"notifWin")});F.appendChild(D)})(this,b[q]);m(z)}}};
+q=document.createElement("div");q.className="notifications clearfix";var x=document.createElement("div");x.setAttribute("id","geNotifList");x.style.position="relative";q.appendChild(x);this.notificationWin.appendChild(q);mxEvent.addListener(this.notificationBtn,"click",mxUtils.bind(this,function(){if("none"==this.notificationWin.style.display){this.notificationWin.style.display="";document.querySelector(".notifications").scrollTop=0;var I=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=
+I.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=I.right-this.notificationWin.clientWidth+"px";m(0)}else u()}));mxEvent.addListener(g,"click",u)}else this.notificationBtn.style.display="";var z=0,F=document.getElementById("geNotifList");if(null!=F){F.innerHTML='<div class="line"></div>';for(q=0;q<b.length;q++)(function(I,H){H.isNew&&z++;var D=document.createElement("div");D.className="notification";I=I.timeSince(new Date(H.timestamp));null==I&&(I=mxResources.get("lessThanAMinute"));
+D.innerHTML='<div class="circle'+(H.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[I],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(H.content)+"</p>";H.link&&mxEvent.addListener(D,"click",function(){window.open(H.link,"notifWin")});F.appendChild(D)})(this,b[q]);m(z)}}};
App.prototype.save=function(b,k){var m=this.getCurrentFile(),g=!0,q=mxUtils.bind(this,function(){g&&(g=!1,m.handleFileSuccess(!0),null!=k&&k())}),u=mxUtils.bind(this,function(x){if(g){g=!1;Editor.addRetryToError(x,mxUtils.bind(this,function(){this.save(b,k)}));if(null!=x&&null!=x.retry){var z=x.retry;x.retry=function(){g=!0;try{m.isModified()?z():q()}catch(F){u(F)}}}m.handleFileError(x,null==x||"AbortError"!=x.name)}});if(null!=m&&this.spinner.spin(document.body,mxResources.get("saving"),u,3*this.timeout))try{this.clearStatus(),
this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==m.getTitle()?m.save(!0,q,u):m.saveAs(b,q,u)}catch(x){u(x)}};App.prototype.getExtensionForService=function(b){b=this.getServiceForName(b);return null!=b?b.extension:".drawio"};
App.prototype.getServiceForName=function(b){return b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_M365?this.m365:b==App.MODE_DROPBOX?this.dropbox:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:null};
@@ -15683,10 +15693,10 @@ function(){localStorage.setItem(k,b)}),null==localStorage.getItem(k)?m():this.co
App.prototype.descriptorChanged=function(){var b=this.getCurrentFile();if(null!=b){if(null!=this.fname){this.fname.innerText="";var k=null!=b.getTitle()?b.getTitle():this.defaultFilename;mxUtils.write(this.fname,k)}k=this.editor.graph;var m=b.isEditable();k.isEnabled()&&!m&&k.reset();k.setEnabled(m);null==urlParams.rev&&(this.updateDocumentTitle(),k=b.getHash(),0<k.length?(k!=this.getDiagramId()&&(window.location.hash=k),this.updateHashObject()):0<window.location.hash.length&&(window.location.hash=
""))}this.updateUi();null==this.format||null!=b&&this.fileEditable==b.isEditable()||!this.editor.graph.isSelectionEmpty()||(this.format.refresh(),this.fileEditable=null!=b?b.isEditable():null);this.fireEvent(new mxEventObject("fileDescriptorChanged","file",b))};
App.prototype.showAuthDialog=function(b,k,m,g){var q=this.spinner.pause();this.showDialog((new AuthDialog(this,b,k,mxUtils.bind(this,function(u){try{null!=m&&m(u,mxUtils.bind(this,function(){this.hideDialog();q()}))}catch(x){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(x.message))}))}}))).container,300,k?180:140,!0,!0,mxUtils.bind(this,function(u){null!=g&&g(u);u&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
-App.prototype.convertFile=function(b,k,m,g,q,u,x,z){var F=k;/\.svg$/i.test(F)||(F=F.substring(0,k.lastIndexOf("."))+g);var J=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(J=!0);if(/\.v(dx|sdx?)$/i.test(k)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var H=new XMLHttpRequest;H.open("GET",b,!0);J||(H.responseType="blob");if(z)for(var D in z)H.setRequestHeader(D,z[D]);H.onload=mxUtils.bind(this,function(){if(200<=
-H.status&&299>=H.status){var f=null;J?(f=JSON.parse(H.responseText),f=this.base64ToBlob(f.content,"application/octet-stream")):f=new Blob([H.response],{type:"application/octet-stream"});this.importVisio(f,mxUtils.bind(this,function(l){q(new LocalFile(this,l,F,!0))}),u,k)}else null!=u&&u({message:mxResources.get("errorLoadingFile")})});H.onerror=u;H.send()}else{var c=mxUtils.bind(this,function(f){try{if(/\.pdf$/i.test(k)){var l=Editor.extractGraphModelFromPdf(f);null!=l&&0<l.length&&q(new LocalFile(this,
+App.prototype.convertFile=function(b,k,m,g,q,u,x,z){var F=k;/\.svg$/i.test(F)||(F=F.substring(0,k.lastIndexOf("."))+g);var I=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(I=!0);if(/\.v(dx|sdx?)$/i.test(k)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var H=new XMLHttpRequest;H.open("GET",b,!0);I||(H.responseType="blob");if(z)for(var D in z)H.setRequestHeader(D,z[D]);H.onload=mxUtils.bind(this,function(){if(200<=
+H.status&&299>=H.status){var f=null;I?(f=JSON.parse(H.responseText),f=this.base64ToBlob(f.content,"application/octet-stream")):f=new Blob([H.response],{type:"application/octet-stream"});this.importVisio(f,mxUtils.bind(this,function(l){q(new LocalFile(this,l,F,!0))}),u,k)}else null!=u&&u({message:mxResources.get("errorLoadingFile")})});H.onerror=u;H.send()}else{var c=mxUtils.bind(this,function(f){try{if(/\.pdf$/i.test(k)){var l=Editor.extractGraphModelFromPdf(f);null!=l&&0<l.length&&q(new LocalFile(this,
l,F,!0))}else/\.png$/i.test(k)?(l=this.extractGraphModelFromPng(f),null!=l?q(new LocalFile(this,l,F,!0)):q(new LocalFile(this,f,k,!0))):Graph.fileSupport&&this.isGliffyData(f,b)?this.importGliffy(f,mxUtils.bind(this,function(n){q(new LocalFile(this,n,F,!0))}),mxUtils.bind(this,function(n){null!=u&&u({message:mxResources.get("errorLoadingFile")})}),k):q(new LocalFile(this,f,F,!0))}catch(n){null!=u&&u(n)}});m=/\.png$/i.test(k)||/\.jpe?g$/i.test(k)||/\.pdf$/i.test(k)||null!=m&&"image/"==m.substring(0,
-6);J?mxUtils.get(b,mxUtils.bind(this,function(f){if(200<=f.getStatus()&&299>=f.getStatus()){if(null!=q){f=JSON.parse(f.getText());var l=f.content;"base64"===f.encoding&&(l=/\.png$/i.test(k)?"data:image/png;base64,"+l:/\.pdf$/i.test(k)?"data:application/pdf;base64,"+l:window.atob?atob(l):Base64.decode(l));c(l)}}else null!=u&&u({code:App.ERROR_UNKNOWN})}),function(){null!=u&&u({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=u&&u({code:App.ERROR_TIMEOUT,retry:fn})},z):null!=x?x(b,c,u,m):
+6);I?mxUtils.get(b,mxUtils.bind(this,function(f){if(200<=f.getStatus()&&299>=f.getStatus()){if(null!=q){f=JSON.parse(f.getText());var l=f.content;"base64"===f.encoding&&(l=/\.png$/i.test(k)?"data:image/png;base64,"+l:/\.pdf$/i.test(k)?"data:application/pdf;base64,"+l:window.atob?atob(l):Base64.decode(l));c(l)}}else null!=u&&u({code:App.ERROR_UNKNOWN})}),function(){null!=u&&u({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=u&&u({code:App.ERROR_TIMEOUT,retry:fn})},z):null!=x?x(b,c,u,m):
this.editor.loadUrl(b,c,u,m,null,null,null,z)}};
App.prototype.updateHeader=function(){if(null!=this.menubar){var b="url("+Editor.logoImage+")";this.appIcon=document.createElement("a");this.appIcon.className="geAppIcon";this.appIcon.style.backgroundImage=b;mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(u){this.appIconClicked(u)}));mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var u=this.getCurrentFile();null!=u&&(u=u.getMode(),u==App.MODE_GOOGLE?(this.appIcon.style.backgroundImage=
"url("+IMAGE_PATH+"/google-drive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):u==App.MODE_DROPBOX?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):u==App.MODE_ONEDRIVE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):u==App.MODE_GITHUB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)",this.appIcon.style.backgroundSize=
@@ -15704,15 +15714,15 @@ App.prototype.getMainUser=function(){var b=null;null!=this.drive&&null!=this.dri
App.prototype.hideUserPanel=function(){null!=this.userPanel&&null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)};
App.prototype.toggleUserPanel=function(){if(null==this.userPanel){var b=document.createElement("div");b.className="geDialog geInlineDialog";b.style.minWidth="300px";this.userPanel=b;mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(x){mxEvent.isConsumed(x)||this.hideUserPanel()}))}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var k=!1;this.userPanel.innerText="";b=document.createElement("div");b.className="geButton";b.setAttribute("title",
mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var m=this.drive.getUsersList();if(0<m.length){var g=mxUtils.bind(this,function(x,z){var F=this.getCurrentFile();null!=F&&F.constructor==DriveFile?(this.spinner.spin(document.body,z),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,
-function(){this.spinner.stop();x()}),2E3)):x()});b=mxUtils.bind(this,function(x){var z=document.createElement("tr"),F=document.createElement("td");F.setAttribute("valig","middle");F.style.height="59px";F.style.width="66px";var J=document.createElement("img");J.setAttribute("width","50");J.setAttribute("height","50");J.setAttribute("border","0");J.setAttribute("src",null!=x.pictureUrl?x.pictureUrl:Editor.userImage);J.style.borderRadius="50%";J.style.margin="4px 8px 0 8px";F.appendChild(J);z.appendChild(F);
-F=document.createElement("td");F.setAttribute("valign","middle");F.style.whiteSpace="nowrap";F.style.paddingTop="4px";F.style.maxWidth="0";F.style.overflow="hidden";F.style.textOverflow="ellipsis";mxUtils.write(F,x.displayName+(x.isCurrent&&1<m.length?" ("+mxResources.get("default")+")":""));null!=x.email&&(mxUtils.br(F),J=document.createElement("small"),J.style.color="gray",mxUtils.write(J,x.email),F.appendChild(J));J=document.createElement("div");J.style.marginTop="4px";var H=document.createElement("i");
-mxUtils.write(H,mxResources.get("googleDrive"));J.appendChild(H);F.appendChild(J);z.appendChild(F);x.isCurrent?z.setAttribute("title","User ID: "+x.id):(z.setAttribute("title",mxResources.get("login")+" (User ID: "+x.id+")"),z.style.cursor="pointer",z.style.opacity="0.3",mxEvent.addListener(z,"mouseenter",mxUtils.bind(this,function(){z.style.opacity="1"})),mxEvent.addListener(z,"mouseleave",mxUtils.bind(this,function(){z.style.opacity="0.3"})),mxEvent.addListener(z,"click",mxUtils.bind(this,function(D){this.hideUserPanel();
+function(){this.spinner.stop();x()}),2E3)):x()});b=mxUtils.bind(this,function(x){var z=document.createElement("tr"),F=document.createElement("td");F.setAttribute("valig","middle");F.style.height="59px";F.style.width="66px";var I=document.createElement("img");I.setAttribute("width","50");I.setAttribute("height","50");I.setAttribute("border","0");I.setAttribute("src",null!=x.pictureUrl?x.pictureUrl:Editor.userImage);I.style.borderRadius="50%";I.style.margin="4px 8px 0 8px";F.appendChild(I);z.appendChild(F);
+F=document.createElement("td");F.setAttribute("valign","middle");F.style.whiteSpace="nowrap";F.style.paddingTop="4px";F.style.maxWidth="0";F.style.overflow="hidden";F.style.textOverflow="ellipsis";mxUtils.write(F,x.displayName+(x.isCurrent&&1<m.length?" ("+mxResources.get("default")+")":""));null!=x.email&&(mxUtils.br(F),I=document.createElement("small"),I.style.color="gray",mxUtils.write(I,x.email),F.appendChild(I));I=document.createElement("div");I.style.marginTop="4px";var H=document.createElement("i");
+mxUtils.write(H,mxResources.get("googleDrive"));I.appendChild(H);F.appendChild(I);z.appendChild(F);x.isCurrent?z.setAttribute("title","User ID: "+x.id):(z.setAttribute("title",mxResources.get("login")+" (User ID: "+x.id+")"),z.style.cursor="pointer",z.style.opacity="0.3",mxEvent.addListener(z,"mouseenter",mxUtils.bind(this,function(){z.style.opacity="1"})),mxEvent.addListener(z,"mouseleave",mxUtils.bind(this,function(){z.style.opacity="0.3"})),mxEvent.addListener(z,"click",mxUtils.bind(this,function(D){this.hideUserPanel();
g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(x);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(c){this.handleError(c)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(D)})));return z});k=!0;var q=document.createElement("table");q.style.borderSpacing="0";q.style.fontSize="10pt";q.style.width="100%";q.style.padding="10px";for(var u=0;u<m.length;u++)q.appendChild(b(m[u]));
this.userPanel.appendChild(q);b=document.createElement("div");b.style.textAlign="left";b.style.padding="10px";b.style.whiteSpace="nowrap";b.style.borderTopStyle="solid";b.style.borderTopWidth="1px";q=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxResources.get("signOut"))}))}));
q.className="geBtn";q.style.float="right";b.appendChild(q);q=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var x=this.drive.createAuthWin();x.blur();window.focus();g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(z){this.handleError(z)}),!0,x)}),mxResources.get("closingFile")+"...")}));q.className="geBtn";q.style.margin="0px";
-b.appendChild(q);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(x,z,F,J){if(null!=x){k&&this.userPanel.appendChild(document.createElement("hr"));k=!0;var H=document.createElement("table");H.style.borderSpacing="0";H.style.fontSize="10pt";H.style.width="100%";H.style.padding="10px";var D=document.createElement("tbody"),c=document.createElement("tr"),f=document.createElement("td");f.setAttribute("valig","top");f.style.width="40px";if(null!=z){var l=document.createElement("img");l.setAttribute("width",
-"40");l.setAttribute("height","40");l.setAttribute("border","0");l.setAttribute("src",z);l.style.marginRight="6px";f.appendChild(l)}c.appendChild(f);f=document.createElement("td");f.setAttribute("valign","middle");f.style.whiteSpace="nowrap";f.style.maxWidth="0";f.style.overflow="hidden";f.style.textOverflow="ellipsis";mxUtils.write(f,x.displayName);null!=x.email&&(mxUtils.br(f),z=document.createElement("small"),z.style.color="gray",mxUtils.write(z,x.email),f.appendChild(z));null!=J&&(x=document.createElement("div"),
-x.style.marginTop="4px",z=document.createElement("i"),mxUtils.write(z,J),x.appendChild(z),f.appendChild(x));c.appendChild(f);D.appendChild(c);H.appendChild(D);this.userPanel.appendChild(H);x=document.createElement("div");x.style.textAlign="center";x.style.padding="10px";x.style.whiteSpace="nowrap";null!=F&&(F=mxUtils.button(mxResources.get("signOut"),F),F.className="geBtn",x.appendChild(F));this.userPanel.appendChild(x)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",
+b.appendChild(q);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(x,z,F,I){if(null!=x){k&&this.userPanel.appendChild(document.createElement("hr"));k=!0;var H=document.createElement("table");H.style.borderSpacing="0";H.style.fontSize="10pt";H.style.width="100%";H.style.padding="10px";var D=document.createElement("tbody"),c=document.createElement("tr"),f=document.createElement("td");f.setAttribute("valig","top");f.style.width="40px";if(null!=z){var l=document.createElement("img");l.setAttribute("width",
+"40");l.setAttribute("height","40");l.setAttribute("border","0");l.setAttribute("src",z);l.style.marginRight="6px";f.appendChild(l)}c.appendChild(f);f=document.createElement("td");f.setAttribute("valign","middle");f.style.whiteSpace="nowrap";f.style.maxWidth="0";f.style.overflow="hidden";f.style.textOverflow="ellipsis";mxUtils.write(f,x.displayName);null!=x.email&&(mxUtils.br(f),z=document.createElement("small"),z.style.color="gray",mxUtils.write(z,x.email),f.appendChild(z));null!=I&&(x=document.createElement("div"),
+x.style.marginTop="4px",z=document.createElement("i"),mxUtils.write(z,I),x.appendChild(z),f.appendChild(x));c.appendChild(f);D.appendChild(c);H.appendChild(D);this.userPanel.appendChild(H);x=document.createElement("div");x.style.textAlign="center";x.style.padding="10px";x.style.whiteSpace="nowrap";null!=F&&(F=mxUtils.button(mxResources.get("signOut"),F),F.className="geBtn",x.appendChild(F));this.userPanel.appendChild(x)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",
mxUtils.bind(this,function(){var x=this.getCurrentFile();if(null!=x&&x.constructor==DropboxFile){var z=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});x.isModified()?this.confirm(mxResources.get("allChangesLost"),null,z,mxResources.get("cancel"),mxResources.get("discardChanges")):z()}else this.dropbox.logout()}),mxResources.get("dropbox"));null!=this.oneDrive&&b(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.oneDrive.noLogout?null:mxUtils.bind(this,function(){var x=
this.getCurrentFile();if(null==x||x.constructor!=OneDriveFile||x.isSP)this.oneDrive.logout();else{var z=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});x.isModified()?this.confirm(mxResources.get("allChangesLost"),null,z,mxResources.get("cancel"),mxResources.get("discardChanges")):z()}}),mxResources.get("oneDrive"));null!=this.m365&&b(this.m365.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.m365.noLogout?null:mxUtils.bind(this,function(){var x=this.getCurrentFile();if(null!=
x&&x.constructor==OneDriveFile&&x.isSP){var z=mxUtils.bind(this,function(){this.m365.logout();window.location.hash=""});x.isModified()?this.confirm(mxResources.get("allChangesLost"),null,z,mxResources.get("cancel"),mxResources.get("discardChanges")):z()}else this.m365.logout()}),mxResources.get("m365"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var x=this.getCurrentFile();if(null!=x&&x.constructor==GitHubFile){var z=mxUtils.bind(this,function(){this.gitHub.logout();
@@ -15721,91 +15731,91 @@ null,z,mxResources.get("cancel"),mxResources.get("discardChanges")):z()}else thi
z()}else this.trello.logout()}),mxResources.get("trello"));"min"==uiTheme&&(q=this.getCurrentFile(),null!=q&&q.isRealtimeEnabled()&&q.isRealtimeSupported()&&(b=document.createElement("div"),b.style.padding="10px",b.style.whiteSpace="nowrap",b.style.borderTop="1px solid rgb(224, 224, 224)",b.style.marginTop="4px",b.style.textAlign="center",b.style.padding="10px",b.style.fontSize="9pt",u=q.getRealtimeError(),1!=q.getRealtimeState()&&(mxUtils.write(b,mxResources.get("realtimeCollaboration")+": "+(null!=
u&&null!=u.message?u.message:mxResources.get("disconnected"))),this.userPanel.appendChild(b))));document.body.appendChild(this.userPanel)}};
App.prototype.getCurrentUser=function(){var b=null;null!=this.drive&&null!=this.drive.getUser()?b=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?b=this.oneDrive.getUser():null!=this.m365&&null!=this.m365.getUser()?b=this.m365.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?b=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()&&(b=this.gitHub.getUser());return b};var editorResetGraph=Editor.prototype.resetGraph;
-Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.layoutContainers=function(){var m=function(q,u){u.resizeLayoutRoot=!0;u.resizeNodes=!1;return"childLayout="+Graph.encodeChildLayout([{layout:q,config:u}])+";"},g=function(q,u,x,
-z){return{width:u,height:x,style:"group;connectable=0;transparentBounds=1;groupPadding=20;"+z,sidebarStyle:"swimlane;html=1;startSize=20;horizontal="+(q?"0":"1")+";resizable=0;fontSize=12;transparentBounds=1;groupPadding=20;"+z}};return{horizontalFlow:g(!0,460,150,"containerType=tree;"+m("elkLayered",{"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.padding":"[top=20,left=40,bottom=20,right=20]",edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),verticalFlow:g(!1,
-270,280,"containerType=tree;"+m("elkLayered",{"elk.direction":"DOWN","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.padding":"[top=40,left=20,bottom=20,right=20]",edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),horizontalTree:g(!0,300,160,"containerType=tree;"+m("elkTree",{"elk.direction":"RIGHT","elk.spacing.nodeNode":"40","elk.spacing.edgeNode":"20","elk.padding":"[top=20,left=40,bottom=20,right=20]",corners:"rounded"})),verticalTree:g(!1,280,180,"containerType=tree;"+
-m("elkTree",{"elk.direction":"DOWN","elk.spacing.nodeNode":"40","elk.spacing.edgeNode":"20","elk.padding":"[top=40,left=20,bottom=20,right=20]",corners:"rounded"})),radialTree:g(!1,320,320,"containerType=tree;"+m("elkRadial",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),organic:g(!1,320,320,m("elkOrganic",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),circle:g(!1,320,320,"childLayout=circleLayout;")}}();Menus.layoutContainerEdgeStyle="html=1;rounded=1;curved=0;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startSize=6;endSize=6;";
-Menus.prototype.createHelpLink=function(m){return this.editorUi.createHelpIcon(m)};Menus.prototype.addLinkToItem=function(m,g){null!=m&&m.firstChild.nextSibling.appendChild(this.createHelpLink(g))};Menus.prototype.removeCustomFont=function(m,g){for(var q=0;q<this.customFonts.length;q++)if(this.customFonts[q].name==m&&this.customFonts[q].url==g){this.customFonts.splice(q,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=
-function(m,g){for(var q=0;q<this.customFonts.length;q++)if(this.customFonts[q].name==m&&this.customFonts[q].url==g)return!0;for(q=0;q<this.defaultFonts.length;q++){var u=this.defaultFonts[q];if("string"!==typeof u&&u.fontFamily==m&&u.fontUrl==g||"string"===typeof u&&u==m&&null==g)return!0}return!1};Menus.prototype.addCustomFont=function(m,g){null==m||this.containsFont(m,g)||(this.customFonts.push({name:m,url:g}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};
-var k=Menus.prototype.init;Menus.prototype.init=function(){function m(y,d,p){g.editor.isExportToCanvas()?g.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z,da,N,aa){da=parseInt(A);!isNaN(da)&&0<da&&(g.exportImage(da/100,G&&"png"==y,I,L,P&&"png"==y,ba,!X,Y,y,ca,"png"==y?aa:null,S,Z),null!=p&&p(A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z))}),!0,d,y,!0):!g.isRemoteExportEnabled()||mxClient.IS_IOS&&
-navigator.standalone||g.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(A,G,I,L,P){g.downloadFile(G&&"png"==y?"xmlpng":y,null,null,A,null,null,I,L,P)}),!1,!0)}k.apply(this,arguments);var g=this.editorUi,q=g.editor.graph,u=mxUtils.bind(q,q.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(y){return"file"!=y}));g.actions.addAction("new...",function(){var y=g.isOffline(),d=new NewDialog(g,y,!(g.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in
-window));g.showDialog(d.container,y?350:620,y?70:460,!0,!0,function(p){null!=g.sidebar&&g.sidebar.hideTooltip();p&&null==g.getCurrentFile()&&g.showSplash()});d.init()});g.actions.put("insertTemplate",new Action("template...",function(){g.openTemplateDialog()})).isEnabled=u;var x=mxResources.get("page");g.actions.put("insertPage",new Action(mxResources.get("insertPage"),function(){try{g.insertPage()}catch(y){g.handleError(y)}})).isEnabled=function(){return null!=g.currentPage};g.actions.put("removePage",
-new Action(mxResources.get("removeIt",[x]),function(){g.removePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("renamePage",new Action(mxResources.get("renameIt",[x])+"...",function(){g.renamePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("duplicatePage",new Action(mxResources.get("duplicateIt",[x]),function(){var y=g.currentPage;g.duplicatePage(y,mxResources.get("copyOf",[y.getName()]))})).isEnabled=function(){return null!=
-g.currentPage};g.actions.put("sortPages",new Action(mxResources.get("sortPages"),function(){g.sortPages()})).isEnabled=function(){return null!=g.pages&&1<g.pages.length&&g.editor.graph.isEnabled()};x=g.actions.addAction("shareCursor",function(){g.setShareCursorPosition(!g.isShareCursorPosition())});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.isShareCursorPosition()});x=g.actions.addAction("showRemoteCursors",function(){g.setShowRemoteCursors(!g.isShowRemoteCursors())});x.setToggleAction(!0);
-x.setSelectedCallback(function(){return g.isShowRemoteCursors()});x=g.actions.addAction("points",function(){g.editor.graph.view.setUnit(mxConstants.POINTS)});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.POINTS});x=g.actions.addAction("inches",function(){g.editor.graph.view.setUnit(mxConstants.INCHES)});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.INCHES});x=g.actions.addAction("millimeters",
-function(){g.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.MILLIMETERS});x=g.actions.addAction("meters",function(){g.editor.graph.view.setUnit(mxConstants.METERS)});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,["points","inches","millimeters","meters"],
-d);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||g.menus.addMenuItems(y,["-","pageScale"],d)})));x=g.actions.addAction("pageTabs",function(){g.setTabContainerVisible(!g.isTabContainerVisible(),!0)});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.isTabContainerVisible()});x=g.actions.addAction("ruler",function(){g.setRulerVisible(!g.isRulerVisible())});x.setEnabled(Editor.canvasSupported&&9!=document.documentMode);x.setToggleAction(!0);x.setSelectedCallback(function(){return g.isRulerVisible()});
-x=g.actions.addAction("fullscreen",function(){if("1"==urlParams.embedInline)g.setInlineFullscreen(!Editor.inlineFullscreen);else{var y=mxUtils.isAncestorNode(document.body,g.container)?g.container:g.editor.graph.container;null!=y&&(null==document.fullscreenElement?(document.body.requestFullscreen(),y.classList.add("geFullscreen")):(document.exitFullscreen(),y.classList.remove("geFullscreen")))}});x.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&null!=document.body.requestFullscreen;
-x.setToggleAction(!0);x.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});x=g.actions.put("lightMode",new Action("light",function(y){g.setAndPersistDarkMode(!1)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&!Editor.isDarkMode()});x=g.actions.put("darkMode",new Action("dark",function(y){g.setAndPersistDarkMode(!0)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&
-Editor.isDarkMode()});x=g.actions.put("autoMode",new Action("automatic",function(y){g.setAndPersistDarkMode("auto")}));x.setToggleAction(!0);x.setSelectedCallback(function(){return g.isAutoDarkMode(!0)});g.actions.addAction("properties...",function(){g.getPublicUrl(g.getCurrentFile(),function(y){y=new FilePropertiesDialog(g,y);g.showDialog(y.container,360,null,!0,!0);y.init()})}).isEnabled=u;window.mxFreehand&&(x=g.actions.put("insertFreehand",new Action("freehand",function(){if(q.isEnabled()){if(null==
-g.freehandWindow){var y=mxSettings.getWindowState("freehand");g.freehandWindow=new FreehandWindow(g,null!=y&&null!=y.x?y.x:document.body.offsetWidth-420,null!=y&&null!=y.y?y.y:102,null!=y&&null!=y.w?y.w:180,null!=y&&null!=y.h?y.h:126,!0);g.installWindowPersistence("freehand",g.freehandWindow);null!=y&&g.restoreWindowState("freehand",g.freehandWindow)}q.freehand.isDrawing()?q.freehand.stopDrawing():q.freehand.startDrawing();g.freehandWindow.window.setVisible(q.freehand.isDrawing())}},null,null,"X")),
-x.isEnabled=function(){return u()},x.setToggleAction(!0),x.setSelectedCallback(function(){return null!=g.freehandWindow&&g.freehandWindow.window.isVisible()}));g.actions.put("exportXml",new Action("formatXml...",function(){var y=document.createElement("div");y.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,p=document.createElement("h3");mxUtils.write(p,mxResources.get("formatXml"));y.appendChild(p);p=document.createElement("div");p.className="geDialogSection";var A=g.addCheckbox(p,
-mxResources.get("selectionOnly"),!1,q.isSelectionEmpty(),null,null,null,null,!0),G=g.addCheckbox(p,mxResources.get("allPages"),!d,d,null,null,null,null,!0),I=g.addCheckbox(p,mxResources.get("compressed"),Editor.defaultCompressed,null,null,null,null,null,!0);y.appendChild(p);mxEvent.addListener(A,"change",function(){A.checked?G.setAttribute("disabled","disabled"):G.removeAttribute("disabled")});y=new CustomDialog(g,y,mxUtils.bind(this,function(){g.downloadFile("xml",!I.checked,null,!A.checked,d||!G.checked)}),
-null,mxResources.get("export"));g.showDialog(y.container,300,null,!0,!0)}));Editor.enableExportUrl&&g.actions.put("exportUrl",new Action("url...",function(){g.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(y,d,p,A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z){L=[];A&&Q&&(Q=ca?g.getHiddenTagsMap():null,L.push("tags="+encodeURIComponent(JSON.stringify(Q||{}))));y=new EmbedDialog(g,g.createLink(y,d,W,A,G,I,null,!0,L,null,p,null,Y,S,Z));g.showDialog(y.container,450,270,!0,!0,null,
-!1,null,new mxRectangle(0,0,400,250));y.init()},null,!0,!0)}));g.actions.put("exportJson",new Action("formatJson...",function(){var y=document.createElement("div");y.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,p=document.createElement("h3");mxUtils.write(p,mxResources.get("formatJson"));y.appendChild(p);p=document.createElement("div");p.className="geDialogSection";var A=g.editor.graph,G=g.addCheckbox(p,mxResources.get("selectionOnly"),!1,A.isSelectionEmpty(),null,null,null,null,
-!0),I=g.addCheckbox(p,mxResources.get("allPages"),!d,d,null,null,null,null,!0),L=g.addCheckbox(p,mxResources.get("includeCopyOfMyDiagram"),!1,null,null,null,null,null,!0),P=g.addCheckbox(p,mxResources.get("compressed"),Editor.defaultCompressed,!0,null,null,null,null,!0);y.appendChild(p);mxEvent.addListener(G,"change",function(){G.checked?I.setAttribute("disabled","disabled"):d||I.removeAttribute("disabled")});mxEvent.addListener(L,"change",function(){L.checked?P.removeAttribute("disabled"):P.setAttribute("disabled",
-"disabled")});y=new CustomDialog(g,y,mxUtils.bind(this,function(){var Q=G.checked&&!A.isSelectionEmpty(),ba=!Q&&!d&&I.checked;Q=g.createJsonForExport(ba,L.checked,L.checked&&P.checked,Q);g.saveData(g.getBaseFilename(ba)+".json","json",JSON.stringify(Q,null,2),"application/json")}),null,mxResources.get("export"));g.showDialog(y.container,300,null,!0,!0)}));g.actions.put("exportHtml",new Action("formatHtmlEmbedded...",function(){g.getPublicUrl(g.getCurrentFile(),function(y){g.showHtmlDialog(mxResources.get("export"),
-"https://www.drawio.com/docs/manual/export/embed-html/",y,function(d,p,A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z){g.createHtml(d,p,A,G,I,L,P,Q,ba,X,Y,mxUtils.bind(this,function(da,N){var aa=g.getBaseFilename(P);da='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(aa)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+da+"\n"+N+"\n</body>\n</html>";g.saveData(aa+(".drawio"==aa.substring(aa.lenth-7)?"":".drawio")+
-".html","html",da,"text/html")}),W,ca,S,Z)})})}));g.actions.put("exportPdf",new Action("formatPdf...",function(){g.showPrintDialog(mxResources.get("formatPdf"),!EditorUi.isElectronApp&&g.isPrintPdfExport()?null:mxUtils.bind(this,function(y,d){y=null!=g.pages?g.pages.length:1;var p=null==g.pages||1>=g.pages.length,A=g.getPageIndex(g.currentPage);A=null!=A?A+1:1;g.downloadFile("pdf",null,null,!d.selection,p||!d.allPages&&d.pagesFrom==A&&d.pagesTo==A,!d.crop,d.transparent,d.scale,null,d.grid,d.includeCopy,
-d.allPages||d.pagesFrom==A&&d.pagesTo==A?null:{from:Math.max(0,Math.min(y-1,d.pagesFrom-1)),to:Math.max(0,Math.min(y-1,d.pagesTo-1))},d.border,d.fit,d.sheetsAcross,d.sheetsDown,d.shadows,d.icons)}),mxResources.get("export"))}));g.actions.addAction("open...",function(){g.pickFile()});g.actions.addAction("close",function(){function y(){null!=d&&d.removeDraft();g.fileLoaded(new LocalFile(g,g.emptyDiagramXml,null,!0))}var d=g.getCurrentFile();null!=d&&d.isModified()?g.confirm(mxResources.get("allChangesLost"),
-null,y,mxResources.get("cancel"),mxResources.get("discardChanges")):y()});g.actions.addAction("extractText",function(y){y=q.getIndexableText(y||q.isSelectionEmpty()?null:q.getSelectionCells());y=new EmbedDialog(g,y,null,null,null,mxResources.get("extractText"));g.showDialog(y.container,450,240,!0,!0);y.init()});g.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==q.getSelectionCount()){var y=q.getSelectionCell(),d=q.view.getState(y);null!=d&&null!=d.shape&&null!=d.shape.stencil&&
-(y=new EditShapeDialog(g,y,mxResources.get("editShape")),g.showDialog(y.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),y.init())}}));g.actions.addAction("revisionHistory...",function(){g.isRevisionHistorySupported()?g.spinner.spin(document.body,mxResources.get("loading"))&&g.getRevisions(mxUtils.bind(this,function(y,d){g.spinner.stop();y=new RevisionDialog(g,y,d);g.showDialog(y.container,640,480,!0,!0);y.init()}),mxUtils.bind(this,function(y){g.handleError(null!=y?y:mxResources.get("notAvailable"))})):
-g.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});g.actions.addAction("createRevision",function(){g.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");x=g.actions.addAction("synchronize",function(){g.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");"none"==DrawioFile.SYNC&&(x.label=mxResources.get("refresh"));g.actions.addAction("upload...",function(){var y=g.getCurrentFile();null!=y&&(window.drawdata=
-g.getFileData(),y=null!=y.getTitle()?y.getTitle():g.defaultFilename,g.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(g.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(y),null,!0))},null,null,null,navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown);"undefined"!==typeof MathJax&&(x=g.actions.addAction("mathematicalTypesetting",function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.mathEnabled=!g.isMathEnabled();
-q.model.execute(y)}),x.setToggleAction(!0),x.setSelectedCallback(function(){return g.isMathEnabled()}),x.isEnabled=u);x=g.actions.put("defaultAdaptiveColors",new Action("defaultAdaptiveColors",function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.adaptiveColors="default";q.model.execute(y)}));x.getTitle=function(){return mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+")"};x.setToggleAction(!0);x.setSelectedCallback(function(){return null==
-q.adaptiveColors});x=g.actions.put("automaticAdaptiveColors",new Action("automatic",function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.adaptiveColors="auto";q.model.execute(y)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return"auto"==q.adaptiveColors});x=g.actions.put("simpleAdaptiveColors",new Action("simple",function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.adaptiveColors="simple";q.model.execute(y)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return"simple"==
-q.adaptiveColors});x=g.actions.put("noAdaptiveColors",new Action("none",function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.adaptiveColors="none";q.model.execute(y)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return"none"==q.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],d)})));var z=g.actions.addAction("autosave",
-function(){g.editor.setAutosave(!g.editor.autosave)});z.setToggleAction(!0);z.setSelectedCallback(function(){return z.isEnabled()&&g.editor.autosave});g.actions.addAction("editGeometry...",function(){for(var y=q.getSelectionCells(),d=[],p=0;p<y.length;p++)q.getModel().isVertex(y[p])&&d.push(y[p]);0<d.length&&(y=new EditGeometryDialog(g,d),g.showDialog(y.container,300,null,!0,!0),y.init())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+M");g.actions.addAction("copyStyle",function(){if(q.isEnabled()&&
-1==q.getSelectionCount()){var y=q.getSelectionCell(),d=q.getCellStyle(y,!1);g.copiedStyle={};var p=[],A=[],G;for(G in d)p.push(d[G]),A.push(G);q.copyCellStyles([y],A,p,g.copiedStyle,g.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");g.actions.addAction("pasteStyle",function(){q.isEnabled()&&!q.isSelectionEmpty()&&null!=g.copiedStyle&&q.pasteCellStyles(q.includeDescendantParts(q.getSelectionCells()),g.copiedStyle,g.copiedStyle,!0)},null,null,Editor.altKey+"+V");g.actions.addAction("copyTextStyle",
-function(){if(q.isEnabled()&&1==q.getSelectionCount()){var y=q.getSelectionCell();y=q.getCellStyle(y,!1);g.copiedTextStyle={};for(var d=0;d<Graph.pasteTextStyles.length;d++){var p=Graph.pasteTextStyles[d];null!=y[p]?g.copiedTextStyle[p]=y[p]:"fontStyle"==p&&(g.copiedTextStyle[p]=0)}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("pasteTextStyle",function(){q.isEnabled()&&!q.isSelectionEmpty()&&null!=g.copiedTextStyle&&q.pasteTextStyles(q.includeDescendantParts(q.getSelectionCells()),
-g.copiedTextStyle)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");g.actions.put("exportSvg",new Action("formatSvg...",function(){g.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(y,d,p,A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z,da){y=parseInt(y);g.lastExportSvgEditable=G;!isNaN(y)&&0<y&&g.exportSvg(y/100,d,p,A,G,I,L,!P,Q,ba,Y,W,ca,null,S,X,da)}),!0,g.lastExportSvgEditable,"svg",!0)}));g.actions.put("exportPng",
-new Action("formatPng...",function(){m("png",g.lastExportPngEditable,function(y,d,p,A,G){g.lastExportPngEditable=G})}));g.actions.put("exportJpg",new Action("formatJpg...",function(){m("jpeg")}));g.actions.put("exportWebp",new Action("formatWebp...",function(){m("webp")}));g.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif")+"...",function(){g.showAnimatedGifExportDialog()}));x=g.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var y=mxUtils.sortCells(q.model.getTopmostCells(q.getSelectionCells()));
-g.copyImage(y)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");x.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();x=g.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var y=mxUtils.sortCells(q.model.getTopmostCells(q.getSelectionCells()));g.copySvg(y)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");x.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();x=g.actions.put("shadowVisible",new Action("shadow",function(){q.setShadowVisible(!q.shadowVisible)}));
-x.setToggleAction(!0);x.setSelectedCallback(function(){return q.shadowVisible});g.actions.put("about",new Action("v"+EditorUi.VERSION,function(y,d){mxEvent.isShiftDown(d)&&(EditorUi.isElectronApp||g.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));g.actions.addAction("support...",function(){EditorUi.isElectronApp?g.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):
-g.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});g.actions.addAction("downloadDesktop...",function(){g.openLink("https://get.diagrams.net/")});g.actions.addAction("exportOptionsDisabled...",function(){g.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});g.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||navigator.standalone?g.openLink("https://app.diagrams.net/shortcuts.svg"):
-g.openLink("shortcuts.svg")});g.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?g.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):g.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});x=g.actions.addAction("tags",mxUtils.bind(this,function(){if(null==this.tagsWindow){var y=mxSettings.getWindowState("tags");this.tagsWindow=new TagsWindow(g,null!=y&&null!=y.x?y.x:document.body.offsetWidth-400,null!=y&&null!=y.y?y.y:60,null!=y&&null!=y.w?y.w:212,null!=
-y&&null!=y.h?y.h:200);this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("tags"))}));this.tagsWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("tags"))});g.installWindowPersistence("tags",this.tagsWindow);null!=y&&g.restoreWindowState("tags",this.tagsWindow);this.tagsWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("tags"))}else this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+
-"+K");x.setToggleAction(!0);x.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));x=g.actions.addAction("animation",mxUtils.bind(this,function(){if(null==this.animationWindow){var y=mxSettings.getWindowState("animation");this.animationWindow=new AnimationDialog(g,null!=y&&null!=y.x?y.x:Math.max(0,(document.body.offsetWidth-480)/2),null!=y&&null!=y.y?y.y:120,null!=y&&null!=y.w?y.w:480,null!=y&&null!=y.h?y.h:460);this.animationWindow.window.addListener("show",
-mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("animation"))}));this.animationWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("animation"))});g.installWindowPersistence("animation",this.animationWindow);null!=y&&g.restoreWindowState("animation",this.animationWindow);this.animationWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("animation"))}else this.animationWindow.window.setVisible(!this.animationWindow.window.isVisible())}));x.setToggleAction(!0);
-x.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.animationWindow&&this.animationWindow.window.isVisible()}));(EditorUi.isElectronApp&&(Editor.enableAi||null==Editor.config||null==Editor.config.enableAi&&null==Editor.config.enableChatGpt)||(Editor.enableAi||(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!g.isOffline()&&0<Editor.aiActions.length&&g.isExternalDataComms())&&"draw.io"==
-g.getServiceName()&&EditorUi.isMermaidSupported()&&(x=g.actions.put("generate",new Action("generate",function(){EditorUi.isElectronApp||Editor.enableAi?null!=g.chatWindow?g.chatWindow.window.setVisible(!g.chatWindow.window.isVisible()):g.openGenerateDialog(""):g.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),x.isEnabled=function(){return u()},x.setToggleAction(!0),x.setSelectedCallback(function(){return null!=
+Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.flowModelOrder="NODES_AND_EDGES";Menus.layoutContainers=function(){var m=function(q,u){u.resizeLayoutRoot=!0;u.resizeNodes=!1;return"childLayout="+Graph.encodeChildLayout([{layout:q,
+config:u}])+";"},g=function(q,u,x,z){return{width:u,height:x,style:"group;connectable=0;transparentBounds=1;groupPadding=20;"+z,sidebarStyle:"swimlane;html=1;startSize=20;horizontal="+(q?"0":"1")+";resizable=0;fontSize=12;transparentBounds=1;groupPadding=20;"+z}};return{horizontalFlow:g(!0,460,150,"containerType=tree;"+m("elkLayered",{"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.layered.considerModelOrder.strategy":Menus.flowModelOrder,"elk.padding":"[top=20,left=40,bottom=20,right=20]",
+edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),verticalFlow:g(!1,270,280,"containerType=tree;"+m("elkLayered",{"elk.direction":"DOWN","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.layered.considerModelOrder.strategy":Menus.flowModelOrder,"elk.padding":"[top=40,left=20,bottom=20,right=20]",edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),horizontalTree:g(!0,300,160,"containerType=tree;"+m("elkTree",{"elk.direction":"RIGHT","elk.spacing.nodeNode":"40",
+"elk.spacing.edgeNode":"20","elk.padding":"[top=20,left=40,bottom=20,right=20]",corners:"rounded"})),verticalTree:g(!1,280,180,"containerType=tree;"+m("elkTree",{"elk.direction":"DOWN","elk.spacing.nodeNode":"40","elk.spacing.edgeNode":"20","elk.padding":"[top=40,left=20,bottom=20,right=20]",corners:"rounded"})),radialTree:g(!1,320,320,"containerType=tree;"+m("elkRadial",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),organic:g(!1,320,320,m("elkOrganic",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),
+circle:g(!1,320,320,"childLayout=circleLayout;")}}();Menus.layoutContainerEdgeStyle="html=1;rounded=1;curved=0;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startSize=6;endSize=6;";Menus.prototype.createHelpLink=function(m){return this.editorUi.createHelpIcon(m)};Menus.prototype.addLinkToItem=function(m,g){null!=m&&m.firstChild.nextSibling.appendChild(this.createHelpLink(g))};Menus.prototype.removeCustomFont=function(m,g){for(var q=0;q<this.customFonts.length;q++)if(this.customFonts[q].name==
+m&&this.customFonts[q].url==g){this.customFonts.splice(q,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(m,g){for(var q=0;q<this.customFonts.length;q++)if(this.customFonts[q].name==m&&this.customFonts[q].url==g)return!0;for(q=0;q<this.defaultFonts.length;q++){var u=this.defaultFonts[q];if("string"!==typeof u&&u.fontFamily==m&&u.fontUrl==g||"string"===typeof u&&u==m&&null==g)return!0}return!1};Menus.prototype.addCustomFont=
+function(m,g){null==m||this.containsFont(m,g)||(this.customFonts.push({name:m,url:g}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var k=Menus.prototype.init;Menus.prototype.init=function(){function m(y,d,p){g.editor.isExportToCanvas()?g.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z,da,N,aa){da=parseInt(A);!isNaN(da)&&
+0<da&&(g.exportImage(da/100,G&&"png"==y,J,L,P&&"png"==y,ba,!W,Y,y,ca,"png"==y?aa:null,S,Z),null!=p&&p(A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z))}),!0,d,y,!0):!g.isRemoteExportEnabled()||mxClient.IS_IOS&&navigator.standalone||g.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(A,G,J,L,P){g.downloadFile(G&&"png"==y?"xmlpng":y,null,null,A,null,null,J,L,P)}),!1,!0)}k.apply(this,arguments);var g=this.editorUi,q=g.editor.graph,u=mxUtils.bind(q,q.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=
+this.defaultMenuItems.filter(function(y){return"file"!=y}));g.actions.addAction("new...",function(){var y=g.isOffline(),d=new NewDialog(g,y,!(g.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));g.showDialog(d.container,y?350:620,y?70:460,!0,!0,function(p){null!=g.sidebar&&g.sidebar.hideTooltip();p&&null==g.getCurrentFile()&&g.showSplash()});d.init()});g.actions.put("insertTemplate",new Action("template...",function(){g.openTemplateDialog()})).isEnabled=u;var x=mxResources.get("page");g.actions.put("insertPage",
+new Action(mxResources.get("insertPage"),function(){try{g.insertPage()}catch(y){g.handleError(y)}})).isEnabled=function(){return null!=g.currentPage};g.actions.put("removePage",new Action(mxResources.get("removeIt",[x]),function(){g.removePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("renamePage",new Action(mxResources.get("renameIt",[x])+"...",function(){g.renamePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("duplicatePage",
+new Action(mxResources.get("duplicateIt",[x]),function(){var y=g.currentPage;g.duplicatePage(y,mxResources.get("copyOf",[y.getName()]))})).isEnabled=function(){return null!=g.currentPage};g.actions.put("sortPages",new Action(mxResources.get("sortPages"),function(){g.sortPages()})).isEnabled=function(){return null!=g.pages&&1<g.pages.length&&g.editor.graph.isEnabled()};x=g.actions.addAction("shareCursor",function(){g.setShareCursorPosition(!g.isShareCursorPosition())});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.isShareCursorPosition()});
+x=g.actions.addAction("showRemoteCursors",function(){g.setShowRemoteCursors(!g.isShowRemoteCursors())});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.isShowRemoteCursors()});x=g.actions.addAction("points",function(){g.editor.graph.view.setUnit(mxConstants.POINTS)});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.POINTS});x=g.actions.addAction("inches",function(){g.editor.graph.view.setUnit(mxConstants.INCHES)});x.setToggleAction(!0);
+x.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.INCHES});x=g.actions.addAction("millimeters",function(){g.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.MILLIMETERS});x=g.actions.addAction("meters",function(){g.editor.graph.view.setUnit(mxConstants.METERS)});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.METERS});
+this.put("units",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,["points","inches","millimeters","meters"],d);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||g.menus.addMenuItems(y,["-","pageScale"],d)})));x=g.actions.addAction("pageTabs",function(){g.setTabContainerVisible(!g.isTabContainerVisible(),!0)});x.setToggleAction(!0);x.setSelectedCallback(function(){return g.isTabContainerVisible()});x=g.actions.addAction("ruler",function(){g.setRulerVisible(!g.isRulerVisible())});
+x.setEnabled(Editor.canvasSupported&&9!=document.documentMode);x.setToggleAction(!0);x.setSelectedCallback(function(){return g.isRulerVisible()});x=g.actions.addAction("fullscreen",function(){if("1"==urlParams.embedInline)g.setInlineFullscreen(!Editor.inlineFullscreen);else{var y=mxUtils.isAncestorNode(document.body,g.container)?g.container:g.editor.graph.container;null!=y&&(null==document.fullscreenElement?(document.body.requestFullscreen(),y.classList.add("geFullscreen")):(document.exitFullscreen(),
+y.classList.remove("geFullscreen")))}});x.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&null!=document.body.requestFullscreen;x.setToggleAction(!0);x.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});x=g.actions.put("lightMode",new Action("light",function(y){g.setAndPersistDarkMode(!1)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&!Editor.isDarkMode()});
+x=g.actions.put("darkMode",new Action("dark",function(y){g.setAndPersistDarkMode(!0)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&Editor.isDarkMode()});x=g.actions.put("autoMode",new Action("automatic",function(y){g.setAndPersistDarkMode("auto")}));x.setToggleAction(!0);x.setSelectedCallback(function(){return g.isAutoDarkMode(!0)});g.actions.addAction("properties...",function(){g.getPublicUrl(g.getCurrentFile(),function(y){y=new FilePropertiesDialog(g,y);
+g.showDialog(y.container,360,null,!0,!0);y.init()})}).isEnabled=u;window.mxFreehand&&(x=g.actions.put("insertFreehand",new Action("freehand",function(){if(q.isEnabled()){if(null==g.freehandWindow){var y=mxSettings.getWindowState("freehand");g.freehandWindow=new FreehandWindow(g,null!=y&&null!=y.x?y.x:document.body.offsetWidth-420,null!=y&&null!=y.y?y.y:102,null!=y&&null!=y.w?y.w:180,null!=y&&null!=y.h?y.h:126,!0);g.installWindowPersistence("freehand",g.freehandWindow);null!=y&&g.restoreWindowState("freehand",
+g.freehandWindow)}q.freehand.isDrawing()?q.freehand.stopDrawing():q.freehand.startDrawing();g.freehandWindow.window.setVisible(q.freehand.isDrawing())}},null,null,"X")),x.isEnabled=function(){return u()},x.setToggleAction(!0),x.setSelectedCallback(function(){return null!=g.freehandWindow&&g.freehandWindow.window.isVisible()}));g.actions.put("exportXml",new Action("formatXml...",function(){var y=document.createElement("div");y.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,p=document.createElement("h3");
+mxUtils.write(p,mxResources.get("formatXml"));y.appendChild(p);p=document.createElement("div");p.className="geDialogSection";var A=g.addCheckbox(p,mxResources.get("selectionOnly"),!1,q.isSelectionEmpty(),null,null,null,null,!0),G=g.addCheckbox(p,mxResources.get("allPages"),!d,d,null,null,null,null,!0),J=g.addCheckbox(p,mxResources.get("compressed"),Editor.defaultCompressed,null,null,null,null,null,!0);y.appendChild(p);mxEvent.addListener(A,"change",function(){A.checked?G.setAttribute("disabled","disabled"):
+G.removeAttribute("disabled")});y=new CustomDialog(g,y,mxUtils.bind(this,function(){g.downloadFile("xml",!J.checked,null,!A.checked,d||!G.checked)}),null,mxResources.get("export"));g.showDialog(y.container,300,null,!0,!0)}));Editor.enableExportUrl&&g.actions.put("exportUrl",new Action("url...",function(){g.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(y,d,p,A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z){L=[];A&&Q&&(Q=ca?g.getHiddenTagsMap():null,L.push("tags="+encodeURIComponent(JSON.stringify(Q||
+{}))));y=new EmbedDialog(g,g.createLink(y,d,X,A,G,J,null,!0,L,null,p,null,Y,S,Z));g.showDialog(y.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));y.init()},null,!0,!0)}));g.actions.put("exportJson",new Action("formatJson...",function(){var y=document.createElement("div");y.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,p=document.createElement("h3");mxUtils.write(p,mxResources.get("formatJson"));y.appendChild(p);p=document.createElement("div");p.className="geDialogSection";
+var A=g.editor.graph,G=g.addCheckbox(p,mxResources.get("selectionOnly"),!1,A.isSelectionEmpty(),null,null,null,null,!0),J=g.addCheckbox(p,mxResources.get("allPages"),!d,d,null,null,null,null,!0),L=g.addCheckbox(p,mxResources.get("includeCopyOfMyDiagram"),!1,null,null,null,null,null,!0),P=g.addCheckbox(p,mxResources.get("compressed"),Editor.defaultCompressed,!0,null,null,null,null,!0);y.appendChild(p);mxEvent.addListener(G,"change",function(){G.checked?J.setAttribute("disabled","disabled"):d||J.removeAttribute("disabled")});
+mxEvent.addListener(L,"change",function(){L.checked?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled")});y=new CustomDialog(g,y,mxUtils.bind(this,function(){var Q=G.checked&&!A.isSelectionEmpty(),ba=!Q&&!d&&J.checked;Q=g.createJsonForExport(ba,L.checked,L.checked&&P.checked,Q);g.saveData(g.getBaseFilename(ba)+".json","json",JSON.stringify(Q,null,2),"application/json")}),null,mxResources.get("export"));g.showDialog(y.container,300,null,!0,!0)}));g.actions.put("exportHtml",new Action("formatHtmlEmbedded...",
+function(){g.getPublicUrl(g.getCurrentFile(),function(y){g.showHtmlDialog(mxResources.get("export"),"https://www.drawio.com/docs/manual/export/embed-html/",y,function(d,p,A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z){g.createHtml(d,p,A,G,J,L,P,Q,ba,W,Y,mxUtils.bind(this,function(da,N){var aa=g.getBaseFilename(P);da='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(aa)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+
+da+"\n"+N+"\n</body>\n</html>";g.saveData(aa+(".drawio"==aa.substring(aa.lenth-7)?"":".drawio")+".html","html",da,"text/html")}),X,ca,S,Z)})})}));g.actions.put("exportPdf",new Action("formatPdf...",function(){g.showPrintDialog(mxResources.get("formatPdf"),!EditorUi.isElectronApp&&g.isPrintPdfExport()?null:mxUtils.bind(this,function(y,d){y=null!=g.pages?g.pages.length:1;var p=null==g.pages||1>=g.pages.length,A=g.getPageIndex(g.currentPage);A=null!=A?A+1:1;g.downloadFile("pdf",null,null,!d.selection,
+p||!d.allPages&&d.pagesFrom==A&&d.pagesTo==A,!d.crop,d.transparent,d.scale,null,d.grid,d.includeCopy,d.allPages||d.pagesFrom==A&&d.pagesTo==A?null:{from:Math.max(0,Math.min(y-1,d.pagesFrom-1)),to:Math.max(0,Math.min(y-1,d.pagesTo-1))},d.border,d.fit,d.sheetsAcross,d.sheetsDown,d.shadows,d.icons)}),mxResources.get("export"))}));g.actions.addAction("open...",function(){g.pickFile()});g.actions.addAction("close",function(){function y(){null!=d&&d.removeDraft();g.fileLoaded(new LocalFile(g,g.emptyDiagramXml,
+null,!0))}var d=g.getCurrentFile();null!=d&&d.isModified()?g.confirm(mxResources.get("allChangesLost"),null,y,mxResources.get("cancel"),mxResources.get("discardChanges")):y()});g.actions.addAction("extractText",function(y){y=q.getIndexableText(y||q.isSelectionEmpty()?null:q.getSelectionCells());y=new EmbedDialog(g,y,null,null,null,mxResources.get("extractText"));g.showDialog(y.container,450,240,!0,!0);y.init()});g.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==q.getSelectionCount()){var y=
+q.getSelectionCell(),d=q.view.getState(y);null!=d&&null!=d.shape&&null!=d.shape.stencil&&(y=new EditShapeDialog(g,y,mxResources.get("editShape")),g.showDialog(y.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),y.init())}}));g.actions.addAction("revisionHistory...",function(){g.isRevisionHistorySupported()?g.spinner.spin(document.body,mxResources.get("loading"))&&g.getRevisions(mxUtils.bind(this,function(y,d){g.spinner.stop();y=new RevisionDialog(g,y,d);g.showDialog(y.container,
+640,480,!0,!0);y.init()}),mxUtils.bind(this,function(y){g.handleError(null!=y?y:mxResources.get("notAvailable"))})):g.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});g.actions.addAction("createRevision",function(){g.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");x=g.actions.addAction("synchronize",function(){g.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");"none"==DrawioFile.SYNC&&(x.label=
+mxResources.get("refresh"));g.actions.addAction("upload...",function(){var y=g.getCurrentFile();null!=y&&(window.drawdata=g.getFileData(),y=null!=y.getTitle()?y.getTitle():g.defaultFilename,g.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(g.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(y),null,!0))},null,null,null,navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown);"undefined"!==typeof MathJax&&(x=g.actions.addAction("mathematicalTypesetting",
+function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.mathEnabled=!g.isMathEnabled();q.model.execute(y)}),x.setToggleAction(!0),x.setSelectedCallback(function(){return g.isMathEnabled()}),x.isEnabled=u);x=g.actions.put("defaultAdaptiveColors",new Action("defaultAdaptiveColors",function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.adaptiveColors="default";q.model.execute(y)}));x.getTitle=function(){return mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+
+")"};x.setToggleAction(!0);x.setSelectedCallback(function(){return null==q.adaptiveColors});x=g.actions.put("automaticAdaptiveColors",new Action("automatic",function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.adaptiveColors="auto";q.model.execute(y)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return"auto"==q.adaptiveColors});x=g.actions.put("simpleAdaptiveColors",new Action("simple",function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.adaptiveColors=
+"simple";q.model.execute(y)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return"simple"==q.adaptiveColors});x=g.actions.put("noAdaptiveColors",new Action("none",function(){var y=new ChangePageSetup(g);y.ignoreColor=!0;y.ignoreImage=!0;y.adaptiveColors="none";q.model.execute(y)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return"none"==q.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,["defaultAdaptiveColors","-","automaticAdaptiveColors",
+"simpleAdaptiveColors","noAdaptiveColors"],d)})));var z=g.actions.addAction("autosave",function(){g.editor.setAutosave(!g.editor.autosave)});z.setToggleAction(!0);z.setSelectedCallback(function(){return z.isEnabled()&&g.editor.autosave});g.actions.addAction("editGeometry...",function(){for(var y=q.getSelectionCells(),d=[],p=0;p<y.length;p++)q.getModel().isVertex(y[p])&&d.push(y[p]);0<d.length&&(y=new EditGeometryDialog(g,d),g.showDialog(y.container,300,null,!0,!0),y.init())},null,null,Editor.ctrlKey+
+"+"+Editor.shiftKey+"+M");g.actions.addAction("copyStyle",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var y=q.getSelectionCell(),d=q.getCellStyle(y,!1);g.copiedStyle={};var p=[],A=[],G;for(G in d)p.push(d[G]),A.push(G);q.copyCellStyles([y],A,p,g.copiedStyle,g.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");g.actions.addAction("pasteStyle",function(){q.isEnabled()&&!q.isSelectionEmpty()&&null!=g.copiedStyle&&q.pasteCellStyles(q.includeDescendantParts(q.getSelectionCells()),
+g.copiedStyle,g.copiedStyle,!0)},null,null,Editor.altKey+"+V");g.actions.addAction("copyTextStyle",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var y=q.getSelectionCell();y=q.getCellStyle(y,!1);g.copiedTextStyle={};for(var d=0;d<Graph.pasteTextStyles.length;d++){var p=Graph.pasteTextStyles[d];null!=y[p]?g.copiedTextStyle[p]=y[p]:"fontStyle"==p&&(g.copiedTextStyle[p]=0)}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("pasteTextStyle",function(){q.isEnabled()&&!q.isSelectionEmpty()&&
+null!=g.copiedTextStyle&&q.pasteTextStyles(q.includeDescendantParts(q.getSelectionCells()),g.copiedTextStyle)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");g.actions.put("exportSvg",new Action("formatSvg...",function(){g.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(y,d,p,A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z,da){y=parseInt(y);g.lastExportSvgEditable=G;!isNaN(y)&&0<y&&g.exportSvg(y/100,d,p,A,G,J,L,!P,
+Q,ba,Y,X,ca,null,S,W,da)}),!0,g.lastExportSvgEditable,"svg",!0)}));g.actions.put("exportPng",new Action("formatPng...",function(){m("png",g.lastExportPngEditable,function(y,d,p,A,G){g.lastExportPngEditable=G})}));g.actions.put("exportJpg",new Action("formatJpg...",function(){m("jpeg")}));g.actions.put("exportWebp",new Action("formatWebp...",function(){m("webp")}));g.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif")+"...",function(){g.showAnimatedGifExportDialog()}));
+x=g.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var y=mxUtils.sortCells(q.model.getTopmostCells(q.getSelectionCells()));g.copyImage(y)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");x.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();x=g.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var y=mxUtils.sortCells(q.model.getTopmostCells(q.getSelectionCells()));g.copySvg(y)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");x.visible=Editor.enableNativeClipboard&&
+g.editor.isExportToCanvas();x=g.actions.put("shadowVisible",new Action("shadow",function(){q.setShadowVisible(!q.shadowVisible)}));x.setToggleAction(!0);x.setSelectedCallback(function(){return q.shadowVisible});g.actions.put("about",new Action("v"+EditorUi.VERSION,function(y,d){mxEvent.isShiftDown(d)&&(EditorUi.isElectronApp||g.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));g.actions.addAction("support...",
+function(){EditorUi.isElectronApp?g.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):g.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});g.actions.addAction("downloadDesktop...",function(){g.openLink("https://get.diagrams.net/")});g.actions.addAction("exportOptionsDisabled...",function(){g.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});g.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||
+EditorUi.isElectronApp||navigator.standalone?g.openLink("https://app.diagrams.net/shortcuts.svg"):g.openLink("shortcuts.svg")});g.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?g.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):g.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});x=g.actions.addAction("tags",mxUtils.bind(this,function(){if(null==this.tagsWindow){var y=mxSettings.getWindowState("tags");this.tagsWindow=new TagsWindow(g,null!=y&&null!=
+y.x?y.x:document.body.offsetWidth-400,null!=y&&null!=y.y?y.y:60,null!=y&&null!=y.w?y.w:212,null!=y&&null!=y.h?y.h:200);this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("tags"))}));this.tagsWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("tags"))});g.installWindowPersistence("tags",this.tagsWindow);null!=y&&g.restoreWindowState("tags",this.tagsWindow);this.tagsWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("tags"))}else this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),
+null,null,Editor.ctrlKey+"+K");x.setToggleAction(!0);x.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));x=g.actions.addAction("animation",mxUtils.bind(this,function(){if(null==this.animationWindow){var y=mxSettings.getWindowState("animation");this.animationWindow=new AnimationDialog(g,null!=y&&null!=y.x?y.x:Math.max(0,(document.body.offsetWidth-480)/2),null!=y&&null!=y.y?y.y:120,null!=y&&null!=y.w?y.w:480,null!=y&&null!=y.h?y.h:460);
+this.animationWindow.window.addListener("show",mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("animation"))}));this.animationWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("animation"))});g.installWindowPersistence("animation",this.animationWindow);null!=y&&g.restoreWindowState("animation",this.animationWindow);this.animationWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("animation"))}else this.animationWindow.window.setVisible(!this.animationWindow.window.isVisible())}));
+x.setToggleAction(!0);x.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.animationWindow&&this.animationWindow.window.isVisible()}));(EditorUi.isElectronApp&&(Editor.enableAi||null==Editor.config||null==Editor.config.enableAi&&null==Editor.config.enableChatGpt)||(Editor.enableAi||(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!g.isOffline()&&0<Editor.aiActions.length&&g.isExternalDataComms())&&
+"draw.io"==g.getServiceName()&&EditorUi.isMermaidSupported()&&(x=g.actions.put("generate",new Action("generate",function(){EditorUi.isElectronApp||Editor.enableAi?null!=g.chatWindow?g.chatWindow.window.setVisible(!g.chatWindow.window.isVisible()):g.openGenerateDialog(""):g.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),x.isEnabled=function(){return u()},x.setToggleAction(!0),x.setSelectedCallback(function(){return null!=
g.chatWindow&&g.chatWindow.window.isVisible()}));x=g.actions.addAction("findReplace",mxUtils.bind(this,function(y,d){g.showSearchWindow(q.isEnabled()&&(null==d||!mxEvent.isShiftDown(d)))}),null,null,Editor.ctrlKey+"+F");x=new Action("exportVsdx",function(){var y=null==g.pages||1>=g.pages.length;if(y)g.exportVisio();else{var d=document.createElement("div");d.style.whiteSpace="nowrap";var p=document.createElement("h3");mxUtils.write(p,mxResources.get("formatVsdx"));d.appendChild(p);p=document.createElement("div");
p.className="geDialogSection";var A=g.addCheckbox(p,mxResources.get("allPages"),!y,y);d.appendChild(p);y=new CustomDialog(g,d,mxUtils.bind(this,function(){g.exportVisio(!A.checked)}),null,mxResources.get("export"));g.showDialog(y.container,300,146,!0,!0)}});x.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};g.actions.put("exportVsdx",x);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&g.actions.addAction("configuration...",function(){var y=[[mxResources.get("reset"),
function(){g.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),g.hideDialog(),g.alert(mxResources.get("restartForChangeRequired"))}catch(p){g.handleError(p)}})}]];if(!g.isOfflineApp()&&isLocalStorage&&g.mode!=App.MODE_ATLAS){var d=g.actions.get("plugins");null==d||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||y.push([mxResources.get("plugins"),d.funct])}EditorUi.isElectronApp||y.push([mxResources.get("link"),
-function(p,A){if(0<A.value.length)try{var G=JSON.parse(A.value),I=window.location.protocol+"//"+window.location.host+"/"+g.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(G)),L=new EmbedDialog(g,I);g.showDialog(L.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));L.init()}catch(P){g.handleError(P)}else g.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=g.getServiceName()&&"1"!=urlParams.embed&&y.push([mxResources.get("preferences"),function(){g.showLocalStorageDialog(mxResources.get("preferences")+
+function(p,A){if(0<A.value.length)try{var G=JSON.parse(A.value),J=window.location.protocol+"//"+window.location.host+"/"+g.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(G)),L=new EmbedDialog(g,J);g.showDialog(L.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));L.init()}catch(P){g.handleError(P)}else g.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=g.getServiceName()&&"1"!=urlParams.embed&&y.push([mxResources.get("preferences"),function(){g.showLocalStorageDialog(mxResources.get("preferences")+
":",Editor.settingsKey,[[mxResources.get("reset"),function(){g.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.settingsKey),localStorage.removeItem(".drawio-config"),g.hideDialog(),g.alert(mxResources.get("restartForChangeRequired"))}catch(p){g.handleError(p)}})}]])}]);g.showConfigurationEditorDialog(mxResources.get("configuration")+":",Editor.configurationKey,y,"https://www.drawio.com/doc/faq/configure-diagram-editor")});if(mxClient.IS_CHROMEAPP||isLocalStorage)g.updateOfflineLanguages(),
-this.put("language",new Menu(mxUtils.bind(this,function(y,d){g.updateOfflineLanguages();var p=mxLanguage;null==urlParams.lang&&isLocalStorage&&(p=mxSettings.settings.language);var A=mxUtils.bind(this,function(I){var L=""==I?mxResources.get("automatic"):mxLanguageMap[I],P=null;if(""!=L){var Q=g.isLanguageAvailableOffline(I);P=y.addItem(L,null,mxUtils.bind(this,function(){g.setAndPersistLanguage(I)}),d,null,Q);Q||P.setAttribute("title",mxResources.get("notInOffline"));(I==p||""==I&&null==p)&&y.addCheckmark(P,
+this.put("language",new Menu(mxUtils.bind(this,function(y,d){g.updateOfflineLanguages();var p=mxLanguage;null==urlParams.lang&&isLocalStorage&&(p=mxSettings.settings.language);var A=mxUtils.bind(this,function(J){var L=""==J?mxResources.get("automatic"):mxLanguageMap[J],P=null;if(""!=L){var Q=g.isLanguageAvailableOffline(J);P=y.addItem(L,null,mxUtils.bind(this,function(){g.setAndPersistLanguage(J)}),d,null,Q);Q||P.setAttribute("title",mxResources.get("notInOffline"));(J==p||""==J&&null==p)&&y.addCheckmark(P,
Editor.checkmarkImage)}return P});A("");y.addSeparator(d);for(var G in mxLanguageMap)A(G);"serviceWorker"in navigator&&null!=navigator.serviceWorker.controller&&(y.addSeparator(d),y.addItem(mxResources.get("manage")+"...",null,mxUtils.bind(this,function(){g.showLanguageDialog()}),d))})));g.customLayoutConfig=[];g.actions.addAction("runLayout",function(){g.showCustomLayoutDialog(JSON.stringify(g.customLayoutConfig,null,2))});g.actions.addAction("runLastLayout",function(){null!=g.lastLayoutSpec&&g.executeLayoutSpec(g.lastLayoutSpec,
null,!0)},null,null,Editor.ctrlKey+"+"+Editor.altKey+"+T");g.actions.put("adaptiveColors",new Action("adaptiveColors",function(y){null==g.adaptiveColorsWindow&&(g.adaptiveColorsWindow=new AdaptiveColorsWindow(g,document.body.offsetWidth-520,80,220,180));g.adaptiveColorsWindow.window.setVisible(!0)}));x=this.get("viewZoom");var F=x.funct;x.funct=mxUtils.bind(this,function(y,d){F.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(y,["-","outline","fullscreen"],
-d)});var J=this;x=this.get("layout");var H=x.funct;this.put("legacyLayout",new Menu(H));x.funct=function(y,d){var p=g.actions.get("runLastLayout"),A=y.addItem(mxResources.get("runLastLayout"),null,function(){p.funct()},d,null,u()&&null!=g.lastLayoutSpec);J.addShortcut(A,p);y.addSeparator(d);"undefined"!==typeof ElkLayout?(A=function(G){y.addItem(mxResources.get(G)+"...",null,function(){var I=ElkLayout.MENU_PRESETS[G];ElkLayout.runWithDialog(g,I.algorithm,I.options,mxResources.get(G))},d,null,u())},
-A("verticalFlow"),A("horizontalFlow"),y.addSeparator(d),A("verticalTree"),A("horizontalTree"),A("radialTree"),y.addSeparator(d),A("organic")):H.apply(this,arguments);y.addItem(mxResources.get("orgChart")+"...",null,function(){for(var G=null,I=20,L=20,P=function(){"undefined"!==typeof mxOrgChartLayout&&null!=G&&g.tryAndHandle(mxUtils.bind(this,function(){var da=g.editor.graph,N=new mxOrgChartLayout(da,G,I,L),aa=da.getDefaultParent();1<da.model.getChildCount(da.getSelectionCell())&&(aa=da.getSelectionCell());
-N.execute(aa)}))},Q=document.createElement("div"),ba=function(da,N){var aa=document.createElement("div");aa.style.marginBottom="8px";var ea=document.createElement("div");ea.style.display="inline-block";ea.style.width="180px";ea.style.verticalAlign="middle";mxUtils.write(ea,mxResources.get(da)+": ");aa.appendChild(ea);N.style.width="160px";N.style.boxSizing="border-box";N.style.verticalAlign="middle";aa.appendChild(N);Q.appendChild(aa)},X=document.createElement("select"),Y=[mxResources.get("linear"),
-mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],W=0;W<Y.length;W++){var ca=document.createElement("option");mxUtils.write(ca,Y[W]);ca.value=W;2==W&&ca.setAttribute("selected","selected");X.appendChild(ca)}mxEvent.addListener(X,"change",function(){G=X.value});ba("orgChartType",X);var S=document.createElement("input");S.type="number";S.value=I;mxEvent.addListener(S,
-"change",function(){I=S.value});ba("parentChildSpacing",S);var Z=document.createElement("input");Z.type="number";Z.value=L;mxEvent.addListener(Z,"change",function(){L=Z.value});ba("siblingSpacing",Z);ba=new CustomDialog(g,Q,function(){null==G&&(G=2);g.loadOrgChartLayouts(P)},null,null,"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");g.showDialog(ba.container,355,null,!0,!0)},d,null,u());y.addItem(mxResources.get("circle"),null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,
-function(){var G=g.getSelectedLayoutContainer();if(null!=G)g.setContainerChildLayout(G,"circleLayout");else{var I=new mxCircleLayout(q);g.executeLayout(function(){var L=q.getSelectionCell();if(null==L||0==q.getModel().getChildCount(L))L=q.getDefaultParent();I.execute(L);q.getModel().isVertex(L)&&q.updateGroupBounds([L],2*q.gridSize,!0)},!0)}}))}),d);y.addSeparator(d);"undefined"!==typeof LibavoidRouting&&y.addItem(mxResources.get("orthogonalRouting")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,
-function(){g.prompt(mxResources.get("spacing"),LibavoidRouting.shapeBufferDistance,mxUtils.bind(this,function(G){g.tryAndHandle(mxUtils.bind(this,function(){var I=parseFloat(G);LibavoidRouting.run(g,isNaN(I)?null:{shapeBufferDistance:I})}))}))}))}),d);y.addItem(mxResources.get("parallels")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,function(){var G=new mxParallelEdgeLayout(q);G.checkOverlap=!0;g.prompt(mxResources.get("spacing"),G.spacing,mxUtils.bind(this,function(I){g.tryAndHandle(mxUtils.bind(this,
-function(){G.spacing=I;g.lastLayoutSpec=[{layout:"mxParallelEdgeLayout",config:{spacing:G.spacing,checkOverlap:!0}}];var L=g.getSelectedLayoutContainer();null!=L?g.setContainerChildLayout(L,g.lastLayoutSpec):g.executeLayout(function(){G.execute(q.getDefaultParent(),q.isSelectionEmpty()?null:q.getSelectionCells())},!1)}))}))}))}),d);"undefined"!==typeof ElkLayout&&(y.addSeparator(d),g.menus.addSubmenu("legacyLayout",y,d,mxResources.get("legacyLayouts")));y.addSeparator(d);g.menus.addMenuItem(y,"runLayout",
-d,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(y,d){if(mxClient.IS_CHROMEAPP||!g.isOffline()&&!navigator.standalone){var p=y.addItem(mxResources.get("search")+":",null,null,d,null,null,!1);p.style.cursor="default";var A=document.createElement("input");A.setAttribute("type","text");A.setAttribute("size","25");A.style.borderWidth="1px";A.style.marginLeft="8px";mxEvent.addListener(A,"keydown",mxUtils.bind(this,function(G){var I=mxUtils.trim(A.value);
-13==G.keyCode&&0<I.length?(this.editorUi.searchHelp(I),A.value="",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==G.keyCode&&(A.value="")}));p.firstChild.nextSibling.appendChild(A);mxEvent.addGestureListeners(A,function(G){document.activeElement!=A&&A.focus();mxEvent.consume(G)},function(G){mxEvent.consume(G)},function(G){mxEvent.consume(G)});window.setTimeout(function(){A.focus()},0);EditorUi.isElectronApp?(g.actions.addAction("website...",function(){g.openLink("https://www.drawio.com")}),
-g.actions.addAction("check4Updates",function(){g.checkForUpdates()}),g.actions.put("desktopZoomIn",new Action("zoomIn",function(){g.desktopZoomIn()})),g.actions.put("desktopZoomOut",new Action("zoomOut",function(){g.desktopZoomOut()})),g.actions.put("desktopResetZoom",new Action("actualSize",function(){g.desktopResetZoom()})),this.addMenuItems(y,"- keyboardShortcuts quickStart website support -".split(" "),d),"1"!=urlParams.disableUpdate&&this.addMenuItems(y,["check4Updates","-"],d),this.addMenuItems(y,
-"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),d)):this.addMenuItems(y,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),d)}else this.addMenuItems(y,["keyboardShortcuts","-","about"],d);"1"==urlParams.test&&(y.addSeparator(d),this.addSubmenu("testDevelop",y,d))})));g.actions.addAction("languageCode...",function(){var y=new FilenameDialog(g,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(d){null!=d&&(Graph.diagramLanguage=
-0<d.length?d:null,Graph.translateDiagram=!0,q.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");g.showDialog(y.container,340,80,!0,!0);y.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,["languageCode","-"],d);d=y.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;q.refresh()},d);Graph.translateDiagram||y.addCheckmark(d,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");
-mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.parse("testCheckPages=Check Pages");mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");mxResources.parse("testOptimize=Remove Inline Images");
-mxResources.parse("testPerformance=Performance");g.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!q.isSelectionEmpty()){var y=q.cloneCells(q.getSelectionCells()),d=q.getBoundingBoxFromGeometry(y,!0);y=q.moveCells(y,-d.x,-d.y);g.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+d.width+", "+d.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(q.encodeCells(y)))+"'),")}}));g.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function y(L){return null==
-L||null==L.boundingBox||!isNaN(L.boundingBox.x)&&!isNaN(L.boundingBox.y)&&!isNaN(L.boundingBox.width)&&!isNaN(L.boundingBox.height)}var d=q.isSelectionEmpty()?q.getGraphBounds():q.getBoundingBox(q.getSelectionCells()),p=q.view.translate,A=q.view.scale;q.insertVertex(q.getDefaultParent(),null,"",d.x/A-p.x,d.y/A-p.y,d.width/A,d.height/A,"fillColor=none;strokeColor=red;");var G=0,I=0;q.view.states.visit(function(L,P){L=!0;y(P.shape)||(console.log("invalid shape",P.cell.id,P.shape),L=!1);y(P.text)||(console.log("invalid text",
-P.cell.id,P.text),L=!1);L||G++;I++});console.log("states checked",I,"invalid",G)}));g.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var y=null!=g.pages&&null!=g.getCurrentFile()?g.getCurrentFile().getAnonymizedXmlForPages(g.pages):"";y=new TextareaDialog(g,"Paste Data:",y,function(d){if(0<d.length)try{var p=function(P){function Q(aa){if(null==N[aa]){if(N[aa]=!0,null!=Y[aa]){for(;0<Y[aa].length;){var ea=Y[aa].pop();Q(ea)}delete Y[aa]}}else mxLog.debug(ba+": Visited: "+aa)}var ba=P.parentNode.id,
-X=P.childNodes;P={};for(var Y={},W=null,ca={},S=0;S<X.length;S++){var Z=X[S];if(null!=Z.id&&0<Z.id.length)if(null==P[Z.id]){P[Z.id]=Z.id;var da=Z.getAttribute("parent");null==da?null!=W?mxLog.debug(ba+": Multiple roots: "+Z.id):W=Z.id:(null==Y[da]&&(Y[da]=[]),Y[da].push(Z.id))}else ca[Z.id]=Z.id}X=Object.keys(ca);0<X.length?(X=ba+": "+X.length+" Duplicates: "+X.join(", "),mxLog.debug(X+" (see console)")):mxLog.debug(ba+": Checked");var N={};null==W?mxLog.debug(ba+": No root"):(Q(W),Object.keys(N).length!=
-Object.keys(P).length&&(mxLog.debug(ba+": Invalid tree: (see console)"),console.log(ba+": Invalid tree",Y)))};"<"!=d.charAt(0)&&(d=Graph.decompress(d),mxLog.debug("See console for uncompressed XML"),console.log("xml",d));var A=mxUtils.parseXml(d),G=g.getPagesForNode(A.documentElement,"mxGraphModel");if(null!=G&&0<G.length)try{var I=g.getHashValueForPages(G);mxLog.debug("Checksum: ",I)}catch(P){mxLog.debug("Error: ",P.message)}else mxLog.debug("No pages found for checksum");var L=A.getElementsByTagName("root");
-for(d=0;d<L.length;d++)p(L[d]);mxLog.show()}catch(P){g.handleError(P),null!=window.console&&console.error(P)}});g.showDialog(y.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));y.init()}));var D=null;g.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=g.pages){var y=new TextareaDialog(g,"Diff/Sync:","",function(d){var p=g.getCurrentFile();if(0<d.length&&null!=p)try{var A=JSON.parse(d);p.patch([A],null,!0,!0);g.hideDialog()}catch(G){g.handleError(G)}},null,"Close",
-null,null,null,!0,null,"Patch",null,[["Snapshot",function(d,p){try{D=g.getPagesForXml(g.getFileData(!0)),y.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(D)}catch(A){g.handleError(A)}}],["Diff",function(d,p){try{y.textarea.value=JSON.stringify(g.diffPages(D,g.pages),null,2)}catch(A){g.handleError(A)}}]]);if(null==D)try{D=g.getPagesForXml(g.getFileData(!0)),y.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(D)}catch(d){g.handleError(d)}else y.textarea.value=
-JSON.stringify(g.diffPages(D,g.pages),null,2);g.showDialog(y.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));y.init()}else g.alert("No pages")}));g.actions.addAction("testChecksum",mxUtils.bind(this,function(){var y=g.getCurrentFile();null!=g.pages&&null!=y?g.spinner.spin(document.body,mxResources.get("loading"))&&y.getLatestVersion(function(d){g.spinner.stop();var p=g.getHashValueForPages(g.pages),A=y.getCurrentRevisionId(),G=g.getHashValueForPages(d.getShadowPages()),I=d.getDescriptorChecksum(d.getDescriptor()),
-L=d.getCurrentRevisionId();console.log("Local File",[y],"modified",y.isModified(),"checksum",p);console.log("Remote File",[d],"rev",L==A,"desc",I==G,"checksum",G);g.alert("Checksums "+(G==p?"match":"no not match"))},function(d){console.log("Error getLatestVersion",d);g.handleError(d)}):console.log("Checksum: no file or pages")}));g.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var y=g.getCurrentFile();console.log("editorUi",g,"file",y);if(null!=y&&y.isRealtime()){console.log("Checksum ownPages",
+d)});var I=this;x=this.get("layout");var H=x.funct;this.put("legacyLayout",new Menu(H));x.funct=function(y,d){var p=g.actions.get("runLastLayout"),A=y.addItem(mxResources.get("runLastLayout"),null,function(){p.funct()},d,null,u()&&null!=g.lastLayoutSpec);I.addShortcut(A,p);y.addSeparator(d);"undefined"!==typeof ElkLayout?(A=function(G){y.addItem(mxResources.get(G)+"...",null,function(){var J=ElkLayout.MENU_PRESETS[G];ElkLayout.runWithDialog(g,J.algorithm,J.options,mxResources.get(G))},d,null,u())},
+A("verticalFlow"),A("horizontalFlow"),y.addSeparator(d),A("verticalTree"),A("horizontalTree"),A("radialTree"),y.addSeparator(d),A("organic")):H.apply(this,arguments);y.addItem(mxResources.get("orgChart")+"...",null,function(){for(var G=null,J=20,L=20,P=function(){"undefined"!==typeof mxOrgChartLayout&&null!=G&&g.tryAndHandle(mxUtils.bind(this,function(){var da=g.editor.graph,N=new mxOrgChartLayout(da,G,J,L),aa=da.getDefaultParent();1<da.model.getChildCount(da.getSelectionCell())&&(aa=da.getSelectionCell());
+N.execute(aa)}))},Q=document.createElement("div"),ba=function(da,N){var aa=document.createElement("div");aa.style.marginBottom="8px";var ea=document.createElement("div");ea.style.display="inline-block";ea.style.width="180px";ea.style.verticalAlign="middle";mxUtils.write(ea,mxResources.get(da)+": ");aa.appendChild(ea);N.style.width="160px";N.style.boxSizing="border-box";N.style.verticalAlign="middle";aa.appendChild(N);Q.appendChild(aa)},W=document.createElement("select"),Y=[mxResources.get("linear"),
+mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],X=0;X<Y.length;X++){var ca=document.createElement("option");mxUtils.write(ca,Y[X]);ca.value=X;2==X&&ca.setAttribute("selected","selected");W.appendChild(ca)}mxEvent.addListener(W,"change",function(){G=W.value});ba("orgChartType",W);var S=document.createElement("input");S.type="number";S.value=J;mxEvent.addListener(S,
+"change",function(){J=S.value});ba("parentChildSpacing",S);var Z=document.createElement("input");Z.type="number";Z.value=L;mxEvent.addListener(Z,"change",function(){L=Z.value});ba("siblingSpacing",Z);ba=new CustomDialog(g,Q,function(){null==G&&(G=2);g.loadOrgChartLayouts(P)},null,null,"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");g.showDialog(ba.container,355,null,!0,!0)},d,null,u());y.addItem(mxResources.get("circle"),null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,
+function(){if(!g.applyLayoutToSelectedContainers("circleLayout")){var G=new mxCircleLayout(q);g.executeLayout(function(){var J=q.getSelectionCell();if(null==J||0==q.getModel().getChildCount(J))J=q.getDefaultParent();G.execute(J);q.getModel().isVertex(J)&&q.updateGroupBounds([J],2*q.gridSize,!0)},!0)}}))}),d);y.addSeparator(d);"undefined"!==typeof LibavoidRouting&&y.addItem(mxResources.get("orthogonalRouting")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,function(){g.prompt(mxResources.get("spacing"),
+LibavoidRouting.shapeBufferDistance,mxUtils.bind(this,function(G){g.tryAndHandle(mxUtils.bind(this,function(){var J=parseFloat(G);LibavoidRouting.run(g,isNaN(J)?null:{shapeBufferDistance:J})}))}))}))}),d);y.addItem(mxResources.get("parallels")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,function(){var G=new mxParallelEdgeLayout(q);G.checkOverlap=!0;g.prompt(mxResources.get("spacing"),G.spacing,mxUtils.bind(this,function(J){g.tryAndHandle(mxUtils.bind(this,function(){G.spacing=
+J;g.lastLayoutSpec=[{layout:"mxParallelEdgeLayout",config:{spacing:G.spacing,checkOverlap:!0}}];g.applyLayoutToSelectedContainers(g.lastLayoutSpec)||g.executeLayout(function(){G.execute(q.getDefaultParent(),q.isSelectionEmpty()?null:q.getSelectionCells())},!1)}))}))}))}),d);"undefined"!==typeof ElkLayout&&(y.addSeparator(d),g.menus.addSubmenu("legacyLayout",y,d,mxResources.get("legacyLayouts")));y.addSeparator(d);g.menus.addMenuItem(y,"runLayout",d,null,null,mxResources.get("custom")+"...")};this.put("help",
+new Menu(mxUtils.bind(this,function(y,d){if(mxClient.IS_CHROMEAPP||!g.isOffline()&&!navigator.standalone){var p=y.addItem(mxResources.get("search")+":",null,null,d,null,null,!1);p.style.cursor="default";var A=document.createElement("input");A.setAttribute("type","text");A.setAttribute("size","25");A.style.borderWidth="1px";A.style.marginLeft="8px";mxEvent.addListener(A,"keydown",mxUtils.bind(this,function(G){var J=mxUtils.trim(A.value);13==G.keyCode&&0<J.length?(this.editorUi.searchHelp(J),A.value=
+"",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==G.keyCode&&(A.value="")}));p.firstChild.nextSibling.appendChild(A);mxEvent.addGestureListeners(A,function(G){document.activeElement!=A&&A.focus();mxEvent.consume(G)},function(G){mxEvent.consume(G)},function(G){mxEvent.consume(G)});window.setTimeout(function(){A.focus()},0);EditorUi.isElectronApp?(g.actions.addAction("website...",function(){g.openLink("https://www.drawio.com")}),g.actions.addAction("check4Updates",
+function(){g.checkForUpdates()}),g.actions.put("desktopZoomIn",new Action("zoomIn",function(){g.desktopZoomIn()})),g.actions.put("desktopZoomOut",new Action("zoomOut",function(){g.desktopZoomOut()})),g.actions.put("desktopResetZoom",new Action("actualSize",function(){g.desktopResetZoom()})),this.addMenuItems(y,"- keyboardShortcuts quickStart website support -".split(" "),d),"1"!=urlParams.disableUpdate&&this.addMenuItems(y,["check4Updates","-"],d),this.addMenuItems(y,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),
+d)):this.addMenuItems(y,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),d)}else this.addMenuItems(y,["keyboardShortcuts","-","about"],d);"1"==urlParams.test&&(y.addSeparator(d),this.addSubmenu("testDevelop",y,d))})));g.actions.addAction("languageCode...",function(){var y=new FilenameDialog(g,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(d){null!=d&&(Graph.diagramLanguage=0<d.length?d:null,Graph.translateDiagram=!0,q.refresh())}),mxResources.get("languageCode"),
+null,null,"https://www.drawio.com/blog/translate-diagrams");g.showDialog(y.container,340,80,!0,!0);y.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,["languageCode","-"],d);d=y.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;q.refresh()},d);Graph.translateDiagram||y.addCheckmark(d,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");mxResources.parse("showBoundingBox=Show bounding box");
+mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.parse("testCheckPages=Check Pages");mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");mxResources.parse("testOptimize=Remove Inline Images");mxResources.parse("testPerformance=Performance");
+g.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!q.isSelectionEmpty()){var y=q.cloneCells(q.getSelectionCells()),d=q.getBoundingBoxFromGeometry(y,!0);y=q.moveCells(y,-d.x,-d.y);g.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+d.width+", "+d.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(q.encodeCells(y)))+"'),")}}));g.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function y(L){return null==L||null==L.boundingBox||!isNaN(L.boundingBox.x)&&
+!isNaN(L.boundingBox.y)&&!isNaN(L.boundingBox.width)&&!isNaN(L.boundingBox.height)}var d=q.isSelectionEmpty()?q.getGraphBounds():q.getBoundingBox(q.getSelectionCells()),p=q.view.translate,A=q.view.scale;q.insertVertex(q.getDefaultParent(),null,"",d.x/A-p.x,d.y/A-p.y,d.width/A,d.height/A,"fillColor=none;strokeColor=red;");var G=0,J=0;q.view.states.visit(function(L,P){L=!0;y(P.shape)||(console.log("invalid shape",P.cell.id,P.shape),L=!1);y(P.text)||(console.log("invalid text",P.cell.id,P.text),L=!1);
+L||G++;J++});console.log("states checked",J,"invalid",G)}));g.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var y=null!=g.pages&&null!=g.getCurrentFile()?g.getCurrentFile().getAnonymizedXmlForPages(g.pages):"";y=new TextareaDialog(g,"Paste Data:",y,function(d){if(0<d.length)try{var p=function(P){function Q(aa){if(null==N[aa]){if(N[aa]=!0,null!=Y[aa]){for(;0<Y[aa].length;){var ea=Y[aa].pop();Q(ea)}delete Y[aa]}}else mxLog.debug(ba+": Visited: "+aa)}var ba=P.parentNode.id,W=P.childNodes;
+P={};for(var Y={},X=null,ca={},S=0;S<W.length;S++){var Z=W[S];if(null!=Z.id&&0<Z.id.length)if(null==P[Z.id]){P[Z.id]=Z.id;var da=Z.getAttribute("parent");null==da?null!=X?mxLog.debug(ba+": Multiple roots: "+Z.id):X=Z.id:(null==Y[da]&&(Y[da]=[]),Y[da].push(Z.id))}else ca[Z.id]=Z.id}W=Object.keys(ca);0<W.length?(W=ba+": "+W.length+" Duplicates: "+W.join(", "),mxLog.debug(W+" (see console)")):mxLog.debug(ba+": Checked");var N={};null==X?mxLog.debug(ba+": No root"):(Q(X),Object.keys(N).length!=Object.keys(P).length&&
+(mxLog.debug(ba+": Invalid tree: (see console)"),console.log(ba+": Invalid tree",Y)))};"<"!=d.charAt(0)&&(d=Graph.decompress(d),mxLog.debug("See console for uncompressed XML"),console.log("xml",d));var A=mxUtils.parseXml(d),G=g.getPagesForNode(A.documentElement,"mxGraphModel");if(null!=G&&0<G.length)try{var J=g.getHashValueForPages(G);mxLog.debug("Checksum: ",J)}catch(P){mxLog.debug("Error: ",P.message)}else mxLog.debug("No pages found for checksum");var L=A.getElementsByTagName("root");for(d=0;d<
+L.length;d++)p(L[d]);mxLog.show()}catch(P){g.handleError(P),null!=window.console&&console.error(P)}});g.showDialog(y.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));y.init()}));var D=null;g.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=g.pages){var y=new TextareaDialog(g,"Diff/Sync:","",function(d){var p=g.getCurrentFile();if(0<d.length&&null!=p)try{var A=JSON.parse(d);p.patch([A],null,!0,!0);g.hideDialog()}catch(G){g.handleError(G)}},null,"Close",null,null,
+null,!0,null,"Patch",null,[["Snapshot",function(d,p){try{D=g.getPagesForXml(g.getFileData(!0)),y.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(D)}catch(A){g.handleError(A)}}],["Diff",function(d,p){try{y.textarea.value=JSON.stringify(g.diffPages(D,g.pages),null,2)}catch(A){g.handleError(A)}}]]);if(null==D)try{D=g.getPagesForXml(g.getFileData(!0)),y.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(D)}catch(d){g.handleError(d)}else y.textarea.value=
+JSON.stringify(g.diffPages(D,g.pages),null,2);g.showDialog(y.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));y.init()}else g.alert("No pages")}));g.actions.addAction("testChecksum",mxUtils.bind(this,function(){var y=g.getCurrentFile();null!=g.pages&&null!=y?g.spinner.spin(document.body,mxResources.get("loading"))&&y.getLatestVersion(function(d){g.spinner.stop();var p=g.getHashValueForPages(g.pages),A=y.getCurrentRevisionId(),G=g.getHashValueForPages(d.getShadowPages()),J=d.getDescriptorChecksum(d.getDescriptor()),
+L=d.getCurrentRevisionId();console.log("Local File",[y],"modified",y.isModified(),"checksum",p);console.log("Remote File",[d],"rev",L==A,"desc",J==G,"checksum",G);g.alert("Checksums "+(G==p?"match":"no not match"))},function(d){console.log("Error getLatestVersion",d);g.handleError(d)}):console.log("Checksum: no file or pages")}));g.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var y=g.getCurrentFile();console.log("editorUi",g,"file",y);if(null!=y&&y.isRealtime()){console.log("Checksum ownPages",
g.getHashValueForPages(y.ownPages));console.log("Checksum theirPages",g.getHashValueForPages(y.theirPages));console.log("diff ownPages/theirPages",g.diffPages(y.ownPages,y.theirPages));var d=y.getShadowPages();null!=d&&(console.log("Checksum shadowPages",g.getHashValueForPages(d)),console.log("diff shadowPages/ownPages",g.diffPages(d,y.ownPages)),console.log("diff ownPages/shadowPages",g.diffPages(y.ownPages,d)),console.log("diff theirPages/shadowPages",g.diffPages(y.theirPages,d)));null!=y.sync&&
null!=y.sync.snapshot&&(console.log("Checksum snapshot",g.getHashValueForPages(y.sync.snapshot)),console.log("diff ownPages/snapshot",g.diffPages(y.ownPages,y.sync.snapshot)),console.log("diff theirPages/snapshot",g.diffPages(y.theirPages,y.sync.snapshot)),null!=g.pages&&console.log("diff snapshot/actualPages",g.diffPages(y.sync.snapshot,g.pages)));null!=g.pages&&(console.log("diff ownPages/actualPages",g.diffPages(y.ownPages,g.pages)),console.log("diff theirPages/actualPages",g.diffPages(y.theirPages,
g.pages)))}null!=y&&console.log("Shadow pages",[g.getXmlForPages(y.getShadowPages())]);null!=g.pages&&console.log("Checksum actualPages",g.getHashValueForPages(g.pages))}));g.actions.addAction("testFixPages",mxUtils.bind(this,function(){console.log("editorUi",g);var y=g.getCurrentFile();null!=y&&y.isRealtime()&&null!=y.shadowPages&&(console.log("patching actualPages to shadowPages",y.patch([g.diffPages(y.shadowPages,g.pages)])),y.ownPages=g.clonePages(g.pages),y.theirPages=g.clonePages(g.pages),y.shadowPages=
-g.clonePages(g.pages),null!=y.sync&&(y.sync.snapshot=g.clonePages(g.pages)))}));g.actions.addAction("testOptimize",mxUtils.bind(this,function(){q.model.beginUpdate();try{var y=q.model.cells,d=0,p=[],A=[],G;for(G in y){var I=y[G],L=q.getCurrentCellStyle(I)[mxConstants.STYLE_IMAGE];null!=L&&"data:"==L.substring(0,5)&&(null==p[L]&&(p[L]=(p[L]||0)+1,d++),A.push(I))}q.setCellStyles(mxConstants.STYLE_IMAGE,null,A);console.log("Removed",d,"image(s) from",A.length,"cell(s): ",[A,p])}finally{q.model.endUpdate()}}));
-g.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(g,q.getModel())}));g.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var y=new mxImageExport,d=q.getGraphBounds(),p=q.view.scale,A=mxUtils.createXmlDocument(),G=A.createElement("output");A.appendChild(G);A=new mxXmlCanvas2D(G);A.translate(Math.floor((1-d.x)/p),Math.floor((1-d.y)/p));A.scale(1/p);var I=0,L=A.save;A.save=function(){I++;L.apply(this,arguments)};var P=A.restore;A.restore=function(){I--;P.apply(this,
-arguments)};var Q=y.drawShape;y.drawShape=function(ba){mxLog.debug("entering shape",ba,I);Q.apply(this,arguments);mxLog.debug("leaving shape",ba,I)};y.drawState(q.getView().getState(q.model.root),A);mxLog.show();mxLog.debug(mxUtils.getXml(G));mxLog.debug("stateCounter",I)}));g.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var c=null,f=null,l=null,n=null,r=null,t=null,v=null,B=null;g.actions.addAction("testPerformance",
+g.clonePages(g.pages),null!=y.sync&&(y.sync.snapshot=g.clonePages(g.pages)))}));g.actions.addAction("testOptimize",mxUtils.bind(this,function(){q.model.beginUpdate();try{var y=q.model.cells,d=0,p=[],A=[],G;for(G in y){var J=y[G],L=q.getCurrentCellStyle(J)[mxConstants.STYLE_IMAGE];null!=L&&"data:"==L.substring(0,5)&&(null==p[L]&&(p[L]=(p[L]||0)+1,d++),A.push(J))}q.setCellStyles(mxConstants.STYLE_IMAGE,null,A);console.log("Removed",d,"image(s) from",A.length,"cell(s): ",[A,p])}finally{q.model.endUpdate()}}));
+g.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(g,q.getModel())}));g.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var y=new mxImageExport,d=q.getGraphBounds(),p=q.view.scale,A=mxUtils.createXmlDocument(),G=A.createElement("output");A.appendChild(G);A=new mxXmlCanvas2D(G);A.translate(Math.floor((1-d.x)/p),Math.floor((1-d.y)/p));A.scale(1/p);var J=0,L=A.save;A.save=function(){J++;L.apply(this,arguments)};var P=A.restore;A.restore=function(){J--;P.apply(this,
+arguments)};var Q=y.drawShape;y.drawShape=function(ba){mxLog.debug("entering shape",ba,J);Q.apply(this,arguments);mxLog.debug("leaving shape",ba,J)};y.drawState(q.getView().getState(q.model.root),A);mxLog.show();mxLog.debug(mxUtils.getXml(G));mxLog.debug("stateCounter",J)}));g.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var c=null,f=null,l=null,n=null,r=null,t=null,v=null,B=null;g.actions.addAction("testPerformance",
mxUtils.bind(this,function(){null!=c?(q.view.revalidate=c,c=null):(c=q.view.revalidate,q.view.revalidate=function(){var y=Date.now(),d=c.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",[this],"time",Date.now()-y+" ms","args",arguments);return d});null!=f?(g.selectPage=f,f=null):(f=g.selectPage,g.selectPage=function(){var y=Date.now(),d=f.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-y+" ms","args",arguments);return d});
null!=l?(g.diffPages=l,l=null):(l=g.diffPages,g.diffPages=function(){var y=Date.now(),d=l.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-y+" ms","args",arguments);return d});null!=n?(g.patchPages=n,n=null):(n=g.patchPages,g.patchPages=function(){var y=Date.now(),d=n.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-y+" ms","args",arguments);return d});null!=r?(g.clonePages=r,r=null):(r=g.clonePages,g.clonePages=
function(){var y=Date.now(),d=r.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-y+" ms","args",arguments);return d});null!=v?(g.getHashValueForPages=v,v=null):(v=g.getHashValueForPages,g.getHashValueForPages=function(){var y=Date.now(),d=v.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-y+" ms","args",arguments);return d});null!=B?(g.resolveCrossReferences=B,B=null):(B=g.resolveCrossReferences,
@@ -15814,13 +15824,13 @@ new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,"createSidebarEntry
!g.isOffline()?g.showDialog((new MoreShapesDialog(g,!0)).container,680,isLocalStorage?mxClient.IS_IOS?500:480:460,!0,!0):g.showDialog((new MoreShapesDialog(g,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)}));g.actions.put("createShape",new Action("shape...",function(y){q.isEnabled()&&(y=new mxCell("",new mxGeometry(0,0,120,120),g.defaultCustomShapeStyle),y.vertex=!0,y=new EditShapeDialog(g,y,mxResources.get("editShape")),g.showDialog(y.container,640,480,!0,!1,null,null,null,
new mxRectangle(0,0,300,200),null,"createShape"),y.init())})).isEnabled=u;g.isOffline()||("1"!=urlParams.embed&&(g.actions.put("embedNotion",new Action("notion...",function(){var y=document.createElement("div");y.style.position="absolute";y.style.bottom="12px";y.style.textAlign="center";y.style.width="100%";y.style.left="0px";var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("target","_blank");d.style.cursor="pointer";mxUtils.write(d,mxResources.get("getNotionChromeExtension"));
y.appendChild(d);mxUtils.setPrefixedStyle(d.style,"transition","all 1s ease");mxUtils.setOpacity(d,0);window.setTimeout(function(){mxUtils.setOpacity(d,100)},300);mxEvent.addListener(d,"click",function(p){g.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");mxEvent.consume(p)});g.getPublicUrl(g.getCurrentFile(),function(p){g.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",y,p,g.getCurrentFile(),
-function(A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z,da,N,aa){ba=["border=0"];Y&&(Y=da?g.getHiddenTagsMap():null,ba.push("tags="+encodeURIComponent(JSON.stringify(Y||{}))));A=new EmbedDialog(g,g.createLink(A,G,Z,L,P,Q,"public"==W?p:null,"copy"==W,ba,null,I,null,S,N,aa));g.showDialog(A.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));A.init()},null,!0)})})),g.actions.addAction("microsoftOffice...",function(){g.openLink("https://office.draw.io")})),g.actions.put("embedHtml",new Action("html...",function(){g.getPublicUrl(g.getCurrentFile(),
-function(y){g.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/docs/manual/export/embed-html/",y,function(d,p,A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z){g.createHtml(d,p,A,G,I,L,P,Q,ba,X,Y,mxUtils.bind(this,function(da,N){g.saveData("embed.html","html","\x3c!-- "+g.editor.appName+" diagram --\x3e\n"+da+"\n"+N+"\n","text/html")}),W,ca,S,Z)})})})),g.actions.put("liveImage",new Action("Live image...",function(){var y=g.getCurrentFile();null!=y&&g.getPublicUrl(y,function(d){null!=d?(d=new EmbedDialog(g,
-'<img src="'+(y.constructor!=DriveFile?d:"https://drive.google.com/uc?id="+y.getId())+'"/>'),g.showDialog(d.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250)),d.init()):g.handleError({message:mxResources.get("invalidPublicUrl")})})})),g.actions.put("embedImage",new Action("image...",function(){g.showEmbedImageDialog(function(y,d,p,A,G,I,L,P){g.spinner.spin(document.body,mxResources.get("loading"))&&g.createEmbedImage(y,d,p,A,G,I,L,P,function(Q){g.spinner.stop();g.saveData("embed.html",
-"html",Q,"text/html")},function(Q){g.spinner.stop();g.handleError(Q)})},mxResources.get("image"),mxResources.get("retina"),g.editor.isExportToCanvas(),"https://www.drawio.com/docs/manual/export/embed-diagram/")})),g.actions.put("embedSvg",new Action("formatSvg...",function(){g.showEmbedImageDialog(function(y,d,p,A,G,I,L,P,Q,ba){g.spinner.spin(document.body,mxResources.get("loading"))&&g.createEmbedSvg(y,d,p,A,G,I,L,P,Q,ba,function(X){g.spinner.stop();g.saveData("embed.html","html",X,"text/html")},
-function(X){g.spinner.stop();g.handleError(X)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/docs/manual/export/embed-svg/",!0,!0)})),g.actions.put("embedIframe",new Action("iframe...",function(){g.getPublicUrl(g.getCurrentFile(),function(y){var d=q.getGraphBounds();g.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,d.height/q.view.scale))+2,null,null,null,y,g.getCurrentFile(),function(p,A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z,da,N){var aa=[];
-X&&(X=Z?g.getHiddenTagsMap():null,aa.push("tags="+encodeURIComponent(JSON.stringify(X||{}))));p=new EmbedDialog(g,'<iframe frameborder="0" style="width:'+Q+";height:"+ba+';" src="'+g.createLink(p,A,S,I,L,P,"public"==Y?y:null,"copy"==Y,aa,null,G,W,ca,da,N)+'"'+(W?' allowtransparency="true"':"")+"></iframe>");g.showDialog(p.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));p.init()},!0,!0)})})));g.actions.put("publishLink",new Action("link...",function(){g.getPublicUrl(g.getCurrentFile(),
-function(y){g.showPublishLinkDialog(null,null,null,null,null,null,y,g.getCurrentFile(),function(d,p,A,G,I,L,P,Q,ba,X,Y,W,ca,S,Z,da){P=[];G&&ba&&(ba=S?g.getHiddenTagsMap():null,P.push("tags="+encodeURIComponent(JSON.stringify(ba||{}))));d=new EmbedDialog(g,g.createLink(d,p,ca,G,I,L,"public"==X?y:null,"copy"==X,P,null,A,null,W,Z,da));g.showDialog(d.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));d.init()},null,!0)})},null,null,null,!g.isOffline()));if(isLocalStorage||mxClient.IS_CHROMEAPP)x=
+function(A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z,da,N,aa){ba=["border=0"];Y&&(Y=da?g.getHiddenTagsMap():null,ba.push("tags="+encodeURIComponent(JSON.stringify(Y||{}))));A=new EmbedDialog(g,g.createLink(A,G,Z,L,P,Q,"public"==X?p:null,"copy"==X,ba,null,J,null,S,N,aa));g.showDialog(A.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));A.init()},null,!0)})})),g.actions.addAction("microsoftOffice...",function(){g.openLink("https://office.draw.io")})),g.actions.put("embedHtml",new Action("html...",function(){g.getPublicUrl(g.getCurrentFile(),
+function(y){g.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/docs/manual/export/embed-html/",y,function(d,p,A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z){g.createHtml(d,p,A,G,J,L,P,Q,ba,W,Y,mxUtils.bind(this,function(da,N){g.saveData("embed.html","html","\x3c!-- "+g.editor.appName+" diagram --\x3e\n"+da+"\n"+N+"\n","text/html")}),X,ca,S,Z)})})})),g.actions.put("liveImage",new Action("Live image...",function(){var y=g.getCurrentFile();null!=y&&g.getPublicUrl(y,function(d){null!=d?(d=new EmbedDialog(g,
+'<img src="'+(y.constructor!=DriveFile?d:"https://drive.google.com/uc?id="+y.getId())+'"/>'),g.showDialog(d.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250)),d.init()):g.handleError({message:mxResources.get("invalidPublicUrl")})})})),g.actions.put("embedImage",new Action("image...",function(){g.showEmbedImageDialog(function(y,d,p,A,G,J,L,P){g.spinner.spin(document.body,mxResources.get("loading"))&&g.createEmbedImage(y,d,p,A,G,J,L,P,function(Q){g.spinner.stop();g.saveData("embed.html",
+"html",Q,"text/html")},function(Q){g.spinner.stop();g.handleError(Q)})},mxResources.get("image"),mxResources.get("retina"),g.editor.isExportToCanvas(),"https://www.drawio.com/docs/manual/export/embed-diagram/")})),g.actions.put("embedSvg",new Action("formatSvg...",function(){g.showEmbedImageDialog(function(y,d,p,A,G,J,L,P,Q,ba){g.spinner.spin(document.body,mxResources.get("loading"))&&g.createEmbedSvg(y,d,p,A,G,J,L,P,Q,ba,function(W){g.spinner.stop();g.saveData("embed.html","html",W,"text/html")},
+function(W){g.spinner.stop();g.handleError(W)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/docs/manual/export/embed-svg/",!0,!0)})),g.actions.put("embedIframe",new Action("iframe...",function(){g.getPublicUrl(g.getCurrentFile(),function(y){var d=q.getGraphBounds();g.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,d.height/q.view.scale))+2,null,null,null,y,g.getCurrentFile(),function(p,A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z,da,N){var aa=[];
+W&&(W=Z?g.getHiddenTagsMap():null,aa.push("tags="+encodeURIComponent(JSON.stringify(W||{}))));p=new EmbedDialog(g,'<iframe frameborder="0" style="width:'+Q+";height:"+ba+';" src="'+g.createLink(p,A,S,J,L,P,"public"==Y?y:null,"copy"==Y,aa,null,G,X,ca,da,N)+'"'+(X?' allowtransparency="true"':"")+"></iframe>");g.showDialog(p.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));p.init()},!0,!0)})})));g.actions.put("publishLink",new Action("link...",function(){g.getPublicUrl(g.getCurrentFile(),
+function(y){g.showPublishLinkDialog(null,null,null,null,null,null,y,g.getCurrentFile(),function(d,p,A,G,J,L,P,Q,ba,W,Y,X,ca,S,Z,da){P=[];G&&ba&&(ba=S?g.getHiddenTagsMap():null,P.push("tags="+encodeURIComponent(JSON.stringify(ba||{}))));d=new EmbedDialog(g,g.createLink(d,p,ca,G,J,L,"public"==W?y:null,"copy"==W,P,null,A,null,X,Z,da));g.showDialog(d.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));d.init()},null,!0)})},null,null,null,!g.isOffline()));if(isLocalStorage||mxClient.IS_CHROMEAPP)x=
g.actions.addAction("scratchpad",function(){g.toggleScratchpad()}),x.setToggleAction(!0),x.setSelectedCallback(function(){return null!=g.scratchpad}),"0"!=urlParams.plugins&&g.actions.addAction("plugins...",function(){g.showDialog((new PluginsDialog(g)).container,380,null,!0,!1)});window.matchMedia&&null!=document.getElementById("high-contrast-stylesheet")&&(x=g.actions.addAction("highContrast",function(){g.setAndPersistHighContrast(!g.isHighContrast())}),x.setToggleAction(!0),x.setSelectedCallback(function(){return g.isHighContrast()}));
x=g.actions.addAction("search",function(){if(null!=g.sidebar){var y=g.sidebar.isEntryVisible("search");g.sidebar.showPalette("search",!y);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!y,mxSettings.save())}});x.label=mxResources.get("searchShapes");x.setToggleAction(!0);x.setSelectedCallback(function(){return null!=g.sidebar&&g.sidebar.isEntryVisible("search")});g.actions.get("clearDefaultStyle").funct=function(y){q.isEnabled()&&("undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&
null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(null),g.clearDefaultStyle(),Editor.sketchMode&&g.setSketchMode(!1))};"1"==urlParams.embed&&(g.actions.get("saveAs").setEnabled(!1),g.actions.get("save").funct=function(y){q.isEditing()&&q.stopEditing();var d="0"!=urlParams.pages||null!=g.pages&&1<g.pages.length?g.getFileData(!0):mxUtils.getXml(g.editor.getGraphXml());if("json"==urlParams.proto){var p=g.createLoadMessage("save");p.xml=d;!0!==y||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||
@@ -15828,35 +15838,35 @@ null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(null),g.clearDefaultSt
mxResources.get("saveAndExit"),g.actions.addAction("exit",function(){if("1"==urlParams.embedInline)g.sendEmbeddedSvgExport();else{var y=function(){g.editor.modified=!1;var d="json"==urlParams.proto?JSON.stringify({event:"exit",modified:g.editor.modified}):"";(window.opener||window.parent).postMessage(d,"*")};g.editor.modified?g.confirm(mxResources.get("allChangesLost"),null,y,mxResources.get("cancel"),mxResources.get("discardChanges")):y()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",
new Menu(mxUtils.bind(this,function(y,d){g.editor.isExportToCanvas()?(this.addMenuItems(y,["exportPng"],d),Editor.jpgSupported&&this.addMenuItems(y,["exportJpg"],d),Editor.webpSupported&&this.addMenuItems(y,["exportWebp"],d)):!g.isRemoteExportEnabled()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(y,["exportPng","exportJpg"],d);g.editor.isExportToCanvas()&&this.addMenuItems(y,["exportAnimatedGif"],d);this.addMenuItems(y,["exportSvg","-"],d);g.isPrintPdfExport()?this.addMenuItems(y,["exportPdf"],
d):mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(y,["exportPdf"],d);!g.vsdxExportEnabled()||"undefined"===typeof VsdxExport&&g.isOffline()||this.addMenuItems(y,["exportVsdx"],d);var p=["-","exportHtml","exportXml"];Editor.enableExportUrl&&p.push("exportUrl");p.push("exportJson");this.addMenuItems(y,p,d);g.isOffline()||(y.addSeparator(d),this.addMenuItem(y,"export",d).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"min"!=
-Editor.currentTheme||g.isOffline()||this.addMenuItems(y,["publishLink"],d);g.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||g.isOffline()||(y.addSeparator(d),g.menus.addSubmenu("embed",y,d))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(y,d){function p(I){I.pickFile(function(L){g.spinner.spin(document.body,mxResources.get("loading"))&&I.getFile(L,function(P){var Q="data:image/"==P.getData().substring(0,
-11)?G(P.getTitle()):"text/xml";/\.svg$/i.test(P.getTitle())&&!g.editor.isDataSvg(P.getData())&&(P.setData(Editor.createSvgDataUri(P.getData())),Q="image/svg+xml");A(P.getData(),Q,P.getTitle())},function(P){g.handleError(P,null!=P?mxResources.get("errorLoadingFile"):null)},I==g.drive)},!0)}var A=mxUtils.bind(this,function(I,L,P){var Q=q.view,ba=q.getGraphBounds(),X=q.snap(Math.ceil(Math.max(0,ba.x/Q.scale-Q.translate.x)+4*q.gridSize)),Y=q.snap(Math.ceil(Math.max(0,(ba.y+ba.height)/Q.scale-Q.translate.y)+
-4*q.gridSize));"data:image/"==I.substring(0,11)?g.loadImage(I,mxUtils.bind(this,function(W){var ca=!0,S=mxUtils.bind(this,function(){g.resizeImage(W,I,mxUtils.bind(this,function(Z,da,N){Z=ca?Math.min(1,Math.min(g.maxImageSize/da,g.maxImageSize/N)):1;g.importFile(I,L,X,Y,Math.round(da*Z),Math.round(N*Z),P,function(aa){g.spinner.stop();q.setSelectionCells(aa);q.scrollCellToVisible(q.getSelectionCell())})}),ca)});I.length>g.resampleThreshold?g.confirmImageResize(function(Z){ca=Z;S()}):S()}),mxUtils.bind(this,
-function(){g.handleError({message:mxResources.get("cannotOpenFile")})})):g.importFile(I,L,X,Y,0,0,P,function(W){g.spinner.stop();q.setSelectionCells(W);q.scrollCellToVisible(q.getSelectionCell())})}),G=mxUtils.bind(this,function(I){var L="text/xml";/\.png$/i.test(I)?L="image/png":/\.jpe?g$/i.test(I)?L="image/jpg":/\.gif$/i.test(I)?L="image/gif":/\.pdf$/i.test(I)&&(L="application/pdf");return L});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=g.drive?y.addItem(mxResources.get("googleDrive")+
+Editor.currentTheme||g.isOffline()||this.addMenuItems(y,["publishLink"],d);g.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||g.isOffline()||(y.addSeparator(d),g.menus.addSubmenu("embed",y,d))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(y,d){function p(J){J.pickFile(function(L){g.spinner.spin(document.body,mxResources.get("loading"))&&J.getFile(L,function(P){var Q="data:image/"==P.getData().substring(0,
+11)?G(P.getTitle()):"text/xml";/\.svg$/i.test(P.getTitle())&&!g.editor.isDataSvg(P.getData())&&(P.setData(Editor.createSvgDataUri(P.getData())),Q="image/svg+xml");A(P.getData(),Q,P.getTitle())},function(P){g.handleError(P,null!=P?mxResources.get("errorLoadingFile"):null)},J==g.drive)},!0)}var A=mxUtils.bind(this,function(J,L,P){var Q=q.view,ba=q.getGraphBounds(),W=q.snap(Math.ceil(Math.max(0,ba.x/Q.scale-Q.translate.x)+4*q.gridSize)),Y=q.snap(Math.ceil(Math.max(0,(ba.y+ba.height)/Q.scale-Q.translate.y)+
+4*q.gridSize));"data:image/"==J.substring(0,11)?g.loadImage(J,mxUtils.bind(this,function(X){var ca=!0,S=mxUtils.bind(this,function(){g.resizeImage(X,J,mxUtils.bind(this,function(Z,da,N){Z=ca?Math.min(1,Math.min(g.maxImageSize/da,g.maxImageSize/N)):1;g.importFile(J,L,W,Y,Math.round(da*Z),Math.round(N*Z),P,function(aa){g.spinner.stop();q.setSelectionCells(aa);q.scrollCellToVisible(q.getSelectionCell())})}),ca)});J.length>g.resampleThreshold?g.confirmImageResize(function(Z){ca=Z;S()}):S()}),mxUtils.bind(this,
+function(){g.handleError({message:mxResources.get("cannotOpenFile")})})):g.importFile(J,L,W,Y,0,0,P,function(X){g.spinner.stop();q.setSelectionCells(X);q.scrollCellToVisible(q.getSelectionCell())})}),G=mxUtils.bind(this,function(J){var L="text/xml";/\.png$/i.test(J)?L="image/png":/\.jpe?g$/i.test(J)?L="image/jpg":/\.gif$/i.test(J)?L="image/gif":/\.pdf$/i.test(J)&&(L="application/pdf");return L});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=g.drive?y.addItem(mxResources.get("googleDrive")+
"...",null,function(){p(g.drive)},d):g.isModeEnabled(App.MODE_GOOGLE)&&y.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));g.isModeReady(App.MODE_ONEDRIVE)?y.addItem(mxResources.get("oneDrive")+"...",null,function(){p(g.oneDrive)},d):g.isModeEnabled(App.MODE_ONEDRIVE)&&y.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_DROPBOX)?y.addItem(mxResources.get("dropbox")+
"...",null,function(){p(g.dropbox)},d):g.isModeEnabled(App.MODE_DROPBOX)&&y.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);y.addSeparator(d);g.isModeReady(App.MODE_GITHUB)&&y.addItem(mxResources.get("github")+"...",null,function(){p(g.gitHub)},d);g.isModeReady(App.MODE_GITLAB)&&y.addItem(mxResources.get("gitlab")+"...",null,function(){p(g.gitLab)},d);g.isModeReady(App.MODE_TRELLO)?y.addItem(mxResources.get("trello")+"...",null,function(){p(g.trello)},
-d):g.isModeEnabled(App.MODE_TRELLO)&&y.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);y.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&y.addItem(mxResources.get("browser")+"...",null,function(){g.importLocalFile(!1)},d);"1"!=urlParams.noDevice&&y.addItem(mxResources.get("device")+"...",null,function(){g.importLocalFile(!0)},d);g.isOffline()||(y.addSeparator(d),y.addItem(mxResources.get("url")+"...",null,function(){var I=new FilenameDialog(g,
-"",mxResources.get("import"),function(L){if(null!=L&&0<L.length&&g.spinner.spin(document.body,mxResources.get("loading"))){var P=/(\.png)($|\?)/i.test(L)?"image/png":"text/xml";g.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(L),function(Q){A(Q,P,L)},function(){g.spinner.stop();g.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==P)}},mxResources.get("url"));g.showDialog(I.container,300,80,!0,!0);I.init()},d))}))).isEnabled=u;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,
+d):g.isModeEnabled(App.MODE_TRELLO)&&y.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);y.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&y.addItem(mxResources.get("browser")+"...",null,function(){g.importLocalFile(!1)},d);"1"!=urlParams.noDevice&&y.addItem(mxResources.get("device")+"...",null,function(){g.importLocalFile(!0)},d);g.isOffline()||(y.addSeparator(d),y.addItem(mxResources.get("url")+"...",null,function(){var J=new FilenameDialog(g,
+"",mxResources.get("import"),function(L){if(null!=L&&0<L.length&&g.spinner.spin(document.body,mxResources.get("loading"))){var P=/(\.png)($|\?)/i.test(L)?"image/png":"text/xml";g.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(L),function(Q){A(Q,P,L)},function(){g.spinner.stop();g.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==P)}},mxResources.get("url"));g.showDialog(J.container,300,80,!0,!0);J.init()},d))}))).isEnabled=u;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,
function(y,d){var p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&(750>p&&this.addSubmenu("viewZoom",y,d,mxResources.get("zoom")),460>p&&g.isPageMenuVisible()&&this.addSubmenu("pages",y,d),320>p&&this.addSubmenu("insert",y,d),360>p&&"1"!=urlParams.embed&&"draw.io"==g.getServiceName()&&this.addSubmenu("share",y,d))})));this.put("appearance",new Menu(mxUtils.bind(this,function(y,d){if(g.isAutoDarkModeSupported()){var p=g.menus.addMenuItem(y,
"autoMode",d);null!=p&&p.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")+")")}this.addMenuItems(y,["lightMode","darkMode","-"],d);p=g.menus.addMenuItem(y,"highContrast",d);(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&g.menus.addLinkToItem(p,"https://github.com/jgraph/drawio/issues/4296")})));g.actions.addAction("addToScratchpad",function(y){q.isSelectionEmpty()||null==g.addSelectionToScratchpad||g.addSelectionToScratchpad(y)});
-g.actions.addAction("accounts...",function(){g.toggleUserPanel();g.userPanel.style.right="10px";g.userPanel.style.top="10px"});this.put("theme",new Menu(mxUtils.bind(this,function(y,d){var p="1"==urlParams.sketch?"sketch":mxSettings.getUi(),A=y.addItem(mxResources.get("automatic"),null,function(){g.setCurrentTheme("")},d),G=y.addItem(mxResources.get("classic"),null,function(){g.setCurrentTheme("kennedy")},d),I=!1;if("kennedy"==p||"dark"==p)y.addCheckmark(G,Editor.checkmarkImage),I=!0;for(var L=0;L<
-Editor.themes.length;L++)mxUtils.bind(this,function(P){G=y.addItem(mxResources.get("min"==P?"minimal":P),null,function(){g.setCurrentTheme(P)},d);p==P&&(y.addCheckmark(G,Editor.checkmarkImage),I=!0);"simple"==P&&y.addSeparator(d)})(Editor.themes[L]);I||y.addCheckmark(A,Editor.checkmarkImage)})));x=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var y=this.editorUi.getCurrentFile();if(null!=y)if(y.constructor==LocalFile&&null!=y.fileHandle)g.showSaveFilePicker(mxUtils.bind(g,
+g.actions.addAction("accounts...",function(){g.toggleUserPanel();g.userPanel.style.right="10px";g.userPanel.style.top="10px"});this.put("theme",new Menu(mxUtils.bind(this,function(y,d){var p="1"==urlParams.sketch?"sketch":mxSettings.getUi(),A=y.addItem(mxResources.get("automatic"),null,function(){g.setCurrentTheme("")},d),G=y.addItem(mxResources.get("classic"),null,function(){g.setCurrentTheme("kennedy")},d),J=!1;if("kennedy"==p||"dark"==p)y.addCheckmark(G,Editor.checkmarkImage),J=!0;for(var L=0;L<
+Editor.themes.length;L++)mxUtils.bind(this,function(P){G=y.addItem(mxResources.get("min"==P?"minimal":P),null,function(){g.setCurrentTheme(P)},d);p==P&&(y.addCheckmark(G,Editor.checkmarkImage),J=!0);"simple"==P&&y.addSeparator(d)})(Editor.themes[L]);J||y.addCheckmark(A,Editor.checkmarkImage)})));x=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var y=this.editorUi.getCurrentFile();if(null!=y)if(y.constructor==LocalFile&&null!=y.fileHandle)g.showSaveFilePicker(mxUtils.bind(g,
function(p,A){y.invalidFileHandle=null;y.fileHandle=p;y.title=A.name;y.desc=A;g.save(A.name)}),null,g.createFileSystemOptions(y.getTitle()));else{var d=null!=y.getTitle()?y.getTitle():this.editorUi.defaultFilename;d=new FilenameDialog(this.editorUi,d,mxResources.get("rename"),mxUtils.bind(this,function(p){null!=p&&0<p.length&&null!=y&&p!=y.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&y.rename(p,mxUtils.bind(this,function(A){this.editorUi.spinner.stop()}),mxUtils.bind(this,
function(A){this.editorUi.handleError(A,null!=A?mxResources.get("errorRenamingFile"):null)}))}),y.constructor==DriveFile||y.constructor==StorageFile?mxResources.get("diagramName"):null,function(p){if(null!=p&&0<p.length)return!0;g.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,FilenameDialog.filenameHelpLink,null,null,g.editor.fileExtensions);this.editorUi.showDialog(d.container,340,100,!0,!0);d.init()}}));x.isEnabled=function(){return this.enabled&&
-u.apply(this,arguments)};x.visible="1"!=urlParams.embed;g.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var y=g.getCurrentFile();if(null!=y){var d=g.getCopyFilename(y);y.constructor==DriveFile?(d=new SaveDialog(g,d,mxUtils.bind(this,function(p,A,G){g.hideDialog();y.copyFile(mxUtils.bind(this,function(I){y.move(G,mxUtils.bind(this,function(L){g.spinner.stop()}),mxUtils.bind(this,function(L){g.handleError(L)}))}),mxUtils.bind(this,function(I){g.handleError(I)}),p.value)}),null,null,null,
+u.apply(this,arguments)};x.visible="1"!=urlParams.embed;g.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var y=g.getCurrentFile();if(null!=y){var d=g.getCopyFilename(y);y.constructor==DriveFile?(d=new SaveDialog(g,d,mxUtils.bind(this,function(p,A,G){g.hideDialog();y.copyFile(mxUtils.bind(this,function(J){y.move(G,mxUtils.bind(this,function(L){g.spinner.stop()}),mxUtils.bind(this,function(L){g.handleError(L)}))}),mxUtils.bind(this,function(J){g.handleError(J)}),p.value)}),null,null,null,
null,null,null,[App.MODE_GOOGLE],mxResources.get("ok")),g.showDialog(d.container,420,162,!0,!1,mxUtils.bind(this,function(){g.hideDialog()})),d.init()):g.editor.editAsNew(this.editorUi.getFileData(!0),d)}}));x=new Action("openFolder",function(y,d){y=g.getCurrentFile();null!=y&&g.openLink(y.getFolderUrl())});x.getTitle=function(){return mxResources.get("openIt",[mxResources.get("folder")])+"..."};g.actions.put("openFolder",x);g.actions.addAction("openFile...",mxUtils.bind(this,function(){var y=g.getCurrentFile();
-null!=y&&g.openLink(y.getFileUrl())}));g.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var y=g.getCurrentFile();if(y.getMode()==App.MODE_GOOGLE||y.getMode()==App.MODE_ONEDRIVE){var d=new SaveDialog(g,"",mxUtils.bind(this,function(p,A,G){g.hideDialog();g.spinner.spin(document.body,mxResources.get("moving"))&&y.move(G,mxUtils.bind(this,function(I){g.spinner.stop()}),mxUtils.bind(this,function(I){g.handleError(I)}))}),null,null,null,null,null,y.getMode());g.showDialog(d.container,
+null!=y&&g.openLink(y.getFileUrl())}));g.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var y=g.getCurrentFile();if(y.getMode()==App.MODE_GOOGLE||y.getMode()==App.MODE_ONEDRIVE){var d=new SaveDialog(g,"",mxUtils.bind(this,function(p,A,G){g.hideDialog();g.spinner.spin(document.body,mxResources.get("moving"))&&y.move(G,mxUtils.bind(this,function(J){g.spinner.stop()}),mxUtils.bind(this,function(J){g.handleError(J)}))}),null,null,null,null,null,y.getMode());g.showDialog(d.container,
420,82,!0,!1,mxUtils.bind(this,function(){g.hideDialog()}));d.init()}}));this.put("publish",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,["publishLink","presentationMode"],d)})));g.actions.put("presentationMode",new Action("presentationMode...",function(){var y=Editor.isDarkMode(),d=document.createElement("div");d.style.cssText="position:fixed;inset:0;z-index:999;background-color:#000000";document.body.appendChild(d);for(var p={},A="pages page-id nav layers dark toolbar".split(" "),
-G=0;G<A.length;G++)p[A[G]]=urlParams[A[G]];urlParams.pages="1";urlParams["page-id"]=null!=g.currentPage?g.currentPage.getId():null;urlParams.nav="1";urlParams.layers="1";urlParams.dark=y?"1":"0";urlParams.toolbar="0";G=EditorUi.prototype.updateActionStates;var I=EditorUi.prototype.addBeforeUnloadListener,L=EditorUi.prototype.addChromelessClickHandler;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=
-function(){};var P=new EditorUi(new Editor(!0),document.createElement("div"),!0);EditorUi.prototype.updateActionStates=G;EditorUi.prototype.addBeforeUnloadListener=I;EditorUi.prototype.addChromelessClickHandler=L;P.refresh=function(){};P.updateHashObject=function(){};var Q=P.editor.graph;G=Q.container;G.style.cssText="position:fixed;inset:0;overflow:hidden;outline:none;z-index:999";var ba=document.body.style.overflow;document.body.style.overflow="hidden";var X=document.createElement("div");X.style.cssText=
-"position:fixed;top:10px;right:10px;z-index:1000;display:inline-flex;align-items:center;gap:2px;padding:4px;white-space:nowrap;cursor:default;border:1px solid;border-radius:6px;background-color:"+(y?"#2a2a2a":"#ffffff")+";border-color:"+(y?"#505050":"#e0e0e0")+";box-shadow:0 2px 6px "+(y?"rgba(0,0,0,0.4)":"rgba(0,0,0,0.1)");var Y=y?"invert(80%)":"none",W=function(N,aa,ea){var ka=document.createElement("img");ka.setAttribute("src",aa);ka.setAttribute("title",ea||"");ka.setAttribute("border","0");ka.style.cssText=
-"width:16px;height:16px;cursor:pointer;display:block;padding:2px;opacity:0.6;filter:"+Y;ka.className="geAdaptiveAsset";mxEvent.addListener(ka,"mouseenter",function(){ka.style.opacity="1"});mxEvent.addListener(ka,"mouseleave",function(){ka.style.opacity="0.6"});mxEvent.addListener(ka,"click",function(ra){N(ra);mxEvent.consume(ra)});X.appendChild(ka);return ka},ca=function(){if(null!=P.pages&&1<P.pages.length){var N=W(function(aa){P.showPopupMenu(function(ea,ka){for(ka=0;ka<P.pages.length;ka++)(function(ra){var sa=
-ea.addItem(P.getShortPageName(P.pages[ra]),null,function(){P.selectPage(P.pages[ra]);P.lightboxFit();P.chromelessResize()}),ma=P.pages[ra].getId();sa.setAttribute("title",P.pages[ra].getName()+" ("+(ra+1)+"/"+P.pages.length+")"+(null!=ma?" ["+ma+"]":""));P.pages[ra]==P.currentPage&&ea.addCheckmark(sa,Editor.checkmarkImage)})(ka)},mxEvent.getClientX(aa),mxEvent.getClientY(aa),aa)},Editor.chevronDownImage,mxResources.get("pages"));X.insertBefore(N,X.firstChild)}};W(function(){Q.zoomOut();P.chromelessResize(!1)},
-Editor.zoomOutImage,mxResources.get("zoomOut"));W(function(){Q.zoomIn();P.chromelessResize(!1)},Editor.zoomInImage,mxResources.get("zoomIn"));W(function(){1==Q.view.scale?P.lightboxFit():Q.zoomTo(1);P.chromelessResize(!1)},Editor.zoomFitImage,mxResources.get("smartFit"));W(function(){P.destroy()},Editor.closeImage,mxResources.get("close")+" (Escape)");var S=P.destroy;P.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",Z);g.keyHandler.setEnabled(da);document.body.removeChild(d);
-document.body.removeChild(X);document.body.style.overflow=ba;for(var N=0;N<A.length;N++)urlParams[A[N]]=p[A[N]];S.apply(this,arguments)};var Z=function(N){if(27==N.keyCode)P.destroy();else if((37==N.keyCode||39==N.keyCode)&&!mxEvent.isShiftDown(N)&&(mxEvent.isControlDown(N)||mxClient.IS_MAC&&mxEvent.isMetaDown(N))&&null!=P.pages&&1<P.pages.length){var aa=P.getSelectedPageIndex()+(39==N.keyCode?1:-1);0<=aa&&aa<P.pages.length&&(P.selectPage(P.pages[aa]),P.lightboxFit(),P.chromelessResize());mxEvent.consume(N)}},
-da=g.keyHandler.isEnabled();g.keyHandler.setEnabled(!1);mxEvent.addListener(document.documentElement,"keydown",Z);document.body.appendChild(G);document.body.appendChild(X);window.setTimeout(function(){try{P.setFileData(g.getFileData(!0)),ca(),P.lightboxFit(),P.chromelessResize()}catch(N){P.handleError(N,null,function(){P.destroy()})}},0)}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var y=g.getCurrentFile();null!=y&&y.share()}catch(d){g.handleError(d)}})).isEnabled=
+G=0;G<A.length;G++)p[A[G]]=urlParams[A[G]];urlParams.pages="1";urlParams["page-id"]=null!=g.currentPage?g.currentPage.getId():null;urlParams.nav="1";urlParams.layers="1";urlParams.dark=y?"1":"0";urlParams.toolbar="0";G=EditorUi.prototype.updateActionStates;var J=EditorUi.prototype.addBeforeUnloadListener,L=EditorUi.prototype.addChromelessClickHandler;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=
+function(){};var P=new EditorUi(new Editor(!0),document.createElement("div"),!0);EditorUi.prototype.updateActionStates=G;EditorUi.prototype.addBeforeUnloadListener=J;EditorUi.prototype.addChromelessClickHandler=L;P.refresh=function(){};P.updateHashObject=function(){};var Q=P.editor.graph;G=Q.container;G.style.cssText="position:fixed;inset:0;overflow:hidden;outline:none;z-index:999";var ba=document.body.style.overflow;document.body.style.overflow="hidden";var W=document.createElement("div");W.style.cssText=
+"position:fixed;top:10px;right:10px;z-index:1000;display:inline-flex;align-items:center;gap:2px;padding:4px;white-space:nowrap;cursor:default;border:1px solid;border-radius:6px;background-color:"+(y?"#2a2a2a":"#ffffff")+";border-color:"+(y?"#505050":"#e0e0e0")+";box-shadow:0 2px 6px "+(y?"rgba(0,0,0,0.4)":"rgba(0,0,0,0.1)");var Y=y?"invert(80%)":"none",X=function(N,aa,ea){var ka=document.createElement("img");ka.setAttribute("src",aa);ka.setAttribute("title",ea||"");ka.setAttribute("border","0");ka.style.cssText=
+"width:16px;height:16px;cursor:pointer;display:block;padding:2px;opacity:0.6;filter:"+Y;ka.className="geAdaptiveAsset";mxEvent.addListener(ka,"mouseenter",function(){ka.style.opacity="1"});mxEvent.addListener(ka,"mouseleave",function(){ka.style.opacity="0.6"});mxEvent.addListener(ka,"click",function(ra){N(ra);mxEvent.consume(ra)});W.appendChild(ka);return ka},ca=function(){if(null!=P.pages&&1<P.pages.length){var N=X(function(aa){P.showPopupMenu(function(ea,ka){for(ka=0;ka<P.pages.length;ka++)(function(ra){var sa=
+ea.addItem(P.getShortPageName(P.pages[ra]),null,function(){P.selectPage(P.pages[ra]);P.lightboxFit();P.chromelessResize()}),ma=P.pages[ra].getId();sa.setAttribute("title",P.pages[ra].getName()+" ("+(ra+1)+"/"+P.pages.length+")"+(null!=ma?" ["+ma+"]":""));P.pages[ra]==P.currentPage&&ea.addCheckmark(sa,Editor.checkmarkImage)})(ka)},mxEvent.getClientX(aa),mxEvent.getClientY(aa),aa)},Editor.chevronDownImage,mxResources.get("pages"));W.insertBefore(N,W.firstChild)}};X(function(){Q.zoomOut();P.chromelessResize(!1)},
+Editor.zoomOutImage,mxResources.get("zoomOut"));X(function(){Q.zoomIn();P.chromelessResize(!1)},Editor.zoomInImage,mxResources.get("zoomIn"));X(function(){1==Q.view.scale?P.lightboxFit():Q.zoomTo(1);P.chromelessResize(!1)},Editor.zoomFitImage,mxResources.get("smartFit"));X(function(){P.destroy()},Editor.closeImage,mxResources.get("close")+" (Escape)");var S=P.destroy;P.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",Z);g.keyHandler.setEnabled(da);document.body.removeChild(d);
+document.body.removeChild(W);document.body.style.overflow=ba;for(var N=0;N<A.length;N++)urlParams[A[N]]=p[A[N]];S.apply(this,arguments)};var Z=function(N){if(27==N.keyCode)P.destroy();else if((37==N.keyCode||39==N.keyCode)&&!mxEvent.isShiftDown(N)&&(mxEvent.isControlDown(N)||mxClient.IS_MAC&&mxEvent.isMetaDown(N))&&null!=P.pages&&1<P.pages.length){var aa=P.getSelectedPageIndex()+(39==N.keyCode?1:-1);0<=aa&&aa<P.pages.length&&(P.selectPage(P.pages[aa]),P.lightboxFit(),P.chromelessResize());mxEvent.consume(N)}},
+da=g.keyHandler.isEnabled();g.keyHandler.setEnabled(!1);mxEvent.addListener(document.documentElement,"keydown",Z);document.body.appendChild(G);document.body.appendChild(W);window.setTimeout(function(){try{P.setFileData(g.getFileData(!0)),ca(),P.lightboxFit(),P.chromelessResize()}catch(N){P.handleError(N,null,function(){P.destroy()})}},0)}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var y=g.getCurrentFile();null!=y&&y.share()}catch(d){g.handleError(d)}})).isEnabled=
u;this.put("embed",new Menu(mxUtils.bind(this,function(y,d){var p=g.getCurrentFile();null==p||p.getMode()!=App.MODE_GOOGLE&&p.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(p.getTitle())||this.addMenuItems(y,["liveImage","-"],d);this.addMenuItems(y,["embedImage","embedSvg","-","embedHtml"],d);navigator.standalone||g.isOffline()||this.addMenuItems(y,["embedIframe"],d);this.addMenuItems(y,["-","microsoftOffice","-","embedNotion"],d)})));x=function(y){var d=mxResources.get(y);g.actions.put(y,new Action(d+
-"...",function(p){p=new ParseDialog(g,d,y);g.showDialog(p.container,640,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));p.init()})).isEnabled=u};var E=function(y,d,p,A){g.actions.put(y,new Action(mxResources.get(y),function(){if(q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())){var G=new mxCell("",new mxGeometry(0,0,0,0),d);G.vertex=!0;for(var I=q.getFreeInsertPoint(),L=[],P=0;P<A.nodes.length;P++){var Q=new mxCell(A.nodes[P],new mxGeometry(I.x+20,I.y+20,100,40),"whiteSpace=wrap;html=1;");
-Q.vertex=!0;L.push(G.insert(Q))}for(P=0;P<A.edges.length;P++)I=new mxCell("",new mxGeometry,p),I.geometry.relative=!0,I.edge=!0,L[A.edges[P][0]].insertEdge(I,!0),L[A.edges[P][1]].insertEdge(I,!1),G.insert(I);M(G)}})).isEnabled=u},K={nodes:["Root","Child 1","Child 2"],edges:[[0,1],[0,2]]},C={nodes:["Start","Task","Task","End"],edges:[[0,1],[0,2],[1,3],[2,3]]},R=function(y,d){E(y,Menus.layoutContainers[y].style,Menus.layoutContainerEdgeStyle,d)};R("horizontalFlow",C);R("verticalFlow",C);R("horizontalTree",
+"...",function(p){p=new ParseDialog(g,d,y);g.showDialog(p.container,640,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));p.init()})).isEnabled=u};var E=function(y,d,p,A){g.actions.put(y,new Action(mxResources.get(y),function(){if(q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())){var G=new mxCell("",new mxGeometry(0,0,0,0),d);G.vertex=!0;for(var J=q.getFreeInsertPoint(),L=[],P=0;P<A.nodes.length;P++){var Q=new mxCell(A.nodes[P],new mxGeometry(J.x+20,J.y+20,100,40),"whiteSpace=wrap;html=1;");
+Q.vertex=!0;L.push(G.insert(Q))}for(P=0;P<A.edges.length;P++)J=new mxCell("",new mxGeometry,p),J.geometry.relative=!0,J.edge=!0,L[A.edges[P][0]].insertEdge(J,!0),L[A.edges[P][1]].insertEdge(J,!1),G.insert(J);M(G)}})).isEnabled=u},K={nodes:["Root","Child 1","Child 2"],edges:[[0,1],[0,2]]},C={nodes:["Start","Task","Task","End"],edges:[[0,1],[0,2],[1,3],[2,3]]},R=function(y,d){E(y,Menus.layoutContainers[y].style,Menus.layoutContainerEdgeStyle,d)};R("horizontalFlow",C);R("verticalFlow",C);R("horizontalTree",
K);R("verticalTree",K);R("radialTree",K);R("organic",K);R("circle",K);x("mermaid");x("fromText");x("formatSql");x("plantUml");var M=function(y){q.getModel().beginUpdate();try{y=q.addCell(y),q.fireEvent(new mxEventObject("cellsInserted","cells",[y])),q.model.isVertex(y)&&q.isAutoSizeCell(y)&&q.updateCellSize(y)}finally{q.getModel().endUpdate()}q.scrollCellToVisible(y);q.setSelectionCell(y);q.container.focus();q.editAfterInsert&&q.startEditing(y);window.setTimeout(function(){null!=g.hoverIcons&&g.hoverIcons.update(q.view.getState(y))},
0);return y},O=function(y,d,p,A,G){y=new mxCell(y,new mxGeometry(0,0,d,p),A);y.vertex=!0;null==G&&(G=q.getCenterInsertPoint(q.getBoundingBoxFromGeometry([y],!0)));y.geometry.x=G.x;y.geometry.y=G.y;return M(y)};g.actions.put("insertText",new Action("text",function(y){q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&q.startEditingAtCell(O("Text",60,30,q.appendFontSize(Editor.defaultTextStyle,q.vertexFontSize),null==y||mxEvent.isControlDown(y)||mxEvent.isMetaDown(y)||!q.isMouseInsertPoint()?null:
q.getInsertPoint()))},null,null,"A")).isEnabled=u;g.actions.put("insertRectangle",new Action("rectangle",function(y){q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&O("",120,60,"whiteSpace=wrap;html=1;",null==y||mxEvent.isControlDown(y)||mxEvent.isMetaDown(y)||!q.isMouseInsertPoint()?null:q.getInsertPoint())},null,null,"D")).isEnabled=u;g.actions.put("insertNote",new Action("note",function(y){q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&O("",160,160,Editor.defaultNoteStyle,null==y||
@@ -15870,7 +15880,7 @@ y,d),g.menus.addSubmenu("insertAdvanced",y,d,mxResources.get("advanced"))):"sket
"generate","-"],d),g.menus.addSubmenu("layout",y,d),g.menus.addSubmenu("insertAdvanced",y,d,mxResources.get("advanced"))):(this.addMenuItems(y,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - insertImage createShape insertPolygon -".split(" "),d),g.insertTemplateEnabled&&!g.isOffline()&&this.addMenuItems(y,["insertTemplate"],d),EditorUi.isMermaidSupported()&&this.addMenuItems(y,["mermaid"],d),g.menus.addMenuItems(y,["-","insertFreehand","generate","-"],
d),"min"==uiTheme||"simple"==Editor.currentTheme?(this.addSubmenu("layout",y,d),this.addSubmenu("insertLayout",y,d,mxResources.get("insert")),y.addSeparator(d),this.addSubmenu("table",y,d)):this.addSubmenu("insertLayout",y,d,mxResources.get("layout")),this.addSubmenu("insertAdvanced",y,d,mxResources.get("advanced")))})));this.put("table",new Menu(mxUtils.bind(this,function(y,d){g.menus.addInsertTableCellItem(y,d)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,
"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),d)})));g.actions.put("csv",new Action(mxResources.get("csv")+"...",function(){q.popupMenuHandler.hideMenu();g.showImportCsvDialog()})).isEnabled=u;this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,["fromText","plantUml","formatSql","csv"],d);"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(y,["-","createShape","editDiagram"],d)})));this.put("openRecent",
-new Menu(function(y,d){var p=g.getRecent();if(null!=p){for(var A=0;A<p.length;A++)(function(G){var I=G.mode;I==App.MODE_GOOGLE?I="googleDrive":I==App.MODE_ONEDRIVE&&(I="oneDrive");y.addItem(G.title+" ("+mxResources.get(I)+")",null,function(){g.loadFile(G.id)},d)})(p[A]);y.addSeparator(d)}y.addItem(mxResources.get("reset"),null,function(){g.resetRecent()},d)}));this.put("openFrom",new Menu(function(y,d){null!=g.drive?y.addItem(mxResources.get("googleDrive")+"...",null,function(){g.pickFile(App.MODE_GOOGLE)},
+new Menu(function(y,d){var p=g.getRecent();if(null!=p){for(var A=0;A<p.length;A++)(function(G){var J=G.mode;J==App.MODE_GOOGLE?J="googleDrive":J==App.MODE_ONEDRIVE&&(J="oneDrive");y.addItem(G.title+" ("+mxResources.get(J)+")",null,function(){g.loadFile(G.id)},d)})(p[A]);y.addSeparator(d)}y.addItem(mxResources.get("reset"),null,function(){g.resetRecent()},d)}));this.put("openFrom",new Menu(function(y,d){null!=g.drive?y.addItem(mxResources.get("googleDrive")+"...",null,function(){g.pickFile(App.MODE_GOOGLE)},
d):g.isModeEnabled(App.MODE_GOOGLE)&&y.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_ONEDRIVE)?y.addItem(mxResources.get("oneDrive")+"...",null,function(){g.pickFile(App.MODE_ONEDRIVE)},d):g.isModeEnabled(App.MODE_ONEDRIVE)&&y.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_M365)?y.addItem(mxResources.get("m365")+"...",null,function(){g.pickFile(App.MODE_M365)},
d):g.isModeEnabled(App.MODE_M365)&&y.addItem(mxResources.get("m365")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_DROPBOX)?y.addItem(mxResources.get("dropbox")+"...",null,function(){g.pickFile(App.MODE_DROPBOX)},d):g.isModeEnabled(App.MODE_DROPBOX)&&y.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);y.addSeparator(d);g.isModeReady(App.MODE_GITHUB)&&y.addItem(mxResources.get("github")+"...",null,function(){g.pickFile(App.MODE_GITHUB)},
d);g.isModeReady(App.MODE_GITLAB)&&y.addItem(mxResources.get("gitlab")+"...",null,function(){g.pickFile(App.MODE_GITLAB)},d);g.isModeReady(App.MODE_TRELLO)?y.addItem(mxResources.get("trello")+"...",null,function(){g.pickFile(App.MODE_TRELLO)},d):g.isModeEnabled(App.MODE_TRELLO)&&y.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);y.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&y.addItem(mxResources.get("browser")+"...",null,function(){g.pickFile(App.MODE_BROWSER)},
@@ -15882,7 +15892,7 @@ null,null,null,App.MODE_BROWSER)},d);"1"!=urlParams.noDevice&&y.addItem(mxResour
null,function(){g.pickLibrary(App.MODE_GOOGLE)},d):g.isModeEnabled(App.MODE_GOOGLE)&&y.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));g.isModeReady(App.MODE_ONEDRIVE)?y.addItem(mxResources.get("oneDrive")+"...",null,function(){g.pickLibrary(App.MODE_ONEDRIVE)},d):g.isModeEnabled(App.MODE_ONEDRIVE)&&y.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_DROPBOX)?y.addItem(mxResources.get("dropbox")+
"...",null,function(){g.pickLibrary(App.MODE_DROPBOX)},d):g.isModeEnabled(App.MODE_DROPBOX)&&y.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);y.addSeparator(d);g.isModeReady(App.MODE_GITHUB)&&y.addItem(mxResources.get("github")+"...",null,function(){g.pickLibrary(App.MODE_GITHUB)},d);g.isModeReady(App.MODE_GITLAB)&&y.addItem(mxResources.get("gitlab")+"...",null,function(){g.pickLibrary(App.MODE_GITLAB)},d);g.isModeReady(App.MODE_TRELLO)?y.addItem(mxResources.get("trello")+
"...",null,function(){g.pickLibrary(App.MODE_TRELLO)},d):g.isModeEnabled(App.MODE_TRELLO)&&y.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);y.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&y.addItem(mxResources.get("browser")+"...",null,function(){g.pickLibrary(App.MODE_BROWSER)},d);"1"!=urlParams.noDevice&&y.addItem(mxResources.get("device")+"...",null,function(){g.pickLibrary(App.MODE_DEVICE)},d);g.isOffline()||(y.addSeparator(d),y.addItem(mxResources.get("url")+
-"...",null,function(){var p=new FilenameDialog(g,"",mxResources.get("open"),function(A){if(null!=A&&0<A.length&&g.spinner.spin(document.body,mxResources.get("loading"))){var G=A;g.editor.isCorsEnabledForUrl(A)||(G=PROXY_URL+"?url="+encodeURIComponent(A));mxUtils.get(G,function(I){if(200<=I.getStatus()&&299>=I.getStatus()){g.spinner.stop();try{g.loadLibrary(new UrlLibrary(g,I.getText(),A)),g.showSidebar()}catch(L){g.handleError(L,mxResources.get("errorLoadingFile"))}}else g.spinner.stop(),g.handleError(null,
+"...",null,function(){var p=new FilenameDialog(g,"",mxResources.get("open"),function(A){if(null!=A&&0<A.length&&g.spinner.spin(document.body,mxResources.get("loading"))){var G=A;g.editor.isCorsEnabledForUrl(A)||(G=PROXY_URL+"?url="+encodeURIComponent(A));mxUtils.get(G,function(J){if(200<=J.getStatus()&&299>=J.getStatus()){g.spinner.stop();try{g.loadLibrary(new UrlLibrary(g,J.getText(),A)),g.showSidebar()}catch(L){g.handleError(L,mxResources.get("errorLoadingFile"))}}else g.spinner.stop(),g.handleError(null,
mxResources.get("errorLoadingFile"))},function(){g.spinner.stop();g.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));g.showDialog(p.container,300,80,!0,!0);p.init()},d));"1"==urlParams.confLib&&(y.addSeparator(d),y.addItem(mxResources.get("confluenceCloud")+"...",null,function(){g.showRemotelyStoredLibrary(mxResources.get("libraries"))},d))})));this.put("edit",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,"undo redo - cut copy copyAsImage copyAsSvg paste delete - duplicate - findReplace - editData editTooltip editNote - editStyle editGeometry editPolygon editConnectionPoints - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));
this.showCommentsWindow=mxUtils.bind(this,function(y,d){if(null==this.commentsWindow){var p=mxSettings.getWindowState("comments");this.commentsWindow=new CommentsWindow(g,null!=p&&null!=p.x?p.x:document.body.offsetWidth-380,null!=p&&null!=p.y?p.y:120,null!=p&&null!=p.w?p.w:300,null!=p&&null!=p.h?p.h:350);this.commentsWindow.window.addListener("show",function(){g.fireEvent(new mxEventObject("comments"))});this.commentsWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("comments"))});
g.installWindowPersistence("comments",this.commentsWindow);null!=p&&g.restoreWindowState("comments",this.commentsWindow);g.fireEvent(new mxEventObject("comments"))}else this.commentsWindow.window.isVisible()||this.commentsWindow.refreshComments();this.commentsWindow.window.setVisible(!0);this.commentsWindow.refreshCommentsTime();null!=y&&this.commentsWindow.scrollToCell(y);null!=d&&this.commentsWindow.startNewComment(d)});x=g.actions.addAction("comments",mxUtils.bind(this,function(){null!=this.commentsWindow&&
@@ -15892,15 +15902,15 @@ d);g.commentsSupported()&&g.menus.addMenuItems(y,["-","comments"],d);null!=p&&p.
d)}else{this.addMenuItems(y,["format","outline","layers","tags"].concat(g.commentsSupported()?["comments","-"]:["-"]));this.addMenuItems(y,["-","search"],d);if(isLocalStorage||mxClient.IS_CHROMEAPP)A=this.addMenuItem(y,"scratchpad",d),(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(A,"https://www.drawio.com/doc/faq/scratchpad");this.addMenuItems(y,["toggleShapes","-","pageView","pageScale"]);this.addSubmenu("units",y,d);y.addSeparator(d);g.isPageMenuVisible()&&
g.menus.addMenuItems(y,["pageTabs"],d);this.addMenuItems(y,"ruler - tooltips animations - grid guides - connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),d);"1"!=urlParams.sketch&&this.addMenuItems(y,["-","fullscreen"],d)}})));this.put("editCell",new Menu(mxUtils.bind(this,function(y,d){this.addMenuItems(y,"editLink editShape editImage crop - editData copyData pasteData - editPolygon editConnectionPoints editGeometry - editTooltip editNote editStyle - edit".split(" "),d)})));
this.put("currentPage",new Menu(mxUtils.bind(this,function(y,d){null!=g.currentPage&&(this.addMenuItems(y,["renamePage","removePage"],d),1<g.pages.length&&(g.menus.addSubmenu("movePage",y,d,mxResources.get("move")),y.addSeparator(d)),this.addMenuItems(y,["-","duplicatePage"],d),1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=g.getServiceName()||y.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){g.editor.editAsNew(g.getFileData(!0,null,null,
-null,!0,!0))}),d)))})));this.put("pages",new Menu(mxUtils.bind(this,function(y,d){var p=g.currentPage;g.editor.graph.isLightboxView()||this.addMenuItems(y,["insertPage","-"],d);if(null!=g.pages){for(var A=0;A<g.pages.length;A++)mxUtils.bind(this,function(G){var I=null;I=g.pages[G]==p&&!g.editor.graph.isLightboxView()&&g.editor.graph.isEnabled()?g.menus.addSubmenu("currentPage",y,d,g.getShortPageName(p)):y.addItem(g.getShortPageName(g.pages[G]),null,mxUtils.bind(this,function(){g.selectPage(g.pages[G])}),
-d);var L=g.pages[G].getId();I.setAttribute("title",g.pages[G].getName()+" ("+(G+1)+"/"+g.pages.length+")"+(null!=L?" ["+L+"]":""));g.pages[G]==p&&y.addCheckmark(I,Editor.checkmarkImage)})(A);g.editor.graph.isLightboxView()||(y.addSeparator(d),this.addMenuItems(y,["sortPages"],d),y.addItem(mxResources.get("deleteAll"),null,mxUtils.bind(this,function(){q.getModel().beginUpdate();try{for(var G=g.pages.length;0<=G;G--)g.removePage(g.pages[G])}catch(I){g.handleError(I)}finally{q.getModel().endUpdate()}g.actions.get("resetView").funct()}),
+null,!0,!0))}),d)))})));this.put("pages",new Menu(mxUtils.bind(this,function(y,d){var p=g.currentPage;g.editor.graph.isLightboxView()||this.addMenuItems(y,["insertPage","-"],d);if(null!=g.pages){for(var A=0;A<g.pages.length;A++)mxUtils.bind(this,function(G){var J=null;J=g.pages[G]==p&&!g.editor.graph.isLightboxView()&&g.editor.graph.isEnabled()?g.menus.addSubmenu("currentPage",y,d,g.getShortPageName(p)):y.addItem(g.getShortPageName(g.pages[G]),null,mxUtils.bind(this,function(){g.selectPage(g.pages[G])}),
+d);var L=g.pages[G].getId();J.setAttribute("title",g.pages[G].getName()+" ("+(G+1)+"/"+g.pages.length+")"+(null!=L?" ["+L+"]":""));g.pages[G]==p&&y.addCheckmark(J,Editor.checkmarkImage)})(A);g.editor.graph.isLightboxView()||(y.addSeparator(d),this.addMenuItems(y,["sortPages"],d),y.addItem(mxResources.get("deleteAll"),null,mxUtils.bind(this,function(){q.getModel().beginUpdate();try{for(var G=g.pages.length;0<=G;G--)g.removePage(g.pages[G])}catch(J){g.handleError(J)}finally{q.getModel().endUpdate()}g.actions.get("resetView").funct()}),
d,null,g.editor.graph.isEnabled()))}})));if(EditorUi.isElectronApp){var U="1"==urlParams.enableSpellCheck;x=g.actions.addAction("spellCheck",function(){g.toggleSpellCheck();U=!U;g.alert(mxResources.get("restartForChangeRequired"))});x.setToggleAction(!0);x.setSelectedCallback(function(){return U});var T="1"==urlParams.enableStoreBkp;x=g.actions.addAction("autoBkp",function(){g.toggleStoreBkp();T=!T});x.setToggleAction(!0);x.setSelectedCallback(function(){return T});var V="1"==urlParams.isGoogleFontsEnabled;
x=g.actions.addAction("googleFonts",function(){g.toggleGoogleFonts();V=!V;g.alert(mxResources.get("restartForChangeRequired"))});x.setToggleAction(!0);x.setSelectedCallback(function(){return V});g.actions.addAction("openDevTools",function(){g.openDevTools()});g.actions.addAction("drafts...",function(){var y=new FilenameDialog(g,EditorUi.draftSaveDelay/1E3+"",mxResources.get("apply"),mxUtils.bind(this,function(d){d=parseInt(d);0<=d&&(EditorUi.draftSaveDelay=1E3*d,EditorUi.enableDrafts=0<d,mxSettings.setDraftSaveDelay(d),
mxSettings.save())}),mxResources.get("draftSaveInt"));g.showDialog(y.container,320,80,!0,!0);y.init()})}var fa=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(y,d){if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){g.isThemeMenuVisible()&&g.menus.addSubmenu("theme",y,d);null==fa||"1"==urlParams.embed&&null!=urlParams.lang||g.menus.addSubmenu("language",y,d);"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||"1"==
urlParams.embedInline||g.menus.addSubmenu("appearance",y,d);y.addSeparator(d);g.menus.addSubmenu("units",y,d);this.addSubmenu("diagramLanguage",y,d);g.menus.addMenuItems(y,["-","collapseExpand","animations","tooltips"],d);var p=g.getCurrentFile();"simple"!=Editor.currentTheme&&(null!=p&&p.isRealtimeEnabled()&&p.isRealtimeSupported()&&this.addMenuItems(y,["showRemoteCursors"],d),g.menus.addMenuItems(y,["ruler"],d));EditorUi.isElectronApp&&g.menus.addMenuItems(y,["-","googleFonts","spellCheck","autoBkp",
"drafts"],d);y.addSeparator(d);g.mode!=App.MODE_ATLAS&&g.menus.addMenuItem(y,"configuration",d);y.addSeparator(d)}else g.isThemeMenuVisible()&&this.addSubmenu("theme",y,d),"1"==urlParams.embed&&null!=urlParams.lang||this.addSubmenu("language",y,d),"1"==urlParams.embed&&"1"!=urlParams.atlas||g.menus.addSubmenu("appearance",y,d),EditorUi.isElectronApp&&this.addMenuItems(y,["-","googleFonts","spellCheck","autoBkp","drafts"],d),y.addSeparator(d),"undefined"!==typeof MathJax&&(p=this.addMenuItem(y,"mathematicalTypesetting",
d),(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(p,"https://www.drawio.com/doc/faq/math-typesetting")),"1"!=urlParams.embed&&(p=g.getCurrentFile(),null!=p&&p.isRealtimeEnabled()&&p.isRealtimeSupported()&&this.addMenuItems(y,["showRemoteCursors","shareCursor"],d),this.addMenuItems(y,["autosave"],d)),this.addMenuItems(y,["collapseExpand","-"],d),this.addSubmenu("diagramLanguage",y,d),this.addMenuItems(y,["editDiagram","-"],d),!g.isOfflineApp()&&isLocalStorage&&
-this.addMenuItem(y,"plugins",d),this.addMenuItems(y,["configuration"],d)})));this.put("movePage",new Menu(mxUtils.bind(this,function(y,d){var p=g.currentPage,A=g.getPageIndex(p);if(null!=g.pages)for(var G=0;G<g.pages.length;G++)G!=A&&function(I){y.addItem(g.getShortPageName(g.pages[I]),null,function(){g.movePage(A,I);g.scrollToPage(p,!0)},d)}(G)})));this.put("share",new Menu(mxUtils.bind(this,function(y,d){if(!g.isStandaloneApp()){var p=g.isOffline(!0)?mxResources.get("offline"):g.getNetworkStatus();
+this.addMenuItem(y,"plugins",d),this.addMenuItems(y,["configuration"],d)})));this.put("movePage",new Menu(mxUtils.bind(this,function(y,d){var p=g.currentPage,A=g.getPageIndex(p);if(null!=g.pages)for(var G=0;G<g.pages.length;G++)G!=A&&function(J){y.addItem(g.getShortPageName(g.pages[J]),null,function(){g.movePage(A,J);g.scrollToPage(p,!0)},d)}(G)})));this.put("share",new Menu(mxUtils.bind(this,function(y,d){if(!g.isStandaloneApp()){var p=g.isOffline(!0)?mxResources.get("offline"):g.getNetworkStatus();
null!=p&&(y.addItem(p,null,null,d,null,!1),y.addSeparator(d));g.menus.addMenuItems(y,["share"],d)}this.addMenuItem(y,"publishLink",d,null,null,mxResources.get("publish")+"...");EditorUi.isElectronApp||!g.isOwnGDriveDomain()||"draw.io"!=g.getServiceName()||navigator.standalone||this.addMenuItem(y,"presentationMode",d);null!=g.getMainUser()&&this.addMenuItems(y,["accounts"],d)})));this.put("diagram",new Menu(mxUtils.bind(this,function(y,d){var p=g.getCurrentFile();"simple"!=Editor.currentTheme&&(g.menus.addSubmenu("extras",
y,d,mxResources.get("settings")),y.addSeparator(d));var A="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)g.menus.addMenuItems(y,["new","open"],d),g.menus.addSubmenu("openRecent",y,d),g.menus.addMenuItems(y,"- synchronize properties - save saveAs -".split(" "),d);else if(g.mode==App.MODE_ATLAS){"1"!=urlParams.noSaveBtn&&"1"!=urlParams.embedInline&&g.menus.addMenuItems(y,["-","save"],d);if("1"==urlParams.saveAndExit||"1"==urlParams.noSaveBtn&&
"0"!=urlParams.saveAndExit||g.mode==App.MODE_ATLAS)g.menus.addMenuItems(y,["saveAndExit"],d),null!=p&&p.isRevisionHistorySupported()&&g.menus.addMenuItems(y,["revisionHistory"],d);y.addSeparator(d)}else g.mode==App.MODE_ATLAS?g.menus.addMenuItems(y,["save","synchronize","-"],d):"1"!=urlParams.noFileMenu&&(g.menus.addSubmenu("file",y,d),y.addSeparator(d),"min"==Editor.currentTheme&&(g.menus.addMenuItems(y,"toggleShapes format layers tags - findReplace".split(" "),d),g.commentsSupported()&&g.menus.addMenuItems(y,
@@ -15917,14 +15927,14 @@ g.menus.addMenuItems(y,["revisionHistory"],d),null!=p&&null!=g.fileNode&&"1"!=ur
this.addLinkToItem(A,"https://www.drawio.com/doc/faq/synchronize");y.addSeparator(d)}else this.addMenuItems(y,["new"],d);this.addSubmenu("openFrom",y,d);isLocalStorage&&this.addSubmenu("openRecent",y,d);null!=p&&p.constructor==DriveFile?this.addMenuItems(y,"new - rename makeCopy openFolder moveToFolder".split(" "),d):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==p||p.constructor==LocalFile&&null==p.fileHandle||(y.addSeparator(d),A=this.addMenuItem(y,"synchronize",d),(!g.isOffline()||mxClient.IS_CHROMEAPP||
EditorUi.isElectronApp)&&this.addLinkToItem(A,"https://www.drawio.com/doc/faq/synchronize")),this.addMenuItems(y,["-","save","saveAs","-"],d),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=g.getServiceName()||g.isOfflineApp()||null==p||this.addMenuItems(y,["share","-"],d),null!=p&&p.isRenamable()&&this.addMenuItems(y,["rename"],d),g.isOfflineApp()?this.addMenuItems(y,["upload"],d):(this.addMenuItems(y,["makeCopy"],d),null!=p&&(p.constructor==OneDriveFile&&this.addMenuItems(y,["moveToFolder"],
d),null!=p.getFolderUrl()&&g.menus.addMenuItems(y,["openFolder"],d))));y.addSeparator(d);this.addSubmenu("importFrom",y,d);this.addSubmenu("exportAs",y,d);g.isOffline()||(y.addSeparator(d),this.addSubmenu("embed",y,d),this.addSubmenu("publish",y,d));y.addSeparator(d);this.addSubmenu("newLibrary",y,d);this.addSubmenu("openLibraryFrom",y,d);g.isRevisionHistorySupported()&&this.addMenuItems(y,["-","revisionHistory"],d);null!=p&&null!=g.fileNode&&"1"!=urlParams.embedInline&&this.addMenuItems(y,["-","properties"]);
-this.addMenuItems(y,["-","pageSetup"],d);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(y,["print"],d);this.addMenuItems(y,["-","close"])}})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(y,d){function p(X){var Y=encodeURIComponent(X.name)+(null==X.url?"":"@"+encodeURIComponent(X.url));if(!G[Y]){for(var W=X.name,ca=0;null!=Q[W.toLowerCase()];)W=X.name+" ("+ ++ca+")";null==P[Y]&&(ba.push({name:X.name,url:X.url,label:W,title:X.url}),Q[W.toLowerCase()]=X,P[Y]=X)}}for(var A=mxUtils.bind(this,
-function(X,Y,W,ca,S){var Z=g.editor.graph,da=this.styleChange(y,null!=ca?ca:X,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[X,null!=Y?encodeURIComponent(Y):null,null],null,d,function(){Z.setFont(X,Y);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[X,null!=Y?encodeURIComponent(Y):null,null],"cells",[Z.cellEditor.getEditingCell()]))},function(){Z.updateLabelElements(Z.getSelectionCells(),function(N){N.removeAttribute("face");N.style.fontFamily=
-null;"PRE"==N.nodeName&&Z.replaceElement(N,"div")})});W&&(W=document.createElement("img"),W.className="geAdaptiveAsset",W.setAttribute("src",Editor.crossImage),W.setAttribute("title",mxResources.get("delete")),W.setAttribute("valign","absmiddle"),W.setAttribute("border","0"),W.style.position="relative",W.style.top="2px",W.style.width="14px",W.style.cursor="default",W.style.margin="0 3px",da.firstChild.nextSibling.nextSibling.appendChild(W),mxEvent.addListener(W,mxClient.IS_POINTER?"pointerup":"mouseup",
-mxUtils.bind(this,function(N){this.removeCustomFont(X,Y);this.editorUi.hideCurrentMenu();mxEvent.consume(N)})));Graph.addFont(X,Y);da.firstChild.nextSibling.style.fontFamily=mxUtils.parseCssFontFamily(X);S=null!=ca?ca:X;null!=Y&&(S+=" ("+Y+")");da.setAttribute("title",S)}),G={},I=0;I<this.defaultFonts.length;I++){var L=this.defaultFonts[I];"string"===typeof L?A(L):null!=L.fontFamily&&null!=L.fontUrl&&(G[encodeURIComponent(L.fontFamily)+"@"+encodeURIComponent(L.fontUrl)]=!0,A(L.fontFamily,L.fontUrl))}y.addSeparator(d);
-var P={},Q={},ba=[];for(I=0;I<this.customFonts.length;I++)p(this.customFonts[I]);ba.sort(function(X,Y){return X.label<Y.label?-1:X.label>Y.label?1:0});if(0<ba.length){for(I=0;I<ba.length;I++)A(ba[I].name,ba[I].url,!0,ba[I].label);y.addSeparator(d)}y.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[];g.fireEvent(new mxEventObject("customFontsChanged"))}),d);y.addSeparator(d);y.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var X=this.editorUi.editor.graph,
-Y=X.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],W="s",ca=null;if(X.isEditing()){var S=X.getSelectedEditingElement();if(null!=S){var Z=mxUtils.getCurrentStyle(S);if(null!=Z){Y=mxUtils.getCssFontFamily(Z.fontFamily);Z=X.getView().getState(X.cellEditor.getEditingCell());ca=null!=Z?Z.style.fontSource:null;for(null!=ca&&(ca=decodeURIComponent(ca));null!=S&&S!=X.cellEditor.textarea;){if(S.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=S.getAttribute("data-font-src")){ca=S.getAttribute("data-font-src");
-break}else if(S.getAttribute("face")==Y){ca=null;break}S=S.parentNode}null!=ca&&(Graph.isGoogleFontUrl(ca)?(ca=null,W="g"):W="w")}}}else Z=X.getView().getState(X.getSelectionCell()),null!=Z&&(Y=Z.style[mxConstants.STYLE_FONTFAMILY]||Y,S=Z.style.fontSource,null!=S&&(S=decodeURIComponent(S),Graph.isGoogleFontUrl(S)?W="g":(W="w",ca=S)));null!=ca&&ca.substring(0,PROXY_URL.length)==PROXY_URL&&(ca=decodeURIComponent(ca.substr((PROXY_URL+"?url=").length)));var da=null;document.activeElement==X.cellEditor.textarea&&
-(da=X.cellEditor.saveSelection());Y=new FontDialog(this.editorUi,Y,ca,W,mxUtils.bind(this,function(N,aa,ea){null!=da&&(X.cellEditor.restoreSelection(da),da=null);if(null!=N&&0<N.length)if(this.addCustomFont(N,aa),X.isEditing())X.setFont(N,aa);else{X.getModel().beginUpdate();try{X.stopEditing(!1),X.setCellStyles(mxConstants.STYLE_FONTFAMILY,N),X.setCellStyles("fontSource",null!=aa?encodeURIComponent(aa):null),X.setCellStyles("FType",null)}finally{X.getModel().endUpdate()}}}));this.editorUi.showDialog(Y.container,
+this.addMenuItems(y,["-","pageSetup"],d);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(y,["print"],d);this.addMenuItems(y,["-","close"])}})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(y,d){function p(W){var Y=encodeURIComponent(W.name)+(null==W.url?"":"@"+encodeURIComponent(W.url));if(!G[Y]){for(var X=W.name,ca=0;null!=Q[X.toLowerCase()];)X=W.name+" ("+ ++ca+")";null==P[Y]&&(ba.push({name:W.name,url:W.url,label:X,title:W.url}),Q[X.toLowerCase()]=W,P[Y]=W)}}for(var A=mxUtils.bind(this,
+function(W,Y,X,ca,S){var Z=g.editor.graph,da=this.styleChange(y,null!=ca?ca:W,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[W,null!=Y?encodeURIComponent(Y):null,null],null,d,function(){Z.setFont(W,Y);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[W,null!=Y?encodeURIComponent(Y):null,null],"cells",[Z.cellEditor.getEditingCell()]))},function(){Z.updateLabelElements(Z.getSelectionCells(),function(N){N.removeAttribute("face");N.style.fontFamily=
+null;"PRE"==N.nodeName&&Z.replaceElement(N,"div")})});X&&(X=document.createElement("img"),X.className="geAdaptiveAsset",X.setAttribute("src",Editor.crossImage),X.setAttribute("title",mxResources.get("delete")),X.setAttribute("valign","absmiddle"),X.setAttribute("border","0"),X.style.position="relative",X.style.top="2px",X.style.width="14px",X.style.cursor="default",X.style.margin="0 3px",da.firstChild.nextSibling.nextSibling.appendChild(X),mxEvent.addListener(X,mxClient.IS_POINTER?"pointerup":"mouseup",
+mxUtils.bind(this,function(N){this.removeCustomFont(W,Y);this.editorUi.hideCurrentMenu();mxEvent.consume(N)})));Graph.addFont(W,Y);da.firstChild.nextSibling.style.fontFamily=mxUtils.parseCssFontFamily(W);S=null!=ca?ca:W;null!=Y&&(S+=" ("+Y+")");da.setAttribute("title",S)}),G={},J=0;J<this.defaultFonts.length;J++){var L=this.defaultFonts[J];"string"===typeof L?A(L):null!=L.fontFamily&&null!=L.fontUrl&&(G[encodeURIComponent(L.fontFamily)+"@"+encodeURIComponent(L.fontUrl)]=!0,A(L.fontFamily,L.fontUrl))}y.addSeparator(d);
+var P={},Q={},ba=[];for(J=0;J<this.customFonts.length;J++)p(this.customFonts[J]);ba.sort(function(W,Y){return W.label<Y.label?-1:W.label>Y.label?1:0});if(0<ba.length){for(J=0;J<ba.length;J++)A(ba[J].name,ba[J].url,!0,ba[J].label);y.addSeparator(d)}y.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[];g.fireEvent(new mxEventObject("customFontsChanged"))}),d);y.addSeparator(d);y.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var W=this.editorUi.editor.graph,
+Y=W.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],X="s",ca=null;if(W.isEditing()){var S=W.getSelectedEditingElement();if(null!=S){var Z=mxUtils.getCurrentStyle(S);if(null!=Z){Y=mxUtils.getCssFontFamily(Z.fontFamily);Z=W.getView().getState(W.cellEditor.getEditingCell());ca=null!=Z?Z.style.fontSource:null;for(null!=ca&&(ca=decodeURIComponent(ca));null!=S&&S!=W.cellEditor.textarea;){if(S.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=S.getAttribute("data-font-src")){ca=S.getAttribute("data-font-src");
+break}else if(S.getAttribute("face")==Y){ca=null;break}S=S.parentNode}null!=ca&&(Graph.isGoogleFontUrl(ca)?(ca=null,X="g"):X="w")}}}else Z=W.getView().getState(W.getSelectionCell()),null!=Z&&(Y=Z.style[mxConstants.STYLE_FONTFAMILY]||Y,S=Z.style.fontSource,null!=S&&(S=decodeURIComponent(S),Graph.isGoogleFontUrl(S)?X="g":(X="w",ca=S)));null!=ca&&ca.substring(0,PROXY_URL.length)==PROXY_URL&&(ca=decodeURIComponent(ca.substr((PROXY_URL+"?url=").length)));var da=null;document.activeElement==W.cellEditor.textarea&&
+(da=W.cellEditor.saveSelection());Y=new FontDialog(this.editorUi,Y,ca,X,mxUtils.bind(this,function(N,aa,ea){null!=da&&(W.cellEditor.restoreSelection(da),da=null);if(null!=N&&0<N.length)if(this.addCustomFont(N,aa),W.isEditing())W.setFont(N,aa);else{W.getModel().beginUpdate();try{W.stopEditing(!1),W.setCellStyles(mxConstants.STYLE_FONTFAMILY,N),W.setCellStyles("fontSource",null!=aa?encodeURIComponent(aa):null),W.setCellStyles("FType",null)}finally{W.getModel().endUpdate()}}}));this.editorUi.showDialog(Y.container,
380,null,!0,!0);Y.init()}),d,null,!0)})))}})();function DiagramPage(b,k){this.node=b;null!=k?this.node.setAttribute("id",k):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};
DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.getViewBox=function(){var b=this.node.getAttribute("viewBox");if(null!=b){var k=b.split(" ");b=parseFloat(k[0]);var m=parseFloat(k[1]),g=parseFloat(k[2]),q=parseFloat(k[3]);k=4<k.length?parseFloat(k[4]):null;if(isFinite(b)&&isFinite(m)&&isFinite(g)&&isFinite(q)&&0<g&&0<q)return{x:b,y:m,width:g,height:q,scale:null!=k&&isFinite(k)&&0<k?k:null}}return null};
DiagramPage.prototype.setViewBox=function(b){if(null==b)this.node.removeAttribute("viewBox");else{var k=b.x+" "+b.y+" "+b.width+" "+b.height;null!=b.scale&&(k+=" "+b.scale);this.node.setAttribute("viewBox",k)}};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,k,m){this.ui=b;this.page=k;this.previous=this.name=m}
@@ -15979,13 +15989,13 @@ EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var k=new Diagra
EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var k=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(m){null!=m&&0<m.length&&this.editor.graph.model.execute(new RenamePage(this,b,m))}),mxResources.get("rename"));this.showDialog(k.container,300,80,!0,!0);k.init()}return b};EditorUi.prototype.movePage=function(b,k){this.editor.graph.model.execute(new MovePage(this,b,k))};
EditorUi.prototype.sortPages=function(){var b=this.pages.slice().sort(function(q,u){return(q.getName()||"").localeCompare(u.getName()||"",void 0,{numeric:!0,sensitivity:"base"})}),k=this.editor.graph.model;k.beginUpdate();try{for(var m=0;m<b.length;m++){var g=mxUtils.indexOf(this.pages,b[m]);g!=m&&this.movePage(g,m)}}finally{k.endUpdate()}this.scrollToPage(this.currentPage,!0)};
EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer geTabItem";return b};
-EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,k=document.createElement("div");k.className="geTabScroller";for(var m=null,g=null,q=null,u=this,x=null!=this.tabScroller?this.tabScroller.scrollLeft:0,z=!1,F=0;F<this.pages.length;F++){var J=this.pages[F];if(null!=J){var H=J.getId(),D=J.getName()||
-mxResources.get("untitled"),c=H+":"+D;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",D+(null!=H?" ("+H+")":"")+" ["+(F+1)+"]"):(c=this.createTabForPage(J,F+1),z=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",F);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(n){b.isEnabled()?(mxClient.IS_FF&&n.dataTransfer.setData("Text","<diagram/>"),m=parseInt(n.currentTarget.getAttribute("data-index"),
+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,k=document.createElement("div");k.className="geTabScroller";for(var m=null,g=null,q=null,u=this,x=null!=this.tabScroller?this.tabScroller.scrollLeft:0,z=!1,F=0;F<this.pages.length;F++){var I=this.pages[F];if(null!=I){var H=I.getId(),D=I.getName()||
+mxResources.get("untitled"),c=H+":"+D;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",D+(null!=H?" ("+H+")":"")+" ["+(F+1)+"]"):(c=this.createTabForPage(I,F+1),z=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",F);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(n){b.isEnabled()?(mxClient.IS_FF&&n.dataTransfer.setData("Text","<diagram/>"),m=parseInt(n.currentTarget.getAttribute("data-index"),
10),g=n.currentTarget,window.requestAnimationFrame(function(){null!=g&&g.classList.add("gePageTabDragPlaceholder")}),u._pageTabDragOverHandler=function(r){r.dataTransfer.dropEffect="move";r.preventDefault();r.target.classList&&r.target.classList.contains("gePageTab")||r.stopPropagation()},u._pageTabDropHandler=function(r){r.preventDefault();r.stopPropagation()},document.addEventListener("dragover",u._pageTabDragOverHandler,!0),document.addEventListener("drop",u._pageTabDropHandler,!0)):mxEvent.consume(n)})),
mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(n){if(null!=g){g.classList.remove("gePageTabDragPlaceholder");for(var r=g.parentNode.querySelectorAll(".gePageTab"),t=0,v=0;v<r.length;v++)if(r[v]==g){t=v;break}null!=m&&t!=m&&this.movePage(m,t)}null!=u._pageTabDragOverHandler&&(document.removeEventListener("dragover",u._pageTabDragOverHandler,!0),document.removeEventListener("drop",u._pageTabDropHandler,!0),u._pageTabDragOverHandler=null,u._pageTabDropHandler=null);g=m=null;n.stopPropagation();
-n.preventDefault()})),mxEvent.addListener(c,"dragover",function(n){if(null!=m&&null!=g){n.dataTransfer.dropEffect="move";var r=n.currentTarget;if(r!=g){var t=r.getBoundingClientRect(),v=g.parentNode;n.clientX<t.left+t.width/2?v.insertBefore(g,r):r.nextSibling!=g&&v.insertBefore(g,r.nextSibling)}}n.stopPropagation();n.preventDefault()}),mxEvent.addListener(c,"drop",function(n){n.stopPropagation();n.preventDefault()}));J==this.currentPage&&(q=c);k.appendChild(c)}}this.tabContainer.innerText="";this.isPageInsertTabVisible()&&
-this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(k);this.leftScrollTab=this.createLeftScrollTab();this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);if(Graph.browserTranslate&&Graph.isBrowserTranslated())for(this.btPageTabCache={},F=0;F<k.children.length;F++)J=
-null!=this.pages&&F<this.pages.length?this.pages[F]:null,null!=J&&(J=J.getId()+":"+(J.getName()||mxResources.get("untitled")),this.btPageTabCache[J]=k.children[F]);this.tabScroller=k;mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(n){this.checkTabScrollerOverflow()}));if(Graph.browserTranslate&&Graph.isBrowserTranslated()){if(null==this.btCanary){u=this;this.btCanary=document.createElement("p");this.btCanary.setAttribute("aria-hidden","true");this.btCanary.style.cssText="position:absolute;left:-10000px;top:0;width:1px;height:1px;overflow:hidden;pointer-events:none;";
+n.preventDefault()})),mxEvent.addListener(c,"dragover",function(n){if(null!=m&&null!=g){n.dataTransfer.dropEffect="move";var r=n.currentTarget;if(r!=g){var t=r.getBoundingClientRect(),v=g.parentNode;n.clientX<t.left+t.width/2?v.insertBefore(g,r):r.nextSibling!=g&&v.insertBefore(g,r.nextSibling)}}n.stopPropagation();n.preventDefault()}),mxEvent.addListener(c,"drop",function(n){n.stopPropagation();n.preventDefault()}));I==this.currentPage&&(q=c);k.appendChild(c)}}this.tabContainer.innerText="";this.isPageInsertTabVisible()&&
+this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(k);this.leftScrollTab=this.createLeftScrollTab();this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);if(Graph.browserTranslate&&Graph.isBrowserTranslated())for(this.btPageTabCache={},F=0;F<k.children.length;F++)I=
+null!=this.pages&&F<this.pages.length?this.pages[F]:null,null!=I&&(I=I.getId()+":"+(I.getName()||mxResources.get("untitled")),this.btPageTabCache[I]=k.children[F]);this.tabScroller=k;mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(n){this.checkTabScrollerOverflow()}));if(Graph.browserTranslate&&Graph.isBrowserTranslated()){if(null==this.btCanary){u=this;this.btCanary=document.createElement("p");this.btCanary.setAttribute("aria-hidden","true");this.btCanary.style.cssText="position:absolute;left:-10000px;top:0;width:1px;height:1px;overflow:hidden;pointer-events:none;";
this.btCanaryOriginal="Click here to insert a new page into the document";this.btCanary.textContent=this.btCanaryOriginal;document.body.appendChild(this.btCanary);this.btCanarySavedScroll=null;var f=function(){null!=u.btCanarySavedScroll&&null!=u.tabScroller&&(u.btCanarySavedScroll=null,u.scrollToPage(null,!0))};this.btCanaryObserver=new MutationObserver(function(){null!=u.btCanarySavedScroll&&u.btCanary.textContent!=u.btCanaryOriginal&&setTimeout(f,100)});this.btCanaryObserver.observe(this.btCanary,
{characterData:!0,childList:!0,subtree:!0})}null==this.btCanarySavedScroll&&z&&0<this.btKnownTabScroll&&(this.btCanarySavedScroll=this.btKnownTabScroll,this.btCanary.textContent=this.btCanaryOriginal,document.body.appendChild(this.btCanary))}var l=document.createElement("a");l.href="https://github.com/jgraph/drawio";l.target="_blank";l.style.cssText="margin-left:auto;display:flex;align-items:center;padding:0 8px;opacity:0.5;flex-shrink:0";k=document.createElement("img");k.src=IMAGE_PATH+(Editor.isDarkMode()?
"/github-logo-white.svg":"/github-logo.svg");k.style.cssText="width:18px;height:18px";k.setAttribute("title","jgraph/drawio");l.appendChild(k);mxEvent.addListener(l,"mouseenter",function(){l.style.opacity="1"});mxEvent.addListener(l,"mouseleave",function(){l.style.opacity="0.5"});this.tabContainer.appendChild(l);null!=q&&q.classList.add("geActivePage");this.tabScroller.scrollLeft=x;this.scrollToPage();this.btKnownTabScroll=this.tabScroller.scrollLeft;this.checkTabScrollerOverflow();null!=q&&q.scrollIntoView({behavior:"smooth",
@@ -15999,74 +16009,75 @@ EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(
EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var k=new mxPopupMenu(mxUtils.bind(this,function(q,u){this.menus.get("pages").funct(q,u)}));k.smartSeparators=!0;k.showDisabled=!0;k.autoExpand=!0;k.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(k,arguments);k.destroy()});var m=mxEvent.getClientX(b),g=mxEvent.getClientY(b);k.popup(m,
g,null,b);this.setCurrentMenu(k);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,k){var m=this.createTab(),g=b.getName()||mxResources.get("untitled"),q=b.getId();m.setAttribute("title",g+(null!=q?" ("+q+")":"")+" ["+k+"]");k=document.createElement("span");k.style.maxWidth="160px";k.style.textOverflow="ellipsis";k.style.overflow="hidden";mxUtils.write(k,g);m.appendChild(k);this.addTabListeners(b,m);return m};
EditorUi.prototype.addTabListeners=function(b,k){mxEvent.disableContextMenu(k);var m=this.editor.graph;mxEvent.addListener(k,"dblclick",mxUtils.bind(this,function(F){this.renamePage(b);mxEvent.consume(F)}));var g=document.createElement("div");g.style.backgroundImage="url("+Editor.thinExpandImage+")";g.className="geButton";k.appendChild(g);var q=!1,u=!1,x=mxUtils.bind(this,function(F){q=null!=this.currentMenu;u=b==this.currentPage;this.scrollToPage(b);m.isMouseDown||u||this.selectPage(b)}),z=mxUtils.bind(this,
-function(F){if(!m.isMouseDown&&(u&&(mxEvent.isTouchEvent(F)||mxEvent.getSource(F)==g)||mxEvent.isPopupTrigger(F))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(F)||!q)){var J=new mxPopupMenu(this.createPageMenu(b));J.smartSeparators=!0;J.showDisabled=!0;J.autoExpand=!0;J.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(J,arguments);this.resetCurrentMenu();J.destroy()});var H=mxEvent.getClientX(F),D=mxEvent.getClientY(F);J.popup(H,D,null,F);
-this.setCurrentMenu(J,k)}mxEvent.consume(F)});mxEvent.addGestureListeners(g,x,null,z);mxEvent.addGestureListeners(k,x,null,z)};
+function(F){if(!m.isMouseDown&&(u&&(mxEvent.isTouchEvent(F)||mxEvent.getSource(F)==g)||mxEvent.isPopupTrigger(F))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(F)||!q)){var I=new mxPopupMenu(this.createPageMenu(b));I.smartSeparators=!0;I.showDisabled=!0;I.autoExpand=!0;I.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(I,arguments);this.resetCurrentMenu();I.destroy()});var H=mxEvent.getClientX(F),D=mxEvent.getClientY(F);I.popup(H,D,null,F);
+this.setCurrentMenu(I,k)}mxEvent.consume(F)});mxEvent.addGestureListeners(g,x,null,z);mxEvent.addGestureListeners(k,x,null,z)};
EditorUi.prototype.createPageMenu=function(b,k){return mxUtils.bind(this,function(m,g){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||m.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),g));this.editor.graph.isEnabled()&&(this.menus.addMenuItems(m,["duplicatePage","-"],g),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",
-m,g,mxResources.get("move")),this.menus.addMenuItems(m,["removePage","renamePage"],g))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(g,q,u,x,z){q=null!=q?q:!1;null==u&&(u=this.getFoldableCells(this.getSelectionCells(),g));this.stopEditing();this.model.beginUpdate();try{for(var F=u.slice(),J=0;J<u.length;J++)"1"==mxUtils.getValue(this.getCurrentCellStyle(u[J]),"treeFolding","0")&&this.foldTreeCell(g,u[J]);u=F;u=b.apply(this,arguments)}finally{this.model.endUpdate()}return u};Graph.prototype.foldTreeCell=function(g,q){this.model.beginUpdate();try{var u=
-[];this.traverse(q,!0,mxUtils.bind(this,function(z,F){var J=null!=F&&this.isTreeEdge(F);J&&u.push(F);z==q||null!=F&&!J||u.push(z);return(null==F||J)&&(z==q||!this.model.isCollapsed(z))}));this.model.setCollapsed(q,g);for(var x=0;x<u.length;x++)this.model.setVisible(u[x],!g)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(g){return!this.isEdgeIgnored(g)};Graph.prototype.getTreeEdges=function(g,q,u,x,z,F){return this.model.filterCells(this.getEdges(g,q,u,x,z,F),mxUtils.bind(this,
-function(J){return this.isTreeEdge(J)}))};Graph.prototype.getIncomingTreeEdges=function(g,q){return this.getTreeEdges(g,q,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(g,q){return this.getTreeEdges(g,q,!1,!0,!1)};var k=EditorUi.prototype.init;EditorUi.prototype.init=function(){k.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function g(d){return B.isVertex(d)&&u(d)}function q(d){var p=!1;null!=d&&(p="1"==
-v.getCurrentCellStyle(d).treeMoving);return p}function u(d){var p=!1;null!=d&&(d=B.getParent(d),p=v.view.getState(d),p="tree"==(null!=p?p.style:v.getCellStyle(d)).containerType);return p}function x(d){for(;null!=d&&!u(d);)d=B.getParent(d);return null!=d?B.getParent(d):null}function z(d){var p=!1;null!=d&&(d=B.getParent(d),p=v.view.getState(d),v.view.getState(d),p=null!=(null!=p?p.style:v.getCellStyle(d)).childLayout);return p}function F(d,p){function A(Y,W){null!=Y&&(I.cut.get(Y)||(I.cut.put(Y,!0),
-I.cells.push(Y)),W&&!L.get(Y)&&(L.put(Y,!0),P.push(Y)))}function G(Y){if(!I.deleted.get(Y)){I.deleted.put(Y,!0);I.cells.push(Y);Y=v.getAllEdges([Y]);for(var W=0;W<Y.length;W++)A(Y[W],!0)}}for(var I={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},L=new mxDictionary,P=[],Q=0;Q<d.length;Q++){var ba=d[Q];B.isEdge(ba)?A(ba,!1):B.isVertex(ba)&&null!=x(ba)?G(ba):null!=ba&&I.cells.push(ba)}for(;0<P.length;)if(d=B.getTerminal(P.shift(),!1),null!=d&&!I.deleted.get(d)&&B.isVertex(d)&&(Q=
-x(d),null!=Q&&(null==p||!p.get(Q)))){Q=v.getIncomingTreeEdges(d);ba=!0;for(var X=0;X<Q.length;X++)if(!I.cut.get(Q[X])){ba=!1;break}ba&&(I.cascaded.push(d),G(d))}return I}function J(d){d=v.view.getState(d);if(null!=d){var p=v.getIncomingTreeEdges(d.cell);if(0<p.length&&(p=v.view.getState(p[0]),null!=p&&(p=p.absolutePoints,null!=p&&0<p.length&&(p=p[p.length-1],null!=p)))){if(p.y==d.y&&Math.abs(p.x-d.getCenterX())<d.width/2)return mxConstants.DIRECTION_SOUTH;if(p.y==d.y+d.height&&Math.abs(p.x-d.getCenterX())<
-d.width/2)return mxConstants.DIRECTION_NORTH;if(p.x>d.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function H(d,p,A){if(null!=A){for(var G=v.getCurrentCellStyle(p),I=["treeFolding","treeMoving","newEdgeStyle"],L=0;L<I.length;L++)null!=G[I[L]]&&(null==A.style||0>A.style.indexOf(I[L]+"="))&&(A.style=mxUtils.setStyle(A.style,I[L],G[I[L]]));null!=A.geometry&&null!=p.geometry&&(A.geometry.x=p.geometry.x,A.geometry.y=p.geometry.y);v.model.getTerminal(d[0],!1)==d[1]&&
-v.model.setTerminal(d[0],A,!1);d[1]=A}return d}function D(d,p,A){p=null!=p?p:!0;v.model.beginUpdate();try{var G=v.model.getParent(d),I=v.getIncomingTreeEdges(d),L=H(v.cloneCells([I[0],d]),d,A);v.model.setTerminal(L[0],v.model.getTerminal(I[0],!0),!0);var P=J(d),Q=G.geometry;P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH?L[1].geometry.x+=p?d.geometry.width+10:-L[1].geometry.width-10:L[1].geometry.y+=p?d.geometry.height+10:-L[1].geometry.height-10;v.view.currentRoot!=G&&(L[1].geometry.x-=
-Q.x,L[1].geometry.y-=Q.y);var ba=v.view.getState(d),X=v.view.scale;if(null!=ba){var Y=mxRectangle.fromRectangle(ba);P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH?Y.x+=(p?d.geometry.width+10:-L[1].geometry.width-10)*X:Y.y+=(p?d.geometry.height+10:-L[1].geometry.height-10)*X;var W=v.getOutgoingTreeEdges(v.model.getTerminal(I[0],!0));if(null!=W){var ca=P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH;for(Q=I=A=0;Q<W.length;Q++){var S=v.model.getTerminal(W[Q],!1);if(P==
-J(S)){var Z=v.view.getState(S);S!=d&&null!=Z&&(ca&&p!=Z.getCenterX()<ba.getCenterX()||!ca&&p!=Z.getCenterY()<ba.getCenterY())&&mxUtils.intersects(Y,Z)&&(A=10+Math.max(A,(Math.min(Y.x+Y.width,Z.x+Z.width)-Math.max(Y.x,Z.x))/X),I=10+Math.max(I,(Math.min(Y.y+Y.height,Z.y+Z.height)-Math.max(Y.y,Z.y))/X))}}ca?I=0:A=0;for(Q=0;Q<W.length;Q++)if(S=v.model.getTerminal(W[Q],!1),P==J(S)&&(Z=v.view.getState(S),S!=d&&null!=Z&&(ca&&p!=Z.getCenterX()<ba.getCenterX()||!ca&&p!=Z.getCenterY()<ba.getCenterY()))){var da=
-[];v.traverse(Z.cell,!0,function(N,aa){var ea=null!=aa&&v.isTreeEdge(aa);ea&&da.push(aa);(null==aa||ea)&&da.push(N);return null==aa||ea});v.moveCells(da,(p?1:-1)*A,(p?1:-1)*I)}}}return v.addCells(L,G)}finally{v.model.endUpdate()}}function c(d,p){v.model.beginUpdate();try{var A=J(d),G=v.getIncomingTreeEdges(d),I=H(v.cloneCells([G[0],d]),d,p);v.model.setTerminal(G[0],I[1],!1);v.model.setTerminal(I[0],I[1],!0);v.model.setTerminal(I[0],d,!1);var L=v.model.getParent(d),P=L.geometry,Q=[];v.view.currentRoot!=
-L&&(I[1].geometry.x-=P.x,I[1].geometry.y-=P.y);v.traverse(d,!0,function(Y,W){var ca=null!=W&&v.isTreeEdge(W);ca&&Q.push(W);(null==W||ca)&&Q.push(Y);return null==W||ca});var ba=d.geometry.width+40,X=d.geometry.height+40;A==mxConstants.DIRECTION_SOUTH?ba=0:A==mxConstants.DIRECTION_NORTH?(ba=0,X=-X):A==mxConstants.DIRECTION_WEST?(ba=-ba,X=0):A==mxConstants.DIRECTION_EAST&&(X=0);v.moveCells(Q,ba,X);return v.addCells(I,L)}finally{v.model.endUpdate()}}function f(d,p,A){v.model.beginUpdate();try{var G=v.model.getParent(d),
-I=v.getIncomingTreeEdges(d),L=J(d);0==I.length&&(I=[v.createEdge(G,null,"",null,null,v.createCurrentEdgeStyle())],L=p);var P=H(v.cloneCells([I[0],d]),d,A);v.model.setTerminal(P[0],d,!0);null==v.model.getTerminal(P[0],!1)&&(v.model.setTerminal(P[0],P[1],!1),v.applyNewEdgeStyle(P[1],[P[0]],L));I=v.getOutgoingTreeEdges(d);var Q=G.geometry;p=[];v.view.currentRoot==G&&(Q=new mxRectangle);for(A=0;A<I.length;A++){var ba=v.model.getTerminal(I[A],!1);null!=ba&&p.push(ba)}var X=v.view.getBounds(p),Y=v.view.translate,
-W=v.view.scale;L==mxConstants.DIRECTION_SOUTH?(P[1].geometry.x=null==X?d.geometry.x+(d.geometry.width-P[1].geometry.width)/2:(X.x+X.width)/W-Y.x-Q.x+10,P[1].geometry.y+=d.geometry.height-Q.y+40):L==mxConstants.DIRECTION_NORTH?(P[1].geometry.x=null==X?d.geometry.x+(d.geometry.width-P[1].geometry.width)/2:(X.x+X.width)/W-Y.x+-Q.x+10,P[1].geometry.y-=P[1].geometry.height+Q.y+40):(P[1].geometry.x=L==mxConstants.DIRECTION_WEST?P[1].geometry.x-(P[1].geometry.width+Q.x+40):P[1].geometry.x+(d.geometry.width-
-Q.x+40),P[1].geometry.y=null==X?d.geometry.y+(d.geometry.height-P[1].geometry.height)/2:(X.y+X.height)/W-Y.y+-Q.y+10);return v.addCells(P,G)}finally{v.model.endUpdate()}}function l(d,p,A){d=v.getOutgoingTreeEdges(d);A=v.view.getState(A);var G=[];if(null!=A&&null!=d){for(var I=0;I<d.length;I++){var L=v.view.getState(v.model.getTerminal(d[I],!1));null!=L&&(!p&&Math.min(L.x+L.width,A.x+A.width)>=Math.max(L.x,A.x)||p&&Math.min(L.y+L.height,A.y+A.height)>=Math.max(L.y,A.y))&&G.push(L)}G.sort(function(P,
-Q){return p?P.x+P.width-Q.x-Q.width:P.y+P.height-Q.y-Q.height})}return G}function n(d,p){var A=J(d),G=p==mxConstants.DIRECTION_EAST||p==mxConstants.DIRECTION_WEST;(A==mxConstants.DIRECTION_EAST||A==mxConstants.DIRECTION_WEST)==G&&A!=p?t.actions.get("selectParent").funct():A==p?(p=v.getOutgoingTreeEdges(d),null!=p&&0<p.length&&v.setSelectionCell(v.model.getTerminal(p[0],!1))):(A=v.getIncomingTreeEdges(d),null!=A&&0<A.length&&(G=l(v.model.getTerminal(A[0],!0),G,d),d=v.view.getState(d),null!=d&&(d=mxUtils.indexOf(G,
+m,g,mxResources.get("move")),this.menus.addMenuItems(m,["removePage","renamePage"],g))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(g,q,u,x,z){q=null!=q?q:!1;null==u&&(u=this.getFoldableCells(this.getSelectionCells(),g));this.stopEditing();this.model.beginUpdate();try{for(var F=u.slice(),I=0;I<u.length;I++)"1"==mxUtils.getValue(this.getCurrentCellStyle(u[I]),"treeFolding","0")&&this.foldTreeCell(g,u[I]);u=F;u=b.apply(this,arguments)}finally{this.model.endUpdate()}return u};Graph.prototype.foldTreeCell=function(g,q){this.model.beginUpdate();try{var u=
+[];this.traverse(q,!0,mxUtils.bind(this,function(z,F){var I=null!=F&&this.isTreeEdge(F);I&&u.push(F);z==q||null!=F&&!I||u.push(z);return(null==F||I)&&(z==q||!this.model.isCollapsed(z))}));this.model.setCollapsed(q,g);for(var x=0;x<u.length;x++)this.model.setVisible(u[x],!g)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(g){return!this.isEdgeIgnored(g)};Graph.prototype.getTreeEdges=function(g,q,u,x,z,F){return this.model.filterCells(this.getEdges(g,q,u,x,z,F),mxUtils.bind(this,
+function(I){return this.isTreeEdge(I)}))};Graph.prototype.getIncomingTreeEdges=function(g,q){return this.getTreeEdges(g,q,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(g,q){return this.getTreeEdges(g,q,!1,!0,!1)};var k=EditorUi.prototype.init;EditorUi.prototype.init=function(){k.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function g(d){return B.isVertex(d)&&u(d)}function q(d){var p=!1;null!=d&&(p="1"==
+v.getCurrentCellStyle(d).treeMoving);return p}function u(d){var p=!1;null!=d&&(d=B.getParent(d),p=v.view.getState(d),p="tree"==(null!=p?p.style:v.getCellStyle(d)).containerType);return p}function x(d){for(;null!=d&&!u(d);)d=B.getParent(d);return null!=d?B.getParent(d):null}function z(d){var p=!1;null!=d&&(d=B.getParent(d),p=v.view.getState(d),v.view.getState(d),p=null!=(null!=p?p.style:v.getCellStyle(d)).childLayout);return p}function F(d,p){function A(Y,X){null!=Y&&(J.cut.get(Y)||(J.cut.put(Y,!0),
+J.cells.push(Y)),X&&!L.get(Y)&&(L.put(Y,!0),P.push(Y)))}function G(Y){if(!J.deleted.get(Y)){J.deleted.put(Y,!0);J.cells.push(Y);Y=v.getAllEdges([Y]);for(var X=0;X<Y.length;X++)A(Y[X],!0)}}for(var J={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},L=new mxDictionary,P=[],Q=0;Q<d.length;Q++){var ba=d[Q];B.isEdge(ba)?A(ba,!1):B.isVertex(ba)&&null!=x(ba)?G(ba):null!=ba&&J.cells.push(ba)}for(;0<P.length;)if(d=B.getTerminal(P.shift(),!1),null!=d&&!J.deleted.get(d)&&B.isVertex(d)&&(Q=
+x(d),null!=Q&&(null==p||!p.get(Q)))){Q=v.getIncomingTreeEdges(d);ba=!0;for(var W=0;W<Q.length;W++)if(!J.cut.get(Q[W])){ba=!1;break}ba&&(J.cascaded.push(d),G(d))}return J}function I(d){d=v.view.getState(d);if(null!=d){var p=v.getIncomingTreeEdges(d.cell);if(0<p.length&&(p=v.view.getState(p[0]),null!=p&&(p=p.absolutePoints,null!=p&&0<p.length&&(p=p[p.length-1],null!=p)))){if(p.y==d.y&&Math.abs(p.x-d.getCenterX())<d.width/2)return mxConstants.DIRECTION_SOUTH;if(p.y==d.y+d.height&&Math.abs(p.x-d.getCenterX())<
+d.width/2)return mxConstants.DIRECTION_NORTH;if(p.x>d.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function H(d,p,A){if(null!=A){for(var G=v.getCurrentCellStyle(p),J=["treeFolding","treeMoving","newEdgeStyle"],L=0;L<J.length;L++)null!=G[J[L]]&&(null==A.style||0>A.style.indexOf(J[L]+"="))&&(A.style=mxUtils.setStyle(A.style,J[L],G[J[L]]));null!=A.geometry&&null!=p.geometry&&(A.geometry.x=p.geometry.x,A.geometry.y=p.geometry.y);v.model.getTerminal(d[0],!1)==d[1]&&
+v.model.setTerminal(d[0],A,!1);d[1]=A}return d}function D(d,p,A){p=null!=p?p:!0;v.model.beginUpdate();try{var G=v.model.getParent(d),J=v.getIncomingTreeEdges(d),L=H(v.cloneCells([J[0],d]),d,A);v.model.setTerminal(L[0],v.model.getTerminal(J[0],!0),!0);var P=I(d),Q=G.geometry;P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH?L[1].geometry.x+=p?d.geometry.width+10:-L[1].geometry.width-10:L[1].geometry.y+=p?d.geometry.height+10:-L[1].geometry.height-10;v.view.currentRoot!=G&&(L[1].geometry.x-=
+Q.x,L[1].geometry.y-=Q.y);var ba=v.view.getState(d),W=v.view.scale;if(null!=ba){var Y=mxRectangle.fromRectangle(ba);P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH?Y.x+=(p?d.geometry.width+10:-L[1].geometry.width-10)*W:Y.y+=(p?d.geometry.height+10:-L[1].geometry.height-10)*W;var X=v.getOutgoingTreeEdges(v.model.getTerminal(J[0],!0));if(null!=X){var ca=P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH;for(Q=J=A=0;Q<X.length;Q++){var S=v.model.getTerminal(X[Q],!1);if(P==
+I(S)){var Z=v.view.getState(S);S!=d&&null!=Z&&(ca&&p!=Z.getCenterX()<ba.getCenterX()||!ca&&p!=Z.getCenterY()<ba.getCenterY())&&mxUtils.intersects(Y,Z)&&(A=10+Math.max(A,(Math.min(Y.x+Y.width,Z.x+Z.width)-Math.max(Y.x,Z.x))/W),J=10+Math.max(J,(Math.min(Y.y+Y.height,Z.y+Z.height)-Math.max(Y.y,Z.y))/W))}}ca?J=0:A=0;for(Q=0;Q<X.length;Q++)if(S=v.model.getTerminal(X[Q],!1),P==I(S)&&(Z=v.view.getState(S),S!=d&&null!=Z&&(ca&&p!=Z.getCenterX()<ba.getCenterX()||!ca&&p!=Z.getCenterY()<ba.getCenterY()))){var da=
+[];v.traverse(Z.cell,!0,function(N,aa){var ea=null!=aa&&v.isTreeEdge(aa);ea&&da.push(aa);(null==aa||ea)&&da.push(N);return null==aa||ea});v.moveCells(da,(p?1:-1)*A,(p?1:-1)*J)}}}return v.addCells(L,G)}finally{v.model.endUpdate()}}function c(d,p){v.model.beginUpdate();try{var A=I(d),G=v.getIncomingTreeEdges(d),J=H(v.cloneCells([G[0],d]),d,p);v.model.setTerminal(G[0],J[1],!1);v.model.setTerminal(J[0],J[1],!0);v.model.setTerminal(J[0],d,!1);var L=v.model.getParent(d),P=L.geometry,Q=[];v.view.currentRoot!=
+L&&(J[1].geometry.x-=P.x,J[1].geometry.y-=P.y);v.traverse(d,!0,function(Y,X){var ca=null!=X&&v.isTreeEdge(X);ca&&Q.push(X);(null==X||ca)&&Q.push(Y);return null==X||ca});var ba=d.geometry.width+40,W=d.geometry.height+40;A==mxConstants.DIRECTION_SOUTH?ba=0:A==mxConstants.DIRECTION_NORTH?(ba=0,W=-W):A==mxConstants.DIRECTION_WEST?(ba=-ba,W=0):A==mxConstants.DIRECTION_EAST&&(W=0);v.moveCells(Q,ba,W);return v.addCells(J,L)}finally{v.model.endUpdate()}}function f(d,p,A){v.model.beginUpdate();try{var G=v.model.getParent(d),
+J=v.getIncomingTreeEdges(d),L=I(d);0==J.length&&(J=[v.createEdge(G,null,"",null,null,v.createCurrentEdgeStyle())],L=p);var P=H(v.cloneCells([J[0],d]),d,A);v.model.setTerminal(P[0],d,!0);null==v.model.getTerminal(P[0],!1)&&(v.model.setTerminal(P[0],P[1],!1),v.applyNewEdgeStyle(P[1],[P[0]],L));J=v.getOutgoingTreeEdges(d);var Q=G.geometry;p=[];v.view.currentRoot==G&&(Q=new mxRectangle);for(A=0;A<J.length;A++){var ba=v.model.getTerminal(J[A],!1);null!=ba&&p.push(ba)}var W=v.view.getBounds(p),Y=v.view.translate,
+X=v.view.scale;L==mxConstants.DIRECTION_SOUTH?(P[1].geometry.x=null==W?d.geometry.x+(d.geometry.width-P[1].geometry.width)/2:(W.x+W.width)/X-Y.x-Q.x+10,P[1].geometry.y+=d.geometry.height-Q.y+40):L==mxConstants.DIRECTION_NORTH?(P[1].geometry.x=null==W?d.geometry.x+(d.geometry.width-P[1].geometry.width)/2:(W.x+W.width)/X-Y.x+-Q.x+10,P[1].geometry.y-=P[1].geometry.height+Q.y+40):(P[1].geometry.x=L==mxConstants.DIRECTION_WEST?P[1].geometry.x-(P[1].geometry.width+Q.x+40):P[1].geometry.x+(d.geometry.width-
+Q.x+40),P[1].geometry.y=null==W?d.geometry.y+(d.geometry.height-P[1].geometry.height)/2:(W.y+W.height)/X-Y.y+-Q.y+10);return v.addCells(P,G)}finally{v.model.endUpdate()}}function l(d,p,A){d=v.getOutgoingTreeEdges(d);A=v.view.getState(A);var G=[];if(null!=A&&null!=d){for(var J=0;J<d.length;J++){var L=v.view.getState(v.model.getTerminal(d[J],!1));null!=L&&(!p&&Math.min(L.x+L.width,A.x+A.width)>=Math.max(L.x,A.x)||p&&Math.min(L.y+L.height,A.y+A.height)>=Math.max(L.y,A.y))&&G.push(L)}G.sort(function(P,
+Q){return p?P.x+P.width-Q.x-Q.width:P.y+P.height-Q.y-Q.height})}return G}function n(d,p){var A=I(d),G=p==mxConstants.DIRECTION_EAST||p==mxConstants.DIRECTION_WEST;(A==mxConstants.DIRECTION_EAST||A==mxConstants.DIRECTION_WEST)==G&&A!=p?t.actions.get("selectParent").funct():A==p?(p=v.getOutgoingTreeEdges(d),null!=p&&0<p.length&&v.setSelectionCell(v.model.getTerminal(p[0],!1))):(A=v.getIncomingTreeEdges(d),null!=A&&0<A.length&&(G=l(v.model.getTerminal(A[0],!0),G,d),d=v.view.getState(d),null!=d&&(d=mxUtils.indexOf(G,
d),0<=d&&(d+=p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_WEST?-1:1,0<=d&&d<=G.length-1&&v.setSelectionCell(G[d].cell)))))}function r(d){return(q(d)||g(d))&&!z(d)&&0<v.getOutgoingTreeEdges(d).length&&!v.isCellCollapsed(d)}var t=this,v=t.editor.graph,B=v.getModel(),E=t.menus.createPopupMenu;t.menus.createPopupMenu=function(d,p,A){E.apply(this,arguments);if(1==v.getSelectionCount()){p=v.getSelectionCell();var G=v.getOutgoingTreeEdges(p);d.addSeparator();0<G.length&&(g(v.getSelectionCell())&&
this.addMenuItems(d,["selectChildren"],null,A),this.addMenuItems(d,["selectDescendants"],null,A));g(v.getSelectionCell())?(d.addSeparator(),0<v.getIncomingTreeEdges(p).length&&this.addMenuItems(d,["selectSiblings","selectParent"],null,A)):0<v.model.getEdgeCount(p)&&this.addMenuItems(d,["selectConnections"],null,A)}};t.actions.addAction("selectChildren",function(d){if(v.isEnabled()&&1==v.getSelectionCount()){var p=v.getSelectionCell();d=mxEvent.isControlDown(d)?null:v.getOutgoingTreeEdges(p);if(null!=
-d&&0<d.length){p=[];for(var A=0;A<d.length;A++)p.push(v.model.getTerminal(d[A],!1));v.setSelectionCells(p)}else v.setSelectionCells(v.model.getChildren(p))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");t.actions.addAction("selectDescendants",function(d){var p=v.getSelectionCell();if(v.isEnabled()&&null!=p){var A=[];mxEvent.isControlDown(d)||v.traverse(p,!0,function(G,I){var L=null!=I&&v.isTreeEdge(I);L&&mxEvent.isControlDown(d)&&A.push(I);(null==I||L)&&A.push(G);return null==I||L});if(0==A.length||
+d&&0<d.length){p=[];for(var A=0;A<d.length;A++)p.push(v.model.getTerminal(d[A],!1));v.setSelectionCells(p)}else v.setSelectionCells(v.model.getChildren(p))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");t.actions.addAction("selectDescendants",function(d){var p=v.getSelectionCell();if(v.isEnabled()&&null!=p){var A=[];mxEvent.isControlDown(d)||v.traverse(p,!0,function(G,J){var L=null!=J&&v.isTreeEdge(J);L&&mxEvent.isControlDown(d)&&A.push(J);(null==J||L)&&A.push(G);return null==J||L});if(0==A.length||
1==A.length&&A[0]==p)A=v.model.getDescendants(p);v.setSelectionCells(A)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");t.actions.addAction("selectParent",function(d){var p=v.getSelectionCell();v.isEnabled()&&null!=p&&(d=mxEvent.isControlDown(d)?null:v.getIncomingTreeEdges(p),null!=d&&0<d.length?v.setSelectionCell(v.model.getTerminal(d[0],!0)):v.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");t.actions.addAction("selectSiblings",function(d){if(v.isEnabled()&&1==v.getSelectionCount()){var p=
v.getSelectionCell(),A=mxEvent.isControlDown(d)?null:v.getIncomingTreeEdges(p);d=[];if(null!=A&&0<A.length&&(A=v.getOutgoingTreeEdges(v.model.getTerminal(A[0],!0)),null!=A))for(var G=0;G<A.length;G++)d.push(v.model.getTerminal(A[G],!1));0==d.length&&(d=v.model.getChildren(v.model.getParent(p)));v.setSelectionCells(d)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var K=v.removeCells;v.removeCells=function(d,p){p=null!=p?p:!0;null==d&&(d=this.getDeletableCells(this.getSelectionCells()));p&&(d=
-this.getDeletableCells(this.addAllEdges(d)));var A=F(d,null);var G=A;for(var I=new mxDictionary,L=null,P=0;P<G.cascaded.length;P++){var Q=x(G.cascaded[P]);if(null!=Q&&!I.get(Q)){I.put(Q,!0);a:{var ba=G;for(var X=[Q];0<X.length;)for(var Y=X.pop(),W=0;W<B.getChildCount(Y);W++){var ca=B.getChildAt(Y,W);if(B.isVertex(ca)&&!ba.deleted.get(ca))for(var S=0;S<B.getEdgeCount(ca);S++)if(!ba.cut.get(B.getEdgeAt(ca,S))){ba=!0;break a}X.push(ca)}ba=!1}ba||(L=null!=L?L:new mxDictionary,L.put(Q,!0))}}G=L;null!=
-G&&(A=F(d,G));d=A.cells;return K.apply(this,arguments)};t.hoverIcons.getStateAt=function(d,p,A){return g(d.cell)?null:this.graph.view.getState(this.graph.getCellAt(p,A))};var C=v.duplicateCells;v.duplicateCells=function(d,p){d=null!=d?d:this.getSelectionCells();for(var A=d.slice(0),G=0;G<A.length;G++){var I=v.view.getState(A[G]);if(null!=I&&g(I.cell)){var L=v.getIncomingTreeEdges(I.cell);for(I=0;I<L.length;I++)mxUtils.remove(L[I],d)}}this.model.beginUpdate();try{var P=C.call(this,d,p);if(P.length==
-d.length)for(G=0;G<d.length;G++)if(g(d[G])){var Q=v.getIncomingTreeEdges(P[G]);L=v.getIncomingTreeEdges(d[G]);if(0==Q.length&&0<L.length){var ba=this.cloneCell(L[0]);this.addEdge(ba,v.getDefaultParent(),this.model.getTerminal(L[0],!0),P[G])}}}finally{this.model.endUpdate()}return P};var R=v.moveCells;v.moveCells=function(d,p,A,G,I,L,P){for(var Q=null,ba=[],X=0;X<d.length;X++)(q(d[X])||g(d[X]))&&!z(d[X])&&this.isCellCollapsed(d[X])?ba=ba.concat(this.getSubtree(d[X])):ba.push(d[X]);d=mxUtils.removeDuplicates(ba);
-this.model.beginUpdate();try{ba=I;var Y=this.getCurrentCellStyle(I);if(null!=d&&g(I)&&"1"==mxUtils.getValue(Y,"treeFolding","0")){for(X=0;X<d.length;X++)if(g(d[X])||v.model.isEdge(d[X])&&null==v.model.getTerminal(d[X],!0)){I=v.model.getParent(d[X]);break}if(null!=ba&&I!=ba&&null!=this.view.getState(d[0])){var W=v.getIncomingTreeEdges(d[0]);if(0<W.length){var ca=v.view.getState(v.model.getTerminal(W[0],!0));if(null!=ca){var S=v.view.getState(ba);null!=S&&(p=(S.getCenterX()-ca.getCenterX())/v.view.scale,
-A=(S.getCenterY()-ca.getCenterY())/v.view.scale)}}}}Q=R.apply(this,arguments);if(null!=Q&&null!=d&&Q.length==d.length)for(X=0;X<Q.length;X++)if(this.model.isEdge(Q[X]))g(ba)&&0>mxUtils.indexOf(Q,this.model.getTerminal(Q[X],!0))&&this.model.setTerminal(Q[X],ba,!0);else if(g(d[X])&&(W=v.getIncomingTreeEdges(d[X]),0<W.length))if(!G)g(ba)&&0>mxUtils.indexOf(d,this.model.getTerminal(W[0],!0))&&this.model.setTerminal(W[0],ba,!0);else if(0==v.getIncomingTreeEdges(Q[X]).length){Y=ba;if(null==Y||Y==v.model.getParent(d[X]))Y=
-v.model.getTerminal(W[0],!0);G=this.cloneCell(W[0]);this.addEdge(G,v.getDefaultParent(),Y,Q[X])}}finally{this.model.endUpdate()}return Q};if(null!=t.sidebar){var M=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(d,p,A,G){var I=v.model,L=null;I.beginUpdate();try{if(L=M.apply(this,arguments),g(d))for(var P=0;P<L.length;P++)if(I.isEdge(L[P])&&null==I.getTerminal(L[P],!0)){I.setTerminal(L[P],d,!0);var Q=v.getCellGeometry(L[P]);Q.points=null;null!=Q.getTerminalPoint(!0)&&Q.setTerminalPoint(null,
-!0)}}finally{I.endUpdate()}return L}}var O={67:t.actions.get("selectChildren"),88:t.actions.get("selectDescendants"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},U={67:t.actions.get("copyStyle"),86:t.actions.get("pasteStyle")},T=t.onKeyDown;t.onKeyDown=function(d){try{var p=v.getSelectionCell();if(v.isEnabled()&&!v.isEditing()&&null!=p){var A=mxEvent.isAltDown(d)&&mxEvent.isShiftDown(d)?O[d.keyCode]:mxEvent.isAltDown(d)?U[d.keyCode]:null;null!=A?(A.funct(d),mxEvent.consume(d)):
+this.getDeletableCells(this.addAllEdges(d)));var A=F(d,null);var G=A;for(var J=new mxDictionary,L=null,P=0;P<G.cascaded.length;P++){var Q=x(G.cascaded[P]);if(null!=Q&&!J.get(Q)){J.put(Q,!0);a:{var ba=G;for(var W=[Q];0<W.length;)for(var Y=W.pop(),X=0;X<B.getChildCount(Y);X++){var ca=B.getChildAt(Y,X);if(B.isVertex(ca)&&!ba.deleted.get(ca))for(var S=0;S<B.getEdgeCount(ca);S++)if(!ba.cut.get(B.getEdgeAt(ca,S))){ba=!0;break a}W.push(ca)}ba=!1}ba||(L=null!=L?L:new mxDictionary,L.put(Q,!0))}}G=L;null!=
+G&&(A=F(d,G));d=A.cells;return K.apply(this,arguments)};t.hoverIcons.getStateAt=function(d,p,A){return g(d.cell)?null:this.graph.view.getState(this.graph.getCellAt(p,A))};var C=v.duplicateCells;v.duplicateCells=function(d,p){d=null!=d?d:this.getSelectionCells();for(var A=d.slice(0),G=0;G<A.length;G++){var J=v.view.getState(A[G]);if(null!=J&&g(J.cell)){var L=v.getIncomingTreeEdges(J.cell);for(J=0;J<L.length;J++)mxUtils.remove(L[J],d)}}this.model.beginUpdate();try{var P=C.call(this,d,p);if(P.length==
+d.length)for(G=0;G<d.length;G++)if(g(d[G])){var Q=v.getIncomingTreeEdges(P[G]);L=v.getIncomingTreeEdges(d[G]);if(0==Q.length&&0<L.length){var ba=this.cloneCell(L[0]);this.addEdge(ba,v.getDefaultParent(),this.model.getTerminal(L[0],!0),P[G])}}}finally{this.model.endUpdate()}return P};var R=v.moveCells;v.moveCells=function(d,p,A,G,J,L,P){for(var Q=null,ba=[],W=0;W<d.length;W++)(q(d[W])||g(d[W]))&&!z(d[W])&&this.isCellCollapsed(d[W])?ba=ba.concat(this.getSubtree(d[W])):ba.push(d[W]);d=mxUtils.removeDuplicates(ba);
+this.model.beginUpdate();try{ba=J;var Y=this.getCurrentCellStyle(J);if(null!=d&&g(J)&&"1"==mxUtils.getValue(Y,"treeFolding","0")){for(W=0;W<d.length;W++)if(g(d[W])||v.model.isEdge(d[W])&&null==v.model.getTerminal(d[W],!0)){J=v.model.getParent(d[W]);break}if(null!=ba&&J!=ba&&null!=this.view.getState(d[0])){var X=v.getIncomingTreeEdges(d[0]);if(0<X.length){var ca=v.view.getState(v.model.getTerminal(X[0],!0));if(null!=ca){var S=v.view.getState(ba);null!=S&&(p=(S.getCenterX()-ca.getCenterX())/v.view.scale,
+A=(S.getCenterY()-ca.getCenterY())/v.view.scale)}}}}Q=R.apply(this,arguments);if(null!=Q&&null!=d&&Q.length==d.length)for(W=0;W<Q.length;W++)if(this.model.isEdge(Q[W]))g(ba)&&0>mxUtils.indexOf(Q,this.model.getTerminal(Q[W],!0))&&this.model.setTerminal(Q[W],ba,!0);else if(g(d[W])&&(X=v.getIncomingTreeEdges(d[W]),0<X.length))if(!G)g(ba)&&0>mxUtils.indexOf(d,this.model.getTerminal(X[0],!0))&&this.model.setTerminal(X[0],ba,!0);else if(0==v.getIncomingTreeEdges(Q[W]).length){Y=ba;if(null==Y||Y==v.model.getParent(d[W]))Y=
+v.model.getTerminal(X[0],!0);G=this.cloneCell(X[0]);this.addEdge(G,v.getDefaultParent(),Y,Q[W])}}finally{this.model.endUpdate()}return Q};if(null!=t.sidebar){var M=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(d,p,A,G){var J=v.model,L=null;J.beginUpdate();try{if(L=M.apply(this,arguments),g(d))for(var P=0;P<L.length;P++)if(J.isEdge(L[P])&&null==J.getTerminal(L[P],!0)){J.setTerminal(L[P],d,!0);var Q=v.getCellGeometry(L[P]);Q.points=null;null!=Q.getTerminalPoint(!0)&&Q.setTerminalPoint(null,
+!0)}}finally{J.endUpdate()}return L}}var O={67:t.actions.get("selectChildren"),88:t.actions.get("selectDescendants"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},U={67:t.actions.get("copyStyle"),86:t.actions.get("pasteStyle")},T=t.onKeyDown;t.onKeyDown=function(d){try{var p=v.getSelectionCell();if(v.isEnabled()&&!v.isEditing()&&null!=p){var A=mxEvent.isAltDown(d)&&mxEvent.isShiftDown(d)?O[d.keyCode]:mxEvent.isAltDown(d)?U[d.keyCode]:null;null!=A?(A.funct(d),mxEvent.consume(d)):
g(p)&&(A=null,0<v.getIncomingTreeEdges(p).length&&(9==d.which?A=mxEvent.isShiftDown(d)?c(p):f(p):13==d.which&&(A=D(p,!mxEvent.isShiftDown(d)))),null!=A&&0<A.length?(1==A.length&&v.model.isEdge(A[0])?v.setSelectionCell(v.model.getTerminal(A[0],!1)):v.setSelectionCell(A[A.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(v.view.getState(p)),v.startEditingAtCell(p),mxEvent.consume(d)):37==d.keyCode?(n(p,mxConstants.DIRECTION_WEST),mxEvent.consume(d)):38==d.keyCode?(n(p,mxConstants.DIRECTION_NORTH),
-mxEvent.consume(d)):39==d.keyCode?(n(p,mxConstants.DIRECTION_EAST),mxEvent.consume(d)):40==d.keyCode&&(n(p,mxConstants.DIRECTION_SOUTH),mxEvent.consume(d)))}}catch(G){t.handleError(G)}mxEvent.isConsumed(d)||T.apply(this,arguments)};var V=v.connectVertex;v.connectVertex=function(d,p,A,G,I,L,P,Q,ba){var X=v.getIncomingTreeEdges(d);if(g(d)){var Y=J(d),W=Y==mxConstants.DIRECTION_EAST||Y==mxConstants.DIRECTION_WEST,ca=p==mxConstants.DIRECTION_EAST||p==mxConstants.DIRECTION_WEST;X=Y==p||0==X.length?f(d,
-p,ba):W==ca?c(d,ba):D(d,p!=mxConstants.DIRECTION_NORTH&&p!=mxConstants.DIRECTION_WEST,ba);if(null!=Q)Q(X);else return X}else return V.apply(this,arguments)};v.getSubtree=function(d){var p=[d];!q(d)&&!g(d)||z(d)||v.traverse(d,!0,function(A,G){var I=null!=G&&v.isTreeEdge(G);I&&0>mxUtils.indexOf(p,G)&&p.push(G);(null==G||I)&&0>mxUtils.indexOf(p,A)&&p.push(A);return null==G||I});return p};var fa=v.isMoveIconVisible;v.isMoveIconVisible=function(d){return fa.apply(this,arguments)||r(d)};var y=v.getMoveIconDragCells;
-v.getMoveIconDragCells=function(d){return r(d)?this.getSubtree(d):y.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var g=m.apply(this,arguments),q=this.graph,u=this;return g.concat([this.addEntry("tree container",function(){var x=new mxCell("Tree Container",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");x.vertex=!0;var z=new mxCell("Parent",
-new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');z.vertex=!0;var F=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');F.vertex=!0;var J=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");
-J.geometry.relative=!0;J.edge=!0;z.insertEdge(J,!0);F.insertEdge(J,!1);x.insert(J);x.insert(z);x.insert(F);return u.createVertexTemplateFromCells([x],160,180,x.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var x=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");x.vertex=!0;var z=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
-z.vertex=!0;var F=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');F.vertex=!0;var J=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");
-J.geometry.relative=!0;J.edge=!0;z.insertEdge(J,!0);F.insertEdge(J,!1);var H=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
-H.vertex=!0;var D=new mxCell("",new mxGeometry(0,0,0,0),J.style);D.geometry.relative=!0;D.edge=!0;z.insertEdge(D,!0);H.insertEdge(D,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
-c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),J.style);f.geometry.relative=!0;f.edge=!0;z.insertEdge(f,!0);c.insertEdge(f,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
-l.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),J.style);n.geometry.relative=!0;n.edge=!0;z.insertEdge(n,!0);l.insertEdge(n,!1);x.insert(J);x.insert(D);x.insert(f);x.insert(n);x.insert(z);x.insert(F);x.insert(H);x.insert(c);x.insert(l);return u.createVertexTemplateFromCells([x],420,126,x.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var x=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');
+mxEvent.consume(d)):39==d.keyCode?(n(p,mxConstants.DIRECTION_EAST),mxEvent.consume(d)):40==d.keyCode&&(n(p,mxConstants.DIRECTION_SOUTH),mxEvent.consume(d)))}}catch(G){t.handleError(G)}mxEvent.isConsumed(d)||T.apply(this,arguments)};var V=v.connectVertex;v.connectVertex=function(d,p,A,G,J,L,P,Q,ba){var W=v.getIncomingTreeEdges(d);if(g(d)){var Y=I(d),X=Y==mxConstants.DIRECTION_EAST||Y==mxConstants.DIRECTION_WEST,ca=p==mxConstants.DIRECTION_EAST||p==mxConstants.DIRECTION_WEST;if(!(W=Y==p||0==W.length))a:{Y=
+B.getParent(d);if(null!=Y){Y=v.getCurrentCellStyle(Y);Y=null!=Y?Y.childLayout:null;if("flowLayout"==Y){W=!0;break a}try{var S=Graph.decodeChildLayout(Y);W=null!=S&&0<S.length&&null!=S[0]&&"elkLayered"==S[0].layout;break a}catch(Z){}}W=!1}X=W?f(d,p,ba):X==ca?c(d,ba):D(d,p!=mxConstants.DIRECTION_NORTH&&p!=mxConstants.DIRECTION_WEST,ba);if(null!=Q)Q(X);else return X}else return V.apply(this,arguments)};v.getSubtree=function(d){var p=[d];!q(d)&&!g(d)||z(d)||v.traverse(d,!0,function(A,G){var J=null!=G&&
+v.isTreeEdge(G);J&&0>mxUtils.indexOf(p,G)&&p.push(G);(null==G||J)&&0>mxUtils.indexOf(p,A)&&p.push(A);return null==G||J});return p};var fa=v.isMoveIconVisible;v.isMoveIconVisible=function(d){return fa.apply(this,arguments)||r(d)};var y=v.getMoveIconDragCells;v.getMoveIconDragCells=function(d){return r(d)?this.getSubtree(d):y.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var g=m.apply(this,arguments),
+q=this.graph,u=this;return g.concat([this.addEntry("tree container",function(){var x=new mxCell("Tree Container",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");x.vertex=!0;var z=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');z.vertex=!0;var F=new mxCell("Child",new mxGeometry(140,140,120,40),
+'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');F.vertex=!0;var I=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");I.geometry.relative=!0;I.edge=!0;z.insertEdge(I,!0);F.insertEdge(I,!1);x.insert(I);x.insert(z);x.insert(F);return u.createVertexTemplateFromCells([x],160,180,x.value)}),
+this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var x=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");x.vertex=!0;var z=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
+z.vertex=!0;var F=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');F.vertex=!0;var I=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");
+I.geometry.relative=!0;I.edge=!0;z.insertEdge(I,!0);F.insertEdge(I,!1);var H=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
+H.vertex=!0;var D=new mxCell("",new mxGeometry(0,0,0,0),I.style);D.geometry.relative=!0;D.edge=!0;z.insertEdge(D,!0);H.insertEdge(D,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
+c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),I.style);f.geometry.relative=!0;f.edge=!0;z.insertEdge(f,!0);c.insertEdge(f,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
+l.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),I.style);n.geometry.relative=!0;n.edge=!0;z.insertEdge(n,!0);l.insertEdge(n,!1);x.insert(I);x.insert(D);x.insert(f);x.insert(n);x.insert(z);x.insert(F);x.insert(H);x.insert(c);x.insert(l);return u.createVertexTemplateFromCells([x],420,126,x.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var x=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');
x.vertex=!0;return u.createVertexTemplateFromCells([x],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var x=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
x.vertex=!0;var z=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");z.geometry.setTerminalPoint(new mxPoint(-40,40),!0);z.geometry.relative=!0;z.edge=!0;x.insertEdge(z,!1);return u.createVertexTemplateFromCells([x,z],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var x=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),
'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');x.vertex=!0;var z=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");
z.geometry.setTerminalPoint(new mxPoint(-40,40),!0);z.geometry.relative=!0;z.edge=!0;x.insertEdge(z,!1);return u.createVertexTemplateFromCells([x,z],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree orgchart organization division",function(){var x=new mxCell("Orgchart",new mxGeometry(0,0,0,0),'swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');x.vertex=!0;var z=
-new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');q.setAttributeForCell(z,"treeRoot","1");z.vertex=!0;var F=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');F.vertex=!0;var J=
-new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");J.geometry.relative=!0;J.edge=!0;z.insertEdge(J,!0);F.insertEdge(J,!1);var H=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');H.vertex=!0;var D=new mxCell("",
-new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");D.geometry.relative=!0;D.edge=!0;z.insertEdge(D,!0);H.insertEdge(D,!1);x.insert(J);x.insert(D);x.insert(z);x.insert(F);x.insert(H);return u.createVertexTemplateFromCells([x],280,220,x.value)}),this.addEntry("tree root",function(){var x=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
+new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');q.setAttributeForCell(z,"treeRoot","1");z.vertex=!0;var F=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');F.vertex=!0;var I=
+new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");I.geometry.relative=!0;I.edge=!0;z.insertEdge(I,!0);F.insertEdge(I,!1);var H=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');H.vertex=!0;var D=new mxCell("",
+new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");D.geometry.relative=!0;D.edge=!0;z.insertEdge(D,!0);H.insertEdge(D,!1);x.insert(I);x.insert(D);x.insert(z);x.insert(F);x.insert(H);return u.createVertexTemplateFromCells([x],280,220,x.value)}),this.addEntry("tree root",function(){var x=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
q.setAttributeForCell(x,"treeRoot","1");x.vertex=!0;return u.createVertexTemplateFromCells([x],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree division",function(){var x=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');x.vertex=!0;var z=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");
z.geometry.setTerminalPoint(new mxPoint(0,0),!0);z.geometry.relative=!0;z.edge=!0;x.insertEdge(z,!1);return u.createVertexTemplateFromCells([x,z],x.geometry.width,x.geometry.height,x.value)}),this.addEntry("tree sub sections",function(){var x=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");x.vertex=!0;var z=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");
-z.geometry.setTerminalPoint(new mxPoint(110,-40),!0);z.geometry.relative=!0;z.edge=!0;x.insertEdge(z,!1);var F=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");F.vertex=!0;var J=new mxCell("",new mxGeometry(0,0,0,0),z.style);J.geometry.setTerminalPoint(new mxPoint(110,-40),!0);J.geometry.relative=!0;J.edge=!0;F.insertEdge(J,!1);return u.createVertexTemplateFromCells([z,J,x,F],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;
-EditorUi.initMinimalTheme=function(){function b(J,H){if(EditorUi.windowed){var D=J.editor.graph;D.popupMenuHandler.hideMenu();null==J.formatWindow?(J.formatWindow=new WrapperWindow(J,"",Math.max(10,J.diagramContainer.clientWidth-248),60,240,Math.min(600,D.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";J.createFormat(c).init()}),J.dependsOnLanguage(mxUtils.bind(this,function(){J.formatWindow.window.setTitle(mxResources.get("format"))})),J.formatWindow.window.addListener(mxEvent.SHOW,
-mxUtils.bind(this,function(){J.formatWindow.window.fit()})),J.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):J.formatWindow.window.setVisible(null!=H?H:!J.formatWindow.window.isVisible())}else null==J.formatElt&&(J.formatElt=J.createSidebarContainer(),J.createFormat(J.formatElt).init(),J.formatElt.style.border="none",J.formatElt.style.width="240px",J.formatElt.style.borderLeftWidth="1px",J.formatElt.style.borderLeftStyle="solid",J.formatElt.style.right="0px"),H=J.diagramContainer.parentNode,
-null!=J.formatElt.parentNode?(J.formatElt.parentNode.removeChild(J.formatElt),H.style.right="0px"):(H.parentNode.appendChild(J.formatElt),H.style.right=J.formatElt.style.width)}function k(J,H){if(EditorUi.windowed){var D=J.editor.graph;D.popupMenuHandler.hideMenu();null==J.sidebarWindow?(J.sidebarWindow=new WrapperWindow(J,"",10,56,Math.min(D.container.clientWidth-10,218)-6,Math.min(D.container.clientHeight-40,650)-6,function(c){J.createShapesPanel(c)}),J.dependsOnLanguage(mxUtils.bind(this,function(){J.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),
-J.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){J.sidebarWindow.window.fit()})),J.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),J.sidebarWindow.window.setVisible(!0),isLocalStorage&&J.getLocalData("sidebar",function(c){J.sidebar.showEntries(c,null,!0)}),J.restoreLibraries()):J.sidebarWindow.window.setVisible(null!=H?H:!J.sidebarWindow.window.isVisible())}else null==J.sidebarElt&&(J.sidebarElt=J.createSidebarContainer(),J.createShapesPanel(J.sidebarElt),J.sidebarElt.style.border=
-"none",J.sidebarElt.style.width="210px",J.sidebarElt.style.borderRight="1px solid gray"),H=J.diagramContainer.parentNode,null!=J.sidebarElt.parentNode?(J.sidebarElt.parentNode.removeChild(J.sidebarElt),H.style.left="0px"):(H.parentNode.appendChild(J.sidebarElt),H.style.left=J.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||
-document.body.clientWidth}catch(J){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR=
+z.geometry.setTerminalPoint(new mxPoint(110,-40),!0);z.geometry.relative=!0;z.edge=!0;x.insertEdge(z,!1);var F=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");F.vertex=!0;var I=new mxCell("",new mxGeometry(0,0,0,0),z.style);I.geometry.setTerminalPoint(new mxPoint(110,-40),!0);I.geometry.relative=!0;I.edge=!0;F.insertEdge(I,!1);return u.createVertexTemplateFromCells([z,I,x,F],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;
+EditorUi.initMinimalTheme=function(){function b(I,H){if(EditorUi.windowed){var D=I.editor.graph;D.popupMenuHandler.hideMenu();null==I.formatWindow?(I.formatWindow=new WrapperWindow(I,"",Math.max(10,I.diagramContainer.clientWidth-248),60,240,Math.min(600,D.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";I.createFormat(c).init()}),I.dependsOnLanguage(mxUtils.bind(this,function(){I.formatWindow.window.setTitle(mxResources.get("format"))})),I.formatWindow.window.addListener(mxEvent.SHOW,
+mxUtils.bind(this,function(){I.formatWindow.window.fit()})),I.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):I.formatWindow.window.setVisible(null!=H?H:!I.formatWindow.window.isVisible())}else null==I.formatElt&&(I.formatElt=I.createSidebarContainer(),I.createFormat(I.formatElt).init(),I.formatElt.style.border="none",I.formatElt.style.width="240px",I.formatElt.style.borderLeftWidth="1px",I.formatElt.style.borderLeftStyle="solid",I.formatElt.style.right="0px"),H=I.diagramContainer.parentNode,
+null!=I.formatElt.parentNode?(I.formatElt.parentNode.removeChild(I.formatElt),H.style.right="0px"):(H.parentNode.appendChild(I.formatElt),H.style.right=I.formatElt.style.width)}function k(I,H){if(EditorUi.windowed){var D=I.editor.graph;D.popupMenuHandler.hideMenu();null==I.sidebarWindow?(I.sidebarWindow=new WrapperWindow(I,"",10,56,Math.min(D.container.clientWidth-10,218)-6,Math.min(D.container.clientHeight-40,650)-6,function(c){I.createShapesPanel(c)}),I.dependsOnLanguage(mxUtils.bind(this,function(){I.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),
+I.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){I.sidebarWindow.window.fit()})),I.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),I.sidebarWindow.window.setVisible(!0),isLocalStorage&&I.getLocalData("sidebar",function(c){I.sidebar.showEntries(c,null,!0)}),I.restoreLibraries()):I.sidebarWindow.window.setVisible(null!=H?H:!I.sidebarWindow.window.isVisible())}else null==I.sidebarElt&&(I.sidebarElt=I.createSidebarContainer(),I.createShapesPanel(I.sidebarElt),I.sidebarElt.style.border=
+"none",I.sidebarElt.style.width="210px",I.sidebarElt.style.borderRight="1px solid gray"),H=I.diagramContainer.parentNode,null!=I.sidebarElt.parentNode?(I.sidebarElt.parentNode.removeChild(I.sidebarElt),H.style.left="0px"):(H.parentNode.appendChild(I.sidebarElt),H.style.left=I.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||
+document.body.clientWidth}catch(I){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR=
"#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=
-function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var q=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(J,H){null!=H.shortcut&&900>m&&!mxClient.IS_IOS?J.firstChild.nextSibling.setAttribute("title",H.shortcut):q.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=
-function(J){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=J?J:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var u=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();u.apply(this,arguments)};var x=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(J){x.apply(this,
-arguments);if(J){var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=H&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=H&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=
-function(J){var H=this.editor.graph,D=document.createElement("div");D.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";H.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<H.getSelectionCount()?(J.appendChild(D),D.innerHTML="Selected: "+H.getSelectionCount()):null!=D.parentNode&&D.parentNode.removeChild(D)}))};var z=!1;EditorUi.prototype.initFormatWindow=
-function(){if(!z&&null!=this.formatWindow){z=!0;var J=this.formatWindow.window.toggleMinimized,H=240;this.formatWindow.window.toggleMinimized=function(){J.apply(this,arguments);this.minimized?(H=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+H-140+"px"):(this.div.style.width=H+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-H+140)+"px");this.fit()};
-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var F=EditorUi.prototype.init;EditorUi.prototype.init=function(){function J(p,A,G){var I=l.menus.get(p);A=t.addMenu(mxResources.get(p),mxUtils.bind(this,function(){I.funct.apply(this,arguments)}));A.className="geButton";A.setAttribute("title",mxResources.get(p));l.menus.menuCreated(I,A,"geButton");null!=G&&
-(A.style.backgroundImage="url("+G+")",A.innerText="");return A}function H(p,A,G,I,L,P){var Q=document.createElement("a");Q.className="geButton";r.appendChild(Q);null!=P?Q.style.backgroundImage="url("+P+")":mxUtils.write(Q,p);mxEvent.addListener(Q,"click",function(ba){"disabled"!=Q.getAttribute("disabled")&&A(ba);mxEvent.consume(ba)});mxEvent.preventDefault(Q);null!=I&&Q.setAttribute("title",I);null!=L&&(p=function(){L.isEnabled()?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled")},
-L.addListener("stateChanged",p),n.addListener("enabledChanged",p),p());return Q}function D(p,A,G){A=document.createElement("div");A.className="geButtonGroup";for(G=0;G<p.length;G++)null!=p[G]&&A.appendChild(p[G]);r.appendChild(A);return A}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var p=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(p=l.buttonContainer.offsetWidth||300);r.innerHTML="";var A=m<1E3+p,G=J("diagram",null,A?Editor.menuImage:null);
-D([G,H(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),A?Editor.shapesImage:null),H(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),A?Editor.formatImage:null)]);G=J("insert",!0,A?C:null);D([G,H(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),A?Editor.trashImage:null)]);
+function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var q=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(I,H){null!=H.shortcut&&900>m&&!mxClient.IS_IOS?I.firstChild.nextSibling.setAttribute("title",H.shortcut):q.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=
+function(I){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=I?I:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var u=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();u.apply(this,arguments)};var x=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(I){x.apply(this,
+arguments);if(I){var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=H&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=H&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=
+function(I){var H=this.editor.graph,D=document.createElement("div");D.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";H.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<H.getSelectionCount()?(I.appendChild(D),D.innerHTML="Selected: "+H.getSelectionCount()):null!=D.parentNode&&D.parentNode.removeChild(D)}))};var z=!1;EditorUi.prototype.initFormatWindow=
+function(){if(!z&&null!=this.formatWindow){z=!0;var I=this.formatWindow.window.toggleMinimized,H=240;this.formatWindow.window.toggleMinimized=function(){I.apply(this,arguments);this.minimized?(H=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+H-140+"px"):(this.div.style.width=H+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-H+140)+"px");this.fit()};
+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var F=EditorUi.prototype.init;EditorUi.prototype.init=function(){function I(p,A,G){var J=l.menus.get(p);A=t.addMenu(mxResources.get(p),mxUtils.bind(this,function(){J.funct.apply(this,arguments)}));A.className="geButton";A.setAttribute("title",mxResources.get(p));l.menus.menuCreated(J,A,"geButton");null!=G&&
+(A.style.backgroundImage="url("+G+")",A.innerText="");return A}function H(p,A,G,J,L,P){var Q=document.createElement("a");Q.className="geButton";r.appendChild(Q);null!=P?Q.style.backgroundImage="url("+P+")":mxUtils.write(Q,p);mxEvent.addListener(Q,"click",function(ba){"disabled"!=Q.getAttribute("disabled")&&A(ba);mxEvent.consume(ba)});mxEvent.preventDefault(Q);null!=J&&Q.setAttribute("title",J);null!=L&&(p=function(){L.isEnabled()?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled")},
+L.addListener("stateChanged",p),n.addListener("enabledChanged",p),p());return Q}function D(p,A,G){A=document.createElement("div");A.className="geButtonGroup";for(G=0;G<p.length;G++)null!=p[G]&&A.appendChild(p[G]);r.appendChild(A);return A}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var p=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(p=l.buttonContainer.offsetWidth||300);r.innerHTML="";var A=m<1E3+p,G=I("diagram",null,A?Editor.menuImage:null);
+D([G,H(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),A?Editor.shapesImage:null),H(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),A?Editor.formatImage:null)]);G=I("insert",!0,A?C:null);D([G,H(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),A?Editor.trashImage:null)]);
n.isEnabled()||G.setAttribute("disabled","disabled");fa.setAttribute("title",mxResources.get("undo")+" ("+T.shortcut+")");y.setAttribute("title",mxResources.get("redo")+" ("+V.shortcut+")");d.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+p&&(D([fa,y]),m>=520+p&&D([d,m>=640+p?H("",O.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",O,Editor.zoomInImage):null,m>=640+p?H("",U.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",U,Editor.zoomOutImage):
null]));r.appendChild(l.statusContainer);r.appendChild(l.buttonContainer)}F.apply(this,arguments);var f=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=f&&(f.classList.add("geSimple"),f.classList.add("geMinimal"),f.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(k(this,!0),null!=this.sidebar&&null!=
urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var l=this,n=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));var r=document.createElement("div");r.className="geMenubarContainer";var t=new Menubar(l,r),v=l.hideCurrentMenu;l.hideCurrentMenu=function(){v.apply(this,arguments);
@@ -16076,35 +16087,35 @@ n.freehand.createStyle=function(p){return M.apply(this,arguments)+"sketch=0;"}}l
l.actions.get("customZoom").funct()):(l.hideCurrentMenu(),l.actions.get("smartFit").funct());mxEvent.consume(p)},!0,"",f,Editor.zoomFitImage);l.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){k(l,null)});l.container.appendChild(l.tabContainer);l.container.appendChild(r);l.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=m&&b(this,!0);c();l.addListener("lockedChanged",c);l.addListener("languageChanged",c);l.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,
"resize",function(){c();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.chatWindow&&l.menus.chatWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit();null!=l.menus.findReplaceWindow&&l.menus.findReplaceWindow.window.fit()})}}};
(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var k=EditorUi.initTheme;EditorUi.initTheme=function(){k.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();function mxRuler(b,k,m,g){function q(){var B=b.getDiagramContainerOffset(),E=b.diagramContainer;D.style.top=E.offsetTop-B.y+"px";D.style.left=E.offsetLeft-B.x+"px";D.style.width=(m?0:E.offsetWidth-1)+F+"px";D.style.height=(m?E.offsetHeight:0)+F+"px"}function u(B,E,K){if(null!=x)return B;var C;return function(){var R=this,M=arguments,O=K&&!C;clearTimeout(C);C=setTimeout(function(){C=null;K||B.apply(R,M)},E);O&&B.apply(R,M)}}var x=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||
-window.msRequestAnimationFrame,z=window.cancelAnimationFrame||window.mozCancelAnimationFrame,F=this.RULER_THICKNESS,J=this;this.unit=k;var H=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},D=document.createElement("div");D.className="geRuler";D.style.position="fixed";this.updateStyle=mxUtils.bind(this,
-function(){H=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};D.style[m?"borderRight":"borderBottom"]="0.5px solid "+H.strokeClr;D.style.borderLeft="0.5px solid "+H.strokeClr});this.updateStyle();b.diagramContainer.appendChild(D);mxEvent.disableContextMenu(D);this.editorUiRefresh=b.refresh;b.refresh=function(B){J.editorUiRefresh.apply(b,
+window.msRequestAnimationFrame,z=window.cancelAnimationFrame||window.mozCancelAnimationFrame,F=this.RULER_THICKNESS,I=this;this.unit=k;var H=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},D=document.createElement("div");D.className="geRuler";D.style.position="fixed";this.updateStyle=mxUtils.bind(this,
+function(){H=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};D.style[m?"borderRight":"borderBottom"]="0.5px solid "+H.strokeClr;D.style.borderLeft="0.5px solid "+H.strokeClr});this.updateStyle();b.diagramContainer.appendChild(D);mxEvent.disableContextMenu(D);this.editorUiRefresh=b.refresh;b.refresh=function(B){I.editorUiRefresh.apply(b,
arguments);q()};q();var c=document.createElement("canvas");c.width=D.offsetWidth;c.height=D.offsetHeight;D.style.overflow="hidden";c.style.position="relative";D.appendChild(c);var f=c.getContext("2d");this.ui=b;var l=b.editor.graph;this.graph=l;this.container=D;this.canvas=c;var n=function(B,E,K,C,R){B=Math.round(B);E=Math.round(E);K=Math.round(K);C=Math.round(C);f.beginPath();f.moveTo(B+.5,E+.5);f.lineTo(K+.5,C+.5);f.stroke();R&&(m?(f.save(),f.translate(B,E),f.rotate(-Math.PI/2),f.fillText(R,0,0),
-f.restore()):f.fillText(R,B,E))},r=function(){f.clearRect(0,0,c.width,c.height);f.beginPath();f.lineWidth=.7;f.strokeStyle=H.strokeClr;f.setLineDash([]);f.font="9px Arial";f.textAlign="center";var B=l.view.scale,E=l.view.getBackgroundPageBounds(),K=l.view.translate,C=l.pageVisible;K=C?F+(m?E.y-l.container.scrollTop:E.x-l.container.scrollLeft):F+(m?K.y*B-l.container.scrollTop:K.x*B-l.container.scrollLeft);var R=0;C&&(R=l.getPageLayout(),R=m?R.y*l.pageFormat.height:R.x*l.pageFormat.width);var M;switch(J.unit){case mxConstants.POINTS:var O=
-M=10;var U=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:M=10;O=mxConstants.PIXELS_PER_MM;U=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:M=20;O=mxConstants.PIXELS_PER_MM;U=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:M=.5>=B||4<=B?8:16,O=mxConstants.PIXELS_PER_INCH/M,U=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var T=O;2<=B?T=O/(2*Math.floor(B/2)):.5>=B&&(T=O*Math.floor(1/B/2)*(J.unit==mxConstants.MILLIMETERS?2:1));O=null;E=C?Math.min(K+(m?E.height:E.width),m?
-c.height:c.width):m?c.height:c.width;if(C)if(f.fillStyle=H.outBkgClr,m){var V=K-F;0<V&&f.fillRect(0,F,F,V);E<c.height&&f.fillRect(0,E,F,c.height)}else V=K-F,0<V&&f.fillRect(F,0,V,F),E<c.width&&f.fillRect(E,0,c.width,F);f.fillStyle=H.fontClr;V=T*B;C=C?K:K%V;for(C<F-V&&(C+=Math.floor((F-C)/V)*V);C<=E;C+=V){var fa=Math.round((C-K)/B/T);if(!(C<F||fa==O)){O=fa;var y=null;0==fa%M&&(y=J.formatText(R+fa*T)+"");m?n(F-U[Math.abs(fa)%M],C,F,C,y):n(C,F-U[Math.abs(fa)%M],C,F,y)}}f.lineWidth=1;n(m?0:F,m?F:0,F,
-F);f.fillStyle=H.cornerClr;f.fillRect(0,0,F,F)},t=-1,v=function(){null!=x?(null!=z&&z(t),t=x(r)):r()};this.drawRuler=v;this.sizeListener=k=u(function(){var B=l.container;m?(B=B.offsetHeight+F,c.height!=B&&(c.height=B,D.style.height=B+"px",v())):(B=B.offsetWidth+F,c.width!=B&&(c.width=B,D.style.width=B+"px",v()))},10);this.pageListener=function(){v()};this.scrollListener=g=u(function(){var B=m?l.container.scrollTop:l.container.scrollLeft;J.lastScroll!=B&&(J.lastScroll=B,v())},10);this.unitListener=
-function(B,E){J.setUnit(E.getProperty("unit"))};l.addListener(mxEvent.SIZE,k);l.container.addEventListener("scroll",g);l.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(B){H=B;D.style.background=H.bkgClr;r()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(B,E,K,C){if(m&&4<B.height||!m&&4<B.width){if(null!=
-J.guidePart)try{f.putImageData(J.guidePart.imgData1,J.guidePart.x1,J.guidePart.y1),f.putImageData(J.guidePart.imgData2,J.guidePart.x2,J.guidePart.y2),f.putImageData(J.guidePart.imgData3,J.guidePart.x3,J.guidePart.y3)}catch(A){}var R=J.origGuideMove.apply(this,arguments);try{f.lineWidth=.5;f.strokeStyle=H.guideClr;f.setLineDash([2]);if(m){var M=B.y+R.y+F-this.graph.container.scrollTop;var O=0;var U=M+B.height/2;var T=F/2;var V=M+B.height;var fa=0;var y=f.getImageData(O,M-1,F,3);n(O,M,F,M);M--;var d=
-f.getImageData(T,U-1,F,3);n(T,U,F,U);U--;var p=f.getImageData(fa,V-1,F,3);n(fa,V,F,V);V--}else M=0,O=B.x+R.x+F-this.graph.container.scrollLeft,U=F/2,T=O+B.width/2,V=0,fa=O+B.width,y=f.getImageData(O-1,M,3,F),n(O,M,O,F),O--,d=f.getImageData(T-1,U,3,F),n(T,U,T,F),T--,p=f.getImageData(fa-1,V,3,F),n(fa,V,fa,F),fa--;if(null==J.guidePart||J.guidePart.x1!=O||J.guidePart.y1!=M)J.guidePart={imgData1:y,x1:O,y1:M,imgData2:d,x2:T,y2:U,imgData3:p,x3:fa,y3:V}}catch(A){}}else R=J.origGuideMove.apply(this,arguments);
-return R};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var B=J.origGuideDestroy.apply(this,arguments);if(null!=J.guidePart)try{f.putImageData(J.guidePart.imgData1,J.guidePart.x1,J.guidePart.y1),f.putImageData(J.guidePart.imgData2,J.guidePart.x2,J.guidePart.y2),f.putImageData(J.guidePart.imgData3,J.guidePart.x3,J.guidePart.y3),J.guidePart=null}catch(E){}return B}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;
+f.restore()):f.fillText(R,B,E))},r=function(){f.clearRect(0,0,c.width,c.height);f.beginPath();f.lineWidth=.7;f.strokeStyle=H.strokeClr;f.setLineDash([]);f.font="9px Arial";f.textAlign="center";var B=l.view.scale,E=l.view.getBackgroundPageBounds(),K=l.view.translate,C=l.pageVisible;K=C?F+(m?E.y-l.container.scrollTop:E.x-l.container.scrollLeft):F+(m?K.y*B-l.container.scrollTop:K.x*B-l.container.scrollLeft);var R=0;C&&(R=l.getPageLayout(),R=m?R.y*l.pageFormat.height:R.x*l.pageFormat.width);var M;switch(I.unit){case mxConstants.POINTS:var O=
+M=10;var U=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:M=10;O=mxConstants.PIXELS_PER_MM;U=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:M=20;O=mxConstants.PIXELS_PER_MM;U=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:M=.5>=B||4<=B?8:16,O=mxConstants.PIXELS_PER_INCH/M,U=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var T=O;2<=B?T=O/(2*Math.floor(B/2)):.5>=B&&(T=O*Math.floor(1/B/2)*(I.unit==mxConstants.MILLIMETERS?2:1));O=null;E=C?Math.min(K+(m?E.height:E.width),m?
+c.height:c.width):m?c.height:c.width;if(C)if(f.fillStyle=H.outBkgClr,m){var V=K-F;0<V&&f.fillRect(0,F,F,V);E<c.height&&f.fillRect(0,E,F,c.height)}else V=K-F,0<V&&f.fillRect(F,0,V,F),E<c.width&&f.fillRect(E,0,c.width,F);f.fillStyle=H.fontClr;V=T*B;C=C?K:K%V;for(C<F-V&&(C+=Math.floor((F-C)/V)*V);C<=E;C+=V){var fa=Math.round((C-K)/B/T);if(!(C<F||fa==O)){O=fa;var y=null;0==fa%M&&(y=I.formatText(R+fa*T)+"");m?n(F-U[Math.abs(fa)%M],C,F,C,y):n(C,F-U[Math.abs(fa)%M],C,F,y)}}f.lineWidth=1;n(m?0:F,m?F:0,F,
+F);f.fillStyle=H.cornerClr;f.fillRect(0,0,F,F)},t=-1,v=function(){null!=x?(null!=z&&z(t),t=x(r)):r()};this.drawRuler=v;this.sizeListener=k=u(function(){var B=l.container;m?(B=B.offsetHeight+F,c.height!=B&&(c.height=B,D.style.height=B+"px",v())):(B=B.offsetWidth+F,c.width!=B&&(c.width=B,D.style.width=B+"px",v()))},10);this.pageListener=function(){v()};this.scrollListener=g=u(function(){var B=m?l.container.scrollTop:l.container.scrollLeft;I.lastScroll!=B&&(I.lastScroll=B,v())},10);this.unitListener=
+function(B,E){I.setUnit(E.getProperty("unit"))};l.addListener(mxEvent.SIZE,k);l.container.addEventListener("scroll",g);l.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(B){H=B;D.style.background=H.bkgClr;r()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(B,E,K,C){if(m&&4<B.height||!m&&4<B.width){if(null!=
+I.guidePart)try{f.putImageData(I.guidePart.imgData1,I.guidePart.x1,I.guidePart.y1),f.putImageData(I.guidePart.imgData2,I.guidePart.x2,I.guidePart.y2),f.putImageData(I.guidePart.imgData3,I.guidePart.x3,I.guidePart.y3)}catch(A){}var R=I.origGuideMove.apply(this,arguments);try{f.lineWidth=.5;f.strokeStyle=H.guideClr;f.setLineDash([2]);if(m){var M=B.y+R.y+F-this.graph.container.scrollTop;var O=0;var U=M+B.height/2;var T=F/2;var V=M+B.height;var fa=0;var y=f.getImageData(O,M-1,F,3);n(O,M,F,M);M--;var d=
+f.getImageData(T,U-1,F,3);n(T,U,F,U);U--;var p=f.getImageData(fa,V-1,F,3);n(fa,V,F,V);V--}else M=0,O=B.x+R.x+F-this.graph.container.scrollLeft,U=F/2,T=O+B.width/2,V=0,fa=O+B.width,y=f.getImageData(O-1,M,3,F),n(O,M,O,F),O--,d=f.getImageData(T-1,U,3,F),n(T,U,T,F),T--,p=f.getImageData(fa-1,V,3,F),n(fa,V,fa,F),fa--;if(null==I.guidePart||I.guidePart.x1!=O||I.guidePart.y1!=M)I.guidePart={imgData1:y,x1:O,y1:M,imgData2:d,x2:T,y2:U,imgData3:p,x3:fa,y3:V}}catch(A){}}else R=I.origGuideMove.apply(this,arguments);
+return R};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var B=I.origGuideDestroy.apply(this,arguments);if(null!=I.guidePart)try{f.putImageData(I.guidePart.imgData1,I.guidePart.x1,I.guidePart.y1),f.putImageData(I.guidePart.imgData2,I.guidePart.x2,I.guidePart.y2),f.putImageData(I.guidePart.imgData3,I.guidePart.x3,I.guidePart.y3),I.guidePart=null}catch(E){}return B}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;
mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};mxRuler.prototype.formatText=function(b){switch(this.unit){case mxConstants.POINTS:return Math.round(b);case mxConstants.MILLIMETERS:return(b/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(b/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(b/mxConstants.PIXELS_PER_INCH).toFixed(2)}};
mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener(this.unitListener);this.ui.removeListener(this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};
function mxDualRuler(b,k){var m=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=b.getDiagramContainerOffset;b.getDiagramContainerOffset=function(){return m};this.editorUiRefresh=b.refresh;this.ui=b;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(b,k,!0);this.hRuler=new mxRuler(b,k,!1,!0);k=mxUtils.bind(this,function(g){var q=!1;mxEvent.addGestureListeners(g,mxUtils.bind(this,
-function(u){q=null!=b.currentMenu;mxEvent.consume(u)}),null,mxUtils.bind(this,function(u){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(u)||mxEvent.isPopupTrigger(u))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(u)||!q){var x=new mxPopupMenu(mxUtils.bind(this,function(J,H){b.menus.addMenuItems(J,["points","inches","millimeters","meters"],H)}));x.smartSeparators=!0;x.showDisabled=!0;x.autoExpand=!0;x.hideMenu=mxUtils.bind(this,
+function(u){q=null!=b.currentMenu;mxEvent.consume(u)}),null,mxUtils.bind(this,function(u){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(u)||mxEvent.isPopupTrigger(u))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(u)||!q){var x=new mxPopupMenu(mxUtils.bind(this,function(I,H){b.menus.addMenuItems(I,["points","inches","millimeters","meters"],H)}));x.smartSeparators=!0;x.showDisabled=!0;x.autoExpand=!0;x.hideMenu=mxUtils.bind(this,
function(){mxPopupMenu.prototype.hideMenu.apply(x,arguments);b.resetCurrentMenu();x.destroy()});var z=mxEvent.getClientX(u),F=mxEvent.getClientY(u);x.popup(z,F,null,u);b.setCurrentMenu(x,g)}mxEvent.consume(u)}}))});k(this.hRuler.container);k(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.updateStyle=function(){this.vRuler.updateStyle();this.hRuler.updateStyle();this.vRuler.drawRuler();this.hRuler.drawRuler()};
-mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var k=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=k){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var m=mxFreehand.prototype.MILD_SMOOTHING,g=null,q=[],u,x=[],z,F=!1,J=!0,H=!0,D=!0,c=!0,f=[],l=!1,n=!1,r=!1,t="default",v={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},B=!0;this.setClosedPath=function(U){F=U};this.setAutoClose=function(U){J=U};this.setAutoInsert=
+mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var k=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=k){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var m=mxFreehand.prototype.MILD_SMOOTHING,g=null,q=[],u,x=[],z,F=!1,I=!0,H=!0,D=!0,c=!0,f=[],l=!1,n=!1,r=!1,t="default",v={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},B=!0;this.setClosedPath=function(U){F=U};this.setAutoClose=function(U){I=U};this.setAutoInsert=
function(U){H=U};this.setAutoScroll=function(U){D=U};this.setOpenFill=function(U){c=U};this.setStopClickEnabled=function(U){n=U};this.setSelectInserted=function(U){r=U};this.setSmoothing=function(U){m=U};this.getSmoothing=function(){return m};this.setPerfectFreehandMode=function(U){B=U};this.isPerfectFreehandMode=function(){return B};this.setBrushSize=function(U){v.size=U};this.getBrushSize=function(){return v.size};var E=function(U){l=U;b.getRubberband().setEnabled(!U);b.graphHandler.setSelectEnabled(!U);
b.graphHandler.setMoveEnabled(!U);b.panningHandler.setPinchEnabled(!U);U?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){E(!0)};this.isDrawing=function(){return l};this.isActive=function(){return null!=g};var K=mxUtils.bind(this,function(U){if(g){var T=z.length,V=n&&0<x.length&&null!=z&&2>z.length;V||x.push.apply(x,z);z=[];x.push(null);q.push(g);g=null;(V||H)&&this.stopDrawing();
H&&(!V||2<=T)&&this.startDrawing();mxEvent.consume(U)}}),C=new mxCell;C.edge=!0;this.getStrokeColor=function(U){var T=null!=t?t:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(C),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=T||U||(T=b.shapeForegroundColor);return T};this.setStrokeColor=function(U){t=U};this.createStyle=function(U){var T=";fillColor=none;";B&&(T=";lineShape=1;");T+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+
"="+U+T};this.stopDrawing=function(){if(0<q.length){if(B){for(var U=[],T=0;T<x.length;T++)null!=x[T]&&U.push([x[T].x,x[T].y]);U=PerfectFreehand.getStroke(U,v);x=[];for(T=0;T<U.length;T++)x.push({x:U[T][0],y:U[T][1]});x.push(null)}U=x[0].x;var V=x[0].x,fa=x[0].y,y=x[0].y;for(T=1;T<x.length;T++)null!=x[T]&&(U=Math.max(U,x[T].x),V=Math.min(V,x[T].x),fa=Math.max(fa,x[T].y),y=Math.min(y,x[T].y));U-=V;fa-=y;if(0<U&&0<fa){var d=100/U,p=100/fa;x.map(function(P){if(null==P)return P;P.x=(P.x-V)*d;P.y=(P.y-
-y)*p;return P});var A='<shape strokewidth="inherit"><foreground>',G=0;for(T=0;T<x.length;T++){var I=x[T];if(null==I){I=!1;G=x[G];var L=x[T-1];!F&&J&&(I=G.x-L.x,L=G.y-L.y,I=Math.sqrt(I*I+L*L)<=b.tolerance);if(F||I)A+='<line x="'+G.x.toFixed(2)+'" y="'+G.y.toFixed(2)+'"/>';A+="</path>"+(c||F||I?"<fillstroke/>":"<stroke/>");G=T+1}else A=T==G?A+('<path><move x="'+I.x.toFixed(2)+'" y="'+I.y.toFixed(2)+'"/>'):A+('<line x="'+I.x.toFixed(2)+'" y="'+I.y.toFixed(2)+'"/>')}A+="</foreground></shape>";if(b.isEnabled()&&
+y)*p;return P});var A='<shape strokewidth="inherit"><foreground>',G=0;for(T=0;T<x.length;T++){var J=x[T];if(null==J){J=!1;G=x[G];var L=x[T-1];!F&&I&&(J=G.x-L.x,L=G.y-L.y,J=Math.sqrt(J*J+L*L)<=b.tolerance);if(F||J)A+='<line x="'+G.x.toFixed(2)+'" y="'+G.y.toFixed(2)+'"/>';A+="</path>"+(c||F||J?"<fillstroke/>":"<stroke/>");G=T+1}else A=T==G?A+('<path><move x="'+J.x.toFixed(2)+'" y="'+J.y.toFixed(2)+'"/>'):A+('<line x="'+J.x.toFixed(2)+'" y="'+J.y.toFixed(2)+'"/>')}A+="</foreground></shape>";if(b.isEnabled()&&
!b.isCellLocked(b.getDefaultParent())){T=this.createStyle("stencil("+Graph.compress(A)+")");A=b.view.scale;G=b.view.translate;T=new mxCell("",new mxGeometry(V/A-G.x,y/A-G.y,U/A,fa/A),T);T.vertex=1;b.model.beginUpdate();try{T=b.addCell(T),b.fireEvent(new mxEventObject("cellsInserted","cells",[T])),b.fireEvent(new mxEventObject("freehandInserted","cell",T))}finally{b.model.endUpdate()}r&&b.setSelectionCells([T])}}for(T=0;T<q.length;T++)q[T].parentNode.removeChild(q[T]);g=null;q=[];x=[]}E(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,
mxUtils.bind(this,function(U,T){l&&T.getProperty("event").consume()}));b.addListener(mxEvent.GESTURE,mxUtils.bind(this,function(U,T){l&&mxEvent.consume(T.getProperty("event"))}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(U,T){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(U=T.getEvent(),l&&!mxEvent.isPopupTrigger(U)&&!mxEvent.isMiddleMouseButton(U)&&!mxEvent.isMultiTouchEvent(U))){var V=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);V=Math.max(1,V*b.view.scale);
var fa=this.getStrokeColor();g=document.createElementNS("http://www.w3.org/2000/svg","path");g.setAttribute("fill",B?fa:"none");g.setAttribute("pointer-events","none");g.setAttribute("stroke",fa);g.setAttribute("stroke-width",V);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(fa=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",fa=fa.split(" ").map(function(y){return parseFloat(y)*V}).join(" "),g.setAttribute("stroke-dasharray",fa));f=[];U=R(U);M(U);u="M"+U.x+" "+U.y;x.push(U);z=[];
g.setAttribute("d",B?PerfectFreehand.getSvgPathFromStroke([[U.x,U.y]],v):u);k.appendChild(g);T.consume()}}),mouseMove:mxUtils.bind(this,function(U,T){if(null!=g&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){U=T.getEvent();U=R(U);M(U);var V=O(0);if(V)if(x.push(V),B){var fa=[];for(V=0;V<x.length;V++)fa.push([x[V].x,x[V].y]);z=[];for(var y=2;y<f.length;y+=2)V=O(y),fa.push([V.x,V.y]),z.push(V);g.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(fa,v))}else{u+=" L"+V.x+" "+V.y;fa="";z=[];
for(y=2;y<f.length;y+=2)V=O(y),fa+=" L"+V.x+" "+V.y,z.push(V);g.setAttribute("d",u+fa)}D&&(V=b.view.translate,b.scrollRectToVisible((new mxRectangle(U.x-V.x,U.y-V.y)).grow(20)));T.consume()}}),mouseUp:mxUtils.bind(this,function(U,T){null!=g&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(K(T.getEvent()),T.consume())})});var R=function(U){return mxUtils.convertPoint(b.container,mxEvent.getClientX(U),mxEvent.getClientY(U))},M=function(U){for(f.push(U);f.length>m;)f.shift()},O=function(U){var T=
f.length;if(1===T%2||T>=m){var V=0,fa=0,y,d=0;for(y=U;y<T;y++)d++,U=f[y],V+=U.x,fa+=U.y;return{x:V/d,y:fa/d}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;function P2PCollab(b,k,m){function g(N,aa){try{if(!V){var ea=k.file.getCurrentUser();if(T&&null!=ea&&null!=ea.displayName)if(A&&d&&0==y&&("cursor"==N||"selectionChange"==N||"diff"==N))"cursor"!=N&&EditorUi.debug("P2PCollab: skipped message while alone",[N]);else{var ka={from:R,id:v,type:N,sessionId:k.clientId,userId:ea.id,username:ea.displayName,data:aa,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION};ka={bytes:k.objectToString(ka),data:"aes"};ka=JSON.stringify(ka);p&&"cursor"!=N&&EditorUi.debug("P2PCollab: sending to socket server",
-[ka]);v++;ea=!p&&("cursor"==N||"selectionChange"==N);U&&!ea&&W("message",ka);if(ea)for(p2pId in O)O[p2pId].send(ka)}else"cursor"!=N&&EditorUi.debug("P2PCollab: message dropped, not joined",[N],"fileJoined",T)}}catch(ra){null!=window.console&&console.error(ra,N,aa)}}function q(N){if(b.shareCursorPosition&&!f.isMouseDown){var aa=mxUtils.getOffset(f.container),ea=f.view.translate,ka=f.view.scale,ra=null!=b.currentPage?b.currentPage.getId():null;g("cursor",{pageId:ra,x:Math.round((N.getX()-aa.x+f.container.scrollLeft)/
+[ka]);v++;ea=!p&&("cursor"==N||"selectionChange"==N);U&&!ea&&X("message",ka);if(ea)for(p2pId in O)O[p2pId].send(ka)}else"cursor"!=N&&EditorUi.debug("P2PCollab: message dropped, not joined",[N],"fileJoined",T)}}catch(ra){null!=window.console&&console.error(ra,N,aa)}}function q(N){if(b.shareCursorPosition&&!f.isMouseDown){var aa=mxUtils.getOffset(f.container),ea=f.view.translate,ka=f.view.scale,ra=null!=b.currentPage?b.currentPage.getId():null;g("cursor",{pageId:ra,x:Math.round((N.getX()-aa.x+f.container.scrollLeft)/
ka-ea.x),y:Math.round((N.getY()-aa.y+f.container.scrollTop)/ka-ea.y)})}}function u(N){return null==N||N==R||fa[N]?!1:(fa[N]=!0,y++,1==y&&(da(),A&&null!=k&&"function"===typeof k.sendUnconfirmedChanges&&k.sendUnconfirmedChanges()),!0)}function x(N,aa){var ea=null!=b.currentPage?b.currentPage.getId():null;if(null!=N&&null!=N.cursor&&null!=N.lastCursor)if(null!=N.lastCursor.hide||!b.isShowRemoteCursors()||null!=N.lastCursor.pageId&&N.lastCursor.pageId!=ea)N.cursor.style.display="none";else{ea=function(){var va=
Math.max(f.container.scrollLeft,Math.min(f.container.scrollLeft+f.container.clientWidth-N.cursor.clientWidth,sa)),za=Math.max(f.container.scrollTop-22,Math.min(f.container.scrollTop+f.container.clientHeight-N.cursor.clientHeight,ma));wa.style.opacity=va!=sa||za!=ma?0:1;N.cursor.style.left=va+"px";N.cursor.style.top=za+"px";N.cursor.style.display=""};var ka=f.view.translate,ra=f.view.scale,sa=(ka.x+N.lastCursor.x)*ra+8,ma=(ka.y+N.lastCursor.y)*ra-12,wa=N.cursor.getElementsByTagName("img")[0];aa?(mxUtils.setPrefixedStyle(N.cursor.style,
"transition","all 900ms ease-out"),mxUtils.setPrefixedStyle(wa.style,"transition","all 900ms ease-out"),window.setTimeout(ea,0)):(mxUtils.setPrefixedStyle(N.cursor.style,"transition",null),mxUtils.setPrefixedStyle(wa.style,"transition",null),ea())}}function z(N,aa){try{var ea=function(){if(null==t[sa]){var ia=C[sa];null==ia&&(ia=l%r.length,C[sa]=ia,l++);var ja=r[ia];ia=11<ia?"black":"white";t[sa]={cursor:document.createElement("div"),color:ja,selection:{}};E[aa]=sa;ma=t[sa].cursor;ma.style.pointerEvents=
@@ -16112,41 +16123,41 @@ Math.max(f.container.scrollLeft,Math.min(f.container.scrollLeft+f.container.clie
"8px";na.style.borderRadius="10px";na.style.maxWidth="100px";na.style.overflow="hidden";na.style.textOverflow="ellipsis";na.style.whiteSpace="nowrap";mxUtils.write(na,ra);ma.appendChild(na);b.diagramContainer.appendChild(ma)}else ma=t[sa].cursor;wa=t[sa].selection};if(!V){N=JSON.parse(N);null!=N.bytes&&(N=k.stringToObject(N.bytes));p&&"cursor"!=N.type&&EditorUi.debug("P2PCollab: msg received",[N]);var ka=!1;if(null!=aa){ka=u(aa);if(N.from==R||B[N.from]>=N.id){EditorUi.debug("P2PCollab: Dropped Message",
N,R,B[N.from]);return}B[N.from]=N.id}var ra=N.username?N.username:"Anonymous",sa=N.sessionId,ma,wa;null!=t[sa]&&(clearTimeout(t[sa].inactiveTO),t[sa].inactiveTO=setTimeout(function(){D(null,sa)},12E4));var va=N.data;switch(N.type){case "join":ka&&H();break;case "cursor":ea();t[sa].lastCursor=va;x(t[sa],!0);break;case "diff":try{N=null!=va.patch?k.stringToObject(decodeURIComponent(va.patch)):va.diff,k.receiveRemoteChanges(N.d)}catch(ia){EditorUi.debug("P2PCollab: Diff msg error",ia)}break;case "selectionChange":if("0"!=
urlParams["remote-selection"]){var za=null!=b.currentPage?b.currentPage.getId():null;if(null==za||null!=va.pageId&&va.pageId==za){ea();for(ea=0;ea<va.removed.length;ea++){var Ba=va.removed[ea];if(null!=Ba){var ua=wa[Ba];delete wa[Ba];null!=ua&&ua.destroy()}}for(ea=0;ea<va.added.length;ea++)if(Ba=va.added[ea],null!=Ba){var qa=f.model.getCell(Ba);null!=qa&&(null!=wa[Ba]&&wa[Ba].destroy(),wa[Ba]=f.highlightCell(qa,t[sa].color,6E4,70,3))}}}break;case "notify":N=null!=va.data?k.stringToObject(decodeURIComponent(va.data)):
-va.msg,k.handleMessageData(N.d,N.c)}k.file.fireEvent(new mxEventObject("realtimeMessage","message",N))}}catch(ia){null!=window.console&&console.warn(ia,N,aa)}}function F(N,aa){if(!p&&SimplePeer.WEBRTC_SUPPORT){var ea=new SimplePeer({initiator:aa,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});ea.on("signal",function(ka){W("sendSignal",{to:N,from:R,signal:ka})});ea.on("error",function(ka){delete M[N];EditorUi.debug("P2PCollab: p2p socket error",ka);!V&&aa&&ea.destroyed&&K[N]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",
-N),F(N,!0))});ea.on("connect",function(){delete M[N];null==O[N]||O[N].destroyed?(O[N]=ea,K[N]=!0,EditorUi.debug("P2PCollab: p2p socket connected",N)):(ea.noP2PMapDel=!0,ea.destroy(),EditorUi.debug("P2PCollab: p2p socket duplicate",N))});ea.on("close",function(){ea.noP2PMapDel||(EditorUi.debug("P2PCollab: p2p socket closed",N),c(E[N]),delete O[N])});ea.on("data",z);return M[N]=ea}}function J(N){R=N.cId;T=!0;P=0;ba=!1;L=null;fa=Object.create(null);y=0;d=null!=N.list;if(null!=N.list)for(var aa=0;aa<
+va.msg,k.handleMessageData(N.d,N.c)}k.file.fireEvent(new mxEventObject("realtimeMessage","message",N))}}catch(ia){null!=window.console&&console.warn(ia,N,aa)}}function F(N,aa){if(!p&&SimplePeer.WEBRTC_SUPPORT){var ea=new SimplePeer({initiator:aa,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});ea.on("signal",function(ka){X("sendSignal",{to:N,from:R,signal:ka})});ea.on("error",function(ka){delete M[N];EditorUi.debug("P2PCollab: p2p socket error",ka);!V&&aa&&ea.destroyed&&K[N]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",
+N),F(N,!0))});ea.on("connect",function(){delete M[N];null==O[N]||O[N].destroyed?(O[N]=ea,K[N]=!0,EditorUi.debug("P2PCollab: p2p socket connected",N)):(ea.noP2PMapDel=!0,ea.destroy(),EditorUi.debug("P2PCollab: p2p socket duplicate",N))});ea.on("close",function(){ea.noP2PMapDel||(EditorUi.debug("P2PCollab: p2p socket closed",N),c(E[N]),delete O[N])});ea.on("data",z);return M[N]=ea}}function I(N){R=N.cId;T=!0;P=0;ba=!1;L=null;fa=Object.create(null);y=0;d=null!=N.list;if(null!=N.list)for(var aa=0;aa<
N.list.length;aa++)u(N.list[aa]),F(N.list[aa],!0);H();window.setTimeout(function(){V||H()},3E3)}function H(){"0"!=urlParams["join-announce"]&&g("join",{})}function D(N,aa){c(aa||E[N]);null!=N&&(delete E[N],K[N]=!1,null!=N&&fa[N]&&(delete fa[N],y--))}function c(N){var aa=t[N];if(null!=aa){var ea=aa.selection,ka;for(ka in ea)null!=ea[ka]&&ea[ka].destroy();null!=aa.cursor&&null!=aa.cursor.parentNode&&aa.cursor.parentNode.removeChild(aa.cursor);clearTimeout(aa.inactiveTO);delete t[N]}}var f=b.editor.graph,
-l=0,n=null,r="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),t=Object.create(null),v=1,B=Object.create(null),E=Object.create(null),K=Object.create(null),C=Object.create(null),R,M=Object.create(null),O=Object.create(null),U=!0,T=!1,V=!1,fa=Object.create(null),y=0,d=!1,p="0"!=urlParams["no-p2p"],A="0"!=urlParams["alone-gate"],G=!1,I=0,L=null,P=0,Q=null,ba=!1,X=mxUtils.bind(this,
+l=0,n=null,r="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),t=Object.create(null),v=1,B=Object.create(null),E=Object.create(null),K=Object.create(null),C=Object.create(null),R,M=Object.create(null),O=Object.create(null),U=!0,T=!1,V=!1,fa=Object.create(null),y=0,d=!1,p="0"!=urlParams["no-p2p"],A="0"!=urlParams["alone-gate"],G=!1,J=0,L=null,P=0,Q=null,ba=!1,W=mxUtils.bind(this,
function(){if(!V&&null==Q)if(10<=P)ba||(ba=!0,L="rejoinStopped",EditorUi.debug("P2PCollab: rejoin stopped after",P,"attempts"),k.file.fireEvent(new mxEventObject("realtimeStateChanged")));else{P++;var N=2E3*P;EditorUi.debug("P2PCollab: scheduling rejoin attempt",P,"of",10,"delay",N);Q=window.setTimeout(mxUtils.bind(this,function(){Q=null;this.joinFile(!0)}),N)}}),Y=mxUtils.bind(this,function(){V||!ba||document.hidden||(EditorUi.debug("P2PCollab: rejoin restarted on activation"),ba=!1,P=0,L=null,this.joinFile(!0))});
-document.addEventListener("visibilitychange",Y);window.addEventListener("focus",Y);var W=mxUtils.bind(this,function(N,aa){if(!V)try{null!=n?(n.send(JSON.stringify({action:N,msg:aa})),p||EditorUi.debug("P2PCollab: sending to socket server",[N],[aa])):this.joinFile(!0)}catch(ea){L=ea,k.file.fireEvent(new mxEventObject("realtimeStateChanged")),EditorUi.debug("P2PCollab:","sendReply error",arguments,ea)}});this.sendMessage=g;this.sendDiff=function(N){this.sendMessage("diff",{diff:N})};this.sendNotification=
+document.addEventListener("visibilitychange",Y);window.addEventListener("focus",Y);var X=mxUtils.bind(this,function(N,aa){if(!V)try{null!=n?(n.send(JSON.stringify({action:N,msg:aa})),p||EditorUi.debug("P2PCollab: sending to socket server",[N],[aa])):this.joinFile(!0)}catch(ea){L=ea,k.file.fireEvent(new mxEventObject("realtimeStateChanged")),EditorUi.debug("P2PCollab:","sendReply error",arguments,ea)}});this.sendMessage=g;this.sendDiff=function(N){this.sendMessage("diff",{diff:N})};this.sendNotification=
function(N){this.sendMessage("notify",{msg:N})};this.getState=function(){return null!=n?n.readyState:3};this.getLastError=function(){return L};this.isFileJoined=function(){return T};this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(N,aa){},mouseMove:function(N,aa){var ea,ka=-1;return function(){clearTimeout(ea);var ra=this,sa=arguments,ma=function(){ea=null;ka=Date.now();N.apply(ra,sa)};Date.now()-ka>aa?ma():ea=setTimeout(ma,aa)}}(function(N,aa){q(aa)},300),mouseUp:function(N,
aa){q(aa)}};f.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||g("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);var ca=mxGraphHandler.prototype.maxCells,S=null,Z={};this.selectionChangeListener=function(N,aa){var ea=function(ka){return null!=ka?ka.id:null};null!=S&&window.clearTimeout(S);S=window.setTimeout(function(){for(var ka=f.getSelectionCount()>ca?[]:f.getSelectionCells().map(ea),ra=
null!=b.currentPage?b.currentPage.getId():null,sa={},ma=[],wa=[],va=0;va<ka.length;va++){var za=ka[va];null!=za&&(sa[za]=!0,null==Z[za]&&wa.push(za))}for(za in Z)sa[za]||ma.push(za);Z=sa;g("selectionChange",{pageId:ra,removed:ma,added:wa})},300)};f.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionChangeListener);var da=mxUtils.bind(this,function(){A&&!f.isSelectionEmpty()&&(Z={},this.selectionChangeListener())});this.cursorHandler=mxUtils.bind(this,function(){for(var N in t)x(t[N])});
-mxEvent.addListener(f.container,"scroll",this.cursorHandler);f.getView().addListener(mxEvent.SCALE,this.cursorHandler);f.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);f.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(N){if(!V)try{d=!1;G&&(EditorUi.debug("P2PCollab: joinInProgress on",G),L="busy");G=++I;try{null!=n&&1==n.readyState&&
+mxEvent.addListener(f.container,"scroll",this.cursorHandler);f.getView().addListener(mxEvent.SCALE,this.cursorHandler);f.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);f.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(N){if(!V)try{d=!1;G&&(EditorUi.debug("P2PCollab: joinInProgress on",G),L="busy");G=++J;try{null!=n&&1==n.readyState&&
(EditorUi.debug("P2PCollab: force closing socket on",n.joinId),n.close(1E3),n=null)}catch(ka){EditorUi.debug("P2PCollab: closing socket error",ka)}var aa=P2PCollab.createSocket(window.RT_WEBSOCKET_URL+"?id="+m);aa.joinId=G;null==n&&(n=aa);aa.addEventListener("open",function(ka){n=aa;G=!1;k.file.fireEvent(new mxEventObject("realtimeStateChanged"));EditorUi.debug("P2PCollab: open socket",n.joinId);Editor.enableRealtimeCache||window.setTimeout(function(){k.sendJoinMessage()},0);N&&k.scheduleCleanup()});
-aa.addEventListener("message",function(ka){try{p||EditorUi.debug("P2PCollab: msg received",[ka]);var ra=JSON.parse(ka.data);p&&"message"!=ra.action&&EditorUi.debug("P2PCollab: msg received",[ka]);switch(ra.action){case "message":z(ra.msg,ra.from);break;case "clientsList":J(ra.msg);break;case "signal":var sa=ra.msg;u(sa.from);if(!p){if(M[sa.from])var ma=M[sa.from];else ma=F(sa.from,!1),U=!0;ma.signal(sa.signal)}break;case "newClient":var wa=ra.msg;U=!0;u(wa);break;case "clientLeft":D(ra.msg);break;
-case "sendSignalFailed":var va=ra.msg;EditorUi.debug("P2PCollab: signal failed (socket not found on server)",va);delete M[va.to];K[va.to]=!1}}catch(za){null!=window.console&&console.warn(za,ka)}});var ea=!1;aa.addEventListener("close",mxUtils.bind(this,function(ka){EditorUi.debug("P2PCollab: WebSocket closed",aa.joinId,"reconnecting",ka.code,ka.reason);EditorUi.debug("P2PCollab: closing socket on",aa.joinId);V||1E3==ka.code||I!=aa.joinId||(G==I&&(EditorUi.debug("P2PCollab: joinInProgress in close on",
-aa.joinId),G=!1),ea||(EditorUi.debug("P2PCollab: calling rejoin on",aa.joinId),ea=!0,X()));k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));aa.addEventListener("error",mxUtils.bind(this,function(ka){EditorUi.debug("P2PCollab: WebSocket error, reconnecting",ka);EditorUi.debug("P2PCollab: error socket on",aa.joinId);V||I!=aa.joinId||(G==I&&(EditorUi.debug("P2PCollab: joinInProgress in error on",aa.joinId),G=!1),ea||(EditorUi.debug("P2PCollab: calling rejoin on",aa.joinId),ea=!0,X()));
+aa.addEventListener("message",function(ka){try{p||EditorUi.debug("P2PCollab: msg received",[ka]);var ra=JSON.parse(ka.data);p&&"message"!=ra.action&&EditorUi.debug("P2PCollab: msg received",[ka]);switch(ra.action){case "message":z(ra.msg,ra.from);break;case "clientsList":I(ra.msg);break;case "signal":var sa=ra.msg;u(sa.from);if(!p){if(M[sa.from])var ma=M[sa.from];else ma=F(sa.from,!1),U=!0;ma.signal(sa.signal)}break;case "newClient":var wa=ra.msg;U=!0;u(wa);break;case "clientLeft":D(ra.msg);break;
+case "sendSignalFailed":var va=ra.msg;EditorUi.debug("P2PCollab: signal failed (socket not found on server)",va);delete M[va.to];K[va.to]=!1}}catch(za){null!=window.console&&console.warn(za,ka)}});var ea=!1;aa.addEventListener("close",mxUtils.bind(this,function(ka){EditorUi.debug("P2PCollab: WebSocket closed",aa.joinId,"reconnecting",ka.code,ka.reason);EditorUi.debug("P2PCollab: closing socket on",aa.joinId);V||1E3==ka.code||J!=aa.joinId||(G==J&&(EditorUi.debug("P2PCollab: joinInProgress in close on",
+aa.joinId),G=!1),ea||(EditorUi.debug("P2PCollab: calling rejoin on",aa.joinId),ea=!0,W()));k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));aa.addEventListener("error",mxUtils.bind(this,function(ka){EditorUi.debug("P2PCollab: WebSocket error, reconnecting",ka);EditorUi.debug("P2PCollab: error socket on",aa.joinId);V||J!=aa.joinId||(G==J&&(EditorUi.debug("P2PCollab: joinInProgress in error on",aa.joinId),G=!1),ea||(EditorUi.debug("P2PCollab: calling rejoin on",aa.joinId),ea=!0,W()));
k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}catch(ka){L=ka,k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}};this.destroy=function(){if(!V){EditorUi.debug("P2PCollab: destroyed");V=!0;window.clearTimeout(Q);Q=null;document.removeEventListener("visibilitychange",Y);window.removeEventListener("focus",Y);for(sessionId in t)c(sessionId);null!=this.mouseListeners&&f.removeMouseListener(this.mouseListeners);null!=
this.selectionChangeListener&&f.getSelectionModel().removeListener(this.selectionChangeListener);null!=this.shareCursorPositionListener&&b.removeListener(this.shareCursorPositionListener);null!=this.cursorHandler&&(mxEvent.removeListener(f.container,"scroll",this.cursorHandler),f.view.removeListener(this.cursorHandler),b.editor.removeListener(this.cursorHandler),b.removeListener(this.cursorHandler));null!=n&&1<=n.readyState&&(n.close(1E3),n=null);for(var N in O)null!=O[N]&&O[N].destroy();k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}}}
P2PCollab.createSocket=function(b){return new WebSocket(b)};Editor.themes.unshift("simple");Editor.themes.push("sketch");Editor.themes.push("atlas");
(function(){EditorUi.prototype.switchCssForTheme=function(q){var u=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=u&&("kennedy"==q?u.classList.add("geClassic"):u.classList.remove("geClassic"),"sketch"==q&&u.classList.add("geSketch"),"simple"==q||"sketch"==q?u.classList.add("geSimple"):u.classList.remove("geSimple"))};var b=EditorUi.prototype.createMainMenuForTheme;EditorUi.prototype.createMainMenuForTheme=function(q){if("simple"==q||"sketch"==
q){if(null==this.sketchMainMenuElt){this.sketchMainMenuElt=document.createElement("div");var u=this.createMenu("simple"==q?"view":"diagram","simple"==q?Editor.thinViewImage:Editor.menuImage);this.sketchMainMenuElt.appendChild(u);var x=this.createMenuItem("delete",Editor.trashImage),z=this.createMenuItem("undo",Editor.undoImage),F=this.createMenuItem("redo",Editor.redoImage);this.dependsOnLanguage(mxUtils.bind(this,function(){u.setAttribute("title",mxResources.get("simple"==q?"view":"diagram"));x.setAttribute("title",
mxResources.get("delete"));z.setAttribute("title",mxResources.get("undo"));F.setAttribute("title",mxResources.get("redo"))}));"simple"==q?this.sketchMainMenuElt.className="geToolbarContainer geSimpleMainMenu":(this.container.appendChild(this.sketchMainMenuElt),this.sketchMainMenuElt.className="geToolbarContainer geSketchMainMenu",this.sketchMainMenuElt.appendChild(x),this.sketchMainMenuElt.appendChild(z),this.sketchMainMenuElt.appendChild(F));this.container.appendChild(this.sketchMainMenuElt)}}else b.apply(this,
-arguments)};var k=EditorUi.prototype.createFooterMenuForTheme;EditorUi.prototype.createFooterMenuForTheme=function(q){if("simple"==q||"sketch"==q){if(null==this.sketchFooterMenuElt){var u=this.createPageMenuTab(!1,"simple"!=q),x=this.createMenu("pages",Editor.thinNoteImage),z=this.createMenuItem("undo",Editor.thinUndoImage),F=this.createMenuItem("redo",Editor.thinRedoImage),J=this.createMenuItem("delete",Editor.thinDeleteImage),H=this.createMenuItem("zoomOut",Editor.zoomOutImage),D=this.createMenuItem("zoomIn",
-Editor.zoomInImage),c=this.createMenuItem("fullscreen",Editor.fullscreenImage),f=this.createMenuItem("exit",Editor.closeImage);this.dependsOnLanguage(mxUtils.bind(this,function(){x.setAttribute("title",mxResources.get("pages"));z.setAttribute("title",mxResources.get("undo"));F.setAttribute("title",mxResources.get("redo"));J.setAttribute("title",mxResources.get("delete"));H.setAttribute("title",mxResources.get("zoomOut"));D.setAttribute("title",mxResources.get("zoomIn"));c.setAttribute("title",mxResources.get("fullscreen"));
+arguments)};var k=EditorUi.prototype.createFooterMenuForTheme;EditorUi.prototype.createFooterMenuForTheme=function(q){if("simple"==q||"sketch"==q){if(null==this.sketchFooterMenuElt){var u=this.createPageMenuTab(!1,"simple"!=q),x=this.createMenu("pages",Editor.thinNoteImage),z=this.createMenuItem("undo",Editor.thinUndoImage),F=this.createMenuItem("redo",Editor.thinRedoImage),I=this.createMenuItem("delete",Editor.thinDeleteImage),H=this.createMenuItem("zoomOut",Editor.zoomOutImage),D=this.createMenuItem("zoomIn",
+Editor.zoomInImage),c=this.createMenuItem("fullscreen",Editor.fullscreenImage),f=this.createMenuItem("exit",Editor.closeImage);this.dependsOnLanguage(mxUtils.bind(this,function(){x.setAttribute("title",mxResources.get("pages"));z.setAttribute("title",mxResources.get("undo"));F.setAttribute("title",mxResources.get("redo"));I.setAttribute("title",mxResources.get("delete"));H.setAttribute("title",mxResources.get("zoomOut"));D.setAttribute("title",mxResources.get("zoomIn"));c.setAttribute("title",mxResources.get("fullscreen"));
f.setAttribute("title",mxResources.get("exit"))}));this.sketchFooterMenuElt=document.createElement("div");this.sketchFooterMenuElt.className="geToolbarContainer geFooterToolbar";var l=this.sketchFooterMenuElt;if("simple"!=q){u.className="geButton gePageMenu";u.style.backgroundImage="url("+Editor.arrowDownImage+")";l.appendChild(u);var n=document.createElement("span");u.innerText="";u.appendChild(n);var r=mxUtils.bind(this,function(){n.innerText="";if(null!=this.currentPage){mxUtils.write(n,this.currentPage.getName());
var E=null!=this.pages?this.pages.length:1,K=this.getPageIndex(this.currentPage);K=null!=K?K+1:1;var C=this.currentPage.getId();u.setAttribute("title",this.currentPage.getName()+" ("+K+"/"+E+")"+(null!=C?" ["+C+"]":""))}});this.editor.addListener("pagesPatched",r);this.editor.addListener("pageSelected",r);this.editor.addListener("pageRenamed",r);this.editor.addListener("fileLoaded",r);r();var t=mxUtils.bind(this,function(){u.style.display=this.isPageMenuVisible()?"":"none"});this.addListener("editInlineStart",
-mxUtils.bind(this,function(){t();r()}));this.addListener("fileDescriptorChanged",t);this.addListener("pagesVisibleChanged",t);this.editor.addListener("pagesPatched",t);t();l.appendChild(H)}var v=this.createZoomInput("simple"!=q);l.appendChild(v);if("simple"==q){z.style.marginLeft="auto";l.appendChild(x);l.appendChild(z);l.appendChild(F);l.appendChild(J);var B=mxUtils.bind(this,function(){var E=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,K="1"==urlParams.embed&&
-null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;x.style.display=E<480+K?"none":"";v.style.display=E<750+K?"none":"";J.style.display=E<290+K?"none":"";z.style.display=E<360+K?"none":"";F.style.display=E<360+K?"none":""});mxEvent.addListener(window,"resize",B);B()}"simple"!=q&&l.appendChild(D);"1"==urlParams.embedInline&&(l.appendChild(c),B=mxUtils.bind(this,function(){c.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")";this.inlineSizeChanged();
+mxUtils.bind(this,function(){t();r()}));this.addListener("fileDescriptorChanged",t);this.addListener("pagesVisibleChanged",t);this.editor.addListener("pagesPatched",t);t();l.appendChild(H)}var v=this.createZoomInput("simple"!=q);l.appendChild(v);if("simple"==q){z.style.marginLeft="auto";l.appendChild(x);l.appendChild(z);l.appendChild(F);l.appendChild(I);var B=mxUtils.bind(this,function(){var E=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,K="1"==urlParams.embed&&
+null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;x.style.display=E<480+K?"none":"";v.style.display=E<750+K?"none":"";I.style.display=E<290+K?"none":"";z.style.display=E<360+K?"none":"";F.style.display=E<360+K?"none":""});mxEvent.addListener(window,"resize",B);B()}"simple"!=q&&l.appendChild(D);"1"==urlParams.embedInline&&(l.appendChild(c),B=mxUtils.bind(this,function(){c.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")";this.inlineSizeChanged();
this.editor.graph.refresh();this.fitWindows()}),this.addListener("editInlineStart",mxUtils.bind(this,function(){c.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")"})),this.addListener("inlineFullscreenChanged",B),l.appendChild(f));"simple"==q?(this.sketchFooterMenuElt.style.cssText="position:relative;gap:6px;flex-shrink:0;flex-grow:0.5;",this.sketchMainMenuElt.appendChild(this.sketchFooterMenuElt)):this.container.appendChild(this.sketchFooterMenuElt)}}else k.apply(this,
arguments)};var m=EditorUi.prototype.createPickerMenuForTheme;EditorUi.prototype.createPickerMenuForTheme=function(q){if("simple"==q||"sketch"==q){if(null==this.sketchPickerMenuElt){var u=this.editor.graph;this.sketchPickerMenuElt=document.createElement("div");this.sketchPickerMenuElt.className="geToolbarContainer";"sketch"==q&&this.sketchPickerMenuElt.classList.add("geVerticalToolbar");var x=this.sketchPickerMenuElt,z=document.createElement("a");z.className="geButton";z.style.height="18px";z.style.opacity=
-"0.4";z.style.backgroundImage="url("+Editor.expandMoreImage+")";z.setAttribute("title",mxResources.get("collapseExpand"));var F=this.createMenuItem("insertFreehand","simple"==q?Editor.thinGestureImage:Editor.freehandImage,!0),J=this.createMenu("insert","simple"==q?Editor.thinAddCircleImage:Editor.addBoxImage),H=J.cloneNode(!0);H.style.backgroundImage="url("+("simple"==q?Editor.thinShapesImage:Editor.shapesImage)+")";H.setAttribute("title",mxResources.get("shapes"));this.addShapePicker(H,"simple"==
+"0.4";z.style.backgroundImage="url("+Editor.expandMoreImage+")";z.setAttribute("title",mxResources.get("collapseExpand"));var F=this.createMenuItem("insertFreehand","simple"==q?Editor.thinGestureImage:Editor.freehandImage,!0),I=this.createMenu("insert","simple"==q?Editor.thinAddCircleImage:Editor.addBoxImage),H=I.cloneNode(!0);H.style.backgroundImage="url("+("simple"==q?Editor.thinShapesImage:Editor.shapesImage)+")";H.setAttribute("title",mxResources.get("shapes"));this.addShapePicker(H,"simple"==
q);var D=!1,c=mxUtils.bind(this,function(n){if(n||null!=document.body&&document.body.contains(x)){n=function(B,E,K,C,R,M){null!=E&&B.setAttribute("title",E);x.appendChild(B);"simple"!=q&&null!=C&&null!=B&&null==B.querySelector(".geShortcutKey")&&(E=document.createElement("div"),E.className="geShortcutKey",mxUtils.write(E,C),B.appendChild(E));u.isEnabled()||"1"==urlParams.embedInline||B.classList.add("mxDisabled");return B};u.isEnabled()||"1"==urlParams.embedInline?(F.classList.remove("mxDisabled"),
-J.classList.remove("mxDisabled"),H.classList.remove("mxDisabled")):(F.classList.add("mxDisabled"),J.classList.add("mxDisabled"),H.classList.add("mxDisabled"));x.innerText="";if(!D){var r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t="1"==urlParams.embed&&null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;"simple"==q&&(this.sidebar.graph.cellRenderer.minSvgStrokeWidth=.9);if("simple"!=q||r>=780+t){var v=this.sidebar.createVertexTemplate(u.appendFontSize(Editor.defaultTextStyle,
+I.classList.remove("mxDisabled"),H.classList.remove("mxDisabled")):(F.classList.add("mxDisabled"),I.classList.add("mxDisabled"),H.classList.add("mxDisabled"));x.innerText="";if(!D){var r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t="1"==urlParams.embed&&null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;"simple"==q&&(this.sidebar.graph.cellRenderer.minSvgStrokeWidth=.9);if("simple"!=q||r>=780+t){var v=this.sidebar.createVertexTemplate(u.appendFontSize(Editor.defaultTextStyle,
u.vertexFontSize),60,30,"Text",mxResources.get("text")+" (A)",!0,!1,null,"simple"!=q,null,28,28,"simple"==q?Editor.thinTextImage:null,!0);n(v,mxResources.get("text")+" (A)",null,"A",32)}v=this.sidebar.createVertexTemplate("rounded=0;whiteSpace=wrap;html=1;",160,80,"",mxResources.get("rectangle")+" (D)",!0,!1,null,"simple"!=q,null,28,28,"simple"==q?Editor.thinRectangleImage:null);"simple"==q?(r>=800+t&&n(v,mxResources.get("rectangle")+" (D)",null,"D"),r>=540+t&&this.sketchPickerMenuElt.appendChild(H),
r>=680+t&&n(F,mxResources.get("freehand")+" (X)",null,"X")):(n(this.sidebar.createVertexTemplate(Editor.defaultNoteStyle,160,160,"",mxResources.get("note")+" (S)",!0,!1,null,!0,null,28,28),mxResources.get("note")+" (S)",null,"S"),n(v,mxResources.get("rectangle")+" (D)",null,"D"),n(this.sidebar.createVertexTemplate("ellipse;whiteSpace=wrap;html=1;shapeInside=1;",160,100,"",mxResources.get("ellipse")+" (F)",!0,!1,null,!0,null,28,28),mxResources.get("ellipse")+" (F)",null,"F"),t=new mxCell("",new mxGeometry(0,
0,this.editor.graph.defaultEdgeLength+20,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(t.geometry.width,0),!1),t.geometry.points=[],t.geometry.relative=!0,t.edge=!0,n(this.sidebar.createEdgeTemplateFromCells([t],t.geometry.width,t.geometry.height,mxResources.get("line")+" (C)",!0,null,"simple"!=q,!1,null,28,28),mxResources.get("line")+" (C)",null,"C"),t=t.clone(),t.style="edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;",
-t.geometry.width=this.editor.graph.defaultEdgeLength+20,t.geometry.setTerminalPoint(new mxPoint(0,20),!0),t.geometry.setTerminalPoint(new mxPoint(t.geometry.width,20),!1),n(F,mxResources.get("freehand")+" (X)",null,"X"),this.sketchPickerMenuElt.appendChild(H));("simple"!=q||320<r)&&this.sketchPickerMenuElt.appendChild(J)}"simple"!=q&&"1"!=urlParams.embedInline&&x.appendChild(z);this.sidebar.graph.cellRenderer.minSvgStrokeWidth=this.sidebar.minThumbStrokeWidth}});mxEvent.addListener(z,"click",mxUtils.bind(this,
+t.geometry.width=this.editor.graph.defaultEdgeLength+20,t.geometry.setTerminalPoint(new mxPoint(0,20),!0),t.geometry.setTerminalPoint(new mxPoint(t.geometry.width,20),!1),n(F,mxResources.get("freehand")+" (X)",null,"X"),this.sketchPickerMenuElt.appendChild(H));("simple"!=q||320<r)&&this.sketchPickerMenuElt.appendChild(I)}"simple"!=q&&"1"!=urlParams.embedInline&&x.appendChild(z);this.sidebar.graph.cellRenderer.minSvgStrokeWidth=this.sidebar.minThumbStrokeWidth}});mxEvent.addListener(z,"click",mxUtils.bind(this,
function(){D?(x.classList.remove("geCollapsedToolbar"),z.style.backgroundImage="url("+Editor.expandMoreImage+")",D=!1,c()):(x.innerText="",x.appendChild(z),x.classList.add("geCollapsedToolbar"),z.style.backgroundImage="url("+Editor.expandLessImage+")",D=!0)}));var f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=null;mxEvent.addListener(window,"resize",function(){var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;n!=f&&(f=
n,null!=l&&window.clearTimeout(l),l=window.setTimeout(function(){l=null;c()},200))});this.editor.addListener("fileLoaded",c);this.addListener("sketchModeChanged",c);this.addListener("currentThemeChanged",c);this.addListener("languageChanged",c);this.addListener("lockedChanged",c);c(!0);"simple"==q?(this.sketchPickerMenuElt.style.cssText="position:relative;white-space:nowrap;user-select:none;display:flex;align-items:center;justify-content:flex-end;flex-grow:1;gap:6px;flex-shrink:0;",this.sketchMainMenuElt.appendChild(this.sketchPickerMenuElt)):
this.container.appendChild(this.sketchPickerMenuElt);mxClient.IS_POINTER&&(this.sketchPickerMenuElt.style.touchAction="none")}}else m.apply(this,arguments)};var g=EditorUi.prototype.createMenubarForTheme;EditorUi.prototype.createMenubarForTheme=function(q){if("simple"==q||"sketch"==q){if(null==this.sketchMenubarElt){this.sketchMenubarElt=document.createElement("div");this.sketchMenubarElt.className="geToolbarContainer";if("simple"==q){if(this.sketchMenubarElt.style.cssText="position:relative;"+("1"!=
diff --git a/src/main/webapp/js/bootstrap.js b/src/main/webapp/js/bootstrap.js
index 30f46b10f..11e77af47 100644
--- a/src/main/webapp/js/bootstrap.js
+++ b/src/main/webapp/js/bootstrap.js
@@ -11,7 +11,6 @@
*
* - dev=1: For developers only
* - test=1: For developers only
- * - export=URL for export: For developers only
* - ignoremime=1: For developers only (see DriveClient.js). Use Cmd-S to override mime.
* - createindex=1: For developers only (see etc/build/README)
* - filesupport=0: For developers only (see Editor.js in core)
diff --git a/src/main/webapp/js/diagramly/App.js b/src/main/webapp/js/diagramly/App.js
index e8379dd62..60385fc18 100644
--- a/src/main/webapp/js/diagramly/App.js
+++ b/src/main/webapp/js/diagramly/App.js
@@ -1334,11 +1334,7 @@ App.main = function(callback, createUi)
if (urlParams['chrome'] != '0' && urlParams['test'] == '1')
{
EditorUi.debug('App.start', ['v' + EditorUi.VERSION, ui, (new Date().getTime() - t0.getTime()) + 'ms']);
-
- if (urlParams['export'] != null)
- {
- EditorUi.debug('Export:', EXPORT_URL);
- }
+ EditorUi.debug('Export:', EXPORT_URL);
}
}
catch (e)
@@ -1896,7 +1892,8 @@ App.prototype.init = function()
initOneDriveClient();
}
- if (urlParams['ms365'] != '0' && !EditorUi.isElectronApp)
+ if (urlParams['ms365'] != '0' && !EditorUi.isElectronApp &&
+ (urlParams['embed'] != '1' || urlParams['ms365'] == '1'))
{
try
{
diff --git a/src/main/webapp/js/diagramly/Dialogs.js b/src/main/webapp/js/diagramly/Dialogs.js
index 8d819198c..b9770b958 100644
--- a/src/main/webapp/js/diagramly/Dialogs.js
+++ b/src/main/webapp/js/diagramly/Dialogs.js
@@ -5915,7 +5915,7 @@ var LinkDialog = function(editorUi, initialValue, btnLabel, fn, showPages, showN
actionValue = newValue;
fn(newValue, LinkDialog.selectedDocs,
(newWindowCheckbox.checked) ? linkTarget : null);
- });
+ }, editorUi.editor.graph.getSelectionCells());
});
editActionBtn.className = 'geBtn';
@@ -6355,26 +6355,70 @@ var LinkDialog = function(editorUi, initialValue, btnLabel, fn, showPages, showN
* cancels (closes without saving), nothing happens — the cell keeps
* whatever link it had before Edit Link was opened.
*/
-LinkDialog.editCustomAction = function(editorUi, currentValue, onSave)
+LinkDialog.editCustomAction = function(editorUi, currentValue, onSave, cells)
{
editorUi.hideDialog();
- // Reuse an already-open action editor instead of stacking a duplicate.
- // The reference is cleared on close (below), so a fresh Edit later opens
- // a new dialog bound to the current cell.
- if (editorUi.actionWindow != null && editorUi.actionWindow.window != null &&
- editorUi.actionWindow.window.isVisible())
+ var open = function()
{
- editorUi.actionWindow.window.setVisible(true);
- editorUi.actionWindow.window.activate();
- return;
+ editorUi.actionWindow = new CustomActionDialog(editorUi, currentValue, onSave);
+ editorUi.actionWindow.cells = cells;
+
+ // The reference is cleared on close, so a fresh Edit later opens a
+ // new dialog bound to the current cell.
+ editorUi.actionWindow.window.addListener('hide', function()
+ {
+ editorUi.actionWindow = null;
+ });
+ };
+
+ var current = editorUi.actionWindow;
+
+ if (current != null && current.window != null && current.window.isVisible())
+ {
+ // Edit… again for the same cells: bring the open editor back instead
+ // of stacking a duplicate.
+ if (LinkDialog.sameCells(current.cells, cells))
+ {
+ current.window.setVisible(true);
+ current.window.activate();
+ return;
+ }
+
+ // Another cell's link: the open editor is bound to the other cell's
+ // save callback, so refocusing it would save the edits onto the wrong
+ // cell (and silently dropped this Insert/Edit). Close it through its
+ // unsaved-changes prompt and open a fresh one for these cells — if the
+ // user keeps the open editor, nothing else happens.
+ if (current.requestClose != null)
+ {
+ current.requestClose(open);
+ return;
+ }
}
- editorUi.actionWindow = new CustomActionDialog(editorUi, currentValue, onSave);
- editorUi.actionWindow.window.addListener('hide', function()
+ open();
+};
+
+/**
+ * Returns true if both arrays hold the same cells in the same order.
+ */
+LinkDialog.sameCells = function(a, b)
+{
+ if (a == null || b == null || a.length != b.length)
{
- editorUi.actionWindow = null;
- });
+ return false;
+ }
+
+ for (var i = 0; i < a.length; i++)
+ {
+ if (a[i] != b[i])
+ {
+ return false;
+ }
+ }
+
+ return true;
};
/**
@@ -6765,6 +6809,10 @@ SelectorChips.create = function(graph, editorUi)
{
var v = getValue();
var count = (Array.isArray(v) && !isWildcard()) ? v.length : 0;
+ // Caller-provided suffix (the cells chip appends "+ Descendants"
+ // while the descendants toggle is on) so the state shows on the
+ // chip, not only as a checkmark in its menu.
+ var suffix = (typeof opts.suffix == 'function') ? (opts.suffix() || '') : '';
chip.textContent = '';
chip.classList.remove('geSelChipEmpty', 'geSelChipAll');
chip.title = '';
@@ -6772,7 +6820,7 @@ SelectorChips.create = function(graph, editorUi)
if (isWildcard())
{
chip.classList.add('geSelChipAll');
- mxUtils.write(chip, mxResources.get('allCells'));
+ mxUtils.write(chip, mxResources.get('allCells') + suffix);
}
else if (count == 0)
{
@@ -6781,13 +6829,13 @@ SelectorChips.create = function(graph, editorUi)
// here".
chip.classList.add('geSelChipEmpty');
mxUtils.write(chip,
- mxResources.get(emptyKey, null, emptyFallback));
+ mxResources.get(emptyKey, null, emptyFallback) + suffix);
}
else
{
mxUtils.write(chip, count + ' ' + (count == 1 ?
mxResources.get(singularKey, null, singularFallback) :
- mxResources.get(pluralKey, null, pluralFallback)));
+ mxResources.get(pluralKey, null, pluralFallback)) + suffix);
chip.title = v.join('\n');
}
};
@@ -7578,6 +7626,8 @@ SelectorChips.create = function(graph, editorUi)
// visible chip yet).
openTagPicker: openTagPicker,
openLayerPicker: openLayerPicker,
+ openPopover: openPopover,
+ openMenuPopover: openMenuPopover,
closePopover: function() {
if (openPopover._open != null) openPopover._open.close();
}
@@ -7744,14 +7794,21 @@ CustomActionDialog.SCHEMAS = {
{name: 'opacity', type: 'number', min: 0, max: 100, step: 10,
placeholder: '100', width: 50, label: '%',
titleKey: 'opacity', title: 'Opacity'}]},
+ // `styleKey: true` adds the style-key datalist and the "use selected
+ // cells" picker to the key field (createStyleKeyPicker in AnimationDialog).
style: {label: 'Set Style', icon: '🎨', selector: true, allowLayers: true,
fields: [{name: 'key', type: 'text', placeholder: 'flowAnimation',
- width: 90, label: '', title: 'Key'},
+ width: 90, label: '', title: 'Key', styleKey: true},
{name: 'value', type: 'text', placeholder: '1',
width: 50, label: '', title: 'Value'}]},
+ // Toggles key between value and defaultValue (an empty default removes
+ // the key so the stylesheet default applies); with value left empty the
+ // legacy 0 ↔ 1 boolean toggle runs (Graph.nextToggleStyleValue).
toggleStyle: {label: 'Toggle Style', icon: '🔀', selector: true, allowLayers: true,
fields: [{name: 'key', type: 'text', placeholder: 'flowAnimation',
- width: 90, label: '', title: 'Key'},
+ width: 90, label: '', title: 'Key', styleKey: true},
+ {name: 'value', type: 'text', placeholder: '1',
+ width: 50, label: '', title: 'Value'},
{name: 'defaultValue', type: 'text', placeholder: '0',
width: 50, label: '', title: 'Default value'}]},
flow: {label: 'Flow', icon: '➡', selector: true, allowLayers: true,
@@ -13024,6 +13081,11 @@ var AnimationDialog = function(editorUi, x, y, w, h, opts)
layerNames.join(', '));
}
+ if (sel.descendants === true)
+ {
+ parts.push(mxResources.get('descendants'));
+ }
+
return parts.join(', ') || '—';
};
@@ -13549,13 +13611,45 @@ var AnimationDialog = function(editorUi, x, y, w, h, opts)
}
});
+ // Toggle for `descendants`: the action also targets everything
+ // inside the resolved cells, looked up when it runs (see
+ // Graph.getCellsForAction) — so an effect on a group or container
+ // reaches its contents and follows children added later, which an
+ // explicit list cannot. Off, only the listed cells are affected.
+ var hasDescendants = function()
+ {
+ var s = data.steps[idx][key];
+ return s != null && typeof s == 'object' && s.descendants === true;
+ };
+
+ extraItems.push({
+ label: mxResources.get('descendants'),
+ active: hasDescendants(),
+ onClick: function()
+ {
+ var s = data.steps[idx][key];
+ if (!s || typeof s != 'object')
+ {
+ s = data.steps[idx][key] = {};
+ }
+ if (s.descendants === true) delete s.descendants;
+ else s.descendants = true;
+ refresh();
+ }
+ });
+
// Cells chip — hosts "Select layers" (when supported), "Select
- // by tags", and "Exclude selected cells" so the secondary
- // chips stay hidden until populated.
+ // by tags", "Exclude selected cells" and the descendants toggle so
+ // the secondary chips stay hidden until populated.
var cellsBind = bind('cells');
wrap.appendChild(selectorChips.cellListField('',
cellsBind.get, cellsBind.set,
- {allowWildcard: true, extraMenuItems: extraItems}));
+ {allowWildcard: true, extraMenuItems: extraItems,
+ suffix: function()
+ {
+ return (hasDescendants()) ?
+ ' + ' + mxResources.get('descendants') : '';
+ }}));
// Layers chip only when populated.
var layersValue = layersBind.get();
@@ -13710,6 +13804,105 @@ var AnimationDialog = function(editorUi, x, y, w, h, opts)
// Renders one schema field into the step row. Mirrors appendField in
// CustomActionDialog but uses the AnimationDialog's inline styling so
// the row layout stays tight and consistent with existing step types.
+ // Style-key fields (Set Style / Toggle Style, `styleKey: true` in the
+ // schema): a datalist of the common style keys named by their Format
+ // panel labels, and a "use selected cells" button that lists the
+ // selected cell's own style entries — picking one fills in the key and
+ // the value, so nobody has to look the key up via Edit Style.
+ var styleKeyList = null;
+
+ var fillStyleKeyList = function()
+ {
+ while (styleKeyList.firstChild != null)
+ {
+ styleKeyList.removeChild(styleKeyList.firstChild);
+ }
+
+ for (var i = 0; i < AnimationDialog.STYLE_KEYS.length; i++)
+ {
+ var entry = AnimationDialog.STYLE_KEYS[i];
+ var opt = document.createElement('option');
+ opt.value = entry.key;
+ opt.label = (typeof entry.label == 'function') ? entry.label() :
+ mxResources.get(entry.label, null, entry.fallback);
+ styleKeyList.appendChild(opt);
+ }
+ };
+
+ var getStyleKeyListId = function()
+ {
+ if (styleKeyList == null)
+ {
+ styleKeyList = document.createElement('datalist');
+ styleKeyList.id = 'geStyleKeys' + (++AnimationDialog.styleKeyListCount);
+ fillStyleKeyList();
+ div.appendChild(styleKeyList);
+ staticRefreshers.push(fillStyleKeyList);
+ }
+
+ return styleKeyList.id;
+ };
+
+ var createStyleKeyPicker = function(inp, idx, key)
+ {
+ inp.setAttribute('list', getStyleKeyListId());
+
+ var schema = CustomActionDialog.SCHEMAS[key];
+ var hasValue = false;
+
+ if (schema != null && Array.isArray(schema.fields))
+ {
+ for (var i = 0; i < schema.fields.length; i++)
+ {
+ hasValue = hasValue || schema.fields[i].name == 'value';
+ }
+ }
+
+ var btn = selectorChips.iconButton('arrowDown',
+ mxResources.get('useSelection'), function()
+ {
+ var cell = graph.getSelectionCell();
+ var pairs = (cell != null) ? AnimationDialog.getStylePairs(
+ graph.model.getStyle(cell)) : [];
+ var items = [];
+
+ if (pairs.length == 0)
+ {
+ items.push({label: mxResources.get((cell == null) ?
+ 'nothingIsSelected' : 'none'), disabled: true});
+ }
+
+ for (var i = 0; i < pairs.length; i++)
+ {
+ (function(pair)
+ {
+ items.push({label: pair.key + ' = ' + pair.value, onClick: function()
+ {
+ var s = data.steps[idx][key];
+
+ if (s == null || typeof s != 'object')
+ {
+ s = data.steps[idx][key] = {};
+ }
+
+ s.key = pair.key;
+
+ if (hasValue)
+ {
+ s.value = pair.value;
+ }
+
+ refresh();
+ }});
+ })(pairs[i]);
+ }
+
+ selectorChips.openMenuPopover(btn, items);
+ });
+
+ return btn;
+ };
+
var renderStepField = function(row, idx, key, spec, isPrimary, disabled)
{
// getter/setter for nested {key: {field: value}} (object actions)
@@ -13938,6 +14131,11 @@ var AnimationDialog = function(editorUi, x, y, w, h, opts)
inp.addEventListener('input', commit);
row.appendChild(inp);
+ if (spec.styleKey && !isPrimary)
+ {
+ row.appendChild(createStyleKeyPicker(inp, idx, key));
+ }
+
if (spec.label)
{
var lbl = document.createElement('span');
@@ -14643,8 +14841,15 @@ var AnimationDialog = function(editorUi, x, y, w, h, opts)
var startPreviewSession = function()
{
- if (previewSession != null) return;
- previewSession = new Editor.AnimationPlayer(graph, data);
+ if (previewSession == null)
+ {
+ previewSession = new Editor.AnimationPlayer(graph, data);
+ }
+
+ // Snapshot on every preview, not only the first: the player keeps
+ // the live steps, and snapshotOpacity only adds cells it has not
+ // recorded yet, so a step added or retargeted after the session
+ // started is restored by Reset and close as well.
previewSession.snapshotOpacity();
updateResetBtn();
};
@@ -14950,6 +15155,36 @@ var AnimationDialog = function(editorUi, x, y, w, h, opts)
}, mxResources.get('cancel'), mxResources.get('discardChanges'));
};
+ // Closes the dialog for a caller that wants a fresh one (Edit… on
+ // another cell's link while this action editor is open): the same
+ // discard prompt as the Cancel button when dirty, then `onClosed` once
+ // the window is hidden — never when the user keeps this dialog open.
+ this.requestClose = function(onClosed)
+ {
+ var finish = function()
+ {
+ thisDialog.window.setVisible(false);
+
+ if (onClosed != null)
+ {
+ onClosed();
+ }
+ };
+
+ if (dirty)
+ {
+ editorUi.confirm(mxResources.get('allChangesLost'), null, function()
+ {
+ setDirty(false);
+ finish();
+ }, mxResources.get('cancel'), mxResources.get('discardChanges'));
+ }
+ else
+ {
+ finish();
+ }
+ };
+
// Auto-save on close-X. mxWindow's close X calls setVisible(false)
// without going through our footer buttons; intercept here so that
// path saves first. Save / Cancel buttons drive their own flow
@@ -15061,6 +15296,72 @@ var AnimationDialog = function(editorUi, x, y, w, h, opts)
// between pages and cell actions. Holds deep clones; pasting clones again.
AnimationDialog.stepsClipboard = null;
+/**
+ * Counter for the ids of the per-dialog style-key datalists.
+ */
+AnimationDialog.styleKeyListCount = 0;
+
+/**
+ * Style keys offered by the Set Style / Toggle Style key fields, labelled
+ * with the Format panel resource (fallback English) so the panel's
+ * natural-language names map to the keys the actions need.
+ */
+AnimationDialog.STYLE_KEYS = [
+ {key: 'strokeWidth', label: 'linewidth', fallback: 'Linewidth'},
+ {key: 'strokeColor', label: 'strokeColor', fallback: 'Line Color'},
+ {key: 'fillColor', label: 'fillColor', fallback: 'Fill Color'},
+ {key: 'gradientColor', label: 'gradient', fallback: 'Gradient'},
+ {key: 'opacity', label: 'opacity', fallback: 'Opacity'},
+ {key: 'fontColor', label: 'fontColor', fallback: 'Font Color'},
+ {key: 'fontSize', label: 'fontSize', fallback: 'Font Size'},
+ {key: 'fontFamily', label: 'fontFamily', fallback: 'Font Family'},
+ {key: 'fontStyle', label: function()
+ {
+ return mxResources.get('font') + ': 1 ' + mxResources.get('bold') +
+ ', 2 ' + mxResources.get('italic') + ', 4 ' + mxResources.get('underline');
+ }},
+ {key: 'textOpacity', label: 'textOpacity', fallback: 'Text Opacity'},
+ {key: 'labelBackgroundColor', label: 'backgroundColor', fallback: 'Background Color'},
+ {key: 'labelBorderColor', label: 'borderColor', fallback: 'Border Color'},
+ {key: 'align', label: 'align', fallback: 'Align'},
+ {key: 'spacing', label: 'spacing', fallback: 'Spacing'},
+ {key: 'dashed', label: 'dashed', fallback: 'Dashed'},
+ {key: 'rounded', label: 'rounded', fallback: 'Rounded'},
+ {key: 'curved', label: 'curved', fallback: 'Curved'},
+ {key: 'startArrow', label: 'linestart', fallback: 'Line Start'},
+ {key: 'endArrow', label: 'lineend', fallback: 'Line End'},
+ {key: 'flowAnimation', label: 'flowAnimation', fallback: 'Flow Animation'},
+ {key: 'shadow', label: 'shadow', fallback: 'Shadow'},
+ {key: 'glass', label: 'glass', fallback: 'Glass'},
+ {key: 'sketch', label: 'sketch', fallback: 'Sketch'},
+ {key: 'comic', label: 'comic', fallback: 'Comic'},
+ {key: 'rotation', label: 'rotation', fallback: 'Rotation'},
+ {key: 'perimeterSpacing', label: 'perimeter', fallback: 'Perimeter'}
+];
+
+/**
+ * Returns the key=value entries of a raw cell style string as
+ * [{key, value}], skipping bare tokens such as the shape name.
+ */
+AnimationDialog.getStylePairs = function(style)
+{
+ var pairs = [];
+ var tokens = (style != null) ? String(style).split(';') : [];
+
+ for (var i = 0; i < tokens.length; i++)
+ {
+ var pos = tokens[i].indexOf('=');
+
+ if (pos > 0)
+ {
+ pairs.push({key: tokens[i].substring(0, pos),
+ value: tokens[i].substring(pos + 1)});
+ }
+ }
+
+ return pairs;
+};
+
/**
* Warning dialog shown when the GitLab server URL has been overridden via the
* ?gitlab= URL parameter but the deployment has not opted in to custom GitLab
diff --git a/src/main/webapp/js/diagramly/Editor.js b/src/main/webapp/js/diagramly/Editor.js
index 5971c3036..8a3a70d97 100644
--- a/src/main/webapp/js/diagramly/Editor.js
+++ b/src/main/webapp/js/diagramly/Editor.js
@@ -397,30 +397,30 @@
Editor.aiActions = ['createPublic', 'create', 'update', 'assist'];
/**
- * Specifies the ChatGPT API key. Default is null.
+ * Specifies the ChatGPT API key. Default is null. The API keys and the
+ * endpoint below are configuration-only (see Editor.configure) and must
+ * never be taken from URL parameters: a link could then point a request
+ * that carries the user's stored key, prompt and diagram at an endpoint
+ * of the sender's choosing, or make the user's prompts and diagrams go
+ * to the sender's own account via an injected key.
*/
- Editor.gptApiKey = (urlParams['gpt-api-key'] != null) ?
- decodeURIComponent(urlParams['gpt-api-key']) : null;
+ Editor.gptApiKey = null;
/**
* Specifies the Gemini API key. Default is null.
*/
- Editor.geminiApiKey = (urlParams['gemini-api-key'] != null) ?
- decodeURIComponent(urlParams['gemini-api-key']) : null;
+ Editor.geminiApiKey = null;
/**
- * Specifies the Gemini API key. Default is null.
+ * Specifies the Claude API key. Default is null.
*/
- Editor.claudeApiKey = (urlParams['claude-api-key'] != null) ?
- decodeURIComponent(urlParams['claude-api-key']) : null;
+ Editor.claudeApiKey = null;
/**
* Specifies the ChatGPT endpoint URL. Default is
* 'https://api.openai.com/v1/chat/completions'.
*/
- Editor.gptUrl = (urlParams['gpt-url'] != null) ?
- decodeURIComponent(urlParams['gpt-url']) :
- 'https://api.openai.com/v1/chat/completions';
+ Editor.gptUrl = 'https://api.openai.com/v1/chat/completions';
/**
* Available AI configurations.
@@ -10556,65 +10556,109 @@
state.style[key] = value;
}
- // `apply` reads styled props into the shape's cached
- // fields; `redraw` repaints. Same pair the regular
- // `setCellStyles` path uses inside its endUpdate hook.
- if (state.shape != null)
- {
- state.shape.apply(state);
- state.shape.redraw();
- }
-
- if (state.text != null)
- {
- state.text.apply(state);
- state.text.redraw();
- }
+ this.redrawTransientStyle(state);
}
}
};
/**
- * Transient style toggle — flips a key between `defaultValue` and its
- * opposite (typically '0' ↔ '1') on each cell's state.style without
- * model mutation. Same revert-on-refresh semantics as
- * setCellStylesTransient.
+ * Repaints a state after its state.style was mutated transiently — the
+ * same resetStyles + configure + redraw sequence mxCellRenderer runs for
+ * a model style change, so a removed key falls back to its default (a
+ * bare shape.apply keeps the previously painted field value, e.g. a
+ * toggled-off strokeWidth stayed at 10).
+ */
+ Graph.prototype.redrawTransientStyle = function(state)
+ {
+ if (state.shape != null)
+ {
+ state.shape.resetStyles();
+ this.cellRenderer.configureShape(state);
+ state.shape.redraw();
+ }
+
+ if (state.text != null)
+ {
+ state.text.resetStyles();
+ state.text.apply(state);
+ state.text.valign = this.getVerticalAlign(state);
+ state.text.redraw();
+ }
+ };
+
+ /**
+ * Returns the next style value for a toggleStyle step. With an explicit
+ * `value` the key flips between `value` and `defaultValue` (null removes
+ * the key so the stylesheet default applies — "strokeWidth 10" toggles
+ * 10 ↔ default, "fontStyle 2" italic ↔ plain). Without `value` it is the
+ * legacy boolean toggle: anything but a missing, empty, zero or 'false'
+ * value counts as on and flips to '0', otherwise '1'. (The old
+ * `truthy ? 0 : 1` test treated the string '0' as on, so a toggle on a
+ * missing key wrote 0 and never turned anything on.)
+ */
+ Graph.nextToggleStyleValue = function(current, value, defaultValue)
+ {
+ if (value != null && value !== '')
+ {
+ return (current != null && String(current) == String(value)) ?
+ defaultValue : value;
+ }
+
+ return (current != null && current !== '' && current != 0 &&
+ current !== 'false') ? '0' : '1';
+ };
+
+ /**
+ * Model-mutating toggle for the toggleStyle action — see
+ * Graph.nextToggleStyleValue for the value semantics. Like
+ * mxGraph.toggleCellStyles, the first cell decides the target state for
+ * all cells so a toggle link moves every cell in lockstep; `defaultValue`
+ * is what a missing key counts as.
*/
- Graph.prototype.toggleCellStylesTransient = function(key, defaultValue, cells)
+ Graph.prototype.toggleCellStyleValues = function(key, value, defaultValue, cells)
{
- if (defaultValue == null) defaultValue = '0';
+ if (cells != null && cells.length > 0)
+ {
+ var current = mxUtils.getValue(this.getCurrentCellStyle(cells[0]),
+ key, defaultValue);
+ this.setCellStyles(key, Graph.nextToggleStyleValue(
+ current, value, defaultValue), cells);
+ }
+ };
+ /**
+ * Transient style toggle — flips a key between `value` and
+ * `defaultValue` (or '0' ↔ '1' without a value, see
+ * Graph.nextToggleStyleValue) on each cell's state.style without model
+ * mutation. Same revert-on-refresh semantics as setCellStylesTransient.
+ */
+ Graph.prototype.toggleCellStylesTransient = function(key, defaultValue, cells, value)
+ {
for (var i = 0; i < cells.length; i++)
{
var state = this.view.getState(cells[i]);
if (state != null && state.style != null)
{
- // Match the model-mutating mxGraph.toggleCellStyles
- // semantics: truthy current → 0, falsy → 1 (so the key
- // flips between '0' and '1' across repeated calls).
// Unlike the model path — which reads the first cell's
// style and applies the same value to all cells — this
// path toggles each cell independently, which matches
// what users intuitively expect from a multi-select
// toggle. The model path keeps its legacy semantics
// when invoked via `transient: false`.
- var next = (mxUtils.getValue(state.style, key,
- defaultValue)) ? '0' : '1';
-
- state.style[key] = next;
+ var next = Graph.nextToggleStyleValue(mxUtils.getValue(
+ state.style, key, defaultValue), value, defaultValue);
- if (state.shape != null)
+ if (next == null || next === '')
{
- state.shape.apply(state);
- state.shape.redraw();
+ delete state.style[key];
}
-
- if (state.text != null)
+ else
{
- state.text.apply(state);
- state.text.redraw();
+ state.style[key] = next;
}
+
+ this.redrawTransientStyle(state);
}
}
};
@@ -10910,19 +10954,22 @@
if (action.toggleStyle != null && action.toggleStyle.key != null)
{
var toggleStyleCells = this.getCellsForAction(action.toggleStyle, true);
- var defValue = (action.toggleStyle.defaultValue != null) ?
- action.toggleStyle.defaultValue : '0';
+ // `value` toggles key ↔ value/defaultValue, without it the
+ // legacy boolean toggle runs (Graph.nextToggleStyleValue).
+ var toggleValue = action.toggleStyle.value;
+ var defValue = (action.toggleStyle.defaultValue !== '') ?
+ action.toggleStyle.defaultValue : null;
if (!isTransient(action.toggleStyle))
{
beginUpdate();
- this.toggleCellStyles(action.toggleStyle.key,
- defValue, toggleStyleCells);
+ this.toggleCellStyleValues(action.toggleStyle.key,
+ toggleValue, defValue, toggleStyleCells);
}
else
{
this.toggleCellStylesTransient(action.toggleStyle.key,
- defValue, toggleStyleCells);
+ defValue, toggleStyleCells, toggleValue);
}
}
@@ -11401,6 +11448,23 @@
merge(layerCells ? this.getLayerCells(action.layers) :
this.getCellsForLayers(action.layers));
+ // `descendants` adds every descendant of the resolved cells, looked
+ // up at execution time like `layers`, so an effect on a group or
+ // container reaches its contents — a group's own shape is invisible,
+ // so without it the effect shows nothing — including children added
+ // after the action was written, which an explicit list cannot
+ // follow. Without the flag only the listed cells are affected, so a
+ // container's frame can still be faded on its own.
+ if (action.descendants === true)
+ {
+ var listed = union.slice();
+
+ for (var i = 0; i < listed.length; i++)
+ {
+ merge(this.model.getDescendants(listed[i]));
+ }
+ }
+
// Final step: subtract every cell in `excludeCells` from the
// union. `'*'` in the exclude list means "exclude everything",
// which collapses the result to []. This mirrors the wildcard
@@ -13444,20 +13508,40 @@
/**
* Snapshots the DOM opacity of every cell referenced by any step so
- * stop() and the next loop iteration can restore it exactly.
+ * stop() and the next loop iteration can restore it exactly. An existing
+ * snapshot is extended, not replaced: nodes already recorded keep their
+ * first value, so a dialog preview session that snapshots again for
+ * steps added or retargeted since it started restores those cells too
+ * instead of leaving them faded (Kym, 2026-09-02).
*/
Editor.AnimationPlayer.prototype.snapshotOpacity = function()
{
var cells = this.collectReferencedCells();
var nodes = this.graph.getNodesForCells(cells);
- this.snapshot = [];
+ var recorded = new Set();
+
+ if (this.snapshot == null)
+ {
+ this.snapshot = [];
+ }
+ else
+ {
+ for (var i = 0; i < this.snapshot.length; i++)
+ {
+ recorded.add(this.snapshot[i].node);
+ }
+ }
for (var i = 0; i < nodes.length; i++)
{
- this.snapshot.push({
- node: nodes[i],
- opacity: nodes[i].style.opacity
- });
+ if (!recorded.has(nodes[i]))
+ {
+ recorded.add(nodes[i]);
+ this.snapshot.push({
+ node: nodes[i],
+ opacity: nodes[i].style.opacity
+ });
+ }
}
};
@@ -13587,7 +13671,17 @@
return;
}
- self.snapshotOpacity();
+ // A caller that seeded a snapshot owns the restore: the dialog's
+ // Preview button seeds an empty one so the restore-on-done below
+ // is a no-op and the canvas stays at the final state until Reset
+ // (the session snapshot restores it). Snapshotting here anyway
+ // undid every opacity effect the moment the last step finished.
+ // The loop restore nulls the snapshot, so a looping player still
+ // snapshots afresh on each pass.
+ if (self.snapshot == null)
+ {
+ self.snapshotOpacity();
+ }
runStep(0, function()
{
diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.js
index 21389f939..d589ae5c6 100644
--- a/src/main/webapp/js/diagramly/EditorUi.js
+++ b/src/main/webapp/js/diagramly/EditorUi.js
@@ -17258,6 +17258,18 @@
textInput.setAttribute('autocorrect', 'off');
textInput.setAttribute('autocapitalize', 'off');
textInput.setAttribute('spellcheck', 'false');
+
+ // Keeps the virtual keyboard out of the way on touch devices. Chromium on
+ // Android reacts to the focus of an editable element by showing the soft
+ // keyboard and, if a hardware keyboard is attached, by asynchronously
+ // scrolling the focused element into view. This moved the diagram to the
+ // top left corner whenever Ctrl was pressed on a tablet with a physical
+ // keyboard. inputmode="none" disables both (see also installTypingShim).
+ if (this.isVirtualKeyboardDevice())
+ {
+ textInput.setAttribute('inputmode', 'none');
+ }
+
textInput.style.textRendering = 'optimizeSpeed';
textInput.style.fontFamily = 'monospace';
textInput.style.wordBreak = 'break-all';
@@ -17267,7 +17279,7 @@
textInput.style.whiteSpace = 'nowrap';
textInput.style.overflow = 'hidden';
textInput.style.display = 'block';
- textInput.style.fontSize = '1';
+ textInput.style.fontSize = '1px';
textInput.style.zIndex = '-1';
textInput.style.resize = 'none';
textInput.style.outline = 'none';
@@ -17313,8 +17325,8 @@
graph.container.appendChild(textInput);
restoreFocus = true;
-
- textInput.focus();
+
+ textInput.focus({preventScroll: true});
document.execCommand('selectAll', false, null);
// Workaround for Safari 16 scroll after CMD key press
@@ -23112,24 +23124,65 @@
* Structural childLayouts (tables, stacks/pools, racks) are never
* replaced by a layout run.
*/
- EditorUi.prototype.getSelectedLayoutContainer = function()
+ EditorUi.prototype.getSelectedLayoutContainers = function()
{
var graph = this.editor.graph;
- var cell = (graph.getSelectionCount() == 1) ?
- graph.getSelectionCell() : null;
+ var cells = graph.getSelectionCells();
+ var result = [];
- if (cell != null && graph.model.isVertex(cell))
+ for (var i = 0; i < cells.length; i++)
{
- var childLayout = graph.getCellStyle(cell)['childLayout'];
+ if (graph.model.isVertex(cells[i]))
+ {
+ var childLayout = graph.getCellStyle(cells[i])['childLayout'];
+
+ if (childLayout != null && childLayout != 'tableLayout' &&
+ childLayout != 'stackLayout' && childLayout != 'rack')
+ {
+ result.push(cells[i]);
+ }
+ else
+ {
+ // Any other selected vertex keeps the legacy one-shot run
+ return [];
+ }
+ }
+ }
+
+ return result;
+ };
+
+ /**
+ * Rewrites the childLayout of every selected layout container (see
+ * getSelectedLayoutContainers) to the given spec in one undoable edit
+ * via setContainerChildLayout and returns true, or returns false when
+ * the selection holds no layout container so the caller runs its
+ * one-shot layout instead.
+ */
+ EditorUi.prototype.applyLayoutToSelectedContainers = function(spec)
+ {
+ var containers = this.getSelectedLayoutContainers();
- if (childLayout != null && childLayout != 'tableLayout' &&
- childLayout != 'stackLayout' && childLayout != 'rack')
+ if (containers.length == 0)
+ {
+ return false;
+ }
+
+ var model = this.editor.graph.model;
+ model.beginUpdate();
+ try
+ {
+ for (var i = 0; i < containers.length; i++)
{
- return cell;
+ this.setContainerChildLayout(containers[i], spec);
}
}
+ finally
+ {
+ model.endUpdate();
+ }
- return null;
+ return true;
};
/**
@@ -23227,9 +23280,21 @@
config.resizeLayoutRoot = true;
}
- if (entry.layout == 'elkLayered' && config.extractIsolated == null)
+ if (entry.layout == 'elkLayered')
{
- config.extractIsolated = false;
+ if (config.extractIsolated == null)
+ {
+ config.extractIsolated = false;
+ }
+
+ // Model order breaks crossing-minimization ties so
+ // inserts don't reshuffle the branches (see
+ // Menus.layoutContainers).
+ if (config['elk.layered.considerModelOrder.strategy'] == null)
+ {
+ config['elk.layered.considerModelOrder.strategy'] =
+ Menus.flowModelOrder;
+ }
}
// The manager's re-runs are deliberately non-enforcing for
@@ -23355,17 +23420,13 @@
{
editorUi.lastLayoutSpec = list;
- // A single selected layout container takes the spec as its
- // new childLayout instead of a one-shot run (same rule as
- // the Arrange > Layout menu items).
- var container = (retargetSelection) ?
- editorUi.getSelectedLayoutContainer() : null;
-
- if (container != null && Array.isArray(list) &&
- list.length > 0)
+ // Selected layout containers take the spec as their new
+ // childLayout instead of a one-shot run (same rule as the
+ // Arrange > Layout menu items).
+ if (retargetSelection && Array.isArray(list) &&
+ list.length > 0 &&
+ editorUi.applyLayoutToSelectedContainers(list))
{
- editorUi.setContainerChildLayout(container, list);
-
if (done != null)
{
done();
@@ -25428,18 +25489,12 @@
{
var list = JSON.parse(newValue);
- // A single selected layout container takes the list as
- // its new childLayout instead of a one-shot run (only
- // for arrays — other parsed JSON keeps the legacy
- // one-shot path and its error behavior).
- var container = this.getSelectedLayoutContainer();
-
- if (container != null && Array.isArray(list) &&
- list.length > 0)
- {
- this.setContainerChildLayout(container, list);
- }
- else
+ // Selected layout containers take the list as their new
+ // childLayout instead of a one-shot run (only for
+ // arrays — other parsed JSON keeps the legacy one-shot
+ // path and its error behavior).
+ if (!(Array.isArray(list) && list.length > 0 &&
+ this.applyLayoutToSelectedContainers(list)))
{
this.executeLayouts(this.editor.graph.createLayouts(list));
}
diff --git a/src/main/webapp/js/diagramly/ElkLayout.js b/src/main/webapp/js/diagramly/ElkLayout.js
index 54ab9cc37..435187d5a 100644
--- a/src/main/webapp/js/diagramly/ElkLayout.js
+++ b/src/main/webapp/js/diagramly/ElkLayout.js
@@ -79,16 +79,12 @@ ElkLayoutBindings.run = function(editorUi, algorithm, options, runOptions, done)
editorUi.lastLayoutSpec = [{layout: specName,
config: Graph.elkOptionsToConfig(options, runOptions)}];
- // A single selected layout container takes the run as its new
- // childLayout instead of a one-shot layout — the style write
- // re-runs the layout (setContainerChildLayout strips the dialog's
- // selection-as-root ids and pins the container defaults).
- var container = editorUi.getSelectedLayoutContainer();
-
- if (container != null)
+ // Selected layout containers take the run as their new childLayout
+ // instead of a one-shot layout — the style write re-runs the layout
+ // (setContainerChildLayout strips the dialog's selection-as-root ids
+ // and pins the container defaults).
+ if (editorUi.applyLayoutToSelectedContainers(editorUi.lastLayoutSpec))
{
- editorUi.setContainerChildLayout(container, editorUi.lastLayoutSpec);
-
if (done != null)
{
done();
@@ -282,8 +278,9 @@ ElkLayoutBindings.runWithDialog = function(editorUi, algorithm, baseOptions, dia
var sel = graph.getSelectionCells();
var maxRoots = ElkLayout.MAX_ROOTS[algorithm] || 0;
var rootCandidates = [];
- var layoutContainer = (typeof onApply === 'function') ?
- null : editorUi.getSelectedLayoutContainer();
+ var layoutContainers = (typeof onApply === 'function') ?
+ [] : editorUi.getSelectedLayoutContainers();
+ var layoutContainer = (layoutContainers.length > 0) ? layoutContainers[0] : null;
if (maxRoots > 0 && (typeof onApply === 'function' || layoutContainer == null))
{
diff --git a/src/main/webapp/js/diagramly/GraphViewer.js b/src/main/webapp/js/diagramly/GraphViewer.js
index c0a8626e0..c70890098 100644
--- a/src/main/webapp/js/diagramly/GraphViewer.js
+++ b/src/main/webapp/js/diagramly/GraphViewer.js
@@ -2795,13 +2795,13 @@ GraphViewer.getCss = function()
' background: light-dark(#ffffcc, ' + GraphViewer.darkBackgroundColor + ');',
' border-style: solid;',
' border-width: 1px;',
- ' border-color: black;',
+ ' border-color: light-dark(#000000, #565656);',
' font-family: ' + GraphViewer.cssFontFamily + ';',
' font-size: 8pt;',
' position: absolute;',
' cursor: default;',
' padding: 4px;',
- ' color: black;',
+ ' color: light-dark(#000000, #c0c0c0);',
'}',
'td.mxPopupMenuIcon div {',
' width: 16px;',
diff --git a/src/main/webapp/js/diagramly/Init.js b/src/main/webapp/js/diagramly/Init.js
index c80903574..2f768a086 100644
--- a/src/main/webapp/js/diagramly/Init.js
+++ b/src/main/webapp/js/diagramly/Init.js
@@ -394,20 +394,10 @@ window.uiTheme = window.uiTheme || (function()
}
}
- // Customizes export URL
- var ex = urlParams['export'];
-
- if (ex != null)
- {
- ex = decodeURIComponent(ex);
-
- if (ex.substring(0, 7) != 'http://' && ex.substring(0, 8) != 'https://')
- {
- ex = 'http://' + ex;
- }
-
- EXPORT_URL = ex;
- }
+ // The export service is not taken from the URL. The export request carries
+ // the diagram, so a link that picked the service would send the diagram to
+ // whoever wrote the link as soon as the user exported [GHSA-ff67-v9r9-6877].
+ // A deployment sets window.EXPORT_URL in PreConfig.js, which loads first.
// Customizes gitlab URL
var glUrl = urlParams['gitlab'];
@@ -480,6 +470,7 @@ if (urlParams['offline'] == '1' || urlParams['demo'] == '1' ||
urlParams['gh'] = '0';
urlParams['gl'] = '0';
urlParams['tr'] = '0';
+ urlParams['ms365'] = '0';
}
// Do not insert code between above and below blocks
@@ -491,6 +482,7 @@ if (window.location.hostname == 'se.diagrams.net')
urlParams['gh'] = '0';
urlParams['gl'] = '0';
urlParams['tr'] = '0';
+ urlParams['ms365'] = '0';
urlParams['plugins'] = '0';
urlParams['mode'] = 'google';
urlParams['lockdown'] = '1'; // Do not want to apply lockdown true to above block
diff --git a/src/main/webapp/js/diagramly/LibavoidRouting.js b/src/main/webapp/js/diagramly/LibavoidRouting.js
index 621d5cc0e..9a6ebcf53 100644
--- a/src/main/webapp/js/diagramly/LibavoidRouting.js
+++ b/src/main/webapp/js/diagramly/LibavoidRouting.js
@@ -143,14 +143,11 @@ LibavoidRouting.run = function(editorUi, opts, done)
editorUi.lastLayoutSpec = [spec];
- // A single selected layout container takes the run as its new
+ // Selected layout containers take the run as their new
// childLayout — live orthogonal routing of the container's edges —
// instead of a one-shot routing pass.
- var container = editorUi.getSelectedLayoutContainer();
-
- if (container != null)
+ if (editorUi.applyLayoutToSelectedContainers(editorUi.lastLayoutSpec))
{
- editorUi.setContainerChildLayout(container, editorUi.lastLayoutSpec);
finish(true);
return;
}
diff --git a/src/main/webapp/js/diagramly/Menus.js b/src/main/webapp/js/diagramly/Menus.js
index 69051330c..0bf5dc97a 100644
--- a/src/main/webapp/js/diagramly/Menus.js
+++ b/src/main/webapp/js/diagramly/Menus.js
@@ -33,6 +33,10 @@
// keeps the legacy margins if transparentBounds is ever toggled off.
// The ELK entries use the JSON childLayout form and run through the
// layout-manager path; see CLAUDE.md "ELK childLayout containers".
+ // ELK considerModelOrder strategy of the flow (elkLayered) containers:
+ // model order breaks crossing-minimization ties and never adds crossings.
+ Menus.flowModelOrder = 'NODES_AND_EDGES';
+
Menus.layoutContainers = (function()
{
var elkChildLayout = function(layout, config)
@@ -72,15 +76,22 @@
var topPad = '[top=40,left=20,bottom=20,right=20]';
var leftPad = '[top=20,left=40,bottom=20,right=20]';
+ // Flow containers keep the model order where crossing minimization
+ // has no preference (Menus.flowModelOrder), so a shape added to a
+ // branch stays where it was dropped instead of the branches being
+ // reshuffled on every insert — the layered counterpart of the
+ // geometry-based sibling order of the tree containers.
return {
horizontalFlow: entry(true, 460, 150, 'containerType=tree;' +
elkChildLayout('elkLayered', {'elk.direction': 'RIGHT',
'elk.layered.spacing.nodeNodeBetweenLayers': '50',
+ 'elk.layered.considerModelOrder.strategy': Menus.flowModelOrder,
'elk.padding': leftPad, edgeStyle: 'orthogonalEdgeStyle',
corners: 'rounded', extractIsolated: false})),
verticalFlow: entry(false, 270, 280, 'containerType=tree;' +
elkChildLayout('elkLayered', {'elk.direction': 'DOWN',
'elk.layered.spacing.nodeNodeBetweenLayers': '50',
+ 'elk.layered.considerModelOrder.strategy': Menus.flowModelOrder,
'elk.padding': topPad, edgeStyle: 'orthogonalEdgeStyle',
corners: 'rounded', extractIsolated: false})),
// edgeNode = half of nodeNode centers the shared tree-edge channel
@@ -1702,13 +1713,10 @@
{
editorUi.tryAndHandle(mxUtils.bind(this, function()
{
- // A single selected layout container takes circle as its new
+ // Selected layout containers take circle as their new
// childLayout (same value as Insert > Layout > Circle).
- var container = editorUi.getSelectedLayoutContainer();
-
- if (container != null)
+ if (editorUi.applyLayoutToSelectedContainers('circleLayout'))
{
- editorUi.setContainerChildLayout(container, 'circleLayout');
return;
}
@@ -1773,14 +1781,11 @@
editorUi.lastLayoutSpec = [{layout: 'mxParallelEdgeLayout',
config: {spacing: layout.spacing, checkOverlap: true}}];
- // A single selected layout container takes the run
- // as its new childLayout instead of a one-shot run.
- var container = editorUi.getSelectedLayoutContainer();
-
- if (container != null)
+ // Selected layout containers take the run as their
+ // new childLayout instead of a one-shot run.
+ if (editorUi.applyLayoutToSelectedContainers(
+ editorUi.lastLayoutSpec))
{
- editorUi.setContainerChildLayout(container,
- editorUi.lastLayoutSpec);
return;
}
diff --git a/src/main/webapp/js/diagramly/Trees.js b/src/main/webapp/js/diagramly/Trees.js
index fc419c2c4..678096cf8 100644
--- a/src/main/webapp/js/diagramly/Trees.js
+++ b/src/main/webapp/js/diagramly/Trees.js
@@ -192,6 +192,42 @@
return (cell != null) ? model.getParent(cell) : null;
};
+ // True if the given tree container runs a layered (flow) layout:
+ // the JSON childLayout decodes to elkLayered, or the legacy
+ // flowLayout string. Flow containers carry containerType=tree for
+ // the subtree delete/move semantics only — a flowchart has no
+ // siblings or parents to insert, so the hover arrows add a child
+ // connected from the hovered cell instead of following the tree
+ // rules (a perpendicular arrow used to add a sibling, ie. a second
+ // successor of the previous shape).
+ function isFlowContainer(container)
+ {
+ if (container != null)
+ {
+ var style = graph.getCurrentCellStyle(container);
+ var value = (style != null) ? style['childLayout'] : null;
+
+ if (value == 'flowLayout')
+ {
+ return true;
+ }
+
+ try
+ {
+ var list = Graph.decodeChildLayout(value);
+
+ return list != null && list.length > 0 && list[0] != null &&
+ list[0].layout == 'elkLayered';
+ }
+ catch (e)
+ {
+ // Malformed childLayout JSON is not a flow container
+ }
+ }
+
+ return false;
+ };
+
function hasLayoutParent(cell)
{
var result = false;
@@ -1395,7 +1431,8 @@
var h2 = direction == mxConstants.DIRECTION_EAST || direction == mxConstants.DIRECTION_WEST;
var result = null;
- if (dir == direction || edges.length == 0)
+ if (dir == direction || edges.length == 0 ||
+ isFlowContainer(model.getParent(source)))
{
result = addChild(source, direction, targetCell);
}
diff --git a/src/main/webapp/js/diagramly/sidebar/Sidebar-Advanced.js b/src/main/webapp/js/diagramly/sidebar/Sidebar-Advanced.js
index 081dc2db6..b039e92c0 100644
--- a/src/main/webapp/js/diagramly/sidebar/Sidebar-Advanced.js
+++ b/src/main/webapp/js/diagramly/sidebar/Sidebar-Advanced.js
@@ -34,7 +34,11 @@
// transparentBounds swimlane: the stored geometry stays pinned at
// (0,0,0,0) — the visible box is derived from the children plus
// groupPadding and the title bar (see Graph.getTransparentBounds).
- var container = new mxCell(title,
+ // The label names the container, not its layout: a layout run
+ // with the container selected replaces the live layout (see
+ // EditorUi.applyLayoutToSelectedContainers), so a layout-specific
+ // title would go stale.
+ var container = new mxCell('Layout Container',
new mxGeometry(0, 0, 0, 0), def.sidebarStyle);
container.vertex = true;
@@ -91,14 +95,17 @@
'horizontalTree',
[['Root', 40, 60], ['Child 1', 180, 20], ['Child 2', 180, 100]],
[[0, 1], [0, 2]]),
+ // Flow seeds list the tied siblings in the order ELK's model-order
+ // tie-break places them (first Task on top / left) so a drop
+ // converges without moving anything.
addLayoutContainerEntry('vertical flow layout', 'Vertical Flow Layout',
'verticalFlow',
- [['Start', 36.67, 40], ['Task', 150, 130], ['Task', 20, 130],
+ [['Start', 36.67, 40], ['Task', 20, 130], ['Task', 150, 130],
['End', 36.67, 220]],
[[0, 1], [0, 2], [1, 3], [2, 3]]),
addLayoutContainerEntry('horizontal flow layout', 'Horizontal Flow Layout',
'horizontalFlow',
- [['Start', 40, 26.67], ['Task', 190, 90], ['Task', 190, 20],
+ [['Start', 40, 26.67], ['Task', 190, 20], ['Task', 190, 90],
['End', 340, 26.67]],
[[0, 1], [0, 2], [1, 3], [2, 3]])
]);
diff --git a/src/main/webapp/js/elk/drawio-elk.min.js b/src/main/webapp/js/elk/drawio-elk.min.js
index 7280c3b90..21edec367 100644
--- a/src/main/webapp/js/elk/drawio-elk.min.js
+++ b/src/main/webapp/js/elk/drawio-elk.min.js
@@ -1,12 +1,12 @@
-/*! @drawio/elk 0.1.0+commit.ddfc94b (built 2026-08-27) */
+/*! @drawio/elk 0.1.0+commit.09eed5e (built 2026-09-11) */
var ELK=(()=>{var Pl=Object.defineProperty;var AO=Object.getOwnPropertyDescriptor;var CO=Object.getOwnPropertyNames;var xO=Object.prototype.hasOwnProperty;var zf=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),Yf=n=>{throw TypeError(n)};var DO=(n,t,e)=>t in n?Pl(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var mp=(n,t)=>{for(var e in t)Pl(n,e,{get:t[e],enumerable:!0})},wO=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of CO(t))!xO.call(n,r)&&r!==e&&Pl(n,r,{get:()=>t[r],enumerable:!(o=AO(t,r))||o.enumerable});return n};var MO=n=>wO(Pl({},"__esModule",{value:!0}),n);var Z=(n,t,e)=>DO(n,typeof t!="symbol"?t+"":t,e),Pp=(n,t,e)=>t.has(n)||Yf("Cannot "+e);var $i=(n,t,e)=>(Pp(n,t,"read from private field"),e?e.call(n):t.get(n)),Vf=(n,t,e)=>t.has(n)?Yf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Xf=(n,t,e,o)=>(Pp(n,t,"write to private field"),o?o.call(n,e):t.set(n,e),e);var bO=function(n,t){this[0]=n,this[1]=t};var nr=n=>{var t=n[zf("asyncIterator")],e=!1,o,r={};return t==null?(t=n[zf("iterator")](),o=i=>r[i]=s=>t[i](s)):(t=t.call(n),o=i=>r[i]=s=>{if(e){if(e=!1,i==="throw")throw s;return s}return e=!0,{done:!1,value:new bO(new Promise(a=>{var l=t[i](s);l instanceof Object||Yf("Object expected"),a(l)}),1)}}),r[zf("iterator")]=()=>r,o("next"),"throw"in t?o("throw"):r.throw=i=>{throw i},"return"in t&&o("return"),r};var DR={};mp(DR,{ElkAdapter:()=>_t,ElkApplier:()=>Rt,ElkLayout:()=>ht,default:()=>xR});var ge=class{constructor(){this._byId=null}setProperty(t,e){let o=Ol(t);return e==null?this._byId&&this._byId.delete(o):(this._byId||(this._byId=new Map),this._byId.set(o,{prop:t,value:e})),this}getProperty(t){let e=Ol(t);if(this._byId){let r=this._byId.get(e);if(r!==void 0)return r.value}let o=t.getDefault();return o!==null&&typeof o=="object"&&(typeof o.clone=="function"||o instanceof Set||o instanceof Map||Array.isArray(o))&&(this._byId||(this._byId=new Map),this._byId.set(e,{prop:t,value:o})),o}hasProperty(t){return this._byId!==null&&this._byId.has(Ol(t))}copyProperties(t){if(!t)return this;let e=t.getAllProperties();if(e.size>0){this._byId||(this._byId=new Map);for(let[o,r]of e)this._byId.set(Ol(o),{prop:o,value:r})}return this}getAllProperties(){if(!this._byId)return new Map;let t=new Map;for(let{prop:e,value:o}of this._byId.values())t.set(e,o);return t}};function Ol(n){return n==null?"":typeof n.getId=="function"?n.getId():n._id||n.id||""}var ui,vs,Ge=class extends Array{constructor(e,o){super();Vf(this,ui);Vf(this,vs);Xf(this,ui,e||null),Xf(this,vs,o||null)}static get[Symbol.species](){return Array}push(...e){for(let o of e)super.push(o),$i(this,ui)&&$i(this,ui).call(this,o);return this.length}splice(e,o,...r){let i=super.splice(e,o,...r);if($i(this,vs))for(let s of i)$i(this,vs).call(this,s);if($i(this,ui))for(let s of r)$i(this,ui).call(this,s);return i}add(e){return this.push(e),this}remove(e){let o=this.indexOf(e);return o>=0&&this.splice(o,1),this}isEmpty(){return this.length===0}clear(){this.splice(0,this.length)}get(e){return this[e]}};ui=new WeakMap,vs=new WeakMap;var qi=class extends ge{constructor(){super(),this.identifier=null,this.labels=new Ge(t=>{t._parent!==this&&(t._parent=this)},t=>{t._parent===this&&(t._parent=null)})}getIdentifier(){return this.identifier}setIdentifier(t){this.identifier=t}getLabels(){return this.labels}};var Ji=class extends qi{constructor(){super(),this.x=0,this.y=0,this.width=0,this.height=0}getX(){return this.x}setX(t){this.x=t}getY(){return this.y}setY(t){this.y=t}getWidth(){return this.width}setWidth(t){this.width=t}getHeight(){return this.height}setHeight(t){this.height=t}setLocation(t,e){this.x=t,this.y=e}setDimensions(t,e){this.width=t,this.height=e}};var Qi=class extends Ji{constructor(){super(),this.outgoingEdges=new Ge(t=>{t.sources.includes(this)||t.sources.push(this)},t=>{t.sources.remove(this)}),this.incomingEdges=new Ge(t=>{t.targets.includes(this)||t.targets.push(this)},t=>{t.targets.remove(this)})}getOutgoingEdges(){return this.outgoingEdges}getIncomingEdges(){return this.incomingEdges}};var Or=class extends Qi{constructor(){super(),this._parent=null,this.children=new Ge(t=>{t._parent!==this&&(t._parent=this)},t=>{t._parent===this&&(t._parent=null)}),this.ports=new Ge(t=>{t._parent!==this&&(t._parent=this)},t=>{t._parent===this&&(t._parent=null)}),this.containedEdges=new Ge(t=>{t._containingNode!==this&&(t._containingNode=this)},t=>{t._containingNode===this&&(t._containingNode=null)})}getParent(){return this._parent}setParent(t){if(this._parent===t)return;let e=this._parent;this._parent=t,e!==null&&e.children.remove(this),t!==null&&!t.children.includes(this)&&t.children.push(this)}get parent(){return this._parent}set parent(t){this.setParent(t)}getChildren(){return this.children}getPorts(){return this.ports}getContainedEdges(){return this.containedEdges}isHierarchical(){return this.children.length>0}};var Ve=class extends Qi{constructor(){super(),this._parent=null}getParent(){return this._parent}setParent(t){if(this._parent===t)return;let e=this._parent;this._parent=t,e!==null&&e.ports.remove(this),t!==null&&!t.ports.includes(this)&&t.ports.push(this)}get parent(){return this._parent}set parent(t){this.setParent(t)}};var Bs=class extends qi{constructor(){super(),this._containingNode=null,this.sources=new Ge(t=>{t.outgoingEdges.includes(this)||t.outgoingEdges.push(this)},t=>{t.outgoingEdges.remove(this)}),this.targets=new Ge(t=>{t.incomingEdges.includes(this)||t.incomingEdges.push(this)},t=>{t.incomingEdges.remove(this)}),this.sections=new Ge(t=>{t._parent!==this&&(t._parent=this)},t=>{t._parent===this&&(t._parent=null)})}getContainingNode(){return this._containingNode}setContainingNode(t){if(this._containingNode===t)return;let e=this._containingNode;this._containingNode=t,e!==null&&e.containedEdges.remove(this),t!==null&&!t.containedEdges.includes(this)&&t.containedEdges.push(this)}getSources(){return this.sources}getTargets(){return this.targets}getSections(){return this.sections}isHyperedge(){return this.sources.length>1||this.targets.length>1}isConnected(){return this.sources.length>0&&this.targets.length>0}isSelfloop(){if(!this.isConnected())return!1;let t=[...this.sources,...this.targets],e=Sl(t[0]);return t.every(o=>Sl(o)===e)}isHierarchical(){var o,r;let t=[...this.sources,...this.targets];if(t.length===0)return!1;let e=(r=(o=Sl(t[0]))==null?void 0:o.parent)!=null?r:null;return!t.every(i=>{var s,a;return((a=(s=Sl(i))==null?void 0:s.parent)!=null?a:null)===e})}};function Sl(n){var t;return n?n.children!==void 0?n:(t=n.parent)!=null?t:null:null}var Vr=class extends ge{constructor(){super(),this.identifier=null,this.startX=0,this.startY=0,this.endX=0,this.endY=0,this.bendPoints=[],this._parent=null,this.incomingShape=null,this.outgoingShape=null,this.outgoingSections=new Ge(t=>{t.incomingSections.includes(this)||t.incomingSections.push(this)},t=>{t.incomingSections.remove(this)}),this.incomingSections=new Ge(t=>{t.outgoingSections.includes(this)||t.outgoingSections.push(this)},t=>{t.outgoingSections.remove(this)})}getIdentifier(){return this.identifier}setIdentifier(t){this.identifier=t}getStartX(){return this.startX}setStartX(t){this.startX=t}getStartY(){return this.startY}setStartY(t){this.startY=t}getEndX(){return this.endX}setEndX(t){this.endX=t}getEndY(){return this.endY}setEndY(t){this.endY=t}setStartLocation(t,e){this.startX=t,this.startY=e}setEndLocation(t,e){this.endX=t,this.endY=e}getBendPoints(){return this.bendPoints}getParent(){return this._parent}setParent(t){if(this._parent===t)return;let e=this._parent;this._parent=t,e!==null&&e.sections.remove(this),t!==null&&!t.sections.includes(this)&&t.sections.push(this)}getIncomingShape(){return this.incomingShape}setIncomingShape(t){this.incomingShape=t}getOutgoingShape(){return this.outgoingShape}setOutgoingShape(t){this.outgoingShape=t}getOutgoingSections(){return this.outgoingSections}getIncomingSections(){return this.incomingSections}};var Xr=class{constructor(t=0,e=0){this.x=t,this.y=e}getX(){return this.x}setX(t){this.x=t}getY(){return this.y}setY(t){this.y=t}set(t,e){this.x=t,this.y=e}toString(){return`(${this.x}, ${this.y})`}};var Us=class extends Ji{constructor(){super(),this.text="",this._parent=null}getText(){return this.text}setText(t){this.text=t}getParent(){return this._parent}setParent(t){if(this._parent===t)return;let e=this._parent;this._parent=t,e!==null&&e.labels.remove(this),t!==null&&!t.labels.includes(this)&&t.labels.push(this)}get parent(){return this._parent}set parent(t){this.setParent(t)}};function Oa(){return Fs(null)}function Fs(n){let t=new Or;return n!==null&&t.setParent(n),t}function Kf(n){let t=new Ve;return n!==null&&t.setParent(n),t}function Tl(n){let t=new Us;return n!==null&&t.setParent(n),t}function Sp(n){let t=new Bs;return n!==null&&t.setContainingNode(n),t}function Zf(n,t){if(n==null)throw new Error("source cannot be null");if(t==null)throw new Error("target cannot be null");let e=Sp(null);return e.sources.push(n),e.targets.push(t),Tp(e),e}function Nl(n){let t=new Vr;return n!==null&&n.sections.push(t),t}function ar(n,t,e){if(n.sections.isEmpty())return Nl(n);let o=n.sections[0];if(t&&(o.bendPoints.length=0,o.setStartLocation(0,0),o.setEndLocation(0,0)),e)for(;n.sections.length>1;)n.sections.splice(n.sections.length-1,1);return o}function Sa(n,t,e){let o=new Xr(t,e);return n!==null&&n.bendPoints.push(o),o}function Tp(n){if(n==null)throw new Error("edge cannot be null");n.setContainingNode(Np(n))}function Np(n){var r,i;if(n==null)throw new Error("edge cannot be null");let t=n.sources.length+n.targets.length;if(t===0)throw new Error("The edge must have at least one source or target.");if(t===1){let s=n.sources.length===0?n.targets[0]:n.sources[0];return(i=(r=Pt(s))==null?void 0:r.parent)!=null?i:null}if(n.sources.length===1&&n.targets.length===1){let s=Pt(n.sources[0]),a=Pt(n.targets[0]);if(s&&a){if(s.parent===a.parent)return s.parent;if(s===a.parent)return s;if(a===s.parent)return a}}let e=[...n.sources,...n.targets],o=Pt(e[0]);for(let s=1;s<e.length;s++){let a=Pt(e[s]);if(a!==o&&!mo(a,o)){if(a.parent===o.parent)o=a.parent;else if(o=yp(o,a),o===null)return null}}return o}function yp(n,t){let e=Op(n),o=Op(t),r=null,i=e.length-1,s=o.length-1;for(;i>=0&&s>=0&&e[i]===o[s];)r=e[i],i--,s--;return r}function Op(n){let t=[],e=n;for(;e!==null;)t.push(e),e=e.parent;return t}function _i(n){let t=[...n.incomingEdges];for(let e of n.ports)for(let o of e.incomingEdges)t.push(o);return t}function Ee(n){let t=[...n.outgoingEdges];for(let e of n.ports)for(let o of e.outgoingEdges)t.push(o);return t}function Ta(n){return[...n.incomingEdges,...n.outgoingEdges]}function mo(n,t){let e=n.parent;for(;e!==null;){if(e===t)return!0;e=e.parent}return!1}function Pt(n){if(n==null)throw new Error("connectableShape cannot be null");if(n instanceof Or)return n;if(n instanceof Ve)return n.parent;throw new Error("Only nodes and ports are supported as connectable shapes.")}function yl(n){if(n==null)throw new Error("connectableShape cannot be null");return n instanceof Ve?n:null}function ks(n){return Ip(n),Pt(n.sources[0])}function Na(n){return Ip(n),Pt(n.targets[0])}function Ip(n){if(n.sources.length!==1||n.targets.length!==1)throw new Error("Passed edge is not 'simple' (must have exactly 1 source and 1 target).")}var Gt=class n{constructor(t,e){this.first=t!==void 0?t:null,this.second=e!==void 0?e:null}static create(){return new n}static of(t,e){return new n(t,e)}static fromMap(t){let e=[];for(let[o,r]of t)e.push(new n(o,r));return e}getFirst(){return this.first}setFirst(t){this.first=t}getSecond(){return this.second}setSecond(t){this.second=t}clear(){this.first=null,this.second=null}equals(t){if(t instanceof n){let e=this.first===null?t.first===null:this.first===t.first,o=this.second===null?t.second===null:this.second===t.second;return e&&o}return!1}toString(){return this.first===null&&this.second===null?"pair(null,null)":this.first===null?`pair(null,${this.second})`:this.second===null?`pair(${this.first},null)`:`pair(${this.first},${this.second})`}[Symbol.iterator](){let t=0,e=this;return{next(){return t===0&&e.first!==null?(t++,{value:e.first,done:!1}):t<=1&&e.second!==null?(t=2,{value:e.second,done:!1}):{value:void 0,done:!0}}}}};var zs=class n{constructor(t){this._id=t.id||"",this._name=t.name||"",this._description=t.description||"",this._layouters=[]}getId(){return this._id}getName(){return this._name}getDescription(){return this._description}getLayouters(){return this._layouters}equals(t){return t instanceof n?this._id===t._id:!1}toString(){return`Layout Type: ${this._id}`}},jf=class{constructor(){this._id="",this._name="",this._description=""}create(){return new zs({id:this._id,name:this._name,description:this._description})}id(t){return this._id=t,this}name(t){return this._name=t,this}description(t){return this._description=t,this}};zs.Builder=jf;var Ht=class n{constructor(){this._algorithmMap=new Map,this._optionMap=new Map,this._legacyOptionMap=new Map,this._categoryMap=new Map,this._algorithmSuffixMap=new Map,this._optionSuffixMap=new Map}static getInstance(){return n._instance||(n._instance=new n),n._instance}static bootstrap(...t){let e=n.getInstance();return e.registerLayoutMetaDataProviders(...t),e}static unload(){if(n._instance){for(let t of n._instance._algorithmMap.values())typeof t.getInstancePool=="function"&&t.getInstancePool().clear();n._instance=null}}registerLayoutMetaDataProviders(...t){for(let e of t){let o=new $f(this);e.apply(o),o._applyDependencies()}this._optionSuffixMap.clear()}getAlgorithmData(t){return this._algorithmMap.get(t)||null}getAlgorithmDataAll(){return Array.from(this._algorithmMap.values())}getAlgorithmDataBySuffix(t){if(!t||t.trim()==="")return null;let e=this._algorithmSuffixMap.get(t);if(e!==void 0)return e;let o=null;for(let r of this._algorithmMap.values()){let i=r.getId();if(i.endsWith(t)&&(t.length===i.length||i[i.length-t.length-1]===".")){if(o!==null)return null;o=r}}return o!==null&&this._algorithmSuffixMap.set(t,o),o}getAlgorithmDataBySuffixOrDefault(t,e){if(t&&t.trim()!==""){let o=this.getAlgorithmDataBySuffix(t);if(o!==null)return o}return e&&e.trim()!==""?this.getAlgorithmDataBySuffix(e):null}getOptionData(t){return this._optionMap.get(t)||this._legacyOptionMap.get(t)||null}getOptionDataAll(){return Array.from(this._optionMap.values())}getOptionDataBySuffix(t){if(!t||t.trim()==="")return null;let e=this._optionSuffixMap.get(t);if(e!==void 0)return e;let o=null;for(let r of this._optionMap.values()){let i=r.getId();if(i.endsWith(t)&&(t.length===i.length||i[i.length-t.length-1]===".")){if(o!==null)return null;o=r}}if(o===null)t:for(let r of this._optionMap.values()){let i=r.getLegacyIds();if(i){for(let s of i)if(s.endsWith(t)&&(t.length===s.length||s[s.length-t.length-1]===".")){if(o!==null)return null;o=r;continue t}}}return o!==null&&this._optionSuffixMap.set(t,o),o}getOptionDataForAlgorithm(t,e){let o=[];for(let r of this._optionMap.values())t.knowsOption(r)&&r.getTargets().has(e)&&o.push(r);return o}getCategoryData(t){return this._categoryMap.get(t)||null}getCategoryDataAll(){return Array.from(this._categoryMap.values())}_getOrCreateBackupCategory(){let t=this._categoryMap.get("");return t||(t=new zs.Builder().id("").name("Other").create(),this._categoryMap.set("",t)),t}};Ht._instance=null;var $f=class{constructor(t){this._service=t,this._optionDependencies=[],this._optionSupport=[]}register(t){if(!(!t||typeof t.getId!="function"))if(typeof t.knowsOption=="function")this._service._algorithmMap.set(t.getId(),t),this._service._algorithmSuffixMap.clear();else if(typeof t.getType=="function"){let e=t.getId();this._service._optionMap.set(e,t);let o=t.getLegacyIds();if(o)for(let r of o)this._service._legacyOptionMap.set(r,t)}else this._service._categoryMap.set(t.getId(),t)}addDependency(t,e,o){this._optionDependencies.push({firstId:t,secondId:e,value:o})}addOptionSupport(t,e,o){this._optionSupport.push({firstId:t,secondId:e,value:o})}_applyDependencies(){for(let t of this._service._algorithmMap.values()){let e=t.getCategoryId()||"",o=this._service.getCategoryData(e);o===null&&e===""&&(o=this._service._getOrCreateBackupCategory()),o!==null&&!o.getLayouters().includes(t)&&o.getLayouters().push(t)}for(let t of this._optionDependencies){let e=this._service.getOptionData(t.firstId),o=this._service.getOptionData(t.secondId);e&&o&&e.getDependencies().push(Gt.of(o,t.value))}this._optionDependencies.length=0;for(let t of this._optionSupport){let e=this._service.getAlgorithmData(t.firstId),o=this._service.getOptionData(t.secondId);e&&o&&e.addKnownOption(o,t.value)}this._optionSupport.length=0}};var Rp=Object.freeze({compareTo(n){return-1},toString(){return"-\u221E"}}),Lp=Object.freeze({compareTo(n){return 1},toString(){return"+\u221E"}}),ts=class ts{constructor(t,e=null,o=null,r=null){this._id=t,this._defaultValue=e,this._lowerBound=o!==null?o:Rp,this._upperBound=r!==null?r:Lp,t&&!ts._byId.has(t)&&ts._byId.set(t,this)}static byId(t){return ts._byId.get(t)||null}static bySuffix(t){if(!t)return null;let e=null;for(let[o,r]of ts._byId){if(o===t)return r;if(o.endsWith(t)&&o[o.length-t.length-1]==="."){if(e!==null)return null;e=r}}return e}getId(){return this._id}getDefault(){let t=this._defaultValue;return typeof t=="function"&&(t=t()),t===null||typeof t!="object"?t:typeof t.clone=="function"?t.clone():t instanceof Set?new Set(t):t instanceof Map?new Map(t):Array.isArray(t)?[...t]:t}getLowerBound(){return this._lowerBound}getUpperBound(){return this._upperBound}equals(t){return t&&typeof t.getId=="function"?this._id===t.getId():!1}compareTo(t){return this._id<t.getId()?-1:this._id>t.getId()?1:0}toString(){return this._id}};Z(ts,"_byId",new Map);var m=ts;var wt={};mp(wt,{ALGORITHM:()=>mi,ALGORITHM_BOX:()=>GS,ALGORITHM_FIXED:()=>Yp,ALGORITHM_RANDOM:()=>HS,ALIGNMENT:()=>XO,ANIMATE:()=>PS,ANIM_TIME_FACTOR:()=>OS,ASPECT_RATIO:()=>KO,BEND_POINTS:()=>Cl,BOX_PACKING_MODE:()=>Il,CATEGORY_CIRCLE:()=>DS,CATEGORY_FORCE:()=>xS,CATEGORY_LAYERED:()=>AS,CATEGORY_ORTHOGONAL:()=>CS,CATEGORY_PLANAR:()=>MS,CATEGORY_RADIAL:()=>bS,CATEGORY_TREE:()=>wS,CHILD_AREA_HEIGHT:()=>Ei,CHILD_AREA_WIDTH:()=>pi,COMMENT_BOX:()=>nS,CONTENT_ALIGNMENT:()=>Rl,DEBUG_MODE:()=>Ks,DIRECTION:()=>lr,EDGE_LABELS_INLINE:()=>Ou,EDGE_LABELS_PLACEMENT:()=>Aa,EDGE_ROUTING:()=>cu,EDGE_THICKNESS:()=>ES,EDGE_TYPE:()=>mS,EXPAND_NODES:()=>Ll,FONT_NAME:()=>aS,FONT_SIZE:()=>lS,HIERARCHY_HANDLING:()=>yr,HYPERNODE:()=>cS,INSIDE_SELF_LOOPS_ACTIVATE:()=>ls,INSIDE_SELF_LOOPS_YO:()=>Ca,INTERACTIVE:()=>zo,INTERACTIVE_LAYOUT:()=>ZO,JSON_EDGE_COORDS:()=>$O,JSON_SHAPE_COORDS:()=>jO,JUNCTION_POINTS:()=>gr,LABEL_MANAGER:()=>gS,LAYOUT_ANCESTORS:()=>SS,MARGINS:()=>Nr,MAX_ANIM_TIME:()=>TS,MIN_ANIM_TIME:()=>NS,NODE_LABELS_PADDING:()=>pu,NODE_LABELS_PLACEMENT:()=>Kr,NODE_SIZE_CONSTRAINTS:()=>Mo,NODE_SIZE_FIXED_GRAPH_SIZE:()=>To,NODE_SIZE_MINIMUM:()=>Yo,NODE_SIZE_OPTIONS:()=>Oo,NO_LAYOUT:()=>bl,OMIT_NODE_MICRO_LAYOUT:()=>So,PADDING:()=>ns,PARTITIONING_ACTIVATE:()=>iS,PARTITIONING_PARTITION:()=>rS,PORT_ALIGNMENT_DEFAULT:()=>Eu,PORT_ALIGNMENT_EAST:()=>Ml,PORT_ALIGNMENT_NORTH:()=>xl,PORT_ALIGNMENT_SOUTH:()=>Dl,PORT_ALIGNMENT_WEST:()=>wl,PORT_ANCHOR:()=>au,PORT_BORDER_OFFSET:()=>Ke,PORT_CONSTRAINTS:()=>cr,PORT_INDEX:()=>Gl,PORT_LABELS_NEXT_TO_PORT_IF_POSSIBLE:()=>Hl,PORT_LABELS_PLACEMENT:()=>Ir,PORT_LABELS_TREAT_AS_GROUP:()=>Su,PORT_SIDE:()=>Tr,POSITION:()=>ho,PRIORITY:()=>mu,PROGRESS_BAR:()=>yS,RANDOM_SEED:()=>Pu,RESOLVED_ALGORITHM:()=>ss,SCALE_FACTOR:()=>lu,SEPARATE_CONNECTED_COMPONENTS:()=>sS,SOFTWRAPPING_FUZZINESS:()=>hS,SPACING_COMMENT_COMMENT:()=>qO,SPACING_COMMENT_NODE:()=>JO,SPACING_COMPONENT_COMPONENT:()=>QO,SPACING_EDGE_EDGE:()=>tS,SPACING_EDGE_LABEL:()=>gu,SPACING_EDGE_NODE:()=>eS,SPACING_INDIVIDUAL:()=>as,SPACING_LABEL_LABEL:()=>hu,SPACING_LABEL_NODE:()=>Zs,SPACING_LABEL_PORT_HORIZONTAL:()=>du,SPACING_LABEL_PORT_VERTICAL:()=>fu,SPACING_NODE_NODE:()=>Pi,SPACING_NODE_SELF_LOOP:()=>oS,SPACING_PORTS_SURROUNDING:()=>_u,SPACING_PORT_PORT:()=>uu,TOPDOWN_HIERARCHICAL_NODE_ASPECT_RATIO:()=>zp,TOPDOWN_HIERARCHICAL_NODE_WIDTH:()=>Wp,TOPDOWN_LAYOUT:()=>js,TOPDOWN_NODE_TYPE:()=>_S,TOPDOWN_SCALE_CAP:()=>pS,TOPDOWN_SCALE_FACTOR:()=>kp,TOPDOWN_SIZE_APPROXIMATOR:()=>uS,TOPDOWN_SIZE_CATEGORIES:()=>dS,TOPDOWN_SIZE_CATEGORIES_HIERARCHICAL_NODE_WEIGHT:()=>fS,VALIDATE_GRAPH:()=>IS,VALIDATE_OPTIONS:()=>RS,ZOOM_TO_FIT:()=>LS});var Kt=Object.freeze({AUTOMATIC:"AUTOMATIC",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP",BOTTOM:"BOTTOM",CENTER:"CENTER",values(){return[this.AUTOMATIC,this.LEFT,this.RIGHT,this.TOP,this.BOTTOM,this.CENTER]},valueOf(n){return this[n]}});var he=Object.freeze({V_TOP:"V_TOP",V_CENTER:"V_CENTER",V_BOTTOM:"V_BOTTOM",H_LEFT:"H_LEFT",H_CENTER:"H_CENTER",H_RIGHT:"H_RIGHT",centerCenter(){return new Set([he.V_CENTER,he.H_CENTER])},topLeft(){return new Set([he.V_TOP,he.H_LEFT])},bottomRight(){return new Set([he.V_BOTTOM,he.H_RIGHT])},topCenter(){return new Set([he.V_TOP,he.H_CENTER])},values(){return[this.V_TOP,this.V_CENTER,this.V_BOTTOM,this.H_LEFT,this.H_CENTER,this.H_RIGHT]},valueOf(n){return this[n]}});var Yt=class Yt{constructor(t){this.name=t,Object.freeze(this)}isHorizontal(){return this===Yt.LEFT||this===Yt.RIGHT}isVertical(){return this===Yt.UP||this===Yt.DOWN}opposite(){switch(this){case Yt.LEFT:return Yt.RIGHT;case Yt.RIGHT:return Yt.LEFT;case Yt.UP:return Yt.DOWN;case Yt.DOWN:return Yt.UP;default:return Yt.UNDEFINED}}toString(){return this.name}static values(){return[Yt.UNDEFINED,Yt.RIGHT,Yt.LEFT,Yt.DOWN,Yt.UP]}static valueOf(t){return Yt[t]}};Z(Yt,"UNDEFINED",new Yt("UNDEFINED")),Z(Yt,"RIGHT",new Yt("RIGHT")),Z(Yt,"LEFT",new Yt("LEFT")),Z(Yt,"DOWN",new Yt("DOWN")),Z(Yt,"UP",new Yt("UP"));var R=Yt;var Ap=Object.freeze({INHERIT:"INHERIT",CONTAINER:"CONTAINER",PARENT:"PARENT",ROOT:"ROOT",values(){return[this.INHERIT,this.CONTAINER,this.PARENT,this.ROOT]},valueOf(n){return this[n]}});var Po=class Po{constructor(t){this.name=t,Object.freeze(this)}isEndLabelPlacement(){return this===Po.HEAD||this===Po.TAIL}toString(){return this.name}static values(){return[Po.CENTER,Po.HEAD,Po.TAIL]}static valueOf(t){return Po[t]}};Z(Po,"CENTER",new Po("CENTER")),Z(Po,"HEAD",new Po("HEAD")),Z(Po,"TAIL",new Po("TAIL"));var St=Po;var At=Object.freeze({UNDEFINED:"UNDEFINED",POLYLINE:"POLYLINE",ORTHOGONAL:"ORTHOGONAL",SPLINES:"SPLINES",values(){return[this.UNDEFINED,this.POLYLINE,this.ORTHOGONAL,this.SPLINES]},valueOf(n){return this[n]}});var Cp=Object.freeze({NONE:"NONE",DIRECTED:"DIRECTED",UNDIRECTED:"UNDIRECTED",ASSOCIATION:"ASSOCIATION",GENERALIZATION:"GENERALIZATION",DEPENDENCY:"DEPENDENCY",values(){return[this.NONE,this.DIRECTED,this.UNDIRECTED,this.ASSOCIATION,this.GENERALIZATION,this.DEPENDENCY]},valueOf(n){return this[n]}});var Ys=class n{constructor(t=0,e=0,o=0,r=0){this.top=0,this.bottom=0,this.left=0,this.right=0,arguments.length>0&&this.set(t,e,o,r)}set(t,e,o,r){typeof t=="object"?(this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left):(this.top=t,this.right=e,this.bottom=o,this.left=r)}getTop(){return this.top}setTop(t){this.top=t}getRight(){return this.right}setRight(t){this.right=t}getBottom(){return this.bottom}setBottom(t){this.bottom=t}getLeft(){return this.left}setLeft(t){this.left=t}setLeftRight(t){this.left=t,this.right=t}setTopBottom(t){this.top=t,this.bottom=t}getHorizontal(){return this.left+this.right}getVertical(){return this.top+this.bottom}equals(t){return t instanceof n?this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right:!1}toString(){return`[top=${this.top},left=${this.left},bottom=${this.bottom},right=${this.right}]`}parse(t){let e=0;for(;e<t.length&&n._isdelim(t[e],`([{"' \r
`);)e++;let o=t.length;for(;o>0&&n._isdelim(t[o-1],`)]}"' \r
`);)o--;if(e<o){let r=t.substring(e,o).split(/,|;/);for(let i of r){let s=i.split("=");if(s.length!==2)throw new Error("Expecting a list of key-value pairs.");let a=s[0].trim(),l=parseFloat(s[1].trim());if(isNaN(l))throw new Error("The given string contains parts that cannot be parsed as numbers.");a==="top"?this.top=l:a==="left"?this.left=l:a==="bottom"?this.bottom=l:a==="right"&&(this.right=l)}}}static _isdelim(t,e){return e.includes(t)}copy(t){return this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this}add(t){return this.left+=t.left,this.right+=t.right,this.top+=t.top,this.bottom+=t.bottom,this}clone(){throw new Error("clone() must be implemented by subclass")}};var me=class n extends Ys{constructor(t,e,o,r){if(super(),arguments.length!==0)if(arguments.length===1)if(typeof t=="object"){let i=t;this.set(i.top,i.right,i.bottom,i.left)}else{let i=t;this.set(i,i,i,i)}else if(arguments.length===2){let i=t,s=e;this.set(s,i,s,i)}else this.set(t,e,o,r)}clone(){return new n(this)}};var yt=class n extends Ys{constructor(t,e,o,r){if(super(),arguments.length!==0)if(arguments.length===1)if(typeof t=="object"){let i=t;this.set(i.top,i.right,i.bottom,i.left)}else{let i=t;this.set(i,i,i,i)}else if(arguments.length===2){let i=t,s=e;this.set(s,i,s,i)}else this.set(t,e,o,r)}clone(){return new n(this)}};var Xe=class{static greaterThan(t){return new qf(t)}static lessThan(t){return new Jf(t)}},qf=class n{constructor(t){this._bound=t}compareTo(t){return this._bound<t?-1:1}equals(t){return t instanceof n&&this._bound===t._bound}toString(){return`${this._bound} (exclusive lower)`}},Jf=class n{constructor(t){this._bound=t}compareTo(t){return this._bound>t?1:-1}equals(t){return t instanceof n&&this._bound===t._bound}toString(){return`${this._bound} (exclusive upper)`}};var Oe=Object.freeze({INHERIT:"INHERIT",INCLUDE_CHILDREN:"INCLUDE_CHILDREN",SEPARATE_CHILDREN:"SEPARATE_CHILDREN",values(){return[this.INHERIT,this.INCLUDE_CHILDREN,this.SEPARATE_CHILDREN]},valueOf(n){return this[n]}});var Sr=class Sr{constructor(t,e){if(arguments.length===0)this.x=0,this.y=0;else if(arguments.length===1){let o=t;typeof o=="number"?(this.x=Math.cos(o),this.y=Math.sin(o)):(this.x=o.x,this.y=o.y)}else if(arguments.length===2){let o=t,r=e;typeof o=="number"?(this.x=o,this.y=r):(this.x=r.x-o.x,this.y=r.y-o.y)}}clone(){return new Sr(this.x,this.y)}toString(){return`(${this.x},${this.y})`}equals(t){return t instanceof Sr?this.x===t.x&&this.y===t.y:!1}equalsFuzzily(t,e=Sr.DEFAULT_FUZZYNESS){return Math.abs(this.x-t.x)<=e&&Math.abs(this.y-t.y)<=e}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}squareLength(){return this.x*this.x+this.y*this.y}reset(){return this.x=0,this.y=0,this}set(t,e){return typeof t=="object"?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}add(t,e){return typeof t=="object"?(this.x+=t.x,this.y+=t.y):(this.x+=t,this.y+=e),this}static sum(...t){let e=new Sr;for(let o of t)e.x+=o.x,e.y+=o.y;return e}sub(t,e){return typeof t=="object"?(this.x-=t.x,this.y-=t.y):(this.x-=t,this.y-=e),this}static diff(t,e){return new Sr(t.x-e.x,t.y-e.y)}scale(t,e){return e===void 0?(this.x*=t,this.y*=t):(this.x*=t,this.y*=e),this}normalize(){let t=this.length();return t>0&&(this.x/=t,this.y/=t),this}scaleToLength(t){return this.normalize(),this.scale(t),this}negate(){return this.x=-this.x,this.y=-this.y,this}toDegrees(){return this.toRadians()*(180/Math.PI)}toRadians(){let t=this.length();return this.x>=0&&this.y>=0?Math.asin(this.y/t):this.x<0?Math.PI-Math.asin(this.y/t):2*Math.PI+Math.asin(this.y/t)}wiggle(t,e){this.x+=t()*e-e/2,this.y+=t()*e-e/2}distance(t){let e=this.x-t.x,o=this.y-t.y;return Math.sqrt(e*e+o*o)}dotProduct(t){return this.x*t.x+this.y*t.y}static crossProduct(t,e){return t.x*e.y-t.y*e.x}rotate(t){let e=this.x*Math.cos(t)-this.y*Math.sin(t);return this.y=this.x*Math.sin(t)+this.y*Math.cos(t),this.x=e,this}angle(t){return Math.acos(this.dotProduct(t)/(this.length()*t.length()))}bound(t,e,o,r){if(o<t||r<e)throw new Error("The highx must be bigger than lowx and the highy must be bigger than lowy");return this.x<t?this.x=t:this.x>o&&(this.x=o),this.y<e?this.y=e:this.y>r&&(this.y=r),this}isNaN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}isInfinite(){return!isFinite(this.x)||!isFinite(this.y)}parse(t){let e=0;for(;e<t.length&&Sr._isdelim(t[e],`([{"' \r
`);)e++;let o=t.length;for(;o>0&&Sr._isdelim(t[o-1],`)]}"' \r
-`);)o--;if(e>=o)throw new Error("The given string does not contain any numbers.");let r=t.substring(e,o).split(/,|;|\r|\n/);if(r.length!==2)throw new Error(`Exactly two numbers are expected, ${r.length} were found.`);if(this.x=parseFloat(r[0].trim()),this.y=parseFloat(r[1].trim()),isNaN(this.x)||isNaN(this.y))throw new Error("The given string contains parts that cannot be parsed as numbers.")}static _isdelim(t,e){return e.includes(t)}};Z(Sr,"DEFAULT_FUZZYNESS",.05);var O=Sr;var st=class n extends Array{constructor(...t){if(super(),t.length===1&&Array.isArray(t[0]))for(let e of t[0])this.push(e);else if(t.length>0)for(let e of t)this.push(e)}toString(){let t="(";for(let e=0;e<this.length;e++){let o=this[e];t+=`${o.x},${o.y}`,e<this.length-1&&(t+="; ")}return t+")"}clone(){return new n(this.toArray())}toArray(t=0){if(t<0||t>this.length)throw new RangeError("Index out of bounds");return Array.prototype.slice.call(this,t)}parse(t){let e=t.split(/,|;|\(|\)|\[|\]|\{|\}| |\t|\n/);this.length=0;let o=0,r=0,i=0,s=0;for(;o<e.length;){let a=e[o];if(a!=null&&a.trim().length>0){let l=parseFloat(a);if(isNaN(l))throw new Error("The given string does not match the expected format for vectors.");r%2===0?i=l:s=l,r>0&&r%2!==0&&this.push(new O(i,s)),r++}o++}}add(t,e){arguments.length===0?this.push(new O):arguments.length===2?typeof t=="number"&&typeof e=="object"?this.splice(t,0,e):this.push(new O(t,e)):this.push(t)}addFirst(t,e){arguments.length===0?this.unshift(new O):arguments.length===2?this.unshift(new O(t,e)):this.unshift(t)}addLast(t,e){arguments.length===0?this.push(new O):arguments.length===2?this.push(new O(t,e)):this.push(t)}getFirst(){return this[0]}getLast(){return this[this.length-1]}removeFirst(){return this.shift()}removeLast(){return this.pop()}size(){return this.length}get(t){return this[t]}remove(t){for(let e=0;e<this.length;e++){let o=this[e];if(o===t||typeof o.equals=="function"&&o.equals(t))return this.splice(e,1),!0}return!1}addAll(t,e){if(e!==void 0){let o=Array.isArray(e)?e:[...e];this.splice(t,0,...o)}else if(Array.isArray(t))for(let o of t)this.push(o);else for(let o of t)this.push(o)}addAllAsCopies(t,e){let o=[];for(let r of e)o.push(new O(r));this.splice(t,0,...o)}scale(t,e){for(let o of this)o.scale(t,e);return this}offset(t,e){if(typeof t=="object")for(let o of this)o.add(t);else for(let o of this)o.add(t,e);return this}offsetNonMutating(t){let e=new n;for(let o of this)e.push(O.sum(o,t));return e}totalLength(){let t=0;if(this.length>=2){let e=this[0];for(let o=1;o<this.length;o++){let r=this[o];t+=e.distance(r),e=r}}return t}hasNaN(){for(let t of this)if(t.isNaN())return!0;return!1}hasInfinite(){for(let t of this)if(t.isInfinite())return!0;return!1}pointOnLine(t){if(this.length>=2){let e=Math.abs(t),o=0;if(t>=0){let r=this[0];for(let i=1;i<this.length;i++){let s=o,a=this[i],l=r.distance(a);if(l>0&&(o+=l,o>=e)){let c=(e-s)/l,g=a.clone().sub(r);return g.scale(c),g.add(r),g}r=a}return this[this.length-1]}else{let r=this[this.length-1];for(let i=this.length-2;i>=0;i--){let s=o,a=this[i],l=r.distance(a);if(l>0&&(o+=l,o>=e)){let c=(e-s)/l,g=a.clone().sub(r);return g.scale(c),g.add(r),g}r=a}return this[0]}}else{if(this.length===1)return this[0];throw new Error("Cannot determine a point on an empty vector chain.")}}angleOnLine(t){if(this.length>=2){let e=Math.abs(t),o=0;if(t>=0){let r,i=this[0];for(let s=1;s<this.length;s++){r=i,i=this[s];let a=r.distance(i);if(a>0&&(o+=a,o>=e))break}return i.clone().sub(r).toRadians()}else{let r,i=this[this.length-1];for(let s=this.length-2;s>=0;s--){r=i,i=this[s];let a=r.distance(i);if(a>0&&(o+=a,o>=e))break}return i.clone().sub(r).toRadians()}}else throw new Error("Need at least two points to determine an angle.")}static reverse(t){let e=new n;for(let o=t.length-1;o>=0;o--)e.push(new O(t[o]));return e}get(t){return this[t]}size(){return this.length}clear(){this.length=0}isEmpty(){return this.length===0}};var k=Object.freeze({H_LEFT:"H_LEFT",H_CENTER:"H_CENTER",H_RIGHT:"H_RIGHT",V_TOP:"V_TOP",V_CENTER:"V_CENTER",V_BOTTOM:"V_BOTTOM",INSIDE:"INSIDE",OUTSIDE:"OUTSIDE",H_PRIORITY:"H_PRIORITY",fixed(){return new Set},insideTopLeft(){return new Set([k.INSIDE,k.V_TOP,k.H_LEFT])},insideTopCenter(){return new Set([k.INSIDE,k.V_TOP,k.H_CENTER])},insideTopRight(){return new Set([k.INSIDE,k.V_TOP,k.H_RIGHT])},insideCenter(){return new Set([k.INSIDE,k.V_CENTER,k.H_CENTER])},insideBottomLeft(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_LEFT])},insideBottomCenter(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_CENTER])},insideBottomRight(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_RIGHT])},outsideTopLeft(){return new Set([k.OUTSIDE,k.V_TOP,k.H_LEFT])},outsideTopCenter(){return new Set([k.OUTSIDE,k.V_TOP,k.H_CENTER])},outsideTopRight(){return new Set([k.OUTSIDE,k.V_TOP,k.H_RIGHT])},outsideBottomLeft(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_LEFT])},outsideBottomCenter(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_CENTER])},outsideBottomRight(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_RIGHT])},isValid(n){return!([k.INSIDE,k.OUTSIDE].filter(r=>n.has(r)).length>1||[k.H_LEFT,k.H_CENTER,k.H_RIGHT].filter(r=>n.has(r)).length>1||[k.V_TOP,k.V_CENTER,k.V_BOTTOM].filter(r=>n.has(r)).length>1)},values(){return[this.H_LEFT,this.H_CENTER,this.H_RIGHT,this.V_TOP,this.V_CENTER,this.V_BOTTOM,this.INSIDE,this.OUTSIDE,this.H_PRIORITY]},valueOf(n){return this[n]},ensureSet(n){if(n instanceof Set)return n;if(n==null)return new Set;if(typeof n=="string"){let t=new Set;for(let e of n.split(/\s+/)){let o=e.trim();o&&k[o]!==void 0&&typeof k[o]=="string"&&t.add(k[o])}return t}return new Set}});var de=class{initialize(t){}dispose(){}layout(t,e){throw new Error(`${this.constructor.name}.layout() is not implemented`)}};var xp=new m("org.eclipse.elk.padding",new yt(15)),Dp=new m("org.eclipse.elk.spacing.nodeNode",15,0),Qf=new m("org.eclipse.elk.priority",0),tu=new m("org.eclipse.elk.aspectRatio",1.3,Xe.greaterThan(0));var dt=class n{constructor(t,e,o,r){arguments.length===0?(this.x=0,this.y=0,this.width=0,this.height=0):arguments.length===1?(this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height):(this.x=t,this.y=e,this.width=o,this.height=r)}setRect(t,e,o,r){this.x=t,this.y=e,this.width=o,this.height=r}getPosition(){return new O(this.x,this.y)}getTopLeft(){return new O(this.x,this.y)}getTopRight(){return new O(this.x+this.width,this.y)}getBottomLeft(){return new O(this.x,this.y+this.height)}getBottomRight(){return new O(this.x+this.width,this.y+this.height)}getCenter(){return new O(this.x+this.width/2,this.y+this.height/2)}union(t){let e=Math.min(this.x,t.x),o=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width),i=Math.max(this.y+this.height,t.y+t.height);if(r<e){let s=e;r=e}if(i<o){let s=o;i=o}this.setRect(e,o,r-e,i-o)}move(t){this.x+=t.x,this.y+=t.y}getMaxX(){return this.x+this.width}getMaxY(){return this.y+this.height}intersects(t){let e=this.x,o=this.y,r=this.x+this.width,i=this.y+this.height,s=t.x,a=t.y,l=t.x+t.width,c=t.y+t.height;return e<l&&r>s&&i>a&&o<c}equals(t){return t==null||!(t instanceof n)?!1:this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}toString(){return`Rect[x=${this.x},y=${this.y},w=${this.width},h=${this.height}]`}};var $t=class $t{constructor(t){this.name=t,Object.freeze(this)}isPosFixed(){return this===$t.FIXED_POS}isRatioFixed(){return this===$t.FIXED_RATIO}isOrderFixed(){return this===$t.FIXED_ORDER||this===$t.FIXED_RATIO||this===$t.FIXED_POS}isSideFixed(){return this!==$t.FREE&&this!==$t.UNDEFINED}toString(){return this.name}static values(){return[$t.UNDEFINED,$t.FREE,$t.FIXED_SIDE,$t.FIXED_ORDER,$t.FIXED_RATIO,$t.FIXED_POS]}static valueOf(t){return $t[t]}};Z($t,"UNDEFINED",new $t("UNDEFINED")),Z($t,"FREE",new $t("FREE")),Z($t,"FIXED_SIDE",new $t("FIXED_SIDE")),Z($t,"FIXED_ORDER",new $t("FIXED_ORDER")),Z($t,"FIXED_RATIO",new $t("FIXED_RATIO")),Z($t,"FIXED_POS",new $t("FIXED_POS"));var H=$t;var it=Object.freeze({OUTSIDE:"OUTSIDE",INSIDE:"INSIDE",NEXT_TO_PORT_IF_POSSIBLE:"NEXT_TO_PORT_IF_POSSIBLE",ALWAYS_SAME_SIDE:"ALWAYS_SAME_SIDE",ALWAYS_OTHER_SAME_SIDE:"ALWAYS_OTHER_SAME_SIDE",SPACE_EFFICIENT:"SPACE_EFFICIENT",fixed(){return new Set},inside(){return new Set([it.INSIDE])},outside(){return new Set([it.OUTSIDE])},isFixed(n){return!n.has(it.INSIDE)&&!n.has(it.OUTSIDE)},isValid(n){return!([it.INSIDE,it.OUTSIDE].filter(o=>n.has(o)).length>1||[it.ALWAYS_SAME_SIDE,it.ALWAYS_OTHER_SAME_SIDE,it.SPACE_EFFICIENT].filter(o=>n.has(o)).length>1)},values(){return[this.OUTSIDE,this.INSIDE,this.NEXT_TO_PORT_IF_POSSIBLE,this.ALWAYS_SAME_SIDE,this.ALWAYS_OTHER_SAME_SIDE,this.SPACE_EFFICIENT]},valueOf(n){return this[n]}});var q=class q{constructor(t){this.name=t,Object.freeze(this)}ordinal(){switch(this){case q.UNDEFINED:return 0;case q.NORTH:return 1;case q.EAST:return 2;case q.SOUTH:return 3;case q.WEST:return 4;default:return-1}}right(){switch(this){case q.NORTH:return q.EAST;case q.EAST:return q.SOUTH;case q.SOUTH:return q.WEST;case q.WEST:return q.NORTH;default:return q.UNDEFINED}}left(){switch(this){case q.NORTH:return q.WEST;case q.EAST:return q.NORTH;case q.SOUTH:return q.EAST;case q.WEST:return q.SOUTH;default:return q.UNDEFINED}}opposed(){switch(this){case q.NORTH:return q.SOUTH;case q.EAST:return q.WEST;case q.SOUTH:return q.NORTH;case q.WEST:return q.EAST;default:return q.UNDEFINED}}areAdjacent(t){return this===q.UNDEFINED?!1:this.left()===t||this.right()===t}static fromDirection(t){switch(t){case R.UP:return q.NORTH;case R.RIGHT:return q.EAST;case R.DOWN:return q.SOUTH;case R.LEFT:return q.WEST;default:return q.UNDEFINED}}static isVertical(t){return t===q.NORTH||t===q.SOUTH}static isHorizontal(t){return t===q.WEST||t===q.EAST}toString(){return this.name}static values(){return[q.UNDEFINED,q.NORTH,q.EAST,q.SOUTH,q.WEST]}static valueOf(t){return q[t]}};Z(q,"UNDEFINED",new q("UNDEFINED")),Z(q,"NORTH",new q("NORTH")),Z(q,"EAST",new q("EAST")),Z(q,"SOUTH",new q("SOUTH")),Z(q,"WEST",new q("WEST")),Z(q,"SIDES_NONE",new Set),Z(q,"SIDES_NORTH",null),Z(q,"SIDES_EAST",null),Z(q,"SIDES_SOUTH",null),Z(q,"SIDES_WEST",null),Z(q,"SIDES_NORTH_SOUTH",null),Z(q,"SIDES_EAST_WEST",null),Z(q,"SIDES_NORTH_WEST",null),Z(q,"SIDES_NORTH_EAST",null),Z(q,"SIDES_SOUTH_WEST",null),Z(q,"SIDES_EAST_SOUTH",null),Z(q,"SIDES_NORTH_EAST_WEST",null),Z(q,"SIDES_EAST_SOUTH_WEST",null),Z(q,"SIDES_NORTH_SOUTH_WEST",null),Z(q,"SIDES_NORTH_EAST_SOUTH",null),Z(q,"SIDES_NORTH_EAST_SOUTH_WEST",null);var u=q;u.SIDES_NORTH=Object.freeze(new Set([u.NORTH]));u.SIDES_EAST=Object.freeze(new Set([u.EAST]));u.SIDES_SOUTH=Object.freeze(new Set([u.SOUTH]));u.SIDES_WEST=Object.freeze(new Set([u.WEST]));u.SIDES_NORTH_SOUTH=Object.freeze(new Set([u.NORTH,u.SOUTH]));u.SIDES_EAST_WEST=Object.freeze(new Set([u.EAST,u.WEST]));u.SIDES_NORTH_WEST=Object.freeze(new Set([u.NORTH,u.WEST]));u.SIDES_NORTH_EAST=Object.freeze(new Set([u.NORTH,u.EAST]));u.SIDES_SOUTH_WEST=Object.freeze(new Set([u.SOUTH,u.WEST]));u.SIDES_EAST_SOUTH=Object.freeze(new Set([u.EAST,u.SOUTH]));u.SIDES_NORTH_EAST_WEST=Object.freeze(new Set([u.NORTH,u.EAST,u.WEST]));u.SIDES_EAST_SOUTH_WEST=Object.freeze(new Set([u.EAST,u.SOUTH,u.WEST]));u.SIDES_NORTH_SOUTH_WEST=Object.freeze(new Set([u.NORTH,u.SOUTH,u.WEST]));u.SIDES_NORTH_EAST_SOUTH=Object.freeze(new Set([u.NORTH,u.EAST,u.SOUTH]));u.SIDES_NORTH_EAST_SOUTH_WEST=Object.freeze(new Set([u.NORTH,u.EAST,u.SOUTH,u.WEST]));var HO=[u.SIDES_NONE,u.SIDES_NORTH,u.SIDES_EAST,u.SIDES_NORTH_EAST,u.SIDES_SOUTH,u.SIDES_NORTH_SOUTH,u.SIDES_EAST_SOUTH,u.SIDES_NORTH_EAST_SOUTH,u.SIDES_WEST,u.SIDES_NORTH_WEST,u.SIDES_EAST_WEST,u.SIDES_NORTH_EAST_WEST,u.SIDES_SOUTH_WEST,u.SIDES_NORTH_SOUTH_WEST,u.SIDES_EAST_SOUTH_WEST,u.SIDES_NORTH_EAST_SOUTH_WEST];u.sidesOf=function(t){let e=0;return t.has(u.NORTH)&&(e|=1),t.has(u.EAST)&&(e|=2),t.has(u.SOUTH)&&(e|=4),t.has(u.WEST)&&(e|=8),HO[e]};var mt=Object.freeze({PORTS:"PORTS",PORT_LABELS:"PORT_LABELS",NODE_LABELS:"NODE_LABELS",MINIMUM_SIZE:"MINIMUM_SIZE",fixed(){return new Set},minimumSize(){return new Set([mt.MINIMUM_SIZE])},minimumSizeWithPorts(){return new Set([mt.PORTS,mt.MINIMUM_SIZE])},free(){return new Set([mt.PORTS,mt.PORT_LABELS,mt.NODE_LABELS,mt.MINIMUM_SIZE])},values(){return[this.PORTS,this.PORT_LABELS,this.NODE_LABELS,this.MINIMUM_SIZE]},valueOf(n){return this[n]}});var Nt=Object.freeze({DEFAULT_MINIMUM_SIZE:"DEFAULT_MINIMUM_SIZE",MINIMUM_SIZE_ACCOUNTS_FOR_PADDING:"MINIMUM_SIZE_ACCOUNTS_FOR_PADDING",COMPUTE_PADDING:"COMPUTE_PADDING",OUTSIDE_NODE_LABELS_OVERHANG:"OUTSIDE_NODE_LABELS_OVERHANG",PORTS_OVERHANG:"PORTS_OVERHANG",UNIFORM_PORT_SPACING:"UNIFORM_PORT_SPACING",SPACE_EFFICIENT_PORT_LABELS:"SPACE_EFFICIENT_PORT_LABELS",FORCE_TABULAR_NODE_LABELS:"FORCE_TABULAR_NODE_LABELS",ASYMMETRICAL:"ASYMMETRICAL",valueOf(n){return typeof n=="number"?Nt.values()[n]:this[n]},values(){return[this.DEFAULT_MINIMUM_SIZE,this.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING,this.COMPUTE_PADDING,this.OUTSIDE_NODE_LABELS_OVERHANG,this.PORTS_OVERHANG,this.UNIFORM_PORT_SPACING,this.SPACE_EFFICIENT_PORT_LABELS,this.FORCE_TABULAR_NODE_LABELS,this.ASYMMETRICAL]}});var es=20,os=20;function bp(n,t){if(n.getParent()===null)throw new Error("port must have a parent node to calculate the port side");let e=n.getParent(),o=e.getWidth(),r=e.getHeight();if(o<=0&&r<=0)return u.UNDEFINED;let i=n.getX(),s=n.getY();if(t===R.LEFT||t===R.RIGHT){if(i<0)return u.WEST;if(i+n.getWidth()>o)return u.EAST}else if(t===R.UP||t===R.DOWN){if(s<0)return u.NORTH;if(s+n.getHeight()>r)return u.SOUTH}let a=(i+n.getWidth()/2)/o,l=(s+n.getHeight()/2)/r;return a+l<=1&&a-l<=0?u.WEST:a+l>=1&&a-l>=0?u.EAST:l<.5?u.NORTH:u.SOUTH}function eu(n,t){if(n.getParent()===null)throw new Error("port must have a parent node to calculate the port side");let e=n.getParent();switch(t){case u.NORTH:return-(n.getY()+n.getHeight());case u.EAST:return n.getX()-e.getWidth();case u.SOUTH:return n.getY()-e.getHeight();case u.WEST:return-(n.getX()+n.getWidth());default:return 0}}function ou(n){let t=n.getProperty(Mo);if(t.size===0)return null;let e=0,o=0;if(t.has(mt.PORTS)){let r=n.getProperty(cr),i=2,s=2,a=2,l=2,c=n.getParent()===null?n.getProperty(lr):n.getParent().getProperty(lr);for(let g of n.ports){let h=g.getProperty(Tr);if(h===u.UNDEFINED&&(h=bp(g,c),g.setProperty(Tr,h)),r===H.FIXED_POS)switch(h){case u.NORTH:i=Math.max(i,g.getX()+g.getWidth());break;case u.EAST:s=Math.max(s,g.getY()+g.getHeight());break;case u.SOUTH:a=Math.max(a,g.getX()+g.getWidth());break;case u.WEST:l=Math.max(l,g.getY()+g.getHeight());break}else switch(h){case u.NORTH:i+=g.getWidth()+2;break;case u.EAST:s+=g.getHeight()+2;break;case u.SOUTH:a+=g.getWidth()+2;break;case u.WEST:l+=g.getHeight()+2;break}}e=Math.max(i,a),o=Math.max(s,l)}return Ae(n,e,o,!0,!0)}function Ae(n,t,e,o,r){let i=new O(n.getWidth(),n.getHeight()),s=ya(n);s.x=Math.max(s.x,t),s.y=Math.max(s.y,e);let a=s.x/i.x,l=s.y/i.y,c=s.x-i.x,g=s.y-i.y;if(o){let h=n.getParent()===null?n.getProperty(lr):n.getParent().getProperty(lr),d=n.getProperty(cr)===H.FIXED_POS;for(let f of n.ports){let E=f.getProperty(Tr);switch(E===u.UNDEFINED&&(E=bp(f,h),f.setProperty(Tr,E)),E){case u.NORTH:d||f.setX(f.getX()*a);break;case u.EAST:f.setX(f.getX()+c),d||f.setY(f.getY()*l);break;case u.SOUTH:d||f.setX(f.getX()*a),f.setY(f.getY()+g);break;case u.WEST:d||f.setY(f.getY()*l);break}}}if(n.setDimensions(s.x,s.y),r)for(let h of n.labels){let d=h.getX()+h.getWidth()/2,f=h.getY()+h.getHeight()/2,E=d/i.x,P=f/i.y;E+P>=1&&(E-P>0&&f>=0?(h.setX(h.getX()+c),h.setY(h.getY()+g*P)):E-P<0&&d>=0&&(h.setX(h.getX()+c*E),h.setY(h.getY()+g)))}return n.setProperty(Mo,mt.fixed()),new O(a,l)}function ya(n){if(n.getProperty(Mo).has(mt.MINIMUM_SIZE)){let e=n.getProperty(Oo),o=new O(n.getProperty(Yo));return e.has(Nt.DEFAULT_MINIMUM_SIZE)&&(o.x<=0&&(o.x=es),o.y<=0&&(o.y=os)),o}return new O}function ru(n){let t=n.getProperty(lu);if(t===1)return;n.setDimensions(t*n.getWidth(),t*n.getHeight());let e=[];for(let r of n.ports)for(let i of r.labels)e.push(i);let o=[...n.labels,...n.ports,...e];for(let r of o){r.setLocation(t*r.getX(),t*r.getY()),r.setDimensions(t*r.getWidth(),t*r.getHeight());let i=r.getProperty(au);i!=null&&(i.x*=t,i.y*=t)}}function Gp(n){if(n.sections.length!==1)throw new Error("The edge needs to have exactly one edge section. Found: "+n.sections.length);let t=new st,e=yl(n.sources[0]);if(e!=null)for(let r of wp(n,e,!1))t.add(r);let o=yl(n.targets[0]);if(o!=null)for(let r of wp(n,o,!0))t.add(r);return t}function wp(n,t,e){let o=n.sections[0],r=new st,i=new Map,s=Mp(o);i.set(o,s);let a=new Map,l=[];for(let c of Ta(t)){if(c.sections.length!==1)throw new Error("The edge needs to have exactly one edge section. Found: "+c.sections.length);if(c!==n){let g=c.sections[0];l.push(g);let h=i.get(g);h||(h=Mp(g),i.set(g,h));let d=e?new O(s[s.length-1]).sub(h[h.length-1]):new O(s[0]).sub(h[0]);a.set(g,d)}}if(l.length>0){let c=s[e?s.length-1:0];for(let g=1;g<s.length;g++){let h=s[e?s.length-1-g:g];for(let d=l.length-1;d>=0;d--){let f=l[d],E=i.get(f);if(E.length<=g)l.splice(d,1);else{let P=new O(E[e?E.length-1-g:g]).add(a.get(f));if(h.x!==P.x||h.y!==P.y){let S=h.x-c.x,T=h.y-c.y,N=P.x-c.x,I=P.y-c.y;N*T===I*S&&Math.sign(S)===Math.sign(N)&&Math.sign(T)===Math.sign(I)?(Math.abs(S)<Math.abs(N)||Math.abs(T)<Math.abs(I))&&r.add(h):g>1&&r.add(c),l.splice(d,1)}}}c=h}}return r}function Mp(n){let t=[];t.push(new O(n.getStartX(),n.getStartY()));for(let o of n.getBendPoints())t.push(new O(o.getX(),o.getY()));t.push(new O(n.getEndX(),n.getEndY()));let e=1;for(;e<t.length-1;){let o=t[e-1],r=t[e],i=t[e+1];o.x===r.x&&r.x===i.x||o.y===r.y&&r.y===i.y?t.splice(e,1):e++}return t}function Ia(n){let t=null;for(let e of n.getLabels()){let o=new dt(e.getPosition().x,e.getPosition().y,e.getSize().x,e.getSize().y);t===null?t=o:t.union(o)}return t||new dt}function Hp(n,t){let e=Ia(n);return iu(new O(e.x,e.y),new O(e.width,e.height),n.getSize(),t,n.getSide())}function iu(n,t,e,o,r){switch(r){case u.NORTH:return Math.max(0,t.y+n.y-(e.y+o));case u.SOUTH:return Math.max(0,-n.y-o);case u.EAST:return Math.max(0,-n.x-o);case u.WEST:return Math.max(0,t.x+n.x-(e.x+o));default:return 0}}function Ra(n,t,e){for(let o of n.children)o.setLocation(o.getX()+t,o.getY()+e);for(let o of n.containedEdges)vO(o,t,e)}function vO(n,t,e){for(let r of n.sections)BO(r,t,e);for(let r of n.labels)r.setLocation(r.getX()+t,r.getY()+e);let o=n.getProperty(gr);o!=null&&o.offset(t,e)}function BO(n,t,e){n.setStartLocation(n.getStartX()+t,n.getStartY()+e);for(let o of n.getBendPoints())o.set(o.getX()+t,o.getY()+e);n.setEndLocation(n.getEndX()+t,n.getEndY()+e)}function Vs(n,t,e){let o=n.getProperty(Rl),r=0,i=0;t.x>e.x&&(o.has(he.H_CENTER)?r=(t.x-e.x)/2:o.has(he.H_RIGHT)&&(r=t.x-e.x)),t.y>e.y&&(o.has(he.V_CENTER)?i=(t.y-e.y)/2:o.has(he.V_BOTTOM)&&(i=t.y-e.y)),Ra(n,r,i)}function su(n,t){let e=t;for(;e!=null;)n.add(e.getX(),e.getY()),e=e.getParent();return n}function nu(n,t){let e=t;for(;e!=null;)n.add(-e.getX(),-e.getY()),e=e.getParent();return n}function Xs(n,t){if(n.size()<2)throw new Error("The vector chain must contain at least a source and a target point.");let e=n.getFirst();t.setStartLocation(e.x,e.y);let o=0,r=t.getBendPoints(),i=n.toArray();for(let a=1;a<i.length-1;a++){let l=i[a],c;o<r.length?c=r[o]:(c=new Xr,r.push(c)),c.set(l.x,l.y),o++}o<r.length&&r.splice(o,r.length-o);let s=n.getLast();t.setEndLocation(s.x,s.y)}function vp(n,...t){Bp(n,e=>{for(let o of t)o.visit(e)})}function Bp(n,t){t(n);for(let e of n.labels)t(e);for(let e of n.ports){t(e);for(let o of e.labels)t(o)}for(let e of n.containedEdges){t(e);for(let o of e.labels)t(o)}for(let e of n.children)Bp(e,t)}var Up=1.3,hr=Object.freeze({SIMPLE:"SIMPLE",GROUP_DEC:"GROUP_DEC",GROUP_MIXED:"GROUP_MIXED",GROUP_INC:"GROUP_INC",values(){return[hr.SIMPLE,hr.GROUP_DEC,hr.GROUP_MIXED,hr.GROUP_INC]},valueOf(n){return hr[n]}}),rs=class extends de{layout(t,e){e&&e.begin&&e.begin("Box layout",2);let o=t.getProperty(Dp),r=t.getProperty(xp),i=t.getProperty(Ll),s=t.getProperty(zo),a=t.getProperty(Il);a===hr.SIMPLE?this._placeBoxesSimple(t,o,r,i,s):this._placeBoxesGrouping(t,o,r,i,a),e&&e.done&&e.done()}_placeBoxesSimple(t,e,o,r,i){let s=UO(t,i),a=ya(t),l=t.getProperty(tu);(l==null||l<=0)&&(l=Up);let c=FO(s,e,o,a.x,a.y,r,l);Ae(t,c.x,c.y,!1,!0)}_placeBoxesGrouping(t,e,o,r,i){let s=t.getProperty(Yo),a=new O(s.x,s.y);a.x=Math.max(a.x-o.getLeft()-o.getRight(),0),a.y=Math.max(a.y-o.getTop()-o.getBottom(),0);let l=t.getProperty(tu);(l==null||l<=0)&&(l=Up);let c=[];for(let f of t.getChildren())c.push(new is(f));let g;i===hr.GROUP_INC?g=VO(c,e,a.x,a.y,r,l):i===hr.GROUP_DEC?g=zO(c,e,a.x,a.y,r,l):g=YO(c,e,a.x,a.y,r,l);let h=new is(g),d=Al(h,e,o,a.x,a.y,r,l);Ae(t,d.x,d.y,!1,!0)}};Z(rs,"PackingMode",hr);function UO(n,t){let e=[...n.getChildren()];return e.sort((o,r)=>{let i=o.getProperty(Qf)||0,s=r.getProperty(Qf)||0;if(i>s)return-1;if(i<s)return 1;if(t){let c=(o.getY()||0)-(r.getY()||0);if(c!==0)return c;let g=(o.getX()||0)-(r.getX()||0);if(g!==0)return g}let a=o.getWidth()*o.getHeight(),l=r.getWidth()*r.getHeight();return a-l}),e}function FO(n,t,e,o,r,i,s){let a=0,l=0;for(let N of n)ou(N),a=Math.max(a,N.getWidth()),l+=N.getWidth()*N.getHeight();let c=l/n.length,g=kO(n,c);l+=n.length*1*g,l+=Math.sqrt(l)*(e.getBottom()+e.getTop()),l+=Math.sqrt(l)*e.getRight(),a=Math.max(a,Math.sqrt(l*s))+e.getLeft();let h=e.getLeft(),d=e.getTop(),f=0,E=e.getHorizontal(),P=[0],S=[];for(let N=0;N<n.length;N++){let I=n[N],C=I.getWidth(),x=I.getHeight();h+C>a&&(i&&(S.push(f),P.push(N)),h=e.getLeft(),d+=f+t,f=0,E=Math.max(E,e.getHorizontal()+C)),I.setLocation(h,d),E=Math.max(E,h+C+e.getRight()),f=Math.max(f,x),h+=C+t}E=Math.max(E,o);let T=d+f+e.getBottom();if(T<r&&(f+=r-T,T=r),i){h=e.getLeft(),P.push(n.length),S.push(f);let N=0,I=P[N++],C=0,x=0;for(let M=0;M<n.length;M++){M===I&&(h=e.getLeft(),x=S[C++],I=P[N++]);let A=n[M],B=A.getHeight();A.setHeight(x);let Y=x;if(M+1===I){let j=E-h-e.getRight(),X=A.getWidth();A.setWidth(j),Vs(A,new O(j,Y),new O(X,B))}h+=A.getWidth()+t}}return new O(E,T)}function kO(n,t){let e=0;for(let o of n)e+=Math.pow(o.getWidth()*o.getHeight()-t,2);return Math.sqrt(e/(n.length-1))}function Al(n,t,e,o,r,i,s){let a=0,l=0;for(let x of n.groups)x.node!=null&&ou(x.node),a=Math.max(a,x.getWidth()),l+=x.getWidth()*x.getHeight();let c=l/n.groups.length,g=WO(n.groups,c);l+=n.groups.length*1*g,a=Math.max(a,Math.sqrt(l*s))+e.getLeft();let d=e.getLeft(),f=e.getTop(),E=0,P=e.getHorizontal(),S=[0],T=[],N=null,I=[];for(let x=0;x<n.groups.length;x++){let M=n.groups[x],A=M.getWidth(),B=M.getHeight();d+A>a&&(i&&(T.push(E),S.push(x),N!=null&&n.right.push(N),I=[]),d=e.getLeft(),f+=E+t,E=0,P=Math.max(P,e.getHorizontal()+A)),I.push(M),M.translate(d,f),P=Math.max(P,d+A+e.getRight()),E=Math.max(E,B),d+=A+t,N=M}for(let x of I)n.bottom.push(x);I.length>0&&n.right.push(I[I.length-1]),P=Math.max(P,o);let C=f+E+e.getBottom();if(C<r&&(E+=r-C,C=r),i){d=e.getLeft(),S.push(n.groups.length),T.push(E);let x=0,M=S[x++],A=0,B=0;for(let Y=0;Y<n.groups.length;Y++){Y===M&&(d=e.getLeft(),B=T[A++],M=S[x++]);let j=n.groups[Y];if(j.setHeight(B),Y+1===M){let X=P-d-e.getRight(),tt=j.getWidth();j.setWidth(X),j.translateInnerNodes((X-tt)/2,0)}d+=j.getWidth()+t}}return new O(P,C)}function WO(n,t){let e=0;for(let o of n)e+=Math.pow(o.area()-t,2);return Math.sqrt(e/(n.length-1))}function zO(n,t,e,o,r,i){n.sort((h,d)=>d.area()-h.area());let s=[...n],a=[],l=[],c=null,g=0;for(;s.length>0;){let h=s.shift();if(c==null||c.area()/2<h.area())c=h,a.push(h);else if(g+=h.area(),l.push(h),l.length>1&&(g>c.area()/2||s.length===0)){let d=new is(l),f=c.getWidth()/c.getHeight(),E=Al(d,t,new yt,e,o,r,f);d.size.x=E.x,d.size.y=E.y,c=d,a.push(d),g=0,l=[]}}for(let h of l)a.push(h);return a}function YO(n,t,e,o,r,i){let s=[...n].sort((g,h)=>g.area()-h.area()),a=new Array(n.length).fill(0),l=0,c=[];for(;s.length>0;){let g=s[0];if(l>1&&g.area()/2>a[0]){let h=0;for(;h<c.length-1&&g.area()/2>a[h];)h++;let d=c.slice(0,h+1),f=new is(d),E=g.getWidth()/g.getHeight(),P=Al(f,t,new yt,e,o,r,E);f.size.x=P.x,f.size.y=P.y;let S=c.slice(h+1);s.push(f);for(let T of S)s.push(T);s.sort((T,N)=>T.area()-N.area()),c.length=0,l=0,a.fill(0)}else s.shift(),l>0&&(a[l]=a[l-1]),a[l]+=g.area(),l++,c.push(g)}return c}function VO(n,t,e,o,r,i){n.sort((l,c)=>l.area()-c.area());let s=[],a=0;for(let l of n)if(s.length>0&&l.area()>a*2){let c=new is(s),g=l.getWidth()/l.getHeight(),h=Al(c,t,new yt,e,o,r,g);c.size.x=h.x,c.size.y=h.y,s=[],a=0,s.push(c),s.push(l),a=c.area()+l.area()}else s.push(l),a+=l.area();return s}var is=class{constructor(t){Array.isArray(t)?(this.groups=[...t],this.node=null,this.bottom=[],this.right=[],this.size=new O):(this.node=t,this.groups=null,this.bottom=null,this.right=null,this.size=null,this.node.setLocation(0,0))}area(){return this.getWidth()*this.getHeight()}getWidth(){return this.node!=null?this.node.getWidth():this.size.x}getHeight(){return this.node!=null?this.node.getHeight():this.size.y}setWidth(t){if(this.node!=null)this.node.setWidth(t);else{let e=t-this.getWidth();for(let o of this.right)o.setWidth(o.getWidth()+e)}}setHeight(t){if(this.node!=null)this.node.setHeight(t);else{let e=t-this.getHeight();for(let o of this.bottom)o.setHeight(o.getHeight()+e)}}translate(t,e){if(this.node!=null)this.node.setX(this.node.getX()+t),this.node.setY(this.node.getY()+e);else for(let o of this.groups)o.translate(t,e)}translateInnerNodes(t,e){if(this.node!=null)Ra(this.node,t,e);else for(let o of this.groups)o.translateInnerNodes(t,e)}};var qt=Object.freeze({DISTRIBUTED:"DISTRIBUTED",JUSTIFIED:"JUSTIFIED",BEGIN:"BEGIN",CENTER:"CENTER",END:"END",values(){return[this.DISTRIBUTED,this.JUSTIFIED,this.BEGIN,this.CENTER,this.END]},valueOf(n){return this[n]}});var Fp=Object.freeze({INHERIT:"INHERIT",PARENT:"PARENT",ROOT:"ROOT",values(){return[this.INHERIT,this.PARENT,this.ROOT]},valueOf(n){return this[n]}});var Il=new m("org.eclipse.elk.box.packingMode",()=>hr.SIMPLE),mi=new m("org.eclipse.elk.algorithm"),ss=new m("org.eclipse.elk.resolvedAlgorithm"),XO=new m("org.eclipse.elk.alignment",Kt.AUTOMATIC),KO=new m("org.eclipse.elk.aspectRatio",null,Xe.greaterThan(0)),Cl=new m("org.eclipse.elk.bendPoints"),Rl=new m("org.eclipse.elk.contentAlignment",he.topLeft()),Ks=new m("org.eclipse.elk.debugMode",!1),lr=new m("org.eclipse.elk.direction",R.UNDEFINED),cu=new m("org.eclipse.elk.edgeRouting",At.UNDEFINED),Ll=new m("org.eclipse.elk.expandNodes",!1),yr=new m("org.eclipse.elk.hierarchyHandling",Oe.INHERIT),ns=new m("org.eclipse.elk.padding",new yt(12)),zo=new m("org.eclipse.elk.interactive",!1),ZO=new m("org.eclipse.elk.interactiveLayout",!1),So=new m("org.eclipse.elk.omitNodeMicroLayout",!1),jO=new m("org.eclipse.elk.json.shapeCoords",Fp.INHERIT),$O=new m("org.eclipse.elk.json.edgeCoords",Ap.INHERIT),qO=new m("org.eclipse.elk.spacing.commentComment",10,0),JO=new m("org.eclipse.elk.spacing.commentNode",10,0),QO=new m("org.eclipse.elk.spacing.componentComponent",20,0),tS=new m("org.eclipse.elk.spacing.edgeEdge",10,0),gu=new m("org.eclipse.elk.spacing.edgeLabel",2,0),eS=new m("org.eclipse.elk.spacing.edgeNode",10,0),hu=new m("org.eclipse.elk.spacing.labelLabel",0,0),Zs=new m("org.eclipse.elk.spacing.labelNode",5,0),du=new m("org.eclipse.elk.spacing.labelPortHorizontal",1),fu=new m("org.eclipse.elk.spacing.labelPortVertical",1),Pi=new m("org.eclipse.elk.spacing.nodeNode",20,0),oS=new m("org.eclipse.elk.spacing.nodeSelfLoop",10,0),uu=new m("org.eclipse.elk.spacing.portPort",10,0),as=new m("org.eclipse.elk.spacing.individual"),_u=new m("org.eclipse.elk.spacing.portsSurrounding",new me(0)),rS=new m("org.eclipse.elk.partitioning.partition"),iS=new m("org.eclipse.elk.partitioning.activate",!1),pu=new m("org.eclipse.elk.nodeLabels.padding",new yt(5)),Kr=new m("org.eclipse.elk.nodeLabels.placement",k.fixed),Eu=new m("org.eclipse.elk.portAlignment.default",qt.DISTRIBUTED),xl=new m("org.eclipse.elk.portAlignment.north"),Dl=new m("org.eclipse.elk.portAlignment.south"),wl=new m("org.eclipse.elk.portAlignment.west"),Ml=new m("org.eclipse.elk.portAlignment.east"),cr=new m("org.eclipse.elk.portConstraints",H.UNDEFINED),ho=new m("org.eclipse.elk.position"),mu=new m("org.eclipse.elk.priority"),Pu=new m("org.eclipse.elk.randomSeed"),sS=new m("org.eclipse.elk.separateConnectedComponents"),Mo=new m("org.eclipse.elk.nodeSize.constraints",new Set),Oo=new m("org.eclipse.elk.nodeSize.options",new Set([Nt.DEFAULT_MINIMUM_SIZE])),Yo=new m("org.eclipse.elk.nodeSize.minimum",new O(0,0)),To=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1),gr=new m("org.eclipse.elk.junctionPoints",new st),nS=new m("org.eclipse.elk.commentBox",!1),Aa=new m("org.eclipse.elk.edgeLabels.placement",St.CENTER),Ou=new m("org.eclipse.elk.edgeLabels.inline",!1),aS=new m("org.eclipse.elk.font.name"),lS=new m("org.eclipse.elk.font.size",null,1),cS=new m("org.eclipse.elk.hypernode",!1),gS=new m("org.eclipse.elk.labelManager"),hS=new m("org.eclipse.elk.softwrappingFuzziness",0),Nr=new m("org.eclipse.elk.margins",new me),bl=new m("org.eclipse.elk.noLayout",!1),au=new m("org.eclipse.elk.port.anchor"),Gl=new m("org.eclipse.elk.port.index"),Tr=new m("org.eclipse.elk.port.side",u.UNDEFINED),Ke=new m("org.eclipse.elk.port.borderOffset"),Ir=new m("org.eclipse.elk.portLabels.placement",it.outside),Hl=new m("org.eclipse.elk.portLabels.nextToPortIfPossible",!1),Su=new m("org.eclipse.elk.portLabels.treatAsGroup",!0),lu=new m("org.eclipse.elk.scaleFactor",1,Xe.greaterThan(0)),pi=new m("org.eclipse.elk.childAreaWidth"),Ei=new m("org.eclipse.elk.childAreaHeight"),js=new m("org.eclipse.elk.topdownLayout",!1),dS=new m("org.eclipse.elk.topdown.sizeCategories",3,1),fS=new m("org.eclipse.elk.topdown.sizeCategoriesHierarchicalNodeWeight",4,1),kp=new m("org.eclipse.elk.topdown.scaleFactor",1,Xe.greaterThan(0)),uS=new m("org.eclipse.elk.topdown.sizeApproximator"),Wp=new m("org.eclipse.elk.topdown.hierarchicalNodeWidth",150),zp=new m("org.eclipse.elk.topdown.hierarchicalNodeAspectRatio",1.414),_S=new m("org.eclipse.elk.topdown.nodeType"),pS=new m("org.eclipse.elk.topdown.scaleCap",1),ls=new m("org.eclipse.elk.insideSelfLoops.activate",!1),Ca=new m("org.eclipse.elk.insideSelfLoops.yo",!1),ES=new m("org.eclipse.elk.edge.thickness",1),mS=new m("org.eclipse.elk.edge.type",Cp.NONE),PS=new m("org.eclipse.elk.animate",!0),OS=new m("org.eclipse.elk.animTimeFactor",100,0),SS=new m("org.eclipse.elk.layoutAncestors",!1),TS=new m("org.eclipse.elk.maxAnimTime",4e3,0),NS=new m("org.eclipse.elk.minAnimTime",400,0),yS=new m("org.eclipse.elk.progressBar",!1),IS=new m("org.eclipse.elk.validateGraph",!1),RS=new m("org.eclipse.elk.validateOptions",!0),LS=new m("org.eclipse.elk.zoomToFit",!1),AS="org.eclipse.elk.layered",CS="org.eclipse.elk.orthogonal",xS="org.eclipse.elk.force",DS="org.eclipse.elk.circle",wS="org.eclipse.elk.tree",MS="org.eclipse.elk.planar",bS="org.eclipse.elk.radial",Yp="org.eclipse.elk.fixed",GS="org.eclipse.elk.box",HS="org.eclipse.elk.random";var Bl=class{static forGraph(t){let e=new yu;if(typeof t=="string")e._graphString=t;else if(t!=null&&typeof t=="object"&&!(t instanceof Array)){if(typeof t.getChildren=="function"&&typeof t.getProperty=="function")return new Iu(t);e._jsonGraph=t}else throw new Error("ElkGraphJson.forGraph expects a string, plain JSON object, or ElkNode.");return e}},yu=class{constructor(){this._graphString=null,this._jsonGraph=null,this._importerMaybe=null,this._lenient=!0}rememberImporter(t){return this._importerMaybe=t,this}lenient(t){return this._lenient=t,this}toElk(){if(this._jsonGraph==null){if(this._graphString==null)throw new Error("No graph has been set on the import builder.");if(this._jsonGraph=JSON.parse(this._graphString),this._jsonGraph==null||typeof this._jsonGraph!="object"||Array.isArray(this._jsonGraph))throw new Oi("Top-level element of the graph must be a json object.")}let t=new Ru,e=t.transform(this._jsonGraph);return this._importerMaybe!=null&&(this._importerMaybe.value=t),e}},Iu=class{constructor(t){this._graph=t,this._prettyPrint=!1,this._omitZeroPosition=!0,this._omitZeroDimension=!0,this._omitLayoutInformation=!1,this._shortLayoutOptionKeys=!0,this._omitUnknownLayoutOptions=!0}prettyPrint(t){return this._prettyPrint=t,this}shortLayoutOptionKeys(t){return this._shortLayoutOptionKeys=t,this}omitZeroPositions(t){return this._omitZeroPosition=t,this}omitZeroDimension(t){return this._omitZeroDimension=t,this}omitLayout(t){return this._omitLayoutInformation=t,this}omitUnknownLayoutOptions(t){return this._omitUnknownLayoutOptions=t,this}toJson(){let t=new Lu;t.setOptions({omitZeroPosition:this._omitZeroPosition,omitZeroDimension:this._omitZeroDimension,omitLayoutInformation:this._omitLayoutInformation,shortLayoutOptionKeys:this._shortLayoutOptionKeys,omitUnknownLayoutOptions:this._omitUnknownLayoutOptions});let e=t.export(this._graph);return this._prettyPrint?JSON.stringify(e,null,2):JSON.stringify(e)}},Oi=class extends Error{constructor(t){super(t),this.name="JsonImportException"}},Ru=class{constructor(){this._nodeIdMap=new Map,this._portIdMap=new Map,this._edgeIdMap=new Map,this._nodeJsonMap=new Map,this._portJsonMap=new Map,this._edgeJsonMap=new Map,this._labelJsonMap=new Map,this._inputModel=null}getInputModel(){return this._inputModel}transform(t){this._inputModel=t,this._nodeIdMap.clear(),this._portIdMap.clear(),this._edgeIdMap.clear(),this._nodeJsonMap.clear(),this._portJsonMap.clear(),this._edgeJsonMap.clear(),this._labelJsonMap.clear();let e=this._transformNode(t,null);return this._transformEdges(t),e}_transformNode(t,e){let o=e==null?Oa():Fs(e),r=t.id;if(r==null)throw new Oi("Every element must have an id.");if(o.identifier=String(r),this._nodeIdMap.set(r,o),this._nodeJsonMap.set(o,t),Au(o,t),Zr(o,t.layoutOptions),Zr(o,t.properties),Array.isArray(t.labels))for(let i of t.labels)Tu(i,o,this._labelJsonMap);if(Array.isArray(t.ports))for(let i of t.ports)this._transformPort(i,o);if(Array.isArray(t.children))for(let i of t.children)this._transformNode(i,o);return o}_transformPort(t,e){let o=Kf(e),r=t.id;if(r==null)throw new Oi("Every element must have an id.");if(o.identifier=String(r),this._portIdMap.set(r,o),this._portJsonMap.set(o,t),Au(o,t),Zr(o,t.layoutOptions),Zr(o,t.properties),Array.isArray(t.labels))for(let i of t.labels)Tu(i,o,this._labelJsonMap);return o}_transformEdges(t){if(Array.isArray(t.edges))for(let e of t.edges)this._transformEdge(e,this._nodeIdMap.get(t.id));if(Array.isArray(t.children))for(let e of t.children)this._transformEdges(e)}_transformEdge(t,e){var c,g,h,d,f,E;let o=t.id;if(o==null)throw new Oi("Every element must have an id.");let r=t.sources||[],i=t.targets||[];if(r.length===0||i.length===0)throw new Oi(`Edge ${o} must have at least one source and one target.`);let s=this._resolveShape(r[0]),a=this._resolveShape(i[0]);if(s==null||a==null)throw new Oi(`Edge ${o} references an unknown source or target.`);let l=Zf(s,a);l.identifier=String(o);for(let P=1;P<r.length;P++){let S=this._resolveShape(r[P]);S!=null&&l.getSources().push(S)}for(let P=1;P<i.length;P++){let S=this._resolveShape(i[P]);S!=null&&l.getTargets().push(S)}if(this._edgeIdMap.set(o,l),this._edgeJsonMap.set(l,t),Zr(l,t.layoutOptions),Zr(l,t.properties),Array.isArray(t.sections))for(let P of t.sections){let S=Nl(l);if(P.id!=null&&(S.identifier=String(P.id)),P.startPoint!=null&&(S.startX=(c=P.startPoint.x)!=null?c:0,S.startY=(g=P.startPoint.y)!=null?g:0),P.endPoint!=null&&(S.endX=(h=P.endPoint.x)!=null?h:0,S.endY=(d=P.endPoint.y)!=null?d:0),Array.isArray(P.bendPoints))for(let T of P.bendPoints)Sa(S,(f=T.x)!=null?f:0,(E=T.y)!=null?E:0)}if(Array.isArray(t.labels))for(let P of t.labels)Tu(P,l,this._labelJsonMap)}_resolveShape(t){let e=this._portIdMap.get(t)||this._nodeIdMap.get(t);if(e!=null)return e;let o=String(t),r=o.indexOf(":");if(r>0){let i=o.substring(r+1),s=this._nodeIdMap.get(o.substring(0,r));if(s!=null&&typeof s.getPorts=="function"){for(let a of s.getPorts())if(typeof a.getIdentifier=="function"&&a.getIdentifier()===i)return a}return this._portIdMap.get(i)||null}return null}transferLayout(t){this._transferShapesAndPorts(t),this._transferEdges(t)}_transferShapesAndPorts(t){let e=this._nodeJsonMap.get(t);e!=null&&xa(e,t);for(let o of t.getLabels()){let r=this._labelJsonMap.get(o);r!=null&&xa(r,o)}for(let o of t.getPorts()){let r=this._portJsonMap.get(o);r!=null&&xa(r,o);for(let i of o.getLabels()){let s=this._labelJsonMap.get(i);s!=null&&xa(s,i)}}for(let o of t.getChildren())this._transferShapesAndPorts(o)}_transferEdges(t){for(let e of t.getContainedEdges()){let o=this._edgeJsonMap.get(e);o!=null&&vS(o,e);for(let r of e.getLabels()){let i=this._labelJsonMap.get(r);i!=null&&xa(i,r)}}for(let e of t.getChildren())this._transferEdges(e)}};function xa(n,t){n.x=t.x||0,n.y=t.y||0,n.width=t.width||0,n.height=t.height||0}function vS(n,t){let e=t.getSections?t.getSections():[];if(e.length>0){let o=n.id!=null?String(n.id):"";n.sections=e.map((r,i)=>{let s={id:r.identifier||o+"_s"+i,startPoint:{x:r.startX||0,y:r.startY||0},endPoint:{x:r.endX||0,y:r.endY||0}};r.bendPoints&&r.bendPoints.length>0&&(s.bendPoints=r.bendPoints.map(c=>({x:c.x,y:c.y})));let a=r.getIncomingShape?r.getIncomingShape():null;a!=null&&a.identifier&&(s.incomingShape=a.identifier);let l=r.getOutgoingShape?r.getOutgoingShape():null;return l!=null&&l.identifier&&(s.outgoingShape=l.identifier),s})}if(t.hasProperty&&t.hasProperty(gr)){let o=t.getProperty(gr);o!=null&&o.length>0&&(n.junctionPoints=o.map(r=>({x:r.x,y:r.y})))}}var Lu=class{constructor(){this._options={omitZeroPosition:!0,omitZeroDimension:!0,omitLayoutInformation:!1,shortLayoutOptionKeys:!1,omitUnknownLayoutOptions:!0}}setOptions(t){Object.assign(this._options,t)}export(t){return this._exportNode(t)}_exportNode(t){let e={id:t.identifier||cs(t)};Cu(e,t,this._options),vl(e,t,this._options);let o=t.getLabels?t.getLabels():[];o&&o.length>0&&(e.labels=o.map(a=>Nu(a,this._options)));let r=t.getPorts?t.getPorts():[];r&&r.length>0&&(e.ports=r.map(a=>this._exportPort(a)));let i=t.getChildren?t.getChildren():[];i&&i.length>0&&(e.children=i.map(a=>this._exportNode(a)));let s=t.getContainedEdges?t.getContainedEdges():[];return s&&s.length>0&&(e.edges=s.map(a=>this._exportEdge(a))),e}_exportPort(t){let e={id:t.identifier||cs(t)};Cu(e,t,this._options),vl(e,t,this._options);let o=t.getLabels?t.getLabels():[];return o&&o.length>0&&(e.labels=o.map(r=>Nu(r,this._options))),e}_exportEdge(t){let e={id:t.identifier||cs(t),sources:t.getSources().map(i=>i.identifier||cs(i)),targets:t.getTargets().map(i=>i.identifier||cs(i))};vl(e,t,this._options);let o=t.getSections?t.getSections():[];o&&o.length>0&&!this._options.omitLayoutInformation&&(e.sections=o.map(i=>({id:i.identifier||cs(i),startPoint:{x:i.startX||0,y:i.startY||0},endPoint:{x:i.endX||0,y:i.endY||0},bendPoints:(i.bendPoints||[]).map(s=>({x:s.x,y:s.y}))})));let r=t.getLabels?t.getLabels():[];return r&&r.length>0&&(e.labels=r.map(i=>Nu(i,this._options))),e}},Vp=0,Xp=new WeakMap;function cs(n){let t=Xp.get(n);return t===void 0&&(Vp+=1,t="__auto_"+Vp,Xp.set(n,t)),t}function Au(n,t){t.x!=null&&(n.x=Number(t.x)),t.y!=null&&(n.y=Number(t.y)),t.width!=null&&(n.width=Number(t.width)),t.height!=null&&(n.height=Number(t.height))}function Cu(n,t,e){let o=t.x||0,r=t.y||0;(!e.omitZeroPosition||o!==0||r!==0)&&(n.x=o,n.y=r);let i=t.width||0,s=t.height||0;(!e.omitZeroDimension||i!==0||s!==0)&&(n.width=i,n.height=s)}function Zr(n,t,e=!0){if(t==null||typeof t!="object")return;let o=Ht.getInstance();for(let[r,i]of Object.entries(t)){let s=m.byId(r)||m.bySuffix(r),a=null;if(o!=null&&(a=o.getOptionData(r),a==null&&typeof o.getOptionDataBySuffix=="function"&&(a=o.getOptionDataBySuffix(r))),s!=null){if(!e&&n.hasProperty(s))continue;let l=BS(s,a,i);l!==void 0&&n.setProperty(s,l)}else if(a!=null){if(!e&&n.hasProperty(a))continue;let l=typeof a.parseValue=="function"?a.parseValue(String(i)):i;l!=null&&n.setProperty(a,l)}else{let l=new m(r);if(!e&&n.hasProperty(l))continue;n.setProperty(l,i)}}}function gs(n,t,e=!0){Zr(n,t,e)}function BS(n,t,e){let o=US.get(n.getId());if(o)return FS(o,e);if(t&&typeof t.parseValue=="function"){let s=t.parseValue(String(e));return s!=null?s:void 0}if(typeof e!="string")return e;let r=n.getDefault();if(r!=null){if(typeof r.parse=="function"&&typeof r.clone=="function"){let a=r.clone();try{return a.parse(String(e)),a}catch(l){return}}if(r instanceof Set){let a=new Set;for(let l of e.split(/[[\]\s,]+/))l&&a.add(l);return a}let s=r.constructor;if(s&&s!==Number&&s!==String&&s!==Boolean&&s!==Object){let a=s[e];if(a instanceof s)return a;if(Object.prototype.hasOwnProperty.call(s,"valueOf")&&typeof s.valueOf=="function"){let l=s.valueOf(e);if(l instanceof s)return l}if(/^\d+$/.test(e)&&typeof s.values=="function"){let l=s.values(),c=parseInt(e,10);if(Array.isArray(l)&&c<l.length)return l[c]}return}if(typeof r=="number"){let a=Number(e);return Number.isNaN(a)?void 0:a}if(typeof r=="boolean")return e==="true"?!0:e==="false"?!1:void 0}if(e==="true")return!0;if(e==="false")return!1;let i=Number(e);return!Number.isNaN(i)&&e.trim()!==""?i:e}var US=new Map([["org.eclipse.elk.position",O],["org.eclipse.elk.bendPoints",st],["org.eclipse.elk.port.anchor",O]]);function FS(n,t){if(t instanceof n)return t;if(typeof t=="string"){let e=new n;try{return e.parse(t),e}catch(o){return}}if(n===O&&t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number")return new O(t.x,t.y);if(n===st&&Array.isArray(t)){let e=new st;for(let o of t){if(o==null||typeof o.x!="number"||typeof o.y!="number")return;e.add(new O(o.x,o.y))}return e}}function vl(n,t,e){if(e.omitLayoutInformation)return;let o=t.getAllProperties?t.getAllProperties():null;if(o==null||o.size===0)return;let r={},i=!1;for(let[s,a]of o.entries()){if(s==null)continue;let l=s.getId?s.getId():s.id||null;l!=null&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean"?r[l]=a:a!=null&&typeof a.toString=="function"&&(r[l]=a.toString()),i=!0)}i&&(n.layoutOptions=r)}function Tu(n,t,e){let o=Tl(t);return n.id!=null&&(o.identifier=String(n.id)),n.text!=null&&(o.text=String(n.text)),Au(o,n),Zr(o,n.layoutOptions),Zr(o,n.properties),e!=null&&e.set(o,n),o}function Nu(n,t){let e={id:n.identifier||cs(n)};return n.text!=null&&(e.text=n.text),Cu(e,n,t),vl(e,n,t),e}var hs=class{visit(t){let e=Ul();t&&typeof t.getChildren=="function"&&!t.getProperty(e.NO_LAYOUT)&&this.resolveAlgorithm(t)}resolveAlgorithm(t){let e=Ul(),o=t.getProperty(e.ALGORITHM);if(!this.resolveAndSetAlgorithm(o,t)&&this.mustResolve(t))if(!o||o.trim()===""){let r=this.getDefaultLayoutAlgorithmID();if(!this.resolveAndSetAlgorithm(r,t)){let i=`Unable to load default layout algorithm '${r}' for unconfigured node`;throw t.getIdentifier&&(i+=` '${t.getIdentifier()}'`),new Error(i)}}else{let r=`Layout algorithm '${o}' not found`;throw t.getIdentifier&&(r+=` for node '${t.getIdentifier()}'`),new Error(r)}}resolveAndSetAlgorithm(t,e){let o=Ht.getInstance().getAlgorithmDataBySuffix(t);if(o!==null){let r=Ul();return e.setProperty(r.RESOLVED_ALGORITHM,o),!0}return!1}mustResolve(t){let e=Ul();return!t.hasProperty(e.RESOLVED_ALGORITHM)&&(t.getChildren().length>0||t.getProperty(e.INSIDE_SELF_LOOPS_ACTIVATE))}getDefaultLayoutAlgorithmID(){return"org.eclipse.elk.layered"}},Fl=null;function Ul(){if(!Fl)try{Fl=_injectedCoreOptions}catch(n){throw new Error("CoreOptions not available. Call LayoutAlgorithmResolver.setCoreOptions(CoreOptions) before using this class, or ensure CoreOptions is registered with LayoutMetaDataService.")}return Fl}hs.setCoreOptions=function(n){Fl=n};var kS=n=>{n.getProperty(Ir).add(it.NEXT_TO_PORT_IF_POSSIBLE),n.setProperty(Hl,null)},WS=n=>{n.getProperty(Oo).has(Nt.SPACE_EFFICIENT_PORT_LABELS)&&(n.getProperty(Ir).add(it.SPACE_EFFICIENT),n.getProperty(Oo).delete(Nt.SPACE_EFFICIENT_PORT_LABELS))},zS=new Map([[Hl,kS],[Oo,WS]]),kl=class{visit(t){for(let[e,o]of zS)t.hasProperty(e)&&o(t)}};var Wl=class{layout(t,e){let o=this._countNodesRecursively(t,!0);e.begin("Recursive Graph Layout",o),vp(t,new kl),t.hasProperty&&t.hasProperty(ss)||Kp(t,new hs),this._layoutRecursively(t,e),e.done()}_layoutRecursively(t,e){if(e.isCanceled())return[];if(t.getProperty&&t.getProperty(bl))return[];let o=t.children&&t.children.length>0,r=this._gatherInsideSelfLoops(t),i=r.length>0;if(!o&&!i)return[];let s=t.getProperty?t.getProperty(ss):null;if(!s)throw new Error("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before layout.");let a=s.supportsFeature("INSIDE_SELF_LOOPS");if(this._evaluateHierarchyHandlingInheritance(t),!o&&i&&!a)return[];let l=[],c=t.getProperty?t.getProperty(yr):null,g=s.supportsFeature("COMPOUND"),h=s.supportsFeature("CLUSTERS");if(c===Oe.INCLUDE_CHILDREN&&(g||h)){if(t.getProperty&&t.getProperty(js))throw new Error("Topdown layout cannot be used together with hierarchy handling.");let f=(t.children||[]).slice();for(;f.length>0;){let E=f.shift();this._evaluateHierarchyHandlingInheritance(E);let S=(E.getProperty?E.getProperty(yr):null)===Oe.SEPARATE_CHILDREN,T=E.getProperty&&E.hasProperty&&E.hasProperty(mi)&&!s.equals(E.getProperty(ss));if(S||T){let N=this._layoutRecursively(E,e);l.push(...N),E.setProperty&&E.setProperty(yr,Oe.SEPARATE_CHILDREN),ru(E)}else f.push(...E.children||[])}}else for(let f of t.children||[]){let E=this._layoutRecursively(f,e);l.push(...E),ru(f)}if(e.isCanceled())return[];for(let f of l)f.setProperty&&f.setProperty(bl,!0);let d=t.children?t.children.length:0;return this._executeAlgorithm(t,s,e.subTask(d)),this._postProcessInsideSelfLoops(l),i&&a?r:[]}_executeAlgorithm(t,e,o){let r=e.createLayoutProvider();try{r.layout(t,o)}catch(i){throw r.dispose(),i}}_countNodesRecursively(t,e){let o=(t.children||[]).length;for(let r of t.children||[])r.children&&r.children.length>0&&(o+=this._countNodesRecursively(r,!1));if(e){let r=t.parent;for(;r;)o+=(r.children||[]).length,r=r.parent}return o}_countNodesWithHierarchy(t){let e=(t.children||[]).length;for(let o of t.children||[])if((o.getProperty?o.getProperty(yr):null)!==Oe.SEPARATE_CHILDREN){let i=t.getProperty?t.getProperty(ss):null,s=o.getProperty?o.getProperty(ss):null;(i===s||i&&i.equals&&i.equals(s))&&o.children&&o.children.length>0&&(e+=this._countNodesWithHierarchy(o))}return e}_evaluateHierarchyHandlingInheritance(t){if(!t.getProperty)return;if(t.getProperty(yr)===Oe.INHERIT)if(!t.parent)t.setProperty(yr,Oe.SEPARATE_CHILDREN);else{let o=t.parent.getProperty?t.parent.getProperty(yr):Oe.SEPARATE_CHILDREN;t.setProperty(yr,o)}}_gatherInsideSelfLoops(t){if(!t.getProperty||!t.getProperty(ls))return[];let e=[];for(let o of Ee(t))o.isSelfloop&&o.isSelfloop()&&o.getProperty&&o.getProperty(Ca)&&e.push(o);return e}_postProcessInsideSelfLoops(t){for(let e of t){let o=e.sources&&e.sources[0];if(!o)continue;let r=o.parent!==void 0?o.parent:o,i=r.x||0,s=r.y||0;if(!e.sections||e.sections.length===0)continue;let a=e.sections[0];a.setStartLocation(a.startX+i,a.startY+s),a.setEndLocation(a.endX+i,a.endY+s);for(let l of a.bendPoints||[])l.set(l.x+i,l.y+s);if(e.getProperty){let l=e.getProperty(gr);l&&typeof l.offset=="function"&&l.offset(i,s)}}}};function Kp(n,t){t.visit(n);for(let e of n.children||[])Kp(e,t);for(let e of n.ports||[])t.visit(e);for(let e of n.labels||[])t.visit(e);for(let e of n.containedEdges||[])t.visit(e)}var zl=class{isCanceled(){return!1}begin(t,e){return!1}worked(t){}done(){}isRunning(){return!1}getTaskName(){return null}subTask(t){return this}getSubMonitors(){return null}getParentMonitor(){return null}isLoggingEnabled(){return!1}isLogPersistenceEnabled(){return!1}log(t){}getLogs(){return null}logGraph(t,e,o){}getLoggedGraphs(){return null}isExecutionTimeMeasured(){return!1}getExecutionTime(){return 0}};var Se=class n{constructor(t){this._id=t.id||"",this._name=t.name||"",this._description=t.description||"",this._category=t.category||null,this._melkBundleName=t.melkBundleName||null,this._definingBundleId=t.definingBundleId||null,this._imagePath=t.imagePath||null,this._supportedFeatures=t.supportedFeatures||new Set,this._providerFactory=t.providerFactory||null,this._validatorClass=t.validatorClass||null,this._knownOptions=new Map}getId(){return this._id}getName(){return this._name}getDescription(){return this._description}getCategoryId(){return this._category}getBundleName(){return this._melkBundleName}getDefiningBundleId(){return this._definingBundleId}getPreviewImagePath(){return this._imagePath}getSupportedFeatures(){return this._supportedFeatures}supportsFeature(t){return this._supportedFeatures.has(t)}getValidatorClass(){return this._validatorClass}createLayoutProvider(){return this._providerFactory?this._providerFactory():null}getInstancePool(){let t=this._providerFactory;return{fetch(){return t?t():null},release(e){},clear(){}}}addKnownOption(t,e){this._knownOptions.set(t.getId(),e)}getKnownOptionIds(){return new Set(this._knownOptions.keys())}knowsOption(t){let e=typeof t=="string"?t:t.getId();return this._knownOptions.has(e)}getDefaultValue(t){let e=typeof t=="string"?t:t.getId();return this._knownOptions.get(e)}equals(t){return t instanceof n?this._id===t._id:!1}toString(){return`Layout Algorithm: ${this._id}`}},xu=class{constructor(){this._id="",this._name="",this._description="",this._category=null,this._melkBundleName=null,this._definingBundleId=null,this._imagePath=null,this._supportedFeatures=null,this._providerFactory=null,this._validatorClass=null}create(){return new Se({id:this._id,name:this._name,description:this._description,category:this._category,melkBundleName:this._melkBundleName,definingBundleId:this._definingBundleId,imagePath:this._imagePath,supportedFeatures:this._supportedFeatures||new Set,providerFactory:this._providerFactory,validatorClass:this._validatorClass})}id(t){return this._id=t,this}name(t){return this._name=t,this}description(t){return this._description=t,this}category(t){return this._category=t,this}melkBundleName(t){return this._melkBundleName=t,this}definingBundleId(t){return this._definingBundleId=t,this}imagePath(t){return this._imagePath=t,this}supportedFeatures(t){return this._supportedFeatures=t,this}providerFactory(t){return this._providerFactory=t,this}validatorClass(t){return this._validatorClass=t,this}};Se.Builder=xu;var Zp=new m("org.eclipse.elk.padding",new yt(15));var Yl=class extends de{layout(t,e){e.begin("Fixed Layout",1);let o=t.getProperty(cu),r=0,i=0;for(let s of t.children){let a=s.getProperty(ho);if(a!=null){s.setLocation(a.x,a.y);let l=s.getProperty(Mo);if(l&&l.has(mt.MINIMUM_SIZE)){let c=s.getProperty(Yo);c!=null&&c.x>0&&c.y>0&&Ae(s,c.x,c.y,!0,!0)}}r=Math.max(r,s.getX()+s.getWidth()),i=Math.max(i,s.getY()+s.getHeight());for(let l of s.labels)a=l.getProperty(ho),a!=null&&l.setLocation(a.x,a.y),r=Math.max(r,s.getX()+l.getX()+l.getWidth()),i=Math.max(i,s.getY()+l.getY()+l.getHeight());for(let l of s.ports){a=l.getProperty(ho),a!=null&&l.setLocation(a.x,a.y);let c=s.getX()+l.getX(),g=s.getY()+l.getY();r=Math.max(r,c+l.getWidth()),i=Math.max(i,g+l.getHeight());for(let h of l.labels)a=h.getProperty(ho),a!=null&&h.setLocation(a.x,a.y),r=Math.max(r,c+h.getX()+h.getWidth()),i=Math.max(i,g+h.getY()+h.getHeight())}for(let l of Ee(s)){let c=this._processEdge(l,o);r=Math.max(r,c.x),i=Math.max(i,c.y)}for(let l of _i(s)){let c=Pt(l.sources[0]);if(c&&c.parent!==t){let g=this._processEdge(l,o);r=Math.max(r,g.x),i=Math.max(i,g.y)}}}if(o===At.ORTHOGONAL)for(let s of t.children)for(let a of Ee(s))this._generateJunctionPoints(a);if(!t.getProperty(To)){let s=t.getProperty(Zp),a=r+s.getLeft()+s.getRight(),l=i+s.getTop()+s.getBottom();Ae(t,a,l,!0,!0)}e.done()}_processEdge(t,e){let o=Pt(t.sources[0]),r=Pt(t.targets[0]),i=o?o.parent:null,s=r?r.parent:null,a=i===s,l=new O,c=t.getProperty(Cl);if(c!=null&&c.size()>=2&&(t.sections.length===0?t.sections.push(new Vr):t.sections.length>1&&t.sections.splice(1,t.sections.length-1),Xs(c,t.sections[0])),a)for(let g of t.sections)for(let h of g.bendPoints)l.x=Math.max(l.x,h.getX()),l.y=Math.max(l.y,h.getY());for(let g of t.labels){let h=g.getProperty(ho);h!=null&&g.setLocation(h.x,h.y),a&&(l.x=Math.max(l.x,g.getX()+g.getWidth()),l.y=Math.max(l.y,g.getY()+g.getHeight()))}return l}_generateJunctionPoints(t){let e=Gp(t);e.isEmpty()?t.setProperty(gr,null):t.setProperty(gr,e)}};var jp=new m("org.eclipse.elk.padding",new yt(15)),$p=new m("org.eclipse.elk.spacing.nodeNode",15,0),qp=new m("org.eclipse.elk.randomSeed",0),Jp=new m("org.eclipse.elk.aspectRatio",1.6,Xe.greaterThan(0));var Qp=BigInt(0x5DEECE66D),XS=BigInt(11),tE=(BigInt(1)<<BigInt(48))-BigInt(1),dr=class{constructor(t){t==null||t===0?(this._mathFallback=!0,this._seed=BigInt(0)):(this._mathFallback=!1,this.setSeed(t))}setSeed(t){let e=typeof t=="bigint"?t:BigInt(t);this._seed=(e^Qp)&tE,this._mathFallback=!1,this._nextGaussianStored=void 0}_next(t){this._seed=this._seed*Qp+XS&tE;let e=this._seed>>BigInt(48-t);return Number(e&BigInt(0xFFFFFFFF))|0}nextDouble(){if(this._mathFallback)return Math.random();let t=BigInt(this._next(26)),e=BigInt(this._next(27)),o=(t<<BigInt(27))+e;return Number(o)/Number(BigInt(1)<<BigInt(53))}nextFloat(){return this._mathFallback?Math.random():this._next(24)/(1<<24)}nextInt(t){if(this._mathFallback)return Math.floor(Math.random()*t);if(t<=0)throw new Error("bound must be positive");if((t&-t)===t){let r=BigInt(this._next(31));return Number(BigInt(t)*r>>BigInt(31))}let e,o;do e=this._next(31),o=e%t;while((e-o+(t-1)|0)<0);return o}nextBoolean(){return this._mathFallback?Math.random()>=.5:this._next(1)!==0}nextLong(){if(this._mathFallback)return BigInt(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER));let t=BigInt(this._next(32)),e=BigInt(this._next(32));return BigInt.asIntN(64,(t<<BigInt(32))+e)}nextGaussian(){if(this._mathFallback)return KS();if(this._nextGaussianStored!==void 0){let i=this._nextGaussianStored;return this._nextGaussianStored=void 0,i}let t,e,o;do t=2*this.nextDouble()-1,e=2*this.nextDouble()-1,o=t*t+e*e;while(o>=1||o===0);let r=Math.sqrt(-2*Math.log(o)/o);return this._nextGaussianStored=e*r,t*r}};function KS(){let n=0,t=0;for(;n===0;)n=Math.random();for(;t===0;)t=Math.random();return Math.sqrt(-2*Math.log(n))*Math.cos(2*Math.PI*t)}var $s=class n extends de{layout(t,e){if(e.begin("Random Layout",1),t.children.length===0){e.done();return}let o=t.getProperty(qp),r=o!=null&&o!==0?new dr(o):new dr,i=t.getProperty(Jp),s=t.getProperty($p),a=t.getProperty(jp);this._randomizeGraph(t,r,i,s,a),e.done()}_randomizeGraph(t,e,o,r,i){let s=0,a=0,l=0,c=1;for(let T of t.children){for(let C of Ee(T))c++;let N=T.getWidth();a=Math.max(a,N);let I=T.getHeight();l=Math.max(l,I),s+=N*I}let g=t.children.length,h=s+2*r*r*c*g,d=Math.sqrt(h),f=Math.max(d*o,a),E=Math.max(d/o,l);for(let T of t.children){let N=i.getLeft()+e.nextDouble()*(f-T.getWidth()),I=i.getLeft()+e.nextDouble()*(E-T.getHeight());T.setLocation(N,I)}let P=f+i.getHorizontal(),S=E+i.getVertical();for(let T of t.children)for(let N of Ee(T))N.isHierarchical()||this._randomizeEdge(N,e,P,S);P+=i.getLeft()+i.getRight(),S+=i.getTop()+i.getBottom(),Ae(t,P,S,!1,!0)}_randomizeEdge(t,e,o,r){let i=t.sources[0],s=i.getX(),a=i.getY(),l=i.getWidth()/2,c=i.getHeight()/2;i instanceof Ve&&(s+=i.getParent().getX(),s+=i.getParent().getX()),s+=l,a+=c;let g=t.sources[0],h=g.getX(),d=g.getY(),f=g.getWidth()/2,E=g.getHeight()/2;if(g instanceof Ve&&(h+=g.getParent().getX(),h+=g.getParent().getX()),h+=f,d+=E,t.sections.length===0)t.sections.push(new Vr);else if(t.sections.length>1){let ot=t.sections[t.sections.length-1];t.sections.length=0,t.sections.push(ot)}let P=t.sections[0],S=h;h>s+l?S=s+l:h<s-l&&(S=s-l);let T=d;d>a+c?T=a+c:d<a-c&&(T=a-c),S>s-l&&S<s+l&&T>a-c&&T<a+c&&(S=s+l),P.setStartLocation(S,T);let N=s;s>h+f?N=h+f:s<h-f&&(N=h-f);let I=a;a>d+E?I=d+E:a<d-E&&(I=d-E),N>h-f&&N<h+f&&I>d-E&&I<d+E&&(I=d+E),P.setEndLocation(N,I),P.bendPoints.length=0;let C=e.nextInt(n.MAX_BENDS);i===g&&C++;let x=N-S,M=I-T,B=Math.sqrt(x*x+M*M)*n.RAND_FACT,Y=x/(C+1),j=M/(C+1),X=S,tt=T;for(let ot=0;ot<C;ot++){X+=Y,tt+=j;let Lt=X+e.nextFloat()*B-B/2;Lt<0?Lt=1:Lt>o&&(Lt=o-1);let zt=tt+e.nextFloat()*B-B/2;zt<0?zt=1:zt>r&&(zt=r-1);let be=new Xr;be.set(Lt,zt),P.bendPoints.push(be)}}};$s.MAX_BENDS=5;$s.RAND_FACT=.2;var ZS=[{id:"org.eclipse.elk.fixed",name:"ELK Fixed",description:"Keeps the current layout as it is, without any automatic modification. Optional coordinates can be given for nodes and edge bend points.",providerFactory:()=>new Yl},{id:"org.eclipse.elk.box",name:"ELK Box",description:"Algorithm for packing of unconnected boxes, i.e. graphs without edges.",providerFactory:()=>new rs},{id:"org.eclipse.elk.random",name:"ELK Randomizer",description:'Distributes the nodes randomly on the plane, leading to very obfuscating layouts. Can be useful to demonstrate the power of "real" layout algorithms.',providerFactory:()=>new $s}],jS=!1;function eE(){let n=Ht.getInstance(),t=[];for(let e of ZS){let o=n.getAlgorithmData(e.id);if(o){t.push(o);continue}let r=new Se.Builder().id(e.id).name(e.name).description(e.description).definingBundleId("org.eclipse.elk.core").providerFactory(e.providerFactory).supportedFeatures(new Set).create();n.registerLayoutMetaDataProviders({apply(i){i.register(r)}}),t.push(r)}return jS=!0,t}var Da=class{constructor(t){this._includeLabels=!0,this._includePorts=!0,this._includePortLabels=!0,this._includeEdgeHeadTailLabels=!0,this._adapter=t}excludeLabels(){return this._includeLabels=!1,this}excludePorts(){return this._includePorts=!1,this}excludePortLabels(){return this._includePortLabels=!1,this}excludeEdgeHeadTailLabels(){return this._includeEdgeHeadTailLabels=!1,this}process(){let t=this._adapter.getProperty(Zs);for(let e of this._adapter.getNodes())this._processNode(e,t)}processNode(t){let e=this._adapter.getProperty(Zs);this._processNode(t,e)}_processNode(t,e){let o=new dt(t.getPosition().x,t.getPosition().y,t.getSize().x,t.getSize().y),r=new dt;if(this._includeLabels)for(let s of t.getLabels())r.x=s.getPosition().x+t.getPosition().x,r.y=s.getPosition().y+t.getPosition().y,r.width=s.getSize().x,r.height=s.getSize().y,o.union(r);for(let s of t.getPorts()){let a=s.getPosition().x+t.getPosition().x,l=s.getPosition().y+t.getPosition().y;if(this._includePorts&&(r.x=a,r.y=l,r.width=s.getSize().x,r.height=s.getSize().y,o.union(r)),this._includePortLabels)for(let c of s.getLabels())r.x=c.getPosition().x+a,r.y=c.getPosition().y+l,r.width=c.getSize().x,r.height=c.getSize().y,o.union(r);if(this._includeEdgeHeadTailLabels){let c=new O(-e,-e);if(t.getProperty(Ir).has(it.OUTSIDE))for(let g of s.getLabels())c.x+=g.getSize().x+e,c.y+=g.getSize().y+e;c.x=Math.max(c.x,0),c.y=Math.max(c.y,0),this._processEdgeHeadTailLabels(o,s.getOutgoingEdges(),s.getIncomingEdges(),t,s,c,e)}}this._includeEdgeHeadTailLabels&&this._processEdgeHeadTailLabels(o,t.getOutgoingEdges(),t.getIncomingEdges(),t,null,null,e);let i=new me(t.getMargin());i.top=Math.max(0,t.getPosition().y-o.y),i.bottom=Math.max(0,o.y+o.height-(t.getPosition().y+t.getSize().y)),i.left=Math.max(0,t.getPosition().x-o.x),i.right=Math.max(0,o.x+o.width-(t.getPosition().x+t.getSize().x)),t.setMargin(i)}_processEdgeHeadTailLabels(t,e,o,r,i,s,a){let l=new dt;for(let c of e)for(let g of c.getLabels())g.getProperty(Aa)===St.TAIL&&(this._computeLabelBox(l,g,!1,r,i,s,a),t.union(l));for(let c of o)for(let g of c.getLabels())g.getProperty(Aa)===St.HEAD&&(this._computeLabelBox(l,g,!0,r,i,s,a),t.union(l))}_computeLabelBox(t,e,o,r,i,s,a){if(t.x=r.getPosition().x,t.y=r.getPosition().y,i!=null&&(t.x+=i.getPosition().x,t.y+=i.getPosition().y),t.width=e.getSize().x,t.height=e.getSize().y,i==null)o?t.x-=a+e.getSize().x:t.x+=r.getSize().x+a;else switch(i.getSide()){case u.UNDEFINED:case u.EAST:t.x+=i.getSize().x+a+s.x+a;break;case u.WEST:t.x-=a+s.x+a+e.getSize().x;break;case u.NORTH:t.x+=i.getSize().x+a,t.y-=a+s.y+a+e.getSize().y;break;case u.SOUTH:t.x+=i.getSize().x+a,t.y+=i.getSize().y+a+s.y+a;break}}};var G=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};G.BEGIN=new G("BEGIN");G.CENTER=new G("CENTER");G.END=new G("END");var Si=class{constructor(){this._padding=new yt,this._cellRectangle=new dt,this._contributesToMinimumWidth=!1,this._contributesToMinimumHeight=!1}getPadding(){return this._padding}getCellRectangle(){return this._cellRectangle}isContributingToMinimumWidth(){return this._contributesToMinimumWidth}setContributesToMinimumWidth(t){this._contributesToMinimumWidth=t}isContributingToMinimumHeight(){return this._contributesToMinimumHeight}setContributesToMinimumHeight(t){this._contributesToMinimumHeight=t}getMinimumWidth(){throw new Error("getMinimumWidth() must be implemented by subclass")}getMinimumHeight(){throw new Error("getMinimumHeight() must be implemented by subclass")}};var ds=class extends Si{constructor(){super(),this._minimumContentAreaSize=new O}getMinimumContentAreaSize(){return this._minimumContentAreaSize}setMinimumContentAreaSize(t,e){if(e){let o=this.getPadding();this._minimumContentAreaSize.x=t.x-o.left-o.right,this._minimumContentAreaSize.y=t.y-o.top-o.bottom}else this._minimumContentAreaSize.set(t)}getMinimumWidth(){let t=this.getPadding();return this._minimumContentAreaSize.x+t.left+t.right}getMinimumHeight(){let t=this.getPadding();return this._minimumContentAreaSize.y+t.top+t.bottom}};var Ze=class extends Si{layoutChildrenHorizontally(){throw new Error("layoutChildrenHorizontally() must be implemented by subclass")}layoutChildrenVertically(){throw new Error("layoutChildrenVertically() must be implemented by subclass")}static minWidthOfCell(t,e){return t==null||e&&!t.isContributingToMinimumWidth()||t instanceof ds&&t.getMinimumContentAreaSize().x===0?0:t.getMinimumWidth()}static minHeightOfCell(t,e){return t==null||e&&!t.isContributingToMinimumHeight()||t instanceof ds&&t.getMinimumContentAreaSize().y===0?0:t.getMinimumHeight()}applyHorizontalLayout(t,e,o){if(t!=null){let r=t.getCellRectangle();r.x=e,r.width=o}}applyVerticalLayout(t,e,o){if(t!=null){let r=t.getCellRectangle();r.y=e,r.height=o}}};var ve=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};ve.VERTICAL=new ve("VERTICAL");ve.HORIZONTAL=new ve("HORIZONTAL");var oE=new Map([[G.BEGIN,0],[G.CENTER,1],[G.END,2]]),Rr=class extends Ze{constructor(t,e,o){super(),this._containerMode=t,this._symmetrical=e,this._gap=o,this._cells=[null,null,null]}getContainerMode(){return this._containerMode}getGap(){return this._gap}getCell(t){return this._cells[oE.get(t)]}setCell(t,e){this._cells[oE.get(t)]=e}getMinimumWidth(){let t=0,e=this.getPadding();if(this._containerMode===ve.VERTICAL)for(let o of this._cells)o!=null&&o.isContributingToMinimumWidth()&&(t=Math.max(t,o.getMinimumWidth()));else{let o=this._minCellWidths(!0),r=0;for(let i of o)i>0&&(t+=i,r++);r>1&&(t+=this._gap*(r-1))}return t>0?t+e.left+e.right:0}getMinimumHeight(){let t=0,e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=this._minCellHeights(!0),r=0;for(let i of o)i>0&&(t+=i,r++);r>1&&(t+=this._gap*(r-1))}else for(let o of this._cells)o!=null&&o.isContributingToMinimumHeight()&&(t=Math.max(t,o.getMinimumHeight()));return t>0?t+e.top+e.bottom:0}layoutChildrenHorizontally(){let t=this.getCellRectangle(),e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=t.x+e.left,r=t.width-e.left-e.right;for(let i of this._cells)this.applyHorizontalLayout(i,o,r)}else{let o=this._minCellWidths(!1);this.applyHorizontalLayout(this._cells[0],t.x+e.left,o[0]),this.applyHorizontalLayout(this._cells[2],t.x+t.width-e.right-o[2],o[2]);let r=t.width-e.left-e.right;o[0]>0&&(r-=o[0]+this._gap,o[0]+=this._gap),o[2]>0&&(r-=o[2]+this._gap),o[1]=Math.max(o[1],r),this.applyHorizontalLayout(this._cells[1],t.x+e.left+o[0]-(o[1]-r)/2,o[1])}for(let o of this._cells)o instanceof Ze&&o.layoutChildrenHorizontally()}layoutChildrenVertically(){let t=this.getCellRectangle(),e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=this._minCellHeights(!1);this.applyVerticalLayout(this._cells[0],t.y+e.top,o[0]),this.applyVerticalLayout(this._cells[2],t.y+t.height-e.bottom-o[2],o[2]);let i=t.height-e.top-e.bottom;o[0]>0&&(o[0]+=this._gap,i-=o[0]),o[2]>0&&(i-=o[2]+this._gap),o[1]=Math.max(o[1],i),this.applyVerticalLayout(this._cells[1],t.y+e.top+o[0]-(o[1]-i)/2,o[1])}else{let o=t.y+e.top,r=t.height-e.top-e.bottom;for(let i of this._cells)this.applyVerticalLayout(i,o,r)}for(let o of this._cells)o instanceof Ze&&o.layoutChildrenVertically()}_minCellWidths(t){let e=[Ze.minWidthOfCell(this._cells[0],t),Ze.minWidthOfCell(this._cells[1],t),Ze.minWidthOfCell(this._cells[2],t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}_minCellHeights(t){let e=[Ze.minHeightOfCell(this._cells[0],t),Ze.minHeightOfCell(this._cells[1],t),Ze.minHeightOfCell(this._cells[2],t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}};var bo=class n extends ge{constructor(t){if(super(),t){let e=t.getAllProperties(),o=this.getAllProperties();for(let[r,i]of e)o.set(r,i)}}static getIndividualOrInherited(t,e){let o=null;if(t.hasProperty(as)){let r=t.getProperty(as);r&&r.hasProperty(e)&&(o=r.getProperty(e))}if(o==null)if(typeof t.getGraph=="function"){let r=t.getGraph();r!=null&&(o=r.getProperty(e)),o==null&&typeof e.getDefault=="function"&&(o=e.getDefault())}else{let r=typeof t.getParent=="function"?t.getParent():t.parent;r!=null&&(o=r.getProperty(e))}return o}toString(){let t=[];for(let[e,o]of this.getAllProperties())t.push(`${e.getId()}:${o}`);return t.join(n.SERIALIZED_OPTION_SEPARATOR)}parse(t){if(!(t==null||t===""))try{let e=t.split(n.SERIALIZED_OPTION_SEPARATOR);for(let o of e){let r=o.indexOf(":");if(r<0)throw new Error(`Invalid option format: ${o}`);let i=o.substring(0,r),s=o.substring(r+1),a=Ht.getInstance().getOptionDataBySuffix(i);if(a==null)throw new Error(`Invalid option id: ${i}`);let l=a.parseValue(s);if(l==null)throw new Error(`Invalid option value: ${s}`);this.setProperty(a,l)}}catch(e){throw new Error("The given string does not match the expected format for individual spacings: "+(e&&e.message?e.message:String(e)))}}};bo.SERIALIZED_OPTION_SEPARATOR=";,;";var Du=class{constructor(t,e){this._sideComparator=t,this._valueComparator=e,this._byKey=new Map}put(t,e){let o=this._byKey.get(t);o==null&&(o=[],this._byKey.set(t,o)),o.push(e),o.sort(this._valueComparator)}get(t){var e;return(e=this._byKey.get(t))!=null?e:[]}containsKey(t){return this._byKey.has(t)}values(){let t=[...this._byKey.keys()].sort(this._sideComparator),e=[];for(let o of t)for(let r of this._byKey.get(o))e.push(r);return e}get size(){let t=0;for(let e of this._byKey.values())t+=e.length;return t}},qs=class n{constructor(t,e){if(this.node=e,this.nodeSize=new O(e.getSize()),this.topdownLayout=e.getProperty(js),this.treatAsCompoundNode=e.isCompoundNode()||e.getProperty(ls),this.sizeConstraints=e.getProperty(Mo),this.sizeOptions=e.getProperty(Oo),this.portConstraints=e.getProperty(cr),this.portLabelsPlacement=e.getProperty(Ir),!it.isValid(this.portLabelsPlacement))throw new Error(`Invalid port label placement: ${[...this.portLabelsPlacement]}`);if(this.portLabelsTreatAsGroup=e.getProperty(Su),this.nodeLabelPlacement=k.ensureSet(e.getProperty(Kr)),!k.isValid(this.nodeLabelPlacement))throw new Error(`Invalid node label placement: ${[...this.nodeLabelPlacement]}`);this.nodeLabelsPadding=bo.getIndividualOrInherited(e,pu),this.nodeLabelSpacing=bo.getIndividualOrInherited(e,Zs),this.labelLabelSpacing=bo.getIndividualOrInherited(e,hu),this.portPortSpacing=bo.getIndividualOrInherited(e,uu),this.portLabelSpacingHorizontal=bo.getIndividualOrInherited(e,du),this.portLabelSpacingVertical=bo.getIndividualOrInherited(e,fu),this.surroundingPortMargins=bo.getIndividualOrInherited(e,_u),this.labelCellSpacing=2*this.labelLabelSpacing;let o=!this.sizeOptions.has(Nt.ASYMMETRICAL);this.nodeContainer=new Rr(ve.VERTICAL,o,0),this.nodeContainerMiddleRow=new Rr(ve.HORIZONTAL,o,0),this.nodeContainer.setCell(G.CENTER,this.nodeContainerMiddleRow),this.portContexts=new Du(n.comparePortSides,n.comparePortContexts),this.insideNodeLabelContainer=null,this.insidePortLabelCells=new Map,this.outsideNodeLabelContainers=new Map,this.nodeLabelCells=new Map}applyNodeSize(){this.node.setSize(this.nodeSize)}getPortAlignment(t){let e=null,o=this.node;switch(t){case u.NORTH:o.hasProperty(xl)&&(e=o.getProperty(xl));break;case u.SOUTH:o.hasProperty(Dl)&&(e=o.getProperty(Dl));break;case u.EAST:o.hasProperty(Ml)&&(e=o.getProperty(Ml));break;case u.WEST:o.hasProperty(wl)&&(e=o.getProperty(wl));break}return e==null&&(e=o.getProperty(Eu)),e}static comparePortSides(t,e){return n._PORT_SIDE_ORDINAL.get(t)-n._PORT_SIDE_ORDINAL.get(e)}static comparePortContexts(t,e){let o=n.comparePortSides(t.port.getSide(),e.port.getSide());if(o!==0)return o;switch(t.port.getSide()){case u.NORTH:case u.EAST:return t.port.getVolatileId()-e.port.getVolatileId();case u.SOUTH:case u.WEST:return e.port.getVolatileId()-t.port.getVolatileId();default:return 0}}};qs._PORT_SIDE_ORDINAL=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);var lt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};lt.LEFT=new lt("LEFT");lt.CENTER=new lt("CENTER");lt.RIGHT=new lt("RIGHT");var nt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};nt.TOP=new nt("TOP");nt.CENTER=new nt("CENTER");nt.BOTTOM=new nt("BOTTOM");function $S(n,t){if(n===t)return!0;if(!(n instanceof Set)||!(t instanceof Set)||n.size!==t.size)return!1;for(let e of n)if(!t.has(e))return!1;return!0}var Q=class n{constructor(t,e,o,r,i,s){this.name=t,this._horizontalAlignment=e,this._verticalAlignment=o,this._containerRow=r,this._containerColumn=i,this._assignedPlacements=s,Object.freeze(this)}getHorizontalAlignment(){return this._horizontalAlignment}getVerticalAlignment(){return this._verticalAlignment}getContainerRow(){return this._containerRow}getContainerColumn(){return this._containerColumn}static fromNodeLabelPlacement(t){for(let e of n.values())for(let o of e._assignedPlacements)if($S(o,t))return e;return n.UNDEFINED}static values(){return n._VALUES}isInsideLocation(){switch(this){case n.IN_T_L:case n.IN_T_C:case n.IN_T_R:case n.IN_C_L:case n.IN_C_C:case n.IN_C_R:case n.IN_B_L:case n.IN_B_C:case n.IN_B_R:return!0;default:return!1}}getOutsideSide(){switch(this){case n.OUT_T_L:case n.OUT_T_C:case n.OUT_T_R:return u.NORTH;case n.OUT_B_L:case n.OUT_B_C:case n.OUT_B_R:return u.SOUTH;case n.OUT_L_T:case n.OUT_L_C:case n.OUT_L_B:return u.WEST;case n.OUT_R_T:case n.OUT_R_C:case n.OUT_R_B:return u.EAST;default:return u.UNDEFINED}}toString(){return this.name}},b=k,vt=(...n)=>new Set(n);Q.OUT_T_L=new Q("OUT_T_L",lt.LEFT,nt.BOTTOM,G.BEGIN,G.BEGIN,[vt(b.OUTSIDE,b.V_TOP,b.H_LEFT)]);Q.OUT_T_C=new Q("OUT_T_C",lt.CENTER,nt.BOTTOM,G.BEGIN,G.CENTER,[vt(b.OUTSIDE,b.V_TOP,b.H_CENTER),vt(b.OUTSIDE,b.V_TOP,b.H_CENTER,b.H_PRIORITY)]);Q.OUT_T_R=new Q("OUT_T_R",lt.RIGHT,nt.BOTTOM,G.BEGIN,G.END,[vt(b.OUTSIDE,b.V_TOP,b.H_RIGHT)]);Q.OUT_B_L=new Q("OUT_B_L",lt.LEFT,nt.TOP,G.END,G.BEGIN,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_LEFT)]);Q.OUT_B_C=new Q("OUT_B_C",lt.CENTER,nt.TOP,G.END,G.CENTER,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_CENTER),vt(b.OUTSIDE,b.V_BOTTOM,b.H_CENTER,b.H_PRIORITY)]);Q.OUT_B_R=new Q("OUT_B_R",lt.RIGHT,nt.TOP,G.END,G.END,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_RIGHT)]);Q.OUT_L_T=new Q("OUT_L_T",lt.RIGHT,nt.TOP,G.BEGIN,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_TOP,b.H_PRIORITY)]);Q.OUT_L_C=new Q("OUT_L_C",lt.RIGHT,nt.CENTER,G.CENTER,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_CENTER),vt(b.OUTSIDE,b.H_LEFT,b.V_CENTER,b.H_PRIORITY)]);Q.OUT_L_B=new Q("OUT_L_B",lt.RIGHT,nt.BOTTOM,G.END,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_BOTTOM,b.H_PRIORITY)]);Q.OUT_R_T=new Q("OUT_R_T",lt.LEFT,nt.TOP,G.BEGIN,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_TOP,b.H_PRIORITY)]);Q.OUT_R_C=new Q("OUT_R_C",lt.LEFT,nt.CENTER,G.CENTER,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_CENTER),vt(b.OUTSIDE,b.H_RIGHT,b.V_CENTER,b.H_PRIORITY)]);Q.OUT_R_B=new Q("OUT_R_B",lt.LEFT,nt.BOTTOM,G.END,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_BOTTOM,b.H_PRIORITY)]);Q.IN_T_L=new Q("IN_T_L",lt.LEFT,nt.TOP,G.BEGIN,G.BEGIN,[vt(b.INSIDE,b.V_TOP,b.H_LEFT),vt(b.INSIDE,b.V_TOP,b.H_LEFT,b.H_PRIORITY)]);Q.IN_T_C=new Q("IN_T_C",lt.CENTER,nt.TOP,G.BEGIN,G.CENTER,[vt(b.INSIDE,b.V_TOP,b.H_CENTER),vt(b.INSIDE,b.V_TOP,b.H_CENTER,b.H_PRIORITY)]);Q.IN_T_R=new Q("IN_T_R",lt.RIGHT,nt.TOP,G.BEGIN,G.END,[vt(b.INSIDE,b.V_TOP,b.H_RIGHT),vt(b.INSIDE,b.V_TOP,b.H_RIGHT,b.H_PRIORITY)]);Q.IN_C_L=new Q("IN_C_L",lt.LEFT,nt.CENTER,G.CENTER,G.BEGIN,[vt(b.INSIDE,b.V_CENTER,b.H_LEFT),vt(b.INSIDE,b.V_CENTER,b.H_LEFT,b.H_PRIORITY)]);Q.IN_C_C=new Q("IN_C_C",lt.CENTER,nt.CENTER,G.CENTER,G.CENTER,[vt(b.INSIDE,b.V_CENTER,b.H_CENTER),vt(b.INSIDE,b.V_CENTER,b.H_CENTER,b.H_PRIORITY)]);Q.IN_C_R=new Q("IN_C_R",lt.RIGHT,nt.CENTER,G.CENTER,G.END,[vt(b.INSIDE,b.V_CENTER,b.H_RIGHT),vt(b.INSIDE,b.V_CENTER,b.H_RIGHT,b.H_PRIORITY)]);Q.IN_B_L=new Q("IN_B_L",lt.LEFT,nt.BOTTOM,G.END,G.BEGIN,[vt(b.INSIDE,b.V_BOTTOM,b.H_LEFT),vt(b.INSIDE,b.V_BOTTOM,b.H_LEFT,b.H_PRIORITY)]);Q.IN_B_C=new Q("IN_B_C",lt.CENTER,nt.BOTTOM,G.END,G.CENTER,[vt(b.INSIDE,b.V_BOTTOM,b.H_CENTER),vt(b.INSIDE,b.V_BOTTOM,b.H_CENTER,b.H_PRIORITY)]);Q.IN_B_R=new Q("IN_B_R",lt.RIGHT,nt.BOTTOM,G.END,G.END,[vt(b.INSIDE,b.V_BOTTOM,b.H_RIGHT),vt(b.INSIDE,b.V_BOTTOM,b.H_RIGHT,b.H_PRIORITY)]);Q.UNDEFINED=new Q("UNDEFINED",null,null,null,null,[]);Q._VALUES=[Q.OUT_T_L,Q.OUT_T_C,Q.OUT_T_R,Q.OUT_B_L,Q.OUT_B_C,Q.OUT_B_R,Q.OUT_L_T,Q.OUT_L_C,Q.OUT_L_B,Q.OUT_R_T,Q.OUT_R_C,Q.OUT_R_B,Q.IN_T_L,Q.IN_T_C,Q.IN_T_R,Q.IN_C_L,Q.IN_C_C,Q.IN_C_R,Q.IN_B_L,Q.IN_B_C,Q.IN_B_R,Q.UNDEFINED];var wa=class{static configureCellSystemSizeContributions(t){if(t.sizeConstraints.size!==0){if(t.sizeConstraints.has(mt.PORTS)){t.insidePortLabelCells.get(u.NORTH).setContributesToMinimumWidth(!0),t.insidePortLabelCells.get(u.SOUTH).setContributesToMinimumWidth(!0);let e=t.portConstraints!==H.FIXED_RATIO&&t.portConstraints!==H.FIXED_POS;t.insidePortLabelCells.get(u.EAST).setContributesToMinimumHeight(e),t.insidePortLabelCells.get(u.WEST).setContributesToMinimumHeight(e),t.nodeContainerMiddleRow.setContributesToMinimumHeight(e),t.sizeConstraints.has(mt.PORT_LABELS)&&(t.insidePortLabelCells.get(u.NORTH).setContributesToMinimumHeight(!0),t.insidePortLabelCells.get(u.SOUTH).setContributesToMinimumHeight(!0),t.insidePortLabelCells.get(u.EAST).setContributesToMinimumWidth(!0),t.insidePortLabelCells.get(u.WEST).setContributesToMinimumWidth(!0),t.nodeContainerMiddleRow.setContributesToMinimumWidth(!0))}if(t.sizeConstraints.has(mt.NODE_LABELS)){t.insideNodeLabelContainer.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.setContributesToMinimumWidth(!0),t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.nodeContainerMiddleRow.setContributesToMinimumWidth(!0);let e=t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG);for(let o of Q.values()){let r=t.nodeLabelCells.get(o);r!=null&&(o.isInsideLocation()?(r.setContributesToMinimumHeight(!0),r.setContributesToMinimumWidth(!0)):(r.setContributesToMinimumHeight(!e),r.setContributesToMinimumWidth(!e)))}}t.sizeConstraints.has(mt.MINIMUM_SIZE)&&t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)&&(t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.isContributingToMinimumHeight()||(t.insideNodeLabelContainer.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.setContributesToMinimumWidth(!0),t.insideNodeLabelContainer.setOnlyCenterCellContributesToMinimumSize(!0)))}}static updateVerticalInsidePortLabelCellPadding(t){if(t.portConstraints===H.FIXED_RATIO||t.portConstraints===H.FIXED_POS)return;let e=t.nodeContainer.getPadding().top+t.insidePortLabelCells.get(u.NORTH).getMinimumHeight()+t.labelCellSpacing,o=t.nodeContainer.getPadding().bottom+t.insidePortLabelCells.get(u.SOUTH).getMinimumHeight()+t.labelCellSpacing,r=t.insidePortLabelCells.get(u.EAST),i=t.insidePortLabelCells.get(u.WEST),s=Math.max(0,r.getPadding().top-e);s=Math.max(s,i.getPadding().top-e);let a=Math.max(0,r.getPadding().bottom-o);a=Math.max(a,i.getPadding().bottom-o),r.getPadding().top=s,i.getPadding().top=s,r.getPadding().bottom=a,i.getPadding().bottom=a}};var Lr=class n{static placeHorizontalPorts(t){switch(t.portConstraints){case H.FIXED_POS:n._placeHorizontalFixedPosPorts(t,u.NORTH),n._placeHorizontalFixedPosPorts(t,u.SOUTH);break;case H.FIXED_RATIO:n._placeHorizontalFixedRatioPorts(t,u.NORTH),n._placeHorizontalFixedRatioPorts(t,u.SOUTH);break;default:n._placeHorizontalFreePorts(t,u.NORTH),n._placeHorizontalFreePorts(t,u.SOUTH);break}}static _placeHorizontalFixedPosPorts(t,e){for(let o of t.portContexts.get(e))o.portPosition.y=n._calculateHorizontalPortYCoordinate(o)}static _placeHorizontalFixedRatioPorts(t,e){let o=t.nodeSize.x;for(let r of t.portContexts.get(e))r.portPosition.x=o*r.port.getProperty(n.PORT_RATIO_OR_POSITION),r.portPosition.y=n._calculateHorizontalPortYCoordinate(r)}static _placeHorizontalFreePorts(t,e){let o=t.portContexts.get(e);if(o.length===0)return;let r=t.insidePortLabelCells.get(e),i=r.getCellRectangle(),s=r.getPadding(),a=t.getPortAlignment(e),l=i.width-s.left-s.right,c=r.getMinimumContentAreaSize().x,g=i.x+s.left,h=t.portPortSpacing;if((a===qt.DISTRIBUTED||a===qt.JUSTIFIED)&&o.length===1&&(c=n._modifiedPortPlacementSize(t,a,c),a=qt.CENTER),l<c&&!t.sizeOptions.has(Nt.PORTS_OVERHANG))a===qt.DISTRIBUTED?(h+=(l-c)/(o.length+1),g+=h):h+=(l-c)/(o.length-1);else switch(l<c&&(c=n._modifiedPortPlacementSize(t,a,c),a=qt.CENTER),a){case qt.BEGIN:break;case qt.CENTER:g+=(l-c)/2;break;case qt.END:g+=l-c;break;case qt.DISTRIBUTED:{let d=(l-c)/(o.length+1);h+=Math.max(0,d),g+=h;break}case qt.JUSTIFIED:{let d=(l-c)/(o.length-1);h+=Math.max(0,d);break}}for(let d of o)d.portPosition.x=g+d.portMargin.left,d.portPosition.y=n._calculateHorizontalPortYCoordinate(d),g+=d.portMargin.left+d.port.getSize().x+d.portMargin.right+h}static _calculateHorizontalPortYCoordinate(t){let e=t.port;return e.hasProperty(Ke)?e.getSide()===u.NORTH?-e.getSize().y-e.getProperty(Ke):e.getProperty(Ke):e.getSide()===u.NORTH?-e.getSize().y:0}static placeVerticalPorts(t){switch(t.portConstraints){case H.FIXED_POS:n._placeVerticalFixedPosPorts(t,u.EAST),n._placeVerticalFixedPosPorts(t,u.WEST);break;case H.FIXED_RATIO:n._placeVerticalFixedRatioPorts(t,u.EAST),n._placeVerticalFixedRatioPorts(t,u.WEST);break;default:n._placeVerticalFreePorts(t,u.EAST),n._placeVerticalFreePorts(t,u.WEST);break}}static _placeVerticalFixedPosPorts(t,e){let o=t.nodeSize.x;for(let r of t.portContexts.get(e))r.portPosition.x=n._calculateVerticalPortXCoordinate(r,o)}static _placeVerticalFixedRatioPorts(t,e){let o=t.nodeSize;for(let r of t.portContexts.get(e))r.portPosition.x=n._calculateVerticalPortXCoordinate(r,o.x),r.portPosition.y=o.y*r.port.getProperty(n.PORT_RATIO_OR_POSITION)}static _placeVerticalFreePorts(t,e){let o=t.portContexts.get(e);if(o.length===0)return;let r=t.insidePortLabelCells.get(e),i=r.getCellRectangle(),s=r.getPadding(),a=t.getPortAlignment(e),l=i.height-s.top-s.bottom,c=r.getMinimumContentAreaSize().y,g=i.y+s.top,h=t.portPortSpacing,d=t.nodeSize.x;if((a===qt.DISTRIBUTED||a===qt.JUSTIFIED)&&o.length===1&&(c=n._modifiedPortPlacementSize(t,a,c),a=qt.CENTER),l<c&&!t.sizeOptions.has(Nt.PORTS_OVERHANG))a===qt.DISTRIBUTED?(h+=(l-c)/(o.length+1),g+=h):h+=(l-c)/(o.length-1);else switch(l<c&&(c=n._modifiedPortPlacementSize(t,a,c),a=qt.CENTER),a){case qt.BEGIN:break;case qt.CENTER:g+=(l-c)/2;break;case qt.END:g+=l-c;break;case qt.DISTRIBUTED:{let f=(l-c)/(o.length+1);h+=Math.max(0,f),g+=h;break}case qt.JUSTIFIED:{let f=(l-c)/(o.length-1);h+=Math.max(0,f);break}}for(let f of o)f.portPosition.x=n._calculateVerticalPortXCoordinate(f,d),f.portPosition.y=g+f.portMargin.top,g+=f.portMargin.top+f.port.getSize().y+f.portMargin.bottom+h}static _calculateVerticalPortXCoordinate(t,e){let o=t.port;return o.hasProperty(Ke)?o.getSide()===u.WEST?-o.getSize().x-o.getProperty(Ke):e+o.getProperty(Ke):o.getSide()===u.WEST?-o.getSize().x:e}static _modifiedPortPlacementSize(t,e,o){return e===qt.DISTRIBUTED?o-2*t.portPortSpacing:o}};Lr.PORT_RATIO_OR_POSITION=new m("portRatioOrPosition",0);var qS=.01;function JS(n,t,e){return Math.abs(n-t)<e}var Ti=class n{static calculateHorizontalPortPlacementSize(t){switch(t.portConstraints){case H.FIXED_POS:n._calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,u.SOUTH);break;case H.FIXED_RATIO:n._calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,u.SOUTH);break;default:n._calculateHorizontalNodeSizeRequiredByFreePorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFreePorts(t,u.SOUTH);break}}static _calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,e){let o=0;for(let i of t.portContexts.get(e))o=Math.max(o,i.portPosition.x+i.port.getSize().x);let r=t.insidePortLabelCells.get(e);r.getPadding().left=0,r.getMinimumContentAreaSize().x=o}static _calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,e){let o=t.insidePortLabelCells.get(e),r=t.portContexts.get(e);if(r.length===0){o.getPadding().left=0,o.getPadding().right=0;return}let i=t.portLabelsPlacement.has(it.INSIDE),s=0,a=null,l=0,c=0;for(let g of r){let h=g.port.getProperty(Lr.PORT_RATIO_OR_POSITION),d=g.port.getSize().x;if(t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e),a==null)t.surroundingPortMargins!=null&&t.surroundingPortMargins.left>0&&(s=Math.max(s,n.minSizeRequiredToRespectSpacing(t.surroundingPortMargins.left+g.portMargin.left,0,h)));else{let f=c+a.portMargin.right+t.portPortSpacing+g.portMargin.left;s=Math.max(s,n.minSizeRequiredToRespectSpacing(f,l,h))}a=g,l=h,c=d}if(t.surroundingPortMargins!=null&&t.surroundingPortMargins.right>0){let g=c+t.surroundingPortMargins.right;i&&(g+=a.portMargin.right),s=Math.max(s,n.minSizeRequiredToRespectSpacing(g,l,1))}o.getPadding().left=0,o.getMinimumContentAreaSize().x=s}static minSizeRequiredToRespectSpacing(t,e,o){return JS(e,o,qS)?0:t/(o-e)}static _calculateHorizontalNodeSizeRequiredByFreePorts(t,e){let o=t.insidePortLabelCells.get(e);if(t.portContexts.get(e).length===0){o.getPadding().left=0,o.getPadding().right=0;return}o.getPadding().left=t.surroundingPortMargins.left,o.getPadding().right=t.surroundingPortMargins.right,t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let r=n._portWidthPlusPortPortSpacing(t,e);t.getPortAlignment(e)===qt.DISTRIBUTED&&(r+=2*t.portPortSpacing),o.getMinimumContentAreaSize().x=r}static _setupPortMargins(t,e){let o=t.portContexts.get(e),r=t.portLabelsPlacement.has(it.OUTSIDE),i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE),a=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),l=t.sizeOptions.has(Nt.UNIFORM_PORT_SPACING),c=!i&&!s&&(a||o.length===2);n._computeHorizontalPortMargins(t,e,r);let g=null,h=null;r&&o.length>0&&(g=o[0],h=o[o.length-1],g.portMargin.left=0,h.portMargin.right=0,c&&!g.labelsNextToPort&&(g.portMargin.right=0)),l&&(n._unifyPortMargins(o),r&&g!=null&&(g.portMargin.left=0,h.portMargin.right=0))}static _computeHorizontalPortMargins(t,e,o){for(let r of t.portContexts.get(e)){let i=r.portLabelCell!=null?r.portLabelCell.getMinimumWidth():0;if(i>0)if(r.labelsNextToPort){let s=r.port.getSize().x;if(i>s){let a=(i-s)/2;r.portMargin.left=a,r.portMargin.right=a}}else r.portMargin.right=t.portLabelSpacingHorizontal+i;else if(it.isFixed(t.portLabelsPlacement)){let s=Ia(r.port);s.x<0&&(r.portMargin.left=-s.x),s.x+s.width>r.port.getSize().x&&(r.portMargin.right=s.x+s.width-r.port.getSize().x)}}}static _unifyPortMargins(t){let e=0,o=0;for(let r of t)e=Math.max(e,r.portMargin.left),o=Math.max(o,r.portMargin.right);for(let r of t)r.portMargin.left=e,r.portMargin.right=o}static _portWidthPlusPortPortSpacing(t,e){let o=0,r=t.portContexts.get(e);for(let i=0;i<r.length;i++){let s=r[i];o+=s.portMargin.left+s.port.getSize().x+s.portMargin.right,i<r.length-1&&(o+=t.portPortSpacing)}return o}};var Vl=class n{static createInsidePortLabelCells(t){n._createInsidePortLabelCell(t,t.nodeContainer,G.BEGIN,u.NORTH),n._createInsidePortLabelCell(t,t.nodeContainer,G.END,u.SOUTH),n._createInsidePortLabelCell(t,t.nodeContainerMiddleRow,G.BEGIN,u.WEST),n._createInsidePortLabelCell(t,t.nodeContainerMiddleRow,G.END,u.EAST),n._setupNorthOrSouthPortLabelCell(t,u.NORTH),n._setupNorthOrSouthPortLabelCell(t,u.SOUTH),n._setupEastOrWestPortLabelCell(t,u.EAST),n._setupEastOrWestPortLabelCell(t,u.WEST)}static _createInsidePortLabelCell(t,e,o,r){let i=new ds;e.setCell(o,i),t.insidePortLabelCells.set(r,i)}static _setupNorthOrSouthPortLabelCell(t,e){let o=t.insidePortLabelCells.get(e).getPadding();switch(e){case u.NORTH:t.portLabelSpacingVertical>=0&&(o.top=t.portLabelSpacingVertical);break;case u.SOUTH:t.portLabelSpacingVertical>=0&&(o.bottom=t.portLabelSpacingVertical);break}t.surroundingPortMargins!=null&&(o.left=t.surroundingPortMargins.left,o.right=t.surroundingPortMargins.right)}static _setupEastOrWestPortLabelCell(t,e){t.portLabelsPlacement.has(it.INSIDE)&&n._calculateWidthDueToLabels(t,e),n._setupTopAndBottomPadding(t,e)}static _calculateWidthDueToLabels(t,e){let o=t.insidePortLabelCells.get(e),r=o.getMinimumContentAreaSize();for(let i of t.portContexts.get(e))i.portLabelCell!=null&&(r.x=Math.max(r.x,i.portLabelCell.getMinimumWidth()));if(r.x>0)switch(e){case u.EAST:o.getPadding().right=t.portLabelSpacingHorizontal;break;case u.WEST:o.getPadding().left=t.portLabelSpacingHorizontal;break}}static _setupTopAndBottomPadding(t,e){if(t.surroundingPortMargins!=null){let o=t.insidePortLabelCells.get(e).getPadding();o.top=t.surroundingPortMargins.top,o.bottom=t.surroundingPortMargins.bottom}}};var Xl=class n{static placeLabels(t){n._placeOuterNodeLabelContainers(t);for(let e of t.nodeLabelCells.values())e.applyLabelLayout();for(let e of t.portContexts.values())e.portLabelCell!=null&&e.portLabelCell.applyLabelLayout()}static _placeOuterNodeLabelContainers(t){let e=t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG);n._placeHorizontalOuterNodeLabelContainer(t,e,u.NORTH),n._placeHorizontalOuterNodeLabelContainer(t,e,u.SOUTH),n._placeVerticalOuterNodeLabelContainer(t,e,u.EAST),n._placeVerticalOuterNodeLabelContainer(t,e,u.WEST)}static _placeHorizontalOuterNodeLabelContainer(t,e,o){let r=t.nodeSize,i=t.outsideNodeLabelContainers.get(o);if(i==null)return;let s=i.getCellRectangle();switch(s.width=i.getMinimumWidth(),s.height=i.getMinimumHeight(),s.width=Math.max(s.width,r.x),s.width>r.x&&!e&&(s.width=r.x),s.x=-(s.width-r.x)/2,o){case u.NORTH:s.y=-s.height;break;case u.SOUTH:s.y=r.y;break}i.layoutChildrenHorizontally(),i.layoutChildrenVertically()}static _placeVerticalOuterNodeLabelContainer(t,e,o){let r=t.nodeSize,i=t.outsideNodeLabelContainers.get(o);if(i==null)return;let s=i.getCellRectangle();switch(s.width=i.getMinimumWidth(),s.height=i.getMinimumHeight(),s.height=Math.max(s.height,r.y),s.height>r.y&&!e&&(s.height=r.y),s.y=-(s.height-r.y)/2,o){case u.WEST:s.x=-s.width;break;case u.EAST:s.x=r.x;break}i.layoutChildrenHorizontally(),i.layoutChildrenVertically()}};var fD=new Set([mt.PORT_LABELS]);function QS(n,t){return n.size===1&&n.has(t)}var fo=class n{static setupMinimumClientAreaSize(t){let e=n.getMinimumClientAreaSize(t);e!=null&&t.insideNodeLabelContainer.setCenterCellMinimumSize(e)}static setupNodePaddingForPortsWithOffset(t){let e=t.nodeContainer.getPadding();for(let o of t.portContexts.values()){let r=0;if(o.port.hasProperty(Ke)&&(r=o.port.getProperty(Ke),r<0))switch(o.port.getSide()){case u.NORTH:e.top=Math.max(e.top,-r);break;case u.SOUTH:e.bottom=Math.max(e.bottom,-r);break;case u.EAST:e.right=Math.max(e.right,-r);break;case u.WEST:e.left=Math.max(e.left,-r);break}if(it.isFixed(t.portLabelsPlacement)){let i=Hp(o.port,r),s=!t.node.getProperty(Oo).has(Nt.ASYMMETRICAL),a=!1;switch(o.port.getSide()){case u.NORTH:a=i>e.top,e.top=Math.max(e.top,i),s&&a&&(e.top=Math.max(e.top,e.bottom),e.bottom=e.top+r);break;case u.SOUTH:a=i>e.bottom,e.bottom=Math.max(e.bottom,i),s&&a&&(e.bottom=Math.max(e.bottom,e.top),e.top=e.bottom+r);break;case u.EAST:a=i>e.right,e.right=Math.max(e.right,i),s&&a&&(e.right=Math.max(e.left,e.right),e.left=e.right+r);break;case u.WEST:a=i>e.left,e.left=Math.max(e.left,i),s&&a&&(e.left=Math.max(e.left,e.right),e.right=e.left+r);break}}}}static offsetSouthernPortsByNodeSize(t){let e=t.nodeSize.y;for(let o of t.portContexts.get(u.SOUTH))o.portPosition.y+=e}static setNodePadding(t){if(!t.sizeOptions.has(Nt.COMPUTE_PADDING))return;let e=t.nodeContainer.getCellRectangle(),o=t.insideNodeLabelContainer.getCenterCellRectangle(),r=new yt;r.left=o.x-e.x,r.top=o.y-e.y,r.right=e.x+e.width-(o.x+o.width),r.bottom=e.y+e.height-(o.y+o.height),t.node.setPadding(r)}static applyStuff(t){t.applyNodeSize();for(let e of t.portContexts.values())e.applyPortPosition()}static getMinimumClientAreaSize(t){return t.sizeConstraints.has(mt.MINIMUM_SIZE)&&t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)?n.getMinimumNodeOrClientAreaSize(t):null}static getMinimumNodeSize(t){return t.sizeConstraints.has(mt.MINIMUM_SIZE)&&!t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)?n.getMinimumNodeOrClientAreaSize(t):null}static getMinimumNodeOrClientAreaSize(t){let e=new O(t.node.getProperty(Yo));return t.sizeOptions.has(Nt.DEFAULT_MINIMUM_SIZE)&&(e.x<=0&&(e.x=es),e.y<=0&&(e.y=os)),e}static areSizeConstraintsFixed(t){return t.sizeConstraints.size===0||QS(t.sizeConstraints,mt.PORT_LABELS)}static isFirstOutsidePortLabelPlacedDifferently(t,e){let o=t.portContexts.get(e);if(o.length>=2){let r=o[0],i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.SPACE_EFFICIENT);return!r.labelsNextToPort&&!i&&(o.length===2||s)}return!1}};var rE=3,iE=3,jr=new Map([[G.BEGIN,0],[G.CENTER,1],[G.END,2]]),Kl=class extends Ze{constructor(t,e,o){super(),this._gap=o,this._tabular=t,this._symmetrical=e,this._cells=[[null,null,null],[null,null,null],[null,null,null]],this._centerCellMinimumSize=null,this._onlyCenterCellContributesToMinimumSize=!1,this._centerCellRect=new dt}getGap(){return this._gap}getCell(t,e){return this._cells[jr.get(t)][jr.get(e)]}setCell(t,e,o){this._cells[jr.get(t)][jr.get(e)]=o}setCenterCellMinimumSize(t){this._centerCellMinimumSize=new O(t)}setOnlyCenterCellContributesToMinimumSize(t){this._onlyCenterCellContributesToMinimumSize=t}getCenterCellRectangle(){return new dt(this._centerCellRect)}getMinimumWidth(){let t=0,e=this.getPadding();if(this._onlyCenterCellContributesToMinimumSize)this._centerCellMinimumSize!=null?t=this._centerCellMinimumSize.x:this._cells[1][1]!=null&&(t=this._cells[1][1].getMinimumWidth());else if(this._tabular)t=this._sumWithGaps(this._minColumnWidths(null,!0));else for(let o of[G.BEGIN,G.CENTER,G.END])t=Math.max(t,this._sumWithGaps(this._minColumnWidths(o,!0)));return t>0?t+e.left+e.right:0}getMinimumHeight(){let t=0,e=this.getPadding();return this._onlyCenterCellContributesToMinimumSize?this._centerCellMinimumSize!=null?t=this._centerCellMinimumSize.y:this._cells[1][1]!=null&&(t=this._cells[1][1].getMinimumHeight()):t=this._sumWithGaps(this._minRowHeights(!0)),t>0?t+e.top+e.bottom:0}layoutChildrenHorizontally(){if(this._tabular){let t=this._minColumnWidths(null,!1);for(let e of[G.BEGIN,G.CENTER,G.END])this._applyWidthsToRow(e,t)}else for(let t of[G.BEGIN,G.CENTER,G.END]){let e=this._minColumnWidths(t,!1);this._applyWidthsToRow(t,e)}}layoutChildrenVertically(){let t=this.getCellRectangle(),e=this.getPadding(),o=this._minRowHeights(!1);this._applyHeightToRow(G.BEGIN,t.y+e.top,o),this._applyHeightToRow(G.END,t.y+t.height-e.bottom-o[2],o);let r=t.height-e.top-e.bottom;o[0]>0&&(o[0]+=this._gap,r-=o[0]),o[2]>0&&(o[2]+=this._gap,r-=o[2]),this._centerCellRect.height=Math.max(0,r),this._centerCellRect.y=t.y+e.top+(this._centerCellRect.height-r)/2,o[1]=Math.max(o[1],r),this._applyHeightToRow(G.CENTER,t.y+e.top+o[0]-(o[1]-r)/2,o)}_minColumnWidths(t,e){let o=[this._minWidthOfColumn(G.BEGIN,t,e),this._minWidthOfColumn(G.CENTER,t,e),this._minWidthOfColumn(G.END,t,e)];return this._symmetrical&&(o[0]=Math.max(o[0],o[2]),o[2]=o[0]),o}_minWidthOfColumn(t,e,o){let r=0,i=jr.get(t);if(e==null)for(let s=0;s<rE;s++)r=Math.max(r,Ze.minWidthOfCell(this._cells[s][i],o));else r=Ze.minWidthOfCell(this._cells[jr.get(e)][i],o);return t===G.CENTER&&this._centerCellMinimumSize!=null&&(r=Math.max(r,this._centerCellMinimumSize.x)),r}_minRowHeights(t){let e=[this._minHeightOfRow(G.BEGIN,t),this._minHeightOfRow(G.CENTER,t),this._minHeightOfRow(G.END,t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}_minHeightOfRow(t,e){let o=0,r=jr.get(t);for(let i=0;i<iE;i++)o=Math.max(o,Ze.minHeightOfCell(this._cells[r][i],e));return t===G.CENTER&&this._centerCellMinimumSize!=null&&(o=Math.max(o,this._centerCellMinimumSize.y)),o}_sumWithGaps(t){let e=0,o=0;for(let r of t)r>0&&(e+=r,o++);return o>1&&(e+=this._gap*(o-1)),e}_applyWidthsToRow(t,e){let o=this.getCellRectangle(),r=this.getPadding();this._applyWidthToColumn(G.BEGIN,o.x+r.left,e),this._applyWidthToColumn(G.END,o.x+o.width-r.right-e[2],e);let i=o.width-r.left-r.right;e[0]>0&&(e[0]+=this._gap,i-=e[0]),e[2]>0&&(e[2]+=this._gap,i-=e[2]);let s=Math.max(0,i);e[1]=Math.max(e[1],i),this._applyWidthToColumn(G.CENTER,o.x+r.left+e[0]-(e[1]-i)/2,e),t===G.CENTER&&(this._centerCellRect.width=s,this._centerCellRect.x=o.x+r.left+(s-i)/2)}_applyWidthToColumn(t,e,o){let r=jr.get(t);for(let i=0;i<rE;i++)this.applyHorizontalLayout(this._cells[i][r],e,o[r])}_applyHeightToRow(t,e,o){let r=jr.get(t);for(let i=0;i<iE;i++)this.applyVerticalLayout(this._cells[r][i],e,o[r])}};var Ni=class extends Si{constructor(t,e,o){super(),this._gap=t;let r=!0,i=lt.CENTER,s=nt.CENTER;e==null||(typeof e=="boolean"?r=e:(i=e.getHorizontalAlignment(),s=e.getVerticalAlignment(),o!=null&&(r=o))),this._horizontalLayoutMode=r,this._horizontalAlignment=i,this._verticalAlignment=s,this._labels=[],this._minimumContentAreaSize=new O}getHorizontalAlignment(){return this._horizontalAlignment}setHorizontalAlignment(t){if(t==null)throw new Error("Horizontal alignment cannot be null");return this._horizontalAlignment=t,this}getVerticalAlignment(){return this._verticalAlignment}setVerticalAlignment(t){if(t==null)throw new Error("Vertical alignment cannot be null");return this._verticalAlignment=t,this}getLabels(){return this._labels}getMinimumWidth(){let t=this.getPadding();return this._minimumContentAreaSize.x+t.left+t.right}getMinimumHeight(){let t=this.getPadding();return this._minimumContentAreaSize.y+t.top+t.bottom}addLabel(t){this._labels.push(t);let e=t.getSize();this._horizontalLayoutMode?(this._minimumContentAreaSize.x=Math.max(this._minimumContentAreaSize.x,e.x),this._minimumContentAreaSize.y+=e.y,this._labels.length>1&&(this._minimumContentAreaSize.y+=this._gap)):(this._minimumContentAreaSize.x+=e.x,this._minimumContentAreaSize.y=Math.max(this._minimumContentAreaSize.y,e.y),this._labels.length>1&&(this._minimumContentAreaSize.x+=this._gap))}hasLabels(){return this._labels.length>0}applyLabelLayout(){this._horizontalLayoutMode?this._applyHorizontalModeLabelLayout():this._applyVerticalModeLabelLayout()}_applyHorizontalModeLabelLayout(){let t=this.getCellRectangle(),e=this.getPadding(),o=t.y;this._verticalAlignment===nt.CENTER?o+=(t.height-this._minimumContentAreaSize.y)/2:this._verticalAlignment===nt.BOTTOM&&(o+=t.height-this._minimumContentAreaSize.y);for(let r of this._labels){let i=r.getSize(),s=new O;switch(s.y=o,o+=i.y+this._gap,this._horizontalAlignment){case lt.LEFT:s.x=t.x+e.left;break;case lt.CENTER:s.x=t.x+e.left+(t.width-i.x)/2;break;case lt.RIGHT:s.x=t.x+t.width-e.right-i.x;break}r.setPosition(s)}}_applyVerticalModeLabelLayout(){let t=this.getCellRectangle(),e=this.getPadding(),o=t.x;this._horizontalAlignment===lt.CENTER?o+=(t.width-this._minimumContentAreaSize.x)/2:this._horizontalAlignment===lt.RIGHT&&(o+=t.width-this._minimumContentAreaSize.x);for(let r of this._labels){let i=r.getSize(),s=new O;switch(s.x=o,o+=i.x+this._gap,this._verticalAlignment){case nt.TOP:s.y=t.y+e.top;break;case nt.CENTER:s.y=t.y+e.top+(t.height-i.y)/2;break;case nt.BOTTOM:s.y=t.y+t.height-e.bottom-i.y;break}r.setPosition(s)}}};var Ma=class n{static createNodeLabelCells(t,e,o){n._createNodeLabelCellContainers(t,e);for(let r of t.node.getLabels())n._handleNodeLabel(t,r,e,o)}static _handleNodeLabel(t,e,o,r){let i=e.hasProperty(Kr)?e.getProperty(Kr):t.nodeLabelPlacement,s=i instanceof Set?i:k.ensureSet(i),a=Q.fromNodeLabelPlacement(s);a!==Q.UNDEFINED&&(o&&!a.isInsideLocation()||n._retrieveNodeLabelCell(t,a,r).addLabel(e))}static _createNodeLabelCellContainers(t,e){let o=!t.sizeOptions.has(Nt.ASYMMETRICAL),r=t.sizeOptions.has(Nt.FORCE_TABULAR_NODE_LABELS);if(t.insideNodeLabelContainer=new Kl(r,o,t.labelCellSpacing),t.nodeLabelsPadding!=null&&t.insideNodeLabelContainer.getPadding().copy(t.nodeLabelsPadding),t.nodeContainerMiddleRow.setCell(G.CENTER,t.insideNodeLabelContainer),!e){let i=new Rr(ve.HORIZONTAL,o,t.labelCellSpacing);i.getPadding().bottom=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.NORTH,i);let s=new Rr(ve.HORIZONTAL,o,t.labelCellSpacing);s.getPadding().top=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.SOUTH,s);let a=new Rr(ve.VERTICAL,o,t.labelCellSpacing);a.getPadding().right=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.WEST,a);let l=new Rr(ve.VERTICAL,o,t.labelCellSpacing);l.getPadding().left=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.EAST,l)}}static _retrieveNodeLabelCell(t,e,o){let r=t.nodeLabelCells.get(e);if(r==null)if(r=new Ni(t.labelLabelSpacing,e,o),t.nodeLabelCells.set(e,r),e.isInsideLocation())t.insideNodeLabelContainer.setCell(e.getContainerRow(),e.getContainerColumn(),r);else{let i=e.getOutsideSide(),s=t.outsideNodeLabelContainers.get(i);switch(i){case u.NORTH:case u.SOUTH:r.setContributesToMinimumHeight(!0),s.setCell(e.getContainerColumn(),r);break;case u.WEST:case u.EAST:r.setContributesToMinimumWidth(!0),s.setCell(e.getContainerRow(),r);break}}return r}};var ba=class{static setNodeWidth(t){let e=t.nodeSize,o;if(fo.areSizeConstraintsFixed(t))o=e.x;else{if(t.topdownLayout?o=Math.max(e.x,t.nodeContainer.getMinimumWidth()):o=t.nodeContainer.getMinimumWidth(),t.sizeConstraints.has(mt.NODE_LABELS)&&!t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG)){let s=t.outsideNodeLabelContainers.get(u.NORTH),a=t.outsideNodeLabelContainers.get(u.SOUTH);s!=null&&(o=Math.max(o,s.getMinimumWidth())),a!=null&&(o=Math.max(o,a.getMinimumWidth()))}let i=fo.getMinimumNodeSize(t);i!=null&&(o=Math.max(o,i.x))}t.node.getGraph().getProperty(To)?e.x=Math.max(e.x,o):e.x=o;let r=t.nodeContainer.getCellRectangle();r.x=0,r.width=o,t.nodeContainer.layoutChildrenHorizontally()}static setNodeHeight(t){let e=t.nodeSize,o;if(fo.areSizeConstraintsFixed(t))o=e.y;else{if(t.topdownLayout?o=Math.max(e.y,t.nodeContainer.getMinimumHeight()):o=t.nodeContainer.getMinimumHeight(),t.sizeConstraints.has(mt.NODE_LABELS)&&!t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG)){let s=t.outsideNodeLabelContainers.get(u.EAST),a=t.outsideNodeLabelContainers.get(u.WEST);s!=null&&(o=Math.max(o,s.getMinimumHeight())),a!=null&&(o=Math.max(o,a.getMinimumHeight()))}let i=fo.getMinimumNodeSize(t);if(i!=null&&(o=Math.max(o,i.y)),t.sizeConstraints.has(mt.PORTS)&&(t.portConstraints===H.FIXED_RATIO||t.portConstraints===H.FIXED_POS)){let s=t.insidePortLabelCells.get(u.EAST),a=t.insidePortLabelCells.get(u.WEST);s!=null&&(o=Math.max(o,s.getMinimumHeight())),a!=null&&(o=Math.max(o,a.getMinimumHeight()))}}t.node.getGraph().getProperty(To)?e.y=Math.max(e.y,o):e.y=o;let r=t.nodeContainer.getCellRectangle();r.y=0,r.height=o,t.nodeContainer.layoutChildrenVertically()}};var Zl=class{constructor(t,e){this.parentNodeContext=t,this.port=e,this.portPosition=new O(e.getPosition()),this.portMargin=new me,this.portLabelCell=null;let o=t.portLabelsPlacement,r=o.has(it.NEXT_TO_PORT_IF_POSSIBLE);o.has(it.INSIDE)?t.treatAsCompoundNode?this.labelsNextToPort=r&&!e.hasCompoundConnections():this.labelsNextToPort=!0:o.has(it.OUTSIDE)?r?this.labelsNextToPort=!tT(e):this.labelsNextToPort=!1:this.labelsNextToPort=!1}applyPortPosition(){this.port.setPosition(this.portPosition)}};function tT(n){for(let t of n.getIncomingEdges())return!0;for(let t of n.getOutgoingEdges())return!0;return!1}var jl=class n{static createPortContexts(t,e){let o=!e||!t.portLabelsPlacement.has(it.INSIDE),r=0;for(let i of t.node.getPorts()){if(i.getSide()===u.UNDEFINED)throw new Error("Label and node size calculator can only be used with ports that have port sides assigned.");i.setVolatileId(r++),n._createPortContext(t,i,o)}}static _createPortContext(t,e,o){let r=new Zl(t,e);if(t.portContexts.put(e.getSide(),r),o&&!it.isFixed(t.portLabelsPlacement)){r.portLabelCell=new Ni(t.labelLabelSpacing);for(let i of e.getLabels())r.portLabelCell.addLabel(i)}}};var $l=class n{removeOverlaps(t){let e=t.getVerticalGap(),o=new Set,r=0;for(let i of t.getRectangleNodes()){let s=0;i.getOverlappingNodes().sort(n.compareByYCoordinate);for(let a of i.getOverlappingNodes())if(o.has(a)){let l=i.getRectangle(),c=a.getRectangle();s<c.y+c.height+e&&s+l.height+e>c.y&&(s=c.y+c.height+e)}i.getRectangle().y=s,o.add(i),r=Math.max(r,i.getRectangle().y+i.getRectangle().height)}return r}static compareByYCoordinate(t,e){return t.getRectangle().y-e.getRectangle().y}};var sE=5,Jt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Jt.UP=new Jt("UP");Jt.DOWN=new Jt("DOWN");Jt.LEFT=new Jt("LEFT");Jt.RIGHT=new Jt("RIGHT");var wu=class{constructor(t,e){this._originalRectangle=t,this._rectangle=e,this._overlappingNodes=[]}getRectangle(){return this._rectangle}getOverlappingNodes(){return this._overlappingNodes}get originalRectangle(){return this._originalRectangle}get rectangle(){return this._rectangle}get overlappingNodes(){return this._overlappingNodes}},fs=class n{constructor(){this._overlapRemovalDirection=null,this._gapVertical=sE,this._gapHorizontal=sE,this._startCoordinate=0,this._overlapRemovalStrategy=null,this._rectangleNodes=[]}static createForDirection(t){let e=new n;return e._overlapRemovalDirection=t,e}withGap(t,e){return this._gapHorizontal=t,this._gapVertical=e,this}withStartCoordinate(t){return this._startCoordinate=t,this}withOverlapRemovalStrategy(t){return this._overlapRemovalStrategy=t,this}addRectangle(t){return this._rectangleNodes.push(new wu(t,this._importRectangle(t))),this}getHorizontalGap(){return this._gapHorizontal}getVerticalGap(){return this._gapVertical}getRectangleNodes(){return this._rectangleNodes}_importRectangle(t){switch(this._overlapRemovalDirection){case Jt.UP:case Jt.DOWN:return t;case Jt.LEFT:case Jt.RIGHT:return new dt(t.y,0,t.height,t.width);default:return null}}_exportRectangle(t,e){let o=t.rectangle,r=t.originalRectangle;switch(this._overlapRemovalDirection){case Jt.UP:r.y=this._startCoordinate-o.height-o.y;break;case Jt.DOWN:r.y+=this._startCoordinate;break;case Jt.LEFT:r.x=this._startCoordinate-o.height-o.y;break;case Jt.RIGHT:r.x=this._startCoordinate+o.y;break}}removeOverlaps(){this._overlapRemovalStrategy==null&&(this._overlapRemovalStrategy=new $l),this._rectangleNodes.sort(n._compareLeftRectangleBorders),this._computeOverlaps();let t=this._overlapRemovalStrategy.removeOverlaps(this);for(let e of this._rectangleNodes)this._exportRectangle(e,t);return t}_computeOverlaps(){let t=[];for(let e of this._rectangleNodes){let o=e.rectangle.x;for(;t.length>0;){let s=t[0];if(s.rectangle.x+s.rectangle.width<o)t.shift();else break}for(let s of t)s.overlappingNodes.push(e),e.overlappingNodes.push(s);let r=e.rectangle.x+e.rectangle.width,i=0;for(;i<t.length;){let s=t[i];if(s.rectangle.x+s.rectangle.width>r)break;i++}t.splice(i,0,e)}}static _compareLeftRectangleBorders(t,e){return t.rectangle.x-e.rectangle.x}static _compareRightRectangleBorders(t,e){return t.rectangle.x+t.rectangle.width-(e.rectangle.x+e.rectangle.width)}};var Ga=class n{static placeHorizontalPortLabels(t){n._placePortLabels(t,u.NORTH),n._placePortLabels(t,u.SOUTH)}static placeVerticalPortLabels(t){n._placePortLabels(t,u.EAST),n._placePortLabels(t,u.WEST)}static _placePortLabels(t,e){let o=!t.sizeConstraints.has(mt.PORT_LABELS)||t.portConstraints===H.FIXED_POS;t.portLabelsPlacement.has(it.INSIDE)?o?n._constrainedInsidePortLabelPlacement(t,e):n._simpleInsidePortLabelPlacement(t,e):t.portLabelsPlacement.has(it.OUTSIDE)&&(o?n._constrainedOutsidePortLabelPlacement(t,e):n._simpleOutsidePortLabelPlacement(t,e))}static _simpleInsidePortLabelPlacement(t,e){let o=0,r=n._portLabelBorderOffsetForPortSide(t,e),i=t.portLabelSpacingHorizontal,s=t.portLabelSpacingVertical;for(let a of t.portContexts.get(e)){if(a.portLabelCell==null||!a.portLabelCell.hasLabels())continue;let l=a.port.getSize(),c=a.port.hasProperty(Ke)?a.port.getProperty(Ke):0,g=a.portLabelCell,h=g.getCellRectangle();switch(h.width=g.getMinimumWidth(),h.height=g.getMinimumHeight(),e){case u.NORTH:h.x=a.labelsNextToPort?(l.x-h.width)/2:l.x+i,h.y=l.y+c+r,g.setHorizontalAlignment(lt.CENTER),g.setVerticalAlignment(nt.TOP);break;case u.SOUTH:h.x=a.labelsNextToPort?(l.x-h.width)/2:l.x+i,h.y=-c-r-h.height,g.setHorizontalAlignment(lt.CENTER),g.setVerticalAlignment(nt.BOTTOM);break;case u.EAST:{if(h.x=-c-r-h.width,a.labelsNextToPort){let d=t.portLabelsTreatAsGroup?h.height:g.getLabels()[0].getSize().y;h.y=(l.y-d)/2}else h.y=l.y+s;g.setHorizontalAlignment(lt.RIGHT),g.setVerticalAlignment(nt.CENTER);break}case u.WEST:{if(h.x=l.x+c+r,a.labelsNextToPort){let d=t.portLabelsTreatAsGroup?h.height:g.getLabels()[0].getSize().y;h.y=(l.y-d)/2}else h.y=l.y+s;g.setHorizontalAlignment(lt.LEFT),g.setVerticalAlignment(nt.CENTER);break}}(e===u.NORTH||e===u.SOUTH)&&(o=Math.max(o,h.height))}o>0&&(t.insidePortLabelCells.get(e).getMinimumContentAreaSize().y=o)}static _portLabelBorderOffsetForPortSide(t,e){switch(e){case u.NORTH:return t.nodeContainer.getPadding().top+t.portLabelSpacingVertical;case u.SOUTH:return t.nodeContainer.getPadding().bottom+t.portLabelSpacingVertical;case u.EAST:return t.nodeContainer.getPadding().right+t.portLabelSpacingHorizontal;case u.WEST:return t.nodeContainer.getPadding().left+t.portLabelSpacingHorizontal;default:return 0}}static _constrainedInsidePortLabelPlacement(t,e){let o=t.portContexts.get(e);if(e===u.EAST||e===u.WEST){n._simpleInsidePortLabelPlacement(t,e);return}let r=e===u.NORTH?Jt.DOWN:Jt.UP,i=e===u.NORTH?nt.TOP:nt.BOTTOM,s=t.insidePortLabelCells.get(e),a=s.getCellRectangle(),l=a.x+Math.max(s.getPadding().left,t.surroundingPortMargins.left,t.nodeLabelSpacing),c=a.x+a.width-Math.max(s.getPadding().right,t.surroundingPortMargins.right,t.nodeLabelSpacing),g=fs.createForDirection(r).withGap(t.portLabelSpacingHorizontal,t.portLabelSpacingVertical),h=e===u.NORTH?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;for(let f of o){if(f.portLabelCell==null||!f.portLabelCell.hasLabels())continue;let E=f.port.getSize(),P=f.portPosition,S=f.portLabelCell,T=S.getCellRectangle();T.width=S.getMinimumWidth(),T.height=S.getMinimumHeight(),S.setVerticalAlignment(i),S.setHorizontalAlignment(lt.RIGHT),n._centerPortLabel(T,P,E,l,c),g.addRectangle(T),h=e===u.NORTH?Math.max(h,P.y+f.port.getSize().y):Math.min(h,P.y)}h+=e===u.NORTH?t.portLabelSpacingVertical:-t.portLabelSpacingVertical;let d=g.withStartCoordinate(h).removeOverlaps();d>0&&(t.insidePortLabelCells.get(e).getMinimumContentAreaSize().y=d);for(let f of o){if(f.portLabelCell==null||!f.portLabelCell.hasLabels())continue;let E=f.portLabelCell.getCellRectangle();E.x-=f.portPosition.x,E.y-=f.portPosition.y}}static _centerPortLabel(t,e,o,r,i){t.x=e.x-(t.width-o.x)/2;let s=Math.min(r,e.x),a=Math.max(i,e.x+o.x);t.x<s?t.x=s:t.x+t.width>a&&(t.x=a-t.width)}static _simpleOutsidePortLabelPlacement(t,e){let o=t.portContexts.get(e),r=fo.isFirstOutsidePortLabelPlacedDifferently(t,e),i=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE);for(let s of o){if(s.portLabelCell==null||!s.portLabelCell.hasLabels())continue;let a=s.port.getSize(),l=s.portLabelCell,c=l.getCellRectangle();switch(c.width=l.getMinimumWidth(),c.height=l.getMinimumHeight(),e){case u.NORTH:s.labelsNextToPort?(c.x=(a.x-c.width)/2,l.setHorizontalAlignment(lt.CENTER)):r||i?(c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT)):(c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT)),c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM);break;case u.SOUTH:s.labelsNextToPort?(c.x=(a.x-c.width)/2,l.setHorizontalAlignment(lt.CENTER)):r||i?(c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT)):(c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT)),c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP);break;case u.EAST:{if(s.labelsNextToPort){let g=t.portLabelsTreatAsGroup?c.height:l.getLabels()[0].getSize().y;c.y=(a.y-g)/2,l.setVerticalAlignment(nt.CENTER)}else r||i?(c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM)):(c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP));c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT);break}case u.WEST:{if(s.labelsNextToPort){let g=t.portLabelsTreatAsGroup?c.height:l.getLabels()[0].getSize().y;c.y=(a.y-g)/2,l.setVerticalAlignment(nt.CENTER)}else r||i?(c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM)):(c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP));c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT);break}}r=!1}}static _constrainedOutsidePortLabelPlacement(t,e){let o=t.portContexts.get(e);if(o.length<=2||e===u.EAST||e===u.WEST){n._simpleOutsidePortLabelPlacement(t,e);return}let r=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),i=e===u.NORTH?Jt.UP:Jt.DOWN,s=e===u.NORTH?nt.BOTTOM:nt.TOP,a=fs.createForDirection(i).withGap(t.portLabelSpacingVertical,t.portLabelSpacingHorizontal),l=e===u.NORTH?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;for(let c of o){if(c.portLabelCell==null||!c.portLabelCell.hasLabels())continue;let g=c.port.getSize(),h=c.portPosition,d=c.portLabelCell,f=d.getCellRectangle();f.width=d.getMinimumWidth(),f.height=d.getMinimumHeight(),r?(f.x=h.x-d.getMinimumWidth()-t.portLabelSpacingHorizontal,r=!1):f.x=h.x+g.x+t.portLabelSpacingHorizontal,d.setVerticalAlignment(s),d.setHorizontalAlignment(lt.RIGHT),a.addRectangle(f),l=e===u.NORTH?Math.min(l,h.y):Math.max(l,h.y+c.port.getSize().y)}l+=e===u.NORTH?-t.portLabelSpacingVertical:t.portLabelSpacingVertical,a.withStartCoordinate(l).removeOverlaps();for(let c of o){if(c.portLabelCell==null||!c.portLabelCell.hasLabels())continue;let g=c.portLabelCell.getCellRectangle();g.x-=c.portPosition.x,g.y-=c.portPosition.y}}};var ql=class n{static calculateVerticalPortPlacementSize(t){switch(t.portConstraints){case H.FIXED_POS:n._calculateVerticalNodeSizeRequiredByFixedPosPorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFixedPosPorts(t,u.WEST);break;case H.FIXED_RATIO:n._calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,u.WEST);break;default:n._calculateVerticalNodeSizeRequiredByFreePorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFreePorts(t,u.WEST);break}}static _calculateVerticalNodeSizeRequiredByFixedPosPorts(t,e){let o=0;for(let i of t.portContexts.get(e))o=Math.max(o,i.portPosition.y+i.port.getSize().y);let r=t.insidePortLabelCells.get(e);r.getPadding().top=0,r.getMinimumContentAreaSize().y=o}static _calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,e){let o=t.insidePortLabelCells.get(e),r=t.portContexts.get(e);if(r.length===0){o.getPadding().top=0,o.getPadding().bottom=0;return}let i=t.portLabelsPlacement.has(it.INSIDE),s=0;t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let a=null,l=0,c=0;for(let g of r){let h=g.port.getProperty(Lr.PORT_RATIO_OR_POSITION),d=g.port.getSize().y;if(a==null)t.surroundingPortMargins!=null&&t.surroundingPortMargins.top>0&&(s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(t.surroundingPortMargins.top+g.portMargin.top,0,h)));else{let f=c+a.portMargin.bottom+t.portPortSpacing+g.portMargin.top;s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(f,l,h))}a=g,l=h,c=d}if(t.surroundingPortMargins!=null&&t.surroundingPortMargins.bottom>0){let g=c+t.surroundingPortMargins.bottom;i&&(g+=a.portMargin.bottom),s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(g,l,1))}o.getPadding().top=0,o.getMinimumContentAreaSize().y=s}static _calculateVerticalNodeSizeRequiredByFreePorts(t,e){let o=t.insidePortLabelCells.get(e);if(t.portContexts.get(e).length===0){o.getPadding().top=0,o.getPadding().bottom=0;return}o.getPadding().top=t.surroundingPortMargins.top,o.getPadding().bottom=t.surroundingPortMargins.bottom,t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let r=n._portHeightPlusPortPortSpacing(t,e);t.getPortAlignment(e)===qt.DISTRIBUTED&&(r+=2*t.portPortSpacing),o.getMinimumContentAreaSize().y=r}static _setupPortMargins(t,e){let o=t.portContexts.get(e),r=t.portLabelsPlacement.has(it.OUTSIDE),i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE),a=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),l=t.sizeOptions.has(Nt.UNIFORM_PORT_SPACING),c=!i&&!s&&(a||o.length===2);n._computeVerticalPortMargins(t,e,r);let g=null,h=null;r&&o.length>0&&(g=o[0],h=o[o.length-1],g.portMargin.top=0,h.portMargin.bottom=0,c&&!g.labelsNextToPort&&(g.portMargin.bottom=0)),l&&(n._unifyPortMargins(o),r&&g!=null&&(g.portMargin.top=0,h.portMargin.bottom=0))}static _computeVerticalPortMargins(t,e,o){for(let r of t.portContexts.get(e)){let i=r.portLabelCell!=null?r.portLabelCell.getMinimumHeight():0;if(i>0)if(r.labelsNextToPort){let s=r.port.getSize().y;if(i>s)if(t.portLabelsTreatAsGroup||r.portLabelCell.getLabels().length===1){let a=(i-s)/2;r.portMargin.top=a,r.portMargin.bottom=a}else{let l=(r.portLabelCell.getLabels()[0].getSize().y-s)/2;r.portMargin.top=Math.max(0,l),r.portMargin.bottom=i-l-s}}else r.portMargin.bottom=t.portLabelSpacingVertical+i;else if(it.isFixed(t.portLabelsPlacement)){let s=Ia(r.port);s.y<0&&(r.portMargin.top=-s.y),s.y+s.height>r.port.getSize().y&&(r.portMargin.bottom=s.y+s.height-r.port.getSize().y)}}}static _unifyPortMargins(t){let e=0,o=0;for(let r of t)e=Math.max(e,r.portMargin.top),o=Math.max(o,r.portMargin.bottom);for(let r of t)r.portMargin.top=e,r.portMargin.bottom=o}static _portHeightPlusPortPortSpacing(t,e){let o=0,r=t.portContexts.get(e);for(let i=0;i<r.length;i++){let s=r[i];o+=s.portMargin.top+s.port.getSize().y+s.portMargin.bottom,i<r.length-1&&(o+=t.portPortSpacing)}return o}};var us=class n{static process(t,e,o=!0,r=!1){if(e==null){for(let a of t.getNodes())n.process(t,a,!0,!1);return}let i=new qs(t,e);jl.createPortContexts(i,r);let s=!0;if(t!=null&&t.hasProperty(lr)){let a=t.getProperty(lr);s=a===R.UNDEFINED||a.isHorizontal()}return Ma.createNodeLabelCells(i,!1,s),Vl.createInsidePortLabelCells(i),fo.setupMinimumClientAreaSize(i),fo.setupNodePaddingForPortsWithOffset(i),Ti.calculateHorizontalPortPlacementSize(i),ql.calculateVerticalPortPlacementSize(i),wa.configureCellSystemSizeContributions(i),ba.setNodeWidth(i),Lr.placeHorizontalPorts(i),Ga.placeHorizontalPortLabels(i),wa.updateVerticalInsidePortLabelCellPadding(i),ba.setNodeHeight(i),o&&(fo.offsetSouthernPortsByNodeSize(i),Lr.placeVerticalPorts(i),Ga.placeVerticalPortLabels(i),Xl.placeLabels(i),fo.setNodePadding(i),fo.applyStuff(i)),i.nodeSize}static computeInsideNodeLabelPadding(t,e,o){let r=new qs(null,e);Ma.createNodeLabelCells(r,!0,!o.isVertical());let i=r.insideNodeLabelContainer,s=new yt;for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(G.BEGIN,a);l!=null&&(s.top=Math.max(s.top,l.getMinimumHeight()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(G.END,a);l!=null&&(s.bottom=Math.max(s.bottom,l.getMinimumHeight()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(a,G.BEGIN);l!=null&&(s.left=Math.max(s.left,l.getMinimumWidth()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(a,G.END);l!=null&&(s.right=Math.max(s.right,l.getMinimumWidth()))}return s.top>0&&(s.top+=i.getPadding().top,s.top+=i.getGap()),s.bottom>0&&(s.bottom+=i.getPadding().bottom,s.bottom+=i.getGap()),s.left>0&&(s.left+=i.getPadding().left,s.left+=i.getGap()),s.right>0&&(s.right+=i.getPadding().right,s.right+=i.getGap()),s}};var No=class{static calculateLabelAndNodeSizes(t){us.process(t)}static calculateNodeMargins(t){new Da(t).process()}static getNodeMarginCalculator(t){return new Da(t)}static sortPortLists(t){for(let e of t.getNodes())e.sortPortList()}};var fe=class fe{constructor(t){this.name=t,Object.freeze(this)}opposite(){switch(this){case fe.ABOVE:return fe.BELOW;case fe.BELOW:return fe.ABOVE;case fe.INLINE:return fe.INLINE;default:return fe.UNKNOWN}}toString(){return this.name}static values(){return[fe.UNKNOWN,fe.ABOVE,fe.BELOW,fe.INLINE]}static valueOf(t){return fe[t]}};Z(fe,"UNKNOWN",new fe("UNKNOWN")),Z(fe,"ABOVE",new fe("ABOVE")),Z(fe,"BELOW",new fe("BELOW")),Z(fe,"INLINE",new fe("INLINE")),Z(fe,"LABEL_SIDE",new m("org.eclipse.elk.labelSide",fe.UNKNOWN));var Vt=fe;var yo=class n{constructor(){throw new Error("ElkGraphAdapters is a namespace and must not be instantiated.")}static adapt(t){return new Mu(t)}static adaptSingleNode(t){let e=t.getParent?t.getParent():t.parent;return new Jl(e==null?null:n.adapt(e),t)}static adaptSinglePort(t){return new Ql(t)}},Js=class{constructor(t){this.element=t,this._volatileId=0}getProperty(t){if(t===Ke){let e=this.element.getProperty(Ke);return e==null?0:e}return this.element.getProperty(t)}hasProperty(t){return this.element.hasProperty(t)}getPosition(){return new O(this.element.getX(),this.element.getY())}getSize(){return new O(this.element.getWidth(),this.element.getHeight())}setSize(t){this.element.setWidth(t.x),this.element.setHeight(t.y)}setPosition(t){this.element.setX(t.x),this.element.setY(t.y)}getPadding(){let t=this.element.getProperty(ns);return t==null?new yt:new yt(t)}setPadding(t){this.element.setProperty(ns,new yt(t))}getMargin(){let t=this.element.getProperty(Nr);return t==null&&(t=new me),t}setMargin(t){this.element.setProperty(Nr,new me(t))}getVolatileId(){return this._volatileId}setVolatileId(t){this._volatileId=t}},Mu=class extends Js{constructor(t){super(t),this._childNodes=null}getNodes(){if(this._childNodes==null){this._childNodes=[];for(let t of this.element.children)this._childNodes.push(new Jl(this,t))}return this._childNodes}},Jl=class extends Js{constructor(t,e){super(e),this._parentGraphAdapter=t,this._labelAdapters=null,this._portAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getGraph(){return this._parentGraphAdapter}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}getPorts(){if(this._portAdapters==null){this._portAdapters=[];for(let t of this.element.ports)this._portAdapters.push(new Ql(t))}return this._portAdapters}getIncomingEdges(){if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let t of _i(this.element))this._incomingEdgeAdapters.push(new Qs(t))}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let t of Ee(this.element))this._outgoingEdgeAdapters.push(new Qs(t))}return this._outgoingEdgeAdapters}sortPortList(t){if(this.element.getProperty(cr).isOrderFixed()){let e=t||aE;this.element.ports.sort(e)}}isCompoundNode(){return this.element.children.length>0||this.element.getProperty(ls)}},Ha=class extends Js{constructor(t){super(t)}getSide(){return this.element.getProperty(Vt.LABEL_SIDE)}getText(){return this.element.getText()}},Ql=class extends Js{constructor(t){super(t),this._labelAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getSide(){return this.element.getProperty(Tr)}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}getIncomingEdges(){if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let t of this.element.incomingEdges)this._incomingEdgeAdapters.push(new Qs(t))}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let t of this.element.outgoingEdges)this._outgoingEdgeAdapters.push(new Qs(t))}return this._outgoingEdgeAdapters}hasCompoundConnections(){let t=this.element.getParent();for(let e of this.element.outgoingEdges)for(let o of e.targets){let r=Pt(o);if(mo(r,t)||r===t&&e.getProperty(Ca))return!0}for(let e of this.element.incomingEdges)for(let o of e.sources)if(mo(Pt(o),t))return!0;return!1}},Qs=class{constructor(t){this.element=t,this._labelAdapters=null}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}},nE=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);function aE(n,t){var a,l;let e=n.getProperty(Tr),o=t.getProperty(Tr),r=((a=nE.get(e))!=null?a:0)-((l=nE.get(o))!=null?l:0);if(r!==0)return r;let i=n.getProperty(Gl),s=t.getProperty(Gl);if(i!=null&&s!=null){let c=i-s;if(c!==0)return c}switch(e){case u.NORTH:return n.getX()-t.getX();case u.EAST:return n.getY()-t.getY();case u.SOUTH:return t.getX()-n.getX();case u.WEST:return t.getY()-n.getY();default:throw new Error("Port side is undefined")}}yo.adapt=yo.adapt;yo.DEFAULT_PORTLIST_SORTER=aE;var Go=class n{constructor(t){this._adapter=t}static forGraph(t){return typeof t.getNodes=="function"&&typeof t.getLabels=="function"?new n(t):new n(yo.adapt(t))}execute(){No.sortPortLists(this._adapter),No.calculateLabelAndNodeSizes(this._adapter),No.calculateNodeMargins(this._adapter)}};var lE=Object.freeze({PARALLEL_NODE:"PARALLEL_NODE",HIERARCHICAL_NODE:"HIERARCHICAL_NODE",ROOT_NODE:"ROOT_NODE",values(){return[this.PARALLEL_NODE,this.HIERARCHICAL_NODE,this.ROOT_NODE]},valueOf(n){return this[n]}});var fr=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};fr.EADES=new fr("EADES");fr.FRUCHTERMAN_REINGOLD=new fr("FRUCHTERMAN_REINGOLD");var bu=new m("org.eclipse.elk.force.model",()=>fr.FRUCHTERMAN_REINGOLD),tn=new m("org.eclipse.elk.force.iterations",300,1),Gu=new m("org.eclipse.elk.force.repulsivePower",0,0),tc=new m("org.eclipse.elk.force.temperature",.001,Xe.greaterThan(0)),ec=new m("org.eclipse.elk.force.repulsion",5,Xe.greaterThan(0));var Vo=new m("org.eclipse.elk.priority",1),_s=new m("org.eclipse.elk.spacing.nodeNode",80,0),nM=new m("org.eclipse.elk.spacing.edgeLabel",5,0),cE=new m("org.eclipse.elk.aspectRatio",1.6,Xe.greaterThan(0)),gE=new m("org.eclipse.elk.randomSeed",1),hE=new m("org.eclipse.elk.separateConnectedComponents",!0),dE=new m("org.eclipse.elk.padding",new yt(50)),aM=new m("org.eclipse.elk.edgeLabels.inline",!1),lM=new m("org.eclipse.elk.topdown.nodeType",lE.HIERARCHICAL_NODE);var yi=class extends ge{constructor(){super(),this._displacement=new O,this._position=new O,this._size=new O}getPosition(){return this._position}getSize(){return this._size}getRadius(){return this._size.length()/2}getDisplacement(){return this._displacement}};var Es=class extends yi{constructor(t,e){super(),this.id=0,this._label=t!=null?t:null,this._parent=e!=null?e:null,this._children=null}toString(){return this._label==null||this._label.length===0?`n_${this.id}`:`n_${this._label}`}isCompound(){return this._children!=null&&this._children.length>0}getLabel(){return this._label}getParent(){return this._parent}getChildren(){return this._children==null&&(this._children=[]),this._children}getDepth(){let t=0,e=this._parent;for(;e!=null;)e=e.getParent(),t++;return t}};var $r=class extends yi{constructor(t){super(),this._edge=t,t.getBendpoints().push(this)}getEdge(){return this._edge}toString(){if(this._edge!=null){let t=this._edge.getBendpoints().indexOf(this);return t>=0?`b${t}[${this._edge}]`:`b[${this._edge}]`}return`b_${this}`}};var Ii=class extends ge{constructor(){super(),this._nodes=[],this._edges=[],this._labels=[],this._bendPoints=[],this._adjacency=null}getEdges(){return this._edges}getNodes(){return this._nodes}getLabels(){return this._labels}getBendpoints(){return this._bendPoints}*getParticles(){for(let t of this._nodes)yield t;for(let t of this._labels)yield t;for(let t of this._bendPoints)yield t}getConnection(t,e){return t instanceof Es&&e instanceof Es?this._adjacency[t.id][e.id]+this._adjacency[e.id][t.id]:t instanceof $r&&e instanceof $r&&t.getEdge()===e.getEdge()?e.getEdge().getProperty(Vo):0}calcAdjacency(){let t=this._nodes.length;this._adjacency=[];for(let e=0;e<t;e++)this._adjacency.push(new Array(t).fill(0));for(let e of this._edges)this._adjacency[e.getSource().id][e.getTarget().id]+=e.getProperty(Vo)}};var Ut=class{};Ut.ORIGIN=new m("origin");Ut.RANDOM=new m("random");Ut.BB_UPLEFT=new m("boundingBox.upLeft");Ut.BB_LOWRIGHT=new m("boundingBox.lowRight");var en=class{split(t){let e=t.getProperty(hE);if(e==null||e===!0){let o=new Array(t.getNodes().length).fill(!1),r=this._buildIncidenceLists(t),i=[];for(let s of t.getNodes()){let a=this._dfs(s,null,null,o,r);a!=null&&(a.copyProperties(t),i.push(a))}if(i.length>1)for(let s of i){let a=0;for(let l of s.getNodes())l.id=a++}return i}return[t]}_buildIncidenceLists(t){let e=t.getNodes().length,o=new Array(e);for(let r=0;r<e;r++)o[r]=[];for(let r of t.getEdges())o[r.getSource().id].push(r),o[r.getTarget().id].push(r);return o}_dfs(t,e,o,r,i){if(!r[t.id]){r[t.id]=!0;let s=o!=null?o:new Ii;s.getNodes().push(t);for(let a of i[t.id])if(!(a.getTarget()===e||a.getSource()===e)){a.getSource()!==t&&this._dfs(a.getSource(),t,s,r,i),a.getTarget()!==t&&this._dfs(a.getTarget(),t,s,r,i),s.getEdges().push(a);for(let l of a.getLabels())s.getLabels().push(l)}return s}return null}recombine(t){var g,h;if(t.length===1)return t[0];if(t.length<=0)return new Ii;for(let d of t){let f=0,E=Number.POSITIVE_INFINITY,P=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(let N of d.getNodes())f+=(g=N.getProperty(Vo))!=null?g:0,E=Math.min(E,N.getPosition().x-N.getSize().x/2),P=Math.min(P,N.getPosition().y-N.getSize().y/2),S=Math.max(S,N.getPosition().x+N.getSize().x/2),T=Math.max(T,N.getPosition().y+N.getSize().y/2);d.setProperty(Vo,f),d.setProperty(Ut.BB_UPLEFT,new O(E,P)),d.setProperty(Ut.BB_LOWRIGHT,new O(S,T))}t.sort((d,f)=>{var P,S;let E=((P=f.getProperty(Vo))!=null?P:0)-((S=d.getProperty(Vo))!=null?S:0);if(E===0){let T=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT)),N=f.getProperty(Ut.BB_LOWRIGHT).clone().sub(f.getProperty(Ut.BB_UPLEFT));return T.x*T.y-N.x*N.y}return E});let e=new Ii;e.copyProperties(t[0]);let o=0,r=0;for(let d of t){let f=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT));o=Math.max(o,f.x),r+=f.x*f.y}o=Math.max(o,Math.sqrt(r)*((h=e.getProperty(cE))!=null?h:1));let i=e.getProperty(_s),s=0,a=0,l=0,c=i;for(let d of t){let f=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT));s+f.x>o&&(s=0,a+=l+i,l=0),this._moveGraph(e,d,s,a),c=Math.max(c,s+f.x),l=Math.max(l,f.y),s+=f.x+i}return e}_moveGraph(t,e,o,r){let i=new O(o,r);i.sub(e.getProperty(Ut.BB_UPLEFT));for(let s of e.getNodes())s.getPosition().add(i),t.getNodes().push(s);for(let s of e.getEdges()){for(let a of s.getBendpoints())a.getPosition().add(i);t.getEdges().push(s)}for(let s of e.getLabels())s.getPosition().add(i),t.getLabels().push(s)}};var U=class U{constructor(){throw new Error("ElkMath is a static utility class")}static factl(t){if(t<0||t>=U._FACT_TABLE.length)throw new Error(`The input must be between 0 and ${U._FACT_TABLE.length}`);return U._FACT_TABLE[t]}static factd(t){if(t<0)throw new Error("The input must be positive");return t<U._FACT_TABLE.length?U._FACT_TABLE[t]:Math.sqrt(2*Math.PI*t)*(U.powf(t,t)/U.powd(Math.E,t))}static binomiall(t,e){if(t<0||e<0)throw new Error("k and n must be positive");if(e>t)throw new Error("k must be smaller than n");return e===0||e===t?1:t===0?0:t<U._FACT_TABLE.length?U.factl(t)/(U.factl(e)*U.factl(t-e)):U.binomiall(t-1,e-1)+U.binomiall(t-1,e)}static binomiald(t,e){if(t<0||e<0)throw new Error("k and n must be positive");if(e>t)throw new Error("k must be smaller than n");return e===0||e===t?1:t===0?0:U.factd(t)/(U.factd(e)*U.factd(t-e))}static powd(t,e){let o=1,r=t,i=e>=0?e:-e;for(;i>0;)i%2===0?(r*=r,i=Math.floor(i/2)):(o*=r,i-=1);return e<0?1/o:o}static powf(t,e){return U.powd(t,e)}static approximateBezierSegment(t,...e){let o,r;if(typeof t=="number"&&e.length>0&&e[0]instanceof O?(o=t,r=e):t instanceof O?(r=[t,...e],o=r.length+1):(o=t,r=e),o<=0)return[];let i=[],s=1/o,a=0;for(let l=0;l<o;l++)a+=s,i.push(U.getPointOnBezierSegment(a,r));return i}static getPointOnBezierSegment(t,e){let o=e.length-1,r=0,i=0;for(let s=0;s<=o;s++){let a=e[s],l=U.binomiald(o,s)*U.powd(1-t,o-s)*U.powd(t,s);r+=a.x*l,i+=a.y*l}return new O(r,i)}static approximateBezierSpline(t){let e=t.length,o=new st,r=0,i=t[r++];for(o.push(i);r<e;){let s=e-r;if(s===1)o.push(t[r++]);else if(s===2){let a=U.approximateBezierSegment(i,t[r++],t[r++]);for(let l of a)o.push(l)}else{let a=t[r++],l=t[r++],c=t[r++],g=U.approximateBezierSegment(i,a,l,c);for(let h of g)o.push(h);i=c}}return o}static distanceFromBezierSegment(t,e,o,r,i){let s=new Array(U._W_DEGREE),a=[t,e,o,r],l=U._convertToBezierForm(a,i),c=U._findRoots(l,U._W_DEGREE,s,0),g=i.distance(t),h=0;for(let E=0;E<c;E++){let P=U._bezier(a,U._DEGREE,s[E],null,null),S=i.distance(P);S<g&&(g=S,h=s[E])}i.distance(r)<g&&(h=1);let f=new O(U._bezier(a,U._DEGREE,h,null,null));return Math.sqrt(f.distance(i))}static _convertToBezierForm(t,e){let o=U._DEGREE,r=U._W_DEGREE,i=new Array(o+1),s=new Array(o),a=Array.from({length:o},()=>new Array(o+1).fill(0)),l=new Array(r+1);for(let d=0;d<=o;d++)i[d]=new O(t[d].x-e.x,t[d].y-e.y);let c=o;for(let d=0;d<=o-1;d++)s[d]=new O(c*(t[d+1].x-t[d].x),c*(t[d+1].y-t[d].y));for(let d=0;d<=o-1;d++)for(let f=0;f<=o;f++)a[d][f]=s[d].x*i[f].x+s[d].y*i[f].y;for(let d=0;d<=r;d++)l[d]=new O(d/r,0);let g=o,h=o-1;for(let d=0;d<=g+h;d++){let f=Math.max(0,d-h),E=Math.min(d,g);for(let P=f;P<=E;P++){let S=d-P;l[P+S].y+=a[S][P]*U._CUBIC_Z[S][P]}}return l}static _findRoots(t,e,o,r){switch(U._crossingCount(t,e)){case 0:return 0;case 1:if(r>=U._MAXDEPTH)return o[0]=(t[0].x+t[U._W_DEGREE].x)/2,1;if(U._controlPolygonFlatEnough(t,e))return o[0]=U._computeXIntercept(t,e),1;break;default:break}let i=new Array(U._W_DEGREE+1),s=new Array(U._W_DEGREE+1),a=new Array(U._W_DEGREE+1),l=new Array(U._W_DEGREE+1);U._bezier(t,e,.5,i,s);let c=U._findRoots(i,e,a,r+1),g=U._findRoots(s,e,l,r+1);for(let h=0;h<c;h++)o[h]=a[h];for(let h=0;h<g;h++)o[h+c]=l[h];return c+g}static _controlPolygonFlatEnough(t,e){let o=t[0].y-t[e].y,r=t[e].x-t[0].x,i=t[0].x*t[e].y-t[e].x*t[0].y,s=o*o+r*r,a=new Array(e+1).fill(0);for(let M=1;M<e;M++)a[M]=o*t[M].x+r*t[M].y+i,a[M]>0&&(a[M]=a[M]*a[M]/s),a[M]<0&&(a[M]=-(a[M]*a[M]/s));let l=0,c=0;for(let M=1;M<e;M++)a[M]<0&&(c=Math.min(c,a[M])),a[M]>0&&(l=Math.max(l,a[M]));let g=0,h=1,d=0,f=o,E=r,P=i+l,S=g*E-f*h,T=1/S,N=(h*P-E*d)*T;P=i+c,S=g*E-f*h,T=1/S;let I=(h*P-E*d)*T,C=Math.min(N,I);return(Math.max(N,I)-C)/2<U._EPSILON}static _computeXIntercept(t,e){let o=t[e].x-t[0].x,r=t[e].y-t[0].y,i=t[0].x,s=t[0].y,a=-1/r;return(o*s-r*i)*a}static _crossingCount(t,e){let o=0,r=t[0].y<0?-1:1,i=r;for(let s=1;s<=e;s++)r=t[s].y<0?-1:1,r!==i&&o++,i=r;return o}static _bezier(t,e,o,r,i){let s=U._W_DEGREE,a=Array.from({length:s+1},()=>new Array(s+1).fill(null));for(let l=0;l<=e;l++)a[0][l]=new O(t[l]);for(let l=1;l<=e;l++)for(let c=0;c<=e-l;c++)a[l][c]=new O((1-o)*a[l-1][c].x+o*a[l-1][c+1].x,(1-o)*a[l-1][c].y+o*a[l-1][c+1].y);if(r!=null)for(let l=0;l<=e;l++)r[l]=a[l][0];if(i!=null)for(let l=0;l<=e;l++)i[l]=a[e-l][l];return a[e][0]}static maxi(...t){let e=-1/0;for(let o of t)o>e&&(e=o);return e}static mini(...t){let e=1/0;for(let o of t)o<e&&(e=o);return e}static averagei(...t){let e=0;for(let o of t)e+=o;return Math.trunc(e/t.length)}static maxl(...t){return U.maxi(...t)}static minl(...t){return U.mini(...t)}static averagel(...t){return U.averagei(...t)}static maxf(...t){return U.maxi(...t)}static minf(...t){return U.mini(...t)}static averagef(...t){let e=0;for(let o of t)e+=o;return e/t.length}static maxd(...t){return U.maxi(...t)}static mind(...t){return U.mini(...t)}static averaged(...t){return U.averagef(...t)}static boundi(t,e,o){return t<=e?e:t>=o?o:t}static boundl(t,e,o){return U.boundi(t,e,o)}static boundf(t,e,o){return U.boundi(t,e,o)}static boundd(t,e,o){return U.boundi(t,e,o)}static clipVector(t,e,o){let r=e/2,i=o/2,s=Math.abs(t.x),a=Math.abs(t.y),l=1,c=1;return s>r&&(l=r/s),a>i&&(c=i/a),t.scale(Math.min(l,c)),t}static signum(t){return t<0?-1:t>0?1:0}static _fuzzyEquals(t,e,o=U._DOUBLE_EQ_EPSILON){return Math.abs(t-e)<=o}static _fuzzyCompare(t,e,o=U._DOUBLE_EQ_EPSILON){return Math.abs(t-e)<=o?0:t<e?-1:1}static intersects(t,e,o,r){if(t instanceof dt&&e instanceof st){let i=t,s=e;if(s.length<2)return!1;let a=s[0],l=a;for(let c=1;c<s.length;c++){let g=s[c];if(U.intersects(i,l,g))return!0;l=g}return U.intersects(i,l,a)}else if(t instanceof dt&&e instanceof O){let i=t,s=e,a=o;return U.contains(i,s,a)?!1:U._intersectsSegments(i.getTopLeft(),i.getTopRight(),s,a)||U._intersectsSegments(i.getTopRight(),i.getBottomRight(),s,a)||U._intersectsSegments(i.getBottomRight(),i.getBottomLeft(),s,a)||U._intersectsSegments(i.getBottomLeft(),i.getTopLeft(),s,a)}else return U._intersectsSegments(t,e,o,r)}static _intersectsSegments(t,e,o,r){let i=t,s=e.clone().sub(t),a=o,l=r.clone().sub(o),c=i.x,g=i.y,h=a.x,d=a.y,f=s.x,E=s.y,P=l.x,S=l.y,T=P*E-f*S;if(U._fuzzyEquals(0,T))return!1;let N=1/T*((c-h)*E-(g-d)*f),I=1/T*-(-(c-h)*S+(g-d)*P);return U._fuzzyCompare(0,N)<0&&U._fuzzyCompare(N,1)<0&&U._fuzzyCompare(0,I)<0&&U._fuzzyCompare(I,1)<0}static intersects2(t,e,o,r){let i=o.clone().sub(t),s=O.crossProduct(i,e),a=O.crossProduct(e,r),l=O.crossProduct(i,r)/a,c=s/a;if(a===0)if(s===0){let g=o.clone().add(r.clone().scale(.5)),h=t.distance(g),d=t.clone().add(e).distance(g),f=r.length()*.5;return h<d&&h<=f?t.clone():d<=f?t.clone().add(e):null}else return null;else return l>=0&&l<=1&&c>=0&&c<=1?t.clone().add(e.clone().scale(l)):null}static distance(t,e,o,r,i){return Math.min(U._traceRays(t,e,o,r,i),U._traceRays(o,r,t,e,i.clone().negate()))}static _traceRays(t,e,o,r,i){let s=1/0,a,l=!1;a=U.intersects2(t,e.clone().sub(t),o.clone().add(i),r.clone().sub(o));let c=a!=null&&!(a.equalsFuzzily(t)||a.equalsFuzzily(e));return a=U.intersects2(t,e.clone().sub(t),o,i),a!=null&&(a.equalsFuzzily(t)===a.equalsFuzzily(e)||c?s=Math.min(s,a.sub(o).length()):l=!0),a=U.intersects2(t,e.clone().sub(t),r,i),a!=null&&(l||a.equalsFuzzily(t)===a.equalsFuzzily(e)||c)&&(s=Math.min(s,a.sub(r).length())),s}static contains(t,e,o){if(e instanceof st){let r=e;if(r.length<2)return!1;let i=r[0],s=i;for(let a=1;a<r.length;a++){let l=r[a];if(!U.contains(t,s,l))return!1;s=l}return U.contains(t,s,i)}else return o!==void 0?U._containsPoint(t,e)&&U._containsPoint(t,o):U._containsPoint(t,e)}static _containsPoint(t,e){let o=t.x,r=t.x+t.width,i=t.y,s=t.y+t.height;return e.x>o&&e.x<r&&e.y>i&&e.y<s}static shortestDistance(t,e){let o=U._DOUBLE_EQ_EPSILON,r=e.x-(t.x+t.width),i=t.x-(e.x+e.width),s=t.y-(e.y+e.height),a=e.y-(t.y+t.height),l=Math.max(i,r),c=Math.max(s,a),g=U._fuzzyCompare(l,0,o)>=0,h=U._fuzzyCompare(c,0,o)>=0;return g!==h?Math.max(c,l):U._fuzzyCompare(l,0,o)>0?Math.sqrt(c*c+l*l):-Math.sqrt(c*c+l*l)}};Z(U,"_FACT_TABLE",[1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368e3,20922789888e3,355687428096e3,6402373705728e3,121645100408832e3,243290200817664e4]),Z(U,"_W_DEGREE",5),Z(U,"_DEGREE",3),Z(U,"_CUBIC_Z",[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]]),Z(U,"_MAXDEPTH",64),Z(U,"_EPSILON",1*Math.pow(2,-65)),Z(U,"_DOUBLE_EQ_EPSILON",1e-5);var Ft=U;var oc=class extends ge{constructor(){super(),this._bendpoints=[],this._labels=[],this._source=null,this._target=null}toString(){var t;return this._source!=null&&this._target!=null?`${this._source}->${this._target}`:"e_"+((t=this._id)!=null?t:"")}getSource(){return this._source}getTarget(){return this._target}getBendpoints(){return this._bendpoints}getLabels(){return this._labels}getSourcePoint(){let t=this._target.getPosition().clone().sub(this._source.getPosition());return Ft.clipVector(t,this._source.getSize().x,this._source.getSize().y),t.add(this._source.getPosition())}getTargetPoint(){let t=this._source.getPosition().clone().sub(this._target.getPosition());return Ft.clipVector(t,this._target.getSize().x,this._target.getSize().y),t.add(this._target.getPosition())}setSource(t){this._source=t}setTarget(t){this._target=t}toVectorChain(){let t=new st;t.add(this.getSourcePoint());for(let e of this._bendpoints)t.add(e.getPosition());return t.add(this.getTargetPoint()),t}distributeBendpoints(){let t=this._bendpoints.length;if(t>0){let e=this._source.getPosition(),r=this._target.getPosition().clone().sub(e).scale(1/(t+1)),i=e.clone();for(let s of this._bendpoints)s.getPosition().x=i.x+r.x,s.getPosition().y=i.y+r.y,i.add(r)}}};var rc=class extends yi{constructor(t,e){super(),this._edge=t,this._text=e,t.getLabels().push(this)}getText(){return this._text}getEdge(){return this._edge}toString(){return this._text==null||this._text.length===0?`l[${this._edge}]`:`l_${this._text}`}refreshPosition(){let t=this.getProperty(Ou),e=this._edge.getSource().getPosition(),o=this._edge.getTarget().getPosition();if(t){let r=o.clone().sub(e).scale(.5),i=this.getSize().clone().scale(.5),s=e.clone().add(r).sub(i);this.getPosition().set(s)}else{let r=this._edge.getProperty(gu),i=this.getPosition();e.x>=o.x?e.y>=o.y?(i.x=o.x+(e.x-o.x)/2+r,i.y=o.y+(e.y-o.y)/2-r-this.getSize().y):(i.x=o.x+(e.x-o.x)/2+r,i.y=e.y+(o.y-e.y)/2+r):e.y>=o.y?(i.x=e.x+(o.x-e.x)/2+r,i.y=o.y+(e.y-o.y)/2+r):(i.x=e.x+(o.x-e.x)/2+r,i.y=e.y+(o.y-e.y)/2-r-this.getSize().y)}}};var on=class{importGraph(t){let e=new Ii;e.copyProperties(t),e.setProperty(Ut.ORIGIN,t);let o=new Map;return this._transformNodes(t,e,o),this._transformEdges(t,e,o),e}_transformNodes(t,e,o){let r=0;for(let i of t.children){let s="";i.labels.length>0&&(s=i.labels[0].getText());let a=new Es(s);a.copyProperties(i),a.setProperty(Ut.ORIGIN,i),a.id=r++,a.getPosition().x=i.getX()+i.getWidth()/2,a.getPosition().y=i.getY()+i.getHeight()/2,a.getSize().x=Math.max(i.getWidth(),1),a.getSize().y=Math.max(i.getHeight(),1),e.getNodes().push(a),o.set(i,a);let l=i.getProperty(cr);l===H.UNDEFINED&&(l=H.FREE)}}_transformEdges(t,e,o){for(let r of t.children)for(let i of Ee(r)){if(i.isHyperedge())throw new Error("Graph must not contain hyperedges.");let s=Pt(i.targets[0]);if(!i.isHierarchical()&&r!==s){let a=new oc;a.copyProperties(i),a.setProperty(Ut.ORIGIN,i),a.setSource(o.get(r)),a.setTarget(o.get(s)),e.getEdges().push(a);for(let l of i.labels){let c=new rc(a,l.getText());c.copyProperties(l),c.setProperty(Ut.ORIGIN,l),c.getSize().x=Math.max(l.getWidth(),1),c.getSize().y=Math.max(l.getHeight(),1),c.refreshPosition(),e.getLabels().push(c)}}}}applyLayout(t){let e=t.getProperty(Ut.ORIGIN),o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let h of t.getNodes()){let d=h.getPosition(),f=h.getSize();o=Math.min(o,d.x-f.x/2),r=Math.min(r,d.y-f.y/2),i=Math.max(i,d.x+f.x/2),s=Math.max(s,d.y+f.y/2)}for(let h of t.getBendpoints()){let d=h.getPosition(),f=h.getSize();o=Math.min(o,d.x-f.x/2),r=Math.min(r,d.y-f.y/2),i=Math.max(i,d.x+f.x/2),s=Math.max(s,d.y+f.y/2)}let a=e.getProperty(dE),l=new O(a.getLeft()-o,a.getTop()-r);for(let h of t.getNodes()){let d=h.getProperty(Ut.ORIGIN);if(d!=null&&d.children!==void 0){let f=new O(h.getPosition()).add(l);d.setLocation(f.x-d.getWidth()/2,f.y-d.getHeight()/2)}}for(let h of t.getEdges()){let d=h.getProperty(Ut.ORIGIN),f=ar(d,!0,!0),E=new O(h.getSourcePoint());E.add(l),f.setStartLocation(E.x,E.y);for(let S of h.getBendpoints()){let T=new O(S.getPosition());T.add(l),Sa(f,T.x,T.y)}let P=new O(h.getTargetPoint());P.add(l),f.setEndLocation(P.x,P.y)}for(let h of t.getLabels()){let d=h.getProperty(Ut.ORIGIN),f=new O(h.getPosition()).add(l);d.setLocation(f.x,f.y)}let c=i-o+a.getHorizontal(),g=s-r+a.getVertical();e.getProperty(To)||Ae(e,c,g,!1,!0),e.setProperty(pi,c-a.getHorizontal()),e.setProperty(Ei,g-a.getVertical())}};var Hu=16,Ri=class{constructor(){this._random=null,this._graph=null,this._dispBound=0}initialize(t){if(this._graph=t,this._random=t.getProperty(Ut.RANDOM),t.calcAdjacency(),this._dispBound=Math.max(t.getNodes().length*Hu+t.getEdges().length,Hu*Hu),!t.getProperty(zo)){let o=this._graph.getNodes().length;for(let r of t.getNodes()){let i=r.getPosition();i.x=this._random.nextDouble()*o,i.y=this._random.nextDouble()*o}}let e=t.getBendpoints();for(let o of t.getEdges()){let r=o.getProperty(Gu);if(r>0){for(let i=0;i<r;i++)e.push(new $r(o));o.distributeBendpoints()}}}getGraph(){return this._graph}getRandom(){return this._random}layout(t,e){var r;e.begin("Component Layout",1),this.initialize(t);let o=0;for(;this.moreIterations(o)&&!((r=e.isCanceled)!=null&&r.call(e));){this.iterationDone();for(let i of t.getParticles())for(let s of t.getParticles())if(s!==i){let a=this.calcDisplacement(s,i);a!=null&&i.getDisplacement().add(a)}for(let i of t.getParticles()){let s=i.getDisplacement();s.bound(-this._dispBound,-this._dispBound,this._dispBound,this._dispBound),i.getPosition().add(s),s.reset()}o++}e.done()}iterationDone(){for(let t of this._graph.getEdges()){for(let e of t.getLabels())e.refreshPosition();t.distributeBendpoints()}}moreIterations(t){throw new Error("moreIterations must be implemented by subclass")}calcDisplacement(t,e){throw new Error("calcDisplacement must be implemented by subclass")}static avoidSamePosition(t,e,o){let r=e.getPosition(),i=o.getPosition();for(;r.x-i.x===0&&r.y-i.y===0;){let s=!1;if(e instanceof $r&&o instanceof $r&&!s){let a=e.getEdge(),l=new O(a.getTargetPoint()).sub(a.getSourcePoint()),c=2,g=new O(l.x/l.length()*c,-l.y/l.length()*c);r.add(g);let h=o.getEdge(),d=new O(h.getTargetPoint()).sub(h.getSourcePoint());c=l===d?-2:2;let f=new O(d.x/d.length()*c,-(d.y/d.length())*c);r.add(f),s=!0}else{let a=()=>t.nextDouble();r.wiggle(a,1),i.wiggle(a,1)}}}};var fE=100,va=class n extends Ri{constructor(){super(),this._maxIterations=tn.getDefault(),this._springLength=_s.getDefault(),this._repulsionFactor=ec.getDefault()}initialize(t){super.initialize(t),this._maxIterations=t.getProperty(tn),this._springLength=t.getProperty(_s),this._repulsionFactor=t.getProperty(ec)}moreIterations(t){return t<this._maxIterations}calcDisplacement(t,e){var l;Ri.avoidSamePosition(this.getRandom(),t,e);let o=e.getPosition().clone().sub(t.getPosition()),r=o.length(),i=Math.max(0,r-t.getRadius()-e.getRadius()),s,a=this.getGraph().getConnection(t,e);if(a>0)s=-n.attractive(i,this._springLength)*a;else{let c=(l=t.getProperty(Vo))!=null?l:0;s=n._repulsive(i,this._repulsionFactor)*c}return o.scale(s/r),o}static _repulsive(t,e){return t>0?e/(t*t):e*fE}static attractive(t,e){return t>0?Math.log(t/e):-fE}};var eT=.01,oT=100,Ba=class n extends Ri{constructor(){super(),this._temperature=tc.getDefault(),this._threshold=0,this._k=0}initialize(t){super.initialize(t),this._temperature=t.getProperty(tc),this._threshold=this._temperature/t.getProperty(tn);let e=t.getNodes().length,o=0,r=0;for(let a of t.getNodes())o+=a.getSize().x,r+=a.getSize().y;let i=o*r,s=t.getProperty(_s)*eT;this._k=Math.sqrt(i/(2*e))*s}moreIterations(t){return this._temperature>0}calcDisplacement(t,e){var c;Ri.avoidSamePosition(this.getRandom(),t,e);let o=e.getPosition().clone().sub(t.getPosition()),r=o.length(),i=Math.max(0,r-t.getRadius()-e.getRadius()),s=(c=t.getProperty(Vo))!=null?c:0,a=n._repulsive(i,this._k)*s,l=this.getGraph().getConnection(t,e);return l>0&&(a-=n.attractive(i,this._k)*l),o.scale(a*this._temperature/r),o}iterationDone(){super.iterationDone(),this._temperature-=this._threshold}static _repulsive(t,e){return t>0?e*e/t:e*e*oT}static attractive(t,e){return t*t/e}};var rn=class extends de{constructor(){super(),this._forceModel=null,this._componentsProcessor=new en}layout(t,e){e.begin("ELK Force",1),t.getProperty(So)||Go.forGraph(t).execute();let o=new on,r=o.importGraph(t);this._setOptions(r,t),this._updateModel(r.getProperty(bu));let i=this._componentsProcessor.split(r);for(let s of i){let a=typeof e.subTask=="function"?e.subTask(1/i.length):e;this._forceModel.layout(s,a)}r=this._componentsProcessor.recombine(i),o.applyLayout(r),e.done()}_setOptions(t,e){let o=t.getProperty(gE);o!=null?o===0?t.setProperty(Ut.RANDOM,new dr):t.setProperty(Ut.RANDOM,new dr(o)):t.setProperty(Ut.RANDOM,new dr(1))}_updateModel(t){switch(t){case fr.EADES:this._forceModel instanceof va||(this._forceModel=new va);break;case fr.FRUCHTERMAN_REINGOLD:default:this._forceModel instanceof Ba||(this._forceModel=new Ba);break}}};var uE="org.eclipse.elk.force",_E=!1;function pE(){let n=Ht.getInstance(),t=n.getAlgorithmData(uE);if(t)return _E=!0,t;let e=new Se.Builder().id(uE).name("ELK Force").description("Force-based algorithm provided by the Eclipse Layout Kernel.").category("org.eclipse.elk.force").definingBundleId("org.eclipse.elk.alg.force").providerFactory(()=>new rn).supportedFeatures(new Set(["MULTI_EDGES","EDGE_LABELS"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),_E=!0,e}var eo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};eo.XY=new eo("XY");eo.X=new eo("X");eo.Y=new eo("Y");var vu=new m("org.eclipse.elk.stress.fixed",!1),Ua=new m("org.eclipse.elk.stress.desiredEdgeLength",100),Bu=new m("org.eclipse.elk.stress.dimension",()=>eo.XY),Uu=new m("org.eclipse.elk.stress.epsilon",.001),Fu=new m("org.eclipse.elk.stress.iterationLimit",Number.MAX_SAFE_INTEGER);var N0=new m("org.eclipse.elk.edgeLabels.inline",!0);var ic=class n{constructor(){this._graph=null,this._apsp=null,this._w=null,this._desiredEdgeLength=0,this._dim=eo.XY,this._epsilon=0,this._iterationLimit=Number.MAX_SAFE_INTEGER,this._connectedEdges=new Map}initialize(t){if(t.getNodes().length<=1)return;this._graph=t,this._dim=t.getProperty(Bu),this._iterationLimit=t.getProperty(Fu),this._epsilon=t.getProperty(Uu),this._desiredEdgeLength=t.getProperty(Ua),this._connectedEdges.clear();for(let o of t.getEdges())this._pushEdge(o.getSource(),o),this._pushEdge(o.getTarget(),o);let e=t.getNodes().length;this._apsp=[];for(let o=0;o<e;o++)this._apsp.push(new Array(e).fill(0));for(let o of t.getNodes())this._dijkstra(o,this._apsp[o.id]);this._w=[];for(let o=0;o<e;o++)this._w.push(new Array(e).fill(0));for(let o=0;o<e;o++)for(let r=0;r<e;r++){let i=this._apsp[o][r];this._w[o][r]=i===0?0:1/(i*i)}}_pushEdge(t,e){let o=this._connectedEdges.get(t);o==null&&(o=[],this._connectedEdges.set(t,o)),o.push(e)}execute(){if(this._graph.getNodes().length<=1)return;let t=0,e=this._computeStress(),o=Number.POSITIVE_INFINITY;do{t>0&&(e=o);for(let r of this._graph.getNodes()){if(r.getProperty(vu))continue;let i=this._computeNewPosition(r);r.getPosition().reset().add(i)}o=this._computeStress(),t++}while(!this._done(t,e,o))}_dijkstra(t,e){var i;let o=this._graph.getNodes().length,r=new Array(o).fill(!1);for(let s of this._graph.getNodes())e[s.id]=s.id===t.id?0:Number.POSITIVE_INFINITY;for(let s=0;s<o;s++){let a=null,l=Number.POSITIVE_INFINITY;for(let g of this._graph.getNodes())!r[g.id]&&e[g.id]<l&&(l=e[g.id],a=g);if(a==null)break;r[a.id]=!0;let c=(i=this._connectedEdges.get(a))!=null?i:[];for(let g of c){let h=n._getOther(g,a);if(r[h.id])continue;let d;g.hasProperty(Ua)?d=g.getProperty(Ua):d=this._desiredEdgeLength;let f=e[a.id]+d;f<e[h.id]&&(e[h.id]=f)}}}_done(t,e,o){return e===0||(e-o)/e<this._epsilon||t>=this._iterationLimit}_computeStress(){let t=0,e=this._graph.getNodes();for(let o=0;o<e.length;o++){let r=e[o];for(let i=o+1;i<e.length;i++){let s=e[i],l=r.getPosition().distance(s.getPosition())-this._apsp[r.id][s.id];t+=this._w[r.id][s.id]*l*l}}return t}_computeNewPosition(t){let e=0,o=0,r=0;for(let i of this._graph.getNodes()){if(t===i)continue;let s=this._w[t.id][i.id];e+=s;let a=t.getPosition().distance(i.getPosition());a>0&&this._dim!==eo.Y&&(o+=s*(i.getPosition().x+this._apsp[t.id][i.id]*(t.getPosition().x-i.getPosition().x)/a)),a>0&&this._dim!==eo.X&&(r+=s*(i.getPosition().y+this._apsp[t.id][i.id]*(t.getPosition().y-i.getPosition().y)/a))}switch(this._dim){case eo.X:return new O(o/e,t.getPosition().y);case eo.Y:return new O(t.getPosition().x,r/e);default:return new O(o/e,r/e)}}static _getOther(t,e){if(t.getSource()===e)return t.getTarget();if(t.getTarget()===e)return t.getSource();throw new Error("Node must be either source or target of edge.")}};var sc=class extends de{constructor(){super(),this._componentsProcessor=new en,this._stressMajorization=new ic}layout(t,e){if(e.begin("ELK Stress",1),t.getProperty(zo))t.getProperty(So)||Go.forGraph(t).execute();else{let s=typeof e.subTask=="function"?e.subTask(1):e;new rn().layout(t,s)}let o=new on,r=o.importGraph(t),i=this._componentsProcessor.split(r);for(let s of i)if(!(s.getNodes().length<=1)){this._stressMajorization.initialize(s),this._stressMajorization.execute();for(let a of s.getLabels())a.refreshPosition()}r=this._componentsProcessor.recombine(i),o.applyLayout(r),e.done()}};var mE="org.eclipse.elk.stress",PE=!1;function OE(){let n=Ht.getInstance(),t=n.getAlgorithmData(mE);if(t)return PE=!0,t;let e=new Se.Builder().id(mE).name("ELK Stress").description("Minimizes the stress within a layout using stress majorization.").category("org.eclipse.elk.force").definingBundleId("org.eclipse.elk.alg.force").providerFactory(()=>new sc).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),PE=!0,e}var qr=class extends ge{constructor(){super(),this._nodes=[],this._edges=[]}getEdges(){return this._edges}getNodes(){return this._nodes}toString(){let t=[];for(let e of this._nodes)t.push(e.toString());for(let e of this._edges)t.push(e.toString());return t.join(`
-`)}};var L=class{};L.ORIGIN=new m("origin");L.RANDOM=new m("random");L.DEPTH=new m("DEPTH",0);L.FAN=new m("FAN",0);L.DESCENDANTS=new m("DESCENDANTS",0);L.ROOT=new m("ROOT",!1);L.LEFTNEIGHBOR=new m("LEFTNEIGHBOR",null);L.RIGHTNEIGHBOR=new m("RIGHTNEIGHBOR",null);L.LEFTSIBLING=new m("LEFTSIBLING",null);L.RIGHTSIBLING=new m("RIGHTSIBLING",null);L.DUMMY=new m("DUMMY",!1);L.LEVEL=new m("LEVEL",0);L.REMOVABLE_EDGES=new m("REMOVABLE_EDGES",[]);L.XCOOR=new m("XCOOR",0);L.YCOOR=new m("YCOOR",0);L.LEVELHEIGHT=new m("LEVELHEIGHT",0);L.LEVELMIN=new m("LEVELMIN",0);L.LEVELMAX=new m("LEVELMAX",0);L.GRAPH_XMIN=new m("GRAPH_XMIN",0);L.GRAPH_YMIN=new m("GRAPH_YMIN",0);L.GRAPH_XMAX=new m("GRAPH_XMAX",0);L.GRAPH_YMAX=new m("GRAPH_YMAX",0);L.COMPACT_LEVEL_ASCENSION=new m("COMPACT_LEVEL_ASCENSION",!1);L.COMPACT_CONSTRAINTS=new m("COMPACT_CONSTRAINTS",[]);L.ID=new m("ID","");L.POSITION=new m("POSITION",0);L.PRELIM=new m("PRELIM",0);L.MODIFIER=new m("MODIFIER",0);L.BB_UPLEFT=new m("boundingBox.upLeft");L.BB_LOWRIGHT=new m("boundingBox.lowRight");var ur=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};ur.DFS=new ur("DFS");ur.BFS=new ur("BFS");var je=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};je.MODEL_ORDER=new je("MODEL_ORDER");je.DESCENDANTS=new je("DESCENDANTS");je.FAN=new je("FAN");je.CONSTRAINT=new je("CONSTRAINT");var ms=Object.freeze({NONE:"NONE",MIDDLE_TO_MIDDLE:"MIDDLE_TO_MIDDLE",AVOID_OVERLAP:"AVOID_OVERLAP",values(){return[this.NONE,this.MIDDLE_TO_MIDDLE,this.AVOID_OVERLAP]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var V=class{};V.ALGORITHM_ID="org.eclipse.elk.mrtree";V.SEARCH_ORDER=new m("org.eclipse.elk.mrtree.searchOrder",ur.DFS);V.DIRECTION=new m("org.eclipse.elk.direction",R.UNDEFINED);V.ASPECT_RATIO=new m("org.eclipse.elk.aspectRatio",1.6);V.PADDING=new m("org.eclipse.elk.padding",new yt(20));V.SEPARATE_CONNECTED_COMPONENTS=new m("org.eclipse.elk.separateConnectedComponents",!0);V.PRIORITY=new m("org.eclipse.elk.priority",1);V.SPACING_NODE_NODE=new m("org.eclipse.elk.spacing.nodeNode",20,0);V.SPACING_EDGE_NODE=new m("org.eclipse.elk.spacing.edgeNode",3,0);V.OMIT_NODE_MICRO_LAYOUT=So;V.RANDOM_SEED=Pu;V.WEIGHTING=new m("org.eclipse.elk.mrtree.weighting",je.MODEL_ORDER);V.DEBUG_MODE=new m("org.eclipse.elk.debugMode",!1);V.POSITION_CONSTRAINT=new m("org.eclipse.elk.mrtree.positionConstraint",-1);V.EDGE_ROUTING_MODE=new m("org.eclipse.elk.mrtree.edgeRoutingMode",ms.AVOID_OVERLAP);V.TREE_LEVEL=new m("org.eclipse.elk.mrtree.treeLevel",0);V.EDGE_END_TEXTURE_LENGTH=new m("org.eclipse.elk.mrtree.edgeEndTextureLength",7);V.COMPACTION=new m("org.eclipse.elk.mrtree.compaction",!1);var nc=class{constructor(){this._incidence=null,this._visited=null}_initialize(t){let e=t.getNodes().length;this._incidence=new Array(e),this._visited=new Array(e).fill(!1);for(let o of t.getNodes())this._incidence[o.id]=[];for(let o of t.getEdges())this._incidence[o.getSource().id].push(o),this._incidence[o.getTarget().id].push(o)}split(t){let e=t.getProperty(V.SEPARATE_CONNECTED_COMPONENTS);if(e==null||e===!0){this._initialize(t);let o=[];for(let r of t.getNodes()){let i=this._dfs(r,null);i!=null&&(i.copyProperties(t),o.push(i))}if(this._incidence=null,this._visited=null,o.length>1)for(let r of o){let i=0;for(let s of r.getNodes())s.id=i++}return o}return[t]}_dfs(t,e){if(!this._visited[t.id]){this._visited[t.id]=!0;let o=e!=null?e:new qr;o.getNodes().push(t);for(let r of this._incidence[t.id])r.getSource()!==t&&this._dfs(r.getSource(),o),r.getTarget()!==t&&this._dfs(r.getTarget(),o),r.getSource()===t&&o.getEdges().push(r);return o}return null}pack(t){var d,f;if(t.length===1)return this._applyPaddingAndNormalizePositions(t[0]),t[0];if(t.length<=0)return new qr;for(let E of t){let P=0,S=Number.POSITIVE_INFINITY,T=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(let C of E.getNodes())P+=(d=C.getProperty(V.PRIORITY))!=null?d:0,S=Math.min(S,C.getPosition().x),T=Math.min(T,C.getPosition().y),N=Math.max(N,C.getPosition().x+C.getSize().x),I=Math.max(I,C.getPosition().y+C.getSize().y);E.setProperty(V.PRIORITY,P),E.setProperty(L.BB_UPLEFT,new O(S,T)),E.setProperty(L.BB_LOWRIGHT,new O(N,I))}t.sort((E,P)=>{var T,N;let S=((T=P.getProperty(V.PRIORITY))!=null?T:0)-((N=E.getProperty(V.PRIORITY))!=null?N:0);if(S===0){let I=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT)),C=P.getProperty(L.BB_LOWRIGHT).clone().sub(P.getProperty(L.BB_UPLEFT));return I.x*I.y-C.x*C.y}return S});let e=new qr;e.copyProperties(t[0]);let o=0,r=0;for(let E of t){let P=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT));o=Math.max(o,P.x),r+=P.x*P.y}o=Math.max(o,Math.sqrt(r)*((f=e.getProperty(V.ASPECT_RATIO))!=null?f:1));let i=e.getProperty(V.SPACING_NODE_NODE),s=0,a=0,l=0,c=i;for(let E of t){let P=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT));s+P.x>o&&(s=0,a+=l+i,l=0),this._moveGraph(e,E,s,a),c=Math.max(c,s+P.x),l=Math.max(l,P.y),s+=P.x+i}let g=new Map,h=new Map;for(let E of t){let P=E.getProperty(Ks),S=E.getAllProperties();for(let[T,N]of S)g.has(T)?T.getDefault()!==N&&(P&&h.has(T)||(g.set(T,N),e.setProperty(T,N),P&&h.set(T,N))):(g.set(T,N),e.setProperty(T,N))}return rT(e),this._applyPaddingAndNormalizePositions(e),e}_applyPaddingAndNormalizePositions(t){let e=t.getProperty(V.PADDING);t.setProperty(L.BB_UPLEFT,new O(0,0)),this._moveGraph(new qr,t,e.getLeft()-t.getProperty(L.GRAPH_XMIN),e.getTop()-t.getProperty(L.GRAPH_YMIN))}_moveGraph(t,e,o,r){let i=new O(o,r);i.sub(e.getProperty(L.BB_UPLEFT));for(let a of e.getNodes())a.getPosition().add(i),t.getNodes().push(a);let s=new Set;for(let a of e.getEdges())if(!s.has(a)){s.add(a);for(let l of a.getBendPoints())l.add(i);t.getEdges().push(a)}}};function rT(n){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let i of n.getNodes()){let s=i.getPosition(),a=i.getSize();t=Math.min(t,s.x),e=Math.min(e,s.y),o=Math.max(o,s.x+a.x),r=Math.max(r,s.y+a.y)}n.getNodes().length===0&&(t=e=o=r=0),n.setProperty(L.GRAPH_XMIN,t),n.setProperty(L.GRAPH_YMIN,e),n.setProperty(L.GRAPH_XMAX,o),n.setProperty(L.GRAPH_YMAX,r)}var sn=class extends ge{constructor(t=0){super(),this.id=t}};var nn=class extends sn{constructor(t,e){super(),this._source=t,this._target=e,this._labels=[],this._bendPoints=new st}getSource(){return this._source}setSource(t){if(this._source!==t){if(this._source!=null){let e=this._source.getOutgoingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}t!=null&&!t.getOutgoingEdges().includes(this)&&t.getOutgoingEdges().push(this),this._source=t}}getTarget(){return this._target}setTarget(t){if(this._target!==t){if(this._target!=null){let e=this._target.getIncomingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}t!=null&&!t.getIncomingEdges().includes(this)&&t.getIncomingEdges().push(this),this._target=t}}getLabels(){return this._labels}getBendPoints(){return this._bendPoints}toString(){return this._source!=null&&this._target!=null?`${this._source}->${this._target}`:`e_${this.id}`}};var ac=class extends sn{constructor(t=0){super(t),this._pos=new O,this._size=new O}getPosition(){return this._pos}getSize(){return this._size}};var Ps=class extends ac{constructor(t,e,o){super(t),this._graph=e,this._label=o!=null?o:null,this._outgoingEdges=[],this._incomingEdges=[]}getLabel(){return this._label}setLabel(t){this._label=t}*getParents(){for(let t of this.getIncomingEdges())yield t.getSource()}getParent(){let t=this.getIncomingEdges();return t.length===0?null:t[0].getSource()}getChildrenCopy(){let t=[];for(let e of this.getOutgoingEdges())t.push(e.getTarget());return t}*getChildren(){for(let t of this.getOutgoingEdges())yield t.getTarget()}getOutgoingEdges(){return this._outgoingEdges==null&&(this._outgoingEdges=[]),this._outgoingEdges}getIncomingEdges(){return this._incomingEdges==null&&(this._incomingEdges=[]),this._incomingEdges}addChild(t){let e=new nn(this,t);e.setProperty(L.DUMMY,!0),this._graph.getEdges().push(e),this.getOutgoingEdges().push(e),t.getIncomingEdges().push(e)}isLeaf(){return this.getOutgoingEdges().length===0}toString(){return this._label==null||this._label.length===0?`n_${this.id}`:`n_${this._label}`}};var lc=class{importGraph(t){let e=new qr;e.copyProperties(t),e.setProperty(L.ORIGIN,t);let o=new Map;return this._transformNodes(t,e,o),this._transformEdges(t,e,o),e}_transformNodes(t,e,o){let r=0;for(let i of t.children){let s="";i.labels.length>0&&(s=i.labels[0].getText());let a=new Ps(r++,e,s);a.copyProperties(i),a.setProperty(L.ORIGIN,i),a.getPosition().y=i.getY()+i.getHeight()/2,a.getSize().x=Math.max(i.getWidth(),1),a.getPosition().x=i.getX()+i.getWidth()/2,a.getSize().y=Math.max(i.getHeight(),1),e.getNodes().push(a),o.set(i,a)}}_transformEdges(t,e,o){for(let r of t.children)for(let i of Ee(r))if(!i.isHierarchical()&&!i.isSelfloop()){let s=o.get(r),a=o.get(Pt(i.targets[0]));if(s!=null&&a!=null){let l=new nn(s,a);l.setProperty(L.ORIGIN,i),l.copyProperties(i),s.getOutgoingEdges().push(l),a.getIncomingEdges().push(l),e.getEdges().push(l)}}}applyLayout(t){let e=t.getProperty(L.ORIGIN),o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let g of t.getNodes()){let h=g.getPosition(),d=g.getSize();o=Math.min(o,h.x-d.x/2),r=Math.min(r,h.y-d.y/2),i=Math.max(i,h.x+d.x/2),s=Math.max(s,h.y+d.y/2)}let a=e.getProperty(V.PADDING);for(let g of t.getNodes()){let h=g.getProperty(L.ORIGIN);h!=null&&h.children!==void 0&&(h.setLocation(g.getPosition().x,g.getPosition().y),h.copyProperties(g))}for(let g of t.getEdges()){let h=g.getProperty(L.ORIGIN);if(h!=null){let d=g.getBendPoints(),f=ar(h,!0,!0);Xs(d,f)}}let l=i-o+a.getHorizontal(),c=s-r+a.getVertical();e.getProperty(To)||Ae(e,l,c,!1,!1),e.setProperty(pi,l-a.getHorizontal()),e.setProperty(Ei,c-a.getVertical())}static _toNodeBorder(t,e,o){let r=o.x/2,i=o.y/2,s=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y),l=1,c=1;s>r&&(l=r/s),a>i&&(c=i/a);let g=Math.min(l,c);t.x+=g*(e.x-t.x),t.y+=g*(e.y-t.y)}};var an=class{constructor(){this._list=[]}provideDefault(){throw new Error(`${this.constructor.name}.provideDefault() is not implemented`)}getListItem(t){if(t<0)throw new RangeError(`Invalid index: ${t}`);return this._ensureListSize(t+1),this._list[t]}setListItem(t,e){if(t<0)throw new RangeError(`Invalid index: ${t}`);t<this._list.length?this._list[t]=e:(this._ensureListSize(t),this._list.push(e))}getListSize(){return this._list.length}clearList(){this._list.length=0}_ensureListSize(t){for(;this._list.length<t;)this._list.push(this.provideDefault())}};var cc=class{compare(t,e){return t.ordinal-e.ordinal}};var K=class n extends an{constructor(){super(),this._currentIndex=-1}static create(){return new n}static createFrom(t){return new n().addAll(t)}clear(){return this.clearList(),this._currentIndex=-1,this}before(t){return this._currentIndex=t.ordinal,this}after(t){return this._currentIndex=t.ordinal+1,this}add(t){if(this._currentIndex<0)throw new Error("Did not call before(...) or after(...) before calling add(...).");return this._doAdd(this._currentIndex,t),this}addBefore(t,e){return this._currentIndex=-1,this._doAdd(t.ordinal,e),this}addAfter(t,e){return this._currentIndex=-1,this._doAdd(t.ordinal+1,e),this}_doAdd(t,e){this.getListItem(t).add(e)}addAll(t){for(let e=0;e<t.getListSize();e++){let o=this.getListItem(e);for(let r of t.getListItem(e))o.add(r)}return this}processorsBefore(t){return this._processors(t.ordinal)}processorsAfter(t){return this._processors(t.ordinal+1)}_processors(t){return new Set(this.getListItem(t))}provideDefault(){return new Set}};var Io=class n extends an{static create(t){return new n(t)}constructor(t){if(super(),!t||t.length===0)throw new Error("There must be at least one phase in the phase enumeration.");this._phaseEnumConstants=t,this._numberOfPhases=t.length,this._enableCaching=!0,this._failOnMissingPhase=!0,this._processorComparator=new cc,this._configuredPhases=new Set,this._additionalProcessors=K.create(),this._cache=new Map}withCaching(t){return this._enableCaching=t,this}withFailOnMissingPhase(t){return this._failOnMissingPhase=t,this}withProcessorComparator(t){return this._processorComparator=t,this}clearCache(){return this._cache.clear(),this}reset(){return this.clearList(),this._configuredPhases.clear(),this._additionalProcessors.clear(),this}setPhase(t,e){return this.setListItem(t.ordinal,e),this._configuredPhases.add(t),this}addProcessorConfiguration(t){return this._additionalProcessors.addAll(t),this}build(t){if(this._failOnMissingPhase&&this._configuredPhases.size<this._numberOfPhases)throw new Error(`Expected ${this._numberOfPhases} phases to be configured; only found ${this._configuredPhases.size}`);let e=this._phaseEnumConstants,o=[];for(let a of e){let l=this.getListItem(a.ordinal);o.push(l!=null?this._retrievePhase(l):null)}let r=K.create();for(let a of o){if(a==null)continue;let l=a.getLayoutProcessorConfiguration(t);l!=null&&r.addAll(l)}r.addAll(this._additionalProcessors);let i=[];for(let a of e){for(let c of this._retrieveProcessors(r.processorsBefore(a)))i.push(c);let l=o[a.ordinal];l!=null&&i.push(l)}let s=e[e.length-1];for(let a of this._retrieveProcessors(r.processorsAfter(s)))i.push(a);return i}provideDefault(){return null}_retrieveProcessors(t){return[...t].sort((o,r)=>this._processorComparator.compare(o,r)).map(o=>this._retrieveProcessor(o))}_retrievePhase(t){return this._retrieveProcessor(t)}_retrieveProcessor(t){if(this._enableCaching){if(this._cache.has(t))return this._cache.get(t);let e=t.create();return this._cache.set(t,e),e}return t.create()}};var Ie=class n{constructor(t=-1){this._parentMonitor=null,this._children=[],this._maxLevels=t<0?-1:t,this._taskName=null,this._closed=!1,this._totalWork=0,this._completedWork=0,this._currentChildWork=-1,this._recordLogs=!1,this._logMessages=null,this._recordExecutionTime=!1,this._startTime=0,this._totalTime=0}withMaxHierarchyLevels(t){return this._maxLevels=t<0?-1:t,this}withLogging(t){return this._recordLogs=t,this._logMessages=t?[]:null,this}withLogPersistence(t){return this}withExecutionTimeMeasurement(t){return this._recordExecutionTime=t,this}begin(t,e){if(this._closed)throw new Error("The task is already done.");if(this._taskName!==null)return!1;if(t==null)throw new Error("Task name must not be null.");return this._taskName=t,this._totalWork=e,this._doBegin(t,e,this._parentMonitor===null,this._maxLevels),this._recordExecutionTime&&(this._startTime=performance.now()),!0}_doBegin(t,e,o,r){}worked(t){t>0&&!this._closed&&this._internalWorked(t)}_internalWorked(t){this._totalWork>0&&this._completedWork<this._totalWork&&(this._completedWork+=t,this._doWorked(this._completedWork,this._totalWork,this._parentMonitor===null),this._parentMonitor!==null&&this._parentMonitor._currentChildWork>0&&this._maxLevels!==0&&this._parentMonitor._internalWorked(t/this._totalWork*this._parentMonitor._currentChildWork))}_doWorked(t,e,o){}done(){if(this._taskName===null)throw new Error("The task has not begun yet.");this._closed||(this._recordExecutionTime&&(this._totalTime=(performance.now()-this._startTime)/1e3),this._completedWork<this._totalWork&&this._internalWorked(this._totalWork-this._completedWork),this._doDone(this._parentMonitor===null,this._maxLevels),this._closed=!0)}_doDone(t,e){}isRunning(){return this._taskName!==null&&!this._closed}isCanceled(){return!1}getTaskName(){return this._taskName}subTask(t){if(!this._closed){let e=this._doSubTask(t,this._maxLevels);return this._children.push(e),e._parentMonitor=this,this._currentChildWork=t,e}return null}_doSubTask(t,e){let o=e>0?e-1:e;return new n().withMaxHierarchyLevels(o).withLogging(this._recordLogs).withExecutionTimeMeasurement(this._recordExecutionTime)}getSubMonitors(){return this._children}getParentMonitor(){return this._parentMonitor}isLoggingEnabled(){return this._recordLogs}isLogPersistenceEnabled(){return!1}log(t){this._recordLogs&&t!==null&&t!==void 0&&this._logMessages.push(String(t))}getLogs(){return this._logMessages}logGraph(t,e,o){}getLoggedGraphs(){return null}isExecutionTimeMeasured(){return this._recordExecutionTime}getExecutionTime(){return this._totalTime}};var gc=class{constructor(){this._roots=[]}process(t,e){e.begin("Find roots",1),this._roots.length=0;for(let o of t.getNodes())o.getIncomingEdges().length===0&&(o.setProperty(L.ROOT,!0),this._roots.push(o));switch(this._roots.length){case 0:{let o=new Ps(0,t,"DUMMY_ROOT");o.setProperty(L.ROOT,!0),o.setProperty(L.DUMMY,!0),t.getNodes().push(o);break}case 1:break;default:{let o=new Ps(0,t,"SUPER_ROOT");for(let r of this._roots)o.addChild(r),r.setProperty(L.ROOT,!1);o.setProperty(L.ROOT,!0),o.setProperty(L.DUMMY,!0),t.getNodes().push(o);break}}e.done()}};var hc=class n{constructor(){this._gloFanMap=new Map,this._gloDescMap=new Map}process(t,e){var r,i;e.begin("Processor compute fanout",1),this._gloFanMap.clear(),this._gloDescMap.clear();let o=null;for(let s of t.getNodes())if(s.getProperty(L.ROOT)){o=s;break}if(o==null){e.done();return}this._calculateFan([o]);for(let s of t.getNodes()){let a=s.getProperty(L.ID),l=(r=this._gloFanMap.get(a))!=null?r:0;s.setProperty(L.FAN,l);let c=1+((i=this._gloDescMap.get(a))!=null?i:0);s.setProperty(L.DESCENDANTS,c)}e.done()}_calculateFan(t){var e,o;if(t.length>0){let r=[],i=null,s=null,a=Math.floor(Math.log10(t.length))+1,l=0;for(let g of t){s!==g.getProperty(L.ID)&&(s=g.getProperty(L.ID),l=0),s!=null?i=s+n.formatRight(l++,a):i=n.formatRight(l++,a),g.setProperty(L.ID,i);for(let h of g.getChildren())r.push(h),h.setProperty(L.ID,i)}let c=new Map;for(let g=0;g<(i!=null?i:"").length-a;g++)for(let h of t){let d=h.getProperty(L.ID).substring(0,g+1),f=((e=c.get(d))!=null?e:0)+1;c.set(d,f)}for(let[g,h]of c){let d=(o=this._gloDescMap.get(g))!=null?o:0;this._gloDescMap.set(g,h+d);let f=this._gloFanMap.get(g);(f==null||f<h)&&this._gloFanMap.set(g,h)}this._calculateFan(r)}}static formatRight(t,e){let o=`${t}`;for(;o.length<e;)o=`0${o}`;return o}};var dc=class{constructor(){this._gloLevelMap=new Map}process(t,e){var r;e.begin("Processor compute fanout",1);let o=t.getNodes().filter(i=>i.getProperty(L.ROOT));this._setLevel(o,0);for(let i of t.getNodes()){let s=(r=this._gloLevelMap.get(i.id))!=null?r:0;i.setProperty(V.TREE_LEVEL,s)}e.done()}_setLevel(t,e){if(t.length>0){let o=[];for(let r of t){this._gloLevelMap.set(r.id,e);for(let i of r.getChildren())o.push(i)}this._setLevel(o,e+1)}}};var fc=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor set neighbors",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let r of t.getNodes())if(r.getProperty(L.ROOT)){o=r;break}o!=null&&this._setNeighbors([...o.getChildren()],e),e.done()}_setNeighbors(t,e){if(t.length>0){let o=typeof e.subTask=="function"?e.subTask(t.length/this._numberOfNodes):e;o.begin("Set neighbors in level",1);let r=[],i=null;for(let s of t){for(let a of s.getChildren())r.push(a);i!=null&&(i.setProperty(L.RIGHTNEIGHBOR,s),s.setProperty(L.LEFTNEIGHBOR,i),s.getParent()===i.getParent()&&(i.setProperty(L.RIGHTSIBLING,s),s.setProperty(L.LEFTSIBLING,i))),i=s}o.done(),this._setNeighbors(r,e)}}};var uc=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor determine the height for each level",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let r of t.getNodes())if(r.getProperty(L.ROOT)){o=r;break}o!=null&&this._setLevelHeight([o],e,t.getProperty(V.DIRECTION)),e.done()}_setLevelHeight(t,e,o){if(t.length>0){let r=typeof e.subTask=="function"?e.subTask(t.length/this._numberOfNodes):e;r.begin("Set neighbors in level",1);let i=[],s=0;if(o.isHorizontal())for(let a of t){for(let l of a.getChildren())i.push(l);s<a.getSize().x&&(s=a.getSize().x)}else for(let a of t){for(let l of a.getChildren())i.push(l);s<a.getSize().y&&(s=a.getSize().y)}for(let a of t)a.setProperty(L.LEVELHEIGHT,s);r.done(),this._setLevelHeight(i,e,o)}}};var _c=class{process(t,e){e.begin("Processor determine the coords for each level",1);let o=[],r=t.getProperty(V.DIRECTION).isHorizontal();for(let i of t.getNodes()){let s=i.getProperty(V.TREE_LEVEL);for(;s>o.length-1;)o.push(new Gt(Number.MAX_VALUE,-Number.MAX_VALUE));let a=o[s];r?(i.getPosition().x<a.getFirst()&&a.setFirst(i.getPosition().x),i.getPosition().x+i.getSize().x>a.getSecond()&&a.setSecond(i.getPosition().x+i.getSize().x)):(i.getPosition().y<a.getFirst()&&a.setFirst(i.getPosition().y),i.getPosition().y+i.getSize().y>a.getSecond()&&a.setSecond(i.getPosition().y+i.getSize().y))}for(let i of t.getNodes()){let s=i.getProperty(V.TREE_LEVEL);i.setProperty(L.LEVELMIN,o[s].getFirst()),i.setProperty(L.LEVELMAX,o[s].getSecond())}e.done()}};var pc=class{process(t,e){e.begin("Process directions",1);let o=t.getProperty(V.DIRECTION);if(o!==R.DOWN)for(let r of t.getNodes()){let i=r.getProperty(L.XCOOR),s=r.getProperty(L.YCOOR);switch(o){case R.UP:s=-s;break;case R.RIGHT:{let a=i;i=s,s=a;break}case R.LEFT:{let a=i;i=-s,s=a;break}}r.setProperty(L.XCOOR,i),r.setProperty(L.YCOOR,s)}e.done()}};var Ec=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor set coordinates",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let s of t.getNodes())if(s.getProperty(L.ROOT)){o=s;let a=s.getPosition();a.x=s.getProperty(L.XCOOR),a.y=s.getProperty(L.YCOOR);break}if(o==null){e.done();return}let r=o.getChildrenCopy(),i=1;do{let s=typeof e.subTask=="function"?e.subTask(i):e;r=this._setCoordinates(r,s),i=r.length/this._numberOfNodes}while(r.length>0);for(let s of t.getNodes())s.getPosition().sub(new O(s.getSize().x/2,s.getSize().y/2));e.done()}_setCoordinates(t,e){if(t.length>0){let o=[];for(let r of t){for(let s of r.getChildrenCopy())o.push(s);let i=r.getPosition();i.x=r.getProperty(L.XCOOR),i.y=r.getProperty(L.YCOOR)}return o}return[]}};var Ro=class n{static getRoot(t){for(let e of t.getNodes())if(e.getProperty(L.ROOT))return e;throw new Error("No root found in tree graph.")}static depth(t){let e=n.getChildren(t);if(e.length===0)return 1;let o=0;for(let r of e)o=Math.max(o,n.depth(r));return o+1}static getChildren(t){let e=new Set,o=[];for(let r of t.getOutgoingEdges()){let i=r.getTarget();e.has(i)||(e.add(i),o.push(i))}return o}static getLeftMost(t,e=-1){let o=[...t];if(o.length>0){let r=e;if(r>1){r--;let i=[];for(let s of o)for(let a of s.getChildren())i.push(a);return n.getLeftMost(i,r)}if(r<0){let i=[];for(let s of o)for(let a of s.getChildren())i.push(a);if(i.length>0)return n.getLeftMost(i,r)}}return o.length>0?o[0]:null}static getDirection(t){return t.getProperty(V.DIRECTION)}static getDirectionVector(t){return t===R.UP?new O(0,-1):t===R.RIGHT?new O(1,0):t===R.LEFT?new O(-1,0):new O(0,1)}static getLowestParent(t,e){let o=n.getDirectionVector(n.getDirection(e)),r=t.getIncomingEdges();if(r.length===0)return null;let i=new Set;for(let g of r)i.add(g.getSource());let s=e.getNodes().filter(g=>i.has(g));if(s.length===0)return null;let a=g=>new O(g.getPosition().x+g.getSize().x/2,g.getPosition().y+g.getSize().y/2).dotProduct(o),l=s[0],c=a(s[0]);for(let g=1;g<s.length;g++){let h=a(s[g]);h>c&&(l=s[g],c=h)}return l}static getFirstPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getTarget().getPosition().x,t.getTarget().getPosition().y):e.getFirst()}static getLastPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getSource().getPosition().x,t.getSource().getPosition().y):e.getLast()}static isCycleInducing(t,e){let o=n.getDirectionVector(n.getDirection(e)),r=t.getTarget().getPosition().x-t.getSource().getPosition().x,i=t.getTarget().getPosition().y-t.getSource().getPosition().y;return o.x*r+o.y*i<=0}static getAllOutgoingEdges(t,e){let o=[];for(let r of e.getEdges())r.getSource()===t&&o.push(r);return o}static getAllIncomingEdges(t,e){let o=[];for(let r of e.getEdges())r.getTarget()===t&&o.push(r);return o}static getUniqueLong(t,e){return t+","+e}static toNodeBorder(t,e,o){let r=o.x/2,i=o.y/2,s=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y),l=1,c=1;s>r&&(l=r/s),a>i&&(c=i/a);let g=Math.min(l,c);t.x+=g*(e.x-t.x),t.y+=g*(e.y-t.y)}};var Os=class n{constructor(t,e,o){this._first=t,this._second=e,this._third=o}getFirst(){return this._first}getSecond(){return this._second}getThird(){return this._third}equals(t){return t instanceof n?ku(this._first,t._first)&&ku(this._second,t._second)&&ku(this._third,t._third):!1}toString(){return`(${this._first}, ${this._second}, ${this._third})`}};function ku(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):!1}var mc=class{constructor(){this._levels=[]}process(t,e){if(e.begin("Process compaction",1),!t.getProperty(V.COMPACTION)){e.done();return}let o=t.getProperty(V.DIRECTION),r=t.getProperty(V.SPACING_NODE_NODE);this._setUpLevels(t,o),this._computeNodeConstraints(t,r/2/2);let i=Ro.getDirectionVector(o),s=[...t.getNodes()].sort((a,l)=>{let c=i.dotProduct(new O(a.getPosition().x,a.getPosition().y)),g=i.dotProduct(new O(l.getPosition().x,l.getPosition().y));return c-g});for(let a of s){if(a.getProperty(L.ROOT))continue;let l=this._getLowestDependentNode(a,o),c=Ro.getLowestParent(a,t),g=0,h=0;if(l!=null){let d=l.getPosition();switch(o){case R.LEFT:g=d.x-r-a.getSize().x,c.getPosition().x-r-a.getSize().x<g&&(g=c.getPosition().x-r-a.getSize().x),h=g+a.getSize().x;break;case R.RIGHT:g=d.x+l.getSize().x+r,c.getPosition().x+r>g&&(g=c.getPosition().x+c.getSize().x+r),h=g+a.getSize().x;break;case R.UP:g=d.y-r-a.getSize().y,c.getPosition().y-r-a.getSize().y<g&&(g=c.getPosition().y-r-a.getSize().y),h=g+a.getSize().y;break;case R.DOWN:g=d.y+l.getSize().y+r,c.getPosition().y+r>g&&(g=c.getPosition().y+c.getSize().y+r),h=g+a.getSize().y;break}}else if(c!=null)switch(o){case R.LEFT:g=c.getPosition().x-r-a.getSize().x,h=g+a.getSize().x;break;case R.RIGHT:g=c.getPosition().x+c.getSize().x+r,h=g+a.getSize().x;break;case R.UP:g=c.getPosition().y-r-a.getSize().y,h=g+a.getSize().y;break;case R.DOWN:g=c.getPosition().y+c.getSize().y+r,h=g+a.getSize().y;break}if(t.getProperty(V.EDGE_ROUTING_MODE)===ms.AVOID_OVERLAP){let d=this._levels.find(f=>f.getFirst()<=g&&f.getSecond()>=h);if(d!=null)o.isHorizontal()?a.getPosition().x=g:a.getPosition().y=g;else{let f=this._levels.slice(1);o===R.LEFT||o===R.UP?d=f.find(E=>E.getFirst()<=g):d=f.find(E=>E.getFirst()>=g),d!=null&&(o.isHorizontal()?a.getPosition().x=d.getFirst():a.getPosition().y=d.getFirst())}if(d!=null){let f=this._levels.indexOf(d);f>0&&f!==a.getProperty(V.TREE_LEVEL)&&(a.setProperty(L.COMPACT_LEVEL_ASCENSION,!0),a.setProperty(V.TREE_LEVEL,f))}}else o.isHorizontal()?a.getPosition().x=g:a.getPosition().y=g}e.done()}_setUpLevels(t,e){this._levels=[];for(let o of t.getNodes()){for(;o.getProperty(V.TREE_LEVEL)>this._levels.length-1;)this._levels.push(new Gt(Number.MAX_VALUE,-Number.MAX_VALUE));let r=o.getProperty(V.TREE_LEVEL),i=this._levels[r];e.isHorizontal()?(o.getPosition().x<i.getFirst()&&i.setFirst(o.getPosition().x),o.getPosition().x+o.getSize().x>i.getSecond()&&i.setSecond(o.getPosition().x+o.getSize().x)):(o.getPosition().y<i.getFirst()&&i.setFirst(o.getPosition().y),o.getPosition().y+o.getSize().y>i.getSecond()&&i.setSecond(o.getPosition().y+o.getSize().y))}}_computeNodeConstraints(t,e){let o=t.getProperty(V.DIRECTION),r=o.isHorizontal()?R.DOWN:R.RIGHT,i=Ro.getDirectionVector(o),s=Ro.getDirectionVector(r),a=t.getNodes().filter(h=>{let d=typeof h.getLabel=="function"?h.getLabel():"";return!(d!=null&&d.includes("SUPER_ROOT"))}),l=[];for(let h of a){let d=h.getPosition().clone();d.sub(e,e),l.push(new Os(h,d,!0))}for(let h of a){let d=h.getPosition().clone();d.add(h.getSize().x+e,h.getSize().y+e),l.push(new Os(h,d,!1))}l.sort((h,d)=>s.dotProduct(h.getSecond().clone())-s.dotProduct(d.getSecond().clone()));let c=new Wu((h,d)=>i.dotProduct(h.getPosition().clone())-i.dotProduct(d.getPosition().clone())),g=new Map;for(let h of l){let d=h.getFirst();if(h.getThird()){c.add(d);let f=c.headSet(d);f.length>0&&g.set(d,f[f.length-1]),c.tailSet(d).length>1&&g.set(this._getRightElement(c,d),d)}else{let f=c.headSet(d);if(f.length>0){let P=f[f.length-1];P===g.get(d)&&d.getProperty(L.COMPACT_CONSTRAINTS).push(P)}if(c.tailSet(d).length>1){let P=this._getRightElement(c,d);g.get(P)===d&&P.getProperty(L.COMPACT_CONSTRAINTS).push(d)}c.remove(d)}}}_getRightElement(t,e){let o=t.tailSet(e);if(o.length<=1)throw new Error("NullPointerException: no right element");return o[1]}_getLowestDependentNode(t,e){let o=t.getProperty(L.COMPACT_CONSTRAINTS);if(o==null||o.length<1)return null;if(o.length===1)return o[0];let r=o[0];switch(e){case R.LEFT:for(let i of o)i.getPosition().x<r.getPosition().x&&(r=i);break;case R.RIGHT:for(let i of o)i.getPosition().x+i.getSize().x>r.getPosition().x+r.getSize().x&&(r=i);break;case R.UP:for(let i of o)i.getPosition().y<r.getPosition().y&&(r=i);break;case R.DOWN:for(let i of o)i.getPosition().y+i.getSize().y>r.getPosition().y+r.getSize().y&&(r=i);break}return r}},Wu=class{constructor(t){this._compare=t,this._items=[]}add(t){this._items.push(t),this._items.sort(this._compare)}remove(t){let e=this._items.indexOf(t);e>=0&&this._items.splice(e,1)}headSet(t){let e=this._items.indexOf(t);if(e<0){let o=0;for(;o<this._items.length&&this._compare(this._items[o],t)<0;)o++;return this._items.slice(0,o)}return this._items.slice(0,e)}tailSet(t){let e=this._items.indexOf(t);if(e<0){let o=0;for(;o<this._items.length&&this._compare(this._items[o],t)<0;)o++;return this._items.slice(o)}return this._items.slice(e)}};var Pc=class{process(t,e){e.begin("Process graph bounds",1);let o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let a of t.getNodes()){let l=a.getPosition(),c=a.getSize();l.x<o&&(o=l.x),l.y<r&&(r=l.y),l.x+c.x>i&&(i=l.x+c.x),l.y+c.y>s&&(s=l.y+c.y)}t.setProperty(L.GRAPH_XMIN,o),t.setProperty(L.GRAPH_YMIN,r),t.setProperty(L.GRAPH_XMAX,i),t.setProperty(L.GRAPH_YMAX,s),e.done()}};var Oc=class{process(t,e){e.begin("Untreeify",1);let o=t.getProperty(L.REMOVABLE_EDGES);for(let r of o)r.getSource().getOutgoingEdges().push(r),r.getTarget().getIncomingEdges().push(r);e.done()}};var pt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.ROOT_PROC:return new gc;case n.FAN_PROC:return new hc;case n.LEVEL_PROC:return new dc;case n.NEIGHBORS_PROC:return new fc;case n.LEVEL_HEIGHT:return new uc;case n.LEVEL_COORDS:return new _c;case n.DIRECTION_PROC:return new pc;case n.NODE_POSITION_PROC:return new Ec;case n.COMPACTION_PROC:return new mc;case n.GRAPH_BOUNDS_PROC:return new Pc;case n.DETREEIFYING_PROC:return new Oc;default:throw new Error(`No implementation available for processor ${this}`)}}};pt.ROOT_PROC=new pt("ROOT_PROC",0);pt.FAN_PROC=new pt("FAN_PROC",1);pt.LEVEL_PROC=new pt("LEVEL_PROC",2);pt.NEIGHBORS_PROC=new pt("NEIGHBORS_PROC",3);pt.LEVEL_HEIGHT=new pt("LEVEL_HEIGHT",4);pt.DIRECTION_PROC=new pt("DIRECTION_PROC",5);pt.NODE_POSITION_PROC=new pt("NODE_POSITION_PROC",6);pt.COMPACTION_PROC=new pt("COMPACTION_PROC",7);pt.LEVEL_COORDS=new pt("LEVEL_COORDS",8);pt.GRAPH_BOUNDS_PROC=new pt("GRAPH_BOUNDS_PROC",9);pt.DETREEIFYING_PROC=new pt("DETREEIFYING_PROC",10);pt.VALUES=[pt.ROOT_PROC,pt.FAN_PROC,pt.LEVEL_PROC,pt.NEIGHBORS_PROC,pt.LEVEL_HEIGHT,pt.DIRECTION_PROC,pt.NODE_POSITION_PROC,pt.COMPACTION_PROC,pt.LEVEL_COORDS,pt.GRAPH_BOUNDS_PROC,pt.DETREEIFYING_PROC];var Sc=class{constructor(){this._visited=null,this._eliminated=null}process(t,e){e.begin("DFS Treeifying phase",1),this._init(t),this._collectEdges(t),this._eliminated=null,this._visited=null,e.done()}getLayoutProcessorConfiguration(){return K.create().addAfter(Mt.P3_NODE_PLACEMENT,pt.DETREEIFYING_PROC)}_init(t){let e=t.getNodes().length;this._eliminated=[],this._visited=new Array(e).fill(0);let o=0;for(let r of t.getNodes())r.id=o++}_collectEdges(t){let e=t.getProperty(V.SEARCH_ORDER);for(let o of t.getNodes())if(this._visited[o.id]===0){switch(e){case ur.DFS:this._dfs(o);break;case ur.BFS:this._bfs(o);break}this._visited[o.id]=2}for(let o of this._eliminated)SE(o.getSource().getOutgoingEdges(),o),SE(o.getTarget().getIncomingEdges(),o);t.setProperty(L.REMOVABLE_EDGES,this._eliminated)}_dfs(t){this._visited[t.id]=1;for(let e of t.getOutgoingEdges()){let o=e.getTarget();this._visited[o.id]===1?this._eliminated.push(e):this._visited[o.id]===2?this._visited[o.id]=1:this._dfs(o)}}_bfs(t){let e=[t];for(;e.length>0;){let o=e.shift();this._visited[o.id]=1;for(let r of o.getOutgoingEdges()){let i=r.getTarget();this._visited[i.id]===1?this._eliminated.push(r):this._visited[i.id]===2?this._visited[i.id]=1:e.push(i)}}}};function SE(n,t){let e=n.indexOf(t);e>=0&&n.splice(e,1)}function TE(n){return(t,e)=>{var o,r;return((o=t.getProperty(n))!=null?o:0)-((r=e.getProperty(n))!=null?r:0)}}var Tc=class{constructor(){this._weighting=null,this._debug=!1}getLayoutProcessorConfiguration(){return K.create().before(Mt.P2_NODE_ORDERING).add(pt.ROOT_PROC).add(pt.FAN_PROC).add(pt.LEVEL_PROC)}process(t,e){var i;e.begin("Processor arrange node",1),this._debug=t.getProperty(V.DEBUG_MODE),this._debug&&((i=e.log)==null||i.call(e,"NodeOrderer!"));let o=t.getNodes().find(s=>s.getProperty(L.ROOT));if(o==null){e.done();return}this._weighting=t.getProperty(V.WEIGHTING);let r=typeof e.subTask=="function"?e.subTask(1):e;this._weighting===je.FAN||this._weighting===je.DESCENDANTS?this._orderLevelFanDescendants([o],r):this._weighting===je.CONSTRAINT&&this._orderLevelConstraint([o],r),e.done()}_orderLevelFanDescendants(t,e){var g,h;e.begin("Processor arrange level",1);let o=L.FAN;this._weighting===je.DESCENDANTS&&(o=L.DESCENDANTS);let r=0;t.sort(TE(o));let i=t.length,s=!0,a=t.length-1;for(;s&&a>=0;)((g=t[a].getProperty(o))!=null?g:0)===0?i--:s=!1,a--;let l=t.slice(0,i),c=t.slice(i);if(l.length===0)for(let d of c)d.setProperty(L.POSITION,r++);else{let d=l.length;for(let f of l){f.setProperty(L.POSITION,r++);let E=f.getChildrenCopy(),P=typeof e.subTask=="function"?e.subTask(1/d):e;this._orderLevelFanDescendants(E,P),E.sort((I,C)=>{var x,M;return((x=C.getProperty(L.POSITION))!=null?x:0)-((M=I.getProperty(L.POSITION))!=null?M:0)});let S=[];for(let I of E)for(let C of f.getOutgoingEdges())C.getTarget()===I&&S.push(C);f.getOutgoingEdges().length=0;for(let I of S)f.getOutgoingEdges().push(I);let T=f.getOutgoingEdges().length,N=c.length-1;for(s=!0;T>0&&s&&N>=0;){let I=c[N];((h=I.getProperty(o))!=null?h:0)===0?(I.setProperty(L.POSITION,r++),T--,c.splice(N,1)):s=!1,N--}}}e.done()}_orderLevelConstraint(t,e){var l;e.begin("Processor arrange level",1),this._debug&&((l=e.log)==null||l.call(e,"OrderLevelConstraint!"));let o=t.filter(c=>{var g;return((g=c.getProperty(V.POSITION_CONSTRAINT))!=null?g:-1)<0}),r=t.filter(c=>{var h;let g=(h=c.getProperty(V.POSITION_CONSTRAINT))!=null?h:-1;return g<t.length&&g>=0}),i=t.filter(c=>{var g;return((g=c.getProperty(V.POSITION_CONSTRAINT))!=null?g:-1)>=t.length}),s=new Array(t.length).fill(null);for(let c=0;c<r.length;c++){let g=r[c],h=g.getProperty(V.POSITION_CONSTRAINT);h>=0&&h<r.length&&s[h]==null&&(s[h]=g,r.splice(c,1),c--)}for(let c=0;c<r.length;c++){let g=r[c],h=g.getProperty(V.POSITION_CONSTRAINT);for(let d=0;;d++){let f=h+d;if(f<s.length&&f>=0&&s[f]==null){s[f]=g,r.splice(c,1),c--;break}if(f=h-d,f<s.length&&f>=0&&s[f]==null){s[f]=g,r.splice(c,1),c--;break}}}i.sort((c,g)=>{var h,d;return-(((h=c.getProperty(V.POSITION_CONSTRAINT))!=null?h:0)-((d=g.getProperty(V.POSITION_CONSTRAINT))!=null?d:0))});for(let c=s.length-1;c>=0;c--)s[c]==null&&i.length>0&&(s[c]=i[0],i.splice(0,1));for(let c=0;c<s.length;c++)s[c]==null&&o.length>0&&(s[c]=o[0],o.splice(0,1));for(let c=0;c<s.length;c++)s[c].setProperty(L.POSITION,c);let a=t.filter(c=>{var g;return((g=c.getProperty(L.FAN))!=null?g:0)!==0});for(let c of a){let g=c.getChildrenCopy(),h=typeof e.subTask=="function"?e.subTask(1/a.length):e;this._orderLevelConstraint(g,h),g.sort(TE(L.POSITION));let d=[];for(let f of g)for(let E of c.getOutgoingEdges())E.getTarget()===f&&d.push(E);c.getOutgoingEdges().length=0;for(let f of d)c.getOutgoingEdges().push(f)}e.done()}};var Nc=class{constructor(){this._spacing=0,this._xTopAdjustment=0,this._yTopAdjustment=0,this._direction=R.UNDEFINED}getLayoutProcessorConfiguration(){return K.create().addBefore(Mt.P2_NODE_ORDERING,pt.ROOT_PROC).before(Mt.P3_NODE_PLACEMENT).add(pt.LEVEL_HEIGHT).add(pt.NEIGHBORS_PROC).before(Mt.P4_EDGE_ROUTING).add(pt.DIRECTION_PROC).add(pt.NODE_POSITION_PROC)}process(t,e){e.begin("Processor order nodes",2),this._spacing=t.getProperty(V.SPACING_NODE_NODE),this._direction=t.getProperty(V.DIRECTION),this._direction===R.UNDEFINED&&(this._direction=R.DOWN,t.setProperty(V.DIRECTION,this._direction));let o=[];for(let i of t.getNodes())i.getProperty(L.ROOT)&&o.push(i);let r=o[0];this._firstWalk(r,0),e.worked(1),this._secondWalk(r,this._yTopAdjustment-r.getProperty(L.LEVELHEIGHT)/2,this._xTopAdjustment),e.worked(1),e.done()}_firstWalk(t,e){var r;t.setProperty(L.MODIFIER,0);let o=t.getProperty(L.LEFTSIBLING);if(t.isLeaf())if(o!=null){let i=o.getProperty(L.PRELIM)+this._spacing+this._meanNodeWidth(o,t);t.setProperty(L.PRELIM,i)}else t.setProperty(L.PRELIM,0);else{for(let c of t.getChildren())this._firstWalk(c,e+1);let i=t.getChildrenCopy(),s=(r=i[0])!=null?r:null,l=((i.length>0?i[i.length-1]:null).getProperty(L.PRELIM)+s.getProperty(L.PRELIM))/2;if(o!=null){let c=o.getProperty(L.PRELIM)+this._spacing+this._meanNodeWidth(o,t);t.setProperty(L.PRELIM,c),t.setProperty(L.MODIFIER,t.getProperty(L.PRELIM)-l),this._apportion(t,e)}else t.setProperty(L.PRELIM,l)}}_apportion(t,e){var a,l;let r=(a=t.getChildrenCopy()[0])!=null?a:null,i=r!=null?r.getProperty(L.LEFTNEIGHBOR):null,s=1;for(;r!=null&&i!=null;){let c=0,g=0,h=r,d=i;for(let T=0;T<s;T++)h=h.getParent(),d=d.getParent(),g+=h.getProperty(L.MODIFIER),c+=d.getProperty(L.MODIFIER);let f=i.getProperty(L.PRELIM),E=r.getProperty(L.PRELIM),P=this._meanNodeWidth(r,i),S=f+c+this._spacing+P-E-g;if(S>0){let T=t,N=0;for(;T!=null&&T!==d;)N++,T=T.getProperty(L.LEFTSIBLING);if(T!=null){let I=S/N;for(T=t;T!==d;){let C=T.getProperty(L.PRELIM)+S;T.setProperty(L.PRELIM,C);let x=T.getProperty(L.MODIFIER)+S;T.setProperty(L.MODIFIER,x),S-=I,T=T.getProperty(L.LEFTSIBLING)}}else return}if(s++,r.isLeaf())r=Ro.getLeftMost(t.getChildren(),s);else{let T=[];for(let N of r.getChildren()){T.push(N);break}r=(l=T[0])!=null?l:null}i=r!=null?r.getProperty(L.LEFTNEIGHBOR):null}}_meanNodeWidth(t,e){let o=0;return t!=null&&(this._direction.isVertical()?o+=t.getSize().x/2:o+=t.getSize().y/2),e!=null&&(this._direction.isVertical()?o+=e.getSize().x/2:o+=e.getSize().y/2),o}_secondWalk(t,e,o){var r;if(t!=null){let i=t.getProperty(L.PRELIM)+o,s=e+t.getProperty(L.LEVELHEIGHT)/2;if(t.setProperty(L.XCOOR,Math.round(i)),t.setProperty(L.YCOOR,Math.round(s)),!t.isLeaf()){let a=[];for(let l of t.getChildren()){a.push(l);break}this._secondWalk((r=a[0])!=null?r:null,e+t.getProperty(L.LEVELHEIGHT)+this._spacing,o+t.getProperty(L.MODIFIER))}t.getProperty(L.RIGHTSIBLING)!=null&&this._secondWalk(t.getProperty(L.RIGHTSIBLING),e,o)}}};var yc=class{constructor(t,e,o,r){this._neighborOne=t,this._neighborTwo=e,this._graph=r,this._bendPoints=[o],this._d=r.getProperty(V.DIRECTION),this._nodeBendpointPadding=r.getProperty(V.SPACING_EDGE_NODE),this._onFirstNodeSide=!1,this._onLastNodeSide=!1,this._updateBendPoints()}getNeighborOne(){return this._neighborOne}getNeighborTwo(){return this._neighborTwo}isOnFirstNodeSide(){return this._onFirstNodeSide}isOnLastNodeSide(){return this._onLastNodeSide}addBendPoints(t){this._bendPoints.push(t),this._d.isHorizontal()?this._bendPoints.sort((e,o)=>e.getThird().getTarget().getPosition().y-o.getThird().getTarget().getPosition().y):this._bendPoints.sort((e,o)=>e.getThird().getTarget().getPosition().x-o.getThird().getTarget().getPosition().x),this._updateBendPoints()}_updateBendPoints(){let t=0,e=this._bendPoints.length;for(let o of this._bendPoints){let r,i,s,a=(t+1)/(e+1);if(this._neighborOne==null&&this._neighborTwo==null)return;this._neighborOne!=null&&this._neighborTwo==null?(this._onLastNodeSide=!0,this._d===R.LEFT?(s=this._neighborOne.getPosition().y+this._neighborOne.getSize().y+this._nodeBendpointPadding*(t+1),r=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborOne.getPosition().y+this._neighborOne.getSize().y+this._nodeBendpointPadding*(t+1),r=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborOne.getPosition().x+this._neighborOne.getSize().x+this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborOne.getPosition().x+this._neighborOne.getSize().x+this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding))):this._neighborOne!=null&&this._neighborTwo!=null?this._d===R.LEFT?(s=this._neighborTwo.getPosition().y*a+(this._neighborOne.getPosition().y+this._neighborOne.getSize().y)*(1-a),r=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborTwo.getPosition().y*a+(this._neighborOne.getPosition().y+this._neighborOne.getSize().y)*(1-a),r=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborTwo.getPosition().x*a+(this._neighborOne.getPosition().x+this._neighborOne.getSize().x)*(1-a),r=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborTwo.getPosition().x*a+(this._neighborOne.getPosition().x+this._neighborOne.getSize().x)*(1-a),r=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding)):(this._onFirstNodeSide=!0,this._d===R.LEFT?(s=this._neighborTwo.getPosition().y-this._nodeBendpointPadding*(t+1),r=new O(this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborTwo.getPosition().y-this._nodeBendpointPadding*(t+1),r=new O(this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborTwo.getPosition().x-this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborTwo.getPosition().x-this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding))),o.getFirst().x=r.x,o.getFirst().y=r.y,o.getSecond().x=i.x,o.getSecond().y=i.y,t++}}};var Ic=class n{constructor(){this._steepEndEdgeTheresholdDistance=50,this._steepEndEdgeRatio=5.3,this._steepEndEdgeSampleHeight=40}getLayoutProcessorConfiguration(){return K.create().before(Mt.P4_EDGE_ROUTING).add(pt.LEVEL_COORDS).add(pt.COMPACTION_PROC).add(pt.GRAPH_BOUNDS_PROC)}process(t,e){e.begin("Edge routing",1);let o=t.getProperty(V.EDGE_ROUTING_MODE);if(o===ms.MIDDLE_TO_MIDDLE)this._middleToMiddle(t);else if(o===ms.AVOID_OVERLAP){this._avoidOverlap(t);for(let r of t.getEdges())r.getBendPoints().size()<2&&this._middleToMiddleEdgeRoute(r)}e.done()}_middleToMiddle(t){for(let e of t.getEdges())this._middleToMiddleEdgeRoute(e)}_middleToMiddleEdgeRoute(t){let e=t.getBendPoints(),o=t.getSource(),r=t.getTarget(),i=new O(o.getPosition().x+o.getSize().x/2,o.getPosition().y+o.getSize().y/2),s=new O(r.getPosition().x+r.getSize().x/2,r.getPosition().y+r.getSize().y/2);e.addFirst(i),e.addLast(s),Ro.toNodeBorder(i,e.get(1),o.getSize()),Ro.toNodeBorder(s,e.get(e.size()-2),r.getSize())}_avoidOverlap(t){let e=t.getProperty(V.DIRECTION),o=t.getProperty(V.SPACING_EDGE_NODE),r=t.getProperty(V.EDGE_END_TEXTURE_LENGTH);this._avoidOverlapSetStartPoints(t,e,o),this._avoidOverlapSpecialEdges(t,e,o,r),this._avoidOverlapSetEndPoints(t,e,o,r)}_avoidOverlapSpecialEdges(t,e,o,r){let i=0,s=0,a=new Map,l=0;for(let E of t.getNodes()){let P=E.getProperty(V.TREE_LEVEL);P>l&&(l=P)}l++;let c=new Array(l).fill(0),g=new Array(l).fill(0),h=new Set,d=[];for(let E of t.getEdges())h.has(E)||(h.add(E),d.push(E));let f=e===R.LEFT||e===R.RIGHT;for(let E of d){let P=E.getSource().getProperty(V.TREE_LEVEL),S=E.getTarget().getProperty(V.TREE_LEVEL),T=S-P;if(T>1)for(let N=P+1;N<S;N++){let I=t.getNodes().filter(X=>X.getProperty(V.TREE_LEVEL)===N),C=0,x=(N-P)/(S-P);if(f){I.sort((tt,ot)=>tt.getPosition().y-ot.getPosition().y);let X=E.getSource().getPosition().y*(1-x)+E.getTarget().getPosition().y*x;for(C=0;C<I.length&&!(I[C].getPosition().y>X);C++);}else{I.sort((tt,ot)=>tt.getPosition().x-ot.getPosition().x);let X=E.getSource().getPosition().x*(1-x)+E.getTarget().getPosition().x*x;for(C=0;C<I.length&&!(I[C].getPosition().x>X);C++);}if(I.length>0){let X=E.getBendPoints(),tt=X.size()===0?new O(E.getSource().getPosition().x,E.getSource().getPosition().y):X.getLast(),ot=I[I.length-1],Lt=new O(ot.getPosition().x+ot.getSize().x,ot.getPosition().y+ot.getSize().y),zt=I[0],be=new O(zt.getPosition().x+zt.getSize().x,zt.getPosition().y+zt.getSize().y);if(f){if(C>=I.length-1&&tt.y>Lt.y&&E.getTarget().getPosition().y>Lt.y||C<=0&&tt.y<be.x&&E.getTarget().getPosition().y<be.y)continue}else if(C>=I.length-1&&tt.x>Lt.x&&E.getTarget().getPosition().x>Lt.x||C<=0&&tt.x<be.x&&E.getTarget().getPosition().x<be.x)continue}let M=new O,A=new O;E.getBendPoints().add(M),E.getBendPoints().add(A);let B=new Os(M,A,E),Y=Ro.getUniqueLong(N,C),j=a.get(Y);j==null?(j=new yc(C===0?null:I[C-1],C===I.length?null:I[C],B,t),a.set(Y,j)):j.addBendPoints(B),f?(j.isOnFirstNodeSide()&&j.getNeighborTwo()!=null&&j.getNeighborTwo().getPosition().y<=t.getProperty(L.GRAPH_YMIN)&&i++,j.isOnLastNodeSide()&&j.getNeighborOne()!=null&&j.getNeighborOne().getPosition().y+j.getNeighborOne().getSize().y>=t.getProperty(L.GRAPH_YMAX)&&s++):(j.isOnFirstNodeSide()&&j.getNeighborTwo()!=null&&j.getNeighborTwo().getPosition().x<=t.getProperty(L.GRAPH_XMIN)&&i++,j.isOnLastNodeSide()&&j.getNeighborOne()!=null&&j.getNeighborOne().getPosition().x+j.getNeighborOne().getSize().x>=t.getProperty(L.GRAPH_XMAX)&&s++)}else if(T===0)this._middleToMiddleEdgeRoute(E);else if(T<0){c[P]++,g[S]++;let N=this._avoidOverlapHandleCycleInducingEdges(E,e,t,i,s,o,r,g[S],c[P]);i=N[0],s=N[1]}}}_avoidOverlapHandleCycleInducingEdges(t,e,o,r,i,s,a,l,c){let g=t.getSource(),h=t.getTarget(),d=o.getNodes(),f=0,E;if(e===R.LEFT||e===R.RIGHT){let S=0;for(let T of d)S+=T.getPosition().y+T.getSize().y/2;if(E=S/d.length,g.getPosition().y+g.getSize().y/2>E){i++;let T=-1/0;for(let N of d){let I=N.getPosition().y+N.getSize().y+s*i;I>T&&(T=I)}f=T}else{r++;let T=1/0;for(let N of d){let I=N.getPosition().y-s*r;I<T&&(T=I)}f=T}}else{let S=0;for(let T of d)S+=T.getPosition().x+T.getSize().x/2;if(E=S/d.length,g.getPosition().x+g.getSize().x/2>E){i++;let T=-1/0;for(let N of d){let I=N.getPosition().x+N.getSize().x+s*i;I>T&&(T=I)}f=T}else{r++;let T=1/0;for(let N of d){let I=N.getPosition().x-s*r;I<T&&(T=I)}f=T}}let P=t.getBendPoints();if(e===R.LEFT){P.add(g.getProperty(L.LEVELMIN)-s,f);let S=h.getPosition().x+h.getSize().x+s+a;P.add(S,f),P.add(S,h.getPosition().y+h.getSize().y/2),P.add(h.getPosition().x+h.getSize().x,h.getPosition().y+h.getSize().y/2)}else if(e===R.RIGHT){P.add(g.getProperty(L.LEVELMAX)+s,g.getPosition().y+g.getSize().y/2),P.add(g.getPosition().x+g.getSize().x+s,f);let S=h.getPosition().x-s-a;P.add(S,f),P.add(S,h.getPosition().y+h.getSize().y/2),P.add(h.getPosition().x,h.getPosition().y+h.getSize().y/2)}else if(e===R.UP){P.add(f,g.getProperty(L.LEVELMIN)-s);let S=h.getPosition().y+h.getSize().y+s+a;P.add(f,S),P.add(h.getPosition().x+h.getSize().x/2,S),P.add(h.getPosition().x+h.getSize().x/2,h.getPosition().y+h.getSize().y+s)}else P.isEmpty()||(P.getLast().y=g.getProperty(L.LEVELMAX)+s*c),P.add(f,g.getProperty(L.LEVELMAX)+s*c),P.add(f,h.getPosition().y-s*l-a);return[r,i]}_avoidOverlapSetStartPoints(t,e,o){for(let r of t.getNodes()){if(r.getLabel()==="SUPER_ROOT")continue;let i=[...r.getOutgoingEdges()];if(i.length===0)continue;e===R.LEFT||e===R.RIGHT?i.sort((a,l)=>n._getFirstPoint(a).y-n._getFirstPoint(l).y):i.sort((a,l)=>n._getFirstPoint(a).x-n._getFirstPoint(l).x);let s=i.length;for(let a=0;a<s;a++){if(r.getProperty(L.COMPACT_LEVEL_ASCENSION)&&!n._isCycleInducing(i[a],e))continue;let l=s===1?.5:(a+1)/(s+1);if(e===R.LEFT){let c=r.getProperty(L.LEVELMIN),g=r.getPosition().y+r.getSize().y*l;i[a].getBendPoints().addFirst(Math.min(c,r.getPosition().x-o),g),i[a].getBendPoints().addFirst(r.getPosition().x,g)}else if(e===R.RIGHT){let c=r.getProperty(L.LEVELMAX)+o,g=r.getPosition().y+r.getSize().y*l;i[a].getBendPoints().addFirst(c,g),i[a].getBendPoints().addFirst(r.getPosition().x+r.getSize().x,g)}else if(e===R.UP){let c=r.getProperty(L.LEVELMIN),g=r.getPosition().x+r.getSize().x*l;i[a].getBendPoints().addFirst(g,Math.min(r.getPosition().y-o,c)),i[a].getBendPoints().addFirst(g,r.getPosition().y)}else{let c=r.getProperty(L.LEVELMAX)+o,g=r.getPosition().x+r.getSize().x*l;i[a].getBendPoints().addFirst(g,c),i[a].getBendPoints().addFirst(g,r.getPosition().y+r.getSize().y)}}}}_avoidOverlapSetEndPoints(t,e,o,r){for(let i of t.getNodes()){if(i.getLabel()==="SUPER_ROOT")continue;let s=[...i.getIncomingEdges()];if(s.length===0)continue;e===R.LEFT||e===R.RIGHT?s.sort((l,c)=>n._getLastPoint(l).y-n._getLastPoint(c).y):s.sort((l,c)=>n._getLastPoint(l).x-n._getLastPoint(c).x);let a=s.length;for(let l=0;l<a;l++){let c=a===1?.5:(1+l)/(a+1),g=s[l].getBendPoints();if(e===R.LEFT){let h=i.getProperty(L.LEVELMAX);i.getPosition().x+i.getSize().x+r<h?g.add(h+o,i.getPosition().y+i.getSize().y*c):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x,i.getPosition().y+i.getSize().y*c)}else if(e===R.RIGHT){let h=i.getProperty(L.LEVELMIN);i.getPosition().x-r>h?g.add(h-o,i.getPosition().y+i.getSize().y*c):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x,i.getPosition().y+i.getSize().y*c)}else if(e===R.UP){let h=i.getProperty(L.LEVELMAX);i.getPosition().y+i.getSize().y+r<h?g.add(i.getPosition().x+i.getSize().x*c,h+o):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x*c,i.getPosition().y+i.getSize().y)}else{let h=i.getProperty(L.LEVELMIN);n._isCycleInducing(s[l],e)?g.add(i.getPosition().x+i.getSize().x*c,g.getLast().y):i.getPosition().y-r>h?g.add(i.getPosition().x+i.getSize().x*c,h-o):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x*c,i.getPosition().y)}}}}_maybeAddSteepBend(t,e,o,r,i){if(r<=0)return;let s=t.getLast(),a=s.x,l=s.y,c=e.getPosition().x+e.getSize().x/2,g=e.getPosition().y+e.getSize().y/2,h=this._steepEndEdgeSampleHeight,d=this._steepEndEdgeRatio,f=this._steepEndEdgeTheresholdDistance;if(i===R.LEFT||i===R.RIGHT){let E=Math.abs(l-g),P=Math.abs(a-c)/h;if(!(E/P>f))return;let S=e.getPosition().y+e.getSize().y*o;g>l?t.add(i===R.LEFT?e.getPosition().x+e.getSize().x+r/d:e.getPosition().x-r/d,S-r/2):t.add(i===R.LEFT?e.getPosition().x+e.getSize().x+r/d:e.getPosition().x-r/d,S+r/2)}else{let E=Math.abs(a-c),P=Math.abs(l-g)/h;if(!(E/P>f))return;let S=e.getPosition().x+e.getSize().x*o,T=i===R.UP?e.getPosition().y+e.getSize().y+r/d:e.getPosition().y-r/d;c>a?t.add(S-r/2,T):t.add(S+r/2,T)}}static _getFirstPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getTarget().getPosition().x,t.getTarget().getPosition().y):e.getFirst()}static _getLastPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getSource().getPosition().x,t.getSource().getPosition().y):e.getLast()}static _isCycleInducing(t,e){let o=Ro.getDirectionVector(e),r=t.getTarget().getPosition().x-t.getSource().getPosition().x,i=t.getTarget().getPosition().y-t.getSource().getPosition().y;return o.x*r+o.y*i<=0}};var Mt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.P1_TREEIFICATION:return new Sc;case n.P2_NODE_ORDERING:return new Tc;case n.P3_NODE_PLACEMENT:return new Nc;case n.P4_EDGE_ROUTING:return new Ic;default:throw new Error(`No implementation available for phase ${this}`)}}};Mt.P1_TREEIFICATION=new Mt("P1_TREEIFICATION",0);Mt.P2_NODE_ORDERING=new Mt("P2_NODE_ORDERING",1);Mt.P3_NODE_PLACEMENT=new Mt("P3_NODE_PLACEMENT",2);Mt.P4_EDGE_ROUTING=new Mt("P4_EDGE_ROUTING",3);Mt.VALUES=[Mt.P1_TREEIFICATION,Mt.P2_NODE_ORDERING,Mt.P3_NODE_PLACEMENT,Mt.P4_EDGE_ROUTING];var Rc=class{constructor(){this._algorithmAssembler=Io.create(Mt.VALUES),this._algorithm=[]}doLayout(t,e){if(e.begin("Tree layout",1),t.getProperty(V.DEBUG_MODE)){let r=new Date,i=String(r.getHours()).padStart(2,"0"),s=String(r.getMinutes()).padStart(2,"0"),a=String(r.getSeconds()).padStart(2,"0");e.log(`MrTree! called at ${i}:${s}:${a}`)}this._updateModules(t);let o=typeof e.subTask=="function"?e.subTask(1):e;return this._layout(t,o),e.done(),t}_updateModules(t){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Mt.P1_TREEIFICATION,Mt.P1_TREEIFICATION),this._algorithmAssembler.setPhase(Mt.P2_NODE_ORDERING,Mt.P2_NODE_ORDERING),this._algorithmAssembler.setPhase(Mt.P3_NODE_PLACEMENT,Mt.P3_NODE_PLACEMENT),this._algorithmAssembler.setPhase(Mt.P4_EDGE_ROUTING,Mt.P4_EDGE_ROUTING),this._algorithm=this._algorithmAssembler.build(t)}_layout(t,e){let o=e!=null?e:new Ie;if(o.begin("Layout",this._algorithm.length),t.getProperty(V.DEBUG_MODE)){e.log(`ELK MrTree uses the following ${this._algorithm.length} modules:`);for(let r=0;r<this._algorithm.length;r++)e.log(` Slot ${r}: ${this._algorithm[r].constructor.name}`)}for(let r of this._algorithm){if(typeof o.isCanceled=="function"&&o.isCanceled())return;let i=typeof o.subTask=="function"?o.subTask(1):o;r.process(t,i)}o.done()}};var Lc=class extends de{constructor(){super(),this._klayTree=new Rc,this._componentsProcessor=new nc,this._defaultWork=.1}layout(t,e){t.getProperty(V.OMIT_NODE_MICRO_LAYOUT)||Go.forGraph(t).execute();let o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e;o.begin("build tGraph",1);let r=new lc,i=r.importGraph(t);o.done(),o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Split graph",1);let s=this._componentsProcessor.split(i);o.done();let a=(1-this._defaultWork*4)/Math.max(s.length,1);for(let l of s){let c=typeof e.subTask=="function"?e.subTask(a):e;this._klayTree.doLayout(l,c)}o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Pack components",1),i=this._componentsProcessor.pack(s),o.done(),o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Apply layout results",1),r.applyLayout(i),o.done()}};var NE="org.eclipse.elk.mrtree",yE=!1;function IE(){let n=Ht.getInstance(),t=n.getAlgorithmData(NE);if(t)return yE=!0,t;let e=new Se.Builder().id(NE).name("ELK Mr. Tree").description("Tree-based algorithm provided by the Eclipse Layout Kernel.").category("org.eclipse.elk.tree").definingBundleId("org.eclipse.elk.alg.mrtree").providerFactory(()=>new Lc).supportedFeatures(new Set(["DISCONNECTED"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),yE=!0,e}var Re=class{};Re.ROOT_NODE=new m("root");var zu=2*Math.PI,Yu=1e-10,bt=class n{static getSuccessors(t){let e=[],o=new Set(t.children);for(let r of Ee(t)){let i=r.sources||[];if(i.length===0)continue;let s=i[0];if(s&&s.parent!==void 0&&s.children===void 0)continue;let a=r.targets||[];if(a.length===0)continue;let l=Pt(a[0]);l!=null&&!o.has(l)&&e.push(l)}return e}static getSuccessorSet(t){return new Set(n.getSuccessors(t))}static findRoot(t){for(let e of t.children)if([..._i(e)].length===0)return e;return null}static findRootOfNode(t){let e=n.getTreeParent(t);return e==null?t:n.findRootOfNode(e)}static getNumberOfLeaves(t){let e=n.getSuccessors(t);if(e.length===0)return 1;let o=0;for(let r of e)o+=n.getNumberOfLeaves(r);return o}static createPolarComparator(t,e){return(o,r)=>{let i=n._arc(o,t,e),s=n._arc(r,t,e);return Math.abs(i-s)<Yu?0:i<s?-1:1}}static _arc(t,e,o){let r=t.getProperty(ho),i=Math.atan2(r.y+o,r.x);return i<0&&(i+=zu),i+=e,i>zu&&(i-=zu),i}static findLargestNodeInGraph(t){let e=0;for(let o of t.children){let r=Math.sqrt(o.width*o.width+o.height*o.height);r>e&&(e=r);let i=n.findLargestNodeInGraph(o);i>e&&(e=i)}return e}static getNextLevelNodes(t){let e=[];for(let o of t)for(let r of n.getSuccessors(o))e.push(r);return e}static getNextLevelNodeSet(t){let e=new Set;for(let o of t)for(let r of n.getSuccessorSet(o))e.add(r);return e}static getLastLevelNodes(t){let e=[];for(let o of t)e.push(n.getTreeParent(o));return e}static centerNodesOnRadi(t,e,o){t.x=e-t.width/2,t.y=o-t.height/2}static shiftClosestEdgeToRadi(t,e,o){if(Math.abs(e)<Yu&&Math.abs(o)<Yu){t.x=e-t.width/2,t.y=o-t.height/2;return}e<0?o<0?(t.x=e-t.width,t.y=o):(t.x=e-t.width,t.y=o+t.height):o<0?(t.x=e,t.y=o):(t.x=e,t.y=o+t.height)}static getTreeParent(t){let e=[..._i(t)];if(e.length===0)return null;let r=e[0].sources||[];return r.length===0?null:Pt(r[0])}};var Ac=class{calculateWedgeSpace(t){return bt.getNumberOfLeaves(t)}};var Cc=class{calculateWedgeSpace(t){let e=bt.getSuccessors(t),o=t.height,r=t.width,i=Math.sqrt(o*o+r*r),s=0;for(let a of e)s+=this.calculateWedgeSpace(a);return Math.max(s,i)}};var Li=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.LEAF_NUMBER:return new Ac;case n.NODE_SIZE:return new Cc;default:throw new Error(`AnnulusWedgeCriteria.${this}: no implementation available.`)}}};Li.LEAF_NUMBER=new Li("LEAF_NUMBER");Li.NODE_SIZE=new Li("NODE_SIZE");var Ai=class{constructor(){this._compactionStep=1,this._spacing=0,this._root=null}contractLayer(t,e){for(let o of t){let r=o.x+o.width/2,i=o.y+o.height/2,s=this._root,a=s.x+s.width/2,l=s.y+s.height/2,c=r-a,g=i-l,h=Math.sqrt(c*c+g*g);h!==0&&(c*=this._compactionStep/h,g*=this._compactionStep/h,e?(r-=c,i-=g):(r+=c,i+=g),o.x=r-o.width/2,o.y=i-o.height/2)}}moveNode(t,e){let o=this._root,r=o.x+o.width/2,i=o.y+o.height/2,s=t.x+t.width/2,a=t.y+t.height/2,l=s-r,c=a-i,g=Math.sqrt(l*l+c*c);if(g===0)return;let h=l/g,d=c/g;t.x=t.x+h*e,t.y=t.y+d*e}overlap(t,e){let o=t.x-this._spacing/2,r=e.x-this._spacing/2,i=t.y-this._spacing/2,s=e.y-this._spacing/2,a=t.width+this._spacing,l=e.width+this._spacing,c=t.height+this._spacing,g=e.height+this._spacing;return o<r+l&&r<o&&i<s+g&&s<i||r<o+a&&o<r&&s<i+c&&i<s||o<r+l&&r<o&&i<s&&s<i+c||r<o+a&&o<r&&i<s+g&&s<i}overlapLayer(t){if(t.length<2)return!1;let e=!1;for(let o=0;o<t.length;o++)o<t.length-1?e=e||this.overlap(t[o],t[o+1]):e=e||this.overlap(t[o],t[0]);return e}getCompactionStep(){return this._compactionStep}setCompactionStep(t){this._compactionStep=t}getSpacing(){return this._spacing}setSpacing(t){this._spacing=t}setRoot(t){this._root=t}getRoot(){return this._root}};var xc=class extends Ai{constructor(){super(),this._sorter=null,this._lastRadius=0}compact(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Dc);o!=null&&this.setCompactionStep(o);let r=t.getProperty(Pi);this.setSpacing(r);let i=bt.getSuccessors(e);this._sorter!=null&&this._sorter.sort(i),this._contract(i)}_contract(t){if(t.length===0)return;let e=this._overlapping(t),o=!1;for(;!e;)this.contractLayer(t,!0),o=!0,e=this._overlapping(t);o&&this.contractLayer(t,!1);let r=bt.getNextLevelNodes(t);this._sorter!=null&&this._sorter.sort(r),this._lastRadius=this._calculateRadius(t[0]),this._contract(r)}_calculateRadius(t){let e=this.getRoot(),o=t.x-e.x,r=t.y-e.y;return Math.sqrt(o*o+r*r)}_overlapping(t){if(this.overlapLayer(t))return!0;for(let e of t){let o=bt.getTreeParent(e);if(o!=null&&this.overlap(e,o)||this._calculateRadius(e)-this.getSpacing()<=this._lastRadius)return!0}return!1}};var wc=class extends Ai{constructor(){super(),this._leftContour=new Map,this._rightContour=new Map,this._sorter=null}compact(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Dc);o!=null&&this.setCompactionStep(o);let r=t.getProperty(Pi);this.setSpacing(r);let i=bt.getSuccessors(e);this._sorter!=null&&this._sorter.sort(i),this._constructContour(i);let s=[e];for(let a=0;a<2;a++)for(let l=0;l<i.length;l++){let c=[i[l]],g=l<i.length-1?i[l+1]:i[0],h=l===0?i[i.length-1]:i[l-1];this._contractWedge(i[l],s,h,g,c)}}_contractWedge(t,e,o,r,i){let s=this._overlapping(e,o,r,i),a=!1;for(;!s;)this.contractLayer(i,!0),a=!0,s=this._overlapping(e,o,r,i);a&&this.contractLayer(i,!1);let l=bt.getNextLevelNodes(i);l.length>0&&(this._sorter!=null&&this._sorter.sort(l),this._contractWedge(t,i,o,r,l))}_overlapping(t,e,o,r){this._sorter!=null&&this._sorter.sort(r);let i=r[0];if(this._contourOverlap(e,i,!1))return!0;let s=r[r.length-1];if(this._contourOverlap(o,s,!0)||this.overlapLayer(r))return!0;for(let a of r)for(let l of t)if(this.overlap(a,l))return!0;return!1}_contourOverlap(t,e,o){let r=o?this._leftContour.get(t)||[]:this._rightContour.get(t)||[];for(let i of r)if(this.overlap(e,i))return!0;return!1}_constructContour(t){for(let e of t){let o=[e],r=[e];this._leftContour.set(e,o),this._rightContour.set(e,r);let i=bt.getSuccessors(e);if(i.length>0)for(this._sorter!=null&&this._sorter.sort(i),o.push(i[0]),r.push(i[i.length-1]);bt.getNextLevelNodes(i).length>0;)i=bt.getNextLevelNodes(i),this._sorter!=null&&this._sorter.sort(i),o.push(i[0]),r.push(i[i.length-1])}}};var Xo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.RADIAL_COMPACTION:return new xc;case n.WEDGE_COMPACTION:return new wc;case n.NONE:return null;default:throw new Error(`CompactionStrategy.${this}: no implementation available.`)}}};Xo.NONE=new Xo("NONE");Xo.RADIAL_COMPACTION=new Xo("RADIAL_COMPACTION");Xo.WEDGE_COMPACTION=new Xo("WEDGE_COMPACTION");var Mc=class{evaluate(t){let e=0;for(let o of Ee(t)){let r=o.targets||[];if(r.length===0)continue;let i=Pt(r[0]);if(i==null)continue;let s=i.x+i.width/2,a=i.y+i.height/2,l=t.x+t.width/2,c=t.y+t.height/2,g=new O(s-l,a-c),h=new O(g.x,g.y);Ft.clipVector(h,t.width,t.height),g.x-=h.x,g.y-=h.y,l=s-g.x,c=a-g.y;let d=new O(g.x,g.y);Ft.clipVector(d,i.width,i.height),g.x-=d.x,g.y-=d.y,s=l+g.x,a=c+g.y;let f=s-l,E=a-c;e+=Math.sqrt(f*f+E*E)}return e}};var bc=class{evaluate(t){let e=0;for(let o of Ee(t)){let r=o.targets||[];if(r.length===0)continue;let i=Pt(r[0]);if(i==null)continue;let s=i.x+i.width/2,a=i.y+i.height/2,l=i.getProperty(ho),c=t.x+l.x+t.width/2,g=t.y+l.y+t.height,h=s-c,d=a-g;e+=Math.sqrt(h*h+d*d)}return e}};var Gc=class{constructor(){this._root=null}evaluate(t){this._root=t;let e=0,o=bt.getSuccessors(t);for(let r=0;r<o.length;r++)for(let i=r+1;i<o.length;i++)this._isCrossing(o[r],o[i])&&(e+=1);return e}_isCrossing(t,e){let o=this._root.x+this._root.width/2,r=this._root.x+this._root.width/2,i=new O(t.x+t.width/2,t.y+t.height/2),s=t.getProperty(ho);s.x=s.x+o,s.y=s.y+r;let a=(i.y-s.y)/(i.x-s.x),l=i.y-a*i.x,c=new O(e.x+e.width/2,e.y+e.height/2),g=e.getProperty(ho);g.x=g.x+o,g.y=g.y+r;let h=(c.y-g.y)/(c.x-g.x),d=c.y-h*c.x,f=(l-d)/(h-a);return!(s.x<f&&i.x<f||f<s.x&&f<i.x||g.x<f&&c.x<f||f<g.x&&f<c.x)}};var Ko=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NONE:return null;case n.EDGE_LENGTH:return new Mc;case n.EDGE_LENGTH_BY_POSITION:return new bc;case n.CROSSING_MINIMIZATION_BY_POSITION:return new Gc;default:throw new Error(`RadialTranslationStrategy.${this}: no implementation available.`)}}};Ko.NONE=new Ko("NONE");Ko.EDGE_LENGTH=new Ko("EDGE_LENGTH");Ko.EDGE_LENGTH_BY_POSITION=new Ko("EDGE_LENGTH_BY_POSITION");Ko.CROSSING_MINIMIZATION_BY_POSITION=new Ko("CROSSING_MINIMIZATION_BY_POSITION");var ln=class{sort(t){t.sort((e,o)=>{let r=e.getProperty(Fa),i=o.getProperty(Fa);return r-i})}initialize(t){}};var iT=.25*Math.PI,sT=.5*Math.PI,RE=.75*Math.PI,LE=1.25*Math.PI,nT=1.5*Math.PI,AE=1.75*Math.PI,Hc=class{constructor(){this._compRight=bt.createPolarComparator(0,0),this._compLeft=bt.createPolarComparator(Math.PI,0),this._compTop=bt.createPolarComparator(nT,0),this._compBottom=bt.createPolarComparator(sT,0),this._idSorter=null}initialize(t){this._idSorter=new ln;let e=bt.getSuccessors(t);e.sort(this._compRight),this._setIDForNodes(e,0)}_setIDForNodes(t,e){let o=e,r=0;for(let i of t){i.setProperty(Fa,o++);let s=bt.getSuccessors(i),a=Math.atan2(i.y+i.height/2,i.x+i.width/2);a<0&&(a+=2*Math.PI),a<iT||a>AE?s.sort(this._compLeft):a<=AE&&a>LE?s.sort(this._compTop):a<=LE&&a>RE?s.sort(this._compRight):a<=RE&&s.sort(this._compBottom),r=this._setIDForNodes(s,r)}return o}sort(t){if(t.length>0){if(this._idSorter==null){let e=bt.findRootOfNode(t[0]);this.initialize(e)}this._idSorter.sort(t)}}};var Ar=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NONE:return null;case n.POLAR_COORDINATE:return new Hc;case n.ID:return new ln;default:throw new Error(`SortingStrategy.${this}: no implementation available.`)}}};Ar.NONE=new Ar("NONE");Ar.POLAR_COORDINATE=new Ar("POLAR_COORDINATE");Ar.ID=new Ar("ID");var CE=new m("org.eclipse.elk.radial.centerOnRoot",!1),Fa=new m("org.eclipse.elk.radial.orderId",0),ka=new m("org.eclipse.elk.radial.radius",0),xE=new m("org.eclipse.elk.radial.rotate",!1),vc=new m("org.eclipse.elk.radial.rotation.targetAngle",0),DE=new m("org.eclipse.elk.radial.rotation.computeAdditionalWedgeSpace",!1),wE=new m("org.eclipse.elk.radial.rotation.outgoingEdgeAngles",!1),Bc=new m("org.eclipse.elk.radial.compactor",()=>Xo.NONE),Dc=new m("org.eclipse.elk.radial.compactionStepSize",1,0),Ci=new m("org.eclipse.elk.radial.sorter",()=>Ar.NONE),ME=new m("org.eclipse.elk.radial.wedgeCriteria",()=>Li.NODE_SIZE),bE=new m("org.eclipse.elk.radial.optimizationCriteria",()=>Ko.NONE);var aT=360,lT=Math.PI/180,Uc=class{constructor(){this._radius=0,this._sorter=null,this._annulusWedgeCriteria=null,this._optimizer=null,this._root=null}process(t,e){e.begin("Eades radial",1),this._root=t.getProperty(Re.ROOT_NODE),this._radius=t.getProperty(ka),this._sorter=t.getProperty(Ci).create(),this._annulusWedgeCriteria=t.getProperty(ME).create(),this._optimizer=t.getProperty(bE).create(),this._translate(t),e.done()}_translate(t){let e=0,o=Number.MAX_VALUE;if(this._optimizer!=null)for(let r=0;r<aT;r++){let i=r*lT;this._positionNodes(this._root,0,0,2*Math.PI,i);let s=this._optimizer.evaluate(this._root);s<o&&(e=i,o=s)}this._positionNodes(this._root,0,0,2*Math.PI,e)}_positionNodes(t,e,o,r,i){let s=(o+r)/2+i,a=e*Math.cos(s),l=e*Math.sin(s);bt.centerNodesOnRadi(t,a,l);let c=this._annulusWedgeCriteria.calculateWedgeSpace(t),g=2*Math.acos(e/e+this._radius),h,d;g<r-o?(h=g/c,d=(o+r-g)/2):(h=(r-o)/c,d=o);let f=bt.getSuccessors(t);this._sorter!=null&&(this._sorter.initialize(this._root),this._sorter.sort(f));for(let E of f){let P=this._annulusWedgeCriteria.calculateWedgeSpace(E);this._positionNodes(E,e+this._radius,d,d+h*P,i),d+=h*P}}getLayoutProcessorConfiguration(){return null}};var Fc=class{process(t,e){e.begin("Straight Line Edge Routing",1);let o=t.getProperty(Re.ROOT_NODE);o!=null&&this.routeEdges(o),e.done()}routeEdges(t){for(let e of Ee(t)){let o=e.sources||[];if(o.length===0)continue;let r=o[0];if(r&&r.parent!==void 0&&r.children===void 0||e.isHierarchical&&e.isHierarchical())continue;let i=e.targets||[];if(i.length===0)continue;let s=Pt(i[0]);if(s==null)continue;let a=t.x+t.width/2,l=t.y+t.height/2,c=s.x+s.width/2,g=s.y+s.height/2,h=new O(c-a,g-l),d=new O(h.x,h.y);Ft.clipVector(d,t.width,t.height),h.x-=d.x,h.y-=d.y,a=c-h.x,l=g-h.y;let f=new O(h.x,h.y);Ft.clipVector(f,s.width,s.height),h.x-=f.x,h.y-=f.y,c=a+h.x,g=l+h.y;let E=ar(e,!0,!0);E.setStartLocation(a,l),E.setEndLocation(c,g),this.routeEdges(s)}}getLayoutProcessorConfiguration(){return null}};var Ce=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.P1_NODE_PLACEMENT:return new Uc;case n.P2_EDGE_ROUTING:return new Fc;default:throw new Error(`RadialLayoutPhases.${this}: no implementation available.`)}}};Ce.P1_NODE_PLACEMENT=new Ce("P1_NODE_PLACEMENT",0);Ce.P2_EDGE_ROUTING=new Ce("P2_EDGE_ROUTING",1);Ce.VALUES=[Ce.P1_NODE_PLACEMENT,Ce.P2_EDGE_ROUTING];var kc=class extends Ai{constructor(){super(),this._sorter=null}process(t,e){e.begin("Remove overlaps",1),this._removeOverlaps(t),e.done()}_removeOverlaps(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Pi);this.setSpacing(o);let r=bt.getSuccessors(e);this._extend(r)}_extend(t){if(t.length===0)return;let e=t.map(l=>new O(l.x,l.y));for(;this.overlapLayer(t);)this.contractLayer(t,!1);let o=0,r=0;if(t.length>0){let l=t[0];o=l.x-e[0].x,r=l.y-e[0].y}let i=Math.sqrt(o*o+r*r),s=bt.getNextLevelNodeSet(t);if(s.size>0)for(let l of s)this.moveNode(l,i);let a=[...s];this._sorter!=null&&this._sorter.sort(a),this._extend(a)}};var Wc=class{process(t,e){e.begin("Calculate Graph Size",1);let o=Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let h of t.children){let d=h.getProperty(Nr);o=Math.min(o,h.x-d.left),r=Math.min(r,h.y-d.top),i=Math.max(i,h.x+h.width+d.right),s=Math.max(s,h.y+h.height+d.bottom)}let a=t.getProperty(ns),l=new O(o-a.getLeft(),r-a.getTop()),c=i-o+a.getHorizontal(),g=s-r+a.getVertical();if(t.getProperty(CE)){let h=t.getProperty(Re.ROOT_NODE),d=h.getProperty(Nr),f=h.x+h.width/2+(d.left+d.right)/2-l.x,E=h.y+h.height/2+(d.top+d.bottom)/2-l.y,P=c-f,S=g-E;if(P<c/2){let T=P-f;c+=T,l.x-=T}else{let T=f-P;c+=T}if(S<g/2){let T=S-E;g+=T,l.y-=T}else{let T=E-S;g+=T}}for(let h of t.children)h.x=h.x-l.x,h.y=h.y-l.y;t.getProperty(To)||(t.width=c,t.height=g),t.setProperty(pi,c-a.getHorizontal()),t.setProperty(Ei,g-a.getVertical()),e.done()}};var zc=class{process(t,e){e.begin("Calculate outgoing edge angles",1);let o=t.getProperty(Re.ROOT_NODE);if(o!=null)for(let r of o.getOutgoingEdges()){let i=r.sections||[];if(i.length===0)continue;let s=i[0],a=new O(s.startX,s.startY),l=new O(s.endX,s.endY),c=O.diff(l,a),g=Math.atan2(c.y,c.x),h=r.targets||[];h.length>0&&typeof h[0].setProperty=="function"&&h[0].setProperty(vc,g)}e.done()}};var Yc=class{process(t,e){e.begin("General Compactor",1);let o=t.getProperty(Bc).create();o!=null&&o.compact(t),e.done()}};var Vc=class{rotate(t){let e=t.getProperty(vc);if(t.getProperty(DE)){let r=t.getProperty(Re.ROOT_NODE).getOutgoingEdges();if(r.length>0){let i=r[r.length-1],s=r[0],a=i.targets[0],l=s.targets[0],c=new O(a.x+a.width/2,a.y+a.height/2),g=new O(l.x+l.width/2,l.y+l.height/2),h=e;h<=0&&(h+=2*Math.PI);let d=c.angle(g);d<=0&&(d+=2*Math.PI);let f=Math.atan2(c.y,c.x);f<=0&&(f+=2*Math.PI),e=Math.PI-(f-h+d/2)}}for(let o of t.children){let r=new O(o.x+o.width/2,o.y+o.height/2);r.rotate(e),o.setLocation(r.x-o.width/2,r.y-o.height/2)}}};var Xc=class{process(t,e){e.begin("General Rotator",1),new Vc().rotate(t),e.done()}};var ue=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.OVERLAP_REMOVAL:return new kc;case n.COMPACTION:return new Yc;case n.ROTATION:return new Xc;case n.GRAPH_SIZE_CALCULATION:return new Wc;case n.OUTGOING_EDGE_ANGLES:return new zc;default:throw new Error(`IntermediateProcessorStrategy.${this}: processor is not yet ported.`)}}};ue.OVERLAP_REMOVAL=new ue("OVERLAP_REMOVAL",0);ue.COMPACTION=new ue("COMPACTION",1);ue.ROTATION=new ue("ROTATION",2);ue.GRAPH_SIZE_CALCULATION=new ue("GRAPH_SIZE_CALCULATION",3);ue.OUTGOING_EDGE_ANGLES=new ue("OUTGOING_EDGE_ANGLES",4);ue.VALUES=[ue.OVERLAP_REMOVAL,ue.COMPACTION,ue.ROTATION,ue.GRAPH_SIZE_CALCULATION,ue.OUTGOING_EDGE_ANGLES];var Kc=class extends de{constructor(){super(),this._algorithmAssembler=Io.create(Ce.VALUES)}layout(t,e){let o=this._assembleAlgorithm(t);e.begin("Radial layout",o.length),t.getProperty(So)||Go.forGraph(t).execute();let r=bt.findRoot(t);if(t.setProperty(Re.ROOT_NODE,r),r==null)throw new Error("The given graph is not a tree!");let i=t.getProperty(ka);i===0&&(i=bt.findLargestNodeInGraph(t)),t.setProperty(ka,i);for(let s of o){let a=typeof e.subTask=="function"?e.subTask(1):e;s.process(t,a)}e.done()}_assembleAlgorithm(t){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ce.P1_NODE_PLACEMENT,Ce.P1_NODE_PLACEMENT),this._algorithmAssembler.setPhase(Ce.P2_EDGE_ROUTING,Ce.P2_EDGE_ROUTING);let e=K.create();return e.addBefore(Ce.P2_EDGE_ROUTING,ue.OVERLAP_REMOVAL),t.getProperty(Bc)!==Xo.NONE&&e.addBefore(Ce.P2_EDGE_ROUTING,ue.COMPACTION),t.getProperty(xE)&&e.addBefore(Ce.P2_EDGE_ROUTING,ue.ROTATION),e.addBefore(Ce.P2_EDGE_ROUTING,ue.GRAPH_SIZE_CALCULATION),t.getProperty(wE)&&e.addAfter(Ce.P2_EDGE_ROUTING,ue.OUTGOING_EDGE_ANGLES),this._algorithmAssembler.addProcessorConfiguration(e),this._algorithmAssembler.build(t)}};var GE="org.eclipse.elk.radial",HE=!1;function vE(){let n=Ht.getInstance(),t=n.getAlgorithmData(GE);if(t)return HE=!0,t;let e=new Se.Builder().id(GE).name("ELK Radial").description("Radial layout provider for tree graphs.").category("org.eclipse.elk.tree").definingBundleId("org.eclipse.elk.alg.radial").providerFactory(()=>new Kc).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),HE=!0,e}var Le=class{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}};Le.P1_WIDTH_APPROXIMATION=new Le("P1_WIDTH_APPROXIMATION",0);Le.P2_PACKING=new Le("P2_PACKING",1);Le.P3_WHITESPACE_ELIMINATION=new Le("P3_WHITESPACE_ELIMINATION",2);Le.VALUES=[Le.P1_WIDTH_APPROXIMATION,Le.P2_PACKING,Le.P3_WHITESPACE_ELIMINATION];var $=class{};$.ADDITIONAL_HEIGHT=new m("additionalHeight");$.DRAWING_HEIGHT=new m("drawingHeight");$.DRAWING_WIDTH=new m("drawingWidth");$.MIN_HEIGHT=new m("minHeight");$.MIN_WIDTH=new m("minWidth");$.ROWS=new m("rows");$.TARGET_WIDTH=new m("targetWidth");$.MIN_ROW_INCREASE=new m("minRowIncrease",0);$.MAX_ROW_INCREASE=new m("maxRowIncrease",0);$.MIN_ROW_DECREASE=new m("minRowDecrease",0);$.MAX_ROW_DECREASE=new m("maxRowDecrease",0);var Lo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Lo.ASPECT_RATIO_DRIVEN=new Lo("ASPECT_RATIO_DRIVEN");Lo.MAX_SCALE_DRIVEN=new Lo("MAX_SCALE_DRIVEN");Lo.AREA_DRIVEN=new Lo("AREA_DRIVEN");var Be=class{static computeScaleMeasure(t,e,o){return Math.min(o/t,1/e)}static resetCoordinates(t){for(let e of t)e.setLocation(0,0)}static calculateDimensions(t,e){let o=0,r=0,i=0;for(let s of t)o=Math.max(o,s.getWidth()),r+=s.getHeight()+(i>0&&e||0),i++;return new O(o,r)}static calculateDimensionsOfRectangles(t){let e=0,o=0;for(let r of t)e=Math.max(r.width+r.x,e),o=Math.max(r.height+r.y,o);return new O(e,o)}};var Ss=class{constructor(t,e,o,r,i=0,s=0){this._dar=t,this._drawingWidth=e,this._drawingHeight=o,this._placementOption=r,this._nextXcoordinate=i,this._nextYcoordinate=s,this._area=0,this._aspectRatio=0,this._scaleMeasure=0,this._calcAreaAspectRatioScaleMeasure()}_calcAreaAspectRatioScaleMeasure(){this._drawingWidth>0&&this._drawingHeight>0&&(this._area=this._drawingWidth*this._drawingHeight,this._aspectRatio=this._drawingWidth/this._drawingHeight,this._scaleMeasure=Be.computeScaleMeasure(this._drawingWidth,this._drawingHeight,this._dar))}getDrawingWidth(){return this._drawingWidth}setDrawingWidth(t){this._drawingWidth=t,this._calcAreaAspectRatioScaleMeasure()}getDrawingHeight(){return this._drawingHeight}setDrawingHeight(t){this._drawingHeight=t,this._calcAreaAspectRatioScaleMeasure()}getScaleMeasure(){return this._scaleMeasure}getArea(){return this._area}getAspectRatio(){return this._aspectRatio}getPlacementOption(){return this._placementOption}setPlacementOption(t){this._placementOption=t}getNextXcoordinate(){return this._nextXcoordinate}setNextXcoordinate(t){this._nextXcoordinate=t}getNextYcoordinate(){return this._nextYcoordinate}setNextYcoordinate(t){this._nextYcoordinate=t}getDesiredAspectRatio(){return this._dar}};var Ot=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT=new Ot("CANDIDATE_POSITION_LAST_PLACED_RIGHT");Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW=new Ot("CANDIDATE_POSITION_LAST_PLACED_BELOW");Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT=new Ot("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT");Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW=new Ot("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW");Ot.WHOLE_DRAWING=new Ot("WHOLE_DRAWING");var Ts=class{constructor(t,e,o){this._x=t,this._y=e,this._width=0,this._height=0,this._nodeNodeSpacing=o,this._rects=[]}addRectangle(t){return t.x=this._x+this._width+(this._rects.length===0?0:this._nodeNodeSpacing),t.y=this._y,this._height=Math.max(this._height,t.height),this._width+=t.width+(this._rects.length===0?0:this._nodeNodeSpacing),this._rects.push(t),!0}removeRectangle(t,e){let o=this._rects.indexOf(t);o>=0&&this._rects.splice(o,1),e&&this.updateRow()}updateRow(){let t=0,e=0;for(let o of this._rects)o.x=this._x+t,o.y=this._y,t+=o.width+this._nodeNodeSpacing,e=Math.max(e,o.height+this._nodeNodeSpacing);this._width=t-this._nodeNodeSpacing,this._height=e-this._nodeNodeSpacing}expand(t,e,o){let r=(t-this._width)/this._rects.length;this._height+=e,this._width=t;let i=0;for(let s of this._rects){let a=s.width,l=s.height;s.x=s.x+i*r,s.y=s.y+o*e,s.width=s.width+r,s.height=this._height,i++;let c=s.width,g=s.height;Vs(s,new O(c,g),new O(a,l))}}getY(){return this._y}setY(t){this._y=t}getX(){return this._x}setX(t){this._x=t}getWidth(){return this._width}getHeight(){return this._height}getNodes(){return this._rects}};var cn=class{constructor(t,e,o,r){this._smallestRectWidth=Number.POSITIVE_INFINITY,this._minWidth=0,this._width=0,this._minHeight=0,this._smallestRectHeight=Number.POSITIVE_INFINITY,this._averageHeight=0,this._maxHeight=0,this._height=0,this._children=[],this._rows=[],this._x=t,this._y=e,this._parentRow=o,this._stack=null,this._nodeNodeSpacing=r,this._fixed=!1,this._positionFixed=!1}addChild(t){this._rows.length===0&&this._rows.push(new Ts(this._x,this._y,this._nodeNodeSpacing)),this._children.push(t),this._rows[this._rows.length-1].addRectangle(t),this._adjustSizeAdd(t)}addChildInNewRow(t){this._children.push(t);let e=this.getLastRow();this._rows.push(new Ts(this._x,e.getY()+e.getHeight()+this._nodeNodeSpacing,this._nodeNodeSpacing)),this.getLastRow().addRectangle(t),this._adjustSizeAdd(t)}removeChild(t){let e=this._children.indexOf(t);e>=0&&this._children.splice(e,1);for(let o=0;o<this._rows.length;o++){let r=this._rows[o];if(r.getNodes().includes(t)){r.removeRectangle(t,!0),r.getNodes().length===0&&this._rows.splice(o,1);break}}this._adjustSizeAfterRemove()}setLocation(t,e){this._adjustChildrensXandY(t-this._x,e-this._y);for(let o of this._rows)o.setX(o.getX()+t-this._x),o.setY(o.getY()+e-this._y);this._x=t,this._y=e}_adjustChildrensXandY(t,e){for(let o of this._children)o.setLocation(o.x+t,o.y+e)}_adjustSizeAdd(t){let e=this.getLastRow().getWidth();this._smallestRectWidth=Math.min(this._smallestRectWidth,t.width),this._width=Math.max(this._width,e),this._minWidth=Math.max(this._minWidth,t.width+(this._children.length===1?0:this._nodeNodeSpacing)),this._smallestRectHeight=Math.min(this._smallestRectHeight,t.height),this._maxHeight+=t.height+(this._children.length===1?0:this._nodeNodeSpacing),this._minHeight=Math.max(this._minHeight,t.height);let o=this._rows.length>0?(this._rows.length-1)*this._nodeNodeSpacing:0;for(let r of this._rows)o+=r.getHeight();this._height=o,this._averageHeight=this._maxHeight/this._children.length-this._nodeNodeSpacing*((this._children.length-1)/this._children.length),this._parentRow.notifyAboutNodeChange()}getWidthForTargetHeight(t){if(this._maxHeight<=t)return this._minWidth;if(this._placeRectsInWH(this._minWidth,t,!1))return this._minWidth;let e=this._width,o=this._minWidth,r=this._width,i=(e-o)/2+o;for(;o+1<e;)this._placeRectsInWH(i,t,!1)?(r=i,e=i):o=i,i=(e-o)/2+o;return r}getHeightForTargetWidth(t){return this._placeRectsInW(t,!1).height}_placeRectsInW(t,e){let o=0,r=this._y,i=0,s=0,a=0,l=0,c=0;e&&(this._rows.length=0,this._rows.push(new Ts(this._x,this._y,this._nodeNodeSpacing)));let g=0;for(let h of this._children)o+h.width+(g>0?this._nodeNodeSpacing:0)>t&&a>0&&(o=0,r+=a+this._nodeNodeSpacing,i=Math.max(i,l),s+=a+this._nodeNodeSpacing,a=0,l=0,e&&(c++,this._rows.push(new Ts(this._x,r,this._nodeNodeSpacing))),g=0),l+=h.width+(g>0?this._nodeNodeSpacing:0),a=Math.max(a,h.height),e&&this._rows[c].addRectangle(h),o+=h.width+(g>0?this._nodeNodeSpacing:0),g++;return i=Math.max(i,l),s+=a,e&&(this._width=i,this._height=s,this._parentRow.notifyAboutNodeChange()),new dt(this._x,this._y,i,s)}_placeRectsInWH(t,e,o){let r=this._placeRectsInW(t,o);return r.width<=t&&r.height<=e}placeRectsIn(t,e){if(e===void 0){let o=this._width,r=this._height,i=this._placeRectsInW(t,!0);return i.width!==o||i.height!==r}return this._placeRectsInWH(t,e,!0)}_adjustSizeAfterRemove(){let t=0,e=0,o=[],r=0;for(let i of this._rows)i.getNodes().length!==0&&(o.push(i),t=Math.max(t,i.getWidth()),e+=i.getHeight()+(r>0?this._nodeNodeSpacing:0),r++);this._rows=o,this._height=e,this._width=t,this._minWidth=0,this._minHeight=0,this._maxHeight=0,this._smallestRectHeight=Number.POSITIVE_INFINITY,this._smallestRectWidth=Number.POSITIVE_INFINITY;for(let i of this._children)this._smallestRectWidth=Math.min(this._smallestRectWidth,i.width),this._minWidth=Math.max(this._minWidth,i.width),this._minHeight=Math.max(this._minHeight,i.height),this._smallestRectHeight=Math.min(this._smallestRectHeight,i.height),this._maxHeight+=i.height+this._nodeNodeSpacing;this._children.length>0&&(this._averageHeight=this._maxHeight/this._children.length-this._nodeNodeSpacing*((this._children.length-1)/this._children.length)),this._parentRow.notifyAboutNodeChange()}expand(t,e){let o=this._width+t;this._width+=t,this._height+=e;let r=e/this._rows.length,i=0;for(let s of this._rows)s.expand(o,r,i),i++}getWidth(){return this._width}setWidth(t){this._width=t}getHeight(){return this._height}setHeight(t){this._height=t}getChildren(){return this._children}getX(){return this._x}getY(){return this._y}getParentRow(){return this._parentRow}setParentRow(t){this._parentRow=t}getMinWidth(){return this._minWidth}getMinHeight(){return this._minHeight}getMaxHeight(){return this._maxHeight}getSmallestRectHeight(){return this._smallestRectHeight}getSmallestRectWidth(){return this._smallestRectWidth}setSmallestRectWidth(t){this._smallestRectWidth=t}getAverageHeight(){return this._averageHeight}isFixed(){return this._fixed}setFixed(t){this._fixed=t}isPositionFixed(){return this._positionFixed}setPositionFixed(t){this._positionFixed=t}getRows(){return this._rows}getLastRow(){return this._rows[this._rows.length-1]}getLastRowNewX(){let t=this.getLastRow();return t.getX()+t.getWidth()}getLastRowY(){return this.getLastRow().getY()}getStack(){return this._stack}setStack(t){this._stack=t}resetBlock(){this._adjustSizeAfterRemove()}};var xi=class{constructor(t,e,o){this._blocks=[],this._x=t,this._y=e,this._width=0,this._height=0,this._nodeNodeSpacing=o}addBlock(t){t.setStack(this),this._width=Math.max(this._width,t.getWidth()),this._height+=t.getHeight()+(this._blocks.length===0?0:this._nodeNodeSpacing),this._blocks.push(t)}updateDimension(){let t=0,e=0,o=0;for(let r of this._blocks)e=Math.max(e,r.getWidth()),t+=r.getHeight()+(o>0?this._nodeNodeSpacing:0),o++;this._height=t,this._width=e}setLocation(t,e){let o=t-this._x,r=e-this._y;for(let i of this._blocks)i.setLocation(i.getX()+o,i.getY()+r);this._x=t,this._y=e}getWidthForFixedHeight(t){if(this._blocks.length===1)return this._blocks[0].getWidthForTargetHeight(t);let e=this._getMinimumWidth(),o=0,r=this._width,i=e,s=this._width,a=(r-i)/2+i;for(;i+1<r;){o=0;for(let l of this._blocks)o+=l.getHeightForTargetWidth(a);o<t?(s=a,r=a):i=a,a=(r-i)/2+i}return s}placeRectsIn(t){let e=this._y,o=0,r=0;for(let i of this._blocks)i.setLocation(this._x,e),i.placeRectsIn(t),r=Math.max(r,i.getWidth()),e+=i.getHeight()+this._nodeNodeSpacing,o=e;this._width=r,this._height=o}expand(t,e){let o=e/this._blocks.length,r=0;for(let i of this._blocks)i.setLocation(i.getX(),i.getY()+r*o),i.expand(this.getWidth()-i.getWidth()+t,o),r++}_getMinimumWidth(){let t=0;for(let e of this._blocks)t=Math.max(t,e.getMinWidth());return t}getBlocks(){return this._blocks}getX(){return this._x}getY(){return this._y}getWidth(){return this._width}setWidth(t){this._width=t}getHeight(){return this._height}setHeight(t){this._height=t}};var Wa=class{constructor(t,e){this._height=0,this._width=0,this._y=t,this._nodeNodeSpacing=e,this._children=[],this._stacks=[],this._potentialAdditionalWidthToGetLastBlock=0}notifyAboutNodeChange(){let t=0,e=Number.NEGATIVE_INFINITY,o=0;for(let r of this._children)t+=r.getWidth()+(o>0?this._nodeNodeSpacing:0),e=Math.max(e,r.getHeight()),o++;this._width=t,this._height=e}expand(t,e){let r=(t-this._width)/this._stacks.length,i=0;for(let s of this._stacks){let a=this.getHeight()-s.getHeight()+e;s.setLocation(s.getX()+i*r,s.getY()),s.expand(r,a),i++}}calculateBlockStacks(){let t=-1;for(let e of this._children)if(e.getX()!==t){let o=new xi(e.getX(),this._y,this._nodeNodeSpacing);this._stacks.push(o),o.addBlock(e),t=e.getX()}else this._stacks[this._stacks.length-1].addBlock(e)}getFirstBlock(){return this._children[0]}getLastBlock(){return this._children[this._children.length-1]}getNumberOfAssignedBlocks(){return this._children.length}addBlock(t){this._height=Math.max(this._height,t.getHeight()),this._width+=t.getWidth()+(this._children.length===0?0:this._nodeNodeSpacing),this._children.push(t)}removeBlock(t){let e=this._children.indexOf(t);e>=0&&this._children.splice(e,1),this._width-=t.getWidth()+(this._children.length===0?0:this._nodeNodeSpacing);let o=Number.MIN_VALUE;for(let r of this._children)o=Math.max(o,r.getHeight());this._height=o}getHeight(){return this._height}setHeight(t){this._height=t}getWidth(){return this._width}setWidth(t){this._width=t}getY(){return this._y}setY(t){let e=t-this._y;for(let o of this._stacks)o.setLocation(o.getX(),o.getY()+e);this._y=t}getChildren(){return this._children}getStacks(){return this._stacks}getPotentialAdditionalWidthToGetLastBlock(){return this._potentialAdditionalWidthToGetLastBlock}setPotentialAdditionalWidthToGetLastBlock(t){this._potentialAdditionalWidthToGetLastBlock=t}resetStacks(){this._stacks=[]}};var Di=class n{static place(t,e,o){let r=[],i=new Wa(0,o),s=0;i.addBlock(new cn(0,0,i,o));let a=0;for(let l of t){let c=i.getLastBlock();if((a+l.width+(i.getChildren()[0].getChildren().length===0?0:o)>e||l.getProperty(gn))&&(a=0,s+=i.getHeight()+o,r.push(i),i=new Wa(s,o),c=new cn(0,i.getY(),i,o),i.addBlock(c),a=0),c.getChildren().length===0||!l.parent.getProperty(Zc)&&n.isSimilarHeight(c,l,o))c.addChild(l);else{let h=new cn(c.getX()+c.getWidth()+o,i.getY(),i,o);i.addBlock(h),h.addChild(l)}a=l.x+l.width}return r.push(i),r}static placeRectInBlock(t,e,o,r,i){if(n.isSimilarHeight(e,o,i)){if(e.getLastRowNewX()+o.width+i<=r&&(e.getLastRowY()-t.getY()+o.height<=t.getHeight()||t.getChildren().length===1))return e.addChild(o),!0;if(e.getX()+o.width<=r&&e.getY()+e.getHeight()+o.height+i<=t.getY()+t.getHeight())return e.addChildInNewRow(o),!0}return!1}static isSimilarHeight(t,e,o){return e.height>=t.getSmallestRectHeight()&&e.height<=t.getMinHeight()?!0:t.getAverageHeight()*.5<=e.height&&t.getAverageHeight()*1.5>=e.height}};var jc=class n{static compact(t,e,o,r,i){let s=!1,a=!1,l=t+1,c=e[t],g=c.getChildren(),h=null;for(let d=0;d<c.getNumberOfAssignedBlocks();d++){let f=g[d];if(f.isFixed())continue;if(f.getChildren().length===0){c.removeBlock(f),d--,s=!0;continue}if(!f.isPositionFixed()){h!=null&&h.updateDimension();let S=h==null?0:h.getX()+h.getWidth()+r;h=new xi(S,c.getY(),r),f.setLocation(h.getX()+h.getWidth(),c.getY()),c.getStacks().push(h),h.addBlock(f),f.setPositionFixed(!0)}let E=n._getNextBlock(e,c,d,l),P=!1;if(E!=null&&(P=E.getParentRow()!==c),E!=null){if(E.getChildren().length>0&&!E.getChildren()[0].getProperty(gn))n._useRowWidth(f,o),n._absorbBlocks(c,f,E,o,r)&&(s=!0);else{c.removeBlock(E);break}if(E.getChildren().length===0)for(e.length>l&&e[l].removeBlock(E),E=null;e.length>l&&e[l].getChildren().length===0;)e.splice(l,1);if(E==null){d--;continue}if(!E.getChildren()[0].getProperty(gn)&&n._placeBelow(e,c,f,E,P,o,l,r)){s=!0;continue}if(P){let S=c.getHeight(),T=E.getMinHeight();if(!E.getChildren()[0].getProperty(gn)&&n._placeBeside(e,c,f,E,P,o,l,r,i)){if(s=!0,S<T){a=!0,E.setParentRow(c);break}continue}if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0;continue}}else if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0;continue}if(s)continue}if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0,E!=null&&E.setPositionFixed(!1);continue}else f.getStack().updateDimension()}return Gt.of(s,a)}static _getNextBlock(t,e,o,r){return o<e.getNumberOfAssignedBlocks()-1?e.getChildren()[o+1]:r<t.length&&t[r].getChildren().length>0?t[r].getChildren()[0]:null}static _useRowHeight(t,e){let o=!1,r=e.getStack().getWidth();if(e.getHeight()<t.getHeight()){let i=e.getStack().getWidthForFixedHeight(t.getHeight());e.getStack().getWidth()>i&&(e.getStack().placeRectsIn(i),o=r!==e.getStack().getWidth())}return o}static _useRowWidth(t,e){t.placeRectsIn(e-t.getX()),t.getStack().updateDimension()}static _absorbBlocks(t,e,o,r,i){let s=!1,a=o.getChildren()[0];for(;Di.placeRectInBlock(t,e,a,r,i)&&(s=!0,o.removeChild(a),o.getChildren().length!==0);)a=o.getChildren()[0];return o.getChildren().length===0&&o.getParentRow().removeBlock(o),s&&e.getStack().updateDimension(),s}static _placeBelow(t,e,o,r,i,s,a,l){let c=!1,g=s-o.getX(),h=o.getY()-e.getY()+o.getHeightForTargetWidth(g);if(r.getMinWidth()+l>g)return!1;let d=r.getHeightForTargetWidth(g);return h+l+d<=e.getHeight()&&(o.placeRectsIn(s-o.getX()),o.setFixed(!0),r.placeRectsIn(s-o.getX()),r.setLocation(o.getX(),o.getY()+o.getHeight()+l),r.setPositionFixed(!0),o.getStack().addBlock(r),c=!0,i&&(e.addBlock(r),r.setParentRow(e),t.length>a&&(t[a].removeBlock(r),t[a].getChildren().length===0&&t.splice(a,1)))),c}static _placeBeside(t,e,o,r,i,s,a,l,c){let g=!1,h=o.getStack().getWidthForFixedHeight(e.getY()+e.getHeight()-o.getStack().getY()),d=r.getMinHeight()>e.getHeight()&&c,f=s-(o.getStack().getX()+h-l),E=r.getHeightForTargetWidth(f);if(d&&E>r.getMinHeight())return!1;if(d){let S=0;for(let T of e.getStacks())S+=T.getWidthForFixedHeight(r.getMinHeight())+l;f=s-S}if(f<r.getMinWidth())return!1;let P=a===t.length-1&&f>=t[a].getWidth();return!d&&E>e.getHeight()&&!P?!1:((P||d||E<=e.getHeight())&&(P&&E>e.getHeight()?(o.setHeight(E),o.placeRectsIn(o.getWidthForTargetHeight(E))):(o.getStack().placeRectsIn(h),o.setFixed(!0)),r.placeRectsIn(s-(o.getX()+o.getWidth())),r.setLocation(o.getStack().getX()+o.getStack().getWidth(),e.getY()),e.addBlock(r),t.length>a&&(t[a].removeBlock(r),t[a].getChildren().length===0&&t.splice(a,1)),g=!0),g)}};var za=class{constructor(t,e){this._aspectRatio=t,this._nodeNodeSpacing=e,this.potentialRowWidthDecreaseMin=Number.POSITIVE_INFINITY,this.potentialRowWidthDecreaseMax=0,this.potentialRowWidthIncreaseMin=Number.POSITIVE_INFINITY,this.potentialRowWidthIncreaseMax=0}start(t,e,o,r){let i=o.getProperty($.TARGET_WIDTH),s=o.getProperty($.MIN_WIDTH),a=o.getProperty($.MIN_HEIGHT);Be.resetCoordinates(o.children);let l=Di.place(o.children,i,this._nodeNodeSpacing);for(let f=0;f<l.length;f++){let E=l[f];if(f!==0){let S=l[f-1];E.setY(S.getY()+S.getHeight()+this._nodeNodeSpacing)}if(jc.compact(f,l,i,this._nodeNodeSpacing,o.getProperty(Zc)).getSecond()){for(let S of E.getChildren())S.setFixed(!1),S.setPositionFixed(!1),S.resetBlock();E.resetStacks(),E.setWidth(i),f--}else{if(this._adjustWidthAndHeight(E),f+1<l.length){let S=l[f+1].getFirstBlock(),T=E.getWidth()+this._nodeNodeSpacing+S.getWidth()-i;if(this.potentialRowWidthIncreaseMax=Math.max(T,this.potentialRowWidthDecreaseMax),this.potentialRowWidthIncreaseMin=Math.min(T,this.potentialRowWidthDecreaseMin),E.getStacks().length!==0){let N=E.getStacks()[E.getStacks().length-1],I=E.getStacks().length<=1?0:this._nodeNodeSpacing;this.potentialRowWidthDecreaseMax=Math.max(this.potentialRowWidthDecreaseMax,N.getWidth()+I),this.potentialRowWidthDecreaseMin=Math.min(this.potentialRowWidthDecreaseMax,N.getWidth()+I)}}if(l.length===1){let S=E.getStacks()[E.getStacks().length-1],T=S.getBlocks()[S.getBlocks().length-1];for(let N of T.getRows())this.potentialRowWidthDecreaseMax=Math.max(this.potentialRowWidthDecreaseMax,T.getWidth()-N.getWidth()),this.potentialRowWidthDecreaseMin=Math.min(this.potentialRowWidthDecreaseMin,T.getWidth()-N.getWidth()),this.potentialRowWidthIncreaseMax=Math.max(this.potentialRowWidthIncreaseMax,N.getWidth()+this._nodeNodeSpacing),this.potentialRowWidthIncreaseMin=Math.min(this.potentialRowWidthIncreaseMin,N.getWidth()+this._nodeNodeSpacing)}}}let c=Be.calculateDimensions(l,this._nodeNodeSpacing),g=Math.max(c.x,s-r.getHorizontal()),d=Math.max(c.y,a-r.getVertical())-c.y;return o.setProperty($.ADDITIONAL_HEIGHT,d),o.setProperty($.ROWS,l),new Ss(this._aspectRatio,g,c.y+d,Ot.WHOLE_DRAWING)}_adjustWidthAndHeight(t){let e=0,o=0,r=0;for(let i of t.getStacks())i.updateDimension(),e=Math.max(e,i.getHeight()),o+=i.getWidth()+(r>0?this._nodeNodeSpacing:0),r++;t.setHeight(e),t.setWidth(o)}};var _r=new m("org.eclipse.elk.padding",new yt(15)),Cr=new m("org.eclipse.elk.spacing.nodeNode",15,0),Ns=new m("org.eclipse.elk.aspectRatio",1.3),BE=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1);var $c=class{process(t,e){e.begin("Compaction",1);let o=t.children,r=t.getProperty(Ns),i=t.getProperty(Cr),s=t.getProperty(_r),a=new za(r,i),l=a.start(o,e,t,s);this._copyRowWidthChangeValues(t,a);let c=t.getProperty(UE);for(;c>1;){let g=this._clone(t),h=l.getScaleMeasure();this._configureSecondIteration(t,g,l),a=new za(r,i);let d=a.start(o,e,g,s),f=d.getScaleMeasure();if(f>=h&&Number.isFinite(f)){for(let E=0;E<g.children.length;E++)this._copyPosition(g.children[E],t.children[E]);this._copyRowWidthChangeValues(t,a),l.setDrawingWidth(d.getDrawingWidth()),l.setDrawingHeight(d.getDrawingHeight())}c--}t.setProperty($.DRAWING_HEIGHT,l.getDrawingHeight()),t.setProperty($.DRAWING_WIDTH,l.getDrawingWidth()),e.done()}_copyRowWidthChangeValues(t,e){t.setProperty($.MIN_ROW_INCREASE,e.potentialRowWidthIncreaseMin),t.setProperty($.MAX_ROW_INCREASE,e.potentialRowWidthIncreaseMax),t.setProperty($.MIN_ROW_DECREASE,e.potentialRowWidthDecreaseMin),t.setProperty($.MAX_ROW_DECREASE,e.potentialRowWidthDecreaseMax)}_configureSecondIteration(t,e,o){let r=t.getProperty(_r),i=t.getProperty(Ns);t.children.length>1&&t.getProperty($.MIN_ROW_INCREASE)!==Number.POSITIVE_INFINITY&&(o.getDrawingWidth()+r.getHorizontal())/(o.getDrawingHeight()+r.getVertical())<i?e.setProperty($.TARGET_WIDTH,t.getProperty($.TARGET_WIDTH)+t.getProperty($.MIN_ROW_INCREASE)):t.children.length>1&&t.getProperty($.MIN_ROW_DECREASE)!==Number.POSITIVE_INFINITY&&(o.getDrawingWidth()+r.getHorizontal())/(o.getDrawingHeight()+r.getVertical())>i&&e.setProperty($.TARGET_WIDTH,Math.max(t.getProperty($.MIN_WIDTH),e.getProperty($.TARGET_WIDTH)-t.getProperty($.MIN_ROW_DECREASE)))}_clone(t){let e=Oa();typeof t.copyProperties=="function"&&e.copyProperties(t);for(let o of t.children){let r=Fs(e);r.width=o.width,r.height=o.height,r.identifier=o.identifier,r.x=o.x,r.y=o.y,typeof r.copyProperties=="function"&&r.copyProperties(o)}return e}_copyPosition(t,e){e.width=t.width,e.height=t.height,e.x=t.x,e.y=t.y;for(let o=0;o<t.children.length;o++)this._copyPosition(t.children[o],e.children[o])}getLayoutProcessorConfiguration(){return null}};var qc=class{process(t,e){e.begin("Simple Placement",1);let o=t.getProperty($.TARGET_WIDTH),r=t.getProperty(Cr),i=t.getProperty(_r);Be.resetCoordinates(t.children);let s=Di.place(t.children,o,r),a,l=t.children;if(s==null)a=Be.calculateDimensionsOfRectangles(l);else{for(let d of s)for(let f of d.getChildren()){let E=new xi(f.getX(),f.getY(),r);E.addBlock(f),d.getStacks().push(E)}a=Be.calculateDimensions(s,r)}let c=Math.max(a.x,t.getProperty($.MIN_WIDTH)-i.getHorizontal()),g=Math.max(a.y,t.getProperty($.MIN_HEIGHT)-i.getVertical()),h=g-a.y;t.setProperty($.ADDITIONAL_HEIGHT,h),t.setProperty($.DRAWING_WIDTH,c),t.setProperty($.DRAWING_HEIGHT,g+h),t.setProperty($.ROWS,s),e.done()}getLayoutProcessorConfiguration(){return null}};var Jc=class{process(t,e){e.begin("No Compaction",1);let o=t.getProperty(_r),r=t.children,i=Be.calculateDimensionsOfRectangles(r),s=Math.max(i.x,t.getProperty($.MIN_WIDTH)-o.getHorizontal()),a=Math.max(i.y,t.getProperty($.MIN_HEIGHT)-o.getVertical()),l=a-i.y;t.setProperty($.ADDITIONAL_HEIGHT,l),t.setProperty($.DRAWING_WIDTH,s),t.setProperty($.DRAWING_HEIGHT,a+l),e.done()}getLayoutProcessorConfiguration(){return null}};var xr=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.COMPACTION:return new $c;case n.SIMPLE:return new qc;case n.NONE:return new Jc;default:return null}}};xr.COMPACTION=new xr("COMPACTION",0);xr.SIMPLE=new xr("SIMPLE",1);xr.NONE=new xr("NONE",2);var Qc=class{static expand(t,e,o,r){let i=o/t.length,s=0;for(let a of t)a.setY(a.getY()+i*s),a.expand(e,i),s++}};var hn=class{process(t,e){if(e.begin("Equal Whitespace Eliminator",1),t.hasProperty($.ROWS))Qc.expand(t.getProperty($.ROWS),t.getProperty($.DRAWING_WIDTH),t.getProperty($.ADDITIONAL_HEIGHT),t.getProperty(Cr));else throw new Error("The graph does not contain rows.");e.done()}getLayoutProcessorConfiguration(){return null}};var tg=class extends hn{process(t,e){e.begin("To Aspect Ratio Whitespace Eliminator",1);let o=t.getProperty($.DRAWING_WIDTH),r=t.getProperty($.DRAWING_HEIGHT),i=t.getProperty(Ns),s=t.getProperty($.ADDITIONAL_HEIGHT);o/r<i?(o=r*i,t.setProperty($.DRAWING_WIDTH,o)):(s+=o/i-r,t.setProperty($.ADDITIONAL_HEIGHT,s),t.setProperty($.DRAWING_HEIGHT,r+s)),super.process(t,e),e.done()}};var Dr=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.EQUAL_BETWEEN_STRUCTURES:return new hn;case n.TO_ASPECT_RATIO:return new tg;case n.NONE:default:return null}}};Dr.EQUAL_BETWEEN_STRUCTURES=new Dr("EQUAL_BETWEEN_STRUCTURES",0);Dr.TO_ASPECT_RATIO=new Dr("TO_ASPECT_RATIO",1);Dr.NONE=new Dr("NONE",2);var pr=class n{static getWidthLPRorLPB(t,e,o){return Math.max(t,e+o)}static getHeightLPRorLPB(t,e,o){return Math.max(t,e+o)}static calculateYforLPR(t,e,o,r){let i=null,s=0;for(let a of e)if(n._verticalOrderConstraint(a,t,r)){if(i==null)i=a;else{let l=a.y+a.height;o.y-l<o.y-s&&(i=a)}s=i.y+i.height}return i==null?0:s+r}static calculateXforLPB(t,e,o,r){let i=null,s=0;for(let a of e)if(n._horizontalOrderConstraint(a,t,r)){if(i==null)i=a;else{let l=a.x+a.width;o.x-l<o.x-s&&(i=a)}s=i.x+i.width}return i==null?0:s+r}static calculateAreaLPR(t,e,o){let r=t.y+t.height,i=o.getNextYcoordinate()+e.height,a=Math.max(r,i)-Math.min(t.y,o.getNextYcoordinate());return(o.getNextXcoordinate()+e.width-t.x)*a}static calculateAreaLPB(t,e,o){let r=t.x+t.width,i=o.getNextXcoordinate()+e.width,a=Math.max(r,i)-Math.min(t.x,o.getNextXcoordinate()),l=o.getNextYcoordinate()+e.height-t.y;return a*l}static _verticalOrderConstraint(t,e,o){return e<t.x+t.width+o}static _horizontalOrderConstraint(t,e,o){return e<t.y+t.height+o}};var dn=class{filterList(t,e,o){let r=Number.NEGATIVE_INFINITY;for(let s of t){let a=Be.computeScaleMeasure(s.getDrawingWidth()+o.getHorizontal(),s.getDrawingHeight()+o.getVertical(),s.getDesiredAspectRatio());a>r&&(r=a)}let i=[];for(let s of t)Be.computeScaleMeasure(s.getDrawingWidth()+o.getHorizontal(),s.getDrawingHeight()+o.getVertical(),s.getDesiredAspectRatio())===r&&i.push(s);return i}};var fn=class{filterList(t,e,o){let r=Number.POSITIVE_INFINITY;for(let s of t){let a=(s.getDrawingWidth()+o.getHorizontal())*(s.getDrawingHeight()+o.getVertical());a<r&&(r=a)}let i=[];for(let s of t)(s.getDrawingWidth()+o.getHorizontal())*(s.getDrawingHeight()+o.getVertical())===r&&i.push(s);return i}};var un=class{filterList(t,e,o){let r=Number.POSITIVE_INFINITY;for(let s of t){let a=Math.abs((s.getDrawingWidth()+o.getHorizontal())/(s.getDrawingHeight()+o.getVertical())-e);a<r&&(r=a)}let i=[];for(let s of t)Math.abs((s.getDrawingWidth()+o.getHorizontal())/(s.getDrawingHeight()+o.getVertical())-e)===r&&i.push(s);return i}};var eg=class{constructor(t,e,o){this._aspectRatio=t,this._goal=e,this._lpShift=o}approxBoundingBox(t,e,o){let r=t[0];r.x=0,r.y=0;let i=[r],s=r,a=new Ss(this._aspectRatio,r.width,r.height,Ot.WHOLE_DRAWING);for(let l=1;l<t.length;l++){let c=t[l],g=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT,c,s,a,i,e),h=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW,c,s,a,i,e),d=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,c,s,a,i,e),f=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,c,s,a,i,e),E=this._findBestCandidate(g,h,d,f,c,s,o);c.x=E.getNextXcoordinate(),c.y=E.getNextYcoordinate(),E.setPlacementOption(Ot.WHOLE_DRAWING),a=E,s=c,i.push(c)}return a}_findBestCandidate(t,e,o,r,i,s,a){let l=[t,e,o,r],c;switch(this._goal){case Lo.MAX_SCALE_DRIVEN:c=[new dn,new fn,new un];break;case Lo.ASPECT_RATIO_DRIVEN:c=[new un,new fn,new dn];break;case Lo.AREA_DRIVEN:c=[new fn,new dn,new un];break;default:c=[]}for(let g of c)l.length>1&&(l=g.filterList(l,this._aspectRatio,a));return l.length===1?l[0]:l.length===2?this._checkSpecialCases(l[0],l[1],s,i):null}_checkSpecialCases(t,e,o,r){let i=t.getPlacementOption(),s=e.getPlacementOption(),a=i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW||i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,l=s===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW||s===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,c=i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,g=s===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||s===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,h=i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW,d=s===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||s===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW;if(a&&l)return i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW?t:e;if(c&&g)return i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT?t:e;if(h&&d){let f,E;i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT?(f=t,E=e):(f=e,E=t);let P=pr.calculateAreaLPR(o,r,f),S=pr.calculateAreaLPB(o,r,E);return P<=S?i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT?t:e:i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW?t:e}return t}_calcValuesForOpt(t,e,o,r,i,s){let a=0,l=0,c=r.getDrawingWidth(),g=r.getDrawingHeight(),h=e.height,d=e.width,f,E;switch(t){case Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT:a=o.x+o.width+s,this._lpShift?l=pr.calculateYforLPR(a,i,o,s):l=o.y,f=pr.getWidthLPRorLPB(c,a,d),E=pr.getHeightLPRorLPB(g,l,h);break;case Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW:l=o.y+o.height+s,this._lpShift?a=pr.calculateXforLPB(l,i,o,s):a=o.x,f=pr.getWidthLPRorLPB(c,a,d),E=pr.getHeightLPRorLPB(g,l,h);break;case Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT:a=c+s,l=0,f=c+s+d,E=Math.max(g,h);break;case Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW:a=0,l=g+s,f=Math.max(c,d),E=g+s+h;break;default:throw new Error("IllegalPlacementOption")}return new Ss(this._aspectRatio,f,E,t,a,l)}};var og=class{process(t,e){e.begin("Greedy Width Approximator",1);let o=t.getProperty(Ns),r=t.getProperty(_r),i=t.getProperty(FE),s=t.getProperty(kE),a=t.getProperty(Cr),l=t.children;Be.resetCoordinates(l);let g=new eg(o,i,s).approxBoundingBox(l,a,r);t.setProperty($.TARGET_WIDTH,g.getDrawingWidth()),e.done()}getLayoutProcessorConfiguration(){return null}};var rg=class{process(t,e){if(e.begin("Target Width Setter",1),t.hasProperty(Vu))t.setProperty($.TARGET_WIDTH,t.getProperty(Vu));else throw new Error("A target width has to be set if the TargetWidthWidthApproximator should be used.");e.done()}getLayoutProcessorConfiguration(){return null}};var Mi=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.GREEDY:return new og;case n.TARGET_WIDTH:return new rg;default:throw new Error(`WidthApproximationStrategy.${this}: no implementation available.`)}}};Mi.GREEDY=new Mi("GREEDY",0);Mi.TARGET_WIDTH=new Mi("TARGET_WIDTH",1);var WE=new m("org.eclipse.elk.rectpacking.widthApproximation.strategy",()=>Mi.GREEDY),Vu=new m("org.eclipse.elk.rectpacking.widthApproximation.targetWidth",-1),FE=new m("org.eclipse.elk.rectpacking.widthApproximation.optimizationGoal",()=>Lo.MAX_SCALE_DRIVEN),kE=new m("org.eclipse.elk.rectpacking.widthApproximation.lastPlaceShift",!0),zE=new m("org.eclipse.elk.rectpacking.packing.strategy",()=>xr.COMPACTION),Zc=new m("org.eclipse.elk.rectpacking.packing.compaction.rowHeightReevaluation",!1),UE=new m("org.eclipse.elk.rectpacking.packing.compaction.iterations",1,1),YE=new m("org.eclipse.elk.rectpacking.whiteSpaceElimination.strategy",()=>Dr.NONE),VE=new m("org.eclipse.elk.rectpacking.trybox",!1),XE=new m("org.eclipse.elk.rectpacking.currentPosition",-1,-1),Ya=new m("org.eclipse.elk.rectpacking.desiredPosition",-1,-1),gn=new m("org.eclipse.elk.rectpacking.inNewRow",!1),KE=new m("org.eclipse.elk.rectpacking.orderBySize",!1);var ig=class{static compare(t,e){return e.height-t.height}};var sg=class{process(t,e){e.begin("Node Size Reorderer",1),t.children.sort(ig.compare),e.done()}};var ng=class{process(t,e){e.begin("Interactive Node Reorderer",1);let o=t.children,r=[];for(let s of o)s.hasProperty(Ya)&&r.push(s);for(let s of r){let a=o.indexOf(s);a>=0&&o.splice(a,1)}r.sort((s,a)=>{let l=s.getProperty(Ya),c=a.getProperty(Ya);return l===c?-1:l-c});for(let s of r){let a=s.getProperty(Ya);a=Math.min(a,o.length),o.splice(a,0,s)}let i=0;for(let s of o)s.setProperty(XE,i),i++;e.done()}};var ag=class{process(t,e){e.begin("Min Size Preprocessing",1);let o=ya(t);t.setProperty($.MIN_WIDTH,o.x),t.setProperty($.MIN_HEIGHT,o.y),e.done()}};var lg=class{process(t,e){e.begin("Min Size Postprocessing",1),t.setProperty($.TARGET_WIDTH,Math.max(t.getProperty($.TARGET_WIDTH),t.getProperty($.MIN_WIDTH))),e.done()}};var xe=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NODE_SIZE_REORDERER:return new sg;case n.INTERACTIVE_NODE_REORDERER:return new ng;case n.MIN_SIZE_PRE_PROCESSOR:return new ag;case n.MIN_SIZE_POST_PROCESSOR:return new lg;default:throw new Error(`IntermediateProcessorStrategy.${this}: no implementation available.`)}}};xe.NODE_SIZE_REORDERER=new xe("NODE_SIZE_REORDERER",0);xe.INTERACTIVE_NODE_REORDERER=new xe("INTERACTIVE_NODE_REORDERER",1);xe.MIN_SIZE_PRE_PROCESSOR=new xe("MIN_SIZE_PRE_PROCESSOR",2);xe.MIN_SIZE_POST_PROCESSOR=new xe("MIN_SIZE_POST_PROCESSOR",3);xe.VALUES=[xe.NODE_SIZE_REORDERER,xe.INTERACTIVE_NODE_REORDERER,xe.MIN_SIZE_PRE_PROCESSOR,xe.MIN_SIZE_POST_PROCESSOR];var cg=class n extends de{constructor(){super(),this._algorithmAssembler=Io.create(Le.VALUES)}layout(t,e){e.begin("Rectangle Packing",1);let o=t.getProperty(_r),r=t.getProperty(BE),i=t.getProperty(Cr),s=t.getProperty(VE),a=t.children;t.getProperty(So)||Go.forGraph(t).execute();let l=!1;if(s&&a.length>=3){let d=a[0],f=a[1],E=0;for(;E+2<a.length;){let P=d;if(d=f,f=a[E+2],P.height>=d.height+f.height+i||f.height>=P.height+d.height+i){l=!0;break}E++}}else l=!0;if(!l){let d=a.length;for(let f of a)f.setProperty(mu,d),d--;new rs().layout(t,new Ie),e.done();return}let c=this._assembleAlgorithm(t);for(let d of c){if(typeof e.isCanceled=="function"&&e.isCanceled())return;let f=typeof e.subTask=="function"?e.subTask(1/c.length):e;d.process(t,f)}let g=0,h=0;for(let d of a)g=Math.max(g,d.x+d.width),h=Math.max(h,d.y+d.height);Vs(t,new O(t.getProperty($.DRAWING_WIDTH),t.getProperty($.DRAWING_HEIGHT)),new O(g,h)),n._applyPadding(a,o),r||Ae(t,t.getProperty($.DRAWING_WIDTH)+o.getHorizontal(),t.getProperty($.DRAWING_HEIGHT)+o.getVertical(),!1,!0),t.getProperty(So)||Go.forGraph(t).execute(),e.done()}static _applyPadding(t,e){for(let o of t)o.setLocation(o.x+e.getLeft(),o.y+e.getTop())}_assembleAlgorithm(t){return this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Le.P1_WIDTH_APPROXIMATION,t.getProperty(WE)),this._algorithmAssembler.setPhase(Le.P2_PACKING,t.getProperty(zE)),this._algorithmAssembler.setPhase(Le.P3_WHITESPACE_ELIMINATION,t.getProperty(YE)),this._algorithmAssembler.addProcessorConfiguration(this._getPhaseIndependentConfig(t)),this._algorithmAssembler.build(t)}_getPhaseIndependentConfig(t){let e=K.create();return e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.MIN_SIZE_PRE_PROCESSOR),e.addBefore(Le.P2_PACKING,xe.MIN_SIZE_POST_PROCESSOR),t.getProperty(KE)&&e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.NODE_SIZE_REORDERER),t.getProperty(zo)&&e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.INTERACTIVE_NODE_REORDERER),e}};var ZE="org.eclipse.elk.rectpacking",jE=!1;function $E(){let n=Ht.getInstance(),t=n.getAlgorithmData(ZE);if(t)return jE=!0,t;let e=new Se.Builder().id(ZE).name("ELK Rectpacking").description("Rectangle packing layout.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.rectpacking").providerFactory(()=>new cg).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),jE=!0,e}var Zo=class{static execute(t,e,o){let r=[...t],i;typeof o=="function"?i=[o]:o!=null&&typeof o.handle=="function"?i=[o]:i=[...o],r.sort(e);for(let s of r)for(let a of i)typeof a=="function"?a(s):a.handle(s)}};var ee=class{};ee.FUZZINESS=1e-4;ee.DEBUG_SVG=new m("debugSVG",!1);ee.OVERLAPS_EXISTED=new m("overlapsExisted",!0);function qE(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var gg=class{constructor(t,e){this.node=t,this.low=e}},Xu=class n{constructor(){this._items=[]}static _compare(t,e){let o=t.rect.x-e.rect.x;return o!==0||(o=t.originalVertex.x-e.originalVertex.x,o!==0)?o:t.originalVertex.y-e.originalVertex.y}add(t){for(let e=0;e<this._items.length;e++){let o=n._compare(this._items[e],t);if(o===0)return!1;if(o>0)return this._items.splice(e,0,t),!0}return this._items.push(t),!0}remove(t){let e=this._items.indexOf(t);return e>=0?(this._items.splice(e,1),!0):!1}clear(){this._items.length=0}[Symbol.iterator](){return this._items[Symbol.iterator]()}},hg=class n{constructor(t,e){this._overlapHandler=t}_applyHandler(t,e){typeof this._overlapHandler=="function"?this._overlapHandler(t,e):this._overlapHandler.handle(t,e)}sweep(t){let e=[];for(let r of t)e.push(new gg(r,!0)),e.push(new gg(r,!1));let o=new Ku(this);o.init(),Zo.execute(e,n._compareTimestamps,o)}static _compareTimestamps(t,e){let o=t.node.rect.y;t.low||(o+=t.node.rect.height);let r=e.node.rect.y;e.low||(r+=e.node.rect.height);let i=o-r;if(i===0){if(!t.low&&e.low)return-1;if(!e.low&&t.low)return 1}return i}},Ku=class{constructor(t){this._owner=t,this._intervalsSortLeft=new Xu}init(){this._intervalsSortLeft.clear()}handle(t){t.low?this._insert(t):this._delete(t)}_insert(t){if(!this._intervalsSortLeft.add(t.node))throw new Error("Invalid hitboxes for scanline overlap calculation.");let o=!1;for(let r of this._intervalsSortLeft)if(this._overlap(t.node,r))this._owner._applyHandler(t.node,r),o=!0;else if(o)break}_delete(t){this._intervalsSortLeft.remove(t.node)}_overlap(t,e){if(t==null||e==null||t===e)return!1;let o=ee.FUZZINESS;return qE(t.rect.x,e.rect.x+e.rect.width,o)<0&&qE(e.rect.x,t.rect.x+t.rect.width,o)<0}};var Ue=class n{constructor(t,e){this.u=t,this.v=e}equals(t){return t instanceof n?dg(this.u,t.u)&&dg(this.v,t.v)||dg(this.u,t.v)&&dg(this.v,t.u):!1}};function dg(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):n.x===t.x&&n.y===t.y}var fg=class{constructor(t){this._spacing=20,this._viewBoxX=Number.POSITIVE_INFINITY,this._viewBoxY=Number.POSITIVE_INFINITY,this._viewBoxW=0,this._viewBoxH=0,this._viewBoxX2=Number.NEGATIVE_INFINITY,this._viewBoxY2=Number.NEGATIVE_INFINITY,this._enableUpdateViewBox=!0,this._current="main",this._groups=new Map,this.fileName=null,this._index=0,this.debug=!1,this.maxArea=8294400,t!=null&&t.length>0&&!t.startsWith("null")&&(this.fileName=t,this.debug=!0),this._groups.set(this._current,"")}g(t){return this.debug&&(this._groups.has(t)||this._groups.set(t,""),this._current=t),this}addGroups(...t){if(this.debug)for(let e of t)this._groups.set(e,"")}clearGroup(t){this.debug&&this._groups.has(t)&&this._groups.set(t,"")}removeGroup(t){this.debug&&(t==="main"?this.clearGroup(t):this._groups.delete(t))}setViewBox(t,e,o,r){this.debug&&(this._viewBoxX=t,this._viewBoxY=e,this._viewBoxW=o,this._viewBoxH=r,this._enableUpdateViewBox=!1)}clear(){this.debug=this.fileName!=null&&this.fileName.length>0,this.debug&&(this._groups.clear(),this._current="main",this._groups.set(this._current,""),this._enableUpdateViewBox&&(this._viewBoxX=Number.POSITIVE_INFINITY,this._viewBoxY=Number.POSITIVE_INFINITY,this._viewBoxW=0,this._viewBoxH=0,this._viewBoxX2=Number.NEGATIVE_INFINITY,this._viewBoxY2=Number.NEGATIVE_INFINITY))}addElementStr(t){if(this.debug){let e=this._groups.get(this._current)||"";this._groups.set(this._current,e+t+`
+`);)o--;if(e>=o)throw new Error("The given string does not contain any numbers.");let r=t.substring(e,o).split(/,|;|\r|\n/);if(r.length!==2)throw new Error(`Exactly two numbers are expected, ${r.length} were found.`);if(this.x=parseFloat(r[0].trim()),this.y=parseFloat(r[1].trim()),isNaN(this.x)||isNaN(this.y))throw new Error("The given string contains parts that cannot be parsed as numbers.")}static _isdelim(t,e){return e.includes(t)}};Z(Sr,"DEFAULT_FUZZYNESS",.05);var O=Sr;var st=class n extends Array{constructor(...t){if(super(),t.length===1&&Array.isArray(t[0]))for(let e of t[0])this.push(e);else if(t.length>0)for(let e of t)this.push(e)}toString(){let t="(";for(let e=0;e<this.length;e++){let o=this[e];t+=`${o.x},${o.y}`,e<this.length-1&&(t+="; ")}return t+")"}clone(){return new n(this.toArray())}toArray(t=0){if(t<0||t>this.length)throw new RangeError("Index out of bounds");return Array.prototype.slice.call(this,t)}parse(t){let e=t.split(/,|;|\(|\)|\[|\]|\{|\}| |\t|\n/);this.length=0;let o=0,r=0,i=0,s=0;for(;o<e.length;){let a=e[o];if(a!=null&&a.trim().length>0){let l=parseFloat(a);if(isNaN(l))throw new Error("The given string does not match the expected format for vectors.");r%2===0?i=l:s=l,r>0&&r%2!==0&&this.push(new O(i,s)),r++}o++}}add(t,e){arguments.length===0?this.push(new O):arguments.length===2?typeof t=="number"&&typeof e=="object"?this.splice(t,0,e):this.push(new O(t,e)):this.push(t)}addFirst(t,e){arguments.length===0?this.unshift(new O):arguments.length===2?this.unshift(new O(t,e)):this.unshift(t)}addLast(t,e){arguments.length===0?this.push(new O):arguments.length===2?this.push(new O(t,e)):this.push(t)}getFirst(){return this[0]}getLast(){return this[this.length-1]}removeFirst(){return this.shift()}removeLast(){return this.pop()}size(){return this.length}get(t){return this[t]}remove(t){for(let e=0;e<this.length;e++){let o=this[e];if(o===t||typeof o.equals=="function"&&o.equals(t))return this.splice(e,1),!0}return!1}addAll(t,e){if(e!==void 0){let o=Array.isArray(e)?e:[...e];this.splice(t,0,...o)}else if(Array.isArray(t))for(let o of t)this.push(o);else for(let o of t)this.push(o)}addAllAsCopies(t,e){let o=[];for(let r of e)o.push(new O(r));this.splice(t,0,...o)}scale(t,e){for(let o of this)o.scale(t,e);return this}offset(t,e){if(typeof t=="object")for(let o of this)o.add(t);else for(let o of this)o.add(t,e);return this}offsetNonMutating(t){let e=new n;for(let o of this)e.push(O.sum(o,t));return e}totalLength(){let t=0;if(this.length>=2){let e=this[0];for(let o=1;o<this.length;o++){let r=this[o];t+=e.distance(r),e=r}}return t}hasNaN(){for(let t of this)if(t.isNaN())return!0;return!1}hasInfinite(){for(let t of this)if(t.isInfinite())return!0;return!1}pointOnLine(t){if(this.length>=2){let e=Math.abs(t),o=0;if(t>=0){let r=this[0];for(let i=1;i<this.length;i++){let s=o,a=this[i],l=r.distance(a);if(l>0&&(o+=l,o>=e)){let c=(e-s)/l,g=a.clone().sub(r);return g.scale(c),g.add(r),g}r=a}return this[this.length-1]}else{let r=this[this.length-1];for(let i=this.length-2;i>=0;i--){let s=o,a=this[i],l=r.distance(a);if(l>0&&(o+=l,o>=e)){let c=(e-s)/l,g=a.clone().sub(r);return g.scale(c),g.add(r),g}r=a}return this[0]}}else{if(this.length===1)return this[0];throw new Error("Cannot determine a point on an empty vector chain.")}}angleOnLine(t){if(this.length>=2){let e=Math.abs(t),o=0;if(t>=0){let r,i=this[0];for(let s=1;s<this.length;s++){r=i,i=this[s];let a=r.distance(i);if(a>0&&(o+=a,o>=e))break}return i.clone().sub(r).toRadians()}else{let r,i=this[this.length-1];for(let s=this.length-2;s>=0;s--){r=i,i=this[s];let a=r.distance(i);if(a>0&&(o+=a,o>=e))break}return i.clone().sub(r).toRadians()}}else throw new Error("Need at least two points to determine an angle.")}static reverse(t){let e=new n;for(let o=t.length-1;o>=0;o--)e.push(new O(t[o]));return e}get(t){return this[t]}size(){return this.length}clear(){this.length=0}isEmpty(){return this.length===0}};var k=Object.freeze({H_LEFT:"H_LEFT",H_CENTER:"H_CENTER",H_RIGHT:"H_RIGHT",V_TOP:"V_TOP",V_CENTER:"V_CENTER",V_BOTTOM:"V_BOTTOM",INSIDE:"INSIDE",OUTSIDE:"OUTSIDE",H_PRIORITY:"H_PRIORITY",fixed(){return new Set},insideTopLeft(){return new Set([k.INSIDE,k.V_TOP,k.H_LEFT])},insideTopCenter(){return new Set([k.INSIDE,k.V_TOP,k.H_CENTER])},insideTopRight(){return new Set([k.INSIDE,k.V_TOP,k.H_RIGHT])},insideCenter(){return new Set([k.INSIDE,k.V_CENTER,k.H_CENTER])},insideBottomLeft(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_LEFT])},insideBottomCenter(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_CENTER])},insideBottomRight(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_RIGHT])},outsideTopLeft(){return new Set([k.OUTSIDE,k.V_TOP,k.H_LEFT])},outsideTopCenter(){return new Set([k.OUTSIDE,k.V_TOP,k.H_CENTER])},outsideTopRight(){return new Set([k.OUTSIDE,k.V_TOP,k.H_RIGHT])},outsideBottomLeft(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_LEFT])},outsideBottomCenter(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_CENTER])},outsideBottomRight(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_RIGHT])},isValid(n){return!([k.INSIDE,k.OUTSIDE].filter(r=>n.has(r)).length>1||[k.H_LEFT,k.H_CENTER,k.H_RIGHT].filter(r=>n.has(r)).length>1||[k.V_TOP,k.V_CENTER,k.V_BOTTOM].filter(r=>n.has(r)).length>1)},values(){return[this.H_LEFT,this.H_CENTER,this.H_RIGHT,this.V_TOP,this.V_CENTER,this.V_BOTTOM,this.INSIDE,this.OUTSIDE,this.H_PRIORITY]},valueOf(n){return this[n]},ensureSet(n){if(n instanceof Set)return n;if(n==null)return new Set;if(typeof n=="string"){let t=new Set;for(let e of n.split(/\s+/)){let o=e.trim();o&&k[o]!==void 0&&typeof k[o]=="string"&&t.add(k[o])}return t}return new Set}});var de=class{initialize(t){}dispose(){}layout(t,e){throw new Error(`${this.constructor.name}.layout() is not implemented`)}};var xp=new m("org.eclipse.elk.padding",new yt(15)),Dp=new m("org.eclipse.elk.spacing.nodeNode",15,0),Qf=new m("org.eclipse.elk.priority",0),tu=new m("org.eclipse.elk.aspectRatio",1.3,Xe.greaterThan(0));var dt=class n{constructor(t,e,o,r){arguments.length===0?(this.x=0,this.y=0,this.width=0,this.height=0):arguments.length===1?(this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height):(this.x=t,this.y=e,this.width=o,this.height=r)}setRect(t,e,o,r){this.x=t,this.y=e,this.width=o,this.height=r}getPosition(){return new O(this.x,this.y)}getTopLeft(){return new O(this.x,this.y)}getTopRight(){return new O(this.x+this.width,this.y)}getBottomLeft(){return new O(this.x,this.y+this.height)}getBottomRight(){return new O(this.x+this.width,this.y+this.height)}getCenter(){return new O(this.x+this.width/2,this.y+this.height/2)}union(t){let e=Math.min(this.x,t.x),o=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width),i=Math.max(this.y+this.height,t.y+t.height);if(r<e){let s=e;r=e}if(i<o){let s=o;i=o}this.setRect(e,o,r-e,i-o)}move(t){this.x+=t.x,this.y+=t.y}getMaxX(){return this.x+this.width}getMaxY(){return this.y+this.height}intersects(t){let e=this.x,o=this.y,r=this.x+this.width,i=this.y+this.height,s=t.x,a=t.y,l=t.x+t.width,c=t.y+t.height;return e<l&&r>s&&i>a&&o<c}equals(t){return t==null||!(t instanceof n)?!1:this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}toString(){return`Rect[x=${this.x},y=${this.y},w=${this.width},h=${this.height}]`}};var qt=class qt{constructor(t){this.name=t,Object.freeze(this)}isPosFixed(){return this===qt.FIXED_POS}isRatioFixed(){return this===qt.FIXED_RATIO}isOrderFixed(){return this===qt.FIXED_ORDER||this===qt.FIXED_RATIO||this===qt.FIXED_POS}isSideFixed(){return this!==qt.FREE&&this!==qt.UNDEFINED}toString(){return this.name}static values(){return[qt.UNDEFINED,qt.FREE,qt.FIXED_SIDE,qt.FIXED_ORDER,qt.FIXED_RATIO,qt.FIXED_POS]}static valueOf(t){return qt[t]}};Z(qt,"UNDEFINED",new qt("UNDEFINED")),Z(qt,"FREE",new qt("FREE")),Z(qt,"FIXED_SIDE",new qt("FIXED_SIDE")),Z(qt,"FIXED_ORDER",new qt("FIXED_ORDER")),Z(qt,"FIXED_RATIO",new qt("FIXED_RATIO")),Z(qt,"FIXED_POS",new qt("FIXED_POS"));var H=qt;var it=Object.freeze({OUTSIDE:"OUTSIDE",INSIDE:"INSIDE",NEXT_TO_PORT_IF_POSSIBLE:"NEXT_TO_PORT_IF_POSSIBLE",ALWAYS_SAME_SIDE:"ALWAYS_SAME_SIDE",ALWAYS_OTHER_SAME_SIDE:"ALWAYS_OTHER_SAME_SIDE",SPACE_EFFICIENT:"SPACE_EFFICIENT",fixed(){return new Set},inside(){return new Set([it.INSIDE])},outside(){return new Set([it.OUTSIDE])},isFixed(n){return!n.has(it.INSIDE)&&!n.has(it.OUTSIDE)},isValid(n){return!([it.INSIDE,it.OUTSIDE].filter(o=>n.has(o)).length>1||[it.ALWAYS_SAME_SIDE,it.ALWAYS_OTHER_SAME_SIDE,it.SPACE_EFFICIENT].filter(o=>n.has(o)).length>1)},values(){return[this.OUTSIDE,this.INSIDE,this.NEXT_TO_PORT_IF_POSSIBLE,this.ALWAYS_SAME_SIDE,this.ALWAYS_OTHER_SAME_SIDE,this.SPACE_EFFICIENT]},valueOf(n){return this[n]}});var q=class q{constructor(t){this.name=t,Object.freeze(this)}ordinal(){switch(this){case q.UNDEFINED:return 0;case q.NORTH:return 1;case q.EAST:return 2;case q.SOUTH:return 3;case q.WEST:return 4;default:return-1}}right(){switch(this){case q.NORTH:return q.EAST;case q.EAST:return q.SOUTH;case q.SOUTH:return q.WEST;case q.WEST:return q.NORTH;default:return q.UNDEFINED}}left(){switch(this){case q.NORTH:return q.WEST;case q.EAST:return q.NORTH;case q.SOUTH:return q.EAST;case q.WEST:return q.SOUTH;default:return q.UNDEFINED}}opposed(){switch(this){case q.NORTH:return q.SOUTH;case q.EAST:return q.WEST;case q.SOUTH:return q.NORTH;case q.WEST:return q.EAST;default:return q.UNDEFINED}}areAdjacent(t){return this===q.UNDEFINED?!1:this.left()===t||this.right()===t}static fromDirection(t){switch(t){case R.UP:return q.NORTH;case R.RIGHT:return q.EAST;case R.DOWN:return q.SOUTH;case R.LEFT:return q.WEST;default:return q.UNDEFINED}}static isVertical(t){return t===q.NORTH||t===q.SOUTH}static isHorizontal(t){return t===q.WEST||t===q.EAST}toString(){return this.name}static values(){return[q.UNDEFINED,q.NORTH,q.EAST,q.SOUTH,q.WEST]}static valueOf(t){return q[t]}};Z(q,"UNDEFINED",new q("UNDEFINED")),Z(q,"NORTH",new q("NORTH")),Z(q,"EAST",new q("EAST")),Z(q,"SOUTH",new q("SOUTH")),Z(q,"WEST",new q("WEST")),Z(q,"SIDES_NONE",new Set),Z(q,"SIDES_NORTH",null),Z(q,"SIDES_EAST",null),Z(q,"SIDES_SOUTH",null),Z(q,"SIDES_WEST",null),Z(q,"SIDES_NORTH_SOUTH",null),Z(q,"SIDES_EAST_WEST",null),Z(q,"SIDES_NORTH_WEST",null),Z(q,"SIDES_NORTH_EAST",null),Z(q,"SIDES_SOUTH_WEST",null),Z(q,"SIDES_EAST_SOUTH",null),Z(q,"SIDES_NORTH_EAST_WEST",null),Z(q,"SIDES_EAST_SOUTH_WEST",null),Z(q,"SIDES_NORTH_SOUTH_WEST",null),Z(q,"SIDES_NORTH_EAST_SOUTH",null),Z(q,"SIDES_NORTH_EAST_SOUTH_WEST",null);var u=q;u.SIDES_NORTH=Object.freeze(new Set([u.NORTH]));u.SIDES_EAST=Object.freeze(new Set([u.EAST]));u.SIDES_SOUTH=Object.freeze(new Set([u.SOUTH]));u.SIDES_WEST=Object.freeze(new Set([u.WEST]));u.SIDES_NORTH_SOUTH=Object.freeze(new Set([u.NORTH,u.SOUTH]));u.SIDES_EAST_WEST=Object.freeze(new Set([u.EAST,u.WEST]));u.SIDES_NORTH_WEST=Object.freeze(new Set([u.NORTH,u.WEST]));u.SIDES_NORTH_EAST=Object.freeze(new Set([u.NORTH,u.EAST]));u.SIDES_SOUTH_WEST=Object.freeze(new Set([u.SOUTH,u.WEST]));u.SIDES_EAST_SOUTH=Object.freeze(new Set([u.EAST,u.SOUTH]));u.SIDES_NORTH_EAST_WEST=Object.freeze(new Set([u.NORTH,u.EAST,u.WEST]));u.SIDES_EAST_SOUTH_WEST=Object.freeze(new Set([u.EAST,u.SOUTH,u.WEST]));u.SIDES_NORTH_SOUTH_WEST=Object.freeze(new Set([u.NORTH,u.SOUTH,u.WEST]));u.SIDES_NORTH_EAST_SOUTH=Object.freeze(new Set([u.NORTH,u.EAST,u.SOUTH]));u.SIDES_NORTH_EAST_SOUTH_WEST=Object.freeze(new Set([u.NORTH,u.EAST,u.SOUTH,u.WEST]));var HO=[u.SIDES_NONE,u.SIDES_NORTH,u.SIDES_EAST,u.SIDES_NORTH_EAST,u.SIDES_SOUTH,u.SIDES_NORTH_SOUTH,u.SIDES_EAST_SOUTH,u.SIDES_NORTH_EAST_SOUTH,u.SIDES_WEST,u.SIDES_NORTH_WEST,u.SIDES_EAST_WEST,u.SIDES_NORTH_EAST_WEST,u.SIDES_SOUTH_WEST,u.SIDES_NORTH_SOUTH_WEST,u.SIDES_EAST_SOUTH_WEST,u.SIDES_NORTH_EAST_SOUTH_WEST];u.sidesOf=function(t){let e=0;return t.has(u.NORTH)&&(e|=1),t.has(u.EAST)&&(e|=2),t.has(u.SOUTH)&&(e|=4),t.has(u.WEST)&&(e|=8),HO[e]};var mt=Object.freeze({PORTS:"PORTS",PORT_LABELS:"PORT_LABELS",NODE_LABELS:"NODE_LABELS",MINIMUM_SIZE:"MINIMUM_SIZE",fixed(){return new Set},minimumSize(){return new Set([mt.MINIMUM_SIZE])},minimumSizeWithPorts(){return new Set([mt.PORTS,mt.MINIMUM_SIZE])},free(){return new Set([mt.PORTS,mt.PORT_LABELS,mt.NODE_LABELS,mt.MINIMUM_SIZE])},values(){return[this.PORTS,this.PORT_LABELS,this.NODE_LABELS,this.MINIMUM_SIZE]},valueOf(n){return this[n]}});var Nt=Object.freeze({DEFAULT_MINIMUM_SIZE:"DEFAULT_MINIMUM_SIZE",MINIMUM_SIZE_ACCOUNTS_FOR_PADDING:"MINIMUM_SIZE_ACCOUNTS_FOR_PADDING",COMPUTE_PADDING:"COMPUTE_PADDING",OUTSIDE_NODE_LABELS_OVERHANG:"OUTSIDE_NODE_LABELS_OVERHANG",PORTS_OVERHANG:"PORTS_OVERHANG",UNIFORM_PORT_SPACING:"UNIFORM_PORT_SPACING",SPACE_EFFICIENT_PORT_LABELS:"SPACE_EFFICIENT_PORT_LABELS",FORCE_TABULAR_NODE_LABELS:"FORCE_TABULAR_NODE_LABELS",ASYMMETRICAL:"ASYMMETRICAL",valueOf(n){return typeof n=="number"?Nt.values()[n]:this[n]},values(){return[this.DEFAULT_MINIMUM_SIZE,this.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING,this.COMPUTE_PADDING,this.OUTSIDE_NODE_LABELS_OVERHANG,this.PORTS_OVERHANG,this.UNIFORM_PORT_SPACING,this.SPACE_EFFICIENT_PORT_LABELS,this.FORCE_TABULAR_NODE_LABELS,this.ASYMMETRICAL]}});var es=20,os=20;function bp(n,t){if(n.getParent()===null)throw new Error("port must have a parent node to calculate the port side");let e=n.getParent(),o=e.getWidth(),r=e.getHeight();if(o<=0&&r<=0)return u.UNDEFINED;let i=n.getX(),s=n.getY();if(t===R.LEFT||t===R.RIGHT){if(i<0)return u.WEST;if(i+n.getWidth()>o)return u.EAST}else if(t===R.UP||t===R.DOWN){if(s<0)return u.NORTH;if(s+n.getHeight()>r)return u.SOUTH}let a=(i+n.getWidth()/2)/o,l=(s+n.getHeight()/2)/r;return a+l<=1&&a-l<=0?u.WEST:a+l>=1&&a-l>=0?u.EAST:l<.5?u.NORTH:u.SOUTH}function eu(n,t){if(n.getParent()===null)throw new Error("port must have a parent node to calculate the port side");let e=n.getParent();switch(t){case u.NORTH:return-(n.getY()+n.getHeight());case u.EAST:return n.getX()-e.getWidth();case u.SOUTH:return n.getY()-e.getHeight();case u.WEST:return-(n.getX()+n.getWidth());default:return 0}}function ou(n){let t=n.getProperty(Mo);if(t.size===0)return null;let e=0,o=0;if(t.has(mt.PORTS)){let r=n.getProperty(cr),i=2,s=2,a=2,l=2,c=n.getParent()===null?n.getProperty(lr):n.getParent().getProperty(lr);for(let g of n.ports){let h=g.getProperty(Tr);if(h===u.UNDEFINED&&(h=bp(g,c),g.setProperty(Tr,h)),r===H.FIXED_POS)switch(h){case u.NORTH:i=Math.max(i,g.getX()+g.getWidth());break;case u.EAST:s=Math.max(s,g.getY()+g.getHeight());break;case u.SOUTH:a=Math.max(a,g.getX()+g.getWidth());break;case u.WEST:l=Math.max(l,g.getY()+g.getHeight());break}else switch(h){case u.NORTH:i+=g.getWidth()+2;break;case u.EAST:s+=g.getHeight()+2;break;case u.SOUTH:a+=g.getWidth()+2;break;case u.WEST:l+=g.getHeight()+2;break}}e=Math.max(i,a),o=Math.max(s,l)}return Ae(n,e,o,!0,!0)}function Ae(n,t,e,o,r){let i=new O(n.getWidth(),n.getHeight()),s=ya(n);s.x=Math.max(s.x,t),s.y=Math.max(s.y,e);let a=s.x/i.x,l=s.y/i.y,c=s.x-i.x,g=s.y-i.y;if(o){let h=n.getParent()===null?n.getProperty(lr):n.getParent().getProperty(lr),d=n.getProperty(cr)===H.FIXED_POS;for(let f of n.ports){let E=f.getProperty(Tr);switch(E===u.UNDEFINED&&(E=bp(f,h),f.setProperty(Tr,E)),E){case u.NORTH:d||f.setX(f.getX()*a);break;case u.EAST:f.setX(f.getX()+c),d||f.setY(f.getY()*l);break;case u.SOUTH:d||f.setX(f.getX()*a),f.setY(f.getY()+g);break;case u.WEST:d||f.setY(f.getY()*l);break}}}if(n.setDimensions(s.x,s.y),r)for(let h of n.labels){let d=h.getX()+h.getWidth()/2,f=h.getY()+h.getHeight()/2,E=d/i.x,P=f/i.y;E+P>=1&&(E-P>0&&f>=0?(h.setX(h.getX()+c),h.setY(h.getY()+g*P)):E-P<0&&d>=0&&(h.setX(h.getX()+c*E),h.setY(h.getY()+g)))}return n.setProperty(Mo,mt.fixed()),new O(a,l)}function ya(n){if(n.getProperty(Mo).has(mt.MINIMUM_SIZE)){let e=n.getProperty(Oo),o=new O(n.getProperty(Yo));return e.has(Nt.DEFAULT_MINIMUM_SIZE)&&(o.x<=0&&(o.x=es),o.y<=0&&(o.y=os)),o}return new O}function ru(n){let t=n.getProperty(lu);if(t===1)return;n.setDimensions(t*n.getWidth(),t*n.getHeight());let e=[];for(let r of n.ports)for(let i of r.labels)e.push(i);let o=[...n.labels,...n.ports,...e];for(let r of o){r.setLocation(t*r.getX(),t*r.getY()),r.setDimensions(t*r.getWidth(),t*r.getHeight());let i=r.getProperty(au);i!=null&&(i.x*=t,i.y*=t)}}function Gp(n){if(n.sections.length!==1)throw new Error("The edge needs to have exactly one edge section. Found: "+n.sections.length);let t=new st,e=yl(n.sources[0]);if(e!=null)for(let r of wp(n,e,!1))t.add(r);let o=yl(n.targets[0]);if(o!=null)for(let r of wp(n,o,!0))t.add(r);return t}function wp(n,t,e){let o=n.sections[0],r=new st,i=new Map,s=Mp(o);i.set(o,s);let a=new Map,l=[];for(let c of Ta(t)){if(c.sections.length!==1)throw new Error("The edge needs to have exactly one edge section. Found: "+c.sections.length);if(c!==n){let g=c.sections[0];l.push(g);let h=i.get(g);h||(h=Mp(g),i.set(g,h));let d=e?new O(s[s.length-1]).sub(h[h.length-1]):new O(s[0]).sub(h[0]);a.set(g,d)}}if(l.length>0){let c=s[e?s.length-1:0];for(let g=1;g<s.length;g++){let h=s[e?s.length-1-g:g];for(let d=l.length-1;d>=0;d--){let f=l[d],E=i.get(f);if(E.length<=g)l.splice(d,1);else{let P=new O(E[e?E.length-1-g:g]).add(a.get(f));if(h.x!==P.x||h.y!==P.y){let S=h.x-c.x,T=h.y-c.y,N=P.x-c.x,I=P.y-c.y;N*T===I*S&&Math.sign(S)===Math.sign(N)&&Math.sign(T)===Math.sign(I)?(Math.abs(S)<Math.abs(N)||Math.abs(T)<Math.abs(I))&&r.add(h):g>1&&r.add(c),l.splice(d,1)}}}c=h}}return r}function Mp(n){let t=[];t.push(new O(n.getStartX(),n.getStartY()));for(let o of n.getBendPoints())t.push(new O(o.getX(),o.getY()));t.push(new O(n.getEndX(),n.getEndY()));let e=1;for(;e<t.length-1;){let o=t[e-1],r=t[e],i=t[e+1];o.x===r.x&&r.x===i.x||o.y===r.y&&r.y===i.y?t.splice(e,1):e++}return t}function Ia(n){let t=null;for(let e of n.getLabels()){let o=new dt(e.getPosition().x,e.getPosition().y,e.getSize().x,e.getSize().y);t===null?t=o:t.union(o)}return t||new dt}function Hp(n,t){let e=Ia(n);return iu(new O(e.x,e.y),new O(e.width,e.height),n.getSize(),t,n.getSide())}function iu(n,t,e,o,r){switch(r){case u.NORTH:return Math.max(0,t.y+n.y-(e.y+o));case u.SOUTH:return Math.max(0,-n.y-o);case u.EAST:return Math.max(0,-n.x-o);case u.WEST:return Math.max(0,t.x+n.x-(e.x+o));default:return 0}}function Ra(n,t,e){for(let o of n.children)o.setLocation(o.getX()+t,o.getY()+e);for(let o of n.containedEdges)vO(o,t,e)}function vO(n,t,e){for(let r of n.sections)BO(r,t,e);for(let r of n.labels)r.setLocation(r.getX()+t,r.getY()+e);let o=n.getProperty(gr);o!=null&&o.offset(t,e)}function BO(n,t,e){n.setStartLocation(n.getStartX()+t,n.getStartY()+e);for(let o of n.getBendPoints())o.set(o.getX()+t,o.getY()+e);n.setEndLocation(n.getEndX()+t,n.getEndY()+e)}function Vs(n,t,e){let o=n.getProperty(Rl),r=0,i=0;t.x>e.x&&(o.has(he.H_CENTER)?r=(t.x-e.x)/2:o.has(he.H_RIGHT)&&(r=t.x-e.x)),t.y>e.y&&(o.has(he.V_CENTER)?i=(t.y-e.y)/2:o.has(he.V_BOTTOM)&&(i=t.y-e.y)),Ra(n,r,i)}function su(n,t){let e=t;for(;e!=null;)n.add(e.getX(),e.getY()),e=e.getParent();return n}function nu(n,t){let e=t;for(;e!=null;)n.add(-e.getX(),-e.getY()),e=e.getParent();return n}function Xs(n,t){if(n.size()<2)throw new Error("The vector chain must contain at least a source and a target point.");let e=n.getFirst();t.setStartLocation(e.x,e.y);let o=0,r=t.getBendPoints(),i=n.toArray();for(let a=1;a<i.length-1;a++){let l=i[a],c;o<r.length?c=r[o]:(c=new Xr,r.push(c)),c.set(l.x,l.y),o++}o<r.length&&r.splice(o,r.length-o);let s=n.getLast();t.setEndLocation(s.x,s.y)}function vp(n,...t){Bp(n,e=>{for(let o of t)o.visit(e)})}function Bp(n,t){t(n);for(let e of n.labels)t(e);for(let e of n.ports){t(e);for(let o of e.labels)t(o)}for(let e of n.containedEdges){t(e);for(let o of e.labels)t(o)}for(let e of n.children)Bp(e,t)}var Up=1.3,hr=Object.freeze({SIMPLE:"SIMPLE",GROUP_DEC:"GROUP_DEC",GROUP_MIXED:"GROUP_MIXED",GROUP_INC:"GROUP_INC",values(){return[hr.SIMPLE,hr.GROUP_DEC,hr.GROUP_MIXED,hr.GROUP_INC]},valueOf(n){return hr[n]}}),rs=class extends de{layout(t,e){e&&e.begin&&e.begin("Box layout",2);let o=t.getProperty(Dp),r=t.getProperty(xp),i=t.getProperty(Ll),s=t.getProperty(zo),a=t.getProperty(Il);a===hr.SIMPLE?this._placeBoxesSimple(t,o,r,i,s):this._placeBoxesGrouping(t,o,r,i,a),e&&e.done&&e.done()}_placeBoxesSimple(t,e,o,r,i){let s=UO(t,i),a=ya(t),l=t.getProperty(tu);(l==null||l<=0)&&(l=Up);let c=FO(s,e,o,a.x,a.y,r,l);Ae(t,c.x,c.y,!1,!0)}_placeBoxesGrouping(t,e,o,r,i){let s=t.getProperty(Yo),a=new O(s.x,s.y);a.x=Math.max(a.x-o.getLeft()-o.getRight(),0),a.y=Math.max(a.y-o.getTop()-o.getBottom(),0);let l=t.getProperty(tu);(l==null||l<=0)&&(l=Up);let c=[];for(let f of t.getChildren())c.push(new is(f));let g;i===hr.GROUP_INC?g=VO(c,e,a.x,a.y,r,l):i===hr.GROUP_DEC?g=zO(c,e,a.x,a.y,r,l):g=YO(c,e,a.x,a.y,r,l);let h=new is(g),d=Al(h,e,o,a.x,a.y,r,l);Ae(t,d.x,d.y,!1,!0)}};Z(rs,"PackingMode",hr);function UO(n,t){let e=[...n.getChildren()];return e.sort((o,r)=>{let i=o.getProperty(Qf)||0,s=r.getProperty(Qf)||0;if(i>s)return-1;if(i<s)return 1;if(t){let c=(o.getY()||0)-(r.getY()||0);if(c!==0)return c;let g=(o.getX()||0)-(r.getX()||0);if(g!==0)return g}let a=o.getWidth()*o.getHeight(),l=r.getWidth()*r.getHeight();return a-l}),e}function FO(n,t,e,o,r,i,s){let a=0,l=0;for(let N of n)ou(N),a=Math.max(a,N.getWidth()),l+=N.getWidth()*N.getHeight();let c=l/n.length,g=kO(n,c);l+=n.length*1*g,l+=Math.sqrt(l)*(e.getBottom()+e.getTop()),l+=Math.sqrt(l)*e.getRight(),a=Math.max(a,Math.sqrt(l*s))+e.getLeft();let h=e.getLeft(),d=e.getTop(),f=0,E=e.getHorizontal(),P=[0],S=[];for(let N=0;N<n.length;N++){let I=n[N],C=I.getWidth(),x=I.getHeight();h+C>a&&(i&&(S.push(f),P.push(N)),h=e.getLeft(),d+=f+t,f=0,E=Math.max(E,e.getHorizontal()+C)),I.setLocation(h,d),E=Math.max(E,h+C+e.getRight()),f=Math.max(f,x),h+=C+t}E=Math.max(E,o);let T=d+f+e.getBottom();if(T<r&&(f+=r-T,T=r),i){h=e.getLeft(),P.push(n.length),S.push(f);let N=0,I=P[N++],C=0,x=0;for(let M=0;M<n.length;M++){M===I&&(h=e.getLeft(),x=S[C++],I=P[N++]);let A=n[M],B=A.getHeight();A.setHeight(x);let Y=x;if(M+1===I){let j=E-h-e.getRight(),X=A.getWidth();A.setWidth(j),Vs(A,new O(j,Y),new O(X,B))}h+=A.getWidth()+t}}return new O(E,T)}function kO(n,t){let e=0;for(let o of n)e+=Math.pow(o.getWidth()*o.getHeight()-t,2);return Math.sqrt(e/(n.length-1))}function Al(n,t,e,o,r,i,s){let a=0,l=0;for(let x of n.groups)x.node!=null&&ou(x.node),a=Math.max(a,x.getWidth()),l+=x.getWidth()*x.getHeight();let c=l/n.groups.length,g=WO(n.groups,c);l+=n.groups.length*1*g,a=Math.max(a,Math.sqrt(l*s))+e.getLeft();let d=e.getLeft(),f=e.getTop(),E=0,P=e.getHorizontal(),S=[0],T=[],N=null,I=[];for(let x=0;x<n.groups.length;x++){let M=n.groups[x],A=M.getWidth(),B=M.getHeight();d+A>a&&(i&&(T.push(E),S.push(x),N!=null&&n.right.push(N),I=[]),d=e.getLeft(),f+=E+t,E=0,P=Math.max(P,e.getHorizontal()+A)),I.push(M),M.translate(d,f),P=Math.max(P,d+A+e.getRight()),E=Math.max(E,B),d+=A+t,N=M}for(let x of I)n.bottom.push(x);I.length>0&&n.right.push(I[I.length-1]),P=Math.max(P,o);let C=f+E+e.getBottom();if(C<r&&(E+=r-C,C=r),i){d=e.getLeft(),S.push(n.groups.length),T.push(E);let x=0,M=S[x++],A=0,B=0;for(let Y=0;Y<n.groups.length;Y++){Y===M&&(d=e.getLeft(),B=T[A++],M=S[x++]);let j=n.groups[Y];if(j.setHeight(B),Y+1===M){let X=P-d-e.getRight(),tt=j.getWidth();j.setWidth(X),j.translateInnerNodes((X-tt)/2,0)}d+=j.getWidth()+t}}return new O(P,C)}function WO(n,t){let e=0;for(let o of n)e+=Math.pow(o.area()-t,2);return Math.sqrt(e/(n.length-1))}function zO(n,t,e,o,r,i){n.sort((h,d)=>d.area()-h.area());let s=[...n],a=[],l=[],c=null,g=0;for(;s.length>0;){let h=s.shift();if(c==null||c.area()/2<h.area())c=h,a.push(h);else if(g+=h.area(),l.push(h),l.length>1&&(g>c.area()/2||s.length===0)){let d=new is(l),f=c.getWidth()/c.getHeight(),E=Al(d,t,new yt,e,o,r,f);d.size.x=E.x,d.size.y=E.y,c=d,a.push(d),g=0,l=[]}}for(let h of l)a.push(h);return a}function YO(n,t,e,o,r,i){let s=[...n].sort((g,h)=>g.area()-h.area()),a=new Array(n.length).fill(0),l=0,c=[];for(;s.length>0;){let g=s[0];if(l>1&&g.area()/2>a[0]){let h=0;for(;h<c.length-1&&g.area()/2>a[h];)h++;let d=c.slice(0,h+1),f=new is(d),E=g.getWidth()/g.getHeight(),P=Al(f,t,new yt,e,o,r,E);f.size.x=P.x,f.size.y=P.y;let S=c.slice(h+1);s.push(f);for(let T of S)s.push(T);s.sort((T,N)=>T.area()-N.area()),c.length=0,l=0,a.fill(0)}else s.shift(),l>0&&(a[l]=a[l-1]),a[l]+=g.area(),l++,c.push(g)}return c}function VO(n,t,e,o,r,i){n.sort((l,c)=>l.area()-c.area());let s=[],a=0;for(let l of n)if(s.length>0&&l.area()>a*2){let c=new is(s),g=l.getWidth()/l.getHeight(),h=Al(c,t,new yt,e,o,r,g);c.size.x=h.x,c.size.y=h.y,s=[],a=0,s.push(c),s.push(l),a=c.area()+l.area()}else s.push(l),a+=l.area();return s}var is=class{constructor(t){Array.isArray(t)?(this.groups=[...t],this.node=null,this.bottom=[],this.right=[],this.size=new O):(this.node=t,this.groups=null,this.bottom=null,this.right=null,this.size=null,this.node.setLocation(0,0))}area(){return this.getWidth()*this.getHeight()}getWidth(){return this.node!=null?this.node.getWidth():this.size.x}getHeight(){return this.node!=null?this.node.getHeight():this.size.y}setWidth(t){if(this.node!=null)this.node.setWidth(t);else{let e=t-this.getWidth();for(let o of this.right)o.setWidth(o.getWidth()+e)}}setHeight(t){if(this.node!=null)this.node.setHeight(t);else{let e=t-this.getHeight();for(let o of this.bottom)o.setHeight(o.getHeight()+e)}}translate(t,e){if(this.node!=null)this.node.setX(this.node.getX()+t),this.node.setY(this.node.getY()+e);else for(let o of this.groups)o.translate(t,e)}translateInnerNodes(t,e){if(this.node!=null)Ra(this.node,t,e);else for(let o of this.groups)o.translateInnerNodes(t,e)}};var Jt=Object.freeze({DISTRIBUTED:"DISTRIBUTED",JUSTIFIED:"JUSTIFIED",BEGIN:"BEGIN",CENTER:"CENTER",END:"END",values(){return[this.DISTRIBUTED,this.JUSTIFIED,this.BEGIN,this.CENTER,this.END]},valueOf(n){return this[n]}});var Fp=Object.freeze({INHERIT:"INHERIT",PARENT:"PARENT",ROOT:"ROOT",values(){return[this.INHERIT,this.PARENT,this.ROOT]},valueOf(n){return this[n]}});var Il=new m("org.eclipse.elk.box.packingMode",()=>hr.SIMPLE),mi=new m("org.eclipse.elk.algorithm"),ss=new m("org.eclipse.elk.resolvedAlgorithm"),XO=new m("org.eclipse.elk.alignment",Kt.AUTOMATIC),KO=new m("org.eclipse.elk.aspectRatio",null,Xe.greaterThan(0)),Cl=new m("org.eclipse.elk.bendPoints"),Rl=new m("org.eclipse.elk.contentAlignment",he.topLeft()),Ks=new m("org.eclipse.elk.debugMode",!1),lr=new m("org.eclipse.elk.direction",R.UNDEFINED),cu=new m("org.eclipse.elk.edgeRouting",At.UNDEFINED),Ll=new m("org.eclipse.elk.expandNodes",!1),yr=new m("org.eclipse.elk.hierarchyHandling",Oe.INHERIT),ns=new m("org.eclipse.elk.padding",new yt(12)),zo=new m("org.eclipse.elk.interactive",!1),ZO=new m("org.eclipse.elk.interactiveLayout",!1),So=new m("org.eclipse.elk.omitNodeMicroLayout",!1),jO=new m("org.eclipse.elk.json.shapeCoords",Fp.INHERIT),$O=new m("org.eclipse.elk.json.edgeCoords",Ap.INHERIT),qO=new m("org.eclipse.elk.spacing.commentComment",10,0),JO=new m("org.eclipse.elk.spacing.commentNode",10,0),QO=new m("org.eclipse.elk.spacing.componentComponent",20,0),tS=new m("org.eclipse.elk.spacing.edgeEdge",10,0),gu=new m("org.eclipse.elk.spacing.edgeLabel",2,0),eS=new m("org.eclipse.elk.spacing.edgeNode",10,0),hu=new m("org.eclipse.elk.spacing.labelLabel",0,0),Zs=new m("org.eclipse.elk.spacing.labelNode",5,0),du=new m("org.eclipse.elk.spacing.labelPortHorizontal",1),fu=new m("org.eclipse.elk.spacing.labelPortVertical",1),Pi=new m("org.eclipse.elk.spacing.nodeNode",20,0),oS=new m("org.eclipse.elk.spacing.nodeSelfLoop",10,0),uu=new m("org.eclipse.elk.spacing.portPort",10,0),as=new m("org.eclipse.elk.spacing.individual"),_u=new m("org.eclipse.elk.spacing.portsSurrounding",new me(0)),rS=new m("org.eclipse.elk.partitioning.partition"),iS=new m("org.eclipse.elk.partitioning.activate",!1),pu=new m("org.eclipse.elk.nodeLabels.padding",new yt(5)),Kr=new m("org.eclipse.elk.nodeLabels.placement",k.fixed),Eu=new m("org.eclipse.elk.portAlignment.default",Jt.DISTRIBUTED),xl=new m("org.eclipse.elk.portAlignment.north"),Dl=new m("org.eclipse.elk.portAlignment.south"),wl=new m("org.eclipse.elk.portAlignment.west"),Ml=new m("org.eclipse.elk.portAlignment.east"),cr=new m("org.eclipse.elk.portConstraints",H.UNDEFINED),ho=new m("org.eclipse.elk.position"),mu=new m("org.eclipse.elk.priority"),Pu=new m("org.eclipse.elk.randomSeed"),sS=new m("org.eclipse.elk.separateConnectedComponents"),Mo=new m("org.eclipse.elk.nodeSize.constraints",new Set),Oo=new m("org.eclipse.elk.nodeSize.options",new Set([Nt.DEFAULT_MINIMUM_SIZE])),Yo=new m("org.eclipse.elk.nodeSize.minimum",new O(0,0)),To=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1),gr=new m("org.eclipse.elk.junctionPoints",new st),nS=new m("org.eclipse.elk.commentBox",!1),Aa=new m("org.eclipse.elk.edgeLabels.placement",St.CENTER),Ou=new m("org.eclipse.elk.edgeLabels.inline",!1),aS=new m("org.eclipse.elk.font.name"),lS=new m("org.eclipse.elk.font.size",null,1),cS=new m("org.eclipse.elk.hypernode",!1),gS=new m("org.eclipse.elk.labelManager"),hS=new m("org.eclipse.elk.softwrappingFuzziness",0),Nr=new m("org.eclipse.elk.margins",new me),bl=new m("org.eclipse.elk.noLayout",!1),au=new m("org.eclipse.elk.port.anchor"),Gl=new m("org.eclipse.elk.port.index"),Tr=new m("org.eclipse.elk.port.side",u.UNDEFINED),Ke=new m("org.eclipse.elk.port.borderOffset"),Ir=new m("org.eclipse.elk.portLabels.placement",it.outside),Hl=new m("org.eclipse.elk.portLabels.nextToPortIfPossible",!1),Su=new m("org.eclipse.elk.portLabels.treatAsGroup",!0),lu=new m("org.eclipse.elk.scaleFactor",1,Xe.greaterThan(0)),pi=new m("org.eclipse.elk.childAreaWidth"),Ei=new m("org.eclipse.elk.childAreaHeight"),js=new m("org.eclipse.elk.topdownLayout",!1),dS=new m("org.eclipse.elk.topdown.sizeCategories",3,1),fS=new m("org.eclipse.elk.topdown.sizeCategoriesHierarchicalNodeWeight",4,1),kp=new m("org.eclipse.elk.topdown.scaleFactor",1,Xe.greaterThan(0)),uS=new m("org.eclipse.elk.topdown.sizeApproximator"),Wp=new m("org.eclipse.elk.topdown.hierarchicalNodeWidth",150),zp=new m("org.eclipse.elk.topdown.hierarchicalNodeAspectRatio",1.414),_S=new m("org.eclipse.elk.topdown.nodeType"),pS=new m("org.eclipse.elk.topdown.scaleCap",1),ls=new m("org.eclipse.elk.insideSelfLoops.activate",!1),Ca=new m("org.eclipse.elk.insideSelfLoops.yo",!1),ES=new m("org.eclipse.elk.edge.thickness",1),mS=new m("org.eclipse.elk.edge.type",Cp.NONE),PS=new m("org.eclipse.elk.animate",!0),OS=new m("org.eclipse.elk.animTimeFactor",100,0),SS=new m("org.eclipse.elk.layoutAncestors",!1),TS=new m("org.eclipse.elk.maxAnimTime",4e3,0),NS=new m("org.eclipse.elk.minAnimTime",400,0),yS=new m("org.eclipse.elk.progressBar",!1),IS=new m("org.eclipse.elk.validateGraph",!1),RS=new m("org.eclipse.elk.validateOptions",!0),LS=new m("org.eclipse.elk.zoomToFit",!1),AS="org.eclipse.elk.layered",CS="org.eclipse.elk.orthogonal",xS="org.eclipse.elk.force",DS="org.eclipse.elk.circle",wS="org.eclipse.elk.tree",MS="org.eclipse.elk.planar",bS="org.eclipse.elk.radial",Yp="org.eclipse.elk.fixed",GS="org.eclipse.elk.box",HS="org.eclipse.elk.random";var Bl=class{static forGraph(t){let e=new yu;if(typeof t=="string")e._graphString=t;else if(t!=null&&typeof t=="object"&&!(t instanceof Array)){if(typeof t.getChildren=="function"&&typeof t.getProperty=="function")return new Iu(t);e._jsonGraph=t}else throw new Error("ElkGraphJson.forGraph expects a string, plain JSON object, or ElkNode.");return e}},yu=class{constructor(){this._graphString=null,this._jsonGraph=null,this._importerMaybe=null,this._lenient=!0}rememberImporter(t){return this._importerMaybe=t,this}lenient(t){return this._lenient=t,this}toElk(){if(this._jsonGraph==null){if(this._graphString==null)throw new Error("No graph has been set on the import builder.");if(this._jsonGraph=JSON.parse(this._graphString),this._jsonGraph==null||typeof this._jsonGraph!="object"||Array.isArray(this._jsonGraph))throw new Oi("Top-level element of the graph must be a json object.")}let t=new Ru,e=t.transform(this._jsonGraph);return this._importerMaybe!=null&&(this._importerMaybe.value=t),e}},Iu=class{constructor(t){this._graph=t,this._prettyPrint=!1,this._omitZeroPosition=!0,this._omitZeroDimension=!0,this._omitLayoutInformation=!1,this._shortLayoutOptionKeys=!0,this._omitUnknownLayoutOptions=!0}prettyPrint(t){return this._prettyPrint=t,this}shortLayoutOptionKeys(t){return this._shortLayoutOptionKeys=t,this}omitZeroPositions(t){return this._omitZeroPosition=t,this}omitZeroDimension(t){return this._omitZeroDimension=t,this}omitLayout(t){return this._omitLayoutInformation=t,this}omitUnknownLayoutOptions(t){return this._omitUnknownLayoutOptions=t,this}toJson(){let t=new Lu;t.setOptions({omitZeroPosition:this._omitZeroPosition,omitZeroDimension:this._omitZeroDimension,omitLayoutInformation:this._omitLayoutInformation,shortLayoutOptionKeys:this._shortLayoutOptionKeys,omitUnknownLayoutOptions:this._omitUnknownLayoutOptions});let e=t.export(this._graph);return this._prettyPrint?JSON.stringify(e,null,2):JSON.stringify(e)}},Oi=class extends Error{constructor(t){super(t),this.name="JsonImportException"}},Ru=class{constructor(){this._nodeIdMap=new Map,this._portIdMap=new Map,this._edgeIdMap=new Map,this._nodeJsonMap=new Map,this._portJsonMap=new Map,this._edgeJsonMap=new Map,this._labelJsonMap=new Map,this._inputModel=null}getInputModel(){return this._inputModel}transform(t){this._inputModel=t,this._nodeIdMap.clear(),this._portIdMap.clear(),this._edgeIdMap.clear(),this._nodeJsonMap.clear(),this._portJsonMap.clear(),this._edgeJsonMap.clear(),this._labelJsonMap.clear();let e=this._transformNode(t,null);return this._transformEdges(t),e}_transformNode(t,e){let o=e==null?Oa():Fs(e),r=t.id;if(r==null)throw new Oi("Every element must have an id.");if(o.identifier=String(r),this._nodeIdMap.set(r,o),this._nodeJsonMap.set(o,t),Au(o,t),Zr(o,t.layoutOptions),Zr(o,t.properties),Array.isArray(t.labels))for(let i of t.labels)Tu(i,o,this._labelJsonMap);if(Array.isArray(t.ports))for(let i of t.ports)this._transformPort(i,o);if(Array.isArray(t.children))for(let i of t.children)this._transformNode(i,o);return o}_transformPort(t,e){let o=Kf(e),r=t.id;if(r==null)throw new Oi("Every element must have an id.");if(o.identifier=String(r),this._portIdMap.set(r,o),this._portJsonMap.set(o,t),Au(o,t),Zr(o,t.layoutOptions),Zr(o,t.properties),Array.isArray(t.labels))for(let i of t.labels)Tu(i,o,this._labelJsonMap);return o}_transformEdges(t){if(Array.isArray(t.edges))for(let e of t.edges)this._transformEdge(e,this._nodeIdMap.get(t.id));if(Array.isArray(t.children))for(let e of t.children)this._transformEdges(e)}_transformEdge(t,e){var c,g,h,d,f,E;let o=t.id;if(o==null)throw new Oi("Every element must have an id.");let r=t.sources||[],i=t.targets||[];if(r.length===0||i.length===0)throw new Oi(`Edge ${o} must have at least one source and one target.`);let s=this._resolveShape(r[0]),a=this._resolveShape(i[0]);if(s==null||a==null)throw new Oi(`Edge ${o} references an unknown source or target.`);let l=Zf(s,a);l.identifier=String(o);for(let P=1;P<r.length;P++){let S=this._resolveShape(r[P]);S!=null&&l.getSources().push(S)}for(let P=1;P<i.length;P++){let S=this._resolveShape(i[P]);S!=null&&l.getTargets().push(S)}if(this._edgeIdMap.set(o,l),this._edgeJsonMap.set(l,t),Zr(l,t.layoutOptions),Zr(l,t.properties),Array.isArray(t.sections))for(let P of t.sections){let S=Nl(l);if(P.id!=null&&(S.identifier=String(P.id)),P.startPoint!=null&&(S.startX=(c=P.startPoint.x)!=null?c:0,S.startY=(g=P.startPoint.y)!=null?g:0),P.endPoint!=null&&(S.endX=(h=P.endPoint.x)!=null?h:0,S.endY=(d=P.endPoint.y)!=null?d:0),Array.isArray(P.bendPoints))for(let T of P.bendPoints)Sa(S,(f=T.x)!=null?f:0,(E=T.y)!=null?E:0)}if(Array.isArray(t.labels))for(let P of t.labels)Tu(P,l,this._labelJsonMap)}_resolveShape(t){let e=this._portIdMap.get(t)||this._nodeIdMap.get(t);if(e!=null)return e;let o=String(t),r=o.indexOf(":");if(r>0){let i=o.substring(r+1),s=this._nodeIdMap.get(o.substring(0,r));if(s!=null&&typeof s.getPorts=="function"){for(let a of s.getPorts())if(typeof a.getIdentifier=="function"&&a.getIdentifier()===i)return a}return this._portIdMap.get(i)||null}return null}transferLayout(t){this._transferShapesAndPorts(t),this._transferEdges(t)}_transferShapesAndPorts(t){let e=this._nodeJsonMap.get(t);e!=null&&xa(e,t);for(let o of t.getLabels()){let r=this._labelJsonMap.get(o);r!=null&&xa(r,o)}for(let o of t.getPorts()){let r=this._portJsonMap.get(o);r!=null&&xa(r,o);for(let i of o.getLabels()){let s=this._labelJsonMap.get(i);s!=null&&xa(s,i)}}for(let o of t.getChildren())this._transferShapesAndPorts(o)}_transferEdges(t){for(let e of t.getContainedEdges()){let o=this._edgeJsonMap.get(e);o!=null&&vS(o,e);for(let r of e.getLabels()){let i=this._labelJsonMap.get(r);i!=null&&xa(i,r)}}for(let e of t.getChildren())this._transferEdges(e)}};function xa(n,t){n.x=t.x||0,n.y=t.y||0,n.width=t.width||0,n.height=t.height||0}function vS(n,t){let e=t.getSections?t.getSections():[];if(e.length>0){let o=n.id!=null?String(n.id):"";n.sections=e.map((r,i)=>{let s={id:r.identifier||o+"_s"+i,startPoint:{x:r.startX||0,y:r.startY||0},endPoint:{x:r.endX||0,y:r.endY||0}};r.bendPoints&&r.bendPoints.length>0&&(s.bendPoints=r.bendPoints.map(c=>({x:c.x,y:c.y})));let a=r.getIncomingShape?r.getIncomingShape():null;a!=null&&a.identifier&&(s.incomingShape=a.identifier);let l=r.getOutgoingShape?r.getOutgoingShape():null;return l!=null&&l.identifier&&(s.outgoingShape=l.identifier),s})}if(t.hasProperty&&t.hasProperty(gr)){let o=t.getProperty(gr);o!=null&&o.length>0&&(n.junctionPoints=o.map(r=>({x:r.x,y:r.y})))}}var Lu=class{constructor(){this._options={omitZeroPosition:!0,omitZeroDimension:!0,omitLayoutInformation:!1,shortLayoutOptionKeys:!1,omitUnknownLayoutOptions:!0}}setOptions(t){Object.assign(this._options,t)}export(t){return this._exportNode(t)}_exportNode(t){let e={id:t.identifier||cs(t)};Cu(e,t,this._options),vl(e,t,this._options);let o=t.getLabels?t.getLabels():[];o&&o.length>0&&(e.labels=o.map(a=>Nu(a,this._options)));let r=t.getPorts?t.getPorts():[];r&&r.length>0&&(e.ports=r.map(a=>this._exportPort(a)));let i=t.getChildren?t.getChildren():[];i&&i.length>0&&(e.children=i.map(a=>this._exportNode(a)));let s=t.getContainedEdges?t.getContainedEdges():[];return s&&s.length>0&&(e.edges=s.map(a=>this._exportEdge(a))),e}_exportPort(t){let e={id:t.identifier||cs(t)};Cu(e,t,this._options),vl(e,t,this._options);let o=t.getLabels?t.getLabels():[];return o&&o.length>0&&(e.labels=o.map(r=>Nu(r,this._options))),e}_exportEdge(t){let e={id:t.identifier||cs(t),sources:t.getSources().map(i=>i.identifier||cs(i)),targets:t.getTargets().map(i=>i.identifier||cs(i))};vl(e,t,this._options);let o=t.getSections?t.getSections():[];o&&o.length>0&&!this._options.omitLayoutInformation&&(e.sections=o.map(i=>({id:i.identifier||cs(i),startPoint:{x:i.startX||0,y:i.startY||0},endPoint:{x:i.endX||0,y:i.endY||0},bendPoints:(i.bendPoints||[]).map(s=>({x:s.x,y:s.y}))})));let r=t.getLabels?t.getLabels():[];return r&&r.length>0&&(e.labels=r.map(i=>Nu(i,this._options))),e}},Vp=0,Xp=new WeakMap;function cs(n){let t=Xp.get(n);return t===void 0&&(Vp+=1,t="__auto_"+Vp,Xp.set(n,t)),t}function Au(n,t){t.x!=null&&(n.x=Number(t.x)),t.y!=null&&(n.y=Number(t.y)),t.width!=null&&(n.width=Number(t.width)),t.height!=null&&(n.height=Number(t.height))}function Cu(n,t,e){let o=t.x||0,r=t.y||0;(!e.omitZeroPosition||o!==0||r!==0)&&(n.x=o,n.y=r);let i=t.width||0,s=t.height||0;(!e.omitZeroDimension||i!==0||s!==0)&&(n.width=i,n.height=s)}function Zr(n,t,e=!0){if(t==null||typeof t!="object")return;let o=Ht.getInstance();for(let[r,i]of Object.entries(t)){let s=m.byId(r)||m.bySuffix(r),a=null;if(o!=null&&(a=o.getOptionData(r),a==null&&typeof o.getOptionDataBySuffix=="function"&&(a=o.getOptionDataBySuffix(r))),s!=null){if(!e&&n.hasProperty(s))continue;let l=BS(s,a,i);l!==void 0&&n.setProperty(s,l)}else if(a!=null){if(!e&&n.hasProperty(a))continue;let l=typeof a.parseValue=="function"?a.parseValue(String(i)):i;l!=null&&n.setProperty(a,l)}else{let l=new m(r);if(!e&&n.hasProperty(l))continue;n.setProperty(l,i)}}}function gs(n,t,e=!0){Zr(n,t,e)}function BS(n,t,e){let o=US.get(n.getId());if(o)return FS(o,e);if(t&&typeof t.parseValue=="function"){let s=t.parseValue(String(e));return s!=null?s:void 0}if(typeof e!="string")return e;let r=n.getDefault();if(r!=null){if(typeof r.parse=="function"&&typeof r.clone=="function"){let a=r.clone();try{return a.parse(String(e)),a}catch(l){return}}if(r instanceof Set){let a=new Set;for(let l of e.split(/[[\]\s,]+/))l&&a.add(l);return a}let s=r.constructor;if(s&&s!==Number&&s!==String&&s!==Boolean&&s!==Object){let a=s[e];if(a instanceof s)return a;if(Object.prototype.hasOwnProperty.call(s,"valueOf")&&typeof s.valueOf=="function"){let l=s.valueOf(e);if(l instanceof s)return l}if(/^\d+$/.test(e)&&typeof s.values=="function"){let l=s.values(),c=parseInt(e,10);if(Array.isArray(l)&&c<l.length)return l[c]}return}if(typeof r=="number"){let a=Number(e);return Number.isNaN(a)?void 0:a}if(typeof r=="boolean")return e==="true"?!0:e==="false"?!1:void 0}if(e==="true")return!0;if(e==="false")return!1;let i=Number(e);return!Number.isNaN(i)&&e.trim()!==""?i:e}var US=new Map([["org.eclipse.elk.position",O],["org.eclipse.elk.bendPoints",st],["org.eclipse.elk.port.anchor",O]]);function FS(n,t){if(t instanceof n)return t;if(typeof t=="string"){let e=new n;try{return e.parse(t),e}catch(o){return}}if(n===O&&t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number")return new O(t.x,t.y);if(n===st&&Array.isArray(t)){let e=new st;for(let o of t){if(o==null||typeof o.x!="number"||typeof o.y!="number")return;e.add(new O(o.x,o.y))}return e}}function vl(n,t,e){if(e.omitLayoutInformation)return;let o=t.getAllProperties?t.getAllProperties():null;if(o==null||o.size===0)return;let r={},i=!1;for(let[s,a]of o.entries()){if(s==null)continue;let l=s.getId?s.getId():s.id||null;l!=null&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean"?r[l]=a:a!=null&&typeof a.toString=="function"&&(r[l]=a.toString()),i=!0)}i&&(n.layoutOptions=r)}function Tu(n,t,e){let o=Tl(t);return n.id!=null&&(o.identifier=String(n.id)),n.text!=null&&(o.text=String(n.text)),Au(o,n),Zr(o,n.layoutOptions),Zr(o,n.properties),e!=null&&e.set(o,n),o}function Nu(n,t){let e={id:n.identifier||cs(n)};return n.text!=null&&(e.text=n.text),Cu(e,n,t),vl(e,n,t),e}var hs=class{visit(t){let e=Ul();t&&typeof t.getChildren=="function"&&!t.getProperty(e.NO_LAYOUT)&&this.resolveAlgorithm(t)}resolveAlgorithm(t){let e=Ul(),o=t.getProperty(e.ALGORITHM);if(!this.resolveAndSetAlgorithm(o,t)&&this.mustResolve(t))if(!o||o.trim()===""){let r=this.getDefaultLayoutAlgorithmID();if(!this.resolveAndSetAlgorithm(r,t)){let i=`Unable to load default layout algorithm '${r}' for unconfigured node`;throw t.getIdentifier&&(i+=` '${t.getIdentifier()}'`),new Error(i)}}else{let r=`Layout algorithm '${o}' not found`;throw t.getIdentifier&&(r+=` for node '${t.getIdentifier()}'`),new Error(r)}}resolveAndSetAlgorithm(t,e){let o=Ht.getInstance().getAlgorithmDataBySuffix(t);if(o!==null){let r=Ul();return e.setProperty(r.RESOLVED_ALGORITHM,o),!0}return!1}mustResolve(t){let e=Ul();return!t.hasProperty(e.RESOLVED_ALGORITHM)&&(t.getChildren().length>0||t.getProperty(e.INSIDE_SELF_LOOPS_ACTIVATE))}getDefaultLayoutAlgorithmID(){return"org.eclipse.elk.layered"}},Fl=null;function Ul(){if(!Fl)try{Fl=_injectedCoreOptions}catch(n){throw new Error("CoreOptions not available. Call LayoutAlgorithmResolver.setCoreOptions(CoreOptions) before using this class, or ensure CoreOptions is registered with LayoutMetaDataService.")}return Fl}hs.setCoreOptions=function(n){Fl=n};var kS=n=>{n.getProperty(Ir).add(it.NEXT_TO_PORT_IF_POSSIBLE),n.setProperty(Hl,null)},WS=n=>{n.getProperty(Oo).has(Nt.SPACE_EFFICIENT_PORT_LABELS)&&(n.getProperty(Ir).add(it.SPACE_EFFICIENT),n.getProperty(Oo).delete(Nt.SPACE_EFFICIENT_PORT_LABELS))},zS=new Map([[Hl,kS],[Oo,WS]]),kl=class{visit(t){for(let[e,o]of zS)t.hasProperty(e)&&o(t)}};var Wl=class{layout(t,e){let o=this._countNodesRecursively(t,!0);e.begin("Recursive Graph Layout",o),vp(t,new kl),t.hasProperty&&t.hasProperty(ss)||Kp(t,new hs),this._layoutRecursively(t,e),e.done()}_layoutRecursively(t,e){if(e.isCanceled())return[];if(t.getProperty&&t.getProperty(bl))return[];let o=t.children&&t.children.length>0,r=this._gatherInsideSelfLoops(t),i=r.length>0;if(!o&&!i)return[];let s=t.getProperty?t.getProperty(ss):null;if(!s)throw new Error("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before layout.");let a=s.supportsFeature("INSIDE_SELF_LOOPS");if(this._evaluateHierarchyHandlingInheritance(t),!o&&i&&!a)return[];let l=[],c=t.getProperty?t.getProperty(yr):null,g=s.supportsFeature("COMPOUND"),h=s.supportsFeature("CLUSTERS");if(c===Oe.INCLUDE_CHILDREN&&(g||h)){if(t.getProperty&&t.getProperty(js))throw new Error("Topdown layout cannot be used together with hierarchy handling.");let f=(t.children||[]).slice();for(;f.length>0;){let E=f.shift();this._evaluateHierarchyHandlingInheritance(E);let S=(E.getProperty?E.getProperty(yr):null)===Oe.SEPARATE_CHILDREN,T=E.getProperty&&E.hasProperty&&E.hasProperty(mi)&&!s.equals(E.getProperty(ss));if(S||T){let N=this._layoutRecursively(E,e);l.push(...N),E.setProperty&&E.setProperty(yr,Oe.SEPARATE_CHILDREN),ru(E)}else f.push(...E.children||[])}}else for(let f of t.children||[]){let E=this._layoutRecursively(f,e);l.push(...E),ru(f)}if(e.isCanceled())return[];for(let f of l)f.setProperty&&f.setProperty(bl,!0);let d=t.children?t.children.length:0;return this._executeAlgorithm(t,s,e.subTask(d)),this._postProcessInsideSelfLoops(l),i&&a?r:[]}_executeAlgorithm(t,e,o){let r=e.createLayoutProvider();try{r.layout(t,o)}catch(i){throw r.dispose(),i}}_countNodesRecursively(t,e){let o=(t.children||[]).length;for(let r of t.children||[])r.children&&r.children.length>0&&(o+=this._countNodesRecursively(r,!1));if(e){let r=t.parent;for(;r;)o+=(r.children||[]).length,r=r.parent}return o}_countNodesWithHierarchy(t){let e=(t.children||[]).length;for(let o of t.children||[])if((o.getProperty?o.getProperty(yr):null)!==Oe.SEPARATE_CHILDREN){let i=t.getProperty?t.getProperty(ss):null,s=o.getProperty?o.getProperty(ss):null;(i===s||i&&i.equals&&i.equals(s))&&o.children&&o.children.length>0&&(e+=this._countNodesWithHierarchy(o))}return e}_evaluateHierarchyHandlingInheritance(t){if(!t.getProperty)return;if(t.getProperty(yr)===Oe.INHERIT)if(!t.parent)t.setProperty(yr,Oe.SEPARATE_CHILDREN);else{let o=t.parent.getProperty?t.parent.getProperty(yr):Oe.SEPARATE_CHILDREN;t.setProperty(yr,o)}}_gatherInsideSelfLoops(t){if(!t.getProperty||!t.getProperty(ls))return[];let e=[];for(let o of Ee(t))o.isSelfloop&&o.isSelfloop()&&o.getProperty&&o.getProperty(Ca)&&e.push(o);return e}_postProcessInsideSelfLoops(t){for(let e of t){let o=e.sources&&e.sources[0];if(!o)continue;let r=o.parent!==void 0?o.parent:o,i=r.x||0,s=r.y||0;if(!e.sections||e.sections.length===0)continue;let a=e.sections[0];a.setStartLocation(a.startX+i,a.startY+s),a.setEndLocation(a.endX+i,a.endY+s);for(let l of a.bendPoints||[])l.set(l.x+i,l.y+s);if(e.getProperty){let l=e.getProperty(gr);l&&typeof l.offset=="function"&&l.offset(i,s)}}}};function Kp(n,t){t.visit(n);for(let e of n.children||[])Kp(e,t);for(let e of n.ports||[])t.visit(e);for(let e of n.labels||[])t.visit(e);for(let e of n.containedEdges||[])t.visit(e)}var zl=class{isCanceled(){return!1}begin(t,e){return!1}worked(t){}done(){}isRunning(){return!1}getTaskName(){return null}subTask(t){return this}getSubMonitors(){return null}getParentMonitor(){return null}isLoggingEnabled(){return!1}isLogPersistenceEnabled(){return!1}log(t){}getLogs(){return null}logGraph(t,e,o){}getLoggedGraphs(){return null}isExecutionTimeMeasured(){return!1}getExecutionTime(){return 0}};var Se=class n{constructor(t){this._id=t.id||"",this._name=t.name||"",this._description=t.description||"",this._category=t.category||null,this._melkBundleName=t.melkBundleName||null,this._definingBundleId=t.definingBundleId||null,this._imagePath=t.imagePath||null,this._supportedFeatures=t.supportedFeatures||new Set,this._providerFactory=t.providerFactory||null,this._validatorClass=t.validatorClass||null,this._knownOptions=new Map}getId(){return this._id}getName(){return this._name}getDescription(){return this._description}getCategoryId(){return this._category}getBundleName(){return this._melkBundleName}getDefiningBundleId(){return this._definingBundleId}getPreviewImagePath(){return this._imagePath}getSupportedFeatures(){return this._supportedFeatures}supportsFeature(t){return this._supportedFeatures.has(t)}getValidatorClass(){return this._validatorClass}createLayoutProvider(){return this._providerFactory?this._providerFactory():null}getInstancePool(){let t=this._providerFactory;return{fetch(){return t?t():null},release(e){},clear(){}}}addKnownOption(t,e){this._knownOptions.set(t.getId(),e)}getKnownOptionIds(){return new Set(this._knownOptions.keys())}knowsOption(t){let e=typeof t=="string"?t:t.getId();return this._knownOptions.has(e)}getDefaultValue(t){let e=typeof t=="string"?t:t.getId();return this._knownOptions.get(e)}equals(t){return t instanceof n?this._id===t._id:!1}toString(){return`Layout Algorithm: ${this._id}`}},xu=class{constructor(){this._id="",this._name="",this._description="",this._category=null,this._melkBundleName=null,this._definingBundleId=null,this._imagePath=null,this._supportedFeatures=null,this._providerFactory=null,this._validatorClass=null}create(){return new Se({id:this._id,name:this._name,description:this._description,category:this._category,melkBundleName:this._melkBundleName,definingBundleId:this._definingBundleId,imagePath:this._imagePath,supportedFeatures:this._supportedFeatures||new Set,providerFactory:this._providerFactory,validatorClass:this._validatorClass})}id(t){return this._id=t,this}name(t){return this._name=t,this}description(t){return this._description=t,this}category(t){return this._category=t,this}melkBundleName(t){return this._melkBundleName=t,this}definingBundleId(t){return this._definingBundleId=t,this}imagePath(t){return this._imagePath=t,this}supportedFeatures(t){return this._supportedFeatures=t,this}providerFactory(t){return this._providerFactory=t,this}validatorClass(t){return this._validatorClass=t,this}};Se.Builder=xu;var Zp=new m("org.eclipse.elk.padding",new yt(15));var Yl=class extends de{layout(t,e){e.begin("Fixed Layout",1);let o=t.getProperty(cu),r=0,i=0;for(let s of t.children){let a=s.getProperty(ho);if(a!=null){s.setLocation(a.x,a.y);let l=s.getProperty(Mo);if(l&&l.has(mt.MINIMUM_SIZE)){let c=s.getProperty(Yo);c!=null&&c.x>0&&c.y>0&&Ae(s,c.x,c.y,!0,!0)}}r=Math.max(r,s.getX()+s.getWidth()),i=Math.max(i,s.getY()+s.getHeight());for(let l of s.labels)a=l.getProperty(ho),a!=null&&l.setLocation(a.x,a.y),r=Math.max(r,s.getX()+l.getX()+l.getWidth()),i=Math.max(i,s.getY()+l.getY()+l.getHeight());for(let l of s.ports){a=l.getProperty(ho),a!=null&&l.setLocation(a.x,a.y);let c=s.getX()+l.getX(),g=s.getY()+l.getY();r=Math.max(r,c+l.getWidth()),i=Math.max(i,g+l.getHeight());for(let h of l.labels)a=h.getProperty(ho),a!=null&&h.setLocation(a.x,a.y),r=Math.max(r,c+h.getX()+h.getWidth()),i=Math.max(i,g+h.getY()+h.getHeight())}for(let l of Ee(s)){let c=this._processEdge(l,o);r=Math.max(r,c.x),i=Math.max(i,c.y)}for(let l of _i(s)){let c=Pt(l.sources[0]);if(c&&c.parent!==t){let g=this._processEdge(l,o);r=Math.max(r,g.x),i=Math.max(i,g.y)}}}if(o===At.ORTHOGONAL)for(let s of t.children)for(let a of Ee(s))this._generateJunctionPoints(a);if(!t.getProperty(To)){let s=t.getProperty(Zp),a=r+s.getLeft()+s.getRight(),l=i+s.getTop()+s.getBottom();Ae(t,a,l,!0,!0)}e.done()}_processEdge(t,e){let o=Pt(t.sources[0]),r=Pt(t.targets[0]),i=o?o.parent:null,s=r?r.parent:null,a=i===s,l=new O,c=t.getProperty(Cl);if(c!=null&&c.size()>=2&&(t.sections.length===0?t.sections.push(new Vr):t.sections.length>1&&t.sections.splice(1,t.sections.length-1),Xs(c,t.sections[0])),a)for(let g of t.sections)for(let h of g.bendPoints)l.x=Math.max(l.x,h.getX()),l.y=Math.max(l.y,h.getY());for(let g of t.labels){let h=g.getProperty(ho);h!=null&&g.setLocation(h.x,h.y),a&&(l.x=Math.max(l.x,g.getX()+g.getWidth()),l.y=Math.max(l.y,g.getY()+g.getHeight()))}return l}_generateJunctionPoints(t){let e=Gp(t);e.isEmpty()?t.setProperty(gr,null):t.setProperty(gr,e)}};var jp=new m("org.eclipse.elk.padding",new yt(15)),$p=new m("org.eclipse.elk.spacing.nodeNode",15,0),qp=new m("org.eclipse.elk.randomSeed",0),Jp=new m("org.eclipse.elk.aspectRatio",1.6,Xe.greaterThan(0));var Qp=BigInt(0x5DEECE66D),XS=BigInt(11),tE=(BigInt(1)<<BigInt(48))-BigInt(1),dr=class{constructor(t){t==null||t===0?(this._mathFallback=!0,this._seed=BigInt(0)):(this._mathFallback=!1,this.setSeed(t))}setSeed(t){let e=typeof t=="bigint"?t:BigInt(t);this._seed=(e^Qp)&tE,this._mathFallback=!1,this._nextGaussianStored=void 0}_next(t){this._seed=this._seed*Qp+XS&tE;let e=this._seed>>BigInt(48-t);return Number(e&BigInt(0xFFFFFFFF))|0}nextDouble(){if(this._mathFallback)return Math.random();let t=BigInt(this._next(26)),e=BigInt(this._next(27)),o=(t<<BigInt(27))+e;return Number(o)/Number(BigInt(1)<<BigInt(53))}nextFloat(){return this._mathFallback?Math.random():this._next(24)/(1<<24)}nextInt(t){if(this._mathFallback)return Math.floor(Math.random()*t);if(t<=0)throw new Error("bound must be positive");if((t&-t)===t){let r=BigInt(this._next(31));return Number(BigInt(t)*r>>BigInt(31))}let e,o;do e=this._next(31),o=e%t;while((e-o+(t-1)|0)<0);return o}nextBoolean(){return this._mathFallback?Math.random()>=.5:this._next(1)!==0}nextLong(){if(this._mathFallback)return BigInt(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER));let t=BigInt(this._next(32)),e=BigInt(this._next(32));return BigInt.asIntN(64,(t<<BigInt(32))+e)}nextGaussian(){if(this._mathFallback)return KS();if(this._nextGaussianStored!==void 0){let i=this._nextGaussianStored;return this._nextGaussianStored=void 0,i}let t,e,o;do t=2*this.nextDouble()-1,e=2*this.nextDouble()-1,o=t*t+e*e;while(o>=1||o===0);let r=Math.sqrt(-2*Math.log(o)/o);return this._nextGaussianStored=e*r,t*r}};function KS(){let n=0,t=0;for(;n===0;)n=Math.random();for(;t===0;)t=Math.random();return Math.sqrt(-2*Math.log(n))*Math.cos(2*Math.PI*t)}var $s=class n extends de{layout(t,e){if(e.begin("Random Layout",1),t.children.length===0){e.done();return}let o=t.getProperty(qp),r=o!=null&&o!==0?new dr(o):new dr,i=t.getProperty(Jp),s=t.getProperty($p),a=t.getProperty(jp);this._randomizeGraph(t,r,i,s,a),e.done()}_randomizeGraph(t,e,o,r,i){let s=0,a=0,l=0,c=1;for(let T of t.children){for(let C of Ee(T))c++;let N=T.getWidth();a=Math.max(a,N);let I=T.getHeight();l=Math.max(l,I),s+=N*I}let g=t.children.length,h=s+2*r*r*c*g,d=Math.sqrt(h),f=Math.max(d*o,a),E=Math.max(d/o,l);for(let T of t.children){let N=i.getLeft()+e.nextDouble()*(f-T.getWidth()),I=i.getLeft()+e.nextDouble()*(E-T.getHeight());T.setLocation(N,I)}let P=f+i.getHorizontal(),S=E+i.getVertical();for(let T of t.children)for(let N of Ee(T))N.isHierarchical()||this._randomizeEdge(N,e,P,S);P+=i.getLeft()+i.getRight(),S+=i.getTop()+i.getBottom(),Ae(t,P,S,!1,!0)}_randomizeEdge(t,e,o,r){let i=t.sources[0],s=i.getX(),a=i.getY(),l=i.getWidth()/2,c=i.getHeight()/2;i instanceof Ve&&(s+=i.getParent().getX(),s+=i.getParent().getX()),s+=l,a+=c;let g=t.sources[0],h=g.getX(),d=g.getY(),f=g.getWidth()/2,E=g.getHeight()/2;if(g instanceof Ve&&(h+=g.getParent().getX(),h+=g.getParent().getX()),h+=f,d+=E,t.sections.length===0)t.sections.push(new Vr);else if(t.sections.length>1){let ot=t.sections[t.sections.length-1];t.sections.length=0,t.sections.push(ot)}let P=t.sections[0],S=h;h>s+l?S=s+l:h<s-l&&(S=s-l);let T=d;d>a+c?T=a+c:d<a-c&&(T=a-c),S>s-l&&S<s+l&&T>a-c&&T<a+c&&(S=s+l),P.setStartLocation(S,T);let N=s;s>h+f?N=h+f:s<h-f&&(N=h-f);let I=a;a>d+E?I=d+E:a<d-E&&(I=d-E),N>h-f&&N<h+f&&I>d-E&&I<d+E&&(I=d+E),P.setEndLocation(N,I),P.bendPoints.length=0;let C=e.nextInt(n.MAX_BENDS);i===g&&C++;let x=N-S,M=I-T,B=Math.sqrt(x*x+M*M)*n.RAND_FACT,Y=x/(C+1),j=M/(C+1),X=S,tt=T;for(let ot=0;ot<C;ot++){X+=Y,tt+=j;let Lt=X+e.nextFloat()*B-B/2;Lt<0?Lt=1:Lt>o&&(Lt=o-1);let zt=tt+e.nextFloat()*B-B/2;zt<0?zt=1:zt>r&&(zt=r-1);let be=new Xr;be.set(Lt,zt),P.bendPoints.push(be)}}};$s.MAX_BENDS=5;$s.RAND_FACT=.2;var ZS=[{id:"org.eclipse.elk.fixed",name:"ELK Fixed",description:"Keeps the current layout as it is, without any automatic modification. Optional coordinates can be given for nodes and edge bend points.",providerFactory:()=>new Yl},{id:"org.eclipse.elk.box",name:"ELK Box",description:"Algorithm for packing of unconnected boxes, i.e. graphs without edges.",providerFactory:()=>new rs},{id:"org.eclipse.elk.random",name:"ELK Randomizer",description:'Distributes the nodes randomly on the plane, leading to very obfuscating layouts. Can be useful to demonstrate the power of "real" layout algorithms.',providerFactory:()=>new $s}],jS=!1;function eE(){let n=Ht.getInstance(),t=[];for(let e of ZS){let o=n.getAlgorithmData(e.id);if(o){t.push(o);continue}let r=new Se.Builder().id(e.id).name(e.name).description(e.description).definingBundleId("org.eclipse.elk.core").providerFactory(e.providerFactory).supportedFeatures(new Set).create();n.registerLayoutMetaDataProviders({apply(i){i.register(r)}}),t.push(r)}return jS=!0,t}var Da=class{constructor(t){this._includeLabels=!0,this._includePorts=!0,this._includePortLabels=!0,this._includeEdgeHeadTailLabels=!0,this._adapter=t}excludeLabels(){return this._includeLabels=!1,this}excludePorts(){return this._includePorts=!1,this}excludePortLabels(){return this._includePortLabels=!1,this}excludeEdgeHeadTailLabels(){return this._includeEdgeHeadTailLabels=!1,this}process(){let t=this._adapter.getProperty(Zs);for(let e of this._adapter.getNodes())this._processNode(e,t)}processNode(t){let e=this._adapter.getProperty(Zs);this._processNode(t,e)}_processNode(t,e){let o=new dt(t.getPosition().x,t.getPosition().y,t.getSize().x,t.getSize().y),r=new dt;if(this._includeLabels)for(let s of t.getLabels())r.x=s.getPosition().x+t.getPosition().x,r.y=s.getPosition().y+t.getPosition().y,r.width=s.getSize().x,r.height=s.getSize().y,o.union(r);for(let s of t.getPorts()){let a=s.getPosition().x+t.getPosition().x,l=s.getPosition().y+t.getPosition().y;if(this._includePorts&&(r.x=a,r.y=l,r.width=s.getSize().x,r.height=s.getSize().y,o.union(r)),this._includePortLabels)for(let c of s.getLabels())r.x=c.getPosition().x+a,r.y=c.getPosition().y+l,r.width=c.getSize().x,r.height=c.getSize().y,o.union(r);if(this._includeEdgeHeadTailLabels){let c=new O(-e,-e);if(t.getProperty(Ir).has(it.OUTSIDE))for(let g of s.getLabels())c.x+=g.getSize().x+e,c.y+=g.getSize().y+e;c.x=Math.max(c.x,0),c.y=Math.max(c.y,0),this._processEdgeHeadTailLabels(o,s.getOutgoingEdges(),s.getIncomingEdges(),t,s,c,e)}}this._includeEdgeHeadTailLabels&&this._processEdgeHeadTailLabels(o,t.getOutgoingEdges(),t.getIncomingEdges(),t,null,null,e);let i=new me(t.getMargin());i.top=Math.max(0,t.getPosition().y-o.y),i.bottom=Math.max(0,o.y+o.height-(t.getPosition().y+t.getSize().y)),i.left=Math.max(0,t.getPosition().x-o.x),i.right=Math.max(0,o.x+o.width-(t.getPosition().x+t.getSize().x)),t.setMargin(i)}_processEdgeHeadTailLabels(t,e,o,r,i,s,a){let l=new dt;for(let c of e)for(let g of c.getLabels())g.getProperty(Aa)===St.TAIL&&(this._computeLabelBox(l,g,!1,r,i,s,a),t.union(l));for(let c of o)for(let g of c.getLabels())g.getProperty(Aa)===St.HEAD&&(this._computeLabelBox(l,g,!0,r,i,s,a),t.union(l))}_computeLabelBox(t,e,o,r,i,s,a){if(t.x=r.getPosition().x,t.y=r.getPosition().y,i!=null&&(t.x+=i.getPosition().x,t.y+=i.getPosition().y),t.width=e.getSize().x,t.height=e.getSize().y,i==null)o?t.x-=a+e.getSize().x:t.x+=r.getSize().x+a;else switch(i.getSide()){case u.UNDEFINED:case u.EAST:t.x+=i.getSize().x+a+s.x+a;break;case u.WEST:t.x-=a+s.x+a+e.getSize().x;break;case u.NORTH:t.x+=i.getSize().x+a,t.y-=a+s.y+a+e.getSize().y;break;case u.SOUTH:t.x+=i.getSize().x+a,t.y+=i.getSize().y+a+s.y+a;break}}};var G=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};G.BEGIN=new G("BEGIN");G.CENTER=new G("CENTER");G.END=new G("END");var Si=class{constructor(){this._padding=new yt,this._cellRectangle=new dt,this._contributesToMinimumWidth=!1,this._contributesToMinimumHeight=!1}getPadding(){return this._padding}getCellRectangle(){return this._cellRectangle}isContributingToMinimumWidth(){return this._contributesToMinimumWidth}setContributesToMinimumWidth(t){this._contributesToMinimumWidth=t}isContributingToMinimumHeight(){return this._contributesToMinimumHeight}setContributesToMinimumHeight(t){this._contributesToMinimumHeight=t}getMinimumWidth(){throw new Error("getMinimumWidth() must be implemented by subclass")}getMinimumHeight(){throw new Error("getMinimumHeight() must be implemented by subclass")}};var ds=class extends Si{constructor(){super(),this._minimumContentAreaSize=new O}getMinimumContentAreaSize(){return this._minimumContentAreaSize}setMinimumContentAreaSize(t,e){if(e){let o=this.getPadding();this._minimumContentAreaSize.x=t.x-o.left-o.right,this._minimumContentAreaSize.y=t.y-o.top-o.bottom}else this._minimumContentAreaSize.set(t)}getMinimumWidth(){let t=this.getPadding();return this._minimumContentAreaSize.x+t.left+t.right}getMinimumHeight(){let t=this.getPadding();return this._minimumContentAreaSize.y+t.top+t.bottom}};var Ze=class extends Si{layoutChildrenHorizontally(){throw new Error("layoutChildrenHorizontally() must be implemented by subclass")}layoutChildrenVertically(){throw new Error("layoutChildrenVertically() must be implemented by subclass")}static minWidthOfCell(t,e){return t==null||e&&!t.isContributingToMinimumWidth()||t instanceof ds&&t.getMinimumContentAreaSize().x===0?0:t.getMinimumWidth()}static minHeightOfCell(t,e){return t==null||e&&!t.isContributingToMinimumHeight()||t instanceof ds&&t.getMinimumContentAreaSize().y===0?0:t.getMinimumHeight()}applyHorizontalLayout(t,e,o){if(t!=null){let r=t.getCellRectangle();r.x=e,r.width=o}}applyVerticalLayout(t,e,o){if(t!=null){let r=t.getCellRectangle();r.y=e,r.height=o}}};var ve=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};ve.VERTICAL=new ve("VERTICAL");ve.HORIZONTAL=new ve("HORIZONTAL");var oE=new Map([[G.BEGIN,0],[G.CENTER,1],[G.END,2]]),Rr=class extends Ze{constructor(t,e,o){super(),this._containerMode=t,this._symmetrical=e,this._gap=o,this._cells=[null,null,null]}getContainerMode(){return this._containerMode}getGap(){return this._gap}getCell(t){return this._cells[oE.get(t)]}setCell(t,e){this._cells[oE.get(t)]=e}getMinimumWidth(){let t=0,e=this.getPadding();if(this._containerMode===ve.VERTICAL)for(let o of this._cells)o!=null&&o.isContributingToMinimumWidth()&&(t=Math.max(t,o.getMinimumWidth()));else{let o=this._minCellWidths(!0),r=0;for(let i of o)i>0&&(t+=i,r++);r>1&&(t+=this._gap*(r-1))}return t>0?t+e.left+e.right:0}getMinimumHeight(){let t=0,e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=this._minCellHeights(!0),r=0;for(let i of o)i>0&&(t+=i,r++);r>1&&(t+=this._gap*(r-1))}else for(let o of this._cells)o!=null&&o.isContributingToMinimumHeight()&&(t=Math.max(t,o.getMinimumHeight()));return t>0?t+e.top+e.bottom:0}layoutChildrenHorizontally(){let t=this.getCellRectangle(),e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=t.x+e.left,r=t.width-e.left-e.right;for(let i of this._cells)this.applyHorizontalLayout(i,o,r)}else{let o=this._minCellWidths(!1);this.applyHorizontalLayout(this._cells[0],t.x+e.left,o[0]),this.applyHorizontalLayout(this._cells[2],t.x+t.width-e.right-o[2],o[2]);let r=t.width-e.left-e.right;o[0]>0&&(r-=o[0]+this._gap,o[0]+=this._gap),o[2]>0&&(r-=o[2]+this._gap),o[1]=Math.max(o[1],r),this.applyHorizontalLayout(this._cells[1],t.x+e.left+o[0]-(o[1]-r)/2,o[1])}for(let o of this._cells)o instanceof Ze&&o.layoutChildrenHorizontally()}layoutChildrenVertically(){let t=this.getCellRectangle(),e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=this._minCellHeights(!1);this.applyVerticalLayout(this._cells[0],t.y+e.top,o[0]),this.applyVerticalLayout(this._cells[2],t.y+t.height-e.bottom-o[2],o[2]);let i=t.height-e.top-e.bottom;o[0]>0&&(o[0]+=this._gap,i-=o[0]),o[2]>0&&(i-=o[2]+this._gap),o[1]=Math.max(o[1],i),this.applyVerticalLayout(this._cells[1],t.y+e.top+o[0]-(o[1]-i)/2,o[1])}else{let o=t.y+e.top,r=t.height-e.top-e.bottom;for(let i of this._cells)this.applyVerticalLayout(i,o,r)}for(let o of this._cells)o instanceof Ze&&o.layoutChildrenVertically()}_minCellWidths(t){let e=[Ze.minWidthOfCell(this._cells[0],t),Ze.minWidthOfCell(this._cells[1],t),Ze.minWidthOfCell(this._cells[2],t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}_minCellHeights(t){let e=[Ze.minHeightOfCell(this._cells[0],t),Ze.minHeightOfCell(this._cells[1],t),Ze.minHeightOfCell(this._cells[2],t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}};var bo=class n extends ge{constructor(t){if(super(),t){let e=t.getAllProperties(),o=this.getAllProperties();for(let[r,i]of e)o.set(r,i)}}static getIndividualOrInherited(t,e){let o=null;if(t.hasProperty(as)){let r=t.getProperty(as);r&&r.hasProperty(e)&&(o=r.getProperty(e))}if(o==null)if(typeof t.getGraph=="function"){let r=t.getGraph();r!=null&&(o=r.getProperty(e)),o==null&&typeof e.getDefault=="function"&&(o=e.getDefault())}else{let r=typeof t.getParent=="function"?t.getParent():t.parent;r!=null&&(o=r.getProperty(e))}return o}toString(){let t=[];for(let[e,o]of this.getAllProperties())t.push(`${e.getId()}:${o}`);return t.join(n.SERIALIZED_OPTION_SEPARATOR)}parse(t){if(!(t==null||t===""))try{let e=t.split(n.SERIALIZED_OPTION_SEPARATOR);for(let o of e){let r=o.indexOf(":");if(r<0)throw new Error(`Invalid option format: ${o}`);let i=o.substring(0,r),s=o.substring(r+1),a=Ht.getInstance().getOptionDataBySuffix(i);if(a==null)throw new Error(`Invalid option id: ${i}`);let l=a.parseValue(s);if(l==null)throw new Error(`Invalid option value: ${s}`);this.setProperty(a,l)}}catch(e){throw new Error("The given string does not match the expected format for individual spacings: "+(e&&e.message?e.message:String(e)))}}};bo.SERIALIZED_OPTION_SEPARATOR=";,;";var Du=class{constructor(t,e){this._sideComparator=t,this._valueComparator=e,this._byKey=new Map}put(t,e){let o=this._byKey.get(t);o==null&&(o=[],this._byKey.set(t,o)),o.push(e),o.sort(this._valueComparator)}get(t){var e;return(e=this._byKey.get(t))!=null?e:[]}containsKey(t){return this._byKey.has(t)}values(){let t=[...this._byKey.keys()].sort(this._sideComparator),e=[];for(let o of t)for(let r of this._byKey.get(o))e.push(r);return e}get size(){let t=0;for(let e of this._byKey.values())t+=e.length;return t}},qs=class n{constructor(t,e){if(this.node=e,this.nodeSize=new O(e.getSize()),this.topdownLayout=e.getProperty(js),this.treatAsCompoundNode=e.isCompoundNode()||e.getProperty(ls),this.sizeConstraints=e.getProperty(Mo),this.sizeOptions=e.getProperty(Oo),this.portConstraints=e.getProperty(cr),this.portLabelsPlacement=e.getProperty(Ir),!it.isValid(this.portLabelsPlacement))throw new Error(`Invalid port label placement: ${[...this.portLabelsPlacement]}`);if(this.portLabelsTreatAsGroup=e.getProperty(Su),this.nodeLabelPlacement=k.ensureSet(e.getProperty(Kr)),!k.isValid(this.nodeLabelPlacement))throw new Error(`Invalid node label placement: ${[...this.nodeLabelPlacement]}`);this.nodeLabelsPadding=bo.getIndividualOrInherited(e,pu),this.nodeLabelSpacing=bo.getIndividualOrInherited(e,Zs),this.labelLabelSpacing=bo.getIndividualOrInherited(e,hu),this.portPortSpacing=bo.getIndividualOrInherited(e,uu),this.portLabelSpacingHorizontal=bo.getIndividualOrInherited(e,du),this.portLabelSpacingVertical=bo.getIndividualOrInherited(e,fu),this.surroundingPortMargins=bo.getIndividualOrInherited(e,_u),this.labelCellSpacing=2*this.labelLabelSpacing;let o=!this.sizeOptions.has(Nt.ASYMMETRICAL);this.nodeContainer=new Rr(ve.VERTICAL,o,0),this.nodeContainerMiddleRow=new Rr(ve.HORIZONTAL,o,0),this.nodeContainer.setCell(G.CENTER,this.nodeContainerMiddleRow),this.portContexts=new Du(n.comparePortSides,n.comparePortContexts),this.insideNodeLabelContainer=null,this.insidePortLabelCells=new Map,this.outsideNodeLabelContainers=new Map,this.nodeLabelCells=new Map}applyNodeSize(){this.node.setSize(this.nodeSize)}getPortAlignment(t){let e=null,o=this.node;switch(t){case u.NORTH:o.hasProperty(xl)&&(e=o.getProperty(xl));break;case u.SOUTH:o.hasProperty(Dl)&&(e=o.getProperty(Dl));break;case u.EAST:o.hasProperty(Ml)&&(e=o.getProperty(Ml));break;case u.WEST:o.hasProperty(wl)&&(e=o.getProperty(wl));break}return e==null&&(e=o.getProperty(Eu)),e}static comparePortSides(t,e){return n._PORT_SIDE_ORDINAL.get(t)-n._PORT_SIDE_ORDINAL.get(e)}static comparePortContexts(t,e){let o=n.comparePortSides(t.port.getSide(),e.port.getSide());if(o!==0)return o;switch(t.port.getSide()){case u.NORTH:case u.EAST:return t.port.getVolatileId()-e.port.getVolatileId();case u.SOUTH:case u.WEST:return e.port.getVolatileId()-t.port.getVolatileId();default:return 0}}};qs._PORT_SIDE_ORDINAL=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);var lt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};lt.LEFT=new lt("LEFT");lt.CENTER=new lt("CENTER");lt.RIGHT=new lt("RIGHT");var nt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};nt.TOP=new nt("TOP");nt.CENTER=new nt("CENTER");nt.BOTTOM=new nt("BOTTOM");function $S(n,t){if(n===t)return!0;if(!(n instanceof Set)||!(t instanceof Set)||n.size!==t.size)return!1;for(let e of n)if(!t.has(e))return!1;return!0}var Q=class n{constructor(t,e,o,r,i,s){this.name=t,this._horizontalAlignment=e,this._verticalAlignment=o,this._containerRow=r,this._containerColumn=i,this._assignedPlacements=s,Object.freeze(this)}getHorizontalAlignment(){return this._horizontalAlignment}getVerticalAlignment(){return this._verticalAlignment}getContainerRow(){return this._containerRow}getContainerColumn(){return this._containerColumn}static fromNodeLabelPlacement(t){for(let e of n.values())for(let o of e._assignedPlacements)if($S(o,t))return e;return n.UNDEFINED}static values(){return n._VALUES}isInsideLocation(){switch(this){case n.IN_T_L:case n.IN_T_C:case n.IN_T_R:case n.IN_C_L:case n.IN_C_C:case n.IN_C_R:case n.IN_B_L:case n.IN_B_C:case n.IN_B_R:return!0;default:return!1}}getOutsideSide(){switch(this){case n.OUT_T_L:case n.OUT_T_C:case n.OUT_T_R:return u.NORTH;case n.OUT_B_L:case n.OUT_B_C:case n.OUT_B_R:return u.SOUTH;case n.OUT_L_T:case n.OUT_L_C:case n.OUT_L_B:return u.WEST;case n.OUT_R_T:case n.OUT_R_C:case n.OUT_R_B:return u.EAST;default:return u.UNDEFINED}}toString(){return this.name}},b=k,vt=(...n)=>new Set(n);Q.OUT_T_L=new Q("OUT_T_L",lt.LEFT,nt.BOTTOM,G.BEGIN,G.BEGIN,[vt(b.OUTSIDE,b.V_TOP,b.H_LEFT)]);Q.OUT_T_C=new Q("OUT_T_C",lt.CENTER,nt.BOTTOM,G.BEGIN,G.CENTER,[vt(b.OUTSIDE,b.V_TOP,b.H_CENTER),vt(b.OUTSIDE,b.V_TOP,b.H_CENTER,b.H_PRIORITY)]);Q.OUT_T_R=new Q("OUT_T_R",lt.RIGHT,nt.BOTTOM,G.BEGIN,G.END,[vt(b.OUTSIDE,b.V_TOP,b.H_RIGHT)]);Q.OUT_B_L=new Q("OUT_B_L",lt.LEFT,nt.TOP,G.END,G.BEGIN,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_LEFT)]);Q.OUT_B_C=new Q("OUT_B_C",lt.CENTER,nt.TOP,G.END,G.CENTER,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_CENTER),vt(b.OUTSIDE,b.V_BOTTOM,b.H_CENTER,b.H_PRIORITY)]);Q.OUT_B_R=new Q("OUT_B_R",lt.RIGHT,nt.TOP,G.END,G.END,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_RIGHT)]);Q.OUT_L_T=new Q("OUT_L_T",lt.RIGHT,nt.TOP,G.BEGIN,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_TOP,b.H_PRIORITY)]);Q.OUT_L_C=new Q("OUT_L_C",lt.RIGHT,nt.CENTER,G.CENTER,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_CENTER),vt(b.OUTSIDE,b.H_LEFT,b.V_CENTER,b.H_PRIORITY)]);Q.OUT_L_B=new Q("OUT_L_B",lt.RIGHT,nt.BOTTOM,G.END,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_BOTTOM,b.H_PRIORITY)]);Q.OUT_R_T=new Q("OUT_R_T",lt.LEFT,nt.TOP,G.BEGIN,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_TOP,b.H_PRIORITY)]);Q.OUT_R_C=new Q("OUT_R_C",lt.LEFT,nt.CENTER,G.CENTER,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_CENTER),vt(b.OUTSIDE,b.H_RIGHT,b.V_CENTER,b.H_PRIORITY)]);Q.OUT_R_B=new Q("OUT_R_B",lt.LEFT,nt.BOTTOM,G.END,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_BOTTOM,b.H_PRIORITY)]);Q.IN_T_L=new Q("IN_T_L",lt.LEFT,nt.TOP,G.BEGIN,G.BEGIN,[vt(b.INSIDE,b.V_TOP,b.H_LEFT),vt(b.INSIDE,b.V_TOP,b.H_LEFT,b.H_PRIORITY)]);Q.IN_T_C=new Q("IN_T_C",lt.CENTER,nt.TOP,G.BEGIN,G.CENTER,[vt(b.INSIDE,b.V_TOP,b.H_CENTER),vt(b.INSIDE,b.V_TOP,b.H_CENTER,b.H_PRIORITY)]);Q.IN_T_R=new Q("IN_T_R",lt.RIGHT,nt.TOP,G.BEGIN,G.END,[vt(b.INSIDE,b.V_TOP,b.H_RIGHT),vt(b.INSIDE,b.V_TOP,b.H_RIGHT,b.H_PRIORITY)]);Q.IN_C_L=new Q("IN_C_L",lt.LEFT,nt.CENTER,G.CENTER,G.BEGIN,[vt(b.INSIDE,b.V_CENTER,b.H_LEFT),vt(b.INSIDE,b.V_CENTER,b.H_LEFT,b.H_PRIORITY)]);Q.IN_C_C=new Q("IN_C_C",lt.CENTER,nt.CENTER,G.CENTER,G.CENTER,[vt(b.INSIDE,b.V_CENTER,b.H_CENTER),vt(b.INSIDE,b.V_CENTER,b.H_CENTER,b.H_PRIORITY)]);Q.IN_C_R=new Q("IN_C_R",lt.RIGHT,nt.CENTER,G.CENTER,G.END,[vt(b.INSIDE,b.V_CENTER,b.H_RIGHT),vt(b.INSIDE,b.V_CENTER,b.H_RIGHT,b.H_PRIORITY)]);Q.IN_B_L=new Q("IN_B_L",lt.LEFT,nt.BOTTOM,G.END,G.BEGIN,[vt(b.INSIDE,b.V_BOTTOM,b.H_LEFT),vt(b.INSIDE,b.V_BOTTOM,b.H_LEFT,b.H_PRIORITY)]);Q.IN_B_C=new Q("IN_B_C",lt.CENTER,nt.BOTTOM,G.END,G.CENTER,[vt(b.INSIDE,b.V_BOTTOM,b.H_CENTER),vt(b.INSIDE,b.V_BOTTOM,b.H_CENTER,b.H_PRIORITY)]);Q.IN_B_R=new Q("IN_B_R",lt.RIGHT,nt.BOTTOM,G.END,G.END,[vt(b.INSIDE,b.V_BOTTOM,b.H_RIGHT),vt(b.INSIDE,b.V_BOTTOM,b.H_RIGHT,b.H_PRIORITY)]);Q.UNDEFINED=new Q("UNDEFINED",null,null,null,null,[]);Q._VALUES=[Q.OUT_T_L,Q.OUT_T_C,Q.OUT_T_R,Q.OUT_B_L,Q.OUT_B_C,Q.OUT_B_R,Q.OUT_L_T,Q.OUT_L_C,Q.OUT_L_B,Q.OUT_R_T,Q.OUT_R_C,Q.OUT_R_B,Q.IN_T_L,Q.IN_T_C,Q.IN_T_R,Q.IN_C_L,Q.IN_C_C,Q.IN_C_R,Q.IN_B_L,Q.IN_B_C,Q.IN_B_R,Q.UNDEFINED];var wa=class{static configureCellSystemSizeContributions(t){if(t.sizeConstraints.size!==0){if(t.sizeConstraints.has(mt.PORTS)){t.insidePortLabelCells.get(u.NORTH).setContributesToMinimumWidth(!0),t.insidePortLabelCells.get(u.SOUTH).setContributesToMinimumWidth(!0);let e=t.portConstraints!==H.FIXED_RATIO&&t.portConstraints!==H.FIXED_POS;t.insidePortLabelCells.get(u.EAST).setContributesToMinimumHeight(e),t.insidePortLabelCells.get(u.WEST).setContributesToMinimumHeight(e),t.nodeContainerMiddleRow.setContributesToMinimumHeight(e),t.sizeConstraints.has(mt.PORT_LABELS)&&(t.insidePortLabelCells.get(u.NORTH).setContributesToMinimumHeight(!0),t.insidePortLabelCells.get(u.SOUTH).setContributesToMinimumHeight(!0),t.insidePortLabelCells.get(u.EAST).setContributesToMinimumWidth(!0),t.insidePortLabelCells.get(u.WEST).setContributesToMinimumWidth(!0),t.nodeContainerMiddleRow.setContributesToMinimumWidth(!0))}if(t.sizeConstraints.has(mt.NODE_LABELS)){t.insideNodeLabelContainer.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.setContributesToMinimumWidth(!0),t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.nodeContainerMiddleRow.setContributesToMinimumWidth(!0);let e=t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG);for(let o of Q.values()){let r=t.nodeLabelCells.get(o);r!=null&&(o.isInsideLocation()?(r.setContributesToMinimumHeight(!0),r.setContributesToMinimumWidth(!0)):(r.setContributesToMinimumHeight(!e),r.setContributesToMinimumWidth(!e)))}}t.sizeConstraints.has(mt.MINIMUM_SIZE)&&t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)&&(t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.isContributingToMinimumHeight()||(t.insideNodeLabelContainer.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.setContributesToMinimumWidth(!0),t.insideNodeLabelContainer.setOnlyCenterCellContributesToMinimumSize(!0)))}}static updateVerticalInsidePortLabelCellPadding(t){if(t.portConstraints===H.FIXED_RATIO||t.portConstraints===H.FIXED_POS)return;let e=t.nodeContainer.getPadding().top+t.insidePortLabelCells.get(u.NORTH).getMinimumHeight()+t.labelCellSpacing,o=t.nodeContainer.getPadding().bottom+t.insidePortLabelCells.get(u.SOUTH).getMinimumHeight()+t.labelCellSpacing,r=t.insidePortLabelCells.get(u.EAST),i=t.insidePortLabelCells.get(u.WEST),s=Math.max(0,r.getPadding().top-e);s=Math.max(s,i.getPadding().top-e);let a=Math.max(0,r.getPadding().bottom-o);a=Math.max(a,i.getPadding().bottom-o),r.getPadding().top=s,i.getPadding().top=s,r.getPadding().bottom=a,i.getPadding().bottom=a}};var Lr=class n{static placeHorizontalPorts(t){switch(t.portConstraints){case H.FIXED_POS:n._placeHorizontalFixedPosPorts(t,u.NORTH),n._placeHorizontalFixedPosPorts(t,u.SOUTH);break;case H.FIXED_RATIO:n._placeHorizontalFixedRatioPorts(t,u.NORTH),n._placeHorizontalFixedRatioPorts(t,u.SOUTH);break;default:n._placeHorizontalFreePorts(t,u.NORTH),n._placeHorizontalFreePorts(t,u.SOUTH);break}}static _placeHorizontalFixedPosPorts(t,e){for(let o of t.portContexts.get(e))o.portPosition.y=n._calculateHorizontalPortYCoordinate(o)}static _placeHorizontalFixedRatioPorts(t,e){let o=t.nodeSize.x;for(let r of t.portContexts.get(e))r.portPosition.x=o*r.port.getProperty(n.PORT_RATIO_OR_POSITION),r.portPosition.y=n._calculateHorizontalPortYCoordinate(r)}static _placeHorizontalFreePorts(t,e){let o=t.portContexts.get(e);if(o.length===0)return;let r=t.insidePortLabelCells.get(e),i=r.getCellRectangle(),s=r.getPadding(),a=t.getPortAlignment(e),l=i.width-s.left-s.right,c=r.getMinimumContentAreaSize().x,g=i.x+s.left,h=t.portPortSpacing;if((a===Jt.DISTRIBUTED||a===Jt.JUSTIFIED)&&o.length===1&&(c=n._modifiedPortPlacementSize(t,a,c),a=Jt.CENTER),l<c&&!t.sizeOptions.has(Nt.PORTS_OVERHANG))a===Jt.DISTRIBUTED?(h+=(l-c)/(o.length+1),g+=h):h+=(l-c)/(o.length-1);else switch(l<c&&(c=n._modifiedPortPlacementSize(t,a,c),a=Jt.CENTER),a){case Jt.BEGIN:break;case Jt.CENTER:g+=(l-c)/2;break;case Jt.END:g+=l-c;break;case Jt.DISTRIBUTED:{let d=(l-c)/(o.length+1);h+=Math.max(0,d),g+=h;break}case Jt.JUSTIFIED:{let d=(l-c)/(o.length-1);h+=Math.max(0,d);break}}for(let d of o)d.portPosition.x=g+d.portMargin.left,d.portPosition.y=n._calculateHorizontalPortYCoordinate(d),g+=d.portMargin.left+d.port.getSize().x+d.portMargin.right+h}static _calculateHorizontalPortYCoordinate(t){let e=t.port;return e.hasProperty(Ke)?e.getSide()===u.NORTH?-e.getSize().y-e.getProperty(Ke):e.getProperty(Ke):e.getSide()===u.NORTH?-e.getSize().y:0}static placeVerticalPorts(t){switch(t.portConstraints){case H.FIXED_POS:n._placeVerticalFixedPosPorts(t,u.EAST),n._placeVerticalFixedPosPorts(t,u.WEST);break;case H.FIXED_RATIO:n._placeVerticalFixedRatioPorts(t,u.EAST),n._placeVerticalFixedRatioPorts(t,u.WEST);break;default:n._placeVerticalFreePorts(t,u.EAST),n._placeVerticalFreePorts(t,u.WEST);break}}static _placeVerticalFixedPosPorts(t,e){let o=t.nodeSize.x;for(let r of t.portContexts.get(e))r.portPosition.x=n._calculateVerticalPortXCoordinate(r,o)}static _placeVerticalFixedRatioPorts(t,e){let o=t.nodeSize;for(let r of t.portContexts.get(e))r.portPosition.x=n._calculateVerticalPortXCoordinate(r,o.x),r.portPosition.y=o.y*r.port.getProperty(n.PORT_RATIO_OR_POSITION)}static _placeVerticalFreePorts(t,e){let o=t.portContexts.get(e);if(o.length===0)return;let r=t.insidePortLabelCells.get(e),i=r.getCellRectangle(),s=r.getPadding(),a=t.getPortAlignment(e),l=i.height-s.top-s.bottom,c=r.getMinimumContentAreaSize().y,g=i.y+s.top,h=t.portPortSpacing,d=t.nodeSize.x;if((a===Jt.DISTRIBUTED||a===Jt.JUSTIFIED)&&o.length===1&&(c=n._modifiedPortPlacementSize(t,a,c),a=Jt.CENTER),l<c&&!t.sizeOptions.has(Nt.PORTS_OVERHANG))a===Jt.DISTRIBUTED?(h+=(l-c)/(o.length+1),g+=h):h+=(l-c)/(o.length-1);else switch(l<c&&(c=n._modifiedPortPlacementSize(t,a,c),a=Jt.CENTER),a){case Jt.BEGIN:break;case Jt.CENTER:g+=(l-c)/2;break;case Jt.END:g+=l-c;break;case Jt.DISTRIBUTED:{let f=(l-c)/(o.length+1);h+=Math.max(0,f),g+=h;break}case Jt.JUSTIFIED:{let f=(l-c)/(o.length-1);h+=Math.max(0,f);break}}for(let f of o)f.portPosition.x=n._calculateVerticalPortXCoordinate(f,d),f.portPosition.y=g+f.portMargin.top,g+=f.portMargin.top+f.port.getSize().y+f.portMargin.bottom+h}static _calculateVerticalPortXCoordinate(t,e){let o=t.port;return o.hasProperty(Ke)?o.getSide()===u.WEST?-o.getSize().x-o.getProperty(Ke):e+o.getProperty(Ke):o.getSide()===u.WEST?-o.getSize().x:e}static _modifiedPortPlacementSize(t,e,o){return e===Jt.DISTRIBUTED?o-2*t.portPortSpacing:o}};Lr.PORT_RATIO_OR_POSITION=new m("portRatioOrPosition",0);var qS=.01;function JS(n,t,e){return Math.abs(n-t)<e}var Ti=class n{static calculateHorizontalPortPlacementSize(t){switch(t.portConstraints){case H.FIXED_POS:n._calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,u.SOUTH);break;case H.FIXED_RATIO:n._calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,u.SOUTH);break;default:n._calculateHorizontalNodeSizeRequiredByFreePorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFreePorts(t,u.SOUTH);break}}static _calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,e){let o=0;for(let i of t.portContexts.get(e))o=Math.max(o,i.portPosition.x+i.port.getSize().x);let r=t.insidePortLabelCells.get(e);r.getPadding().left=0,r.getMinimumContentAreaSize().x=o}static _calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,e){let o=t.insidePortLabelCells.get(e),r=t.portContexts.get(e);if(r.length===0){o.getPadding().left=0,o.getPadding().right=0;return}let i=t.portLabelsPlacement.has(it.INSIDE),s=0,a=null,l=0,c=0;for(let g of r){let h=g.port.getProperty(Lr.PORT_RATIO_OR_POSITION),d=g.port.getSize().x;if(t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e),a==null)t.surroundingPortMargins!=null&&t.surroundingPortMargins.left>0&&(s=Math.max(s,n.minSizeRequiredToRespectSpacing(t.surroundingPortMargins.left+g.portMargin.left,0,h)));else{let f=c+a.portMargin.right+t.portPortSpacing+g.portMargin.left;s=Math.max(s,n.minSizeRequiredToRespectSpacing(f,l,h))}a=g,l=h,c=d}if(t.surroundingPortMargins!=null&&t.surroundingPortMargins.right>0){let g=c+t.surroundingPortMargins.right;i&&(g+=a.portMargin.right),s=Math.max(s,n.minSizeRequiredToRespectSpacing(g,l,1))}o.getPadding().left=0,o.getMinimumContentAreaSize().x=s}static minSizeRequiredToRespectSpacing(t,e,o){return JS(e,o,qS)?0:t/(o-e)}static _calculateHorizontalNodeSizeRequiredByFreePorts(t,e){let o=t.insidePortLabelCells.get(e);if(t.portContexts.get(e).length===0){o.getPadding().left=0,o.getPadding().right=0;return}o.getPadding().left=t.surroundingPortMargins.left,o.getPadding().right=t.surroundingPortMargins.right,t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let r=n._portWidthPlusPortPortSpacing(t,e);t.getPortAlignment(e)===Jt.DISTRIBUTED&&(r+=2*t.portPortSpacing),o.getMinimumContentAreaSize().x=r}static _setupPortMargins(t,e){let o=t.portContexts.get(e),r=t.portLabelsPlacement.has(it.OUTSIDE),i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE),a=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),l=t.sizeOptions.has(Nt.UNIFORM_PORT_SPACING),c=!i&&!s&&(a||o.length===2);n._computeHorizontalPortMargins(t,e,r);let g=null,h=null;r&&o.length>0&&(g=o[0],h=o[o.length-1],g.portMargin.left=0,h.portMargin.right=0,c&&!g.labelsNextToPort&&(g.portMargin.right=0)),l&&(n._unifyPortMargins(o),r&&g!=null&&(g.portMargin.left=0,h.portMargin.right=0))}static _computeHorizontalPortMargins(t,e,o){for(let r of t.portContexts.get(e)){let i=r.portLabelCell!=null?r.portLabelCell.getMinimumWidth():0;if(i>0)if(r.labelsNextToPort){let s=r.port.getSize().x;if(i>s){let a=(i-s)/2;r.portMargin.left=a,r.portMargin.right=a}}else r.portMargin.right=t.portLabelSpacingHorizontal+i;else if(it.isFixed(t.portLabelsPlacement)){let s=Ia(r.port);s.x<0&&(r.portMargin.left=-s.x),s.x+s.width>r.port.getSize().x&&(r.portMargin.right=s.x+s.width-r.port.getSize().x)}}}static _unifyPortMargins(t){let e=0,o=0;for(let r of t)e=Math.max(e,r.portMargin.left),o=Math.max(o,r.portMargin.right);for(let r of t)r.portMargin.left=e,r.portMargin.right=o}static _portWidthPlusPortPortSpacing(t,e){let o=0,r=t.portContexts.get(e);for(let i=0;i<r.length;i++){let s=r[i];o+=s.portMargin.left+s.port.getSize().x+s.portMargin.right,i<r.length-1&&(o+=t.portPortSpacing)}return o}};var Vl=class n{static createInsidePortLabelCells(t){n._createInsidePortLabelCell(t,t.nodeContainer,G.BEGIN,u.NORTH),n._createInsidePortLabelCell(t,t.nodeContainer,G.END,u.SOUTH),n._createInsidePortLabelCell(t,t.nodeContainerMiddleRow,G.BEGIN,u.WEST),n._createInsidePortLabelCell(t,t.nodeContainerMiddleRow,G.END,u.EAST),n._setupNorthOrSouthPortLabelCell(t,u.NORTH),n._setupNorthOrSouthPortLabelCell(t,u.SOUTH),n._setupEastOrWestPortLabelCell(t,u.EAST),n._setupEastOrWestPortLabelCell(t,u.WEST)}static _createInsidePortLabelCell(t,e,o,r){let i=new ds;e.setCell(o,i),t.insidePortLabelCells.set(r,i)}static _setupNorthOrSouthPortLabelCell(t,e){let o=t.insidePortLabelCells.get(e).getPadding();switch(e){case u.NORTH:t.portLabelSpacingVertical>=0&&(o.top=t.portLabelSpacingVertical);break;case u.SOUTH:t.portLabelSpacingVertical>=0&&(o.bottom=t.portLabelSpacingVertical);break}t.surroundingPortMargins!=null&&(o.left=t.surroundingPortMargins.left,o.right=t.surroundingPortMargins.right)}static _setupEastOrWestPortLabelCell(t,e){t.portLabelsPlacement.has(it.INSIDE)&&n._calculateWidthDueToLabels(t,e),n._setupTopAndBottomPadding(t,e)}static _calculateWidthDueToLabels(t,e){let o=t.insidePortLabelCells.get(e),r=o.getMinimumContentAreaSize();for(let i of t.portContexts.get(e))i.portLabelCell!=null&&(r.x=Math.max(r.x,i.portLabelCell.getMinimumWidth()));if(r.x>0)switch(e){case u.EAST:o.getPadding().right=t.portLabelSpacingHorizontal;break;case u.WEST:o.getPadding().left=t.portLabelSpacingHorizontal;break}}static _setupTopAndBottomPadding(t,e){if(t.surroundingPortMargins!=null){let o=t.insidePortLabelCells.get(e).getPadding();o.top=t.surroundingPortMargins.top,o.bottom=t.surroundingPortMargins.bottom}}};var Xl=class n{static placeLabels(t){n._placeOuterNodeLabelContainers(t);for(let e of t.nodeLabelCells.values())e.applyLabelLayout();for(let e of t.portContexts.values())e.portLabelCell!=null&&e.portLabelCell.applyLabelLayout()}static _placeOuterNodeLabelContainers(t){let e=t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG);n._placeHorizontalOuterNodeLabelContainer(t,e,u.NORTH),n._placeHorizontalOuterNodeLabelContainer(t,e,u.SOUTH),n._placeVerticalOuterNodeLabelContainer(t,e,u.EAST),n._placeVerticalOuterNodeLabelContainer(t,e,u.WEST)}static _placeHorizontalOuterNodeLabelContainer(t,e,o){let r=t.nodeSize,i=t.outsideNodeLabelContainers.get(o);if(i==null)return;let s=i.getCellRectangle();switch(s.width=i.getMinimumWidth(),s.height=i.getMinimumHeight(),s.width=Math.max(s.width,r.x),s.width>r.x&&!e&&(s.width=r.x),s.x=-(s.width-r.x)/2,o){case u.NORTH:s.y=-s.height;break;case u.SOUTH:s.y=r.y;break}i.layoutChildrenHorizontally(),i.layoutChildrenVertically()}static _placeVerticalOuterNodeLabelContainer(t,e,o){let r=t.nodeSize,i=t.outsideNodeLabelContainers.get(o);if(i==null)return;let s=i.getCellRectangle();switch(s.width=i.getMinimumWidth(),s.height=i.getMinimumHeight(),s.height=Math.max(s.height,r.y),s.height>r.y&&!e&&(s.height=r.y),s.y=-(s.height-r.y)/2,o){case u.WEST:s.x=-s.width;break;case u.EAST:s.x=r.x;break}i.layoutChildrenHorizontally(),i.layoutChildrenVertically()}};var fD=new Set([mt.PORT_LABELS]);function QS(n,t){return n.size===1&&n.has(t)}var fo=class n{static setupMinimumClientAreaSize(t){let e=n.getMinimumClientAreaSize(t);e!=null&&t.insideNodeLabelContainer.setCenterCellMinimumSize(e)}static setupNodePaddingForPortsWithOffset(t){let e=t.nodeContainer.getPadding();for(let o of t.portContexts.values()){let r=0;if(o.port.hasProperty(Ke)&&(r=o.port.getProperty(Ke),r<0))switch(o.port.getSide()){case u.NORTH:e.top=Math.max(e.top,-r);break;case u.SOUTH:e.bottom=Math.max(e.bottom,-r);break;case u.EAST:e.right=Math.max(e.right,-r);break;case u.WEST:e.left=Math.max(e.left,-r);break}if(it.isFixed(t.portLabelsPlacement)){let i=Hp(o.port,r),s=!t.node.getProperty(Oo).has(Nt.ASYMMETRICAL),a=!1;switch(o.port.getSide()){case u.NORTH:a=i>e.top,e.top=Math.max(e.top,i),s&&a&&(e.top=Math.max(e.top,e.bottom),e.bottom=e.top+r);break;case u.SOUTH:a=i>e.bottom,e.bottom=Math.max(e.bottom,i),s&&a&&(e.bottom=Math.max(e.bottom,e.top),e.top=e.bottom+r);break;case u.EAST:a=i>e.right,e.right=Math.max(e.right,i),s&&a&&(e.right=Math.max(e.left,e.right),e.left=e.right+r);break;case u.WEST:a=i>e.left,e.left=Math.max(e.left,i),s&&a&&(e.left=Math.max(e.left,e.right),e.right=e.left+r);break}}}}static offsetSouthernPortsByNodeSize(t){let e=t.nodeSize.y;for(let o of t.portContexts.get(u.SOUTH))o.portPosition.y+=e}static setNodePadding(t){if(!t.sizeOptions.has(Nt.COMPUTE_PADDING))return;let e=t.nodeContainer.getCellRectangle(),o=t.insideNodeLabelContainer.getCenterCellRectangle(),r=new yt;r.left=o.x-e.x,r.top=o.y-e.y,r.right=e.x+e.width-(o.x+o.width),r.bottom=e.y+e.height-(o.y+o.height),t.node.setPadding(r)}static applyStuff(t){t.applyNodeSize();for(let e of t.portContexts.values())e.applyPortPosition()}static getMinimumClientAreaSize(t){return t.sizeConstraints.has(mt.MINIMUM_SIZE)&&t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)?n.getMinimumNodeOrClientAreaSize(t):null}static getMinimumNodeSize(t){return t.sizeConstraints.has(mt.MINIMUM_SIZE)&&!t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)?n.getMinimumNodeOrClientAreaSize(t):null}static getMinimumNodeOrClientAreaSize(t){let e=new O(t.node.getProperty(Yo));return t.sizeOptions.has(Nt.DEFAULT_MINIMUM_SIZE)&&(e.x<=0&&(e.x=es),e.y<=0&&(e.y=os)),e}static areSizeConstraintsFixed(t){return t.sizeConstraints.size===0||QS(t.sizeConstraints,mt.PORT_LABELS)}static isFirstOutsidePortLabelPlacedDifferently(t,e){let o=t.portContexts.get(e);if(o.length>=2){let r=o[0],i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.SPACE_EFFICIENT);return!r.labelsNextToPort&&!i&&(o.length===2||s)}return!1}};var rE=3,iE=3,jr=new Map([[G.BEGIN,0],[G.CENTER,1],[G.END,2]]),Kl=class extends Ze{constructor(t,e,o){super(),this._gap=o,this._tabular=t,this._symmetrical=e,this._cells=[[null,null,null],[null,null,null],[null,null,null]],this._centerCellMinimumSize=null,this._onlyCenterCellContributesToMinimumSize=!1,this._centerCellRect=new dt}getGap(){return this._gap}getCell(t,e){return this._cells[jr.get(t)][jr.get(e)]}setCell(t,e,o){this._cells[jr.get(t)][jr.get(e)]=o}setCenterCellMinimumSize(t){this._centerCellMinimumSize=new O(t)}setOnlyCenterCellContributesToMinimumSize(t){this._onlyCenterCellContributesToMinimumSize=t}getCenterCellRectangle(){return new dt(this._centerCellRect)}getMinimumWidth(){let t=0,e=this.getPadding();if(this._onlyCenterCellContributesToMinimumSize)this._centerCellMinimumSize!=null?t=this._centerCellMinimumSize.x:this._cells[1][1]!=null&&(t=this._cells[1][1].getMinimumWidth());else if(this._tabular)t=this._sumWithGaps(this._minColumnWidths(null,!0));else for(let o of[G.BEGIN,G.CENTER,G.END])t=Math.max(t,this._sumWithGaps(this._minColumnWidths(o,!0)));return t>0?t+e.left+e.right:0}getMinimumHeight(){let t=0,e=this.getPadding();return this._onlyCenterCellContributesToMinimumSize?this._centerCellMinimumSize!=null?t=this._centerCellMinimumSize.y:this._cells[1][1]!=null&&(t=this._cells[1][1].getMinimumHeight()):t=this._sumWithGaps(this._minRowHeights(!0)),t>0?t+e.top+e.bottom:0}layoutChildrenHorizontally(){if(this._tabular){let t=this._minColumnWidths(null,!1);for(let e of[G.BEGIN,G.CENTER,G.END])this._applyWidthsToRow(e,t)}else for(let t of[G.BEGIN,G.CENTER,G.END]){let e=this._minColumnWidths(t,!1);this._applyWidthsToRow(t,e)}}layoutChildrenVertically(){let t=this.getCellRectangle(),e=this.getPadding(),o=this._minRowHeights(!1);this._applyHeightToRow(G.BEGIN,t.y+e.top,o),this._applyHeightToRow(G.END,t.y+t.height-e.bottom-o[2],o);let r=t.height-e.top-e.bottom;o[0]>0&&(o[0]+=this._gap,r-=o[0]),o[2]>0&&(o[2]+=this._gap,r-=o[2]),this._centerCellRect.height=Math.max(0,r),this._centerCellRect.y=t.y+e.top+(this._centerCellRect.height-r)/2,o[1]=Math.max(o[1],r),this._applyHeightToRow(G.CENTER,t.y+e.top+o[0]-(o[1]-r)/2,o)}_minColumnWidths(t,e){let o=[this._minWidthOfColumn(G.BEGIN,t,e),this._minWidthOfColumn(G.CENTER,t,e),this._minWidthOfColumn(G.END,t,e)];return this._symmetrical&&(o[0]=Math.max(o[0],o[2]),o[2]=o[0]),o}_minWidthOfColumn(t,e,o){let r=0,i=jr.get(t);if(e==null)for(let s=0;s<rE;s++)r=Math.max(r,Ze.minWidthOfCell(this._cells[s][i],o));else r=Ze.minWidthOfCell(this._cells[jr.get(e)][i],o);return t===G.CENTER&&this._centerCellMinimumSize!=null&&(r=Math.max(r,this._centerCellMinimumSize.x)),r}_minRowHeights(t){let e=[this._minHeightOfRow(G.BEGIN,t),this._minHeightOfRow(G.CENTER,t),this._minHeightOfRow(G.END,t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}_minHeightOfRow(t,e){let o=0,r=jr.get(t);for(let i=0;i<iE;i++)o=Math.max(o,Ze.minHeightOfCell(this._cells[r][i],e));return t===G.CENTER&&this._centerCellMinimumSize!=null&&(o=Math.max(o,this._centerCellMinimumSize.y)),o}_sumWithGaps(t){let e=0,o=0;for(let r of t)r>0&&(e+=r,o++);return o>1&&(e+=this._gap*(o-1)),e}_applyWidthsToRow(t,e){let o=this.getCellRectangle(),r=this.getPadding();this._applyWidthToColumn(G.BEGIN,o.x+r.left,e),this._applyWidthToColumn(G.END,o.x+o.width-r.right-e[2],e);let i=o.width-r.left-r.right;e[0]>0&&(e[0]+=this._gap,i-=e[0]),e[2]>0&&(e[2]+=this._gap,i-=e[2]);let s=Math.max(0,i);e[1]=Math.max(e[1],i),this._applyWidthToColumn(G.CENTER,o.x+r.left+e[0]-(e[1]-i)/2,e),t===G.CENTER&&(this._centerCellRect.width=s,this._centerCellRect.x=o.x+r.left+(s-i)/2)}_applyWidthToColumn(t,e,o){let r=jr.get(t);for(let i=0;i<rE;i++)this.applyHorizontalLayout(this._cells[i][r],e,o[r])}_applyHeightToRow(t,e,o){let r=jr.get(t);for(let i=0;i<iE;i++)this.applyVerticalLayout(this._cells[r][i],e,o[r])}};var Ni=class extends Si{constructor(t,e,o){super(),this._gap=t;let r=!0,i=lt.CENTER,s=nt.CENTER;e==null||(typeof e=="boolean"?r=e:(i=e.getHorizontalAlignment(),s=e.getVerticalAlignment(),o!=null&&(r=o))),this._horizontalLayoutMode=r,this._horizontalAlignment=i,this._verticalAlignment=s,this._labels=[],this._minimumContentAreaSize=new O}getHorizontalAlignment(){return this._horizontalAlignment}setHorizontalAlignment(t){if(t==null)throw new Error("Horizontal alignment cannot be null");return this._horizontalAlignment=t,this}getVerticalAlignment(){return this._verticalAlignment}setVerticalAlignment(t){if(t==null)throw new Error("Vertical alignment cannot be null");return this._verticalAlignment=t,this}getLabels(){return this._labels}getMinimumWidth(){let t=this.getPadding();return this._minimumContentAreaSize.x+t.left+t.right}getMinimumHeight(){let t=this.getPadding();return this._minimumContentAreaSize.y+t.top+t.bottom}addLabel(t){this._labels.push(t);let e=t.getSize();this._horizontalLayoutMode?(this._minimumContentAreaSize.x=Math.max(this._minimumContentAreaSize.x,e.x),this._minimumContentAreaSize.y+=e.y,this._labels.length>1&&(this._minimumContentAreaSize.y+=this._gap)):(this._minimumContentAreaSize.x+=e.x,this._minimumContentAreaSize.y=Math.max(this._minimumContentAreaSize.y,e.y),this._labels.length>1&&(this._minimumContentAreaSize.x+=this._gap))}hasLabels(){return this._labels.length>0}applyLabelLayout(){this._horizontalLayoutMode?this._applyHorizontalModeLabelLayout():this._applyVerticalModeLabelLayout()}_applyHorizontalModeLabelLayout(){let t=this.getCellRectangle(),e=this.getPadding(),o=t.y;this._verticalAlignment===nt.CENTER?o+=(t.height-this._minimumContentAreaSize.y)/2:this._verticalAlignment===nt.BOTTOM&&(o+=t.height-this._minimumContentAreaSize.y);for(let r of this._labels){let i=r.getSize(),s=new O;switch(s.y=o,o+=i.y+this._gap,this._horizontalAlignment){case lt.LEFT:s.x=t.x+e.left;break;case lt.CENTER:s.x=t.x+e.left+(t.width-i.x)/2;break;case lt.RIGHT:s.x=t.x+t.width-e.right-i.x;break}r.setPosition(s)}}_applyVerticalModeLabelLayout(){let t=this.getCellRectangle(),e=this.getPadding(),o=t.x;this._horizontalAlignment===lt.CENTER?o+=(t.width-this._minimumContentAreaSize.x)/2:this._horizontalAlignment===lt.RIGHT&&(o+=t.width-this._minimumContentAreaSize.x);for(let r of this._labels){let i=r.getSize(),s=new O;switch(s.x=o,o+=i.x+this._gap,this._verticalAlignment){case nt.TOP:s.y=t.y+e.top;break;case nt.CENTER:s.y=t.y+e.top+(t.height-i.y)/2;break;case nt.BOTTOM:s.y=t.y+t.height-e.bottom-i.y;break}r.setPosition(s)}}};var Ma=class n{static createNodeLabelCells(t,e,o){n._createNodeLabelCellContainers(t,e);for(let r of t.node.getLabels())n._handleNodeLabel(t,r,e,o)}static _handleNodeLabel(t,e,o,r){let i=e.hasProperty(Kr)?e.getProperty(Kr):t.nodeLabelPlacement,s=i instanceof Set?i:k.ensureSet(i),a=Q.fromNodeLabelPlacement(s);a!==Q.UNDEFINED&&(o&&!a.isInsideLocation()||n._retrieveNodeLabelCell(t,a,r).addLabel(e))}static _createNodeLabelCellContainers(t,e){let o=!t.sizeOptions.has(Nt.ASYMMETRICAL),r=t.sizeOptions.has(Nt.FORCE_TABULAR_NODE_LABELS);if(t.insideNodeLabelContainer=new Kl(r,o,t.labelCellSpacing),t.nodeLabelsPadding!=null&&t.insideNodeLabelContainer.getPadding().copy(t.nodeLabelsPadding),t.nodeContainerMiddleRow.setCell(G.CENTER,t.insideNodeLabelContainer),!e){let i=new Rr(ve.HORIZONTAL,o,t.labelCellSpacing);i.getPadding().bottom=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.NORTH,i);let s=new Rr(ve.HORIZONTAL,o,t.labelCellSpacing);s.getPadding().top=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.SOUTH,s);let a=new Rr(ve.VERTICAL,o,t.labelCellSpacing);a.getPadding().right=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.WEST,a);let l=new Rr(ve.VERTICAL,o,t.labelCellSpacing);l.getPadding().left=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.EAST,l)}}static _retrieveNodeLabelCell(t,e,o){let r=t.nodeLabelCells.get(e);if(r==null)if(r=new Ni(t.labelLabelSpacing,e,o),t.nodeLabelCells.set(e,r),e.isInsideLocation())t.insideNodeLabelContainer.setCell(e.getContainerRow(),e.getContainerColumn(),r);else{let i=e.getOutsideSide(),s=t.outsideNodeLabelContainers.get(i);switch(i){case u.NORTH:case u.SOUTH:r.setContributesToMinimumHeight(!0),s.setCell(e.getContainerColumn(),r);break;case u.WEST:case u.EAST:r.setContributesToMinimumWidth(!0),s.setCell(e.getContainerRow(),r);break}}return r}};var ba=class{static setNodeWidth(t){let e=t.nodeSize,o;if(fo.areSizeConstraintsFixed(t))o=e.x;else{if(t.topdownLayout?o=Math.max(e.x,t.nodeContainer.getMinimumWidth()):o=t.nodeContainer.getMinimumWidth(),t.sizeConstraints.has(mt.NODE_LABELS)&&!t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG)){let s=t.outsideNodeLabelContainers.get(u.NORTH),a=t.outsideNodeLabelContainers.get(u.SOUTH);s!=null&&(o=Math.max(o,s.getMinimumWidth())),a!=null&&(o=Math.max(o,a.getMinimumWidth()))}let i=fo.getMinimumNodeSize(t);i!=null&&(o=Math.max(o,i.x))}t.node.getGraph().getProperty(To)?e.x=Math.max(e.x,o):e.x=o;let r=t.nodeContainer.getCellRectangle();r.x=0,r.width=o,t.nodeContainer.layoutChildrenHorizontally()}static setNodeHeight(t){let e=t.nodeSize,o;if(fo.areSizeConstraintsFixed(t))o=e.y;else{if(t.topdownLayout?o=Math.max(e.y,t.nodeContainer.getMinimumHeight()):o=t.nodeContainer.getMinimumHeight(),t.sizeConstraints.has(mt.NODE_LABELS)&&!t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG)){let s=t.outsideNodeLabelContainers.get(u.EAST),a=t.outsideNodeLabelContainers.get(u.WEST);s!=null&&(o=Math.max(o,s.getMinimumHeight())),a!=null&&(o=Math.max(o,a.getMinimumHeight()))}let i=fo.getMinimumNodeSize(t);if(i!=null&&(o=Math.max(o,i.y)),t.sizeConstraints.has(mt.PORTS)&&(t.portConstraints===H.FIXED_RATIO||t.portConstraints===H.FIXED_POS)){let s=t.insidePortLabelCells.get(u.EAST),a=t.insidePortLabelCells.get(u.WEST);s!=null&&(o=Math.max(o,s.getMinimumHeight())),a!=null&&(o=Math.max(o,a.getMinimumHeight()))}}t.node.getGraph().getProperty(To)?e.y=Math.max(e.y,o):e.y=o;let r=t.nodeContainer.getCellRectangle();r.y=0,r.height=o,t.nodeContainer.layoutChildrenVertically()}};var Zl=class{constructor(t,e){this.parentNodeContext=t,this.port=e,this.portPosition=new O(e.getPosition()),this.portMargin=new me,this.portLabelCell=null;let o=t.portLabelsPlacement,r=o.has(it.NEXT_TO_PORT_IF_POSSIBLE);o.has(it.INSIDE)?t.treatAsCompoundNode?this.labelsNextToPort=r&&!e.hasCompoundConnections():this.labelsNextToPort=!0:o.has(it.OUTSIDE)?r?this.labelsNextToPort=!tT(e):this.labelsNextToPort=!1:this.labelsNextToPort=!1}applyPortPosition(){this.port.setPosition(this.portPosition)}};function tT(n){for(let t of n.getIncomingEdges())return!0;for(let t of n.getOutgoingEdges())return!0;return!1}var jl=class n{static createPortContexts(t,e){let o=!e||!t.portLabelsPlacement.has(it.INSIDE),r=0;for(let i of t.node.getPorts()){if(i.getSide()===u.UNDEFINED)throw new Error("Label and node size calculator can only be used with ports that have port sides assigned.");i.setVolatileId(r++),n._createPortContext(t,i,o)}}static _createPortContext(t,e,o){let r=new Zl(t,e);if(t.portContexts.put(e.getSide(),r),o&&!it.isFixed(t.portLabelsPlacement)){r.portLabelCell=new Ni(t.labelLabelSpacing);for(let i of e.getLabels())r.portLabelCell.addLabel(i)}}};var $l=class n{removeOverlaps(t){let e=t.getVerticalGap(),o=new Set,r=0;for(let i of t.getRectangleNodes()){let s=0;i.getOverlappingNodes().sort(n.compareByYCoordinate);for(let a of i.getOverlappingNodes())if(o.has(a)){let l=i.getRectangle(),c=a.getRectangle();s<c.y+c.height+e&&s+l.height+e>c.y&&(s=c.y+c.height+e)}i.getRectangle().y=s,o.add(i),r=Math.max(r,i.getRectangle().y+i.getRectangle().height)}return r}static compareByYCoordinate(t,e){return t.getRectangle().y-e.getRectangle().y}};var sE=5,Qt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Qt.UP=new Qt("UP");Qt.DOWN=new Qt("DOWN");Qt.LEFT=new Qt("LEFT");Qt.RIGHT=new Qt("RIGHT");var wu=class{constructor(t,e){this._originalRectangle=t,this._rectangle=e,this._overlappingNodes=[]}getRectangle(){return this._rectangle}getOverlappingNodes(){return this._overlappingNodes}get originalRectangle(){return this._originalRectangle}get rectangle(){return this._rectangle}get overlappingNodes(){return this._overlappingNodes}},fs=class n{constructor(){this._overlapRemovalDirection=null,this._gapVertical=sE,this._gapHorizontal=sE,this._startCoordinate=0,this._overlapRemovalStrategy=null,this._rectangleNodes=[]}static createForDirection(t){let e=new n;return e._overlapRemovalDirection=t,e}withGap(t,e){return this._gapHorizontal=t,this._gapVertical=e,this}withStartCoordinate(t){return this._startCoordinate=t,this}withOverlapRemovalStrategy(t){return this._overlapRemovalStrategy=t,this}addRectangle(t){return this._rectangleNodes.push(new wu(t,this._importRectangle(t))),this}getHorizontalGap(){return this._gapHorizontal}getVerticalGap(){return this._gapVertical}getRectangleNodes(){return this._rectangleNodes}_importRectangle(t){switch(this._overlapRemovalDirection){case Qt.UP:case Qt.DOWN:return t;case Qt.LEFT:case Qt.RIGHT:return new dt(t.y,0,t.height,t.width);default:return null}}_exportRectangle(t,e){let o=t.rectangle,r=t.originalRectangle;switch(this._overlapRemovalDirection){case Qt.UP:r.y=this._startCoordinate-o.height-o.y;break;case Qt.DOWN:r.y+=this._startCoordinate;break;case Qt.LEFT:r.x=this._startCoordinate-o.height-o.y;break;case Qt.RIGHT:r.x=this._startCoordinate+o.y;break}}removeOverlaps(){this._overlapRemovalStrategy==null&&(this._overlapRemovalStrategy=new $l),this._rectangleNodes.sort(n._compareLeftRectangleBorders),this._computeOverlaps();let t=this._overlapRemovalStrategy.removeOverlaps(this);for(let e of this._rectangleNodes)this._exportRectangle(e,t);return t}_computeOverlaps(){let t=[];for(let e of this._rectangleNodes){let o=e.rectangle.x;for(;t.length>0;){let s=t[0];if(s.rectangle.x+s.rectangle.width<o)t.shift();else break}for(let s of t)s.overlappingNodes.push(e),e.overlappingNodes.push(s);let r=e.rectangle.x+e.rectangle.width,i=0;for(;i<t.length;){let s=t[i];if(s.rectangle.x+s.rectangle.width>r)break;i++}t.splice(i,0,e)}}static _compareLeftRectangleBorders(t,e){return t.rectangle.x-e.rectangle.x}static _compareRightRectangleBorders(t,e){return t.rectangle.x+t.rectangle.width-(e.rectangle.x+e.rectangle.width)}};var Ga=class n{static placeHorizontalPortLabels(t){n._placePortLabels(t,u.NORTH),n._placePortLabels(t,u.SOUTH)}static placeVerticalPortLabels(t){n._placePortLabels(t,u.EAST),n._placePortLabels(t,u.WEST)}static _placePortLabels(t,e){let o=!t.sizeConstraints.has(mt.PORT_LABELS)||t.portConstraints===H.FIXED_POS;t.portLabelsPlacement.has(it.INSIDE)?o?n._constrainedInsidePortLabelPlacement(t,e):n._simpleInsidePortLabelPlacement(t,e):t.portLabelsPlacement.has(it.OUTSIDE)&&(o?n._constrainedOutsidePortLabelPlacement(t,e):n._simpleOutsidePortLabelPlacement(t,e))}static _simpleInsidePortLabelPlacement(t,e){let o=0,r=n._portLabelBorderOffsetForPortSide(t,e),i=t.portLabelSpacingHorizontal,s=t.portLabelSpacingVertical;for(let a of t.portContexts.get(e)){if(a.portLabelCell==null||!a.portLabelCell.hasLabels())continue;let l=a.port.getSize(),c=a.port.hasProperty(Ke)?a.port.getProperty(Ke):0,g=a.portLabelCell,h=g.getCellRectangle();switch(h.width=g.getMinimumWidth(),h.height=g.getMinimumHeight(),e){case u.NORTH:h.x=a.labelsNextToPort?(l.x-h.width)/2:l.x+i,h.y=l.y+c+r,g.setHorizontalAlignment(lt.CENTER),g.setVerticalAlignment(nt.TOP);break;case u.SOUTH:h.x=a.labelsNextToPort?(l.x-h.width)/2:l.x+i,h.y=-c-r-h.height,g.setHorizontalAlignment(lt.CENTER),g.setVerticalAlignment(nt.BOTTOM);break;case u.EAST:{if(h.x=-c-r-h.width,a.labelsNextToPort){let d=t.portLabelsTreatAsGroup?h.height:g.getLabels()[0].getSize().y;h.y=(l.y-d)/2}else h.y=l.y+s;g.setHorizontalAlignment(lt.RIGHT),g.setVerticalAlignment(nt.CENTER);break}case u.WEST:{if(h.x=l.x+c+r,a.labelsNextToPort){let d=t.portLabelsTreatAsGroup?h.height:g.getLabels()[0].getSize().y;h.y=(l.y-d)/2}else h.y=l.y+s;g.setHorizontalAlignment(lt.LEFT),g.setVerticalAlignment(nt.CENTER);break}}(e===u.NORTH||e===u.SOUTH)&&(o=Math.max(o,h.height))}o>0&&(t.insidePortLabelCells.get(e).getMinimumContentAreaSize().y=o)}static _portLabelBorderOffsetForPortSide(t,e){switch(e){case u.NORTH:return t.nodeContainer.getPadding().top+t.portLabelSpacingVertical;case u.SOUTH:return t.nodeContainer.getPadding().bottom+t.portLabelSpacingVertical;case u.EAST:return t.nodeContainer.getPadding().right+t.portLabelSpacingHorizontal;case u.WEST:return t.nodeContainer.getPadding().left+t.portLabelSpacingHorizontal;default:return 0}}static _constrainedInsidePortLabelPlacement(t,e){let o=t.portContexts.get(e);if(e===u.EAST||e===u.WEST){n._simpleInsidePortLabelPlacement(t,e);return}let r=e===u.NORTH?Qt.DOWN:Qt.UP,i=e===u.NORTH?nt.TOP:nt.BOTTOM,s=t.insidePortLabelCells.get(e),a=s.getCellRectangle(),l=a.x+Math.max(s.getPadding().left,t.surroundingPortMargins.left,t.nodeLabelSpacing),c=a.x+a.width-Math.max(s.getPadding().right,t.surroundingPortMargins.right,t.nodeLabelSpacing),g=fs.createForDirection(r).withGap(t.portLabelSpacingHorizontal,t.portLabelSpacingVertical),h=e===u.NORTH?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;for(let f of o){if(f.portLabelCell==null||!f.portLabelCell.hasLabels())continue;let E=f.port.getSize(),P=f.portPosition,S=f.portLabelCell,T=S.getCellRectangle();T.width=S.getMinimumWidth(),T.height=S.getMinimumHeight(),S.setVerticalAlignment(i),S.setHorizontalAlignment(lt.RIGHT),n._centerPortLabel(T,P,E,l,c),g.addRectangle(T),h=e===u.NORTH?Math.max(h,P.y+f.port.getSize().y):Math.min(h,P.y)}h+=e===u.NORTH?t.portLabelSpacingVertical:-t.portLabelSpacingVertical;let d=g.withStartCoordinate(h).removeOverlaps();d>0&&(t.insidePortLabelCells.get(e).getMinimumContentAreaSize().y=d);for(let f of o){if(f.portLabelCell==null||!f.portLabelCell.hasLabels())continue;let E=f.portLabelCell.getCellRectangle();E.x-=f.portPosition.x,E.y-=f.portPosition.y}}static _centerPortLabel(t,e,o,r,i){t.x=e.x-(t.width-o.x)/2;let s=Math.min(r,e.x),a=Math.max(i,e.x+o.x);t.x<s?t.x=s:t.x+t.width>a&&(t.x=a-t.width)}static _simpleOutsidePortLabelPlacement(t,e){let o=t.portContexts.get(e),r=fo.isFirstOutsidePortLabelPlacedDifferently(t,e),i=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE);for(let s of o){if(s.portLabelCell==null||!s.portLabelCell.hasLabels())continue;let a=s.port.getSize(),l=s.portLabelCell,c=l.getCellRectangle();switch(c.width=l.getMinimumWidth(),c.height=l.getMinimumHeight(),e){case u.NORTH:s.labelsNextToPort?(c.x=(a.x-c.width)/2,l.setHorizontalAlignment(lt.CENTER)):r||i?(c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT)):(c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT)),c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM);break;case u.SOUTH:s.labelsNextToPort?(c.x=(a.x-c.width)/2,l.setHorizontalAlignment(lt.CENTER)):r||i?(c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT)):(c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT)),c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP);break;case u.EAST:{if(s.labelsNextToPort){let g=t.portLabelsTreatAsGroup?c.height:l.getLabels()[0].getSize().y;c.y=(a.y-g)/2,l.setVerticalAlignment(nt.CENTER)}else r||i?(c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM)):(c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP));c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT);break}case u.WEST:{if(s.labelsNextToPort){let g=t.portLabelsTreatAsGroup?c.height:l.getLabels()[0].getSize().y;c.y=(a.y-g)/2,l.setVerticalAlignment(nt.CENTER)}else r||i?(c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM)):(c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP));c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT);break}}r=!1}}static _constrainedOutsidePortLabelPlacement(t,e){let o=t.portContexts.get(e);if(o.length<=2||e===u.EAST||e===u.WEST){n._simpleOutsidePortLabelPlacement(t,e);return}let r=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),i=e===u.NORTH?Qt.UP:Qt.DOWN,s=e===u.NORTH?nt.BOTTOM:nt.TOP,a=fs.createForDirection(i).withGap(t.portLabelSpacingVertical,t.portLabelSpacingHorizontal),l=e===u.NORTH?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;for(let c of o){if(c.portLabelCell==null||!c.portLabelCell.hasLabels())continue;let g=c.port.getSize(),h=c.portPosition,d=c.portLabelCell,f=d.getCellRectangle();f.width=d.getMinimumWidth(),f.height=d.getMinimumHeight(),r?(f.x=h.x-d.getMinimumWidth()-t.portLabelSpacingHorizontal,r=!1):f.x=h.x+g.x+t.portLabelSpacingHorizontal,d.setVerticalAlignment(s),d.setHorizontalAlignment(lt.RIGHT),a.addRectangle(f),l=e===u.NORTH?Math.min(l,h.y):Math.max(l,h.y+c.port.getSize().y)}l+=e===u.NORTH?-t.portLabelSpacingVertical:t.portLabelSpacingVertical,a.withStartCoordinate(l).removeOverlaps();for(let c of o){if(c.portLabelCell==null||!c.portLabelCell.hasLabels())continue;let g=c.portLabelCell.getCellRectangle();g.x-=c.portPosition.x,g.y-=c.portPosition.y}}};var ql=class n{static calculateVerticalPortPlacementSize(t){switch(t.portConstraints){case H.FIXED_POS:n._calculateVerticalNodeSizeRequiredByFixedPosPorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFixedPosPorts(t,u.WEST);break;case H.FIXED_RATIO:n._calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,u.WEST);break;default:n._calculateVerticalNodeSizeRequiredByFreePorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFreePorts(t,u.WEST);break}}static _calculateVerticalNodeSizeRequiredByFixedPosPorts(t,e){let o=0;for(let i of t.portContexts.get(e))o=Math.max(o,i.portPosition.y+i.port.getSize().y);let r=t.insidePortLabelCells.get(e);r.getPadding().top=0,r.getMinimumContentAreaSize().y=o}static _calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,e){let o=t.insidePortLabelCells.get(e),r=t.portContexts.get(e);if(r.length===0){o.getPadding().top=0,o.getPadding().bottom=0;return}let i=t.portLabelsPlacement.has(it.INSIDE),s=0;t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let a=null,l=0,c=0;for(let g of r){let h=g.port.getProperty(Lr.PORT_RATIO_OR_POSITION),d=g.port.getSize().y;if(a==null)t.surroundingPortMargins!=null&&t.surroundingPortMargins.top>0&&(s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(t.surroundingPortMargins.top+g.portMargin.top,0,h)));else{let f=c+a.portMargin.bottom+t.portPortSpacing+g.portMargin.top;s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(f,l,h))}a=g,l=h,c=d}if(t.surroundingPortMargins!=null&&t.surroundingPortMargins.bottom>0){let g=c+t.surroundingPortMargins.bottom;i&&(g+=a.portMargin.bottom),s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(g,l,1))}o.getPadding().top=0,o.getMinimumContentAreaSize().y=s}static _calculateVerticalNodeSizeRequiredByFreePorts(t,e){let o=t.insidePortLabelCells.get(e);if(t.portContexts.get(e).length===0){o.getPadding().top=0,o.getPadding().bottom=0;return}o.getPadding().top=t.surroundingPortMargins.top,o.getPadding().bottom=t.surroundingPortMargins.bottom,t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let r=n._portHeightPlusPortPortSpacing(t,e);t.getPortAlignment(e)===Jt.DISTRIBUTED&&(r+=2*t.portPortSpacing),o.getMinimumContentAreaSize().y=r}static _setupPortMargins(t,e){let o=t.portContexts.get(e),r=t.portLabelsPlacement.has(it.OUTSIDE),i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE),a=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),l=t.sizeOptions.has(Nt.UNIFORM_PORT_SPACING),c=!i&&!s&&(a||o.length===2);n._computeVerticalPortMargins(t,e,r);let g=null,h=null;r&&o.length>0&&(g=o[0],h=o[o.length-1],g.portMargin.top=0,h.portMargin.bottom=0,c&&!g.labelsNextToPort&&(g.portMargin.bottom=0)),l&&(n._unifyPortMargins(o),r&&g!=null&&(g.portMargin.top=0,h.portMargin.bottom=0))}static _computeVerticalPortMargins(t,e,o){for(let r of t.portContexts.get(e)){let i=r.portLabelCell!=null?r.portLabelCell.getMinimumHeight():0;if(i>0)if(r.labelsNextToPort){let s=r.port.getSize().y;if(i>s)if(t.portLabelsTreatAsGroup||r.portLabelCell.getLabels().length===1){let a=(i-s)/2;r.portMargin.top=a,r.portMargin.bottom=a}else{let l=(r.portLabelCell.getLabels()[0].getSize().y-s)/2;r.portMargin.top=Math.max(0,l),r.portMargin.bottom=i-l-s}}else r.portMargin.bottom=t.portLabelSpacingVertical+i;else if(it.isFixed(t.portLabelsPlacement)){let s=Ia(r.port);s.y<0&&(r.portMargin.top=-s.y),s.y+s.height>r.port.getSize().y&&(r.portMargin.bottom=s.y+s.height-r.port.getSize().y)}}}static _unifyPortMargins(t){let e=0,o=0;for(let r of t)e=Math.max(e,r.portMargin.top),o=Math.max(o,r.portMargin.bottom);for(let r of t)r.portMargin.top=e,r.portMargin.bottom=o}static _portHeightPlusPortPortSpacing(t,e){let o=0,r=t.portContexts.get(e);for(let i=0;i<r.length;i++){let s=r[i];o+=s.portMargin.top+s.port.getSize().y+s.portMargin.bottom,i<r.length-1&&(o+=t.portPortSpacing)}return o}};var us=class n{static process(t,e,o=!0,r=!1){if(e==null){for(let a of t.getNodes())n.process(t,a,!0,!1);return}let i=new qs(t,e);jl.createPortContexts(i,r);let s=!0;if(t!=null&&t.hasProperty(lr)){let a=t.getProperty(lr);s=a===R.UNDEFINED||a.isHorizontal()}return Ma.createNodeLabelCells(i,!1,s),Vl.createInsidePortLabelCells(i),fo.setupMinimumClientAreaSize(i),fo.setupNodePaddingForPortsWithOffset(i),Ti.calculateHorizontalPortPlacementSize(i),ql.calculateVerticalPortPlacementSize(i),wa.configureCellSystemSizeContributions(i),ba.setNodeWidth(i),Lr.placeHorizontalPorts(i),Ga.placeHorizontalPortLabels(i),wa.updateVerticalInsidePortLabelCellPadding(i),ba.setNodeHeight(i),o&&(fo.offsetSouthernPortsByNodeSize(i),Lr.placeVerticalPorts(i),Ga.placeVerticalPortLabels(i),Xl.placeLabels(i),fo.setNodePadding(i),fo.applyStuff(i)),i.nodeSize}static computeInsideNodeLabelPadding(t,e,o){let r=new qs(null,e);Ma.createNodeLabelCells(r,!0,!o.isVertical());let i=r.insideNodeLabelContainer,s=new yt;for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(G.BEGIN,a);l!=null&&(s.top=Math.max(s.top,l.getMinimumHeight()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(G.END,a);l!=null&&(s.bottom=Math.max(s.bottom,l.getMinimumHeight()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(a,G.BEGIN);l!=null&&(s.left=Math.max(s.left,l.getMinimumWidth()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(a,G.END);l!=null&&(s.right=Math.max(s.right,l.getMinimumWidth()))}return s.top>0&&(s.top+=i.getPadding().top,s.top+=i.getGap()),s.bottom>0&&(s.bottom+=i.getPadding().bottom,s.bottom+=i.getGap()),s.left>0&&(s.left+=i.getPadding().left,s.left+=i.getGap()),s.right>0&&(s.right+=i.getPadding().right,s.right+=i.getGap()),s}};var No=class{static calculateLabelAndNodeSizes(t){us.process(t)}static calculateNodeMargins(t){new Da(t).process()}static getNodeMarginCalculator(t){return new Da(t)}static sortPortLists(t){for(let e of t.getNodes())e.sortPortList()}};var fe=class fe{constructor(t){this.name=t,Object.freeze(this)}opposite(){switch(this){case fe.ABOVE:return fe.BELOW;case fe.BELOW:return fe.ABOVE;case fe.INLINE:return fe.INLINE;default:return fe.UNKNOWN}}toString(){return this.name}static values(){return[fe.UNKNOWN,fe.ABOVE,fe.BELOW,fe.INLINE]}static valueOf(t){return fe[t]}};Z(fe,"UNKNOWN",new fe("UNKNOWN")),Z(fe,"ABOVE",new fe("ABOVE")),Z(fe,"BELOW",new fe("BELOW")),Z(fe,"INLINE",new fe("INLINE")),Z(fe,"LABEL_SIDE",new m("org.eclipse.elk.labelSide",fe.UNKNOWN));var Vt=fe;var yo=class n{constructor(){throw new Error("ElkGraphAdapters is a namespace and must not be instantiated.")}static adapt(t){return new Mu(t)}static adaptSingleNode(t){let e=t.getParent?t.getParent():t.parent;return new Jl(e==null?null:n.adapt(e),t)}static adaptSinglePort(t){return new Ql(t)}},Js=class{constructor(t){this.element=t,this._volatileId=0}getProperty(t){if(t===Ke){let e=this.element.getProperty(Ke);return e==null?0:e}return this.element.getProperty(t)}hasProperty(t){return this.element.hasProperty(t)}getPosition(){return new O(this.element.getX(),this.element.getY())}getSize(){return new O(this.element.getWidth(),this.element.getHeight())}setSize(t){this.element.setWidth(t.x),this.element.setHeight(t.y)}setPosition(t){this.element.setX(t.x),this.element.setY(t.y)}getPadding(){let t=this.element.getProperty(ns);return t==null?new yt:new yt(t)}setPadding(t){this.element.setProperty(ns,new yt(t))}getMargin(){let t=this.element.getProperty(Nr);return t==null&&(t=new me),t}setMargin(t){this.element.setProperty(Nr,new me(t))}getVolatileId(){return this._volatileId}setVolatileId(t){this._volatileId=t}},Mu=class extends Js{constructor(t){super(t),this._childNodes=null}getNodes(){if(this._childNodes==null){this._childNodes=[];for(let t of this.element.children)this._childNodes.push(new Jl(this,t))}return this._childNodes}},Jl=class extends Js{constructor(t,e){super(e),this._parentGraphAdapter=t,this._labelAdapters=null,this._portAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getGraph(){return this._parentGraphAdapter}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}getPorts(){if(this._portAdapters==null){this._portAdapters=[];for(let t of this.element.ports)this._portAdapters.push(new Ql(t))}return this._portAdapters}getIncomingEdges(){if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let t of _i(this.element))this._incomingEdgeAdapters.push(new Qs(t))}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let t of Ee(this.element))this._outgoingEdgeAdapters.push(new Qs(t))}return this._outgoingEdgeAdapters}sortPortList(t){if(this.element.getProperty(cr).isOrderFixed()){let e=t||aE;this.element.ports.sort(e)}}isCompoundNode(){return this.element.children.length>0||this.element.getProperty(ls)}},Ha=class extends Js{constructor(t){super(t)}getSide(){return this.element.getProperty(Vt.LABEL_SIDE)}getText(){return this.element.getText()}},Ql=class extends Js{constructor(t){super(t),this._labelAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getSide(){return this.element.getProperty(Tr)}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}getIncomingEdges(){if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let t of this.element.incomingEdges)this._incomingEdgeAdapters.push(new Qs(t))}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let t of this.element.outgoingEdges)this._outgoingEdgeAdapters.push(new Qs(t))}return this._outgoingEdgeAdapters}hasCompoundConnections(){let t=this.element.getParent();for(let e of this.element.outgoingEdges)for(let o of e.targets){let r=Pt(o);if(mo(r,t)||r===t&&e.getProperty(Ca))return!0}for(let e of this.element.incomingEdges)for(let o of e.sources)if(mo(Pt(o),t))return!0;return!1}},Qs=class{constructor(t){this.element=t,this._labelAdapters=null}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}},nE=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);function aE(n,t){var a,l;let e=n.getProperty(Tr),o=t.getProperty(Tr),r=((a=nE.get(e))!=null?a:0)-((l=nE.get(o))!=null?l:0);if(r!==0)return r;let i=n.getProperty(Gl),s=t.getProperty(Gl);if(i!=null&&s!=null){let c=i-s;if(c!==0)return c}switch(e){case u.NORTH:return n.getX()-t.getX();case u.EAST:return n.getY()-t.getY();case u.SOUTH:return t.getX()-n.getX();case u.WEST:return t.getY()-n.getY();default:throw new Error("Port side is undefined")}}yo.adapt=yo.adapt;yo.DEFAULT_PORTLIST_SORTER=aE;var Go=class n{constructor(t){this._adapter=t}static forGraph(t){return typeof t.getNodes=="function"&&typeof t.getLabels=="function"?new n(t):new n(yo.adapt(t))}execute(){No.sortPortLists(this._adapter),No.calculateLabelAndNodeSizes(this._adapter),No.calculateNodeMargins(this._adapter)}};var lE=Object.freeze({PARALLEL_NODE:"PARALLEL_NODE",HIERARCHICAL_NODE:"HIERARCHICAL_NODE",ROOT_NODE:"ROOT_NODE",values(){return[this.PARALLEL_NODE,this.HIERARCHICAL_NODE,this.ROOT_NODE]},valueOf(n){return this[n]}});var fr=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};fr.EADES=new fr("EADES");fr.FRUCHTERMAN_REINGOLD=new fr("FRUCHTERMAN_REINGOLD");var bu=new m("org.eclipse.elk.force.model",()=>fr.FRUCHTERMAN_REINGOLD),tn=new m("org.eclipse.elk.force.iterations",300,1),Gu=new m("org.eclipse.elk.force.repulsivePower",0,0),tc=new m("org.eclipse.elk.force.temperature",.001,Xe.greaterThan(0)),ec=new m("org.eclipse.elk.force.repulsion",5,Xe.greaterThan(0));var Vo=new m("org.eclipse.elk.priority",1),_s=new m("org.eclipse.elk.spacing.nodeNode",80,0),nM=new m("org.eclipse.elk.spacing.edgeLabel",5,0),cE=new m("org.eclipse.elk.aspectRatio",1.6,Xe.greaterThan(0)),gE=new m("org.eclipse.elk.randomSeed",1),hE=new m("org.eclipse.elk.separateConnectedComponents",!0),dE=new m("org.eclipse.elk.padding",new yt(50)),aM=new m("org.eclipse.elk.edgeLabels.inline",!1),lM=new m("org.eclipse.elk.topdown.nodeType",lE.HIERARCHICAL_NODE);var yi=class extends ge{constructor(){super(),this._displacement=new O,this._position=new O,this._size=new O}getPosition(){return this._position}getSize(){return this._size}getRadius(){return this._size.length()/2}getDisplacement(){return this._displacement}};var Es=class extends yi{constructor(t,e){super(),this.id=0,this._label=t!=null?t:null,this._parent=e!=null?e:null,this._children=null}toString(){return this._label==null||this._label.length===0?`n_${this.id}`:`n_${this._label}`}isCompound(){return this._children!=null&&this._children.length>0}getLabel(){return this._label}getParent(){return this._parent}getChildren(){return this._children==null&&(this._children=[]),this._children}getDepth(){let t=0,e=this._parent;for(;e!=null;)e=e.getParent(),t++;return t}};var $r=class extends yi{constructor(t){super(),this._edge=t,t.getBendpoints().push(this)}getEdge(){return this._edge}toString(){if(this._edge!=null){let t=this._edge.getBendpoints().indexOf(this);return t>=0?`b${t}[${this._edge}]`:`b[${this._edge}]`}return`b_${this}`}};var Ii=class extends ge{constructor(){super(),this._nodes=[],this._edges=[],this._labels=[],this._bendPoints=[],this._adjacency=null}getEdges(){return this._edges}getNodes(){return this._nodes}getLabels(){return this._labels}getBendpoints(){return this._bendPoints}*getParticles(){for(let t of this._nodes)yield t;for(let t of this._labels)yield t;for(let t of this._bendPoints)yield t}getConnection(t,e){return t instanceof Es&&e instanceof Es?this._adjacency[t.id][e.id]+this._adjacency[e.id][t.id]:t instanceof $r&&e instanceof $r&&t.getEdge()===e.getEdge()?e.getEdge().getProperty(Vo):0}calcAdjacency(){let t=this._nodes.length;this._adjacency=[];for(let e=0;e<t;e++)this._adjacency.push(new Array(t).fill(0));for(let e of this._edges)this._adjacency[e.getSource().id][e.getTarget().id]+=e.getProperty(Vo)}};var Ut=class{};Ut.ORIGIN=new m("origin");Ut.RANDOM=new m("random");Ut.BB_UPLEFT=new m("boundingBox.upLeft");Ut.BB_LOWRIGHT=new m("boundingBox.lowRight");var en=class{split(t){let e=t.getProperty(hE);if(e==null||e===!0){let o=new Array(t.getNodes().length).fill(!1),r=this._buildIncidenceLists(t),i=[];for(let s of t.getNodes()){let a=this._dfs(s,null,null,o,r);a!=null&&(a.copyProperties(t),i.push(a))}if(i.length>1)for(let s of i){let a=0;for(let l of s.getNodes())l.id=a++}return i}return[t]}_buildIncidenceLists(t){let e=t.getNodes().length,o=new Array(e);for(let r=0;r<e;r++)o[r]=[];for(let r of t.getEdges())o[r.getSource().id].push(r),o[r.getTarget().id].push(r);return o}_dfs(t,e,o,r,i){if(!r[t.id]){r[t.id]=!0;let s=o!=null?o:new Ii;s.getNodes().push(t);for(let a of i[t.id])if(!(a.getTarget()===e||a.getSource()===e)){a.getSource()!==t&&this._dfs(a.getSource(),t,s,r,i),a.getTarget()!==t&&this._dfs(a.getTarget(),t,s,r,i),s.getEdges().push(a);for(let l of a.getLabels())s.getLabels().push(l)}return s}return null}recombine(t){var g,h;if(t.length===1)return t[0];if(t.length<=0)return new Ii;for(let d of t){let f=0,E=Number.POSITIVE_INFINITY,P=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(let N of d.getNodes())f+=(g=N.getProperty(Vo))!=null?g:0,E=Math.min(E,N.getPosition().x-N.getSize().x/2),P=Math.min(P,N.getPosition().y-N.getSize().y/2),S=Math.max(S,N.getPosition().x+N.getSize().x/2),T=Math.max(T,N.getPosition().y+N.getSize().y/2);d.setProperty(Vo,f),d.setProperty(Ut.BB_UPLEFT,new O(E,P)),d.setProperty(Ut.BB_LOWRIGHT,new O(S,T))}t.sort((d,f)=>{var P,S;let E=((P=f.getProperty(Vo))!=null?P:0)-((S=d.getProperty(Vo))!=null?S:0);if(E===0){let T=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT)),N=f.getProperty(Ut.BB_LOWRIGHT).clone().sub(f.getProperty(Ut.BB_UPLEFT));return T.x*T.y-N.x*N.y}return E});let e=new Ii;e.copyProperties(t[0]);let o=0,r=0;for(let d of t){let f=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT));o=Math.max(o,f.x),r+=f.x*f.y}o=Math.max(o,Math.sqrt(r)*((h=e.getProperty(cE))!=null?h:1));let i=e.getProperty(_s),s=0,a=0,l=0,c=i;for(let d of t){let f=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT));s+f.x>o&&(s=0,a+=l+i,l=0),this._moveGraph(e,d,s,a),c=Math.max(c,s+f.x),l=Math.max(l,f.y),s+=f.x+i}return e}_moveGraph(t,e,o,r){let i=new O(o,r);i.sub(e.getProperty(Ut.BB_UPLEFT));for(let s of e.getNodes())s.getPosition().add(i),t.getNodes().push(s);for(let s of e.getEdges()){for(let a of s.getBendpoints())a.getPosition().add(i);t.getEdges().push(s)}for(let s of e.getLabels())s.getPosition().add(i),t.getLabels().push(s)}};var U=class U{constructor(){throw new Error("ElkMath is a static utility class")}static factl(t){if(t<0||t>=U._FACT_TABLE.length)throw new Error(`The input must be between 0 and ${U._FACT_TABLE.length}`);return U._FACT_TABLE[t]}static factd(t){if(t<0)throw new Error("The input must be positive");return t<U._FACT_TABLE.length?U._FACT_TABLE[t]:Math.sqrt(2*Math.PI*t)*(U.powf(t,t)/U.powd(Math.E,t))}static binomiall(t,e){if(t<0||e<0)throw new Error("k and n must be positive");if(e>t)throw new Error("k must be smaller than n");return e===0||e===t?1:t===0?0:t<U._FACT_TABLE.length?U.factl(t)/(U.factl(e)*U.factl(t-e)):U.binomiall(t-1,e-1)+U.binomiall(t-1,e)}static binomiald(t,e){if(t<0||e<0)throw new Error("k and n must be positive");if(e>t)throw new Error("k must be smaller than n");return e===0||e===t?1:t===0?0:U.factd(t)/(U.factd(e)*U.factd(t-e))}static powd(t,e){let o=1,r=t,i=e>=0?e:-e;for(;i>0;)i%2===0?(r*=r,i=Math.floor(i/2)):(o*=r,i-=1);return e<0?1/o:o}static powf(t,e){return U.powd(t,e)}static approximateBezierSegment(t,...e){let o,r;if(typeof t=="number"&&e.length>0&&e[0]instanceof O?(o=t,r=e):t instanceof O?(r=[t,...e],o=r.length+1):(o=t,r=e),o<=0)return[];let i=[],s=1/o,a=0;for(let l=0;l<o;l++)a+=s,i.push(U.getPointOnBezierSegment(a,r));return i}static getPointOnBezierSegment(t,e){let o=e.length-1,r=0,i=0;for(let s=0;s<=o;s++){let a=e[s],l=U.binomiald(o,s)*U.powd(1-t,o-s)*U.powd(t,s);r+=a.x*l,i+=a.y*l}return new O(r,i)}static approximateBezierSpline(t){let e=t.length,o=new st,r=0,i=t[r++];for(o.push(i);r<e;){let s=e-r;if(s===1)o.push(t[r++]);else if(s===2){let a=U.approximateBezierSegment(i,t[r++],t[r++]);for(let l of a)o.push(l)}else{let a=t[r++],l=t[r++],c=t[r++],g=U.approximateBezierSegment(i,a,l,c);for(let h of g)o.push(h);i=c}}return o}static distanceFromBezierSegment(t,e,o,r,i){let s=new Array(U._W_DEGREE),a=[t,e,o,r],l=U._convertToBezierForm(a,i),c=U._findRoots(l,U._W_DEGREE,s,0),g=i.distance(t),h=0;for(let E=0;E<c;E++){let P=U._bezier(a,U._DEGREE,s[E],null,null),S=i.distance(P);S<g&&(g=S,h=s[E])}i.distance(r)<g&&(h=1);let f=new O(U._bezier(a,U._DEGREE,h,null,null));return Math.sqrt(f.distance(i))}static _convertToBezierForm(t,e){let o=U._DEGREE,r=U._W_DEGREE,i=new Array(o+1),s=new Array(o),a=Array.from({length:o},()=>new Array(o+1).fill(0)),l=new Array(r+1);for(let d=0;d<=o;d++)i[d]=new O(t[d].x-e.x,t[d].y-e.y);let c=o;for(let d=0;d<=o-1;d++)s[d]=new O(c*(t[d+1].x-t[d].x),c*(t[d+1].y-t[d].y));for(let d=0;d<=o-1;d++)for(let f=0;f<=o;f++)a[d][f]=s[d].x*i[f].x+s[d].y*i[f].y;for(let d=0;d<=r;d++)l[d]=new O(d/r,0);let g=o,h=o-1;for(let d=0;d<=g+h;d++){let f=Math.max(0,d-h),E=Math.min(d,g);for(let P=f;P<=E;P++){let S=d-P;l[P+S].y+=a[S][P]*U._CUBIC_Z[S][P]}}return l}static _findRoots(t,e,o,r){switch(U._crossingCount(t,e)){case 0:return 0;case 1:if(r>=U._MAXDEPTH)return o[0]=(t[0].x+t[U._W_DEGREE].x)/2,1;if(U._controlPolygonFlatEnough(t,e))return o[0]=U._computeXIntercept(t,e),1;break;default:break}let i=new Array(U._W_DEGREE+1),s=new Array(U._W_DEGREE+1),a=new Array(U._W_DEGREE+1),l=new Array(U._W_DEGREE+1);U._bezier(t,e,.5,i,s);let c=U._findRoots(i,e,a,r+1),g=U._findRoots(s,e,l,r+1);for(let h=0;h<c;h++)o[h]=a[h];for(let h=0;h<g;h++)o[h+c]=l[h];return c+g}static _controlPolygonFlatEnough(t,e){let o=t[0].y-t[e].y,r=t[e].x-t[0].x,i=t[0].x*t[e].y-t[e].x*t[0].y,s=o*o+r*r,a=new Array(e+1).fill(0);for(let M=1;M<e;M++)a[M]=o*t[M].x+r*t[M].y+i,a[M]>0&&(a[M]=a[M]*a[M]/s),a[M]<0&&(a[M]=-(a[M]*a[M]/s));let l=0,c=0;for(let M=1;M<e;M++)a[M]<0&&(c=Math.min(c,a[M])),a[M]>0&&(l=Math.max(l,a[M]));let g=0,h=1,d=0,f=o,E=r,P=i+l,S=g*E-f*h,T=1/S,N=(h*P-E*d)*T;P=i+c,S=g*E-f*h,T=1/S;let I=(h*P-E*d)*T,C=Math.min(N,I);return(Math.max(N,I)-C)/2<U._EPSILON}static _computeXIntercept(t,e){let o=t[e].x-t[0].x,r=t[e].y-t[0].y,i=t[0].x,s=t[0].y,a=-1/r;return(o*s-r*i)*a}static _crossingCount(t,e){let o=0,r=t[0].y<0?-1:1,i=r;for(let s=1;s<=e;s++)r=t[s].y<0?-1:1,r!==i&&o++,i=r;return o}static _bezier(t,e,o,r,i){let s=U._W_DEGREE,a=Array.from({length:s+1},()=>new Array(s+1).fill(null));for(let l=0;l<=e;l++)a[0][l]=new O(t[l]);for(let l=1;l<=e;l++)for(let c=0;c<=e-l;c++)a[l][c]=new O((1-o)*a[l-1][c].x+o*a[l-1][c+1].x,(1-o)*a[l-1][c].y+o*a[l-1][c+1].y);if(r!=null)for(let l=0;l<=e;l++)r[l]=a[l][0];if(i!=null)for(let l=0;l<=e;l++)i[l]=a[e-l][l];return a[e][0]}static maxi(...t){let e=-1/0;for(let o of t)o>e&&(e=o);return e}static mini(...t){let e=1/0;for(let o of t)o<e&&(e=o);return e}static averagei(...t){let e=0;for(let o of t)e+=o;return Math.trunc(e/t.length)}static maxl(...t){return U.maxi(...t)}static minl(...t){return U.mini(...t)}static averagel(...t){return U.averagei(...t)}static maxf(...t){return U.maxi(...t)}static minf(...t){return U.mini(...t)}static averagef(...t){let e=0;for(let o of t)e+=o;return e/t.length}static maxd(...t){return U.maxi(...t)}static mind(...t){return U.mini(...t)}static averaged(...t){return U.averagef(...t)}static boundi(t,e,o){return t<=e?e:t>=o?o:t}static boundl(t,e,o){return U.boundi(t,e,o)}static boundf(t,e,o){return U.boundi(t,e,o)}static boundd(t,e,o){return U.boundi(t,e,o)}static clipVector(t,e,o){let r=e/2,i=o/2,s=Math.abs(t.x),a=Math.abs(t.y),l=1,c=1;return s>r&&(l=r/s),a>i&&(c=i/a),t.scale(Math.min(l,c)),t}static signum(t){return t<0?-1:t>0?1:0}static _fuzzyEquals(t,e,o=U._DOUBLE_EQ_EPSILON){return Math.abs(t-e)<=o}static _fuzzyCompare(t,e,o=U._DOUBLE_EQ_EPSILON){return Math.abs(t-e)<=o?0:t<e?-1:1}static intersects(t,e,o,r){if(t instanceof dt&&e instanceof st){let i=t,s=e;if(s.length<2)return!1;let a=s[0],l=a;for(let c=1;c<s.length;c++){let g=s[c];if(U.intersects(i,l,g))return!0;l=g}return U.intersects(i,l,a)}else if(t instanceof dt&&e instanceof O){let i=t,s=e,a=o;return U.contains(i,s,a)?!1:U._intersectsSegments(i.getTopLeft(),i.getTopRight(),s,a)||U._intersectsSegments(i.getTopRight(),i.getBottomRight(),s,a)||U._intersectsSegments(i.getBottomRight(),i.getBottomLeft(),s,a)||U._intersectsSegments(i.getBottomLeft(),i.getTopLeft(),s,a)}else return U._intersectsSegments(t,e,o,r)}static _intersectsSegments(t,e,o,r){let i=t,s=e.clone().sub(t),a=o,l=r.clone().sub(o),c=i.x,g=i.y,h=a.x,d=a.y,f=s.x,E=s.y,P=l.x,S=l.y,T=P*E-f*S;if(U._fuzzyEquals(0,T))return!1;let N=1/T*((c-h)*E-(g-d)*f),I=1/T*-(-(c-h)*S+(g-d)*P);return U._fuzzyCompare(0,N)<0&&U._fuzzyCompare(N,1)<0&&U._fuzzyCompare(0,I)<0&&U._fuzzyCompare(I,1)<0}static intersects2(t,e,o,r){let i=o.clone().sub(t),s=O.crossProduct(i,e),a=O.crossProduct(e,r),l=O.crossProduct(i,r)/a,c=s/a;if(a===0)if(s===0){let g=o.clone().add(r.clone().scale(.5)),h=t.distance(g),d=t.clone().add(e).distance(g),f=r.length()*.5;return h<d&&h<=f?t.clone():d<=f?t.clone().add(e):null}else return null;else return l>=0&&l<=1&&c>=0&&c<=1?t.clone().add(e.clone().scale(l)):null}static distance(t,e,o,r,i){return Math.min(U._traceRays(t,e,o,r,i),U._traceRays(o,r,t,e,i.clone().negate()))}static _traceRays(t,e,o,r,i){let s=1/0,a,l=!1;a=U.intersects2(t,e.clone().sub(t),o.clone().add(i),r.clone().sub(o));let c=a!=null&&!(a.equalsFuzzily(t)||a.equalsFuzzily(e));return a=U.intersects2(t,e.clone().sub(t),o,i),a!=null&&(a.equalsFuzzily(t)===a.equalsFuzzily(e)||c?s=Math.min(s,a.sub(o).length()):l=!0),a=U.intersects2(t,e.clone().sub(t),r,i),a!=null&&(l||a.equalsFuzzily(t)===a.equalsFuzzily(e)||c)&&(s=Math.min(s,a.sub(r).length())),s}static contains(t,e,o){if(e instanceof st){let r=e;if(r.length<2)return!1;let i=r[0],s=i;for(let a=1;a<r.length;a++){let l=r[a];if(!U.contains(t,s,l))return!1;s=l}return U.contains(t,s,i)}else return o!==void 0?U._containsPoint(t,e)&&U._containsPoint(t,o):U._containsPoint(t,e)}static _containsPoint(t,e){let o=t.x,r=t.x+t.width,i=t.y,s=t.y+t.height;return e.x>o&&e.x<r&&e.y>i&&e.y<s}static shortestDistance(t,e){let o=U._DOUBLE_EQ_EPSILON,r=e.x-(t.x+t.width),i=t.x-(e.x+e.width),s=t.y-(e.y+e.height),a=e.y-(t.y+t.height),l=Math.max(i,r),c=Math.max(s,a),g=U._fuzzyCompare(l,0,o)>=0,h=U._fuzzyCompare(c,0,o)>=0;return g!==h?Math.max(c,l):U._fuzzyCompare(l,0,o)>0?Math.sqrt(c*c+l*l):-Math.sqrt(c*c+l*l)}};Z(U,"_FACT_TABLE",[1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368e3,20922789888e3,355687428096e3,6402373705728e3,121645100408832e3,243290200817664e4]),Z(U,"_W_DEGREE",5),Z(U,"_DEGREE",3),Z(U,"_CUBIC_Z",[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]]),Z(U,"_MAXDEPTH",64),Z(U,"_EPSILON",1*Math.pow(2,-65)),Z(U,"_DOUBLE_EQ_EPSILON",1e-5);var Ft=U;var oc=class extends ge{constructor(){super(),this._bendpoints=[],this._labels=[],this._source=null,this._target=null}toString(){var t;return this._source!=null&&this._target!=null?`${this._source}->${this._target}`:"e_"+((t=this._id)!=null?t:"")}getSource(){return this._source}getTarget(){return this._target}getBendpoints(){return this._bendpoints}getLabels(){return this._labels}getSourcePoint(){let t=this._target.getPosition().clone().sub(this._source.getPosition());return Ft.clipVector(t,this._source.getSize().x,this._source.getSize().y),t.add(this._source.getPosition())}getTargetPoint(){let t=this._source.getPosition().clone().sub(this._target.getPosition());return Ft.clipVector(t,this._target.getSize().x,this._target.getSize().y),t.add(this._target.getPosition())}setSource(t){this._source=t}setTarget(t){this._target=t}toVectorChain(){let t=new st;t.add(this.getSourcePoint());for(let e of this._bendpoints)t.add(e.getPosition());return t.add(this.getTargetPoint()),t}distributeBendpoints(){let t=this._bendpoints.length;if(t>0){let e=this._source.getPosition(),r=this._target.getPosition().clone().sub(e).scale(1/(t+1)),i=e.clone();for(let s of this._bendpoints)s.getPosition().x=i.x+r.x,s.getPosition().y=i.y+r.y,i.add(r)}}};var rc=class extends yi{constructor(t,e){super(),this._edge=t,this._text=e,t.getLabels().push(this)}getText(){return this._text}getEdge(){return this._edge}toString(){return this._text==null||this._text.length===0?`l[${this._edge}]`:`l_${this._text}`}refreshPosition(){let t=this.getProperty(Ou),e=this._edge.getSource().getPosition(),o=this._edge.getTarget().getPosition();if(t){let r=o.clone().sub(e).scale(.5),i=this.getSize().clone().scale(.5),s=e.clone().add(r).sub(i);this.getPosition().set(s)}else{let r=this._edge.getProperty(gu),i=this.getPosition();e.x>=o.x?e.y>=o.y?(i.x=o.x+(e.x-o.x)/2+r,i.y=o.y+(e.y-o.y)/2-r-this.getSize().y):(i.x=o.x+(e.x-o.x)/2+r,i.y=e.y+(o.y-e.y)/2+r):e.y>=o.y?(i.x=e.x+(o.x-e.x)/2+r,i.y=o.y+(e.y-o.y)/2+r):(i.x=e.x+(o.x-e.x)/2+r,i.y=e.y+(o.y-e.y)/2-r-this.getSize().y)}}};var on=class{importGraph(t){let e=new Ii;e.copyProperties(t),e.setProperty(Ut.ORIGIN,t);let o=new Map;return this._transformNodes(t,e,o),this._transformEdges(t,e,o),e}_transformNodes(t,e,o){let r=0;for(let i of t.children){let s="";i.labels.length>0&&(s=i.labels[0].getText());let a=new Es(s);a.copyProperties(i),a.setProperty(Ut.ORIGIN,i),a.id=r++,a.getPosition().x=i.getX()+i.getWidth()/2,a.getPosition().y=i.getY()+i.getHeight()/2,a.getSize().x=Math.max(i.getWidth(),1),a.getSize().y=Math.max(i.getHeight(),1),e.getNodes().push(a),o.set(i,a);let l=i.getProperty(cr);l===H.UNDEFINED&&(l=H.FREE)}}_transformEdges(t,e,o){for(let r of t.children)for(let i of Ee(r)){if(i.isHyperedge())throw new Error("Graph must not contain hyperedges.");let s=Pt(i.targets[0]);if(!i.isHierarchical()&&r!==s){let a=new oc;a.copyProperties(i),a.setProperty(Ut.ORIGIN,i),a.setSource(o.get(r)),a.setTarget(o.get(s)),e.getEdges().push(a);for(let l of i.labels){let c=new rc(a,l.getText());c.copyProperties(l),c.setProperty(Ut.ORIGIN,l),c.getSize().x=Math.max(l.getWidth(),1),c.getSize().y=Math.max(l.getHeight(),1),c.refreshPosition(),e.getLabels().push(c)}}}}applyLayout(t){let e=t.getProperty(Ut.ORIGIN),o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let h of t.getNodes()){let d=h.getPosition(),f=h.getSize();o=Math.min(o,d.x-f.x/2),r=Math.min(r,d.y-f.y/2),i=Math.max(i,d.x+f.x/2),s=Math.max(s,d.y+f.y/2)}for(let h of t.getBendpoints()){let d=h.getPosition(),f=h.getSize();o=Math.min(o,d.x-f.x/2),r=Math.min(r,d.y-f.y/2),i=Math.max(i,d.x+f.x/2),s=Math.max(s,d.y+f.y/2)}let a=e.getProperty(dE),l=new O(a.getLeft()-o,a.getTop()-r);for(let h of t.getNodes()){let d=h.getProperty(Ut.ORIGIN);if(d!=null&&d.children!==void 0){let f=new O(h.getPosition()).add(l);d.setLocation(f.x-d.getWidth()/2,f.y-d.getHeight()/2)}}for(let h of t.getEdges()){let d=h.getProperty(Ut.ORIGIN),f=ar(d,!0,!0),E=new O(h.getSourcePoint());E.add(l),f.setStartLocation(E.x,E.y);for(let S of h.getBendpoints()){let T=new O(S.getPosition());T.add(l),Sa(f,T.x,T.y)}let P=new O(h.getTargetPoint());P.add(l),f.setEndLocation(P.x,P.y)}for(let h of t.getLabels()){let d=h.getProperty(Ut.ORIGIN),f=new O(h.getPosition()).add(l);d.setLocation(f.x,f.y)}let c=i-o+a.getHorizontal(),g=s-r+a.getVertical();e.getProperty(To)||Ae(e,c,g,!1,!0),e.setProperty(pi,c-a.getHorizontal()),e.setProperty(Ei,g-a.getVertical())}};var Hu=16,Ri=class{constructor(){this._random=null,this._graph=null,this._dispBound=0}initialize(t){if(this._graph=t,this._random=t.getProperty(Ut.RANDOM),t.calcAdjacency(),this._dispBound=Math.max(t.getNodes().length*Hu+t.getEdges().length,Hu*Hu),!t.getProperty(zo)){let o=this._graph.getNodes().length;for(let r of t.getNodes()){let i=r.getPosition();i.x=this._random.nextDouble()*o,i.y=this._random.nextDouble()*o}}let e=t.getBendpoints();for(let o of t.getEdges()){let r=o.getProperty(Gu);if(r>0){for(let i=0;i<r;i++)e.push(new $r(o));o.distributeBendpoints()}}}getGraph(){return this._graph}getRandom(){return this._random}layout(t,e){var r;e.begin("Component Layout",1),this.initialize(t);let o=0;for(;this.moreIterations(o)&&!((r=e.isCanceled)!=null&&r.call(e));){this.iterationDone();for(let i of t.getParticles())for(let s of t.getParticles())if(s!==i){let a=this.calcDisplacement(s,i);a!=null&&i.getDisplacement().add(a)}for(let i of t.getParticles()){let s=i.getDisplacement();s.bound(-this._dispBound,-this._dispBound,this._dispBound,this._dispBound),i.getPosition().add(s),s.reset()}o++}e.done()}iterationDone(){for(let t of this._graph.getEdges()){for(let e of t.getLabels())e.refreshPosition();t.distributeBendpoints()}}moreIterations(t){throw new Error("moreIterations must be implemented by subclass")}calcDisplacement(t,e){throw new Error("calcDisplacement must be implemented by subclass")}static avoidSamePosition(t,e,o){let r=e.getPosition(),i=o.getPosition();for(;r.x-i.x===0&&r.y-i.y===0;){let s=!1;if(e instanceof $r&&o instanceof $r&&!s){let a=e.getEdge(),l=new O(a.getTargetPoint()).sub(a.getSourcePoint()),c=2,g=new O(l.x/l.length()*c,-l.y/l.length()*c);r.add(g);let h=o.getEdge(),d=new O(h.getTargetPoint()).sub(h.getSourcePoint());c=l===d?-2:2;let f=new O(d.x/d.length()*c,-(d.y/d.length())*c);r.add(f),s=!0}else{let a=()=>t.nextDouble();r.wiggle(a,1),i.wiggle(a,1)}}}};var fE=100,va=class n extends Ri{constructor(){super(),this._maxIterations=tn.getDefault(),this._springLength=_s.getDefault(),this._repulsionFactor=ec.getDefault()}initialize(t){super.initialize(t),this._maxIterations=t.getProperty(tn),this._springLength=t.getProperty(_s),this._repulsionFactor=t.getProperty(ec)}moreIterations(t){return t<this._maxIterations}calcDisplacement(t,e){var l;Ri.avoidSamePosition(this.getRandom(),t,e);let o=e.getPosition().clone().sub(t.getPosition()),r=o.length(),i=Math.max(0,r-t.getRadius()-e.getRadius()),s,a=this.getGraph().getConnection(t,e);if(a>0)s=-n.attractive(i,this._springLength)*a;else{let c=(l=t.getProperty(Vo))!=null?l:0;s=n._repulsive(i,this._repulsionFactor)*c}return o.scale(s/r),o}static _repulsive(t,e){return t>0?e/(t*t):e*fE}static attractive(t,e){return t>0?Math.log(t/e):-fE}};var eT=.01,oT=100,Ba=class n extends Ri{constructor(){super(),this._temperature=tc.getDefault(),this._threshold=0,this._k=0}initialize(t){super.initialize(t),this._temperature=t.getProperty(tc),this._threshold=this._temperature/t.getProperty(tn);let e=t.getNodes().length,o=0,r=0;for(let a of t.getNodes())o+=a.getSize().x,r+=a.getSize().y;let i=o*r,s=t.getProperty(_s)*eT;this._k=Math.sqrt(i/(2*e))*s}moreIterations(t){return this._temperature>0}calcDisplacement(t,e){var c;Ri.avoidSamePosition(this.getRandom(),t,e);let o=e.getPosition().clone().sub(t.getPosition()),r=o.length(),i=Math.max(0,r-t.getRadius()-e.getRadius()),s=(c=t.getProperty(Vo))!=null?c:0,a=n._repulsive(i,this._k)*s,l=this.getGraph().getConnection(t,e);return l>0&&(a-=n.attractive(i,this._k)*l),o.scale(a*this._temperature/r),o}iterationDone(){super.iterationDone(),this._temperature-=this._threshold}static _repulsive(t,e){return t>0?e*e/t:e*e*oT}static attractive(t,e){return t*t/e}};var rn=class extends de{constructor(){super(),this._forceModel=null,this._componentsProcessor=new en}layout(t,e){e.begin("ELK Force",1),t.getProperty(So)||Go.forGraph(t).execute();let o=new on,r=o.importGraph(t);this._setOptions(r,t),this._updateModel(r.getProperty(bu));let i=this._componentsProcessor.split(r);for(let s of i){let a=typeof e.subTask=="function"?e.subTask(1/i.length):e;this._forceModel.layout(s,a)}r=this._componentsProcessor.recombine(i),o.applyLayout(r),e.done()}_setOptions(t,e){let o=t.getProperty(gE);o!=null?o===0?t.setProperty(Ut.RANDOM,new dr):t.setProperty(Ut.RANDOM,new dr(o)):t.setProperty(Ut.RANDOM,new dr(1))}_updateModel(t){switch(t){case fr.EADES:this._forceModel instanceof va||(this._forceModel=new va);break;case fr.FRUCHTERMAN_REINGOLD:default:this._forceModel instanceof Ba||(this._forceModel=new Ba);break}}};var uE="org.eclipse.elk.force",_E=!1;function pE(){let n=Ht.getInstance(),t=n.getAlgorithmData(uE);if(t)return _E=!0,t;let e=new Se.Builder().id(uE).name("ELK Force").description("Force-based algorithm provided by the Eclipse Layout Kernel.").category("org.eclipse.elk.force").definingBundleId("org.eclipse.elk.alg.force").providerFactory(()=>new rn).supportedFeatures(new Set(["MULTI_EDGES","EDGE_LABELS"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),_E=!0,e}var eo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};eo.XY=new eo("XY");eo.X=new eo("X");eo.Y=new eo("Y");var vu=new m("org.eclipse.elk.stress.fixed",!1),Ua=new m("org.eclipse.elk.stress.desiredEdgeLength",100),Bu=new m("org.eclipse.elk.stress.dimension",()=>eo.XY),Uu=new m("org.eclipse.elk.stress.epsilon",.001),Fu=new m("org.eclipse.elk.stress.iterationLimit",Number.MAX_SAFE_INTEGER);var N0=new m("org.eclipse.elk.edgeLabels.inline",!0);var ic=class n{constructor(){this._graph=null,this._apsp=null,this._w=null,this._desiredEdgeLength=0,this._dim=eo.XY,this._epsilon=0,this._iterationLimit=Number.MAX_SAFE_INTEGER,this._connectedEdges=new Map}initialize(t){if(t.getNodes().length<=1)return;this._graph=t,this._dim=t.getProperty(Bu),this._iterationLimit=t.getProperty(Fu),this._epsilon=t.getProperty(Uu),this._desiredEdgeLength=t.getProperty(Ua),this._connectedEdges.clear();for(let o of t.getEdges())this._pushEdge(o.getSource(),o),this._pushEdge(o.getTarget(),o);let e=t.getNodes().length;this._apsp=[];for(let o=0;o<e;o++)this._apsp.push(new Array(e).fill(0));for(let o of t.getNodes())this._dijkstra(o,this._apsp[o.id]);this._w=[];for(let o=0;o<e;o++)this._w.push(new Array(e).fill(0));for(let o=0;o<e;o++)for(let r=0;r<e;r++){let i=this._apsp[o][r];this._w[o][r]=i===0?0:1/(i*i)}}_pushEdge(t,e){let o=this._connectedEdges.get(t);o==null&&(o=[],this._connectedEdges.set(t,o)),o.push(e)}execute(){if(this._graph.getNodes().length<=1)return;let t=0,e=this._computeStress(),o=Number.POSITIVE_INFINITY;do{t>0&&(e=o);for(let r of this._graph.getNodes()){if(r.getProperty(vu))continue;let i=this._computeNewPosition(r);r.getPosition().reset().add(i)}o=this._computeStress(),t++}while(!this._done(t,e,o))}_dijkstra(t,e){var i;let o=this._graph.getNodes().length,r=new Array(o).fill(!1);for(let s of this._graph.getNodes())e[s.id]=s.id===t.id?0:Number.POSITIVE_INFINITY;for(let s=0;s<o;s++){let a=null,l=Number.POSITIVE_INFINITY;for(let g of this._graph.getNodes())!r[g.id]&&e[g.id]<l&&(l=e[g.id],a=g);if(a==null)break;r[a.id]=!0;let c=(i=this._connectedEdges.get(a))!=null?i:[];for(let g of c){let h=n._getOther(g,a);if(r[h.id])continue;let d;g.hasProperty(Ua)?d=g.getProperty(Ua):d=this._desiredEdgeLength;let f=e[a.id]+d;f<e[h.id]&&(e[h.id]=f)}}}_done(t,e,o){return e===0||(e-o)/e<this._epsilon||t>=this._iterationLimit}_computeStress(){let t=0,e=this._graph.getNodes();for(let o=0;o<e.length;o++){let r=e[o];for(let i=o+1;i<e.length;i++){let s=e[i],l=r.getPosition().distance(s.getPosition())-this._apsp[r.id][s.id];t+=this._w[r.id][s.id]*l*l}}return t}_computeNewPosition(t){let e=0,o=0,r=0;for(let i of this._graph.getNodes()){if(t===i)continue;let s=this._w[t.id][i.id];e+=s;let a=t.getPosition().distance(i.getPosition());a>0&&this._dim!==eo.Y&&(o+=s*(i.getPosition().x+this._apsp[t.id][i.id]*(t.getPosition().x-i.getPosition().x)/a)),a>0&&this._dim!==eo.X&&(r+=s*(i.getPosition().y+this._apsp[t.id][i.id]*(t.getPosition().y-i.getPosition().y)/a))}switch(this._dim){case eo.X:return new O(o/e,t.getPosition().y);case eo.Y:return new O(t.getPosition().x,r/e);default:return new O(o/e,r/e)}}static _getOther(t,e){if(t.getSource()===e)return t.getTarget();if(t.getTarget()===e)return t.getSource();throw new Error("Node must be either source or target of edge.")}};var sc=class extends de{constructor(){super(),this._componentsProcessor=new en,this._stressMajorization=new ic}layout(t,e){if(e.begin("ELK Stress",1),t.getProperty(zo))t.getProperty(So)||Go.forGraph(t).execute();else{let s=typeof e.subTask=="function"?e.subTask(1):e;new rn().layout(t,s)}let o=new on,r=o.importGraph(t),i=this._componentsProcessor.split(r);for(let s of i)if(!(s.getNodes().length<=1)){this._stressMajorization.initialize(s),this._stressMajorization.execute();for(let a of s.getLabels())a.refreshPosition()}r=this._componentsProcessor.recombine(i),o.applyLayout(r),e.done()}};var mE="org.eclipse.elk.stress",PE=!1;function OE(){let n=Ht.getInstance(),t=n.getAlgorithmData(mE);if(t)return PE=!0,t;let e=new Se.Builder().id(mE).name("ELK Stress").description("Minimizes the stress within a layout using stress majorization.").category("org.eclipse.elk.force").definingBundleId("org.eclipse.elk.alg.force").providerFactory(()=>new sc).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),PE=!0,e}var qr=class extends ge{constructor(){super(),this._nodes=[],this._edges=[]}getEdges(){return this._edges}getNodes(){return this._nodes}toString(){let t=[];for(let e of this._nodes)t.push(e.toString());for(let e of this._edges)t.push(e.toString());return t.join(`
+`)}};var L=class{};L.ORIGIN=new m("origin");L.RANDOM=new m("random");L.DEPTH=new m("DEPTH",0);L.FAN=new m("FAN",0);L.DESCENDANTS=new m("DESCENDANTS",0);L.ROOT=new m("ROOT",!1);L.LEFTNEIGHBOR=new m("LEFTNEIGHBOR",null);L.RIGHTNEIGHBOR=new m("RIGHTNEIGHBOR",null);L.LEFTSIBLING=new m("LEFTSIBLING",null);L.RIGHTSIBLING=new m("RIGHTSIBLING",null);L.DUMMY=new m("DUMMY",!1);L.LEVEL=new m("LEVEL",0);L.REMOVABLE_EDGES=new m("REMOVABLE_EDGES",[]);L.XCOOR=new m("XCOOR",0);L.YCOOR=new m("YCOOR",0);L.LEVELHEIGHT=new m("LEVELHEIGHT",0);L.LEVELMIN=new m("LEVELMIN",0);L.LEVELMAX=new m("LEVELMAX",0);L.GRAPH_XMIN=new m("GRAPH_XMIN",0);L.GRAPH_YMIN=new m("GRAPH_YMIN",0);L.GRAPH_XMAX=new m("GRAPH_XMAX",0);L.GRAPH_YMAX=new m("GRAPH_YMAX",0);L.COMPACT_LEVEL_ASCENSION=new m("COMPACT_LEVEL_ASCENSION",!1);L.COMPACT_CONSTRAINTS=new m("COMPACT_CONSTRAINTS",[]);L.ID=new m("ID","");L.POSITION=new m("POSITION",0);L.PRELIM=new m("PRELIM",0);L.MODIFIER=new m("MODIFIER",0);L.BB_UPLEFT=new m("boundingBox.upLeft");L.BB_LOWRIGHT=new m("boundingBox.lowRight");var ur=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};ur.DFS=new ur("DFS");ur.BFS=new ur("BFS");var je=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};je.MODEL_ORDER=new je("MODEL_ORDER");je.DESCENDANTS=new je("DESCENDANTS");je.FAN=new je("FAN");je.CONSTRAINT=new je("CONSTRAINT");var ms=Object.freeze({NONE:"NONE",MIDDLE_TO_MIDDLE:"MIDDLE_TO_MIDDLE",AVOID_OVERLAP:"AVOID_OVERLAP",values(){return[this.NONE,this.MIDDLE_TO_MIDDLE,this.AVOID_OVERLAP]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var V=class{};V.ALGORITHM_ID="org.eclipse.elk.mrtree";V.SEARCH_ORDER=new m("org.eclipse.elk.mrtree.searchOrder",ur.DFS);V.DIRECTION=new m("org.eclipse.elk.direction",R.UNDEFINED);V.ASPECT_RATIO=new m("org.eclipse.elk.aspectRatio",1.6);V.PADDING=new m("org.eclipse.elk.padding",new yt(20));V.SEPARATE_CONNECTED_COMPONENTS=new m("org.eclipse.elk.separateConnectedComponents",!0);V.PRIORITY=new m("org.eclipse.elk.priority",1);V.SPACING_NODE_NODE=new m("org.eclipse.elk.spacing.nodeNode",20,0);V.SPACING_EDGE_NODE=new m("org.eclipse.elk.spacing.edgeNode",3,0);V.OMIT_NODE_MICRO_LAYOUT=So;V.RANDOM_SEED=Pu;V.WEIGHTING=new m("org.eclipse.elk.mrtree.weighting",je.MODEL_ORDER);V.DEBUG_MODE=new m("org.eclipse.elk.debugMode",!1);V.POSITION_CONSTRAINT=new m("org.eclipse.elk.mrtree.positionConstraint",-1);V.EDGE_ROUTING_MODE=new m("org.eclipse.elk.mrtree.edgeRoutingMode",ms.AVOID_OVERLAP);V.TREE_LEVEL=new m("org.eclipse.elk.mrtree.treeLevel",0);V.EDGE_END_TEXTURE_LENGTH=new m("org.eclipse.elk.mrtree.edgeEndTextureLength",7);V.COMPACTION=new m("org.eclipse.elk.mrtree.compaction",!1);var nc=class{constructor(){this._incidence=null,this._visited=null}_initialize(t){let e=t.getNodes().length;this._incidence=new Array(e),this._visited=new Array(e).fill(!1);for(let o of t.getNodes())this._incidence[o.id]=[];for(let o of t.getEdges())this._incidence[o.getSource().id].push(o),this._incidence[o.getTarget().id].push(o)}split(t){let e=t.getProperty(V.SEPARATE_CONNECTED_COMPONENTS);if(e==null||e===!0){this._initialize(t);let o=[];for(let r of t.getNodes()){let i=this._dfs(r,null);i!=null&&(i.copyProperties(t),o.push(i))}if(this._incidence=null,this._visited=null,o.length>1)for(let r of o){let i=0;for(let s of r.getNodes())s.id=i++}return o}return[t]}_dfs(t,e){if(!this._visited[t.id]){this._visited[t.id]=!0;let o=e!=null?e:new qr;o.getNodes().push(t);for(let r of this._incidence[t.id])r.getSource()!==t&&this._dfs(r.getSource(),o),r.getTarget()!==t&&this._dfs(r.getTarget(),o),r.getSource()===t&&o.getEdges().push(r);return o}return null}pack(t){var d,f;if(t.length===1)return this._applyPaddingAndNormalizePositions(t[0]),t[0];if(t.length<=0)return new qr;for(let E of t){let P=0,S=Number.POSITIVE_INFINITY,T=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(let C of E.getNodes())P+=(d=C.getProperty(V.PRIORITY))!=null?d:0,S=Math.min(S,C.getPosition().x),T=Math.min(T,C.getPosition().y),N=Math.max(N,C.getPosition().x+C.getSize().x),I=Math.max(I,C.getPosition().y+C.getSize().y);E.setProperty(V.PRIORITY,P),E.setProperty(L.BB_UPLEFT,new O(S,T)),E.setProperty(L.BB_LOWRIGHT,new O(N,I))}t.sort((E,P)=>{var T,N;let S=((T=P.getProperty(V.PRIORITY))!=null?T:0)-((N=E.getProperty(V.PRIORITY))!=null?N:0);if(S===0){let I=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT)),C=P.getProperty(L.BB_LOWRIGHT).clone().sub(P.getProperty(L.BB_UPLEFT));return I.x*I.y-C.x*C.y}return S});let e=new qr;e.copyProperties(t[0]);let o=0,r=0;for(let E of t){let P=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT));o=Math.max(o,P.x),r+=P.x*P.y}o=Math.max(o,Math.sqrt(r)*((f=e.getProperty(V.ASPECT_RATIO))!=null?f:1));let i=e.getProperty(V.SPACING_NODE_NODE),s=0,a=0,l=0,c=i;for(let E of t){let P=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT));s+P.x>o&&(s=0,a+=l+i,l=0),this._moveGraph(e,E,s,a),c=Math.max(c,s+P.x),l=Math.max(l,P.y),s+=P.x+i}let g=new Map,h=new Map;for(let E of t){let P=E.getProperty(Ks),S=E.getAllProperties();for(let[T,N]of S)g.has(T)?T.getDefault()!==N&&(P&&h.has(T)||(g.set(T,N),e.setProperty(T,N),P&&h.set(T,N))):(g.set(T,N),e.setProperty(T,N))}return rT(e),this._applyPaddingAndNormalizePositions(e),e}_applyPaddingAndNormalizePositions(t){let e=t.getProperty(V.PADDING);t.setProperty(L.BB_UPLEFT,new O(0,0)),this._moveGraph(new qr,t,e.getLeft()-t.getProperty(L.GRAPH_XMIN),e.getTop()-t.getProperty(L.GRAPH_YMIN))}_moveGraph(t,e,o,r){let i=new O(o,r);i.sub(e.getProperty(L.BB_UPLEFT));for(let a of e.getNodes())a.getPosition().add(i),t.getNodes().push(a);let s=new Set;for(let a of e.getEdges())if(!s.has(a)){s.add(a);for(let l of a.getBendPoints())l.add(i);t.getEdges().push(a)}}};function rT(n){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let i of n.getNodes()){let s=i.getPosition(),a=i.getSize();t=Math.min(t,s.x),e=Math.min(e,s.y),o=Math.max(o,s.x+a.x),r=Math.max(r,s.y+a.y)}n.getNodes().length===0&&(t=e=o=r=0),n.setProperty(L.GRAPH_XMIN,t),n.setProperty(L.GRAPH_YMIN,e),n.setProperty(L.GRAPH_XMAX,o),n.setProperty(L.GRAPH_YMAX,r)}var sn=class extends ge{constructor(t=0){super(),this.id=t}};var nn=class extends sn{constructor(t,e){super(),this._source=t,this._target=e,this._labels=[],this._bendPoints=new st}getSource(){return this._source}setSource(t){if(this._source!==t){if(this._source!=null){let e=this._source.getOutgoingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}t!=null&&!t.getOutgoingEdges().includes(this)&&t.getOutgoingEdges().push(this),this._source=t}}getTarget(){return this._target}setTarget(t){if(this._target!==t){if(this._target!=null){let e=this._target.getIncomingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}t!=null&&!t.getIncomingEdges().includes(this)&&t.getIncomingEdges().push(this),this._target=t}}getLabels(){return this._labels}getBendPoints(){return this._bendPoints}toString(){return this._source!=null&&this._target!=null?`${this._source}->${this._target}`:`e_${this.id}`}};var ac=class extends sn{constructor(t=0){super(t),this._pos=new O,this._size=new O}getPosition(){return this._pos}getSize(){return this._size}};var Ps=class extends ac{constructor(t,e,o){super(t),this._graph=e,this._label=o!=null?o:null,this._outgoingEdges=[],this._incomingEdges=[]}getLabel(){return this._label}setLabel(t){this._label=t}*getParents(){for(let t of this.getIncomingEdges())yield t.getSource()}getParent(){let t=this.getIncomingEdges();return t.length===0?null:t[0].getSource()}getChildrenCopy(){let t=[];for(let e of this.getOutgoingEdges())t.push(e.getTarget());return t}*getChildren(){for(let t of this.getOutgoingEdges())yield t.getTarget()}getOutgoingEdges(){return this._outgoingEdges==null&&(this._outgoingEdges=[]),this._outgoingEdges}getIncomingEdges(){return this._incomingEdges==null&&(this._incomingEdges=[]),this._incomingEdges}addChild(t){let e=new nn(this,t);e.setProperty(L.DUMMY,!0),this._graph.getEdges().push(e),this.getOutgoingEdges().push(e),t.getIncomingEdges().push(e)}isLeaf(){return this.getOutgoingEdges().length===0}toString(){return this._label==null||this._label.length===0?`n_${this.id}`:`n_${this._label}`}};var lc=class{importGraph(t){let e=new qr;e.copyProperties(t),e.setProperty(L.ORIGIN,t);let o=new Map;return this._transformNodes(t,e,o),this._transformEdges(t,e,o),e}_transformNodes(t,e,o){let r=0;for(let i of t.children){let s="";i.labels.length>0&&(s=i.labels[0].getText());let a=new Ps(r++,e,s);a.copyProperties(i),a.setProperty(L.ORIGIN,i),a.getPosition().y=i.getY()+i.getHeight()/2,a.getSize().x=Math.max(i.getWidth(),1),a.getPosition().x=i.getX()+i.getWidth()/2,a.getSize().y=Math.max(i.getHeight(),1),e.getNodes().push(a),o.set(i,a)}}_transformEdges(t,e,o){for(let r of t.children)for(let i of Ee(r))if(!i.isHierarchical()&&!i.isSelfloop()){let s=o.get(r),a=o.get(Pt(i.targets[0]));if(s!=null&&a!=null){let l=new nn(s,a);l.setProperty(L.ORIGIN,i),l.copyProperties(i),s.getOutgoingEdges().push(l),a.getIncomingEdges().push(l),e.getEdges().push(l)}}}applyLayout(t){let e=t.getProperty(L.ORIGIN),o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let g of t.getNodes()){let h=g.getPosition(),d=g.getSize();o=Math.min(o,h.x-d.x/2),r=Math.min(r,h.y-d.y/2),i=Math.max(i,h.x+d.x/2),s=Math.max(s,h.y+d.y/2)}let a=e.getProperty(V.PADDING);for(let g of t.getNodes()){let h=g.getProperty(L.ORIGIN);h!=null&&h.children!==void 0&&(h.setLocation(g.getPosition().x,g.getPosition().y),h.copyProperties(g))}for(let g of t.getEdges()){let h=g.getProperty(L.ORIGIN);if(h!=null){let d=g.getBendPoints(),f=ar(h,!0,!0);Xs(d,f)}}let l=i-o+a.getHorizontal(),c=s-r+a.getVertical();e.getProperty(To)||Ae(e,l,c,!1,!1),e.setProperty(pi,l-a.getHorizontal()),e.setProperty(Ei,c-a.getVertical())}static _toNodeBorder(t,e,o){let r=o.x/2,i=o.y/2,s=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y),l=1,c=1;s>r&&(l=r/s),a>i&&(c=i/a);let g=Math.min(l,c);t.x+=g*(e.x-t.x),t.y+=g*(e.y-t.y)}};var an=class{constructor(){this._list=[]}provideDefault(){throw new Error(`${this.constructor.name}.provideDefault() is not implemented`)}getListItem(t){if(t<0)throw new RangeError(`Invalid index: ${t}`);return this._ensureListSize(t+1),this._list[t]}setListItem(t,e){if(t<0)throw new RangeError(`Invalid index: ${t}`);t<this._list.length?this._list[t]=e:(this._ensureListSize(t),this._list.push(e))}getListSize(){return this._list.length}clearList(){this._list.length=0}_ensureListSize(t){for(;this._list.length<t;)this._list.push(this.provideDefault())}};var cc=class{compare(t,e){return t.ordinal-e.ordinal}};var K=class n extends an{constructor(){super(),this._currentIndex=-1}static create(){return new n}static createFrom(t){return new n().addAll(t)}clear(){return this.clearList(),this._currentIndex=-1,this}before(t){return this._currentIndex=t.ordinal,this}after(t){return this._currentIndex=t.ordinal+1,this}add(t){if(this._currentIndex<0)throw new Error("Did not call before(...) or after(...) before calling add(...).");return this._doAdd(this._currentIndex,t),this}addBefore(t,e){return this._currentIndex=-1,this._doAdd(t.ordinal,e),this}addAfter(t,e){return this._currentIndex=-1,this._doAdd(t.ordinal+1,e),this}_doAdd(t,e){this.getListItem(t).add(e)}addAll(t){for(let e=0;e<t.getListSize();e++){let o=this.getListItem(e);for(let r of t.getListItem(e))o.add(r)}return this}processorsBefore(t){return this._processors(t.ordinal)}processorsAfter(t){return this._processors(t.ordinal+1)}_processors(t){return new Set(this.getListItem(t))}provideDefault(){return new Set}};var Io=class n extends an{static create(t){return new n(t)}constructor(t){if(super(),!t||t.length===0)throw new Error("There must be at least one phase in the phase enumeration.");this._phaseEnumConstants=t,this._numberOfPhases=t.length,this._enableCaching=!0,this._failOnMissingPhase=!0,this._processorComparator=new cc,this._configuredPhases=new Set,this._additionalProcessors=K.create(),this._cache=new Map}withCaching(t){return this._enableCaching=t,this}withFailOnMissingPhase(t){return this._failOnMissingPhase=t,this}withProcessorComparator(t){return this._processorComparator=t,this}clearCache(){return this._cache.clear(),this}reset(){return this.clearList(),this._configuredPhases.clear(),this._additionalProcessors.clear(),this}setPhase(t,e){return this.setListItem(t.ordinal,e),this._configuredPhases.add(t),this}addProcessorConfiguration(t){return this._additionalProcessors.addAll(t),this}build(t){if(this._failOnMissingPhase&&this._configuredPhases.size<this._numberOfPhases)throw new Error(`Expected ${this._numberOfPhases} phases to be configured; only found ${this._configuredPhases.size}`);let e=this._phaseEnumConstants,o=[];for(let a of e){let l=this.getListItem(a.ordinal);o.push(l!=null?this._retrievePhase(l):null)}let r=K.create();for(let a of o){if(a==null)continue;let l=a.getLayoutProcessorConfiguration(t);l!=null&&r.addAll(l)}r.addAll(this._additionalProcessors);let i=[];for(let a of e){for(let c of this._retrieveProcessors(r.processorsBefore(a)))i.push(c);let l=o[a.ordinal];l!=null&&i.push(l)}let s=e[e.length-1];for(let a of this._retrieveProcessors(r.processorsAfter(s)))i.push(a);return i}provideDefault(){return null}_retrieveProcessors(t){return[...t].sort((o,r)=>this._processorComparator.compare(o,r)).map(o=>this._retrieveProcessor(o))}_retrievePhase(t){return this._retrieveProcessor(t)}_retrieveProcessor(t){if(this._enableCaching){if(this._cache.has(t))return this._cache.get(t);let e=t.create();return this._cache.set(t,e),e}return t.create()}};var Ie=class n{constructor(t=-1){this._parentMonitor=null,this._children=[],this._maxLevels=t<0?-1:t,this._taskName=null,this._closed=!1,this._totalWork=0,this._completedWork=0,this._currentChildWork=-1,this._recordLogs=!1,this._logMessages=null,this._recordExecutionTime=!1,this._startTime=0,this._totalTime=0}withMaxHierarchyLevels(t){return this._maxLevels=t<0?-1:t,this}withLogging(t){return this._recordLogs=t,this._logMessages=t?[]:null,this}withLogPersistence(t){return this}withExecutionTimeMeasurement(t){return this._recordExecutionTime=t,this}begin(t,e){if(this._closed)throw new Error("The task is already done.");if(this._taskName!==null)return!1;if(t==null)throw new Error("Task name must not be null.");return this._taskName=t,this._totalWork=e,this._doBegin(t,e,this._parentMonitor===null,this._maxLevels),this._recordExecutionTime&&(this._startTime=performance.now()),!0}_doBegin(t,e,o,r){}worked(t){t>0&&!this._closed&&this._internalWorked(t)}_internalWorked(t){this._totalWork>0&&this._completedWork<this._totalWork&&(this._completedWork+=t,this._doWorked(this._completedWork,this._totalWork,this._parentMonitor===null),this._parentMonitor!==null&&this._parentMonitor._currentChildWork>0&&this._maxLevels!==0&&this._parentMonitor._internalWorked(t/this._totalWork*this._parentMonitor._currentChildWork))}_doWorked(t,e,o){}done(){if(this._taskName===null)throw new Error("The task has not begun yet.");this._closed||(this._recordExecutionTime&&(this._totalTime=(performance.now()-this._startTime)/1e3),this._completedWork<this._totalWork&&this._internalWorked(this._totalWork-this._completedWork),this._doDone(this._parentMonitor===null,this._maxLevels),this._closed=!0)}_doDone(t,e){}isRunning(){return this._taskName!==null&&!this._closed}isCanceled(){return!1}getTaskName(){return this._taskName}subTask(t){if(!this._closed){let e=this._doSubTask(t,this._maxLevels);return this._children.push(e),e._parentMonitor=this,this._currentChildWork=t,e}return null}_doSubTask(t,e){let o=e>0?e-1:e;return new n().withMaxHierarchyLevels(o).withLogging(this._recordLogs).withExecutionTimeMeasurement(this._recordExecutionTime)}getSubMonitors(){return this._children}getParentMonitor(){return this._parentMonitor}isLoggingEnabled(){return this._recordLogs}isLogPersistenceEnabled(){return!1}log(t){this._recordLogs&&t!==null&&t!==void 0&&this._logMessages.push(String(t))}getLogs(){return this._logMessages}logGraph(t,e,o){}getLoggedGraphs(){return null}isExecutionTimeMeasured(){return this._recordExecutionTime}getExecutionTime(){return this._totalTime}};var gc=class{constructor(){this._roots=[]}process(t,e){e.begin("Find roots",1),this._roots.length=0;for(let o of t.getNodes())o.getIncomingEdges().length===0&&(o.setProperty(L.ROOT,!0),this._roots.push(o));switch(this._roots.length){case 0:{let o=new Ps(0,t,"DUMMY_ROOT");o.setProperty(L.ROOT,!0),o.setProperty(L.DUMMY,!0),t.getNodes().push(o);break}case 1:break;default:{let o=new Ps(0,t,"SUPER_ROOT");for(let r of this._roots)o.addChild(r),r.setProperty(L.ROOT,!1);o.setProperty(L.ROOT,!0),o.setProperty(L.DUMMY,!0),t.getNodes().push(o);break}}e.done()}};var hc=class n{constructor(){this._gloFanMap=new Map,this._gloDescMap=new Map}process(t,e){var r,i;e.begin("Processor compute fanout",1),this._gloFanMap.clear(),this._gloDescMap.clear();let o=null;for(let s of t.getNodes())if(s.getProperty(L.ROOT)){o=s;break}if(o==null){e.done();return}this._calculateFan([o]);for(let s of t.getNodes()){let a=s.getProperty(L.ID),l=(r=this._gloFanMap.get(a))!=null?r:0;s.setProperty(L.FAN,l);let c=1+((i=this._gloDescMap.get(a))!=null?i:0);s.setProperty(L.DESCENDANTS,c)}e.done()}_calculateFan(t){var e,o;if(t.length>0){let r=[],i=null,s=null,a=Math.floor(Math.log10(t.length))+1,l=0;for(let g of t){s!==g.getProperty(L.ID)&&(s=g.getProperty(L.ID),l=0),s!=null?i=s+n.formatRight(l++,a):i=n.formatRight(l++,a),g.setProperty(L.ID,i);for(let h of g.getChildren())r.push(h),h.setProperty(L.ID,i)}let c=new Map;for(let g=0;g<(i!=null?i:"").length-a;g++)for(let h of t){let d=h.getProperty(L.ID).substring(0,g+1),f=((e=c.get(d))!=null?e:0)+1;c.set(d,f)}for(let[g,h]of c){let d=(o=this._gloDescMap.get(g))!=null?o:0;this._gloDescMap.set(g,h+d);let f=this._gloFanMap.get(g);(f==null||f<h)&&this._gloFanMap.set(g,h)}this._calculateFan(r)}}static formatRight(t,e){let o=`${t}`;for(;o.length<e;)o=`0${o}`;return o}};var dc=class{constructor(){this._gloLevelMap=new Map}process(t,e){var r;e.begin("Processor compute fanout",1);let o=t.getNodes().filter(i=>i.getProperty(L.ROOT));this._setLevel(o,0);for(let i of t.getNodes()){let s=(r=this._gloLevelMap.get(i.id))!=null?r:0;i.setProperty(V.TREE_LEVEL,s)}e.done()}_setLevel(t,e){if(t.length>0){let o=[];for(let r of t){this._gloLevelMap.set(r.id,e);for(let i of r.getChildren())o.push(i)}this._setLevel(o,e+1)}}};var fc=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor set neighbors",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let r of t.getNodes())if(r.getProperty(L.ROOT)){o=r;break}o!=null&&this._setNeighbors([...o.getChildren()],e),e.done()}_setNeighbors(t,e){if(t.length>0){let o=typeof e.subTask=="function"?e.subTask(t.length/this._numberOfNodes):e;o.begin("Set neighbors in level",1);let r=[],i=null;for(let s of t){for(let a of s.getChildren())r.push(a);i!=null&&(i.setProperty(L.RIGHTNEIGHBOR,s),s.setProperty(L.LEFTNEIGHBOR,i),s.getParent()===i.getParent()&&(i.setProperty(L.RIGHTSIBLING,s),s.setProperty(L.LEFTSIBLING,i))),i=s}o.done(),this._setNeighbors(r,e)}}};var uc=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor determine the height for each level",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let r of t.getNodes())if(r.getProperty(L.ROOT)){o=r;break}o!=null&&this._setLevelHeight([o],e,t.getProperty(V.DIRECTION)),e.done()}_setLevelHeight(t,e,o){if(t.length>0){let r=typeof e.subTask=="function"?e.subTask(t.length/this._numberOfNodes):e;r.begin("Set neighbors in level",1);let i=[],s=0;if(o.isHorizontal())for(let a of t){for(let l of a.getChildren())i.push(l);s<a.getSize().x&&(s=a.getSize().x)}else for(let a of t){for(let l of a.getChildren())i.push(l);s<a.getSize().y&&(s=a.getSize().y)}for(let a of t)a.setProperty(L.LEVELHEIGHT,s);r.done(),this._setLevelHeight(i,e,o)}}};var _c=class{process(t,e){e.begin("Processor determine the coords for each level",1);let o=[],r=t.getProperty(V.DIRECTION).isHorizontal();for(let i of t.getNodes()){let s=i.getProperty(V.TREE_LEVEL);for(;s>o.length-1;)o.push(new Gt(Number.MAX_VALUE,-Number.MAX_VALUE));let a=o[s];r?(i.getPosition().x<a.getFirst()&&a.setFirst(i.getPosition().x),i.getPosition().x+i.getSize().x>a.getSecond()&&a.setSecond(i.getPosition().x+i.getSize().x)):(i.getPosition().y<a.getFirst()&&a.setFirst(i.getPosition().y),i.getPosition().y+i.getSize().y>a.getSecond()&&a.setSecond(i.getPosition().y+i.getSize().y))}for(let i of t.getNodes()){let s=i.getProperty(V.TREE_LEVEL);i.setProperty(L.LEVELMIN,o[s].getFirst()),i.setProperty(L.LEVELMAX,o[s].getSecond())}e.done()}};var pc=class{process(t,e){e.begin("Process directions",1);let o=t.getProperty(V.DIRECTION);if(o!==R.DOWN)for(let r of t.getNodes()){let i=r.getProperty(L.XCOOR),s=r.getProperty(L.YCOOR);switch(o){case R.UP:s=-s;break;case R.RIGHT:{let a=i;i=s,s=a;break}case R.LEFT:{let a=i;i=-s,s=a;break}}r.setProperty(L.XCOOR,i),r.setProperty(L.YCOOR,s)}e.done()}};var Ec=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor set coordinates",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let s of t.getNodes())if(s.getProperty(L.ROOT)){o=s;let a=s.getPosition();a.x=s.getProperty(L.XCOOR),a.y=s.getProperty(L.YCOOR);break}if(o==null){e.done();return}let r=o.getChildrenCopy(),i=1;do{let s=typeof e.subTask=="function"?e.subTask(i):e;r=this._setCoordinates(r,s),i=r.length/this._numberOfNodes}while(r.length>0);for(let s of t.getNodes())s.getPosition().sub(new O(s.getSize().x/2,s.getSize().y/2));e.done()}_setCoordinates(t,e){if(t.length>0){let o=[];for(let r of t){for(let s of r.getChildrenCopy())o.push(s);let i=r.getPosition();i.x=r.getProperty(L.XCOOR),i.y=r.getProperty(L.YCOOR)}return o}return[]}};var Ro=class n{static getRoot(t){for(let e of t.getNodes())if(e.getProperty(L.ROOT))return e;throw new Error("No root found in tree graph.")}static depth(t){let e=n.getChildren(t);if(e.length===0)return 1;let o=0;for(let r of e)o=Math.max(o,n.depth(r));return o+1}static getChildren(t){let e=new Set,o=[];for(let r of t.getOutgoingEdges()){let i=r.getTarget();e.has(i)||(e.add(i),o.push(i))}return o}static getLeftMost(t,e=-1){let o=[...t];if(o.length>0){let r=e;if(r>1){r--;let i=[];for(let s of o)for(let a of s.getChildren())i.push(a);return n.getLeftMost(i,r)}if(r<0){let i=[];for(let s of o)for(let a of s.getChildren())i.push(a);if(i.length>0)return n.getLeftMost(i,r)}}return o.length>0?o[0]:null}static getDirection(t){return t.getProperty(V.DIRECTION)}static getDirectionVector(t){return t===R.UP?new O(0,-1):t===R.RIGHT?new O(1,0):t===R.LEFT?new O(-1,0):new O(0,1)}static getLowestParent(t,e){let o=n.getDirectionVector(n.getDirection(e)),r=t.getIncomingEdges();if(r.length===0)return null;let i=new Set;for(let g of r)i.add(g.getSource());let s=e.getNodes().filter(g=>i.has(g));if(s.length===0)return null;let a=g=>new O(g.getPosition().x+g.getSize().x/2,g.getPosition().y+g.getSize().y/2).dotProduct(o),l=s[0],c=a(s[0]);for(let g=1;g<s.length;g++){let h=a(s[g]);h>c&&(l=s[g],c=h)}return l}static getFirstPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getTarget().getPosition().x,t.getTarget().getPosition().y):e.getFirst()}static getLastPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getSource().getPosition().x,t.getSource().getPosition().y):e.getLast()}static isCycleInducing(t,e){let o=n.getDirectionVector(n.getDirection(e)),r=t.getTarget().getPosition().x-t.getSource().getPosition().x,i=t.getTarget().getPosition().y-t.getSource().getPosition().y;return o.x*r+o.y*i<=0}static getAllOutgoingEdges(t,e){let o=[];for(let r of e.getEdges())r.getSource()===t&&o.push(r);return o}static getAllIncomingEdges(t,e){let o=[];for(let r of e.getEdges())r.getTarget()===t&&o.push(r);return o}static getUniqueLong(t,e){return t+","+e}static toNodeBorder(t,e,o){let r=o.x/2,i=o.y/2,s=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y),l=1,c=1;s>r&&(l=r/s),a>i&&(c=i/a);let g=Math.min(l,c);t.x+=g*(e.x-t.x),t.y+=g*(e.y-t.y)}};var Os=class n{constructor(t,e,o){this._first=t,this._second=e,this._third=o}getFirst(){return this._first}getSecond(){return this._second}getThird(){return this._third}equals(t){return t instanceof n?ku(this._first,t._first)&&ku(this._second,t._second)&&ku(this._third,t._third):!1}toString(){return`(${this._first}, ${this._second}, ${this._third})`}};function ku(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):!1}var mc=class{constructor(){this._levels=[]}process(t,e){if(e.begin("Process compaction",1),!t.getProperty(V.COMPACTION)){e.done();return}let o=t.getProperty(V.DIRECTION),r=t.getProperty(V.SPACING_NODE_NODE);this._setUpLevels(t,o),this._computeNodeConstraints(t,r/2/2);let i=Ro.getDirectionVector(o),s=[...t.getNodes()].sort((a,l)=>{let c=i.dotProduct(new O(a.getPosition().x,a.getPosition().y)),g=i.dotProduct(new O(l.getPosition().x,l.getPosition().y));return c-g});for(let a of s){if(a.getProperty(L.ROOT))continue;let l=this._getLowestDependentNode(a,o),c=Ro.getLowestParent(a,t),g=0,h=0;if(l!=null){let d=l.getPosition();switch(o){case R.LEFT:g=d.x-r-a.getSize().x,c.getPosition().x-r-a.getSize().x<g&&(g=c.getPosition().x-r-a.getSize().x),h=g+a.getSize().x;break;case R.RIGHT:g=d.x+l.getSize().x+r,c.getPosition().x+r>g&&(g=c.getPosition().x+c.getSize().x+r),h=g+a.getSize().x;break;case R.UP:g=d.y-r-a.getSize().y,c.getPosition().y-r-a.getSize().y<g&&(g=c.getPosition().y-r-a.getSize().y),h=g+a.getSize().y;break;case R.DOWN:g=d.y+l.getSize().y+r,c.getPosition().y+r>g&&(g=c.getPosition().y+c.getSize().y+r),h=g+a.getSize().y;break}}else if(c!=null)switch(o){case R.LEFT:g=c.getPosition().x-r-a.getSize().x,h=g+a.getSize().x;break;case R.RIGHT:g=c.getPosition().x+c.getSize().x+r,h=g+a.getSize().x;break;case R.UP:g=c.getPosition().y-r-a.getSize().y,h=g+a.getSize().y;break;case R.DOWN:g=c.getPosition().y+c.getSize().y+r,h=g+a.getSize().y;break}if(t.getProperty(V.EDGE_ROUTING_MODE)===ms.AVOID_OVERLAP){let d=this._levels.find(f=>f.getFirst()<=g&&f.getSecond()>=h);if(d!=null)o.isHorizontal()?a.getPosition().x=g:a.getPosition().y=g;else{let f=this._levels.slice(1);o===R.LEFT||o===R.UP?d=f.find(E=>E.getFirst()<=g):d=f.find(E=>E.getFirst()>=g),d!=null&&(o.isHorizontal()?a.getPosition().x=d.getFirst():a.getPosition().y=d.getFirst())}if(d!=null){let f=this._levels.indexOf(d);f>0&&f!==a.getProperty(V.TREE_LEVEL)&&(a.setProperty(L.COMPACT_LEVEL_ASCENSION,!0),a.setProperty(V.TREE_LEVEL,f))}}else o.isHorizontal()?a.getPosition().x=g:a.getPosition().y=g}e.done()}_setUpLevels(t,e){this._levels=[];for(let o of t.getNodes()){for(;o.getProperty(V.TREE_LEVEL)>this._levels.length-1;)this._levels.push(new Gt(Number.MAX_VALUE,-Number.MAX_VALUE));let r=o.getProperty(V.TREE_LEVEL),i=this._levels[r];e.isHorizontal()?(o.getPosition().x<i.getFirst()&&i.setFirst(o.getPosition().x),o.getPosition().x+o.getSize().x>i.getSecond()&&i.setSecond(o.getPosition().x+o.getSize().x)):(o.getPosition().y<i.getFirst()&&i.setFirst(o.getPosition().y),o.getPosition().y+o.getSize().y>i.getSecond()&&i.setSecond(o.getPosition().y+o.getSize().y))}}_computeNodeConstraints(t,e){let o=t.getProperty(V.DIRECTION),r=o.isHorizontal()?R.DOWN:R.RIGHT,i=Ro.getDirectionVector(o),s=Ro.getDirectionVector(r),a=t.getNodes().filter(h=>{let d=typeof h.getLabel=="function"?h.getLabel():"";return!(d!=null&&d.includes("SUPER_ROOT"))}),l=[];for(let h of a){let d=h.getPosition().clone();d.sub(e,e),l.push(new Os(h,d,!0))}for(let h of a){let d=h.getPosition().clone();d.add(h.getSize().x+e,h.getSize().y+e),l.push(new Os(h,d,!1))}l.sort((h,d)=>s.dotProduct(h.getSecond().clone())-s.dotProduct(d.getSecond().clone()));let c=new Wu((h,d)=>i.dotProduct(h.getPosition().clone())-i.dotProduct(d.getPosition().clone())),g=new Map;for(let h of l){let d=h.getFirst();if(h.getThird()){c.add(d);let f=c.headSet(d);f.length>0&&g.set(d,f[f.length-1]),c.tailSet(d).length>1&&g.set(this._getRightElement(c,d),d)}else{let f=c.headSet(d);if(f.length>0){let P=f[f.length-1];P===g.get(d)&&d.getProperty(L.COMPACT_CONSTRAINTS).push(P)}if(c.tailSet(d).length>1){let P=this._getRightElement(c,d);g.get(P)===d&&P.getProperty(L.COMPACT_CONSTRAINTS).push(d)}c.remove(d)}}}_getRightElement(t,e){let o=t.tailSet(e);if(o.length<=1)throw new Error("NullPointerException: no right element");return o[1]}_getLowestDependentNode(t,e){let o=t.getProperty(L.COMPACT_CONSTRAINTS);if(o==null||o.length<1)return null;if(o.length===1)return o[0];let r=o[0];switch(e){case R.LEFT:for(let i of o)i.getPosition().x<r.getPosition().x&&(r=i);break;case R.RIGHT:for(let i of o)i.getPosition().x+i.getSize().x>r.getPosition().x+r.getSize().x&&(r=i);break;case R.UP:for(let i of o)i.getPosition().y<r.getPosition().y&&(r=i);break;case R.DOWN:for(let i of o)i.getPosition().y+i.getSize().y>r.getPosition().y+r.getSize().y&&(r=i);break}return r}},Wu=class{constructor(t){this._compare=t,this._items=[]}add(t){this._items.push(t),this._items.sort(this._compare)}remove(t){let e=this._items.indexOf(t);e>=0&&this._items.splice(e,1)}headSet(t){let e=this._items.indexOf(t);if(e<0){let o=0;for(;o<this._items.length&&this._compare(this._items[o],t)<0;)o++;return this._items.slice(0,o)}return this._items.slice(0,e)}tailSet(t){let e=this._items.indexOf(t);if(e<0){let o=0;for(;o<this._items.length&&this._compare(this._items[o],t)<0;)o++;return this._items.slice(o)}return this._items.slice(e)}};var Pc=class{process(t,e){e.begin("Process graph bounds",1);let o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let a of t.getNodes()){let l=a.getPosition(),c=a.getSize();l.x<o&&(o=l.x),l.y<r&&(r=l.y),l.x+c.x>i&&(i=l.x+c.x),l.y+c.y>s&&(s=l.y+c.y)}t.setProperty(L.GRAPH_XMIN,o),t.setProperty(L.GRAPH_YMIN,r),t.setProperty(L.GRAPH_XMAX,i),t.setProperty(L.GRAPH_YMAX,s),e.done()}};var Oc=class{process(t,e){e.begin("Untreeify",1);let o=t.getProperty(L.REMOVABLE_EDGES);for(let r of o)r.getSource().getOutgoingEdges().push(r),r.getTarget().getIncomingEdges().push(r);e.done()}};var pt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.ROOT_PROC:return new gc;case n.FAN_PROC:return new hc;case n.LEVEL_PROC:return new dc;case n.NEIGHBORS_PROC:return new fc;case n.LEVEL_HEIGHT:return new uc;case n.LEVEL_COORDS:return new _c;case n.DIRECTION_PROC:return new pc;case n.NODE_POSITION_PROC:return new Ec;case n.COMPACTION_PROC:return new mc;case n.GRAPH_BOUNDS_PROC:return new Pc;case n.DETREEIFYING_PROC:return new Oc;default:throw new Error(`No implementation available for processor ${this}`)}}};pt.ROOT_PROC=new pt("ROOT_PROC",0);pt.FAN_PROC=new pt("FAN_PROC",1);pt.LEVEL_PROC=new pt("LEVEL_PROC",2);pt.NEIGHBORS_PROC=new pt("NEIGHBORS_PROC",3);pt.LEVEL_HEIGHT=new pt("LEVEL_HEIGHT",4);pt.DIRECTION_PROC=new pt("DIRECTION_PROC",5);pt.NODE_POSITION_PROC=new pt("NODE_POSITION_PROC",6);pt.COMPACTION_PROC=new pt("COMPACTION_PROC",7);pt.LEVEL_COORDS=new pt("LEVEL_COORDS",8);pt.GRAPH_BOUNDS_PROC=new pt("GRAPH_BOUNDS_PROC",9);pt.DETREEIFYING_PROC=new pt("DETREEIFYING_PROC",10);pt.VALUES=[pt.ROOT_PROC,pt.FAN_PROC,pt.LEVEL_PROC,pt.NEIGHBORS_PROC,pt.LEVEL_HEIGHT,pt.DIRECTION_PROC,pt.NODE_POSITION_PROC,pt.COMPACTION_PROC,pt.LEVEL_COORDS,pt.GRAPH_BOUNDS_PROC,pt.DETREEIFYING_PROC];var Sc=class{constructor(){this._visited=null,this._eliminated=null}process(t,e){e.begin("DFS Treeifying phase",1),this._init(t),this._collectEdges(t),this._eliminated=null,this._visited=null,e.done()}getLayoutProcessorConfiguration(){return K.create().addAfter(Mt.P3_NODE_PLACEMENT,pt.DETREEIFYING_PROC)}_init(t){let e=t.getNodes().length;this._eliminated=[],this._visited=new Array(e).fill(0);let o=0;for(let r of t.getNodes())r.id=o++}_collectEdges(t){let e=t.getProperty(V.SEARCH_ORDER);for(let o of t.getNodes())if(this._visited[o.id]===0){switch(e){case ur.DFS:this._dfs(o);break;case ur.BFS:this._bfs(o);break}this._visited[o.id]=2}for(let o of this._eliminated)SE(o.getSource().getOutgoingEdges(),o),SE(o.getTarget().getIncomingEdges(),o);t.setProperty(L.REMOVABLE_EDGES,this._eliminated)}_dfs(t){this._visited[t.id]=1;for(let e of t.getOutgoingEdges()){let o=e.getTarget();this._visited[o.id]===1?this._eliminated.push(e):this._visited[o.id]===2?this._visited[o.id]=1:this._dfs(o)}}_bfs(t){let e=[t];for(;e.length>0;){let o=e.shift();this._visited[o.id]=1;for(let r of o.getOutgoingEdges()){let i=r.getTarget();this._visited[i.id]===1?this._eliminated.push(r):this._visited[i.id]===2?this._visited[i.id]=1:e.push(i)}}}};function SE(n,t){let e=n.indexOf(t);e>=0&&n.splice(e,1)}function TE(n){return(t,e)=>{var o,r;return((o=t.getProperty(n))!=null?o:0)-((r=e.getProperty(n))!=null?r:0)}}var Tc=class{constructor(){this._weighting=null,this._debug=!1}getLayoutProcessorConfiguration(){return K.create().before(Mt.P2_NODE_ORDERING).add(pt.ROOT_PROC).add(pt.FAN_PROC).add(pt.LEVEL_PROC)}process(t,e){var i;e.begin("Processor arrange node",1),this._debug=t.getProperty(V.DEBUG_MODE),this._debug&&((i=e.log)==null||i.call(e,"NodeOrderer!"));let o=t.getNodes().find(s=>s.getProperty(L.ROOT));if(o==null){e.done();return}this._weighting=t.getProperty(V.WEIGHTING);let r=typeof e.subTask=="function"?e.subTask(1):e;this._weighting===je.FAN||this._weighting===je.DESCENDANTS?this._orderLevelFanDescendants([o],r):this._weighting===je.CONSTRAINT&&this._orderLevelConstraint([o],r),e.done()}_orderLevelFanDescendants(t,e){var g,h;e.begin("Processor arrange level",1);let o=L.FAN;this._weighting===je.DESCENDANTS&&(o=L.DESCENDANTS);let r=0;t.sort(TE(o));let i=t.length,s=!0,a=t.length-1;for(;s&&a>=0;)((g=t[a].getProperty(o))!=null?g:0)===0?i--:s=!1,a--;let l=t.slice(0,i),c=t.slice(i);if(l.length===0)for(let d of c)d.setProperty(L.POSITION,r++);else{let d=l.length;for(let f of l){f.setProperty(L.POSITION,r++);let E=f.getChildrenCopy(),P=typeof e.subTask=="function"?e.subTask(1/d):e;this._orderLevelFanDescendants(E,P),E.sort((I,C)=>{var x,M;return((x=C.getProperty(L.POSITION))!=null?x:0)-((M=I.getProperty(L.POSITION))!=null?M:0)});let S=[];for(let I of E)for(let C of f.getOutgoingEdges())C.getTarget()===I&&S.push(C);f.getOutgoingEdges().length=0;for(let I of S)f.getOutgoingEdges().push(I);let T=f.getOutgoingEdges().length,N=c.length-1;for(s=!0;T>0&&s&&N>=0;){let I=c[N];((h=I.getProperty(o))!=null?h:0)===0?(I.setProperty(L.POSITION,r++),T--,c.splice(N,1)):s=!1,N--}}}e.done()}_orderLevelConstraint(t,e){var l;e.begin("Processor arrange level",1),this._debug&&((l=e.log)==null||l.call(e,"OrderLevelConstraint!"));let o=t.filter(c=>{var g;return((g=c.getProperty(V.POSITION_CONSTRAINT))!=null?g:-1)<0}),r=t.filter(c=>{var h;let g=(h=c.getProperty(V.POSITION_CONSTRAINT))!=null?h:-1;return g<t.length&&g>=0}),i=t.filter(c=>{var g;return((g=c.getProperty(V.POSITION_CONSTRAINT))!=null?g:-1)>=t.length}),s=new Array(t.length).fill(null);for(let c=0;c<r.length;c++){let g=r[c],h=g.getProperty(V.POSITION_CONSTRAINT);h>=0&&h<r.length&&s[h]==null&&(s[h]=g,r.splice(c,1),c--)}for(let c=0;c<r.length;c++){let g=r[c],h=g.getProperty(V.POSITION_CONSTRAINT);for(let d=0;;d++){let f=h+d;if(f<s.length&&f>=0&&s[f]==null){s[f]=g,r.splice(c,1),c--;break}if(f=h-d,f<s.length&&f>=0&&s[f]==null){s[f]=g,r.splice(c,1),c--;break}}}i.sort((c,g)=>{var h,d;return-(((h=c.getProperty(V.POSITION_CONSTRAINT))!=null?h:0)-((d=g.getProperty(V.POSITION_CONSTRAINT))!=null?d:0))});for(let c=s.length-1;c>=0;c--)s[c]==null&&i.length>0&&(s[c]=i[0],i.splice(0,1));for(let c=0;c<s.length;c++)s[c]==null&&o.length>0&&(s[c]=o[0],o.splice(0,1));for(let c=0;c<s.length;c++)s[c].setProperty(L.POSITION,c);let a=t.filter(c=>{var g;return((g=c.getProperty(L.FAN))!=null?g:0)!==0});for(let c of a){let g=c.getChildrenCopy(),h=typeof e.subTask=="function"?e.subTask(1/a.length):e;this._orderLevelConstraint(g,h),g.sort(TE(L.POSITION));let d=[];for(let f of g)for(let E of c.getOutgoingEdges())E.getTarget()===f&&d.push(E);c.getOutgoingEdges().length=0;for(let f of d)c.getOutgoingEdges().push(f)}e.done()}};var Nc=class{constructor(){this._spacing=0,this._xTopAdjustment=0,this._yTopAdjustment=0,this._direction=R.UNDEFINED}getLayoutProcessorConfiguration(){return K.create().addBefore(Mt.P2_NODE_ORDERING,pt.ROOT_PROC).before(Mt.P3_NODE_PLACEMENT).add(pt.LEVEL_HEIGHT).add(pt.NEIGHBORS_PROC).before(Mt.P4_EDGE_ROUTING).add(pt.DIRECTION_PROC).add(pt.NODE_POSITION_PROC)}process(t,e){e.begin("Processor order nodes",2),this._spacing=t.getProperty(V.SPACING_NODE_NODE),this._direction=t.getProperty(V.DIRECTION),this._direction===R.UNDEFINED&&(this._direction=R.DOWN,t.setProperty(V.DIRECTION,this._direction));let o=[];for(let i of t.getNodes())i.getProperty(L.ROOT)&&o.push(i);let r=o[0];this._firstWalk(r,0),e.worked(1),this._secondWalk(r,this._yTopAdjustment-r.getProperty(L.LEVELHEIGHT)/2,this._xTopAdjustment),e.worked(1),e.done()}_firstWalk(t,e){var r;t.setProperty(L.MODIFIER,0);let o=t.getProperty(L.LEFTSIBLING);if(t.isLeaf())if(o!=null){let i=o.getProperty(L.PRELIM)+this._spacing+this._meanNodeWidth(o,t);t.setProperty(L.PRELIM,i)}else t.setProperty(L.PRELIM,0);else{for(let c of t.getChildren())this._firstWalk(c,e+1);let i=t.getChildrenCopy(),s=(r=i[0])!=null?r:null,l=((i.length>0?i[i.length-1]:null).getProperty(L.PRELIM)+s.getProperty(L.PRELIM))/2;if(o!=null){let c=o.getProperty(L.PRELIM)+this._spacing+this._meanNodeWidth(o,t);t.setProperty(L.PRELIM,c),t.setProperty(L.MODIFIER,t.getProperty(L.PRELIM)-l),this._apportion(t,e)}else t.setProperty(L.PRELIM,l)}}_apportion(t,e){var a,l;let r=(a=t.getChildrenCopy()[0])!=null?a:null,i=r!=null?r.getProperty(L.LEFTNEIGHBOR):null,s=1;for(;r!=null&&i!=null;){let c=0,g=0,h=r,d=i;for(let T=0;T<s;T++)h=h.getParent(),d=d.getParent(),g+=h.getProperty(L.MODIFIER),c+=d.getProperty(L.MODIFIER);let f=i.getProperty(L.PRELIM),E=r.getProperty(L.PRELIM),P=this._meanNodeWidth(r,i),S=f+c+this._spacing+P-E-g;if(S>0){let T=t,N=0;for(;T!=null&&T!==d;)N++,T=T.getProperty(L.LEFTSIBLING);if(T!=null){let I=S/N;for(T=t;T!==d;){let C=T.getProperty(L.PRELIM)+S;T.setProperty(L.PRELIM,C);let x=T.getProperty(L.MODIFIER)+S;T.setProperty(L.MODIFIER,x),S-=I,T=T.getProperty(L.LEFTSIBLING)}}else return}if(s++,r.isLeaf())r=Ro.getLeftMost(t.getChildren(),s);else{let T=[];for(let N of r.getChildren()){T.push(N);break}r=(l=T[0])!=null?l:null}i=r!=null?r.getProperty(L.LEFTNEIGHBOR):null}}_meanNodeWidth(t,e){let o=0;return t!=null&&(this._direction.isVertical()?o+=t.getSize().x/2:o+=t.getSize().y/2),e!=null&&(this._direction.isVertical()?o+=e.getSize().x/2:o+=e.getSize().y/2),o}_secondWalk(t,e,o){var r;if(t!=null){let i=t.getProperty(L.PRELIM)+o,s=e+t.getProperty(L.LEVELHEIGHT)/2;if(t.setProperty(L.XCOOR,Math.round(i)),t.setProperty(L.YCOOR,Math.round(s)),!t.isLeaf()){let a=[];for(let l of t.getChildren()){a.push(l);break}this._secondWalk((r=a[0])!=null?r:null,e+t.getProperty(L.LEVELHEIGHT)+this._spacing,o+t.getProperty(L.MODIFIER))}t.getProperty(L.RIGHTSIBLING)!=null&&this._secondWalk(t.getProperty(L.RIGHTSIBLING),e,o)}}};var yc=class{constructor(t,e,o,r){this._neighborOne=t,this._neighborTwo=e,this._graph=r,this._bendPoints=[o],this._d=r.getProperty(V.DIRECTION),this._nodeBendpointPadding=r.getProperty(V.SPACING_EDGE_NODE),this._onFirstNodeSide=!1,this._onLastNodeSide=!1,this._updateBendPoints()}getNeighborOne(){return this._neighborOne}getNeighborTwo(){return this._neighborTwo}isOnFirstNodeSide(){return this._onFirstNodeSide}isOnLastNodeSide(){return this._onLastNodeSide}addBendPoints(t){this._bendPoints.push(t),this._d.isHorizontal()?this._bendPoints.sort((e,o)=>e.getThird().getTarget().getPosition().y-o.getThird().getTarget().getPosition().y):this._bendPoints.sort((e,o)=>e.getThird().getTarget().getPosition().x-o.getThird().getTarget().getPosition().x),this._updateBendPoints()}_updateBendPoints(){let t=0,e=this._bendPoints.length;for(let o of this._bendPoints){let r,i,s,a=(t+1)/(e+1);if(this._neighborOne==null&&this._neighborTwo==null)return;this._neighborOne!=null&&this._neighborTwo==null?(this._onLastNodeSide=!0,this._d===R.LEFT?(s=this._neighborOne.getPosition().y+this._neighborOne.getSize().y+this._nodeBendpointPadding*(t+1),r=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborOne.getPosition().y+this._neighborOne.getSize().y+this._nodeBendpointPadding*(t+1),r=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborOne.getPosition().x+this._neighborOne.getSize().x+this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborOne.getPosition().x+this._neighborOne.getSize().x+this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding))):this._neighborOne!=null&&this._neighborTwo!=null?this._d===R.LEFT?(s=this._neighborTwo.getPosition().y*a+(this._neighborOne.getPosition().y+this._neighborOne.getSize().y)*(1-a),r=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborTwo.getPosition().y*a+(this._neighborOne.getPosition().y+this._neighborOne.getSize().y)*(1-a),r=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborTwo.getPosition().x*a+(this._neighborOne.getPosition().x+this._neighborOne.getSize().x)*(1-a),r=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborTwo.getPosition().x*a+(this._neighborOne.getPosition().x+this._neighborOne.getSize().x)*(1-a),r=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding)):(this._onFirstNodeSide=!0,this._d===R.LEFT?(s=this._neighborTwo.getPosition().y-this._nodeBendpointPadding*(t+1),r=new O(this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborTwo.getPosition().y-this._nodeBendpointPadding*(t+1),r=new O(this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborTwo.getPosition().x-this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborTwo.getPosition().x-this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding))),o.getFirst().x=r.x,o.getFirst().y=r.y,o.getSecond().x=i.x,o.getSecond().y=i.y,t++}}};var Ic=class n{constructor(){this._steepEndEdgeTheresholdDistance=50,this._steepEndEdgeRatio=5.3,this._steepEndEdgeSampleHeight=40}getLayoutProcessorConfiguration(){return K.create().before(Mt.P4_EDGE_ROUTING).add(pt.LEVEL_COORDS).add(pt.COMPACTION_PROC).add(pt.GRAPH_BOUNDS_PROC)}process(t,e){e.begin("Edge routing",1);let o=t.getProperty(V.EDGE_ROUTING_MODE);if(o===ms.MIDDLE_TO_MIDDLE)this._middleToMiddle(t);else if(o===ms.AVOID_OVERLAP){this._avoidOverlap(t);for(let r of t.getEdges())r.getBendPoints().size()<2&&this._middleToMiddleEdgeRoute(r)}e.done()}_middleToMiddle(t){for(let e of t.getEdges())this._middleToMiddleEdgeRoute(e)}_middleToMiddleEdgeRoute(t){let e=t.getBendPoints(),o=t.getSource(),r=t.getTarget(),i=new O(o.getPosition().x+o.getSize().x/2,o.getPosition().y+o.getSize().y/2),s=new O(r.getPosition().x+r.getSize().x/2,r.getPosition().y+r.getSize().y/2);e.addFirst(i),e.addLast(s),Ro.toNodeBorder(i,e.get(1),o.getSize()),Ro.toNodeBorder(s,e.get(e.size()-2),r.getSize())}_avoidOverlap(t){let e=t.getProperty(V.DIRECTION),o=t.getProperty(V.SPACING_EDGE_NODE),r=t.getProperty(V.EDGE_END_TEXTURE_LENGTH);this._avoidOverlapSetStartPoints(t,e,o),this._avoidOverlapSpecialEdges(t,e,o,r),this._avoidOverlapSetEndPoints(t,e,o,r)}_avoidOverlapSpecialEdges(t,e,o,r){let i=0,s=0,a=new Map,l=0;for(let E of t.getNodes()){let P=E.getProperty(V.TREE_LEVEL);P>l&&(l=P)}l++;let c=new Array(l).fill(0),g=new Array(l).fill(0),h=new Set,d=[];for(let E of t.getEdges())h.has(E)||(h.add(E),d.push(E));let f=e===R.LEFT||e===R.RIGHT;for(let E of d){let P=E.getSource().getProperty(V.TREE_LEVEL),S=E.getTarget().getProperty(V.TREE_LEVEL),T=S-P;if(T>1)for(let N=P+1;N<S;N++){let I=t.getNodes().filter(X=>X.getProperty(V.TREE_LEVEL)===N),C=0,x=(N-P)/(S-P);if(f){I.sort((tt,ot)=>tt.getPosition().y-ot.getPosition().y);let X=E.getSource().getPosition().y*(1-x)+E.getTarget().getPosition().y*x;for(C=0;C<I.length&&!(I[C].getPosition().y>X);C++);}else{I.sort((tt,ot)=>tt.getPosition().x-ot.getPosition().x);let X=E.getSource().getPosition().x*(1-x)+E.getTarget().getPosition().x*x;for(C=0;C<I.length&&!(I[C].getPosition().x>X);C++);}if(I.length>0){let X=E.getBendPoints(),tt=X.size()===0?new O(E.getSource().getPosition().x,E.getSource().getPosition().y):X.getLast(),ot=I[I.length-1],Lt=new O(ot.getPosition().x+ot.getSize().x,ot.getPosition().y+ot.getSize().y),zt=I[0],be=new O(zt.getPosition().x+zt.getSize().x,zt.getPosition().y+zt.getSize().y);if(f){if(C>=I.length-1&&tt.y>Lt.y&&E.getTarget().getPosition().y>Lt.y||C<=0&&tt.y<be.x&&E.getTarget().getPosition().y<be.y)continue}else if(C>=I.length-1&&tt.x>Lt.x&&E.getTarget().getPosition().x>Lt.x||C<=0&&tt.x<be.x&&E.getTarget().getPosition().x<be.x)continue}let M=new O,A=new O;E.getBendPoints().add(M),E.getBendPoints().add(A);let B=new Os(M,A,E),Y=Ro.getUniqueLong(N,C),j=a.get(Y);j==null?(j=new yc(C===0?null:I[C-1],C===I.length?null:I[C],B,t),a.set(Y,j)):j.addBendPoints(B),f?(j.isOnFirstNodeSide()&&j.getNeighborTwo()!=null&&j.getNeighborTwo().getPosition().y<=t.getProperty(L.GRAPH_YMIN)&&i++,j.isOnLastNodeSide()&&j.getNeighborOne()!=null&&j.getNeighborOne().getPosition().y+j.getNeighborOne().getSize().y>=t.getProperty(L.GRAPH_YMAX)&&s++):(j.isOnFirstNodeSide()&&j.getNeighborTwo()!=null&&j.getNeighborTwo().getPosition().x<=t.getProperty(L.GRAPH_XMIN)&&i++,j.isOnLastNodeSide()&&j.getNeighborOne()!=null&&j.getNeighborOne().getPosition().x+j.getNeighborOne().getSize().x>=t.getProperty(L.GRAPH_XMAX)&&s++)}else if(T===0)this._middleToMiddleEdgeRoute(E);else if(T<0){c[P]++,g[S]++;let N=this._avoidOverlapHandleCycleInducingEdges(E,e,t,i,s,o,r,g[S],c[P]);i=N[0],s=N[1]}}}_avoidOverlapHandleCycleInducingEdges(t,e,o,r,i,s,a,l,c){let g=t.getSource(),h=t.getTarget(),d=o.getNodes(),f=0,E;if(e===R.LEFT||e===R.RIGHT){let S=0;for(let T of d)S+=T.getPosition().y+T.getSize().y/2;if(E=S/d.length,g.getPosition().y+g.getSize().y/2>E){i++;let T=-1/0;for(let N of d){let I=N.getPosition().y+N.getSize().y+s*i;I>T&&(T=I)}f=T}else{r++;let T=1/0;for(let N of d){let I=N.getPosition().y-s*r;I<T&&(T=I)}f=T}}else{let S=0;for(let T of d)S+=T.getPosition().x+T.getSize().x/2;if(E=S/d.length,g.getPosition().x+g.getSize().x/2>E){i++;let T=-1/0;for(let N of d){let I=N.getPosition().x+N.getSize().x+s*i;I>T&&(T=I)}f=T}else{r++;let T=1/0;for(let N of d){let I=N.getPosition().x-s*r;I<T&&(T=I)}f=T}}let P=t.getBendPoints();if(e===R.LEFT){P.add(g.getProperty(L.LEVELMIN)-s,f);let S=h.getPosition().x+h.getSize().x+s+a;P.add(S,f),P.add(S,h.getPosition().y+h.getSize().y/2),P.add(h.getPosition().x+h.getSize().x,h.getPosition().y+h.getSize().y/2)}else if(e===R.RIGHT){P.add(g.getProperty(L.LEVELMAX)+s,g.getPosition().y+g.getSize().y/2),P.add(g.getPosition().x+g.getSize().x+s,f);let S=h.getPosition().x-s-a;P.add(S,f),P.add(S,h.getPosition().y+h.getSize().y/2),P.add(h.getPosition().x,h.getPosition().y+h.getSize().y/2)}else if(e===R.UP){P.add(f,g.getProperty(L.LEVELMIN)-s);let S=h.getPosition().y+h.getSize().y+s+a;P.add(f,S),P.add(h.getPosition().x+h.getSize().x/2,S),P.add(h.getPosition().x+h.getSize().x/2,h.getPosition().y+h.getSize().y+s)}else P.isEmpty()||(P.getLast().y=g.getProperty(L.LEVELMAX)+s*c),P.add(f,g.getProperty(L.LEVELMAX)+s*c),P.add(f,h.getPosition().y-s*l-a);return[r,i]}_avoidOverlapSetStartPoints(t,e,o){for(let r of t.getNodes()){if(r.getLabel()==="SUPER_ROOT")continue;let i=[...r.getOutgoingEdges()];if(i.length===0)continue;e===R.LEFT||e===R.RIGHT?i.sort((a,l)=>n._getFirstPoint(a).y-n._getFirstPoint(l).y):i.sort((a,l)=>n._getFirstPoint(a).x-n._getFirstPoint(l).x);let s=i.length;for(let a=0;a<s;a++){if(r.getProperty(L.COMPACT_LEVEL_ASCENSION)&&!n._isCycleInducing(i[a],e))continue;let l=s===1?.5:(a+1)/(s+1);if(e===R.LEFT){let c=r.getProperty(L.LEVELMIN),g=r.getPosition().y+r.getSize().y*l;i[a].getBendPoints().addFirst(Math.min(c,r.getPosition().x-o),g),i[a].getBendPoints().addFirst(r.getPosition().x,g)}else if(e===R.RIGHT){let c=r.getProperty(L.LEVELMAX)+o,g=r.getPosition().y+r.getSize().y*l;i[a].getBendPoints().addFirst(c,g),i[a].getBendPoints().addFirst(r.getPosition().x+r.getSize().x,g)}else if(e===R.UP){let c=r.getProperty(L.LEVELMIN),g=r.getPosition().x+r.getSize().x*l;i[a].getBendPoints().addFirst(g,Math.min(r.getPosition().y-o,c)),i[a].getBendPoints().addFirst(g,r.getPosition().y)}else{let c=r.getProperty(L.LEVELMAX)+o,g=r.getPosition().x+r.getSize().x*l;i[a].getBendPoints().addFirst(g,c),i[a].getBendPoints().addFirst(g,r.getPosition().y+r.getSize().y)}}}}_avoidOverlapSetEndPoints(t,e,o,r){for(let i of t.getNodes()){if(i.getLabel()==="SUPER_ROOT")continue;let s=[...i.getIncomingEdges()];if(s.length===0)continue;e===R.LEFT||e===R.RIGHT?s.sort((l,c)=>n._getLastPoint(l).y-n._getLastPoint(c).y):s.sort((l,c)=>n._getLastPoint(l).x-n._getLastPoint(c).x);let a=s.length;for(let l=0;l<a;l++){let c=a===1?.5:(1+l)/(a+1),g=s[l].getBendPoints();if(e===R.LEFT){let h=i.getProperty(L.LEVELMAX);i.getPosition().x+i.getSize().x+r<h?g.add(h+o,i.getPosition().y+i.getSize().y*c):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x,i.getPosition().y+i.getSize().y*c)}else if(e===R.RIGHT){let h=i.getProperty(L.LEVELMIN);i.getPosition().x-r>h?g.add(h-o,i.getPosition().y+i.getSize().y*c):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x,i.getPosition().y+i.getSize().y*c)}else if(e===R.UP){let h=i.getProperty(L.LEVELMAX);i.getPosition().y+i.getSize().y+r<h?g.add(i.getPosition().x+i.getSize().x*c,h+o):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x*c,i.getPosition().y+i.getSize().y)}else{let h=i.getProperty(L.LEVELMIN);n._isCycleInducing(s[l],e)?g.add(i.getPosition().x+i.getSize().x*c,g.getLast().y):i.getPosition().y-r>h?g.add(i.getPosition().x+i.getSize().x*c,h-o):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x*c,i.getPosition().y)}}}}_maybeAddSteepBend(t,e,o,r,i){if(r<=0)return;let s=t.getLast(),a=s.x,l=s.y,c=e.getPosition().x+e.getSize().x/2,g=e.getPosition().y+e.getSize().y/2,h=this._steepEndEdgeSampleHeight,d=this._steepEndEdgeRatio,f=this._steepEndEdgeTheresholdDistance;if(i===R.LEFT||i===R.RIGHT){let E=Math.abs(l-g),P=Math.abs(a-c)/h;if(!(E/P>f))return;let S=e.getPosition().y+e.getSize().y*o;g>l?t.add(i===R.LEFT?e.getPosition().x+e.getSize().x+r/d:e.getPosition().x-r/d,S-r/2):t.add(i===R.LEFT?e.getPosition().x+e.getSize().x+r/d:e.getPosition().x-r/d,S+r/2)}else{let E=Math.abs(a-c),P=Math.abs(l-g)/h;if(!(E/P>f))return;let S=e.getPosition().x+e.getSize().x*o,T=i===R.UP?e.getPosition().y+e.getSize().y+r/d:e.getPosition().y-r/d;c>a?t.add(S-r/2,T):t.add(S+r/2,T)}}static _getFirstPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getTarget().getPosition().x,t.getTarget().getPosition().y):e.getFirst()}static _getLastPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getSource().getPosition().x,t.getSource().getPosition().y):e.getLast()}static _isCycleInducing(t,e){let o=Ro.getDirectionVector(e),r=t.getTarget().getPosition().x-t.getSource().getPosition().x,i=t.getTarget().getPosition().y-t.getSource().getPosition().y;return o.x*r+o.y*i<=0}};var Mt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.P1_TREEIFICATION:return new Sc;case n.P2_NODE_ORDERING:return new Tc;case n.P3_NODE_PLACEMENT:return new Nc;case n.P4_EDGE_ROUTING:return new Ic;default:throw new Error(`No implementation available for phase ${this}`)}}};Mt.P1_TREEIFICATION=new Mt("P1_TREEIFICATION",0);Mt.P2_NODE_ORDERING=new Mt("P2_NODE_ORDERING",1);Mt.P3_NODE_PLACEMENT=new Mt("P3_NODE_PLACEMENT",2);Mt.P4_EDGE_ROUTING=new Mt("P4_EDGE_ROUTING",3);Mt.VALUES=[Mt.P1_TREEIFICATION,Mt.P2_NODE_ORDERING,Mt.P3_NODE_PLACEMENT,Mt.P4_EDGE_ROUTING];var Rc=class{constructor(){this._algorithmAssembler=Io.create(Mt.VALUES),this._algorithm=[]}doLayout(t,e){if(e.begin("Tree layout",1),t.getProperty(V.DEBUG_MODE)){let r=new Date,i=String(r.getHours()).padStart(2,"0"),s=String(r.getMinutes()).padStart(2,"0"),a=String(r.getSeconds()).padStart(2,"0");e.log(`MrTree! called at ${i}:${s}:${a}`)}this._updateModules(t);let o=typeof e.subTask=="function"?e.subTask(1):e;return this._layout(t,o),e.done(),t}_updateModules(t){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Mt.P1_TREEIFICATION,Mt.P1_TREEIFICATION),this._algorithmAssembler.setPhase(Mt.P2_NODE_ORDERING,Mt.P2_NODE_ORDERING),this._algorithmAssembler.setPhase(Mt.P3_NODE_PLACEMENT,Mt.P3_NODE_PLACEMENT),this._algorithmAssembler.setPhase(Mt.P4_EDGE_ROUTING,Mt.P4_EDGE_ROUTING),this._algorithm=this._algorithmAssembler.build(t)}_layout(t,e){let o=e!=null?e:new Ie;if(o.begin("Layout",this._algorithm.length),t.getProperty(V.DEBUG_MODE)){e.log(`ELK MrTree uses the following ${this._algorithm.length} modules:`);for(let r=0;r<this._algorithm.length;r++)e.log(` Slot ${r}: ${this._algorithm[r].constructor.name}`)}for(let r of this._algorithm){if(typeof o.isCanceled=="function"&&o.isCanceled())return;let i=typeof o.subTask=="function"?o.subTask(1):o;r.process(t,i)}o.done()}};var Lc=class extends de{constructor(){super(),this._klayTree=new Rc,this._componentsProcessor=new nc,this._defaultWork=.1}layout(t,e){t.getProperty(V.OMIT_NODE_MICRO_LAYOUT)||Go.forGraph(t).execute();let o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e;o.begin("build tGraph",1);let r=new lc,i=r.importGraph(t);o.done(),o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Split graph",1);let s=this._componentsProcessor.split(i);o.done();let a=(1-this._defaultWork*4)/Math.max(s.length,1);for(let l of s){let c=typeof e.subTask=="function"?e.subTask(a):e;this._klayTree.doLayout(l,c)}o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Pack components",1),i=this._componentsProcessor.pack(s),o.done(),o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Apply layout results",1),r.applyLayout(i),o.done()}};var NE="org.eclipse.elk.mrtree",yE=!1;function IE(){let n=Ht.getInstance(),t=n.getAlgorithmData(NE);if(t)return yE=!0,t;let e=new Se.Builder().id(NE).name("ELK Mr. Tree").description("Tree-based algorithm provided by the Eclipse Layout Kernel.").category("org.eclipse.elk.tree").definingBundleId("org.eclipse.elk.alg.mrtree").providerFactory(()=>new Lc).supportedFeatures(new Set(["DISCONNECTED"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),yE=!0,e}var Re=class{};Re.ROOT_NODE=new m("root");var zu=2*Math.PI,Yu=1e-10,bt=class n{static getSuccessors(t){let e=[],o=new Set(t.children);for(let r of Ee(t)){let i=r.sources||[];if(i.length===0)continue;let s=i[0];if(s&&s.parent!==void 0&&s.children===void 0)continue;let a=r.targets||[];if(a.length===0)continue;let l=Pt(a[0]);l!=null&&!o.has(l)&&e.push(l)}return e}static getSuccessorSet(t){return new Set(n.getSuccessors(t))}static findRoot(t){for(let e of t.children)if([..._i(e)].length===0)return e;return null}static findRootOfNode(t){let e=n.getTreeParent(t);return e==null?t:n.findRootOfNode(e)}static getNumberOfLeaves(t){let e=n.getSuccessors(t);if(e.length===0)return 1;let o=0;for(let r of e)o+=n.getNumberOfLeaves(r);return o}static createPolarComparator(t,e){return(o,r)=>{let i=n._arc(o,t,e),s=n._arc(r,t,e);return Math.abs(i-s)<Yu?0:i<s?-1:1}}static _arc(t,e,o){let r=t.getProperty(ho),i=Math.atan2(r.y+o,r.x);return i<0&&(i+=zu),i+=e,i>zu&&(i-=zu),i}static findLargestNodeInGraph(t){let e=0;for(let o of t.children){let r=Math.sqrt(o.width*o.width+o.height*o.height);r>e&&(e=r);let i=n.findLargestNodeInGraph(o);i>e&&(e=i)}return e}static getNextLevelNodes(t){let e=[];for(let o of t)for(let r of n.getSuccessors(o))e.push(r);return e}static getNextLevelNodeSet(t){let e=new Set;for(let o of t)for(let r of n.getSuccessorSet(o))e.add(r);return e}static getLastLevelNodes(t){let e=[];for(let o of t)e.push(n.getTreeParent(o));return e}static centerNodesOnRadi(t,e,o){t.x=e-t.width/2,t.y=o-t.height/2}static shiftClosestEdgeToRadi(t,e,o){if(Math.abs(e)<Yu&&Math.abs(o)<Yu){t.x=e-t.width/2,t.y=o-t.height/2;return}e<0?o<0?(t.x=e-t.width,t.y=o):(t.x=e-t.width,t.y=o+t.height):o<0?(t.x=e,t.y=o):(t.x=e,t.y=o+t.height)}static getTreeParent(t){let e=[..._i(t)];if(e.length===0)return null;let r=e[0].sources||[];return r.length===0?null:Pt(r[0])}};var Ac=class{calculateWedgeSpace(t){return bt.getNumberOfLeaves(t)}};var Cc=class{calculateWedgeSpace(t){let e=bt.getSuccessors(t),o=t.height,r=t.width,i=Math.sqrt(o*o+r*r),s=0;for(let a of e)s+=this.calculateWedgeSpace(a);return Math.max(s,i)}};var Li=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.LEAF_NUMBER:return new Ac;case n.NODE_SIZE:return new Cc;default:throw new Error(`AnnulusWedgeCriteria.${this}: no implementation available.`)}}};Li.LEAF_NUMBER=new Li("LEAF_NUMBER");Li.NODE_SIZE=new Li("NODE_SIZE");var Ai=class{constructor(){this._compactionStep=1,this._spacing=0,this._root=null}contractLayer(t,e){for(let o of t){let r=o.x+o.width/2,i=o.y+o.height/2,s=this._root,a=s.x+s.width/2,l=s.y+s.height/2,c=r-a,g=i-l,h=Math.sqrt(c*c+g*g);h!==0&&(c*=this._compactionStep/h,g*=this._compactionStep/h,e?(r-=c,i-=g):(r+=c,i+=g),o.x=r-o.width/2,o.y=i-o.height/2)}}moveNode(t,e){let o=this._root,r=o.x+o.width/2,i=o.y+o.height/2,s=t.x+t.width/2,a=t.y+t.height/2,l=s-r,c=a-i,g=Math.sqrt(l*l+c*c);if(g===0)return;let h=l/g,d=c/g;t.x=t.x+h*e,t.y=t.y+d*e}overlap(t,e){let o=t.x-this._spacing/2,r=e.x-this._spacing/2,i=t.y-this._spacing/2,s=e.y-this._spacing/2,a=t.width+this._spacing,l=e.width+this._spacing,c=t.height+this._spacing,g=e.height+this._spacing;return o<r+l&&r<o&&i<s+g&&s<i||r<o+a&&o<r&&s<i+c&&i<s||o<r+l&&r<o&&i<s&&s<i+c||r<o+a&&o<r&&i<s+g&&s<i}overlapLayer(t){if(t.length<2)return!1;let e=!1;for(let o=0;o<t.length;o++)o<t.length-1?e=e||this.overlap(t[o],t[o+1]):e=e||this.overlap(t[o],t[0]);return e}getCompactionStep(){return this._compactionStep}setCompactionStep(t){this._compactionStep=t}getSpacing(){return this._spacing}setSpacing(t){this._spacing=t}setRoot(t){this._root=t}getRoot(){return this._root}};var xc=class extends Ai{constructor(){super(),this._sorter=null,this._lastRadius=0}compact(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Dc);o!=null&&this.setCompactionStep(o);let r=t.getProperty(Pi);this.setSpacing(r);let i=bt.getSuccessors(e);this._sorter!=null&&this._sorter.sort(i),this._contract(i)}_contract(t){if(t.length===0)return;let e=this._overlapping(t),o=!1;for(;!e;)this.contractLayer(t,!0),o=!0,e=this._overlapping(t);o&&this.contractLayer(t,!1);let r=bt.getNextLevelNodes(t);this._sorter!=null&&this._sorter.sort(r),this._lastRadius=this._calculateRadius(t[0]),this._contract(r)}_calculateRadius(t){let e=this.getRoot(),o=t.x-e.x,r=t.y-e.y;return Math.sqrt(o*o+r*r)}_overlapping(t){if(this.overlapLayer(t))return!0;for(let e of t){let o=bt.getTreeParent(e);if(o!=null&&this.overlap(e,o)||this._calculateRadius(e)-this.getSpacing()<=this._lastRadius)return!0}return!1}};var wc=class extends Ai{constructor(){super(),this._leftContour=new Map,this._rightContour=new Map,this._sorter=null}compact(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Dc);o!=null&&this.setCompactionStep(o);let r=t.getProperty(Pi);this.setSpacing(r);let i=bt.getSuccessors(e);this._sorter!=null&&this._sorter.sort(i),this._constructContour(i);let s=[e];for(let a=0;a<2;a++)for(let l=0;l<i.length;l++){let c=[i[l]],g=l<i.length-1?i[l+1]:i[0],h=l===0?i[i.length-1]:i[l-1];this._contractWedge(i[l],s,h,g,c)}}_contractWedge(t,e,o,r,i){let s=this._overlapping(e,o,r,i),a=!1;for(;!s;)this.contractLayer(i,!0),a=!0,s=this._overlapping(e,o,r,i);a&&this.contractLayer(i,!1);let l=bt.getNextLevelNodes(i);l.length>0&&(this._sorter!=null&&this._sorter.sort(l),this._contractWedge(t,i,o,r,l))}_overlapping(t,e,o,r){this._sorter!=null&&this._sorter.sort(r);let i=r[0];if(this._contourOverlap(e,i,!1))return!0;let s=r[r.length-1];if(this._contourOverlap(o,s,!0)||this.overlapLayer(r))return!0;for(let a of r)for(let l of t)if(this.overlap(a,l))return!0;return!1}_contourOverlap(t,e,o){let r=o?this._leftContour.get(t)||[]:this._rightContour.get(t)||[];for(let i of r)if(this.overlap(e,i))return!0;return!1}_constructContour(t){for(let e of t){let o=[e],r=[e];this._leftContour.set(e,o),this._rightContour.set(e,r);let i=bt.getSuccessors(e);if(i.length>0)for(this._sorter!=null&&this._sorter.sort(i),o.push(i[0]),r.push(i[i.length-1]);bt.getNextLevelNodes(i).length>0;)i=bt.getNextLevelNodes(i),this._sorter!=null&&this._sorter.sort(i),o.push(i[0]),r.push(i[i.length-1])}}};var Xo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.RADIAL_COMPACTION:return new xc;case n.WEDGE_COMPACTION:return new wc;case n.NONE:return null;default:throw new Error(`CompactionStrategy.${this}: no implementation available.`)}}};Xo.NONE=new Xo("NONE");Xo.RADIAL_COMPACTION=new Xo("RADIAL_COMPACTION");Xo.WEDGE_COMPACTION=new Xo("WEDGE_COMPACTION");var Mc=class{evaluate(t){let e=0;for(let o of Ee(t)){let r=o.targets||[];if(r.length===0)continue;let i=Pt(r[0]);if(i==null)continue;let s=i.x+i.width/2,a=i.y+i.height/2,l=t.x+t.width/2,c=t.y+t.height/2,g=new O(s-l,a-c),h=new O(g.x,g.y);Ft.clipVector(h,t.width,t.height),g.x-=h.x,g.y-=h.y,l=s-g.x,c=a-g.y;let d=new O(g.x,g.y);Ft.clipVector(d,i.width,i.height),g.x-=d.x,g.y-=d.y,s=l+g.x,a=c+g.y;let f=s-l,E=a-c;e+=Math.sqrt(f*f+E*E)}return e}};var bc=class{evaluate(t){let e=0;for(let o of Ee(t)){let r=o.targets||[];if(r.length===0)continue;let i=Pt(r[0]);if(i==null)continue;let s=i.x+i.width/2,a=i.y+i.height/2,l=i.getProperty(ho),c=t.x+l.x+t.width/2,g=t.y+l.y+t.height,h=s-c,d=a-g;e+=Math.sqrt(h*h+d*d)}return e}};var Gc=class{constructor(){this._root=null}evaluate(t){this._root=t;let e=0,o=bt.getSuccessors(t);for(let r=0;r<o.length;r++)for(let i=r+1;i<o.length;i++)this._isCrossing(o[r],o[i])&&(e+=1);return e}_isCrossing(t,e){let o=this._root.x+this._root.width/2,r=this._root.x+this._root.width/2,i=new O(t.x+t.width/2,t.y+t.height/2),s=t.getProperty(ho);s.x=s.x+o,s.y=s.y+r;let a=(i.y-s.y)/(i.x-s.x),l=i.y-a*i.x,c=new O(e.x+e.width/2,e.y+e.height/2),g=e.getProperty(ho);g.x=g.x+o,g.y=g.y+r;let h=(c.y-g.y)/(c.x-g.x),d=c.y-h*c.x,f=(l-d)/(h-a);return!(s.x<f&&i.x<f||f<s.x&&f<i.x||g.x<f&&c.x<f||f<g.x&&f<c.x)}};var Ko=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NONE:return null;case n.EDGE_LENGTH:return new Mc;case n.EDGE_LENGTH_BY_POSITION:return new bc;case n.CROSSING_MINIMIZATION_BY_POSITION:return new Gc;default:throw new Error(`RadialTranslationStrategy.${this}: no implementation available.`)}}};Ko.NONE=new Ko("NONE");Ko.EDGE_LENGTH=new Ko("EDGE_LENGTH");Ko.EDGE_LENGTH_BY_POSITION=new Ko("EDGE_LENGTH_BY_POSITION");Ko.CROSSING_MINIMIZATION_BY_POSITION=new Ko("CROSSING_MINIMIZATION_BY_POSITION");var ln=class{sort(t){t.sort((e,o)=>{let r=e.getProperty(Fa),i=o.getProperty(Fa);return r-i})}initialize(t){}};var iT=.25*Math.PI,sT=.5*Math.PI,RE=.75*Math.PI,LE=1.25*Math.PI,nT=1.5*Math.PI,AE=1.75*Math.PI,Hc=class{constructor(){this._compRight=bt.createPolarComparator(0,0),this._compLeft=bt.createPolarComparator(Math.PI,0),this._compTop=bt.createPolarComparator(nT,0),this._compBottom=bt.createPolarComparator(sT,0),this._idSorter=null}initialize(t){this._idSorter=new ln;let e=bt.getSuccessors(t);e.sort(this._compRight),this._setIDForNodes(e,0)}_setIDForNodes(t,e){let o=e,r=0;for(let i of t){i.setProperty(Fa,o++);let s=bt.getSuccessors(i),a=Math.atan2(i.y+i.height/2,i.x+i.width/2);a<0&&(a+=2*Math.PI),a<iT||a>AE?s.sort(this._compLeft):a<=AE&&a>LE?s.sort(this._compTop):a<=LE&&a>RE?s.sort(this._compRight):a<=RE&&s.sort(this._compBottom),r=this._setIDForNodes(s,r)}return o}sort(t){if(t.length>0){if(this._idSorter==null){let e=bt.findRootOfNode(t[0]);this.initialize(e)}this._idSorter.sort(t)}}};var Ar=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NONE:return null;case n.POLAR_COORDINATE:return new Hc;case n.ID:return new ln;default:throw new Error(`SortingStrategy.${this}: no implementation available.`)}}};Ar.NONE=new Ar("NONE");Ar.POLAR_COORDINATE=new Ar("POLAR_COORDINATE");Ar.ID=new Ar("ID");var CE=new m("org.eclipse.elk.radial.centerOnRoot",!1),Fa=new m("org.eclipse.elk.radial.orderId",0),ka=new m("org.eclipse.elk.radial.radius",0),xE=new m("org.eclipse.elk.radial.rotate",!1),vc=new m("org.eclipse.elk.radial.rotation.targetAngle",0),DE=new m("org.eclipse.elk.radial.rotation.computeAdditionalWedgeSpace",!1),wE=new m("org.eclipse.elk.radial.rotation.outgoingEdgeAngles",!1),Bc=new m("org.eclipse.elk.radial.compactor",()=>Xo.NONE),Dc=new m("org.eclipse.elk.radial.compactionStepSize",1,0),Ci=new m("org.eclipse.elk.radial.sorter",()=>Ar.NONE),ME=new m("org.eclipse.elk.radial.wedgeCriteria",()=>Li.NODE_SIZE),bE=new m("org.eclipse.elk.radial.optimizationCriteria",()=>Ko.NONE);var aT=360,lT=Math.PI/180,Uc=class{constructor(){this._radius=0,this._sorter=null,this._annulusWedgeCriteria=null,this._optimizer=null,this._root=null}process(t,e){e.begin("Eades radial",1),this._root=t.getProperty(Re.ROOT_NODE),this._radius=t.getProperty(ka),this._sorter=t.getProperty(Ci).create(),this._annulusWedgeCriteria=t.getProperty(ME).create(),this._optimizer=t.getProperty(bE).create(),this._translate(t),e.done()}_translate(t){let e=0,o=Number.MAX_VALUE;if(this._optimizer!=null)for(let r=0;r<aT;r++){let i=r*lT;this._positionNodes(this._root,0,0,2*Math.PI,i);let s=this._optimizer.evaluate(this._root);s<o&&(e=i,o=s)}this._positionNodes(this._root,0,0,2*Math.PI,e)}_positionNodes(t,e,o,r,i){let s=(o+r)/2+i,a=e*Math.cos(s),l=e*Math.sin(s);bt.centerNodesOnRadi(t,a,l);let c=this._annulusWedgeCriteria.calculateWedgeSpace(t),g=2*Math.acos(e/e+this._radius),h,d;g<r-o?(h=g/c,d=(o+r-g)/2):(h=(r-o)/c,d=o);let f=bt.getSuccessors(t);this._sorter!=null&&(this._sorter.initialize(this._root),this._sorter.sort(f));for(let E of f){let P=this._annulusWedgeCriteria.calculateWedgeSpace(E);this._positionNodes(E,e+this._radius,d,d+h*P,i),d+=h*P}}getLayoutProcessorConfiguration(){return null}};var Fc=class{process(t,e){e.begin("Straight Line Edge Routing",1);let o=t.getProperty(Re.ROOT_NODE);o!=null&&this.routeEdges(o),e.done()}routeEdges(t){for(let e of Ee(t)){let o=e.sources||[];if(o.length===0)continue;let r=o[0];if(r&&r.parent!==void 0&&r.children===void 0||e.isHierarchical&&e.isHierarchical())continue;let i=e.targets||[];if(i.length===0)continue;let s=Pt(i[0]);if(s==null)continue;let a=t.x+t.width/2,l=t.y+t.height/2,c=s.x+s.width/2,g=s.y+s.height/2,h=new O(c-a,g-l),d=new O(h.x,h.y);Ft.clipVector(d,t.width,t.height),h.x-=d.x,h.y-=d.y,a=c-h.x,l=g-h.y;let f=new O(h.x,h.y);Ft.clipVector(f,s.width,s.height),h.x-=f.x,h.y-=f.y,c=a+h.x,g=l+h.y;let E=ar(e,!0,!0);E.setStartLocation(a,l),E.setEndLocation(c,g),this.routeEdges(s)}}getLayoutProcessorConfiguration(){return null}};var Ce=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.P1_NODE_PLACEMENT:return new Uc;case n.P2_EDGE_ROUTING:return new Fc;default:throw new Error(`RadialLayoutPhases.${this}: no implementation available.`)}}};Ce.P1_NODE_PLACEMENT=new Ce("P1_NODE_PLACEMENT",0);Ce.P2_EDGE_ROUTING=new Ce("P2_EDGE_ROUTING",1);Ce.VALUES=[Ce.P1_NODE_PLACEMENT,Ce.P2_EDGE_ROUTING];var kc=class extends Ai{constructor(){super(),this._sorter=null}process(t,e){e.begin("Remove overlaps",1),this._removeOverlaps(t),e.done()}_removeOverlaps(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Pi);this.setSpacing(o);let r=bt.getSuccessors(e);this._extend(r)}_extend(t){if(t.length===0)return;let e=t.map(l=>new O(l.x,l.y));for(;this.overlapLayer(t);)this.contractLayer(t,!1);let o=0,r=0;if(t.length>0){let l=t[0];o=l.x-e[0].x,r=l.y-e[0].y}let i=Math.sqrt(o*o+r*r),s=bt.getNextLevelNodeSet(t);if(s.size>0)for(let l of s)this.moveNode(l,i);let a=[...s];this._sorter!=null&&this._sorter.sort(a),this._extend(a)}};var Wc=class{process(t,e){e.begin("Calculate Graph Size",1);let o=Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let h of t.children){let d=h.getProperty(Nr);o=Math.min(o,h.x-d.left),r=Math.min(r,h.y-d.top),i=Math.max(i,h.x+h.width+d.right),s=Math.max(s,h.y+h.height+d.bottom)}let a=t.getProperty(ns),l=new O(o-a.getLeft(),r-a.getTop()),c=i-o+a.getHorizontal(),g=s-r+a.getVertical();if(t.getProperty(CE)){let h=t.getProperty(Re.ROOT_NODE),d=h.getProperty(Nr),f=h.x+h.width/2+(d.left+d.right)/2-l.x,E=h.y+h.height/2+(d.top+d.bottom)/2-l.y,P=c-f,S=g-E;if(P<c/2){let T=P-f;c+=T,l.x-=T}else{let T=f-P;c+=T}if(S<g/2){let T=S-E;g+=T,l.y-=T}else{let T=E-S;g+=T}}for(let h of t.children)h.x=h.x-l.x,h.y=h.y-l.y;t.getProperty(To)||(t.width=c,t.height=g),t.setProperty(pi,c-a.getHorizontal()),t.setProperty(Ei,g-a.getVertical()),e.done()}};var zc=class{process(t,e){e.begin("Calculate outgoing edge angles",1);let o=t.getProperty(Re.ROOT_NODE);if(o!=null)for(let r of o.getOutgoingEdges()){let i=r.sections||[];if(i.length===0)continue;let s=i[0],a=new O(s.startX,s.startY),l=new O(s.endX,s.endY),c=O.diff(l,a),g=Math.atan2(c.y,c.x),h=r.targets||[];h.length>0&&typeof h[0].setProperty=="function"&&h[0].setProperty(vc,g)}e.done()}};var Yc=class{process(t,e){e.begin("General Compactor",1);let o=t.getProperty(Bc).create();o!=null&&o.compact(t),e.done()}};var Vc=class{rotate(t){let e=t.getProperty(vc);if(t.getProperty(DE)){let r=t.getProperty(Re.ROOT_NODE).getOutgoingEdges();if(r.length>0){let i=r[r.length-1],s=r[0],a=i.targets[0],l=s.targets[0],c=new O(a.x+a.width/2,a.y+a.height/2),g=new O(l.x+l.width/2,l.y+l.height/2),h=e;h<=0&&(h+=2*Math.PI);let d=c.angle(g);d<=0&&(d+=2*Math.PI);let f=Math.atan2(c.y,c.x);f<=0&&(f+=2*Math.PI),e=Math.PI-(f-h+d/2)}}for(let o of t.children){let r=new O(o.x+o.width/2,o.y+o.height/2);r.rotate(e),o.setLocation(r.x-o.width/2,r.y-o.height/2)}}};var Xc=class{process(t,e){e.begin("General Rotator",1),new Vc().rotate(t),e.done()}};var ue=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.OVERLAP_REMOVAL:return new kc;case n.COMPACTION:return new Yc;case n.ROTATION:return new Xc;case n.GRAPH_SIZE_CALCULATION:return new Wc;case n.OUTGOING_EDGE_ANGLES:return new zc;default:throw new Error(`IntermediateProcessorStrategy.${this}: processor is not yet ported.`)}}};ue.OVERLAP_REMOVAL=new ue("OVERLAP_REMOVAL",0);ue.COMPACTION=new ue("COMPACTION",1);ue.ROTATION=new ue("ROTATION",2);ue.GRAPH_SIZE_CALCULATION=new ue("GRAPH_SIZE_CALCULATION",3);ue.OUTGOING_EDGE_ANGLES=new ue("OUTGOING_EDGE_ANGLES",4);ue.VALUES=[ue.OVERLAP_REMOVAL,ue.COMPACTION,ue.ROTATION,ue.GRAPH_SIZE_CALCULATION,ue.OUTGOING_EDGE_ANGLES];var Kc=class extends de{constructor(){super(),this._algorithmAssembler=Io.create(Ce.VALUES)}layout(t,e){let o=this._assembleAlgorithm(t);e.begin("Radial layout",o.length),t.getProperty(So)||Go.forGraph(t).execute();let r=bt.findRoot(t);if(t.setProperty(Re.ROOT_NODE,r),r==null)throw new Error("The given graph is not a tree!");let i=t.getProperty(ka);i===0&&(i=bt.findLargestNodeInGraph(t)),t.setProperty(ka,i);for(let s of o){let a=typeof e.subTask=="function"?e.subTask(1):e;s.process(t,a)}e.done()}_assembleAlgorithm(t){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ce.P1_NODE_PLACEMENT,Ce.P1_NODE_PLACEMENT),this._algorithmAssembler.setPhase(Ce.P2_EDGE_ROUTING,Ce.P2_EDGE_ROUTING);let e=K.create();return e.addBefore(Ce.P2_EDGE_ROUTING,ue.OVERLAP_REMOVAL),t.getProperty(Bc)!==Xo.NONE&&e.addBefore(Ce.P2_EDGE_ROUTING,ue.COMPACTION),t.getProperty(xE)&&e.addBefore(Ce.P2_EDGE_ROUTING,ue.ROTATION),e.addBefore(Ce.P2_EDGE_ROUTING,ue.GRAPH_SIZE_CALCULATION),t.getProperty(wE)&&e.addAfter(Ce.P2_EDGE_ROUTING,ue.OUTGOING_EDGE_ANGLES),this._algorithmAssembler.addProcessorConfiguration(e),this._algorithmAssembler.build(t)}};var GE="org.eclipse.elk.radial",HE=!1;function vE(){let n=Ht.getInstance(),t=n.getAlgorithmData(GE);if(t)return HE=!0,t;let e=new Se.Builder().id(GE).name("ELK Radial").description("Radial layout provider for tree graphs.").category("org.eclipse.elk.tree").definingBundleId("org.eclipse.elk.alg.radial").providerFactory(()=>new Kc).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),HE=!0,e}var Le=class{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}};Le.P1_WIDTH_APPROXIMATION=new Le("P1_WIDTH_APPROXIMATION",0);Le.P2_PACKING=new Le("P2_PACKING",1);Le.P3_WHITESPACE_ELIMINATION=new Le("P3_WHITESPACE_ELIMINATION",2);Le.VALUES=[Le.P1_WIDTH_APPROXIMATION,Le.P2_PACKING,Le.P3_WHITESPACE_ELIMINATION];var $=class{};$.ADDITIONAL_HEIGHT=new m("additionalHeight");$.DRAWING_HEIGHT=new m("drawingHeight");$.DRAWING_WIDTH=new m("drawingWidth");$.MIN_HEIGHT=new m("minHeight");$.MIN_WIDTH=new m("minWidth");$.ROWS=new m("rows");$.TARGET_WIDTH=new m("targetWidth");$.MIN_ROW_INCREASE=new m("minRowIncrease",0);$.MAX_ROW_INCREASE=new m("maxRowIncrease",0);$.MIN_ROW_DECREASE=new m("minRowDecrease",0);$.MAX_ROW_DECREASE=new m("maxRowDecrease",0);var Lo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Lo.ASPECT_RATIO_DRIVEN=new Lo("ASPECT_RATIO_DRIVEN");Lo.MAX_SCALE_DRIVEN=new Lo("MAX_SCALE_DRIVEN");Lo.AREA_DRIVEN=new Lo("AREA_DRIVEN");var Be=class{static computeScaleMeasure(t,e,o){return Math.min(o/t,1/e)}static resetCoordinates(t){for(let e of t)e.setLocation(0,0)}static calculateDimensions(t,e){let o=0,r=0,i=0;for(let s of t)o=Math.max(o,s.getWidth()),r+=s.getHeight()+(i>0&&e||0),i++;return new O(o,r)}static calculateDimensionsOfRectangles(t){let e=0,o=0;for(let r of t)e=Math.max(r.width+r.x,e),o=Math.max(r.height+r.y,o);return new O(e,o)}};var Ss=class{constructor(t,e,o,r,i=0,s=0){this._dar=t,this._drawingWidth=e,this._drawingHeight=o,this._placementOption=r,this._nextXcoordinate=i,this._nextYcoordinate=s,this._area=0,this._aspectRatio=0,this._scaleMeasure=0,this._calcAreaAspectRatioScaleMeasure()}_calcAreaAspectRatioScaleMeasure(){this._drawingWidth>0&&this._drawingHeight>0&&(this._area=this._drawingWidth*this._drawingHeight,this._aspectRatio=this._drawingWidth/this._drawingHeight,this._scaleMeasure=Be.computeScaleMeasure(this._drawingWidth,this._drawingHeight,this._dar))}getDrawingWidth(){return this._drawingWidth}setDrawingWidth(t){this._drawingWidth=t,this._calcAreaAspectRatioScaleMeasure()}getDrawingHeight(){return this._drawingHeight}setDrawingHeight(t){this._drawingHeight=t,this._calcAreaAspectRatioScaleMeasure()}getScaleMeasure(){return this._scaleMeasure}getArea(){return this._area}getAspectRatio(){return this._aspectRatio}getPlacementOption(){return this._placementOption}setPlacementOption(t){this._placementOption=t}getNextXcoordinate(){return this._nextXcoordinate}setNextXcoordinate(t){this._nextXcoordinate=t}getNextYcoordinate(){return this._nextYcoordinate}setNextYcoordinate(t){this._nextYcoordinate=t}getDesiredAspectRatio(){return this._dar}};var Ot=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT=new Ot("CANDIDATE_POSITION_LAST_PLACED_RIGHT");Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW=new Ot("CANDIDATE_POSITION_LAST_PLACED_BELOW");Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT=new Ot("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT");Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW=new Ot("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW");Ot.WHOLE_DRAWING=new Ot("WHOLE_DRAWING");var Ts=class{constructor(t,e,o){this._x=t,this._y=e,this._width=0,this._height=0,this._nodeNodeSpacing=o,this._rects=[]}addRectangle(t){return t.x=this._x+this._width+(this._rects.length===0?0:this._nodeNodeSpacing),t.y=this._y,this._height=Math.max(this._height,t.height),this._width+=t.width+(this._rects.length===0?0:this._nodeNodeSpacing),this._rects.push(t),!0}removeRectangle(t,e){let o=this._rects.indexOf(t);o>=0&&this._rects.splice(o,1),e&&this.updateRow()}updateRow(){let t=0,e=0;for(let o of this._rects)o.x=this._x+t,o.y=this._y,t+=o.width+this._nodeNodeSpacing,e=Math.max(e,o.height+this._nodeNodeSpacing);this._width=t-this._nodeNodeSpacing,this._height=e-this._nodeNodeSpacing}expand(t,e,o){let r=(t-this._width)/this._rects.length;this._height+=e,this._width=t;let i=0;for(let s of this._rects){let a=s.width,l=s.height;s.x=s.x+i*r,s.y=s.y+o*e,s.width=s.width+r,s.height=this._height,i++;let c=s.width,g=s.height;Vs(s,new O(c,g),new O(a,l))}}getY(){return this._y}setY(t){this._y=t}getX(){return this._x}setX(t){this._x=t}getWidth(){return this._width}getHeight(){return this._height}getNodes(){return this._rects}};var cn=class{constructor(t,e,o,r){this._smallestRectWidth=Number.POSITIVE_INFINITY,this._minWidth=0,this._width=0,this._minHeight=0,this._smallestRectHeight=Number.POSITIVE_INFINITY,this._averageHeight=0,this._maxHeight=0,this._height=0,this._children=[],this._rows=[],this._x=t,this._y=e,this._parentRow=o,this._stack=null,this._nodeNodeSpacing=r,this._fixed=!1,this._positionFixed=!1}addChild(t){this._rows.length===0&&this._rows.push(new Ts(this._x,this._y,this._nodeNodeSpacing)),this._children.push(t),this._rows[this._rows.length-1].addRectangle(t),this._adjustSizeAdd(t)}addChildInNewRow(t){this._children.push(t);let e=this.getLastRow();this._rows.push(new Ts(this._x,e.getY()+e.getHeight()+this._nodeNodeSpacing,this._nodeNodeSpacing)),this.getLastRow().addRectangle(t),this._adjustSizeAdd(t)}removeChild(t){let e=this._children.indexOf(t);e>=0&&this._children.splice(e,1);for(let o=0;o<this._rows.length;o++){let r=this._rows[o];if(r.getNodes().includes(t)){r.removeRectangle(t,!0),r.getNodes().length===0&&this._rows.splice(o,1);break}}this._adjustSizeAfterRemove()}setLocation(t,e){this._adjustChildrensXandY(t-this._x,e-this._y);for(let o of this._rows)o.setX(o.getX()+t-this._x),o.setY(o.getY()+e-this._y);this._x=t,this._y=e}_adjustChildrensXandY(t,e){for(let o of this._children)o.setLocation(o.x+t,o.y+e)}_adjustSizeAdd(t){let e=this.getLastRow().getWidth();this._smallestRectWidth=Math.min(this._smallestRectWidth,t.width),this._width=Math.max(this._width,e),this._minWidth=Math.max(this._minWidth,t.width+(this._children.length===1?0:this._nodeNodeSpacing)),this._smallestRectHeight=Math.min(this._smallestRectHeight,t.height),this._maxHeight+=t.height+(this._children.length===1?0:this._nodeNodeSpacing),this._minHeight=Math.max(this._minHeight,t.height);let o=this._rows.length>0?(this._rows.length-1)*this._nodeNodeSpacing:0;for(let r of this._rows)o+=r.getHeight();this._height=o,this._averageHeight=this._maxHeight/this._children.length-this._nodeNodeSpacing*((this._children.length-1)/this._children.length),this._parentRow.notifyAboutNodeChange()}getWidthForTargetHeight(t){if(this._maxHeight<=t)return this._minWidth;if(this._placeRectsInWH(this._minWidth,t,!1))return this._minWidth;let e=this._width,o=this._minWidth,r=this._width,i=(e-o)/2+o;for(;o+1<e;)this._placeRectsInWH(i,t,!1)?(r=i,e=i):o=i,i=(e-o)/2+o;return r}getHeightForTargetWidth(t){return this._placeRectsInW(t,!1).height}_placeRectsInW(t,e){let o=0,r=this._y,i=0,s=0,a=0,l=0,c=0;e&&(this._rows.length=0,this._rows.push(new Ts(this._x,this._y,this._nodeNodeSpacing)));let g=0;for(let h of this._children)o+h.width+(g>0?this._nodeNodeSpacing:0)>t&&a>0&&(o=0,r+=a+this._nodeNodeSpacing,i=Math.max(i,l),s+=a+this._nodeNodeSpacing,a=0,l=0,e&&(c++,this._rows.push(new Ts(this._x,r,this._nodeNodeSpacing))),g=0),l+=h.width+(g>0?this._nodeNodeSpacing:0),a=Math.max(a,h.height),e&&this._rows[c].addRectangle(h),o+=h.width+(g>0?this._nodeNodeSpacing:0),g++;return i=Math.max(i,l),s+=a,e&&(this._width=i,this._height=s,this._parentRow.notifyAboutNodeChange()),new dt(this._x,this._y,i,s)}_placeRectsInWH(t,e,o){let r=this._placeRectsInW(t,o);return r.width<=t&&r.height<=e}placeRectsIn(t,e){if(e===void 0){let o=this._width,r=this._height,i=this._placeRectsInW(t,!0);return i.width!==o||i.height!==r}return this._placeRectsInWH(t,e,!0)}_adjustSizeAfterRemove(){let t=0,e=0,o=[],r=0;for(let i of this._rows)i.getNodes().length!==0&&(o.push(i),t=Math.max(t,i.getWidth()),e+=i.getHeight()+(r>0?this._nodeNodeSpacing:0),r++);this._rows=o,this._height=e,this._width=t,this._minWidth=0,this._minHeight=0,this._maxHeight=0,this._smallestRectHeight=Number.POSITIVE_INFINITY,this._smallestRectWidth=Number.POSITIVE_INFINITY;for(let i of this._children)this._smallestRectWidth=Math.min(this._smallestRectWidth,i.width),this._minWidth=Math.max(this._minWidth,i.width),this._minHeight=Math.max(this._minHeight,i.height),this._smallestRectHeight=Math.min(this._smallestRectHeight,i.height),this._maxHeight+=i.height+this._nodeNodeSpacing;this._children.length>0&&(this._averageHeight=this._maxHeight/this._children.length-this._nodeNodeSpacing*((this._children.length-1)/this._children.length)),this._parentRow.notifyAboutNodeChange()}expand(t,e){let o=this._width+t;this._width+=t,this._height+=e;let r=e/this._rows.length,i=0;for(let s of this._rows)s.expand(o,r,i),i++}getWidth(){return this._width}setWidth(t){this._width=t}getHeight(){return this._height}setHeight(t){this._height=t}getChildren(){return this._children}getX(){return this._x}getY(){return this._y}getParentRow(){return this._parentRow}setParentRow(t){this._parentRow=t}getMinWidth(){return this._minWidth}getMinHeight(){return this._minHeight}getMaxHeight(){return this._maxHeight}getSmallestRectHeight(){return this._smallestRectHeight}getSmallestRectWidth(){return this._smallestRectWidth}setSmallestRectWidth(t){this._smallestRectWidth=t}getAverageHeight(){return this._averageHeight}isFixed(){return this._fixed}setFixed(t){this._fixed=t}isPositionFixed(){return this._positionFixed}setPositionFixed(t){this._positionFixed=t}getRows(){return this._rows}getLastRow(){return this._rows[this._rows.length-1]}getLastRowNewX(){let t=this.getLastRow();return t.getX()+t.getWidth()}getLastRowY(){return this.getLastRow().getY()}getStack(){return this._stack}setStack(t){this._stack=t}resetBlock(){this._adjustSizeAfterRemove()}};var xi=class{constructor(t,e,o){this._blocks=[],this._x=t,this._y=e,this._width=0,this._height=0,this._nodeNodeSpacing=o}addBlock(t){t.setStack(this),this._width=Math.max(this._width,t.getWidth()),this._height+=t.getHeight()+(this._blocks.length===0?0:this._nodeNodeSpacing),this._blocks.push(t)}updateDimension(){let t=0,e=0,o=0;for(let r of this._blocks)e=Math.max(e,r.getWidth()),t+=r.getHeight()+(o>0?this._nodeNodeSpacing:0),o++;this._height=t,this._width=e}setLocation(t,e){let o=t-this._x,r=e-this._y;for(let i of this._blocks)i.setLocation(i.getX()+o,i.getY()+r);this._x=t,this._y=e}getWidthForFixedHeight(t){if(this._blocks.length===1)return this._blocks[0].getWidthForTargetHeight(t);let e=this._getMinimumWidth(),o=0,r=this._width,i=e,s=this._width,a=(r-i)/2+i;for(;i+1<r;){o=0;for(let l of this._blocks)o+=l.getHeightForTargetWidth(a);o<t?(s=a,r=a):i=a,a=(r-i)/2+i}return s}placeRectsIn(t){let e=this._y,o=0,r=0;for(let i of this._blocks)i.setLocation(this._x,e),i.placeRectsIn(t),r=Math.max(r,i.getWidth()),e+=i.getHeight()+this._nodeNodeSpacing,o=e;this._width=r,this._height=o}expand(t,e){let o=e/this._blocks.length,r=0;for(let i of this._blocks)i.setLocation(i.getX(),i.getY()+r*o),i.expand(this.getWidth()-i.getWidth()+t,o),r++}_getMinimumWidth(){let t=0;for(let e of this._blocks)t=Math.max(t,e.getMinWidth());return t}getBlocks(){return this._blocks}getX(){return this._x}getY(){return this._y}getWidth(){return this._width}setWidth(t){this._width=t}getHeight(){return this._height}setHeight(t){this._height=t}};var Wa=class{constructor(t,e){this._height=0,this._width=0,this._y=t,this._nodeNodeSpacing=e,this._children=[],this._stacks=[],this._potentialAdditionalWidthToGetLastBlock=0}notifyAboutNodeChange(){let t=0,e=Number.NEGATIVE_INFINITY,o=0;for(let r of this._children)t+=r.getWidth()+(o>0?this._nodeNodeSpacing:0),e=Math.max(e,r.getHeight()),o++;this._width=t,this._height=e}expand(t,e){let r=(t-this._width)/this._stacks.length,i=0;for(let s of this._stacks){let a=this.getHeight()-s.getHeight()+e;s.setLocation(s.getX()+i*r,s.getY()),s.expand(r,a),i++}}calculateBlockStacks(){let t=-1;for(let e of this._children)if(e.getX()!==t){let o=new xi(e.getX(),this._y,this._nodeNodeSpacing);this._stacks.push(o),o.addBlock(e),t=e.getX()}else this._stacks[this._stacks.length-1].addBlock(e)}getFirstBlock(){return this._children[0]}getLastBlock(){return this._children[this._children.length-1]}getNumberOfAssignedBlocks(){return this._children.length}addBlock(t){this._height=Math.max(this._height,t.getHeight()),this._width+=t.getWidth()+(this._children.length===0?0:this._nodeNodeSpacing),this._children.push(t)}removeBlock(t){let e=this._children.indexOf(t);e>=0&&this._children.splice(e,1),this._width-=t.getWidth()+(this._children.length===0?0:this._nodeNodeSpacing);let o=Number.MIN_VALUE;for(let r of this._children)o=Math.max(o,r.getHeight());this._height=o}getHeight(){return this._height}setHeight(t){this._height=t}getWidth(){return this._width}setWidth(t){this._width=t}getY(){return this._y}setY(t){let e=t-this._y;for(let o of this._stacks)o.setLocation(o.getX(),o.getY()+e);this._y=t}getChildren(){return this._children}getStacks(){return this._stacks}getPotentialAdditionalWidthToGetLastBlock(){return this._potentialAdditionalWidthToGetLastBlock}setPotentialAdditionalWidthToGetLastBlock(t){this._potentialAdditionalWidthToGetLastBlock=t}resetStacks(){this._stacks=[]}};var Di=class n{static place(t,e,o){let r=[],i=new Wa(0,o),s=0;i.addBlock(new cn(0,0,i,o));let a=0;for(let l of t){let c=i.getLastBlock();if((a+l.width+(i.getChildren()[0].getChildren().length===0?0:o)>e||l.getProperty(gn))&&(a=0,s+=i.getHeight()+o,r.push(i),i=new Wa(s,o),c=new cn(0,i.getY(),i,o),i.addBlock(c),a=0),c.getChildren().length===0||!l.parent.getProperty(Zc)&&n.isSimilarHeight(c,l,o))c.addChild(l);else{let h=new cn(c.getX()+c.getWidth()+o,i.getY(),i,o);i.addBlock(h),h.addChild(l)}a=l.x+l.width}return r.push(i),r}static placeRectInBlock(t,e,o,r,i){if(n.isSimilarHeight(e,o,i)){if(e.getLastRowNewX()+o.width+i<=r&&(e.getLastRowY()-t.getY()+o.height<=t.getHeight()||t.getChildren().length===1))return e.addChild(o),!0;if(e.getX()+o.width<=r&&e.getY()+e.getHeight()+o.height+i<=t.getY()+t.getHeight())return e.addChildInNewRow(o),!0}return!1}static isSimilarHeight(t,e,o){return e.height>=t.getSmallestRectHeight()&&e.height<=t.getMinHeight()?!0:t.getAverageHeight()*.5<=e.height&&t.getAverageHeight()*1.5>=e.height}};var jc=class n{static compact(t,e,o,r,i){let s=!1,a=!1,l=t+1,c=e[t],g=c.getChildren(),h=null;for(let d=0;d<c.getNumberOfAssignedBlocks();d++){let f=g[d];if(f.isFixed())continue;if(f.getChildren().length===0){c.removeBlock(f),d--,s=!0;continue}if(!f.isPositionFixed()){h!=null&&h.updateDimension();let S=h==null?0:h.getX()+h.getWidth()+r;h=new xi(S,c.getY(),r),f.setLocation(h.getX()+h.getWidth(),c.getY()),c.getStacks().push(h),h.addBlock(f),f.setPositionFixed(!0)}let E=n._getNextBlock(e,c,d,l),P=!1;if(E!=null&&(P=E.getParentRow()!==c),E!=null){if(E.getChildren().length>0&&!E.getChildren()[0].getProperty(gn))n._useRowWidth(f,o),n._absorbBlocks(c,f,E,o,r)&&(s=!0);else{c.removeBlock(E);break}if(E.getChildren().length===0)for(e.length>l&&e[l].removeBlock(E),E=null;e.length>l&&e[l].getChildren().length===0;)e.splice(l,1);if(E==null){d--;continue}if(!E.getChildren()[0].getProperty(gn)&&n._placeBelow(e,c,f,E,P,o,l,r)){s=!0;continue}if(P){let S=c.getHeight(),T=E.getMinHeight();if(!E.getChildren()[0].getProperty(gn)&&n._placeBeside(e,c,f,E,P,o,l,r,i)){if(s=!0,S<T){a=!0,E.setParentRow(c);break}continue}if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0;continue}}else if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0;continue}if(s)continue}if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0,E!=null&&E.setPositionFixed(!1);continue}else f.getStack().updateDimension()}return Gt.of(s,a)}static _getNextBlock(t,e,o,r){return o<e.getNumberOfAssignedBlocks()-1?e.getChildren()[o+1]:r<t.length&&t[r].getChildren().length>0?t[r].getChildren()[0]:null}static _useRowHeight(t,e){let o=!1,r=e.getStack().getWidth();if(e.getHeight()<t.getHeight()){let i=e.getStack().getWidthForFixedHeight(t.getHeight());e.getStack().getWidth()>i&&(e.getStack().placeRectsIn(i),o=r!==e.getStack().getWidth())}return o}static _useRowWidth(t,e){t.placeRectsIn(e-t.getX()),t.getStack().updateDimension()}static _absorbBlocks(t,e,o,r,i){let s=!1,a=o.getChildren()[0];for(;Di.placeRectInBlock(t,e,a,r,i)&&(s=!0,o.removeChild(a),o.getChildren().length!==0);)a=o.getChildren()[0];return o.getChildren().length===0&&o.getParentRow().removeBlock(o),s&&e.getStack().updateDimension(),s}static _placeBelow(t,e,o,r,i,s,a,l){let c=!1,g=s-o.getX(),h=o.getY()-e.getY()+o.getHeightForTargetWidth(g);if(r.getMinWidth()+l>g)return!1;let d=r.getHeightForTargetWidth(g);return h+l+d<=e.getHeight()&&(o.placeRectsIn(s-o.getX()),o.setFixed(!0),r.placeRectsIn(s-o.getX()),r.setLocation(o.getX(),o.getY()+o.getHeight()+l),r.setPositionFixed(!0),o.getStack().addBlock(r),c=!0,i&&(e.addBlock(r),r.setParentRow(e),t.length>a&&(t[a].removeBlock(r),t[a].getChildren().length===0&&t.splice(a,1)))),c}static _placeBeside(t,e,o,r,i,s,a,l,c){let g=!1,h=o.getStack().getWidthForFixedHeight(e.getY()+e.getHeight()-o.getStack().getY()),d=r.getMinHeight()>e.getHeight()&&c,f=s-(o.getStack().getX()+h-l),E=r.getHeightForTargetWidth(f);if(d&&E>r.getMinHeight())return!1;if(d){let S=0;for(let T of e.getStacks())S+=T.getWidthForFixedHeight(r.getMinHeight())+l;f=s-S}if(f<r.getMinWidth())return!1;let P=a===t.length-1&&f>=t[a].getWidth();return!d&&E>e.getHeight()&&!P?!1:((P||d||E<=e.getHeight())&&(P&&E>e.getHeight()?(o.setHeight(E),o.placeRectsIn(o.getWidthForTargetHeight(E))):(o.getStack().placeRectsIn(h),o.setFixed(!0)),r.placeRectsIn(s-(o.getX()+o.getWidth())),r.setLocation(o.getStack().getX()+o.getStack().getWidth(),e.getY()),e.addBlock(r),t.length>a&&(t[a].removeBlock(r),t[a].getChildren().length===0&&t.splice(a,1)),g=!0),g)}};var za=class{constructor(t,e){this._aspectRatio=t,this._nodeNodeSpacing=e,this.potentialRowWidthDecreaseMin=Number.POSITIVE_INFINITY,this.potentialRowWidthDecreaseMax=0,this.potentialRowWidthIncreaseMin=Number.POSITIVE_INFINITY,this.potentialRowWidthIncreaseMax=0}start(t,e,o,r){let i=o.getProperty($.TARGET_WIDTH),s=o.getProperty($.MIN_WIDTH),a=o.getProperty($.MIN_HEIGHT);Be.resetCoordinates(o.children);let l=Di.place(o.children,i,this._nodeNodeSpacing);for(let f=0;f<l.length;f++){let E=l[f];if(f!==0){let S=l[f-1];E.setY(S.getY()+S.getHeight()+this._nodeNodeSpacing)}if(jc.compact(f,l,i,this._nodeNodeSpacing,o.getProperty(Zc)).getSecond()){for(let S of E.getChildren())S.setFixed(!1),S.setPositionFixed(!1),S.resetBlock();E.resetStacks(),E.setWidth(i),f--}else{if(this._adjustWidthAndHeight(E),f+1<l.length){let S=l[f+1].getFirstBlock(),T=E.getWidth()+this._nodeNodeSpacing+S.getWidth()-i;if(this.potentialRowWidthIncreaseMax=Math.max(T,this.potentialRowWidthDecreaseMax),this.potentialRowWidthIncreaseMin=Math.min(T,this.potentialRowWidthDecreaseMin),E.getStacks().length!==0){let N=E.getStacks()[E.getStacks().length-1],I=E.getStacks().length<=1?0:this._nodeNodeSpacing;this.potentialRowWidthDecreaseMax=Math.max(this.potentialRowWidthDecreaseMax,N.getWidth()+I),this.potentialRowWidthDecreaseMin=Math.min(this.potentialRowWidthDecreaseMax,N.getWidth()+I)}}if(l.length===1){let S=E.getStacks()[E.getStacks().length-1],T=S.getBlocks()[S.getBlocks().length-1];for(let N of T.getRows())this.potentialRowWidthDecreaseMax=Math.max(this.potentialRowWidthDecreaseMax,T.getWidth()-N.getWidth()),this.potentialRowWidthDecreaseMin=Math.min(this.potentialRowWidthDecreaseMin,T.getWidth()-N.getWidth()),this.potentialRowWidthIncreaseMax=Math.max(this.potentialRowWidthIncreaseMax,N.getWidth()+this._nodeNodeSpacing),this.potentialRowWidthIncreaseMin=Math.min(this.potentialRowWidthIncreaseMin,N.getWidth()+this._nodeNodeSpacing)}}}let c=Be.calculateDimensions(l,this._nodeNodeSpacing),g=Math.max(c.x,s-r.getHorizontal()),d=Math.max(c.y,a-r.getVertical())-c.y;return o.setProperty($.ADDITIONAL_HEIGHT,d),o.setProperty($.ROWS,l),new Ss(this._aspectRatio,g,c.y+d,Ot.WHOLE_DRAWING)}_adjustWidthAndHeight(t){let e=0,o=0,r=0;for(let i of t.getStacks())i.updateDimension(),e=Math.max(e,i.getHeight()),o+=i.getWidth()+(r>0?this._nodeNodeSpacing:0),r++;t.setHeight(e),t.setWidth(o)}};var _r=new m("org.eclipse.elk.padding",new yt(15)),Cr=new m("org.eclipse.elk.spacing.nodeNode",15,0),Ns=new m("org.eclipse.elk.aspectRatio",1.3),BE=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1);var $c=class{process(t,e){e.begin("Compaction",1);let o=t.children,r=t.getProperty(Ns),i=t.getProperty(Cr),s=t.getProperty(_r),a=new za(r,i),l=a.start(o,e,t,s);this._copyRowWidthChangeValues(t,a);let c=t.getProperty(UE);for(;c>1;){let g=this._clone(t),h=l.getScaleMeasure();this._configureSecondIteration(t,g,l),a=new za(r,i);let d=a.start(o,e,g,s),f=d.getScaleMeasure();if(f>=h&&Number.isFinite(f)){for(let E=0;E<g.children.length;E++)this._copyPosition(g.children[E],t.children[E]);this._copyRowWidthChangeValues(t,a),l.setDrawingWidth(d.getDrawingWidth()),l.setDrawingHeight(d.getDrawingHeight())}c--}t.setProperty($.DRAWING_HEIGHT,l.getDrawingHeight()),t.setProperty($.DRAWING_WIDTH,l.getDrawingWidth()),e.done()}_copyRowWidthChangeValues(t,e){t.setProperty($.MIN_ROW_INCREASE,e.potentialRowWidthIncreaseMin),t.setProperty($.MAX_ROW_INCREASE,e.potentialRowWidthIncreaseMax),t.setProperty($.MIN_ROW_DECREASE,e.potentialRowWidthDecreaseMin),t.setProperty($.MAX_ROW_DECREASE,e.potentialRowWidthDecreaseMax)}_configureSecondIteration(t,e,o){let r=t.getProperty(_r),i=t.getProperty(Ns);t.children.length>1&&t.getProperty($.MIN_ROW_INCREASE)!==Number.POSITIVE_INFINITY&&(o.getDrawingWidth()+r.getHorizontal())/(o.getDrawingHeight()+r.getVertical())<i?e.setProperty($.TARGET_WIDTH,t.getProperty($.TARGET_WIDTH)+t.getProperty($.MIN_ROW_INCREASE)):t.children.length>1&&t.getProperty($.MIN_ROW_DECREASE)!==Number.POSITIVE_INFINITY&&(o.getDrawingWidth()+r.getHorizontal())/(o.getDrawingHeight()+r.getVertical())>i&&e.setProperty($.TARGET_WIDTH,Math.max(t.getProperty($.MIN_WIDTH),e.getProperty($.TARGET_WIDTH)-t.getProperty($.MIN_ROW_DECREASE)))}_clone(t){let e=Oa();typeof t.copyProperties=="function"&&e.copyProperties(t);for(let o of t.children){let r=Fs(e);r.width=o.width,r.height=o.height,r.identifier=o.identifier,r.x=o.x,r.y=o.y,typeof r.copyProperties=="function"&&r.copyProperties(o)}return e}_copyPosition(t,e){e.width=t.width,e.height=t.height,e.x=t.x,e.y=t.y;for(let o=0;o<t.children.length;o++)this._copyPosition(t.children[o],e.children[o])}getLayoutProcessorConfiguration(){return null}};var qc=class{process(t,e){e.begin("Simple Placement",1);let o=t.getProperty($.TARGET_WIDTH),r=t.getProperty(Cr),i=t.getProperty(_r);Be.resetCoordinates(t.children);let s=Di.place(t.children,o,r),a,l=t.children;if(s==null)a=Be.calculateDimensionsOfRectangles(l);else{for(let d of s)for(let f of d.getChildren()){let E=new xi(f.getX(),f.getY(),r);E.addBlock(f),d.getStacks().push(E)}a=Be.calculateDimensions(s,r)}let c=Math.max(a.x,t.getProperty($.MIN_WIDTH)-i.getHorizontal()),g=Math.max(a.y,t.getProperty($.MIN_HEIGHT)-i.getVertical()),h=g-a.y;t.setProperty($.ADDITIONAL_HEIGHT,h),t.setProperty($.DRAWING_WIDTH,c),t.setProperty($.DRAWING_HEIGHT,g+h),t.setProperty($.ROWS,s),e.done()}getLayoutProcessorConfiguration(){return null}};var Jc=class{process(t,e){e.begin("No Compaction",1);let o=t.getProperty(_r),r=t.children,i=Be.calculateDimensionsOfRectangles(r),s=Math.max(i.x,t.getProperty($.MIN_WIDTH)-o.getHorizontal()),a=Math.max(i.y,t.getProperty($.MIN_HEIGHT)-o.getVertical()),l=a-i.y;t.setProperty($.ADDITIONAL_HEIGHT,l),t.setProperty($.DRAWING_WIDTH,s),t.setProperty($.DRAWING_HEIGHT,a+l),e.done()}getLayoutProcessorConfiguration(){return null}};var xr=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.COMPACTION:return new $c;case n.SIMPLE:return new qc;case n.NONE:return new Jc;default:return null}}};xr.COMPACTION=new xr("COMPACTION",0);xr.SIMPLE=new xr("SIMPLE",1);xr.NONE=new xr("NONE",2);var Qc=class{static expand(t,e,o,r){let i=o/t.length,s=0;for(let a of t)a.setY(a.getY()+i*s),a.expand(e,i),s++}};var hn=class{process(t,e){if(e.begin("Equal Whitespace Eliminator",1),t.hasProperty($.ROWS))Qc.expand(t.getProperty($.ROWS),t.getProperty($.DRAWING_WIDTH),t.getProperty($.ADDITIONAL_HEIGHT),t.getProperty(Cr));else throw new Error("The graph does not contain rows.");e.done()}getLayoutProcessorConfiguration(){return null}};var tg=class extends hn{process(t,e){e.begin("To Aspect Ratio Whitespace Eliminator",1);let o=t.getProperty($.DRAWING_WIDTH),r=t.getProperty($.DRAWING_HEIGHT),i=t.getProperty(Ns),s=t.getProperty($.ADDITIONAL_HEIGHT);o/r<i?(o=r*i,t.setProperty($.DRAWING_WIDTH,o)):(s+=o/i-r,t.setProperty($.ADDITIONAL_HEIGHT,s),t.setProperty($.DRAWING_HEIGHT,r+s)),super.process(t,e),e.done()}};var Dr=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.EQUAL_BETWEEN_STRUCTURES:return new hn;case n.TO_ASPECT_RATIO:return new tg;case n.NONE:default:return null}}};Dr.EQUAL_BETWEEN_STRUCTURES=new Dr("EQUAL_BETWEEN_STRUCTURES",0);Dr.TO_ASPECT_RATIO=new Dr("TO_ASPECT_RATIO",1);Dr.NONE=new Dr("NONE",2);var pr=class n{static getWidthLPRorLPB(t,e,o){return Math.max(t,e+o)}static getHeightLPRorLPB(t,e,o){return Math.max(t,e+o)}static calculateYforLPR(t,e,o,r){let i=null,s=0;for(let a of e)if(n._verticalOrderConstraint(a,t,r)){if(i==null)i=a;else{let l=a.y+a.height;o.y-l<o.y-s&&(i=a)}s=i.y+i.height}return i==null?0:s+r}static calculateXforLPB(t,e,o,r){let i=null,s=0;for(let a of e)if(n._horizontalOrderConstraint(a,t,r)){if(i==null)i=a;else{let l=a.x+a.width;o.x-l<o.x-s&&(i=a)}s=i.x+i.width}return i==null?0:s+r}static calculateAreaLPR(t,e,o){let r=t.y+t.height,i=o.getNextYcoordinate()+e.height,a=Math.max(r,i)-Math.min(t.y,o.getNextYcoordinate());return(o.getNextXcoordinate()+e.width-t.x)*a}static calculateAreaLPB(t,e,o){let r=t.x+t.width,i=o.getNextXcoordinate()+e.width,a=Math.max(r,i)-Math.min(t.x,o.getNextXcoordinate()),l=o.getNextYcoordinate()+e.height-t.y;return a*l}static _verticalOrderConstraint(t,e,o){return e<t.x+t.width+o}static _horizontalOrderConstraint(t,e,o){return e<t.y+t.height+o}};var dn=class{filterList(t,e,o){let r=Number.NEGATIVE_INFINITY;for(let s of t){let a=Be.computeScaleMeasure(s.getDrawingWidth()+o.getHorizontal(),s.getDrawingHeight()+o.getVertical(),s.getDesiredAspectRatio());a>r&&(r=a)}let i=[];for(let s of t)Be.computeScaleMeasure(s.getDrawingWidth()+o.getHorizontal(),s.getDrawingHeight()+o.getVertical(),s.getDesiredAspectRatio())===r&&i.push(s);return i}};var fn=class{filterList(t,e,o){let r=Number.POSITIVE_INFINITY;for(let s of t){let a=(s.getDrawingWidth()+o.getHorizontal())*(s.getDrawingHeight()+o.getVertical());a<r&&(r=a)}let i=[];for(let s of t)(s.getDrawingWidth()+o.getHorizontal())*(s.getDrawingHeight()+o.getVertical())===r&&i.push(s);return i}};var un=class{filterList(t,e,o){let r=Number.POSITIVE_INFINITY;for(let s of t){let a=Math.abs((s.getDrawingWidth()+o.getHorizontal())/(s.getDrawingHeight()+o.getVertical())-e);a<r&&(r=a)}let i=[];for(let s of t)Math.abs((s.getDrawingWidth()+o.getHorizontal())/(s.getDrawingHeight()+o.getVertical())-e)===r&&i.push(s);return i}};var eg=class{constructor(t,e,o){this._aspectRatio=t,this._goal=e,this._lpShift=o}approxBoundingBox(t,e,o){let r=t[0];r.x=0,r.y=0;let i=[r],s=r,a=new Ss(this._aspectRatio,r.width,r.height,Ot.WHOLE_DRAWING);for(let l=1;l<t.length;l++){let c=t[l],g=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT,c,s,a,i,e),h=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW,c,s,a,i,e),d=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,c,s,a,i,e),f=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,c,s,a,i,e),E=this._findBestCandidate(g,h,d,f,c,s,o);c.x=E.getNextXcoordinate(),c.y=E.getNextYcoordinate(),E.setPlacementOption(Ot.WHOLE_DRAWING),a=E,s=c,i.push(c)}return a}_findBestCandidate(t,e,o,r,i,s,a){let l=[t,e,o,r],c;switch(this._goal){case Lo.MAX_SCALE_DRIVEN:c=[new dn,new fn,new un];break;case Lo.ASPECT_RATIO_DRIVEN:c=[new un,new fn,new dn];break;case Lo.AREA_DRIVEN:c=[new fn,new dn,new un];break;default:c=[]}for(let g of c)l.length>1&&(l=g.filterList(l,this._aspectRatio,a));return l.length===1?l[0]:l.length===2?this._checkSpecialCases(l[0],l[1],s,i):null}_checkSpecialCases(t,e,o,r){let i=t.getPlacementOption(),s=e.getPlacementOption(),a=i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW||i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,l=s===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW||s===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,c=i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,g=s===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||s===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,h=i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW,d=s===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||s===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW;if(a&&l)return i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW?t:e;if(c&&g)return i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT?t:e;if(h&&d){let f,E;i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT?(f=t,E=e):(f=e,E=t);let P=pr.calculateAreaLPR(o,r,f),S=pr.calculateAreaLPB(o,r,E);return P<=S?i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT?t:e:i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW?t:e}return t}_calcValuesForOpt(t,e,o,r,i,s){let a=0,l=0,c=r.getDrawingWidth(),g=r.getDrawingHeight(),h=e.height,d=e.width,f,E;switch(t){case Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT:a=o.x+o.width+s,this._lpShift?l=pr.calculateYforLPR(a,i,o,s):l=o.y,f=pr.getWidthLPRorLPB(c,a,d),E=pr.getHeightLPRorLPB(g,l,h);break;case Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW:l=o.y+o.height+s,this._lpShift?a=pr.calculateXforLPB(l,i,o,s):a=o.x,f=pr.getWidthLPRorLPB(c,a,d),E=pr.getHeightLPRorLPB(g,l,h);break;case Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT:a=c+s,l=0,f=c+s+d,E=Math.max(g,h);break;case Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW:a=0,l=g+s,f=Math.max(c,d),E=g+s+h;break;default:throw new Error("IllegalPlacementOption")}return new Ss(this._aspectRatio,f,E,t,a,l)}};var og=class{process(t,e){e.begin("Greedy Width Approximator",1);let o=t.getProperty(Ns),r=t.getProperty(_r),i=t.getProperty(FE),s=t.getProperty(kE),a=t.getProperty(Cr),l=t.children;Be.resetCoordinates(l);let g=new eg(o,i,s).approxBoundingBox(l,a,r);t.setProperty($.TARGET_WIDTH,g.getDrawingWidth()),e.done()}getLayoutProcessorConfiguration(){return null}};var rg=class{process(t,e){if(e.begin("Target Width Setter",1),t.hasProperty(Vu))t.setProperty($.TARGET_WIDTH,t.getProperty(Vu));else throw new Error("A target width has to be set if the TargetWidthWidthApproximator should be used.");e.done()}getLayoutProcessorConfiguration(){return null}};var Mi=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.GREEDY:return new og;case n.TARGET_WIDTH:return new rg;default:throw new Error(`WidthApproximationStrategy.${this}: no implementation available.`)}}};Mi.GREEDY=new Mi("GREEDY",0);Mi.TARGET_WIDTH=new Mi("TARGET_WIDTH",1);var WE=new m("org.eclipse.elk.rectpacking.widthApproximation.strategy",()=>Mi.GREEDY),Vu=new m("org.eclipse.elk.rectpacking.widthApproximation.targetWidth",-1),FE=new m("org.eclipse.elk.rectpacking.widthApproximation.optimizationGoal",()=>Lo.MAX_SCALE_DRIVEN),kE=new m("org.eclipse.elk.rectpacking.widthApproximation.lastPlaceShift",!0),zE=new m("org.eclipse.elk.rectpacking.packing.strategy",()=>xr.COMPACTION),Zc=new m("org.eclipse.elk.rectpacking.packing.compaction.rowHeightReevaluation",!1),UE=new m("org.eclipse.elk.rectpacking.packing.compaction.iterations",1,1),YE=new m("org.eclipse.elk.rectpacking.whiteSpaceElimination.strategy",()=>Dr.NONE),VE=new m("org.eclipse.elk.rectpacking.trybox",!1),XE=new m("org.eclipse.elk.rectpacking.currentPosition",-1,-1),Ya=new m("org.eclipse.elk.rectpacking.desiredPosition",-1,-1),gn=new m("org.eclipse.elk.rectpacking.inNewRow",!1),KE=new m("org.eclipse.elk.rectpacking.orderBySize",!1);var ig=class{static compare(t,e){return e.height-t.height}};var sg=class{process(t,e){e.begin("Node Size Reorderer",1),t.children.sort(ig.compare),e.done()}};var ng=class{process(t,e){e.begin("Interactive Node Reorderer",1);let o=t.children,r=[];for(let s of o)s.hasProperty(Ya)&&r.push(s);for(let s of r){let a=o.indexOf(s);a>=0&&o.splice(a,1)}r.sort((s,a)=>{let l=s.getProperty(Ya),c=a.getProperty(Ya);return l===c?-1:l-c});for(let s of r){let a=s.getProperty(Ya);a=Math.min(a,o.length),o.splice(a,0,s)}let i=0;for(let s of o)s.setProperty(XE,i),i++;e.done()}};var ag=class{process(t,e){e.begin("Min Size Preprocessing",1);let o=ya(t);t.setProperty($.MIN_WIDTH,o.x),t.setProperty($.MIN_HEIGHT,o.y),e.done()}};var lg=class{process(t,e){e.begin("Min Size Postprocessing",1),t.setProperty($.TARGET_WIDTH,Math.max(t.getProperty($.TARGET_WIDTH),t.getProperty($.MIN_WIDTH))),e.done()}};var xe=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NODE_SIZE_REORDERER:return new sg;case n.INTERACTIVE_NODE_REORDERER:return new ng;case n.MIN_SIZE_PRE_PROCESSOR:return new ag;case n.MIN_SIZE_POST_PROCESSOR:return new lg;default:throw new Error(`IntermediateProcessorStrategy.${this}: no implementation available.`)}}};xe.NODE_SIZE_REORDERER=new xe("NODE_SIZE_REORDERER",0);xe.INTERACTIVE_NODE_REORDERER=new xe("INTERACTIVE_NODE_REORDERER",1);xe.MIN_SIZE_PRE_PROCESSOR=new xe("MIN_SIZE_PRE_PROCESSOR",2);xe.MIN_SIZE_POST_PROCESSOR=new xe("MIN_SIZE_POST_PROCESSOR",3);xe.VALUES=[xe.NODE_SIZE_REORDERER,xe.INTERACTIVE_NODE_REORDERER,xe.MIN_SIZE_PRE_PROCESSOR,xe.MIN_SIZE_POST_PROCESSOR];var cg=class n extends de{constructor(){super(),this._algorithmAssembler=Io.create(Le.VALUES)}layout(t,e){e.begin("Rectangle Packing",1);let o=t.getProperty(_r),r=t.getProperty(BE),i=t.getProperty(Cr),s=t.getProperty(VE),a=t.children;t.getProperty(So)||Go.forGraph(t).execute();let l=!1;if(s&&a.length>=3){let d=a[0],f=a[1],E=0;for(;E+2<a.length;){let P=d;if(d=f,f=a[E+2],P.height>=d.height+f.height+i||f.height>=P.height+d.height+i){l=!0;break}E++}}else l=!0;if(!l){let d=a.length;for(let f of a)f.setProperty(mu,d),d--;new rs().layout(t,new Ie),e.done();return}let c=this._assembleAlgorithm(t);for(let d of c){if(typeof e.isCanceled=="function"&&e.isCanceled())return;let f=typeof e.subTask=="function"?e.subTask(1/c.length):e;d.process(t,f)}let g=0,h=0;for(let d of a)g=Math.max(g,d.x+d.width),h=Math.max(h,d.y+d.height);Vs(t,new O(t.getProperty($.DRAWING_WIDTH),t.getProperty($.DRAWING_HEIGHT)),new O(g,h)),n._applyPadding(a,o),r||Ae(t,t.getProperty($.DRAWING_WIDTH)+o.getHorizontal(),t.getProperty($.DRAWING_HEIGHT)+o.getVertical(),!1,!0),t.getProperty(So)||Go.forGraph(t).execute(),e.done()}static _applyPadding(t,e){for(let o of t)o.setLocation(o.x+e.getLeft(),o.y+e.getTop())}_assembleAlgorithm(t){return this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Le.P1_WIDTH_APPROXIMATION,t.getProperty(WE)),this._algorithmAssembler.setPhase(Le.P2_PACKING,t.getProperty(zE)),this._algorithmAssembler.setPhase(Le.P3_WHITESPACE_ELIMINATION,t.getProperty(YE)),this._algorithmAssembler.addProcessorConfiguration(this._getPhaseIndependentConfig(t)),this._algorithmAssembler.build(t)}_getPhaseIndependentConfig(t){let e=K.create();return e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.MIN_SIZE_PRE_PROCESSOR),e.addBefore(Le.P2_PACKING,xe.MIN_SIZE_POST_PROCESSOR),t.getProperty(KE)&&e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.NODE_SIZE_REORDERER),t.getProperty(zo)&&e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.INTERACTIVE_NODE_REORDERER),e}};var ZE="org.eclipse.elk.rectpacking",jE=!1;function $E(){let n=Ht.getInstance(),t=n.getAlgorithmData(ZE);if(t)return jE=!0,t;let e=new Se.Builder().id(ZE).name("ELK Rectpacking").description("Rectangle packing layout.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.rectpacking").providerFactory(()=>new cg).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),jE=!0,e}var Zo=class{static execute(t,e,o){let r=[...t],i;typeof o=="function"?i=[o]:o!=null&&typeof o.handle=="function"?i=[o]:i=[...o],r.sort(e);for(let s of r)for(let a of i)typeof a=="function"?a(s):a.handle(s)}};var oe=class{};oe.FUZZINESS=1e-4;oe.DEBUG_SVG=new m("debugSVG",!1);oe.OVERLAPS_EXISTED=new m("overlapsExisted",!0);function qE(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var gg=class{constructor(t,e){this.node=t,this.low=e}},Xu=class n{constructor(){this._items=[]}static _compare(t,e){let o=t.rect.x-e.rect.x;return o!==0||(o=t.originalVertex.x-e.originalVertex.x,o!==0)?o:t.originalVertex.y-e.originalVertex.y}add(t){for(let e=0;e<this._items.length;e++){let o=n._compare(this._items[e],t);if(o===0)return!1;if(o>0)return this._items.splice(e,0,t),!0}return this._items.push(t),!0}remove(t){let e=this._items.indexOf(t);return e>=0?(this._items.splice(e,1),!0):!1}clear(){this._items.length=0}[Symbol.iterator](){return this._items[Symbol.iterator]()}},hg=class n{constructor(t,e){this._overlapHandler=t}_applyHandler(t,e){typeof this._overlapHandler=="function"?this._overlapHandler(t,e):this._overlapHandler.handle(t,e)}sweep(t){let e=[];for(let r of t)e.push(new gg(r,!0)),e.push(new gg(r,!1));let o=new Ku(this);o.init(),Zo.execute(e,n._compareTimestamps,o)}static _compareTimestamps(t,e){let o=t.node.rect.y;t.low||(o+=t.node.rect.height);let r=e.node.rect.y;e.low||(r+=e.node.rect.height);let i=o-r;if(i===0){if(!t.low&&e.low)return-1;if(!e.low&&t.low)return 1}return i}},Ku=class{constructor(t){this._owner=t,this._intervalsSortLeft=new Xu}init(){this._intervalsSortLeft.clear()}handle(t){t.low?this._insert(t):this._delete(t)}_insert(t){if(!this._intervalsSortLeft.add(t.node))throw new Error("Invalid hitboxes for scanline overlap calculation.");let o=!1;for(let r of this._intervalsSortLeft)if(this._overlap(t.node,r))this._owner._applyHandler(t.node,r),o=!0;else if(o)break}_delete(t){this._intervalsSortLeft.remove(t.node)}_overlap(t,e){if(t==null||e==null||t===e)return!1;let o=oe.FUZZINESS;return qE(t.rect.x,e.rect.x+e.rect.width,o)<0&&qE(e.rect.x,t.rect.x+t.rect.width,o)<0}};var Ue=class n{constructor(t,e){this.u=t,this.v=e}equals(t){return t instanceof n?dg(this.u,t.u)&&dg(this.v,t.v)||dg(this.u,t.v)&&dg(this.v,t.u):!1}};function dg(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):n.x===t.x&&n.y===t.y}var fg=class{constructor(t){this._spacing=20,this._viewBoxX=Number.POSITIVE_INFINITY,this._viewBoxY=Number.POSITIVE_INFINITY,this._viewBoxW=0,this._viewBoxH=0,this._viewBoxX2=Number.NEGATIVE_INFINITY,this._viewBoxY2=Number.NEGATIVE_INFINITY,this._enableUpdateViewBox=!0,this._current="main",this._groups=new Map,this.fileName=null,this._index=0,this.debug=!1,this.maxArea=8294400,t!=null&&t.length>0&&!t.startsWith("null")&&(this.fileName=t,this.debug=!0),this._groups.set(this._current,"")}g(t){return this.debug&&(this._groups.has(t)||this._groups.set(t,""),this._current=t),this}addGroups(...t){if(this.debug)for(let e of t)this._groups.set(e,"")}clearGroup(t){this.debug&&this._groups.has(t)&&this._groups.set(t,"")}removeGroup(t){this.debug&&(t==="main"?this.clearGroup(t):this._groups.delete(t))}setViewBox(t,e,o,r){this.debug&&(this._viewBoxX=t,this._viewBoxY=e,this._viewBoxW=o,this._viewBoxH=r,this._enableUpdateViewBox=!1)}clear(){this.debug=this.fileName!=null&&this.fileName.length>0,this.debug&&(this._groups.clear(),this._current="main",this._groups.set(this._current,""),this._enableUpdateViewBox&&(this._viewBoxX=Number.POSITIVE_INFINITY,this._viewBoxY=Number.POSITIVE_INFINITY,this._viewBoxW=0,this._viewBoxH=0,this._viewBoxX2=Number.NEGATIVE_INFINITY,this._viewBoxY2=Number.NEGATIVE_INFINITY))}addElementStr(t){if(this.debug){let e=this._groups.get(this._current)||"";this._groups.set(this._current,e+t+`
`),this._current="main"}}addCircle(t,e,o,r){if(this.debug){if(o==null){this.addCircle(t,e,5,'stroke="black" stroke-width="1" fill="none"');return}this.addElementStr(`<circle cx="${t}" cy="${e}" r="${o}" ${r} />`),this._updateViewBox(new O(t-o,e-o),new O(t+o,e+o))}}addLine(t,e,o,r,i){if(this.debug){if(i==null){this.addLine(t,e,o,r,'stroke="black" stroke-width="1"');return}this.addElementStr(`<line x1="${t}" y1="${e}" x2="${o}" y2="${r}" ${i} />`),this._updateViewBox(new O(t,e),new O(o,r))}}addRect(t,e,o,r,i){if(!this.debug)return;if(typeof t=="object"&&t!=null){let l=t,c=e;this.addRect(l.x,l.y,l.width,l.height,c);return}let s=t,a=e;this.addElementStr(`<rect x="${s}" y="${a}" width="${o}" height="${r}" ${i} />`),this._updateViewBox(new O(s,a),new O(s+o,a+r))}addPoly(t,...e){if(!this.debug)return;let o='<polyline points="';for(let r of e)o+=`${r.x},${r.y} `;this.addElementStr(o+`" ${t} />`),this._updateViewBox(...e)}addText(t,e,o,r){this.debug&&this.addElementStr(`<text x="${t}" y="${e}" ${r}>${o}</text>`)}_updateViewBox(...t){if(this.debug&&this._enableUpdateViewBox){for(let e of t)Number.isFinite(e.x)&&Number.isFinite(e.y)&&(this._viewBoxX=Math.min(this._viewBoxX,e.x),this._viewBoxY=Math.min(this._viewBoxY,e.y),this._viewBoxX2=Math.max(this._viewBoxX2,e.x),this._viewBoxY2=Math.max(this._viewBoxY2,e.y));this._viewBoxW=this._viewBoxX2-this._viewBoxX,this._viewBoxH=this._viewBoxY2-this._viewBoxY}}getSVG(){if(!this.debug)return"";let t=this._viewBoxH*this._viewBoxW,e=1;t>this.maxArea&&(e=Math.sqrt(this.maxArea/t));let o=[];o.push('<?xml version="1.0" encoding="UTF-8"?>'),o.push(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="${this._viewBoxX*e-this._spacing} ${this._viewBoxY*e-this._spacing} ${this._viewBoxW*e+2*this._spacing} ${this._viewBoxH*e+2*this._spacing}">`);for(let[r,i]of this._groups.entries())o.push(`<g transform="scale(${e})" id="${r}">
${i}</g>`);return o.push("</svg>"),o.join(`
-`)}save(t){}isave(t){this._index++}};function ug(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var _g=class n{static compact(t,e,o=null){let r={root:t,orthogonal:e};n._compactTree(t,r)}static _compactTree(t,e){for(let o of t.children)n._compactTree(o,e);for(let o of t.children){let r=t.node.vertex.clone().sub(o.node.vertex);if(e.orthogonal){let s=t.node.rect,a=o.node.rect;Math.abs(r.x)>=Math.abs(r.y)?(r.y=0,a.y+a.height>s.y&&a.y<s.y+s.height&&r.scaleToLength(Math.max(s.x-(a.x+a.width),a.x-(s.x+s.width)))):(r.x=0,a.x+a.width>s.x&&a.x<s.x+s.width&&r.scaleToLength(Math.max(s.y-(a.y+a.height),a.y-(s.y+s.height))))}else r.scaleToLength(t.node.underlap(o.node));let i=r.length();i=n._getMinUnderlap(e.root,o,i,r),r.scaleToLength(i),n._translateSubtree(o,r)}}static _getMinUnderlap(t,e,o,r){let i=Math.min(o,n._minUnderlapWithSubtree(t.node,e,o,r));for(let s of t.children)s!==e&&(i=Math.min(i,n._getMinUnderlap(s,e,i,r)));return i}static _minUnderlapWithSubtree(t,e,o,r){let i=o,s=ee.FUZZINESS;for(let a of e.children){let l=a.node;if(t.touches(l)){if(ug(l.rect.x,t.rect.x+t.rect.width,s)===0&&r.x<0||ug(l.rect.x+l.rect.width,t.rect.x,s)===0&&r.x>0||ug(l.rect.y,t.rect.y+t.rect.height,s)===0&&r.y<0||ug(l.rect.y+l.rect.height,t.rect.y,s)===0&&r.y>0){i=0;break}}else i=Math.min(i,t.distance(l,r));i=Math.min(i,n._minUnderlapWithSubtree(t,a,i,r))}return i}static _translateSubtree(t,e){t.node.translate(e);for(let o of t.children)n._translateSubtree(o,e)}};var pg=class{process(t,e){e.begin("Shrinking tree compaction",1);let o=t.getProperty(ee.DEBUG_SVG)?"spore/60compaction":null;_g.compact(t.tree,t.orthogonalCompaction,o),e.done()}getLayoutProcessorConfiguration(){return K.create()}};var _n=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.DEPTH_FIRST:return new pg;default:throw new Error(`No implementation for CompactionStrategy.${this}`)}}};_n.DEPTH_FIRST=new _n("DEPTH_FIRST");var Ho=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Ho.FIXED=new Ho("FIXED");Ho.CENTER_NODE=new Ho("CENTER_NODE");var Te=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Te.CENTER_DISTANCE=new Te("CENTER_DISTANCE");Te.CIRCLE_UNDERLAP=new Te("CIRCLE_UNDERLAP");Te.RECTANGLE_UNDERLAP=new Te("RECTANGLE_UNDERLAP");Te.INVERTED_OVERLAP=new Te("INVERTED_OVERLAP");Te.MINIMUM_ROOT_DISTANCE=new Te("MINIMUM_ROOT_DISTANCE");var cT=ee.FUZZINESS;function gT(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var Va=class n{constructor(t,e,o){this.a=t,this.b=e,this.c=o,this.tEdges=[new Ue(t,e),new Ue(e,o),new Ue(o,t)],this.vertices=[t,e,o],this._circumcenter=this._calculateCircumcenter()}getCircumcenter(){return this._circumcenter}_calculateCircumcenter(){let t=this.b.clone().sub(this.a),e=this.c.clone().sub(this.a),o=this.c.clone().sub(this.b),r=t.x*(this.a.x+this.b.x)+t.y*(this.a.y+this.b.y),i=e.x*(this.a.x+this.c.x)+e.y*(this.a.y+this.c.y),s=2*(t.x*o.y-t.y*o.x),a=(e.y*r-t.y*i)/s,l=(t.x*i-e.x*r)/s;return new O(a,l)}inCircumcircle(t){return gT(this._circumcenter.distance(t),this._circumcenter.distance(this.a),cT)<0}equals(t){return t instanceof n?this.containsVertex(t.a)&&this.containsVertex(t.b)&&this.containsVertex(t.c):!1}containsEdge(t){return ju(t,this.tEdges[0])||ju(t,this.tEdges[1])||ju(t,this.tEdges[2])}containsVertex(t){return Zu(t,this.vertices[0])||Zu(t,this.vertices[1])||Zu(t,this.vertices[2])}};function Zu(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):n.x===t.x&&n.y===t.y}function ju(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):!1}var Eg=class{static triangulate(t,e=null){let o=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let S of t)o.x=Math.min(o.x,S.x),o.y=Math.min(o.y,S.y),r.x=Math.max(r.x,S.x),r.y=Math.max(r.y,S.y);let i=new O(r.x-o.x,r.y-o.y),s=50,a=new O(o.x-s,o.y-i.x-s),l=new O(o.x-s,r.y+i.x+s),c=new O(r.x+i.y/2+s,o.y+i.y/2),g=new Va(a,l,c),h=[g],d=[],f=[];for(let S of t){d.length=0;for(let T of h)T.inCircumcircle(S)&&d.push(T);f.length=0;for(let T of d)for(let N of T.tEdges){let I=!0;for(let C of d)C!==T&&C.containsEdge(N)&&(I=!1);I&&f.push(N)}for(let T of d){let N=h.indexOf(T);N>=0&&h.splice(N,1)}for(let T of f)h.push(new Va(S,T.u,T.v))}let E=[];for(let S of h)for(let T of S.tEdges){let N=!1;for(let I of E)if(I.equals(T)){N=!0;break}N||E.push(T)}let P=new Set;for(let S of E)!g.containsVertex(S.u)&&!g.containsVertex(S.v)&&P.add(S);return P}};var mg=class{process(t,e){e.begin("Delaunay triangulation",1);let o=[];for(let s of t.vertices)o.push(s.originalVertex);let r=t.getProperty(ee.DEBUG_SVG)?"spore/10bw":null,i=Eg.triangulate(o,r);if(t.tEdges==null)t.tEdges=i;else for(let s of i)t.tEdges.add(s);e.done()}getLayoutProcessorConfiguration(){return K.create()}};var wr=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.DELAUNAY_TRIANGULATION:return new mg;default:throw new Error(`No implementation for StructureExtractionStrategy.${this}`)}}};wr.DELAUNAY_TRIANGULATION=new wr("DELAUNAY_TRIANGULATION");var bi=class{constructor(t){this.node=t,this.children=[]}};var pn=class{static createSpanningTree(t,e,o,r=null){let i=typeof o=="function"?o:h=>o.cost(h),s=new Map;for(let h of t)s.set(h,i(h));let a=[...t];a.sort((h,d)=>s.get(h)-s.get(d));let l=new Set(a),c=new bi(e),g=new Map;for(g.set(e,c);l.size>0;){let h=null,d=null,f=null;for(let P of l){if(g.has(P.u)&&!g.has(P.v)){d=P.v,f=P.u,h=P;break}if(g.has(P.v)&&!g.has(P.u)){d=P.u,f=P.v,h=P;break}}if(h==null)break;let E=new bi(d);g.get(f).children.push(E),g.set(d,E),l.delete(h)}return c}};var En=class{constructor(){this._nodeMap=new Map}process(t,e){e.begin("Minimum spanning tree construction",1);let o=t.preferredRoot!=null?t.preferredRoot.originalVertex:t.vertices[0].originalVertex,r=t.getProperty(ee.DEBUG_SVG)?"spore/20minst":null,i=pn.createSpanningTree(t.tEdges,o,t.costFunction,r);this._convert(i,t),e.done()}_convert(t,e){this._nodeMap.clear();for(let r of e.vertices)this._nodeMap.set(r.originalVertex,r);let o=new bi(this._nodeMap.get(t.node));this._addNode(o,t),e.tree=o}_addNode(t,e){for(let o of e.children){let r=new bi(this._nodeMap.get(o.node));t.children.push(r),this._addNode(r,o)}}getLayoutProcessorConfiguration(){return K.create()}};var Pg=class extends En{process(t,e){e.begin("Maximum spanning tree construction",1);let o=a=>-t.costFunction(a),r=t.preferredRoot!=null?t.preferredRoot.originalVertex:t.vertices[0].originalVertex,i=t.getProperty(ee.DEBUG_SVG)?"spore/20minst":null,s=pn.createSpanningTree(t.tEdges,r,o,i);this._convert(s,t),e.done()}};var Mr=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.MINIMUM_SPANNING_TREE:return new En;case n.MAXIMUM_SPANNING_TREE:return new Pg;default:throw new Error(`No implementation for TreeConstructionStrategy.${this}`)}}};Mr.MINIMUM_SPANNING_TREE=new Mr("MINIMUM_SPANNING_TREE");Mr.MAXIMUM_SPANNING_TREE=new Mr("MAXIMUM_SPANNING_TREE");var mn=new m("org.eclipse.elk.underlyingLayoutAlgorithm"),Gk=new m("org.eclipse.elk.structure.structureExtractionStrategy",()=>wr.DELAUNAY_TRIANGULATION),Og=new m("org.eclipse.elk.processingOrder.treeConstruction",()=>Mr.MINIMUM_SPANNING_TREE),Sg=new m("org.eclipse.elk.processingOrder.spanningTreeCostFunction",()=>Te.CIRCLE_UNDERLAP),JE=new m("org.eclipse.elk.processingOrder.preferredRoot"),Tg=new m("org.eclipse.elk.processingOrder.rootSelection",()=>Ho.CENTER_NODE),QE=new m("org.eclipse.elk.compaction.compactionStrategy",()=>_n.DEPTH_FIRST),tm=new m("org.eclipse.elk.compaction.orthogonal",!1),em=new m("org.eclipse.elk.overlapRemoval.maxIterations",64),om=new m("org.eclipse.elk.overlapRemoval.runScanline",!0);var Pn=class{static overlap(t,e){let o=Math.min(Math.abs(t.x-(e.x+e.width)),Math.abs(t.x+t.width-e.x)),r=Math.min(Math.abs(t.y-(e.y+e.height)),Math.abs(t.y+t.height-e.y)),i=Math.abs(t.x+t.width/2-(e.x+e.width/2));if(i>t.width/2+e.width/2)return 1;let s=Math.abs(t.y+t.height/2-(e.y+e.height/2));return s>t.height/2+e.height/2?1:i===0&&s===0?0:i===0?r/s+1:s===0?o/i+1:Math.min(o/i,r/s)+1}static getRectEdges(t){let e=[];return e.push(new Ue(t.getTopLeft(),t.getTopRight())),e.push(new Ue(t.getTopLeft(),t.getBottomLeft())),e.push(new Ue(t.getBottomRight(),t.getTopRight())),e.push(new Ue(t.getBottomRight(),t.getBottomLeft())),e}};var Ng=class{constructor(){this._root=null,this._overlapsExisted=!1}process(t,e){e.begin("Grow Tree",1),this._root=t.tree,this._overlapsExisted=!1,this._growAt(t.tree),t.setProperty(ee.OVERLAPS_EXISTED,this._overlapsExisted),e.done()}_growAt(t){for(let e of t.children){e.node.translate(t.node.vertex.clone().sub(t.node.originalVertex));let o=Pn.overlap(t.node.rect,e.node.rect);o>1&&(this._overlapsExisted=!0),e.node.setCenterPosition(t.node.vertex.clone().add(e.node.originalVertex.clone().sub(t.node.originalVertex).scale(o))),this._growAt(e)}}getLayoutProcessorConfiguration(){return K.create()}};var On=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.GROW_TREE:return new Ng;default:throw new Error(`No implementation for OverlapRemovalStrategy.${this}`)}}};On.GROW_TREE=new On("GROW_TREE");var Ne=class{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}};Ne.P1_STRUCTURE=new Ne("P1_STRUCTURE",0);Ne.P2_PROCESSING_ORDER=new Ne("P2_PROCESSING_ORDER",1);Ne.P3_EXECUTION=new Ne("P3_EXECUTION",2);Ne.VALUES=[Ne.P1_STRUCTURE,Ne.P2_PROCESSING_ORDER,Ne.P3_EXECUTION];var rm=new m("org.eclipse.elk.padding",new yt(8)),im=new m("org.eclipse.elk.spacing.nodeNode",8,0);function yg(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}function sm(n){return[new Ue(n.getTopLeft(),n.getTopRight()),new Ue(n.getTopLeft(),n.getBottomLeft()),new Ue(n.getBottomRight(),n.getTopRight()),new Ue(n.getBottomRight(),n.getBottomLeft())]}var Ig=class{constructor(t,e){this.originalVertex=t,this.vertex=this.originalVertex.clone(),this.rect=new dt(e)}translate(t){this.vertex.add(t),this.rect.x+=t.x,this.rect.y+=t.y}setCenterPosition(t){this.translate(t.clone().sub(this.vertex))}underlap(t){let e=Math.abs(this.rect.getCenter().x-t.rect.getCenter().x),o=Math.abs(this.rect.getCenter().y-t.rect.getCenter().y),r=0,i=0,s=1,a=1;return e>this.rect.width/2+t.rect.width/2&&(r=Math.min(Math.abs(this.rect.x-(t.rect.x+t.rect.width)),Math.abs(this.rect.x+this.rect.width-t.rect.x)),s=1-r/e),o>this.rect.height/2+t.rect.height/2&&(i=Math.min(Math.abs(this.rect.y-(t.rect.y+t.rect.height)),Math.abs(this.rect.y+this.rect.height-t.rect.y)),a=1-i/o),(1-Math.min(s,a))*Math.sqrt(e*e+o*o)}distance(t,e){let o=Number.POSITIVE_INFINITY;for(let r of sm(this.rect))for(let i of sm(t.rect)){let s=Ft.distance(r.u,r.v,i.u,i.v,e);o=Math.min(o,s)}return o}touches(t){let e=ee.FUZZINESS;return yg(this.rect.x,t.rect.x+t.rect.width,e)<=0&&yg(t.rect.x,this.rect.x+this.rect.width,e)<=0&&yg(this.rect.y,t.rect.y+t.rect.height,e)<=0&&yg(t.rect.y,this.rect.y+this.rect.height,e)<=0}};var Rg=class extends ge{constructor(t,e,o){super(),this.vertices=[],this.tEdges=null,this.treeConstructionStrategy=e,this.tree=null,this.compactionStrategy=o,this.costFunction=t,this.preferredRoot=null,this.orthogonalCompaction=!1}};var Sn=class{constructor(){this._graph=null,this._nodeMap=new Map,this._elkGraph=null,this._spacingNodeNode=0,this._centerDistance=t=>t.u.distance(t.v),this._minimumRootDistance=t=>Math.min(t.u.distance(this._graph.preferredRoot.vertex),t.v.distance(this._graph.preferredRoot.vertex)),this._circleUnderlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst();return t.u.distance(t.v)-t.u.distance(e.rect.getPosition())-t.v.distance(o.rect.getPosition())},this._rectangleUnderlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst();return e.underlap(o)},this._invertedOverlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst(),r=e.rect,i=o.rect,s=Ft.shortestDistance(r,i);if(s>=0)return s;let a=i.getCenter().sub(r.getCenter()).length();return-(Pn.overlap(r,i)-1)*a}}importGraph(t){this._elkGraph=t,this._nodeMap=new Map,this._seenCoords=new Set;let e=yo.adapt(this._elkGraph);No.calculateNodeMargins(e);let o=this._elkGraph.getProperty(JE),r=this._elkGraph.getProperty(Sg),i=this._elkGraph.getProperty(Og),s=this._elkGraph.getProperty(QE),a=this._elkGraph.getProperty(Tg);this._spacingNodeNode=this._elkGraph.getProperty(im);let l;switch(r){case Te.CENTER_DISTANCE:l=this._centerDistance;break;case Te.CIRCLE_UNDERLAP:l=this._circleUnderlap;break;case Te.RECTANGLE_UNDERLAP:l=this._rectangleUnderlap;break;case Te.INVERTED_OVERLAP:l=this._invertedOverlap;break;case Te.MINIMUM_ROOT_DISTANCE:l=this._minimumRootDistance;break;default:throw new Error("No implementation available for "+r)}if(this._graph=new Rg(l,i,s),this._graph.setProperty(ee.DEBUG_SVG,this._elkGraph.getProperty(Ks)),this._graph.orthogonalCompaction=this._elkGraph.getProperty(tm),this._elkGraph.children.length===0)return this._graph;for(let c of this._elkGraph.children){let g=c.width/2,h=c.height/2,d=new O(c.x+g,c.y+h),f=d.x+","+d.y;for(;this._seenCoords.has(f);)d.add((Math.random()-.5)*.001,(Math.random()-.5)*.001),f=d.x+","+d.y;this._seenCoords.add(f);let E=c.getProperty(Nr),P=new Ig(d,new dt(d.x-g-this._spacingNodeNode/2-E.left,d.y-h-this._spacingNodeNode/2-E.top,c.width+this._spacingNodeNode+E.getHorizontal(),c.height+this._spacingNodeNode+E.getVertical()));this._graph.vertices.push(P),this._nodeMap.set(d,Gt.of(P,c))}if(a===Ho.FIXED)if(o==null)this._graph.preferredRoot=this._graph.vertices[0];else for(let c of this._graph.vertices){let g=this._nodeMap.get(c.originalVertex).getSecond().getIdentifier();g!==null&&g===o&&(this._graph.preferredRoot=c)}else if(a===Ho.CENTER_NODE){let c=new O(this._elkGraph.width,this._elkGraph.height);c.scale(.5),c.add(this._elkGraph.x,this._elkGraph.y);let g=Number.POSITIVE_INFINITY;for(let h of this._graph.vertices){let d=h.originalVertex.distance(c);d<g&&(g=d,this._graph.preferredRoot=h)}}else throw new Error("No implementation available for "+a);return this._graph}updateGraph(t){let e=new Map;t.tEdges=null,t.tree=null;for(let o of t.vertices){let r=this._nodeMap.get(o.originalVertex);o.originalVertex=o.rect.getCenter(),e.set(o.originalVertex,r)}this._nodeMap=e}applyPositions(t){let e=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let a of t.vertices){let l=this._nodeMap.get(a.originalVertex).getSecond();l.setLocation(a.rect.x,a.rect.y),e=Math.min(e,l.x),o=Math.min(o,l.y),r=Math.max(r,l.x+l.width),i=Math.max(i,l.y+l.height)}let s=this._elkGraph.getProperty(rm);Ae(this._elkGraph,r-e+s.getHorizontal(),i-o+s.getVertical(),!0,!0),Ra(this._elkGraph,-e+s.left,-o+s.top);for(let a of this._elkGraph.containedEdges){let l=ar(a,!0,!0),c=ks(a),g=Na(a),h=new O(c.x+c.width/2,c.y+c.height/2),d=new O(g.x+g.width/2,g.y+g.height/2),f=d.clone().sub(h);Ft.clipVector(f,c.width,c.height),h.add(f);let E=h.clone().sub(d);Ft.clipVector(E,g.width,g.height),d.add(E),l.setStartLocation(h.x,h.y),l.setEndLocation(d.x,d.y)}}};var Lg=class extends de{constructor(){super(),this._algorithmAssembler=Io.create(Ne.VALUES)}layout(t,e){if(t.hasProperty(mn)){let h=t.getProperty(mn),d=Ht.getInstance().getAlgorithmDataBySuffix(h);if(d!=null){let f=d.getInstancePool().fetch(),E=typeof e.subTask=="function"?e.subTask(1):e;f.layout(t,E)}}t.setProperty(Tg,Ho.CENTER_NODE),t.setProperty(Sg,Te.INVERTED_OVERLAP),t.setProperty(Og,Mr.MINIMUM_SPANNING_TREE);let o=t.getProperty(em);e.begin("Overlap removal",1);let r=new fg(null),i=new Set,s={handle(h,d){i.add(new Ue(h.originalVertex,d.originalVertex))}},a=new Sn,l=a.importGraph(t),c=!0,g=0;for(;g<o&&c;){if(t.getProperty(om)){if(i.clear(),new hg(s,r).sweep(l.vertices),i.size===0)break;l.tEdges=i}this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ne.P1_STRUCTURE,wr.DELAUNAY_TRIANGULATION),this._algorithmAssembler.setPhase(Ne.P2_PROCESSING_ORDER,l.treeConstructionStrategy),this._algorithmAssembler.setPhase(Ne.P3_EXECUTION,On.GROW_TREE);let h=this._algorithmAssembler.build(l);for(let d of h){let f=typeof e.subTask=="function"?e.subTask(1):e;d.process(l,f)}a.updateGraph(l),c=l.getProperty(ee.OVERLAPS_EXISTED),g++}a.applyPositions(l),e.done()}};var Ag=class{constructor(){this._algorithmAssembler=Io.create(Ne.VALUES)}shrink(t,e){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ne.P1_STRUCTURE,wr.DELAUNAY_TRIANGULATION),this._algorithmAssembler.setPhase(Ne.P2_PROCESSING_ORDER,t.treeConstructionStrategy),this._algorithmAssembler.setPhase(Ne.P3_EXECUTION,t.compactionStrategy);let o=this._algorithmAssembler.build(t);if(e.begin("Compaction by shrinking a tree",o.length),t.vertices.length>1)for(let r of o){let i=typeof e.subTask=="function"?e.subTask(1):e;r.process(t,i)}e.done()}};var Cg=class extends de{constructor(){super(),this._shrinktree=new Ag}layout(t,e){if(t.hasProperty(mn)){let s=t.getProperty(mn),a=Ht.getInstance().getAlgorithmDataBySuffix(s);if(a!=null){let l=a.getInstancePool().fetch(),c=typeof e.subTask=="function"?e.subTask(1):e;l.layout(t,c)}}let o=new Sn,r=o.importGraph(t),i=typeof e.subTask=="function"?e.subTask(1):e;this._shrinktree.shrink(r,i),o.applyPositions(r)}};var nm="org.eclipse.elk.sporeOverlap",am="org.eclipse.elk.sporeCompaction",lm=!1;function cm(){let n=Ht.getInstance(),t=n.getAlgorithmData(nm),e=n.getAlgorithmData(am);if(t&&e)return lm=!0,{overlap:t,compaction:e};let o=new Se.Builder().id(nm).name("ELK SPOrE Overlap").description("Node-overlap removal via Nachmanson et al. 2016.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.spore").providerFactory(()=>new Lg).supportedFeatures(new Set([])).create(),r=new Se.Builder().id(am).name("ELK SPOrE Compaction").description("Tree-based compaction to tighten whitespace between nodes.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.spore").providerFactory(()=>new Cg).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(i){i.register(o),i.register(r)}}),lm=!0,{overlap:o,compaction:r}}var br=class extends ge{constructor(){super(),this.id=0}getDesignation(){return null}};var Tn=class n extends yt{constructor(){super()}clone(){let t=new n;return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t}};var Nn=class extends br{constructor(){super(),this._size=new O,this._padding=new Tn,this._offset=new O,this._layerlessNodes=[],this._layers=[],this._parentNode=null}getSize(){return this._size}getActualSize(){return new O(this._size.x+this._padding.left+this._padding.right,this._size.y+this._padding.top+this._padding.bottom)}getPadding(){return this._padding}getOffset(){return this._offset}getLayerlessNodes(){return this._layerlessNodes}getLayers(){return this._layers}getParentNode(){return this._parentNode}setParentNode(t){this._parentNode=t}[Symbol.iterator](){return this._layers[Symbol.iterator]()}toNodeArray(){let t=new Array(this._layers.length);for(let e=0;e<this._layers.length;e++)t[e]=this._layers[e].getNodes().slice();return t}toString(){return this._layers.length===0?`G-unlayered[${this._layerlessNodes.join(",")}]`:this._layerlessNodes.length===0?`G-layered[${this._layers.join(",")}]`:`G[layerless[${this._layerlessNodes.join(",")}], layers[${this._layers.join(",")}]]`}};var p=class{};p.REVERSED=new m("reversed",!1);p.INPUT_COLLECT=new m("inputCollect",!1);p.OUTPUT_COLLECT=new m("outputCollect",!1);p.REPRESENTED_LABELS=new m("representedLabels");p.RANDOM=new m("random");p.CYCLIC=new m("cyclic",!1);p.MODEL_ORDER=new m("modelOrder");p.MAX_MODEL_ORDER_NODES=new m("maxModelOrderNodes",0);p.CB_NUM_MODEL_ORDER_GROUPS=new m("cbNumModelOrderGroups",1);p.TARJAN_ID=new m("tarjanId",-1);p.TARJAN_LOWLINK=new m("tarjanLowlink",-1);p.TARJAN_ON_STACK=new m("tarjanOnStack",!1);p.IS_PART_OF_CYCLE=new m("isPartOfCycle",!1);p.IN_LAYER_LAYOUT_UNIT=new m("inLayerLayoutUnit");p.ORIGIN=new m("origin");p.PORT_DUMMY=new m("portDummy");p.WEIGHT=new m("weight");p.IN_LAYER_SUCCESSOR_CONSTRAINTS=new m("inLayerSuccessorConstraints",[]);p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES=new m("inLayerSuccessorConstraintsBetweenNonDummies",!1);p.BARYCENTER_ASSOCIATES=new m("barycenterAssociates");p.GRAPH_PROPERTIES=new m("graphProperties",()=>new Set);p.FIRST_TRY_WITH_INITIAL_ORDER=new m("firstTryWithInitialOrder",!1);p.SECOND_TRY_WITH_INITIAL_ORDER=new m("secondTryWithInitialOrder",!1);p.INSIDE_CONNECTIONS=new m("insideConnections",!1);p.SPACINGS=new m("spacings");p.ORIGINAL_DUMMY_NODE_POSITION=new m("originalDummyNodePosition");p.LONG_EDGE_SOURCE=new m("longEdgeSource");p.LONG_EDGE_TARGET=new m("longEdgeTarget");p.LONG_EDGE_HAS_LABEL_DUMMIES=new m("longEdgeHasLabelDummies",!1);p.END_LABEL_EDGE=new m("endLabelEdge");p.EXT_PORT_SIDE=new m("extPortSide");p.IN_LAYER_CONSTRAINT=new m("inLayerConstraint");p.EDGE_CONSTRAINT=new m("edgeConstraint");p.TOP_COMMENTS=new m("topComments");p.BOTTOM_COMMENTS=new m("bottomComments");p.COMMENT_CONN_PORT=new m("commentConnPort");p.HIDDEN_NODES=new m("hiddenNodes");p.ORIGINAL_OPPOSITE_PORT=new m("originalOppositePort");p.LONG_EDGE_BEFORE_LABEL_DUMMY=new m("longEdgeBeforeLabelDummy",!1);p.PARTITION_DUMMY=new m("partitionDummy",!1);p.LABEL_SIDE=new m("labelSide");p.END_LABELS=new m("endLabels");p.MAX_EDGE_THICKNESS=new m("maxEdgeThickness",0);p.SPLINE_NS_PORT_Y_COORD=new m("splineNsPortYCoord");p.PORT_RATIO_OR_POSITION=new m("portRatioOrPosition",0);p.EXT_PORT_REPLACED_DUMMIES=new m("extPortReplacedDummies");p.EXT_PORT_REPLACED_DUMMY=new m("extPortReplacedDummy");p.SELF_LOOP_HOLDER=new m("selfLoopHolder");p.ORIGINAL_PORT_CONSTRAINTS=new m("originalPortConstraints");p.CROSSING_HINT=new m("crossingHint",0);p.BREAKING_POINT_INFO=new m("breakingPointInfo");p.SPLINE_ROUTE_START=new m("splineRouteStart");p.SPLINE_EDGE_CHAIN=new m("splineEdgeChain");p.SPLINE_SURVIVING_EDGE=new m("splineSurvivingEdge");p.COMPOUND_NODE=new m("compoundNode",!1);p.PROCESSORS=new m("processors");p.EXT_PORT_CONNECTIONS=new m("extPortConnections");p.EXT_PORT_SIZE=new m("extPortSize");p.COORDINATE_SYSTEM_ORIGIN=new m("coordinateSystemOrigin");p.ORIGINAL_BENDPOINTS=new m("originalBendpoints");p.TARGET_OFFSET=new m("targetOffset");p.CROSS_HIERARCHY_MAP=new m("crossHierarchyMap");p.ORIGINAL_LABEL_EDGE=new m("originalLabelEdge");p.TARGET_NODE_MODEL_ORDER=new m("targetNodeModelOrder");p.LONG_EDGE_TARGET_NODE=new m("longEdgeTargetNode");var oe=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};oe.BARYCENTER=new oe("BARYCENTER");oe.ONE_SIDED_GREEDY_SWITCH=new oe("ONE_SIDED_GREEDY_SWITCH");oe.TWO_SIDED_GREEDY_SWITCH=new oe("TWO_SIDED_GREEDY_SWITCH");oe.MEDIAN=new oe("MEDIAN");var Gi=class extends br{constructor(){super(),this._pos=new O,this._size=new O}getPosition(){return this._pos}getSize(){return this._size}};var Gr=class extends me{constructor(){super()}};var rt=class extends Gi{constructor(){super(),this._owner=null,this._side=u.UNDEFINED,this._anchor=new O,this._explicitlySuppliedPortAnchor=!1,this._margin=new Gr,this._labels=[],this._incomingEdges=[],this._outgoingEdges=[],this._connectedToExternalNodes=!0}getNode(){return this._owner}setNode(t){if(this._owner!=null){let e=this._owner.getPorts(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._owner=t,this._owner!=null&&this._owner.getPorts().push(this)}getSide(){return this._side}setSide(t){if(t==null)throw new TypeError("PortSide must not be null");if(this._side=t,!this.isExplicitlySuppliedPortAnchor()){let e=this.getSize(),o=this.getAnchor();switch(t){case u.NORTH:o.x=e.x/2,o.y=0;break;case u.EAST:o.x=e.x,o.y=e.y/2;break;case u.SOUTH:o.x=e.x/2,o.y=e.y;break;case u.WEST:o.x=0,o.y=e.y/2;break}}}getAnchor(){return this._anchor}isExplicitlySuppliedPortAnchor(){return this._explicitlySuppliedPortAnchor}setExplicitlySuppliedPortAnchor(t){this._explicitlySuppliedPortAnchor=t}getAbsoluteAnchor(){let t=this._owner.getPosition(),e=this.getPosition();return new O(t.x+e.x+this._anchor.x,t.y+e.y+this._anchor.y)}getMargin(){return this._margin}getLabels(){return this._labels}getName(){return this._labels.length>0?this._labels[0].getText():null}getDegree(){return this._incomingEdges.length+this._outgoingEdges.length}getNetFlow(){return this._incomingEdges.length-this._outgoingEdges.length}getIncomingEdges(){return this._incomingEdges}getOutgoingEdges(){return this._outgoingEdges}*getConnectedEdges(){yield*nr(this._incomingEdges),yield*nr(this._outgoingEdges)}isConnectedToExternalNodes(){return this._connectedToExternalNodes}setConnectedToExternalNodes(t){this._connectedToExternalNodes=t}*getPredecessorPorts(){for(let t of this._incomingEdges)yield t.getSource()}*getSuccessorPorts(){for(let t of this._outgoingEdges)yield t.getTarget()}*getConnectedPorts(){yield*nr(this.getPredecessorPorts()),yield*nr(this.getSuccessorPorts())}getIndex(){return this._owner==null?-1:this._owner.getPorts().indexOf(this)}getDesignation(){if(this._labels.length>0&&this._labels[0].getText())return this._labels[0].getText();let t=super.getDesignation();return t!=null?t:String(this.getIndex())}toString(){let t=`p_${this.getDesignation()}`;if(this._owner!=null&&(t+=`[${this._owner}]`),this._incomingEdges.length===1&&this._outgoingEdges.length===0&&this._incomingEdges[0].getSource()!==this){let e=this._incomingEdges[0].getSource();t+=` << ${e.getDesignation()}[${e._owner}]`}if(this._incomingEdges.length===0&&this._outgoingEdges.length===1&&this._outgoingEdges[0].getTarget()!==this){let e=this._outgoingEdges[0].getTarget();t+=` >> ${e.getDesignation()}[${e._owner}]`}return t}};Z(rt,"OUTPUT_PREDICATE",t=>t._outgoingEdges.length>0),Z(rt,"INPUT_PREDICATE",t=>t._incomingEdges.length>0),Z(rt,"NORTH_PREDICATE",t=>t._side===u.NORTH),Z(rt,"EAST_PREDICATE",t=>t._side===u.EAST),Z(rt,"SOUTH_PREDICATE",t=>t._side===u.SOUTH),Z(rt,"WEST_PREDICATE",t=>t._side===u.WEST);var W=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};W.UNDEFINED=new W("UNDEFINED");W.INPUT=new W("INPUT");W.OUTPUT=new W("OUTPUT");var ft=class extends Gi{constructor(t){super(),this._graph=t,this._layer=null,this._type=y.NORMAL,this._ports=[],this._labels=[],this._nestedGraph=null,this._margin=new Gr,this._padding=new Tn,this._portSideIndices=null,this._portSidesCached=!1}getLayer(){return this._layer}setLayer(t,e){let o,r=-1;if(e===void 0)o=t;else if(r=t,o=e,o!=null&&(r<0||r>o.getNodes().length))throw new RangeError("index must be >= 0 and <= layer node count");if(this._layer!=null){let i=this._layer.getNodes(),s=i.indexOf(this);s>=0&&i.splice(s,1)}this._layer=o,this._layer!=null&&(r>=0?this._layer.getNodes().splice(r,0,this):this._layer.getNodes().push(this))}getGraph(){return this._graph==null&&this._layer!=null?this._layer.getGraph():this._graph}setGraph(t){if(this._layer!=null)throw new Error("setGraph called on a node that is already in a layer");this._graph=t}getType(){return this._type}setType(t){this._type=t}getPorts(t,e){return t===void 0?this._ports:fT(this._ports,t,e)}getPortSideView(t){this._portSidesCached||this._findPortIndices();let e=this._portSideIndices.get(t);return e==null?[]:this._ports.slice(e[0],e[1])}*getIncomingEdges(){for(let t of this._ports)yield*nr(t.getIncomingEdges())}*getOutgoingEdges(){for(let t of this._ports)yield*nr(t.getOutgoingEdges())}*getConnectedEdges(){for(let t of this._ports)yield*nr(t.getConnectedEdges())}getLabels(){return this._labels}getNestedGraph(){return this._nestedGraph}setNestedGraph(t){this._nestedGraph=t}getMargin(){return this._margin}getPadding(){return this._padding}getIndex(){return this._layer==null?-1:this._layer.getNodes().indexOf(this)}borderToContentAreaCoordinates(t,e){let o=this.getGraph(),r=o.getPadding(),i=o.getOffset(),s=this.getPosition();t&&(s.x=s.x-r.left-i.x),e&&(s.y=s.y-r.top-i.y)}getInteractiveReferencePoint(){switch(this.getGraph().getProperty(_.INTERACTIVE_REFERENCE_POINT)){case vo.CENTER:{let e=this.getPosition(),o=this.getSize();return new O(e.x+o.x/2,e.y+o.y/2)}case vo.TOP_LEFT:return new O(this.getPosition().x,this.getPosition().y);default:return null}}cachePortSides(){this._portSidesCached=!0,this._findPortIndices()}_findPortIndices(){this._portSideIndices=new Map;let t=0,e=u.NORTH,o=0;for(;o<this._ports.length;o++){let r=this._ports[o];r.getSide()!==e&&(t!==o&&this._portSideIndices.set(e,[t,o]),e=r.getSide(),t=o)}this._portSideIndices.set(e,[t,o])}getDesignation(){if(this._labels.length>0&&this._labels[0].getText())return this._labels[0].getText();let t=super.getDesignation();return t!=null?t:String(this.getIndex())}isInlineEdgeLabel(){if(this._type!==y.LABEL)return!1;let t=this.getProperty(p.REPRESENTED_LABELS);return t?t.every(e=>e.getProperty(_.EDGE_LABELS_INLINE)):!1}toString(){let t="n";return this._type!==y.NORMAL&&(t+=`(${this._type.name.toLowerCase()})`),t+=`_${this.getDesignation()}`,t}},y=class{constructor(t,e){this.name=t,this._color=e,Object.freeze(this)}getColor(){return this._color}toString(){return this.name}};y.NORMAL=new y("NORMAL","#eeeeee");y.LONG_EDGE=new y("LONG_EDGE","#eaed00");y.EXTERNAL_PORT=new y("EXTERNAL_PORT","#cc99cc");y.NORTH_SOUTH_PORT=new y("NORTH_SOUTH_PORT","#0034de");y.LABEL=new y("LABEL","#75c3c3");y.BREAKING_POINT=new y("BREAKING_POINT","#eeeeff");y.PLACEHOLDER=new y("PLACEHOLDER","#eeeeee");y.NONSHIFTING_PLACEHOLDER=new y("NONSHIFTING_PLACEHOLDER","#eeeeee");function dT(n){return n===W.INPUT?rt.INPUT_PREDICATE:n===W.OUTPUT?rt.OUTPUT_PREDICATE:null}function gm(n){return n===u.NORTH?rt.NORTH_PREDICATE:n===u.EAST?rt.EAST_PREDICATE:n===u.SOUTH?rt.SOUTH_PREDICATE:n===u.WEST?rt.WEST_PREDICATE:null}function*fT(n,t,e){let o=null,r=null;t instanceof W?o=dT(t):t instanceof u&&(r=gm(t)),e!=null&&(r=gm(e));for(let i of n)o&&!o(i)||r&&!r(i)||(yield i)}var D=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}static values(){return[n.P1_CYCLE_BREAKING,n.P2_LAYERING,n.P3_NODE_ORDERING,n.P4_NODE_PLACEMENT,n.P5_EDGE_ROUTING]}};D.P1_CYCLE_BREAKING=new D("P1_CYCLE_BREAKING",0);D.P2_LAYERING=new D("P2_LAYERING",1);D.P3_NODE_ORDERING=new D("P3_NODE_ORDERING",2);D.P4_NODE_PLACEMENT=new D("P4_NODE_PLACEMENT",3);D.P5_EDGE_ROUTING=new D("P5_EDGE_ROUTING",4);var oo=class n{constructor(t){this._graph=t;let e=hm().size;this._horizontal=Array.from({length:e},()=>new Array(e).fill(null)),this._vertical=Array.from({length:e},()=>new Array(e).fill(null)),this._precalculate()}_precalculate(){this._set(y.NORMAL,_.SPACING_NODE_NODE,_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._setPair(y.NORMAL,y.LONG_EDGE,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.NORMAL,y.NORTH_SOUTH_PORT,_.SPACING_EDGE_NODE),this._setPair(y.NORMAL,y.EXTERNAL_PORT,_.SPACING_EDGE_NODE),this._setPair(y.NORMAL,y.LABEL,_.SPACING_NODE_NODE,_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._set(y.LONG_EDGE,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this._setPair(y.LONG_EDGE,y.NORTH_SOUTH_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.LONG_EDGE,y.EXTERNAL_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.LONG_EDGE,y.LABEL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._set(y.NORTH_SOUTH_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.NORTH_SOUTH_PORT,y.EXTERNAL_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.NORTH_SOUTH_PORT,y.LABEL,_.SPACING_LABEL_NODE),this._set(y.EXTERNAL_PORT,_.SPACING_PORT_PORT),this._setPair(y.EXTERNAL_PORT,y.LABEL,_.SPACING_LABEL_PORT_VERTICAL,_.SPACING_LABEL_PORT_HORIZONTAL),this._set(y.LABEL,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE),this._set(y.BREAKING_POINT,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.NORMAL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.LABEL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.LONG_EDGE,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS)}_set(t,e,o){let r=Is(t);this._vertical[r][r]=e,o!==void 0&&(this._horizontal[r][r]=o)}_setPair(t,e,o,r){let i=Is(t),s=Is(e);this._vertical[i][s]=o,this._vertical[s][i]=o,r!==void 0&&(this._horizontal[i][s]=r,this._horizontal[s][i]=r)}getHorizontalSpacing(t,e){if(xg(t)&&xg(e))return this._getLocalSpacingNodes(t,e,this._horizontal);if(Dg(t)&&Dg(e))return this._getLocalSpacingTypes(t,e,this._horizontal);throw new yn("getHorizontalSpacing requires two nodes or two node types")}getVerticalSpacing(t,e){if(xg(t)&&xg(e))return this._getLocalSpacingNodes(t,e,this._vertical);if(Dg(t)&&Dg(e))return this._getLocalSpacingTypes(t,e,this._vertical);throw new yn("getVerticalSpacing requires two nodes or two node types")}_getLocalSpacingNodes(t,e,o){let r=o[Is(t.getType())][Is(e.getType())];if(r==null)throw new yn(`No spacing between ${t.getType()} and ${e.getType()}`);let i=n.getIndividualOrDefault(t,r),s=n.getIndividualOrDefault(e,r);return Math.max(i,s)}_getLocalSpacingTypes(t,e,o){let r=o[Is(t)][Is(e)];if(r==null)throw new yn(`No spacing between ${t} and ${e}`);return this._graph.getProperty(r)}static getIndividualOrDefault(t,e){let o=null;if(t.hasProperty(_.SPACING_INDIVIDUAL)){let r=t.getProperty(_.SPACING_INDIVIDUAL);r&&r.hasProperty&&r.hasProperty(e)&&(o=r.getProperty(e))}return o==null&&(o=t.getGraph().getProperty(e)),o}},yn=class extends Error{constructor(t="unspecified spacing"){super(t),this.name="UnspecifiedSpacingException"}};function xg(n){return n!=null&&typeof n.getType=="function"&&typeof n.getPorts=="function"}function Dg(n){return n instanceof y}var qu=null;function hm(){return qu===null&&(qu=new Map([y.NORMAL,y.LONG_EDGE,y.EXTERNAL_PORT,y.NORTH_SOUTH_PORT,y.LABEL,y.BREAKING_POINT,y.PLACEHOLDER,y.NONSHIFTING_PLACEHOLDER].map((n,t)=>[n,t]))),qu}function Is(n){let t=hm().get(n);if(t===void 0)throw new Error(`Unknown NodeType ${n}`);return t}var wg=class{process(t,e){e.begin("Node margin calculation",1);for(let o of t.getLayers())for(let r of o.getNodes())uT(r);e.done()}};function uT(n){let t=n.getMargin(),e=n.getProperty(p.TOP_COMMENTS),o=n.getProperty(p.BOTTOM_COMMENTS);if(e==null&&o==null)return;let r=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_COMMENT),i=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_NODE),s=0;if(e!=null){let c=0;for(let g of e)g.getSize().y>c&&(c=g.getSize().y),s+=g.getSize().x;s+=r*(e.length-1),t.top+=c+i}let a=0;if(o!=null){let c=0;for(let g of o)g.getSize().y>c&&(c=g.getSize().y),a+=g.getSize().x;a+=r*(o.length-1),t.bottom+=c+i}let l=Math.max(s,a);if(l>n.getSize().x){let c=(l-n.getSize().x)/2;c>t.left&&(t.left=c),c>t.right&&(t.right=c)}}var Mg=class{process(t,e){e.begin("Comment post-processing",1);for(let o of t){let r=[];for(let i of o){let s=i.getProperty(p.TOP_COMMENTS),a=i.getProperty(p.BOTTOM_COMMENTS);if(s!=null||a!=null){if(_T(i,s,a),s!=null)for(let l of s)r.push(l);if(a!=null)for(let l of a)r.push(l)}}for(let i of r)o.getNodes().push(i)}e.done()}};function _T(n,t,e){let o=n.getPosition(),r=n.getSize(),i=n.getMargin(),s=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_COMMENT);if(t!=null){let a=s*(t.length-1),l=0;for(let f of t)a+=f.getSize().x,f.getSize().y>l&&(l=f.getSize().y);let c=o.x-(a-r.x)/2,g=o.y-i.top+l,h=r.x/(t.length+1),d=h;for(let f of t){f.getPosition().x=c,f.getPosition().y=g-f.getSize().y,c+=f.getSize().x+s;let E=dm(f);E.getPosition().x=f.getSize().x/2-E.getAnchor().x,E.getPosition().y=f.getSize().y;let P=f.getProperty(p.COMMENT_CONN_PORT);P.getDegree()===1&&(P.getPosition().x=d-P.getAnchor().x,P.getPosition().y=0,P.setNode(n)),d+=h}}if(e!=null){let a=s*(e.length-1),l=0;for(let f of e)a+=f.getSize().x,f.getSize().y>l&&(l=f.getSize().y);let c=o.x-(a-r.x)/2,g=o.y+r.y+i.bottom-l,h=r.x/(e.length+1),d=h;for(let f of e){f.getPosition().x=c,f.getPosition().y=g,c+=f.getSize().x+s;let E=dm(f);E.getPosition().x=f.getSize().x/2-E.getAnchor().x,E.getPosition().y=0;let P=f.getProperty(p.COMMENT_CONN_PORT);P.getDegree()===1&&(P.getPosition().x=d-P.getAnchor().x,P.getPosition().y=r.y,P.setNode(n)),d+=h}}}function dm(n){let t=n.getProperty(p.COMMENT_CONN_PORT);for(let e of n.getPorts()){for(let o of e.getOutgoingEdges())return o.setTarget(t),e;for(let o of e.getIncomingEdges())return o.setSource(t),e}return null}var bg=class{process(t,e){e.begin("Comment pre-processing",1);let o=t.getLayerlessNodes(),r=0;for(;r<o.length;){let i=o[r];if(!i.getProperty(_.COMMENT_BOX)){r++;continue}let s=0,a=null,l=null;for(let c of i.getPorts())s+=c.getDegree(),c.getIncomingEdges().length===1&&(a=c.getIncomingEdges()[0],l=a.getSource()),c.getOutgoingEdges().length===1&&(a=c.getOutgoingEdges()[0],l=a.getTarget());if(s===1&&l!=null&&l.getDegree()===1&&!l.getNode().getProperty(_.COMMENT_BOX))pT(i,a,l,l.getNode()),o.splice(r,1);else{let c=[];for(let g of i.getPorts()){for(let h of g.getOutgoingEdges())h.getTarget().getOutgoingEdges().length>0&&c.push(h);for(let h of g.getIncomingEdges())h.getSource().getIncomingEdges().length>0&&c.push(h)}for(let g of c)g.reverse(t,!0);r++}}e.done()}};function pT(n,t,e,o){let r,i=!1,s=!1;if(o.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){let l=!1,c=!1;t:for(let g of o.getPorts())for(let h of g.getConnectedPorts())if(!h.getNode().getProperty(_.COMMENT_BOX)){if(g.getSide()===u.NORTH){l=!0;break t}if(g.getSide()===u.SOUTH){c=!0;break t}}i=c&&!l,s=l&&!c}if(!i&&!s&&o.getLabels().length>0){let l=0;for(let c of o.getLabels())l+=c.getPosition().y+c.getSize().y/2;l/=o.getLabels().length,r=l>=o.getSize().y/2}else r=!s;ET(o,r,i,s).push(n),n.setProperty(p.COMMENT_CONN_PORT,e),t.getTarget()===e?(t.setTarget(null),e.getDegree()===0&&e.setNode(null),mT(e)):(t.setSource(null),e.getDegree()===0&&e.setNode(null)),t.getBendPoints().clear()}function ET(n,t,e,o){if(t){let s=n.getProperty(p.TOP_COMMENTS);if(s==null)return s=[],n.setProperty(p.TOP_COMMENTS,s),s;if(e)return s;let a=n.getProperty(p.BOTTOM_COMMENTS);return a==null?(a=[],n.setProperty(p.BOTTOM_COMMENTS,a),a):s.length<=a.length?s:a}let r=n.getProperty(p.BOTTOM_COMMENTS);if(r==null)return r=[],n.setProperty(p.BOTTOM_COMMENTS,r),r;if(o)return r;let i=n.getProperty(p.TOP_COMMENTS);return i==null?(i=[],n.setProperty(p.TOP_COMMENTS,i),i):r.length<=i.length?r:i}function mT(n){let t=n.getProperty(p.PORT_DUMMY);if(t!=null){let e=t.getLayer(),o=e.getNodes().indexOf(t);if(o>=0&&e.getNodes().splice(o,1),e.getNodes().length===0){let r=t.getGraph(),i=r.getLayers().indexOf(e);i>=0&&r.getLayers().splice(i,1)}}}var Gg=class{process(t,e){e.begin("Constraints Postprocessor",1);let o=0;for(let r of t.getLayers()){let i=0,s=!1;for(let a of r.getNodes())a.getType()===y.NORMAL&&(s=!0,a.setProperty(_.LAYERING_LAYER_ID,o),a.setProperty(_.CROSSING_MINIMIZATION_POSITION_ID,i),i++);s&&o++}e.done()}};var J=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};J.NONE=new J("NONE");J.FIRST=new J("FIRST");J.FIRST_SEPARATE=new J("FIRST_SEPARATE");J.LAST=new J("LAST");J.LAST_SEPARATE=new J("LAST_SEPARATE");var De=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};De.NONE=new De("NONE");De.OUTGOING_ONLY=new De("OUTGOING_ONLY");De.INCOMING_ONLY=new De("INCOMING_ONLY");var Hg=class{process(t,e){e.begin("Edge and layer constraint edge reversal",1);let o=PT(t);OT(t,o),e.done()}};function PT(n){let t=[];for(let e of n.getLayerlessNodes()){let o=e.getProperty(_.LAYERING_LAYER_CONSTRAINT),r=fm(o);r!=null?(e.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),r===De.INCOMING_ONLY?Xa(n,e,o,W.INPUT):r===De.OUTGOING_ONLY&&Xa(n,e,o,W.OUTPUT)):t.push(e)}return t}function OT(n,t){for(let e of t){let o=e.getProperty(_.LAYERING_LAYER_CONSTRAINT),r=fm(o);r!=null?(e.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),r===De.INCOMING_ONLY?Xa(n,e,o,W.INPUT):r===De.OUTGOING_ONLY&&Xa(n,e,o,W.OUTPUT)):e.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&e.getPorts().length>0&&ST(e)&&Xa(n,e,o,W.UNDEFINED)}}function ST(n){for(let t of n.getPorts()){let e=t.getSide()===u.EAST&&t.getNetFlow()>0,o=t.getSide()===u.WEST&&t.getNetFlow()<0;if(!(e||o))return!1;for(let r of t.getOutgoingEdges()){let i=r.getTarget().getNode().getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.LAST||i===J.LAST_SEPARATE)return!1}for(let r of t.getIncomingEdges()){let i=r.getSource().getNode().getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.FIRST||i===J.FIRST_SEPARATE)return!1}}return!0}function fm(n){switch(n){case J.FIRST:case J.FIRST_SEPARATE:return De.OUTGOING_ONLY;case J.LAST:case J.LAST_SEPARATE:return De.INCOMING_ONLY;default:return null}}function Xa(n,t,e,o){let r=t.getPorts().slice();for(let i of r){if(o===W.INPUT||o===W.UNDEFINED){let s=i.getOutgoingEdges().slice();for(let a of s)TT(e,a)&&a.reverse(n,!0)}if(o===W.OUTPUT||o===W.UNDEFINED){let s=i.getIncomingEdges().slice();for(let a of s)NT(e,a)&&a.reverse(n,!0)}}}function TT(n,t){if(t.getProperty(p.REVERSED))return!1;let e=t.getTarget().getNode();return!(n===J.LAST&&e.getType()===y.LABEL||e.getProperty(_.LAYERING_LAYER_CONSTRAINT)===J.LAST_SEPARATE)}function NT(n,t){if(t.getProperty(p.REVERSED))return!1;let e=t.getSource().getNode();return!(n===J.FIRST&&e.getType()===y.LABEL||e.getProperty(_.LAYERING_LAYER_CONSTRAINT)===J.FIRST_SEPARATE)}var vg=class{process(t,e){e.begin("End label post-processing",1);for(let o of t.getLayers())for(let r of o.getNodes())(r.getType()===y.NORMAL||r.getType()===y.EXTERNAL_PORT)&&r.hasProperty(p.END_LABELS)&&yT(r);e.done()}};function yT(n){let t=n.getProperty(p.END_LABELS);if(t==null||t.size===0)return;let e=n.getPosition();for(let o of t.values())o.getCellRectangle().move(e),o.applyLabelLayout();n.setProperty(p.END_LABELS,null)}var _m=-1,In=class{process(t,e){e.begin("End label pre-processing",1);let o=t.getProperty(_.SPACING_EDGE_LABEL),r=t.getProperty(_.SPACING_LABEL_LABEL),i=t.getProperty(_.DIRECTION),s=i!=null&&i.isVertical&&i.isVertical();for(let a of t.getLayers())for(let l of a.getNodes())IT(l,o,r,s);e.done()}static gatherLabels(t){return pm(t)}};function IT(n,t,e,o){let r=n.getPorts(),i=r.length,s=new Array(i);for(let l=0;l<i;l++){let c=r[l];c.id=l,s[l]=RT(pm(c),e,o)}LT(n,s,e,t,o);let a=new Map;for(let l=0;l<s.length;l++)s[l]!=null&&a.set(r[l],s[l]);a.size>0&&(n.setProperty(p.END_LABELS,a),xT(n,s))}function RT(n,t,e){if(n==null||n.length===0)return null;let o=new Ni(t,!e);for(let i of n)o.addLabel(i);let r=o.getCellRectangle();return r.height=o.getMinimumHeight(),r.width=o.getMinimumWidth(),o}function pm(n){let t=[],e=um(n,t),o=n.getProperty(p.PORT_DUMMY);if(o!=null){for(let r of o.getPorts())if(r.getProperty(p.ORIGIN)===n){let i=um(r,t);i>e&&(e=i)}}return t.length>0&&n.setProperty(p.MAX_EDGE_THICKNESS,e),e!==_m?t:null}function um(n,t){let e=_m,o=[];for(let r of n.getConnectedEdges()){let i=r.getProperty(_.EDGE_THICKNESS);if(i>e&&(e=i),r.getSource()===n)for(let s of r.getLabels())s.getProperty(_.EDGE_LABELS_PLACEMENT)===St.TAIL&&o.push(s);else for(let s of r.getLabels())s.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD&&o.push(s);for(let s of o)s.hasProperty(p.END_LABEL_EDGE)||s.setProperty(p.END_LABEL_EDGE,r),t.push(s);o.length=0}return e}function LT(n,t,e,o,r){let i=new Set;for(let s of n.getPorts())t[s.id]!=null&&(AT(s,t[s.id],o),i.add(s.getSide()));r?(Bg(n,t,u.EAST,2*e,o),Bg(n,t,u.WEST,2*e,o)):(Bg(n,t,u.NORTH,2*e,o),Bg(n,t,u.SOUTH,2*e,o))}function AT(n,t,e){let o=t.getCellRectangle(),r=n.getNode(),i=r.getSize(),s=r.getMargin(),a=n.getPosition(),l=new O(a.x+n.getAnchor().x,a.y+n.getAnchor().y),c=n.getProperty(p.MAX_EDGE_THICKNESS),g=DT(t)===Vt.ABOVE;switch(n.getSide()){case u.NORTH:{t.setVerticalAlignment(nt.BOTTOM),o.y=-s.top-e-o.height,g?(t.setHorizontalAlignment(lt.RIGHT),o.x=l.x-c-e-o.width):(t.setHorizontalAlignment(lt.LEFT),o.x=l.x+c+e);break}case u.EAST:{t.setHorizontalAlignment(lt.LEFT),o.x=i.x+s.right+e,g?(t.setVerticalAlignment(nt.BOTTOM),o.y=l.y-c-e-o.height):(t.setVerticalAlignment(nt.TOP),o.y=l.y+c+e);break}case u.SOUTH:{t.setVerticalAlignment(nt.TOP),o.y=i.y+s.bottom+e,g?(t.setHorizontalAlignment(lt.RIGHT),o.x=l.x-c-e-o.width):(t.setHorizontalAlignment(lt.LEFT),o.x=l.x+c+e);break}case u.WEST:{t.setHorizontalAlignment(lt.RIGHT),o.x=-s.left-e-o.width,g?(t.setVerticalAlignment(nt.BOTTOM),o.y=l.y-c-e-o.height):(t.setVerticalAlignment(nt.TOP),o.y=l.y+c+e);break}default:break}}function Bg(n,t,e,o,r){let i=fs.createForDirection(wT(e)).withGap(o,o).withStartCoordinate(CT(n,e,r));for(let s of n.getPorts(e))t[s.id]!=null&&i.addRectangle(t[s.id].getCellRectangle());i.removeOverlaps()}function CT(n,t,e){let o=n.getSize(),r=n.getMargin();switch(t){case u.NORTH:return-r.top-e;case u.SOUTH:return o.y+r.bottom+e;case u.EAST:return o.x+r.right+e;case u.WEST:return-r.left-e;default:return 0}}function xT(n,t){let e=n.getMargin(),o=n.getSize(),r=new dt(-e.left,-e.top,e.left+o.x+e.right,e.top+o.y+e.bottom);for(let i of t)i!=null&&r.union(i.getCellRectangle());e.left=-r.x,e.top=-r.y,e.right=r.width-e.left-o.x,e.bottom=r.height-e.top-o.y}function DT(n){return n.getLabels()[0].getProperty(p.LABEL_SIDE)}function wT(n){switch(n){case u.NORTH:return Jt.UP;case u.SOUTH:return Jt.DOWN;case u.EAST:return Jt.RIGHT;case u.WEST:return Jt.LEFT;default:return null}}var Ug=class{process(t,e){e.begin("Sort end labels",1);for(let o of t.getLayers())for(let r of o.getNodes())r.getType()===y.NORMAL&&MT(r,t);e.done()}};function MT(n,t){if(!n.hasProperty(p.END_LABELS))return;let e=n.getProperty(p.END_LABELS),o=!1;for(let r of n.getPorts())bT(r)&&(o||(GT(t),o=!0),HT(e.get(r)))}function bT(n){let t=0;for(let e of n.getIncomingEdges())e.getLabels().some(o=>o.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD)&&t++;for(let e of n.getOutgoingEdges())e.getLabels().some(o=>o.getProperty(_.EDGE_LABELS_PLACEMENT)===St.TAIL)&&t++;return t>=2}function GT(n){let t=0;for(let e of n)for(let o of e){o.id=t++;for(let r of o.getPorts())r.id=t++}}function HT(n){if(n==null)return;let t=new Map,e=n.getLabels();for(let r of e){let i=r.getProperty(p.END_LABEL_EDGE),s=t.get(i);s==null&&(s=[],t.set(i,s)),s.push(r)}let o=Array.from(t.entries());o.sort((r,i)=>{let s=r[0],a=i[0];if(s==null||a==null)return 0;let l=s.getSource().id-a.getSource().id;if(l!==0)return l;let c=s.getTarget().getNode().id-a.getTarget().getNode().id;return c!==0?c:a.getTarget().id-s.getTarget().id}),e.length=0;for(let[,r]of o)for(let i of r)e.push(i)}var re=class{constructor(t){this.name=t}toString(){return this.name}};re.NONE=new re("NONE");re.LEFT=new re("LEFT");re.RIGHT=new re("RIGHT");re.LEFT_RIGHT_CONSTRAINT_LOCKING=new re("LEFT_RIGHT_CONSTRAINT_LOCKING");re.LEFT_RIGHT_CONNECTION_LOCKING=new re("LEFT_RIGHT_CONNECTION_LOCKING");re.EDGE_LENGTH=new re("EDGE_LENGTH");var Qr=Object.freeze({CONSERVATIVE:"CONSERVATIVE",CONSERVATIVE_SOFT:"CONSERVATIVE_SOFT",SLOPPY:"SLOPPY",values(){return[this.CONSERVATIVE,this.CONSERVATIVE_SOFT,this.SLOPPY]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var Fg=class n{constructor(...t){if(this.top=Number.MAX_VALUE,this.bottom=-Number.MAX_VALUE,this.left=Number.MAX_VALUE,this.right=-Number.MAX_VALUE,t.length===4&&t.every(e=>typeof e=="number")){let[e,o,r,i]=t;if(o>i)throw new RangeError("Top must be smaller or equal to bottom.");if(e>r)throw new RangeError("Left must be smaller or equal to right.");this.top=o,this.right=r,this.bottom=i,this.left=e;return}if(t.length===1){let e=t[0];if(e instanceof n){this.top=e.top,this.right=e.right,this.bottom=e.bottom,this.left=e.left;return}if(e instanceof O){this.top=e.y,this.bottom=e.y,this.right=e.x,this.left=e.x;return}if(typeof e.getPosition=="function"&&typeof e.getSize=="function"){let o=e.getPosition(),r=new O(o.x+e.getSize().x,o.y+e.getSize().y);this.top=Math.min(o.y,r.y),this.bottom=Math.max(o.y,r.y),this.left=Math.min(o.x,r.x),this.right=Math.max(o.x,r.x);return}if(Array.isArray(e)||typeof e[Symbol.iterator]=="function"){for(let o of e)this.union(o);return}}if(t.length>=1){for(let e of t)this.union(e);return}}union(t){if(t instanceof n){this.top=Math.min(this.top,t.top),this.right=Math.max(this.right,t.right),this.bottom=Math.max(this.bottom,t.bottom),this.left=Math.min(this.left,t.left);return}if(t instanceof O){this.top=Math.min(this.top,t.y),this.right=Math.max(this.right,t.x),this.bottom=Math.max(this.bottom,t.y),this.left=Math.min(this.left,t.x);return}if(typeof t.getPosition=="function"&&typeof t.getSize=="function"){this.union(t.getPosition());let e=t.getPosition();this.union(new O(e.x+t.getSize().x,e.y+t.getSize().y));return}}static union(t,e){if(e instanceof n){let s=new n(t);return s.union(e),s}let o=e[Symbol.iterator](),r=o.next();if(r.done)throw new RangeError("Empty rectangle collection");let i=new n(r.value);for(let s of o)i.union(s);return i}enlarge(t){this.top-=t,this.left-=t,this.right+=t,this.bottom+=t}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}getTop(){return this.top}getRight(){return this.right}getBottom(){return this.bottom}getLeft(){return this.left}getFromPortSide(t){switch(t){case u.NORTH:return this.top;case u.EAST:return this.right;case u.SOUTH:return this.bottom;case u.WEST:return this.left;default:return 0}}toNodeMargins(t){let e=new me,o=new n(0,0,t.getSize().x,t.getSize().y);return e.top=Math.max(0,o.top-this.top),e.left=Math.max(0,o.left-this.left),e.bottom=Math.max(0,this.bottom-o.bottom),e.right=Math.max(0,this.right-o.right),e}toString(){return"[top= "+this.top.toFixed(1)+",left= "+this.left.toFixed(1)+",bottom= "+this.bottom.toFixed(1)+",right= "+this.right.toFixed(1)+"]"}};var uo=1e-6,Rs=class n{constructor(...t){if(this.knotVector=[],this.controlPoints=[],this.dimNUBS=0,this.isUniform=!1,this.isClamped=!1,this.outerBox=null,this.isBezier=!1,this.minKnot=0,this.maxKnot=0,t.length===1&&t[0]instanceof n){let a=t[0];this.dimNUBS=a.dimNUBS,this.isUniform=a.isUniform,this.isClamped=a.isClamped,this.outerBox=a.outerBox,this.isBezier=a.isBezier,this.knotVector=a.knotVector.slice(),this.minKnot=a.minKnot,this.maxKnot=a.maxKnot,this.controlPoints=a.controlPoints.slice();return}if(t.length===6){let[a,l,c,g,h,d]=t;this.isClamped=a,this.isUniform=l,this.isBezier=c,this.dimNUBS=g,this.knotVector=h,this.controlPoints=d,this.minKnot=h[0],this.maxKnot=h[h.length-1];return}let e=t[0],o=t[1],r;if(t.length===3&&Array.isArray(t[2])?r=t[2].slice():t.length===3&&t[2]instanceof st?r=Array.from(t[2]):r=t.slice(2),o<1)throw new RangeError("The dimension must be at least 1!");for(;r.length<o+1;)r.unshift(r[0]);if(r.length<o+1)throw new RangeError("At least (dimension + 1) control points are necessary!");this.dimNUBS=o,this.isClamped=e,this.isUniform=!0,this.isBezier=!1,this._createUniformKnotVector(e,r.length+this.dimNUBS-1);let i=[],s=0;for(let a=0;a<this.dimNUBS-1;a++)i.push(this.knotVector[s++]);for(let a of r)i.push(this.knotVector[s++]),this.controlPoints.push(new Rn(a,i)),i.shift()}static generateDerivedNUBS(t){let e=t.isClamped,o=t.isUniform,r=t.isBezier,i=t.dimNUBS,s=i-1,a=t.knotVector,l=t.knotVector.slice(1,t.knotVector.length-1),c=[];for(let f=0;f<t.controlPoints.length-1;f++){let E=t.controlPoints[f+1].getCp().clone().sub(t.controlPoints[f].getCp()).scale(i/(a[f+i]-a[f]));c.push(E)}let g=[],h=0,d=[];for(let f=0;f<s-1;f++)g.push(l[h++]);for(let f of c)g.push(l[h++]),d.push(new Rn(f,g)),g.shift();return new n(e,o,r,s,l,d)}static generateInvertedNUBS(t){let e=[],o=t.knotVector[t.knotVector.length-1];for(let l of t.knotVector)e.unshift(o-l);let r=st.reverse(t.getControlPoints()),i=[],s=0,a=[];for(let l=0;l<t.dimNUBS-1;l++)i.push(e[s++]);for(let l of r)i.push(e[s++]),a.push(new Rn(l,i)),i.shift();return new n(t.isClamped,t.isUniform,t.isBezier,t.dimNUBS,e,a)}getDim(){return this.dimNUBS}getOuterBox(){return this.outerBox===null&&this._calculateOuterBox(),this.outerBox}setOuterBox(t){this.outerBox=t}getControlPoints(){let t=new st;for(let e of this.controlPoints)t.push(e.getCp());return t}getControlPoint(t){return this.controlPoints[t].getCp()}getControlPointsSize(){return this.controlPoints.length}getKnotVector(){return this.knotVector.slice()}_getIndexInKnotVector(t){for(let e=0;e<this.knotVector.length;e++)if(Math.abs(this.knotVector[e]-t)<uo)return e;return this.knotVector.length}_getMultiplicity(t){let e=0;for(let o of this.knotVector){let r=o-t;if(r>uo)return e;r>-uo&&e++}return e}_createUniformKnotVector(t,e){if(e<2*this.dimNUBS)throw new RangeError("The knot vector must have at least two times the dimension elements.");let o;if(t){this.minKnot=0,this.maxKnot=1;for(let i=0;i<this.dimNUBS;i++)this.knotVector.push(0);o=e+1-2*this.dimNUBS}else{o=e+1;let i=this.dimNUBS;this.minKnot=i/(o+1),this.maxKnot=(o-i)/o}let r=o;for(let i=1;i<o;i++)this.knotVector.push(i/r);if(this.isClamped)for(let i=0;i<this.dimNUBS;i++)this.knotVector.push(1)}_calculateOuterBox(){this.outerBox=new Fg(this.getControlPoints())}static _getTFromPolar(t){let e=0;for(let o of t)e+=o;return e/t.length}_insertKnot(t,e){let o;this.isClamped?o=this.dimNUBS:o=this.dimNUBS-1;let r=this.knotVector[o++],i=0;for(;r-t<uo;)r=this.knotVector[o++],i++;o--,this._insertKnotAtCurrentPosition(e,t,i,o)}_insertKnotAtCurrentPosition(t,e,o,r){let i=this._getMultiplicity(e);for(let s=0;s<t;s++){this.knotVector.splice(r,0,e),r++;let a=[],l=o,c=this.controlPoints[l++];for(let d=i+s;d<this.dimNUBS;d++){let f=c;c=this.controlPoints[l++],a.push(new Rn(f,c,e))}let g=o+1,h=Math.max(0,a.length-1);this.controlPoints.splice(g,h,...a),s<t-1?o+=1:o+=1+a.length}return{cpIdx:o,knotIdx:r}}static _getFirstVerticalPoint(t,e,o){let r=n.generateDerivedNUBS(t),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroXOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.x),a++;return t._getPointOnCurve(l,!1)}static _getLastVerticalPoint(t,e,o){let r=n.generateInvertedNUBS(n.generateDerivedNUBS(t)),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroXOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.x),a++;let c=t.getKnotVector()[t.getKnotVector().length-1];return t._getPointOnCurve(c-l,!1)}static _getFirstHorizontalPoint(t,e,o){let r=n.generateDerivedNUBS(t),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroYOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.y),a++;return t._getPointOnCurve(l,!1)}static _getLastHorizontalPoint(t,e,o){let r=n.generateInvertedNUBS(n.generateDerivedNUBS(t)),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroYOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.y),a++;let c=t.getKnotVector()[t.getKnotVector().length-1];return t._getPointOnCurve(c-l,!1)}_getPointOnCurve(t,e=!1){let o=this._getMultiplicity(t);if(o===this.dimNUBS)return this.getControlPoint(this._getIndexInKnotVector(t));if(e)return this._insertKnot(t,this.dimNUBS-o),this.getControlPoint(this._getIndexInKnotVector(t));let r=new n(this);return r._insertKnot(t,this.dimNUBS-o),r.getControlPoint(r._getIndexInKnotVector(t))}static _getZeroYOfControlPoligon(t){let e=t.controlPoints;if(e.length===0)return 0;let o=e[0],r=o.getCp().y,i=r>uo,s=r<-uo;for(let a=1;a<e.length;a++){let l=o,c=r,g=i,h=s;if(o=e[a],r=o.getCp().y,i=r>uo,s=r<-uo,!(i||s))return n._getTFromPolar(o.getPolarCoordinate());if(g&&s||h&&i){let d=c/(c-r),f=n._getTFromPolar(l.getPolarCoordinate()),E=n._getTFromPolar(o.getPolarCoordinate());return d*f+(1-d)*E}}return 0}static _getZeroXOfControlPoligon(t){let e=t.controlPoints;if(e.length===0)return 0;let o=e[0],r=o.getCp().x,i=r>uo,s=r<-uo;for(let a=1;a<e.length;a++){let l=o,c=r,g=i,h=s;if(o=e[a],r=o.getCp().x,i=r>uo,s=r<-uo,!(i||s))return n._getTFromPolar(o.getPolarCoordinate());if(g&&s||h&&i){let d=c/(c-r),f=n._getTFromPolar(l.getPolarCoordinate()),E=n._getTFromPolar(o.getPolarCoordinate());return d*f+(1-d)*E}}return 0}toBezier(){if(this.isBezier)return;let t;this.isClamped?t=this.dimNUBS:(this.knotVector.splice(0,this.dimNUBS-1),t=0);let e=0,o=this.knotVector[t++];for(;this.maxKnot-o>uo;){let r=o,i=0;for(;Math.abs(o-r)<uo;)i++,o=this.knotVector[t++],e++;if(i<this.dimNUBS){t--;let s=this._insertKnotAtCurrentPosition(this.dimNUBS-i,r,e,t);e=s.cpIdx,t=s.knotIdx,o=this.knotVector[t++]}e--}this.isClamped||this.knotVector.splice(t,this.dimNUBS-1),this.isClamped=!0,this.isBezier=!0}getBezierCP(t=!1,e=!1){this.isBezier||this.toBezier();let o=new st,r=0;t||(r=1);for(let i=r;i<this.controlPoints.length;i++)o.push(this.controlPoints[i].getCp());return e||o.pop(),o}static generateNiceCurve(){let t=new st,e=new O(5.5,23),o=new O(2.5,12),r=new O(5,10),i=new O(5,9),s=new O(3.8,5.5),a=new O(7,4),l=new O(7,3.5),c=new O(6,2.2),g=new O(8,.5),h=(d,f)=>new O(f+f-d.x,d.y);return t.push(e,e,e,o,r,i,s,a,l,c,g,h(c,g.x),h(l,g.x),h(a,g.x),h(s,g.x),h(i,g.x),h(r,g.x),h(o,g.x),h(e,g.x),h(e,g.x),h(e,g.x)),t.scale(5),t.offset(-50,-80),new n(!0,3,t)}toString(){return`[${this.controlPoints.join(", ")}]`}};Rs.DIM=3;var Rn=class n{constructor(t,e,o){if(arguments.length===2){if(t instanceof n){this.cp=t.getCp().clone(),this.polarCoordinate=t.polarCoordinate.slice();return}this.cp=t.clone(),this.polarCoordinate=e.slice();return}if(arguments.length===1){let f=t;this.cp=f.getCp().clone(),this.polarCoordinate=f.polarCoordinate.slice();return}let r=t,i=e,s=o,a=r.polarCoordinate[0],l=i.polarCoordinate[i.polarCoordinate.length-1],c=r.cp.clone().scale(l-s),g=i.cp.clone().scale(s-a),h=c.add(g);h.scale(1/(l-a)),this.cp=h,this.polarCoordinate=[];let d=!0;for(let f=1;f<r.polarCoordinate.length;f++){let E=r.polarCoordinate[f];d&&E-s>uo&&(this.polarCoordinate.push(s),d=!1),this.polarCoordinate.push(E)}d&&this.polarCoordinate.push(s)}getCp(){return this.cp}setCp(t){this.cp=t}getPolarCoordinate(){return this.polarCoordinate}setPolarCoordinate(t){this.polarCoordinate=t}toString(){return`[${this.polarCoordinate.join(",")}] (${this.cp.x.toFixed(2)}, ${this.cp.y.toFixed(2)})`}};var v=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};v.COMMENTS=new v("COMMENTS");v.EXTERNAL_PORTS=new v("EXTERNAL_PORTS");v.HYPEREDGES=new v("HYPEREDGES");v.HYPERNODES=new v("HYPERNODES");v.NON_FREE_PORTS=new v("NON_FREE_PORTS");v.NORTH_SOUTH_PORTS=new v("NORTH_SOUTH_PORTS");v.SELF_LOOPS=new v("SELF_LOOPS");v.CENTER_LABELS=new v("CENTER_LABELS");v.END_LABELS=new v("END_LABELS");v.PARTITIONS=new v("PARTITIONS");var Ln=class Ln{constructor(t,e,o,r){this._type=t,this._weight=r,this._source=null,this._target=null,this.setSource(e),this.setTarget(o)}static createAndAddRegular(t,e,o){return new Ln(Hr.REGULAR,t,e,o)}static createAndAddCritical(t,e){return new Ln(Hr.CRITICAL,t,e,Ln.CRITICAL_DEPENDENCY_WEIGHT)}remove(){this.setSource(null),this.setTarget(null)}reverse(){let t=this._source,e=this._target;this.setSource(e),this.setTarget(t)}getType(){return this._type}getSource(){return this._source}setSource(t){if(this._source!=null){let e=this._source.getOutgoingSegmentDependencies(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._source=t,this._source!=null&&this._source.getOutgoingSegmentDependencies().push(this)}getTarget(){return this._target}setTarget(t){if(this._target!=null){let e=this._target.getIncomingSegmentDependencies(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._target=t,this._target!=null&&this._target.getIncomingSegmentDependencies().push(this)}getWeight(){return this._weight}toString(){return`${this._source}->${this._target} (${this._type})`}};Z(Ln,"CRITICAL_DEPENDENCY_WEIGHT",1);var $e=Ln,Hr=Object.freeze({REGULAR:"REGULAR",CRITICAL:"CRITICAL"});var Ka=class{static detectCycles(t,e,o){let r=[],i=[],s=[];vT(t,i,s,e),BT(t,i,s,e,o);for(let a of t)for(let l of a.getOutgoingSegmentDependencies())(!e||l.getType()===Hr.CRITICAL)&&a.mark>l.getTarget().mark&&r.push(l);return r}};function vT(n,t,e,o){let r=-1;for(let i of n){i.mark=r--;let s=0;for(let g of i.getIncomingSegmentDependencies())g.getType()===Hr.CRITICAL&&(s+=g.getWeight());let a=0;for(let g of i.getOutgoingSegmentDependencies())g.getType()===Hr.CRITICAL&&(a+=g.getWeight());let l=s,c=a;if(!o){l=0;for(let g of i.getIncomingSegmentDependencies())l+=g.getWeight();c=0;for(let g of i.getOutgoingSegmentDependencies())c+=g.getWeight()}i.setInWeight(l),i.setCriticalInWeight(s),i.setOutWeight(c),i.setCriticalOutWeight(a),c===0?e.push(i):l===0&&t.push(i)}}function BT(n,t,e,o,r){let i=new Set(n),s=[],a=n.length,l=a-1,c=a+1;for(;i.size>0;){for(;e.length>0;){let f=e.shift();i.delete(f),f.mark=l--,Ju(f,t,e,o)}for(;t.length>0;){let f=t.shift();i.delete(f),f.mark=c++,Ju(f,t,e,o)}let h=Number.MIN_SAFE_INTEGER;s.length=0;let d=!1;for(let f of[...i].sort((E,P)=>E.mark-P.mark)){if(!o&&f.getCriticalOutWeight()>0&&f.getCriticalInWeight()<=0){s.length=0,s.push(f),d=!0;break}let E=f.getOutWeight()-f.getInWeight();E>=h&&(E>h&&(s.length=0,h=E),s.push(f))}if(s.length>0){let f=s[r.nextInt(s.length)];i.delete(f),f.mark=c++,Ju(f,t,e,o),s.length=0}}let g=n.length+1;for(let h of n)h.mark<a&&(h.mark=h.mark+g)}function Ju(n,t,e,o){for(let r of n.getOutgoingSegmentDependencies())if(!o||r.getType()===Hr.CRITICAL){let i=r.getTarget();i.mark<0&&r.getWeight()>0&&(i.setInWeight(i.getInWeight()-r.getWeight()),r.getType()===Hr.CRITICAL&&i.setCriticalInWeight(i.getCriticalInWeight()-r.getWeight()),i.getInWeight()<=0&&i.getOutWeight()>0&&t.push(i))}for(let r of n.getIncomingSegmentDependencies())if(!o||r.getType()===Hr.CRITICAL){let i=r.getSource();i.mark<0&&r.getWeight()>0&&(i.setOutWeight(i.getOutWeight()-r.getWeight()),r.getType()===Hr.CRITICAL&&i.setCriticalOutWeight(i.getCriticalOutWeight()-r.getWeight()),i.getOutWeight()<=0&&i.getInWeight()>0&&e.push(i))}}var An=class n{constructor(t){this._routingStrategy=t,this._ports=[],this.mark=0,this._routingSlot=0,this._startPosition=Number.NaN,this._endPosition=Number.NaN,this._incomingConnectionCoordinates=[],this._outgoingConnectionCoordinates=[],this._outgoingSegmentDependencies=[],this._outDepWeight=0,this._criticalOutDepWeight=0,this._incomingSegmentDependencies=[],this._inDepWeight=0,this._criticalInDepWeight=0,this._splitPartner=null,this._splitBy=null}addPortPositions(t,e){e.set(t,this),this._ports.push(t);let o=this._routingStrategy.getPortPositionOnHyperNode(t);t.getSide()===this._routingStrategy.getSourcePortSide()?Em(this._incomingConnectionCoordinates,o):Em(this._outgoingConnectionCoordinates,o),this.recomputeExtent();for(let r of t.getConnectedPorts())e.has(r)||this.addPortPositions(r,e)}getPorts(){return this._ports}getRoutingSlot(){return this._routingSlot}setRoutingSlot(t){this._routingSlot=t}getStartCoordinate(){return this._startPosition}getEndCoordinate(){return this._endPosition}getIncomingConnectionCoordinates(){return this._incomingConnectionCoordinates}getOutgoingConnectionCoordinates(){return this._outgoingConnectionCoordinates}getOutgoingSegmentDependencies(){return this._outgoingSegmentDependencies}getIncomingSegmentDependencies(){return this._incomingSegmentDependencies}getOutWeight(){return this._outDepWeight}setOutWeight(t){this._outDepWeight=t}getCriticalOutWeight(){return this._criticalOutDepWeight}setCriticalOutWeight(t){this._criticalOutDepWeight=t}getInWeight(){return this._inDepWeight}setInWeight(t){this._inDepWeight=t}getCriticalInWeight(){return this._criticalInDepWeight}setCriticalInWeight(t){this._criticalInDepWeight=t}getSplitPartner(){return this._splitPartner}setSplitPartner(t){this._splitPartner=t}getSplitBy(){return this._splitBy}setSplitBy(t){this._splitBy=t}getLength(){return this.getEndCoordinate()-this.getStartCoordinate()}representsHyperedge(){return this._incomingConnectionCoordinates.length+this._outgoingConnectionCoordinates.length>2}isDummy(){return this._splitPartner!=null&&this._splitBy==null}recomputeExtent(){this._startPosition=Number.NaN,this._endPosition=Number.NaN,this._recomputeExtentOne(this._incomingConnectionCoordinates),this._recomputeExtentOne(this._outgoingConnectionCoordinates)}_recomputeExtentOne(t){if(t.length===0)return;let e=t[0],o=t[t.length-1];this._startPosition=Number.isNaN(this._startPosition)?e:Math.min(this._startPosition,e),this._endPosition=Number.isNaN(this._endPosition)?o:Math.max(this._endPosition,o)}simulateSplit(){let t=new n(this._routingStrategy),e=new n(this._routingStrategy);return t._incomingConnectionCoordinates.push(...this._incomingConnectionCoordinates),t._splitBy=this._splitBy,t._splitPartner=e,t.recomputeExtent(),e._outgoingConnectionCoordinates.push(...this._outgoingConnectionCoordinates),e._splitPartner=t,e.recomputeExtent(),Gt.of(t,e)}splitAt(t){for(this._splitPartner=new n(this._routingStrategy),this._splitPartner.setSplitPartner(this),this._splitPartner._outgoingConnectionCoordinates.push(...this._outgoingConnectionCoordinates),this._outgoingConnectionCoordinates.length=0,this._outgoingConnectionCoordinates.push(t),this._splitPartner._incomingConnectionCoordinates.push(t),this.recomputeExtent(),this._splitPartner.recomputeExtent();this._incomingSegmentDependencies.length>0;)this._incomingSegmentDependencies[0].remove();for(;this._outgoingSegmentDependencies.length>0;)this._outgoingSegmentDependencies[0].remove();return this._splitPartner}compareTo(t){return this.mark-t.mark}toString(){let t=[];for(let e of this._ports){let o=e.getNode().getDesignation();o==null&&(o="n"+e.getNode().getIndex()),t.push(o)}return"{"+t.join(",")+"}"}};function Em(n,t){for(let e=0;e<n.length;e++){if(n[e]===t)return;if(n[e]>t){n.splice(e,0,t);return}}n.push(t)}var kg=class{constructor(t){this._routingGenerator=t}splitSegments(t,e,o){if(t.length===0)return;let r=this._findFreeAreas(e,o),s=[...this._decideWhichSegmentsToSplit(t)].sort((a,l)=>a.getLength()-l.getLength());for(let a of s)this._split(a,e,r,o)}_findFreeAreas(t,e){let o=[],r=[];for(let i of t){for(let s of i.getIncomingConnectionCoordinates())r.push(s);for(let s of i.getOutgoingConnectionCoordinates())r.push(s)}r.sort((i,s)=>i-s);for(let i=1;i<r.length;i++)r[i]-r[i-1]>=2*e&&o.push(new Za(r[i-1]+e,r[i]-e));return o}_decideWhichSegmentsToSplit(t){let e=new Set;for(let o of t){let r=o.getSource(),i=o.getTarget();if(e.has(r)||e.has(i))continue;let s=r,a=i;r.representsHyperedge()&&!i.representsHyperedge()&&(s=i,a=r),e.add(s),s.setSplitBy(a)}return e}_split(t,e,o,r){let i=this._computePositionToSplitAndUpdateFreeAreas(t,o,r);e.push(t.splitAt(i)),this._updateDependencies(t,e)}_updateDependencies(t,e){let o=t.getSplitBy(),r=t.getSplitPartner();$e.createAndAddCritical(t,o),$e.createAndAddCritical(o,r);for(let i of e)i!==o&&i!==t&&i!==r&&(this._routingGenerator.createDependencyIfNecessary(i,t),this._routingGenerator.createDependencyIfNecessary(i,r))}_computePositionToSplitAndUpdateFreeAreas(t,e,o){let r=-1,i=-1;for(let a=0;a<e.length;a++){let l=e[a];if(l.startPosition>t.getEndCoordinate())break;l.endPosition>=t.getStartCoordinate()&&(r<0&&(r=a),i=a)}let s=UT(t);if(r>=0){let a=this._chooseBestAreaIndex(t,e,r,i);s=Qu(e[a]),this._useArea(e,a,o)}return s}_chooseBestAreaIndex(t,e,o,r){let i=o;if(o<r){let s=t.simulateSplit(),a=s.getFirst(),l=s.getSecond(),c=e[i],g=this._rateArea(t,a,l,c);for(let h=o+1;h<=r;h++){let d=e[h],f=this._rateArea(t,a,l,d);this._isBetter(d,f,c,g)&&(c=d,g=f,i=h)}}return i}_rateArea(t,e,o,r){let i=Qu(r);e.getOutgoingConnectionCoordinates().length=0,e.getOutgoingConnectionCoordinates().push(i),o.getIncomingConnectionCoordinates().length=0,o.getIncomingConnectionCoordinates().push(i);let s=new t_(0,0);for(let a of t.getIncomingSegmentDependencies()){let l=a.getSource();this._updateConsideringBothOrderings(s,e,l),this._updateConsideringBothOrderings(s,o,l)}for(let a of t.getOutgoingSegmentDependencies()){let l=a.getTarget();this._updateConsideringBothOrderings(s,e,l),this._updateConsideringBothOrderings(s,o,l)}return s.dependencies+=2,s.crossings+=this._countCrossingsForSingleOrdering(e,t.getSplitBy()),s.crossings+=this._countCrossingsForSingleOrdering(t.getSplitBy(),o),s}_updateConsideringBothOrderings(t,e,o){let r=this._countCrossingsForSingleOrdering(e,o),i=this._countCrossingsForSingleOrdering(o,e);r===i?r>0&&(t.dependencies+=2,t.crossings+=r):(t.dependencies+=1,t.crossings+=Math.min(r,i))}_countCrossingsForSingleOrdering(t,e){return ie.countCrossings(t.getOutgoingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate())+ie.countCrossings(e.getIncomingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate())}_isBetter(t,e,o,r){return e.crossings<r.crossings||e.crossings===r.crossings&&(e.dependencies<r.dependencies||e.dependencies===r.dependencies&&t.size>o.size)}_useArea(t,e,o){let r=t[e];if(t.splice(e,1),r.size/2>=o){let i=e,s=Qu(r),a=s-o;r.startPosition<=a&&t.splice(i++,0,new Za(r.startPosition,a));let l=s+o;l<=r.endPosition&&t.splice(i,0,new Za(l,r.endPosition))}}},Za=class{constructor(t,e){this.startPosition=t,this.endPosition=e,this.size=e-t}},t_=class{constructor(t,e){this.dependencies=t,this.crossings=e}};function UT(n){return(n.getStartCoordinate()+n.getEndCoordinate())/2}function Qu(n){return(n.startPosition+n.endPosition)/2}var Hi=class{constructor(){this._createdJunctionPoints=new Set}addJunctionPointIfNecessary(t,e,o,r){let i=r?o.y:o.x;if(this._createdJunctionPoints.has(o.x+","+o.y))return;let s=i>e.getStartCoordinate()&&i<e.getEndCoordinate(),a=!1,l=e.getIncomingConnectionCoordinates(),c=e.getOutgoingConnectionCoordinates();if(l.length>0&&c.length>0&&(a=a||Math.abs(i-l[0])<ie.TOLERANCE&&Math.abs(i-c[0])<ie.TOLERANCE,a=a||Math.abs(i-l[l.length-1])<ie.TOLERANCE&&Math.abs(i-c[c.length-1])<ie.TOLERANCE),s||a){let g=t.getProperty(_.JUNCTION_POINTS);g==null&&(g=new st,t.setProperty(_.JUNCTION_POINTS,g));let h=o.clone?o.clone():{x:o.x,y:o.y};g.add(h),this._createdJunctionPoints.add(h.x+","+h.y)}}getCreatedJunctionPoints(){return this._createdJunctionPoints}clearCreatedJunctionPoints(){this._createdJunctionPoints.clear()}getPortPositionOnHyperNode(t){throw new Error("Abstract method")}getSourcePortSide(){throw new Error("Abstract method")}getTargetPortSide(){throw new Error("Abstract method")}calculateBendPoints(t,e,o){throw new Error("Abstract method")}};var Wg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().x+t.getPosition().x+t.getAnchor().x}getSourcePortSide(){return u.SOUTH}getTargetPortSide(){return u.NORTH}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e+t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().x;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().x;if(Math.abs(s-c)<=ie.TOLERANCE)continue;let g=r,h=t,d=new O(s,g);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1),g=e+f.getRoutingSlot()*o,h=f,d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}d=new O(c,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}}}};var qe=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};qe.WEST_TO_EAST=new qe("WEST_TO_EAST");qe.NORTH_TO_SOUTH=new qe("NORTH_TO_SOUTH");qe.SOUTH_TO_NORTH=new qe("SOUTH_TO_NORTH");var zg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().x+t.getPosition().x+t.getAnchor().x}getSourcePortSide(){return u.NORTH}getTargetPortSide(){return u.SOUTH}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e-t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().x;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().x;if(Math.abs(s-c)<=ie.TOLERANCE)continue;let g=r,h=t,d=new O(s,g);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1),g=e-f.getRoutingSlot()*o,h=f,d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}d=new O(c,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}}}};var Yg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().y+t.getPosition().y+t.getAnchor().y}getSourcePortSide(){return u.EAST}getTargetPortSide(){return u.WEST}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e+t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().y;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().y;if(Math.abs(s-c)<=ie.TOLERANCE)continue;let g=r,h=t,d=new O(g,s);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(g,E),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0),g=e+f.getRoutingSlot()*o,h=f,d=new O(g,E),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0)}d=new O(g,c),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0)}}}};function mm(n){switch(n){case qe.WEST_TO_EAST:return new Yg;case qe.NORTH_TO_SOUTH:return new Wg;case qe.SOUTH_TO_NORTH:return new zg;default:throw new Error("Unknown routing direction: "+n)}}var ja=-1,FT=.5,kT=.2,Pm=1,Om=16,ie=class n{constructor(t,e,o=null){this._routingStrategy=mm(t),this._edgeSpacing=e,this._conflictThreshold=FT*e,this._criticalConflictThreshold=0,this._debugPrefix=o,this._segmentSplitter=null}routeEdges(t,e,o,r,i,s){let a=new Map,l=[];this._createHyperEdgeSegments(o,this._routingStrategy.getSourcePortSide(),l,a),this._createHyperEdgeSegments(i,this._routingStrategy.getTargetPortSide(),l,a),this._criticalConflictThreshold=kT*this._minimumHorizontalSegmentDistance(l);let c=0;for(let d=0;d<l.length-1;d++){let f=l[d];for(let E=d+1;E<l.length;E++)c+=this.createDependencyIfNecessary(f,l[E])}let g=e.getProperty(p.RANDOM);c>=2&&this._breakCriticalCycles(l,g),n.breakNonCriticalCycles(l,g),n._topologicalNumbering(l);let h=-1;for(let d of l)Math.abs(d.getStartCoordinate()-d.getEndCoordinate())<n.TOLERANCE||(h=Math.max(h,d.getRoutingSlot()),this._routingStrategy.calculateBendPoints(d,s,this._edgeSpacing));return this._routingStrategy.clearCreatedJunctionPoints(),h+1}_createHyperEdgeSegments(t,e,o,r){if(t!=null)for(let i of t)for(let s of i.getPorts(W.OUTPUT,e)){let a=r.get(s);a==null&&(a=new An(this._routingStrategy),o.push(a),a.addPortPositions(s,r))}}createDependencyIfNecessary(t,e){if(Math.abs(t.getStartCoordinate()-t.getEndCoordinate())<n.TOLERANCE||Math.abs(e.getStartCoordinate()-e.getEndCoordinate())<n.TOLERANCE)return 0;let o=this._countConflicts(t.getOutgoingConnectionCoordinates(),e.getIncomingConnectionCoordinates()),r=this._countConflicts(e.getOutgoingConnectionCoordinates(),t.getIncomingConnectionCoordinates()),i=o===ja||r===ja,s=0;if(i)o===ja&&($e.createAndAddCritical(e,t),s++),r===ja&&($e.createAndAddCritical(t,e),s++);else{let a=n.countCrossings(t.getOutgoingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate());a+=n.countCrossings(e.getIncomingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate());let l=n.countCrossings(e.getOutgoingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate());l+=n.countCrossings(t.getIncomingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate());let c=Pm*o+Om*a,g=Pm*r+Om*l;c<g?$e.createAndAddRegular(t,e,g-c):c>g?$e.createAndAddRegular(e,t,c-g):c>0&&g>0&&($e.createAndAddRegular(t,e,0),$e.createAndAddRegular(e,t,0))}return s}_countConflicts(t,e){let o=0;if(t.length===0||e.length===0)return 0;let r=0,i=0,s=t[r],a=e[i],l=!0;do{if(s>a-this._criticalConflictThreshold&&s<a+this._criticalConflictThreshold)return ja;s>a-this._conflictThreshold&&s<a+this._conflictThreshold&&o++,s<=a&&r+1<t.length?s=t[++r]:a<=s&&i+1<e.length?a=e[++i]:l=!1}while(l);return o}static countCrossings(t,e,o){let r=0;for(let i of t){if(i>o)break;i>=e&&r++}return r}_minimumHorizontalSegmentDistance(t){let e=[],o=[];for(let s of t){for(let a of s.getIncomingConnectionCoordinates())e.push(a);for(let a of s.getOutgoingConnectionCoordinates())o.push(a)}let r=n._minimumDifference(e),i=n._minimumDifference(o);return Math.min(r,i)}static _minimumDifference(t){let e=[...new Set(t)].sort((r,i)=>r-i),o=Number.MAX_VALUE;for(let r=1;r<e.length;r++)o=Math.min(o,e[r]-e[r-1]);return o}_breakCriticalCycles(t,e){let o=Ka.detectCycles(t,!0,e);this._segmentSplitter==null&&(this._segmentSplitter=new kg(this)),this._segmentSplitter.splitSegments(o,t,this._criticalConflictThreshold)}static breakNonCriticalCycles(t,e){let o=Ka.detectCycles(t,!1,e);for(let r of o)r.getWeight()===0?r.remove():r.reverse()}static _topologicalNumbering(t){let e=[],o=[];for(let i of t)i.setInWeight(i.getIncomingSegmentDependencies().length),i.setOutWeight(i.getOutgoingSegmentDependencies().length),i.getInWeight()===0&&e.push(i),i.getOutWeight()===0&&i.getIncomingConnectionCoordinates().length===0&&o.push(i);let r=-1;for(;e.length>0;){let i=e.shift();for(let s of i.getOutgoingSegmentDependencies()){let a=s.getTarget();a.setRoutingSlot(Math.max(a.getRoutingSlot(),i.getRoutingSlot()+1)),r=Math.max(r,a.getRoutingSlot()),a.setInWeight(a.getInWeight()-1),a.getInWeight()===0&&e.push(a)}}if(r>-1){for(let i of o)i.setRoutingSlot(r);for(;o.length>0;){let i=o.shift();for(let s of i.getIncomingSegmentDependencies()){let a=s.getSource();a.getIncomingConnectionCoordinates().length>0||(a.setRoutingSlot(Math.min(a.getRoutingSlot(),i.getRoutingSlot()-1)),a.setOutWeight(a.getOutWeight()-1),a.getOutWeight()===0&&o.push(a))}}}}};ie.TOLERANCE=.001;function Ls(n){let t=n.getProperty(p.EXT_PORT_SIDE);return n.getType()===y.EXTERNAL_PORT&&(t===u.WEST||t===u.EAST)}var Vg=class{getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);if(!e)return null;let o=K.create(),r=!1;return e.has(v.HYPEREDGES)&&(o.addBefore(D.P4_NODE_PLACEMENT,w.HYPEREDGE_DUMMY_MERGER),o.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR),r=!0),(e.has(v.NON_FREE_PORTS)||t.getProperty(_.FEEDBACK_EDGES))&&(o.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR),e.has(v.NORTH_SOUTH_PORTS)&&(o.addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)),r=!0),e.has(v.EXTERNAL_PORTS)&&(o.addBefore(D.P3_NODE_ORDERING,w.HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR),o.addBefore(D.P4_NODE_PLACEMENT,w.HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER),r=!0),e.has(v.SELF_LOOPS)&&(o.addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR),o.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER),o.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER),o.addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR),r=!0),e.has(v.HYPERNODES)&&(o.addAfter(D.P5_EDGE_ROUTING,w.HYPERNODE_PROCESSOR),r=!0),e.has(v.CENTER_LABELS)&&(o.addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER),o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER),o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),o.addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER),r=!0),e.has(v.END_LABELS)&&(o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),o.addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR),r=!0),r?o:null}process(t,e){e&&e.begin&&e.begin("Orthogonal edge routing",1);let o=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),r=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),s=new ie(qe.WEST_TO_EAST,r,null),a=0,l=t.getLayers(),c=-1,g=null,h=null,d=-1;for(;;){c++;let f=c<l.length?l[c]:null,E=f==null?null:f.getNodes(),P=c-1;g!=null&&(z.placeNodesHorizontally(g,a),a+=g.getSize().x);let S=g==null?a:a+i,T=s.routeEdges(e,t,h,d,E,S),N=g==null||h.every(Ls),I=f==null||E.every(Ls);if(T>0){let C=(T-1)*r;g!=null&&(C+=i),f!=null&&(C+=i),C<o&&!N&&!I&&(C=o),a+=C}else!N&&!I&&(a+=o);if(g=f,h=E,d=P,f==null)break}t.getSize().x=a,e&&e.done&&e.done()}};var Cn=class n{constructor(t,e,o){if(this.handled=!1,this.leftPorts=new Set,this.rightPorts=new Set,this.outgoing=[],this.incoming=[],this.mark=0,this.inweight=0,this.outweight=0,this.rank=0,this.edges=new Set,this.boundingBox=new dt,this.isWestOfInitialLayer=!1,this.xDelta=0,this.sourcePort=null,this.targetPort=null,this.initialSegment=!1,this.lastSegment=!1,this.sourceNode=null,this.targetNode=null,this.inverseOrder=!1,this.hyperEdgeTopYPos=0,this.hyperEdgeBottomYPos=0,this.centerControlPointY=0,this.edgeInformation=new Map,e instanceof Set||Array.isArray(e)){let r=t,i=e;o===Fe.LEFT?this.leftPorts.add(r):this.rightPorts.add(r);let a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of i){let h=g.getFirst(),d=g.getSecond(),f=d.getSource();f===r&&(f=d.getTarget()),h===Fe.LEFT?this.leftPorts.add(f):this.rightPorts.add(f);let E=n._anchorY(f);a=Math.min(a,E),l=Math.max(l,E)}let c=n._anchorY(r);this._setRelevantPositions(c,a,l);for(let g of i)this._addEdge(g.getSecond());this.isStraight=!1}else{let r=t,i=e,s=o;i===Fe.LEFT?this.leftPorts.add(r.getSource()):this.rightPorts.add(r.getSource()),s===Fe.LEFT?this.leftPorts.add(r.getTarget()):this.rightPorts.add(r.getTarget()),this._addEdge(r);let a=n._anchorY(r.getSource()),l=n._anchorY(r.getTarget());this._setRelevantPositions(a,l,l),this.isStraight=Math.abs(a-l)<WT}}_addEdge(t){this.edges.add(t);let e=new e_;this.edgeInformation.set(t,e),e.startY=n._anchorY(t.getSource()),e.endY=n._anchorY(t.getTarget()),e.normalSourceNode=n._isNormalNode(t.getSource().getNode()),e.normalTargetNode=n._isNormalNode(t.getTarget().getNode()),e.invertedLeft=t.getSource().getSide()===u.WEST,e.invertedRight=t.getTarget().getSide()===u.EAST}static _anchorY(t){return u.SIDES_NORTH_SOUTH.has(t.getSide())?t.getProperty(p.SPLINE_NS_PORT_Y_COORD):t.getAbsoluteAnchor().y}static _isNormalNode(t){let e=t.getType();return e===y.NORMAL||e===y.BREAKING_POINT}isHyperEdge(){return this.edges.size>1}compareTo(t){return this.mark-t.mark}_setRelevantPositions(t,e,o){this.boundingBox.y=Math.min(t,e),this.boundingBox.height=Math.max(t,o)-this.boundingBox.y,t<e?(this.centerControlPointY=Sm*(t+e),this.hyperEdgeTopYPos=Xg*this.centerControlPointY+$a*t,this.hyperEdgeBottomYPos=Xg*this.centerControlPointY+$a*e):(this.centerControlPointY=Sm*(t+o),this.hyperEdgeTopYPos=Xg*this.centerControlPointY+$a*o,this.hyperEdgeBottomYPos=Xg*this.centerControlPointY+$a*t)}},e_=class{constructor(){this.startY=0,this.endY=0,this.normalSourceNode=!1,this.normalTargetNode=!1,this.invertedLeft=!1,this.invertedRight=!1}},Fe=Object.freeze({LEFT:"LEFT",RIGHT:"RIGHT"}),WT=.2,$a=.9,Xg=1-$a,Sm=.5;var zT=.2,vi=class n{constructor(){this.edgesRemainingLayer=[],this.splineSegmentsLayer=[],this.leftPortsLayer=new Set,this.rightPortsLayer=new Set,this.selfLoopsLayer=new Set,this.lGraph=null,this.startEdges=[],this.allSplineSegments=[],this.edgeToSegmentMap=new Map,this.successingEdge=new Map}getLayoutProcessorConfiguration(t){let e=K.create();e.addAll(YT());let o=t.getProperty(p.GRAPH_PROPERTIES);return o&&o.has(v.SELF_LOOPS)&&e.addAll(VT()),o&&o.has(v.CENTER_LABELS)&&e.addAll(XT()),o&&o.has(v.NORTH_SOUTH_PORTS)&&e.addAll(KT()),o&&o.has(v.END_LABELS)&&e.addAll(ZT()),e}process(t,e){if(e&&e.begin&&e.begin("Spline edge routing",1),t.getLayers().length===0){t.getSize().x=0,e&&e.done&&e.done();return}let o=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),r=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),a=t.getProperty(_.EDGE_ROUTING_SPLINES_MODE)===Qr.SLOPPY,l=t.getProperty(_.EDGE_ROUTING_SPLINES_SLOPPY_LAYER_SPACING_FACTOR);this.lGraph=t,this.startEdges=[],this.allSplineSegments=[],this.successingEdge.clear();let c=t.getLayers(),g=c[0],h=g.getNodes().every(Ls),d=c[c.length-1],f=d.getNodes().every(Ls),E=0,P=null,S,T=0;do{S=E<c.length?c[E++]:null,this._clearThenFillMappings(P,S),this._createSegmentsAndComputeRanking();let N=0;for(let A of this.splineSegmentsLayer)!A.isStraight&&A.rank+1>N&&(N=A.rank+1);let I=0,C=T,x=P===null||h&&P===g,M=S===null||f&&S===d;if(N>0){let A=0;P!==null&&(A+=r),A+=(N-1)*i,S!==null&&(A+=r),a&&S!==null&&(A=Math.max(A,n._computeSloppySpacing(S,i,o,l))),A<o&&!x&&!M&&(I=(o-A)/2,A=o),C+=A}else!x&&!M&&(C+=o);S!==null&&z.placeNodesHorizontally(S,C);for(let A of this.splineSegmentsLayer)A.boundingBox.x=T,A.boundingBox.width=C-T,A.xDelta=I,A.isWestOfInitialLayer=P===null;for(let A of this.splineSegmentsLayer)this.allSplineSegments.push(A);T=C,S!==null&&(T+=S.getSize().x),P=S}while(S!==null);for(let N of this.startEdges){let I=this._getEdgeChain(N);N.setProperty(p.SPLINE_EDGE_CHAIN,I);let C=this._getSplinePath(N);N.setProperty(p.SPLINE_ROUTE_START,C)}t.getSize().x=T,this.lGraph=null,e&&e.done&&e.done()}_createSegmentsAndComputeRanking(){this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.LEFT,!0,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.LEFT,!1,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.RIGHT,!0,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.RIGHT,!1,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegments(this.edgesRemainingLayer,this.leftPortsLayer,this.rightPortsLayer,this.splineSegmentsLayer);for(let t=0;t<this.splineSegmentsLayer.length;t++){let e=this.splineSegmentsLayer[t];for(let o=t+1;o<this.splineSegmentsLayer.length;o++){let r=this.splineSegmentsLayer[o];n._createDependency(e,r)}}n._breakCycles(this.splineSegmentsLayer,this.lGraph.getProperty(p.RANDOM)),n._topologicalNumbering(this.splineSegmentsLayer)}_clearThenFillMappings(t,e){if(this.leftPortsLayer.clear(),this.rightPortsLayer.clear(),this.edgesRemainingLayer=[],this.splineSegmentsLayer=[],this.selfLoopsLayer.clear(),t!==null)for(let o of t.getNodes())for(let r of o.getPorts(u.EAST)){this.leftPortsLayer.add(r);for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;this.edgesRemainingLayer.push(i),this._findAndAddSuccessor(i),n.isQualifiedAsStartingNode(i.getSource().getNode())&&this.startEdges.push(i);let s=i.getTarget(),a=s.getNode().getLayer();if(a===e)this.rightPortsLayer.add(s);else if(a===t)this.leftPortsLayer.add(s);else{let l=this.edgesRemainingLayer.indexOf(i);l>=0&&this.edgesRemainingLayer.splice(l,1)}}}if(e!==null)for(let o of e.getNodes()){for(let r of o.getPorts())for(let i of r.getOutgoingEdges())i.isSelfLoop()&&this.selfLoopsLayer.add(i);for(let r of o.getPorts(u.WEST)){this.rightPortsLayer.add(r);for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;this.edgesRemainingLayer.push(i),this._findAndAddSuccessor(i),n.isQualifiedAsStartingNode(i.getSource().getNode())&&this.startEdges.push(i);let s=i.getTarget(),a=s.getNode().getLayer();if(a===e)this.rightPortsLayer.add(s);else if(a===t)this.leftPortsLayer.add(s);else{let l=this.edgesRemainingLayer.indexOf(i);l>=0&&this.edgesRemainingLayer.splice(l,1)}}}}}static _computeSloppySpacing(t,e,o,r){let i=0;for(let s of t.getNodes()){let a=0;for(let l of s.getIncomingEdges()){let c=l.getSource().getAbsoluteAnchor().y,g=l.getTarget().getAbsoluteAnchor().y;a=Math.max(a,Math.abs(g-c))}i=Math.max(i,a)}return r*Math.min(1,e/o)*i}_findAndAddSuccessor(t){let e=t.getTarget().getNode();if(n.isNormalNode(e))return;let r=e.getOutgoingEdges()[Symbol.iterator]().next();r.done||this.successingEdge.set(t,r.value)}_createSplineSegments(t,e,o,r){for(let i of t){let s=i.getSource(),a;if(e.has(s))a=Fe.LEFT;else if(o.has(s))a=Fe.RIGHT;else throw new Error("Source port must be in one of the port sets.");let l=i.getTarget(),c;if(e.has(l))c=Fe.LEFT;else if(o.has(l))c=Fe.RIGHT;else throw new Error("Target port must be in one of the port sets.");let g=new Cn(i,a,c);this.edgeToSegmentMap.set(i,g),r.push(g)}}_createSplineSegmentsForHyperEdges(t,e,o,r,i,s){let a;o===Fe.LEFT?a=t:a=e;for(let l of a){let c=l.getAbsoluteAnchor().y,g=new Set,h=new Set;for(let d of l.getConnectedEdges()){if(!!d.getProperty(p.REVERSED)!=!!r||!i.includes(d))continue;let f;d.getTarget()===l?f=d.getSource():f=d.getTarget();let E=f.getAbsoluteAnchor().y;n.isStraight(E,c)||(E<c?t.has(f)?g.add(Gt.of(Fe.LEFT,d)):g.add(Gt.of(Fe.RIGHT,d)):t.has(f)?h.add(Gt.of(Fe.LEFT,d)):h.add(Gt.of(Fe.RIGHT,d)))}if(g.size>1){let d=new Cn(l,g,o);for(let f of g)this.edgeToSegmentMap.set(f.getSecond(),d);s.push(d);for(let f of g){let E=i.indexOf(f.getSecond());E>=0&&i.splice(E,1)}}if(h.size>1){let d=new Cn(l,h,o);for(let f of h)this.edgeToSegmentMap.set(f.getSecond(),d);s.push(d);for(let f of h){let E=i.indexOf(f.getSecond());E>=0&&i.splice(E,1)}}}}static _isBetween(t,e,o){return Math.abs(e-t)<1e-8||Math.abs(o-t)<1e-8?!0:e-t>1e-8?t-o>1e-8:o-t>1e-8}static _createDependency(t,e){if(t.hyperEdgeTopYPos>e.hyperEdgeBottomYPos||e.hyperEdgeTopYPos>t.hyperEdgeBottomYPos)return;let o=0,r=0;for(let i of t.rightPorts)n._isBetween(i.getAbsoluteAnchor().y,e.hyperEdgeTopYPos,e.hyperEdgeBottomYPos)&&o++;for(let i of t.leftPorts)n._isBetween(i.getAbsoluteAnchor().y,e.hyperEdgeTopYPos,e.hyperEdgeBottomYPos)&&o--;for(let i of e.rightPorts)n._isBetween(i.getAbsoluteAnchor().y,t.hyperEdgeTopYPos,t.hyperEdgeBottomYPos)&&r++;for(let i of e.leftPorts)n._isBetween(i.getAbsoluteAnchor().y,t.hyperEdgeTopYPos,t.hyperEdgeBottomYPos)&&r--;o<r?new xn(t,e,r-o):r<o?new xn(e,t,o-r):(new xn(e,t,0),new xn(t,e,0))}static _breakCycles(t,e){let o=[],r=[],i=-1;for(let d of t){d.mark=i--;let f=0,E=0;for(let P of d.outgoing)E+=P.weight;for(let P of d.incoming)f+=P.weight;d.inweight=f,d.outweight=E,E===0?r.push(d):f===0&&o.push(d)}let s=new Set(t),a=t.length,l=a+1,c=a-1,g=[];for(;s.size>0;){for(;r.length>0;){let f=r.shift();s.delete(f),f.mark=c--,n._updateNeighbors(f,o,r)}for(;o.length>0;){let f=o.shift();s.delete(f),f.mark=l++,n._updateNeighbors(f,o,r)}let d=Number.MIN_SAFE_INTEGER;for(let f of s){let E=f.outweight-f.inweight;E>=d&&(E>d&&(g.length=0,d=E),g.push(f))}if(g.length>0){let f=g[e.nextInt(g.length)];s.delete(f),f.mark=l++,n._updateNeighbors(f,o,r),g.length=0}}let h=t.length+1;for(let d of t)d.mark<a&&(d.mark+=h);for(let d of t){let f=d.outgoing.slice();for(let E of f){let P=E.target;if(d.mark>P.mark){let S=d.outgoing.indexOf(E);S>=0&&d.outgoing.splice(S,1);let T=P.incoming.indexOf(E);T>=0&&P.incoming.splice(T,1),E.weight>0&&(E.source=P,P.outgoing.push(E),E.target=d,d.incoming.push(E))}}}}static _updateNeighbors(t,e,o){for(let r of t.outgoing)r.target.mark<0&&r.weight>0&&(r.target.inweight-=r.weight,r.target.inweight<=0&&r.target.outweight>0&&e.push(r.target));for(let r of t.incoming)r.source.mark<0&&r.weight>0&&(r.source.outweight-=r.weight,r.source.outweight<=0&&r.source.inweight>0&&o.push(r.source))}static _topologicalNumbering(t){let e=[],o=[];for(let i of t)i.rank=0,i.inweight=i.incoming.length,i.outweight=i.outgoing.length,i.inweight===0&&e.push(i),i.outweight===0&&i.leftPorts.size===0&&o.push(i);let r=-1;for(;e.length>0;){let i=e.shift();for(let s of i.outgoing){let a=s.target;a.rank=Math.max(a.rank,i.rank+1),r=Math.max(r,a.rank),a.inweight--,a.inweight===0&&e.push(a)}}if(r>-1){for(let i of o)i.rank=r;for(;o.length>0;){let i=o.shift();for(let s of i.incoming){let a=s.source;a.leftPorts.size>0||(a.rank=Math.min(a.rank,i.rank-1),a.outweight--,a.outweight===0&&o.push(a))}}}}static isStraight(t,e){return Math.abs(t-e)<zT}_getEdgeChain(t){let e=[],o=t;do e.push(o),o=this.successingEdge.get(o)||null;while(o!==null);return e}_getSplinePath(t){let e=[],o=t;do{let s=this.edgeToSegmentMap.get(o);s.sourcePort=o.getSource(),s.targetPort=o.getTarget(),e.push(s),o=this.successingEdge.get(o)||null}while(o!==null);let r=e[0];r.initialSegment=!0,r.sourceNode=r.edges.values().next().value.getSource().getNode();let i=e[e.length-1];return i.lastSegment=!0,i.targetNode=i.edges.values().next().value.getTarget().getNode(),e}static isNormalNode(t){let e=t.getType();return e===y.NORMAL||e===y.BREAKING_POINT}static isQualifiedAsStartingNode(t){let e=t.getType();return e===y.NORMAL||e===y.NORTH_SOUTH_PORT||e===y.EXTERNAL_PORT||e===y.BREAKING_POINT}};vi.SPLINE_DIMENSION=3;var xn=class{constructor(t,e,o){this.source=t,this.target=e,this.weight=o,t.outgoing.push(this),e.incoming.push(this)}};function YT(){return K.create().addAfter(D.P5_EDGE_ROUTING,w.FINAL_SPLINE_BENDPOINTS_CALCULATOR).addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR)}function VT(){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER).addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER)}function XT(){return K.create().addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR).addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER)}function KT(){return K.create().addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR).addBefore(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)}function ZT(){return K.create().addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR).addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR)}var se=class{},Dn=1e-8;se.HALF_PI=Math.PI/2;se.QUATER_PI=se.HALF_PI/2;se.THREE_HALF_PI=se.HALF_PI*3;se.TWO_PI=2*Math.PI;se.THREE=3;se.intersect=function(t,e,o,r){return typeof o=="number"?se._intersect4(t,new O(o).add(t),e,new O(r).add(e)):se._intersect4(t,e,o,r)};se._intersect4=function(t,e,o,r){let i=t.x,s=t.y,a=e.x,l=e.y,c=o.x,g=o.y,h=r.x,d=r.y,f=(i-a)*(g-d)-(s-l)*(c-h);if(Math.abs(f)<Dn)return null;let E=i*l-s*a,P=c*d-g*h,S=(E*(c-h)-P*(i-a))/f,T=(E*(g-d)-P*(s-l))/f;return new O(S,T)};se.innerAngle=function(t,e){if(typeof t=="number")return Math.abs(t-e)%Math.PI;let o=t,r=e;return Math.acos((o.x*r.x+o.y*r.y)/(o.length()*r.length()))};se.lengthToOrthogonal=function(t,e){let o=se.innerAngle(t,e.toRadians()),r=1;return o>se.HALF_PI&&(r=-1,o=o-se.QUATER_PI),r*Math.cos(o)*e.length()};se.portSideToDirection=function(t){switch(t){case u.NORTH:return se.THREE_HALF_PI;case u.EAST:return 0;case u.SOUTH:return se.HALF_PI;case u.WEST:return Math.PI;default:return 0}};se.distPortToNodeEdge=function(t,e){let o=t.getPosition().clone().add(t.getAnchor()),r=t.getNode().getSize();switch(e){case u.NORTH:return-o.y;case u.EAST:return-o.x+r.x;case u.SOUTH:return-o.y+r.y;case u.WEST:return-o.x;default:return 0}};se.isBetween=function(t,e,o){return Math.abs(e-t)<Dn||Math.abs(o-t)<Dn?!0:e-t>Dn?t-o>Dn:o-t>Dn};se.getMarginOnPortSide=function(t,e){let o=t.getMargin();switch(e){case u.NORTH:return o.top;case u.EAST:return o.right;case u.SOUTH:return o.bottom;case u.WEST:return o.left;default:return 0}};var jT=.5,Tm=5,$T=.4,Kg=class n{constructor(){this.edgeEdgeSpacing=0,this.edgeNodeSpacing=0,this.splineRoutingMode=null,this.compactionStrategy=null}process(t,e){e&&e.begin&&e.begin("Spline bendpoints",1),this.edgeEdgeSpacing=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this.edgeNodeSpacing=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this.splineRoutingMode=t.getProperty(_.EDGE_ROUTING_SPLINES_MODE),this.compactionStrategy=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY),this._indexNodesPerLayer(t);let o=[];for(let r of t.getLayers())for(let i of r.getNodes())for(let s of i.getOutgoingEdges())s.isSelfLoop()||s.hasProperty(p.SPLINE_ROUTE_START)&&o.push(s);for(let r of o){let i=r.getProperty(p.SPLINE_ROUTE_START);for(let s of i)this._calculateControlPoints(s);r.setProperty(p.SPLINE_ROUTE_START,null)}for(let r of o){let i=r.getProperty(p.SPLINE_SURVIVING_EDGE),s=r.getProperty(p.SPLINE_EDGE_CHAIN);this._calculateBezierBendPoints(s,i),r.setProperty(p.SPLINE_EDGE_CHAIN,null)}e&&e.done&&e.done()}_indexNodesPerLayer(t){for(let e of t.getLayers()){let o=0;for(let r of e.getNodes())r.id=o++}}_calculateControlPoints(t){if(!t.handled){t.handled=!0;for(let e of t.edges){if(t.isStraight&&!t.isHyperEdge()){this._calculateControlPointsStraight(t);continue}let o=t.edgeInformation.get(e);if(o.invertedLeft||o.invertedRight){this._calculateControlPointsInvertedEdge(e,t);continue}this.splineRoutingMode===Qr.SLOPPY&&(o.normalSourceNode||o.normalTargetNode)&&this._segmentAllowsSloppyRouting(t)&&!t.isHyperEdge()?this._calculateControlPointsSloppy(e,t):this._calculateControlPointsConservative(e,t)}if(t.inverseOrder)for(let e of t.edges)e.getBendPoints().reverse()}}_calculateControlPointsStraight(t){let e=t.boundingBox.x,o=t.boundingBox.x+t.boundingBox.width,r=new O(e+(o-e)/2,t.centerControlPointY);t.edges.values().next().value.getBendPoints().push(r)}_calculateControlPointsInvertedEdge(t,e){let o=e.boundingBox.x,r=e.boundingBox.x+e.boundingBox.width,i=e.edgeInformation.get(t),s=i.startY,a=i.endY,l,c;i.invertedLeft?l=new O(r,s):l=new O(o,s),i.invertedRight?c=new O(o,a):c=new O(r,a);let g=o;e.isWestOfInitialLayer||(g+=this.edgeNodeSpacing),g+=e.xDelta+e.rank*this.edgeEdgeSpacing;let h=new O(g,s),d=new O(g,a),f=t.getBendPoints();if(f.push(l,h),e.edges.size>1){let P=new O(g,e.centerControlPointY);f.push(P)}f.push(d,c)}_calculateControlPointsConservative(t,e){let o=e.boundingBox.x,r=e.boundingBox.x+e.boundingBox.width,i=e.edgeInformation.get(t),s=i.startY,a=i.endY,l=new O(o,s),c=new O(r,a),g=o;e.isWestOfInitialLayer||(g+=this.edgeNodeSpacing),g+=e.xDelta+e.rank*this.edgeEdgeSpacing;let h=new O(g,s),d=new O(g,a),f=t.getBendPoints();if(f.push(l,h),e.edges.size>1){let P=new O(g,e.centerControlPointY);f.push(P)}f.push(d,c)}_calculateControlPointsSloppy(t,e){let o=e.edgeInformation.get(t),r=e.boundingBox.x,i=e.boundingBox.x+e.boundingBox.width,s=o.startY,a=o.endY,l=s<a,c=new O(r,s),g=new O(i,a),h=(r+i)/2,d=new O(h,s),f=new O(h,a),E=this._computeSloppyCenterY(t,s,a),P=e.sourcePort.getAbsoluteAnchor(),S=new O(h,E),T=e.targetPort.getAbsoluteAnchor(),N=Ft.approximateBezierSegment(2,P,S,T),I=!1,C=e.sourcePort.getNode();if(C!==null&&C.getLayer()!==null&&o.normalSourceNode)if(!(l&&C.id<C.getLayer().getNodes().length-1||!l&&C.id>0))I=!0;else{let Y=C.id;l?Y++:Y--;let j=C.getLayer().getNodes()[Y],X=n._nodeToBoundingBox(j);I=!(Ft.intersects(X,P,N[0])||Ft.contains(X,P,N[0]))}let x=!1,M=e.targetPort.getNode();if(M!==null&&M.getLayer()!==null&&o.normalTargetNode)if(!(l&&M.id>0||!l&&M.id<M.getLayer().getNodes().length-1))x=!0;else{let Y=M.id;l?Y--:Y++;let j=M.getLayer().getNodes()[Y],X=n._nodeToBoundingBox(j);x=!(Ft.intersects(X,N[0],T)||Ft.contains(X,N[0],T))}let A=t.getBendPoints();I&&x&&A.push(S),I||A.push(c,d),x||A.push(f,g)}static _nodeToBoundingBox(t){let e=t.getPosition(),o=t.getSize(),r=t.getMargin();return new dt(e.x-r.left,e.y-r.top,o.x+r.getHorizontal(),o.y+r.getVertical())}_computeSloppyCenterY(t,e,o){let r=0,i=0;if(t.getSource()!==null)for(let a of t.getTarget().getNode().getPorts())r+=a.getIncomingEdges().length;else r=1;if(t.getTarget()!==null)for(let a of t.getSource().getNode().getPorts())i+=a.getOutgoingEdges().length;else i=1;let s=Math.sign(i-r);return(o+e)/2+(o-e)*($T*s)}_calculateBezierBendPoints(t,e){if(!t||t.length===0)return;let o=new st,r=e!=null?e:t[0],i=r.getSource();if(!vi.isQualifiedAsStartingNode(i.getNode()))throw new Error("The source node of the edge must be a normal node or a northSouthPort.");if(o.addLast(i.getAbsoluteAnchor()),u.SIDES_NORTH_SOUTH.has(i.getSide())){let d=i.getProperty(p.SPLINE_NS_PORT_Y_COORD),f=new O(i.getAbsoluteAnchor().x,d);o.addLast(f)}let s=null,a=!1;for(let d of t){let f=d.getBendPoints();if(f.length>0){if(a){let E=s.add(f.getFirst()).scale(jT);o.addLast(E),a=!1}else a=!0;s=f.getLast().clone();for(let E of f)o.addLast(E);f.length=0}}let l=r.getTarget();if(u.SIDES_NORTH_SOUTH.has(l.getSide())){let d=l.getProperty(p.SPLINE_NS_PORT_Y_COORD),f=new O(l.getAbsoluteAnchor().x,d);o.addLast(f)}o.addLast(l.getAbsoluteAnchor()),this.splineRoutingMode===Qr.CONSERVATIVE&&n._insertStraighteningControlPoints(o,i,l);let g=new Rs(!0,vi.SPLINE_DIMENSION,o).getBezierCP(),h=r.getBendPoints();for(let d of g)h.push(d)}static _insertStraighteningControlPoints(t,e,o){let r=t.getFirst(),i=t[1],s=new O(se.portSideToDirection(e.getSide()));s.scale(Tm);let a=i.clone().sub(r),l=new O(n._absMin(s.x,a.x),n._absMin(s.y,a.y));l.add(r),t.splice(1,0,l);let c=t.getLast(),g=t[t.length-2];s=new O(se.portSideToDirection(o.getSide())),s.scale(Tm),a=g.clone().sub(c);let h=new O(n._absMin(s.x,a.x),n._absMin(s.y,a.y));h.add(c),t.splice(t.length-1,0,h)}static _absMin(t,e){return Math.abs(t)<Math.abs(e)?t:e}_segmentAllowsSloppyRouting(t){if(this.compactionStrategy===re.NONE)return!0;let e=t.boundingBox.x,o=t.boundingBox.x+t.boundingBox.width;if(t.initialSegment){let r=t.sourceNode,i=n._segmentNodeDistanceThreshold(r);if(e-(r.getPosition().x+r.getSize().x)>i)return!1}if(t.lastSegment){let r=t.targetNode,i=n._segmentNodeDistanceThreshold(r);if(r.getPosition().x-o>i)return!1}return!0}static _segmentNodeDistanceThreshold(t){return t.getLayer().getSize().x-t.getSize().x/2}};var jo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};jo.ROTATION=new jo("ROTATION");jo.READING_DIRECTION=new jo("READING_DIRECTION");var jt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};jt.NONE=new jt("NONE");jt.TOP=new jt("TOP");jt.BOTTOM=new jt("BOTTOM");var wn=class{constructor(t){this._mode=t}process(t,e){e.begin(`Graph transformation (${this._mode})`,1);let o=[...t.getLayerlessNodes()];for(let a of t.getLayers())for(let l of a.getNodes())o.push(l);let r=t.getProperty(_.DIRECTION_CONGRUENCY),i=t.getProperty(_.DIRECTION),s=i!=null&&i.name?i.name:null;if(r===jo.READING_DIRECTION||r==="READING_DIRECTION")switch(s){case"LEFT":qa(t,o);break;case"DOWN":Ja(t,o);break;case"UP":this._mode===$o.TO_INTERNAL_LTR?(Ja(t,o),Zg(t,o)):(Zg(t,o),Ja(t,o));break;default:break}else if(this._mode===$o.TO_INTERNAL_LTR)switch(s){case"LEFT":qa(t,o),Zg(t,o);break;case"DOWN":Nm(t,o);break;case"UP":ym(t,o);break;default:break}else switch(s){case"LEFT":qa(t,o),Zg(t,o);break;case"DOWN":ym(t,o);break;case"UP":Nm(t,o);break;default:break}e.done()}},$o=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};$o.TO_INTERNAL_LTR=new $o("TO_INTERNAL_LTR");$o.TO_INPUT_DIRECTION=new $o("TO_INPUT_DIRECTION");wn.Mode=$o;function Nm(n,t){Ja(n,t),qa(n,t)}function ym(n,t){qa(n,t),Ja(n,t)}function qa(n,t){qT(t,n),o_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&o_(e)}function Zg(n,t){QT(t,n),r_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&r_(e)}function Ja(n,t){eN(t),oN(n),_o(n.getOffset()),_o(n.getSize()),i_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&i_(e)}function qT(n,t){let e=0;if(t.getSize().x===0)for(let o of n){let r=o.getPosition().x+o.getSize().x+o.getMargin().right;r>e&&(e=r)}else e=t.getSize().x-t.getOffset().x;e-=t.getOffset().x;for(let o of n){switch(ti(o.getPosition(),e-o.getSize().x),o_(o.getPadding()),Im(o),o.hasProperty(_.POSITION)&&ti(o.getProperty(_.POSITION),e-o.getSize().x),o.getProperty(_.ALIGNMENT)){case Kt.LEFT:o.setProperty(_.ALIGNMENT,Kt.RIGHT);break;case Kt.RIGHT:o.setProperty(_.ALIGNMENT,Kt.LEFT);break;default:break}let r=o.getSize();for(let i of o.getPorts()){ti(i.getPosition(),r.x-i.getSize().x),ti(i.getAnchor(),i.getSize().x),i.setSide(Rm(i.getSide())),s_(i);for(let s of i.getOutgoingEdges()){for(let l of s.getBendPoints())ti(l,e);let a=s.getProperty(_.JUNCTION_POINTS);if(a!=null)for(let l of a)ti(l,e);for(let l of s.getLabels())ti(l.getPosition(),e-l.getSize().x)}for(let s of i.getLabels())ti(s.getPosition(),i.getSize().x-s.getSize().x)}o.getType()===y.EXTERNAL_PORT&&(o.setProperty(p.EXT_PORT_SIDE,Rm(o.getProperty(p.EXT_PORT_SIDE))),JT(o));for(let i of o.getLabels())Im(i),ti(i.getPosition(),r.x-i.getSize().x)}}function ti(n,t){n.x=t-n.x}function o_(n){if(n==null)return;let t=n.left;n.left=n.right,n.right=t}function Im(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);t!=null&&(t.has(k.H_LEFT)?(t.delete(k.H_LEFT),t.add(k.H_RIGHT)):t.has(k.H_RIGHT)&&(t.delete(k.H_RIGHT),t.add(k.H_LEFT)))}function Rm(n){return n===u.EAST?u.WEST:n===u.WEST?u.EAST:n}function JT(n){switch(n.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST);break;case J.FIRST_SEPARATE:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE);break;case J.LAST:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST);break;case J.LAST_SEPARATE:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE);break;default:break}}function QT(n,t){let e=0;if(t.getSize().y===0)for(let o of n){let r=o.getPosition().y+o.getSize().y+o.getMargin().bottom;r>e&&(e=r)}else e=t.getSize().y-t.getOffset().y;e-=t.getOffset().y;for(let o of n){switch(ei(o.getPosition(),e-o.getSize().y),r_(o.getPadding()),Lm(o),o.hasProperty(_.POSITION)&&ei(o.getProperty(_.POSITION),e-o.getSize().y),o.getProperty(_.ALIGNMENT)){case Kt.TOP:o.setProperty(_.ALIGNMENT,Kt.BOTTOM);break;case Kt.BOTTOM:o.setProperty(_.ALIGNMENT,Kt.TOP);break;default:break}let r=o.getSize();for(let i of o.getPorts()){ei(i.getPosition(),r.y-i.getSize().y),ei(i.getAnchor(),i.getSize().y),i.setSide(Am(i.getSide())),s_(i);for(let s of i.getOutgoingEdges()){for(let l of s.getBendPoints())ei(l,e);let a=s.getProperty(_.JUNCTION_POINTS);if(a!=null)for(let l of a)ei(l,e);for(let l of s.getLabels())ei(l.getPosition(),e-l.getSize().y)}for(let s of i.getLabels())ei(s.getPosition(),i.getSize().y-s.getSize().y)}o.getType()===y.EXTERNAL_PORT&&(o.setProperty(p.EXT_PORT_SIDE,Am(o.getProperty(p.EXT_PORT_SIDE))),tN(o));for(let i of o.getLabels())Lm(i),ei(i.getPosition(),r.y-i.getSize().y)}}function ei(n,t){n.y=t-n.y}function r_(n){if(n==null)return;let t=n.top;n.top=n.bottom,n.bottom=t}function Lm(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);t!=null&&(t.has(k.V_TOP)?(t.delete(k.V_TOP),t.add(k.V_BOTTOM)):t.has(k.V_BOTTOM)&&(t.delete(k.V_BOTTOM),t.add(k.V_TOP)))}function Am(n){return n===u.NORTH?u.SOUTH:n===u.SOUTH?u.NORTH:n}function tN(n){let t=n.getProperty(p.IN_LAYER_CONSTRAINT);t===jt.TOP?n.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM):t===jt.BOTTOM&&n.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP)}function eN(n){for(let t of n){_o(t.getPosition()),_o(t.getSize()),i_(t.getPadding()),Cm(t),iN(t);for(let e of t.getPorts()){_o(e.getPosition()),_o(e.getAnchor()),_o(e.getSize()),e.setSide(xm(e.getSide())),s_(e);for(let o of e.getOutgoingEdges()){for(let i of o.getBendPoints())_o(i);let r=o.getProperty(_.JUNCTION_POINTS);if(r!=null)for(let i of r)_o(i);for(let i of o.getLabels())_o(i.getPosition()),_o(i.getSize())}for(let o of e.getLabels())_o(o.getPosition()),_o(o.getSize())}t.getType()===y.EXTERNAL_PORT&&(t.setProperty(p.EXT_PORT_SIDE,xm(t.getProperty(p.EXT_PORT_SIDE))),rN(t));for(let e of t.getLabels())Cm(e),_o(e.getSize()),_o(e.getPosition())}}function _o(n){let t=n.x;n.x=n.y,n.y=t}function i_(n){if(n==null)return;let t=n.top,e=n.bottom,o=n.left,r=n.right;n.top=o,n.bottom=r,n.left=t,n.right=e}function Cm(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);if(t==null||t.size===0)return;let e=new Set;t.has(k.INSIDE)?e.add(k.INSIDE):e.add(k.OUTSIDE),t.has(k.H_PRIORITY)||e.add(k.H_PRIORITY),t.has(k.H_LEFT)?e.add(k.V_TOP):t.has(k.H_CENTER)?e.add(k.V_CENTER):t.has(k.H_RIGHT)&&e.add(k.V_BOTTOM),t.has(k.V_TOP)?e.add(k.H_LEFT):t.has(k.V_CENTER)?e.add(k.H_CENTER):t.has(k.V_BOTTOM)&&e.add(k.H_RIGHT),n.setProperty(_.NODE_LABELS_PLACEMENT,e)}function xm(n){switch(n){case u.NORTH:return u.WEST;case u.WEST:return u.NORTH;case u.SOUTH:return u.EAST;case u.EAST:return u.SOUTH;default:return u.UNDEFINED}}function oN(n){let t=n.getProperty(_.EDGE_LABELS_SIDE_SELECTION);t!=null&&typeof t.transpose=="function"&&n.setProperty(_.EDGE_LABELS_SIDE_SELECTION,t.transpose())}function rN(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT),e=n.getProperty(p.IN_LAYER_CONSTRAINT);t===J.FIRST_SEPARATE?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.NONE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP)):t===J.LAST_SEPARATE?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.NONE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM)):e===jt.TOP?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.NONE)):e===jt.BOTTOM&&(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.NONE))}function iN(n){let t=n.getProperty(_.NODE_SIZE_MINIMUM);switch(t!=null&&n.setProperty(_.NODE_SIZE_MINIMUM,new O(t.y,t.x)),n.getProperty(_.ALIGNMENT)){case Kt.LEFT:n.setProperty(_.ALIGNMENT,Kt.TOP);break;case Kt.RIGHT:n.setProperty(_.ALIGNMENT,Kt.BOTTOM);break;case Kt.TOP:n.setProperty(_.ALIGNMENT,Kt.LEFT);break;case Kt.BOTTOM:n.setProperty(_.ALIGNMENT,Kt.RIGHT);break;default:break}if(n.hasProperty(_.POSITION)){let e=n.getProperty(_.POSITION),o=e.x;e.x=e.y,e.y=o}}function s_(n){let t=n.getProperty(_.PORT_INDEX);t!=null&&n.setProperty(_.PORT_INDEX,-t)}var jg=class{process(t,e){e.begin("Resize child graph to fit parent.",1);for(let o of t){for(let r of o.getNodes())t.getLayerlessNodes().push(r);o.getNodes().length=0}for(let o of t.getLayerlessNodes())o.setLayer(null);t.getLayers().length=0,this._resizeGraph(t),t.getParentNode()!=null&&this._graphLayoutToNode(t.getParentNode(),t),e.done()}_graphLayoutToNode(t,e){for(let i of e.getLayerlessNodes()){let s=i.getProperty(p.ORIGIN);if(s instanceof rt){let a=s,l=z.getExternalPortPosition(e,i,a.getSize().x,a.getSize().y);a.getPosition().x=l.x,a.getPosition().y=l.y,a.setSide(i.getProperty(p.EXT_PORT_SIDE))}}let o=e.getActualSize();e.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)?(t.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),t.getGraph().getProperty(p.GRAPH_PROPERTIES).add(v.NON_FREE_PORTS),z.resizeNode(t,o,!1,!0)):z.resizeNode(t,o,!0,!0)}_resizeGraph(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS),o=t.getProperty(_.NODE_SIZE_OPTIONS),r=t.getActualSize(),i=new O(r.x,r.y);if(e!=null&&e.has(mt.MINIMUM_SIZE)){let s=new O(0,0),a=t.getProperty(_.NODE_SIZE_MINIMUM);a!=null&&(s.x=a.x||0,s.y=a.y||0),o!=null&&o.has(Nt.DEFAULT_MINIMUM_SIZE)&&(s.x<=0&&(s.x=es),s.y<=0&&(s.y=os)),i.x=Math.max(r.x,s.x),i.y=Math.max(r.y,s.y)}this._resizeGraphNoReallyIMeanIt(t,r,i)}_resizeGraphNoReallyIMeanIt(t,e,o){let r=t.getProperty(_.CONTENT_ALIGNMENT);if(o.x>e.x&&r!=null&&(r.has(he.H_CENTER)?t.getOffset().x+=(o.x-e.x)/2:r.has(he.H_RIGHT)&&(t.getOffset().x+=o.x-e.x)),o.y>e.y&&r!=null&&(r.has(he.V_CENTER)?t.getOffset().y+=(o.y-e.y)/2:r.has(he.V_BOTTOM)&&(t.getOffset().y+=o.y-e.y)),t.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)&&(o.x>e.x||o.y>e.y))for(let a of t.getLayerlessNodes()){if(a.getType()!==y.EXTERNAL_PORT)continue;let l=a.getProperty(p.EXT_PORT_SIDE);l===u.EAST?a.getPosition().x+=o.x-e.x:l===u.SOUTH&&(a.getPosition().y+=o.y-e.y)}let s=t.getPadding();t.getSize().x=o.x-s.left-s.right,t.getSize().y=o.y-s.top-s.bottom}};var Et=class extends br{constructor(t){super(),this._owner=t,this._size=new O,this._nodes=[]}getSize(){return this._size}getNodes(){return this._nodes}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}getGraph(){return this._owner}getIndex(){return this._owner.getLayers().indexOf(this)}toString(){return`L_${this.getIndex()}[${this._nodes.join(",")}]`}};var $g=class{process(t,e){e.begin("Hierarchical port constraint processing",1),lN(t),cN(t),e.done()}},sN=0,nN=1;function aN(n,t){let e=n.getType();if(t.getType()!==y.EXTERNAL_PORT)return-1;if(e!==y.EXTERNAL_PORT)return 1;let r=n.getProperty(p.PORT_RATIO_OR_POSITION),i=t.getProperty(p.PORT_RATIO_OR_POSITION);return r===i?0:r<i?-1:1}function lN(n){if(!n.getProperty(_.PORT_CONSTRAINTS).isOrderFixed())return;let t=n.getLayers();t.length!==0&&(Dm(t[0]),Dm(t[t.length-1]))}function Dm(n){let t=z.toNodeArray(n.getNodes());t.sort(aN);let e=null;for(let o of t){if(o.getType()!==y.EXTERNAL_PORT)break;let r=o.getProperty(p.EXT_PORT_SIDE);r!==u.WEST&&r!==u.EAST||(e!=null&&e.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(o),e=o)}}function cN(n){if(!n.getProperty(_.PORT_CONSTRAINTS).isSideFixed())return;let e=n.getLayers(),o=e.length,r=[new Map,new Map],i=[[],[]],s=[];for(let a=0;a<o;a++){let l=e[a],c=r[a],g=new Map;r.push(g);let h=i[a],d=[];i.push(d);for(let f of l){if(n_(f)){s.push(f);continue}for(let E of z.toEdgeArray(f.getIncomingEdges())){let P=E.getSource().getNode();if(!n_(P))continue;let S=P.getProperty(p.ORIGIN),T=c.get(S);T==null&&(T=wm(n,P),c.set(S,T),h.push(T)),E.setSource(T.getPorts()[nN])}for(let E of z.toEdgeArray(f.getOutgoingEdges())){let P=E.getTarget().getNode();if(!n_(P))continue;let S=P.getProperty(p.ORIGIN),T=g.get(S);T==null&&(T=wm(n,P),g.set(S,T),d.push(T)),E.setTarget(T.getPorts()[sN])}}}for(let a=0;a<i.length;a++){let l=i[a];if(l.length===0)continue;let c;a===0?(c=new Et(n),e.unshift(c)):a===r.length-1?(c=new Et(n),e.push(c)):c=e[a-1];for(let g of l)g.setLayer(c)}for(let a of s)a.setLayer(null);n.setProperty(p.EXT_PORT_REPLACED_DUMMIES,s)}function n_(n){if(n.getType()!==y.EXTERNAL_PORT)return!1;let t=n.getProperty(p.EXT_PORT_SIDE);return t===u.NORTH||t===u.SOUTH}function wm(n,t){let e=new ft(n);e.copyProperties(t),e.setProperty(p.EXT_PORT_REPLACED_DUMMY,t),e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),e.setProperty(_.ALIGNMENT,Kt.CENTER),e.setType(y.EXTERNAL_PORT);let o=new rt;o.setNode(e),o.setSide(u.WEST);let r=new rt;return r.setNode(e),r.setSide(u.EAST),e}var _e=class extends br{constructor(){super(),this._bendPoints=new st,this._source=null,this._target=null,this._labels=[]}reverse(t,e){let o=this.getSource(),r=this.getTarget();this.setSource(null),this.setTarget(null),e&&r!=null&&r.getProperty(p.INPUT_COLLECT)?this.setSource(z.provideCollectorPort(t,r.getNode(),W.OUTPUT,u.EAST)):this.setSource(r),e&&o!=null&&o.getProperty(p.OUTPUT_COLLECT)?this.setTarget(z.provideCollectorPort(t,o.getNode(),W.INPUT,u.WEST)):this.setTarget(o);for(let s of this._labels){let a=s.getProperty(_.EDGE_LABELS_PLACEMENT);a===St.TAIL?s.setProperty(_.EDGE_LABELS_PLACEMENT,St.HEAD):a===St.HEAD&&s.setProperty(_.EDGE_LABELS_PLACEMENT,St.TAIL)}let i=this.getProperty(p.REVERSED);this.setProperty(p.REVERSED,!i),this._bendPoints=st.reverse(this._bendPoints)}getSource(){return this._source}setSource(t){if(this._source!=null){let e=this._source.getOutgoingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._source=t,this._source!=null&&this._source.getOutgoingEdges().push(this)}getTarget(){return this._target}setTarget(t){if(this._target!=null){let e=this._target.getIncomingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._target=t,this._target!=null&&this._target.getIncomingEdges().push(this)}setTargetAndInsertAtIndex(t,e){if(this._target!=null){let o=this._target.getIncomingEdges(),r=o.indexOf(this);r>=0&&o.splice(r,1)}this._target=t,this._target!=null&&this._target.getIncomingEdges().splice(e,0,this)}isSelfLoop(){if(this._source==null||this._target==null)return!1;let t=this._source.getNode();return t!=null&&t===this._target.getNode()}isInLayerEdge(){return!this.isSelfLoop()&&this._source.getNode().getLayer()===this._target.getNode().getLayer()}getBendPoints(){return this._bendPoints}getLabels(){return this._labels}getOther(t){if(t===this._source)return this._target;if(t===this._target)return this._source;if(this._source!=null&&t===this._source.getNode())return this._target.getNode();if(this._target!=null&&t===this._target.getNode())return this._source.getNode();throw new Error("'portOrNode' must be either the source or target of the edge.")}getDesignation(){return this._labels.length>0&&this._labels[0].getText()?this._labels[0].getText():super.getDesignation()}toString(){let t="e_",e=this.getDesignation();return e!=null&&(t+=e),this._source!=null&&this._target!=null&&(t+=` ${this._source.getDesignation()}[${this._source.getNode()}]`,t+=` -> ${this._target.getDesignation()}[${this._target.getNode()}]`),t}};var oi=class{static adapt(t,e=!1,o=!1,r=()=>!0){return new a_(t,e,o,r)}static adaptNode(t,e){return new Mn(null,t,e)}static adaptLabel(t){return new bn(t)}},Qa=class{constructor(t){this._element=t}getElement(){return this._element}getSize(){return this._element.getSize()}setSize(t){this._element.getSize().x=t.x,this._element.getSize().y=t.y}getPosition(){return this._element.getPosition()}setPosition(t){this._element.getPosition().x=t.x,this._element.getPosition().y=t.y}getProperty(t){return this._element.getProperty(t)}hasProperty(t){return this._element.hasProperty(t)}getVolatileId(){return this._element.id}setVolatileId(t){this._element.id=t}},a_=class{constructor(t,e,o,r){this._element=t,this._transparentNorthSouthEdges=e,this._transparentCommentNodes=o,this._nodeFilter=r,this._nodeAdapters=null}getSize(){return this._element.getSize()}setSize(t){this._element.getSize().x=t.x,this._element.getSize().y=t.y}getPosition(){throw new Error("Not supported by LGraph")}setPosition(){throw new Error("Not supported by LGraph")}getProperty(t){return this._element.getProperty(t)}hasProperty(t){return this._element.hasProperty(t)}getVolatileId(){return this._element.id}setVolatileId(t){this._element.id=t}getNodes(){if(this._nodeAdapters==null){this._nodeAdapters=[];for(let t of this._element.getLayers())for(let e of t.getNodes())if(this._nodeFilter(e)&&(this._nodeAdapters.push(new Mn(this,e,this._transparentNorthSouthEdges)),this._transparentCommentNodes)){if(e.hasProperty(p.TOP_COMMENTS))for(let o of e.getProperty(p.TOP_COMMENTS))this._nodeAdapters.push(new Mn(this,o,!1));if(e.hasProperty(p.BOTTOM_COMMENTS))for(let o of e.getProperty(p.BOTTOM_COMMENTS))this._nodeAdapters.push(new Mn(this,o,!1))}}return this._nodeAdapters}},Mn=class extends Qa{constructor(t,e,o){super(e),this._parentGraphAdapter=t,this._transparentNorthSouthEdges=o,this._labelAdapters=null,this._portAdapters=null}getGraph(){return this._parentGraphAdapter}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}getPorts(){if(this._portAdapters==null){this._portAdapters=[];for(let t of this._element.getPorts())this._portAdapters.push(new l_(t,this._transparentNorthSouthEdges))}return this._portAdapters}getIncomingEdges(){return[]}getOutgoingEdges(){return[]}sortPortList(t){let e=t||gN;this._element.getProperty(_.PORT_CONSTRAINTS).isOrderFixed()&&this._element.getPorts().sort(e)}isCompoundNode(){return this._element.getProperty(p.COMPOUND_NODE)}getPadding(){let t=this._element.getPadding();return new yt(t.top,t.right,t.bottom,t.left)}setPadding(t){let e=this._element.getPadding();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}getMargin(){let t=this._element.getMargin();return new me(t.top,t.right,t.bottom,t.left)}setMargin(t){let e=this._element.getMargin();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}},l_=class extends Qa{constructor(t,e){super(t),this._transparentNorthSouthEdges=e,this._labelAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getSide(){return this._element.getSide()}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}getMargin(){let t=this._element.getMargin?this._element.getMargin():{top:0,right:0,bottom:0,left:0};return new me(t.top,t.right,t.bottom,t.left)}setMargin(t){if(!this._element.getMargin)return;let e=this._element.getMargin();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}getIncomingEdges(){if(this._transparentNorthSouthEdges&&this._element.getNode().getType()===y.NORTH_SOUTH_PORT)return[];if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let e of this._element.getIncomingEdges())this._incomingEdgeAdapters.push(new Bi(e));if(this._transparentNorthSouthEdges){let e=this._element.getProperty(p.PORT_DUMMY);if(e!=null)for(let o of e.getIncomingEdges())this._incomingEdgeAdapters.push(new Bi(o))}let t=this._element.getNode();if(t.hasProperty(p.SELF_LOOP_HOLDER)){let o=t.getProperty(p.SELF_LOOP_HOLDER).getSLPortMap().get(this._element);if(o!=null)for(let r of o.getIncomingSLEdges())this._incomingEdgeAdapters.push(new Bi(r.getLEdge()))}}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._transparentNorthSouthEdges&&this._element.getNode().getType()===y.NORTH_SOUTH_PORT)return[];if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let e of this._element.getOutgoingEdges())this._outgoingEdgeAdapters.push(new Bi(e));if(this._transparentNorthSouthEdges){let e=this._element.getProperty(p.PORT_DUMMY);if(e!=null)for(let o of e.getOutgoingEdges())this._outgoingEdgeAdapters.push(new Bi(o))}let t=this._element.getNode();if(t.hasProperty(p.SELF_LOOP_HOLDER)){let o=t.getProperty(p.SELF_LOOP_HOLDER).getSLPortMap().get(this._element);if(o!=null)for(let r of o.getOutgoingSLEdges())this._outgoingEdgeAdapters.push(new Bi(r.getLEdge()))}}return this._outgoingEdgeAdapters}hasCompoundConnections(){return this._element.getProperty(p.INSIDE_CONNECTIONS)}},bn=class extends Qa{constructor(t){super(t)}getSide(){return this._element.getProperty(Vt.LABEL_SIDE)}getText(){return this._element.getText?this._element.getText():""}},Bi=class{constructor(t){this._element=t,this._labelAdapters=null}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}},gN=(n,t)=>{let e=n.getSide().ordinal()-t.getSide().ordinal();if(e!==0)return e;let o=n.getProperty(_.PORT_INDEX),r=t.getProperty(_.PORT_INDEX);if(o!=null&&r!=null){let i=o-r;if(i!==0)return i}switch(n.getSide().toString()){case"NORTH":return n.getPosition().x-t.getPosition().x;case"EAST":return n.getPosition().y-t.getPosition().y;case"SOUTH":return t.getPosition().x-n.getPosition().x;case"WEST":return t.getPosition().y-n.getPosition().y;default:throw new Error("Port side is undefined")}};var qg=class{constructor(){this._northernExtPortEdgeRoutingHeight=0}process(t,e){e&&e.begin&&e.begin("Orthogonally routing hierarchical port edges",1),this._northernExtPortEdgeRoutingHeight=0;let o=this._restoreNorthSouthDummies(t);this._setNorthSouthDummyCoordinates(t,o),this._routeEdges(e,t,o),this._removeTemporaryNorthSouthDummies(t),this._fixCoordinates(t),this._correctSlantedEdgeSegments(t),e&&e.done&&e.done()}_restoreNorthSouthDummies(t){let e=[];if(!t.hasProperty(p.EXT_PORT_REPLACED_DUMMIES))return e;for(let i of t.getProperty(p.EXT_PORT_REPLACED_DUMMIES))this._restoreDummy(i,t),e.push(i);for(let i of t.getLayers())for(let s of i.getNodes()){if(s.getType()!==y.EXTERNAL_PORT)continue;let a=s.getProperty(p.EXT_PORT_REPLACED_DUMMY);a!=null&&this._connectNodeToDummy(t,s,a)}let o=t.getLayers(),r=o[o.length-1];for(let i of e)i.setLayer(r);return e}_restoreDummy(t,e){let o=t.getProperty(p.EXT_PORT_SIDE),r=t.getPorts()[0];o===u.NORTH?r.setSide(u.SOUTH):o===u.SOUTH&&r.setSide(u.NORTH);let i=e.getProperty(_.NODE_SIZE_CONSTRAINTS);if(i!=null&&i.has&&i.has(mt.PORT_LABELS)){let s=t.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL)||0,a=t.getProperty(_.SPACING_LABEL_PORT_VERTICAL)||0,l=t.getProperty(_.SPACING_LABEL_LABEL)||0,c=e.getProperty(_.PORT_LABELS_PLACEMENT);if(c!=null&&c.has){if(c.has(it.INSIDE)){let g=a,h=t.getSize().x/2-r.getPosition().x;for(let d of r.getLabels())d.getPosition().y=g,d.getPosition().x=h-d.getSize().x/2,g+=d.getSize().y+l}else if(c.has(it.OUTSIDE))for(let g of r.getLabels())g.getPosition().x=s+t.getSize().x-r.getPosition().x}No.getNodeMarginCalculator(oi.adapt(e,!1)).processNode(oi.adapt(t,!1))}}_connectNodeToDummy(t,e,o){let r=new rt;r.setNode(e);let i=e.getProperty(p.EXT_PORT_SIDE);r.setSide(i);let s=o.getPorts()[0],a=new _e;a.setSource(r),a.setTarget(s)}_setNorthSouthDummyCoordinates(t,e){let o=t.getProperty(_.PORT_CONSTRAINTS),r=t.getSize(),i=t.getPadding(),s=r.x+i.left+i.right,a=0-i.top-t.getOffset().y,l=r.y+i.top+i.bottom-t.getOffset().y,c=[],g=[];for(let h of e){o===H.FREE||o===H.FIXED_SIDE||o===H.FIXED_ORDER?this._calculateNorthSouthDummyPositions(h):o===H.FIXED_RATIO?(this._applyNorthSouthDummyRatio(h,s),h.borderToContentAreaCoordinates(!0,!1)):o===H.FIXED_POS&&(this._applyNorthSouthDummyPosition(h),h.borderToContentAreaCoordinates(!0,!1),r.x=Math.max(r.x,h.getPosition().x+h.getSize().x/2));let d=h.getProperty(p.EXT_PORT_SIDE);d===u.NORTH?(h.getPosition().y=a,c.push(h)):d===u.SOUTH&&(h.getPosition().y=l,g.push(h))}o===H.FREE||o===H.FIXED_SIDE?(this._ensureUniquePositions(c,t),this._ensureUniquePositions(g,t)):o===H.FIXED_ORDER&&(this._restoreProperOrder(c,t),this._restoreProperOrder(g,t))}_calculateNorthSouthDummyPositions(t){let e=t.getPorts()[0];if(e.getDegree()===0){t.getPosition().x=0;return}let o=0;for(let s of e.getConnectedPorts())o+=s.getNode().getPosition().x+s.getPosition().x+s.getAnchor().x;let r=t.getProperty(_.PORT_ANCHOR),i=r==null?0:r.x;t.getPosition().x=o/e.getDegree()-i}_applyNorthSouthDummyRatio(t,e){let o=t.getProperty(_.PORT_ANCHOR),r=o==null?0:o.x;t.getPosition().x=e*t.getProperty(p.PORT_RATIO_OR_POSITION)-r}_applyNorthSouthDummyPosition(t){let e=t.getProperty(_.PORT_ANCHOR),o=e==null?0:e.x;t.getPosition().x=t.getProperty(p.PORT_RATIO_OR_POSITION)-o}_ensureUniquePositions(t,e){if(t.length===0)return;let o=z.toNodeArray(t);o.sort((r,i)=>r.getPosition().x-i.getPosition().x),this._assignAscendingCoordinates(o,e)}_restoreProperOrder(t,e){if(t.length===0)return;let o=z.toNodeArray(t);o.sort((r,i)=>r.getProperty(p.PORT_RATIO_OR_POSITION)-i.getProperty(p.PORT_RATIO_OR_POSITION)),this._assignAscendingCoordinates(o,e)}_assignAscendingCoordinates(t,e){let o=e.getProperty(_.SPACING_PORT_PORT)||10,r=t[0].getPosition().x+t[0].getSize().x+t[0].getMargin().right+o;for(let i=1;i<t.length;i++){let s=t[i].getPosition(),a=t[i].getSize(),l=t[i].getMargin(),c=s.x-l.left-r;c<0&&(s.x-=c);let g=e.getSize();g.x=Math.max(g.x,s.x+a.x),r=s.x+a.x+l.right+o}}_routeEdges(t,e,o){let r=new Set,i=new Set,s=new Set,a=new Set,l=e.getProperty(_.SPACING_NODE_NODE),c=e.getProperty(_.SPACING_EDGE_EDGE);for(let g of o){let h=g.getProperty(p.EXT_PORT_SIDE);if(h===u.NORTH){i.add(g);for(let d of g.getIncomingEdges())r.add(d.getSource().getNode())}else if(h===u.SOUTH){a.add(g);for(let d of g.getIncomingEdges())s.add(d.getSource().getNode())}}if(r.size>0){let h=new ie(qe.SOUTH_TO_NORTH,c,"extnorth").routeEdges(t,e,r,0,i,-l-e.getOffset().y);h>0&&(this._northernExtPortEdgeRoutingHeight=l+(h-1)*c,e.getOffset().y+=this._northernExtPortEdgeRoutingHeight,e.getSize().y+=this._northernExtPortEdgeRoutingHeight)}if(s.size>0){let h=new ie(qe.NORTH_TO_SOUTH,c,"extsouth").routeEdges(t,e,s,0,a,e.getSize().y+l-e.getOffset().y);h>0&&(e.getSize().y+=l+(h-1)*c)}}_removeTemporaryNorthSouthDummies(t){let e=[];for(let o of t.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.EXTERNAL_PORT||!r.hasProperty(p.EXT_PORT_REPLACED_DUMMY))continue;let i=null,s=null,a=null;for(let T of r.getPorts())T.getSide()===u.WEST?i=T:T.getSide()===u.EAST?s=T:a=T;let l=a.getOutgoingEdges()[0],c=new st(l.getBendPoints()),g=new O(a.getPosition().x,a.getPosition().y);g.x+=r.getPosition().x,g.y+=r.getPosition().y,c.splice(0,0,g);let h=st.reverse(l.getBendPoints()),d=new O(a.getPosition().x,a.getPosition().y);d.x+=r.getPosition().x,d.y+=r.getPosition().y,h.add(d);let E=r.getProperty(p.EXT_PORT_REPLACED_DUMMY).getPorts()[0],P=[...i.getIncomingEdges()];for(let T of P)T.setTarget(E),T.getBendPoints().addAllAsCopies(T.getBendPoints().length,c);let S=z.toEdgeArray(s.getOutgoingEdges());for(let T of S)T.setSource(E),T.getBendPoints().addAllAsCopies(0,h);l.setSource(null),l.setTarget(null),e.push(r)}for(let o of e)o.setLayer(null)}_fixCoordinates(t){let e=t.getProperty(_.PORT_CONSTRAINTS),o=t.getLayers();this._fixCoordinatesInLayer(o[0],e,t),this._fixCoordinatesInLayer(o[o.length-1],e,t)}_fixCoordinatesInLayer(t,e,o){let r=o.getPadding(),i=o.getOffset(),s=o.getActualSize(),a=s.y;for(let l of t.getNodes()){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE),g=l.getProperty(p.EXT_PORT_SIZE),h=l.getPosition();c===u.EAST?h.x=o.getSize().x+r.right-i.x:c===u.WEST&&(h.x=-i.x-r.left);let d=0;if(c===u.EAST||c===u.WEST)if(e===H.FIXED_RATIO){let f=l.getProperty(p.PORT_RATIO_OR_POSITION);h.y=s.y*f-l.getProperty(_.PORT_ANCHOR).y,d=h.y+g.y,l.borderToContentAreaCoordinates(!1,!0)}else e===H.FIXED_POS&&(h.y=l.getProperty(p.PORT_RATIO_OR_POSITION)-l.getProperty(_.PORT_ANCHOR).y,d=h.y+g.y,l.borderToContentAreaCoordinates(!1,!0));a=Math.max(a,d)}o.getSize().y+=a-s.y;for(let l of t.getNodes()){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE),g=l.getPosition();c===u.NORTH?g.y=-i.y-r.top:c===u.SOUTH&&(g.y=o.getSize().y+r.bottom-i.y)}}_correctSlantedEdgeSegments(t){let e=t.getLayers();this._correctSlantedEdgeSegmentsInLayer(e[0]),this._correctSlantedEdgeSegmentsInLayer(e[e.length-1])}_correctSlantedEdgeSegmentsInLayer(t){for(let e of t.getNodes()){if(e.getType()!==y.EXTERNAL_PORT)continue;let o=e.getProperty(p.EXT_PORT_SIDE);if(!(o!==u.EAST&&o!==u.WEST))for(let r of e.getConnectedEdges()){let i=r.getBendPoints();if(i.length===0)continue;let s=r.getSource();if(s&&s.getNode()===e){let l=i[0];l.y=s.getAbsoluteAnchor().y}let a=r.getTarget();if(a&&a.getNode()===e){let l=i[i.length-1];l.y=a.getAbsoluteAnchor().y}}}}};var Jg=class{process(t,e){e.begin("Hierarchical port dummy size processing",1);let r=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS)*2,i=[],s=[];for(let a of t){i.length=0,s.length=0;for(let l of a){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE);c===u.NORTH?i.push(l):c===u.SOUTH&&s.push(l)}Mm(i,!0,r),Mm(s,!1,r)}e.done()}};function Mm(n,t,e){let o=0,r=e;t||(o=e*(n.length-1),r*=-1);for(let i of n){i.setProperty(_.ALIGNMENT,Kt.CENTER),i.getSize().x=o;for(let s of i.getPorts(u.EAST))s.getPosition().x=o;o+=r}}var Qg=class{process(t,e){e.begin("Hierarchical port position processing",1);let o=t.getLayers();o.length>0&&bm(o[0],t),o.length>1&&bm(o[o.length-1],t),e.done()}};function bm(n,t){let e=t.getProperty(_.PORT_CONSTRAINTS);if(!(e.isRatioFixed()||e.isPosFixed()))return;let o=t.getActualSize().y;for(let r of n){if(r.getType()!==y.EXTERNAL_PORT)continue;let i=r.getProperty(p.EXT_PORT_SIDE);if(i!==u.EAST&&i!==u.WEST)continue;let s=r.getProperty(p.PORT_RATIO_OR_POSITION);e===H.FIXED_RATIO&&(s*=o),r.getPosition().y=s-r.getProperty(_.PORT_ANCHOR).y,r.borderToContentAreaCoordinates(!1,!0)}}var oh=class{constructor(){this._layeredGraph=null,this._degreeThreshold=0,this._treeHeightThreshold=0}process(t,e){this._layeredGraph=t,this._degreeThreshold=t.getProperty(_.HIGH_DEGREE_NODES_THRESHOLD);let o=t.getProperty(_.HIGH_DEGREE_NODES_TREE_HEIGHT);o===0&&(o=Number.MAX_SAFE_INTEGER),this._treeHeightThreshold=o;let r=t.getLayers(),i=0;for(;i<r.length;){let s=r[i],a=[],l=-1,c=-1;for(let d of s.getNodes())if(this._isHighDegreeNode(d)){let f=this._calculateInformation(d);l=Math.max(l,f.incTreesMaxHeight),c=Math.max(c,f.outTreesMaxHeight),a.push([d,f])}let g=[];for(let d=0;d<l;d++){let f=new Et(t);r.splice(i,0,f),g.unshift(f),i++}for(let[,d]of a)if(d.incTreeRoots!=null)for(let f of d.incTreeRoots)this._moveTree(f,th,g);let h=[];for(let d=0;d<c;d++){let f=new Et(t);r.splice(i+1+d,0,f),h.push(f)}for(let[,d]of a)if(d.outTreeRoots!=null)for(let f of d.outTreeRoots)this._moveTree(f,eh,h);i+=1+Math.max(c,0)}for(let s=r.length-1;s>=0;s--)r[s].getNodes().length===0&&r.splice(s,1)}_isHighDegreeNode(t){return dN(t)>=this._degreeThreshold}_calculateInformation(t){let e=new g_;for(let o of t.getIncomingEdges()){if(o.isSelfLoop())continue;let r=o.getSource().getNode();if(c_(r,eh)){let i=this._isTreeRoot(r,eh,th);if(i===-1)continue;e.incTreesMaxHeight=Math.max(e.incTreesMaxHeight,i),e.incTreeRoots==null&&(e.incTreeRoots=[]),e.incTreeRoots.push(r)}}for(let o of t.getOutgoingEdges()){if(o.isSelfLoop())continue;let r=o.getTarget().getNode();if(c_(r,th)){let i=this._isTreeRoot(r,th,eh);if(i===-1)continue;e.outTreesMaxHeight=Math.max(e.outTreesMaxHeight,i),e.outTreeRoots==null&&(e.outTreeRoots=[]),e.outTreeRoots.push(r)}}return e}_moveTree(t,e,o){t.setLayer(o[0]);let r=o.slice(1);for(let i of e(t)){let s=h_(i,t);r.length>0&&this._moveTree(s,e,r)}}_isTreeRoot(t,e,o){if(this._isHighDegreeNode(t)||!c_(t,e))return-1;if(fN(o(t)))return 1;let r=0;for(let i of o(t)){let s=h_(i,t),a=this._isTreeRoot(s,e,o);if(a===-1||(r=Math.max(r,a),r>this._treeHeightThreshold-1))return-1}return r+1}},g_=class{constructor(){this.incTreesMaxHeight=-1,this.incTreeRoots=null,this.outTreesMaxHeight=-1,this.outTreeRoots=null}},th=n=>n.getIncomingEdges(),eh=n=>n.getOutgoingEdges(),hN=n=>n.getConnectedEdges();function dN(n){let t=0;for(let e of hN(n))t++;return t}function fN(n){for(let t of n)return!1;return!0}function c_(n,t){let e=null;for(let o of t(n)){let r=h_(o,n);if(e==null)e=r;else if(r!==e)return!1}return!0}function h_(n,t){return n.getSource().getNode()===t?n.getTarget().getNode():n.getSource().getNode()}var rh=class{process(t,e){e.begin("Hyperedge merging",1),pN(t);for(let o of t.getLayers()){let r=o.getNodes();if(r.length===0)continue;let i=null,s=null,a=null,l=null;for(let c=0;c<r.length;c++){if(i=r[c],s=i.getType(),s===y.LONG_EDGE&&l===y.LONG_EDGE){let g=uN(i,a);g.allowMerge&&(_N(i,a,g.sameSource,g.sameTarget),r.splice(c,1),c--,i=a,s=l)}a=i,l=s}}e.done()}};function uN(n,t){let e=n.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES),o=t.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES),r=n.getProperty(p.LONG_EDGE_SOURCE),i=t.getProperty(p.LONG_EDGE_SOURCE),s=n.getProperty(p.LONG_EDGE_TARGET),a=t.getProperty(p.LONG_EDGE_TARGET),l=r!=null&&r===i,c=s!=null&&s===a;if(!e&&!o){let d=n.getPorts()[0],f=t.getPorts()[0];return{allowMerge:d.id===f.id,sameSource:l,sameTarget:c}}let g=(!e||n.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY))&&(!o||t.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY)),h=(!e||!n.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY))&&(!o||!t.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY));return{allowMerge:l&&g||c&&h,sameSource:l,sameTarget:c}}function _N(n,t,e,o){let r=Gm(t.getPorts(u.WEST)),i=Gm(t.getPorts(u.EAST));for(let s of n.getPorts()){for(;s.getIncomingEdges().length>0;)s.getIncomingEdges()[0].setTarget(r);for(;s.getOutgoingEdges().length>0;)s.getOutgoingEdges()[0].setSource(i)}e||t.setProperty(p.LONG_EDGE_SOURCE,null),o||t.setProperty(p.LONG_EDGE_TARGET,null)}function Gm(n){for(let t of n)return t;return null}function pN(n){let t=[];for(let o of n.getLayers())for(let r of o.getNodes())for(let i of r.getPorts())t.push(i);for(let o of t)o.id=-1;let e=0;for(let o of t)o.id===-1&&d_(o,e++)}function d_(n,t){n.id=t;for(let e of n.getConnectedPorts())e.id===-1&&d_(e,t);if(n.getNode().getType()===y.LONG_EDGE)for(let e of n.getNode().getPorts())e!==n&&e.id===-1&&d_(e,t)}var ih=class{process(t,e){e.begin("Hypernodes processing",1);for(let o of t)for(let r of o){if(!r.getProperty(_.HYPERNODE)||r.getPorts().length>2)continue;let i=0,s=0,a=0,l=0;for(let c of r.getPorts())switch(c.getSide()){case u.NORTH:i++;break;case u.EAST:s++;break;case u.SOUTH:a++;break;case u.WEST:l++;break}i===0&&a===0&&EN(t,r,l<=s)}e.done()}};function EN(n,t,e){let o=[],r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;if(e){r=n.getSize().x;for(let c of t.getPorts())for(let g of c.getOutgoingEdges()){let h=g.getBendPoints();if(h.isEmpty())continue;let d=h.getFirst();d.x<r&&(i=r-d.x,s=Number.MAX_SAFE_INTEGER,o.length=0,r=d.x),d.x<=r&&(o.push(g),h.size()>1&&(s=Math.min(s,Math.abs(h.get(1).y-d.y))))}}else for(let c of t.getPorts())for(let g of c.getIncomingEdges()){let h=g.getBendPoints();if(h.isEmpty())continue;let d=h.getLast();d.x>r&&(i=d.x-r,s=Number.MAX_SAFE_INTEGER,o.length=0,r=d.x),d.x>=r&&(o.push(g),h.size()>1&&(s=Math.min(s,Math.abs(h.get(h.size()-2).y-d.y))))}if(o.length===0||i<=t.getSize().x/2||s<=t.getSize().y/2)return;let a=new rt;a.setNode(t),a.setSide(u.NORTH),a.getPosition().x=t.getSize().x/2;let l=new rt;l.setNode(t),l.setSide(u.SOUTH),l.getPosition().x=t.getSize().x/2,l.getPosition().y=t.getSize().y;for(let c of o){let g=c.getBendPoints(),h,d;e?(h=g.removeFirst(),d=g.isEmpty()?c.getTarget().getAbsoluteAnchor():g.getFirst(),d.y>=h.y?c.setSource(l):c.setSource(a)):(h=g.removeLast(),d=g.isEmpty()?c.getSource().getAbsoluteAnchor():g.getLast(),d.y>=h.y?c.setTarget(l):c.setTarget(a));let f=c.getProperty(_.JUNCTION_POINTS);f!=null&&f.remove(h)}t.getPosition().x=r-t.getSize().x/2}var sh=class{process(t,e){e.begin("Layer constraint edge reversal",1);for(let o of t){let r=-1,i=[],s=o.getNodes().slice();for(let a=0;a<s.length;a++){let l=s[a].getProperty(p.IN_LAYER_CONSTRAINT);r===-1?l!==jt.TOP&&(r=a):l===jt.TOP&&(s[a].setLayer(null),s[a].setLayer(r++,o)),l===jt.BOTTOM&&i.push(s[a])}for(let a of i)a.setLayer(null),a.setLayer(o)}e.done()}};var nh=class{process(t,e){e.begin("Node margin calculation",1),No.getNodeMarginCalculator(oi.adapt(t,!1)).excludeEdgeHeadTailLabels().process(),e.done()}};var Gn=10,ah=class{constructor(){this._minX=Number.POSITIVE_INFINITY,this._maxX=Number.NEGATIVE_INFINITY,this._minY=Number.POSITIVE_INFINITY,this._maxY=Number.NEGATIVE_INFINITY}process(t,e){if(t.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)){for(let r of t.getLayerlessNodes()){if(r.getType()!==y.NORMAL)continue;let i=r.getProperty(_.MARGINS),s=i!=null?i.left:0,a=i!=null?i.right:0,l=i!=null?i.top:0,c=i!=null?i.bottom:0,g=r.getPosition(),h=r.getSize();g.x-s<this._minX&&(this._minX=g.x-s),g.x+h.x+a>this._maxX&&(this._maxX=g.x+h.x+a),g.y-l<this._minY&&(this._minY=g.y-l),g.y+h.y+c>this._maxY&&(this._maxY=g.y+h.y+c)}for(let r of t.getLayerlessNodes()){if(r.getType()===y.NORMAL)continue;if(r.getType()!==y.EXTERNAL_PORT)throw new Error(`InteractiveExternalPortPositioner: unsupported node type ${r.getType()}`);let i=r.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.FIRST_SEPARATE){r.getPosition().x=this._minX-Gn;let a=Hm(r,l=>l.getTarget().getNode());a!=null&&(r.getPosition().y=a);continue}if(i===J.LAST_SEPARATE){r.getPosition().x=this._maxX+Gn;let a=Hm(r,l=>l.getSource().getNode());a!=null&&(r.getPosition().y=a);continue}let s=r.getProperty(p.IN_LAYER_CONSTRAINT);if(s===jt.TOP){let a=vm(r);a!=null&&(r.getPosition().x=a+Gn),r.getPosition().y=this._minY-Gn;continue}if(s===jt.BOTTOM){let a=vm(r);a!=null&&(r.getPosition().x=a+Gn),r.getPosition().y=this._maxY+Gn}}}}};function Hm(n,t){for(let e of n.getConnectedEdges()){let o=t(e);return o.getPosition().y+o.getSize().y/2}return null}function vm(n){if(n.getPorts().length!==1)throw new Error("external port dummy must have exactly one port");let t=n.getPorts()[0],e=t.getOutgoingEdges().length>0,o=t.getIncomingEdges().length>0;if(e&&o)throw new Error("Interactive layout does not support N/S ports with incoming AND outgoing edges");if(e){let r=Number.POSITIVE_INFINITY;for(let i of t.getOutgoingEdges()){let s=i.getTarget().getNode(),a=s.getProperty(_.MARGINS),l=a!=null?a.left:0,c=s.getPosition().x-l;c<r&&(r=c)}return r}if(o){let r=Number.NEGATIVE_INFINITY;for(let i of t.getIncomingEdges()){let s=i.getSource().getNode(),a=s.getProperty(_.MARGINS),l=a!=null?a.right:0,c=s.getPosition().x+s.getSize().x+l;c>r&&(r=c)}return r}return null}var lh=class{process(t,e){e.begin("Inverted port preprocessing",1);let o=t.getLayers(),r=[],i=null;for(let s=0;s<o.length;s++){let a=i;i=o[s];for(let c of r)c.setLayer(a);r=[];let l=i.getNodes().slice();for(let c of l)if(c.getType()===y.NORMAL&&c.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){for(let g of c.getPorts(W.INPUT,u.EAST)){let h=g.getIncomingEdges().slice();for(let d of h)mN(t,g,d,r)}for(let g of c.getPorts(W.OUTPUT,u.WEST)){let h=g.getOutgoingEdges().slice();for(let d of h)PN(t,g,d,r)}}}for(let s of r)s.setLayer(i);e.done()}};function mN(n,t,e,o){if(e.getSource().getNode()===t.getNode())return;let r=new ft(n);r.setType(y.LONG_EDGE),r.setProperty(p.ORIGIN,e),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.push(r);let i=new rt;i.setNode(r),i.setSide(u.WEST);let s=new rt;s.setNode(r),s.setSide(u.EAST),e.setTarget(i);let a=new _e;a.copyProperties(e),a.setProperty(_.JUNCTION_POINTS,null),a.setSource(s),a.setTarget(t),Um(r,i,s),Bm(e,a,!1)}function PN(n,t,e,o){if(e.getTarget().getNode()===t.getNode())return;let r=new ft(n);r.setType(y.LONG_EDGE),r.setProperty(p.ORIGIN,e),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.push(r);let i=new rt;i.setNode(r),i.setSide(u.WEST);let s=new rt;s.setNode(r),s.setSide(u.EAST);let a=e.getTarget();e.setTarget(i);let l=new _e;l.copyProperties(e),l.setProperty(_.JUNCTION_POINTS,null),l.setSource(s),l.setTarget(a),Bm(e,l,!0),Um(r,i,s)}function Bm(n,t,e){let o=n.getLabels(),r=0;for(;r<o.length;){let i=o[r];i.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD?((e||!i.hasProperty(p.END_LABEL_EDGE))&&i.setProperty(p.END_LABEL_EDGE,n),o.splice(r,1),t.getLabels().push(i)):r++}}function Um(n,t,e){let o=t.getIncomingEdges()[0].getSource(),r=o.getNode(),i=e.getOutgoingEdges()[0].getTarget(),s=i.getNode();r.getType()===y.LONG_EDGE?n.setProperty(p.LONG_EDGE_SOURCE,r.getProperty(p.LONG_EDGE_SOURCE)):n.setProperty(p.LONG_EDGE_SOURCE,o),s.getType()===y.LONG_EDGE?n.setProperty(p.LONG_EDGE_TARGET,s.getProperty(p.LONG_EDGE_TARGET)):n.setProperty(p.LONG_EDGE_TARGET,i)}var ch=class{process(t,e){e.begin("Node and Port Label Placement and Node Sizing",1),No.calculateLabelAndNodeSizes(oi.adapt(t,!0,!0,r=>r.getType()===y.NORMAL));let o=t.getProperty(p.GRAPH_PROPERTIES);if(o!=null&&o.has(v.EXTERNAL_PORTS)){let r=t.getProperty(_.PORT_LABELS_PLACEMENT),i=r!=null&&r.has(it.NEXT_TO_PORT_IF_POSSIBLE),s=t.getProperty(_.PORT_LABELS_TREAT_AS_GROUP);for(let a of t.getLayers())for(let l of a.getNodes())l.getType()===y.EXTERNAL_PORT&&this._placeExternalPortDummyLabels(l,r,i,s)}e.done()}_placeExternalPortDummyLabels(t,e,o,r){let i=t.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL),s=t.getProperty(_.SPACING_LABEL_PORT_VERTICAL),a=t.getProperty(_.SPACING_LABEL_LABEL),l=t.getSize(),c=t.getPorts()[0],g=c.getPosition(),h=this._computePortLabelBox(c,a);if(h==null)return;if(e!=null&&e.has(it.INSIDE))switch(t.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:h.x=(l.x-h.width)/2-g.x,h.y=s;break;case u.SOUTH:h.x=(l.x-h.width)/2-g.x,h.y=-s-h.height;break;case u.EAST:{if(f_(c,!0,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=l.y+s-g.y;h.x=-i-h.width;break}case u.WEST:{if(f_(c,!0,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=l.y+s-g.y;h.x=i;break}default:break}else if(e!=null&&e.has(it.OUTSIDE))switch(t.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:case u.SOUTH:h.x=g.x+i;break;case u.EAST:case u.WEST:{if(f_(c,!1,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=g.y+s;break}default:break}let d=h.y;for(let f of c.getLabels()){let E=f.getPosition();E.x=h.x,E.y=d,d+=f.getSize().y+a}}_computePortLabelBox(t,e){let o=t.getLabels();if(o.length===0)return null;let r=new dt;for(let i of o){let s=i.getSize();s.x>r.width&&(r.width=s.x),r.height+=s.y}return r.height+=(o.length-1)*e,r}};function f_(n,t,e){return e?t?n.getIncomingEdges().length===0&&n.getOutgoingEdges().length===0:!n.isConnectedToExternalNodes():!1}var ri=class n{process(t,e){e.begin("Edge splitting",1);let o=t.getLayers();if(o.length<=2){e.done();return}for(let r=0;r<o.length-1;r++){let i=o[r],s=o[r+1];for(let a of i)for(let l of a.getPorts()){let c=l.getOutgoingEdges().slice();for(let g of c){let h=g.getTarget().getNode().getLayer();if(h!==i&&h!==s){let d=ON(t,s,g);n.splitEdge(g,d)}}}}e.done()}static splitEdge(t,e){let o=t.getTarget(),r=t.getProperty(_.EDGE_THICKNESS);r<0&&(r=0,t.setProperty(_.EDGE_THICKNESS,r)),e.getSize().y=r;let i=Math.floor(r/2),s=new rt;s.setSide(u.WEST),s.setNode(e),s.getPosition().y=i;let a=new rt;a.setSide(u.EAST),a.setNode(e),a.getPosition().y=i,t.setTarget(s);let l=new _e;return l.copyProperties(t),l.setProperty(_.JUNCTION_POINTS,null),l.setSource(a),l.setTarget(o),SN(e,t,l),TN(t,l),l}};function ON(n,t,e){let o=new ft(n);return o.setType(y.LONG_EDGE),o.setProperty(p.ORIGIN,e),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setLayer(t),o}function SN(n,t,e){let o=t.getSource().getNode(),r=e.getTarget().getNode();o.getType()===y.LONG_EDGE?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,o.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES))):o.getType()===y.LABEL?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,!0)):r.getType()===y.LABEL?(n.setProperty(p.LONG_EDGE_SOURCE,r.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,r.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,!0)):(n.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),n.setProperty(p.LONG_EDGE_TARGET,e.getTarget()))}function TN(n,t){let e=n.getLabels(),o=0;for(;o<e.length;){let r=e[o];r.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD?(e.splice(o,1),t.getLabels().push(r),r.hasProperty(p.END_LABEL_EDGE)||r.setProperty(p.END_LABEL_EDGE,n)):o++}}var gh=class{process(t,e){e.begin("Label dummy insertions",1);let o=[],r=t.getProperty(_.SPACING_EDGE_LABEL),i=t.getProperty(_.SPACING_LABEL_LABEL),s=t.getProperty(_.DIRECTION),a=s!=null&&s.isVertical&&s.isVertical();for(let l of t.getLayerlessNodes()){let c=[...l.getOutgoingEdges()];for(let g of c){if(!NN(g))continue;let h=yN(g),d=[],f=IN(t,g,d);o.push(f);let E=f.getSize(),P=g.getLabels(),S=0;for(;S<P.length;){let N=P[S];N.getProperty(_.EDGE_LABELS_PLACEMENT)===St.CENTER?(a?(E.x+=N.getSize().x+i,N.getSize().y>E.y&&(E.y=N.getSize().y)):(N.getSize().x>E.x&&(E.x=N.getSize().x),E.y+=N.getSize().y+i),d.push(N),P.splice(S,1)):S++}a?(E.x-=i,E.y+=r+h):E.y+=r-i+h;let T=Math.floor(h/2);for(let N of f.getPorts())N.getPosition().y=T}}for(let l of o)t.getLayerlessNodes().push(l);e.done()}};function NN(n){if(n.getSource().getNode()===n.getTarget().getNode())return!1;for(let t of n.getLabels())if(t.getProperty(_.EDGE_LABELS_PLACEMENT)===St.CENTER)return!0;return!1}function yN(n){let t=n.getProperty(_.EDGE_THICKNESS);return t<0&&(t=0,n.setProperty(_.EDGE_THICKNESS,t)),t}function IN(n,t,e){let o=new ft(n);return o.setType(y.LABEL),o.setProperty(p.ORIGIN,t),o.setProperty(p.REPRESENTED_LABELS,e),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),o.setProperty(p.LONG_EDGE_TARGET,t.getTarget()),ri.splitEdge(t,o),o}var ii=class n{process(t,e){e.begin("Edge joining",1);let o=t.getProperty(_.UNNECESSARY_BENDPOINTS);for(let r of t){let i=r.getNodes(),s=0;for(;s<i.length;){let a=i[s];a.getType()===y.LONG_EDGE?(n.joinAt(a,o),i.splice(s,1)):s++}}e.done()}static joinAt(t,e){let o=t.getPorts(u.WEST),r=t.getPorts(u.EAST),i=Fm(o),s=Fm(r),a=i.getIncomingEdges(),l=s.getOutgoingEdges(),c=a.length,g=t.getPorts()[0].getAbsoluteAnchor();for(;c-- >0;){let h=a[0],d=l[0],E=d.getTarget().getIncomingEdges().indexOf(d);h.setTargetAndInsertAtIndex(d.getTarget(),E),d.setSource(null),d.setTarget(null);let P=h.getBendPoints();e&&P.add(new O(g.x,g.y));for(let N of d.getBendPoints())P.add(new O(N.x,N.y));for(let N of d.getLabels())h.getLabels().push(N);let S=h.getProperty(_.JUNCTION_POINTS),T=d.getProperty(_.JUNCTION_POINTS);if(T!=null){S==null&&(S=new st,h.setProperty(_.JUNCTION_POINTS,S));for(let N of T)S.add(new O(N.x,N.y))}}}};function Fm(n){for(let t of n)return t;return null}var hh=class{process(t,e){e.begin("Label dummy removal",1);let o=t.getProperty(_.SPACING_EDGE_LABEL),r=t.getProperty(_.SPACING_LABEL_LABEL),i=t.getProperty(_.DIRECTION);for(let s of t.getLayers()){let a=s.getNodes(),l=0;for(;l<a.length;){let c=a[l];if(c.getType()!==y.LABEL){l++;continue}let g=c.getProperty(p.ORIGIN),h=Number(g.getProperty(_.EDGE_THICKNESS)),d=c.getProperty(p.LABEL_SIDE)===Vt.BELOW,f=new O(c.getPosition().x,c.getPosition().y);d&&(f.y+=h+o);let E=new O(c.getSize().x,c.getSize().y+(c.isInlineEdgeLabel()?0:-h-o)),P=c.getProperty(p.REPRESENTED_LABELS);i!=null&&i.isVertical&&i.isVertical()?LN(P,f,r,E,d,i):RN(P,f,r,E);for(let T of P)g.getLabels().push(T);let S=t.getProperty(_.EDGE_ROUTING);ii.joinAt(c,S===At.POLYLINE),a.splice(l,1)}}e.done()}};function RN(n,t,e,o){for(let r of n)r.getPosition().x=t.x+(o.x-r.getSize().x)/2,r.getPosition().y=t.y,t.y+=r.getSize().y+e}function LN(n,t,e,o,r,i){let s=n.every(l=>l.getProperty(_.EDGE_LABELS_INLINE)),a=i===R.UP?[...n].reverse():n;for(let l of a)l.getPosition().x=t.x,s?l.getPosition().y=t.y+(o.y-l.getSize().y)/2:r?l.getPosition().y=t.y:l.getPosition().y=t.y+o.y-l.getSize().y,t.x+=l.getSize().x+e}var Ct=class{constructor(t,e){this._name=t,this._usesLabelSize=e}toString(){return this._name}usesLabelSizeInformation(){return this._usesLabelSize}};Ct.MEDIAN_LAYER=new Ct("MEDIAN_LAYER",!1);Ct.TAIL_LAYER=new Ct("TAIL_LAYER",!1);Ct.HEAD_LAYER=new Ct("HEAD_LAYER",!1);Ct.SPACE_EFFICIENT_LAYER=new Ct("SPACE_EFFICIENT_LAYER",!0);Ct.WIDEST_LAYER=new Ct("WIDEST_LAYER",!0);Ct.CENTER_LAYER=new Ct("CENTER_LAYER",!0);Ct.values=()=>[Ct.MEDIAN_LAYER,Ct.TAIL_LAYER,Ct.HEAD_LAYER,Ct.SPACE_EFFICIENT_LAYER,Ct.WIDEST_LAYER,Ct.CENTER_LAYER];var tl=class n{constructor(){this._layerWidths=null}process(t,e){var i;e.begin("Label dummy switching",1);let o=(i=t.getProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY))!=null?i:Ct.MEDIAN_LAYER;AN(t);let r=CN(t,o);this._layerWidths=new Array(t.getLayers().length).fill(0);for(let s of Ct.values())if(s.usesLabelSizeInformation()&&r.get(s).length>0){this._calculateLayerWidths(t);break}for(let s of Ct.values())s.usesLabelSizeInformation()||this._processStrategy(r.get(s));for(let s of Ct.values())s.usesLabelSizeInformation()&&this._processStrategy(r.get(s));this._layerWidths=null,e.done()}_calculateLayerWidths(t){for(let e of t.getLayers())this._layerWidths[e.id]=z.findMaxNonDummyNodeWidth(e,!1)}_processStrategy(t){if(t.length!==0){if(t[0].placementStrategy===Ct.SPACE_EFFICIENT_LAYER){this._computeSpaceEfficientAssignment(t);return}for(let e of t){switch(e.placementStrategy){case Ct.CENTER_LAYER:this._assignLayer(e,this._findCenterLayerTargetId(e));break;case Ct.MEDIAN_LAYER:this._assignLayer(e,xN(e));break;case Ct.WIDEST_LAYER:this._assignLayer(e,this._findWidestLayerTargetId(e));break;case Ct.HEAD_LAYER:Wm(e),this._assignLayer(e,km(e,!0));break;case Ct.TAIL_LAYER:Wm(e),this._assignLayer(e,km(e,!1));break}wN(e)}}}_findWidestLayerTargetId(t){let e=t.leftmostLayerId;for(let o=e+1;o<=t.rightmostLayerId;o++)this._layerWidths[o]>this._layerWidths[e]&&(e=o);return e}_findCenterLayerTargetId(t){let e=this._computeLayerWidthSums(t),o=e[e.length-1]/2;for(let r=0;r<e.length;r++)if(e[r]>=o)return t.leftmostLayerId+r;return t.leftmostLayerId+t.leftLongEdgeDummies.length}_computeLayerWidthSums(t){let e=t.labelDummy.getGraph(),o=e.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS)*2,r=e.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),i=Math.max(o,r),s=new Array(t.totalDummyCount()),a=-i,l=0;for(let c of t.leftLongEdgeDummies)a+=this._layerWidths[c.getLayer().id]+i,s[l++]=a;a+=this._layerWidths[t.labelDummy.getLayer().id]+i,s[l++]=a;for(let c of t.rightLongEdgeDummies)a+=this._layerWidths[c.getLayer().id]+i,s[l++]=a;return s}_computeSpaceEfficientAssignment(t){let e=this._performTrivialAssignments(t);if(e.length!==0){e.sort((o,r)=>r.labelDummy.getSize().x-o.labelDummy.getSize().x);for(let o=0;o<e.length;o++)this._assignLayer(e[o],this._findPotentiallyWidestLayer(e,o))}}_performTrivialAssignments(t){let e=[];for(let o of t)o.leftmostLayerId===o.rightmostLayerId?this._assignLayer(o,o.leftmostLayerId):this._assignToWiderLayer(o)||e.push(o);return e}_assignToWiderLayer(t){let e=t.labelDummy.getSize().x,r=t.labelDummy.getGraph().getLayers().slice(t.leftmostLayerId,t.rightmostLayerId+1);for(let i of r)if(i.getSize().x>=e)return this._assignLayer(t,i.id),!0;return!1}_findPotentiallyWidestLayer(t,e){let o=t[e],r=o.labelDummy.getSize().x,i=o.leftmostLayerId,s=0;for(let a=o.leftmostLayerId;a<=o.rightmostLayerId;a++){if(r<=this._layerWidths[a])return a;let l=this._layerWidths[a],c=null;for(let g=e+1;g<t.length;g++){let h=t[g];h.leftmostLayerId<=a&&h.rightmostLayerId>=a&&(c=h)}c!=null&&(l=Math.max(l,c.labelDummy.getSize().x)),l>s&&(i=a,s=l)}return i}_assignLayer(t,e){e!==t.leftmostLayerId+t.leftLongEdgeDummies.length&&DN(t.labelDummy,t.ithDummyNode(e-t.leftmostLayerId));let o=t.labelDummy.getLayer().id;this._layerWidths[o]=Math.max(this._layerWidths[o],t.labelDummy.getSize().x);let r=t.labelDummy.getProperty(p.REPRESENTED_LABELS);if(r!=null)for(let i of r)i.setProperty(n.INCLUDE_LABEL,!0)}};tl.INCLUDE_LABEL=new m("edgelabelcenterednessanalysis.includelabel",!1);function AN(n){let t=0;for(let e of n)e.id=t++}function CN(n,t){let e=new Map;for(let o of Ct.values())e.set(o,[]);for(let o of n.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.LABEL)continue;let i=new u_(r,t);e.get(i.placementStrategy).push(i)}return e}function xN(n){let t=n.totalDummyCount(),e=Math.floor((t-1)/2);return n.leftmostLayerId+e}function km(n,t){let e=Ym(n);return t&&!e||!t&&e?n.rightmostLayerId:n.leftmostLayerId}function Wm(n){let t=n.placementStrategy===Ct.HEAD_LAYER,e=Ym(n);t&&!e||!t&&e?n.labelDummy.setProperty(_.ALIGNMENT,Kt.RIGHT):n.labelDummy.setProperty(_.ALIGNMENT,Kt.LEFT)}function Ym(n){let t=null;for(let o of n.labelDummy.getIncomingEdges()){t=o;break}let e=null;for(let o of n.labelDummy.getOutgoingEdges()){e=o;break}return t!=null&&t.getProperty(p.REVERSED)||e!=null&&e.getProperty(p.REVERSED)}function DN(n,t){let e=n.getLayer(),o=t.getLayer(),r=e.getNodes().indexOf(n),i=o.getNodes().indexOf(t),s=null;for(let E of n.getPorts(W.INPUT)){s=E;break}let a=null;for(let E of n.getPorts(W.OUTPUT)){a=E;break}let l=null;for(let E of t.getPorts(W.INPUT)){l=E;break}let c=null;for(let E of t.getPorts(W.OUTPUT)){c=E;break}let g=z.toEdgeArray(s.getIncomingEdges()),h=z.toEdgeArray(a.getOutgoingEdges()),d=z.toEdgeArray(l.getIncomingEdges()),f=z.toEdgeArray(c.getOutgoingEdges());n.setLayer(i,o);for(let E of d)E.setTarget(s);for(let E of f)E.setSource(a);t.setLayer(r,e);for(let E of g)E.setTarget(l);for(let E of h)E.setSource(c)}function wN(n){let t=n.labelDummy,e=zm(t);for(;e!=null&&e.getType()===y.LONG_EDGE;)e.setProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY,!0),e=zm(e)}function zm(n){for(let t of n.getIncomingEdges())return t.getSource().getNode();return null}var u_=class{constructor(t,e){this.labelDummy=t,this.placementStrategy=e,this.leftLongEdgeDummies=[],this.rightLongEdgeDummies=[],this.leftmostLayerId=0,this.rightmostLayerId=0,this._gatherLeftLongEdgeDummies(),this._gatherRightLongEdgeDummies(),this.leftLongEdgeDummies.length===0?this.leftmostLayerId=t.getLayer().id:this.leftmostLayerId=this.leftLongEdgeDummies[0].getLayer().id,this.rightLongEdgeDummies.length===0?this.rightmostLayerId=t.getLayer().id:this.rightmostLayerId=this.rightLongEdgeDummies[this.rightLongEdgeDummies.length-1].getLayer().id;let o=t.getProperty(p.REPRESENTED_LABELS);if(o!=null){for(let r of o)if(r.hasProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY)){this.placementStrategy=r.getProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY);break}}}_gatherLeftLongEdgeDummies(){let t=this.labelDummy;do{let e=null;for(let o of t.getIncomingEdges()){e=o.getSource().getNode();break}if(e==null)break;t=e,t.getType()===y.LONG_EDGE&&this.leftLongEdgeDummies.push(t)}while(t.getType()===y.LONG_EDGE);this.leftLongEdgeDummies.reverse()}_gatherRightLongEdgeDummies(){let t=this.labelDummy;do{let e=null;for(let o of t.getOutgoingEdges()){e=o.getTarget().getNode();break}if(e==null)break;t=e,t.getType()===y.LONG_EDGE&&this.rightLongEdgeDummies.push(t)}while(t.getType()===y.LONG_EDGE)}totalDummyCount(){return this.rightmostLayerId-this.leftmostLayerId+1}ithDummyNode(t){return t<this.leftLongEdgeDummies.length?this.leftLongEdgeDummies[t]:t===this.leftLongEdgeDummies.length?this.labelDummy:this.rightLongEdgeDummies[t-this.leftLongEdgeDummies.length-1]}};var Hn=new m("org.eclipse.elk.labels.labelManager");var MN=20,__=40,ol=60,el=class{constructor(t){this._centerLabels=!!t}process(t,e){e.begin("Label management",1);let o=t.getProperty(Hn);if(o!=null){let r=t.getProperty(_.SPACING_EDGE_LABEL),i=t.getProperty(_.SPACING_LABEL_LABEL);this._centerLabels?GN(t,o,r,i):bN(t,o,i)}e.done()}};function bN(n,t,e){let o=n.getProperty(_.DIRECTION),r=o!=null&&o.isVertical&&o.isVertical();for(let i of n)for(let s of i){if(s.getType()===y.NORMAL){As(t,s.getLabels(),__,e,r);for(let a of s.getPorts())As(t,a.getLabels(),MN,e,r);s.hasProperty(p.TOP_COMMENTS)&&Vm(t,s.getProperty(p.TOP_COMMENTS),__,r),s.hasProperty(p.BOTTOM_COMMENTS)&&Vm(t,s.getProperty(p.BOTTOM_COMMENTS),__,r)}for(let a of s.getOutgoingEdges())As(t,a.getLabels(),ol,0,r)}}function Vm(n,t,e,o){for(let r of t)r.getLabels().length!==0&&As(n,r.getLabels(),e,0,o)}function GN(n,t,e,o){let r=n.getProperty(_.DIRECTION),i=r!=null&&r.isVertical&&r.isVertical();for(let s of n){let a=Math.max(ol,z.findMaxNonDummyNodeWidth(s,!1));for(let l of s){if(l.getType()!==y.LABEL)continue;let c=null;for(let f of l.getConnectedEdges()){c=f;break}let g=c.getProperty(_.EDGE_THICKNESS),h=l.getProperty(p.REPRESENTED_LABELS),d=As(t,h,a,o,i);l.getSize().x=d.x,l.getSize().y=d.y+g+e}}}function As(n,t,e,o,r){let i=new O,s=!1;for(let a of t){s=!0;let l=a.getSize(),c=a.getProperty(p.ORIGIN);if(c!=null){let g=n.manageLabelSize(c,e);g!=null&&(r?(l.x=g.y,l.y=g.x):(l.x=g.x,l.y=g.y))}r?(i.x+=o+a.getSize().x,i.y=Math.max(i.y,l.y)):(i.x=Math.max(i.x,l.x),i.y+=o+a.getSize().y)}return s&&(r?i.x-=o:i.y-=o),i}var Tt=class{constructor(t){this.name=t,this._transposed=null}toString(){return this.name}transpose(){return this._transposed||this}};Tt.ALWAYS_UP=new Tt("ALWAYS_UP");Tt.ALWAYS_DOWN=new Tt("ALWAYS_DOWN");Tt.DIRECTION_UP=new Tt("DIRECTION_UP");Tt.DIRECTION_DOWN=new Tt("DIRECTION_DOWN");Tt.SMART_UP=new Tt("SMART_UP");Tt.SMART_DOWN=new Tt("SMART_DOWN");Tt.ALWAYS_UP._transposed=Tt.ALWAYS_DOWN;Tt.ALWAYS_DOWN._transposed=Tt.ALWAYS_UP;Tt.DIRECTION_UP._transposed=Tt.DIRECTION_DOWN;Tt.DIRECTION_DOWN._transposed=Tt.DIRECTION_UP;Tt.SMART_UP._transposed=Tt.SMART_DOWN;Tt.SMART_DOWN._transposed=Tt.SMART_UP;[Tt.ALWAYS_UP,Tt.ALWAYS_DOWN,Tt.DIRECTION_UP,Tt.DIRECTION_DOWN,Tt.SMART_UP,Tt.SMART_DOWN].forEach(n=>Object.freeze(n));var dh=class{process(t,e){let o=t.getProperty(_.EDGE_LABELS_SIDE_SELECTION);switch(e.begin(`Label side selection (${o})`,1),o){case Tt.ALWAYS_UP:Xm(t,Vt.ABOVE);break;case Tt.ALWAYS_DOWN:Xm(t,Vt.BELOW);break;case Tt.DIRECTION_UP:Km(t,Vt.ABOVE);break;case Tt.DIRECTION_DOWN:Km(t,Vt.BELOW);break;case Tt.SMART_UP:Zm(t,Vt.ABOVE);break;case Tt.SMART_DOWN:Zm(t,Vt.BELOW);break}e.done()}};function Xm(n,t){for(let e of n)for(let o of e){o.getType()===y.LABEL&&si(o,t);for(let r of o.getOutgoingEdges())Qm(r,t)}}function Km(n,t){for(let e of n)for(let o of e){if(o.getType()===y.LABEL){let r=BN(o)?t:t.opposite();si(o,r)}for(let r of o.getOutgoingEdges()){let i=p_(r)?t:t.opposite();Qm(r,i)}}}function Zm(n,t){let e=[];for(let o of n){let r=!0,i=0;for(let s of o){let a=s.getType();if(a===y.LABEL){i++,e.push(s);continue}if(a===y.LONG_EDGE){e.push(s);continue}a===y.NORMAL&&vN(s,t),e.length>0&&jm(e,i,r,!1,t),r=!1,i=0}e.length>0&&jm(e,i,r,!0,t)}}function jm(n,t,e,o,r){e&&(!o||n.length>1)&&t===1&&n[0].getType()===y.LABEL?si(n[0],Vt.ABOVE):o&&(!e||n.length>1)&&t===1&&n[n.length-1].getType()===y.LABEL?si(n[n.length-1],Vt.BELOW):n.length===2?(si(n.shift(),Vt.ABOVE),si(n.shift(),Vt.BELOW)):HN(n,t,r),n.length=0}function HN(n,t,e){let o=[],r=null,i=null;for(let s of n){let a=$m(s,!0),l=$m(s,!1);(r!==a||i!==l)&&(qm(o,e),r=a,i=l),o.push(s)}qm(o,e)}function $m(n,t){let e=n.getProperty(t?p.LONG_EDGE_SOURCE:p.LONG_EDGE_TARGET);return e==null?null:e.getNode()}function qm(n,t){if(n.length>0){if(n.length===2)si(n[0],Vt.ABOVE),si(n[1],Vt.BELOW);else for(let e of n)si(e,t);n.length=0}}function vN(n,t){let e=[],o=null;for(let r of n.getPorts()){r.getSide()!==o&&(e.length>0&&Jm(e,o,t),e.length=0,o=r.getSide());let i=In.gatherLabels(r);i!=null&&e.push(i)}e.length>0&&Jm(e,o,t)}function Jm(n,t,e){if(n.length===2)t===u.NORTH||t===u.EAST?(rl(n.shift(),Vt.ABOVE),rl(n.shift(),Vt.BELOW)):(rl(n.shift(),Vt.BELOW),rl(n.shift(),Vt.ABOVE));else for(let o of n)rl(o,e)}function si(n,t){if(n.getType()!==y.LABEL)return;let e=n.isInlineEdgeLabel()?Vt.INLINE:t;if(n.setProperty(p.LABEL_SIDE,e),e!==Vt.BELOW){let r=n.getProperty(p.ORIGIN).getProperty(_.EDGE_THICKNESS),i=0;if(e===Vt.ABOVE)i=n.getSize().y-Math.ceil(r/2);else if(e===Vt.INLINE){let s=n.getGraph().getProperty(_.SPACING_EDGE_LABEL);i=Math.ceil(n.getSize().y-s-r)/2,n.getSize().y-=s,n.getSize().y-=r}for(let s of n.getPorts())s.getPosition().y=i}}function Qm(n,t){for(let e of n.getLabels())e.setProperty(p.LABEL_SIDE,t)}function rl(n,t){for(let e of n)e.setProperty(p.LABEL_SIDE,t)}function p_(n){return!n.getProperty(p.REVERSED)}function BN(n){let t=null;for(let o of n.getIncomingEdges()){t=o;break}let e=null;for(let o of n.getOutgoingEdges()){e=o;break}return t!=null&&p_(t)||e!=null&&p_(e)}var fh=class{process(t,e){e.begin("Layer constraint postprocessing",1);let o=t.getLayers();if(o.length>0){let r=o[0],i=o[o.length-1],s=new Et(t),a=new Et(t);UN(t,r,i,s,a),s.getNodes().length>0&&o.unshift(s),a.getNodes().length>0&&o.push(a)}if(t.hasProperty(p.HIDDEN_NODES)){let r=new Et(t),i=new Et(t);FN(t,r,i),r.getNodes().length>0&&o.unshift(r),i.getNodes().length>0&&o.push(i)}e.done()}};function UN(n,t,e,o,r){for(let a of n){let l=a.getNodes().slice();for(let c of l)switch(c.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST:kN(c),c.setLayer(t),tP(c,!0,o);break;case J.LAST:WN(c),c.setLayer(e),tP(c,!1,r);break;default:break}}let i=n.getLayers(),s=0;for(;s<i.length;)i[s].getNodes().length===0?i.splice(s,1):s++}function tP(n,t,e){let o=t?n.getIncomingEdges():n.getOutgoingEdges();for(let r of o){let i=t?r.getSource().getNode():r.getTarget().getNode();i.getType()===y.LABEL&&i.setLayer(e)}}function FN(n,t,e){for(let o of n.getProperty(p.HIDDEN_NODES)){let r=o.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(r===J.FIRST_SEPARATE)o.setLayer(t);else if(r===J.LAST_SEPARATE)o.setLayer(e);else throw new Error(`Hidden node ${o} has unexpected layer constraint ${r}`);for(let i of o.getConnectedEdges()){if(i.getSource()!=null&&i.getTarget()!=null)continue;let s=i.getTarget()==null,a=i.getProperty(p.ORIGINAL_OPPOSITE_PORT);s?i.setTarget(a):i.setSource(a)}}}function kN(n){for(let t of n.getIncomingEdges())if(t.getSource().getNode().getType()!==y.LABEL)throw new Error(`Node '${n.getDesignation()}' has FIRST layer constraint with a non-LABEL incoming edge.`)}function WN(n){for(let t of n.getOutgoingEdges())if(t.getTarget().getNode().getType()!==y.LABEL)throw new Error(`Node '${n.getDesignation()}' has LAST layer constraint with a non-LABEL outgoing edge.`)}var oP="NONE",vn="FIRST_SEPARATE",uh="LAST_SEPARATE",E_="BOTH",$K=Symbol("separateLayerConnections"),_h=class{process(t,e){e.begin("Layer constraint preprocessing",1);let o=[],r=t.getLayerlessNodes(),i=0;for(;i<r.length;){let s=r[i];zN(s)?(YN(s),o.push(s),r.splice(i,1)):i++}o.length>0&&t.setProperty(p.HIDDEN_NODES,o),e.done()}};function zN(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT);return t===J.FIRST_SEPARATE||t===J.LAST_SEPARATE}function YN(n){$N(n);let t=[];for(let e of n.getConnectedEdges())t.push(e);for(let e of t)VN(n,e)}function VN(n,t){let e=t.getSource().getNode()===n,o=e?t.getTarget():t.getSource();e?t.setTarget(null):t.setSource(null),t.setProperty(p.ORIGINAL_OPPOSITE_PORT,o),XN(n,o.getNode())}function XN(n,t){if(t.hasProperty(_.LAYERING_LAYER_CONSTRAINT))return;let e=KN(t),o=jN(e,n.getProperty(_.LAYERING_LAYER_CONSTRAINT));ZN(t,o),t.getConnectedEdges()[Symbol.iterator]().next().done&&(o===vn?t.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST):o===uh&&t.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST))}function KN(n){return n._hiddenConnections||oP}function ZN(n,t){n._hiddenConnections=t}function jN(n,t){let e=t===J.FIRST_SEPARATE?vn:uh;return n===oP?e:n===vn?e===vn?vn:E_:n===uh?e===vn?E_:uh:E_}function $N(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(t===J.FIRST_SEPARATE){for(let e of n.getIncomingEdges())if(!eP(e))throw new Error(`Node '${n.getDesignation()}' has FIRST_SEPARATE with an incoming edge.`)}else if(t===J.LAST_SEPARATE){for(let e of n.getOutgoingEdges())if(!eP(e))throw new Error(`Node '${n.getDesignation()}' has LAST_SEPARATE with an outgoing edge.`)}}function eP(n){let t=n.getSource().getNode(),e=n.getTarget().getNode();return t.getType()===y.EXTERNAL_PORT&&e.getType()===y.EXTERNAL_PORT}var ph=class{process(t,e){e.begin("Layer size calculation",1);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=!1;for(let s of t){let a=s.getSize();if(a.x=0,a.y=0,s.getNodes().length===0)continue;i=!0;for(let d of s){let f=d.getSize(),E=d.getMargin(),P=f.x+E.left+E.right;P>a.x&&(a.x=P)}let l=s.getNodes()[0],c=l.getPosition().y-l.getMargin().top;if(l.getType()===y.EXTERNAL_PORT){let d=t.getProperty(_.SPACING_PORTS_SURROUNDING);d!=null&&(c-=d.top)}let g=s.getNodes()[s.getNodes().length-1],h=g.getPosition().y+g.getSize().y+g.getMargin().bottom;if(g.getType()===y.EXTERNAL_PORT){let d=t.getProperty(_.SPACING_PORTS_SURROUNDING);d!=null&&(h+=d.bottom)}a.y=h-c,c<o&&(o=c),h>r&&(r=h)}i||(o=0,r=0),t.getSize().y=r-o,t.getOffset().y=t.getOffset().y-o,e.done()}};var il=class{constructor(){this._keyToValues=new Map,this._valueToKey=new Map}putAll(t,e){for(let o of e)this.put(t,o)}put(t,e){let o=this._valueToKey.get(e);if(o!==void 0){let i=this._keyToValues.get(o);if(i){let s=i.indexOf(e);s>=0&&i.splice(s,1)}}let r=this._keyToValues.get(t);r==null&&(r=[],this._keyToValues.set(t,r)),r.push(e),this._valueToKey.set(e,t)}getKey(t){return this._valueToKey.get(t)}getValues(t){let e=this._keyToValues.get(t);return e==null?[]:e}keySet(){return this._keyToValues.keys()}isMaximalKey(t){for(let e of this._keyToValues.keys())if(typeof t.compareTo=="function"?t.compareTo(e)<0:t<e)return!1;return!0}isMinimalKey(t){for(let e of this._keyToValues.keys())if(typeof t.compareTo=="function"?t.compareTo(e)>0:t>e)return!1;return!0}};var ut=class{constructor(t){this._name=t}toString(){return this._name}};ut.NONE=new ut("NONE");ut.NIKOLOV=new ut("NIKOLOV");ut.NIKOLOV_PIXEL=new ut("NIKOLOV_PIXEL");ut.NIKOLOV_IMPROVED=new ut("NIKOLOV_IMPROVED");ut.NIKOLOV_IMPROVED_PIXEL=new ut("NIKOLOV_IMPROVED_PIXEL");ut.DUMMYNODE_PERCENTAGE=new ut("DUMMYNODE_PERCENTAGE");ut.NODECOUNT_PERCENTAGE=new ut("NODECOUNT_PERCENTAGE");ut.NO_BOUNDARY=new ut("NO_BOUNDARY");ut.MODEL_ORDER_LEFT_TO_RIGHT=new ut("MODEL_ORDER_LEFT_TO_RIGHT");ut.MODEL_ORDER_RIGHT_TO_LEFT=new ut("MODEL_ORDER_RIGHT_TO_LEFT");var Eh=class{constructor(){this._masterGraph=null,this._nodesWithIncomingEdges=[],this._nodes=[],this._currentWidth=[],this._currentWidthPixel=[],this._layers=[],this._degreeDiff=[],this._maxWidth=0,this._maxWidthPixel=0,this._dummyNodeCount=0,this._maxHeight=0,this._nodeSizeAffix=0,this._dummySize=0,this._promotionStrategy=null,this._biLayerMap=new il}process(t,e){e.begin("Node promotion heuristic",1),this._masterGraph=t,this._promotionStrategy=t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY),this._promotionStrategy!==ut.MODEL_ORDER_LEFT_TO_RIGHT&&this._promotionStrategy!==ut.MODEL_ORDER_RIGHT_TO_LEFT?this._precalculateAndSetInformation():this._precalculateAndSetInformationModelOrder();let o=t.getProperty(_.LAYERING_NODE_PROMOTION_MAX_ITERATIONS),r=()=>!0;switch(this._promotionStrategy){case ut.NIKOLOV:this._promotionMagic(r);break;case ut.NIKOLOV_PIXEL:this._promotionMagic(r);break;case ut.NIKOLOV_IMPROVED:{this._promotionStrategy=ut.NO_BOUNDARY,this._promotionMagic(r);let i=0;for(let s of this._currentWidth)i=Math.max(i,s);i>this._maxWidth&&(this._promotionStrategy=ut.NIKOLOV,this._promotionMagic(r));break}case ut.NIKOLOV_IMPROVED_PIXEL:{this._promotionStrategy=ut.NO_BOUNDARY,this._promotionMagic(r);let i=0;for(let s of this._currentWidthPixel)i=Math.max(i,s);i>this._maxWidthPixel&&(this._promotionStrategy=ut.NIKOLOV_PIXEL,this._promotionMagic(r));break}case ut.NODECOUNT_PERCENTAGE:{let i=Math.ceil(this._layers.length*o/100);this._promotionMagic(s=>s.getSecond()<i);break}case ut.DUMMYNODE_PERCENTAGE:{let i=Math.ceil(this._dummyNodeCount*o/100);this._promotionMagic(s=>s.getFirst()<i);break}case ut.MODEL_ORDER_LEFT_TO_RIGHT:this._modelOrderNodePromotion(!0);break;case ut.MODEL_ORDER_RIGHT_TO_LEFT:this._modelOrderNodePromotion(!1);break;default:this._promotionMagic(r);break}this._promotionStrategy!==ut.MODEL_ORDER_LEFT_TO_RIGHT&&this._promotionStrategy!==ut.MODEL_ORDER_RIGHT_TO_LEFT?this._setNewLayering(t):this._setNewLayeringModelOrder(t),e.done()}_precalculateAndSetInformation(){this._nodeSizeAffix=this._masterGraph.getProperty(_.SPACING_NODE_NODE),this._dummySize=this._masterGraph.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._maxHeight=this._masterGraph.getLayers().length;let t=this._maxHeight-1,e=0;this._maxWidth=0,this._maxWidthPixel=0,this._currentWidth=new Array(this._maxHeight).fill(0),this._currentWidthPixel=new Array(this._maxHeight).fill(0);for(let r of this._masterGraph.getLayers()){r.id=t;for(let i of r.getNodes())i.id=e,e++;t--}this._layers=new Array(e).fill(0),this._degreeDiff=new Array(e);for(let r=0;r<e;r++)this._degreeDiff[r]=[0,0,0];this._nodes=[],this._nodesWithIncomingEdges=[];let o=0;this._dummyNodeCount=0;for(let r of this._masterGraph){t=r.id;let i=0,s=0,a=r.getNodes().length,l=0;for(let g of r.getNodes()){e=g.id,this._layers[e]=g.getLayer().id,l+=g.getSize().y+this._nodeSizeAffix;let h=0;for(let f of g.getIncomingEdges())h++;let d=0;for(let f of g.getOutgoingEdges())d++;this._degreeDiff[e][0]=d-h,this._degreeDiff[e][1]=h,this._degreeDiff[e][2]=d,i+=h,s+=d,h>0&&this._nodesWithIncomingEdges.push(g),this._nodes.push(g)}o-=i;let c=a+o;l+=o*this._dummySize,this._currentWidth[t]=c,this._currentWidthPixel[t]=l,this._maxWidth=Math.max(this._maxWidth,c),this._maxWidthPixel=Math.max(this._maxWidthPixel,l),this._dummyNodeCount+=o,o+=s}}_precalculateAndSetInformationModelOrder(){this._biLayerMap=new il;let t=0,e=0;for(let i of this._masterGraph.getLayers()){i.id=e;for(let s of i.getNodes())s.id=t,t++;e++}let r=this._promotionStrategy===ut.MODEL_ORDER_LEFT_TO_RIGHT?qN:JN;for(let i of this._masterGraph)i.getNodes().sort(r),this._biLayerMap.putAll(i.id,i.getNodes())}_modelOrderNodePromotion(t){let e=0;for(let s of this._masterGraph.getLayers())e+=s.getNodes().length;let o=2*(this._masterGraph.getLayers().length+e)+10,r=0,i;do{i=!1;let a=[...this._biLayerMap.keySet()].length,l=t?a-2:1,c=t?h=>h>=0:h=>h<a,g=t?-1:1;for(let h=l;c(h);h+=g){let d=this._biLayerMap.getValues(h);for(let f=0;f<d.length;f++){let E=d[f];if(!E.hasProperty(p.MODEL_ORDER)||this._biLayerMap.isMaximalKey(h)&&this._promotionStrategy===ut.MODEL_ORDER_LEFT_TO_RIGHT||this._biLayerMap.isMinimalKey(h)&&this._promotionStrategy===ut.MODEL_ORDER_RIGHT_TO_LEFT)continue;let P=!0;for(let x of d){if(!x.hasProperty(p.MODEL_ORDER))continue;let M=E.getProperty(p.MODEL_ORDER),A=x.getProperty(p.MODEL_ORDER);if(t&&M<A||!t&&M>A){P=!1;break}}if(!P)continue;let S=t?h+1:h-1,T=this._biLayerMap.getValues(S),N=!1,I=!0,C=!1;for(let x of T)if(x.hasProperty(p.MODEL_ORDER)){if(x.id!==E.id){let M=x.getProperty(p.MODEL_ORDER),A=E.getProperty(p.MODEL_ORDER);N||(N=t?M<A:M>A),I=!1}}else if(!N&&I&&x.getType()===y.LABEL){C=!0;let M;if(t?M=Bn(x.getIncomingEdges()).getSource().getNode():M=Bn(x.getOutgoingEdges()).getTarget().getNode(),M===E){let A;t?A=Bn(x.getOutgoingEdges()).getTarget().getNode():A=Bn(x.getIncomingEdges()).getSource().getNode(),(t?this._biLayerMap.getKey(A)-this._biLayerMap.getKey(M):this._biLayerMap.getKey(M)-this._biLayerMap.getKey(A))<=2&&(I=!1)}}if(C&&I){let x;t?x=Bn(E.getOutgoingEdges()).getTarget().getNode():x=Bn(E.getIncomingEdges()).getSource().getNode(),(t?this._biLayerMap.getKey(x)-this._biLayerMap.getKey(E):this._biLayerMap.getKey(E)-this._biLayerMap.getKey(x))<=2&&x.getType()===y.NORMAL&&(I=!1)}if(N||I){let x=this._promoteNodeByModelOrder(E,t);for(;x.size>0;){let M=x.values().next().value;x.delete(M);for(let A of this._promoteNodeByModelOrder(M,t))x.add(A)}f--,i=!0}}}}while(i&&++r<o)}_promoteNodeByModelOrder(t,e){let o=this._biLayerMap.getKey(t);e?this._biLayerMap.put(o+1,t):this._biLayerMap.put(o-1,t);let r=new Set,i=e?t.getOutgoingEdges():t.getIncomingEdges();for(let s of i){let a=e?s.getTarget().getNode():s.getSource().getNode();this._biLayerMap.getKey(a)===this._biLayerMap.getKey(t)&&r.add(a)}return r}_promotionMagic(t){let e,o,r=0,i=0,s=this._layers.slice(),a=this._dummyNodeCount,l=this._maxHeight,c=this._currentWidth.slice(),g=this._currentWidthPixel.slice();do{e=0;for(let h of this._nodesWithIncomingEdges){let d=this._promoteNode(h),f=!0;(this._promotionStrategy===ut.NIKOLOV||this._promotionStrategy===ut.NIKOLOV_PIXEL)&&(f=d.getSecond()),d.getFirst()<0&&f?(e++,s=this._layers.slice(),this._dummyNodeCount=this._dummyNodeCount+d.getFirst(),i+=a-this._dummyNodeCount,a=this._dummyNodeCount+d.getFirst(),l=this._maxHeight,c=this._currentWidth.slice(),g=this._currentWidthPixel.slice()):(this._layers=s.slice(),this._dummyNodeCount=a,this._currentWidth=c.slice(),this._currentWidthPixel=g.slice(),this._maxHeight=l)}r++,o=e!==0&&t(Gt.of(i,r))}while(o)}_promoteNode(t){let e=!0,o=0,r=this._layers[t.id],i=t.getSize().y+this._nodeSizeAffix,s=this._degreeDiff[t.id][2];if(this._currentWidth[r]=this._currentWidth[r]-1+s,this._currentWidthPixel[r]=this._currentWidthPixel[r]-i+s*this._dummySize,r++,r>=this._maxHeight)this._maxHeight++,this._currentWidth.push(1),this._currentWidthPixel.push(i);else{let a=this._degreeDiff[t.id][1];this._currentWidth[r]=this._currentWidth[r]+1-a,this._currentWidthPixel[r]=this._currentWidthPixel[r]+i-a*this._dummySize}(this._promotionStrategy===ut.NIKOLOV&&(this._currentWidth[r]>this._maxWidth||this._currentWidth[r-1]>this._maxWidth)||this._promotionStrategy===ut.NIKOLOV_PIXEL&&(this._currentWidthPixel[r]>this._maxWidthPixel||this._currentWidthPixel[r-1]>this._maxWidthPixel))&&(e=!1);for(let a of t.getIncomingEdges()){let l=a.getSource().getNode();if(this._layers[l.id]===r){let c=this._promoteNode(l);o=o+c.getFirst(),e=e&&c.getSecond()}}return this._layers[t.id]=r,o=o+this._degreeDiff[t.id][0],Gt.of(o,e)}_setNewLayering(t){let e=[];for(let o=0;o<=this._maxHeight;o++){let r=new Et(t);r.id=this._maxHeight-o,e.push(r)}for(let o of this._nodes)o.setLayer(e[this._maxHeight-this._layers[o.id]]);for(let o=e.length-1;o>=0;o--)e[o].getNodes().length===0&&e.splice(o,1);t.getLayers().length=0;for(let o of e)t.getLayers().push(o)}_setNewLayeringModelOrder(t){let e=[];t.getLayers().length=0;let o=[...this._biLayerMap.keySet()].sort((r,i)=>r-i);for(let r of o){let i=this._biLayerMap.getValues(r);if(i.length===0)continue;let s=new Et(t);e.push(s),s.id=r;for(let a of i)a.setLayer(s)}for(let r of e)t.getLayers().push(r)}};function qN(n,t){return n.hasProperty(p.MODEL_ORDER)&&t.hasProperty(p.MODEL_ORDER)?t.getProperty(p.MODEL_ORDER)-n.getProperty(p.MODEL_ORDER):0}function JN(n,t){return n.hasProperty(p.MODEL_ORDER)&&t.hasProperty(p.MODEL_ORDER)?n.getProperty(p.MODEL_ORDER)-t.getProperty(p.MODEL_ORDER):0}function Bn(n){for(let t of n)return t;return null}var mh=class{process(t,e){e.begin("Odd port side processing",1);let o=t.getProperty(_.EDGE_ROUTING);for(let r of t){let i=z.toNodeArray(r.getNodes());for(let s of i)if(s.getType()===y.NORTH_SOUTH_PORT){if(o===At.SPLINES)for(let a of s.getPorts())a.getIncomingEdges().length>0&&oy(a),a.getOutgoingEdges().length>0&&ry(a);else if(s.getProperty(p.ORIGIN)instanceof _e)ey(s);else{let a=s.getPorts(),l=!1;if(a.length>=2){l=!0;for(let c=1;c<a.length;c++)if(a[c-1].getProperty(p.ORIGIN)!==a[c].getProperty(p.ORIGIN)){l=!1;break}}for(let c of a)c.getIncomingEdges().length>0&&QN(c,l),c.getOutgoingEdges().length>0&&ty(c,l)}s.setLayer(null)}}e.done()}};function QN(n,t){let e=n.getProperty(p.ORIGIN),o=e.getAbsoluteAnchor().x,r=n.getNode().getPosition().y,i=z.toEdgeArray(n.getIncomingEdges());for(let s of i)if(s.setTarget(e),s.getBendPoints().addLast(o,r),t){let a=s.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,s.setProperty(_.JUNCTION_POINTS,a)),a.add(new O(o,r))}}function ty(n,t){let e=n.getProperty(p.ORIGIN),o=e.getAbsoluteAnchor().x,r=n.getNode().getPosition().y,i=z.toEdgeArray(n.getOutgoingEdges());for(let s of i)if(s.setSource(e),s.getBendPoints().addFirst(o,r),t){let a=s.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,s.setProperty(_.JUNCTION_POINTS,a)),a.add(new O(o,r))}}function ey(n){let t=n.getProperty(p.ORIGIN),e=[...n.getPorts(u.WEST)][0],o=[...n.getPorts(u.EAST)][0],r=e.getProperty(p.ORIGIN),i=o.getProperty(p.ORIGIN);t.setSource(i),t.setTarget(r);let s=new O(o.getNode().getPosition());s.x=i.getAbsoluteAnchor().x,t.getBendPoints().add(s);let a=new O(e.getNode().getPosition());a.x=r.getAbsoluteAnchor().x,t.getBendPoints().add(a)}function oy(n){let t=n.getProperty(p.ORIGIN);t.setProperty(p.SPLINE_NS_PORT_Y_COORD,n.getNode().getPosition().y);let e=z.toEdgeArray(n.getIncomingEdges());for(let o of e)o.setTarget(t)}function ry(n){let t=n.getProperty(p.ORIGIN);t.setProperty(p.SPLINE_NS_PORT_Y_COORD,n.getNode().getPosition().y);let e=z.toEdgeArray(n.getOutgoingEdges());for(let o of e)o.setSource(t)}var ce=class{constructor(t){this._name=t,Object.freeze(this)}toString(){return this._name}};ce.NONE=new ce("NONE");ce.NODES_AND_EDGES=new ce("NODES_AND_EDGES");ce.PREFER_EDGES=new ce("PREFER_EDGES");ce.PREFER_NODES=new ce("PREFER_NODES");var Ph=class{process(t,e){e.begin("Odd port side processing",1);let o=[],r=[];for(let i of t){let s=-1,a=z.toNodeArray(i.getNodes());for(let l of a){s++;let c=l.getProperty(_.PORT_CONSTRAINTS);if(l.getType()!==y.NORMAL||!c.isSideFixed())continue;!c.isOrderFixed()&&l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)===ce.NONE&&iy(l),l.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),o.length=0,r.length=0;let g=[],h=[...l.getPorts(u.NORTH)];l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==ce.NONE&&(h=iP(h)),sP(t,h,o,r,g);let d=s,f=l;for(let S of o)S.setLayer(d,i),s++,S.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),S.getPorts()[0].getProperty(p.ORIGIN).getProperty(_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES)||S.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(f);let E=[];for(let S of l.getPorts(u.SOUTH))E.unshift(S);l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==ce.NONE&&(E=iP(E)),sP(t,E,r,null,g);let P=l;for(let S of r)S.setLayer(++s,i),S.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),S.getPorts()[0].getProperty(p.ORIGIN).getProperty(_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES)||P.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(S);g.length>0&&l.setProperty(p.BARYCENTER_ASSOCIATES,g)}}e.done()}};function iy(n){let t=n.getPorts().length,e=0,o=t,r=2*t;for(let i of n.getPorts()){let s=i.getSide();if(s===u.EAST||s===u.WEST){i.id=-1;continue}if(s!==u.NORTH&&s!==u.SOUTH)continue;let a=i.getIncomingEdges().length,l=i.getOutgoingEdges().length;a>0&&l>0?i.id=o++:a>0?i.id=e++:l>0?i.id=r++:i.id=e++}n.getPorts().sort((i,s)=>{let a=i.getSide(),l=s.getSide();return a!==l?rP(a)-rP(l):i.id===s.id?0:a===u.NORTH?i.id-s.id:s.id-i.id})}function rP(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function iP(n){let t=[],e=[];for(let o of n)o.getIncomingEdges().length>0?t.push(o):e.push(o);return t.reverse(),t.concat(e)}function sP(n,t,e,o,r){let i=[],s=[],a=[],l=[],c=[];for(let g of t)for(let h of g.getOutgoingEdges())h.getSource().getNode()===h.getTarget().getNode()&&(g.getSide()===h.getTarget().getSide()?l.push(h):g.getSide()===u.NORTH&&h.getTarget().getSide()===u.SOUTH&&c.push(h));for(let g of c)ny(n,g,e,o,u.EAST);for(let g of l)sy(n,g,e);for(let g of t){let h=g.getIncomingEdges().length>0,d=g.getOutgoingEdges().length>0;h&&d?a.push(g):h?i.push(g):d&&s.push(g)}for(let g of i)r.push(m_(n,g,null,e));for(let g of s)r.push(m_(n,null,g,e));for(let g of a)r.push(m_(n,g,g,e))}function m_(n,t,e,o){let r=new ft(n);r.setType(y.NORTH_SOUTH_PORT),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS);let i=0;if(t!=null){let s=new rt;s.setProperty(p.ORIGIN,t),r.setProperty(p.ORIGIN,t.getNode()),s.setSide(u.WEST),s.setNode(r);let a=z.toEdgeArray(t.getIncomingEdges());for(let l of a)l.setTarget(s);t.setProperty(p.PORT_DUMMY,r),i++}if(e!=null){let s=new rt;r.setProperty(p.ORIGIN,e.getNode()),s.setProperty(p.ORIGIN,e),s.setSide(u.EAST),s.setNode(r);let a=z.toEdgeArray(e.getOutgoingEdges());for(let l of a)l.setSource(s);e.setProperty(p.PORT_DUMMY,r),i++}return r.setProperty(p.CROSSING_HINT,i),o.push(r),r}function sy(n,t,e){let o=new ft(n);o.setType(y.NORTH_SOUTH_PORT),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setProperty(p.ORIGIN,t);let r=new rt;r.setProperty(p.ORIGIN,t.getTarget()),r.setSide(u.WEST),r.setNode(o);let i=new rt;i.setProperty(p.ORIGIN,t.getSource()),i.setSide(u.EAST),i.setNode(o),t.getSource().setProperty(p.PORT_DUMMY,o),t.getTarget().setProperty(p.PORT_DUMMY,o),t.setSource(null),t.setTarget(null),e.push(o),o.setProperty(p.CROSSING_HINT,2)}function ny(n,t,e,o,r){let i=new ft(n);i.setType(y.NORTH_SOUTH_PORT),i.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),i.setProperty(p.ORIGIN,t.getSource().getNode());let s=new rt;s.setProperty(p.ORIGIN,t.getSource()),s.setSide(r),s.setNode(i),t.getSource().setProperty(p.PORT_DUMMY,i);let a=new ft(n);a.setType(y.NORTH_SOUTH_PORT),a.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),a.setProperty(p.ORIGIN,t.getTarget().getNode());let l=new rt;l.setProperty(p.ORIGIN,t.getTarget()),l.setSide(r),l.setNode(a),t.getTarget().setProperty(p.PORT_DUMMY,a),t.setSource(s),t.setTarget(l),e.unshift(i),o.push(a),i.setProperty(p.CROSSING_HINT,1),a.setProperty(p.CROSSING_HINT,1)}var Oh=class{process(t,e){e.begin("Partition midprocessing",1);let o=new Map;for(let i of t.getLayerlessNodes()){if(!i.hasProperty(_.PARTITIONING_PARTITION))continue;let s=i.getProperty(_.PARTITIONING_PARTITION),a=o.get(s);a==null&&(a=[],o.set(s,a)),a.push(i)}if(o.size===0){e.done();return}let r=Array.from(o.keys()).sort((i,s)=>i-s);for(let i=0;i<r.length-1;i++){let s=o.get(r[i]),a=o.get(r[i+1]);ay(s,a)}e.done()}};function ay(n,t){for(let e of n){let o=new rt;o.setNode(e),o.setSide(u.EAST),o.setProperty(p.PARTITION_DUMMY,!0);for(let r of t){let i=new rt;i.setNode(r),i.setSide(u.WEST),i.setProperty(p.PARTITION_DUMMY,!0);let s=new _e;s.setProperty(p.PARTITION_DUMMY,!0),s.setSource(o),s.setTarget(i)}}}var Sh=class{process(t,e){e.begin("Partition postprocessing",1);for(let o of t)for(let r of o){let i=r.getPorts(),s=0;for(;s<i.length;)i[s].getProperty(p.PARTITION_DUMMY)?i.splice(s,1):s++}e.done()}};var ly=1e3,Th=class{process(t,e){e.begin("Partition preprocessing",1);let o=[];for(let i of t.getLayerlessNodes())i.hasProperty(_.PARTITIONING_PARTITION)&&o.push(i);let r=[];for(let i of o)for(let s of i.getOutgoingEdges())cy(s,o)&&r.push(s);for(let i of r)gy(i,t);e.done()}};function cy(n,t){let e=n.getSource().getNode(),o=n.getTarget().getNode();if(o.hasProperty(_.PARTITIONING_PARTITION)){let l=e.getProperty(_.PARTITIONING_PARTITION),c=o.getProperty(_.PARTITIONING_PARTITION);return l>c}let r=e.getProperty(_.PARTITIONING_PARTITION),i=new Set;for(let l of t)l.getProperty(_.PARTITIONING_PARTITION)<r&&i.add(l);let s=[e],a=new Set([e]);for(;s.length>0;){let l=s.shift();if(i.has(l))return!0;for(let c of l.getOutgoingEdges()){let g=c.getTarget().getNode();a.has(g)||(a.add(g),s.push(g))}}return!1}function gy(n,t){n.reverse(t,!0);let e=ly;n.hasProperty(_.PRIORITY_DIRECTION)&&(e+=n.getProperty(_.PRIORITY_DIRECTION)),n.setProperty(_.PRIORITY_DIRECTION,e)}var Ih=class{process(t,e){e.begin("Port order processing",1);let o=t.getProperty(_.PORT_SORTING_STRATEGY);for(let r of t)for(let i of r){let s=i.getProperty(_.PORT_CONSTRAINTS),a=i.getPorts();s.isOrderFixed()?a.sort(P_):s.isSideFixed()&&(a.sort(gP),hy(a),o==="PORT_DEGREE"&&a.sort(dy)),i.cachePortSides()}e.done()}};function hy(n){if(n.length<=1)return;let t=nP(n,u.SOUTH);aP(n,t[0],t[1]);let e=nP(n,u.WEST);aP(n,e[0],e[1])}function nP(n,t){if(n.length===0)return[0,0];let e=n[0].getSide(),o=0,r=t.ordinal(),i=t.ordinal()+1;for(;o<n.length-1&&e.ordinal()<r;)o++,e=n[o].getSide();let s=o;for(;s<n.length-1&&e.ordinal()<i;)s++,e=n[o].getSide();return[o,s]}function aP(n,t,e){if(e<=t+2)return;let o=Math.floor((e-t)/2);for(let r=0;r<o;r++){let i=n[t+r];n[t+r]=n[e-r-1],n[e-r-1]=i}}var gP=(n,t)=>{let e=n.getSide().ordinal()-t.getSide().ordinal();return e!==0?e:0},dy=(n,t)=>{if(n.getSide().ordinal()!==t.getSide().ordinal())return 0;switch(n.getSide()){case u.EAST:return Nh(t,lP)-Nh(n,lP);case u.WEST:return Nh(n,cP)-Nh(t,cP);default:return 0}};function lP(n){return n.getOutgoingEdges()}function cP(n){return n.getIncomingEdges()}function Nh(n,t){let e=0;for(let o of t(n))o.getProperty(p.REVERSED)||e++;return e}var fy=(n,t)=>{let e=n.getNode().getProperty(_.PORT_CONSTRAINTS);if(n.getSide().ordinal()-t.getSide().ordinal()!==0||!e.isOrderFixed())return 0;if(e===H.FIXED_ORDER){let r=n.getProperty(_.PORT_INDEX),i=t.getProperty(_.PORT_INDEX);if(r!=null&&i!=null){let s=r-i;if(s!==0)return s}}switch(n.getSide()){case u.NORTH:return yh(n.getPosition().x,t.getPosition().x);case u.EAST:return yh(n.getPosition().y,t.getPosition().y);case u.SOUTH:return yh(t.getPosition().x,n.getPosition().x);case u.WEST:return yh(t.getPosition().y,n.getPosition().y);default:throw new Error("Port side is undefined")}};function yh(n,t){return n<t?-1:n>t?1:0}var P_=(n,t)=>{let e=gP(n,t);return e!==0?e:fy(n,t)};var Un=class{process(t,e){e.begin("Port side processing",1);for(let o of t.getLayerlessNodes())hP(o);for(let o of t)for(let r of o)hP(r);e.done()}static setPortSide(t){let e=t.getProperty(p.PORT_DUMMY);e!=null?t.setSide(e.getProperty(p.EXT_PORT_SIDE)):t.getNetFlow()<0?t.setSide(u.EAST):t.setSide(u.WEST)}};function hP(n){if(n.getProperty(_.PORT_CONSTRAINTS).isSideFixed())for(let t of n.getPorts())t.getSide()===u.UNDEFINED&&Un.setPortSide(t);else{for(let t of n.getPorts())Un.setPortSide(t);n.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE)}}var Rh=class{process(t,e){e.begin("Restoring reversed edges",1);for(let o of t)for(let r of o)for(let i of r.getPorts()){let s=i.getOutgoingEdges().slice();for(let a of s)a.getProperty(p.REVERSED)&&a.reverse(t,!1)}e.done()}};var Je=class{constructor(t){this._name=t}toString(){return this._name}};Je.STACKED=new Je("STACKED");Je.REVERSE_STACKED=new Je("REVERSE_STACKED");Je.SEQUENCED=new Je("SEQUENCED");var kt=class n{constructor(t){this._name=t}toString(){return this._name}static fromPortSides(t){if(t.has(u.UNDEFINED))throw new Error("Port sides must not contain UNDEFINED");switch(t.size){case 1:return n.ONE_SIDE;case 2:{let e=t.has(u.EAST)&&t.has(u.WEST),o=t.has(u.NORTH)&&t.has(u.SOUTH);return e||o?n.TWO_SIDES_OPPOSING:n.TWO_SIDES_CORNER}case 3:return n.THREE_SIDES;case 4:return n.FOUR_SIDES;default:return null}}};kt.ONE_SIDE=new kt("ONE_SIDE");kt.TWO_SIDES_CORNER=new kt("TWO_SIDES_CORNER");kt.TWO_SIDES_OPPOSING=new kt("TWO_SIDES_OPPOSING");kt.THREE_SIDES=new kt("THREE_SIDES");kt.FOUR_SIDES=new kt("FOUR_SIDES");var Lh=class{constructor(){this._slLoopsByType=null,this._targetAreas=null}restorePorts(t,e){this._initTargetAreas(),this._slLoopsByType=uy(t),this._processOneSideLoops(t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_ORDERING)),this._processTwoSideCornerLoops(),this._processThreeSideLoops(),this._processFourSideLoops(),this._processTwoSideOpposingLoops(),this._restorePorts(t);for(let o=0;o<4;o++)for(let r=0;r<3;r++)for(let i of this._targetAreas[o][r])i.setHidden(!1);t.setPortsHidden(!1),this._slLoopsByType=null,this._targetAreas=null}_initTargetAreas(){this._targetAreas=[];for(let t=0;t<4;t++)this._targetAreas.push([[],[],[]])}_processOneSideLoops(t){var o;let e=(o=this._slLoopsByType.get(kt.ONE_SIDE))!=null?o:[];t===Je.REVERSE_STACKED&&e.reverse();for(let r of e){let i=r.getSLPorts()[0].getLPort().getSide(),s=r.getSLPorts().slice();if(s.sort((a,l)=>a.getSLNetFlow()-l.getSLNetFlow()),t===Je.SEQUENCED)this._addToTargetAreaPorts(s,i,Pe.MIDDLE,qo.APPEND);else{let a=_y(s);this._addToTargetAreaPorts(s.slice(0,a),i,Pe.MIDDLE,qo.PREPEND),this._addToTargetAreaPorts(s.slice(a),i,Pe.MIDDLE,qo.APPEND)}}}_processTwoSideCornerLoops(){var e;let t=(e=this._slLoopsByType.get(kt.TWO_SIDES_CORNER))!=null?e:[];for(let o of t){let r=Ah(o);this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.START,qo.APPEND)}}_processTwoSideOpposingLoops(){var e;let t=(e=this._slLoopsByType.get(kt.TWO_SIDES_OPPOSING))!=null?e:[];for(let o of t){let r=Ah(o);this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.START,qo.APPEND)}}_processThreeSideLoops(){var e;let t=(e=this._slLoopsByType.get(kt.THREE_SIDES))!=null?e:[];for(let o of t){let r=Oy(o);r!=null&&(this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.MIDDLE,qo.APPEND),this._addToTargetAreaLoop(o,r[2],Pe.START,qo.APPEND))}}_processFourSideLoops(){var e;let t=(e=this._slLoopsByType.get(kt.FOUR_SIDES))!=null?e:[];for(let o of t){let r=o.getSLPortsBySide();if(r!=null)for(let i of r.keys())this._addToTargetAreaLoop(o,i,Pe.MIDDLE,qo.APPEND)}}_addToTargetAreaLoop(t,e,o,r){let i=t.getSLPortsOnSide(e);this._addToTargetAreaPorts(i,e,o,r)}_addToTargetAreaPorts(t,e,o,r){let i=[];for(let a of t)a.isHidden()&&i.push(a);i.reverse();let s=this._targetAreas[Cs(e)][o];r===qo.PREPEND?s.unshift(...i):s.push(...i)}_restorePorts(t){let e=t.getLNode(),o=e.getPorts().slice(),r=0,i=e.getPorts();i.length=0;let s=Cs(u.NORTH),a=Cs(u.EAST),l=Cs(u.SOUTH),c=Cs(u.WEST),g=this._targetAreas;Jo(g[s][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.NORTH&&Sy(h),i),Jo(g[s][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.NORTH,i),Jo(g[s][Pe.END],e),Jo(g[a][Pe.START],e),Jo(g[a][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.EAST,i),Jo(g[a][Pe.END],e),Jo(g[l][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.SOUTH&&Ty(h),i),Jo(g[l][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.SOUTH,i),Jo(g[l][Pe.END],e),Jo(g[c][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.WEST,i),Jo(g[c][Pe.MIDDLE],e),Jo(g[c][Pe.END],e)}},Pe={START:0,MIDDLE:1,END:2},qo={PREPEND:"PREPEND",APPEND:"APPEND"};function Cs(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function uy(n){let t=new Map;for(let e of n.getSLHyperLoops()){let o=e.getSelfLoopType(),r=t.get(o);r==null&&(r=[],t.set(o,r)),r.push(e)}return t}function _y(n){let t=0;for(;t<n.length&&n[t].getSLNetFlow()<=0;)t++;if(t>0&&t<n.length-1)return t;let e=0;for(;e<n.length&&n[e].getSLNetFlow()<=0;)e++;return e>0&&t<n.length-1?e:Math.floor(n.length/2)}function Ah(n){let e=[...n.getSLPortsBySide().keys()];return e.sort((o,r)=>Cs(o)-Cs(r)),e[0]===u.NORTH&&e[1]===u.WEST&&(e[0]=u.WEST,e[1]=u.NORTH),e}var py=[u.NORTH,u.EAST,u.SOUTH],Ey=[u.EAST,u.SOUTH,u.WEST],my=[u.SOUTH,u.WEST,u.NORTH],Py=[u.WEST,u.NORTH,u.EAST];function Oy(n){let t=n.getSLPortsBySide();return t==null?null:t.has(u.NORTH)?t.has(u.EAST)?t.has(u.SOUTH)?t.has(u.WEST)?null:py:Py:my:Ey}function Jo(n,t){for(let e of n)e.getLPort().setNode(t)}function Fn(n,t,e,o){for(let r=t;r<n.length;r++){let i=n[r];if(e(i))o.push(i);else return r}return n.length}function Sy(n){return dP(n).has(u.WEST)}function Ty(n){return dP(n).has(u.EAST)}function dP(n){let t=new Set,e=n.getProperty(p.PORT_DUMMY);if(e!=null){for(let o of e.getPorts())if(o.getProperty(p.ORIGIN)===n){let r=o.getConnectedEdges();for(let i of r){t.add(o.getSide());break}}}return t}var Qo=class{constructor(t){this._name=t}toString(){return this._name}};Qo.EQUALLY=new Qo("EQUALLY");Qo.NORTH=new Qo("NORTH");Qo.NORTH_SOUTH=new Qo("NORTH_SOUTH");var Qt=class{constructor(t,e,o){this._name=t,this.firstSide=e,this.secondSide=o}toString(){return this._name}isCornerTarget(){return this.firstSide!==this.secondSide}};Qt.NORTH=new Qt("NORTH",u.NORTH,u.NORTH);Qt.SOUTH=new Qt("SOUTH",u.SOUTH,u.SOUTH);Qt.EAST=new Qt("EAST",u.EAST,u.EAST);Qt.WEST=new Qt("WEST",u.WEST,u.WEST);Qt.NORTH_WEST_CORNER=new Qt("NORTH_WEST_CORNER",u.WEST,u.NORTH);Qt.NORTH_EAST_CORNER=new Qt("NORTH_EAST_CORNER",u.NORTH,u.EAST);Qt.SOUTH_WEST_CORNER=new Qt("SOUTH_WEST_CORNER",u.SOUTH,u.WEST);Qt.SOUTH_EAST_CORNER=new Qt("SOUTH_EAST_CORNER",u.EAST,u.SOUTH);Qt._values=[Qt.NORTH,Qt.SOUTH,Qt.EAST,Qt.WEST,Qt.NORTH_WEST_CORNER,Qt.NORTH_EAST_CORNER,Qt.SOUTH_WEST_CORNER,Qt.SOUTH_EAST_CORNER];var Ch=class{assignPortSides(t){let e=t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_DISTRIBUTION);switch(e!=null?e.toString():null){case"NORTH":this._assignToNorthSide(t);break;case"NORTH_SOUTH":this._assignToNorthOrSouthSide(t);break;case"EQUALLY":this._assignToAllSides(t);break;default:this._assignToNorthSide(t);break}}_assignToNorthSide(t){for(let e of t.getSLHyperLoops())for(let o of this._hiddenSelfLoopPorts(e))o.getLPort().setSide(u.NORTH)}_assignToNorthOrSouthSide(t){let e=0,o=0;for(let r of t.getSLHyperLoops()){let i=this._hiddenSelfLoopPorts(r),s=null;if(e<=o?(s=u.NORTH,e+=i.length):o<e&&(s=u.SOUTH,o+=i.length),s!=null)for(let a of i)a.getLPort().setSide(s)}}_assignToAllSides(t){let e=t.getSLHyperLoops().slice();e.sort((i,s)=>s.getSLPorts().length-i.getSLPorts().length);let o=Qt._values,r=0;for(let i of e){let s=o[r%o.length];this._assignToTarget(i,s),r++}}_assignToTarget(t,e){let o=t.getSLPorts();e.isCornerTarget()&&o.sort((i,s)=>i.getLPort().getNetFlow()-s.getLPort().getNetFlow());let r=Math.floor(o.length/2);for(let i=0;i<r;i++){let s=o[i];s.isHidden()&&s.getLPort().setSide(e.firstSide)}for(let i=r;i<o.length;i++){let s=o[i];s.isHidden()&&s.getLPort().setSide(e.secondSide)}}_hiddenSelfLoopPorts(t){let e=[];for(let o of t.getSLPorts())o.isHidden()&&e.push(o);return e}};p.ORIGINAL_PORT_CONSTRAINTS;var xh=class{constructor(){this._portSideAssigner=new Ch,this._portRestorer=new Lh}process(t,e){e.begin("Self-Loop ordering",1);for(let o of t.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.NORMAL||!r.hasProperty(p.SELF_LOOP_HOLDER))continue;let i=r.getProperty(p.SELF_LOOP_HOLDER);this._processNode(i,e)}e.done()}_processNode(t,e){if(t.arePortsHidden()){let o=t.getLNode().getProperty(p.ORIGINAL_PORT_CONSTRAINTS);o===H.UNDEFINED||o===H.FREE||o==null?(this._portSideAssigner.assignPortSides(t),O_(t),this._portRestorer.restorePorts(t,e)):o===H.FIXED_SIDE&&(O_(t),this._portRestorer.restorePorts(t,e))}else O_(t)}};function O_(n){for(let t of n.getSLHyperLoops())t.computePortsPerSide()}var Dh=class{process(t,e){e.begin("Self-Loop post-processing",1);for(let o of t.getLayers())for(let r of o.getNodes())r.getType()===y.NORMAL&&r.hasProperty(p.SELF_LOOP_HOLDER)&&Ny(r);e.done()}};function Ny(n){let t=n.getProperty(p.SELF_LOOP_HOLDER);for(let e of t.getSLHyperLoops())for(let o of e.getSLEdges())yy(n,o);for(let e of t.getSLHyperLoops()){let o=e.getSLLabels();o!=null&&o.applyPlacement(n.getPosition())}}function yy(n,t){let e=t.getLEdge();e.setSource(t.getSLSource().getLPort()),e.setTarget(t.getSLTarget().getLPort()),e.getBendPoints().offset(n.getPosition())}var wh=class{constructor(t,e,o){this._lEdge=t,this._slHyperLoop=null,this._slSource=e,this._slTarget=o,e.getOutgoingSLEdges().push(this),o.getIncomingSLEdges().push(this)}getLEdge(){return this._lEdge}getSLHyperLoop(){return this._slHyperLoop}setSLHyperLoop(t){this._slHyperLoop=t}getSLSource(){return this._slSource}getSLTarget(){return this._slTarget}isInline(){for(let t of this._lEdge.getLabels())if(t.getProperty(_.EDGE_LABELS_INLINE))return!0;return!1}getLabelSide(){return this._slHyperLoop.getSLLabels().getSide()}};var Mh=class{constructor(t){this._lPort=t,this._incomingSLEdges=[],this._outgoingSLEdges=[],this._isHidden=!1;let e=!0;for(let o of t.getConnectedEdges())if(!o.isSelfLoop()){e=!1;break}this._hadOnlySelfLoops=e}getLPort(){return this._lPort}hadOnlySelfLoops(){return this._hadOnlySelfLoops}isHidden(){return this._isHidden}setHidden(t){this._isHidden=t}getIncomingSLEdges(){return this._incomingSLEdges}getOutgoingSLEdges(){return this._outgoingSLEdges}getSLNetFlow(){return this._incomingSLEdges.length-this._outgoingSLEdges.length}};var It=class{constructor(t){this._name=t}toString(){return this._name}};It.CENTER=new It("CENTER");It.LEFT=new It("LEFT");It.RIGHT=new It("RIGHT");It.TOP=new It("TOP");var bh=class{constructor(t){this.id=0,this._lLabels=[],this._size=new O,this._position=new O,this._side=null,this._alignment=null,this._alignmentReferenceSLPort=null;let e=t.getSLHolder().getLNode();this._layoutDirection=e.getGraph().getProperty(_.DIRECTION),this._labelLabelSpacing=z.getIndividualOrInherited(e,_.SPACING_LABEL_LABEL)}addLLabels(t){for(let e of t)this._lLabels.push(e),this._updateSize(e)}getLLabels(){return this._lLabels}_updateSize(t){let e=t.getSize();this._layoutDirection!=null&&this._layoutDirection.isHorizontal&&this._layoutDirection.isHorizontal()?(this._size.x=Math.max(this._size.x,e.x),this._size.y+=e.y,this._lLabels.length>1&&(this._size.y+=this._labelLabelSpacing)):(this._size.x+=e.x,this._size.y=Math.max(this._size.y,e.y),this._lLabels.length>1&&(this._size.x+=this._labelLabelSpacing))}applyLabelManagement(t,e){let o=this._layoutDirection!=null&&this._layoutDirection.isVertical&&this._layoutDirection.isVertical(),r=As(t,this._lLabels,e,this._labelLabelSpacing,o);this._size.x=r.x,this._size.y=r.y}applyPlacement(t){this._layoutDirection!=null&&this._layoutDirection.isHorizontal&&this._layoutDirection.isHorizontal()?this._applyPlacementForHorizontalLayout(t):this._applyPlacementForVerticalLayout(t)}_applyPlacementForHorizontalLayout(t){let e=this._position.x,o=this._position.y;for(let r of this._lLabels){let i=r.getPosition();this._alignment===It.LEFT||this._side===u.EAST?i.x=e:this._alignment===It.RIGHT||this._side===u.WEST?i.x=e+this._size.x-r.getSize().x:i.x=e+(this._size.x-r.getSize().x)/2,i.y=o,i.add(t),o+=r.getSize().y+this._labelLabelSpacing}}_applyPlacementForVerticalLayout(t){let e=this._position.x,o=this._position.y;for(let r of this._lLabels){let i=r.getPosition();i.x=e,this._side===u.NORTH?i.y=o+this._size.y-r.getSize().y:i.y=o,i.add(t),e+=r.getSize().x+this._labelLabelSpacing}}getSize(){return this._size}getPosition(){return this._position}getSide(){return this._side}setSide(t){this._side=t}getAlignment(){return this._alignment}setAlignment(t){this._alignment=t}getAlignmentReferenceSLPort(){return this._alignmentReferenceSLPort}setAlignmentReferenceSLPort(t){this._alignmentReferenceSLPort=t}};var Gh=class{constructor(t){this._slHolder=t,this._slPorts=[],this._slEdges=new Set,this._slLabels=null,this._selfLoopType=null,this._slPortsBySide=null,this._leftmostPort=null,this._rightmostPort=null,this._occupiedPortSides=new Set,this._routingSlot=new Array(4).fill(0)}computePortsPerSide(){this._slPortsBySide=new Map;let t=new Set;for(let e of this._slPorts){let o=e.getLPort().getSide();if(o===u.UNDEFINED)throw new Error("Port side must not be UNDEFINED");let r=this._slPortsBySide.get(o);r==null&&(r=[],this._slPortsBySide.set(o,r)),r.push(e),t.add(o)}this._selfLoopType=kt.fromPortSides(t)}getSLHolder(){return this._slHolder}addSelfLoopEdge(t){if(this._slEdges.has(t))return;this._slEdges.add(t),t.setSLHyperLoop(this);let e=t.getSLSource();this._slPorts.includes(e)||this._slPorts.push(e);let o=t.getSLTarget();this._slPorts.includes(o)||this._slPorts.push(o);let r=t.getLEdge().getLabels();r.length>0&&(this._slLabels==null&&(this._slLabels=new bh(this)),this._slLabels.addLLabels(r))}getSLPorts(){return this._slPorts}getSLEdges(){return this._slEdges}getSLLabels(){return this._slLabels}getSelfLoopType(){return this._selfLoopType}getSLPortsBySide(){return this._slPortsBySide}getSLPortsOnSide(t){return this._slPortsBySide!=null&&this._slPortsBySide.has(t)?this._slPortsBySide.get(t):[]}hasSLPortsOnSide(t){return this._slPortsBySide!=null&&this._slPortsBySide.has(t)}getLeftmostPort(){return this._leftmostPort}setLeftmostPort(t){this._leftmostPort=t}getRightmostPort(){return this._rightmostPort}setRightmostPort(t){this._rightmostPort=t}getOccupiedPortSides(){return this._occupiedPortSides}getRoutingSlot(t){return this._routingSlot[fP(t)]}setRoutingSlot(t,e){let o=fP(t);this._routingSlot[o]=e;let r=this._slHolder.getRoutingSlotCount();r[o]=Math.max(r[o],e+1)}},Iy=new Map([[u.NORTH,0],[u.EAST,1],[u.SOUTH,2],[u.WEST,3],[u.UNDEFINED,4]]);function fP(n){var t;return(t=Iy.get(n))!=null?t:4}var Hh=0,Ry=1,sl=class n{constructor(t){this._lNode=t,this._slHyperLoops=[],this._slPorts=new Map,this._arePortsHidden=!1,this._routingSlotCount=[0,0,0,0]}static install(t){let e=new n(t);return t.setProperty(p.SELF_LOOP_HOLDER,e),e._initialize(),e}static needsSelfLoopProcessing(t){if(t.getType()!==y.NORMAL)return!1;for(let e of t.getOutgoingEdges())if(e.isSelfLoop())return!0;return!1}_initialize(){for(let t of this._lNode.getOutgoingEdges())t.isSelfLoop()&&new wh(t,this._selfLoopPortFor(t.getSource()),this._selfLoopPortFor(t.getTarget()));for(let t of this._slPorts.values())t.getLPort().id=Hh;for(let t of this._slPorts.values())t.getLPort().id===Hh&&this._slHyperLoops.push(this._initializeHyperLoop(t))}_selfLoopPortFor(t){let e=this._slPorts.get(t);return e==null&&(e=new Mh(t),this._slPorts.set(t,e)),e}_initializeHyperLoop(t){let e=new Gh(this),o=[t];for(;o.length>0;){let r=o.shift();r.getLPort().id=Ry;for(let i of r.getOutgoingSLEdges()){e.addSelfLoopEdge(i);let s=i.getSLTarget();s.getLPort().id===Hh&&o.push(s)}for(let i of r.getIncomingSLEdges()){e.addSelfLoopEdge(i);let s=i.getSLSource();s.getLPort().id===Hh&&o.push(s)}}return e}getLNode(){return this._lNode}getSLHyperLoops(){return this._slHyperLoops}getSLPortMap(){return this._slPorts}arePortsHidden(){return this._arePortsHidden}setPortsHidden(t){this._arePortsHidden=t}getRoutingSlotCount(){return this._routingSlotCount}static ordinalOf(t){switch(t){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}};var vh=class{process(t,e){e.begin("Self-Loop pre-processing",1);for(let o of t.getLayerlessNodes())if(sl.needsSelfLoopProcessing(o)){let r=sl.install(o);Ly(r),Ay(r)}e.done()}};function Ly(n){for(let t of n.getSLHyperLoops())for(let e of t.getSLEdges()){let o=e.getLEdge();o.setSource(null),o.setTarget(null)}}function Ay(n){let t=n.getLNode(),e=t.getNestedGraph(),o=t.getProperty(_.PORT_CONSTRAINTS),r=o!=null&&o.isOrderFixed(),i=e!=null&&e.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS);if(!(r||i))for(let s of n.getSLPortMap().values()){if(!s.hadOnlySelfLoops())continue;s.getLPort().setNode(null),s.setHidden(!0),n.setPortsHidden(!0)}}var Bh=class{placeLabels(t,e,o){this._assignSideAndAlignment(t);for(let r of t.getSLHyperLoops())r.getSLLabels()!=null&&(e!=null&&this._manageLabels(r,e),this._computeCoordinates(r))}_assignSideAndAlignment(t){let e=null,o=null,r=t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_ORDERING);r===Je.SEQUENCED&&(e=[],o=[]);for(let i of t.getSLHyperLoops())if(i.getSLLabels()!=null)switch(i.getSelfLoopType()){case kt.ONE_SIDE:{let a=i.getOccupiedPortSides().values().next().value;r===Je.SEQUENCED&&a===u.NORTH?e.push(i):r===Je.SEQUENCED&&a===u.SOUTH?o.push(i):this._assignOneSidedSimpleSideAndAlignment(i,a);break}case kt.TWO_SIDES_CORNER:this._assignTwoSidesCornerSideAndAlignment(i);break;case kt.TWO_SIDES_OPPOSING:case kt.THREE_SIDES:this._assignTwoSidesOpposingAndThreeSidesSideAndAlignment(i);break;case kt.FOUR_SIDES:this._assignFourSidesSideAndAlignment(i);break;default:throw new Error("Unknown self loop type: "+i.getSelfLoopType())}e!=null&&(e.length>0&&this._assignOneSidedSequencedSideAndAlignment(e,u.NORTH),o.length>0&&this._assignOneSidedSequencedSideAndAlignment(o,u.SOUTH))}_assignOneSidedSimpleSideAndAlignment(t,e){for(let o of t.getSLLabels().getLLabels())o.setProperty(_.EDGE_LABELS_INLINE,null);switch(e){case u.EAST:case u.WEST:{let o=t.getLeftmostPort();t.getRightmostPort().getLPort().getPosition().y<o.getLPort().getPosition().y&&(o=t.getRightmostPort()),this._assignSideAndAlignmentFor(t,e,It.TOP,o);break}case u.NORTH:case u.SOUTH:this._assignSideAndAlignmentFor(t,e,It.CENTER,null);break;default:throw new Error("Invalid loop side: "+e)}}_assignOneSidedSequencedSideAndAlignment(t,e){let o=0;for(let s of t[0].getSLHolder().getLNode().getPorts())s.id=o++;e===u.NORTH?t.sort((s,a)=>s.getLeftmostPort().getLPort().id-a.getLeftmostPort().getLPort().id):t.sort((s,a)=>a.getLeftmostPort().getLPort().id-s.getLeftmostPort().getLPort().id);let r=0,i=t.length-1;for(;r<i;){let s=t[r],a=t[i],l=e===u.NORTH?s.getRightmostPort():s.getLeftmostPort(),c=e===u.NORTH?a.getLeftmostPort():a.getRightmostPort();this._assignSideAndAlignmentFor(s,e,It.RIGHT,l),this._assignSideAndAlignmentFor(a,e,It.LEFT,c),r++,i--}r===i&&this._assignSideAndAlignmentFor(t[r],e,It.CENTER,null)}_assignTwoSidesCornerSideAndAlignment(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getRightmostPort().getLPort().getSide();for(let r of t.getSLLabels().getLLabels())r.setProperty(_.EDGE_LABELS_INLINE,null);if(e===u.NORTH)this._assignSideAndAlignmentFor(t,u.NORTH,It.LEFT,t.getLeftmostPort());else if(o===u.NORTH)this._assignSideAndAlignmentFor(t,u.NORTH,It.RIGHT,t.getRightmostPort());else if(e===u.SOUTH)this._assignSideAndAlignmentFor(t,u.SOUTH,It.RIGHT,t.getLeftmostPort());else if(o===u.SOUTH)this._assignSideAndAlignmentFor(t,u.SOUTH,It.LEFT,t.getRightmostPort());else throw new Error("Invalid two-sides-corner configuration")}_assignTwoSidesOpposingAndThreeSidesSideAndAlignment(t){let e=t.getOccupiedPortSides(),o=!1;for(let r of t.getSLLabels().getLLabels())if(r.getProperty(_.EDGE_LABELS_INLINE)){o=!0;break}if(!e.has(u.NORTH))this._assignSideAndAlignmentFor(t,u.SOUTH,It.CENTER,null);else if(!e.has(u.SOUTH))this._assignSideAndAlignmentFor(t,u.NORTH,It.CENTER,null);else if(!e.has(u.WEST))this._assignSideAndAlignmentFor(t,o?u.EAST:u.NORTH,o?It.CENTER:It.LEFT,o?null:t.getLeftmostPort());else if(!e.has(u.EAST))this._assignSideAndAlignmentFor(t,o?u.WEST:u.NORTH,o?It.CENTER:It.RIGHT,o?null:t.getRightmostPort());else throw new Error("All sides occupied for two-sides-opposing / three-sides loop")}_assignFourSidesSideAndAlignment(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getLeftmostPort().getLPort().getSide();for(let r of t.getSLLabels().getLLabels())r.setProperty(_.EDGE_LABELS_INLINE,null);e===u.NORTH||o===u.NORTH?this._assignSideAndAlignmentFor(t,u.SOUTH,It.CENTER,null):this._assignSideAndAlignmentFor(t,u.NORTH,It.CENTER,null)}_assignSideAndAlignmentFor(t,e,o,r){let i=t.getSLLabels();i.setSide(e),i.setAlignment(o),i.setAlignmentReferenceSLPort(r)}_manageLabels(t,e){let o=t.getSLLabels(),r=o.getAlignmentReferenceSLPort(),s=t.getSLHolder().getLNode().getSize(),a=t.getSLHolder().getLNode().getMargin(),l=0;switch(o.getAlignment()){case It.CENTER:l=a.left+s.x+a.right;break;case It.LEFT:l=s.x-r.getLPort().getPosition().x-r.getLPort().getAnchor().x+a.right;break;case It.RIGHT:l=a.left+r.getLPort().getPosition().x+r.getLPort().getAnchor().x;break;case It.TOP:l=ol;break;default:throw new Error("Invalid alignment: "+o.getAlignment())}o.applyLabelManagement(e,Math.max(l,ol))}_computeCoordinates(t){let e=t.getSLLabels(),o=e.getAlignmentReferenceSLPort(),r=e.getSize(),i=e.getPosition();switch(e.getAlignment()){case It.CENTER:i.x=(t.getSLHolder().getLNode().getSize().x-r.x)/2;break;case It.LEFT:i.x=o.getLPort().getPosition().x+o.getLPort().getAnchor().x;break;case It.RIGHT:i.x=o.getLPort().getPosition().x+o.getLPort().getAnchor().x-r.x;break;case It.TOP:i.y=o.getLPort().getPosition().y+o.getLPort().getAnchor().y;break;default:throw new Error("Invalid alignment: "+e.getAlignment())}}};var Uh=class{routeSelfLoops(t){throw new Error("AbstractSelfLoopRouter.routeSelfLoops() must be overridden")}};var ni=Object.freeze({CLOCKWISE:"CLOCKWISE",COUNTER_CLOCKWISE:"COUNTER_CLOCKWISE"}),Ui=class extends Uh{routeSelfLoops(t){let e=t.getLNode(),o=e.getSize(),r=e.getMargin(),i=z.getIndividualOrInherited(e,_.SPACING_EDGE_EDGE),s=z.getIndividualOrInherited(e,_.SPACING_EDGE_LABEL),a=z.getIndividualOrInherited(e,_.SPACING_NODE_SELF_LOOP),l=new Gr;l.set(r);let c=this._computeRoutingSlotPositions(t,i,s,a);for(let g of t.getSLHyperLoops()){for(let d of g.getSLEdges()){let f=d.getLEdge(),E=xy(d),P=this.computeOrthogonalBendPoints(d,E,c);P=this.modifyBendPoints(d,E,P);let S=f.getBendPoints();S.length=0;for(let T of P)S.push(T);for(let T of P)S_(o,l,T)}let h=g.getSLLabels();h!=null&&(Dy(g,h,c,s),wy(o,l,h))}r.set(l)}_computeRoutingSlotPositions(t,e,o,r){let i=new Array(5);for(let s of u.values())i[s.ordinal()]=new Array(t.getRoutingSlotCount()[Cy(s)]).fill(0);return uP(i,t,u.NORTH),uP(i,t,u.SOUTH),Fh(i,t,u.NORTH,e,o,r),Fh(i,t,u.EAST,e,o,r),Fh(i,t,u.SOUTH,e,o,r),Fh(i,t,u.WEST,e,o,r),i}computeOrthogonalBendPoints(t,e,o){let r=new st;return _P(t,t.getSLSource(),o,r),by(t,e,o,r),_P(t,t.getSLTarget(),o,r),r}modifyBendPoints(t,e,o){return o}};function Cy(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function xy(n){let t=n.getSLSource().getLPort(),e=t.getSide(),o=n.getSLTarget().getLPort(),r=o.getSide();return e===r?t.id<o.id?ni.CLOCKWISE:ni.COUNTER_CLOCKWISE:e.right()===r?ni.CLOCKWISE:e.left()===r?ni.COUNTER_CLOCKWISE:n.getSLHyperLoop().getOccupiedPortSides().has(e.right())?ni.CLOCKWISE:ni.COUNTER_CLOCKWISE}function Dy(n,t,e,o){let r=t.getSide(),i=e[r.ordinal()][n.getRoutingSlot(r)],s=!1;for(let l of t.getLLabels())if(l.getProperty(_.EDGE_LABELS_INLINE)){s=!0;break}let a=s?0:o;switch(r){case u.NORTH:i-=a+t.getSize().y,t.getPosition().y=i;break;case u.SOUTH:i+=a,t.getPosition().y=i;break;case u.WEST:i-=a+t.getSize().x,t.getPosition().x=i;break;case u.EAST:i+=a,t.getPosition().x=i;break;default:throw new Error("Invalid label side: "+r)}}function S_(n,t,e){t.left=Math.max(t.left,-e.x),t.right=Math.max(t.right,e.x-n.x),t.top=Math.max(t.top,-e.y),t.bottom=Math.max(t.bottom,e.y-n.y)}function wy(n,t,e){let o=new O(e.getPosition().x,e.getPosition().y);S_(n,t,o),o.add(e.getSize()),S_(n,t,o)}function uP(n,t,e){let o=n[e.ordinal()];for(let r of t.getSLHyperLoops()){let i=r.getSLLabels();if(i!=null&&i.getSide()===e){let s=r.getRoutingSlot(e);o[s]=Math.max(o[s],i.getSize().y)}}}function Fh(n,t,e,o,r,i){let s=My(t,e,i),a=e===u.NORTH||e===u.WEST?-1:1,l=n[e.ordinal()];for(let c=0;c<l.length;c++){let g=l[c];g>0&&(g+=r),l[c]=s,s+=a*(g+o)}}function My(n,t,e){let o=n.getLNode(),r=o.getMargin();switch(t){case u.NORTH:return-r.top-e;case u.EAST:return o.getSize().x+r.right+e;case u.SOUTH:return o.getSize().y+r.bottom+e;case u.WEST:return-r.left-e;default:throw new Error("Invalid port side: "+t)}}function _P(n,t,e,o){let r=n.getSLHyperLoop(),i=t.getLPort(),s=i.getSide(),a=T_(s,r.getRoutingSlot(s),e),l=new O(i.getPosition().x,i.getPosition().y);switch(l.add(i.getAnchor()),s){case u.NORTH:case u.SOUTH:a.x+=l.x;break;case u.EAST:case u.WEST:a.y+=l.y;break;default:throw new Error("Invalid port side: "+s)}o.add(a)}function by(n,t,e,o){let r=n.getSLSource().getLPort(),i=n.getSLTarget().getLPort();if(r.getSide()===i.getSide())return;let s=n.getSLHyperLoop(),a=null,l=null,c=n.isInline();c&&s.getSLLabels()!=null&&(a=n.getLabelSide(),l=s.getSLLabels().getSize());let g=r.getSide();for(;g!==i.getSide();){let h=t===ni.CLOCKWISE?g.right():g.left(),d=T_(g,s.getRoutingSlot(g),e),f=T_(h,s.getRoutingSlot(h),e);c&&a!=null&&l!=null&&(g===a?pP(d,a,l):h===a&&pP(f,a,l)),o.add(d.add(f)),g=h}}function T_(n,t,e){let o=e[n.ordinal()][t];switch(n){case u.NORTH:case u.SOUTH:return new O(0,o);case u.EAST:case u.WEST:return new O(o,0);default:throw new Error("Invalid port side: "+n)}}function pP(n,t,e){switch(t){case u.NORTH:n.y-=e.y/2;break;case u.SOUTH:n.y+=e.y/2;break;case u.WEST:n.x-=e.x/2;break;case u.EAST:n.x+=e.x/2;break;default:break}}var Gy=10,kh=.01,Wh=class extends Ui{modifyBendPoints(t,e,o){let r=t.getSLSource().getLPort(),i=new O(r.getPosition().x,r.getPosition().y);i.add(r.getAnchor()),o.splice(0,0,i);let s=t.getSLTarget().getLPort(),a=new O(s.getPosition().x,s.getPosition().y);return a.add(s.getAnchor()),o.push(a),this.cutCorners(o,Gy)}cutCorners(t,e){let o=new st,r=null,i=t[0],s=t[1];for(let a=2;a<t.length;a++){r=i,i=s,s=t[a];let l=EP(new O(r.x-i.x,r.y-i.y)),c=EP(new O(s.x-i.x,s.y-i.y)),g=e;g=Math.min(g,Math.abs(l.x+l.y)/2),g=Math.min(g,Math.abs(c.x+c.y)/2),l.x=Math.sign(l.x)*g,l.y=Math.sign(l.y)*g,c.x=Math.sign(c.x)*g,c.y=Math.sign(c.y)*g,o.push(new O(l.x+i.x,l.y+i.y)),o.push(new O(c.x+i.x,c.y+i.y))}return o}};function EP(n){return n.x>=-kh&&n.x<=kh&&(n.x=0),n.y>=-kh&&n.y<=kh&&(n.y=0),n}var Hy=(n,t)=>n.getLPort().id-t.getLPort().id,vy=1,By=3,zh=class{constructor(){this._portPenalties=null}determineLoopRoutes(t){this._assignPortIds(t.getLNode().getPorts()),this._sortHyperLoopPortLists(t);for(let e of t.getSLHyperLoops()){switch(e.getSelfLoopType()){case kt.ONE_SIDE:this._determineOneSideLoopRoutes(e);break;case kt.TWO_SIDES_CORNER:this._determineTwoSideCornerLoopRoutes(e);break;case kt.TWO_SIDES_OPPOSING:this._determineTwoSideOpposingLoopRoutes(e);break;case kt.THREE_SIDES:this._determineThreeSideLoopRoutes(e);break;case kt.FOUR_SIDES:this._determineFourSideLoopRoutes(e);break;default:throw new Error("Unknown self loop type: "+e.getSelfLoopType())}this._computeOccupiedPortSides(e)}this._portPenalties=null}_assignPortIds(t){for(let e=0;e<t.length;e++)t[e].id=e}_sortHyperLoopPortLists(t){for(let e of t.getSLHyperLoops())e.getSLPorts().sort(Hy)}_computeOccupiedPortSides(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getRightmostPort().getLPort().getSide();for(;e!==o;)t.getOccupiedPortSides().add(e),e=e.right();t.getOccupiedPortSides().add(e)}_determineOneSideLoopRoutes(t){let e=t.getSLPorts()[0].getLPort().getSide();this._assignLeftmostRightmostPorts(t,e,e)}_determineTwoSideCornerLoopRoutes(t){let e=Ah(t);this._assignLeftmostRightmostPorts(t,e[0],e[1])}_determineTwoSideOpposingLoopRoutes(t){let e=[...t.getSLPortsBySide().keys()];if(e.length!==2)throw new Error("Expected exactly two occupied sides");let o=t.getSLHolder(),r=N_(t,e[0]),i=y_(t,e[1]),s=this._computeEdgePenalty(o,r,i),a=N_(t,e[1]),l=y_(t,e[0]),c=this._computeEdgePenalty(o,a,l);s<=c?(t.setLeftmostPort(r),t.setRightmostPort(i)):(t.setLeftmostPort(a),t.setRightmostPort(l))}_determineThreeSideLoopRoutes(t){let e=null,o=null;switch(this._computeMissingPortSide(t)){case u.NORTH:e=u.EAST,o=u.WEST;break;case u.EAST:e=u.SOUTH,o=u.NORTH;break;case u.SOUTH:e=u.WEST,o=u.EAST;break;case u.WEST:e=u.NORTH,o=u.SOUTH;break;default:throw new Error("Invalid missing port side")}this._assignLeftmostRightmostPorts(t,e,o)}_computeMissingPortSide(t){let e=t.getSLPortsBySide();for(let o of[u.NORTH,u.EAST,u.SOUTH,u.WEST])if(!e.has(o))return o;throw new Error("All sides occupied for three-sided loop")}_determineFourSideLoopRoutes(t){let e=t.getSLPorts(),o=t.getSLHolder(),r=e[e.length-1],i=e[0],s=this._computeEdgePenalty(o,r,i);for(let a=1;a<e.length;a++){let l=e[a-1],c=e[a],g=this._computeEdgePenalty(o,l,c);g>s&&(r=l,i=c,s=g)}t.setLeftmostPort(i),t.setRightmostPort(r)}_assignLeftmostRightmostPorts(t,e,o){t.setLeftmostPort(N_(t,e)),t.setRightmostPort(y_(t,o))}_computeEdgePenalty(t,e,o){this._portPenalties==null&&this._computePenalties(t);let r=t.getLNode().getPorts().length,i=e.getLPort().id,a=o.getLPort().id-1;return a<0&&(a=r-1),i<=a?this._portPenalties[a]-this._portPenalties[i]:this._portPenalties[r-1]-this._portPenalties[i]+this._portPenalties[a]}_computePenalties(t){let e=t.getLNode().getPorts();this._portPenalties=new Array(e.length).fill(0);let o=0;for(let r=0;r<e.length;r++){let i=e[r];i.getIncomingEdges().length===0&&i.getOutgoingEdges().length===0?o+=vy:o+=By,this._portPenalties[r]=o}}};function N_(n,t){let e=n.getSLPortsBySide().get(t),o=e[0];for(let r=1;r<e.length;r++)e[r].getLPort().id<o.getLPort().id&&(o=e[r]);return o}function y_(n,t){let e=n.getSLPortsBySide().get(t),o=e[0];for(let r=1;r<e.length;r++)e[r].getLPort().id>o.getLPort().id&&(o=e[r]);return o}var Yh=class{constructor(){this._hyperEdgeSegments=null,this._slLoopToSegmentMap=null,this._slLoopActivityOverPorts=null}assignRoutingSlots(t){let e=this._computeLabelCrossingMatrix(t);this._createCrossingGraph(t,e);let o=t.getLNode().getGraph().getProperty(p.RANDOM);ie.breakNonCriticalCycles(this._hyperEdgeSegments,o),this._doAssignRoutingSlots(t,e),this._hyperEdgeSegments=null,this._slLoopToSegmentMap=null,this._slLoopActivityOverPorts=null}_computeLabelCrossingMatrix(t){let e=0;for(let i of t.getSLHyperLoops())i.getSLLabels()!=null&&(i.getSLLabels().id=e++);let o=[];for(let i=0;i<e;i++)o.push(new Array(e).fill(!1));let r=t.getSLHyperLoops();for(let i=0;i<r.length;i++){let s=r[i];if(s.getSLLabels()!=null)for(let a=i+1;a<r.length;a++){let l=r[a];if(l.getSLLabels()==null)continue;let c=Uy(s,l);o[s.getSLLabels().id][l.getSLLabels().id]=c,o[l.getSLLabels().id][s.getSLLabels().id]=c}}return o}_createCrossingGraph(t,e){let o=t.getSLHyperLoops();this._hyperEdgeSegments=[],this._slLoopToSegmentMap=new Map;for(let r of o){let i=new An(null);this._hyperEdgeSegments.push(i),this._slLoopToSegmentMap.set(r,i)}this._slLoopActivityOverPorts=new Map,this._computeLoopActivity(t);for(let r=0;r<o.length-1;r++){let i=t.getSLHyperLoops()[r];for(let s=r+1;s<o.length;s++)this._createDependencies(i,t.getSLHyperLoops()[s],e)}}_computeLoopActivity(t){let e=t.getSLHyperLoops(),o=t.getLNode().getPorts();for(let r of e){let i=new Array(o.length).fill(!1);this._slLoopActivityOverPorts.set(r,i);let s=r.getLeftmostPort().getLPort().id-1,a=r.getRightmostPort().getLPort().id;for(;s!==a;)s=(s+1+o.length)%o.length,i[s]=!0}}_createDependencies(t,e,o){let r=this._countCrossings(t,e),i=this._countCrossings(e,t),s=this._slLoopToSegmentMap.get(t),a=this._slLoopToSegmentMap.get(e);r<i?$e.createAndAddRegular(s,a,i-r):i<r?$e.createAndAddRegular(a,s,r-i):(r!==0||Fy(t,e,o))&&($e.createAndAddRegular(s,a,0),$e.createAndAddRegular(a,s,0))}_countCrossings(t,e){let o=this._slLoopActivityOverPorts.get(e),r=0;for(let i of t.getSLPorts())o[i.getLPort().id]&&r++;return r}_doAssignRoutingSlots(t,e){this._assignRawRoutingSlotsToSegments(),this._assignRawRoutingSlotsToLoops(t),this._shiftTowardsNode(t,e)}_assignRawRoutingSlotsToSegments(){let t=[];for(let e of this._hyperEdgeSegments)e.setInWeight(e.getIncomingSegmentDependencies().length),e.setOutWeight(e.getOutgoingSegmentDependencies().length),e.getOutWeight()===0&&(e.setRoutingSlot(0),t.push(e));for(;t.length>0;){let e=t.shift(),o=e.getRoutingSlot()+1;for(let r of e.getIncomingSegmentDependencies()){let i=r.getSource();i.setRoutingSlot(Math.max(i.getRoutingSlot(),o)),i.setOutWeight(i.getOutWeight()-1),i.getOutWeight()===0&&t.push(i)}}}_assignRawRoutingSlotsToLoops(t){for(let e of t.getSLHyperLoops()){let o=this._slLoopToSegmentMap.get(e).getRoutingSlot();for(let r of e.getOccupiedPortSides())e.setRoutingSlot(r,o)}}_shiftTowardsNode(t,e){let o=new Array(t.getLNode().getPorts().length).fill(0);this._shiftTowardsNodeOnSide(t,u.NORTH,o,e),this._shiftTowardsNodeOnSide(t,u.EAST,o,e),this._shiftTowardsNodeOnSide(t,u.SOUTH,o,e),this._shiftTowardsNodeOnSide(t,u.WEST,o,e)}_shiftTowardsNodeOnSide(t,e,o,r){let i=t.getSLHyperLoops().filter(c=>c.getOccupiedPortSides().has(e));i.sort((c,g)=>c.getRoutingSlot(e)-g.getRoutingSlot(e));let s=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(let c of t.getLNode().getPorts())c.getSide()===e&&(c.id<s&&(s=c.id),c.id>a&&(a=c.id));if(s===Number.MAX_SAFE_INTEGER){for(let c=0;c<i.length;c++)i[c].setRoutingSlot(e,c);return}let l=new Array(r.length).fill(-1);for(let c of i){let g=this._slLoopActivityOverPorts.get(c),h=0;for(let d=s;d<=a;d++)g[d]&&(h=Math.max(h,o[d]));if(c.getSLLabels()!=null){let d=c.getSLLabels().id,f=new Set;for(let E=0;E<r.length;E++)r[d][E]&&f.add(l[E]);for(;f.has(h);)h++}c.setRoutingSlot(e,h);for(let d=s;d<=a;d++)g[d]&&(o[d]=h+1);c.getSLLabels()!=null&&(l[c.getSLLabels().id]=h)}}};function Uy(n,t){let e=n.getSLLabels(),o=t.getSLLabels();if(e==null||o==null||e.getSide()!==o.getSide()||e.getSide()===u.EAST||e.getSide()===u.WEST)return!1;let r=e.getPosition().x,i=r+e.getSize().x,s=o.getPosition().x,a=s+o.getSize().x;return r<=a&&i>=s}function Fy(n,t,e){return n.getSLLabels()==null||t.getSLLabels()==null?!1:e[n.getSLLabels().id][t.getSLLabels().id]}var ky=3,mP=.5,Vh=class extends Ui{modifyBendPoints(t,e,o){let r=z.getIndividualOrInherited(t.getSLHyperLoop().getSLHolder().getLNode(),_.SPACING_EDGE_LABEL),i=new st;return i.push(PP(t.getSLSource())),this._addSplineControlPoints(t,e,o,i,r),i.push(PP(t.getSLTarget())),new Rs(!0,ky,i).getBezierCP()}_addSplineControlPoints(t,e,o,r,i){let s=t.getSLSource().getLPort().getSide(),a=o[0];for(let l=1;l<o.length;l++){let c=o[l];r.push(a);let g=new O((a.x+c.x)*mP,(a.y+c.y)*mP),h=Wy(s);h.scale(i),g.add(h),r.push(g),a=c,s=e===ni.CLOCKWISE?s.right():s.left()}r.push(o[o.length-1])}};function PP(n){let t=n.getLPort(),e=new O(t.getPosition().x,t.getPosition().y);return e.add(t.getAnchor()),e}function Wy(n){switch(n.toString()){case"NORTH":return new O(0,-1);case"EAST":return new O(1,0);case"SOUTH":return new O(0,1);case"WEST":return new O(-1,0);default:return new O}}var Xh=class{constructor(){this._routingDirector=new zh,this._labelPlacer=new Bh,this._routingSlotAssigner=new Yh}process(t,e){e.begin("Self-Loop routing",1);let o=this._routerForGraph(t),r=t.getProperty(Hn);for(let i of t.getLayers())for(let s of i.getNodes()){if(s.getType()!==y.NORMAL||!s.hasProperty(p.SELF_LOOP_HOLDER))continue;let a=s.getProperty(p.SELF_LOOP_HOLDER);this._processNode(a,r,o,e)}e.done()}_routerForGraph(t){switch(t.getProperty(_.EDGE_ROUTING)){case At.POLYLINE:return new Wh;case At.SPLINES:return new Vh;default:return new Ui}}_processNode(t,e,o,r){this._routingDirector.determineLoopRoutes(t),this._labelPlacer.placeLabels(t,e,r),this._routingSlotAssigner.assignRoutingSlots(t),o.routeSelfLoops(t)}};var Kh=class{process(t,e){e.begin("Semi-Interactive Crossing Minimization Processor",1);let o=!1;for(let r of t){let i=[];for(let s of r.getNodes())s.getType()===y.NORMAL&&s.hasProperty(_.POSITION)&&i.push(s);if(i.sort((s,a)=>{let l=s.getProperty(_.POSITION).y,c=a.getProperty(_.POSITION).y;return l-c}),i.length>0){o=!0;for(let s=0;s<i.length-1;s++)i[s].getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(i[s+1])}}o&&t.setProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES,!0),e.done()}};var Ao=class{constructor(t,e){this.name=t,this._returnValue=e,Object.freeze(this)}toString(){return this.name}returnValue(){return this._returnValue}};Ao.DUMMY_NODE_OVER=new Ao("DUMMY_NODE_OVER",Number.MAX_SAFE_INTEGER);Ao.DUMMY_NODE_UNDER=new Ao("DUMMY_NODE_UNDER",Number.MIN_SAFE_INTEGER);Ao.EQUAL=new Ao("EQUAL",0);var Wt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Wt.ONLY_WITHIN_GROUP=new Wt("ONLY_WITHIN_GROUP");Wt.MODEL_ORDER=new Wt("MODEL_ORDER");Wt.ENFORCED=new Wt("ENFORCED");var Qe=class{static calculateModelOrderOrGroupModelOrder(t,e,o,r){let i=o.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,s=o.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_ENFORCED_GROUP_ORDERS);if(t.hasProperty(p.MODEL_ORDER))if(i){let a=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID),l=e.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID);if(s.indexOf(a)>=0&&s.indexOf(l)>=0)return r*a+t.getProperty(p.MODEL_ORDER)}else return t.getProperty(p.MODEL_ORDER);else return-1;return t.getProperty(p.MODEL_ORDER)}};var Zh=class{constructor(t,e,o,r,i){this._graph=t,this._strategy=o,this._targetNodeModelOrder=r,this._portModelOrder=i,e!=null&&typeof e.getNodes=="function"?this._previousLayer=[...e.getNodes()]:this._previousLayer=e||[],this._biggerThan=new Map,this._smallerThan=new Map}compare(t,e){if(!this._biggerThan.has(t))this._biggerThan.set(t,new Set);else if(this._biggerThan.get(t).has(e))return 1;if(!this._biggerThan.has(e))this._biggerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return-1;if(!this._smallerThan.has(t))this._smallerThan.set(t,new Set);else if(this._smallerThan.get(t).has(e))return-1;if(!this._smallerThan.has(e))this._smallerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return 1;if(t.getSide()!==e.getSide()){let r=OP(t.getSide())-OP(e.getSide());return r>0?this._updateAssoc(t,e,1):this._updateAssoc(e,t,1),r}let o=1;if(t.getIncomingEdges().length>0&&e.getIncomingEdges().length>0){(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.NORTH&&e.getSide()===u.NORTH||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o);let r=t.getIncomingEdges()[0].getSource(),i=e.getIncomingEdges()[0].getSource(),s=r.getNode(),a=i.getNode();if(s===a)for(let c of s.getPorts()){if(c===r)return this._updateAssoc(e,t,o),-o;if(c===i)return this._updateAssoc(t,e,o),o}if(r.getNode().getType()===y.LONG_EDGE&&i.getNode().getType()===y.LONG_EDGE&&s.getLayer().id===a.getLayer().id&&s.getLayer().id===t.getNode().getLayer().id){let c=s.getLayer().getNodes(),g=this._checkReferenceLayer(c,s,a,t,e);if(g!==0)return t.getSide()===u.EAST&&e.getSide()===u.EAST&&(o=-o),g>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}let l=this._checkReferenceLayer(this._previousLayer,s,a,t,e);if(l!==0)return l>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o);if(this._portModelOrder){let c=this.checkPortModelOrder(t,e);if(c!==0)return c>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}}if(t.getOutgoingEdges().length>0&&e.getOutgoingEdges().length>0){(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o);let r=t.getProperty(p.LONG_EDGE_TARGET_NODE),i=e.getProperty(p.LONG_EDGE_TARGET_NODE);if(this._strategy===ce.PREFER_NODES&&r!=null&&i!=null&&r.hasProperty(p.MODEL_ORDER)&&i.hasProperty(p.MODEL_ORDER)){let l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES),c=Qe.calculateModelOrderOrGroupModelOrder(r,i,this._graph,l),g=Qe.calculateModelOrderOrGroupModelOrder(i,r,this._graph,l);return c>g?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}if(this._portModelOrder){let l=this.checkPortModelOrder(t,e);if(l!==0)return l>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}let s=0,a=0;return t.getOutgoingEdges()[0].hasProperty(p.MODEL_ORDER)&&(s=Qe.calculateModelOrderOrGroupModelOrder(t.getOutgoingEdges()[0],e.getOutgoingEdges()[0],this._graph,t.getOutgoingEdges().length+t.getIncomingEdges().length)),e.getOutgoingEdges()[0].hasProperty(p.MODEL_ORDER)&&(a=Qe.calculateModelOrderOrGroupModelOrder(e.getOutgoingEdges()[0],t.getOutgoingEdges()[0],this._graph,e.getOutgoingEdges().length+e.getIncomingEdges().length)),r!=null&&r===i?s>a?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o):(this._targetNodeModelOrder!=null&&(this._targetNodeModelOrder.has(r)&&(s=this._targetNodeModelOrder.get(r)),this._targetNodeModelOrder.has(i)&&(a=this._targetNodeModelOrder.get(i))),s>a?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o))}if(t.getIncomingEdges().length>0&&e.getOutgoingEdges().length>0)return this._updateAssoc(t,e,o),1;if(t.getOutgoingEdges().length>0&&e.getIncomingEdges().length>0)return this._updateAssoc(e,t,o),-1;if(t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER)){let r=t.getNode().getPorts().length,i=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,r),s=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,r);return(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o),i>s?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}return this._updateAssoc(e,t,o),-o}checkPortModelOrder(t,e){let o=t.getNode().getPorts().length;if(t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER)){let r=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,o),i=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,o);return r-i}return 0}_updateAssoc(t,e,o){let r=t,i=e;o<0&&(r=e,i=t);let s=this._biggerThan.get(r),a=this._biggerThan.get(i),l=this._smallerThan.get(r),c=this._smallerThan.get(i);s.add(i),c.add(r);for(let g of a){s.add(g);let h=this._smallerThan.get(g);if(h){h.add(r);for(let d of l)h.add(d)}}for(let g of l){c.add(g);let h=this._biggerThan.get(g);if(h){h.add(i);for(let d of a)h.add(d)}}}_checkReferenceLayer(t,e,o,r,i){for(let s of t){if(s===e)return-1;if(s===o)return 1}return 0}clearTransitiveOrdering(){this._biggerThan=new Map,this._smallerThan=new Map}},zy=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);function OP(n){return zy.get(n)||0}var nl=class{constructor(t,e,o,r,i,s){this._graph=t,this._orderingStrategy=o,this._groupOrderStrategy=i,this._longEdgeNodeOrder=r||Ao.EQUAL,this._beforePorts=s,e!=null&&typeof e.getNodes=="function"?this._previousLayer=[...e.getNodes()]:this._previousLayer=e||[],this._biggerThan=new Map,this._smallerThan=new Map}compare(t,e){if(!this._biggerThan.has(t))this._biggerThan.set(t,new Set);else if(this._biggerThan.get(t).has(e))return 1;if(!this._biggerThan.has(e))this._biggerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return-1;if(!this._smallerThan.has(t))this._smallerThan.set(t,new Set);else if(this._smallerThan.get(t).has(e))return-1;if(!this._smallerThan.has(e))this._smallerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return 1;let o=t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER);if(this._orderingStrategy===ce.PREFER_EDGES||!o){let i=this._findPreviousLayerSourcePort(t),s=this._findPreviousLayerSourcePort(e);if(i!=null&&s!=null){let a=i.getNode(),l=s.getNode();if(a!=null&&a===l){for(let h of a.getPorts()){if(h===i)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(h===s)return this._updateBiggerAndSmallerAssociations(t,e),1}let c=this._getModelOrderFromConnectedEdges(t),g=this._getModelOrderFromConnectedEdges(e);return c>g?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}for(let c of this._previousLayer){if(c===a)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(c===l)return this._updateBiggerAndSmallerAssociations(t,e),1}}if(i!=null&&s==null||i==null&&s!=null){let a=this._handleHelperDummyNodes(t,e);if(a!==0)return a>0?this._updateBiggerAndSmallerAssociations(t,e):this._updateBiggerAndSmallerAssociations(e,t),a;if(!o){let l=this._getModelOrderFromConnectedEdges(t),c=this._getModelOrderFromConnectedEdges(e);return l>c?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}}if(i==null&&s==null){let a=this._handleHelperDummyNodes(t,e);if(a!==0)return a>0?this._updateBiggerAndSmallerAssociations(t,e):this._updateBiggerAndSmallerAssociations(e,t),a}}if(o){let i=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES),s=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,i),a=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,i);return s>a?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}return this._updateBiggerAndSmallerAssociations(e,t),-1}_findPreviousLayerSourcePort(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0){let o=e.getIncomingEdges()[0].getSource().getNode(),r=o.getLayer&&o.getLayer(),i=t.getLayer&&t.getLayer();if(r!=null&&i!=null&&r.id===i.id-1)return e.getIncomingEdges()[0].getSource()}return null}_getModelOrderFromConnectedEdges(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0)return e.getIncomingEdges()[0].getProperty(p.MODEL_ORDER);return this._longEdgeNodeOrder.returnValue()}_updateBiggerAndSmallerAssociations(t,e){let o=this._biggerThan.get(t),r=this._biggerThan.get(e),i=this._smallerThan.get(t),s=this._smallerThan.get(e);o.add(e),s.add(t);for(let a of r){o.add(a);let l=this._smallerThan.get(a);if(l){l.add(t);for(let c of i)l.add(c)}}for(let a of i){s.add(a);let l=this._biggerThan.get(a);if(l){l.add(e);for(let c of r)l.add(c)}}}_handleHelperDummyNodes(t,e){if(t.getType()===y.LONG_EDGE&&e.getType()===y.NORMAL){let o=this._getFirstIncomingSourcePortOfNode(t),r=this._getFirstOutgoingTargetPortOfNode(t);if(o==null||r==null)return 0;let i=t.getLayer().id;return o.getNode().getLayer().id!==i&&r.getNode().getLayer().id!==i?0:o.getNode()===e?(this._updateBiggerAndSmallerAssociations(t,e),1):r.getNode()===e?(this._updateBiggerAndSmallerAssociations(t,e),1):this.compare(o.getNode(),e)}if(t.getType()===y.NORMAL&&e.getType()===y.LONG_EDGE){let o=this._getFirstIncomingSourcePortOfNode(e),r=this._getFirstOutgoingTargetPortOfNode(e);if(o==null||r==null)return 0;let i=t.getLayer().id;return o.getNode().getLayer().id!==i&&r.getNode().getLayer().id!==i?0:o.getNode()===t?(this._updateBiggerAndSmallerAssociations(e,t),-1):r.getNode()===t?(this._updateBiggerAndSmallerAssociations(e,t),-1):this.compare(t,o.getNode())}if(t.getType()===y.LONG_EDGE&&e.getType()===y.LONG_EDGE){let o=this._getFirstIncomingSourcePortOfNode(t),r=this._getFirstOutgoingTargetPortOfNode(t),i=this._getFirstIncomingSourcePortOfNode(e),s=this._getFirstOutgoingTargetPortOfNode(e);if(o==null||r==null||i==null||s==null)return 0;let a=t.getLayer().id,l=e.getLayer().id,c=t,g=e;if(o.getNode().getLayer().id===a?c=o.getNode():r.getNode().getLayer().id===a&&(c=r.getNode()),i.getNode().getLayer().id===l?g=i.getNode():s.getNode().getLayer().id===l&&(g=s.getNode()),c===g)for(let h of c.getPorts()){if(h===o)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(h===i)return this._updateBiggerAndSmallerAssociations(t,e),1}return this.compare(c,g)}return 0}_getFirstIncomingSourcePortOfNode(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0)return e.getIncomingEdges()[0].getSource();return null}_getFirstOutgoingTargetPortOfNode(t){for(let e of t.getPorts())if(e.getOutgoingEdges().length>0)return e.getOutgoingEdges()[0].getTarget();return null}clearTransitiveOrdering(){this._biggerThan=new Map,this._smallerThan=new Map}};var jh=class n{process(t,e){e&&e.begin&&e.begin("Sort By Input Model "+t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),1);let o=0;for(let r of t.getLayers()){r.id=o;let i=o===0?0:o-1,s=t.getLayers()[i],a=new nl(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY),!0);n.insertionSort(r.getNodes(),a);for(let l of r.getNodes()){let c=l.getProperty(_.PORT_CONSTRAINTS);c!==H.FIXED_ORDER&&c!==H.FIXED_POS&&l.getPorts().sort((g,h)=>new Zh(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),n.longEdgeTargetNodePreprocessing(l),t.getProperty(_.CONSIDER_MODEL_ORDER_PORT_MODEL_ORDER)).compare(g,h))}a=new nl(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY),!1),n.insertionSort(r.getNodes(),a),o++}e&&e.done&&e.done()}static longEdgeTargetNodePreprocessing(t){let e=new Map;if(t.hasProperty(p.TARGET_NODE_MODEL_ORDER))return t.getProperty(p.TARGET_NODE_MODEL_ORDER);for(let o of t.getPorts()){if(o.getOutgoingEdges().length===0)continue;let r=n.getTargetNode(o);if(o.setProperty(p.LONG_EDGE_TARGET_NODE,r),r!=null){let i=o.getOutgoingEdges()[0];if(!i.getProperty(p.REVERSED)){let s=e.has(r)?e.get(r):Number.MAX_SAFE_INTEGER;e.set(r,Math.min(i.getProperty(p.MODEL_ORDER),s))}}}return t.setProperty(p.TARGET_NODE_MODEL_ORDER,e),e}static getTargetNode(t){let e=null,o=t.getOutgoingEdges()[0];do{if(e=o.getTarget().getNode(),e.hasProperty(p.LONG_EDGE_TARGET))return e.getProperty(p.LONG_EDGE_TARGET).getNode();if(e.getType()!==y.NORMAL){let i=e.getOutgoingEdges()[Symbol.iterator]().next();if(!i.done)o=i.value;else return null}}while(e!=null&&e.getType()!==y.NORMAL);return e}static insertionSort(t,e){for(let o=1;o<t.length;o++){let r=t[o],i=o;for(;i>0&&e.compare(t[i-1],r)>0;)t[i]=t[i-1],i--;t[i]=r}e.clearTransitiveOrdering()}};var $h=class{process(t,e){e.begin("Alternating layer unzipping",1);let o=1,r=[],i=t.getLayers();for(let s=0;s<i.length;s++){let a=i[s],l=Yy(a),c=Vy(a);if(Xy(a)){let h=0,d=0;for(let f of a)h=Math.max(h,f.getSize().x),d+=f.getSize().y;if(d/=a.getNodes().length,h+=Math.max(2*t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),Math.max(a.getNodes().length*t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS))),d+=Math.max(t.getProperty(_.SPACING_NODE_NODE),t.getProperty(_.SPACING_EDGE_NODE)),h/d>=a.getNodes().length/4)continue}if(a.getNodes().length>l){let h=[a];for(let f=0;f<l-1;f++){let E=new Et(t);r.push([E,s+f+o]),h.push(E)}o+=l-1;let d=h[0].getNodes().length;for(let f=0,E=0,P=0;f<d;f++,E++,P++){let S=h[0].getNodes()[E];S.getType()!==y.NONSHIFTING_PLACEHOLDER?E+=Ky(t,h,P%l,E):(f--,P--),c&&S.getType()===y.LONG_EDGE&&(P=-1)}}}for(let[s,a]of r)i.splice(a,0,s);for(let s of i){let a=s.getNodes();for(let l=a.length-1;l>=0;l--){let c=a[l].getType();(c===y.PLACEHOLDER||c===y.NONSHIFTING_PLACEHOLDER)&&a.splice(l,1)}}e.done()}};function Yy(n){let t=Number.MAX_SAFE_INTEGER,e=!0;for(let o of n)if(o.hasProperty(_.LAYER_UNZIPPING_LAYER_SPLIT)){e=!1;let r=o.getProperty(_.LAYER_UNZIPPING_LAYER_SPLIT);r<t&&(t=r)}return e?_.LAYER_UNZIPPING_LAYER_SPLIT.getDefault():t}function Vy(n){for(let t of n)if(t.hasProperty(_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES)&&!t.getProperty(_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES))return!1;return!0}function Xy(n){for(let t of n)if(t.hasProperty(_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH)&&t.getProperty(_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH))return!0;return!1}function Ky(n,t,e,o){let r=t[0].getNodes()[o];e>0&&r.setLayer(t[e]);let i=0,s=!0,a=[...r.getIncomingEdges()].reverse();for(let c of a){s=!1;let g=c;for(let h=0;h<e;h++){let d=SP(n,g);o+i>t[h].getNodes().length?d.setLayer(t[h]):d.setLayer(o+i,t[h]),g=ri.splitEdge(g,d)}e>0&&i++}if(s){for(let c=0;c<e;c++){let g=new ft(n);g.setType(y.PLACEHOLDER),o+i>t[c].getNodes().length?g.setLayer(t[c]):g.setLayer(o+i,t[c])}e>0&&i++}let l=!1;for(let c of r.getOutgoingEdges()){let g=c;for(let h=e+1;h<t.length;h++){let d=SP(n,g);d.setLayer(t[h]),g=ri.splitEdge(g,d)}for(let h=0;h<=e;h++)if(l){let d=new ft(n);d.setType(y.NONSHIFTING_PLACEHOLDER),o+1>t[h].getNodes().length?d.setLayer(t[h]):d.setLayer(o+1,t[h])}l&&i++,l=!0}return i>0?i-1:0}function SP(n,t){let e=new ft(n);return e.setType(y.LONG_EDGE),e.setProperty(p.ORIGIN,t),e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),e}var ro=class{constructor(t){this._name=t}toString(){return this._name}};ro.ARD=new ro("ARD");ro.MSD=new ro("MSD");ro.MANUAL=new ro("MANUAL");var io=class{constructor(t){this._name=t}toString(){return this._name}};io.NO=new io("NO");io.GREEDY=new io("GREEDY");io.LOOK_BACK=new io("LOOK_BACK");var kn=class{constructor(t){this.graph=t;let e=t.getProperty(_.DIRECTION),o=t.getProperty(_.ASPECT_RATIO),r=t.getProperty(_.WRAPPING_CORRECTION_FACTOR);e===R.LEFT||e===R.RIGHT||e===R.UNDEFINED||e==null?this.dar=o*r:this.dar=1/(o*r),this._spacing=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._inLayerSpacing=t.getProperty(_.SPACING_NODE_NODE),this.longestPath=t.getLayers().length,this._maxWidth=null,this._maxHeight=null,this._sumWidth=null,this._widths=null,this._heights=null,this._cutsAllowed=null}getApproximateLayerWidth(t){return this._determineLayerWidth(t)}getApproximateLayeringWidth(){return this.getSumWidth()}getApproximateChunkBasedLayeringWidth(t){if(t.length===0)return this.getApproximateLayeringWidth();let e=0,o=0;for(let r of t)e=Math.max(e,this._determineChunkWidth(o,r)),o=r;return e=Math.max(e,this._determineChunkWidth(o,this.graph.getLayers().length)),e}getApproximateLayerHeight(t){return this._determineLayerHeight(t)}getApproximateLayeringHeight(){return this.getMaxHeight()}getApproximateChunkBasedLayeringHeight(t){if(t.length===0)return 0;let e=0,o=0;for(let r of t)e+=this._determineChunkHeight(o,r),o=r;return e+=this._determineChunkHeight(o,this.graph.getLayers().length),e}getMaxWidth(){return this._maxWidth==null&&(this._maxWidth=this._determineWidth((t,e)=>Math.max(t,e))),this._maxWidth}getSumWidth(){return this._sumWidth==null&&(this._sumWidth=this._determineWidth((t,e)=>t+e)),this._sumWidth}getWidths(){return this._widths==null&&this._initWidthsAndHeights(),this._widths}_initWidthsAndHeights(){let t=this.longestPath;this._widths=new Array(t),this._heights=new Array(t);for(let e=0;e<t;e++){let o=this.graph.getLayers()[e];this._widths[e]=this._determineLayerWidth(o),this._heights[e]=this._determineLayerHeight(o)}}_determineWidth(t){let e=this.graph.getLayers();if(e.length===0)return 0;let o=this._determineLayerWidth(e[0]);for(let r=1;r<e.length;r++)o=t(o,this._determineLayerWidth(e[r]));return o}_determineLayerWidth(t){let e=0;for(let o of t.getNodes()){let r=o.getSize().x+o.getMargin().right+o.getMargin().left+this._spacing;r>e&&(e=r)}return e}_determineChunkWidth(t,e){let o=0,r=this.graph.getLayers();for(let i=t;i<e;i++)o+=this._determineLayerWidth(r[i]);return o}getMaxHeight(){return this._maxHeight==null&&(this._maxHeight=this._determineHeight((t,e)=>Math.max(t,e))),this._maxHeight}getHeights(){return this._heights==null&&this._initWidthsAndHeights(),this._heights}_determineHeight(t){let e=this.graph.getLayers();if(e.length===0)return 0;let o=this._determineLayerHeight(e[0]);for(let r=1;r<e.length;r++)o=t(o,this._determineLayerHeight(e[r]));return o}_determineLayerHeight(t){let e=0;for(let o of t.getNodes()){e+=o.getSize().y+o.getMargin().bottom+o.getMargin().top+this._inLayerSpacing;for(let r of o.getIncomingEdges())if(r.getSource().getNode().getType()===y.NORTH_SOUTH_PORT){let s=r.getSource().getNode().getProperty(p.ORIGIN);s!=null&&(e+=s.getSize().y+s.getMargin().bottom+s.getMargin().top)}}return e}_determineChunkHeight(t,e){let o=this.graph.getLayers(),r=0;for(let i=t;i<e;i++){let s=this._determineLayerHeight(o[i]);s>r&&(r=s)}return r}isCutAllowed(t){return this._cutsAllowed==null&&this._initCutAllowed(),this._cutsAllowed[t]}getCutsAllowed(){return this._cutsAllowed==null&&this._initCutAllowed(),this._cutsAllowed}_initCutAllowed(){if(this._cutsAllowed=new Array(this.graph.getLayers().length).fill(!0),this._cutsAllowed[0]=!1,this.graph.hasProperty(_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES)){let t=this.graph.getProperty(_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES);for(let e of t)e>0&&e<this._cutsAllowed.length&&(this._cutsAllowed[e]=!1)}else{let t=this.graph.getLayers();for(let e=1;e<t.length;e++)this._cutsAllowed[e]=Zy(t[e])}}};function Zy(n){let t=null,e=null;for(let o of n.getNodes())for(let r of o.getIncomingEdges()){if(t!=null&&t!==o)return!1;t=o;let i=r.getSource().getNode();if(e!=null&&e!==i)return!1;e=i}return!0}var Wn=class{getCutIndexes(t,e){let o=t.getProperty(_.WRAPPING_CUTTING_CUTS);return o!=null?o:[]}guaranteeValid(){return!1}};var Fi=class n{getCutIndexes(t,e){let o=n.getChunkCount(e),r=[],i=e.longestPath/o;for(let s=1;s<o;s++)r.push(Math.round(s*i));return r}static getChunkCount(t){let e=Math.sqrt(t.getSumWidth()/(t.dar*t.getMaxHeight())),o=Math.round(e);return o=Math.min(o,t.longestPath),o}guaranteeValid(){return!1}};var zn=class{guaranteeValid(){return!1}getCutIndexes(t,e){let o=e.getWidths(),r=e.getHeights(),i=new Array(o.length);i[0]=o[0];let s=o[0];for(let h=1;h<o.length;h++)i[h]=i[h-1]+o[h],s+=o[h];let a=Fi.getChunkCount(e)-1,l=t.getProperty(_.WRAPPING_CUTTING_MSD_FREEDOM),c=Number.NEGATIVE_INFINITY,g=[];for(let h=Math.max(0,a-l);h<=Math.min(e.longestPath-1,a+l);h++){let d=s/(h+1),f=0,E=1,P=[],S=Number.NEGATIVE_INFINITY,T=0,N=0,I=r[0];if(h===0)S=s,N=e.getMaxHeight();else{for(;E<e.longestPath;)i[E-1]-f>=d&&(P.push(E),S=Math.max(S,i[E-1]-T),N+=I,f+=i[E-1]-f,T=i[E-1],I=r[E]),I=Math.max(I,r[E]),E++;N+=I}let C=Math.min(1/S,1/e.dar/N);C>c&&(c=C,g=P)}return g}};var Yn=class{static insertDummies(t,e,o){let r=t.getProperty(_.SPACING_EDGE_NODE),i=t.getProperty(_.WRAPPING_ADDITIONAL_EDGE_SPACING),s=new bo;s.setProperty(_.SPACING_EDGE_NODE,r+i);let a=e,l=a.getTarget(),c=a.getSource().getNode(),g=a.getTarget().getNode(),h=c.getLayer().getIndex(),d=g.getLayer().getIndex(),f=[];for(let E=h;E<=d;E++){let P=new ft(t);P.setType(y.LONG_EDGE),P.setProperty(p.ORIGIN,a),P.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),P.setProperty(_.SPACING_INDIVIDUAL,s);let S=t.getLayers()[E];E===h?P.setLayer(S.getNodes().length-o,S):P.setLayer(S);let T=a.getProperty(_.EDGE_THICKNESS);T<0&&(T=0,a.setProperty(_.EDGE_THICKNESS,T)),P.getSize().y=T;let N=Math.floor(T/2),I=new rt;I.setSide(u.WEST),I.setNode(P),I.getPosition().y=N;let C=new rt;C.setSide(u.EAST),C.setNode(P),C.getPosition().y=N,a.setTarget(I);let x=new _e;x.copyProperties(a),x.setProperty(_.JUNCTION_POINTS,null),x.setSource(C),x.setTarget(l),jy(P,a,x),f.push(x),a=x}return f}};function jy(n,t,e){let o=t.getSource().getNode();o.getType()===y.LONG_EDGE?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET))):(n.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),n.setProperty(p.LONG_EDGE_TARGET,e.getTarget()))}var xs=class n{process(t,e){if(e.begin("Path-Like Graph Wrapping",1),t.getLayers().length===0){e.done();return}let o=new kn(t),i=o.getMaxWidth()*o.longestPath/o.getMaxWidth();if(o.dar>i){e.done();return}let s;switch(t.getProperty(_.WRAPPING_CUTTING_STRATEGY)){case ro.MANUAL:s=new Wn;break;case ro.ARD:s=new Fi;break;default:s=new zn}let a=s.getCutIndexes(t,o);if(!s.guaranteeValid())switch(t.getProperty(_.WRAPPING_VALIDIFY_STRATEGY)){case io.LOOK_BACK:a=n.validifyIndexesLookingBack(o,a);break;case io.GREEDY:a=n.validifyIndexesGreedily(o,a);break;default:}qy(t,o,a),e.done()}static validifyIndexesGreedily(t,e){let o=[],r=0;for(let i of e){let s=i+r;for(;s<t.longestPath&&!t.isCutAllowed(s);)s++,r++;if(s>=t.longestPath)break;o.push(s)}return o}static validifyIndexesLookingBack(t,e){if(e.length===0)return[];let o=[];o.push(Number.NEGATIVE_INFINITY);for(let r=1;r<t.longestPath;r++)t.isCutAllowed(r)&&o.push(r);return o.length===1?[]:(o.push(Number.POSITIVE_INFINITY),$y(e,o))}};function $y(n,t){let e=[],o=0,r=0,i=0;for(;o<t.length-1&&r<n.length;){let s=n[r]+i;for(;t[o+1]<s;)o++;let a=0,l=s-t[o],c=t[o+1]-s;l>c&&a++;let g=t[o+a];for(e.push(g),i+=g-s,r++;r<n.length&&n[r]+i<=g;)r++;o+=1+a}return e}function qy(n,t,e){if(e.length===0)return;let o=0,r=0,i=0,s=e[i++];for(;o<t.longestPath;){if(o===s&&(r=0,i<e.length?s=e[i++]:s=t.longestPath+1),o!==r){let l=n.getLayers()[o],c=n.getLayers()[r],g=l.getNodes().slice();for(let h of g)if(h.setLayer(c.getNodes().length,c),r===0){let d=[...h.getIncomingEdges()];for(let f of d)f.reverse(n,!0),n.setProperty(p.CYCLIC,!0),Yn.insertDummies(n,f,1)}}r++,o++}let a=n.getLayers();for(let l=a.length-1;l>=0;l--)a[l].getNodes().length===0&&a.splice(l,1)}var qh=class{process(t,e){e.begin("Breaking Point Insertion",1);let o=new kn(t),r;switch(t.getProperty(_.WRAPPING_CUTTING_STRATEGY)){case ro.MANUAL:r=new Wn;break;case ro.ARD:r=new Fi;break;default:r=new zn}let i=r.getCutIndexes(t,o);if(t.getProperty(_.WRAPPING_MULTI_EDGE_IMPROVE_CUTS)&&(i=Qy(t,i)),!r.guaranteeValid()&&t.hasProperty(_.WRAPPING_VALIDIFY_STRATEGY))switch(t.getProperty(_.WRAPPING_VALIDIFY_STRATEGY)){case io.LOOK_BACK:i=xs.validifyIndexesLookingBack(o,i);break;case io.GREEDY:i=xs.validifyIndexesGreedily(o,i);break;default:}if(i.length===0){e.done();return}Jy(t,i),e.done()}},vr=class{constructor(t,e,o,r,i){this.start=t,this.end=e,this.nodeStartEdge=o,this.startEndEdge=r,this.originalEdge=i,this.startInLayerDummy=null,this.startInLayerEdge=null,this.endInLayerDummy=null,this.endInLayerEdge=null,this.prev=null,this.next=null}static isStart(t){let e=t.getProperty(p.BREAKING_POINT_INFO);return e!=null&&e.start===t}static isEnd(t){let e=t.getProperty(p.BREAKING_POINT_INFO);return e!=null&&e.end===t}};function Jy(n,t){let e=n.getLayers(),o=0,r=t[o++],i=0,s=new Set,a=new Set,l=0,c=0;for(;l<e.length;){let g=e[l];for(let h of g){for(let d of h.getOutgoingEdges())a.add(d);for(let d of h.getIncomingEdges())a.delete(d)}if(c+1===r){let h=new Et(n),d=new Et(n);e.splice(l+1,0,h,d),l+=2;for(let f of a){s.has(f)||(i++,s.add(f));let E=new ft(n);E.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),E.setLayer(h),E.setType(y.BREAKING_POINT);let P=new rt;P.setNode(E),P.setSide(u.WEST);let S=new rt;S.setNode(E),S.setSide(u.EAST);let T=new ft(n);T.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),T.setLayer(d),T.setType(y.BREAKING_POINT);let N=new rt;N.setNode(T),N.setSide(u.WEST);let I=new rt;I.setNode(T),I.setSide(u.EAST);let C=new _e;C.setSource(f.getSource()),C.setTarget(P),C.setProperty(p.MODEL_ORDER,f.getProperty(p.MODEL_ORDER));let x=new _e;x.setSource(S),x.setTarget(N),x.setProperty(p.MODEL_ORDER,f.getProperty(p.MODEL_ORDER)),f.setSource(I);let M=new vr(E,T,C,x,f);E.setProperty(p.BREAKING_POINT_INFO,M),T.setProperty(p.BREAKING_POINT_INFO,M);let A=C.getSource().getNode();if(A.getType()===y.BREAKING_POINT){let B=A.getProperty(p.BREAKING_POINT_INFO);B.next=M,M.prev=B}}if(o<t.length)r=t[o++];else break}c++,l++}return i}function Qy(n,t){let e=[],o=[],r=null;for(let s of t){let a=new I_(s);o.push(a),r!=null&&(a.prev=r,r.suc=a),r=a}let i=eI(n);for(let s=0;s<o.length;s++){let a=null,l=o[0].selfOrNext(),c=null,g=Number.POSITIVE_INFINITY;for(let h=1;h<n.getLayers().length;h++){let d,f=l!=null?Math.abs(l.index-h):Math.abs(h-a.index)+1,E=a!=null?Math.abs(h-a.index):f+1,P;E<f?(d=a,P=E):(d=l,P=f);let S=tI(n,h,i[h],P);S<g&&(g=S,c=d,c.newIndex=h),l!=null&&h===l.index&&(a=l,l=l.next())}c!=null&&(e.push(c.newIndex),c.assigned=!0,c.offset())}return e.sort((s,a)=>s-a),e}function tI(n,t,e,o){let r=n.getProperty(_.WRAPPING_MULTI_EDGE_DISTANCE_PENALTY);return e+Math.pow(o,r)}function eI(n){let t=new Array(n.getLayers().length+1).fill(0),e=new Set,o=0;for(let r of n.getLayers()){t[o++]=e.size;for(let i of r.getNodes())for(let s of i.getOutgoingEdges())e.add(s);for(let i of r.getNodes())for(let s of i.getIncomingEdges())e.delete(s)}return t}var I_=class{constructor(t){this.index=t,this.newIndex=t,this.prev=null,this.suc=null,this.assigned=!1}selfOrNext(){return this.assigned?this.suc!=null?this.suc.selfOrNext():null:this}next(){return this.suc!=null?this.suc.selfOrNext():null}offset(){if(!this.assigned)throw new Error("Cannot offset an unassigned cut.");let t=this.newIndex-this.index;this._offset(t),this._offsetPrev(t),this._offsetSuc(t)}_offset(t){this.index+=t}_offsetPrev(t){this.prev!=null&&!this.prev.assigned&&(this.prev._offset(t),this.prev._offsetPrev(t))}_offsetSuc(t){this.suc!=null&&!this.suc.assigned&&(this.suc._offset(t),this.suc._offsetSuc(t))}};var Qh=class{process(t,e){if(e.begin("Breaking Point Processor",1),oI(t),t.getProperty(_.WRAPPING_MULTI_EDGE_IMPROVE_WRAPPED_EDGES)){for(let o of t.getLayers()){let r=0;for(let i of o.getNodes())i.id=r++}rI(t),TP(t,!0),TP(t,!1)}e.done()}};function oI(n){let t=n.getLayers();t.unshift(new Et(n));let e=!1,o=1,r=0;for(;r<t.length;){let i=t[r],s=t[o],a=i.getNodes().slice(),l=a.length;for(let c of a)c.setLayer(s);if(e){let c=a.slice().reverse();for(let g of c){let h=[...g.getIncomingEdges()];for(let d of h){d.reverse(n,!0),n.setProperty(p.CYCLIC,!0);let f=Yn.insertDummies(n,d,l),E=g.getProperty(p.BREAKING_POINT_INFO),P=f[f.length-1];E.startInLayerDummy=P.getSource().getNode(),E.startInLayerEdge=P,E.endInLayerDummy=d.getTarget().getNode(),E.endInLayerEdge=d}}e=!1}else a.length>0&&a[0].getType()===y.BREAKING_POINT&&(e=!0,o=-1);o++,r++}for(let i=t.length-1;i>=0;i--)t[i].getNodes().length===0&&t.splice(i,1)}function rI(n){for(let t of n.getLayers()){let e=t.getNodes().slice();for(let o of e){if(!vr.isStart(o))continue;let r=o.getProperty(p.BREAKING_POINT_INFO);if(r.prev!=null||r.next==null)continue;let i=r,s=r.next;for(;s!=null;){NP(s.start,s.startInLayerDummy,!1,!0),Vn(i.end),Vn(s.start),Vn(s.startInLayerDummy),Vn(s.endInLayerDummy),s.endInLayerEdge.setTarget(i.endInLayerEdge.getTarget()),i.endInLayerEdge.setTarget(null),i.end.setLayer(null),s.start.setLayer(null),s.startInLayerDummy.setLayer(null),s.endInLayerDummy.setLayer(null);let a=new vr(i.start,s.end,i.nodeStartEdge,s.startEndEdge,s.originalEdge);a.startInLayerDummy=i.startInLayerDummy,a.startInLayerEdge=i.startInLayerEdge,a.endInLayerDummy=i.endInLayerDummy,a.endInLayerEdge=s.endInLayerEdge,a.prev=i.prev,a.next=s.next,i.start.setProperty(p.BREAKING_POINT_INFO,a),s.end.setProperty(p.BREAKING_POINT_INFO,a),s=s.next,i=a}}}}function TP(n,t){let e=t?r=>vr.isEnd(r):r=>vr.isStart(r),o;do{o=!1;let r=t?n.getLayers().slice().reverse():n.getLayers();for(let i of r){let s=i.getNodes().slice();for(let a of s){if(!e(a))continue;let l=a.getProperty(p.BREAKING_POINT_INFO),c=t?l.endInLayerDummy:l.startInLayerDummy;NP(a,c,t,!1)&&(o=!0)}}}while(o)}function NP(n,t,e,o){let r=Jh(n,e),i=Jh(t,e),s=!1;for(;r!=null&&i!=null&&!(!o&&!iI(r,i,e));){let a=Jh(r,e),l=Jh(i,e);Vn(t),Vn(n);let c=r.getLayer();ii.joinAt(r,!1),ii.joinAt(i,!1),e?(t.setLayer(i.id,c),t.id=i.id,n.setLayer(r.id+1,c),n.id=r.id):(n.setLayer(r.id,c),n.id=r.id,t.setLayer(i.id+1,c),t.id=i.id),r.setLayer(null),i.setLayer(null),r=a,i=l,s=!0}return s}function iI(n,t,e){let o=n.getLayer(),r=e?t:n,i=e?n:t;for(let s=r.id+1;s<i.id;s++){let a=o.getNodes()[s];if(!(a.getType()===y.BREAKING_POINT||sI(a)))return!1}return!0}function Jh(n,t){let e=t?n.getOutgoingEdges():n.getIncomingEdges();for(let o of e){let r=o.getOther(n);if(r.getType()===y.LONG_EDGE&&r.getLayer()!==n.getLayer())return r}return null}function sI(n){if(n.getType()!==y.LONG_EDGE)return!1;for(let t of n.getConnectedEdges())if(!t.isSelfLoop()&&n.getLayer()===t.getOther(n).getLayer())return!0;return!1}function Vn(n){let t=n.getLayer();if(t==null)return;let e=t.getNodes();for(let o=n.id+1;o<e.length;o++)e[o].id--}var td=class{constructor(){this._edgeRouting=null}process(t,e){e.begin("Breaking Point Removing",1),this._edgeRouting=t.getProperty(_.EDGE_ROUTING);for(let o of t.getLayers()){let r=o.getNodes().slice();for(let i of r){if(!vr.isEnd(i))continue;let s=i.getProperty(p.BREAKING_POINT_INFO);s.next==null&&this._remove(t,s)}}e.done()}_remove(t,e){let o=new st;switch(this._edgeRouting){case At.SPLINES:{let l=e.nodeStartEdge.getProperty(p.SPLINE_ROUTE_START),c=e.startEndEdge.getProperty(p.SPLINE_ROUTE_START),g=e.originalEdge.getProperty(p.SPLINE_ROUTE_START),h=e.nodeStartEdge.getProperty(p.SPLINE_EDGE_CHAIN),d=e.startEndEdge.getProperty(p.SPLINE_EDGE_CHAIN),f=e.originalEdge.getProperty(p.SPLINE_EDGE_CHAIN),E=[];if(l&&E.push(...l),c){for(let S of c)S.inverseOrder=!0;E.push(...[...c].reverse())}g&&E.push(...g);let P=[];h&&P.push(...h),d&&P.push(...[...d].reverse()),f&&P.push(...f),e.originalEdge.setProperty(p.SPLINE_ROUTE_START,E),e.originalEdge.setProperty(p.SPLINE_EDGE_CHAIN,P),e.originalEdge.setProperty(p.SPLINE_SURVIVING_EDGE,e.originalEdge),e.nodeStartEdge.setProperty(p.SPLINE_ROUTE_START,null),e.nodeStartEdge.setProperty(p.SPLINE_EDGE_CHAIN,null),e.startEndEdge.setProperty(p.SPLINE_ROUTE_START,null),e.startEndEdge.setProperty(p.SPLINE_EDGE_CHAIN,null);break}case At.POLYLINE:{for(let c of e.nodeStartEdge.getBendPoints())o.add(c);o.add(e.start.getPosition());let l=[...e.startEndEdge.getBendPoints()].reverse();for(let c of l)o.add(c);o.add(e.end.getPosition());for(let c of e.originalEdge.getBendPoints())o.add(c);break}default:{for(let c of e.nodeStartEdge.getBendPoints())o.add(c);let l=[...e.startEndEdge.getBendPoints()].reverse();for(let c of l)o.add(c);for(let c of e.originalEdge.getBendPoints())o.add(c)}}let r=e.originalEdge.getBendPoints();r.length=0;for(let l of o)r.add(l);e.originalEdge.setSource(e.nodeStartEdge.getSource());let i=e.nodeStartEdge.getProperty(_.JUNCTION_POINTS),s=e.startEndEdge.getProperty(_.JUNCTION_POINTS),a=e.originalEdge.getProperty(_.JUNCTION_POINTS);if(i!=null||s!=null||a!=null){let l=new st;R_(l,a),R_(l,s),R_(l,i),e.originalEdge.setProperty(_.JUNCTION_POINTS,l)}e.startEndEdge.setSource(null),e.startEndEdge.setTarget(null),e.nodeStartEdge.setSource(null),e.nodeStartEdge.setTarget(null),e.end.setLayer(null),e.start.setLayer(null),e.prev!=null&&this._remove(t,e.prev)}};function R_(n,t){if(n==null||t==null)return!1;for(let e of t)n.add(e);return!0}var tr=class{constructor(){this.id=0,this.master=null,this.cNodes=new Set,this.startPos=Number.NEGATIVE_INFINITY,this.incomingConstraints=new Set,this.outDegree=0,this.outDegreeReal=0,this.reference=null,this.delta=0,this.deltaNormalized=0}static of(){return new L_}addCNode(t){if(t.cGroup!=null)throw new Error("CNode belongs to another CGroup.");this.cNodes.add(t),t.cGroup=this,this.reference==null&&(this.reference=t)}removeCNode(t){let e=this.cNodes.delete(t);return e&&(t.cGroup=null),e}},L_=class{constructor(){this.group=new tr}nodes(...t){for(let e of t)this.group.addCNode(e);return this}reference(t){return this.group.reference=t,this}master(t){return this.group.master=t,this}create(t){return t.cGroups.push(this.group),this.group}};var ed=class{compact(t){let e=Number.POSITIVE_INFINITY;for(let r of t.cGraph.cNodes)e=Math.min(e,r.cGroup.reference.hitbox.x+r.cGroupOffset.x);let o=[];for(let r of t.cGraph.cGroups)r.startPos=e,r.outDegree===0&&o.push(r);for(;o.length>0;){let r=o.shift(),i=r.reference.hitbox.x;for(let s of r.cNodes){let a=r.startPos+s.cGroupOffset.x;!t.isLocked(r,t.direction)||s.hitbox.x<a?s.startPos=a:s.startPos=s.hitbox.x}i-=r.reference.startPos,r.delta+=i,t.direction===R.RIGHT||t.direction===R.DOWN?r.deltaNormalized+=i:r.deltaNormalized-=i;for(let s of r.cNodes)for(let a of s.constraints){let l;t.direction.isHorizontal()?l=t.spacingsHandler.getHorizontalSpacing(s,a):l=t.spacingsHandler.getVerticalSpacing(s,a),a.cGroup.startPos=Math.max(a.cGroup.startPos,s.startPos+s.hitbox.width+l-a.cGroupOffset.x),t.isLocked(a,t.direction)&&(a.cGroup.startPos=Math.max(a.cGroup.startPos,a.hitbox.x-a.cGroupOffset.x)),a.cGroup.outDegree--,a.cGroup.outDegree===0&&o.push(a.cGroup)}}for(let r of t.cGraph.cNodes)r.hitbox.x=r.startPos}};var ne=class{};ne.TOLERANCE=1e-4;function od(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}ne.eq=(n,t)=>Math.abs(n-t)<=ne.TOLERANCE;ne.gt=(n,t)=>od(n,t,ne.TOLERANCE)>0;ne.lt=(n,t)=>od(n,t,ne.TOLERANCE)<0;ne.ge=(n,t)=>od(n,t,ne.TOLERANCE)>=0;ne.le=(n,t)=>od(n,t,ne.TOLERANCE)<=0;var rd=class{constructor(t,e){this.node=t,this.low=e}},A_=class n{constructor(){this._items=[]}static _key(t){return t.hitbox.x+t.hitbox.width/2}add(t){let e=n._key(t);for(let o=0;o<this._items.length;o++){let r=n._key(this._items[o]);if(r===e)return!1;if(r>e)return this._items.splice(o,0,t),!0}return this._items.push(t),!0}lower(t){let e=n._key(t),o=null;for(let r of this._items)if(n._key(r)<e)o=r;else break;return o}floor(t){let e=n._key(t),o=null;for(let r of this._items)if(n._key(r)<=e)o=r;else break;return o}higher(t){let e=n._key(t);for(let o of this._items)if(n._key(o)>e)return o;return null}ceiling(t){let e=n._key(t);for(let o of this._items)if(n._key(o)>=e)return o;return null}remove(t){let e=this._items.indexOf(t);return e>=0?(this._items.splice(e,1),!0):!1}clear(){this._items.length=0}},Xn=class n{constructor(){this.compactor=null,this._scanlineHandler=new C_(this)}calculateConstraints(t){this.compactor=t,this._sweep(()=>!0)}_sweep(t){let e=[];for(let o of this.compactor.cGraph.cNodes)t(o)&&(e.push(new rd(o,!0)),e.push(new rd(o,!1)));this._scanlineHandler.reset(),Zo.execute(e,n._compareTimestamps,this._scanlineHandler)}static _compareTimestamps(t,e){let o=t.node.hitbox.y;t.low||(o+=t.node.hitbox.height);let r=e.node.hitbox.y;e.low||(r+=e.node.hitbox.height);let i=o-r;if(i===0){if(!t.low&&e.low)return-1;if(!e.low&&t.low)return 1}return i}},C_=class{constructor(t){this._owner=t,this._intervals=new A_,this._cand=[]}reset(){this._intervals.clear();let t=this._owner.compactor.cGraph.cNodes;this._cand=new Array(t.length).fill(null);let e=0;for(let o of t)o.id=e++}handle(t){t.low?this._insert(t):this._delete(t)}_insert(t){if(!this._intervals.add(t.node))throw new Error("Invalid hitboxes for scanline constraint calculation.");this._overlap(t.node,this._intervals.floor(t.node))||this._overlap(t.node,this._intervals.ceiling(t.node)),this._cand[t.node.id]=this._intervals.lower(t.node);let o=this._intervals.higher(t.node);o!=null&&(this._cand[o.id]=t.node)}_delete(t){let e=this._intervals.lower(t.node);e!=null&&e===this._cand[t.node.id]&&e.cGroup!=null&&e.cGroup!==t.node.cGroup&&e.constraints.push(t.node);let o=this._intervals.higher(t.node);o!=null&&this._cand[o.id]===t.node&&o.cGroup!=null&&o.cGroup!==t.node.cGroup&&t.node.constraints.push(o),this._intervals.remove(t.node)}_overlap(t,e){return t==null||e==null||t===e?!1:ne.le(t.hitbox.x,e.hitbox.x+e.hitbox.width)&&ne.le(e.hitbox.x,t.hitbox.x+t.hitbox.width)}};var id=class{calculateConstraints(t){for(let e of t.cGraph.cNodes)e.constraints.length=0;for(let e of t.cGraph.cNodes)for(let o of t.cGraph.cNodes){if(e===o||e.cGroup!=null&&e.cGroup===o.cGroup)continue;let r;t.direction.isHorizontal()?r=t.spacingsHandler.getVerticalSpacing(e,o):r=t.spacingsHandler.getHorizontalSpacing(e,o),(o.hitbox.x>e.hitbox.x||e.hitbox.x===o.hitbox.x&&e.hitbox.width<o.hitbox.width)&&ne.gt(o.hitbox.y+o.hitbox.height+r,e.hitbox.y)&&ne.lt(o.hitbox.y,e.hitbox.y+e.hitbox.height+r)&&e.constraints.push(o)}}};var x_=Object.freeze({getHorizontalSpacing:()=>0,getVerticalSpacing:()=>0}),Vq=Object.freeze({DEFAULT_SPACING_HANDLER:x_});var Br=class n{constructor(t){this.cGraph=t,this.compactionAlgorithm=n.LONGEST_PATH_COMPACTION,this.constraintAlgorithm=n.SCANLINE_CONSTRAINTS,this.lockFun=null,this.spacingsHandler=x_,this.direction=R.UNDEFINED,this._finished=!1,this.calculateGroupOffsets();for(let e of t.cNodes)e.cGroup==null&&tr.of().nodes(e).create(t),e.hitboxPreCompaction=new dt(e.hitbox)}setSpacingsHandler(t){return this.spacingsHandler=t,this}setCompactionAlgorithm(t){return this.compactionAlgorithm=t,this}setConstraintAlgorithm(t){return this.constraintAlgorithm=t,this}compact(){if(this._finished)throw new Error("The OneDimensionalCompactor instance has been finished already.");this.direction===R.UNDEFINED&&this.changeDirection(R.LEFT);for(let t of this.cGraph.cGroups)t.outDegree=t.outDegreeReal;for(let t of this.cGraph.cNodes)t.startPos=Number.NEGATIVE_INFINITY;return this.compactionAlgorithm.compact(this),this}finish(){return this.changeDirection(R.LEFT),this._finished=!0,this}changeDirection(t){if(this._finished)throw new Error("The OneDimensionalCompactor instance has been finished already.");if(!this.cGraph.supports(t))throw new Error(`The direction ${t} is not supported by the CGraph instance.`);if(t===this.direction)return this;let e=this.direction;switch(this.direction=t,e){case R.UNDEFINED:switch(t){case R.LEFT:this._calculateConstraints();break;case R.RIGHT:this._mirrorHitboxes(),this._calculateConstraints();break;case R.UP:this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.LEFT:switch(t){case R.RIGHT:this._mirrorHitboxes(),this._reverseConstraints();break;case R.UP:this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.RIGHT:switch(t){case R.LEFT:this._mirrorHitboxes(),this._reverseConstraints();break;case R.UP:this._mirrorHitboxes(),this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._mirrorHitboxes(),this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.UP:switch(t){case R.LEFT:this._transposeHitboxes(),this._calculateConstraints();break;case R.RIGHT:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break;case R.DOWN:this._mirrorHitboxes(),this._reverseConstraints();break}break;case R.DOWN:switch(t){case R.LEFT:this._mirrorHitboxes(),this._transposeHitboxes(),this._calculateConstraints();break;case R.RIGHT:this._mirrorHitboxes(),this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break;case R.UP:this._mirrorHitboxes(),this._reverseConstraints();break}break}return this}isLocked(t,e){if(t.cNodes!=null){for(let o of t.cNodes)if(this.isLocked(o,e))return!0;return!1}return this.lockFun!=null?this.lockFun.isLocked(t,e):!1}setLockFunction(t){return this.lockFun=t,this}forceConstraintsRecalculation(){return this._calculateConstraints(),this}calculateGroupOffsets(){for(let t of this.cGraph.cGroups){t.reference=null;for(let e of t.cNodes)e.cGroupOffset.reset(),(t.reference==null||e.hitbox.x<t.reference.hitbox.x)&&(t.reference=e);for(let e of t.cNodes)e.cGroupOffset.x=e.hitbox.x-t.reference.hitbox.x,e.cGroupOffset.y=e.hitbox.y-t.reference.hitbox.y}return this}_mirrorHitboxes(){for(let t of this.cGraph.cNodes)t.hitbox.x=-t.hitbox.x-t.hitbox.width;this.calculateGroupOffsets()}_transposeHitboxes(){for(let t of this.cGraph.cNodes){let e=t.hitbox.x;t.hitbox.x=t.hitbox.y,t.hitbox.y=e,e=t.hitbox.width,t.hitbox.width=t.hitbox.height,t.hitbox.height=e,e=t.cGroupOffset.x,t.cGroupOffset.x=t.cGroupOffset.y,t.cGroupOffset.y=e}this.calculateGroupOffsets()}_calculateConstraints(){for(let e of this.cGraph.cNodes)e.constraints.length=0;let t=this.direction.isHorizontal()?this.cGraph.predefinedHorizontalConstraints:this.cGraph.predefinedVerticalConstraints;for(let e of t)this.direction===R.LEFT||this.direction===R.UP?e.getFirst().constraints.push(e.getSecond()):e.getSecond().constraints.push(e.getFirst());this.constraintAlgorithm.calculateConstraints(this),this._calculateConstraintsForCGroups()}_calculateConstraintsForCGroups(){for(let t of this.cGraph.cGroups)t.outDegree=0,t.outDegreeReal=0,t.incomingConstraints.clear();for(let t of this.cGraph.cGroups)for(let e of t.cNodes)for(let o of e.constraints)o.cGroup!==t&&(t.incomingConstraints.add(o),o.cGroup.outDegree++,o.cGroup.outDegreeReal++)}_reverseConstraints(){let t=new Map;for(let e of this.cGraph.cNodes)t.set(e,[]);for(let e of this.cGraph.cNodes){e.startPos=Number.NEGATIVE_INFINITY;for(let o of e.constraints)t.get(o).push(e)}for(let e of this.cGraph.cNodes)e.constraints=t.get(e);this._calculateConstraintsForCGroups()}};Br.LONGEST_PATH_COMPACTION=new ed;Br.SCANLINE_CONSTRAINTS=new Xn;Br.QUADRATIC_CONSTRAINTS=new id;var Ur=class{constructor(t){this.name=t}toString(){return this.name}};Ur.QUADRATIC=new Ur("QUADRATIC");Ur.SCANLINE=new Ur("SCANLINE");var ai=class{constructor(t=!1,e=!1,o=!1,r=!1){this.left=t,this.right=e,this.up=o,this.down=r}set(t,e,o,r){this.left=t,this.right=e,this.up=o,this.down=r}applyOr(t){this.left=this.left||t.left,this.right=this.right||t.right,this.up=this.up||t.up,this.down=this.down||t.down}setDirection(t,e){switch(e){case R.LEFT:this.left=t;break;case R.RIGHT:this.right=t;break;case R.UP:this.up=t;break;case R.DOWN:this.down=t;break}}getDirection(t){switch(t){case R.LEFT:return this.left;case R.RIGHT:return this.right;case R.UP:return this.up;case R.DOWN:return this.down;default:return!1}}};var we=class{constructor(t,e,o,r){this.potentialGroupParents=[],this.representedLEdges=[],this.affectedBends=[],this.affectedBoundingBoxes=[],this.hitbox=new dt,this.junctionPoints=new st,this.ignoreSpacing=new ai,this.constraints=[],this.aPort=null,this.joined=[],this.affectedBends.push(t),this.affectedBends.push(e),this.hitbox.x=Math.min(t.x,e.x),this.hitbox.y=Math.min(t.y,e.y),this.hitbox.width=Math.abs(t.x-e.x),this.hitbox.height=Math.abs(t.y-e.y);let i=r.getProperty(_.JUNCTION_POINTS);if(i!=null)for(let s of i)ne.eq(s.x,t.x)&&this.junctionPoints.add(s);o!=null&&this.potentialGroupParents.push(o),this.representedLEdges.push(r)}joinWith(t){for(let l of t.representedLEdges)this.representedLEdges.push(l);for(let l of t.affectedBends)this.affectedBends.push(l);for(let l of t.affectedBoundingBoxes)this.affectedBoundingBoxes.push(l);for(let l of t.junctionPoints)this.junctionPoints.add(l);for(let l of t.constraints)this.constraints.push(l);for(let l of t.potentialGroupParents)this.potentialGroupParents.push(l);let e=Math.min(this.hitbox.x,t.hitbox.x),o=Math.min(this.hitbox.y,t.hitbox.y),i=Math.max(this.hitbox.x+this.hitbox.width,t.hitbox.x+t.hitbox.width)-e,a=Math.max(this.hitbox.y+this.hitbox.height,t.hitbox.y+t.hitbox.height)-o;this.hitbox.x=e,this.hitbox.y=o,this.hitbox.width=i,this.hitbox.height=a,this.ignoreSpacing.applyOr(t.ignoreSpacing),this.aPort==null&&(this.aPort=t.aPort);for(let l of t.joined)this.joined.push(l);return this.joined.push(t),this}intersects(t){return ne.eq(this.hitbox.x,t.hitbox.x)&&!(ne.lt(this.hitbox.y+this.hitbox.height,t.hitbox.y)||ne.lt(t.hitbox.y+t.hitbox.height,this.hitbox.y))}compareTo(t){let e=ne.TOLERANCE,o=this.hitbox.x-t.hitbox.x;return Math.abs(o)<=e?this.hitbox.y-t.hitbox.y:o}toString(){return`VerticalSegment ${this.hitbox} ${this.representedLEdges.join(", ")}`}};var sd=.5,Kn=.01,nd=class extends Xn{constructor(t){super(),this._verticalEdgeEdgeSpacing=t.getProperty(_.SPACING_EDGE_EDGE),this._edgeRouting=t.getProperty(_.EDGE_ROUTING)}calculateConstraints(t){switch(this.compactor=t,this._edgeRouting){case At.ORTHOGONAL:this._calculateForOrthogonal();break;case At.SPLINES:this._calculateForSpline();break;default:throw new Error("Unsupported edge routing: "+this._edgeRouting)}}_calculateForSpline(){let t=[];this._sweep(o=>o.origin instanceof we);let e=this._computeMinSpacing();for(let o of this.compactor.cGraph.cNodes)o.origin instanceof ft&&(this._alterHitbox(o,e,1),t.push(()=>this._alterHitbox(o,e,-1)));this._sweep(()=>!0);for(let o of t)o();t.length=0}_calculateForOrthogonal(){let t=[];for(let o of this.compactor.cGraph.cNodes)if(o.origin instanceof we){let r=Math.max(0,this._verticalEdgeEdgeSpacing/2-sd);this._alterHitbox(o,r,1),t.push(()=>this._alterHitbox(o,r,-1))}this._sweep(o=>o.origin instanceof we);for(let o of t)o();t.length=0;for(let o of this.compactor.cGraph.cNodes)if(o.origin instanceof ft){let r=ke.getLNodeOrNull(o),i=oo.getIndividualOrDefault(r,_.SPACING_EDGE_EDGE),s=Math.max(0,i/2-sd);this._alterHitbox(o,s,1),t.push(()=>this._alterHitbox(o,s,-1))}this._sweep(o=>o.origin instanceof ft);for(let o of t)o();t.length=0;let e=this._computeMinSpacing();for(let o of this.compactor.cGraph.cGroups)this._alterGroupedHitboxOrthogonal(o,e,1),t.push(()=>this._alterGroupedHitboxOrthogonal(o,e,-1));this._sweep(()=>!0);for(let o of t)o();t.length=0}_computeMinSpacing(){let t=Number.POSITIVE_INFINITY;for(let e of this.compactor.cGraph.cNodes){let o;if(e.origin instanceof ft&&e.origin.getType()===y.EXTERNAL_PORT)o=Number.POSITIVE_INFINITY;else if(ke.getVerticalSegmentOrNull(e)!=null)o=Math.max(0,this._verticalEdgeEdgeSpacing/2-sd);else{let i=ke.getLNodeOrNull(e);if(i!=null){let s=oo.getIndividualOrDefault(i,_.SPACING_NODE_NODE);o=Math.max(0,s/2-sd)}else o=Number.POSITIVE_INFINITY}o<t&&(t=o)}return Number.isFinite(t)?t:0}_alterGroupedHitboxOrthogonal(t,e,o){let r=t.master;if(r==null&&(r=t.cNodes.values().next().value),this._alterHitbox(r,e,o),t.cNodes.size===1)return;let i=e*o;for(let s of t.cNodes){if(s===r)continue;let a=ke.getVerticalSegmentOrNull(s);a!=null&&(a.ignoreSpacing.up?(s.hitbox.y+=i+Kn,s.hitbox.height-=i+Kn):a.ignoreSpacing.down&&(s.hitbox.height-=i+Kn))}}_alterHitbox(t,e,o){let r=e*o;if(t.origin instanceof we){let i=ke.getVerticalSegmentOrNull(t);i.ignoreSpacing.up?i.ignoreSpacing.down||(t.hitbox.height+=r+Kn):(t.hitbox.y-=r+Kn,t.hitbox.height+=r+Kn)}else t.origin instanceof ft&&(t.hitbox.y-=r,t.hitbox.height+=2*r)}};var Zn=class{constructor(t){this.cNodes=[],this.cGroups=[],this.predefinedHorizontalConstraints=[],this.predefinedVerticalConstraints=[],this._supportedDirections=t}supports(t){return this._supportedDirections.has(t)}};var ki=class{constructor(){this.id=0,this.origin=null,this.type=null,this.toStringDelegate=null,this.cGroup=null,this.cGroupOffset=new O,this.hitboxPreCompaction=null,this.hitbox=null,this.constraints=[],this.startPos=Number.NEGATIVE_INFINITY,this.lock=new ai}static of(){return new D_}getDebugSVG(){let t=this.hitbox.x,e=this.hitbox.y,o=Math.max(1,this.hitbox.width),r=Math.max(1,this.hitbox.height);return`<rect x="${t}" y="${e}" width="${o}" height="${r}" fill="green" stroke="black" opacity="0.5"/><text x="${t+2}" y="${e+8+2+1}">(${Math.round(t)}, ${Math.round(e)})
-${this}</text>`}toString(){return this.toStringDelegate!=null?this.toStringDelegate(this):`CNode[id=${this.id}]`}},D_=class{constructor(){this.node=new ki,this.groupParent=null}id(t){return this.node.id=t,this}origin(t){return this.node.origin=t,this}type(t){return this.node.type=t,this}hitbox(t){return this.node.hitbox=t,this}toStringDelegate(t){return this.node.toStringDelegate=t,this}groupWith(t){return this.groupParent=t,this}create(t){return t.cNodes.push(this.node),this.groupParent!=null&&(this.groupParent.cGroup==null?tr.of().nodes(this.groupParent,this.node).create(t):this.groupParent.cGroup.addCNode(this.node)),this.node}};var ad=class{constructor(){this._cGraph=null,this._layeredGraph=null,this._edgeRouting=null,this._commentOffsets=new Map,this._nodesMap=new Map,this._verticalSegmentsMap=new Map,this._lockMap=new Map}transform(t){return this._layeredGraph=t,this._edgeRouting=this._layeredGraph.getProperty(_.EDGE_ROUTING),this._init(),this._transformNodes(),this._transformEdges(),this._cGraph}getLockMap(){return this._lockMap}_init(){let t=!1,e=0;for(let r of this._layeredGraph){r.id=e++;for(let i of r)if(!t)for(let s of i.getConnectedEdges()){t=!0;break}}let o=new Set([R.UNDEFINED,R.LEFT,R.RIGHT]);t||(o.add(R.UP),o.add(R.DOWN)),this._cGraph=new Zn(o),this._nodesMap.clear(),this._commentOffsets.clear(),this._lockMap.clear(),this._verticalSegmentsMap.clear()}_transformNodes(){for(let t of this._layeredGraph)for(let e of t){if(e.getProperty(_.COMMENT_BOX)){let c=[...e.getConnectedEdges()];if(c.length>0){let g=c[0],h=g.getSource().getNode();h===e&&(h=g.getTarget().getNode());let d=new O(e.getPosition().x-h.getPosition().x,e.getPosition().y-h.getPosition().y);this._commentOffsets.set(e,{other:h,offset:d});continue}}let o=new dt(e.getPosition().x-e.getMargin().left,e.getPosition().y-e.getMargin().top,e.getSize().x+e.getMargin().left+e.getMargin().right,e.getSize().y+e.getMargin().top+e.getMargin().bottom),r=ki.of().origin(e).hitbox(o).toStringDelegate(nI).create(this._cGraph);tr.of().nodes(r).master(r).create(this._cGraph);let i=new ai;this._lockMap.set(r,i);let s=0;for(let c of e.getIncomingEdges())s++;let a=0;for(let c of e.getOutgoingEdges())a++;let l=s-a;l<0?i.setDirection(!0,R.LEFT):l>0&&i.setDirection(!0,R.RIGHT),e.getType()===y.EXTERNAL_PORT&&i.set(!1,!1,!1,!1),this._nodesMap.set(e,r)}}_transformEdges(){let t=this._layeredGraph.getProperty(_.EDGE_ROUTING),e;switch(t){case At.ORTHOGONAL:e=this._collectVerticalSegmentsOrthogonal();break;case At.SPLINES:e=this._collectVerticalSegmentsSplines();break;default:throw new Error("Compaction not supported for "+t+" edges.")}this._mergeVerticalSegments(e);for(let o of this._verticalSegmentsMap.keys()){let r=this._verticalSegmentsMap.get(o);for(let i of o.constraints){let s=this._verticalSegmentsMap.get(i);this._cGraph.predefinedHorizontalConstraints.push([r,s])}}}_collectVerticalSegmentsOrthogonal(){let t=[];for(let e of this._layeredGraph)for(let o of e){let r=this._nodesMap.get(o);if(r!=null){for(let i of o.getOutgoingEdges()){let s=[...i.getBendPoints()];if(s.length===0)continue;let a=s[0],l=null,c=!0;if(i.getSource().getSide()===u.NORTH){let g=new we(a,new O(a.x,r.hitbox.y),r,i);g.ignoreSpacing.down=!0,g.aPort=i.getSource(),t.push(g)}if(i.getSource().getSide()===u.SOUTH){let g=new we(a,new O(a.x,r.hitbox.y+r.hitbox.height),r,i);g.ignoreSpacing.up=!0,g.aPort=i.getSource(),t.push(g)}for(let g=1;g<s.length;g++){let h=s[g];ne.eq(a.y,h.y)||(l=new we(a,h,null,i),t.push(l),c&&(c=!1,h.y<r.hitbox.y?l.ignoreSpacing.down=!0:h.y>r.hitbox.y+r.hitbox.height?l.ignoreSpacing.up=!0:(l.ignoreSpacing.up=!0,l.ignoreSpacing.down=!0))),g+1<s.length&&(a=h)}if(l!=null){let g=this._nodesMap.get(i.getTarget().getNode()),h=s[s.length-2];g!=null&&(h.y<g.hitbox.y?l.ignoreSpacing.down=!0:h.y>g.hitbox.y+g.hitbox.height?l.ignoreSpacing.up=!0:(l.ignoreSpacing.up=!0,l.ignoreSpacing.down=!0))}}for(let i of o.getIncomingEdges()){let s=i.getBendPoints();if(s.length===0)continue;let a=s[s.length-1];if(i.getTarget().getSide()===u.NORTH){let l=new we(a,new O(a.x,r.hitbox.y),r,i);l.ignoreSpacing.down=!0,l.aPort=i.getTarget(),t.push(l)}if(i.getTarget().getSide()===u.SOUTH){let l=new we(a,new O(a.x,r.hitbox.y+r.hitbox.height),r,i);l.ignoreSpacing.up=!0,l.aPort=i.getTarget(),t.push(l)}}}}return t}_collectVerticalSegmentsSplines(){let t=[];for(let e of this._layeredGraph.getLayers())for(let o of e.getNodes())for(let r of o.getOutgoingEdges()){let i=r.getProperty(p.SPLINE_ROUTE_START);if(i==null)continue;let s=null;for(let a of i){if(a.isStraight)continue;let l=a.boundingBox.getTopLeft(),c=a.boundingBox.getBottomRight(),g=new we(l,c,null,a.edges.values().next().value);g.affectedBoundingBoxes.push(a.boundingBox),t.push(g),s!=null&&s.constraints.push(g),s=g}}return t}_mergeVerticalSegments(t){if(t.length===0)return;t.sort((o,r)=>o.compareTo(r));let e=t[0];for(let o=1;o<t.length;o++){let r=t[o];e.intersects(r)?e=e.joinWith(r):(this._verticalSegmentToCNode(e),e=r)}this._verticalSegmentToCNode(e)}_verticalSegmentToCNode(t){let e=ki.of().origin(t).type("vs").hitbox(new dt(t.hitbox)).toStringDelegate(aI).create(this._cGraph);t.potentialGroupParents.length>0&&t.potentialGroupParents[0].cGroup.addCNode(e);let o=new ai;this._lockMap.set(e,o);let r=new Set,i=new Set;for(let a of t.representedLEdges)r.add(a.getSource()),i.add(a.getTarget());let s=r.size-i.size;s<0?(o.setDirection(!0,R.LEFT),o.setDirection(!1,R.RIGHT)):s>0&&(o.setDirection(!1,R.LEFT),o.setDirection(!0,R.RIGHT));for(let a of t.joined)this._verticalSegmentsMap.set(a,e);this._verticalSegmentsMap.set(t,e)}applyLayout(){for(let o of this._cGraph.cNodes)if(o.origin instanceof ft){let r=o.origin;r.getPosition().x=o.hitbox.x+r.getMargin().left}this._applyCommentPositions();for(let o of this._cGraph.cNodes)if(o.origin instanceof we){let r=o.hitbox.x-o.hitboxPreCompaction.x,i=o.origin;for(let s of i.affectedBends)s.x+=r;for(let s of i.affectedBoundingBoxes)s.x+=r;for(let s of i.junctionPoints)s.x+=r}for(let o of this._nodesMap.keys())for(let r of o.getOutgoingEdges()){if(!r.isSelfLoop())continue;let i=r.getSource().getNode(),s=this._nodesMap.get(i),a=s.hitbox.x-s.hitboxPreCompaction.x;for(let l of r.getBendPoints())l.x+=a;for(let l of r.getLabels())l.getPosition().x+=a}if(this._layeredGraph.getProperty(_.EDGE_ROUTING)===At.SPLINES)for(let o of this._layeredGraph.getLayers())for(let r of o.getNodes())for(let i of r.getOutgoingEdges()){let s=i.getProperty(p.SPLINE_ROUTE_START);s!=null&&s.length>0&&this._adjustSplineControlPoints(s)}let t=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),e=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let o of this._cGraph.cNodes)t.x=Math.min(t.x,o.hitbox.x),t.y=Math.min(t.y,o.hitbox.y),e.x=Math.max(e.x,o.hitbox.x+o.hitbox.width),e.y=Math.max(e.y,o.hitbox.y+o.hitbox.height);this._layeredGraph.getOffset().reset().add(-t.x,-t.y),this._layeredGraph.getSize().reset().add(e.x-t.x,e.y-t.y),this._applyExternalPortPositions(t,e),this._cleanup()}_applyCommentPositions(){for(let[t,e]of this._commentOffsets){let o=e.other,r=e.offset;t.getPosition().reset().add(o.getPosition().x+r.x,o.getPosition().y+r.y)}}_applyExternalPortPositions(t,e){for(let o of this._cGraph.cNodes){let r=o.origin instanceof ft?o.origin:null;if(!(r==null||r.getType()!==y.EXTERNAL_PORT))switch(r.getProperty(p.EXT_PORT_SIDE)){case u.WEST:r.getPosition().x=t.x;break;case u.EAST:r.getPosition().x=e.x-(r.getSize().x+r.getMargin().right);break;case u.NORTH:r.getPosition().y=t.y;break;case u.SOUTH:r.getPosition().y=e.y-(r.getSize().y+r.getMargin().bottom);break;default:break}}}_adjustSplineControlPoints(t){if(t.length===0)return;let e=t[0];if(t.length===1){this._adjustControlPointBetweenSegments(e,e,1,0,t);return}let o=1;for(;o<t.length;)if(e.initialSegment||!e.isStraight){let r=this._firstNonStraightSegment(t,o);if(r!=null){let i=r[0],s=r[1];this._adjustControlPointBetweenSegments(e,s,o,i,t),o=i+1,e=s}else break}else o++}_firstNonStraightSegment(t,e){if(e<0||e>=t.length)return null;for(let o=e;o<t.length;o++){let r=t[o];if(o===t.length-1||!r.isStraight)return[o,r]}return null}_adjustControlPointBetweenSegments(t,e,o,r,i){let s,a=o;if(t.initialSegment&&t.isStraight){let E=this._nodesMap.get(t.sourceNode);s=E.hitbox.x+E.hitbox.width,a--}else s=t.boundingBox.x+t.boundingBox.width;let l,c=r;e.lastSegment&&e.isStraight?(l=this._nodesMap.get(e.targetNode).hitbox.x,c++):l=e.boundingBox.x;let g=l-s,h=Math.max(2,c-a),d=g/h,f=s+d;for(let E=a;E<c;E++){let P=i[E],S=P.boundingBox.width;P.boundingBox.x=f-S/2,f+=d}}_cleanup(){this._nodesMap.clear(),this._commentOffsets.clear(),this._verticalSegmentsMap.clear(),this._lockMap.clear(),this._cGraph.cGroups.length=0,this._cGraph.cNodes.length=0,this._cGraph=null,this._layeredGraph=null}},nI=n=>{let t=n.origin,e=t&&t.getProperty?t.getProperty(p.ORIGIN):null;return e!=null?String(e):String(t)},aI=n=>String(n.origin);var te=class{constructor(){this.id=0,this.internalId=0,this.origin=null,this.source=null,this.target=null,this.weight=0,this.delta=1,this.treeEdge=!1}static of(t){return new w_}getSource(){return this.source}getTarget(){return this.target}getOther(t){if(t===this.source)return this.target;if(t===this.target)return this.source;throw new Error(`Node ${t} not part of edge ${this}`)}reverse(){let t=this.source;return this.source=this.target,this.target=t,yP(this.target.getOutgoingEdges(),this),this.target.getIncomingEdges().push(this),yP(this.source.getIncomingEdges(),this),this.source.getOutgoingEdges().push(this),this}toString(){return`NEdge[id=${this.id} w=${this.weight} d=${this.delta}]`}};function yP(n,t){let e=n.indexOf(t);e>=0&&n.splice(e,1)}var w_=class{constructor(){this.edge=new te}id(t){return this.edge.id=t,this}origin(t){return this.edge.origin=t,this}weight(t){return this.edge.weight=t,this}delta(t){return this.edge.delta=t,this}source(t){return this.edge.source=t,this}target(t){return this.edge.target=t,this}create(){if(this.edge.source==null||this.edge.target==null)throw new Error("NEdge must have a source and target NNode specified.");if(this.edge.source===this.edge.target)throw new Error(`Network simplex does not support self-loops: ${this.edge} ${this.edge.source} ${this.edge.target}`);return this.edge.source.getOutgoingEdges().push(this.edge),this.edge.target.getIncomingEdges().push(this.edge),this.edge}};var He=class{constructor(){this.id=0,this.internalId=0,this.origin=null,this.type="",this.layer=0,this.treeNode=!1,this.unknownCutvalues=[],this._outgoingEdges=new ld,this._incomingEdges=new ld,this._outgoingEdgesModCnt=-1,this._incomingEdgesModCnt=-1,this._allEdges=[]}static of(){return new M_}getOutgoingEdges(){return this._outgoingEdges}getIncomingEdges(){return this._incomingEdges}getConnectedEdges(){if(this._incomingEdgesModCnt!==this._incomingEdges.getModCnt()||this._outgoingEdgesModCnt!==this._outgoingEdges.getModCnt()){this._allEdges=[];for(let t of this._incomingEdges)this._allEdges.push(t);for(let t of this._outgoingEdges)this._allEdges.push(t);this._incomingEdgesModCnt=this._incomingEdges.getModCnt(),this._outgoingEdgesModCnt=this._outgoingEdges.getModCnt()}return this._allEdges}toString(){return`NNode[id=${this.id} layer=${this.layer}]`}},M_=class{constructor(){this.node=new He}id(t){return this.node.id=t,this}origin(t){return this.node.origin=t,this}type(t){return this.node.type=t,this}create(t){return t.nodes.push(this.node),this.node}},ld=class extends Array{constructor(){super(),this._modCount=0}getModCnt(){return this._modCount}push(...t){return this._modCount++,super.push(...t)}pop(){return this._modCount++,super.pop()}shift(){return this._modCount++,super.shift()}unshift(...t){return this._modCount++,super.unshift(...t)}splice(t,e,...o){return this._modCount++,super.splice(t,e,...o)}clear(){this._modCount++,this.length=0}};var Wi=class{constructor(){this.nodes=[]}makeConnected(){let t=0;for(let o of this.nodes)o.internalId=t++;let e=this._findConCompRepresentatives();return e.length>1?this._createArtificialRootAndConnect(e):null}_createArtificialRootAndConnect(t){let e=He.of().create(this);for(let o of t)te.of().delta(0).weight(0).source(e).target(o).create();return e}_findConCompRepresentatives(){let t=[],e=new Array(this.nodes.length).fill(!1);for(let o of this.nodes)e[o.internalId]||(t.push(o),this._dfs(o,e));return t}_dfs(t,e){if(!e[t.internalId]){e[t.internalId]=!0;for(let o of t.getConnectedEdges()){let r=o.getOther(t);this._dfs(r,e)}}}isAcyclic(){let t=0;for(let i of this.nodes)i.internalId=t++;let e=new Array(this.nodes.length).fill(0),o=new Array(this.nodes.length).fill(0);for(let i of this.nodes)e[i.internalId]+=i.getIncomingEdges().length;let r=[];for(let i of this.nodes)i.getIncomingEdges().length===0&&r.push(i);if(r.length===0&&this.nodes.length>0)return!1;for(;r.length>0;){let i=r.shift();for(let s of i.getOutgoingEdges()){let a=s.getTarget();o[a.internalId]=Math.max(o[a.internalId],o[i.internalId]+1),e[a.internalId]--,e[a.internalId]===0&&r.push(a)}}for(let i of this.nodes)for(let s of i.getOutgoingEdges())if(o[s.target.internalId]<=o[s.source.internalId])return!1;return!0}};var lI=40,cI=-1e-10,li=class n{constructor(){this._previousLayeringNodeCounts=null,this._balance=!1,this._iterationLimit=Number.MAX_SAFE_INTEGER,this.graph=null,this._edges=null,this._treeEdges=null,this._sources=null,this._edgeVisited=null,this._postOrder=1,this._poID=null,this._lowestPoID=null,this._cutvalue=null,this._subtreeNodesStack=null}static forGraph(t){let e=new n;return e.graph=t,e}withBalancing(t){return this._balance=t,this}withPreviousLayering(t){return this._previousLayeringNodeCounts=t,this}withIterationLimit(t){return this._iterationLimit=t,this}_initialize(){let t=this.graph.nodes.length;for(let s of this.graph.nodes)s.treeNode=!1;this._poID=new Array(t).fill(0),this._lowestPoID=new Array(t).fill(0),this._sources=[];let e=0,o=[];for(let s of this.graph.nodes){s.internalId=e++,s.getIncomingEdges().length===0&&this._sources.push(s);for(let a of s.getOutgoingEdges())o.push(a)}let r=0;for(let s of o)s.internalId=r++,s.treeEdge=!1;let i=o.length;this._cutvalue==null||this._cutvalue.length<i?(this._cutvalue=new Array(i).fill(0),this._edgeVisited=new Array(i).fill(!1)):this._edgeVisited.fill(!1),this._edges=o,this._treeEdges=new Set,this._postOrder=1}_dispose(){this._cutvalue=null,this._edges=null,this._treeEdges=null,this._edgeVisited=null,this._lowestPoID=null,this._poID=null,this._sources=null,this._subtreeNodesStack=null}execute(t){let e=t||new Ie;if(e.begin("Network simplex",1),this.graph.nodes.length<1){e.done();return}for(let s of this.graph.nodes)s.layer=0;let o=this.graph.nodes.length>=lI;o&&this._removeSubtrees(),this._initialize(),this._feasibleTree();let r=this._leaveEdge(),i=0;for(;r!=null&&i<this._iterationLimit;)this._exchange(r,this._enterEdge(r)),r=this._leaveEdge(),i++;o&&this._reattachSubtrees(),this._balance?this._balanceLayering(this._normalize()):this._normalize(),this._dispose(),e.done()}_removeSubtrees(){this._subtreeNodesStack=[];let t=[];for(let e of this.graph.nodes)e.getConnectedEdges().length===1&&t.push(e);for(;t.length>0;){let e=t.shift();if(e.getConnectedEdges().length===0)continue;let o=e.getConnectedEdges()[0],r=e.getOutgoingEdges().length>0,i=o.getOther(e);al(r?i.getIncomingEdges():i.getOutgoingEdges(),o),i.getConnectedEdges().length===1&&t.push(i),this._subtreeNodesStack.push(new Gt(e,o)),al(this.graph.nodes,e)}}_reattachSubtrees(){for(;this._subtreeNodesStack.length>0;){let t=this._subtreeNodesStack.pop(),e=t.getFirst(),o=t.getSecond(),r=o.getOther(e);o.target===e?(r.getOutgoingEdges().push(o),e.layer=r.layer+o.delta):(r.getIncomingEdges().push(o),e.layer=r.layer-o.delta),this.graph.nodes.push(e)}}_feasibleTree(){if(this._layeringTopologicalNumbering(this._sources),this._edges.length>0){for(this._edgeVisited.fill(!1);this._tightTreeDFS(this.graph.nodes[0])<this.graph.nodes.length;){let t=this._minimalSlack(),e=t.getTarget().layer-t.getSource().layer-t.delta;t.getTarget().treeNode&&(e=-e);for(let o of this.graph.nodes)o.treeNode&&(o.layer+=e);this._edgeVisited.fill(!1)}this._edgeVisited.fill(!1),this._postorderTraversal(this.graph.nodes[0]),this._cutvalues()}}_layeringTopologicalNumbering(t){let e=new Array(this.graph.nodes.length).fill(0);for(let r of this.graph.nodes)e[r.internalId]+=r.getIncomingEdges().length;let o=[...t];for(;o.length>0;){let r=o.shift();for(let i of r.getOutgoingEdges()){let s=i.getTarget();s.layer=Math.max(s.layer,r.layer+i.delta),e[s.internalId]--,e[s.internalId]===0&&o.push(s)}}}_minimalSpan(t){let e=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER;for(let r of t.getConnectedEdges()){let i=r.getTarget().layer-r.getSource().layer;r.getTarget()===t&&i<o?o=i:i<e&&(e=i)}return o===Number.MAX_SAFE_INTEGER&&(o=-1),e===Number.MAX_SAFE_INTEGER&&(e=-1),new Gt(o,e)}_tightTreeDFS(t){let e=1;t.treeNode=!0;for(let o of t.getConnectedEdges())if(!this._edgeVisited[o.internalId]){this._edgeVisited[o.internalId]=!0;let r=o.getOther(t);o.treeEdge?e+=this._tightTreeDFS(r):!r.treeNode&&o.delta===o.getTarget().layer-o.getSource().layer&&(o.treeEdge=!0,this._treeEdges.add(o),e+=this._tightTreeDFS(r))}return e}_minimalSlack(){let t=Number.MAX_SAFE_INTEGER,e=null;for(let o of this._edges)if(o.getSource().treeNode!==o.getTarget().treeNode){let r=o.getTarget().layer-o.getSource().layer-o.delta;r<t&&(t=r,e=o)}return e}_postorderTraversal(t){let e=Number.MAX_SAFE_INTEGER;for(let o of t.getConnectedEdges())o.treeEdge&&!this._edgeVisited[o.internalId]&&(this._edgeVisited[o.internalId]=!0,e=Math.min(e,this._postorderTraversal(o.getOther(t))));return this._poID[t.internalId]=this._postOrder,this._lowestPoID[t.internalId]=Math.min(e,this._postOrder++),this._lowestPoID[t.internalId]}_isInHead(t,e){let o=e.getSource(),r=e.getTarget();return this._lowestPoID[o.internalId]<=this._poID[t.internalId]&&this._poID[t.internalId]<=this._poID[o.internalId]&&this._lowestPoID[r.internalId]<=this._poID[t.internalId]&&this._poID[t.internalId]<=this._poID[r.internalId]?!(this._poID[o.internalId]<this._poID[r.internalId]):this._poID[o.internalId]<this._poID[r.internalId]}_cutvalues(){let t=[];for(let e of this.graph.nodes){let o=0;e.unknownCutvalues.length=0;for(let r of e.getConnectedEdges())r.treeEdge&&(e.unknownCutvalues.push(r),o++);o===1&&t.push(e)}for(let e of t)for(;e.unknownCutvalues.length===1;){let o=e.unknownCutvalues[0];this._cutvalue[o.internalId]=o.weight;let r=o.getSource(),i=o.getTarget();for(let s of e.getConnectedEdges())s!==o&&(s.treeEdge?r===s.getSource()||i===s.getTarget()?this._cutvalue[o.internalId]-=this._cutvalue[s.internalId]-s.weight:this._cutvalue[o.internalId]+=this._cutvalue[s.internalId]-s.weight:e===r?s.getSource()===e?this._cutvalue[o.internalId]+=s.weight:this._cutvalue[o.internalId]-=s.weight:s.getSource()===e?this._cutvalue[o.internalId]-=s.weight:this._cutvalue[o.internalId]+=s.weight);al(r.unknownCutvalues,o),al(i.unknownCutvalues,o),r===e?e=o.getTarget():e=o.getSource()}}_leaveEdge(){for(let t of this._treeEdges)if(t.treeEdge&&this._cutvalue[t.internalId]<cI)return t;return null}_enterEdge(t){if(!t.treeEdge)throw new Error("The input edge is not a tree edge.");let e=null,o=Number.MAX_SAFE_INTEGER;for(let r of this._edges){let i=r.getSource(),s=r.getTarget();if(this._isInHead(i,t)&&!this._isInHead(s,t)){let a=s.layer-i.layer-r.delta;a<o&&(o=a,e=r)}}return e}_exchange(t,e){if(!t.treeEdge)throw new Error("Given leave edge is no tree edge.");if(e.treeEdge)throw new Error("Given enter edge is a tree edge already.");t.treeEdge=!1,this._treeEdges.delete(t),e.treeEdge=!0,this._treeEdges.add(e);let o=e.getTarget().layer-e.getSource().layer-e.delta;this._isInHead(e.getTarget(),t)||(o=-o);for(let r of this.graph.nodes)this._isInHead(r,t)||(r.layer+=o);this._postOrder=1,this._edgeVisited.fill(!1),this._postorderTraversal(this.graph.nodes[0]),this._cutvalues()}_normalize(){let t=Number.MIN_SAFE_INTEGER,e=Number.MAX_SAFE_INTEGER;for(let i of this.graph.nodes)e=Math.min(e,i.layer),t=Math.max(t,i.layer);let o=new Array(t-e+1).fill(0);for(let i of this.graph.nodes)i.layer-=e,o[i.layer]++;let r=0;if(this._previousLayeringNodeCounts!=null){for(let i of this._previousLayeringNodeCounts)if(o[r++]+=i,o.length===r)break}return o}_balanceLayering(t){for(let e of this.graph.nodes)if(e.getIncomingEdges().length===e.getOutgoingEdges().length){let o=e.layer,r=this._minimalSpan(e);for(let i=e.layer-r.getFirst()+1;i<e.layer+r.getSecond();i++)t[i]<t[o]&&(o=i);t[o]<t[e.layer]&&(t[e.layer]--,t[o]++,e.layer=o)}}};function al(n,t){let e=n.indexOf(t);return e>=0?(n.splice(e,1),!0):!1}var b_=1,G_=100,cd=class{constructor(){this.compactor=null,this.networkSimplexGraph=null,this.nNodes=null,this.index=0}compact(t){this.compactor=t,this.networkSimplexGraph=new Wi,this.nNodes=new Array(this.compactor.cGraph.cGroups.length).fill(null),this.index=0;for(let e of this.compactor.cGraph.cGroups){e.id=this.index;let o=He.of().id(this.index).origin(e).create(this.networkSimplexGraph);this.nNodes[this.index]=o,this.index++}this._addSeparationConstraints(),this._addEdgeConstraints(),this._addArtificialSourceNode(),li.forGraph(this.networkSimplexGraph).execute(new Ie);for(let e of this.compactor.cGraph.cNodes)e.hitbox.x=this.nNodes[e.cGroup.id].layer+e.cGroupOffset.x}_addSeparationConstraints(){for(let t of this.compactor.cGraph.cNodes)for(let e of t.constraints){if(t.cGroup===e.cGroup)continue;let o;this.compactor.direction.isHorizontal()?o=this.compactor.spacingsHandler.getHorizontalSpacing(t,e):o=this.compactor.spacingsHandler.getVerticalSpacing(t,e);let r=t.cGroupOffset.x+t.hitbox.width+o-e.cGroupOffset.x;if(r=Math.ceil(r),r=Math.max(0,r),ke.isVerticalSegmentsOfSameEdge(t,e)){let i=He.of().create(this.networkSimplexGraph),s=Math.ceil(e.cGroupOffset.x-t.cGroupOffset.x),a=s-(e.cGroupOffset.x-t.cGroupOffset.x),l=ke.getVerticalSegmentOrNull(t).aPort,c=t;l==null&&(l=ke.getVerticalSegmentOrNull(e).aPort,a=-a,c=e),l!=null&&(c.cGroupOffset.x-=a,l.getPosition().x-=a),te.of().delta(Math.max(0,s)).weight(b_).source(i).target(this.nNodes[t.cGroup.id]).create(),te.of().delta(Math.max(0,-s)).weight(b_).source(i).target(this.nNodes[e.cGroup.id]).create()}else{let i=b_;(t.origin instanceof we&&e.origin instanceof ft||e.origin instanceof we&&t.origin instanceof ft)&&(i=2),te.of().delta(r).weight(i).source(this.nNodes[t.cGroup.id]).target(this.nNodes[e.cGroup.id]).create()}}}_addEdgeConstraints(){let t=new Map,e=new Map;for(let o of this.compactor.cGraph.cNodes){let r=ke.getLNodeOrNull(o);if(r!=null)t.set(r,o);else{let i=ke.getVerticalSegmentOrNull(o);if(i!=null)for(let s of i.representedLEdges){let a=e.get(s);a==null&&(a=new Set,e.set(s,a)),a.add(o)}}}for(let o of this.compactor.cGraph.cNodes){let r=ke.getLNodeOrNull(o);if(r!=null)for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;let s=i.getSource(),a=i.getTarget();if(u.SIDES_NORTH_SOUTH.has(s.getSide())&&u.SIDES_NORTH_SOUTH.has(a.getSide()))continue;let l=t.get(a.getNode());if(l!=null){if(te.of().delta(0).weight(G_).source(this.nNodes[o.cGroup.id]).target(this.nNodes[l.cGroup.id]).create(),s.getSide()===u.WEST&&rt.OUTPUT_PREDICATE(s)){let c=e.get(i);if(c!=null){for(let g of c)if(g.hitbox.x<o.hitbox.x){let h=this.nNodes[g.cGroup.id],d=this.nNodes[o.cGroup.id];if(h===d)continue;te.of().delta(1).weight(G_).source(h).target(d).create()}}}if(a.getSide()===u.EAST&&rt.INPUT_PREDICATE(a)){let c=e.get(i);if(c!=null){for(let g of c)if(g.hitbox.x>o.hitbox.x){let h=this.nNodes[o.cGroup.id],d=this.nNodes[g.cGroup.id];if(h===d)continue;te.of().delta(1).weight(G_).source(h).target(d).create()}}}}}}}_addArtificialSourceNode(){let t=[];for(let e of this.networkSimplexGraph.nodes)e.getIncomingEdges().length===0&&t.push(e);if(t.length>1){let e=He.of().id(this.index++).create(this.networkSimplexGraph);for(let o of t)te.of().delta(1).weight(0).source(e).target(o).create()}}};var ke=class n{constructor(){this._lGraph=null}process(t,e){let o=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY);if(o==null||o===re.NONE)return;e.begin("Horizontal Compaction",1),this._lGraph=t;let r=new ad,i=new Br(r.transform(t));switch(i.setSpacingsHandler(this._createSpacingsHandler()),t.getProperty(_.COMPACTION_POST_COMPACTION_CONSTRAINTS)===Ur.SCANLINE?i.setConstraintAlgorithm(new nd(this._lGraph)):i.setConstraintAlgorithm(Br.QUADRATIC_CONSTRAINTS),o){case re.LEFT:i.compact();break;case re.RIGHT:i.changeDirection(R.RIGHT).compact();break;case re.LEFT_RIGHT_CONSTRAINT_LOCKING:i.compact().changeDirection(R.RIGHT).setLockFunction((a,l)=>a.cGroup.outDegreeReal===0).compact();break;case re.LEFT_RIGHT_CONNECTION_LOCKING:i.compact().changeDirection(R.RIGHT).setLockFunction((a,l)=>r.getLockMap().get(a).getDirection(l)).compact();break;case re.EDGE_LENGTH:i.setCompactionAlgorithm(n.NETWORK_SIMPLEX_COMPACTION).compact();break;default:break}i.finish(),r.applyLayout(),e.done()}static isVerticalSegmentsOfSameEdge(t,e){let o=n.getVerticalSegmentOrNull(t),r=n.getVerticalSegmentOrNull(e);if(o==null||r==null)return!1;for(let i of o.representedLEdges)if(r.representedLEdges.includes(i))return!0;return!1}static getLNodeOrNull(t){return t.origin instanceof ft?t.origin:null}static getVerticalSegmentOrNull(t){return t.origin instanceof we?t.origin:null}_createSpacingsHandler(){let t=this;return{getHorizontalSpacing(e,o){if(n.isVerticalSegmentsOfSameEdge(e,o))return 0;let r=n.getLNodeOrNull(e),i=n.getLNodeOrNull(o);return r!=null&&r.getType()===y.EXTERNAL_PORT||i!=null&&i.getType()===y.EXTERNAL_PORT?0:t._lGraph.getProperty(p.SPACINGS).getHorizontalSpacing(r!=null?r.getType():y.LONG_EDGE,i!=null?i.getType():y.LONG_EDGE)},getVerticalSpacing(e,o){if(n.isVerticalSegmentsOfSameEdge(e,o))return 1;let r=n.getLNodeOrNull(e),i=n.getLNodeOrNull(o);return t._lGraph.getProperty(p.SPACINGS).getVerticalSpacing(r!=null?r.getType():y.LONG_EDGE,i!=null?i.getType():y.LONG_EDGE)}}}};ke.NETWORK_SIMPLEX_COMPACTION=new cd;var Ds=class{constructor(t){this._maxNum=t,this._binarySums=new Int32Array(t+1),this._numsPerIndex=new Int32Array(t),this._size=0}add(t){this._size++,this._numsPerIndex[t]++;let e=t+1;for(;e<this._binarySums.length;)this._binarySums[e]++,e+=e&-e}rank(t){let e=t,o=0;for(;e>0;)o+=this._binarySums[e],e-=e&-e;return o}size(){return this._size}removeAll(t){let e=this._numsPerIndex[t];if(e===0)return;this._numsPerIndex[t]=0,this._size-=e;let o=t+1;for(;o<this._binarySums.length;)this._binarySums[o]-=e,o+=o&-o}clear(){this._binarySums=new Int32Array(this._maxNum+1),this._numsPerIndex=new Int32Array(this._maxNum),this._size=0}isEmpty(){return this._size===0}};function zi(n,t){switch(t){case u.EAST:case u.NORTH:return n.getPortSideView(t);case u.SOUTH:case u.WEST:return[...n.getPortSideView(t)].reverse();default:return[]}}var gd={inNorthSouthEastWestOrder:zi};var Fr=class{constructor(t){this._portPositions=t,this._indexTree=null,this._ends=[],this._nodeCardinalities=null}countCrossingsBetweenLayers(t,e){let o=this._initPortPositionsCounterClockwise(t,e);return this._indexTree=new Ds(o.length),this._countCrossingsOnPorts(o)}countInLayerCrossingsOnSide(t,e){let o=this.initPortPositionsForInLayerCrossings(t,e);return this._countInLayerCrossingsOnPorts(o)}countNorthSouthPortCrossingsInLayer(t){let e=this._initPositionsForNorthSouthCounting(t);return this._indexTree=new Ds(e.length),this._countNorthSouthCrossingsOnPorts(e)}countCrossingsBetweenPortsInBothOrders(t,e){let o=this._connectedPortsSortedByPosition(t,e),r=this._countCrossingsOnPorts(o);this._indexTree.clear(),this.switchPorts(t,e),o.sort((s,a)=>this._positionOf(s)-this._positionOf(a));let i=this._countCrossingsOnPorts(o);return this._indexTree.clear(),this.switchPorts(e,t),Gt.of(r,i)}countInLayerCrossingsBetweenNodesInBothOrders(t,e,o){let r=this._connectedInLayerPortsSortedByPosition(t,e,o),i=this._countInLayerCrossingsOnPorts(r);this.switchNodes(t,e,o),this._indexTree.clear(),r.sort((a,l)=>this._positionOf(a)-this._positionOf(l));let s=this._countInLayerCrossingsOnPorts(r);return this.switchNodes(e,t,o),this._indexTree.clear(),Gt.of(i,s)}initForCountingBetween(t,e){let o=this._initPortPositionsCounterClockwise(t,e);this._indexTree=new Ds(o.length)}initPortPositionsForInLayerCrossings(t,e){let o=[];return this._initPositions(t,o,e,!0,!0),this._indexTree=new Ds(o.length),o}switchPorts(t,e){let o=this._portPositions[t.id];this._portPositions[t.id]=this._portPositions[e.id],this._portPositions[e.id]=o}switchNodes(t,e,o){for(let r of gd.inNorthSouthEastWestOrder(t,o))this._portPositions[r.id]=this._positionOf(r)+this._nodeCardinalities[e.id];for(let r of gd.inNorthSouthEastWestOrder(e,o))this._portPositions[r.id]=this._positionOf(r)-this._nodeCardinalities[t.id]}_connectedInLayerPortsSortedByPosition(t,e,o){let r=new Set,i=s=>r.add(s);for(let s of[t,e])for(let a of gd.inNorthSouthEastWestOrder(s,o))for(let l of a.getConnectedEdges())l.isSelfLoop()||(i(a),this._isInLayer(l)&&i(this._otherEndOf(l,a)));return[...r].sort((s,a)=>this._positionOf(s)-this._positionOf(a))}_connectedPortsSortedByPosition(t,e){let o=new Set;for(let r of[t,e]){o.add(r);for(let i of r.getConnectedEdges())this._isPortSelfLoop(i)||o.add(this._otherEndOf(i,r))}return[...o].sort((r,i)=>this._positionOf(r)-this._positionOf(i))}_countCrossingsOnPorts(t){let e=0;for(let o of t){this._indexTree.removeAll(this._positionOf(o));for(let r of o.getConnectedEdges()){let i=this._positionOf(this._otherEndOf(r,o));i>this._positionOf(o)&&(e+=this._indexTree.rank(i),this._ends.push(i))}for(;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_countInLayerCrossingsOnPorts(t){let e=0;for(let o of t){this._indexTree.removeAll(this._positionOf(o));let r=0;for(let i of o.getConnectedEdges())if(this._isInLayer(i)){let s=this._positionOf(this._otherEndOf(i,o));s>this._positionOf(o)&&(e+=this._indexTree.rank(s),this._ends.push(s))}else r++;for(e+=this._indexTree.size()*r;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_countNorthSouthCrossingsOnPorts(t){let e=0,o=[];for(let r of t){switch(this._indexTree.removeAll(this._positionOf(r)),o.length=0,r.getNode().getType()){case y.NORMAL:{let i=r.getProperty(p.PORT_DUMMY);if(i!=null)for(let s of i.getPorts())o.push([s,s.getDegree()]);break}case y.LONG_EDGE:{for(let i of r.getNode().getPorts())if(i!==r){o.push([i,i.getDegree()]);break}break}case y.NORTH_SOUTH_PORT:{let i=r.getProperty(p.ORIGIN);i!=null&&o.push([i,r.getDegree()]);break}default:break}for(let[i,s]of o){let a=this._positionOf(i);a>this._positionOf(r)&&(e+=this._indexTree.rank(a)*s,this._ends.push(a))}for(;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_initPositions(t,e,o,r,i){let s=e.length;i&&(this._nodeCardinalities=new Int32Array(t.length));let a=r?0:t.length-1,l=r?1:-1,c=g=>r?g<t.length:g>=0;for(let g=a;c(g);g+=l){let h=t[g],d=this._getPorts(h,o,r);i&&(this._nodeCardinalities[h.id]=d.length);for(let f of d)this._portPositions[f.id]=s++;for(let f of d)e.push(f)}}_initPortPositionsCounterClockwise(t,e){let o=[];return this._initPositions(t,o,u.EAST,!0,!1),this._initPositions(e,o,u.WEST,!1,!1),o}_initPositionsForNorthSouthCounting(t){let e=[],o=[],r=null,i=0;for(let s=0;s<t.length;s++){let a=t[s];switch(this._isLayoutUnitChanged(r,a)&&(i=this._emptyStack(o,e,hd,i)),a.hasProperty(p.IN_LAYER_LAYOUT_UNIT)&&(r=a.getProperty(p.IN_LAYER_LAYOUT_UNIT)),a.getType()){case y.NORMAL:for(let l of this._getNorthSouthPortsWithIncidentEdges(a,u.NORTH))this._portPositions[l.id]=i++,e.push(l);i=this._emptyStack(o,e,hd,i);for(let l of this._getNorthSouthPortsWithIncidentEdges(a,u.SOUTH))this._portPositions[l.id]=i++,e.push(l);break;case y.NORTH_SOUTH_PORT:{let l=a.getPortSideView(gI);if(l.length>0){let c=l[0];this._portPositions[c.id]=i++,e.push(c)}a.getPortSideView(hd).length>0&&o.push(a);break}case y.LONG_EDGE:{for(let l of a.getPortSideView(u.WEST))this._portPositions[l.id]=i++,e.push(l);for(let l of a.getPortSideView(u.EAST))o.push(a);break}default:break}}return this._emptyStack(o,e,hd,i),e}_emptyStack(t,e,o,r){let i=r;for(;t.length>0;){let a=t.pop().getPortSideView(o);if(a.length>0){let l=a[0];this._portPositions[l.id]=i++,e.push(l)}}return i}_getPorts(t,e,o){return e===u.EAST?o?t.getPortSideView(e):[...t.getPortSideView(e)].reverse():o?[...t.getPortSideView(e)].reverse():t.getPortSideView(e)}*_getNorthSouthPortsWithIncidentEdges(t,e){for(let o of t.getPortSideView(e))o.hasProperty(p.PORT_DUMMY)&&(yield o)}_isInLayer(t){return t.getSource().getNode().getLayer()===t.getTarget().getNode().getLayer()}_positionOf(t){return this._portPositions[t.id]}_otherEndOf(t,e){return e===t.getSource()?t.getTarget():t.getSource()}_isPortSelfLoop(t){return t.getSource()===t.getTarget()}_isLayoutUnitChanged(t,e){return t==null||t===e||!e.hasProperty(p.IN_LAYER_LAYOUT_UNIT)?!1:e.getProperty(p.IN_LAYER_LAYOUT_UNIT)!==t}},gI=u.WEST,hd=u.EAST;var dd=class{constructor(t,e,o){this._portPos=o}countCrossings(t,e){let o=this._portPos,r=0;for(let A of t)for(let B of A.getPorts()){let Y=0;for(let j of B.getOutgoingEdges())A.getLayer()!==j.getTarget().getNode().getLayer()&&Y++;Y>0&&(o[B.id]=r++)}let i=0;for(let A of e){let B=0;for(let X of A.getPorts())if(X.getSide()===u.NORTH){for(let tt of X.getIncomingEdges())if(A.getLayer()!==tt.getSource().getNode().getLayer()){B++;break}}else break;let Y=0,j=A.getPorts();for(let X=j.length-1;X>=0;X--){let tt=j[X],ot=0;for(let Lt of tt.getIncomingEdges())A.getLayer()!==Lt.getSource().getNode().getLayer()&&ot++;ot>0&&(tt.getSide()===u.NORTH?(o[tt.id]=i,i++):(o[tt.id]=i+B+Y,Y++))}i+=Y}let s=new Map,a=new Set,l=0;for(let A of t)for(let B of A.getPorts())for(let Y of B.getOutgoingEdges()){let j=Y.getTarget();if(A.getLayer()!==j.getNode().getLayer()){let X=s.get(B),tt=s.get(j);if(X==null&&tt==null){let ot=new H_(l++);a.add(ot),ot.edges.push(Y),ot.ports.push(B),s.set(B,ot),ot.ports.push(j),s.set(j,ot)}else if(X==null)tt.edges.push(Y),tt.ports.push(B),s.set(B,tt);else if(tt==null)X.edges.push(Y),X.ports.push(j),s.set(j,X);else if(X===tt)X.edges.push(Y);else{X.edges.push(Y);for(let ot of tt.ports)s.set(ot,X);for(let ot of tt.edges)X.edges.push(ot);for(let ot of tt.ports)X.ports.push(ot);a.delete(tt)}}}let c=[...a],g=t[0].getLayer(),h=e[0].getLayer();for(let A of c){A.upperLeft=r,A.upperRight=i,A.lowerLeft=0,A.lowerRight=0;for(let B of A.ports){let Y=o[B.id];B.getNode().getLayer()===g?(Y<A.upperLeft&&(A.upperLeft=Y),Y>A.lowerLeft&&(A.lowerLeft=Y)):B.getNode().getLayer()===h&&(Y<A.upperRight&&(A.upperRight=Y),Y>A.lowerRight&&(A.lowerRight=Y))}}c.sort((A,B)=>A.upperLeft!==B.upperLeft?A.upperLeft-B.upperLeft:A.upperRight!==B.upperRight?A.upperRight-B.upperRight:A.id-B.id);let d=new Int32Array(c.length),f=new Int32Array(i+1);for(let A=0;A<c.length;A++)d[A]=c[A].upperRight,f[d[A]]=1;let E=0;for(let A=0;A<f.length;A++)f[A]===1?f[A]=E:E--;let P=0;for(let A=0;A<d.length;A++)d[A]+=f[d[A]],d[A]+1>P&&(P=d[A]+1);let S=1;for(;S<P;)S*=2;let T=2*S-1;S-=1;let N=new Int32Array(T),I=0;for(let A=0;A<d.length;A++){let B=d[A]+S;for(N[B]++;B>0;)B%2>0&&(I+=N[B+1]),B=B-1>>1,N[B]++}let C=new Array(c.length*2);for(let A=0;A<c.length;A++)C[2*A]=new jn(c[A],c[A].upperLeft,c[A].lowerLeft,kr.UPPER),C[2*A+1]=new jn(c[A],c[A].lowerLeft,c[A].upperLeft,kr.LOWER);C.sort(IP);let x=0;for(let A of C)A.type===kr.UPPER?x++:(x--,I+=x);let M=new Array(c.length*2);for(let A=0;A<c.length;A++)M[2*A]=new jn(c[A],c[A].upperRight,c[A].lowerRight,kr.UPPER),M[2*A+1]=new jn(c[A],c[A].lowerRight,c[A].upperRight,kr.LOWER);M.sort(IP),x=0;for(let A of M)A.type===kr.UPPER?x++:(x--,I+=x);return I}},H_=class{constructor(t){this.id=t,this.edges=[],this.ports=[],this.upperLeft=0,this.lowerLeft=0,this.upperRight=0,this.lowerRight=0}},kr=Object.freeze({UPPER:"UPPER",LOWER:"LOWER"}),jn=class{constructor(t,e,o,r){this.hyperedge=t,this.position=e,this.oppositePosition=o,this.type=r}};function IP(n,t){return n.position!==t.position?n.position-t.position:n.oppositePosition!==t.oppositePosition?n.oppositePosition-t.oppositePosition:n.hyperedge!==t.hyperedge?n.hyperedge.id-t.hyperedge.id:n.type===kr.UPPER&&t.type===kr.LOWER?-1:n.type===kr.LOWER&&t.type===kr.UPPER?1:0}var fd=class{constructor(t){this._inLayerEdgeCounts=new Int32Array(t.length),this._hasNorthSouthPorts=new Array(t.length).fill(!1),this._hasHyperEdgesEastOfIndex=new Array(t.length).fill(!1),this._nPorts=0,this._crossingCounter=null,this._hyperedgeCrossingsCounter=null}countAllCrossings(t){if(t.length===0)return 0;let e=this._crossingCounter.countInLayerCrossingsOnSide(t[0],u.WEST);e+=this._crossingCounter.countInLayerCrossingsOnSide(t[t.length-1],u.EAST);for(let o=0;o<t.length;o++)e+=this._countCrossingsAt(o,t);return e}_countCrossingsAt(t,e){let o=0,r=e[t];if(t<e.length-1){let i=e[t+1];this._hasHyperEdgesEastOfIndex[t]?(o=this._hyperedgeCrossingsCounter.countCrossings(r,i),o+=this._crossingCounter.countInLayerCrossingsOnSide(r,u.EAST),o+=this._crossingCounter.countInLayerCrossingsOnSide(i,u.WEST)):o=this._crossingCounter.countCrossingsBetweenLayers(r,i)}return this._hasNorthSouthPorts[t]&&(o+=this._crossingCounter.countNorthSouthPortCrossingsInLayer(r)),o}initAtNodeLevel(t,e,o){o[t][e].getType()===y.NORTH_SOUTH_PORT&&(this._hasNorthSouthPorts[t]=!0)}initAtPortLevel(t,e,o,r){let i=r[t][e].getPorts()[o];i.id=this._nPorts++,i.getOutgoingEdges().length+i.getIncomingEdges().length>1&&(i.getSide()===u.EAST?this._hasHyperEdgesEastOfIndex[t]=!0:i.getSide()===u.WEST&&t>0&&(this._hasHyperEdgesEastOfIndex[t-1]=!0))}initAtEdgeLevel(t,e,o,r,i,s){let a=s[t][e].getPorts()[o];i.getSource()===a&&i.getSource().getNode().getLayer()===i.getTarget().getNode().getLayer()&&this._inLayerEdgeCounts[t]++}initAfterTraversal(){let t=new Int32Array(this._nPorts);this._hyperedgeCrossingsCounter=new dd(this._inLayerEdgeCounts,this._hasNorthSouthPorts,t),this._crossingCounter=new Fr(t)}};function hI(n,t){for(let e=0;e<t.length;e++){for(let o of n)typeof o.initAtLayerLevel=="function"&&o.initAtLayerLevel(e,t);for(let o=0;o<t[e].length;o++){for(let i of n)typeof i.initAtNodeLevel=="function"&&i.initAtNodeLevel(e,o,t);let r=t[e][o].getPorts();for(let i=0;i<r.length;i++){for(let l of n)typeof l.initAtPortLevel=="function"&&l.initAtPortLevel(e,o,i,t);let s=r[i],a=0;for(let l of s.getConnectedEdges()){for(let c of n)typeof c.initAtEdgeLevel=="function"&&c.initAtEdgeLevel(e,o,i,a,l,t);a++}}}}for(let e of n)typeof e.initAfterTraversal=="function"&&e.initAfterTraversal()}var ud={init:hI};var _d=class{constructor(t){this.node=t,this.summedWeight=0,this.degree=0,this.barycenter=null,this.visited=!1}toString(){return`BarycenterState [node=${this.node}, summedWeight=${this.summedWeight}, degree=${this.degree}, barycenter=${this.barycenter}, visited=${this.visited}]`}},ll=class{constructor(t){this._constraintsBetweenNonDummies=!1,t.length>0&&t[0].length>0&&(this._constraintsBetweenNonDummies=t[0][0].getGraph().getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES)),this.barycenterStates=new Array(t.length),this.constraintGroups=new Array(t.length),this.layoutUnits=new Map}initAtLayerLevel(t,e){this.barycenterStates[t]=new Array(e[t].length),this.constraintGroups[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){this._initAtNode(o[t][e],!0)}_initAtNode(t,e){let o=t.getLayer().id,r=t.id;if(this.constraintGroups[o][r]=new pd(this,t),e){this.barycenterStates[o][r]=new _d(t);let i=t.getProperty(p.IN_LAYER_LAYOUT_UNIT);if(i!=null){let s=this.layoutUnits.get(i);s==null&&(s=[],this.layoutUnits.set(i,s)),s.push(t)}}}getBarycenterStates(){return this.barycenterStates}processConstraints(t){if(this._constraintsBetweenNonDummies){this._processConstraints(t,!0);for(let e of t)this._initAtNode(e,!1)}this._processConstraints(t,!1)}_processConstraints(t,e){let o=new Array(t.length);for(let i=0;i<t.length;i++){let s=t[i];o[i]=this.constraintGroups[s.getLayer().id][s.id]}this._buildConstraintsGraph(o,e);let r;for(;(r=this._findViolatedConstraint(o))!=null;)this._handleViolatedConstraint(r.first,r.second,o);t.length=0;for(let i of o)for(let s of i.getNodes())t.push(s),this._stateOf(s).barycenter=i.getBarycenter()}_buildConstraintsGraph(t,e){for(let r of t)r.resetOutgoingConstraints(),r.incomingConstraintsCount=0;let o=null;for(let r of t){let i=r.getNode();if(!(e&&i.getType()!==y.NORMAL)){for(let s of i.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS))(!e||s.getType()===y.NORMAL)&&(r.getOutgoingConstraints().push(this._groupOf(s)),this._groupOf(s).incomingConstraintsCount++);if(!e&&i.getType()===y.NORMAL){if(o!=null){let s=this.layoutUnits.get(o)||[],a=this.layoutUnits.get(i)||[];for(let l of s)for(let c of a)this._groupOf(l).getOutgoingConstraints().push(this._groupOf(c)),this._groupOf(c).incomingConstraintsCount++}o=i}}}}_findViolatedConstraint(t){let e=null;for(let o of t)o.resetIncomingConstraints(),o.hasOutgoingConstraints()&&o.incomingConstraintsCount===0&&(e==null&&(e=[]),e.push(o));if(e!=null)for(;e.length>0;){let o=e.shift();if(o.hasIncomingConstraints()){for(let r of o.getIncomingConstraints())if(r.getBarycenter()===o.getBarycenter()){if(t.indexOf(r)>t.indexOf(o))return Gt.of(r,o)}else if(r.getBarycenter()>o.getBarycenter())return Gt.of(r,o)}for(let r of o.getOutgoingConstraints()){let i=r.getIncomingConstraints();i.unshift(o),r.incomingConstraintsCount===i.length&&e.push(r)}}return null}_handleViolatedConstraint(t,e,o){let r=pd.merge(this,t,e),i=!1,s=0;for(;s<o.length;){let a=o[s];if(a===t||a===e){o.splice(s,1);continue}if(!i&&a.getBarycenter()>r.getBarycenter()){o.splice(s,0,r),i=!0,s++;continue}if(a.hasOutgoingConstraints()){let l=a.getOutgoingConstraints(),c=Ed(l,t),g=Ed(l,e);(c||g)&&(l.push(r),r.incomingConstraintsCount++)}s++}i||o.push(r)}_groupOf(t){return this.constraintGroups[t.getLayer().id][t.id]}_stateOf(t){return this.barycenterStates[t.getLayer().id][t.id]}},RP=1e-4,pd=class n{constructor(t,e){this._resolver=t,this.nodes=[e],this.summedWeight=0,this.degree=0,this.outgoingConstraints=null,this.incomingConstraints=null,this.incomingConstraintsCount=0}static merge(t,e,o){let r=Object.create(n.prototype);if(r._resolver=t,r.nodes=e.nodes.concat(o.nodes),r.summedWeight=e.summedWeight+o.summedWeight,r.degree=e.degree+o.degree,r.outgoingConstraints=null,r.incomingConstraints=null,r.incomingConstraintsCount=0,e.outgoingConstraints!=null){if(r.outgoingConstraints=e.outgoingConstraints.slice(),Ed(r.outgoingConstraints,o),o.outgoingConstraints!=null)for(let s of o.outgoingConstraints)s!==e&&(r.outgoingConstraints.indexOf(s)>=0?s.incomingConstraintsCount--:r.outgoingConstraints.push(s))}else o.outgoingConstraints!=null&&(r.outgoingConstraints=o.outgoingConstraints.slice(),Ed(r.outgoingConstraints,e));r.degree>0?r.setBarycenter(r.summedWeight/r.degree):e.getBarycenter()!=null&&o.getBarycenter()!=null?r.setBarycenter((e.getBarycenter()+o.getBarycenter())/2):e.getBarycenter()!=null?r.setBarycenter(e.getBarycenter()):o.getBarycenter()!=null&&r.setBarycenter(o.getBarycenter());let i=r.getBarycenter();if(i!=null){let s=o.getBarycenter(),a=e.getBarycenter();if(s!=null&&i+RP<s)throw new Error("merged barycenter fell below second group barycenter");if(a!=null&&i-RP>a)throw new Error("merged barycenter rose above first group barycenter")}return r}setBarycenter(t){for(let e of this.nodes)this._resolver._stateOf(e).barycenter=t}getBarycenter(){return this._resolver._stateOf(this.nodes[0]).barycenter}getOutgoingConstraints(){return this.outgoingConstraints==null&&(this.outgoingConstraints=[]),this.outgoingConstraints}resetOutgoingConstraints(){this.outgoingConstraints=null}hasOutgoingConstraints(){return this.outgoingConstraints!=null&&this.outgoingConstraints.length>0}getIncomingConstraints(){return this.incomingConstraints==null&&(this.incomingConstraints=[]),this.incomingConstraints}resetIncomingConstraints(){this.incomingConstraints=null}hasIncomingConstraints(){return this.incomingConstraints!=null&&this.incomingConstraints.length>0}getNodes(){return this.nodes}getNode(){if(this.nodes.length!==1)throw new Error("ConstraintGroup.getNode called on a multi-node group");return this.nodes[0]}toString(){let t="[";for(let e=0;e<this.nodes.length;e++){t+=this.nodes[e].toString();let o=this.getBarycenter();o!=null&&(t+=`<${o}>`),e<this.nodes.length-1&&(t+=", ")}return t+"]"}};function Ed(n,t){let e=n.indexOf(t);return e<0?!1:(n.splice(e,1),!0)}var LP=.07,$n=class{constructor(t,e,o,r){this.constraintResolver=t,this.random=e,this.portDistributor=o,this.portRanks=null,this.barycenterState=null,this.barycenterStateComparator=(i,s)=>{let a=this.stateOf(i),l=this.stateOf(s);return a.barycenter!=null&&l.barycenter!=null?a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:0:a.barycenter!=null?-1:l.barycenter!=null?1:0}}minimizeCrossingsList(t,e,o,r){if(o?this.randomizeBarycenters(t):(this.calculateBarycenters(t,r),this.fillInUnknownBarycenters(t,e)),t.length>1){if(t[0].getGraph().getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER))throw new Error("CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER requires ModelOrderBarycenterHeuristic");t.sort(this.barycenterStateComparator),this.constraintResolver.processConstraints(t)}}randomizeBarycenters(t){for(let e of t){let o=this.stateOf(e);o.barycenter=this.random.nextDouble(),o.summedWeight=o.barycenter,o.degree=1}}fillInUnknownBarycenters(t,e){if(e){let o=-1;for(let r=0;r<t.length;r++){let i=t[r],s=this.stateOf(i),a=s.barycenter;if(a==null){let l=o+1;for(let c=r+1;c<t.length;c++){let g=this.stateOf(t[c]).barycenter;if(g!=null){l=g;break}}a=(o+l)/2,s.barycenter=a,s.summedWeight=a,s.degree=1}o=a}}else{let o=0;for(let r of t){let i=this.stateOf(r).barycenter;i!=null&&(o=Math.max(o,i))}o+=2;for(let r of t){let i=this.stateOf(r);if(i.barycenter==null){let s=this.random.nextFloat()*o-1;i.barycenter=s,i.summedWeight=s,i.degree=1}}}}calculateBarycenters(t,e){for(let o of t)this.stateOf(o).visited=!1;for(let o of t)this._calculateBarycenter(o,e)}_calculateBarycenter(t,e){let o=this.stateOf(t);if(o.visited)return;o.visited=!0,o.degree=0,o.summedWeight=0,o.barycenter=null;for(let i of t.getPorts()){let s=e?i.getPredecessorPorts():i.getSuccessorPorts();for(let a of s){let l=a.getNode();if(l.getLayer()===t.getLayer()){if(l!==t){this._calculateBarycenter(l,e);let c=this.stateOf(l);o.degree+=c.degree,o.summedWeight+=c.summedWeight}}else o.summedWeight+=this.portRanks[a.id],o.degree++}}let r=t.getProperty(p.BARYCENTER_ASSOCIATES);if(r!=null){for(let i of r)if(t.getLayer()===i.getLayer()){this._calculateBarycenter(i,e);let s=this.stateOf(i);o.degree+=s.degree,o.summedWeight+=s.summedWeight}}o.degree>0&&(o.summedWeight+=this.random.nextFloat()*LP-LP/2,o.barycenter=o.summedWeight/o.degree)}stateOf(t){return this.barycenterState[t.getLayer().id][t.id]}minimizeCrossings(t,e,o,r){if(!this._isFirstLayer(t,e,o)){let l=t[e-fI(o)];this.portDistributor.calculatePortRanksLayer(l,uI(o))}let i=t[e][0],s=!r||dI(i),a=Array.from(t[e]);this.minimizeCrossingsList(a,s,!1,o);for(let l=0;l<a.length;l++)t[e][l]=a[l];return!1}setFirstLayerOrder(t,e){let o=AP(e,t.length),r=Array.from(t[o]);this.minimizeCrossingsList(r,!1,!0,e);for(let i=0;i<r.length;i++)t[o][i]=r[i];return!1}alwaysImproves(){return!1}isDeterministic(){return!1}_isFirstLayer(t,e,o){return e===AP(o,t.length)}initAfterTraversal(){this.barycenterState=this.constraintResolver.getBarycenterStates(),this.portRanks=this.portDistributor.getPortRanks()}initAtLayerLevel(t,e){e[t][0].getLayer().id=t}};function dI(n){return n.getType()===y.EXTERNAL_PORT}function fI(n){return n?1:-1}function uI(n){return n?W.OUTPUT:W.INPUT}function AP(n,t){return n?0:Math.max(0,t-1)}var qn=class{constructor(t,e){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._portPositions=new Map,this._easternAdjacencies=new Map,this._westernAdjacencies=new Map,this._currentNodeOrder=t,this._freeLayerIndex=e,this._upperAdjacencies=null,this._lowerAdjacencies=null,this._setPortPositionsForNeighbouringLayers()}_setPortPositionsForNeighbouringLayers(){this._freeLayerIsNotFirstLayer()&&this._setPortPositionsForLayer(this._freeLayerIndex-1,u.EAST),this._freeLayerIsNotLastLayer()&&this._setPortPositionsForLayer(this._freeLayerIndex+1,u.WEST)}_freeLayerIsNotFirstLayer(){return this._freeLayerIndex>0}_freeLayerIsNotLastLayer(){return this._freeLayerIndex<this._currentNodeOrder.length-1}_setPortPositionsForLayer(t,e){let o=0;for(let r of this._currentNodeOrder[t]){let i=zi(r,e);for(let s of i)this._portPositions.set(s,o++)}}countEasternEdgeCrossings(t,e){this._resetCrossingCount(),t!==e&&this._addEasternCrossings(t,e)}countWesternEdgeCrossings(t,e){this._resetCrossingCount(),t!==e&&this._addWesternCrossings(t,e)}countBothSideCrossings(t,e){this._resetCrossingCount(),t!==e&&(this._addWesternCrossings(t,e),this._addEasternCrossings(t,e))}_resetCrossingCount(){this._upperLowerCrossings=0,this._lowerUpperCrossings=0}_addEasternCrossings(t,e){this._upperAdjacencies=this._getAdjacencyFor(t,u.EAST,this._easternAdjacencies),this._lowerAdjacencies=this._getAdjacencyFor(e,u.EAST,this._easternAdjacencies),!(this._upperAdjacencies.size()===0||this._lowerAdjacencies.size()===0)&&this._countCrossingsByMergingAdjacencyLists()}_addWesternCrossings(t,e){this._upperAdjacencies=this._getAdjacencyFor(t,u.WEST,this._westernAdjacencies),this._lowerAdjacencies=this._getAdjacencyFor(e,u.WEST,this._westernAdjacencies),!(this._upperAdjacencies.size()===0||this._lowerAdjacencies.size()===0)&&this._countCrossingsByMergingAdjacencyLists()}_getAdjacencyFor(t,e,o){if(o.size===0)for(let i of this._currentNodeOrder[this._freeLayerIndex])o.set(i,new v_(i,e,this._portPositions));let r=o.get(t);return r.reset(),r}_countCrossingsByMergingAdjacencyLists(){for(;!this._upperAdjacencies.isEmpty()&&!this._lowerAdjacencies.isEmpty();)CP(this._upperAdjacencies.first(),this._lowerAdjacencies.first())?(this._upperLowerCrossings+=this._upperAdjacencies.size(),this._lowerAdjacencies.removeFirst()):CP(this._lowerAdjacencies.first(),this._upperAdjacencies.first())?(this._lowerUpperCrossings+=this._lowerAdjacencies.size(),this._upperAdjacencies.removeFirst()):(this._upperLowerCrossings+=this._upperAdjacencies.countAdjacenciesBelowNodeOfFirstPort(),this._lowerUpperCrossings+=this._lowerAdjacencies.countAdjacenciesBelowNodeOfFirstPort(),this._upperAdjacencies.removeFirst(),this._lowerAdjacencies.removeFirst())}getUpperLowerCrossings(){return this._upperLowerCrossings}getLowerUpperCrossings(){return this._lowerUpperCrossings}};function CP(n,t){return n>t}var v_=class{constructor(t,e,o){this._node=t,this._side=e,this._portPositions=o,this._adjacencies=[],this._size=0,this._currentSize=0,this._currentIndex=0,this._collectSortedAdjacencies()}_collectSortedAdjacencies(){let t=zi(this._node,this._side);for(let e of t){let o=this._side===u.WEST?e.getIncomingEdges():e.getOutgoingEdges();for(let r of o)r.isSelfLoop()||r.getSource().getNode().getLayer()!==r.getTarget().getNode().getLayer()&&(this._addAdjacencyOf(r),this._size++,this._currentSize++)}this._adjacencies.sort((e,o)=>e.position-o.position)}_addAdjacencyOf(t){let e=this._side===u.WEST?t.getSource():t.getTarget(),o=this._portPositions.get(e),r=this._adjacencies.length-1;this._adjacencies.length>0&&this._adjacencies[r].position===o?(this._adjacencies[r].cardinality++,this._adjacencies[r].currentCardinality++):this._adjacencies.push(new B_(o))}reset(){this._currentIndex=0,this._currentSize=this._size,this.isEmpty()||this._currentAdjacency().reset()}countAdjacenciesBelowNodeOfFirstPort(){return this._currentSize-this._currentAdjacency().currentCardinality}removeFirst(){if(this.isEmpty())return;let t=this._currentAdjacency();t.currentCardinality===1?this._incrementCurrentIndex():t.currentCardinality--,this._currentSize--}_incrementCurrentIndex(){this._currentIndex++,this._currentIndex<this._adjacencies.length&&this._currentAdjacency().reset()}isEmpty(){return this._currentSize===0}first(){return this._currentAdjacency().position}size(){return this._currentSize}_currentAdjacency(){return this._adjacencies[this._currentIndex]}toString(){return`AdjacencyList [node=${this._node}, adjacencies=${this._adjacencies.map(t=>t.toString())}]`}},B_=class{constructor(t){this.position=t,this.cardinality=1,this.currentCardinality=1}reset(){this.currentCardinality=this.cardinality}toString(){return`Adjacency [position=${this.position}, cardinality=${this.cardinality}, currentCardinality=${this.currentCardinality}]`}};var md=class{constructor(){this.crossingsCounter=null,this._nPorts=0,this.portPos=null,this._hierarchicalCrossingsCounter=null}distributePortsWhileSweeping(t,e,o){return this._initialize(t,e,o),this._distributePortsInLayer(t,e,o)}_distributePortsInLayer(t,e,o){let r=o?u.WEST:u.EAST,i=!1;for(let s of t[e]){if(s.getProperty(_.PORT_CONSTRAINTS).isOrderFixed())continue;let a=s.getNestedGraph(),l=s.getPortSideView(r).length>0&&a!=null;if(l){let c=a.toNodeArray();this._hierarchicalCrossingsCounter=new qn(c,o?0:c.length-1)}i=this._distributePortsOnNode(s,r,l)||i}return i}_distributePortsOnNode(t,e,o){let r=t.getPortSideView(e);e===u.SOUTH||e===u.WEST?r=r.slice().reverse():r=r.slice();let i=!1,s;do{s=!1;for(let a=0;a<r.length-1;a++){let l=r[a],c=r[a+1];this._switchingDecreasesCrossings(l,c,o)&&(i=!0,this._switchPorts(r,a,a+1),s=!0)}}while(s);return i}_switchingDecreasesCrossings(t,e,o){let r=this.crossingsCounter.countCrossingsBetweenPortsInBothOrders(t,e),i=r.getFirst(),s=r.getSecond();if(o){let a=t.getProperty(p.PORT_DUMMY),l=e.getProperty(p.PORT_DUMMY);a!=null&&l!=null&&(this._hierarchicalCrossingsCounter.countBothSideCrossings(a,l),i+=this._hierarchicalCrossingsCounter.getUpperLowerCrossings(),s+=this._hierarchicalCrossingsCounter.getLowerUpperCrossings())}return i>s}_switchPorts(t,e,o){this.crossingsCounter.switchPorts(t[e],t[o]);let r=t[o];t[o]=t[e],t[e]=r}_initialize(t,e,o){o&&e>0?this.crossingsCounter.initForCountingBetween(t[e-1],t[e]):!o&&e<t.length-1?this.crossingsCounter.initForCountingBetween(t[e],t[e+1]):this.crossingsCounter.initPortPositionsForInLayerCrossings(t[e],o?u.WEST:u.EAST)}initAtNodeLevel(t,e,o){this._nPorts+=o[t][e].getPorts().length,this._nPorts}initAfterTraversal(){this.portPos=new Int32Array(this._nPorts),this.crossingsCounter=new Fr(this.portPos)}};var Jn=class{constructor(t){this.portRanks=null,this.minBarycenter=0,this.maxBarycenter=0,this.nodePositions=new Array(t),this.portBarycenter=null,this.inLayerPorts=[],this._nPorts=0}getPortRanks(){return this.portRanks}distributePortsWhileSweeping(t,e,o){this._updateNodePositions(t,e);let r=t[e],i=o?u.WEST:u.EAST;if(this._isNotFirstLayer(t.length,e,o)){let s=t[o?e-1:e+1];this.calculatePortRanksLayer(s,xP(o));for(let a of r)this._distributePorts(a,i);this.calculatePortRanksLayer(r,xP(!o));for(let a of s)_I(a)||this._distributePorts(a,i.opposed())}else for(let s of r)this._distributePorts(s,i);return!1}calculatePortRanksLayer(t,e){let o=0;for(let r=0;r<t.length;r++)o+=this.calculatePortRanks(t[r],o,e)}calculatePortRanks(t,e,o){throw new Error("abstract method \u2014 subclass must override calculatePortRanks(node, rankSum, type)")}_distributePorts(t,e){t.getProperty(_.PORT_CONSTRAINTS).isOrderFixed()||(this._distributePortsSubset(t,t.getPorts(e)),this._distributePortsSubset(t,t.getPorts(u.SOUTH)),this._distributePortsSubset(t,t.getPorts(u.NORTH)),this._sortPorts(t))}_distributePortsSubset(t,e){this.inLayerPorts.length=0,this._iteratePortsAndCollectInLayerPorts(t,e),this.inLayerPorts.length>0&&this._calculateInLayerPortsBarycenterValues(t)}_iteratePortsAndCollectInLayerPorts(t,e){this.minBarycenter=0,this.maxBarycenter=0;let o=2*t.getLayer().getNodes().length+1;t:for(let r of e){let i=r.getSide(),s=i===u.NORTH||i===u.SOUTH,a=0;if(s){let l=r.getProperty(p.PORT_DUMMY);if(l==null)continue;a+=this._dealWithNorthSouthPorts(o,r,l)}else{for(let l of r.getOutgoingEdges()){let c=l.getTarget();if(c.getNode().getLayer()===t.getLayer()){this.inLayerPorts.push(r);continue t}else a+=this.portRanks[c.id]}for(let l of r.getIncomingEdges()){let c=l.getSource();if(c.getNode().getLayer()===t.getLayer()){this.inLayerPorts.push(r);continue t}else a-=this.portRanks[c.id]}}r.getDegree()>0?(this.portBarycenter[r.id]=a/r.getDegree(),this.minBarycenter=Math.min(this.minBarycenter,this.portBarycenter[r.id]),this.maxBarycenter=Math.max(this.maxBarycenter,this.portBarycenter[r.id])):s&&(this.portBarycenter[r.id]=a)}}_calculateInLayerPortsBarycenterValues(t){let e=this._positionOfNode(t)+1,o=t.getLayer().getNodes().length+1;for(let r of this.inLayerPorts){let i=0,s=0;for(let c of r.getConnectedPorts())c.getNode().getLayer()===t.getLayer()&&(i+=this._positionOfNode(c.getNode())+1,s++);let a=i/s,l=r.getSide();l===u.EAST?a<e?this.portBarycenter[r.id]=this.minBarycenter-a:this.portBarycenter[r.id]=this.maxBarycenter+(o-a):l===u.WEST&&(a<e?this.portBarycenter[r.id]=this.maxBarycenter+a:this.portBarycenter[r.id]=this.minBarycenter-(o-a))}}_dealWithNorthSouthPorts(t,e,o){let r=!1,i=!1;for(let a of o.getPorts())a.getProperty(p.ORIGIN)===e&&(a.getOutgoingEdges().length>0?i=!0:a.getIncomingEdges().length>0&&(r=!0));let s=0;return r&&r!==i?s=e.getSide()===u.NORTH?-this._positionOfNode(o):t-this._positionOfNode(o):i&&r!==i?s=this._positionOfNode(o)+1:r&&i&&(s=e.getSide()===u.NORTH?0:t/2),s}_positionOfNode(t){return this.nodePositions[t.getLayer().id][t.id]}_updateNodePositions(t,e){let o=t[e];for(let r=0;r<o.length;r++){let i=o[r];this.nodePositions[i.getLayer().id][i.id]=r}}_isNotFirstLayer(t,e,o){return o?e!==0:e!==t-1}_sortPorts(t){let e=t.getPorts(),o=this.portBarycenter;e.sort((r,i)=>{let s=r.getSide(),a=i.getSide();if(s!==a)return s.ordinal()-a.ordinal();let l=o[r.id],c=o[i.id];return l===0&&c===0?0:l===0?-1:c===0?1:l<c?-1:l>c?1:0})}initAtLayerLevel(t,e){this.nodePositions[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){let r=o[t][e];r.id=e,this.nodePositions[t][e]=e}initAtPortLevel(t,e,o,r){r[t][e].getPorts()[o].id=this._nPorts++}initAfterTraversal(){this.portRanks=new Float32Array(this._nPorts),this.portBarycenter=new Float32Array(this._nPorts)}};function xP(n){return n?W.OUTPUT:W.INPUT}function _I(n){return n.getNestedGraph()!=null}var Qn=class extends Jn{constructor(t){super(t)}calculatePortRanks(t,e,o){let r=this.getPortRanks();if(o===W.INPUT){let i=0,s=0;for(let g of t.getPorts())g.getIncomingEdges().length>0&&(i++,g.getSide()===u.NORTH&&s++);let a=1/(i+1),l=e+s*a,c=e+1-a;for(let g of t.getPorts(W.INPUT))g.getSide()===u.NORTH?(r[g.id]=l,l-=a):(r[g.id]=c,c-=a)}else if(o===W.OUTPUT){let i=0;for(let l of t.getPorts())l.getOutgoingEdges().length>0&&i++;let s=1/(i+1),a=e+s;for(let l of t.getPorts(W.OUTPUT))r[l.id]=a,a+=s}else throw new Error("Port type is undefined");return 1}};var Pd=class extends Jn{constructor(t){super(t)}calculatePortRanks(t,e,o){let r=this.getPortRanks();if(o===W.INPUT){let i=0,s=0;for(let c of t.getPorts())c.getIncomingEdges().length>0&&(i++,c.getSide()===u.NORTH&&s++);let a=e+s,l=e+i;for(let c of t.getPorts(W.INPUT))c.getSide()===u.NORTH?(r[c.id]=a,a--):(r[c.id]=l,l--);return i}if(o===W.OUTPUT){let i=0;for(let s of t.getPorts(W.OUTPUT))i++,r[s.id]=e+i;return i}throw new Error("Port type is undefined")}};var Od=class{static create(t,e,o){return t===oe.TWO_SIDED_GREEDY_SWITCH?new md:e.nextBoolean()?new Qn(o.length):new Pd(o.length)}};var Sd=class{constructor(t){this.graphData=t,this.nodeInfo=new Array(t.currentNodeOrder().length)}useBottomUp(){let t=this.graphData.lGraph().getProperty(_.CROSSING_MINIMIZATION_HIERARCHICAL_SWEEPINESS);if(pI(t)||this._rootNode()||this._fixedPortOrder()||this._fewerThanTwoInOutEdges())return!0;if(this.graphData.crossMinDeterministic())return!1;let e=0,o=0,r=[];for(let a of this.graphData.currentNodeOrder()){for(let l of a){if(OI(l)){r.push(l);continue}let c=this._nodeInfoFor(l);PI(l)?(c.hierarchicalInfluence=1,SI(l)&&(o+=c.connectedEdges)):mI(l)?c.randomInfluence=1:EI(l)&&(e+=c.connectedEdges);for(let g of l.getOutgoingEdges())e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoToTarget(c,g);for(let g of l.getPortSideView(u.NORTH)){let h=g.getProperty(p.PORT_DUMMY);h!=null&&(e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoTo(c,h))}for(let g of l.getPortSideView(u.SOUTH)){let h=g.getProperty(p.PORT_DUMMY);h!=null&&(e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoTo(c,h))}}for(let l of r){let c=this._nodeInfoFor(l);for(let g of l.getOutgoingEdges())e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoToTarget(c,g)}r.length=0}let i=e+o;return(i===0?Number.POSITIVE_INFINITY:(e-o)/i)>=t}_fixedPortOrder(){return this.graphData.parent().getProperty(_.PORT_CONSTRAINTS).isOrderFixed()}_transferInfoToTarget(t,e){let o=e.getTarget().getNode();this._transferInfoTo(t,o)}_transferInfoTo(t,e){let o=this._nodeInfoFor(e);o.transfer(t),o.connectedEdges++}_fewerThanTwoInOutEdges(){let t=this.graphData.parent();return t.getPortSideView(u.EAST).length<2&&t.getPortSideView(u.WEST).length<2}_rootNode(){return!this.graphData.hasParent()}_nodeInfoFor(t){return this.nodeInfo[t.getLayer().id][t.id]}initAtLayerLevel(t,e){e[t][0].getLayer().id=t,this.nodeInfo[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){o[t][e].id=e,this.nodeInfo[t][e]=new U_}},U_=class{constructor(){this.connectedEdges=0,this.hierarchicalInfluence=0,this.randomInfluence=0}transfer(t){this.hierarchicalInfluence+=t.hierarchicalInfluence,this.randomInfluence+=t.randomInfluence,this.connectedEdges+=t.connectedEdges}toString(){return`NodeInfo [connectedEdges=${this.connectedEdges}, hierarchicalInfluence=${this.hierarchicalInfluence}, randomInfluence=${this.randomInfluence}]`}};function pI(n){return n<-1}function EI(n){let t=n.getPortSideView(u.EAST);if(t.length===0)return!0;for(let e of t)if(!e.getConnectedEdges()[Symbol.iterator]().next().done)return!1;return!0}function mI(n){let t=n.getPortSideView(u.WEST);if(t.length===0)return!0;for(let e of t)if(!e.getConnectedEdges()[Symbol.iterator]().next().done)return!1;return!0}function PI(n){return n.getType()===y.EXTERNAL_PORT}function OI(n){return n.getType()===y.NORTH_SOUTH_PORT}function SI(n){return n.getProperty(p.ORIGIN).getSide()===u.EAST}var Td=class{constructor(t){this.random=t,this.weightComparator=(e,o)=>{if(!e.hasProperty(p.WEIGHT))return 1;if(!o.hasProperty(p.WEIGHT))return-1;let r=e.getProperty(p.WEIGHT),i=o.getProperty(p.WEIGHT);return r!=null&&i!=null?r<i?-1:r>i?1:0:r!=null?-1:i!=null?1:0}}alwaysImproves(){return!1}isDeterministic(){return!0}setFirstLayerOrder(t,e){let o=e?0:Math.max(0,t.length-1),r=Array.from(t[o]);for(let i of r)i.setProperty(p.WEIGHT,this.random.nextDouble());r.sort(this.weightComparator);for(let i=0;i<r.length;i++){let s=r[i];t[o][i]=s,s.setProperty(p.WEIGHT,i+1)}return!1}minimizeCrossings(t,e,o,r){let i=Array.from(t[e]);this._calculateMedians(i,o?e-1:e+1),i.sort(this.weightComparator);for(let s=0;s<i.length;s++)t[e][s]=i[s];return!1}_calculateMedians(t,e){let o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=[];for(let a of t){let l=[];for(let c of a.getIncomingEdges()){let g=c.getTarget().getNode(),h=c.getSource().getNode();g.getLayer().id===e&&l.push(g),h.getLayer().id===e&&l.push(h)}for(let c of a.getOutgoingEdges()){let g=c.getTarget().getNode(),h=c.getSource().getNode();g.getLayer().id===e&&l.push(g),h.getLayer().id===e&&l.push(h)}if(l.length===0)i.push(a);else{l.sort(this.weightComparator);let c=Math.floor(l.length/2),g=l[c].getProperty(p.WEIGHT);a.setProperty(p.WEIGHT,g),o=Math.min(o,g),r=Math.max(r,g)}}let s=(r+o)/2;for(let a of i)a.setProperty(p.WEIGHT,s)}};var Nd=class n extends $n{constructor(t,e,o,r){super(t,e,o,r),this.biggerThan=new Map,this.smallerThan=new Map,this.barycenterStateComparator=(i,s)=>{let a=i.hasProperty(_.LAYERING_LAYER_CONSTRAINT)&&DP(i.getProperty(_.LAYERING_LAYER_CONSTRAINT)),l=s.hasProperty(_.LAYERING_LAYER_CONSTRAINT)&&DP(s.getProperty(_.LAYERING_LAYER_CONSTRAINT));if(a||l)return 0;let c=i.getGraph(),g=this._compareBasedOnTransitiveDependencies(i,s);if(g!==0)return g;if(i.hasProperty(p.MODEL_ORDER)&&s.hasProperty(p.MODEL_ORDER)){let h=c.getProperty(p.MAX_MODEL_ORDER_NODES),d=Qe.calculateModelOrderOrGroupModelOrder(i,s,c,h),f=Qe.calculateModelOrderOrGroupModelOrder(s,i,c,h),E=Math.sign(d-f);if(c.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY)===Wt.ONLY_WITHIN_GROUP&&i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID)!==s.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID)&&(E=0),E<0)return this._updateBiggerAndSmallerAssociations(i,s),E;if(E>0)return this._updateBiggerAndSmallerAssociations(s,i),E}return this._compareBasedOnBarycenter(i,s)}}minimizeCrossingsList(t,e,o,r){if(o?this.randomizeBarycenters(t):(this.calculateBarycenters(t,r),this.fillInUnknownBarycenters(t,e)),t.length>1){let s=t[0].getGraph().getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER);s?n.insertionSort(t,this.barycenterStateComparator,this):t.sort(this.barycenterStateComparator),s||this.constraintResolver.processConstraints(t)}}_compareBasedOnTransitiveDependencies(t,e){if(!this.biggerThan.has(t))this.biggerThan.set(t,new Set);else if(this.biggerThan.get(t).has(e))return 1;if(!this.biggerThan.has(e))this.biggerThan.set(e,new Set);else if(this.biggerThan.get(e).has(t))return-1;if(!this.smallerThan.has(t))this.smallerThan.set(t,new Set);else if(this.smallerThan.get(t).has(e))return-1;if(!this.smallerThan.has(e))this.smallerThan.set(e,new Set);else if(this.smallerThan.get(e).has(t))return 1;return 0}_compareBasedOnBarycenter(t,e){let o=this.stateOf(t),r=this.stateOf(e);if(o.barycenter!=null&&r.barycenter!=null){let i=0;return o.barycenter<r.barycenter?i=-1:o.barycenter>r.barycenter&&(i=1),i<0?this._updateBiggerAndSmallerAssociations(t,e):i>0&&this._updateBiggerAndSmallerAssociations(e,t),i}return o.barycenter!=null?(this._updateBiggerAndSmallerAssociations(t,e),-1):r.barycenter!=null?(this._updateBiggerAndSmallerAssociations(e,t),1):0}_updateBiggerAndSmallerAssociations(t,e){let o=this.biggerThan.get(t),r=this.biggerThan.get(e),i=this.smallerThan.get(t),s=this.smallerThan.get(e);o.add(e),s.add(t);for(let a of r){o.add(a);let l=this.smallerThan.get(a);l.add(t);for(let c of i)l.add(c)}for(let a of i){s.add(a);let l=this.biggerThan.get(a);l.add(e);for(let c of r)l.add(c)}}static insertionSort(t,e,o){for(let r=1;r<t.length;r++){let i=t[r],s=r;for(;s>0&&e(t[s-1],i)>0;)t[s]=t[s-1],s--;t[s]=i}o.clearTransitiveOrdering()}clearTransitiveOrdering(){this.biggerThan=new Map,this.smallerThan=new Map}};function DP(n){return n===J.FIRST_SEPARATE||n===J.LAST_SEPARATE}var er=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};er.WEST=new er("WEST");er.EAST=new er("EAST");var yd=class{constructor(t,e,o,r){this._direction=r,this._oneSided=t===oe.ONE_SIDED_GREEDY_SWITCH;let s=e[o].length;this._isCrossingMatrixFilled=new Array(s),this._crossingMatrix=new Array(s);for(let a=0;a<s;a++)this._isCrossingMatrixFilled[a]=new Array(s).fill(!1),this._crossingMatrix[a]=new Array(s).fill(0);this._inBetweenLayerCrossingCounter=new qn(e,o)}getCrossingMatrixEntry(t,e){return this._isCrossingMatrixFilled[t.id][e.id]||(this._fillCrossingMatrix(t,e),this._isCrossingMatrixFilled[t.id][e.id]=!0,this._isCrossingMatrixFilled[e.id][t.id]=!0),this._crossingMatrix[t.id][e.id]}_fillCrossingMatrix(t,e){this._oneSided?this._direction===er.EAST?this._inBetweenLayerCrossingCounter.countEasternEdgeCrossings(t,e):this._direction===er.WEST&&this._inBetweenLayerCrossingCounter.countWesternEdgeCrossings(t,e):this._inBetweenLayerCrossingCounter.countBothSideCrossings(t,e),this._crossingMatrix[t.id][e.id]=this._inBetweenLayerCrossingCounter.getUpperLowerCrossings(),this._crossingMatrix[e.id][t.id]=this._inBetweenLayerCrossingCounter.getLowerUpperCrossings()}};var Ad=class{constructor(t){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._portPositions=new Map,this._layer=t,this._initializePortPositions()}_initializePortPositions(){for(let t of this._layer)this._setPortIdsOn(t,u.SOUTH),this._setPortIdsOn(t,u.NORTH)}_setPortIdsOn(t,e){let o=0;for(let r of zi(t,e))this._portPositions.set(r,o++)}countCrossings(t,e){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._processIfTwoNorthSouthNodes(t,e),this._processIfNorthSouthLongEdgeDummyCrossing(t,e),this._processIfNormalNodeWithNSPortsAndLongEdgeDummy(t,e)}_processIfTwoNorthSouthNodes(t,e){Ld(t)&&Ld(e)&&!this._haveDifferentOrigins(t,e)&&(this._isNorthOfNormalNode(t)?this._countCrossingsOfTwoNorthSouthDummies(t,e):this._countCrossingsOfTwoNorthSouthDummies(e,t))}_countCrossingsOfTwoNorthSouthDummies(t,e){if(this._originPortPositionOf(t)>this._originPortPositionOf(e)){let o=e.getPortSideView(u.EAST);this._upperLowerCrossings=o.length===0?0:o[0].getDegree();let r=t.getPortSideView(u.WEST);this._lowerUpperCrossings=r.length===0?0:r[0].getDegree()}else{let o=e.getPortSideView(u.WEST);this._upperLowerCrossings=o.length===0?0:o[0].getDegree();let r=t.getPortSideView(u.EAST);this._lowerUpperCrossings=r.length===0?0:r[0].getDegree()}}_processIfNorthSouthLongEdgeDummyCrossing(t,e){Ld(t)&&Rd(e)?this._isNorthOfNormalNode(t)?this._upperLowerCrossings=1:this._lowerUpperCrossings=1:Ld(e)&&Rd(t)&&(this._isNorthOfNormalNode(e)?this._lowerUpperCrossings=1:this._upperLowerCrossings=1)}_processIfNormalNodeWithNSPortsAndLongEdgeDummy(t,e){bP(t)&&Rd(e)&&(this._upperLowerCrossings=Id(t,u.SOUTH),this._lowerUpperCrossings=Id(t,u.NORTH)),bP(e)&&Rd(t)&&(this._upperLowerCrossings=Id(e,u.NORTH),this._lowerUpperCrossings=Id(e,u.SOUTH))}_haveDifferentOrigins(t,e){return MP(t)!==MP(e)}_originPortPositionOf(t){let e=wP(t);return this._portPositions.get(e)}_isNorthOfNormalNode(t){return wP(t).getSide()===u.NORTH}getUpperLowerCrossings(){return this._upperLowerCrossings}getLowerUpperCrossings(){return this._lowerUpperCrossings}};function Id(n,t){let e=0;for(let o of n.getPortSideView(t))o.getProperty(p.PORT_DUMMY)!=null&&e++;return e}function wP(n){return n.getPorts()[0].getProperty(p.ORIGIN)}function MP(n){return n.getProperty(p.ORIGIN)}function Rd(n){return n.getType()===y.LONG_EDGE}function Ld(n){return n.getType()===y.NORTH_SOUTH_PORT}function bP(n){return n.getType()===y.NORMAL}var xd=class{constructor(t,e,o,r,i,s){if(this._crossingMatrixFiller=o,this._graphData=i,t>=e.length)throw new RangeError("Greedy SwitchDecider: Free layer not in graph.");this._freeLayer=e[t],this._leftInLayerCounter=new Fr(r),this._leftInLayerCounter.initPortPositionsForInLayerCrossings(this._freeLayer,u.WEST),this._rightInLayerCounter=new Fr(r),this._rightInLayerCounter.initPortPositionsForInLayerCrossings(this._freeLayer,u.EAST),this._northSouthCounter=new Ad(this._freeLayer),this._countCrossingsCausedByPortSwitch=!s&&i.hasParent()&&!i.dontSweepInto()&&this._freeLayer[0].getType()===y.EXTERNAL_PORT,this._parentCrossCounter=null,this._countCrossingsCausedByPortSwitch&&this._initParentCrossingsCounters(t,e.length)}_initParentCrossingsCounters(t,e){let o=this._graphData.parentGraphData(),r=o.currentNodeOrder(),i=o.portPositions();this._parentCrossCounter=new Fr(i);let s=this._graphData.parent().getLayer().id,a=s>0?r[s-1]:[],l=r[s],c=s<r.length-1?r[s+1]:[];t===e-1?this._parentCrossCounter.initForCountingBetween(l,c):this._parentCrossCounter.initForCountingBetween(a,l)}notifyOfSwitch(t,e){if(this._leftInLayerCounter.switchNodes(t,e,u.WEST),this._rightInLayerCounter.switchNodes(t,e,u.EAST),this._countCrossingsCausedByPortSwitch){let o=t.getProperty(p.ORIGIN),r=e.getProperty(p.ORIGIN);this._parentCrossCounter.switchPorts(o,r)}}doesSwitchReduceCrossings(t,e){if(this._constraintsPreventSwitch(t,e))return!1;let o=this._freeLayer[t],r=this._freeLayer[e],i=this._leftInLayerCounter.countInLayerCrossingsBetweenNodesInBothOrders(o,r,u.WEST),s=this._rightInLayerCounter.countInLayerCrossingsBetweenNodesInBothOrders(o,r,u.EAST);this._northSouthCounter.countCrossings(o,r);let a=this._crossingMatrixFiller.getCrossingMatrixEntry(o,r)+i.getFirst()+s.getFirst()+this._northSouthCounter.getUpperLowerCrossings(),l=this._crossingMatrixFiller.getCrossingMatrixEntry(r,o)+i.getSecond()+s.getSecond()+this._northSouthCounter.getLowerUpperCrossings();if(this._countCrossingsCausedByPortSwitch){let c=o.getProperty(p.ORIGIN),g=r.getProperty(p.ORIGIN),h=this._parentCrossCounter.countCrossingsBetweenPortsInBothOrders(c,g);a+=h.getFirst(),l+=h.getSecond()}return a>l}_constraintsPreventSwitch(t,e){let o=this._freeLayer[t],r=this._freeLayer[e];return TI(o,r)||NI(o,r)||yI(o,r)}};function TI(n,t){let e=n.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS);return e!=null&&e.length>0&&e.indexOf(t)>=0}function NI(n,t){let e=n.getType()!==y.LONG_EDGE&&t.getType()!==y.LONG_EDGE,o=n.getProperty(p.IN_LAYER_LAYOUT_UNIT),r=t.getProperty(p.IN_LAYER_LAYOUT_UNIT),i=o!==r,s=GP(n,o)||GP(t,r),a=Cd(n,u.NORTH),l=Cd(t,u.SOUTH);return s=s||Cd(n,u.SOUTH)||Cd(t,u.NORTH),e&&(s&&i||a||l)}function Cd(n,t){for(let e of n.getPortSideView(t))if(e.getProperty(p.PORT_DUMMY)!=null||!e.getConnectedEdges()[Symbol.iterator]().next().done)return!0;return!1}function GP(n,t){return t!=null&&t!==n}function yI(n,t){return vP(n)&&HP(t)||vP(t)&&HP(n)}function HP(n){return n.getType()===y.NORMAL}function vP(n){return n.getType()===y.NORTH_SOUTH_PORT}var Dd=class{constructor(t,e){this._graphData=e,this._greedySwitchType=t,this._currentNodeOrder=null,this._switchDecider=null,this._portPositions=null,this._nPorts=0}minimizeCrossings(t,e,o,r){return this._setUp(t,e,o),this._continueSwitchingUntilNoImprovementInLayer(e)}setFirstLayerOrder(t,e){let o=e?0:t.length-1;return this._setUp(t,o,e),this._sweepDownwardInLayer(o)}_setUp(t,e,o){this._currentNodeOrder=t;let r=o?er.WEST:er.EAST;this._switchDecider=this._getNewSwitchDecider(e,r)}_getNewSwitchDecider(t,e){let o=new yd(this._greedySwitchType,this._currentNodeOrder,t,e);return new xd(t,this._currentNodeOrder,o,this._portPositions,this._graphData,this._greedySwitchType===oe.ONE_SIDED_GREEDY_SWITCH)}_continueSwitchingUntilNoImprovementInLayer(t){let e=!1,o;do o=this._sweepDownwardInLayer(t),e=e||o;while(o);return e}_sweepDownwardInLayer(t){let e=!1,o=this._currentNodeOrder[t].length;for(let r=0;r<o-1;r++){let i=r+1;this._switchIfImproves(t,r,i)&&(e=!0)}return e}_switchIfImproves(t,e,o){return this._switchDecider.doesSwitchReduceCrossings(e,o)?(this._exchangeNodes(e,o,t),!0):!1}_exchangeNodes(t,e,o){let r=this._currentNodeOrder[o];this._switchDecider.notifyOfSwitch(r[t],r[e]);let i=r[e];r[e]=r[t],r[t]=i}alwaysImproves(){return this._greedySwitchType!==oe.ONE_SIDED_GREEDY_SWITCH}isDeterministic(){return!0}initAtLayerLevel(t,e){e[t][0].getLayer().id=t}initAtPortLevel(t,e,o,r){this._nPorts++}initAfterTraversal(){this._portPositions=new Int32Array(this._nPorts)}};var wd=class{constructor(t,e,o){this._lGraph=t,this._currentNodeOrder=t.toNodeArray(),this._parent=this._lGraph.getParentNode(),this._hasParent=this._parent!=null,this._parentGraphData=this._hasParent?o[this._parent.getGraph().id]:null;let r=t.getProperty(p.GRAPH_PROPERTIES);this._hasExternalPorts=r.has(v.EXTERNAL_PORTS),this._childGraphs=[],this._currentlyBestNodeAndPortOrder=null,this._bestNodeAndPortOrder=null,this._portPositions=null,this._nPorts=0,this._crossingsCounter=new fd(this._currentNodeOrder);let i=this._lGraph.getProperty(p.RANDOM);if(i==null){let a=this._lGraph.getParentNode?this._lGraph.getParentNode():null;for(;a!=null&&i==null;){let l=a.getGraph?a.getGraph():null;l&&(i=l.getProperty(p.RANDOM)),a=l&&l.getParentNode?l.getParentNode():null}i!=null&&this._lGraph.setProperty(p.RANDOM,i)}this._portDistributor=Od.create(e,i,this._currentNodeOrder),this._layerSweepTypeDecider=new Sd(this);let s=[this,this._crossingsCounter,this._layerSweepTypeDecider,this._portDistributor];if(e===oe.BARYCENTER&&!t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)){let a=new ll(this._currentNodeOrder);s.push(a),this._crossMinimizer=new $n(a,i,this._portDistributor,this._currentNodeOrder)}else if(e===oe.BARYCENTER&&t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)){let a=new ll(this._currentNodeOrder);s.push(a),this._crossMinimizer=new Nd(a,i,this._portDistributor,this._currentNodeOrder)}else e===oe.MEDIAN?this._crossMinimizer=new Td(i):this._crossMinimizer=new Dd(e,this);s.push(this._crossMinimizer),ud.init(s,this._currentNodeOrder),this._useBottomUp=this._layerSweepTypeDecider.useBottomUp()}dontSweepInto(){return this._useBottomUp}lGraph(){return this._lGraph}currentNodeOrder(){return this._currentNodeOrder}currentlyBestNodeAndPortOrder(){return this._currentlyBestNodeAndPortOrder}setCurrentlyBestNodeAndPortOrder(t){this._currentlyBestNodeAndPortOrder=t}bestNodeNPortOrder(){return this._bestNodeAndPortOrder}setBestNodeNPortOrder(t){this._bestNodeAndPortOrder=t}crossCounter(){return this._crossingsCounter}crossMinimizer(){return this._crossMinimizer}portDistributor(){return this._portDistributor}parent(){return this._parent}hasParent(){return this._hasParent}childGraphs(){return this._childGraphs}hasExternalPorts(){return this._hasExternalPorts}getBestSweep(){return this._crossMinimizer.isDeterministic()?this.currentlyBestNodeAndPortOrder():this.bestNodeNPortOrder()}parentGraphData(){return this._parentGraphData}crossMinDeterministic(){return this._crossMinimizer.isDeterministic()}crossMinAlwaysImproves(){return this._crossMinimizer.alwaysImproves()}portPositions(){return this._portPositions}toString(){return JSON.stringify(this._currentNodeOrder.map(t=>t.map(e=>String(e))))}initAtNodeLevel(t,e,o){let i=o[t][e].getNestedGraph();i!=null&&this._childGraphs.push(i)}initAtPortLevel(t,e,o,r){this._nPorts++}initAfterTraversal(){this._portPositions=new Int32Array(this._nPorts)}};var cl=class n{constructor(t){if(t instanceof n){this._nodeOrder=BP(t._nodeOrder),this._portOrders=t._portOrders.map(o=>o.map(r=>[...r]));return}let e=t;this._nodeOrder=BP(e),this._portOrders=[];for(let o of e){let r=[];this._portOrders.push(r);for(let i of o)r.push([...i.getPorts()])}}nodes(){return this._nodeOrder}transferNodeAndPortOrdersToGraph(t,e){let o=new Set,r=t.getLayers();for(let i=0;i<r.length;i++){let s=r[i].getNodes(),a=[];for(let l=0;l<s.length;l++){let c=this._nodeOrder[i][l];c.id=l,c.getType()===y.NORTH_SOUTH_PORT&&a.push(c),r[i].getNodes()[l]=c,c.getPorts().length=0;for(let g of this._portOrders[i][l])c.getPorts().push(g);if(e){let g=c.getProperty(_.PORT_CONSTRAINTS);(g==null||!g.isOrderFixed||!g.isOrderFixed())&&c.setProperty(_.PORT_CONSTRAINTS,H.FIXED_ORDER)}}for(let l of a){let c=this._assertCorrectPortSides(l);o.add(c),o.add(l)}}for(let i of o)i.getPorts().sort(P_),i.cachePortSides()}_assertCorrectPortSides(t){let e=t.getProperty(p.IN_LAYER_LAYOUT_UNIT);if(e==null)return null;let r=t.getPorts()[0].getProperty(p.ORIGIN);for(let i of e.getPorts())if(i===r){if(i.getSide()===u.NORTH&&t.id>e.id){if(i.setSide(u.SOUTH),i.isExplicitlySuppliedPortAnchor()){let s=i.getSize().y;i.getAnchor().y=s-i.getAnchor().y}}else if(i.getSide()===u.SOUTH&&e.id>t.id&&(i.setSide(u.NORTH),i.isExplicitlySuppliedPortAnchor())){let s=i.getSize().y;i.getAnchor().y=-(s-i.getAnchor().y)}break}return e}};function BP(n){if(n==null)return null;let t=new Array(n.length);for(let e=0;e<t.length;e++)t[e]=n[e].slice();return t}var ci=class{constructor(t){this._crossMinType=t,this._graphInfoHolders=[],this._graphsWhoseNodeOrderChanged=new Set,this._random=null,this._randomSeed=0}getLayoutProcessorConfiguration(t){let e=K.createFrom(MI());return e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}process(t,e){e.begin(`Minimize Crossings ${this._crossMinType}`,1);let o=t.getLayers(),r=o.length===0||o.every(c=>c.getNodes().length===0),i=o.length===1&&o[0].getNodes().length===1,s=t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN;if(r||i&&!s){e.done();return}let a=this._initialize(t),l=this._chooseMinimizingMethod(a);this._minimizeCrossings(a,l),this._transferNodeAndPortOrdersToGraph(),e.done()}_chooseMinimizingMethod(t){let e=t[0];return e.crossMinDeterministic()?e.crossMinAlwaysImproves()?o=>this._minimizeCrossingsNoCounter(o):o=>this._minimizeCrossingsWithCounter(o):o=>this._compareDifferentRandomizedLayouts(o)}_minimizeCrossings(t,e){for(let o of t)o.currentNodeOrder().length>0&&(e(o),o.hasParent()&&this._setPortOrderOnParentGraph(o))}_setPortOrderOnParentGraph(t){if(t.hasExternalPorts()&&t.getBestSweep()!=null){let e=t.getBestSweep();this._sortPortsByDummyPositionsInLastLayer(e.nodes(),t.parent(),!0),this._sortPortsByDummyPositionsInLastLayer(e.nodes(),t.parent(),!1),t.parent().setProperty(_.PORT_CONSTRAINTS,H.FIXED_ORDER)}}_minimizeCrossingsNoCounter(t){let e=this._random.nextBoolean(),o=!0;for(;o;)o=!1,o=t.crossMinimizer().setFirstLayerOrder(t.currentNodeOrder(),e),this._sweepReducingCrossings(t,e,!1)&&(o=!0),e=!e;this._setCurrentlyBestNodeOrders()}_compareDifferentRandomizedLayouts(t){typeof this._random.setSeed=="function"&&this._random.setSeed(this._randomSeed),this._graphsWhoseNodeOrderChanged.clear();let e=Number.POSITIVE_INFINITY,o=t.lGraph().getProperty(_.THOROUGHNESS);for(let r=0;r<o;r++){let i=this._minimizeCrossingsWithCounter(t);if(i<e&&(e=i,this._saveAllNodeOrdersOfChangedGraphs(),e===0))break}}_minimizeCrossingsWithCounter(t){let e=this._random.nextBoolean();if(this._countCurrentNumberOfCrossings(t)===0&&t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER))return 0;t.crossMinimizer().setFirstLayerOrder(t.currentNodeOrder(),e),this._sweepReducingCrossings(t,e,!0),t.lGraph().getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER)&&t.lGraph().setProperty(p.SECOND_TRY_WITH_INITIAL_ORDER,!1),t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER)&&(t.lGraph().setProperty(p.FIRST_TRY_WITH_INITIAL_ORDER,!1),t.lGraph().setProperty(p.SECOND_TRY_WITH_INITIAL_ORDER,!0));let r=this._countCurrentNumberOfCrossings(t),i;do{if(this._setCurrentlyBestNodeOrders(),r===0)return 0;e=!e,i=r,this._sweepReducingCrossings(t,e,!1),r=this._countCurrentNumberOfCrossings(t)}while(i>r);return i}_countCurrentNumberOfCrossings(t){let e=0,o=[t];for(;o.length>0;){let r=o.pop();e+=r.crossCounter().countAllCrossings(r.currentNodeOrder());for(let i of r.childGraphs()){let s=this._graphInfoHolders[i.id];s.dontSweepInto()||o.push(s)}}return e}_sweepReducingCrossings(t,e,o){let r=t.currentNodeOrder(),i=r.length,s=t.portDistributor().distributePortsWhileSweeping(r,Md(e,i),e),a=r[Md(e,i)];this._sweepInHierarchicalNodes(a,e,o)&&(s=!0);let l=t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER),c=t.lGraph().getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER),g=o&&!l&&!c;for(let h=RI(e,i);LI(i,h,e);h+=UP(e))t.crossMinimizer().minimizeCrossings(r,h,e,g)&&(s=!0),t.portDistributor().distributePortsWhileSweeping(r,h,e)&&(s=!0),this._sweepInHierarchicalNodes(r[h],e,o)&&(s=!0);return this._graphsWhoseNodeOrderChanged.add(t),s}_sweepInHierarchicalNodes(t,e,o){let r=!1;for(let i of t)AI(i)&&!this._graphInfoHolders[i.getNestedGraph().id].dontSweepInto()&&this._sweepInHierarchicalNode(e,i,o)&&(r=!0);return r}_sweepInHierarchicalNode(t,e,o){let r=e.getNestedGraph(),i=this._graphInfoHolders[r.id],s=i.currentNodeOrder(),a=Md(t,s.length),l=s[a][0];FP(l)?s[a]=this._sortPortDummiesByPortPositions(e,s[a],CI(t)):i.crossMinimizer().setFirstLayerOrder(s,t);let c=this._sweepReducingCrossings(i,t,o);return this._sortPortsByDummyPositionsInLastLayer(i.currentNodeOrder(),i.parent(),t),c}_sortPortsByDummyPositionsInLastLayer(t,e,o){let r=II(o,t.length),i=t[r],s=Md(o,i.length);if(!FP(i[s]))return;let a=e.getPorts();for(let l=0;l<a.length;l++){let c=a[l];wI(c,o)&&kP(c)&&(a[l]=xI(i[s]),s+=UP(o))}}_sortPortDummiesByPortPositions(t,e,o){let r=zi(t,o),i=new Array(e.length),s=0;for(let a of r)kP(a)&&(i[s++]=DI(a));if(s<e.length)throw new Error(`Expected ${e.length} hierarchical ports, but found only ${s}.`);return i}_saveAllNodeOrdersOfChangedGraphs(){for(let t of this._graphsWhoseNodeOrderChanged)t.setBestNodeNPortOrder(new cl(t.currentlyBestNodeAndPortOrder()))}_setCurrentlyBestNodeOrders(){for(let t of this._graphsWhoseNodeOrderChanged)t.setCurrentlyBestNodeAndPortOrder(new cl(t.currentNodeOrder()))}_initialize(t){this._graphInfoHolders=[],this._random=t.getProperty(p.RANDOM),this._randomSeed=typeof this._random.nextLong=="function"?this._random.nextLong():0;let e=[],o=[t],r=0;for(;r<o.length;){let i=o[r];i.id=r++;let s=new wd(i,this._crossMinType,this._graphInfoHolders);for(let a of s.childGraphs())o.push(a);this._graphInfoHolders.push(s),s.dontSweepInto()&&e.unshift(s)}return this._graphsWhoseNodeOrderChanged=new Set,e}_transferNodeAndPortOrdersToGraph(){for(let t of this._graphInfoHolders){let e=t.getBestSweep();e!=null&&e.transferNodeAndPortOrdersToGraph(t.lGraph(),!0)}}getGraphData(){return this._graphInfoHolders}};Z(ci,"isHierarchyAware",!0);function Md(n,t){return n?0:t-1}function II(n,t){return n?t-1:0}function RI(n,t){return n?1:t-2}function UP(n){return n?1:-1}function LI(n,t,e){return e?t<n:t>=0}function AI(n){return n.getNestedGraph()!=null}function CI(n){return n?u.WEST:u.EAST}function FP(n){return n.getType()===y.EXTERNAL_PORT}function xI(n){return n.getProperty(p.ORIGIN)}function kP(n){return n.getProperty(p.INSIDE_CONNECTIONS)}function DI(n){return n.getProperty(p.PORT_DUMMY)}function wI(n,t){return t?n.getSide()===u.EAST:n.getSide()===u.WEST}function MI(){return K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER)}var at=class{constructor(t,e,o){this.name=t,this.ordinal=e,this._factory=o,Object.freeze(this)}toString(){return this.name}create(){if(this._factory==null)throw new Error("No implementation available for layout processor "+this.name);return this._factory()}},w=class{},ct=0,gt=w;gt.DIRECTION_PREPROCESSOR=new at("DIRECTION_PREPROCESSOR",ct++,()=>new wn($o.TO_INPUT_DIRECTION));gt.COMMENT_PREPROCESSOR=new at("COMMENT_PREPROCESSOR",ct++,()=>new bg);gt.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER=new at("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER",ct++,()=>new Hg);gt.INTERACTIVE_EXTERNAL_PORT_POSITIONER=new at("INTERACTIVE_EXTERNAL_PORT_POSITIONER",ct++,()=>new ah);gt.PARTITION_PREPROCESSOR=new at("PARTITION_PREPROCESSOR",ct++,()=>new Th);gt.LABEL_DUMMY_INSERTER=new at("LABEL_DUMMY_INSERTER",ct++,()=>new gh);gt.SELF_LOOP_PREPROCESSOR=new at("SELF_LOOP_PREPROCESSOR",ct++,()=>new vh);gt.LAYER_CONSTRAINT_PREPROCESSOR=new at("LAYER_CONSTRAINT_PREPROCESSOR",ct++,()=>new _h);gt.PARTITION_MIDPROCESSOR=new at("PARTITION_MIDPROCESSOR",ct++,()=>new Oh);gt.HIGH_DEGREE_NODE_LAYER_PROCESSOR=new at("HIGH_DEGREE_NODE_LAYER_PROCESSOR",ct++,()=>new oh);gt.NODE_PROMOTION=new at("NODE_PROMOTION",ct++,()=>new Eh);gt.LAYER_CONSTRAINT_POSTPROCESSOR=new at("LAYER_CONSTRAINT_POSTPROCESSOR",ct++,()=>new fh);gt.PARTITION_POSTPROCESSOR=new at("PARTITION_POSTPROCESSOR",ct++,()=>new Sh);gt.HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR=new at("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR",ct++,()=>new $g);gt.SEMI_INTERACTIVE_CROSSMIN_PROCESSOR=new at("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR",ct++,()=>new Kh);gt.BREAKING_POINT_INSERTER=new at("BREAKING_POINT_INSERTER",ct++,()=>new qh);gt.LONG_EDGE_SPLITTER=new at("LONG_EDGE_SPLITTER",ct++,()=>new ri);gt.PORT_SIDE_PROCESSOR=new at("PORT_SIDE_PROCESSOR",ct++,()=>new Un);gt.INVERTED_PORT_PROCESSOR=new at("INVERTED_PORT_PROCESSOR",ct++,()=>new lh);gt.PORT_LIST_SORTER=new at("PORT_LIST_SORTER",ct++,()=>new Ih);gt.SORT_BY_INPUT_ORDER_OF_MODEL=new at("SORT_BY_INPUT_ORDER_OF_MODEL",ct++,()=>new jh);gt.NORTH_SOUTH_PORT_PREPROCESSOR=new at("NORTH_SOUTH_PORT_PREPROCESSOR",ct++,()=>new Ph);gt.BREAKING_POINT_PROCESSOR=new at("BREAKING_POINT_PROCESSOR",ct++,()=>new Qh);gt.ONE_SIDED_GREEDY_SWITCH=new at("ONE_SIDED_GREEDY_SWITCH",ct++,()=>new ci(oe.ONE_SIDED_GREEDY_SWITCH));gt.TWO_SIDED_GREEDY_SWITCH=new at("TWO_SIDED_GREEDY_SWITCH",ct++,()=>new ci(oe.TWO_SIDED_GREEDY_SWITCH));gt.SELF_LOOP_PORT_RESTORER=new at("SELF_LOOP_PORT_RESTORER",ct++,()=>new xh);gt.ALTERNATING_LAYER_UNZIPPER=new at("ALTERNATING_LAYER_UNZIPPER",ct++,()=>new $h);gt.SINGLE_EDGE_GRAPH_WRAPPER=new at("SINGLE_EDGE_GRAPH_WRAPPER",ct++,()=>new xs);gt.IN_LAYER_CONSTRAINT_PROCESSOR=new at("IN_LAYER_CONSTRAINT_PROCESSOR",ct++,()=>new sh);gt.END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR=new at("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR",ct++,()=>new el(!1));gt.LABEL_AND_NODE_SIZE_PROCESSOR=new at("LABEL_AND_NODE_SIZE_PROCESSOR",ct++,()=>new ch);gt.INNERMOST_NODE_MARGIN_CALCULATOR=new at("INNERMOST_NODE_MARGIN_CALCULATOR",ct++,()=>new nh);gt.SELF_LOOP_ROUTER=new at("SELF_LOOP_ROUTER",ct++,()=>new Xh);gt.COMMENT_NODE_MARGIN_CALCULATOR=new at("COMMENT_NODE_MARGIN_CALCULATOR",ct++,()=>new wg);gt.END_LABEL_PREPROCESSOR=new at("END_LABEL_PREPROCESSOR",ct++,()=>new In);gt.LABEL_DUMMY_SWITCHER=new at("LABEL_DUMMY_SWITCHER",ct++,()=>new tl);gt.CENTER_LABEL_MANAGEMENT_PROCESSOR=new at("CENTER_LABEL_MANAGEMENT_PROCESSOR",ct++,()=>new el(!0));gt.LABEL_SIDE_SELECTOR=new at("LABEL_SIDE_SELECTOR",ct++,()=>new dh);gt.HYPEREDGE_DUMMY_MERGER=new at("HYPEREDGE_DUMMY_MERGER",ct++,()=>new rh);gt.HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR=new at("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR",ct++,()=>new Jg);gt.LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR=new at("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR",ct++,()=>new ph);gt.HIERARCHICAL_PORT_POSITION_PROCESSOR=new at("HIERARCHICAL_PORT_POSITION_PROCESSOR",ct++,()=>new Qg);gt.CONSTRAINTS_POSTPROCESSOR=new at("CONSTRAINTS_POSTPROCESSOR",ct++,()=>new Gg);gt.COMMENT_POSTPROCESSOR=new at("COMMENT_POSTPROCESSOR",ct++,()=>new Mg);gt.HYPERNODE_PROCESSOR=new at("HYPERNODE_PROCESSOR",ct++,()=>new ih);gt.HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER=new at("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER",ct++,()=>new qg);gt.LONG_EDGE_JOINER=new at("LONG_EDGE_JOINER",ct++,()=>new ii);gt.SELF_LOOP_POSTPROCESSOR=new at("SELF_LOOP_POSTPROCESSOR",ct++,()=>new Dh);gt.BREAKING_POINT_REMOVER=new at("BREAKING_POINT_REMOVER",ct++,()=>new td);gt.NORTH_SOUTH_PORT_POSTPROCESSOR=new at("NORTH_SOUTH_PORT_POSTPROCESSOR",ct++,()=>new mh);gt.HORIZONTAL_COMPACTOR=new at("HORIZONTAL_COMPACTOR",ct++,()=>new ke);gt.LABEL_DUMMY_REMOVER=new at("LABEL_DUMMY_REMOVER",ct++,()=>new hh);gt.FINAL_SPLINE_BENDPOINTS_CALCULATOR=new at("FINAL_SPLINE_BENDPOINTS_CALCULATOR",ct++,()=>new Kg);gt.END_LABEL_SORTER=new at("END_LABEL_SORTER",ct++,()=>new Ug);gt.REVERSED_EDGE_RESTORER=new at("REVERSED_EDGE_RESTORER",ct++,()=>new Rh);gt.END_LABEL_POSTPROCESSOR=new at("END_LABEL_POSTPROCESSOR",ct++,()=>new vg);gt.HIERARCHICAL_NODE_RESIZER=new at("HIERARCHICAL_NODE_RESIZER",ct++,()=>new jg);gt.DIRECTION_POSTPROCESSOR=new at("DIRECTION_POSTPROCESSOR",ct++,()=>new wn($o.TO_INTERNAL_LTR));var bd=class n{getLayoutProcessorConfiguration(t){let e=K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER),o=t.getProperty(p.GRAPH_PROPERTIES);return o&&o.has(v.NON_FREE_PORTS)&&e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}process(t,e){e&&e.begin&&e.begin("Interactive crossing minimization",1);let o=0;for(let a of t.getLayers())a.id=o++;let r=t.toNodeArray(),i=new Qn(r.length);ud.init([i],r);let s=0;o=0;for(let a of t.getLayers()){let l=0,c=0;for(let d of a.getNodes()){d.getPosition().x>0&&(l+=d.getPosition().x+d.getSize().x/2,c++);for(let f of d.getPorts())f.id=s++}c>0&&(l/=c);let g=new Array(a.getNodes().length),h=0;for(let d of a.getNodes())d.id=h++,g[d.id]=n._getPos(d,l),d.getType()===y.LONG_EDGE&&d.setProperty(p.ORIGINAL_DUMMY_NODE_POSITION,g[d.id]);a.getNodes().sort((d,f)=>{let E=g[d.id]-g[f.id];if(E!==0)return E;let P=d.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS),S=f.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS);return P&&P.includes(f)?-1:S&&S.includes(d)?1:0}),i.distributePortsWhileSweeping(r,o,!0),o++}e&&e.done&&e.done()}static _getPos(t,e){if(t.getType()===y.LONG_EDGE){let o=t.getProperty(p.ORIGIN),r=o.getProperty(p.ORIGINAL_BENDPOINTS);r==null?r=new st:o.getProperty(p.REVERSED)&&(r=st.reverse(r));let i=t.getProperty(p.LONG_EDGE_SOURCE);if(i!=null){let a=i.getAbsoluteAnchor();if(e<=a.x)return a.y;r.addFirst(a)}let s=t.getProperty(p.LONG_EDGE_TARGET);if(s!=null){let a=s.getAbsoluteAnchor();if(a.x<=e)return a.y;r.addLast(a)}if(r.length>=2){let a=0,l=r[a++],c=r[a++];for(;c.x<e&&a<r.length;)l=c,c=r[a++];return l.y+(e-l.x)/(c.x-l.x)*(c.y-l.y)}}else if(t.getType()===y.NORTH_SOUTH_PORT){let o=t.getPorts()[0].getProperty(p.ORIGIN),r=o.getNode();if(o.getSide()===u.NORTH)return r.getPosition().y;if(o.getSide()===u.SOUTH)return r.getPosition().y+r.getSize().y}return t.getInteractiveReferencePoint().y}};var Gd=class{process(t,e){e.begin("No crossing minimization",1),e.done()}getLayoutProcessorConfiguration(t){let e=K.createFrom(bI);return e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}},bI=K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER);var We=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.LAYER_SWEEP:return new ci(oe.BARYCENTER);case n.MEDIAN_LAYER_SWEEP:return new ci(oe.MEDIAN);case n.INTERACTIVE:return new bd;case n.NONE:return new Gd;default:throw new Error("Unknown crossing minimization strategy: "+this.name)}}static valueOf(t){return n[t]}};We.LAYER_SWEEP=new We("LAYER_SWEEP");We.MEDIAN_LAYER_SWEEP=new We("MEDIAN_LAYER_SWEEP");We.INTERACTIVE=new We("INTERACTIVE");We.NONE=new We("NONE");var ta=class{constructor(){this._indeg=null,this._outdeg=null,this._mark=null,this._sources=[],this._sinks=[],this.layeredGraph=null,this._random=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Greedy cycle removal",1),this.layeredGraph=t;let o=t.getLayerlessNodes(),r=o.length;this._indeg=new Array(r).fill(0),this._outdeg=new Array(r).fill(0),this._mark=new Array(r).fill(0);let i=0;for(let g of o){g.id=i;for(let h of g.getPorts()){for(let d of h.getIncomingEdges()){if(d.getSource().getNode()===g)continue;let f=d.getProperty(_.PRIORITY_DIRECTION);this._indeg[i]+=f>0?f+1:1}for(let d of h.getOutgoingEdges()){if(d.getTarget().getNode()===g)continue;let f=d.getProperty(_.PRIORITY_DIRECTION);this._outdeg[i]+=f>0?f+1:1}}this._outdeg[i]===0?this._sinks.push(g):this._indeg[i]===0&&this._sources.push(g),i++}let s=-1,a=1,l=[];for(this._random=t.getProperty(p.RANDOM);r>0;){for(;this._sinks.length>0;){let g=this._sinks.shift();this._mark[g.id]=s--,this._updateNeighbors(g),r--}for(;this._sources.length>0;){let g=this._sources.shift();this._mark[g.id]=a++,this._updateNeighbors(g),r--}if(r>0){let g=Number.MIN_SAFE_INTEGER;l.length=0;for(let d of o)if(this._mark[d.id]===0){let f=this._outdeg[d.id]-this._indeg[d.id];f>=g&&(f>g&&(l.length=0,g=f),l.push(d))}let h=this.chooseNodeWithMaxOutflow(l);this._mark[h.id]=a++,this._updateNeighbors(h),r--}}let c=o.length+1;for(let g=0;g<o.length;g++)this._mark[g]<0&&(this._mark[g]+=c);for(let g of o){let h=z.toPortArray(g.getPorts());for(let d of h){let f=z.toEdgeArray(d.getOutgoingEdges());for(let E of f){let P=E.getTarget().getNode().id;this._mark[g.id]>this._mark[P]&&(E.reverse(t,!0),t.setProperty(p.CYCLIC,!0))}}}this._dispose(),e.done()}chooseNodeWithMaxOutflow(t){let e=this._random!=null?this._random.nextInt(t.length):Math.floor(Math.random()*t.length);return t[e]}_dispose(){this._indeg=null,this._outdeg=null,this._mark=null,this._sources.length=0,this._sinks.length=0}_updateNeighbors(t){for(let e of t.getPorts())for(let o of e.getConnectedEdges()){let r=o.getSource()===e?o.getTarget():o.getSource(),i=r.getNode();if(t===i)continue;let s=o.getProperty(_.PRIORITY_DIRECTION);s<0&&(s=0);let a=i.id;this._mark[a]===0&&(o.getTarget()===r?(this._indeg[a]-=s+1,this._indeg[a]<=0&&this._outdeg[a]>0&&this._sources.push(i)):(this._outdeg[a]-=s+1,this._outdeg[a]<=0&&this._indeg[a]>0&&this._sinks.push(i)))}}};var Hd=class{constructor(){this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Depth-first cycle removal",1);let o=t.getLayerlessNodes(),r=o.length;this._sources=[],this._visited=new Array(r).fill(!1),this._active=new Array(r).fill(!1),this._edgesToBeReversed=[];let i=0;for(let s of o){s.id=i;let a=!1;for(let l of s.getIncomingEdges()){a=!0;break}a||this._sources.push(s),i++}for(let s of this._sources)this._dfs(s);for(let s=0;s<r;s++)this._visited[s]||this._dfs(o[s]);for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,e.done()}_dfs(t){if(!this._visited[t.id]){this._visited[t.id]=!0,this._active[t.id]=!0;for(let e of t.getOutgoingEdges()){if(e.isSelfLoop())continue;let o=e.getTarget().getNode();this._active[o.id]?this._edgesToBeReversed.push(e):this._dfs(o)}this._active[t.id]=!1}}};var vd=class{constructor(){this._revEdges=[]}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.INTERACTIVE_EXTERNAL_PORT_POSITIONER).addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Interactive cycle breaking",1);let o=[];for(let r of t.getLayerlessNodes()){r.id=1;let i=r.getInteractiveReferencePoint().x;for(let s of r.getPorts(W.OUTPUT))for(let a of s.getOutgoingEdges()){let l=a.getTarget().getNode();l!==r&&l.getInteractiveReferencePoint().x<i&&o.push(a)}}for(let r of o)r.reverse(t,!0);o.length=0;for(let r of t.getLayerlessNodes())r.id>0&&this._findCycles(r,o);for(let r of o)r.reverse(t,!0);o.length=0,e.done()}_findCycles(t,e){t.id=-1;for(let o of t.getPorts(W.OUTPUT))for(let r of o.getOutgoingEdges()){let i=r.getTarget().getNode();t!==i&&(i.id<0?e.push(r):i.id>0&&this._findCycles(i,e))}t.id=0}};var or=class{constructor(){this._firstSeparateNodes=0,this._lastSeparateNodes=0}computeConstraintModelOrder(t,e){let o=0;switch(t.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST_SEPARATE:o=2*-e+this._firstSeparateNodes,this._firstSeparateNodes++;break;case J.FIRST:o=-e;break;case J.LAST:o=e;break;case J.LAST_SEPARATE:o=2*e+this._lastSeparateNodes,this._lastSeparateNodes++;break;default:break}return t.hasProperty(p.MODEL_ORDER)&&(o+=t.getProperty(p.MODEL_ORDER)),o}computeConstraintGroupModelOrder(t,e,o){let r=0;switch(t.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST_SEPARATE:r=2*-e+this._firstSeparateNodes,this._firstSeparateNodes++;break;case J.FIRST:r=-e;break;case J.LAST:r=e;break;case J.LAST_SEPARATE:r=2*e+this._lastSeparateNodes,this._lastSeparateNodes++;break;default:break}return t.hasProperty(p.MODEL_ORDER)&&(r+=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)*o+t.getProperty(p.MODEL_ORDER)),r}resetInternalCounters(){this._firstSeparateNodes=0,this._lastSeparateNodes=0}};var Bd=class{getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Model order cycle breaking",1);let o=[],r=Math.max(t.getLayerlessNodes().length,t.getProperty(p.MAX_MODEL_ORDER_NODES)),i=r*t.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),s=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;for(let a of t.getLayerlessNodes()){let l=new or,c=s?l.computeConstraintGroupModelOrder(a,i,r):l.computeConstraintModelOrder(a,r);for(let g of a.getPorts(W.OUTPUT))for(let h of g.getOutgoingEdges()){let d=h.getTarget().getNode();(s?l.computeConstraintGroupModelOrder(d,i,r):l.computeConstraintModelOrder(d,r))<c&&o.push(h)}}for(let a of o)a.reverse(t,!0),t.setProperty(p.CYCLIC,!0);o.length=0,e.done()}};var Ud=class extends ta{chooseNodeWithMaxOutflow(t){let e=null,o=Number.MAX_SAFE_INTEGER,r=Math.max(this.layeredGraph.getLayerlessNodes().length,this.layeredGraph.getProperty(p.MAX_MODEL_ORDER_NODES)),i=r*this.layeredGraph.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),s=new or,a=this.layeredGraph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;for(let l of t)if(l.hasProperty(p.MODEL_ORDER)){let c=a?s.computeConstraintGroupModelOrder(l,i,r):s.computeConstraintModelOrder(l,r);o>c&&(o=c,e=l)}return e==null?super.chooseNodeWithMaxOutflow(t):e}};var Fd=class{constructor(t,e,o){this._edgesToBeReversed=t,this.stronglyConnectedComponents=e,this._nodeToSCCID=o,this._index=0,this._stack=[]}tarjan(t){this._index=0,this._stack.length=0;for(let e of t.getLayerlessNodes())e.getProperty(p.TARJAN_ID)===-1&&(this._stronglyConnected(e),this._stack.length=0)}_stronglyConnected(t){t.setProperty(p.TARJAN_ID,this._index),t.setProperty(p.TARJAN_LOWLINK,this._index),this._index++,this._stack.push(t),t.setProperty(p.TARJAN_ON_STACK,!0);for(let e of t.getConnectedEdges()){let o=this._edgesToBeReversed.includes(e);if(e.getSource().getNode()!==t&&!o||e.getSource().getNode()===t&&o)continue;let r=e.getTarget().getNode()===t?e.getSource().getNode():e.getTarget().getNode();r.getProperty(p.TARJAN_ID)===-1?(this._stronglyConnected(r),t.setProperty(p.TARJAN_LOWLINK,Math.min(t.getProperty(p.TARJAN_LOWLINK),r.getProperty(p.TARJAN_LOWLINK)))):r.getProperty(p.TARJAN_ON_STACK)&&t.setProperty(p.TARJAN_LOWLINK,Math.min(t.getProperty(p.TARJAN_LOWLINK),r.getProperty(p.TARJAN_ID)))}if(t.getProperty(p.TARJAN_LOWLINK)===t.getProperty(p.TARJAN_ID)){let e=new Set,o=null;do o=this._stack.pop(),o.setProperty(p.TARJAN_ON_STACK,!1),e.add(o);while(t!==o);if(e.size>1){let r=this.stronglyConnectedComponents.length;this.stronglyConnectedComponents.push(e);for(let i of e)this._nodeToSCCID.set(i,r)}}}resetTarjan(t){for(let e of t.getLayerlessNodes()){e.setProperty(p.TARJAN_ON_STACK,!1),e.setProperty(p.TARJAN_LOWLINK,-1),e.setProperty(p.TARJAN_ID,-1),this._stack.length=0;for(let o of e.getConnectedEdges())o.setProperty(p.IS_PART_OF_CYCLE,!1)}}};var ea=class{constructor(){this.stronglyConnectedComponents=[],this.nodeToSCCID=new Map,this.revEdges=[],this.graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Model order cycle breaking",1),this.graph=t,this.revEdges=[];let o=Math.max(t.getLayerlessNodes().length,t.getProperty(p.MAX_MODEL_ORDER_NODES)),r=o*t.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),i=t.getLayerlessNodes().length*4+16,s=0;for(;;){if(s++>i)throw new Error("SCCModelOrderCycleBreaker: too many iterations \u2014 findNodes() is not breaking SCCs");let a=new Fd(this.revEdges,this.stronglyConnectedComponents,this.nodeToSCCID);if(a.resetTarjan(t),a.tarjan(t),this.stronglyConnectedComponents.length===0)break;this.findNodes(o,r);for(let l of this.revEdges){l.reverse(t,!1);let c=l.getSource().getNode();c.setProperty(_.LAYERING_LAYER_ID,c.getProperty(_.LAYERING_LAYER_ID)+1),t.setProperty(p.CYCLIC,!0)}this.stronglyConnectedComponents.length=0,this.nodeToSCCID.clear(),this.revEdges.length=0}e.done()}findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=null,i=new or,s=Number.MIN_SAFE_INTEGER;for(let a of this.stronglyConnectedComponents[o]){let l=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;if(r==null)r=a,s=l?i.computeConstraintGroupModelOrder(a,e,t):i.computeConstraintModelOrder(a,t);else{let c=l?i.computeConstraintGroupModelOrder(a,e,t):i.computeConstraintModelOrder(a,t);s<c&&(r=a,s=c)}}for(let a of r.getOutgoingEdges())this.stronglyConnectedComponents[o].has(a.getTarget().getNode())&&this.revEdges.push(a)}}};var kd=class extends ea{findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=this.stronglyConnectedComponents[o];if(r.size<=1)continue;let i=null,s=null,a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,g=new or;for(let h of r)if(i==null||s==null)i=h,a=c?g.computeConstraintGroupModelOrder(h,e,t):g.computeConstraintModelOrder(h,t),s=h,l=a;else{let d=c?g.computeConstraintGroupModelOrder(h,e,t):g.computeConstraintModelOrder(h,t);a>d&&(i=h,a=d),l<d&&(s=h,l=d)}if(WP(i.getIncomingEdges())>WP(s.getOutgoingEdges()))for(let h of i.getIncomingEdges())r.has(h.getSource().getNode())&&this.revEdges.push(h);else for(let h of s.getOutgoingEdges())r.has(h.getTarget().getNode())&&this.revEdges.push(h)}}};function WP(n){let t=0;for(let e of n)t++;return t}var Wd=class extends ea{findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=this.stronglyConnectedComponents[o];if(r.size<=1)continue;let i=null,s=null,a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,g=new or;for(let P of r)if(i==null||s==null)i=P,a=c?g.computeConstraintGroupModelOrder(P,e,t):g.computeConstraintModelOrder(P,t),s=P,l=a;else{let S=c?g.computeConstraintGroupModelOrder(P,e,t):g.computeConstraintModelOrder(P,t);a>S&&(i=P,a=S),l<S&&(s=P,l=S)}let h=i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID),d=s.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID),f=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_SOURCE_ID),E=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_TARGET_ID);if(h===f)for(let P of i.getIncomingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else if(d===E)for(let P of s.getOutgoingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else if(zP(i.getIncomingEdges())>zP(s.getOutgoingEdges()))for(let P of i.getIncomingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else for(let P of s.getOutgoingEdges())r.has(P.getTarget().getNode())&&this.revEdges.push(P)}}};function zP(n){let t=0;for(let e of n)t++;return t}var zd=class{constructor(){this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,this._graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Depth-first cycle removal",1),this._graph=t;let o=t.getLayerlessNodes(),r=o.length;this._sources=[],this._visited=new Array(r).fill(!1),this._active=new Array(r).fill(!1),this._edgesToBeReversed=[];let i=0;for(let s of o){s.id=i;let a=!1;for(let l of s.getIncomingEdges()){a=!0;break}a||this._sources.push(s),i++}for(let s of this._sources)this._dfs(s);for(let s=0;s<r;s++)this._visited[s]||this._dfs(o[s]);for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,e.done()}_dfs(t){if(this._visited[t.id])return;this._visited[t.id]=!0,this._active[t.id]=!0;let e=new Map,o=this._graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,r=Number.MAX_SAFE_INTEGER;for(let s of t.getOutgoingEdges()){let a=s.getTarget().getNode();if(!a.hasProperty(p.MODEL_ORDER))e.set(r--,new Set([s]));else{let l;o?l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES)*a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)+a.getProperty(p.MODEL_ORDER):l=a.getProperty(p.MODEL_ORDER);let c=e.get(l);c?c.add(s):e.set(l,new Set([s]))}}let i=[...e.keys()].sort((s,a)=>s-a);for(let s of i){let a=e.get(s),l=a.values().next().value;if(l.isSelfLoop())continue;let c=l.getTarget().getNode();if(this._active[c.id])for(let g of a)this._edgesToBeReversed.push(g);else this._dfs(c)}this._active[t.id]=!1}};var Yd=class{constructor(){this._sources=null,this._sinks=null,this._visited=null,this._bfsQueue=null,this._edgesToBeReversed=null,this._graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Breadth-first cycle removal",1),this._graph=t;let o=t.getLayerlessNodes();this._bfsQueue=[],this._sources=new Set,this._sinks=new Set,this._visited=new Array(o.length).fill(!1),this._edgesToBeReversed=[];let r=0;for(let s of o){s.id=r;let a=!1;for(let c of s.getIncomingEdges()){a=!0;break}a||this._sources.add(s);let l=!1;for(let c of s.getOutgoingEdges()){l=!0;break}l||this._sinks.add(s),r++}for(let s of this._sources)this._bfsQueue.push(s),this._bfsLoop();this._bfsLoop();let i=!0;for(;i;){i=!1;for(let s=0;s<o.length;s++)if(!this._visited[s]){this._bfsQueue.push(o[s]),i=!0;break}this._bfsLoop()}for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._sinks=null,this._visited=null,this._bfsQueue=null,this._edgesToBeReversed=null,e.done()}_bfsLoop(){for(;this._bfsQueue.length>0;)this._bfs(this._bfsQueue.shift())}_bfs(t){if(this._visited[t.id])return;this._visited[t.id]=!0;let e=new Map,o=this._graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,r=Number.MAX_SAFE_INTEGER;for(let s of t.getOutgoingEdges()){let a=s.getTarget().getNode();if(!a.hasProperty(p.MODEL_ORDER))e.set(r--,new Set([s]));else{let l;o?l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES)*a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)+a.getProperty(p.MODEL_ORDER):l=a.getProperty(p.MODEL_ORDER);let c=e.get(l);c?c.add(s):e.set(l,new Set([s]))}}let i=[...e.keys()].sort((s,a)=>s-a);for(let s of i){let a=e.get(s),l=a.values().next().value;if(l.isSelfLoop())continue;let c=l.getTarget().getNode();if(this._visited[c.id]&&!this._sources.has(t)&&!this._sinks.has(c))for(let g of a)this._edgesToBeReversed.push(g);else this._bfsQueue.push(c)}}};var Xt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}create(){switch(this){case n.GREEDY:return new ta;case n.DEPTH_FIRST:return new Hd;case n.INTERACTIVE:return new vd;case n.MODEL_ORDER:return new Bd;case n.GREEDY_MODEL_ORDER:return new Ud;case n.SCC_CONNECTIVITY:return new kd;case n.SCC_NODE_TYPE:return new Wd;case n.DFS_NODE_ORDER:return new zd;case n.BFS_NODE_ORDER:return new Yd;default:throw new Error(`Unknown cycle breaker strategy ${this.name}`)}}toString(){return this.name}static valueOf(t){return n[t]}};Xt.GREEDY=new Xt("GREEDY",0);Xt.DEPTH_FIRST=new Xt("DEPTH_FIRST",1);Xt.INTERACTIVE=new Xt("INTERACTIVE",2);Xt.MODEL_ORDER=new Xt("MODEL_ORDER",3);Xt.GREEDY_MODEL_ORDER=new Xt("GREEDY_MODEL_ORDER",4);Xt.SCC_CONNECTIVITY=new Xt("SCC_CONNECTIVITY",5);Xt.SCC_NODE_TYPE=new Xt("SCC_NODE_TYPE",6);Xt.DFS_NODE_ORDER=new Xt("DFS_NODE_ORDER",7);Xt.BFS_NODE_ORDER=new Xt("BFS_NODE_ORDER",8);var Vd=class{constructor(){this._layeredGraph=null,this._nodeHeights=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Longest path layering",1),this._layeredGraph=t;let o=t.getLayerlessNodes();this._nodeHeights=new Int32Array(o.length);for(let r=0;r<o.length;r++)o[r].id=r,this._nodeHeights[r]=-1;for(let r of o)this._visit(r);o.length=0,this._layeredGraph=null,this._nodeHeights=null,e.done()}_visit(t){let e=this._nodeHeights[t.id];if(e>=0)return e;let o=1;for(let r of t.getPorts())for(let i of r.getOutgoingEdges()){let s=i.getTarget().getNode();if(t!==s){let a=this._visit(s);a+1>o&&(o=a+1)}}return this._putNode(t,o),o}_putNode(t,e){let o=this._layeredGraph.getLayers();for(;o.length<e;)o.unshift(new Et(this._layeredGraph));t.setLayer(o[o.length-e]),this._nodeHeights[t.id]=e}};var Xd=class{constructor(){this._layeredGraph=null,this._nodeHeights=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Longest path to source layering",1),this._layeredGraph=t;let o=t.getLayerlessNodes();this._nodeHeights=new Int32Array(o.length);for(let r=0;r<o.length;r++)o[r].id=r,this._nodeHeights[r]=-1;for(let r of o)this._visit(r);o.length=0,this._layeredGraph=null,this._nodeHeights=null,e.done()}_visit(t){let e=this._nodeHeights[t.id];if(e>=0)return e;let o=1;for(let r of t.getPorts())for(let i of r.getIncomingEdges()){let s=i.getSource().getNode();if(t!==s){let a=this._visit(s);a+1>o&&(o=a+1)}}return this._putNode(t,o),o}_putNode(t,e){let o=this._layeredGraph.getLayers();for(;o.length<e;)o.push(new Et(this._layeredGraph));t.setLayer(o[e-1]),this._nodeHeights[t.id]=e}};var Bo=class extends Error{constructor(t,e){super(t),this.name="UnsupportedGraphException",e&&(this.cause=e)}};var Kd=class{constructor(){this._layeredGraph=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Breadth first model order layering",1),this._layeredGraph=t;let o=[];for(let l of t.getLayerlessNodes())l.getType()===y.NORMAL&&o.push(l);o.sort((l,c)=>{if(l.hasProperty(p.MODEL_ORDER)&&c.hasProperty(p.MODEL_ORDER)){let g=l.getProperty(p.MODEL_ORDER),h=c.getProperty(p.MODEL_ORDER);return g-h}throw new Bo("The BF model order layer assigner requires all real nodes to have a model order.")});let r=!0,i=new Et(t),s=null;t.getLayers().push(i);for(let l of o)if(r)l.setLayer(i),r=!1;else{for(let c of l.getIncomingEdges()){let g=c.getSource().getNode(),h=g.getType()===y.NORMAL&&g.getLayer()===i,d=!1;if(g.getType()===y.LABEL){let f=g.getIncomingEdges().next().value;f!=null&&f.getSource().getNode().getLayer()===i&&(d=!0)}if(h||d){s=new Et(t),t.getLayers().push(s),i=new Et(t),t.getLayers().push(i);break}}for(let c of l.getIncomingEdges()){let g=c.getSource().getNode();g.getType()===y.LABEL&&g.getLayer()==null&&g.setLayer(s)}l.setLayer(i)}t.getLayerlessNodes().length=0;let a=t.getLayers();for(let l=a.length-1;l>=0;l--)a[l].getNodes().length===0&&a.splice(l,1);for(let l=0;l<a.length;l++)a[l].id=l;e.done()}};var Zd=class{getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.INTERACTIVE_EXTERNAL_PORT_POSITIONER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Interactive node layering",1);let o=[];for(let s of t.getLayerlessNodes()){let a=s.getPosition().x,l=Math.max(a+1,a+s.getSize().x),c=null,g=0;for(;g<o.length;){let h=o[g];if(h.start>=l)break;if(h.end>a)if(c==null)h.nodes.push(s),h.start=Math.min(h.start,a),h.end=Math.max(h.end,l),c=h,g++;else{for(let d of h.nodes)c.nodes.push(d);c.end=Math.max(c.end,h.end),o.splice(g,1)}else g++}c==null&&o.splice(g,0,{start:a,end:l,nodes:[s]})}let r=t.getLayers(),i=0;for(let s of o){let a=new Et(t);a.id=i++,r.push(a);for(let l of s.nodes)l.setLayer(a),l.id=0}for(let s of t.getLayerlessNodes())if(s.id===0){let a=this._checkNode(s,t);for(;a.size>0;){let l=a.values().next().value;a.delete(l);let c=this._checkNode(l,t);for(let g of c)a.add(g)}}for(let s=r.length-1;s>=0;s--)r[s].getNodes().length===0&&r.splice(s,1);t.getLayerlessNodes().length=0,e.done()}_checkNode(t,e){t.id=1;let o=t.getLayer(),r=new Set;for(let i of t.getPorts(W.OUTPUT))for(let s of i.getOutgoingEdges()){let a=s.getTarget().getNode();if(t!==a&&a.getLayer().id<=o.id){let c=o.id+1;if(c===e.getLayers().length){let g=new Et(e);g.id=c,e.getLayers().push(g),a.setLayer(g)}else a.setLayer(e.getLayers()[c]);r.add(a)}}return r}};var jd=class{constructor(){this._nodeMark=null,this._edgeMark=null,this._inDeg=null,this._outDeg=null,this._topoOrd=null,this._inTopo=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){if(e.begin("Coffman-Graham Layering",1),t.getLayerlessNodes().length===0){e.done();return}let o=t.getProperty(_.LAYERING_COFFMAN_GRAHAM_LAYER_BOUND),r=0,i=0;for(let d of t.getLayerlessNodes()){d.id=r++;for(let f of d.getOutgoingEdges())f.id=i++}this._nodeMark=new Array(r).fill(!1),this._edgeMark=new Array(i).fill(!1),this._inDeg=new Int32Array(r),this._outDeg=new Int32Array(r),this._topoOrd=new Int32Array(r),this._inTopo=new Map,this._transitiveReduction(t);let s=[];for(let d of t.getLayerlessNodes()){for(let f of d.getIncomingEdges())this._edgeMark[f.id]||this._inDeg[d.id]++;this._inDeg[d.id]===0&&s.push(d)}let a=0;for(;s.length>0;){s.sort((f,E)=>this._compareNodesInTopo(f,E));let d=s.shift();this._topoOrd[d.id]=a++;for(let f of d.getOutgoingEdges()){if(this._edgeMark[f.id])continue;let E=f.getTarget().getNode();this._inDeg[E.id]--,this._pushInTopo(E,this._topoOrd[d.id]),this._inDeg[E.id]===0&&s.push(E)}}let l=[];for(let d of t.getLayerlessNodes()){for(let f of d.getOutgoingEdges())this._edgeMark[f.id]||this._outDeg[d.id]++;this._outDeg[d.id]===0&&l.push(d)}let c=(d,f)=>-(this._topoOrd[d.id]-this._topoOrd[f.id]),g=[],h=this._createLayer(t,g);for(;l.length>0;){l.sort(c);let d=l.shift();(this._isLayerFull(h,o)||!this._canAdd(d,h))&&(h=this._createLayer(t,g)),d.setLayer(h);for(let f of d.getIncomingEdges()){if(this._edgeMark[f.id])continue;let E=f.getSource().getNode();this._outDeg[E.id]--,this._outDeg[E.id]===0&&l.push(E)}}for(let d=g.length-1;d>=0;d--)t.getLayers().push(g[d]);t.getLayerlessNodes().length=0,e.done()}_pushInTopo(t,e){let o=this._inTopo.get(t);o?o.push(e):this._inTopo.set(t,[e])}_isLayerFull(t,e){return t.getNodes().length>=e}_canAdd(t,e){for(let o of t.getOutgoingEdges())if(o.getTarget().getNode().getLayer()===e)return!1;return!0}_createLayer(t,e){let o=new Et(t);return e.push(o),o}_compareNodesInTopo(t,e){let o=this._inTopo.get(t)||[],r=this._inTopo.get(e)||[],i=o.length-1,s=r.length-1;for(;i>=0&&s>=0;){let a=o[i--],l=r[s--];if(a!==l)return a-l}return i<0&&s<0?t.id<e.id?-1:t.id>e.id?1:0:i<0?-1:1}_transitiveReduction(t){for(let e of t.getLayerlessNodes()){this._nodeMark.fill(!1);for(let o of e.getOutgoingEdges())this._dfs(e,o.getTarget().getNode())}}_dfs(t,e){if(!this._nodeMark[e.id]){for(let o of e.getOutgoingEdges()){let r=o.getTarget().getNode();for(let i of r.getIncomingEdges())i.getSource().getNode()===t&&(this._edgeMark[i.id]=!0);this._dfs(t,r)}this._nodeMark[e.id]=!0}}};var $d=class{constructor(){this._layeredGraph=null,this._componentNodes=null,this._nodeVisited=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Network simplex layering",1),this._layeredGraph=t;let o=t.getProperty(_.THOROUGHNESS)*GI,r=t.getLayerlessNodes();if(r.length<1){e.done();return}let i=this._connectedComponents(r),s=null;for(let a of i){let l=o*Math.floor(Math.sqrt(a.length)),c=this._initialize(a);li.forGraph(c).withIterationLimit(l).withPreviousLayering(s).withBalancing(!0).execute(e.subTask(1));let g=t.getLayers();for(let h of c.nodes){for(;g.length<=h.layer;)g.push(new Et(t));h.origin.setLayer(g[h.layer])}if(i.length>1){s=new Array(g.length);for(let h=0;h<g.length;h++)s[h]=g[h].getNodes().length}}r.length=0,this._dispose(),e.done()}_connectedComponents(t){this._nodeVisited==null||this._nodeVisited.length<t.length?this._nodeVisited=new Array(t.length).fill(!1):this._nodeVisited.fill(!1),this._componentNodes=[];for(let o=0;o<t.length;o++)t[o].id=o;let e=[];for(let o of t)this._nodeVisited[o.id]||(this._connectedComponentsDFS(o),e.length===0||e[0].length<this._componentNodes.length?e.unshift(this._componentNodes):e.push(this._componentNodes),this._componentNodes=[]);return e}_connectedComponentsDFS(t){this._nodeVisited[t.id]=!0,this._componentNodes.push(t);for(let e of t.getPorts())for(let o of e.getConnectedEdges()){let r=this._getOpposite(e,o).getNode();this._nodeVisited[r.id]||this._connectedComponentsDFS(r)}}_initialize(t){let e=new Map,o=new Wi;for(let r of t){let i=He.of().origin(r).create(o);e.set(r,i)}for(let r of t)for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;let s=Math.max(1,i.getProperty(_.PRIORITY_SHORTNESS));te.of(i).weight(s).delta(1).source(e.get(i.getSource().getNode())).target(e.get(i.getTarget().getNode())).create()}return o}_dispose(){this._componentNodes=null,this._layeredGraph=null,this._nodeVisited=null}_getOpposite(t,e){if(e.getSource()===t)return e.getTarget();if(e.getTarget()===t)return e.getSource();throw new Error("Input edge is not connected to the input port.")}},GI=4;var qd=class{constructor(){this._layeredGraph=null,this._currentLayer=null,this._currentLayerId=0,this._currentDummyLayer=null,this._nodesToPlace=null,this._maxToPlace=0}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Depth first model order layering",1),this._layeredGraph=t;let o=[];for(let s of t.getLayerlessNodes())s.getType()===y.NORMAL&&o.push(s);o.sort((s,a)=>{if(s.hasProperty(p.MODEL_ORDER)&&a.hasProperty(p.MODEL_ORDER))return s.getProperty(p.MODEL_ORDER)-a.getProperty(p.MODEL_ORDER);throw new Bo("The DF model order layer assigner requires all real nodes to have a model order.")});let r=!0;this._currentLayer=new Et(t),this._currentDummyLayer=null,t.getLayers().push(this._currentLayer),this._currentLayer.id=0,this._currentLayerId=0,this._nodesToPlace=[];for(let s of o){if(r){s.setLayer(this._currentLayer),r=!1;continue}if(this._isConnectedToCurrentLayer(s)){let a=this._currentLayerId;a=this._getMaxConnectedLayer(a,s);let l=a+2,c=a-this._currentLayerId;if(this._nodesToPlace.length>0)if(c>0){for(let g of this._nodesToPlace)g.id+=a-this._maxToPlace;this._placeNodesToPlace(),this._nodesToPlace.length=0,this._addNodeToLayer(l,s)}else{this._nodesToPlace.push(s),s.id=l,l>this._maxToPlace&&(this._maxToPlace=l);for(let g of s.getIncomingEdges()){let h=g.getSource().getNode();h.getLayer()==null&&h.getType()===y.LABEL&&(this._nodesToPlace.push(h),h.id=l-1)}this._currentLayerId=l}else this._addNodeToLayer(l,s)}else if(this._placeNodesToPlace(),this._nodesToPlace.length=0,s.getIncomingEdges()[Symbol.iterator]().next().done)this._nodesToPlace.push(s),s.id=0,this._maxToPlace<0&&(this._maxToPlace=0),this._currentLayer=t.getLayers()[0],this._currentLayerId=0;else{let c=0;c=this._getMaxConnectedLayer(c,s);let g=c+2;this._addNodeToLayer(g,s)}}this._nodesToPlace.length>0&&this._placeNodesToPlace(),t.getLayerlessNodes().length=0;let i=t.getLayers();for(let s=i.length-1;s>=0;s--)i[s].getNodes().length===0&&i.splice(s,1);for(let s=0;s<i.length;s++)i[s].id=s;e.done()}_isConnectedToCurrentLayer(t){for(let e of t.getIncomingEdges()){let o=e.getSource().getNode(),r,i;if(this._nodesToPlace.length===0){r=o.getType()===y.NORMAL&&o.getLayer()!=null&&o.getLayer().id===this._currentLayerId;let a=o.getIncomingEdges()[Symbol.iterator]().next();if(a.done)i=!1;else{let l=a.value.getSource().getNode().getLayer();i=o.getType()===y.LABEL&&l!=null&&l.id===this._currentLayerId}}else{r=o.getType()===y.NORMAL&&o.id===this._currentLayerId;let a=o.getIncomingEdges()[Symbol.iterator]().next();i=o.getType()===y.LABEL&&!a.done&&a.value.getSource().getNode().id===this._currentLayerId}if(r||i)return!0}return!1}_addNodeToLayer(t,e){let o=this._layeredGraph.getLayers();t<o.length?(this._currentLayer=o[t],this._currentDummyLayer=o[t-1],this._currentLayerId=t):(this._currentDummyLayer=new Et(this._layeredGraph),this._currentDummyLayer.id=t-1,o.push(this._currentDummyLayer),this._currentLayer=new Et(this._layeredGraph),this._currentLayer.id=t,o.push(this._currentLayer),this._currentLayerId=t),e.setLayer(this._currentLayer);for(let r of e.getIncomingEdges()){let i=r.getSource().getNode();i.getLayer()==null&&i.getType()===y.LABEL&&i.setLayer(this._currentDummyLayer)}}_getMaxConnectedLayer(t,e){let o=t;for(let r of e.getIncomingEdges()){let i=r.getSource().getNode();i.getLayer()!=null&&i.getLayer().id>o&&(o=i.getLayer().id)}return o}_placeNodesToPlace(){this._maxToPlace=0;let t=this._layeredGraph.getLayers();for(let e of this._nodesToPlace){if(e.id>=t.length){let o=new Et(this._layeredGraph);o.id=e.id-1,t.push(o);let r=new Et(this._layeredGraph);r.id=e.id,t.push(r)}e.setLayer(t[e.id])}}};var Jd=class{constructor(){this._widthCurrent=0,this._widthUp=0,this._maxWidth=0,this._currentGraph=null,this._upperLayerInfluence=0,this._sortedLayerlessNodes=[],this._alreadyPlacedNodes=new Set,this._alreadyPlacedInOtherLayers=new Set,this._tempLayerlessNodes=[],this._successors=[],this._outDegree=null,this._remainingOutGoing=null,this._inDegree=null,this._selectedNode=null,this._minimumNodeSize=0,this._maximumNodeSize=0,this._normSize=null,this._dummySize=0}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){if(e.begin("StretchWidth layering",1),t.getLayerlessNodes().length===0){e.done();return}this._currentGraph=t,this._widthCurrent=0,this._widthUp=0,this._minimumNodeSize=Number.POSITIVE_INFINITY,this._maximumNodeSize=Number.NEGATIVE_INFINITY,this._dummySize=Number(t.getProperty(_.SPACING_EDGE_EDGE)),this._computeSortedNodes(),this._computeSuccessors(),this._computeDegrees(),this._minMaxNodeSize(),this._computeNormalizedSize(),this._minimumNodeSize=Math.max(1,this._minimumNodeSize),this._maximumNodeSize=Math.max(1,this._maximumNodeSize),this._dummySize/=this._minimumNodeSize,this._maxWidth=this._maximumNodeSize/this._minimumNodeSize,this._upperLayerInfluence=this._getAverageOutDegree();let o=new Et(this._currentGraph);for(this._currentGraph.getLayers().push(o),this._tempLayerlessNodes=this._sortedLayerlessNodes.slice(),this._remainingOutGoing=Int32Array.from(this._outDegree);this._tempLayerlessNodes.length>0;)if(this._selectedNode=this._selectNode(),this._selectedNode==null||this._conditionGoUp()&&this._alreadyPlacedNodes.size>0){this._updateOutGoing(o),o=new Et(this._currentGraph),this._currentGraph.getLayers().push(o);for(let r of this._alreadyPlacedNodes)this._alreadyPlacedInOtherLayers.add(r);this._alreadyPlacedNodes.clear(),this._widthCurrent=this._widthUp,this._widthUp=0}else if(this._conditionGoUp())this._currentGraph.getLayers().length=0,o=new Et(this._currentGraph),this._currentGraph.getLayers().push(o),this._widthCurrent=0,this._widthUp=0,this._alreadyPlacedNodes.clear(),this._alreadyPlacedInOtherLayers.clear(),this._maxWidth++,this._tempLayerlessNodes=this._sortedLayerlessNodes.slice(),this._remainingOutGoing=Int32Array.from(this._outDegree);else{this._selectedNode.setLayer(o);let r=this._tempLayerlessNodes.indexOf(this._selectedNode);r>=0&&this._tempLayerlessNodes.splice(r,1),this._alreadyPlacedNodes.add(this._selectedNode),this._widthCurrent=this._widthCurrent-this._outDegree[this._selectedNode.id]*this._dummySize+this._normSize[this._selectedNode.id],this._widthUp+=this._inDegree[this._selectedNode.id]*this._dummySize}t.getLayerlessNodes().length=0,t.getLayers().reverse(),e.done()}_conditionGoUp(){let t=this._widthCurrent-this._outDegree[this._selectedNode.id]*this._dummySize+this._normSize[this._selectedNode.id]>this._maxWidth,e=this._widthUp+this._inDegree[this._selectedNode.id]*this._dummySize>this._maxWidth*this._upperLayerInfluence*this._dummySize;return t||e}_selectNode(){for(let t of this._tempLayerlessNodes)if(this._remainingOutGoing[t.id]<=0)return t;return null}_computeSortedNodes(){let t=this._currentGraph.getLayerlessNodes();this._sortedLayerlessNodes=t.slice();for(let e of t)e.id=this._getRank(e);this._sortedLayerlessNodes.sort((e,o)=>o.id-e.id)}_getRank(t){let e=gl(t.getOutgoingEdges());for(let o of t.getIncomingEdges()){let r=o.getSource().getNode(),i=gl(r.getOutgoingEdges());i>e&&(e=i)}return e}_computeSuccessors(){let t=0;this._successors=[];let e=new Set;for(let o of this._sortedLayerlessNodes){o.id=t;for(let r of o.getOutgoingEdges())e.add(r.getTarget().getNode());e.delete(o),this._successors.push(new Set(e)),e.clear(),t++}}_computeDegrees(){let t=this._sortedLayerlessNodes.length;this._inDegree=new Int32Array(t),this._outDegree=new Int32Array(t);for(let e of this._sortedLayerlessNodes)this._inDegree[e.id]=gl(e.getIncomingEdges()),this._outDegree[e.id]=gl(e.getOutgoingEdges())}_minMaxNodeSize(){for(let t of this._sortedLayerlessNodes){if(t.getType()!==y.NORMAL)continue;let e=t.getSize().y;e<this._minimumNodeSize&&(this._minimumNodeSize=e),e>this._maximumNodeSize&&(this._maximumNodeSize=e)}}_computeNormalizedSize(){this._normSize=new Float64Array(this._sortedLayerlessNodes.length);for(let t of this._sortedLayerlessNodes)this._normSize[t.id]=t.getSize().y/this._minimumNodeSize}_getAverageOutDegree(){let t=0,e=this._currentGraph.getLayerlessNodes();for(let o of e)t+=gl(o.getOutgoingEdges());return e.length===0?0:t/e.length}_updateOutGoing(t){for(let e of t.getNodes())for(let o of e.getIncomingEdges()){let r=o.getSource().getNode().id;this._remainingOutGoing[r]--}}};function gl(n){let t=0;for(let e of n)t++;return t}var Qd=class{constructor(){this._dummySize=0,this._minimumNodeSize=0,this._normSize=null,this._avgSize=0,this._inDegree=null,this._outDegree=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("MinWidth layering",1);let o=t.getLayers(),r=t.getLayerlessNodes(),i=t.getProperty(_.LAYERING_MIN_WIDTH_UPPER_BOUND_ON_WIDTH),s=t.getProperty(_.LAYERING_MIN_WIDTH_UPPER_LAYER_ESTIMATION_SCALING_FACTOR);this._dummySize=Number(t.getProperty(_.SPACING_EDGE_EDGE)),this._minimumNodeSize=Number.POSITIVE_INFINITY;for(let T of r){if(T.getType()!==y.NORMAL)continue;let N=T.getSize().y;N<this._minimumNodeSize&&(this._minimumNodeSize=N)}this._minimumNodeSize=Math.max(1,this._minimumNodeSize);let a=r.length;this._inDegree=new Int32Array(a),this._outDegree=new Int32Array(a),this._normSize=new Float64Array(a);let l=0;this._avgSize=0;for(let T of r)T.id=l++,this._inDegree[T.id]=this._countEdgesExceptSelfLoops(T.getIncomingEdges()),this._outDegree[T.id]=this._countEdgesExceptSelfLoops(T.getOutgoingEdges()),this._normSize[T.id]=T.getSize().y/this._minimumNodeSize,this._avgSize+=this._normSize[T.id];this._dummySize/=this._minimumNodeSize,a>0&&(this._avgSize/=a);let c=this._precalcSuccessors(r);r.sort((T,N)=>this._outDegree[N.id]-this._outDegree[T.id]);let g=Number.POSITIVE_INFINITY,h=Number.MAX_SAFE_INTEGER,d=null,f=i,E=i,P=s,S=s;i<0&&(f=1,E=4),s<0&&(P=1,S=2);for(let T=f;T<=E;T++)for(let N=P;N<=S;N++){let{width:I,layering:C}=this._computeMinWidthLayering(T,N,r,c),x=C.length;(I<g||I===g&&x<h)&&(g=I,h=x,d=C)}for(let T of d){let N=new Et(t);for(let I of T)I.setLayer(N);o.push(N)}o.reverse(),r.length=0,e.done()}_precalcSuccessors(t){let e=new Array(t.length);for(let o of t){let r=new Set;for(let i of o.getOutgoingEdges())this._isSelfLoop(i)||r.add(i.getTarget().getNode());e[o.id]=r}return e}_computeMinWidthLayering(t,e,o,r){let i=[],s=new Set(o),a=t*this._avgSize,l=new Set,c=new Set,g=[],h=0,d=0,f=0,E=0,P=0,S=0,T=0,N=0;for(;s.size>0;){let I=this._selectNode(s,r,c);if(I!=null&&(s.delete(I),g.push(I),l.add(I),N=this._outDegree[I.id],h+=this._normSize[I.id]-N*this._dummySize,T=this._inDegree[I.id],d+=T*this._dummySize,S+=N*this._dummySize,E+=this._normSize[I.id]),I==null||s.size===0||h>=a&&this._normSize[I.id]>N*this._dummySize||d>=e*a){i.push(g),g=[];for(let M of l)c.add(M);l.clear(),P-=S;let x=P*this._dummySize+E;x>f&&(f=x),P+=d,h=d,d=0,S=0,E=0}}return{width:f,layering:i}}_selectNode(t,e,o){for(let r of t){let i=!0;for(let s of e[r.id])if(!o.has(s)){i=!1;break}if(i)return r}return null}_isSelfLoop(t){return t.getSource().getNode()===t.getTarget().getNode()}_countEdgesExceptSelfLoops(t){let e=0;for(let o of t)this._isSelfLoop(o)||e++;return e}};var ae=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}create(){switch(this){case n.NETWORK_SIMPLEX:return new $d;case n.LONGEST_PATH:return new Vd;case n.LONGEST_PATH_SOURCE:return new Xd;case n.COFFMAN_GRAHAM:return new jd;case n.INTERACTIVE:return new Zd;case n.BF_MODEL_ORDER:return new Kd;case n.DF_MODEL_ORDER:return new qd;case n.STRETCH_WIDTH:return new Jd;case n.MIN_WIDTH:return new Qd;default:throw new Error(`Unknown layering strategy ${this.name}`)}}toString(){return this.name}static valueOf(t){return n[t]}};ae.NETWORK_SIMPLEX=new ae("NETWORK_SIMPLEX",0);ae.LONGEST_PATH=new ae("LONGEST_PATH",1);ae.LONGEST_PATH_SOURCE=new ae("LONGEST_PATH_SOURCE",2);ae.COFFMAN_GRAHAM=new ae("COFFMAN_GRAHAM",3);ae.INTERACTIVE=new ae("INTERACTIVE",4);ae.STRETCH_WIDTH=new ae("STRETCH_WIDTH",5);ae.MIN_WIDTH=new ae("MIN_WIDTH",6);ae.BF_MODEL_ORDER=new ae("BF_MODEL_ORDER",7);ae.DF_MODEL_ORDER=new ae("DF_MODEL_ORDER",8);var tf=class{process(t,e){e.begin("Simple node placement",1);let o=t.getProperty(p.SPACINGS),r=0;for(let i of t.getLayers()){let s=i.getSize();s.y=0;let a=null;for(let l of i.getNodes())a!=null&&(s.y+=o.getVerticalSpacing(l,a)),s.y+=l.getMargin().top+l.getSize().y+l.getMargin().bottom,a=l;r=Math.max(r,s.y)}for(let i of t.getLayers()){let s=i.getSize(),a=(r-s.y)/2,l=null;for(let c of i.getNodes())l!=null&&(a+=o.getVerticalSpacing(c,l)),a+=c.getMargin().top,c.getPosition().y=a,a+=c.getSize().y+c.getMargin().bottom,l=c}e.done()}getLayoutProcessorConfiguration(t){return null}};var ef=class{constructor(){this._spacings=null}process(t,e){e.begin("Interactive node placement",1),this._spacings=t.getProperty(p.SPACINGS);for(let o of t)this._placeNodes(o);e.done()}_placeNodes(t){let e=Number.NEGATIVE_INFINITY,o=y.NORMAL;for(let r of t){let i=r.getType();if(i!==y.NORMAL){let a=r.getProperty(p.ORIGINAL_DUMMY_NODE_POSITION);a==null?(e=Math.max(e,0),r.getPosition().y=e+this._spacings.getVerticalSpacing(i,o)):r.getPosition().y=a}let s=this._spacings.getVerticalSpacing(i,o);r.getPosition().y<e+s+r.getMargin().top&&(r.getPosition().y=e+s+r.getMargin().top),e=r.getPosition().y+r.getSize().y+r.getMargin().bottom,o=i}}getLayoutProcessorConfiguration(t){return null}};var of=new m("linearSegments.inputPrio",0),rf=new m("linearSegments.outputPrio",0),HI=20,vI=4,BI=3,UI=1e-4,hl="FORW_PENDULUM",F_="BACKW_PENDULUM",FI="RUBBER",k_=class n{constructor(){this.nodes=[],this.id=0,this.indexInLastLayer=-1,this.lastLayer=-1,this.deflection=0,this.weight=0,this.refSegment=null,this.nodeType=null}region(){let t=this;for(;t.refSegment!=null;)t=t.refSegment;return t}split(t,e){let o=this.nodes.indexOf(t),r=new n;r.id=e;let i=this.nodes.splice(o);for(let s of i)s.id=e,r.nodes.push(s);return r}toString(){return`ls[${this.nodes.map(t=>String(t)).join(",")}]`}},sf=class{constructor(){this.linearSegments=null,this.spacings=null}process(t,e){e.begin("Linear segments node placement",1),this.spacings=t.getProperty(p.SPACINGS),this._sortLinearSegments(t),this._createUnbalancedPlacement(t),this._balancePlacement(t),this._postProcess(t),this.linearSegments=null,this.spacings=null,e.done()}getLayoutProcessorConfiguration(t){return null}_sortLinearSegments(t){for(let d of t)for(let f of d){f.id=-1;let E=Number.MIN_SAFE_INTEGER,P=Number.MIN_SAFE_INTEGER;for(let S of f.getPorts()){for(let T of S.getIncomingEdges()){let N=T.getProperty(_.PRIORITY_STRAIGHTNESS);N>E&&(E=N)}for(let T of S.getOutgoingEdges()){let N=T.getProperty(_.PRIORITY_STRAIGHTNESS);N>P&&(P=N)}}f.setProperty(of,E),f.setProperty(rf,P)}let e=[],o=0;for(let d of t)for(let f of d)if(f.id<0){let E=new k_;E.id=o++,this._fillSegment(f,E),e.push(E)}let r=[],i=[];for(let d=0;d<e.length;d++)r.push([]),i.push(0);this._createDependencyGraphEdges(t,e,r,i);let s=e.slice(),a=r.slice(),l=i.slice(),c=0,g=[];for(let d=0;d<s.length;d++)l[d]===0&&g.push(s[d]);let h=new Int32Array(s.length);for(;g.length>0;){let d=g.shift();for(h[d.id]=c++;a[d.id].length>0;){let f=a[d.id].shift();l[f.id]--,l[f.id]===0&&g.push(f)}}this.linearSegments=new Array(s.length);for(let d=0;d<s.length;d++){let f=s[d],E=h[d];this.linearSegments[E]=f,f.id=E;for(let P of f.nodes)P.id=E}}_createDependencyGraphEdges(t,e,o,r){let i=e.length,s=0;for(let a of t){let l=a.getNodes();if(l.length===0)continue;let c=null,g=0,h=0,d=l[h++];for(;d!=null;){let f=e[d.id];if(f.indexInLastLayer>=0){let P=null;for(let S=g+1;S<l.length;S++){let T=l[S],N=e[T.id];if(N.lastLayer===f.lastLayer&&N.indexInLastLayer<f.indexInLastLayer){P=N;break}}if(P!=null){if(c!=null){r[d.id]=r[d.id]-1;let S=o[c.id],T=S.indexOf(f);T>=0&&S.splice(T,1)}f=f.split(d,i++),e.push(f),o.push([]),c!=null?(o[c.id].push(f),r.push(1)):r.push(0)}}let E=null;if(h<l.length){E=l[h++];let P=e[E.id];o[d.id].push(P),r[E.id]=r[E.id]+1}f.lastLayer=s,f.indexInLastLayer=g++,c=d,d=E}s++}}_fillSegment(t,e){let o=t.getType();if(t.id>=0)return!1;if(t.id=e.id,e.nodes.push(t),e.nodeType=o,o===y.LONG_EDGE||o===y.NORTH_SOUTH_PORT)for(let r of t.getPorts())for(let i of r.getSuccessorPorts()){let s=i.getNode(),a=s.getType();if(t.getLayer()!==s.getLayer()&&(a===y.LONG_EDGE||a===y.NORTH_SOUTH_PORT)&&this._fillSegment(s,e))return!0}return!0}_createUnbalancedPlacement(t){let e=t.getLayers().length,o=new Int32Array(e),r=new Array(e).fill(null);for(let i of this.linearSegments){let s=0;for(let a of i.nodes){let l=a.getLayer().getIndex();o[l]++;let c=t.getProperty(_.SPACING_EDGE_EDGE);o[l]>0&&r[l]!=null&&(c=this.spacings.getVerticalSpacing(r[l],a)),s=Math.max(s,a.getLayer().getSize().y+c)}for(let a of i.nodes){a.getPosition().y=s+a.getMargin().top;let l=a.getLayer();l.getSize().y=s+a.getMargin().top+a.getSize().y+a.getMargin().bottom,r[l.getIndex()]=a}}}_balancePlacement(t){let e=Number(t.getProperty(_.NODE_PLACEMENT_LINEAR_SEGMENTS_DEFLECTION_DAMPENING)),o=t.getProperty(_.THOROUGHNESS),r=vI,i=BI,s=HI/o,a=!1,l=hl,c=Number.MAX_SAFE_INTEGER;do{let g=l!==F_,h=l!==hl,d=0;for(let E of this.linearSegments)E.refSegment=null,this._calcDeflection(E,g,h,e),d+=Math.abs(E.deflection);let f;do f=this._mergeRegions(t);while(f);for(let E of this.linearSegments){let P=E.region().deflection;if(P!==0)for(let S of E.nodes)S.getPosition().y+=P}l===hl||l===F_?(r--,r<=0&&(d<c||-r>o)?(l=FI,c=Number.MAX_SAFE_INTEGER):l===hl?(l=F_,c=d):(l=hl,c=d)):(a=d>=c||c-d<s,c=d,a&&i--)}while(!(a&&i<=0))}_calcDeflection(t,e,o,r){let i=0,s=0;for(let a of t.nodes){let l=0,c=0,g=e?a.getProperty(of):Number.MIN_SAFE_INTEGER,h=o?a.getProperty(rf):Number.MIN_SAFE_INTEGER,d=Math.max(g,h);for(let f of a.getPorts()){let E=a.getPosition().y+f.getPosition().y+f.getAnchor().y;if(o)for(let P of f.getOutgoingEdges()){let S=P.getTarget(),T=S.getNode();if(t!==this.linearSegments[T.id]){let N=Math.max(T.getProperty(of),T.getProperty(rf)),I=P.getProperty(_.PRIORITY_STRAIGHTNESS);I>=d&&I>=N&&(l+=T.getPosition().y+S.getPosition().y+S.getAnchor().y-E,c++)}}if(e)for(let P of f.getIncomingEdges()){let S=P.getSource(),T=S.getNode();if(t!==this.linearSegments[T.id]){let N=Math.max(T.getProperty(of),T.getProperty(rf)),I=P.getProperty(_.PRIORITY_STRAIGHTNESS);I>=d&&I>=N&&(l+=T.getPosition().y+S.getPosition().y+S.getAnchor().y-E,c++)}}}c>0&&(i+=l/c,s++)}s>0?(t.deflection=r*i/s,t.weight=s):(t.deflection=0,t.weight=0)}_mergeRegions(t){let e=!1,o=Number(t.getProperty(_.SPACING_NODE_NODE)),r=UI*o;for(let i of t){let s=i.getNodes();if(s.length===0)continue;let a=s[0],l=this.linearSegments[a.id].region();for(let c=1;c<s.length;c++){let g=s[c],h=this.linearSegments[g.id].region();if(l!==h){let d=this.spacings.getVerticalSpacing(a,g),f=a.getPosition().y+a.getSize().y+a.getMargin().bottom+l.deflection+d,E=g.getPosition().y-g.getMargin().top+h.deflection;if(f>E+r){let P=l.weight+h.weight;h.deflection=(h.weight*h.deflection+l.weight*l.deflection)/P,h.weight=P,l.refSegment=h,e=!0}}a=g,l=h}}return e}_postProcess(t){for(let e of this.linearSegments){let o=Number.MAX_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER;for(let c of e.nodes){let g=c.getIndex(),h;if(g>0){let f=c.getLayer().getNodes()[g-1],E=this.spacings.getVerticalSpacing(c,f);h=c.getPosition().y-c.getMargin().top-(f.getPosition().y+f.getSize().y+f.getMargin().bottom+E)}else h=c.getPosition().y-c.getMargin().top;h<o&&(o=h);let d;if(g<c.getLayer().getNodes().length-1){let f=c.getLayer().getNodes()[g+1],E=this.spacings.getVerticalSpacing(c,f);d=f.getPosition().y-f.getMargin().top-(c.getPosition().y+c.getSize().y+c.getMargin().bottom+E)}else d=2*c.getPosition().y;d<r&&(r=d)}let i=Number.MAX_SAFE_INTEGER,s=!1,a=e.nodes[0];for(let c of a.getPorts()){let g=a.getPosition().y+c.getPosition().y+c.getAnchor().y;for(let h of c.getIncomingEdges()){let d=h.getSource(),f=d.getNode().getPosition().y+d.getPosition().y+d.getAnchor().y-g;Math.abs(f)<Math.abs(i)&&Math.abs(f)<(f<0?o:r)&&(i=f,s=!0)}}let l=e.nodes[e.nodes.length-1];for(let c of l.getPorts()){let g=l.getPosition().y+c.getPosition().y+c.getAnchor().y;for(let h of c.getOutgoingEdges()){let d=h.getTarget(),f=d.getNode().getPosition().y+d.getPosition().y+d.getAnchor().y-g;Math.abs(f)<Math.abs(i)&&Math.abs(f)<(f<0?o:r)&&(i=f,s=!0)}}if(s&&i!==0)for(let c of e.nodes)c.getPosition().y+=i}}};var ye=class n{constructor(t){this.name=t}toString(){return this.name}isFlexibleSize(){return this===n.NODE_SIZE}isFlexibleSizeWhereSpacePermits(){return this===n.NODE_SIZE_WHERE_SPACE_PERMITS||this===n.NODE_SIZE}isFlexiblePorts(){return this===n.PORT_POSITION||this===n.NODE_SIZE_WHERE_SPACE_PERMITS||this===n.NODE_SIZE}isAtLeast(t){switch(this){case n.NODE_SIZE:return t.isFlexibleSize();case n.NODE_SIZE_WHERE_SPACE_PERMITS:return t.isFlexibleSizeWhereSpacePermits();case n.PORT_POSITION:return t.isFlexiblePorts();default:return!0}}static getNodeFlexibility(t){return typeof t.getAllProperties=="function"&&t.getAllProperties().has(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY)?t.getProperty(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY):t.getGraph().getProperty(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY_DEFAULT)}};ye.NONE=new ye("NONE");ye.PORT_POSITION=new ye("PORT_POSITION");ye.NODE_SIZE_WHERE_SPACE_PERMITS=new ye("NODE_SIZE_WHERE_SPACE_PERMITS");ye.NODE_SIZE=new ye("NODE_SIZE");var lf=4,YP=.1,kI=2,VP=1e4,XP=1,WI=1e-5,KP=-1,jP=0,cf=2,gf=class{constructor(){this._lGraph=null,this._spacings=null,this._nGraph=null,this._nodeReps=null,this._edgeReps=null,this._portMap=new Map,this._nodeCount=0,this._edgeCount=0,this._nodeState=null,this._twoPaths=null,this._crossing=null,this._flexibleWhereSpacePermitsEdges=new Set}getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);return e!=null&&e.has(v.EXTERNAL_PORTS)?K.create().addBefore(D.P5_EDGE_ROUTING,w.HIERARCHICAL_PORT_POSITION_PROCESSOR):null}process(t,e){e&&e.begin&&e.begin("Network simplex node placement",1),this._lGraph=t,this._spacings=t.getProperty(p.SPACINGS),this._prepare(),this._buildInitialAuxiliaryGraph(),this._insertNorthSouthAuxiliaryEdges(),this._insertInLayerEdgeAuxiliaryEdges();let o=t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES);o&&this._preferStraightEdges(),this._nGraph.makeConnected();let r=t.getProperty(_.THOROUGHNESS)*this._nGraph.nodes.length;if(li.forGraph(this._nGraph).withIterationLimit(r).withBalancing(!1).execute(ZP(e)),this._flexibleWhereSpacePermitsEdges.size>0){this._insertFlexibleWhereSpaceAuxiliaryEdges();for(let i of this._flexibleWhereSpacePermitsEdges)i.weight=XP;li.forGraph(this._nGraph).withIterationLimit(r).withBalancing(!1).execute(ZP(e))}o&&this._postProcessTwoPaths(),this._applyPositions(),this._cleanup(),e&&e.done&&e.done()}_prepare(){this._nGraph=new Wi;let t=0,e=0;for(let o of this._lGraph.getLayers())for(let r of o.getNodes()){r.id=t++;for(let s of r.getOutgoingEdges())s.id=e++;let i=af(r);for(let s of r.getPorts()){if(i){let l=s.getAnchor().y;if(l!==Math.floor(l)){let c=l-Math.round(l);s.getAnchor().y-=c}}let a=s.getPosition().y+s.getAnchor().y;if(a!==Math.floor(a)){let l=a-Math.round(a);s.getPosition().y-=l}}}this._nodeCount=t,this._edgeCount=e,this._nodeReps=new Array(t),this._edgeReps=new Array(e),this._flexibleWhereSpacePermitsEdges.clear(),this._portMap.clear()}_cleanup(){this._lGraph=null,this._nGraph=null,this._nodeReps=null,this._edgeReps=null,this._portMap.clear(),this._nodeState=null,this._crossing=null,this._twoPaths=null,this._flexibleWhereSpacePermitsEdges.clear()}_buildInitialAuxiliaryGraph(){for(let t of this._lGraph.getLayers())this._transformLayer(t);this._transformEdges()}_transformLayer(t){let e=null;for(let o of t.getNodes()){let r=af(o)?this._transformFixedOrderNode(o):this._transformFixedPosNode(o);if(this._nodeReps[o.id]=r,e!=null){let i=e.origin.getMargin().bottom+this._spacings.getVerticalSpacing(e.origin,o)+o.getMargin().top;e.isFlexible||(i+=e.origin.getSize().y),te.of().delta(Math.ceil(i)).weight(0).source(e.tail).target(r.head).create()}e=r}}_transformFixedPosNode(t){let e=He.of().origin(t).type("non-flexible").create(this._nGraph);for(let o of t.getPorts())u.SIDES_EAST_WEST.has(o.getSide())&&this._portMap.set(o,e);return new hf(t,!1,e,e)}_transformFixedOrderNode(t){let e=He.of().origin(t).type("flexible-head").create(this._nGraph),o=He.of().origin(t).type("flexible-tail").create(this._nGraph),r=new hf(t,!0,e,o),i=t.getSize().y,s=ye.getNodeFlexibility(t),a=s.isFlexibleSize()?XP:VP,l=te.of().weight(a).delta(Math.ceil(i)).source(e).target(o).create();s===ye.NODE_SIZE_WHERE_SPACE_PERMITS&&this._flexibleWhereSpacePermitsEdges.add(l);let c=t.getPortSideView(u.WEST);return this._transformPorts([...c].reverse(),r),this._transformPorts(t.getPortSideView(u.EAST),r),r}_transformPorts(t,e){if(t.length===0)return;let o=oo.getIndividualOrDefault(e.origin,_.SPACING_PORT_PORT),r=oo.getIndividualOrDefault(e.origin,_.SPACING_PORTS_SURROUNDING);r==null&&(r=new me);let i=e.head,s=null;for(let a of t){let l=s==null?r.top:o+s.getSize().y,c=He.of().origin(a).type("port").create(this._nGraph);this._portMap.set(a,c),te.of().weight(0).delta(Math.ceil(l)).source(i).target(c).create(),s=a,i=c}te.of().weight(0).delta(Math.ceil(r.bottom+s.getSize().y)).source(i).target(e.tail).create()}_transformEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes())for(let o of e.getOutgoingEdges())W_(o)&&this._transformEdge(o)}_transformEdge(t){let e=He.of().type("edge").create(this._nGraph),o=this._nodeReps[t.getSource().getNode().id],r=this._nodeReps[t.getTarget().getNode().id],i=t.getSource(),s=t.getTarget(),a=i.getAnchor().y,l=s.getAnchor().y;o.isFlexible||(a+=i.getPosition().y),r.isFlexible||(l+=s.getPosition().y);let c=Math.max(0,a-l),g=Math.max(0,l-a),h=this._getEdgeWeight(t),d=te.of(t).weight(h).delta(g).source(e).target(this._portMap.get(t.getSource())).create(),f=te.of(t).weight(h).delta(c).source(e).target(this._portMap.get(t.getTarget())).create();this._edgeReps[t.id]=new Y_(t,e,d,f)}_insertInLayerEdgeAuxiliaryEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes())if(e.getType()===y.NORMAL)for(let o of e.getConnectedEdges()){if(!o.isInLayerEdge())continue;let i=o.getSource().getNode().getType()!==y.NORMAL?o.getTarget():o.getSource(),s=o.getOther(i).getNode(),a=this._portMap.get(i),l=this._nodeReps[s.id].head,c,g;i.getNode().getIndex()<s.getIndex()?(c=a,g=l):(c=l,g=a),te.of().delta(0).weight(lf).source(c).target(g).create()}}_insertNorthSouthAuxiliaryEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes()){for(let o of e.getPortSideView(u.SOUTH)){let r=o.getProperty(p.PORT_DUMMY);r!=null&&te.of().delta(0).weight(YP).source(this._nodeReps[e.id].tail).target(this._nodeReps[r.id].head).create()}for(let o of e.getPortSideView(u.NORTH)){let r=o.getProperty(p.PORT_DUMMY);r!=null&&te.of().delta(0).weight(YP).source(this._nodeReps[r.id].tail).target(this._nodeReps[e.id].head).create()}}}_insertFlexibleWhereSpaceAuxiliaryEdges(){let t=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;for(let s of this._nGraph.nodes)s.layer<t&&(t=s.layer),s.layer>e&&(e=s.layer);let o=e-t,r=He.of().create(this._nGraph),i=He.of().create(this._nGraph);te.of().weight(VP*2).delta(o).source(r).target(i).create();for(let s of this._nodeReps)s.origin.getType()===y.NORMAL&&(s.origin.getPorts().length<=1||(te.of().weight(0).delta(s.tail.layer-t).source(r).target(s.tail).create(),te.of().weight(0).delta(o-s.head.layer).source(s.head).target(i).create()))}_applyPositions(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes()){let o=this._nodeReps[e.id],r=o.head.layer,i=o.tail.layer;e.getPosition().y=r;let s=i-r-e.getSize().y,a=af(e),l=ye.getNodeFlexibility(e);if(a&&l.isFlexibleSizeWhereSpacePermits()&&(e.getSize().y+=s),a&&l.isFlexiblePorts()){for(let c of e.getPorts())if(u.SIDES_EAST_WEST.has(c.getSide())){let g=this._portMap.get(c);c.getPosition().y=g.layer-r}for(let c of e.getLabels())zI(e,c,s);if(l.isFlexibleSizeWhereSpacePermits())for(let c of e.getPortSideView(u.SOUTH))c.getPosition().y+=s}}}_getEdgeWeight(t){let e=Math.max(1,t.getProperty(_.PRIORITY_STRAIGHTNESS)),o=z_(t.getSource().getNode().getType(),t.getTarget().getNode().getType());return e*o}_preferStraightEdges(){this._nodeState=new Array(this._nodeCount).fill(jP),this._twoPaths=[];for(let e of this._lGraph.getLayers())for(let o of e.getNodes())this._nodeState[o.id]=YI(o);this._markEdgeCrossings();let t=this._identifyPaths();for(let e of t){if(e.length<=1)continue;if(e.length===2){VI(e),af(e[0].getTarget().getNode())||this._twoPaths.push(e);continue}if(XI(e)||KI(e))continue;let o=null;for(let r=0;r<e.length;r++){let i=e[r],s=this._edgeReps[i.id],a;o==null||r===e.length-1?a=z_(y.NORMAL,y.LONG_EDGE):a=z_(y.LONG_EDGE,y.LONG_EDGE),a*=kI,s.left.weight=Math.max(s.left.weight,a),s.right.weight=Math.max(s.right.weight,a),o=i}}}_postProcessTwoPaths(){let t=[...this._twoPaths],e=[];for(;t.length>0;){let o=t.shift();this._improveTwoPath(o,!0)&&e.push(o)}for(;e.length>0;){let o=e.pop();this._improveTwoPath(o,!1)}}_improveTwoPath(t,e){let o=this._edgeReps[t[0].id],r=this._edgeReps[t[1].id];if(o.isStraight()&&r.isStraight())return!1;let i=o.right.target.origin;if(i==null||typeof i.getLayer!="function")return!1;let s=i,a=this._nodeReps[s.id],l=s.getIndex(),c=Number.POSITIVE_INFINITY;if(l>0){let C=s.getLayer().getNodes()[l-1],x=this._nodeReps[C.id],M=Math.ceil(this._spacings.getVerticalSpacing(C,s));c=a.head.layer-s.getMargin().top-(x.head.layer+C.getSize().y+C.getMargin().bottom)-M}let g=Number.POSITIVE_INFINITY;if(l<s.getLayer().getNodes().length-1){let C=s.getLayer().getNodes()[l+1],x=this._nodeReps[C.id],M=Math.ceil(this._spacings.getVerticalSpacing(C,s));g=x.head.layer-C.getMargin().top-(a.head.layer+s.getSize().y+s.getMargin().bottom)-M}if(e&&Math.abs(c-g)<WI)return!0;let h=+nf(o.left),d=-nf(o.right),f=-nf(r.left),E=+nf(r.right),P=o.notStraightBy()>0&&r.notStraightBy()<0,S=o.notStraightBy()<0&&r.notStraightBy()>0,T=o.left.target.layer+o.right.delta<r.right.target.layer+r.left.delta,N=o.left.target.layer+o.right.delta>r.right.target.layer+r.left.delta,I=0;return!P&&!S&&(N?c+f>0?I=f:g-h>0&&(I=h):T&&(c+d>0?I=d:g-E>0&&(I=E))),a.head.layer+=I,a.isFlexible&&(a.tail.layer+=I),!1}_identifyPaths(){let t=[];for(let e of this._lGraph.getLayers())for(let o of e.getNodes())if(this._nodeState[o.id]===cf)for(let r of o.getConnectedEdges()){if(!W_(r))continue;let i=this._follow(r,o,[]);i.length>1&&t.push(i)}return t}_follow(t,e,o){let r=t.getOther(e);if(o.push(t),this._nodeState[r.id]===KP||this._nodeState[r.id]===cf||this._crossing[t.id])return o;this._nodeState[r.id]=KP;for(let i of r.getConnectedEdges())if(!(!W_(i)||i===t))return this._follow(i,r,o);return o}_markEdgeCrossings(){this._crossing=new Array(this._edgeCount).fill(!1);let t=this._lGraph.getLayers();for(let e=0;e+1<t.length;e++)this._markCrossingEdges(t[e],t[e+1])}_markCrossingEdges(t,e){let o=[];for(let i of t.getNodes())for(let s of i.getPortSideView(u.EAST))for(let a of s.getOutgoingEdges())a.isInLayerEdge()||a.isSelfLoop()||a.getTarget().getNode().getLayer()!==e||o.push(a);let r=[...e.getNodes()].reverse();for(let i of r)for(let s of i.getPortSideView(u.WEST))for(let a of s.getIncomingEdges()){if(a.isInLayerEdge()||a.isSelfLoop()||a.getSource().getNode().getLayer()!==t||o.length===0)continue;let l=o.length-1;for(;l>=0&&o[l]!==a;)this._crossing[o[l].id]=!0,this._crossing[a.id]=!0,l--;l>=0&&o.splice(l,1)}}};function ZP(n){return n&&typeof n.subTask=="function"?n.subTask(1):n}function W_(n){return!n.isSelfLoop()&&!n.isInLayerEdge()}function z_(n,t){return n===y.NORMAL&&t===y.NORMAL?1*lf:n===y.NORMAL||t===y.NORMAL?2*lf:8*lf}function nf(n){return Math.abs(n.source.layer-n.target.layer)-n.delta}function zI(n,t,e){let o=n.getProperty(_.NODE_LABELS_PLACEMENT);o!=null&&(o.has&&o.has(k.V_BOTTOM)?t.getPosition().y+=e:o.has&&o.has(k.V_CENTER)&&(t.getPosition().y+=e/2))}function YI(n){let t=0,e=0;for(let o of n.getPorts()){for(let r of o.getIncomingEdges())r.isSelfLoop()||t++;for(let r of o.getOutgoingEdges())r.isSelfLoop()||e++;if(t>1||e>1)return cf}return t+e===1?cf:jP}function VI(n){let t=n[0],e=n[1];t.getTarget().getNode()!==e.getSource().getNode()&&(n[0]=e,n[1]=t)}function XI(n){if(n.length===0)return!1;if(n[0].getSource().getNode().getType()===y.LONG_EDGE)return!0;for(let t of n)if(t.getTarget().getNode().getType()===y.LONG_EDGE)return!0;return!1}function KI(n){if(n.length===0)return!1;if(ye.getNodeFlexibility(n[0].getSource().getNode()).isFlexibleSizeWhereSpacePermits())return!0;for(let e of n)if(ye.getNodeFlexibility(e.getTarget().getNode()).isFlexibleSizeWhereSpacePermits())return!0;return!1}function af(n){if(n.getType()!==y.NORMAL||n.getPorts().length<=1)return!1;let t=n.getProperty(_.PORT_CONSTRAINTS);if(t!=null&&typeof t.isPosFixed=="function"&&t.isPosFixed())return!1;let e=ye.getNodeFlexibility(n);if(e===ye.NONE)return!1;if(!e.isFlexibleSizeWhereSpacePermits()){let o=oo.getIndividualOrDefault(n,_.SPACING_PORT_PORT),r=n.getProperty(_.SPACING_PORTS_SURROUNDING);r==null&&(r=new me(o,o,o,o));let i=n.getPortSideView(u.WEST);if(r.top+r.bottom+(i.length-1)*o>n.getSize().y)return!1;let a=n.getPortSideView(u.EAST);if(r.top+r.bottom+(a.length-1)*o>n.getSize().y)return!1}return!0}var hf=class{constructor(t,e,o,r){this.origin=t,this.isFlexible=e,this.head=o,this.tail=r}},Y_=class{constructor(t,e,o,r){this.origin=t,this.left=o,this.right=r}isStraight(){return this.notStraightBy()===0}notStraightBy(){return this.left.target.layer-this.left.delta-(this.right.target.layer-this.right.delta)}};var rr=class{constructor(t,e,o,r){this.layeredGraph=t,this.spacings=t.getProperty(p.SPACINGS),this.root=new Array(e),this.blockSize=new Array(e),this.align=new Array(e),this.innerShift=new Array(e),this.sink=new Array(e),this.shift=new Array(e),this.y=new Array(e),this.su=new Array(e).fill(!1),this.od=new Array(e).fill(!0),this.vdir=o,this.hdir=r}cleanup(){this.root=null,this.blockSize=null,this.align=null,this.innerShift=null,this.sink=null,this.shift=null,this.y=null}layoutSize(){let t=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;for(let o of this.layeredGraph.getLayers())for(let r of o.getNodes()){let i=this.y[r.id],s=i+this.blockSize[this.root[r.id].id];i<t&&(t=i),s>e&&(e=s)}return e-t}calculateDelta(t,e){let o=this.y[t.getNode().id]+this.innerShift[t.getNode().id]+t.getPosition().y+t.getAnchor().y;return this.y[e.getNode().id]+this.innerShift[e.getNode().id]+e.getPosition().y+e.getAnchor().y-o}shiftBlock(t,e){let o=t;do this.y[o.id]=this.y[o.id]+e,o=this.align[o.id];while(o!==t)}checkSpaceAbove(t,e,o){let r=e,i=t,s=i;do{s=this.align[s.id];let a=this.getMinY(s),l=this._getUpperNeighbor(s,o);if(l!=null){let c=this.getMaxY(l),g=a-(c+this.spacings.getVerticalSpacing(s,l));g<r&&(r=g)}}while(i!==s);return r}checkSpaceBelow(t,e,o){let r=e,i=t,s=i;do{s=this.align[s.id];let a=this.getMaxY(s),l=this._getLowerNeighbor(s,o);if(l!=null){let g=this.getMinY(l)-(a+this.spacings.getVerticalSpacing(s,l));g<r&&(r=g)}}while(i!==s);return r}getMinY(t){let e=this.root[t.id];return this.y[e.id]+this.innerShift[t.id]-t.getMargin().top}getMaxY(t){let e=this.root[t.id];return this.y[e.id]+this.innerShift[t.id]+t.getSize().y+t.getMargin().bottom}_getLowerNeighbor(t,e){let o=t.getLayer(),r=e.nodeIndex[t.id];return r<o.getNodes().length-1?o.getNodes()[r+1]:null}_getUpperNeighbor(t,e){let o=t.getLayer(),r=e.nodeIndex[t.id];return r>0?o.getNodes()[r-1]:null}toString(){let t="";return this.hdir===Zt.RIGHT?t+="RIGHT":this.hdir===Zt.LEFT&&(t+="LEFT"),this.vdir===xt.DOWN?t+="DOWN":this.vdir===xt.UP?t+="UP":t+="BALANCED",t}},xt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};xt.DOWN=new xt("DOWN");xt.UP=new xt("UP");var Zt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Zt.RIGHT=new Zt("RIGHT");Zt.LEFT=new Zt("LEFT");function $P(n,t){for(let e of n.getConnectedEdges())if(e.getTarget().getNode()===t||e.getSource().getNode()===t)return e;return null}function V_(n){let t=new Map;for(let e of n.layeredGraph.getLayers())for(let o of e.getNodes()){let r=n.root[o.id],i=t.get(r);i==null&&(i=[],t.set(r,i)),i.push(o)}return t}var df=class{constructor(t,e){this.layeredGraph=t,this.ni=e}verticalAlignment(t,e){for(let r of this.layeredGraph.getLayers())for(let i of r.getNodes())t.root[i.id]=i,t.align[i.id]=i,t.innerShift[i.id]=0;let o=this.layeredGraph.getLayers();t.hdir===Zt.LEFT&&(o=[...o].reverse());for(let r of o){let i=-1,s=r.getNodes();t.vdir===xt.UP&&(i=Number.MAX_SAFE_INTEGER,s=[...s].reverse());for(let a of s){let l=t.hdir===Zt.LEFT?this.ni.rightNeighbors[a.id]:this.ni.leftNeighbors[a.id];if(l.length===0)continue;let c=l.length,g=Math.floor((c+1)/2)-1,h=Math.ceil((c+1)/2)-1;if(t.vdir===xt.UP){for(let d=h;d>=g;d--)if(t.align[a.id]===a){let f=l[d],E=f.getFirst();!e.has(f.getSecond())&&i>this.ni.nodeIndex[E.id]&&(t.align[E.id]=a,t.root[a.id]=t.root[E.id],t.align[a.id]=t.root[a.id],t.od[t.root[a.id].id]=t.od[t.root[a.id].id]&&a.getType()===y.LONG_EDGE,i=this.ni.nodeIndex[E.id])}}else for(let d=g;d<=h;d++)if(t.align[a.id]===a){let f=l[d],E=f.getFirst();!e.has(f.getSecond())&&i<this.ni.nodeIndex[E.id]&&(t.align[E.id]=a,t.root[a.id]=t.root[E.id],t.align[a.id]=t.root[a.id],t.od[t.root[a.id].id]=t.od[t.root[a.id].id]&&a.getType()===y.LONG_EDGE,i=this.ni.nodeIndex[E.id])}}}}insideBlockShift(t){let e=V_(t);for(let o of e.keys()){let r=o.getMargin().top,i=o.getSize().y+o.getMargin().bottom;t.innerShift[o.id]=0;let s=o,a;for(;(a=t.align[s.id])!==o;){let l=$P(s,a),c;t.hdir===Zt.LEFT?c=l.getTarget().getPosition().y+l.getTarget().getAnchor().y-l.getSource().getPosition().y-l.getSource().getAnchor().y:c=l.getSource().getPosition().y+l.getSource().getAnchor().y-l.getTarget().getPosition().y-l.getTarget().getAnchor().y;let g=t.innerShift[s.id]+c;t.innerShift[a.id]=g,r=Math.max(r,a.getMargin().top-g),i=Math.max(i,g+a.getSize().y+a.getMargin().bottom),s=a}s=o;do t.innerShift[s.id]=t.innerShift[s.id]+r,s=t.align[s.id];while(s!==o);t.blockSize[o.id]=r+i}}};var oa=Object.freeze({NONE:"NONE",IMPROVE_STRAIGHTNESS:"IMPROVE_STRAIGHTNESS",values(){return[this.NONE,this.IMPROVE_STRAIGHTNESS]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var qP=Number.MAX_VALUE;var ff=class{constructor(){this.bal=null,this.ni=null,this.blockFinished=new Set,this.postProcessablesQueue=[],this.postProcessablesStack=[]}init(t,e){this.bal=t,this.ni=e,this.blockFinished.clear(),this.postProcessablesQueue.length=0,this.postProcessablesStack.length=0}finishBlock(t){this.blockFinished.add(t)}calculateThreshold(t,e,o){throw new Error("abstract")}postProcess(){throw new Error("abstract")}getOther(t,e){if(t.getSource().getNode()===e)return t.getTarget().getNode();if(t.getTarget().getNode()===e)return t.getSource().getNode();throw new Error(`Node ${e} is neither source nor target of edge ${t}`)}},uf=class extends ff{calculateThreshold(t,e,o){return this.bal.vdir===xt.UP?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY}postProcess(){}},_f=class extends ff{calculateThreshold(t,e,o){let r=e===o,i=this.bal.align[o.id]===e;if(!(r||i))return t;let s=t;return r&&(s=this._getBound(e,!0)),!isFinite(s)&&i&&(s=this._getBound(o,!1)),s}_pickEdge(t){let e;t.isRoot?e=this.bal.hdir===Zt.RIGHT?t.free.getIncomingEdges():t.free.getOutgoingEdges():e=this.bal.hdir===Zt.LEFT?t.free.getIncomingEdges():t.free.getOutgoingEdges();let o=!1;for(let r of e)if(!(!this.bal.od[this.bal.root[t.free.id].id]&&r.isInLayerEdge())&&!this.bal.su[this.bal.root[t.free.id].id]&&(o=!0,this.blockFinished.has(this.bal.root[this.getOther(r,t.free).id])))return t.hasEdges=!0,t.edge=r,t;return t.hasEdges=o,t.edge=null,t}_getBound(t,e){let o=this.bal.vdir===xt.UP?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,r=this._pickEdge(new X_(t,e));if(r.edge==null&&r.hasEdges)return this.postProcessablesQueue.push(r),o;if(r.edge==null)return o;let i=r.edge.getSource(),s=r.edge.getTarget(),a;if(e){let l=this.bal.hdir===Zt.RIGHT?s:i,c=this.bal.hdir===Zt.RIGHT?i:s,g=this.bal.root[c.getNode().id];a=this.bal.y[g.id]+this.bal.innerShift[c.getNode().id]+c.getPosition().y+c.getAnchor().y-this.bal.innerShift[l.getNode().id]-l.getPosition().y-l.getAnchor().y}else{let l=this.bal.hdir===Zt.LEFT?s:i,c=this.bal.hdir===Zt.LEFT?i:s;a=this.bal.y[this.bal.root[c.getNode().id].id]+this.bal.innerShift[c.getNode().id]+c.getPosition().y+c.getAnchor().y-this.bal.innerShift[l.getNode().id]-l.getPosition().y-l.getAnchor().y}return this.bal.su[this.bal.root[i.getNode().id].id]=!0,this.bal.su[this.bal.root[s.getNode().id].id]=!0,a}postProcess(){for(;this.postProcessablesQueue.length>0;){let t=this.postProcessablesQueue.shift(),e=this._pickEdge(t);if(e.edge==null)continue;let o=e.edge;if(!this.bal.od[this.bal.root[t.free.id].id]&&o.isInLayerEdge())continue;this._process(t)||this.postProcessablesStack.push(t)}for(;this.postProcessablesStack.length>0;)this._process(this.postProcessablesStack.pop())}_process(t){let e=t.edge,o=e.getSource().getNode()===t.free?e.getTarget():e.getSource(),r=e.getSource().getNode()===t.free?e.getSource():e.getTarget(),i=this.bal.calculateDelta(o,r);if(i>0&&i<qP){let s=this.bal.checkSpaceAbove(r.getNode(),i,this.ni);return this.bal.shiftBlock(r.getNode(),-s),s>0}if(i<0&&-i<qP){let s=this.bal.checkSpaceBelow(r.getNode(),-i,this.ni);return this.bal.shiftBlock(r.getNode(),s),s>0}return!1}},X_=class{constructor(t,e){this.free=t,this.isRoot=e,this.hasEdges=!1,this.edge=null}};var pf=class{constructor(t,e){this.layeredGraph=t,this.ni=e,this.spacings=t.getProperty(p.SPACINGS),this.sinkNodes=new Map,t.getProperty(_.NODE_PLACEMENT_BK_EDGE_STRAIGHTENING)===oa.IMPROVE_STRAIGHTNESS?this.threshStrategy=new _f:this.threshStrategy=new uf}horizontalCompaction(t){for(let o of this.layeredGraph.getLayers())for(let r of o.getNodes())t.sink[r.id]=r,t.shift[r.id]=t.vdir===xt.UP?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;this.sinkNodes.clear();let e=this.layeredGraph.getLayers();t.hdir===Zt.LEFT&&(e=[...e].reverse()),this.threshStrategy.init(t,this.ni),t.y.fill(null);for(let o of e){let r=o.getNodes();t.vdir===xt.UP&&(r=[...r].reverse());for(let i of r)t.root[i.id]===i&&this._placeBlock(i,t)}this._placeClasses(t);for(let o of e)for(let r of o.getNodes())if(t.y[r.id]=t.y[t.root[r.id].id],r===t.root[r.id]){let i=t.shift[t.sink[r.id].id];(t.vdir===xt.UP&&i>Number.NEGATIVE_INFINITY||t.vdir===xt.DOWN&&i<Number.POSITIVE_INFINITY)&&(t.y[r.id]=t.y[r.id]+i)}this.threshStrategy.postProcess()}_placeBlock(t,e){if(e.y[t.id]!=null)return;let o=!0;e.y[t.id]=0;let r=t,i=e.vdir===xt.DOWN?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;do{let s=this.ni.nodeIndex[r.id],a=r.getLayer().getNodes().length;if(e.vdir===xt.DOWN&&s>0||e.vdir===xt.UP&&s<a-1){let c=e.vdir===xt.UP?s+1:s-1,g=r.getLayer().getNodes()[c],h=e.root[g.id];if(this._placeBlock(h,e),i=this.threshStrategy.calculateThreshold(i,t,r),e.sink[t.id]===t&&(e.sink[t.id]=e.sink[h.id]),e.sink[t.id]===e.sink[h.id]){let d=this.spacings.getVerticalSpacing(r,g);if(e.vdir===xt.UP){let f=e.y[t.id],E=e.y[h.id]+e.innerShift[g.id]-g.getMargin().top-d-r.getMargin().bottom-r.getSize().y-e.innerShift[r.id];o?(o=!1,e.y[t.id]=Math.min(E,i)):e.y[t.id]=Math.min(f,Math.min(E,i))}else{let f=e.y[t.id],E=e.y[h.id]+e.innerShift[g.id]+g.getSize().y+g.getMargin().bottom+d+r.getMargin().top-e.innerShift[r.id];o?(o=!1,e.y[t.id]=Math.max(E,i)):e.y[t.id]=Math.max(f,Math.max(E,i))}}else{let d=Number(this.layeredGraph.getProperty(_.SPACING_NODE_NODE)),f=this._getOrCreateClassNode(e.sink[t.id]),E=this._getOrCreateClassNode(e.sink[h.id]);if(e.vdir===xt.UP){let P=e.y[t.id]+e.innerShift[r.id]+r.getSize().y+r.getMargin().bottom+d-(e.y[h.id]+e.innerShift[g.id]-g.getMargin().top);f.addEdge(E,P)}else{let P=e.y[t.id]+e.innerShift[r.id]-r.getMargin().top-e.y[h.id]-e.innerShift[g.id]-g.getSize().y-g.getMargin().bottom-d;f.addEdge(E,P)}}}else i=this.threshStrategy.calculateThreshold(i,t,r);r=e.align[r.id]}while(r!==t);this.threshStrategy.finishBlock(t)}_placeClasses(t){let e=[];for(let o of this.sinkNodes.values())o.indegree===0&&e.push(o);for(;e.length>0;){let o=e.shift();o.classShift==null&&(o.classShift=0);for(let r of o.outgoing)r.target.classShift==null?r.target.classShift=o.classShift+r.separation:t.vdir===xt.DOWN?r.target.classShift=Math.min(r.target.classShift,o.classShift+r.separation):r.target.classShift=Math.max(r.target.classShift,o.classShift+r.separation),r.target.indegree--,r.target.indegree===0&&e.push(r.target)}for(let o of this.sinkNodes.values())t.shift[o.node.id]=o.classShift}_getOrCreateClassNode(t){let e=this.sinkNodes.get(t);return e==null&&(e=new K_,e.node=t,this.sinkNodes.set(t,e)),e}},K_=class{constructor(){this.classShift=null,this.node=null,this.outgoing=[],this.indegree=0}addEdge(t,e){let o=new Z_;o.target=t,o.separation=e,t.indegree++,this.outgoing.push(o)}},Z_=class{constructor(){this.separation=0,this.target=null}};var Ef=class n{constructor(){this.nodeCount=0,this.layerIndex=null,this.nodeIndex=null,this.leftNeighbors=[],this.rightNeighbors=[]}cleanup(){this.layerIndex=null,this.nodeIndex=null,this.leftNeighbors.length=0,this.rightNeighbors.length=0}static buildFor(t){let e=new n,o=0;for(let l of t)o+=l.getNodes().length;e.nodeCount=o,e.layerIndex=new Int32Array(t.getLayers().length),e.nodeIndex=new Int32Array(o);let r=0,i=0,s=0;for(let l of t.getLayers()){l.id=r++,e.layerIndex[l.id]=i++;let c=0;for(let g of l.getNodes())g.id=s++,e.nodeIndex[g.id]=c++}let a=(l,c)=>{let g=e.nodeIndex[l.getFirst().id]-e.nodeIndex[c.getFirst().id];return Math.sign(g)};return e.leftNeighbors=new Array(o),e.rightNeighbors=new Array(o),jI(e,t,a),ZI(e,t,a),e}};function ZI(n,t,e){for(let o of t)for(let r of o){let i=[],s=0;for(let a of r.getOutgoingEdges()){if(a.isSelfLoop()||a.isInLayerEdge())continue;let l=a.getProperty(_.PRIORITY_STRAIGHTNESS);l>s&&(s=l,i.length=0),l===s&&i.push(Gt.of(a.getTarget().getNode(),a))}i.sort(e),n.rightNeighbors[r.id]=i}}function jI(n,t,e){for(let o of t)for(let r of o){let i=[],s=0;for(let a of r.getIncomingEdges()){if(a.isSelfLoop()||a.isInLayerEdge())continue;let l=a.getProperty(_.PRIORITY_STRAIGHTNESS);l>s&&(s=l,i.length=0),l===s&&i.push(Gt.of(a.getSource().getNode(),a))}i.sort(e),n.leftNeighbors[r.id]=i}}var $I=3,mf=class{constructor(){this._lGraph=null,this._markedEdges=new Set,this._ni=null,this._produceBalancedLayout=!1}process(t,e){e.begin("Brandes & Koepf node placement",1),this._lGraph=t,this._ni=Ef.buildFor(t);let o=t.getProperty(_.NODE_PLACEMENT_BK_FIXED_ALIGNMENT),r=t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES);this._produceBalancedLayout=o==="NONE"&&!r||o==="BALANCED",this._markConflicts(t);let i=[];switch(o){case"LEFTDOWN":i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.LEFT));break;case"LEFTUP":i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.LEFT));break;case"RIGHTDOWN":i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.RIGHT));break;case"RIGHTUP":i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.RIGHT));break;default:i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.RIGHT)),i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.RIGHT)),i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.LEFT)),i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.LEFT))}let s=new df(t,this._ni);for(let c of i)s.verticalAlignment(c,this._markedEdges),s.insideBlockShift(c);let a=new pf(t,this._ni);for(let c of i)a.horizontalCompaction(c);let l=null;if(this._produceBalancedLayout){let c=this._createBalancedLayout(i,this._ni.nodeCount);this._checkOrderConstraint(t,c)&&(l=c)}if(l==null)for(let c of i)this._checkOrderConstraint(t,c)&&(l==null||l.layoutSize()>c.layoutSize())&&(l=c);l==null&&(l=i[0]);for(let c of t.getLayers())for(let g of c.getNodes())g.getPosition().y=l.y[g.id]+l.innerShift[g.id];for(let c of i)c.cleanup();this._ni.cleanup(),this._markedEdges.clear(),e.done()}_markConflicts(t){let e=t.getLayers().length;if(e<$I)return;let o=new Int32Array(e),r=t.getLayers();for(let i=0;i<e;i++)o[i]=r[i].getNodes().length;for(let i=1;i<e-1;i++){let s=r[i+1],a=s.getNodes(),l=0,c=0;for(let g=0;g<o[i+1];g++){let h=a[g];if(g===o[i+1]-1||this._incidentToInnerSegment(h,i+1,i)){let d=o[i]-1;for(this._incidentToInnerSegment(h,i+1,i)&&(d=this._ni.nodeIndex[this._ni.leftNeighbors[h.id][0].getFirst().id]);c<=g;){let f=s.getNodes()[c];if(!this._incidentToInnerSegment(f,i+1,i))for(let E of this._ni.leftNeighbors[f.id]){let P=this._ni.nodeIndex[E.getFirst().id];(P<l||P>d)&&this._markedEdges.add(E.getSecond())}c++}l=d}}}}_incidentToInnerSegment(t,e,o){if(t.getType()!==y.LONG_EDGE)return!1;for(let r of t.getIncomingEdges())if(r.getSource().getNode().getType()===y.LONG_EDGE&&this._ni.layerIndex[r.getSource().getNode().getLayer().id]===o&&this._ni.layerIndex[t.getLayer().id]===e)return!0;return!1}_createBalancedLayout(t,e){let o=t.length,r=new rr(this._lGraph,e,null,null),i=new Float64Array(o),s=new Float64Array(o),a=new Float64Array(o),l=0;for(let h=0;h<o;h++)s[h]=Number.POSITIVE_INFINITY,a[h]=Number.NEGATIVE_INFINITY;for(let h=0;h<o;h++){let d=t[h];i[h]=d.layoutSize(),i[l]>i[h]&&(l=h);for(let f of this._lGraph)for(let E of f){let P=d.y[E.id]+d.innerShift[E.id];P<s[h]&&(s[h]=P);let S=P+E.getSize().y;S>a[h]&&(a[h]=S)}}let c=new Float64Array(o);for(let h=0;h<o;h++)c[h]=t[h].vdir===xt.DOWN?s[l]-s[h]:a[l]-a[h];let g=new Array(o);for(let h of this._lGraph.getLayers())for(let d of h.getNodes()){for(let f=0;f<o;f++)g[f]=t[f].y[d.id]+t[f].innerShift[d.id]+c[f];g.sort((f,E)=>f-E),r.y[d.id]=(g[1]+g[2])/2,r.innerShift[d.id]=0}return r}_checkOrderConstraint(t,e){for(let o of t.getLayers()){let r=Number.NEGATIVE_INFINITY;for(let i of o.getNodes()){let s=e.y[i.id]+e.innerShift[i.id]-i.getMargin().top,a=e.y[i.id]+e.innerShift[i.id]+i.getSize().y+i.getMargin().bottom;if(s>r&&a>r)r=e.y[i.id]+e.innerShift[i.id]+i.getSize().y+i.getMargin().bottom;else return!1}}return!0}getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);return e&&e.has&&e.has("EXTERNAL_PORTS"),null}};var ze=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.SIMPLE:return new tf;case n.INTERACTIVE:return new ef;case n.LINEAR_SEGMENTS:return new sf;case n.BRANDES_KOEPF:return new mf;case n.NETWORK_SIMPLEX:return new gf;default:throw new Error("Unknown node placement strategy: "+this.name)}}static valueOf(t){return n[t]}};ze.SIMPLE=new ze("SIMPLE");ze.INTERACTIVE=new ze("INTERACTIVE");ze.LINEAR_SEGMENTS=new ze("LINEAR_SEGMENTS");ze.BRANDES_KOEPF=new ze("BRANDES_KOEPF");ze.NETWORK_SIMPLEX=new ze("NETWORK_SIMPLEX");var vo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};vo.CENTER=new vo("CENTER");vo.TOP_LEFT=new vo("TOP_LEFT");var Uo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};Uo.ONE_SIDED=new Uo("ONE_SIDED");Uo.TWO_SIDED=new Uo("TWO_SIDED");Uo.OFF=new Uo("OFF");var Me=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};Me.NONE=new Me("NONE");Me.INSIDE_PORT_SIDE_GROUPS=new Me("INSIDE_PORT_SIDE_GROUPS");Me.GROUP_MODEL_ORDER=new Me("GROUP_MODEL_ORDER");Me.MODEL_ORDER=new Me("MODEL_ORDER");var so=class{constructor(t){this.name=t}toString(){return this.name}};so.NONE=new so("NONE");so.LEFTUP=new so("LEFTUP");so.RIGHTUP=new so("RIGHTUP");so.LEFTDOWN=new so("LEFTDOWN");so.RIGHTDOWN=new so("RIGHTDOWN");so.BALANCED=new so("BALANCED");var Wr=class{constructor(t){this.name=t}toString(){return this.name}};Wr.NONE=new Wr("NONE");Wr.ALTERNATING=new Wr("ALTERNATING");var Yi=class{constructor(t){this.name=t}toString(){return this.name}};Yi.INPUT_ORDER=new Yi("INPUT_ORDER");Yi.PORT_DEGREE=new Yi("PORT_DEGREE");var Fo=class{constructor(t){this._name=t}toString(){return this._name}};Fo.OFF=new Fo("OFF");Fo.SINGLE_EDGE=new Fo("SINGLE_EDGE");Fo.MULTI_EDGE=new Fo("MULTI_EDGE");var zet=new m("org.eclipse.elk.layered.cycleBreaking.strategy",()=>Xt.GREEDY),Yet=new m("org.eclipse.elk.layered.layering.strategy",()=>ae.NETWORK_SIMPLEX),Vet=new m("org.eclipse.elk.layered.layering.layerConstraint",()=>J.NONE),Xet=new m("org.eclipse.elk.layered.layering.layerChoiceConstraint",null,-1),Ket=new m("org.eclipse.elk.layered.layering.layerId",-1,-1),Zet=new m("org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",4,-1),jet=new m("org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",2,-1),$et=new m("org.eclipse.elk.layered.layering.nodePromotion.strategy",()=>ut.NONE),qet=new m("org.eclipse.elk.layered.layering.nodePromotion.maxIterations",0,0),Jet=new m("org.eclipse.elk.layered.layering.coffmanGraham.layerBound",Number.MAX_SAFE_INTEGER),Qet=new m("org.eclipse.elk.layered.crossingMinimization.strategy",()=>We.LAYER_SWEEP),tot=new m("org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",!1),eot=new m("org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",.1),oot=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",40,0),rot=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",()=>Uo.TWO_SIDED),JP=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type",()=>Uo.OFF),iot=new m("org.eclipse.elk.layered.crossingMinimization.semiInteractive",!1),sot=new m("org.eclipse.elk.layered.crossingMinimization.inLayerPredOf"),not=new m("org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf"),aot=new m("org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint",null,-1),lot=new m("org.eclipse.elk.layered.crossingMinimization.positionId",-1,-1),cot=new m("org.eclipse.elk.layered.nodePlacement.strategy",()=>ze.BRANDES_KOEPF),got=new m("org.eclipse.elk.layered.nodePlacement.favorStraightEdges"),hot=new m("org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",()=>oa.IMPROVE_STRAIGHTNESS),dot=new m("org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment",()=>so.NONE),fot=new m("org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",.3,Xe.greaterThan(0)),uot=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility"),_ot=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",()=>ye.NONE),pot=new m("org.eclipse.elk.layered.edgeRouting.splines.mode",()=>Qr.SLOPPY),Eot=new m("org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",.2),mot=new m("org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",2),Pot=new m("org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",()=>Qo.NORTH),Oot=new m("org.eclipse.elk.layered.edgeRouting.selfLoopOrdering",()=>Je.STACKED),Sot=new m("org.eclipse.elk.layered.spacing.baseValue",null,0),Tot=new m("org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",10,0),Not=new m("org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",10,0),yot=new m("org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",20,0),QP=new m("org.eclipse.elk.layered.priority.direction",0,0),Iot=new m("org.eclipse.elk.layered.priority.shortness",0,0),tO=new m("org.eclipse.elk.layered.priority.straightness",0,0),Rot=new m("org.eclipse.elk.layered.compaction.postCompaction.strategy",()=>re.NONE),Lot=new m("org.eclipse.elk.layered.compaction.postCompaction.constraints",()=>Ur.SCANLINE),Aot=new m("org.eclipse.elk.layered.compaction.connectedComponents",!1),Cot=new m("org.eclipse.elk.layered.highDegreeNodes.treatment",!1),xot=new m("org.eclipse.elk.layered.highDegreeNodes.threshold",16,0),Dot=new m("org.eclipse.elk.layered.highDegreeNodes.treeHeight",5,0),wot=new m("org.eclipse.elk.layered.wrapping.strategy",()=>Fo.OFF),Mot=new m("org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",10),bot=new m("org.eclipse.elk.layered.wrapping.correctionFactor",1),Got=new m("org.eclipse.elk.layered.wrapping.cutting.strategy",()=>ro.MSD),Hot=new m("org.eclipse.elk.layered.wrapping.cutting.cuts"),vot=new m("org.eclipse.elk.layered.wrapping.cutting.msd.freedom",1,0),Bot=new m("org.eclipse.elk.layered.wrapping.validify.strategy",()=>io.GREEDY),Uot=new m("org.eclipse.elk.layered.wrapping.validify.forbiddenIndices"),Fot=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",!0),kot=new m("org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",2),Wot=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",!0),zot=new m("org.eclipse.elk.layered.layerUnzipping.strategy",()=>Wr.NONE),Yot=new m("org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",!1),eO=new m("org.eclipse.elk.layered.layerUnzipping.layerSplit",2,1),Vot=new m("org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",!0),oO=new m("org.eclipse.elk.layered.edgeLabels.sideSelection",()=>Tt.SMART_DOWN),Xot=new m("org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy",()=>Ct.MEDIAN_LAYER),Kot=new m("org.eclipse.elk.layered.considerModelOrder.strategy",()=>ce.NONE),Zot=new m("org.eclipse.elk.layered.considerModelOrder.portModelOrder",!1),jot=new m("org.eclipse.elk.layered.considerModelOrder.noModelOrder",!1),$ot=new m("org.eclipse.elk.layered.considerModelOrder.components",()=>Me.NONE),qot=new m("org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",()=>Ao.DUMMY_NODE_OVER),Jot=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",0),Qot=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",0),trt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",0),ert=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",0),ort=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.componentGroupId",0),rrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP),irt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredSourceId"),srt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredTargetId"),nrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP),art=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmEnforcedGroupOrders","1, 2, 6, 7, 10, 11"),lrt=new m("org.eclipse.elk.layered.directionCongruency",()=>jo.READING_DIRECTION),crt=new m("org.eclipse.elk.layered.feedbackEdges",!1),grt=new m("org.eclipse.elk.layered.interactiveReferencePoint",()=>vo.CENTER),hrt=new m("org.eclipse.elk.layered.mergeEdges",!1),drt=new m("org.eclipse.elk.layered.mergeHierarchyEdges",!0),frt=new m("org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",!1),urt=new m("org.eclipse.elk.layered.portSortingStrategy",()=>Yi.INPUT_ORDER),_rt=new m("org.eclipse.elk.layered.thoroughness",7,1),prt=new m("org.eclipse.elk.layered.unnecessaryBendpoints",!1),Ert=new m("org.eclipse.elk.layered.generatePositionAndLayerIds",!1);var _=class{};_.EDGE_LABELS_PLACEMENT=new m("org.eclipse.elk.edgeLabels.placement",()=>St.CENTER);_.EDGE_LABELS_INLINE=new m("org.eclipse.elk.edgeLabels.inline",!1);_.INTERACTIVE_REFERENCE_POINT=new m("org.eclipse.elk.layered.interactiveReferencePoint",()=>vo.CENTER);_.PRIORITY_DIRECTION=QP;_.LAYERING_LAYER_CONSTRAINT=new m("org.eclipse.elk.layered.layering.layerConstraint",()=>J.NONE);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",0);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_SOURCE_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingPreferredSourceId",-1);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_TARGET_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingPreferredTargetId",-1);_.LAYERING_LAYER_ID=new m("org.eclipse.elk.layered.layering.layerId",0);_.LAYERING_COFFMAN_GRAHAM_LAYER_BOUND=new m("org.eclipse.elk.layered.layering.coffmanGraham.layerBound",Number.MAX_SAFE_INTEGER);_.PRIORITY_SHORTNESS=new m("org.eclipse.elk.layered.priority.shortness",0);_.PRIORITY_STRAIGHTNESS=tO;_.NODE_PLACEMENT_BK_EDGE_STRAIGHTENING=new m("org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",()=>oa.IMPROVE_STRAIGHTNESS);_.NODE_PLACEMENT_BK_FIXED_ALIGNMENT=new m("org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment","NONE");_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES=new m("org.eclipse.elk.layered.nodePlacement.favorStraightEdges");_.NODE_PLACEMENT_LINEAR_SEGMENTS_DEFLECTION_DAMPENING=new m("org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",.3);_.UNNECESSARY_BENDPOINTS=new m("org.eclipse.elk.layered.unnecessaryBendpoints",!1);_.JUNCTION_POINTS=new m("org.eclipse.elk.junctionPoints");_.EDGE_THICKNESS=new m("org.eclipse.elk.edge.thickness",1);_.PORT_INDEX=new m("org.eclipse.elk.port.index");_.PORT_SORTING_STRATEGY=new m("org.eclipse.elk.layered.portSortingStrategy","INPUT_ORDER");_.SPACING_PORTS_SURROUNDING=new m("org.eclipse.elk.spacing.portsSurrounding");_.COMMENT_BOX=new m("org.eclipse.elk.commentBox",!1);_.SPACING_COMMENT_COMMENT=new m("org.eclipse.elk.spacing.commentComment",20);_.SPACING_COMMENT_NODE=new m("org.eclipse.elk.spacing.commentNode",20);_.MARGINS=new m("org.eclipse.elk.margins");_.SPACING_EDGE_LABEL=new m("org.eclipse.elk.spacing.edgeLabel",2);_.SPACING_LABEL_LABEL=new m("org.eclipse.elk.spacing.labelLabel",0);_.DIRECTION=new m("org.eclipse.elk.direction",R.UNDEFINED);_.EDGE_ROUTING=new m("org.eclipse.elk.edgeRouting",()=>At.ORTHOGONAL);_.DIRECTION_CONGRUENCY=new m("org.eclipse.elk.layered.directionCongruency",jo.READING_DIRECTION);_.NODE_LABELS_PADDING=new m("org.eclipse.elk.nodeLabels.padding");_.NODE_LABELS_PLACEMENT=new m("org.eclipse.elk.nodeLabels.placement");_.EDGE_LABELS_SIDE_SELECTION=oO;_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY=new m("org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy");_.ALIGNMENT=new m("org.eclipse.elk.alignment");_.POSITION=new m("org.eclipse.elk.position");_.NODE_SIZE_MINIMUM=new m("org.eclipse.elk.nodeSize.minimum");_.HYPERNODE=new m("org.eclipse.elk.hypernode",!1);_.CROSSING_MINIMIZATION_POSITION_ID=new m("org.eclipse.elk.layered.crossingMinimization.positionId",0);_.LAYERING_LAYER_CHOICE_CONSTRAINT=new m("org.eclipse.elk.layered.layering.layerChoiceConstraint");_.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF=new m("org.eclipse.elk.layered.crossingMinimization.inLayerPredOf");_.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF=new m("org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf");_.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT=new m("org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint");_.PARTITIONING_PARTITION=new m("org.eclipse.elk.partitioning.partition");_.PORT_ANCHOR=new m("org.eclipse.elk.port.anchor");_.ASPECT_RATIO=new m("org.eclipse.elk.aspectRatio",1.6);_.SPACING_COMPONENT_COMPONENT=new m("org.eclipse.elk.spacing.componentComponent",20);_.COMPACTION_CONNECTED_COMPONENTS=new m("org.eclipse.elk.layered.compaction.connectedComponents",!1);_.PRIORITY=new m("org.eclipse.elk.priority",0);_.WRAPPING_MULTI_EDGE_IMPROVE_WRAPPED_EDGES=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",!0);_.WRAPPING_MULTI_EDGE_IMPROVE_CUTS=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",!0);_.WRAPPING_MULTI_EDGE_DISTANCE_PENALTY=new m("org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",2);_.WRAPPING_CUTTING_STRATEGY=new m("org.eclipse.elk.layered.wrapping.cutting.strategy");_.WRAPPING_VALIDIFY_STRATEGY=new m("org.eclipse.elk.layered.wrapping.validify.strategy");_.WRAPPING_CORRECTION_FACTOR=new m("org.eclipse.elk.layered.wrapping.correctionFactor",1);_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES=new m("org.eclipse.elk.layered.wrapping.validify.forbiddenIndices");_.WRAPPING_CUTTING_CUTS=new m("org.eclipse.elk.layered.wrapping.cutting.cuts");_.WRAPPING_CUTTING_MSD_FREEDOM=new m("org.eclipse.elk.layered.wrapping.cutting.msd.freedom",2);_.WRAPPING_ADDITIONAL_EDGE_SPACING=new m("org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",10);_.LAYERING_NODE_PROMOTION_STRATEGY=new m("org.eclipse.elk.layered.layering.nodePromotion.strategy");_.LAYERING_NODE_PROMOTION_MAX_ITERATIONS=new m("org.eclipse.elk.layered.layering.nodePromotion.maxIterations",0);_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES=new m("org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",!1);_.EDGE_ROUTING_SELF_LOOP_DISTRIBUTION=new m("org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",Qo.NORTH);_.EDGE_ROUTING_SELF_LOOP_ORDERING=new m("org.eclipse.elk.layered.edgeRouting.selfLoopOrdering");_.LAYER_UNZIPPING_LAYER_SPLIT=eO;_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES=new m("org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",!0);_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH=new m("org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",!1);_.HIGH_DEGREE_NODES_THRESHOLD=new m("org.eclipse.elk.layered.highDegreeNodes.threshold",16);_.HIGH_DEGREE_NODES_TREE_HEIGHT=new m("org.eclipse.elk.layered.highDegreeNodes.treeHeight",5);_.THOROUGHNESS=new m("org.eclipse.elk.layered.thoroughness",7);_.SPACING_EDGE_EDGE=new m("org.eclipse.elk.spacing.edgeEdge",10);_.SPACING_NODE_SELF_LOOP=new m("org.eclipse.elk.spacing.nodeSelfLoop",10);_.PORT_BORDER_OFFSET=new m("org.eclipse.elk.port.borderOffset",0);_.NODE_SIZE_CONSTRAINTS=new m("org.eclipse.elk.nodeSize.constraints");_.NODE_SIZE_OPTIONS=new m("org.eclipse.elk.nodeSize.options");_.CONTENT_ALIGNMENT=new m("org.eclipse.elk.contentAlignment");_.PORT_LABELS_PLACEMENT=new m("org.eclipse.elk.portLabels.placement");_.PORT_LABELS_TREAT_AS_GROUP=new m("org.eclipse.elk.portLabels.treatAsGroup",!0);_.CYCLE_BREAKING_STRATEGY=new m("org.eclipse.elk.layered.cycleBreaking.strategy",()=>Xt.GREEDY);_.LAYERING_STRATEGY=new m("org.eclipse.elk.layered.layering.strategy",()=>ae.NETWORK_SIMPLEX);_.CROSSING_MINIMIZATION_STRATEGY=new m("org.eclipse.elk.layered.crossingMinimization.strategy",()=>We.LAYER_SWEEP);_.NODE_PLACEMENT_STRATEGY=new m("org.eclipse.elk.layered.nodePlacement.strategy",()=>ze.BRANDES_KOEPF);_.RANDOM_SEED=new m("org.eclipse.elk.randomSeed",1);_.FEEDBACK_EDGES=new m("org.eclipse.elk.layered.feedbackEdges",!1);_.INTERACTIVE_LAYOUT=new m("org.eclipse.elk.interactiveLayout",!1);_.GENERATE_POSITION_AND_LAYER_IDS=new m("org.eclipse.elk.layered.generatePositionAndLayerIds",!1);_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE=new m("org.eclipse.elk.layered.crossingMinimization.semiInteractive",!1);_.LAYER_UNZIPPING_STRATEGY=new m("org.eclipse.elk.layered.layerUnzipping.strategy");_.HIGH_DEGREE_NODES_TREATMENT=new m("org.eclipse.elk.layered.highDegreeNodes.treatment",!1);_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",Uo.TWO_SIDED);_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE=JP;_.CROSSING_MINIMIZATION_GREEDY_SWITCH_ACTIVATION_THRESHOLD=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",40);_.SEPARATE_CONNECTED_COMPONENTS=new m("org.eclipse.elk.separateConnectedComponents",!0);_.NODE_SIZE_FIXED_GRAPH_SIZE=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1);_.CONSIDER_MODEL_ORDER_COMPONENTS=new m("org.eclipse.elk.layered.considerModelOrder.components",Me.NONE);_.WRAPPING_STRATEGY=new m("org.eclipse.elk.layered.wrapping.strategy");_.COMPACTION_POST_COMPACTION_STRATEGY=new m("org.eclipse.elk.layered.compaction.postCompaction.strategy");_.COMPACTION_POST_COMPACTION_CONSTRAINTS=new m("org.eclipse.elk.layered.compaction.postCompaction.constraints");_.SPACING_NODE_NODE=new m("org.eclipse.elk.spacing.nodeNode",20);_.SPACING_EDGE_NODE=new m("org.eclipse.elk.spacing.edgeNode",10);_.SPACING_LABEL_NODE=new m("org.eclipse.elk.spacing.labelNode",5);_.SPACING_LABEL_PORT_HORIZONTAL=new m("org.eclipse.elk.spacing.labelPortHorizontal",1);_.SPACING_LABEL_PORT_VERTICAL=new m("org.eclipse.elk.spacing.labelPortVertical",1);_.SPACING_PORT_PORT=new m("org.eclipse.elk.spacing.portPort",10);_.SPACING_NODE_NODE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",20);_.SPACING_EDGE_NODE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",16);_.SPACING_EDGE_EDGE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",10);_.EDGE_ROUTING_SPLINES_MODE=new m("org.eclipse.elk.layered.edgeRouting.splines.mode",()=>Qr.SLOPPY);_.EDGE_ROUTING_POLYLINE_SLOPED_EDGE_ZONE_WIDTH=new m("org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",2);_.EDGE_ROUTING_SPLINES_SLOPPY_LAYER_SPACING_FACTOR=new m("org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",.2);_.SPACING_INDIVIDUAL=new m("org.eclipse.elk.spacing.individual");_.LAYERING_MIN_WIDTH_UPPER_BOUND_ON_WIDTH=new m("org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",4,-1);_.LAYERING_MIN_WIDTH_UPPER_LAYER_ESTIMATION_SCALING_FACTOR=new m("org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",2,-1);_.PORT_CONSTRAINTS=new m("org.eclipse.elk.portConstraints",()=>H.UNDEFINED);_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER=new m("org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",!1);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",0);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_ENFORCED_GROUP_ORDERS=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationEnforcedGroupOrders",()=>[]);_.CROSSING_MINIMIZATION_HIERARCHICAL_SWEEPINESS=new m("org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",.1);_.HIERARCHY_HANDLING=new m("org.eclipse.elk.hierarchyHandling","INHERIT");_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_NODE_INFLUENCE=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",0);_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_PORT_INFLUENCE=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",0);_.CONSIDER_MODEL_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.strategy",()=>ce.NONE);_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",()=>Ao.DUMMY_NODE_OVER);_.CONSIDER_MODEL_ORDER_PORT_MODEL_ORDER=new m("org.eclipse.elk.layered.considerModelOrder.portModelOrder",!1);_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility");_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY_DEFAULT=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",()=>ye.NODE_SIZE_WHERE_SPACE_PERMITS);_.NO_LAYOUT=new m("org.eclipse.elk.noLayout",!1);_.PORT_SIDE=new m("org.eclipse.elk.port.side");_.ALGORITHM=new m("org.eclipse.elk.algorithm");_.ALGORITHM_ID="org.eclipse.elk.layered";_.PARTITIONING_ACTIVATE=new m("org.eclipse.elk.partitioning.activate",!1);_.SPACING_BASE_VALUE=new m("org.eclipse.elk.spacing.baseValue");_.MERGE_EDGES=new m("org.eclipse.elk.layered.mergeEdges",!1);_.MERGE_HIERARCHY_EDGES=new m("org.eclipse.elk.layered.mergeHierarchyEdges",!0);_.INSIDE_SELF_LOOPS_ACTIVATE=new m("org.eclipse.elk.insideSelfLoops.activate",!1);_.INSIDE_SELF_LOOPS_YO=new m("org.eclipse.elk.insideSelfLoops.yo",!1);_.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER=new m("org.eclipse.elk.layered.considerModelOrder.noModelOrder",!1);_.PADDING=new m("org.eclipse.elk.padding",new yt(12));var z=class n{static toNodeArray(t){return[...t]}static toEdgeArray(t){return[...t]}static toPortArray(t){return[...t]}static resizeNode(t,e,o,r){let i=new O(t.getSize().x,t.getSize().y),s=e.x/i.x,a=e.y/i.y,l=e.x-i.x,c=e.y-i.y;if(o){let g=t.getProperty(_.PORT_CONSTRAINTS)===H.FIXED_POS;for(let h of t.getPorts())switch(h.getSide()){case u.NORTH:g||(h.getPosition().x*=s);break;case u.EAST:h.getPosition().x+=l,g||(h.getPosition().y*=a);break;case u.SOUTH:g||(h.getPosition().x*=s),h.getPosition().y+=c;break;case u.WEST:g||(h.getPosition().y*=a);break;default:break}}if(r)for(let g of t.getLabels()){let h=g.getPosition().x+g.getSize().x/2,d=g.getPosition().y+g.getSize().y/2,f=h/i.x,E=d/i.y;f+E>=1&&(f-E>0&&d>=0?(g.getPosition().x+=l,g.getPosition().y+=c*E):f-E<0&&h>=0&&(g.getPosition().x+=l*f,g.getPosition().y+=c))}t.getSize().x=e.x,t.getSize().y=e.y,t.setProperty(_.NODE_SIZE_CONSTRAINTS,mt.fixed())}static offsetGraphs(t,e,o){for(let r of t)n.offsetGraph(r,e,o)}static offsetGraph(t,e,o){let r=new O(e,o);for(let i of t.getLayerlessNodes()){i.getPosition().add(r);for(let s of i.getPorts())for(let a of s.getOutgoingEdges()){for(let c of a.getBendPoints())c.x+=e,c.y+=o;let l=a.getProperty(_.JUNCTION_POINTS);if(l!=null)for(let c of l)c.x+=e,c.y+=o;for(let c of a.getLabels())c.getPosition().add(r)}}}static placeNodesHorizontally(t,e){let o=0,r=0;for(let i of t.getNodes())o=Math.max(o,i.getMargin().left),r=Math.max(r,i.getMargin().right);for(let i of t.getNodes()){let s=i.getProperty(_.ALIGNMENT),a;switch(s){case Kt.LEFT:a=0;break;case Kt.RIGHT:a=1;break;case Kt.CENTER:a=.5;break;default:{let f=0,E=0;for(let P of i.getPorts())P.getIncomingEdges().length>0&&f++,P.getOutgoingEdges().length>0&&E++;a=f+E===0?.5:E/(f+E)}}let l=t.getSize(),c=i.getSize().x,g=(l.x-c)*a;a>.5?g-=r*2*(a-.5):a<.5&&(g+=o*2*(.5-a));let h=i.getMargin().left;g<h&&(g=h);let d=i.getMargin().right;g>l.x-d-c&&(g=l.x-d-c),i.getPosition().x=e+g}}static findMaxNonDummyNodeWidth(t,e){if(t.getGraph().getProperty(_.DIRECTION).isVertical())return 0;let o=0;for(let r of t.getNodes())if(r.getType()===y.NORMAL){let i=r.getSize().x;e&&(i+=r.getMargin().left+r.getMargin().right),i>o&&(o=i)}return o}static computeGraphProperties(t){let e=t.getProperty(p.GRAPH_PROPERTIES);e.size>0&&e.clear();let o=n.getDirection(t);for(let r of t.getLayerlessNodes()){r.getProperty(_.COMMENT_BOX)?e.add(v.COMMENTS):r.getProperty(_.HYPERNODE)?(e.add(v.HYPERNODES),e.add(v.HYPEREDGES)):r.getType()===y.EXTERNAL_PORT&&e.add(v.EXTERNAL_PORTS);let i=r.getProperty(_.PORT_CONSTRAINTS);i===H.UNDEFINED?r.setProperty(_.PORT_CONSTRAINTS,H.FREE):i!==H.FREE&&e.add(v.NON_FREE_PORTS);for(let s of r.getPorts()){s.getIncomingEdges().length+s.getOutgoingEdges().length>1&&e.add(v.HYPEREDGES);let a=s.getSide();o===R.UP||o===R.DOWN?(a===u.EAST||a===u.WEST)&&e.add(v.NORTH_SOUTH_PORTS):(a===u.NORTH||a===u.SOUTH)&&e.add(v.NORTH_SOUTH_PORTS);for(let l of s.getOutgoingEdges()){l.getTarget().getNode()===r&&e.add(v.SELF_LOOPS);for(let c of l.getLabels())switch(c.getProperty(_.EDGE_LABELS_PLACEMENT)){case St.CENTER:e.add(v.CENTER_LABELS);break;case St.HEAD:case St.TAIL:e.add(v.END_LABELS);break;default:break}}}}}static getExternalPortPosition(t,e,o,r){let i=new O(e.getPosition().x,e.getPosition().y);i.x+=e.getSize().x/2,i.y+=e.getSize().y/2;let s=e.getProperty(_.PORT_BORDER_OFFSET)||0,a=t.getSize(),l=t.getPadding(),c=t.getOffset();switch(e.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:i.x+=l.left+c.x-o/2,i.y=-r-s,e.getPosition().y=-(l.top+s+c.y);break;case u.EAST:i.x=a.x+l.left+l.right+s,i.y+=l.top+c.y-r/2,e.getPosition().x=a.x+l.right+s-c.x;break;case u.SOUTH:i.x+=l.left+c.x-o/2,i.y=a.y+l.top+l.bottom+s,e.getPosition().y=a.y+l.bottom+s-c.y;break;case u.WEST:i.x=-o-s,i.y+=l.top+c.y-r/2,e.getPosition().x=-(l.left+s+c.x);break;default:break}return i}static isDescendant(t,e){let o=t,r=o.getGraph().getParentNode();for(;r!=null;){if(o=r,o===e)return!0;r=o.getGraph().getParentNode()}return!1}static changeCoordSystem(t,e,o){if(e===o)return;let r=e,i;do if(t.add(r.getOffset()),i=r.getParentNode(),i!=null){let s=r.getPadding();t.add(s.left,s.top),t.add(i.getPosition()),r=i.getGraph()}while(i!=null);r=o;do if(t.sub(r.getOffset()),i=r.getParentNode(),i!=null){let s=r.getPadding();t.sub(s.left,s.top),t.sub(i.getPosition()),r=i.getGraph()}while(i!=null)}static getIndividualOrInherited(t,e){if(t!=null&&t.hasProperty&&t.hasProperty(as)){let o=t.getProperty(as);if(o!=null&&o.hasProperty&&o.hasProperty(e)){let r=o.getProperty(e);if(r!=null)return r}}if(t!=null&&t.hasProperty&&t.hasProperty(e))return t.getProperty(e);if(t!=null&&typeof t.getGraph=="function"){let o=t.getGraph();if(o!=null)return o.getProperty(e)}return t!=null?t.getProperty(e):null}static getDirection(t){let e=t.getProperty(_.DIRECTION);return e===R.UNDEFINED?t.getProperty(_.ASPECT_RATIO)>=1?R.RIGHT:R.DOWN:e}static getMinimalModelOrder(t){let e=Number.MAX_SAFE_INTEGER;for(let o of t.getLayerlessNodes())o.hasProperty(p.MODEL_ORDER)&&(e=Math.min(e,o.getProperty(p.MODEL_ORDER)));return e}static createPort(t,e,o,r){let i,s=n.getDirection(r);if((r.getProperty(_.MERGE_EDGES)||t.getProperty(_.HYPERNODE))&&!t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){let l=u.fromDirection(s);i=n.provideCollectorPort(r,t,o,o===W.OUTPUT?l:l.opposed())}else{if(i=new rt,i.setNode(t),e!=null){let g=i.getPosition();g.x=e.x-t.getPosition().x,g.y=e.y-t.getPosition().y,typeof g.bound=="function"?g.bound(0,0,t.getSize().x,t.getSize().y):(g.x=Math.min(Math.max(g.x,0),t.getSize().x),g.y=Math.min(Math.max(g.y,0),t.getSize().y)),i.setSide(n._calcPortSide(i,s))}else{let g=u.fromDirection(s);i.setSide(o===W.OUTPUT?g:g.opposed())}let l=r.getProperty(p.GRAPH_PROPERTIES),c=i.getSide();s===R.LEFT||s===R.RIGHT?(c===u.NORTH||c===u.SOUTH)&&l.add(v.NORTH_SOUTH_PORTS):(s===R.UP||s===R.DOWN)&&(c===u.EAST||c===u.WEST)&&l.add(v.NORTH_SOUTH_PORTS)}return i}static provideCollectorPort(t,e,o,r){let i=null;switch(o){case W.INPUT:for(let s of e.getPorts())if(s.getProperty(p.INPUT_COLLECT))return s;i=new rt,i.setProperty(p.INPUT_COLLECT,!0);break;case W.OUTPUT:for(let s of e.getPorts())if(s.getProperty(p.OUTPUT_COLLECT))return s;i=new rt,i.setProperty(p.OUTPUT_COLLECT,!0);break;default:break}return i!=null&&(i.setNode(e),i.setSide(r),n._centerPoint(i.getPosition(),e.getSize(),r)),i}static initializePort(t,e,o,r){let i=t.getSide();if(i===u.UNDEFINED&&e.isSideFixed()&&(i=n._calcPortSide(t,o),t.setSide(i),!t.hasProperty(_.PORT_BORDER_OFFSET)&&i!==u.UNDEFINED&&(t.getPosition().x!==0||t.getPosition().y!==0)&&t.setProperty(_.PORT_BORDER_OFFSET,n._calcPortOffset(t,i))),e.isRatioFixed()){let l=0;switch(i){case u.NORTH:case u.SOUTH:{let c=t.getNode().getSize().x;c>0&&(l=t.getPosition().x/c);break}case u.EAST:case u.WEST:{let c=t.getNode().getSize().y;c>0&&(l=t.getPosition().y/c);break}default:break}t.setProperty(p.PORT_RATIO_OR_POSITION,l)}let s=t.getSize(),a=t.getAnchor();if(r!=null)a.x=r.x,a.y=r.y,t.setExplicitlySuppliedPortAnchor(!0);else if(e.isSideFixed()&&i!==u.UNDEFINED)switch(i){case u.NORTH:a.x=s.x/2;break;case u.EAST:a.x=s.x,a.y=s.y/2;break;case u.SOUTH:a.x=s.x/2,a.y=s.y;break;case u.WEST:a.y=s.y/2;break;default:break}else a.x=s.x/2,a.y=s.y/2}static createExternalPortDummy(t,e,o,r,i,s,a,l,c){let g=o,h=new ft(c);h.setType(y.EXTERNAL_PORT),h.setProperty(p.EXT_PORT_SIZE,a),h.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS);let d=t.getProperty(_.PORT_BORDER_OFFSET)||0;h.setProperty(_.PORT_BORDER_OFFSET,d);let f=new rt;f.setNode(h),e.isSideFixed()||(r>=0?g=u.fromDirection(l):g=u.fromDirection(l).opposed(),t.setProperty(_.PORT_SIDE,g));let E=new O,P=!1;if(t.hasProperty(_.PORT_ANCHOR)){let S=t.getProperty(_.PORT_ANCHOR);E.x=S.x,E.y=S.y,P=!0}else E.x=a.x/2,E.y=a.y/2;switch(g){case u.WEST:h.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE),h.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),h.getSize().y=a.y,d<0&&(h.getSize().x=-d),f.setSide(u.EAST),P||(E.x=a.x),E.x-=a.x;break;case u.EAST:h.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE),h.setProperty(p.EDGE_CONSTRAINT,De.INCOMING_ONLY),h.getSize().y=a.y,d<0&&(h.getSize().x=-d),f.setSide(u.WEST),P||(E.x=0);break;case u.NORTH:h.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP),h.getSize().x=a.x,d<0&&(h.getSize().y=-d),f.setSide(u.SOUTH),P||(E.y=a.y),E.y-=a.y;break;case u.SOUTH:h.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM),h.getSize().x=a.x,d<0&&(h.getSize().y=-d),f.setSide(u.NORTH),P||(E.y=0);break;default:break}if(f.getPosition().x=E.x,f.getPosition().y=E.y,h.setProperty(_.PORT_ANCHOR,E),e.isOrderFixed()){let S=0;if(e===H.FIXED_ORDER&&t.hasProperty(_.PORT_INDEX))switch(g){case u.NORTH:case u.EAST:S=t.getProperty(_.PORT_INDEX);break;case u.SOUTH:case u.WEST:S=-t.getProperty(_.PORT_INDEX);break;default:break}else switch(g){case u.WEST:case u.EAST:S=s.y,e.isRatioFixed()&&(S/=i.y);break;case u.NORTH:case u.SOUTH:S=s.x,e.isRatioFixed()&&(S/=i.x);break;default:break}h.setProperty(p.PORT_RATIO_OR_POSITION,S)}return h.setProperty(p.EXT_PORT_SIDE,g),h}static _calcPortSide(t,e){let o=t.getNode(),r=o.getSize().x,i=o.getSize().y;if(r<=0&&i<=0)return u.UNDEFINED;let s=t.getPosition().x,a=t.getPosition().y,l=t.getSize().x,c=t.getSize().y;if(e===R.LEFT||e===R.RIGHT){if(s<0)return u.WEST;if(s+l>r)return u.EAST}else if(e===R.UP||e===R.DOWN){if(a<0)return u.NORTH;if(a+c>i)return u.SOUTH}let g=(s+l/2)/r,h=(a+c/2)/i;return g+h<=1&&g-h<=0?u.WEST:g+h>=1&&g-h>=0?u.EAST:h<.5?u.NORTH:u.SOUTH}static _calcPortOffset(t,e){let o=t.getNode();switch(e){case u.NORTH:return-(t.getPosition().y+t.getSize().y);case u.EAST:return t.getPosition().x-o.getSize().x;case u.SOUTH:return t.getPosition().y-o.getSize().y;case u.WEST:return-(t.getPosition().x+t.getSize().x);default:return 0}}static _centerPoint(t,e,o){switch(o){case u.NORTH:t.x=e.x/2,t.y=0;break;case u.EAST:t.x=e.x,t.y=e.y/2;break;case u.SOUTH:t.x=e.x/2,t.y=e.y;break;case u.WEST:t.x=0,t.y=e.y/2;break;default:break}}};var ra=class{combine(t,e){throw new Error("AbstractGraphPlacer.combine is abstract")}moveGraphs(t,e,o,r){for(let i of e)this.moveGraph(t,i,o,r)}moveGraph(t,e,o,r){let i=e.getOffset().clone().add(o,r);for(let s of e.getLayerlessNodes()){s.getPosition().add(i);for(let a of s.getPorts())for(let l of a.getOutgoingEdges()){l.getBendPoints().offset(i);let c=l.getProperty(_.JUNCTION_POINTS);c!=null&&c.offset(i);for(let g of l.getLabels())g.getPosition().add(i)}t.getLayerlessNodes().push(s),s.setGraph(t)}}offsetGraphs(t,e,o){for(let r of t)this.offsetGraph(r,e,o)}offsetGraph(t,e,o){let r=new O(e,o);for(let i of t.getLayerlessNodes()){i.getPosition().add(r);for(let s of i.getPorts())for(let a of s.getOutgoingEdges()){a.getBendPoints().offset(r);let l=a.getProperty(_.JUNCTION_POINTS);l!=null&&l.offset(r);for(let c of a.getLabels())c.getPosition().add(r)}}}};var{SIDES_EAST:JI,SIDES_EAST_SOUTH:QI,SIDES_EAST_SOUTH_WEST:tR,SIDES_EAST_WEST:eR,SIDES_NORTH:oR,SIDES_NORTH_EAST:rR,SIDES_NORTH_EAST_SOUTH_WEST:iR,SIDES_NORTH_EAST_WEST:sR,SIDES_NORTH_SOUTH:nR,SIDES_NORTH_SOUTH_WEST:aR,SIDES_NORTH_WEST:lR,SIDES_SOUTH:cR,SIDES_SOUTH_WEST:gR,SIDES_WEST:hR}=u,sa=class{constructor(t){this._spacing=t,this.cGraph=null,this._oldPosition=new Map,this._offsets=new Map,this._globalOffset=null,this._graphSize=null,this._externalExtensions=new Map,this._externalPlaceholder=new Map;for(let e of[R.LEFT,R.RIGHT,R.UP,R.DOWN])this._externalPlaceholder.set(e,[])}getOffset(t){let e=this._oldPosition.get(t),o=this._offsets.get(t).rect.getPosition();return e.clone().sub(o)}getGlobalOffset(){return this._globalOffset}getGraphSize(){return this._graphSize}getExternalExtensions(){return this._externalExtensions}getExternalPlaceholder(){return this._externalPlaceholder}transform(t){this.cGraph=new Zn(new Set([R.LEFT,R.RIGHT,R.UP,R.DOWN]));for(let e of t.getComponents()){let o=new tr;this.cGraph.cGroups.push(o);for(let r of e.getHull()){let i=new ia(r,null,this._spacing);this._setLock(i,e.getExternalExtensionSides()),this._oldPosition.has(e)||(this._oldPosition.set(e,new O(r.x,r.y)),this._offsets.set(e,i)),this.cGraph.cNodes.push(i),o.addCNode(i)}for(let r of e.getExternalExtensions()){let i=new ia(r.getRepresentor(),null,this._spacing);this._externalExtensions.set(r,{first:o,second:i}),this._setLock(i,e.getExternalExtensionSides());let s=r.getPlaceholder?r.getPlaceholder():null;if(s!=null){let a=new ia(s,1,this._spacing);this._setLock(a,e.getExternalExtensionSides()),new tr().addCNode(a);let c=this._externalPlaceholder.get(r.getDirection())||[];c.push({first:o,second:a}),this._externalPlaceholder.set(r.getDirection(),c)}}}return this.cGraph}_setLock(t,e){let o=r=>e.size===r.size&&[...r].every(i=>e.has(i));e.size===0&&t.lock.set(!0,!0,!0,!0),o(oR)&&t.lock.set(!0,!0,!0,!1),o(JI)&&t.lock.set(!1,!0,!0,!0),o(cR)&&t.lock.set(!0,!0,!1,!0),o(hR)&&t.lock.set(!0,!1,!0,!0),o(rR)&&t.lock.set(!1,!0,!0,!1),o(QI)&&t.lock.set(!1,!0,!1,!0),o(gR)&&t.lock.set(!0,!1,!1,!0),o(lR)&&t.lock.set(!0,!1,!0,!1),o(nR)&&t.lock.set(!0,!0,!0,!0),o(eR)&&t.lock.set(!0,!0,!0,!0),o(tR)&&t.lock.set(!0,!0,!0,!0),o(aR)&&t.lock.set(!0,!0,!0,!0),o(sR)&&t.lock.set(!0,!0,!0,!0),o(iR)&&t.lock.set(!0,!0,!0,!0)}applyLayout(){for(let o of this.cGraph.cNodes)o instanceof ia&&o.applyElementPosition();let t=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),e=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let o of this.cGraph.cNodes)t.x=Math.min(t.x,o.hitbox.x),t.y=Math.min(t.y,o.hitbox.y),e.x=Math.max(e.x,o.hitbox.x+o.hitbox.width),e.y=Math.max(e.y,o.hitbox.y+o.hitbox.height);for(let o of this._externalPlaceholder.values())for(let r of o){let i=r.second;t.x=Math.min(t.x,i.hitbox.x),t.y=Math.min(t.y,i.hitbox.y),e.x=Math.max(e.x,i.hitbox.x+i.hitbox.width),e.y=Math.max(e.y,i.hitbox.y+i.hitbox.height)}this._globalOffset=t.clone().negate(),this._graphSize=e.clone().sub(t),this.cGraph.cGroups.length=0,this.cGraph.cNodes.length=0}},ia=class extends ki{constructor(t,e,o){super(),this.rect=t,this.hitbox=new dt(t.x,t.y,t.width,t.height),this._individualSpacing=e,this._defaultSpacing=o}getHorizontalSpacing(){return this._individualSpacing!=null?this._individualSpacing:this._defaultSpacing}getVerticalSpacing(){return this._individualSpacing!=null?this._individualSpacing:this._defaultSpacing}applyElementPosition(){this.rect.x=this.hitbox.x,this.rect.y=this.hitbox.y}getElementPosition(){return this.rect.x}toString(){return""}};sa.SPACING_HANDLER={getHorizontalSpacing(n,t){let e=typeof n.getHorizontalSpacing=="function"?n.getHorizontalSpacing():0,o=typeof t.getHorizontalSpacing=="function"?t.getHorizontalSpacing():0;return Math.min(e,o)},getVerticalSpacing(n,t){let e=typeof n.getVerticalSpacing=="function"?n.getVerticalSpacing():0,o=typeof t.getVerticalSpacing=="function"?t.getVerticalSpacing():0;return Math.min(e,o)}};var ir=Object.freeze({HORZ:"HORZ",VERT:"VERT"}),j_=new Set([R.LEFT,R.RIGHT]),$_=new Set([R.UP,R.DOWN]),na=class n{constructor(){this._compactionGraph=null,this._transformer=null,this._verticalExternalExtensions=[],this._horizontalExternalExtensions=[],this._compactor=null,this._topLeft=new O,this._bottomRight=new O}static init(t,e){let o=new n;return o._transformer=new sa(e),o._compactionGraph=o._transformer.transform(t),o}compact(t){let e=[];this._verticalExternalExtensions=[],this._horizontalExternalExtensions=[];for(let[a,l]of this._transformer.getExternalExtensions()){e.push(l.second);let c=a.getDirection();c===R.LEFT||c===R.RIGHT?this._horizontalExternalExtensions.push(l):this._verticalExternalExtensions.push(l)}this._addExternalEdgeRepresentations(this._horizontalExternalExtensions),this._addExternalEdgeRepresentations(this._verticalExternalExtensions),this._compactor=new Br(this._compactionGraph),this._compactor.setSpacingsHandler(sa.SPACING_HANDLER),this._removeExternalEdgeRepresentations(this._horizontalExternalExtensions),this._removeExternalEdgeRepresentations(this._verticalExternalExtensions);for(let a of this._compactor.cGraph.cNodes)e.push(a);this._topLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this._bottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let a of e)this._topLeft.x=Math.min(this._topLeft.x,a.hitbox.x),this._topLeft.y=Math.min(this._topLeft.y,a.hitbox.y),this._bottomRight.x=Math.max(this._bottomRight.x,a.hitbox.x+a.hitbox.width),this._bottomRight.y=Math.max(this._bottomRight.y,a.hitbox.y+a.hitbox.height);let o={isLocked:(a,l)=>{let c=a.cGroup||a;return c.outDegree!=null&&c.outDegree!==0}};this._compactor.setLockFunction(o);let r=0,i;do i=this._compactIteration(r),r++;while((r<2||i>n.EPSILON)&&r<n.MAX_ITERATION);let s={isLocked:(a,l)=>{let c=a.cGroup!=null?a:null;if(c!=null){let g=c.lock&&c.lock.getDirection(l);if(g||c.cGroup.outDegree!==0&&g)return!0}return!1}};this._compactor.setLockFunction(s),this._compactIteration(0),this._compactor.finish(),this._transformer.applyLayout()}_compactIteration(t){let e=0;for(let r of this._compactionGraph.cGroups)r.delta=0,r.deltaNormalized=0;this._addPlaceholders(ir.HORZ),this._addExternalEdgeRepresentations(this._verticalExternalExtensions),this._compactor.calculateGroupOffsets(),this._compactor.forceConstraintsRecalculation();let o=R.LEFT;this._compactor.changeDirection(o).compact().changeDirection(R.RIGHT).compact().changeDirection(o).compact(),this._compactor.changeDirection(R.LEFT),this._removeExternalEdgeRepresentations(this._verticalExternalExtensions),this._removePlaceholders(ir.HORZ),this._updateExternalExtensionDimensions(ir.HORZ),this._updatePlaceholders(ir.VERT),this._addPlaceholders(ir.VERT),this._addExternalEdgeRepresentations(this._horizontalExternalExtensions),this._compactor.calculateGroupOffsets();for(let r of this._compactionGraph.cGroups)e+=Math.abs(r.deltaNormalized);for(let r of this._compactionGraph.cGroups)r.delta=0,r.deltaNormalized=0;o=R.UP,this._compactor.changeDirection(o).forceConstraintsRecalculation().compact().changeDirection(R.DOWN).compact().changeDirection(o).compact(),this._compactor.changeDirection(R.LEFT),this._removeExternalEdgeRepresentations(this._horizontalExternalExtensions),this._removePlaceholders(ir.VERT),this._updateExternalExtensionDimensions(ir.VERT),this._updatePlaceholders(ir.HORZ),this._compactor.forceConstraintsRecalculation();for(let r of this._compactionGraph.cGroups)e+=Math.abs(r.deltaNormalized);return e}getGraphSize(){return this._transformer.getGraphSize()}getOffset(t){return this._transformer.getOffset(t).negate().add(this._transformer.getGlobalOffset())}_addExternalEdgeRepresentations(t){for(let e of t)this._compactionGraph.cNodes.push(e.second),e.first.addCNode(e.second)}_removeExternalEdgeRepresentations(t){for(let e of t){let o=this._compactionGraph.cNodes.indexOf(e.second);o>=0&&this._compactionGraph.cNodes.splice(o,1),typeof e.first.removeCNode=="function"&&e.first.removeCNode(e.second)}}_addPlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[])this._compactionGraph.cNodes.push(r.second),r.second.cGroup!=null&&this._compactionGraph.cGroups.push(r.second.cGroup)}_removePlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[]){let i=this._compactionGraph.cNodes.indexOf(r.second);i>=0&&this._compactionGraph.cNodes.splice(i,1);let s=this._compactionGraph.cGroups.indexOf(r.second.cGroup);s>=0&&this._compactionGraph.cGroups.splice(s,1)}}_updatePlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[]){let i=r.second,a=r.first.deltaNormalized;switch(o){case R.LEFT:case R.RIGHT:i.hitbox.y+=a;break;case R.UP:case R.DOWN:i.hitbox.x+=a;break}}}_updateExternalExtensionDimensions(t){for(let[e,o]of this._transformer.getExternalExtensions()){if(t===ir.VERT){if(e.getDirection()!==R.UP&&e.getDirection()!==R.DOWN)continue}else if(e.getDirection()!==R.LEFT&&e.getDirection()!==R.RIGHT)continue;let r=o.second,s=o.first.deltaNormalized;switch(e.getDirection()){case R.LEFT:r.hitbox.x=this._topLeft.x,r.hitbox.width=Math.max(1,r.hitbox.width+s);break;case R.RIGHT:r.hitbox.x=r.hitbox.x+s,r.hitbox.width=Math.max(1,r.hitbox.width-s);break;case R.UP:r.hitbox.y=this._topLeft.y,r.hitbox.height=Math.max(1,r.hitbox.height+s);break;case R.DOWN:r.hitbox.y=r.hitbox.y+s,r.hitbox.height=Math.max(1,r.hitbox.height-s);break}}}};na.MAX_ITERATION=10;na.EPSILON=1e-4;var Ye=class n{constructor(t,e,o){this.x=t,this.y=e,this.quadrant=o,this.convex=!0}static from(t){return new n(t.x,t.y)}toString(){return`(${this.x}, ${this.y}${this.convex?"cx":""}${this.quadrant})`}equals(t){return t==null||!(t instanceof n)?!1:this.x===t.x&&this.y===t.y}},Bt=class n{constructor(t){this.name=t,Object.freeze(this)}isUpper(){return this===n.Q1||this===n.Q2}isLeft(){return this===n.Q1||this===n.Q4}static isBothLeftOrBothRight(t,e){return t===n.Q1&&e===n.Q4||t===n.Q4&&e===n.Q1||t===n.Q3&&e===n.Q2||t===n.Q2&&e===n.Q3}static isOneLeftOneRight(t,e){return t===n.Q1&&e===n.Q2||t===n.Q1&&e===n.Q3||t===n.Q4&&e===n.Q3||t===n.Q4&&e===n.Q2}toString(){return this.name}};Bt.Q1=new Bt("Q1");Bt.Q4=new Bt("Q4");Bt.Q2=new Bt("Q2");Bt.Q3=new Bt("Q3");var rO=new Map([[Bt.Q1,0],[Bt.Q4,1],[Bt.Q2,2],[Bt.Q3,3]]),dR=(n,t)=>n.x===t.x?t.y-n.y:n.x-t.x,fR=(n,t)=>n.x===t.x?n.y-t.y:n.x-t.x,uR=(n,t)=>n.x===t.x?t.y-n.y:t.x-n.x,_R=(n,t)=>n.x===t.x?n.y-t.y:t.x-n.x,pR=(n,t)=>{if(n.x===t.x){if(n.quadrant===t.quadrant||Bt.isBothLeftOrBothRight(n.quadrant,t.quadrant)){let e=n.quadrant.isLeft()?1:-1;if(n.convex&&!t.convex)return e;if(!n.convex&&t.convex)return-e}return rO.get(n.quadrant)-rO.get(t.quadrant)}return n.x-t.x},aa=class{constructor(t){switch(this.quadrant=t,this.points=[],t){case Bt.Q1:case Bt.Q2:this._compare=(e,o)=>o-e,this._maximalY=Number.POSITIVE_INFINITY;break;case Bt.Q3:case Bt.Q4:this._compare=(e,o)=>e-o,this._maximalY=Number.NEGATIVE_INFINITY;break}}handle(t){this._compare(t.y,this._maximalY)>0&&(this.points.push(new Ye(t.x,t.y,this.quadrant)),this._maximalY=t.y)}},dl=class n{constructor(){this.hull=[],this.xMax1=null,this.xMax2=null,this.xMin1=null,this.xMin2=null,this.yMax1=null,this.yMax2=null,this.yMin1=null,this.yMin2=null}static of(t){let e=new n;for(let a of t)(e.xMax1==null||a.x>=e.xMax1.x)&&(e.xMax2=e.xMax1,e.xMax1=a),(e.xMin1==null||a.x<=e.xMin1.x)&&(e.xMin2=e.xMin1,e.xMin1=a),(e.yMax1==null||a.y>=e.yMax1.y)&&(e.yMax2=e.yMax1,e.yMax1=a),(e.yMin1==null||a.y<=e.yMin1.y)&&(e.yMin2=e.yMin1,e.yMin1=a);let o=new aa(Bt.Q1);Zo.execute(t,fR,o);let r=new aa(Bt.Q4);Zo.execute(t,dR,r);let i=new aa(Bt.Q2);Zo.execute(t,_R,i);let s=new aa(Bt.Q3);Zo.execute(t,uR,s),n._addConcaveCorners(o.points,Bt.Q1),n._addConcaveCorners(i.points,Bt.Q2),n._addConcaveCorners(s.points,Bt.Q3),n._addConcaveCorners(r.points,Bt.Q4),e.hull=[];for(let a of o.points)e.hull.push(a);for(let a=i.points.length-1;a>=0;a--)e.hull.push(i.points[a]);for(let a of s.points)e.hull.push(a);for(let a=r.points.length-1;a>=0;a--)e.hull.push(r.points[a]);return e}getHull(){return this.hull}splitIntoRectangles(){let t=new q_(this);return Zo.execute(this.hull,pR,t),t.queued!=null&&t.rects.push(t.queued),t.rects}static _addConcaveCorners(t,e){let o=[];if(t.length!==0){o.push(t[0]);for(let r=1;r<t.length;r++){let i=t[r-1],s=t[r],a=new Ye(s.x,i.y,e);a.convex=!1,o.push(a),o.push(s)}t.length=0;for(let r of o)t.push(r)}}},q_=class{constructor(t){this._hull=t,this.rects=[],this._minY=null,this._maxY=null,this._lastX=Math.min(t.xMin1.x,t.xMin2.x),this.queued=null,this._queuedPnt=null}handle(t){if(this.queued!=null&&(t.x!==this._queuedPnt.x||Bt.isOneLeftOneRight(this._queuedPnt.quadrant,t.quadrant))&&(this.rects.push(this.queued),this._lastX=this.queued.x+this.queued.width,this.queued=null,this._queuedPnt=null),t.quadrant.isUpper()?this._minY=t:this._maxY=t,(t.quadrant===Bt.Q1&&!t.convex||t.quadrant===Bt.Q2&&t.convex||t.quadrant===Bt.Q3&&t.convex||t.quadrant===Bt.Q4&&!t.convex)&&this._minY!=null&&this._maxY!=null){let e=new dt(this._lastX,this._minY.y,t.x-this._lastX,this._maxY.y-this._minY.y);this.queued=e,this._queuedPnt=t}}};var Er=class n{constructor(){this._compactor=null,this._yetAnotherOffset=null,this._compactedGraphSize=null,this._graphTopLeft=null,this._graphBottomRight=null}compact(t,e,o){this._graphTopLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this._graphBottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let i of t)for(let s of i.getLayerlessNodes()){let a=s.getPosition(),l=s.getSize(),c=s.getMargin();this._graphTopLeft.x=Math.min(this._graphTopLeft.x,a.x-c.left),this._graphTopLeft.y=Math.min(this._graphTopLeft.y,a.y-c.top),this._graphBottomRight.x=Math.max(this._graphBottomRight.x,a.x+l.x+c.right),this._graphBottomRight.y=Math.max(this._graphBottomRight.y,a.y+l.y+c.bottom)}let r=new J_;for(let i of t){let s=this._transformLGraph(i);r.getComponents().push(s),s.containsRegularNodes|=s.getExternalExtensionSides().size!==0}this._compactor=na.init(r,o),this._compactor.compact(new Ie),this._yetAnotherOffset=new O,this._compactedGraphSize=this._compactor.getGraphSize();for(let i of r.getComponents()){let s=this._compactor.getOffset(i);z.offsetGraph(i.graph,s.x,s.y);for(let a of i.getNodes())if(a.getType()===y.EXTERNAL_PORT){let l=this._getExternalPortPosition(a.getPosition(),a.getProperty(p.EXT_PORT_SIDE));a.getPosition().reset().add(l)}}for(let i of r.getComponents())for(let s of i.getExternalEdges()){let a=new st;for(let c of s.getBendPoints())a.add(c);a.add(0,s.getSource().getAbsoluteAnchor()),a.add(s.getTarget().getAbsoluteAnchor());let l=null;for(let c of a){if(l==null){l=c;continue}Math.abs(l.x-c.x)<n.EPSILON?(this._yetAnotherOffset.x=Math.min(this._yetAnotherOffset.x,l.x),this._compactedGraphSize.x=Math.max(this._compactedGraphSize.x,l.x)):Math.abs(l.y-c.y)<n.EPSILON&&(this._yetAnotherOffset.y=Math.min(this._yetAnotherOffset.y,l.y),this._compactedGraphSize.y=Math.max(this._compactedGraphSize.y,l.y)),l=c}}this._yetAnotherOffset.negate(),this._compactedGraphSize.add(this._yetAnotherOffset)}getOffset(){return this._yetAnotherOffset}getGraphSize(){return this._compactedGraphSize}_transformLGraph(t){let e=new Q_(t);e.containsRegularNodes||this._createDummyNode(t);let o=new op;n._componentHullPoints(t,o);let r=new Map;for(let a of[R.LEFT,R.RIGHT,R.UP,R.DOWN,R.UNDEFINED])r.set(a,[]);let i=new ip;for(let a of t.getLayerlessNodes())for(let l of a.getOutgoingEdges())if(n._isExternalEdge(l)){let c=this._transformLEdge(l,o,i),g=c.getDirection(),h=r.get(g)||[];h.push(c.getRepresentative()),r.set(g,h)}let s=[];for(let a of e.getExternalExtensionSides()){let l=a.ordinal(),c=i.min[l],g=i.max[l],h=i.extent[l],d=null,f=null;switch(a){case u.WEST:d=new dt(this._graphTopLeft.x,c,o.topLeft.x-this._graphTopLeft.x,g-c),f=new dt(this._graphTopLeft.x,c,h,g-c),o.add(d.getTopRight()),o.add(d.getBottomRight());break;case u.EAST:d=new dt(o.bottomRight.x,c,this._graphBottomRight.x-o.bottomRight.x,g-c),f=new dt(this._graphBottomRight.x-h,c,h,g-c),o.add(d.getTopLeft()),o.add(d.getBottomLeft());break;case u.NORTH:d=new dt(c,this._graphTopLeft.y,g-c,o.topLeft.y-this._graphTopLeft.y),f=new dt(c,this._graphTopLeft.y,g-c,h),o.add(d.getBottomLeft()),o.add(d.getBottomRight());break;case u.SOUTH:d=new dt(c,o.bottomRight.y,g-c,this._graphBottomRight.y-o.bottomRight.y),f=new dt(c,this._graphBottomRight.y-h,g-c,h),o.add(d.getTopLeft()),o.add(d.getTopRight());break}if(d!=null){let E=new tp;E.side=a,E.extension=d,E.placeholder=f,E.edges=new Set(r.get(n._portSideToDirection(a))||[]),s.push(E)}}for(let a of s)e.externalExtensions.push(a);return e.rectilinearConvexHull=dl.of(o).splitIntoRectangles(),e}_createDummyNode(t){if(t.getLayerlessNodes().length!==1)throw new Error("_createDummyNode precondition failed");let e=t.getLayerlessNodes()[0],o=new ft(t);switch(t.getLayerlessNodes().push(o),o.getSize().x=Math.max(1,e.getSize().x),o.getSize().y=Math.max(1,e.getSize().y),o.getPosition().x=e.getPosition().x,o.getPosition().y=e.getPosition().y,e.getProperty(p.EXT_PORT_SIDE)){case u.WEST:o.getPosition().x+=2;break;case u.NORTH:o.getPosition().y+=2;break;case u.EAST:o.getPosition().x-=2;break;case u.SOUTH:o.getPosition().y-=2;break}let r=new rt;r.setNode(o);let i=new _e,s=e.getPorts()[0];return i.setSource(s),i.setTarget(r),r.getPosition().reset().add(s.getPosition()),r.getAnchor().reset().add(s.getAnchor()),o}static _componentHullPoints(t,e){for(let o of t.getLayerlessNodes())if(o.getType()!==y.EXTERNAL_PORT){n._addLGraphElementBounds(e,o,new O);for(let r of o.getOutgoingEdges())if(!n._isExternalEdge(r))for(let i of r.getBendPoints())e.add(Ye.from(i))}}static _addLGraphElementBounds(t,e,o){let r=null;e instanceof ft||e instanceof rt?r=e.getMargin():r=new Gr;let i=e.getPosition().x,s=e.getPosition().y,a=e.getSize().x,l=e.getSize().y;t.add(new Ye(i-r.left+o.x,s-r.top+o.y)),t.add(new Ye(i-r.left+o.x,s+l+r.bottom+o.y)),t.add(new Ye(i+a+r.right+o.x,s-r.top+o.y)),t.add(new Ye(i+a+r.right+o.x,s+l+r.bottom+o.y))}static _isExternalEdge(t){return t.getSource().getNode().getType()===y.EXTERNAL_PORT||t.getTarget().getNode().getType()===y.EXTERNAL_PORT}_transformLEdge(t,e,o){let r=new ep(t),i=n._edgeToSegments(t,r),s=Math.max(t.getProperty(_.EDGE_THICKNESS)||1,1);for(let d of i.innerSegments){let f=n._segmentToRectangle(d.first,d.second,s);e.addRect(f)}let a=r.externalPortSide,l=n._segmentToRectangle(i.outerSegment.first,i.outerSegment.second,s),c=a.ordinal();a===u.WEST||a===u.EAST?(o.min[c]=Math.min(o.min[c],l.y),o.max[c]=Math.max(o.max[c],l.y+l.height)):(o.min[c]=Math.min(o.min[c],l.x),o.max[c]=Math.max(o.max[c],l.x+l.width));let g=Number.NEGATIVE_INFINITY,h=r.externalPort.getNode().getMargin();switch(a){case u.WEST:g=h.right;break;case u.EAST:g=h.left;break;case u.NORTH:g=h.bottom;break;case u.SOUTH:g=h.top;break}return o.extent[c]=Math.max(o.extent[c],g),r}static _segmentToRectangle(t,e,o){return new dt(Math.min(t.x,e.x)-o/2,Math.min(t.y,e.y)-o/2,Math.abs(t.x-e.x)+o,Math.abs(t.y-e.y)+o)}static _edgeToSegments(t,e){let o=e.externalPort,r=e.externalPortSide,i=t.getSource().getAbsoluteAnchor(),s=t.getTarget().getAbsoluteAnchor();o===t.getSource()?(i=n._getExternalPortPositionStatic(i,r,null),s=n._getPortPositionOnMargin(t.getTarget())):(i=n._getPortPositionOnMargin(t.getSource()),s=n._getExternalPortPositionStatic(s,r,null));let a=new st;for(let g of t.getBendPoints())a.add(g);a.addFirst(i),a.addLast(s);let l=t.getSource()===o,c=new rp;for(let g=0;g<a.size()-1;g++){let h={first:a.get(g),second:a.get(g+1)};l&&g===0||!l&&g===a.size()-2?c.outerSegment=h:c.innerSegments.push(h)}return c}_getExternalPortPosition(t,e){return n._getExternalPortPositionStatic(t,e,this)}static _getExternalPortPositionStatic(t,e,o){if(o==null||o._graphTopLeft==null||o._graphBottomRight==null)return t.clone();switch(e){case u.NORTH:return new O(t.x,Math.min(o._graphTopLeft.y,t.y));case u.EAST:return new O(Math.max(o._graphBottomRight.x,t.x),t.y);case u.SOUTH:return new O(t.x,Math.max(o._graphBottomRight.y,t.y));case u.WEST:return new O(Math.min(t.x,o._graphTopLeft.x),t.y)}return t.clone()}static _getPortPositionOnMargin(t){let e=t.getAbsoluteAnchor().clone(),o=t.getNode().getMargin();switch(t.getSide()){case u.NORTH:e.y-=o.top;break;case u.EAST:e.x+=o.right;break;case u.SOUTH:e.y+=o.bottom;break;case u.WEST:e.x-=o.left;break}return e}static _portSideToDirection(t){switch(t){case u.NORTH:return R.UP;case u.WEST:return R.LEFT;case u.EAST:return R.RIGHT;case u.SOUTH:return R.DOWN}return R.UNDEFINED}};Er.EPSILON=1e-4;var J_=class{constructor(){this._components=[],this.containsExternalPorts=!1}getComponents(){return this._components}isContainsExternalExtensions(){return this.containsExternalPorts}*[Symbol.iterator](){yield*nr(this._components)}},Q_=class{constructor(t){this.graph=t,this.containsRegularNodes=!1;for(let e of t.getLayerlessNodes())this.containsRegularNodes|=e.getType()===y.NORMAL;this.rectilinearConvexHull=[],this.externalExtensions=[]}getExternalExtensionSides(){return this.graph.getProperty(p.EXT_PORT_CONNECTIONS)||new Set}getHull(){return this.rectilinearConvexHull}getExternalExtensions(){return this.externalExtensions}getNodes(){return this.graph.getLayerlessNodes()}getExternalEdges(){let t=[];for(let e of this.externalExtensions)for(let o of e.getRepresentative())t.push(o);return t}},tp=class{constructor(){this.edges=new Set,this.side=null,this.extension=null,this.placeholder=null}getRepresentative(){return this.edges}getRepresentor(){return this.extension}getParent(){throw new Error("InternalUnionExternalExtension.getParent is unsupported")}getDirection(){return Er._portSideToDirection(this.side)}getPlaceholder(){return this.placeholder}},ep=class{constructor(t){if(this.edge=t,this.externalPort=null,this.externalPortSide=null,this.externalExtensionRect=null,this.parent=null,t.getSource().getNode().getType()===y.EXTERNAL_PORT)this.externalPort=t.getSource(),this.externalPortSide=t.getSource().getNode().getProperty(p.EXT_PORT_SIDE);else if(t.getTarget().getNode().getType()===y.EXTERNAL_PORT)this.externalPort=t.getTarget(),this.externalPortSide=t.getTarget().getNode().getProperty(p.EXT_PORT_SIDE);else throw new Error(`Edge ${t} is not an external edge`)}getDirection(){return Er._portSideToDirection(this.externalPortSide)}getRepresentative(){return this.edge}getRepresentor(){return this.externalExtensionRect}getParent(){return this.parent}},op=class extends Array{constructor(){super(),this.topLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this.bottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)}add(t){let e=t instanceof Ye?t:Ye.from(t);return this.topLeft.x=Math.min(this.topLeft.x,e.x),this.topLeft.y=Math.min(this.topLeft.y,e.y),this.bottomRight.x=Math.max(this.bottomRight.x,e.x),this.bottomRight.y=Math.max(this.bottomRight.y,e.y),super.push(e),!0}addRect(t){this.add(new Ye(t.x,t.y)),this.add(new Ye(t.x+t.width,t.y)),this.add(new Ye(t.x,t.y+t.height)),this.add(new Ye(t.x+t.width,t.y+t.height))}},rp=class{constructor(){this.innerSegments=[],this.outerSegment=null}},ip=class{constructor(){this.min=new Array(5).fill(Number.POSITIVE_INFINITY),this.max=new Array(5).fill(Number.NEGATIVE_INFINITY),this.extent=new Array(5).fill(Number.NEGATIVE_INFINITY)}};var la=class extends ra{combine(t,e){if(t.length===1){let a=t[0];a!==e&&(e.getLayerlessNodes().length=0,this.moveGraph(e,a,0,0),e.copyProperties(a),e.getPadding().copy(a.getPadding()),e.getSize().x=a.getSize().x,e.getSize().y=a.getSize().y);return}else if(t.length===0){e.getLayerlessNodes().length=0,e.getSize().x=0,e.getSize().y=0;return}this.sortComponents(t,e);let o=t[0];e.getLayerlessNodes().length=0,e.copyProperties(o);let r=0,i=0;for(let a of t){let l=a.getSize();r=Math.max(r,l.x),i+=l.x*l.y}r=Math.max(r,Math.sqrt(i)*e.getProperty(_.ASPECT_RATIO));let s=e.getProperty(_.SPACING_COMPONENT_COMPONENT);if(this.placeComponents(t,e,r,s),o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)){let a=new Er;a.compact(t,e.getSize(),s);for(let l of t)l.getOffset().reset().add(a.getOffset());e.getSize().reset().add(a.getGraphSize())}this.moveGraphs(e,t,0,0)}sortComponents(t,e){if(e.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)===Me.NONE){for(let o of t){let r=0;for(let i of o.getLayerlessNodes())r+=i.getProperty(_.PRIORITY)||0;o.id=r}t.sort((o,r)=>{let i=r.id-o.id;if(i===0){let s=o.getSize().x*o.getSize().y,a=r.getSize().x*r.getSize().y;return s-a}return i})}}placeComponents(t,e,o,r){let i=0,s=0,a=0,l=r;for(let c of t){let g=c.getSize();i+g.x>o&&(i=0,s+=a+r,a=0);let h=c.getOffset();this.offsetGraph(c,i+h.x,s+h.y),h.reset(),l=Math.max(l,i+g.x),a=Math.max(a,g.y),i+=g.x+r}e.getSize().x=l,e.getSize().y=s+a}};var{SIDES_EAST:Pf,SIDES_EAST_SOUTH:ca,SIDES_EAST_SOUTH_WEST:no,SIDES_EAST_WEST:Vi,SIDES_NONE:iO,SIDES_NORTH:Of,SIDES_NORTH_EAST:ga,SIDES_NORTH_EAST_SOUTH:ao,SIDES_NORTH_EAST_SOUTH_WEST:pe,SIDES_NORTH_EAST_WEST:lo,SIDES_NORTH_SOUTH:Xi,SIDES_NORTH_SOUTH_WEST:co,SIDES_NORTH_WEST:ha,SIDES_SOUTH:Sf,SIDES_SOUTH_WEST:da,SIDES_WEST:Tf}=u,zr=class n{constructor(t){this.components=new Map,t!==void 0&&this.add(t)}add(t){if(this._canAdd(t)){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=this.components.get(e);return o===void 0&&(o=[],this.components.set(e,o)),o.push(t),!0}return!1}_canAdd(t){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=n.CONSTRAINTS.get(e);if(!o)return!0;for(let r of o){let i=this.components.get(r);if(i&&i.length>0)return!1}return!0}*getPortSides(){for(let[t,e]of this.components)for(let o=0;o<e.length;o++)yield t}getComponents(t){if(t!==void 0)return this.components.get(t)||[];let e=[];for(let o of this.components.values())for(let r of o)e.push(r);return e}};zr.CONSTRAINTS=new Map;function et(n,t){let e=zr.CONSTRAINTS.get(n);e||(e=[],zr.CONSTRAINTS.set(n,e)),e.push(t)}et(iO,pe);et(Tf,pe);et(Tf,co);et(Pf,ao);et(Pf,pe);et(Of,pe);et(Of,lo);et(Sf,no);et(Sf,pe);et(Xi,Vi);et(Xi,pe);et(Xi,lo);et(Xi,no);et(Vi,Xi);et(Vi,co);et(Vi,ao);et(Vi,pe);et(ha,ha);et(ha,lo);et(ha,co);et(ga,ga);et(ga,lo);et(ga,ao);et(da,da);et(da,no);et(da,co);et(ca,ca);et(ca,no);et(ca,ao);et(lo,Of);et(lo,Xi);et(lo,ha);et(lo,ga);et(lo,pe);et(lo,lo);et(lo,co);et(lo,ao);et(no,Sf);et(no,Xi);et(no,da);et(no,ca);et(no,no);et(no,co);et(no,ao);et(no,pe);et(co,Tf);et(co,Vi);et(co,ha);et(co,da);et(co,lo);et(co,no);et(co,co);et(co,pe);et(ao,Pf);et(ao,Vi);et(ao,ga);et(ao,ca);et(ao,lo);et(ao,no);et(ao,ao);et(ao,pe);et(pe,iO);et(pe,Tf);et(pe,Pf);et(pe,Of);et(pe,Sf);et(pe,Xi);et(pe,Vi);et(pe,lo);et(pe,no);et(pe,co);et(pe,ao);et(pe,pe);var{SIDES_EAST:sO,SIDES_EAST_SOUTH:nO,SIDES_EAST_SOUTH_WEST:aO,SIDES_EAST_WEST:lO,SIDES_NONE:cO,SIDES_NORTH:gO,SIDES_NORTH_EAST:hO,SIDES_NORTH_EAST_SOUTH:dO,SIDES_NORTH_EAST_SOUTH_WEST:fO,SIDES_NORTH_EAST_WEST:ER,SIDES_NORTH_SOUTH:uO,SIDES_NORTH_SOUTH_WEST:mR,SIDES_NORTH_WEST:PR,SIDES_SOUTH:_O,SIDES_SOUTH_WEST:pO,SIDES_WEST:EO}=u,fa=class extends ra{constructor(){super(),this.componentGroups=[]}combine(t,e){if(this.componentGroups.length=0,e.getLayerlessNodes().length=0,t.length===0){e.getSize().x=0,e.getSize().y=0;return}let o=t[0];e.copyProperties(o);for(let s of t)this._addComponent(s);let r=new O,i=o.getProperty(_.SPACING_COMPONENT_COMPONENT);for(let s of this.componentGroups){let a=this._placeComponents(s,i);this.offsetGraphs(s.getComponents(),r.x,r.y),r.x+=a.x,r.y+=a.y}if(e.getSize().x=r.x-i,e.getSize().y=r.y-i,o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)&&o.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL){for(let a of t)this.offsetGraph(a,a.getOffset().x,a.getOffset().y);let s=new Er;s.compact(t,e.getSize(),i);for(let a of t)a.getOffset().reset().add(s.getOffset());e.getSize().reset().add(s.getGraphSize())}for(let s of this.componentGroups)this.moveGraphs(e,s.getComponents(),0,0)}_addComponent(t){for(let e of this.componentGroups)if(e.add(t))return;this.componentGroups.push(new zr(t))}_placeComponents(t,e){let o=this._placeComponentsInRows(t.getComponents(cO),e),r=this._placeComponentsHorizontally(t.getComponents(gO),e),i=this._placeComponentsHorizontally(t.getComponents(_O),e),s=this._placeComponentsVertically(t.getComponents(EO),e),a=this._placeComponentsVertically(t.getComponents(sO),e),l=this._placeComponentsHorizontally(t.getComponents(PR),e),c=this._placeComponentsHorizontally(t.getComponents(hO),e),g=this._placeComponentsHorizontally(t.getComponents(pO),e),h=this._placeComponentsHorizontally(t.getComponents(nO),e),d=this._placeComponentsVertically(t.getComponents(lO),e),f=this._placeComponentsHorizontally(t.getComponents(uO),e),E=this._placeComponentsHorizontally(t.getComponents(ER),e),P=this._placeComponentsHorizontally(t.getComponents(aO),e),S=this._placeComponentsVertically(t.getComponents(mR),e),T=this._placeComponentsVertically(t.getComponents(dO),e),N=this._placeComponentsHorizontally(t.getComponents(fO),e),I=Ft.maxd(l.x,s.x,g.x,S.x),C=Ft.maxd(r.x,o.x,i.x,N.x),x=f.x,M=Ft.maxd(c.x,a.x,h.x,T.x),A=Ft.maxd(l.y,r.y,c.y,E.y),B=Ft.maxd(s.y,o.y,a.y,N.y),Y=d.y,j=Ft.maxd(g.y,i.y,h.y,P.y);this.offsetGraphs(t.getComponents(cO),I+x,A+Y),this.offsetGraphs(t.getComponents(fO),I+x,A+Y),this.offsetGraphs(t.getComponents(gO),I+x,0),this.offsetGraphs(t.getComponents(_O),I+x,A+Y+B),this.offsetGraphs(t.getComponents(EO),0,A+Y),this.offsetGraphs(t.getComponents(sO),I+x+C,A+Y),this.offsetGraphs(t.getComponents(hO),I+x+C,0),this.offsetGraphs(t.getComponents(pO),0,A+Y+B),this.offsetGraphs(t.getComponents(nO),I+x+C,A+Y+B),this.offsetGraphs(t.getComponents(lO),0,A),this.offsetGraphs(t.getComponents(uO),I,0),this.offsetGraphs(t.getComponents(aO),0,A+Y+B),this.offsetGraphs(t.getComponents(dO),I+x+C,0);let X=new O;return X.x=Ft.maxd(I+C+x+M,d.x,E.x,P.x),X.y=Ft.maxd(A+B+Y+j,f.y,S.y,T.y),X}_placeComponentsHorizontally(t,e){let o=new O;for(let r of t)this.offsetGraph(r,o.x,0),o.x+=r.getSize().x+e,o.y=Math.max(o.y,r.getSize().y);return o.y>0&&(o.y+=e),o}_placeComponentsVertically(t,e){let o=new O;for(let r of t)this.offsetGraph(r,0,o.y),o.y+=r.getSize().y+e,o.x=Math.max(o.x,r.getSize().x);return o.x>0&&(o.x+=e),o}_placeComponentsInRows(t,e){if(t.length===0)return new O;let o=0,r=0;for(let c of t){let g=c.getSize();o=Math.max(o,g.x),r+=g.x*g.y}o=Math.max(o,Math.sqrt(r)*t[0].getProperty(_.ASPECT_RATIO));let i=0,s=0,a=0,l=e;for(let c of t){let g=c.getSize();i+g.x>o&&(i=0,s+=a+e,a=0),this.offsetGraph(c,i,s),l=Math.max(l,i+g.x),a=Math.max(a,g.y),i+=g.x+e}return new O(l+e,s+a+e)}};var{SIDES_EAST:po,SIDES_EAST_SOUTH:ko,SIDES_EAST_SOUTH_WEST:gi,SIDES_EAST_WEST:Eo,SIDES_NONE:Co,SIDES_NORTH:Wo,SIDES_NORTH_EAST:to,SIDES_NORTH_EAST_SOUTH:hi,SIDES_NORTH_EAST_SOUTH_WEST:Nf,SIDES_NORTH_EAST_WEST:Ki,SIDES_NORTH_SOUTH:di,SIDES_NORTH_SOUTH_WEST:Yr,SIDES_NORTH_WEST:sr,SIDES_SOUTH:go,SIDES_SOUTH_WEST:xo,SIDES_WEST:Do}=u,ws=class n extends zr{constructor(t){super(),this.componentOrder=[],t!==void 0&&this.add(t)}add(t){if(this._canAdd(t)){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=this.components.get(e);return o===void 0&&(o=[],this.components.set(e,o)),o.push(t),this.componentOrder.push(t),!0}return!1}_canAdd(t){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=zr.CONSTRAINTS.get(e),r=n.MODEL_ORDER_CONSTRAINTS.get(e);if(o)for(let i of o){let s=this.components.get(i);if(s&&s.length>0)return!1}if(r)for(let i of r){let s=this.components.get(i);if(s&&s.length>0)return!1}return!0}getComponentOrder(){return this.componentOrder}};ws.MODEL_ORDER_CONSTRAINTS=new Map;function F(n,t){let e=ws.MODEL_ORDER_CONSTRAINTS.get(n);e||(e=[],ws.MODEL_ORDER_CONSTRAINTS.set(n,e)),e.push(t)}F(Wo,Co);F(Do,Co);F(to,Co);F(sr,Co);F(Yr,Co);F(Ki,Co);F(sr,Wo);F(Co,po);F(Wo,po);F(Do,po);F(to,po);F(di,po);F(sr,po);F(Yr,po);F(Ki,po);F(Eo,po);F(Co,go);F(Wo,go);F(po,go);F(Do,go);F(to,go);F(di,go);F(sr,go);F(Eo,go);F(xo,go);F(Yr,go);F(hi,go);F(Ki,go);F(Wo,Do);F(to,Do);F(sr,Do);F(Ki,Do);F(Wo,to);F(Do,to);F(sr,to);F(to,to);F(Yr,to);F(Co,ko);F(Wo,ko);F(po,ko);F(go,ko);F(Do,ko);F(to,ko);F(di,ko);F(sr,ko);F(xo,ko);F(Eo,ko);F(Ki,ko);F(Yr,ko);F(Nf,ko);F(Co,xo);F(Wo,xo);F(po,xo);F(Do,xo);F(to,xo);F(di,xo);F(sr,xo);F(Eo,xo);F(Ki,xo);F(hi,xo);F(Nf,xo);F(Wo,Eo);F(Do,Eo);F(to,Eo);F(sr,Eo);F(xo,Eo);F(Ki,Eo);F(Yr,Eo);F(Co,gi);F(Wo,gi);F(po,gi);F(Do,gi);F(to,gi);F(di,gi);F(sr,gi);F(Eo,gi);F(Ki,gi);F(Wo,Yr);F(po,Yr);F(go,Yr);F(to,Yr);F(Co,hi);F(Wo,hi);F(go,hi);F(Do,hi);F(to,hi);F(di,hi);F(sr,hi);F(sr,Nf);F(to,Nf);F(Eo,Co);F(Eo,Do);F(Eo,po);F(di,Co);F(di,Wo);F(di,go);var yf=class extends fa{combine(t,e){if(this.componentGroups.length=0,e.getLayerlessNodes().length=0,t.length===0){e.getSize().x=0,e.getSize().y=0;return}let o=t[0];e.copyProperties(o);for(let d of t)this._addComponent(d);let r=new O,i=new O,s=new O,a=new O,l=o.getProperty(_.SPACING_COMPONENT_COMPONENT),c=e.getProperty(lr),g=c&&c.isHorizontal&&c.isHorizontal(),h=c&&c.isVertical&&c.isVertical();for(let d of this.componentGroups){if(g){s.x=r.x;for(let E of d.getPortSides())if(E.has(u.NORTH)){s.x=i.x;break}}else if(h){s.y=r.y;for(let E of d.getPortSides())if(E.has(u.WEST)){s.y=i.y;break}}let f=this._placeComponents(d,l);if(this.offsetGraphs(d.getComponents(),s.x,s.y),g){i.x=s.x+f.x,a.x=Math.max(a.x,i.x);for(let E of d.getPortSides())if(E.has(u.SOUTH)){r.x=s.x+f.x;break}i.y=s.y+f.y,s.y=i.y,a.y=Math.max(a.y,s.y)}else if(h){i.y=s.y+f.y,a.y=Math.max(a.y,i.y);for(let E of d.getPortSides())if(E.has(u.EAST)){r.y=s.y+f.y;break}i.x=s.x+f.x,s.x=i.x,a.x=Math.max(a.x,s.x)}}if(e.getSize().x=a.x-l,e.getSize().y=a.y-l,o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)&&o.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL){for(let f of t)this.offsetGraph(f,f.getOffset().x,f.getOffset().y);let d=new Er;d.compact(t,e.getSize(),l);for(let f of t)f.getOffset().reset().add(d.getOffset());e.getSize().reset().add(d.getGraphSize())}for(let d of this.componentGroups)this.moveGraphs(e,d.getComponents(),0,0)}_addComponent(t){this.componentGroups.length>0&&this.componentGroups[this.componentGroups.length-1].add(t)||this.componentGroups.push(new ws(t))}};var If=class extends la{sortComponents(t,e){}placeComponents(t,e,o,r){let i=0,s=0,a=0,l=r,c=null,g=0;for(let h of t){let d=h.getSize(),f=h.getProperty(p.EXT_PORT_CONNECTIONS),E=c?c.getProperty(p.EXT_PORT_CONNECTIONS):null;(i+d.x>o&&!(f&&f.has(u.NORTH))||E&&E.has(u.EAST)||f&&f.has(u.WEST))&&(i=g,s+=a+r,a=0);let P=h.getOffset();f&&f.has(u.NORTH)&&(i=l+r),this.offsetGraph(h,i+P.x,s+P.y),l=Math.max(l,i+d.x),f&&f.has(u.SOUTH)&&(g=Math.max(g,i+d.x+r)),P.reset(),a=Math.max(a,d.y),i+=d.x+r,c=h}e.getSize().x=l,e.getSize().y=s+a}};var Rf=class{constructor(){this._componentGroupGraphPlacer=new fa,this._componentGroupModelOrderGraphPlacer=new yf,this._modelOrderRowGraphPlacer=new If,this._simpleRowGraphPlacer=new la,this._graphPlacer=this._simpleRowGraphPlacer}split(t){let e;this._graphPlacer=this._simpleRowGraphPlacer;let o=t.getProperty(_.SEPARATE_CONNECTED_COMPONENTS),r=o==null||o===!0,i=t.getProperty(p.GRAPH_PROPERTIES),s=i&&i.has(v.EXTERNAL_PORTS),a=t.getProperty(_.PORT_CONSTRAINTS),l=!(a&&typeof a.isOrderFixed=="function"&&a.isOrderFixed());if(r&&(l||!s)){for(let c of t.getLayerlessNodes())c.id=0;e=[];for(let c of t.getLayerlessNodes()){let g=this._dfs(c,null);if(g!=null){let h=new Nn;h.copyProperties(t),h.setProperty(p.EXT_PORT_CONNECTIONS,u.sidesOf(g.extPortSides)),h.getPadding().copy(t.getPadding()),h.setProperty(_.NODE_SIZE_MINIMUM,null);for(let d of g.nodes)h.getLayerlessNodes().push(d),d.setGraph(h);e.push(h)}}if(s){let c=t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS);c===Me.GROUP_MODEL_ORDER?this._graphPlacer=this._componentGroupModelOrderGraphPlacer:c===Me.MODEL_ORDER?this._graphPlacer=this._modelOrderRowGraphPlacer:this._graphPlacer=this._componentGroupGraphPlacer}}else e=[t];return t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)!==Me.NONE&&e.sort((c,g)=>{let h=z.getMinimalModelOrder(c),d=z.getMinimalModelOrder(g);return h-d}),e}_dfs(t,e){if(t.id===0){t.id=1;let o=e;o==null&&(o={nodes:[],extPortSides:new Set}),o.nodes.push(t),t.getType()===y.EXTERNAL_PORT&&o.extPortSides.add(t.getProperty(p.EXT_PORT_SIDE));for(let r of t.getPorts())for(let i of r.getConnectedPorts())this._dfs(i.getNode(),o);return o}return null}combine(t,e){this._graphPlacer.combine(t,e)}};var ua=class extends Gi{constructor(t=""){super(),this._text=t}getText(){return this._text}toString(){let t=this.getDesignation();return t==null?"label":`l_${t}`}getDesignation(){return this._text&&this._text.length>0?this._text:super.getDesignation()}};var Ms=class{constructor(t,e,o){this._newEdge=t,this._graph=e,this._type=o}toString(){return`${this._type.toString()}:${this._newEdge.toString()}`}getEdge(){return this._newEdge}getGraph(){return this._graph}getType(){return this._type}getActualSource(){let t=this._newEdge.getSource();return t.getNode().getType()===y.EXTERNAL_PORT?t.getNode().getProperty(p.ORIGIN):t}getActualTarget(){let t=this._newEdge.getTarget();return t.getNode().getType()===y.EXTERNAL_PORT?t.getNode().getProperty(p.ORIGIN):t}};var _a=class n{constructor(t){this._graph=t,this.compare=this.compare.bind(this)}compare(t,e){if(t.getType()===W.OUTPUT&&e.getType()===W.INPUT)return-1;if(t.getType()===W.INPUT&&e.getType()===W.OUTPUT)return 1;let o=n._hierarchyLevel(t.getGraph(),this._graph),r=n._hierarchyLevel(e.getGraph(),this._graph);return t.getType()===W.OUTPUT?r-o:o-r}static _hierarchyLevel(t,e){let o=t,r=0;for(;;){if(o===e)return r;let i=o.getParentNode();if(i==null)throw new Error("CrossHierarchyEdgeComparator: nestedGraph is not a descendant of topLevelGraph");o=i.getGraph(),r++}}};var fl=class n{constructor(){this._crossHierarchyMap=null,this._dummyNodeMap=new Map}process(t,e){e.begin("Compound graph preprocessor",1),this._crossHierarchyMap=new Map,this._transformHierarchyEdges(t,null),this._moveLabelsAndRemoveOriginalEdges(t),this._setSidesOfPortsToSidesOfDummyNodes(),t.setProperty(p.CROSS_HIERARCHY_MAP,this._crossHierarchyMap),this._crossHierarchyMap=null,this._dummyNodeMap.clear(),e.done()}_putCrossHierarchyEdge(t,e){let o=this._crossHierarchyMap.get(t);o==null&&(o=[],this._crossHierarchyMap.set(t,o)),o.push(e)}_setSidesOfPortsToSidesOfDummyNodes(){for(let[t,e]of this._dummyNodeMap.entries())e.setProperty(p.ORIGIN,t),t.setProperty(p.PORT_DUMMY,e),t.setProperty(p.INSIDE_CONNECTIONS,!0),t.setSide(e.getProperty(p.EXT_PORT_SIDE)),t.getNode().setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),t.getNode().getGraph().getProperty(p.GRAPH_PROPERTIES).add(v.NON_FREE_PORTS)}_transformHierarchyEdges(t,e){let o=[];for(let i of t.getLayerlessNodes()){let s=i.getNestedGraph();if(s==null)continue;let a=this._transformHierarchyEdges(s,i);if(o.push(...a),this._processInsideSelfLoops(s,i),s.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)){let l=i.getProperty(_.PORT_CONSTRAINTS),c=i.getProperty(_.PORT_LABELS_PLACEMENT),g=c!=null&&c.has!=null&&c.has(it.INSIDE);for(let h of i.getPorts()){let d=this._dummyNodeMap.get(h);d==null&&(d=z.createExternalPortDummy(h,l,h.getSide(),-h.getNetFlow(),null,new O,h.getSize(),s.getProperty(_.DIRECTION),s),d.setProperty(p.ORIGIN,h),this._dummyNodeMap.set(h,d),s.getLayerlessNodes().push(d));let f=d.getPorts()[0];for(let E of h.getLabels()){let P=new ua;if(P.getSize().x=E.getSize().x,P.getSize().y=E.getSize().y,f.getLabels().push(P),!g){let S=h.getSide(),T=0;c!=null&&it.isFixed(c)&&(T=iu(E.getPosition(),E.getSize(),h.getSize(),0,S)),l===H.FREE||u.SIDES_EAST_WEST.has(S)?P.getSize().x=T:P.getSize().y=T}}}}}let r=[];return this._processInnerHierarchicalEdgeSegments(t,e,o,r),e!=null&&this._processOuterHierarchicalEdgeSegments(t,e,r),r}_moveLabelsAndRemoveOriginalEdges(t){for(let e of this._crossHierarchyMap.keys()){let o=e.getLabels();if(o!=null&&o.length>0){let r=Array.from(this._crossHierarchyMap.get(e));r.sort(new _a(t).compare);let i=[];for(let s of o){let a=-1,l=s.getProperty(_.EDGE_LABELS_PLACEMENT);if(l===St.HEAD?a=r.length-1:l===St.CENTER?a=this._getShallowestEdgeSegment(r):l===St.TAIL&&(a=0),a!==-1){let c=r[a];c.getEdge().getLabels().push(s);let g=c.getEdge().getSource().getNode().getGraph().getProperty(p.GRAPH_PROPERTIES);g.add(v.END_LABELS),g.add(v.CENTER_LABELS),s.setProperty(p.ORIGINAL_LABEL_EDGE,e)}else i.push(s)}o.length=0,o.push(...i)}e.setSource(null),e.setTarget(null)}}_getShallowestEdgeSegment(t){let e=-1,o=0;for(let r of t){if(r.getType()===W.INPUT){e=o===0?0:o-1;break}else o===t.length-1&&(e=o);o+=1}return e}_processInnerHierarchicalEdgeSegments(t,e,o,r){let i=[];for(let s of o){let a=null;if(s.type===W.OUTPUT)for(let l of s.origEdges){let c=l.getTarget().getNode();if(c.getGraph()===t)this._connectChild(t,s,l,s.dummyPort,l.getTarget());else if(e==null||z.isDescendant(c,e))this._connectSiblings(t,s,o,l);else{let g=this._introduceHierarchicalEdgeSegment(t,e,l,s.dummyPort,W.OUTPUT,a);g!==a&&i.push(g),g.exported&&(a=g)}}else for(let l of s.origEdges){let c=l.getSource().getNode();if(c.getGraph()===t)this._connectChild(t,s,l,l.getSource(),s.dummyPort);else{if(e==null||z.isDescendant(c,e))continue;{let g=this._introduceHierarchicalEdgeSegment(t,e,l,s.dummyPort,W.INPUT,a);g!==a&&i.push(g),g.exported&&(a=g)}}}}for(let s of i){let a=t.getLayerlessNodes();a.includes(s.dummyNode)||a.push(s.dummyNode),s.exported&&r.push(s)}}_connectChild(t,e,o,r,i){let s=this._createDummyEdge(t,o);s.setSource(r),s.setTarget(i),this._putCrossHierarchyEdge(o,new Ms(s,t,e.type))}_connectSiblings(t,e,o,r){let i=null;for(let a of o)if(a!==e&&a.origEdges.includes(r)){i=a;break}let s=this._createDummyEdge(t,r);s.setSource(e.dummyPort),s.setTarget(i.dummyPort),this._putCrossHierarchyEdge(r,new Ms(s,t,e.type))}_processOuterHierarchicalEdgeSegments(t,e,o){let r=[];for(let i of t.getLayerlessNodes())for(let s of i.getPorts()){let a=null;for(let c of z.toEdgeArray(s.getOutgoingEdges()))if(!z.isDescendant(c.getTarget().getNode(),e)){let g=this._introduceHierarchicalEdgeSegment(t,e,c,c.getSource(),W.OUTPUT,a);g!==a&&r.push(g),g.exported&&(a=g)}let l=null;for(let c of z.toEdgeArray(s.getIncomingEdges()))if(!z.isDescendant(c.getSource().getNode(),e)){let g=this._introduceHierarchicalEdgeSegment(t,e,c,c.getTarget(),W.INPUT,l);g!==l&&r.push(g),g.exported&&(l=g)}}for(let i of r){let s=t.getLayerlessNodes();s.includes(i.dummyNode)||s.push(i.dummyNode),i.exported&&o.push(i)}}_processInsideSelfLoops(t,e){if(e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))for(let o of e.getPorts()){let r=z.toEdgeArray(o.getOutgoingEdges());for(let i of r){if(!(i.getTarget().getNode()===e&&i.getProperty(_.INSIDE_SELF_LOOPS_YO)))continue;let l=i.getSource(),c=this._dummyNodeMap.get(l);c==null&&(c=z.createExternalPortDummy(l,H.FREE,l.getSide(),-1,null,null,l.getSize(),t.getProperty(_.DIRECTION),t),c.setProperty(p.ORIGIN,l),this._dummyNodeMap.set(l,c),t.getLayerlessNodes().push(c));let g=i.getTarget(),h=this._dummyNodeMap.get(g);h==null&&(h=z.createExternalPortDummy(g,H.FREE,g.getSide(),1,null,null,g.getSize(),t.getProperty(_.DIRECTION),t),h.setProperty(p.ORIGIN,g),this._dummyNodeMap.set(g,h),t.getLayerlessNodes().push(h));let d=this._createDummyEdge(t,i);d.setSource(c.getPorts()[0]),d.setTarget(h.getPorts()[0]),this._putCrossHierarchyEdge(i,new Ms(d,t,W.OUTPUT)),t.getProperty(p.GRAPH_PROPERTIES).add(v.EXTERNAL_PORTS)}}}_introduceHierarchicalEdgeSegment(t,e,o,r,i,s){let a=t.getProperty(_.MERGE_HIERARCHY_EDGES),l=null;i===W.INPUT&&o.getSource().getNode()===e?l=o.getSource():i===W.OUTPUT&&o.getTarget().getNode()===e&&(l=o.getTarget());let c=s;if(c==null||!a||l!=null){let g=u.UNDEFINED;l!=null?g=l.getSide():e.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(g=i===W.INPUT?u.WEST:u.EAST);let h=this._createExternalPortDummyNode(t,e,i,g,o),d=this._createDummyEdge(e.getGraph(),o);i===W.INPUT?(d.setSource(h.getPorts()[0]),d.setTarget(r)):(d.setSource(r),d.setTarget(h.getPorts()[0])),c=new sp(o,d,h,h.getProperty(p.ORIGIN),i,l==null)}else{c.origEdges.push(o);let g=Math.max(c.newEdge.getProperty(_.EDGE_THICKNESS),o.getProperty(_.EDGE_THICKNESS));c.newEdge.setProperty(_.EDGE_THICKNESS,g)}return this._putCrossHierarchyEdge(o,new Ms(c.newEdge,t,i)),c}_createDummyEdge(t,e){let o=new _e;return o.copyProperties(e),o.setProperty(_.JUNCTION_POINTS,null),o}_calculateNetFlow(t){let e=t.getNode(),o=e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=0,i=0;for(let s of t.getOutgoingEdges()){let a=s.isSelfLoop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=s.getTarget().getNode();a&&l?i++:a&&!l?r++:c.getGraph().getParentNode()===e?i++:r++}for(let s of t.getIncomingEdges()){let a=s.isSelfLoop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=s.getSource().getNode();a&&l?r++:a&&!l?i++:c.getGraph().getParentNode()===e?r++:i++}return r-i}_createExternalPortDummyNode(t,e,o,r,i){let s=null,a=o===W.INPUT?i.getSource():i.getTarget(),l=z.getDirection(t);if(a.getNode()===e)s=this._dummyNodeMap.get(a),s==null&&(s=z.createExternalPortDummy(a,e.getProperty(_.PORT_CONSTRAINTS),r,this._calculateNetFlow(a),null,a.getPosition(),a.getSize(),l,t),s.setProperty(p.ORIGIN,a),this._dummyNodeMap.set(a,s));else{s=z.createExternalPortDummy(n._createExternalPortProperties(t),e.getProperty(_.PORT_CONSTRAINTS),r,o===W.INPUT?-1:1,null,new O,new O(0,0),l,t);let c=n._createPortForDummy(s,e,o);s.setProperty(p.ORIGIN,c),this._dummyNodeMap.set(c,s)}return t.getProperty(p.GRAPH_PROPERTIES).add(v.EXTERNAL_PORTS),t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()?t.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE):t.setProperty(_.PORT_CONSTRAINTS,H.FREE),s}static _createExternalPortProperties(t){let e=new ge,o=t.getProperty(_.SPACING_EDGE_EDGE)/2;return e.setProperty(_.PORT_BORDER_OFFSET,o),e}static _createPortForDummy(t,e,o){let r=e.getGraph(),i=z.getDirection(r),s=new rt;return s.setNode(e),o===W.INPUT?s.setSide(u.fromDirection(i).opposed()):o===W.OUTPUT&&s.setSide(u.fromDirection(i)),s.setProperty(_.PORT_BORDER_OFFSET,t.getProperty(_.PORT_BORDER_OFFSET)),s}};fl.isHierarchyAware=!0;var sp=class{constructor(t,e,o,r,i,s){this.origEdges=[t],this.newEdge=e,this.dummyNode=o,this.dummyPort=r,this.type=i!=null?i:W.UNDEFINED,this.exported=s}};var Lf=class n{process(t,e){e.begin("Compound graph postprocessor",1);let o=t.getProperty(_.UNNECESSARY_BENDPOINTS),r=t.getProperty(p.CROSS_HIERARCHY_MAP);if(r==null){e.done();return}let i=new Set;for(let s of r.keys()){let a=(r.get(s)||[]).slice();a.sort(new _a(t).compare);let l=a[0].getActualSource(),c=a[a.length-1].getActualTarget(),g=l.getNode(),h;z.isDescendant(c.getNode(),g)?h=g.getNestedGraph():h=g.getGraph();let d=n._clearJunctionPoints(s,a);s.getBendPoints().clear();let f=null;for(let E of a){let P=new O;z.changeCoordSystem(P,E.getGraph(),h);let S=E.getEdge(),T=new st;T.addAllAsCopies(0,S.getBendPoints()),T.offset(P);let N=S.getSource().getAbsoluteAnchor().clone(),I=S.getTarget().getAbsoluteAnchor().clone();if(N.add(P),I.add(P),f!=null){let C;T.isEmpty()?C=I:C=T.getFirst();let x=Math.abs(f.x-C.x)>ie.TOLERANCE,M=Math.abs(f.y-C.y)>ie.TOLERANCE;(!o&&x&&M||o&&(x||M))&&s.getBendPoints().add(N)}for(let C of T)s.getBendPoints().add(C);T.isEmpty()?f=N:f=T.getLast(),n._copyJunctionPoints(S,d,P),E.getActualTarget()===c&&(c.getNode().getGraph()!==E.getGraph()&&(P=new O,z.changeCoordSystem(P,c.getNode().getGraph(),h)),s.setProperty(p.TARGET_OFFSET,P)),n._copyLabelsBack(S,s,h),i.add(S)}s.setSource(l),s.setTarget(c)}for(let s of i)s.setSource(null),s.setTarget(null);e.done()}static _clearJunctionPoints(t,e){let o=t.getProperty(_.JUNCTION_POINTS),r=!1;for(let i of e){let s=i.getEdge().getProperty(_.JUNCTION_POINTS);if(s!=null&&!s.isEmpty()){r=!0;break}}return r?o==null?(o=new st,t.setProperty(_.JUNCTION_POINTS,o)):o.clear():o!=null&&(t.setProperty(_.JUNCTION_POINTS,null),o=null),o}static _copyJunctionPoints(t,e,o){if(e==null)return;let r=t.getProperty(_.JUNCTION_POINTS);if(r!=null){let i=new st;i.addAllAsCopies(0,r),i.offset(o);for(let s of i)e.add(s)}}static _copyLabelsBack(t,e,o){let r=t.getLabels();for(let i=r.length-1;i>=0;i--){let s=r[i];s.getProperty(p.ORIGINAL_LABEL_EDGE)===e&&(z.changeCoordSystem(s.getPosition(),t.getSource().getNode().getGraph(),o),r.splice(i,1),e.getLabels().push(s))}}};var OR=1,np=.4,Af=class{constructor(){this._createdJunctionPoints=new Set}getLayoutProcessorConfiguration(t){let e=K.create();e.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR);let o=t.getProperty(p.GRAPH_PROPERTIES);return o&&(o.has(v.NORTH_SOUTH_PORTS)&&(e.addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR),e.addAfter(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)),o.has(v.SELF_LOOPS)&&(e.addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR),e.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER),e.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER),e.addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR)),o.has(v.CENTER_LABELS)&&(e.addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER),e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER),e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),e.addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER)),o.has(v.END_LABELS)&&(e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),e.addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR),e.addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR))),e}process(t,e){e&&e.begin&&e.begin("Polyline edge routing",1);let o=t.getProperty(_.EDGE_ROUTING_POLYLINE_SLOPED_EDGE_ZONE_WIDTH),r=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),s=Math.min(1,i/r),a=t.getLayers(),l=0;if(a.length>0){let c=this._calculateWestInLayerEdgeYDiff(a[0]);l=np*s*c}for(let c=0;c<a.length;c++){let g=a[c],h=g.getNodes(),d=h.every(Ls);d&&l>0&&(l-=r),z.placeNodesHorizontally(g,l);let f=0;for(let P of h){let S=0;for(let N of P.getOutgoingEdges()){let I=N.getSource().getAbsoluteAnchor().y,C=N.getTarget().getAbsoluteAnchor().y;g===N.getTarget().getNode().getLayer()&&!N.isSelfLoop()&&(this._processInLayerEdge(N,l,np*s*Math.abs(I-C)),N.getSource().getSide()===u.WEST&&(I=0,C=0)),S=Math.max(S,Math.abs(C-I))}let T=P.getType();(T===y.NORMAL||T===y.LABEL||T===y.LONG_EDGE||T===y.NORTH_SOUTH_PORT||T===y.BREAKING_POINT)&&this._processNode(P,l,o),f=Math.max(f,S)}if(c+1<a.length){let P=this._calculateWestInLayerEdgeYDiff(a[c+1]);f=Math.max(f,P)}let E=np*s*f;!d&&c+1<a.length&&(E+=r),l+=g.getSize().x+E}this._createdJunctionPoints.clear(),t.getSize().x=l,e&&e.done&&e.done()}_processNode(t,e,o){let r=e+t.getLayer().getSize().x;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor();if(t.getType()===y.NORTH_SOUTH_PORT){let g=i.getProperty(p.ORIGIN);g&&(s.x=g.getAbsoluteAnchor().x,t.getPosition().x=s.x)}let a=new O(0,s.y);if(i.getSide()===u.EAST)a.x=r;else if(i.getSide()===u.WEST)a.x=e;else continue;if(Math.abs(s.x-a.x)<=o&&!this._isInLayerDummy(t))continue;let c=i.getOutgoingEdges().length+i.getIncomingEdges().length>1;for(let g of i.getConnectedEdges()){let h=g.getSource()===i?g.getTarget():g.getSource();Math.abs(h.getAbsoluteAnchor().y-a.y)>OR&&this._addBendPoint(g,a,c,i)}}}_processInLayerEdge(t,e,o){let r=t.getSource(),i=t.getTarget(),s=(r.getAbsoluteAnchor().y+i.getAbsoluteAnchor().y)/2,a;r.getSide()===u.EAST?a=new O(e+r.getNode().getLayer().getSize().x+o,s):a=new O(e-o,s),t.getBendPoints().splice(0,0,a)}_calculateWestInLayerEdgeYDiff(t){let e=0;for(let o of t.getNodes())for(let r of o.getOutgoingEdges())if(t===r.getTarget().getNode().getLayer()&&r.getSource().getSide()===u.WEST){let i=r.getSource().getAbsoluteAnchor().y,s=r.getTarget().getAbsoluteAnchor().y;e=Math.max(e,Math.abs(s-i))}return e}_addBendPoint(t,e,o,r){if(t.isSelfLoop()||!t.isInLayerEdge()&&r.getAbsoluteAnchor().equals(e))return;let i=new O(e.x,e.y);if(t.getSource()===r?t.getBendPoints().splice(0,0,i):t.getBendPoints().push(i),o){let s=e.x+","+e.y;if(!this._createdJunctionPoints.has(s)){let a=t.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,t.setProperty(_.JUNCTION_POINTS,a));let l=new O(e.x,e.y);a.push(l),this._createdJunctionPoints.add(s)}}}_isInLayerDummy(t){if(t.getType()!==y.LONG_EDGE)return!1;for(let e of t.getConnectedEdges())if(e.isInLayerEdge())return!0;return!1}};var bs=class bs{constructor(){this._edgeRoutingStrategy=null}static factoryFor(t){let e=String(t);if(!bs._factoryCache.has(e)){let o=new bs;o._edgeRoutingStrategy=t,bs._factoryCache.set(e,o)}return bs._factoryCache.get(e)}create(){switch(this._edgeRoutingStrategy){case At.POLYLINE:return new Af;case At.SPLINES:return new vi;default:return new Vg}}};Z(bs,"_factoryCache",new Map);var Cf=bs;var mO=2,SR=()=>K.create().addBefore(D.P4_NODE_PLACEMENT,w.INNERMOST_NODE_MARGIN_CALCULATOR).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_AND_NODE_SIZE_PROCESSOR).addBefore(D.P5_EDGE_ROUTING,w.LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR).addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_SORTER),TR=()=>K.create().addBefore(D.P4_NODE_PLACEMENT,w.CENTER_LABEL_MANAGEMENT_PROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR),NR=()=>K.create().addAfter(D.P5_EDGE_ROUTING,w.HIERARCHICAL_NODE_RESIZER),xf=class n{constructor(){this._algorithmAssembler=Io.create(D.values())}prepareGraphForLayout(t){this._configureGraphProperties(t),this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(D.P1_CYCLE_BREAKING,t.getProperty(_.CYCLE_BREAKING_STRATEGY)),this._algorithmAssembler.setPhase(D.P2_LAYERING,t.getProperty(_.LAYERING_STRATEGY)),this._algorithmAssembler.setPhase(D.P3_NODE_ORDERING,t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY)),this._algorithmAssembler.setPhase(D.P4_NODE_PLACEMENT,t.getProperty(_.NODE_PLACEMENT_STRATEGY)),this._algorithmAssembler.setPhase(D.P5_EDGE_ROUTING,Cf.factoryFor(t.getProperty(_.EDGE_ROUTING))),this._algorithmAssembler.addProcessorConfiguration(this._getPhaseIndependentLayoutProcessorConfiguration(t)),t.setProperty(p.PROCESSORS,this._algorithmAssembler.build(t))}_configureGraphProperties(t){let e=t.getProperty(_.SPACING_EDGE_EDGE);e!=null&&e<mO&&t.setProperty(_.SPACING_EDGE_EDGE,mO),t.getProperty(_.DIRECTION)===R.UNDEFINED&&t.setProperty(_.DIRECTION,z.getDirection(t));let r=t.getProperty(_.RANDOM_SEED);t.setProperty(p.RANDOM,new dr(r)),t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES)==null&&t.setProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES,t.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL),this._copyPortConstraints(t),t.setProperty(p.SPACINGS,new oo(t))}_copyPortConstraints(t){for(let e of t.getLayerlessNodes())this._copyPortConstraintsForNode(e);for(let e of t.getLayers())for(let o of e.getNodes())this._copyPortConstraintsForNode(o)}_copyPortConstraintsForNode(t){let e=t.getProperty(_.PORT_CONSTRAINTS);t.setProperty(p.ORIGINAL_PORT_CONSTRAINTS,e);let o=t.getNestedGraph&&t.getNestedGraph();o!=null&&this._copyPortConstraints(o)}_getPhaseIndependentLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES),o=SR();switch(t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN&&o.addAll(NR()),t.getProperty(_.FEEDBACK_EDGES)?o.addBefore(D.P1_CYCLE_BREAKING,w.PORT_SIDE_PROCESSOR):o.addBefore(D.P3_NODE_ORDERING,w.PORT_SIDE_PROCESSOR),t.getProperty(Hn)!=null&&o.addAll(TR()),(t.getProperty(_.INTERACTIVE_LAYOUT)||t.getProperty(_.GENERATE_POSITION_AND_LAYER_IDS))&&o.addAfter(D.P5_EDGE_ROUTING,w.CONSTRAINTS_POSTPROCESSOR),t.getProperty(_.DIRECTION)){case R.LEFT:case R.DOWN:case R.UP:o.addBefore(D.P1_CYCLE_BREAKING,w.DIRECTION_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.DIRECTION_POSTPROCESSOR);break;default:break}e!=null&&e.has(v.COMMENTS)&&o.addBefore(D.P1_CYCLE_BREAKING,w.COMMENT_PREPROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.COMMENT_NODE_MARGIN_CALCULATOR).addAfter(D.P5_EDGE_ROUTING,w.COMMENT_POSTPROCESSOR),t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY)!==ut.NONE&&t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY)!=null&&o.addBefore(D.P3_NODE_ORDERING,w.NODE_PROMOTION),e!=null&&e.has(v.PARTITIONS)&&(o.addBefore(D.P1_CYCLE_BREAKING,w.PARTITION_PREPROCESSOR),o.addBefore(D.P2_LAYERING,w.PARTITION_MIDPROCESSOR),o.addBefore(D.P3_NODE_ORDERING,w.PARTITION_POSTPROCESSOR));let i=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY);if(i!=null&&i!==re.NONE&&t.getProperty(_.EDGE_ROUTING)!==At.POLYLINE&&o.addAfter(D.P5_EDGE_ROUTING,w.HORIZONTAL_COMPACTOR),t.getProperty(_.HIGH_DEGREE_NODES_TREATMENT)&&o.addBefore(D.P3_NODE_ORDERING,w.HIGH_DEGREE_NODE_LAYER_PROCESSOR),t.getProperty(_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE)&&o.addBefore(D.P3_NODE_ORDERING,w.SEMI_INTERACTIVE_CROSSMIN_PROCESSOR),n.activateGreedySwitchFor(t)){let c=n._isHierarchicalLayout(t)?t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE):t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE),g=String(c)==="ONE_SIDED"?w.ONE_SIDED_GREEDY_SWITCH:w.TWO_SIDED_GREEDY_SWITCH;o.addBefore(D.P4_NODE_PLACEMENT,g)}t.getProperty(_.LAYER_UNZIPPING_STRATEGY)===Wr.ALTERNATING&&o.addBefore(D.P4_NODE_PLACEMENT,w.ALTERNATING_LAYER_UNZIPPER);let a=t.getProperty(_.WRAPPING_STRATEGY);return a===Fo.SINGLE_EDGE?o.addBefore(D.P4_NODE_PLACEMENT,w.SINGLE_EDGE_GRAPH_WRAPPER):a===Fo.MULTI_EDGE&&o.addBefore(D.P3_NODE_ORDERING,w.BREAKING_POINT_INSERTER).addBefore(D.P4_NODE_PLACEMENT,w.BREAKING_POINT_PROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.BREAKING_POINT_REMOVER),t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==ce.NONE&&t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!=null&&o.addBefore(D.P3_NODE_ORDERING,w.SORT_BY_INPUT_ORDER_OF_MODEL),o}static activateGreedySwitchFor(t){if(n._isHierarchicalLayout(t)){let s=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE);return t.getParentNode()==null&&s!=null&&String(s)!=="OFF"}let e=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE),o=t.getProperty(_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE)||t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY)===We.INTERACTIVE,r=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_ACTIVATION_THRESHOLD)||0,i=t.getLayerlessNodes().length;return!o&&e!=null&&String(e)!=="OFF"&&(r===0||r>i)}static _isHierarchicalLayout(t){return t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN}};var ap=Object.freeze({isInstance(n){return n!=null&&(n.constructor&&n.constructor.isHierarchyAware===!0||n.isHierarchyAware===!0)}});var Df=class{constructor(){this._graphConfigurator=new xf,this._componentsProcessor=new Rf}doLayout(t,e){let o=e!=null?e:new Ie;o.begin("Layered layout",1),this._graphConfigurator.prepareGraphForLayout(t);let r=this._componentsProcessor.split(t);for(let i of r)this._layout(i,o);this._componentsProcessor.combine(r,t),this._resizeGraph(t),o.done()}doCompoundLayout(t,e){let o=e!=null?e:new Ie;o.begin("Layered compound layout",2),new fl().process(t,o.subTask?o.subTask(1):new Ie),this._hierarchicalLayout(t,o.subTask?o.subTask(1):new Ie),new Lf().process(t,o.subTask?o.subTask(1):new Ie),o.done()}_hierarchicalLayout(t,e){let o=this._collectAllGraphsBottomUp(t);this._reviewAndCorrectHierarchicalProcessors(t,o);let r=[],i=0;for(let a of o){this._graphConfigurator.prepareGraphForLayout(a);let l=a.getProperty(p.PROCESSORS);i+=l.length,r.push({graph:a,processors:l,index:0})}e.begin("Recursive hierarchical layout",i);let s=r.find(a=>a.graph===t);for(;s.index<s.processors.length;)for(let a of r)for(;a.index<a.processors.length;){let l=a.processors[a.index];if(!ap.isInstance(l))l.process(a.graph,e.subTask?e.subTask(1):new Ie),a.index++;else if(a.graph===t){l.process(a.graph,e.subTask?e.subTask(1):new Ie),a.index++;for(let g of r)g!==a&&g.index<g.processors.length&&ap.isInstance(g.processors[g.index])&&g.index++;break}else break}for(let a of r){let l=a.graph;for(let c of l){for(let g of c.getNodes())l.getLayerlessNodes().push(g);c.getNodes().length=0}for(let c of l.getLayerlessNodes())c.setLayer(null);l.getLayers().length=0,this._resizeGraph(l)}e.done()}_reviewAndCorrectHierarchicalProcessors(t,e){let o=t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY);for(let i of e){let s=i.getProperty(_.CROSSING_MINIMIZATION_STRATEGY);if(s!==o)throw new Bo("The hierarchy aware processor "+s+" in child node "+i+" is only allowed if the root node specifies the same hierarchical processor.")}let r=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE);for(let i of e)i.setProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE,r)}_collectAllGraphsBottomUp(t){let e=[t],o=[t];for(;o.length>0;){let r=o.shift();for(let i of r.getLayerlessNodes()){let s=i.getNestedGraph();s!=null&&(e.unshift(s),o.push(s))}}return e}_layout(t,e){let o=e.isRunning&&e.isRunning();o||e.begin("Component Layout",1);let r=t.getProperty(p.PROCESSORS);if(r==null)throw new Error("ElkLayered.doLayout: algorithm processor list is missing. Did GraphConfigurator.prepareGraphForLayout succeed?");let i=1/Math.max(1,r.length);for(let s of r){if(e.isCanceled&&e.isCanceled())return;s.process(t,e.subTask?e.subTask(i):new Ie)}for(let s of t){for(let a of s.getNodes())t.getLayerlessNodes().push(a);s.getNodes().length=0}for(let s of t.getLayerlessNodes())s.setLayer(null);t.getLayers().length=0,o||e.done()}_resizeGraph(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS),o=t.getProperty(_.NODE_SIZE_OPTIONS),r=t.getActualSize(),i=new O(r.x,r.y);if(e!=null&&e.has&&e.has(mt.MINIMUM_SIZE)){let s=new O(0,0),a=t.getProperty(_.NODE_SIZE_MINIMUM);a!=null&&(s.x=a.x||0,s.y=a.y||0),o!=null&&o.has&&o.has(Nt.DEFAULT_MINIMUM_SIZE)&&(s.x<=0&&(s.x=es),s.y<=0&&(s.y=os)),i.x=Math.max(r.x,s.x),i.y=Math.max(r.y,s.y)}t.getProperty(_.NODE_SIZE_FIXED_GRAPH_SIZE)||this._resizeGraphNoReallyIMeanIt(t,r,i)}_resizeGraphNoReallyIMeanIt(t,e,o){let r=t.getProperty(_.CONTENT_ALIGNMENT);o.x>e.x&&r!=null&&(r.has(he.H_CENTER)?t.getOffset().x+=(o.x-e.x)/2:r.has(he.H_RIGHT)&&(t.getOffset().x+=o.x-e.x)),o.y>e.y&&r!=null&&(r.has(he.V_CENTER)?t.getOffset().y+=(o.y-e.y)/2:r.has(he.V_BOTTOM)&&(t.getOffset().y+=o.y-e.y));let i=t.getProperty(p.GRAPH_PROPERTIES);if(i!=null&&i.has(v.EXTERNAL_PORTS)&&(o.x>e.x||o.y>e.y))for(let a of t.getLayerlessNodes()){if(a.getType()!==y.EXTERNAL_PORT)continue;let l=a.getProperty(p.EXT_PORT_SIDE);l===u.EAST?a.getPosition().x+=o.x-e.x:l===u.SOUTH&&(a.getPosition().y+=o.y-e.y)}let s=t.getPadding();t.getSize().x=o.x-s.left-s.right,t.getSize().y=o.y-s.top-s.bottom}};var wf=class{constructor(){this._nodeAndPortMap=new Map}importGraph(t){let e=this._createLGraph(t);for(let r of t.getPorts())this._ensureDefinedPortSide(e,r);let o=e.getProperty(p.GRAPH_PROPERTIES);if(this._checkExternalPorts(t,o),o.has(v.EXTERNAL_PORTS))for(let r of t.getPorts())this._transformExternalPort(t,e,r);return this._shouldCalculateMinimumGraphSize(t)&&this._calculateMinimumGraphSize(t,e),e.getProperty(_.PARTITIONING_ACTIVATE)&&o.add(v.PARTITIONS),t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN?this._importHierarchicalGraph(t,e):this._importFlatGraph(t,e),e}_ensureDefinedPortSide(t,e){let o=t.getProperty(_.DIRECTION),r=e.getProperty(_.PORT_SIDE);t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()?(r==null||r===u.UNDEFINED)&&(r=u.fromDirection(o)):this._calculateNetFlow(e)>0?r=u.fromDirection(o):r=u.fromDirection(o).opposed(),e.setProperty(_.PORT_SIDE,r)}_shouldCalculateMinimumGraphSize(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS);return e!=null&&typeof e.size=="number"&&e.size>0}_calculateMinimumGraphSize(t,e){if(t.getParent()==null)return;let o=e.getProperty(_.NODE_SIZE_CONSTRAINTS);if(o==null||o.size===0)return;t.getProperty(_.PORT_CONSTRAINTS)===H.UNDEFINED&&t.setProperty(_.PORT_CONSTRAINTS,H.FREE);let r=yo.adapt(t.getParent()),i=yo.adaptSingleNode(t),s=us.process(r,i,!1,!0);o.add(mt.MINIMUM_SIZE);let a=e.getProperty(_.NODE_SIZE_MINIMUM)||new O;a.x=Math.max(s.x,a.x),a.y=Math.max(s.y,a.y),e.setProperty(_.NODE_SIZE_MINIMUM,a)}_importFlatGraph(t,e){let o=0,r=new Set;for(let i of t.getChildren())i.getProperty(_.NO_LAYOUT)||(this._needsModelOrder(i)&&(i.setProperty(p.MODEL_ORDER,o),o++,i.hasProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)&&r.add(i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID))),this._transformNode(i,e));e.setProperty(p.MAX_MODEL_ORDER_NODES,o),e.setProperty(p.CB_NUM_MODEL_ORDER_GROUPS,r.size),o=0;for(let i of t.getContainedEdges()){this._needsModelOrderBasedOnParent(t)&&(i.setProperty(p.MODEL_ORDER,o),o++);let s=ks(i),a=Na(i);if(s==null||a==null)continue;let l=s.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),c=!i.getProperty(_.NO_LAYOUT),g=l&&i.isSelfloop()&&i.getProperty(_.INSIDE_SELF_LOOPS_YO),h=s.getParent()===t&&s.getParent()===a.getParent(),d=s.getParent()===t&&a===t,f=a.getParent()===t&&s===t;c&&!g&&(d!==f||h)&&this._transformEdge(i,t,e)}if(t.getParent()!=null)for(let i of t.getParent().getContainedEdges()){let s=ks(i);s===t&&i.isSelfloop()&&s.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE)&&i.getProperty(_.INSIDE_SELF_LOOPS_YO)&&this._transformEdge(i,t,e)}}_importHierarchicalGraph(t,e){let o=[],r=e.getProperty(_.DIRECTION),i=0,s=new Set;for(o.push(...t.getChildren());o.length>0;){let a=o.shift();if(this._needsModelOrder(a)&&(a.setProperty(p.MODEL_ORDER,i++),a.hasProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)&&s.add(a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID))),a.getProperty(_.NO_LAYOUT))continue;let l=a.getChildren().length>0,c=this._hasInsideSelfLoops(a),g=a.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN,h=a.hasProperty(mi)?a.getProperty(mi):null,d=h==null||_.ALGORITHM_ID.endsWith(h),f=null;if(d&&g&&(l||c)&&(f=this._createLGraph(a),f.setProperty(_.DIRECTION,r),this._shouldCalculateMinimumGraphSize(a))){for(let T of a.getPorts())this._ensureDefinedPortSide(f,T);this._calculateMinimumGraphSize(a,f)}let E=e,P=this._nodeAndPortMap.get(a.getParent());P instanceof ft&&P.getNestedGraph()!=null&&(E=P.getNestedGraph());let S=this._transformNode(a,E);f!=null&&(S.setNestedGraph(f),f.setParentNode(S),o.push(...a.getChildren()))}for(e.setProperty(p.MAX_MODEL_ORDER_NODES,i),e.setProperty(p.CB_NUM_MODEL_ORDER_GROUPS,s.size),i=0,o.push(t);o.length>0;){let a=o.shift();for(let c of a.getContainedEdges()){this._checkEdgeValidity(c),this._needsModelOrderBasedOnParent(t)&&c.setProperty(p.MODEL_ORDER,i++);let g=Pt(c.getSources()[0]),h=Pt(c.getTargets()[0]);if(g==null||h==null||c.getProperty(_.NO_LAYOUT)||g.getProperty(_.NO_LAYOUT)||h.getProperty(_.NO_LAYOUT))continue;let d=c.isSelfloop()&&g.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE)&&c.getProperty(_.INSIDE_SELF_LOOPS_YO),f=a;d||mo(h,g)?f=g:mo(g,h)&&(f=h);let E=e,P=this._nodeAndPortMap.get(f);P instanceof ft&&P.getNestedGraph()!=null&&(E=P.getNestedGraph());let S=this._transformEdge(c,f,E);S!=null&&S.setProperty(p.COORDINATE_SYSTEM_ORIGIN,this._findCoordinateSystemOrigin(c,t,e))}if(a.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN)for(let c of a.getChildren()){let g=c.hasProperty(mi)?c.getProperty(mi):null,h=g==null||_.ALGORITHM_ID.endsWith(g),d=c.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN;h&&d&&o.push(c)}}}_needsModelOrder(t){let e=t.getParent();return this._needsModelOrderBasedOnParent(e)&&!t.getProperty(_.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER)}_needsModelOrderBasedOnParent(t){let e=t.getProperty(_.CYCLE_BREAKING_STRATEGY),o=e===Xt.MODEL_ORDER||e===Xt.BFS_NODE_ORDER||e===Xt.DFS_NODE_ORDER||e===Xt.GREEDY_MODEL_ORDER||e===Xt.SCC_CONNECTIVITY||e===Xt.SCC_NODE_TYPE,r=t.getProperty(_.LAYERING_STRATEGY),i=t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY),s=r===ae.BF_MODEL_ORDER||r===ae.DF_MODEL_ORDER||i===ut.MODEL_ORDER_LEFT_TO_RIGHT||i===ut.MODEL_ORDER_RIGHT_TO_LEFT,a=t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==ce.NONE||t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)||t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)!=="NONE"||t.getProperty(_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_NODE_INFLUENCE)!==0||t.getProperty(_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_PORT_INFLUENCE)!==0;return o||s||a}_hasInsideSelfLoops(t){if(!t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))return!1;for(let e of t.getPorts())for(let o of e.getOutgoingEdges())if(o.isSelfloop()&&o.getProperty(_.INSIDE_SELF_LOOPS_YO))return!0;return!1}_findCoordinateSystemOrigin(t,e,o){let r=Pt(t.getSources()[0]),i=Pt(t.getTargets()[0]);if(r==null||i==null||r.getParent()===i.getParent()||mo(i,r))return null;let s=t.getContainingNode();if(s===e)return o;let a=this._nodeAndPortMap.get(s);if(a instanceof ft){let l=a.getNestedGraph();if(l!=null)return l}return null}_createLGraph(t){let e=new Nn;e.copyProperties(t),e.getProperty(_.DIRECTION)===R.UNDEFINED&&e.setProperty(_.DIRECTION,z.getDirection(e)),e.setProperty(p.ORIGIN,t),e.setProperty(p.GRAPH_PROPERTIES,new Set);let o=t.getParent()==null?null:yo.adapt(t.getParent()),r=yo.adaptSingleNode(t),i=us.computeInsideNodeLabelPadding(o,r,R.RIGHT),s=e.getProperty(_.PADDING),a=e.getPadding();return s!=null&&(a.top+=s.top||0,a.bottom+=s.bottom||0,a.left+=s.left||0,a.right+=s.right||0),i!=null&&(a.top+=i.top||0,a.bottom+=i.bottom||0,a.left+=i.left||0,a.right+=i.right||0),e}_checkExternalPorts(t,e){let o=t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=t.getProperty(_.PORT_LABELS_PLACEMENT),i=!1,s=!1;for(let a of t.getPorts()){if(i&&s)break;let l=0;for(let c of Ta(a)){let g=o&&c.isSelfloop()&&c.getProperty(_.INSIDE_SELF_LOOPS_YO),d=c.getSources().includes(a)?Pt(c.getTargets()[0]):Pt(c.getSources()[0]),f=d!=null&&d.getParent()===t;if((g||f)&&(l++,l>1))break}(l>0||r!=null&&r.has&&r.has(it.INSIDE)&&a.getLabels().length>0)&&(i=!0),l>1&&(s=!0)}i&&e.add(v.EXTERNAL_PORTS),s&&e.add(v.HYPEREDGES)}_transformExternalPort(t,e,o){let r=new O(o.getX()+o.getWidth()/2,o.getY()+o.getHeight()/2),i=this._calculateNetFlow(o),s=t.getProperty(_.PORT_CONSTRAINTS),a=o.getProperty(_.PORT_SIDE);if(!o.getAllProperties().has(_.PORT_BORDER_OFFSET)){let f;o.getX()===0&&o.getY()===0?f=0:f=eu!=null?eu(o,a):0,o.setProperty(_.PORT_BORDER_OFFSET,f)}let l=new O(t.getWidth(),t.getHeight()),c=z.createExternalPortDummy(o,s,a,i,l,r,new O(o.getWidth(),o.getHeight()),e.getProperty(_.DIRECTION),e);c.setProperty(p.ORIGIN,o);let g=c.getPorts()[0];g.setConnectedToExternalNodes(this._isConnectedToExternalNodes(o)),c.setProperty(_.PORT_LABELS_PLACEMENT,it.outside());let h=t.getProperty(_.PORT_LABELS_PLACEMENT)!=null&&t.getProperty(_.PORT_LABELS_PLACEMENT).has&&t.getProperty(_.PORT_LABELS_PLACEMENT).has(it.INSIDE);for(let f of o.getLabels())if(!f.getProperty(_.NO_LAYOUT)&&f.getText()!=null&&f.getText().length>0){let E=this._transformLabel(f);if(g.getLabels().push(E),!h)switch(a){case u.EAST:case u.WEST:E.getSize().x=0;break;case u.NORTH:case u.SOUTH:E.getSize().y=0;break;default:break}}let d=t.getParent();d!=null&&(c.setProperty(_.SPACING_LABEL_PORT_HORIZONTAL,d.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL)),c.setProperty(_.SPACING_LABEL_PORT_VERTICAL,d.getProperty(_.SPACING_LABEL_PORT_VERTICAL)),c.setProperty(_.SPACING_LABEL_LABEL,d.getProperty(_.SPACING_LABEL_LABEL))),e.getLayerlessNodes().push(c),this._nodeAndPortMap.set(o,c)}_calculateNetFlow(t){let e=t.getParent(),o=e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=0,i=0;for(let s of t.getOutgoingEdges()){let a=s.isSelfloop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=Pt(s.getTargets()[0]);a&&l?i++:a&&!l?r++:c!=null&&(c.getParent()===e||c===e)?i++:r++}for(let s of t.getIncomingEdges()){let a=s.isSelfloop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=Pt(s.getSources()[0]);a&&l?r++:a&&!l?i++:c!=null&&(c.getParent()===e||c===e)?r++:i++}return r-i}_isConnectedToExternalNodes(t){let e=t.getParent();for(let o of t.getOutgoingEdges()){let r=Pt(o.getTargets()[0]);if(r!=null&&!mo(r,e))return!0}for(let o of t.getIncomingEdges()){let r=Pt(o.getSources()[0]);if(r!=null&&!mo(r,e))return!0}return!1}_transformNode(t,e){let o=new ft(e);o.copyProperties(t),o.setProperty(p.ORIGIN,t),o.getSize().x=t.getWidth(),o.getSize().y=t.getHeight(),o.getPosition().x=t.getX(),o.getPosition().y=t.getY(),e.getLayerlessNodes().push(o),this._nodeAndPortMap.set(t,o),(t.getChildren().length>0||t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))&&o.setProperty(p.COMPOUND_NODE,!0);let r=e.getProperty(p.GRAPH_PROPERTIES),i=o.getProperty(_.PORT_CONSTRAINTS);i===H.UNDEFINED?(o.setProperty(_.PORT_CONSTRAINTS,H.FREE),i=H.FREE):i!==H.FREE&&r.add(v.NON_FREE_PORTS);let s=0,a=e.getProperty(_.DIRECTION);for(let l of t.getPorts())this._needsModelOrder(t)&&l.setProperty(p.MODEL_ORDER,s++),l.getProperty(_.NO_LAYOUT)||this._transformPort(l,o,r,a,i);for(let l of t.getLabels())!l.getProperty(_.NO_LAYOUT)&&l.getText()!=null&&l.getText().length>0&&o.getLabels().push(this._transformLabel(l));return o.getProperty(_.COMMENT_BOX)&&r.add(v.COMMENTS),o.getProperty(_.HYPERNODE)&&(r.add(v.HYPERNODES),r.add(v.HYPEREDGES),o.setProperty(_.PORT_CONSTRAINTS,H.FREE)),o}_transformPort(t,e,o,r,i){let s=new rt;s.copyProperties(t),s.setSide(t.getProperty(_.PORT_SIDE)||u.UNDEFINED),s.setProperty(p.ORIGIN,t),s.setNode(e),s.getSize().x=t.getWidth(),s.getSize().y=t.getHeight(),s.getPosition().x=t.getX(),s.getPosition().y=t.getY(),this._nodeAndPortMap.set(t,s);let a=!1;for(let l of t.getOutgoingEdges()){for(let c of l.getTargets()){let g=Pt(c);if(g!=null&&mo(g,t.getParent())){a=!0;break}}if(a)break}if(!a)for(let l of t.getIncomingEdges()){for(let c of l.getSources()){let g=Pt(c);if(g!=null&&mo(g,t.getParent())){a=!0;break}}if(a)break}if(!a){for(let l of t.getOutgoingEdges())if(l.isSelfloop()&&l.getProperty(_.INSIDE_SELF_LOOPS_YO)){a=!0;break}}s.setProperty(p.INSIDE_CONNECTIONS,a),z.initializePort(s,i,r,t.getProperty(_.PORT_ANCHOR));for(let l of t.getLabels())!l.getProperty(_.NO_LAYOUT)&&l.getText()!=null&&l.getText().length>0&&s.getLabels().push(this._transformLabel(l));return r===R.LEFT||r===R.RIGHT?(s.getSide()===u.NORTH||s.getSide()===u.SOUTH)&&o.add(v.NORTH_SOUTH_PORTS):(r===R.UP||r===R.DOWN)&&(s.getSide()===u.EAST||s.getSide()===u.WEST)&&o.add(v.NORTH_SOUTH_PORTS),s}_transformEdge(t,e,o){this._checkEdgeValidity(t);let r=t.getSources()[0],i=t.getTargets()[0],s=Pt(r),a=Pt(i),l=t.getSections().length>0?t.getSections()[0]:null,c=this._nodeAndPortMap.get(s),g=this._nodeAndPortMap.get(a),h=null,d=null;if(r instanceof Ve){let N=this._nodeAndPortMap.get(r);N instanceof rt?h=N:N instanceof ft&&(c=N,h=c.getPorts()[0])}if(i instanceof Ve){let N=this._nodeAndPortMap.get(i);N instanceof rt?d=N:N instanceof ft&&(g=N,d=g.getPorts()[0])}if(!(c instanceof ft)||!(g instanceof ft))throw new Bo("The source or target of an edge could not be found. This usually happens when an edge connects nodes laid out by different algorithms. Try setting hierarchyHandling to INCLUDE_CHILDREN.");let f=new _e;f.copyProperties(t),f.setProperty(p.ORIGIN,t),f.setProperty(_.JUNCTION_POINTS,null);let E=o.getProperty(p.GRAPH_PROPERTIES);if(c===g&&E.add(v.SELF_LOOPS),h==null){let N=W.OUTPUT,I=null;l!=null&&c.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(I=new O(l.getStartX(),l.getStartY()),su(I,t.getContainingNode()),nu(I,e),mo(a,s)&&(N=W.INPUT,I.x+=c.getPosition().x,I.y+=c.getPosition().y)),h=z.createPort(c,I,N,o)}if(d==null){let N=W.INPUT,I=null;l!=null&&g.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(I=new O(l.getEndX(),l.getEndY()),su(I,t.getContainingNode()),nu(I,e)),d=z.createPort(g,I,N,g.getGraph())}f.setSource(h),f.setTarget(d),(h.getIncomingEdges().length>1||h.getOutgoingEdges().length>1||d.getIncomingEdges().length>1||d.getOutgoingEdges().length>1)&&E.add(v.HYPEREDGES);for(let N of t.getLabels())if(!N.getProperty(_.NO_LAYOUT)&&N.getText()!=null&&N.getText().length>0){let I=this._transformLabel(N);f.getLabels().push(I);let C=I.getProperty(_.EDGE_LABELS_PLACEMENT);C===St.HEAD||C===St.TAIL?E.add(v.END_LABELS):C===St.CENTER&&(E.add(v.CENTER_LABELS),I.setProperty(_.EDGE_LABELS_PLACEMENT,St.CENTER))}let P=o.getProperty(_.CROSSING_MINIMIZATION_STRATEGY),S=o.getProperty(_.NODE_PLACEMENT_STRATEGY),T=P===We.INTERACTIVE||S===ze.INTERACTIVE;if(l!=null&&l.getBendPoints().length>0&&T){let N=new st;for(let I of l.getBendPoints())N.add(new O(I.x,I.y));f.setProperty(p.ORIGINAL_BENDPOINTS,N)}return f}_checkEdgeValidity(t){if(t.getSources().length===0)throw new Bo("Edges must have a source.");if(t.getTargets().length===0)throw new Bo("Edges must have a target.");if(t.isHyperedge())throw new Bo("Hyperedges are not supported.")}_transformLabel(t){let e=new ua(t.getText());return e.copyProperties(t),e.setProperty(p.ORIGIN,t),e.getSize().x=t.getWidth(),e.getSize().y=t.getHeight(),e.getPosition().x=t.getX(),e.getPosition().y=t.getY(),e}};var Mf=class n{applyLayout(t){let e=t.getProperty(p.ORIGIN);if(!(e instanceof Or))return;let o=e,r=t.getParentNode(),i=new O(t.getOffset().x,t.getOffset().y),s=t.getPadding();i.x+=s.left,i.y+=s.top;let a=o.getProperty(_.NODE_SIZE_OPTIONS);if(a!=null&&a.has&&a.has(Nt.COMPUTE_PADDING)){let g=o.getProperty(_.PADDING);g!=null&&(g.bottom=s.bottom,g.top=s.top,g.left=s.left,g.right=s.right)}let l=[];for(let g of t.getLayerlessNodes()){if(n._representsNode(g))this._applyNodeLayout(g,i);else if(n._representsExternalPort(g)&&r==null){let h=g.getProperty(p.ORIGIN),d=z.getExternalPortPosition(t,g,h.getWidth(),h.getHeight());h.setLocation(d.x,d.y)}for(let h of g.getPorts())for(let d of h.getOutgoingEdges())z.isDescendant(d.getTarget().getNode(),g)||l.push(d)}if(r!=null)for(let g of r.getPorts())for(let h of g.getOutgoingEdges())z.isDescendant(h.getTarget().getNode(),r)&&l.push(h);let c=o.getProperty(_.EDGE_ROUTING);for(let g of l)this._applyEdgeLayout(g,c,i,s);this._applyParentNodeLayout(t);for(let g of t.getLayerlessNodes()){let h=g.getNestedGraph();h!=null&&this.applyLayout(h)}}_applyNodeLayout(t,e){let o=t.getProperty(p.ORIGIN),r=t.getProperty(_.CROSSING_MINIMIZATION_POSITION_ID),i=t.getProperty(_.LAYERING_LAYER_ID);o.setProperty(_.CROSSING_MINIMIZATION_POSITION_ID,r),o.setProperty(_.LAYERING_LAYER_ID,i),o.setX(t.getPosition().x+e.x),o.setY(t.getPosition().y+e.y);let s=o.getProperty(_.NODE_SIZE_CONSTRAINTS);(s!=null&&s.size>0||t.getNestedGraph()!=null)&&(o.setWidth(t.getSize().x),o.setHeight(t.getSize().y));for(let h of t.getPorts()){let d=h.getProperty(p.ORIGIN);d instanceof Ve&&(d.setLocation(h.getPosition().x,h.getPosition().y),d.setProperty(_.PORT_SIDE,h.getSide()))}let l=t.getProperty(_.NODE_LABELS_PLACEMENT),c=l!=null&&l.size>0;for(let h of t.getLabels()){let d=h.getProperty(_.NODE_LABELS_PLACEMENT),f=d!=null&&d.size>0;if(c||f){let E=h.getProperty(p.ORIGIN);E!=null&&(E.setDimensions(h.getSize().x,h.getSize().y),E.setLocation(h.getPosition().x,h.getPosition().y))}}let g=t.getProperty(_.PORT_LABELS_PLACEMENT);if(g!=null&&!it.isFixed(g))for(let h of t.getPorts())for(let d of h.getLabels()){let f=d.getProperty(p.ORIGIN);f!=null&&(f.setWidth(d.getSize().x),f.setHeight(d.getSize().y),f.setLocation(d.getPosition().x,d.getPosition().y))}}_applyEdgeLayout(t,e,o,r){let i=t.getProperty(p.ORIGIN);if(i==null)return;let s=t.getBendPoints(),a=new O(o.x,o.y),l=this._calculateHierarchicalOffset(t);a.x+=l.x,a.y+=l.y;let c;if(z.isDescendant(t.getTarget().getNode(),t.getSource().getNode())){let P=t.getSource();c=new O(P.getPosition().x+P.getAnchor().x,P.getPosition().y+P.getAnchor().y),c.x-=o.x,c.y-=o.y}else{let P=t.getSource().getAbsoluteAnchor();c=new O(P.x,P.y)}s.addFirst(c);let g=t.getTarget().getAbsoluteAnchor(),h=new O(g.x,g.y),d=t.getProperty(p.TARGET_OFFSET);d!=null&&(h.x+=d.x,h.y+=d.y),s.addLast(h);for(let P of s)P.x+=a.x,P.y+=a.y;let f=ar(i,!0,!0);f.setIncomingShape(i.getSources()[0]),f.setOutgoingShape(i.getTargets()[0]),Xs(s,f);for(let P of t.getLabels()){let S=P.getProperty(p.ORIGIN);S!=null&&(S.setWidth(P.getSize().x),S.setHeight(P.getSize().y),S.setLocation(P.getPosition().x+a.x,P.getPosition().y+a.y))}let E=t.getProperty(_.JUNCTION_POINTS);if(E!=null){for(let P of E)P.x+=a.x,P.y+=a.y;i.setProperty(_.JUNCTION_POINTS,E)}else i.setProperty(_.JUNCTION_POINTS,null);e===At.SPLINES?i.setProperty(_.EDGE_ROUTING,At.SPLINES):i.setProperty(_.EDGE_ROUTING,null)}_calculateHierarchicalOffset(t){let e=t.getProperty(p.COORDINATE_SYSTEM_ORIGIN);if(e==null)return new O;let o=new O,r=t.getSource().getNode().getGraph();for(;r!==e;){let i=r.getParentNode();if(i==null)break;r=i.getGraph(),o.x+=i.getPosition().x,o.y+=i.getPosition().y,o.x+=r.getOffset().x,o.y+=r.getOffset().y,o.x+=r.getPadding().left,o.y+=r.getPadding().top}return o}_applyParentNodeLayout(t){let e=t.getProperty(p.ORIGIN),o=e.getProperty(_.NODE_SIZE_CONSTRAINTS),r=o!=null&&o.has&&o.has(mt.PORT_LABELS);if(t.getParentNode()==null){let i=t.getProperty(p.GRAPH_PROPERTIES),s=t.getActualSize();i!=null&&i.has(v.EXTERNAL_PORTS)?(e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),Ae(e,s.x,s.y,!1,!0)):e.getProperty(_.NODE_SIZE_FIXED_GRAPH_SIZE)||Ae(e,s.x,s.y,!0,!0)}r?e.setProperty(_.NODE_SIZE_CONSTRAINTS,new Set([mt.PORT_LABELS])):e.setProperty(_.NODE_SIZE_CONSTRAINTS,mt.fixed())}static _representsNode(t){return t.getProperty(p.ORIGIN)instanceof Or}static _representsExternalPort(t){return t.getProperty(p.ORIGIN)instanceof Ve}};var bf=class n{importGraph(t){return new wf().importGraph(t)}applyLayout(t){new Mf().applyLayout(t)}static getOriginIdentifier(t){let e=t.getProperty(p.ORIGIN);return e!=null&&typeof e.getIdentifier=="function"?n._getIdentifier(e):null}static _getIdentifier(t){let e=t.getIdentifier!=null?t.getIdentifier():null;if(e!=null&&e.length>0){let o=typeof t.getParent=="function"?t.getParent():null;if(o!=null&&typeof o.getIdentifier=="function"){let r=n._getIdentifier(o);if(r!=null)return r+"."+e}return e}return null}};var Gf=class extends de{constructor(){super(),this.elkLayered=new Df}layout(t,e){let o=new bf,r=o.importGraph(t);t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN?this.elkLayered.doCompoundLayout(r,e):this.elkLayered.doLayout(r,e),(!e||!e.isCanceled||!e.isCanceled())&&o.applyLayout(r)}getLayoutAlgorithm(){return this.elkLayered}};var PO="org.eclipse.elk.layered",OO=!1;function SO(){let n=Ht.getInstance(),t=n.getAlgorithmData(PO);if(t)return OO=!0,t;let e=new Se.Builder().id(PO).name("ELK Layered").description("Layer-based algorithm with a hand-ported JS implementation.").category("org.eclipse.elk.layered").definingBundleId("org.eclipse.elk.alg.layered").providerFactory(()=>new Gf).supportedFeatures(new Set(["SELF_LOOPS","INSIDE_SELF_LOOPS","MULTI_EDGES","EDGE_LABELS","PORTS","COMPOUND","CLUSTERS"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),OO=!0,e}var le=class le{constructor(t,e=""){this.name=t,this.description=e,Object.freeze(this)}getDescription(){return this.description}toString(){return this.name}static values(){return[le.SELF_LOOPS,le.INSIDE_SELF_LOOPS,le.MULTI_EDGES,le.EDGE_LABELS,le.PORTS,le.COMPOUND,le.CLUSTERS,le.DISCONNECTED]}static valueOf(t){return le[t]||null}};Z(le,"SELF_LOOPS",new le("SELF_LOOPS","Edges connecting a node with itself.")),Z(le,"INSIDE_SELF_LOOPS",new le("INSIDE_SELF_LOOPS","Self-loops routed through a node instead of around it.")),Z(le,"MULTI_EDGES",new le("MULTI_EDGES","Multiple edges with the same source and target node.")),Z(le,"EDGE_LABELS",new le("EDGE_LABELS","Labels that are associated with edges.")),Z(le,"PORTS",new le("PORTS","Edges are connected to nodes over ports.")),Z(le,"COMPOUND",new le("COMPOUND","Edges that connect nodes from different hierarchy levels and are incident to compound nodes.")),Z(le,"CLUSTERS",new le("CLUSTERS","Edges that connect nodes from different clusters, but not the cluster parent nodes.")),Z(le,"DISCONNECTED",new le("DISCONNECTED","Multiple connected components."));var lp=le;function Rt(n,t,e,o){this.graph=n,this.model=n.getModel(),this.elkToCellMap=t,this.portCells=e||new Set,this.options=o||{},this._styles=this.options.styleBatch||new Zi(n),this._anchorCache={}}function Zi(n){this.graph=n,this.model=n.getModel(),this._pending=new Map}function yR(n,t,e){if(typeof mxUtils!="undefined"&&mxUtils!=null&&typeof mxUtils.setStyle=="function")return mxUtils.setStyle(n,t,e);var o=e!=null&&(typeof e.length=="undefined"||e.length>0);if(n!=null&&typeof n!="string"&&(n=""+n),n==null||n.length==0)o&&(n=t+"="+e+";");else if(n.substring(0,t.length+1)==t+"="){var r=n.indexOf(";");o?n=t+"="+e+(r<0?";":n.substring(r)):n=r<0||r==n.length-1?"":n.substring(r+1)}else{var i=n.indexOf(";"+t+"=");if(i<0){if(o){var s=n.charAt(n.length-1)==";"?"":";";n=n+s+t+"="+e+";"}}else{var a=n.indexOf(";",i+1);o?n=n.substring(0,i+1)+t+"="+e+(a<0?";":n.substring(a)):n=n.substring(0,i)+(a<0?";":n.substring(a))}}return n}Zi.prototype._read=function(n){var t=typeof this.model.getStyle=="function"?this.model.getStyle(n):n.style;return t!=null?t:""};Zi.prototype.get=function(n){return this._pending.has(n)?this._pending.get(n):this._read(n)};Zi.prototype.set=function(n,t,e){var o=yR(this.get(n),t,e);this._pending.set(n,o!=null?o:"")};Zi.prototype.flush=function(){var n=this;this._pending.forEach(function(t,e){n._read(e)!==t&&(typeof n.model.setStyle=="function"?n.model.setStyle(e,t):e.style=t)}),this._pending.clear()};function Dt(n){return Math.round(n*100)/100}function Hf(n){return n>0?n<1?n:1:0}function IR(n,t){var e=n!=null?n.length:0,o=t!=null?t.length:0;if(e!==o)return!1;for(var r=0;r<e;r++)if(n[r].x!==t[r].x||n[r].y!==t[r].y)return!1;return!0}function RR(n,t){return n==null&&t==null?!0:n!=null&&t!=null&&n.x===t.x&&n.y===t.y}function LR(n,t){return n.x===t.x&&n.y===t.y&&!n.relative==!t.relative&&IR(n.points,t.points)&&RR(n.offset,t.offset)}Rt.prototype.apply=function(n,t,e){this._applyNodes(n,t||0,e||0),this.options.portSpread&&this._spreadPorts(n),this._applyEdges(n,t||0,e||0),this._styles.flush()};Rt.prototype._spreadPorts=function(n){var t=1.3,e=.05,o=.5,r={};function i(A,B,Y){var j=B+(A.x||0),X=Y+(A.y||0);if(A.id!=null&&(r[A.id]={x:j,y:X,width:A.width||0,height:A.height||0}),A.children)for(var tt=0;tt<A.children.length;tt++)i(A.children[tt],j,X)}i(n,0,0);function s(A,B,Y){return Math.abs(B-Y.y)<o?"N":Math.abs(B-(Y.y+Y.height))<o?"S":Math.abs(A-Y.x)<o?"W":Math.abs(A-(Y.x+Y.width))<o?"E":null}var a={};function l(A,B,Y,j){var X=r[A];if(X!=null){var tt=s(Y+B.x,j+B.y,X);if(tt!=null){var ot=A+"|"+tt;(a[ot]=a[ot]||[]).push({box:X,side:tt,point:B,ox:Y,oy:j})}}}function c(A,B,Y){var j=B+(A.x||0),X=Y+(A.y||0);if(A.edges)for(var tt=0;tt<A.edges.length;tt++){var ot=A.edges[tt];if(!(!ot.sections||ot.sections.length===0)){var Lt=ot.sections[0];Lt.startPoint&&ot.sources&&ot.sources[0]!=null&&l(ot.sources[0],Lt.startPoint,j,X),Lt.endPoint&&ot.targets&&ot.targets[0]!=null&&l(ot.targets[0],Lt.endPoint,j,X)}}if(A.children)for(var tt=0;tt<A.children.length;tt++)c(A.children[tt],j,X)}c(n,0,0);for(var g in a){var h=a[g];if(!(h.length<2)){var d=h[0].box,f=h[0].side,E=f==="N"||f==="S",P=E?d.width:d.height;if(P>0)for(var S=E?d.x:d.y,T=0;T<h.length;T++){var N=h[T],I=E?N.ox+N.point.x:N.oy+N.point.y,C=(I-S)/P,x=.5+(C-.5)*t;x<e?x=e:x>1-e&&(x=1-e);var M=S+x*P;E?N.point.x=M-N.ox:N.point.y=M-N.oy}}}};Rt.prototype._applyNodes=function(n,t,e){if(n.children)for(var o=0;o<n.children.length;o++){var r=n.children[o],i=this.elkToCellMap[r.id];if(i!=null){var s=this.model.getGeometry(i);if(s!=null){var a=this._isTransparentBounds(i);if(a){if((r.children==null||r.children.length===0)&&r.x!=null&&r.y!=null){var g=r.x+t,h=r.y+e,d=fi(this.graph,i);d!=null&&pa(this.model,i,Dt(g-(s.x+d.x)),Dt(h-(s.y+d.y)))}}else{var l=s;if(s=s.clone(),s.x=Dt(r.x+t),s.y=Dt(r.y+e),r.width!=null&&r.height!=null&&(this.options.resizeParent||r.children!=null&&r.children.length>0)){s.width=Dt(r.width),s.height=Dt(r.height);var c=AR(this.graph,i);c!=null&&(s.width=Math.max(s.width,Dt(c.width)),s.height=Math.max(s.height,Dt(c.height)))}(s.x!==l.x||s.y!==l.y||s.width!==l.width||s.height!==l.height)&&this.model.setGeometry(i,s)}var f=a?Dt(r.x+t):0,E=a?Dt(r.y+e):0;r.children&&r.children.length>0&&this._applyNodes(r,f,E),r.edges&&this._applyEdges(r,f,E)}}}};Rt.prototype._applyEdges=function(n,t,e){if(n.edges)for(var o=0;o<n.edges.length;o++){var r=n.edges[o],i=this.elkToCellMap[r.id];if(i!=null){var s=this.model.getGeometry(i);if(s!=null){var a=s.clone(),l=null;if(r.sections){l=[];for(var c=0;c<r.sections.length;c++){var g=r.sections[c];if(g.startPoint&&l.push(new mxPoint(Dt(g.startPoint.x+t),Dt(g.startPoint.y+e))),g.bendPoints)for(var h=0;h<g.bendPoints.length;h++){var d=g.bendPoints[h];l.push(new mxPoint(Dt(d.x+t),Dt(d.y+e)))}g.endPoint&&l.push(new mxPoint(Dt(g.endPoint.x+t),Dt(g.endPoint.y+e)))}}var f=this.options.reversedEdges!=null&&this.options.reversedEdges.has(r.id);f&&l!=null&&l.reverse();var E=this.options.jettyEnds!=null?this.options.jettyEnds[r.id]:null;if(E!=null&&l!=null&&l.length>=2&&(E.source===!0&&this._appendAnchorPoint(i,i.source,l,!0),E.target===!0&&this._appendAnchorPoint(i,i.target,l,!1)),this.options.applyEdgeRouting&&l){var P=l.slice(1,l.length-1);a.points=P.length>0?P:null}else this.options.resetEdgePoints&&(a.points=null);var S=this.options.anchoredEnds!=null?this.options.anchoredEnds[r.id]:null,T=S!=null&&S.source===!0,N=S!=null&&S.target===!0;l&&l.length>=2&&this.options.applyEdgeRouting&&this.options.orthogonalRouting&&(T||(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),N||(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null)));var I=this.options.edgeStyleMode,C=this.options.climbedEnds!=null?this.options.climbedEnds[r.id]:null,x=this.options.maskedEnds!=null?this.options.maskedEnds[r.id]:null,M=C!=null&&C.source===!0,A=C!=null&&C.target===!0,B=x!=null&&x.source===!0,Y=x!=null&&x.target===!0,j=!1,X=!1;l&&l.length>=2&&this.options.applyEdgeRouting&&(j=!T&&!M&&this._snapEndpointToAnchor(i,i.source,l,!0),X=!N&&!A&&this._snapEndpointToAnchor(i,i.target,l,!1));var tt=M||T||B&&!j,ot=A||N||Y&&!X;tt&&!T&&this.options.applyEdgeRouting&&(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),ot&&!N&&this.options.applyEdgeRouting&&(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null));var Lt=a.points!=null&&a.points.length>=1,zt=l!=null?l[0]:null,be=l!=null?l[l.length-1]:null,mr=zt!=null&&be!=null&&(Math.abs(zt.x-be.x)>.5||Math.abs(zt.y-be.y)>.5),Ea=l&&l.length>=2&&this.options.applyEdgeRouting&&this.options.orthogonalRouting&&i.source!=null&&i.target!=null,Pr=!1;if(Ea&&I==="orthogonalEdgeStyle")if(this._isOrthogonalChain(l)&&(Lt||mr)){var ma=!tt&&!j&&this._terminalDiagonal(i,i.source,l,!0),Pa=!ot&&!X&&this._terminalDiagonal(i,i.target,l,!1);Lt?(!ma&&!tt&&this._alignEndpointSegment(a,l,!0),!Pa&&!ot&&this._alignEndpointSegment(a,l,!1)):this._synthesizeZ(a,l),tt||this._strictPinTerminal(i,i.source,l,!0,ma,j),ot||this._strictPinTerminal(i,i.target,l,!1,Pa,X),Pr=!0}else tt||this._applyEndpointConstraint(i,i.source,l,!0,j),ot||this._applyEndpointConstraint(i,i.target,l,!1,X),this._styles.set(i,mxConstants.STYLE_EDGE,null),this._styles.set(i,mxConstants.STYLE_NOEDGESTYLE,"1");else if(Ea&&(I==="elkCompat"||I==="orthogonal")){var Gs=tt?null:this._applyEndpointConstraint(i,i.source,l,!0,j),Hs=ot?null:this._applyEndpointConstraint(i,i.target,l,!1,X),ma=!tt&&!j&&this._terminalDiagonal(i,i.source,l,!0),Pa=!ot&&!X&&this._terminalDiagonal(i,i.target,l,!1),hp=ma||Pa,IO=!hp&&(Lt||mr&&(Math.abs(zt.x-be.x)<=.5||Math.abs(zt.y-be.y)<=.5));if(IO)Gs!=null&&(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),Hs!=null&&(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null)),Lt||(a.points=[new mxPoint(Dt((zt.x+be.x)/2),Dt((zt.y+be.y)/2))]),Pr=!0;else if(hp){if(ma)this._pinPerpendicularPerimeter(i,i.source,l,!0),this._anchorDiagonalBody(a,l,!0);else if(Gs!=null&&I==="orthogonal"){var dp=a.points!=null?a.points.slice():[];dp.unshift(Gs),a.points=dp}if(Pa)this._pinPerpendicularPerimeter(i,i.target,l,!1),this._anchorDiagonalBody(a,l,!1);else if(Hs!=null&&I==="orthogonal"){var fp=a.points!=null?a.points.slice():[];fp.push(Hs),a.points=fp}}else if(I==="orthogonal"&&(Gs!=null||Hs!=null)){var pl=a.points!=null?a.points.slice():[];Gs!=null&&pl.unshift(Gs),Hs!=null&&pl.push(Hs),a.points=pl.length>0?pl:null}}else if(l&&l.length>=2&&this.options.applyEdgeRouting&&i.source!=null&&i.target!=null){var Ff=tt?null:this._applyEndpointConstraint(i,i.source,l,!0,j),kf=ot?null:this._applyEndpointConstraint(i,i.target,l,!1,X);if(I!=="elkCompat"&&I!=="orthogonalEdgeStyle"&&(Ff!=null||kf!=null)){var El=a.points!=null?a.points.slice():[];Ff!=null&&El.unshift(Ff),kf!=null&&El.push(kf),a.points=El.length>0?El:null}}Pr&&(this._styles.set(i,mxConstants.STYLE_NOEDGESTYLE,null),this._styles.set(i,mxConstants.STYLE_ORTHOGONAL,null),this._styles.set(i,mxConstants.STYLE_EDGE,mxConstants.EDGESTYLE_ORTHOGONAL));var RO=Pr||I==="orthogonalEdgeStyle"||I==="elkCompat";if(this.options.applyEdgeRouting&&this.options.orthogonalRouting&&l&&l.length>=2&&!RO&&this._styles.set(i,mxConstants.STYLE_ORTHOGONAL,"1"),this.options.applyEdgeRouting&&this.options.orthogonalRouting&&a.points!=null&&a.points.length>2&&(a.points=this._simplifyOrthogonal(a.points)),r.labels&&r.labels.length>0&&l&&l.length>=2){var ji=r.labels[0];if(ji.x!=null&&ji.y!=null){var ml=new mxPoint(ji.x+(ji.width||0)/2+t,ji.y+(ji.height||0)/2+e),Wf=this._projectOntoPolyline(ml,l),up=ml.x-Wf.x,_p=ml.y-Wf.y,LO=Math.sqrt(up*up+_p*_p),pp=LO<=(ji.height||0)/2?Wf:ml,Ep=this._polylineMidpoint(l);a.relative=!0,a.x=0,a.y=0,a.offset=new mxPoint(Dt(pp.x-Ep.x),Dt(pp.y-Ep.y))}}LR(a,s)||this.model.setGeometry(i,a)}}}};Rt.prototype._terminalBox=function(n){var t=this.model.getGeometry(n);if(t==null)return null;if(!t.relative)return t;var e=n.parent!=null?this.model.getGeometry(n.parent):null;if(e==null)return null;var o=t.x*e.width,r=t.y*e.height;return t.offset!=null&&(o+=t.offset.x,r+=t.offset.y),{x:o,y:r,width:t.width,height:t.height}};Rt.prototype._applyEndpointConstraint=function(n,t,e,o,r){if(t!=null){var i=this._terminalBox(t);if(!(i==null||!(i.width>0)||!(i.height>0))){var s=o?e[0]:e[e.length-1],a=o?e[1]:e[e.length-2],l=this._coordsBetween(n.parent,t.parent),c=s.x+l.dx,g=s.y+l.dy,h=(c-i.x)/i.width,d=(g-i.y)/i.height,f=.02;if(a!=null&&this.options.orthogonalRouting&&!r){var E=a.x+l.dx,P=a.y+l.dy;h<f||h>1-f?d=(P-i.y)/i.height:(d<f||d>1-f)&&(h=(E-i.x)/i.width)}h<0?h=0:h>1&&(h=1),d<0?d=0:d>1&&(d=1),h=Math.round(h*1e4)/1e4,d=Math.round(d*1e4)/1e4;var S=o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,T=o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y;if(this._styles.set(n,S,h),this._styles.set(n,T,d),a==null||!this.options.orthogonalRouting)return null;var N=i.x+h*i.width-l.dx,I=i.y+d*i.height-l.dy,C=N-a.x,x=I-a.y,M=.5;if(Math.abs(C)<=M||Math.abs(x)<=M)return null;var A=d===0||d===1;return A?new mxPoint(Dt(N),Dt(a.y)):new mxPoint(Dt(a.x),Dt(I))}}};Rt.prototype._anchorDiagonalBody=function(n,t,e){var o=e?t[0]:t[t.length-1];if(o!=null){var r=n.points!=null?n.points.slice():[],i=e?r[0]:r[r.length-1],s=.5;if(!(i!=null&&(Math.abs(i.x-o.x)<=s||Math.abs(i.y-o.y)<=s))){var a=new mxPoint(o.x,o.y);e?r.unshift(a):r.push(a),n.points=r}}};Rt.prototype._strictPinTerminal=function(n,t,e,o,r,i){r&&this._pinPerpendicularPerimeter(n,t,e,o)||this._applyEndpointConstraint(n,t,e,o,i)};Rt.prototype._appendAnchorPoint=function(n,t,e,o){if(t!=null){var r=this.graph.getCellStyle(n);if(r!=null){var i=parseFloat(r[o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]),s=parseFloat(r[o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]);if(!(isNaN(i)||isNaN(s))){var a=parseFloat(r[o?"exitDx":"entryDx"])||0,l=parseFloat(r[o?"exitDy":"entryDy"])||0,c=this._terminalBox(t);if(!(c==null||!(c.width>0)||!(c.height>0))){var g=this._coordsBetween(n.parent,t.parent),h=Dt(c.x+i*c.width+a-g.dx),d=Dt(c.y+s*c.height+l-g.dy),f=o?e[0]:e[e.length-1];if(!(f!=null&&Math.abs(f.x-h)<=.5&&Math.abs(f.y-d)<=.5)){if(f!=null)for(var E=Math.abs(f.x-h)>=Math.abs(f.y-d),P=o?0:e.length-1,S=o?1:-1;P>=0&&P<e.length;P+=S)if(E){if(Math.abs(e[P].y-d)>.75)break;e[P].y=d}else{if(Math.abs(e[P].x-h)>.75)break;e[P].x=h}var T=new mxPoint(h,d);o?e.unshift(T):e.push(T)}}}}}};Rt.prototype._snapEndpointToAnchor=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=this.graph.getCellStyle(n),s=r!=null&&String(r.snapToPoint)==="1"||i!=null&&String(i.snapToPoint)==="1";if(!s)return!1;var a=this._terminalAnchors(t);if(a==null)return!1;var l=this._terminalBox(t);if(l==null||!(l.width>0)||!(l.height>0))return!1;var c=o?e[0]:e[e.length-1];if(c==null)return!1;for(var g=this._coordsBetween(n.parent,t.parent),h=c.x+g.dx,d=c.y+g.dy,f=null,E=1/0,P=0;P<a.length;P++){var S=l.x+a[P].x*l.width,T=l.y+a[P].y*l.height,N=(S-h)*(S-h)+(T-d)*(T-d);N<E&&(E=N,f={x:S,y:T})}return f==null?!1:(c.x=Dt(f.x-g.dx),c.y=Dt(f.y-g.dy),!0)};Rt.prototype._terminalAnchors=function(n){var t=this._anchorCache[n.id];if(t!==void 0)return t;var e=this.graph,o=null,r=e.view!=null&&e.view.getState!=null?e.view.getState(n):null;r!=null&&e.getAllConnectionConstraints!=null&&(o=e.getAllConnectionConstraints(r,!0));var i=this._terminalBox(n),s=i!=null&&i.width>0?i.width:1,a=i!=null&&i.height>0?i.height:1,l=[],c;if(o!=null)for(c=0;c<o.length;c++){var g=o[c];g!=null&&g.point!=null&&l.push({x:Hf(g.point.x+(g.dx||0)/s),y:Hf(g.point.y+(g.dy||0)/a)})}else{var h=e.getCellStyle(n),d=h!=null?h.points:null;if(d!=null)try{var f=typeof d=="string"?JSON.parse(d):d;for(c=0;c<f.length;c++){var E=f[c];E!=null&&E.length>=2&&l.push({x:Hf(parseFloat(E[0])+(E.length>3&&parseFloat(E[3])||0)/s),y:Hf(parseFloat(E[1])+(E.length>4&&parseFloat(E[4])||0)/a)})}}catch(S){}}var P=l.length>0?l:null;return this._anchorCache[n.id]=P,P};Rt.PERPENDICULAR_PERIMETER_SHAPES={rhombus:!0,ellipse:!0,doubleEllipse:!0};function vf(n,t,e){var o=n!=null?n[t]:null,r=typeof o=="number"?o:parseFloat(o);return isNaN(r)?e:r}Rt.PERIMETER_OUTLINES={parallelogramPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east";if(i==="north"||i==="south"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:s},{x:t,y:e},{x:0,y:e-s},{x:0,y:0}]}var a=o?Math.max(0,Math.min(t*.5,r)):t*Math.max(0,Math.min(1,r));return[{x:a,y:0},{x:t,y:0},{x:t-a,y:e},{x:0,y:e},{x:a,y:0}]},trapezoidPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east";if(i==="west"){var a=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:0},{x:t-a,y:e},{x:a,y:e},{x:0,y:0}]}if(i==="north"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:s},{x:t,y:0},{x:t,y:e},{x:0,y:e-s},{x:0,y:s}]}if(i==="south"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:s},{x:t,y:e-s},{x:0,y:e},{x:0,y:0}]}var a=o?Math.max(0,Math.min(t*.5,r)):t*Math.max(0,Math.min(1,r));return[{x:a,y:0},{x:t-a,y:0},{x:t,y:e},{x:0,y:e},{x:a,y:0}]},stepPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east",s=t/2,a=e/2;if(i==="west"){var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:c,y:0},{x:t,y:0},{x:t-c,y:a},{x:t,y:e},{x:c,y:e},{x:0,y:a},{x:c,y:0}]}if(i==="north"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:l},{x:s,y:0},{x:t,y:l},{x:t,y:e},{x:s,y:e-l},{x:0,y:e},{x:0,y:l}]}if(i==="south"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:s,y:l},{x:t,y:0},{x:t,y:e-l},{x:s,y:e},{x:0,y:e-l},{x:0,y:0}]}var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t-c,y:0},{x:t,y:a},{x:t-c,y:e},{x:0,y:e},{x:c,y:a},{x:0,y:0}]},hexagonPerimeter2:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.25),i=n.direction||"east",s=t/2,a=e/2;if(i==="north"||i==="south"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:s,y:0},{x:t,y:l},{x:t,y:e-l},{x:s,y:e},{x:0,y:e-l},{x:0,y:l},{x:s,y:0}]}var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:c,y:0},{x:t-c,y:0},{x:t,y:a},{x:t-c,y:e},{x:c,y:e},{x:0,y:a},{x:c,y:0}]},trianglePerimeter:function(n,t,e){var o=n.direction||"east";return o==="north"?[{x:0,y:e},{x:t/2,y:0},{x:t,y:e},{x:0,y:e}]:o==="south"?[{x:0,y:0},{x:t/2,y:e},{x:t,y:0},{x:0,y:0}]:o==="west"?[{x:t,y:0},{x:0,y:e/2},{x:t,y:e},{x:t,y:0}]:[{x:0,y:0},{x:t,y:e/2},{x:0,y:e},{x:0,y:0}]}};function TO(n,t){if(n==null)return null;var e=n*1e4;return(t==="right"||t==="bottom"?Math.ceil(e-1e-6):Math.floor(e+1e-6))/1e4}Rt.prototype._outlineCross=function(n,t,e,o,r){for(var i=t==="top"||t==="bottom",s=i?e*o:e*r,a=t==="top"||t==="left",l=null,c=function(N){(l==null||(a?N<l:N>l))&&(l=N)},g=1;g<n.length;g++){var h=n[g-1],d=n[g],f=i?h.x:h.y,E=i?d.x:d.y,P=i?h.y:h.x,S=i?d.y:d.x;if(!(s<Math.min(f,E)-1e-9||s>Math.max(f,E)+1e-9))if(Math.abs(E-f)<1e-9)c(P),c(S);else{var T=(s-f)/(E-f);c(P+T*(S-P))}}return l==null?null:l/(i?r:o)};Rt.prototype._pinPerpendicularPerimeter=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=r!=null?r[mxConstants.STYLE_SHAPE]:null,s=i!=null&&Rt.PERPENDICULAR_PERIMETER_SHAPES[i]===!0,a=!s&&r!=null?Rt.PERIMETER_OUTLINES[r.perimeter]:null;if(!s&&a==null)return!1;var l=this._terminalBox(t);if(l==null||!(l.width>0)||!(l.height>0))return!1;var c=o?e[0]:e[e.length-1],g=o?e[1]:e[e.length-2];if(c==null||g==null)return!1;var h=this._coordsBetween(n.parent,t.parent),d=(c.y+h.dy-l.y)/l.height,f=(c.x+h.dx-l.x)/l.width,E=(g.x+h.dx-l.x)/l.width,P=(g.y+h.dy-l.y)/l.height,S=.02,T=null;if(d<=S)T="top";else if(d>=1-S)T="bottom";else if(f<=S)T="left";else if(f>=1-S)T="right";else{var N=Math.abs(g.x-c.x),I=Math.abs(g.y-c.y),C=.5;I<=C&&N>C?T=g.x>c.x?"right":"left":N<=C&&I>C&&(T=g.y>c.y?"bottom":"top")}if(T==null)return!1;var x,M;if(T==="top"||T==="bottom"?(x=Math.round(E*1e4)/1e4,M=TO(s?this._perimeterCross(i,T,x):this._outlineCross(a(r,l.width,l.height),T,x,l.width,l.height),T)):(M=Math.round(P*1e4)/1e4,x=TO(s?this._perimeterCross(i,T,M):this._outlineCross(a(r,l.width,l.height),T,M,l.width,l.height),T)),x==null||M==null)return!1;x<0?x=0:x>1&&(x=1),M<0?M=0:M>1&&(M=1);var A=o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,B=o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y;return this._styles.set(n,A,x),this._styles.set(n,B,M),!0};Rt.prototype._perimeterCross=function(n,t,e){if(e<0?e=0:e>1&&(e=1),n==="rhombus")return t==="bottom"||t==="right"?e<=.5?.5+e:1.5-e:e<=.5?.5-e:e-.5;var o=2*e-1,r=Math.sqrt(Math.max(0,1-o*o))/2;return t==="bottom"||t==="right"?.5+r:.5-r};Rt.prototype._isOrthogonalChain=function(n){if(n==null)return!1;for(var t=.5,e=2;e<=n.length-2;e++){var o=Math.abs(n[e].x-n[e-1].x),r=Math.abs(n[e].y-n[e-1].y);if(o>t&&r>t)return!1}return!0};Rt.prototype._alignEndpointSegment=function(n,t,e){var o=n.points;if(!(o==null||o.length===0)){var r=e?0:o.length-1,i=o[r],s=e?t[0]:t[t.length-1],a=.5;if(!(Math.abs(i.x-s.x)<=a||Math.abs(i.y-s.y)<=a)){var l=e?t[2]:t[t.length-3];l==null&&(l=e?t[t.length-1]:t[0]),Math.abs(i.x-l.x)>=Math.abs(i.y-l.y)?i.x=Dt(s.x):i.y=Dt(s.y)}}};Rt.prototype._synthesizeZ=function(n,t){var e=t[0],o=t[t.length-1],r,i;if(Math.abs(o.y-e.y)>=Math.abs(o.x-e.x)){var s=Dt((e.y+o.y)/2);r=new mxPoint(Dt(e.x),s),i=new mxPoint(Dt(o.x),s)}else{var a=Dt((e.x+o.x)/2);r=new mxPoint(a,Dt(e.y)),i=new mxPoint(a,Dt(o.y))}n.points=Math.abs(r.x-i.x)<=.5&&Math.abs(r.y-i.y)<=.5?[r]:[r,i],t.splice.apply(t,[1,0].concat(n.points))};Rt.prototype._simplifyOrthogonal=function(n){if(n==null||n.length<=2)return n;for(var t=.5,e=[n[0]],o=1;o<n.length-1;o++){var r=e[e.length-1],i=n[o],s=n[o+1],a=Math.abs(r.x-i.x)<=t&&Math.abs(i.x-s.x)<=t,l=Math.abs(r.y-i.y)<=t&&Math.abs(i.y-s.y)<=t;a||l||e.push(i)}return e.push(n[n.length-1]),e};Rt.NON_RECT_PERIMETER_SHAPES={ellipse:!0,doubleEllipse:!0,rhombus:!0,triangle:!0,hexagon:!0,parallelogram:!0,step:!0,trapezoid:!0};Rt.prototype._terminalDiagonal=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=r!=null?r[mxConstants.STYLE_SHAPE]:null;if(i==null||!Rt.NON_RECT_PERIMETER_SHAPES[i])return!1;var s=this._terminalBox(t);if(s==null||!(s.width>0)||!(s.height>0))return!1;var a=o?e[0]:e[e.length-1],l=this._coordsBetween(n.parent,t.parent),c=(a.x+l.dx-s.x)/s.width,g=(a.y+l.dy-s.y)/s.height,h=.02,d=Math.abs(c-.5)<h&&(g<h||g>1-h)||Math.abs(g-.5)<h&&(c<h||c>1-h);return!d};Rt.prototype._coordsBetween=function(n,t){if(n===t)return{dx:0,dy:0};var e=this._parentAbsoluteOrigin(n),o=this._parentAbsoluteOrigin(t);return{dx:e.x-o.x,dy:e.y-o.y}};Rt.prototype._parentAbsoluteOrigin=function(n){for(var t=0,e=0,o=n;o!=null&&o.parent!=null;){var r=this.model.getGeometry(o);r!=null&&(t+=r.x,e+=r.y),o=o.parent}return{x:t,y:e}};Rt.prototype._projectOntoPolyline=function(n,t){for(var e=null,o=1/0,r=1;r<t.length;r++){var i=t[r-1],s=t[r],a=s.x-i.x,l=s.y-i.y,c=a*a+l*l,g=0;c>0&&(g=((n.x-i.x)*a+(n.y-i.y)*l)/c,g<0?g=0:g>1&&(g=1));var h=i.x+g*a,d=i.y+g*l,f=(n.x-h)*(n.x-h)+(n.y-d)*(n.y-d);f<o&&(o=f,e=new mxPoint(h,d))}return e||n.clone()};Rt.prototype._polylineMidpoint=function(n){if(n.length===1)return n[0].clone();for(var t=0,e=[],o=1;o<n.length;o++){var r=n[o].x-n[o-1].x,i=n[o].y-n[o-1].y,s=Math.sqrt(r*r+i*i);e.push(s),t+=s}for(var a=t/2,l=0,o=0;o<e.length;o++){if(l+e[o]>=a){var c=e[o]===0?0:(a-l)/e[o];return new mxPoint(n[o].x+(n[o+1].x-n[o].x)*c,n[o].y+(n[o+1].y-n[o].y)*c)}l+=e[o]}return n[n.length-1].clone()};Rt.prototype._isCompound=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isVertex(o)&&!this.portCells.has(o.id))return!0}return!1};function wo(n,t){var e=n.getStyle(t);if(e==null)return!1;for(var o=e.split(";"),r=0;r<o.length;r++)if(o[r]==="transparentBounds=1")return!0;return!1}Rt.prototype._isTransparentBounds=function(n){return wo(this.model,n)};function AR(n,t){for(var e=n.getModel(),o=e.getChildCount(t),r=null,i=0;i<o;i++){var s=e.getChildAt(t,i);if(!(!e.isVertex(s)||!e.isVisible(s))){var a=e.getGeometry(s);if(!(a==null||a.relative)){var l=typeof n.getCellStyle=="function"?n.getCellStyle(s):{};if(l.part=="1"){var c=a.x+a.width,g=a.y+a.height;r==null?r={width:c,height:g}:(r.width=Math.max(r.width,c),r.height=Math.max(r.height,g))}}}}return r}function Bf(n){if(n==null||n==="")return null;if(typeof n=="number")return isFinite(n)?{top:n,right:n,bottom:n,left:n}:null;var t=String(n);try{t=decodeURIComponent(t)}catch(s){}if(t=t.trim(),t==="")return null;for(var e=t.split(/\s+/),o=[],r=0;r<e.length;r++){var i=parseFloat(e[r]);o.push(isNaN(i)?0:i)}return o.length===0?null:o.length===1?{top:o[0],right:o[0],bottom:o[0],left:o[0]}:o.length===2?{top:o[0],right:o[1],bottom:o[0],left:o[1]}:o.length===3?{top:o[0],right:o[1],bottom:o[2],left:o[1]}:{top:o[0],right:o[1],bottom:o[2],left:o[3]}}function CR(n,t){for(var e=n.getModel(),o=e.getChildCount(t),r=null,i=function(d,f,E,P){if(r==null)r={x:d,y:f,width:E,height:P};else{var S=Math.max(r.x+r.width,d+E),T=Math.max(r.y+r.height,f+P);r.x=Math.min(r.x,d),r.y=Math.min(r.y,f),r.width=S-r.x,r.height=T-r.y}},s=0;s<o;s++){var a=e.getChildAt(t,s),l=e.getGeometry(a);if(l!=null){if(e.isVertex(a)&&!l.relative)if(wo(e,a)){var c=fi(n,a);c!=null&&i(l.x+c.x,l.y+c.y,c.width,c.height)}else i(l.x,l.y,l.width,l.height);else if(e.isEdge(a)){var g=l.points!=null?l.points.slice():[];typeof l.getTerminalPoint=="function"&&(e.getTerminal(a,!0)==null&&l.getTerminalPoint(!0)!=null&&g.push(l.getTerminalPoint(!0)),e.getTerminal(a,!1)==null&&l.getTerminalPoint(!1)!=null&&g.push(l.getTerminalPoint(!1)));for(var h=0;h<g.length;h++)g[h]!=null&&i(g[h].x,g[h].y,0,0)}}}return r}function fi(n,t){var e=CR(n,t);if(e==null)return null;var o=typeof n.getCellStyle=="function"?n.getCellStyle(t):{},r=Bf(o.groupPadding)||{top:0,right:0,bottom:0,left:0},i=o.shape==="swimlane"||o.swimlane!=null;if(i){var s=parseInt(o.startSize,10);isNaN(s)&&(s=40),o.horizontal==0||o.horizontal==="0"?r.left+=s:r.top+=s}var a=parseInt(o.footerSize,10);return!isNaN(a)&&a>0&&(i&&(o.horizontal==0||o.horizontal==="0")?r.right+=a:r.bottom+=a),{x:e.x-r.left,y:e.y-r.top,width:e.width+r.left+r.right,height:e.height+r.top+r.bottom}}function ul(n,t,e){for(var o=null,r=n.getChildCount(t),i=0;i<r;i++){var s=n.getChildAt(t,i);if(!(!n.isVertex(s)||!n.isVisible(s))&&!(e!=null&&!e(s))){var a=n.getGeometry(s);if(a!=null){var l=a.x,c=a.y;if(wo(n,s)){var g=ul(n,s,e);if(g==null)continue;l=a.x+g.x,c=a.y+g.y}o==null?o={x:l,y:c}:(l<o.x&&(o.x=l),c<o.y&&(o.y=c))}}}return o}function cp(n,t,e){for(var o=n.getModel(),r=null,i=0;i<(t.children!=null?t.children.length:0);i++){var s=t.children[i],a=e[s.id];if(!(a==null||s.x==null||s.y==null)){var l=s.x,c=s.y;if(wo(o,a))if(s.children!=null&&s.children.length>0){var g=cp(n,s,e);if(g==null)continue;l=s.x+g.x,c=s.y+g.y}else{var h=fi(n,a),d=ul(o,a),f=o.getGeometry(a);if(h==null||d==null)continue;l=s.x+d.x-((f!=null?f.x:0)+h.x),c=s.y+d.y-((f!=null?f.y:0)+h.y)}r==null?r={x:l,y:c}:(l<r.x&&(r.x=l),c<r.y&&(r.y=c))}}return r}function pa(n,t,e,o,r){if(!(Math.abs(e)<.01&&Math.abs(o)<.01))for(var i=n.getChildCount(t),s=0;s<i;s++){var a=n.getChildAt(t,s);if(!(r!=null&&!r(a))){if(n.isVertex(a)&&wo(n,a)){pa(n,a,e,o,r);continue}var l=n.getGeometry(a);if(l!=null){if(n.isVertex(a)){if(l.relative)continue;var c=l.clone();c.x=l.x+e,c.y=l.y+o,n.setGeometry(a,c)}else if(n.isEdge(a)){var c=null;if(l.points!=null&&l.points.length>0){c=l.clone(),c.points=[];for(var g=0;g<l.points.length;g++){var h=l.points[g];c.points.push(new mxPoint(h.x+e,h.y+o))}}if(typeof l.getTerminalPoint=="function"&&typeof l.setTerminalPoint=="function")for(var d=0;d<2;d++){var f=d===0,E=n.getTerminal(a,f)==null?l.getTerminalPoint(f):null;E!=null&&(c=c!=null?c:l.clone(),c.setTerminalPoint(new mxPoint(E.x+e,E.y+o),f))}c!=null&&n.setGeometry(a,c)}}}}}function _t(n){this.graph=n,this.model=n.getModel(),this._cellToElk={},this._elkToCell={},this._portCells=new Set,this._cellToElkNode={},this._constraintPorts={},this._constraintPortCounter=0,this._portThresholdSize=20,this._reversedEdges=new Set,this._climbedEnds={},this._maskedEnds={},this._maskPortCounter=0,this._freeEndPortCounter=0,this._layoutDirection=null,this._edgeRouting=null,this._anchoredEnds={},this._jettyEnds={},this.respectConnectionConstraints=!1,this.rootCellIds=null,this.useViewStateSizing=!0,this.respectFixedPosition=!0,this.cellFilter=null,this.includeEdgeLabels=!0,this.includeVertexLabels=!0,this.includeCompoundLabels=null,this.groupPadding=null}_t.prototype.convert=function(n,t){this._cellToElk={},this._elkToCell={},this._portCells=new Set,this._cellToElkNode={},this._constraintPorts={},this._constraintPortCounter=0,this._reversedEdges=new Set,this._climbedEnds={},this._maskedEnds={},this._anchoredEnds={},this._jettyEnds={},this._maskPortCounter=0,this._freeEndPortCounter=0;var e=mxUtils.clone(t)||{};if(this._layoutDirection=e["elk.direction"]!=null?String(e["elk.direction"]):null,this.preserveNodePositions=e["elk.interactive"]==="true",e["elk.algorithm"]==null&&(e["elk.algorithm"]="layered"),e["elk.hierarchyHandling"]==null&&(e["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),this._edgeLabelsInline=e["elk.edgeLabels.inline"]==="true"||e["elk.edgeLabels.inline"]===!0,e["elk.edgeRouting"]==null){var o=this._inferEdgeRouting(n);o!=null&&(e["elk.edgeRouting"]=o)}if(this._edgeRouting=e["elk.edgeRouting"]!=null?String(e["elk.edgeRouting"]):null,e["elk.padding"]==null&&n!=null&&this.model.isVertex(n)){var r=this._getGroupPadding(n);e["elk.padding"]="[top="+r.top+",left="+r.left+",bottom="+r.bottom+",right="+r.right+"]"}var i={id:"root",layoutOptions:e,children:[],edges:[]};this._inheritedCompoundOptions={};for(var s in e)(s==="elk.algorithm"||s==="elk.direction"||s==="elk.layered.cycleBreaking.strategy"||s.indexOf("elk.layered.spacing.")===0||s.indexOf("elk.spacing.")===0||s.indexOf("elk.force.")===0||s.indexOf("elk.stress.")===0||s.indexOf("elk.radial.")===0||s.indexOf("elk.mrtree.")===0)&&(this._inheritedCompoundOptions[s]=e[s]);return this._convertChildren(n,i),this._convertEdges(n,i),this._convertInternalEdges(n),this._portFixedPosFreeEnds(i),i};_t.prototype.getElkToCellMap=function(){return this._elkToCell};_t.prototype.getPortCells=function(){return this._portCells};_t.prototype.getReversedEdges=function(){return this._reversedEdges};_t.prototype.getClimbedEnds=function(){return this._climbedEnds};_t.prototype.getMaskedEnds=function(){return this._maskedEnds};_t.prototype.getAnchoredEnds=function(){return this._anchoredEnds};_t.prototype.getJettyEnds=function(){return this._jettyEnds};_t.prototype._convertChildren=function(n,t){var e=null;t.id!=="root"&&this.model.isVertex(n)&&wo(this.model,n)&&(e=fi(this.graph,n));for(var o=this.model.getChildCount(n),r=0;r<o;r++){var i=this.model.getChildAt(n,r);if(!(!this.model.isVertex(i)||!this.model.isVisible(i))){if(this._isShapePart(i)){var s=this.model.getGeometry(i);if(this.model.isVertex(n)||s!=null&&s.relative)continue}if(!(this.cellFilter!=null&&!this.cellFilter(i))){var a=this.model.getGeometry(i);if(a!=null){if(i.collapsed){var l=this._convertVertex(i,a,e);this._convertPorts(i,l),t.children.push(l);continue}var l=this._convertVertex(i,a,e),c=this._hasLayoutableChildren(i);if(c){l.children=[],l.edges=[];var g=this._getGroupPadding(i);l.layoutOptions=l.layoutOptions||{},l.layoutOptions["elk.padding"]="[top="+g.top+",left="+g.left+",bottom="+g.bottom+",right="+g.right+"]";for(var h in this._inheritedCompoundOptions)l.layoutOptions[h]==null&&(l.layoutOptions[h]=this._inheritedCompoundOptions[h]);this._convertChildren(i,l)}this._convertPorts(i,l),t.children.push(l)}}}}};_t.prototype._convertVertex=function(n,t,e){var o="n"+n.id;this._cellToElk[n.id]=o,this._elkToCell[o]=n;var r=t.width,i=t.height,s=wo(this.model,n),a=s?fi(this.graph,n):null;if(a!=null)r=a.width,i=a.height;else if(this.useViewStateSizing&&!n.collapsed&&this._hasNonPartChild(n)&&this.graph.view!=null&&typeof this.graph.view.getState=="function"){var l=this.graph.view.getState(n),c=this.graph.view.scale||1;l!=null&&l.width!=null&&l.height!=null&&(r=Math.max(r,l.width/c),i=Math.max(i,l.height/c))}var g={id:o,width:r,height:i},h=(t.x||0)+(a!=null?a.x:0)-(e!=null?e.x:0),d=(t.y||0)+(a!=null?a.y:0)-(e!=null?e.y:0);this.respectFixedPosition&&typeof this.graph.isCellMovable=="function"&&!this.graph.isCellMovable(n)?(g.x=h,g.y=d,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.position"]="("+h+","+d+")"):this.preserveNodePositions&&t.x!=null&&t.y!=null&&(g.x=h,g.y=d),this._cellToElkNode[n.id]=g;var f=this.includeVertexLabels;if(!f&&this.includeCompoundLabels===!0&&this._hasLayoutableChildren(n)&&(f=!0),f&&s&&(f=!1),f){var E=this._getVertexLabels(n);E.length>0&&(g.labels=E,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.nodeSize.constraints"]="NODE_LABELS MINIMUM_SIZE",g.layoutOptions["elk.nodeSize.minimum"]="("+r+", "+i+")")}return g};_t.prototype._convertEdges=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(!(!this.model.isEdge(r)||!this.model.isVisible(r))&&!(this.cellFilter!=null&&!this.cellFilter(r))){var i=this._convertEdge(r);i!=null&&t.edges.push(i)}}};_t.prototype._convertEdge=function(n){var t=this.model.getTerminal(n,!0),e=this.model.getTerminal(n,!1);if(t==null||e==null)return null;var o=this._resolveEdgeTerminal(t,n,!0),r=this._resolveEdgeTerminal(e,n,!1);if(o==null||r==null)return null;var i="e"+n.id;this._cellToElk[n.id]=i,this._elkToCell[i]=n;var s={id:i,sources:[o],targets:[r]};this.respectConnectionConstraints&&this._applyConnectionConstraints(n,t,e,s);var a=s.sources[0]===this._cellToElk[t.id]?this._anchoredPoint(n,!0):null,l=s.targets[0]===this._cellToElk[e.id]?this._anchoredPoint(n,!1):null,c=a!=null?this._jettyStubFor(n,t,a,!0):null,g=l!=null?this._jettyStubFor(n,e,l,!1):null;if((c!=null||g!=null)&&this.model.getParent(t)===this.model.getParent(e)){var h=this.model.getGeometry(t),d=this.model.getGeometry(e);if(h!=null&&d!=null&&a!=null&&l!=null){var f=h.x+a.x*h.width+a.dx,E=h.y+a.y*h.height+a.dy,P=d.x+l.x*d.width+l.dx,S=d.y+l.y*d.height+l.dy,T=P-f,N=S-E,I=(c!=null?c.jetty:0)+(g!=null?g.jetty:0);T*T+N*N<I*I&&(c=null,g=null)}}if(a!=null){var C=this._ensureConstraintPort(t,a.x,a.y,a.dx,a.dy,c);C!=null&&(s.sources=[C.id],this._markAnchoredEnd(i,!0),c!=null&&this._markJettyEnd(i,!0))}if(l!=null){var x=this._ensureConstraintPort(e,l.x,l.y,l.dx,l.dy,g);x!=null&&(s.targets=[x.id],this._markAnchoredEnd(i,!1),g!=null&&this._markJettyEnd(i,!1))}if(s.sources[0]===this._cellToElk[t.id]){var M=this._portConstraintSides(n,t,!0);if(M!=null){var A=this._createMaskPort(t,this._pickConstraintSide(M,t,e,!0),this._maskJettyFor(n,!0));A!=null&&(s.sources=[A.id],this._markMaskedEnd(i,!0))}}if(s.targets[0]===this._cellToElk[e.id]){var B=this._portConstraintSides(n,e,!1);if(B!=null){var Y=this._createMaskPort(e,this._pickConstraintSide(B,e,t,!1),this._maskJettyFor(n,!1));Y!=null&&(s.targets=[Y.id],this._markMaskedEnd(i,!1))}}if(this.rootCellIds!=null&&e!=null&&t!=null){for(var j=String(e.id),X=String(t.id),tt=!1,ot=!1,Lt=0;Lt<this.rootCellIds.length;Lt++){var zt=String(this.rootCellIds[Lt]);j===zt&&(tt=!0),X===zt&&(ot=!0)}if(tt&&!ot){var be=s.sources;s.sources=s.targets,s.targets=be,this._reversedEdges.add(i)}}if(this.includeEdgeLabels){var mr=this._getEdgeLabels(n);mr.length>0&&(s.labels=mr)}return s};_t.prototype._resolveEdgeTerminal=function(n,t,e){if(this._portCells.has(n.id))return"p"+n.id;if(this._cellToElk[n.id]!=null)return this._cellToElk[n.id];for(var o=this.model.getParent(n);o!=null;){if(this._cellToElk[o.id]!=null){var r="e"+t.id,i=this._climbedEnds[r];return i==null&&(i={source:!1,target:!1},this._climbedEnds[r]=i),i[e?"source":"target"]=!0,this._cellToElk[o.id]}o=this.model.getParent(o)}return null};_t.prototype._collectInternalEdges=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isEdge(r)&&this.model.isVisible(r)){if(this.cellFilter!=null&&!this.cellFilter(r))continue;var i=this._convertEdge(r);i!=null&&t.edges.push(i)}}};_t.prototype._convertInternalEdges=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(!(!this.model.isVertex(o)||!this.model.isVisible(o))&&!this._isPort(o)&&!(this.cellFilter!=null&&!this.cellFilter(o))&&!o.collapsed){var r=this._cellToElkNode[o.id];r==null||r.edges==null||(this._collectInternalEdges(o,r),this._convertInternalEdges(o))}}};_t.prototype._isPort=function(n){if(!this.model.isVertex(n))return!1;var t=this.model.getGeometry(n);if(t==null||!t.relative)return!1;var e=this.graph.getCellStyle(n);return e[mxConstants.STYLE_SHAPE]==="port"||e.portConstraint!=null?!0:t.width<=this._portThresholdSize&&t.height<=this._portThresholdSize};_t.prototype._isShapePart=function(n){var t=this.model.getGeometry(n);return t!=null&&t.relative?!0:this.graph.getCellStyle(n).part=="1"};_t.prototype._hasNonPartChild=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isVertex(o)&&this.model.isVisible(o)&&!this._isShapePart(o))return!0}return!1};_t.prototype._hasLayoutableEdge=function(n){if(typeof this.model.getEdgeCount!="function")return!1;var t=this.model.getEdgeCount(n);if(typeof this.model.getEdgeAt!="function")return t>0;for(var e=0;e<t;e++){var o=this.model.getEdgeAt(n,e);if(!(o==null||!this.model.isVisible(o))&&!(this.cellFilter!=null&&!this.cellFilter(o)))return!0}return!1};_t.prototype._convertPorts=function(n,t){var e=this.model.getChildCount(n);if(e!==0){for(var o=[],r=0;r<e;r++){var i=this.model.getChildAt(n,r);if(this._isPort(i)&&this.graph.getCellStyle(i).part!="1"&&this._hasLayoutableEdge(i)){var s=this._convertPort(i,n,t);s!=null&&(o.push(s),this._portCells.add(i.id))}}o.length>0&&(t.ports=o,t.layoutOptions=t.layoutOptions||{},t.layoutOptions["elk.portConstraints"]="FIXED_POS")}};_t.prototype._convertPort=function(n,t,e){var o=this.model.getGeometry(n),r=this.model.getGeometry(t);if(o==null||r==null)return null;var i="p"+n.id;this._cellToElk["p"+n.id]=i,this._elkToCell[i]=n;var s=e!=null&&e.width!=null?e.width:r.width,a=e!=null&&e.height!=null?e.height:r.height,l=o.x*s,c=o.y*a;o.offset&&(l+=o.offset.x,c+=o.offset.y);var g=this._inferPortSide(s>0?(l+o.width/2)/s:o.x,a>0?(c+o.height/2)/a:o.y),h=this.graph.getCellStyle(n);if(h.portConstraint){var d={north:"NORTH",south:"SOUTH",east:"EAST",west:"WEST",NORTH:"NORTH",SOUTH:"SOUTH",EAST:"EAST",WEST:"WEST"}[h.portConstraint];d&&(g=d)}return{id:i,x:l,y:c,width:o.width,height:o.height,layoutOptions:{"elk.port.side":g}}};_t.prototype._inferPortSide=function(n,t){if(t<=.01)return"NORTH";if(t>=.99)return"SOUTH";if(n<=.01)return"WEST";if(n>=.99)return"EAST";var e=t,o=1-t,r=n,i=1-n,s=Math.min(e,o,r,i);return s===e?"NORTH":s===o?"SOUTH":s===r?"WEST":"EAST"};_t.prototype._applyConnectionConstraints=function(n,t,e,o){var r=this.graph.getCellStyle(n);if(r[mxConstants.STYLE_EXIT_X]!=null&&r[mxConstants.STYLE_EXIT_Y]!=null){var i=parseFloat(r[mxConstants.STYLE_EXIT_X]),s=parseFloat(r[mxConstants.STYLE_EXIT_Y]);if(!isNaN(i)&&!isNaN(s)){var a=this._ensureConstraintPort(t,i,s);a!=null&&(o.sources=[a.id])}}if(r[mxConstants.STYLE_ENTRY_X]!=null&&r[mxConstants.STYLE_ENTRY_Y]!=null){var l=parseFloat(r[mxConstants.STYLE_ENTRY_X]),c=parseFloat(r[mxConstants.STYLE_ENTRY_Y]);if(!isNaN(l)&&!isNaN(c)){var a=this._ensureConstraintPort(e,l,c);a!=null&&(o.targets=[a.id])}}};_t.prototype._ensureConstraintPort=function(n,t,e,o,r,i){var s=this._cellToElkNode[n.id];if(s==null)return null;var a=this.model.getGeometry(n);if(a==null)return null;o=o||0,r=r||0;var l=n.id+"_"+t.toFixed(3)+"_"+e.toFixed(3)+"_"+o+"_"+r+(i!=null?"_"+i.side+i.jetty:"");if(this._constraintPorts[l]!=null)return this._constraintPorts[l];var c="cp"+ ++this._constraintPortCounter,g={id:c,x:t*(s.width!=null?s.width:a.width)+o,y:e*(s.height!=null?s.height:a.height)+r,width:1,height:1,layoutOptions:{"elk.port.side":this._inferPortSide(t,e)}};i!=null&&(g.layoutOptions["elk.port.borderOffset"]=String(i.jetty)),s.ports||(s.ports=[]),s.ports.push(g),s.layoutOptions=s.layoutOptions||{};var h=s.layoutOptions["elk.portConstraints"];return(h==null||h==="FIXED_SIDE")&&(s.layoutOptions["elk.portConstraints"]="FIXED_POS"),this._constraintPorts[l]=g,g};_t.prototype._anchoredPoint=function(n,t){var e=this.graph.getCellStyle(n)||{};if(e[t?"exitDx":"entryDx"]==null)return null;var o=parseFloat(e[t?"exitX":"entryX"]),r=parseFloat(e[t?"exitY":"entryY"]);return isNaN(o)||isNaN(r)?null:{x:o,y:r,dx:parseFloat(e[t?"exitDx":"entryDx"])||0,dy:parseFloat(e[t?"exitDy":"entryDy"])||0}};_t.prototype._markAnchoredEnd=function(n,t){var e=this._anchoredEnds[n];e==null&&(e={source:!1,target:!1},this._anchoredEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._markJettyEnd=function(n,t){var e=this._jettyEnds[n];e==null&&(e={source:!1,target:!1},this._jettyEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._jettyStubFor=function(n,t,e,o){if(this._edgeRouting!=="ORTHOGONAL")return null;var r=this.model.getGeometry(t);if(r==null||!(r.width>0)||!(r.height>0))return null;var i=e.x+e.dx/r.width,s=e.y+e.dy/r.height,a=.01,l=i<=a,c=i>=1-a,g=s<=a,h=s>=1-a;if(l+c+g+h!==1)return null;var d=this._jettyFor(this.graph.getCellStyle(n),o);return d>0?{side:g?"N":h?"S":l?"W":"E",jetty:d}:null};_t.prototype._jettyFor=function(n,t){if(n==null)return 0;var e=n[t?"sourceJettySize":"targetJettySize"];if(e==null&&(e=n.jettySize),e==null&&(e=10),e==="auto"){var o=n[t?"startArrow":"endArrow"];if(o!=null&&o!=="none"){var r=parseFloat(n[t?"startSize":"endSize"]);isNaN(r)&&(r=6),e=Math.max(2,Math.ceil((r+10)/10))*10}else e=20}return e=parseFloat(e),isNaN(e)?0:e};_t.prototype._maskJettyFor=function(n,t){if(this._edgeRouting!=="ORTHOGONAL")return null;var e=this.graph.getCellStyle(n);if(e==null||e.jettySize==null&&e[t?"sourceJettySize":"targetJettySize"]==null)return null;var o=this._jettyFor(e,t);return o>0?o:null};_t.prototype._portConstraintSides=function(n,t,e){var o=this.graph.getCellStyle(t)||{},r=this.graph.getCellStyle(n)||{},i=o.portConstraint;if(i==null&&(i=r[e?"sourcePortConstraint":"targetPortConstraint"]),i==null)return null;var s=String(i),a=0;if(o.portConstraintRotation==1){var l=parseFloat(o.rotation)||0;l>45?a=l>=135?2:1:l<-45&&(a=l<=-135?2:3)}for(var c=["NORTH","EAST","SOUTH","WEST"],g=["north","east","south","west"],h=[],d={},f=0;f<g.length;f++)if(s.indexOf(g[f])>=0){var E=c[(f+a)%4];d[E]||(d[E]=!0,h.push(E))}return h.length===0||h.length===4?null:h};_t.prototype._pickConstraintSide=function(n,t,e,o){if(n.length===1)return n[0];var r=function(E){return n.indexOf(E)>=0?E:null},i={RIGHT:["EAST","WEST"],LEFT:["WEST","EAST"],DOWN:["SOUTH","NORTH"],UP:["NORTH","SOUTH"]}[this._layoutDirection];if(i!=null){var s=r(o?i[0]:i[1]);if(s!=null)return s}var a=this._terminalCenter(t),l=this._terminalCenter(e);if(a!=null&&l!=null)for(var c=l.x-a.x,g=l.y-a.y,h=Math.abs(c)>=Math.abs(g)?[c>=0?"EAST":"WEST",g>=0?"SOUTH":"NORTH"]:[g>=0?"SOUTH":"NORTH",c>=0?"EAST":"WEST"],d=0;d<h.length;d++){var f=r(h[d]);if(f!=null)return f}return n[0]};_t.prototype._terminalCenter=function(n){var t=this.model.getGeometry(n);return t!=null&&!t.relative?{x:t.x+t.width/2,y:t.y+t.height/2}:null};_t.prototype._createMaskPort=function(n,t,e){var o=this._cellToElkNode[n.id];if(o==null)return null;var r=this.model.getGeometry(n),i=o.width!=null?o.width:r!=null?r.width:0,s=o.height!=null?o.height:r!=null?r.height:0,a={NORTH:{x:i/2,y:0},SOUTH:{x:i/2,y:s},WEST:{x:0,y:s/2},EAST:{x:i,y:s/2}}[t],l={id:"mp"+ ++this._maskPortCounter,x:a.x,y:a.y,width:1,height:1,layoutOptions:{"elk.port.side":t}};return e!=null&&(l.layoutOptions["elk.port.borderOffset"]=String(e)),o.ports||(o.ports=[]),o.ports.push(l),o.layoutOptions=o.layoutOptions||{},o.layoutOptions["elk.portConstraints"]==null&&(o.layoutOptions["elk.portConstraints"]="FIXED_SIDE"),l};_t.prototype._markMaskedEnd=function(n,t){var e=this._maskedEnds[n];e==null&&(e={source:!1,target:!1},this._maskedEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._portFixedPosFreeEnds=function(n){var t={RIGHT:["EAST","WEST"],LEFT:["WEST","EAST"],DOWN:["SOUTH","NORTH"],UP:["NORTH","SOUTH"]}[this._layoutDirection]||["EAST","WEST"],e=[];(function j(X){e.push(X);for(var tt=X.children||[],ot=0;ot<tt.length;ot++)j(tt[ot])})(n);for(var o={},r={},i=0;i<e.length;i++){var s=e[i].layoutOptions;e[i]!==n&&s!=null&&s["elk.portConstraints"]==="FIXED_POS"&&(o[e[i].id]=e[i]);var a=e[i].ports;if(a!=null)for(var l=0;l<a.length;l++)r[a[l].id]=e[i].id}for(var c={},g=[],i=0;i<e.length;i++){var h=e[i].edges;if(h!=null)for(var d=0;d<h.length;d++)for(var f=0;f<2;f++){var E=f===0?"sources":"targets",P=o[h[d][E][0]];if(P!=null){var S=t[f],T=P.id+"|"+S,N=c[T];N==null&&(N={node:P,side:S,ends:[]},c[T]=N,g.push(N)),N.ends.push({edge:h[d],key:E,other:h[d][f===0?"targets":"sources"][0]})}}}for(var i=0;i<g.length;i++){var N=g[i],I=this._elkToCell[N.node.id],C=I!=null?this.model.getGeometry(I):null,x=N.node.width!=null?N.node.width:C!=null?C.width:0,M=N.node.height!=null?N.node.height:C!=null?C.height:0;if(N.ends.length>1){for(var d=0;d<N.ends.length;d++)N.ends[d].order=d,N.ends[d].cross=this._endCrossCoord(N.ends[d].other,N.side,r);N.ends.sort(function(tt,ot){return tt.cross!=null&&ot.cross!=null&&tt.cross!==ot.cross?tt.cross-ot.cross:tt.order-ot.order})}for(var d=0;d<N.ends.length;d++){var A=(d+1)/(N.ends.length+1),B={NORTH:{x:x*A,y:0},SOUTH:{x:x*A,y:M},WEST:{x:0,y:M*A},EAST:{x,y:M*A}}[N.side],Y={id:"fp"+ ++this._freeEndPortCounter,x:B.x,y:B.y,width:1,height:1,layoutOptions:{"elk.port.side":N.side}};N.node.ports||(N.node.ports=[]),N.node.ports.push(Y),N.ends[d].edge[N.ends[d].key]=[Y.id]}}};_t.prototype._endCrossCoord=function(n,t,e){var o=e[n]!=null?e[n]:n,r=this._elkToCell[o];if(r==null)return null;var i=this.model.getGeometry(r);if(i==null)return null;for(var s=i.x+i.width/2,a=i.y+i.height/2,l=this.model.getParent(r);l!=null&&this.model.isVertex(l);){var c=this.model.getGeometry(l);c!=null&&(s+=c.x,a+=c.y),l=this.model.getParent(l)}return t==="EAST"||t==="WEST"?a:s};_t.prototype._getCellLabel=function(n){var t=this.graph.getLabel(n);if(t!=null&&typeof t=="string"&&t.length>0){var e=t.replace(/<[^>]*>/g,"");return e.length>0?e:null}return null};_t.prototype._measureLabel=function(n,t){if(typeof mxUtils!="undefined"&&mxUtils.getSizeForString){var e=t[mxConstants.STYLE_FONTSIZE]?parseInt(t[mxConstants.STYLE_FONTSIZE]):null,o=t[mxConstants.STYLE_FONTFAMILY]||null,r=t[mxConstants.STYLE_FONTSTYLE]?parseInt(t[mxConstants.STYLE_FONTSTYLE]):null,i=mxUtils.getSizeForString(n,e,o,null,r);return{width:i.width+2,height:i.height+2}}return{width:n.length*7,height:14}};_t.prototype._getVertexLabels=function(n){var t=this._getCellLabel(n);if(t==null)return[];var e=this.graph.getCellStyle(n),o="INSIDE V_CENTER H_CENTER";e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]==="bottom"?o="OUTSIDE V_BOTTOM H_CENTER":e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]==="top"?o="OUTSIDE V_TOP H_CENTER":e[mxConstants.STYLE_LABEL_POSITION]==="left"?o="OUTSIDE V_CENTER H_LEFT":e[mxConstants.STYLE_LABEL_POSITION]==="right"?o="OUTSIDE V_CENTER H_RIGHT":e.verticalAlign==="top"?o="INSIDE V_TOP H_CENTER":e.verticalAlign==="bottom"&&(o="INSIDE V_BOTTOM H_CENTER");var r=this._measureLabel(t,e);return[{text:t,width:r.width,height:r.height,layoutOptions:{"elk.nodeLabels.placement":o}}]};_t.prototype._getEdgeLabels=function(n){var t=[],e=this.graph.getCellStyle(n),o=this._getCellLabel(n);if(o!=null){var r=this._measureLabel(o,e),i={"elk.edgeLabels.placement":"CENTER"};this._edgeLabelsInline&&(i["elk.edgeLabels.inline"]="true"),t.push({text:o,width:r.width+4,height:r.height+14,layoutOptions:i})}return t};_t.prototype._getGroupPadding=function(n){var t=this.graph.getCellStyle(n),e=wo(this.model,n),o=t[mxConstants.STYLE_SHAPE]==="swimlane"||t.swimlane!=null,r=t.container==="1",i=Bf(t.groupPadding);if(i==null&&!e&&(i=Bf(this.groupPadding)),i==null&&(i=e?{top:0,right:0,bottom:0,left:0}:{top:o||r?10:20,right:10,bottom:10,left:10}),o||r&&!e){var s=parseInt(t[mxConstants.STYLE_STARTSIZE],10);isNaN(s)&&(s=e?40:r?20:30),t.horizontal==0||t.horizontal==="0"?i.left+=s:i.top+=s}var a=parseInt(t.footerSize,10);return!isNaN(a)&&a>0&&(o&&(t.horizontal==0||t.horizontal==="0")?i.right+=a:i.bottom+=a),{top:i.top,left:i.left,bottom:i.bottom,right:i.right}};_t.prototype._hasLayoutableChildren=function(n){var t=this.graph.getCellStyle(n);if(t.childLayout!=null)return!1;for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isVertex(r)&&this.model.isVisible(r)&&!this._isShapePart(r))return this._subtreeHasEdge(n)}return!1};_t.prototype._subtreeHasEdge=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isEdge(o))return!0;if(!(this.model.isVertex(o)&&this._isShapePart(o))&&(this.model.isVertex(o)&&typeof this.model.getEdgeCount=="function"&&this.model.getEdgeCount(o)>0||this._subtreeHasEdge(o)))return!0}return!1};_t.prototype._inferEdgeRouting=function(n){var t={orthogonal:0,spline:0,other:0};return this._countEdgeStyles(n,t),t.spline>t.orthogonal&&t.spline>t.other?"SPLINES":t.orthogonal>t.other?"ORTHOGONAL":null};_t.prototype._countEdgeStyles=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isEdge(r)&&this.model.isVisible(r)){var i=this.graph.getCellStyle(r);i[mxConstants.STYLE_CURVED]==="1"?t.spline++:i[mxConstants.STYLE_EDGE]==="orthogonalEdgeStyle"||i[mxConstants.STYLE_EDGE]==="elbowEdgeStyle"||i[mxConstants.STYLE_EDGE]==="entityRelationEdgeStyle"?t.orthogonal++:t.other++}this.model.isVertex(r)&&this.model.getChildCount(r)>0&&this._countEdgeStyles(r,t)}};ht.DEFAULTS={layered:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":"30","elk.layered.spacing.nodeNodeBetweenLayers":"30","elk.edgeLabels.inline":"true","elk.spacing.edgeLabel":"5","elk.layered.cycleBreaking.strategy":"DEPTH_FIRST","elk.layered.considerModelOrder.strategy":"NODES","elk.layered.crossingMinimization.forceNodeModelOrder":"true"},mrtree:{"elk.algorithm":"mrtree","elk.direction":"DOWN","elk.spacing.nodeNode":"20","elk.spacing.edgeNode":"10","elk.mrtree.weighting":"MODEL_ORDER"},force:{"elk.algorithm":"force","elk.spacing.nodeNode":"10","elk.force.iterations":"300","elk.force.repulsivePower":"0"},stress:{"elk.algorithm":"stress","elk.spacing.nodeNode":"80","elk.stress.desiredEdgeLength":"100"},radial:{"elk.algorithm":"radial","elk.spacing.nodeNode":"20","elk.edgeRouting":"POLYLINE"},routing:{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.interactive":"true","elk.layered.cycleBreaking.strategy":"INTERACTIVE","elk.layered.layering.strategy":"INTERACTIVE","elk.layered.crossingMinimization.strategy":"INTERACTIVE","elk.layered.nodePlacement.strategy":"INTERACTIVE","elk.layered.crossingMinimization.greedySwitch.type":"OFF","elk.layered.crossingMinimization.greedySwitchHierarchical.type":"OFF","elk.spacing.nodeNode":"30","elk.layered.spacing.nodeNodeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"20","elk.edgeLabels.inline":"true","elk.spacing.edgeLabel":"5"}};ht.MENU_PRESETS={verticalFlow:{algorithm:"layered",options:{"elk.direction":"DOWN"}},horizontalFlow:{algorithm:"layered",options:{"elk.direction":"RIGHT"}},verticalTree:{algorithm:"mrtree",options:{"elk.direction":"DOWN"}},horizontalTree:{algorithm:"mrtree",options:{"elk.direction":"RIGHT"}},radialTree:{algorithm:"radial",options:null},organic:{algorithm:"force",options:null}};ht.CANONICAL_EDGE={edgeStyleMode:"orthogonalEdgeStyle",corners:"rounded"};function ht(n,t,e,o){this.graph=n,this.algorithm=t||"layered",this.layoutOptions=e||{},this.edgeStyleMode=o!=null&&o.edgeStyleMode||"auto",this.corners=o!=null&&o.corners||"keep",this.enforceCorners=o==null||o.enforceCorners!==!1,this.applierOptions=o!=null&&o.applierOptions||null,this.useViewStateSizing=o==null||o.useViewStateSizing!==!1,this.respectFixedPosition=o==null||o.respectFixedPosition!==!1,o!=null&&o.rootCellIds!=null&&o.rootCellIds.length>0?this.rootCellIds=o.rootCellIds.slice():o!=null&&o.rootCellId!=null?this.rootCellIds=[o.rootCellId]:this.rootCellIds=null,this.cellFilter=o!=null&&typeof o.cellFilter=="function"?o.cellFilter:null,this._effectiveCellFilter=this.cellFilter,this.includeEdgeLabels=!(o!=null&&o.includeEdgeLabels===!1),this.includeCompoundLabels=null,o!=null&&o.includeVertexLabels!=null?this.includeVertexLabels=o.includeVertexLabels!==!1:o!=null&&o.applierOptions!=null&&o.applierOptions.resizeParent===!1?(this.includeVertexLabels=!1,this.includeCompoundLabels=!0):this.includeVertexLabels=!0,this.portSpread=o!=null&&o.portSpread===!0,o!=null&&o.mermaidPolicy===!1?this.mermaidPolicy=!1:this.mermaidPolicy=this.algorithm==="layered",this.preserveOrigin=o!=null&&o.preserveOrigin===!0,this.resizeLayoutRoot=o!=null&&o.resizeLayoutRoot===!0,this.extractIsolated=o==null||o.extractIsolated!==!1,this.sharedStems=o==null||o.sharedStems!==!1,this.nonTreeEdges=o!=null&&o.nonTreeEdges==="elk"?"elk":"route",this.siblingOrder=o!=null&&o.siblingOrder==="model"?"model":"geometry",this.groupPadding=o!=null&&o.groupPadding!=null?o.groupPadding:null}ht.prototype.moveCell=function(){};ht.prototype.resizeCell=function(){};ht.prototype.canRouteNonTreeEdges=function(n,t){return!1};ht.prototype.routeNonTreeEdges=function(n,t){};ht.componentScopeFilter=function(n,t,e){var o={},r;for(r=0;r<e.length;r++)o[String(e[r])]=!0;var i={},s=[],a=function(E){for(var P=n.getChildCount(E),S=0;S<P;S++){var T=n.getChildAt(E,S);if(T.id!=null&&o[String(T.id)]===!0&&s.push(T),n.isEdge(T)){var N=n.getTerminal(T,!0),I=n.getTerminal(T,!1);N!=null&&N.id!=null&&(i[N.id]=i[N.id]||[]).push(T),I!=null&&I.id!=null&&I!==N&&(i[I.id]=i[I.id]||[]).push(T)}a(T)}};if(a(t),s.length===0)return null;var l={},c=[],g=function(E){for(;E!=null&&E!==t&&(n.isVertex(E)||n.isEdge(E));){if(E.id==null||l[E.id]===!0)return;l[E.id]=!0,c.push(E),E=n.getParent(E)}};for(r=0;r<s.length;r++)g(s[r]);for(;c.length>0;){var h=c.pop();n.isEdge(h)&&(g(n.getTerminal(h,!0)),g(n.getTerminal(h,!1)));var d=h.id!=null?i[h.id]:null;if(d!=null)for(r=0;r<d.length;r++)g(d[r]);var f=n.getChildCount(h);for(r=0;r<f;r++)g(n.getChildAt(h,r))}return function(E){for(;E!=null&&E!==t;){if(E.id!=null&&l[E.id]===!0)return!0;E=n.getParent(E)}return!1}};ht.prototype.execute=function(n,t){var e=this.graph.getModel();this.prepare(n,function(o,r){if(o!=null){t!=null?t(o):typeof console!="undefined"&&console.error&&console.error("ElkLayout.execute failed:",o);return}e.beginUpdate();try{r()}finally{e.endUpdate()}t!=null&&t(null)})};ht.prototype.prepare=function(n,t){var e=this,o=this._convertGraph(n);ht.getElk(function(r,i){if(i!=null){t(i);return}r.layout(o.elkGraph).then(function(s){t(null,function(){e._applyResult(n,o,s)})},function(s){t(s)})})};ht.prototype.executeSync=function(n){var t=ht.getElkSync();if(t==null)throw new Error("No synchronous ELK engine available \u2014 use prepare()/execute().");var e=this._convertGraph(n),o=t.layoutSync(e.elkGraph),r=this.graph.getModel();r.beginUpdate();try{this._applyResult(n,e,o)}finally{r.endUpdate()}};ht.prototype.canExecuteSync=function(){return ht.getElkSync()!=null};ht.prototype._convertGraph=function(n){var t=ht.DEFAULTS[this.algorithm]||{},e={};for(var o in t)e[o]=t[o];for(var o in this.layoutOptions)e[o]=this.layoutOptions[o];var r=new _t(this.graph);r.rootCellIds=this.rootCellIds,r.useViewStateSizing=this.useViewStateSizing,r.respectFixedPosition=this.respectFixedPosition;var i=this.cellFilter;i==null&&this.rootCellIds!=null&&this.rootCellIds.length>0&&(i=ht.componentScopeFilter(this.graph.getModel(),n,this.rootCellIds)),this._effectiveCellFilter=i,r.cellFilter=i,r.includeEdgeLabels=this.includeEdgeLabels,r.includeVertexLabels=this.includeVertexLabels,r.includeCompoundLabels=this.includeCompoundLabels,r.groupPadding=this.groupPadding;var s=r.convert(n,e);this.mermaidPolicy&&ht.applyMermaidElkPolicy(s);var a=[];this.algorithm==="layered"&&this.extractIsolated&&(a=ht.extractIsolatedTopLevel(s)||[]);var l=r.getElkToCellMap(),c=[];if(this.algorithm==="mrtree"&&this.nonTreeEdges!=="elk")for(var g=ht.extractNonTreeEdges(s,e["elk.mrtree.searchOrder"]),h=0;h<g.length;h++){var d=l[g[h].id];d!=null&&(c.push(d),delete l[g[h].id])}return this.algorithm==="mrtree"&&this.siblingOrder!=="model"&&this.layoutOptions["elk.mrtree.weighting"]==null&&ht.stampSiblingOrderConstraints(s,l,this.graph,e["elk.direction"],e["elk.mrtree.searchOrder"]),{mergedOptions:e,elkGraph:s,elkToCellMap:l,portCells:r.getPortCells(),reversedEdges:r.getReversedEdges(),climbedEnds:r.getClimbedEnds(),maskedEnds:r.getMaskedEnds(),anchoredEnds:r.getAnchoredEnds(),jettyEnds:r.getJettyEnds(),isolatedNodes:a,nonTreeEdges:c}};ht._walkTreeStructure=function(n,t){var e={},o=[],r=function(S,T){if(e[S.id]={node:S,parent:T,outDirect:[],outPort:[],treeChildren:[]},S.ports!=null)for(var N=0;N<S.ports.length;N++)e[S.ports[N].id]=e[S.id];if(S.children!=null&&S.children.length>0){o.push(S);for(var I=0;I<S.children.length;I++)r(S.children[I],S)}};r(n,null);var i=function(S){if(S.edges!=null)for(var T=0;T<S.edges.length;T++){var N=S.edges[T],I=N.sources!=null?e[N.sources[0]]:null,C=N.targets!=null?e[N.targets[0]]:null;if(!(I==null||C==null||I===C||I.parent==null||I.parent!==C.parent)){var x={edge:N,container:S,target:C};N.sources[0]===I.node.id?I.outDirect.push(x):I.outPort.push(x)}}if(S.children!=null)for(var M=0;M<S.children.length;M++)i(S.children[M])};i(n);for(var s=[],a=t==="BFS",l=0;l<o.length;l++)for(var c=o[l].children,g={},h=function(S){return S.outDirect.concat(S.outPort)},d=function(S){g[S.node.id]=1;for(var T=h(S),N=0;N<T.length;N++){var I=T[N].target;g[I.node.id]===1?s.push(T[N]):g[I.node.id]===2?(g[I.node.id]=1,S.treeChildren.push(I)):(S.treeChildren.push(I),d(I))}},f=function(S){for(var T=[S];T.length>0;){var N=T.shift();g[N.node.id]=1;for(var I=h(N),C=0;C<I.length;C++){var x=I[C].target;g[x.node.id]===1?s.push(I[C]):g[x.node.id]===2?(g[x.node.id]=1,N.treeChildren.push(x)):(N.treeChildren.push(x),T.push(x))}}},E=0;E<c.length;E++){var P=e[c[E].id];g[P.node.id]==null&&(a?f(P):d(P),g[P.node.id]=2)}return{levels:o,nodeMeta:e,eliminated:s}};ht.extractNonTreeEdges=function(n,t){for(var e=ht._walkTreeStructure(n,t),o=[],r=0;r<e.eliminated.length;r++){var i=e.eliminated[r],s=i.container.edges.indexOf(i.edge);s>=0&&(i.container.edges.splice(s,1),o.push(i.edge))}return o};ht.stampSiblingOrderConstraints=function(n,t,e,o,r){for(var i=e.getModel(),s=!(o==="RIGHT"||o==="LEFT"),a=ht._walkTreeStructure(n,r),l=function(I){var C=t[I.id],x=C!=null?i.getGeometry(C):null;if(x==null)return 0;var M=wo(i,C)?fi(e,C):null;return s?(x.x||0)+(M!=null?M.x:0)+(M!=null?M.width:x.width||0)/2:(x.y||0)+(M!=null?M.y:0)+(M!=null?M.height:x.height||0)/2},c=0;c<a.levels.length;c++){var g=a.levels[c];g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.mrtree.weighting"]="CONSTRAINT"}var h={};for(var d in a.nodeMeta){var f=a.nodeMeta[d];if(!(f.node.id!==d||f.treeChildren.length===0)){for(var E=[],P=0;P<f.treeChildren.length;P++){var S=f.treeChildren[P].node;h[S.id]||(h[S.id]=!0,E.push({node:S,idx:E.length,coord:l(S)}))}E.sort(function(I,C){return I.coord-C.coord||I.idx-C.idx});for(var T=0;T<E.length;T++){var N=E[T].node;N.layoutOptions=N.layoutOptions||{},N.layoutOptions["elk.mrtree.positionConstraint"]=String(T)}}}};ht.collapseTreeStems=function(n,t){var e={},o;if(n.children!=null)for(o=0;o<n.children.length;o++)e[n.children[o].id]=n.children[o];if(n.edges!=null)for(o=0;o<n.edges.length;o++){var r=n.edges[o],i=r.sources!=null?e[r.sources[0]]:null,s=r.sections!=null&&r.sections.length>0?r.sections[0]:null;if(!(i==null||s==null||s.startPoint==null||s.bendPoints==null||s.bendPoints.length===0)){var a=s.bendPoints[0];if(t&&s.startPoint.y===a.y){var l=i.y+i.height/2;s.startPoint.y=l,a.y=l}else if(!t&&s.startPoint.x===a.x){var c=i.x+i.width/2;s.startPoint.x=c,a.x=c}var g=r.targets!=null?e[r.targets[0]]:null;if(!(g==null||s.endPoint==null)){var h=s.bendPoints,d=h[h.length-1];if(t){var f=g.y+g.height/2;s.endPoint.y===f&&d.y!==f&&(h.length>=2?d.y=f:h.push({x:d.x,y:f}))}else{var E=g.x+g.width/2;s.endPoint.x===E&&d.x!==E&&(h.length>=2?d.x=E:h.push({x:E,y:d.y}))}}}}if(n.children!=null)for(o=0;o<n.children.length;o++)ht.collapseTreeStems(n.children[o],t)};ht.prototype._applyResult=function(n,t,e){var o=this.graph,r=o.getModel(),i=t.mergedOptions,s=t.elkToCellMap,a=n!=null&&r.isVertex(n)&&wo(r,n),l=this.preserveOrigin||a,c=l&&t.isolatedNodes.length>0,g=l?ul(r,n,this._effectiveCellFilter):null,h=0,d=0;if(l&&!c&&g!=null){var f=cp(o,e,s);f!=null&&(h=g.x-f.x,d=g.y-f.y)}var E=new Zi(o),P=i["elk.edgeRouting"],S=this.algorithm==="layered"||this.algorithm==="mrtree",T=this.edgeStyleMode;T==="auto"&&(T=S&&P!=="POLYLINE"&&P!=="SPLINES"?"orthogonal":"straight");var N=t.nonTreeEdges!=null&&t.nonTreeEdges.length>0?new Set(t.nonTreeEdges):null,I=N!=null&&this.canRouteNonTreeEdges(n,t.nonTreeEdges);if(T!=="keep"){var C=new Set;for(var x in s){var M=s[x];M!=null&&r.isEdge(M)&&C.add(M)}I&&N.forEach(function(zt){C.add(zt)}),this._applyEdgeStyle(n,T,this.corners,C,E,N)}else if(N!=null&&!I){var A=this;N.forEach(function(zt){A.graph.resetEdge(zt)})}this.algorithm==="mrtree"&&this.sharedStems&&!this.portSpread&&ht.collapseTreeStems(e,i["elk.direction"]==="RIGHT"||i["elk.direction"]==="LEFT");var B={resizeParent:!0,applyEdgeRouting:this.edgeStyleMode!=="keep",resetEdgePoints:!0,orthogonalRouting:T!=="straight"&&P!=="POLYLINE"&&P!=="SPLINES",edgeStyleMode:T,portSpread:this.portSpread};if(this.applierOptions!=null)for(var Y in this.applierOptions)B[Y]=this.applierOptions[Y];B.reversedEdges=t.reversedEdges,B.climbedEnds=t.climbedEnds,B.maskedEnds=t.maskedEnds,B.anchoredEnds=t.anchoredEnds,B.jettyEnds=t.jettyEnds,B.styleBatch=E;var j=new Rt(o,s,t.portCells,B);if(j.apply(e,h,d),t.isolatedNodes.length>0&&ht.placeIsolatedTopLevelAbove(o,r,s,t.isolatedNodes,t.elkGraph.children,n,this._effectiveCellFilter),this.resizeLayoutRoot&&!a&&e.width!=null&&e.height!=null&&n!=null&&r.isVertex(n)){var X=r.getGeometry(n),tt=Math.round(e.width),ot=Math.round(e.height);X!=null&&(X.width!==tt||X.height!==ot)&&(X=X.clone(),X.width=tt,X.height=ot,r.setGeometry(n,X))}if(I&&this.routeNonTreeEdges(n,t.nonTreeEdges),c&&g!=null){var Lt=ul(r,n,this._effectiveCellFilter);Lt!=null&&pa(r,n,g.x-Lt.x,g.y-Lt.y,this._effectiveCellFilter)}};ht.prototype._applyEdgeStyle=function(n,t,e,o,r,i){var s=this.graph.getModel();this._applyEdgeStyleRecursive(n,s,t,e,o,r,i)};ht.prototype._applyEdgeStyleRecursive=function(n,t,e,o,r,i,s){for(var a=t.getChildCount(n),l=0;l<a;l++){var c=t.getChildAt(n,l);if(t.isEdge(c)&&t.isVisible(c)&&(this._effectiveCellFilter==null||this._effectiveCellFilter(c))){(r==null||!r.has(c))&&this.graph.resetEdge(c);var g=s!=null&&s.has(c)?"orthogonalEdgeStyle":e;g==="orthogonalEdgeStyle"?(i.set(c,mxConstants.STYLE_NOEDGESTYLE,null),i.set(c,mxConstants.STYLE_ORTHOGONAL,null),i.set(c,mxConstants.STYLE_EDGE,mxConstants.EDGESTYLE_ORTHOGONAL)):g==="elkCompat"?(i.set(c,mxConstants.STYLE_NOEDGESTYLE,"1"),i.set(c,mxConstants.STYLE_ORTHOGONAL,null),i.set(c,mxConstants.STYLE_EDGE,null)):(i.set(c,mxConstants.STYLE_NOEDGESTYLE,"1"),i.set(c,mxConstants.STYLE_ORTHOGONAL,g==="orthogonal"?"1":null),i.set(c,mxConstants.STYLE_EDGE,null)),o!=="keep"&&(this.enforceCorners||!gp(i.get(c),mxConstants.STYLE_CURVED))&&(i.set(c,mxConstants.STYLE_ROUNDED,o==="rounded"?"1":"0"),i.set(c,mxConstants.STYLE_CURVED,o==="curved"?"1":"0"));var h=i.get(c);gp(h,"exitDx")||(i.set(c,mxConstants.STYLE_EXIT_X,null),i.set(c,mxConstants.STYLE_EXIT_Y,null)),gp(h,"entryDx")||(i.set(c,mxConstants.STYLE_ENTRY_X,null),i.set(c,mxConstants.STYLE_ENTRY_Y,null))}t.isVertex(c)&&t.getChildCount(c)>0&&!c.collapsed&&this.graph.getCellStyle(c).childLayout==null&&this._applyEdgeStyleRecursive(c,t,e,o,r,i,s)}};function gp(n,t){return n!=null&&(n.substring(0,t.length+1)===t+"="||n.indexOf(";"+t+"=")>=0)}ht.applyCorners=function(n,t,e){if(!(e==null||e==="keep")){var o=n.getModel(),r=new Zi(n),i=function(s){for(var a=o.getChildCount(s),l=0;l<a;l++){var c=o.getChildAt(s,l);o.isEdge(c)&&o.isVisible(c)&&(r.set(c,mxConstants.STYLE_ROUNDED,e==="rounded"?"1":"0"),r.set(c,mxConstants.STYLE_CURVED,e==="curved"?"1":"0")),o.isVertex(c)&&o.getChildCount(c)>0&&!c.collapsed&&n.getCellStyle(c).childLayout==null&&i(c)}};i(t),r.flush()}};ht._elk=null;ht.getElkSync=function(){if(ht._elk!=null)return typeof ht._elk.layoutSync=="function"?ht._elk:null;if(typeof globalThis.ELK=="undefined"||globalThis.ELK==null||globalThis.ELK.prototype==null||typeof globalThis.ELK.prototype.layoutSync!="function")return null;try{return ht._elk=new globalThis.ELK,ht._elk}catch(n){return null}};ht.getElk=function(n){if(ht._elk!=null){n(ht._elk,null);return}if(typeof globalThis.ELK=="undefined"||globalThis.ELK==null){n(null,new Error("ELK engine not loaded \u2014 drawio-mermaid bundle must be included first."));return}try{ht._elk=new globalThis.ELK,n(ht._elk,null)}catch(t){n(null,t)}};ht.applyMermaidElkPolicy=function(n){var t={},e={},o={};function r(g,h){if(t[g.id]=g,e[g.id]=h,g.ports)for(var d=0;d<g.ports.length;d++)o[g.ports[d].id]=g;if(g.children)for(var f=0;f<g.children.length;f++)r(g.children[f],g)}r(n,null);function i(g){return t[g]!=null?t[g]:o[g]!=null?o[g]:null}n.layoutOptions=n.layoutOptions||{},n.layoutOptions["spacing.baseValue"]==null&&(n.layoutOptions["spacing.baseValue"]=35),n.layoutOptions["elk.layered.unnecessaryBendpoints"]==null&&(n.layoutOptions["elk.layered.unnecessaryBendpoints"]="true"),delete n.layoutOptions["elk.layered.crossingMinimization.forceNodeModelOrder"],delete n.layoutOptions["elk.layered.considerModelOrder.strategy"];function s(g){if(g!==n&&g.children!=null&&g.children.length>0&&(g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.hierarchyHandling"]==null&&(g.layoutOptions["elk.hierarchyHandling"]="SEPARATE_CHILDREN"),g.layoutOptions["spacing.baseValue"]==null&&(g.layoutOptions["spacing.baseValue"]=30),g.layoutOptions["nodeLabels.placement"]==null&&(g.layoutOptions["nodeLabels.placement"]="[H_CENTER V_TOP, INSIDE]"),delete g.width,delete g.height,delete g.layoutOptions["elk.nodeSize.constraints"],delete g.layoutOptions["elk.nodeSize.minimum"]),g.children)for(var h=0;h<g.children.length;h++)s(g.children[h])}s(n);function a(g,h){for(var d={},f=g;f!=null;)d[f.id]=f,f=e[f.id];for(f=h;f!=null;){if(d[f.id]!=null)return f;f=e[f.id]}return null}function l(g,h){for(var d=g;d!=null&&(d.children!=null&&d.children.length>0&&(d.layoutOptions=d.layoutOptions||{},d.layoutOptions["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),d!==h);)d=e[d.id]}function c(g){if(g.edges)for(var h=0;h<g.edges.length;h++){var d=g.edges[h],f=d.sources!=null?d.sources[0]:null,E=d.targets!=null?d.targets[0]:null,P=f!=null?i(f):null,S=E!=null?i(E):null;if(!(P==null||S==null)&&e[P.id]!==e[S.id]){var T=a(P,S);T!=null&&(l(P,T),l(S,T))}}if(g.children)for(var h=0;h<g.children.length;h++)c(g.children[h])}c(n)};ht.extractIsolatedTopLevel=function(n){if(n==null||n.children==null||n.children.length<2)return[];var t={};if(n.edges!=null)for(var e=0;e<n.edges.length;e++){var o=n.edges[e];if(o.sources!=null)for(var r=0;r<o.sources.length;r++)t[o.sources[r]]=!0;if(o.targets!=null)for(var i=0;i<o.targets.length;i++)t[o.targets[i]]=!0}for(var s=[],a=[],e=0;e<n.children.length;e++){var l=n.children[e],c=l.children!=null&&l.children.length>0,g=!1;if(l.ports!=null){for(var h=0;h<l.ports.length;h++)if(t[l.ports[h].id]){g=!0;break}}c||t[l.id]||g?s.push(l):a.push(l)}return a.length===0||s.length===0?[]:(n.children=s,a)};ht.placeIsolatedTopLevelAbove=function(n,t,e,o,r,i,s){if(!(o==null||o.length===0)&&!(e==null||r==null)){for(var a=1/0,l=1/0,c=-1/0,g=0;g<r.length;g++){var h=e[r[g].id];if(h!=null){var d=t.getGeometry(h);d!=null&&(d.x<a&&(a=d.x),d.y<l&&(l=d.y),d.x+d.width>c&&(c=d.x+d.width))}}if(a!==1/0){for(var f=c-a,E=30,P=10,S=0,g=0;g<o.length;g++)S+=o[g].height||30,g>0&&(S+=P);var T=S+E,N=Math.max(0,T-l);if(N>0){for(var I={},g=0;g<o.length;g++){var C=o[g],x=e[C.id];x!=null&&(I[x.id]=!0)}for(var M=i!=null?i:n.getDefaultParent(),A=t.getChildCount(M),g=0;g<A;g++){var B=t.getChildAt(M,g);if(!(B==null||I[B.id])&&!(s!=null&&!s(B))){var Y=t.getGeometry(B);if(Y!=null){if(t.isVertex(B))if(wo(t,B))pa(t,B,0,N);else{var j=Y.clone();j.y=Y.y+N,t.setGeometry(B,j)}else if(t.isEdge(B)&&Y.points!=null&&Y.points.length>0){var j=Y.clone();j.points=[];for(var X=0;X<Y.points.length;X++){var tt=Y.points[X];j.points.push(new mxPoint(tt.x,tt.y+N))}t.setGeometry(B,j)}}}}}for(var ot=l+N-S-E,g=0;g<o.length;g++){var C=o[g],x=e[C.id];if(x!=null){var Lt=t.getGeometry(x);if(Lt!=null){if(wo(t,x)){var zt=fi(n,x);if(zt!=null){var be=Math.min(zt.width,f);pa(t,x,a+(f-be)/2-(Lt.x+zt.x),ot-(Lt.y+zt.y)),ot+=zt.height+P}continue}var mr=C.width||Lt.width||100,Ea=C.height||Lt.height||30;mr>f&&(mr=f);var Pr=Lt.clone();Pr.x=a+(f-mr)/2,Pr.y=ot,Pr.width=mr,Pr.height=Ea,t.setGeometry(x,Pr),ot+=Ea+P}}}}}};ht.Adapter=_t;ht.Applier=Rt;hs.setCoreOptions(wt);var NO=!1;function Uf(){NO||(SO(),pE(),OE(),IE(),vE(),$E(),cm(),eE(),NO=!0)}function yO(n,t){gs(n,t,!1);for(let e of n.getLabels())gs(e,t,!1);for(let e of n.getPorts()){gs(e,t,!1);for(let o of e.getLabels())gs(o,t,!1)}for(let e of n.getContainedEdges()){gs(e,t,!1);for(let o of e.getLabels())gs(o,t,!1)}for(let e of n.getChildren())yO(e,t)}var _l=class{constructor(t={}){this.defaultLayoutOptions=t.defaultLayoutOptions||{},Uf()}layoutSync(t,e={}){let o=e.layoutOptions!==void 0?e.layoutOptions:this.defaultLayoutOptions,r={value:null},i=Bl.forGraph(t).rememberImporter(r).toElk();o!=null&&typeof o=="object"&&Object.keys(o).length>0&&yO(i,o);let s=e.progressMonitor||new zl;return new Wl().layout(i,s),r.value.transferLayout(i),t}layout(t,e={}){return new Promise((o,r)=>{try{o(this.layoutSync(t,e))}catch(i){r(i)}})}knownLayoutOptions(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getOptionDataAll().map(e=>({id:e.getId(),name:e.getName()||"",description:e.getDescription()||"",group:e.getGroup()||"",type:e.getType()||"",targets:e.getTargets()?Array.from(e.getTargets()):[]})))}knownLayoutAlgorithms(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getAlgorithmDataAll().map(e=>({id:e.getId(),name:e.getName()||"",description:e.getDescription()||"",knownOptions:Array.from(e.getKnownOptionIds())})))}knownLayoutCategories(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getCategoryDataAll().map(e=>({id:e.getId(),name:e.getName()||"",knownLayouters:e.getLayouters().map(o=>o.getId())})))}terminateWorker(){}};var xR=_l;return MO(DR);})();
+`)}save(t){}isave(t){this._index++}};function ug(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var _g=class n{static compact(t,e,o=null){let r={root:t,orthogonal:e};n._compactTree(t,r)}static _compactTree(t,e){for(let o of t.children)n._compactTree(o,e);for(let o of t.children){let r=t.node.vertex.clone().sub(o.node.vertex);if(e.orthogonal){let s=t.node.rect,a=o.node.rect;Math.abs(r.x)>=Math.abs(r.y)?(r.y=0,a.y+a.height>s.y&&a.y<s.y+s.height&&r.scaleToLength(Math.max(s.x-(a.x+a.width),a.x-(s.x+s.width)))):(r.x=0,a.x+a.width>s.x&&a.x<s.x+s.width&&r.scaleToLength(Math.max(s.y-(a.y+a.height),a.y-(s.y+s.height))))}else r.scaleToLength(t.node.underlap(o.node));let i=r.length();i=n._getMinUnderlap(e.root,o,i,r),r.scaleToLength(i),n._translateSubtree(o,r)}}static _getMinUnderlap(t,e,o,r){let i=Math.min(o,n._minUnderlapWithSubtree(t.node,e,o,r));for(let s of t.children)s!==e&&(i=Math.min(i,n._getMinUnderlap(s,e,i,r)));return i}static _minUnderlapWithSubtree(t,e,o,r){let i=o,s=oe.FUZZINESS;for(let a of e.children){let l=a.node;if(t.touches(l)){if(ug(l.rect.x,t.rect.x+t.rect.width,s)===0&&r.x<0||ug(l.rect.x+l.rect.width,t.rect.x,s)===0&&r.x>0||ug(l.rect.y,t.rect.y+t.rect.height,s)===0&&r.y<0||ug(l.rect.y+l.rect.height,t.rect.y,s)===0&&r.y>0){i=0;break}}else i=Math.min(i,t.distance(l,r));i=Math.min(i,n._minUnderlapWithSubtree(t,a,i,r))}return i}static _translateSubtree(t,e){t.node.translate(e);for(let o of t.children)n._translateSubtree(o,e)}};var pg=class{process(t,e){e.begin("Shrinking tree compaction",1);let o=t.getProperty(oe.DEBUG_SVG)?"spore/60compaction":null;_g.compact(t.tree,t.orthogonalCompaction,o),e.done()}getLayoutProcessorConfiguration(){return K.create()}};var _n=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.DEPTH_FIRST:return new pg;default:throw new Error(`No implementation for CompactionStrategy.${this}`)}}};_n.DEPTH_FIRST=new _n("DEPTH_FIRST");var Ho=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Ho.FIXED=new Ho("FIXED");Ho.CENTER_NODE=new Ho("CENTER_NODE");var Te=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Te.CENTER_DISTANCE=new Te("CENTER_DISTANCE");Te.CIRCLE_UNDERLAP=new Te("CIRCLE_UNDERLAP");Te.RECTANGLE_UNDERLAP=new Te("RECTANGLE_UNDERLAP");Te.INVERTED_OVERLAP=new Te("INVERTED_OVERLAP");Te.MINIMUM_ROOT_DISTANCE=new Te("MINIMUM_ROOT_DISTANCE");var cT=oe.FUZZINESS;function gT(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var Va=class n{constructor(t,e,o){this.a=t,this.b=e,this.c=o,this.tEdges=[new Ue(t,e),new Ue(e,o),new Ue(o,t)],this.vertices=[t,e,o],this._circumcenter=this._calculateCircumcenter()}getCircumcenter(){return this._circumcenter}_calculateCircumcenter(){let t=this.b.clone().sub(this.a),e=this.c.clone().sub(this.a),o=this.c.clone().sub(this.b),r=t.x*(this.a.x+this.b.x)+t.y*(this.a.y+this.b.y),i=e.x*(this.a.x+this.c.x)+e.y*(this.a.y+this.c.y),s=2*(t.x*o.y-t.y*o.x),a=(e.y*r-t.y*i)/s,l=(t.x*i-e.x*r)/s;return new O(a,l)}inCircumcircle(t){return gT(this._circumcenter.distance(t),this._circumcenter.distance(this.a),cT)<0}equals(t){return t instanceof n?this.containsVertex(t.a)&&this.containsVertex(t.b)&&this.containsVertex(t.c):!1}containsEdge(t){return ju(t,this.tEdges[0])||ju(t,this.tEdges[1])||ju(t,this.tEdges[2])}containsVertex(t){return Zu(t,this.vertices[0])||Zu(t,this.vertices[1])||Zu(t,this.vertices[2])}};function Zu(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):n.x===t.x&&n.y===t.y}function ju(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):!1}var Eg=class{static triangulate(t,e=null){let o=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let S of t)o.x=Math.min(o.x,S.x),o.y=Math.min(o.y,S.y),r.x=Math.max(r.x,S.x),r.y=Math.max(r.y,S.y);let i=new O(r.x-o.x,r.y-o.y),s=50,a=new O(o.x-s,o.y-i.x-s),l=new O(o.x-s,r.y+i.x+s),c=new O(r.x+i.y/2+s,o.y+i.y/2),g=new Va(a,l,c),h=[g],d=[],f=[];for(let S of t){d.length=0;for(let T of h)T.inCircumcircle(S)&&d.push(T);f.length=0;for(let T of d)for(let N of T.tEdges){let I=!0;for(let C of d)C!==T&&C.containsEdge(N)&&(I=!1);I&&f.push(N)}for(let T of d){let N=h.indexOf(T);N>=0&&h.splice(N,1)}for(let T of f)h.push(new Va(S,T.u,T.v))}let E=[];for(let S of h)for(let T of S.tEdges){let N=!1;for(let I of E)if(I.equals(T)){N=!0;break}N||E.push(T)}let P=new Set;for(let S of E)!g.containsVertex(S.u)&&!g.containsVertex(S.v)&&P.add(S);return P}};var mg=class{process(t,e){e.begin("Delaunay triangulation",1);let o=[];for(let s of t.vertices)o.push(s.originalVertex);let r=t.getProperty(oe.DEBUG_SVG)?"spore/10bw":null,i=Eg.triangulate(o,r);if(t.tEdges==null)t.tEdges=i;else for(let s of i)t.tEdges.add(s);e.done()}getLayoutProcessorConfiguration(){return K.create()}};var wr=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.DELAUNAY_TRIANGULATION:return new mg;default:throw new Error(`No implementation for StructureExtractionStrategy.${this}`)}}};wr.DELAUNAY_TRIANGULATION=new wr("DELAUNAY_TRIANGULATION");var bi=class{constructor(t){this.node=t,this.children=[]}};var pn=class{static createSpanningTree(t,e,o,r=null){let i=typeof o=="function"?o:h=>o.cost(h),s=new Map;for(let h of t)s.set(h,i(h));let a=[...t];a.sort((h,d)=>s.get(h)-s.get(d));let l=new Set(a),c=new bi(e),g=new Map;for(g.set(e,c);l.size>0;){let h=null,d=null,f=null;for(let P of l){if(g.has(P.u)&&!g.has(P.v)){d=P.v,f=P.u,h=P;break}if(g.has(P.v)&&!g.has(P.u)){d=P.u,f=P.v,h=P;break}}if(h==null)break;let E=new bi(d);g.get(f).children.push(E),g.set(d,E),l.delete(h)}return c}};var En=class{constructor(){this._nodeMap=new Map}process(t,e){e.begin("Minimum spanning tree construction",1);let o=t.preferredRoot!=null?t.preferredRoot.originalVertex:t.vertices[0].originalVertex,r=t.getProperty(oe.DEBUG_SVG)?"spore/20minst":null,i=pn.createSpanningTree(t.tEdges,o,t.costFunction,r);this._convert(i,t),e.done()}_convert(t,e){this._nodeMap.clear();for(let r of e.vertices)this._nodeMap.set(r.originalVertex,r);let o=new bi(this._nodeMap.get(t.node));this._addNode(o,t),e.tree=o}_addNode(t,e){for(let o of e.children){let r=new bi(this._nodeMap.get(o.node));t.children.push(r),this._addNode(r,o)}}getLayoutProcessorConfiguration(){return K.create()}};var Pg=class extends En{process(t,e){e.begin("Maximum spanning tree construction",1);let o=a=>-t.costFunction(a),r=t.preferredRoot!=null?t.preferredRoot.originalVertex:t.vertices[0].originalVertex,i=t.getProperty(oe.DEBUG_SVG)?"spore/20minst":null,s=pn.createSpanningTree(t.tEdges,r,o,i);this._convert(s,t),e.done()}};var Mr=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.MINIMUM_SPANNING_TREE:return new En;case n.MAXIMUM_SPANNING_TREE:return new Pg;default:throw new Error(`No implementation for TreeConstructionStrategy.${this}`)}}};Mr.MINIMUM_SPANNING_TREE=new Mr("MINIMUM_SPANNING_TREE");Mr.MAXIMUM_SPANNING_TREE=new Mr("MAXIMUM_SPANNING_TREE");var mn=new m("org.eclipse.elk.underlyingLayoutAlgorithm"),Gk=new m("org.eclipse.elk.structure.structureExtractionStrategy",()=>wr.DELAUNAY_TRIANGULATION),Og=new m("org.eclipse.elk.processingOrder.treeConstruction",()=>Mr.MINIMUM_SPANNING_TREE),Sg=new m("org.eclipse.elk.processingOrder.spanningTreeCostFunction",()=>Te.CIRCLE_UNDERLAP),JE=new m("org.eclipse.elk.processingOrder.preferredRoot"),Tg=new m("org.eclipse.elk.processingOrder.rootSelection",()=>Ho.CENTER_NODE),QE=new m("org.eclipse.elk.compaction.compactionStrategy",()=>_n.DEPTH_FIRST),tm=new m("org.eclipse.elk.compaction.orthogonal",!1),em=new m("org.eclipse.elk.overlapRemoval.maxIterations",64),om=new m("org.eclipse.elk.overlapRemoval.runScanline",!0);var Pn=class{static overlap(t,e){let o=Math.min(Math.abs(t.x-(e.x+e.width)),Math.abs(t.x+t.width-e.x)),r=Math.min(Math.abs(t.y-(e.y+e.height)),Math.abs(t.y+t.height-e.y)),i=Math.abs(t.x+t.width/2-(e.x+e.width/2));if(i>t.width/2+e.width/2)return 1;let s=Math.abs(t.y+t.height/2-(e.y+e.height/2));return s>t.height/2+e.height/2?1:i===0&&s===0?0:i===0?r/s+1:s===0?o/i+1:Math.min(o/i,r/s)+1}static getRectEdges(t){let e=[];return e.push(new Ue(t.getTopLeft(),t.getTopRight())),e.push(new Ue(t.getTopLeft(),t.getBottomLeft())),e.push(new Ue(t.getBottomRight(),t.getTopRight())),e.push(new Ue(t.getBottomRight(),t.getBottomLeft())),e}};var Ng=class{constructor(){this._root=null,this._overlapsExisted=!1}process(t,e){e.begin("Grow Tree",1),this._root=t.tree,this._overlapsExisted=!1,this._growAt(t.tree),t.setProperty(oe.OVERLAPS_EXISTED,this._overlapsExisted),e.done()}_growAt(t){for(let e of t.children){e.node.translate(t.node.vertex.clone().sub(t.node.originalVertex));let o=Pn.overlap(t.node.rect,e.node.rect);o>1&&(this._overlapsExisted=!0),e.node.setCenterPosition(t.node.vertex.clone().add(e.node.originalVertex.clone().sub(t.node.originalVertex).scale(o))),this._growAt(e)}}getLayoutProcessorConfiguration(){return K.create()}};var On=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.GROW_TREE:return new Ng;default:throw new Error(`No implementation for OverlapRemovalStrategy.${this}`)}}};On.GROW_TREE=new On("GROW_TREE");var Ne=class{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}};Ne.P1_STRUCTURE=new Ne("P1_STRUCTURE",0);Ne.P2_PROCESSING_ORDER=new Ne("P2_PROCESSING_ORDER",1);Ne.P3_EXECUTION=new Ne("P3_EXECUTION",2);Ne.VALUES=[Ne.P1_STRUCTURE,Ne.P2_PROCESSING_ORDER,Ne.P3_EXECUTION];var rm=new m("org.eclipse.elk.padding",new yt(8)),im=new m("org.eclipse.elk.spacing.nodeNode",8,0);function yg(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}function sm(n){return[new Ue(n.getTopLeft(),n.getTopRight()),new Ue(n.getTopLeft(),n.getBottomLeft()),new Ue(n.getBottomRight(),n.getTopRight()),new Ue(n.getBottomRight(),n.getBottomLeft())]}var Ig=class{constructor(t,e){this.originalVertex=t,this.vertex=this.originalVertex.clone(),this.rect=new dt(e)}translate(t){this.vertex.add(t),this.rect.x+=t.x,this.rect.y+=t.y}setCenterPosition(t){this.translate(t.clone().sub(this.vertex))}underlap(t){let e=Math.abs(this.rect.getCenter().x-t.rect.getCenter().x),o=Math.abs(this.rect.getCenter().y-t.rect.getCenter().y),r=0,i=0,s=1,a=1;return e>this.rect.width/2+t.rect.width/2&&(r=Math.min(Math.abs(this.rect.x-(t.rect.x+t.rect.width)),Math.abs(this.rect.x+this.rect.width-t.rect.x)),s=1-r/e),o>this.rect.height/2+t.rect.height/2&&(i=Math.min(Math.abs(this.rect.y-(t.rect.y+t.rect.height)),Math.abs(this.rect.y+this.rect.height-t.rect.y)),a=1-i/o),(1-Math.min(s,a))*Math.sqrt(e*e+o*o)}distance(t,e){let o=Number.POSITIVE_INFINITY;for(let r of sm(this.rect))for(let i of sm(t.rect)){let s=Ft.distance(r.u,r.v,i.u,i.v,e);o=Math.min(o,s)}return o}touches(t){let e=oe.FUZZINESS;return yg(this.rect.x,t.rect.x+t.rect.width,e)<=0&&yg(t.rect.x,this.rect.x+this.rect.width,e)<=0&&yg(this.rect.y,t.rect.y+t.rect.height,e)<=0&&yg(t.rect.y,this.rect.y+this.rect.height,e)<=0}};var Rg=class extends ge{constructor(t,e,o){super(),this.vertices=[],this.tEdges=null,this.treeConstructionStrategy=e,this.tree=null,this.compactionStrategy=o,this.costFunction=t,this.preferredRoot=null,this.orthogonalCompaction=!1}};var Sn=class{constructor(){this._graph=null,this._nodeMap=new Map,this._elkGraph=null,this._spacingNodeNode=0,this._centerDistance=t=>t.u.distance(t.v),this._minimumRootDistance=t=>Math.min(t.u.distance(this._graph.preferredRoot.vertex),t.v.distance(this._graph.preferredRoot.vertex)),this._circleUnderlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst();return t.u.distance(t.v)-t.u.distance(e.rect.getPosition())-t.v.distance(o.rect.getPosition())},this._rectangleUnderlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst();return e.underlap(o)},this._invertedOverlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst(),r=e.rect,i=o.rect,s=Ft.shortestDistance(r,i);if(s>=0)return s;let a=i.getCenter().sub(r.getCenter()).length();return-(Pn.overlap(r,i)-1)*a}}importGraph(t){this._elkGraph=t,this._nodeMap=new Map,this._seenCoords=new Set;let e=yo.adapt(this._elkGraph);No.calculateNodeMargins(e);let o=this._elkGraph.getProperty(JE),r=this._elkGraph.getProperty(Sg),i=this._elkGraph.getProperty(Og),s=this._elkGraph.getProperty(QE),a=this._elkGraph.getProperty(Tg);this._spacingNodeNode=this._elkGraph.getProperty(im);let l;switch(r){case Te.CENTER_DISTANCE:l=this._centerDistance;break;case Te.CIRCLE_UNDERLAP:l=this._circleUnderlap;break;case Te.RECTANGLE_UNDERLAP:l=this._rectangleUnderlap;break;case Te.INVERTED_OVERLAP:l=this._invertedOverlap;break;case Te.MINIMUM_ROOT_DISTANCE:l=this._minimumRootDistance;break;default:throw new Error("No implementation available for "+r)}if(this._graph=new Rg(l,i,s),this._graph.setProperty(oe.DEBUG_SVG,this._elkGraph.getProperty(Ks)),this._graph.orthogonalCompaction=this._elkGraph.getProperty(tm),this._elkGraph.children.length===0)return this._graph;for(let c of this._elkGraph.children){let g=c.width/2,h=c.height/2,d=new O(c.x+g,c.y+h),f=d.x+","+d.y;for(;this._seenCoords.has(f);)d.add((Math.random()-.5)*.001,(Math.random()-.5)*.001),f=d.x+","+d.y;this._seenCoords.add(f);let E=c.getProperty(Nr),P=new Ig(d,new dt(d.x-g-this._spacingNodeNode/2-E.left,d.y-h-this._spacingNodeNode/2-E.top,c.width+this._spacingNodeNode+E.getHorizontal(),c.height+this._spacingNodeNode+E.getVertical()));this._graph.vertices.push(P),this._nodeMap.set(d,Gt.of(P,c))}if(a===Ho.FIXED)if(o==null)this._graph.preferredRoot=this._graph.vertices[0];else for(let c of this._graph.vertices){let g=this._nodeMap.get(c.originalVertex).getSecond().getIdentifier();g!==null&&g===o&&(this._graph.preferredRoot=c)}else if(a===Ho.CENTER_NODE){let c=new O(this._elkGraph.width,this._elkGraph.height);c.scale(.5),c.add(this._elkGraph.x,this._elkGraph.y);let g=Number.POSITIVE_INFINITY;for(let h of this._graph.vertices){let d=h.originalVertex.distance(c);d<g&&(g=d,this._graph.preferredRoot=h)}}else throw new Error("No implementation available for "+a);return this._graph}updateGraph(t){let e=new Map;t.tEdges=null,t.tree=null;for(let o of t.vertices){let r=this._nodeMap.get(o.originalVertex);o.originalVertex=o.rect.getCenter(),e.set(o.originalVertex,r)}this._nodeMap=e}applyPositions(t){let e=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let a of t.vertices){let l=this._nodeMap.get(a.originalVertex).getSecond();l.setLocation(a.rect.x,a.rect.y),e=Math.min(e,l.x),o=Math.min(o,l.y),r=Math.max(r,l.x+l.width),i=Math.max(i,l.y+l.height)}let s=this._elkGraph.getProperty(rm);Ae(this._elkGraph,r-e+s.getHorizontal(),i-o+s.getVertical(),!0,!0),Ra(this._elkGraph,-e+s.left,-o+s.top);for(let a of this._elkGraph.containedEdges){let l=ar(a,!0,!0),c=ks(a),g=Na(a),h=new O(c.x+c.width/2,c.y+c.height/2),d=new O(g.x+g.width/2,g.y+g.height/2),f=d.clone().sub(h);Ft.clipVector(f,c.width,c.height),h.add(f);let E=h.clone().sub(d);Ft.clipVector(E,g.width,g.height),d.add(E),l.setStartLocation(h.x,h.y),l.setEndLocation(d.x,d.y)}}};var Lg=class extends de{constructor(){super(),this._algorithmAssembler=Io.create(Ne.VALUES)}layout(t,e){if(t.hasProperty(mn)){let h=t.getProperty(mn),d=Ht.getInstance().getAlgorithmDataBySuffix(h);if(d!=null){let f=d.getInstancePool().fetch(),E=typeof e.subTask=="function"?e.subTask(1):e;f.layout(t,E)}}t.setProperty(Tg,Ho.CENTER_NODE),t.setProperty(Sg,Te.INVERTED_OVERLAP),t.setProperty(Og,Mr.MINIMUM_SPANNING_TREE);let o=t.getProperty(em);e.begin("Overlap removal",1);let r=new fg(null),i=new Set,s={handle(h,d){i.add(new Ue(h.originalVertex,d.originalVertex))}},a=new Sn,l=a.importGraph(t),c=!0,g=0;for(;g<o&&c;){if(t.getProperty(om)){if(i.clear(),new hg(s,r).sweep(l.vertices),i.size===0)break;l.tEdges=i}this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ne.P1_STRUCTURE,wr.DELAUNAY_TRIANGULATION),this._algorithmAssembler.setPhase(Ne.P2_PROCESSING_ORDER,l.treeConstructionStrategy),this._algorithmAssembler.setPhase(Ne.P3_EXECUTION,On.GROW_TREE);let h=this._algorithmAssembler.build(l);for(let d of h){let f=typeof e.subTask=="function"?e.subTask(1):e;d.process(l,f)}a.updateGraph(l),c=l.getProperty(oe.OVERLAPS_EXISTED),g++}a.applyPositions(l),e.done()}};var Ag=class{constructor(){this._algorithmAssembler=Io.create(Ne.VALUES)}shrink(t,e){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ne.P1_STRUCTURE,wr.DELAUNAY_TRIANGULATION),this._algorithmAssembler.setPhase(Ne.P2_PROCESSING_ORDER,t.treeConstructionStrategy),this._algorithmAssembler.setPhase(Ne.P3_EXECUTION,t.compactionStrategy);let o=this._algorithmAssembler.build(t);if(e.begin("Compaction by shrinking a tree",o.length),t.vertices.length>1)for(let r of o){let i=typeof e.subTask=="function"?e.subTask(1):e;r.process(t,i)}e.done()}};var Cg=class extends de{constructor(){super(),this._shrinktree=new Ag}layout(t,e){if(t.hasProperty(mn)){let s=t.getProperty(mn),a=Ht.getInstance().getAlgorithmDataBySuffix(s);if(a!=null){let l=a.getInstancePool().fetch(),c=typeof e.subTask=="function"?e.subTask(1):e;l.layout(t,c)}}let o=new Sn,r=o.importGraph(t),i=typeof e.subTask=="function"?e.subTask(1):e;this._shrinktree.shrink(r,i),o.applyPositions(r)}};var nm="org.eclipse.elk.sporeOverlap",am="org.eclipse.elk.sporeCompaction",lm=!1;function cm(){let n=Ht.getInstance(),t=n.getAlgorithmData(nm),e=n.getAlgorithmData(am);if(t&&e)return lm=!0,{overlap:t,compaction:e};let o=new Se.Builder().id(nm).name("ELK SPOrE Overlap").description("Node-overlap removal via Nachmanson et al. 2016.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.spore").providerFactory(()=>new Lg).supportedFeatures(new Set([])).create(),r=new Se.Builder().id(am).name("ELK SPOrE Compaction").description("Tree-based compaction to tighten whitespace between nodes.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.spore").providerFactory(()=>new Cg).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(i){i.register(o),i.register(r)}}),lm=!0,{overlap:o,compaction:r}}var br=class extends ge{constructor(){super(),this.id=0}getDesignation(){return null}};var Tn=class n extends yt{constructor(){super()}clone(){let t=new n;return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t}};var Nn=class extends br{constructor(){super(),this._size=new O,this._padding=new Tn,this._offset=new O,this._layerlessNodes=[],this._layers=[],this._parentNode=null}getSize(){return this._size}getActualSize(){return new O(this._size.x+this._padding.left+this._padding.right,this._size.y+this._padding.top+this._padding.bottom)}getPadding(){return this._padding}getOffset(){return this._offset}getLayerlessNodes(){return this._layerlessNodes}getLayers(){return this._layers}getParentNode(){return this._parentNode}setParentNode(t){this._parentNode=t}[Symbol.iterator](){return this._layers[Symbol.iterator]()}toNodeArray(){let t=new Array(this._layers.length);for(let e=0;e<this._layers.length;e++)t[e]=this._layers[e].getNodes().slice();return t}toString(){return this._layers.length===0?`G-unlayered[${this._layerlessNodes.join(",")}]`:this._layerlessNodes.length===0?`G-layered[${this._layers.join(",")}]`:`G[layerless[${this._layerlessNodes.join(",")}], layers[${this._layers.join(",")}]]`}};var p=class{};p.REVERSED=new m("reversed",!1);p.INPUT_COLLECT=new m("inputCollect",!1);p.OUTPUT_COLLECT=new m("outputCollect",!1);p.REPRESENTED_LABELS=new m("representedLabels");p.RANDOM=new m("random");p.CYCLIC=new m("cyclic",!1);p.MODEL_ORDER=new m("modelOrder");p.MAX_MODEL_ORDER_NODES=new m("maxModelOrderNodes",0);p.CB_NUM_MODEL_ORDER_GROUPS=new m("cbNumModelOrderGroups",1);p.TARJAN_ID=new m("tarjanId",-1);p.TARJAN_LOWLINK=new m("tarjanLowlink",-1);p.TARJAN_ON_STACK=new m("tarjanOnStack",!1);p.IS_PART_OF_CYCLE=new m("isPartOfCycle",!1);p.IN_LAYER_LAYOUT_UNIT=new m("inLayerLayoutUnit");p.ORIGIN=new m("origin");p.PORT_DUMMY=new m("portDummy");p.WEIGHT=new m("weight");p.IN_LAYER_SUCCESSOR_CONSTRAINTS=new m("inLayerSuccessorConstraints",[]);p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES=new m("inLayerSuccessorConstraintsBetweenNonDummies",!1);p.BARYCENTER_ASSOCIATES=new m("barycenterAssociates");p.GRAPH_PROPERTIES=new m("graphProperties",()=>new Set);p.FIRST_TRY_WITH_INITIAL_ORDER=new m("firstTryWithInitialOrder",!1);p.SECOND_TRY_WITH_INITIAL_ORDER=new m("secondTryWithInitialOrder",!1);p.INSIDE_CONNECTIONS=new m("insideConnections",!1);p.SPACINGS=new m("spacings");p.ORIGINAL_DUMMY_NODE_POSITION=new m("originalDummyNodePosition");p.LONG_EDGE_SOURCE=new m("longEdgeSource");p.LONG_EDGE_TARGET=new m("longEdgeTarget");p.LONG_EDGE_HAS_LABEL_DUMMIES=new m("longEdgeHasLabelDummies",!1);p.END_LABEL_EDGE=new m("endLabelEdge");p.EXT_PORT_SIDE=new m("extPortSide");p.IN_LAYER_CONSTRAINT=new m("inLayerConstraint");p.EDGE_CONSTRAINT=new m("edgeConstraint");p.TOP_COMMENTS=new m("topComments");p.BOTTOM_COMMENTS=new m("bottomComments");p.COMMENT_CONN_PORT=new m("commentConnPort");p.HIDDEN_NODES=new m("hiddenNodes");p.ORIGINAL_OPPOSITE_PORT=new m("originalOppositePort");p.LONG_EDGE_BEFORE_LABEL_DUMMY=new m("longEdgeBeforeLabelDummy",!1);p.PARTITION_DUMMY=new m("partitionDummy",!1);p.LABEL_SIDE=new m("labelSide");p.END_LABELS=new m("endLabels");p.MAX_EDGE_THICKNESS=new m("maxEdgeThickness",0);p.SPLINE_NS_PORT_Y_COORD=new m("splineNsPortYCoord");p.PORT_RATIO_OR_POSITION=new m("portRatioOrPosition",0);p.EXT_PORT_REPLACED_DUMMIES=new m("extPortReplacedDummies");p.EXT_PORT_REPLACED_DUMMY=new m("extPortReplacedDummy");p.SELF_LOOP_HOLDER=new m("selfLoopHolder");p.ORIGINAL_PORT_CONSTRAINTS=new m("originalPortConstraints");p.CROSSING_HINT=new m("crossingHint",0);p.BREAKING_POINT_INFO=new m("breakingPointInfo");p.SPLINE_ROUTE_START=new m("splineRouteStart");p.SPLINE_EDGE_CHAIN=new m("splineEdgeChain");p.SPLINE_SURVIVING_EDGE=new m("splineSurvivingEdge");p.COMPOUND_NODE=new m("compoundNode",!1);p.PROCESSORS=new m("processors");p.EXT_PORT_CONNECTIONS=new m("extPortConnections");p.EXT_PORT_SIZE=new m("extPortSize");p.COORDINATE_SYSTEM_ORIGIN=new m("coordinateSystemOrigin");p.ORIGINAL_BENDPOINTS=new m("originalBendpoints");p.TARGET_OFFSET=new m("targetOffset");p.CROSS_HIERARCHY_MAP=new m("crossHierarchyMap");p.ORIGINAL_LABEL_EDGE=new m("originalLabelEdge");p.TARGET_NODE_MODEL_ORDER=new m("targetNodeModelOrder");p.LONG_EDGE_TARGET_NODE=new m("longEdgeTargetNode");var re=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};re.BARYCENTER=new re("BARYCENTER");re.ONE_SIDED_GREEDY_SWITCH=new re("ONE_SIDED_GREEDY_SWITCH");re.TWO_SIDED_GREEDY_SWITCH=new re("TWO_SIDED_GREEDY_SWITCH");re.MEDIAN=new re("MEDIAN");var Gi=class extends br{constructor(){super(),this._pos=new O,this._size=new O}getPosition(){return this._pos}getSize(){return this._size}};var Gr=class extends me{constructor(){super()}};var rt=class extends Gi{constructor(){super(),this._owner=null,this._side=u.UNDEFINED,this._anchor=new O,this._explicitlySuppliedPortAnchor=!1,this._margin=new Gr,this._labels=[],this._incomingEdges=[],this._outgoingEdges=[],this._connectedToExternalNodes=!0}getNode(){return this._owner}setNode(t){if(this._owner!=null){let e=this._owner.getPorts(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._owner=t,this._owner!=null&&this._owner.getPorts().push(this)}getSide(){return this._side}setSide(t){if(t==null)throw new TypeError("PortSide must not be null");if(this._side=t,!this.isExplicitlySuppliedPortAnchor()){let e=this.getSize(),o=this.getAnchor();switch(t){case u.NORTH:o.x=e.x/2,o.y=0;break;case u.EAST:o.x=e.x,o.y=e.y/2;break;case u.SOUTH:o.x=e.x/2,o.y=e.y;break;case u.WEST:o.x=0,o.y=e.y/2;break}}}getAnchor(){return this._anchor}isExplicitlySuppliedPortAnchor(){return this._explicitlySuppliedPortAnchor}setExplicitlySuppliedPortAnchor(t){this._explicitlySuppliedPortAnchor=t}getAbsoluteAnchor(){let t=this._owner.getPosition(),e=this.getPosition();return new O(t.x+e.x+this._anchor.x,t.y+e.y+this._anchor.y)}getMargin(){return this._margin}getLabels(){return this._labels}getName(){return this._labels.length>0?this._labels[0].getText():null}getDegree(){return this._incomingEdges.length+this._outgoingEdges.length}getNetFlow(){return this._incomingEdges.length-this._outgoingEdges.length}getIncomingEdges(){return this._incomingEdges}getOutgoingEdges(){return this._outgoingEdges}*getConnectedEdges(){yield*nr(this._incomingEdges),yield*nr(this._outgoingEdges)}isConnectedToExternalNodes(){return this._connectedToExternalNodes}setConnectedToExternalNodes(t){this._connectedToExternalNodes=t}*getPredecessorPorts(){for(let t of this._incomingEdges)yield t.getSource()}*getSuccessorPorts(){for(let t of this._outgoingEdges)yield t.getTarget()}*getConnectedPorts(){yield*nr(this.getPredecessorPorts()),yield*nr(this.getSuccessorPorts())}getIndex(){return this._owner==null?-1:this._owner.getPorts().indexOf(this)}getDesignation(){if(this._labels.length>0&&this._labels[0].getText())return this._labels[0].getText();let t=super.getDesignation();return t!=null?t:String(this.getIndex())}toString(){let t=`p_${this.getDesignation()}`;if(this._owner!=null&&(t+=`[${this._owner}]`),this._incomingEdges.length===1&&this._outgoingEdges.length===0&&this._incomingEdges[0].getSource()!==this){let e=this._incomingEdges[0].getSource();t+=` << ${e.getDesignation()}[${e._owner}]`}if(this._incomingEdges.length===0&&this._outgoingEdges.length===1&&this._outgoingEdges[0].getTarget()!==this){let e=this._outgoingEdges[0].getTarget();t+=` >> ${e.getDesignation()}[${e._owner}]`}return t}};Z(rt,"OUTPUT_PREDICATE",t=>t._outgoingEdges.length>0),Z(rt,"INPUT_PREDICATE",t=>t._incomingEdges.length>0),Z(rt,"NORTH_PREDICATE",t=>t._side===u.NORTH),Z(rt,"EAST_PREDICATE",t=>t._side===u.EAST),Z(rt,"SOUTH_PREDICATE",t=>t._side===u.SOUTH),Z(rt,"WEST_PREDICATE",t=>t._side===u.WEST);var W=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};W.UNDEFINED=new W("UNDEFINED");W.INPUT=new W("INPUT");W.OUTPUT=new W("OUTPUT");var ft=class extends Gi{constructor(t){super(),this._graph=t,this._layer=null,this._type=y.NORMAL,this._ports=[],this._labels=[],this._nestedGraph=null,this._margin=new Gr,this._padding=new Tn,this._portSideIndices=null,this._portSidesCached=!1}getLayer(){return this._layer}setLayer(t,e){let o,r=-1;if(e===void 0)o=t;else if(r=t,o=e,o!=null&&(r<0||r>o.getNodes().length))throw new RangeError("index must be >= 0 and <= layer node count");if(this._layer!=null){let i=this._layer.getNodes(),s=i.indexOf(this);s>=0&&i.splice(s,1)}this._layer=o,this._layer!=null&&(r>=0?this._layer.getNodes().splice(r,0,this):this._layer.getNodes().push(this))}getGraph(){return this._graph==null&&this._layer!=null?this._layer.getGraph():this._graph}setGraph(t){if(this._layer!=null)throw new Error("setGraph called on a node that is already in a layer");this._graph=t}getType(){return this._type}setType(t){this._type=t}getPorts(t,e){return t===void 0?this._ports:fT(this._ports,t,e)}getPortSideView(t){this._portSidesCached||this._findPortIndices();let e=this._portSideIndices.get(t);return e==null?[]:this._ports.slice(e[0],e[1])}*getIncomingEdges(){for(let t of this._ports)yield*nr(t.getIncomingEdges())}*getOutgoingEdges(){for(let t of this._ports)yield*nr(t.getOutgoingEdges())}*getConnectedEdges(){for(let t of this._ports)yield*nr(t.getConnectedEdges())}getLabels(){return this._labels}getNestedGraph(){return this._nestedGraph}setNestedGraph(t){this._nestedGraph=t}getMargin(){return this._margin}getPadding(){return this._padding}getIndex(){return this._layer==null?-1:this._layer.getNodes().indexOf(this)}borderToContentAreaCoordinates(t,e){let o=this.getGraph(),r=o.getPadding(),i=o.getOffset(),s=this.getPosition();t&&(s.x=s.x-r.left-i.x),e&&(s.y=s.y-r.top-i.y)}getInteractiveReferencePoint(){switch(this.getGraph().getProperty(_.INTERACTIVE_REFERENCE_POINT)){case vo.CENTER:{let e=this.getPosition(),o=this.getSize();return new O(e.x+o.x/2,e.y+o.y/2)}case vo.TOP_LEFT:return new O(this.getPosition().x,this.getPosition().y);default:return null}}cachePortSides(){this._portSidesCached=!0,this._findPortIndices()}_findPortIndices(){this._portSideIndices=new Map;let t=0,e=u.NORTH,o=0;for(;o<this._ports.length;o++){let r=this._ports[o];r.getSide()!==e&&(t!==o&&this._portSideIndices.set(e,[t,o]),e=r.getSide(),t=o)}this._portSideIndices.set(e,[t,o])}getDesignation(){if(this._labels.length>0&&this._labels[0].getText())return this._labels[0].getText();let t=super.getDesignation();return t!=null?t:String(this.getIndex())}isInlineEdgeLabel(){if(this._type!==y.LABEL)return!1;let t=this.getProperty(p.REPRESENTED_LABELS);return t?t.every(e=>e.getProperty(_.EDGE_LABELS_INLINE)):!1}toString(){let t="n";return this._type!==y.NORMAL&&(t+=`(${this._type.name.toLowerCase()})`),t+=`_${this.getDesignation()}`,t}},y=class{constructor(t,e){this.name=t,this._color=e,Object.freeze(this)}getColor(){return this._color}toString(){return this.name}};y.NORMAL=new y("NORMAL","#eeeeee");y.LONG_EDGE=new y("LONG_EDGE","#eaed00");y.EXTERNAL_PORT=new y("EXTERNAL_PORT","#cc99cc");y.NORTH_SOUTH_PORT=new y("NORTH_SOUTH_PORT","#0034de");y.LABEL=new y("LABEL","#75c3c3");y.BREAKING_POINT=new y("BREAKING_POINT","#eeeeff");y.PLACEHOLDER=new y("PLACEHOLDER","#eeeeee");y.NONSHIFTING_PLACEHOLDER=new y("NONSHIFTING_PLACEHOLDER","#eeeeee");function dT(n){return n===W.INPUT?rt.INPUT_PREDICATE:n===W.OUTPUT?rt.OUTPUT_PREDICATE:null}function gm(n){return n===u.NORTH?rt.NORTH_PREDICATE:n===u.EAST?rt.EAST_PREDICATE:n===u.SOUTH?rt.SOUTH_PREDICATE:n===u.WEST?rt.WEST_PREDICATE:null}function*fT(n,t,e){let o=null,r=null;t instanceof W?o=dT(t):t instanceof u&&(r=gm(t)),e!=null&&(r=gm(e));for(let i of n)o&&!o(i)||r&&!r(i)||(yield i)}var D=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}static values(){return[n.P1_CYCLE_BREAKING,n.P2_LAYERING,n.P3_NODE_ORDERING,n.P4_NODE_PLACEMENT,n.P5_EDGE_ROUTING]}};D.P1_CYCLE_BREAKING=new D("P1_CYCLE_BREAKING",0);D.P2_LAYERING=new D("P2_LAYERING",1);D.P3_NODE_ORDERING=new D("P3_NODE_ORDERING",2);D.P4_NODE_PLACEMENT=new D("P4_NODE_PLACEMENT",3);D.P5_EDGE_ROUTING=new D("P5_EDGE_ROUTING",4);var oo=class n{constructor(t){this._graph=t;let e=hm().size;this._horizontal=Array.from({length:e},()=>new Array(e).fill(null)),this._vertical=Array.from({length:e},()=>new Array(e).fill(null)),this._precalculate()}_precalculate(){this._set(y.NORMAL,_.SPACING_NODE_NODE,_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._setPair(y.NORMAL,y.LONG_EDGE,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.NORMAL,y.NORTH_SOUTH_PORT,_.SPACING_EDGE_NODE),this._setPair(y.NORMAL,y.EXTERNAL_PORT,_.SPACING_EDGE_NODE),this._setPair(y.NORMAL,y.LABEL,_.SPACING_NODE_NODE,_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._set(y.LONG_EDGE,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this._setPair(y.LONG_EDGE,y.NORTH_SOUTH_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.LONG_EDGE,y.EXTERNAL_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.LONG_EDGE,y.LABEL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._set(y.NORTH_SOUTH_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.NORTH_SOUTH_PORT,y.EXTERNAL_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.NORTH_SOUTH_PORT,y.LABEL,_.SPACING_LABEL_NODE),this._set(y.EXTERNAL_PORT,_.SPACING_PORT_PORT),this._setPair(y.EXTERNAL_PORT,y.LABEL,_.SPACING_LABEL_PORT_VERTICAL,_.SPACING_LABEL_PORT_HORIZONTAL),this._set(y.LABEL,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE),this._set(y.BREAKING_POINT,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.NORMAL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.LABEL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.LONG_EDGE,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS)}_set(t,e,o){let r=Is(t);this._vertical[r][r]=e,o!==void 0&&(this._horizontal[r][r]=o)}_setPair(t,e,o,r){let i=Is(t),s=Is(e);this._vertical[i][s]=o,this._vertical[s][i]=o,r!==void 0&&(this._horizontal[i][s]=r,this._horizontal[s][i]=r)}getHorizontalSpacing(t,e){if(xg(t)&&xg(e))return this._getLocalSpacingNodes(t,e,this._horizontal);if(Dg(t)&&Dg(e))return this._getLocalSpacingTypes(t,e,this._horizontal);throw new yn("getHorizontalSpacing requires two nodes or two node types")}getVerticalSpacing(t,e){if(xg(t)&&xg(e))return this._getLocalSpacingNodes(t,e,this._vertical);if(Dg(t)&&Dg(e))return this._getLocalSpacingTypes(t,e,this._vertical);throw new yn("getVerticalSpacing requires two nodes or two node types")}_getLocalSpacingNodes(t,e,o){let r=o[Is(t.getType())][Is(e.getType())];if(r==null)throw new yn(`No spacing between ${t.getType()} and ${e.getType()}`);let i=n.getIndividualOrDefault(t,r),s=n.getIndividualOrDefault(e,r);return Math.max(i,s)}_getLocalSpacingTypes(t,e,o){let r=o[Is(t)][Is(e)];if(r==null)throw new yn(`No spacing between ${t} and ${e}`);return this._graph.getProperty(r)}static getIndividualOrDefault(t,e){let o=null;if(t.hasProperty(_.SPACING_INDIVIDUAL)){let r=t.getProperty(_.SPACING_INDIVIDUAL);r&&r.hasProperty&&r.hasProperty(e)&&(o=r.getProperty(e))}return o==null&&(o=t.getGraph().getProperty(e)),o}},yn=class extends Error{constructor(t="unspecified spacing"){super(t),this.name="UnspecifiedSpacingException"}};function xg(n){return n!=null&&typeof n.getType=="function"&&typeof n.getPorts=="function"}function Dg(n){return n instanceof y}var qu=null;function hm(){return qu===null&&(qu=new Map([y.NORMAL,y.LONG_EDGE,y.EXTERNAL_PORT,y.NORTH_SOUTH_PORT,y.LABEL,y.BREAKING_POINT,y.PLACEHOLDER,y.NONSHIFTING_PLACEHOLDER].map((n,t)=>[n,t]))),qu}function Is(n){let t=hm().get(n);if(t===void 0)throw new Error(`Unknown NodeType ${n}`);return t}var wg=class{process(t,e){e.begin("Node margin calculation",1);for(let o of t.getLayers())for(let r of o.getNodes())uT(r);e.done()}};function uT(n){let t=n.getMargin(),e=n.getProperty(p.TOP_COMMENTS),o=n.getProperty(p.BOTTOM_COMMENTS);if(e==null&&o==null)return;let r=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_COMMENT),i=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_NODE),s=0;if(e!=null){let c=0;for(let g of e)g.getSize().y>c&&(c=g.getSize().y),s+=g.getSize().x;s+=r*(e.length-1),t.top+=c+i}let a=0;if(o!=null){let c=0;for(let g of o)g.getSize().y>c&&(c=g.getSize().y),a+=g.getSize().x;a+=r*(o.length-1),t.bottom+=c+i}let l=Math.max(s,a);if(l>n.getSize().x){let c=(l-n.getSize().x)/2;c>t.left&&(t.left=c),c>t.right&&(t.right=c)}}var Mg=class{process(t,e){e.begin("Comment post-processing",1);for(let o of t){let r=[];for(let i of o){let s=i.getProperty(p.TOP_COMMENTS),a=i.getProperty(p.BOTTOM_COMMENTS);if(s!=null||a!=null){if(_T(i,s,a),s!=null)for(let l of s)r.push(l);if(a!=null)for(let l of a)r.push(l)}}for(let i of r)o.getNodes().push(i)}e.done()}};function _T(n,t,e){let o=n.getPosition(),r=n.getSize(),i=n.getMargin(),s=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_COMMENT);if(t!=null){let a=s*(t.length-1),l=0;for(let f of t)a+=f.getSize().x,f.getSize().y>l&&(l=f.getSize().y);let c=o.x-(a-r.x)/2,g=o.y-i.top+l,h=r.x/(t.length+1),d=h;for(let f of t){f.getPosition().x=c,f.getPosition().y=g-f.getSize().y,c+=f.getSize().x+s;let E=dm(f);E.getPosition().x=f.getSize().x/2-E.getAnchor().x,E.getPosition().y=f.getSize().y;let P=f.getProperty(p.COMMENT_CONN_PORT);P.getDegree()===1&&(P.getPosition().x=d-P.getAnchor().x,P.getPosition().y=0,P.setNode(n)),d+=h}}if(e!=null){let a=s*(e.length-1),l=0;for(let f of e)a+=f.getSize().x,f.getSize().y>l&&(l=f.getSize().y);let c=o.x-(a-r.x)/2,g=o.y+r.y+i.bottom-l,h=r.x/(e.length+1),d=h;for(let f of e){f.getPosition().x=c,f.getPosition().y=g,c+=f.getSize().x+s;let E=dm(f);E.getPosition().x=f.getSize().x/2-E.getAnchor().x,E.getPosition().y=0;let P=f.getProperty(p.COMMENT_CONN_PORT);P.getDegree()===1&&(P.getPosition().x=d-P.getAnchor().x,P.getPosition().y=r.y,P.setNode(n)),d+=h}}}function dm(n){let t=n.getProperty(p.COMMENT_CONN_PORT);for(let e of n.getPorts()){for(let o of e.getOutgoingEdges())return o.setTarget(t),e;for(let o of e.getIncomingEdges())return o.setSource(t),e}return null}var bg=class{process(t,e){e.begin("Comment pre-processing",1);let o=t.getLayerlessNodes(),r=0;for(;r<o.length;){let i=o[r];if(!i.getProperty(_.COMMENT_BOX)){r++;continue}let s=0,a=null,l=null;for(let c of i.getPorts())s+=c.getDegree(),c.getIncomingEdges().length===1&&(a=c.getIncomingEdges()[0],l=a.getSource()),c.getOutgoingEdges().length===1&&(a=c.getOutgoingEdges()[0],l=a.getTarget());if(s===1&&l!=null&&l.getDegree()===1&&!l.getNode().getProperty(_.COMMENT_BOX))pT(i,a,l,l.getNode()),o.splice(r,1);else{let c=[];for(let g of i.getPorts()){for(let h of g.getOutgoingEdges())h.getTarget().getOutgoingEdges().length>0&&c.push(h);for(let h of g.getIncomingEdges())h.getSource().getIncomingEdges().length>0&&c.push(h)}for(let g of c)g.reverse(t,!0);r++}}e.done()}};function pT(n,t,e,o){let r,i=!1,s=!1;if(o.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){let l=!1,c=!1;t:for(let g of o.getPorts())for(let h of g.getConnectedPorts())if(!h.getNode().getProperty(_.COMMENT_BOX)){if(g.getSide()===u.NORTH){l=!0;break t}if(g.getSide()===u.SOUTH){c=!0;break t}}i=c&&!l,s=l&&!c}if(!i&&!s&&o.getLabels().length>0){let l=0;for(let c of o.getLabels())l+=c.getPosition().y+c.getSize().y/2;l/=o.getLabels().length,r=l>=o.getSize().y/2}else r=!s;ET(o,r,i,s).push(n),n.setProperty(p.COMMENT_CONN_PORT,e),t.getTarget()===e?(t.setTarget(null),e.getDegree()===0&&e.setNode(null),mT(e)):(t.setSource(null),e.getDegree()===0&&e.setNode(null)),t.getBendPoints().clear()}function ET(n,t,e,o){if(t){let s=n.getProperty(p.TOP_COMMENTS);if(s==null)return s=[],n.setProperty(p.TOP_COMMENTS,s),s;if(e)return s;let a=n.getProperty(p.BOTTOM_COMMENTS);return a==null?(a=[],n.setProperty(p.BOTTOM_COMMENTS,a),a):s.length<=a.length?s:a}let r=n.getProperty(p.BOTTOM_COMMENTS);if(r==null)return r=[],n.setProperty(p.BOTTOM_COMMENTS,r),r;if(o)return r;let i=n.getProperty(p.TOP_COMMENTS);return i==null?(i=[],n.setProperty(p.TOP_COMMENTS,i),i):r.length<=i.length?r:i}function mT(n){let t=n.getProperty(p.PORT_DUMMY);if(t!=null){let e=t.getLayer(),o=e.getNodes().indexOf(t);if(o>=0&&e.getNodes().splice(o,1),e.getNodes().length===0){let r=t.getGraph(),i=r.getLayers().indexOf(e);i>=0&&r.getLayers().splice(i,1)}}}var Gg=class{process(t,e){e.begin("Constraints Postprocessor",1);let o=0;for(let r of t.getLayers()){let i=0,s=!1;for(let a of r.getNodes())a.getType()===y.NORMAL&&(s=!0,a.setProperty(_.LAYERING_LAYER_ID,o),a.setProperty(_.CROSSING_MINIMIZATION_POSITION_ID,i),i++);s&&o++}e.done()}};var J=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};J.NONE=new J("NONE");J.FIRST=new J("FIRST");J.FIRST_SEPARATE=new J("FIRST_SEPARATE");J.LAST=new J("LAST");J.LAST_SEPARATE=new J("LAST_SEPARATE");var De=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};De.NONE=new De("NONE");De.OUTGOING_ONLY=new De("OUTGOING_ONLY");De.INCOMING_ONLY=new De("INCOMING_ONLY");var Hg=class{process(t,e){e.begin("Edge and layer constraint edge reversal",1);let o=PT(t);OT(t,o),e.done()}};function PT(n){let t=[];for(let e of n.getLayerlessNodes()){let o=e.getProperty(_.LAYERING_LAYER_CONSTRAINT),r=fm(o);r!=null?(e.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),r===De.INCOMING_ONLY?Xa(n,e,o,W.INPUT):r===De.OUTGOING_ONLY&&Xa(n,e,o,W.OUTPUT)):t.push(e)}return t}function OT(n,t){for(let e of t){let o=e.getProperty(_.LAYERING_LAYER_CONSTRAINT),r=fm(o);r!=null?(e.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),r===De.INCOMING_ONLY?Xa(n,e,o,W.INPUT):r===De.OUTGOING_ONLY&&Xa(n,e,o,W.OUTPUT)):e.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&e.getPorts().length>0&&ST(e)&&Xa(n,e,o,W.UNDEFINED)}}function ST(n){for(let t of n.getPorts()){let e=t.getSide()===u.EAST&&t.getNetFlow()>0,o=t.getSide()===u.WEST&&t.getNetFlow()<0;if(!(e||o))return!1;for(let r of t.getOutgoingEdges()){let i=r.getTarget().getNode().getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.LAST||i===J.LAST_SEPARATE)return!1}for(let r of t.getIncomingEdges()){let i=r.getSource().getNode().getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.FIRST||i===J.FIRST_SEPARATE)return!1}}return!0}function fm(n){switch(n){case J.FIRST:case J.FIRST_SEPARATE:return De.OUTGOING_ONLY;case J.LAST:case J.LAST_SEPARATE:return De.INCOMING_ONLY;default:return null}}function Xa(n,t,e,o){let r=t.getPorts().slice();for(let i of r){if(o===W.INPUT||o===W.UNDEFINED){let s=i.getOutgoingEdges().slice();for(let a of s)TT(e,a)&&a.reverse(n,!0)}if(o===W.OUTPUT||o===W.UNDEFINED){let s=i.getIncomingEdges().slice();for(let a of s)NT(e,a)&&a.reverse(n,!0)}}}function TT(n,t){if(t.getProperty(p.REVERSED))return!1;let e=t.getTarget().getNode();return!(n===J.LAST&&e.getType()===y.LABEL||e.getProperty(_.LAYERING_LAYER_CONSTRAINT)===J.LAST_SEPARATE)}function NT(n,t){if(t.getProperty(p.REVERSED))return!1;let e=t.getSource().getNode();return!(n===J.FIRST&&e.getType()===y.LABEL||e.getProperty(_.LAYERING_LAYER_CONSTRAINT)===J.FIRST_SEPARATE)}var vg=class{process(t,e){e.begin("End label post-processing",1);for(let o of t.getLayers())for(let r of o.getNodes())(r.getType()===y.NORMAL||r.getType()===y.EXTERNAL_PORT)&&r.hasProperty(p.END_LABELS)&&yT(r);e.done()}};function yT(n){let t=n.getProperty(p.END_LABELS);if(t==null||t.size===0)return;let e=n.getPosition();for(let o of t.values())o.getCellRectangle().move(e),o.applyLabelLayout();n.setProperty(p.END_LABELS,null)}var _m=-1,In=class{process(t,e){e.begin("End label pre-processing",1);let o=t.getProperty(_.SPACING_EDGE_LABEL),r=t.getProperty(_.SPACING_LABEL_LABEL),i=t.getProperty(_.DIRECTION),s=i!=null&&i.isVertical&&i.isVertical();for(let a of t.getLayers())for(let l of a.getNodes())IT(l,o,r,s);e.done()}static gatherLabels(t){return pm(t)}};function IT(n,t,e,o){let r=n.getPorts(),i=r.length,s=new Array(i);for(let l=0;l<i;l++){let c=r[l];c.id=l,s[l]=RT(pm(c),e,o)}LT(n,s,e,t,o);let a=new Map;for(let l=0;l<s.length;l++)s[l]!=null&&a.set(r[l],s[l]);a.size>0&&(n.setProperty(p.END_LABELS,a),xT(n,s))}function RT(n,t,e){if(n==null||n.length===0)return null;let o=new Ni(t,!e);for(let i of n)o.addLabel(i);let r=o.getCellRectangle();return r.height=o.getMinimumHeight(),r.width=o.getMinimumWidth(),o}function pm(n){let t=[],e=um(n,t),o=n.getProperty(p.PORT_DUMMY);if(o!=null){for(let r of o.getPorts())if(r.getProperty(p.ORIGIN)===n){let i=um(r,t);i>e&&(e=i)}}return t.length>0&&n.setProperty(p.MAX_EDGE_THICKNESS,e),e!==_m?t:null}function um(n,t){let e=_m,o=[];for(let r of n.getConnectedEdges()){let i=r.getProperty(_.EDGE_THICKNESS);if(i>e&&(e=i),r.getSource()===n)for(let s of r.getLabels())s.getProperty(_.EDGE_LABELS_PLACEMENT)===St.TAIL&&o.push(s);else for(let s of r.getLabels())s.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD&&o.push(s);for(let s of o)s.hasProperty(p.END_LABEL_EDGE)||s.setProperty(p.END_LABEL_EDGE,r),t.push(s);o.length=0}return e}function LT(n,t,e,o,r){let i=new Set;for(let s of n.getPorts())t[s.id]!=null&&(AT(s,t[s.id],o),i.add(s.getSide()));r?(Bg(n,t,u.EAST,2*e,o),Bg(n,t,u.WEST,2*e,o)):(Bg(n,t,u.NORTH,2*e,o),Bg(n,t,u.SOUTH,2*e,o))}function AT(n,t,e){let o=t.getCellRectangle(),r=n.getNode(),i=r.getSize(),s=r.getMargin(),a=n.getPosition(),l=new O(a.x+n.getAnchor().x,a.y+n.getAnchor().y),c=n.getProperty(p.MAX_EDGE_THICKNESS),g=DT(t)===Vt.ABOVE;switch(n.getSide()){case u.NORTH:{t.setVerticalAlignment(nt.BOTTOM),o.y=-s.top-e-o.height,g?(t.setHorizontalAlignment(lt.RIGHT),o.x=l.x-c-e-o.width):(t.setHorizontalAlignment(lt.LEFT),o.x=l.x+c+e);break}case u.EAST:{t.setHorizontalAlignment(lt.LEFT),o.x=i.x+s.right+e,g?(t.setVerticalAlignment(nt.BOTTOM),o.y=l.y-c-e-o.height):(t.setVerticalAlignment(nt.TOP),o.y=l.y+c+e);break}case u.SOUTH:{t.setVerticalAlignment(nt.TOP),o.y=i.y+s.bottom+e,g?(t.setHorizontalAlignment(lt.RIGHT),o.x=l.x-c-e-o.width):(t.setHorizontalAlignment(lt.LEFT),o.x=l.x+c+e);break}case u.WEST:{t.setHorizontalAlignment(lt.RIGHT),o.x=-s.left-e-o.width,g?(t.setVerticalAlignment(nt.BOTTOM),o.y=l.y-c-e-o.height):(t.setVerticalAlignment(nt.TOP),o.y=l.y+c+e);break}default:break}}function Bg(n,t,e,o,r){let i=fs.createForDirection(wT(e)).withGap(o,o).withStartCoordinate(CT(n,e,r));for(let s of n.getPorts(e))t[s.id]!=null&&i.addRectangle(t[s.id].getCellRectangle());i.removeOverlaps()}function CT(n,t,e){let o=n.getSize(),r=n.getMargin();switch(t){case u.NORTH:return-r.top-e;case u.SOUTH:return o.y+r.bottom+e;case u.EAST:return o.x+r.right+e;case u.WEST:return-r.left-e;default:return 0}}function xT(n,t){let e=n.getMargin(),o=n.getSize(),r=new dt(-e.left,-e.top,e.left+o.x+e.right,e.top+o.y+e.bottom);for(let i of t)i!=null&&r.union(i.getCellRectangle());e.left=-r.x,e.top=-r.y,e.right=r.width-e.left-o.x,e.bottom=r.height-e.top-o.y}function DT(n){return n.getLabels()[0].getProperty(p.LABEL_SIDE)}function wT(n){switch(n){case u.NORTH:return Qt.UP;case u.SOUTH:return Qt.DOWN;case u.EAST:return Qt.RIGHT;case u.WEST:return Qt.LEFT;default:return null}}var Ug=class{process(t,e){e.begin("Sort end labels",1);for(let o of t.getLayers())for(let r of o.getNodes())r.getType()===y.NORMAL&&MT(r,t);e.done()}};function MT(n,t){if(!n.hasProperty(p.END_LABELS))return;let e=n.getProperty(p.END_LABELS),o=!1;for(let r of n.getPorts())bT(r)&&(o||(GT(t),o=!0),HT(e.get(r)))}function bT(n){let t=0;for(let e of n.getIncomingEdges())e.getLabels().some(o=>o.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD)&&t++;for(let e of n.getOutgoingEdges())e.getLabels().some(o=>o.getProperty(_.EDGE_LABELS_PLACEMENT)===St.TAIL)&&t++;return t>=2}function GT(n){let t=0;for(let e of n)for(let o of e){o.id=t++;for(let r of o.getPorts())r.id=t++}}function HT(n){if(n==null)return;let t=new Map,e=n.getLabels();for(let r of e){let i=r.getProperty(p.END_LABEL_EDGE),s=t.get(i);s==null&&(s=[],t.set(i,s)),s.push(r)}let o=Array.from(t.entries());o.sort((r,i)=>{let s=r[0],a=i[0];if(s==null||a==null)return 0;let l=s.getSource().id-a.getSource().id;if(l!==0)return l;let c=s.getTarget().getNode().id-a.getTarget().getNode().id;return c!==0?c:a.getTarget().id-s.getTarget().id}),e.length=0;for(let[,r]of o)for(let i of r)e.push(i)}var ie=class{constructor(t){this.name=t}toString(){return this.name}};ie.NONE=new ie("NONE");ie.LEFT=new ie("LEFT");ie.RIGHT=new ie("RIGHT");ie.LEFT_RIGHT_CONSTRAINT_LOCKING=new ie("LEFT_RIGHT_CONSTRAINT_LOCKING");ie.LEFT_RIGHT_CONNECTION_LOCKING=new ie("LEFT_RIGHT_CONNECTION_LOCKING");ie.EDGE_LENGTH=new ie("EDGE_LENGTH");var Qr=Object.freeze({CONSERVATIVE:"CONSERVATIVE",CONSERVATIVE_SOFT:"CONSERVATIVE_SOFT",SLOPPY:"SLOPPY",values(){return[this.CONSERVATIVE,this.CONSERVATIVE_SOFT,this.SLOPPY]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var Fg=class n{constructor(...t){if(this.top=Number.MAX_VALUE,this.bottom=-Number.MAX_VALUE,this.left=Number.MAX_VALUE,this.right=-Number.MAX_VALUE,t.length===4&&t.every(e=>typeof e=="number")){let[e,o,r,i]=t;if(o>i)throw new RangeError("Top must be smaller or equal to bottom.");if(e>r)throw new RangeError("Left must be smaller or equal to right.");this.top=o,this.right=r,this.bottom=i,this.left=e;return}if(t.length===1){let e=t[0];if(e instanceof n){this.top=e.top,this.right=e.right,this.bottom=e.bottom,this.left=e.left;return}if(e instanceof O){this.top=e.y,this.bottom=e.y,this.right=e.x,this.left=e.x;return}if(typeof e.getPosition=="function"&&typeof e.getSize=="function"){let o=e.getPosition(),r=new O(o.x+e.getSize().x,o.y+e.getSize().y);this.top=Math.min(o.y,r.y),this.bottom=Math.max(o.y,r.y),this.left=Math.min(o.x,r.x),this.right=Math.max(o.x,r.x);return}if(Array.isArray(e)||typeof e[Symbol.iterator]=="function"){for(let o of e)this.union(o);return}}if(t.length>=1){for(let e of t)this.union(e);return}}union(t){if(t instanceof n){this.top=Math.min(this.top,t.top),this.right=Math.max(this.right,t.right),this.bottom=Math.max(this.bottom,t.bottom),this.left=Math.min(this.left,t.left);return}if(t instanceof O){this.top=Math.min(this.top,t.y),this.right=Math.max(this.right,t.x),this.bottom=Math.max(this.bottom,t.y),this.left=Math.min(this.left,t.x);return}if(typeof t.getPosition=="function"&&typeof t.getSize=="function"){this.union(t.getPosition());let e=t.getPosition();this.union(new O(e.x+t.getSize().x,e.y+t.getSize().y));return}}static union(t,e){if(e instanceof n){let s=new n(t);return s.union(e),s}let o=e[Symbol.iterator](),r=o.next();if(r.done)throw new RangeError("Empty rectangle collection");let i=new n(r.value);for(let s of o)i.union(s);return i}enlarge(t){this.top-=t,this.left-=t,this.right+=t,this.bottom+=t}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}getTop(){return this.top}getRight(){return this.right}getBottom(){return this.bottom}getLeft(){return this.left}getFromPortSide(t){switch(t){case u.NORTH:return this.top;case u.EAST:return this.right;case u.SOUTH:return this.bottom;case u.WEST:return this.left;default:return 0}}toNodeMargins(t){let e=new me,o=new n(0,0,t.getSize().x,t.getSize().y);return e.top=Math.max(0,o.top-this.top),e.left=Math.max(0,o.left-this.left),e.bottom=Math.max(0,this.bottom-o.bottom),e.right=Math.max(0,this.right-o.right),e}toString(){return"[top= "+this.top.toFixed(1)+",left= "+this.left.toFixed(1)+",bottom= "+this.bottom.toFixed(1)+",right= "+this.right.toFixed(1)+"]"}};var uo=1e-6,Rs=class n{constructor(...t){if(this.knotVector=[],this.controlPoints=[],this.dimNUBS=0,this.isUniform=!1,this.isClamped=!1,this.outerBox=null,this.isBezier=!1,this.minKnot=0,this.maxKnot=0,t.length===1&&t[0]instanceof n){let a=t[0];this.dimNUBS=a.dimNUBS,this.isUniform=a.isUniform,this.isClamped=a.isClamped,this.outerBox=a.outerBox,this.isBezier=a.isBezier,this.knotVector=a.knotVector.slice(),this.minKnot=a.minKnot,this.maxKnot=a.maxKnot,this.controlPoints=a.controlPoints.slice();return}if(t.length===6){let[a,l,c,g,h,d]=t;this.isClamped=a,this.isUniform=l,this.isBezier=c,this.dimNUBS=g,this.knotVector=h,this.controlPoints=d,this.minKnot=h[0],this.maxKnot=h[h.length-1];return}let e=t[0],o=t[1],r;if(t.length===3&&Array.isArray(t[2])?r=t[2].slice():t.length===3&&t[2]instanceof st?r=Array.from(t[2]):r=t.slice(2),o<1)throw new RangeError("The dimension must be at least 1!");for(;r.length<o+1;)r.unshift(r[0]);if(r.length<o+1)throw new RangeError("At least (dimension + 1) control points are necessary!");this.dimNUBS=o,this.isClamped=e,this.isUniform=!0,this.isBezier=!1,this._createUniformKnotVector(e,r.length+this.dimNUBS-1);let i=[],s=0;for(let a=0;a<this.dimNUBS-1;a++)i.push(this.knotVector[s++]);for(let a of r)i.push(this.knotVector[s++]),this.controlPoints.push(new Rn(a,i)),i.shift()}static generateDerivedNUBS(t){let e=t.isClamped,o=t.isUniform,r=t.isBezier,i=t.dimNUBS,s=i-1,a=t.knotVector,l=t.knotVector.slice(1,t.knotVector.length-1),c=[];for(let f=0;f<t.controlPoints.length-1;f++){let E=t.controlPoints[f+1].getCp().clone().sub(t.controlPoints[f].getCp()).scale(i/(a[f+i]-a[f]));c.push(E)}let g=[],h=0,d=[];for(let f=0;f<s-1;f++)g.push(l[h++]);for(let f of c)g.push(l[h++]),d.push(new Rn(f,g)),g.shift();return new n(e,o,r,s,l,d)}static generateInvertedNUBS(t){let e=[],o=t.knotVector[t.knotVector.length-1];for(let l of t.knotVector)e.unshift(o-l);let r=st.reverse(t.getControlPoints()),i=[],s=0,a=[];for(let l=0;l<t.dimNUBS-1;l++)i.push(e[s++]);for(let l of r)i.push(e[s++]),a.push(new Rn(l,i)),i.shift();return new n(t.isClamped,t.isUniform,t.isBezier,t.dimNUBS,e,a)}getDim(){return this.dimNUBS}getOuterBox(){return this.outerBox===null&&this._calculateOuterBox(),this.outerBox}setOuterBox(t){this.outerBox=t}getControlPoints(){let t=new st;for(let e of this.controlPoints)t.push(e.getCp());return t}getControlPoint(t){return this.controlPoints[t].getCp()}getControlPointsSize(){return this.controlPoints.length}getKnotVector(){return this.knotVector.slice()}_getIndexInKnotVector(t){for(let e=0;e<this.knotVector.length;e++)if(Math.abs(this.knotVector[e]-t)<uo)return e;return this.knotVector.length}_getMultiplicity(t){let e=0;for(let o of this.knotVector){let r=o-t;if(r>uo)return e;r>-uo&&e++}return e}_createUniformKnotVector(t,e){if(e<2*this.dimNUBS)throw new RangeError("The knot vector must have at least two times the dimension elements.");let o;if(t){this.minKnot=0,this.maxKnot=1;for(let i=0;i<this.dimNUBS;i++)this.knotVector.push(0);o=e+1-2*this.dimNUBS}else{o=e+1;let i=this.dimNUBS;this.minKnot=i/(o+1),this.maxKnot=(o-i)/o}let r=o;for(let i=1;i<o;i++)this.knotVector.push(i/r);if(this.isClamped)for(let i=0;i<this.dimNUBS;i++)this.knotVector.push(1)}_calculateOuterBox(){this.outerBox=new Fg(this.getControlPoints())}static _getTFromPolar(t){let e=0;for(let o of t)e+=o;return e/t.length}_insertKnot(t,e){let o;this.isClamped?o=this.dimNUBS:o=this.dimNUBS-1;let r=this.knotVector[o++],i=0;for(;r-t<uo;)r=this.knotVector[o++],i++;o--,this._insertKnotAtCurrentPosition(e,t,i,o)}_insertKnotAtCurrentPosition(t,e,o,r){let i=this._getMultiplicity(e);for(let s=0;s<t;s++){this.knotVector.splice(r,0,e),r++;let a=[],l=o,c=this.controlPoints[l++];for(let d=i+s;d<this.dimNUBS;d++){let f=c;c=this.controlPoints[l++],a.push(new Rn(f,c,e))}let g=o+1,h=Math.max(0,a.length-1);this.controlPoints.splice(g,h,...a),s<t-1?o+=1:o+=1+a.length}return{cpIdx:o,knotIdx:r}}static _getFirstVerticalPoint(t,e,o){let r=n.generateDerivedNUBS(t),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroXOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.x),a++;return t._getPointOnCurve(l,!1)}static _getLastVerticalPoint(t,e,o){let r=n.generateInvertedNUBS(n.generateDerivedNUBS(t)),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroXOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.x),a++;let c=t.getKnotVector()[t.getKnotVector().length-1];return t._getPointOnCurve(c-l,!1)}static _getFirstHorizontalPoint(t,e,o){let r=n.generateDerivedNUBS(t),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroYOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.y),a++;return t._getPointOnCurve(l,!1)}static _getLastHorizontalPoint(t,e,o){let r=n.generateInvertedNUBS(n.generateDerivedNUBS(t)),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroYOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.y),a++;let c=t.getKnotVector()[t.getKnotVector().length-1];return t._getPointOnCurve(c-l,!1)}_getPointOnCurve(t,e=!1){let o=this._getMultiplicity(t);if(o===this.dimNUBS)return this.getControlPoint(this._getIndexInKnotVector(t));if(e)return this._insertKnot(t,this.dimNUBS-o),this.getControlPoint(this._getIndexInKnotVector(t));let r=new n(this);return r._insertKnot(t,this.dimNUBS-o),r.getControlPoint(r._getIndexInKnotVector(t))}static _getZeroYOfControlPoligon(t){let e=t.controlPoints;if(e.length===0)return 0;let o=e[0],r=o.getCp().y,i=r>uo,s=r<-uo;for(let a=1;a<e.length;a++){let l=o,c=r,g=i,h=s;if(o=e[a],r=o.getCp().y,i=r>uo,s=r<-uo,!(i||s))return n._getTFromPolar(o.getPolarCoordinate());if(g&&s||h&&i){let d=c/(c-r),f=n._getTFromPolar(l.getPolarCoordinate()),E=n._getTFromPolar(o.getPolarCoordinate());return d*f+(1-d)*E}}return 0}static _getZeroXOfControlPoligon(t){let e=t.controlPoints;if(e.length===0)return 0;let o=e[0],r=o.getCp().x,i=r>uo,s=r<-uo;for(let a=1;a<e.length;a++){let l=o,c=r,g=i,h=s;if(o=e[a],r=o.getCp().x,i=r>uo,s=r<-uo,!(i||s))return n._getTFromPolar(o.getPolarCoordinate());if(g&&s||h&&i){let d=c/(c-r),f=n._getTFromPolar(l.getPolarCoordinate()),E=n._getTFromPolar(o.getPolarCoordinate());return d*f+(1-d)*E}}return 0}toBezier(){if(this.isBezier)return;let t;this.isClamped?t=this.dimNUBS:(this.knotVector.splice(0,this.dimNUBS-1),t=0);let e=0,o=this.knotVector[t++];for(;this.maxKnot-o>uo;){let r=o,i=0;for(;Math.abs(o-r)<uo;)i++,o=this.knotVector[t++],e++;if(i<this.dimNUBS){t--;let s=this._insertKnotAtCurrentPosition(this.dimNUBS-i,r,e,t);e=s.cpIdx,t=s.knotIdx,o=this.knotVector[t++]}e--}this.isClamped||this.knotVector.splice(t,this.dimNUBS-1),this.isClamped=!0,this.isBezier=!0}getBezierCP(t=!1,e=!1){this.isBezier||this.toBezier();let o=new st,r=0;t||(r=1);for(let i=r;i<this.controlPoints.length;i++)o.push(this.controlPoints[i].getCp());return e||o.pop(),o}static generateNiceCurve(){let t=new st,e=new O(5.5,23),o=new O(2.5,12),r=new O(5,10),i=new O(5,9),s=new O(3.8,5.5),a=new O(7,4),l=new O(7,3.5),c=new O(6,2.2),g=new O(8,.5),h=(d,f)=>new O(f+f-d.x,d.y);return t.push(e,e,e,o,r,i,s,a,l,c,g,h(c,g.x),h(l,g.x),h(a,g.x),h(s,g.x),h(i,g.x),h(r,g.x),h(o,g.x),h(e,g.x),h(e,g.x),h(e,g.x)),t.scale(5),t.offset(-50,-80),new n(!0,3,t)}toString(){return`[${this.controlPoints.join(", ")}]`}};Rs.DIM=3;var Rn=class n{constructor(t,e,o){if(arguments.length===2){if(t instanceof n){this.cp=t.getCp().clone(),this.polarCoordinate=t.polarCoordinate.slice();return}this.cp=t.clone(),this.polarCoordinate=e.slice();return}if(arguments.length===1){let f=t;this.cp=f.getCp().clone(),this.polarCoordinate=f.polarCoordinate.slice();return}let r=t,i=e,s=o,a=r.polarCoordinate[0],l=i.polarCoordinate[i.polarCoordinate.length-1],c=r.cp.clone().scale(l-s),g=i.cp.clone().scale(s-a),h=c.add(g);h.scale(1/(l-a)),this.cp=h,this.polarCoordinate=[];let d=!0;for(let f=1;f<r.polarCoordinate.length;f++){let E=r.polarCoordinate[f];d&&E-s>uo&&(this.polarCoordinate.push(s),d=!1),this.polarCoordinate.push(E)}d&&this.polarCoordinate.push(s)}getCp(){return this.cp}setCp(t){this.cp=t}getPolarCoordinate(){return this.polarCoordinate}setPolarCoordinate(t){this.polarCoordinate=t}toString(){return`[${this.polarCoordinate.join(",")}] (${this.cp.x.toFixed(2)}, ${this.cp.y.toFixed(2)})`}};var v=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};v.COMMENTS=new v("COMMENTS");v.EXTERNAL_PORTS=new v("EXTERNAL_PORTS");v.HYPEREDGES=new v("HYPEREDGES");v.HYPERNODES=new v("HYPERNODES");v.NON_FREE_PORTS=new v("NON_FREE_PORTS");v.NORTH_SOUTH_PORTS=new v("NORTH_SOUTH_PORTS");v.SELF_LOOPS=new v("SELF_LOOPS");v.CENTER_LABELS=new v("CENTER_LABELS");v.END_LABELS=new v("END_LABELS");v.PARTITIONS=new v("PARTITIONS");var Ln=class Ln{constructor(t,e,o,r){this._type=t,this._weight=r,this._source=null,this._target=null,this.setSource(e),this.setTarget(o)}static createAndAddRegular(t,e,o){return new Ln(Hr.REGULAR,t,e,o)}static createAndAddCritical(t,e){return new Ln(Hr.CRITICAL,t,e,Ln.CRITICAL_DEPENDENCY_WEIGHT)}remove(){this.setSource(null),this.setTarget(null)}reverse(){let t=this._source,e=this._target;this.setSource(e),this.setTarget(t)}getType(){return this._type}getSource(){return this._source}setSource(t){if(this._source!=null){let e=this._source.getOutgoingSegmentDependencies(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._source=t,this._source!=null&&this._source.getOutgoingSegmentDependencies().push(this)}getTarget(){return this._target}setTarget(t){if(this._target!=null){let e=this._target.getIncomingSegmentDependencies(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._target=t,this._target!=null&&this._target.getIncomingSegmentDependencies().push(this)}getWeight(){return this._weight}toString(){return`${this._source}->${this._target} (${this._type})`}};Z(Ln,"CRITICAL_DEPENDENCY_WEIGHT",1);var $e=Ln,Hr=Object.freeze({REGULAR:"REGULAR",CRITICAL:"CRITICAL"});var Ka=class{static detectCycles(t,e,o){let r=[],i=[],s=[];vT(t,i,s,e),BT(t,i,s,e,o);for(let a of t)for(let l of a.getOutgoingSegmentDependencies())(!e||l.getType()===Hr.CRITICAL)&&a.mark>l.getTarget().mark&&r.push(l);return r}};function vT(n,t,e,o){let r=-1;for(let i of n){i.mark=r--;let s=0;for(let g of i.getIncomingSegmentDependencies())g.getType()===Hr.CRITICAL&&(s+=g.getWeight());let a=0;for(let g of i.getOutgoingSegmentDependencies())g.getType()===Hr.CRITICAL&&(a+=g.getWeight());let l=s,c=a;if(!o){l=0;for(let g of i.getIncomingSegmentDependencies())l+=g.getWeight();c=0;for(let g of i.getOutgoingSegmentDependencies())c+=g.getWeight()}i.setInWeight(l),i.setCriticalInWeight(s),i.setOutWeight(c),i.setCriticalOutWeight(a),c===0?e.push(i):l===0&&t.push(i)}}function BT(n,t,e,o,r){let i=new Set(n),s=[],a=n.length,l=a-1,c=a+1;for(;i.size>0;){for(;e.length>0;){let f=e.shift();i.delete(f),f.mark=l--,Ju(f,t,e,o)}for(;t.length>0;){let f=t.shift();i.delete(f),f.mark=c++,Ju(f,t,e,o)}let h=Number.MIN_SAFE_INTEGER;s.length=0;let d=!1;for(let f of[...i].sort((E,P)=>E.mark-P.mark)){if(!o&&f.getCriticalOutWeight()>0&&f.getCriticalInWeight()<=0){s.length=0,s.push(f),d=!0;break}let E=f.getOutWeight()-f.getInWeight();E>=h&&(E>h&&(s.length=0,h=E),s.push(f))}if(s.length>0){let f=s[r.nextInt(s.length)];i.delete(f),f.mark=c++,Ju(f,t,e,o),s.length=0}}let g=n.length+1;for(let h of n)h.mark<a&&(h.mark=h.mark+g)}function Ju(n,t,e,o){for(let r of n.getOutgoingSegmentDependencies())if(!o||r.getType()===Hr.CRITICAL){let i=r.getTarget();i.mark<0&&r.getWeight()>0&&(i.setInWeight(i.getInWeight()-r.getWeight()),r.getType()===Hr.CRITICAL&&i.setCriticalInWeight(i.getCriticalInWeight()-r.getWeight()),i.getInWeight()<=0&&i.getOutWeight()>0&&t.push(i))}for(let r of n.getIncomingSegmentDependencies())if(!o||r.getType()===Hr.CRITICAL){let i=r.getSource();i.mark<0&&r.getWeight()>0&&(i.setOutWeight(i.getOutWeight()-r.getWeight()),r.getType()===Hr.CRITICAL&&i.setCriticalOutWeight(i.getCriticalOutWeight()-r.getWeight()),i.getOutWeight()<=0&&i.getInWeight()>0&&e.push(i))}}var An=class n{constructor(t){this._routingStrategy=t,this._ports=[],this.mark=0,this._routingSlot=0,this._startPosition=Number.NaN,this._endPosition=Number.NaN,this._incomingConnectionCoordinates=[],this._outgoingConnectionCoordinates=[],this._outgoingSegmentDependencies=[],this._outDepWeight=0,this._criticalOutDepWeight=0,this._incomingSegmentDependencies=[],this._inDepWeight=0,this._criticalInDepWeight=0,this._splitPartner=null,this._splitBy=null}addPortPositions(t,e){e.set(t,this),this._ports.push(t);let o=this._routingStrategy.getPortPositionOnHyperNode(t);t.getSide()===this._routingStrategy.getSourcePortSide()?Em(this._incomingConnectionCoordinates,o):Em(this._outgoingConnectionCoordinates,o),this.recomputeExtent();for(let r of t.getConnectedPorts())e.has(r)||this.addPortPositions(r,e)}getPorts(){return this._ports}getRoutingSlot(){return this._routingSlot}setRoutingSlot(t){this._routingSlot=t}getStartCoordinate(){return this._startPosition}getEndCoordinate(){return this._endPosition}getIncomingConnectionCoordinates(){return this._incomingConnectionCoordinates}getOutgoingConnectionCoordinates(){return this._outgoingConnectionCoordinates}getOutgoingSegmentDependencies(){return this._outgoingSegmentDependencies}getIncomingSegmentDependencies(){return this._incomingSegmentDependencies}getOutWeight(){return this._outDepWeight}setOutWeight(t){this._outDepWeight=t}getCriticalOutWeight(){return this._criticalOutDepWeight}setCriticalOutWeight(t){this._criticalOutDepWeight=t}getInWeight(){return this._inDepWeight}setInWeight(t){this._inDepWeight=t}getCriticalInWeight(){return this._criticalInDepWeight}setCriticalInWeight(t){this._criticalInDepWeight=t}getSplitPartner(){return this._splitPartner}setSplitPartner(t){this._splitPartner=t}getSplitBy(){return this._splitBy}setSplitBy(t){this._splitBy=t}getLength(){return this.getEndCoordinate()-this.getStartCoordinate()}representsHyperedge(){return this._incomingConnectionCoordinates.length+this._outgoingConnectionCoordinates.length>2}isDummy(){return this._splitPartner!=null&&this._splitBy==null}recomputeExtent(){this._startPosition=Number.NaN,this._endPosition=Number.NaN,this._recomputeExtentOne(this._incomingConnectionCoordinates),this._recomputeExtentOne(this._outgoingConnectionCoordinates)}_recomputeExtentOne(t){if(t.length===0)return;let e=t[0],o=t[t.length-1];this._startPosition=Number.isNaN(this._startPosition)?e:Math.min(this._startPosition,e),this._endPosition=Number.isNaN(this._endPosition)?o:Math.max(this._endPosition,o)}simulateSplit(){let t=new n(this._routingStrategy),e=new n(this._routingStrategy);return t._incomingConnectionCoordinates.push(...this._incomingConnectionCoordinates),t._splitBy=this._splitBy,t._splitPartner=e,t.recomputeExtent(),e._outgoingConnectionCoordinates.push(...this._outgoingConnectionCoordinates),e._splitPartner=t,e.recomputeExtent(),Gt.of(t,e)}splitAt(t){for(this._splitPartner=new n(this._routingStrategy),this._splitPartner.setSplitPartner(this),this._splitPartner._outgoingConnectionCoordinates.push(...this._outgoingConnectionCoordinates),this._outgoingConnectionCoordinates.length=0,this._outgoingConnectionCoordinates.push(t),this._splitPartner._incomingConnectionCoordinates.push(t),this.recomputeExtent(),this._splitPartner.recomputeExtent();this._incomingSegmentDependencies.length>0;)this._incomingSegmentDependencies[0].remove();for(;this._outgoingSegmentDependencies.length>0;)this._outgoingSegmentDependencies[0].remove();return this._splitPartner}compareTo(t){return this.mark-t.mark}toString(){let t=[];for(let e of this._ports){let o=e.getNode().getDesignation();o==null&&(o="n"+e.getNode().getIndex()),t.push(o)}return"{"+t.join(",")+"}"}};function Em(n,t){for(let e=0;e<n.length;e++){if(n[e]===t)return;if(n[e]>t){n.splice(e,0,t);return}}n.push(t)}var kg=class{constructor(t){this._routingGenerator=t}splitSegments(t,e,o){if(t.length===0)return;let r=this._findFreeAreas(e,o),s=[...this._decideWhichSegmentsToSplit(t)].sort((a,l)=>a.getLength()-l.getLength());for(let a of s)this._split(a,e,r,o)}_findFreeAreas(t,e){let o=[],r=[];for(let i of t){for(let s of i.getIncomingConnectionCoordinates())r.push(s);for(let s of i.getOutgoingConnectionCoordinates())r.push(s)}r.sort((i,s)=>i-s);for(let i=1;i<r.length;i++)r[i]-r[i-1]>=2*e&&o.push(new Za(r[i-1]+e,r[i]-e));return o}_decideWhichSegmentsToSplit(t){let e=new Set;for(let o of t){let r=o.getSource(),i=o.getTarget();if(e.has(r)||e.has(i))continue;let s=r,a=i;r.representsHyperedge()&&!i.representsHyperedge()&&(s=i,a=r),e.add(s),s.setSplitBy(a)}return e}_split(t,e,o,r){let i=this._computePositionToSplitAndUpdateFreeAreas(t,o,r);e.push(t.splitAt(i)),this._updateDependencies(t,e)}_updateDependencies(t,e){let o=t.getSplitBy(),r=t.getSplitPartner();$e.createAndAddCritical(t,o),$e.createAndAddCritical(o,r);for(let i of e)i!==o&&i!==t&&i!==r&&(this._routingGenerator.createDependencyIfNecessary(i,t),this._routingGenerator.createDependencyIfNecessary(i,r))}_computePositionToSplitAndUpdateFreeAreas(t,e,o){let r=-1,i=-1;for(let a=0;a<e.length;a++){let l=e[a];if(l.startPosition>t.getEndCoordinate())break;l.endPosition>=t.getStartCoordinate()&&(r<0&&(r=a),i=a)}let s=UT(t);if(r>=0){let a=this._chooseBestAreaIndex(t,e,r,i);s=Qu(e[a]),this._useArea(e,a,o)}return s}_chooseBestAreaIndex(t,e,o,r){let i=o;if(o<r){let s=t.simulateSplit(),a=s.getFirst(),l=s.getSecond(),c=e[i],g=this._rateArea(t,a,l,c);for(let h=o+1;h<=r;h++){let d=e[h],f=this._rateArea(t,a,l,d);this._isBetter(d,f,c,g)&&(c=d,g=f,i=h)}}return i}_rateArea(t,e,o,r){let i=Qu(r);e.getOutgoingConnectionCoordinates().length=0,e.getOutgoingConnectionCoordinates().push(i),o.getIncomingConnectionCoordinates().length=0,o.getIncomingConnectionCoordinates().push(i);let s=new t_(0,0);for(let a of t.getIncomingSegmentDependencies()){let l=a.getSource();this._updateConsideringBothOrderings(s,e,l),this._updateConsideringBothOrderings(s,o,l)}for(let a of t.getOutgoingSegmentDependencies()){let l=a.getTarget();this._updateConsideringBothOrderings(s,e,l),this._updateConsideringBothOrderings(s,o,l)}return s.dependencies+=2,s.crossings+=this._countCrossingsForSingleOrdering(e,t.getSplitBy()),s.crossings+=this._countCrossingsForSingleOrdering(t.getSplitBy(),o),s}_updateConsideringBothOrderings(t,e,o){let r=this._countCrossingsForSingleOrdering(e,o),i=this._countCrossingsForSingleOrdering(o,e);r===i?r>0&&(t.dependencies+=2,t.crossings+=r):(t.dependencies+=1,t.crossings+=Math.min(r,i))}_countCrossingsForSingleOrdering(t,e){return se.countCrossings(t.getOutgoingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate())+se.countCrossings(e.getIncomingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate())}_isBetter(t,e,o,r){return e.crossings<r.crossings||e.crossings===r.crossings&&(e.dependencies<r.dependencies||e.dependencies===r.dependencies&&t.size>o.size)}_useArea(t,e,o){let r=t[e];if(t.splice(e,1),r.size/2>=o){let i=e,s=Qu(r),a=s-o;r.startPosition<=a&&t.splice(i++,0,new Za(r.startPosition,a));let l=s+o;l<=r.endPosition&&t.splice(i,0,new Za(l,r.endPosition))}}},Za=class{constructor(t,e){this.startPosition=t,this.endPosition=e,this.size=e-t}},t_=class{constructor(t,e){this.dependencies=t,this.crossings=e}};function UT(n){return(n.getStartCoordinate()+n.getEndCoordinate())/2}function Qu(n){return(n.startPosition+n.endPosition)/2}var Hi=class{constructor(){this._createdJunctionPoints=new Set}addJunctionPointIfNecessary(t,e,o,r){let i=r?o.y:o.x;if(this._createdJunctionPoints.has(o.x+","+o.y))return;let s=i>e.getStartCoordinate()&&i<e.getEndCoordinate(),a=!1,l=e.getIncomingConnectionCoordinates(),c=e.getOutgoingConnectionCoordinates();if(l.length>0&&c.length>0&&(a=a||Math.abs(i-l[0])<se.TOLERANCE&&Math.abs(i-c[0])<se.TOLERANCE,a=a||Math.abs(i-l[l.length-1])<se.TOLERANCE&&Math.abs(i-c[c.length-1])<se.TOLERANCE),s||a){let g=t.getProperty(_.JUNCTION_POINTS);g==null&&(g=new st,t.setProperty(_.JUNCTION_POINTS,g));let h=o.clone?o.clone():{x:o.x,y:o.y};g.add(h),this._createdJunctionPoints.add(h.x+","+h.y)}}getCreatedJunctionPoints(){return this._createdJunctionPoints}clearCreatedJunctionPoints(){this._createdJunctionPoints.clear()}getPortPositionOnHyperNode(t){throw new Error("Abstract method")}getSourcePortSide(){throw new Error("Abstract method")}getTargetPortSide(){throw new Error("Abstract method")}calculateBendPoints(t,e,o){throw new Error("Abstract method")}};var Wg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().x+t.getPosition().x+t.getAnchor().x}getSourcePortSide(){return u.SOUTH}getTargetPortSide(){return u.NORTH}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e+t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().x;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().x;if(Math.abs(s-c)<=se.TOLERANCE)continue;let g=r,h=t,d=new O(s,g);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1),g=e+f.getRoutingSlot()*o,h=f,d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}d=new O(c,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}}}};var qe=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};qe.WEST_TO_EAST=new qe("WEST_TO_EAST");qe.NORTH_TO_SOUTH=new qe("NORTH_TO_SOUTH");qe.SOUTH_TO_NORTH=new qe("SOUTH_TO_NORTH");var zg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().x+t.getPosition().x+t.getAnchor().x}getSourcePortSide(){return u.NORTH}getTargetPortSide(){return u.SOUTH}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e-t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().x;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().x;if(Math.abs(s-c)<=se.TOLERANCE)continue;let g=r,h=t,d=new O(s,g);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1),g=e-f.getRoutingSlot()*o,h=f,d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}d=new O(c,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}}}};var Yg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().y+t.getPosition().y+t.getAnchor().y}getSourcePortSide(){return u.EAST}getTargetPortSide(){return u.WEST}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e+t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().y;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().y;if(Math.abs(s-c)<=se.TOLERANCE)continue;let g=r,h=t,d=new O(g,s);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(g,E),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0),g=e+f.getRoutingSlot()*o,h=f,d=new O(g,E),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0)}d=new O(g,c),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0)}}}};function mm(n){switch(n){case qe.WEST_TO_EAST:return new Yg;case qe.NORTH_TO_SOUTH:return new Wg;case qe.SOUTH_TO_NORTH:return new zg;default:throw new Error("Unknown routing direction: "+n)}}var ja=-1,FT=.5,kT=.2,Pm=1,Om=16,se=class n{constructor(t,e,o=null){this._routingStrategy=mm(t),this._edgeSpacing=e,this._conflictThreshold=FT*e,this._criticalConflictThreshold=0,this._debugPrefix=o,this._segmentSplitter=null}routeEdges(t,e,o,r,i,s){let a=new Map,l=[];this._createHyperEdgeSegments(o,this._routingStrategy.getSourcePortSide(),l,a),this._createHyperEdgeSegments(i,this._routingStrategy.getTargetPortSide(),l,a),this._criticalConflictThreshold=kT*this._minimumHorizontalSegmentDistance(l);let c=0;for(let d=0;d<l.length-1;d++){let f=l[d];for(let E=d+1;E<l.length;E++)c+=this.createDependencyIfNecessary(f,l[E])}let g=e.getProperty(p.RANDOM);c>=2&&this._breakCriticalCycles(l,g),n.breakNonCriticalCycles(l,g),n._topologicalNumbering(l);let h=-1;for(let d of l)Math.abs(d.getStartCoordinate()-d.getEndCoordinate())<n.TOLERANCE||(h=Math.max(h,d.getRoutingSlot()),this._routingStrategy.calculateBendPoints(d,s,this._edgeSpacing));return this._routingStrategy.clearCreatedJunctionPoints(),h+1}_createHyperEdgeSegments(t,e,o,r){if(t!=null)for(let i of t)for(let s of i.getPorts(W.OUTPUT,e)){let a=r.get(s);a==null&&(a=new An(this._routingStrategy),o.push(a),a.addPortPositions(s,r))}}createDependencyIfNecessary(t,e){if(Math.abs(t.getStartCoordinate()-t.getEndCoordinate())<n.TOLERANCE||Math.abs(e.getStartCoordinate()-e.getEndCoordinate())<n.TOLERANCE)return 0;let o=this._countConflicts(t.getOutgoingConnectionCoordinates(),e.getIncomingConnectionCoordinates()),r=this._countConflicts(e.getOutgoingConnectionCoordinates(),t.getIncomingConnectionCoordinates()),i=o===ja||r===ja,s=0;if(i)o===ja&&($e.createAndAddCritical(e,t),s++),r===ja&&($e.createAndAddCritical(t,e),s++);else{let a=n.countCrossings(t.getOutgoingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate());a+=n.countCrossings(e.getIncomingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate());let l=n.countCrossings(e.getOutgoingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate());l+=n.countCrossings(t.getIncomingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate());let c=Pm*o+Om*a,g=Pm*r+Om*l;c<g?$e.createAndAddRegular(t,e,g-c):c>g?$e.createAndAddRegular(e,t,c-g):c>0&&g>0&&($e.createAndAddRegular(t,e,0),$e.createAndAddRegular(e,t,0))}return s}_countConflicts(t,e){let o=0;if(t.length===0||e.length===0)return 0;let r=0,i=0,s=t[r],a=e[i],l=!0;do{if(s>a-this._criticalConflictThreshold&&s<a+this._criticalConflictThreshold)return ja;s>a-this._conflictThreshold&&s<a+this._conflictThreshold&&o++,s<=a&&r+1<t.length?s=t[++r]:a<=s&&i+1<e.length?a=e[++i]:l=!1}while(l);return o}static countCrossings(t,e,o){let r=0;for(let i of t){if(i>o)break;i>=e&&r++}return r}_minimumHorizontalSegmentDistance(t){let e=[],o=[];for(let s of t){for(let a of s.getIncomingConnectionCoordinates())e.push(a);for(let a of s.getOutgoingConnectionCoordinates())o.push(a)}let r=n._minimumDifference(e),i=n._minimumDifference(o);return Math.min(r,i)}static _minimumDifference(t){let e=[...new Set(t)].sort((r,i)=>r-i),o=Number.MAX_VALUE;for(let r=1;r<e.length;r++)o=Math.min(o,e[r]-e[r-1]);return o}_breakCriticalCycles(t,e){let o=Ka.detectCycles(t,!0,e);this._segmentSplitter==null&&(this._segmentSplitter=new kg(this)),this._segmentSplitter.splitSegments(o,t,this._criticalConflictThreshold)}static breakNonCriticalCycles(t,e){let o=Ka.detectCycles(t,!1,e);for(let r of o)r.getWeight()===0?r.remove():r.reverse()}static _topologicalNumbering(t){let e=[],o=[];for(let i of t)i.setInWeight(i.getIncomingSegmentDependencies().length),i.setOutWeight(i.getOutgoingSegmentDependencies().length),i.getInWeight()===0&&e.push(i),i.getOutWeight()===0&&i.getIncomingConnectionCoordinates().length===0&&o.push(i);let r=-1;for(;e.length>0;){let i=e.shift();for(let s of i.getOutgoingSegmentDependencies()){let a=s.getTarget();a.setRoutingSlot(Math.max(a.getRoutingSlot(),i.getRoutingSlot()+1)),r=Math.max(r,a.getRoutingSlot()),a.setInWeight(a.getInWeight()-1),a.getInWeight()===0&&e.push(a)}}if(r>-1){for(let i of o)i.setRoutingSlot(r);for(;o.length>0;){let i=o.shift();for(let s of i.getIncomingSegmentDependencies()){let a=s.getSource();a.getIncomingConnectionCoordinates().length>0||(a.setRoutingSlot(Math.min(a.getRoutingSlot(),i.getRoutingSlot()-1)),a.setOutWeight(a.getOutWeight()-1),a.getOutWeight()===0&&o.push(a))}}}}};se.TOLERANCE=.001;function Ls(n){let t=n.getProperty(p.EXT_PORT_SIDE);return n.getType()===y.EXTERNAL_PORT&&(t===u.WEST||t===u.EAST)}var Vg=class{getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);if(!e)return null;let o=K.create(),r=!1;return e.has(v.HYPEREDGES)&&(o.addBefore(D.P4_NODE_PLACEMENT,w.HYPEREDGE_DUMMY_MERGER),o.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR),r=!0),(e.has(v.NON_FREE_PORTS)||t.getProperty(_.FEEDBACK_EDGES))&&(o.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR),e.has(v.NORTH_SOUTH_PORTS)&&(o.addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)),r=!0),e.has(v.EXTERNAL_PORTS)&&(o.addBefore(D.P3_NODE_ORDERING,w.HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR),o.addBefore(D.P4_NODE_PLACEMENT,w.HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER),r=!0),e.has(v.SELF_LOOPS)&&(o.addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR),o.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER),o.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER),o.addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR),r=!0),e.has(v.HYPERNODES)&&(o.addAfter(D.P5_EDGE_ROUTING,w.HYPERNODE_PROCESSOR),r=!0),e.has(v.CENTER_LABELS)&&(o.addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER),o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER),o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),o.addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER),r=!0),e.has(v.END_LABELS)&&(o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),o.addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR),r=!0),r?o:null}process(t,e){e&&e.begin&&e.begin("Orthogonal edge routing",1);let o=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),r=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),s=new se(qe.WEST_TO_EAST,r,null),a=0,l=t.getLayers(),c=-1,g=null,h=null,d=-1;for(;;){c++;let f=c<l.length?l[c]:null,E=f==null?null:f.getNodes(),P=c-1;g!=null&&(z.placeNodesHorizontally(g,a),a+=g.getSize().x);let S=g==null?a:a+i,T=s.routeEdges(e,t,h,d,E,S),N=g==null||h.every(Ls),I=f==null||E.every(Ls);if(T>0){let C=(T-1)*r;g!=null&&(C+=i),f!=null&&(C+=i),C<o&&!N&&!I&&(C=o),a+=C}else!N&&!I&&(a+=o);if(g=f,h=E,d=P,f==null)break}t.getSize().x=a,e&&e.done&&e.done()}};var Cn=class n{constructor(t,e,o){if(this.handled=!1,this.leftPorts=new Set,this.rightPorts=new Set,this.outgoing=[],this.incoming=[],this.mark=0,this.inweight=0,this.outweight=0,this.rank=0,this.edges=new Set,this.boundingBox=new dt,this.isWestOfInitialLayer=!1,this.xDelta=0,this.sourcePort=null,this.targetPort=null,this.initialSegment=!1,this.lastSegment=!1,this.sourceNode=null,this.targetNode=null,this.inverseOrder=!1,this.hyperEdgeTopYPos=0,this.hyperEdgeBottomYPos=0,this.centerControlPointY=0,this.edgeInformation=new Map,e instanceof Set||Array.isArray(e)){let r=t,i=e;o===Fe.LEFT?this.leftPorts.add(r):this.rightPorts.add(r);let a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of i){let h=g.getFirst(),d=g.getSecond(),f=d.getSource();f===r&&(f=d.getTarget()),h===Fe.LEFT?this.leftPorts.add(f):this.rightPorts.add(f);let E=n._anchorY(f);a=Math.min(a,E),l=Math.max(l,E)}let c=n._anchorY(r);this._setRelevantPositions(c,a,l);for(let g of i)this._addEdge(g.getSecond());this.isStraight=!1}else{let r=t,i=e,s=o;i===Fe.LEFT?this.leftPorts.add(r.getSource()):this.rightPorts.add(r.getSource()),s===Fe.LEFT?this.leftPorts.add(r.getTarget()):this.rightPorts.add(r.getTarget()),this._addEdge(r);let a=n._anchorY(r.getSource()),l=n._anchorY(r.getTarget());this._setRelevantPositions(a,l,l),this.isStraight=Math.abs(a-l)<WT}}_addEdge(t){this.edges.add(t);let e=new e_;this.edgeInformation.set(t,e),e.startY=n._anchorY(t.getSource()),e.endY=n._anchorY(t.getTarget()),e.normalSourceNode=n._isNormalNode(t.getSource().getNode()),e.normalTargetNode=n._isNormalNode(t.getTarget().getNode()),e.invertedLeft=t.getSource().getSide()===u.WEST,e.invertedRight=t.getTarget().getSide()===u.EAST}static _anchorY(t){return u.SIDES_NORTH_SOUTH.has(t.getSide())?t.getProperty(p.SPLINE_NS_PORT_Y_COORD):t.getAbsoluteAnchor().y}static _isNormalNode(t){let e=t.getType();return e===y.NORMAL||e===y.BREAKING_POINT}isHyperEdge(){return this.edges.size>1}compareTo(t){return this.mark-t.mark}_setRelevantPositions(t,e,o){this.boundingBox.y=Math.min(t,e),this.boundingBox.height=Math.max(t,o)-this.boundingBox.y,t<e?(this.centerControlPointY=Sm*(t+e),this.hyperEdgeTopYPos=Xg*this.centerControlPointY+$a*t,this.hyperEdgeBottomYPos=Xg*this.centerControlPointY+$a*e):(this.centerControlPointY=Sm*(t+o),this.hyperEdgeTopYPos=Xg*this.centerControlPointY+$a*o,this.hyperEdgeBottomYPos=Xg*this.centerControlPointY+$a*t)}},e_=class{constructor(){this.startY=0,this.endY=0,this.normalSourceNode=!1,this.normalTargetNode=!1,this.invertedLeft=!1,this.invertedRight=!1}},Fe=Object.freeze({LEFT:"LEFT",RIGHT:"RIGHT"}),WT=.2,$a=.9,Xg=1-$a,Sm=.5;var zT=.2,vi=class n{constructor(){this.edgesRemainingLayer=[],this.splineSegmentsLayer=[],this.leftPortsLayer=new Set,this.rightPortsLayer=new Set,this.selfLoopsLayer=new Set,this.lGraph=null,this.startEdges=[],this.allSplineSegments=[],this.edgeToSegmentMap=new Map,this.successingEdge=new Map}getLayoutProcessorConfiguration(t){let e=K.create();e.addAll(YT());let o=t.getProperty(p.GRAPH_PROPERTIES);return o&&o.has(v.SELF_LOOPS)&&e.addAll(VT()),o&&o.has(v.CENTER_LABELS)&&e.addAll(XT()),o&&o.has(v.NORTH_SOUTH_PORTS)&&e.addAll(KT()),o&&o.has(v.END_LABELS)&&e.addAll(ZT()),e}process(t,e){if(e&&e.begin&&e.begin("Spline edge routing",1),t.getLayers().length===0){t.getSize().x=0,e&&e.done&&e.done();return}let o=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),r=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),a=t.getProperty(_.EDGE_ROUTING_SPLINES_MODE)===Qr.SLOPPY,l=t.getProperty(_.EDGE_ROUTING_SPLINES_SLOPPY_LAYER_SPACING_FACTOR);this.lGraph=t,this.startEdges=[],this.allSplineSegments=[],this.successingEdge.clear();let c=t.getLayers(),g=c[0],h=g.getNodes().every(Ls),d=c[c.length-1],f=d.getNodes().every(Ls),E=0,P=null,S,T=0;do{S=E<c.length?c[E++]:null,this._clearThenFillMappings(P,S),this._createSegmentsAndComputeRanking();let N=0;for(let A of this.splineSegmentsLayer)!A.isStraight&&A.rank+1>N&&(N=A.rank+1);let I=0,C=T,x=P===null||h&&P===g,M=S===null||f&&S===d;if(N>0){let A=0;P!==null&&(A+=r),A+=(N-1)*i,S!==null&&(A+=r),a&&S!==null&&(A=Math.max(A,n._computeSloppySpacing(S,i,o,l))),A<o&&!x&&!M&&(I=(o-A)/2,A=o),C+=A}else!x&&!M&&(C+=o);S!==null&&z.placeNodesHorizontally(S,C);for(let A of this.splineSegmentsLayer)A.boundingBox.x=T,A.boundingBox.width=C-T,A.xDelta=I,A.isWestOfInitialLayer=P===null;for(let A of this.splineSegmentsLayer)this.allSplineSegments.push(A);T=C,S!==null&&(T+=S.getSize().x),P=S}while(S!==null);for(let N of this.startEdges){let I=this._getEdgeChain(N);N.setProperty(p.SPLINE_EDGE_CHAIN,I);let C=this._getSplinePath(N);N.setProperty(p.SPLINE_ROUTE_START,C)}t.getSize().x=T,this.lGraph=null,e&&e.done&&e.done()}_createSegmentsAndComputeRanking(){this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.LEFT,!0,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.LEFT,!1,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.RIGHT,!0,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.RIGHT,!1,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegments(this.edgesRemainingLayer,this.leftPortsLayer,this.rightPortsLayer,this.splineSegmentsLayer);for(let t=0;t<this.splineSegmentsLayer.length;t++){let e=this.splineSegmentsLayer[t];for(let o=t+1;o<this.splineSegmentsLayer.length;o++){let r=this.splineSegmentsLayer[o];n._createDependency(e,r)}}n._breakCycles(this.splineSegmentsLayer,this.lGraph.getProperty(p.RANDOM)),n._topologicalNumbering(this.splineSegmentsLayer)}_clearThenFillMappings(t,e){if(this.leftPortsLayer.clear(),this.rightPortsLayer.clear(),this.edgesRemainingLayer=[],this.splineSegmentsLayer=[],this.selfLoopsLayer.clear(),t!==null)for(let o of t.getNodes())for(let r of o.getPorts(u.EAST)){this.leftPortsLayer.add(r);for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;this.edgesRemainingLayer.push(i),this._findAndAddSuccessor(i),n.isQualifiedAsStartingNode(i.getSource().getNode())&&this.startEdges.push(i);let s=i.getTarget(),a=s.getNode().getLayer();if(a===e)this.rightPortsLayer.add(s);else if(a===t)this.leftPortsLayer.add(s);else{let l=this.edgesRemainingLayer.indexOf(i);l>=0&&this.edgesRemainingLayer.splice(l,1)}}}if(e!==null)for(let o of e.getNodes()){for(let r of o.getPorts())for(let i of r.getOutgoingEdges())i.isSelfLoop()&&this.selfLoopsLayer.add(i);for(let r of o.getPorts(u.WEST)){this.rightPortsLayer.add(r);for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;this.edgesRemainingLayer.push(i),this._findAndAddSuccessor(i),n.isQualifiedAsStartingNode(i.getSource().getNode())&&this.startEdges.push(i);let s=i.getTarget(),a=s.getNode().getLayer();if(a===e)this.rightPortsLayer.add(s);else if(a===t)this.leftPortsLayer.add(s);else{let l=this.edgesRemainingLayer.indexOf(i);l>=0&&this.edgesRemainingLayer.splice(l,1)}}}}}static _computeSloppySpacing(t,e,o,r){let i=0;for(let s of t.getNodes()){let a=0;for(let l of s.getIncomingEdges()){let c=l.getSource().getAbsoluteAnchor().y,g=l.getTarget().getAbsoluteAnchor().y;a=Math.max(a,Math.abs(g-c))}i=Math.max(i,a)}return r*Math.min(1,e/o)*i}_findAndAddSuccessor(t){let e=t.getTarget().getNode();if(n.isNormalNode(e))return;let r=e.getOutgoingEdges()[Symbol.iterator]().next();r.done||this.successingEdge.set(t,r.value)}_createSplineSegments(t,e,o,r){for(let i of t){let s=i.getSource(),a;if(e.has(s))a=Fe.LEFT;else if(o.has(s))a=Fe.RIGHT;else throw new Error("Source port must be in one of the port sets.");let l=i.getTarget(),c;if(e.has(l))c=Fe.LEFT;else if(o.has(l))c=Fe.RIGHT;else throw new Error("Target port must be in one of the port sets.");let g=new Cn(i,a,c);this.edgeToSegmentMap.set(i,g),r.push(g)}}_createSplineSegmentsForHyperEdges(t,e,o,r,i,s){let a;o===Fe.LEFT?a=t:a=e;for(let l of a){let c=l.getAbsoluteAnchor().y,g=new Set,h=new Set;for(let d of l.getConnectedEdges()){if(!!d.getProperty(p.REVERSED)!=!!r||!i.includes(d))continue;let f;d.getTarget()===l?f=d.getSource():f=d.getTarget();let E=f.getAbsoluteAnchor().y;n.isStraight(E,c)||(E<c?t.has(f)?g.add(Gt.of(Fe.LEFT,d)):g.add(Gt.of(Fe.RIGHT,d)):t.has(f)?h.add(Gt.of(Fe.LEFT,d)):h.add(Gt.of(Fe.RIGHT,d)))}if(g.size>1){let d=new Cn(l,g,o);for(let f of g)this.edgeToSegmentMap.set(f.getSecond(),d);s.push(d);for(let f of g){let E=i.indexOf(f.getSecond());E>=0&&i.splice(E,1)}}if(h.size>1){let d=new Cn(l,h,o);for(let f of h)this.edgeToSegmentMap.set(f.getSecond(),d);s.push(d);for(let f of h){let E=i.indexOf(f.getSecond());E>=0&&i.splice(E,1)}}}}static _isBetween(t,e,o){return Math.abs(e-t)<1e-8||Math.abs(o-t)<1e-8?!0:e-t>1e-8?t-o>1e-8:o-t>1e-8}static _createDependency(t,e){if(t.hyperEdgeTopYPos>e.hyperEdgeBottomYPos||e.hyperEdgeTopYPos>t.hyperEdgeBottomYPos)return;let o=0,r=0;for(let i of t.rightPorts)n._isBetween(i.getAbsoluteAnchor().y,e.hyperEdgeTopYPos,e.hyperEdgeBottomYPos)&&o++;for(let i of t.leftPorts)n._isBetween(i.getAbsoluteAnchor().y,e.hyperEdgeTopYPos,e.hyperEdgeBottomYPos)&&o--;for(let i of e.rightPorts)n._isBetween(i.getAbsoluteAnchor().y,t.hyperEdgeTopYPos,t.hyperEdgeBottomYPos)&&r++;for(let i of e.leftPorts)n._isBetween(i.getAbsoluteAnchor().y,t.hyperEdgeTopYPos,t.hyperEdgeBottomYPos)&&r--;o<r?new xn(t,e,r-o):r<o?new xn(e,t,o-r):(new xn(e,t,0),new xn(t,e,0))}static _breakCycles(t,e){let o=[],r=[],i=-1;for(let d of t){d.mark=i--;let f=0,E=0;for(let P of d.outgoing)E+=P.weight;for(let P of d.incoming)f+=P.weight;d.inweight=f,d.outweight=E,E===0?r.push(d):f===0&&o.push(d)}let s=new Set(t),a=t.length,l=a+1,c=a-1,g=[];for(;s.size>0;){for(;r.length>0;){let f=r.shift();s.delete(f),f.mark=c--,n._updateNeighbors(f,o,r)}for(;o.length>0;){let f=o.shift();s.delete(f),f.mark=l++,n._updateNeighbors(f,o,r)}let d=Number.MIN_SAFE_INTEGER;for(let f of s){let E=f.outweight-f.inweight;E>=d&&(E>d&&(g.length=0,d=E),g.push(f))}if(g.length>0){let f=g[e.nextInt(g.length)];s.delete(f),f.mark=l++,n._updateNeighbors(f,o,r),g.length=0}}let h=t.length+1;for(let d of t)d.mark<a&&(d.mark+=h);for(let d of t){let f=d.outgoing.slice();for(let E of f){let P=E.target;if(d.mark>P.mark){let S=d.outgoing.indexOf(E);S>=0&&d.outgoing.splice(S,1);let T=P.incoming.indexOf(E);T>=0&&P.incoming.splice(T,1),E.weight>0&&(E.source=P,P.outgoing.push(E),E.target=d,d.incoming.push(E))}}}}static _updateNeighbors(t,e,o){for(let r of t.outgoing)r.target.mark<0&&r.weight>0&&(r.target.inweight-=r.weight,r.target.inweight<=0&&r.target.outweight>0&&e.push(r.target));for(let r of t.incoming)r.source.mark<0&&r.weight>0&&(r.source.outweight-=r.weight,r.source.outweight<=0&&r.source.inweight>0&&o.push(r.source))}static _topologicalNumbering(t){let e=[],o=[];for(let i of t)i.rank=0,i.inweight=i.incoming.length,i.outweight=i.outgoing.length,i.inweight===0&&e.push(i),i.outweight===0&&i.leftPorts.size===0&&o.push(i);let r=-1;for(;e.length>0;){let i=e.shift();for(let s of i.outgoing){let a=s.target;a.rank=Math.max(a.rank,i.rank+1),r=Math.max(r,a.rank),a.inweight--,a.inweight===0&&e.push(a)}}if(r>-1){for(let i of o)i.rank=r;for(;o.length>0;){let i=o.shift();for(let s of i.incoming){let a=s.source;a.leftPorts.size>0||(a.rank=Math.min(a.rank,i.rank-1),a.outweight--,a.outweight===0&&o.push(a))}}}}static isStraight(t,e){return Math.abs(t-e)<zT}_getEdgeChain(t){let e=[],o=t;do e.push(o),o=this.successingEdge.get(o)||null;while(o!==null);return e}_getSplinePath(t){let e=[],o=t;do{let s=this.edgeToSegmentMap.get(o);s.sourcePort=o.getSource(),s.targetPort=o.getTarget(),e.push(s),o=this.successingEdge.get(o)||null}while(o!==null);let r=e[0];r.initialSegment=!0,r.sourceNode=r.edges.values().next().value.getSource().getNode();let i=e[e.length-1];return i.lastSegment=!0,i.targetNode=i.edges.values().next().value.getTarget().getNode(),e}static isNormalNode(t){let e=t.getType();return e===y.NORMAL||e===y.BREAKING_POINT}static isQualifiedAsStartingNode(t){let e=t.getType();return e===y.NORMAL||e===y.NORTH_SOUTH_PORT||e===y.EXTERNAL_PORT||e===y.BREAKING_POINT}};vi.SPLINE_DIMENSION=3;var xn=class{constructor(t,e,o){this.source=t,this.target=e,this.weight=o,t.outgoing.push(this),e.incoming.push(this)}};function YT(){return K.create().addAfter(D.P5_EDGE_ROUTING,w.FINAL_SPLINE_BENDPOINTS_CALCULATOR).addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR)}function VT(){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER).addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER)}function XT(){return K.create().addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR).addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER)}function KT(){return K.create().addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR).addBefore(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)}function ZT(){return K.create().addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR).addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR)}var ne=class{},Dn=1e-8;ne.HALF_PI=Math.PI/2;ne.QUATER_PI=ne.HALF_PI/2;ne.THREE_HALF_PI=ne.HALF_PI*3;ne.TWO_PI=2*Math.PI;ne.THREE=3;ne.intersect=function(t,e,o,r){return typeof o=="number"?ne._intersect4(t,new O(o).add(t),e,new O(r).add(e)):ne._intersect4(t,e,o,r)};ne._intersect4=function(t,e,o,r){let i=t.x,s=t.y,a=e.x,l=e.y,c=o.x,g=o.y,h=r.x,d=r.y,f=(i-a)*(g-d)-(s-l)*(c-h);if(Math.abs(f)<Dn)return null;let E=i*l-s*a,P=c*d-g*h,S=(E*(c-h)-P*(i-a))/f,T=(E*(g-d)-P*(s-l))/f;return new O(S,T)};ne.innerAngle=function(t,e){if(typeof t=="number")return Math.abs(t-e)%Math.PI;let o=t,r=e;return Math.acos((o.x*r.x+o.y*r.y)/(o.length()*r.length()))};ne.lengthToOrthogonal=function(t,e){let o=ne.innerAngle(t,e.toRadians()),r=1;return o>ne.HALF_PI&&(r=-1,o=o-ne.QUATER_PI),r*Math.cos(o)*e.length()};ne.portSideToDirection=function(t){switch(t){case u.NORTH:return ne.THREE_HALF_PI;case u.EAST:return 0;case u.SOUTH:return ne.HALF_PI;case u.WEST:return Math.PI;default:return 0}};ne.distPortToNodeEdge=function(t,e){let o=t.getPosition().clone().add(t.getAnchor()),r=t.getNode().getSize();switch(e){case u.NORTH:return-o.y;case u.EAST:return-o.x+r.x;case u.SOUTH:return-o.y+r.y;case u.WEST:return-o.x;default:return 0}};ne.isBetween=function(t,e,o){return Math.abs(e-t)<Dn||Math.abs(o-t)<Dn?!0:e-t>Dn?t-o>Dn:o-t>Dn};ne.getMarginOnPortSide=function(t,e){let o=t.getMargin();switch(e){case u.NORTH:return o.top;case u.EAST:return o.right;case u.SOUTH:return o.bottom;case u.WEST:return o.left;default:return 0}};var jT=.5,Tm=5,$T=.4,Kg=class n{constructor(){this.edgeEdgeSpacing=0,this.edgeNodeSpacing=0,this.splineRoutingMode=null,this.compactionStrategy=null}process(t,e){e&&e.begin&&e.begin("Spline bendpoints",1),this.edgeEdgeSpacing=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this.edgeNodeSpacing=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this.splineRoutingMode=t.getProperty(_.EDGE_ROUTING_SPLINES_MODE),this.compactionStrategy=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY),this._indexNodesPerLayer(t);let o=[];for(let r of t.getLayers())for(let i of r.getNodes())for(let s of i.getOutgoingEdges())s.isSelfLoop()||s.hasProperty(p.SPLINE_ROUTE_START)&&o.push(s);for(let r of o){let i=r.getProperty(p.SPLINE_ROUTE_START);for(let s of i)this._calculateControlPoints(s);r.setProperty(p.SPLINE_ROUTE_START,null)}for(let r of o){let i=r.getProperty(p.SPLINE_SURVIVING_EDGE),s=r.getProperty(p.SPLINE_EDGE_CHAIN);this._calculateBezierBendPoints(s,i),r.setProperty(p.SPLINE_EDGE_CHAIN,null)}e&&e.done&&e.done()}_indexNodesPerLayer(t){for(let e of t.getLayers()){let o=0;for(let r of e.getNodes())r.id=o++}}_calculateControlPoints(t){if(!t.handled){t.handled=!0;for(let e of t.edges){if(t.isStraight&&!t.isHyperEdge()){this._calculateControlPointsStraight(t);continue}let o=t.edgeInformation.get(e);if(o.invertedLeft||o.invertedRight){this._calculateControlPointsInvertedEdge(e,t);continue}this.splineRoutingMode===Qr.SLOPPY&&(o.normalSourceNode||o.normalTargetNode)&&this._segmentAllowsSloppyRouting(t)&&!t.isHyperEdge()?this._calculateControlPointsSloppy(e,t):this._calculateControlPointsConservative(e,t)}if(t.inverseOrder)for(let e of t.edges)e.getBendPoints().reverse()}}_calculateControlPointsStraight(t){let e=t.boundingBox.x,o=t.boundingBox.x+t.boundingBox.width,r=new O(e+(o-e)/2,t.centerControlPointY);t.edges.values().next().value.getBendPoints().push(r)}_calculateControlPointsInvertedEdge(t,e){let o=e.boundingBox.x,r=e.boundingBox.x+e.boundingBox.width,i=e.edgeInformation.get(t),s=i.startY,a=i.endY,l,c;i.invertedLeft?l=new O(r,s):l=new O(o,s),i.invertedRight?c=new O(o,a):c=new O(r,a);let g=o;e.isWestOfInitialLayer||(g+=this.edgeNodeSpacing),g+=e.xDelta+e.rank*this.edgeEdgeSpacing;let h=new O(g,s),d=new O(g,a),f=t.getBendPoints();if(f.push(l,h),e.edges.size>1){let P=new O(g,e.centerControlPointY);f.push(P)}f.push(d,c)}_calculateControlPointsConservative(t,e){let o=e.boundingBox.x,r=e.boundingBox.x+e.boundingBox.width,i=e.edgeInformation.get(t),s=i.startY,a=i.endY,l=new O(o,s),c=new O(r,a),g=o;e.isWestOfInitialLayer||(g+=this.edgeNodeSpacing),g+=e.xDelta+e.rank*this.edgeEdgeSpacing;let h=new O(g,s),d=new O(g,a),f=t.getBendPoints();if(f.push(l,h),e.edges.size>1){let P=new O(g,e.centerControlPointY);f.push(P)}f.push(d,c)}_calculateControlPointsSloppy(t,e){let o=e.edgeInformation.get(t),r=e.boundingBox.x,i=e.boundingBox.x+e.boundingBox.width,s=o.startY,a=o.endY,l=s<a,c=new O(r,s),g=new O(i,a),h=(r+i)/2,d=new O(h,s),f=new O(h,a),E=this._computeSloppyCenterY(t,s,a),P=e.sourcePort.getAbsoluteAnchor(),S=new O(h,E),T=e.targetPort.getAbsoluteAnchor(),N=Ft.approximateBezierSegment(2,P,S,T),I=!1,C=e.sourcePort.getNode();if(C!==null&&C.getLayer()!==null&&o.normalSourceNode)if(!(l&&C.id<C.getLayer().getNodes().length-1||!l&&C.id>0))I=!0;else{let Y=C.id;l?Y++:Y--;let j=C.getLayer().getNodes()[Y],X=n._nodeToBoundingBox(j);I=!(Ft.intersects(X,P,N[0])||Ft.contains(X,P,N[0]))}let x=!1,M=e.targetPort.getNode();if(M!==null&&M.getLayer()!==null&&o.normalTargetNode)if(!(l&&M.id>0||!l&&M.id<M.getLayer().getNodes().length-1))x=!0;else{let Y=M.id;l?Y--:Y++;let j=M.getLayer().getNodes()[Y],X=n._nodeToBoundingBox(j);x=!(Ft.intersects(X,N[0],T)||Ft.contains(X,N[0],T))}let A=t.getBendPoints();I&&x&&A.push(S),I||A.push(c,d),x||A.push(f,g)}static _nodeToBoundingBox(t){let e=t.getPosition(),o=t.getSize(),r=t.getMargin();return new dt(e.x-r.left,e.y-r.top,o.x+r.getHorizontal(),o.y+r.getVertical())}_computeSloppyCenterY(t,e,o){let r=0,i=0;if(t.getSource()!==null)for(let a of t.getTarget().getNode().getPorts())r+=a.getIncomingEdges().length;else r=1;if(t.getTarget()!==null)for(let a of t.getSource().getNode().getPorts())i+=a.getOutgoingEdges().length;else i=1;let s=Math.sign(i-r);return(o+e)/2+(o-e)*($T*s)}_calculateBezierBendPoints(t,e){if(!t||t.length===0)return;let o=new st,r=e!=null?e:t[0],i=r.getSource();if(!vi.isQualifiedAsStartingNode(i.getNode()))throw new Error("The source node of the edge must be a normal node or a northSouthPort.");if(o.addLast(i.getAbsoluteAnchor()),u.SIDES_NORTH_SOUTH.has(i.getSide())){let d=i.getProperty(p.SPLINE_NS_PORT_Y_COORD),f=new O(i.getAbsoluteAnchor().x,d);o.addLast(f)}let s=null,a=!1;for(let d of t){let f=d.getBendPoints();if(f.length>0){if(a){let E=s.add(f.getFirst()).scale(jT);o.addLast(E),a=!1}else a=!0;s=f.getLast().clone();for(let E of f)o.addLast(E);f.length=0}}let l=r.getTarget();if(u.SIDES_NORTH_SOUTH.has(l.getSide())){let d=l.getProperty(p.SPLINE_NS_PORT_Y_COORD),f=new O(l.getAbsoluteAnchor().x,d);o.addLast(f)}o.addLast(l.getAbsoluteAnchor()),this.splineRoutingMode===Qr.CONSERVATIVE&&n._insertStraighteningControlPoints(o,i,l);let g=new Rs(!0,vi.SPLINE_DIMENSION,o).getBezierCP(),h=r.getBendPoints();for(let d of g)h.push(d)}static _insertStraighteningControlPoints(t,e,o){let r=t.getFirst(),i=t[1],s=new O(ne.portSideToDirection(e.getSide()));s.scale(Tm);let a=i.clone().sub(r),l=new O(n._absMin(s.x,a.x),n._absMin(s.y,a.y));l.add(r),t.splice(1,0,l);let c=t.getLast(),g=t[t.length-2];s=new O(ne.portSideToDirection(o.getSide())),s.scale(Tm),a=g.clone().sub(c);let h=new O(n._absMin(s.x,a.x),n._absMin(s.y,a.y));h.add(c),t.splice(t.length-1,0,h)}static _absMin(t,e){return Math.abs(t)<Math.abs(e)?t:e}_segmentAllowsSloppyRouting(t){if(this.compactionStrategy===ie.NONE)return!0;let e=t.boundingBox.x,o=t.boundingBox.x+t.boundingBox.width;if(t.initialSegment){let r=t.sourceNode,i=n._segmentNodeDistanceThreshold(r);if(e-(r.getPosition().x+r.getSize().x)>i)return!1}if(t.lastSegment){let r=t.targetNode,i=n._segmentNodeDistanceThreshold(r);if(r.getPosition().x-o>i)return!1}return!0}static _segmentNodeDistanceThreshold(t){return t.getLayer().getSize().x-t.getSize().x/2}};var jo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};jo.ROTATION=new jo("ROTATION");jo.READING_DIRECTION=new jo("READING_DIRECTION");var jt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};jt.NONE=new jt("NONE");jt.TOP=new jt("TOP");jt.BOTTOM=new jt("BOTTOM");var wn=class{constructor(t){this._mode=t}process(t,e){e.begin(`Graph transformation (${this._mode})`,1);let o=[...t.getLayerlessNodes()];for(let a of t.getLayers())for(let l of a.getNodes())o.push(l);let r=t.getProperty(_.DIRECTION_CONGRUENCY),i=t.getProperty(_.DIRECTION),s=i!=null&&i.name?i.name:null;if(r===jo.READING_DIRECTION||r==="READING_DIRECTION")switch(s){case"LEFT":qa(t,o);break;case"DOWN":Ja(t,o);break;case"UP":this._mode===$o.TO_INTERNAL_LTR?(Ja(t,o),Zg(t,o)):(Zg(t,o),Ja(t,o));break;default:break}else if(this._mode===$o.TO_INTERNAL_LTR)switch(s){case"LEFT":qa(t,o),Zg(t,o);break;case"DOWN":Nm(t,o);break;case"UP":ym(t,o);break;default:break}else switch(s){case"LEFT":qa(t,o),Zg(t,o);break;case"DOWN":ym(t,o);break;case"UP":Nm(t,o);break;default:break}e.done()}},$o=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};$o.TO_INTERNAL_LTR=new $o("TO_INTERNAL_LTR");$o.TO_INPUT_DIRECTION=new $o("TO_INPUT_DIRECTION");wn.Mode=$o;function Nm(n,t){Ja(n,t),qa(n,t)}function ym(n,t){qa(n,t),Ja(n,t)}function qa(n,t){qT(t,n),o_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&o_(e)}function Zg(n,t){QT(t,n),r_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&r_(e)}function Ja(n,t){eN(t),oN(n),_o(n.getOffset()),_o(n.getSize()),i_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&i_(e)}function qT(n,t){let e=0;if(t.getSize().x===0)for(let o of n){let r=o.getPosition().x+o.getSize().x+o.getMargin().right;r>e&&(e=r)}else e=t.getSize().x-t.getOffset().x;e-=t.getOffset().x;for(let o of n){switch(ti(o.getPosition(),e-o.getSize().x),o_(o.getPadding()),Im(o),o.hasProperty(_.POSITION)&&ti(o.getProperty(_.POSITION),e-o.getSize().x),o.getProperty(_.ALIGNMENT)){case Kt.LEFT:o.setProperty(_.ALIGNMENT,Kt.RIGHT);break;case Kt.RIGHT:o.setProperty(_.ALIGNMENT,Kt.LEFT);break;default:break}let r=o.getSize();for(let i of o.getPorts()){ti(i.getPosition(),r.x-i.getSize().x),ti(i.getAnchor(),i.getSize().x),i.setSide(Rm(i.getSide())),s_(i);for(let s of i.getOutgoingEdges()){for(let l of s.getBendPoints())ti(l,e);let a=s.getProperty(_.JUNCTION_POINTS);if(a!=null)for(let l of a)ti(l,e);for(let l of s.getLabels())ti(l.getPosition(),e-l.getSize().x)}for(let s of i.getLabels())ti(s.getPosition(),i.getSize().x-s.getSize().x)}o.getType()===y.EXTERNAL_PORT&&(o.setProperty(p.EXT_PORT_SIDE,Rm(o.getProperty(p.EXT_PORT_SIDE))),JT(o));for(let i of o.getLabels())Im(i),ti(i.getPosition(),r.x-i.getSize().x)}}function ti(n,t){n.x=t-n.x}function o_(n){if(n==null)return;let t=n.left;n.left=n.right,n.right=t}function Im(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);t!=null&&(t.has(k.H_LEFT)?(t.delete(k.H_LEFT),t.add(k.H_RIGHT)):t.has(k.H_RIGHT)&&(t.delete(k.H_RIGHT),t.add(k.H_LEFT)))}function Rm(n){return n===u.EAST?u.WEST:n===u.WEST?u.EAST:n}function JT(n){switch(n.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST);break;case J.FIRST_SEPARATE:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE);break;case J.LAST:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST);break;case J.LAST_SEPARATE:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE);break;default:break}}function QT(n,t){let e=0;if(t.getSize().y===0)for(let o of n){let r=o.getPosition().y+o.getSize().y+o.getMargin().bottom;r>e&&(e=r)}else e=t.getSize().y-t.getOffset().y;e-=t.getOffset().y;for(let o of n){switch(ei(o.getPosition(),e-o.getSize().y),r_(o.getPadding()),Lm(o),o.hasProperty(_.POSITION)&&ei(o.getProperty(_.POSITION),e-o.getSize().y),o.getProperty(_.ALIGNMENT)){case Kt.TOP:o.setProperty(_.ALIGNMENT,Kt.BOTTOM);break;case Kt.BOTTOM:o.setProperty(_.ALIGNMENT,Kt.TOP);break;default:break}let r=o.getSize();for(let i of o.getPorts()){ei(i.getPosition(),r.y-i.getSize().y),ei(i.getAnchor(),i.getSize().y),i.setSide(Am(i.getSide())),s_(i);for(let s of i.getOutgoingEdges()){for(let l of s.getBendPoints())ei(l,e);let a=s.getProperty(_.JUNCTION_POINTS);if(a!=null)for(let l of a)ei(l,e);for(let l of s.getLabels())ei(l.getPosition(),e-l.getSize().y)}for(let s of i.getLabels())ei(s.getPosition(),i.getSize().y-s.getSize().y)}o.getType()===y.EXTERNAL_PORT&&(o.setProperty(p.EXT_PORT_SIDE,Am(o.getProperty(p.EXT_PORT_SIDE))),tN(o));for(let i of o.getLabels())Lm(i),ei(i.getPosition(),r.y-i.getSize().y)}}function ei(n,t){n.y=t-n.y}function r_(n){if(n==null)return;let t=n.top;n.top=n.bottom,n.bottom=t}function Lm(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);t!=null&&(t.has(k.V_TOP)?(t.delete(k.V_TOP),t.add(k.V_BOTTOM)):t.has(k.V_BOTTOM)&&(t.delete(k.V_BOTTOM),t.add(k.V_TOP)))}function Am(n){return n===u.NORTH?u.SOUTH:n===u.SOUTH?u.NORTH:n}function tN(n){let t=n.getProperty(p.IN_LAYER_CONSTRAINT);t===jt.TOP?n.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM):t===jt.BOTTOM&&n.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP)}function eN(n){for(let t of n){_o(t.getPosition()),_o(t.getSize()),i_(t.getPadding()),Cm(t),iN(t);for(let e of t.getPorts()){_o(e.getPosition()),_o(e.getAnchor()),_o(e.getSize()),e.setSide(xm(e.getSide())),s_(e);for(let o of e.getOutgoingEdges()){for(let i of o.getBendPoints())_o(i);let r=o.getProperty(_.JUNCTION_POINTS);if(r!=null)for(let i of r)_o(i);for(let i of o.getLabels())_o(i.getPosition()),_o(i.getSize())}for(let o of e.getLabels())_o(o.getPosition()),_o(o.getSize())}t.getType()===y.EXTERNAL_PORT&&(t.setProperty(p.EXT_PORT_SIDE,xm(t.getProperty(p.EXT_PORT_SIDE))),rN(t));for(let e of t.getLabels())Cm(e),_o(e.getSize()),_o(e.getPosition())}}function _o(n){let t=n.x;n.x=n.y,n.y=t}function i_(n){if(n==null)return;let t=n.top,e=n.bottom,o=n.left,r=n.right;n.top=o,n.bottom=r,n.left=t,n.right=e}function Cm(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);if(t==null||t.size===0)return;let e=new Set;t.has(k.INSIDE)?e.add(k.INSIDE):e.add(k.OUTSIDE),t.has(k.H_PRIORITY)||e.add(k.H_PRIORITY),t.has(k.H_LEFT)?e.add(k.V_TOP):t.has(k.H_CENTER)?e.add(k.V_CENTER):t.has(k.H_RIGHT)&&e.add(k.V_BOTTOM),t.has(k.V_TOP)?e.add(k.H_LEFT):t.has(k.V_CENTER)?e.add(k.H_CENTER):t.has(k.V_BOTTOM)&&e.add(k.H_RIGHT),n.setProperty(_.NODE_LABELS_PLACEMENT,e)}function xm(n){switch(n){case u.NORTH:return u.WEST;case u.WEST:return u.NORTH;case u.SOUTH:return u.EAST;case u.EAST:return u.SOUTH;default:return u.UNDEFINED}}function oN(n){let t=n.getProperty(_.EDGE_LABELS_SIDE_SELECTION);t!=null&&typeof t.transpose=="function"&&n.setProperty(_.EDGE_LABELS_SIDE_SELECTION,t.transpose())}function rN(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT),e=n.getProperty(p.IN_LAYER_CONSTRAINT);t===J.FIRST_SEPARATE?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.NONE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP)):t===J.LAST_SEPARATE?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.NONE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM)):e===jt.TOP?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.NONE)):e===jt.BOTTOM&&(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.NONE))}function iN(n){let t=n.getProperty(_.NODE_SIZE_MINIMUM);switch(t!=null&&n.setProperty(_.NODE_SIZE_MINIMUM,new O(t.y,t.x)),n.getProperty(_.ALIGNMENT)){case Kt.LEFT:n.setProperty(_.ALIGNMENT,Kt.TOP);break;case Kt.RIGHT:n.setProperty(_.ALIGNMENT,Kt.BOTTOM);break;case Kt.TOP:n.setProperty(_.ALIGNMENT,Kt.LEFT);break;case Kt.BOTTOM:n.setProperty(_.ALIGNMENT,Kt.RIGHT);break;default:break}if(n.hasProperty(_.POSITION)){let e=n.getProperty(_.POSITION),o=e.x;e.x=e.y,e.y=o}}function s_(n){let t=n.getProperty(_.PORT_INDEX);t!=null&&n.setProperty(_.PORT_INDEX,-t)}var jg=class{process(t,e){e.begin("Resize child graph to fit parent.",1);for(let o of t){for(let r of o.getNodes())t.getLayerlessNodes().push(r);o.getNodes().length=0}for(let o of t.getLayerlessNodes())o.setLayer(null);t.getLayers().length=0,this._resizeGraph(t),t.getParentNode()!=null&&this._graphLayoutToNode(t.getParentNode(),t),e.done()}_graphLayoutToNode(t,e){for(let i of e.getLayerlessNodes()){let s=i.getProperty(p.ORIGIN);if(s instanceof rt){let a=s,l=z.getExternalPortPosition(e,i,a.getSize().x,a.getSize().y);a.getPosition().x=l.x,a.getPosition().y=l.y,a.setSide(i.getProperty(p.EXT_PORT_SIDE))}}let o=e.getActualSize();e.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)?(t.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),t.getGraph().getProperty(p.GRAPH_PROPERTIES).add(v.NON_FREE_PORTS),z.resizeNode(t,o,!1,!0)):z.resizeNode(t,o,!0,!0)}_resizeGraph(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS),o=t.getProperty(_.NODE_SIZE_OPTIONS),r=t.getActualSize(),i=new O(r.x,r.y);if(e!=null&&e.has(mt.MINIMUM_SIZE)){let s=new O(0,0),a=t.getProperty(_.NODE_SIZE_MINIMUM);a!=null&&(s.x=a.x||0,s.y=a.y||0),o!=null&&o.has(Nt.DEFAULT_MINIMUM_SIZE)&&(s.x<=0&&(s.x=es),s.y<=0&&(s.y=os)),i.x=Math.max(r.x,s.x),i.y=Math.max(r.y,s.y)}this._resizeGraphNoReallyIMeanIt(t,r,i)}_resizeGraphNoReallyIMeanIt(t,e,o){let r=t.getProperty(_.CONTENT_ALIGNMENT);if(o.x>e.x&&r!=null&&(r.has(he.H_CENTER)?t.getOffset().x+=(o.x-e.x)/2:r.has(he.H_RIGHT)&&(t.getOffset().x+=o.x-e.x)),o.y>e.y&&r!=null&&(r.has(he.V_CENTER)?t.getOffset().y+=(o.y-e.y)/2:r.has(he.V_BOTTOM)&&(t.getOffset().y+=o.y-e.y)),t.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)&&(o.x>e.x||o.y>e.y))for(let a of t.getLayerlessNodes()){if(a.getType()!==y.EXTERNAL_PORT)continue;let l=a.getProperty(p.EXT_PORT_SIDE);l===u.EAST?a.getPosition().x+=o.x-e.x:l===u.SOUTH&&(a.getPosition().y+=o.y-e.y)}let s=t.getPadding();t.getSize().x=o.x-s.left-s.right,t.getSize().y=o.y-s.top-s.bottom}};var Et=class extends br{constructor(t){super(),this._owner=t,this._size=new O,this._nodes=[]}getSize(){return this._size}getNodes(){return this._nodes}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}getGraph(){return this._owner}getIndex(){return this._owner.getLayers().indexOf(this)}toString(){return`L_${this.getIndex()}[${this._nodes.join(",")}]`}};var $g=class{process(t,e){e.begin("Hierarchical port constraint processing",1),lN(t),cN(t),e.done()}},sN=0,nN=1;function aN(n,t){let e=n.getType();if(t.getType()!==y.EXTERNAL_PORT)return-1;if(e!==y.EXTERNAL_PORT)return 1;let r=n.getProperty(p.PORT_RATIO_OR_POSITION),i=t.getProperty(p.PORT_RATIO_OR_POSITION);return r===i?0:r<i?-1:1}function lN(n){if(!n.getProperty(_.PORT_CONSTRAINTS).isOrderFixed())return;let t=n.getLayers();t.length!==0&&(Dm(t[0]),Dm(t[t.length-1]))}function Dm(n){let t=z.toNodeArray(n.getNodes());t.sort(aN);let e=null;for(let o of t){if(o.getType()!==y.EXTERNAL_PORT)break;let r=o.getProperty(p.EXT_PORT_SIDE);r!==u.WEST&&r!==u.EAST||(e!=null&&e.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(o),e=o)}}function cN(n){if(!n.getProperty(_.PORT_CONSTRAINTS).isSideFixed())return;let e=n.getLayers(),o=e.length,r=[new Map,new Map],i=[[],[]],s=[];for(let a=0;a<o;a++){let l=e[a],c=r[a],g=new Map;r.push(g);let h=i[a],d=[];i.push(d);for(let f of l){if(n_(f)){s.push(f);continue}for(let E of z.toEdgeArray(f.getIncomingEdges())){let P=E.getSource().getNode();if(!n_(P))continue;let S=P.getProperty(p.ORIGIN),T=c.get(S);T==null&&(T=wm(n,P),c.set(S,T),h.push(T)),E.setSource(T.getPorts()[nN])}for(let E of z.toEdgeArray(f.getOutgoingEdges())){let P=E.getTarget().getNode();if(!n_(P))continue;let S=P.getProperty(p.ORIGIN),T=g.get(S);T==null&&(T=wm(n,P),g.set(S,T),d.push(T)),E.setTarget(T.getPorts()[sN])}}}for(let a=0;a<i.length;a++){let l=i[a];if(l.length===0)continue;let c;a===0?(c=new Et(n),e.unshift(c)):a===r.length-1?(c=new Et(n),e.push(c)):c=e[a-1];for(let g of l)g.setLayer(c)}for(let a of s)a.setLayer(null);n.setProperty(p.EXT_PORT_REPLACED_DUMMIES,s)}function n_(n){if(n.getType()!==y.EXTERNAL_PORT)return!1;let t=n.getProperty(p.EXT_PORT_SIDE);return t===u.NORTH||t===u.SOUTH}function wm(n,t){let e=new ft(n);e.copyProperties(t),e.setProperty(p.EXT_PORT_REPLACED_DUMMY,t),e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),e.setProperty(_.ALIGNMENT,Kt.CENTER),e.setType(y.EXTERNAL_PORT);let o=new rt;o.setNode(e),o.setSide(u.WEST);let r=new rt;return r.setNode(e),r.setSide(u.EAST),e}var _e=class extends br{constructor(){super(),this._bendPoints=new st,this._source=null,this._target=null,this._labels=[]}reverse(t,e){let o=this.getSource(),r=this.getTarget();this.setSource(null),this.setTarget(null),e&&r!=null&&r.getProperty(p.INPUT_COLLECT)?this.setSource(z.provideCollectorPort(t,r.getNode(),W.OUTPUT,u.EAST)):this.setSource(r),e&&o!=null&&o.getProperty(p.OUTPUT_COLLECT)?this.setTarget(z.provideCollectorPort(t,o.getNode(),W.INPUT,u.WEST)):this.setTarget(o);for(let s of this._labels){let a=s.getProperty(_.EDGE_LABELS_PLACEMENT);a===St.TAIL?s.setProperty(_.EDGE_LABELS_PLACEMENT,St.HEAD):a===St.HEAD&&s.setProperty(_.EDGE_LABELS_PLACEMENT,St.TAIL)}let i=this.getProperty(p.REVERSED);this.setProperty(p.REVERSED,!i),this._bendPoints=st.reverse(this._bendPoints)}getSource(){return this._source}setSource(t){if(this._source!=null){let e=this._source.getOutgoingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._source=t,this._source!=null&&this._source.getOutgoingEdges().push(this)}getTarget(){return this._target}setTarget(t){if(this._target!=null){let e=this._target.getIncomingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._target=t,this._target!=null&&this._target.getIncomingEdges().push(this)}setTargetAndInsertAtIndex(t,e){if(this._target!=null){let o=this._target.getIncomingEdges(),r=o.indexOf(this);r>=0&&o.splice(r,1)}this._target=t,this._target!=null&&this._target.getIncomingEdges().splice(e,0,this)}isSelfLoop(){if(this._source==null||this._target==null)return!1;let t=this._source.getNode();return t!=null&&t===this._target.getNode()}isInLayerEdge(){return!this.isSelfLoop()&&this._source.getNode().getLayer()===this._target.getNode().getLayer()}getBendPoints(){return this._bendPoints}getLabels(){return this._labels}getOther(t){if(t===this._source)return this._target;if(t===this._target)return this._source;if(this._source!=null&&t===this._source.getNode())return this._target.getNode();if(this._target!=null&&t===this._target.getNode())return this._source.getNode();throw new Error("'portOrNode' must be either the source or target of the edge.")}getDesignation(){return this._labels.length>0&&this._labels[0].getText()?this._labels[0].getText():super.getDesignation()}toString(){let t="e_",e=this.getDesignation();return e!=null&&(t+=e),this._source!=null&&this._target!=null&&(t+=` ${this._source.getDesignation()}[${this._source.getNode()}]`,t+=` -> ${this._target.getDesignation()}[${this._target.getNode()}]`),t}};var oi=class{static adapt(t,e=!1,o=!1,r=()=>!0){return new a_(t,e,o,r)}static adaptNode(t,e){return new Mn(null,t,e)}static adaptLabel(t){return new bn(t)}},Qa=class{constructor(t){this._element=t}getElement(){return this._element}getSize(){return this._element.getSize()}setSize(t){this._element.getSize().x=t.x,this._element.getSize().y=t.y}getPosition(){return this._element.getPosition()}setPosition(t){this._element.getPosition().x=t.x,this._element.getPosition().y=t.y}getProperty(t){return this._element.getProperty(t)}hasProperty(t){return this._element.hasProperty(t)}getVolatileId(){return this._element.id}setVolatileId(t){this._element.id=t}},a_=class{constructor(t,e,o,r){this._element=t,this._transparentNorthSouthEdges=e,this._transparentCommentNodes=o,this._nodeFilter=r,this._nodeAdapters=null}getSize(){return this._element.getSize()}setSize(t){this._element.getSize().x=t.x,this._element.getSize().y=t.y}getPosition(){throw new Error("Not supported by LGraph")}setPosition(){throw new Error("Not supported by LGraph")}getProperty(t){return this._element.getProperty(t)}hasProperty(t){return this._element.hasProperty(t)}getVolatileId(){return this._element.id}setVolatileId(t){this._element.id=t}getNodes(){if(this._nodeAdapters==null){this._nodeAdapters=[];for(let t of this._element.getLayers())for(let e of t.getNodes())if(this._nodeFilter(e)&&(this._nodeAdapters.push(new Mn(this,e,this._transparentNorthSouthEdges)),this._transparentCommentNodes)){if(e.hasProperty(p.TOP_COMMENTS))for(let o of e.getProperty(p.TOP_COMMENTS))this._nodeAdapters.push(new Mn(this,o,!1));if(e.hasProperty(p.BOTTOM_COMMENTS))for(let o of e.getProperty(p.BOTTOM_COMMENTS))this._nodeAdapters.push(new Mn(this,o,!1))}}return this._nodeAdapters}},Mn=class extends Qa{constructor(t,e,o){super(e),this._parentGraphAdapter=t,this._transparentNorthSouthEdges=o,this._labelAdapters=null,this._portAdapters=null}getGraph(){return this._parentGraphAdapter}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}getPorts(){if(this._portAdapters==null){this._portAdapters=[];for(let t of this._element.getPorts())this._portAdapters.push(new l_(t,this._transparentNorthSouthEdges))}return this._portAdapters}getIncomingEdges(){return[]}getOutgoingEdges(){return[]}sortPortList(t){let e=t||gN;this._element.getProperty(_.PORT_CONSTRAINTS).isOrderFixed()&&this._element.getPorts().sort(e)}isCompoundNode(){return this._element.getProperty(p.COMPOUND_NODE)}getPadding(){let t=this._element.getPadding();return new yt(t.top,t.right,t.bottom,t.left)}setPadding(t){let e=this._element.getPadding();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}getMargin(){let t=this._element.getMargin();return new me(t.top,t.right,t.bottom,t.left)}setMargin(t){let e=this._element.getMargin();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}},l_=class extends Qa{constructor(t,e){super(t),this._transparentNorthSouthEdges=e,this._labelAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getSide(){return this._element.getSide()}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}getMargin(){let t=this._element.getMargin?this._element.getMargin():{top:0,right:0,bottom:0,left:0};return new me(t.top,t.right,t.bottom,t.left)}setMargin(t){if(!this._element.getMargin)return;let e=this._element.getMargin();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}getIncomingEdges(){if(this._transparentNorthSouthEdges&&this._element.getNode().getType()===y.NORTH_SOUTH_PORT)return[];if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let e of this._element.getIncomingEdges())this._incomingEdgeAdapters.push(new Bi(e));if(this._transparentNorthSouthEdges){let e=this._element.getProperty(p.PORT_DUMMY);if(e!=null)for(let o of e.getIncomingEdges())this._incomingEdgeAdapters.push(new Bi(o))}let t=this._element.getNode();if(t.hasProperty(p.SELF_LOOP_HOLDER)){let o=t.getProperty(p.SELF_LOOP_HOLDER).getSLPortMap().get(this._element);if(o!=null)for(let r of o.getIncomingSLEdges())this._incomingEdgeAdapters.push(new Bi(r.getLEdge()))}}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._transparentNorthSouthEdges&&this._element.getNode().getType()===y.NORTH_SOUTH_PORT)return[];if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let e of this._element.getOutgoingEdges())this._outgoingEdgeAdapters.push(new Bi(e));if(this._transparentNorthSouthEdges){let e=this._element.getProperty(p.PORT_DUMMY);if(e!=null)for(let o of e.getOutgoingEdges())this._outgoingEdgeAdapters.push(new Bi(o))}let t=this._element.getNode();if(t.hasProperty(p.SELF_LOOP_HOLDER)){let o=t.getProperty(p.SELF_LOOP_HOLDER).getSLPortMap().get(this._element);if(o!=null)for(let r of o.getOutgoingSLEdges())this._outgoingEdgeAdapters.push(new Bi(r.getLEdge()))}}return this._outgoingEdgeAdapters}hasCompoundConnections(){return this._element.getProperty(p.INSIDE_CONNECTIONS)}},bn=class extends Qa{constructor(t){super(t)}getSide(){return this._element.getProperty(Vt.LABEL_SIDE)}getText(){return this._element.getText?this._element.getText():""}},Bi=class{constructor(t){this._element=t,this._labelAdapters=null}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}},gN=(n,t)=>{let e=n.getSide().ordinal()-t.getSide().ordinal();if(e!==0)return e;let o=n.getProperty(_.PORT_INDEX),r=t.getProperty(_.PORT_INDEX);if(o!=null&&r!=null){let i=o-r;if(i!==0)return i}switch(n.getSide().toString()){case"NORTH":return n.getPosition().x-t.getPosition().x;case"EAST":return n.getPosition().y-t.getPosition().y;case"SOUTH":return t.getPosition().x-n.getPosition().x;case"WEST":return t.getPosition().y-n.getPosition().y;default:throw new Error("Port side is undefined")}};var qg=class{constructor(){this._northernExtPortEdgeRoutingHeight=0}process(t,e){e&&e.begin&&e.begin("Orthogonally routing hierarchical port edges",1),this._northernExtPortEdgeRoutingHeight=0;let o=this._restoreNorthSouthDummies(t);this._setNorthSouthDummyCoordinates(t,o),this._routeEdges(e,t,o),this._removeTemporaryNorthSouthDummies(t),this._fixCoordinates(t),this._correctSlantedEdgeSegments(t),e&&e.done&&e.done()}_restoreNorthSouthDummies(t){let e=[];if(!t.hasProperty(p.EXT_PORT_REPLACED_DUMMIES))return e;for(let i of t.getProperty(p.EXT_PORT_REPLACED_DUMMIES))this._restoreDummy(i,t),e.push(i);for(let i of t.getLayers())for(let s of i.getNodes()){if(s.getType()!==y.EXTERNAL_PORT)continue;let a=s.getProperty(p.EXT_PORT_REPLACED_DUMMY);a!=null&&this._connectNodeToDummy(t,s,a)}let o=t.getLayers(),r=o[o.length-1];for(let i of e)i.setLayer(r);return e}_restoreDummy(t,e){let o=t.getProperty(p.EXT_PORT_SIDE),r=t.getPorts()[0];o===u.NORTH?r.setSide(u.SOUTH):o===u.SOUTH&&r.setSide(u.NORTH);let i=e.getProperty(_.NODE_SIZE_CONSTRAINTS);if(i!=null&&i.has&&i.has(mt.PORT_LABELS)){let s=t.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL)||0,a=t.getProperty(_.SPACING_LABEL_PORT_VERTICAL)||0,l=t.getProperty(_.SPACING_LABEL_LABEL)||0,c=e.getProperty(_.PORT_LABELS_PLACEMENT);if(c!=null&&c.has){if(c.has(it.INSIDE)){let g=a,h=t.getSize().x/2-r.getPosition().x;for(let d of r.getLabels())d.getPosition().y=g,d.getPosition().x=h-d.getSize().x/2,g+=d.getSize().y+l}else if(c.has(it.OUTSIDE))for(let g of r.getLabels())g.getPosition().x=s+t.getSize().x-r.getPosition().x}No.getNodeMarginCalculator(oi.adapt(e,!1)).processNode(oi.adapt(t,!1))}}_connectNodeToDummy(t,e,o){let r=new rt;r.setNode(e);let i=e.getProperty(p.EXT_PORT_SIDE);r.setSide(i);let s=o.getPorts()[0],a=new _e;a.setSource(r),a.setTarget(s)}_setNorthSouthDummyCoordinates(t,e){let o=t.getProperty(_.PORT_CONSTRAINTS),r=t.getSize(),i=t.getPadding(),s=r.x+i.left+i.right,a=0-i.top-t.getOffset().y,l=r.y+i.top+i.bottom-t.getOffset().y,c=[],g=[];for(let h of e){o===H.FREE||o===H.FIXED_SIDE||o===H.FIXED_ORDER?this._calculateNorthSouthDummyPositions(h):o===H.FIXED_RATIO?(this._applyNorthSouthDummyRatio(h,s),h.borderToContentAreaCoordinates(!0,!1)):o===H.FIXED_POS&&(this._applyNorthSouthDummyPosition(h),h.borderToContentAreaCoordinates(!0,!1),r.x=Math.max(r.x,h.getPosition().x+h.getSize().x/2));let d=h.getProperty(p.EXT_PORT_SIDE);d===u.NORTH?(h.getPosition().y=a,c.push(h)):d===u.SOUTH&&(h.getPosition().y=l,g.push(h))}o===H.FREE||o===H.FIXED_SIDE?(this._ensureUniquePositions(c,t),this._ensureUniquePositions(g,t)):o===H.FIXED_ORDER&&(this._restoreProperOrder(c,t),this._restoreProperOrder(g,t))}_calculateNorthSouthDummyPositions(t){let e=t.getPorts()[0];if(e.getDegree()===0){t.getPosition().x=0;return}let o=0;for(let s of e.getConnectedPorts())o+=s.getNode().getPosition().x+s.getPosition().x+s.getAnchor().x;let r=t.getProperty(_.PORT_ANCHOR),i=r==null?0:r.x;t.getPosition().x=o/e.getDegree()-i}_applyNorthSouthDummyRatio(t,e){let o=t.getProperty(_.PORT_ANCHOR),r=o==null?0:o.x;t.getPosition().x=e*t.getProperty(p.PORT_RATIO_OR_POSITION)-r}_applyNorthSouthDummyPosition(t){let e=t.getProperty(_.PORT_ANCHOR),o=e==null?0:e.x;t.getPosition().x=t.getProperty(p.PORT_RATIO_OR_POSITION)-o}_ensureUniquePositions(t,e){if(t.length===0)return;let o=z.toNodeArray(t);o.sort((r,i)=>r.getPosition().x-i.getPosition().x),this._assignAscendingCoordinates(o,e)}_restoreProperOrder(t,e){if(t.length===0)return;let o=z.toNodeArray(t);o.sort((r,i)=>r.getProperty(p.PORT_RATIO_OR_POSITION)-i.getProperty(p.PORT_RATIO_OR_POSITION)),this._assignAscendingCoordinates(o,e)}_assignAscendingCoordinates(t,e){let o=e.getProperty(_.SPACING_PORT_PORT)||10,r=t[0].getPosition().x+t[0].getSize().x+t[0].getMargin().right+o;for(let i=1;i<t.length;i++){let s=t[i].getPosition(),a=t[i].getSize(),l=t[i].getMargin(),c=s.x-l.left-r;c<0&&(s.x-=c);let g=e.getSize();g.x=Math.max(g.x,s.x+a.x),r=s.x+a.x+l.right+o}}_routeEdges(t,e,o){let r=new Set,i=new Set,s=new Set,a=new Set,l=e.getProperty(_.SPACING_NODE_NODE),c=e.getProperty(_.SPACING_EDGE_EDGE);for(let g of o){let h=g.getProperty(p.EXT_PORT_SIDE);if(h===u.NORTH){i.add(g);for(let d of g.getIncomingEdges())r.add(d.getSource().getNode())}else if(h===u.SOUTH){a.add(g);for(let d of g.getIncomingEdges())s.add(d.getSource().getNode())}}if(r.size>0){let h=new se(qe.SOUTH_TO_NORTH,c,"extnorth").routeEdges(t,e,r,0,i,-l-e.getOffset().y);h>0&&(this._northernExtPortEdgeRoutingHeight=l+(h-1)*c,e.getOffset().y+=this._northernExtPortEdgeRoutingHeight,e.getSize().y+=this._northernExtPortEdgeRoutingHeight)}if(s.size>0){let h=new se(qe.NORTH_TO_SOUTH,c,"extsouth").routeEdges(t,e,s,0,a,e.getSize().y+l-e.getOffset().y);h>0&&(e.getSize().y+=l+(h-1)*c)}}_removeTemporaryNorthSouthDummies(t){let e=[];for(let o of t.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.EXTERNAL_PORT||!r.hasProperty(p.EXT_PORT_REPLACED_DUMMY))continue;let i=null,s=null,a=null;for(let T of r.getPorts())T.getSide()===u.WEST?i=T:T.getSide()===u.EAST?s=T:a=T;let l=a.getOutgoingEdges()[0],c=new st(l.getBendPoints()),g=new O(a.getPosition().x,a.getPosition().y);g.x+=r.getPosition().x,g.y+=r.getPosition().y,c.splice(0,0,g);let h=st.reverse(l.getBendPoints()),d=new O(a.getPosition().x,a.getPosition().y);d.x+=r.getPosition().x,d.y+=r.getPosition().y,h.add(d);let E=r.getProperty(p.EXT_PORT_REPLACED_DUMMY).getPorts()[0],P=[...i.getIncomingEdges()];for(let T of P)T.setTarget(E),T.getBendPoints().addAllAsCopies(T.getBendPoints().length,c);let S=z.toEdgeArray(s.getOutgoingEdges());for(let T of S)T.setSource(E),T.getBendPoints().addAllAsCopies(0,h);l.setSource(null),l.setTarget(null),e.push(r)}for(let o of e)o.setLayer(null)}_fixCoordinates(t){let e=t.getProperty(_.PORT_CONSTRAINTS),o=t.getLayers();this._fixCoordinatesInLayer(o[0],e,t),this._fixCoordinatesInLayer(o[o.length-1],e,t)}_fixCoordinatesInLayer(t,e,o){let r=o.getPadding(),i=o.getOffset(),s=o.getActualSize(),a=s.y;for(let l of t.getNodes()){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE),g=l.getProperty(p.EXT_PORT_SIZE),h=l.getPosition();c===u.EAST?h.x=o.getSize().x+r.right-i.x:c===u.WEST&&(h.x=-i.x-r.left);let d=0;if(c===u.EAST||c===u.WEST)if(e===H.FIXED_RATIO){let f=l.getProperty(p.PORT_RATIO_OR_POSITION);h.y=s.y*f-l.getProperty(_.PORT_ANCHOR).y,d=h.y+g.y,l.borderToContentAreaCoordinates(!1,!0)}else e===H.FIXED_POS&&(h.y=l.getProperty(p.PORT_RATIO_OR_POSITION)-l.getProperty(_.PORT_ANCHOR).y,d=h.y+g.y,l.borderToContentAreaCoordinates(!1,!0));a=Math.max(a,d)}o.getSize().y+=a-s.y;for(let l of t.getNodes()){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE),g=l.getPosition();c===u.NORTH?g.y=-i.y-r.top:c===u.SOUTH&&(g.y=o.getSize().y+r.bottom-i.y)}}_correctSlantedEdgeSegments(t){let e=t.getLayers();this._correctSlantedEdgeSegmentsInLayer(e[0]),this._correctSlantedEdgeSegmentsInLayer(e[e.length-1])}_correctSlantedEdgeSegmentsInLayer(t){for(let e of t.getNodes()){if(e.getType()!==y.EXTERNAL_PORT)continue;let o=e.getProperty(p.EXT_PORT_SIDE);if(!(o!==u.EAST&&o!==u.WEST))for(let r of e.getConnectedEdges()){let i=r.getBendPoints();if(i.length===0)continue;let s=r.getSource();if(s&&s.getNode()===e){let l=i[0];l.y=s.getAbsoluteAnchor().y}let a=r.getTarget();if(a&&a.getNode()===e){let l=i[i.length-1];l.y=a.getAbsoluteAnchor().y}}}}};var Jg=class{process(t,e){e.begin("Hierarchical port dummy size processing",1);let r=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS)*2,i=[],s=[];for(let a of t){i.length=0,s.length=0;for(let l of a){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE);c===u.NORTH?i.push(l):c===u.SOUTH&&s.push(l)}Mm(i,!0,r),Mm(s,!1,r)}e.done()}};function Mm(n,t,e){let o=0,r=e;t||(o=e*(n.length-1),r*=-1);for(let i of n){i.setProperty(_.ALIGNMENT,Kt.CENTER),i.getSize().x=o;for(let s of i.getPorts(u.EAST))s.getPosition().x=o;o+=r}}var Qg=class{process(t,e){e.begin("Hierarchical port position processing",1);let o=t.getLayers();o.length>0&&bm(o[0],t),o.length>1&&bm(o[o.length-1],t),e.done()}};function bm(n,t){let e=t.getProperty(_.PORT_CONSTRAINTS);if(!(e.isRatioFixed()||e.isPosFixed()))return;let o=t.getActualSize().y;for(let r of n){if(r.getType()!==y.EXTERNAL_PORT)continue;let i=r.getProperty(p.EXT_PORT_SIDE);if(i!==u.EAST&&i!==u.WEST)continue;let s=r.getProperty(p.PORT_RATIO_OR_POSITION);e===H.FIXED_RATIO&&(s*=o),r.getPosition().y=s-r.getProperty(_.PORT_ANCHOR).y,r.borderToContentAreaCoordinates(!1,!0)}}var oh=class{constructor(){this._layeredGraph=null,this._degreeThreshold=0,this._treeHeightThreshold=0}process(t,e){this._layeredGraph=t,this._degreeThreshold=t.getProperty(_.HIGH_DEGREE_NODES_THRESHOLD);let o=t.getProperty(_.HIGH_DEGREE_NODES_TREE_HEIGHT);o===0&&(o=Number.MAX_SAFE_INTEGER),this._treeHeightThreshold=o;let r=t.getLayers(),i=0;for(;i<r.length;){let s=r[i],a=[],l=-1,c=-1;for(let d of s.getNodes())if(this._isHighDegreeNode(d)){let f=this._calculateInformation(d);l=Math.max(l,f.incTreesMaxHeight),c=Math.max(c,f.outTreesMaxHeight),a.push([d,f])}let g=[];for(let d=0;d<l;d++){let f=new Et(t);r.splice(i,0,f),g.unshift(f),i++}for(let[,d]of a)if(d.incTreeRoots!=null)for(let f of d.incTreeRoots)this._moveTree(f,th,g);let h=[];for(let d=0;d<c;d++){let f=new Et(t);r.splice(i+1+d,0,f),h.push(f)}for(let[,d]of a)if(d.outTreeRoots!=null)for(let f of d.outTreeRoots)this._moveTree(f,eh,h);i+=1+Math.max(c,0)}for(let s=r.length-1;s>=0;s--)r[s].getNodes().length===0&&r.splice(s,1)}_isHighDegreeNode(t){return dN(t)>=this._degreeThreshold}_calculateInformation(t){let e=new g_;for(let o of t.getIncomingEdges()){if(o.isSelfLoop())continue;let r=o.getSource().getNode();if(c_(r,eh)){let i=this._isTreeRoot(r,eh,th);if(i===-1)continue;e.incTreesMaxHeight=Math.max(e.incTreesMaxHeight,i),e.incTreeRoots==null&&(e.incTreeRoots=[]),e.incTreeRoots.push(r)}}for(let o of t.getOutgoingEdges()){if(o.isSelfLoop())continue;let r=o.getTarget().getNode();if(c_(r,th)){let i=this._isTreeRoot(r,th,eh);if(i===-1)continue;e.outTreesMaxHeight=Math.max(e.outTreesMaxHeight,i),e.outTreeRoots==null&&(e.outTreeRoots=[]),e.outTreeRoots.push(r)}}return e}_moveTree(t,e,o){t.setLayer(o[0]);let r=o.slice(1);for(let i of e(t)){let s=h_(i,t);r.length>0&&this._moveTree(s,e,r)}}_isTreeRoot(t,e,o){if(this._isHighDegreeNode(t)||!c_(t,e))return-1;if(fN(o(t)))return 1;let r=0;for(let i of o(t)){let s=h_(i,t),a=this._isTreeRoot(s,e,o);if(a===-1||(r=Math.max(r,a),r>this._treeHeightThreshold-1))return-1}return r+1}},g_=class{constructor(){this.incTreesMaxHeight=-1,this.incTreeRoots=null,this.outTreesMaxHeight=-1,this.outTreeRoots=null}},th=n=>n.getIncomingEdges(),eh=n=>n.getOutgoingEdges(),hN=n=>n.getConnectedEdges();function dN(n){let t=0;for(let e of hN(n))t++;return t}function fN(n){for(let t of n)return!1;return!0}function c_(n,t){let e=null;for(let o of t(n)){let r=h_(o,n);if(e==null)e=r;else if(r!==e)return!1}return!0}function h_(n,t){return n.getSource().getNode()===t?n.getTarget().getNode():n.getSource().getNode()}var rh=class{process(t,e){e.begin("Hyperedge merging",1),pN(t);for(let o of t.getLayers()){let r=o.getNodes();if(r.length===0)continue;let i=null,s=null,a=null,l=null;for(let c=0;c<r.length;c++){if(i=r[c],s=i.getType(),s===y.LONG_EDGE&&l===y.LONG_EDGE){let g=uN(i,a);g.allowMerge&&(_N(i,a,g.sameSource,g.sameTarget),r.splice(c,1),c--,i=a,s=l)}a=i,l=s}}e.done()}};function uN(n,t){let e=n.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES),o=t.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES),r=n.getProperty(p.LONG_EDGE_SOURCE),i=t.getProperty(p.LONG_EDGE_SOURCE),s=n.getProperty(p.LONG_EDGE_TARGET),a=t.getProperty(p.LONG_EDGE_TARGET),l=r!=null&&r===i,c=s!=null&&s===a;if(!e&&!o){let d=n.getPorts()[0],f=t.getPorts()[0];return{allowMerge:d.id===f.id,sameSource:l,sameTarget:c}}let g=(!e||n.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY))&&(!o||t.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY)),h=(!e||!n.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY))&&(!o||!t.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY));return{allowMerge:l&&g||c&&h,sameSource:l,sameTarget:c}}function _N(n,t,e,o){let r=Gm(t.getPorts(u.WEST)),i=Gm(t.getPorts(u.EAST));for(let s of n.getPorts()){for(;s.getIncomingEdges().length>0;)s.getIncomingEdges()[0].setTarget(r);for(;s.getOutgoingEdges().length>0;)s.getOutgoingEdges()[0].setSource(i)}e||t.setProperty(p.LONG_EDGE_SOURCE,null),o||t.setProperty(p.LONG_EDGE_TARGET,null)}function Gm(n){for(let t of n)return t;return null}function pN(n){let t=[];for(let o of n.getLayers())for(let r of o.getNodes())for(let i of r.getPorts())t.push(i);for(let o of t)o.id=-1;let e=0;for(let o of t)o.id===-1&&d_(o,e++)}function d_(n,t){n.id=t;for(let e of n.getConnectedPorts())e.id===-1&&d_(e,t);if(n.getNode().getType()===y.LONG_EDGE)for(let e of n.getNode().getPorts())e!==n&&e.id===-1&&d_(e,t)}var ih=class{process(t,e){e.begin("Hypernodes processing",1);for(let o of t)for(let r of o){if(!r.getProperty(_.HYPERNODE)||r.getPorts().length>2)continue;let i=0,s=0,a=0,l=0;for(let c of r.getPorts())switch(c.getSide()){case u.NORTH:i++;break;case u.EAST:s++;break;case u.SOUTH:a++;break;case u.WEST:l++;break}i===0&&a===0&&EN(t,r,l<=s)}e.done()}};function EN(n,t,e){let o=[],r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;if(e){r=n.getSize().x;for(let c of t.getPorts())for(let g of c.getOutgoingEdges()){let h=g.getBendPoints();if(h.isEmpty())continue;let d=h.getFirst();d.x<r&&(i=r-d.x,s=Number.MAX_SAFE_INTEGER,o.length=0,r=d.x),d.x<=r&&(o.push(g),h.size()>1&&(s=Math.min(s,Math.abs(h.get(1).y-d.y))))}}else for(let c of t.getPorts())for(let g of c.getIncomingEdges()){let h=g.getBendPoints();if(h.isEmpty())continue;let d=h.getLast();d.x>r&&(i=d.x-r,s=Number.MAX_SAFE_INTEGER,o.length=0,r=d.x),d.x>=r&&(o.push(g),h.size()>1&&(s=Math.min(s,Math.abs(h.get(h.size()-2).y-d.y))))}if(o.length===0||i<=t.getSize().x/2||s<=t.getSize().y/2)return;let a=new rt;a.setNode(t),a.setSide(u.NORTH),a.getPosition().x=t.getSize().x/2;let l=new rt;l.setNode(t),l.setSide(u.SOUTH),l.getPosition().x=t.getSize().x/2,l.getPosition().y=t.getSize().y;for(let c of o){let g=c.getBendPoints(),h,d;e?(h=g.removeFirst(),d=g.isEmpty()?c.getTarget().getAbsoluteAnchor():g.getFirst(),d.y>=h.y?c.setSource(l):c.setSource(a)):(h=g.removeLast(),d=g.isEmpty()?c.getSource().getAbsoluteAnchor():g.getLast(),d.y>=h.y?c.setTarget(l):c.setTarget(a));let f=c.getProperty(_.JUNCTION_POINTS);f!=null&&f.remove(h)}t.getPosition().x=r-t.getSize().x/2}var sh=class{process(t,e){e.begin("Layer constraint edge reversal",1);for(let o of t){let r=-1,i=[],s=o.getNodes().slice();for(let a=0;a<s.length;a++){let l=s[a].getProperty(p.IN_LAYER_CONSTRAINT);r===-1?l!==jt.TOP&&(r=a):l===jt.TOP&&(s[a].setLayer(null),s[a].setLayer(r++,o)),l===jt.BOTTOM&&i.push(s[a])}for(let a of i)a.setLayer(null),a.setLayer(o)}e.done()}};var nh=class{process(t,e){e.begin("Node margin calculation",1),No.getNodeMarginCalculator(oi.adapt(t,!1)).excludeEdgeHeadTailLabels().process(),e.done()}};var Gn=10,ah=class{constructor(){this._minX=Number.POSITIVE_INFINITY,this._maxX=Number.NEGATIVE_INFINITY,this._minY=Number.POSITIVE_INFINITY,this._maxY=Number.NEGATIVE_INFINITY}process(t,e){if(t.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)){for(let r of t.getLayerlessNodes()){if(r.getType()!==y.NORMAL)continue;let i=r.getProperty(_.MARGINS),s=i!=null?i.left:0,a=i!=null?i.right:0,l=i!=null?i.top:0,c=i!=null?i.bottom:0,g=r.getPosition(),h=r.getSize();g.x-s<this._minX&&(this._minX=g.x-s),g.x+h.x+a>this._maxX&&(this._maxX=g.x+h.x+a),g.y-l<this._minY&&(this._minY=g.y-l),g.y+h.y+c>this._maxY&&(this._maxY=g.y+h.y+c)}for(let r of t.getLayerlessNodes()){if(r.getType()===y.NORMAL)continue;if(r.getType()!==y.EXTERNAL_PORT)throw new Error(`InteractiveExternalPortPositioner: unsupported node type ${r.getType()}`);let i=r.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.FIRST_SEPARATE){r.getPosition().x=this._minX-Gn;let a=Hm(r,l=>l.getTarget().getNode());a!=null&&(r.getPosition().y=a);continue}if(i===J.LAST_SEPARATE){r.getPosition().x=this._maxX+Gn;let a=Hm(r,l=>l.getSource().getNode());a!=null&&(r.getPosition().y=a);continue}let s=r.getProperty(p.IN_LAYER_CONSTRAINT);if(s===jt.TOP){let a=vm(r);a!=null&&(r.getPosition().x=a+Gn),r.getPosition().y=this._minY-Gn;continue}if(s===jt.BOTTOM){let a=vm(r);a!=null&&(r.getPosition().x=a+Gn),r.getPosition().y=this._maxY+Gn}}}}};function Hm(n,t){for(let e of n.getConnectedEdges()){let o=t(e);return o.getPosition().y+o.getSize().y/2}return null}function vm(n){if(n.getPorts().length!==1)throw new Error("external port dummy must have exactly one port");let t=n.getPorts()[0],e=t.getOutgoingEdges().length>0,o=t.getIncomingEdges().length>0;if(e&&o)throw new Error("Interactive layout does not support N/S ports with incoming AND outgoing edges");if(e){let r=Number.POSITIVE_INFINITY;for(let i of t.getOutgoingEdges()){let s=i.getTarget().getNode(),a=s.getProperty(_.MARGINS),l=a!=null?a.left:0,c=s.getPosition().x-l;c<r&&(r=c)}return r}if(o){let r=Number.NEGATIVE_INFINITY;for(let i of t.getIncomingEdges()){let s=i.getSource().getNode(),a=s.getProperty(_.MARGINS),l=a!=null?a.right:0,c=s.getPosition().x+s.getSize().x+l;c>r&&(r=c)}return r}return null}var lh=class{process(t,e){e.begin("Inverted port preprocessing",1);let o=t.getLayers(),r=[],i=null;for(let s=0;s<o.length;s++){let a=i;i=o[s];for(let c of r)c.setLayer(a);r=[];let l=i.getNodes().slice();for(let c of l)if(c.getType()===y.NORMAL&&c.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){for(let g of c.getPorts(W.INPUT,u.EAST)){let h=g.getIncomingEdges().slice();for(let d of h)mN(t,g,d,r)}for(let g of c.getPorts(W.OUTPUT,u.WEST)){let h=g.getOutgoingEdges().slice();for(let d of h)PN(t,g,d,r)}}}for(let s of r)s.setLayer(i);e.done()}};function mN(n,t,e,o){if(e.getSource().getNode()===t.getNode())return;let r=new ft(n);r.setType(y.LONG_EDGE),r.setProperty(p.ORIGIN,e),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.push(r);let i=new rt;i.setNode(r),i.setSide(u.WEST);let s=new rt;s.setNode(r),s.setSide(u.EAST),e.setTarget(i);let a=new _e;a.copyProperties(e),a.setProperty(_.JUNCTION_POINTS,null),a.setSource(s),a.setTarget(t),Um(r,i,s),Bm(e,a,!1)}function PN(n,t,e,o){if(e.getTarget().getNode()===t.getNode())return;let r=new ft(n);r.setType(y.LONG_EDGE),r.setProperty(p.ORIGIN,e),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.push(r);let i=new rt;i.setNode(r),i.setSide(u.WEST);let s=new rt;s.setNode(r),s.setSide(u.EAST);let a=e.getTarget();e.setTarget(i);let l=new _e;l.copyProperties(e),l.setProperty(_.JUNCTION_POINTS,null),l.setSource(s),l.setTarget(a),Bm(e,l,!0),Um(r,i,s)}function Bm(n,t,e){let o=n.getLabels(),r=0;for(;r<o.length;){let i=o[r];i.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD?((e||!i.hasProperty(p.END_LABEL_EDGE))&&i.setProperty(p.END_LABEL_EDGE,n),o.splice(r,1),t.getLabels().push(i)):r++}}function Um(n,t,e){let o=t.getIncomingEdges()[0].getSource(),r=o.getNode(),i=e.getOutgoingEdges()[0].getTarget(),s=i.getNode();r.getType()===y.LONG_EDGE?n.setProperty(p.LONG_EDGE_SOURCE,r.getProperty(p.LONG_EDGE_SOURCE)):n.setProperty(p.LONG_EDGE_SOURCE,o),s.getType()===y.LONG_EDGE?n.setProperty(p.LONG_EDGE_TARGET,s.getProperty(p.LONG_EDGE_TARGET)):n.setProperty(p.LONG_EDGE_TARGET,i)}var ch=class{process(t,e){e.begin("Node and Port Label Placement and Node Sizing",1),No.calculateLabelAndNodeSizes(oi.adapt(t,!0,!0,r=>r.getType()===y.NORMAL));let o=t.getProperty(p.GRAPH_PROPERTIES);if(o!=null&&o.has(v.EXTERNAL_PORTS)){let r=t.getProperty(_.PORT_LABELS_PLACEMENT),i=r!=null&&r.has(it.NEXT_TO_PORT_IF_POSSIBLE),s=t.getProperty(_.PORT_LABELS_TREAT_AS_GROUP);for(let a of t.getLayers())for(let l of a.getNodes())l.getType()===y.EXTERNAL_PORT&&this._placeExternalPortDummyLabels(l,r,i,s)}e.done()}_placeExternalPortDummyLabels(t,e,o,r){let i=t.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL),s=t.getProperty(_.SPACING_LABEL_PORT_VERTICAL),a=t.getProperty(_.SPACING_LABEL_LABEL),l=t.getSize(),c=t.getPorts()[0],g=c.getPosition(),h=this._computePortLabelBox(c,a);if(h==null)return;if(e!=null&&e.has(it.INSIDE))switch(t.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:h.x=(l.x-h.width)/2-g.x,h.y=s;break;case u.SOUTH:h.x=(l.x-h.width)/2-g.x,h.y=-s-h.height;break;case u.EAST:{if(f_(c,!0,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=l.y+s-g.y;h.x=-i-h.width;break}case u.WEST:{if(f_(c,!0,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=l.y+s-g.y;h.x=i;break}default:break}else if(e!=null&&e.has(it.OUTSIDE))switch(t.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:case u.SOUTH:h.x=g.x+i;break;case u.EAST:case u.WEST:{if(f_(c,!1,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=g.y+s;break}default:break}let d=h.y;for(let f of c.getLabels()){let E=f.getPosition();E.x=h.x,E.y=d,d+=f.getSize().y+a}}_computePortLabelBox(t,e){let o=t.getLabels();if(o.length===0)return null;let r=new dt;for(let i of o){let s=i.getSize();s.x>r.width&&(r.width=s.x),r.height+=s.y}return r.height+=(o.length-1)*e,r}};function f_(n,t,e){return e?t?n.getIncomingEdges().length===0&&n.getOutgoingEdges().length===0:!n.isConnectedToExternalNodes():!1}var ri=class n{process(t,e){e.begin("Edge splitting",1);let o=t.getLayers();if(o.length<=2){e.done();return}for(let r=0;r<o.length-1;r++){let i=o[r],s=o[r+1];for(let a of i)for(let l of a.getPorts()){let c=l.getOutgoingEdges().slice();for(let g of c){let h=g.getTarget().getNode().getLayer();if(h!==i&&h!==s){let d=ON(t,s,g);n.splitEdge(g,d)}}}}e.done()}static splitEdge(t,e){let o=t.getTarget(),r=t.getProperty(_.EDGE_THICKNESS);r<0&&(r=0,t.setProperty(_.EDGE_THICKNESS,r)),e.getSize().y=r;let i=Math.floor(r/2),s=new rt;s.setSide(u.WEST),s.setNode(e),s.getPosition().y=i;let a=new rt;a.setSide(u.EAST),a.setNode(e),a.getPosition().y=i,t.setTarget(s);let l=new _e;return l.copyProperties(t),l.setProperty(_.JUNCTION_POINTS,null),l.setSource(a),l.setTarget(o),SN(e,t,l),TN(t,l),l}};function ON(n,t,e){let o=new ft(n);return o.setType(y.LONG_EDGE),o.setProperty(p.ORIGIN,e),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setLayer(t),o}function SN(n,t,e){let o=t.getSource().getNode(),r=e.getTarget().getNode();o.getType()===y.LONG_EDGE?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,o.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES))):o.getType()===y.LABEL?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,!0)):r.getType()===y.LABEL?(n.setProperty(p.LONG_EDGE_SOURCE,r.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,r.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,!0)):(n.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),n.setProperty(p.LONG_EDGE_TARGET,e.getTarget()))}function TN(n,t){let e=n.getLabels(),o=0;for(;o<e.length;){let r=e[o];r.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD?(e.splice(o,1),t.getLabels().push(r),r.hasProperty(p.END_LABEL_EDGE)||r.setProperty(p.END_LABEL_EDGE,n)):o++}}var gh=class{process(t,e){e.begin("Label dummy insertions",1);let o=[],r=t.getProperty(_.SPACING_EDGE_LABEL),i=t.getProperty(_.SPACING_LABEL_LABEL),s=t.getProperty(_.DIRECTION),a=s!=null&&s.isVertical&&s.isVertical();for(let l of t.getLayerlessNodes()){let c=[...l.getOutgoingEdges()];for(let g of c){if(!NN(g))continue;let h=yN(g),d=[],f=IN(t,g,d);o.push(f);let E=f.getSize(),P=g.getLabels(),S=0;for(;S<P.length;){let N=P[S];N.getProperty(_.EDGE_LABELS_PLACEMENT)===St.CENTER?(a?(E.x+=N.getSize().x+i,N.getSize().y>E.y&&(E.y=N.getSize().y)):(N.getSize().x>E.x&&(E.x=N.getSize().x),E.y+=N.getSize().y+i),d.push(N),P.splice(S,1)):S++}a?(E.x-=i,E.y+=r+h):E.y+=r-i+h;let T=Math.floor(h/2);for(let N of f.getPorts())N.getPosition().y=T}}for(let l of o)t.getLayerlessNodes().push(l);e.done()}};function NN(n){if(n.getSource().getNode()===n.getTarget().getNode())return!1;for(let t of n.getLabels())if(t.getProperty(_.EDGE_LABELS_PLACEMENT)===St.CENTER)return!0;return!1}function yN(n){let t=n.getProperty(_.EDGE_THICKNESS);return t<0&&(t=0,n.setProperty(_.EDGE_THICKNESS,t)),t}function IN(n,t,e){let o=new ft(n);return o.setType(y.LABEL),o.setProperty(p.ORIGIN,t),o.setProperty(p.REPRESENTED_LABELS,e),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),o.setProperty(p.LONG_EDGE_TARGET,t.getTarget()),ri.splitEdge(t,o),o}var ii=class n{process(t,e){e.begin("Edge joining",1);let o=t.getProperty(_.UNNECESSARY_BENDPOINTS);for(let r of t){let i=r.getNodes(),s=0;for(;s<i.length;){let a=i[s];a.getType()===y.LONG_EDGE?(n.joinAt(a,o),i.splice(s,1)):s++}}e.done()}static joinAt(t,e){let o=t.getPorts(u.WEST),r=t.getPorts(u.EAST),i=Fm(o),s=Fm(r),a=i.getIncomingEdges(),l=s.getOutgoingEdges(),c=a.length,g=t.getPorts()[0].getAbsoluteAnchor();for(;c-- >0;){let h=a[0],d=l[0],E=d.getTarget().getIncomingEdges().indexOf(d);h.setTargetAndInsertAtIndex(d.getTarget(),E),d.setSource(null),d.setTarget(null);let P=h.getBendPoints();e&&P.add(new O(g.x,g.y));for(let N of d.getBendPoints())P.add(new O(N.x,N.y));for(let N of d.getLabels())h.getLabels().push(N);let S=h.getProperty(_.JUNCTION_POINTS),T=d.getProperty(_.JUNCTION_POINTS);if(T!=null){S==null&&(S=new st,h.setProperty(_.JUNCTION_POINTS,S));for(let N of T)S.add(new O(N.x,N.y))}}}};function Fm(n){for(let t of n)return t;return null}var hh=class{process(t,e){e.begin("Label dummy removal",1);let o=t.getProperty(_.SPACING_EDGE_LABEL),r=t.getProperty(_.SPACING_LABEL_LABEL),i=t.getProperty(_.DIRECTION);for(let s of t.getLayers()){let a=s.getNodes(),l=0;for(;l<a.length;){let c=a[l];if(c.getType()!==y.LABEL){l++;continue}let g=c.getProperty(p.ORIGIN),h=Number(g.getProperty(_.EDGE_THICKNESS)),d=c.getProperty(p.LABEL_SIDE)===Vt.BELOW,f=new O(c.getPosition().x,c.getPosition().y);d&&(f.y+=h+o);let E=new O(c.getSize().x,c.getSize().y+(c.isInlineEdgeLabel()?0:-h-o)),P=c.getProperty(p.REPRESENTED_LABELS);i!=null&&i.isVertical&&i.isVertical()?LN(P,f,r,E,d,i):RN(P,f,r,E);for(let T of P)g.getLabels().push(T);let S=t.getProperty(_.EDGE_ROUTING);ii.joinAt(c,S===At.POLYLINE),a.splice(l,1)}}e.done()}};function RN(n,t,e,o){for(let r of n)r.getPosition().x=t.x+(o.x-r.getSize().x)/2,r.getPosition().y=t.y,t.y+=r.getSize().y+e}function LN(n,t,e,o,r,i){let s=n.every(l=>l.getProperty(_.EDGE_LABELS_INLINE)),a=i===R.UP?[...n].reverse():n;for(let l of a)l.getPosition().x=t.x,s?l.getPosition().y=t.y+(o.y-l.getSize().y)/2:r?l.getPosition().y=t.y:l.getPosition().y=t.y+o.y-l.getSize().y,t.x+=l.getSize().x+e}var Ct=class{constructor(t,e){this._name=t,this._usesLabelSize=e}toString(){return this._name}usesLabelSizeInformation(){return this._usesLabelSize}};Ct.MEDIAN_LAYER=new Ct("MEDIAN_LAYER",!1);Ct.TAIL_LAYER=new Ct("TAIL_LAYER",!1);Ct.HEAD_LAYER=new Ct("HEAD_LAYER",!1);Ct.SPACE_EFFICIENT_LAYER=new Ct("SPACE_EFFICIENT_LAYER",!0);Ct.WIDEST_LAYER=new Ct("WIDEST_LAYER",!0);Ct.CENTER_LAYER=new Ct("CENTER_LAYER",!0);Ct.values=()=>[Ct.MEDIAN_LAYER,Ct.TAIL_LAYER,Ct.HEAD_LAYER,Ct.SPACE_EFFICIENT_LAYER,Ct.WIDEST_LAYER,Ct.CENTER_LAYER];var tl=class n{constructor(){this._layerWidths=null}process(t,e){var i;e.begin("Label dummy switching",1);let o=(i=t.getProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY))!=null?i:Ct.MEDIAN_LAYER;AN(t);let r=CN(t,o);this._layerWidths=new Array(t.getLayers().length).fill(0);for(let s of Ct.values())if(s.usesLabelSizeInformation()&&r.get(s).length>0){this._calculateLayerWidths(t);break}for(let s of Ct.values())s.usesLabelSizeInformation()||this._processStrategy(r.get(s));for(let s of Ct.values())s.usesLabelSizeInformation()&&this._processStrategy(r.get(s));this._layerWidths=null,e.done()}_calculateLayerWidths(t){for(let e of t.getLayers())this._layerWidths[e.id]=z.findMaxNonDummyNodeWidth(e,!1)}_processStrategy(t){if(t.length!==0){if(t[0].placementStrategy===Ct.SPACE_EFFICIENT_LAYER){this._computeSpaceEfficientAssignment(t);return}for(let e of t){switch(e.placementStrategy){case Ct.CENTER_LAYER:this._assignLayer(e,this._findCenterLayerTargetId(e));break;case Ct.MEDIAN_LAYER:this._assignLayer(e,xN(e));break;case Ct.WIDEST_LAYER:this._assignLayer(e,this._findWidestLayerTargetId(e));break;case Ct.HEAD_LAYER:Wm(e),this._assignLayer(e,km(e,!0));break;case Ct.TAIL_LAYER:Wm(e),this._assignLayer(e,km(e,!1));break}wN(e)}}}_findWidestLayerTargetId(t){let e=t.leftmostLayerId;for(let o=e+1;o<=t.rightmostLayerId;o++)this._layerWidths[o]>this._layerWidths[e]&&(e=o);return e}_findCenterLayerTargetId(t){let e=this._computeLayerWidthSums(t),o=e[e.length-1]/2;for(let r=0;r<e.length;r++)if(e[r]>=o)return t.leftmostLayerId+r;return t.leftmostLayerId+t.leftLongEdgeDummies.length}_computeLayerWidthSums(t){let e=t.labelDummy.getGraph(),o=e.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS)*2,r=e.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),i=Math.max(o,r),s=new Array(t.totalDummyCount()),a=-i,l=0;for(let c of t.leftLongEdgeDummies)a+=this._layerWidths[c.getLayer().id]+i,s[l++]=a;a+=this._layerWidths[t.labelDummy.getLayer().id]+i,s[l++]=a;for(let c of t.rightLongEdgeDummies)a+=this._layerWidths[c.getLayer().id]+i,s[l++]=a;return s}_computeSpaceEfficientAssignment(t){let e=this._performTrivialAssignments(t);if(e.length!==0){e.sort((o,r)=>r.labelDummy.getSize().x-o.labelDummy.getSize().x);for(let o=0;o<e.length;o++)this._assignLayer(e[o],this._findPotentiallyWidestLayer(e,o))}}_performTrivialAssignments(t){let e=[];for(let o of t)o.leftmostLayerId===o.rightmostLayerId?this._assignLayer(o,o.leftmostLayerId):this._assignToWiderLayer(o)||e.push(o);return e}_assignToWiderLayer(t){let e=t.labelDummy.getSize().x,r=t.labelDummy.getGraph().getLayers().slice(t.leftmostLayerId,t.rightmostLayerId+1);for(let i of r)if(i.getSize().x>=e)return this._assignLayer(t,i.id),!0;return!1}_findPotentiallyWidestLayer(t,e){let o=t[e],r=o.labelDummy.getSize().x,i=o.leftmostLayerId,s=0;for(let a=o.leftmostLayerId;a<=o.rightmostLayerId;a++){if(r<=this._layerWidths[a])return a;let l=this._layerWidths[a],c=null;for(let g=e+1;g<t.length;g++){let h=t[g];h.leftmostLayerId<=a&&h.rightmostLayerId>=a&&(c=h)}c!=null&&(l=Math.max(l,c.labelDummy.getSize().x)),l>s&&(i=a,s=l)}return i}_assignLayer(t,e){e!==t.leftmostLayerId+t.leftLongEdgeDummies.length&&DN(t.labelDummy,t.ithDummyNode(e-t.leftmostLayerId));let o=t.labelDummy.getLayer().id;this._layerWidths[o]=Math.max(this._layerWidths[o],t.labelDummy.getSize().x);let r=t.labelDummy.getProperty(p.REPRESENTED_LABELS);if(r!=null)for(let i of r)i.setProperty(n.INCLUDE_LABEL,!0)}};tl.INCLUDE_LABEL=new m("edgelabelcenterednessanalysis.includelabel",!1);function AN(n){let t=0;for(let e of n)e.id=t++}function CN(n,t){let e=new Map;for(let o of Ct.values())e.set(o,[]);for(let o of n.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.LABEL)continue;let i=new u_(r,t);e.get(i.placementStrategy).push(i)}return e}function xN(n){let t=n.totalDummyCount(),e=Math.floor((t-1)/2);return n.leftmostLayerId+e}function km(n,t){let e=Ym(n);return t&&!e||!t&&e?n.rightmostLayerId:n.leftmostLayerId}function Wm(n){let t=n.placementStrategy===Ct.HEAD_LAYER,e=Ym(n);t&&!e||!t&&e?n.labelDummy.setProperty(_.ALIGNMENT,Kt.RIGHT):n.labelDummy.setProperty(_.ALIGNMENT,Kt.LEFT)}function Ym(n){let t=null;for(let o of n.labelDummy.getIncomingEdges()){t=o;break}let e=null;for(let o of n.labelDummy.getOutgoingEdges()){e=o;break}return t!=null&&t.getProperty(p.REVERSED)||e!=null&&e.getProperty(p.REVERSED)}function DN(n,t){let e=n.getLayer(),o=t.getLayer(),r=e.getNodes().indexOf(n),i=o.getNodes().indexOf(t),s=null;for(let E of n.getPorts(W.INPUT)){s=E;break}let a=null;for(let E of n.getPorts(W.OUTPUT)){a=E;break}let l=null;for(let E of t.getPorts(W.INPUT)){l=E;break}let c=null;for(let E of t.getPorts(W.OUTPUT)){c=E;break}let g=z.toEdgeArray(s.getIncomingEdges()),h=z.toEdgeArray(a.getOutgoingEdges()),d=z.toEdgeArray(l.getIncomingEdges()),f=z.toEdgeArray(c.getOutgoingEdges());n.setLayer(i,o);for(let E of d)E.setTarget(s);for(let E of f)E.setSource(a);t.setLayer(r,e);for(let E of g)E.setTarget(l);for(let E of h)E.setSource(c)}function wN(n){let t=n.labelDummy,e=zm(t);for(;e!=null&&e.getType()===y.LONG_EDGE;)e.setProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY,!0),e=zm(e)}function zm(n){for(let t of n.getIncomingEdges())return t.getSource().getNode();return null}var u_=class{constructor(t,e){this.labelDummy=t,this.placementStrategy=e,this.leftLongEdgeDummies=[],this.rightLongEdgeDummies=[],this.leftmostLayerId=0,this.rightmostLayerId=0,this._gatherLeftLongEdgeDummies(),this._gatherRightLongEdgeDummies(),this.leftLongEdgeDummies.length===0?this.leftmostLayerId=t.getLayer().id:this.leftmostLayerId=this.leftLongEdgeDummies[0].getLayer().id,this.rightLongEdgeDummies.length===0?this.rightmostLayerId=t.getLayer().id:this.rightmostLayerId=this.rightLongEdgeDummies[this.rightLongEdgeDummies.length-1].getLayer().id;let o=t.getProperty(p.REPRESENTED_LABELS);if(o!=null){for(let r of o)if(r.hasProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY)){this.placementStrategy=r.getProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY);break}}}_gatherLeftLongEdgeDummies(){let t=this.labelDummy;do{let e=null;for(let o of t.getIncomingEdges()){e=o.getSource().getNode();break}if(e==null)break;t=e,t.getType()===y.LONG_EDGE&&this.leftLongEdgeDummies.push(t)}while(t.getType()===y.LONG_EDGE);this.leftLongEdgeDummies.reverse()}_gatherRightLongEdgeDummies(){let t=this.labelDummy;do{let e=null;for(let o of t.getOutgoingEdges()){e=o.getTarget().getNode();break}if(e==null)break;t=e,t.getType()===y.LONG_EDGE&&this.rightLongEdgeDummies.push(t)}while(t.getType()===y.LONG_EDGE)}totalDummyCount(){return this.rightmostLayerId-this.leftmostLayerId+1}ithDummyNode(t){return t<this.leftLongEdgeDummies.length?this.leftLongEdgeDummies[t]:t===this.leftLongEdgeDummies.length?this.labelDummy:this.rightLongEdgeDummies[t-this.leftLongEdgeDummies.length-1]}};var Hn=new m("org.eclipse.elk.labels.labelManager");var MN=20,__=40,ol=60,el=class{constructor(t){this._centerLabels=!!t}process(t,e){e.begin("Label management",1);let o=t.getProperty(Hn);if(o!=null){let r=t.getProperty(_.SPACING_EDGE_LABEL),i=t.getProperty(_.SPACING_LABEL_LABEL);this._centerLabels?GN(t,o,r,i):bN(t,o,i)}e.done()}};function bN(n,t,e){let o=n.getProperty(_.DIRECTION),r=o!=null&&o.isVertical&&o.isVertical();for(let i of n)for(let s of i){if(s.getType()===y.NORMAL){As(t,s.getLabels(),__,e,r);for(let a of s.getPorts())As(t,a.getLabels(),MN,e,r);s.hasProperty(p.TOP_COMMENTS)&&Vm(t,s.getProperty(p.TOP_COMMENTS),__,r),s.hasProperty(p.BOTTOM_COMMENTS)&&Vm(t,s.getProperty(p.BOTTOM_COMMENTS),__,r)}for(let a of s.getOutgoingEdges())As(t,a.getLabels(),ol,0,r)}}function Vm(n,t,e,o){for(let r of t)r.getLabels().length!==0&&As(n,r.getLabels(),e,0,o)}function GN(n,t,e,o){let r=n.getProperty(_.DIRECTION),i=r!=null&&r.isVertical&&r.isVertical();for(let s of n){let a=Math.max(ol,z.findMaxNonDummyNodeWidth(s,!1));for(let l of s){if(l.getType()!==y.LABEL)continue;let c=null;for(let f of l.getConnectedEdges()){c=f;break}let g=c.getProperty(_.EDGE_THICKNESS),h=l.getProperty(p.REPRESENTED_LABELS),d=As(t,h,a,o,i);l.getSize().x=d.x,l.getSize().y=d.y+g+e}}}function As(n,t,e,o,r){let i=new O,s=!1;for(let a of t){s=!0;let l=a.getSize(),c=a.getProperty(p.ORIGIN);if(c!=null){let g=n.manageLabelSize(c,e);g!=null&&(r?(l.x=g.y,l.y=g.x):(l.x=g.x,l.y=g.y))}r?(i.x+=o+a.getSize().x,i.y=Math.max(i.y,l.y)):(i.x=Math.max(i.x,l.x),i.y+=o+a.getSize().y)}return s&&(r?i.x-=o:i.y-=o),i}var Tt=class{constructor(t){this.name=t,this._transposed=null}toString(){return this.name}transpose(){return this._transposed||this}};Tt.ALWAYS_UP=new Tt("ALWAYS_UP");Tt.ALWAYS_DOWN=new Tt("ALWAYS_DOWN");Tt.DIRECTION_UP=new Tt("DIRECTION_UP");Tt.DIRECTION_DOWN=new Tt("DIRECTION_DOWN");Tt.SMART_UP=new Tt("SMART_UP");Tt.SMART_DOWN=new Tt("SMART_DOWN");Tt.ALWAYS_UP._transposed=Tt.ALWAYS_DOWN;Tt.ALWAYS_DOWN._transposed=Tt.ALWAYS_UP;Tt.DIRECTION_UP._transposed=Tt.DIRECTION_DOWN;Tt.DIRECTION_DOWN._transposed=Tt.DIRECTION_UP;Tt.SMART_UP._transposed=Tt.SMART_DOWN;Tt.SMART_DOWN._transposed=Tt.SMART_UP;[Tt.ALWAYS_UP,Tt.ALWAYS_DOWN,Tt.DIRECTION_UP,Tt.DIRECTION_DOWN,Tt.SMART_UP,Tt.SMART_DOWN].forEach(n=>Object.freeze(n));var dh=class{process(t,e){let o=t.getProperty(_.EDGE_LABELS_SIDE_SELECTION);switch(e.begin(`Label side selection (${o})`,1),o){case Tt.ALWAYS_UP:Xm(t,Vt.ABOVE);break;case Tt.ALWAYS_DOWN:Xm(t,Vt.BELOW);break;case Tt.DIRECTION_UP:Km(t,Vt.ABOVE);break;case Tt.DIRECTION_DOWN:Km(t,Vt.BELOW);break;case Tt.SMART_UP:Zm(t,Vt.ABOVE);break;case Tt.SMART_DOWN:Zm(t,Vt.BELOW);break}e.done()}};function Xm(n,t){for(let e of n)for(let o of e){o.getType()===y.LABEL&&si(o,t);for(let r of o.getOutgoingEdges())Qm(r,t)}}function Km(n,t){for(let e of n)for(let o of e){if(o.getType()===y.LABEL){let r=BN(o)?t:t.opposite();si(o,r)}for(let r of o.getOutgoingEdges()){let i=p_(r)?t:t.opposite();Qm(r,i)}}}function Zm(n,t){let e=[];for(let o of n){let r=!0,i=0;for(let s of o){let a=s.getType();if(a===y.LABEL){i++,e.push(s);continue}if(a===y.LONG_EDGE){e.push(s);continue}a===y.NORMAL&&vN(s,t),e.length>0&&jm(e,i,r,!1,t),r=!1,i=0}e.length>0&&jm(e,i,r,!0,t)}}function jm(n,t,e,o,r){e&&(!o||n.length>1)&&t===1&&n[0].getType()===y.LABEL?si(n[0],Vt.ABOVE):o&&(!e||n.length>1)&&t===1&&n[n.length-1].getType()===y.LABEL?si(n[n.length-1],Vt.BELOW):n.length===2?(si(n.shift(),Vt.ABOVE),si(n.shift(),Vt.BELOW)):HN(n,t,r),n.length=0}function HN(n,t,e){let o=[],r=null,i=null;for(let s of n){let a=$m(s,!0),l=$m(s,!1);(r!==a||i!==l)&&(qm(o,e),r=a,i=l),o.push(s)}qm(o,e)}function $m(n,t){let e=n.getProperty(t?p.LONG_EDGE_SOURCE:p.LONG_EDGE_TARGET);return e==null?null:e.getNode()}function qm(n,t){if(n.length>0){if(n.length===2)si(n[0],Vt.ABOVE),si(n[1],Vt.BELOW);else for(let e of n)si(e,t);n.length=0}}function vN(n,t){let e=[],o=null;for(let r of n.getPorts()){r.getSide()!==o&&(e.length>0&&Jm(e,o,t),e.length=0,o=r.getSide());let i=In.gatherLabels(r);i!=null&&e.push(i)}e.length>0&&Jm(e,o,t)}function Jm(n,t,e){if(n.length===2)t===u.NORTH||t===u.EAST?(rl(n.shift(),Vt.ABOVE),rl(n.shift(),Vt.BELOW)):(rl(n.shift(),Vt.BELOW),rl(n.shift(),Vt.ABOVE));else for(let o of n)rl(o,e)}function si(n,t){if(n.getType()!==y.LABEL)return;let e=n.isInlineEdgeLabel()?Vt.INLINE:t;if(n.setProperty(p.LABEL_SIDE,e),e!==Vt.BELOW){let r=n.getProperty(p.ORIGIN).getProperty(_.EDGE_THICKNESS),i=0;if(e===Vt.ABOVE)i=n.getSize().y-Math.ceil(r/2);else if(e===Vt.INLINE){let s=n.getGraph().getProperty(_.SPACING_EDGE_LABEL);i=Math.ceil(n.getSize().y-s-r)/2,n.getSize().y-=s,n.getSize().y-=r}for(let s of n.getPorts())s.getPosition().y=i}}function Qm(n,t){for(let e of n.getLabels())e.setProperty(p.LABEL_SIDE,t)}function rl(n,t){for(let e of n)e.setProperty(p.LABEL_SIDE,t)}function p_(n){return!n.getProperty(p.REVERSED)}function BN(n){let t=null;for(let o of n.getIncomingEdges()){t=o;break}let e=null;for(let o of n.getOutgoingEdges()){e=o;break}return t!=null&&p_(t)||e!=null&&p_(e)}var fh=class{process(t,e){e.begin("Layer constraint postprocessing",1);let o=t.getLayers();if(o.length>0){let r=o[0],i=o[o.length-1],s=new Et(t),a=new Et(t);UN(t,r,i,s,a),s.getNodes().length>0&&o.unshift(s),a.getNodes().length>0&&o.push(a)}if(t.hasProperty(p.HIDDEN_NODES)){let r=new Et(t),i=new Et(t);FN(t,r,i),r.getNodes().length>0&&o.unshift(r),i.getNodes().length>0&&o.push(i)}e.done()}};function UN(n,t,e,o,r){for(let a of n){let l=a.getNodes().slice();for(let c of l)switch(c.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST:kN(c),c.setLayer(t),tP(c,!0,o);break;case J.LAST:WN(c),c.setLayer(e),tP(c,!1,r);break;default:break}}let i=n.getLayers(),s=0;for(;s<i.length;)i[s].getNodes().length===0?i.splice(s,1):s++}function tP(n,t,e){let o=t?n.getIncomingEdges():n.getOutgoingEdges();for(let r of o){let i=t?r.getSource().getNode():r.getTarget().getNode();i.getType()===y.LABEL&&i.setLayer(e)}}function FN(n,t,e){for(let o of n.getProperty(p.HIDDEN_NODES)){let r=o.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(r===J.FIRST_SEPARATE)o.setLayer(t);else if(r===J.LAST_SEPARATE)o.setLayer(e);else throw new Error(`Hidden node ${o} has unexpected layer constraint ${r}`);for(let i of o.getConnectedEdges()){if(i.getSource()!=null&&i.getTarget()!=null)continue;let s=i.getTarget()==null,a=i.getProperty(p.ORIGINAL_OPPOSITE_PORT);s?i.setTarget(a):i.setSource(a)}}}function kN(n){for(let t of n.getIncomingEdges())if(t.getSource().getNode().getType()!==y.LABEL)throw new Error(`Node '${n.getDesignation()}' has FIRST layer constraint with a non-LABEL incoming edge.`)}function WN(n){for(let t of n.getOutgoingEdges())if(t.getTarget().getNode().getType()!==y.LABEL)throw new Error(`Node '${n.getDesignation()}' has LAST layer constraint with a non-LABEL outgoing edge.`)}var oP="NONE",vn="FIRST_SEPARATE",uh="LAST_SEPARATE",E_="BOTH",$K=Symbol("separateLayerConnections"),_h=class{process(t,e){e.begin("Layer constraint preprocessing",1);let o=[],r=t.getLayerlessNodes(),i=0;for(;i<r.length;){let s=r[i];zN(s)?(YN(s),o.push(s),r.splice(i,1)):i++}o.length>0&&t.setProperty(p.HIDDEN_NODES,o),e.done()}};function zN(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT);return t===J.FIRST_SEPARATE||t===J.LAST_SEPARATE}function YN(n){$N(n);let t=[];for(let e of n.getConnectedEdges())t.push(e);for(let e of t)VN(n,e)}function VN(n,t){let e=t.getSource().getNode()===n,o=e?t.getTarget():t.getSource();e?t.setTarget(null):t.setSource(null),t.setProperty(p.ORIGINAL_OPPOSITE_PORT,o),XN(n,o.getNode())}function XN(n,t){if(t.hasProperty(_.LAYERING_LAYER_CONSTRAINT))return;let e=KN(t),o=jN(e,n.getProperty(_.LAYERING_LAYER_CONSTRAINT));ZN(t,o),t.getConnectedEdges()[Symbol.iterator]().next().done&&(o===vn?t.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST):o===uh&&t.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST))}function KN(n){return n._hiddenConnections||oP}function ZN(n,t){n._hiddenConnections=t}function jN(n,t){let e=t===J.FIRST_SEPARATE?vn:uh;return n===oP?e:n===vn?e===vn?vn:E_:n===uh?e===vn?E_:uh:E_}function $N(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(t===J.FIRST_SEPARATE){for(let e of n.getIncomingEdges())if(!eP(e))throw new Error(`Node '${n.getDesignation()}' has FIRST_SEPARATE with an incoming edge.`)}else if(t===J.LAST_SEPARATE){for(let e of n.getOutgoingEdges())if(!eP(e))throw new Error(`Node '${n.getDesignation()}' has LAST_SEPARATE with an outgoing edge.`)}}function eP(n){let t=n.getSource().getNode(),e=n.getTarget().getNode();return t.getType()===y.EXTERNAL_PORT&&e.getType()===y.EXTERNAL_PORT}var ph=class{process(t,e){e.begin("Layer size calculation",1);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=!1;for(let s of t){let a=s.getSize();if(a.x=0,a.y=0,s.getNodes().length===0)continue;i=!0;for(let d of s){let f=d.getSize(),E=d.getMargin(),P=f.x+E.left+E.right;P>a.x&&(a.x=P)}let l=s.getNodes()[0],c=l.getPosition().y-l.getMargin().top;if(l.getType()===y.EXTERNAL_PORT){let d=t.getProperty(_.SPACING_PORTS_SURROUNDING);d!=null&&(c-=d.top)}let g=s.getNodes()[s.getNodes().length-1],h=g.getPosition().y+g.getSize().y+g.getMargin().bottom;if(g.getType()===y.EXTERNAL_PORT){let d=t.getProperty(_.SPACING_PORTS_SURROUNDING);d!=null&&(h+=d.bottom)}a.y=h-c,c<o&&(o=c),h>r&&(r=h)}i||(o=0,r=0),t.getSize().y=r-o,t.getOffset().y=t.getOffset().y-o,e.done()}};var il=class{constructor(){this._keyToValues=new Map,this._valueToKey=new Map}putAll(t,e){for(let o of e)this.put(t,o)}put(t,e){let o=this._valueToKey.get(e);if(o!==void 0){let i=this._keyToValues.get(o);if(i){let s=i.indexOf(e);s>=0&&i.splice(s,1)}}let r=this._keyToValues.get(t);r==null&&(r=[],this._keyToValues.set(t,r)),r.push(e),this._valueToKey.set(e,t)}getKey(t){return this._valueToKey.get(t)}getValues(t){let e=this._keyToValues.get(t);return e==null?[]:e}keySet(){return this._keyToValues.keys()}isMaximalKey(t){for(let e of this._keyToValues.keys())if(typeof t.compareTo=="function"?t.compareTo(e)<0:t<e)return!1;return!0}isMinimalKey(t){for(let e of this._keyToValues.keys())if(typeof t.compareTo=="function"?t.compareTo(e)>0:t>e)return!1;return!0}};var ut=class{constructor(t){this._name=t}toString(){return this._name}};ut.NONE=new ut("NONE");ut.NIKOLOV=new ut("NIKOLOV");ut.NIKOLOV_PIXEL=new ut("NIKOLOV_PIXEL");ut.NIKOLOV_IMPROVED=new ut("NIKOLOV_IMPROVED");ut.NIKOLOV_IMPROVED_PIXEL=new ut("NIKOLOV_IMPROVED_PIXEL");ut.DUMMYNODE_PERCENTAGE=new ut("DUMMYNODE_PERCENTAGE");ut.NODECOUNT_PERCENTAGE=new ut("NODECOUNT_PERCENTAGE");ut.NO_BOUNDARY=new ut("NO_BOUNDARY");ut.MODEL_ORDER_LEFT_TO_RIGHT=new ut("MODEL_ORDER_LEFT_TO_RIGHT");ut.MODEL_ORDER_RIGHT_TO_LEFT=new ut("MODEL_ORDER_RIGHT_TO_LEFT");var Eh=class{constructor(){this._masterGraph=null,this._nodesWithIncomingEdges=[],this._nodes=[],this._currentWidth=[],this._currentWidthPixel=[],this._layers=[],this._degreeDiff=[],this._maxWidth=0,this._maxWidthPixel=0,this._dummyNodeCount=0,this._maxHeight=0,this._nodeSizeAffix=0,this._dummySize=0,this._promotionStrategy=null,this._biLayerMap=new il}process(t,e){e.begin("Node promotion heuristic",1),this._masterGraph=t,this._promotionStrategy=t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY),this._promotionStrategy!==ut.MODEL_ORDER_LEFT_TO_RIGHT&&this._promotionStrategy!==ut.MODEL_ORDER_RIGHT_TO_LEFT?this._precalculateAndSetInformation():this._precalculateAndSetInformationModelOrder();let o=t.getProperty(_.LAYERING_NODE_PROMOTION_MAX_ITERATIONS),r=()=>!0;switch(this._promotionStrategy){case ut.NIKOLOV:this._promotionMagic(r);break;case ut.NIKOLOV_PIXEL:this._promotionMagic(r);break;case ut.NIKOLOV_IMPROVED:{this._promotionStrategy=ut.NO_BOUNDARY,this._promotionMagic(r);let i=0;for(let s of this._currentWidth)i=Math.max(i,s);i>this._maxWidth&&(this._promotionStrategy=ut.NIKOLOV,this._promotionMagic(r));break}case ut.NIKOLOV_IMPROVED_PIXEL:{this._promotionStrategy=ut.NO_BOUNDARY,this._promotionMagic(r);let i=0;for(let s of this._currentWidthPixel)i=Math.max(i,s);i>this._maxWidthPixel&&(this._promotionStrategy=ut.NIKOLOV_PIXEL,this._promotionMagic(r));break}case ut.NODECOUNT_PERCENTAGE:{let i=Math.ceil(this._layers.length*o/100);this._promotionMagic(s=>s.getSecond()<i);break}case ut.DUMMYNODE_PERCENTAGE:{let i=Math.ceil(this._dummyNodeCount*o/100);this._promotionMagic(s=>s.getFirst()<i);break}case ut.MODEL_ORDER_LEFT_TO_RIGHT:this._modelOrderNodePromotion(!0);break;case ut.MODEL_ORDER_RIGHT_TO_LEFT:this._modelOrderNodePromotion(!1);break;default:this._promotionMagic(r);break}this._promotionStrategy!==ut.MODEL_ORDER_LEFT_TO_RIGHT&&this._promotionStrategy!==ut.MODEL_ORDER_RIGHT_TO_LEFT?this._setNewLayering(t):this._setNewLayeringModelOrder(t),e.done()}_precalculateAndSetInformation(){this._nodeSizeAffix=this._masterGraph.getProperty(_.SPACING_NODE_NODE),this._dummySize=this._masterGraph.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._maxHeight=this._masterGraph.getLayers().length;let t=this._maxHeight-1,e=0;this._maxWidth=0,this._maxWidthPixel=0,this._currentWidth=new Array(this._maxHeight).fill(0),this._currentWidthPixel=new Array(this._maxHeight).fill(0);for(let r of this._masterGraph.getLayers()){r.id=t;for(let i of r.getNodes())i.id=e,e++;t--}this._layers=new Array(e).fill(0),this._degreeDiff=new Array(e);for(let r=0;r<e;r++)this._degreeDiff[r]=[0,0,0];this._nodes=[],this._nodesWithIncomingEdges=[];let o=0;this._dummyNodeCount=0;for(let r of this._masterGraph){t=r.id;let i=0,s=0,a=r.getNodes().length,l=0;for(let g of r.getNodes()){e=g.id,this._layers[e]=g.getLayer().id,l+=g.getSize().y+this._nodeSizeAffix;let h=0;for(let f of g.getIncomingEdges())h++;let d=0;for(let f of g.getOutgoingEdges())d++;this._degreeDiff[e][0]=d-h,this._degreeDiff[e][1]=h,this._degreeDiff[e][2]=d,i+=h,s+=d,h>0&&this._nodesWithIncomingEdges.push(g),this._nodes.push(g)}o-=i;let c=a+o;l+=o*this._dummySize,this._currentWidth[t]=c,this._currentWidthPixel[t]=l,this._maxWidth=Math.max(this._maxWidth,c),this._maxWidthPixel=Math.max(this._maxWidthPixel,l),this._dummyNodeCount+=o,o+=s}}_precalculateAndSetInformationModelOrder(){this._biLayerMap=new il;let t=0,e=0;for(let i of this._masterGraph.getLayers()){i.id=e;for(let s of i.getNodes())s.id=t,t++;e++}let r=this._promotionStrategy===ut.MODEL_ORDER_LEFT_TO_RIGHT?qN:JN;for(let i of this._masterGraph)i.getNodes().sort(r),this._biLayerMap.putAll(i.id,i.getNodes())}_modelOrderNodePromotion(t){let e=0;for(let s of this._masterGraph.getLayers())e+=s.getNodes().length;let o=2*(this._masterGraph.getLayers().length+e)+10,r=0,i;do{i=!1;let a=[...this._biLayerMap.keySet()].length,l=t?a-2:1,c=t?h=>h>=0:h=>h<a,g=t?-1:1;for(let h=l;c(h);h+=g){let d=this._biLayerMap.getValues(h);for(let f=0;f<d.length;f++){let E=d[f];if(!E.hasProperty(p.MODEL_ORDER)||this._biLayerMap.isMaximalKey(h)&&this._promotionStrategy===ut.MODEL_ORDER_LEFT_TO_RIGHT||this._biLayerMap.isMinimalKey(h)&&this._promotionStrategy===ut.MODEL_ORDER_RIGHT_TO_LEFT)continue;let P=!0;for(let x of d){if(!x.hasProperty(p.MODEL_ORDER))continue;let M=E.getProperty(p.MODEL_ORDER),A=x.getProperty(p.MODEL_ORDER);if(t&&M<A||!t&&M>A){P=!1;break}}if(!P)continue;let S=t?h+1:h-1,T=this._biLayerMap.getValues(S),N=!1,I=!0,C=!1;for(let x of T)if(x.hasProperty(p.MODEL_ORDER)){if(x.id!==E.id){let M=x.getProperty(p.MODEL_ORDER),A=E.getProperty(p.MODEL_ORDER);N||(N=t?M<A:M>A),I=!1}}else if(!N&&I&&x.getType()===y.LABEL){C=!0;let M;if(t?M=Bn(x.getIncomingEdges()).getSource().getNode():M=Bn(x.getOutgoingEdges()).getTarget().getNode(),M===E){let A;t?A=Bn(x.getOutgoingEdges()).getTarget().getNode():A=Bn(x.getIncomingEdges()).getSource().getNode(),(t?this._biLayerMap.getKey(A)-this._biLayerMap.getKey(M):this._biLayerMap.getKey(M)-this._biLayerMap.getKey(A))<=2&&(I=!1)}}if(C&&I){let x;t?x=Bn(E.getOutgoingEdges()).getTarget().getNode():x=Bn(E.getIncomingEdges()).getSource().getNode(),(t?this._biLayerMap.getKey(x)-this._biLayerMap.getKey(E):this._biLayerMap.getKey(E)-this._biLayerMap.getKey(x))<=2&&x.getType()===y.NORMAL&&(I=!1)}if(N||I){let x=this._promoteNodeByModelOrder(E,t);for(;x.size>0;){let M=x.values().next().value;x.delete(M);for(let A of this._promoteNodeByModelOrder(M,t))x.add(A)}f--,i=!0}}}}while(i&&++r<o)}_promoteNodeByModelOrder(t,e){let o=this._biLayerMap.getKey(t);e?this._biLayerMap.put(o+1,t):this._biLayerMap.put(o-1,t);let r=new Set,i=e?t.getOutgoingEdges():t.getIncomingEdges();for(let s of i){let a=e?s.getTarget().getNode():s.getSource().getNode();this._biLayerMap.getKey(a)===this._biLayerMap.getKey(t)&&r.add(a)}return r}_promotionMagic(t){let e,o,r=0,i=0,s=this._layers.slice(),a=this._dummyNodeCount,l=this._maxHeight,c=this._currentWidth.slice(),g=this._currentWidthPixel.slice();do{e=0;for(let h of this._nodesWithIncomingEdges){let d=this._promoteNode(h),f=!0;(this._promotionStrategy===ut.NIKOLOV||this._promotionStrategy===ut.NIKOLOV_PIXEL)&&(f=d.getSecond()),d.getFirst()<0&&f?(e++,s=this._layers.slice(),this._dummyNodeCount=this._dummyNodeCount+d.getFirst(),i+=a-this._dummyNodeCount,a=this._dummyNodeCount+d.getFirst(),l=this._maxHeight,c=this._currentWidth.slice(),g=this._currentWidthPixel.slice()):(this._layers=s.slice(),this._dummyNodeCount=a,this._currentWidth=c.slice(),this._currentWidthPixel=g.slice(),this._maxHeight=l)}r++,o=e!==0&&t(Gt.of(i,r))}while(o)}_promoteNode(t){let e=!0,o=0,r=this._layers[t.id],i=t.getSize().y+this._nodeSizeAffix,s=this._degreeDiff[t.id][2];if(this._currentWidth[r]=this._currentWidth[r]-1+s,this._currentWidthPixel[r]=this._currentWidthPixel[r]-i+s*this._dummySize,r++,r>=this._maxHeight)this._maxHeight++,this._currentWidth.push(1),this._currentWidthPixel.push(i);else{let a=this._degreeDiff[t.id][1];this._currentWidth[r]=this._currentWidth[r]+1-a,this._currentWidthPixel[r]=this._currentWidthPixel[r]+i-a*this._dummySize}(this._promotionStrategy===ut.NIKOLOV&&(this._currentWidth[r]>this._maxWidth||this._currentWidth[r-1]>this._maxWidth)||this._promotionStrategy===ut.NIKOLOV_PIXEL&&(this._currentWidthPixel[r]>this._maxWidthPixel||this._currentWidthPixel[r-1]>this._maxWidthPixel))&&(e=!1);for(let a of t.getIncomingEdges()){let l=a.getSource().getNode();if(this._layers[l.id]===r){let c=this._promoteNode(l);o=o+c.getFirst(),e=e&&c.getSecond()}}return this._layers[t.id]=r,o=o+this._degreeDiff[t.id][0],Gt.of(o,e)}_setNewLayering(t){let e=[];for(let o=0;o<=this._maxHeight;o++){let r=new Et(t);r.id=this._maxHeight-o,e.push(r)}for(let o of this._nodes)o.setLayer(e[this._maxHeight-this._layers[o.id]]);for(let o=e.length-1;o>=0;o--)e[o].getNodes().length===0&&e.splice(o,1);t.getLayers().length=0;for(let o of e)t.getLayers().push(o)}_setNewLayeringModelOrder(t){let e=[];t.getLayers().length=0;let o=[...this._biLayerMap.keySet()].sort((r,i)=>r-i);for(let r of o){let i=this._biLayerMap.getValues(r);if(i.length===0)continue;let s=new Et(t);e.push(s),s.id=r;for(let a of i)a.setLayer(s)}for(let r of e)t.getLayers().push(r)}};function qN(n,t){return n.hasProperty(p.MODEL_ORDER)&&t.hasProperty(p.MODEL_ORDER)?t.getProperty(p.MODEL_ORDER)-n.getProperty(p.MODEL_ORDER):0}function JN(n,t){return n.hasProperty(p.MODEL_ORDER)&&t.hasProperty(p.MODEL_ORDER)?n.getProperty(p.MODEL_ORDER)-t.getProperty(p.MODEL_ORDER):0}function Bn(n){for(let t of n)return t;return null}var mh=class{process(t,e){e.begin("Odd port side processing",1);let o=t.getProperty(_.EDGE_ROUTING);for(let r of t){let i=z.toNodeArray(r.getNodes());for(let s of i)if(s.getType()===y.NORTH_SOUTH_PORT){if(o===At.SPLINES)for(let a of s.getPorts())a.getIncomingEdges().length>0&&oy(a),a.getOutgoingEdges().length>0&&ry(a);else if(s.getProperty(p.ORIGIN)instanceof _e)ey(s);else{let a=s.getPorts(),l=!1;if(a.length>=2){l=!0;for(let c=1;c<a.length;c++)if(a[c-1].getProperty(p.ORIGIN)!==a[c].getProperty(p.ORIGIN)){l=!1;break}}for(let c of a)c.getIncomingEdges().length>0&&QN(c,l),c.getOutgoingEdges().length>0&&ty(c,l)}s.setLayer(null)}}e.done()}};function QN(n,t){let e=n.getProperty(p.ORIGIN),o=e.getAbsoluteAnchor().x,r=n.getNode().getPosition().y,i=z.toEdgeArray(n.getIncomingEdges());for(let s of i)if(s.setTarget(e),s.getBendPoints().addLast(o,r),t){let a=s.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,s.setProperty(_.JUNCTION_POINTS,a)),a.add(new O(o,r))}}function ty(n,t){let e=n.getProperty(p.ORIGIN),o=e.getAbsoluteAnchor().x,r=n.getNode().getPosition().y,i=z.toEdgeArray(n.getOutgoingEdges());for(let s of i)if(s.setSource(e),s.getBendPoints().addFirst(o,r),t){let a=s.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,s.setProperty(_.JUNCTION_POINTS,a)),a.add(new O(o,r))}}function ey(n){let t=n.getProperty(p.ORIGIN),e=[...n.getPorts(u.WEST)][0],o=[...n.getPorts(u.EAST)][0],r=e.getProperty(p.ORIGIN),i=o.getProperty(p.ORIGIN);t.setSource(i),t.setTarget(r);let s=new O(o.getNode().getPosition());s.x=i.getAbsoluteAnchor().x,t.getBendPoints().add(s);let a=new O(e.getNode().getPosition());a.x=r.getAbsoluteAnchor().x,t.getBendPoints().add(a)}function oy(n){let t=n.getProperty(p.ORIGIN);t.setProperty(p.SPLINE_NS_PORT_Y_COORD,n.getNode().getPosition().y);let e=z.toEdgeArray(n.getIncomingEdges());for(let o of e)o.setTarget(t)}function ry(n){let t=n.getProperty(p.ORIGIN);t.setProperty(p.SPLINE_NS_PORT_Y_COORD,n.getNode().getPosition().y);let e=z.toEdgeArray(n.getOutgoingEdges());for(let o of e)o.setSource(t)}var $t=class{constructor(t){this._name=t,Object.freeze(this)}toString(){return this._name}};$t.NONE=new $t("NONE");$t.NODES_AND_EDGES=new $t("NODES_AND_EDGES");$t.PREFER_EDGES=new $t("PREFER_EDGES");$t.PREFER_NODES=new $t("PREFER_NODES");var Ph=class{process(t,e){e.begin("Odd port side processing",1);let o=[],r=[];for(let i of t){let s=-1,a=z.toNodeArray(i.getNodes());for(let l of a){s++;let c=l.getProperty(_.PORT_CONSTRAINTS);if(l.getType()!==y.NORMAL||!c.isSideFixed())continue;!c.isOrderFixed()&&l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)===$t.NONE&&iy(l),l.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),o.length=0,r.length=0;let g=[],h=[...l.getPorts(u.NORTH)];l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==$t.NONE&&(h=iP(h)),sP(t,h,o,r,g);let d=s,f=l;for(let S of o)S.setLayer(d,i),s++,S.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),S.getPorts()[0].getProperty(p.ORIGIN).getProperty(_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES)||S.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(f);let E=[];for(let S of l.getPorts(u.SOUTH))E.unshift(S);l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==$t.NONE&&(E=iP(E)),sP(t,E,r,null,g);let P=l;for(let S of r)S.setLayer(++s,i),S.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),S.getPorts()[0].getProperty(p.ORIGIN).getProperty(_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES)||P.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(S);g.length>0&&l.setProperty(p.BARYCENTER_ASSOCIATES,g)}}e.done()}};function iy(n){let t=n.getPorts().length,e=0,o=t,r=2*t;for(let i of n.getPorts()){let s=i.getSide();if(s===u.EAST||s===u.WEST){i.id=-1;continue}if(s!==u.NORTH&&s!==u.SOUTH)continue;let a=i.getIncomingEdges().length,l=i.getOutgoingEdges().length;a>0&&l>0?i.id=o++:a>0?i.id=e++:l>0?i.id=r++:i.id=e++}n.getPorts().sort((i,s)=>{let a=i.getSide(),l=s.getSide();return a!==l?rP(a)-rP(l):i.id===s.id?0:a===u.NORTH?i.id-s.id:s.id-i.id})}function rP(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function iP(n){let t=[],e=[];for(let o of n)o.getIncomingEdges().length>0?t.push(o):e.push(o);return t.reverse(),t.concat(e)}function sP(n,t,e,o,r){let i=[],s=[],a=[],l=[],c=[];for(let g of t)for(let h of g.getOutgoingEdges())h.getSource().getNode()===h.getTarget().getNode()&&(g.getSide()===h.getTarget().getSide()?l.push(h):g.getSide()===u.NORTH&&h.getTarget().getSide()===u.SOUTH&&c.push(h));for(let g of c)ny(n,g,e,o,u.EAST);for(let g of l)sy(n,g,e);for(let g of t){let h=g.getIncomingEdges().length>0,d=g.getOutgoingEdges().length>0;h&&d?a.push(g):h?i.push(g):d&&s.push(g)}for(let g of i)r.push(m_(n,g,null,e));for(let g of s)r.push(m_(n,null,g,e));for(let g of a)r.push(m_(n,g,g,e))}function m_(n,t,e,o){let r=new ft(n);r.setType(y.NORTH_SOUTH_PORT),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS);let i=0;if(t!=null){let s=new rt;s.setProperty(p.ORIGIN,t),r.setProperty(p.ORIGIN,t.getNode()),s.setSide(u.WEST),s.setNode(r);let a=z.toEdgeArray(t.getIncomingEdges());for(let l of a)l.setTarget(s);t.setProperty(p.PORT_DUMMY,r),i++}if(e!=null){let s=new rt;r.setProperty(p.ORIGIN,e.getNode()),s.setProperty(p.ORIGIN,e),s.setSide(u.EAST),s.setNode(r);let a=z.toEdgeArray(e.getOutgoingEdges());for(let l of a)l.setSource(s);e.setProperty(p.PORT_DUMMY,r),i++}return r.setProperty(p.CROSSING_HINT,i),o.push(r),r}function sy(n,t,e){let o=new ft(n);o.setType(y.NORTH_SOUTH_PORT),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setProperty(p.ORIGIN,t);let r=new rt;r.setProperty(p.ORIGIN,t.getTarget()),r.setSide(u.WEST),r.setNode(o);let i=new rt;i.setProperty(p.ORIGIN,t.getSource()),i.setSide(u.EAST),i.setNode(o),t.getSource().setProperty(p.PORT_DUMMY,o),t.getTarget().setProperty(p.PORT_DUMMY,o),t.setSource(null),t.setTarget(null),e.push(o),o.setProperty(p.CROSSING_HINT,2)}function ny(n,t,e,o,r){let i=new ft(n);i.setType(y.NORTH_SOUTH_PORT),i.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),i.setProperty(p.ORIGIN,t.getSource().getNode());let s=new rt;s.setProperty(p.ORIGIN,t.getSource()),s.setSide(r),s.setNode(i),t.getSource().setProperty(p.PORT_DUMMY,i);let a=new ft(n);a.setType(y.NORTH_SOUTH_PORT),a.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),a.setProperty(p.ORIGIN,t.getTarget().getNode());let l=new rt;l.setProperty(p.ORIGIN,t.getTarget()),l.setSide(r),l.setNode(a),t.getTarget().setProperty(p.PORT_DUMMY,a),t.setSource(s),t.setTarget(l),e.unshift(i),o.push(a),i.setProperty(p.CROSSING_HINT,1),a.setProperty(p.CROSSING_HINT,1)}var Oh=class{process(t,e){e.begin("Partition midprocessing",1);let o=new Map;for(let i of t.getLayerlessNodes()){if(!i.hasProperty(_.PARTITIONING_PARTITION))continue;let s=i.getProperty(_.PARTITIONING_PARTITION),a=o.get(s);a==null&&(a=[],o.set(s,a)),a.push(i)}if(o.size===0){e.done();return}let r=Array.from(o.keys()).sort((i,s)=>i-s);for(let i=0;i<r.length-1;i++){let s=o.get(r[i]),a=o.get(r[i+1]);ay(s,a)}e.done()}};function ay(n,t){for(let e of n){let o=new rt;o.setNode(e),o.setSide(u.EAST),o.setProperty(p.PARTITION_DUMMY,!0);for(let r of t){let i=new rt;i.setNode(r),i.setSide(u.WEST),i.setProperty(p.PARTITION_DUMMY,!0);let s=new _e;s.setProperty(p.PARTITION_DUMMY,!0),s.setSource(o),s.setTarget(i)}}}var Sh=class{process(t,e){e.begin("Partition postprocessing",1);for(let o of t)for(let r of o){let i=r.getPorts(),s=0;for(;s<i.length;)i[s].getProperty(p.PARTITION_DUMMY)?i.splice(s,1):s++}e.done()}};var ly=1e3,Th=class{process(t,e){e.begin("Partition preprocessing",1);let o=[];for(let i of t.getLayerlessNodes())i.hasProperty(_.PARTITIONING_PARTITION)&&o.push(i);let r=[];for(let i of o)for(let s of i.getOutgoingEdges())cy(s,o)&&r.push(s);for(let i of r)gy(i,t);e.done()}};function cy(n,t){let e=n.getSource().getNode(),o=n.getTarget().getNode();if(o.hasProperty(_.PARTITIONING_PARTITION)){let l=e.getProperty(_.PARTITIONING_PARTITION),c=o.getProperty(_.PARTITIONING_PARTITION);return l>c}let r=e.getProperty(_.PARTITIONING_PARTITION),i=new Set;for(let l of t)l.getProperty(_.PARTITIONING_PARTITION)<r&&i.add(l);let s=[e],a=new Set([e]);for(;s.length>0;){let l=s.shift();if(i.has(l))return!0;for(let c of l.getOutgoingEdges()){let g=c.getTarget().getNode();a.has(g)||(a.add(g),s.push(g))}}return!1}function gy(n,t){n.reverse(t,!0);let e=ly;n.hasProperty(_.PRIORITY_DIRECTION)&&(e+=n.getProperty(_.PRIORITY_DIRECTION)),n.setProperty(_.PRIORITY_DIRECTION,e)}var Ih=class{process(t,e){e.begin("Port order processing",1);let o=t.getProperty(_.PORT_SORTING_STRATEGY);for(let r of t)for(let i of r){let s=i.getProperty(_.PORT_CONSTRAINTS),a=i.getPorts();s.isOrderFixed()?a.sort(P_):s.isSideFixed()&&(a.sort(gP),hy(a),o==="PORT_DEGREE"&&a.sort(dy)),i.cachePortSides()}e.done()}};function hy(n){if(n.length<=1)return;let t=nP(n,u.SOUTH);aP(n,t[0],t[1]);let e=nP(n,u.WEST);aP(n,e[0],e[1])}function nP(n,t){if(n.length===0)return[0,0];let e=n[0].getSide(),o=0,r=t.ordinal(),i=t.ordinal()+1;for(;o<n.length-1&&e.ordinal()<r;)o++,e=n[o].getSide();let s=o;for(;s<n.length-1&&e.ordinal()<i;)s++,e=n[o].getSide();return[o,s]}function aP(n,t,e){if(e<=t+2)return;let o=Math.floor((e-t)/2);for(let r=0;r<o;r++){let i=n[t+r];n[t+r]=n[e-r-1],n[e-r-1]=i}}var gP=(n,t)=>{let e=n.getSide().ordinal()-t.getSide().ordinal();return e!==0?e:0},dy=(n,t)=>{if(n.getSide().ordinal()!==t.getSide().ordinal())return 0;switch(n.getSide()){case u.EAST:return Nh(t,lP)-Nh(n,lP);case u.WEST:return Nh(n,cP)-Nh(t,cP);default:return 0}};function lP(n){return n.getOutgoingEdges()}function cP(n){return n.getIncomingEdges()}function Nh(n,t){let e=0;for(let o of t(n))o.getProperty(p.REVERSED)||e++;return e}var fy=(n,t)=>{let e=n.getNode().getProperty(_.PORT_CONSTRAINTS);if(n.getSide().ordinal()-t.getSide().ordinal()!==0||!e.isOrderFixed())return 0;if(e===H.FIXED_ORDER){let r=n.getProperty(_.PORT_INDEX),i=t.getProperty(_.PORT_INDEX);if(r!=null&&i!=null){let s=r-i;if(s!==0)return s}}switch(n.getSide()){case u.NORTH:return yh(n.getPosition().x,t.getPosition().x);case u.EAST:return yh(n.getPosition().y,t.getPosition().y);case u.SOUTH:return yh(t.getPosition().x,n.getPosition().x);case u.WEST:return yh(t.getPosition().y,n.getPosition().y);default:throw new Error("Port side is undefined")}};function yh(n,t){return n<t?-1:n>t?1:0}var P_=(n,t)=>{let e=gP(n,t);return e!==0?e:fy(n,t)};var Un=class{process(t,e){e.begin("Port side processing",1);for(let o of t.getLayerlessNodes())hP(o);for(let o of t)for(let r of o)hP(r);e.done()}static setPortSide(t){let e=t.getProperty(p.PORT_DUMMY);e!=null?t.setSide(e.getProperty(p.EXT_PORT_SIDE)):t.getNetFlow()<0?t.setSide(u.EAST):t.setSide(u.WEST)}};function hP(n){if(n.getProperty(_.PORT_CONSTRAINTS).isSideFixed())for(let t of n.getPorts())t.getSide()===u.UNDEFINED&&Un.setPortSide(t);else{for(let t of n.getPorts())Un.setPortSide(t);n.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE)}}var Rh=class{process(t,e){e.begin("Restoring reversed edges",1);for(let o of t)for(let r of o)for(let i of r.getPorts()){let s=i.getOutgoingEdges().slice();for(let a of s)a.getProperty(p.REVERSED)&&a.reverse(t,!1)}e.done()}};var Je=class{constructor(t){this._name=t}toString(){return this._name}};Je.STACKED=new Je("STACKED");Je.REVERSE_STACKED=new Je("REVERSE_STACKED");Je.SEQUENCED=new Je("SEQUENCED");var kt=class n{constructor(t){this._name=t}toString(){return this._name}static fromPortSides(t){if(t.has(u.UNDEFINED))throw new Error("Port sides must not contain UNDEFINED");switch(t.size){case 1:return n.ONE_SIDE;case 2:{let e=t.has(u.EAST)&&t.has(u.WEST),o=t.has(u.NORTH)&&t.has(u.SOUTH);return e||o?n.TWO_SIDES_OPPOSING:n.TWO_SIDES_CORNER}case 3:return n.THREE_SIDES;case 4:return n.FOUR_SIDES;default:return null}}};kt.ONE_SIDE=new kt("ONE_SIDE");kt.TWO_SIDES_CORNER=new kt("TWO_SIDES_CORNER");kt.TWO_SIDES_OPPOSING=new kt("TWO_SIDES_OPPOSING");kt.THREE_SIDES=new kt("THREE_SIDES");kt.FOUR_SIDES=new kt("FOUR_SIDES");var Lh=class{constructor(){this._slLoopsByType=null,this._targetAreas=null}restorePorts(t,e){this._initTargetAreas(),this._slLoopsByType=uy(t),this._processOneSideLoops(t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_ORDERING)),this._processTwoSideCornerLoops(),this._processThreeSideLoops(),this._processFourSideLoops(),this._processTwoSideOpposingLoops(),this._restorePorts(t);for(let o=0;o<4;o++)for(let r=0;r<3;r++)for(let i of this._targetAreas[o][r])i.setHidden(!1);t.setPortsHidden(!1),this._slLoopsByType=null,this._targetAreas=null}_initTargetAreas(){this._targetAreas=[];for(let t=0;t<4;t++)this._targetAreas.push([[],[],[]])}_processOneSideLoops(t){var o;let e=(o=this._slLoopsByType.get(kt.ONE_SIDE))!=null?o:[];t===Je.REVERSE_STACKED&&e.reverse();for(let r of e){let i=r.getSLPorts()[0].getLPort().getSide(),s=r.getSLPorts().slice();if(s.sort((a,l)=>a.getSLNetFlow()-l.getSLNetFlow()),t===Je.SEQUENCED)this._addToTargetAreaPorts(s,i,Pe.MIDDLE,qo.APPEND);else{let a=_y(s);this._addToTargetAreaPorts(s.slice(0,a),i,Pe.MIDDLE,qo.PREPEND),this._addToTargetAreaPorts(s.slice(a),i,Pe.MIDDLE,qo.APPEND)}}}_processTwoSideCornerLoops(){var e;let t=(e=this._slLoopsByType.get(kt.TWO_SIDES_CORNER))!=null?e:[];for(let o of t){let r=Ah(o);this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.START,qo.APPEND)}}_processTwoSideOpposingLoops(){var e;let t=(e=this._slLoopsByType.get(kt.TWO_SIDES_OPPOSING))!=null?e:[];for(let o of t){let r=Ah(o);this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.START,qo.APPEND)}}_processThreeSideLoops(){var e;let t=(e=this._slLoopsByType.get(kt.THREE_SIDES))!=null?e:[];for(let o of t){let r=Oy(o);r!=null&&(this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.MIDDLE,qo.APPEND),this._addToTargetAreaLoop(o,r[2],Pe.START,qo.APPEND))}}_processFourSideLoops(){var e;let t=(e=this._slLoopsByType.get(kt.FOUR_SIDES))!=null?e:[];for(let o of t){let r=o.getSLPortsBySide();if(r!=null)for(let i of r.keys())this._addToTargetAreaLoop(o,i,Pe.MIDDLE,qo.APPEND)}}_addToTargetAreaLoop(t,e,o,r){let i=t.getSLPortsOnSide(e);this._addToTargetAreaPorts(i,e,o,r)}_addToTargetAreaPorts(t,e,o,r){let i=[];for(let a of t)a.isHidden()&&i.push(a);i.reverse();let s=this._targetAreas[Cs(e)][o];r===qo.PREPEND?s.unshift(...i):s.push(...i)}_restorePorts(t){let e=t.getLNode(),o=e.getPorts().slice(),r=0,i=e.getPorts();i.length=0;let s=Cs(u.NORTH),a=Cs(u.EAST),l=Cs(u.SOUTH),c=Cs(u.WEST),g=this._targetAreas;Jo(g[s][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.NORTH&&Sy(h),i),Jo(g[s][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.NORTH,i),Jo(g[s][Pe.END],e),Jo(g[a][Pe.START],e),Jo(g[a][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.EAST,i),Jo(g[a][Pe.END],e),Jo(g[l][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.SOUTH&&Ty(h),i),Jo(g[l][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.SOUTH,i),Jo(g[l][Pe.END],e),Jo(g[c][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.WEST,i),Jo(g[c][Pe.MIDDLE],e),Jo(g[c][Pe.END],e)}},Pe={START:0,MIDDLE:1,END:2},qo={PREPEND:"PREPEND",APPEND:"APPEND"};function Cs(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function uy(n){let t=new Map;for(let e of n.getSLHyperLoops()){let o=e.getSelfLoopType(),r=t.get(o);r==null&&(r=[],t.set(o,r)),r.push(e)}return t}function _y(n){let t=0;for(;t<n.length&&n[t].getSLNetFlow()<=0;)t++;if(t>0&&t<n.length-1)return t;let e=0;for(;e<n.length&&n[e].getSLNetFlow()<=0;)e++;return e>0&&t<n.length-1?e:Math.floor(n.length/2)}function Ah(n){let e=[...n.getSLPortsBySide().keys()];return e.sort((o,r)=>Cs(o)-Cs(r)),e[0]===u.NORTH&&e[1]===u.WEST&&(e[0]=u.WEST,e[1]=u.NORTH),e}var py=[u.NORTH,u.EAST,u.SOUTH],Ey=[u.EAST,u.SOUTH,u.WEST],my=[u.SOUTH,u.WEST,u.NORTH],Py=[u.WEST,u.NORTH,u.EAST];function Oy(n){let t=n.getSLPortsBySide();return t==null?null:t.has(u.NORTH)?t.has(u.EAST)?t.has(u.SOUTH)?t.has(u.WEST)?null:py:Py:my:Ey}function Jo(n,t){for(let e of n)e.getLPort().setNode(t)}function Fn(n,t,e,o){for(let r=t;r<n.length;r++){let i=n[r];if(e(i))o.push(i);else return r}return n.length}function Sy(n){return dP(n).has(u.WEST)}function Ty(n){return dP(n).has(u.EAST)}function dP(n){let t=new Set,e=n.getProperty(p.PORT_DUMMY);if(e!=null){for(let o of e.getPorts())if(o.getProperty(p.ORIGIN)===n){let r=o.getConnectedEdges();for(let i of r){t.add(o.getSide());break}}}return t}var Qo=class{constructor(t){this._name=t}toString(){return this._name}};Qo.EQUALLY=new Qo("EQUALLY");Qo.NORTH=new Qo("NORTH");Qo.NORTH_SOUTH=new Qo("NORTH_SOUTH");var te=class{constructor(t,e,o){this._name=t,this.firstSide=e,this.secondSide=o}toString(){return this._name}isCornerTarget(){return this.firstSide!==this.secondSide}};te.NORTH=new te("NORTH",u.NORTH,u.NORTH);te.SOUTH=new te("SOUTH",u.SOUTH,u.SOUTH);te.EAST=new te("EAST",u.EAST,u.EAST);te.WEST=new te("WEST",u.WEST,u.WEST);te.NORTH_WEST_CORNER=new te("NORTH_WEST_CORNER",u.WEST,u.NORTH);te.NORTH_EAST_CORNER=new te("NORTH_EAST_CORNER",u.NORTH,u.EAST);te.SOUTH_WEST_CORNER=new te("SOUTH_WEST_CORNER",u.SOUTH,u.WEST);te.SOUTH_EAST_CORNER=new te("SOUTH_EAST_CORNER",u.EAST,u.SOUTH);te._values=[te.NORTH,te.SOUTH,te.EAST,te.WEST,te.NORTH_WEST_CORNER,te.NORTH_EAST_CORNER,te.SOUTH_WEST_CORNER,te.SOUTH_EAST_CORNER];var Ch=class{assignPortSides(t){let e=t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_DISTRIBUTION);switch(e!=null?e.toString():null){case"NORTH":this._assignToNorthSide(t);break;case"NORTH_SOUTH":this._assignToNorthOrSouthSide(t);break;case"EQUALLY":this._assignToAllSides(t);break;default:this._assignToNorthSide(t);break}}_assignToNorthSide(t){for(let e of t.getSLHyperLoops())for(let o of this._hiddenSelfLoopPorts(e))o.getLPort().setSide(u.NORTH)}_assignToNorthOrSouthSide(t){let e=0,o=0;for(let r of t.getSLHyperLoops()){let i=this._hiddenSelfLoopPorts(r),s=null;if(e<=o?(s=u.NORTH,e+=i.length):o<e&&(s=u.SOUTH,o+=i.length),s!=null)for(let a of i)a.getLPort().setSide(s)}}_assignToAllSides(t){let e=t.getSLHyperLoops().slice();e.sort((i,s)=>s.getSLPorts().length-i.getSLPorts().length);let o=te._values,r=0;for(let i of e){let s=o[r%o.length];this._assignToTarget(i,s),r++}}_assignToTarget(t,e){let o=t.getSLPorts();e.isCornerTarget()&&o.sort((i,s)=>i.getLPort().getNetFlow()-s.getLPort().getNetFlow());let r=Math.floor(o.length/2);for(let i=0;i<r;i++){let s=o[i];s.isHidden()&&s.getLPort().setSide(e.firstSide)}for(let i=r;i<o.length;i++){let s=o[i];s.isHidden()&&s.getLPort().setSide(e.secondSide)}}_hiddenSelfLoopPorts(t){let e=[];for(let o of t.getSLPorts())o.isHidden()&&e.push(o);return e}};p.ORIGINAL_PORT_CONSTRAINTS;var xh=class{constructor(){this._portSideAssigner=new Ch,this._portRestorer=new Lh}process(t,e){e.begin("Self-Loop ordering",1);for(let o of t.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.NORMAL||!r.hasProperty(p.SELF_LOOP_HOLDER))continue;let i=r.getProperty(p.SELF_LOOP_HOLDER);this._processNode(i,e)}e.done()}_processNode(t,e){if(t.arePortsHidden()){let o=t.getLNode().getProperty(p.ORIGINAL_PORT_CONSTRAINTS);o===H.UNDEFINED||o===H.FREE||o==null?(this._portSideAssigner.assignPortSides(t),O_(t),this._portRestorer.restorePorts(t,e)):o===H.FIXED_SIDE&&(O_(t),this._portRestorer.restorePorts(t,e))}else O_(t)}};function O_(n){for(let t of n.getSLHyperLoops())t.computePortsPerSide()}var Dh=class{process(t,e){e.begin("Self-Loop post-processing",1);for(let o of t.getLayers())for(let r of o.getNodes())r.getType()===y.NORMAL&&r.hasProperty(p.SELF_LOOP_HOLDER)&&Ny(r);e.done()}};function Ny(n){let t=n.getProperty(p.SELF_LOOP_HOLDER);for(let e of t.getSLHyperLoops())for(let o of e.getSLEdges())yy(n,o);for(let e of t.getSLHyperLoops()){let o=e.getSLLabels();o!=null&&o.applyPlacement(n.getPosition())}}function yy(n,t){let e=t.getLEdge();e.setSource(t.getSLSource().getLPort()),e.setTarget(t.getSLTarget().getLPort()),e.getBendPoints().offset(n.getPosition())}var wh=class{constructor(t,e,o){this._lEdge=t,this._slHyperLoop=null,this._slSource=e,this._slTarget=o,e.getOutgoingSLEdges().push(this),o.getIncomingSLEdges().push(this)}getLEdge(){return this._lEdge}getSLHyperLoop(){return this._slHyperLoop}setSLHyperLoop(t){this._slHyperLoop=t}getSLSource(){return this._slSource}getSLTarget(){return this._slTarget}isInline(){for(let t of this._lEdge.getLabels())if(t.getProperty(_.EDGE_LABELS_INLINE))return!0;return!1}getLabelSide(){return this._slHyperLoop.getSLLabels().getSide()}};var Mh=class{constructor(t){this._lPort=t,this._incomingSLEdges=[],this._outgoingSLEdges=[],this._isHidden=!1;let e=!0;for(let o of t.getConnectedEdges())if(!o.isSelfLoop()){e=!1;break}this._hadOnlySelfLoops=e}getLPort(){return this._lPort}hadOnlySelfLoops(){return this._hadOnlySelfLoops}isHidden(){return this._isHidden}setHidden(t){this._isHidden=t}getIncomingSLEdges(){return this._incomingSLEdges}getOutgoingSLEdges(){return this._outgoingSLEdges}getSLNetFlow(){return this._incomingSLEdges.length-this._outgoingSLEdges.length}};var It=class{constructor(t){this._name=t}toString(){return this._name}};It.CENTER=new It("CENTER");It.LEFT=new It("LEFT");It.RIGHT=new It("RIGHT");It.TOP=new It("TOP");var bh=class{constructor(t){this.id=0,this._lLabels=[],this._size=new O,this._position=new O,this._side=null,this._alignment=null,this._alignmentReferenceSLPort=null;let e=t.getSLHolder().getLNode();this._layoutDirection=e.getGraph().getProperty(_.DIRECTION),this._labelLabelSpacing=z.getIndividualOrInherited(e,_.SPACING_LABEL_LABEL)}addLLabels(t){for(let e of t)this._lLabels.push(e),this._updateSize(e)}getLLabels(){return this._lLabels}_updateSize(t){let e=t.getSize();this._layoutDirection!=null&&this._layoutDirection.isHorizontal&&this._layoutDirection.isHorizontal()?(this._size.x=Math.max(this._size.x,e.x),this._size.y+=e.y,this._lLabels.length>1&&(this._size.y+=this._labelLabelSpacing)):(this._size.x+=e.x,this._size.y=Math.max(this._size.y,e.y),this._lLabels.length>1&&(this._size.x+=this._labelLabelSpacing))}applyLabelManagement(t,e){let o=this._layoutDirection!=null&&this._layoutDirection.isVertical&&this._layoutDirection.isVertical(),r=As(t,this._lLabels,e,this._labelLabelSpacing,o);this._size.x=r.x,this._size.y=r.y}applyPlacement(t){this._layoutDirection!=null&&this._layoutDirection.isHorizontal&&this._layoutDirection.isHorizontal()?this._applyPlacementForHorizontalLayout(t):this._applyPlacementForVerticalLayout(t)}_applyPlacementForHorizontalLayout(t){let e=this._position.x,o=this._position.y;for(let r of this._lLabels){let i=r.getPosition();this._alignment===It.LEFT||this._side===u.EAST?i.x=e:this._alignment===It.RIGHT||this._side===u.WEST?i.x=e+this._size.x-r.getSize().x:i.x=e+(this._size.x-r.getSize().x)/2,i.y=o,i.add(t),o+=r.getSize().y+this._labelLabelSpacing}}_applyPlacementForVerticalLayout(t){let e=this._position.x,o=this._position.y;for(let r of this._lLabels){let i=r.getPosition();i.x=e,this._side===u.NORTH?i.y=o+this._size.y-r.getSize().y:i.y=o,i.add(t),e+=r.getSize().x+this._labelLabelSpacing}}getSize(){return this._size}getPosition(){return this._position}getSide(){return this._side}setSide(t){this._side=t}getAlignment(){return this._alignment}setAlignment(t){this._alignment=t}getAlignmentReferenceSLPort(){return this._alignmentReferenceSLPort}setAlignmentReferenceSLPort(t){this._alignmentReferenceSLPort=t}};var Gh=class{constructor(t){this._slHolder=t,this._slPorts=[],this._slEdges=new Set,this._slLabels=null,this._selfLoopType=null,this._slPortsBySide=null,this._leftmostPort=null,this._rightmostPort=null,this._occupiedPortSides=new Set,this._routingSlot=new Array(4).fill(0)}computePortsPerSide(){this._slPortsBySide=new Map;let t=new Set;for(let e of this._slPorts){let o=e.getLPort().getSide();if(o===u.UNDEFINED)throw new Error("Port side must not be UNDEFINED");let r=this._slPortsBySide.get(o);r==null&&(r=[],this._slPortsBySide.set(o,r)),r.push(e),t.add(o)}this._selfLoopType=kt.fromPortSides(t)}getSLHolder(){return this._slHolder}addSelfLoopEdge(t){if(this._slEdges.has(t))return;this._slEdges.add(t),t.setSLHyperLoop(this);let e=t.getSLSource();this._slPorts.includes(e)||this._slPorts.push(e);let o=t.getSLTarget();this._slPorts.includes(o)||this._slPorts.push(o);let r=t.getLEdge().getLabels();r.length>0&&(this._slLabels==null&&(this._slLabels=new bh(this)),this._slLabels.addLLabels(r))}getSLPorts(){return this._slPorts}getSLEdges(){return this._slEdges}getSLLabels(){return this._slLabels}getSelfLoopType(){return this._selfLoopType}getSLPortsBySide(){return this._slPortsBySide}getSLPortsOnSide(t){return this._slPortsBySide!=null&&this._slPortsBySide.has(t)?this._slPortsBySide.get(t):[]}hasSLPortsOnSide(t){return this._slPortsBySide!=null&&this._slPortsBySide.has(t)}getLeftmostPort(){return this._leftmostPort}setLeftmostPort(t){this._leftmostPort=t}getRightmostPort(){return this._rightmostPort}setRightmostPort(t){this._rightmostPort=t}getOccupiedPortSides(){return this._occupiedPortSides}getRoutingSlot(t){return this._routingSlot[fP(t)]}setRoutingSlot(t,e){let o=fP(t);this._routingSlot[o]=e;let r=this._slHolder.getRoutingSlotCount();r[o]=Math.max(r[o],e+1)}},Iy=new Map([[u.NORTH,0],[u.EAST,1],[u.SOUTH,2],[u.WEST,3],[u.UNDEFINED,4]]);function fP(n){var t;return(t=Iy.get(n))!=null?t:4}var Hh=0,Ry=1,sl=class n{constructor(t){this._lNode=t,this._slHyperLoops=[],this._slPorts=new Map,this._arePortsHidden=!1,this._routingSlotCount=[0,0,0,0]}static install(t){let e=new n(t);return t.setProperty(p.SELF_LOOP_HOLDER,e),e._initialize(),e}static needsSelfLoopProcessing(t){if(t.getType()!==y.NORMAL)return!1;for(let e of t.getOutgoingEdges())if(e.isSelfLoop())return!0;return!1}_initialize(){for(let t of this._lNode.getOutgoingEdges())t.isSelfLoop()&&new wh(t,this._selfLoopPortFor(t.getSource()),this._selfLoopPortFor(t.getTarget()));for(let t of this._slPorts.values())t.getLPort().id=Hh;for(let t of this._slPorts.values())t.getLPort().id===Hh&&this._slHyperLoops.push(this._initializeHyperLoop(t))}_selfLoopPortFor(t){let e=this._slPorts.get(t);return e==null&&(e=new Mh(t),this._slPorts.set(t,e)),e}_initializeHyperLoop(t){let e=new Gh(this),o=[t];for(;o.length>0;){let r=o.shift();r.getLPort().id=Ry;for(let i of r.getOutgoingSLEdges()){e.addSelfLoopEdge(i);let s=i.getSLTarget();s.getLPort().id===Hh&&o.push(s)}for(let i of r.getIncomingSLEdges()){e.addSelfLoopEdge(i);let s=i.getSLSource();s.getLPort().id===Hh&&o.push(s)}}return e}getLNode(){return this._lNode}getSLHyperLoops(){return this._slHyperLoops}getSLPortMap(){return this._slPorts}arePortsHidden(){return this._arePortsHidden}setPortsHidden(t){this._arePortsHidden=t}getRoutingSlotCount(){return this._routingSlotCount}static ordinalOf(t){switch(t){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}};var vh=class{process(t,e){e.begin("Self-Loop pre-processing",1);for(let o of t.getLayerlessNodes())if(sl.needsSelfLoopProcessing(o)){let r=sl.install(o);Ly(r),Ay(r)}e.done()}};function Ly(n){for(let t of n.getSLHyperLoops())for(let e of t.getSLEdges()){let o=e.getLEdge();o.setSource(null),o.setTarget(null)}}function Ay(n){let t=n.getLNode(),e=t.getNestedGraph(),o=t.getProperty(_.PORT_CONSTRAINTS),r=o!=null&&o.isOrderFixed(),i=e!=null&&e.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS);if(!(r||i))for(let s of n.getSLPortMap().values()){if(!s.hadOnlySelfLoops())continue;s.getLPort().setNode(null),s.setHidden(!0),n.setPortsHidden(!0)}}var Bh=class{placeLabels(t,e,o){this._assignSideAndAlignment(t);for(let r of t.getSLHyperLoops())r.getSLLabels()!=null&&(e!=null&&this._manageLabels(r,e),this._computeCoordinates(r))}_assignSideAndAlignment(t){let e=null,o=null,r=t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_ORDERING);r===Je.SEQUENCED&&(e=[],o=[]);for(let i of t.getSLHyperLoops())if(i.getSLLabels()!=null)switch(i.getSelfLoopType()){case kt.ONE_SIDE:{let a=i.getOccupiedPortSides().values().next().value;r===Je.SEQUENCED&&a===u.NORTH?e.push(i):r===Je.SEQUENCED&&a===u.SOUTH?o.push(i):this._assignOneSidedSimpleSideAndAlignment(i,a);break}case kt.TWO_SIDES_CORNER:this._assignTwoSidesCornerSideAndAlignment(i);break;case kt.TWO_SIDES_OPPOSING:case kt.THREE_SIDES:this._assignTwoSidesOpposingAndThreeSidesSideAndAlignment(i);break;case kt.FOUR_SIDES:this._assignFourSidesSideAndAlignment(i);break;default:throw new Error("Unknown self loop type: "+i.getSelfLoopType())}e!=null&&(e.length>0&&this._assignOneSidedSequencedSideAndAlignment(e,u.NORTH),o.length>0&&this._assignOneSidedSequencedSideAndAlignment(o,u.SOUTH))}_assignOneSidedSimpleSideAndAlignment(t,e){for(let o of t.getSLLabels().getLLabels())o.setProperty(_.EDGE_LABELS_INLINE,null);switch(e){case u.EAST:case u.WEST:{let o=t.getLeftmostPort();t.getRightmostPort().getLPort().getPosition().y<o.getLPort().getPosition().y&&(o=t.getRightmostPort()),this._assignSideAndAlignmentFor(t,e,It.TOP,o);break}case u.NORTH:case u.SOUTH:this._assignSideAndAlignmentFor(t,e,It.CENTER,null);break;default:throw new Error("Invalid loop side: "+e)}}_assignOneSidedSequencedSideAndAlignment(t,e){let o=0;for(let s of t[0].getSLHolder().getLNode().getPorts())s.id=o++;e===u.NORTH?t.sort((s,a)=>s.getLeftmostPort().getLPort().id-a.getLeftmostPort().getLPort().id):t.sort((s,a)=>a.getLeftmostPort().getLPort().id-s.getLeftmostPort().getLPort().id);let r=0,i=t.length-1;for(;r<i;){let s=t[r],a=t[i],l=e===u.NORTH?s.getRightmostPort():s.getLeftmostPort(),c=e===u.NORTH?a.getLeftmostPort():a.getRightmostPort();this._assignSideAndAlignmentFor(s,e,It.RIGHT,l),this._assignSideAndAlignmentFor(a,e,It.LEFT,c),r++,i--}r===i&&this._assignSideAndAlignmentFor(t[r],e,It.CENTER,null)}_assignTwoSidesCornerSideAndAlignment(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getRightmostPort().getLPort().getSide();for(let r of t.getSLLabels().getLLabels())r.setProperty(_.EDGE_LABELS_INLINE,null);if(e===u.NORTH)this._assignSideAndAlignmentFor(t,u.NORTH,It.LEFT,t.getLeftmostPort());else if(o===u.NORTH)this._assignSideAndAlignmentFor(t,u.NORTH,It.RIGHT,t.getRightmostPort());else if(e===u.SOUTH)this._assignSideAndAlignmentFor(t,u.SOUTH,It.RIGHT,t.getLeftmostPort());else if(o===u.SOUTH)this._assignSideAndAlignmentFor(t,u.SOUTH,It.LEFT,t.getRightmostPort());else throw new Error("Invalid two-sides-corner configuration")}_assignTwoSidesOpposingAndThreeSidesSideAndAlignment(t){let e=t.getOccupiedPortSides(),o=!1;for(let r of t.getSLLabels().getLLabels())if(r.getProperty(_.EDGE_LABELS_INLINE)){o=!0;break}if(!e.has(u.NORTH))this._assignSideAndAlignmentFor(t,u.SOUTH,It.CENTER,null);else if(!e.has(u.SOUTH))this._assignSideAndAlignmentFor(t,u.NORTH,It.CENTER,null);else if(!e.has(u.WEST))this._assignSideAndAlignmentFor(t,o?u.EAST:u.NORTH,o?It.CENTER:It.LEFT,o?null:t.getLeftmostPort());else if(!e.has(u.EAST))this._assignSideAndAlignmentFor(t,o?u.WEST:u.NORTH,o?It.CENTER:It.RIGHT,o?null:t.getRightmostPort());else throw new Error("All sides occupied for two-sides-opposing / three-sides loop")}_assignFourSidesSideAndAlignment(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getLeftmostPort().getLPort().getSide();for(let r of t.getSLLabels().getLLabels())r.setProperty(_.EDGE_LABELS_INLINE,null);e===u.NORTH||o===u.NORTH?this._assignSideAndAlignmentFor(t,u.SOUTH,It.CENTER,null):this._assignSideAndAlignmentFor(t,u.NORTH,It.CENTER,null)}_assignSideAndAlignmentFor(t,e,o,r){let i=t.getSLLabels();i.setSide(e),i.setAlignment(o),i.setAlignmentReferenceSLPort(r)}_manageLabels(t,e){let o=t.getSLLabels(),r=o.getAlignmentReferenceSLPort(),s=t.getSLHolder().getLNode().getSize(),a=t.getSLHolder().getLNode().getMargin(),l=0;switch(o.getAlignment()){case It.CENTER:l=a.left+s.x+a.right;break;case It.LEFT:l=s.x-r.getLPort().getPosition().x-r.getLPort().getAnchor().x+a.right;break;case It.RIGHT:l=a.left+r.getLPort().getPosition().x+r.getLPort().getAnchor().x;break;case It.TOP:l=ol;break;default:throw new Error("Invalid alignment: "+o.getAlignment())}o.applyLabelManagement(e,Math.max(l,ol))}_computeCoordinates(t){let e=t.getSLLabels(),o=e.getAlignmentReferenceSLPort(),r=e.getSize(),i=e.getPosition();switch(e.getAlignment()){case It.CENTER:i.x=(t.getSLHolder().getLNode().getSize().x-r.x)/2;break;case It.LEFT:i.x=o.getLPort().getPosition().x+o.getLPort().getAnchor().x;break;case It.RIGHT:i.x=o.getLPort().getPosition().x+o.getLPort().getAnchor().x-r.x;break;case It.TOP:i.y=o.getLPort().getPosition().y+o.getLPort().getAnchor().y;break;default:throw new Error("Invalid alignment: "+e.getAlignment())}}};var Uh=class{routeSelfLoops(t){throw new Error("AbstractSelfLoopRouter.routeSelfLoops() must be overridden")}};var ni=Object.freeze({CLOCKWISE:"CLOCKWISE",COUNTER_CLOCKWISE:"COUNTER_CLOCKWISE"}),Ui=class extends Uh{routeSelfLoops(t){let e=t.getLNode(),o=e.getSize(),r=e.getMargin(),i=z.getIndividualOrInherited(e,_.SPACING_EDGE_EDGE),s=z.getIndividualOrInherited(e,_.SPACING_EDGE_LABEL),a=z.getIndividualOrInherited(e,_.SPACING_NODE_SELF_LOOP),l=new Gr;l.set(r);let c=this._computeRoutingSlotPositions(t,i,s,a);for(let g of t.getSLHyperLoops()){for(let d of g.getSLEdges()){let f=d.getLEdge(),E=xy(d),P=this.computeOrthogonalBendPoints(d,E,c);P=this.modifyBendPoints(d,E,P);let S=f.getBendPoints();S.length=0;for(let T of P)S.push(T);for(let T of P)S_(o,l,T)}let h=g.getSLLabels();h!=null&&(Dy(g,h,c,s),wy(o,l,h))}r.set(l)}_computeRoutingSlotPositions(t,e,o,r){let i=new Array(5);for(let s of u.values())i[s.ordinal()]=new Array(t.getRoutingSlotCount()[Cy(s)]).fill(0);return uP(i,t,u.NORTH),uP(i,t,u.SOUTH),Fh(i,t,u.NORTH,e,o,r),Fh(i,t,u.EAST,e,o,r),Fh(i,t,u.SOUTH,e,o,r),Fh(i,t,u.WEST,e,o,r),i}computeOrthogonalBendPoints(t,e,o){let r=new st;return _P(t,t.getSLSource(),o,r),by(t,e,o,r),_P(t,t.getSLTarget(),o,r),r}modifyBendPoints(t,e,o){return o}};function Cy(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function xy(n){let t=n.getSLSource().getLPort(),e=t.getSide(),o=n.getSLTarget().getLPort(),r=o.getSide();return e===r?t.id<o.id?ni.CLOCKWISE:ni.COUNTER_CLOCKWISE:e.right()===r?ni.CLOCKWISE:e.left()===r?ni.COUNTER_CLOCKWISE:n.getSLHyperLoop().getOccupiedPortSides().has(e.right())?ni.CLOCKWISE:ni.COUNTER_CLOCKWISE}function Dy(n,t,e,o){let r=t.getSide(),i=e[r.ordinal()][n.getRoutingSlot(r)],s=!1;for(let l of t.getLLabels())if(l.getProperty(_.EDGE_LABELS_INLINE)){s=!0;break}let a=s?0:o;switch(r){case u.NORTH:i-=a+t.getSize().y,t.getPosition().y=i;break;case u.SOUTH:i+=a,t.getPosition().y=i;break;case u.WEST:i-=a+t.getSize().x,t.getPosition().x=i;break;case u.EAST:i+=a,t.getPosition().x=i;break;default:throw new Error("Invalid label side: "+r)}}function S_(n,t,e){t.left=Math.max(t.left,-e.x),t.right=Math.max(t.right,e.x-n.x),t.top=Math.max(t.top,-e.y),t.bottom=Math.max(t.bottom,e.y-n.y)}function wy(n,t,e){let o=new O(e.getPosition().x,e.getPosition().y);S_(n,t,o),o.add(e.getSize()),S_(n,t,o)}function uP(n,t,e){let o=n[e.ordinal()];for(let r of t.getSLHyperLoops()){let i=r.getSLLabels();if(i!=null&&i.getSide()===e){let s=r.getRoutingSlot(e);o[s]=Math.max(o[s],i.getSize().y)}}}function Fh(n,t,e,o,r,i){let s=My(t,e,i),a=e===u.NORTH||e===u.WEST?-1:1,l=n[e.ordinal()];for(let c=0;c<l.length;c++){let g=l[c];g>0&&(g+=r),l[c]=s,s+=a*(g+o)}}function My(n,t,e){let o=n.getLNode(),r=o.getMargin();switch(t){case u.NORTH:return-r.top-e;case u.EAST:return o.getSize().x+r.right+e;case u.SOUTH:return o.getSize().y+r.bottom+e;case u.WEST:return-r.left-e;default:throw new Error("Invalid port side: "+t)}}function _P(n,t,e,o){let r=n.getSLHyperLoop(),i=t.getLPort(),s=i.getSide(),a=T_(s,r.getRoutingSlot(s),e),l=new O(i.getPosition().x,i.getPosition().y);switch(l.add(i.getAnchor()),s){case u.NORTH:case u.SOUTH:a.x+=l.x;break;case u.EAST:case u.WEST:a.y+=l.y;break;default:throw new Error("Invalid port side: "+s)}o.add(a)}function by(n,t,e,o){let r=n.getSLSource().getLPort(),i=n.getSLTarget().getLPort();if(r.getSide()===i.getSide())return;let s=n.getSLHyperLoop(),a=null,l=null,c=n.isInline();c&&s.getSLLabels()!=null&&(a=n.getLabelSide(),l=s.getSLLabels().getSize());let g=r.getSide();for(;g!==i.getSide();){let h=t===ni.CLOCKWISE?g.right():g.left(),d=T_(g,s.getRoutingSlot(g),e),f=T_(h,s.getRoutingSlot(h),e);c&&a!=null&&l!=null&&(g===a?pP(d,a,l):h===a&&pP(f,a,l)),o.add(d.add(f)),g=h}}function T_(n,t,e){let o=e[n.ordinal()][t];switch(n){case u.NORTH:case u.SOUTH:return new O(0,o);case u.EAST:case u.WEST:return new O(o,0);default:throw new Error("Invalid port side: "+n)}}function pP(n,t,e){switch(t){case u.NORTH:n.y-=e.y/2;break;case u.SOUTH:n.y+=e.y/2;break;case u.WEST:n.x-=e.x/2;break;case u.EAST:n.x+=e.x/2;break;default:break}}var Gy=10,kh=.01,Wh=class extends Ui{modifyBendPoints(t,e,o){let r=t.getSLSource().getLPort(),i=new O(r.getPosition().x,r.getPosition().y);i.add(r.getAnchor()),o.splice(0,0,i);let s=t.getSLTarget().getLPort(),a=new O(s.getPosition().x,s.getPosition().y);return a.add(s.getAnchor()),o.push(a),this.cutCorners(o,Gy)}cutCorners(t,e){let o=new st,r=null,i=t[0],s=t[1];for(let a=2;a<t.length;a++){r=i,i=s,s=t[a];let l=EP(new O(r.x-i.x,r.y-i.y)),c=EP(new O(s.x-i.x,s.y-i.y)),g=e;g=Math.min(g,Math.abs(l.x+l.y)/2),g=Math.min(g,Math.abs(c.x+c.y)/2),l.x=Math.sign(l.x)*g,l.y=Math.sign(l.y)*g,c.x=Math.sign(c.x)*g,c.y=Math.sign(c.y)*g,o.push(new O(l.x+i.x,l.y+i.y)),o.push(new O(c.x+i.x,c.y+i.y))}return o}};function EP(n){return n.x>=-kh&&n.x<=kh&&(n.x=0),n.y>=-kh&&n.y<=kh&&(n.y=0),n}var Hy=(n,t)=>n.getLPort().id-t.getLPort().id,vy=1,By=3,zh=class{constructor(){this._portPenalties=null}determineLoopRoutes(t){this._assignPortIds(t.getLNode().getPorts()),this._sortHyperLoopPortLists(t);for(let e of t.getSLHyperLoops()){switch(e.getSelfLoopType()){case kt.ONE_SIDE:this._determineOneSideLoopRoutes(e);break;case kt.TWO_SIDES_CORNER:this._determineTwoSideCornerLoopRoutes(e);break;case kt.TWO_SIDES_OPPOSING:this._determineTwoSideOpposingLoopRoutes(e);break;case kt.THREE_SIDES:this._determineThreeSideLoopRoutes(e);break;case kt.FOUR_SIDES:this._determineFourSideLoopRoutes(e);break;default:throw new Error("Unknown self loop type: "+e.getSelfLoopType())}this._computeOccupiedPortSides(e)}this._portPenalties=null}_assignPortIds(t){for(let e=0;e<t.length;e++)t[e].id=e}_sortHyperLoopPortLists(t){for(let e of t.getSLHyperLoops())e.getSLPorts().sort(Hy)}_computeOccupiedPortSides(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getRightmostPort().getLPort().getSide();for(;e!==o;)t.getOccupiedPortSides().add(e),e=e.right();t.getOccupiedPortSides().add(e)}_determineOneSideLoopRoutes(t){let e=t.getSLPorts()[0].getLPort().getSide();this._assignLeftmostRightmostPorts(t,e,e)}_determineTwoSideCornerLoopRoutes(t){let e=Ah(t);this._assignLeftmostRightmostPorts(t,e[0],e[1])}_determineTwoSideOpposingLoopRoutes(t){let e=[...t.getSLPortsBySide().keys()];if(e.length!==2)throw new Error("Expected exactly two occupied sides");let o=t.getSLHolder(),r=N_(t,e[0]),i=y_(t,e[1]),s=this._computeEdgePenalty(o,r,i),a=N_(t,e[1]),l=y_(t,e[0]),c=this._computeEdgePenalty(o,a,l);s<=c?(t.setLeftmostPort(r),t.setRightmostPort(i)):(t.setLeftmostPort(a),t.setRightmostPort(l))}_determineThreeSideLoopRoutes(t){let e=null,o=null;switch(this._computeMissingPortSide(t)){case u.NORTH:e=u.EAST,o=u.WEST;break;case u.EAST:e=u.SOUTH,o=u.NORTH;break;case u.SOUTH:e=u.WEST,o=u.EAST;break;case u.WEST:e=u.NORTH,o=u.SOUTH;break;default:throw new Error("Invalid missing port side")}this._assignLeftmostRightmostPorts(t,e,o)}_computeMissingPortSide(t){let e=t.getSLPortsBySide();for(let o of[u.NORTH,u.EAST,u.SOUTH,u.WEST])if(!e.has(o))return o;throw new Error("All sides occupied for three-sided loop")}_determineFourSideLoopRoutes(t){let e=t.getSLPorts(),o=t.getSLHolder(),r=e[e.length-1],i=e[0],s=this._computeEdgePenalty(o,r,i);for(let a=1;a<e.length;a++){let l=e[a-1],c=e[a],g=this._computeEdgePenalty(o,l,c);g>s&&(r=l,i=c,s=g)}t.setLeftmostPort(i),t.setRightmostPort(r)}_assignLeftmostRightmostPorts(t,e,o){t.setLeftmostPort(N_(t,e)),t.setRightmostPort(y_(t,o))}_computeEdgePenalty(t,e,o){this._portPenalties==null&&this._computePenalties(t);let r=t.getLNode().getPorts().length,i=e.getLPort().id,a=o.getLPort().id-1;return a<0&&(a=r-1),i<=a?this._portPenalties[a]-this._portPenalties[i]:this._portPenalties[r-1]-this._portPenalties[i]+this._portPenalties[a]}_computePenalties(t){let e=t.getLNode().getPorts();this._portPenalties=new Array(e.length).fill(0);let o=0;for(let r=0;r<e.length;r++){let i=e[r];i.getIncomingEdges().length===0&&i.getOutgoingEdges().length===0?o+=vy:o+=By,this._portPenalties[r]=o}}};function N_(n,t){let e=n.getSLPortsBySide().get(t),o=e[0];for(let r=1;r<e.length;r++)e[r].getLPort().id<o.getLPort().id&&(o=e[r]);return o}function y_(n,t){let e=n.getSLPortsBySide().get(t),o=e[0];for(let r=1;r<e.length;r++)e[r].getLPort().id>o.getLPort().id&&(o=e[r]);return o}var Yh=class{constructor(){this._hyperEdgeSegments=null,this._slLoopToSegmentMap=null,this._slLoopActivityOverPorts=null}assignRoutingSlots(t){let e=this._computeLabelCrossingMatrix(t);this._createCrossingGraph(t,e);let o=t.getLNode().getGraph().getProperty(p.RANDOM);se.breakNonCriticalCycles(this._hyperEdgeSegments,o),this._doAssignRoutingSlots(t,e),this._hyperEdgeSegments=null,this._slLoopToSegmentMap=null,this._slLoopActivityOverPorts=null}_computeLabelCrossingMatrix(t){let e=0;for(let i of t.getSLHyperLoops())i.getSLLabels()!=null&&(i.getSLLabels().id=e++);let o=[];for(let i=0;i<e;i++)o.push(new Array(e).fill(!1));let r=t.getSLHyperLoops();for(let i=0;i<r.length;i++){let s=r[i];if(s.getSLLabels()!=null)for(let a=i+1;a<r.length;a++){let l=r[a];if(l.getSLLabels()==null)continue;let c=Uy(s,l);o[s.getSLLabels().id][l.getSLLabels().id]=c,o[l.getSLLabels().id][s.getSLLabels().id]=c}}return o}_createCrossingGraph(t,e){let o=t.getSLHyperLoops();this._hyperEdgeSegments=[],this._slLoopToSegmentMap=new Map;for(let r of o){let i=new An(null);this._hyperEdgeSegments.push(i),this._slLoopToSegmentMap.set(r,i)}this._slLoopActivityOverPorts=new Map,this._computeLoopActivity(t);for(let r=0;r<o.length-1;r++){let i=t.getSLHyperLoops()[r];for(let s=r+1;s<o.length;s++)this._createDependencies(i,t.getSLHyperLoops()[s],e)}}_computeLoopActivity(t){let e=t.getSLHyperLoops(),o=t.getLNode().getPorts();for(let r of e){let i=new Array(o.length).fill(!1);this._slLoopActivityOverPorts.set(r,i);let s=r.getLeftmostPort().getLPort().id-1,a=r.getRightmostPort().getLPort().id;for(;s!==a;)s=(s+1+o.length)%o.length,i[s]=!0}}_createDependencies(t,e,o){let r=this._countCrossings(t,e),i=this._countCrossings(e,t),s=this._slLoopToSegmentMap.get(t),a=this._slLoopToSegmentMap.get(e);r<i?$e.createAndAddRegular(s,a,i-r):i<r?$e.createAndAddRegular(a,s,r-i):(r!==0||Fy(t,e,o))&&($e.createAndAddRegular(s,a,0),$e.createAndAddRegular(a,s,0))}_countCrossings(t,e){let o=this._slLoopActivityOverPorts.get(e),r=0;for(let i of t.getSLPorts())o[i.getLPort().id]&&r++;return r}_doAssignRoutingSlots(t,e){this._assignRawRoutingSlotsToSegments(),this._assignRawRoutingSlotsToLoops(t),this._shiftTowardsNode(t,e)}_assignRawRoutingSlotsToSegments(){let t=[];for(let e of this._hyperEdgeSegments)e.setInWeight(e.getIncomingSegmentDependencies().length),e.setOutWeight(e.getOutgoingSegmentDependencies().length),e.getOutWeight()===0&&(e.setRoutingSlot(0),t.push(e));for(;t.length>0;){let e=t.shift(),o=e.getRoutingSlot()+1;for(let r of e.getIncomingSegmentDependencies()){let i=r.getSource();i.setRoutingSlot(Math.max(i.getRoutingSlot(),o)),i.setOutWeight(i.getOutWeight()-1),i.getOutWeight()===0&&t.push(i)}}}_assignRawRoutingSlotsToLoops(t){for(let e of t.getSLHyperLoops()){let o=this._slLoopToSegmentMap.get(e).getRoutingSlot();for(let r of e.getOccupiedPortSides())e.setRoutingSlot(r,o)}}_shiftTowardsNode(t,e){let o=new Array(t.getLNode().getPorts().length).fill(0);this._shiftTowardsNodeOnSide(t,u.NORTH,o,e),this._shiftTowardsNodeOnSide(t,u.EAST,o,e),this._shiftTowardsNodeOnSide(t,u.SOUTH,o,e),this._shiftTowardsNodeOnSide(t,u.WEST,o,e)}_shiftTowardsNodeOnSide(t,e,o,r){let i=t.getSLHyperLoops().filter(c=>c.getOccupiedPortSides().has(e));i.sort((c,g)=>c.getRoutingSlot(e)-g.getRoutingSlot(e));let s=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(let c of t.getLNode().getPorts())c.getSide()===e&&(c.id<s&&(s=c.id),c.id>a&&(a=c.id));if(s===Number.MAX_SAFE_INTEGER){for(let c=0;c<i.length;c++)i[c].setRoutingSlot(e,c);return}let l=new Array(r.length).fill(-1);for(let c of i){let g=this._slLoopActivityOverPorts.get(c),h=0;for(let d=s;d<=a;d++)g[d]&&(h=Math.max(h,o[d]));if(c.getSLLabels()!=null){let d=c.getSLLabels().id,f=new Set;for(let E=0;E<r.length;E++)r[d][E]&&f.add(l[E]);for(;f.has(h);)h++}c.setRoutingSlot(e,h);for(let d=s;d<=a;d++)g[d]&&(o[d]=h+1);c.getSLLabels()!=null&&(l[c.getSLLabels().id]=h)}}};function Uy(n,t){let e=n.getSLLabels(),o=t.getSLLabels();if(e==null||o==null||e.getSide()!==o.getSide()||e.getSide()===u.EAST||e.getSide()===u.WEST)return!1;let r=e.getPosition().x,i=r+e.getSize().x,s=o.getPosition().x,a=s+o.getSize().x;return r<=a&&i>=s}function Fy(n,t,e){return n.getSLLabels()==null||t.getSLLabels()==null?!1:e[n.getSLLabels().id][t.getSLLabels().id]}var ky=3,mP=.5,Vh=class extends Ui{modifyBendPoints(t,e,o){let r=z.getIndividualOrInherited(t.getSLHyperLoop().getSLHolder().getLNode(),_.SPACING_EDGE_LABEL),i=new st;return i.push(PP(t.getSLSource())),this._addSplineControlPoints(t,e,o,i,r),i.push(PP(t.getSLTarget())),new Rs(!0,ky,i).getBezierCP()}_addSplineControlPoints(t,e,o,r,i){let s=t.getSLSource().getLPort().getSide(),a=o[0];for(let l=1;l<o.length;l++){let c=o[l];r.push(a);let g=new O((a.x+c.x)*mP,(a.y+c.y)*mP),h=Wy(s);h.scale(i),g.add(h),r.push(g),a=c,s=e===ni.CLOCKWISE?s.right():s.left()}r.push(o[o.length-1])}};function PP(n){let t=n.getLPort(),e=new O(t.getPosition().x,t.getPosition().y);return e.add(t.getAnchor()),e}function Wy(n){switch(n.toString()){case"NORTH":return new O(0,-1);case"EAST":return new O(1,0);case"SOUTH":return new O(0,1);case"WEST":return new O(-1,0);default:return new O}}var Xh=class{constructor(){this._routingDirector=new zh,this._labelPlacer=new Bh,this._routingSlotAssigner=new Yh}process(t,e){e.begin("Self-Loop routing",1);let o=this._routerForGraph(t),r=t.getProperty(Hn);for(let i of t.getLayers())for(let s of i.getNodes()){if(s.getType()!==y.NORMAL||!s.hasProperty(p.SELF_LOOP_HOLDER))continue;let a=s.getProperty(p.SELF_LOOP_HOLDER);this._processNode(a,r,o,e)}e.done()}_routerForGraph(t){switch(t.getProperty(_.EDGE_ROUTING)){case At.POLYLINE:return new Wh;case At.SPLINES:return new Vh;default:return new Ui}}_processNode(t,e,o,r){this._routingDirector.determineLoopRoutes(t),this._labelPlacer.placeLabels(t,e,r),this._routingSlotAssigner.assignRoutingSlots(t),o.routeSelfLoops(t)}};var Kh=class{process(t,e){e.begin("Semi-Interactive Crossing Minimization Processor",1);let o=!1;for(let r of t){let i=[];for(let s of r.getNodes())s.getType()===y.NORMAL&&s.hasProperty(_.POSITION)&&i.push(s);if(i.sort((s,a)=>{let l=s.getProperty(_.POSITION).y,c=a.getProperty(_.POSITION).y;return l-c}),i.length>0){o=!0;for(let s=0;s<i.length-1;s++)i[s].getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(i[s+1])}}o&&t.setProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES,!0),e.done()}};var Ao=class{constructor(t,e){this.name=t,this._returnValue=e,Object.freeze(this)}toString(){return this.name}returnValue(){return this._returnValue}};Ao.DUMMY_NODE_OVER=new Ao("DUMMY_NODE_OVER",Number.MAX_SAFE_INTEGER);Ao.DUMMY_NODE_UNDER=new Ao("DUMMY_NODE_UNDER",Number.MIN_SAFE_INTEGER);Ao.EQUAL=new Ao("EQUAL",0);var Wt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Wt.ONLY_WITHIN_GROUP=new Wt("ONLY_WITHIN_GROUP");Wt.MODEL_ORDER=new Wt("MODEL_ORDER");Wt.ENFORCED=new Wt("ENFORCED");var Qe=class{static calculateModelOrderOrGroupModelOrder(t,e,o,r){let i=o.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,s=o.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_ENFORCED_GROUP_ORDERS);if(t.hasProperty(p.MODEL_ORDER))if(i){let a=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID),l=e.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID);if(s.indexOf(a)>=0&&s.indexOf(l)>=0)return r*a+t.getProperty(p.MODEL_ORDER)}else return t.getProperty(p.MODEL_ORDER);else return-1;return t.getProperty(p.MODEL_ORDER)}};var Zh=class{constructor(t,e,o,r,i){this._graph=t,this._strategy=o,this._targetNodeModelOrder=r,this._portModelOrder=i,e!=null&&typeof e.getNodes=="function"?this._previousLayer=[...e.getNodes()]:this._previousLayer=e||[],this._biggerThan=new Map,this._smallerThan=new Map}compare(t,e){if(!this._biggerThan.has(t))this._biggerThan.set(t,new Set);else if(this._biggerThan.get(t).has(e))return 1;if(!this._biggerThan.has(e))this._biggerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return-1;if(!this._smallerThan.has(t))this._smallerThan.set(t,new Set);else if(this._smallerThan.get(t).has(e))return-1;if(!this._smallerThan.has(e))this._smallerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return 1;if(t.getSide()!==e.getSide()){let r=OP(t.getSide())-OP(e.getSide());return r>0?this._updateAssoc(t,e,1):this._updateAssoc(e,t,1),r}let o=1;if(t.getIncomingEdges().length>0&&e.getIncomingEdges().length>0){(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.NORTH&&e.getSide()===u.NORTH||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o);let r=t.getIncomingEdges()[0].getSource(),i=e.getIncomingEdges()[0].getSource(),s=r.getNode(),a=i.getNode();if(s===a)for(let c of s.getPorts()){if(c===r)return this._updateAssoc(e,t,o),-o;if(c===i)return this._updateAssoc(t,e,o),o}if(r.getNode().getType()===y.LONG_EDGE&&i.getNode().getType()===y.LONG_EDGE&&s.getLayer().id===a.getLayer().id&&s.getLayer().id===t.getNode().getLayer().id){let c=s.getLayer().getNodes(),g=this._checkReferenceLayer(c,s,a,t,e);if(g!==0)return t.getSide()===u.EAST&&e.getSide()===u.EAST&&(o=-o),g>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}let l=this._checkReferenceLayer(this._previousLayer,s,a,t,e);if(l!==0)return l>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o);if(this._portModelOrder){let c=this.checkPortModelOrder(t,e);if(c!==0)return c>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}}if(t.getOutgoingEdges().length>0&&e.getOutgoingEdges().length>0){(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o);let r=t.getProperty(p.LONG_EDGE_TARGET_NODE),i=e.getProperty(p.LONG_EDGE_TARGET_NODE);if(this._strategy===$t.PREFER_NODES&&r!=null&&i!=null&&r.hasProperty(p.MODEL_ORDER)&&i.hasProperty(p.MODEL_ORDER)){let l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES),c=Qe.calculateModelOrderOrGroupModelOrder(r,i,this._graph,l),g=Qe.calculateModelOrderOrGroupModelOrder(i,r,this._graph,l);return c>g?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}if(this._portModelOrder){let l=this.checkPortModelOrder(t,e);if(l!==0)return l>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}let s=0,a=0;return t.getOutgoingEdges()[0].hasProperty(p.MODEL_ORDER)&&(s=Qe.calculateModelOrderOrGroupModelOrder(t.getOutgoingEdges()[0],e.getOutgoingEdges()[0],this._graph,t.getOutgoingEdges().length+t.getIncomingEdges().length)),e.getOutgoingEdges()[0].hasProperty(p.MODEL_ORDER)&&(a=Qe.calculateModelOrderOrGroupModelOrder(e.getOutgoingEdges()[0],t.getOutgoingEdges()[0],this._graph,e.getOutgoingEdges().length+e.getIncomingEdges().length)),r!=null&&r===i?s>a?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o):(this._targetNodeModelOrder!=null&&(this._targetNodeModelOrder.has(r)&&(s=this._targetNodeModelOrder.get(r)),this._targetNodeModelOrder.has(i)&&(a=this._targetNodeModelOrder.get(i))),s>a?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o))}if(t.getIncomingEdges().length>0&&e.getOutgoingEdges().length>0)return this._updateAssoc(t,e,o),1;if(t.getOutgoingEdges().length>0&&e.getIncomingEdges().length>0)return this._updateAssoc(e,t,o),-1;if(t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER)){let r=t.getNode().getPorts().length,i=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,r),s=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,r);return(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o),i>s?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}return this._updateAssoc(e,t,o),-o}checkPortModelOrder(t,e){let o=t.getNode().getPorts().length;if(t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER)){let r=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,o),i=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,o);return r-i}return 0}_updateAssoc(t,e,o){let r=t,i=e;o<0&&(r=e,i=t);let s=this._biggerThan.get(r),a=this._biggerThan.get(i),l=this._smallerThan.get(r),c=this._smallerThan.get(i);s.add(i),c.add(r);for(let g of a){s.add(g);let h=this._smallerThan.get(g);if(h){h.add(r);for(let d of l)h.add(d)}}for(let g of l){c.add(g);let h=this._biggerThan.get(g);if(h){h.add(i);for(let d of a)h.add(d)}}}_checkReferenceLayer(t,e,o,r,i){for(let s of t){if(s===e)return-1;if(s===o)return 1}return 0}clearTransitiveOrdering(){this._biggerThan=new Map,this._smallerThan=new Map}},zy=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);function OP(n){return zy.get(n)||0}var nl=class{constructor(t,e,o,r,i,s){this._graph=t,this._orderingStrategy=o,this._groupOrderStrategy=i,this._longEdgeNodeOrder=r||Ao.EQUAL,this._beforePorts=s,e!=null&&typeof e.getNodes=="function"?this._previousLayer=[...e.getNodes()]:this._previousLayer=e||[],this._biggerThan=new Map,this._smallerThan=new Map}compare(t,e){if(!this._biggerThan.has(t))this._biggerThan.set(t,new Set);else if(this._biggerThan.get(t).has(e))return 1;if(!this._biggerThan.has(e))this._biggerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return-1;if(!this._smallerThan.has(t))this._smallerThan.set(t,new Set);else if(this._smallerThan.get(t).has(e))return-1;if(!this._smallerThan.has(e))this._smallerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return 1;let o=t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER);if(this._orderingStrategy===$t.PREFER_EDGES||!o){let i=this._findPreviousLayerSourcePort(t),s=this._findPreviousLayerSourcePort(e);if(i!=null&&s!=null){let a=i.getNode(),l=s.getNode();if(a!=null&&a===l){for(let h of a.getPorts()){if(h===i)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(h===s)return this._updateBiggerAndSmallerAssociations(t,e),1}let c=this._getModelOrderFromConnectedEdges(t),g=this._getModelOrderFromConnectedEdges(e);return c>g?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}for(let c of this._previousLayer){if(c===a)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(c===l)return this._updateBiggerAndSmallerAssociations(t,e),1}}if(i!=null&&s==null||i==null&&s!=null){let a=this._handleHelperDummyNodes(t,e);if(a!==0)return a>0?this._updateBiggerAndSmallerAssociations(t,e):this._updateBiggerAndSmallerAssociations(e,t),a;if(!o){let l=this._getModelOrderFromConnectedEdges(t),c=this._getModelOrderFromConnectedEdges(e);return l>c?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}}if(i==null&&s==null){let a=this._handleHelperDummyNodes(t,e);if(a!==0)return a>0?this._updateBiggerAndSmallerAssociations(t,e):this._updateBiggerAndSmallerAssociations(e,t),a}}if(o){let i=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES),s=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,i),a=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,i);return s>a?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}return this._updateBiggerAndSmallerAssociations(e,t),-1}_findPreviousLayerSourcePort(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0){let o=e.getIncomingEdges()[0].getSource().getNode(),r=o.getLayer&&o.getLayer(),i=t.getLayer&&t.getLayer();if(r!=null&&i!=null&&r.id===i.id-1)return e.getIncomingEdges()[0].getSource()}return null}_getModelOrderFromConnectedEdges(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0)return e.getIncomingEdges()[0].getProperty(p.MODEL_ORDER);return this._longEdgeNodeOrder.returnValue()}_updateBiggerAndSmallerAssociations(t,e){let o=this._biggerThan.get(t),r=this._biggerThan.get(e),i=this._smallerThan.get(t),s=this._smallerThan.get(e);o.add(e),s.add(t);for(let a of r){o.add(a);let l=this._smallerThan.get(a);if(l){l.add(t);for(let c of i)l.add(c)}}for(let a of i){s.add(a);let l=this._biggerThan.get(a);if(l){l.add(e);for(let c of r)l.add(c)}}}_handleHelperDummyNodes(t,e){if(t.getType()===y.LONG_EDGE&&e.getType()===y.NORMAL){let o=this._getFirstIncomingSourcePortOfNode(t),r=this._getFirstOutgoingTargetPortOfNode(t);if(o==null||r==null)return 0;let i=t.getLayer().id;return o.getNode().getLayer().id!==i&&r.getNode().getLayer().id!==i?0:o.getNode()===e?(this._updateBiggerAndSmallerAssociations(t,e),1):r.getNode()===e?(this._updateBiggerAndSmallerAssociations(t,e),1):this.compare(o.getNode(),e)}if(t.getType()===y.NORMAL&&e.getType()===y.LONG_EDGE){let o=this._getFirstIncomingSourcePortOfNode(e),r=this._getFirstOutgoingTargetPortOfNode(e);if(o==null||r==null)return 0;let i=t.getLayer().id;return o.getNode().getLayer().id!==i&&r.getNode().getLayer().id!==i?0:o.getNode()===t?(this._updateBiggerAndSmallerAssociations(e,t),-1):r.getNode()===t?(this._updateBiggerAndSmallerAssociations(e,t),-1):this.compare(t,o.getNode())}if(t.getType()===y.LONG_EDGE&&e.getType()===y.LONG_EDGE){let o=this._getFirstIncomingSourcePortOfNode(t),r=this._getFirstOutgoingTargetPortOfNode(t),i=this._getFirstIncomingSourcePortOfNode(e),s=this._getFirstOutgoingTargetPortOfNode(e);if(o==null||r==null||i==null||s==null)return 0;let a=t.getLayer().id,l=e.getLayer().id,c=t,g=e;if(o.getNode().getLayer().id===a?c=o.getNode():r.getNode().getLayer().id===a&&(c=r.getNode()),i.getNode().getLayer().id===l?g=i.getNode():s.getNode().getLayer().id===l&&(g=s.getNode()),c===g)for(let h of c.getPorts()){if(h===o)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(h===i)return this._updateBiggerAndSmallerAssociations(t,e),1}return this.compare(c,g)}return 0}_getFirstIncomingSourcePortOfNode(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0)return e.getIncomingEdges()[0].getSource();return null}_getFirstOutgoingTargetPortOfNode(t){for(let e of t.getPorts())if(e.getOutgoingEdges().length>0)return e.getOutgoingEdges()[0].getTarget();return null}clearTransitiveOrdering(){this._biggerThan=new Map,this._smallerThan=new Map}};var jh=class n{process(t,e){e&&e.begin&&e.begin("Sort By Input Model "+t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),1);let o=0;for(let r of t.getLayers()){r.id=o;let i=o===0?0:o-1,s=t.getLayers()[i],a=new nl(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY),!0);n.insertionSort(r.getNodes(),a);for(let l of r.getNodes()){let c=l.getProperty(_.PORT_CONSTRAINTS);c!==H.FIXED_ORDER&&c!==H.FIXED_POS&&l.getPorts().sort((g,h)=>new Zh(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),n.longEdgeTargetNodePreprocessing(l),t.getProperty(_.CONSIDER_MODEL_ORDER_PORT_MODEL_ORDER)).compare(g,h))}a=new nl(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY),!1),n.insertionSort(r.getNodes(),a),o++}e&&e.done&&e.done()}static longEdgeTargetNodePreprocessing(t){let e=new Map;if(t.hasProperty(p.TARGET_NODE_MODEL_ORDER))return t.getProperty(p.TARGET_NODE_MODEL_ORDER);for(let o of t.getPorts()){if(o.getOutgoingEdges().length===0)continue;let r=n.getTargetNode(o);if(o.setProperty(p.LONG_EDGE_TARGET_NODE,r),r!=null){let i=o.getOutgoingEdges()[0];if(!i.getProperty(p.REVERSED)){let s=e.has(r)?e.get(r):Number.MAX_SAFE_INTEGER;e.set(r,Math.min(i.getProperty(p.MODEL_ORDER),s))}}}return t.setProperty(p.TARGET_NODE_MODEL_ORDER,e),e}static getTargetNode(t){let e=null,o=t.getOutgoingEdges()[0];do{if(e=o.getTarget().getNode(),e.hasProperty(p.LONG_EDGE_TARGET))return e.getProperty(p.LONG_EDGE_TARGET).getNode();if(e.getType()!==y.NORMAL){let i=e.getOutgoingEdges()[Symbol.iterator]().next();if(!i.done)o=i.value;else return null}}while(e!=null&&e.getType()!==y.NORMAL);return e}static insertionSort(t,e){for(let o=1;o<t.length;o++){let r=t[o],i=o;for(;i>0&&e.compare(t[i-1],r)>0;)t[i]=t[i-1],i--;t[i]=r}e.clearTransitiveOrdering()}};var $h=class{process(t,e){e.begin("Alternating layer unzipping",1);let o=1,r=[],i=t.getLayers();for(let s=0;s<i.length;s++){let a=i[s],l=Yy(a),c=Vy(a);if(Xy(a)){let h=0,d=0;for(let f of a)h=Math.max(h,f.getSize().x),d+=f.getSize().y;if(d/=a.getNodes().length,h+=Math.max(2*t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),Math.max(a.getNodes().length*t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS))),d+=Math.max(t.getProperty(_.SPACING_NODE_NODE),t.getProperty(_.SPACING_EDGE_NODE)),h/d>=a.getNodes().length/4)continue}if(a.getNodes().length>l){let h=[a];for(let f=0;f<l-1;f++){let E=new Et(t);r.push([E,s+f+o]),h.push(E)}o+=l-1;let d=h[0].getNodes().length;for(let f=0,E=0,P=0;f<d;f++,E++,P++){let S=h[0].getNodes()[E];S.getType()!==y.NONSHIFTING_PLACEHOLDER?E+=Ky(t,h,P%l,E):(f--,P--),c&&S.getType()===y.LONG_EDGE&&(P=-1)}}}for(let[s,a]of r)i.splice(a,0,s);for(let s of i){let a=s.getNodes();for(let l=a.length-1;l>=0;l--){let c=a[l].getType();(c===y.PLACEHOLDER||c===y.NONSHIFTING_PLACEHOLDER)&&a.splice(l,1)}}e.done()}};function Yy(n){let t=Number.MAX_SAFE_INTEGER,e=!0;for(let o of n)if(o.hasProperty(_.LAYER_UNZIPPING_LAYER_SPLIT)){e=!1;let r=o.getProperty(_.LAYER_UNZIPPING_LAYER_SPLIT);r<t&&(t=r)}return e?_.LAYER_UNZIPPING_LAYER_SPLIT.getDefault():t}function Vy(n){for(let t of n)if(t.hasProperty(_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES)&&!t.getProperty(_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES))return!1;return!0}function Xy(n){for(let t of n)if(t.hasProperty(_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH)&&t.getProperty(_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH))return!0;return!1}function Ky(n,t,e,o){let r=t[0].getNodes()[o];e>0&&r.setLayer(t[e]);let i=0,s=!0,a=[...r.getIncomingEdges()].reverse();for(let c of a){s=!1;let g=c;for(let h=0;h<e;h++){let d=SP(n,g);o+i>t[h].getNodes().length?d.setLayer(t[h]):d.setLayer(o+i,t[h]),g=ri.splitEdge(g,d)}e>0&&i++}if(s){for(let c=0;c<e;c++){let g=new ft(n);g.setType(y.PLACEHOLDER),o+i>t[c].getNodes().length?g.setLayer(t[c]):g.setLayer(o+i,t[c])}e>0&&i++}let l=!1;for(let c of r.getOutgoingEdges()){let g=c;for(let h=e+1;h<t.length;h++){let d=SP(n,g);d.setLayer(t[h]),g=ri.splitEdge(g,d)}for(let h=0;h<=e;h++)if(l){let d=new ft(n);d.setType(y.NONSHIFTING_PLACEHOLDER),o+1>t[h].getNodes().length?d.setLayer(t[h]):d.setLayer(o+1,t[h])}l&&i++,l=!0}return i>0?i-1:0}function SP(n,t){let e=new ft(n);return e.setType(y.LONG_EDGE),e.setProperty(p.ORIGIN,t),e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),e}var ro=class{constructor(t){this._name=t}toString(){return this._name}};ro.ARD=new ro("ARD");ro.MSD=new ro("MSD");ro.MANUAL=new ro("MANUAL");var io=class{constructor(t){this._name=t}toString(){return this._name}};io.NO=new io("NO");io.GREEDY=new io("GREEDY");io.LOOK_BACK=new io("LOOK_BACK");var kn=class{constructor(t){this.graph=t;let e=t.getProperty(_.DIRECTION),o=t.getProperty(_.ASPECT_RATIO),r=t.getProperty(_.WRAPPING_CORRECTION_FACTOR);e===R.LEFT||e===R.RIGHT||e===R.UNDEFINED||e==null?this.dar=o*r:this.dar=1/(o*r),this._spacing=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._inLayerSpacing=t.getProperty(_.SPACING_NODE_NODE),this.longestPath=t.getLayers().length,this._maxWidth=null,this._maxHeight=null,this._sumWidth=null,this._widths=null,this._heights=null,this._cutsAllowed=null}getApproximateLayerWidth(t){return this._determineLayerWidth(t)}getApproximateLayeringWidth(){return this.getSumWidth()}getApproximateChunkBasedLayeringWidth(t){if(t.length===0)return this.getApproximateLayeringWidth();let e=0,o=0;for(let r of t)e=Math.max(e,this._determineChunkWidth(o,r)),o=r;return e=Math.max(e,this._determineChunkWidth(o,this.graph.getLayers().length)),e}getApproximateLayerHeight(t){return this._determineLayerHeight(t)}getApproximateLayeringHeight(){return this.getMaxHeight()}getApproximateChunkBasedLayeringHeight(t){if(t.length===0)return 0;let e=0,o=0;for(let r of t)e+=this._determineChunkHeight(o,r),o=r;return e+=this._determineChunkHeight(o,this.graph.getLayers().length),e}getMaxWidth(){return this._maxWidth==null&&(this._maxWidth=this._determineWidth((t,e)=>Math.max(t,e))),this._maxWidth}getSumWidth(){return this._sumWidth==null&&(this._sumWidth=this._determineWidth((t,e)=>t+e)),this._sumWidth}getWidths(){return this._widths==null&&this._initWidthsAndHeights(),this._widths}_initWidthsAndHeights(){let t=this.longestPath;this._widths=new Array(t),this._heights=new Array(t);for(let e=0;e<t;e++){let o=this.graph.getLayers()[e];this._widths[e]=this._determineLayerWidth(o),this._heights[e]=this._determineLayerHeight(o)}}_determineWidth(t){let e=this.graph.getLayers();if(e.length===0)return 0;let o=this._determineLayerWidth(e[0]);for(let r=1;r<e.length;r++)o=t(o,this._determineLayerWidth(e[r]));return o}_determineLayerWidth(t){let e=0;for(let o of t.getNodes()){let r=o.getSize().x+o.getMargin().right+o.getMargin().left+this._spacing;r>e&&(e=r)}return e}_determineChunkWidth(t,e){let o=0,r=this.graph.getLayers();for(let i=t;i<e;i++)o+=this._determineLayerWidth(r[i]);return o}getMaxHeight(){return this._maxHeight==null&&(this._maxHeight=this._determineHeight((t,e)=>Math.max(t,e))),this._maxHeight}getHeights(){return this._heights==null&&this._initWidthsAndHeights(),this._heights}_determineHeight(t){let e=this.graph.getLayers();if(e.length===0)return 0;let o=this._determineLayerHeight(e[0]);for(let r=1;r<e.length;r++)o=t(o,this._determineLayerHeight(e[r]));return o}_determineLayerHeight(t){let e=0;for(let o of t.getNodes()){e+=o.getSize().y+o.getMargin().bottom+o.getMargin().top+this._inLayerSpacing;for(let r of o.getIncomingEdges())if(r.getSource().getNode().getType()===y.NORTH_SOUTH_PORT){let s=r.getSource().getNode().getProperty(p.ORIGIN);s!=null&&(e+=s.getSize().y+s.getMargin().bottom+s.getMargin().top)}}return e}_determineChunkHeight(t,e){let o=this.graph.getLayers(),r=0;for(let i=t;i<e;i++){let s=this._determineLayerHeight(o[i]);s>r&&(r=s)}return r}isCutAllowed(t){return this._cutsAllowed==null&&this._initCutAllowed(),this._cutsAllowed[t]}getCutsAllowed(){return this._cutsAllowed==null&&this._initCutAllowed(),this._cutsAllowed}_initCutAllowed(){if(this._cutsAllowed=new Array(this.graph.getLayers().length).fill(!0),this._cutsAllowed[0]=!1,this.graph.hasProperty(_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES)){let t=this.graph.getProperty(_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES);for(let e of t)e>0&&e<this._cutsAllowed.length&&(this._cutsAllowed[e]=!1)}else{let t=this.graph.getLayers();for(let e=1;e<t.length;e++)this._cutsAllowed[e]=Zy(t[e])}}};function Zy(n){let t=null,e=null;for(let o of n.getNodes())for(let r of o.getIncomingEdges()){if(t!=null&&t!==o)return!1;t=o;let i=r.getSource().getNode();if(e!=null&&e!==i)return!1;e=i}return!0}var Wn=class{getCutIndexes(t,e){let o=t.getProperty(_.WRAPPING_CUTTING_CUTS);return o!=null?o:[]}guaranteeValid(){return!1}};var Fi=class n{getCutIndexes(t,e){let o=n.getChunkCount(e),r=[],i=e.longestPath/o;for(let s=1;s<o;s++)r.push(Math.round(s*i));return r}static getChunkCount(t){let e=Math.sqrt(t.getSumWidth()/(t.dar*t.getMaxHeight())),o=Math.round(e);return o=Math.min(o,t.longestPath),o}guaranteeValid(){return!1}};var zn=class{guaranteeValid(){return!1}getCutIndexes(t,e){let o=e.getWidths(),r=e.getHeights(),i=new Array(o.length);i[0]=o[0];let s=o[0];for(let h=1;h<o.length;h++)i[h]=i[h-1]+o[h],s+=o[h];let a=Fi.getChunkCount(e)-1,l=t.getProperty(_.WRAPPING_CUTTING_MSD_FREEDOM),c=Number.NEGATIVE_INFINITY,g=[];for(let h=Math.max(0,a-l);h<=Math.min(e.longestPath-1,a+l);h++){let d=s/(h+1),f=0,E=1,P=[],S=Number.NEGATIVE_INFINITY,T=0,N=0,I=r[0];if(h===0)S=s,N=e.getMaxHeight();else{for(;E<e.longestPath;)i[E-1]-f>=d&&(P.push(E),S=Math.max(S,i[E-1]-T),N+=I,f+=i[E-1]-f,T=i[E-1],I=r[E]),I=Math.max(I,r[E]),E++;N+=I}let C=Math.min(1/S,1/e.dar/N);C>c&&(c=C,g=P)}return g}};var Yn=class{static insertDummies(t,e,o){let r=t.getProperty(_.SPACING_EDGE_NODE),i=t.getProperty(_.WRAPPING_ADDITIONAL_EDGE_SPACING),s=new bo;s.setProperty(_.SPACING_EDGE_NODE,r+i);let a=e,l=a.getTarget(),c=a.getSource().getNode(),g=a.getTarget().getNode(),h=c.getLayer().getIndex(),d=g.getLayer().getIndex(),f=[];for(let E=h;E<=d;E++){let P=new ft(t);P.setType(y.LONG_EDGE),P.setProperty(p.ORIGIN,a),P.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),P.setProperty(_.SPACING_INDIVIDUAL,s);let S=t.getLayers()[E];E===h?P.setLayer(S.getNodes().length-o,S):P.setLayer(S);let T=a.getProperty(_.EDGE_THICKNESS);T<0&&(T=0,a.setProperty(_.EDGE_THICKNESS,T)),P.getSize().y=T;let N=Math.floor(T/2),I=new rt;I.setSide(u.WEST),I.setNode(P),I.getPosition().y=N;let C=new rt;C.setSide(u.EAST),C.setNode(P),C.getPosition().y=N,a.setTarget(I);let x=new _e;x.copyProperties(a),x.setProperty(_.JUNCTION_POINTS,null),x.setSource(C),x.setTarget(l),jy(P,a,x),f.push(x),a=x}return f}};function jy(n,t,e){let o=t.getSource().getNode();o.getType()===y.LONG_EDGE?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET))):(n.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),n.setProperty(p.LONG_EDGE_TARGET,e.getTarget()))}var xs=class n{process(t,e){if(e.begin("Path-Like Graph Wrapping",1),t.getLayers().length===0){e.done();return}let o=new kn(t),i=o.getMaxWidth()*o.longestPath/o.getMaxWidth();if(o.dar>i){e.done();return}let s;switch(t.getProperty(_.WRAPPING_CUTTING_STRATEGY)){case ro.MANUAL:s=new Wn;break;case ro.ARD:s=new Fi;break;default:s=new zn}let a=s.getCutIndexes(t,o);if(!s.guaranteeValid())switch(t.getProperty(_.WRAPPING_VALIDIFY_STRATEGY)){case io.LOOK_BACK:a=n.validifyIndexesLookingBack(o,a);break;case io.GREEDY:a=n.validifyIndexesGreedily(o,a);break;default:}qy(t,o,a),e.done()}static validifyIndexesGreedily(t,e){let o=[],r=0;for(let i of e){let s=i+r;for(;s<t.longestPath&&!t.isCutAllowed(s);)s++,r++;if(s>=t.longestPath)break;o.push(s)}return o}static validifyIndexesLookingBack(t,e){if(e.length===0)return[];let o=[];o.push(Number.NEGATIVE_INFINITY);for(let r=1;r<t.longestPath;r++)t.isCutAllowed(r)&&o.push(r);return o.length===1?[]:(o.push(Number.POSITIVE_INFINITY),$y(e,o))}};function $y(n,t){let e=[],o=0,r=0,i=0;for(;o<t.length-1&&r<n.length;){let s=n[r]+i;for(;t[o+1]<s;)o++;let a=0,l=s-t[o],c=t[o+1]-s;l>c&&a++;let g=t[o+a];for(e.push(g),i+=g-s,r++;r<n.length&&n[r]+i<=g;)r++;o+=1+a}return e}function qy(n,t,e){if(e.length===0)return;let o=0,r=0,i=0,s=e[i++];for(;o<t.longestPath;){if(o===s&&(r=0,i<e.length?s=e[i++]:s=t.longestPath+1),o!==r){let l=n.getLayers()[o],c=n.getLayers()[r],g=l.getNodes().slice();for(let h of g)if(h.setLayer(c.getNodes().length,c),r===0){let d=[...h.getIncomingEdges()];for(let f of d)f.reverse(n,!0),n.setProperty(p.CYCLIC,!0),Yn.insertDummies(n,f,1)}}r++,o++}let a=n.getLayers();for(let l=a.length-1;l>=0;l--)a[l].getNodes().length===0&&a.splice(l,1)}var qh=class{process(t,e){e.begin("Breaking Point Insertion",1);let o=new kn(t),r;switch(t.getProperty(_.WRAPPING_CUTTING_STRATEGY)){case ro.MANUAL:r=new Wn;break;case ro.ARD:r=new Fi;break;default:r=new zn}let i=r.getCutIndexes(t,o);if(t.getProperty(_.WRAPPING_MULTI_EDGE_IMPROVE_CUTS)&&(i=Qy(t,i)),!r.guaranteeValid()&&t.hasProperty(_.WRAPPING_VALIDIFY_STRATEGY))switch(t.getProperty(_.WRAPPING_VALIDIFY_STRATEGY)){case io.LOOK_BACK:i=xs.validifyIndexesLookingBack(o,i);break;case io.GREEDY:i=xs.validifyIndexesGreedily(o,i);break;default:}if(i.length===0){e.done();return}Jy(t,i),e.done()}},vr=class{constructor(t,e,o,r,i){this.start=t,this.end=e,this.nodeStartEdge=o,this.startEndEdge=r,this.originalEdge=i,this.startInLayerDummy=null,this.startInLayerEdge=null,this.endInLayerDummy=null,this.endInLayerEdge=null,this.prev=null,this.next=null}static isStart(t){let e=t.getProperty(p.BREAKING_POINT_INFO);return e!=null&&e.start===t}static isEnd(t){let e=t.getProperty(p.BREAKING_POINT_INFO);return e!=null&&e.end===t}};function Jy(n,t){let e=n.getLayers(),o=0,r=t[o++],i=0,s=new Set,a=new Set,l=0,c=0;for(;l<e.length;){let g=e[l];for(let h of g){for(let d of h.getOutgoingEdges())a.add(d);for(let d of h.getIncomingEdges())a.delete(d)}if(c+1===r){let h=new Et(n),d=new Et(n);e.splice(l+1,0,h,d),l+=2;for(let f of a){s.has(f)||(i++,s.add(f));let E=new ft(n);E.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),E.setLayer(h),E.setType(y.BREAKING_POINT);let P=new rt;P.setNode(E),P.setSide(u.WEST);let S=new rt;S.setNode(E),S.setSide(u.EAST);let T=new ft(n);T.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),T.setLayer(d),T.setType(y.BREAKING_POINT);let N=new rt;N.setNode(T),N.setSide(u.WEST);let I=new rt;I.setNode(T),I.setSide(u.EAST);let C=new _e;C.setSource(f.getSource()),C.setTarget(P),C.setProperty(p.MODEL_ORDER,f.getProperty(p.MODEL_ORDER));let x=new _e;x.setSource(S),x.setTarget(N),x.setProperty(p.MODEL_ORDER,f.getProperty(p.MODEL_ORDER)),f.setSource(I);let M=new vr(E,T,C,x,f);E.setProperty(p.BREAKING_POINT_INFO,M),T.setProperty(p.BREAKING_POINT_INFO,M);let A=C.getSource().getNode();if(A.getType()===y.BREAKING_POINT){let B=A.getProperty(p.BREAKING_POINT_INFO);B.next=M,M.prev=B}}if(o<t.length)r=t[o++];else break}c++,l++}return i}function Qy(n,t){let e=[],o=[],r=null;for(let s of t){let a=new I_(s);o.push(a),r!=null&&(a.prev=r,r.suc=a),r=a}let i=eI(n);for(let s=0;s<o.length;s++){let a=null,l=o[0].selfOrNext(),c=null,g=Number.POSITIVE_INFINITY;for(let h=1;h<n.getLayers().length;h++){let d,f=l!=null?Math.abs(l.index-h):Math.abs(h-a.index)+1,E=a!=null?Math.abs(h-a.index):f+1,P;E<f?(d=a,P=E):(d=l,P=f);let S=tI(n,h,i[h],P);S<g&&(g=S,c=d,c.newIndex=h),l!=null&&h===l.index&&(a=l,l=l.next())}c!=null&&(e.push(c.newIndex),c.assigned=!0,c.offset())}return e.sort((s,a)=>s-a),e}function tI(n,t,e,o){let r=n.getProperty(_.WRAPPING_MULTI_EDGE_DISTANCE_PENALTY);return e+Math.pow(o,r)}function eI(n){let t=new Array(n.getLayers().length+1).fill(0),e=new Set,o=0;for(let r of n.getLayers()){t[o++]=e.size;for(let i of r.getNodes())for(let s of i.getOutgoingEdges())e.add(s);for(let i of r.getNodes())for(let s of i.getIncomingEdges())e.delete(s)}return t}var I_=class{constructor(t){this.index=t,this.newIndex=t,this.prev=null,this.suc=null,this.assigned=!1}selfOrNext(){return this.assigned?this.suc!=null?this.suc.selfOrNext():null:this}next(){return this.suc!=null?this.suc.selfOrNext():null}offset(){if(!this.assigned)throw new Error("Cannot offset an unassigned cut.");let t=this.newIndex-this.index;this._offset(t),this._offsetPrev(t),this._offsetSuc(t)}_offset(t){this.index+=t}_offsetPrev(t){this.prev!=null&&!this.prev.assigned&&(this.prev._offset(t),this.prev._offsetPrev(t))}_offsetSuc(t){this.suc!=null&&!this.suc.assigned&&(this.suc._offset(t),this.suc._offsetSuc(t))}};var Qh=class{process(t,e){if(e.begin("Breaking Point Processor",1),oI(t),t.getProperty(_.WRAPPING_MULTI_EDGE_IMPROVE_WRAPPED_EDGES)){for(let o of t.getLayers()){let r=0;for(let i of o.getNodes())i.id=r++}rI(t),TP(t,!0),TP(t,!1)}e.done()}};function oI(n){let t=n.getLayers();t.unshift(new Et(n));let e=!1,o=1,r=0;for(;r<t.length;){let i=t[r],s=t[o],a=i.getNodes().slice(),l=a.length;for(let c of a)c.setLayer(s);if(e){let c=a.slice().reverse();for(let g of c){let h=[...g.getIncomingEdges()];for(let d of h){d.reverse(n,!0),n.setProperty(p.CYCLIC,!0);let f=Yn.insertDummies(n,d,l),E=g.getProperty(p.BREAKING_POINT_INFO),P=f[f.length-1];E.startInLayerDummy=P.getSource().getNode(),E.startInLayerEdge=P,E.endInLayerDummy=d.getTarget().getNode(),E.endInLayerEdge=d}}e=!1}else a.length>0&&a[0].getType()===y.BREAKING_POINT&&(e=!0,o=-1);o++,r++}for(let i=t.length-1;i>=0;i--)t[i].getNodes().length===0&&t.splice(i,1)}function rI(n){for(let t of n.getLayers()){let e=t.getNodes().slice();for(let o of e){if(!vr.isStart(o))continue;let r=o.getProperty(p.BREAKING_POINT_INFO);if(r.prev!=null||r.next==null)continue;let i=r,s=r.next;for(;s!=null;){NP(s.start,s.startInLayerDummy,!1,!0),Vn(i.end),Vn(s.start),Vn(s.startInLayerDummy),Vn(s.endInLayerDummy),s.endInLayerEdge.setTarget(i.endInLayerEdge.getTarget()),i.endInLayerEdge.setTarget(null),i.end.setLayer(null),s.start.setLayer(null),s.startInLayerDummy.setLayer(null),s.endInLayerDummy.setLayer(null);let a=new vr(i.start,s.end,i.nodeStartEdge,s.startEndEdge,s.originalEdge);a.startInLayerDummy=i.startInLayerDummy,a.startInLayerEdge=i.startInLayerEdge,a.endInLayerDummy=i.endInLayerDummy,a.endInLayerEdge=s.endInLayerEdge,a.prev=i.prev,a.next=s.next,i.start.setProperty(p.BREAKING_POINT_INFO,a),s.end.setProperty(p.BREAKING_POINT_INFO,a),s=s.next,i=a}}}}function TP(n,t){let e=t?r=>vr.isEnd(r):r=>vr.isStart(r),o;do{o=!1;let r=t?n.getLayers().slice().reverse():n.getLayers();for(let i of r){let s=i.getNodes().slice();for(let a of s){if(!e(a))continue;let l=a.getProperty(p.BREAKING_POINT_INFO),c=t?l.endInLayerDummy:l.startInLayerDummy;NP(a,c,t,!1)&&(o=!0)}}}while(o)}function NP(n,t,e,o){let r=Jh(n,e),i=Jh(t,e),s=!1;for(;r!=null&&i!=null&&!(!o&&!iI(r,i,e));){let a=Jh(r,e),l=Jh(i,e);Vn(t),Vn(n);let c=r.getLayer();ii.joinAt(r,!1),ii.joinAt(i,!1),e?(t.setLayer(i.id,c),t.id=i.id,n.setLayer(r.id+1,c),n.id=r.id):(n.setLayer(r.id,c),n.id=r.id,t.setLayer(i.id+1,c),t.id=i.id),r.setLayer(null),i.setLayer(null),r=a,i=l,s=!0}return s}function iI(n,t,e){let o=n.getLayer(),r=e?t:n,i=e?n:t;for(let s=r.id+1;s<i.id;s++){let a=o.getNodes()[s];if(!(a.getType()===y.BREAKING_POINT||sI(a)))return!1}return!0}function Jh(n,t){let e=t?n.getOutgoingEdges():n.getIncomingEdges();for(let o of e){let r=o.getOther(n);if(r.getType()===y.LONG_EDGE&&r.getLayer()!==n.getLayer())return r}return null}function sI(n){if(n.getType()!==y.LONG_EDGE)return!1;for(let t of n.getConnectedEdges())if(!t.isSelfLoop()&&n.getLayer()===t.getOther(n).getLayer())return!0;return!1}function Vn(n){let t=n.getLayer();if(t==null)return;let e=t.getNodes();for(let o=n.id+1;o<e.length;o++)e[o].id--}var td=class{constructor(){this._edgeRouting=null}process(t,e){e.begin("Breaking Point Removing",1),this._edgeRouting=t.getProperty(_.EDGE_ROUTING);for(let o of t.getLayers()){let r=o.getNodes().slice();for(let i of r){if(!vr.isEnd(i))continue;let s=i.getProperty(p.BREAKING_POINT_INFO);s.next==null&&this._remove(t,s)}}e.done()}_remove(t,e){let o=new st;switch(this._edgeRouting){case At.SPLINES:{let l=e.nodeStartEdge.getProperty(p.SPLINE_ROUTE_START),c=e.startEndEdge.getProperty(p.SPLINE_ROUTE_START),g=e.originalEdge.getProperty(p.SPLINE_ROUTE_START),h=e.nodeStartEdge.getProperty(p.SPLINE_EDGE_CHAIN),d=e.startEndEdge.getProperty(p.SPLINE_EDGE_CHAIN),f=e.originalEdge.getProperty(p.SPLINE_EDGE_CHAIN),E=[];if(l&&E.push(...l),c){for(let S of c)S.inverseOrder=!0;E.push(...[...c].reverse())}g&&E.push(...g);let P=[];h&&P.push(...h),d&&P.push(...[...d].reverse()),f&&P.push(...f),e.originalEdge.setProperty(p.SPLINE_ROUTE_START,E),e.originalEdge.setProperty(p.SPLINE_EDGE_CHAIN,P),e.originalEdge.setProperty(p.SPLINE_SURVIVING_EDGE,e.originalEdge),e.nodeStartEdge.setProperty(p.SPLINE_ROUTE_START,null),e.nodeStartEdge.setProperty(p.SPLINE_EDGE_CHAIN,null),e.startEndEdge.setProperty(p.SPLINE_ROUTE_START,null),e.startEndEdge.setProperty(p.SPLINE_EDGE_CHAIN,null);break}case At.POLYLINE:{for(let c of e.nodeStartEdge.getBendPoints())o.add(c);o.add(e.start.getPosition());let l=[...e.startEndEdge.getBendPoints()].reverse();for(let c of l)o.add(c);o.add(e.end.getPosition());for(let c of e.originalEdge.getBendPoints())o.add(c);break}default:{for(let c of e.nodeStartEdge.getBendPoints())o.add(c);let l=[...e.startEndEdge.getBendPoints()].reverse();for(let c of l)o.add(c);for(let c of e.originalEdge.getBendPoints())o.add(c)}}let r=e.originalEdge.getBendPoints();r.length=0;for(let l of o)r.add(l);e.originalEdge.setSource(e.nodeStartEdge.getSource());let i=e.nodeStartEdge.getProperty(_.JUNCTION_POINTS),s=e.startEndEdge.getProperty(_.JUNCTION_POINTS),a=e.originalEdge.getProperty(_.JUNCTION_POINTS);if(i!=null||s!=null||a!=null){let l=new st;R_(l,a),R_(l,s),R_(l,i),e.originalEdge.setProperty(_.JUNCTION_POINTS,l)}e.startEndEdge.setSource(null),e.startEndEdge.setTarget(null),e.nodeStartEdge.setSource(null),e.nodeStartEdge.setTarget(null),e.end.setLayer(null),e.start.setLayer(null),e.prev!=null&&this._remove(t,e.prev)}};function R_(n,t){if(n==null||t==null)return!1;for(let e of t)n.add(e);return!0}var tr=class{constructor(){this.id=0,this.master=null,this.cNodes=new Set,this.startPos=Number.NEGATIVE_INFINITY,this.incomingConstraints=new Set,this.outDegree=0,this.outDegreeReal=0,this.reference=null,this.delta=0,this.deltaNormalized=0}static of(){return new L_}addCNode(t){if(t.cGroup!=null)throw new Error("CNode belongs to another CGroup.");this.cNodes.add(t),t.cGroup=this,this.reference==null&&(this.reference=t)}removeCNode(t){let e=this.cNodes.delete(t);return e&&(t.cGroup=null),e}},L_=class{constructor(){this.group=new tr}nodes(...t){for(let e of t)this.group.addCNode(e);return this}reference(t){return this.group.reference=t,this}master(t){return this.group.master=t,this}create(t){return t.cGroups.push(this.group),this.group}};var ed=class{compact(t){let e=Number.POSITIVE_INFINITY;for(let r of t.cGraph.cNodes)e=Math.min(e,r.cGroup.reference.hitbox.x+r.cGroupOffset.x);let o=[];for(let r of t.cGraph.cGroups)r.startPos=e,r.outDegree===0&&o.push(r);for(;o.length>0;){let r=o.shift(),i=r.reference.hitbox.x;for(let s of r.cNodes){let a=r.startPos+s.cGroupOffset.x;!t.isLocked(r,t.direction)||s.hitbox.x<a?s.startPos=a:s.startPos=s.hitbox.x}i-=r.reference.startPos,r.delta+=i,t.direction===R.RIGHT||t.direction===R.DOWN?r.deltaNormalized+=i:r.deltaNormalized-=i;for(let s of r.cNodes)for(let a of s.constraints){let l;t.direction.isHorizontal()?l=t.spacingsHandler.getHorizontalSpacing(s,a):l=t.spacingsHandler.getVerticalSpacing(s,a),a.cGroup.startPos=Math.max(a.cGroup.startPos,s.startPos+s.hitbox.width+l-a.cGroupOffset.x),t.isLocked(a,t.direction)&&(a.cGroup.startPos=Math.max(a.cGroup.startPos,a.hitbox.x-a.cGroupOffset.x)),a.cGroup.outDegree--,a.cGroup.outDegree===0&&o.push(a.cGroup)}}for(let r of t.cGraph.cNodes)r.hitbox.x=r.startPos}};var ae=class{};ae.TOLERANCE=1e-4;function od(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}ae.eq=(n,t)=>Math.abs(n-t)<=ae.TOLERANCE;ae.gt=(n,t)=>od(n,t,ae.TOLERANCE)>0;ae.lt=(n,t)=>od(n,t,ae.TOLERANCE)<0;ae.ge=(n,t)=>od(n,t,ae.TOLERANCE)>=0;ae.le=(n,t)=>od(n,t,ae.TOLERANCE)<=0;var rd=class{constructor(t,e){this.node=t,this.low=e}},A_=class n{constructor(){this._items=[]}static _key(t){return t.hitbox.x+t.hitbox.width/2}add(t){let e=n._key(t);for(let o=0;o<this._items.length;o++){let r=n._key(this._items[o]);if(r===e)return!1;if(r>e)return this._items.splice(o,0,t),!0}return this._items.push(t),!0}lower(t){let e=n._key(t),o=null;for(let r of this._items)if(n._key(r)<e)o=r;else break;return o}floor(t){let e=n._key(t),o=null;for(let r of this._items)if(n._key(r)<=e)o=r;else break;return o}higher(t){let e=n._key(t);for(let o of this._items)if(n._key(o)>e)return o;return null}ceiling(t){let e=n._key(t);for(let o of this._items)if(n._key(o)>=e)return o;return null}remove(t){let e=this._items.indexOf(t);return e>=0?(this._items.splice(e,1),!0):!1}clear(){this._items.length=0}},Xn=class n{constructor(){this.compactor=null,this._scanlineHandler=new C_(this)}calculateConstraints(t){this.compactor=t,this._sweep(()=>!0)}_sweep(t){let e=[];for(let o of this.compactor.cGraph.cNodes)t(o)&&(e.push(new rd(o,!0)),e.push(new rd(o,!1)));this._scanlineHandler.reset(),Zo.execute(e,n._compareTimestamps,this._scanlineHandler)}static _compareTimestamps(t,e){let o=t.node.hitbox.y;t.low||(o+=t.node.hitbox.height);let r=e.node.hitbox.y;e.low||(r+=e.node.hitbox.height);let i=o-r;if(i===0){if(!t.low&&e.low)return-1;if(!e.low&&t.low)return 1}return i}},C_=class{constructor(t){this._owner=t,this._intervals=new A_,this._cand=[]}reset(){this._intervals.clear();let t=this._owner.compactor.cGraph.cNodes;this._cand=new Array(t.length).fill(null);let e=0;for(let o of t)o.id=e++}handle(t){t.low?this._insert(t):this._delete(t)}_insert(t){if(!this._intervals.add(t.node))throw new Error("Invalid hitboxes for scanline constraint calculation.");this._overlap(t.node,this._intervals.floor(t.node))||this._overlap(t.node,this._intervals.ceiling(t.node)),this._cand[t.node.id]=this._intervals.lower(t.node);let o=this._intervals.higher(t.node);o!=null&&(this._cand[o.id]=t.node)}_delete(t){let e=this._intervals.lower(t.node);e!=null&&e===this._cand[t.node.id]&&e.cGroup!=null&&e.cGroup!==t.node.cGroup&&e.constraints.push(t.node);let o=this._intervals.higher(t.node);o!=null&&this._cand[o.id]===t.node&&o.cGroup!=null&&o.cGroup!==t.node.cGroup&&t.node.constraints.push(o),this._intervals.remove(t.node)}_overlap(t,e){return t==null||e==null||t===e?!1:ae.le(t.hitbox.x,e.hitbox.x+e.hitbox.width)&&ae.le(e.hitbox.x,t.hitbox.x+t.hitbox.width)}};var id=class{calculateConstraints(t){for(let e of t.cGraph.cNodes)e.constraints.length=0;for(let e of t.cGraph.cNodes)for(let o of t.cGraph.cNodes){if(e===o||e.cGroup!=null&&e.cGroup===o.cGroup)continue;let r;t.direction.isHorizontal()?r=t.spacingsHandler.getVerticalSpacing(e,o):r=t.spacingsHandler.getHorizontalSpacing(e,o),(o.hitbox.x>e.hitbox.x||e.hitbox.x===o.hitbox.x&&e.hitbox.width<o.hitbox.width)&&ae.gt(o.hitbox.y+o.hitbox.height+r,e.hitbox.y)&&ae.lt(o.hitbox.y,e.hitbox.y+e.hitbox.height+r)&&e.constraints.push(o)}}};var x_=Object.freeze({getHorizontalSpacing:()=>0,getVerticalSpacing:()=>0}),Vq=Object.freeze({DEFAULT_SPACING_HANDLER:x_});var Br=class n{constructor(t){this.cGraph=t,this.compactionAlgorithm=n.LONGEST_PATH_COMPACTION,this.constraintAlgorithm=n.SCANLINE_CONSTRAINTS,this.lockFun=null,this.spacingsHandler=x_,this.direction=R.UNDEFINED,this._finished=!1,this.calculateGroupOffsets();for(let e of t.cNodes)e.cGroup==null&&tr.of().nodes(e).create(t),e.hitboxPreCompaction=new dt(e.hitbox)}setSpacingsHandler(t){return this.spacingsHandler=t,this}setCompactionAlgorithm(t){return this.compactionAlgorithm=t,this}setConstraintAlgorithm(t){return this.constraintAlgorithm=t,this}compact(){if(this._finished)throw new Error("The OneDimensionalCompactor instance has been finished already.");this.direction===R.UNDEFINED&&this.changeDirection(R.LEFT);for(let t of this.cGraph.cGroups)t.outDegree=t.outDegreeReal;for(let t of this.cGraph.cNodes)t.startPos=Number.NEGATIVE_INFINITY;return this.compactionAlgorithm.compact(this),this}finish(){return this.changeDirection(R.LEFT),this._finished=!0,this}changeDirection(t){if(this._finished)throw new Error("The OneDimensionalCompactor instance has been finished already.");if(!this.cGraph.supports(t))throw new Error(`The direction ${t} is not supported by the CGraph instance.`);if(t===this.direction)return this;let e=this.direction;switch(this.direction=t,e){case R.UNDEFINED:switch(t){case R.LEFT:this._calculateConstraints();break;case R.RIGHT:this._mirrorHitboxes(),this._calculateConstraints();break;case R.UP:this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.LEFT:switch(t){case R.RIGHT:this._mirrorHitboxes(),this._reverseConstraints();break;case R.UP:this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.RIGHT:switch(t){case R.LEFT:this._mirrorHitboxes(),this._reverseConstraints();break;case R.UP:this._mirrorHitboxes(),this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._mirrorHitboxes(),this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.UP:switch(t){case R.LEFT:this._transposeHitboxes(),this._calculateConstraints();break;case R.RIGHT:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break;case R.DOWN:this._mirrorHitboxes(),this._reverseConstraints();break}break;case R.DOWN:switch(t){case R.LEFT:this._mirrorHitboxes(),this._transposeHitboxes(),this._calculateConstraints();break;case R.RIGHT:this._mirrorHitboxes(),this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break;case R.UP:this._mirrorHitboxes(),this._reverseConstraints();break}break}return this}isLocked(t,e){if(t.cNodes!=null){for(let o of t.cNodes)if(this.isLocked(o,e))return!0;return!1}return this.lockFun!=null?this.lockFun.isLocked(t,e):!1}setLockFunction(t){return this.lockFun=t,this}forceConstraintsRecalculation(){return this._calculateConstraints(),this}calculateGroupOffsets(){for(let t of this.cGraph.cGroups){t.reference=null;for(let e of t.cNodes)e.cGroupOffset.reset(),(t.reference==null||e.hitbox.x<t.reference.hitbox.x)&&(t.reference=e);for(let e of t.cNodes)e.cGroupOffset.x=e.hitbox.x-t.reference.hitbox.x,e.cGroupOffset.y=e.hitbox.y-t.reference.hitbox.y}return this}_mirrorHitboxes(){for(let t of this.cGraph.cNodes)t.hitbox.x=-t.hitbox.x-t.hitbox.width;this.calculateGroupOffsets()}_transposeHitboxes(){for(let t of this.cGraph.cNodes){let e=t.hitbox.x;t.hitbox.x=t.hitbox.y,t.hitbox.y=e,e=t.hitbox.width,t.hitbox.width=t.hitbox.height,t.hitbox.height=e,e=t.cGroupOffset.x,t.cGroupOffset.x=t.cGroupOffset.y,t.cGroupOffset.y=e}this.calculateGroupOffsets()}_calculateConstraints(){for(let e of this.cGraph.cNodes)e.constraints.length=0;let t=this.direction.isHorizontal()?this.cGraph.predefinedHorizontalConstraints:this.cGraph.predefinedVerticalConstraints;for(let e of t)this.direction===R.LEFT||this.direction===R.UP?e.getFirst().constraints.push(e.getSecond()):e.getSecond().constraints.push(e.getFirst());this.constraintAlgorithm.calculateConstraints(this),this._calculateConstraintsForCGroups()}_calculateConstraintsForCGroups(){for(let t of this.cGraph.cGroups)t.outDegree=0,t.outDegreeReal=0,t.incomingConstraints.clear();for(let t of this.cGraph.cGroups)for(let e of t.cNodes)for(let o of e.constraints)o.cGroup!==t&&(t.incomingConstraints.add(o),o.cGroup.outDegree++,o.cGroup.outDegreeReal++)}_reverseConstraints(){let t=new Map;for(let e of this.cGraph.cNodes)t.set(e,[]);for(let e of this.cGraph.cNodes){e.startPos=Number.NEGATIVE_INFINITY;for(let o of e.constraints)t.get(o).push(e)}for(let e of this.cGraph.cNodes)e.constraints=t.get(e);this._calculateConstraintsForCGroups()}};Br.LONGEST_PATH_COMPACTION=new ed;Br.SCANLINE_CONSTRAINTS=new Xn;Br.QUADRATIC_CONSTRAINTS=new id;var Ur=class{constructor(t){this.name=t}toString(){return this.name}};Ur.QUADRATIC=new Ur("QUADRATIC");Ur.SCANLINE=new Ur("SCANLINE");var ai=class{constructor(t=!1,e=!1,o=!1,r=!1){this.left=t,this.right=e,this.up=o,this.down=r}set(t,e,o,r){this.left=t,this.right=e,this.up=o,this.down=r}applyOr(t){this.left=this.left||t.left,this.right=this.right||t.right,this.up=this.up||t.up,this.down=this.down||t.down}setDirection(t,e){switch(e){case R.LEFT:this.left=t;break;case R.RIGHT:this.right=t;break;case R.UP:this.up=t;break;case R.DOWN:this.down=t;break}}getDirection(t){switch(t){case R.LEFT:return this.left;case R.RIGHT:return this.right;case R.UP:return this.up;case R.DOWN:return this.down;default:return!1}}};var we=class{constructor(t,e,o,r){this.potentialGroupParents=[],this.representedLEdges=[],this.affectedBends=[],this.affectedBoundingBoxes=[],this.hitbox=new dt,this.junctionPoints=new st,this.ignoreSpacing=new ai,this.constraints=[],this.aPort=null,this.joined=[],this.affectedBends.push(t),this.affectedBends.push(e),this.hitbox.x=Math.min(t.x,e.x),this.hitbox.y=Math.min(t.y,e.y),this.hitbox.width=Math.abs(t.x-e.x),this.hitbox.height=Math.abs(t.y-e.y);let i=r.getProperty(_.JUNCTION_POINTS);if(i!=null)for(let s of i)ae.eq(s.x,t.x)&&this.junctionPoints.add(s);o!=null&&this.potentialGroupParents.push(o),this.representedLEdges.push(r)}joinWith(t){for(let l of t.representedLEdges)this.representedLEdges.push(l);for(let l of t.affectedBends)this.affectedBends.push(l);for(let l of t.affectedBoundingBoxes)this.affectedBoundingBoxes.push(l);for(let l of t.junctionPoints)this.junctionPoints.add(l);for(let l of t.constraints)this.constraints.push(l);for(let l of t.potentialGroupParents)this.potentialGroupParents.push(l);let e=Math.min(this.hitbox.x,t.hitbox.x),o=Math.min(this.hitbox.y,t.hitbox.y),i=Math.max(this.hitbox.x+this.hitbox.width,t.hitbox.x+t.hitbox.width)-e,a=Math.max(this.hitbox.y+this.hitbox.height,t.hitbox.y+t.hitbox.height)-o;this.hitbox.x=e,this.hitbox.y=o,this.hitbox.width=i,this.hitbox.height=a,this.ignoreSpacing.applyOr(t.ignoreSpacing),this.aPort==null&&(this.aPort=t.aPort);for(let l of t.joined)this.joined.push(l);return this.joined.push(t),this}intersects(t){return ae.eq(this.hitbox.x,t.hitbox.x)&&!(ae.lt(this.hitbox.y+this.hitbox.height,t.hitbox.y)||ae.lt(t.hitbox.y+t.hitbox.height,this.hitbox.y))}compareTo(t){let e=ae.TOLERANCE,o=this.hitbox.x-t.hitbox.x;return Math.abs(o)<=e?this.hitbox.y-t.hitbox.y:o}toString(){return`VerticalSegment ${this.hitbox} ${this.representedLEdges.join(", ")}`}};var sd=.5,Kn=.01,nd=class extends Xn{constructor(t){super(),this._verticalEdgeEdgeSpacing=t.getProperty(_.SPACING_EDGE_EDGE),this._edgeRouting=t.getProperty(_.EDGE_ROUTING)}calculateConstraints(t){switch(this.compactor=t,this._edgeRouting){case At.ORTHOGONAL:this._calculateForOrthogonal();break;case At.SPLINES:this._calculateForSpline();break;default:throw new Error("Unsupported edge routing: "+this._edgeRouting)}}_calculateForSpline(){let t=[];this._sweep(o=>o.origin instanceof we);let e=this._computeMinSpacing();for(let o of this.compactor.cGraph.cNodes)o.origin instanceof ft&&(this._alterHitbox(o,e,1),t.push(()=>this._alterHitbox(o,e,-1)));this._sweep(()=>!0);for(let o of t)o();t.length=0}_calculateForOrthogonal(){let t=[];for(let o of this.compactor.cGraph.cNodes)if(o.origin instanceof we){let r=Math.max(0,this._verticalEdgeEdgeSpacing/2-sd);this._alterHitbox(o,r,1),t.push(()=>this._alterHitbox(o,r,-1))}this._sweep(o=>o.origin instanceof we);for(let o of t)o();t.length=0;for(let o of this.compactor.cGraph.cNodes)if(o.origin instanceof ft){let r=ke.getLNodeOrNull(o),i=oo.getIndividualOrDefault(r,_.SPACING_EDGE_EDGE),s=Math.max(0,i/2-sd);this._alterHitbox(o,s,1),t.push(()=>this._alterHitbox(o,s,-1))}this._sweep(o=>o.origin instanceof ft);for(let o of t)o();t.length=0;let e=this._computeMinSpacing();for(let o of this.compactor.cGraph.cGroups)this._alterGroupedHitboxOrthogonal(o,e,1),t.push(()=>this._alterGroupedHitboxOrthogonal(o,e,-1));this._sweep(()=>!0);for(let o of t)o();t.length=0}_computeMinSpacing(){let t=Number.POSITIVE_INFINITY;for(let e of this.compactor.cGraph.cNodes){let o;if(e.origin instanceof ft&&e.origin.getType()===y.EXTERNAL_PORT)o=Number.POSITIVE_INFINITY;else if(ke.getVerticalSegmentOrNull(e)!=null)o=Math.max(0,this._verticalEdgeEdgeSpacing/2-sd);else{let i=ke.getLNodeOrNull(e);if(i!=null){let s=oo.getIndividualOrDefault(i,_.SPACING_NODE_NODE);o=Math.max(0,s/2-sd)}else o=Number.POSITIVE_INFINITY}o<t&&(t=o)}return Number.isFinite(t)?t:0}_alterGroupedHitboxOrthogonal(t,e,o){let r=t.master;if(r==null&&(r=t.cNodes.values().next().value),this._alterHitbox(r,e,o),t.cNodes.size===1)return;let i=e*o;for(let s of t.cNodes){if(s===r)continue;let a=ke.getVerticalSegmentOrNull(s);a!=null&&(a.ignoreSpacing.up?(s.hitbox.y+=i+Kn,s.hitbox.height-=i+Kn):a.ignoreSpacing.down&&(s.hitbox.height-=i+Kn))}}_alterHitbox(t,e,o){let r=e*o;if(t.origin instanceof we){let i=ke.getVerticalSegmentOrNull(t);i.ignoreSpacing.up?i.ignoreSpacing.down||(t.hitbox.height+=r+Kn):(t.hitbox.y-=r+Kn,t.hitbox.height+=r+Kn)}else t.origin instanceof ft&&(t.hitbox.y-=r,t.hitbox.height+=2*r)}};var Zn=class{constructor(t){this.cNodes=[],this.cGroups=[],this.predefinedHorizontalConstraints=[],this.predefinedVerticalConstraints=[],this._supportedDirections=t}supports(t){return this._supportedDirections.has(t)}};var ki=class{constructor(){this.id=0,this.origin=null,this.type=null,this.toStringDelegate=null,this.cGroup=null,this.cGroupOffset=new O,this.hitboxPreCompaction=null,this.hitbox=null,this.constraints=[],this.startPos=Number.NEGATIVE_INFINITY,this.lock=new ai}static of(){return new D_}getDebugSVG(){let t=this.hitbox.x,e=this.hitbox.y,o=Math.max(1,this.hitbox.width),r=Math.max(1,this.hitbox.height);return`<rect x="${t}" y="${e}" width="${o}" height="${r}" fill="green" stroke="black" opacity="0.5"/><text x="${t+2}" y="${e+8+2+1}">(${Math.round(t)}, ${Math.round(e)})
+${this}</text>`}toString(){return this.toStringDelegate!=null?this.toStringDelegate(this):`CNode[id=${this.id}]`}},D_=class{constructor(){this.node=new ki,this.groupParent=null}id(t){return this.node.id=t,this}origin(t){return this.node.origin=t,this}type(t){return this.node.type=t,this}hitbox(t){return this.node.hitbox=t,this}toStringDelegate(t){return this.node.toStringDelegate=t,this}groupWith(t){return this.groupParent=t,this}create(t){return t.cNodes.push(this.node),this.groupParent!=null&&(this.groupParent.cGroup==null?tr.of().nodes(this.groupParent,this.node).create(t):this.groupParent.cGroup.addCNode(this.node)),this.node}};var ad=class{constructor(){this._cGraph=null,this._layeredGraph=null,this._edgeRouting=null,this._commentOffsets=new Map,this._nodesMap=new Map,this._verticalSegmentsMap=new Map,this._lockMap=new Map}transform(t){return this._layeredGraph=t,this._edgeRouting=this._layeredGraph.getProperty(_.EDGE_ROUTING),this._init(),this._transformNodes(),this._transformEdges(),this._cGraph}getLockMap(){return this._lockMap}_init(){let t=!1,e=0;for(let r of this._layeredGraph){r.id=e++;for(let i of r)if(!t)for(let s of i.getConnectedEdges()){t=!0;break}}let o=new Set([R.UNDEFINED,R.LEFT,R.RIGHT]);t||(o.add(R.UP),o.add(R.DOWN)),this._cGraph=new Zn(o),this._nodesMap.clear(),this._commentOffsets.clear(),this._lockMap.clear(),this._verticalSegmentsMap.clear()}_transformNodes(){for(let t of this._layeredGraph)for(let e of t){if(e.getProperty(_.COMMENT_BOX)){let c=[...e.getConnectedEdges()];if(c.length>0){let g=c[0],h=g.getSource().getNode();h===e&&(h=g.getTarget().getNode());let d=new O(e.getPosition().x-h.getPosition().x,e.getPosition().y-h.getPosition().y);this._commentOffsets.set(e,{other:h,offset:d});continue}}let o=new dt(e.getPosition().x-e.getMargin().left,e.getPosition().y-e.getMargin().top,e.getSize().x+e.getMargin().left+e.getMargin().right,e.getSize().y+e.getMargin().top+e.getMargin().bottom),r=ki.of().origin(e).hitbox(o).toStringDelegate(nI).create(this._cGraph);tr.of().nodes(r).master(r).create(this._cGraph);let i=new ai;this._lockMap.set(r,i);let s=0;for(let c of e.getIncomingEdges())s++;let a=0;for(let c of e.getOutgoingEdges())a++;let l=s-a;l<0?i.setDirection(!0,R.LEFT):l>0&&i.setDirection(!0,R.RIGHT),e.getType()===y.EXTERNAL_PORT&&i.set(!1,!1,!1,!1),this._nodesMap.set(e,r)}}_transformEdges(){let t=this._layeredGraph.getProperty(_.EDGE_ROUTING),e;switch(t){case At.ORTHOGONAL:e=this._collectVerticalSegmentsOrthogonal();break;case At.SPLINES:e=this._collectVerticalSegmentsSplines();break;default:throw new Error("Compaction not supported for "+t+" edges.")}this._mergeVerticalSegments(e);for(let o of this._verticalSegmentsMap.keys()){let r=this._verticalSegmentsMap.get(o);for(let i of o.constraints){let s=this._verticalSegmentsMap.get(i);this._cGraph.predefinedHorizontalConstraints.push([r,s])}}}_collectVerticalSegmentsOrthogonal(){let t=[];for(let e of this._layeredGraph)for(let o of e){let r=this._nodesMap.get(o);if(r!=null){for(let i of o.getOutgoingEdges()){let s=[...i.getBendPoints()];if(s.length===0)continue;let a=s[0],l=null,c=!0;if(i.getSource().getSide()===u.NORTH){let g=new we(a,new O(a.x,r.hitbox.y),r,i);g.ignoreSpacing.down=!0,g.aPort=i.getSource(),t.push(g)}if(i.getSource().getSide()===u.SOUTH){let g=new we(a,new O(a.x,r.hitbox.y+r.hitbox.height),r,i);g.ignoreSpacing.up=!0,g.aPort=i.getSource(),t.push(g)}for(let g=1;g<s.length;g++){let h=s[g];ae.eq(a.y,h.y)||(l=new we(a,h,null,i),t.push(l),c&&(c=!1,h.y<r.hitbox.y?l.ignoreSpacing.down=!0:h.y>r.hitbox.y+r.hitbox.height?l.ignoreSpacing.up=!0:(l.ignoreSpacing.up=!0,l.ignoreSpacing.down=!0))),g+1<s.length&&(a=h)}if(l!=null){let g=this._nodesMap.get(i.getTarget().getNode()),h=s[s.length-2];g!=null&&(h.y<g.hitbox.y?l.ignoreSpacing.down=!0:h.y>g.hitbox.y+g.hitbox.height?l.ignoreSpacing.up=!0:(l.ignoreSpacing.up=!0,l.ignoreSpacing.down=!0))}}for(let i of o.getIncomingEdges()){let s=i.getBendPoints();if(s.length===0)continue;let a=s[s.length-1];if(i.getTarget().getSide()===u.NORTH){let l=new we(a,new O(a.x,r.hitbox.y),r,i);l.ignoreSpacing.down=!0,l.aPort=i.getTarget(),t.push(l)}if(i.getTarget().getSide()===u.SOUTH){let l=new we(a,new O(a.x,r.hitbox.y+r.hitbox.height),r,i);l.ignoreSpacing.up=!0,l.aPort=i.getTarget(),t.push(l)}}}}return t}_collectVerticalSegmentsSplines(){let t=[];for(let e of this._layeredGraph.getLayers())for(let o of e.getNodes())for(let r of o.getOutgoingEdges()){let i=r.getProperty(p.SPLINE_ROUTE_START);if(i==null)continue;let s=null;for(let a of i){if(a.isStraight)continue;let l=a.boundingBox.getTopLeft(),c=a.boundingBox.getBottomRight(),g=new we(l,c,null,a.edges.values().next().value);g.affectedBoundingBoxes.push(a.boundingBox),t.push(g),s!=null&&s.constraints.push(g),s=g}}return t}_mergeVerticalSegments(t){if(t.length===0)return;t.sort((o,r)=>o.compareTo(r));let e=t[0];for(let o=1;o<t.length;o++){let r=t[o];e.intersects(r)?e=e.joinWith(r):(this._verticalSegmentToCNode(e),e=r)}this._verticalSegmentToCNode(e)}_verticalSegmentToCNode(t){let e=ki.of().origin(t).type("vs").hitbox(new dt(t.hitbox)).toStringDelegate(aI).create(this._cGraph);t.potentialGroupParents.length>0&&t.potentialGroupParents[0].cGroup.addCNode(e);let o=new ai;this._lockMap.set(e,o);let r=new Set,i=new Set;for(let a of t.representedLEdges)r.add(a.getSource()),i.add(a.getTarget());let s=r.size-i.size;s<0?(o.setDirection(!0,R.LEFT),o.setDirection(!1,R.RIGHT)):s>0&&(o.setDirection(!1,R.LEFT),o.setDirection(!0,R.RIGHT));for(let a of t.joined)this._verticalSegmentsMap.set(a,e);this._verticalSegmentsMap.set(t,e)}applyLayout(){for(let o of this._cGraph.cNodes)if(o.origin instanceof ft){let r=o.origin;r.getPosition().x=o.hitbox.x+r.getMargin().left}this._applyCommentPositions();for(let o of this._cGraph.cNodes)if(o.origin instanceof we){let r=o.hitbox.x-o.hitboxPreCompaction.x,i=o.origin;for(let s of i.affectedBends)s.x+=r;for(let s of i.affectedBoundingBoxes)s.x+=r;for(let s of i.junctionPoints)s.x+=r}for(let o of this._nodesMap.keys())for(let r of o.getOutgoingEdges()){if(!r.isSelfLoop())continue;let i=r.getSource().getNode(),s=this._nodesMap.get(i),a=s.hitbox.x-s.hitboxPreCompaction.x;for(let l of r.getBendPoints())l.x+=a;for(let l of r.getLabels())l.getPosition().x+=a}if(this._layeredGraph.getProperty(_.EDGE_ROUTING)===At.SPLINES)for(let o of this._layeredGraph.getLayers())for(let r of o.getNodes())for(let i of r.getOutgoingEdges()){let s=i.getProperty(p.SPLINE_ROUTE_START);s!=null&&s.length>0&&this._adjustSplineControlPoints(s)}let t=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),e=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let o of this._cGraph.cNodes)t.x=Math.min(t.x,o.hitbox.x),t.y=Math.min(t.y,o.hitbox.y),e.x=Math.max(e.x,o.hitbox.x+o.hitbox.width),e.y=Math.max(e.y,o.hitbox.y+o.hitbox.height);this._layeredGraph.getOffset().reset().add(-t.x,-t.y),this._layeredGraph.getSize().reset().add(e.x-t.x,e.y-t.y),this._applyExternalPortPositions(t,e),this._cleanup()}_applyCommentPositions(){for(let[t,e]of this._commentOffsets){let o=e.other,r=e.offset;t.getPosition().reset().add(o.getPosition().x+r.x,o.getPosition().y+r.y)}}_applyExternalPortPositions(t,e){for(let o of this._cGraph.cNodes){let r=o.origin instanceof ft?o.origin:null;if(!(r==null||r.getType()!==y.EXTERNAL_PORT))switch(r.getProperty(p.EXT_PORT_SIDE)){case u.WEST:r.getPosition().x=t.x;break;case u.EAST:r.getPosition().x=e.x-(r.getSize().x+r.getMargin().right);break;case u.NORTH:r.getPosition().y=t.y;break;case u.SOUTH:r.getPosition().y=e.y-(r.getSize().y+r.getMargin().bottom);break;default:break}}}_adjustSplineControlPoints(t){if(t.length===0)return;let e=t[0];if(t.length===1){this._adjustControlPointBetweenSegments(e,e,1,0,t);return}let o=1;for(;o<t.length;)if(e.initialSegment||!e.isStraight){let r=this._firstNonStraightSegment(t,o);if(r!=null){let i=r[0],s=r[1];this._adjustControlPointBetweenSegments(e,s,o,i,t),o=i+1,e=s}else break}else o++}_firstNonStraightSegment(t,e){if(e<0||e>=t.length)return null;for(let o=e;o<t.length;o++){let r=t[o];if(o===t.length-1||!r.isStraight)return[o,r]}return null}_adjustControlPointBetweenSegments(t,e,o,r,i){let s,a=o;if(t.initialSegment&&t.isStraight){let E=this._nodesMap.get(t.sourceNode);s=E.hitbox.x+E.hitbox.width,a--}else s=t.boundingBox.x+t.boundingBox.width;let l,c=r;e.lastSegment&&e.isStraight?(l=this._nodesMap.get(e.targetNode).hitbox.x,c++):l=e.boundingBox.x;let g=l-s,h=Math.max(2,c-a),d=g/h,f=s+d;for(let E=a;E<c;E++){let P=i[E],S=P.boundingBox.width;P.boundingBox.x=f-S/2,f+=d}}_cleanup(){this._nodesMap.clear(),this._commentOffsets.clear(),this._verticalSegmentsMap.clear(),this._lockMap.clear(),this._cGraph.cGroups.length=0,this._cGraph.cNodes.length=0,this._cGraph=null,this._layeredGraph=null}},nI=n=>{let t=n.origin,e=t&&t.getProperty?t.getProperty(p.ORIGIN):null;return e!=null?String(e):String(t)},aI=n=>String(n.origin);var ee=class{constructor(){this.id=0,this.internalId=0,this.origin=null,this.source=null,this.target=null,this.weight=0,this.delta=1,this.treeEdge=!1}static of(t){return new w_}getSource(){return this.source}getTarget(){return this.target}getOther(t){if(t===this.source)return this.target;if(t===this.target)return this.source;throw new Error(`Node ${t} not part of edge ${this}`)}reverse(){let t=this.source;return this.source=this.target,this.target=t,yP(this.target.getOutgoingEdges(),this),this.target.getIncomingEdges().push(this),yP(this.source.getIncomingEdges(),this),this.source.getOutgoingEdges().push(this),this}toString(){return`NEdge[id=${this.id} w=${this.weight} d=${this.delta}]`}};function yP(n,t){let e=n.indexOf(t);e>=0&&n.splice(e,1)}var w_=class{constructor(){this.edge=new ee}id(t){return this.edge.id=t,this}origin(t){return this.edge.origin=t,this}weight(t){return this.edge.weight=t,this}delta(t){return this.edge.delta=t,this}source(t){return this.edge.source=t,this}target(t){return this.edge.target=t,this}create(){if(this.edge.source==null||this.edge.target==null)throw new Error("NEdge must have a source and target NNode specified.");if(this.edge.source===this.edge.target)throw new Error(`Network simplex does not support self-loops: ${this.edge} ${this.edge.source} ${this.edge.target}`);return this.edge.source.getOutgoingEdges().push(this.edge),this.edge.target.getIncomingEdges().push(this.edge),this.edge}};var He=class{constructor(){this.id=0,this.internalId=0,this.origin=null,this.type="",this.layer=0,this.treeNode=!1,this.unknownCutvalues=[],this._outgoingEdges=new ld,this._incomingEdges=new ld,this._outgoingEdgesModCnt=-1,this._incomingEdgesModCnt=-1,this._allEdges=[]}static of(){return new M_}getOutgoingEdges(){return this._outgoingEdges}getIncomingEdges(){return this._incomingEdges}getConnectedEdges(){if(this._incomingEdgesModCnt!==this._incomingEdges.getModCnt()||this._outgoingEdgesModCnt!==this._outgoingEdges.getModCnt()){this._allEdges=[];for(let t of this._incomingEdges)this._allEdges.push(t);for(let t of this._outgoingEdges)this._allEdges.push(t);this._incomingEdgesModCnt=this._incomingEdges.getModCnt(),this._outgoingEdgesModCnt=this._outgoingEdges.getModCnt()}return this._allEdges}toString(){return`NNode[id=${this.id} layer=${this.layer}]`}},M_=class{constructor(){this.node=new He}id(t){return this.node.id=t,this}origin(t){return this.node.origin=t,this}type(t){return this.node.type=t,this}create(t){return t.nodes.push(this.node),this.node}},ld=class extends Array{constructor(){super(),this._modCount=0}getModCnt(){return this._modCount}push(...t){return this._modCount++,super.push(...t)}pop(){return this._modCount++,super.pop()}shift(){return this._modCount++,super.shift()}unshift(...t){return this._modCount++,super.unshift(...t)}splice(t,e,...o){return this._modCount++,super.splice(t,e,...o)}clear(){this._modCount++,this.length=0}};var Wi=class{constructor(){this.nodes=[]}makeConnected(){let t=0;for(let o of this.nodes)o.internalId=t++;let e=this._findConCompRepresentatives();return e.length>1?this._createArtificialRootAndConnect(e):null}_createArtificialRootAndConnect(t){let e=He.of().create(this);for(let o of t)ee.of().delta(0).weight(0).source(e).target(o).create();return e}_findConCompRepresentatives(){let t=[],e=new Array(this.nodes.length).fill(!1);for(let o of this.nodes)e[o.internalId]||(t.push(o),this._dfs(o,e));return t}_dfs(t,e){if(!e[t.internalId]){e[t.internalId]=!0;for(let o of t.getConnectedEdges()){let r=o.getOther(t);this._dfs(r,e)}}}isAcyclic(){let t=0;for(let i of this.nodes)i.internalId=t++;let e=new Array(this.nodes.length).fill(0),o=new Array(this.nodes.length).fill(0);for(let i of this.nodes)e[i.internalId]+=i.getIncomingEdges().length;let r=[];for(let i of this.nodes)i.getIncomingEdges().length===0&&r.push(i);if(r.length===0&&this.nodes.length>0)return!1;for(;r.length>0;){let i=r.shift();for(let s of i.getOutgoingEdges()){let a=s.getTarget();o[a.internalId]=Math.max(o[a.internalId],o[i.internalId]+1),e[a.internalId]--,e[a.internalId]===0&&r.push(a)}}for(let i of this.nodes)for(let s of i.getOutgoingEdges())if(o[s.target.internalId]<=o[s.source.internalId])return!1;return!0}};var lI=40,cI=-1e-10,li=class n{constructor(){this._previousLayeringNodeCounts=null,this._balance=!1,this._iterationLimit=Number.MAX_SAFE_INTEGER,this.graph=null,this._edges=null,this._treeEdges=null,this._sources=null,this._edgeVisited=null,this._postOrder=1,this._poID=null,this._lowestPoID=null,this._cutvalue=null,this._subtreeNodesStack=null}static forGraph(t){let e=new n;return e.graph=t,e}withBalancing(t){return this._balance=t,this}withPreviousLayering(t){return this._previousLayeringNodeCounts=t,this}withIterationLimit(t){return this._iterationLimit=t,this}_initialize(){let t=this.graph.nodes.length;for(let s of this.graph.nodes)s.treeNode=!1;this._poID=new Array(t).fill(0),this._lowestPoID=new Array(t).fill(0),this._sources=[];let e=0,o=[];for(let s of this.graph.nodes){s.internalId=e++,s.getIncomingEdges().length===0&&this._sources.push(s);for(let a of s.getOutgoingEdges())o.push(a)}let r=0;for(let s of o)s.internalId=r++,s.treeEdge=!1;let i=o.length;this._cutvalue==null||this._cutvalue.length<i?(this._cutvalue=new Array(i).fill(0),this._edgeVisited=new Array(i).fill(!1)):this._edgeVisited.fill(!1),this._edges=o,this._treeEdges=new Set,this._postOrder=1}_dispose(){this._cutvalue=null,this._edges=null,this._treeEdges=null,this._edgeVisited=null,this._lowestPoID=null,this._poID=null,this._sources=null,this._subtreeNodesStack=null}execute(t){let e=t||new Ie;if(e.begin("Network simplex",1),this.graph.nodes.length<1){e.done();return}for(let s of this.graph.nodes)s.layer=0;let o=this.graph.nodes.length>=lI;o&&this._removeSubtrees(),this._initialize(),this._feasibleTree();let r=this._leaveEdge(),i=0;for(;r!=null&&i<this._iterationLimit;)this._exchange(r,this._enterEdge(r)),r=this._leaveEdge(),i++;o&&this._reattachSubtrees(),this._balance?this._balanceLayering(this._normalize()):this._normalize(),this._dispose(),e.done()}_removeSubtrees(){this._subtreeNodesStack=[];let t=[];for(let e of this.graph.nodes)e.getConnectedEdges().length===1&&t.push(e);for(;t.length>0;){let e=t.shift();if(e.getConnectedEdges().length===0)continue;let o=e.getConnectedEdges()[0],r=e.getOutgoingEdges().length>0,i=o.getOther(e);al(r?i.getIncomingEdges():i.getOutgoingEdges(),o),i.getConnectedEdges().length===1&&t.push(i),this._subtreeNodesStack.push(new Gt(e,o)),al(this.graph.nodes,e)}}_reattachSubtrees(){for(;this._subtreeNodesStack.length>0;){let t=this._subtreeNodesStack.pop(),e=t.getFirst(),o=t.getSecond(),r=o.getOther(e);o.target===e?(r.getOutgoingEdges().push(o),e.layer=r.layer+o.delta):(r.getIncomingEdges().push(o),e.layer=r.layer-o.delta),this.graph.nodes.push(e)}}_feasibleTree(){if(this._layeringTopologicalNumbering(this._sources),this._edges.length>0){for(this._edgeVisited.fill(!1);this._tightTreeDFS(this.graph.nodes[0])<this.graph.nodes.length;){let t=this._minimalSlack(),e=t.getTarget().layer-t.getSource().layer-t.delta;t.getTarget().treeNode&&(e=-e);for(let o of this.graph.nodes)o.treeNode&&(o.layer+=e);this._edgeVisited.fill(!1)}this._edgeVisited.fill(!1),this._postorderTraversal(this.graph.nodes[0]),this._cutvalues()}}_layeringTopologicalNumbering(t){let e=new Array(this.graph.nodes.length).fill(0);for(let r of this.graph.nodes)e[r.internalId]+=r.getIncomingEdges().length;let o=[...t];for(;o.length>0;){let r=o.shift();for(let i of r.getOutgoingEdges()){let s=i.getTarget();s.layer=Math.max(s.layer,r.layer+i.delta),e[s.internalId]--,e[s.internalId]===0&&o.push(s)}}}_minimalSpan(t){let e=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER;for(let r of t.getConnectedEdges()){let i=r.getTarget().layer-r.getSource().layer;r.getTarget()===t&&i<o?o=i:i<e&&(e=i)}return o===Number.MAX_SAFE_INTEGER&&(o=-1),e===Number.MAX_SAFE_INTEGER&&(e=-1),new Gt(o,e)}_tightTreeDFS(t){let e=1;t.treeNode=!0;for(let o of t.getConnectedEdges())if(!this._edgeVisited[o.internalId]){this._edgeVisited[o.internalId]=!0;let r=o.getOther(t);o.treeEdge?e+=this._tightTreeDFS(r):!r.treeNode&&o.delta===o.getTarget().layer-o.getSource().layer&&(o.treeEdge=!0,this._treeEdges.add(o),e+=this._tightTreeDFS(r))}return e}_minimalSlack(){let t=Number.MAX_SAFE_INTEGER,e=null;for(let o of this._edges)if(o.getSource().treeNode!==o.getTarget().treeNode){let r=o.getTarget().layer-o.getSource().layer-o.delta;r<t&&(t=r,e=o)}return e}_postorderTraversal(t){let e=Number.MAX_SAFE_INTEGER;for(let o of t.getConnectedEdges())o.treeEdge&&!this._edgeVisited[o.internalId]&&(this._edgeVisited[o.internalId]=!0,e=Math.min(e,this._postorderTraversal(o.getOther(t))));return this._poID[t.internalId]=this._postOrder,this._lowestPoID[t.internalId]=Math.min(e,this._postOrder++),this._lowestPoID[t.internalId]}_isInHead(t,e){let o=e.getSource(),r=e.getTarget();return this._lowestPoID[o.internalId]<=this._poID[t.internalId]&&this._poID[t.internalId]<=this._poID[o.internalId]&&this._lowestPoID[r.internalId]<=this._poID[t.internalId]&&this._poID[t.internalId]<=this._poID[r.internalId]?!(this._poID[o.internalId]<this._poID[r.internalId]):this._poID[o.internalId]<this._poID[r.internalId]}_cutvalues(){let t=[];for(let e of this.graph.nodes){let o=0;e.unknownCutvalues.length=0;for(let r of e.getConnectedEdges())r.treeEdge&&(e.unknownCutvalues.push(r),o++);o===1&&t.push(e)}for(let e of t)for(;e.unknownCutvalues.length===1;){let o=e.unknownCutvalues[0];this._cutvalue[o.internalId]=o.weight;let r=o.getSource(),i=o.getTarget();for(let s of e.getConnectedEdges())s!==o&&(s.treeEdge?r===s.getSource()||i===s.getTarget()?this._cutvalue[o.internalId]-=this._cutvalue[s.internalId]-s.weight:this._cutvalue[o.internalId]+=this._cutvalue[s.internalId]-s.weight:e===r?s.getSource()===e?this._cutvalue[o.internalId]+=s.weight:this._cutvalue[o.internalId]-=s.weight:s.getSource()===e?this._cutvalue[o.internalId]-=s.weight:this._cutvalue[o.internalId]+=s.weight);al(r.unknownCutvalues,o),al(i.unknownCutvalues,o),r===e?e=o.getTarget():e=o.getSource()}}_leaveEdge(){for(let t of this._treeEdges)if(t.treeEdge&&this._cutvalue[t.internalId]<cI)return t;return null}_enterEdge(t){if(!t.treeEdge)throw new Error("The input edge is not a tree edge.");let e=null,o=Number.MAX_SAFE_INTEGER;for(let r of this._edges){let i=r.getSource(),s=r.getTarget();if(this._isInHead(i,t)&&!this._isInHead(s,t)){let a=s.layer-i.layer-r.delta;a<o&&(o=a,e=r)}}return e}_exchange(t,e){if(!t.treeEdge)throw new Error("Given leave edge is no tree edge.");if(e.treeEdge)throw new Error("Given enter edge is a tree edge already.");t.treeEdge=!1,this._treeEdges.delete(t),e.treeEdge=!0,this._treeEdges.add(e);let o=e.getTarget().layer-e.getSource().layer-e.delta;this._isInHead(e.getTarget(),t)||(o=-o);for(let r of this.graph.nodes)this._isInHead(r,t)||(r.layer+=o);this._postOrder=1,this._edgeVisited.fill(!1),this._postorderTraversal(this.graph.nodes[0]),this._cutvalues()}_normalize(){let t=Number.MIN_SAFE_INTEGER,e=Number.MAX_SAFE_INTEGER;for(let i of this.graph.nodes)e=Math.min(e,i.layer),t=Math.max(t,i.layer);let o=new Array(t-e+1).fill(0);for(let i of this.graph.nodes)i.layer-=e,o[i.layer]++;let r=0;if(this._previousLayeringNodeCounts!=null){for(let i of this._previousLayeringNodeCounts)if(o[r++]+=i,o.length===r)break}return o}_balanceLayering(t){for(let e of this.graph.nodes)if(e.getIncomingEdges().length===e.getOutgoingEdges().length){let o=e.layer,r=this._minimalSpan(e);for(let i=e.layer-r.getFirst()+1;i<e.layer+r.getSecond();i++)t[i]<t[o]&&(o=i);t[o]<t[e.layer]&&(t[e.layer]--,t[o]++,e.layer=o)}}};function al(n,t){let e=n.indexOf(t);return e>=0?(n.splice(e,1),!0):!1}var b_=1,G_=100,cd=class{constructor(){this.compactor=null,this.networkSimplexGraph=null,this.nNodes=null,this.index=0}compact(t){this.compactor=t,this.networkSimplexGraph=new Wi,this.nNodes=new Array(this.compactor.cGraph.cGroups.length).fill(null),this.index=0;for(let e of this.compactor.cGraph.cGroups){e.id=this.index;let o=He.of().id(this.index).origin(e).create(this.networkSimplexGraph);this.nNodes[this.index]=o,this.index++}this._addSeparationConstraints(),this._addEdgeConstraints(),this._addArtificialSourceNode(),li.forGraph(this.networkSimplexGraph).execute(new Ie);for(let e of this.compactor.cGraph.cNodes)e.hitbox.x=this.nNodes[e.cGroup.id].layer+e.cGroupOffset.x}_addSeparationConstraints(){for(let t of this.compactor.cGraph.cNodes)for(let e of t.constraints){if(t.cGroup===e.cGroup)continue;let o;this.compactor.direction.isHorizontal()?o=this.compactor.spacingsHandler.getHorizontalSpacing(t,e):o=this.compactor.spacingsHandler.getVerticalSpacing(t,e);let r=t.cGroupOffset.x+t.hitbox.width+o-e.cGroupOffset.x;if(r=Math.ceil(r),r=Math.max(0,r),ke.isVerticalSegmentsOfSameEdge(t,e)){let i=He.of().create(this.networkSimplexGraph),s=Math.ceil(e.cGroupOffset.x-t.cGroupOffset.x),a=s-(e.cGroupOffset.x-t.cGroupOffset.x),l=ke.getVerticalSegmentOrNull(t).aPort,c=t;l==null&&(l=ke.getVerticalSegmentOrNull(e).aPort,a=-a,c=e),l!=null&&(c.cGroupOffset.x-=a,l.getPosition().x-=a),ee.of().delta(Math.max(0,s)).weight(b_).source(i).target(this.nNodes[t.cGroup.id]).create(),ee.of().delta(Math.max(0,-s)).weight(b_).source(i).target(this.nNodes[e.cGroup.id]).create()}else{let i=b_;(t.origin instanceof we&&e.origin instanceof ft||e.origin instanceof we&&t.origin instanceof ft)&&(i=2),ee.of().delta(r).weight(i).source(this.nNodes[t.cGroup.id]).target(this.nNodes[e.cGroup.id]).create()}}}_addEdgeConstraints(){let t=new Map,e=new Map;for(let o of this.compactor.cGraph.cNodes){let r=ke.getLNodeOrNull(o);if(r!=null)t.set(r,o);else{let i=ke.getVerticalSegmentOrNull(o);if(i!=null)for(let s of i.representedLEdges){let a=e.get(s);a==null&&(a=new Set,e.set(s,a)),a.add(o)}}}for(let o of this.compactor.cGraph.cNodes){let r=ke.getLNodeOrNull(o);if(r!=null)for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;let s=i.getSource(),a=i.getTarget();if(u.SIDES_NORTH_SOUTH.has(s.getSide())&&u.SIDES_NORTH_SOUTH.has(a.getSide()))continue;let l=t.get(a.getNode());if(l!=null){if(ee.of().delta(0).weight(G_).source(this.nNodes[o.cGroup.id]).target(this.nNodes[l.cGroup.id]).create(),s.getSide()===u.WEST&&rt.OUTPUT_PREDICATE(s)){let c=e.get(i);if(c!=null){for(let g of c)if(g.hitbox.x<o.hitbox.x){let h=this.nNodes[g.cGroup.id],d=this.nNodes[o.cGroup.id];if(h===d)continue;ee.of().delta(1).weight(G_).source(h).target(d).create()}}}if(a.getSide()===u.EAST&&rt.INPUT_PREDICATE(a)){let c=e.get(i);if(c!=null){for(let g of c)if(g.hitbox.x>o.hitbox.x){let h=this.nNodes[o.cGroup.id],d=this.nNodes[g.cGroup.id];if(h===d)continue;ee.of().delta(1).weight(G_).source(h).target(d).create()}}}}}}}_addArtificialSourceNode(){let t=[];for(let e of this.networkSimplexGraph.nodes)e.getIncomingEdges().length===0&&t.push(e);if(t.length>1){let e=He.of().id(this.index++).create(this.networkSimplexGraph);for(let o of t)ee.of().delta(1).weight(0).source(e).target(o).create()}}};var ke=class n{constructor(){this._lGraph=null}process(t,e){let o=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY);if(o==null||o===ie.NONE)return;e.begin("Horizontal Compaction",1),this._lGraph=t;let r=new ad,i=new Br(r.transform(t));switch(i.setSpacingsHandler(this._createSpacingsHandler()),t.getProperty(_.COMPACTION_POST_COMPACTION_CONSTRAINTS)===Ur.SCANLINE?i.setConstraintAlgorithm(new nd(this._lGraph)):i.setConstraintAlgorithm(Br.QUADRATIC_CONSTRAINTS),o){case ie.LEFT:i.compact();break;case ie.RIGHT:i.changeDirection(R.RIGHT).compact();break;case ie.LEFT_RIGHT_CONSTRAINT_LOCKING:i.compact().changeDirection(R.RIGHT).setLockFunction((a,l)=>a.cGroup.outDegreeReal===0).compact();break;case ie.LEFT_RIGHT_CONNECTION_LOCKING:i.compact().changeDirection(R.RIGHT).setLockFunction((a,l)=>r.getLockMap().get(a).getDirection(l)).compact();break;case ie.EDGE_LENGTH:i.setCompactionAlgorithm(n.NETWORK_SIMPLEX_COMPACTION).compact();break;default:break}i.finish(),r.applyLayout(),e.done()}static isVerticalSegmentsOfSameEdge(t,e){let o=n.getVerticalSegmentOrNull(t),r=n.getVerticalSegmentOrNull(e);if(o==null||r==null)return!1;for(let i of o.representedLEdges)if(r.representedLEdges.includes(i))return!0;return!1}static getLNodeOrNull(t){return t.origin instanceof ft?t.origin:null}static getVerticalSegmentOrNull(t){return t.origin instanceof we?t.origin:null}_createSpacingsHandler(){let t=this;return{getHorizontalSpacing(e,o){if(n.isVerticalSegmentsOfSameEdge(e,o))return 0;let r=n.getLNodeOrNull(e),i=n.getLNodeOrNull(o);return r!=null&&r.getType()===y.EXTERNAL_PORT||i!=null&&i.getType()===y.EXTERNAL_PORT?0:t._lGraph.getProperty(p.SPACINGS).getHorizontalSpacing(r!=null?r.getType():y.LONG_EDGE,i!=null?i.getType():y.LONG_EDGE)},getVerticalSpacing(e,o){if(n.isVerticalSegmentsOfSameEdge(e,o))return 1;let r=n.getLNodeOrNull(e),i=n.getLNodeOrNull(o);return t._lGraph.getProperty(p.SPACINGS).getVerticalSpacing(r!=null?r.getType():y.LONG_EDGE,i!=null?i.getType():y.LONG_EDGE)}}}};ke.NETWORK_SIMPLEX_COMPACTION=new cd;var Ds=class{constructor(t){this._maxNum=t,this._binarySums=new Int32Array(t+1),this._numsPerIndex=new Int32Array(t),this._size=0}add(t){this._size++,this._numsPerIndex[t]++;let e=t+1;for(;e<this._binarySums.length;)this._binarySums[e]++,e+=e&-e}rank(t){let e=t,o=0;for(;e>0;)o+=this._binarySums[e],e-=e&-e;return o}size(){return this._size}removeAll(t){let e=this._numsPerIndex[t];if(e===0)return;this._numsPerIndex[t]=0,this._size-=e;let o=t+1;for(;o<this._binarySums.length;)this._binarySums[o]-=e,o+=o&-o}clear(){this._binarySums=new Int32Array(this._maxNum+1),this._numsPerIndex=new Int32Array(this._maxNum),this._size=0}isEmpty(){return this._size===0}};function zi(n,t){switch(t){case u.EAST:case u.NORTH:return n.getPortSideView(t);case u.SOUTH:case u.WEST:return[...n.getPortSideView(t)].reverse();default:return[]}}var gd={inNorthSouthEastWestOrder:zi};var Fr=class{constructor(t){this._portPositions=t,this._indexTree=null,this._ends=[],this._nodeCardinalities=null}countCrossingsBetweenLayers(t,e){let o=this._initPortPositionsCounterClockwise(t,e);return this._indexTree=new Ds(o.length),this._countCrossingsOnPorts(o)}countInLayerCrossingsOnSide(t,e){let o=this.initPortPositionsForInLayerCrossings(t,e);return this._countInLayerCrossingsOnPorts(o)}countNorthSouthPortCrossingsInLayer(t){let e=this._initPositionsForNorthSouthCounting(t);return this._indexTree=new Ds(e.length),this._countNorthSouthCrossingsOnPorts(e)}countCrossingsBetweenPortsInBothOrders(t,e){let o=this._connectedPortsSortedByPosition(t,e),r=this._countCrossingsOnPorts(o);this._indexTree.clear(),this.switchPorts(t,e),o.sort((s,a)=>this._positionOf(s)-this._positionOf(a));let i=this._countCrossingsOnPorts(o);return this._indexTree.clear(),this.switchPorts(e,t),Gt.of(r,i)}countInLayerCrossingsBetweenNodesInBothOrders(t,e,o){let r=this._connectedInLayerPortsSortedByPosition(t,e,o),i=this._countInLayerCrossingsOnPorts(r);this.switchNodes(t,e,o),this._indexTree.clear(),r.sort((a,l)=>this._positionOf(a)-this._positionOf(l));let s=this._countInLayerCrossingsOnPorts(r);return this.switchNodes(e,t,o),this._indexTree.clear(),Gt.of(i,s)}initForCountingBetween(t,e){let o=this._initPortPositionsCounterClockwise(t,e);this._indexTree=new Ds(o.length)}initPortPositionsForInLayerCrossings(t,e){let o=[];return this._initPositions(t,o,e,!0,!0),this._indexTree=new Ds(o.length),o}switchPorts(t,e){let o=this._portPositions[t.id];this._portPositions[t.id]=this._portPositions[e.id],this._portPositions[e.id]=o}switchNodes(t,e,o){for(let r of gd.inNorthSouthEastWestOrder(t,o))this._portPositions[r.id]=this._positionOf(r)+this._nodeCardinalities[e.id];for(let r of gd.inNorthSouthEastWestOrder(e,o))this._portPositions[r.id]=this._positionOf(r)-this._nodeCardinalities[t.id]}_connectedInLayerPortsSortedByPosition(t,e,o){let r=new Set,i=s=>r.add(s);for(let s of[t,e])for(let a of gd.inNorthSouthEastWestOrder(s,o))for(let l of a.getConnectedEdges())l.isSelfLoop()||(i(a),this._isInLayer(l)&&i(this._otherEndOf(l,a)));return[...r].sort((s,a)=>this._positionOf(s)-this._positionOf(a))}_connectedPortsSortedByPosition(t,e){let o=new Set;for(let r of[t,e]){o.add(r);for(let i of r.getConnectedEdges())this._isPortSelfLoop(i)||o.add(this._otherEndOf(i,r))}return[...o].sort((r,i)=>this._positionOf(r)-this._positionOf(i))}_countCrossingsOnPorts(t){let e=0;for(let o of t){this._indexTree.removeAll(this._positionOf(o));for(let r of o.getConnectedEdges()){let i=this._positionOf(this._otherEndOf(r,o));i>this._positionOf(o)&&(e+=this._indexTree.rank(i),this._ends.push(i))}for(;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_countInLayerCrossingsOnPorts(t){let e=0;for(let o of t){this._indexTree.removeAll(this._positionOf(o));let r=0;for(let i of o.getConnectedEdges())if(this._isInLayer(i)){let s=this._positionOf(this._otherEndOf(i,o));s>this._positionOf(o)&&(e+=this._indexTree.rank(s),this._ends.push(s))}else r++;for(e+=this._indexTree.size()*r;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_countNorthSouthCrossingsOnPorts(t){let e=0,o=[];for(let r of t){switch(this._indexTree.removeAll(this._positionOf(r)),o.length=0,r.getNode().getType()){case y.NORMAL:{let i=r.getProperty(p.PORT_DUMMY);if(i!=null)for(let s of i.getPorts())o.push([s,s.getDegree()]);break}case y.LONG_EDGE:{for(let i of r.getNode().getPorts())if(i!==r){o.push([i,i.getDegree()]);break}break}case y.NORTH_SOUTH_PORT:{let i=r.getProperty(p.ORIGIN);i!=null&&o.push([i,r.getDegree()]);break}default:break}for(let[i,s]of o){let a=this._positionOf(i);a>this._positionOf(r)&&(e+=this._indexTree.rank(a)*s,this._ends.push(a))}for(;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_initPositions(t,e,o,r,i){let s=e.length;i&&(this._nodeCardinalities=new Int32Array(t.length));let a=r?0:t.length-1,l=r?1:-1,c=g=>r?g<t.length:g>=0;for(let g=a;c(g);g+=l){let h=t[g],d=this._getPorts(h,o,r);i&&(this._nodeCardinalities[h.id]=d.length);for(let f of d)this._portPositions[f.id]=s++;for(let f of d)e.push(f)}}_initPortPositionsCounterClockwise(t,e){let o=[];return this._initPositions(t,o,u.EAST,!0,!1),this._initPositions(e,o,u.WEST,!1,!1),o}_initPositionsForNorthSouthCounting(t){let e=[],o=[],r=null,i=0;for(let s=0;s<t.length;s++){let a=t[s];switch(this._isLayoutUnitChanged(r,a)&&(i=this._emptyStack(o,e,hd,i)),a.hasProperty(p.IN_LAYER_LAYOUT_UNIT)&&(r=a.getProperty(p.IN_LAYER_LAYOUT_UNIT)),a.getType()){case y.NORMAL:for(let l of this._getNorthSouthPortsWithIncidentEdges(a,u.NORTH))this._portPositions[l.id]=i++,e.push(l);i=this._emptyStack(o,e,hd,i);for(let l of this._getNorthSouthPortsWithIncidentEdges(a,u.SOUTH))this._portPositions[l.id]=i++,e.push(l);break;case y.NORTH_SOUTH_PORT:{let l=a.getPortSideView(gI);if(l.length>0){let c=l[0];this._portPositions[c.id]=i++,e.push(c)}a.getPortSideView(hd).length>0&&o.push(a);break}case y.LONG_EDGE:{for(let l of a.getPortSideView(u.WEST))this._portPositions[l.id]=i++,e.push(l);for(let l of a.getPortSideView(u.EAST))o.push(a);break}default:break}}return this._emptyStack(o,e,hd,i),e}_emptyStack(t,e,o,r){let i=r;for(;t.length>0;){let a=t.pop().getPortSideView(o);if(a.length>0){let l=a[0];this._portPositions[l.id]=i++,e.push(l)}}return i}_getPorts(t,e,o){return e===u.EAST?o?t.getPortSideView(e):[...t.getPortSideView(e)].reverse():o?[...t.getPortSideView(e)].reverse():t.getPortSideView(e)}*_getNorthSouthPortsWithIncidentEdges(t,e){for(let o of t.getPortSideView(e))o.hasProperty(p.PORT_DUMMY)&&(yield o)}_isInLayer(t){return t.getSource().getNode().getLayer()===t.getTarget().getNode().getLayer()}_positionOf(t){return this._portPositions[t.id]}_otherEndOf(t,e){return e===t.getSource()?t.getTarget():t.getSource()}_isPortSelfLoop(t){return t.getSource()===t.getTarget()}_isLayoutUnitChanged(t,e){return t==null||t===e||!e.hasProperty(p.IN_LAYER_LAYOUT_UNIT)?!1:e.getProperty(p.IN_LAYER_LAYOUT_UNIT)!==t}},gI=u.WEST,hd=u.EAST;var dd=class{constructor(t,e,o){this._portPos=o}countCrossings(t,e){let o=this._portPos,r=0;for(let A of t)for(let B of A.getPorts()){let Y=0;for(let j of B.getOutgoingEdges())A.getLayer()!==j.getTarget().getNode().getLayer()&&Y++;Y>0&&(o[B.id]=r++)}let i=0;for(let A of e){let B=0;for(let X of A.getPorts())if(X.getSide()===u.NORTH){for(let tt of X.getIncomingEdges())if(A.getLayer()!==tt.getSource().getNode().getLayer()){B++;break}}else break;let Y=0,j=A.getPorts();for(let X=j.length-1;X>=0;X--){let tt=j[X],ot=0;for(let Lt of tt.getIncomingEdges())A.getLayer()!==Lt.getSource().getNode().getLayer()&&ot++;ot>0&&(tt.getSide()===u.NORTH?(o[tt.id]=i,i++):(o[tt.id]=i+B+Y,Y++))}i+=Y}let s=new Map,a=new Set,l=0;for(let A of t)for(let B of A.getPorts())for(let Y of B.getOutgoingEdges()){let j=Y.getTarget();if(A.getLayer()!==j.getNode().getLayer()){let X=s.get(B),tt=s.get(j);if(X==null&&tt==null){let ot=new H_(l++);a.add(ot),ot.edges.push(Y),ot.ports.push(B),s.set(B,ot),ot.ports.push(j),s.set(j,ot)}else if(X==null)tt.edges.push(Y),tt.ports.push(B),s.set(B,tt);else if(tt==null)X.edges.push(Y),X.ports.push(j),s.set(j,X);else if(X===tt)X.edges.push(Y);else{X.edges.push(Y);for(let ot of tt.ports)s.set(ot,X);for(let ot of tt.edges)X.edges.push(ot);for(let ot of tt.ports)X.ports.push(ot);a.delete(tt)}}}let c=[...a],g=t[0].getLayer(),h=e[0].getLayer();for(let A of c){A.upperLeft=r,A.upperRight=i,A.lowerLeft=0,A.lowerRight=0;for(let B of A.ports){let Y=o[B.id];B.getNode().getLayer()===g?(Y<A.upperLeft&&(A.upperLeft=Y),Y>A.lowerLeft&&(A.lowerLeft=Y)):B.getNode().getLayer()===h&&(Y<A.upperRight&&(A.upperRight=Y),Y>A.lowerRight&&(A.lowerRight=Y))}}c.sort((A,B)=>A.upperLeft!==B.upperLeft?A.upperLeft-B.upperLeft:A.upperRight!==B.upperRight?A.upperRight-B.upperRight:A.id-B.id);let d=new Int32Array(c.length),f=new Int32Array(i+1);for(let A=0;A<c.length;A++)d[A]=c[A].upperRight,f[d[A]]=1;let E=0;for(let A=0;A<f.length;A++)f[A]===1?f[A]=E:E--;let P=0;for(let A=0;A<d.length;A++)d[A]+=f[d[A]],d[A]+1>P&&(P=d[A]+1);let S=1;for(;S<P;)S*=2;let T=2*S-1;S-=1;let N=new Int32Array(T),I=0;for(let A=0;A<d.length;A++){let B=d[A]+S;for(N[B]++;B>0;)B%2>0&&(I+=N[B+1]),B=B-1>>1,N[B]++}let C=new Array(c.length*2);for(let A=0;A<c.length;A++)C[2*A]=new jn(c[A],c[A].upperLeft,c[A].lowerLeft,kr.UPPER),C[2*A+1]=new jn(c[A],c[A].lowerLeft,c[A].upperLeft,kr.LOWER);C.sort(IP);let x=0;for(let A of C)A.type===kr.UPPER?x++:(x--,I+=x);let M=new Array(c.length*2);for(let A=0;A<c.length;A++)M[2*A]=new jn(c[A],c[A].upperRight,c[A].lowerRight,kr.UPPER),M[2*A+1]=new jn(c[A],c[A].lowerRight,c[A].upperRight,kr.LOWER);M.sort(IP),x=0;for(let A of M)A.type===kr.UPPER?x++:(x--,I+=x);return I}},H_=class{constructor(t){this.id=t,this.edges=[],this.ports=[],this.upperLeft=0,this.lowerLeft=0,this.upperRight=0,this.lowerRight=0}},kr=Object.freeze({UPPER:"UPPER",LOWER:"LOWER"}),jn=class{constructor(t,e,o,r){this.hyperedge=t,this.position=e,this.oppositePosition=o,this.type=r}};function IP(n,t){return n.position!==t.position?n.position-t.position:n.oppositePosition!==t.oppositePosition?n.oppositePosition-t.oppositePosition:n.hyperedge!==t.hyperedge?n.hyperedge.id-t.hyperedge.id:n.type===kr.UPPER&&t.type===kr.LOWER?-1:n.type===kr.LOWER&&t.type===kr.UPPER?1:0}var fd=class{constructor(t){this._inLayerEdgeCounts=new Int32Array(t.length),this._hasNorthSouthPorts=new Array(t.length).fill(!1),this._hasHyperEdgesEastOfIndex=new Array(t.length).fill(!1),this._nPorts=0,this._crossingCounter=null,this._hyperedgeCrossingsCounter=null}countAllCrossings(t){if(t.length===0)return 0;let e=this._crossingCounter.countInLayerCrossingsOnSide(t[0],u.WEST);e+=this._crossingCounter.countInLayerCrossingsOnSide(t[t.length-1],u.EAST);for(let o=0;o<t.length;o++)e+=this._countCrossingsAt(o,t);return e}_countCrossingsAt(t,e){let o=0,r=e[t];if(t<e.length-1){let i=e[t+1];this._hasHyperEdgesEastOfIndex[t]?(o=this._hyperedgeCrossingsCounter.countCrossings(r,i),o+=this._crossingCounter.countInLayerCrossingsOnSide(r,u.EAST),o+=this._crossingCounter.countInLayerCrossingsOnSide(i,u.WEST)):o=this._crossingCounter.countCrossingsBetweenLayers(r,i)}return this._hasNorthSouthPorts[t]&&(o+=this._crossingCounter.countNorthSouthPortCrossingsInLayer(r)),o}initAtNodeLevel(t,e,o){o[t][e].getType()===y.NORTH_SOUTH_PORT&&(this._hasNorthSouthPorts[t]=!0)}initAtPortLevel(t,e,o,r){let i=r[t][e].getPorts()[o];i.id=this._nPorts++,i.getOutgoingEdges().length+i.getIncomingEdges().length>1&&(i.getSide()===u.EAST?this._hasHyperEdgesEastOfIndex[t]=!0:i.getSide()===u.WEST&&t>0&&(this._hasHyperEdgesEastOfIndex[t-1]=!0))}initAtEdgeLevel(t,e,o,r,i,s){let a=s[t][e].getPorts()[o];i.getSource()===a&&i.getSource().getNode().getLayer()===i.getTarget().getNode().getLayer()&&this._inLayerEdgeCounts[t]++}initAfterTraversal(){let t=new Int32Array(this._nPorts);this._hyperedgeCrossingsCounter=new dd(this._inLayerEdgeCounts,this._hasNorthSouthPorts,t),this._crossingCounter=new Fr(t)}};function hI(n,t){for(let e=0;e<t.length;e++){for(let o of n)typeof o.initAtLayerLevel=="function"&&o.initAtLayerLevel(e,t);for(let o=0;o<t[e].length;o++){for(let i of n)typeof i.initAtNodeLevel=="function"&&i.initAtNodeLevel(e,o,t);let r=t[e][o].getPorts();for(let i=0;i<r.length;i++){for(let l of n)typeof l.initAtPortLevel=="function"&&l.initAtPortLevel(e,o,i,t);let s=r[i],a=0;for(let l of s.getConnectedEdges()){for(let c of n)typeof c.initAtEdgeLevel=="function"&&c.initAtEdgeLevel(e,o,i,a,l,t);a++}}}}for(let e of n)typeof e.initAfterTraversal=="function"&&e.initAfterTraversal()}var ud={init:hI};var _d=class{constructor(t){this.node=t,this.summedWeight=0,this.degree=0,this.barycenter=null,this.visited=!1}toString(){return`BarycenterState [node=${this.node}, summedWeight=${this.summedWeight}, degree=${this.degree}, barycenter=${this.barycenter}, visited=${this.visited}]`}},ll=class{constructor(t){this._constraintsBetweenNonDummies=!1,t.length>0&&t[0].length>0&&(this._constraintsBetweenNonDummies=t[0][0].getGraph().getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES)),this.barycenterStates=new Array(t.length),this.constraintGroups=new Array(t.length),this.layoutUnits=new Map}initAtLayerLevel(t,e){this.barycenterStates[t]=new Array(e[t].length),this.constraintGroups[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){this._initAtNode(o[t][e],!0)}_initAtNode(t,e){let o=t.getLayer().id,r=t.id;if(this.constraintGroups[o][r]=new pd(this,t),e){this.barycenterStates[o][r]=new _d(t);let i=t.getProperty(p.IN_LAYER_LAYOUT_UNIT);if(i!=null){let s=this.layoutUnits.get(i);s==null&&(s=[],this.layoutUnits.set(i,s)),s.push(t)}}}getBarycenterStates(){return this.barycenterStates}processConstraints(t){if(this._constraintsBetweenNonDummies){this._processConstraints(t,!0);for(let e of t)this._initAtNode(e,!1)}this._processConstraints(t,!1)}_processConstraints(t,e){let o=new Array(t.length);for(let i=0;i<t.length;i++){let s=t[i];o[i]=this.constraintGroups[s.getLayer().id][s.id]}this._buildConstraintsGraph(o,e);let r;for(;(r=this._findViolatedConstraint(o))!=null;)this._handleViolatedConstraint(r.first,r.second,o);t.length=0;for(let i of o)for(let s of i.getNodes())t.push(s),this._stateOf(s).barycenter=i.getBarycenter()}_buildConstraintsGraph(t,e){for(let r of t)r.resetOutgoingConstraints(),r.incomingConstraintsCount=0;let o=null;for(let r of t){let i=r.getNode();if(!(e&&i.getType()!==y.NORMAL)){for(let s of i.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS))(!e||s.getType()===y.NORMAL)&&(r.getOutgoingConstraints().push(this._groupOf(s)),this._groupOf(s).incomingConstraintsCount++);if(!e&&i.getType()===y.NORMAL){if(o!=null){let s=this.layoutUnits.get(o)||[],a=this.layoutUnits.get(i)||[];for(let l of s)for(let c of a)this._groupOf(l).getOutgoingConstraints().push(this._groupOf(c)),this._groupOf(c).incomingConstraintsCount++}o=i}}}}_findViolatedConstraint(t){let e=null;for(let o of t)o.resetIncomingConstraints(),o.hasOutgoingConstraints()&&o.incomingConstraintsCount===0&&(e==null&&(e=[]),e.push(o));if(e!=null)for(;e.length>0;){let o=e.shift();if(o.hasIncomingConstraints()){for(let r of o.getIncomingConstraints())if(r.getBarycenter()===o.getBarycenter()){if(t.indexOf(r)>t.indexOf(o))return Gt.of(r,o)}else if(r.getBarycenter()>o.getBarycenter())return Gt.of(r,o)}for(let r of o.getOutgoingConstraints()){let i=r.getIncomingConstraints();i.unshift(o),r.incomingConstraintsCount===i.length&&e.push(r)}}return null}_handleViolatedConstraint(t,e,o){let r=pd.merge(this,t,e),i=!1,s=0;for(;s<o.length;){let a=o[s];if(a===t||a===e){o.splice(s,1);continue}if(!i&&a.getBarycenter()>r.getBarycenter()){o.splice(s,0,r),i=!0,s++;continue}if(a.hasOutgoingConstraints()){let l=a.getOutgoingConstraints(),c=Ed(l,t),g=Ed(l,e);(c||g)&&(l.push(r),r.incomingConstraintsCount++)}s++}i||o.push(r)}_groupOf(t){return this.constraintGroups[t.getLayer().id][t.id]}_stateOf(t){return this.barycenterStates[t.getLayer().id][t.id]}},RP=1e-4,pd=class n{constructor(t,e){this._resolver=t,this.nodes=[e],this.summedWeight=0,this.degree=0,this.outgoingConstraints=null,this.incomingConstraints=null,this.incomingConstraintsCount=0}static merge(t,e,o){let r=Object.create(n.prototype);if(r._resolver=t,r.nodes=e.nodes.concat(o.nodes),r.summedWeight=e.summedWeight+o.summedWeight,r.degree=e.degree+o.degree,r.outgoingConstraints=null,r.incomingConstraints=null,r.incomingConstraintsCount=0,e.outgoingConstraints!=null){if(r.outgoingConstraints=e.outgoingConstraints.slice(),Ed(r.outgoingConstraints,o),o.outgoingConstraints!=null)for(let s of o.outgoingConstraints)s!==e&&(r.outgoingConstraints.indexOf(s)>=0?s.incomingConstraintsCount--:r.outgoingConstraints.push(s))}else o.outgoingConstraints!=null&&(r.outgoingConstraints=o.outgoingConstraints.slice(),Ed(r.outgoingConstraints,e));r.degree>0?r.setBarycenter(r.summedWeight/r.degree):e.getBarycenter()!=null&&o.getBarycenter()!=null?r.setBarycenter((e.getBarycenter()+o.getBarycenter())/2):e.getBarycenter()!=null?r.setBarycenter(e.getBarycenter()):o.getBarycenter()!=null&&r.setBarycenter(o.getBarycenter());let i=r.getBarycenter();if(i!=null){let s=o.getBarycenter(),a=e.getBarycenter();if(s!=null&&i+RP<s)throw new Error("merged barycenter fell below second group barycenter");if(a!=null&&i-RP>a)throw new Error("merged barycenter rose above first group barycenter")}return r}setBarycenter(t){for(let e of this.nodes)this._resolver._stateOf(e).barycenter=t}getBarycenter(){return this._resolver._stateOf(this.nodes[0]).barycenter}getOutgoingConstraints(){return this.outgoingConstraints==null&&(this.outgoingConstraints=[]),this.outgoingConstraints}resetOutgoingConstraints(){this.outgoingConstraints=null}hasOutgoingConstraints(){return this.outgoingConstraints!=null&&this.outgoingConstraints.length>0}getIncomingConstraints(){return this.incomingConstraints==null&&(this.incomingConstraints=[]),this.incomingConstraints}resetIncomingConstraints(){this.incomingConstraints=null}hasIncomingConstraints(){return this.incomingConstraints!=null&&this.incomingConstraints.length>0}getNodes(){return this.nodes}getNode(){if(this.nodes.length!==1)throw new Error("ConstraintGroup.getNode called on a multi-node group");return this.nodes[0]}toString(){let t="[";for(let e=0;e<this.nodes.length;e++){t+=this.nodes[e].toString();let o=this.getBarycenter();o!=null&&(t+=`<${o}>`),e<this.nodes.length-1&&(t+=", ")}return t+"]"}};function Ed(n,t){let e=n.indexOf(t);return e<0?!1:(n.splice(e,1),!0)}var LP=.07,$n=class{constructor(t,e,o,r){this.constraintResolver=t,this.random=e,this.portDistributor=o,this.portRanks=null,this.barycenterState=null,this.barycenterStateComparator=(i,s)=>{let a=this.stateOf(i),l=this.stateOf(s);return a.barycenter!=null&&l.barycenter!=null?a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:0:a.barycenter!=null?-1:l.barycenter!=null?1:0}}minimizeCrossingsList(t,e,o,r){if(o?this.randomizeBarycenters(t):(this.calculateBarycenters(t,r),this.fillInUnknownBarycenters(t,e)),t.length>1){if(t[0].getGraph().getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER))throw new Error("CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER requires ModelOrderBarycenterHeuristic");t.sort(this.barycenterStateComparator),this.constraintResolver.processConstraints(t)}}randomizeBarycenters(t){for(let e of t){let o=this.stateOf(e);o.barycenter=this.random.nextDouble(),o.summedWeight=o.barycenter,o.degree=1}}fillInUnknownBarycenters(t,e){if(e){let o=-1;for(let r=0;r<t.length;r++){let i=t[r],s=this.stateOf(i),a=s.barycenter;if(a==null){let l=o+1;for(let c=r+1;c<t.length;c++){let g=this.stateOf(t[c]).barycenter;if(g!=null){l=g;break}}a=(o+l)/2,s.barycenter=a,s.summedWeight=a,s.degree=1}o=a}}else{let o=0;for(let r of t){let i=this.stateOf(r).barycenter;i!=null&&(o=Math.max(o,i))}o+=2;for(let r of t){let i=this.stateOf(r);if(i.barycenter==null){let s=this.random.nextFloat()*o-1;i.barycenter=s,i.summedWeight=s,i.degree=1}}}}calculateBarycenters(t,e){for(let o of t)this.stateOf(o).visited=!1;for(let o of t)this._calculateBarycenter(o,e)}_calculateBarycenter(t,e){let o=this.stateOf(t);if(o.visited)return;o.visited=!0,o.degree=0,o.summedWeight=0,o.barycenter=null;for(let i of t.getPorts()){let s=e?i.getPredecessorPorts():i.getSuccessorPorts();for(let a of s){let l=a.getNode();if(l.getLayer()===t.getLayer()){if(l!==t){this._calculateBarycenter(l,e);let c=this.stateOf(l);o.degree+=c.degree,o.summedWeight+=c.summedWeight}}else o.summedWeight+=this.portRanks[a.id],o.degree++}}let r=t.getProperty(p.BARYCENTER_ASSOCIATES);if(r!=null){for(let i of r)if(t.getLayer()===i.getLayer()){this._calculateBarycenter(i,e);let s=this.stateOf(i);o.degree+=s.degree,o.summedWeight+=s.summedWeight}}o.degree>0&&(o.summedWeight+=this.random.nextFloat()*LP-LP/2,o.barycenter=o.summedWeight/o.degree)}stateOf(t){return this.barycenterState[t.getLayer().id][t.id]}minimizeCrossings(t,e,o,r){if(!this._isFirstLayer(t,e,o)){let l=t[e-fI(o)];this.portDistributor.calculatePortRanksLayer(l,uI(o))}let i=t[e][0],s=!r||dI(i),a=Array.from(t[e]);this.minimizeCrossingsList(a,s,!1,o);for(let l=0;l<a.length;l++)t[e][l]=a[l];return!1}setFirstLayerOrder(t,e){let o=AP(e,t.length),r=Array.from(t[o]);this.minimizeCrossingsList(r,!1,!0,e);for(let i=0;i<r.length;i++)t[o][i]=r[i];return!1}alwaysImproves(){return!1}isDeterministic(){return!1}_isFirstLayer(t,e,o){return e===AP(o,t.length)}initAfterTraversal(){this.barycenterState=this.constraintResolver.getBarycenterStates(),this.portRanks=this.portDistributor.getPortRanks()}initAtLayerLevel(t,e){e[t][0].getLayer().id=t}};function dI(n){return n.getType()===y.EXTERNAL_PORT}function fI(n){return n?1:-1}function uI(n){return n?W.OUTPUT:W.INPUT}function AP(n,t){return n?0:Math.max(0,t-1)}var qn=class{constructor(t,e){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._portPositions=new Map,this._easternAdjacencies=new Map,this._westernAdjacencies=new Map,this._currentNodeOrder=t,this._freeLayerIndex=e,this._upperAdjacencies=null,this._lowerAdjacencies=null,this._setPortPositionsForNeighbouringLayers()}_setPortPositionsForNeighbouringLayers(){this._freeLayerIsNotFirstLayer()&&this._setPortPositionsForLayer(this._freeLayerIndex-1,u.EAST),this._freeLayerIsNotLastLayer()&&this._setPortPositionsForLayer(this._freeLayerIndex+1,u.WEST)}_freeLayerIsNotFirstLayer(){return this._freeLayerIndex>0}_freeLayerIsNotLastLayer(){return this._freeLayerIndex<this._currentNodeOrder.length-1}_setPortPositionsForLayer(t,e){let o=0;for(let r of this._currentNodeOrder[t]){let i=zi(r,e);for(let s of i)this._portPositions.set(s,o++)}}countEasternEdgeCrossings(t,e){this._resetCrossingCount(),t!==e&&this._addEasternCrossings(t,e)}countWesternEdgeCrossings(t,e){this._resetCrossingCount(),t!==e&&this._addWesternCrossings(t,e)}countBothSideCrossings(t,e){this._resetCrossingCount(),t!==e&&(this._addWesternCrossings(t,e),this._addEasternCrossings(t,e))}_resetCrossingCount(){this._upperLowerCrossings=0,this._lowerUpperCrossings=0}_addEasternCrossings(t,e){this._upperAdjacencies=this._getAdjacencyFor(t,u.EAST,this._easternAdjacencies),this._lowerAdjacencies=this._getAdjacencyFor(e,u.EAST,this._easternAdjacencies),!(this._upperAdjacencies.size()===0||this._lowerAdjacencies.size()===0)&&this._countCrossingsByMergingAdjacencyLists()}_addWesternCrossings(t,e){this._upperAdjacencies=this._getAdjacencyFor(t,u.WEST,this._westernAdjacencies),this._lowerAdjacencies=this._getAdjacencyFor(e,u.WEST,this._westernAdjacencies),!(this._upperAdjacencies.size()===0||this._lowerAdjacencies.size()===0)&&this._countCrossingsByMergingAdjacencyLists()}_getAdjacencyFor(t,e,o){if(o.size===0)for(let i of this._currentNodeOrder[this._freeLayerIndex])o.set(i,new v_(i,e,this._portPositions));let r=o.get(t);return r.reset(),r}_countCrossingsByMergingAdjacencyLists(){for(;!this._upperAdjacencies.isEmpty()&&!this._lowerAdjacencies.isEmpty();)CP(this._upperAdjacencies.first(),this._lowerAdjacencies.first())?(this._upperLowerCrossings+=this._upperAdjacencies.size(),this._lowerAdjacencies.removeFirst()):CP(this._lowerAdjacencies.first(),this._upperAdjacencies.first())?(this._lowerUpperCrossings+=this._lowerAdjacencies.size(),this._upperAdjacencies.removeFirst()):(this._upperLowerCrossings+=this._upperAdjacencies.countAdjacenciesBelowNodeOfFirstPort(),this._lowerUpperCrossings+=this._lowerAdjacencies.countAdjacenciesBelowNodeOfFirstPort(),this._upperAdjacencies.removeFirst(),this._lowerAdjacencies.removeFirst())}getUpperLowerCrossings(){return this._upperLowerCrossings}getLowerUpperCrossings(){return this._lowerUpperCrossings}};function CP(n,t){return n>t}var v_=class{constructor(t,e,o){this._node=t,this._side=e,this._portPositions=o,this._adjacencies=[],this._size=0,this._currentSize=0,this._currentIndex=0,this._collectSortedAdjacencies()}_collectSortedAdjacencies(){let t=zi(this._node,this._side);for(let e of t){let o=this._side===u.WEST?e.getIncomingEdges():e.getOutgoingEdges();for(let r of o)r.isSelfLoop()||r.getSource().getNode().getLayer()!==r.getTarget().getNode().getLayer()&&(this._addAdjacencyOf(r),this._size++,this._currentSize++)}this._adjacencies.sort((e,o)=>e.position-o.position)}_addAdjacencyOf(t){let e=this._side===u.WEST?t.getSource():t.getTarget(),o=this._portPositions.get(e),r=this._adjacencies.length-1;this._adjacencies.length>0&&this._adjacencies[r].position===o?(this._adjacencies[r].cardinality++,this._adjacencies[r].currentCardinality++):this._adjacencies.push(new B_(o))}reset(){this._currentIndex=0,this._currentSize=this._size,this.isEmpty()||this._currentAdjacency().reset()}countAdjacenciesBelowNodeOfFirstPort(){return this._currentSize-this._currentAdjacency().currentCardinality}removeFirst(){if(this.isEmpty())return;let t=this._currentAdjacency();t.currentCardinality===1?this._incrementCurrentIndex():t.currentCardinality--,this._currentSize--}_incrementCurrentIndex(){this._currentIndex++,this._currentIndex<this._adjacencies.length&&this._currentAdjacency().reset()}isEmpty(){return this._currentSize===0}first(){return this._currentAdjacency().position}size(){return this._currentSize}_currentAdjacency(){return this._adjacencies[this._currentIndex]}toString(){return`AdjacencyList [node=${this._node}, adjacencies=${this._adjacencies.map(t=>t.toString())}]`}},B_=class{constructor(t){this.position=t,this.cardinality=1,this.currentCardinality=1}reset(){this.currentCardinality=this.cardinality}toString(){return`Adjacency [position=${this.position}, cardinality=${this.cardinality}, currentCardinality=${this.currentCardinality}]`}};var md=class{constructor(){this.crossingsCounter=null,this._nPorts=0,this.portPos=null,this._hierarchicalCrossingsCounter=null}distributePortsWhileSweeping(t,e,o){return this._initialize(t,e,o),this._distributePortsInLayer(t,e,o)}_distributePortsInLayer(t,e,o){let r=o?u.WEST:u.EAST,i=!1;for(let s of t[e]){if(s.getProperty(_.PORT_CONSTRAINTS).isOrderFixed())continue;let a=s.getNestedGraph(),l=s.getPortSideView(r).length>0&&a!=null;if(l){let c=a.toNodeArray();this._hierarchicalCrossingsCounter=new qn(c,o?0:c.length-1)}i=this._distributePortsOnNode(s,r,l)||i}return i}_distributePortsOnNode(t,e,o){let r=t.getPortSideView(e);e===u.SOUTH||e===u.WEST?r=r.slice().reverse():r=r.slice();let i=!1,s;do{s=!1;for(let a=0;a<r.length-1;a++){let l=r[a],c=r[a+1];this._switchingDecreasesCrossings(l,c,o)&&(i=!0,this._switchPorts(r,a,a+1),s=!0)}}while(s);return i}_switchingDecreasesCrossings(t,e,o){let r=this.crossingsCounter.countCrossingsBetweenPortsInBothOrders(t,e),i=r.getFirst(),s=r.getSecond();if(o){let a=t.getProperty(p.PORT_DUMMY),l=e.getProperty(p.PORT_DUMMY);a!=null&&l!=null&&(this._hierarchicalCrossingsCounter.countBothSideCrossings(a,l),i+=this._hierarchicalCrossingsCounter.getUpperLowerCrossings(),s+=this._hierarchicalCrossingsCounter.getLowerUpperCrossings())}return i>s}_switchPorts(t,e,o){this.crossingsCounter.switchPorts(t[e],t[o]);let r=t[o];t[o]=t[e],t[e]=r}_initialize(t,e,o){o&&e>0?this.crossingsCounter.initForCountingBetween(t[e-1],t[e]):!o&&e<t.length-1?this.crossingsCounter.initForCountingBetween(t[e],t[e+1]):this.crossingsCounter.initPortPositionsForInLayerCrossings(t[e],o?u.WEST:u.EAST)}initAtNodeLevel(t,e,o){this._nPorts+=o[t][e].getPorts().length,this._nPorts}initAfterTraversal(){this.portPos=new Int32Array(this._nPorts),this.crossingsCounter=new Fr(this.portPos)}};var Jn=class{constructor(t){this.portRanks=null,this.minBarycenter=0,this.maxBarycenter=0,this.nodePositions=new Array(t),this.portBarycenter=null,this.inLayerPorts=[],this._nPorts=0}getPortRanks(){return this.portRanks}distributePortsWhileSweeping(t,e,o){this._updateNodePositions(t,e);let r=t[e],i=o?u.WEST:u.EAST;if(this._isNotFirstLayer(t.length,e,o)){let s=t[o?e-1:e+1];this.calculatePortRanksLayer(s,xP(o));for(let a of r)this._distributePorts(a,i);this.calculatePortRanksLayer(r,xP(!o));for(let a of s)_I(a)||this._distributePorts(a,i.opposed())}else for(let s of r)this._distributePorts(s,i);return!1}calculatePortRanksLayer(t,e){let o=0;for(let r=0;r<t.length;r++)o+=this.calculatePortRanks(t[r],o,e)}calculatePortRanks(t,e,o){throw new Error("abstract method \u2014 subclass must override calculatePortRanks(node, rankSum, type)")}_distributePorts(t,e){t.getProperty(_.PORT_CONSTRAINTS).isOrderFixed()||(this._distributePortsSubset(t,t.getPorts(e)),this._distributePortsSubset(t,t.getPorts(u.SOUTH)),this._distributePortsSubset(t,t.getPorts(u.NORTH)),this._sortPorts(t))}_distributePortsSubset(t,e){this.inLayerPorts.length=0,this._iteratePortsAndCollectInLayerPorts(t,e),this.inLayerPorts.length>0&&this._calculateInLayerPortsBarycenterValues(t)}_iteratePortsAndCollectInLayerPorts(t,e){this.minBarycenter=0,this.maxBarycenter=0;let o=2*t.getLayer().getNodes().length+1;t:for(let r of e){let i=r.getSide(),s=i===u.NORTH||i===u.SOUTH,a=0;if(s){let l=r.getProperty(p.PORT_DUMMY);if(l==null)continue;a+=this._dealWithNorthSouthPorts(o,r,l)}else{for(let l of r.getOutgoingEdges()){let c=l.getTarget();if(c.getNode().getLayer()===t.getLayer()){this.inLayerPorts.push(r);continue t}else a+=this.portRanks[c.id]}for(let l of r.getIncomingEdges()){let c=l.getSource();if(c.getNode().getLayer()===t.getLayer()){this.inLayerPorts.push(r);continue t}else a-=this.portRanks[c.id]}}r.getDegree()>0?(this.portBarycenter[r.id]=a/r.getDegree(),this.minBarycenter=Math.min(this.minBarycenter,this.portBarycenter[r.id]),this.maxBarycenter=Math.max(this.maxBarycenter,this.portBarycenter[r.id])):s&&(this.portBarycenter[r.id]=a)}}_calculateInLayerPortsBarycenterValues(t){let e=this._positionOfNode(t)+1,o=t.getLayer().getNodes().length+1;for(let r of this.inLayerPorts){let i=0,s=0;for(let c of r.getConnectedPorts())c.getNode().getLayer()===t.getLayer()&&(i+=this._positionOfNode(c.getNode())+1,s++);let a=i/s,l=r.getSide();l===u.EAST?a<e?this.portBarycenter[r.id]=this.minBarycenter-a:this.portBarycenter[r.id]=this.maxBarycenter+(o-a):l===u.WEST&&(a<e?this.portBarycenter[r.id]=this.maxBarycenter+a:this.portBarycenter[r.id]=this.minBarycenter-(o-a))}}_dealWithNorthSouthPorts(t,e,o){let r=!1,i=!1;for(let a of o.getPorts())a.getProperty(p.ORIGIN)===e&&(a.getOutgoingEdges().length>0?i=!0:a.getIncomingEdges().length>0&&(r=!0));let s=0;return r&&r!==i?s=e.getSide()===u.NORTH?-this._positionOfNode(o):t-this._positionOfNode(o):i&&r!==i?s=this._positionOfNode(o)+1:r&&i&&(s=e.getSide()===u.NORTH?0:t/2),s}_positionOfNode(t){return this.nodePositions[t.getLayer().id][t.id]}_updateNodePositions(t,e){let o=t[e];for(let r=0;r<o.length;r++){let i=o[r];this.nodePositions[i.getLayer().id][i.id]=r}}_isNotFirstLayer(t,e,o){return o?e!==0:e!==t-1}_sortPorts(t){let e=t.getPorts(),o=this.portBarycenter;e.sort((r,i)=>{let s=r.getSide(),a=i.getSide();if(s!==a)return s.ordinal()-a.ordinal();let l=o[r.id],c=o[i.id];return l===0&&c===0?0:l===0?-1:c===0?1:l<c?-1:l>c?1:0})}initAtLayerLevel(t,e){this.nodePositions[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){let r=o[t][e];r.id=e,this.nodePositions[t][e]=e}initAtPortLevel(t,e,o,r){r[t][e].getPorts()[o].id=this._nPorts++}initAfterTraversal(){this.portRanks=new Float32Array(this._nPorts),this.portBarycenter=new Float32Array(this._nPorts)}};function xP(n){return n?W.OUTPUT:W.INPUT}function _I(n){return n.getNestedGraph()!=null}var Qn=class extends Jn{constructor(t){super(t)}calculatePortRanks(t,e,o){let r=this.getPortRanks();if(o===W.INPUT){let i=0,s=0;for(let g of t.getPorts())g.getIncomingEdges().length>0&&(i++,g.getSide()===u.NORTH&&s++);let a=1/(i+1),l=e+s*a,c=e+1-a;for(let g of t.getPorts(W.INPUT))g.getSide()===u.NORTH?(r[g.id]=l,l-=a):(r[g.id]=c,c-=a)}else if(o===W.OUTPUT){let i=0;for(let l of t.getPorts())l.getOutgoingEdges().length>0&&i++;let s=1/(i+1),a=e+s;for(let l of t.getPorts(W.OUTPUT))r[l.id]=a,a+=s}else throw new Error("Port type is undefined");return 1}};var Pd=class extends Jn{constructor(t){super(t)}calculatePortRanks(t,e,o){let r=this.getPortRanks();if(o===W.INPUT){let i=0,s=0;for(let c of t.getPorts())c.getIncomingEdges().length>0&&(i++,c.getSide()===u.NORTH&&s++);let a=e+s,l=e+i;for(let c of t.getPorts(W.INPUT))c.getSide()===u.NORTH?(r[c.id]=a,a--):(r[c.id]=l,l--);return i}if(o===W.OUTPUT){let i=0;for(let s of t.getPorts(W.OUTPUT))i++,r[s.id]=e+i;return i}throw new Error("Port type is undefined")}};var Od=class{static create(t,e,o){return t===re.TWO_SIDED_GREEDY_SWITCH?new md:e.nextBoolean()?new Qn(o.length):new Pd(o.length)}};var Sd=class{constructor(t){this.graphData=t,this.nodeInfo=new Array(t.currentNodeOrder().length)}useBottomUp(){let t=this.graphData.lGraph().getProperty(_.CROSSING_MINIMIZATION_HIERARCHICAL_SWEEPINESS);if(pI(t)||this._rootNode()||this._fixedPortOrder()||this._fewerThanTwoInOutEdges())return!0;if(this.graphData.crossMinDeterministic())return!1;let e=0,o=0,r=[];for(let a of this.graphData.currentNodeOrder()){for(let l of a){if(OI(l)){r.push(l);continue}let c=this._nodeInfoFor(l);PI(l)?(c.hierarchicalInfluence=1,SI(l)&&(o+=c.connectedEdges)):mI(l)?c.randomInfluence=1:EI(l)&&(e+=c.connectedEdges);for(let g of l.getOutgoingEdges())e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoToTarget(c,g);for(let g of l.getPortSideView(u.NORTH)){let h=g.getProperty(p.PORT_DUMMY);h!=null&&(e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoTo(c,h))}for(let g of l.getPortSideView(u.SOUTH)){let h=g.getProperty(p.PORT_DUMMY);h!=null&&(e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoTo(c,h))}}for(let l of r){let c=this._nodeInfoFor(l);for(let g of l.getOutgoingEdges())e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoToTarget(c,g)}r.length=0}let i=e+o;return(i===0?Number.POSITIVE_INFINITY:(e-o)/i)>=t}_fixedPortOrder(){return this.graphData.parent().getProperty(_.PORT_CONSTRAINTS).isOrderFixed()}_transferInfoToTarget(t,e){let o=e.getTarget().getNode();this._transferInfoTo(t,o)}_transferInfoTo(t,e){let o=this._nodeInfoFor(e);o.transfer(t),o.connectedEdges++}_fewerThanTwoInOutEdges(){let t=this.graphData.parent();return t.getPortSideView(u.EAST).length<2&&t.getPortSideView(u.WEST).length<2}_rootNode(){return!this.graphData.hasParent()}_nodeInfoFor(t){return this.nodeInfo[t.getLayer().id][t.id]}initAtLayerLevel(t,e){e[t][0].getLayer().id=t,this.nodeInfo[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){o[t][e].id=e,this.nodeInfo[t][e]=new U_}},U_=class{constructor(){this.connectedEdges=0,this.hierarchicalInfluence=0,this.randomInfluence=0}transfer(t){this.hierarchicalInfluence+=t.hierarchicalInfluence,this.randomInfluence+=t.randomInfluence,this.connectedEdges+=t.connectedEdges}toString(){return`NodeInfo [connectedEdges=${this.connectedEdges}, hierarchicalInfluence=${this.hierarchicalInfluence}, randomInfluence=${this.randomInfluence}]`}};function pI(n){return n<-1}function EI(n){let t=n.getPortSideView(u.EAST);if(t.length===0)return!0;for(let e of t)if(!e.getConnectedEdges()[Symbol.iterator]().next().done)return!1;return!0}function mI(n){let t=n.getPortSideView(u.WEST);if(t.length===0)return!0;for(let e of t)if(!e.getConnectedEdges()[Symbol.iterator]().next().done)return!1;return!0}function PI(n){return n.getType()===y.EXTERNAL_PORT}function OI(n){return n.getType()===y.NORTH_SOUTH_PORT}function SI(n){return n.getProperty(p.ORIGIN).getSide()===u.EAST}var Td=class{constructor(t){this.random=t,this.weightComparator=(e,o)=>{if(!e.hasProperty(p.WEIGHT))return 1;if(!o.hasProperty(p.WEIGHT))return-1;let r=e.getProperty(p.WEIGHT),i=o.getProperty(p.WEIGHT);return r!=null&&i!=null?r<i?-1:r>i?1:0:r!=null?-1:i!=null?1:0}}alwaysImproves(){return!1}isDeterministic(){return!0}setFirstLayerOrder(t,e){let o=e?0:Math.max(0,t.length-1),r=Array.from(t[o]);for(let i of r)i.setProperty(p.WEIGHT,this.random.nextDouble());r.sort(this.weightComparator);for(let i=0;i<r.length;i++){let s=r[i];t[o][i]=s,s.setProperty(p.WEIGHT,i+1)}return!1}minimizeCrossings(t,e,o,r){let i=Array.from(t[e]);this._calculateMedians(i,o?e-1:e+1),i.sort(this.weightComparator);for(let s=0;s<i.length;s++)t[e][s]=i[s];return!1}_calculateMedians(t,e){let o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=[];for(let a of t){let l=[];for(let c of a.getIncomingEdges()){let g=c.getTarget().getNode(),h=c.getSource().getNode();g.getLayer().id===e&&l.push(g),h.getLayer().id===e&&l.push(h)}for(let c of a.getOutgoingEdges()){let g=c.getTarget().getNode(),h=c.getSource().getNode();g.getLayer().id===e&&l.push(g),h.getLayer().id===e&&l.push(h)}if(l.length===0)i.push(a);else{l.sort(this.weightComparator);let c=Math.floor(l.length/2),g=l[c].getProperty(p.WEIGHT);a.setProperty(p.WEIGHT,g),o=Math.min(o,g),r=Math.max(r,g)}}let s=(r+o)/2;for(let a of i)a.setProperty(p.WEIGHT,s)}};var Nd=class n extends $n{constructor(t,e,o,r){super(t,e,o,r),this.biggerThan=new Map,this.smallerThan=new Map,this.barycenterStateComparator=(i,s)=>{let a=i.hasProperty(_.LAYERING_LAYER_CONSTRAINT)&&DP(i.getProperty(_.LAYERING_LAYER_CONSTRAINT)),l=s.hasProperty(_.LAYERING_LAYER_CONSTRAINT)&&DP(s.getProperty(_.LAYERING_LAYER_CONSTRAINT));if(a||l)return 0;let c=i.getGraph(),g=this._compareBasedOnTransitiveDependencies(i,s);if(g!==0)return g;if(i.hasProperty(p.MODEL_ORDER)&&s.hasProperty(p.MODEL_ORDER)){let h=c.getProperty(p.MAX_MODEL_ORDER_NODES),d=Qe.calculateModelOrderOrGroupModelOrder(i,s,c,h),f=Qe.calculateModelOrderOrGroupModelOrder(s,i,c,h),E=Math.sign(d-f);if(c.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY)===Wt.ONLY_WITHIN_GROUP&&i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID)!==s.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID)&&(E=0),E<0)return this._updateBiggerAndSmallerAssociations(i,s),E;if(E>0)return this._updateBiggerAndSmallerAssociations(s,i),E}return this._compareBasedOnBarycenter(i,s)}}minimizeCrossingsList(t,e,o,r){if(o?this.randomizeBarycenters(t):(this.calculateBarycenters(t,r),this.fillInUnknownBarycenters(t,e)),t.length>1){let s=t[0].getGraph().getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER);s?n.insertionSort(t,this.barycenterStateComparator,this):t.sort(this.barycenterStateComparator),s||this.constraintResolver.processConstraints(t)}}_compareBasedOnTransitiveDependencies(t,e){if(!this.biggerThan.has(t))this.biggerThan.set(t,new Set);else if(this.biggerThan.get(t).has(e))return 1;if(!this.biggerThan.has(e))this.biggerThan.set(e,new Set);else if(this.biggerThan.get(e).has(t))return-1;if(!this.smallerThan.has(t))this.smallerThan.set(t,new Set);else if(this.smallerThan.get(t).has(e))return-1;if(!this.smallerThan.has(e))this.smallerThan.set(e,new Set);else if(this.smallerThan.get(e).has(t))return 1;return 0}_compareBasedOnBarycenter(t,e){let o=this.stateOf(t),r=this.stateOf(e);if(o.barycenter!=null&&r.barycenter!=null){let i=0;return o.barycenter<r.barycenter?i=-1:o.barycenter>r.barycenter&&(i=1),i<0?this._updateBiggerAndSmallerAssociations(t,e):i>0&&this._updateBiggerAndSmallerAssociations(e,t),i}return o.barycenter!=null?(this._updateBiggerAndSmallerAssociations(t,e),-1):r.barycenter!=null?(this._updateBiggerAndSmallerAssociations(e,t),1):0}_updateBiggerAndSmallerAssociations(t,e){let o=this.biggerThan.get(t),r=this.biggerThan.get(e),i=this.smallerThan.get(t),s=this.smallerThan.get(e);o.add(e),s.add(t);for(let a of r){o.add(a);let l=this.smallerThan.get(a);l.add(t);for(let c of i)l.add(c)}for(let a of i){s.add(a);let l=this.biggerThan.get(a);l.add(e);for(let c of r)l.add(c)}}static insertionSort(t,e,o){for(let r=1;r<t.length;r++){let i=t[r],s=r;for(;s>0&&e(t[s-1],i)>0;)t[s]=t[s-1],s--;t[s]=i}o.clearTransitiveOrdering()}clearTransitiveOrdering(){this.biggerThan=new Map,this.smallerThan=new Map}};function DP(n){return n===J.FIRST_SEPARATE||n===J.LAST_SEPARATE}var er=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};er.WEST=new er("WEST");er.EAST=new er("EAST");var yd=class{constructor(t,e,o,r){this._direction=r,this._oneSided=t===re.ONE_SIDED_GREEDY_SWITCH;let s=e[o].length;this._isCrossingMatrixFilled=new Array(s),this._crossingMatrix=new Array(s);for(let a=0;a<s;a++)this._isCrossingMatrixFilled[a]=new Array(s).fill(!1),this._crossingMatrix[a]=new Array(s).fill(0);this._inBetweenLayerCrossingCounter=new qn(e,o)}getCrossingMatrixEntry(t,e){return this._isCrossingMatrixFilled[t.id][e.id]||(this._fillCrossingMatrix(t,e),this._isCrossingMatrixFilled[t.id][e.id]=!0,this._isCrossingMatrixFilled[e.id][t.id]=!0),this._crossingMatrix[t.id][e.id]}_fillCrossingMatrix(t,e){this._oneSided?this._direction===er.EAST?this._inBetweenLayerCrossingCounter.countEasternEdgeCrossings(t,e):this._direction===er.WEST&&this._inBetweenLayerCrossingCounter.countWesternEdgeCrossings(t,e):this._inBetweenLayerCrossingCounter.countBothSideCrossings(t,e),this._crossingMatrix[t.id][e.id]=this._inBetweenLayerCrossingCounter.getUpperLowerCrossings(),this._crossingMatrix[e.id][t.id]=this._inBetweenLayerCrossingCounter.getLowerUpperCrossings()}};var Ad=class{constructor(t){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._portPositions=new Map,this._layer=t,this._initializePortPositions()}_initializePortPositions(){for(let t of this._layer)this._setPortIdsOn(t,u.SOUTH),this._setPortIdsOn(t,u.NORTH)}_setPortIdsOn(t,e){let o=0;for(let r of zi(t,e))this._portPositions.set(r,o++)}countCrossings(t,e){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._processIfTwoNorthSouthNodes(t,e),this._processIfNorthSouthLongEdgeDummyCrossing(t,e),this._processIfNormalNodeWithNSPortsAndLongEdgeDummy(t,e)}_processIfTwoNorthSouthNodes(t,e){Ld(t)&&Ld(e)&&!this._haveDifferentOrigins(t,e)&&(this._isNorthOfNormalNode(t)?this._countCrossingsOfTwoNorthSouthDummies(t,e):this._countCrossingsOfTwoNorthSouthDummies(e,t))}_countCrossingsOfTwoNorthSouthDummies(t,e){if(this._originPortPositionOf(t)>this._originPortPositionOf(e)){let o=e.getPortSideView(u.EAST);this._upperLowerCrossings=o.length===0?0:o[0].getDegree();let r=t.getPortSideView(u.WEST);this._lowerUpperCrossings=r.length===0?0:r[0].getDegree()}else{let o=e.getPortSideView(u.WEST);this._upperLowerCrossings=o.length===0?0:o[0].getDegree();let r=t.getPortSideView(u.EAST);this._lowerUpperCrossings=r.length===0?0:r[0].getDegree()}}_processIfNorthSouthLongEdgeDummyCrossing(t,e){Ld(t)&&Rd(e)?this._isNorthOfNormalNode(t)?this._upperLowerCrossings=1:this._lowerUpperCrossings=1:Ld(e)&&Rd(t)&&(this._isNorthOfNormalNode(e)?this._lowerUpperCrossings=1:this._upperLowerCrossings=1)}_processIfNormalNodeWithNSPortsAndLongEdgeDummy(t,e){bP(t)&&Rd(e)&&(this._upperLowerCrossings=Id(t,u.SOUTH),this._lowerUpperCrossings=Id(t,u.NORTH)),bP(e)&&Rd(t)&&(this._upperLowerCrossings=Id(e,u.NORTH),this._lowerUpperCrossings=Id(e,u.SOUTH))}_haveDifferentOrigins(t,e){return MP(t)!==MP(e)}_originPortPositionOf(t){let e=wP(t);return this._portPositions.get(e)}_isNorthOfNormalNode(t){return wP(t).getSide()===u.NORTH}getUpperLowerCrossings(){return this._upperLowerCrossings}getLowerUpperCrossings(){return this._lowerUpperCrossings}};function Id(n,t){let e=0;for(let o of n.getPortSideView(t))o.getProperty(p.PORT_DUMMY)!=null&&e++;return e}function wP(n){return n.getPorts()[0].getProperty(p.ORIGIN)}function MP(n){return n.getProperty(p.ORIGIN)}function Rd(n){return n.getType()===y.LONG_EDGE}function Ld(n){return n.getType()===y.NORTH_SOUTH_PORT}function bP(n){return n.getType()===y.NORMAL}var xd=class{constructor(t,e,o,r,i,s){if(this._crossingMatrixFiller=o,this._graphData=i,t>=e.length)throw new RangeError("Greedy SwitchDecider: Free layer not in graph.");this._freeLayer=e[t],this._leftInLayerCounter=new Fr(r),this._leftInLayerCounter.initPortPositionsForInLayerCrossings(this._freeLayer,u.WEST),this._rightInLayerCounter=new Fr(r),this._rightInLayerCounter.initPortPositionsForInLayerCrossings(this._freeLayer,u.EAST),this._northSouthCounter=new Ad(this._freeLayer),this._countCrossingsCausedByPortSwitch=!s&&i.hasParent()&&!i.dontSweepInto()&&this._freeLayer[0].getType()===y.EXTERNAL_PORT,this._parentCrossCounter=null,this._countCrossingsCausedByPortSwitch&&this._initParentCrossingsCounters(t,e.length)}_initParentCrossingsCounters(t,e){let o=this._graphData.parentGraphData(),r=o.currentNodeOrder(),i=o.portPositions();this._parentCrossCounter=new Fr(i);let s=this._graphData.parent().getLayer().id,a=s>0?r[s-1]:[],l=r[s],c=s<r.length-1?r[s+1]:[];t===e-1?this._parentCrossCounter.initForCountingBetween(l,c):this._parentCrossCounter.initForCountingBetween(a,l)}notifyOfSwitch(t,e){if(this._leftInLayerCounter.switchNodes(t,e,u.WEST),this._rightInLayerCounter.switchNodes(t,e,u.EAST),this._countCrossingsCausedByPortSwitch){let o=t.getProperty(p.ORIGIN),r=e.getProperty(p.ORIGIN);this._parentCrossCounter.switchPorts(o,r)}}doesSwitchReduceCrossings(t,e){if(this._constraintsPreventSwitch(t,e))return!1;let o=this._freeLayer[t],r=this._freeLayer[e],i=this._leftInLayerCounter.countInLayerCrossingsBetweenNodesInBothOrders(o,r,u.WEST),s=this._rightInLayerCounter.countInLayerCrossingsBetweenNodesInBothOrders(o,r,u.EAST);this._northSouthCounter.countCrossings(o,r);let a=this._crossingMatrixFiller.getCrossingMatrixEntry(o,r)+i.getFirst()+s.getFirst()+this._northSouthCounter.getUpperLowerCrossings(),l=this._crossingMatrixFiller.getCrossingMatrixEntry(r,o)+i.getSecond()+s.getSecond()+this._northSouthCounter.getLowerUpperCrossings();if(this._countCrossingsCausedByPortSwitch){let c=o.getProperty(p.ORIGIN),g=r.getProperty(p.ORIGIN),h=this._parentCrossCounter.countCrossingsBetweenPortsInBothOrders(c,g);a+=h.getFirst(),l+=h.getSecond()}return a>l}_constraintsPreventSwitch(t,e){let o=this._freeLayer[t],r=this._freeLayer[e];return TI(o,r)||NI(o,r)||yI(o,r)}};function TI(n,t){let e=n.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS);return e!=null&&e.length>0&&e.indexOf(t)>=0}function NI(n,t){let e=n.getType()!==y.LONG_EDGE&&t.getType()!==y.LONG_EDGE,o=n.getProperty(p.IN_LAYER_LAYOUT_UNIT),r=t.getProperty(p.IN_LAYER_LAYOUT_UNIT),i=o!==r,s=GP(n,o)||GP(t,r),a=Cd(n,u.NORTH),l=Cd(t,u.SOUTH);return s=s||Cd(n,u.SOUTH)||Cd(t,u.NORTH),e&&(s&&i||a||l)}function Cd(n,t){for(let e of n.getPortSideView(t))if(e.getProperty(p.PORT_DUMMY)!=null||!e.getConnectedEdges()[Symbol.iterator]().next().done)return!0;return!1}function GP(n,t){return t!=null&&t!==n}function yI(n,t){return vP(n)&&HP(t)||vP(t)&&HP(n)}function HP(n){return n.getType()===y.NORMAL}function vP(n){return n.getType()===y.NORTH_SOUTH_PORT}var Dd=class{constructor(t,e){this._graphData=e,this._greedySwitchType=t,this._currentNodeOrder=null,this._switchDecider=null,this._portPositions=null,this._nPorts=0}minimizeCrossings(t,e,o,r){return this._setUp(t,e,o),this._continueSwitchingUntilNoImprovementInLayer(e)}setFirstLayerOrder(t,e){let o=e?0:t.length-1;return this._setUp(t,o,e),this._sweepDownwardInLayer(o)}_setUp(t,e,o){this._currentNodeOrder=t;let r=o?er.WEST:er.EAST;this._switchDecider=this._getNewSwitchDecider(e,r)}_getNewSwitchDecider(t,e){let o=new yd(this._greedySwitchType,this._currentNodeOrder,t,e);return new xd(t,this._currentNodeOrder,o,this._portPositions,this._graphData,this._greedySwitchType===re.ONE_SIDED_GREEDY_SWITCH)}_continueSwitchingUntilNoImprovementInLayer(t){let e=!1,o;do o=this._sweepDownwardInLayer(t),e=e||o;while(o);return e}_sweepDownwardInLayer(t){let e=!1,o=this._currentNodeOrder[t].length;for(let r=0;r<o-1;r++){let i=r+1;this._switchIfImproves(t,r,i)&&(e=!0)}return e}_switchIfImproves(t,e,o){return this._switchDecider.doesSwitchReduceCrossings(e,o)?(this._exchangeNodes(e,o,t),!0):!1}_exchangeNodes(t,e,o){let r=this._currentNodeOrder[o];this._switchDecider.notifyOfSwitch(r[t],r[e]);let i=r[e];r[e]=r[t],r[t]=i}alwaysImproves(){return this._greedySwitchType!==re.ONE_SIDED_GREEDY_SWITCH}isDeterministic(){return!0}initAtLayerLevel(t,e){e[t][0].getLayer().id=t}initAtPortLevel(t,e,o,r){this._nPorts++}initAfterTraversal(){this._portPositions=new Int32Array(this._nPorts)}};var wd=class{constructor(t,e,o){this._lGraph=t,this._currentNodeOrder=t.toNodeArray(),this._parent=this._lGraph.getParentNode(),this._hasParent=this._parent!=null,this._parentGraphData=this._hasParent?o[this._parent.getGraph().id]:null;let r=t.getProperty(p.GRAPH_PROPERTIES);this._hasExternalPorts=r.has(v.EXTERNAL_PORTS),this._childGraphs=[],this._currentlyBestNodeAndPortOrder=null,this._bestNodeAndPortOrder=null,this._portPositions=null,this._nPorts=0,this._crossingsCounter=new fd(this._currentNodeOrder);let i=this._lGraph.getProperty(p.RANDOM);if(i==null){let a=this._lGraph.getParentNode?this._lGraph.getParentNode():null;for(;a!=null&&i==null;){let l=a.getGraph?a.getGraph():null;l&&(i=l.getProperty(p.RANDOM)),a=l&&l.getParentNode?l.getParentNode():null}i!=null&&this._lGraph.setProperty(p.RANDOM,i)}this._portDistributor=Od.create(e,i,this._currentNodeOrder),this._layerSweepTypeDecider=new Sd(this);let s=[this,this._crossingsCounter,this._layerSweepTypeDecider,this._portDistributor];if(e===re.BARYCENTER&&!t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)){let a=new ll(this._currentNodeOrder);s.push(a),this._crossMinimizer=new $n(a,i,this._portDistributor,this._currentNodeOrder)}else if(e===re.BARYCENTER&&t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)){let a=new ll(this._currentNodeOrder);s.push(a),this._crossMinimizer=new Nd(a,i,this._portDistributor,this._currentNodeOrder)}else e===re.MEDIAN?this._crossMinimizer=new Td(i):this._crossMinimizer=new Dd(e,this);s.push(this._crossMinimizer),ud.init(s,this._currentNodeOrder),this._useBottomUp=this._layerSweepTypeDecider.useBottomUp()}dontSweepInto(){return this._useBottomUp}lGraph(){return this._lGraph}currentNodeOrder(){return this._currentNodeOrder}currentlyBestNodeAndPortOrder(){return this._currentlyBestNodeAndPortOrder}setCurrentlyBestNodeAndPortOrder(t){this._currentlyBestNodeAndPortOrder=t}bestNodeNPortOrder(){return this._bestNodeAndPortOrder}setBestNodeNPortOrder(t){this._bestNodeAndPortOrder=t}crossCounter(){return this._crossingsCounter}crossMinimizer(){return this._crossMinimizer}portDistributor(){return this._portDistributor}parent(){return this._parent}hasParent(){return this._hasParent}childGraphs(){return this._childGraphs}hasExternalPorts(){return this._hasExternalPorts}getBestSweep(){return this._crossMinimizer.isDeterministic()?this.currentlyBestNodeAndPortOrder():this.bestNodeNPortOrder()}parentGraphData(){return this._parentGraphData}crossMinDeterministic(){return this._crossMinimizer.isDeterministic()}crossMinAlwaysImproves(){return this._crossMinimizer.alwaysImproves()}portPositions(){return this._portPositions}toString(){return JSON.stringify(this._currentNodeOrder.map(t=>t.map(e=>String(e))))}initAtNodeLevel(t,e,o){let i=o[t][e].getNestedGraph();i!=null&&this._childGraphs.push(i)}initAtPortLevel(t,e,o,r){this._nPorts++}initAfterTraversal(){this._portPositions=new Int32Array(this._nPorts)}};var cl=class n{constructor(t){if(t instanceof n){this._nodeOrder=BP(t._nodeOrder),this._portOrders=t._portOrders.map(o=>o.map(r=>[...r]));return}let e=t;this._nodeOrder=BP(e),this._portOrders=[];for(let o of e){let r=[];this._portOrders.push(r);for(let i of o)r.push([...i.getPorts()])}}nodes(){return this._nodeOrder}transferNodeAndPortOrdersToGraph(t,e){let o=new Set,r=t.getLayers();for(let i=0;i<r.length;i++){let s=r[i].getNodes(),a=[];for(let l=0;l<s.length;l++){let c=this._nodeOrder[i][l];c.id=l,c.getType()===y.NORTH_SOUTH_PORT&&a.push(c),r[i].getNodes()[l]=c,c.getPorts().length=0;for(let g of this._portOrders[i][l])c.getPorts().push(g);if(e){let g=c.getProperty(_.PORT_CONSTRAINTS);(g==null||!g.isOrderFixed||!g.isOrderFixed())&&c.setProperty(_.PORT_CONSTRAINTS,H.FIXED_ORDER)}}for(let l of a){let c=this._assertCorrectPortSides(l);o.add(c),o.add(l)}}for(let i of o)i.getPorts().sort(P_),i.cachePortSides()}_assertCorrectPortSides(t){let e=t.getProperty(p.IN_LAYER_LAYOUT_UNIT);if(e==null)return null;let r=t.getPorts()[0].getProperty(p.ORIGIN);for(let i of e.getPorts())if(i===r){if(i.getSide()===u.NORTH&&t.id>e.id){if(i.setSide(u.SOUTH),i.isExplicitlySuppliedPortAnchor()){let s=i.getSize().y;i.getAnchor().y=s-i.getAnchor().y}}else if(i.getSide()===u.SOUTH&&e.id>t.id&&(i.setSide(u.NORTH),i.isExplicitlySuppliedPortAnchor())){let s=i.getSize().y;i.getAnchor().y=-(s-i.getAnchor().y)}break}return e}};function BP(n){if(n==null)return null;let t=new Array(n.length);for(let e=0;e<t.length;e++)t[e]=n[e].slice();return t}var ci=class{constructor(t){this._crossMinType=t,this._graphInfoHolders=[],this._graphsWhoseNodeOrderChanged=new Set,this._random=null,this._randomSeed=0}getLayoutProcessorConfiguration(t){let e=K.createFrom(MI());return e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}process(t,e){e.begin(`Minimize Crossings ${this._crossMinType}`,1);let o=t.getLayers(),r=o.length===0||o.every(c=>c.getNodes().length===0),i=o.length===1&&o[0].getNodes().length===1,s=t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN;if(r||i&&!s){e.done();return}let a=this._initialize(t),l=this._chooseMinimizingMethod(a);this._minimizeCrossings(a,l),this._transferNodeAndPortOrdersToGraph(),e.done()}_chooseMinimizingMethod(t){let e=t[0];return e.crossMinDeterministic()?e.crossMinAlwaysImproves()?o=>this._minimizeCrossingsNoCounter(o):o=>this._minimizeCrossingsWithCounter(o):o=>this._compareDifferentRandomizedLayouts(o)}_minimizeCrossings(t,e){for(let o of t)o.currentNodeOrder().length>0&&(e(o),o.hasParent()&&this._setPortOrderOnParentGraph(o))}_setPortOrderOnParentGraph(t){if(t.hasExternalPorts()&&t.getBestSweep()!=null){let e=t.getBestSweep();this._sortPortsByDummyPositionsInLastLayer(e.nodes(),t.parent(),!0),this._sortPortsByDummyPositionsInLastLayer(e.nodes(),t.parent(),!1),t.parent().setProperty(_.PORT_CONSTRAINTS,H.FIXED_ORDER)}}_minimizeCrossingsNoCounter(t){let e=this._random.nextBoolean(),o=!0;for(;o;)o=!1,o=t.crossMinimizer().setFirstLayerOrder(t.currentNodeOrder(),e),this._sweepReducingCrossings(t,e,!1)&&(o=!0),e=!e;this._setCurrentlyBestNodeOrders()}_compareDifferentRandomizedLayouts(t){typeof this._random.setSeed=="function"&&this._random.setSeed(this._randomSeed),this._graphsWhoseNodeOrderChanged.clear();let e=t.lGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY);e!=null&&e!==$t.NONE&&t.lGraph().setProperty(p.FIRST_TRY_WITH_INITIAL_ORDER,!0);let o=Number.POSITIVE_INFINITY,r=t.lGraph().getProperty(_.THOROUGHNESS);for(let i=0;i<r;i++){let s=this._minimizeCrossingsWithCounter(t);if(s<o&&(o=s,this._saveAllNodeOrdersOfChangedGraphs(),o===0))break}}_minimizeCrossingsWithCounter(t){let e=this._random.nextBoolean();if(this._countCurrentNumberOfCrossings(t)===0&&t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER))return 0;let r=t.lGraph();!r.getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER)&&!r.getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER)||r.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)==null||r.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)===$t.NONE?t.crossMinimizer().setFirstLayerOrder(t.currentNodeOrder(),e):e=!!r.getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER),this._sweepReducingCrossings(t,e,!0),t.lGraph().getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER)&&t.lGraph().setProperty(p.SECOND_TRY_WITH_INITIAL_ORDER,!1),t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER)&&(t.lGraph().setProperty(p.FIRST_TRY_WITH_INITIAL_ORDER,!1),t.lGraph().setProperty(p.SECOND_TRY_WITH_INITIAL_ORDER,!0));let i=this._countCurrentNumberOfCrossings(t),s;do{if(this._setCurrentlyBestNodeOrders(),i===0)return 0;e=!e,s=i,this._sweepReducingCrossings(t,e,!1),i=this._countCurrentNumberOfCrossings(t)}while(s>i);return s}_countCurrentNumberOfCrossings(t){let e=0,o=[t];for(;o.length>0;){let r=o.pop();e+=r.crossCounter().countAllCrossings(r.currentNodeOrder());for(let i of r.childGraphs()){let s=this._graphInfoHolders[i.id];s.dontSweepInto()||o.push(s)}}return e}_sweepReducingCrossings(t,e,o){let r=t.currentNodeOrder(),i=r.length,s=t.portDistributor().distributePortsWhileSweeping(r,Md(e,i),e),a=r[Md(e,i)];this._sweepInHierarchicalNodes(a,e,o)&&(s=!0);let l=t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER),c=t.lGraph().getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER),g=o&&!l&&!c;for(let h=RI(e,i);LI(i,h,e);h+=UP(e))t.crossMinimizer().minimizeCrossings(r,h,e,g)&&(s=!0),t.portDistributor().distributePortsWhileSweeping(r,h,e)&&(s=!0),this._sweepInHierarchicalNodes(r[h],e,o)&&(s=!0);return this._graphsWhoseNodeOrderChanged.add(t),s}_sweepInHierarchicalNodes(t,e,o){let r=!1;for(let i of t)AI(i)&&!this._graphInfoHolders[i.getNestedGraph().id].dontSweepInto()&&this._sweepInHierarchicalNode(e,i,o)&&(r=!0);return r}_sweepInHierarchicalNode(t,e,o){let r=e.getNestedGraph(),i=this._graphInfoHolders[r.id],s=i.currentNodeOrder(),a=Md(t,s.length),l=s[a][0];FP(l)?s[a]=this._sortPortDummiesByPortPositions(e,s[a],CI(t)):i.crossMinimizer().setFirstLayerOrder(s,t);let c=this._sweepReducingCrossings(i,t,o);return this._sortPortsByDummyPositionsInLastLayer(i.currentNodeOrder(),i.parent(),t),c}_sortPortsByDummyPositionsInLastLayer(t,e,o){let r=II(o,t.length),i=t[r],s=Md(o,i.length);if(!FP(i[s]))return;let a=e.getPorts();for(let l=0;l<a.length;l++){let c=a[l];wI(c,o)&&kP(c)&&(a[l]=xI(i[s]),s+=UP(o))}}_sortPortDummiesByPortPositions(t,e,o){let r=zi(t,o),i=new Array(e.length),s=0;for(let a of r)kP(a)&&(i[s++]=DI(a));if(s<e.length)throw new Error(`Expected ${e.length} hierarchical ports, but found only ${s}.`);return i}_saveAllNodeOrdersOfChangedGraphs(){for(let t of this._graphsWhoseNodeOrderChanged)t.setBestNodeNPortOrder(new cl(t.currentlyBestNodeAndPortOrder()))}_setCurrentlyBestNodeOrders(){for(let t of this._graphsWhoseNodeOrderChanged)t.setCurrentlyBestNodeAndPortOrder(new cl(t.currentNodeOrder()))}_initialize(t){this._graphInfoHolders=[],this._random=t.getProperty(p.RANDOM),this._randomSeed=typeof this._random.nextLong=="function"?this._random.nextLong():0;let e=[],o=[t],r=0;for(;r<o.length;){let i=o[r];i.id=r++;let s=new wd(i,this._crossMinType,this._graphInfoHolders);for(let a of s.childGraphs())o.push(a);this._graphInfoHolders.push(s),s.dontSweepInto()&&e.unshift(s)}return this._graphsWhoseNodeOrderChanged=new Set,e}_transferNodeAndPortOrdersToGraph(){for(let t of this._graphInfoHolders){let e=t.getBestSweep();e!=null&&e.transferNodeAndPortOrdersToGraph(t.lGraph(),!0)}}getGraphData(){return this._graphInfoHolders}};Z(ci,"isHierarchyAware",!0);function Md(n,t){return n?0:t-1}function II(n,t){return n?t-1:0}function RI(n,t){return n?1:t-2}function UP(n){return n?1:-1}function LI(n,t,e){return e?t<n:t>=0}function AI(n){return n.getNestedGraph()!=null}function CI(n){return n?u.WEST:u.EAST}function FP(n){return n.getType()===y.EXTERNAL_PORT}function xI(n){return n.getProperty(p.ORIGIN)}function kP(n){return n.getProperty(p.INSIDE_CONNECTIONS)}function DI(n){return n.getProperty(p.PORT_DUMMY)}function wI(n,t){return t?n.getSide()===u.EAST:n.getSide()===u.WEST}function MI(){return K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER)}var at=class{constructor(t,e,o){this.name=t,this.ordinal=e,this._factory=o,Object.freeze(this)}toString(){return this.name}create(){if(this._factory==null)throw new Error("No implementation available for layout processor "+this.name);return this._factory()}},w=class{},ct=0,gt=w;gt.DIRECTION_PREPROCESSOR=new at("DIRECTION_PREPROCESSOR",ct++,()=>new wn($o.TO_INPUT_DIRECTION));gt.COMMENT_PREPROCESSOR=new at("COMMENT_PREPROCESSOR",ct++,()=>new bg);gt.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER=new at("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER",ct++,()=>new Hg);gt.INTERACTIVE_EXTERNAL_PORT_POSITIONER=new at("INTERACTIVE_EXTERNAL_PORT_POSITIONER",ct++,()=>new ah);gt.PARTITION_PREPROCESSOR=new at("PARTITION_PREPROCESSOR",ct++,()=>new Th);gt.LABEL_DUMMY_INSERTER=new at("LABEL_DUMMY_INSERTER",ct++,()=>new gh);gt.SELF_LOOP_PREPROCESSOR=new at("SELF_LOOP_PREPROCESSOR",ct++,()=>new vh);gt.LAYER_CONSTRAINT_PREPROCESSOR=new at("LAYER_CONSTRAINT_PREPROCESSOR",ct++,()=>new _h);gt.PARTITION_MIDPROCESSOR=new at("PARTITION_MIDPROCESSOR",ct++,()=>new Oh);gt.HIGH_DEGREE_NODE_LAYER_PROCESSOR=new at("HIGH_DEGREE_NODE_LAYER_PROCESSOR",ct++,()=>new oh);gt.NODE_PROMOTION=new at("NODE_PROMOTION",ct++,()=>new Eh);gt.LAYER_CONSTRAINT_POSTPROCESSOR=new at("LAYER_CONSTRAINT_POSTPROCESSOR",ct++,()=>new fh);gt.PARTITION_POSTPROCESSOR=new at("PARTITION_POSTPROCESSOR",ct++,()=>new Sh);gt.HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR=new at("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR",ct++,()=>new $g);gt.SEMI_INTERACTIVE_CROSSMIN_PROCESSOR=new at("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR",ct++,()=>new Kh);gt.BREAKING_POINT_INSERTER=new at("BREAKING_POINT_INSERTER",ct++,()=>new qh);gt.LONG_EDGE_SPLITTER=new at("LONG_EDGE_SPLITTER",ct++,()=>new ri);gt.PORT_SIDE_PROCESSOR=new at("PORT_SIDE_PROCESSOR",ct++,()=>new Un);gt.INVERTED_PORT_PROCESSOR=new at("INVERTED_PORT_PROCESSOR",ct++,()=>new lh);gt.PORT_LIST_SORTER=new at("PORT_LIST_SORTER",ct++,()=>new Ih);gt.SORT_BY_INPUT_ORDER_OF_MODEL=new at("SORT_BY_INPUT_ORDER_OF_MODEL",ct++,()=>new jh);gt.NORTH_SOUTH_PORT_PREPROCESSOR=new at("NORTH_SOUTH_PORT_PREPROCESSOR",ct++,()=>new Ph);gt.BREAKING_POINT_PROCESSOR=new at("BREAKING_POINT_PROCESSOR",ct++,()=>new Qh);gt.ONE_SIDED_GREEDY_SWITCH=new at("ONE_SIDED_GREEDY_SWITCH",ct++,()=>new ci(re.ONE_SIDED_GREEDY_SWITCH));gt.TWO_SIDED_GREEDY_SWITCH=new at("TWO_SIDED_GREEDY_SWITCH",ct++,()=>new ci(re.TWO_SIDED_GREEDY_SWITCH));gt.SELF_LOOP_PORT_RESTORER=new at("SELF_LOOP_PORT_RESTORER",ct++,()=>new xh);gt.ALTERNATING_LAYER_UNZIPPER=new at("ALTERNATING_LAYER_UNZIPPER",ct++,()=>new $h);gt.SINGLE_EDGE_GRAPH_WRAPPER=new at("SINGLE_EDGE_GRAPH_WRAPPER",ct++,()=>new xs);gt.IN_LAYER_CONSTRAINT_PROCESSOR=new at("IN_LAYER_CONSTRAINT_PROCESSOR",ct++,()=>new sh);gt.END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR=new at("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR",ct++,()=>new el(!1));gt.LABEL_AND_NODE_SIZE_PROCESSOR=new at("LABEL_AND_NODE_SIZE_PROCESSOR",ct++,()=>new ch);gt.INNERMOST_NODE_MARGIN_CALCULATOR=new at("INNERMOST_NODE_MARGIN_CALCULATOR",ct++,()=>new nh);gt.SELF_LOOP_ROUTER=new at("SELF_LOOP_ROUTER",ct++,()=>new Xh);gt.COMMENT_NODE_MARGIN_CALCULATOR=new at("COMMENT_NODE_MARGIN_CALCULATOR",ct++,()=>new wg);gt.END_LABEL_PREPROCESSOR=new at("END_LABEL_PREPROCESSOR",ct++,()=>new In);gt.LABEL_DUMMY_SWITCHER=new at("LABEL_DUMMY_SWITCHER",ct++,()=>new tl);gt.CENTER_LABEL_MANAGEMENT_PROCESSOR=new at("CENTER_LABEL_MANAGEMENT_PROCESSOR",ct++,()=>new el(!0));gt.LABEL_SIDE_SELECTOR=new at("LABEL_SIDE_SELECTOR",ct++,()=>new dh);gt.HYPEREDGE_DUMMY_MERGER=new at("HYPEREDGE_DUMMY_MERGER",ct++,()=>new rh);gt.HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR=new at("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR",ct++,()=>new Jg);gt.LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR=new at("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR",ct++,()=>new ph);gt.HIERARCHICAL_PORT_POSITION_PROCESSOR=new at("HIERARCHICAL_PORT_POSITION_PROCESSOR",ct++,()=>new Qg);gt.CONSTRAINTS_POSTPROCESSOR=new at("CONSTRAINTS_POSTPROCESSOR",ct++,()=>new Gg);gt.COMMENT_POSTPROCESSOR=new at("COMMENT_POSTPROCESSOR",ct++,()=>new Mg);gt.HYPERNODE_PROCESSOR=new at("HYPERNODE_PROCESSOR",ct++,()=>new ih);gt.HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER=new at("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER",ct++,()=>new qg);gt.LONG_EDGE_JOINER=new at("LONG_EDGE_JOINER",ct++,()=>new ii);gt.SELF_LOOP_POSTPROCESSOR=new at("SELF_LOOP_POSTPROCESSOR",ct++,()=>new Dh);gt.BREAKING_POINT_REMOVER=new at("BREAKING_POINT_REMOVER",ct++,()=>new td);gt.NORTH_SOUTH_PORT_POSTPROCESSOR=new at("NORTH_SOUTH_PORT_POSTPROCESSOR",ct++,()=>new mh);gt.HORIZONTAL_COMPACTOR=new at("HORIZONTAL_COMPACTOR",ct++,()=>new ke);gt.LABEL_DUMMY_REMOVER=new at("LABEL_DUMMY_REMOVER",ct++,()=>new hh);gt.FINAL_SPLINE_BENDPOINTS_CALCULATOR=new at("FINAL_SPLINE_BENDPOINTS_CALCULATOR",ct++,()=>new Kg);gt.END_LABEL_SORTER=new at("END_LABEL_SORTER",ct++,()=>new Ug);gt.REVERSED_EDGE_RESTORER=new at("REVERSED_EDGE_RESTORER",ct++,()=>new Rh);gt.END_LABEL_POSTPROCESSOR=new at("END_LABEL_POSTPROCESSOR",ct++,()=>new vg);gt.HIERARCHICAL_NODE_RESIZER=new at("HIERARCHICAL_NODE_RESIZER",ct++,()=>new jg);gt.DIRECTION_POSTPROCESSOR=new at("DIRECTION_POSTPROCESSOR",ct++,()=>new wn($o.TO_INTERNAL_LTR));var bd=class n{getLayoutProcessorConfiguration(t){let e=K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER),o=t.getProperty(p.GRAPH_PROPERTIES);return o&&o.has(v.NON_FREE_PORTS)&&e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}process(t,e){e&&e.begin&&e.begin("Interactive crossing minimization",1);let o=0;for(let a of t.getLayers())a.id=o++;let r=t.toNodeArray(),i=new Qn(r.length);ud.init([i],r);let s=0;o=0;for(let a of t.getLayers()){let l=0,c=0;for(let d of a.getNodes()){d.getPosition().x>0&&(l+=d.getPosition().x+d.getSize().x/2,c++);for(let f of d.getPorts())f.id=s++}c>0&&(l/=c);let g=new Array(a.getNodes().length),h=0;for(let d of a.getNodes())d.id=h++,g[d.id]=n._getPos(d,l),d.getType()===y.LONG_EDGE&&d.setProperty(p.ORIGINAL_DUMMY_NODE_POSITION,g[d.id]);a.getNodes().sort((d,f)=>{let E=g[d.id]-g[f.id];if(E!==0)return E;let P=d.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS),S=f.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS);return P&&P.includes(f)?-1:S&&S.includes(d)?1:0}),i.distributePortsWhileSweeping(r,o,!0),o++}e&&e.done&&e.done()}static _getPos(t,e){if(t.getType()===y.LONG_EDGE){let o=t.getProperty(p.ORIGIN),r=o.getProperty(p.ORIGINAL_BENDPOINTS);r==null?r=new st:o.getProperty(p.REVERSED)&&(r=st.reverse(r));let i=t.getProperty(p.LONG_EDGE_SOURCE);if(i!=null){let a=i.getAbsoluteAnchor();if(e<=a.x)return a.y;r.addFirst(a)}let s=t.getProperty(p.LONG_EDGE_TARGET);if(s!=null){let a=s.getAbsoluteAnchor();if(a.x<=e)return a.y;r.addLast(a)}if(r.length>=2){let a=0,l=r[a++],c=r[a++];for(;c.x<e&&a<r.length;)l=c,c=r[a++];return l.y+(e-l.x)/(c.x-l.x)*(c.y-l.y)}}else if(t.getType()===y.NORTH_SOUTH_PORT){let o=t.getPorts()[0].getProperty(p.ORIGIN),r=o.getNode();if(o.getSide()===u.NORTH)return r.getPosition().y;if(o.getSide()===u.SOUTH)return r.getPosition().y+r.getSize().y}return t.getInteractiveReferencePoint().y}};var Gd=class{process(t,e){e.begin("No crossing minimization",1),e.done()}getLayoutProcessorConfiguration(t){let e=K.createFrom(bI);return e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}},bI=K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER);var We=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.LAYER_SWEEP:return new ci(re.BARYCENTER);case n.MEDIAN_LAYER_SWEEP:return new ci(re.MEDIAN);case n.INTERACTIVE:return new bd;case n.NONE:return new Gd;default:throw new Error("Unknown crossing minimization strategy: "+this.name)}}static valueOf(t){return n[t]}};We.LAYER_SWEEP=new We("LAYER_SWEEP");We.MEDIAN_LAYER_SWEEP=new We("MEDIAN_LAYER_SWEEP");We.INTERACTIVE=new We("INTERACTIVE");We.NONE=new We("NONE");var ta=class{constructor(){this._indeg=null,this._outdeg=null,this._mark=null,this._sources=[],this._sinks=[],this.layeredGraph=null,this._random=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Greedy cycle removal",1),this.layeredGraph=t;let o=t.getLayerlessNodes(),r=o.length;this._indeg=new Array(r).fill(0),this._outdeg=new Array(r).fill(0),this._mark=new Array(r).fill(0);let i=0;for(let g of o){g.id=i;for(let h of g.getPorts()){for(let d of h.getIncomingEdges()){if(d.getSource().getNode()===g)continue;let f=d.getProperty(_.PRIORITY_DIRECTION);this._indeg[i]+=f>0?f+1:1}for(let d of h.getOutgoingEdges()){if(d.getTarget().getNode()===g)continue;let f=d.getProperty(_.PRIORITY_DIRECTION);this._outdeg[i]+=f>0?f+1:1}}this._outdeg[i]===0?this._sinks.push(g):this._indeg[i]===0&&this._sources.push(g),i++}let s=-1,a=1,l=[];for(this._random=t.getProperty(p.RANDOM);r>0;){for(;this._sinks.length>0;){let g=this._sinks.shift();this._mark[g.id]=s--,this._updateNeighbors(g),r--}for(;this._sources.length>0;){let g=this._sources.shift();this._mark[g.id]=a++,this._updateNeighbors(g),r--}if(r>0){let g=Number.MIN_SAFE_INTEGER;l.length=0;for(let d of o)if(this._mark[d.id]===0){let f=this._outdeg[d.id]-this._indeg[d.id];f>=g&&(f>g&&(l.length=0,g=f),l.push(d))}let h=this.chooseNodeWithMaxOutflow(l);this._mark[h.id]=a++,this._updateNeighbors(h),r--}}let c=o.length+1;for(let g=0;g<o.length;g++)this._mark[g]<0&&(this._mark[g]+=c);for(let g of o){let h=z.toPortArray(g.getPorts());for(let d of h){let f=z.toEdgeArray(d.getOutgoingEdges());for(let E of f){let P=E.getTarget().getNode().id;this._mark[g.id]>this._mark[P]&&(E.reverse(t,!0),t.setProperty(p.CYCLIC,!0))}}}this._dispose(),e.done()}chooseNodeWithMaxOutflow(t){let e=this._random!=null?this._random.nextInt(t.length):Math.floor(Math.random()*t.length);return t[e]}_dispose(){this._indeg=null,this._outdeg=null,this._mark=null,this._sources.length=0,this._sinks.length=0}_updateNeighbors(t){for(let e of t.getPorts())for(let o of e.getConnectedEdges()){let r=o.getSource()===e?o.getTarget():o.getSource(),i=r.getNode();if(t===i)continue;let s=o.getProperty(_.PRIORITY_DIRECTION);s<0&&(s=0);let a=i.id;this._mark[a]===0&&(o.getTarget()===r?(this._indeg[a]-=s+1,this._indeg[a]<=0&&this._outdeg[a]>0&&this._sources.push(i)):(this._outdeg[a]-=s+1,this._outdeg[a]<=0&&this._indeg[a]>0&&this._sinks.push(i)))}}};var Hd=class{constructor(){this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Depth-first cycle removal",1);let o=t.getLayerlessNodes(),r=o.length;this._sources=[],this._visited=new Array(r).fill(!1),this._active=new Array(r).fill(!1),this._edgesToBeReversed=[];let i=0;for(let s of o){s.id=i;let a=!1;for(let l of s.getIncomingEdges()){a=!0;break}a||this._sources.push(s),i++}for(let s of this._sources)this._dfs(s);for(let s=0;s<r;s++)this._visited[s]||this._dfs(o[s]);for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,e.done()}_dfs(t){if(!this._visited[t.id]){this._visited[t.id]=!0,this._active[t.id]=!0;for(let e of t.getOutgoingEdges()){if(e.isSelfLoop())continue;let o=e.getTarget().getNode();this._active[o.id]?this._edgesToBeReversed.push(e):this._dfs(o)}this._active[t.id]=!1}}};var vd=class{constructor(){this._revEdges=[]}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.INTERACTIVE_EXTERNAL_PORT_POSITIONER).addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Interactive cycle breaking",1);let o=[];for(let r of t.getLayerlessNodes()){r.id=1;let i=r.getInteractiveReferencePoint().x;for(let s of r.getPorts(W.OUTPUT))for(let a of s.getOutgoingEdges()){let l=a.getTarget().getNode();l!==r&&l.getInteractiveReferencePoint().x<i&&o.push(a)}}for(let r of o)r.reverse(t,!0);o.length=0;for(let r of t.getLayerlessNodes())r.id>0&&this._findCycles(r,o);for(let r of o)r.reverse(t,!0);o.length=0,e.done()}_findCycles(t,e){t.id=-1;for(let o of t.getPorts(W.OUTPUT))for(let r of o.getOutgoingEdges()){let i=r.getTarget().getNode();t!==i&&(i.id<0?e.push(r):i.id>0&&this._findCycles(i,e))}t.id=0}};var or=class{constructor(){this._firstSeparateNodes=0,this._lastSeparateNodes=0}computeConstraintModelOrder(t,e){let o=0;switch(t.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST_SEPARATE:o=2*-e+this._firstSeparateNodes,this._firstSeparateNodes++;break;case J.FIRST:o=-e;break;case J.LAST:o=e;break;case J.LAST_SEPARATE:o=2*e+this._lastSeparateNodes,this._lastSeparateNodes++;break;default:break}return t.hasProperty(p.MODEL_ORDER)&&(o+=t.getProperty(p.MODEL_ORDER)),o}computeConstraintGroupModelOrder(t,e,o){let r=0;switch(t.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST_SEPARATE:r=2*-e+this._firstSeparateNodes,this._firstSeparateNodes++;break;case J.FIRST:r=-e;break;case J.LAST:r=e;break;case J.LAST_SEPARATE:r=2*e+this._lastSeparateNodes,this._lastSeparateNodes++;break;default:break}return t.hasProperty(p.MODEL_ORDER)&&(r+=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)*o+t.getProperty(p.MODEL_ORDER)),r}resetInternalCounters(){this._firstSeparateNodes=0,this._lastSeparateNodes=0}};var Bd=class{getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Model order cycle breaking",1);let o=[],r=Math.max(t.getLayerlessNodes().length,t.getProperty(p.MAX_MODEL_ORDER_NODES)),i=r*t.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),s=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;for(let a of t.getLayerlessNodes()){let l=new or,c=s?l.computeConstraintGroupModelOrder(a,i,r):l.computeConstraintModelOrder(a,r);for(let g of a.getPorts(W.OUTPUT))for(let h of g.getOutgoingEdges()){let d=h.getTarget().getNode();(s?l.computeConstraintGroupModelOrder(d,i,r):l.computeConstraintModelOrder(d,r))<c&&o.push(h)}}for(let a of o)a.reverse(t,!0),t.setProperty(p.CYCLIC,!0);o.length=0,e.done()}};var Ud=class extends ta{chooseNodeWithMaxOutflow(t){let e=null,o=Number.MAX_SAFE_INTEGER,r=Math.max(this.layeredGraph.getLayerlessNodes().length,this.layeredGraph.getProperty(p.MAX_MODEL_ORDER_NODES)),i=r*this.layeredGraph.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),s=new or,a=this.layeredGraph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;for(let l of t)if(l.hasProperty(p.MODEL_ORDER)){let c=a?s.computeConstraintGroupModelOrder(l,i,r):s.computeConstraintModelOrder(l,r);o>c&&(o=c,e=l)}return e==null?super.chooseNodeWithMaxOutflow(t):e}};var Fd=class{constructor(t,e,o){this._edgesToBeReversed=t,this.stronglyConnectedComponents=e,this._nodeToSCCID=o,this._index=0,this._stack=[]}tarjan(t){this._index=0,this._stack.length=0;for(let e of t.getLayerlessNodes())e.getProperty(p.TARJAN_ID)===-1&&(this._stronglyConnected(e),this._stack.length=0)}_stronglyConnected(t){t.setProperty(p.TARJAN_ID,this._index),t.setProperty(p.TARJAN_LOWLINK,this._index),this._index++,this._stack.push(t),t.setProperty(p.TARJAN_ON_STACK,!0);for(let e of t.getConnectedEdges()){let o=this._edgesToBeReversed.includes(e);if(e.getSource().getNode()!==t&&!o||e.getSource().getNode()===t&&o)continue;let r=e.getTarget().getNode()===t?e.getSource().getNode():e.getTarget().getNode();r.getProperty(p.TARJAN_ID)===-1?(this._stronglyConnected(r),t.setProperty(p.TARJAN_LOWLINK,Math.min(t.getProperty(p.TARJAN_LOWLINK),r.getProperty(p.TARJAN_LOWLINK)))):r.getProperty(p.TARJAN_ON_STACK)&&t.setProperty(p.TARJAN_LOWLINK,Math.min(t.getProperty(p.TARJAN_LOWLINK),r.getProperty(p.TARJAN_ID)))}if(t.getProperty(p.TARJAN_LOWLINK)===t.getProperty(p.TARJAN_ID)){let e=new Set,o=null;do o=this._stack.pop(),o.setProperty(p.TARJAN_ON_STACK,!1),e.add(o);while(t!==o);if(e.size>1){let r=this.stronglyConnectedComponents.length;this.stronglyConnectedComponents.push(e);for(let i of e)this._nodeToSCCID.set(i,r)}}}resetTarjan(t){for(let e of t.getLayerlessNodes()){e.setProperty(p.TARJAN_ON_STACK,!1),e.setProperty(p.TARJAN_LOWLINK,-1),e.setProperty(p.TARJAN_ID,-1),this._stack.length=0;for(let o of e.getConnectedEdges())o.setProperty(p.IS_PART_OF_CYCLE,!1)}}};var ea=class{constructor(){this.stronglyConnectedComponents=[],this.nodeToSCCID=new Map,this.revEdges=[],this.graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Model order cycle breaking",1),this.graph=t,this.revEdges=[];let o=Math.max(t.getLayerlessNodes().length,t.getProperty(p.MAX_MODEL_ORDER_NODES)),r=o*t.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),i=t.getLayerlessNodes().length*4+16,s=0;for(;;){if(s++>i)throw new Error("SCCModelOrderCycleBreaker: too many iterations \u2014 findNodes() is not breaking SCCs");let a=new Fd(this.revEdges,this.stronglyConnectedComponents,this.nodeToSCCID);if(a.resetTarjan(t),a.tarjan(t),this.stronglyConnectedComponents.length===0)break;this.findNodes(o,r);for(let l of this.revEdges){l.reverse(t,!1);let c=l.getSource().getNode();c.setProperty(_.LAYERING_LAYER_ID,c.getProperty(_.LAYERING_LAYER_ID)+1),t.setProperty(p.CYCLIC,!0)}this.stronglyConnectedComponents.length=0,this.nodeToSCCID.clear(),this.revEdges.length=0}e.done()}findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=null,i=new or,s=Number.MIN_SAFE_INTEGER;for(let a of this.stronglyConnectedComponents[o]){let l=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;if(r==null)r=a,s=l?i.computeConstraintGroupModelOrder(a,e,t):i.computeConstraintModelOrder(a,t);else{let c=l?i.computeConstraintGroupModelOrder(a,e,t):i.computeConstraintModelOrder(a,t);s<c&&(r=a,s=c)}}for(let a of r.getOutgoingEdges())this.stronglyConnectedComponents[o].has(a.getTarget().getNode())&&this.revEdges.push(a)}}};var kd=class extends ea{findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=this.stronglyConnectedComponents[o];if(r.size<=1)continue;let i=null,s=null,a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,g=new or;for(let h of r)if(i==null||s==null)i=h,a=c?g.computeConstraintGroupModelOrder(h,e,t):g.computeConstraintModelOrder(h,t),s=h,l=a;else{let d=c?g.computeConstraintGroupModelOrder(h,e,t):g.computeConstraintModelOrder(h,t);a>d&&(i=h,a=d),l<d&&(s=h,l=d)}if(WP(i.getIncomingEdges())>WP(s.getOutgoingEdges()))for(let h of i.getIncomingEdges())r.has(h.getSource().getNode())&&this.revEdges.push(h);else for(let h of s.getOutgoingEdges())r.has(h.getTarget().getNode())&&this.revEdges.push(h)}}};function WP(n){let t=0;for(let e of n)t++;return t}var Wd=class extends ea{findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=this.stronglyConnectedComponents[o];if(r.size<=1)continue;let i=null,s=null,a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,g=new or;for(let P of r)if(i==null||s==null)i=P,a=c?g.computeConstraintGroupModelOrder(P,e,t):g.computeConstraintModelOrder(P,t),s=P,l=a;else{let S=c?g.computeConstraintGroupModelOrder(P,e,t):g.computeConstraintModelOrder(P,t);a>S&&(i=P,a=S),l<S&&(s=P,l=S)}let h=i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID),d=s.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID),f=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_SOURCE_ID),E=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_TARGET_ID);if(h===f)for(let P of i.getIncomingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else if(d===E)for(let P of s.getOutgoingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else if(zP(i.getIncomingEdges())>zP(s.getOutgoingEdges()))for(let P of i.getIncomingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else for(let P of s.getOutgoingEdges())r.has(P.getTarget().getNode())&&this.revEdges.push(P)}}};function zP(n){let t=0;for(let e of n)t++;return t}var zd=class{constructor(){this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,this._graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Depth-first cycle removal",1),this._graph=t;let o=t.getLayerlessNodes(),r=o.length;this._sources=[],this._visited=new Array(r).fill(!1),this._active=new Array(r).fill(!1),this._edgesToBeReversed=[];let i=0;for(let s of o){s.id=i;let a=!1;for(let l of s.getIncomingEdges()){a=!0;break}a||this._sources.push(s),i++}for(let s of this._sources)this._dfs(s);for(let s=0;s<r;s++)this._visited[s]||this._dfs(o[s]);for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,e.done()}_dfs(t){if(this._visited[t.id])return;this._visited[t.id]=!0,this._active[t.id]=!0;let e=new Map,o=this._graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,r=Number.MAX_SAFE_INTEGER;for(let s of t.getOutgoingEdges()){let a=s.getTarget().getNode();if(!a.hasProperty(p.MODEL_ORDER))e.set(r--,new Set([s]));else{let l;o?l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES)*a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)+a.getProperty(p.MODEL_ORDER):l=a.getProperty(p.MODEL_ORDER);let c=e.get(l);c?c.add(s):e.set(l,new Set([s]))}}let i=[...e.keys()].sort((s,a)=>s-a);for(let s of i){let a=e.get(s),l=a.values().next().value;if(l.isSelfLoop())continue;let c=l.getTarget().getNode();if(this._active[c.id])for(let g of a)this._edgesToBeReversed.push(g);else this._dfs(c)}this._active[t.id]=!1}};var Yd=class{constructor(){this._sources=null,this._sinks=null,this._visited=null,this._bfsQueue=null,this._edgesToBeReversed=null,this._graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Breadth-first cycle removal",1),this._graph=t;let o=t.getLayerlessNodes();this._bfsQueue=[],this._sources=new Set,this._sinks=new Set,this._visited=new Array(o.length).fill(!1),this._edgesToBeReversed=[];let r=0;for(let s of o){s.id=r;let a=!1;for(let c of s.getIncomingEdges()){a=!0;break}a||this._sources.add(s);let l=!1;for(let c of s.getOutgoingEdges()){l=!0;break}l||this._sinks.add(s),r++}for(let s of this._sources)this._bfsQueue.push(s),this._bfsLoop();this._bfsLoop();let i=!0;for(;i;){i=!1;for(let s=0;s<o.length;s++)if(!this._visited[s]){this._bfsQueue.push(o[s]),i=!0;break}this._bfsLoop()}for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._sinks=null,this._visited=null,this._bfsQueue=null,this._edgesToBeReversed=null,e.done()}_bfsLoop(){for(;this._bfsQueue.length>0;)this._bfs(this._bfsQueue.shift())}_bfs(t){if(this._visited[t.id])return;this._visited[t.id]=!0;let e=new Map,o=this._graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,r=Number.MAX_SAFE_INTEGER;for(let s of t.getOutgoingEdges()){let a=s.getTarget().getNode();if(!a.hasProperty(p.MODEL_ORDER))e.set(r--,new Set([s]));else{let l;o?l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES)*a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)+a.getProperty(p.MODEL_ORDER):l=a.getProperty(p.MODEL_ORDER);let c=e.get(l);c?c.add(s):e.set(l,new Set([s]))}}let i=[...e.keys()].sort((s,a)=>s-a);for(let s of i){let a=e.get(s),l=a.values().next().value;if(l.isSelfLoop())continue;let c=l.getTarget().getNode();if(this._visited[c.id]&&!this._sources.has(t)&&!this._sinks.has(c))for(let g of a)this._edgesToBeReversed.push(g);else this._bfsQueue.push(c)}}};var Xt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}create(){switch(this){case n.GREEDY:return new ta;case n.DEPTH_FIRST:return new Hd;case n.INTERACTIVE:return new vd;case n.MODEL_ORDER:return new Bd;case n.GREEDY_MODEL_ORDER:return new Ud;case n.SCC_CONNECTIVITY:return new kd;case n.SCC_NODE_TYPE:return new Wd;case n.DFS_NODE_ORDER:return new zd;case n.BFS_NODE_ORDER:return new Yd;default:throw new Error(`Unknown cycle breaker strategy ${this.name}`)}}toString(){return this.name}static valueOf(t){return n[t]}};Xt.GREEDY=new Xt("GREEDY",0);Xt.DEPTH_FIRST=new Xt("DEPTH_FIRST",1);Xt.INTERACTIVE=new Xt("INTERACTIVE",2);Xt.MODEL_ORDER=new Xt("MODEL_ORDER",3);Xt.GREEDY_MODEL_ORDER=new Xt("GREEDY_MODEL_ORDER",4);Xt.SCC_CONNECTIVITY=new Xt("SCC_CONNECTIVITY",5);Xt.SCC_NODE_TYPE=new Xt("SCC_NODE_TYPE",6);Xt.DFS_NODE_ORDER=new Xt("DFS_NODE_ORDER",7);Xt.BFS_NODE_ORDER=new Xt("BFS_NODE_ORDER",8);var Vd=class{constructor(){this._layeredGraph=null,this._nodeHeights=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Longest path layering",1),this._layeredGraph=t;let o=t.getLayerlessNodes();this._nodeHeights=new Int32Array(o.length);for(let r=0;r<o.length;r++)o[r].id=r,this._nodeHeights[r]=-1;for(let r of o)this._visit(r);o.length=0,this._layeredGraph=null,this._nodeHeights=null,e.done()}_visit(t){let e=this._nodeHeights[t.id];if(e>=0)return e;let o=1;for(let r of t.getPorts())for(let i of r.getOutgoingEdges()){let s=i.getTarget().getNode();if(t!==s){let a=this._visit(s);a+1>o&&(o=a+1)}}return this._putNode(t,o),o}_putNode(t,e){let o=this._layeredGraph.getLayers();for(;o.length<e;)o.unshift(new Et(this._layeredGraph));t.setLayer(o[o.length-e]),this._nodeHeights[t.id]=e}};var Xd=class{constructor(){this._layeredGraph=null,this._nodeHeights=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Longest path to source layering",1),this._layeredGraph=t;let o=t.getLayerlessNodes();this._nodeHeights=new Int32Array(o.length);for(let r=0;r<o.length;r++)o[r].id=r,this._nodeHeights[r]=-1;for(let r of o)this._visit(r);o.length=0,this._layeredGraph=null,this._nodeHeights=null,e.done()}_visit(t){let e=this._nodeHeights[t.id];if(e>=0)return e;let o=1;for(let r of t.getPorts())for(let i of r.getIncomingEdges()){let s=i.getSource().getNode();if(t!==s){let a=this._visit(s);a+1>o&&(o=a+1)}}return this._putNode(t,o),o}_putNode(t,e){let o=this._layeredGraph.getLayers();for(;o.length<e;)o.push(new Et(this._layeredGraph));t.setLayer(o[e-1]),this._nodeHeights[t.id]=e}};var Bo=class extends Error{constructor(t,e){super(t),this.name="UnsupportedGraphException",e&&(this.cause=e)}};var Kd=class{constructor(){this._layeredGraph=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Breadth first model order layering",1),this._layeredGraph=t;let o=[];for(let l of t.getLayerlessNodes())l.getType()===y.NORMAL&&o.push(l);o.sort((l,c)=>{if(l.hasProperty(p.MODEL_ORDER)&&c.hasProperty(p.MODEL_ORDER)){let g=l.getProperty(p.MODEL_ORDER),h=c.getProperty(p.MODEL_ORDER);return g-h}throw new Bo("The BF model order layer assigner requires all real nodes to have a model order.")});let r=!0,i=new Et(t),s=null;t.getLayers().push(i);for(let l of o)if(r)l.setLayer(i),r=!1;else{for(let c of l.getIncomingEdges()){let g=c.getSource().getNode(),h=g.getType()===y.NORMAL&&g.getLayer()===i,d=!1;if(g.getType()===y.LABEL){let f=g.getIncomingEdges().next().value;f!=null&&f.getSource().getNode().getLayer()===i&&(d=!0)}if(h||d){s=new Et(t),t.getLayers().push(s),i=new Et(t),t.getLayers().push(i);break}}for(let c of l.getIncomingEdges()){let g=c.getSource().getNode();g.getType()===y.LABEL&&g.getLayer()==null&&g.setLayer(s)}l.setLayer(i)}t.getLayerlessNodes().length=0;let a=t.getLayers();for(let l=a.length-1;l>=0;l--)a[l].getNodes().length===0&&a.splice(l,1);for(let l=0;l<a.length;l++)a[l].id=l;e.done()}};var Zd=class{getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.INTERACTIVE_EXTERNAL_PORT_POSITIONER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Interactive node layering",1);let o=[];for(let s of t.getLayerlessNodes()){let a=s.getPosition().x,l=Math.max(a+1,a+s.getSize().x),c=null,g=0;for(;g<o.length;){let h=o[g];if(h.start>=l)break;if(h.end>a)if(c==null)h.nodes.push(s),h.start=Math.min(h.start,a),h.end=Math.max(h.end,l),c=h,g++;else{for(let d of h.nodes)c.nodes.push(d);c.end=Math.max(c.end,h.end),o.splice(g,1)}else g++}c==null&&o.splice(g,0,{start:a,end:l,nodes:[s]})}let r=t.getLayers(),i=0;for(let s of o){let a=new Et(t);a.id=i++,r.push(a);for(let l of s.nodes)l.setLayer(a),l.id=0}for(let s of t.getLayerlessNodes())if(s.id===0){let a=this._checkNode(s,t);for(;a.size>0;){let l=a.values().next().value;a.delete(l);let c=this._checkNode(l,t);for(let g of c)a.add(g)}}for(let s=r.length-1;s>=0;s--)r[s].getNodes().length===0&&r.splice(s,1);t.getLayerlessNodes().length=0,e.done()}_checkNode(t,e){t.id=1;let o=t.getLayer(),r=new Set;for(let i of t.getPorts(W.OUTPUT))for(let s of i.getOutgoingEdges()){let a=s.getTarget().getNode();if(t!==a&&a.getLayer().id<=o.id){let c=o.id+1;if(c===e.getLayers().length){let g=new Et(e);g.id=c,e.getLayers().push(g),a.setLayer(g)}else a.setLayer(e.getLayers()[c]);r.add(a)}}return r}};var jd=class{constructor(){this._nodeMark=null,this._edgeMark=null,this._inDeg=null,this._outDeg=null,this._topoOrd=null,this._inTopo=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){if(e.begin("Coffman-Graham Layering",1),t.getLayerlessNodes().length===0){e.done();return}let o=t.getProperty(_.LAYERING_COFFMAN_GRAHAM_LAYER_BOUND),r=0,i=0;for(let d of t.getLayerlessNodes()){d.id=r++;for(let f of d.getOutgoingEdges())f.id=i++}this._nodeMark=new Array(r).fill(!1),this._edgeMark=new Array(i).fill(!1),this._inDeg=new Int32Array(r),this._outDeg=new Int32Array(r),this._topoOrd=new Int32Array(r),this._inTopo=new Map,this._transitiveReduction(t);let s=[];for(let d of t.getLayerlessNodes()){for(let f of d.getIncomingEdges())this._edgeMark[f.id]||this._inDeg[d.id]++;this._inDeg[d.id]===0&&s.push(d)}let a=0;for(;s.length>0;){s.sort((f,E)=>this._compareNodesInTopo(f,E));let d=s.shift();this._topoOrd[d.id]=a++;for(let f of d.getOutgoingEdges()){if(this._edgeMark[f.id])continue;let E=f.getTarget().getNode();this._inDeg[E.id]--,this._pushInTopo(E,this._topoOrd[d.id]),this._inDeg[E.id]===0&&s.push(E)}}let l=[];for(let d of t.getLayerlessNodes()){for(let f of d.getOutgoingEdges())this._edgeMark[f.id]||this._outDeg[d.id]++;this._outDeg[d.id]===0&&l.push(d)}let c=(d,f)=>-(this._topoOrd[d.id]-this._topoOrd[f.id]),g=[],h=this._createLayer(t,g);for(;l.length>0;){l.sort(c);let d=l.shift();(this._isLayerFull(h,o)||!this._canAdd(d,h))&&(h=this._createLayer(t,g)),d.setLayer(h);for(let f of d.getIncomingEdges()){if(this._edgeMark[f.id])continue;let E=f.getSource().getNode();this._outDeg[E.id]--,this._outDeg[E.id]===0&&l.push(E)}}for(let d=g.length-1;d>=0;d--)t.getLayers().push(g[d]);t.getLayerlessNodes().length=0,e.done()}_pushInTopo(t,e){let o=this._inTopo.get(t);o?o.push(e):this._inTopo.set(t,[e])}_isLayerFull(t,e){return t.getNodes().length>=e}_canAdd(t,e){for(let o of t.getOutgoingEdges())if(o.getTarget().getNode().getLayer()===e)return!1;return!0}_createLayer(t,e){let o=new Et(t);return e.push(o),o}_compareNodesInTopo(t,e){let o=this._inTopo.get(t)||[],r=this._inTopo.get(e)||[],i=o.length-1,s=r.length-1;for(;i>=0&&s>=0;){let a=o[i--],l=r[s--];if(a!==l)return a-l}return i<0&&s<0?t.id<e.id?-1:t.id>e.id?1:0:i<0?-1:1}_transitiveReduction(t){for(let e of t.getLayerlessNodes()){this._nodeMark.fill(!1);for(let o of e.getOutgoingEdges())this._dfs(e,o.getTarget().getNode())}}_dfs(t,e){if(!this._nodeMark[e.id]){for(let o of e.getOutgoingEdges()){let r=o.getTarget().getNode();for(let i of r.getIncomingEdges())i.getSource().getNode()===t&&(this._edgeMark[i.id]=!0);this._dfs(t,r)}this._nodeMark[e.id]=!0}}};var $d=class{constructor(){this._layeredGraph=null,this._componentNodes=null,this._nodeVisited=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Network simplex layering",1),this._layeredGraph=t;let o=t.getProperty(_.THOROUGHNESS)*GI,r=t.getLayerlessNodes();if(r.length<1){e.done();return}let i=this._connectedComponents(r),s=null;for(let a of i){let l=o*Math.floor(Math.sqrt(a.length)),c=this._initialize(a);li.forGraph(c).withIterationLimit(l).withPreviousLayering(s).withBalancing(!0).execute(e.subTask(1));let g=t.getLayers();for(let h of c.nodes){for(;g.length<=h.layer;)g.push(new Et(t));h.origin.setLayer(g[h.layer])}if(i.length>1){s=new Array(g.length);for(let h=0;h<g.length;h++)s[h]=g[h].getNodes().length}}r.length=0,this._dispose(),e.done()}_connectedComponents(t){this._nodeVisited==null||this._nodeVisited.length<t.length?this._nodeVisited=new Array(t.length).fill(!1):this._nodeVisited.fill(!1),this._componentNodes=[];for(let o=0;o<t.length;o++)t[o].id=o;let e=[];for(let o of t)this._nodeVisited[o.id]||(this._connectedComponentsDFS(o),e.length===0||e[0].length<this._componentNodes.length?e.unshift(this._componentNodes):e.push(this._componentNodes),this._componentNodes=[]);return e}_connectedComponentsDFS(t){this._nodeVisited[t.id]=!0,this._componentNodes.push(t);for(let e of t.getPorts())for(let o of e.getConnectedEdges()){let r=this._getOpposite(e,o).getNode();this._nodeVisited[r.id]||this._connectedComponentsDFS(r)}}_initialize(t){let e=new Map,o=new Wi;for(let r of t){let i=He.of().origin(r).create(o);e.set(r,i)}for(let r of t)for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;let s=Math.max(1,i.getProperty(_.PRIORITY_SHORTNESS));ee.of(i).weight(s).delta(1).source(e.get(i.getSource().getNode())).target(e.get(i.getTarget().getNode())).create()}return o}_dispose(){this._componentNodes=null,this._layeredGraph=null,this._nodeVisited=null}_getOpposite(t,e){if(e.getSource()===t)return e.getTarget();if(e.getTarget()===t)return e.getSource();throw new Error("Input edge is not connected to the input port.")}},GI=4;var qd=class{constructor(){this._layeredGraph=null,this._currentLayer=null,this._currentLayerId=0,this._currentDummyLayer=null,this._nodesToPlace=null,this._maxToPlace=0}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Depth first model order layering",1),this._layeredGraph=t;let o=[];for(let s of t.getLayerlessNodes())s.getType()===y.NORMAL&&o.push(s);o.sort((s,a)=>{if(s.hasProperty(p.MODEL_ORDER)&&a.hasProperty(p.MODEL_ORDER))return s.getProperty(p.MODEL_ORDER)-a.getProperty(p.MODEL_ORDER);throw new Bo("The DF model order layer assigner requires all real nodes to have a model order.")});let r=!0;this._currentLayer=new Et(t),this._currentDummyLayer=null,t.getLayers().push(this._currentLayer),this._currentLayer.id=0,this._currentLayerId=0,this._nodesToPlace=[];for(let s of o){if(r){s.setLayer(this._currentLayer),r=!1;continue}if(this._isConnectedToCurrentLayer(s)){let a=this._currentLayerId;a=this._getMaxConnectedLayer(a,s);let l=a+2,c=a-this._currentLayerId;if(this._nodesToPlace.length>0)if(c>0){for(let g of this._nodesToPlace)g.id+=a-this._maxToPlace;this._placeNodesToPlace(),this._nodesToPlace.length=0,this._addNodeToLayer(l,s)}else{this._nodesToPlace.push(s),s.id=l,l>this._maxToPlace&&(this._maxToPlace=l);for(let g of s.getIncomingEdges()){let h=g.getSource().getNode();h.getLayer()==null&&h.getType()===y.LABEL&&(this._nodesToPlace.push(h),h.id=l-1)}this._currentLayerId=l}else this._addNodeToLayer(l,s)}else if(this._placeNodesToPlace(),this._nodesToPlace.length=0,s.getIncomingEdges()[Symbol.iterator]().next().done)this._nodesToPlace.push(s),s.id=0,this._maxToPlace<0&&(this._maxToPlace=0),this._currentLayer=t.getLayers()[0],this._currentLayerId=0;else{let c=0;c=this._getMaxConnectedLayer(c,s);let g=c+2;this._addNodeToLayer(g,s)}}this._nodesToPlace.length>0&&this._placeNodesToPlace(),t.getLayerlessNodes().length=0;let i=t.getLayers();for(let s=i.length-1;s>=0;s--)i[s].getNodes().length===0&&i.splice(s,1);for(let s=0;s<i.length;s++)i[s].id=s;e.done()}_isConnectedToCurrentLayer(t){for(let e of t.getIncomingEdges()){let o=e.getSource().getNode(),r,i;if(this._nodesToPlace.length===0){r=o.getType()===y.NORMAL&&o.getLayer()!=null&&o.getLayer().id===this._currentLayerId;let a=o.getIncomingEdges()[Symbol.iterator]().next();if(a.done)i=!1;else{let l=a.value.getSource().getNode().getLayer();i=o.getType()===y.LABEL&&l!=null&&l.id===this._currentLayerId}}else{r=o.getType()===y.NORMAL&&o.id===this._currentLayerId;let a=o.getIncomingEdges()[Symbol.iterator]().next();i=o.getType()===y.LABEL&&!a.done&&a.value.getSource().getNode().id===this._currentLayerId}if(r||i)return!0}return!1}_addNodeToLayer(t,e){let o=this._layeredGraph.getLayers();t<o.length?(this._currentLayer=o[t],this._currentDummyLayer=o[t-1],this._currentLayerId=t):(this._currentDummyLayer=new Et(this._layeredGraph),this._currentDummyLayer.id=t-1,o.push(this._currentDummyLayer),this._currentLayer=new Et(this._layeredGraph),this._currentLayer.id=t,o.push(this._currentLayer),this._currentLayerId=t),e.setLayer(this._currentLayer);for(let r of e.getIncomingEdges()){let i=r.getSource().getNode();i.getLayer()==null&&i.getType()===y.LABEL&&i.setLayer(this._currentDummyLayer)}}_getMaxConnectedLayer(t,e){let o=t;for(let r of e.getIncomingEdges()){let i=r.getSource().getNode();i.getLayer()!=null&&i.getLayer().id>o&&(o=i.getLayer().id)}return o}_placeNodesToPlace(){this._maxToPlace=0;let t=this._layeredGraph.getLayers();for(let e of this._nodesToPlace){if(e.id>=t.length){let o=new Et(this._layeredGraph);o.id=e.id-1,t.push(o);let r=new Et(this._layeredGraph);r.id=e.id,t.push(r)}e.setLayer(t[e.id])}}};var Jd=class{constructor(){this._widthCurrent=0,this._widthUp=0,this._maxWidth=0,this._currentGraph=null,this._upperLayerInfluence=0,this._sortedLayerlessNodes=[],this._alreadyPlacedNodes=new Set,this._alreadyPlacedInOtherLayers=new Set,this._tempLayerlessNodes=[],this._successors=[],this._outDegree=null,this._remainingOutGoing=null,this._inDegree=null,this._selectedNode=null,this._minimumNodeSize=0,this._maximumNodeSize=0,this._normSize=null,this._dummySize=0}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){if(e.begin("StretchWidth layering",1),t.getLayerlessNodes().length===0){e.done();return}this._currentGraph=t,this._widthCurrent=0,this._widthUp=0,this._minimumNodeSize=Number.POSITIVE_INFINITY,this._maximumNodeSize=Number.NEGATIVE_INFINITY,this._dummySize=Number(t.getProperty(_.SPACING_EDGE_EDGE)),this._computeSortedNodes(),this._computeSuccessors(),this._computeDegrees(),this._minMaxNodeSize(),this._computeNormalizedSize(),this._minimumNodeSize=Math.max(1,this._minimumNodeSize),this._maximumNodeSize=Math.max(1,this._maximumNodeSize),this._dummySize/=this._minimumNodeSize,this._maxWidth=this._maximumNodeSize/this._minimumNodeSize,this._upperLayerInfluence=this._getAverageOutDegree();let o=new Et(this._currentGraph);for(this._currentGraph.getLayers().push(o),this._tempLayerlessNodes=this._sortedLayerlessNodes.slice(),this._remainingOutGoing=Int32Array.from(this._outDegree);this._tempLayerlessNodes.length>0;)if(this._selectedNode=this._selectNode(),this._selectedNode==null||this._conditionGoUp()&&this._alreadyPlacedNodes.size>0){this._updateOutGoing(o),o=new Et(this._currentGraph),this._currentGraph.getLayers().push(o);for(let r of this._alreadyPlacedNodes)this._alreadyPlacedInOtherLayers.add(r);this._alreadyPlacedNodes.clear(),this._widthCurrent=this._widthUp,this._widthUp=0}else if(this._conditionGoUp())this._currentGraph.getLayers().length=0,o=new Et(this._currentGraph),this._currentGraph.getLayers().push(o),this._widthCurrent=0,this._widthUp=0,this._alreadyPlacedNodes.clear(),this._alreadyPlacedInOtherLayers.clear(),this._maxWidth++,this._tempLayerlessNodes=this._sortedLayerlessNodes.slice(),this._remainingOutGoing=Int32Array.from(this._outDegree);else{this._selectedNode.setLayer(o);let r=this._tempLayerlessNodes.indexOf(this._selectedNode);r>=0&&this._tempLayerlessNodes.splice(r,1),this._alreadyPlacedNodes.add(this._selectedNode),this._widthCurrent=this._widthCurrent-this._outDegree[this._selectedNode.id]*this._dummySize+this._normSize[this._selectedNode.id],this._widthUp+=this._inDegree[this._selectedNode.id]*this._dummySize}t.getLayerlessNodes().length=0,t.getLayers().reverse(),e.done()}_conditionGoUp(){let t=this._widthCurrent-this._outDegree[this._selectedNode.id]*this._dummySize+this._normSize[this._selectedNode.id]>this._maxWidth,e=this._widthUp+this._inDegree[this._selectedNode.id]*this._dummySize>this._maxWidth*this._upperLayerInfluence*this._dummySize;return t||e}_selectNode(){for(let t of this._tempLayerlessNodes)if(this._remainingOutGoing[t.id]<=0)return t;return null}_computeSortedNodes(){let t=this._currentGraph.getLayerlessNodes();this._sortedLayerlessNodes=t.slice();for(let e of t)e.id=this._getRank(e);this._sortedLayerlessNodes.sort((e,o)=>o.id-e.id)}_getRank(t){let e=gl(t.getOutgoingEdges());for(let o of t.getIncomingEdges()){let r=o.getSource().getNode(),i=gl(r.getOutgoingEdges());i>e&&(e=i)}return e}_computeSuccessors(){let t=0;this._successors=[];let e=new Set;for(let o of this._sortedLayerlessNodes){o.id=t;for(let r of o.getOutgoingEdges())e.add(r.getTarget().getNode());e.delete(o),this._successors.push(new Set(e)),e.clear(),t++}}_computeDegrees(){let t=this._sortedLayerlessNodes.length;this._inDegree=new Int32Array(t),this._outDegree=new Int32Array(t);for(let e of this._sortedLayerlessNodes)this._inDegree[e.id]=gl(e.getIncomingEdges()),this._outDegree[e.id]=gl(e.getOutgoingEdges())}_minMaxNodeSize(){for(let t of this._sortedLayerlessNodes){if(t.getType()!==y.NORMAL)continue;let e=t.getSize().y;e<this._minimumNodeSize&&(this._minimumNodeSize=e),e>this._maximumNodeSize&&(this._maximumNodeSize=e)}}_computeNormalizedSize(){this._normSize=new Float64Array(this._sortedLayerlessNodes.length);for(let t of this._sortedLayerlessNodes)this._normSize[t.id]=t.getSize().y/this._minimumNodeSize}_getAverageOutDegree(){let t=0,e=this._currentGraph.getLayerlessNodes();for(let o of e)t+=gl(o.getOutgoingEdges());return e.length===0?0:t/e.length}_updateOutGoing(t){for(let e of t.getNodes())for(let o of e.getIncomingEdges()){let r=o.getSource().getNode().id;this._remainingOutGoing[r]--}}};function gl(n){let t=0;for(let e of n)t++;return t}var Qd=class{constructor(){this._dummySize=0,this._minimumNodeSize=0,this._normSize=null,this._avgSize=0,this._inDegree=null,this._outDegree=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("MinWidth layering",1);let o=t.getLayers(),r=t.getLayerlessNodes(),i=t.getProperty(_.LAYERING_MIN_WIDTH_UPPER_BOUND_ON_WIDTH),s=t.getProperty(_.LAYERING_MIN_WIDTH_UPPER_LAYER_ESTIMATION_SCALING_FACTOR);this._dummySize=Number(t.getProperty(_.SPACING_EDGE_EDGE)),this._minimumNodeSize=Number.POSITIVE_INFINITY;for(let T of r){if(T.getType()!==y.NORMAL)continue;let N=T.getSize().y;N<this._minimumNodeSize&&(this._minimumNodeSize=N)}this._minimumNodeSize=Math.max(1,this._minimumNodeSize);let a=r.length;this._inDegree=new Int32Array(a),this._outDegree=new Int32Array(a),this._normSize=new Float64Array(a);let l=0;this._avgSize=0;for(let T of r)T.id=l++,this._inDegree[T.id]=this._countEdgesExceptSelfLoops(T.getIncomingEdges()),this._outDegree[T.id]=this._countEdgesExceptSelfLoops(T.getOutgoingEdges()),this._normSize[T.id]=T.getSize().y/this._minimumNodeSize,this._avgSize+=this._normSize[T.id];this._dummySize/=this._minimumNodeSize,a>0&&(this._avgSize/=a);let c=this._precalcSuccessors(r);r.sort((T,N)=>this._outDegree[N.id]-this._outDegree[T.id]);let g=Number.POSITIVE_INFINITY,h=Number.MAX_SAFE_INTEGER,d=null,f=i,E=i,P=s,S=s;i<0&&(f=1,E=4),s<0&&(P=1,S=2);for(let T=f;T<=E;T++)for(let N=P;N<=S;N++){let{width:I,layering:C}=this._computeMinWidthLayering(T,N,r,c),x=C.length;(I<g||I===g&&x<h)&&(g=I,h=x,d=C)}for(let T of d){let N=new Et(t);for(let I of T)I.setLayer(N);o.push(N)}o.reverse(),r.length=0,e.done()}_precalcSuccessors(t){let e=new Array(t.length);for(let o of t){let r=new Set;for(let i of o.getOutgoingEdges())this._isSelfLoop(i)||r.add(i.getTarget().getNode());e[o.id]=r}return e}_computeMinWidthLayering(t,e,o,r){let i=[],s=new Set(o),a=t*this._avgSize,l=new Set,c=new Set,g=[],h=0,d=0,f=0,E=0,P=0,S=0,T=0,N=0;for(;s.size>0;){let I=this._selectNode(s,r,c);if(I!=null&&(s.delete(I),g.push(I),l.add(I),N=this._outDegree[I.id],h+=this._normSize[I.id]-N*this._dummySize,T=this._inDegree[I.id],d+=T*this._dummySize,S+=N*this._dummySize,E+=this._normSize[I.id]),I==null||s.size===0||h>=a&&this._normSize[I.id]>N*this._dummySize||d>=e*a){i.push(g),g=[];for(let M of l)c.add(M);l.clear(),P-=S;let x=P*this._dummySize+E;x>f&&(f=x),P+=d,h=d,d=0,S=0,E=0}}return{width:f,layering:i}}_selectNode(t,e,o){for(let r of t){let i=!0;for(let s of e[r.id])if(!o.has(s)){i=!1;break}if(i)return r}return null}_isSelfLoop(t){return t.getSource().getNode()===t.getTarget().getNode()}_countEdgesExceptSelfLoops(t){let e=0;for(let o of t)this._isSelfLoop(o)||e++;return e}};var le=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}create(){switch(this){case n.NETWORK_SIMPLEX:return new $d;case n.LONGEST_PATH:return new Vd;case n.LONGEST_PATH_SOURCE:return new Xd;case n.COFFMAN_GRAHAM:return new jd;case n.INTERACTIVE:return new Zd;case n.BF_MODEL_ORDER:return new Kd;case n.DF_MODEL_ORDER:return new qd;case n.STRETCH_WIDTH:return new Jd;case n.MIN_WIDTH:return new Qd;default:throw new Error(`Unknown layering strategy ${this.name}`)}}toString(){return this.name}static valueOf(t){return n[t]}};le.NETWORK_SIMPLEX=new le("NETWORK_SIMPLEX",0);le.LONGEST_PATH=new le("LONGEST_PATH",1);le.LONGEST_PATH_SOURCE=new le("LONGEST_PATH_SOURCE",2);le.COFFMAN_GRAHAM=new le("COFFMAN_GRAHAM",3);le.INTERACTIVE=new le("INTERACTIVE",4);le.STRETCH_WIDTH=new le("STRETCH_WIDTH",5);le.MIN_WIDTH=new le("MIN_WIDTH",6);le.BF_MODEL_ORDER=new le("BF_MODEL_ORDER",7);le.DF_MODEL_ORDER=new le("DF_MODEL_ORDER",8);var tf=class{process(t,e){e.begin("Simple node placement",1);let o=t.getProperty(p.SPACINGS),r=0;for(let i of t.getLayers()){let s=i.getSize();s.y=0;let a=null;for(let l of i.getNodes())a!=null&&(s.y+=o.getVerticalSpacing(l,a)),s.y+=l.getMargin().top+l.getSize().y+l.getMargin().bottom,a=l;r=Math.max(r,s.y)}for(let i of t.getLayers()){let s=i.getSize(),a=(r-s.y)/2,l=null;for(let c of i.getNodes())l!=null&&(a+=o.getVerticalSpacing(c,l)),a+=c.getMargin().top,c.getPosition().y=a,a+=c.getSize().y+c.getMargin().bottom,l=c}e.done()}getLayoutProcessorConfiguration(t){return null}};var ef=class{constructor(){this._spacings=null}process(t,e){e.begin("Interactive node placement",1),this._spacings=t.getProperty(p.SPACINGS);for(let o of t)this._placeNodes(o);e.done()}_placeNodes(t){let e=Number.NEGATIVE_INFINITY,o=y.NORMAL;for(let r of t){let i=r.getType();if(i!==y.NORMAL){let a=r.getProperty(p.ORIGINAL_DUMMY_NODE_POSITION);a==null?(e=Math.max(e,0),r.getPosition().y=e+this._spacings.getVerticalSpacing(i,o)):r.getPosition().y=a}let s=this._spacings.getVerticalSpacing(i,o);r.getPosition().y<e+s+r.getMargin().top&&(r.getPosition().y=e+s+r.getMargin().top),e=r.getPosition().y+r.getSize().y+r.getMargin().bottom,o=i}}getLayoutProcessorConfiguration(t){return null}};var of=new m("linearSegments.inputPrio",0),rf=new m("linearSegments.outputPrio",0),HI=20,vI=4,BI=3,UI=1e-4,hl="FORW_PENDULUM",F_="BACKW_PENDULUM",FI="RUBBER",k_=class n{constructor(){this.nodes=[],this.id=0,this.indexInLastLayer=-1,this.lastLayer=-1,this.deflection=0,this.weight=0,this.refSegment=null,this.nodeType=null}region(){let t=this;for(;t.refSegment!=null;)t=t.refSegment;return t}split(t,e){let o=this.nodes.indexOf(t),r=new n;r.id=e;let i=this.nodes.splice(o);for(let s of i)s.id=e,r.nodes.push(s);return r}toString(){return`ls[${this.nodes.map(t=>String(t)).join(",")}]`}},sf=class{constructor(){this.linearSegments=null,this.spacings=null}process(t,e){e.begin("Linear segments node placement",1),this.spacings=t.getProperty(p.SPACINGS),this._sortLinearSegments(t),this._createUnbalancedPlacement(t),this._balancePlacement(t),this._postProcess(t),this.linearSegments=null,this.spacings=null,e.done()}getLayoutProcessorConfiguration(t){return null}_sortLinearSegments(t){for(let d of t)for(let f of d){f.id=-1;let E=Number.MIN_SAFE_INTEGER,P=Number.MIN_SAFE_INTEGER;for(let S of f.getPorts()){for(let T of S.getIncomingEdges()){let N=T.getProperty(_.PRIORITY_STRAIGHTNESS);N>E&&(E=N)}for(let T of S.getOutgoingEdges()){let N=T.getProperty(_.PRIORITY_STRAIGHTNESS);N>P&&(P=N)}}f.setProperty(of,E),f.setProperty(rf,P)}let e=[],o=0;for(let d of t)for(let f of d)if(f.id<0){let E=new k_;E.id=o++,this._fillSegment(f,E),e.push(E)}let r=[],i=[];for(let d=0;d<e.length;d++)r.push([]),i.push(0);this._createDependencyGraphEdges(t,e,r,i);let s=e.slice(),a=r.slice(),l=i.slice(),c=0,g=[];for(let d=0;d<s.length;d++)l[d]===0&&g.push(s[d]);let h=new Int32Array(s.length);for(;g.length>0;){let d=g.shift();for(h[d.id]=c++;a[d.id].length>0;){let f=a[d.id].shift();l[f.id]--,l[f.id]===0&&g.push(f)}}this.linearSegments=new Array(s.length);for(let d=0;d<s.length;d++){let f=s[d],E=h[d];this.linearSegments[E]=f,f.id=E;for(let P of f.nodes)P.id=E}}_createDependencyGraphEdges(t,e,o,r){let i=e.length,s=0;for(let a of t){let l=a.getNodes();if(l.length===0)continue;let c=null,g=0,h=0,d=l[h++];for(;d!=null;){let f=e[d.id];if(f.indexInLastLayer>=0){let P=null;for(let S=g+1;S<l.length;S++){let T=l[S],N=e[T.id];if(N.lastLayer===f.lastLayer&&N.indexInLastLayer<f.indexInLastLayer){P=N;break}}if(P!=null){if(c!=null){r[d.id]=r[d.id]-1;let S=o[c.id],T=S.indexOf(f);T>=0&&S.splice(T,1)}f=f.split(d,i++),e.push(f),o.push([]),c!=null?(o[c.id].push(f),r.push(1)):r.push(0)}}let E=null;if(h<l.length){E=l[h++];let P=e[E.id];o[d.id].push(P),r[E.id]=r[E.id]+1}f.lastLayer=s,f.indexInLastLayer=g++,c=d,d=E}s++}}_fillSegment(t,e){let o=t.getType();if(t.id>=0)return!1;if(t.id=e.id,e.nodes.push(t),e.nodeType=o,o===y.LONG_EDGE||o===y.NORTH_SOUTH_PORT)for(let r of t.getPorts())for(let i of r.getSuccessorPorts()){let s=i.getNode(),a=s.getType();if(t.getLayer()!==s.getLayer()&&(a===y.LONG_EDGE||a===y.NORTH_SOUTH_PORT)&&this._fillSegment(s,e))return!0}return!0}_createUnbalancedPlacement(t){let e=t.getLayers().length,o=new Int32Array(e),r=new Array(e).fill(null);for(let i of this.linearSegments){let s=0;for(let a of i.nodes){let l=a.getLayer().getIndex();o[l]++;let c=t.getProperty(_.SPACING_EDGE_EDGE);o[l]>0&&r[l]!=null&&(c=this.spacings.getVerticalSpacing(r[l],a)),s=Math.max(s,a.getLayer().getSize().y+c)}for(let a of i.nodes){a.getPosition().y=s+a.getMargin().top;let l=a.getLayer();l.getSize().y=s+a.getMargin().top+a.getSize().y+a.getMargin().bottom,r[l.getIndex()]=a}}}_balancePlacement(t){let e=Number(t.getProperty(_.NODE_PLACEMENT_LINEAR_SEGMENTS_DEFLECTION_DAMPENING)),o=t.getProperty(_.THOROUGHNESS),r=vI,i=BI,s=HI/o,a=!1,l=hl,c=Number.MAX_SAFE_INTEGER;do{let g=l!==F_,h=l!==hl,d=0;for(let E of this.linearSegments)E.refSegment=null,this._calcDeflection(E,g,h,e),d+=Math.abs(E.deflection);let f;do f=this._mergeRegions(t);while(f);for(let E of this.linearSegments){let P=E.region().deflection;if(P!==0)for(let S of E.nodes)S.getPosition().y+=P}l===hl||l===F_?(r--,r<=0&&(d<c||-r>o)?(l=FI,c=Number.MAX_SAFE_INTEGER):l===hl?(l=F_,c=d):(l=hl,c=d)):(a=d>=c||c-d<s,c=d,a&&i--)}while(!(a&&i<=0))}_calcDeflection(t,e,o,r){let i=0,s=0;for(let a of t.nodes){let l=0,c=0,g=e?a.getProperty(of):Number.MIN_SAFE_INTEGER,h=o?a.getProperty(rf):Number.MIN_SAFE_INTEGER,d=Math.max(g,h);for(let f of a.getPorts()){let E=a.getPosition().y+f.getPosition().y+f.getAnchor().y;if(o)for(let P of f.getOutgoingEdges()){let S=P.getTarget(),T=S.getNode();if(t!==this.linearSegments[T.id]){let N=Math.max(T.getProperty(of),T.getProperty(rf)),I=P.getProperty(_.PRIORITY_STRAIGHTNESS);I>=d&&I>=N&&(l+=T.getPosition().y+S.getPosition().y+S.getAnchor().y-E,c++)}}if(e)for(let P of f.getIncomingEdges()){let S=P.getSource(),T=S.getNode();if(t!==this.linearSegments[T.id]){let N=Math.max(T.getProperty(of),T.getProperty(rf)),I=P.getProperty(_.PRIORITY_STRAIGHTNESS);I>=d&&I>=N&&(l+=T.getPosition().y+S.getPosition().y+S.getAnchor().y-E,c++)}}}c>0&&(i+=l/c,s++)}s>0?(t.deflection=r*i/s,t.weight=s):(t.deflection=0,t.weight=0)}_mergeRegions(t){let e=!1,o=Number(t.getProperty(_.SPACING_NODE_NODE)),r=UI*o;for(let i of t){let s=i.getNodes();if(s.length===0)continue;let a=s[0],l=this.linearSegments[a.id].region();for(let c=1;c<s.length;c++){let g=s[c],h=this.linearSegments[g.id].region();if(l!==h){let d=this.spacings.getVerticalSpacing(a,g),f=a.getPosition().y+a.getSize().y+a.getMargin().bottom+l.deflection+d,E=g.getPosition().y-g.getMargin().top+h.deflection;if(f>E+r){let P=l.weight+h.weight;h.deflection=(h.weight*h.deflection+l.weight*l.deflection)/P,h.weight=P,l.refSegment=h,e=!0}}a=g,l=h}}return e}_postProcess(t){for(let e of this.linearSegments){let o=Number.MAX_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER;for(let c of e.nodes){let g=c.getIndex(),h;if(g>0){let f=c.getLayer().getNodes()[g-1],E=this.spacings.getVerticalSpacing(c,f);h=c.getPosition().y-c.getMargin().top-(f.getPosition().y+f.getSize().y+f.getMargin().bottom+E)}else h=c.getPosition().y-c.getMargin().top;h<o&&(o=h);let d;if(g<c.getLayer().getNodes().length-1){let f=c.getLayer().getNodes()[g+1],E=this.spacings.getVerticalSpacing(c,f);d=f.getPosition().y-f.getMargin().top-(c.getPosition().y+c.getSize().y+c.getMargin().bottom+E)}else d=2*c.getPosition().y;d<r&&(r=d)}let i=Number.MAX_SAFE_INTEGER,s=!1,a=e.nodes[0];for(let c of a.getPorts()){let g=a.getPosition().y+c.getPosition().y+c.getAnchor().y;for(let h of c.getIncomingEdges()){let d=h.getSource(),f=d.getNode().getPosition().y+d.getPosition().y+d.getAnchor().y-g;Math.abs(f)<Math.abs(i)&&Math.abs(f)<(f<0?o:r)&&(i=f,s=!0)}}let l=e.nodes[e.nodes.length-1];for(let c of l.getPorts()){let g=l.getPosition().y+c.getPosition().y+c.getAnchor().y;for(let h of c.getOutgoingEdges()){let d=h.getTarget(),f=d.getNode().getPosition().y+d.getPosition().y+d.getAnchor().y-g;Math.abs(f)<Math.abs(i)&&Math.abs(f)<(f<0?o:r)&&(i=f,s=!0)}}if(s&&i!==0)for(let c of e.nodes)c.getPosition().y+=i}}};var ye=class n{constructor(t){this.name=t}toString(){return this.name}isFlexibleSize(){return this===n.NODE_SIZE}isFlexibleSizeWhereSpacePermits(){return this===n.NODE_SIZE_WHERE_SPACE_PERMITS||this===n.NODE_SIZE}isFlexiblePorts(){return this===n.PORT_POSITION||this===n.NODE_SIZE_WHERE_SPACE_PERMITS||this===n.NODE_SIZE}isAtLeast(t){switch(this){case n.NODE_SIZE:return t.isFlexibleSize();case n.NODE_SIZE_WHERE_SPACE_PERMITS:return t.isFlexibleSizeWhereSpacePermits();case n.PORT_POSITION:return t.isFlexiblePorts();default:return!0}}static getNodeFlexibility(t){return typeof t.getAllProperties=="function"&&t.getAllProperties().has(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY)?t.getProperty(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY):t.getGraph().getProperty(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY_DEFAULT)}};ye.NONE=new ye("NONE");ye.PORT_POSITION=new ye("PORT_POSITION");ye.NODE_SIZE_WHERE_SPACE_PERMITS=new ye("NODE_SIZE_WHERE_SPACE_PERMITS");ye.NODE_SIZE=new ye("NODE_SIZE");var lf=4,YP=.1,kI=2,VP=1e4,XP=1,WI=1e-5,KP=-1,jP=0,cf=2,gf=class{constructor(){this._lGraph=null,this._spacings=null,this._nGraph=null,this._nodeReps=null,this._edgeReps=null,this._portMap=new Map,this._nodeCount=0,this._edgeCount=0,this._nodeState=null,this._twoPaths=null,this._crossing=null,this._flexibleWhereSpacePermitsEdges=new Set}getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);return e!=null&&e.has(v.EXTERNAL_PORTS)?K.create().addBefore(D.P5_EDGE_ROUTING,w.HIERARCHICAL_PORT_POSITION_PROCESSOR):null}process(t,e){e&&e.begin&&e.begin("Network simplex node placement",1),this._lGraph=t,this._spacings=t.getProperty(p.SPACINGS),this._prepare(),this._buildInitialAuxiliaryGraph(),this._insertNorthSouthAuxiliaryEdges(),this._insertInLayerEdgeAuxiliaryEdges();let o=t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES);o&&this._preferStraightEdges(),this._nGraph.makeConnected();let r=t.getProperty(_.THOROUGHNESS)*this._nGraph.nodes.length;if(li.forGraph(this._nGraph).withIterationLimit(r).withBalancing(!1).execute(ZP(e)),this._flexibleWhereSpacePermitsEdges.size>0){this._insertFlexibleWhereSpaceAuxiliaryEdges();for(let i of this._flexibleWhereSpacePermitsEdges)i.weight=XP;li.forGraph(this._nGraph).withIterationLimit(r).withBalancing(!1).execute(ZP(e))}o&&this._postProcessTwoPaths(),this._applyPositions(),this._cleanup(),e&&e.done&&e.done()}_prepare(){this._nGraph=new Wi;let t=0,e=0;for(let o of this._lGraph.getLayers())for(let r of o.getNodes()){r.id=t++;for(let s of r.getOutgoingEdges())s.id=e++;let i=af(r);for(let s of r.getPorts()){if(i){let l=s.getAnchor().y;if(l!==Math.floor(l)){let c=l-Math.round(l);s.getAnchor().y-=c}}let a=s.getPosition().y+s.getAnchor().y;if(a!==Math.floor(a)){let l=a-Math.round(a);s.getPosition().y-=l}}}this._nodeCount=t,this._edgeCount=e,this._nodeReps=new Array(t),this._edgeReps=new Array(e),this._flexibleWhereSpacePermitsEdges.clear(),this._portMap.clear()}_cleanup(){this._lGraph=null,this._nGraph=null,this._nodeReps=null,this._edgeReps=null,this._portMap.clear(),this._nodeState=null,this._crossing=null,this._twoPaths=null,this._flexibleWhereSpacePermitsEdges.clear()}_buildInitialAuxiliaryGraph(){for(let t of this._lGraph.getLayers())this._transformLayer(t);this._transformEdges()}_transformLayer(t){let e=null;for(let o of t.getNodes()){let r=af(o)?this._transformFixedOrderNode(o):this._transformFixedPosNode(o);if(this._nodeReps[o.id]=r,e!=null){let i=e.origin.getMargin().bottom+this._spacings.getVerticalSpacing(e.origin,o)+o.getMargin().top;e.isFlexible||(i+=e.origin.getSize().y),ee.of().delta(Math.ceil(i)).weight(0).source(e.tail).target(r.head).create()}e=r}}_transformFixedPosNode(t){let e=He.of().origin(t).type("non-flexible").create(this._nGraph);for(let o of t.getPorts())u.SIDES_EAST_WEST.has(o.getSide())&&this._portMap.set(o,e);return new hf(t,!1,e,e)}_transformFixedOrderNode(t){let e=He.of().origin(t).type("flexible-head").create(this._nGraph),o=He.of().origin(t).type("flexible-tail").create(this._nGraph),r=new hf(t,!0,e,o),i=t.getSize().y,s=ye.getNodeFlexibility(t),a=s.isFlexibleSize()?XP:VP,l=ee.of().weight(a).delta(Math.ceil(i)).source(e).target(o).create();s===ye.NODE_SIZE_WHERE_SPACE_PERMITS&&this._flexibleWhereSpacePermitsEdges.add(l);let c=t.getPortSideView(u.WEST);return this._transformPorts([...c].reverse(),r),this._transformPorts(t.getPortSideView(u.EAST),r),r}_transformPorts(t,e){if(t.length===0)return;let o=oo.getIndividualOrDefault(e.origin,_.SPACING_PORT_PORT),r=oo.getIndividualOrDefault(e.origin,_.SPACING_PORTS_SURROUNDING);r==null&&(r=new me);let i=e.head,s=null;for(let a of t){let l=s==null?r.top:o+s.getSize().y,c=He.of().origin(a).type("port").create(this._nGraph);this._portMap.set(a,c),ee.of().weight(0).delta(Math.ceil(l)).source(i).target(c).create(),s=a,i=c}ee.of().weight(0).delta(Math.ceil(r.bottom+s.getSize().y)).source(i).target(e.tail).create()}_transformEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes())for(let o of e.getOutgoingEdges())W_(o)&&this._transformEdge(o)}_transformEdge(t){let e=He.of().type("edge").create(this._nGraph),o=this._nodeReps[t.getSource().getNode().id],r=this._nodeReps[t.getTarget().getNode().id],i=t.getSource(),s=t.getTarget(),a=i.getAnchor().y,l=s.getAnchor().y;o.isFlexible||(a+=i.getPosition().y),r.isFlexible||(l+=s.getPosition().y);let c=Math.max(0,a-l),g=Math.max(0,l-a),h=this._getEdgeWeight(t),d=ee.of(t).weight(h).delta(g).source(e).target(this._portMap.get(t.getSource())).create(),f=ee.of(t).weight(h).delta(c).source(e).target(this._portMap.get(t.getTarget())).create();this._edgeReps[t.id]=new Y_(t,e,d,f)}_insertInLayerEdgeAuxiliaryEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes())if(e.getType()===y.NORMAL)for(let o of e.getConnectedEdges()){if(!o.isInLayerEdge())continue;let i=o.getSource().getNode().getType()!==y.NORMAL?o.getTarget():o.getSource(),s=o.getOther(i).getNode(),a=this._portMap.get(i),l=this._nodeReps[s.id].head,c,g;i.getNode().getIndex()<s.getIndex()?(c=a,g=l):(c=l,g=a),ee.of().delta(0).weight(lf).source(c).target(g).create()}}_insertNorthSouthAuxiliaryEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes()){for(let o of e.getPortSideView(u.SOUTH)){let r=o.getProperty(p.PORT_DUMMY);r!=null&&ee.of().delta(0).weight(YP).source(this._nodeReps[e.id].tail).target(this._nodeReps[r.id].head).create()}for(let o of e.getPortSideView(u.NORTH)){let r=o.getProperty(p.PORT_DUMMY);r!=null&&ee.of().delta(0).weight(YP).source(this._nodeReps[r.id].tail).target(this._nodeReps[e.id].head).create()}}}_insertFlexibleWhereSpaceAuxiliaryEdges(){let t=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;for(let s of this._nGraph.nodes)s.layer<t&&(t=s.layer),s.layer>e&&(e=s.layer);let o=e-t,r=He.of().create(this._nGraph),i=He.of().create(this._nGraph);ee.of().weight(VP*2).delta(o).source(r).target(i).create();for(let s of this._nodeReps)s.origin.getType()===y.NORMAL&&(s.origin.getPorts().length<=1||(ee.of().weight(0).delta(s.tail.layer-t).source(r).target(s.tail).create(),ee.of().weight(0).delta(o-s.head.layer).source(s.head).target(i).create()))}_applyPositions(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes()){let o=this._nodeReps[e.id],r=o.head.layer,i=o.tail.layer;e.getPosition().y=r;let s=i-r-e.getSize().y,a=af(e),l=ye.getNodeFlexibility(e);if(a&&l.isFlexibleSizeWhereSpacePermits()&&(e.getSize().y+=s),a&&l.isFlexiblePorts()){for(let c of e.getPorts())if(u.SIDES_EAST_WEST.has(c.getSide())){let g=this._portMap.get(c);c.getPosition().y=g.layer-r}for(let c of e.getLabels())zI(e,c,s);if(l.isFlexibleSizeWhereSpacePermits())for(let c of e.getPortSideView(u.SOUTH))c.getPosition().y+=s}}}_getEdgeWeight(t){let e=Math.max(1,t.getProperty(_.PRIORITY_STRAIGHTNESS)),o=z_(t.getSource().getNode().getType(),t.getTarget().getNode().getType());return e*o}_preferStraightEdges(){this._nodeState=new Array(this._nodeCount).fill(jP),this._twoPaths=[];for(let e of this._lGraph.getLayers())for(let o of e.getNodes())this._nodeState[o.id]=YI(o);this._markEdgeCrossings();let t=this._identifyPaths();for(let e of t){if(e.length<=1)continue;if(e.length===2){VI(e),af(e[0].getTarget().getNode())||this._twoPaths.push(e);continue}if(XI(e)||KI(e))continue;let o=null;for(let r=0;r<e.length;r++){let i=e[r],s=this._edgeReps[i.id],a;o==null||r===e.length-1?a=z_(y.NORMAL,y.LONG_EDGE):a=z_(y.LONG_EDGE,y.LONG_EDGE),a*=kI,s.left.weight=Math.max(s.left.weight,a),s.right.weight=Math.max(s.right.weight,a),o=i}}}_postProcessTwoPaths(){let t=[...this._twoPaths],e=[];for(;t.length>0;){let o=t.shift();this._improveTwoPath(o,!0)&&e.push(o)}for(;e.length>0;){let o=e.pop();this._improveTwoPath(o,!1)}}_improveTwoPath(t,e){let o=this._edgeReps[t[0].id],r=this._edgeReps[t[1].id];if(o.isStraight()&&r.isStraight())return!1;let i=o.right.target.origin;if(i==null||typeof i.getLayer!="function")return!1;let s=i,a=this._nodeReps[s.id],l=s.getIndex(),c=Number.POSITIVE_INFINITY;if(l>0){let C=s.getLayer().getNodes()[l-1],x=this._nodeReps[C.id],M=Math.ceil(this._spacings.getVerticalSpacing(C,s));c=a.head.layer-s.getMargin().top-(x.head.layer+C.getSize().y+C.getMargin().bottom)-M}let g=Number.POSITIVE_INFINITY;if(l<s.getLayer().getNodes().length-1){let C=s.getLayer().getNodes()[l+1],x=this._nodeReps[C.id],M=Math.ceil(this._spacings.getVerticalSpacing(C,s));g=x.head.layer-C.getMargin().top-(a.head.layer+s.getSize().y+s.getMargin().bottom)-M}if(e&&Math.abs(c-g)<WI)return!0;let h=+nf(o.left),d=-nf(o.right),f=-nf(r.left),E=+nf(r.right),P=o.notStraightBy()>0&&r.notStraightBy()<0,S=o.notStraightBy()<0&&r.notStraightBy()>0,T=o.left.target.layer+o.right.delta<r.right.target.layer+r.left.delta,N=o.left.target.layer+o.right.delta>r.right.target.layer+r.left.delta,I=0;return!P&&!S&&(N?c+f>0?I=f:g-h>0&&(I=h):T&&(c+d>0?I=d:g-E>0&&(I=E))),a.head.layer+=I,a.isFlexible&&(a.tail.layer+=I),!1}_identifyPaths(){let t=[];for(let e of this._lGraph.getLayers())for(let o of e.getNodes())if(this._nodeState[o.id]===cf)for(let r of o.getConnectedEdges()){if(!W_(r))continue;let i=this._follow(r,o,[]);i.length>1&&t.push(i)}return t}_follow(t,e,o){let r=t.getOther(e);if(o.push(t),this._nodeState[r.id]===KP||this._nodeState[r.id]===cf||this._crossing[t.id])return o;this._nodeState[r.id]=KP;for(let i of r.getConnectedEdges())if(!(!W_(i)||i===t))return this._follow(i,r,o);return o}_markEdgeCrossings(){this._crossing=new Array(this._edgeCount).fill(!1);let t=this._lGraph.getLayers();for(let e=0;e+1<t.length;e++)this._markCrossingEdges(t[e],t[e+1])}_markCrossingEdges(t,e){let o=[];for(let i of t.getNodes())for(let s of i.getPortSideView(u.EAST))for(let a of s.getOutgoingEdges())a.isInLayerEdge()||a.isSelfLoop()||a.getTarget().getNode().getLayer()!==e||o.push(a);let r=[...e.getNodes()].reverse();for(let i of r)for(let s of i.getPortSideView(u.WEST))for(let a of s.getIncomingEdges()){if(a.isInLayerEdge()||a.isSelfLoop()||a.getSource().getNode().getLayer()!==t||o.length===0)continue;let l=o.length-1;for(;l>=0&&o[l]!==a;)this._crossing[o[l].id]=!0,this._crossing[a.id]=!0,l--;l>=0&&o.splice(l,1)}}};function ZP(n){return n&&typeof n.subTask=="function"?n.subTask(1):n}function W_(n){return!n.isSelfLoop()&&!n.isInLayerEdge()}function z_(n,t){return n===y.NORMAL&&t===y.NORMAL?1*lf:n===y.NORMAL||t===y.NORMAL?2*lf:8*lf}function nf(n){return Math.abs(n.source.layer-n.target.layer)-n.delta}function zI(n,t,e){let o=n.getProperty(_.NODE_LABELS_PLACEMENT);o!=null&&(o.has&&o.has(k.V_BOTTOM)?t.getPosition().y+=e:o.has&&o.has(k.V_CENTER)&&(t.getPosition().y+=e/2))}function YI(n){let t=0,e=0;for(let o of n.getPorts()){for(let r of o.getIncomingEdges())r.isSelfLoop()||t++;for(let r of o.getOutgoingEdges())r.isSelfLoop()||e++;if(t>1||e>1)return cf}return t+e===1?cf:jP}function VI(n){let t=n[0],e=n[1];t.getTarget().getNode()!==e.getSource().getNode()&&(n[0]=e,n[1]=t)}function XI(n){if(n.length===0)return!1;if(n[0].getSource().getNode().getType()===y.LONG_EDGE)return!0;for(let t of n)if(t.getTarget().getNode().getType()===y.LONG_EDGE)return!0;return!1}function KI(n){if(n.length===0)return!1;if(ye.getNodeFlexibility(n[0].getSource().getNode()).isFlexibleSizeWhereSpacePermits())return!0;for(let e of n)if(ye.getNodeFlexibility(e.getTarget().getNode()).isFlexibleSizeWhereSpacePermits())return!0;return!1}function af(n){if(n.getType()!==y.NORMAL||n.getPorts().length<=1)return!1;let t=n.getProperty(_.PORT_CONSTRAINTS);if(t!=null&&typeof t.isPosFixed=="function"&&t.isPosFixed())return!1;let e=ye.getNodeFlexibility(n);if(e===ye.NONE)return!1;if(!e.isFlexibleSizeWhereSpacePermits()){let o=oo.getIndividualOrDefault(n,_.SPACING_PORT_PORT),r=n.getProperty(_.SPACING_PORTS_SURROUNDING);r==null&&(r=new me(o,o,o,o));let i=n.getPortSideView(u.WEST);if(r.top+r.bottom+(i.length-1)*o>n.getSize().y)return!1;let a=n.getPortSideView(u.EAST);if(r.top+r.bottom+(a.length-1)*o>n.getSize().y)return!1}return!0}var hf=class{constructor(t,e,o,r){this.origin=t,this.isFlexible=e,this.head=o,this.tail=r}},Y_=class{constructor(t,e,o,r){this.origin=t,this.left=o,this.right=r}isStraight(){return this.notStraightBy()===0}notStraightBy(){return this.left.target.layer-this.left.delta-(this.right.target.layer-this.right.delta)}};var rr=class{constructor(t,e,o,r){this.layeredGraph=t,this.spacings=t.getProperty(p.SPACINGS),this.root=new Array(e),this.blockSize=new Array(e),this.align=new Array(e),this.innerShift=new Array(e),this.sink=new Array(e),this.shift=new Array(e),this.y=new Array(e),this.su=new Array(e).fill(!1),this.od=new Array(e).fill(!0),this.vdir=o,this.hdir=r}cleanup(){this.root=null,this.blockSize=null,this.align=null,this.innerShift=null,this.sink=null,this.shift=null,this.y=null}layoutSize(){let t=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;for(let o of this.layeredGraph.getLayers())for(let r of o.getNodes()){let i=this.y[r.id],s=i+this.blockSize[this.root[r.id].id];i<t&&(t=i),s>e&&(e=s)}return e-t}calculateDelta(t,e){let o=this.y[t.getNode().id]+this.innerShift[t.getNode().id]+t.getPosition().y+t.getAnchor().y;return this.y[e.getNode().id]+this.innerShift[e.getNode().id]+e.getPosition().y+e.getAnchor().y-o}shiftBlock(t,e){let o=t;do this.y[o.id]=this.y[o.id]+e,o=this.align[o.id];while(o!==t)}checkSpaceAbove(t,e,o){let r=e,i=t,s=i;do{s=this.align[s.id];let a=this.getMinY(s),l=this._getUpperNeighbor(s,o);if(l!=null){let c=this.getMaxY(l),g=a-(c+this.spacings.getVerticalSpacing(s,l));g<r&&(r=g)}}while(i!==s);return r}checkSpaceBelow(t,e,o){let r=e,i=t,s=i;do{s=this.align[s.id];let a=this.getMaxY(s),l=this._getLowerNeighbor(s,o);if(l!=null){let g=this.getMinY(l)-(a+this.spacings.getVerticalSpacing(s,l));g<r&&(r=g)}}while(i!==s);return r}getMinY(t){let e=this.root[t.id];return this.y[e.id]+this.innerShift[t.id]-t.getMargin().top}getMaxY(t){let e=this.root[t.id];return this.y[e.id]+this.innerShift[t.id]+t.getSize().y+t.getMargin().bottom}_getLowerNeighbor(t,e){let o=t.getLayer(),r=e.nodeIndex[t.id];return r<o.getNodes().length-1?o.getNodes()[r+1]:null}_getUpperNeighbor(t,e){let o=t.getLayer(),r=e.nodeIndex[t.id];return r>0?o.getNodes()[r-1]:null}toString(){let t="";return this.hdir===Zt.RIGHT?t+="RIGHT":this.hdir===Zt.LEFT&&(t+="LEFT"),this.vdir===xt.DOWN?t+="DOWN":this.vdir===xt.UP?t+="UP":t+="BALANCED",t}},xt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};xt.DOWN=new xt("DOWN");xt.UP=new xt("UP");var Zt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Zt.RIGHT=new Zt("RIGHT");Zt.LEFT=new Zt("LEFT");function $P(n,t){for(let e of n.getConnectedEdges())if(e.getTarget().getNode()===t||e.getSource().getNode()===t)return e;return null}function V_(n){let t=new Map;for(let e of n.layeredGraph.getLayers())for(let o of e.getNodes()){let r=n.root[o.id],i=t.get(r);i==null&&(i=[],t.set(r,i)),i.push(o)}return t}var df=class{constructor(t,e){this.layeredGraph=t,this.ni=e}verticalAlignment(t,e){for(let r of this.layeredGraph.getLayers())for(let i of r.getNodes())t.root[i.id]=i,t.align[i.id]=i,t.innerShift[i.id]=0;let o=this.layeredGraph.getLayers();t.hdir===Zt.LEFT&&(o=[...o].reverse());for(let r of o){let i=-1,s=r.getNodes();t.vdir===xt.UP&&(i=Number.MAX_SAFE_INTEGER,s=[...s].reverse());for(let a of s){let l=t.hdir===Zt.LEFT?this.ni.rightNeighbors[a.id]:this.ni.leftNeighbors[a.id];if(l.length===0)continue;let c=l.length,g=Math.floor((c+1)/2)-1,h=Math.ceil((c+1)/2)-1;if(t.vdir===xt.UP){for(let d=h;d>=g;d--)if(t.align[a.id]===a){let f=l[d],E=f.getFirst();!e.has(f.getSecond())&&i>this.ni.nodeIndex[E.id]&&(t.align[E.id]=a,t.root[a.id]=t.root[E.id],t.align[a.id]=t.root[a.id],t.od[t.root[a.id].id]=t.od[t.root[a.id].id]&&a.getType()===y.LONG_EDGE,i=this.ni.nodeIndex[E.id])}}else for(let d=g;d<=h;d++)if(t.align[a.id]===a){let f=l[d],E=f.getFirst();!e.has(f.getSecond())&&i<this.ni.nodeIndex[E.id]&&(t.align[E.id]=a,t.root[a.id]=t.root[E.id],t.align[a.id]=t.root[a.id],t.od[t.root[a.id].id]=t.od[t.root[a.id].id]&&a.getType()===y.LONG_EDGE,i=this.ni.nodeIndex[E.id])}}}}insideBlockShift(t){let e=V_(t);for(let o of e.keys()){let r=o.getMargin().top,i=o.getSize().y+o.getMargin().bottom;t.innerShift[o.id]=0;let s=o,a;for(;(a=t.align[s.id])!==o;){let l=$P(s,a),c;t.hdir===Zt.LEFT?c=l.getTarget().getPosition().y+l.getTarget().getAnchor().y-l.getSource().getPosition().y-l.getSource().getAnchor().y:c=l.getSource().getPosition().y+l.getSource().getAnchor().y-l.getTarget().getPosition().y-l.getTarget().getAnchor().y;let g=t.innerShift[s.id]+c;t.innerShift[a.id]=g,r=Math.max(r,a.getMargin().top-g),i=Math.max(i,g+a.getSize().y+a.getMargin().bottom),s=a}s=o;do t.innerShift[s.id]=t.innerShift[s.id]+r,s=t.align[s.id];while(s!==o);t.blockSize[o.id]=r+i}}};var oa=Object.freeze({NONE:"NONE",IMPROVE_STRAIGHTNESS:"IMPROVE_STRAIGHTNESS",values(){return[this.NONE,this.IMPROVE_STRAIGHTNESS]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var qP=Number.MAX_VALUE;var ff=class{constructor(){this.bal=null,this.ni=null,this.blockFinished=new Set,this.postProcessablesQueue=[],this.postProcessablesStack=[]}init(t,e){this.bal=t,this.ni=e,this.blockFinished.clear(),this.postProcessablesQueue.length=0,this.postProcessablesStack.length=0}finishBlock(t){this.blockFinished.add(t)}calculateThreshold(t,e,o){throw new Error("abstract")}postProcess(){throw new Error("abstract")}getOther(t,e){if(t.getSource().getNode()===e)return t.getTarget().getNode();if(t.getTarget().getNode()===e)return t.getSource().getNode();throw new Error(`Node ${e} is neither source nor target of edge ${t}`)}},uf=class extends ff{calculateThreshold(t,e,o){return this.bal.vdir===xt.UP?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY}postProcess(){}},_f=class extends ff{calculateThreshold(t,e,o){let r=e===o,i=this.bal.align[o.id]===e;if(!(r||i))return t;let s=t;return r&&(s=this._getBound(e,!0)),!isFinite(s)&&i&&(s=this._getBound(o,!1)),s}_pickEdge(t){let e;t.isRoot?e=this.bal.hdir===Zt.RIGHT?t.free.getIncomingEdges():t.free.getOutgoingEdges():e=this.bal.hdir===Zt.LEFT?t.free.getIncomingEdges():t.free.getOutgoingEdges();let o=!1;for(let r of e)if(!(!this.bal.od[this.bal.root[t.free.id].id]&&r.isInLayerEdge())&&!this.bal.su[this.bal.root[t.free.id].id]&&(o=!0,this.blockFinished.has(this.bal.root[this.getOther(r,t.free).id])))return t.hasEdges=!0,t.edge=r,t;return t.hasEdges=o,t.edge=null,t}_getBound(t,e){let o=this.bal.vdir===xt.UP?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,r=this._pickEdge(new X_(t,e));if(r.edge==null&&r.hasEdges)return this.postProcessablesQueue.push(r),o;if(r.edge==null)return o;let i=r.edge.getSource(),s=r.edge.getTarget(),a;if(e){let l=this.bal.hdir===Zt.RIGHT?s:i,c=this.bal.hdir===Zt.RIGHT?i:s,g=this.bal.root[c.getNode().id];a=this.bal.y[g.id]+this.bal.innerShift[c.getNode().id]+c.getPosition().y+c.getAnchor().y-this.bal.innerShift[l.getNode().id]-l.getPosition().y-l.getAnchor().y}else{let l=this.bal.hdir===Zt.LEFT?s:i,c=this.bal.hdir===Zt.LEFT?i:s;a=this.bal.y[this.bal.root[c.getNode().id].id]+this.bal.innerShift[c.getNode().id]+c.getPosition().y+c.getAnchor().y-this.bal.innerShift[l.getNode().id]-l.getPosition().y-l.getAnchor().y}return this.bal.su[this.bal.root[i.getNode().id].id]=!0,this.bal.su[this.bal.root[s.getNode().id].id]=!0,a}postProcess(){for(;this.postProcessablesQueue.length>0;){let t=this.postProcessablesQueue.shift(),e=this._pickEdge(t);if(e.edge==null)continue;let o=e.edge;if(!this.bal.od[this.bal.root[t.free.id].id]&&o.isInLayerEdge())continue;this._process(t)||this.postProcessablesStack.push(t)}for(;this.postProcessablesStack.length>0;)this._process(this.postProcessablesStack.pop())}_process(t){let e=t.edge,o=e.getSource().getNode()===t.free?e.getTarget():e.getSource(),r=e.getSource().getNode()===t.free?e.getSource():e.getTarget(),i=this.bal.calculateDelta(o,r);if(i>0&&i<qP){let s=this.bal.checkSpaceAbove(r.getNode(),i,this.ni);return this.bal.shiftBlock(r.getNode(),-s),s>0}if(i<0&&-i<qP){let s=this.bal.checkSpaceBelow(r.getNode(),-i,this.ni);return this.bal.shiftBlock(r.getNode(),s),s>0}return!1}},X_=class{constructor(t,e){this.free=t,this.isRoot=e,this.hasEdges=!1,this.edge=null}};var pf=class{constructor(t,e){this.layeredGraph=t,this.ni=e,this.spacings=t.getProperty(p.SPACINGS),this.sinkNodes=new Map,t.getProperty(_.NODE_PLACEMENT_BK_EDGE_STRAIGHTENING)===oa.IMPROVE_STRAIGHTNESS?this.threshStrategy=new _f:this.threshStrategy=new uf}horizontalCompaction(t){for(let o of this.layeredGraph.getLayers())for(let r of o.getNodes())t.sink[r.id]=r,t.shift[r.id]=t.vdir===xt.UP?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;this.sinkNodes.clear();let e=this.layeredGraph.getLayers();t.hdir===Zt.LEFT&&(e=[...e].reverse()),this.threshStrategy.init(t,this.ni),t.y.fill(null);for(let o of e){let r=o.getNodes();t.vdir===xt.UP&&(r=[...r].reverse());for(let i of r)t.root[i.id]===i&&this._placeBlock(i,t)}this._placeClasses(t);for(let o of e)for(let r of o.getNodes())if(t.y[r.id]=t.y[t.root[r.id].id],r===t.root[r.id]){let i=t.shift[t.sink[r.id].id];(t.vdir===xt.UP&&i>Number.NEGATIVE_INFINITY||t.vdir===xt.DOWN&&i<Number.POSITIVE_INFINITY)&&(t.y[r.id]=t.y[r.id]+i)}this.threshStrategy.postProcess()}_placeBlock(t,e){if(e.y[t.id]!=null)return;let o=!0;e.y[t.id]=0;let r=t,i=e.vdir===xt.DOWN?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;do{let s=this.ni.nodeIndex[r.id],a=r.getLayer().getNodes().length;if(e.vdir===xt.DOWN&&s>0||e.vdir===xt.UP&&s<a-1){let c=e.vdir===xt.UP?s+1:s-1,g=r.getLayer().getNodes()[c],h=e.root[g.id];if(this._placeBlock(h,e),i=this.threshStrategy.calculateThreshold(i,t,r),e.sink[t.id]===t&&(e.sink[t.id]=e.sink[h.id]),e.sink[t.id]===e.sink[h.id]){let d=this.spacings.getVerticalSpacing(r,g);if(e.vdir===xt.UP){let f=e.y[t.id],E=e.y[h.id]+e.innerShift[g.id]-g.getMargin().top-d-r.getMargin().bottom-r.getSize().y-e.innerShift[r.id];o?(o=!1,e.y[t.id]=Math.min(E,i)):e.y[t.id]=Math.min(f,Math.min(E,i))}else{let f=e.y[t.id],E=e.y[h.id]+e.innerShift[g.id]+g.getSize().y+g.getMargin().bottom+d+r.getMargin().top-e.innerShift[r.id];o?(o=!1,e.y[t.id]=Math.max(E,i)):e.y[t.id]=Math.max(f,Math.max(E,i))}}else{let d=Number(this.layeredGraph.getProperty(_.SPACING_NODE_NODE)),f=this._getOrCreateClassNode(e.sink[t.id]),E=this._getOrCreateClassNode(e.sink[h.id]);if(e.vdir===xt.UP){let P=e.y[t.id]+e.innerShift[r.id]+r.getSize().y+r.getMargin().bottom+d-(e.y[h.id]+e.innerShift[g.id]-g.getMargin().top);f.addEdge(E,P)}else{let P=e.y[t.id]+e.innerShift[r.id]-r.getMargin().top-e.y[h.id]-e.innerShift[g.id]-g.getSize().y-g.getMargin().bottom-d;f.addEdge(E,P)}}}else i=this.threshStrategy.calculateThreshold(i,t,r);r=e.align[r.id]}while(r!==t);this.threshStrategy.finishBlock(t)}_placeClasses(t){let e=[];for(let o of this.sinkNodes.values())o.indegree===0&&e.push(o);for(;e.length>0;){let o=e.shift();o.classShift==null&&(o.classShift=0);for(let r of o.outgoing)r.target.classShift==null?r.target.classShift=o.classShift+r.separation:t.vdir===xt.DOWN?r.target.classShift=Math.min(r.target.classShift,o.classShift+r.separation):r.target.classShift=Math.max(r.target.classShift,o.classShift+r.separation),r.target.indegree--,r.target.indegree===0&&e.push(r.target)}for(let o of this.sinkNodes.values())t.shift[o.node.id]=o.classShift}_getOrCreateClassNode(t){let e=this.sinkNodes.get(t);return e==null&&(e=new K_,e.node=t,this.sinkNodes.set(t,e)),e}},K_=class{constructor(){this.classShift=null,this.node=null,this.outgoing=[],this.indegree=0}addEdge(t,e){let o=new Z_;o.target=t,o.separation=e,t.indegree++,this.outgoing.push(o)}},Z_=class{constructor(){this.separation=0,this.target=null}};var Ef=class n{constructor(){this.nodeCount=0,this.layerIndex=null,this.nodeIndex=null,this.leftNeighbors=[],this.rightNeighbors=[]}cleanup(){this.layerIndex=null,this.nodeIndex=null,this.leftNeighbors.length=0,this.rightNeighbors.length=0}static buildFor(t){let e=new n,o=0;for(let l of t)o+=l.getNodes().length;e.nodeCount=o,e.layerIndex=new Int32Array(t.getLayers().length),e.nodeIndex=new Int32Array(o);let r=0,i=0,s=0;for(let l of t.getLayers()){l.id=r++,e.layerIndex[l.id]=i++;let c=0;for(let g of l.getNodes())g.id=s++,e.nodeIndex[g.id]=c++}let a=(l,c)=>{let g=e.nodeIndex[l.getFirst().id]-e.nodeIndex[c.getFirst().id];return Math.sign(g)};return e.leftNeighbors=new Array(o),e.rightNeighbors=new Array(o),jI(e,t,a),ZI(e,t,a),e}};function ZI(n,t,e){for(let o of t)for(let r of o){let i=[],s=0;for(let a of r.getOutgoingEdges()){if(a.isSelfLoop()||a.isInLayerEdge())continue;let l=a.getProperty(_.PRIORITY_STRAIGHTNESS);l>s&&(s=l,i.length=0),l===s&&i.push(Gt.of(a.getTarget().getNode(),a))}i.sort(e),n.rightNeighbors[r.id]=i}}function jI(n,t,e){for(let o of t)for(let r of o){let i=[],s=0;for(let a of r.getIncomingEdges()){if(a.isSelfLoop()||a.isInLayerEdge())continue;let l=a.getProperty(_.PRIORITY_STRAIGHTNESS);l>s&&(s=l,i.length=0),l===s&&i.push(Gt.of(a.getSource().getNode(),a))}i.sort(e),n.leftNeighbors[r.id]=i}}var $I=3,mf=class{constructor(){this._lGraph=null,this._markedEdges=new Set,this._ni=null,this._produceBalancedLayout=!1}process(t,e){e.begin("Brandes & Koepf node placement",1),this._lGraph=t,this._ni=Ef.buildFor(t);let o=t.getProperty(_.NODE_PLACEMENT_BK_FIXED_ALIGNMENT),r=t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES);this._produceBalancedLayout=o==="NONE"&&!r||o==="BALANCED",this._markConflicts(t);let i=[];switch(o){case"LEFTDOWN":i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.LEFT));break;case"LEFTUP":i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.LEFT));break;case"RIGHTDOWN":i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.RIGHT));break;case"RIGHTUP":i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.RIGHT));break;default:i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.RIGHT)),i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.RIGHT)),i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.LEFT)),i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.LEFT))}let s=new df(t,this._ni);for(let c of i)s.verticalAlignment(c,this._markedEdges),s.insideBlockShift(c);let a=new pf(t,this._ni);for(let c of i)a.horizontalCompaction(c);let l=null;if(this._produceBalancedLayout){let c=this._createBalancedLayout(i,this._ni.nodeCount);this._checkOrderConstraint(t,c)&&(l=c)}if(l==null)for(let c of i)this._checkOrderConstraint(t,c)&&(l==null||l.layoutSize()>c.layoutSize())&&(l=c);l==null&&(l=i[0]);for(let c of t.getLayers())for(let g of c.getNodes())g.getPosition().y=l.y[g.id]+l.innerShift[g.id];for(let c of i)c.cleanup();this._ni.cleanup(),this._markedEdges.clear(),e.done()}_markConflicts(t){let e=t.getLayers().length;if(e<$I)return;let o=new Int32Array(e),r=t.getLayers();for(let i=0;i<e;i++)o[i]=r[i].getNodes().length;for(let i=1;i<e-1;i++){let s=r[i+1],a=s.getNodes(),l=0,c=0;for(let g=0;g<o[i+1];g++){let h=a[g];if(g===o[i+1]-1||this._incidentToInnerSegment(h,i+1,i)){let d=o[i]-1;for(this._incidentToInnerSegment(h,i+1,i)&&(d=this._ni.nodeIndex[this._ni.leftNeighbors[h.id][0].getFirst().id]);c<=g;){let f=s.getNodes()[c];if(!this._incidentToInnerSegment(f,i+1,i))for(let E of this._ni.leftNeighbors[f.id]){let P=this._ni.nodeIndex[E.getFirst().id];(P<l||P>d)&&this._markedEdges.add(E.getSecond())}c++}l=d}}}}_incidentToInnerSegment(t,e,o){if(t.getType()!==y.LONG_EDGE)return!1;for(let r of t.getIncomingEdges())if(r.getSource().getNode().getType()===y.LONG_EDGE&&this._ni.layerIndex[r.getSource().getNode().getLayer().id]===o&&this._ni.layerIndex[t.getLayer().id]===e)return!0;return!1}_createBalancedLayout(t,e){let o=t.length,r=new rr(this._lGraph,e,null,null),i=new Float64Array(o),s=new Float64Array(o),a=new Float64Array(o),l=0;for(let h=0;h<o;h++)s[h]=Number.POSITIVE_INFINITY,a[h]=Number.NEGATIVE_INFINITY;for(let h=0;h<o;h++){let d=t[h];i[h]=d.layoutSize(),i[l]>i[h]&&(l=h);for(let f of this._lGraph)for(let E of f){let P=d.y[E.id]+d.innerShift[E.id];P<s[h]&&(s[h]=P);let S=P+E.getSize().y;S>a[h]&&(a[h]=S)}}let c=new Float64Array(o);for(let h=0;h<o;h++)c[h]=t[h].vdir===xt.DOWN?s[l]-s[h]:a[l]-a[h];let g=new Array(o);for(let h of this._lGraph.getLayers())for(let d of h.getNodes()){for(let f=0;f<o;f++)g[f]=t[f].y[d.id]+t[f].innerShift[d.id]+c[f];g.sort((f,E)=>f-E),r.y[d.id]=(g[1]+g[2])/2,r.innerShift[d.id]=0}return r}_checkOrderConstraint(t,e){for(let o of t.getLayers()){let r=Number.NEGATIVE_INFINITY;for(let i of o.getNodes()){let s=e.y[i.id]+e.innerShift[i.id]-i.getMargin().top,a=e.y[i.id]+e.innerShift[i.id]+i.getSize().y+i.getMargin().bottom;if(s>r&&a>r)r=e.y[i.id]+e.innerShift[i.id]+i.getSize().y+i.getMargin().bottom;else return!1}}return!0}getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);return e&&e.has&&e.has("EXTERNAL_PORTS"),null}};var ze=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.SIMPLE:return new tf;case n.INTERACTIVE:return new ef;case n.LINEAR_SEGMENTS:return new sf;case n.BRANDES_KOEPF:return new mf;case n.NETWORK_SIMPLEX:return new gf;default:throw new Error("Unknown node placement strategy: "+this.name)}}static valueOf(t){return n[t]}};ze.SIMPLE=new ze("SIMPLE");ze.INTERACTIVE=new ze("INTERACTIVE");ze.LINEAR_SEGMENTS=new ze("LINEAR_SEGMENTS");ze.BRANDES_KOEPF=new ze("BRANDES_KOEPF");ze.NETWORK_SIMPLEX=new ze("NETWORK_SIMPLEX");var vo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};vo.CENTER=new vo("CENTER");vo.TOP_LEFT=new vo("TOP_LEFT");var Uo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};Uo.ONE_SIDED=new Uo("ONE_SIDED");Uo.TWO_SIDED=new Uo("TWO_SIDED");Uo.OFF=new Uo("OFF");var Me=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};Me.NONE=new Me("NONE");Me.INSIDE_PORT_SIDE_GROUPS=new Me("INSIDE_PORT_SIDE_GROUPS");Me.GROUP_MODEL_ORDER=new Me("GROUP_MODEL_ORDER");Me.MODEL_ORDER=new Me("MODEL_ORDER");var so=class{constructor(t){this.name=t}toString(){return this.name}};so.NONE=new so("NONE");so.LEFTUP=new so("LEFTUP");so.RIGHTUP=new so("RIGHTUP");so.LEFTDOWN=new so("LEFTDOWN");so.RIGHTDOWN=new so("RIGHTDOWN");so.BALANCED=new so("BALANCED");var Wr=class{constructor(t){this.name=t}toString(){return this.name}};Wr.NONE=new Wr("NONE");Wr.ALTERNATING=new Wr("ALTERNATING");var Yi=class{constructor(t){this.name=t}toString(){return this.name}};Yi.INPUT_ORDER=new Yi("INPUT_ORDER");Yi.PORT_DEGREE=new Yi("PORT_DEGREE");var Fo=class{constructor(t){this._name=t}toString(){return this._name}};Fo.OFF=new Fo("OFF");Fo.SINGLE_EDGE=new Fo("SINGLE_EDGE");Fo.MULTI_EDGE=new Fo("MULTI_EDGE");var Yet=new m("org.eclipse.elk.layered.cycleBreaking.strategy",()=>Xt.GREEDY),Vet=new m("org.eclipse.elk.layered.layering.strategy",()=>le.NETWORK_SIMPLEX),Xet=new m("org.eclipse.elk.layered.layering.layerConstraint",()=>J.NONE),Ket=new m("org.eclipse.elk.layered.layering.layerChoiceConstraint",null,-1),Zet=new m("org.eclipse.elk.layered.layering.layerId",-1,-1),jet=new m("org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",4,-1),$et=new m("org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",2,-1),qet=new m("org.eclipse.elk.layered.layering.nodePromotion.strategy",()=>ut.NONE),Jet=new m("org.eclipse.elk.layered.layering.nodePromotion.maxIterations",0,0),Qet=new m("org.eclipse.elk.layered.layering.coffmanGraham.layerBound",Number.MAX_SAFE_INTEGER),tot=new m("org.eclipse.elk.layered.crossingMinimization.strategy",()=>We.LAYER_SWEEP),eot=new m("org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",!1),oot=new m("org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",.1),rot=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",40,0),iot=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",()=>Uo.TWO_SIDED),JP=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type",()=>Uo.OFF),sot=new m("org.eclipse.elk.layered.crossingMinimization.semiInteractive",!1),not=new m("org.eclipse.elk.layered.crossingMinimization.inLayerPredOf"),aot=new m("org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf"),lot=new m("org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint",null,-1),cot=new m("org.eclipse.elk.layered.crossingMinimization.positionId",-1,-1),got=new m("org.eclipse.elk.layered.nodePlacement.strategy",()=>ze.BRANDES_KOEPF),hot=new m("org.eclipse.elk.layered.nodePlacement.favorStraightEdges"),dot=new m("org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",()=>oa.IMPROVE_STRAIGHTNESS),fot=new m("org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment",()=>so.NONE),uot=new m("org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",.3,Xe.greaterThan(0)),_ot=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility"),pot=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",()=>ye.NONE),Eot=new m("org.eclipse.elk.layered.edgeRouting.splines.mode",()=>Qr.SLOPPY),mot=new m("org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",.2),Pot=new m("org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",2),Oot=new m("org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",()=>Qo.NORTH),Sot=new m("org.eclipse.elk.layered.edgeRouting.selfLoopOrdering",()=>Je.STACKED),Tot=new m("org.eclipse.elk.layered.spacing.baseValue",null,0),Not=new m("org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",10,0),yot=new m("org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",10,0),Iot=new m("org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",20,0),QP=new m("org.eclipse.elk.layered.priority.direction",0,0),Rot=new m("org.eclipse.elk.layered.priority.shortness",0,0),tO=new m("org.eclipse.elk.layered.priority.straightness",0,0),Lot=new m("org.eclipse.elk.layered.compaction.postCompaction.strategy",()=>ie.NONE),Aot=new m("org.eclipse.elk.layered.compaction.postCompaction.constraints",()=>Ur.SCANLINE),Cot=new m("org.eclipse.elk.layered.compaction.connectedComponents",!1),xot=new m("org.eclipse.elk.layered.highDegreeNodes.treatment",!1),Dot=new m("org.eclipse.elk.layered.highDegreeNodes.threshold",16,0),wot=new m("org.eclipse.elk.layered.highDegreeNodes.treeHeight",5,0),Mot=new m("org.eclipse.elk.layered.wrapping.strategy",()=>Fo.OFF),bot=new m("org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",10),Got=new m("org.eclipse.elk.layered.wrapping.correctionFactor",1),Hot=new m("org.eclipse.elk.layered.wrapping.cutting.strategy",()=>ro.MSD),vot=new m("org.eclipse.elk.layered.wrapping.cutting.cuts"),Bot=new m("org.eclipse.elk.layered.wrapping.cutting.msd.freedom",1,0),Uot=new m("org.eclipse.elk.layered.wrapping.validify.strategy",()=>io.GREEDY),Fot=new m("org.eclipse.elk.layered.wrapping.validify.forbiddenIndices"),kot=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",!0),Wot=new m("org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",2),zot=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",!0),Yot=new m("org.eclipse.elk.layered.layerUnzipping.strategy",()=>Wr.NONE),Vot=new m("org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",!1),eO=new m("org.eclipse.elk.layered.layerUnzipping.layerSplit",2,1),Xot=new m("org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",!0),oO=new m("org.eclipse.elk.layered.edgeLabels.sideSelection",()=>Tt.SMART_DOWN),Kot=new m("org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy",()=>Ct.MEDIAN_LAYER),Zot=new m("org.eclipse.elk.layered.considerModelOrder.strategy",()=>$t.NONE),jot=new m("org.eclipse.elk.layered.considerModelOrder.portModelOrder",!1),$ot=new m("org.eclipse.elk.layered.considerModelOrder.noModelOrder",!1),qot=new m("org.eclipse.elk.layered.considerModelOrder.components",()=>Me.NONE),Jot=new m("org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",()=>Ao.DUMMY_NODE_OVER),Qot=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",0),trt=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",0),ert=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",0),ort=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",0),rrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.componentGroupId",0),irt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP),srt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredSourceId"),nrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredTargetId"),art=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP),lrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmEnforcedGroupOrders","1, 2, 6, 7, 10, 11"),crt=new m("org.eclipse.elk.layered.directionCongruency",()=>jo.READING_DIRECTION),grt=new m("org.eclipse.elk.layered.feedbackEdges",!1),hrt=new m("org.eclipse.elk.layered.interactiveReferencePoint",()=>vo.CENTER),drt=new m("org.eclipse.elk.layered.mergeEdges",!1),frt=new m("org.eclipse.elk.layered.mergeHierarchyEdges",!0),urt=new m("org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",!1),_rt=new m("org.eclipse.elk.layered.portSortingStrategy",()=>Yi.INPUT_ORDER),prt=new m("org.eclipse.elk.layered.thoroughness",7,1),Ert=new m("org.eclipse.elk.layered.unnecessaryBendpoints",!1),mrt=new m("org.eclipse.elk.layered.generatePositionAndLayerIds",!1);var _=class{};_.EDGE_LABELS_PLACEMENT=new m("org.eclipse.elk.edgeLabels.placement",()=>St.CENTER);_.EDGE_LABELS_INLINE=new m("org.eclipse.elk.edgeLabels.inline",!1);_.INTERACTIVE_REFERENCE_POINT=new m("org.eclipse.elk.layered.interactiveReferencePoint",()=>vo.CENTER);_.PRIORITY_DIRECTION=QP;_.LAYERING_LAYER_CONSTRAINT=new m("org.eclipse.elk.layered.layering.layerConstraint",()=>J.NONE);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",0);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_SOURCE_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingPreferredSourceId",-1);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_TARGET_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingPreferredTargetId",-1);_.LAYERING_LAYER_ID=new m("org.eclipse.elk.layered.layering.layerId",0);_.LAYERING_COFFMAN_GRAHAM_LAYER_BOUND=new m("org.eclipse.elk.layered.layering.coffmanGraham.layerBound",Number.MAX_SAFE_INTEGER);_.PRIORITY_SHORTNESS=new m("org.eclipse.elk.layered.priority.shortness",0);_.PRIORITY_STRAIGHTNESS=tO;_.NODE_PLACEMENT_BK_EDGE_STRAIGHTENING=new m("org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",()=>oa.IMPROVE_STRAIGHTNESS);_.NODE_PLACEMENT_BK_FIXED_ALIGNMENT=new m("org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment","NONE");_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES=new m("org.eclipse.elk.layered.nodePlacement.favorStraightEdges");_.NODE_PLACEMENT_LINEAR_SEGMENTS_DEFLECTION_DAMPENING=new m("org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",.3);_.UNNECESSARY_BENDPOINTS=new m("org.eclipse.elk.layered.unnecessaryBendpoints",!1);_.JUNCTION_POINTS=new m("org.eclipse.elk.junctionPoints");_.EDGE_THICKNESS=new m("org.eclipse.elk.edge.thickness",1);_.PORT_INDEX=new m("org.eclipse.elk.port.index");_.PORT_SORTING_STRATEGY=new m("org.eclipse.elk.layered.portSortingStrategy","INPUT_ORDER");_.SPACING_PORTS_SURROUNDING=new m("org.eclipse.elk.spacing.portsSurrounding");_.COMMENT_BOX=new m("org.eclipse.elk.commentBox",!1);_.SPACING_COMMENT_COMMENT=new m("org.eclipse.elk.spacing.commentComment",20);_.SPACING_COMMENT_NODE=new m("org.eclipse.elk.spacing.commentNode",20);_.MARGINS=new m("org.eclipse.elk.margins");_.SPACING_EDGE_LABEL=new m("org.eclipse.elk.spacing.edgeLabel",2);_.SPACING_LABEL_LABEL=new m("org.eclipse.elk.spacing.labelLabel",0);_.DIRECTION=new m("org.eclipse.elk.direction",R.UNDEFINED);_.EDGE_ROUTING=new m("org.eclipse.elk.edgeRouting",()=>At.ORTHOGONAL);_.DIRECTION_CONGRUENCY=new m("org.eclipse.elk.layered.directionCongruency",jo.READING_DIRECTION);_.NODE_LABELS_PADDING=new m("org.eclipse.elk.nodeLabels.padding");_.NODE_LABELS_PLACEMENT=new m("org.eclipse.elk.nodeLabels.placement");_.EDGE_LABELS_SIDE_SELECTION=oO;_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY=new m("org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy");_.ALIGNMENT=new m("org.eclipse.elk.alignment");_.POSITION=new m("org.eclipse.elk.position");_.NODE_SIZE_MINIMUM=new m("org.eclipse.elk.nodeSize.minimum");_.HYPERNODE=new m("org.eclipse.elk.hypernode",!1);_.CROSSING_MINIMIZATION_POSITION_ID=new m("org.eclipse.elk.layered.crossingMinimization.positionId",0);_.LAYERING_LAYER_CHOICE_CONSTRAINT=new m("org.eclipse.elk.layered.layering.layerChoiceConstraint");_.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF=new m("org.eclipse.elk.layered.crossingMinimization.inLayerPredOf");_.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF=new m("org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf");_.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT=new m("org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint");_.PARTITIONING_PARTITION=new m("org.eclipse.elk.partitioning.partition");_.PORT_ANCHOR=new m("org.eclipse.elk.port.anchor");_.ASPECT_RATIO=new m("org.eclipse.elk.aspectRatio",1.6);_.SPACING_COMPONENT_COMPONENT=new m("org.eclipse.elk.spacing.componentComponent",20);_.COMPACTION_CONNECTED_COMPONENTS=new m("org.eclipse.elk.layered.compaction.connectedComponents",!1);_.PRIORITY=new m("org.eclipse.elk.priority",0);_.WRAPPING_MULTI_EDGE_IMPROVE_WRAPPED_EDGES=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",!0);_.WRAPPING_MULTI_EDGE_IMPROVE_CUTS=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",!0);_.WRAPPING_MULTI_EDGE_DISTANCE_PENALTY=new m("org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",2);_.WRAPPING_CUTTING_STRATEGY=new m("org.eclipse.elk.layered.wrapping.cutting.strategy");_.WRAPPING_VALIDIFY_STRATEGY=new m("org.eclipse.elk.layered.wrapping.validify.strategy");_.WRAPPING_CORRECTION_FACTOR=new m("org.eclipse.elk.layered.wrapping.correctionFactor",1);_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES=new m("org.eclipse.elk.layered.wrapping.validify.forbiddenIndices");_.WRAPPING_CUTTING_CUTS=new m("org.eclipse.elk.layered.wrapping.cutting.cuts");_.WRAPPING_CUTTING_MSD_FREEDOM=new m("org.eclipse.elk.layered.wrapping.cutting.msd.freedom",2);_.WRAPPING_ADDITIONAL_EDGE_SPACING=new m("org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",10);_.LAYERING_NODE_PROMOTION_STRATEGY=new m("org.eclipse.elk.layered.layering.nodePromotion.strategy");_.LAYERING_NODE_PROMOTION_MAX_ITERATIONS=new m("org.eclipse.elk.layered.layering.nodePromotion.maxIterations",0);_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES=new m("org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",!1);_.EDGE_ROUTING_SELF_LOOP_DISTRIBUTION=new m("org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",Qo.NORTH);_.EDGE_ROUTING_SELF_LOOP_ORDERING=new m("org.eclipse.elk.layered.edgeRouting.selfLoopOrdering");_.LAYER_UNZIPPING_LAYER_SPLIT=eO;_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES=new m("org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",!0);_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH=new m("org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",!1);_.HIGH_DEGREE_NODES_THRESHOLD=new m("org.eclipse.elk.layered.highDegreeNodes.threshold",16);_.HIGH_DEGREE_NODES_TREE_HEIGHT=new m("org.eclipse.elk.layered.highDegreeNodes.treeHeight",5);_.THOROUGHNESS=new m("org.eclipse.elk.layered.thoroughness",7);_.SPACING_EDGE_EDGE=new m("org.eclipse.elk.spacing.edgeEdge",10);_.SPACING_NODE_SELF_LOOP=new m("org.eclipse.elk.spacing.nodeSelfLoop",10);_.PORT_BORDER_OFFSET=new m("org.eclipse.elk.port.borderOffset",0);_.NODE_SIZE_CONSTRAINTS=new m("org.eclipse.elk.nodeSize.constraints");_.NODE_SIZE_OPTIONS=new m("org.eclipse.elk.nodeSize.options");_.CONTENT_ALIGNMENT=new m("org.eclipse.elk.contentAlignment");_.PORT_LABELS_PLACEMENT=new m("org.eclipse.elk.portLabels.placement");_.PORT_LABELS_TREAT_AS_GROUP=new m("org.eclipse.elk.portLabels.treatAsGroup",!0);_.CYCLE_BREAKING_STRATEGY=new m("org.eclipse.elk.layered.cycleBreaking.strategy",()=>Xt.GREEDY);_.LAYERING_STRATEGY=new m("org.eclipse.elk.layered.layering.strategy",()=>le.NETWORK_SIMPLEX);_.CROSSING_MINIMIZATION_STRATEGY=new m("org.eclipse.elk.layered.crossingMinimization.strategy",()=>We.LAYER_SWEEP);_.NODE_PLACEMENT_STRATEGY=new m("org.eclipse.elk.layered.nodePlacement.strategy",()=>ze.BRANDES_KOEPF);_.RANDOM_SEED=new m("org.eclipse.elk.randomSeed",1);_.FEEDBACK_EDGES=new m("org.eclipse.elk.layered.feedbackEdges",!1);_.INTERACTIVE_LAYOUT=new m("org.eclipse.elk.interactiveLayout",!1);_.GENERATE_POSITION_AND_LAYER_IDS=new m("org.eclipse.elk.layered.generatePositionAndLayerIds",!1);_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE=new m("org.eclipse.elk.layered.crossingMinimization.semiInteractive",!1);_.LAYER_UNZIPPING_STRATEGY=new m("org.eclipse.elk.layered.layerUnzipping.strategy");_.HIGH_DEGREE_NODES_TREATMENT=new m("org.eclipse.elk.layered.highDegreeNodes.treatment",!1);_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",Uo.TWO_SIDED);_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE=JP;_.CROSSING_MINIMIZATION_GREEDY_SWITCH_ACTIVATION_THRESHOLD=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",40);_.SEPARATE_CONNECTED_COMPONENTS=new m("org.eclipse.elk.separateConnectedComponents",!0);_.NODE_SIZE_FIXED_GRAPH_SIZE=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1);_.CONSIDER_MODEL_ORDER_COMPONENTS=new m("org.eclipse.elk.layered.considerModelOrder.components",Me.NONE);_.WRAPPING_STRATEGY=new m("org.eclipse.elk.layered.wrapping.strategy");_.COMPACTION_POST_COMPACTION_STRATEGY=new m("org.eclipse.elk.layered.compaction.postCompaction.strategy");_.COMPACTION_POST_COMPACTION_CONSTRAINTS=new m("org.eclipse.elk.layered.compaction.postCompaction.constraints");_.SPACING_NODE_NODE=new m("org.eclipse.elk.spacing.nodeNode",20);_.SPACING_EDGE_NODE=new m("org.eclipse.elk.spacing.edgeNode",10);_.SPACING_LABEL_NODE=new m("org.eclipse.elk.spacing.labelNode",5);_.SPACING_LABEL_PORT_HORIZONTAL=new m("org.eclipse.elk.spacing.labelPortHorizontal",1);_.SPACING_LABEL_PORT_VERTICAL=new m("org.eclipse.elk.spacing.labelPortVertical",1);_.SPACING_PORT_PORT=new m("org.eclipse.elk.spacing.portPort",10);_.SPACING_NODE_NODE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",20);_.SPACING_EDGE_NODE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",16);_.SPACING_EDGE_EDGE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",10);_.EDGE_ROUTING_SPLINES_MODE=new m("org.eclipse.elk.layered.edgeRouting.splines.mode",()=>Qr.SLOPPY);_.EDGE_ROUTING_POLYLINE_SLOPED_EDGE_ZONE_WIDTH=new m("org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",2);_.EDGE_ROUTING_SPLINES_SLOPPY_LAYER_SPACING_FACTOR=new m("org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",.2);_.SPACING_INDIVIDUAL=new m("org.eclipse.elk.spacing.individual");_.LAYERING_MIN_WIDTH_UPPER_BOUND_ON_WIDTH=new m("org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",4,-1);_.LAYERING_MIN_WIDTH_UPPER_LAYER_ESTIMATION_SCALING_FACTOR=new m("org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",2,-1);_.PORT_CONSTRAINTS=new m("org.eclipse.elk.portConstraints",()=>H.UNDEFINED);_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER=new m("org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",!1);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",0);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_ENFORCED_GROUP_ORDERS=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationEnforcedGroupOrders",()=>[]);_.CROSSING_MINIMIZATION_HIERARCHICAL_SWEEPINESS=new m("org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",.1);_.HIERARCHY_HANDLING=new m("org.eclipse.elk.hierarchyHandling","INHERIT");_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_NODE_INFLUENCE=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",0);_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_PORT_INFLUENCE=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",0);_.CONSIDER_MODEL_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.strategy",()=>$t.NONE);_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",()=>Ao.DUMMY_NODE_OVER);_.CONSIDER_MODEL_ORDER_PORT_MODEL_ORDER=new m("org.eclipse.elk.layered.considerModelOrder.portModelOrder",!1);_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility");_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY_DEFAULT=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",()=>ye.NODE_SIZE_WHERE_SPACE_PERMITS);_.NO_LAYOUT=new m("org.eclipse.elk.noLayout",!1);_.PORT_SIDE=new m("org.eclipse.elk.port.side");_.ALGORITHM=new m("org.eclipse.elk.algorithm");_.ALGORITHM_ID="org.eclipse.elk.layered";_.PARTITIONING_ACTIVATE=new m("org.eclipse.elk.partitioning.activate",!1);_.SPACING_BASE_VALUE=new m("org.eclipse.elk.spacing.baseValue");_.MERGE_EDGES=new m("org.eclipse.elk.layered.mergeEdges",!1);_.MERGE_HIERARCHY_EDGES=new m("org.eclipse.elk.layered.mergeHierarchyEdges",!0);_.INSIDE_SELF_LOOPS_ACTIVATE=new m("org.eclipse.elk.insideSelfLoops.activate",!1);_.INSIDE_SELF_LOOPS_YO=new m("org.eclipse.elk.insideSelfLoops.yo",!1);_.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER=new m("org.eclipse.elk.layered.considerModelOrder.noModelOrder",!1);_.PADDING=new m("org.eclipse.elk.padding",new yt(12));var z=class n{static toNodeArray(t){return[...t]}static toEdgeArray(t){return[...t]}static toPortArray(t){return[...t]}static resizeNode(t,e,o,r){let i=new O(t.getSize().x,t.getSize().y),s=e.x/i.x,a=e.y/i.y,l=e.x-i.x,c=e.y-i.y;if(o){let g=t.getProperty(_.PORT_CONSTRAINTS)===H.FIXED_POS;for(let h of t.getPorts())switch(h.getSide()){case u.NORTH:g||(h.getPosition().x*=s);break;case u.EAST:h.getPosition().x+=l,g||(h.getPosition().y*=a);break;case u.SOUTH:g||(h.getPosition().x*=s),h.getPosition().y+=c;break;case u.WEST:g||(h.getPosition().y*=a);break;default:break}}if(r)for(let g of t.getLabels()){let h=g.getPosition().x+g.getSize().x/2,d=g.getPosition().y+g.getSize().y/2,f=h/i.x,E=d/i.y;f+E>=1&&(f-E>0&&d>=0?(g.getPosition().x+=l,g.getPosition().y+=c*E):f-E<0&&h>=0&&(g.getPosition().x+=l*f,g.getPosition().y+=c))}t.getSize().x=e.x,t.getSize().y=e.y,t.setProperty(_.NODE_SIZE_CONSTRAINTS,mt.fixed())}static offsetGraphs(t,e,o){for(let r of t)n.offsetGraph(r,e,o)}static offsetGraph(t,e,o){let r=new O(e,o);for(let i of t.getLayerlessNodes()){i.getPosition().add(r);for(let s of i.getPorts())for(let a of s.getOutgoingEdges()){for(let c of a.getBendPoints())c.x+=e,c.y+=o;let l=a.getProperty(_.JUNCTION_POINTS);if(l!=null)for(let c of l)c.x+=e,c.y+=o;for(let c of a.getLabels())c.getPosition().add(r)}}}static placeNodesHorizontally(t,e){let o=0,r=0;for(let i of t.getNodes())o=Math.max(o,i.getMargin().left),r=Math.max(r,i.getMargin().right);for(let i of t.getNodes()){let s=i.getProperty(_.ALIGNMENT),a;switch(s){case Kt.LEFT:a=0;break;case Kt.RIGHT:a=1;break;case Kt.CENTER:a=.5;break;default:{let f=0,E=0;for(let P of i.getPorts())P.getIncomingEdges().length>0&&f++,P.getOutgoingEdges().length>0&&E++;a=f+E===0?.5:E/(f+E)}}let l=t.getSize(),c=i.getSize().x,g=(l.x-c)*a;a>.5?g-=r*2*(a-.5):a<.5&&(g+=o*2*(.5-a));let h=i.getMargin().left;g<h&&(g=h);let d=i.getMargin().right;g>l.x-d-c&&(g=l.x-d-c),i.getPosition().x=e+g}}static findMaxNonDummyNodeWidth(t,e){if(t.getGraph().getProperty(_.DIRECTION).isVertical())return 0;let o=0;for(let r of t.getNodes())if(r.getType()===y.NORMAL){let i=r.getSize().x;e&&(i+=r.getMargin().left+r.getMargin().right),i>o&&(o=i)}return o}static computeGraphProperties(t){let e=t.getProperty(p.GRAPH_PROPERTIES);e.size>0&&e.clear();let o=n.getDirection(t);for(let r of t.getLayerlessNodes()){r.getProperty(_.COMMENT_BOX)?e.add(v.COMMENTS):r.getProperty(_.HYPERNODE)?(e.add(v.HYPERNODES),e.add(v.HYPEREDGES)):r.getType()===y.EXTERNAL_PORT&&e.add(v.EXTERNAL_PORTS);let i=r.getProperty(_.PORT_CONSTRAINTS);i===H.UNDEFINED?r.setProperty(_.PORT_CONSTRAINTS,H.FREE):i!==H.FREE&&e.add(v.NON_FREE_PORTS);for(let s of r.getPorts()){s.getIncomingEdges().length+s.getOutgoingEdges().length>1&&e.add(v.HYPEREDGES);let a=s.getSide();o===R.UP||o===R.DOWN?(a===u.EAST||a===u.WEST)&&e.add(v.NORTH_SOUTH_PORTS):(a===u.NORTH||a===u.SOUTH)&&e.add(v.NORTH_SOUTH_PORTS);for(let l of s.getOutgoingEdges()){l.getTarget().getNode()===r&&e.add(v.SELF_LOOPS);for(let c of l.getLabels())switch(c.getProperty(_.EDGE_LABELS_PLACEMENT)){case St.CENTER:e.add(v.CENTER_LABELS);break;case St.HEAD:case St.TAIL:e.add(v.END_LABELS);break;default:break}}}}}static getExternalPortPosition(t,e,o,r){let i=new O(e.getPosition().x,e.getPosition().y);i.x+=e.getSize().x/2,i.y+=e.getSize().y/2;let s=e.getProperty(_.PORT_BORDER_OFFSET)||0,a=t.getSize(),l=t.getPadding(),c=t.getOffset();switch(e.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:i.x+=l.left+c.x-o/2,i.y=-r-s,e.getPosition().y=-(l.top+s+c.y);break;case u.EAST:i.x=a.x+l.left+l.right+s,i.y+=l.top+c.y-r/2,e.getPosition().x=a.x+l.right+s-c.x;break;case u.SOUTH:i.x+=l.left+c.x-o/2,i.y=a.y+l.top+l.bottom+s,e.getPosition().y=a.y+l.bottom+s-c.y;break;case u.WEST:i.x=-o-s,i.y+=l.top+c.y-r/2,e.getPosition().x=-(l.left+s+c.x);break;default:break}return i}static isDescendant(t,e){let o=t,r=o.getGraph().getParentNode();for(;r!=null;){if(o=r,o===e)return!0;r=o.getGraph().getParentNode()}return!1}static changeCoordSystem(t,e,o){if(e===o)return;let r=e,i;do if(t.add(r.getOffset()),i=r.getParentNode(),i!=null){let s=r.getPadding();t.add(s.left,s.top),t.add(i.getPosition()),r=i.getGraph()}while(i!=null);r=o;do if(t.sub(r.getOffset()),i=r.getParentNode(),i!=null){let s=r.getPadding();t.sub(s.left,s.top),t.sub(i.getPosition()),r=i.getGraph()}while(i!=null)}static getIndividualOrInherited(t,e){if(t!=null&&t.hasProperty&&t.hasProperty(as)){let o=t.getProperty(as);if(o!=null&&o.hasProperty&&o.hasProperty(e)){let r=o.getProperty(e);if(r!=null)return r}}if(t!=null&&t.hasProperty&&t.hasProperty(e))return t.getProperty(e);if(t!=null&&typeof t.getGraph=="function"){let o=t.getGraph();if(o!=null)return o.getProperty(e)}return t!=null?t.getProperty(e):null}static getDirection(t){let e=t.getProperty(_.DIRECTION);return e===R.UNDEFINED?t.getProperty(_.ASPECT_RATIO)>=1?R.RIGHT:R.DOWN:e}static getMinimalModelOrder(t){let e=Number.MAX_SAFE_INTEGER;for(let o of t.getLayerlessNodes())o.hasProperty(p.MODEL_ORDER)&&(e=Math.min(e,o.getProperty(p.MODEL_ORDER)));return e}static createPort(t,e,o,r){let i,s=n.getDirection(r);if((r.getProperty(_.MERGE_EDGES)||t.getProperty(_.HYPERNODE))&&!t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){let l=u.fromDirection(s);i=n.provideCollectorPort(r,t,o,o===W.OUTPUT?l:l.opposed())}else{if(i=new rt,i.setNode(t),e!=null){let g=i.getPosition();g.x=e.x-t.getPosition().x,g.y=e.y-t.getPosition().y,typeof g.bound=="function"?g.bound(0,0,t.getSize().x,t.getSize().y):(g.x=Math.min(Math.max(g.x,0),t.getSize().x),g.y=Math.min(Math.max(g.y,0),t.getSize().y)),i.setSide(n._calcPortSide(i,s))}else{let g=u.fromDirection(s);i.setSide(o===W.OUTPUT?g:g.opposed())}let l=r.getProperty(p.GRAPH_PROPERTIES),c=i.getSide();s===R.LEFT||s===R.RIGHT?(c===u.NORTH||c===u.SOUTH)&&l.add(v.NORTH_SOUTH_PORTS):(s===R.UP||s===R.DOWN)&&(c===u.EAST||c===u.WEST)&&l.add(v.NORTH_SOUTH_PORTS)}return i}static provideCollectorPort(t,e,o,r){let i=null;switch(o){case W.INPUT:for(let s of e.getPorts())if(s.getProperty(p.INPUT_COLLECT))return s;i=new rt,i.setProperty(p.INPUT_COLLECT,!0);break;case W.OUTPUT:for(let s of e.getPorts())if(s.getProperty(p.OUTPUT_COLLECT))return s;i=new rt,i.setProperty(p.OUTPUT_COLLECT,!0);break;default:break}return i!=null&&(i.setNode(e),i.setSide(r),n._centerPoint(i.getPosition(),e.getSize(),r)),i}static initializePort(t,e,o,r){let i=t.getSide();if(i===u.UNDEFINED&&e.isSideFixed()&&(i=n._calcPortSide(t,o),t.setSide(i),!t.hasProperty(_.PORT_BORDER_OFFSET)&&i!==u.UNDEFINED&&(t.getPosition().x!==0||t.getPosition().y!==0)&&t.setProperty(_.PORT_BORDER_OFFSET,n._calcPortOffset(t,i))),e.isRatioFixed()){let l=0;switch(i){case u.NORTH:case u.SOUTH:{let c=t.getNode().getSize().x;c>0&&(l=t.getPosition().x/c);break}case u.EAST:case u.WEST:{let c=t.getNode().getSize().y;c>0&&(l=t.getPosition().y/c);break}default:break}t.setProperty(p.PORT_RATIO_OR_POSITION,l)}let s=t.getSize(),a=t.getAnchor();if(r!=null)a.x=r.x,a.y=r.y,t.setExplicitlySuppliedPortAnchor(!0);else if(e.isSideFixed()&&i!==u.UNDEFINED)switch(i){case u.NORTH:a.x=s.x/2;break;case u.EAST:a.x=s.x,a.y=s.y/2;break;case u.SOUTH:a.x=s.x/2,a.y=s.y;break;case u.WEST:a.y=s.y/2;break;default:break}else a.x=s.x/2,a.y=s.y/2}static createExternalPortDummy(t,e,o,r,i,s,a,l,c){let g=o,h=new ft(c);h.setType(y.EXTERNAL_PORT),h.setProperty(p.EXT_PORT_SIZE,a),h.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS);let d=t.getProperty(_.PORT_BORDER_OFFSET)||0;h.setProperty(_.PORT_BORDER_OFFSET,d);let f=new rt;f.setNode(h),e.isSideFixed()||(r>=0?g=u.fromDirection(l):g=u.fromDirection(l).opposed(),t.setProperty(_.PORT_SIDE,g));let E=new O,P=!1;if(t.hasProperty(_.PORT_ANCHOR)){let S=t.getProperty(_.PORT_ANCHOR);E.x=S.x,E.y=S.y,P=!0}else E.x=a.x/2,E.y=a.y/2;switch(g){case u.WEST:h.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE),h.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),h.getSize().y=a.y,d<0&&(h.getSize().x=-d),f.setSide(u.EAST),P||(E.x=a.x),E.x-=a.x;break;case u.EAST:h.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE),h.setProperty(p.EDGE_CONSTRAINT,De.INCOMING_ONLY),h.getSize().y=a.y,d<0&&(h.getSize().x=-d),f.setSide(u.WEST),P||(E.x=0);break;case u.NORTH:h.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP),h.getSize().x=a.x,d<0&&(h.getSize().y=-d),f.setSide(u.SOUTH),P||(E.y=a.y),E.y-=a.y;break;case u.SOUTH:h.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM),h.getSize().x=a.x,d<0&&(h.getSize().y=-d),f.setSide(u.NORTH),P||(E.y=0);break;default:break}if(f.getPosition().x=E.x,f.getPosition().y=E.y,h.setProperty(_.PORT_ANCHOR,E),e.isOrderFixed()){let S=0;if(e===H.FIXED_ORDER&&t.hasProperty(_.PORT_INDEX))switch(g){case u.NORTH:case u.EAST:S=t.getProperty(_.PORT_INDEX);break;case u.SOUTH:case u.WEST:S=-t.getProperty(_.PORT_INDEX);break;default:break}else switch(g){case u.WEST:case u.EAST:S=s.y,e.isRatioFixed()&&(S/=i.y);break;case u.NORTH:case u.SOUTH:S=s.x,e.isRatioFixed()&&(S/=i.x);break;default:break}h.setProperty(p.PORT_RATIO_OR_POSITION,S)}return h.setProperty(p.EXT_PORT_SIDE,g),h}static _calcPortSide(t,e){let o=t.getNode(),r=o.getSize().x,i=o.getSize().y;if(r<=0&&i<=0)return u.UNDEFINED;let s=t.getPosition().x,a=t.getPosition().y,l=t.getSize().x,c=t.getSize().y;if(e===R.LEFT||e===R.RIGHT){if(s<0)return u.WEST;if(s+l>r)return u.EAST}else if(e===R.UP||e===R.DOWN){if(a<0)return u.NORTH;if(a+c>i)return u.SOUTH}let g=(s+l/2)/r,h=(a+c/2)/i;return g+h<=1&&g-h<=0?u.WEST:g+h>=1&&g-h>=0?u.EAST:h<.5?u.NORTH:u.SOUTH}static _calcPortOffset(t,e){let o=t.getNode();switch(e){case u.NORTH:return-(t.getPosition().y+t.getSize().y);case u.EAST:return t.getPosition().x-o.getSize().x;case u.SOUTH:return t.getPosition().y-o.getSize().y;case u.WEST:return-(t.getPosition().x+t.getSize().x);default:return 0}}static _centerPoint(t,e,o){switch(o){case u.NORTH:t.x=e.x/2,t.y=0;break;case u.EAST:t.x=e.x,t.y=e.y/2;break;case u.SOUTH:t.x=e.x/2,t.y=e.y;break;case u.WEST:t.x=0,t.y=e.y/2;break;default:break}}};var ra=class{combine(t,e){throw new Error("AbstractGraphPlacer.combine is abstract")}moveGraphs(t,e,o,r){for(let i of e)this.moveGraph(t,i,o,r)}moveGraph(t,e,o,r){let i=e.getOffset().clone().add(o,r);for(let s of e.getLayerlessNodes()){s.getPosition().add(i);for(let a of s.getPorts())for(let l of a.getOutgoingEdges()){l.getBendPoints().offset(i);let c=l.getProperty(_.JUNCTION_POINTS);c!=null&&c.offset(i);for(let g of l.getLabels())g.getPosition().add(i)}t.getLayerlessNodes().push(s),s.setGraph(t)}}offsetGraphs(t,e,o){for(let r of t)this.offsetGraph(r,e,o)}offsetGraph(t,e,o){let r=new O(e,o);for(let i of t.getLayerlessNodes()){i.getPosition().add(r);for(let s of i.getPorts())for(let a of s.getOutgoingEdges()){a.getBendPoints().offset(r);let l=a.getProperty(_.JUNCTION_POINTS);l!=null&&l.offset(r);for(let c of a.getLabels())c.getPosition().add(r)}}}};var{SIDES_EAST:JI,SIDES_EAST_SOUTH:QI,SIDES_EAST_SOUTH_WEST:tR,SIDES_EAST_WEST:eR,SIDES_NORTH:oR,SIDES_NORTH_EAST:rR,SIDES_NORTH_EAST_SOUTH_WEST:iR,SIDES_NORTH_EAST_WEST:sR,SIDES_NORTH_SOUTH:nR,SIDES_NORTH_SOUTH_WEST:aR,SIDES_NORTH_WEST:lR,SIDES_SOUTH:cR,SIDES_SOUTH_WEST:gR,SIDES_WEST:hR}=u,sa=class{constructor(t){this._spacing=t,this.cGraph=null,this._oldPosition=new Map,this._offsets=new Map,this._globalOffset=null,this._graphSize=null,this._externalExtensions=new Map,this._externalPlaceholder=new Map;for(let e of[R.LEFT,R.RIGHT,R.UP,R.DOWN])this._externalPlaceholder.set(e,[])}getOffset(t){let e=this._oldPosition.get(t),o=this._offsets.get(t).rect.getPosition();return e.clone().sub(o)}getGlobalOffset(){return this._globalOffset}getGraphSize(){return this._graphSize}getExternalExtensions(){return this._externalExtensions}getExternalPlaceholder(){return this._externalPlaceholder}transform(t){this.cGraph=new Zn(new Set([R.LEFT,R.RIGHT,R.UP,R.DOWN]));for(let e of t.getComponents()){let o=new tr;this.cGraph.cGroups.push(o);for(let r of e.getHull()){let i=new ia(r,null,this._spacing);this._setLock(i,e.getExternalExtensionSides()),this._oldPosition.has(e)||(this._oldPosition.set(e,new O(r.x,r.y)),this._offsets.set(e,i)),this.cGraph.cNodes.push(i),o.addCNode(i)}for(let r of e.getExternalExtensions()){let i=new ia(r.getRepresentor(),null,this._spacing);this._externalExtensions.set(r,{first:o,second:i}),this._setLock(i,e.getExternalExtensionSides());let s=r.getPlaceholder?r.getPlaceholder():null;if(s!=null){let a=new ia(s,1,this._spacing);this._setLock(a,e.getExternalExtensionSides()),new tr().addCNode(a);let c=this._externalPlaceholder.get(r.getDirection())||[];c.push({first:o,second:a}),this._externalPlaceholder.set(r.getDirection(),c)}}}return this.cGraph}_setLock(t,e){let o=r=>e.size===r.size&&[...r].every(i=>e.has(i));e.size===0&&t.lock.set(!0,!0,!0,!0),o(oR)&&t.lock.set(!0,!0,!0,!1),o(JI)&&t.lock.set(!1,!0,!0,!0),o(cR)&&t.lock.set(!0,!0,!1,!0),o(hR)&&t.lock.set(!0,!1,!0,!0),o(rR)&&t.lock.set(!1,!0,!0,!1),o(QI)&&t.lock.set(!1,!0,!1,!0),o(gR)&&t.lock.set(!0,!1,!1,!0),o(lR)&&t.lock.set(!0,!1,!0,!1),o(nR)&&t.lock.set(!0,!0,!0,!0),o(eR)&&t.lock.set(!0,!0,!0,!0),o(tR)&&t.lock.set(!0,!0,!0,!0),o(aR)&&t.lock.set(!0,!0,!0,!0),o(sR)&&t.lock.set(!0,!0,!0,!0),o(iR)&&t.lock.set(!0,!0,!0,!0)}applyLayout(){for(let o of this.cGraph.cNodes)o instanceof ia&&o.applyElementPosition();let t=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),e=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let o of this.cGraph.cNodes)t.x=Math.min(t.x,o.hitbox.x),t.y=Math.min(t.y,o.hitbox.y),e.x=Math.max(e.x,o.hitbox.x+o.hitbox.width),e.y=Math.max(e.y,o.hitbox.y+o.hitbox.height);for(let o of this._externalPlaceholder.values())for(let r of o){let i=r.second;t.x=Math.min(t.x,i.hitbox.x),t.y=Math.min(t.y,i.hitbox.y),e.x=Math.max(e.x,i.hitbox.x+i.hitbox.width),e.y=Math.max(e.y,i.hitbox.y+i.hitbox.height)}this._globalOffset=t.clone().negate(),this._graphSize=e.clone().sub(t),this.cGraph.cGroups.length=0,this.cGraph.cNodes.length=0}},ia=class extends ki{constructor(t,e,o){super(),this.rect=t,this.hitbox=new dt(t.x,t.y,t.width,t.height),this._individualSpacing=e,this._defaultSpacing=o}getHorizontalSpacing(){return this._individualSpacing!=null?this._individualSpacing:this._defaultSpacing}getVerticalSpacing(){return this._individualSpacing!=null?this._individualSpacing:this._defaultSpacing}applyElementPosition(){this.rect.x=this.hitbox.x,this.rect.y=this.hitbox.y}getElementPosition(){return this.rect.x}toString(){return""}};sa.SPACING_HANDLER={getHorizontalSpacing(n,t){let e=typeof n.getHorizontalSpacing=="function"?n.getHorizontalSpacing():0,o=typeof t.getHorizontalSpacing=="function"?t.getHorizontalSpacing():0;return Math.min(e,o)},getVerticalSpacing(n,t){let e=typeof n.getVerticalSpacing=="function"?n.getVerticalSpacing():0,o=typeof t.getVerticalSpacing=="function"?t.getVerticalSpacing():0;return Math.min(e,o)}};var ir=Object.freeze({HORZ:"HORZ",VERT:"VERT"}),j_=new Set([R.LEFT,R.RIGHT]),$_=new Set([R.UP,R.DOWN]),na=class n{constructor(){this._compactionGraph=null,this._transformer=null,this._verticalExternalExtensions=[],this._horizontalExternalExtensions=[],this._compactor=null,this._topLeft=new O,this._bottomRight=new O}static init(t,e){let o=new n;return o._transformer=new sa(e),o._compactionGraph=o._transformer.transform(t),o}compact(t){let e=[];this._verticalExternalExtensions=[],this._horizontalExternalExtensions=[];for(let[a,l]of this._transformer.getExternalExtensions()){e.push(l.second);let c=a.getDirection();c===R.LEFT||c===R.RIGHT?this._horizontalExternalExtensions.push(l):this._verticalExternalExtensions.push(l)}this._addExternalEdgeRepresentations(this._horizontalExternalExtensions),this._addExternalEdgeRepresentations(this._verticalExternalExtensions),this._compactor=new Br(this._compactionGraph),this._compactor.setSpacingsHandler(sa.SPACING_HANDLER),this._removeExternalEdgeRepresentations(this._horizontalExternalExtensions),this._removeExternalEdgeRepresentations(this._verticalExternalExtensions);for(let a of this._compactor.cGraph.cNodes)e.push(a);this._topLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this._bottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let a of e)this._topLeft.x=Math.min(this._topLeft.x,a.hitbox.x),this._topLeft.y=Math.min(this._topLeft.y,a.hitbox.y),this._bottomRight.x=Math.max(this._bottomRight.x,a.hitbox.x+a.hitbox.width),this._bottomRight.y=Math.max(this._bottomRight.y,a.hitbox.y+a.hitbox.height);let o={isLocked:(a,l)=>{let c=a.cGroup||a;return c.outDegree!=null&&c.outDegree!==0}};this._compactor.setLockFunction(o);let r=0,i;do i=this._compactIteration(r),r++;while((r<2||i>n.EPSILON)&&r<n.MAX_ITERATION);let s={isLocked:(a,l)=>{let c=a.cGroup!=null?a:null;if(c!=null){let g=c.lock&&c.lock.getDirection(l);if(g||c.cGroup.outDegree!==0&&g)return!0}return!1}};this._compactor.setLockFunction(s),this._compactIteration(0),this._compactor.finish(),this._transformer.applyLayout()}_compactIteration(t){let e=0;for(let r of this._compactionGraph.cGroups)r.delta=0,r.deltaNormalized=0;this._addPlaceholders(ir.HORZ),this._addExternalEdgeRepresentations(this._verticalExternalExtensions),this._compactor.calculateGroupOffsets(),this._compactor.forceConstraintsRecalculation();let o=R.LEFT;this._compactor.changeDirection(o).compact().changeDirection(R.RIGHT).compact().changeDirection(o).compact(),this._compactor.changeDirection(R.LEFT),this._removeExternalEdgeRepresentations(this._verticalExternalExtensions),this._removePlaceholders(ir.HORZ),this._updateExternalExtensionDimensions(ir.HORZ),this._updatePlaceholders(ir.VERT),this._addPlaceholders(ir.VERT),this._addExternalEdgeRepresentations(this._horizontalExternalExtensions),this._compactor.calculateGroupOffsets();for(let r of this._compactionGraph.cGroups)e+=Math.abs(r.deltaNormalized);for(let r of this._compactionGraph.cGroups)r.delta=0,r.deltaNormalized=0;o=R.UP,this._compactor.changeDirection(o).forceConstraintsRecalculation().compact().changeDirection(R.DOWN).compact().changeDirection(o).compact(),this._compactor.changeDirection(R.LEFT),this._removeExternalEdgeRepresentations(this._horizontalExternalExtensions),this._removePlaceholders(ir.VERT),this._updateExternalExtensionDimensions(ir.VERT),this._updatePlaceholders(ir.HORZ),this._compactor.forceConstraintsRecalculation();for(let r of this._compactionGraph.cGroups)e+=Math.abs(r.deltaNormalized);return e}getGraphSize(){return this._transformer.getGraphSize()}getOffset(t){return this._transformer.getOffset(t).negate().add(this._transformer.getGlobalOffset())}_addExternalEdgeRepresentations(t){for(let e of t)this._compactionGraph.cNodes.push(e.second),e.first.addCNode(e.second)}_removeExternalEdgeRepresentations(t){for(let e of t){let o=this._compactionGraph.cNodes.indexOf(e.second);o>=0&&this._compactionGraph.cNodes.splice(o,1),typeof e.first.removeCNode=="function"&&e.first.removeCNode(e.second)}}_addPlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[])this._compactionGraph.cNodes.push(r.second),r.second.cGroup!=null&&this._compactionGraph.cGroups.push(r.second.cGroup)}_removePlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[]){let i=this._compactionGraph.cNodes.indexOf(r.second);i>=0&&this._compactionGraph.cNodes.splice(i,1);let s=this._compactionGraph.cGroups.indexOf(r.second.cGroup);s>=0&&this._compactionGraph.cGroups.splice(s,1)}}_updatePlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[]){let i=r.second,a=r.first.deltaNormalized;switch(o){case R.LEFT:case R.RIGHT:i.hitbox.y+=a;break;case R.UP:case R.DOWN:i.hitbox.x+=a;break}}}_updateExternalExtensionDimensions(t){for(let[e,o]of this._transformer.getExternalExtensions()){if(t===ir.VERT){if(e.getDirection()!==R.UP&&e.getDirection()!==R.DOWN)continue}else if(e.getDirection()!==R.LEFT&&e.getDirection()!==R.RIGHT)continue;let r=o.second,s=o.first.deltaNormalized;switch(e.getDirection()){case R.LEFT:r.hitbox.x=this._topLeft.x,r.hitbox.width=Math.max(1,r.hitbox.width+s);break;case R.RIGHT:r.hitbox.x=r.hitbox.x+s,r.hitbox.width=Math.max(1,r.hitbox.width-s);break;case R.UP:r.hitbox.y=this._topLeft.y,r.hitbox.height=Math.max(1,r.hitbox.height+s);break;case R.DOWN:r.hitbox.y=r.hitbox.y+s,r.hitbox.height=Math.max(1,r.hitbox.height-s);break}}}};na.MAX_ITERATION=10;na.EPSILON=1e-4;var Ye=class n{constructor(t,e,o){this.x=t,this.y=e,this.quadrant=o,this.convex=!0}static from(t){return new n(t.x,t.y)}toString(){return`(${this.x}, ${this.y}${this.convex?"cx":""}${this.quadrant})`}equals(t){return t==null||!(t instanceof n)?!1:this.x===t.x&&this.y===t.y}},Bt=class n{constructor(t){this.name=t,Object.freeze(this)}isUpper(){return this===n.Q1||this===n.Q2}isLeft(){return this===n.Q1||this===n.Q4}static isBothLeftOrBothRight(t,e){return t===n.Q1&&e===n.Q4||t===n.Q4&&e===n.Q1||t===n.Q3&&e===n.Q2||t===n.Q2&&e===n.Q3}static isOneLeftOneRight(t,e){return t===n.Q1&&e===n.Q2||t===n.Q1&&e===n.Q3||t===n.Q4&&e===n.Q3||t===n.Q4&&e===n.Q2}toString(){return this.name}};Bt.Q1=new Bt("Q1");Bt.Q4=new Bt("Q4");Bt.Q2=new Bt("Q2");Bt.Q3=new Bt("Q3");var rO=new Map([[Bt.Q1,0],[Bt.Q4,1],[Bt.Q2,2],[Bt.Q3,3]]),dR=(n,t)=>n.x===t.x?t.y-n.y:n.x-t.x,fR=(n,t)=>n.x===t.x?n.y-t.y:n.x-t.x,uR=(n,t)=>n.x===t.x?t.y-n.y:t.x-n.x,_R=(n,t)=>n.x===t.x?n.y-t.y:t.x-n.x,pR=(n,t)=>{if(n.x===t.x){if(n.quadrant===t.quadrant||Bt.isBothLeftOrBothRight(n.quadrant,t.quadrant)){let e=n.quadrant.isLeft()?1:-1;if(n.convex&&!t.convex)return e;if(!n.convex&&t.convex)return-e}return rO.get(n.quadrant)-rO.get(t.quadrant)}return n.x-t.x},aa=class{constructor(t){switch(this.quadrant=t,this.points=[],t){case Bt.Q1:case Bt.Q2:this._compare=(e,o)=>o-e,this._maximalY=Number.POSITIVE_INFINITY;break;case Bt.Q3:case Bt.Q4:this._compare=(e,o)=>e-o,this._maximalY=Number.NEGATIVE_INFINITY;break}}handle(t){this._compare(t.y,this._maximalY)>0&&(this.points.push(new Ye(t.x,t.y,this.quadrant)),this._maximalY=t.y)}},dl=class n{constructor(){this.hull=[],this.xMax1=null,this.xMax2=null,this.xMin1=null,this.xMin2=null,this.yMax1=null,this.yMax2=null,this.yMin1=null,this.yMin2=null}static of(t){let e=new n;for(let a of t)(e.xMax1==null||a.x>=e.xMax1.x)&&(e.xMax2=e.xMax1,e.xMax1=a),(e.xMin1==null||a.x<=e.xMin1.x)&&(e.xMin2=e.xMin1,e.xMin1=a),(e.yMax1==null||a.y>=e.yMax1.y)&&(e.yMax2=e.yMax1,e.yMax1=a),(e.yMin1==null||a.y<=e.yMin1.y)&&(e.yMin2=e.yMin1,e.yMin1=a);let o=new aa(Bt.Q1);Zo.execute(t,fR,o);let r=new aa(Bt.Q4);Zo.execute(t,dR,r);let i=new aa(Bt.Q2);Zo.execute(t,_R,i);let s=new aa(Bt.Q3);Zo.execute(t,uR,s),n._addConcaveCorners(o.points,Bt.Q1),n._addConcaveCorners(i.points,Bt.Q2),n._addConcaveCorners(s.points,Bt.Q3),n._addConcaveCorners(r.points,Bt.Q4),e.hull=[];for(let a of o.points)e.hull.push(a);for(let a=i.points.length-1;a>=0;a--)e.hull.push(i.points[a]);for(let a of s.points)e.hull.push(a);for(let a=r.points.length-1;a>=0;a--)e.hull.push(r.points[a]);return e}getHull(){return this.hull}splitIntoRectangles(){let t=new q_(this);return Zo.execute(this.hull,pR,t),t.queued!=null&&t.rects.push(t.queued),t.rects}static _addConcaveCorners(t,e){let o=[];if(t.length!==0){o.push(t[0]);for(let r=1;r<t.length;r++){let i=t[r-1],s=t[r],a=new Ye(s.x,i.y,e);a.convex=!1,o.push(a),o.push(s)}t.length=0;for(let r of o)t.push(r)}}},q_=class{constructor(t){this._hull=t,this.rects=[],this._minY=null,this._maxY=null,this._lastX=Math.min(t.xMin1.x,t.xMin2.x),this.queued=null,this._queuedPnt=null}handle(t){if(this.queued!=null&&(t.x!==this._queuedPnt.x||Bt.isOneLeftOneRight(this._queuedPnt.quadrant,t.quadrant))&&(this.rects.push(this.queued),this._lastX=this.queued.x+this.queued.width,this.queued=null,this._queuedPnt=null),t.quadrant.isUpper()?this._minY=t:this._maxY=t,(t.quadrant===Bt.Q1&&!t.convex||t.quadrant===Bt.Q2&&t.convex||t.quadrant===Bt.Q3&&t.convex||t.quadrant===Bt.Q4&&!t.convex)&&this._minY!=null&&this._maxY!=null){let e=new dt(this._lastX,this._minY.y,t.x-this._lastX,this._maxY.y-this._minY.y);this.queued=e,this._queuedPnt=t}}};var Er=class n{constructor(){this._compactor=null,this._yetAnotherOffset=null,this._compactedGraphSize=null,this._graphTopLeft=null,this._graphBottomRight=null}compact(t,e,o){this._graphTopLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this._graphBottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let i of t)for(let s of i.getLayerlessNodes()){let a=s.getPosition(),l=s.getSize(),c=s.getMargin();this._graphTopLeft.x=Math.min(this._graphTopLeft.x,a.x-c.left),this._graphTopLeft.y=Math.min(this._graphTopLeft.y,a.y-c.top),this._graphBottomRight.x=Math.max(this._graphBottomRight.x,a.x+l.x+c.right),this._graphBottomRight.y=Math.max(this._graphBottomRight.y,a.y+l.y+c.bottom)}let r=new J_;for(let i of t){let s=this._transformLGraph(i);r.getComponents().push(s),s.containsRegularNodes|=s.getExternalExtensionSides().size!==0}this._compactor=na.init(r,o),this._compactor.compact(new Ie),this._yetAnotherOffset=new O,this._compactedGraphSize=this._compactor.getGraphSize();for(let i of r.getComponents()){let s=this._compactor.getOffset(i);z.offsetGraph(i.graph,s.x,s.y);for(let a of i.getNodes())if(a.getType()===y.EXTERNAL_PORT){let l=this._getExternalPortPosition(a.getPosition(),a.getProperty(p.EXT_PORT_SIDE));a.getPosition().reset().add(l)}}for(let i of r.getComponents())for(let s of i.getExternalEdges()){let a=new st;for(let c of s.getBendPoints())a.add(c);a.add(0,s.getSource().getAbsoluteAnchor()),a.add(s.getTarget().getAbsoluteAnchor());let l=null;for(let c of a){if(l==null){l=c;continue}Math.abs(l.x-c.x)<n.EPSILON?(this._yetAnotherOffset.x=Math.min(this._yetAnotherOffset.x,l.x),this._compactedGraphSize.x=Math.max(this._compactedGraphSize.x,l.x)):Math.abs(l.y-c.y)<n.EPSILON&&(this._yetAnotherOffset.y=Math.min(this._yetAnotherOffset.y,l.y),this._compactedGraphSize.y=Math.max(this._compactedGraphSize.y,l.y)),l=c}}this._yetAnotherOffset.negate(),this._compactedGraphSize.add(this._yetAnotherOffset)}getOffset(){return this._yetAnotherOffset}getGraphSize(){return this._compactedGraphSize}_transformLGraph(t){let e=new Q_(t);e.containsRegularNodes||this._createDummyNode(t);let o=new op;n._componentHullPoints(t,o);let r=new Map;for(let a of[R.LEFT,R.RIGHT,R.UP,R.DOWN,R.UNDEFINED])r.set(a,[]);let i=new ip;for(let a of t.getLayerlessNodes())for(let l of a.getOutgoingEdges())if(n._isExternalEdge(l)){let c=this._transformLEdge(l,o,i),g=c.getDirection(),h=r.get(g)||[];h.push(c.getRepresentative()),r.set(g,h)}let s=[];for(let a of e.getExternalExtensionSides()){let l=a.ordinal(),c=i.min[l],g=i.max[l],h=i.extent[l],d=null,f=null;switch(a){case u.WEST:d=new dt(this._graphTopLeft.x,c,o.topLeft.x-this._graphTopLeft.x,g-c),f=new dt(this._graphTopLeft.x,c,h,g-c),o.add(d.getTopRight()),o.add(d.getBottomRight());break;case u.EAST:d=new dt(o.bottomRight.x,c,this._graphBottomRight.x-o.bottomRight.x,g-c),f=new dt(this._graphBottomRight.x-h,c,h,g-c),o.add(d.getTopLeft()),o.add(d.getBottomLeft());break;case u.NORTH:d=new dt(c,this._graphTopLeft.y,g-c,o.topLeft.y-this._graphTopLeft.y),f=new dt(c,this._graphTopLeft.y,g-c,h),o.add(d.getBottomLeft()),o.add(d.getBottomRight());break;case u.SOUTH:d=new dt(c,o.bottomRight.y,g-c,this._graphBottomRight.y-o.bottomRight.y),f=new dt(c,this._graphBottomRight.y-h,g-c,h),o.add(d.getTopLeft()),o.add(d.getTopRight());break}if(d!=null){let E=new tp;E.side=a,E.extension=d,E.placeholder=f,E.edges=new Set(r.get(n._portSideToDirection(a))||[]),s.push(E)}}for(let a of s)e.externalExtensions.push(a);return e.rectilinearConvexHull=dl.of(o).splitIntoRectangles(),e}_createDummyNode(t){if(t.getLayerlessNodes().length!==1)throw new Error("_createDummyNode precondition failed");let e=t.getLayerlessNodes()[0],o=new ft(t);switch(t.getLayerlessNodes().push(o),o.getSize().x=Math.max(1,e.getSize().x),o.getSize().y=Math.max(1,e.getSize().y),o.getPosition().x=e.getPosition().x,o.getPosition().y=e.getPosition().y,e.getProperty(p.EXT_PORT_SIDE)){case u.WEST:o.getPosition().x+=2;break;case u.NORTH:o.getPosition().y+=2;break;case u.EAST:o.getPosition().x-=2;break;case u.SOUTH:o.getPosition().y-=2;break}let r=new rt;r.setNode(o);let i=new _e,s=e.getPorts()[0];return i.setSource(s),i.setTarget(r),r.getPosition().reset().add(s.getPosition()),r.getAnchor().reset().add(s.getAnchor()),o}static _componentHullPoints(t,e){for(let o of t.getLayerlessNodes())if(o.getType()!==y.EXTERNAL_PORT){n._addLGraphElementBounds(e,o,new O);for(let r of o.getOutgoingEdges())if(!n._isExternalEdge(r))for(let i of r.getBendPoints())e.add(Ye.from(i))}}static _addLGraphElementBounds(t,e,o){let r=null;e instanceof ft||e instanceof rt?r=e.getMargin():r=new Gr;let i=e.getPosition().x,s=e.getPosition().y,a=e.getSize().x,l=e.getSize().y;t.add(new Ye(i-r.left+o.x,s-r.top+o.y)),t.add(new Ye(i-r.left+o.x,s+l+r.bottom+o.y)),t.add(new Ye(i+a+r.right+o.x,s-r.top+o.y)),t.add(new Ye(i+a+r.right+o.x,s+l+r.bottom+o.y))}static _isExternalEdge(t){return t.getSource().getNode().getType()===y.EXTERNAL_PORT||t.getTarget().getNode().getType()===y.EXTERNAL_PORT}_transformLEdge(t,e,o){let r=new ep(t),i=n._edgeToSegments(t,r),s=Math.max(t.getProperty(_.EDGE_THICKNESS)||1,1);for(let d of i.innerSegments){let f=n._segmentToRectangle(d.first,d.second,s);e.addRect(f)}let a=r.externalPortSide,l=n._segmentToRectangle(i.outerSegment.first,i.outerSegment.second,s),c=a.ordinal();a===u.WEST||a===u.EAST?(o.min[c]=Math.min(o.min[c],l.y),o.max[c]=Math.max(o.max[c],l.y+l.height)):(o.min[c]=Math.min(o.min[c],l.x),o.max[c]=Math.max(o.max[c],l.x+l.width));let g=Number.NEGATIVE_INFINITY,h=r.externalPort.getNode().getMargin();switch(a){case u.WEST:g=h.right;break;case u.EAST:g=h.left;break;case u.NORTH:g=h.bottom;break;case u.SOUTH:g=h.top;break}return o.extent[c]=Math.max(o.extent[c],g),r}static _segmentToRectangle(t,e,o){return new dt(Math.min(t.x,e.x)-o/2,Math.min(t.y,e.y)-o/2,Math.abs(t.x-e.x)+o,Math.abs(t.y-e.y)+o)}static _edgeToSegments(t,e){let o=e.externalPort,r=e.externalPortSide,i=t.getSource().getAbsoluteAnchor(),s=t.getTarget().getAbsoluteAnchor();o===t.getSource()?(i=n._getExternalPortPositionStatic(i,r,null),s=n._getPortPositionOnMargin(t.getTarget())):(i=n._getPortPositionOnMargin(t.getSource()),s=n._getExternalPortPositionStatic(s,r,null));let a=new st;for(let g of t.getBendPoints())a.add(g);a.addFirst(i),a.addLast(s);let l=t.getSource()===o,c=new rp;for(let g=0;g<a.size()-1;g++){let h={first:a.get(g),second:a.get(g+1)};l&&g===0||!l&&g===a.size()-2?c.outerSegment=h:c.innerSegments.push(h)}return c}_getExternalPortPosition(t,e){return n._getExternalPortPositionStatic(t,e,this)}static _getExternalPortPositionStatic(t,e,o){if(o==null||o._graphTopLeft==null||o._graphBottomRight==null)return t.clone();switch(e){case u.NORTH:return new O(t.x,Math.min(o._graphTopLeft.y,t.y));case u.EAST:return new O(Math.max(o._graphBottomRight.x,t.x),t.y);case u.SOUTH:return new O(t.x,Math.max(o._graphBottomRight.y,t.y));case u.WEST:return new O(Math.min(t.x,o._graphTopLeft.x),t.y)}return t.clone()}static _getPortPositionOnMargin(t){let e=t.getAbsoluteAnchor().clone(),o=t.getNode().getMargin();switch(t.getSide()){case u.NORTH:e.y-=o.top;break;case u.EAST:e.x+=o.right;break;case u.SOUTH:e.y+=o.bottom;break;case u.WEST:e.x-=o.left;break}return e}static _portSideToDirection(t){switch(t){case u.NORTH:return R.UP;case u.WEST:return R.LEFT;case u.EAST:return R.RIGHT;case u.SOUTH:return R.DOWN}return R.UNDEFINED}};Er.EPSILON=1e-4;var J_=class{constructor(){this._components=[],this.containsExternalPorts=!1}getComponents(){return this._components}isContainsExternalExtensions(){return this.containsExternalPorts}*[Symbol.iterator](){yield*nr(this._components)}},Q_=class{constructor(t){this.graph=t,this.containsRegularNodes=!1;for(let e of t.getLayerlessNodes())this.containsRegularNodes|=e.getType()===y.NORMAL;this.rectilinearConvexHull=[],this.externalExtensions=[]}getExternalExtensionSides(){return this.graph.getProperty(p.EXT_PORT_CONNECTIONS)||new Set}getHull(){return this.rectilinearConvexHull}getExternalExtensions(){return this.externalExtensions}getNodes(){return this.graph.getLayerlessNodes()}getExternalEdges(){let t=[];for(let e of this.externalExtensions)for(let o of e.getRepresentative())t.push(o);return t}},tp=class{constructor(){this.edges=new Set,this.side=null,this.extension=null,this.placeholder=null}getRepresentative(){return this.edges}getRepresentor(){return this.extension}getParent(){throw new Error("InternalUnionExternalExtension.getParent is unsupported")}getDirection(){return Er._portSideToDirection(this.side)}getPlaceholder(){return this.placeholder}},ep=class{constructor(t){if(this.edge=t,this.externalPort=null,this.externalPortSide=null,this.externalExtensionRect=null,this.parent=null,t.getSource().getNode().getType()===y.EXTERNAL_PORT)this.externalPort=t.getSource(),this.externalPortSide=t.getSource().getNode().getProperty(p.EXT_PORT_SIDE);else if(t.getTarget().getNode().getType()===y.EXTERNAL_PORT)this.externalPort=t.getTarget(),this.externalPortSide=t.getTarget().getNode().getProperty(p.EXT_PORT_SIDE);else throw new Error(`Edge ${t} is not an external edge`)}getDirection(){return Er._portSideToDirection(this.externalPortSide)}getRepresentative(){return this.edge}getRepresentor(){return this.externalExtensionRect}getParent(){return this.parent}},op=class extends Array{constructor(){super(),this.topLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this.bottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)}add(t){let e=t instanceof Ye?t:Ye.from(t);return this.topLeft.x=Math.min(this.topLeft.x,e.x),this.topLeft.y=Math.min(this.topLeft.y,e.y),this.bottomRight.x=Math.max(this.bottomRight.x,e.x),this.bottomRight.y=Math.max(this.bottomRight.y,e.y),super.push(e),!0}addRect(t){this.add(new Ye(t.x,t.y)),this.add(new Ye(t.x+t.width,t.y)),this.add(new Ye(t.x,t.y+t.height)),this.add(new Ye(t.x+t.width,t.y+t.height))}},rp=class{constructor(){this.innerSegments=[],this.outerSegment=null}},ip=class{constructor(){this.min=new Array(5).fill(Number.POSITIVE_INFINITY),this.max=new Array(5).fill(Number.NEGATIVE_INFINITY),this.extent=new Array(5).fill(Number.NEGATIVE_INFINITY)}};var la=class extends ra{combine(t,e){if(t.length===1){let a=t[0];a!==e&&(e.getLayerlessNodes().length=0,this.moveGraph(e,a,0,0),e.copyProperties(a),e.getPadding().copy(a.getPadding()),e.getSize().x=a.getSize().x,e.getSize().y=a.getSize().y);return}else if(t.length===0){e.getLayerlessNodes().length=0,e.getSize().x=0,e.getSize().y=0;return}this.sortComponents(t,e);let o=t[0];e.getLayerlessNodes().length=0,e.copyProperties(o);let r=0,i=0;for(let a of t){let l=a.getSize();r=Math.max(r,l.x),i+=l.x*l.y}r=Math.max(r,Math.sqrt(i)*e.getProperty(_.ASPECT_RATIO));let s=e.getProperty(_.SPACING_COMPONENT_COMPONENT);if(this.placeComponents(t,e,r,s),o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)){let a=new Er;a.compact(t,e.getSize(),s);for(let l of t)l.getOffset().reset().add(a.getOffset());e.getSize().reset().add(a.getGraphSize())}this.moveGraphs(e,t,0,0)}sortComponents(t,e){if(e.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)===Me.NONE){for(let o of t){let r=0;for(let i of o.getLayerlessNodes())r+=i.getProperty(_.PRIORITY)||0;o.id=r}t.sort((o,r)=>{let i=r.id-o.id;if(i===0){let s=o.getSize().x*o.getSize().y,a=r.getSize().x*r.getSize().y;return s-a}return i})}}placeComponents(t,e,o,r){let i=0,s=0,a=0,l=r;for(let c of t){let g=c.getSize();i+g.x>o&&(i=0,s+=a+r,a=0);let h=c.getOffset();this.offsetGraph(c,i+h.x,s+h.y),h.reset(),l=Math.max(l,i+g.x),a=Math.max(a,g.y),i+=g.x+r}e.getSize().x=l,e.getSize().y=s+a}};var{SIDES_EAST:Pf,SIDES_EAST_SOUTH:ca,SIDES_EAST_SOUTH_WEST:no,SIDES_EAST_WEST:Vi,SIDES_NONE:iO,SIDES_NORTH:Of,SIDES_NORTH_EAST:ga,SIDES_NORTH_EAST_SOUTH:ao,SIDES_NORTH_EAST_SOUTH_WEST:pe,SIDES_NORTH_EAST_WEST:lo,SIDES_NORTH_SOUTH:Xi,SIDES_NORTH_SOUTH_WEST:co,SIDES_NORTH_WEST:ha,SIDES_SOUTH:Sf,SIDES_SOUTH_WEST:da,SIDES_WEST:Tf}=u,zr=class n{constructor(t){this.components=new Map,t!==void 0&&this.add(t)}add(t){if(this._canAdd(t)){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=this.components.get(e);return o===void 0&&(o=[],this.components.set(e,o)),o.push(t),!0}return!1}_canAdd(t){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=n.CONSTRAINTS.get(e);if(!o)return!0;for(let r of o){let i=this.components.get(r);if(i&&i.length>0)return!1}return!0}*getPortSides(){for(let[t,e]of this.components)for(let o=0;o<e.length;o++)yield t}getComponents(t){if(t!==void 0)return this.components.get(t)||[];let e=[];for(let o of this.components.values())for(let r of o)e.push(r);return e}};zr.CONSTRAINTS=new Map;function et(n,t){let e=zr.CONSTRAINTS.get(n);e||(e=[],zr.CONSTRAINTS.set(n,e)),e.push(t)}et(iO,pe);et(Tf,pe);et(Tf,co);et(Pf,ao);et(Pf,pe);et(Of,pe);et(Of,lo);et(Sf,no);et(Sf,pe);et(Xi,Vi);et(Xi,pe);et(Xi,lo);et(Xi,no);et(Vi,Xi);et(Vi,co);et(Vi,ao);et(Vi,pe);et(ha,ha);et(ha,lo);et(ha,co);et(ga,ga);et(ga,lo);et(ga,ao);et(da,da);et(da,no);et(da,co);et(ca,ca);et(ca,no);et(ca,ao);et(lo,Of);et(lo,Xi);et(lo,ha);et(lo,ga);et(lo,pe);et(lo,lo);et(lo,co);et(lo,ao);et(no,Sf);et(no,Xi);et(no,da);et(no,ca);et(no,no);et(no,co);et(no,ao);et(no,pe);et(co,Tf);et(co,Vi);et(co,ha);et(co,da);et(co,lo);et(co,no);et(co,co);et(co,pe);et(ao,Pf);et(ao,Vi);et(ao,ga);et(ao,ca);et(ao,lo);et(ao,no);et(ao,ao);et(ao,pe);et(pe,iO);et(pe,Tf);et(pe,Pf);et(pe,Of);et(pe,Sf);et(pe,Xi);et(pe,Vi);et(pe,lo);et(pe,no);et(pe,co);et(pe,ao);et(pe,pe);var{SIDES_EAST:sO,SIDES_EAST_SOUTH:nO,SIDES_EAST_SOUTH_WEST:aO,SIDES_EAST_WEST:lO,SIDES_NONE:cO,SIDES_NORTH:gO,SIDES_NORTH_EAST:hO,SIDES_NORTH_EAST_SOUTH:dO,SIDES_NORTH_EAST_SOUTH_WEST:fO,SIDES_NORTH_EAST_WEST:ER,SIDES_NORTH_SOUTH:uO,SIDES_NORTH_SOUTH_WEST:mR,SIDES_NORTH_WEST:PR,SIDES_SOUTH:_O,SIDES_SOUTH_WEST:pO,SIDES_WEST:EO}=u,fa=class extends ra{constructor(){super(),this.componentGroups=[]}combine(t,e){if(this.componentGroups.length=0,e.getLayerlessNodes().length=0,t.length===0){e.getSize().x=0,e.getSize().y=0;return}let o=t[0];e.copyProperties(o);for(let s of t)this._addComponent(s);let r=new O,i=o.getProperty(_.SPACING_COMPONENT_COMPONENT);for(let s of this.componentGroups){let a=this._placeComponents(s,i);this.offsetGraphs(s.getComponents(),r.x,r.y),r.x+=a.x,r.y+=a.y}if(e.getSize().x=r.x-i,e.getSize().y=r.y-i,o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)&&o.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL){for(let a of t)this.offsetGraph(a,a.getOffset().x,a.getOffset().y);let s=new Er;s.compact(t,e.getSize(),i);for(let a of t)a.getOffset().reset().add(s.getOffset());e.getSize().reset().add(s.getGraphSize())}for(let s of this.componentGroups)this.moveGraphs(e,s.getComponents(),0,0)}_addComponent(t){for(let e of this.componentGroups)if(e.add(t))return;this.componentGroups.push(new zr(t))}_placeComponents(t,e){let o=this._placeComponentsInRows(t.getComponents(cO),e),r=this._placeComponentsHorizontally(t.getComponents(gO),e),i=this._placeComponentsHorizontally(t.getComponents(_O),e),s=this._placeComponentsVertically(t.getComponents(EO),e),a=this._placeComponentsVertically(t.getComponents(sO),e),l=this._placeComponentsHorizontally(t.getComponents(PR),e),c=this._placeComponentsHorizontally(t.getComponents(hO),e),g=this._placeComponentsHorizontally(t.getComponents(pO),e),h=this._placeComponentsHorizontally(t.getComponents(nO),e),d=this._placeComponentsVertically(t.getComponents(lO),e),f=this._placeComponentsHorizontally(t.getComponents(uO),e),E=this._placeComponentsHorizontally(t.getComponents(ER),e),P=this._placeComponentsHorizontally(t.getComponents(aO),e),S=this._placeComponentsVertically(t.getComponents(mR),e),T=this._placeComponentsVertically(t.getComponents(dO),e),N=this._placeComponentsHorizontally(t.getComponents(fO),e),I=Ft.maxd(l.x,s.x,g.x,S.x),C=Ft.maxd(r.x,o.x,i.x,N.x),x=f.x,M=Ft.maxd(c.x,a.x,h.x,T.x),A=Ft.maxd(l.y,r.y,c.y,E.y),B=Ft.maxd(s.y,o.y,a.y,N.y),Y=d.y,j=Ft.maxd(g.y,i.y,h.y,P.y);this.offsetGraphs(t.getComponents(cO),I+x,A+Y),this.offsetGraphs(t.getComponents(fO),I+x,A+Y),this.offsetGraphs(t.getComponents(gO),I+x,0),this.offsetGraphs(t.getComponents(_O),I+x,A+Y+B),this.offsetGraphs(t.getComponents(EO),0,A+Y),this.offsetGraphs(t.getComponents(sO),I+x+C,A+Y),this.offsetGraphs(t.getComponents(hO),I+x+C,0),this.offsetGraphs(t.getComponents(pO),0,A+Y+B),this.offsetGraphs(t.getComponents(nO),I+x+C,A+Y+B),this.offsetGraphs(t.getComponents(lO),0,A),this.offsetGraphs(t.getComponents(uO),I,0),this.offsetGraphs(t.getComponents(aO),0,A+Y+B),this.offsetGraphs(t.getComponents(dO),I+x+C,0);let X=new O;return X.x=Ft.maxd(I+C+x+M,d.x,E.x,P.x),X.y=Ft.maxd(A+B+Y+j,f.y,S.y,T.y),X}_placeComponentsHorizontally(t,e){let o=new O;for(let r of t)this.offsetGraph(r,o.x,0),o.x+=r.getSize().x+e,o.y=Math.max(o.y,r.getSize().y);return o.y>0&&(o.y+=e),o}_placeComponentsVertically(t,e){let o=new O;for(let r of t)this.offsetGraph(r,0,o.y),o.y+=r.getSize().y+e,o.x=Math.max(o.x,r.getSize().x);return o.x>0&&(o.x+=e),o}_placeComponentsInRows(t,e){if(t.length===0)return new O;let o=0,r=0;for(let c of t){let g=c.getSize();o=Math.max(o,g.x),r+=g.x*g.y}o=Math.max(o,Math.sqrt(r)*t[0].getProperty(_.ASPECT_RATIO));let i=0,s=0,a=0,l=e;for(let c of t){let g=c.getSize();i+g.x>o&&(i=0,s+=a+e,a=0),this.offsetGraph(c,i,s),l=Math.max(l,i+g.x),a=Math.max(a,g.y),i+=g.x+e}return new O(l+e,s+a+e)}};var{SIDES_EAST:po,SIDES_EAST_SOUTH:ko,SIDES_EAST_SOUTH_WEST:gi,SIDES_EAST_WEST:Eo,SIDES_NONE:Co,SIDES_NORTH:Wo,SIDES_NORTH_EAST:to,SIDES_NORTH_EAST_SOUTH:hi,SIDES_NORTH_EAST_SOUTH_WEST:Nf,SIDES_NORTH_EAST_WEST:Ki,SIDES_NORTH_SOUTH:di,SIDES_NORTH_SOUTH_WEST:Yr,SIDES_NORTH_WEST:sr,SIDES_SOUTH:go,SIDES_SOUTH_WEST:xo,SIDES_WEST:Do}=u,ws=class n extends zr{constructor(t){super(),this.componentOrder=[],t!==void 0&&this.add(t)}add(t){if(this._canAdd(t)){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=this.components.get(e);return o===void 0&&(o=[],this.components.set(e,o)),o.push(t),this.componentOrder.push(t),!0}return!1}_canAdd(t){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=zr.CONSTRAINTS.get(e),r=n.MODEL_ORDER_CONSTRAINTS.get(e);if(o)for(let i of o){let s=this.components.get(i);if(s&&s.length>0)return!1}if(r)for(let i of r){let s=this.components.get(i);if(s&&s.length>0)return!1}return!0}getComponentOrder(){return this.componentOrder}};ws.MODEL_ORDER_CONSTRAINTS=new Map;function F(n,t){let e=ws.MODEL_ORDER_CONSTRAINTS.get(n);e||(e=[],ws.MODEL_ORDER_CONSTRAINTS.set(n,e)),e.push(t)}F(Wo,Co);F(Do,Co);F(to,Co);F(sr,Co);F(Yr,Co);F(Ki,Co);F(sr,Wo);F(Co,po);F(Wo,po);F(Do,po);F(to,po);F(di,po);F(sr,po);F(Yr,po);F(Ki,po);F(Eo,po);F(Co,go);F(Wo,go);F(po,go);F(Do,go);F(to,go);F(di,go);F(sr,go);F(Eo,go);F(xo,go);F(Yr,go);F(hi,go);F(Ki,go);F(Wo,Do);F(to,Do);F(sr,Do);F(Ki,Do);F(Wo,to);F(Do,to);F(sr,to);F(to,to);F(Yr,to);F(Co,ko);F(Wo,ko);F(po,ko);F(go,ko);F(Do,ko);F(to,ko);F(di,ko);F(sr,ko);F(xo,ko);F(Eo,ko);F(Ki,ko);F(Yr,ko);F(Nf,ko);F(Co,xo);F(Wo,xo);F(po,xo);F(Do,xo);F(to,xo);F(di,xo);F(sr,xo);F(Eo,xo);F(Ki,xo);F(hi,xo);F(Nf,xo);F(Wo,Eo);F(Do,Eo);F(to,Eo);F(sr,Eo);F(xo,Eo);F(Ki,Eo);F(Yr,Eo);F(Co,gi);F(Wo,gi);F(po,gi);F(Do,gi);F(to,gi);F(di,gi);F(sr,gi);F(Eo,gi);F(Ki,gi);F(Wo,Yr);F(po,Yr);F(go,Yr);F(to,Yr);F(Co,hi);F(Wo,hi);F(go,hi);F(Do,hi);F(to,hi);F(di,hi);F(sr,hi);F(sr,Nf);F(to,Nf);F(Eo,Co);F(Eo,Do);F(Eo,po);F(di,Co);F(di,Wo);F(di,go);var yf=class extends fa{combine(t,e){if(this.componentGroups.length=0,e.getLayerlessNodes().length=0,t.length===0){e.getSize().x=0,e.getSize().y=0;return}let o=t[0];e.copyProperties(o);for(let d of t)this._addComponent(d);let r=new O,i=new O,s=new O,a=new O,l=o.getProperty(_.SPACING_COMPONENT_COMPONENT),c=e.getProperty(lr),g=c&&c.isHorizontal&&c.isHorizontal(),h=c&&c.isVertical&&c.isVertical();for(let d of this.componentGroups){if(g){s.x=r.x;for(let E of d.getPortSides())if(E.has(u.NORTH)){s.x=i.x;break}}else if(h){s.y=r.y;for(let E of d.getPortSides())if(E.has(u.WEST)){s.y=i.y;break}}let f=this._placeComponents(d,l);if(this.offsetGraphs(d.getComponents(),s.x,s.y),g){i.x=s.x+f.x,a.x=Math.max(a.x,i.x);for(let E of d.getPortSides())if(E.has(u.SOUTH)){r.x=s.x+f.x;break}i.y=s.y+f.y,s.y=i.y,a.y=Math.max(a.y,s.y)}else if(h){i.y=s.y+f.y,a.y=Math.max(a.y,i.y);for(let E of d.getPortSides())if(E.has(u.EAST)){r.y=s.y+f.y;break}i.x=s.x+f.x,s.x=i.x,a.x=Math.max(a.x,s.x)}}if(e.getSize().x=a.x-l,e.getSize().y=a.y-l,o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)&&o.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL){for(let f of t)this.offsetGraph(f,f.getOffset().x,f.getOffset().y);let d=new Er;d.compact(t,e.getSize(),l);for(let f of t)f.getOffset().reset().add(d.getOffset());e.getSize().reset().add(d.getGraphSize())}for(let d of this.componentGroups)this.moveGraphs(e,d.getComponents(),0,0)}_addComponent(t){this.componentGroups.length>0&&this.componentGroups[this.componentGroups.length-1].add(t)||this.componentGroups.push(new ws(t))}};var If=class extends la{sortComponents(t,e){}placeComponents(t,e,o,r){let i=0,s=0,a=0,l=r,c=null,g=0;for(let h of t){let d=h.getSize(),f=h.getProperty(p.EXT_PORT_CONNECTIONS),E=c?c.getProperty(p.EXT_PORT_CONNECTIONS):null;(i+d.x>o&&!(f&&f.has(u.NORTH))||E&&E.has(u.EAST)||f&&f.has(u.WEST))&&(i=g,s+=a+r,a=0);let P=h.getOffset();f&&f.has(u.NORTH)&&(i=l+r),this.offsetGraph(h,i+P.x,s+P.y),l=Math.max(l,i+d.x),f&&f.has(u.SOUTH)&&(g=Math.max(g,i+d.x+r)),P.reset(),a=Math.max(a,d.y),i+=d.x+r,c=h}e.getSize().x=l,e.getSize().y=s+a}};var Rf=class{constructor(){this._componentGroupGraphPlacer=new fa,this._componentGroupModelOrderGraphPlacer=new yf,this._modelOrderRowGraphPlacer=new If,this._simpleRowGraphPlacer=new la,this._graphPlacer=this._simpleRowGraphPlacer}split(t){let e;this._graphPlacer=this._simpleRowGraphPlacer;let o=t.getProperty(_.SEPARATE_CONNECTED_COMPONENTS),r=o==null||o===!0,i=t.getProperty(p.GRAPH_PROPERTIES),s=i&&i.has(v.EXTERNAL_PORTS),a=t.getProperty(_.PORT_CONSTRAINTS),l=!(a&&typeof a.isOrderFixed=="function"&&a.isOrderFixed());if(r&&(l||!s)){for(let c of t.getLayerlessNodes())c.id=0;e=[];for(let c of t.getLayerlessNodes()){let g=this._dfs(c,null);if(g!=null){let h=new Nn;h.copyProperties(t),h.setProperty(p.EXT_PORT_CONNECTIONS,u.sidesOf(g.extPortSides)),h.getPadding().copy(t.getPadding()),h.setProperty(_.NODE_SIZE_MINIMUM,null);for(let d of g.nodes)h.getLayerlessNodes().push(d),d.setGraph(h);e.push(h)}}if(s){let c=t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS);c===Me.GROUP_MODEL_ORDER?this._graphPlacer=this._componentGroupModelOrderGraphPlacer:c===Me.MODEL_ORDER?this._graphPlacer=this._modelOrderRowGraphPlacer:this._graphPlacer=this._componentGroupGraphPlacer}}else e=[t];return t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)!==Me.NONE&&e.sort((c,g)=>{let h=z.getMinimalModelOrder(c),d=z.getMinimalModelOrder(g);return h-d}),e}_dfs(t,e){if(t.id===0){t.id=1;let o=e;o==null&&(o={nodes:[],extPortSides:new Set}),o.nodes.push(t),t.getType()===y.EXTERNAL_PORT&&o.extPortSides.add(t.getProperty(p.EXT_PORT_SIDE));for(let r of t.getPorts())for(let i of r.getConnectedPorts())this._dfs(i.getNode(),o);return o}return null}combine(t,e){this._graphPlacer.combine(t,e)}};var ua=class extends Gi{constructor(t=""){super(),this._text=t}getText(){return this._text}toString(){let t=this.getDesignation();return t==null?"label":`l_${t}`}getDesignation(){return this._text&&this._text.length>0?this._text:super.getDesignation()}};var Ms=class{constructor(t,e,o){this._newEdge=t,this._graph=e,this._type=o}toString(){return`${this._type.toString()}:${this._newEdge.toString()}`}getEdge(){return this._newEdge}getGraph(){return this._graph}getType(){return this._type}getActualSource(){let t=this._newEdge.getSource();return t.getNode().getType()===y.EXTERNAL_PORT?t.getNode().getProperty(p.ORIGIN):t}getActualTarget(){let t=this._newEdge.getTarget();return t.getNode().getType()===y.EXTERNAL_PORT?t.getNode().getProperty(p.ORIGIN):t}};var _a=class n{constructor(t){this._graph=t,this.compare=this.compare.bind(this)}compare(t,e){if(t.getType()===W.OUTPUT&&e.getType()===W.INPUT)return-1;if(t.getType()===W.INPUT&&e.getType()===W.OUTPUT)return 1;let o=n._hierarchyLevel(t.getGraph(),this._graph),r=n._hierarchyLevel(e.getGraph(),this._graph);return t.getType()===W.OUTPUT?r-o:o-r}static _hierarchyLevel(t,e){let o=t,r=0;for(;;){if(o===e)return r;let i=o.getParentNode();if(i==null)throw new Error("CrossHierarchyEdgeComparator: nestedGraph is not a descendant of topLevelGraph");o=i.getGraph(),r++}}};var fl=class n{constructor(){this._crossHierarchyMap=null,this._dummyNodeMap=new Map}process(t,e){e.begin("Compound graph preprocessor",1),this._crossHierarchyMap=new Map,this._transformHierarchyEdges(t,null),this._moveLabelsAndRemoveOriginalEdges(t),this._setSidesOfPortsToSidesOfDummyNodes(),t.setProperty(p.CROSS_HIERARCHY_MAP,this._crossHierarchyMap),this._crossHierarchyMap=null,this._dummyNodeMap.clear(),e.done()}_putCrossHierarchyEdge(t,e){let o=this._crossHierarchyMap.get(t);o==null&&(o=[],this._crossHierarchyMap.set(t,o)),o.push(e)}_setSidesOfPortsToSidesOfDummyNodes(){for(let[t,e]of this._dummyNodeMap.entries())e.setProperty(p.ORIGIN,t),t.setProperty(p.PORT_DUMMY,e),t.setProperty(p.INSIDE_CONNECTIONS,!0),t.setSide(e.getProperty(p.EXT_PORT_SIDE)),t.getNode().setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),t.getNode().getGraph().getProperty(p.GRAPH_PROPERTIES).add(v.NON_FREE_PORTS)}_transformHierarchyEdges(t,e){let o=[];for(let i of t.getLayerlessNodes()){let s=i.getNestedGraph();if(s==null)continue;let a=this._transformHierarchyEdges(s,i);if(o.push(...a),this._processInsideSelfLoops(s,i),s.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)){let l=i.getProperty(_.PORT_CONSTRAINTS),c=i.getProperty(_.PORT_LABELS_PLACEMENT),g=c!=null&&c.has!=null&&c.has(it.INSIDE);for(let h of i.getPorts()){let d=this._dummyNodeMap.get(h);d==null&&(d=z.createExternalPortDummy(h,l,h.getSide(),-h.getNetFlow(),null,new O,h.getSize(),s.getProperty(_.DIRECTION),s),d.setProperty(p.ORIGIN,h),this._dummyNodeMap.set(h,d),s.getLayerlessNodes().push(d));let f=d.getPorts()[0];for(let E of h.getLabels()){let P=new ua;if(P.getSize().x=E.getSize().x,P.getSize().y=E.getSize().y,f.getLabels().push(P),!g){let S=h.getSide(),T=0;c!=null&&it.isFixed(c)&&(T=iu(E.getPosition(),E.getSize(),h.getSize(),0,S)),l===H.FREE||u.SIDES_EAST_WEST.has(S)?P.getSize().x=T:P.getSize().y=T}}}}}let r=[];return this._processInnerHierarchicalEdgeSegments(t,e,o,r),e!=null&&this._processOuterHierarchicalEdgeSegments(t,e,r),r}_moveLabelsAndRemoveOriginalEdges(t){for(let e of this._crossHierarchyMap.keys()){let o=e.getLabels();if(o!=null&&o.length>0){let r=Array.from(this._crossHierarchyMap.get(e));r.sort(new _a(t).compare);let i=[];for(let s of o){let a=-1,l=s.getProperty(_.EDGE_LABELS_PLACEMENT);if(l===St.HEAD?a=r.length-1:l===St.CENTER?a=this._getShallowestEdgeSegment(r):l===St.TAIL&&(a=0),a!==-1){let c=r[a];c.getEdge().getLabels().push(s);let g=c.getEdge().getSource().getNode().getGraph().getProperty(p.GRAPH_PROPERTIES);g.add(v.END_LABELS),g.add(v.CENTER_LABELS),s.setProperty(p.ORIGINAL_LABEL_EDGE,e)}else i.push(s)}o.length=0,o.push(...i)}e.setSource(null),e.setTarget(null)}}_getShallowestEdgeSegment(t){let e=-1,o=0;for(let r of t){if(r.getType()===W.INPUT){e=o===0?0:o-1;break}else o===t.length-1&&(e=o);o+=1}return e}_processInnerHierarchicalEdgeSegments(t,e,o,r){let i=[];for(let s of o){let a=null;if(s.type===W.OUTPUT)for(let l of s.origEdges){let c=l.getTarget().getNode();if(c.getGraph()===t)this._connectChild(t,s,l,s.dummyPort,l.getTarget());else if(e==null||z.isDescendant(c,e))this._connectSiblings(t,s,o,l);else{let g=this._introduceHierarchicalEdgeSegment(t,e,l,s.dummyPort,W.OUTPUT,a);g!==a&&i.push(g),g.exported&&(a=g)}}else for(let l of s.origEdges){let c=l.getSource().getNode();if(c.getGraph()===t)this._connectChild(t,s,l,l.getSource(),s.dummyPort);else{if(e==null||z.isDescendant(c,e))continue;{let g=this._introduceHierarchicalEdgeSegment(t,e,l,s.dummyPort,W.INPUT,a);g!==a&&i.push(g),g.exported&&(a=g)}}}}for(let s of i){let a=t.getLayerlessNodes();a.includes(s.dummyNode)||a.push(s.dummyNode),s.exported&&r.push(s)}}_connectChild(t,e,o,r,i){let s=this._createDummyEdge(t,o);s.setSource(r),s.setTarget(i),this._putCrossHierarchyEdge(o,new Ms(s,t,e.type))}_connectSiblings(t,e,o,r){let i=null;for(let a of o)if(a!==e&&a.origEdges.includes(r)){i=a;break}let s=this._createDummyEdge(t,r);s.setSource(e.dummyPort),s.setTarget(i.dummyPort),this._putCrossHierarchyEdge(r,new Ms(s,t,e.type))}_processOuterHierarchicalEdgeSegments(t,e,o){let r=[];for(let i of t.getLayerlessNodes())for(let s of i.getPorts()){let a=null;for(let c of z.toEdgeArray(s.getOutgoingEdges()))if(!z.isDescendant(c.getTarget().getNode(),e)){let g=this._introduceHierarchicalEdgeSegment(t,e,c,c.getSource(),W.OUTPUT,a);g!==a&&r.push(g),g.exported&&(a=g)}let l=null;for(let c of z.toEdgeArray(s.getIncomingEdges()))if(!z.isDescendant(c.getSource().getNode(),e)){let g=this._introduceHierarchicalEdgeSegment(t,e,c,c.getTarget(),W.INPUT,l);g!==l&&r.push(g),g.exported&&(l=g)}}for(let i of r){let s=t.getLayerlessNodes();s.includes(i.dummyNode)||s.push(i.dummyNode),i.exported&&o.push(i)}}_processInsideSelfLoops(t,e){if(e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))for(let o of e.getPorts()){let r=z.toEdgeArray(o.getOutgoingEdges());for(let i of r){if(!(i.getTarget().getNode()===e&&i.getProperty(_.INSIDE_SELF_LOOPS_YO)))continue;let l=i.getSource(),c=this._dummyNodeMap.get(l);c==null&&(c=z.createExternalPortDummy(l,H.FREE,l.getSide(),-1,null,null,l.getSize(),t.getProperty(_.DIRECTION),t),c.setProperty(p.ORIGIN,l),this._dummyNodeMap.set(l,c),t.getLayerlessNodes().push(c));let g=i.getTarget(),h=this._dummyNodeMap.get(g);h==null&&(h=z.createExternalPortDummy(g,H.FREE,g.getSide(),1,null,null,g.getSize(),t.getProperty(_.DIRECTION),t),h.setProperty(p.ORIGIN,g),this._dummyNodeMap.set(g,h),t.getLayerlessNodes().push(h));let d=this._createDummyEdge(t,i);d.setSource(c.getPorts()[0]),d.setTarget(h.getPorts()[0]),this._putCrossHierarchyEdge(i,new Ms(d,t,W.OUTPUT)),t.getProperty(p.GRAPH_PROPERTIES).add(v.EXTERNAL_PORTS)}}}_introduceHierarchicalEdgeSegment(t,e,o,r,i,s){let a=t.getProperty(_.MERGE_HIERARCHY_EDGES),l=null;i===W.INPUT&&o.getSource().getNode()===e?l=o.getSource():i===W.OUTPUT&&o.getTarget().getNode()===e&&(l=o.getTarget());let c=s;if(c==null||!a||l!=null){let g=u.UNDEFINED;l!=null?g=l.getSide():e.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(g=i===W.INPUT?u.WEST:u.EAST);let h=this._createExternalPortDummyNode(t,e,i,g,o),d=this._createDummyEdge(e.getGraph(),o);i===W.INPUT?(d.setSource(h.getPorts()[0]),d.setTarget(r)):(d.setSource(r),d.setTarget(h.getPorts()[0])),c=new sp(o,d,h,h.getProperty(p.ORIGIN),i,l==null)}else{c.origEdges.push(o);let g=Math.max(c.newEdge.getProperty(_.EDGE_THICKNESS),o.getProperty(_.EDGE_THICKNESS));c.newEdge.setProperty(_.EDGE_THICKNESS,g)}return this._putCrossHierarchyEdge(o,new Ms(c.newEdge,t,i)),c}_createDummyEdge(t,e){let o=new _e;return o.copyProperties(e),o.setProperty(_.JUNCTION_POINTS,null),o}_calculateNetFlow(t){let e=t.getNode(),o=e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=0,i=0;for(let s of t.getOutgoingEdges()){let a=s.isSelfLoop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=s.getTarget().getNode();a&&l?i++:a&&!l?r++:c.getGraph().getParentNode()===e?i++:r++}for(let s of t.getIncomingEdges()){let a=s.isSelfLoop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=s.getSource().getNode();a&&l?r++:a&&!l?i++:c.getGraph().getParentNode()===e?r++:i++}return r-i}_createExternalPortDummyNode(t,e,o,r,i){let s=null,a=o===W.INPUT?i.getSource():i.getTarget(),l=z.getDirection(t);if(a.getNode()===e)s=this._dummyNodeMap.get(a),s==null&&(s=z.createExternalPortDummy(a,e.getProperty(_.PORT_CONSTRAINTS),r,this._calculateNetFlow(a),null,a.getPosition(),a.getSize(),l,t),s.setProperty(p.ORIGIN,a),this._dummyNodeMap.set(a,s));else{s=z.createExternalPortDummy(n._createExternalPortProperties(t),e.getProperty(_.PORT_CONSTRAINTS),r,o===W.INPUT?-1:1,null,new O,new O(0,0),l,t);let c=n._createPortForDummy(s,e,o);s.setProperty(p.ORIGIN,c),this._dummyNodeMap.set(c,s)}return t.getProperty(p.GRAPH_PROPERTIES).add(v.EXTERNAL_PORTS),t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()?t.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE):t.setProperty(_.PORT_CONSTRAINTS,H.FREE),s}static _createExternalPortProperties(t){let e=new ge,o=t.getProperty(_.SPACING_EDGE_EDGE)/2;return e.setProperty(_.PORT_BORDER_OFFSET,o),e}static _createPortForDummy(t,e,o){let r=e.getGraph(),i=z.getDirection(r),s=new rt;return s.setNode(e),o===W.INPUT?s.setSide(u.fromDirection(i).opposed()):o===W.OUTPUT&&s.setSide(u.fromDirection(i)),s.setProperty(_.PORT_BORDER_OFFSET,t.getProperty(_.PORT_BORDER_OFFSET)),s}};fl.isHierarchyAware=!0;var sp=class{constructor(t,e,o,r,i,s){this.origEdges=[t],this.newEdge=e,this.dummyNode=o,this.dummyPort=r,this.type=i!=null?i:W.UNDEFINED,this.exported=s}};var Lf=class n{process(t,e){e.begin("Compound graph postprocessor",1);let o=t.getProperty(_.UNNECESSARY_BENDPOINTS),r=t.getProperty(p.CROSS_HIERARCHY_MAP);if(r==null){e.done();return}let i=new Set;for(let s of r.keys()){let a=(r.get(s)||[]).slice();a.sort(new _a(t).compare);let l=a[0].getActualSource(),c=a[a.length-1].getActualTarget(),g=l.getNode(),h;z.isDescendant(c.getNode(),g)?h=g.getNestedGraph():h=g.getGraph();let d=n._clearJunctionPoints(s,a);s.getBendPoints().clear();let f=null;for(let E of a){let P=new O;z.changeCoordSystem(P,E.getGraph(),h);let S=E.getEdge(),T=new st;T.addAllAsCopies(0,S.getBendPoints()),T.offset(P);let N=S.getSource().getAbsoluteAnchor().clone(),I=S.getTarget().getAbsoluteAnchor().clone();if(N.add(P),I.add(P),f!=null){let C;T.isEmpty()?C=I:C=T.getFirst();let x=Math.abs(f.x-C.x)>se.TOLERANCE,M=Math.abs(f.y-C.y)>se.TOLERANCE;(!o&&x&&M||o&&(x||M))&&s.getBendPoints().add(N)}for(let C of T)s.getBendPoints().add(C);T.isEmpty()?f=N:f=T.getLast(),n._copyJunctionPoints(S,d,P),E.getActualTarget()===c&&(c.getNode().getGraph()!==E.getGraph()&&(P=new O,z.changeCoordSystem(P,c.getNode().getGraph(),h)),s.setProperty(p.TARGET_OFFSET,P)),n._copyLabelsBack(S,s,h),i.add(S)}s.setSource(l),s.setTarget(c)}for(let s of i)s.setSource(null),s.setTarget(null);e.done()}static _clearJunctionPoints(t,e){let o=t.getProperty(_.JUNCTION_POINTS),r=!1;for(let i of e){let s=i.getEdge().getProperty(_.JUNCTION_POINTS);if(s!=null&&!s.isEmpty()){r=!0;break}}return r?o==null?(o=new st,t.setProperty(_.JUNCTION_POINTS,o)):o.clear():o!=null&&(t.setProperty(_.JUNCTION_POINTS,null),o=null),o}static _copyJunctionPoints(t,e,o){if(e==null)return;let r=t.getProperty(_.JUNCTION_POINTS);if(r!=null){let i=new st;i.addAllAsCopies(0,r),i.offset(o);for(let s of i)e.add(s)}}static _copyLabelsBack(t,e,o){let r=t.getLabels();for(let i=r.length-1;i>=0;i--){let s=r[i];s.getProperty(p.ORIGINAL_LABEL_EDGE)===e&&(z.changeCoordSystem(s.getPosition(),t.getSource().getNode().getGraph(),o),r.splice(i,1),e.getLabels().push(s))}}};var OR=1,np=.4,Af=class{constructor(){this._createdJunctionPoints=new Set}getLayoutProcessorConfiguration(t){let e=K.create();e.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR);let o=t.getProperty(p.GRAPH_PROPERTIES);return o&&(o.has(v.NORTH_SOUTH_PORTS)&&(e.addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR),e.addAfter(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)),o.has(v.SELF_LOOPS)&&(e.addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR),e.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER),e.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER),e.addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR)),o.has(v.CENTER_LABELS)&&(e.addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER),e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER),e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),e.addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER)),o.has(v.END_LABELS)&&(e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),e.addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR),e.addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR))),e}process(t,e){e&&e.begin&&e.begin("Polyline edge routing",1);let o=t.getProperty(_.EDGE_ROUTING_POLYLINE_SLOPED_EDGE_ZONE_WIDTH),r=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),s=Math.min(1,i/r),a=t.getLayers(),l=0;if(a.length>0){let c=this._calculateWestInLayerEdgeYDiff(a[0]);l=np*s*c}for(let c=0;c<a.length;c++){let g=a[c],h=g.getNodes(),d=h.every(Ls);d&&l>0&&(l-=r),z.placeNodesHorizontally(g,l);let f=0;for(let P of h){let S=0;for(let N of P.getOutgoingEdges()){let I=N.getSource().getAbsoluteAnchor().y,C=N.getTarget().getAbsoluteAnchor().y;g===N.getTarget().getNode().getLayer()&&!N.isSelfLoop()&&(this._processInLayerEdge(N,l,np*s*Math.abs(I-C)),N.getSource().getSide()===u.WEST&&(I=0,C=0)),S=Math.max(S,Math.abs(C-I))}let T=P.getType();(T===y.NORMAL||T===y.LABEL||T===y.LONG_EDGE||T===y.NORTH_SOUTH_PORT||T===y.BREAKING_POINT)&&this._processNode(P,l,o),f=Math.max(f,S)}if(c+1<a.length){let P=this._calculateWestInLayerEdgeYDiff(a[c+1]);f=Math.max(f,P)}let E=np*s*f;!d&&c+1<a.length&&(E+=r),l+=g.getSize().x+E}this._createdJunctionPoints.clear(),t.getSize().x=l,e&&e.done&&e.done()}_processNode(t,e,o){let r=e+t.getLayer().getSize().x;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor();if(t.getType()===y.NORTH_SOUTH_PORT){let g=i.getProperty(p.ORIGIN);g&&(s.x=g.getAbsoluteAnchor().x,t.getPosition().x=s.x)}let a=new O(0,s.y);if(i.getSide()===u.EAST)a.x=r;else if(i.getSide()===u.WEST)a.x=e;else continue;if(Math.abs(s.x-a.x)<=o&&!this._isInLayerDummy(t))continue;let c=i.getOutgoingEdges().length+i.getIncomingEdges().length>1;for(let g of i.getConnectedEdges()){let h=g.getSource()===i?g.getTarget():g.getSource();Math.abs(h.getAbsoluteAnchor().y-a.y)>OR&&this._addBendPoint(g,a,c,i)}}}_processInLayerEdge(t,e,o){let r=t.getSource(),i=t.getTarget(),s=(r.getAbsoluteAnchor().y+i.getAbsoluteAnchor().y)/2,a;r.getSide()===u.EAST?a=new O(e+r.getNode().getLayer().getSize().x+o,s):a=new O(e-o,s),t.getBendPoints().splice(0,0,a)}_calculateWestInLayerEdgeYDiff(t){let e=0;for(let o of t.getNodes())for(let r of o.getOutgoingEdges())if(t===r.getTarget().getNode().getLayer()&&r.getSource().getSide()===u.WEST){let i=r.getSource().getAbsoluteAnchor().y,s=r.getTarget().getAbsoluteAnchor().y;e=Math.max(e,Math.abs(s-i))}return e}_addBendPoint(t,e,o,r){if(t.isSelfLoop()||!t.isInLayerEdge()&&r.getAbsoluteAnchor().equals(e))return;let i=new O(e.x,e.y);if(t.getSource()===r?t.getBendPoints().splice(0,0,i):t.getBendPoints().push(i),o){let s=e.x+","+e.y;if(!this._createdJunctionPoints.has(s)){let a=t.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,t.setProperty(_.JUNCTION_POINTS,a));let l=new O(e.x,e.y);a.push(l),this._createdJunctionPoints.add(s)}}}_isInLayerDummy(t){if(t.getType()!==y.LONG_EDGE)return!1;for(let e of t.getConnectedEdges())if(e.isInLayerEdge())return!0;return!1}};var bs=class bs{constructor(){this._edgeRoutingStrategy=null}static factoryFor(t){let e=String(t);if(!bs._factoryCache.has(e)){let o=new bs;o._edgeRoutingStrategy=t,bs._factoryCache.set(e,o)}return bs._factoryCache.get(e)}create(){switch(this._edgeRoutingStrategy){case At.POLYLINE:return new Af;case At.SPLINES:return new vi;default:return new Vg}}};Z(bs,"_factoryCache",new Map);var Cf=bs;var mO=2,SR=()=>K.create().addBefore(D.P4_NODE_PLACEMENT,w.INNERMOST_NODE_MARGIN_CALCULATOR).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_AND_NODE_SIZE_PROCESSOR).addBefore(D.P5_EDGE_ROUTING,w.LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR).addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_SORTER),TR=()=>K.create().addBefore(D.P4_NODE_PLACEMENT,w.CENTER_LABEL_MANAGEMENT_PROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR),NR=()=>K.create().addAfter(D.P5_EDGE_ROUTING,w.HIERARCHICAL_NODE_RESIZER),xf=class n{constructor(){this._algorithmAssembler=Io.create(D.values())}prepareGraphForLayout(t){this._configureGraphProperties(t),this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(D.P1_CYCLE_BREAKING,t.getProperty(_.CYCLE_BREAKING_STRATEGY)),this._algorithmAssembler.setPhase(D.P2_LAYERING,t.getProperty(_.LAYERING_STRATEGY)),this._algorithmAssembler.setPhase(D.P3_NODE_ORDERING,t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY)),this._algorithmAssembler.setPhase(D.P4_NODE_PLACEMENT,t.getProperty(_.NODE_PLACEMENT_STRATEGY)),this._algorithmAssembler.setPhase(D.P5_EDGE_ROUTING,Cf.factoryFor(t.getProperty(_.EDGE_ROUTING))),this._algorithmAssembler.addProcessorConfiguration(this._getPhaseIndependentLayoutProcessorConfiguration(t)),t.setProperty(p.PROCESSORS,this._algorithmAssembler.build(t))}_configureGraphProperties(t){let e=t.getProperty(_.SPACING_EDGE_EDGE);e!=null&&e<mO&&t.setProperty(_.SPACING_EDGE_EDGE,mO),t.getProperty(_.DIRECTION)===R.UNDEFINED&&t.setProperty(_.DIRECTION,z.getDirection(t));let r=t.getProperty(_.RANDOM_SEED);t.setProperty(p.RANDOM,new dr(r)),t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES)==null&&t.setProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES,t.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL),this._copyPortConstraints(t),t.setProperty(p.SPACINGS,new oo(t))}_copyPortConstraints(t){for(let e of t.getLayerlessNodes())this._copyPortConstraintsForNode(e);for(let e of t.getLayers())for(let o of e.getNodes())this._copyPortConstraintsForNode(o)}_copyPortConstraintsForNode(t){let e=t.getProperty(_.PORT_CONSTRAINTS);t.setProperty(p.ORIGINAL_PORT_CONSTRAINTS,e);let o=t.getNestedGraph&&t.getNestedGraph();o!=null&&this._copyPortConstraints(o)}_getPhaseIndependentLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES),o=SR();switch(t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN&&o.addAll(NR()),t.getProperty(_.FEEDBACK_EDGES)?o.addBefore(D.P1_CYCLE_BREAKING,w.PORT_SIDE_PROCESSOR):o.addBefore(D.P3_NODE_ORDERING,w.PORT_SIDE_PROCESSOR),t.getProperty(Hn)!=null&&o.addAll(TR()),(t.getProperty(_.INTERACTIVE_LAYOUT)||t.getProperty(_.GENERATE_POSITION_AND_LAYER_IDS))&&o.addAfter(D.P5_EDGE_ROUTING,w.CONSTRAINTS_POSTPROCESSOR),t.getProperty(_.DIRECTION)){case R.LEFT:case R.DOWN:case R.UP:o.addBefore(D.P1_CYCLE_BREAKING,w.DIRECTION_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.DIRECTION_POSTPROCESSOR);break;default:break}e!=null&&e.has(v.COMMENTS)&&o.addBefore(D.P1_CYCLE_BREAKING,w.COMMENT_PREPROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.COMMENT_NODE_MARGIN_CALCULATOR).addAfter(D.P5_EDGE_ROUTING,w.COMMENT_POSTPROCESSOR),t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY)!==ut.NONE&&t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY)!=null&&o.addBefore(D.P3_NODE_ORDERING,w.NODE_PROMOTION),e!=null&&e.has(v.PARTITIONS)&&(o.addBefore(D.P1_CYCLE_BREAKING,w.PARTITION_PREPROCESSOR),o.addBefore(D.P2_LAYERING,w.PARTITION_MIDPROCESSOR),o.addBefore(D.P3_NODE_ORDERING,w.PARTITION_POSTPROCESSOR));let i=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY);if(i!=null&&i!==ie.NONE&&t.getProperty(_.EDGE_ROUTING)!==At.POLYLINE&&o.addAfter(D.P5_EDGE_ROUTING,w.HORIZONTAL_COMPACTOR),t.getProperty(_.HIGH_DEGREE_NODES_TREATMENT)&&o.addBefore(D.P3_NODE_ORDERING,w.HIGH_DEGREE_NODE_LAYER_PROCESSOR),t.getProperty(_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE)&&o.addBefore(D.P3_NODE_ORDERING,w.SEMI_INTERACTIVE_CROSSMIN_PROCESSOR),n.activateGreedySwitchFor(t)){let c=n._isHierarchicalLayout(t)?t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE):t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE),g=String(c)==="ONE_SIDED"?w.ONE_SIDED_GREEDY_SWITCH:w.TWO_SIDED_GREEDY_SWITCH;o.addBefore(D.P4_NODE_PLACEMENT,g)}t.getProperty(_.LAYER_UNZIPPING_STRATEGY)===Wr.ALTERNATING&&o.addBefore(D.P4_NODE_PLACEMENT,w.ALTERNATING_LAYER_UNZIPPER);let a=t.getProperty(_.WRAPPING_STRATEGY);return a===Fo.SINGLE_EDGE?o.addBefore(D.P4_NODE_PLACEMENT,w.SINGLE_EDGE_GRAPH_WRAPPER):a===Fo.MULTI_EDGE&&o.addBefore(D.P3_NODE_ORDERING,w.BREAKING_POINT_INSERTER).addBefore(D.P4_NODE_PLACEMENT,w.BREAKING_POINT_PROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.BREAKING_POINT_REMOVER),t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==$t.NONE&&t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!=null&&o.addBefore(D.P3_NODE_ORDERING,w.SORT_BY_INPUT_ORDER_OF_MODEL),o}static activateGreedySwitchFor(t){if(n._isHierarchicalLayout(t)){let s=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE);return t.getParentNode()==null&&s!=null&&String(s)!=="OFF"}let e=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE),o=t.getProperty(_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE)||t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY)===We.INTERACTIVE,r=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_ACTIVATION_THRESHOLD)||0,i=t.getLayerlessNodes().length;return!o&&e!=null&&String(e)!=="OFF"&&(r===0||r>i)}static _isHierarchicalLayout(t){return t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN}};var ap=Object.freeze({isInstance(n){return n!=null&&(n.constructor&&n.constructor.isHierarchyAware===!0||n.isHierarchyAware===!0)}});var Df=class{constructor(){this._graphConfigurator=new xf,this._componentsProcessor=new Rf}doLayout(t,e){let o=e!=null?e:new Ie;o.begin("Layered layout",1),this._graphConfigurator.prepareGraphForLayout(t);let r=this._componentsProcessor.split(t);for(let i of r)this._layout(i,o);this._componentsProcessor.combine(r,t),this._resizeGraph(t),o.done()}doCompoundLayout(t,e){let o=e!=null?e:new Ie;o.begin("Layered compound layout",2),new fl().process(t,o.subTask?o.subTask(1):new Ie),this._hierarchicalLayout(t,o.subTask?o.subTask(1):new Ie),new Lf().process(t,o.subTask?o.subTask(1):new Ie),o.done()}_hierarchicalLayout(t,e){let o=this._collectAllGraphsBottomUp(t);this._reviewAndCorrectHierarchicalProcessors(t,o);let r=[],i=0;for(let a of o){this._graphConfigurator.prepareGraphForLayout(a);let l=a.getProperty(p.PROCESSORS);i+=l.length,r.push({graph:a,processors:l,index:0})}e.begin("Recursive hierarchical layout",i);let s=r.find(a=>a.graph===t);for(;s.index<s.processors.length;)for(let a of r)for(;a.index<a.processors.length;){let l=a.processors[a.index];if(!ap.isInstance(l))l.process(a.graph,e.subTask?e.subTask(1):new Ie),a.index++;else if(a.graph===t){l.process(a.graph,e.subTask?e.subTask(1):new Ie),a.index++;for(let g of r)g!==a&&g.index<g.processors.length&&ap.isInstance(g.processors[g.index])&&g.index++;break}else break}for(let a of r){let l=a.graph;for(let c of l){for(let g of c.getNodes())l.getLayerlessNodes().push(g);c.getNodes().length=0}for(let c of l.getLayerlessNodes())c.setLayer(null);l.getLayers().length=0,this._resizeGraph(l)}e.done()}_reviewAndCorrectHierarchicalProcessors(t,e){let o=t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY);for(let i of e){let s=i.getProperty(_.CROSSING_MINIMIZATION_STRATEGY);if(s!==o)throw new Bo("The hierarchy aware processor "+s+" in child node "+i+" is only allowed if the root node specifies the same hierarchical processor.")}let r=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE);for(let i of e)i.setProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE,r)}_collectAllGraphsBottomUp(t){let e=[t],o=[t];for(;o.length>0;){let r=o.shift();for(let i of r.getLayerlessNodes()){let s=i.getNestedGraph();s!=null&&(e.unshift(s),o.push(s))}}return e}_layout(t,e){let o=e.isRunning&&e.isRunning();o||e.begin("Component Layout",1);let r=t.getProperty(p.PROCESSORS);if(r==null)throw new Error("ElkLayered.doLayout: algorithm processor list is missing. Did GraphConfigurator.prepareGraphForLayout succeed?");let i=1/Math.max(1,r.length);for(let s of r){if(e.isCanceled&&e.isCanceled())return;s.process(t,e.subTask?e.subTask(i):new Ie)}for(let s of t){for(let a of s.getNodes())t.getLayerlessNodes().push(a);s.getNodes().length=0}for(let s of t.getLayerlessNodes())s.setLayer(null);t.getLayers().length=0,o||e.done()}_resizeGraph(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS),o=t.getProperty(_.NODE_SIZE_OPTIONS),r=t.getActualSize(),i=new O(r.x,r.y);if(e!=null&&e.has&&e.has(mt.MINIMUM_SIZE)){let s=new O(0,0),a=t.getProperty(_.NODE_SIZE_MINIMUM);a!=null&&(s.x=a.x||0,s.y=a.y||0),o!=null&&o.has&&o.has(Nt.DEFAULT_MINIMUM_SIZE)&&(s.x<=0&&(s.x=es),s.y<=0&&(s.y=os)),i.x=Math.max(r.x,s.x),i.y=Math.max(r.y,s.y)}t.getProperty(_.NODE_SIZE_FIXED_GRAPH_SIZE)||this._resizeGraphNoReallyIMeanIt(t,r,i)}_resizeGraphNoReallyIMeanIt(t,e,o){let r=t.getProperty(_.CONTENT_ALIGNMENT);o.x>e.x&&r!=null&&(r.has(he.H_CENTER)?t.getOffset().x+=(o.x-e.x)/2:r.has(he.H_RIGHT)&&(t.getOffset().x+=o.x-e.x)),o.y>e.y&&r!=null&&(r.has(he.V_CENTER)?t.getOffset().y+=(o.y-e.y)/2:r.has(he.V_BOTTOM)&&(t.getOffset().y+=o.y-e.y));let i=t.getProperty(p.GRAPH_PROPERTIES);if(i!=null&&i.has(v.EXTERNAL_PORTS)&&(o.x>e.x||o.y>e.y))for(let a of t.getLayerlessNodes()){if(a.getType()!==y.EXTERNAL_PORT)continue;let l=a.getProperty(p.EXT_PORT_SIDE);l===u.EAST?a.getPosition().x+=o.x-e.x:l===u.SOUTH&&(a.getPosition().y+=o.y-e.y)}let s=t.getPadding();t.getSize().x=o.x-s.left-s.right,t.getSize().y=o.y-s.top-s.bottom}};var wf=class{constructor(){this._nodeAndPortMap=new Map}importGraph(t){let e=this._createLGraph(t);for(let r of t.getPorts())this._ensureDefinedPortSide(e,r);let o=e.getProperty(p.GRAPH_PROPERTIES);if(this._checkExternalPorts(t,o),o.has(v.EXTERNAL_PORTS))for(let r of t.getPorts())this._transformExternalPort(t,e,r);return this._shouldCalculateMinimumGraphSize(t)&&this._calculateMinimumGraphSize(t,e),e.getProperty(_.PARTITIONING_ACTIVATE)&&o.add(v.PARTITIONS),t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN?this._importHierarchicalGraph(t,e):this._importFlatGraph(t,e),e}_ensureDefinedPortSide(t,e){let o=t.getProperty(_.DIRECTION),r=e.getProperty(_.PORT_SIDE);t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()?(r==null||r===u.UNDEFINED)&&(r=u.fromDirection(o)):this._calculateNetFlow(e)>0?r=u.fromDirection(o):r=u.fromDirection(o).opposed(),e.setProperty(_.PORT_SIDE,r)}_shouldCalculateMinimumGraphSize(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS);return e!=null&&typeof e.size=="number"&&e.size>0}_calculateMinimumGraphSize(t,e){if(t.getParent()==null)return;let o=e.getProperty(_.NODE_SIZE_CONSTRAINTS);if(o==null||o.size===0)return;t.getProperty(_.PORT_CONSTRAINTS)===H.UNDEFINED&&t.setProperty(_.PORT_CONSTRAINTS,H.FREE);let r=yo.adapt(t.getParent()),i=yo.adaptSingleNode(t),s=us.process(r,i,!1,!0);o.add(mt.MINIMUM_SIZE);let a=e.getProperty(_.NODE_SIZE_MINIMUM)||new O;a.x=Math.max(s.x,a.x),a.y=Math.max(s.y,a.y),e.setProperty(_.NODE_SIZE_MINIMUM,a)}_importFlatGraph(t,e){let o=0,r=new Set;for(let i of t.getChildren())i.getProperty(_.NO_LAYOUT)||(this._needsModelOrder(i)&&(i.setProperty(p.MODEL_ORDER,o),o++,i.hasProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)&&r.add(i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID))),this._transformNode(i,e));e.setProperty(p.MAX_MODEL_ORDER_NODES,o),e.setProperty(p.CB_NUM_MODEL_ORDER_GROUPS,r.size),o=0;for(let i of t.getContainedEdges()){this._needsModelOrderBasedOnParent(t)&&(i.setProperty(p.MODEL_ORDER,o),o++);let s=ks(i),a=Na(i);if(s==null||a==null)continue;let l=s.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),c=!i.getProperty(_.NO_LAYOUT),g=l&&i.isSelfloop()&&i.getProperty(_.INSIDE_SELF_LOOPS_YO),h=s.getParent()===t&&s.getParent()===a.getParent(),d=s.getParent()===t&&a===t,f=a.getParent()===t&&s===t;c&&!g&&(d!==f||h)&&this._transformEdge(i,t,e)}if(t.getParent()!=null)for(let i of t.getParent().getContainedEdges()){let s=ks(i);s===t&&i.isSelfloop()&&s.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE)&&i.getProperty(_.INSIDE_SELF_LOOPS_YO)&&this._transformEdge(i,t,e)}}_importHierarchicalGraph(t,e){let o=[],r=e.getProperty(_.DIRECTION),i=0,s=new Set;for(o.push(...t.getChildren());o.length>0;){let a=o.shift();if(this._needsModelOrder(a)&&(a.setProperty(p.MODEL_ORDER,i++),a.hasProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)&&s.add(a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID))),a.getProperty(_.NO_LAYOUT))continue;let l=a.getChildren().length>0,c=this._hasInsideSelfLoops(a),g=a.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN,h=a.hasProperty(mi)?a.getProperty(mi):null,d=h==null||_.ALGORITHM_ID.endsWith(h),f=null;if(d&&g&&(l||c)&&(f=this._createLGraph(a),f.setProperty(_.DIRECTION,r),this._shouldCalculateMinimumGraphSize(a))){for(let T of a.getPorts())this._ensureDefinedPortSide(f,T);this._calculateMinimumGraphSize(a,f)}let E=e,P=this._nodeAndPortMap.get(a.getParent());P instanceof ft&&P.getNestedGraph()!=null&&(E=P.getNestedGraph());let S=this._transformNode(a,E);f!=null&&(S.setNestedGraph(f),f.setParentNode(S),o.push(...a.getChildren()))}for(e.setProperty(p.MAX_MODEL_ORDER_NODES,i),e.setProperty(p.CB_NUM_MODEL_ORDER_GROUPS,s.size),i=0,o.push(t);o.length>0;){let a=o.shift();for(let c of a.getContainedEdges()){this._checkEdgeValidity(c),this._needsModelOrderBasedOnParent(t)&&c.setProperty(p.MODEL_ORDER,i++);let g=Pt(c.getSources()[0]),h=Pt(c.getTargets()[0]);if(g==null||h==null||c.getProperty(_.NO_LAYOUT)||g.getProperty(_.NO_LAYOUT)||h.getProperty(_.NO_LAYOUT))continue;let d=c.isSelfloop()&&g.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE)&&c.getProperty(_.INSIDE_SELF_LOOPS_YO),f=a;d||mo(h,g)?f=g:mo(g,h)&&(f=h);let E=e,P=this._nodeAndPortMap.get(f);P instanceof ft&&P.getNestedGraph()!=null&&(E=P.getNestedGraph());let S=this._transformEdge(c,f,E);S!=null&&S.setProperty(p.COORDINATE_SYSTEM_ORIGIN,this._findCoordinateSystemOrigin(c,t,e))}if(a.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN)for(let c of a.getChildren()){let g=c.hasProperty(mi)?c.getProperty(mi):null,h=g==null||_.ALGORITHM_ID.endsWith(g),d=c.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN;h&&d&&o.push(c)}}}_needsModelOrder(t){let e=t.getParent();return this._needsModelOrderBasedOnParent(e)&&!t.getProperty(_.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER)}_needsModelOrderBasedOnParent(t){let e=t.getProperty(_.CYCLE_BREAKING_STRATEGY),o=e===Xt.MODEL_ORDER||e===Xt.BFS_NODE_ORDER||e===Xt.DFS_NODE_ORDER||e===Xt.GREEDY_MODEL_ORDER||e===Xt.SCC_CONNECTIVITY||e===Xt.SCC_NODE_TYPE,r=t.getProperty(_.LAYERING_STRATEGY),i=t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY),s=r===le.BF_MODEL_ORDER||r===le.DF_MODEL_ORDER||i===ut.MODEL_ORDER_LEFT_TO_RIGHT||i===ut.MODEL_ORDER_RIGHT_TO_LEFT,a=t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==$t.NONE||t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)||t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)!=="NONE"||t.getProperty(_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_NODE_INFLUENCE)!==0||t.getProperty(_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_PORT_INFLUENCE)!==0;return o||s||a}_hasInsideSelfLoops(t){if(!t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))return!1;for(let e of t.getPorts())for(let o of e.getOutgoingEdges())if(o.isSelfloop()&&o.getProperty(_.INSIDE_SELF_LOOPS_YO))return!0;return!1}_findCoordinateSystemOrigin(t,e,o){let r=Pt(t.getSources()[0]),i=Pt(t.getTargets()[0]);if(r==null||i==null||r.getParent()===i.getParent()||mo(i,r))return null;let s=t.getContainingNode();if(s===e)return o;let a=this._nodeAndPortMap.get(s);if(a instanceof ft){let l=a.getNestedGraph();if(l!=null)return l}return null}_createLGraph(t){let e=new Nn;e.copyProperties(t),e.getProperty(_.DIRECTION)===R.UNDEFINED&&e.setProperty(_.DIRECTION,z.getDirection(e)),e.setProperty(p.ORIGIN,t),e.setProperty(p.GRAPH_PROPERTIES,new Set);let o=t.getParent()==null?null:yo.adapt(t.getParent()),r=yo.adaptSingleNode(t),i=us.computeInsideNodeLabelPadding(o,r,R.RIGHT),s=e.getProperty(_.PADDING),a=e.getPadding();return s!=null&&(a.top+=s.top||0,a.bottom+=s.bottom||0,a.left+=s.left||0,a.right+=s.right||0),i!=null&&(a.top+=i.top||0,a.bottom+=i.bottom||0,a.left+=i.left||0,a.right+=i.right||0),e}_checkExternalPorts(t,e){let o=t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=t.getProperty(_.PORT_LABELS_PLACEMENT),i=!1,s=!1;for(let a of t.getPorts()){if(i&&s)break;let l=0;for(let c of Ta(a)){let g=o&&c.isSelfloop()&&c.getProperty(_.INSIDE_SELF_LOOPS_YO),d=c.getSources().includes(a)?Pt(c.getTargets()[0]):Pt(c.getSources()[0]),f=d!=null&&d.getParent()===t;if((g||f)&&(l++,l>1))break}(l>0||r!=null&&r.has&&r.has(it.INSIDE)&&a.getLabels().length>0)&&(i=!0),l>1&&(s=!0)}i&&e.add(v.EXTERNAL_PORTS),s&&e.add(v.HYPEREDGES)}_transformExternalPort(t,e,o){let r=new O(o.getX()+o.getWidth()/2,o.getY()+o.getHeight()/2),i=this._calculateNetFlow(o),s=t.getProperty(_.PORT_CONSTRAINTS),a=o.getProperty(_.PORT_SIDE);if(!o.getAllProperties().has(_.PORT_BORDER_OFFSET)){let f;o.getX()===0&&o.getY()===0?f=0:f=eu!=null?eu(o,a):0,o.setProperty(_.PORT_BORDER_OFFSET,f)}let l=new O(t.getWidth(),t.getHeight()),c=z.createExternalPortDummy(o,s,a,i,l,r,new O(o.getWidth(),o.getHeight()),e.getProperty(_.DIRECTION),e);c.setProperty(p.ORIGIN,o);let g=c.getPorts()[0];g.setConnectedToExternalNodes(this._isConnectedToExternalNodes(o)),c.setProperty(_.PORT_LABELS_PLACEMENT,it.outside());let h=t.getProperty(_.PORT_LABELS_PLACEMENT)!=null&&t.getProperty(_.PORT_LABELS_PLACEMENT).has&&t.getProperty(_.PORT_LABELS_PLACEMENT).has(it.INSIDE);for(let f of o.getLabels())if(!f.getProperty(_.NO_LAYOUT)&&f.getText()!=null&&f.getText().length>0){let E=this._transformLabel(f);if(g.getLabels().push(E),!h)switch(a){case u.EAST:case u.WEST:E.getSize().x=0;break;case u.NORTH:case u.SOUTH:E.getSize().y=0;break;default:break}}let d=t.getParent();d!=null&&(c.setProperty(_.SPACING_LABEL_PORT_HORIZONTAL,d.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL)),c.setProperty(_.SPACING_LABEL_PORT_VERTICAL,d.getProperty(_.SPACING_LABEL_PORT_VERTICAL)),c.setProperty(_.SPACING_LABEL_LABEL,d.getProperty(_.SPACING_LABEL_LABEL))),e.getLayerlessNodes().push(c),this._nodeAndPortMap.set(o,c)}_calculateNetFlow(t){let e=t.getParent(),o=e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=0,i=0;for(let s of t.getOutgoingEdges()){let a=s.isSelfloop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=Pt(s.getTargets()[0]);a&&l?i++:a&&!l?r++:c!=null&&(c.getParent()===e||c===e)?i++:r++}for(let s of t.getIncomingEdges()){let a=s.isSelfloop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=Pt(s.getSources()[0]);a&&l?r++:a&&!l?i++:c!=null&&(c.getParent()===e||c===e)?r++:i++}return r-i}_isConnectedToExternalNodes(t){let e=t.getParent();for(let o of t.getOutgoingEdges()){let r=Pt(o.getTargets()[0]);if(r!=null&&!mo(r,e))return!0}for(let o of t.getIncomingEdges()){let r=Pt(o.getSources()[0]);if(r!=null&&!mo(r,e))return!0}return!1}_transformNode(t,e){let o=new ft(e);o.copyProperties(t),o.setProperty(p.ORIGIN,t),o.getSize().x=t.getWidth(),o.getSize().y=t.getHeight(),o.getPosition().x=t.getX(),o.getPosition().y=t.getY(),e.getLayerlessNodes().push(o),this._nodeAndPortMap.set(t,o),(t.getChildren().length>0||t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))&&o.setProperty(p.COMPOUND_NODE,!0);let r=e.getProperty(p.GRAPH_PROPERTIES),i=o.getProperty(_.PORT_CONSTRAINTS);i===H.UNDEFINED?(o.setProperty(_.PORT_CONSTRAINTS,H.FREE),i=H.FREE):i!==H.FREE&&r.add(v.NON_FREE_PORTS);let s=0,a=e.getProperty(_.DIRECTION);for(let l of t.getPorts())this._needsModelOrder(t)&&l.setProperty(p.MODEL_ORDER,s++),l.getProperty(_.NO_LAYOUT)||this._transformPort(l,o,r,a,i);for(let l of t.getLabels())!l.getProperty(_.NO_LAYOUT)&&l.getText()!=null&&l.getText().length>0&&o.getLabels().push(this._transformLabel(l));return o.getProperty(_.COMMENT_BOX)&&r.add(v.COMMENTS),o.getProperty(_.HYPERNODE)&&(r.add(v.HYPERNODES),r.add(v.HYPEREDGES),o.setProperty(_.PORT_CONSTRAINTS,H.FREE)),o}_transformPort(t,e,o,r,i){let s=new rt;s.copyProperties(t),s.setSide(t.getProperty(_.PORT_SIDE)||u.UNDEFINED),s.setProperty(p.ORIGIN,t),s.setNode(e),s.getSize().x=t.getWidth(),s.getSize().y=t.getHeight(),s.getPosition().x=t.getX(),s.getPosition().y=t.getY(),this._nodeAndPortMap.set(t,s);let a=!1;for(let l of t.getOutgoingEdges()){for(let c of l.getTargets()){let g=Pt(c);if(g!=null&&mo(g,t.getParent())){a=!0;break}}if(a)break}if(!a)for(let l of t.getIncomingEdges()){for(let c of l.getSources()){let g=Pt(c);if(g!=null&&mo(g,t.getParent())){a=!0;break}}if(a)break}if(!a){for(let l of t.getOutgoingEdges())if(l.isSelfloop()&&l.getProperty(_.INSIDE_SELF_LOOPS_YO)){a=!0;break}}s.setProperty(p.INSIDE_CONNECTIONS,a),z.initializePort(s,i,r,t.getProperty(_.PORT_ANCHOR));for(let l of t.getLabels())!l.getProperty(_.NO_LAYOUT)&&l.getText()!=null&&l.getText().length>0&&s.getLabels().push(this._transformLabel(l));return r===R.LEFT||r===R.RIGHT?(s.getSide()===u.NORTH||s.getSide()===u.SOUTH)&&o.add(v.NORTH_SOUTH_PORTS):(r===R.UP||r===R.DOWN)&&(s.getSide()===u.EAST||s.getSide()===u.WEST)&&o.add(v.NORTH_SOUTH_PORTS),s}_transformEdge(t,e,o){this._checkEdgeValidity(t);let r=t.getSources()[0],i=t.getTargets()[0],s=Pt(r),a=Pt(i),l=t.getSections().length>0?t.getSections()[0]:null,c=this._nodeAndPortMap.get(s),g=this._nodeAndPortMap.get(a),h=null,d=null;if(r instanceof Ve){let N=this._nodeAndPortMap.get(r);N instanceof rt?h=N:N instanceof ft&&(c=N,h=c.getPorts()[0])}if(i instanceof Ve){let N=this._nodeAndPortMap.get(i);N instanceof rt?d=N:N instanceof ft&&(g=N,d=g.getPorts()[0])}if(!(c instanceof ft)||!(g instanceof ft))throw new Bo("The source or target of an edge could not be found. This usually happens when an edge connects nodes laid out by different algorithms. Try setting hierarchyHandling to INCLUDE_CHILDREN.");let f=new _e;f.copyProperties(t),f.setProperty(p.ORIGIN,t),f.setProperty(_.JUNCTION_POINTS,null);let E=o.getProperty(p.GRAPH_PROPERTIES);if(c===g&&E.add(v.SELF_LOOPS),h==null){let N=W.OUTPUT,I=null;l!=null&&c.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(I=new O(l.getStartX(),l.getStartY()),su(I,t.getContainingNode()),nu(I,e),mo(a,s)&&(N=W.INPUT,I.x+=c.getPosition().x,I.y+=c.getPosition().y)),h=z.createPort(c,I,N,o)}if(d==null){let N=W.INPUT,I=null;l!=null&&g.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(I=new O(l.getEndX(),l.getEndY()),su(I,t.getContainingNode()),nu(I,e)),d=z.createPort(g,I,N,g.getGraph())}f.setSource(h),f.setTarget(d),(h.getIncomingEdges().length>1||h.getOutgoingEdges().length>1||d.getIncomingEdges().length>1||d.getOutgoingEdges().length>1)&&E.add(v.HYPEREDGES);for(let N of t.getLabels())if(!N.getProperty(_.NO_LAYOUT)&&N.getText()!=null&&N.getText().length>0){let I=this._transformLabel(N);f.getLabels().push(I);let C=I.getProperty(_.EDGE_LABELS_PLACEMENT);C===St.HEAD||C===St.TAIL?E.add(v.END_LABELS):C===St.CENTER&&(E.add(v.CENTER_LABELS),I.setProperty(_.EDGE_LABELS_PLACEMENT,St.CENTER))}let P=o.getProperty(_.CROSSING_MINIMIZATION_STRATEGY),S=o.getProperty(_.NODE_PLACEMENT_STRATEGY),T=P===We.INTERACTIVE||S===ze.INTERACTIVE;if(l!=null&&l.getBendPoints().length>0&&T){let N=new st;for(let I of l.getBendPoints())N.add(new O(I.x,I.y));f.setProperty(p.ORIGINAL_BENDPOINTS,N)}return f}_checkEdgeValidity(t){if(t.getSources().length===0)throw new Bo("Edges must have a source.");if(t.getTargets().length===0)throw new Bo("Edges must have a target.");if(t.isHyperedge())throw new Bo("Hyperedges are not supported.")}_transformLabel(t){let e=new ua(t.getText());return e.copyProperties(t),e.setProperty(p.ORIGIN,t),e.getSize().x=t.getWidth(),e.getSize().y=t.getHeight(),e.getPosition().x=t.getX(),e.getPosition().y=t.getY(),e}};var Mf=class n{applyLayout(t){let e=t.getProperty(p.ORIGIN);if(!(e instanceof Or))return;let o=e,r=t.getParentNode(),i=new O(t.getOffset().x,t.getOffset().y),s=t.getPadding();i.x+=s.left,i.y+=s.top;let a=o.getProperty(_.NODE_SIZE_OPTIONS);if(a!=null&&a.has&&a.has(Nt.COMPUTE_PADDING)){let g=o.getProperty(_.PADDING);g!=null&&(g.bottom=s.bottom,g.top=s.top,g.left=s.left,g.right=s.right)}let l=[];for(let g of t.getLayerlessNodes()){if(n._representsNode(g))this._applyNodeLayout(g,i);else if(n._representsExternalPort(g)&&r==null){let h=g.getProperty(p.ORIGIN),d=z.getExternalPortPosition(t,g,h.getWidth(),h.getHeight());h.setLocation(d.x,d.y)}for(let h of g.getPorts())for(let d of h.getOutgoingEdges())z.isDescendant(d.getTarget().getNode(),g)||l.push(d)}if(r!=null)for(let g of r.getPorts())for(let h of g.getOutgoingEdges())z.isDescendant(h.getTarget().getNode(),r)&&l.push(h);let c=o.getProperty(_.EDGE_ROUTING);for(let g of l)this._applyEdgeLayout(g,c,i,s);this._applyParentNodeLayout(t);for(let g of t.getLayerlessNodes()){let h=g.getNestedGraph();h!=null&&this.applyLayout(h)}}_applyNodeLayout(t,e){let o=t.getProperty(p.ORIGIN),r=t.getProperty(_.CROSSING_MINIMIZATION_POSITION_ID),i=t.getProperty(_.LAYERING_LAYER_ID);o.setProperty(_.CROSSING_MINIMIZATION_POSITION_ID,r),o.setProperty(_.LAYERING_LAYER_ID,i),o.setX(t.getPosition().x+e.x),o.setY(t.getPosition().y+e.y);let s=o.getProperty(_.NODE_SIZE_CONSTRAINTS);(s!=null&&s.size>0||t.getNestedGraph()!=null)&&(o.setWidth(t.getSize().x),o.setHeight(t.getSize().y));for(let h of t.getPorts()){let d=h.getProperty(p.ORIGIN);d instanceof Ve&&(d.setLocation(h.getPosition().x,h.getPosition().y),d.setProperty(_.PORT_SIDE,h.getSide()))}let l=t.getProperty(_.NODE_LABELS_PLACEMENT),c=l!=null&&l.size>0;for(let h of t.getLabels()){let d=h.getProperty(_.NODE_LABELS_PLACEMENT),f=d!=null&&d.size>0;if(c||f){let E=h.getProperty(p.ORIGIN);E!=null&&(E.setDimensions(h.getSize().x,h.getSize().y),E.setLocation(h.getPosition().x,h.getPosition().y))}}let g=t.getProperty(_.PORT_LABELS_PLACEMENT);if(g!=null&&!it.isFixed(g))for(let h of t.getPorts())for(let d of h.getLabels()){let f=d.getProperty(p.ORIGIN);f!=null&&(f.setWidth(d.getSize().x),f.setHeight(d.getSize().y),f.setLocation(d.getPosition().x,d.getPosition().y))}}_applyEdgeLayout(t,e,o,r){let i=t.getProperty(p.ORIGIN);if(i==null)return;let s=t.getBendPoints(),a=new O(o.x,o.y),l=this._calculateHierarchicalOffset(t);a.x+=l.x,a.y+=l.y;let c;if(z.isDescendant(t.getTarget().getNode(),t.getSource().getNode())){let P=t.getSource();c=new O(P.getPosition().x+P.getAnchor().x,P.getPosition().y+P.getAnchor().y),c.x-=o.x,c.y-=o.y}else{let P=t.getSource().getAbsoluteAnchor();c=new O(P.x,P.y)}s.addFirst(c);let g=t.getTarget().getAbsoluteAnchor(),h=new O(g.x,g.y),d=t.getProperty(p.TARGET_OFFSET);d!=null&&(h.x+=d.x,h.y+=d.y),s.addLast(h);for(let P of s)P.x+=a.x,P.y+=a.y;let f=ar(i,!0,!0);f.setIncomingShape(i.getSources()[0]),f.setOutgoingShape(i.getTargets()[0]),Xs(s,f);for(let P of t.getLabels()){let S=P.getProperty(p.ORIGIN);S!=null&&(S.setWidth(P.getSize().x),S.setHeight(P.getSize().y),S.setLocation(P.getPosition().x+a.x,P.getPosition().y+a.y))}let E=t.getProperty(_.JUNCTION_POINTS);if(E!=null){for(let P of E)P.x+=a.x,P.y+=a.y;i.setProperty(_.JUNCTION_POINTS,E)}else i.setProperty(_.JUNCTION_POINTS,null);e===At.SPLINES?i.setProperty(_.EDGE_ROUTING,At.SPLINES):i.setProperty(_.EDGE_ROUTING,null)}_calculateHierarchicalOffset(t){let e=t.getProperty(p.COORDINATE_SYSTEM_ORIGIN);if(e==null)return new O;let o=new O,r=t.getSource().getNode().getGraph();for(;r!==e;){let i=r.getParentNode();if(i==null)break;r=i.getGraph(),o.x+=i.getPosition().x,o.y+=i.getPosition().y,o.x+=r.getOffset().x,o.y+=r.getOffset().y,o.x+=r.getPadding().left,o.y+=r.getPadding().top}return o}_applyParentNodeLayout(t){let e=t.getProperty(p.ORIGIN),o=e.getProperty(_.NODE_SIZE_CONSTRAINTS),r=o!=null&&o.has&&o.has(mt.PORT_LABELS);if(t.getParentNode()==null){let i=t.getProperty(p.GRAPH_PROPERTIES),s=t.getActualSize();i!=null&&i.has(v.EXTERNAL_PORTS)?(e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),Ae(e,s.x,s.y,!1,!0)):e.getProperty(_.NODE_SIZE_FIXED_GRAPH_SIZE)||Ae(e,s.x,s.y,!0,!0)}r?e.setProperty(_.NODE_SIZE_CONSTRAINTS,new Set([mt.PORT_LABELS])):e.setProperty(_.NODE_SIZE_CONSTRAINTS,mt.fixed())}static _representsNode(t){return t.getProperty(p.ORIGIN)instanceof Or}static _representsExternalPort(t){return t.getProperty(p.ORIGIN)instanceof Ve}};var bf=class n{importGraph(t){return new wf().importGraph(t)}applyLayout(t){new Mf().applyLayout(t)}static getOriginIdentifier(t){let e=t.getProperty(p.ORIGIN);return e!=null&&typeof e.getIdentifier=="function"?n._getIdentifier(e):null}static _getIdentifier(t){let e=t.getIdentifier!=null?t.getIdentifier():null;if(e!=null&&e.length>0){let o=typeof t.getParent=="function"?t.getParent():null;if(o!=null&&typeof o.getIdentifier=="function"){let r=n._getIdentifier(o);if(r!=null)return r+"."+e}return e}return null}};var Gf=class extends de{constructor(){super(),this.elkLayered=new Df}layout(t,e){let o=new bf,r=o.importGraph(t);t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN?this.elkLayered.doCompoundLayout(r,e):this.elkLayered.doLayout(r,e),(!e||!e.isCanceled||!e.isCanceled())&&o.applyLayout(r)}getLayoutAlgorithm(){return this.elkLayered}};var PO="org.eclipse.elk.layered",OO=!1;function SO(){let n=Ht.getInstance(),t=n.getAlgorithmData(PO);if(t)return OO=!0,t;let e=new Se.Builder().id(PO).name("ELK Layered").description("Layer-based algorithm with a hand-ported JS implementation.").category("org.eclipse.elk.layered").definingBundleId("org.eclipse.elk.alg.layered").providerFactory(()=>new Gf).supportedFeatures(new Set(["SELF_LOOPS","INSIDE_SELF_LOOPS","MULTI_EDGES","EDGE_LABELS","PORTS","COMPOUND","CLUSTERS"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),OO=!0,e}var ce=class ce{constructor(t,e=""){this.name=t,this.description=e,Object.freeze(this)}getDescription(){return this.description}toString(){return this.name}static values(){return[ce.SELF_LOOPS,ce.INSIDE_SELF_LOOPS,ce.MULTI_EDGES,ce.EDGE_LABELS,ce.PORTS,ce.COMPOUND,ce.CLUSTERS,ce.DISCONNECTED]}static valueOf(t){return ce[t]||null}};Z(ce,"SELF_LOOPS",new ce("SELF_LOOPS","Edges connecting a node with itself.")),Z(ce,"INSIDE_SELF_LOOPS",new ce("INSIDE_SELF_LOOPS","Self-loops routed through a node instead of around it.")),Z(ce,"MULTI_EDGES",new ce("MULTI_EDGES","Multiple edges with the same source and target node.")),Z(ce,"EDGE_LABELS",new ce("EDGE_LABELS","Labels that are associated with edges.")),Z(ce,"PORTS",new ce("PORTS","Edges are connected to nodes over ports.")),Z(ce,"COMPOUND",new ce("COMPOUND","Edges that connect nodes from different hierarchy levels and are incident to compound nodes.")),Z(ce,"CLUSTERS",new ce("CLUSTERS","Edges that connect nodes from different clusters, but not the cluster parent nodes.")),Z(ce,"DISCONNECTED",new ce("DISCONNECTED","Multiple connected components."));var lp=ce;function Rt(n,t,e,o){this.graph=n,this.model=n.getModel(),this.elkToCellMap=t,this.portCells=e||new Set,this.options=o||{},this._styles=this.options.styleBatch||new Zi(n),this._anchorCache={}}function Zi(n){this.graph=n,this.model=n.getModel(),this._pending=new Map}function yR(n,t,e){if(typeof mxUtils!="undefined"&&mxUtils!=null&&typeof mxUtils.setStyle=="function")return mxUtils.setStyle(n,t,e);var o=e!=null&&(typeof e.length=="undefined"||e.length>0);if(n!=null&&typeof n!="string"&&(n=""+n),n==null||n.length==0)o&&(n=t+"="+e+";");else if(n.substring(0,t.length+1)==t+"="){var r=n.indexOf(";");o?n=t+"="+e+(r<0?";":n.substring(r)):n=r<0||r==n.length-1?"":n.substring(r+1)}else{var i=n.indexOf(";"+t+"=");if(i<0){if(o){var s=n.charAt(n.length-1)==";"?"":";";n=n+s+t+"="+e+";"}}else{var a=n.indexOf(";",i+1);o?n=n.substring(0,i+1)+t+"="+e+(a<0?";":n.substring(a)):n=n.substring(0,i)+(a<0?";":n.substring(a))}}return n}Zi.prototype._read=function(n){var t=typeof this.model.getStyle=="function"?this.model.getStyle(n):n.style;return t!=null?t:""};Zi.prototype.get=function(n){return this._pending.has(n)?this._pending.get(n):this._read(n)};Zi.prototype.set=function(n,t,e){var o=yR(this.get(n),t,e);this._pending.set(n,o!=null?o:"")};Zi.prototype.flush=function(){var n=this;this._pending.forEach(function(t,e){n._read(e)!==t&&(typeof n.model.setStyle=="function"?n.model.setStyle(e,t):e.style=t)}),this._pending.clear()};function Dt(n){return Math.round(n*100)/100}function Hf(n){return n>0?n<1?n:1:0}function IR(n,t){var e=n!=null?n.length:0,o=t!=null?t.length:0;if(e!==o)return!1;for(var r=0;r<e;r++)if(n[r].x!==t[r].x||n[r].y!==t[r].y)return!1;return!0}function RR(n,t){return n==null&&t==null?!0:n!=null&&t!=null&&n.x===t.x&&n.y===t.y}function LR(n,t){return n.x===t.x&&n.y===t.y&&!n.relative==!t.relative&&IR(n.points,t.points)&&RR(n.offset,t.offset)}Rt.prototype.apply=function(n,t,e){this._applyNodes(n,t||0,e||0),this.options.portSpread&&this._spreadPorts(n),this._applyEdges(n,t||0,e||0),this._styles.flush()};Rt.prototype._spreadPorts=function(n){var t=1.3,e=.05,o=.5,r={};function i(A,B,Y){var j=B+(A.x||0),X=Y+(A.y||0);if(A.id!=null&&(r[A.id]={x:j,y:X,width:A.width||0,height:A.height||0}),A.children)for(var tt=0;tt<A.children.length;tt++)i(A.children[tt],j,X)}i(n,0,0);function s(A,B,Y){return Math.abs(B-Y.y)<o?"N":Math.abs(B-(Y.y+Y.height))<o?"S":Math.abs(A-Y.x)<o?"W":Math.abs(A-(Y.x+Y.width))<o?"E":null}var a={};function l(A,B,Y,j){var X=r[A];if(X!=null){var tt=s(Y+B.x,j+B.y,X);if(tt!=null){var ot=A+"|"+tt;(a[ot]=a[ot]||[]).push({box:X,side:tt,point:B,ox:Y,oy:j})}}}function c(A,B,Y){var j=B+(A.x||0),X=Y+(A.y||0);if(A.edges)for(var tt=0;tt<A.edges.length;tt++){var ot=A.edges[tt];if(!(!ot.sections||ot.sections.length===0)){var Lt=ot.sections[0];Lt.startPoint&&ot.sources&&ot.sources[0]!=null&&l(ot.sources[0],Lt.startPoint,j,X),Lt.endPoint&&ot.targets&&ot.targets[0]!=null&&l(ot.targets[0],Lt.endPoint,j,X)}}if(A.children)for(var tt=0;tt<A.children.length;tt++)c(A.children[tt],j,X)}c(n,0,0);for(var g in a){var h=a[g];if(!(h.length<2)){var d=h[0].box,f=h[0].side,E=f==="N"||f==="S",P=E?d.width:d.height;if(P>0)for(var S=E?d.x:d.y,T=0;T<h.length;T++){var N=h[T],I=E?N.ox+N.point.x:N.oy+N.point.y,C=(I-S)/P,x=.5+(C-.5)*t;x<e?x=e:x>1-e&&(x=1-e);var M=S+x*P;E?N.point.x=M-N.ox:N.point.y=M-N.oy}}}};Rt.prototype._applyNodes=function(n,t,e){if(n.children)for(var o=0;o<n.children.length;o++){var r=n.children[o],i=this.elkToCellMap[r.id];if(i!=null){var s=this.model.getGeometry(i);if(s!=null){var a=this._isTransparentBounds(i);if(a){if((r.children==null||r.children.length===0)&&r.x!=null&&r.y!=null){var g=r.x+t,h=r.y+e,d=fi(this.graph,i);d!=null&&pa(this.model,i,Dt(g-(s.x+d.x)),Dt(h-(s.y+d.y)))}}else{var l=s;if(s=s.clone(),s.x=Dt(r.x+t),s.y=Dt(r.y+e),r.width!=null&&r.height!=null&&(this.options.resizeParent||r.children!=null&&r.children.length>0)){s.width=Dt(r.width),s.height=Dt(r.height);var c=AR(this.graph,i);c!=null&&(s.width=Math.max(s.width,Dt(c.width)),s.height=Math.max(s.height,Dt(c.height)))}(s.x!==l.x||s.y!==l.y||s.width!==l.width||s.height!==l.height)&&this.model.setGeometry(i,s)}var f=a?Dt(r.x+t):0,E=a?Dt(r.y+e):0;r.children&&r.children.length>0&&this._applyNodes(r,f,E),r.edges&&this._applyEdges(r,f,E)}}}};Rt.prototype._applyEdges=function(n,t,e){if(n.edges)for(var o=0;o<n.edges.length;o++){var r=n.edges[o],i=this.elkToCellMap[r.id];if(i!=null){var s=this.model.getGeometry(i);if(s!=null){var a=s.clone(),l=null;if(r.sections){l=[];for(var c=0;c<r.sections.length;c++){var g=r.sections[c];if(g.startPoint&&l.push(new mxPoint(Dt(g.startPoint.x+t),Dt(g.startPoint.y+e))),g.bendPoints)for(var h=0;h<g.bendPoints.length;h++){var d=g.bendPoints[h];l.push(new mxPoint(Dt(d.x+t),Dt(d.y+e)))}g.endPoint&&l.push(new mxPoint(Dt(g.endPoint.x+t),Dt(g.endPoint.y+e)))}}var f=this.options.reversedEdges!=null&&this.options.reversedEdges.has(r.id);f&&l!=null&&l.reverse();var E=this.options.jettyEnds!=null?this.options.jettyEnds[r.id]:null;if(E!=null&&l!=null&&l.length>=2&&(E.source===!0&&this._appendAnchorPoint(i,i.source,l,!0),E.target===!0&&this._appendAnchorPoint(i,i.target,l,!1)),this.options.applyEdgeRouting&&l){var P=l.slice(1,l.length-1);a.points=P.length>0?P:null}else this.options.resetEdgePoints&&(a.points=null);var S=this.options.anchoredEnds!=null?this.options.anchoredEnds[r.id]:null,T=S!=null&&S.source===!0,N=S!=null&&S.target===!0;l&&l.length>=2&&this.options.applyEdgeRouting&&this.options.orthogonalRouting&&(T||(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),N||(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null)));var I=this.options.edgeStyleMode,C=this.options.climbedEnds!=null?this.options.climbedEnds[r.id]:null,x=this.options.maskedEnds!=null?this.options.maskedEnds[r.id]:null,M=C!=null&&C.source===!0,A=C!=null&&C.target===!0,B=x!=null&&x.source===!0,Y=x!=null&&x.target===!0,j=!1,X=!1;l&&l.length>=2&&this.options.applyEdgeRouting&&(j=!T&&!M&&this._snapEndpointToAnchor(i,i.source,l,!0),X=!N&&!A&&this._snapEndpointToAnchor(i,i.target,l,!1));var tt=M||T||B&&!j,ot=A||N||Y&&!X;tt&&!T&&this.options.applyEdgeRouting&&(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),ot&&!N&&this.options.applyEdgeRouting&&(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null));var Lt=a.points!=null&&a.points.length>=1,zt=l!=null?l[0]:null,be=l!=null?l[l.length-1]:null,mr=zt!=null&&be!=null&&(Math.abs(zt.x-be.x)>.5||Math.abs(zt.y-be.y)>.5),Ea=l&&l.length>=2&&this.options.applyEdgeRouting&&this.options.orthogonalRouting&&i.source!=null&&i.target!=null,Pr=!1;if(Ea&&I==="orthogonalEdgeStyle")if(this._isOrthogonalChain(l)&&(Lt||mr)){var ma=!tt&&!j&&this._terminalDiagonal(i,i.source,l,!0),Pa=!ot&&!X&&this._terminalDiagonal(i,i.target,l,!1);Lt?(!ma&&!tt&&this._alignEndpointSegment(a,l,!0),!Pa&&!ot&&this._alignEndpointSegment(a,l,!1)):this._synthesizeZ(a,l),tt||this._strictPinTerminal(i,i.source,l,!0,ma,j),ot||this._strictPinTerminal(i,i.target,l,!1,Pa,X),Pr=!0}else tt||this._applyEndpointConstraint(i,i.source,l,!0,j),ot||this._applyEndpointConstraint(i,i.target,l,!1,X),this._styles.set(i,mxConstants.STYLE_EDGE,null),this._styles.set(i,mxConstants.STYLE_NOEDGESTYLE,"1");else if(Ea&&(I==="elkCompat"||I==="orthogonal")){var Gs=tt?null:this._applyEndpointConstraint(i,i.source,l,!0,j),Hs=ot?null:this._applyEndpointConstraint(i,i.target,l,!1,X),ma=!tt&&!j&&this._terminalDiagonal(i,i.source,l,!0),Pa=!ot&&!X&&this._terminalDiagonal(i,i.target,l,!1),hp=ma||Pa,IO=!hp&&(Lt||mr&&(Math.abs(zt.x-be.x)<=.5||Math.abs(zt.y-be.y)<=.5));if(IO)Gs!=null&&(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),Hs!=null&&(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null)),Lt||(a.points=[new mxPoint(Dt((zt.x+be.x)/2),Dt((zt.y+be.y)/2))]),Pr=!0;else if(hp){if(ma)this._pinPerpendicularPerimeter(i,i.source,l,!0),this._anchorDiagonalBody(a,l,!0);else if(Gs!=null&&I==="orthogonal"){var dp=a.points!=null?a.points.slice():[];dp.unshift(Gs),a.points=dp}if(Pa)this._pinPerpendicularPerimeter(i,i.target,l,!1),this._anchorDiagonalBody(a,l,!1);else if(Hs!=null&&I==="orthogonal"){var fp=a.points!=null?a.points.slice():[];fp.push(Hs),a.points=fp}}else if(I==="orthogonal"&&(Gs!=null||Hs!=null)){var pl=a.points!=null?a.points.slice():[];Gs!=null&&pl.unshift(Gs),Hs!=null&&pl.push(Hs),a.points=pl.length>0?pl:null}}else if(l&&l.length>=2&&this.options.applyEdgeRouting&&i.source!=null&&i.target!=null){var Ff=tt?null:this._applyEndpointConstraint(i,i.source,l,!0,j),kf=ot?null:this._applyEndpointConstraint(i,i.target,l,!1,X);if(I!=="elkCompat"&&I!=="orthogonalEdgeStyle"&&(Ff!=null||kf!=null)){var El=a.points!=null?a.points.slice():[];Ff!=null&&El.unshift(Ff),kf!=null&&El.push(kf),a.points=El.length>0?El:null}}Pr&&(this._styles.set(i,mxConstants.STYLE_NOEDGESTYLE,null),this._styles.set(i,mxConstants.STYLE_ORTHOGONAL,null),this._styles.set(i,mxConstants.STYLE_EDGE,mxConstants.EDGESTYLE_ORTHOGONAL));var RO=Pr||I==="orthogonalEdgeStyle"||I==="elkCompat";if(this.options.applyEdgeRouting&&this.options.orthogonalRouting&&l&&l.length>=2&&!RO&&this._styles.set(i,mxConstants.STYLE_ORTHOGONAL,"1"),this.options.applyEdgeRouting&&this.options.orthogonalRouting&&a.points!=null&&a.points.length>2&&(a.points=this._simplifyOrthogonal(a.points)),r.labels&&r.labels.length>0&&l&&l.length>=2){var ji=r.labels[0];if(ji.x!=null&&ji.y!=null){var ml=new mxPoint(ji.x+(ji.width||0)/2+t,ji.y+(ji.height||0)/2+e),Wf=this._projectOntoPolyline(ml,l),up=ml.x-Wf.x,_p=ml.y-Wf.y,LO=Math.sqrt(up*up+_p*_p),pp=LO<=(ji.height||0)/2?Wf:ml,Ep=this._polylineMidpoint(l);a.relative=!0,a.x=0,a.y=0,a.offset=new mxPoint(Dt(pp.x-Ep.x),Dt(pp.y-Ep.y))}}LR(a,s)||this.model.setGeometry(i,a)}}}};Rt.prototype._terminalBox=function(n){var t=this.model.getGeometry(n);if(t==null)return null;if(!t.relative)return t;var e=n.parent!=null?this.model.getGeometry(n.parent):null;if(e==null)return null;var o=t.x*e.width,r=t.y*e.height;return t.offset!=null&&(o+=t.offset.x,r+=t.offset.y),{x:o,y:r,width:t.width,height:t.height}};Rt.prototype._applyEndpointConstraint=function(n,t,e,o,r){if(t!=null){var i=this._terminalBox(t);if(!(i==null||!(i.width>0)||!(i.height>0))){var s=o?e[0]:e[e.length-1],a=o?e[1]:e[e.length-2],l=this._coordsBetween(n.parent,t.parent),c=s.x+l.dx,g=s.y+l.dy,h=(c-i.x)/i.width,d=(g-i.y)/i.height,f=.02;if(a!=null&&this.options.orthogonalRouting&&!r){var E=a.x+l.dx,P=a.y+l.dy;h<f||h>1-f?d=(P-i.y)/i.height:(d<f||d>1-f)&&(h=(E-i.x)/i.width)}h<0?h=0:h>1&&(h=1),d<0?d=0:d>1&&(d=1),h=Math.round(h*1e4)/1e4,d=Math.round(d*1e4)/1e4;var S=o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,T=o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y;if(this._styles.set(n,S,h),this._styles.set(n,T,d),a==null||!this.options.orthogonalRouting)return null;var N=i.x+h*i.width-l.dx,I=i.y+d*i.height-l.dy,C=N-a.x,x=I-a.y,M=.5;if(Math.abs(C)<=M||Math.abs(x)<=M)return null;var A=d===0||d===1;return A?new mxPoint(Dt(N),Dt(a.y)):new mxPoint(Dt(a.x),Dt(I))}}};Rt.prototype._anchorDiagonalBody=function(n,t,e){var o=e?t[0]:t[t.length-1];if(o!=null){var r=n.points!=null?n.points.slice():[],i=e?r[0]:r[r.length-1],s=.5;if(!(i!=null&&(Math.abs(i.x-o.x)<=s||Math.abs(i.y-o.y)<=s))){var a=new mxPoint(o.x,o.y);e?r.unshift(a):r.push(a),n.points=r}}};Rt.prototype._strictPinTerminal=function(n,t,e,o,r,i){r&&this._pinPerpendicularPerimeter(n,t,e,o)||this._applyEndpointConstraint(n,t,e,o,i)};Rt.prototype._appendAnchorPoint=function(n,t,e,o){if(t!=null){var r=this.graph.getCellStyle(n);if(r!=null){var i=parseFloat(r[o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]),s=parseFloat(r[o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]);if(!(isNaN(i)||isNaN(s))){var a=parseFloat(r[o?"exitDx":"entryDx"])||0,l=parseFloat(r[o?"exitDy":"entryDy"])||0,c=this._terminalBox(t);if(!(c==null||!(c.width>0)||!(c.height>0))){var g=this._coordsBetween(n.parent,t.parent),h=Dt(c.x+i*c.width+a-g.dx),d=Dt(c.y+s*c.height+l-g.dy),f=o?e[0]:e[e.length-1];if(!(f!=null&&Math.abs(f.x-h)<=.5&&Math.abs(f.y-d)<=.5)){if(f!=null)for(var E=Math.abs(f.x-h)>=Math.abs(f.y-d),P=o?0:e.length-1,S=o?1:-1;P>=0&&P<e.length;P+=S)if(E){if(Math.abs(e[P].y-d)>.75)break;e[P].y=d}else{if(Math.abs(e[P].x-h)>.75)break;e[P].x=h}var T=new mxPoint(h,d);o?e.unshift(T):e.push(T)}}}}}};Rt.prototype._snapEndpointToAnchor=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=this.graph.getCellStyle(n),s=r!=null&&String(r.snapToPoint)==="1"||i!=null&&String(i.snapToPoint)==="1";if(!s)return!1;var a=this._terminalAnchors(t);if(a==null)return!1;var l=this._terminalBox(t);if(l==null||!(l.width>0)||!(l.height>0))return!1;var c=o?e[0]:e[e.length-1];if(c==null)return!1;for(var g=this._coordsBetween(n.parent,t.parent),h=c.x+g.dx,d=c.y+g.dy,f=null,E=1/0,P=0;P<a.length;P++){var S=l.x+a[P].x*l.width,T=l.y+a[P].y*l.height,N=(S-h)*(S-h)+(T-d)*(T-d);N<E&&(E=N,f={x:S,y:T})}return f==null?!1:(c.x=Dt(f.x-g.dx),c.y=Dt(f.y-g.dy),!0)};Rt.prototype._terminalAnchors=function(n){var t=this._anchorCache[n.id];if(t!==void 0)return t;var e=this.graph,o=null,r=e.view!=null&&e.view.getState!=null?e.view.getState(n):null;r!=null&&e.getAllConnectionConstraints!=null&&(o=e.getAllConnectionConstraints(r,!0));var i=this._terminalBox(n),s=i!=null&&i.width>0?i.width:1,a=i!=null&&i.height>0?i.height:1,l=[],c;if(o!=null)for(c=0;c<o.length;c++){var g=o[c];g!=null&&g.point!=null&&l.push({x:Hf(g.point.x+(g.dx||0)/s),y:Hf(g.point.y+(g.dy||0)/a)})}else{var h=e.getCellStyle(n),d=h!=null?h.points:null;if(d!=null)try{var f=typeof d=="string"?JSON.parse(d):d;for(c=0;c<f.length;c++){var E=f[c];E!=null&&E.length>=2&&l.push({x:Hf(parseFloat(E[0])+(E.length>3&&parseFloat(E[3])||0)/s),y:Hf(parseFloat(E[1])+(E.length>4&&parseFloat(E[4])||0)/a)})}}catch(S){}}var P=l.length>0?l:null;return this._anchorCache[n.id]=P,P};Rt.PERPENDICULAR_PERIMETER_SHAPES={rhombus:!0,ellipse:!0,doubleEllipse:!0};function vf(n,t,e){var o=n!=null?n[t]:null,r=typeof o=="number"?o:parseFloat(o);return isNaN(r)?e:r}Rt.PERIMETER_OUTLINES={parallelogramPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east";if(i==="north"||i==="south"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:s},{x:t,y:e},{x:0,y:e-s},{x:0,y:0}]}var a=o?Math.max(0,Math.min(t*.5,r)):t*Math.max(0,Math.min(1,r));return[{x:a,y:0},{x:t,y:0},{x:t-a,y:e},{x:0,y:e},{x:a,y:0}]},trapezoidPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east";if(i==="west"){var a=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:0},{x:t-a,y:e},{x:a,y:e},{x:0,y:0}]}if(i==="north"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:s},{x:t,y:0},{x:t,y:e},{x:0,y:e-s},{x:0,y:s}]}if(i==="south"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:s},{x:t,y:e-s},{x:0,y:e},{x:0,y:0}]}var a=o?Math.max(0,Math.min(t*.5,r)):t*Math.max(0,Math.min(1,r));return[{x:a,y:0},{x:t-a,y:0},{x:t,y:e},{x:0,y:e},{x:a,y:0}]},stepPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east",s=t/2,a=e/2;if(i==="west"){var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:c,y:0},{x:t,y:0},{x:t-c,y:a},{x:t,y:e},{x:c,y:e},{x:0,y:a},{x:c,y:0}]}if(i==="north"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:l},{x:s,y:0},{x:t,y:l},{x:t,y:e},{x:s,y:e-l},{x:0,y:e},{x:0,y:l}]}if(i==="south"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:s,y:l},{x:t,y:0},{x:t,y:e-l},{x:s,y:e},{x:0,y:e-l},{x:0,y:0}]}var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t-c,y:0},{x:t,y:a},{x:t-c,y:e},{x:0,y:e},{x:c,y:a},{x:0,y:0}]},hexagonPerimeter2:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.25),i=n.direction||"east",s=t/2,a=e/2;if(i==="north"||i==="south"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:s,y:0},{x:t,y:l},{x:t,y:e-l},{x:s,y:e},{x:0,y:e-l},{x:0,y:l},{x:s,y:0}]}var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:c,y:0},{x:t-c,y:0},{x:t,y:a},{x:t-c,y:e},{x:c,y:e},{x:0,y:a},{x:c,y:0}]},trianglePerimeter:function(n,t,e){var o=n.direction||"east";return o==="north"?[{x:0,y:e},{x:t/2,y:0},{x:t,y:e},{x:0,y:e}]:o==="south"?[{x:0,y:0},{x:t/2,y:e},{x:t,y:0},{x:0,y:0}]:o==="west"?[{x:t,y:0},{x:0,y:e/2},{x:t,y:e},{x:t,y:0}]:[{x:0,y:0},{x:t,y:e/2},{x:0,y:e},{x:0,y:0}]}};function TO(n,t){if(n==null)return null;var e=n*1e4;return(t==="right"||t==="bottom"?Math.ceil(e-1e-6):Math.floor(e+1e-6))/1e4}Rt.prototype._outlineCross=function(n,t,e,o,r){for(var i=t==="top"||t==="bottom",s=i?e*o:e*r,a=t==="top"||t==="left",l=null,c=function(N){(l==null||(a?N<l:N>l))&&(l=N)},g=1;g<n.length;g++){var h=n[g-1],d=n[g],f=i?h.x:h.y,E=i?d.x:d.y,P=i?h.y:h.x,S=i?d.y:d.x;if(!(s<Math.min(f,E)-1e-9||s>Math.max(f,E)+1e-9))if(Math.abs(E-f)<1e-9)c(P),c(S);else{var T=(s-f)/(E-f);c(P+T*(S-P))}}return l==null?null:l/(i?r:o)};Rt.prototype._pinPerpendicularPerimeter=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=r!=null?r[mxConstants.STYLE_SHAPE]:null,s=i!=null&&Rt.PERPENDICULAR_PERIMETER_SHAPES[i]===!0,a=!s&&r!=null?Rt.PERIMETER_OUTLINES[r.perimeter]:null;if(!s&&a==null)return!1;var l=this._terminalBox(t);if(l==null||!(l.width>0)||!(l.height>0))return!1;var c=o?e[0]:e[e.length-1],g=o?e[1]:e[e.length-2];if(c==null||g==null)return!1;var h=this._coordsBetween(n.parent,t.parent),d=(c.y+h.dy-l.y)/l.height,f=(c.x+h.dx-l.x)/l.width,E=(g.x+h.dx-l.x)/l.width,P=(g.y+h.dy-l.y)/l.height,S=.02,T=null;if(d<=S)T="top";else if(d>=1-S)T="bottom";else if(f<=S)T="left";else if(f>=1-S)T="right";else{var N=Math.abs(g.x-c.x),I=Math.abs(g.y-c.y),C=.5;I<=C&&N>C?T=g.x>c.x?"right":"left":N<=C&&I>C&&(T=g.y>c.y?"bottom":"top")}if(T==null)return!1;var x,M;if(T==="top"||T==="bottom"?(x=Math.round(E*1e4)/1e4,M=TO(s?this._perimeterCross(i,T,x):this._outlineCross(a(r,l.width,l.height),T,x,l.width,l.height),T)):(M=Math.round(P*1e4)/1e4,x=TO(s?this._perimeterCross(i,T,M):this._outlineCross(a(r,l.width,l.height),T,M,l.width,l.height),T)),x==null||M==null)return!1;x<0?x=0:x>1&&(x=1),M<0?M=0:M>1&&(M=1);var A=o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,B=o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y;return this._styles.set(n,A,x),this._styles.set(n,B,M),!0};Rt.prototype._perimeterCross=function(n,t,e){if(e<0?e=0:e>1&&(e=1),n==="rhombus")return t==="bottom"||t==="right"?e<=.5?.5+e:1.5-e:e<=.5?.5-e:e-.5;var o=2*e-1,r=Math.sqrt(Math.max(0,1-o*o))/2;return t==="bottom"||t==="right"?.5+r:.5-r};Rt.prototype._isOrthogonalChain=function(n){if(n==null)return!1;for(var t=.5,e=2;e<=n.length-2;e++){var o=Math.abs(n[e].x-n[e-1].x),r=Math.abs(n[e].y-n[e-1].y);if(o>t&&r>t)return!1}return!0};Rt.prototype._alignEndpointSegment=function(n,t,e){var o=n.points;if(!(o==null||o.length===0)){var r=e?0:o.length-1,i=o[r],s=e?t[0]:t[t.length-1],a=.5;if(!(Math.abs(i.x-s.x)<=a||Math.abs(i.y-s.y)<=a)){var l=e?t[2]:t[t.length-3];l==null&&(l=e?t[t.length-1]:t[0]),Math.abs(i.x-l.x)>=Math.abs(i.y-l.y)?i.x=Dt(s.x):i.y=Dt(s.y)}}};Rt.prototype._synthesizeZ=function(n,t){var e=t[0],o=t[t.length-1],r,i;if(Math.abs(o.y-e.y)>=Math.abs(o.x-e.x)){var s=Dt((e.y+o.y)/2);r=new mxPoint(Dt(e.x),s),i=new mxPoint(Dt(o.x),s)}else{var a=Dt((e.x+o.x)/2);r=new mxPoint(a,Dt(e.y)),i=new mxPoint(a,Dt(o.y))}n.points=Math.abs(r.x-i.x)<=.5&&Math.abs(r.y-i.y)<=.5?[r]:[r,i],t.splice.apply(t,[1,0].concat(n.points))};Rt.prototype._simplifyOrthogonal=function(n){if(n==null||n.length<=2)return n;for(var t=.5,e=[n[0]],o=1;o<n.length-1;o++){var r=e[e.length-1],i=n[o],s=n[o+1],a=Math.abs(r.x-i.x)<=t&&Math.abs(i.x-s.x)<=t,l=Math.abs(r.y-i.y)<=t&&Math.abs(i.y-s.y)<=t;a||l||e.push(i)}return e.push(n[n.length-1]),e};Rt.NON_RECT_PERIMETER_SHAPES={ellipse:!0,doubleEllipse:!0,rhombus:!0,triangle:!0,hexagon:!0,parallelogram:!0,step:!0,trapezoid:!0};Rt.prototype._terminalDiagonal=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=r!=null?r[mxConstants.STYLE_SHAPE]:null;if(i==null||!Rt.NON_RECT_PERIMETER_SHAPES[i])return!1;var s=this._terminalBox(t);if(s==null||!(s.width>0)||!(s.height>0))return!1;var a=o?e[0]:e[e.length-1],l=this._coordsBetween(n.parent,t.parent),c=(a.x+l.dx-s.x)/s.width,g=(a.y+l.dy-s.y)/s.height,h=.02,d=Math.abs(c-.5)<h&&(g<h||g>1-h)||Math.abs(g-.5)<h&&(c<h||c>1-h);return!d};Rt.prototype._coordsBetween=function(n,t){if(n===t)return{dx:0,dy:0};var e=this._parentAbsoluteOrigin(n),o=this._parentAbsoluteOrigin(t);return{dx:e.x-o.x,dy:e.y-o.y}};Rt.prototype._parentAbsoluteOrigin=function(n){for(var t=0,e=0,o=n;o!=null&&o.parent!=null;){var r=this.model.getGeometry(o);r!=null&&(t+=r.x,e+=r.y),o=o.parent}return{x:t,y:e}};Rt.prototype._projectOntoPolyline=function(n,t){for(var e=null,o=1/0,r=1;r<t.length;r++){var i=t[r-1],s=t[r],a=s.x-i.x,l=s.y-i.y,c=a*a+l*l,g=0;c>0&&(g=((n.x-i.x)*a+(n.y-i.y)*l)/c,g<0?g=0:g>1&&(g=1));var h=i.x+g*a,d=i.y+g*l,f=(n.x-h)*(n.x-h)+(n.y-d)*(n.y-d);f<o&&(o=f,e=new mxPoint(h,d))}return e||n.clone()};Rt.prototype._polylineMidpoint=function(n){if(n.length===1)return n[0].clone();for(var t=0,e=[],o=1;o<n.length;o++){var r=n[o].x-n[o-1].x,i=n[o].y-n[o-1].y,s=Math.sqrt(r*r+i*i);e.push(s),t+=s}for(var a=t/2,l=0,o=0;o<e.length;o++){if(l+e[o]>=a){var c=e[o]===0?0:(a-l)/e[o];return new mxPoint(n[o].x+(n[o+1].x-n[o].x)*c,n[o].y+(n[o+1].y-n[o].y)*c)}l+=e[o]}return n[n.length-1].clone()};Rt.prototype._isCompound=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isVertex(o)&&!this.portCells.has(o.id))return!0}return!1};function wo(n,t){var e=n.getStyle(t);if(e==null)return!1;for(var o=e.split(";"),r=0;r<o.length;r++)if(o[r]==="transparentBounds=1")return!0;return!1}Rt.prototype._isTransparentBounds=function(n){return wo(this.model,n)};function AR(n,t){for(var e=n.getModel(),o=e.getChildCount(t),r=null,i=0;i<o;i++){var s=e.getChildAt(t,i);if(!(!e.isVertex(s)||!e.isVisible(s))){var a=e.getGeometry(s);if(!(a==null||a.relative)){var l=typeof n.getCellStyle=="function"?n.getCellStyle(s):{};if(l.part=="1"){var c=a.x+a.width,g=a.y+a.height;r==null?r={width:c,height:g}:(r.width=Math.max(r.width,c),r.height=Math.max(r.height,g))}}}}return r}function Bf(n){if(n==null||n==="")return null;if(typeof n=="number")return isFinite(n)?{top:n,right:n,bottom:n,left:n}:null;var t=String(n);try{t=decodeURIComponent(t)}catch(s){}if(t=t.trim(),t==="")return null;for(var e=t.split(/\s+/),o=[],r=0;r<e.length;r++){var i=parseFloat(e[r]);o.push(isNaN(i)?0:i)}return o.length===0?null:o.length===1?{top:o[0],right:o[0],bottom:o[0],left:o[0]}:o.length===2?{top:o[0],right:o[1],bottom:o[0],left:o[1]}:o.length===3?{top:o[0],right:o[1],bottom:o[2],left:o[1]}:{top:o[0],right:o[1],bottom:o[2],left:o[3]}}function CR(n,t){for(var e=n.getModel(),o=e.getChildCount(t),r=null,i=function(d,f,E,P){if(r==null)r={x:d,y:f,width:E,height:P};else{var S=Math.max(r.x+r.width,d+E),T=Math.max(r.y+r.height,f+P);r.x=Math.min(r.x,d),r.y=Math.min(r.y,f),r.width=S-r.x,r.height=T-r.y}},s=0;s<o;s++){var a=e.getChildAt(t,s),l=e.getGeometry(a);if(l!=null){if(e.isVertex(a)&&!l.relative)if(wo(e,a)){var c=fi(n,a);c!=null&&i(l.x+c.x,l.y+c.y,c.width,c.height)}else i(l.x,l.y,l.width,l.height);else if(e.isEdge(a)){var g=l.points!=null?l.points.slice():[];typeof l.getTerminalPoint=="function"&&(e.getTerminal(a,!0)==null&&l.getTerminalPoint(!0)!=null&&g.push(l.getTerminalPoint(!0)),e.getTerminal(a,!1)==null&&l.getTerminalPoint(!1)!=null&&g.push(l.getTerminalPoint(!1)));for(var h=0;h<g.length;h++)g[h]!=null&&i(g[h].x,g[h].y,0,0)}}}return r}function fi(n,t){var e=CR(n,t);if(e==null)return null;var o=typeof n.getCellStyle=="function"?n.getCellStyle(t):{},r=Bf(o.groupPadding)||{top:0,right:0,bottom:0,left:0},i=o.shape==="swimlane"||o.swimlane!=null;if(i){var s=parseInt(o.startSize,10);isNaN(s)&&(s=40),o.horizontal==0||o.horizontal==="0"?r.left+=s:r.top+=s}var a=parseInt(o.footerSize,10);return!isNaN(a)&&a>0&&(i&&(o.horizontal==0||o.horizontal==="0")?r.right+=a:r.bottom+=a),{x:e.x-r.left,y:e.y-r.top,width:e.width+r.left+r.right,height:e.height+r.top+r.bottom}}function ul(n,t,e){for(var o=null,r=n.getChildCount(t),i=0;i<r;i++){var s=n.getChildAt(t,i);if(!(!n.isVertex(s)||!n.isVisible(s))&&!(e!=null&&!e(s))){var a=n.getGeometry(s);if(a!=null){var l=a.x,c=a.y;if(wo(n,s)){var g=ul(n,s,e);if(g==null)continue;l=a.x+g.x,c=a.y+g.y}o==null?o={x:l,y:c}:(l<o.x&&(o.x=l),c<o.y&&(o.y=c))}}}return o}function cp(n,t,e){for(var o=n.getModel(),r=null,i=0;i<(t.children!=null?t.children.length:0);i++){var s=t.children[i],a=e[s.id];if(!(a==null||s.x==null||s.y==null)){var l=s.x,c=s.y;if(wo(o,a))if(s.children!=null&&s.children.length>0){var g=cp(n,s,e);if(g==null)continue;l=s.x+g.x,c=s.y+g.y}else{var h=fi(n,a),d=ul(o,a),f=o.getGeometry(a);if(h==null||d==null)continue;l=s.x+d.x-((f!=null?f.x:0)+h.x),c=s.y+d.y-((f!=null?f.y:0)+h.y)}r==null?r={x:l,y:c}:(l<r.x&&(r.x=l),c<r.y&&(r.y=c))}}return r}function pa(n,t,e,o,r){if(!(Math.abs(e)<.01&&Math.abs(o)<.01))for(var i=n.getChildCount(t),s=0;s<i;s++){var a=n.getChildAt(t,s);if(!(r!=null&&!r(a))){if(n.isVertex(a)&&wo(n,a)){pa(n,a,e,o,r);continue}var l=n.getGeometry(a);if(l!=null){if(n.isVertex(a)){if(l.relative)continue;var c=l.clone();c.x=l.x+e,c.y=l.y+o,n.setGeometry(a,c)}else if(n.isEdge(a)){var c=null;if(l.points!=null&&l.points.length>0){c=l.clone(),c.points=[];for(var g=0;g<l.points.length;g++){var h=l.points[g];c.points.push(new mxPoint(h.x+e,h.y+o))}}if(typeof l.getTerminalPoint=="function"&&typeof l.setTerminalPoint=="function")for(var d=0;d<2;d++){var f=d===0,E=n.getTerminal(a,f)==null?l.getTerminalPoint(f):null;E!=null&&(c=c!=null?c:l.clone(),c.setTerminalPoint(new mxPoint(E.x+e,E.y+o),f))}c!=null&&n.setGeometry(a,c)}}}}}function _t(n){this.graph=n,this.model=n.getModel(),this._cellToElk={},this._elkToCell={},this._portCells=new Set,this._cellToElkNode={},this._constraintPorts={},this._constraintPortCounter=0,this._portThresholdSize=20,this._reversedEdges=new Set,this._climbedEnds={},this._maskedEnds={},this._maskPortCounter=0,this._freeEndPortCounter=0,this._layoutDirection=null,this._edgeRouting=null,this._anchoredEnds={},this._jettyEnds={},this.respectConnectionConstraints=!1,this.rootCellIds=null,this.useViewStateSizing=!0,this.respectFixedPosition=!0,this.cellFilter=null,this.includeEdgeLabels=!0,this.includeVertexLabels=!0,this.includeCompoundLabels=null,this.groupPadding=null}_t.prototype.convert=function(n,t){this._cellToElk={},this._elkToCell={},this._portCells=new Set,this._cellToElkNode={},this._constraintPorts={},this._constraintPortCounter=0,this._reversedEdges=new Set,this._climbedEnds={},this._maskedEnds={},this._anchoredEnds={},this._jettyEnds={},this._maskPortCounter=0,this._freeEndPortCounter=0;var e=mxUtils.clone(t)||{};if(this._layoutDirection=e["elk.direction"]!=null?String(e["elk.direction"]):null,this.preserveNodePositions=e["elk.interactive"]==="true",e["elk.algorithm"]==null&&(e["elk.algorithm"]="layered"),e["elk.hierarchyHandling"]==null&&(e["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),this._edgeLabelsInline=e["elk.edgeLabels.inline"]==="true"||e["elk.edgeLabels.inline"]===!0,e["elk.edgeRouting"]==null){var o=this._inferEdgeRouting(n);o!=null&&(e["elk.edgeRouting"]=o)}if(this._edgeRouting=e["elk.edgeRouting"]!=null?String(e["elk.edgeRouting"]):null,e["elk.padding"]==null&&n!=null&&this.model.isVertex(n)){var r=this._getGroupPadding(n);e["elk.padding"]="[top="+r.top+",left="+r.left+",bottom="+r.bottom+",right="+r.right+"]"}var i={id:"root",layoutOptions:e,children:[],edges:[]};this._inheritedCompoundOptions={};for(var s in e)(s==="elk.algorithm"||s==="elk.direction"||s==="elk.layered.cycleBreaking.strategy"||s.indexOf("elk.layered.spacing.")===0||s.indexOf("elk.spacing.")===0||s.indexOf("elk.force.")===0||s.indexOf("elk.stress.")===0||s.indexOf("elk.radial.")===0||s.indexOf("elk.mrtree.")===0)&&(this._inheritedCompoundOptions[s]=e[s]);return this._convertChildren(n,i),this._convertEdges(n,i),this._convertInternalEdges(n),this._portFixedPosFreeEnds(i),i};_t.prototype.getElkToCellMap=function(){return this._elkToCell};_t.prototype.getPortCells=function(){return this._portCells};_t.prototype.getReversedEdges=function(){return this._reversedEdges};_t.prototype.getClimbedEnds=function(){return this._climbedEnds};_t.prototype.getMaskedEnds=function(){return this._maskedEnds};_t.prototype.getAnchoredEnds=function(){return this._anchoredEnds};_t.prototype.getJettyEnds=function(){return this._jettyEnds};_t.prototype._convertChildren=function(n,t){var e=null;t.id!=="root"&&this.model.isVertex(n)&&wo(this.model,n)&&(e=fi(this.graph,n));for(var o=this.model.getChildCount(n),r=0;r<o;r++){var i=this.model.getChildAt(n,r);if(!(!this.model.isVertex(i)||!this.model.isVisible(i))){if(this._isShapePart(i)){var s=this.model.getGeometry(i);if(this.model.isVertex(n)||s!=null&&s.relative)continue}if(!(this.cellFilter!=null&&!this.cellFilter(i))){var a=this.model.getGeometry(i);if(a!=null){if(i.collapsed){var l=this._convertVertex(i,a,e);this._convertPorts(i,l),t.children.push(l);continue}var l=this._convertVertex(i,a,e),c=this._hasLayoutableChildren(i);if(c){l.children=[],l.edges=[];var g=this._getGroupPadding(i);l.layoutOptions=l.layoutOptions||{},l.layoutOptions["elk.padding"]="[top="+g.top+",left="+g.left+",bottom="+g.bottom+",right="+g.right+"]";for(var h in this._inheritedCompoundOptions)l.layoutOptions[h]==null&&(l.layoutOptions[h]=this._inheritedCompoundOptions[h]);this._convertChildren(i,l)}this._convertPorts(i,l),t.children.push(l)}}}}};_t.prototype._convertVertex=function(n,t,e){var o="n"+n.id;this._cellToElk[n.id]=o,this._elkToCell[o]=n;var r=t.width,i=t.height,s=wo(this.model,n),a=s?fi(this.graph,n):null;if(a!=null)r=a.width,i=a.height;else if(this.useViewStateSizing&&!n.collapsed&&this._hasNonPartChild(n)&&this.graph.view!=null&&typeof this.graph.view.getState=="function"){var l=this.graph.view.getState(n),c=this.graph.view.scale||1;l!=null&&l.width!=null&&l.height!=null&&(r=Math.max(r,l.width/c),i=Math.max(i,l.height/c))}var g={id:o,width:r,height:i},h=(t.x||0)+(a!=null?a.x:0)-(e!=null?e.x:0),d=(t.y||0)+(a!=null?a.y:0)-(e!=null?e.y:0);this.respectFixedPosition&&typeof this.graph.isCellMovable=="function"&&!this.graph.isCellMovable(n)?(g.x=h,g.y=d,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.position"]="("+h+","+d+")"):this.preserveNodePositions&&t.x!=null&&t.y!=null&&(g.x=h,g.y=d),this._cellToElkNode[n.id]=g;var f=this.includeVertexLabels;if(!f&&this.includeCompoundLabels===!0&&this._hasLayoutableChildren(n)&&(f=!0),f&&s&&(f=!1),f){var E=this._getVertexLabels(n);E.length>0&&(g.labels=E,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.nodeSize.constraints"]="NODE_LABELS MINIMUM_SIZE",g.layoutOptions["elk.nodeSize.minimum"]="("+r+", "+i+")")}return g};_t.prototype._convertEdges=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(!(!this.model.isEdge(r)||!this.model.isVisible(r))&&!(this.cellFilter!=null&&!this.cellFilter(r))){var i=this._convertEdge(r);i!=null&&t.edges.push(i)}}};_t.prototype._convertEdge=function(n){var t=this.model.getTerminal(n,!0),e=this.model.getTerminal(n,!1);if(t==null||e==null)return null;var o=this._resolveEdgeTerminal(t,n,!0),r=this._resolveEdgeTerminal(e,n,!1);if(o==null||r==null)return null;var i="e"+n.id;this._cellToElk[n.id]=i,this._elkToCell[i]=n;var s={id:i,sources:[o],targets:[r]};this.respectConnectionConstraints&&this._applyConnectionConstraints(n,t,e,s);var a=s.sources[0]===this._cellToElk[t.id]?this._anchoredPoint(n,!0):null,l=s.targets[0]===this._cellToElk[e.id]?this._anchoredPoint(n,!1):null,c=a!=null?this._jettyStubFor(n,t,a,!0):null,g=l!=null?this._jettyStubFor(n,e,l,!1):null;if((c!=null||g!=null)&&this.model.getParent(t)===this.model.getParent(e)){var h=this.model.getGeometry(t),d=this.model.getGeometry(e);if(h!=null&&d!=null&&a!=null&&l!=null){var f=h.x+a.x*h.width+a.dx,E=h.y+a.y*h.height+a.dy,P=d.x+l.x*d.width+l.dx,S=d.y+l.y*d.height+l.dy,T=P-f,N=S-E,I=(c!=null?c.jetty:0)+(g!=null?g.jetty:0);T*T+N*N<I*I&&(c=null,g=null)}}if(a!=null){var C=this._ensureConstraintPort(t,a.x,a.y,a.dx,a.dy,c);C!=null&&(s.sources=[C.id],this._markAnchoredEnd(i,!0),c!=null&&this._markJettyEnd(i,!0))}if(l!=null){var x=this._ensureConstraintPort(e,l.x,l.y,l.dx,l.dy,g);x!=null&&(s.targets=[x.id],this._markAnchoredEnd(i,!1),g!=null&&this._markJettyEnd(i,!1))}if(s.sources[0]===this._cellToElk[t.id]){var M=this._portConstraintSides(n,t,!0);if(M!=null){var A=this._createMaskPort(t,this._pickConstraintSide(M,t,e,!0),this._maskJettyFor(n,!0));A!=null&&(s.sources=[A.id],this._markMaskedEnd(i,!0))}}if(s.targets[0]===this._cellToElk[e.id]){var B=this._portConstraintSides(n,e,!1);if(B!=null){var Y=this._createMaskPort(e,this._pickConstraintSide(B,e,t,!1),this._maskJettyFor(n,!1));Y!=null&&(s.targets=[Y.id],this._markMaskedEnd(i,!1))}}if(this.rootCellIds!=null&&e!=null&&t!=null){for(var j=String(e.id),X=String(t.id),tt=!1,ot=!1,Lt=0;Lt<this.rootCellIds.length;Lt++){var zt=String(this.rootCellIds[Lt]);j===zt&&(tt=!0),X===zt&&(ot=!0)}if(tt&&!ot){var be=s.sources;s.sources=s.targets,s.targets=be,this._reversedEdges.add(i)}}if(this.includeEdgeLabels){var mr=this._getEdgeLabels(n);mr.length>0&&(s.labels=mr)}return s};_t.prototype._resolveEdgeTerminal=function(n,t,e){if(this._portCells.has(n.id))return"p"+n.id;if(this._cellToElk[n.id]!=null)return this._cellToElk[n.id];for(var o=this.model.getParent(n);o!=null;){if(this._cellToElk[o.id]!=null){var r="e"+t.id,i=this._climbedEnds[r];return i==null&&(i={source:!1,target:!1},this._climbedEnds[r]=i),i[e?"source":"target"]=!0,this._cellToElk[o.id]}o=this.model.getParent(o)}return null};_t.prototype._collectInternalEdges=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isEdge(r)&&this.model.isVisible(r)){if(this.cellFilter!=null&&!this.cellFilter(r))continue;var i=this._convertEdge(r);i!=null&&t.edges.push(i)}}};_t.prototype._convertInternalEdges=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(!(!this.model.isVertex(o)||!this.model.isVisible(o))&&!this._isPort(o)&&!(this.cellFilter!=null&&!this.cellFilter(o))&&!o.collapsed){var r=this._cellToElkNode[o.id];r==null||r.edges==null||(this._collectInternalEdges(o,r),this._convertInternalEdges(o))}}};_t.prototype._isPort=function(n){if(!this.model.isVertex(n))return!1;var t=this.model.getGeometry(n);if(t==null||!t.relative)return!1;var e=this.graph.getCellStyle(n);return e[mxConstants.STYLE_SHAPE]==="port"||e.portConstraint!=null?!0:t.width<=this._portThresholdSize&&t.height<=this._portThresholdSize};_t.prototype._isShapePart=function(n){var t=this.model.getGeometry(n);return t!=null&&t.relative?!0:this.graph.getCellStyle(n).part=="1"};_t.prototype._hasNonPartChild=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isVertex(o)&&this.model.isVisible(o)&&!this._isShapePart(o))return!0}return!1};_t.prototype._hasLayoutableEdge=function(n){if(typeof this.model.getEdgeCount!="function")return!1;var t=this.model.getEdgeCount(n);if(typeof this.model.getEdgeAt!="function")return t>0;for(var e=0;e<t;e++){var o=this.model.getEdgeAt(n,e);if(!(o==null||!this.model.isVisible(o))&&!(this.cellFilter!=null&&!this.cellFilter(o)))return!0}return!1};_t.prototype._convertPorts=function(n,t){var e=this.model.getChildCount(n);if(e!==0){for(var o=[],r=0;r<e;r++){var i=this.model.getChildAt(n,r);if(this._isPort(i)&&this.graph.getCellStyle(i).part!="1"&&this._hasLayoutableEdge(i)){var s=this._convertPort(i,n,t);s!=null&&(o.push(s),this._portCells.add(i.id))}}o.length>0&&(t.ports=o,t.layoutOptions=t.layoutOptions||{},t.layoutOptions["elk.portConstraints"]="FIXED_POS")}};_t.prototype._convertPort=function(n,t,e){var o=this.model.getGeometry(n),r=this.model.getGeometry(t);if(o==null||r==null)return null;var i="p"+n.id;this._cellToElk["p"+n.id]=i,this._elkToCell[i]=n;var s=e!=null&&e.width!=null?e.width:r.width,a=e!=null&&e.height!=null?e.height:r.height,l=o.x*s,c=o.y*a;o.offset&&(l+=o.offset.x,c+=o.offset.y);var g=this._inferPortSide(s>0?(l+o.width/2)/s:o.x,a>0?(c+o.height/2)/a:o.y),h=this.graph.getCellStyle(n);if(h.portConstraint){var d={north:"NORTH",south:"SOUTH",east:"EAST",west:"WEST",NORTH:"NORTH",SOUTH:"SOUTH",EAST:"EAST",WEST:"WEST"}[h.portConstraint];d&&(g=d)}return{id:i,x:l,y:c,width:o.width,height:o.height,layoutOptions:{"elk.port.side":g}}};_t.prototype._inferPortSide=function(n,t){if(t<=.01)return"NORTH";if(t>=.99)return"SOUTH";if(n<=.01)return"WEST";if(n>=.99)return"EAST";var e=t,o=1-t,r=n,i=1-n,s=Math.min(e,o,r,i);return s===e?"NORTH":s===o?"SOUTH":s===r?"WEST":"EAST"};_t.prototype._applyConnectionConstraints=function(n,t,e,o){var r=this.graph.getCellStyle(n);if(r[mxConstants.STYLE_EXIT_X]!=null&&r[mxConstants.STYLE_EXIT_Y]!=null){var i=parseFloat(r[mxConstants.STYLE_EXIT_X]),s=parseFloat(r[mxConstants.STYLE_EXIT_Y]);if(!isNaN(i)&&!isNaN(s)){var a=this._ensureConstraintPort(t,i,s);a!=null&&(o.sources=[a.id])}}if(r[mxConstants.STYLE_ENTRY_X]!=null&&r[mxConstants.STYLE_ENTRY_Y]!=null){var l=parseFloat(r[mxConstants.STYLE_ENTRY_X]),c=parseFloat(r[mxConstants.STYLE_ENTRY_Y]);if(!isNaN(l)&&!isNaN(c)){var a=this._ensureConstraintPort(e,l,c);a!=null&&(o.targets=[a.id])}}};_t.prototype._ensureConstraintPort=function(n,t,e,o,r,i){var s=this._cellToElkNode[n.id];if(s==null)return null;var a=this.model.getGeometry(n);if(a==null)return null;o=o||0,r=r||0;var l=n.id+"_"+t.toFixed(3)+"_"+e.toFixed(3)+"_"+o+"_"+r+(i!=null?"_"+i.side+i.jetty:"");if(this._constraintPorts[l]!=null)return this._constraintPorts[l];var c="cp"+ ++this._constraintPortCounter,g={id:c,x:t*(s.width!=null?s.width:a.width)+o,y:e*(s.height!=null?s.height:a.height)+r,width:1,height:1,layoutOptions:{"elk.port.side":this._inferPortSide(t,e)}};i!=null&&(g.layoutOptions["elk.port.borderOffset"]=String(i.jetty)),s.ports||(s.ports=[]),s.ports.push(g),s.layoutOptions=s.layoutOptions||{};var h=s.layoutOptions["elk.portConstraints"];return(h==null||h==="FIXED_SIDE")&&(s.layoutOptions["elk.portConstraints"]="FIXED_POS"),this._constraintPorts[l]=g,g};_t.prototype._anchoredPoint=function(n,t){var e=this.graph.getCellStyle(n)||{};if(e[t?"exitDx":"entryDx"]==null)return null;var o=parseFloat(e[t?"exitX":"entryX"]),r=parseFloat(e[t?"exitY":"entryY"]);return isNaN(o)||isNaN(r)?null:{x:o,y:r,dx:parseFloat(e[t?"exitDx":"entryDx"])||0,dy:parseFloat(e[t?"exitDy":"entryDy"])||0}};_t.prototype._markAnchoredEnd=function(n,t){var e=this._anchoredEnds[n];e==null&&(e={source:!1,target:!1},this._anchoredEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._markJettyEnd=function(n,t){var e=this._jettyEnds[n];e==null&&(e={source:!1,target:!1},this._jettyEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._jettyStubFor=function(n,t,e,o){if(this._edgeRouting!=="ORTHOGONAL")return null;var r=this.model.getGeometry(t);if(r==null||!(r.width>0)||!(r.height>0))return null;var i=e.x+e.dx/r.width,s=e.y+e.dy/r.height,a=.01,l=i<=a,c=i>=1-a,g=s<=a,h=s>=1-a;if(l+c+g+h!==1)return null;var d=this._jettyFor(this.graph.getCellStyle(n),o);return d>0?{side:g?"N":h?"S":l?"W":"E",jetty:d}:null};_t.prototype._jettyFor=function(n,t){if(n==null)return 0;var e=n[t?"sourceJettySize":"targetJettySize"];if(e==null&&(e=n.jettySize),e==null&&(e=10),e==="auto"){var o=n[t?"startArrow":"endArrow"];if(o!=null&&o!=="none"){var r=parseFloat(n[t?"startSize":"endSize"]);isNaN(r)&&(r=6),e=Math.max(2,Math.ceil((r+10)/10))*10}else e=20}return e=parseFloat(e),isNaN(e)?0:e};_t.prototype._maskJettyFor=function(n,t){if(this._edgeRouting!=="ORTHOGONAL")return null;var e=this.graph.getCellStyle(n);if(e==null||e.jettySize==null&&e[t?"sourceJettySize":"targetJettySize"]==null)return null;var o=this._jettyFor(e,t);return o>0?o:null};_t.prototype._portConstraintSides=function(n,t,e){var o=this.graph.getCellStyle(t)||{},r=this.graph.getCellStyle(n)||{},i=o.portConstraint;if(i==null&&(i=r[e?"sourcePortConstraint":"targetPortConstraint"]),i==null)return null;var s=String(i),a=0;if(o.portConstraintRotation==1){var l=parseFloat(o.rotation)||0;l>45?a=l>=135?2:1:l<-45&&(a=l<=-135?2:3)}for(var c=["NORTH","EAST","SOUTH","WEST"],g=["north","east","south","west"],h=[],d={},f=0;f<g.length;f++)if(s.indexOf(g[f])>=0){var E=c[(f+a)%4];d[E]||(d[E]=!0,h.push(E))}return h.length===0||h.length===4?null:h};_t.prototype._pickConstraintSide=function(n,t,e,o){if(n.length===1)return n[0];var r=function(E){return n.indexOf(E)>=0?E:null},i={RIGHT:["EAST","WEST"],LEFT:["WEST","EAST"],DOWN:["SOUTH","NORTH"],UP:["NORTH","SOUTH"]}[this._layoutDirection];if(i!=null){var s=r(o?i[0]:i[1]);if(s!=null)return s}var a=this._terminalCenter(t),l=this._terminalCenter(e);if(a!=null&&l!=null)for(var c=l.x-a.x,g=l.y-a.y,h=Math.abs(c)>=Math.abs(g)?[c>=0?"EAST":"WEST",g>=0?"SOUTH":"NORTH"]:[g>=0?"SOUTH":"NORTH",c>=0?"EAST":"WEST"],d=0;d<h.length;d++){var f=r(h[d]);if(f!=null)return f}return n[0]};_t.prototype._terminalCenter=function(n){var t=this.model.getGeometry(n);return t!=null&&!t.relative?{x:t.x+t.width/2,y:t.y+t.height/2}:null};_t.prototype._createMaskPort=function(n,t,e){var o=this._cellToElkNode[n.id];if(o==null)return null;var r=this.model.getGeometry(n),i=o.width!=null?o.width:r!=null?r.width:0,s=o.height!=null?o.height:r!=null?r.height:0,a={NORTH:{x:i/2,y:0},SOUTH:{x:i/2,y:s},WEST:{x:0,y:s/2},EAST:{x:i,y:s/2}}[t],l={id:"mp"+ ++this._maskPortCounter,x:a.x,y:a.y,width:1,height:1,layoutOptions:{"elk.port.side":t}};return e!=null&&(l.layoutOptions["elk.port.borderOffset"]=String(e)),o.ports||(o.ports=[]),o.ports.push(l),o.layoutOptions=o.layoutOptions||{},o.layoutOptions["elk.portConstraints"]==null&&(o.layoutOptions["elk.portConstraints"]="FIXED_SIDE"),l};_t.prototype._markMaskedEnd=function(n,t){var e=this._maskedEnds[n];e==null&&(e={source:!1,target:!1},this._maskedEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._portFixedPosFreeEnds=function(n){var t={RIGHT:["EAST","WEST"],LEFT:["WEST","EAST"],DOWN:["SOUTH","NORTH"],UP:["NORTH","SOUTH"]}[this._layoutDirection]||["EAST","WEST"],e=[];(function j(X){e.push(X);for(var tt=X.children||[],ot=0;ot<tt.length;ot++)j(tt[ot])})(n);for(var o={},r={},i=0;i<e.length;i++){var s=e[i].layoutOptions;e[i]!==n&&s!=null&&s["elk.portConstraints"]==="FIXED_POS"&&(o[e[i].id]=e[i]);var a=e[i].ports;if(a!=null)for(var l=0;l<a.length;l++)r[a[l].id]=e[i].id}for(var c={},g=[],i=0;i<e.length;i++){var h=e[i].edges;if(h!=null)for(var d=0;d<h.length;d++)for(var f=0;f<2;f++){var E=f===0?"sources":"targets",P=o[h[d][E][0]];if(P!=null){var S=t[f],T=P.id+"|"+S,N=c[T];N==null&&(N={node:P,side:S,ends:[]},c[T]=N,g.push(N)),N.ends.push({edge:h[d],key:E,other:h[d][f===0?"targets":"sources"][0]})}}}for(var i=0;i<g.length;i++){var N=g[i],I=this._elkToCell[N.node.id],C=I!=null?this.model.getGeometry(I):null,x=N.node.width!=null?N.node.width:C!=null?C.width:0,M=N.node.height!=null?N.node.height:C!=null?C.height:0;if(N.ends.length>1){for(var d=0;d<N.ends.length;d++)N.ends[d].order=d,N.ends[d].cross=this._endCrossCoord(N.ends[d].other,N.side,r);N.ends.sort(function(tt,ot){return tt.cross!=null&&ot.cross!=null&&tt.cross!==ot.cross?tt.cross-ot.cross:tt.order-ot.order})}for(var d=0;d<N.ends.length;d++){var A=(d+1)/(N.ends.length+1),B={NORTH:{x:x*A,y:0},SOUTH:{x:x*A,y:M},WEST:{x:0,y:M*A},EAST:{x,y:M*A}}[N.side],Y={id:"fp"+ ++this._freeEndPortCounter,x:B.x,y:B.y,width:1,height:1,layoutOptions:{"elk.port.side":N.side}};N.node.ports||(N.node.ports=[]),N.node.ports.push(Y),N.ends[d].edge[N.ends[d].key]=[Y.id]}}};_t.prototype._endCrossCoord=function(n,t,e){var o=e[n]!=null?e[n]:n,r=this._elkToCell[o];if(r==null)return null;var i=this.model.getGeometry(r);if(i==null)return null;for(var s=i.x+i.width/2,a=i.y+i.height/2,l=this.model.getParent(r);l!=null&&this.model.isVertex(l);){var c=this.model.getGeometry(l);c!=null&&(s+=c.x,a+=c.y),l=this.model.getParent(l)}return t==="EAST"||t==="WEST"?a:s};_t.prototype._getCellLabel=function(n){var t=this.graph.getLabel(n);if(t!=null&&typeof t=="string"&&t.length>0){var e=t.replace(/<[^>]*>/g,"");return e.length>0?e:null}return null};_t.prototype._measureLabel=function(n,t){if(typeof mxUtils!="undefined"&&mxUtils.getSizeForString){var e=t[mxConstants.STYLE_FONTSIZE]?parseInt(t[mxConstants.STYLE_FONTSIZE]):null,o=t[mxConstants.STYLE_FONTFAMILY]||null,r=t[mxConstants.STYLE_FONTSTYLE]?parseInt(t[mxConstants.STYLE_FONTSTYLE]):null,i=mxUtils.getSizeForString(n,e,o,null,r);return{width:i.width+2,height:i.height+2}}return{width:n.length*7,height:14}};_t.prototype._getVertexLabels=function(n){var t=this._getCellLabel(n);if(t==null)return[];var e=this.graph.getCellStyle(n),o="INSIDE V_CENTER H_CENTER";e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]==="bottom"?o="OUTSIDE V_BOTTOM H_CENTER":e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]==="top"?o="OUTSIDE V_TOP H_CENTER":e[mxConstants.STYLE_LABEL_POSITION]==="left"?o="OUTSIDE V_CENTER H_LEFT":e[mxConstants.STYLE_LABEL_POSITION]==="right"?o="OUTSIDE V_CENTER H_RIGHT":e.verticalAlign==="top"?o="INSIDE V_TOP H_CENTER":e.verticalAlign==="bottom"&&(o="INSIDE V_BOTTOM H_CENTER");var r=this._measureLabel(t,e);return[{text:t,width:r.width,height:r.height,layoutOptions:{"elk.nodeLabels.placement":o}}]};_t.prototype._getEdgeLabels=function(n){var t=[],e=this.graph.getCellStyle(n),o=this._getCellLabel(n);if(o!=null){var r=this._measureLabel(o,e),i={"elk.edgeLabels.placement":"CENTER"};this._edgeLabelsInline&&(i["elk.edgeLabels.inline"]="true"),t.push({text:o,width:r.width+4,height:r.height+14,layoutOptions:i})}return t};_t.prototype._getGroupPadding=function(n){var t=this.graph.getCellStyle(n),e=wo(this.model,n),o=t[mxConstants.STYLE_SHAPE]==="swimlane"||t.swimlane!=null,r=t.container==="1",i=Bf(t.groupPadding);if(i==null&&!e&&(i=Bf(this.groupPadding)),i==null&&(i=e?{top:0,right:0,bottom:0,left:0}:{top:o||r?10:20,right:10,bottom:10,left:10}),o||r&&!e){var s=parseInt(t[mxConstants.STYLE_STARTSIZE],10);isNaN(s)&&(s=e?40:r?20:30),t.horizontal==0||t.horizontal==="0"?i.left+=s:i.top+=s}var a=parseInt(t.footerSize,10);return!isNaN(a)&&a>0&&(o&&(t.horizontal==0||t.horizontal==="0")?i.right+=a:i.bottom+=a),{top:i.top,left:i.left,bottom:i.bottom,right:i.right}};_t.prototype._hasLayoutableChildren=function(n){var t=this.graph.getCellStyle(n);if(t.childLayout!=null)return!1;for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isVertex(r)&&this.model.isVisible(r)&&!this._isShapePart(r))return this._subtreeHasEdge(n)}return!1};_t.prototype._subtreeHasEdge=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isEdge(o))return!0;if(!(this.model.isVertex(o)&&this._isShapePart(o))&&(this.model.isVertex(o)&&typeof this.model.getEdgeCount=="function"&&this.model.getEdgeCount(o)>0||this._subtreeHasEdge(o)))return!0}return!1};_t.prototype._inferEdgeRouting=function(n){var t={orthogonal:0,spline:0,other:0};return this._countEdgeStyles(n,t),t.spline>t.orthogonal&&t.spline>t.other?"SPLINES":t.orthogonal>t.other?"ORTHOGONAL":null};_t.prototype._countEdgeStyles=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isEdge(r)&&this.model.isVisible(r)){var i=this.graph.getCellStyle(r);i[mxConstants.STYLE_CURVED]==="1"?t.spline++:i[mxConstants.STYLE_EDGE]==="orthogonalEdgeStyle"||i[mxConstants.STYLE_EDGE]==="elbowEdgeStyle"||i[mxConstants.STYLE_EDGE]==="entityRelationEdgeStyle"?t.orthogonal++:t.other++}this.model.isVertex(r)&&this.model.getChildCount(r)>0&&this._countEdgeStyles(r,t)}};ht.DEFAULTS={layered:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":"30","elk.layered.spacing.nodeNodeBetweenLayers":"30","elk.edgeLabels.inline":"true","elk.spacing.edgeLabel":"5","elk.layered.cycleBreaking.strategy":"DEPTH_FIRST","elk.layered.considerModelOrder.strategy":"NODES","elk.layered.crossingMinimization.forceNodeModelOrder":"true"},mrtree:{"elk.algorithm":"mrtree","elk.direction":"DOWN","elk.spacing.nodeNode":"20","elk.spacing.edgeNode":"10","elk.mrtree.weighting":"MODEL_ORDER"},force:{"elk.algorithm":"force","elk.spacing.nodeNode":"10","elk.force.iterations":"300","elk.force.repulsivePower":"0"},stress:{"elk.algorithm":"stress","elk.spacing.nodeNode":"80","elk.stress.desiredEdgeLength":"100"},radial:{"elk.algorithm":"radial","elk.spacing.nodeNode":"20","elk.edgeRouting":"POLYLINE"},routing:{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.interactive":"true","elk.layered.cycleBreaking.strategy":"INTERACTIVE","elk.layered.layering.strategy":"INTERACTIVE","elk.layered.crossingMinimization.strategy":"INTERACTIVE","elk.layered.nodePlacement.strategy":"INTERACTIVE","elk.layered.crossingMinimization.greedySwitch.type":"OFF","elk.layered.crossingMinimization.greedySwitchHierarchical.type":"OFF","elk.spacing.nodeNode":"30","elk.layered.spacing.nodeNodeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"20","elk.edgeLabels.inline":"true","elk.spacing.edgeLabel":"5"}};ht.MENU_PRESETS={verticalFlow:{algorithm:"layered",options:{"elk.direction":"DOWN"}},horizontalFlow:{algorithm:"layered",options:{"elk.direction":"RIGHT"}},verticalTree:{algorithm:"mrtree",options:{"elk.direction":"DOWN"}},horizontalTree:{algorithm:"mrtree",options:{"elk.direction":"RIGHT"}},radialTree:{algorithm:"radial",options:null},organic:{algorithm:"force",options:null}};ht.CANONICAL_EDGE={edgeStyleMode:"orthogonalEdgeStyle",corners:"rounded"};function ht(n,t,e,o){this.graph=n,this.algorithm=t||"layered",this.layoutOptions=e||{},this.edgeStyleMode=o!=null&&o.edgeStyleMode||"auto",this.corners=o!=null&&o.corners||"keep",this.enforceCorners=o==null||o.enforceCorners!==!1,this.applierOptions=o!=null&&o.applierOptions||null,this.useViewStateSizing=o==null||o.useViewStateSizing!==!1,this.respectFixedPosition=o==null||o.respectFixedPosition!==!1,o!=null&&o.rootCellIds!=null&&o.rootCellIds.length>0?this.rootCellIds=o.rootCellIds.slice():o!=null&&o.rootCellId!=null?this.rootCellIds=[o.rootCellId]:this.rootCellIds=null,this.cellFilter=o!=null&&typeof o.cellFilter=="function"?o.cellFilter:null,this._effectiveCellFilter=this.cellFilter,this.includeEdgeLabels=!(o!=null&&o.includeEdgeLabels===!1),this.includeCompoundLabels=null,o!=null&&o.includeVertexLabels!=null?this.includeVertexLabels=o.includeVertexLabels!==!1:o!=null&&o.applierOptions!=null&&o.applierOptions.resizeParent===!1?(this.includeVertexLabels=!1,this.includeCompoundLabels=!0):this.includeVertexLabels=!0,this.portSpread=o!=null&&o.portSpread===!0,o!=null&&o.mermaidPolicy===!1?this.mermaidPolicy=!1:this.mermaidPolicy=this.algorithm==="layered",this.preserveOrigin=o!=null&&o.preserveOrigin===!0,this.resizeLayoutRoot=o!=null&&o.resizeLayoutRoot===!0,this.extractIsolated=o==null||o.extractIsolated!==!1,this.sharedStems=o==null||o.sharedStems!==!1,this.nonTreeEdges=o!=null&&o.nonTreeEdges==="elk"?"elk":"route",this.siblingOrder=o!=null&&o.siblingOrder==="model"?"model":"geometry",this.groupPadding=o!=null&&o.groupPadding!=null?o.groupPadding:null}ht.prototype.moveCell=function(){};ht.prototype.resizeCell=function(){};ht.prototype.canRouteNonTreeEdges=function(n,t){return!1};ht.prototype.routeNonTreeEdges=function(n,t){};ht.componentScopeFilter=function(n,t,e){var o={},r;for(r=0;r<e.length;r++)o[String(e[r])]=!0;var i={},s=[],a=function(E){for(var P=n.getChildCount(E),S=0;S<P;S++){var T=n.getChildAt(E,S);if(T.id!=null&&o[String(T.id)]===!0&&s.push(T),n.isEdge(T)){var N=n.getTerminal(T,!0),I=n.getTerminal(T,!1);N!=null&&N.id!=null&&(i[N.id]=i[N.id]||[]).push(T),I!=null&&I.id!=null&&I!==N&&(i[I.id]=i[I.id]||[]).push(T)}a(T)}};if(a(t),s.length===0)return null;var l={},c=[],g=function(E){for(;E!=null&&E!==t&&(n.isVertex(E)||n.isEdge(E));){if(E.id==null||l[E.id]===!0)return;l[E.id]=!0,c.push(E),E=n.getParent(E)}};for(r=0;r<s.length;r++)g(s[r]);for(;c.length>0;){var h=c.pop();n.isEdge(h)&&(g(n.getTerminal(h,!0)),g(n.getTerminal(h,!1)));var d=h.id!=null?i[h.id]:null;if(d!=null)for(r=0;r<d.length;r++)g(d[r]);var f=n.getChildCount(h);for(r=0;r<f;r++)g(n.getChildAt(h,r))}return function(E){for(;E!=null&&E!==t;){if(E.id!=null&&l[E.id]===!0)return!0;E=n.getParent(E)}return!1}};ht.prototype.execute=function(n,t){var e=this.graph.getModel();this.prepare(n,function(o,r){if(o!=null){t!=null?t(o):typeof console!="undefined"&&console.error&&console.error("ElkLayout.execute failed:",o);return}e.beginUpdate();try{r()}finally{e.endUpdate()}t!=null&&t(null)})};ht.prototype.prepare=function(n,t){var e=this,o=this._convertGraph(n);ht.getElk(function(r,i){if(i!=null){t(i);return}r.layout(o.elkGraph).then(function(s){t(null,function(){e._applyResult(n,o,s)})},function(s){t(s)})})};ht.prototype.executeSync=function(n){var t=ht.getElkSync();if(t==null)throw new Error("No synchronous ELK engine available \u2014 use prepare()/execute().");var e=this._convertGraph(n),o=t.layoutSync(e.elkGraph),r=this.graph.getModel();r.beginUpdate();try{this._applyResult(n,e,o)}finally{r.endUpdate()}};ht.prototype.canExecuteSync=function(){return ht.getElkSync()!=null};ht.prototype._convertGraph=function(n){var t=ht.DEFAULTS[this.algorithm]||{},e={};for(var o in t)e[o]=t[o];for(var o in this.layoutOptions)e[o]=this.layoutOptions[o];var r=new _t(this.graph);r.rootCellIds=this.rootCellIds,r.useViewStateSizing=this.useViewStateSizing,r.respectFixedPosition=this.respectFixedPosition;var i=this.cellFilter;i==null&&this.rootCellIds!=null&&this.rootCellIds.length>0&&(i=ht.componentScopeFilter(this.graph.getModel(),n,this.rootCellIds)),this._effectiveCellFilter=i,r.cellFilter=i,r.includeEdgeLabels=this.includeEdgeLabels,r.includeVertexLabels=this.includeVertexLabels,r.includeCompoundLabels=this.includeCompoundLabels,r.groupPadding=this.groupPadding;var s=r.convert(n,e);if(this.mermaidPolicy){ht.applyMermaidElkPolicy(s);for(var o in this.layoutOptions)(o==="elk.layered.considerModelOrder.strategy"||o==="elk.layered.crossingMinimization.forceNodeModelOrder")&&(s.layoutOptions[o]=this.layoutOptions[o])}var a=[];this.algorithm==="layered"&&this.extractIsolated&&(a=ht.extractIsolatedTopLevel(s)||[]);var l=r.getElkToCellMap(),c=[];if(this.algorithm==="mrtree"&&this.nonTreeEdges!=="elk")for(var g=ht.extractNonTreeEdges(s,e["elk.mrtree.searchOrder"]),h=0;h<g.length;h++){var d=l[g[h].id];d!=null&&(c.push(d),delete l[g[h].id])}return this.algorithm==="mrtree"&&this.siblingOrder!=="model"&&this.layoutOptions["elk.mrtree.weighting"]==null&&ht.stampSiblingOrderConstraints(s,l,this.graph,e["elk.direction"],e["elk.mrtree.searchOrder"]),{mergedOptions:e,elkGraph:s,elkToCellMap:l,portCells:r.getPortCells(),reversedEdges:r.getReversedEdges(),climbedEnds:r.getClimbedEnds(),maskedEnds:r.getMaskedEnds(),anchoredEnds:r.getAnchoredEnds(),jettyEnds:r.getJettyEnds(),isolatedNodes:a,nonTreeEdges:c}};ht._walkTreeStructure=function(n,t){var e={},o=[],r=function(S,T){if(e[S.id]={node:S,parent:T,outDirect:[],outPort:[],treeChildren:[]},S.ports!=null)for(var N=0;N<S.ports.length;N++)e[S.ports[N].id]=e[S.id];if(S.children!=null&&S.children.length>0){o.push(S);for(var I=0;I<S.children.length;I++)r(S.children[I],S)}};r(n,null);var i=function(S){if(S.edges!=null)for(var T=0;T<S.edges.length;T++){var N=S.edges[T],I=N.sources!=null?e[N.sources[0]]:null,C=N.targets!=null?e[N.targets[0]]:null;if(!(I==null||C==null||I===C||I.parent==null||I.parent!==C.parent)){var x={edge:N,container:S,target:C};N.sources[0]===I.node.id?I.outDirect.push(x):I.outPort.push(x)}}if(S.children!=null)for(var M=0;M<S.children.length;M++)i(S.children[M])};i(n);for(var s=[],a=t==="BFS",l=0;l<o.length;l++)for(var c=o[l].children,g={},h=function(S){return S.outDirect.concat(S.outPort)},d=function(S){g[S.node.id]=1;for(var T=h(S),N=0;N<T.length;N++){var I=T[N].target;g[I.node.id]===1?s.push(T[N]):g[I.node.id]===2?(g[I.node.id]=1,S.treeChildren.push(I)):(S.treeChildren.push(I),d(I))}},f=function(S){for(var T=[S];T.length>0;){var N=T.shift();g[N.node.id]=1;for(var I=h(N),C=0;C<I.length;C++){var x=I[C].target;g[x.node.id]===1?s.push(I[C]):g[x.node.id]===2?(g[x.node.id]=1,N.treeChildren.push(x)):(N.treeChildren.push(x),T.push(x))}}},E=0;E<c.length;E++){var P=e[c[E].id];g[P.node.id]==null&&(a?f(P):d(P),g[P.node.id]=2)}return{levels:o,nodeMeta:e,eliminated:s}};ht.extractNonTreeEdges=function(n,t){for(var e=ht._walkTreeStructure(n,t),o=[],r=0;r<e.eliminated.length;r++){var i=e.eliminated[r],s=i.container.edges.indexOf(i.edge);s>=0&&(i.container.edges.splice(s,1),o.push(i.edge))}return o};ht.stampSiblingOrderConstraints=function(n,t,e,o,r){for(var i=e.getModel(),s=!(o==="RIGHT"||o==="LEFT"),a=ht._walkTreeStructure(n,r),l=function(I){var C=t[I.id],x=C!=null?i.getGeometry(C):null;if(x==null)return 0;var M=wo(i,C)?fi(e,C):null;return s?(x.x||0)+(M!=null?M.x:0)+(M!=null?M.width:x.width||0)/2:(x.y||0)+(M!=null?M.y:0)+(M!=null?M.height:x.height||0)/2},c=0;c<a.levels.length;c++){var g=a.levels[c];g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.mrtree.weighting"]="CONSTRAINT"}var h={};for(var d in a.nodeMeta){var f=a.nodeMeta[d];if(!(f.node.id!==d||f.treeChildren.length===0)){for(var E=[],P=0;P<f.treeChildren.length;P++){var S=f.treeChildren[P].node;h[S.id]||(h[S.id]=!0,E.push({node:S,idx:E.length,coord:l(S)}))}E.sort(function(I,C){return I.coord-C.coord||I.idx-C.idx});for(var T=0;T<E.length;T++){var N=E[T].node;N.layoutOptions=N.layoutOptions||{},N.layoutOptions["elk.mrtree.positionConstraint"]=String(T)}}}};ht.collapseTreeStems=function(n,t){var e={},o;if(n.children!=null)for(o=0;o<n.children.length;o++)e[n.children[o].id]=n.children[o];if(n.edges!=null)for(o=0;o<n.edges.length;o++){var r=n.edges[o],i=r.sources!=null?e[r.sources[0]]:null,s=r.sections!=null&&r.sections.length>0?r.sections[0]:null;if(!(i==null||s==null||s.startPoint==null||s.bendPoints==null||s.bendPoints.length===0)){var a=s.bendPoints[0];if(t&&s.startPoint.y===a.y){var l=i.y+i.height/2;s.startPoint.y=l,a.y=l}else if(!t&&s.startPoint.x===a.x){var c=i.x+i.width/2;s.startPoint.x=c,a.x=c}var g=r.targets!=null?e[r.targets[0]]:null;if(!(g==null||s.endPoint==null)){var h=s.bendPoints,d=h[h.length-1];if(t){var f=g.y+g.height/2;s.endPoint.y===f&&d.y!==f&&(h.length>=2?d.y=f:h.push({x:d.x,y:f}))}else{var E=g.x+g.width/2;s.endPoint.x===E&&d.x!==E&&(h.length>=2?d.x=E:h.push({x:E,y:d.y}))}}}}if(n.children!=null)for(o=0;o<n.children.length;o++)ht.collapseTreeStems(n.children[o],t)};ht.prototype._applyResult=function(n,t,e){var o=this.graph,r=o.getModel(),i=t.mergedOptions,s=t.elkToCellMap,a=n!=null&&r.isVertex(n)&&wo(r,n),l=this.preserveOrigin||a,c=l&&t.isolatedNodes.length>0,g=l?ul(r,n,this._effectiveCellFilter):null,h=0,d=0;if(l&&!c&&g!=null){var f=cp(o,e,s);f!=null&&(h=g.x-f.x,d=g.y-f.y)}var E=new Zi(o),P=i["elk.edgeRouting"],S=this.algorithm==="layered"||this.algorithm==="mrtree",T=this.edgeStyleMode;T==="auto"&&(T=S&&P!=="POLYLINE"&&P!=="SPLINES"?"orthogonal":"straight");var N=t.nonTreeEdges!=null&&t.nonTreeEdges.length>0?new Set(t.nonTreeEdges):null,I=N!=null&&this.canRouteNonTreeEdges(n,t.nonTreeEdges);if(T!=="keep"){var C=new Set;for(var x in s){var M=s[x];M!=null&&r.isEdge(M)&&C.add(M)}I&&N.forEach(function(zt){C.add(zt)}),this._applyEdgeStyle(n,T,this.corners,C,E,N)}else if(N!=null&&!I){var A=this;N.forEach(function(zt){A.graph.resetEdge(zt)})}this.algorithm==="mrtree"&&this.sharedStems&&!this.portSpread&&ht.collapseTreeStems(e,i["elk.direction"]==="RIGHT"||i["elk.direction"]==="LEFT");var B={resizeParent:!0,applyEdgeRouting:this.edgeStyleMode!=="keep",resetEdgePoints:!0,orthogonalRouting:T!=="straight"&&P!=="POLYLINE"&&P!=="SPLINES",edgeStyleMode:T,portSpread:this.portSpread};if(this.applierOptions!=null)for(var Y in this.applierOptions)B[Y]=this.applierOptions[Y];B.reversedEdges=t.reversedEdges,B.climbedEnds=t.climbedEnds,B.maskedEnds=t.maskedEnds,B.anchoredEnds=t.anchoredEnds,B.jettyEnds=t.jettyEnds,B.styleBatch=E;var j=new Rt(o,s,t.portCells,B);if(j.apply(e,h,d),t.isolatedNodes.length>0&&ht.placeIsolatedTopLevelAbove(o,r,s,t.isolatedNodes,t.elkGraph.children,n,this._effectiveCellFilter),this.resizeLayoutRoot&&!a&&e.width!=null&&e.height!=null&&n!=null&&r.isVertex(n)){var X=r.getGeometry(n),tt=Math.round(e.width),ot=Math.round(e.height);X!=null&&(X.width!==tt||X.height!==ot)&&(X=X.clone(),X.width=tt,X.height=ot,r.setGeometry(n,X))}if(I&&this.routeNonTreeEdges(n,t.nonTreeEdges),c&&g!=null){var Lt=ul(r,n,this._effectiveCellFilter);Lt!=null&&pa(r,n,g.x-Lt.x,g.y-Lt.y,this._effectiveCellFilter)}};ht.prototype._applyEdgeStyle=function(n,t,e,o,r,i){var s=this.graph.getModel();this._applyEdgeStyleRecursive(n,s,t,e,o,r,i)};ht.prototype._applyEdgeStyleRecursive=function(n,t,e,o,r,i,s){for(var a=t.getChildCount(n),l=0;l<a;l++){var c=t.getChildAt(n,l);if(t.isEdge(c)&&t.isVisible(c)&&(this._effectiveCellFilter==null||this._effectiveCellFilter(c))){(r==null||!r.has(c))&&this.graph.resetEdge(c);var g=s!=null&&s.has(c)?"orthogonalEdgeStyle":e;g==="orthogonalEdgeStyle"?(i.set(c,mxConstants.STYLE_NOEDGESTYLE,null),i.set(c,mxConstants.STYLE_ORTHOGONAL,null),i.set(c,mxConstants.STYLE_EDGE,mxConstants.EDGESTYLE_ORTHOGONAL)):g==="elkCompat"?(i.set(c,mxConstants.STYLE_NOEDGESTYLE,"1"),i.set(c,mxConstants.STYLE_ORTHOGONAL,null),i.set(c,mxConstants.STYLE_EDGE,null)):(i.set(c,mxConstants.STYLE_NOEDGESTYLE,"1"),i.set(c,mxConstants.STYLE_ORTHOGONAL,g==="orthogonal"?"1":null),i.set(c,mxConstants.STYLE_EDGE,null)),o!=="keep"&&(this.enforceCorners||!gp(i.get(c),mxConstants.STYLE_CURVED))&&(i.set(c,mxConstants.STYLE_ROUNDED,o==="rounded"?"1":"0"),i.set(c,mxConstants.STYLE_CURVED,o==="curved"?"1":"0"));var h=i.get(c);gp(h,"exitDx")||(i.set(c,mxConstants.STYLE_EXIT_X,null),i.set(c,mxConstants.STYLE_EXIT_Y,null)),gp(h,"entryDx")||(i.set(c,mxConstants.STYLE_ENTRY_X,null),i.set(c,mxConstants.STYLE_ENTRY_Y,null))}t.isVertex(c)&&t.getChildCount(c)>0&&!c.collapsed&&this.graph.getCellStyle(c).childLayout==null&&this._applyEdgeStyleRecursive(c,t,e,o,r,i,s)}};function gp(n,t){return n!=null&&(n.substring(0,t.length+1)===t+"="||n.indexOf(";"+t+"=")>=0)}ht.applyCorners=function(n,t,e){if(!(e==null||e==="keep")){var o=n.getModel(),r=new Zi(n),i=function(s){for(var a=o.getChildCount(s),l=0;l<a;l++){var c=o.getChildAt(s,l);o.isEdge(c)&&o.isVisible(c)&&(r.set(c,mxConstants.STYLE_ROUNDED,e==="rounded"?"1":"0"),r.set(c,mxConstants.STYLE_CURVED,e==="curved"?"1":"0")),o.isVertex(c)&&o.getChildCount(c)>0&&!c.collapsed&&n.getCellStyle(c).childLayout==null&&i(c)}};i(t),r.flush()}};ht._elk=null;ht.getElkSync=function(){if(ht._elk!=null)return typeof ht._elk.layoutSync=="function"?ht._elk:null;if(typeof globalThis.ELK=="undefined"||globalThis.ELK==null||globalThis.ELK.prototype==null||typeof globalThis.ELK.prototype.layoutSync!="function")return null;try{return ht._elk=new globalThis.ELK,ht._elk}catch(n){return null}};ht.getElk=function(n){if(ht._elk!=null){n(ht._elk,null);return}if(typeof globalThis.ELK=="undefined"||globalThis.ELK==null){n(null,new Error("ELK engine not loaded \u2014 drawio-mermaid bundle must be included first."));return}try{ht._elk=new globalThis.ELK,n(ht._elk,null)}catch(t){n(null,t)}};ht.applyMermaidElkPolicy=function(n){var t={},e={},o={};function r(g,h){if(t[g.id]=g,e[g.id]=h,g.ports)for(var d=0;d<g.ports.length;d++)o[g.ports[d].id]=g;if(g.children)for(var f=0;f<g.children.length;f++)r(g.children[f],g)}r(n,null);function i(g){return t[g]!=null?t[g]:o[g]!=null?o[g]:null}n.layoutOptions=n.layoutOptions||{},n.layoutOptions["spacing.baseValue"]==null&&(n.layoutOptions["spacing.baseValue"]=35),n.layoutOptions["elk.layered.unnecessaryBendpoints"]==null&&(n.layoutOptions["elk.layered.unnecessaryBendpoints"]="true"),delete n.layoutOptions["elk.layered.crossingMinimization.forceNodeModelOrder"],delete n.layoutOptions["elk.layered.considerModelOrder.strategy"];function s(g){if(g!==n&&g.children!=null&&g.children.length>0&&(g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.hierarchyHandling"]==null&&(g.layoutOptions["elk.hierarchyHandling"]="SEPARATE_CHILDREN"),g.layoutOptions["spacing.baseValue"]==null&&(g.layoutOptions["spacing.baseValue"]=30),g.layoutOptions["nodeLabels.placement"]==null&&(g.layoutOptions["nodeLabels.placement"]="[H_CENTER V_TOP, INSIDE]"),delete g.width,delete g.height,delete g.layoutOptions["elk.nodeSize.constraints"],delete g.layoutOptions["elk.nodeSize.minimum"]),g.children)for(var h=0;h<g.children.length;h++)s(g.children[h])}s(n);function a(g,h){for(var d={},f=g;f!=null;)d[f.id]=f,f=e[f.id];for(f=h;f!=null;){if(d[f.id]!=null)return f;f=e[f.id]}return null}function l(g,h){for(var d=g;d!=null&&(d.children!=null&&d.children.length>0&&(d.layoutOptions=d.layoutOptions||{},d.layoutOptions["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),d!==h);)d=e[d.id]}function c(g){if(g.edges)for(var h=0;h<g.edges.length;h++){var d=g.edges[h],f=d.sources!=null?d.sources[0]:null,E=d.targets!=null?d.targets[0]:null,P=f!=null?i(f):null,S=E!=null?i(E):null;if(!(P==null||S==null)&&e[P.id]!==e[S.id]){var T=a(P,S);T!=null&&(l(P,T),l(S,T))}}if(g.children)for(var h=0;h<g.children.length;h++)c(g.children[h])}c(n)};ht.extractIsolatedTopLevel=function(n){if(n==null||n.children==null||n.children.length<2)return[];var t={};if(n.edges!=null)for(var e=0;e<n.edges.length;e++){var o=n.edges[e];if(o.sources!=null)for(var r=0;r<o.sources.length;r++)t[o.sources[r]]=!0;if(o.targets!=null)for(var i=0;i<o.targets.length;i++)t[o.targets[i]]=!0}for(var s=[],a=[],e=0;e<n.children.length;e++){var l=n.children[e],c=l.children!=null&&l.children.length>0,g=!1;if(l.ports!=null){for(var h=0;h<l.ports.length;h++)if(t[l.ports[h].id]){g=!0;break}}c||t[l.id]||g?s.push(l):a.push(l)}return a.length===0||s.length===0?[]:(n.children=s,a)};ht.placeIsolatedTopLevelAbove=function(n,t,e,o,r,i,s){if(!(o==null||o.length===0)&&!(e==null||r==null)){for(var a=1/0,l=1/0,c=-1/0,g=0;g<r.length;g++){var h=e[r[g].id];if(h!=null){var d=t.getGeometry(h);d!=null&&(d.x<a&&(a=d.x),d.y<l&&(l=d.y),d.x+d.width>c&&(c=d.x+d.width))}}if(a!==1/0){for(var f=c-a,E=30,P=10,S=0,g=0;g<o.length;g++)S+=o[g].height||30,g>0&&(S+=P);var T=S+E,N=Math.max(0,T-l);if(N>0){for(var I={},g=0;g<o.length;g++){var C=o[g],x=e[C.id];x!=null&&(I[x.id]=!0)}for(var M=i!=null?i:n.getDefaultParent(),A=t.getChildCount(M),g=0;g<A;g++){var B=t.getChildAt(M,g);if(!(B==null||I[B.id])&&!(s!=null&&!s(B))){var Y=t.getGeometry(B);if(Y!=null){if(t.isVertex(B))if(wo(t,B))pa(t,B,0,N);else{var j=Y.clone();j.y=Y.y+N,t.setGeometry(B,j)}else if(t.isEdge(B)&&Y.points!=null&&Y.points.length>0){var j=Y.clone();j.points=[];for(var X=0;X<Y.points.length;X++){var tt=Y.points[X];j.points.push(new mxPoint(tt.x,tt.y+N))}t.setGeometry(B,j)}}}}}for(var ot=l+N-S-E,g=0;g<o.length;g++){var C=o[g],x=e[C.id];if(x!=null){var Lt=t.getGeometry(x);if(Lt!=null){if(wo(t,x)){var zt=fi(n,x);if(zt!=null){var be=Math.min(zt.width,f);pa(t,x,a+(f-be)/2-(Lt.x+zt.x),ot-(Lt.y+zt.y)),ot+=zt.height+P}continue}var mr=C.width||Lt.width||100,Ea=C.height||Lt.height||30;mr>f&&(mr=f);var Pr=Lt.clone();Pr.x=a+(f-mr)/2,Pr.y=ot,Pr.width=mr,Pr.height=Ea,t.setGeometry(x,Pr),ot+=Ea+P}}}}}};ht.Adapter=_t;ht.Applier=Rt;hs.setCoreOptions(wt);var NO=!1;function Uf(){NO||(SO(),pE(),OE(),IE(),vE(),$E(),cm(),eE(),NO=!0)}function yO(n,t){gs(n,t,!1);for(let e of n.getLabels())gs(e,t,!1);for(let e of n.getPorts()){gs(e,t,!1);for(let o of e.getLabels())gs(o,t,!1)}for(let e of n.getContainedEdges()){gs(e,t,!1);for(let o of e.getLabels())gs(o,t,!1)}for(let e of n.getChildren())yO(e,t)}var _l=class{constructor(t={}){this.defaultLayoutOptions=t.defaultLayoutOptions||{},Uf()}layoutSync(t,e={}){let o=e.layoutOptions!==void 0?e.layoutOptions:this.defaultLayoutOptions,r={value:null},i=Bl.forGraph(t).rememberImporter(r).toElk();o!=null&&typeof o=="object"&&Object.keys(o).length>0&&yO(i,o);let s=e.progressMonitor||new zl;return new Wl().layout(i,s),r.value.transferLayout(i),t}layout(t,e={}){return new Promise((o,r)=>{try{o(this.layoutSync(t,e))}catch(i){r(i)}})}knownLayoutOptions(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getOptionDataAll().map(e=>({id:e.getId(),name:e.getName()||"",description:e.getDescription()||"",group:e.getGroup()||"",type:e.getType()||"",targets:e.getTargets()?Array.from(e.getTargets()):[]})))}knownLayoutAlgorithms(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getAlgorithmDataAll().map(e=>({id:e.getId(),name:e.getName()||"",description:e.getDescription()||"",knownOptions:Array.from(e.getKnownOptionIds())})))}knownLayoutCategories(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getCategoryDataAll().map(e=>({id:e.getId(),name:e.getName()||"",knownLayouters:e.getLayouters().map(o=>o.getId())})))}terminateWorker(){}};var xR=_l;return MO(DR);})();
var ElkLayout=ELK.ElkLayout,ElkAdapter=ELK.ElkAdapter,ElkApplier=ELK.ElkApplier;ELK=ELK.default;
diff --git a/src/main/webapp/js/grapheditor/EditorUi.js b/src/main/webapp/js/grapheditor/EditorUi.js
index 39d28eb61..a5dd6bbe7 100644
--- a/src/main/webapp/js/grapheditor/EditorUi.js
+++ b/src/main/webapp/js/grapheditor/EditorUi.js
@@ -2967,6 +2967,20 @@ EditorUi.prototype.onKeyPress = function(evt)
}
};
+/**
+ * Returns true if focusing an editable element on this device is expected to
+ * engage the virtual keyboard (Android and iOS tablets, other multi-touch
+ * devices). Hidden editable elements that only exist to capture keystrokes or
+ * clipboard events from a physical keyboard use this to add inputmode="none",
+ * which keeps the soft keyboard and its side effects (viewport resize, scroll
+ * of the focused element into view) out of the way.
+ */
+EditorUi.prototype.isVirtualKeyboardDevice = function()
+{
+ return mxClient.IS_ANDROID || mxClient.IS_IOS ||
+ ('ontouchstart' in document.documentElement && navigator.maxTouchPoints > 1);
+};
+
/**
* Creates and installs a hidden textarea ("typing shim") that stays focused
* when a cell is selected but not being edited. Because the OS sees an editable
@@ -2988,8 +3002,7 @@ EditorUi.prototype.installTypingShim = function()
// Suppress virtual keyboard on touch devices (Android/iOS tablets).
// The shim is for capturing keystrokes from physical keyboards and IME;
// on touch-only devices focusing a textarea triggers the soft keyboard.
- if (mxClient.IS_ANDROID || mxClient.IS_IOS ||
- ('ontouchstart' in document.documentElement && navigator.maxTouchPoints > 1))
+ if (this.isVirtualKeyboardDevice())
{
shim.setAttribute('inputmode', 'none');
}
diff --git a/src/main/webapp/js/integrate.min.js b/src/main/webapp/js/integrate.min.js
index 9bbe66c52..f568f5cee 100644
--- a/src/main/webapp/js/integrate.min.js
+++ b/src/main/webapp/js/integrate.min.js
@@ -65,13 +65,13 @@ if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap
lang.substring(0,dash));0<=window.mxLanguages.indexOf(lang)&&(window.mxLanguage=lang)}}"1"==urlParams.extAuth&&/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent)&&(urlParams.gapi="0",urlParams.noDevice="1","1"!=urlParams.lightbox&&(urlParams.lightbox="1",urlParams.layers="1",urlParams.viewerOnlyMsg="1"));"viewer.diagrams.net"==window.location.hostname&&(urlParams.lightbox="1");"1"==urlParams.lightbox&&(urlParams.chrome="0");
"1"==urlParams.embedInline&&(urlParams.embed="1",urlParams.ui="sketch",urlParams.plugins="0",urlParams.proto="json",urlParams.prefetchFonts="1",null==urlParams.pv&&(urlParams.pv="0"));function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)}
window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;"1"==urlParams.extAuth&&(a="sketch");if(null==a&&isLocalStorage&&"undefined"!==typeof JSON&&"1"!=urlParams.lightbox)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}"dark"==urlParams.ui&&null==urlParams.dark&&(urlParams.dark="1");"sketch"==a&&null==urlParams.sketch&&"ac.draw.io"===window.location.hostname&&(urlParams.sketch="1");return a}();
-(function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams["export"];null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,
-8)&&(a="http://"+a),EXPORT_URL=a);a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,
-b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0";
-"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
+(function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,
+8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");
+if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.ms365="0";
+"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.ms365="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],FORBID_ATTR:["data-icon","data-icon-content"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ALLOW_DATA_ATTR:!1,ADD_ATTR:"target content pointer-events requiredFeatures data-font-src data-action data-title data-message data-link data-effect data-lucid-type data-lucid-content".split(" ")};
window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL="undefined"===typeof window.EXPORT_URL?"/export":window.EXPORT_URL;window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
-window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"31.4.5",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"31.4.6",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),
IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&
0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),
@@ -2310,7 +2310,8 @@ EditorUi.prototype.hideShapePicker=function(a){null!=this.shapePicker&&(this.sha
EditorUi.prototype.onKeyDown=function(a){var b=this.editor.graph;if(9==a.which&&b.isEnabled()&&!mxEvent.isControlDown(a)){if(b.isEditing())if(mxEvent.isAltDown(a))b.stopEditing(!1);else try{var d=b.cellEditor.isContentEditing()&&b.cellEditor.isTextSelected();if(window.getSelection&&b.cellEditor.isContentEditing()&&!d){var e=window.getSelection(),g=0<e.rangeCount?e.getRangeAt(0).commonAncestorContainer:null;d=null!=g&&("LI"==g.nodeName||null!=g.parentNode&&"LI"==g.parentNode.nodeName)}d?document.execCommand(mxEvent.isShiftDown(a)?
"outdent":"indent",!1,null):mxEvent.isShiftDown(a)?b.stopEditing(!1):b.cellEditor.insertTab(b.cellEditor.isContentEditing()?null:4)}catch(c){}else mxEvent.isAltDown(a)?b.selectParentCell():b.selectCell(!mxEvent.isShiftDown(a));mxEvent.consume(a)}};
EditorUi.prototype.onKeyPress=function(a){var b=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(a)===this.typingShim||!this.isImmediateEditingEvent(a)||b.isEditing()||b.isSelectionEmpty()||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(null==a.key||1!==a.key.length)&&229!==a.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(a)||(b.escape(),b.cellEditor.editByTyping=!0,b.startEditing())};
-EditorUi.prototype.installTypingShim=function(){var a=this.editor.graph,b=document.createElement("textarea");b.setAttribute("autocomplete","off");b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&b.setAttribute("inputmode","none");b.tabIndex=-1;b.className="mxTypingShim";b.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";
+EditorUi.prototype.isVirtualKeyboardDevice=function(){return mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints};
+EditorUi.prototype.installTypingShim=function(){var a=this.editor.graph,b=document.createElement("textarea");b.setAttribute("autocomplete","off");b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");this.isVirtualKeyboardDevice()&&b.setAttribute("inputmode","none");b.tabIndex=-1;b.className="mxTypingShim";b.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";
this.typingShim=b;var d=!1,e=mxUtils.bind(this,function(){if(!d&&0<b.value.length){var c=b.value;b.value="";this.hideTypingShim();a.escape();a.cellEditor.editByTyping=!0;a.startEditing(null,c)}});mxEvent.addListener(b,"compositionstart",function(){d=!0});mxEvent.addListener(b,"compositionend",function(){d=!1;e()});mxEvent.addListener(b,"input",function(){e()});mxEvent.addListener(b,"keydown",mxUtils.bind(this,function(c){229!==c.keyCode&&(mxEvent.isControlDown(c)||mxEvent.isMetaDown(c)||(null==c.key||
1!==c.key.length||mxEvent.isAltDown(c)?c.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(c)&&c.preventDefault()))}));a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));a.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));a.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,
function(){this.updateTypingShim()}),0)}));if(null==a.container.tabIndex||0>a.container.tabIndex)a.container.tabIndex=-1;mxEvent.addListener(a.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var g=a.cellEditor.focusContainer;a.cellEditor.focusContainer=mxUtils.bind(this,function(){a.isSelectionEmpty()||a.isEditing()?g.apply(a.cellEditor):this.updateTypingShim()})};
@@ -4743,12 +4744,12 @@ q=!0}}q||m.apply(this,arguments)}})();(function(){Sidebar.prototype.addActiveDir
40,50,"","Windows Server",!1,null,this.getTagsForStencil("ms active directory ","windows server","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/wiring_hub.svg;",50,34,"","Wiring Hub",!1,null,this.getTagsForStencil("ms active directory ","wiring hub","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/workspace_site.svg;",
50,48.5,"","Workspace Site",!1,null,this.getTagsForStencil("ms active directory ","workspace site","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/workstation_client.svg;",42.5,50,"","Workstation Client",!1,null,this.getTagsForStencil("ms active directory ","workstation client","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/writer.svg;",
48,50,"","Writer",!1,null,this.getTagsForStencil("ms active directory ","writer","ibm").join(" ")),this.createVertexTemplateEntry("image;aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;spacingTop=3;image=img/lib/active_directory/writing.svg;",49,50,"","Writing",!1,null,this.getTagsForStencil("ms active directory ","writing","ibm").join(" "))];this.addPalette("active_directory","Active Directory",!1,mxUtils.bind(this,function(c){for(var e=0;e<a.length;e++)c.appendChild(a[e](c))}));
-this.setCurrentSearchEntryLibrary()}})();(function(){var a=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){this.setCurrentSearchEntryLibrary("general","advanced");var c=a.apply(this,arguments),e=this,b=Menus.layoutContainerEdgeStyle+"edgeStyle=orthogonalEdgeStyle;",d=function(f,g,h,m,k){return e.addEntry(f,function(){var l=Menus.layoutContainers[h],n=Menus.layoutContainers[h];n=new mxCell(g,new mxGeometry(0,0,0,0),n.sidebarStyle);n.vertex=!0;for(var p=[],q=0;q<m.length;q++){var r=new mxCell(m[q][0],
-new mxGeometry(m[q][1],m[q][2],100,40),"whiteSpace=wrap;html=1;");r.vertex=!0;p.push(n.insert(r))}for(q=0;q<k.length;q++)r=new mxCell("",new mxGeometry,b),r.geometry.relative=!0,r.edge=!0,p[k[q][0]].insertEdge(r,!0),p[k[q][1]].insertEdge(r,!1),n.insert(r);return e.createVertexTemplateFromCells([n],l.width,l.height,g,!0)})};c=c.concat([this.addDataEntry("container swimlane pool horizontal",480,380,"Horizontal Pool 1","zZRBbsMgEEVPwx4Gt+o6bptNIkXKCVA8CqhgIiCNndMXG2iUNk6rqq2ysMT8+Z/xvAWE16abO7GTS9ugJvyJ8NpZG9LJdDVqTYCqhvBHAkDjR+B5osvGLt0Jh234TgBS4FXoPSZlZa1Oog+9zqI/KKNFG6vZRirdLERv98MAH8TmpVQzh14dcVWmsw/SUnRRpVGV1qmjbYPQ2RbvcWEdnbGGc8d6GFFywZRE/nF0AbvJ5Ucpbz5HazC4PloOqgkyOaqHBIhKVFuZY7yIwidh+549sYyHjPMyWv4J7WIgCJRdw3sFxA8ZwGUGfe7mTb9CwuAXkFRTSOCWkLDqP5ncTTHht8QE7v+QSSxPL97YO3sQ3wA="),
+this.setCurrentSearchEntryLibrary()}})();(function(){var a=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){this.setCurrentSearchEntryLibrary("general","advanced");var c=a.apply(this,arguments),e=this,b=Menus.layoutContainerEdgeStyle+"edgeStyle=orthogonalEdgeStyle;",d=function(f,g,h,m,k){return e.addEntry(f,function(){var l=Menus.layoutContainers[h],n=Menus.layoutContainers[h];n=new mxCell("Layout Container",new mxGeometry(0,0,0,0),n.sidebarStyle);n.vertex=!0;for(var p=[],q=0;q<m.length;q++){var r=
+new mxCell(m[q][0],new mxGeometry(m[q][1],m[q][2],100,40),"whiteSpace=wrap;html=1;");r.vertex=!0;p.push(n.insert(r))}for(q=0;q<k.length;q++)r=new mxCell("",new mxGeometry,b),r.geometry.relative=!0,r.edge=!0,p[k[q][0]].insertEdge(r,!0),p[k[q][1]].insertEdge(r,!1),n.insert(r);return e.createVertexTemplateFromCells([n],l.width,l.height,g,!0)})};c=c.concat([this.addDataEntry("container swimlane pool horizontal",480,380,"Horizontal Pool 1","zZRBbsMgEEVPwx4Gt+o6bptNIkXKCVA8CqhgIiCNndMXG2iUNk6rqq2ysMT8+Z/xvAWE16abO7GTS9ugJvyJ8NpZG9LJdDVqTYCqhvBHAkDjR+B5osvGLt0Jh234TgBS4FXoPSZlZa1Oog+9zqI/KKNFG6vZRirdLERv98MAH8TmpVQzh14dcVWmsw/SUnRRpVGV1qmjbYPQ2RbvcWEdnbGGc8d6GFFywZRE/nF0AbvJ5Ucpbz5HazC4PloOqgkyOaqHBIhKVFuZY7yIwidh+549sYyHjPMyWv4J7WIgCJRdw3sFxA8ZwGUGfe7mTb9CwuAXkFRTSOCWkLDqP5ncTTHht8QE7v+QSSxPL97YO3sQ3wA="),
this.addDataEntry("container swimlane pool horizontal",480,360,"Horizontal Pool 2","zZRRb8IgEMc/De/06MyerZsvmpj4CYi9CBkUA6itn360UE1da5ZlW3wg4f53f477hUBYoeul5QexNiUqwt4IK6wxPu50XaBSBKgsCVsQABoWgfeJbNZl6YFbrPx3DBANJ66OGJWNMSqKzjcqie4steJViOY7IVW54o05tg2c57uPPppbdPKCm757dieteR1UGlRhrLyYynOVhHCO9dtQGWIYVmzbFr3Pa5UOThdH67GeHL6T0uRLNBq9bULJWZZexIr8NQKiAuVeJBubJZG7KOyv3hvLsEk4x9GyL2hXLUGg2SO8D0D8kAGMM0iG9D4GSGYjSDL4BST5FBJ4RiTN3eT/guhlChF7YkSQ/yGiEN7+wy43+C4/AQ=="),this.addDataEntry("container swimlane pool horizontal",
360,480,"Vertical Pool 1","xZTRbsIgFIafhsstcKC11zrnjSYmewJiT4SMiqE42z39aMGZabss2bJekHD+n//A+S4gfFE1KyePamNLNIQvCV84a33cVc0CjSFAdUn4EwGgYRF4HnFZ79KjdHjwPwlADLxJc8KobK01Uax9a5JYn3Vl5CFU853SplzL1p66C2ovd6+Xau6w1u+4vdzObqSNbIJKgxpizr8EI9TQCcpXJiXSi9B5bEan6qU00gpthd614UgKiMdMzMSMZ7QocpELhg+MxyZnXXoVT/E8sqEK9V6lxqJIoqyjsP/sfsUYNonkMFV+R3XdwQPKviP7aygwDKVNLr0jwGCIQP4HBMQYAZiCQHMz7hREsjEifEIiIP6PSCiv/1rvffn2PgA="),this.addDataEntry("container swimlane pool vertical",380,480,"Vertical Pool 2","vZRBbsIwEEVP470zTquuSVs2ICFxAouMsFUnRrYpCafvJHYILaRiQxaRPG/8Pfnfkpkoqmbp5EGtbYmGiQ8mCmdtiKuqKdAYBlyXTLwzAE4fg8+JbtZ3+UE6rMMjAoiCb2mOGMnGWhOhD61J0J90ZWRN1WKntClXsrXHboAPcvc1VAuHXp9xM0zP/qC1bIhyoiRzYUsNqqEDyjp9tnWQJu0YwbYbkU5Lf4suYDPpuEfJ7hJthcG1tOWky6DiDvEWU+EK9V4lWT5A6SPYX7RjgLRIGd7PU9zkuepiA579l+lNHA/5hPs+kyBd/LXtDJ5lO5+yDXPbzvI5fb9M+RazX/frE31TOT5Jfe/Xi/UD"),
-d("vertical tree layout","Vertical Tree Layout","verticalTree",[["Root",90,40],["Child 1",20,120],["Child 2",160,120]],[[0,1],[0,2]]),d("horizontal tree layout","Horizontal Tree Layout","horizontalTree",[["Root",40,60],["Child 1",180,20],["Child 2",180,100]],[[0,1],[0,2]]),d("vertical flow layout","Vertical Flow Layout","verticalFlow",[["Start",36.67,40],["Task",150,130],["Task",20,130],["End",36.67,220]],[[0,1],[0,2],[1,3],[2,3]]),d("horizontal flow layout","Horizontal Flow Layout","horizontalFlow",
-[["Start",40,26.67],["Task",190,90],["Task",190,20],["End",340,26.67]],[[0,1],[0,2],[1,3],[2,3]])]);this.setCurrentSearchEntryLibrary();return c}})();(function(){Sidebar.prototype.addAlibabaCloudPalette=function(){this.setCurrentSearchEntryLibrary("alibaba_cloud","alibaba_cloud");this.addAlibabaCloudGeneralPalette(30,"alibaba cloud",this,"points=[];aspect=fixed;html=1;align=center;shadow=0;dashed=0;fillColor=#FF6A00;strokeColor=none;shape=mxgraph.alibaba_cloud.");this.setCurrentSearchEntryLibrary()};Sidebar.prototype.addAlibabaCloudGeneralPalette=function(a,c,e,b){var d=[this.createVertexTemplateEntry(b+"abap_business_application_platform;",1.82*
+d("vertical tree layout","Vertical Tree Layout","verticalTree",[["Root",90,40],["Child 1",20,120],["Child 2",160,120]],[[0,1],[0,2]]),d("horizontal tree layout","Horizontal Tree Layout","horizontalTree",[["Root",40,60],["Child 1",180,20],["Child 2",180,100]],[[0,1],[0,2]]),d("vertical flow layout","Vertical Flow Layout","verticalFlow",[["Start",36.67,40],["Task",20,130],["Task",150,130],["End",36.67,220]],[[0,1],[0,2],[1,3],[2,3]]),d("horizontal flow layout","Horizontal Flow Layout","horizontalFlow",
+[["Start",40,26.67],["Task",190,20],["Task",190,90],["End",340,26.67]],[[0,1],[0,2],[1,3],[2,3]])]);this.setCurrentSearchEntryLibrary();return c}})();(function(){Sidebar.prototype.addAlibabaCloudPalette=function(){this.setCurrentSearchEntryLibrary("alibaba_cloud","alibaba_cloud");this.addAlibabaCloudGeneralPalette(30,"alibaba cloud",this,"points=[];aspect=fixed;html=1;align=center;shadow=0;dashed=0;fillColor=#FF6A00;strokeColor=none;shape=mxgraph.alibaba_cloud.");this.setCurrentSearchEntryLibrary()};Sidebar.prototype.addAlibabaCloudGeneralPalette=function(a,c,e,b){var d=[this.createVertexTemplateEntry(b+"abap_business_application_platform;",1.82*
a,1.65*a,"","ABAP Business Application Platform",!1,null,this.getTagsForStencil("buildings","abap business application platform",c).join(" ")),this.createVertexTemplateEntry(b+"acms_application_configuration_manangement;",1.7*a,1.58*a,"","ACMS Application Configuration Manangement",!1,null,this.getTagsForStencil("buildings","acms application configuration manangement",c).join(" ")),this.createVertexTemplateEntry(b+"acr_cloud_container_registry;",1.62*a,1.88*a,"","ACR Cloud Container Registry",!1,
null,this.getTagsForStencil("buildings","acr cloud container registry",c).join(" ")),this.createVertexTemplateEntry(b+"actiontrail;",1.67*a,1.67*a,"","ActionTrail",!1,null,this.getTagsForStencil("buildings","actiontrail",c).join(" ")),this.createVertexTemplateEntry(b+"adam_advanced_database_and_application_migration;",1.43*a,1.71*a,"","ADAM Advanced Database and Application Migration",!1,null,this.getTagsForStencil("buildings","adam advanced database and application migration",c).join(" ")),this.createVertexTemplateEntry(b+
"adb_analyticdb_for_mysql;",1.63*a,1.83*a,"","ADB AnalyticDB for MySQL",!1,null,this.getTagsForStencil("buildings","adb analyticdb for mysql my sql",c).join(" ")),this.createVertexTemplateEntry(b+"address_purification;",1.69*a,1.79*a,"","Address Purification",!1,null,this.getTagsForStencil("buildings","address purification",c).join(" ")),this.createVertexTemplateEntry(b+"afs_fraud_service;",1.47*a,1.66*a,"","AFS Fraud Service",!1,null,this.getTagsForStencil("buildings","afs fraud service",c).join(" ")),
@@ -13194,53 +13195,53 @@ E.setAttribute("value","circle");mxUtils.write(E,mxResources.get("circle"));var
"center",E.innerHTML='<a href="https://github.com/jgraph/drawio/issues" target="_blank" rel="noopener noreferrer">Report any PlantUML issues</a>',l.appendChild(E));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=p&&"plantUml"!=p||l.appendChild(b.createHelpIcon("mermaid"==p?"https://www.drawio.com/docs/manual/mermaid/":"https://plantuml.com/"));l.appendChild(M);mxEvent.addListener(M,"change",function(){var f=u();if(0==J.value.length||J.value==c)c=f,J.value=c});null==b.sidebar||"mermaid"!=p&&"plantUml"!=
p||(E=mxUtils.button(mxResources.get("preview"),function(f){if(b.spinner.spin(document.body,mxResources.get("loading"))){var k=function(q){b.spinner.stop();b.showPreviewTooltip(q,f)},n=function(q){b.spinner.stop();b.handleError(q)};"mermaid"==p?b.parseMermaidDiagram(J.value,"mermaidImage"!=M.value||EditorUi.isMermaidConfigured()?null:mxUtils.clone(EditorUi.legacyMermaidConfig),k,n):b.parsePlantUmlDiagram(J.value,null,function(q,t){k(q);b.showPlantUmlWarnings(t)},n)}}),E.className="geBtn",l.appendChild(E));
E=mxUtils.button(mxResources.get("close"),function(){J.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});E.className="geBtn";b.editor.cancelFirst&&l.appendChild(E);L=mxUtils.button(mxResources.get("insert"),function(f){try{"mermaid"!=M.value&&"mermaidImage"!=M.value&&"plantUmlDiagram"!=M.value&&"plantUmlImage"!=M.value&&b.hideDialog(),g(J.value,M.value,f)}catch(k){b.handleError(k)}});L.className="geBtn gePrimaryBtn";l.appendChild(L);b.editor.cancelFirst||
-l.appendChild(E);A.appendChild(l);this.container=A},NewDialog=function(b,l,p,g,u,y,A,E,J,M,L,O,c,f,k,n,q,t,r,z){function D(Ga){null!=Ga&&(bb=ab=Ga?135:140);Ga=!0;if(null!=cb)for(;Z<cb.length&&(Ga||0!=mxUtils.mod(Z,30));){var Pa=cb[Z++];Pa=v(Pa.url,Pa.libs,Pa.title,Pa.tooltip?Pa.tooltip:Pa.title,Pa.select,Pa.imgUrl,Pa.info,Pa.onClick,Pa.preview,Pa.noImg,Pa.clibs,Pa.type);Ga&&Pa.click();Ga=!1}}function H(Ga,Pa,La,Ta,Qa,Ra){if(null!=Ga&&mxUtils.isAncestorNode(document.body,Ta)){Ga=mxUtils.parseXml(Ga);
-Ga=Editor.parseDiagramNode(Ga.documentElement,null,!0);var Xa=new mxCodec(Ga.ownerDocument),gb=new mxGraphModel;Xa.decode(Ga,gb);b.sidebar.createTooltip(Ta,gb.root.children,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=Qa?mxResources.get(Qa):null,!0,new mxPoint(Pa,La),!0,function(){P=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;
-null!=Ra&&W(Ta,null,null,Ra,infoObj,clibs)},!0,!1)}}function B(){if(za==tb&&null==pa&&null!=Sa&&null!=rb&&""!=mxUtils.trim(rb.value))g&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+rb.value+"'")&&(x=!0,b.hideDialog()),Sa.click();else if(x&&b.spinner.stop(),fa&&null!=f)p||x||b.hideDialog(),f(fa,xa,Q.value);else if(g)p||x||b.hideDialog(),g(pa,Q.value,ka,ha);else{var Ga=Q.value;if(null!=Ga&&0<Ga.length){var Pa=function(Ta,Qa,Ra){b.createFile(Ra,pa,null!=ha&&0<ha.length?ha:null,Ta,function(){x||
-b.hideDialog()},null,Qa,null,null!=ia&&0<ia.length?ia:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var La=new SaveDialog(b,Ga,mxUtils.bind(this,function(Ta,Qa,Ra){Pa(Qa,Ra,Ta.value)}),null,null,null,null,b.mode);b.showDialog(La.container,420,162,!0,!1);La.init()}else b.pickFolder(b.mode,function(Ta){Pa(b.mode,Ta,Ga)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function W(Ga,Pa,La,Ta,Qa,Ra,Xa){return za!=Ga?(null!=za&&(za.classList.remove("geTemplateSelected"),
-za==tb&&(jb.style.display="none",hb.style.display="",kb.style.visibility="hidden",Ua.style.visibility=null!=Ba?"visible":"hidden")),Ga==tb&&(Pa=Ba,null!=Pa?(Ua.style.visibility="visible",Ua.style.visibility=null!=Ba?"visible":"hidden",kb.style.visibility="visible"):(jb.style.display="",kb.style.visibility="hidden",Ua.style.visibility="hidden")),da.removeAttribute("disabled"),pa=Pa,ha=La,ia=Ra,za=Ga,fa=Ta,ka=Xa,xa=Qa,za.classList.add("geTemplateSelected"),!0):!1}function I(){jb.style.display="";hb.style.display=
-"none";kb.style.visibility="hidden";Ua.style.visibility="hidden";rb.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?rb.select():document.execCommand("selectAll",!1,null)}function N(){""!=rb.value?Sa.removeAttribute("disabled"):Sa.setAttribute("disabled","disabled")}function U(){hb.style.backgroundImage=yb;hb.style.backgroundSize="contain"}function S(){U();jb.style.display="none";hb.style.display="";kb.style.visibility="visible";Ua.style.visibility="visible"}function V(){lb=!0;hb.style.backgroundImage=
-"url("+Editor.spinImage+")";hb.style.backgroundSize="12px 12px";hb.style.display="";jb.style.display="none"}function ja(Ga){if(!lb){var Pa=mxUtils.trim(rb.value);Ga||""==Pa?null!=ma&&(rb.value=ma,S()):(V(),b.generateOpenAiMermaidDiagram(Pa,function(La){lb=!1;za==tb&&"none"==jb.style.display?(yb="url("+Editor.createSvgDataUri(mxUtils.getXml(b.getSvgForXml(La)))+")",tb.setAttribute("title",Pa),Ua.style.display="",Ba=pa=La,ma=Pa,b.lastGenerateXml=La,b.lastGenerateTitle=Pa,b.lastGenerateBackground=yb,
-S(),x&&B()):U()},mxUtils.bind(this,function(La){lb=!1;U();if(za==tb){jb.style.display="";hb.style.display="none";kb.style.visibility="hidden";Ua.style.visibility="hidden";if(null!=La&&null!=La.retry){var Ta=La.retry;La.retry=function(){V();Ta()}}b.handleError(La)}})))}}function v(Ga,Pa,La,Ta,Qa,Ra,Xa,gb,ib,zb,xb,Jb){function mb(Oa,db){null==sa?(va=Oa,va=/^https?:\/\//.test(va)?b.editor.isCorsEnabledForUrl(va)?va:PROXY_URL+"?url="+encodeURIComponent(va):TEMPLATE_PATH+"/"+va,mxUtils.get(va,mxUtils.bind(this,
-function(ob){200<=ob.getStatus()&&299>=ob.getStatus()&&(sa=ob.getText());db(sa,va)}))):db(sa,va)}function Fb(Oa,db){if(null==Ga||Y||b.sidebar.currentElt==Ya)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=ca){var ob="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+ca.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+ca.naturalWidth+'" height="'+ca.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+
-"</diagram></mxfile>";H(ob,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),La,Ga)}else b.sidebar.currentElt=Ya,Y=!0,mb(Ga,function(ub){if(Y&&b.sidebar.currentElt==Ya)try{H(ub,mxEvent.getClientX(Oa),mxEvent.getClientY(Oa),Ya,db)}catch(Bb){b.sidebar.currentElt=null,b.handleError(Bb)}Y=!1})}var Ya=null;if("generative"!=Jb||null==tb){Ya=document.createElement("div");Ya.className="geTemplate";var sa=null,va=Ga;null!=La?Ya.setAttribute("title",mxResources.get(La,null,La)):null!=Ta&&0<Ta.length&&Ya.setAttribute("title",
-Ta)}else Ya=tb;var Da=document.createElement("span");Da.className="geAdaptiveAsset";mxUtils.write(Da,mxResources.get(La,null,La));if(null!=Ra){Ya.style.display="inline-flex";Ya.style.justifyContent="center";Ya.style.alignItems="center";ib=document.createElement("img");ib.setAttribute("src",Ra);ib.setAttribute("alt",Ta);ib.style.maxWidth=bb+"px";ib.style.maxHeight=ab+"px";ca=ib;var Ka=Ra.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ya.appendChild(ib);ib.onerror=function(){this.src!=
-Ka?this.src=Ka:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ya,mxUtils.bind(this,function(Oa){W(Ya,null,null,Ga,Xa,xb)}),null,null);mxEvent.addListener(Ya,"dblclick",function(Oa){B();mxEvent.consume(Oa)})}else if(!zb&&null!=Ga&&0<Ga.length){var Ja=function(Oa){X.spin(la)&&mb(Ga,function(db,ob){X.stop();null!=db&&(W(Ya,db,Pa,null,null,xb,ob),Oa&&B())})};Ra=ib||TEMPLATE_PATH+"/"+Ga.substring(0,Ga.length-4)+".png";ib=hb.cloneNode(!1);ib.style.backgroundImage="url("+Ra+
-")";ib.style.display="";Ya.appendChild(ib);null!=La&&Ya.appendChild(Da);mxEvent.addGestureListeners(Ya,mxUtils.bind(this,function(Oa){Ja()}),null,null);mxEvent.addListener(Ya,"dblclick",function(Oa){Ja(!0);mxEvent.consume(Oa)})}else Ya.appendChild(Da),"generative"==Jb&&null==tb&&(Ya.appendChild(hb),Ya.appendChild(jb),Ya.appendChild(Ua),Ya.appendChild(kb),tb=Ya,null!=Ba&&(Ya.setAttribute("title",ma),rb.value=ma,N(),Ua.style.display="")),Qa&&W(Ya),null!=gb?(mxEvent.addGestureListeners(Ya,null,null,
-mxUtils.bind(this,function(Oa){W(Ya,null,null,Ga,Xa)})),mxEvent.addListener(Ya,"click",gb)):(mxEvent.addListener(Ya,"click",function(Oa){W(Ya,null,null,Ga,Xa)&&"generative"==Jb&&null==Ba&&I()}),mxEvent.addListener(Ya,"dblclick",function(Oa){"generative"!=Jb?B():"none"==jb.style.display&&I();mxEvent.consume(Oa)}));null!=Ga&&(Ra=R.cloneNode(!0),Ya.appendChild(Ra),mxEvent.addGestureListeners(Ra,mxUtils.bind(this,function(Oa){P=b.sidebar.currentElt==Ya}),null,null),mxEvent.addListener(Ra,"click",mxUtils.bind(this,
-function(Oa){P||Fb(Oa,null!=La?La:Ta);mxEvent.consume(Oa)})));la.appendChild(Ya);return Ya}function d(){function Ga(mb,Fb){mb=mxResources.get(mb,null,mb.substring(0,1).toUpperCase()+mb.substring(1));18<mb.length&&(mb=mb.substring(0,18)+"&hellip;");return mb+(null!=Fb?" ("+Fb.length+")":"")}function Pa(mb,Fb,Ya){mxEvent.addListener(Fb,"click",function(){eb!=Fb&&(null!=eb&&(eb.style.backgroundColor=""),eb=Fb,eb.style.backgroundColor=A,la.scrollTop=0,la.innerText="",Z=0,null!=Za[mb].content?(la.appendChild(Za[mb].content),
-pa=Ba,cb=null,null!=Za[mb].content.init&&Za[mb].content.init()):(cb=Ya?Hb[mb][Ya]:Za[mb],ea=null,D(!1)))})}fb&&(fb=!1,mxEvent.addListener(la,"scroll",function(mb){la.scrollTop+la.clientHeight>=la.scrollHeight&&(D(),mxEvent.consume(mb))}));if(0<Cb){var La=document.createElement("div");La.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(La,mxResources.get("custom"));Ma.appendChild(La);for(var Ta in Db){var Qa=document.createElement("div");
-La=Ta;var Ra=Db[Ta];18<La.length&&(La=La.substring(0,18)+"&hellip;");Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";Qa.setAttribute("title",La+" ("+Ra.length+")");mxUtils.write(Qa,Qa.getAttribute("title"));null!=M&&(Qa.style.padding=M);Ma.appendChild(Qa);(function(mb,Fb){mxEvent.addListener(Qa,"click",function(){eb!=Fb&&(eb.style.backgroundColor="",eb=Fb,eb.style.backgroundColor=A,la.scrollTop=
-0,la.innerText="",Z=0,cb=Db[mb],ea=null,D(!1))})})(Ta,Qa)}La=document.createElement("div");La.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(La,"draw.io");Ma.appendChild(La)}for(Ta in Za){La=Ra=null;if(null!=Za[Ta].content)Qa=document.createElement(Xa?"ul":"div"),La=Ga(Ta),Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",
-Qa.setAttribute("title",La),mxUtils.write(Qa,La),Ma.appendChild(Qa),La=Qa;else{var Xa=Hb[Ta];La=Qa=document.createElement(Xa?"ul":"div");Ra=Za[Ta];var gb=Ga(Ta,Ra);if(null!=Xa){Ra=document.createElement("li");var ib=document.createElement("div");ib.className="geTempTreeCaret";ib.setAttribute("title",gb);mxUtils.write(ib,gb);La=ib;Ra.appendChild(ib);gb=document.createElement("ul");gb.className="geTempTreeNested";gb.style.visibility="hidden";for(var zb in Xa){var xb=document.createElement("li"),Jb=
-Ga(zb,Xa[zb]);xb.setAttribute("title",Jb);mxUtils.write(xb,Jb);Pa(Ta,xb,zb);gb.appendChild(xb)}Ra.appendChild(gb);Qa.className="geTempTree";Qa.appendChild(Ra);(function(mb,Fb){mxEvent.addListener(Fb,"click",function(){mb.style.visibility="visible";mb.classList.toggle("geTempTreeActive");mb.classList.toggle("geTempTreeNested")&&setTimeout(function(){mb.style.visibility="hidden"},550);Fb.classList.toggle("geTempTreeCaret-down")})})(gb,ib)}else Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",
-Qa.setAttribute("title",gb),mxUtils.write(Qa,gb);null!=M&&(Qa.style.padding=M);Ma.appendChild(Qa)}Pa(Ta,La);null==eb&&La.click()}D(!1)}var m=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);p=null!=p?p:!0;u=null!=u?u:!1;A=null!=A?A:"light-dark(#ebf2f9, "+Editor.darkColor+")";L=null!=L?L:EditorUi.templateFile;var x=!1,C=document.createElement("div");C.style.userSelect="none";C.style.height="100%";var F=document.createElement("div");F.style.whiteSpace="nowrap";
+l.appendChild(E);A.appendChild(l);this.container=A},NewDialog=function(b,l,p,g,u,y,A,E,J,M,L,O,c,f,k,n,q,t,r,z){function D(Fa){null!=Fa&&(eb=bb=Fa?135:140);Fa=!0;if(null!=db)for(;Z<db.length&&(Fa||0!=mxUtils.mod(Z,30));){var Na=db[Z++];Na=v(Na.url,Na.libs,Na.title,Na.tooltip?Na.tooltip:Na.title,Na.select,Na.imgUrl,Na.info,Na.onClick,Na.preview,Na.noImg,Na.clibs,Na.type);Fa&&Na.click();Fa=!1}}function H(Fa,Na,Ka,Ta,Qa,Ra){if(null!=Fa&&mxUtils.isAncestorNode(document.body,Ta)){Fa=mxUtils.parseXml(Fa);
+Fa=Editor.parseDiagramNode(Fa.documentElement,null,!0);var $a=new mxCodec(Fa.ownerDocument),ab=new mxGraphModel;$a.decode(Fa,ab);b.sidebar.createTooltip(Ta,ab.root.children,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=Qa?mxResources.get(Qa):null,!0,new mxPoint(Na,Ka),!0,function(){P=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;
+null!=Ra&&W(Ta,null,null,Ra,infoObj,clibs)},!0,!1)}}function B(){if(za==tb&&null==pa&&null!=Sa&&null!=wb&&""!=mxUtils.trim(wb.value))g&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+wb.value+"'")&&(x=!0,b.hideDialog()),Sa.click();else if(x&&b.spinner.stop(),fa&&null!=f)p||x||b.hideDialog(),f(fa,xa,Q.value);else if(g)p||x||b.hideDialog(),g(pa,Q.value,ka,ha);else{var Fa=Q.value;if(null!=Fa&&0<Fa.length){var Na=function(Ta,Qa,Ra){b.createFile(Ra,pa,null!=ha&&0<ha.length?ha:null,Ta,function(){x||
+b.hideDialog()},null,Qa,null,null!=ia&&0<ia.length?ia:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var Ka=new SaveDialog(b,Fa,mxUtils.bind(this,function(Ta,Qa,Ra){Na(Qa,Ra,Ta.value)}),null,null,null,null,b.mode);b.showDialog(Ka.container,420,162,!0,!1);Ka.init()}else b.pickFolder(b.mode,function(Ta){Na(b.mode,Ta,Fa)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function W(Fa,Na,Ka,Ta,Qa,Ra,$a){return za!=Fa?(null!=za&&(za.classList.remove("geTemplateSelected"),
+za==tb&&(cb.style.display="none",gb.style.display="",pb.style.visibility="hidden",Xa.style.visibility=null!=Ba?"visible":"hidden")),Fa==tb&&(Na=Ba,null!=Na?(Xa.style.visibility="visible",Xa.style.visibility=null!=Ba?"visible":"hidden",pb.style.visibility="visible"):(cb.style.display="",pb.style.visibility="hidden",Xa.style.visibility="hidden")),da.removeAttribute("disabled"),pa=Na,ha=Ka,ia=Ra,za=Fa,fa=Ta,ka=$a,xa=Qa,za.classList.add("geTemplateSelected"),!0):!1}function I(){cb.style.display="";gb.style.display=
+"none";pb.style.visibility="hidden";Xa.style.visibility="hidden";wb.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?wb.select():document.execCommand("selectAll",!1,null)}function N(){""!=wb.value?Sa.removeAttribute("disabled"):Sa.setAttribute("disabled","disabled")}function U(){gb.style.backgroundImage=Db;gb.style.backgroundSize="contain"}function S(){U();cb.style.display="none";gb.style.display="";pb.style.visibility="visible";Xa.style.visibility="visible"}function V(){qb=!0;gb.style.backgroundImage=
+"url("+Editor.spinImage+")";gb.style.backgroundSize="12px 12px";gb.style.display="";cb.style.display="none"}function ja(Fa){if(!qb){var Na=mxUtils.trim(wb.value);Fa||""==Na?null!=ma&&(wb.value=ma,S()):(V(),b.generateOpenAiMermaidDiagram(Na,function(Ka){qb=!1;za==tb&&"none"==cb.style.display?(Db="url("+Editor.createSvgDataUri(mxUtils.getXml(b.getSvgForXml(Ka)))+")",tb.setAttribute("title",Na),Xa.style.display="",Ba=pa=Ka,ma=Na,b.lastGenerateXml=Ka,b.lastGenerateTitle=Na,b.lastGenerateBackground=Db,
+S(),x&&B()):U()},mxUtils.bind(this,function(Ka){qb=!1;U();if(za==tb){cb.style.display="";gb.style.display="none";pb.style.visibility="hidden";Xa.style.visibility="hidden";if(null!=Ka&&null!=Ka.retry){var Ta=Ka.retry;Ka.retry=function(){V();Ta()}}b.handleError(Ka)}})))}}function v(Fa,Na,Ka,Ta,Qa,Ra,$a,ab,mb,sb,zb,Eb){function hb(Ca,Ia){null==Ob?(Kb=Ca,Kb=/^https?:\/\//.test(Kb)?b.editor.isCorsEnabledForUrl(Kb)?Kb:PROXY_URL+"?url="+encodeURIComponent(Kb):TEMPLATE_PATH+"/"+Kb,mxUtils.get(Kb,mxUtils.bind(this,
+function(La){200<=La.getStatus()&&299>=La.getStatus()&&(Ob=La.getText());Ia(Ob,Kb)}))):Ia(Ob,Kb)}function Fb(Ca,Ia){if(null==Fa||Y||b.sidebar.currentElt==Ya)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=ca){var La="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+ca.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+ca.naturalWidth+'" height="'+ca.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+
+"</diagram></mxfile>";H(La,mxEvent.getClientX(Ca),mxEvent.getClientY(Ca),Ka,Fa)}else b.sidebar.currentElt=Ya,Y=!0,hb(Fa,function(Ua){if(Y&&b.sidebar.currentElt==Ya)try{H(Ua,mxEvent.getClientX(Ca),mxEvent.getClientY(Ca),Ya,Ia)}catch(Va){b.sidebar.currentElt=null,b.handleError(Va)}Y=!1})}var Ya=null;if("generative"!=Eb||null==tb){Ya=document.createElement("div");Ya.className="geTemplate";var Ob=null,Kb=Fa;null!=Ka?Ya.setAttribute("title",mxResources.get(Ka,null,Ka)):null!=Ta&&0<Ta.length&&Ya.setAttribute("title",
+Ta)}else Ya=tb;var Nb=document.createElement("span");Nb.className="geAdaptiveAsset";mxUtils.write(Nb,mxResources.get(Ka,null,Ka));if(null!=Ra){Ya.style.display="inline-flex";Ya.style.justifyContent="center";Ya.style.alignItems="center";mb=document.createElement("img");mb.setAttribute("src",Ra);mb.setAttribute("alt",Ta);mb.style.maxWidth=eb+"px";mb.style.maxHeight=bb+"px";ca=mb;var ra=Ra.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ya.appendChild(mb);mb.onerror=function(){this.src!=
+ra?this.src=ra:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ya,mxUtils.bind(this,function(Ca){W(Ya,null,null,Fa,$a,zb)}),null,null);mxEvent.addListener(Ya,"dblclick",function(Ca){B();mxEvent.consume(Ca)})}else if(!sb&&null!=Fa&&0<Fa.length){var va=function(Ca){X.spin(la)&&hb(Fa,function(Ia,La){X.stop();null!=Ia&&(W(Ya,Ia,Na,null,null,zb,La),Ca&&B())})};Ra=mb||TEMPLATE_PATH+"/"+Fa.substring(0,Fa.length-4)+".png";mb=gb.cloneNode(!1);mb.style.backgroundImage="url("+Ra+
+")";mb.style.display="";Ya.appendChild(mb);null!=Ka&&Ya.appendChild(Nb);mxEvent.addGestureListeners(Ya,mxUtils.bind(this,function(Ca){va()}),null,null);mxEvent.addListener(Ya,"dblclick",function(Ca){va(!0);mxEvent.consume(Ca)})}else Ya.appendChild(Nb),"generative"==Eb&&null==tb&&(Ya.appendChild(gb),Ya.appendChild(cb),Ya.appendChild(Xa),Ya.appendChild(pb),tb=Ya,null!=Ba&&(Ya.setAttribute("title",ma),wb.value=ma,N(),Xa.style.display="")),Qa&&W(Ya),null!=ab?(mxEvent.addGestureListeners(Ya,null,null,
+mxUtils.bind(this,function(Ca){W(Ya,null,null,Fa,$a)})),mxEvent.addListener(Ya,"click",ab)):(mxEvent.addListener(Ya,"click",function(Ca){W(Ya,null,null,Fa,$a)&&"generative"==Eb&&null==Ba&&I()}),mxEvent.addListener(Ya,"dblclick",function(Ca){"generative"!=Eb?B():"none"==cb.style.display&&I();mxEvent.consume(Ca)}));null!=Fa&&(Ra=R.cloneNode(!0),Ya.appendChild(Ra),mxEvent.addGestureListeners(Ra,mxUtils.bind(this,function(Ca){P=b.sidebar.currentElt==Ya}),null,null),mxEvent.addListener(Ra,"click",mxUtils.bind(this,
+function(Ca){P||Fb(Ca,null!=Ka?Ka:Ta);mxEvent.consume(Ca)})));la.appendChild(Ya);return Ya}function d(){function Fa(hb,Fb){hb=mxResources.get(hb,null,hb.substring(0,1).toUpperCase()+hb.substring(1));18<hb.length&&(hb=hb.substring(0,18)+"&hellip;");return hb+(null!=Fb?" ("+Fb.length+")":"")}function Na(hb,Fb,Ya){mxEvent.addListener(Fb,"click",function(){ib!=Fb&&(null!=ib&&(ib.style.backgroundColor=""),ib=Fb,ib.style.backgroundColor=A,la.scrollTop=0,la.innerText="",Z=0,null!=Za[hb].content?(la.appendChild(Za[hb].content),
+pa=Ba,db=null,null!=Za[hb].content.init&&Za[hb].content.init()):(db=Ya?Jb[hb][Ya]:Za[hb],ea=null,D(!1)))})}fb&&(fb=!1,mxEvent.addListener(la,"scroll",function(hb){la.scrollTop+la.clientHeight>=la.scrollHeight&&(D(),mxEvent.consume(hb))}));if(0<yb){var Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,mxResources.get("custom"));Ma.appendChild(Ka);for(var Ta in Ab){var Qa=document.createElement("div");
+Ka=Ta;var Ra=Ab[Ta];18<Ka.length&&(Ka=Ka.substring(0,18)+"&hellip;");Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";Qa.setAttribute("title",Ka+" ("+Ra.length+")");mxUtils.write(Qa,Qa.getAttribute("title"));null!=M&&(Qa.style.padding=M);Ma.appendChild(Qa);(function(hb,Fb){mxEvent.addListener(Qa,"click",function(){ib!=Fb&&(ib.style.backgroundColor="",ib=Fb,ib.style.backgroundColor=A,la.scrollTop=
+0,la.innerText="",Z=0,db=Ab[hb],ea=null,D(!1))})})(Ta,Qa)}Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,"draw.io");Ma.appendChild(Ka)}for(Ta in Za){Ka=Ra=null;if(null!=Za[Ta].content)Qa=document.createElement($a?"ul":"div"),Ka=Fa(Ta),Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",
+Qa.setAttribute("title",Ka),mxUtils.write(Qa,Ka),Ma.appendChild(Qa),Ka=Qa;else{var $a=Jb[Ta];Ka=Qa=document.createElement($a?"ul":"div");Ra=Za[Ta];var ab=Fa(Ta,Ra);if(null!=$a){Ra=document.createElement("li");var mb=document.createElement("div");mb.className="geTempTreeCaret";mb.setAttribute("title",ab);mxUtils.write(mb,ab);Ka=mb;Ra.appendChild(mb);ab=document.createElement("ul");ab.className="geTempTreeNested";ab.style.visibility="hidden";for(var sb in $a){var zb=document.createElement("li"),Eb=
+Fa(sb,$a[sb]);zb.setAttribute("title",Eb);mxUtils.write(zb,Eb);Na(Ta,zb,sb);ab.appendChild(zb)}Ra.appendChild(ab);Qa.className="geTempTree";Qa.appendChild(Ra);(function(hb,Fb){mxEvent.addListener(Fb,"click",function(){hb.style.visibility="visible";hb.classList.toggle("geTempTreeActive");hb.classList.toggle("geTempTreeNested")&&setTimeout(function(){hb.style.visibility="hidden"},550);Fb.classList.toggle("geTempTreeCaret-down")})})(ab,mb)}else Qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",
+Qa.setAttribute("title",ab),mxUtils.write(Qa,ab);null!=M&&(Qa.style.padding=M);Ma.appendChild(Qa)}Na(Ta,Ka);null==ib&&Ka.click()}D(!1)}var m=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);p=null!=p?p:!0;u=null!=u?u:!1;A=null!=A?A:"light-dark(#ebf2f9, "+Editor.darkColor+")";L=null!=L?L:EditorUi.templateFile;var x=!1,C=document.createElement("div");C.style.userSelect="none";C.style.height="100%";var F=document.createElement("div");F.style.whiteSpace="nowrap";
F.style.height="46px";p&&C.appendChild(F);var G=document.createElement("img");G.setAttribute("border","0");G.setAttribute("align","absmiddle");G.style.width="40px";G.style.height="40px";G.style.marginRight="10px";G.style.paddingBottom="4px";G.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_M365?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH+
"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";l||m||!p||F.appendChild(G);p&&mxUtils.write(F,(m?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var K=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?K=b.drive.extension:b.mode==
App.MODE_DROPBOX&&null!=b.dropbox?K=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?K=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?K=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?K=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(K=b.trello.extension);var Q=document.createElement("input");Q.setAttribute("value",b.defaultFilename+K);Q.style.marginLeft="10px";Q.style.width=l||m?"144px":"244px";this.init=function(){p&&Editor.selectFilename(Q);
-null!=la.parentNode&&null!=la.parentNode.parentNode&&mxEvent.addGestureListeners(la.parentNode.parentNode,mxUtils.bind(this,function(Ga){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(p)if(F.appendChild(Q),t)Q.style.width=l||m?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var ba=FilenameDialog.createFileTypes(b,Q,b.editor.diagramFileTypes);ba.style.marginLeft="6px";ba.style.width=l||m?"80px":"180px";F.appendChild(ba)}var T=!1,Z=0,X=new Spinner({lines:12,length:10,width:5,radius:10,
-rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),da=mxUtils.button(n||mxResources.get("create"),function(){da.setAttribute("disabled","disabled");B();da.removeAttribute("disabled")});da.className="geBtn gePrimaryBtn";var R=document.createElement("img");R.setAttribute("src",Editor.magnifyImage);R.setAttribute("title",mxResources.get("preview"));R.className="geButton geRoundButton";var Y=!1,ca=null,P=!1;if(O||c){var aa=[],ea=null,oa=null,ra=
-null,ta=function(Ga){da.setAttribute("disabled","disabled");for(var Pa=0;Pa<aa.length;Pa++)aa[Pa].className=Pa==Ga?"geBtn gePrimaryBtn":"geBtn"};T=!0;var na=document.createElement("div");na.style.whiteSpace="nowrap";na.style.height="30px";C.appendChild(na);var wa=mxUtils.button(mxResources.get("templates"),function(){Ma.style.display="";Fa.style.display="";la.style.left="160px";ta(0);la.scrollTop=0;la.innerText="";Z=0;ea!=cb&&(cb=ea,Za=oa,Cb=ra,Ma.innerText="",d(),ea=null)});aa.push(wa);na.appendChild(wa);
-var ya=function(Ga){Ma.style.display="none";Fa.style.display="none";la.style.left="30px";ta(Ga?-1:1);null==ea&&(ea=cb);la.scrollTop=0;la.innerText="";X.spin(la);var Pa=function(La,Ta,Qa){Z=0;X.stop();cb=La;Qa=Qa||{};var Ra=0,Xa;for(Xa in Qa)Ra+=Qa[Xa].length;if(Ta)la.innerText=Ta;else if(0==La.length&&0==Ra)la.innerText=mxResources.get("noDiagrams");else if(la.innerText="",0<Ra){Ma.style.display="";la.style.left="160px";Ma.innerText="";Cb=0;Za={"draw.io":La};for(Xa in Qa)Za[Xa]=Qa[Xa];d()}else D(!0)};
-Ga?c(ua.value,Pa):O(Pa)};if(O){var Aa=mxUtils.button(mxResources.get("recent"),function(){ya()});na.appendChild(Aa);aa.push(Aa)}if(c){var Ca=document.createElement("span");Ca.style.marginLeft="10px";Ca.innerText=mxResources.get("search")+":";na.appendChild(Ca);var ua=document.createElement("input");ua.style.marginRight="10px";ua.style.marginLeft="10px";ua.style.width="220px";mxEvent.addListener(ua,"keypress",function(Ga){13==Ga.keyCode&&ya(!0)});na.appendChild(ua);var qa=mxUtils.button(mxResources.get("search"),
-function(){ya(!0)});qa.className="geBtn";na.appendChild(qa)}ta(0)}var ha=null,ia=null,pa=null,za=null,fa=null,ka=null,xa=null,Ba=b.lastGenerateXml,ma=b.lastGenerateTitle,la=document.createElement("div");la.style.border="1px solid #d3d3d3";la.style.position="absolute";la.style.left="160px";la.style.right="34px";var Ea=(p?72:40)+(T?30:0);la.style.top=Ea+"px";la.style.bottom="68px";la.style.margin="6px 0 0 -1px";la.style.padding="6px";la.style.overflow="auto";var Fa=document.createElement("div");Fa.style.cssText=
-"position:absolute;left:30px;width:128px;top:"+Ea+"px;height:22px;margin-top: 6px;white-space: nowrap;";var Ia=document.createElement("input");Ia.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";Ia.setAttribute("placeholder",mxResources.get("search"));Ia.setAttribute("type","text");Fa.appendChild(Ia);var Ha=document.createElement("img");Ha.setAttribute("src",Editor.magnifyImage);Ha.setAttribute("title",mxResources.get("search"));
-Ha.className="geAdaptiveAsset";Ha.style.position="relative";Ha.style.cursor="pointer";Ha.style.outline="none";Ha.style.opacity="0.5";Ha.style.height="16px";Ha.style.left="-20px";Ha.style.top="4px";Fa.appendChild(Ha);mxEvent.addListener(Ha,"click",function(){Ha.getAttribute("src")!=Editor.magnifyImage&&(Ha.setAttribute("src",Editor.magnifyImage),Ha.setAttribute("title",mxResources.get("search")),Ia.value="",null!=Wa&&(Wa.click(),Wa=null));Ia.focus()});mxEvent.addListener(Ia,"keydown",mxUtils.bind(this,
-function(Ga){if(13==Ga.keyCode){var Pa=Ia.value;if(""==Pa)null!=Wa&&(Wa.click(),Wa=null);else{if(null==NewDialog.tagsList[L]){var La=Object.create(null);for(xb in Za)if(null==Za[xb].content)for(var Ta=Za[xb],Qa=0;Qa<Ta.length;Qa++){var Ra=Ta[Qa];if(null!=Ra.tags)for(var Xa=Ra.tags.toLowerCase().split(";"),gb=0;gb<Xa.length;gb++)null==La[Xa[gb]]&&(La[Xa[gb]]=[]),La[Xa[gb]].push(Ra)}NewDialog.tagsList[L]=La}var ib=Pa.toLowerCase().split(" ");La=NewDialog.tagsList[L];if(0<Cb&&null==La.__tagsList__){for(xb in Db)for(Ta=
-Db[xb],Qa=0;Qa<Ta.length;Qa++)for(Ra=Ta[Qa],Xa=Ra.title.split(" "),Xa.push(xb),gb=0;gb<Xa.length;gb++){var zb=Xa[gb].toLowerCase();null==La[zb]&&(La[zb]=[]);La[zb].push(Ra)}La.__tagsList__=!0}var xb=[];Ta={};for(Qa=Xa=0;Qa<ib.length;Qa++)if(0<ib[Qa].length){zb=La[ib[Qa]];var Jb={};xb=[];if(null!=zb)for(gb=0;gb<zb.length;gb++)Ra=zb[gb],0==Xa==(null==Ta[Ra.url])&&(Jb[Ra.url]=!0,xb.push(Ra));Ta=Jb;Xa++}la.scrollTop=0;la.innerText="";Z=0;La=document.createElement("div");La.style.padding="6px";La.style.whiteSpace=
-"nowrap";La.style.overflow="hidden";La.style.textOverflow="ellipsis";Ra=mxResources.get(0==xb.length?"noResultsFor":"resultsFor",[Pa]);La.setAttribute("title",Ra);mxUtils.write(La,Ra);la.appendChild(La);null!=eb&&null==Wa&&(eb.style.backgroundColor="",Wa=eb,eb=La);cb=xb;ea=null;D(!1)}mxEvent.consume(Ga)}}));mxEvent.addListener(Ia,"keyup",mxUtils.bind(this,function(Ga){""==Ia.value?(Ha.setAttribute("src",Editor.magnifyImage),Ha.setAttribute("title",mxResources.get("search"))):(Ha.setAttribute("src",
-Editor.crossImage),Ha.setAttribute("title",mxResources.get("reset")))}));Ea+=23;var Ma=document.createElement("div");Ma.style.cssText="position:absolute;left:30px;width:128px;top:"+Ea+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(la,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var bb=140,ab=bb,tb=null,yb=null!=b.lastGenerateBackground?b.lastGenerateBackground:"url("+Editor.thinSparklesImage+")",jb=document.createElement("div");jb.className=
-"geGenerateDiagramForm";jb.style.position="absolute";jb.style.width="100%";jb.style.height="100%";var hb=document.createElement("div");hb.className="geTemplatePreview geAdaptiveAsset";hb.style.backgroundImage=yb;var rb=document.createElement("textarea");rb.setAttribute("placeholder",mxResources.get("describeYourDiagram"));rb.className="geGenerateDiagramDescription";var Sa=document.createElement("button");Sa.className="geBtn gePrimaryBtn geGenerateDiagramButton";Sa.setAttribute("disabled","disabled");
-Sa.setAttribute("title",mxResources.get("ok"));mxUtils.write(Sa,mxResources.get("ok"));var Ua=R.cloneNode(!0);Ua.style.display="none";var vb=!1;mxEvent.addGestureListeners(Ua,function(Ga){vb=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Ga){if(!vb&&null!=Ba){var Pa="<mxfile><diagram>"+Graph.compress(Ba)+"</diagram></mxfile>";H(Pa,mxEvent.getClientX(Ga),mxEvent.getClientY(Ga),tb,ma)}});var kb=R.cloneNode(!0);kb.setAttribute("src",Editor.editImage);kb.setAttribute("title",
-mxResources.get("edit"));kb.style.visibility="hidden";kb.style.left="0px";var qb=R.cloneNode(!0);qb.setAttribute("src",Editor.helpImage);qb.setAttribute("title",mxResources.get("help"));mxEvent.addListener(qb,"click",function(Ga){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Ga)});jb.appendChild(rb);jb.appendChild(Sa);jb.appendChild(qb);jb.style.display="none";mxEvent.addListener(kb,"click",I);mxEvent.addListener(rb,"input",N);var lb=!1;mxEvent.addListener(Sa,
-"click",function(){ja()});mxEvent.addListener(rb,"keydown",function(Ga){13!=Ga.keyCode||mxEvent.isShiftDown(Ga)?27==Ga.keyCode&&(ja(!0),mxEvent.consume(Ga)):(ja(),mxEvent.consume(Ga))});var Za={},Hb={},Db={},Cb=0,fb=!0,eb=null,Wa=null;Za.basic=z?[]:[{title:"blankDiagram"}];var cb=Za.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&EditorUi.isMermaidSupported()&&Za.basic.push({title:"generate",type:"generative"});if(!l){var Gb=function(){mxUtils.get(Eb,function(Ga){if(!wb){wb=
-!0;Ga=Ga.getXml().documentElement.firstChild;for(var Pa={};null!=Ga;){if("undefined"!==typeof Ga.getAttribute)if("parsererror"==Ga.nodeName)null!=window.console&&console.log("Parser error in "+L+": "+Ga.textContent);else if("clibs"==Ga.nodeName){for(var La=Ga.getAttribute("name"),Ta=Ga.getElementsByTagName("add"),Qa=[],Ra=0;Ra<Ta.length;Ra++)Qa.push(encodeURIComponent(mxUtils.getTextContent(Ta[Ra])));null!=La&&0<Qa.length&&(Pa[La]=Qa.join(";"))}else sb({url:Ga.getAttribute("url"),section:Ga.getAttribute("section"),
-subsection:Ga.getAttribute("subsection"),libs:Ga.getAttribute("libs"),clibs:Ga.getAttribute("clibs"),title:Ga.getAttribute("title"),name:Ga.getAttribute("name"),preview:Ga.getAttribute("preview"),tags:Ga.getAttribute("tags")},Pa);Ga=Ga.nextSibling}if(Array.isArray(EditorUi.customTemplates))for(Ra=0;Ra<EditorUi.customTemplates.length;Ra++)null!=EditorUi.customTemplates[Ra]&&sb(EditorUi.customTemplates[Ra],Pa);X.stop();d()}})},sb=function(Ga,Pa){var La=Ga.url;if(null!=La){var Ta=Ga.section,Qa=Ga.subsection;
-if(null==Ta){var Ra=La.indexOf("/");Ta=La.substring(0,Ra);if(null==Qa){var Xa=La.indexOf("/",Ra+1);-1<Xa&&(Qa=La.substring(Ra+1,Xa))}}if(null==EditorUi.enabledTemplateSections||0<=mxUtils.indexOf(EditorUi.enabledTemplateSections,Ta))La=Za[Ta],null==La&&(La=[],Za[Ta]=La),Ra=Ga.clibs,null!=Pa[Ra]&&(Ra=Pa[Ra]),Ga={url:Ga.url,libs:Ga.libs,title:Ga.title,tooltip:Ga.name||Ga.url,preview:Ga.preview,clibs:Ra,tags:Ga.tags},La.push(Ga),null!=Qa&&(Pa=Hb[Ta],null==Pa&&(Pa={},Hb[Ta]=Pa),Ta=Pa[Qa],null==Ta&&(Ta=
-[],Pa[Qa]=Ta),Ta.push(Ga))}};C.appendChild(Fa);C.appendChild(Ma);C.appendChild(la);var wb=!1,Eb=L;/^https?:\/\//.test(Eb)&&!b.editor.isCorsEnabledForUrl(Eb)&&(Eb=PROXY_URL+"?url="+encodeURIComponent(Eb));X.spin(la);null!=q?q(function(Ga,Pa){Db=Ga;ra=Cb=Pa;Gb()},Gb):Gb();oa=Za}mxEvent.addListener(Q,"keypress",function(Ga){b.dialog.container.firstChild==C&&13==Ga.keyCode&&B()});var pb=document.createElement("div");pb.style.marginTop=l?"4px":"16px";pb.style.textAlign="right";pb.style.position="absolute";
-pb.style.left="40px";pb.style.bottom="24px";pb.style.right="40px";var Ab=mxUtils.button(mxResources.get("cancel"),function(){null!=y&&y();b.hideDialog(!0)});Ab.className="geBtn";!b.editor.cancelFirst||u&&null==y||pb.appendChild(Ab);if(!(l||"1"==urlParams.embed||u||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Ib=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Ga=new FilenameDialog(b,"",mxResources.get("create"),function(Pa){null!=Pa&&0<Pa.length&&b.editor.loadUrl(b.editor.getProxiedUrl(Pa),
-function(La){pa=La;ha=null;templateRealURl=Pa;b.hideDialog();B()},function(La){b.handleError(La)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Ga.container,300,80,!0,!0);Ga.init()});Ib.className="geBtn";pb.appendChild(Ib)}if(Graph.fileSupport&&k){var Lb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Ga=document.createElement("input");Ga.setAttribute("multiple","multiple");Ga.setAttribute("type","file");mxEvent.addListener(Ga,"change",function(Pa){b.openFiles(Ga.files,
-!0);Ga.value=""});Ga.style.display="none";document.body.appendChild(Ga);b.newDlgFileInputElt=Ga}b.newDlgFileInputElt.click()});Lb.className="geBtn";pb.appendChild(Lb)}pb.appendChild(da);b.editor.cancelFirst||null!=g||u&&null==y||pb.appendChild(Ab);C.appendChild(pb);this.container=C};NewDialog.tagsList=Object.create(null);
+null!=la.parentNode&&null!=la.parentNode.parentNode&&mxEvent.addGestureListeners(la.parentNode.parentNode,mxUtils.bind(this,function(Fa){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(p)if(F.appendChild(Q),t)Q.style.width=l||m?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var ba=FilenameDialog.createFileTypes(b,Q,b.editor.diagramFileTypes);ba.style.marginLeft="6px";ba.style.width=l||m?"80px":"180px";F.appendChild(ba)}var T=!1,Z=0,X=new Spinner({lines:12,length:10,width:5,radius:10,
+rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),da=mxUtils.button(n||mxResources.get("create"),function(){da.setAttribute("disabled","disabled");B();da.removeAttribute("disabled")});da.className="geBtn gePrimaryBtn";var R=document.createElement("img");R.setAttribute("src",Editor.magnifyImage);R.setAttribute("title",mxResources.get("preview"));R.className="geButton geRoundButton";var Y=!1,ca=null,P=!1;if(O||c){var aa=[],ea=null,oa=null,sa=
+null,ta=function(Fa){da.setAttribute("disabled","disabled");for(var Na=0;Na<aa.length;Na++)aa[Na].className=Na==Fa?"geBtn gePrimaryBtn":"geBtn"};T=!0;var na=document.createElement("div");na.style.whiteSpace="nowrap";na.style.height="30px";C.appendChild(na);var wa=mxUtils.button(mxResources.get("templates"),function(){Ma.style.display="";Ga.style.display="";la.style.left="160px";ta(0);la.scrollTop=0;la.innerText="";Z=0;ea!=db&&(db=ea,Za=oa,yb=sa,Ma.innerText="",d(),ea=null)});aa.push(wa);na.appendChild(wa);
+var ya=function(Fa){Ma.style.display="none";Ga.style.display="none";la.style.left="30px";ta(Fa?-1:1);null==ea&&(ea=db);la.scrollTop=0;la.innerText="";X.spin(la);var Na=function(Ka,Ta,Qa){Z=0;X.stop();db=Ka;Qa=Qa||{};var Ra=0,$a;for($a in Qa)Ra+=Qa[$a].length;if(Ta)la.innerText=Ta;else if(0==Ka.length&&0==Ra)la.innerText=mxResources.get("noDiagrams");else if(la.innerText="",0<Ra){Ma.style.display="";la.style.left="160px";Ma.innerText="";yb=0;Za={"draw.io":Ka};for($a in Qa)Za[$a]=Qa[$a];d()}else D(!0)};
+Fa?c(ua.value,Na):O(Na)};if(O){var Aa=mxUtils.button(mxResources.get("recent"),function(){ya()});na.appendChild(Aa);aa.push(Aa)}if(c){var Da=document.createElement("span");Da.style.marginLeft="10px";Da.innerText=mxResources.get("search")+":";na.appendChild(Da);var ua=document.createElement("input");ua.style.marginRight="10px";ua.style.marginLeft="10px";ua.style.width="220px";mxEvent.addListener(ua,"keypress",function(Fa){13==Fa.keyCode&&ya(!0)});na.appendChild(ua);var qa=mxUtils.button(mxResources.get("search"),
+function(){ya(!0)});qa.className="geBtn";na.appendChild(qa)}ta(0)}var ha=null,ia=null,pa=null,za=null,fa=null,ka=null,xa=null,Ba=b.lastGenerateXml,ma=b.lastGenerateTitle,la=document.createElement("div");la.style.border="1px solid #d3d3d3";la.style.position="absolute";la.style.left="160px";la.style.right="34px";var Ea=(p?72:40)+(T?30:0);la.style.top=Ea+"px";la.style.bottom="68px";la.style.margin="6px 0 0 -1px";la.style.padding="6px";la.style.overflow="auto";var Ga=document.createElement("div");Ga.style.cssText=
+"position:absolute;left:30px;width:128px;top:"+Ea+"px;height:22px;margin-top: 6px;white-space: nowrap;";var Ja=document.createElement("input");Ja.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";Ja.setAttribute("placeholder",mxResources.get("search"));Ja.setAttribute("type","text");Ga.appendChild(Ja);var Ha=document.createElement("img");Ha.setAttribute("src",Editor.magnifyImage);Ha.setAttribute("title",mxResources.get("search"));
+Ha.className="geAdaptiveAsset";Ha.style.position="relative";Ha.style.cursor="pointer";Ha.style.outline="none";Ha.style.opacity="0.5";Ha.style.height="16px";Ha.style.left="-20px";Ha.style.top="4px";Ga.appendChild(Ha);mxEvent.addListener(Ha,"click",function(){Ha.getAttribute("src")!=Editor.magnifyImage&&(Ha.setAttribute("src",Editor.magnifyImage),Ha.setAttribute("title",mxResources.get("search")),Ja.value="",null!=Wa&&(Wa.click(),Wa=null));Ja.focus()});mxEvent.addListener(Ja,"keydown",mxUtils.bind(this,
+function(Fa){if(13==Fa.keyCode){var Na=Ja.value;if(""==Na)null!=Wa&&(Wa.click(),Wa=null);else{if(null==NewDialog.tagsList[L]){var Ka=Object.create(null);for(zb in Za)if(null==Za[zb].content)for(var Ta=Za[zb],Qa=0;Qa<Ta.length;Qa++){var Ra=Ta[Qa];if(null!=Ra.tags)for(var $a=Ra.tags.toLowerCase().split(";"),ab=0;ab<$a.length;ab++)null==Ka[$a[ab]]&&(Ka[$a[ab]]=[]),Ka[$a[ab]].push(Ra)}NewDialog.tagsList[L]=Ka}var mb=Na.toLowerCase().split(" ");Ka=NewDialog.tagsList[L];if(0<yb&&null==Ka.__tagsList__){for(zb in Ab)for(Ta=
+Ab[zb],Qa=0;Qa<Ta.length;Qa++)for(Ra=Ta[Qa],$a=Ra.title.split(" "),$a.push(zb),ab=0;ab<$a.length;ab++){var sb=$a[ab].toLowerCase();null==Ka[sb]&&(Ka[sb]=[]);Ka[sb].push(Ra)}Ka.__tagsList__=!0}var zb=[];Ta={};for(Qa=$a=0;Qa<mb.length;Qa++)if(0<mb[Qa].length){sb=Ka[mb[Qa]];var Eb={};zb=[];if(null!=sb)for(ab=0;ab<sb.length;ab++)Ra=sb[ab],0==$a==(null==Ta[Ra.url])&&(Eb[Ra.url]=!0,zb.push(Ra));Ta=Eb;$a++}la.scrollTop=0;la.innerText="";Z=0;Ka=document.createElement("div");Ka.style.padding="6px";Ka.style.whiteSpace=
+"nowrap";Ka.style.overflow="hidden";Ka.style.textOverflow="ellipsis";Ra=mxResources.get(0==zb.length?"noResultsFor":"resultsFor",[Na]);Ka.setAttribute("title",Ra);mxUtils.write(Ka,Ra);la.appendChild(Ka);null!=ib&&null==Wa&&(ib.style.backgroundColor="",Wa=ib,ib=Ka);db=zb;ea=null;D(!1)}mxEvent.consume(Fa)}}));mxEvent.addListener(Ja,"keyup",mxUtils.bind(this,function(Fa){""==Ja.value?(Ha.setAttribute("src",Editor.magnifyImage),Ha.setAttribute("title",mxResources.get("search"))):(Ha.setAttribute("src",
+Editor.crossImage),Ha.setAttribute("title",mxResources.get("reset")))}));Ea+=23;var Ma=document.createElement("div");Ma.style.cssText="position:absolute;left:30px;width:128px;top:"+Ea+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(la,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var eb=140,bb=eb,tb=null,Db=null!=b.lastGenerateBackground?b.lastGenerateBackground:"url("+Editor.thinSparklesImage+")",cb=document.createElement("div");cb.className=
+"geGenerateDiagramForm";cb.style.position="absolute";cb.style.width="100%";cb.style.height="100%";var gb=document.createElement("div");gb.className="geTemplatePreview geAdaptiveAsset";gb.style.backgroundImage=Db;var wb=document.createElement("textarea");wb.setAttribute("placeholder",mxResources.get("describeYourDiagram"));wb.className="geGenerateDiagramDescription";var Sa=document.createElement("button");Sa.className="geBtn gePrimaryBtn geGenerateDiagramButton";Sa.setAttribute("disabled","disabled");
+Sa.setAttribute("title",mxResources.get("ok"));mxUtils.write(Sa,mxResources.get("ok"));var Xa=R.cloneNode(!0);Xa.style.display="none";var vb=!1;mxEvent.addGestureListeners(Xa,function(Fa){vb=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Fa){if(!vb&&null!=Ba){var Na="<mxfile><diagram>"+Graph.compress(Ba)+"</diagram></mxfile>";H(Na,mxEvent.getClientX(Fa),mxEvent.getClientY(Fa),tb,ma)}});var pb=R.cloneNode(!0);pb.setAttribute("src",Editor.editImage);pb.setAttribute("title",
+mxResources.get("edit"));pb.style.visibility="hidden";pb.style.left="0px";var jb=R.cloneNode(!0);jb.setAttribute("src",Editor.helpImage);jb.setAttribute("title",mxResources.get("help"));mxEvent.addListener(jb,"click",function(Fa){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Fa)});cb.appendChild(wb);cb.appendChild(Sa);cb.appendChild(jb);cb.style.display="none";mxEvent.addListener(pb,"click",I);mxEvent.addListener(wb,"input",N);var qb=!1;mxEvent.addListener(Sa,
+"click",function(){ja()});mxEvent.addListener(wb,"keydown",function(Fa){13!=Fa.keyCode||mxEvent.isShiftDown(Fa)?27==Fa.keyCode&&(ja(!0),mxEvent.consume(Fa)):(ja(),mxEvent.consume(Fa))});var Za={},Jb={},Ab={},yb=0,fb=!0,ib=null,Wa=null;Za.basic=z?[]:[{title:"blankDiagram"}];var db=Za.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&EditorUi.isMermaidSupported()&&Za.basic.push({title:"generate",type:"generative"});if(!l){var Hb=function(){mxUtils.get(Bb,function(Fa){if(!xb){xb=
+!0;Fa=Fa.getXml().documentElement.firstChild;for(var Na={};null!=Fa;){if("undefined"!==typeof Fa.getAttribute)if("parsererror"==Fa.nodeName)null!=window.console&&console.log("Parser error in "+L+": "+Fa.textContent);else if("clibs"==Fa.nodeName){for(var Ka=Fa.getAttribute("name"),Ta=Fa.getElementsByTagName("add"),Qa=[],Ra=0;Ra<Ta.length;Ra++)Qa.push(encodeURIComponent(mxUtils.getTextContent(Ta[Ra])));null!=Ka&&0<Qa.length&&(Na[Ka]=Qa.join(";"))}else ub({url:Fa.getAttribute("url"),section:Fa.getAttribute("section"),
+subsection:Fa.getAttribute("subsection"),libs:Fa.getAttribute("libs"),clibs:Fa.getAttribute("clibs"),title:Fa.getAttribute("title"),name:Fa.getAttribute("name"),preview:Fa.getAttribute("preview"),tags:Fa.getAttribute("tags")},Na);Fa=Fa.nextSibling}if(Array.isArray(EditorUi.customTemplates))for(Ra=0;Ra<EditorUi.customTemplates.length;Ra++)null!=EditorUi.customTemplates[Ra]&&ub(EditorUi.customTemplates[Ra],Na);X.stop();d()}})},ub=function(Fa,Na){var Ka=Fa.url;if(null!=Ka){var Ta=Fa.section,Qa=Fa.subsection;
+if(null==Ta){var Ra=Ka.indexOf("/");Ta=Ka.substring(0,Ra);if(null==Qa){var $a=Ka.indexOf("/",Ra+1);-1<$a&&(Qa=Ka.substring(Ra+1,$a))}}if(null==EditorUi.enabledTemplateSections||0<=mxUtils.indexOf(EditorUi.enabledTemplateSections,Ta))Ka=Za[Ta],null==Ka&&(Ka=[],Za[Ta]=Ka),Ra=Fa.clibs,null!=Na[Ra]&&(Ra=Na[Ra]),Fa={url:Fa.url,libs:Fa.libs,title:Fa.title,tooltip:Fa.name||Fa.url,preview:Fa.preview,clibs:Ra,tags:Fa.tags},Ka.push(Fa),null!=Qa&&(Na=Jb[Ta],null==Na&&(Na={},Jb[Ta]=Na),Ta=Na[Qa],null==Ta&&(Ta=
+[],Na[Qa]=Ta),Ta.push(Fa))}};C.appendChild(Ga);C.appendChild(Ma);C.appendChild(la);var xb=!1,Bb=L;/^https?:\/\//.test(Bb)&&!b.editor.isCorsEnabledForUrl(Bb)&&(Bb=PROXY_URL+"?url="+encodeURIComponent(Bb));X.spin(la);null!=q?q(function(Fa,Na){Ab=Fa;sa=yb=Na;Hb()},Hb):Hb();oa=Za}mxEvent.addListener(Q,"keypress",function(Fa){b.dialog.container.firstChild==C&&13==Fa.keyCode&&B()});var lb=document.createElement("div");lb.style.marginTop=l?"4px":"16px";lb.style.textAlign="right";lb.style.position="absolute";
+lb.style.left="40px";lb.style.bottom="24px";lb.style.right="40px";var Gb=mxUtils.button(mxResources.get("cancel"),function(){null!=y&&y();b.hideDialog(!0)});Gb.className="geBtn";!b.editor.cancelFirst||u&&null==y||lb.appendChild(Gb);if(!(l||"1"==urlParams.embed||u||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Mb=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Fa=new FilenameDialog(b,"",mxResources.get("create"),function(Na){null!=Na&&0<Na.length&&b.editor.loadUrl(b.editor.getProxiedUrl(Na),
+function(Ka){pa=Ka;ha=null;templateRealURl=Na;b.hideDialog();B()},function(Ka){b.handleError(Ka)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Fa.container,300,80,!0,!0);Fa.init()});Mb.className="geBtn";lb.appendChild(Mb)}if(Graph.fileSupport&&k){var Qb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Fa=document.createElement("input");Fa.setAttribute("multiple","multiple");Fa.setAttribute("type","file");mxEvent.addListener(Fa,"change",function(Na){b.openFiles(Fa.files,
+!0);Fa.value=""});Fa.style.display="none";document.body.appendChild(Fa);b.newDlgFileInputElt=Fa}b.newDlgFileInputElt.click()});Qb.className="geBtn";lb.appendChild(Qb)}lb.appendChild(da);b.editor.cancelFirst||null!=g||u&&null==y||lb.appendChild(Gb);C.appendChild(lb);this.container=C};NewDialog.tagsList=Object.create(null);
var SaveDialog=function(b,l,p,g,u,y,A,E,J,M,L){function O(v,d,m,x,C,F){var G=null;if(v!=App.MODE_DROPBOX&&(null==g||0>mxUtils.indexOf(g,v))&&(null==J||v==J)&&(null==M||0<=mxUtils.indexOf(M,v))){C=null!=C?C:b.getTitleForService(v);var K=0<=mxUtils.indexOf(U,v);if(K||null!=b.getServiceForName(v)){G=document.createElement("option");var Q="";!K&&b.isOffline(v==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(G.setAttribute("disabled","disabled"),Q=" ("+mxResources.get("offline")+")");if("pick"==F)G.innerHTML=
mxUtils.htmlEntities(C)+"&nbsp;&nbsp;&#8211&nbsp;&nbsp;"+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+Q,G.setAttribute("value","pickFolder-"+v),G.setAttribute("title",C+" - "+mxResources.get("pickFolder")+"...");else{K=v+(null!=m?"-"+m:"");var ba=V[K];null!=ba&&null!=ba.option&&ba.option.parentNode.removeChild(ba.option);ba=null;if(null!=d){"/"==d.charAt(d.length-1)&&(d=d.substring(0,d.length-1));"/"==d.charAt(0)&&(d=d.substring(1));ba=d;if(v!=App.MODE_GITHUB&&v==App.MODE_GITLAB){var T=
ba.lastIndexOf("/");0<=T&&(ba=ba.substring(T+1))}40<ba.length&&(ba=ba.substring(0,20)+"..."+ba.substring(ba.length-20))}G.innerHTML=mxUtils.htmlEntities(C)+(null!=ba?"&nbsp;&nbsp;&#8211&nbsp;&nbsp;"+mxUtils.htmlEntities(ba):"")+Q;G.setAttribute("title",C+(null!=d?" ("+d+")":"")+(null!=m&&decodeURIComponent(m)!=d?" ["+m+"]":""));G.setAttribute("value",K);V[K]={option:G,mode:v,path:d,id:m};SaveDialog.lastValue==K&&null==E&&"disabled"==!G.getAttribute("disabled")?x=!0:null==x&&("root"==F?x=null==E&&
@@ -13293,22 +13294,22 @@ var M=document.createElement("h3");mxUtils.write(M,mxResources.get("editLink"));
"checked"),c.defaultChecked=!0):null!=l&&Graph.isPageLink(l)?(O.setAttribute("checked","checked"),O.defaultChecked=!0):(k.setAttribute("value",l),L.setAttribute("checked","checked"),L.defaultChecked=!0);u=document.createElement("div");u.className="geDialogCheckRow";u.appendChild(L);u.appendChild(k);u.appendChild(n);y&&(y=document.createElement("label"),y.style.display="flex",y.style.alignItems="center",y.style.gap="4px",y.style.marginLeft="8px",y.style.whiteSpace="nowrap",y.style.fontSize="13px",
y.appendChild(t),mxUtils.write(y,mxResources.get("openInNewWindow")),u.appendChild(y));M.appendChild(u);y=!1;for(u=0;u<b.pages.length;u++)n=document.createElement("option"),mxUtils.write(n,b.pages[u].getName()||mxResources.get("pageWithNumber",[u+1])),n.setAttribute("value","data:page/id,"+b.pages[u].getId()),l==n.getAttribute("value")&&(n.setAttribute("selected","selected"),y=!0),q.appendChild(n);if(!y&&O.checked){var r=document.createElement("option");mxUtils.write(r,mxResources.get("pageNotFound"));
r.setAttribute("disabled","disabled");r.setAttribute("selected","selected");r.setAttribute("value","pageNotFound");q.appendChild(r);mxEvent.addListener(q,"change",function(){null==r.parentNode||r.selected||r.parentNode.removeChild(r)})}y=document.createElement("div");y.className="geDialogCheckRow";y.style.marginTop="6px";y.appendChild(O);y.appendChild(q);M.appendChild(y);y=document.createElement("div");y.className="geDialogCheckRow";y.style.marginTop="6px";y.appendChild(c);var z=document.createElement("span");
-z.style.cssText="flex:1;min-width:0;font-size:13px;line-height:1.5;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px";var D=mxUtils.button("",function(){c.checked=!0;LinkDialog.editCustomAction(b,f,function(I){f=I;g(I,LinkDialog.selectedDocs,t.checked?A:null)})});D.className="geBtn";(function(){z.textContent="";if(null==f)mxUtils.write(z,mxResources.get("action")),D.textContent=mxResources.get("insert");
-else{D.textContent=mxResources.get("edit");try{var I=JSON.parse(f.substring(17));if("string"==typeof I.title&&""!=I.title.trim())var N=I.title.trim();else{var U=0<(null!=I.actions?I.actions.length:0)?Object.keys(I.actions[0])[0]:"";if("animation"==U&&null!=I.actions[0].animation.steps){var S=I.actions[0].animation.steps.length;N=mxResources.get("effects")+" ("+S+")"}else if(""!=U){var V=null!=CustomActionDialog?CustomActionDialog.SCHEMAS[U]:null;N=mxResources.get(null!=V&&V.labelKey?V.labelKey:U,
-null,null!=V?V.label:U)}else N=mxResources.get("action")}mxUtils.write(z,N)}catch(ja){mxUtils.write(z,"("+mxResources.get("invalid")+")")}}})();y.appendChild(z);D.style.marginLeft="8px";y.appendChild(D);M.appendChild(y)}else k.setAttribute("value",l),u=document.createElement("div"),u.className="geDialogFormRow",u.appendChild(k),u.appendChild(n),M.appendChild(u);J.appendChild(M);var H=mxUtils.button(p,function(){b.hideDialog();g(c.checked?null!=f?f:l:O.checked?"pageNotFound"!==q.value?q.value:l:k.value,
-LinkDialog.selectedDocs,t.checked?A:null)});H.style.verticalAlign="middle";H.className="geBtn gePrimaryBtn";this.init=function(){O.checked?q.focus():(k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(q,"focus",function(){L.removeAttribute("checked");O.setAttribute("checked","checked");O.checked=!0});mxEvent.addListener(k,"focus",function(){O.removeAttribute("checked");L.setAttribute("checked","checked");L.checked=
-!0});if(Graph.fileSupport&&null!=J.parentNode){var I=J.parentNode,N=null;mxEvent.addListener(I,"dragleave",function(U){null!=N&&(N.parentNode.removeChild(N),N=null);U.stopPropagation();U.preventDefault()});mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(U){null==N&&(N=b.highlightElement(I));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(I,"drop",mxUtils.bind(this,function(U){try{null!=N&&(N.parentNode.removeChild(N),N=null),0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")&&
-(k.value=decodeURIComponent(U.dataTransfer.getData("text/uri-list")),L.setAttribute("checked","checked"),L.checked=!0,H.click())}catch(S){b.handleError(S)}U.stopPropagation();U.preventDefault()}),!1)}};p=document.createElement("div");p.style.marginTop="34px";p.style.textAlign="right";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));M=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});M.style.verticalAlign="middle";M.className="geBtn";
-b.editor.cancelFirst&&p.appendChild(M);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(I){if(I.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=I.docs;var N=I.docs[0].url;"application/mxe"==I.docs[0].mimeType||null!=I.docs[0].mimeType&&"application/vnd.jgraph."==I.docs[0].mimeType.substring(0,23)?N="https://app.diagrams.net/#G"+I.docs[0].id:"application/vnd.google-apps.folder"==I.docs[0].mimeType&&(N="https://drive.google.com/#folders/"+I.docs[0].id);k.value=N;k.focus()}else LinkDialog.selectedDocs=
+z.style.cssText="flex:1;min-width:0;font-size:13px;line-height:1.5;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px";var D=mxUtils.button("",function(){c.checked=!0;LinkDialog.editCustomAction(b,f,function(I){f=I;g(I,LinkDialog.selectedDocs,t.checked?A:null)},b.editor.graph.getSelectionCells())});D.className="geBtn";(function(){z.textContent="";if(null==f)mxUtils.write(z,mxResources.get("action")),D.textContent=
+mxResources.get("insert");else{D.textContent=mxResources.get("edit");try{var I=JSON.parse(f.substring(17));if("string"==typeof I.title&&""!=I.title.trim())var N=I.title.trim();else{var U=0<(null!=I.actions?I.actions.length:0)?Object.keys(I.actions[0])[0]:"";if("animation"==U&&null!=I.actions[0].animation.steps){var S=I.actions[0].animation.steps.length;N=mxResources.get("effects")+" ("+S+")"}else if(""!=U){var V=null!=CustomActionDialog?CustomActionDialog.SCHEMAS[U]:null;N=mxResources.get(null!=V&&
+V.labelKey?V.labelKey:U,null,null!=V?V.label:U)}else N=mxResources.get("action")}mxUtils.write(z,N)}catch(ja){mxUtils.write(z,"("+mxResources.get("invalid")+")")}}})();y.appendChild(z);D.style.marginLeft="8px";y.appendChild(D);M.appendChild(y)}else k.setAttribute("value",l),u=document.createElement("div"),u.className="geDialogFormRow",u.appendChild(k),u.appendChild(n),M.appendChild(u);J.appendChild(M);var H=mxUtils.button(p,function(){b.hideDialog();g(c.checked?null!=f?f:l:O.checked?"pageNotFound"!==
+q.value?q.value:l:k.value,LinkDialog.selectedDocs,t.checked?A:null)});H.style.verticalAlign="middle";H.className="geBtn gePrimaryBtn";this.init=function(){O.checked?q.focus():(k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(q,"focus",function(){L.removeAttribute("checked");O.setAttribute("checked","checked");O.checked=!0});mxEvent.addListener(k,"focus",function(){O.removeAttribute("checked");L.setAttribute("checked",
+"checked");L.checked=!0});if(Graph.fileSupport&&null!=J.parentNode){var I=J.parentNode,N=null;mxEvent.addListener(I,"dragleave",function(U){null!=N&&(N.parentNode.removeChild(N),N=null);U.stopPropagation();U.preventDefault()});mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(U){null==N&&(N=b.highlightElement(I));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(I,"drop",mxUtils.bind(this,function(U){try{null!=N&&(N.parentNode.removeChild(N),N=null),0<=mxUtils.indexOf(U.dataTransfer.types,
+"text/uri-list")&&(k.value=decodeURIComponent(U.dataTransfer.getData("text/uri-list")),L.setAttribute("checked","checked"),L.checked=!0,H.click())}catch(S){b.handleError(S)}U.stopPropagation();U.preventDefault()}),!1)}};p=document.createElement("div");p.style.marginTop="34px";p.style.textAlign="right";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));M=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});M.style.verticalAlign="middle";M.className=
+"geBtn";b.editor.cancelFirst&&p.appendChild(M);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(I){if(I.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=I.docs;var N=I.docs[0].url;"application/mxe"==I.docs[0].mimeType||null!=I.docs[0].mimeType&&"application/vnd.jgraph."==I.docs[0].mimeType.substring(0,23)?N="https://app.diagrams.net/#G"+I.docs[0].id:"application/vnd.google-apps.folder"==I.docs[0].mimeType&&(N="https://drive.google.com/#folders/"+I.docs[0].id);k.value=N;k.focus()}else LinkDialog.selectedDocs=
null;k.focus()};var B=document.createElement("select");B.className="geBtn";B.style.position="relative";B.style.top="1px";B.style.maxWidth="120px";var W={};y=document.createElement("option");mxUtils.write(y,mxResources.get("select")+"...");y.value="";B.appendChild(y);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&E("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==
b.linkPicker){var I=b.drive.createLinkPicker();b.linkPicker=I.setCallback(function(N){LinkDialog.filePicked(N)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&E("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(I){k.value=I[0].link;k.focus()}})});null!=b.oneDrive&&E("oneDrive",function(){b.oneDrive.pickFile(function(I,N){null!=N&&null!=N.value&&0<N.value.length&&(k.value=N.value[0].webUrl,k.focus())},
!0)});null!=b.gitHub&&E("github",function(){b.gitHub.pickFile(function(I){if(null!=I){I=I.split("/");var N=I[0],U=I[1],S=I[2];I=I.slice(3,I.length).join("/");k.value="https://github.com/"+N+"/"+U+"/blob/"+S+"/"+I;k.focus()}})});null!=b.gitLab&&E("gitlab",function(){b.gitLab.pickFile(function(I){if(null!=I){I=I.split("/");var N=I[0],U=I[1],S=I[2];I=I.slice(3,I.length).join("/");k.value=DRAWIO_GITLAB_URL+"/"+N+"/"+U+"/blob/"+S+"/"+I;k.focus()}})});1<B.children.length&&(p.appendChild(B),mxEvent.addListener(B,
"change",function(I){null!=W[B.value]&&(W[B.value](),B.value="")}));mxEvent.addListener(k,"keypress",function(I){13==I.keyCode&&H.click()});p.appendChild(H);b.editor.cancelFirst||p.appendChild(M);J.appendChild(p);this.urlInput=k;this.container=J};
-LinkDialog.editCustomAction=function(b,l,p){b.hideDialog();null!=b.actionWindow&&null!=b.actionWindow.window&&b.actionWindow.window.isVisible()?(b.actionWindow.window.setVisible(!0),b.actionWindow.window.activate()):(b.actionWindow=new CustomActionDialog(b,l,p),b.actionWindow.window.addListener("hide",function(){b.actionWindow=null}))};
-var ANIMATION_HELP_URL="https://www.drawio.com/docs/manual/links-tooltips-tags/animations-custom-actions/",SELECTOR_ICONS={arrowDown:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8M4.5 6.5L8 10l3.5-3.5M3 13h10"/></svg>',target:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
-asterisk:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M4 5.5l8 5M4 10.5l8-5"/></svg>'};
-function installCustomActionStyles(){if(!installCustomActionStyles._done){installCustomActionStyles._done=!0;var b=document.createElement("style");b.setAttribute("data-source","customActionDialog");b.textContent='.geSelField{display:inline-flex;align-items:center;gap:6px;font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}.geSelFieldLabel{color:light-dark(var(--secondary-text-color), var(--dark-secondary-text-color));font-weight:500;letter-spacing:0.01em}.geSelChip{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:2px 10px;border-radius:999px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:light-dark(var(--soft-color), var(--dark-card-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font:inherit;font-weight:500;flex:0 0 auto;max-width:100%;white-space:nowrap;user-select:none;transition:background-color .15s,border-color .15s,box-shadow .15s}.geSelChipReadOnly{cursor:default}button.geSelChip,a.geSelChip{cursor:pointer}button.geSelChip:hover,a.geSelChip:hover{background:light-dark(var(--soft-hover-color), var(--dark-soft-hover-color));border-color:light-dark(var(--strong-border-color), var(--dark-strong-border-color))}button.geSelChip:focus-visible{outline:2px solid light-dark(var(--focus-color), var(--dark-focus-color));outline-offset:1px}.geSelChipEmpty{color:light-dark(var(--faint-text-color), var(--dark-faint-text-color));border-style:dashed;background:transparent}.geSelChipAll{background:light-dark(var(--mention-background-color), var(--dark-mention-background-color));border-color:light-dark(#a3c4f8,#2a5aa8);color:light-dark(var(--mention-color), var(--dark-mention-color))}.geSelChipTags{padding:2px 6px;gap:3px}.geSelChipExpandable::after{content:"";display:inline-block;width:5px;height:5px;margin-left:6px;border:solid currentColor;border-width:0 1.4px 1.4px 0;transform:translateY(-2px) rotate(45deg);opacity:.55}.geSelIconBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:6px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--text-color), var(--dark-text-color));cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}.geSelIconBtn:hover{background:light-dark(var(--soft-color), var(--dark-card-color));border-color:light-dark(var(--strong-border-color), var(--dark-strong-border-color));color:light-dark(var(--focus-color), var(--dark-focus-color))}.geSelIconBtn:focus-visible{outline:2px solid light-dark(var(--focus-color), var(--dark-focus-color));outline-offset:1px}.geSelIconBtn:active{background:light-dark(var(--inactive-color), var(--dark-soft-color))}.geSelIconBtnActive{background:light-dark(var(--focus-color), var(--dark-focus-color));border-color:light-dark(var(--focus-color), var(--dark-focus-color));color:#ffffff}.geSelIconBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff);color:#ffffff}.geSelIconBtn svg{display:block}.geTagPicker{position:fixed;z-index:10000;min-width:220px;max-width:300px;background:light-dark(var(--field-color), var(--dark-field-color));border:1px solid light-dark(#d0d0d0,#505050);border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,0.15);font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));opacity:0;transform:scale(0);transition:transform .2s cubic-bezier(0.34,1.56,0.64,1),opacity .1s ease-out}.geTagPickerOpen{opacity:1;transform:scale(1)}.geTagPickerArrow{position:absolute;top:-7px;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid light-dark(var(--field-border-color), var(--dark-field-border-color));pointer-events:none}.geTagPickerArrow::after{content:"";position:absolute;top:1px;left:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid light-dark(var(--field-color), var(--dark-field-color))}.geTagPickerArrowBottom{top:auto;bottom:-7px;border-bottom:none;border-top:7px solid light-dark(var(--field-border-color), var(--dark-field-border-color))}.geTagPickerArrowBottom::after{top:auto;bottom:1px;border-bottom:none;border-top:6px solid light-dark(var(--field-color), var(--dark-field-color))}.geTagPickerHeader{padding:10px 14px 6px;font-weight:600;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-size:12px;letter-spacing:.02em;text-transform:uppercase;opacity:.8}.geTagPickerEmpty{padding:14px 18px;color:light-dark(var(--faint-text-color), var(--dark-faint-text-color));font-style:italic;text-align:center}.geTagPickerFooter{padding:4px;border-top:1px solid light-dark(var(--inactive-color), var(--dark-soft-color))}.geTagPickerModeBar{display:flex;align-items:center;gap:6px;padding:6px 10px 4px}.geTagPickerModeLabel{font-size:11px;font-weight:500;color:light-dark(var(--secondary-text-color), var(--dark-secondary-text-color));margin-right:4px}.geTagPickerModeBtn{padding:2px 10px;border-radius:999px;font:inherit;font-size:11px;font-weight:500;cursor:pointer;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:transparent;color:light-dark(var(--text-color), var(--dark-text-color));transition:background-color .12s,color .12s,border-color .12s}.geTagPickerModeBtn:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geTagPickerModeBtnActive{background:light-dark(var(--focus-color), var(--dark-focus-color));border-color:light-dark(var(--focus-color), var(--dark-focus-color));color:#ffffff}.geTagPickerModeBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff)}.geTagPickerCloud{display:flex;flex-wrap:wrap;gap:6px;padding:8px 10px 12px;max-height:320px;overflow:auto;max-width:320px}.geTagCloudPill{display:inline-block;padding:3px 10px;border-radius:999px;cursor:pointer;font:inherit;font-size:11px;font-weight:500;line-height:1.4;background:light-dark(var(--inactive-color), var(--dark-field-border-color));color:light-dark(var(--text-color), var(--dark-text-color));border:1px solid transparent;white-space:nowrap;transition:background-color .12s,color .12s,border-color .12s}.geTagCloudPill:hover{background:light-dark(#d5d5da,#5a5a5e)}.geTagCloudPillActive{background:light-dark(#d4f0db,#1c4530);color:light-dark(#1f7a3e,#86e0a3);border-color:light-dark(#a8e0b8,#2d6849)}.geTagCloudPillActive:hover{background:light-dark(#c4e8ce,#235c3d)}.geLayerPickerList{display:flex;flex-direction:column;gap:2px;padding:6px 6px 10px;max-height:320px;overflow:auto;min-width:220px}.geLayerPickerRow{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));transition:background-color .1s}.geLayerPickerRow:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geLayerPickerRow input[type="checkbox"]{margin:0;flex:0 0 auto}.geLayerPickerRowLabel{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}option.geDeleteOpt{color:light-dark(#d70015,#ff453a);font-weight:500}.geNoSpin{-moz-appearance:textfield;flex:0 0 60px;width:60px;max-width:60px;box-sizing:border-box}.geNoSpin::-webkit-outer-spin-button,.geNoSpin::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.geActionMenuList{padding:4px;min-width:180px}.geActionMenuItem{display:block;width:100%;padding:6px 12px;background:none;border:0;border-radius:6px;text-align:left;font:inherit;font-size:13px;cursor:pointer;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));transition:background-color .1s}.geActionMenuItem:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geActionMenuItemActive{color:light-dark(var(--focus-color), var(--dark-focus-color));font-weight:600}.geActionMenuItemDanger{color:light-dark(#d70015,#ff453a)}.geActionMenuItemDanger:hover{background:light-dark(#fdf0f0,#3a2020)}.geActionMenuItemDisabled{color:light-dark(#aeaeb2,#636366);cursor:default;pointer-events:none}.geActionMenuSeparator{height:1px;margin:4px 6px;background:light-dark(var(--inactive-color), var(--dark-soft-color))}.geAnimationStepActive{background:light-dark(color-mix(in srgb, var(--focus-color) 10%, transparent), color-mix(in srgb, var(--dark-focus-color) 18%, transparent))}.geAnimationStepSelected{background:light-dark(color-mix(in srgb, var(--focus-color) 6%, transparent), color-mix(in srgb, var(--dark-focus-color) 10%, transparent))}.geAnimationStepActive.geAnimationStepSelected{background:light-dark(color-mix(in srgb, var(--focus-color) 16%, transparent), color-mix(in srgb, var(--dark-focus-color) 28%, transparent))}';document.head.appendChild(b)}}
-function installDialogDocking(b,l){var p=EditorUi.windowed;EditorUi.windowed=!0;try{b.installResizeHandler(l,!0)}finally{EditorUi.windowed=p}}function containDragEvents(b){for(var l="dragstart dragenter dragover dragleave drop dragend".split(" "),p=0;p<l.length;p++)b.addEventListener(l[p],function(g){g.stopPropagation()})}
+LinkDialog.editCustomAction=function(b,l,p,g){b.hideDialog();var u=function(){b.actionWindow=new CustomActionDialog(b,l,p);b.actionWindow.cells=g;b.actionWindow.window.addListener("hide",function(){b.actionWindow=null})},y=b.actionWindow;if(null!=y&&null!=y.window&&y.window.isVisible()){if(LinkDialog.sameCells(y.cells,g)){y.window.setVisible(!0);y.window.activate();return}if(null!=y.requestClose){y.requestClose(u);return}}u()};
+LinkDialog.sameCells=function(b,l){if(null==b||null==l||b.length!=l.length)return!1;for(var p=0;p<b.length;p++)if(b[p]!=l[p])return!1;return!0};
+var ANIMATION_HELP_URL="https://www.drawio.com/docs/manual/links-tooltips-tags/animations-custom-actions/",SELECTOR_ICONS={arrowDown:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8M4.5 6.5L8 10l3.5-3.5M3 13h10"/></svg>',target:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',asterisk:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M4 5.5l8 5M4 10.5l8-5"/></svg>'};
+function installCustomActionStyles(){if(!installCustomActionStyles._done){installCustomActionStyles._done=!0;var b=document.createElement("style");b.setAttribute("data-source","customActionDialog");b.textContent='.geSelField{display:inline-flex;align-items:center;gap:6px;font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}.geSelFieldLabel{color:light-dark(var(--secondary-text-color), var(--dark-secondary-text-color));font-weight:500;letter-spacing:0.01em}.geSelChip{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:2px 10px;border-radius:999px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:light-dark(var(--soft-color), var(--dark-card-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font:inherit;font-weight:500;flex:0 0 auto;max-width:100%;white-space:nowrap;user-select:none;transition:background-color .15s,border-color .15s,box-shadow .15s}.geSelChipReadOnly{cursor:default}button.geSelChip,a.geSelChip{cursor:pointer}button.geSelChip:hover,a.geSelChip:hover{background:light-dark(var(--soft-hover-color), var(--dark-soft-hover-color));border-color:light-dark(var(--strong-border-color), var(--dark-strong-border-color))}button.geSelChip:focus-visible{outline:2px solid light-dark(var(--focus-color), var(--dark-focus-color));outline-offset:1px}.geSelChipEmpty{color:light-dark(var(--faint-text-color), var(--dark-faint-text-color));border-style:dashed;background:transparent}.geSelChipAll{background:light-dark(var(--mention-background-color), var(--dark-mention-background-color));border-color:light-dark(#a3c4f8,#2a5aa8);color:light-dark(var(--mention-color), var(--dark-mention-color))}.geSelChipTags{padding:2px 6px;gap:3px}.geSelChipExpandable::after{content:"";display:inline-block;width:5px;height:5px;margin-left:6px;border:solid currentColor;border-width:0 1.4px 1.4px 0;transform:translateY(-2px) rotate(45deg);opacity:.55}.geSelIconBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:6px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--text-color), var(--dark-text-color));cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}.geSelIconBtn:hover{background:light-dark(var(--soft-color), var(--dark-card-color));border-color:light-dark(var(--strong-border-color), var(--dark-strong-border-color));color:light-dark(var(--focus-color), var(--dark-focus-color))}.geSelIconBtn:focus-visible{outline:2px solid light-dark(var(--focus-color), var(--dark-focus-color));outline-offset:1px}.geSelIconBtn:active{background:light-dark(var(--inactive-color), var(--dark-soft-color))}.geSelIconBtnActive{background:light-dark(var(--focus-color), var(--dark-focus-color));border-color:light-dark(var(--focus-color), var(--dark-focus-color));color:#ffffff}.geSelIconBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff);color:#ffffff}.geSelIconBtn svg{display:block}.geTagPicker{position:fixed;z-index:10000;min-width:220px;max-width:300px;background:light-dark(var(--field-color), var(--dark-field-color));border:1px solid light-dark(#d0d0d0,#505050);border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,0.15);font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));opacity:0;transform:scale(0);transition:transform .2s cubic-bezier(0.34,1.56,0.64,1),opacity .1s ease-out}.geTagPickerOpen{opacity:1;transform:scale(1)}.geTagPickerArrow{position:absolute;top:-7px;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid light-dark(var(--field-border-color), var(--dark-field-border-color));pointer-events:none}.geTagPickerArrow::after{content:"";position:absolute;top:1px;left:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid light-dark(var(--field-color), var(--dark-field-color))}.geTagPickerArrowBottom{top:auto;bottom:-7px;border-bottom:none;border-top:7px solid light-dark(var(--field-border-color), var(--dark-field-border-color))}.geTagPickerArrowBottom::after{top:auto;bottom:1px;border-bottom:none;border-top:6px solid light-dark(var(--field-color), var(--dark-field-color))}.geTagPickerHeader{padding:10px 14px 6px;font-weight:600;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-size:12px;letter-spacing:.02em;text-transform:uppercase;opacity:.8}.geTagPickerEmpty{padding:14px 18px;color:light-dark(var(--faint-text-color), var(--dark-faint-text-color));font-style:italic;text-align:center}.geTagPickerFooter{padding:4px;border-top:1px solid light-dark(var(--inactive-color), var(--dark-soft-color))}.geTagPickerModeBar{display:flex;align-items:center;gap:6px;padding:6px 10px 4px}.geTagPickerModeLabel{font-size:11px;font-weight:500;color:light-dark(var(--secondary-text-color), var(--dark-secondary-text-color));margin-right:4px}.geTagPickerModeBtn{padding:2px 10px;border-radius:999px;font:inherit;font-size:11px;font-weight:500;cursor:pointer;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));background:transparent;color:light-dark(var(--text-color), var(--dark-text-color));transition:background-color .12s,color .12s,border-color .12s}.geTagPickerModeBtn:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geTagPickerModeBtnActive{background:light-dark(var(--focus-color), var(--dark-focus-color));border-color:light-dark(var(--focus-color), var(--dark-focus-color));color:#ffffff}.geTagPickerModeBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff)}.geTagPickerCloud{display:flex;flex-wrap:wrap;gap:6px;padding:8px 10px 12px;max-height:320px;overflow:auto;max-width:320px}.geTagCloudPill{display:inline-block;padding:3px 10px;border-radius:999px;cursor:pointer;font:inherit;font-size:11px;font-weight:500;line-height:1.4;background:light-dark(var(--inactive-color), var(--dark-field-border-color));color:light-dark(var(--text-color), var(--dark-text-color));border:1px solid transparent;white-space:nowrap;transition:background-color .12s,color .12s,border-color .12s}.geTagCloudPill:hover{background:light-dark(#d5d5da,#5a5a5e)}.geTagCloudPillActive{background:light-dark(#d4f0db,#1c4530);color:light-dark(#1f7a3e,#86e0a3);border-color:light-dark(#a8e0b8,#2d6849)}.geTagCloudPillActive:hover{background:light-dark(#c4e8ce,#235c3d)}.geLayerPickerList{display:flex;flex-direction:column;gap:2px;padding:6px 6px 10px;max-height:320px;overflow:auto;min-width:220px}.geLayerPickerRow{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));transition:background-color .1s}.geLayerPickerRow:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geLayerPickerRow input[type="checkbox"]{margin:0;flex:0 0 auto}.geLayerPickerRowLabel{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}option.geDeleteOpt{color:light-dark(#d70015,#ff453a);font-weight:500}.geNoSpin{-moz-appearance:textfield;flex:0 0 60px;width:60px;max-width:60px;box-sizing:border-box}.geNoSpin::-webkit-outer-spin-button,.geNoSpin::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.geActionMenuList{padding:4px;min-width:180px}.geActionMenuItem{display:block;width:100%;padding:6px 12px;background:none;border:0;border-radius:6px;text-align:left;font:inherit;font-size:13px;cursor:pointer;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));transition:background-color .1s}.geActionMenuItem:hover{background:light-dark(var(--soft-hover-color), var(--dark-card-color))}.geActionMenuItemActive{color:light-dark(var(--focus-color), var(--dark-focus-color));font-weight:600}.geActionMenuItemDanger{color:light-dark(#d70015,#ff453a)}.geActionMenuItemDanger:hover{background:light-dark(#fdf0f0,#3a2020)}.geActionMenuItemDisabled{color:light-dark(#aeaeb2,#636366);cursor:default;pointer-events:none}.geActionMenuSeparator{height:1px;margin:4px 6px;background:light-dark(var(--inactive-color), var(--dark-soft-color))}.geAnimationStepActive{background:light-dark(color-mix(in srgb, var(--focus-color) 10%, transparent), color-mix(in srgb, var(--dark-focus-color) 18%, transparent))}.geAnimationStepSelected{background:light-dark(color-mix(in srgb, var(--focus-color) 6%, transparent), color-mix(in srgb, var(--dark-focus-color) 10%, transparent))}.geAnimationStepActive.geAnimationStepSelected{background:light-dark(color-mix(in srgb, var(--focus-color) 16%, transparent), color-mix(in srgb, var(--dark-focus-color) 28%, transparent))}';
+document.head.appendChild(b)}}function installDialogDocking(b,l){var p=EditorUi.windowed;EditorUi.windowed=!0;try{b.installResizeHandler(l,!0)}finally{EditorUi.windowed=p}}function containDragEvents(b){for(var l="dragstart dragenter dragover dragleave drop dragend".split(" "),p=0;p<l.length;p++)b.addEventListener(l[p],function(g){g.stopPropagation()})}
var SelectorChips={create:function(b,l){function p(E,J,M,L,O){for(var c=(Array.isArray(J())?J():[]).slice(),f="function"==typeof b.getAllTags?b.getAllTags():[],k=0;k<c.length;k++)0>f.indexOf(c[k])&&f.push(c[k]);f.sort();J=document.createElement("div");if(0==f.length)f=document.createElement("div"),f.className="geTagPickerEmpty",mxUtils.write(f,mxResources.get("noTagsInDiagram",null,"No tags in this diagram yet.")),J.appendChild(f);else{var n="function"==typeof L?L()||"and":null;if("function"==typeof O){L=
document.createElement("div");L.className="geTagPickerModeBar";k=document.createElement("span");k.className="geTagPickerModeLabel";mxUtils.write(k,mxResources.get("match")+":");L.appendChild(k);var q=document.createElement("button");q.type="button";q.className="geTagPickerModeBtn";mxUtils.write(q,mxResources.get("matchAll"));q.title=mxResources.get("matchAllHint",null,"Match cells that have every selected tag (AND)");var t=document.createElement("button");t.type="button";t.className="geTagPickerModeBtn";
mxUtils.write(t,mxResources.get("matchAny"));t.title=mxResources.get("matchAnyHint",null,"Match cells that have at least one selected tag (OR)");var r=function(){q.classList.toggle("geTagPickerModeBtnActive","and"===n);t.classList.toggle("geTagPickerModeBtnActive","or"===n)};r();q.addEventListener("click",function(I){I.preventDefault();n="and";O("and");r()});t.addEventListener("click",function(I){I.preventDefault();n="or";O("or");r()});L.appendChild(q);L.appendChild(t);J.appendChild(L)}var z=document.createElement("div");
@@ -13324,24 +13325,25 @@ var n=c.offsetWidth;J=c.offsetHeight;var q=k.bottom+6;M=!1;q+J>window.innerHeigh
O,!0);window.addEventListener("resize",L);window.addEventListener("scroll",L,!0);var r={close:L,anchor:E};return y._open=r}function A(E,J){var M=document.createElement("div");M.className="geActionMenuList";for(var L=[],O,c=0;c<J.length;c++)(function(n){if(n.separator){var q=document.createElement("div");q.className="geActionMenuSeparator";M.appendChild(q)}else{var t=document.createElement("button");t.type="button";t.className="geActionMenuItem";n.danger&&t.classList.add("geActionMenuItemDanger");
n.active&&t.classList.add("geActionMenuItemActive");var r=function(){return"function"==typeof n.disabled?!!n.disabled():!!n.disabled};q=function(){var z=r();t.classList.toggle("geActionMenuItemDisabled",z);t.disabled=z};q();L.push(q);mxUtils.write(t,n.label);t.addEventListener("click",function(z){z.preventDefault();r()||(O&&O.close(),n.onClick(E))});M.appendChild(t)}})(J[c]);O=y(E,null,M);var f=function(){for(var n=0;n<L.length;n++)L[n]()};b.getSelectionModel().addListener(mxEvent.CHANGE,f);var k=
O.close;O.close=function(){b.getSelectionModel().removeListener(f);k()};return O}installCustomActionStyles();return{cellListField:function(E,J,M,L){L=L||{};var O=L.singularKey||"cell",c=L.pluralKey||"cells",f=L.singularFallback||"cell",k=L.pluralFallback||"cells",n=L.emptyKey||"select",q=L.emptyFallback||"Select",t=document.createElement("div");t.className="geSelField";if(E){var r=document.createElement("span");r.className="geSelFieldLabel";mxUtils.write(r,E);t.appendChild(r)}var z=document.createElement("button");
-z.type="button";z.className="geSelChip geSelChipExpandable";var D=null,H=function(){var I=J();return Array.isArray(I)&&1==I.length&&"*"===I[0]},B=function(){var I=J();return Array.isArray(I)&&0<I.length},W=function(){var I=J(),N=Array.isArray(I)&&!H()?I.length:0;z.textContent="";z.classList.remove("geSelChipEmpty","geSelChipAll");z.title="";H()?(z.classList.add("geSelChipAll"),mxUtils.write(z,mxResources.get("allCells"))):0==N?(z.classList.add("geSelChipEmpty"),mxUtils.write(z,mxResources.get(n,null,
-q))):(mxUtils.write(z,N+" "+(1==N?mxResources.get(O,null,f):mxResources.get(c,null,k))),z.title=I.join("\n"))};z.addEventListener("click",function(I){I.preventDefault();if(null!=y._open&&y._open.anchor===z)y._open.close();else{I=[];I.push({label:mxResources.get("useSelection"),disabled:function(){return 0==b.getSelectionCount()},onClick:function(){var U=b.getSelectionCells();0!=U.length&&(M(U.map(function(S){return S.id})),W())}});L.allowWildcard&&I.push({label:mxResources.get("allCells"),active:H(),
-onClick:function(){if(H())M(D),D=null;else{var U=J();D=Array.isArray(U)?U.slice():null;M(["*"])}W()}});B()&&(I.push({label:mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"),onClick:function(){for(var U=J(),S=[],V=0;V<U.length;V++){if("*"===U[V]){S=b.model.getDescendants(b.model.getRoot());break}var ja=b.model.getCell(U[V]);null!=ja&&S.push(ja)}0<S.length?b.setSelectionCells(S):b.clearSelection()}}),I.push({separator:!0}),I.push({label:mxResources.get("reset"),danger:!0,onClick:function(){M(null);
-D=null;W()}}));if(Array.isArray(L.extraMenuItems)&&0<L.extraMenuItems.length){0<I.length&&!I[I.length-1].separator&&I.push({separator:!0});for(var N=0;N<L.extraMenuItems.length;N++)I.push(L.extraMenuItems[N])}A(z,I)}});t.appendChild(z);W();return t},tagListField:function(E,J,M,L){L=L||{};var O=document.createElement("div");O.className="geSelField";if(E){var c=document.createElement("span");c.className="geSelFieldLabel";mxUtils.write(c,E);O.appendChild(c)}var f=document.createElement("button");f.type=
-"button";f.className="geSelChip geSelChipExpandable";var k=function(){var n=J(),q=Array.isArray(n)?n.length:0;f.textContent="";f.classList.remove("geSelChipEmpty");f.title="";0==q?(f.classList.add("geSelChipEmpty"),mxUtils.write(f,mxResources.get("tags"))):(mxUtils.write(f,q+" "+(1==q?mxResources.get("tag"):mxResources.get("tags"))),f.title=n.join("\n"))};f.addEventListener("click",function(n){n.preventDefault();null!=y._open&&y._open.anchor===f?y._open.close():p(f,J,function(q){M(q);k()},L.getMode,
-L.setMode)});O.appendChild(f);k();return O},layerListField:function(E,J,M){var L=document.createElement("div");L.className="geSelField";if(E){var O=document.createElement("span");O.className="geSelFieldLabel";mxUtils.write(O,E);L.appendChild(O)}var c=document.createElement("button");c.type="button";c.className="geSelChip geSelChipExpandable";var f=function(){var k=J(),n=Array.isArray(k)?k.length:0;c.textContent="";c.classList.remove("geSelChipEmpty");c.title="";if(0==n)c.classList.add("geSelChipEmpty"),
+z.type="button";z.className="geSelChip geSelChipExpandable";var D=null,H=function(){var I=J();return Array.isArray(I)&&1==I.length&&"*"===I[0]},B=function(){var I=J();return Array.isArray(I)&&0<I.length},W=function(){var I=J(),N=Array.isArray(I)&&!H()?I.length:0,U="function"==typeof L.suffix?L.suffix()||"":"";z.textContent="";z.classList.remove("geSelChipEmpty","geSelChipAll");z.title="";H()?(z.classList.add("geSelChipAll"),mxUtils.write(z,mxResources.get("allCells")+U)):0==N?(z.classList.add("geSelChipEmpty"),
+mxUtils.write(z,mxResources.get(n,null,q)+U)):(mxUtils.write(z,N+" "+(1==N?mxResources.get(O,null,f):mxResources.get(c,null,k))+U),z.title=I.join("\n"))};z.addEventListener("click",function(I){I.preventDefault();if(null!=y._open&&y._open.anchor===z)y._open.close();else{I=[];I.push({label:mxResources.get("useSelection"),disabled:function(){return 0==b.getSelectionCount()},onClick:function(){var U=b.getSelectionCells();0!=U.length&&(M(U.map(function(S){return S.id})),W())}});L.allowWildcard&&I.push({label:mxResources.get("allCells"),
+active:H(),onClick:function(){if(H())M(D),D=null;else{var U=J();D=Array.isArray(U)?U.slice():null;M(["*"])}W()}});B()&&(I.push({label:mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"),onClick:function(){for(var U=J(),S=[],V=0;V<U.length;V++){if("*"===U[V]){S=b.model.getDescendants(b.model.getRoot());break}var ja=b.model.getCell(U[V]);null!=ja&&S.push(ja)}0<S.length?b.setSelectionCells(S):b.clearSelection()}}),I.push({separator:!0}),I.push({label:mxResources.get("reset"),danger:!0,
+onClick:function(){M(null);D=null;W()}}));if(Array.isArray(L.extraMenuItems)&&0<L.extraMenuItems.length){0<I.length&&!I[I.length-1].separator&&I.push({separator:!0});for(var N=0;N<L.extraMenuItems.length;N++)I.push(L.extraMenuItems[N])}A(z,I)}});t.appendChild(z);W();return t},tagListField:function(E,J,M,L){L=L||{};var O=document.createElement("div");O.className="geSelField";if(E){var c=document.createElement("span");c.className="geSelFieldLabel";mxUtils.write(c,E);O.appendChild(c)}var f=document.createElement("button");
+f.type="button";f.className="geSelChip geSelChipExpandable";var k=function(){var n=J(),q=Array.isArray(n)?n.length:0;f.textContent="";f.classList.remove("geSelChipEmpty");f.title="";0==q?(f.classList.add("geSelChipEmpty"),mxUtils.write(f,mxResources.get("tags"))):(mxUtils.write(f,q+" "+(1==q?mxResources.get("tag"):mxResources.get("tags"))),f.title=n.join("\n"))};f.addEventListener("click",function(n){n.preventDefault();null!=y._open&&y._open.anchor===f?y._open.close():p(f,J,function(q){M(q);k()},
+L.getMode,L.setMode)});O.appendChild(f);k();return O},layerListField:function(E,J,M){var L=document.createElement("div");L.className="geSelField";if(E){var O=document.createElement("span");O.className="geSelFieldLabel";mxUtils.write(O,E);L.appendChild(O)}var c=document.createElement("button");c.type="button";c.className="geSelChip geSelChipExpandable";var f=function(){var k=J(),n=Array.isArray(k)?k.length:0;c.textContent="";c.classList.remove("geSelChipEmpty");c.title="";if(0==n)c.classList.add("geSelChipEmpty"),
mxUtils.write(c,mxResources.get("layers"));else{mxUtils.write(c,n+" "+(1==n?mxResources.get("layer"):mxResources.get("layers")));n=[];for(var q=b.getModel(),t=0;t<k.length;t++){var r=q.getCell(k[t]);null!=r?(r=b.convertValueToString(r),n.push(null!=r&&""!==r?r:k[t])):n.push(k[t])}c.title=n.join("\n")}};c.addEventListener("click",function(k){k.preventDefault();null!=y._open&&y._open.anchor===c?y._open.close():u(c,J,function(n){M(n);f()})});L.appendChild(c);f();return L},iconButton:function(E,J,M){var L=
-document.createElement("button");L.type="button";L.title=J;L.className="geSelIconBtn";L.innerHTML=SELECTOR_ICONS[E];L.addEventListener("click",function(O){O.preventDefault();M(O)});return L},openTagPicker:p,openLayerPicker:u,closePopover:function(){null!=y._open&&y._open.close()}}}},CustomActionDialog=function(b,l,p){installCustomActionStyles();var g={steps:[]};if(null!=l&&"data:action/json,"==l.substring(0,17))try{var u=JSON.parse(l.substring(17));if(Array.isArray(u.actions)){l=[];for(var y=0;y<
-u.actions.length;y++){var A=u.actions[y];if(A&&A.animation&&Array.isArray(A.animation.steps))for(var E=0;E<A.animation.steps.length;E++)l.push(A.animation.steps[E]);else l.push(A)}g.steps=l}"string"==typeof u.title&&""!==u.title&&(g.title=u.title)}catch(J){}u=mxSettings.getWindowState("customAction");A=null!=u&&null!=u.w?u.w:700;g=new AnimationDialog(b,null!=u&&null!=u.x?u.x:Math.max(40,(document.body.offsetWidth-A)/2),null!=u&&null!=u.y?u.y:80,A,null!=u&&null!=u.h?u.h:560,{kind:"action",showTitle:!0,
-windowTitleKey:"action",windowTitleFallback:"Action",initial:g,save:function(J){var M={actions:J.steps};J.title&&(M.title=J.title);p("data:action/json,"+JSON.stringify(M))}});b.installWindowPersistence("customAction",g);null!=u&&(b.restoreWindowState("customAction",g),g.window.setVisible(!0));return g};
+document.createElement("button");L.type="button";L.title=J;L.className="geSelIconBtn";L.innerHTML=SELECTOR_ICONS[E];L.addEventListener("click",function(O){O.preventDefault();M(O)});return L},openTagPicker:p,openLayerPicker:u,openPopover:y,openMenuPopover:A,closePopover:function(){null!=y._open&&y._open.close()}}}},CustomActionDialog=function(b,l,p){installCustomActionStyles();var g={steps:[]};if(null!=l&&"data:action/json,"==l.substring(0,17))try{var u=JSON.parse(l.substring(17));if(Array.isArray(u.actions)){l=
+[];for(var y=0;y<u.actions.length;y++){var A=u.actions[y];if(A&&A.animation&&Array.isArray(A.animation.steps))for(var E=0;E<A.animation.steps.length;E++)l.push(A.animation.steps[E]);else l.push(A)}g.steps=l}"string"==typeof u.title&&""!==u.title&&(g.title=u.title)}catch(J){}u=mxSettings.getWindowState("customAction");A=null!=u&&null!=u.w?u.w:700;g=new AnimationDialog(b,null!=u&&null!=u.x?u.x:Math.max(40,(document.body.offsetWidth-A)/2),null!=u&&null!=u.y?u.y:80,A,null!=u&&null!=u.h?u.h:560,{kind:"action",
+showTitle:!0,windowTitleKey:"action",windowTitleFallback:"Action",initial:g,save:function(J){var M={actions:J.steps};J.title&&(M.title=J.title);p("data:action/json,"+JSON.stringify(M))}});b.installWindowPersistence("customAction",g);null!=u&&(b.restoreWindowState("customAction",g),g.window.setVisible(!0));return g};
CustomActionDialog.SCHEMAS={toggle:{label:"Toggle",icon:"⇄",selector:!0,allowLayers:!0},show:{label:"Show",icon:"✓",selector:!0,allowLayers:!0},hide:{label:"Hide",icon:"✗",selector:!0,allowLayers:!0},select:{label:"Select",icon:"☑",selector:!0,allowLayers:!0},scroll:{label:"Scroll To",icon:"↓",selector:!0,allowLayers:!0,fields:[{name:"border",type:"number",placeholder:"0",width:36,label:"",titleKey:"border",title:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},
opacity:{label:"Set Opacity",icon:"◐",selector:!0,allowLayers:!0,fields:[{name:"value",type:"number",min:0,max:1,step:.1,def:"1",width:50,label:"",titleKey:"opacity",title:"Opacity"}]},fadeIn:{label:"Fade In",icon:"↗",selector:!0,allowLayers:!0,fields:[{name:"delay",type:"number",min:0,step:100,width:50,placeholder:"400",label:"ms",titleKey:"duration",title:"Duration (ms)"}]},fadeOut:{label:"Fade Out",icon:"↘",selector:!0,allowLayers:!0,fields:[{name:"delay",type:"number",min:0,step:100,width:50,
placeholder:"400",label:"ms",titleKey:"duration",title:"Duration (ms)"}]},fadeTo:{label:"Fade To",icon:"◐",selector:!0,allowLayers:!0,fields:[{name:"value",type:"number",min:0,max:1,step:.1,def:"0.5",width:50,label:"",titleKey:"opacity",title:"Opacity"},{name:"delay",type:"number",min:0,step:100,width:50,placeholder:"400",label:"ms",titleKey:"duration",title:"Duration (ms)"}]},wipeIn:{label:"Wipe In",icon:"→",selector:!0,allowLayers:!0},wipeOut:{label:"Wipe Out",icon:"←",selector:!0,allowLayers:!0},
popIn:{label:"Pop In",icon:"✨",selector:!0,allowLayers:!0},popOut:{label:"Pop Out",icon:"\ud83d\udca8",selector:!0,allowLayers:!0},highlight:{label:"Highlight",icon:"\ud83c\udf1f",selector:!0,allowLayers:!0,fields:[{name:"color",type:"color",def:"#00FF00",width:36,label:"",title:"Color"},{name:"duration",type:"number",min:0,step:100,width:50,placeholder:"1000",label:"ms",titleKey:"duration",title:"Duration (ms)"},{name:"opacity",type:"number",min:0,max:100,step:10,placeholder:"100",width:50,label:"%",
-titleKey:"opacity",title:"Opacity"}]},style:{label:"Set Style",icon:"\ud83c\udfa8",selector:!0,allowLayers:!0,fields:[{name:"key",type:"text",placeholder:"flowAnimation",width:90,label:"",title:"Key"},{name:"value",type:"text",placeholder:"1",width:50,label:"",title:"Value"}]},toggleStyle:{label:"Toggle Style",icon:"\ud83d\udd00",selector:!0,allowLayers:!0,fields:[{name:"key",type:"text",placeholder:"flowAnimation",width:90,label:"",title:"Key"},{name:"defaultValue",type:"text",placeholder:"0",width:50,
-label:"",title:"Default value"}]},flow:{label:"Flow",icon:"➡",selector:!0,allowLayers:!0,fields:[{name:"start",type:"select",options:[{value:"",label:"(toggle)"},{value:"true",label:"On"},{value:"false",label:"Off"}],label:""}]},wait:{label:"Wait",icon:"⏱",noSelector:!0,primary:{name:"value",type:"number",min:0,step:100,width:60,def:"1000",label:"ms",titleKey:"wait",title:"Wait"}},open:{label:"Open Link",icon:"\ud83d\udd17",noSelector:!0,primary:{name:"value",type:"text",placeholder:"https://… or data:page/id,…",
-label:"",title:"URL"}},viewbox:{label:"View",labelKey:"view",icon:"⊞",selector:!0,allowLayers:!0,fields:[{name:"x",type:"number",placeholder:"x",width:36,label:"",title:"X",staticOnly:!0},{name:"y",type:"number",placeholder:"y",width:36,label:"",title:"Y",staticOnly:!0},{name:"width",type:"number",placeholder:"w",width:36,label:"",titleKey:"width",title:"Width",staticOnly:!0},{name:"height",type:"number",placeholder:"h",width:36,label:"",titleKey:"height",title:"Height",staticOnly:!0},{name:"border",
-type:"number",placeholder:"b",width:36,label:"",titleKey:"border",title:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},tags:{label:"Toggle Tags",icon:"\ud83c\udff7",noSelector:!0,fields:[{name:"toggle",type:"tagList",labelKey:"toggle",label:"Toggle",modeField:"toggleMatch"},{name:"hidden",type:"tagList",labelKey:"hide",label:"Hide",modeField:"hiddenMatch"},{name:"visible",type:"tagList",labelKey:"show",label:"Show",modeField:"visibleMatch"}]}};
+titleKey:"opacity",title:"Opacity"}]},style:{label:"Set Style",icon:"\ud83c\udfa8",selector:!0,allowLayers:!0,fields:[{name:"key",type:"text",placeholder:"flowAnimation",width:90,label:"",title:"Key",styleKey:!0},{name:"value",type:"text",placeholder:"1",width:50,label:"",title:"Value"}]},toggleStyle:{label:"Toggle Style",icon:"\ud83d\udd00",selector:!0,allowLayers:!0,fields:[{name:"key",type:"text",placeholder:"flowAnimation",width:90,label:"",title:"Key",styleKey:!0},{name:"value",type:"text",placeholder:"1",
+width:50,label:"",title:"Value"},{name:"defaultValue",type:"text",placeholder:"0",width:50,label:"",title:"Default value"}]},flow:{label:"Flow",icon:"➡",selector:!0,allowLayers:!0,fields:[{name:"start",type:"select",options:[{value:"",label:"(toggle)"},{value:"true",label:"On"},{value:"false",label:"Off"}],label:""}]},wait:{label:"Wait",icon:"⏱",noSelector:!0,primary:{name:"value",type:"number",min:0,step:100,width:60,def:"1000",label:"ms",titleKey:"wait",title:"Wait"}},open:{label:"Open Link",icon:"\ud83d\udd17",
+noSelector:!0,primary:{name:"value",type:"text",placeholder:"https://… or data:page/id,…",label:"",title:"URL"}},viewbox:{label:"View",labelKey:"view",icon:"⊞",selector:!0,allowLayers:!0,fields:[{name:"x",type:"number",placeholder:"x",width:36,label:"",title:"X",staticOnly:!0},{name:"y",type:"number",placeholder:"y",width:36,label:"",title:"Y",staticOnly:!0},{name:"width",type:"number",placeholder:"w",width:36,label:"",titleKey:"width",title:"Width",staticOnly:!0},{name:"height",type:"number",placeholder:"h",
+width:36,label:"",titleKey:"height",title:"Height",staticOnly:!0},{name:"border",type:"number",placeholder:"b",width:36,label:"",titleKey:"border",title:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},tags:{label:"Toggle Tags",icon:"\ud83c\udff7",noSelector:!0,fields:[{name:"toggle",type:"tagList",labelKey:"toggle",label:"Toggle",modeField:"toggleMatch"},{name:"hidden",type:"tagList",labelKey:"hide",label:"Hide",modeField:"hiddenMatch"},{name:"visible",type:"tagList",
+labelKey:"show",label:"Show",modeField:"visibleMatch"}]}};
var RevisionDialog=function(b,l,p){var g=document.createElement("div"),u=document.createElement("h3");u.style.marginTop="3px";mxUtils.write(u,mxResources.get("revisionHistory"));g.appendChild(u);u=document.createElement("div");u.style.position="absolute";u.style.overflow="auto";u.style.width="170px";u.style.height="378px";g.appendChild(u);var y=document.createElement("div");y.style.position="absolute";y.style.left="200px";y.style.width="470px";y.style.height="376px";y.style.overflow="hidden";y.style.borderWidth=
"1px";y.style.borderStyle="solid";var A=document.createElement("div");A.style.position="absolute";A.style.display="none";A.style.textAlign="center";A.style.padding="8px";A.style.borderRadius="8px";A.style.left="50%";A.style.top="50%";A.style.whiteSpace="nowrap";A.style.transform="translate(-50%, -50%)";A.style.background="inherit";A.style.border="1px solid";y.appendChild(A);mxEvent.disableContextMenu(y);g.appendChild(y);var E=new Graph(y);E.setTooltips(!1);E.setEnabled(!1);E.setPanning(!0);E.panningHandler.ignoreCell=
!0;E.panningHandler.useLeftButtonForPanning=!0;E.minFitScale=null;E.maxFitScale=null;E.centerZoom=!0;var J=0,M=null,L=0,O=E.getGlobalVariable;E.getGlobalVariable=function(Z){return"page"==Z&&null!=M&&null!=M[L]?M[L].getAttribute("name"):"pagenumber"==Z?L+1:"pagecount"==Z?null!=M?M.length:1:O.apply(this,arguments)};E.getLinkForCell=function(){return null};for(var c=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,
@@ -13359,8 +13361,8 @@ b.openLink(b.getUrl(),null,!0))});x.className="geBtn";x.setAttribute("disabled",
"geToolbarContainer";F.style.backgroundColor="transparent";F.style.left="32px";F.style.right="32px";F.style.border="none";F.style.top="442px";var G=null;if(null!=l&&0<l.length){y.style.cursor="move";var K=document.createElement("table");K.style.borderWidth="1px";K.style.borderStyle="solid";K.style.borderCollapse="collapse";K.style.borderSpacing="0px";K.style.width="100%";var Q=document.createElement("tbody"),ba=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(J=mxUtils.indexOf(b.pages,
b.currentPage));for(q=l.length-1;0<=q;q--){var T=function(Z){var X=new Date(Z.modifiedDate),da=null;if(0<=X.getTime()){var R=function(ca){c.stop();A.innerText="";var P=mxUtils.parseXml(ca),aa=b.editor.extractGraphModel(P.documentElement,!0);if(null!=aa){var ea=function(wa){null!=wa&&(wa=oa(Editor.parseDiagramNode(wa)));return wa},oa=function(wa){var ya=wa.getAttribute("background");if(null==ya||""==ya||ya==mxConstants.NONE)ya=E.defaultPageBackgroundColor;y.style.backgroundColor=mxUtils.getLightDarkColor(ya);
(new mxCodec(wa.ownerDocument)).decode(wa,E.getModel());E.maxFitScale=1;E.fit(8);E.center();E.mathEnabled="1"==wa.getAttribute("math");E.setAdaptiveColors(wa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&E.mathEnabled&&Editor.MathJaxRender(E.container);return wa};d.style.display="none";d.innerText="";z=P;D=ca;M=parseSelectFunction=null;L=0;if("mxfile"==aa.nodeName){P=aa.getElementsByTagName("diagram");M=[];for(ca=0;ca<P.length;ca++)M.push(P[ca]);L=Math.min(J,M.length-1);0<M.length&&ea(M[L]);
-if(1<M.length)for(d.removeAttribute("disabled"),d.style.display="",ca=0;ca<M.length;ca++){P=document.createElement("option");P.setAttribute("title",ra+" ("+M[ca].getAttribute("id")+")");P.setAttribute("value",ca);var ra=M[ca].getAttribute("name")||mxResources.get("pageWithNumber",[ca+1]);aa=b.getPageById(M[ca].getAttribute("id"));var ta="";if(null!=aa){var na=new DiagramPage(M[ca]);b.getHashValueForPages([aa])!=b.getHashValueForPages([na])&&(ta=" (M)")}else ta=" (X)";mxUtils.write(P,ra+ta);ca==L&&
-P.setAttribute("selected","selected");d.appendChild(P)}m=function(){try{var wa=parseInt(d.value);L=J=wa;ea(M[wa])}catch(ya){d.value=J,b.handleError(ya)}}}else oa(aa);ra=Z.lastModifyingUserName;null!=ra&&20<ra.length&&(ra=ra.substring(0,20)+"...");V.innerText="";mxUtils.write(V,(null!=ra?ra+" ":"")+X.toLocaleDateString()+" "+X.toLocaleTimeString());V.setAttribute("title",da.getAttribute("title"));H.removeAttribute("disabled");B.removeAttribute("disabled");W.removeAttribute("disabled");I.removeAttribute("disabled");
+if(1<M.length)for(d.removeAttribute("disabled"),d.style.display="",ca=0;ca<M.length;ca++){P=document.createElement("option");P.setAttribute("title",sa+" ("+M[ca].getAttribute("id")+")");P.setAttribute("value",ca);var sa=M[ca].getAttribute("name")||mxResources.get("pageWithNumber",[ca+1]);aa=b.getPageById(M[ca].getAttribute("id"));var ta="";if(null!=aa){var na=new DiagramPage(M[ca]);b.getHashValueForPages([aa])!=b.getHashValueForPages([na])&&(ta=" (M)")}else ta=" (X)";mxUtils.write(P,sa+ta);ca==L&&
+P.setAttribute("selected","selected");d.appendChild(P)}m=function(){try{var wa=parseInt(d.value);L=J=wa;ea(M[wa])}catch(ya){d.value=J,b.handleError(ya)}}}else oa(aa);sa=Z.lastModifyingUserName;null!=sa&&20<sa.length&&(sa=sa.substring(0,20)+"...");V.innerText="";mxUtils.write(V,(null!=sa?sa+" ":"")+X.toLocaleDateString()+" "+X.toLocaleTimeString());V.setAttribute("title",da.getAttribute("title"));H.removeAttribute("disabled");B.removeAttribute("disabled");W.removeAttribute("disabled");I.removeAttribute("disabled");
N.removeAttribute("disabled");null!=f&&f.isRestricted()||(b.editor.graph.isEnabled()&&v.removeAttribute("disabled"),x.removeAttribute("disabled"),C.removeAttribute("disabled"));mxUtils.setOpacity(H,60);mxUtils.setOpacity(B,60);mxUtils.setOpacity(W,60);mxUtils.setOpacity(I,60);mxUtils.setOpacity(N,60)}else d.style.display="none",d.innerText="",V.innerText="",A.innerText="",mxUtils.write(V,mxResources.get("errorLoadingFile")),mxUtils.write(A,mxResources.get("errorLoadingFile"))};da=document.createElement("tr");
da.style.borderBottomWidth="1px";da.style.borderBottomStyle="solid";da.style.fontSize="12px";da.style.cursor="pointer";var Y=document.createElement("td");Y.style.padding="6px";Y.style.whiteSpace="nowrap";Z==l[l.length-1]?mxUtils.write(Y,mxResources.get("current")):X.toDateString()===ba?mxUtils.write(Y,X.toLocaleTimeString()):mxUtils.write(Y,X.toLocaleDateString()+" "+X.toLocaleTimeString());da.appendChild(Y);da.setAttribute("title",X.toLocaleDateString()+" "+X.toLocaleTimeString()+(null!=Z.fileSize?
" "+b.formatFileSize(parseInt(Z.fileSize)):"")+(null!=Z.lastModifyingUserName?" "+Z.lastModifyingUserName:""));mxEvent.addListener(da,"click",function(ca){r!=Z&&(c.stop(),null!=t&&(t.style.backgroundColor=""),r=Z,t=da,t.style.backgroundColor="light-dark(#ebf2f9, #000000)",D=z=null,V.removeAttribute("title"),V.innerText=mxResources.get("loading")+"...",y.style.backgroundColor=E.defaultPageBackgroundColor,A.innerText="",E.getModel().clear(),v.setAttribute("disabled","disabled"),H.setAttribute("disabled",
@@ -13414,22 +13416,22 @@ mxResources.get("delete"));za.style.width="13px";za.style.flexShrink="0";za.styl
function(){I(ha)}):ha!=D&&B(ha);mxEvent.consume(fa)});W(ha,null);t.insertBefore(ia,t.firstChild);z.splice(0,0,ha);return ha}function A(){var ha=document.createElement("div");ha.style.textAlign="left";ha.style.padding="6px";ha.style.margin="6px 0";return ha}function E(ha){var ia=document.createElement("div");ia.style.whiteSpace="pre-wrap";ia.style.overflow="auto";ia.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(ha,!1).replace(/\n*^##### (.+)$\n*/gm,"<h5>$1</h5>").replace(/\n*^#### (.+)$\n*/gm,
"<h4>$1</h4>").replace(/\n*^### (.+)$\n*/gm,"<h3>$1</h3>").replace(/\n*^## (.+)$\n*/gm,"<h2>$1</h2>").replace(/\n*^# (.+)$\n*/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>"));return ia}function J(ha,ia){var pa=mxResources.get("error")+": ",za=document.createElement("div");za.style.whiteSpace="pre-wrap";ha=null!=ha&&null!=ha.message?ha.message:"string"===typeof ha?ha:mxResources.get("unknownError");"string"!==
typeof ha&&(ha=String(ha));ha.substring(0,pa.length)!=pa&&(ha=pa+ha);mxUtils.write(za,ha);if(null!=ia){pa=za.appendChild;ha=document.createElement("div");ha.style.display="flex";var fa=document.createElement("img");fa.className="geAdaptiveAsset geLibraryButton";fa.setAttribute("src",Editor.refreshImage);fa.setAttribute("title",mxResources.get("retry"));ha.appendChild(fa);mxEvent.addListener(fa,"click",ia);pa.call(za,ha)}return za}function M(){null!=ba&&ba();var ha=mxUtils.trim(d.value),ia=K();if(""!=
-ha||"clipboard"==ia.kind&&null!=V)try{var pa=V;V=null;ja();null==D.title&&""!=ha&&W(D,40<ha.length?ha.substring(0,40)+"…":ha);qa(D,ha,pa,ia);d.value="";m();ra()}catch(za){EditorUi.debug("EditorUi.ChatWindow.send","error",za)}}var L=b.editor.graph,O=[];if(0<=mxUtils.indexOf(Editor.aiActions,"create")||0<=mxUtils.indexOf(Editor.aiActions,"update")||0<=mxUtils.indexOf(Editor.aiActions,"assist"))for(var c=0;c<Editor.aiModels.length;c++){var f=Editor.aiModels[c];null!=Editor.aiConfigs[f.config]&&null!=
+ha||"clipboard"==ia.kind&&null!=V)try{var pa=V;V=null;ja();null==D.title&&""!=ha&&W(D,40<ha.length?ha.substring(0,40)+"…":ha);qa(D,ha,pa,ia);d.value="";m();sa()}catch(za){EditorUi.debug("EditorUi.ChatWindow.send","error",za)}}var L=b.editor.graph,O=[];if(0<=mxUtils.indexOf(Editor.aiActions,"create")||0<=mxUtils.indexOf(Editor.aiActions,"update")||0<=mxUtils.indexOf(Editor.aiActions,"assist"))for(var c=0;c<Editor.aiModels.length;c++){var f=Editor.aiModels[c];null!=Editor.aiConfigs[f.config]&&null!=
Editor.aiGlobals[Editor.aiConfigs[f.config].apiKey]&&O.push({id:"model-"+f.name,kind:"model",label:f.name,model:f})}b.isExternalDataComms()&&EditorUi.isMermaidSupported()&&0<=mxUtils.indexOf(Editor.aiActions,"createPublic")&&(0==O.length||1==urlParams.test)&&O.push({id:"public",kind:"public",label:mxResources.get("draw.io")});O.push({id:"clipboard",kind:"clipboard",label:mxResources.get("clipboard")});var k=document.createElement("div");k.style.display="flex";k.style.overflow="hidden";k.style.height=
"100%";k.style.boxSizing="border-box";var n=function(){k.style.colorScheme=null!=Editor.isDarkMode&&Editor.isDarkMode()?"dark":"light"};n();b.addListener("darkModeChanged",n);mxEvent.addGestureListeners(k,function(ha){null!=b.sidebar&&b.sidebar.hideTooltip()},null,null);var q=document.createElement("div");q.style.display="flex";q.style.flexDirection="column";q.style.flexShrink="0";q.style.width="150px";q.style.boxSizing="border-box";q.style.padding="8px 6px 20px 6px";q.style.borderRight="1px solid light-dark(#e5e5e5, #505050)";
q.style.overflow="hidden";k.appendChild(q);var t=document.createElement("div");t.style.flexGrow="1";t.style.overflow="auto";t.style.marginTop="6px";f=document.createElement("div");f.style.display="flex";f.style.flexDirection="column";f.style.flexGrow="1";f.style.minWidth="0";f.style.boxSizing="border-box";f.style.padding="10px 12px 20px 12px";k.appendChild(f);var r=document.createElement("div");r.style.flexGrow="1";r.style.overflow="auto";r.style.fontSize="12px";r.style.marginRight="-8px";r.style.paddingRight=
"8px";f.appendChild(r);mxEvent.addListener(r,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var z=[],D=null,H=function(){for(var ha=0;ha<z.length;ha++){var ia=z[ha];ia.active=ia==D;ia.item.style.backgroundColor=ia.active?"light-dark(var(--highlight-color), var(--dark-soft-color))":"transparent";ia.del.style.display=null!=ia.el.firstChild?"":"none"}},B=function(ha){D=ha;for(var ia=z.length-1;0<=ia;ia--)z[ia]!=ha&&null==z[ia].el.firstChild&&I(z[ia]);r.innerHTML="";r.appendChild(ha.el);
-r.scrollTop=r.scrollHeight;H();ra();d.focus()},W=function(ha,ia){ha.title=ia;ha.label.innerHTML="";mxUtils.write(ha.label,null!=ia?ia:mxResources.get("describeYourDiagram"));ha.label.style.fontStyle=null!=ia?"":"italic";ha.item.setAttribute("title",null!=ia?ia:mxResources.get("describeYourDiagram"))},I=function(ha){var ia=mxUtils.indexOf(z,ha);0<=ia&&z.splice(ia,1);null!=ha.item.parentNode&&ha.item.parentNode.removeChild(ha.item);ha==D&&(0<z.length?B(z[Math.min(ia,z.length-1)]):B(y()))},N=document.createElement("a");
+r.scrollTop=r.scrollHeight;H();sa();d.focus()},W=function(ha,ia){ha.title=ia;ha.label.innerHTML="";mxUtils.write(ha.label,null!=ia?ia:mxResources.get("describeYourDiagram"));ha.label.style.fontStyle=null!=ia?"":"italic";ha.item.setAttribute("title",null!=ia?ia:mxResources.get("describeYourDiagram"))},I=function(ha){var ia=mxUtils.indexOf(z,ha);0<=ia&&z.splice(ia,1);null!=ha.item.parentNode&&ha.item.parentNode.removeChild(ha.item);ha==D&&(0<z.length?B(z[Math.min(ia,z.length-1)]):B(y()))},N=document.createElement("a");
N.style.display="flex";N.style.alignItems="center";N.style.gap="5px";N.style.flexShrink="0";N.style.padding="5px 6px";N.style.borderRadius="8px";N.style.fontSize="11px";N.style.fontWeight="bold";N.style.cursor="pointer";N.style.overflow="hidden";N.style.whiteSpace="nowrap";var U=document.createElement("img");U.className="geAdaptiveAsset";U.setAttribute("src",Editor.plusImage);U.style.width="13px";U.style.flexShrink="0";N.appendChild(U);U=document.createElement("span");U.style.overflow="hidden";U.style.textOverflow=
"ellipsis";mxUtils.write(U,mxResources.get("newChat"));N.appendChild(U);mxEvent.addListener(N,"mouseenter",function(){N.style.backgroundColor="light-dark(#ececec, #333333)"});mxEvent.addListener(N,"mouseleave",function(){N.style.backgroundColor="transparent"});mxEvent.addListener(N,"click",function(){null==D||null!=D.el.firstChild?B(y()):d.focus()});q.appendChild(N);q.appendChild(t);q=document.createElement("div");q.style.borderRadius="12px";q.style.backgroundColor="light-dark(var(--highlight-color), var(--dark-soft-color))";
q.style.padding="8px 10px";q.style.marginTop="8px";q.style.flexShrink="0";var S=document.createElement("div");S.style.display="none";S.style.flexWrap="wrap";S.style.gap="4px";S.style.marginBottom="6px";q.appendChild(S);var V=null,ja=function(){S.innerHTML="";if(null!=V){var ha=document.createElement("div");ha.style.display="flex";ha.style.alignItems="center";ha.style.gap="5px";ha.style.fontSize="11px";ha.style.padding="2px 8px";ha.style.borderRadius="10px";ha.style.backgroundColor="light-dark(#cfcfcf, #4a4a4a)";
-mxUtils.write(ha,V.label);var ia=document.createElement("img");ia.className="geAdaptiveAsset";ia.setAttribute("src",Editor.closeImage);ia.setAttribute("title",mxResources.get("remove"));ia.style.width="10px";ia.style.cursor="pointer";ia.style.opacity="0.6";ha.appendChild(ia);mxEvent.addListener(ia,"click",function(pa){V=null;ja();mxEvent.consume(pa)});S.appendChild(ha);S.style.display="flex"}else S.style.display="none";ra()},v=function(ha){try{var ia={kind:ha,page:b.currentPage};if("file"==ha)ia.label=
+mxUtils.write(ha,V.label);var ia=document.createElement("img");ia.className="geAdaptiveAsset";ia.setAttribute("src",Editor.closeImage);ia.setAttribute("title",mxResources.get("remove"));ia.style.width="10px";ia.style.cursor="pointer";ia.style.opacity="0.6";ha.appendChild(ia);mxEvent.addListener(ia,"click",function(pa){V=null;ja();mxEvent.consume(pa)});S.appendChild(ha);S.style.display="flex"}else S.style.display="none";sa()},v=function(ha){try{var ia={kind:ha,page:b.currentPage};if("file"==ha)ia.label=
mxResources.get("file"),ia.data=b.getFileData(!0,null,null,null,!0,!1,null,null,null,!0);else{var pa=new mxCodec(mxUtils.createXmlDocument());"selection"==ha?(ia.label=mxResources.get("selection"),pa.isObjectIgnored=function(fa){return fa.constructor==mxCell&&!L.model.isRoot(fa)&&!L.model.isLayer(fa)&&!L.isCellSelected(fa)&&!L.isAncestorSelected(fa)}):ia.label=mxResources.get("page");var za=pa.encode(L.getModel());za.ownerDocument.appendChild(za);ia.xmlNode=za;ia.data=mxUtils.getXml(za)}V=ia;ja();
d.focus()}catch(fa){b.handleError(fa)}},d=document.createElement("textarea");d.setAttribute("rows","1");d.setAttribute("placeholder",mxResources.get("describeYourDiagram"));d.style.width="100%";d.style.outline="none";d.style.border="none";d.style.resize="none";d.style.background="transparent";d.style.fontFamily="inherit";d.style.fontSize="12px";d.style.padding="4px 2px";d.style.margin="0";d.style.boxSizing="border-box";d.style.maxHeight="92px";d.style.overflow="auto";q.appendChild(d);var m=function(){d.style.height=
-"auto";d.style.height=Math.min(92,d.scrollHeight)+"px"};mxEvent.addListener(d,"input",function(){m();ra()});U=document.createElement("div");U.style.display="flex";U.style.alignItems="center";U.style.gap="6px";U.style.marginTop="2px";q.appendChild(U);var x=document.createElement("img");x.className="geAdaptiveAsset";x.setAttribute("src",Editor.thinAddCircleImage);x.setAttribute("title",mxResources.get("add"));x.style.width="18px";x.style.cursor="pointer";x.style.opacity="0.7";x.style.flexShrink="0";
+"auto";d.style.height=Math.min(92,d.scrollHeight)+"px"};mxEvent.addListener(d,"input",function(){m();sa()});U=document.createElement("div");U.style.display="flex";U.style.alignItems="center";U.style.gap="6px";U.style.marginTop="2px";q.appendChild(U);var x=document.createElement("img");x.className="geAdaptiveAsset";x.setAttribute("src",Editor.thinAddCircleImage);x.setAttribute("title",mxResources.get("add"));x.style.width="18px";x.style.cursor="pointer";x.style.opacity="0.7";x.style.flexShrink="0";
U.appendChild(x);mxEvent.addListener(x,"click",function(ha){var ia=mxUtils.getOffset(x);b.showPopupMenu(function(pa,za){pa.addItem(mxResources.get("file"),null,function(){v("file")},za,null,null!=b.pages&&1<b.pages.length||!b.isDiagramEmpty());pa.addItem(mxResources.get("page"),null,function(){v("page")},za,null,!b.isDiagramEmpty());pa.addItem(mxResources.get("selection"),null,function(){v("selection")},za,null,!L.isSelectionEmpty())},ia.x,ia.y+x.offsetHeight+4,ha)});var C=mxUtils.button(mxResources.get("paste"),
function(){ua(D)});C.className="geBtn";C.setAttribute("title",mxResources.get("pasteResponse"));C.style.margin="0";C.style.fontSize="11px";C.style.minWidth="0";C.style.padding="2px 8px";U.appendChild(C);c=document.createElement("div");c.style.flexGrow="1";U.appendChild(c);var F=document.createElement("select");F.style.borderColor="transparent";F.style.background="light-dark(var(--highlight-color), var(--dark-soft-color))";F.style.textOverflow="ellipsis";F.style.fontSize="11px";F.style.opacity="0.8";
-F.style.maxWidth="60%";F.style.minWidth="0";F.style.padding="2px";for(c=0;c<O.length;c++){var G=document.createElement("option");G.setAttribute("value",O[c].id);mxUtils.write(G,O[c].label);F.appendChild(G)}F.value=O[0].id;U.appendChild(F);var K=function(){for(var ha=0;ha<O.length;ha++)if(O[ha].id==F.value)return O[ha];return O[O.length-1]};c=function(){C.style.display="clipboard"==K().kind?"":"none";ra()};mxEvent.addListener(F,"change",c);var Q=window.SpeechRecognition||window.webkitSpeechRecognition,
+F.style.maxWidth="60%";F.style.minWidth="0";F.style.padding="2px";for(c=0;c<O.length;c++){var G=document.createElement("option");G.setAttribute("value",O[c].id);mxUtils.write(G,O[c].label);F.appendChild(G)}F.value=O[0].id;U.appendChild(F);var K=function(){for(var ha=0;ha<O.length;ha++)if(O[ha].id==F.value)return O[ha];return O[O.length-1]};c=function(){C.style.display="clipboard"==K().kind?"":"none";sa()};mxEvent.addListener(F,"change",c);var Q=window.SpeechRecognition||window.webkitSpeechRecognition,
ba=null;if(null!=Q){var T=document.createElement("img");T.className="geAdaptiveAsset";T.setAttribute("src",Editor.micImage);T.setAttribute("title",mxResources.get("dictate"));T.style.width="18px";T.style.cursor="pointer";T.style.opacity="0.7";T.style.flexShrink="0";T.style.borderRadius="50%";U.appendChild(T);var Z=null;ba=function(){if(null!=Z){var ha=Z;Z=null;try{ha.stop()}catch(ia){}}T.style.backgroundColor="";T.style.opacity="0.7"};mxEvent.addListener(T,"click",function(){if(null!=Z)ba();else try{var ha=
new Q;ha.continuous=!0;ha.interimResults=!0;var ia=d.value;ha.onresult=function(pa){for(var za="",fa=0;fa<pa.results.length;fa++)za+=pa.results[fa][0].transcript;d.value=ia+(""!=ia&&""!=za&&" "!=ia.charAt(ia.length-1)?" ":"")+za;m()};ha.onerror=function(pa){Z==ha&&(ba(),null==pa||"not-allowed"!=pa.error&&"service-not-allowed"!=pa.error||b.alert(mxResources.get("error")+": "+pa.error))};ha.onend=function(){Z==ha&&ba()};Z=ha;T.style.backgroundColor="light-dark(#fbd2d2, #7a3a3a)";T.style.opacity="1";
ha.start()}catch(pa){ba(),b.handleError(pa)}})}var X=function(ha,ia){for(var pa=[],za=0;za<ha.length;za++)pa.push(("assistant"==ha[za].role?"Assistant: ":"User: ")+ha[za].content);return 0<pa.length?"Previous conversation:\n\n"+pa.join("\n\n")+"\n\nRequest: "+ia:ia},da=function(){var ha=mxUtils.trim(d.value)+(null!=V?"\n\nDiagram XML:\n"+V.data:"");return null!=D?X(D.turns,ha).length:ha.length},R=document.createElement("span");R.style.display="none";R.style.alignItems="center";R.style.justifyContent=
@@ -13438,34 +13440,34 @@ document.createElementNS("http://www.w3.org/2000/svg","circle");Y.setAttribute("
"round");ca.setAttribute("pathLength","100");ca.setAttribute("transform","rotate(-90 18 18)");G.appendChild(ca);R.appendChild(G);U.appendChild(R);var P=document.createElement("div");P.style.position="fixed";P.style.display="none";P.style.zIndex="10000";P.style.width="210px";P.style.boxSizing="border-box";P.style.padding="10px 12px";P.style.borderRadius="8px";P.style.fontSize="11px";P.style.lineHeight="1.5";P.style.background="light-dark(#ffffff, #2a2a2a)";P.style.color="light-dark(#000000, #f0f0f0)";
P.style.border="1px solid light-dark(#d0d0d0, #505050)";P.style.boxShadow="0 4px 14px rgba(0, 0, 0, 0.25)";document.body.appendChild(P);var aa=null,ea=function(){var ha=Editor.maxPublicPromptLength,ia=da(),pa=Math.round(ia/ha*100),za=ha-ia;P.innerHTML="";var fa=document.createElement("div");fa.style.fontWeight="bold";fa.style.marginBottom="2px";mxUtils.write(fa,mxResources.get("draw.io"));P.appendChild(fa);fa=document.createElement("div");fa.style.fontVariantNumeric="tabular-nums";mxUtils.write(fa,
ia.toLocaleString()+" / "+ha.toLocaleString()+" ("+pa+"%)");P.appendChild(fa);ha=document.createElement("div");ha.style.color=0>za?"#e53935":"";mxUtils.write(ha,mxResources.get("charactersRemaining",[za.toLocaleString()]));P.appendChild(ha);za=document.createElement("div");za.style.marginTop="6px";za.style.opacity="0.7";mxUtils.write(za,mxResources.get("aiFreeModelHint"));P.appendChild(za)},oa=function(ha){ha=mxEvent.getSource(ha);ha==R||R.contains(ha)||ha==P||P.contains(ha)||aa()};aa=function(){"none"!=
-P.style.display&&(P.style.display="none",mxEvent.removeListener(document,"mousedown",oa))};mxEvent.addListener(R,"click",function(ha){if("none"==P.style.display){ea();P.style.display="block";var ia=R.getBoundingClientRect(),pa=P.getBoundingClientRect();P.style.left=Math.max(8,ia.right-pa.width)+"px";P.style.top=(8>ia.top-pa.height-8?ia.bottom+8:ia.top-pa.height-8)+"px";mxEvent.addListener(document,"mousedown",oa)}else aa();mxEvent.consume(ha)});var ra=function(){var ha=Editor.maxPublicPromptLength;
+P.style.display&&(P.style.display="none",mxEvent.removeListener(document,"mousedown",oa))};mxEvent.addListener(R,"click",function(ha){if("none"==P.style.display){ea();P.style.display="block";var ia=R.getBoundingClientRect(),pa=P.getBoundingClientRect();P.style.left=Math.max(8,ia.right-pa.width)+"px";P.style.top=(8>ia.top-pa.height-8?ia.bottom+8:ia.top-pa.height-8)+"px";mxEvent.addListener(document,"mousedown",oa)}else aa();mxEvent.consume(ha)});var sa=function(){var ha=Editor.maxPublicPromptLength;
if("public"!=K().kind||0>=ha)R.style.display="none",aa();else{var ia=da();if(0==ia)R.style.display="none",aa();else{var pa=ia/ha;ca.setAttribute("stroke-dasharray",100*Math.max(0,Math.min(1,pa))+" 100");ca.setAttribute("stroke",1<pa?"#e53935":.8<=pa?"#f9a825":"#4d90fe");R.setAttribute("title",mxResources.get("charactersRemaining",[(ha-ia).toLocaleString()])+" — "+ia.toLocaleString()+"/"+ha.toLocaleString()+" ("+Math.round(100*pa)+"%)");R.style.display="flex";"none"!=P.style.display&&ea()}}};G=document.createElement("img");
G.setAttribute("src",Editor.sendImage);G.setAttribute("title",mxResources.get("sendMessage"));G.className="geAdaptiveAsset";G.style.cursor="pointer";G.style.opacity="0.6";G.style.height="19px";G.style.flexShrink="0";U.appendChild(G);f.appendChild(q);c();var ta=function(ha){var ia=new mxCodec(mxUtils.createXmlDocument());ia.isObjectIgnored=function(pa){return pa.constructor==mxCell&&!L.model.isRoot(pa)&&!L.model.isLayer(pa)&&!(null!=pa.id&&ha[pa.id])};ia=ia.encode(L.getModel());ia.ownerDocument.appendChild(ia);
-return ia},na=function(ha,ia,pa){var za=null;if(null!=ia&&1<ia.length&&0<ia[1].length)try{if(za=b.stringToCells(ia[1]),0==za.length){var fa=Editor.extractGraphModelFromText(ia[1]);null!=fa&&0<fa[1].length&&fa[1]!=ia[1]&&(za=b.stringToCells(fa[1]))}}catch(Fa){throw Error(Fa.toString()+"\n\n"+ia[1]);}ha.innerHTML="";if(null!=za&&0<za.length){var ka=L.getBoundingBoxFromGeometry(za);b.sidebar.graph.moveCells(za,-ka.x,-ka.y);var xa=null,Ba=function(){var Fa=L.getFreeInsertPoint();Fa=L.importCells(za,Fa.x,
-Fa.y);L.setSelectionCells(Fa);return Fa};fa=function(Fa){null!=b.sidebar&&b.sidebar.hideTooltip();var Ia=null;L.model.beginUpdate();try{Ia=Ba()}finally{L.model.endUpdate()}if(null!=pa.onInsert)pa.onInsert(Ia);null!=L.getSelectionCell()&&L.scrollCellToVisible(L.getSelectionCell());null!=Fa&&mxEvent.consume(Fa)};var ma=null==pa.applyCtx?null:function(Fa){null!=b.sidebar&&b.sidebar.hideTooltip();try{var Ia=pa.applyCtx.page,Ha=null;if(pa.applyCtx.fresh){var Ma=(new mxCodec(mxUtils.createXmlDocument())).encode(L.getModel());
-Ma.ownerDocument.appendChild(Ma);var bb=new mxCodec(Ma.ownerDocument);Ha=new mxGraphModel;bb.decode(Ma,Ha);Ia=b.currentPage}else{if(null==xa){var ab=new mxCodec(pa.applyCtx.xmlNode.ownerDocument);xa=new mxGraphModel;ab.decode(pa.applyCtx.xmlNode,xa)}Ha=xa}Ma=null;L.model.beginUpdate();try{if(null!=Ha&&null!=Ia&&null!=b.getPageIndex(Ia)){b.selectPage(Ia);var tb=mxUtils.parseXml(ia[1]),yb=new mxCodec(tb),jb=new mxGraphModel;yb.decode(tb.documentElement,jb);var hb=b.diffCells(Ha.root,jb.root);b.patchPage(Ia,
-hb,null,!0);EditorUi.debug("EditorUi.ChatWindow.apply","base",Ha,"receivedModel",jb,"patch",hb);if(null!=pa.onApplied)pa.onApplied(tb.documentElement,Ia)}else Ma=Ba()}finally{L.model.endUpdate()}if(null!=Ma&&null!=pa.onInsert)pa.onInsert(Ma);null!=L.getSelectionCell()&&L.scrollCellToVisible(L.getSelectionCell())}catch(rb){b.handleError(rb)}null!=Fa&&mxEvent.consume(Fa)};0<ia[0].length&&ha.appendChild(E(ia[0]));var la=b.getSvgForXml(ia[1]);la.style.overflow="visible";la.style.padding="1px";la.style.cursor=
+return ia},na=function(ha,ia,pa){var za=null;if(null!=ia&&1<ia.length&&0<ia[1].length)try{if(za=b.stringToCells(ia[1]),0==za.length){var fa=Editor.extractGraphModelFromText(ia[1]);null!=fa&&0<fa[1].length&&fa[1]!=ia[1]&&(za=b.stringToCells(fa[1]))}}catch(Ga){throw Error(Ga.toString()+"\n\n"+ia[1]);}ha.innerHTML="";if(null!=za&&0<za.length){var ka=L.getBoundingBoxFromGeometry(za);b.sidebar.graph.moveCells(za,-ka.x,-ka.y);var xa=null,Ba=function(){var Ga=L.getFreeInsertPoint();Ga=L.importCells(za,Ga.x,
+Ga.y);L.setSelectionCells(Ga);return Ga};fa=function(Ga){null!=b.sidebar&&b.sidebar.hideTooltip();var Ja=null;L.model.beginUpdate();try{Ja=Ba()}finally{L.model.endUpdate()}if(null!=pa.onInsert)pa.onInsert(Ja);null!=L.getSelectionCell()&&L.scrollCellToVisible(L.getSelectionCell());null!=Ga&&mxEvent.consume(Ga)};var ma=null==pa.applyCtx?null:function(Ga){null!=b.sidebar&&b.sidebar.hideTooltip();try{var Ja=pa.applyCtx.page,Ha=null;if(pa.applyCtx.fresh){var Ma=(new mxCodec(mxUtils.createXmlDocument())).encode(L.getModel());
+Ma.ownerDocument.appendChild(Ma);var eb=new mxCodec(Ma.ownerDocument);Ha=new mxGraphModel;eb.decode(Ma,Ha);Ja=b.currentPage}else{if(null==xa){var bb=new mxCodec(pa.applyCtx.xmlNode.ownerDocument);xa=new mxGraphModel;bb.decode(pa.applyCtx.xmlNode,xa)}Ha=xa}Ma=null;L.model.beginUpdate();try{if(null!=Ha&&null!=Ja&&null!=b.getPageIndex(Ja)){b.selectPage(Ja);var tb=mxUtils.parseXml(ia[1]),Db=new mxCodec(tb),cb=new mxGraphModel;Db.decode(tb.documentElement,cb);var gb=b.diffCells(Ha.root,cb.root);b.patchPage(Ja,
+gb,null,!0);EditorUi.debug("EditorUi.ChatWindow.apply","base",Ha,"receivedModel",cb,"patch",gb);if(null!=pa.onApplied)pa.onApplied(tb.documentElement,Ja)}else Ma=Ba()}finally{L.model.endUpdate()}if(null!=Ma&&null!=pa.onInsert)pa.onInsert(Ma);null!=L.getSelectionCell()&&L.scrollCellToVisible(L.getSelectionCell())}catch(wb){b.handleError(wb)}null!=Ga&&mxEvent.consume(Ga)};0<ia[0].length&&ha.appendChild(E(ia[0]));var la=b.getSvgForXml(ia[1]);la.style.overflow="visible";la.style.padding="1px";la.style.cursor=
"move";la.style.width="160px";la.style.height="auto";la.style.maxHeight="460px";var Ea=document.createElement("a");Ea.className="geItem";Ea.style.padding="4px";Ea.style.borderRadius="10px";Ea.appendChild(la);ha.appendChild(Ea);b.sidebar.createItem(za,pa.prompt,!0,!0,ka.width,ka.height,!0,!0,null!=ma?ma:fa,null,null,null,null,null,Ea);null!=pa.infoLabel&&Ea.setAttribute("title",pa.infoLabel);pa.partial&&(ka=document.createElement("div"),ka.style.opacity="0.7",ka.style.fontSize="11px",mxUtils.write(ka,
-mxResources.get("partialResponse")),ha.appendChild(ka));ka=document.createElement("div");ka.style.display="flex";la=document.createElement("img");la.className="geAdaptiveAsset geLibraryButton";la.setAttribute("src",Editor.copyImage);la.setAttribute("title",mxResources.get("copy"));ka.appendChild(la);mxEvent.addListener(la,"click",function(){b.writeTextToClipboard(ia[1],function(Fa){b.handleError(Fa)})});"draw.io"==b.getServiceName()&&(la=la.cloneNode(),la.setAttribute("src",Editor.shareImage),la.setAttribute("title",
-mxResources.get(b.isStandaloneApp()?"export":"openInNewWindow")),ka.appendChild(la),mxEvent.addListener(la,"click",function(Fa){b.isStandaloneApp()?b.saveData("export.xml","xml",ia[1],"text/xml"):b.editor.editAsNew(mxUtils.getXml(L.encodeCells(za)))}));la=la.cloneNode();la.setAttribute("src",Editor.magnifyImage);la.setAttribute("title",mxResources.get("preview"));ka.appendChild(la);mxEvent.addListener(la,"click",function(Fa){b.sidebar.createTooltip(ha,za,Math.min((window.innerWidth||document.documentElement.clientWidth||
-document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,1200),pa.prompt,!0,new mxPoint(mxEvent.getClientX(Fa),mxEvent.getClientY(Fa)),!0,null,!0,!1)});la=la.cloneNode();la.setAttribute("src",Editor.plusImage);la.setAttribute("title",mxResources.get("insert"));ka.appendChild(la);mxEvent.addListener(la,"click",fa);null!=ma&&(la=la.cloneNode(),la.setAttribute("src",Editor.checkImage),la.setAttribute("title",mxResources.get("apply")),
+mxResources.get("partialResponse")),ha.appendChild(ka));ka=document.createElement("div");ka.style.display="flex";la=document.createElement("img");la.className="geAdaptiveAsset geLibraryButton";la.setAttribute("src",Editor.copyImage);la.setAttribute("title",mxResources.get("copy"));ka.appendChild(la);mxEvent.addListener(la,"click",function(){b.writeTextToClipboard(ia[1],function(Ga){b.handleError(Ga)})});"draw.io"==b.getServiceName()&&(la=la.cloneNode(),la.setAttribute("src",Editor.shareImage),la.setAttribute("title",
+mxResources.get(b.isStandaloneApp()?"export":"openInNewWindow")),ka.appendChild(la),mxEvent.addListener(la,"click",function(Ga){b.isStandaloneApp()?b.saveData("export.xml","xml",ia[1],"text/xml"):b.editor.editAsNew(mxUtils.getXml(L.encodeCells(za)))}));la=la.cloneNode();la.setAttribute("src",Editor.magnifyImage);la.setAttribute("title",mxResources.get("preview"));ka.appendChild(la);mxEvent.addListener(la,"click",function(Ga){b.sidebar.createTooltip(ha,za,Math.min((window.innerWidth||document.documentElement.clientWidth||
+document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,1200),pa.prompt,!0,new mxPoint(mxEvent.getClientX(Ga),mxEvent.getClientY(Ga)),!0,null,!0,!1)});la=la.cloneNode();la.setAttribute("src",Editor.plusImage);la.setAttribute("title",mxResources.get("insert"));ka.appendChild(la);mxEvent.addListener(la,"click",fa);null!=ma&&(la=la.cloneNode(),la.setAttribute("src",Editor.checkImage),la.setAttribute("title",mxResources.get("apply")),
ka.appendChild(la),mxEvent.addListener(la,"click",ma));ha.appendChild(ka);0<ia[2].length&&ha.appendChild(E(ia[2]))}else null==ia||null!=ia[1]&&0<ia[1].length?(null!=ia&&null!=ia[0]&&0<ia[0].length&&ha.appendChild(E(ia[0])),ha.appendChild(J({message:mxResources.get("errShowingDiag")},pa.retryFn))):(ha.style.whiteSpace="pre-wrap",ha.appendChild(E(ia[0])),null!=ia[2]&&0<ia[2].length&&ha.appendChild(E(ia[2])));ha.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},wa=function(ha,ia,pa,za){var fa=
b.extractMermaidDeclaration(ia);if(null==fa){var ka=Editor.extractGraphModelFromText(ia);if(""==ka[1]&&0<=ia.indexOf("<mxGraphModel")){var xa=Editor.repairTruncatedXml(ia);null!=xa&&(xa=Editor.extractGraphModelFromText(xa),""!=xa[1]&&(pa.partial=!0,ka=xa))}na(ha,ka,pa);null!=pa.recordTurn&&pa.recordTurn(ia)}else b.parseMermaidDiagram(fa,null,function(Ba){try{na(ha,["",mxMermaidToDrawio.wrapGroup(Ba,fa,EditorUi.getInsertMermaidConfig()),""],pa),null!=pa.recordTurn&&pa.recordTurn("```mermaid\n"+fa+
-"\n```\n\nThe same diagram as draw.io XML, use this as the basis for changes:\n\n```xml\n"+Ba+"\n```")}catch(ma){za(ma)}},za)},ya=function(ha,ia,pa){var za=null,fa=null;return{record:function(ka){null!=ia.parentNode&&(null==fa?(za={role:"user",content:pa},fa={role:"assistant",content:ka},ha.turns.push(za,fa)):fa.content=ka,ra())},amend:function(ka){null!=fa&&(fa.content=ka,ra())}}},Aa=function(ha,ia){var pa=new ha.constructor,za;for(za in ha){var fa=ha[za];pa[za]="object"===typeof fa?Aa(fa,ia):"string"===
-typeof fa?Editor.replacePlaceholders(fa,ia):fa}return pa},Ca=function(ha,ia){if(null!=ha&&null!=ia&&0<ia.length)if(Array.isArray(ha.messages)&&0<ha.messages.length){for(var pa=ha.messages[ha.messages.length-1],za=ha.messages.slice(0,ha.messages.length-1),fa=[],ka=0;ka<ia.length;ka++)fa.push({role:ia[ka].role,content:ia[ka].content});ha.messages=za.concat(fa,[pa])}else if(Array.isArray(ha.contents)&&0<ha.contents.length){pa=ha.contents[ha.contents.length-1];pa.role="user";za=ha.contents.slice(0,ha.contents.length-
+"\n```\n\nThe same diagram as draw.io XML, use this as the basis for changes:\n\n```xml\n"+Ba+"\n```")}catch(ma){za(ma)}},za)},ya=function(ha,ia,pa){var za=null,fa=null;return{record:function(ka){null!=ia.parentNode&&(null==fa?(za={role:"user",content:pa},fa={role:"assistant",content:ka},ha.turns.push(za,fa)):fa.content=ka,sa())},amend:function(ka){null!=fa&&(fa.content=ka,sa())}}},Aa=function(ha,ia){var pa=new ha.constructor,za;for(za in ha){var fa=ha[za];pa[za]="object"===typeof fa?Aa(fa,ia):"string"===
+typeof fa?Editor.replacePlaceholders(fa,ia):fa}return pa},Da=function(ha,ia){if(null!=ha&&null!=ia&&0<ia.length)if(Array.isArray(ha.messages)&&0<ha.messages.length){for(var pa=ha.messages[ha.messages.length-1],za=ha.messages.slice(0,ha.messages.length-1),fa=[],ka=0;ka<ia.length;ka++)fa.push({role:ia[ka].role,content:ia[ka].content});ha.messages=za.concat(fa,[pa])}else if(Array.isArray(ha.contents)&&0<ha.contents.length){pa=ha.contents[ha.contents.length-1];pa.role="user";za=ha.contents.slice(0,ha.contents.length-
1);fa=[];for(ka=0;ka<ia.length;ka++)fa.push({role:"assistant"==ia[ka].role?"model":"user",parts:[{text:ia[ka].content}]});ha.contents=za.concat(fa,[pa])}},ua=function(ha){var ia=A();ia.className="geSidebar";ha.el.appendChild(ia);H();var pa=function(za){ia.innerHTML="";ia.appendChild(J(za,null));ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};try{navigator.clipboard.readText().then(function(za){try{wa(ia,mxUtils.trim(za),{prompt:mxResources.get("paste"),applyCtx:{fresh:!0}},pa)}catch(fa){pa(fa)}})["catch"](pa)}catch(za){pa(za)}},
qa=function(ha,ia,pa,za){var fa=A();fa.style.whiteSpace="pre-wrap";fa.style.marginBottom="2px";fa.style.marginLeft="40%";fa.style.borderRadius="10px";fa.style.backgroundColor="light-dark(var(--highlight-color), var(--dark-soft-color))";mxUtils.write(fa,""!=ia?ia:pa.label);ha.el.appendChild(fa);H();if(null!=pa&&""!=ia){var ka=document.createElement("div");ka.style.fontSize="10px";ka.style.opacity="0.7";ka.style.marginTop="4px";mxUtils.write(ka,"+ "+pa.label);fa.appendChild(ka)}""!=ia&&(fa=document.createElement("div"),
fa.className="geInlineButtons",fa.style.display="flex",fa.style.justifyContent="end",ha.el.appendChild(fa),ka=document.createElement("img"),ka.className="geAdaptiveAsset geLibraryButton",ka.setAttribute("src",Editor.copyImage),ka.setAttribute("title",mxResources.get("copy")),fa.appendChild(ka),mxEvent.addListener(ka,"click",function(){b.writeTextToClipboard(ia,function(Sa){b.handleError(Sa)},function(){b.alert(mxResources.get("copiedToClipboard"))})}),ka=ka.cloneNode(),ka.setAttribute("src",Editor.editImage),
ka.setAttribute("title",mxResources.get("edit")),fa.appendChild(ka),mxEvent.addListener(ka,"click",function(){d.value=ia;m();d.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?d.select():document.execCommand("selectAll",!1,null)}));var xa=A();xa.className="geSidebar";xa.style.marginTop="2px";ha.el.appendChild(xa);var Ba=ya(ha,xa,null==pa?ia:(""!=ia?ia+"\n\n":"")+"Diagram XML:\n```xml\n"+pa.data+"\n```"),ma=null;null!=pa?"file"==pa.kind?ha.lastContext=null:(ma={xmlNode:pa.xmlNode,page:pa.page},
-ha.lastContext=ma):ma=ha.lastContext;var la=function(Sa){try{if(null!=Sa&&0!=Sa.length){for(var Ua={},vb=function(lb){null!=lb.id&&(Ua[lb.id]=!0);for(var Za=0;Za<L.model.getChildCount(lb);Za++)vb(L.model.getChildAt(lb,Za))},kb=0;kb<Sa.length;kb++)vb(Sa[kb]);var qb=ta(Ua);ha.lastContext={xmlNode:qb,page:b.currentPage};Ba.amend("The current diagram as draw.io XML (keep these cell ids when modifying it):\n```xml\n"+mxUtils.getXml(qb)+"\n```")}}catch(lb){EditorUi.debug("EditorUi.ChatWindow.onInsert",
-"error",lb)}},Ea=function(Sa,Ua){ha.lastContext={xmlNode:Sa,page:Ua}};fa=ha.turns.slice();var Fa=Date.now(),Ia=null,Ha=function(Sa){xa.innerHTML="";xa.appendChild(J(Sa,Ia));xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",Sa);null!=window.console&&console.error(Sa)},Ma=function(){xa.innerHTML="";var Sa=document.createElement("div");Sa.style.display="flex";Sa.style.alignItems="center";mxUtils.write(Sa,mxResources.get("loading")+
-"...");var Ua=document.createElement("img");Ua.className="geAdaptiveAsset";Ua.setAttribute("src",Editor.svgSpinImage);Ua.style.width="16px";Ua.style.height="16px";Ua.style.marginLeft="6px";Sa.appendChild(Ua);xa.appendChild(Sa);xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};if("model"==za.kind){var bb=za.model,ab=Editor.aiConfigs[bb.config],tb=function(Sa){var Ua=null;"prompt"==Sa?Ua=ia:"data"==Sa&&null!=pa?Ua=pa.data:"model"==Sa?Ua=bb.model:"apiKey"==Sa?Sa=ab.apiKey:"action"==
-Sa&&(Sa=null!=pa?"update":"create");null==Ua&&(Ua=Editor.replacePlaceholders(Editor.aiGlobals[Sa],tb));return Ua},yb=Aa(ab.request,tb);Ca(yb,fa);Ia=function(){Ma();b.createTimeout(b.editor.generateTimeout,function(Sa){var Ua=function(qb){Sa.clear();Ha(qb)},vb=Editor.replacePlaceholders(ab.endpoint,tb),kb=new mxXmlRequest(vb,JSON.stringify(yb),"POST");kb.setRequestHeaders=function(qb,lb){qb.setRequestHeader("Content-Type","application/json");for(var Za in ab.requestHeaders)qb.setRequestHeader(Za,Editor.replacePlaceholders(ab.requestHeaders[Za],
-tb))};EditorUi.debug("EditorUi.ChatWindow.send","url",vb,"params",yb,"aiModel",bb,"config",ab);kb.send(function(qb){if(Sa.clear())try{if(200<=qb.getStatus()&&299>=qb.getStatus()){var lb=JSON.parse(qb.getText()),Za=Editor.executeSimpleJsonPath(lb,ab.responsePath),Hb=mxUtils.trim(0<Za.length?Za[0]:qb.getText()),Db=Date.now()-Fa;EditorUi.debug("EditorUi.ChatWindow.response","params",yb,"response",lb,"text",[Hb],"time",Db);wa(xa,Hb,{prompt:ia,applyCtx:ma,retryFn:Ia,recordTurn:Ba.record,onInsert:la,onApplied:Ea,
-infoLabel:1==urlParams.test?za.label+" ("+Db+" ms)":null},Ua)}else{Za="Error: "+qb.getStatus();try{var Cb=JSON.parse(qb.getText());null!=Cb&&null!=Cb.error&&null!=Cb.error.message&&(Za=Cb.error.message)}catch(fb){}Ha({message:Za})}}catch(fb){Ua(fb)}},Ua)},Ha)};Ia()}else if("public"==za.kind){var jb=X(fa,ia+(null!=pa?"\n\nDiagram XML:\n"+pa.data:""));Ia=function(){var Sa=Editor.maxPublicPromptLength;0<Sa&&jb.length>Sa?(xa.innerHTML="",xa.appendChild(J({message:mxResources.get("promptTooLarge",[Sa])},
-null)),xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):(Ma(),b.generateOpenAiMermaidDiagram(jb,function(Ua,vb){try{var kb=Date.now()-Fa;na(xa,["",Ua,""],{prompt:ia,applyCtx:ma,retryFn:Ia,partial:vb,onInsert:la,onApplied:Ea,infoLabel:1==urlParams.test?za.label+" ("+kb+" ms)":null});Ba.record(Ua)}catch(qb){Ha(qb)}},Ha))};Ia()}else{fa=null;fa=""==ia&&null!=pa?pa.data:Editor.replacePlaceholders(Editor.aiGlobals[null!=pa?"update":"create"],function(Sa){return"data"==Sa&&null!=pa?pa.data:
-null})+"\n\n"+ia;var hb=null,rb=function(){var Sa=mxUtils.button(mxResources.get("pasteResponse"),function(){try{navigator.clipboard.readText().then(function(Ua){try{xa.innerHTML="",wa(xa,mxUtils.trim(Ua),{prompt:""!=ia?ia:pa.label,applyCtx:ma,recordTurn:Ba.record,onInsert:la,onApplied:Ea},hb)}catch(vb){hb(vb)}})["catch"](hb)}catch(Ua){hb(Ua)}});Sa.className="geBtn";Sa.style.margin="6px 0 0 0";xa.appendChild(Sa)};hb=function(Sa){xa.innerHTML="";xa.appendChild(J(Sa,null));rb();xa.scrollIntoView({behavior:"smooth",
-block:"end",inline:"nearest"})};b.writeTextToClipboard(fa,function(Sa){Ha(Sa)},function(){xa.innerHTML="";var Sa=document.createElement("div");mxUtils.write(Sa,mxResources.get("copiedToClipboard"));xa.appendChild(Sa);rb();xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})}};mxEvent.addListener(G,"click",M);mxEvent.addListener(d,"keydown",function(ha){13!=ha.keyCode||mxEvent.isShiftDown(ha)||(M(),mxEvent.consume(ha))});this.generate=mxUtils.bind(this,function(ha){null!=D&&null==
+ha.lastContext=ma):ma=ha.lastContext;var la=function(Sa){try{if(null!=Sa&&0!=Sa.length){for(var Xa={},vb=function(qb){null!=qb.id&&(Xa[qb.id]=!0);for(var Za=0;Za<L.model.getChildCount(qb);Za++)vb(L.model.getChildAt(qb,Za))},pb=0;pb<Sa.length;pb++)vb(Sa[pb]);var jb=ta(Xa);ha.lastContext={xmlNode:jb,page:b.currentPage};Ba.amend("The current diagram as draw.io XML (keep these cell ids when modifying it):\n```xml\n"+mxUtils.getXml(jb)+"\n```")}}catch(qb){EditorUi.debug("EditorUi.ChatWindow.onInsert",
+"error",qb)}},Ea=function(Sa,Xa){ha.lastContext={xmlNode:Sa,page:Xa}};fa=ha.turns.slice();var Ga=Date.now(),Ja=null,Ha=function(Sa){xa.innerHTML="";xa.appendChild(J(Sa,Ja));xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",Sa);null!=window.console&&console.error(Sa)},Ma=function(){xa.innerHTML="";var Sa=document.createElement("div");Sa.style.display="flex";Sa.style.alignItems="center";mxUtils.write(Sa,mxResources.get("loading")+
+"...");var Xa=document.createElement("img");Xa.className="geAdaptiveAsset";Xa.setAttribute("src",Editor.svgSpinImage);Xa.style.width="16px";Xa.style.height="16px";Xa.style.marginLeft="6px";Sa.appendChild(Xa);xa.appendChild(Sa);xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};if("model"==za.kind){var eb=za.model,bb=Editor.aiConfigs[eb.config],tb=function(Sa){var Xa=null;"prompt"==Sa?Xa=ia:"data"==Sa&&null!=pa?Xa=pa.data:"model"==Sa?Xa=eb.model:"apiKey"==Sa?Sa=bb.apiKey:"action"==
+Sa&&(Sa=null!=pa?"update":"create");null==Xa&&(Xa=Editor.replacePlaceholders(Editor.aiGlobals[Sa],tb));return Xa},Db=Aa(bb.request,tb);Da(Db,fa);Ja=function(){Ma();b.createTimeout(b.editor.generateTimeout,function(Sa){var Xa=function(jb){Sa.clear();Ha(jb)},vb=Editor.replacePlaceholders(bb.endpoint,tb),pb=new mxXmlRequest(vb,JSON.stringify(Db),"POST");pb.setRequestHeaders=function(jb,qb){jb.setRequestHeader("Content-Type","application/json");for(var Za in bb.requestHeaders)jb.setRequestHeader(Za,Editor.replacePlaceholders(bb.requestHeaders[Za],
+tb))};EditorUi.debug("EditorUi.ChatWindow.send","url",vb,"params",Db,"aiModel",eb,"config",bb);pb.send(function(jb){if(Sa.clear())try{if(200<=jb.getStatus()&&299>=jb.getStatus()){var qb=JSON.parse(jb.getText()),Za=Editor.executeSimpleJsonPath(qb,bb.responsePath),Jb=mxUtils.trim(0<Za.length?Za[0]:jb.getText()),Ab=Date.now()-Ga;EditorUi.debug("EditorUi.ChatWindow.response","params",Db,"response",qb,"text",[Jb],"time",Ab);wa(xa,Jb,{prompt:ia,applyCtx:ma,retryFn:Ja,recordTurn:Ba.record,onInsert:la,onApplied:Ea,
+infoLabel:1==urlParams.test?za.label+" ("+Ab+" ms)":null},Xa)}else{Za="Error: "+jb.getStatus();try{var yb=JSON.parse(jb.getText());null!=yb&&null!=yb.error&&null!=yb.error.message&&(Za=yb.error.message)}catch(fb){}Ha({message:Za})}}catch(fb){Xa(fb)}},Xa)},Ha)};Ja()}else if("public"==za.kind){var cb=X(fa,ia+(null!=pa?"\n\nDiagram XML:\n"+pa.data:""));Ja=function(){var Sa=Editor.maxPublicPromptLength;0<Sa&&cb.length>Sa?(xa.innerHTML="",xa.appendChild(J({message:mxResources.get("promptTooLarge",[Sa])},
+null)),xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):(Ma(),b.generateOpenAiMermaidDiagram(cb,function(Xa,vb){try{var pb=Date.now()-Ga;na(xa,["",Xa,""],{prompt:ia,applyCtx:ma,retryFn:Ja,partial:vb,onInsert:la,onApplied:Ea,infoLabel:1==urlParams.test?za.label+" ("+pb+" ms)":null});Ba.record(Xa)}catch(jb){Ha(jb)}},Ha))};Ja()}else{fa=null;fa=""==ia&&null!=pa?pa.data:Editor.replacePlaceholders(Editor.aiGlobals[null!=pa?"update":"create"],function(Sa){return"data"==Sa&&null!=pa?pa.data:
+null})+"\n\n"+ia;var gb=null,wb=function(){var Sa=mxUtils.button(mxResources.get("pasteResponse"),function(){try{navigator.clipboard.readText().then(function(Xa){try{xa.innerHTML="",wa(xa,mxUtils.trim(Xa),{prompt:""!=ia?ia:pa.label,applyCtx:ma,recordTurn:Ba.record,onInsert:la,onApplied:Ea},gb)}catch(vb){gb(vb)}})["catch"](gb)}catch(Xa){gb(Xa)}});Sa.className="geBtn";Sa.style.margin="6px 0 0 0";xa.appendChild(Sa)};gb=function(Sa){xa.innerHTML="";xa.appendChild(J(Sa,null));wb();xa.scrollIntoView({behavior:"smooth",
+block:"end",inline:"nearest"})};b.writeTextToClipboard(fa,function(Sa){Ha(Sa)},function(){xa.innerHTML="";var Sa=document.createElement("div");mxUtils.write(Sa,mxResources.get("copiedToClipboard"));xa.appendChild(Sa);wb();xa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})}};mxEvent.addListener(G,"click",M);mxEvent.addListener(d,"keydown",function(ha){13!=ha.keyCode||mxEvent.isShiftDown(ha)||(M(),mxEvent.consume(ha))});this.generate=mxUtils.bind(this,function(ha){null!=D&&null==
D.el.firstChild||B(y());d.value=ha;m();M()});B(y());this.window=new mxWindow(mxResources.get("generate"),k,l,p,g,u,!0,!0);this.window.minimumSize=new mxRectangle(0,0,280,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);b.isOffline()||(l=b.createHelpIcon("https://www.drawio.com/doc/faq/configure-ai-options"),l.style.cursor="help",l.style.opacity="0.5",this.window.buttons.insertBefore(l,this.window.buttons.firstChild));this.window.addListener("show",
mxUtils.bind(this,function(){this.window.fit();d.focus()}));this.window.addListener("hide",function(){aa()});this.window.addListener(mxEvent.DESTROY,function(){aa();b.removeListener(n);null!=P.parentNode&&P.parentNode.removeChild(P)});b.installResizeHandler(this,!0)},TagsWindow=function(b,l,p,g,u){var y=b.editor.graph,A=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)A=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var E=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),
null,function(J,M){if(y.isEnabled()){var L=new FilenameDialog(b,"",mxResources.get("add"),function(O){b.hideDialog();if(null!=O&&0<O.length){O=O.split(" ");for(var c=[],f=[],k=0;k<O.length;k++){var n=mxUtils.trim(O[k]);""!=n&&(f.push(n),0>mxUtils.indexOf(J,n)&&c.push(n))}y.isSelectionEmpty()?M(J.concat(c)):y.addTagsForCells(y.getSelectionCells(),f)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(L.container,320,80,!0,!0);L.init()}},A);A=E.div;this.window=
@@ -13477,62 +13479,70 @@ z.style.margin="0";H.appendChild(z);var B=document.createElement("span"),W=funct
var U=document.createElement("span"),S=function(){U.textContent="";mxUtils.write(U,mxResources.get("disabled",null,"Disabled"))};S();L.push(S);N.appendChild(U);I.appendChild(N);r.appendChild(I)}else{var V=document.createElement("span");r.appendChild(V)}var ja=document.createElement("label");ja.className="geDialogHint";ja.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";var v=document.createElement("input");v.type="checkbox";v.style.margin="0";ja.appendChild(v);var d=document.createElement("span"),
m=function(){d.textContent="";mxUtils.write(d,mxResources.get("editText",null,"Edit Text"))};m();L.push(m);ja.appendChild(d);r.appendChild(ja);c.appendChild(r);var x=document.createElement("div");x.style.cssText="flex:1 1 0;min-height:0;overflow:auto;padding:4px;box-sizing:border-box;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:6px;background:light-dark(var(--field-color), var(--dark-field-color))";containDragEvents(x);c.appendChild(x);var C=
document.createElement("textarea");C.spellcheck=!1;C.style.cssText="display:none;width:100%;flex:1 1 0;min-height:0;resize:none;font-family:monospace;font-size:12px;padding:8px;box-sizing:border-box;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:6px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";c.appendChild(C);var F=document.createElement("div");F.style.cssText=
-"display:none;flex:0 0 auto;margin-top:6px;padding:6px 8px;border-radius:6px;font-size:12px;background:light-dark(#fde7e9,#3a1d1f);color:light-dark(#b3261e,#ffb4ab);border:1px solid light-dark(#f1aeb5,#7a2e2e);white-space:pre-wrap;word-break:break-word";c.appendChild(F);var G=!0,K=function(sa){G=null==sa;F.style.display=null==sa?"none":"block";null!=sa&&(F.textContent=sa)},Q=function(sa,va){va=null!=va&&null!=va.message?va.message:String(va);if(!/line \d+/i.test(va)){var Da=va.match(/at position (\d+)/i);
-null!=Da&&(Da=Math.min(parseInt(Da[1],10),sa.length),sa=sa.substring(0,Da).split("\n"),va+=" (line "+sa.length+" column "+(sa[sa.length-1].length+1)+")")}return mxResources.get("error")+": "+va},ba=function(){try{Editor.parseAnimationData(C.value),K(null)}catch(sa){K(Q(C.value,sa))}},T={steps:[]},Z=E.getModel().getRoot(),X=function(){if("page"==A){var sa=E.getAttributeForCell(Z,"animation");try{T=Editor.parseAnimationData(sa)}catch(va){T=Editor.parseAnimationData(null)}}else sa=y.initial,T=Array.isArray(sa)?
-{steps:JSON.parse(JSON.stringify(sa))}:null!=sa&&"object"==typeof sa?JSON.parse(JSON.stringify(sa)):{steps:[]};null==T.steps&&(T.steps=[]);"page"!=A&&(null!=T.loop&&delete T.loop,null!=T.enabled&&delete T.enabled);C.value=JSON.stringify(T,null,2);null!=f&&(f.value=T.title||"");null!=z&&(z.checked=null==T.loop?!0:!!T.loop);null!=D&&(D.checked=null==T.enabled?!1:!T.enabled)};X();var da=!1,R=null,Y=null,ca=function(sa){da=sa;null!=R&&(R.className="geBtn"+(da?" gePrimaryBtn":""));null!=Y&&(Y.className=
-"geBtn"+(da?"":" gePrimaryBtn"))};null!=D&&D.addEventListener("change",function(){T.enabled=!D.checked;C.value=JSON.stringify(T,null,2);ca(!0)});null!=z&&z.addEventListener("change",function(){T.loop=!!z.checked;C.value=JSON.stringify(T,null,2);ca(!0)});null!=f&&(f.addEventListener("input",function(){f.value?T.title=f.value:delete T.title;ca(!0)}),f.addEventListener("keydown",function(sa){13!==sa.keyCode||sa.shiftKey||sa.isComposing||null==R||(sa.preventDefault(),R.click())}));var P="wait fadeIn fadeOut fadeTo opacity wipeIn wipeOut popIn popOut flow toggle show hide select style toggleStyle highlight scroll viewbox open tags".split(" "),
-aa=function(sa){for(var va=0;va<P.length;va++)if(void 0!==sa[P[va]])return P[va];return null},ea=function(sa){var va=aa(sa);return null==va||"wait"==va?null:sa[va]},oa=function(sa){var va=aa(sa);if("fadeTo"==va)return va=sa.fadeTo.value,1===va?{icon:"↗",text:mxResources.get("fadeIn",null,"Fade In")}:0===va?{icon:"↘",text:mxResources.get("fadeOut",null,"Fade Out")}:{icon:"◐",text:mxResources.get("fadeTo",null,"Fade To")};if("flow"==va)return!0===sa.flow.start?{icon:"➡",text:mxResources.get("flowOn",
-null,"Flow On")}:!1===sa.flow.start?{icon:"⏸",text:mxResources.get("flowOff",null,"Flow Off")}:{icon:"➡",text:mxResources.get("flowOn",null,"Flow Toggle")};if("opacity"==va)return{icon:"◐",text:mxResources.get("setOpacity",null,"Set Opacity")};sa=null!=va?CustomActionDialog.SCHEMAS[va]:null;return null!=sa?{icon:sa.icon||"?",text:mxResources.get(sa.labelKey||va,null,sa.label||va)}:{icon:"?",text:va||"?"}},ra=function(){C.value=JSON.stringify(T,null,2);ca(!0);Ha()},ta=function(){C.value=JSON.stringify(T,
-null,2);ca(!0)},na=new Set,wa=null,ya=null,Aa=null,Ca=null,ua=null,qa=function(sa,va){null!=sa&&(sa.disabled=!va,sa.style.opacity=va?"":"0.3",sa.style.cursor=va?"pointer":"default")},ha=function(){var sa=AnimationDialog.stepsClipboard;qa(ya,0<na.size);qa(Ca,0<na.size);qa(ua,0<na.size);qa(Aa,null!=sa&&0<sa.length)},ia=function(){return Array.from(na).sort(function(sa,va){return sa-va})},pa=function(){if(0!=na.size){for(var sa=ia(),va=[],Da=0;Da<sa.length;Da++)va.push(JSON.parse(JSON.stringify(T.steps[sa[Da]])));
-AnimationDialog.stepsClipboard=va;if(null!=navigator.clipboard&&null!=navigator.clipboard.writeText)navigator.clipboard.writeText(JSON.stringify(va,null,2))["catch"](function(){});ha()}},za=function(sa,va){sa=JSON.parse(JSON.stringify(sa));Array.prototype.splice.apply(T.steps,[va,0].concat(sa));na.clear();for(var Da=0;Da<sa.length;Da++)na.add(va+Da);wa=va;ra();va=x.querySelector('[data-step-idx="'+va+'"]');null!=va&&null!=va.scrollIntoView&&va.scrollIntoView({block:"nearest"})},fa=function(){var sa=
-AnimationDialog.stepsClipboard;if(null!=sa&&0!=sa.length){var va=ia();za(sa,0<va.length?va[va.length-1]+1:T.steps.length)}},ka=function(){if(0!=na.size){for(var sa=ia(),va=[],Da=0;Da<sa.length;Da++)va.push(T.steps[sa[Da]]);za(va,sa[sa.length-1]+1)}},xa=function(){if(0!=na.size){for(var sa=ia(),va=sa.length-1;0<=va;va--)T.steps.splice(sa[va],1);na.clear();wa=null;ra()}},Ba=null,ma=function(sa,va){var Da=document.createElement("span");Da.style.cssText="flex:0 0 14px;text-align:center;font-size:14px;line-height:1;color:light-dark(#86868b,#86868b);cursor:grab;user-select:none";
-Da.title=mxResources.get("reorder");Da.textContent="⋮⋮";Da.addEventListener("mousedown",function(){sa.draggable=!0});Da.addEventListener("mouseup",function(){sa.draggable=!1});sa.addEventListener("dragstart",function(Ka){Ba={sourceIndex:va};Ka.dataTransfer.effectAllowed="move";Ka.dataTransfer.setData("text/plain","animstep");sa.style.opacity="0.4"});sa.addEventListener("dragend",function(){sa.draggable=!1;sa.style.opacity="";for(var Ka=x.querySelectorAll("div"),Ja=0;Ja<Ka.length;Ja++)Ka[Ja].style.borderTop=
-"",Ka[Ja].style.borderBottom="";Ba=null});return Da},la=function(sa,va){sa.addEventListener("dragover",function(Da){if(null!=Ba){var Ka=sa.getBoundingClientRect(),Ja=(Ka=Da.clientY>Ka.top+Ka.height/2)?va+1:va,Oa=Ba.sourceIndex;Ja==Oa||Ja==Oa+1?(sa.style.borderTop="",sa.style.borderBottom=""):(Da.preventDefault(),Da.dataTransfer.dropEffect="move",sa._dropInsertAt=Ja,Ka?(sa.style.borderTop="",sa.style.borderBottom="2px solid light-dark(var(--focus-color), var(--dark-focus-color))"):(sa.style.borderBottom=
-"",sa.style.borderTop="2px solid light-dark(var(--focus-color), var(--dark-focus-color))"))}});sa.addEventListener("dragleave",function(){sa.style.borderTop="";sa.style.borderBottom=""});sa.addEventListener("drop",function(Da){if(null!=Ba){Da.preventDefault();Da.stopPropagation();sa.style.borderTop="";sa.style.borderBottom="";Da=Ba.sourceIndex;var Ka=null!=sa._dropInsertAt?sa._dropInsertAt:va;if(Ka!=Da&&Ka!=Da+1){var Ja=T.steps.splice(Da,1)[0];Da<Ka&&Ka--;T.steps.splice(Ka,0,Ja);na.clear();wa=null;
-ra()}}})},Ea=function(sa,va,Da,Ka){var Ja=document.createElement("button");Ja.type="button";Ja.title=va;Ja.style.cssText="flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";Da||(Ja.disabled=!0,Ja.style.opacity="0.3",Ja.style.cursor="default");mxUtils.write(Ja,sa);Da&&Ja.addEventListener("click",
-Ka);return Ja},Fa=function(sa,va){va=va||{};var Da=document.createElement("input");Da.type="number";null!=va.min&&(Da.min=va.min);null!=va.max&&(Da.max=va.max);null!=va.step&&(Da.step=va.step);null!=va.placeholder&&(Da.placeholder=va.placeholder);null!=sa&&(Da.value=sa);Da.className="geNoSpin";Da.style.cssText="padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";
-return Da},Ia=function(sa,va,Da,Ka){if(null!=Ka){Ka=document.createElement("span");Ka.style.cssText="display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:6px";var Ja=function($a){return{get:function(){var Na=T.steps[va]&&T.steps[va][Da];return Na&&Array.isArray(Na[$a])?Na[$a]:null},set:function(Na){var Va=T.steps[va][Da];Va&&"object"==typeof Va||(Va=T.steps[va][Da]={});Na&&Na.length?Va[$a]=Na:delete Va[$a];ra()}}},Oa=Ja("tags"),db=function(){var $a=T.steps[va]&&T.steps[va][Da];return $a&&
-"or"===$a.tagsMatch?"or":"and"},ob=function($a){var Na=T.steps[va][Da];Na&&"object"==typeof Na||(Na=T.steps[va][Da]={});"or"===$a?Na.tagsMatch="or":delete Na.tagsMatch;ra()},ub=Ja("layers"),Bb=CustomActionDialog.SCHEMAS[Da],nb=[];null!=Bb&&Bb.allowLayers&&nb.push({label:mxResources.get("selectLayers")+"…",disabled:function(){return 0==E.getModel().getChildCount(E.getModel().getRoot())},onClick:function($a){J.openLayerPicker($a,ub.get,ub.set)}});nb.push({label:mxResources.get("selectByTags",null,"Select by tags")+
-"…",onClick:function($a){J.openTagPicker($a,Oa.get,Oa.set,db,ob)}});nb.push({label:mxResources.get("excludeSelection",null,"Exclude selected cells"),disabled:function(){return 0==E.getSelectionCount()},onClick:function(){var $a=E.getSelectionCells();if(0!=$a.length){var Na=T.steps[va][Da];Na&&"object"==typeof Na||(Na=T.steps[va][Da]={});for(var Va=Array.isArray(Na.excludeCells)?Na.excludeCells.slice():[],Mb={},Kb=0;Kb<Va.length;Kb++)Mb[Va[Kb]]=!0;for(Kb=0;Kb<$a.length;Kb++)Mb[$a[Kb].id]||(Va.push($a[Kb].id),
-Mb[$a[Kb].id]=!0);Na.excludeCells=Va;ra()}}});Bb=Ja("cells");Ka.appendChild(J.cellListField("",Bb.get,Bb.set,{allowWildcard:!0,extraMenuItems:nb}));nb=ub.get();Array.isArray(nb)&&0<nb.length&&Ka.appendChild(J.layerListField("",ub.get,ub.set));nb=Oa.get();Array.isArray(nb)&&0<nb.length&&Ka.appendChild(J.tagListField("",Oa.get,Oa.set,{getMode:db,setMode:ob}));Ja=Ja("excludeCells");nb=Ja.get();Array.isArray(nb)&&0<nb.length&&Ka.appendChild(J.cellListField("",Ja.get,Ja.set,{allowWildcard:!1,singularKey:"excluded",
-pluralKey:"excluded",singularFallback:"Excluded",pluralFallback:"Excluded"}));sa.appendChild(Ka)}},Ha=function(){x.innerHTML="";if(0==T.steps.length){var sa=document.createElement("div");sa.style.cssText="padding:12px;text-align:center;color:light-dark(#86868b,#86868b);font-size:12px";mxUtils.write(sa,mxResources.get("noStepsYet",null,"No steps yet. Add the first step below."));x.appendChild(sa)}else for(sa=0;sa<T.steps.length;sa++)x.appendChild(hb(T.steps[sa],sa,sa==T.steps.length-1));ha()},Ma=function(sa){var va=
-document.createElement("div");va.style.cssText="display:flex;align-items:center;gap:6px;min-width:max-content;padding:6px 4px;border-radius:4px;border-bottom:1px solid light-dark(rgba(0,0,0,0.05),rgba(255,255,255,0.05))";sa&&(va.style.borderBottom="none");return va},bb=function(sa){var va=document.createElement("span");va.style.cssText="flex:1 1 auto;min-width:0";sa.appendChild(va)},ab=function(sa,va){var Da=document.createElement("span");Da.style.cssText="flex:0 0 18px;text-align:center;font-size:14px";
-mxUtils.write(Da,va);sa.appendChild(Da);return Da},tb=function(sa,va){var Da=document.createElement("span");Da.style.cssText="flex:0 0 70px;font-weight:500;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis";Da.title=va;mxUtils.write(Da,va);sa.appendChild(Da)},yb=function(sa){return null!=sa.titleKey?mxResources.get(sa.titleKey,null,sa.title||""):null!=sa.title?sa.title:null!=sa.placeholderKey?mxResources.get(sa.placeholderKey,null,sa.placeholder||""):null!=sa.placeholder?sa.placeholder:
-null},jb=function(sa,va,Da,Ka,Ja,Oa){if(Ja){Ja=function(){return T.steps[va][Da]};var db=function(Na){T.steps[va][Da]=null==Na||""===Na?"number"==Ka.type?0:"":Na;ta()}}else Ja=function(){var Na=T.steps[va][Da];return null!=Na&&"object"==typeof Na?Na[Ka.name]:void 0},db=function(Na){var Va=T.steps[va][Da];if(null==Va||"object"!=typeof Va)Va=T.steps[va][Da]={};null==Na||""===Na?delete Va[Ka.name]:Va[Ka.name]=Na;ta()};var ob=yb(Ka);if("checkbox"==Ka.type){Oa=document.createElement("label");Oa.style.cssText=
-"flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));user-select:none";ob&&(Oa.title=ob);var ub=document.createElement("input");ub.type="checkbox";ub.checked=!!Ja();ub.style.cssText="margin:0;accent-color:light-dark(var(--focus-color), var(--dark-focus-color))";ub.addEventListener("change",function(){ub.checked?db(!0):db(void 0)});Oa.appendChild(ub);if(Ka.labelKey||Ka.label)Ja=document.createElement("span"),
-mxUtils.write(Ja,Ka.labelKey?mxResources.get(Ka.labelKey,null,Ka.label||""):Ka.label||""),Oa.appendChild(Ja);sa.appendChild(Oa)}else if("tagList"==Ka.type)ob=Ka.labelKey?mxResources.get(Ka.labelKey,null,Ka.label||""):Ka.label||"",sa.appendChild(J.tagListField(ob,Ja,function(Na){Array.isArray(Na)&&0!=Na.length?db(Na):db(void 0)},(Ka.modeField?{getMode:function(){var Na=T.steps[va][Da];return Na&&"or"===Na[Ka.modeField]?"or":"and"},setMode:function(Na){var Va=T.steps[va][Da];if(null==Va||"object"!=
-typeof Va)Va=T.steps[va][Da]={};"or"===Na?Va[Ka.modeField]="or":delete Va[Ka.modeField];ta()}}:null)||void 0));else if("select"==Ka.type){var Bb=document.createElement("select");Bb.style.cssText="flex:0 0 auto;padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";for(Oa=0;Oa<Ka.options.length;Oa++){var nb=
-document.createElement("option");nb.value=Ka.options[Oa].value;nb.textContent=Ka.options[Oa].label;Bb.appendChild(nb)}Ja=Ja();null!=Ja&&(Bb.value=String(Ja));ob&&(Bb.title=ob);Bb.addEventListener("change",function(){var Na=Bb.value;""===Na?db(void 0):"true"===Na?db(!0):"false"===Na?db(!1):db(Na)});sa.appendChild(Bb);Ka.label&&(Ja=document.createElement("span"),Ja.className="geDialogHint",Ja.style.cssText="flex:0 0 auto",mxUtils.write(Ja,Ka.label),sa.appendChild(Ja))}else{if("number"==Ka.type){nb=
-null!=Ka.placeholderKey?mxResources.get(Ka.placeholderKey,null,Ka.placeholder||""):Ka.placeholder;var $a=Fa(Ja(),{min:Ka.min,max:Ka.max,step:Ka.step,width:Ka.width||55,placeholder:nb})}else{$a=document.createElement("input");$a.type=Ka.type||"text";nb=Ka.width||("color"==Ka.type?36:80);$a.style.cssText="color"==Ka.type?"flex:0 0 "+nb+"px;min-width:0;height:22px;padding:1px;cursor:pointer;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color))":
-"flex:0 0 "+nb+"px;min-width:0;padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";if(nb=null!=Ka.placeholderKey?mxResources.get(Ka.placeholderKey,null,Ka.placeholder||""):Ka.placeholder)$a.placeholder=nb;Ja=Ja();null!=Ja&&($a.value=String(Ja))}ob&&($a.title=ob);Oa&&($a.disabled=!0,$a.style.opacity=
-"0.4");Ja=function(){var Na=$a.value;"number"==Ka.type?""===Na?db(void 0):(Na=parseFloat(Na),isNaN(Na)?db(void 0):db(Na)):db(""===Na?void 0:Na)};$a.addEventListener("change",Ja);$a.addEventListener("input",Ja);sa.appendChild($a);Ka.label&&(Ja=document.createElement("span"),Ja.className="geDialogHint",Ja.style.cssText="flex:0 0 auto",mxUtils.write(Ja,Ka.label),sa.appendChild(Ja))}},hb=function(sa,va,Da){var Ka=oa(sa),Ja=aa(sa),Oa=null!=Ja?CustomActionDialog.SCHEMAS[Ja]:null,db=ea(sa);Da=Ma(Da);Da.setAttribute("data-step-idx",
-va);M.has(va)&&Da.classList.add("geAnimationStepActive");na.has(va)&&Da.classList.add("geAnimationStepSelected");var ob=document.createElement("input");ob.type="checkbox";ob.setAttribute("data-step-select","1");ob.checked=na.has(va);ob.title=mxResources.get("select");ob.style.cssText="flex:0 0 auto;margin:0;accent-color:light-dark(var(--focus-color), var(--dark-focus-color))";ob.addEventListener("click",function(Na){if(Na.shiftKey&&null!=wa){Na=Math.max(wa,va);for(var Va=Math.min(wa,va);Va<=Na;Va++)na.add(Va)}else{if(ob.checked)na.add(va);
-else na["delete"](va);wa=va}Na=x.querySelectorAll("[data-step-idx]");for(Va=0;Va<Na.length;Va++){var Mb=parseInt(Na[Va].getAttribute("data-step-idx"),10);Mb=na.has(Mb);Na[Va].classList.toggle("geAnimationStepSelected",Mb);var Kb=Na[Va].querySelector("input[data-step-select]");null!=Kb&&(Kb.checked=Mb)}ha()});Da.appendChild(ob);Da.appendChild(ma(Da,va));la(Da,va);var ub=document.createElement("button");ub.type="button";var Bb=function(){ub.textContent="";!0===sa.immediate?(mxUtils.write(ub,"⏩︎"),ub.title=
-mxResources.get("immediate",null,"Immediate")):(mxUtils.write(ub,"⏱︎"),ub.title=mxResources.get("wait",null,"Wait"))};ub.style.cssText='flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-family:"Segoe UI Symbol","Apple Symbols",sans-serif;font-variant-emoji:text;filter:grayscale(1) contrast(2)';
-Bb();0===va&&(ub.style.visibility="hidden");ub.addEventListener("click",function(){!0===sa.immediate?(delete T.steps[va].immediate,sa.immediate=void 0):(T.steps[va].immediate=!0,sa.immediate=!0);Bb();ta()});Da.appendChild(ub);ab(Da,Ka.icon);tb(Da,Ka.text);if(null!=Oa&&null!=Oa.primary)bb(Da),jb(Da,va,Ja,Oa.primary,!0);else{(null==Oa||Oa.selector)&&Ia(Da,va,Ja,db);bb(Da);if(null!=Oa&&Array.isArray(Oa.fields)){Ka=null!=db&&(Array.isArray(db.cells)&&0<db.cells.length||Array.isArray(db.tags)&&0<db.tags.length||
-Array.isArray(db.layers)&&0<db.layers.length);for(var nb=0;nb<Oa.fields.length;nb++)jb(Da,va,Ja,Oa.fields[nb],!1,!0===Oa.fields[nb].staticOnly&&Ka)}if(null!=Oa&&Oa.selector&&("wipeIn"==Ja||"wipeOut"==Ja||"popIn"==Ja||"popOut"==Ja)){var $a=Fa(db.delay,{min:0,step:100,width:55,placeholder:"900"});$a.title=mxResources.get("duration");$a.addEventListener("change",function(){var Na=parseFloat($a.value);Na=""===$a.value||isNaN(Na)||0>Na?void 0:Na;null==Na?delete T.steps[va][Ja].delay:T.steps[va][Ja].delay=
-Na;ta()});Da.appendChild($a);Oa=document.createElement("span");Oa.className="geDialogHint";Oa.style.cssText="flex:0 0 auto";mxUtils.write(Oa,"ms");Da.appendChild(Oa)}"viewbox"==Ja&&(Oa=document.createElement("button"),Oa.type="button",Oa.className="geBtn",Oa.style.cssText="flex:0 0 auto;padding:2px 8px;font-size:11px;min-width:0",Oa.textContent=mxResources.get("useCurrent"),Oa.title=Oa.textContent,Oa.addEventListener("click",function(Na){Na.preventDefault();Na=Eb();var Va=T.steps[va].viewbox;if(null==
-Va||"object"!=typeof Va)Va=T.steps[va].viewbox={};Va.x=Na.x;Va.y=Na.y;Va.width=Na.width;Va.height=Na.height;null==Va.border&&(Va.border=Na.border);delete Va.cells;delete Va.tags;delete Va.tagsMatch;delete Va.layers;delete Va.excludeCells;ra()}),Da.appendChild(Oa))}Oa=Ea("▶",mxResources.get("preview"),!0,function(){Pa();var Na=JSON.parse(JSON.stringify(Graph.flattenAnimationActions([sa])));E.executeCustomActions(Na)});Da.appendChild(Oa);return Da};v.addEventListener("change",function(){v.checked?(x.style.display=
-"none",C.style.display="block",ba()):(C.style.display="none",x.style.display="block",K(null),Ha())});C.addEventListener("input",function(){ca(!0);try{var sa=Editor.parseAnimationData(C.value);null!=sa&&Array.isArray(sa.steps)&&(T=sa,na.clear(),wa=null,K(null),null!=z&&(z.checked=!!T.loop),null!=D&&(D.checked=!T.enabled),v.checked||Ha())}catch(va){K(Q(C.value,va))}});Ha();var rb=document.createElement("div");rb.className="geDialogSection";rb.style.cssText="margin-top:10px;margin-bottom:0;flex:0 0 auto;display:flex;flex-direction:column;gap:8px";
-var Sa=document.createElement("div");Sa.style.cssText="display:flex;align-items:center;gap:8px;flex-wrap:wrap";rb.appendChild(Sa);var Ua=document.createElement("select");Ua.style.cssText="flex:1 1 200px;min-width:180px;padding:5px 6px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:4px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-size:13px";var vb=
-[],kb=document.createElement("option");kb.value="";kb.disabled=!0;kb.selected=!0;var qb=function(){kb.textContent=mxResources.get("add")+"…"};qb();L.push(qb);Ua.appendChild(kb);for(var lb=[{labelKey:"visibilityActions",label:"Visibility",keys:["toggle","show","hide"]},{labelKey:"effects",label:"Effects",keys:"fadeIn fadeOut fadeTo wipeIn wipeOut popIn popOut".split(" ")},{labelKey:"style",label:"Style",keys:["opacity","style","toggleStyle","highlight","flow"]},{labelKey:"navigation",label:"Navigation",
-keys:["select","scroll","viewbox","open"]},{labelKey:"tags",label:"Tags",keys:["tags"]},{labelKey:"timing",label:"Timing",keys:["wait"]}],Za=0;Za<lb.length;Za++){var Hb=document.createElement("optgroup");Hb.label=mxResources.get(lb[Za].labelKey,null,lb[Za].label);vb.push({el:Hb,prop:"label",key:lb[Za].labelKey,fallback:lb[Za].label});for(var Db=0;Db<lb[Za].keys.length;Db++){var Cb=lb[Za].keys[Db],fb=CustomActionDialog.SCHEMAS[Cb];if(null!=fb){var eb=document.createElement("option");eb.value=Cb;var Wa=
-fb.labelKey||Cb;eb.textContent=mxResources.get(Wa,null,fb.label);vb.push({el:eb,prop:"textContent",key:Wa,fallback:fb.label});Hb.appendChild(eb)}}Ua.appendChild(Hb)}var cb=document.createElement("optgroup");cb.label="──────";var Gb=document.createElement("option");Gb.value="__deleteAll__";Gb.className="geDeleteOpt";Gb.textContent=mxResources.get("deleteAll");vb.push({el:Gb,prop:"textContent",key:"deleteAll",fallback:"Delete All"});cb.appendChild(Gb);Ua.appendChild(cb);L.push(function(){for(var sa=
-0;sa<vb.length;sa++){var va=vb[sa];va.el[va.prop]=mxResources.get(va.key,null,va.fallback)}});Sa.appendChild(Ua);var sb=[],wb=function(sa,va,Da,Ka){var Ja=mxResources.get(va,null,Da);Ka=Ea("",Ja,!0,Ka);Ja=document.createElement("img");Ja.className="geAdaptiveAsset";Ja.setAttribute("src",sa);Ja.style.cssText="width:14px;height:14px;vertical-align:middle";Ka.appendChild(Ja);sb.push({el:Ka,key:va,fallback:Da});Sa.appendChild(Ka);return Ka};ya=wb(Editor.copyImage,"copy","Copy",pa);Aa=wb(Editor.pasteImage,
-"paste","Paste",fa);Ca=wb(Editor.duplicateImage,"duplicate","Duplicate",ka);ua=wb(Editor.trashImage,"delete","Delete",xa);ha();L.push(function(){for(var sa=0;sa<sb.length;sa++){var va=sb[sa];va.el.title=mxResources.get(va.key,null,va.fallback)}});c.addEventListener("keydown",function(sa){var va=sa.target,Da=null!=va&&null!=va.tagName?va.tagName.toLowerCase():"";"textarea"==Da||"select"==Da||"input"==Da&&"checkbox"!=va.type||null!=va&&va.isContentEditable||(va=null!=sa.key?sa.key.toLowerCase():"",
-Da=!1,!("delete"!=va&&"backspace"!=va||sa.metaKey||sa.ctrlKey||sa.altKey)&&0<na.size?(xa(),Da=!0):(mxClient.IS_MAC?sa.metaKey:sa.ctrlKey)&&!sa.altKey&&("c"==va&&0<na.size&&""==window.getSelection().toString()?(pa(),Da=!0):"v"==va&&null!=AnimationDialog.stepsClipboard&&0<AnimationDialog.stepsClipboard.length?(fa(),Da=!0):"d"==va&&0<na.size&&(ka(),Da=!0)),Da&&(sa.preventDefault(),sa.stopPropagation()))});c.appendChild(rb);var Eb=function(){var sa=E.view,va=E.container,Da=sa.scale;sa=sa.translate;return{x:Math.round(va.scrollLeft/
-Da-sa.x),y:Math.round(va.scrollTop/Da-sa.y),width:Math.round(va.clientWidth/Da),height:Math.round(va.clientHeight/Da),border:0}},pb=function(sa,va){var Da=CustomActionDialog.SCHEMAS[sa];if(null==Da)return null;var Ka={};if(null!=Da.primary){var Ja=Da.primary.def;Ka[sa]=null!=Ja?"number"==Da.primary.type?parseFloat(Ja):Ja:"number"==Da.primary.type?0:""}else{Ja={};Da.selector&&Array.isArray(va)&&0<va.length&&(Ja.cells=va.slice());if(Array.isArray(Da.fields))for(va=0;va<Da.fields.length;va++){var Oa=
-Da.fields[va];null!=Oa.def&&(Ja[Oa.name]="number"==Oa.type?parseFloat(Oa.def):Oa.def)}"viewbox"==sa&&null==Ja.cells&&(Da=Eb(),null==Ja.x&&(Ja.x=Da.x),null==Ja.y&&(Ja.y=Da.y),null==Ja.width&&(Ja.width=Da.width),null==Ja.height&&(Ja.height=Da.height),null==Ja.border&&(Ja.border=Da.border));Ka[sa]=Ja}return Ka};Ua.addEventListener("change",function(){var sa=Ua.value;Ua.value="";if(sa)if("__deleteAll__"==sa)0!=T.steps.length&&b.confirm(mxResources.get("areYouSure",null,"Are you sure?"),function(){T.steps=
-[];na.clear();wa=null;ra()});else{var va=CustomActionDialog.SCHEMAS[sa];if(null!=va){var Da=null;va.selector&&(va=E.getSelectionCells(),Da=0<va.length?va.map(function(Ka){return Ka.id}):"viewbox"==sa?null:[Editor.ANIMATION_ALL]);sa=pb(sa,Da);null!=sa&&(T.steps.push(sa),ra(),x.scrollTop=x.scrollHeight)}}});var Ab=null,Ib=null,Lb=null,Ga=function(){if(null!=Lb){var sa=null!=Ib;Lb.disabled=!sa;Lb.style.opacity=sa?"":"0.4";Lb.style.cursor=sa?"":"default"}},Pa=function(){null==Ib&&(Ib=new Editor.AnimationPlayer(E,
-T),Ib.snapshotOpacity(),Ga())},La=function(){if(null!=Ib){Ib.restoreOpacity();for(var sa=Ib.collectReferencedCells(),va=[],Da=0;Da<sa.length;Da++)E.getModel().isEdge(sa[Da])&&va.push(sa[Da]);0<va.length&&Editor.toggleFlowAnimation(E,va,"stop");E.refresh();Ib=null;Ga()}},Ta=function(){null!=Ab&&(Ab.stop(),Ab=null)},Qa=document.createElement("div");Qa.style.cssText="margin-top:20px;display:flex;gap:6px;flex:0 0 auto";var Ra=function(sa,va){var Da=new Set;if(null!=sa&&0<=sa)for(va=null!=va?va:sa+1;sa<
-va;sa++)Da.add(sa);if(Da.size===M.size){sa=!0;va=$jscomp.makeIterator(Da);for(var Ka=va.next();!Ka.done;Ka=va.next())if(!M.has(Ka.value)){sa=!1;break}if(sa)return}M=Da;Da=x.querySelectorAll("[data-step-idx]");for(sa=0;sa<Da.length;sa++)va=parseInt(Da[sa].getAttribute("data-step-idx"),10),Da[sa].classList.toggle("geAnimationStepActive",M.has(va))};Qa.appendChild(b.createHelpIcon(ANIMATION_HELP_URL));var Xa=this,gb=function(){if("page"==A){var sa=E.getModel().getRoot(),va={steps:T.steps};!1===T.loop&&
-(va.loop=!1);!1===T.enabled&&(va.enabled=!1);va=0<va.steps.length?JSON.stringify({animation:va}):null;E.setAttributeForCell(sa,"animation",va);E.setAttributeForCell(sa,"animationHideInitial",null)}else"function"==typeof y.save&&y.save(T);ca(!1)};Y=mxUtils.button(mxResources.get("preview"),function(){Ta();Pa();Ab=new Editor.AnimationPlayer(E,T);Ab.snapshot=[];Ab.play({done:function(){Ab=null;Ra(-1)},onStep:function(sa,va){Ra(sa,va)}})});Y.className="geBtn";L.push(function(){Y.textContent=mxResources.get("preview");
-Y.title=mxResources.get("preview")});Y.title=mxResources.get("preview");Qa.appendChild(Y);var ib=mxUtils.button(mxResources.get("reset"),function(){Ta();Ra(-1);La()});ib.className="geBtn";L.push(function(){var sa=mxResources.get("reset");ib.textContent=sa;ib.title=sa});ib.title=mxResources.get("reset");Lb=ib;Ga();Qa.appendChild(ib);V=document.createElement("span");V.style.flex="1 1 auto";Qa.appendChild(V);var zb=mxUtils.button(mxResources.get("cancel"),function(){da?mb():Xa.window.setVisible(!1)});
-zb.className="geBtn";L.push(function(){zb.textContent=mxResources.get("cancel");zb.title=mxResources.get("cancel")});zb.title=mxResources.get("cancel");Qa.appendChild(zb);R=mxUtils.button(mxResources.get("save"),function(){v.checked&&!G?(ba(),C.focus()):(gb(),Xa.window.setVisible(!1))});R.className="geBtn gePrimaryBtn";L.push(function(){R.textContent=mxResources.get("save");R.title=mxResources.get("save")});R.title=mxResources.get("save");Qa.appendChild(R);c.appendChild(Qa);this.window=new mxWindow(O(),
-c,l,p,g,u,!0,!0);this.window.minimumSize=new mxRectangle(0,0,360,360);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);var xb=function(){"function"==typeof J.closePopover&&J.closePopover()};this.window.addListener(mxEvent.MOVE,xb);this.window.addListener(mxEvent.RESIZE,xb);var Jb=function(){for(var sa=0;sa<L.length;sa++)try{L[sa]()}catch(va){}null!=Xa.window&&null!=Xa.window.title&&(Xa.window.title.innerHTML=mxUtils.htmlEntities(O()));
-Ha()};b.addListener("languageChanged",Jb);this.window.addListener(mxEvent.DESTROY,function(){b.removeListener(Jb)});var mb=function(){b.confirm(mxResources.get("allChangesLost"),null,function(){ca(!1);Xa.window.setVisible(!1)},mxResources.get("cancel"),mxResources.get("discardChanges"))},Fb=Xa.window.setVisible.bind(Xa.window);Xa.window.setVisible=function(sa){!1===sa&&da&&gb();Fb(sa)};this.window.addListener("hide",function(){Ta();Ra(-1);La()});"page"==A&&E.addListener(mxEvent.ROOT,function(){var sa=
-E.getModel().getRoot();if(sa!=Z){if(da){var va={steps:T.steps};!1===T.loop&&(va.loop=!1);!1===T.enabled&&(va.enabled=!1);va=0<T.steps.length?JSON.stringify({animation:va}):null;E.setAttributeForCell(Z,"animation",va)}Z=sa;X();ca(!1);na.clear();wa=null;Ha();Ta()}});var Ya=function(){ca(!1);Xa.window.setVisible(!1)};b.editor.addListener("fileLoaded",Ya);this.window.addListener(mxEvent.DESTROY,function(){b.editor.removeListener(Ya)});installDialogDocking(b,this);this.window.setVisible(!0);window.setTimeout(mxUtils.bind(this,
-function(){null==this.window||null==this.window.div||this.window.minimized||null!=this.window.dockState||this.window.setLocation(this.window.getX(),this.window.getY())}),0)};AnimationDialog.stepsClipboard=null;
+"display:none;flex:0 0 auto;margin-top:6px;padding:6px 8px;border-radius:6px;font-size:12px;background:light-dark(#fde7e9,#3a1d1f);color:light-dark(#b3261e,#ffb4ab);border:1px solid light-dark(#f1aeb5,#7a2e2e);white-space:pre-wrap;word-break:break-word";c.appendChild(F);var G=!0,K=function(ra){G=null==ra;F.style.display=null==ra?"none":"block";null!=ra&&(F.textContent=ra)},Q=function(ra,va){va=null!=va&&null!=va.message?va.message:String(va);if(!/line \d+/i.test(va)){var Ca=va.match(/at position (\d+)/i);
+null!=Ca&&(Ca=Math.min(parseInt(Ca[1],10),ra.length),ra=ra.substring(0,Ca).split("\n"),va+=" (line "+ra.length+" column "+(ra[ra.length-1].length+1)+")")}return mxResources.get("error")+": "+va},ba=function(){try{Editor.parseAnimationData(C.value),K(null)}catch(ra){K(Q(C.value,ra))}},T={steps:[]},Z=E.getModel().getRoot(),X=function(){if("page"==A){var ra=E.getAttributeForCell(Z,"animation");try{T=Editor.parseAnimationData(ra)}catch(va){T=Editor.parseAnimationData(null)}}else ra=y.initial,T=Array.isArray(ra)?
+{steps:JSON.parse(JSON.stringify(ra))}:null!=ra&&"object"==typeof ra?JSON.parse(JSON.stringify(ra)):{steps:[]};null==T.steps&&(T.steps=[]);"page"!=A&&(null!=T.loop&&delete T.loop,null!=T.enabled&&delete T.enabled);C.value=JSON.stringify(T,null,2);null!=f&&(f.value=T.title||"");null!=z&&(z.checked=null==T.loop?!0:!!T.loop);null!=D&&(D.checked=null==T.enabled?!1:!T.enabled)};X();var da=!1,R=null,Y=null,ca=function(ra){da=ra;null!=R&&(R.className="geBtn"+(da?" gePrimaryBtn":""));null!=Y&&(Y.className=
+"geBtn"+(da?"":" gePrimaryBtn"))};null!=D&&D.addEventListener("change",function(){T.enabled=!D.checked;C.value=JSON.stringify(T,null,2);ca(!0)});null!=z&&z.addEventListener("change",function(){T.loop=!!z.checked;C.value=JSON.stringify(T,null,2);ca(!0)});null!=f&&(f.addEventListener("input",function(){f.value?T.title=f.value:delete T.title;ca(!0)}),f.addEventListener("keydown",function(ra){13!==ra.keyCode||ra.shiftKey||ra.isComposing||null==R||(ra.preventDefault(),R.click())}));var P="wait fadeIn fadeOut fadeTo opacity wipeIn wipeOut popIn popOut flow toggle show hide select style toggleStyle highlight scroll viewbox open tags".split(" "),
+aa=function(ra){for(var va=0;va<P.length;va++)if(void 0!==ra[P[va]])return P[va];return null},ea=function(ra){var va=aa(ra);return null==va||"wait"==va?null:ra[va]},oa=function(ra){var va=aa(ra);if("fadeTo"==va)return va=ra.fadeTo.value,1===va?{icon:"↗",text:mxResources.get("fadeIn",null,"Fade In")}:0===va?{icon:"↘",text:mxResources.get("fadeOut",null,"Fade Out")}:{icon:"◐",text:mxResources.get("fadeTo",null,"Fade To")};if("flow"==va)return!0===ra.flow.start?{icon:"➡",text:mxResources.get("flowOn",
+null,"Flow On")}:!1===ra.flow.start?{icon:"⏸",text:mxResources.get("flowOff",null,"Flow Off")}:{icon:"➡",text:mxResources.get("flowOn",null,"Flow Toggle")};if("opacity"==va)return{icon:"◐",text:mxResources.get("setOpacity",null,"Set Opacity")};ra=null!=va?CustomActionDialog.SCHEMAS[va]:null;return null!=ra?{icon:ra.icon||"?",text:mxResources.get(ra.labelKey||va,null,ra.label||va)}:{icon:"?",text:va||"?"}},sa=function(){C.value=JSON.stringify(T,null,2);ca(!0);Ha()},ta=function(){C.value=JSON.stringify(T,
+null,2);ca(!0)},na=new Set,wa=null,ya=null,Aa=null,Da=null,ua=null,qa=function(ra,va){null!=ra&&(ra.disabled=!va,ra.style.opacity=va?"":"0.3",ra.style.cursor=va?"pointer":"default")},ha=function(){var ra=AnimationDialog.stepsClipboard;qa(ya,0<na.size);qa(Da,0<na.size);qa(ua,0<na.size);qa(Aa,null!=ra&&0<ra.length)},ia=function(){return Array.from(na).sort(function(ra,va){return ra-va})},pa=function(){if(0!=na.size){for(var ra=ia(),va=[],Ca=0;Ca<ra.length;Ca++)va.push(JSON.parse(JSON.stringify(T.steps[ra[Ca]])));
+AnimationDialog.stepsClipboard=va;if(null!=navigator.clipboard&&null!=navigator.clipboard.writeText)navigator.clipboard.writeText(JSON.stringify(va,null,2))["catch"](function(){});ha()}},za=function(ra,va){ra=JSON.parse(JSON.stringify(ra));Array.prototype.splice.apply(T.steps,[va,0].concat(ra));na.clear();for(var Ca=0;Ca<ra.length;Ca++)na.add(va+Ca);wa=va;sa();va=x.querySelector('[data-step-idx="'+va+'"]');null!=va&&null!=va.scrollIntoView&&va.scrollIntoView({block:"nearest"})},fa=function(){var ra=
+AnimationDialog.stepsClipboard;if(null!=ra&&0!=ra.length){var va=ia();za(ra,0<va.length?va[va.length-1]+1:T.steps.length)}},ka=function(){if(0!=na.size){for(var ra=ia(),va=[],Ca=0;Ca<ra.length;Ca++)va.push(T.steps[ra[Ca]]);za(va,ra[ra.length-1]+1)}},xa=function(){if(0!=na.size){for(var ra=ia(),va=ra.length-1;0<=va;va--)T.steps.splice(ra[va],1);na.clear();wa=null;sa()}},Ba=null,ma=function(ra,va){var Ca=document.createElement("span");Ca.style.cssText="flex:0 0 14px;text-align:center;font-size:14px;line-height:1;color:light-dark(#86868b,#86868b);cursor:grab;user-select:none";
+Ca.title=mxResources.get("reorder");Ca.textContent="⋮⋮";Ca.addEventListener("mousedown",function(){ra.draggable=!0});Ca.addEventListener("mouseup",function(){ra.draggable=!1});ra.addEventListener("dragstart",function(Ia){Ba={sourceIndex:va};Ia.dataTransfer.effectAllowed="move";Ia.dataTransfer.setData("text/plain","animstep");ra.style.opacity="0.4"});ra.addEventListener("dragend",function(){ra.draggable=!1;ra.style.opacity="";for(var Ia=x.querySelectorAll("div"),La=0;La<Ia.length;La++)Ia[La].style.borderTop=
+"",Ia[La].style.borderBottom="";Ba=null});return Ca},la=function(ra,va){ra.addEventListener("dragover",function(Ca){if(null!=Ba){var Ia=ra.getBoundingClientRect(),La=(Ia=Ca.clientY>Ia.top+Ia.height/2)?va+1:va,Ua=Ba.sourceIndex;La==Ua||La==Ua+1?(ra.style.borderTop="",ra.style.borderBottom=""):(Ca.preventDefault(),Ca.dataTransfer.dropEffect="move",ra._dropInsertAt=La,Ia?(ra.style.borderTop="",ra.style.borderBottom="2px solid light-dark(var(--focus-color), var(--dark-focus-color))"):(ra.style.borderBottom=
+"",ra.style.borderTop="2px solid light-dark(var(--focus-color), var(--dark-focus-color))"))}});ra.addEventListener("dragleave",function(){ra.style.borderTop="";ra.style.borderBottom=""});ra.addEventListener("drop",function(Ca){if(null!=Ba){Ca.preventDefault();Ca.stopPropagation();ra.style.borderTop="";ra.style.borderBottom="";Ca=Ba.sourceIndex;var Ia=null!=ra._dropInsertAt?ra._dropInsertAt:va;if(Ia!=Ca&&Ia!=Ca+1){var La=T.steps.splice(Ca,1)[0];Ca<Ia&&Ia--;T.steps.splice(Ia,0,La);na.clear();wa=null;
+sa()}}})},Ea=function(ra,va,Ca,Ia){var La=document.createElement("button");La.type="button";La.title=va;La.style.cssText="flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";Ca||(La.disabled=!0,La.style.opacity="0.3",La.style.cursor="default");mxUtils.write(La,ra);Ca&&La.addEventListener("click",
+Ia);return La},Ga=function(ra,va){va=va||{};var Ca=document.createElement("input");Ca.type="number";null!=va.min&&(Ca.min=va.min);null!=va.max&&(Ca.max=va.max);null!=va.step&&(Ca.step=va.step);null!=va.placeholder&&(Ca.placeholder=va.placeholder);null!=ra&&(Ca.value=ra);Ca.className="geNoSpin";Ca.style.cssText="padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";
+return Ca},Ja=function(ra,va,Ca,Ia){if(null!=Ia){Ia=document.createElement("span");Ia.style.cssText="display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:6px";var La=function(Pa){return{get:function(){var Oa=T.steps[va]&&T.steps[va][Ca];return Oa&&Array.isArray(Oa[Pa])?Oa[Pa]:null},set:function(Oa){var rb=T.steps[va][Ca];rb&&"object"==typeof rb||(rb=T.steps[va][Ca]={});Oa&&Oa.length?rb[Pa]=Oa:delete rb[Pa];sa()}}},Ua=La("tags"),Va=function(){var Pa=T.steps[va]&&T.steps[va][Ca];return Pa&&
+"or"===Pa.tagsMatch?"or":"and"},nb=function(Pa){var Oa=T.steps[va][Ca];Oa&&"object"==typeof Oa||(Oa=T.steps[va][Ca]={});"or"===Pa?Oa.tagsMatch="or":delete Oa.tagsMatch;sa()},ob=La("layers"),Cb=CustomActionDialog.SCHEMAS[Ca],kb=[];null!=Cb&&Cb.allowLayers&&kb.push({label:mxResources.get("selectLayers")+"…",disabled:function(){return 0==E.getModel().getChildCount(E.getModel().getRoot())},onClick:function(Pa){J.openLayerPicker(Pa,ob.get,ob.set)}});kb.push({label:mxResources.get("selectByTags",null,"Select by tags")+
+"…",onClick:function(Pa){J.openTagPicker(Pa,Ua.get,Ua.set,Va,nb)}});kb.push({label:mxResources.get("excludeSelection",null,"Exclude selected cells"),disabled:function(){return 0==E.getSelectionCount()},onClick:function(){var Pa=E.getSelectionCells();if(0!=Pa.length){var Oa=T.steps[va][Ca];Oa&&"object"==typeof Oa||(Oa=T.steps[va][Ca]={});for(var rb=Array.isArray(Oa.excludeCells)?Oa.excludeCells.slice():[],Pb={},Lb=0;Lb<rb.length;Lb++)Pb[rb[Lb]]=!0;for(Lb=0;Lb<Pa.length;Lb++)Pb[Pa[Lb].id]||(rb.push(Pa[Lb].id),
+Pb[Pa[Lb].id]=!0);Oa.excludeCells=rb;sa()}}});var Ib=function(){var Pa=T.steps[va][Ca];return null!=Pa&&"object"==typeof Pa&&!0===Pa.descendants};kb.push({label:mxResources.get("descendants"),active:Ib(),onClick:function(){var Pa=T.steps[va][Ca];Pa&&"object"==typeof Pa||(Pa=T.steps[va][Ca]={});!0===Pa.descendants?delete Pa.descendants:Pa.descendants=!0;sa()}});Cb=La("cells");Ia.appendChild(J.cellListField("",Cb.get,Cb.set,{allowWildcard:!0,extraMenuItems:kb,suffix:function(){return Ib()?" + "+mxResources.get("descendants"):
+""}}));kb=ob.get();Array.isArray(kb)&&0<kb.length&&Ia.appendChild(J.layerListField("",ob.get,ob.set));kb=Ua.get();Array.isArray(kb)&&0<kb.length&&Ia.appendChild(J.tagListField("",Ua.get,Ua.set,{getMode:Va,setMode:nb}));La=La("excludeCells");kb=La.get();Array.isArray(kb)&&0<kb.length&&Ia.appendChild(J.cellListField("",La.get,La.set,{allowWildcard:!1,singularKey:"excluded",pluralKey:"excluded",singularFallback:"Excluded",pluralFallback:"Excluded"}));ra.appendChild(Ia)}},Ha=function(){x.innerHTML="";
+if(0==T.steps.length){var ra=document.createElement("div");ra.style.cssText="padding:12px;text-align:center;color:light-dark(#86868b,#86868b);font-size:12px";mxUtils.write(ra,mxResources.get("noStepsYet",null,"No steps yet. Add the first step below."));x.appendChild(ra)}else for(ra=0;ra<T.steps.length;ra++)x.appendChild(Xa(T.steps[ra],ra,ra==T.steps.length-1));ha()},Ma=function(ra){var va=document.createElement("div");va.style.cssText="display:flex;align-items:center;gap:6px;min-width:max-content;padding:6px 4px;border-radius:4px;border-bottom:1px solid light-dark(rgba(0,0,0,0.05),rgba(255,255,255,0.05))";
+ra&&(va.style.borderBottom="none");return va},eb=function(ra){var va=document.createElement("span");va.style.cssText="flex:1 1 auto;min-width:0";ra.appendChild(va)},bb=function(ra,va){var Ca=document.createElement("span");Ca.style.cssText="flex:0 0 18px;text-align:center;font-size:14px";mxUtils.write(Ca,va);ra.appendChild(Ca);return Ca},tb=function(ra,va){var Ca=document.createElement("span");Ca.style.cssText="flex:0 0 70px;font-weight:500;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis";
+Ca.title=va;mxUtils.write(Ca,va);ra.appendChild(Ca)},Db=function(ra){return null!=ra.titleKey?mxResources.get(ra.titleKey,null,ra.title||""):null!=ra.title?ra.title:null!=ra.placeholderKey?mxResources.get(ra.placeholderKey,null,ra.placeholder||""):null!=ra.placeholder?ra.placeholder:null},cb=null,gb=function(){for(;null!=cb.firstChild;)cb.removeChild(cb.firstChild);for(var ra=0;ra<AnimationDialog.STYLE_KEYS.length;ra++){var va=AnimationDialog.STYLE_KEYS[ra],Ca=document.createElement("option");Ca.value=
+va.key;Ca.label="function"==typeof va.label?va.label():mxResources.get(va.label,null,va.fallback);cb.appendChild(Ca)}},wb=function(ra,va,Ca){var Ia=ra.setAttribute;null==cb&&(cb=document.createElement("datalist"),cb.id="geStyleKeys"+ ++AnimationDialog.styleKeyListCount,gb(),c.appendChild(cb),L.push(gb));Ia.call(ra,"list",cb.id);ra=CustomActionDialog.SCHEMAS[Ca];var La=!1;if(null!=ra&&Array.isArray(ra.fields))for(Ia=0;Ia<ra.fields.length;Ia++)La=La||"value"==ra.fields[Ia].name;var Ua=J.iconButton("arrowDown",
+mxResources.get("useSelection"),function(){var Va=E.getSelectionCell(),nb=null!=Va?AnimationDialog.getStylePairs(E.model.getStyle(Va)):[],ob=[];0==nb.length&&ob.push({label:mxResources.get(null==Va?"nothingIsSelected":"none"),disabled:!0});for(Va=0;Va<nb.length;Va++)(function(Cb){ob.push({label:Cb.key+" = "+Cb.value,onClick:function(){var kb=T.steps[va][Ca];if(null==kb||"object"!=typeof kb)kb=T.steps[va][Ca]={};kb.key=Cb.key;La&&(kb.value=Cb.value);sa()}})})(nb[Va]);J.openMenuPopover(Ua,ob)});return Ua},
+Sa=function(ra,va,Ca,Ia,La,Ua){if(La){var Va=function(){return T.steps[va][Ca]};var nb=function(Oa){T.steps[va][Ca]=null==Oa||""===Oa?"number"==Ia.type?0:"":Oa;ta()}}else Va=function(){var Oa=T.steps[va][Ca];return null!=Oa&&"object"==typeof Oa?Oa[Ia.name]:void 0},nb=function(Oa){var rb=T.steps[va][Ca];if(null==rb||"object"!=typeof rb)rb=T.steps[va][Ca]={};null==Oa||""===Oa?delete rb[Ia.name]:rb[Ia.name]=Oa;ta()};var ob=Db(Ia);if("checkbox"==Ia.type){La=document.createElement("label");La.style.cssText=
+"flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));user-select:none";ob&&(La.title=ob);var Cb=document.createElement("input");Cb.type="checkbox";Cb.checked=!!Va();Cb.style.cssText="margin:0;accent-color:light-dark(var(--focus-color), var(--dark-focus-color))";Cb.addEventListener("change",function(){Cb.checked?nb(!0):nb(void 0)});La.appendChild(Cb);if(Ia.labelKey||Ia.label)Va=document.createElement("span"),
+mxUtils.write(Va,Ia.labelKey?mxResources.get(Ia.labelKey,null,Ia.label||""):Ia.label||""),La.appendChild(Va);ra.appendChild(La)}else if("tagList"==Ia.type)ob=Ia.labelKey?mxResources.get(Ia.labelKey,null,Ia.label||""):Ia.label||"",ra.appendChild(J.tagListField(ob,Va,function(Oa){Array.isArray(Oa)&&0!=Oa.length?nb(Oa):nb(void 0)},(Ia.modeField?{getMode:function(){var Oa=T.steps[va][Ca];return Oa&&"or"===Oa[Ia.modeField]?"or":"and"},setMode:function(Oa){var rb=T.steps[va][Ca];if(null==rb||"object"!=
+typeof rb)rb=T.steps[va][Ca]={};"or"===Oa?rb[Ia.modeField]="or":delete rb[Ia.modeField];ta()}}:null)||void 0));else if("select"==Ia.type){var kb=document.createElement("select");kb.style.cssText="flex:0 0 auto;padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";for(La=0;La<Ia.options.length;La++)Ua=
+document.createElement("option"),Ua.value=Ia.options[La].value,Ua.textContent=Ia.options[La].label,kb.appendChild(Ua);Va=Va();null!=Va&&(kb.value=String(Va));ob&&(kb.title=ob);kb.addEventListener("change",function(){var Oa=kb.value;""===Oa?nb(void 0):"true"===Oa?nb(!0):"false"===Oa?nb(!1):nb(Oa)});ra.appendChild(kb);Ia.label&&(Va=document.createElement("span"),Va.className="geDialogHint",Va.style.cssText="flex:0 0 auto",mxUtils.write(Va,Ia.label),ra.appendChild(Va))}else{if("number"==Ia.type){var Ib=
+null!=Ia.placeholderKey?mxResources.get(Ia.placeholderKey,null,Ia.placeholder||""):Ia.placeholder;var Pa=Ga(Va(),{min:Ia.min,max:Ia.max,step:Ia.step,width:Ia.width||55,placeholder:Ib})}else{Pa=document.createElement("input");Pa.type=Ia.type||"text";Ib=Ia.width||("color"==Ia.type?36:80);Pa.style.cssText="color"==Ia.type?"flex:0 0 "+Ib+"px;min-width:0;height:22px;padding:1px;cursor:pointer;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color))":
+"flex:0 0 "+Ib+"px;min-width:0;padding:2px 4px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color))";if(Ib=null!=Ia.placeholderKey?mxResources.get(Ia.placeholderKey,null,Ia.placeholder||""):Ia.placeholder)Pa.placeholder=Ib;Va=Va();null!=Va&&(Pa.value=String(Va))}ob&&(Pa.title=ob);Ua&&(Pa.disabled=!0,Pa.style.opacity=
+"0.4");Va=function(){var Oa=Pa.value;"number"==Ia.type?""===Oa?nb(void 0):(Oa=parseFloat(Oa),isNaN(Oa)?nb(void 0):nb(Oa)):nb(""===Oa?void 0:Oa)};Pa.addEventListener("change",Va);Pa.addEventListener("input",Va);ra.appendChild(Pa);Ia.styleKey&&!La&&ra.appendChild(wb(Pa,va,Ca));Ia.label&&(Va=document.createElement("span"),Va.className="geDialogHint",Va.style.cssText="flex:0 0 auto",mxUtils.write(Va,Ia.label),ra.appendChild(Va))}},Xa=function(ra,va,Ca){var Ia=oa(ra),La=aa(ra),Ua=null!=La?CustomActionDialog.SCHEMAS[La]:
+null,Va=ea(ra);Ca=Ma(Ca);Ca.setAttribute("data-step-idx",va);M.has(va)&&Ca.classList.add("geAnimationStepActive");na.has(va)&&Ca.classList.add("geAnimationStepSelected");var nb=document.createElement("input");nb.type="checkbox";nb.setAttribute("data-step-select","1");nb.checked=na.has(va);nb.title=mxResources.get("select");nb.style.cssText="flex:0 0 auto;margin:0;accent-color:light-dark(var(--focus-color), var(--dark-focus-color))";nb.addEventListener("click",function(Pa){if(Pa.shiftKey&&null!=wa){Pa=
+Math.max(wa,va);for(var Oa=Math.min(wa,va);Oa<=Pa;Oa++)na.add(Oa)}else{if(nb.checked)na.add(va);else na["delete"](va);wa=va}Pa=x.querySelectorAll("[data-step-idx]");for(Oa=0;Oa<Pa.length;Oa++){var rb=parseInt(Pa[Oa].getAttribute("data-step-idx"),10);rb=na.has(rb);Pa[Oa].classList.toggle("geAnimationStepSelected",rb);var Pb=Pa[Oa].querySelector("input[data-step-select]");null!=Pb&&(Pb.checked=rb)}ha()});Ca.appendChild(nb);Ca.appendChild(ma(Ca,va));la(Ca,va);var ob=document.createElement("button");
+ob.type="button";var Cb=function(){ob.textContent="";!0===ra.immediate?(mxUtils.write(ob,"⏩︎"),ob.title=mxResources.get("immediate",null,"Immediate")):(mxUtils.write(ob,"⏱︎"),ob.title=mxResources.get("wait",null,"Wait"))};ob.style.cssText='flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-family:"Segoe UI Symbol","Apple Symbols",sans-serif;font-variant-emoji:text;filter:grayscale(1) contrast(2)';
+Cb();0===va&&(ob.style.visibility="hidden");ob.addEventListener("click",function(){!0===ra.immediate?(delete T.steps[va].immediate,ra.immediate=void 0):(T.steps[va].immediate=!0,ra.immediate=!0);Cb();ta()});Ca.appendChild(ob);bb(Ca,Ia.icon);tb(Ca,Ia.text);if(null!=Ua&&null!=Ua.primary)eb(Ca),Sa(Ca,va,La,Ua.primary,!0);else{(null==Ua||Ua.selector)&&Ja(Ca,va,La,Va);eb(Ca);if(null!=Ua&&Array.isArray(Ua.fields)){Ia=null!=Va&&(Array.isArray(Va.cells)&&0<Va.cells.length||Array.isArray(Va.tags)&&0<Va.tags.length||
+Array.isArray(Va.layers)&&0<Va.layers.length);for(var kb=0;kb<Ua.fields.length;kb++)Sa(Ca,va,La,Ua.fields[kb],!1,!0===Ua.fields[kb].staticOnly&&Ia)}if(null!=Ua&&Ua.selector&&("wipeIn"==La||"wipeOut"==La||"popIn"==La||"popOut"==La)){var Ib=Ga(Va.delay,{min:0,step:100,width:55,placeholder:"900"});Ib.title=mxResources.get("duration");Ib.addEventListener("change",function(){var Pa=parseFloat(Ib.value);Pa=""===Ib.value||isNaN(Pa)||0>Pa?void 0:Pa;null==Pa?delete T.steps[va][La].delay:T.steps[va][La].delay=
+Pa;ta()});Ca.appendChild(Ib);Ua=document.createElement("span");Ua.className="geDialogHint";Ua.style.cssText="flex:0 0 auto";mxUtils.write(Ua,"ms");Ca.appendChild(Ua)}"viewbox"==La&&(Ua=document.createElement("button"),Ua.type="button",Ua.className="geBtn",Ua.style.cssText="flex:0 0 auto;padding:2px 8px;font-size:11px;min-width:0",Ua.textContent=mxResources.get("useCurrent"),Ua.title=Ua.textContent,Ua.addEventListener("click",function(Pa){Pa.preventDefault();Pa=Mb();var Oa=T.steps[va].viewbox;if(null==
+Oa||"object"!=typeof Oa)Oa=T.steps[va].viewbox={};Oa.x=Pa.x;Oa.y=Pa.y;Oa.width=Pa.width;Oa.height=Pa.height;null==Oa.border&&(Oa.border=Pa.border);delete Oa.cells;delete Oa.tags;delete Oa.tagsMatch;delete Oa.layers;delete Oa.excludeCells;sa()}),Ca.appendChild(Ua))}Ua=Ea("▶",mxResources.get("preview"),!0,function(){Qa();var Pa=JSON.parse(JSON.stringify(Graph.flattenAnimationActions([ra])));E.executeCustomActions(Pa)});Ca.appendChild(Ua);return Ca};v.addEventListener("change",function(){v.checked?(x.style.display=
+"none",C.style.display="block",ba()):(C.style.display="none",x.style.display="block",K(null),Ha())});C.addEventListener("input",function(){ca(!0);try{var ra=Editor.parseAnimationData(C.value);null!=ra&&Array.isArray(ra.steps)&&(T=ra,na.clear(),wa=null,K(null),null!=z&&(z.checked=!!T.loop),null!=D&&(D.checked=!T.enabled),v.checked||Ha())}catch(va){K(Q(C.value,va))}});Ha();var vb=document.createElement("div");vb.className="geDialogSection";vb.style.cssText="margin-top:10px;margin-bottom:0;flex:0 0 auto;display:flex;flex-direction:column;gap:8px";
+var pb=document.createElement("div");pb.style.cssText="display:flex;align-items:center;gap:8px;flex-wrap:wrap";vb.appendChild(pb);var jb=document.createElement("select");jb.style.cssText="flex:1 1 200px;min-width:180px;padding:5px 6px;border:1px solid light-dark(var(--field-border-color), var(--dark-field-border-color));border-radius:4px;background:light-dark(var(--field-color), var(--dark-field-color));color:light-dark(var(--strong-text-color), var(--dark-strong-text-color));font-size:13px";var qb=
+[],Za=document.createElement("option");Za.value="";Za.disabled=!0;Za.selected=!0;var Jb=function(){Za.textContent=mxResources.get("add")+"…"};Jb();L.push(Jb);jb.appendChild(Za);for(var Ab=[{labelKey:"visibilityActions",label:"Visibility",keys:["toggle","show","hide"]},{labelKey:"effects",label:"Effects",keys:"fadeIn fadeOut fadeTo wipeIn wipeOut popIn popOut".split(" ")},{labelKey:"style",label:"Style",keys:["opacity","style","toggleStyle","highlight","flow"]},{labelKey:"navigation",label:"Navigation",
+keys:["select","scroll","viewbox","open"]},{labelKey:"tags",label:"Tags",keys:["tags"]},{labelKey:"timing",label:"Timing",keys:["wait"]}],yb=0;yb<Ab.length;yb++){var fb=document.createElement("optgroup");fb.label=mxResources.get(Ab[yb].labelKey,null,Ab[yb].label);qb.push({el:fb,prop:"label",key:Ab[yb].labelKey,fallback:Ab[yb].label});for(var ib=0;ib<Ab[yb].keys.length;ib++){var Wa=Ab[yb].keys[ib],db=CustomActionDialog.SCHEMAS[Wa];if(null!=db){var Hb=document.createElement("option");Hb.value=Wa;var ub=
+db.labelKey||Wa;Hb.textContent=mxResources.get(ub,null,db.label);qb.push({el:Hb,prop:"textContent",key:ub,fallback:db.label});fb.appendChild(Hb)}}jb.appendChild(fb)}var xb=document.createElement("optgroup");xb.label="──────";var Bb=document.createElement("option");Bb.value="__deleteAll__";Bb.className="geDeleteOpt";Bb.textContent=mxResources.get("deleteAll");qb.push({el:Bb,prop:"textContent",key:"deleteAll",fallback:"Delete All"});xb.appendChild(Bb);jb.appendChild(xb);L.push(function(){for(var ra=
+0;ra<qb.length;ra++){var va=qb[ra];va.el[va.prop]=mxResources.get(va.key,null,va.fallback)}});pb.appendChild(jb);var lb=[],Gb=function(ra,va,Ca,Ia){var La=mxResources.get(va,null,Ca);Ia=Ea("",La,!0,Ia);La=document.createElement("img");La.className="geAdaptiveAsset";La.setAttribute("src",ra);La.style.cssText="width:14px;height:14px;vertical-align:middle";Ia.appendChild(La);lb.push({el:Ia,key:va,fallback:Ca});pb.appendChild(Ia);return Ia};ya=Gb(Editor.copyImage,"copy","Copy",pa);Aa=Gb(Editor.pasteImage,
+"paste","Paste",fa);Da=Gb(Editor.duplicateImage,"duplicate","Duplicate",ka);ua=Gb(Editor.trashImage,"delete","Delete",xa);ha();L.push(function(){for(var ra=0;ra<lb.length;ra++){var va=lb[ra];va.el.title=mxResources.get(va.key,null,va.fallback)}});c.addEventListener("keydown",function(ra){var va=ra.target,Ca=null!=va&&null!=va.tagName?va.tagName.toLowerCase():"";"textarea"==Ca||"select"==Ca||"input"==Ca&&"checkbox"!=va.type||null!=va&&va.isContentEditable||(va=null!=ra.key?ra.key.toLowerCase():"",
+Ca=!1,!("delete"!=va&&"backspace"!=va||ra.metaKey||ra.ctrlKey||ra.altKey)&&0<na.size?(xa(),Ca=!0):(mxClient.IS_MAC?ra.metaKey:ra.ctrlKey)&&!ra.altKey&&("c"==va&&0<na.size&&""==window.getSelection().toString()?(pa(),Ca=!0):"v"==va&&null!=AnimationDialog.stepsClipboard&&0<AnimationDialog.stepsClipboard.length?(fa(),Ca=!0):"d"==va&&0<na.size&&(ka(),Ca=!0)),Ca&&(ra.preventDefault(),ra.stopPropagation()))});c.appendChild(vb);var Mb=function(){var ra=E.view,va=E.container,Ca=ra.scale;ra=ra.translate;return{x:Math.round(va.scrollLeft/
+Ca-ra.x),y:Math.round(va.scrollTop/Ca-ra.y),width:Math.round(va.clientWidth/Ca),height:Math.round(va.clientHeight/Ca),border:0}},Qb=function(ra,va){var Ca=CustomActionDialog.SCHEMAS[ra];if(null==Ca)return null;var Ia={};if(null!=Ca.primary){var La=Ca.primary.def;Ia[ra]=null!=La?"number"==Ca.primary.type?parseFloat(La):La:"number"==Ca.primary.type?0:""}else{La={};Ca.selector&&Array.isArray(va)&&0<va.length&&(La.cells=va.slice());if(Array.isArray(Ca.fields))for(va=0;va<Ca.fields.length;va++){var Ua=
+Ca.fields[va];null!=Ua.def&&(La[Ua.name]="number"==Ua.type?parseFloat(Ua.def):Ua.def)}"viewbox"==ra&&null==La.cells&&(Ca=Mb(),null==La.x&&(La.x=Ca.x),null==La.y&&(La.y=Ca.y),null==La.width&&(La.width=Ca.width),null==La.height&&(La.height=Ca.height),null==La.border&&(La.border=Ca.border));Ia[ra]=La}return Ia};jb.addEventListener("change",function(){var ra=jb.value;jb.value="";if(ra)if("__deleteAll__"==ra)0!=T.steps.length&&b.confirm(mxResources.get("areYouSure",null,"Are you sure?"),function(){T.steps=
+[];na.clear();wa=null;sa()});else{var va=CustomActionDialog.SCHEMAS[ra];if(null!=va){var Ca=null;va.selector&&(va=E.getSelectionCells(),Ca=0<va.length?va.map(function(Ia){return Ia.id}):"viewbox"==ra?null:[Editor.ANIMATION_ALL]);ra=Qb(ra,Ca);null!=ra&&(T.steps.push(ra),sa(),x.scrollTop=x.scrollHeight)}}});var Fa=null,Na=null,Ka=null,Ta=function(){if(null!=Ka){var ra=null!=Na;Ka.disabled=!ra;Ka.style.opacity=ra?"":"0.4";Ka.style.cursor=ra?"":"default"}},Qa=function(){null==Na&&(Na=new Editor.AnimationPlayer(E,
+T));Na.snapshotOpacity();Ta()},Ra=function(){if(null!=Na){Na.restoreOpacity();for(var ra=Na.collectReferencedCells(),va=[],Ca=0;Ca<ra.length;Ca++)E.getModel().isEdge(ra[Ca])&&va.push(ra[Ca]);0<va.length&&Editor.toggleFlowAnimation(E,va,"stop");E.refresh();Na=null;Ta()}},$a=function(){null!=Fa&&(Fa.stop(),Fa=null)},ab=document.createElement("div");ab.style.cssText="margin-top:20px;display:flex;gap:6px;flex:0 0 auto";var mb=function(ra,va){var Ca=new Set;if(null!=ra&&0<=ra)for(va=null!=va?va:ra+1;ra<
+va;ra++)Ca.add(ra);if(Ca.size===M.size){ra=!0;va=$jscomp.makeIterator(Ca);for(var Ia=va.next();!Ia.done;Ia=va.next())if(!M.has(Ia.value)){ra=!1;break}if(ra)return}M=Ca;Ca=x.querySelectorAll("[data-step-idx]");for(ra=0;ra<Ca.length;ra++)va=parseInt(Ca[ra].getAttribute("data-step-idx"),10),Ca[ra].classList.toggle("geAnimationStepActive",M.has(va))};ab.appendChild(b.createHelpIcon(ANIMATION_HELP_URL));var sb=this,zb=function(){if("page"==A){var ra=E.getModel().getRoot(),va={steps:T.steps};!1===T.loop&&
+(va.loop=!1);!1===T.enabled&&(va.enabled=!1);va=0<va.steps.length?JSON.stringify({animation:va}):null;E.setAttributeForCell(ra,"animation",va);E.setAttributeForCell(ra,"animationHideInitial",null)}else"function"==typeof y.save&&y.save(T);ca(!1)};Y=mxUtils.button(mxResources.get("preview"),function(){$a();Qa();Fa=new Editor.AnimationPlayer(E,T);Fa.snapshot=[];Fa.play({done:function(){Fa=null;mb(-1)},onStep:function(ra,va){mb(ra,va)}})});Y.className="geBtn";L.push(function(){Y.textContent=mxResources.get("preview");
+Y.title=mxResources.get("preview")});Y.title=mxResources.get("preview");ab.appendChild(Y);var Eb=mxUtils.button(mxResources.get("reset"),function(){$a();mb(-1);Ra()});Eb.className="geBtn";L.push(function(){var ra=mxResources.get("reset");Eb.textContent=ra;Eb.title=ra});Eb.title=mxResources.get("reset");Ka=Eb;Ta();ab.appendChild(Eb);V=document.createElement("span");V.style.flex="1 1 auto";ab.appendChild(V);var hb=mxUtils.button(mxResources.get("cancel"),function(){da?Ob():sb.window.setVisible(!1)});
+hb.className="geBtn";L.push(function(){hb.textContent=mxResources.get("cancel");hb.title=mxResources.get("cancel")});hb.title=mxResources.get("cancel");ab.appendChild(hb);R=mxUtils.button(mxResources.get("save"),function(){v.checked&&!G?(ba(),C.focus()):(zb(),sb.window.setVisible(!1))});R.className="geBtn gePrimaryBtn";L.push(function(){R.textContent=mxResources.get("save");R.title=mxResources.get("save")});R.title=mxResources.get("save");ab.appendChild(R);c.appendChild(ab);this.window=new mxWindow(O(),
+c,l,p,g,u,!0,!0);this.window.minimumSize=new mxRectangle(0,0,360,360);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);var Fb=function(){"function"==typeof J.closePopover&&J.closePopover()};this.window.addListener(mxEvent.MOVE,Fb);this.window.addListener(mxEvent.RESIZE,Fb);var Ya=function(){for(var ra=0;ra<L.length;ra++)try{L[ra]()}catch(va){}null!=sb.window&&null!=sb.window.title&&(sb.window.title.innerHTML=mxUtils.htmlEntities(O()));
+Ha()};b.addListener("languageChanged",Ya);this.window.addListener(mxEvent.DESTROY,function(){b.removeListener(Ya)});var Ob=function(){b.confirm(mxResources.get("allChangesLost"),null,function(){ca(!1);sb.window.setVisible(!1)},mxResources.get("cancel"),mxResources.get("discardChanges"))};this.requestClose=function(ra){da?b.confirm(mxResources.get("allChangesLost"),null,function(){ca(!1);sb.window.setVisible(!1);null!=ra&&ra()},mxResources.get("cancel"),mxResources.get("discardChanges")):(sb.window.setVisible(!1),
+null!=ra&&ra())};var Kb=sb.window.setVisible.bind(sb.window);sb.window.setVisible=function(ra){!1===ra&&da&&zb();Kb(ra)};this.window.addListener("hide",function(){$a();mb(-1);Ra()});"page"==A&&E.addListener(mxEvent.ROOT,function(){var ra=E.getModel().getRoot();if(ra!=Z){if(da){var va={steps:T.steps};!1===T.loop&&(va.loop=!1);!1===T.enabled&&(va.enabled=!1);va=0<T.steps.length?JSON.stringify({animation:va}):null;E.setAttributeForCell(Z,"animation",va)}Z=ra;X();ca(!1);na.clear();wa=null;Ha();$a()}});
+var Nb=function(){ca(!1);sb.window.setVisible(!1)};b.editor.addListener("fileLoaded",Nb);this.window.addListener(mxEvent.DESTROY,function(){b.editor.removeListener(Nb)});installDialogDocking(b,this);this.window.setVisible(!0);window.setTimeout(mxUtils.bind(this,function(){null==this.window||null==this.window.div||this.window.minimized||null!=this.window.dockState||this.window.setLocation(this.window.getX(),this.window.getY())}),0)};AnimationDialog.stepsClipboard=null;
+AnimationDialog.styleKeyListCount=0;
+AnimationDialog.STYLE_KEYS=[{key:"strokeWidth",label:"linewidth",fallback:"Linewidth"},{key:"strokeColor",label:"strokeColor",fallback:"Line Color"},{key:"fillColor",label:"fillColor",fallback:"Fill Color"},{key:"gradientColor",label:"gradient",fallback:"Gradient"},{key:"opacity",label:"opacity",fallback:"Opacity"},{key:"fontColor",label:"fontColor",fallback:"Font Color"},{key:"fontSize",label:"fontSize",fallback:"Font Size"},{key:"fontFamily",label:"fontFamily",fallback:"Font Family"},{key:"fontStyle",
+label:function(){return mxResources.get("font")+": 1 "+mxResources.get("bold")+", 2 "+mxResources.get("italic")+", 4 "+mxResources.get("underline")}},{key:"textOpacity",label:"textOpacity",fallback:"Text Opacity"},{key:"labelBackgroundColor",label:"backgroundColor",fallback:"Background Color"},{key:"labelBorderColor",label:"borderColor",fallback:"Border Color"},{key:"align",label:"align",fallback:"Align"},{key:"spacing",label:"spacing",fallback:"Spacing"},{key:"dashed",label:"dashed",fallback:"Dashed"},
+{key:"rounded",label:"rounded",fallback:"Rounded"},{key:"curved",label:"curved",fallback:"Curved"},{key:"startArrow",label:"linestart",fallback:"Line Start"},{key:"endArrow",label:"lineend",fallback:"Line End"},{key:"flowAnimation",label:"flowAnimation",fallback:"Flow Animation"},{key:"shadow",label:"shadow",fallback:"Shadow"},{key:"glass",label:"glass",fallback:"Glass"},{key:"sketch",label:"sketch",fallback:"Sketch"},{key:"comic",label:"comic",fallback:"Comic"},{key:"rotation",label:"rotation",fallback:"Rotation"},
+{key:"perimeterSpacing",label:"perimeter",fallback:"Perimeter"}];AnimationDialog.getStylePairs=function(b){var l=[];b=null!=b?String(b).split(";"):[];for(var p=0;p<b.length;p++){var g=b[p].indexOf("=");0<g&&l.push({key:b[p].substring(0,g),value:b[p].substring(g+1)})}return l};
var CustomGitLabUrlWarningDialog=function(b,l){var p=document.createElement("div"),g=document.createElement("h3");mxUtils.write(g,mxResources.get("customGitlabUrlTitle"));p.appendChild(g);g=document.createElement("p");mxUtils.write(g,mxResources.get("customGitlabUrlWarning"));p.appendChild(g);g=document.createElement("p");var u=document.createElement("strong");mxUtils.write(u,mxResources.get("customGitlabUrlServer")+" ");g.appendChild(u);u=document.createElement("code");mxUtils.write(u,l);g.appendChild(u);
p.appendChild(g);l=document.createElement("p");g=document.createElement("a");g.setAttribute("href","https://github.com/jgraph/drawio/issues/493");g.setAttribute("target","_blank");g.setAttribute("rel","noopener noreferrer");mxUtils.write(g,mxResources.get("customGitlabUrlLearnMore"));l.appendChild(g);p.appendChild(l);this.container=(new CustomDialog(b,p,null,null,mxResources.get("close"),null,null,!0)).container},AuthDialog=function(b,l,p,g){var u=document.createElement("div");u.style.textAlign="center";
var y=document.createElement("p");y.style.fontSize="16pt";y.style.padding="0px";y.style.margin="0px";y.style.color="gray";mxUtils.write(y,mxResources.get("authorizationRequired"));var A="Unknown",E=document.createElement("img");E.setAttribute("border","0");E.setAttribute("align","absmiddle");E.style.marginRight="10px";l==b.drive?(A=mxResources.get("googleDrive"),E.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(A=mxResources.get("dropbox"),E.src=IMAGE_PATH+"/dropbox-logo-white.svg"):
@@ -13584,10 +13594,10 @@ mxEvent.addListener(this.container,"keypress",function(r){13==r.keyCode&&(t(),b.
"pointer";R.style.whiteSpace="nowrap";R.style.textOverflow="ellipsis";mxUtils.write(R,null!=Y.title&&0<Y.title.length?Y.title:mxResources.get("untitled"));R.style.color=null==Y.title||0==Y.title.length?"#d0d0d0":""};t.style.backgroundImage="";r.style.display="none";var K=d,Q=m;if(d>b.maxImageSize||m>b.maxImageSize){var ba=Math.min(1,Math.min(b.maxImageSize/Math.max(1,d)),b.maxImageSize/Math.max(1,m));d*=ba;m*=ba}K>Q?(Q=Math.round(100*Q/K),K=100):(K=Math.round(100*K/Q),Q=100);var T=document.createElement("div");
T.setAttribute("draggable","true");T.style.display="inline-block";T.style.position="relative";T.style.padding="0 12px";T.style.cursor="move";mxUtils.setPrefixedStyle(T.style,"transition","transform .1s ease-in-out");if(null!=S){var Z=document.createElement("img");Z.setAttribute("src",W.convert(S));Z.style.width=K+"px";Z.style.height=Q+"px";Z.style.margin="10px";Z.style.paddingBottom=Math.floor((100-Q)/2)+"px";Z.style.paddingLeft=Math.floor((100-K)/2)+"px";T.appendChild(Z)}else if(null!=x){var X=b.stringToCells("<"==
x.xml.charAt(0)?x.xml:Graph.decompress(x.xml));0<X.length&&(b.sidebar.createThumb(X,100,100,T,null,!0,!1,null,null,c.shapeBackgroundColor),T.firstChild.style.display="inline-block",T.firstChild.style.cursor="")}var da=document.createElement("img");da.setAttribute("src",Editor.closeBlackImage);da.setAttribute("border","0");da.setAttribute("title",mxResources.get("delete"));da.setAttribute("align","top");da.style.paddingTop="4px";da.style.position="absolute";da.style.marginLeft="-12px";da.style.zIndex=
-"1";da.style.cursor="pointer";mxEvent.addListener(da,"dragstart",function(oa){mxEvent.consume(oa)});(function(oa,ra,ta){mxEvent.addListener(da,"click",function(na){z[ra]=null;for(var wa=0;wa<O.length;wa++)if(null!=O[wa].data&&O[wa].data==ra||null!=O[wa].xml&&null!=ta&&O[wa].xml==ta.xml){O.splice(wa,1);break}T.parentNode.removeChild(oa);0==O.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",r.style.display="");mxEvent.consume(na)});mxEvent.addListener(da,"dblclick",function(na){mxEvent.consume(na)})})(T,
+"1";da.style.cursor="pointer";mxEvent.addListener(da,"dragstart",function(oa){mxEvent.consume(oa)});(function(oa,sa,ta){mxEvent.addListener(da,"click",function(na){z[sa]=null;for(var wa=0;wa<O.length;wa++)if(null!=O[wa].data&&O[wa].data==sa||null!=O[wa].xml&&null!=ta&&O[wa].xml==ta.xml){O.splice(wa,1);break}T.parentNode.removeChild(oa);0==O.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",r.style.display="");mxEvent.consume(na)});mxEvent.addListener(da,"dblclick",function(na){mxEvent.consume(na)})})(T,
S,x);T.appendChild(da);T.style.marginBottom="30px";var R=document.createElement("div");R.style.position="absolute";R.style.boxSizing="border-box";R.style.bottom="-18px";R.style.left="10px";R.style.right="10px";R.style.backgroundColor="light-dark(#ffffff, transparent)";R.style.overflow="hidden";R.style.textAlign="center";R.setAttribute("title",mxResources.get("rename"));var Y=null;null!=S?(Y={data:S,w:d,h:m,title:F},null!=C&&(Y.aspect=C),z[S]=Z,O.push(Y)):null!=x&&(x.aspect="fixed",O.push(x),Y=x);
-mxEvent.addListener(R,"keydown",function(oa){13==oa.keyCode&&null!=B&&(B(),B=null,mxEvent.consume(oa))});G();T.appendChild(R);mxEvent.addListener(R,"mousedown",function(oa){"true"!=R.getAttribute("contentEditable")&&mxEvent.consume(oa)});X=function(oa){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ra=new FilenameDialog(b,Y.title||"",mxResources.get("ok"),function(ta){null!=ta&&(Y.title=ta,G())},mxResources.get("enterValue"));b.showDialog(ra.container,
-300,80,!0,!0);ra.init();mxEvent.consume(oa)}else if("true"!=R.getAttribute("contentEditable")){null!=B&&(B(),B=null);if(null==Y.title||0==Y.title.length)R.innerText="";R.style.textOverflow="";R.style.whiteSpace="";R.style.cursor="text";R.style.color="";R.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(R.style,"user-select","text");R.focus();document.execCommand("selectAll",!1,null);B=function(){R.removeAttribute("contentEditable");R.style.cursor="pointer";Y.title=mxUtils.getTextContent(R);
+mxEvent.addListener(R,"keydown",function(oa){13==oa.keyCode&&null!=B&&(B(),B=null,mxEvent.consume(oa))});G();T.appendChild(R);mxEvent.addListener(R,"mousedown",function(oa){"true"!=R.getAttribute("contentEditable")&&mxEvent.consume(oa)});X=function(oa){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var sa=new FilenameDialog(b,Y.title||"",mxResources.get("ok"),function(ta){null!=ta&&(Y.title=ta,G())},mxResources.get("enterValue"));b.showDialog(sa.container,
+300,80,!0,!0);sa.init();mxEvent.consume(oa)}else if("true"!=R.getAttribute("contentEditable")){null!=B&&(B(),B=null);if(null==Y.title||0==Y.title.length)R.innerText="";R.style.textOverflow="";R.style.whiteSpace="";R.style.cursor="text";R.style.color="";R.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(R.style,"user-select","text");R.focus();document.execCommand("selectAll",!1,null);B=function(){R.removeAttribute("contentEditable");R.style.cursor="pointer";Y.title=mxUtils.getTextContent(R);
G()};mxEvent.consume(oa)}};mxEvent.addListener(R,"click",X);mxEvent.addListener(T,"dblclick",X);t.appendChild(T);mxEvent.addListener(T,"dragstart",function(oa){null==B&&(null==S&&null!=x&&(da.style.visibility="hidden",R.style.visibility="hidden"),mxClient.IS_FF&&null!=x.xml&&oa.dataTransfer.setData("Text",x.xml),D=E(oa),mxClient.IS_GC&&(T.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(T.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(T,30);da.style.visibility="";
R.style.visibility=""},0))});mxEvent.addListener(T,"dragend",function(oa){"hidden"==da.style.visibility&&(da.style.visibility="",R.style.visibility="");D=null;mxUtils.setOpacity(T,100);mxUtils.setPrefixedStyle(T.style,"transform",null)})}else I||(I=!0,b.handleError({message:mxResources.get("fileExists")}));else{d=!1;try{if(K=mxUtils.parseXml(S),"mxlibrary"==K.documentElement.nodeName){Q=JSON.parse(mxUtils.getTextContent(K.documentElement));if(null!=Q&&0<Q.length)for(var ca=0;ca<Q.length;ca++)null!=
Q[ca].xml?J(null,null,0,0,0,0,Q[ca]):J(Q[ca].data,null,0,0,Q[ca].w,Q[ca].h,null,"fixed",Q[ca].title);d=!0}else if("mxfile"==K.documentElement.nodeName){var P=K.documentElement.getElementsByTagName("diagram");for(ca=0;ca<P.length;ca++){var aa=Editor.getDiagramNodeXml(P[ca]);X=b.stringToCells(aa);if(0<X.length){var ea=b.editor.graph.getBoundingBoxFromGeometry(X);null!=ea&&J(null,null,0,0,0,0,{xml:aa,w:ea.width,h:ea.height})}}d=!0}}catch(oa){null!=window.console&&console.error("Error in library dialog: "+
@@ -13675,8 +13685,8 @@ k[0].cx-5),ka.setAttribute("y",k[0].cy-5),ka.setAttribute("width",10),ka.setAttr
qa.appendChild(fa)}else for(fa=0;fa<k.length;fa++)(function(ka){var xa=document.createElement("div");xa.style.display="flex";xa.style.alignItems="center";xa.style.padding="2px 4px";xa.style.gap="4px";xa.style.borderRadius="3px";xa.style.marginBottom="2px";xa.style.fontSize="12px";xa.setAttribute("draggable","true");xa.setAttribute("data-idx",ka);ka===n&&(xa.style.backgroundColor="rgba(66, 133, 244, 0.15)");xa.style.cursor="pointer";mxEvent.addListener(xa,"click",function(){n=ka;O()});var Ba=document.createElement("span");
Ba.innerHTML="&#9776;";Ba.style.cursor="grab";Ba.style.fontSize="11px";Ba.style.opacity="0.4";Ba.style.flexShrink="0";xa.appendChild(Ba);Ba=document.createElement("span");Ba.style.minWidth="18px";Ba.style.fontWeight="bold";mxUtils.write(Ba,ka+1+"");xa.appendChild(Ba);Ba=document.createElement("input");Ba.type="number";Ba.value=Math.round(k[ka].x);Ba.style.width="48px";Ba.style.fontSize="11px";Ba.style.padding="1px 3px";Ba.title="X";mxEvent.addListener(Ba,"change",function(){E();k[ka].x=parseInt(this.value)||
0;O()});mxEvent.addListener(Ba,"click",function(la){la.stopPropagation()});xa.appendChild(Ba);Ba=document.createElement("input");Ba.type="number";Ba.value=Math.round(k[ka].y);Ba.style.width="48px";Ba.style.fontSize="11px";Ba.style.padding="1px 3px";Ba.title="Y";mxEvent.addListener(Ba,"change",function(){E();k[ka].y=parseInt(this.value)||0;O()});mxEvent.addListener(Ba,"click",function(la){la.stopPropagation()});xa.appendChild(Ba);if(0<ka||0===ka&&q&&2<k.length){Ba=document.createElement("label");Ba.style.display=
-"flex";Ba.style.alignItems="center";Ba.style.cursor="pointer";Ba.style.flexShrink="0";Ba.title=mxResources.get("curved");var ma=document.createElement("input");ma.type="checkbox";ma.checked="Q"===k[ka].type;ma.style.margin="0";mxEvent.addListener(ma,"click",function(la){la.stopPropagation()});mxEvent.addListener(ma,"change",function(){E();if("Q"===k[ka].type)k[ka].type="L",delete k[ka].cx,delete k[ka].cy;else{var la=0<ka?k[ka-1]:k[k.length-1];var Ea=k[ka];var Fa=(la.x+Ea.x)/2;var Ia=(la.y+Ea.y)/2;
-var Ha=Ea.x-la.x,Ma=Ea.y-la.y;la=Math.sqrt(Ha*Ha+Ma*Ma);0!==la&&(Ea=.25*la,Fa=Math.round(Fa+-Ma/la*Ea),Ia=Math.round(Ia+Ha/la*Ea));k[ka].type="Q";k[ka].cx=Fa;k[ka].cy=Ia}O()});Ba.appendChild(ma);xa.appendChild(Ba)}Ba=document.createElement("img");Ba.setAttribute("src",Editor.trashImage);Ba.style.cursor="pointer";Ba.style.marginLeft="auto";Ba.style.width="14px";Ba.style.height="14px";Ba.style.opacity="0.5";Ba.style.flexShrink="0";Ba.title=mxResources.get("delete");Editor.isDarkMode()&&(Ba.style.filter=
+"flex";Ba.style.alignItems="center";Ba.style.cursor="pointer";Ba.style.flexShrink="0";Ba.title=mxResources.get("curved");var ma=document.createElement("input");ma.type="checkbox";ma.checked="Q"===k[ka].type;ma.style.margin="0";mxEvent.addListener(ma,"click",function(la){la.stopPropagation()});mxEvent.addListener(ma,"change",function(){E();if("Q"===k[ka].type)k[ka].type="L",delete k[ka].cx,delete k[ka].cy;else{var la=0<ka?k[ka-1]:k[k.length-1];var Ea=k[ka];var Ga=(la.x+Ea.x)/2;var Ja=(la.y+Ea.y)/2;
+var Ha=Ea.x-la.x,Ma=Ea.y-la.y;la=Math.sqrt(Ha*Ha+Ma*Ma);0!==la&&(Ea=.25*la,Ga=Math.round(Ga+-Ma/la*Ea),Ja=Math.round(Ja+Ha/la*Ea));k[ka].type="Q";k[ka].cx=Ga;k[ka].cy=Ja}O()});Ba.appendChild(ma);xa.appendChild(Ba)}Ba=document.createElement("img");Ba.setAttribute("src",Editor.trashImage);Ba.style.cursor="pointer";Ba.style.marginLeft="auto";Ba.style.width="14px";Ba.style.height="14px";Ba.style.opacity="0.5";Ba.style.flexShrink="0";Ba.title=mxResources.get("delete");Editor.isDarkMode()&&(Ba.style.filter=
"invert(1)");mxEvent.addListener(Ba,"click",function(la){la.stopPropagation();E();k.splice(ka,1);n>=k.length&&(n=k.length-1);O()});xa.appendChild(Ba);mxEvent.addListener(xa,"dragstart",function(la){F=ka;xa.style.opacity="0.4";la.dataTransfer.effectAllowed="move";la.dataTransfer.setData("text/plain",""+ka);la.stopPropagation()});mxEvent.addListener(xa,"dragover",function(la){la.preventDefault();la.stopPropagation();la.dataTransfer.dropEffect="move";la=parseInt(xa.getAttribute("data-idx"));null!==F&&
la!==F&&(xa.style.borderTop=la<F?"2px solid #4285f4":"",xa.style.borderBottom=la>F?"2px solid #4285f4":"")});mxEvent.addListener(xa,"dragleave",function(la){xa.style.borderTop="";xa.style.borderBottom=""});mxEvent.addListener(xa,"drop",function(la){la.preventDefault();la.stopPropagation();xa.style.borderTop="";xa.style.borderBottom="";var Ea=parseInt(xa.getAttribute("data-idx"));null!==F&&Ea!==F&&(E(),la=k.splice(F,1)[0],Ea=Ea>F?Ea-1:Ea,k.splice(Ea,0,la),n===F?n=Ea:F<n&&Ea>=n?n--:F>n&&Ea<=n&&n++,
O());F=null});mxEvent.addListener(xa,"dragend",function(la){xa.style.opacity="";xa.style.borderTop="";xa.style.borderBottom="";F=null});qa.appendChild(xa)})(fa)}var f=b.editor.graph,k=[],n=-1,q=!0,t=!0,r=[],z=[],D=-1,H=null,B=!1,W=!1,I=0,N=0,U=400,S=400,V=1,ja=!1,v=0,d=0,m=0,x=0,C=!1,F=null,G=f.view.getState(l);if(null!=G)try{var K=JSON.parse(mxUtils.getValue(G.style,"polyCoords","[]")),Q=JSON.parse(mxUtils.getValue(G.style,"polyCurves","[]")),ba=mxUtils.getValue(G.style,"polyline",0);q=!(1==ba||
@@ -13686,10 +13696,10 @@ Z.style.userSelect="none";Z.setAttribute("tabindex","0");Z.style.outline="none";
G="polygonGrid_"+Date.now();T.setAttribute("id",G);T.setAttribute("width",20);T.setAttribute("height",20);T.setAttribute("patternUnits","userSpaceOnUse");ba=document.createElementNS("http://www.w3.org/2000/svg","path");ba.setAttribute("d","M 20 0 L 0 0 0 20");ba.setAttribute("fill","none");ba.setAttribute("stroke","#e0e0e0");ba.setAttribute("stroke-width","0.5");T.appendChild(ba);Q.appendChild(T);da.appendChild(Q);var R=document.createElementNS("http://www.w3.org/2000/svg","rect");R.setAttribute("x",
"-5000");R.setAttribute("y","-5000");R.setAttribute("width","10000");R.setAttribute("height","10000");R.setAttribute("fill","url(#"+G+")");da.appendChild(R);var Y=document.createElementNS("http://www.w3.org/2000/svg","path");Y.setAttribute("fill","rgba(66, 133, 244, 0.1)");Y.setAttribute("stroke","#4285f4");Y.setAttribute("stroke-width","2");da.appendChild(Y);var ca=document.createElementNS("http://www.w3.org/2000/svg","g");da.appendChild(ca);var P=document.createElementNS("http://www.w3.org/2000/svg",
"g");da.appendChild(P);var aa=document.createElementNS("http://www.w3.org/2000/svg","g");da.appendChild(aa);X.appendChild(da);var ea=document.createElement("div");ea.style.position="absolute";ea.style.bottom="0px";ea.style.left="0px";ea.style.right="12px";ea.style.height="12px";ea.style.backgroundColor="rgba(128,128,128,0.08)";var oa=document.createElement("div");oa.style.position="absolute";oa.style.top="2px";oa.style.height="8px";oa.style.borderRadius="4px";oa.style.backgroundColor="rgba(128,128,128,0.35)";
-oa.style.cursor="pointer";oa.style.minWidth="20px";ea.appendChild(oa);X.appendChild(ea);var ra=document.createElement("div");ra.style.position="absolute";ra.style.top="0px";ra.style.right="0px";ra.style.bottom="12px";ra.style.width="12px";ra.style.backgroundColor="rgba(128,128,128,0.08)";var ta=document.createElement("div");ta.style.position="absolute";ta.style.left="2px";ta.style.width="8px";ta.style.borderRadius="4px";ta.style.backgroundColor="rgba(128,128,128,0.35)";ta.style.cursor="pointer";ta.style.minHeight=
-"20px";ra.appendChild(ta);X.appendChild(ra);var na=!1,wa=!1,ya=0,Aa=0;mxEvent.addListener(oa,"mousedown",function(fa){na=!0;ya=fa.clientX;Aa=I;fa.preventDefault();fa.stopPropagation()});mxEvent.addListener(ta,"mousedown",function(fa){wa=!0;ya=fa.clientY;Aa=N;fa.preventDefault();fa.stopPropagation()});mxEvent.addListener(ea,"mousedown",function(fa){if(fa.target===ea){var ka=ea.getBoundingClientRect().width,xa=fa.clientX-ea.getBoundingClientRect().left,Ba=1200-U;0<Ba&&(I=-400+xa/ka*Ba,u());fa.preventDefault();
-fa.stopPropagation()}});mxEvent.addListener(ra,"mousedown",function(fa){if(fa.target===ra){var ka=ra.getBoundingClientRect().height,xa=fa.clientY-ra.getBoundingClientRect().top,Ba=1200-S;0<Ba&&(N=-400+xa/ka*Ba,u());fa.preventDefault();fa.stopPropagation()}});var Ca=function(fa){if(na){var ka=X.getBoundingClientRect().width-12,xa=parseFloat(oa.style.width)||20,Ba=1200-U;ka>xa&&0<Ba&&(I=Aa+(fa.clientX-ya)/(ka-xa)*Ba,u());fa.preventDefault()}wa&&(ka=X.getBoundingClientRect().height-12,xa=parseFloat(ta.style.height)||
-20,Ba=1200-S,ka>xa&&0<Ba&&(N=Aa+(fa.clientY-ya)/(ka-xa)*Ba,u()),fa.preventDefault())},ua=function(fa){wa=na=!1};mxEvent.addListener(document,"mousemove",Ca);mxEvent.addListener(document,"mouseup",ua);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var fa=da.getBoundingClientRect();if(0<fa.width&&0<fa.height){var ka=I+U/2,xa=N+S/2;U=fa.width*V;S=fa.height*V;I=ka-U/2;N=xa-S/2;u()}})).observe(X);var qa=document.createElement("div");qa.style.width="200px";qa.style.flexShrink="0";qa.style.overflowY=
+oa.style.cursor="pointer";oa.style.minWidth="20px";ea.appendChild(oa);X.appendChild(ea);var sa=document.createElement("div");sa.style.position="absolute";sa.style.top="0px";sa.style.right="0px";sa.style.bottom="12px";sa.style.width="12px";sa.style.backgroundColor="rgba(128,128,128,0.08)";var ta=document.createElement("div");ta.style.position="absolute";ta.style.left="2px";ta.style.width="8px";ta.style.borderRadius="4px";ta.style.backgroundColor="rgba(128,128,128,0.35)";ta.style.cursor="pointer";ta.style.minHeight=
+"20px";sa.appendChild(ta);X.appendChild(sa);var na=!1,wa=!1,ya=0,Aa=0;mxEvent.addListener(oa,"mousedown",function(fa){na=!0;ya=fa.clientX;Aa=I;fa.preventDefault();fa.stopPropagation()});mxEvent.addListener(ta,"mousedown",function(fa){wa=!0;ya=fa.clientY;Aa=N;fa.preventDefault();fa.stopPropagation()});mxEvent.addListener(ea,"mousedown",function(fa){if(fa.target===ea){var ka=ea.getBoundingClientRect().width,xa=fa.clientX-ea.getBoundingClientRect().left,Ba=1200-U;0<Ba&&(I=-400+xa/ka*Ba,u());fa.preventDefault();
+fa.stopPropagation()}});mxEvent.addListener(sa,"mousedown",function(fa){if(fa.target===sa){var ka=sa.getBoundingClientRect().height,xa=fa.clientY-sa.getBoundingClientRect().top,Ba=1200-S;0<Ba&&(N=-400+xa/ka*Ba,u());fa.preventDefault();fa.stopPropagation()}});var Da=function(fa){if(na){var ka=X.getBoundingClientRect().width-12,xa=parseFloat(oa.style.width)||20,Ba=1200-U;ka>xa&&0<Ba&&(I=Aa+(fa.clientX-ya)/(ka-xa)*Ba,u());fa.preventDefault()}wa&&(ka=X.getBoundingClientRect().height-12,xa=parseFloat(ta.style.height)||
+20,Ba=1200-S,ka>xa&&0<Ba&&(N=Aa+(fa.clientY-ya)/(ka-xa)*Ba,u()),fa.preventDefault())},ua=function(fa){wa=na=!1};mxEvent.addListener(document,"mousemove",Da);mxEvent.addListener(document,"mouseup",ua);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var fa=da.getBoundingClientRect();if(0<fa.width&&0<fa.height){var ka=I+U/2,xa=N+S/2;U=fa.width*V;S=fa.height*V;I=ka-U/2;N=xa-S/2;u()}})).observe(X);var qa=document.createElement("div");qa.style.width="200px";qa.style.flexShrink="0";qa.style.overflowY=
"auto";qa.style.border="1px solid";qa.style.borderColor="inherit";qa.style.borderRadius="4px";qa.style.padding="4px";K.appendChild(qa);mxEvent.addGestureListeners(da,function(fa){if(!C&&1!==fa.button&&2!==fa.button){var ka=A(fa);if(null!=ka)D=ka.index,H=ka.type,B=!0,W=!1,n=ka.index;else{ka=y(fa);E();if(2>k.length)k.push({x:ka.x,y:ka.y,type:"L"}),n=k.length-1;else{for(var xa=Infinity,Ba=k.length-1,ma=q?k.length:k.length-1,la=0;la<ma;la++){var Ea=(la+1)%k.length;Ea=mxUtils.ptSegDistSq(k[la].x,k[la].y,
k[Ea].x,k[Ea].y,ka.x,ka.y);Ea<xa&&(xa=Ea,Ba=la)}k.splice(Ba+1,0,{x:ka.x,y:ka.y,type:"L"});n=Ba+1}D=n;H="vertex";W=B=!0}O();mxEvent.consume(fa)}},function(fa){if(B&&0<=D&&D<k.length){W||(E(),W=!0);var ka=y(fa);"control"===H?(k[D].cx=ka.x,k[D].cy=ka.y):(k[D].x=ka.x,k[D].y=ka.y);O();mxEvent.consume(fa)}},function(fa){!C&&1!==fa.button&&2!==fa.button&&B&&0<=D&&(B=!1,D=-1,H=null,mxEvent.consume(fa))});mxEvent.addListener(da,"wheel",function(fa){fa.preventDefault();var ka=da.getBoundingClientRect(),xa=
(fa.clientX-ka.left)/ka.width,Ba=(fa.clientY-ka.top)/ka.height,ma=I+xa*U,la=N+Ba*S;V=Math.max(.05,Math.min(5,V*(0<fa.deltaY?1.15:1/1.15)));U=ka.width*V;S=ka.height*V;I=ma-xa*U;N=la-Ba*S;u()});mxEvent.addListener(da,"contextmenu",function(fa){fa.preventDefault()});mxEvent.addListener(da,"mousedown",function(fa){if(1===fa.button||2===fa.button||0===fa.button&&C)ja=!0,v=fa.clientX,d=fa.clientY,m=I,x=N,da.style.cursor="grabbing",fa.preventDefault()});var ha=function(fa){if(ja){var ka=da.getBoundingClientRect();
@@ -13699,10 +13709,10 @@ V)if(0<k.length){for(var ka=k[0].x,xa=k[0].y,Ba=k[0].x,ma=k[0].y,la=1;la<k.lengt
V,S=fa.height*V,I=(400-U)/2,N=(400-S)/2;u()}});K.appendChild(Q);Q=mxUtils.button(mxResources.get("deleteAll"),function(){0<k.length&&(E(),k=[],n=-1,O())});Q.className="geBtn";Q.style.padding="2px 10px";Q.style.fontSize="12px";K.appendChild(Q);Q=document.createElement("span");Q.style.flexGrow="1";K.appendChild(Q);Q=document.createElement("label");Q.style.display="flex";Q.style.alignItems="center";Q.style.gap="4px";Q.style.fontSize="12px";Q.style.cursor="pointer";Q.style.whiteSpace="nowrap";T=document.createElement("input");
T.type="checkbox";T.checked=t;mxEvent.addListener(T,"change",function(){t=this.checked;R.style.display=t?"":"none"});Q.appendChild(T);mxUtils.write(Q,mxResources.get("grid"));K.appendChild(Q);Q=document.createElement("label");Q.style.display="flex";Q.style.alignItems="center";Q.style.gap="4px";Q.style.fontSize="12px";Q.style.cursor="pointer";Q.style.whiteSpace="nowrap";T=document.createElement("input");T.type="checkbox";T.checked=q;mxEvent.addListener(T,"change",function(){q=this.checked;O()});Q.appendChild(T);
mxUtils.write(Q,mxResources.get("closePath"));K.appendChild(Q);Q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});Q.className="geBtn";T=mxUtils.button(mxResources.get("apply"),function(){if(2>k.length)b.showError(mxResources.get("error"),mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var fa=k[0].x,ka=k[0].x,xa=k[0].y,Ba=k[0].y,ma=0;ma<k.length;ma++)fa=Math.min(fa,k[ma].x),ka=Math.max(ka,k[ma].x),xa=Math.min(xa,k[ma].y),Ba=Math.max(Ba,k[ma].y),"Q"===k[ma].type&&
-(fa=Math.min(fa,k[ma].cx),ka=Math.max(ka,k[ma].cx),xa=Math.min(xa,k[ma].cy),Ba=Math.max(Ba,k[ma].cy));var la=ka-fa,Ea=Ba-xa,Fa=function(Ha){return 0<la?Math.round((Ha-fa)/la*1E5)/1E5:.5},Ia=function(Ha){return 0<Ea?Math.round((Ha-xa)/Ea*1E5)/1E5:.5};ka=[];Ba=[];for(ma=0;ma<k.length;ma++)ka.push([Fa(k[ma].x),Ia(k[ma].y)]),0<ma&&("Q"===k[ma].type?Ba.push(["Q",Fa(k[ma].cx),Ia(k[ma].cy)]):Ba.push([]));q&&2<k.length&&"Q"===k[0].type&&Ba.push(["Q",Fa(k[0].cx),Ia(k[0].cy)]);if(null!=p)ma="shape=mxgraph.basic.polygon;polyCoords="+
+(fa=Math.min(fa,k[ma].cx),ka=Math.max(ka,k[ma].cx),xa=Math.min(xa,k[ma].cy),Ba=Math.max(Ba,k[ma].cy));var la=ka-fa,Ea=Ba-xa,Ga=function(Ha){return 0<la?Math.round((Ha-fa)/la*1E5)/1E5:.5},Ja=function(Ha){return 0<Ea?Math.round((Ha-xa)/Ea*1E5)/1E5:.5};ka=[];Ba=[];for(ma=0;ma<k.length;ma++)ka.push([Ga(k[ma].x),Ja(k[ma].y)]),0<ma&&("Q"===k[ma].type?Ba.push(["Q",Ga(k[ma].cx),Ja(k[ma].cy)]):Ba.push([]));q&&2<k.length&&"Q"===k[0].type&&Ba.push(["Q",Ga(k[0].cx),Ja(k[0].cy)]);if(null!=p)ma="shape=mxgraph.basic.polygon;polyCoords="+
JSON.stringify(ka)+";polyCurves="+JSON.stringify(Ba)+";polyline="+(q?"0":"1")+";whiteSpace=wrap;html=1;",p(ma);else{ma=f.getCellGeometry(l);null!=ma&&(ma=ma.clone(),0<la&&(ma.x+=fa/400*ma.width,ma.width*=la/400),0<Ea&&(ma.y+=xa/400*ma.height,ma.height*=Ea/400));f.getModel().beginUpdate();try{null!=ma&&f.getModel().setGeometry(l,ma),f.setCellStyles("polyCoords",JSON.stringify(ka),[l]),f.setCellStyles("polyCurves",JSON.stringify(Ba),[l]),f.setCellStyles("polyline",q?"0":"1",[l])}finally{f.getModel().endUpdate()}}b.hideDialog()}});
T.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(K.appendChild(Q),K.appendChild(T)):(K.appendChild(T),K.appendChild(Q));Z.appendChild(K);mxEvent.addListener(Z,"keydown",function(fa){32===fa.keyCode?(C||(C=!0,da.style.cursor="grab"),mxEvent.consume(fa)):46===fa.keyCode||8===fa.keyCode?0<=n&&n<k.length&&"INPUT"!==fa.target.tagName&&(E(),k.splice(n,1),n>=k.length&&(n=k.length-1),O(),mxEvent.consume(fa)):90===fa.keyCode&&(fa.ctrlKey||fa.metaKey)?(fa.shiftKey?M():J(),mxEvent.consume(fa)):89===fa.keyCode&&
-(fa.ctrlKey||fa.metaKey)&&(M(),mxEvent.consume(fa))});mxEvent.addListener(Z,"keyup",function(fa){32===fa.keyCode&&(C=!1,ja||(da.style.cursor="crosshair"))});O();L();this.init=function(){Z.focus();var fa=da.getBoundingClientRect();0<fa.width&&0<fa.height&&(V=1,U=fa.width*V,S=fa.height*V,I=(400-U)/2,N=(400-S)/2,u())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",Ca);mxEvent.removeListener(document,"mouseup",ua);mxEvent.removeListener(document,"mousemove",ha);mxEvent.removeListener(document,
+(fa.ctrlKey||fa.metaKey)&&(M(),mxEvent.consume(fa))});mxEvent.addListener(Z,"keyup",function(fa){32===fa.keyCode&&(C=!1,ja||(da.style.cursor="crosshair"))});O();L();this.init=function(){Z.focus();var fa=da.getBoundingClientRect();0<fa.width&&0<fa.height&&(V=1,U=fa.width*V,S=fa.height*V,I=(400-U)/2,N=(400-S)/2,u())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",Da);mxEvent.removeListener(document,"mouseup",ua);mxEvent.removeListener(document,"mousemove",ha);mxEvent.removeListener(document,
"mouseup",ia)};this.container=Z};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage=
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";
Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";
@@ -13753,9 +13763,8 @@ Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.tweetImage=IMAGE_PATH+"/t
!0;Editor.enableSimpleTheme=!0;Editor.enableHashObjects=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"1"!=urlParams.embed&&window.top==window.self;Editor.defaultIncludeDiagram=!0;Editor.enableServiceWorker="0"!=urlParams.pwa&&"serviceWorker"in navigator&&("1"==urlParams.offline||"1"==urlParams.enableSW||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.draw\.io$/.test(window.location.hostname));try{Editor.enableServiceWorker&&navigator.serviceWorker}catch(d){Editor.enableServiceWorker=
!1}Editor.defaultLanguages=null;Editor.enableWebFonts=!window.mxIsElectron;Editor.enableLocalFonts=!1;Editor.localFonts=null;Editor.enableShadowOption=!mxClient.IS_SF;Editor.enableExportUrl=!0;Editor.enableRealtime=!0;Editor.enableRealtimeCache=!0;Editor.p2pSyncNotify=!1;Editor.compressXml=!0;Editor.defaultCompressed=!1;Editor.oneDriveInlinePicker=null!=window.urlParams&&"0"==window.urlParams.inlinePicker?!1:!0;Editor.globalVars=null;Editor.defaultBorder=5;Editor.addSvgMetadata=!1;Editor.mathOutputSize=
!0;Editor.enableAnimations=!0;Editor.insertAnimations=!0;Editor.enableWindowDocking="1"!=urlParams.embedInline;Editor.pasteAtMousePointer=!0;Editor.fitDiagramOnLoad=!0;Editor.fitDiagramOnPage=!0;Editor.showLinkIcons=!1;Editor.showTooltipIcons=!1;Editor.showNoteIcons=!0;Editor.tooltipFontSize=null;Editor.tooltipMaxWidth=360;Editor.expandPatternsForPrint=!0;Editor.defaultTextStyle="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;";Editor.defaultNoteStyle=
-"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;autosizeText=1;";Editor.enableAi=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.aiActions=["createPublic","create","update","assist"];Editor.gptApiKey=null!=urlParams["gpt-api-key"]?
-decodeURIComponent(urlParams["gpt-api-key"]):null;Editor.geminiApiKey=null!=urlParams["gemini-api-key"]?decodeURIComponent(urlParams["gemini-api-key"]):null;Editor.claudeApiKey=null!=urlParams["claude-api-key"]?decodeURIComponent(urlParams["claude-api-key"]):null;Editor.gptUrl=null!=urlParams["gpt-url"]?decodeURIComponent(urlParams["gpt-url"]):"https://api.openai.com/v1/chat/completions";Editor.aiGlobals={gptApiKey:Editor.gptApiKey,geminiApiKey:Editor.geminiApiKey,claudeApiKey:Editor.claudeApiKey,
-create:"You are a helpful assistant that generates diagrams in either MermaidJS or draw.io XML format based on the given prompt. Begin with a concise checklist (3-7 bullets) of what you will do; keep items conceptual, not implementation-level. Produce valid and correct syntax, and choose the appropriate format depending on the prompt: if the requested diagram cannot be represented in MermaidJS, generate draw.io XML instead but do not use indentation and newlines. When asked to modify a diagram that is given in the conversation as draw.io XML, return the complete updated diagram as draw.io XML, not MermaidJS, and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. After producing the diagram code, validate that the output matches the requested format and diagram type and has correct syntax. Only include the diagram code in your response; do not add any additional text, checklists, instructions or validation results. If the prompt is a question or does not ask for a diagram, answer it as plain text without any diagram code instead.",
+"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;autosizeText=1;";Editor.enableAi=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.aiActions=["createPublic","create","update","assist"];Editor.gptApiKey=null;Editor.geminiApiKey=
+null;Editor.claudeApiKey=null;Editor.gptUrl="https://api.openai.com/v1/chat/completions";Editor.aiGlobals={gptApiKey:Editor.gptApiKey,geminiApiKey:Editor.geminiApiKey,claudeApiKey:Editor.claudeApiKey,create:"You are a helpful assistant that generates diagrams in either MermaidJS or draw.io XML format based on the given prompt. Begin with a concise checklist (3-7 bullets) of what you will do; keep items conceptual, not implementation-level. Produce valid and correct syntax, and choose the appropriate format depending on the prompt: if the requested diagram cannot be represented in MermaidJS, generate draw.io XML instead but do not use indentation and newlines. When asked to modify a diagram that is given in the conversation as draw.io XML, return the complete updated diagram as draw.io XML, not MermaidJS, and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. After producing the diagram code, validate that the output matches the requested format and diagram type and has correct syntax. Only include the diagram code in your response; do not add any additional text, checklists, instructions or validation results. If the prompt is a question or does not ask for a diagram, answer it as plain text without any diagram code instead.",
update:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. When asked to modify the diagram, return the complete updated diagram as draw.io XML without indentation and newlines - never as MermaidJS or any other format - and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. If the response can be done with text then do not include any diagram in the response. Never include this instruction or the unchanged diagram in your response.\n{data}",
assist:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."};Editor.aiConfigs={gpt:{apiKey:"gptApiKey",endpoint:Editor.gptUrl,requestHeaders:{Authorization:"Bearer {apiKey}"},request:{model:"{model}",messages:[{role:"system",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.choices[0].message.content"},gemini:{apiKey:"geminiApiKey",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",
requestHeaders:{"X-Goog-Api-Key":"{apiKey}"},request:{system_instruction:{parts:[{text:"{action}"}]},contents:[{parts:[{text:"{prompt}"}]}]},responsePath:"$.candidates[0].content.parts[0].text"},claude:{apiKey:"claudeApiKey",endpoint:"https://api.anthropic.com/v1/messages",requestHeaders:{"X-API-Key":"{apiKey}","Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},request:{max_tokens:8192,model:"{model}",system:"{action}",messages:[{role:"user",content:"{prompt}"}]},
@@ -13861,12 +13870,12 @@ null!=d.shadowBlur&&(mxConstants.SHADOW_BLUR=d.shadowBlur);null!=d.enableAnimati
null!=d.enableChatGpt&&(Editor.enableAi=d.enableChatGpt);null!=d.gptApiKey&&(Editor.aiGlobals.gptApiKey=d.gptApiKey);null!=d.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=d.geminiApiKey);null!=d.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=d.claudeApiKey);null!=d.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=d.gptUrl);null!=d.aiActions&&(Editor.aiActions=d.aiActions);null!=d.aiGlobals&&(Editor.aiGlobals=d.aiGlobals);null!=d.aiConfigs&&(Editor.aiConfigs=d.aiConfigs);null!=d.aiModels&&
(Editor.aiModels=d.aiModels)}};Editor.applyCustomResources=function(){if(null!=Editor.customResources){var d=null!=mxClient.language?mxClient.language.toLowerCase():null,m=null!=d?d.indexOf("-"):-1,x;for(x in Editor.customResources){var C=Editor.customResources[x];null!=C&&"object"===typeof C&&(C=(null!=d?C[d]:null)||(0<m?C[d.substring(0,m)]:null)||C.main);"string"===typeof C&&(mxResources.resources[x]=C)}}};var b=mxResources.parse;mxResources.parse=function(d){b.apply(this,arguments);Editor.applyCustomResources()};
Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=function(d){function m(ba,T){ba=ba.getAttribute("fill");if(null==ba||0!==ba.indexOf("url("))return null;ba=ba.match(/url\([^#]*#([^)"]+)\)?/);if(null==ba)return null;ba=ba[1];try{var Z=T.querySelector("#"+CSS.escape(ba));return null!=Z&&"pattern"===Z.nodeName?Z:null}catch(X){return null}}function x(ba,T,Z){var X,da,R;try{var Y=ba.getBBox()}catch(ha){return}if(0!==
-Y.width&&0!==Y.height){var ca=parseFloat(T.getAttribute("width")),P=parseFloat(T.getAttribute("height"));if(!(isNaN(ca)||isNaN(P)||0>=ca||0>=P)){var aa=T.getAttribute("patternTransform");var ea=da=X=0;var oa=R=1;if(null!=aa){var ra=aa.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=ra&&(X=parseFloat(ra[1]),da=parseFloat(ra[2]));ra=aa.match(/rotate\(\s*([^)]+)\)/);null!=ra&&(ea=parseFloat(ra[1])*Math.PI/180);aa=aa.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=aa&&(R=parseFloat(aa[1]),
-oa=null!=aa[2]?parseFloat(aa[2]):R)}var ta=[{x:Y.x,y:Y.y},{x:Y.x+Y.width,y:Y.y},{x:Y.x+Y.width,y:Y.y+Y.height},{x:Y.x,y:Y.y+Y.height}],na=Infinity;Y=Infinity;ra=aa=-Infinity;for(var wa=0;wa<ta.length;wa++){var ya=ta[wa].x-X;var Aa=ta[wa].y-da,Ca=Math.cos(-ea),ua=Math.sin(-ea);var qa=(ya*Ca-Aa*ua)/R;ya=(ya*ua+Aa*Ca)/oa;na=Math.min(na,qa);Y=Math.min(Y,ya);aa=Math.max(aa,qa);ra=Math.max(ra,ya)}na=Math.floor(na/ca)-1;Y=Math.floor(Y/P)-1;aa=Math.ceil(aa/ca)+1;qa=Math.ceil(ra/P)+1;if(!(1E4<(aa-na)*(qa-
-Y))){wa=F+ ++C;ra=Z.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");ra.setAttribute("id",wa);ta=ba.cloneNode(!0);ta.removeAttribute("fill");ta.removeAttribute("fill-opacity");ta.removeAttribute("stroke");ta.removeAttribute("stroke-width");ta.removeAttribute("stroke-opacity");ta.removeAttribute("style");ta.removeAttribute("pointer-events");ta.setAttribute("fill","black");ra.appendChild(ta);ta=Z.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");ta.setAttribute("clip-path",
+Y.width&&0!==Y.height){var ca=parseFloat(T.getAttribute("width")),P=parseFloat(T.getAttribute("height"));if(!(isNaN(ca)||isNaN(P)||0>=ca||0>=P)){var aa=T.getAttribute("patternTransform");var ea=da=X=0;var oa=R=1;if(null!=aa){var sa=aa.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=sa&&(X=parseFloat(sa[1]),da=parseFloat(sa[2]));sa=aa.match(/rotate\(\s*([^)]+)\)/);null!=sa&&(ea=parseFloat(sa[1])*Math.PI/180);aa=aa.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=aa&&(R=parseFloat(aa[1]),
+oa=null!=aa[2]?parseFloat(aa[2]):R)}var ta=[{x:Y.x,y:Y.y},{x:Y.x+Y.width,y:Y.y},{x:Y.x+Y.width,y:Y.y+Y.height},{x:Y.x,y:Y.y+Y.height}],na=Infinity;Y=Infinity;sa=aa=-Infinity;for(var wa=0;wa<ta.length;wa++){var ya=ta[wa].x-X;var Aa=ta[wa].y-da,Da=Math.cos(-ea),ua=Math.sin(-ea);var qa=(ya*Da-Aa*ua)/R;ya=(ya*ua+Aa*Da)/oa;na=Math.min(na,qa);Y=Math.min(Y,ya);aa=Math.max(aa,qa);sa=Math.max(sa,ya)}na=Math.floor(na/ca)-1;Y=Math.floor(Y/P)-1;aa=Math.ceil(aa/ca)+1;qa=Math.ceil(sa/P)+1;if(!(1E4<(aa-na)*(qa-
+Y))){wa=F+ ++C;sa=Z.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");sa.setAttribute("id",wa);ta=ba.cloneNode(!0);ta.removeAttribute("fill");ta.removeAttribute("fill-opacity");ta.removeAttribute("stroke");ta.removeAttribute("stroke-width");ta.removeAttribute("stroke-opacity");ta.removeAttribute("style");ta.removeAttribute("pointer-events");ta.setAttribute("fill","black");sa.appendChild(ta);ta=Z.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");ta.setAttribute("clip-path",
"url(#"+wa+")");wa=ba.getAttribute("fill-opacity");null!=wa&&ta.setAttribute("opacity",wa);wa=Z.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");wa.setAttribute("transform","translate("+X+","+da+")"+(0!==ea?" rotate("+180*ea/Math.PI+")":"")+" scale("+R+(oa!==R?","+oa:"")+")");da=F+ ++C;X=Z.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");X.setAttribute("id",da);ea=Z.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect");ea.setAttribute("x","0");ea.setAttribute("y",
"0");ea.setAttribute("width",ca);ea.setAttribute("height",P);X.appendChild(ea);T=T.childNodes;for(ea=na;ea<aa;ea++)for(R=Y;R<qa;R++){oa=Z.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");oa.setAttribute("transform","translate("+ea*ca+","+R*P+")");oa.setAttribute("clip-path","url(#"+da+")");for(na=0;na<T.length;na++)1===T[na].nodeType&&oa.appendChild(T[na].cloneNode(!0));wa.appendChild(oa)}ta.appendChild(wa);ca=Z.querySelector("defs");null==ca&&(ca=Z.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
-"defs"),Z.insertBefore(ca,Z.firstChild));ca.appendChild(ra);ca.appendChild(X);ba.parentNode.insertBefore(ta,ba.nextSibling);ba.setAttribute("fill","none");ba.style.fill=""}}}}for(var C=0,F="expand-pattern-clip-"+Editor.guid(8)+"-",G=d.querySelectorAll('[fill^="url("]'),K=0;K<G.length;K++){var Q=m(G[K],d);null!=Q&&x(G[K],Q,d)}G=d.querySelectorAll("[style]");for(K=0;K<G.length;K++)Q=G[K].getAttribute("style"),null!=Q&&-1!==Q.indexOf("url(")&&(Q=m(G[K],d),null!=Q&&x(G[K],Q,d))};Editor.addAllowedFontUrl=
+"defs"),Z.insertBefore(ca,Z.firstChild));ca.appendChild(sa);ca.appendChild(X);ba.parentNode.insertBefore(ta,ba.nextSibling);ba.setAttribute("fill","none");ba.style.fill=""}}}}for(var C=0,F="expand-pattern-clip-"+Editor.guid(8)+"-",G=d.querySelectorAll('[fill^="url("]'),K=0;K<G.length;K++){var Q=m(G[K],d);null!=Q&&x(G[K],Q,d)}G=d.querySelectorAll("[style]");for(K=0;K<G.length;K++)Q=G[K].getAttribute("style"),null!=Q&&-1!==Q.indexOf("url(")&&(Q=m(G[K],d),null!=Q&&x(G[K],Q,d))};Editor.addAllowedFontUrl=
function(d){"string"===typeof d&&0<d.length&&(Graph.allowedFontUrls[d]=!0)};Editor.addAllowedFontUrls=function(d){if(Array.isArray(d))for(var m=0;m<d.length;m++)null!=d[m]&&"object"===typeof d[m]&&Editor.addAllowedFontUrl(d[m].fontUrl)};Editor.configureFontCss=function(d){if(null!=d){Editor.prototype.fontCss=d;for(var m=d.split("url("),x=1;x<m.length;x++){var C=m[x].indexOf(")");0<C&&Editor.addAllowedFontUrl(Editor.trimCssUrl(m[x].substring(0,C)))}m=document.getElementsByTagName("script")[0];if(null!=
m&&null!=m.parentNode)for(x=document.createElement("style"),x.setAttribute("type","text/css"),x.appendChild(document.createTextNode(d)),m.parentNode.insertBefore(x,m),d=d.split("url("),x=1;x<d.length;x++){C=d[x].indexOf(")");C=Editor.trimCssUrl(d[x].substring(0,C));var F=document.createElement("link");F.setAttribute("rel","preload");F.setAttribute("href",C);F.setAttribute("as","font");F.setAttribute("crossorigin","");m.parentNode.insertBefore(F,m)}}};Editor.trimCssUrl=function(d){return d.replace(RegExp("^[\\s\"']+",
"g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(d){d=null!=d?d:Editor.GUID_LENGTH;for(var m=[],x=0;x<d;x++)m.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return m.join("")};Editor.updateStatusInterval=
@@ -13900,13 +13909,13 @@ mxUtils.bind(this,function(){window.clearTimeout(K);G&&Q()}));else{var ba=new Im
function(d,m,x,C){function F(){0<G.length?G.shift()():m(d)}null==C&&(C=this.createImageUrlConverter());var G=[],K=x||{};x=mxUtils.bind(this,function(X,da){X=d.getElementsByTagName(X);for(var R=0;R<X.length;R++)mxUtils.bind(this,function(Y){G.push(mxUtils.bind(this,function(){try{if(null!=Y){var ca=C.convert(Y.getAttribute(da));if(null!=ca&&"data:"!=ca.substring(0,5)){var P=K[ca];null==P?this.convertImageToDataUri(ca,function(aa){null!=aa&&(K[ca]=aa,Y.setAttribute(da,aa));F()},null,Editor.svgRasterScale):
(Y.setAttribute(da,P),F())}else null!=ca&&Y.setAttribute(da,ca),F()}}catch(aa){F()}}))})(X[R])});var Q={},ba=function(){var X=d.getElementsByTagName("defs")[0];null==X&&(X=d.ownerDocument,X=null!=X.createElementNS?X.createElementNS(mxConstants.NS_SVG,"defs"):X.createElement("defs"),d.insertBefore(X,d.firstChild));return X},T=mxUtils.bind(this,function(){for(var X=d.getElementsByTagName("use"),da=0;da<X.length;da++)mxUtils.bind(this,function(R){G.push(mxUtils.bind(this,function(){try{var Y=R.getAttribute("href");
null==Y&&(Y=R.getAttribute("xlink:href"));if(null!=Y&&"#"!=Y.charAt(0)&&"data:"!=Y.substring(0,5)){var ca=C.convert(Y),P=function(ea){ea=Graph.createSvgImageSymbol(ba(),Q,ea,!0);null!=ea&&(R.setAttribute("href","#"+ea),R.setAttribute("xlink:href","#"+ea));F()},aa=K[ca];null==aa?this.convertImageToDataUri(ca,function(ea){null!=ea&&ea!=ca&&(K[ca]=ea);P(ea)}):P(aa)}else F()}catch(ea){F()}}))})(X[da])}),Z=mxUtils.bind(this,function(){G.push(mxUtils.bind(this,function(){try{for(var X=d.getElementsByTagName("image"),
-da=[],R=0;R<X.length;R++)da.push(X[R]);var Y={},ca={},P=[],aa=function(){for(var Ca=d.getElementsByTagName("use"),ua=0;ua<Ca.length;ua++){var qa=Ca[ua].getAttribute("href");null==qa&&(qa=Ca[ua].getAttribute("xlink:href"));null!=qa&&null!=Y[qa]&&(Ca[ua].setAttribute("href","#"+Y[qa]),Ca[ua].setAttribute("xlink:href","#"+Y[qa]))}},ea=function(Ca,ua){for(var qa=null!=d.ownerDocument.createElementNS?d.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):d.ownerDocument.createElement("use"),ha=Ca.attributes,
-ia=0;ia<ha.length;ia++){var pa=ha[ia].name;"href"!=pa&&"xlink:href"!=pa&&"preserveAspectRatio"!=pa&&qa.setAttribute(pa,ha[ia].value)}qa.setAttribute("href","#"+ua);qa.setAttribute("xlink:href","#"+ua);Ca.parentNode.replaceChild(qa,Ca)};for(R=0;R<da.length;R++){var oa=da[R];X=oa;var ra=!0;if("symbol"==oa.parentNode.nodeName)if(null==oa.getAttribute("id")&&"mx-image-"==String(oa.parentNode.getAttribute("id")||"").substring(0,9))X=oa.parentNode,ra=!1;else continue;else"mx-image-"==String(oa.getAttribute("id")||
-"").substring(0,9)&&(ra=!1);var ta=oa.getAttribute("xlink:href");if(null!=ta&&"data:"==ta.substring(0,5)){var na=X.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==ta.substring(0,18)){var wa="mx-symbol-"+mxUtils.hashCode(ta+"|"+("none"!=na)),ya=d.querySelector('[id="'+wa+'"]');if(null!=ya&&"symbol"==ya.nodeName){ra?ea(oa,wa):(Y["#"+X.getAttribute("id")]=wa,X.parentNode.removeChild(X));continue}}null==ca[ta]&&(ca[ta]={},P.push(ta));null==ca[ta][na]&&(ca[ta][na]=[]);ca[ta][na].push({node:X,
-inline:ra})}}aa();var Aa=function(){for(var Ca=null,ua=null;0<P.length&&null==Ca;){Ca=P.pop();ua=ca[Ca];var qa=0,ha=0,ia;for(ia in ua)qa++,ha=Math.max(ha,ua[ia].length);2>qa&&2>ha&&(Ca=null)}if(null==Ca)F();else{var pa=new Image;pa.onload=function(){try{var za=pa.naturalWidth,fa=pa.naturalHeight;if(0<za&&0<fa){var ka=d.ownerDocument,xa=0,Ba;for(Ba in ua)xa++;var ma=function(ab){return null!=ka.createElementNS?ka.createElementNS(mxConstants.NS_SVG,ab):ka.createElement(ab)},la=function(){var ab=ma("image");
-ab.setAttribute("width",za);ab.setAttribute("height",fa);null==ab.setAttributeNS?ab.setAttribute("xlink:href",Ca):ab.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Ca);return ab},Ea=null;if(1<xa){for(Ea="mx-data-"+mxUtils.hashCode(Ca);null!=d.querySelector('[id="'+Ea+'"]');)Ea+="-1";var Fa=la();Fa.setAttribute("id",Ea);ba().appendChild(Fa)}for(Ba in ua){var Ia=ua[Ba];xa=null;for(Fa=0;Fa<Ia.length&&null==xa;Fa++)Ia[Fa].inline||(xa=Ia[Fa].node.getAttribute("id"));if(null==xa)for(xa="mx-image-"+mxUtils.hashCode(Ca+
-"|"+Ba);null!=d.querySelector('[id="'+xa+'"]');)xa+="-1";var Ha=ma("symbol");Ha.setAttribute("id",xa);Ha.setAttribute("viewBox","0 0 "+za+" "+fa);""!=Ba&&Ha.setAttribute("preserveAspectRatio",Ba);if(null!=Ea){var Ma=ma("use");Ma.setAttribute("href","#"+Ea);Ma.setAttribute("xlink:href","#"+Ea);Ha.appendChild(Ma)}else Ha.appendChild(la());ba().appendChild(Ha);for(Fa=0;Fa<Ia.length;Fa++){var bb=Ia[Fa].node;Ia[Fa].inline?ea(bb,xa):(bb.getAttribute("id")!=xa&&(Y["#"+bb.getAttribute("id")]=xa),bb.parentNode.removeChild(bb))}}aa()}}catch(ab){}Aa()};
-pa.onerror=function(){Aa()};pa.src=Ca}};Aa()}catch(Ca){F()}}))});x("image","xlink:href");x("img","src");T();Z();F()};Editor.base64Encode=function(d){for(var m="",x=0,C=d.length,F,G,K;x<C;){F=d.charCodeAt(x++)&255;if(x==C){m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(F>>2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((F&3)<<4);m+="==";break}G=d.charCodeAt(x++);if(x==C){m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(F>>
+da=[],R=0;R<X.length;R++)da.push(X[R]);var Y={},ca={},P=[],aa=function(){for(var Da=d.getElementsByTagName("use"),ua=0;ua<Da.length;ua++){var qa=Da[ua].getAttribute("href");null==qa&&(qa=Da[ua].getAttribute("xlink:href"));null!=qa&&null!=Y[qa]&&(Da[ua].setAttribute("href","#"+Y[qa]),Da[ua].setAttribute("xlink:href","#"+Y[qa]))}},ea=function(Da,ua){for(var qa=null!=d.ownerDocument.createElementNS?d.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):d.ownerDocument.createElement("use"),ha=Da.attributes,
+ia=0;ia<ha.length;ia++){var pa=ha[ia].name;"href"!=pa&&"xlink:href"!=pa&&"preserveAspectRatio"!=pa&&qa.setAttribute(pa,ha[ia].value)}qa.setAttribute("href","#"+ua);qa.setAttribute("xlink:href","#"+ua);Da.parentNode.replaceChild(qa,Da)};for(R=0;R<da.length;R++){var oa=da[R];X=oa;var sa=!0;if("symbol"==oa.parentNode.nodeName)if(null==oa.getAttribute("id")&&"mx-image-"==String(oa.parentNode.getAttribute("id")||"").substring(0,9))X=oa.parentNode,sa=!1;else continue;else"mx-image-"==String(oa.getAttribute("id")||
+"").substring(0,9)&&(sa=!1);var ta=oa.getAttribute("xlink:href");if(null!=ta&&"data:"==ta.substring(0,5)){var na=X.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==ta.substring(0,18)){var wa="mx-symbol-"+mxUtils.hashCode(ta+"|"+("none"!=na)),ya=d.querySelector('[id="'+wa+'"]');if(null!=ya&&"symbol"==ya.nodeName){sa?ea(oa,wa):(Y["#"+X.getAttribute("id")]=wa,X.parentNode.removeChild(X));continue}}null==ca[ta]&&(ca[ta]={},P.push(ta));null==ca[ta][na]&&(ca[ta][na]=[]);ca[ta][na].push({node:X,
+inline:sa})}}aa();var Aa=function(){for(var Da=null,ua=null;0<P.length&&null==Da;){Da=P.pop();ua=ca[Da];var qa=0,ha=0,ia;for(ia in ua)qa++,ha=Math.max(ha,ua[ia].length);2>qa&&2>ha&&(Da=null)}if(null==Da)F();else{var pa=new Image;pa.onload=function(){try{var za=pa.naturalWidth,fa=pa.naturalHeight;if(0<za&&0<fa){var ka=d.ownerDocument,xa=0,Ba;for(Ba in ua)xa++;var ma=function(bb){return null!=ka.createElementNS?ka.createElementNS(mxConstants.NS_SVG,bb):ka.createElement(bb)},la=function(){var bb=ma("image");
+bb.setAttribute("width",za);bb.setAttribute("height",fa);null==bb.setAttributeNS?bb.setAttribute("xlink:href",Da):bb.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Da);return bb},Ea=null;if(1<xa){for(Ea="mx-data-"+mxUtils.hashCode(Da);null!=d.querySelector('[id="'+Ea+'"]');)Ea+="-1";var Ga=la();Ga.setAttribute("id",Ea);ba().appendChild(Ga)}for(Ba in ua){var Ja=ua[Ba];xa=null;for(Ga=0;Ga<Ja.length&&null==xa;Ga++)Ja[Ga].inline||(xa=Ja[Ga].node.getAttribute("id"));if(null==xa)for(xa="mx-image-"+mxUtils.hashCode(Da+
+"|"+Ba);null!=d.querySelector('[id="'+xa+'"]');)xa+="-1";var Ha=ma("symbol");Ha.setAttribute("id",xa);Ha.setAttribute("viewBox","0 0 "+za+" "+fa);""!=Ba&&Ha.setAttribute("preserveAspectRatio",Ba);if(null!=Ea){var Ma=ma("use");Ma.setAttribute("href","#"+Ea);Ma.setAttribute("xlink:href","#"+Ea);Ha.appendChild(Ma)}else Ha.appendChild(la());ba().appendChild(Ha);for(Ga=0;Ga<Ja.length;Ga++){var eb=Ja[Ga].node;Ja[Ga].inline?ea(eb,xa):(eb.getAttribute("id")!=xa&&(Y["#"+eb.getAttribute("id")]=xa),eb.parentNode.removeChild(eb))}}aa()}}catch(bb){}Aa()};
+pa.onerror=function(){Aa()};pa.src=Da}};Aa()}catch(Da){F()}}))});x("image","xlink:href");x("img","src");T();Z();F()};Editor.base64Encode=function(d){for(var m="",x=0,C=d.length,F,G,K;x<C;){F=d.charCodeAt(x++)&255;if(x==C){m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(F>>2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((F&3)<<4);m+="==";break}G=d.charCodeAt(x++);if(x==C){m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(F>>
2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((F&3)<<4|(G&240)>>4);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((G&15)<<2);m+="=";break}K=d.charCodeAt(x++);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(F>>2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((F&3)<<4|(G&240)>>4);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((G&15)<<2|(K&192)>>6);
m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(K&63)}return m};Editor.prototype.loadUrl=function(d,m,x,C,F,G,K,Q){try{var ba=!K&&(C||/(\.png)($|\?)/i.test(d)||/(\.jpe?g)($|\?)/i.test(d)||/(\.gif)($|\?)/i.test(d)||/(\.pdf)($|\?)/i.test(d));F=null!=F?F:!0;var T=mxUtils.bind(this,function(){mxUtils.get(d,mxUtils.bind(this,function(Z){200<=Z.getStatus()&&299>=Z.getStatus()?null!=m&&(Z=Z.getText(),ba&&(G=null!=G?G:"data:image/png;base64,",Z=G+Editor.base64Encode(Z)),m(Z)):
null!=x&&(0==Z.getStatus()?x({message:mxResources.get("accessDenied")},Z):404==Z.getStatus()?x({message:mxResources.get("fileNotFound"),code:Z.getStatus()},Z):x({message:this.getErrorMessage(Z)},Z))}),function(Z){null!=x&&x({message:mxResources.get("error")+" "+Z.getStatus()})},ba,this.timeout,function(){F&&null!=x&&x({code:App.ERROR_TIMEOUT,retry:T})},Q)});T()}catch(Z){null!=x&&x(Z)}};Editor.prototype.getErrorMessage=function(d){var m=mxResources.get("error")+" "+d.getStatus();try{var x=d.getText(),
@@ -13919,11 +13928,11 @@ m;null!=d&&d()})):null!=d&&d()};Editor.prototype.createGoogleFontCache=function(
null==this.cachedGoogleFonts[Q]?(C++,this.loadUrl(Graph.rewriteGoogleFontUrl(Q),mxUtils.bind(this,function(ba){this.cachedGoogleFonts[Q]=ba;x.push(ba+"\n");C--;F()}),mxUtils.bind(this,function(ba){C--;x.push('@import url("'+Graph.escapeCssString(Q)+'");\n');F()}))):x.push(this.cachedGoogleFonts[Q]+"\n"):x.push('@font-face {font-family: "'+Graph.escapeCssString(K)+'";src: url("'+Graph.escapeCssString(Q)+'")}\n')})(m[G].name,m[G].url);F()}else d()};Editor.prototype.addMathCss=function(d){d=d.getElementsByTagName("defs");
if(null!=d&&0<d.length)for(var m=document.getElementsByTagName("style"),x=0;x<m.length;x++){var C=mxUtils.getTextContent(m[x]);0>C.indexOf("mxPageSelector")&&0<C.indexOf("MathJax")&&d[0].appendChild(m[x].cloneNode(!0))}};Editor.prototype.addFontCss=function(d,m){m=null!=m?m:this.absoluteCssFonts(this.fontCss);if(null!=m){var x=mxUtils.getSvgDefs(d),C=m.split("\n");m=[];for(var F=[],G=0;G<C.length;G++)"@import"==C[G].substring(0,7)?m.push(C[G]):F.push(C[G]);d=d.ownerDocument;d=null!=d.createElementNS?
d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");0<m.length&&(mxUtils.setTextContent(d,m.join("\n")),x.appendChild(d));0<F.length&&(d=d.cloneNode(!1),mxUtils.setTextContent(d,F.join("\n")),x.appendChild(d))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(d,m,x){var C=mxClient.IS_FF?8192:16384;return Math.min(x,Math.min(C/d,C/m))};Editor.prototype.exportToCanvas=
-function(d,m,x,C,F,G,K,Q,ba,T,Z,X,da,R,Y,ca,P,aa){try{G=null!=G?G:!0;K=null!=K?K:!0;X=null!=X?X:this.graph;da=null!=da?da:0;var ea=ba?null:X.background;ea==mxConstants.NONE&&(ea=null);null==ea&&(ea=C);null==ea&&0==ba&&(ea=Editor.getDefaultPageBackgroundColor());this.convertImages(X.getSvg(null,null,da,R,null,K,null,null,null,T,null,ca,P,aa),mxUtils.bind(this,function(oa){try{oa.style.setProperty("-webkit-font-smoothing","antialiased");oa.style.setProperty("-moz-osx-font-smoothing","grayscale");var ra=
-new Image;ra.onload=mxUtils.bind(this,function(){try{var na=function(){mxClient.IS_SF?window.setTimeout(function(){Ca.drawImage(ra,0,0);d(wa,oa)},0):(Ca.drawImage(ra,0,0),d(wa,oa))},wa=document.createElement("canvas"),ya=parseInt(oa.getAttribute("width")),Aa=parseInt(oa.getAttribute("height"));Q=null!=Q?Q:1;null!=m&&(Q=G?Math.min(1,Math.min(3*m/(4*Aa),m/ya)):m/ya);Q=this.getMaxCanvasScale(ya,Aa,Q);ya=Math.ceil(Q*ya);Aa=Math.ceil(Q*Aa);wa.setAttribute("width",ya);wa.setAttribute("height",Aa);var Ca=
-wa.getContext("2d");if(null!=ea){var ua=mxUtils.getLightDarkColor(ea);Ca.beginPath();Ca.rect(0,0,ya,Aa);Ca.fillStyle="dark"==ca&&"none"!=X.getAdaptiveColors()?ua.dark:ua.light;Ca.fill()}1!=Q&&Ca.scale(Q,Q);if(Y){var qa=X.view,ha=qa.scale;qa.scale=1;var ia=btoa(unescape(encodeURIComponent(qa.createSvgGrid(qa.gridColor))));qa.scale=ha;ia="data:image/svg+xml;base64,"+ia;var pa=X.gridSize*qa.gridSteps*Q,za=X.getGraphBounds(),fa=qa.translate.x*ha,ka=qa.translate.y*ha,xa=fa+(za.x-fa)/ha-da,Ba=ka+(za.y-
-ka)/ha-da,ma=new Image;ma.onload=function(){try{for(var la=-Math.round(pa-mxUtils.mod((fa-xa)*Q,pa)),Ea=-Math.round(pa-mxUtils.mod((ka-Ba)*Q,pa));la<ya;la+=pa)for(var Fa=Ea;Fa<Aa;Fa+=pa)Ca.drawImage(ma,la/Q,Fa/Q);na()}catch(Ia){null!=F&&F(Ia)}};ma.onerror=function(la){null!=F&&F(la)};ma.src=ia}else na()}catch(la){null!=F&&F(la)}});ra.onerror=function(na){null!=F&&F(na)};T&&this.graph.addSvgShadow(oa);this.graph.mathEnabled&&this.addMathCss(oa);var ta=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&
-this.addFontCss(oa,this.resolvedFontCss),ra.src=Editor.createSvgDataUri(mxUtils.getXml(oa))}catch(na){null!=F&&F(na)}});this.embedExtFonts(mxUtils.bind(this,function(na){try{null!=na&&this.addFontCss(oa,na),this.loadFonts(ta)}catch(wa){null!=F&&F(wa)}}))}catch(na){null!=F&&F(na)}}),x,Z)}catch(oa){null!=F&&F(oa)}};Editor.crcTable=[];for(var y=0;256>y;y++)for(var A=y,E=0;8>E;E++)A=1==(A&1)?3988292384^A>>>1:A>>>1,Editor.crcTable[y]=A;Editor.updateCRC=function(d,m,x,C){for(var F=0;F<C;F++)d=Editor.crcTable[(d^
+function(d,m,x,C,F,G,K,Q,ba,T,Z,X,da,R,Y,ca,P,aa){try{G=null!=G?G:!0;K=null!=K?K:!0;X=null!=X?X:this.graph;da=null!=da?da:0;var ea=ba?null:X.background;ea==mxConstants.NONE&&(ea=null);null==ea&&(ea=C);null==ea&&0==ba&&(ea=Editor.getDefaultPageBackgroundColor());this.convertImages(X.getSvg(null,null,da,R,null,K,null,null,null,T,null,ca,P,aa),mxUtils.bind(this,function(oa){try{oa.style.setProperty("-webkit-font-smoothing","antialiased");oa.style.setProperty("-moz-osx-font-smoothing","grayscale");var sa=
+new Image;sa.onload=mxUtils.bind(this,function(){try{var na=function(){mxClient.IS_SF?window.setTimeout(function(){Da.drawImage(sa,0,0);d(wa,oa)},0):(Da.drawImage(sa,0,0),d(wa,oa))},wa=document.createElement("canvas"),ya=parseInt(oa.getAttribute("width")),Aa=parseInt(oa.getAttribute("height"));Q=null!=Q?Q:1;null!=m&&(Q=G?Math.min(1,Math.min(3*m/(4*Aa),m/ya)):m/ya);Q=this.getMaxCanvasScale(ya,Aa,Q);ya=Math.ceil(Q*ya);Aa=Math.ceil(Q*Aa);wa.setAttribute("width",ya);wa.setAttribute("height",Aa);var Da=
+wa.getContext("2d");if(null!=ea){var ua=mxUtils.getLightDarkColor(ea);Da.beginPath();Da.rect(0,0,ya,Aa);Da.fillStyle="dark"==ca&&"none"!=X.getAdaptiveColors()?ua.dark:ua.light;Da.fill()}1!=Q&&Da.scale(Q,Q);if(Y){var qa=X.view,ha=qa.scale;qa.scale=1;var ia=btoa(unescape(encodeURIComponent(qa.createSvgGrid(qa.gridColor))));qa.scale=ha;ia="data:image/svg+xml;base64,"+ia;var pa=X.gridSize*qa.gridSteps*Q,za=X.getGraphBounds(),fa=qa.translate.x*ha,ka=qa.translate.y*ha,xa=fa+(za.x-fa)/ha-da,Ba=ka+(za.y-
+ka)/ha-da,ma=new Image;ma.onload=function(){try{for(var la=-Math.round(pa-mxUtils.mod((fa-xa)*Q,pa)),Ea=-Math.round(pa-mxUtils.mod((ka-Ba)*Q,pa));la<ya;la+=pa)for(var Ga=Ea;Ga<Aa;Ga+=pa)Da.drawImage(ma,la/Q,Ga/Q);na()}catch(Ja){null!=F&&F(Ja)}};ma.onerror=function(la){null!=F&&F(la)};ma.src=ia}else na()}catch(la){null!=F&&F(la)}});sa.onerror=function(na){null!=F&&F(na)};T&&this.graph.addSvgShadow(oa);this.graph.mathEnabled&&this.addMathCss(oa);var ta=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&
+this.addFontCss(oa,this.resolvedFontCss),sa.src=Editor.createSvgDataUri(mxUtils.getXml(oa))}catch(na){null!=F&&F(na)}});this.embedExtFonts(mxUtils.bind(this,function(na){try{null!=na&&this.addFontCss(oa,na),this.loadFonts(ta)}catch(wa){null!=F&&F(wa)}}))}catch(na){null!=F&&F(na)}}),x,Z)}catch(oa){null!=F&&F(oa)}};Editor.crcTable=[];for(var y=0;256>y;y++)for(var A=y,E=0;8>E;E++)A=1==(A&1)?3988292384^A>>>1:A>>>1,Editor.crcTable[y]=A;Editor.updateCRC=function(d,m,x,C){for(var F=0;F<C;F++)d=Editor.crcTable[(d^
m.charCodeAt(x+F))&255]^d>>>8;return d};Editor.crc32=function(d){for(var m=-1,x=0;x<d.length;x++)m=m>>>8^Editor.crcTable[(m^d.charCodeAt(x))&255];return(m^-1)>>>0};Editor.writeGraphModelToPng=function(d,m,x,C,F){function G(Z,X){var da=ba;ba+=X;return Z.substring(da,ba)}function K(Z){Z=G(Z,4);return Z.charCodeAt(3)+(Z.charCodeAt(2)<<8)+(Z.charCodeAt(1)<<16)+(Z.charCodeAt(0)<<24)}function Q(Z){return String.fromCharCode(Z>>24&255,Z>>16&255,Z>>8&255,Z&255)}d=d.substring(d.indexOf(",")+1);d=window.atob?
atob(d):Base64.decode(d,!0);var ba=0;if(G(d,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=F&&F();else if(G(d,4),"IHDR"!=G(d,4))null!=F&&F();else{G(d,17);F=d.substring(0,ba);do{var T=K(d);if("IDAT"==G(d,4)){F=d.substring(0,ba-8);"pHYs"==m&&"dpi"==x?(x=Math.round(C/.0254),x=Q(x)+Q(x)+String.fromCharCode(1)):x=x+String.fromCharCode(0)+("zTXt"==m?String.fromCharCode(0):"")+C;C=4294967295;C=Editor.updateCRC(C,m,0,4);C=Editor.updateCRC(C,x,0,x.length);F+=Q(x.length)+m+x+Q(C^
4294967295);F+=d.substring(ba-8,d.length);break}F+=d.substring(ba-8,ba-4+T);G(d,T);G(d,4)}while(T);return"data:image/png;base64,"+(window.btoa?btoa(F):Base64.encode(F,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var J=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(d,m){J.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var M=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=
@@ -13960,33 +13969,33 @@ font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2"
{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",
gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",
stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var d=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<d.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);null!=d.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),
-d.customProperties,d))};var k=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(d){var m=this.editorUi.getSelectionState();1==m.cells.length?this.addActions(d,["copyStyle","pasteStyle"]):1<=m.cells.length&&this.addActions(d,["pasteStyle","pasteData"]);k.apply(this,arguments);return d};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(d,m,x,C){function F(Ca,ua,qa,ha,ia){if(null!=qa.valueChanged)qa.valueChanged(ua,ia,x,X);
-else{da.getModel().beginUpdate();try{ia=[];var pa=[];if(null!=qa.index){for(var za=[],fa=qa.parentRow.nextSibling;fa&&fa.getAttribute("data-pName")==Ca;)za.push(fa.getAttribute("data-pValue")),fa=fa.nextSibling;qa.index<za.length?null!=ha?za.splice(ha,1):za[qa.index]=ua:za.push(ua);null!=qa.size&&za.length>qa.size&&(za=za.slice(0,qa.size));ua=za.join(",");null!=qa.countProperty&&(da.setCellStyles(qa.countProperty,za.length,da.getSelectionCells()),ia.push(qa.countProperty),pa.push(za.length))}da.setCellStyles(Ca,
-ua,da.getSelectionCells());ia.push(Ca);pa.push(ua);if(null!=qa.dependentProps)for(Ca=0;Ca<qa.dependentProps.length;Ca++){var ka=qa.dependentPropsDefVal[Ca],xa=qa.dependentPropsVals[Ca];if(xa.length>ua)xa=xa.slice(0,ua);else for(var Ba=xa.length;Ba<ua;Ba++)xa.push(ka);xa=xa.join(",");da.setCellStyles(qa.dependentProps[Ca],xa,da.getSelectionCells());ia.push(qa.dependentProps[Ca]);pa.push(xa)}if("function"==typeof qa.onChange)qa.onChange(da,ua);X.editorUi.fireEvent(new mxEventObject("styleChanged","keys",
-ia,"values",pa,"cells",da.getSelectionCells()))}finally{da.getModel().endUpdate()}}}function G(Ca,ua){ua.style.left="0px";ua.style.top="0px";ua.style.position="relative";ua.style.right="0px";ua.style.bottom="0px";ua.style.width="100%";ua.style.maxWidth="100%";ua.style.maxHeight="100%";ua.style.textAlign="left"}function K(Ca,ua,qa){function ha(pa){if(null==pa||pa==mxConstants.NONE)ia.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==pa)ia.style.background="";else{var za=
-mxUtils.getLightDarkColor(pa);mxUtils.isLightDarkColor(pa)&&za.light!=za.dark?ia.style.background="linear-gradient(to right bottom, "+za.cssText+" 50%, "+mxUtils.invertLightDarkColor(za).cssText+" 50.3%)":ia.style.background=pa}}var ia=document.createElement("div");ia.style.width="32px";ia.style.height="8px";ia.style.margin="2px";ia.style.borderStyle="solid";ia.style.borderWidth="1px";ha(ua);btn=mxUtils.button("",mxUtils.bind(X,function(pa){this.editorUi.pickColor(ua,function(za){F(Ca,za,qa);ha(za)});
-mxEvent.consume(pa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(ia);return btn}function Q(Ca,ua,qa,ha,ia,pa,za){null!=ua&&(ua=ua.split(","),R.push({name:Ca,values:ua,type:qa,defVal:ha,countProperty:ia,parentRow:pa,isDeletable:!0,flipBkg:za}));btn=mxUtils.button("+",mxUtils.bind(X,function(fa){for(var ka=pa,xa=0;null!=ka.nextSibling;)if(ka.nextSibling.getAttribute("data-pName")==Ca)ka=ka.nextSibling,
-xa++;else break;var Ba={type:qa,parentRow:pa,index:xa,isDeletable:!0,defVal:ha,countProperty:ia};xa=Z(Ca,"",Ba,0==xa%2,za);F(Ca,ha,Ba);ka.parentNode.insertBefore(xa,ka.nextSibling);mxEvent.consume(fa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ba(Ca,ua,qa,ha,ia,pa,za){if(0<ia){var fa=Array(ia);ua=null!=ua?ua.split(","):[];for(var ka=0;ka<ia;ka++)fa[ka]=null!=ua[ka]?ua[ka]:null!=ha?ha:"";R.push({name:Ca,values:fa,type:qa,defVal:ha,parentRow:pa,
-flipBkg:za,size:ia})}return document.createElement("div")}function T(Ca,ua,qa){var ha=document.createElement("input");ha.type="checkbox";ha.checked="1"==ua;mxEvent.addListener(ha,"change",function(){F(Ca,ha.checked?"1":"0",qa,null,ha)});return ha}function Z(Ca,ua,qa,ha,ia){var pa=qa.dispName,za=qa.type,fa=document.createElement("tr");fa.className="gePropRow"+(ia?"Dark":"")+(ha?"Alt":"")+" gePropNonHeaderRow";fa.setAttribute("data-pName",Ca);fa.setAttribute("data-pValue",ua);ha=!1;null!=qa.index&&
+d.customProperties,d))};var k=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(d){var m=this.editorUi.getSelectionState();1==m.cells.length?this.addActions(d,["copyStyle","pasteStyle"]):1<=m.cells.length&&this.addActions(d,["pasteStyle","pasteData"]);k.apply(this,arguments);return d};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(d,m,x,C){function F(Da,ua,qa,ha,ia){if(null!=qa.valueChanged)qa.valueChanged(ua,ia,x,X);
+else{da.getModel().beginUpdate();try{ia=[];var pa=[];if(null!=qa.index){for(var za=[],fa=qa.parentRow.nextSibling;fa&&fa.getAttribute("data-pName")==Da;)za.push(fa.getAttribute("data-pValue")),fa=fa.nextSibling;qa.index<za.length?null!=ha?za.splice(ha,1):za[qa.index]=ua:za.push(ua);null!=qa.size&&za.length>qa.size&&(za=za.slice(0,qa.size));ua=za.join(",");null!=qa.countProperty&&(da.setCellStyles(qa.countProperty,za.length,da.getSelectionCells()),ia.push(qa.countProperty),pa.push(za.length))}da.setCellStyles(Da,
+ua,da.getSelectionCells());ia.push(Da);pa.push(ua);if(null!=qa.dependentProps)for(Da=0;Da<qa.dependentProps.length;Da++){var ka=qa.dependentPropsDefVal[Da],xa=qa.dependentPropsVals[Da];if(xa.length>ua)xa=xa.slice(0,ua);else for(var Ba=xa.length;Ba<ua;Ba++)xa.push(ka);xa=xa.join(",");da.setCellStyles(qa.dependentProps[Da],xa,da.getSelectionCells());ia.push(qa.dependentProps[Da]);pa.push(xa)}if("function"==typeof qa.onChange)qa.onChange(da,ua);X.editorUi.fireEvent(new mxEventObject("styleChanged","keys",
+ia,"values",pa,"cells",da.getSelectionCells()))}finally{da.getModel().endUpdate()}}}function G(Da,ua){ua.style.left="0px";ua.style.top="0px";ua.style.position="relative";ua.style.right="0px";ua.style.bottom="0px";ua.style.width="100%";ua.style.maxWidth="100%";ua.style.maxHeight="100%";ua.style.textAlign="left"}function K(Da,ua,qa){function ha(pa){if(null==pa||pa==mxConstants.NONE)ia.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==pa)ia.style.background="";else{var za=
+mxUtils.getLightDarkColor(pa);mxUtils.isLightDarkColor(pa)&&za.light!=za.dark?ia.style.background="linear-gradient(to right bottom, "+za.cssText+" 50%, "+mxUtils.invertLightDarkColor(za).cssText+" 50.3%)":ia.style.background=pa}}var ia=document.createElement("div");ia.style.width="32px";ia.style.height="8px";ia.style.margin="2px";ia.style.borderStyle="solid";ia.style.borderWidth="1px";ha(ua);btn=mxUtils.button("",mxUtils.bind(X,function(pa){this.editorUi.pickColor(ua,function(za){F(Da,za,qa);ha(za)});
+mxEvent.consume(pa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(ia);return btn}function Q(Da,ua,qa,ha,ia,pa,za){null!=ua&&(ua=ua.split(","),R.push({name:Da,values:ua,type:qa,defVal:ha,countProperty:ia,parentRow:pa,isDeletable:!0,flipBkg:za}));btn=mxUtils.button("+",mxUtils.bind(X,function(fa){for(var ka=pa,xa=0;null!=ka.nextSibling;)if(ka.nextSibling.getAttribute("data-pName")==Da)ka=ka.nextSibling,
+xa++;else break;var Ba={type:qa,parentRow:pa,index:xa,isDeletable:!0,defVal:ha,countProperty:ia};xa=Z(Da,"",Ba,0==xa%2,za);F(Da,ha,Ba);ka.parentNode.insertBefore(xa,ka.nextSibling);mxEvent.consume(fa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ba(Da,ua,qa,ha,ia,pa,za){if(0<ia){var fa=Array(ia);ua=null!=ua?ua.split(","):[];for(var ka=0;ka<ia;ka++)fa[ka]=null!=ua[ka]?ua[ka]:null!=ha?ha:"";R.push({name:Da,values:fa,type:qa,defVal:ha,parentRow:pa,
+flipBkg:za,size:ia})}return document.createElement("div")}function T(Da,ua,qa){var ha=document.createElement("input");ha.type="checkbox";ha.checked="1"==ua;mxEvent.addListener(ha,"change",function(){F(Da,ha.checked?"1":"0",qa,null,ha)});return ha}function Z(Da,ua,qa,ha,ia){var pa=qa.dispName,za=qa.type,fa=document.createElement("tr");fa.className="gePropRow"+(ia?"Dark":"")+(ha?"Alt":"")+" gePropNonHeaderRow";fa.setAttribute("data-pName",Da);fa.setAttribute("data-pValue",ua);ha=!1;null!=qa.index&&
(fa.setAttribute("data-index",qa.index),pa=(null!=pa?pa:"")+"["+qa.index+"]",ha=!0);var ka=document.createElement("td");ka.className="gePropRowCell";pa=mxResources.get(pa,null,pa);mxUtils.write(ka,pa);ka.setAttribute("title",pa);ha&&(ka.style.textAlign="right");fa.appendChild(ka);ka=document.createElement("td");ka.className="gePropRowCell";ka.setAttribute("title",null!=ua?mxUtils.safeDecodeURIComponent(ua):mxResources.get("none"));mxEvent.addListener(ka,"click",mxUtils.bind(X,function(la){!mxUtils.isAncestorNode(fa,
-document.activeElement)&&mxUtils.isAncestorNode(fa.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(la))}));if("color"==za)ka.appendChild(K(Ca,ua,qa));else if("bool"==za||"boolean"==za)ka.appendChild(T(Ca,ua,qa));else if("enum"==za){var xa=qa.enumList;ka.innerHTML="";var Ba=document.createElement("div");Ba.className="gePropValue";ka.appendChild(Ba);for(ia=0;ia<xa.length;ia++)if(pa=xa[ia],pa.val==ua){mxUtils.write(Ba,
-mxResources.get(pa.dispName,null,pa.dispName));break}mxEvent.addListener(ka,"click",mxUtils.bind(X,function(la){var Ea=mxEvent.getSource(la);if(!(Ea!=ka&&Ea!=Ba||mxEvent.isConsumed(la))){Ba.innerHTML="";var Fa=document.createElement("select"),Ia=null;G(ka,Fa);Fa.style.boxSizing="border-box";Fa.style.height="100%";Fa.style.padding="0";Fa.style.margin="0";Fa.style.border="0";for(la=0;la<xa.length;la++){Ea=xa[la];var Ha=document.createElement("option");Ha.value=mxUtils.htmlEntities(Ea.val);mxUtils.write(Ha,
-mxResources.get(Ea.dispName,null,Ea.dispName));Fa.appendChild(Ha);null==Ea.val&&(Ha.value="null",Ia=Ha)}Fa.value=null==ua&&null!=Ia?"null":ua;Ba.appendChild(Fa);mxEvent.addListener(Fa,"change",function(){var Ma=mxUtils.htmlEntities(Fa.value);if(Fa[Fa.selectedIndex]==Ia||"null"==Ma.value)Ma=null;F(Ca,Ma,qa)});Fa.focus();mxEvent.addListener(Fa,"blur",function(){Ba.innerHTML="";for(var Ma=Fa[Fa.selectedIndex]==Ia||"null"==Fa.value?null:Fa.value,bb=0;bb<xa.length;bb++){var ab=xa[bb];if(ab.val==Ma){mxUtils.write(Ba,
-mxResources.get(ab.dispName,null,ab.dispName));break}}})}}))}else if("dynamicArr"==za)ka.appendChild(Q(Ca,ua,qa.subType,qa.subDefVal,qa.countProperty,fa,ia));else if("staticArr"==za)ka.appendChild(ba(Ca,ua,qa.subType,qa.subDefVal,qa.size,fa,ia));else if("readOnly"==za)ia=document.createElement("input"),ia.setAttribute("readonly",""),ia.value=ua,ia.style.borderWidth="0px","id"==Ca||"shape"==Ca?(fa.firstChild.innerHTML="",fa.firstChild.setAttribute("colspan","2"),ia.style.flexGrow="1",ia.style.marginLeft=
-"4px",ia.style.textAlign="id"==Ca?"center":"left",ia.setAttribute("title",ua),pa=document.createElement("div"),mxUtils.write(pa,mxResources.get(Ca)+":"),pa.style.display="inline-flex",pa.style.alignItems="center",pa.style.width="100%",pa.appendChild(ia),fa.firstChild.appendChild(pa)):(ia.style.width="96px",ka.appendChild(ia));else{ka.innerHTML="";var ma=document.createElement("div");ma.className="gePropValue";ka.appendChild(ma);ma.innerHTML=mxUtils.htmlEntities(mxUtils.safeDecodeURIComponent(ua));
-mxEvent.addListener(ka,"click",mxUtils.bind(X,function(la){function Ea(){var Ha=Ia.value,Ma=za;Ha=0==Ha.trim().length&&"string"!=Ma&&"numbers"!=Ma?qa.allowAuto?"auto":0:Ha;qa.allowAuto&&(null!=Ha.trim&&"auto"==Ha.trim().toLowerCase()?(Ha="auto",Ma="string"):(Ha=parseFloat(Ha),Ha=isNaN(Ha)?0:Ha));null!=qa.min&&Ha<qa.min?Ha=qa.min:null!=qa.max&&Ha>qa.max&&(Ha=qa.max);var bb=null;try{bb="numbers"==Ma?Ha.match(/\d*\.?\d+/g).map(Number).join(" "):"auto"===Ha&&qa.allowAuto&&"auto"==qa.defVal?null:encodeURIComponent(("int"==
-Ma?parseInt(Ha):Ha)+"")}catch(ab){}F(Ca,bb,qa,null,Ia)}var Fa=mxEvent.getSource(la);if(!(Fa!=ka&&Fa!=ma||mxEvent.isConsumed(la))){ma.innerHTML="";var Ia=document.createElement("input");G(ma,Ia);Ia.value=mxUtils.safeDecodeURIComponent(ua);Ia.className="gePropEditor";"int"!=za&&"float"!=za||qa.allowAuto||(Ia.type="number",Ia.step="int"==za?"1":"any",null!=qa.min&&(Ia.min=parseFloat(qa.min)),null!=qa.max&&(Ia.max=parseFloat(qa.max)));ma.appendChild(Ia);mxEvent.addListener(Ia,"keypress",function(Ha){13==
-Ha.keyCode&&Ea()});Ia.focus();mxEvent.addListener(Ia,"blur",function(){Ea()})}}))}qa.isDeletable&&(ia=mxUtils.button("-",mxUtils.bind(X,function(la){F(Ca,"",qa,qa.index);mxEvent.consume(la)})),ia.style.height="16px",ia.style.width="25px",ia.style.float="right",ia.className="geColorBtn",ka.appendChild(ia));fa.appendChild(ka);return fa}var X=this,da=this.editorUi.editor.graph,R=[],Y=document.createElement("table");Y.className="geProperties geFullWidthElement";var ca=document.createElement("tr");ca.className=
-"gePropHeader";var P=document.createElement("th");P.className="gePropHeaderCell";P.style.paddingLeft="16px";P.style.backgroundRepeat="no-repeat";P.style.backgroundPosition="-2px 50%";P.style.backgroundSize="20px";mxUtils.write(P,mxResources.get("property"));ca.style.cursor="pointer";var aa=function(){var Ca=Y.querySelectorAll(".gePropNonHeaderRow");if(X.editorUi.propertiesCollapsed){P.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ua="none";for(var qa=d.childNodes.length-1;0<=qa;qa--)try{var ha=
-d.childNodes[qa],ia=ha.nodeName.toUpperCase();"INPUT"!=ia&&"SELECT"!=ia||d.removeChild(ha)}catch(pa){}}else P.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ua="";for(qa=0;qa<Ca.length;qa++)Ca[qa].style.display=ua};mxEvent.addListener(ca,"click",function(){X.editorUi.propertiesCollapsed=!X.editorUi.propertiesCollapsed;aa()});ca.appendChild(P);var ea=document.createElement("th");ea.className="gePropHeaderCell";ea.style.paddingLeft="4px";mxUtils.write(ea,mxResources.get("value"));ca.appendChild(ea);
-Y.appendChild(ca);var oa=ea=!1;ca=null;1==x.vertices.length&&0==x.edges.length?ca=x.vertices[0].id:0==x.vertices.length&&1==x.edges.length&&(ca=x.edges[0].id);null==ca||C||(Y.appendChild(Z("id",mxUtils.htmlEntities(ca),{dispName:"id",type:"readOnly"},!0,!1)),null!=x.style&&null!=x.style.shape&&Y.appendChild(Z("shape",mxUtils.htmlEntities(x.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var ra in m)if(C=m[ra],("function"!=typeof C.isVisible||C.isVisible(x,this))&&!C.primary){var ta=null!=
-C.getValue?C.getValue(x,this):null!=x.style[ra]?mxUtils.htmlEntities(x.style[ra]+""):null!=C.getDefaultValue?C.getDefaultValue(x,this):C.defVal;if("separator"==C.type)oa=!oa;else{if("staticArr"==C.type)C.size=parseInt(x.style[C.sizeProperty]||m[C.sizeProperty].defVal)||0;else if(null!=C.dependentProps){var na=C.dependentProps,wa=[],ya=[];for(ca=0;ca<na.length;ca++)if(null!=m[na[ca]]){var Aa=x.style[na[ca]];ya.push(m[na[ca]].subDefVal);wa.push(null!=Aa?Aa.split(","):[])}C.dependentPropsDefVal=ya;C.dependentPropsVals=
-wa}Y.appendChild(Z(ra,ta,C,ea,oa));ea=!ea}}for(ca=0;ca<R.length;ca++)for(C=R[ca],m=C.parentRow,ra=0;ra<C.values.length;ra++)ea=Z(C.name,C.values[ra],{type:C.type,parentRow:C.parentRow,isDeletable:C.isDeletable,index:ra,defVal:C.defVal,countProperty:C.countProperty,size:C.size},0==ra%2,C.flipBkg),m.parentNode.insertBefore(ea,m.nextSibling),m=ea;d.appendChild(Y);aa();return d};StyleFormatPanel.prototype.addStyles=function(d){if(null!=this.defaultColorSchemes){var m=this.editorUi,x=m.editor.graph,C=
+document.activeElement)&&mxUtils.isAncestorNode(fa.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(la))}));if("color"==za)ka.appendChild(K(Da,ua,qa));else if("bool"==za||"boolean"==za)ka.appendChild(T(Da,ua,qa));else if("enum"==za){var xa=qa.enumList;ka.innerHTML="";var Ba=document.createElement("div");Ba.className="gePropValue";ka.appendChild(Ba);for(ia=0;ia<xa.length;ia++)if(pa=xa[ia],pa.val==ua){mxUtils.write(Ba,
+mxResources.get(pa.dispName,null,pa.dispName));break}mxEvent.addListener(ka,"click",mxUtils.bind(X,function(la){var Ea=mxEvent.getSource(la);if(!(Ea!=ka&&Ea!=Ba||mxEvent.isConsumed(la))){Ba.innerHTML="";var Ga=document.createElement("select"),Ja=null;G(ka,Ga);Ga.style.boxSizing="border-box";Ga.style.height="100%";Ga.style.padding="0";Ga.style.margin="0";Ga.style.border="0";for(la=0;la<xa.length;la++){Ea=xa[la];var Ha=document.createElement("option");Ha.value=mxUtils.htmlEntities(Ea.val);mxUtils.write(Ha,
+mxResources.get(Ea.dispName,null,Ea.dispName));Ga.appendChild(Ha);null==Ea.val&&(Ha.value="null",Ja=Ha)}Ga.value=null==ua&&null!=Ja?"null":ua;Ba.appendChild(Ga);mxEvent.addListener(Ga,"change",function(){var Ma=mxUtils.htmlEntities(Ga.value);if(Ga[Ga.selectedIndex]==Ja||"null"==Ma.value)Ma=null;F(Da,Ma,qa)});Ga.focus();mxEvent.addListener(Ga,"blur",function(){Ba.innerHTML="";for(var Ma=Ga[Ga.selectedIndex]==Ja||"null"==Ga.value?null:Ga.value,eb=0;eb<xa.length;eb++){var bb=xa[eb];if(bb.val==Ma){mxUtils.write(Ba,
+mxResources.get(bb.dispName,null,bb.dispName));break}}})}}))}else if("dynamicArr"==za)ka.appendChild(Q(Da,ua,qa.subType,qa.subDefVal,qa.countProperty,fa,ia));else if("staticArr"==za)ka.appendChild(ba(Da,ua,qa.subType,qa.subDefVal,qa.size,fa,ia));else if("readOnly"==za)ia=document.createElement("input"),ia.setAttribute("readonly",""),ia.value=ua,ia.style.borderWidth="0px","id"==Da||"shape"==Da?(fa.firstChild.innerHTML="",fa.firstChild.setAttribute("colspan","2"),ia.style.flexGrow="1",ia.style.marginLeft=
+"4px",ia.style.textAlign="id"==Da?"center":"left",ia.setAttribute("title",ua),pa=document.createElement("div"),mxUtils.write(pa,mxResources.get(Da)+":"),pa.style.display="inline-flex",pa.style.alignItems="center",pa.style.width="100%",pa.appendChild(ia),fa.firstChild.appendChild(pa)):(ia.style.width="96px",ka.appendChild(ia));else{ka.innerHTML="";var ma=document.createElement("div");ma.className="gePropValue";ka.appendChild(ma);ma.innerHTML=mxUtils.htmlEntities(mxUtils.safeDecodeURIComponent(ua));
+mxEvent.addListener(ka,"click",mxUtils.bind(X,function(la){function Ea(){var Ha=Ja.value,Ma=za;Ha=0==Ha.trim().length&&"string"!=Ma&&"numbers"!=Ma?qa.allowAuto?"auto":0:Ha;qa.allowAuto&&(null!=Ha.trim&&"auto"==Ha.trim().toLowerCase()?(Ha="auto",Ma="string"):(Ha=parseFloat(Ha),Ha=isNaN(Ha)?0:Ha));null!=qa.min&&Ha<qa.min?Ha=qa.min:null!=qa.max&&Ha>qa.max&&(Ha=qa.max);var eb=null;try{eb="numbers"==Ma?Ha.match(/\d*\.?\d+/g).map(Number).join(" "):"auto"===Ha&&qa.allowAuto&&"auto"==qa.defVal?null:encodeURIComponent(("int"==
+Ma?parseInt(Ha):Ha)+"")}catch(bb){}F(Da,eb,qa,null,Ja)}var Ga=mxEvent.getSource(la);if(!(Ga!=ka&&Ga!=ma||mxEvent.isConsumed(la))){ma.innerHTML="";var Ja=document.createElement("input");G(ma,Ja);Ja.value=mxUtils.safeDecodeURIComponent(ua);Ja.className="gePropEditor";"int"!=za&&"float"!=za||qa.allowAuto||(Ja.type="number",Ja.step="int"==za?"1":"any",null!=qa.min&&(Ja.min=parseFloat(qa.min)),null!=qa.max&&(Ja.max=parseFloat(qa.max)));ma.appendChild(Ja);mxEvent.addListener(Ja,"keypress",function(Ha){13==
+Ha.keyCode&&Ea()});Ja.focus();mxEvent.addListener(Ja,"blur",function(){Ea()})}}))}qa.isDeletable&&(ia=mxUtils.button("-",mxUtils.bind(X,function(la){F(Da,"",qa,qa.index);mxEvent.consume(la)})),ia.style.height="16px",ia.style.width="25px",ia.style.float="right",ia.className="geColorBtn",ka.appendChild(ia));fa.appendChild(ka);return fa}var X=this,da=this.editorUi.editor.graph,R=[],Y=document.createElement("table");Y.className="geProperties geFullWidthElement";var ca=document.createElement("tr");ca.className=
+"gePropHeader";var P=document.createElement("th");P.className="gePropHeaderCell";P.style.paddingLeft="16px";P.style.backgroundRepeat="no-repeat";P.style.backgroundPosition="-2px 50%";P.style.backgroundSize="20px";mxUtils.write(P,mxResources.get("property"));ca.style.cursor="pointer";var aa=function(){var Da=Y.querySelectorAll(".gePropNonHeaderRow");if(X.editorUi.propertiesCollapsed){P.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ua="none";for(var qa=d.childNodes.length-1;0<=qa;qa--)try{var ha=
+d.childNodes[qa],ia=ha.nodeName.toUpperCase();"INPUT"!=ia&&"SELECT"!=ia||d.removeChild(ha)}catch(pa){}}else P.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ua="";for(qa=0;qa<Da.length;qa++)Da[qa].style.display=ua};mxEvent.addListener(ca,"click",function(){X.editorUi.propertiesCollapsed=!X.editorUi.propertiesCollapsed;aa()});ca.appendChild(P);var ea=document.createElement("th");ea.className="gePropHeaderCell";ea.style.paddingLeft="4px";mxUtils.write(ea,mxResources.get("value"));ca.appendChild(ea);
+Y.appendChild(ca);var oa=ea=!1;ca=null;1==x.vertices.length&&0==x.edges.length?ca=x.vertices[0].id:0==x.vertices.length&&1==x.edges.length&&(ca=x.edges[0].id);null==ca||C||(Y.appendChild(Z("id",mxUtils.htmlEntities(ca),{dispName:"id",type:"readOnly"},!0,!1)),null!=x.style&&null!=x.style.shape&&Y.appendChild(Z("shape",mxUtils.htmlEntities(x.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var sa in m)if(C=m[sa],("function"!=typeof C.isVisible||C.isVisible(x,this))&&!C.primary){var ta=null!=
+C.getValue?C.getValue(x,this):null!=x.style[sa]?mxUtils.htmlEntities(x.style[sa]+""):null!=C.getDefaultValue?C.getDefaultValue(x,this):C.defVal;if("separator"==C.type)oa=!oa;else{if("staticArr"==C.type)C.size=parseInt(x.style[C.sizeProperty]||m[C.sizeProperty].defVal)||0;else if(null!=C.dependentProps){var na=C.dependentProps,wa=[],ya=[];for(ca=0;ca<na.length;ca++)if(null!=m[na[ca]]){var Aa=x.style[na[ca]];ya.push(m[na[ca]].subDefVal);wa.push(null!=Aa?Aa.split(","):[])}C.dependentPropsDefVal=ya;C.dependentPropsVals=
+wa}Y.appendChild(Z(sa,ta,C,ea,oa));ea=!ea}}for(ca=0;ca<R.length;ca++)for(C=R[ca],m=C.parentRow,sa=0;sa<C.values.length;sa++)ea=Z(C.name,C.values[sa],{type:C.type,parentRow:C.parentRow,isDeletable:C.isDeletable,index:sa,defVal:C.defVal,countProperty:C.countProperty,size:C.size},0==sa%2,C.flipBkg),m.parentNode.insertBefore(ea,m.nextSibling),m=ea;d.appendChild(Y);aa();return d};StyleFormatPanel.prototype.addStyles=function(d){if(null!=this.defaultColorSchemes){var m=this.editorUi,x=m.editor.graph,C=
document.createElement("div");C.style.padding="6px 20px 0 24px";d.appendChild(C);var F=document.createElement("div");F.className="geSwitcher";F.style.padding="4px 18px 6px 0px";for(var G=[],K=0;K<this.defaultColorSchemes.length;K++){var Q=document.createElement("div");Q.className="geSwitcherDot";mxUtils.bind(this,function(da){mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){ba(da)}))})(K);G.push(Q);F.appendChild(Q)}var ba=mxUtils.bind(this,function(da){null!=G[da]&&(null!=this.format.currentScheme&&
null!=G[this.format.currentScheme]&&(G[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=da,T(this.defaultColorSchemes[this.format.currentScheme]),G[this.format.currentScheme].style.background="#84d7ff")}),T=mxUtils.bind(this,function(da){var R=mxUtils.clone(x.defaultVertexStyle);R[mxConstants.STYLE_STROKECOLOR]=null!=R[mxConstants.STYLE_STROKECOLOR]?R[mxConstants.STYLE_STROKECOLOR]:"default";R[mxConstants.STYLE_FILLCOLOR]=null!=R[mxConstants.STYLE_FILLCOLOR]?R[mxConstants.STYLE_FILLCOLOR]:
-"default";R[mxConstants.STYLE_FONTCOLOR]=null!=R[mxConstants.STYLE_FONTCOLOR]?R[mxConstants.STYLE_FONTCOLOR]:"default";x.replaceDefaultColors(new mxCell,R);var Y=mxUtils.bind(this,function(P){var aa=mxUtils.button("",mxUtils.bind(this,function(ra){x.getModel().beginUpdate();try{for(var ta=m.getSelectionState().cells,na=x.getModel(),wa=[],ya=0<ta.length,Aa=0;Aa<ta.length;Aa++){var Ca=na.isVertex(ta[Aa])&&na.isEdge(na.getParent(ta[Aa])),ua=x.getCellStyle(ta[Aa]),qa=null!=ua&&"image"==ua.shape,ha=x.getCellGeometry(ta[Aa]);
-wa.push({isLabel:qa||Ca&&(null==ha||0>=ha.width||0>=ha.height)});Ca||qa||(ya=!1)}for(Aa=0;Aa<ta.length;Aa++){var ia=wa[Aa];if(ya||!ia.isLabel){var pa=ia.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,za=ia.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,fa=na.getStyle(ta[Aa]);null!=fa&&"string"!==typeof fa&&(fa=String(fa));null!=P?(mxEvent.isShiftDown(ra)||(fa=""==P.fill||null==P.fill?mxUtils.setStyle(fa,pa,null):mxUtils.setStyle(fa,pa,P.fill),
-ia.isLabel||(fa=""==P.gradient||null==P.gradient?mxUtils.setStyle(fa,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(fa,mxConstants.STYLE_GRADIENTCOLOR,P.gradient)),mxEvent.isControlDown(ra)||mxClient.IS_MAC&&mxEvent.isMetaDown(ra)||!na.isVertex(ta[Aa])||(fa=""==P.font||null==P.font?mxUtils.setStyle(fa,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(fa,mxConstants.STYLE_FONTCOLOR,P.font))),mxEvent.isAltDown(ra)||(fa=""==P.stroke||null==P.stroke?mxUtils.setStyle(fa,za,null):mxUtils.setStyle(fa,
+"default";R[mxConstants.STYLE_FONTCOLOR]=null!=R[mxConstants.STYLE_FONTCOLOR]?R[mxConstants.STYLE_FONTCOLOR]:"default";x.replaceDefaultColors(new mxCell,R);var Y=mxUtils.bind(this,function(P){var aa=mxUtils.button("",mxUtils.bind(this,function(sa){x.getModel().beginUpdate();try{for(var ta=m.getSelectionState().cells,na=x.getModel(),wa=[],ya=0<ta.length,Aa=0;Aa<ta.length;Aa++){var Da=na.isVertex(ta[Aa])&&na.isEdge(na.getParent(ta[Aa])),ua=x.getCellStyle(ta[Aa]),qa=null!=ua&&"image"==ua.shape,ha=x.getCellGeometry(ta[Aa]);
+wa.push({isLabel:qa||Da&&(null==ha||0>=ha.width||0>=ha.height)});Da||qa||(ya=!1)}for(Aa=0;Aa<ta.length;Aa++){var ia=wa[Aa];if(ya||!ia.isLabel){var pa=ia.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,za=ia.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,fa=na.getStyle(ta[Aa]);null!=fa&&"string"!==typeof fa&&(fa=String(fa));null!=P?(mxEvent.isShiftDown(sa)||(fa=""==P.fill||null==P.fill?mxUtils.setStyle(fa,pa,null):mxUtils.setStyle(fa,pa,P.fill),
+ia.isLabel||(fa=""==P.gradient||null==P.gradient?mxUtils.setStyle(fa,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(fa,mxConstants.STYLE_GRADIENTCOLOR,P.gradient)),mxEvent.isControlDown(sa)||mxClient.IS_MAC&&mxEvent.isMetaDown(sa)||!na.isVertex(ta[Aa])||(fa=""==P.font||null==P.font?mxUtils.setStyle(fa,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(fa,mxConstants.STYLE_FONTCOLOR,P.font))),mxEvent.isAltDown(sa)||(fa=""==P.stroke||null==P.stroke?mxUtils.setStyle(fa,za,null):mxUtils.setStyle(fa,
za,P.stroke))):(fa=mxUtils.setStyle(fa,pa,null),fa=mxUtils.setStyle(fa,za,null),ia.isLabel||(fa=mxUtils.setStyle(fa,mxConstants.STYLE_GRADIENTCOLOR,null)),na.isVertex(ta[Aa])&&(fa=mxUtils.setStyle(fa,mxConstants.STYLE_FONTCOLOR,null)));na.setStyle(ta[Aa],fa)}}}finally{x.getModel().endUpdate()}}));aa.className="geStyleButton";aa.style.width="36px";aa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";aa.style.margin="0px 6px 6px 0px";if(null!=P){var ea="1px solid";null!=P.border&&(ea=P.border);
if(null!=P.gradient)aa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(P.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(P.gradient).cssText+" 100%)";else if(P.fill==mxConstants.NONE)aa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==P.fill||""==P.fill)aa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(R,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var oa=mxUtils.getLightDarkColor(P.fill);aa.style.backgroundImage="linear-gradient(to right bottom, "+
oa.cssText+" 50%, "+oa.light+" 50.3%)"}null==P.stroke||P.stroke==mxConstants.NONE?aa.style.border=ea+" transparent":""==P.stroke?aa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(R,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(oa=mxUtils.getLightDarkColor(P.stroke),aa.style.border=ea+" "+oa.cssText,aa.style.borderRightColor=oa.light,aa.style.borderBottomColor=aa.style.borderRightColor);null!=P.title&&aa.setAttribute("title",P.title)}else ea=mxUtils.getValue(R,mxConstants.STYLE_FILLCOLOR,
@@ -14004,14 +14013,14 @@ d){var m=mxUtils.getValue(d,"fontSource",null);if(null!=m){var x=mxUtils.getValu
"mouseleave",function(F){m=null});this.isMouseInsertPoint=function(){return null!=m};var x=this.getInsertPoint;this.getInsertPoint=function(F){return null==m||F?x.apply(this,arguments):this.getPointForEvent(m)};var C=this.layoutManager.getLayout;this.layoutManager.getLayout=function(F){var G=this.graph.getCellStyle(F);if(null!=G&&"rack"==G.childLayout){var K=new mxStackLayout(this.graph,!1);K.gridSize=null!=G.rackUnitSize?parseFloat(G.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:
20;K.marginLeft=G.marginLeft||0;K.marginRight=G.marginRight||0;K.marginTop=G.marginTop||0;K.marginBottom=G.marginBottom||0;K.allowGaps=G.allowGaps||0;K.horizontal="1"==mxUtils.getValue(G,"horizontalRack","0");K.resizeParent=!1;K.fill=!0;return K}return C.apply(this,arguments)};this.updateGlobalUrlVariables()};var q=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(d,m){return Graph.processFontStyle(q.apply(this,arguments))};var t=mxSvgCanvas2D.prototype.updateTextNodes;
mxSvgCanvas2D.prototype.updateTextNodes=function(d,m,x,C,F,G,K,Q,ba,T,Z,X){t.apply(this,arguments);Graph.processFontAttributes(X)};var r=mxText.prototype.redraw;mxText.prototype.redraw=function(){r.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(d,m,x,C){function F(){for(var ca=Q.getSelectionCells(),P=[],aa=0;aa<ca.length;aa++)Q.isCellVisible(ca[aa])&&P.push(ca[aa]);Q.setSelectionCells(P)}function G(ca){Q.setHiddenTags(ca?
-[]:ba.slice());F();Q.refresh()}function K(ca,P){Z.innerText="";if(0<ca.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ea=document.createElement("tbody");if(null!=ca&&0<ca.length)for(var oa=0;oa<ca.length;oa++)(function(ra){function ta(){var ua=Q.getCellsForTags([ra],null,null,!0);Q.isEnabled()?Q.setSelectionCells(ua):Q.highlightCells(ua,null,null,70)}var na=0>mxUtils.indexOf(Q.hiddenTags,
-ra),wa=document.createElement("tr"),ya=document.createElement("td");ya.style.align="center";ya.style.width="16px";var Aa=document.createElement("img");Aa.setAttribute("src",na?Editor.visibleImage:Editor.hiddenImage);Aa.setAttribute("title",mxResources.get(na?"hideIt":"show",[ra])+"\n"+mxResources.get("shiftClickShowOnly",[ra]));mxUtils.setOpacity(Aa,na?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.style.width="16px";if(m||Editor.isDarkMode())Aa.style.filter=
-"invert(100%)";ya.appendChild(Aa);mxEvent.addListener(Aa,"click",function(ua){if(mxEvent.isShiftDown(ua)){for(var qa=[],ha=0;ha<ba.length;ha++)ba[ha]!==ra&&qa.push(ba[ha]);var ia=0<qa.length;for(ha=0;ha<qa.length;ha++)if(0>mxUtils.indexOf(Q.hiddenTags,qa[ha])){ia=!1;break}ia&&0>mxUtils.indexOf(Q.hiddenTags,ra)?Q.setHiddenTags([]):Q.setHiddenTags(qa)}else Q.toggleHiddenTag(ra);F();Q.refresh();mxEvent.consume(ua)});wa.appendChild(ya);ya=document.createElement("td");ya.style.align="center";ya.style.width=
+[]:ba.slice());F();Q.refresh()}function K(ca,P){Z.innerText="";if(0<ca.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ea=document.createElement("tbody");if(null!=ca&&0<ca.length)for(var oa=0;oa<ca.length;oa++)(function(sa){function ta(){var ua=Q.getCellsForTags([sa],null,null,!0);Q.isEnabled()?Q.setSelectionCells(ua):Q.highlightCells(ua,null,null,70)}var na=0>mxUtils.indexOf(Q.hiddenTags,
+sa),wa=document.createElement("tr"),ya=document.createElement("td");ya.style.align="center";ya.style.width="16px";var Aa=document.createElement("img");Aa.setAttribute("src",na?Editor.visibleImage:Editor.hiddenImage);Aa.setAttribute("title",mxResources.get(na?"hideIt":"show",[sa])+"\n"+mxResources.get("shiftClickShowOnly",[sa]));mxUtils.setOpacity(Aa,na?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.style.width="16px";if(m||Editor.isDarkMode())Aa.style.filter=
+"invert(100%)";ya.appendChild(Aa);mxEvent.addListener(Aa,"click",function(ua){if(mxEvent.isShiftDown(ua)){for(var qa=[],ha=0;ha<ba.length;ha++)ba[ha]!==sa&&qa.push(ba[ha]);var ia=0<qa.length;for(ha=0;ha<qa.length;ha++)if(0>mxUtils.indexOf(Q.hiddenTags,qa[ha])){ia=!1;break}ia&&0>mxUtils.indexOf(Q.hiddenTags,sa)?Q.setHiddenTags([]):Q.setHiddenTags(qa)}else Q.toggleHiddenTag(sa);F();Q.refresh();mxEvent.consume(ua)});wa.appendChild(ya);ya=document.createElement("td");ya.style.align="center";ya.style.width=
"16px";Aa=document.createElement("img");Aa.setAttribute("src",Editor.selectImage);Aa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Aa,na?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.style.width="16px";if(m||Editor.isDarkMode())Aa.style.filter="invert(100%)";mxEvent.addListener(Aa,"click",function(ua){G(!0);ta();mxEvent.consume(ua)});ya.appendChild(Aa);wa.appendChild(ya);ya=document.createElement("td");ya.style.overflow="hidden";
-ya.style.whiteSpace="nowrap";ya.style.textOverflow="ellipsis";ya.style.verticalAlign="middle";ya.style.cursor="pointer";ya.setAttribute("title",ra);a=document.createElement("a");mxUtils.write(a,ra);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,na?100:40);ya.appendChild(a);mxEvent.addListener(ya,"click",function(ua){if(mxEvent.isShiftDown(ua))G(!0),ta();else if(na&&0<Q.hiddenTags.length)G(!0);else{var qa=ba.slice(),ha=mxUtils.indexOf(qa,ra);qa.splice(ha,1);Q.setHiddenTags(qa);
-F();Q.refresh()}mxEvent.consume(ua)});wa.appendChild(ya);if(Q.isEnabled()){ya=document.createElement("td");ya.style.verticalAlign="middle";ya.style.textAlign="center";ya.style.width="18px";if(null==P){ya.style.align="center";ya.style.width="16px";Aa=document.createElement("img");Aa.setAttribute("src",Editor.trashImage);Aa.setAttribute("title",mxResources.get("removeIt",[ra]));mxUtils.setOpacity(Aa,na?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.style.width=
-"16px";if(m||Editor.isDarkMode())Aa.style.filter="invert(100%)";mxEvent.addListener(Aa,"click",function(ua){var qa=mxUtils.indexOf(ba,ra);0<=qa&&ba.splice(qa,1);Q.removeTagsForCells(Q.model.getDescendants(Q.model.getRoot()),[ra]);Q.refresh();mxEvent.consume(ua)});ya.appendChild(Aa)}else{var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.style.margin="0px";Ca.defaultChecked=null!=P&&0<=mxUtils.indexOf(P,ra);Ca.checked=Ca.defaultChecked;Ca.style.background="transparent";Ca.setAttribute("title",
-mxResources.get(Ca.defaultChecked?"removeIt":"add",[ra]));mxEvent.addListener(Ca,"change",function(ua){Ca.checked?Q.addTagsForCells(Q.getSelectionCells(),[ra]):Q.removeTagsForCells(Q.getSelectionCells(),[ra]);mxEvent.consume(ua)});ya.appendChild(Ca)}wa.appendChild(ya)}ea.appendChild(wa)})(ca[oa]);aa.appendChild(ea);Z.appendChild(aa)}}var Q=this,ba=Q.hiddenTags.slice(),T=document.createElement("div");T.style.userSelect="none";T.style.overflow="hidden";T.style.padding="10px";T.style.height="100%";var Z=
+ya.style.whiteSpace="nowrap";ya.style.textOverflow="ellipsis";ya.style.verticalAlign="middle";ya.style.cursor="pointer";ya.setAttribute("title",sa);a=document.createElement("a");mxUtils.write(a,sa);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,na?100:40);ya.appendChild(a);mxEvent.addListener(ya,"click",function(ua){if(mxEvent.isShiftDown(ua))G(!0),ta();else if(na&&0<Q.hiddenTags.length)G(!0);else{var qa=ba.slice(),ha=mxUtils.indexOf(qa,sa);qa.splice(ha,1);Q.setHiddenTags(qa);
+F();Q.refresh()}mxEvent.consume(ua)});wa.appendChild(ya);if(Q.isEnabled()){ya=document.createElement("td");ya.style.verticalAlign="middle";ya.style.textAlign="center";ya.style.width="18px";if(null==P){ya.style.align="center";ya.style.width="16px";Aa=document.createElement("img");Aa.setAttribute("src",Editor.trashImage);Aa.setAttribute("title",mxResources.get("removeIt",[sa]));mxUtils.setOpacity(Aa,na?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.style.width=
+"16px";if(m||Editor.isDarkMode())Aa.style.filter="invert(100%)";mxEvent.addListener(Aa,"click",function(ua){var qa=mxUtils.indexOf(ba,sa);0<=qa&&ba.splice(qa,1);Q.removeTagsForCells(Q.model.getDescendants(Q.model.getRoot()),[sa]);Q.refresh();mxEvent.consume(ua)});ya.appendChild(Aa)}else{var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.style.margin="0px";Da.defaultChecked=null!=P&&0<=mxUtils.indexOf(P,sa);Da.checked=Da.defaultChecked;Da.style.background="transparent";Da.setAttribute("title",
+mxResources.get(Da.defaultChecked?"removeIt":"add",[sa]));mxEvent.addListener(Da,"change",function(ua){Da.checked?Q.addTagsForCells(Q.getSelectionCells(),[sa]):Q.removeTagsForCells(Q.getSelectionCells(),[sa]);mxEvent.consume(ua)});ya.appendChild(Da)}wa.appendChild(ya)}ea.appendChild(wa)})(ca[oa]);aa.appendChild(ea);Z.appendChild(aa)}}var Q=this,ba=Q.hiddenTags.slice(),T=document.createElement("div");T.style.userSelect="none";T.style.overflow="hidden";T.style.padding="10px";T.style.height="100%";var Z=
document.createElement("div");Z.style.position="absolute";Z.style.boxSizing="border-box";Z.style.userSelect="none";Z.style.overflow="auto";Z.style.padding="3px";Z.style.left="0px";Z.style.right="0px";Z.style.top="0px";Z.style.bottom="0px";T.appendChild(Z);Q.addListener(mxEvent.ROOT,function(){ba=Q.hiddenTags.slice()});var X=mxUtils.bind(this,function(ca,P){if(d()){ca=Q.getAllTags();for(P=0;P<ca.length;P++)0>mxUtils.indexOf(ba,ca[P])&&ba.push(ca[P]);ba.sort();Q.isSelectionEmpty()?K(ba):K(ba,Q.getCommonTagsForCells(Q.getSelectionCells()))}});
Q.selectionModel.addListener(mxEvent.CHANGE,X);Q.model.addListener(mxEvent.CHANGE,X);Q.addListener(mxEvent.REFRESH,X);var da=document.createElement("div");da.className="geToolbarContainer geDialogToolbar";da.style.position="absolute";da.style.display="flex";da.style.bottom="0px";da.style.left="0px";da.style.right="0px";da.style.height="32px";da.style.overflow="hidden";da.style.padding="3px 4px 4px 4px";da.style.borderWidth="1px 0px 0px 0px";da.style.borderStyle="solid";da.style.whiteSpace="nowrap";
if(Q.isEnabled()){Z.style.bottom="32px";var R=document.createElement("a");R.className="geButton";var Y=R.cloneNode(!1);Y.style.backgroundImage="url("+Editor.visibleImage+")";Y.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(Y,"click",function(ca){Q.setHiddenTags([]);mxEvent.isShiftDown(ca)||(ba=Q.hiddenTags.slice());F();Q.refresh();mxEvent.consume(ca)});da.appendChild(Y);null!=x&&(R=R.cloneNode(!1),R.style.backgroundImage="url("+Editor.plusImage+")",R.setAttribute("title",mxResources.get("add")),
@@ -14020,8 +14029,8 @@ function(d){d=this.getCustomFonts(d);for(var m="",x="",C=0;C<d.length;C++){var F
F=!1,G=0;G<C.length;G++)C[G].getAttribute("face")==x&&(F=!0,C[G].setAttribute("face",d),null!=m?C[G].setAttribute("data-font-src",m):C[G].removeAttribute("data-font-src"));F||document.execCommand("fontname",!1,d)};var z=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return z.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=
null!=this.globalVars?mxUtils.clone(this.globalVars):{};var d=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=d)for(var m in d)this.globalVars[m]=d[m]}catch(x){null!=window.console&&console.log("Error in vars URL parameter: "+x)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var D=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(d){var m=D.apply(this,arguments);null==m&&null!=this.globalVars&&(m=this.globalVars[d]);
return m};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var d=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(d.ownerDocument)).decode(d)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var H=Graph.prototype.getSvg;Graph.prototype.getSvg=function(d,m,x,C,F,G,K,Q,ba,T,Z,X,da,R,Y,ca,P){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==
-typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(ta){}this.refreshMathBounds()}var aa=H.apply(this,arguments);if(null!=X){var ea=aa.getAttribute("style");null==ea&&(ea="");X="auto"==X||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":X;aa.setAttribute("style",ea+(" color-scheme: "+X+";"))}var oa=Z?this.getExtFontCss():"";if(0<oa.length){var ra=aa.ownerDocument;
-ea=null!=ra.createElementNS?ra.createElementNS(mxConstants.NS_SVG,"style"):ra.createElement("style");null!=ra.setAttributeNS?ea.setAttributeNS("type","text/css"):ea.setAttribute("type","text/css");ea.appendChild(ra.createTextNode(oa));aa.getElementsByTagName("defs")[0].appendChild(ea)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(aa);this.mathEnabled&&(document.body.appendChild(aa),Editor.MathJaxRender(aa),aa.parentNode.removeChild(aa),
+typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(ta){}this.refreshMathBounds()}var aa=H.apply(this,arguments);if(null!=X){var ea=aa.getAttribute("style");null==ea&&(ea="");X="auto"==X||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":X;aa.setAttribute("style",ea+(" color-scheme: "+X+";"))}var oa=Z?this.getExtFontCss():"";if(0<oa.length){var sa=aa.ownerDocument;
+ea=null!=sa.createElementNS?sa.createElementNS(mxConstants.NS_SVG,"style"):sa.createElement("style");null!=sa.setAttributeNS?ea.setAttributeNS("type","text/css"):ea.setAttribute("type","text/css");ea.appendChild(sa.createTextNode(oa));aa.getElementsByTagName("defs")[0].appendChild(ea)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(aa);this.mathEnabled&&(document.body.appendChild(aa),Editor.MathJaxRender(aa),aa.parentNode.removeChild(aa),
ea=aa.ownerDocument.getElementById("MJX-SVG-styles"),null!=ea&&aa.getElementsByTagName("defs")[0].appendChild(ea.cloneNode(!0)));return aa};var B=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(d){B.apply(this,arguments);null!=d.secondLabel&&(d.secondLabel.destroy(),d.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(d){return[d.shape,d.text,d.secondLabel,d.control]};var W=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=
function(){W.apply(this,arguments);this.enumerationState=0};var I=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(d){null!=d.shape&&this.redrawEnumerationState(d);return I.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(d){d=mxUtils.safeDecodeURIComponent(mxUtils.getValue(d.style,"enumerateValue",""));""==d&&(d=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(d)+
"</div>"};mxGraphView.prototype.redrawEnumerationState=function(d){var m="1"==mxUtils.getValue(d.style,"enumerate",0);m&&null==d.secondLabel?(d.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),d.secondLabel.size=12,d.secondLabel.state=d,d.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(d,d.secondLabel)):m||null==d.secondLabel||(d.secondLabel.destroy(),d.secondLabel=null);m=d.secondLabel;if(null!=m){var x=d.view.scale,
@@ -14034,88 +14043,89 @@ this.container.scrollLeft=0>F?0:Math.max(0,Math.min(C,F));this.container.scrollT
C.scrollLeft,C.scrollTop,600);null!=x&&window.setTimeout(x,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(d,m){var x=this.view.getState(d);if(null!=x){var C=this.view.graphBounds,F=this.view.scale;this.view.translate.x===-C.x&&this.view.translate.y===-C.y||this.view.scaleAndTranslate(F,-C.x,-C.y);d=this.container.clientWidth;var G=this.container.clientHeight,K=this.getBorder(),Q=C.width*F+2*K-d;K=C.height*F+2*K-G;if(null!=m){var ba=(x.x-C.x)*F,T=(x.y-C.y)*F,Z=(x.x+x.width-C.x)*F;
C=(x.y+x.height-C.y)*F;var X=this.container.scrollLeft;x=this.container.scrollTop;ba-m<X?X=ba-m:Z+m>X+d&&(X=Z+m-d);T-m<x?x=T-m:C+m>x+G&&(x=C+m-G)}else X=(x.x+x.width/2-C.x)*F-d/2,x=(x.y+x.height/2-C.y)*F-G/2;this.container.scrollLeft=0>Q?0:Math.max(0,Math.min(X,Q));this.container.scrollTop=0>K?0:Math.max(0,Math.min(x,K))}};Graph.prototype.scrollCellToVisibleBorder=function(d,m){null==m?this.scrollCellToVisible(d):(d=this.view.getState(d),null!=d&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+
d.x-m,-this.view.translate.y+d.y-m,d.width+2*m,d.height+2*m)))};Graph.prototype.smoothScrollCellToVisible=function(d,m,x){if(this.isGraphTornDown())null!=x&&x();else{var C=this.container,F=C.scrollLeft,G=C.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(d,m):this.scrollCellToVisibleBorder(d,m);Graph.smoothScrollContainer(C,F,G,C.scrollLeft,C.scrollTop,600);null!=x&&window.setTimeout(x,600)}};Graph.prototype.toggleCellsTransient=function(d){d=this.getNodesForCells(d);for(var m=
-0;m<d.length;m++){var x=d[m].style.opacity;x=""===x||null===x||0<parseFloat(x);d[m].style.opacity=x?0:1}};Graph.prototype.setCellStylesTransient=function(d,m,x){for(var C=0;C<x.length;C++){var F=this.view.getState(x[C]);null!=F&&null!=F.style&&(null==m?delete F.style[d]:F.style[d]=m,null!=F.shape&&(F.shape.apply(F),F.shape.redraw()),null!=F.text&&(F.text.apply(F),F.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(d,m,x){null==m&&(m="0");for(var C=0;C<x.length;C++){var F=this.view.getState(x[C]);
-if(null!=F&&null!=F.style){var G=mxUtils.getValue(F.style,d,m)?"0":"1";F.style[d]=G;null!=F.shape&&(F.shape.apply(F),F.shape.redraw());null!=F.text&&(F.text.apply(F),F.text.redraw())}}};Graph.prototype.executeCustomActions=function(d,m,x){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));
-else{this.executingCustomActions=!0;var C=!1,F=0,G=0,K=mxUtils.bind(this,function(){C||(C=!0,this.model.beginUpdate())}),Q=mxUtils.bind(this,function(){C&&(C=!1,this.model.endUpdate())}),ba=null==x,T=function(R){return null!=R.transient?R.transient:ba},Z=mxUtils.bind(this,function(){0<F&&F--;0==F&&da()}),X=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=m&&m();else if(G<d.length){do{var R=this.stoppingCustomActions,Y=d[G++],ca=
-[];if(null!=Y.open)if(Q(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,x)){this.stoppingCustomActions=this.executingCustomActions=!1;null!=m&&m();return}}else this.openLink(Y.open);null==Y.wait||R||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;Z()}),F++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Y.wait?parseInt(Y.wait):1E3),Q());null!=Y.opacity&&null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,
-!0)),Y.opacity.value);null!=Y.fadeIn&&(F++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,Z,R?0:Y.fadeIn.delay));null!=Y.fadeOut&&(F++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,!0)),1,0,Z,R?0:Y.fadeOut.delay));if(null!=Y.fadeTo&&null!=Y.fadeTo.value){F++;var P=this.getNodesForCells(this.getCellsForAction(Y.fadeTo,!0)),aa=R?0:null!=Y.fadeTo.delay?Y.fadeTo.delay:1E3;Graph.setTransitionForNodes(P,"all "+aa+"ms ease-in-out");Graph.setOpacityForNodes(P,
-Y.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(P,null);Z()},aa)}null!=Y.flow&&(aa=this.getCellsForAction(Y.flow,!0),Editor.toggleFlowAnimation(this,aa,!1===Y.flow.start?"stop":!0===Y.flow.start?"start":"toggle"));null!=Y.wipeIn&&(ca=ca.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,!0),!0)));null!=Y.wipeOut&&(ca=ca.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,!0),!1)));null!=Y.popIn&&(ca=ca.concat(this.createPopAnimations(this.getCellsForAction(Y.popIn,
+0;m<d.length;m++){var x=d[m].style.opacity;x=""===x||null===x||0<parseFloat(x);d[m].style.opacity=x?0:1}};Graph.prototype.setCellStylesTransient=function(d,m,x){for(var C=0;C<x.length;C++){var F=this.view.getState(x[C]);null!=F&&null!=F.style&&(null==m?delete F.style[d]:F.style[d]=m,this.redrawTransientStyle(F))}};Graph.prototype.redrawTransientStyle=function(d){null!=d.shape&&(d.shape.resetStyles(),this.cellRenderer.configureShape(d),d.shape.redraw());null!=d.text&&(d.text.resetStyles(),d.text.apply(d),
+d.text.valign=this.getVerticalAlign(d),d.text.redraw())};Graph.nextToggleStyleValue=function(d,m,x){return null!=m&&""!==m?null!=d&&String(d)==String(m)?x:m:null!=d&&""!==d&&0!=d&&"false"!==d?"0":"1"};Graph.prototype.toggleCellStyleValues=function(d,m,x,C){if(null!=C&&0<C.length){var F=mxUtils.getValue(this.getCurrentCellStyle(C[0]),d,x);this.setCellStyles(d,Graph.nextToggleStyleValue(F,m,x),C)}};Graph.prototype.toggleCellStylesTransient=function(d,m,x,C){for(var F=0;F<x.length;F++){var G=this.view.getState(x[F]);
+if(null!=G&&null!=G.style){var K=Graph.nextToggleStyleValue(mxUtils.getValue(G.style,d,m),C,m);null==K||""===K?delete G.style[d]:G.style[d]=K;this.redrawTransientStyle(G)}}};Graph.prototype.executeCustomActions=function(d,m,x){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=
+!0;var C=!1,F=0,G=0,K=mxUtils.bind(this,function(){C||(C=!0,this.model.beginUpdate())}),Q=mxUtils.bind(this,function(){C&&(C=!1,this.model.endUpdate())}),ba=null==x,T=function(R){return null!=R.transient?R.transient:ba},Z=mxUtils.bind(this,function(){0<F&&F--;0==F&&da()}),X=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=m&&m();else if(G<d.length){do{var R=this.stoppingCustomActions,Y=d[G++],ca=[];if(null!=Y.open)if(Q(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,
+x)){this.stoppingCustomActions=this.executingCustomActions=!1;null!=m&&m();return}}else this.openLink(Y.open);null==Y.wait||R||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;Z()}),F++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Y.wait?parseInt(Y.wait):1E3),Q());null!=Y.opacity&&null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,!0)),Y.opacity.value);
+null!=Y.fadeIn&&(F++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,Z,R?0:Y.fadeIn.delay));null!=Y.fadeOut&&(F++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,!0)),1,0,Z,R?0:Y.fadeOut.delay));if(null!=Y.fadeTo&&null!=Y.fadeTo.value){F++;var P=this.getNodesForCells(this.getCellsForAction(Y.fadeTo,!0)),aa=R?0:null!=Y.fadeTo.delay?Y.fadeTo.delay:1E3;Graph.setTransitionForNodes(P,"all "+aa+"ms ease-in-out");Graph.setOpacityForNodes(P,Y.fadeTo.value);
+window.setTimeout(function(){Graph.setTransitionForNodes(P,null);Z()},aa)}null!=Y.flow&&(aa=this.getCellsForAction(Y.flow,!0),Editor.toggleFlowAnimation(this,aa,!1===Y.flow.start?"stop":!0===Y.flow.start?"start":"toggle"));null!=Y.wipeIn&&(ca=ca.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,!0),!0)));null!=Y.wipeOut&&(ca=ca.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,!0),!1)));null!=Y.popIn&&(ca=ca.concat(this.createPopAnimations(this.getCellsForAction(Y.popIn,
!0),!0)));null!=Y.popOut&&(ca=ca.concat(this.createPopAnimations(this.getCellsForAction(Y.popOut,!0),!1)));null!=Y.toggle&&(T(Y.toggle)?this.toggleCellsTransient(this.getCellsForAction(Y.toggle,!0)):(K(),this.toggleCells(this.getCellsForAction(Y.toggle,!0,!0))));null!=Y.show&&(aa=this.getCellsForAction(Y.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(aa),1),T(Y.show)||(K(),this.setCellsVisible(this.getCellsForAction(Y.show,!0,!0),!0)));null!=Y.hide&&(aa=this.getCellsForAction(Y.hide,!0),
-Graph.setOpacityForNodes(this.getNodesForCells(aa),0),T(Y.hide)||(K(),this.setCellsVisible(this.getCellsForAction(Y.hide,!0,!0),!1)));if(null!=Y.toggleStyle&&null!=Y.toggleStyle.key){aa=this.getCellsForAction(Y.toggleStyle,!0);var ea=null!=Y.toggleStyle.defaultValue?Y.toggleStyle.defaultValue:"0";T(Y.toggleStyle)?this.toggleCellStylesTransient(Y.toggleStyle.key,ea,aa):(K(),this.toggleCellStyles(Y.toggleStyle.key,ea,aa))}null!=Y.style&&null!=Y.style.key&&(aa=this.getCellsForAction(Y.style,!0),T(Y.style)?
-this.setCellStylesTransient(Y.style.key,Y.style.value,aa):(K(),this.setCellStyles(Y.style.key,Y.style.value,aa)));aa=[];null!=Y.select&&this.isEnabled()&&(aa=this.getCellsForAction(Y.select),this.setSelectionCells(aa));null!=Y.highlight&&(aa=this.getCellsForAction(Y.highlight),this.highlightCells(aa,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));null!=Y.scroll&&(aa=this.getCellsForAction(Y.scroll));if(null!=Y.viewbox){ea=Y.viewbox;if(null!=ea.cells||null!=ea.tags||null!=ea.layers){var oa=
-this.getBoundingBox(this.getCellsForAction(ea));if(null!=oa){var ra=this.useCssTransforms?1:this.view.scale,ta=this.useCssTransforms?new mxPoint(0,0):this.view.translate,na=null==ea.border||""===ea.border||isNaN(parseFloat(ea.border))?null:2*parseFloat(ea.border);ea={x:oa.x/ra-ta.x,y:oa.y/ra-ta.y,width:Math.max(1,oa.width/ra),height:Math.max(1,oa.height/ra),border:na,smooth:ea.smooth}}else ea=null}null!=ea&&(!0!==ea.smooth||R?this.useCssTransforms?this.fitBoundsCssTransform(ea,ea.border):this.fitWindow(ea,
-ea.border):(F++,this.smoothFitWindow(ea,ea.border,Z)))}0<aa.length&&(ea=null==Y.scroll||null==Y.scroll.border||""===Y.scroll.border||isNaN(parseFloat(Y.scroll.border))?null:parseFloat(Y.scroll.border),null==Y.scroll||!0!==Y.scroll.smooth||R?this.useCssTransforms?this.scrollCellToVisibleCssTransform(aa[0],ea):this.scrollCellToVisibleBorder(aa[0],ea):(F++,this.smoothScrollCellToVisible(aa[0],ea,Z)));null!=x&&null!=Y.explore&&Graph.exploreFromCell(this,x,Y.explore);if(null!=Y.tags){if(null!=Y.tags.toggle)for(ea=
-Y.tags.toggle,0==ea.length&&(ea=this.getAllTags()),aa=0;aa<ea.length;aa++)this.toggleHiddenTag(ea[aa]);ea=null;null!=Y.tags.hidden&&(null==ea&&(ea=[]),ea=ea.concat(Y.tags.hidden));if(null!=Y.tags.visible)for(null==ea&&(ea=[]),oa=this.getAllTags(),aa=0;aa<oa.length;aa++)0>mxUtils.indexOf(Y.tags.visible,oa[aa])&&0>mxUtils.indexOf(ea,oa[aa])&&ea.push(oa[aa]);null!=ea&&this.setHiddenTags(ea);this.refresh()}if(0<ca.length){F++;aa=null!=Y.steps?Y.steps:30;ea=Y.delay;oa=["wipeIn","wipeOut","popIn","popOut"];
-ra=null;for(ta=0;ta<oa.length;ta++)na=Y[oa[ta]],null!=na&&null!=na.delay&&(ra=null==ra?na.delay:Math.max(ra,na.delay));null!=ra&&(ea=ra/aa);this.executeAnimations(ca,Z,R?1:aa,R?0:ea)}}while(G<d.length&&!0===d[G].immediate&&!this.stoppingCustomActions);0==F?da():Q()}else this.stoppingCustomActions=this.executingCustomActions=!1,Q(),null!=m&&m()}),da=mxUtils.bind(this,function(){try{X()}catch(R){throw this.stoppingCustomActions=this.executingCustomActions=!1,Q(),R;}});da()}};Graph.prototype.doUpdateCustomLinksForCell=
+Graph.setOpacityForNodes(this.getNodesForCells(aa),0),T(Y.hide)||(K(),this.setCellsVisible(this.getCellsForAction(Y.hide,!0,!0),!1)));if(null!=Y.toggleStyle&&null!=Y.toggleStyle.key){aa=this.getCellsForAction(Y.toggleStyle,!0);var ea=Y.toggleStyle.value,oa=""!==Y.toggleStyle.defaultValue?Y.toggleStyle.defaultValue:null;T(Y.toggleStyle)?this.toggleCellStylesTransient(Y.toggleStyle.key,oa,aa,ea):(K(),this.toggleCellStyleValues(Y.toggleStyle.key,ea,oa,aa))}null!=Y.style&&null!=Y.style.key&&(aa=this.getCellsForAction(Y.style,
+!0),T(Y.style)?this.setCellStylesTransient(Y.style.key,Y.style.value,aa):(K(),this.setCellStyles(Y.style.key,Y.style.value,aa)));aa=[];null!=Y.select&&this.isEnabled()&&(aa=this.getCellsForAction(Y.select),this.setSelectionCells(aa));null!=Y.highlight&&(aa=this.getCellsForAction(Y.highlight),this.highlightCells(aa,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));null!=Y.scroll&&(aa=this.getCellsForAction(Y.scroll));if(null!=Y.viewbox){ea=Y.viewbox;if(null!=ea.cells||null!=ea.tags||null!=
+ea.layers)if(oa=this.getBoundingBox(this.getCellsForAction(ea)),null!=oa){var sa=this.useCssTransforms?1:this.view.scale,ta=this.useCssTransforms?new mxPoint(0,0):this.view.translate,na=null==ea.border||""===ea.border||isNaN(parseFloat(ea.border))?null:2*parseFloat(ea.border);ea={x:oa.x/sa-ta.x,y:oa.y/sa-ta.y,width:Math.max(1,oa.width/sa),height:Math.max(1,oa.height/sa),border:na,smooth:ea.smooth}}else ea=null;null!=ea&&(!0!==ea.smooth||R?this.useCssTransforms?this.fitBoundsCssTransform(ea,ea.border):
+this.fitWindow(ea,ea.border):(F++,this.smoothFitWindow(ea,ea.border,Z)))}0<aa.length&&(ea=null==Y.scroll||null==Y.scroll.border||""===Y.scroll.border||isNaN(parseFloat(Y.scroll.border))?null:parseFloat(Y.scroll.border),null==Y.scroll||!0!==Y.scroll.smooth||R?this.useCssTransforms?this.scrollCellToVisibleCssTransform(aa[0],ea):this.scrollCellToVisibleBorder(aa[0],ea):(F++,this.smoothScrollCellToVisible(aa[0],ea,Z)));null!=x&&null!=Y.explore&&Graph.exploreFromCell(this,x,Y.explore);if(null!=Y.tags){if(null!=
+Y.tags.toggle)for(ea=Y.tags.toggle,0==ea.length&&(ea=this.getAllTags()),aa=0;aa<ea.length;aa++)this.toggleHiddenTag(ea[aa]);ea=null;null!=Y.tags.hidden&&(null==ea&&(ea=[]),ea=ea.concat(Y.tags.hidden));if(null!=Y.tags.visible)for(null==ea&&(ea=[]),oa=this.getAllTags(),aa=0;aa<oa.length;aa++)0>mxUtils.indexOf(Y.tags.visible,oa[aa])&&0>mxUtils.indexOf(ea,oa[aa])&&ea.push(oa[aa]);null!=ea&&this.setHiddenTags(ea);this.refresh()}if(0<ca.length){F++;aa=null!=Y.steps?Y.steps:30;ea=Y.delay;oa=["wipeIn","wipeOut",
+"popIn","popOut"];sa=null;for(ta=0;ta<oa.length;ta++)na=Y[oa[ta]],null!=na&&null!=na.delay&&(sa=null==sa?na.delay:Math.max(sa,na.delay));null!=sa&&(ea=sa/aa);this.executeAnimations(ca,Z,R?1:aa,R?0:ea)}}while(G<d.length&&!0===d[G].immediate&&!this.stoppingCustomActions);0==F?da():Q()}else this.stoppingCustomActions=this.executingCustomActions=!1,Q(),null!=m&&m()}),da=mxUtils.bind(this,function(){try{X()}catch(R){throw this.stoppingCustomActions=this.executingCustomActions=!1,Q(),R;}});da()}};Graph.prototype.doUpdateCustomLinksForCell=
function(d,m){var x=this.getLinkForCell(m);null!=x&&"data:action/json,"==x.substring(0,17)&&this.setLinkForCell(m,this.updateCustomLink(d,x));if(this.isHtmlLabel(m)){var C=document.createElement("div");C.innerHTML=Graph.sanitizeHtml(this.getLabel(m));for(var F=C.getElementsByTagName("a"),G=!1,K=0;K<F.length;K++)x=F[K].getAttribute("href"),null!=x&&"data:action/json,"==x.substring(0,17)&&(F[K].setAttribute("href",this.updateCustomLink(d,x)),G=!0);G&&this.labelChanged(m,C.innerHTML)}};Graph.prototype.updateCustomLink=
function(d,m){if("data:action/json,"==m.substring(0,17))try{var x=JSON.parse(m.substring(17));null!=x.actions&&(this.updateCustomLinkActions(d,x.actions),m="data:action/json,"+JSON.stringify(x))}catch(C){}return m};Graph.prototype.updateCustomLinkActions=function(d,m){for(var x=0;x<m.length;x++){var C=m[x],F;for(F in C)this.updateCustomLinkAction(d,C[F],"cells"),this.updateCustomLinkAction(d,C[F],"excludeCells"),this.updateCustomLinkAction(d,C[F],"layers")}};Graph.prototype.updateCustomLinkAction=
function(d,m,x){if(null!=m&&null!=m[x]){for(var C=[],F=0;F<m[x].length;F++)if("*"==m[x][F])C.push(m[x][F]);else{var G=d[m[x][F]];null!=G?""!=G&&C.push(G):C.push(m[x][F])}m[x]=C}};Graph.prototype.getCellsForAction=function(d,m,x){var C="or"===d.tagsMatch?"or":"and",F={},G=[],K=function(Q){for(var ba=0;ba<Q.length;ba++){var T=Q[ba].id;F[T]||(F[T]=!0,G.push(Q[ba]))}};K(this.getCellsById(d.cells));K(this.getCellsForTags(d.tags,null,m,!1,C));K(x?this.getLayerCells(d.layers):this.getCellsForLayers(d.layers));
-if(null!=d.excludeCells&&0<d.excludeCells.length){m={};C=!1;for(x=0;x<d.excludeCells.length;x++){if("*"===d.excludeCells[x]){C=!0;break}m[d.excludeCells[x]]=!0}if(C)return[];d=[];for(x=0;x<G.length;x++)m[G[x].id]||d.push(G[x]);return d}return G};Graph.prototype.getCellsById=function(d){var m=[];if(null!=d)for(var x=0;x<d.length;x++)if("*"==d[x]){var C=this.model.getRoot();m=m.concat(this.model.filterDescendants(function(G){return G!=C},C))}else{var F=this.model.getCell(d[x]);null!=F&&m.push(F)}return m};
-Graph.prototype.getCellsForLayers=function(d){var m=[];if(Array.isArray(d))for(var x=0;x<d.length;x++){var C=this.model.getCell(d[x]);null!=C&&(m=m.concat(this.model.filterDescendants(function(F){return F!=C},C)))}return m};Graph.prototype.getLayerCells=function(d){var m=[];if(Array.isArray(d))for(var x=0;x<d.length;x++){var C=this.model.getCell(d[x]);null!=C&&m.push(C)}return m};var S=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(d){return S.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(d))};
-Graph.prototype.setHiddenTags=function(d){this.hiddenTags=d;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(d){var m=mxUtils.indexOf(this.hiddenTags,d);0>m?this.hiddenTags.push(d):0<=m&&this.hiddenTags.splice(m,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(d){if(null==d||0==d.length||0==this.hiddenTags.length)return!1;d=d.split(" ");if(d.length>this.hiddenTags.length)return!1;for(var m=0;m<d.length;m++)if(0>
-mxUtils.indexOf(this.hiddenTags,d[m]))return!1;return!0};Graph.prototype.getCellsForTags=function(d,m,x,C,F){var G=[];F="or"===F;if(null!=d){m=null!=m?m:this.model.getDescendants(this.model.getRoot());for(var K=0,Q={},ba=0;ba<d.length;ba++)0<d[ba].length&&(Q[d[ba]]=!0,K++);for(ba=0;ba<m.length;ba++)if(x&&this.model.getParent(m[ba])==this.model.root||this.model.isVertex(m[ba])||this.model.isEdge(m[ba])){var T=this.getTagsForCell(m[ba]),Z=!1;if(0<T.length&&(T=T.split(" "),F||T.length>=d.length)){for(var X=
-Z=0;X<T.length&&Z<K;X++)null!=Q[T[X]]&&Z++;Z=F?0<Z:Z==K}Z&&(1!=C||this.isCellVisible(m[ba]))&&G.push(m[ba])}}return G};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(d){for(var m=null,x=[],C=0;C<d.length;C++){var F=this.getTagsForCell(d[C]);x=[];if(0<F.length){F=F.split(" ");for(var G={},K=0;K<F.length;K++)if(null==m||null!=m[F[K]])G[F[K]]=!0,x.push(F[K]);m=G}else return[]}return x};
-Graph.prototype.getTagsForCells=function(d){for(var m=[],x={},C=0;C<d.length;C++){var F=this.getTagsForCell(d[C]);if(0<F.length){F=F.split(" ");for(var G=0;G<F.length;G++)null==x[F[G]]&&(x[F[G]]=!0,m.push(F[G]))}}return m};Graph.prototype.getTagsForCell=function(d){return this.getAttributeForCell(d,"tags","")};Graph.prototype.addTagsForCells=function(d,m){if(0<d.length&&0<m.length){this.model.beginUpdate();try{for(var x=0;x<d.length;x++){for(var C=this.getTagsForCell(d[x]),F=C.split(" "),G=!1,K=0;K<
-m.length;K++){var Q=mxUtils.trim(m[K]);""!=Q&&0>mxUtils.indexOf(F,Q)&&(C=0<C.length?C+" "+Q:Q,G=!0)}G&&this.setAttributeForCell(d[x],"tags",C)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(d,m){if(0<d.length&&0<m.length){this.model.beginUpdate();try{for(var x=0;x<d.length;x++){var C=this.getTagsForCell(d[x]);if(0<C.length){for(var F=C.split(" "),G=!1,K=0;K<m.length;K++){var Q=mxUtils.indexOf(F,m[K]);0<=Q&&(F.splice(Q,1),G=!0)}G&&this.setAttributeForCell(d[x],"tags",
-F.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(d){this.model.beginUpdate();try{for(var m=0;m<d.length;m++)this.model.setVisible(d[m],!this.model.isVisible(d[m]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(d,m){this.model.beginUpdate();try{for(var x=0;x<d.length;x++)this.model.setVisible(d[x],m)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(d,m,x,C){for(var F=0;F<d.length;F++)this.highlightCell(d[F],m,
-x,C)};Graph.prototype.highlightCell=function(d,m,x,C,F){m=null!=m?m:mxConstants.DEFAULT_VALID_COLOR;x=null!=x?x:1E3;d=this.view.getState(d);var G=null;null!=d&&(F=null!=F?F:4,F=Math.max(F+1,mxUtils.getValue(d.style,mxConstants.STYLE_STROKEWIDTH,1)+F),G=new mxCellHighlight(this,m,F,!1),null!=C&&(G.opacity=C),G.highlight(d),window.setTimeout(function(){null!=G.shape&&(mxUtils.setPrefixedStyle(G.shape.node.style,"transition","all 1200ms ease-in-out"),G.shape.node.style.opacity=0);window.setTimeout(function(){G.destroy()},
-1200)},x));return G};Graph.prototype.addSvgShadow=function(d,m,x,C){C=null!=C?C:!0;var F=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=x&&x||(m=null!=m?m:d.getElementsByTagName("g")[0],null!=m&&(this.updateShadowFilter(m,!0),!isNaN(parseInt(d.getAttribute("width")))&&C&&(d.setAttribute("width",parseInt(d.getAttribute("width"))+F),d.setAttribute("height",parseInt(d.getAttribute("height"))+F),m=d.getAttribute("viewBox"),null!=m&&0<m.length&&(m=m.split(" "),3<m.length&&(w=parseFloat(m[2])+F,
-h=parseFloat(m[3])+F,d.setAttribute("viewBox",m[0]+" "+m[1]+" "+w+" "+h))))));return F};Graph.prototype.updateShadowFilter=function(d,m){mxClient.IS_SF||(m?(m=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),d.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+m.cssText+")"):d.style.filter="")};Graph.prototype.setShadowVisible=function(d,m){m=null!=m?m:!0;this.shadowVisible=
-d;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);m&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var d=this.model.getChildCount(this.model.root),m=0;do var x=this.model.getChildAt(this.model.root,
-m);while(m++<d&&"1"==mxUtils.getValue(this.getCellStyle(x),"locked","0"));null!=x&&this.setDefaultParent(x)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=
-[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",
-STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",
-STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=
-[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=
-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=
-[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];
-mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+
-"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=
-[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate4=[SHAPES_PATH+"/mxArchiMate3.js",SHAPES_PATH+"/mxArchiMate4.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",
-STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.atlassian2=[SHAPES_PATH+"/mxAtlassian2.js",STENCIL_PATH+"/atlassian2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+
-"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
-[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(d){var m=null;null!=d&&0<d.length&&("ER"==d.substring(0,2)?m="mxgraph.er":"sysML"==d.substring(0,5)&&(m="mxgraph.sysml"));return m};var V=mxMarker.createMarker;mxMarker.createMarker=function(d,m,x,C,F,G,K,
-Q,ba,T){if(null!=x&&null==mxMarker.markers[x]){var Z=this.getPackageForType(x);null!=Z&&mxStencilRegistry.getStencil(Z)}return V.apply(this,arguments)};var ja=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(d,m,x,C,F,G){"1"==mxUtils.getValue(m.style,"lineShape",null)&&d.setFillColor(mxUtils.getValue(m.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ja.apply(this,arguments)};PrintDialog.prototype.create=function(d,m,x,C){function F(){aa.value=Math.max(1,Math.min(da,Math.max(parseInt(aa.value),
-parseInt(P.value))));P.value=Math.max(1,Math.min(da,Math.min(parseInt(aa.value),parseInt(P.value))))}function G(Ha){d.lastPrintPagesRadioChecked=ca.checked;d.lastPrintSelectionOnlyChecked=ea.checked;d.lastPrintCropRadioChecked=ra.checked;d.lastPrintFitRadioChecked=ta.checked;ca.checked&&P.value<aa.value?(d.lastPrintPagesFromInput=P.value,d.lastPrintPagesToInput=aa.value):(d.lastPrintPagesFromInput=null,d.lastPrintPagesToInput=null);ka.value=Math.max(1,Math.min(1600,parseInt(ka.value)))+"%";d.lastPrintZoom=
-ka.value;d.lastPrintBorder=fa.value;d.lastPrintGrid=xa.checked;d.lastPrintShadow=Ba.checked;d.lastPrintTransparent=ma.checked;d.lastPrintInclude=la.checked;d.lastPrintIcons=Ea.checked;d.lastPrintSheetsAcross=pa.value;d.lastPrintSheetsDown=za.value;var Ma={};Ma.border=parseInt(fa.value);Ma.scale=parseInt(ka.value)/100;Ma.grid=xa.checked;Ma.shadows=Ba.checked;Ma.transparent=ma.checked;Ma.includeCopy=la.checked;Ma.icons=Ea.checked&&EditorUi.isElectronApp;Ma.sheetsAcross=parseInt(pa.value);Ma.sheetsDown=
-parseInt(za.value);Ma.pagesFrom=parseInt(P.value);Ma.pagesTo=parseInt(aa.value);Ma.allPages=R.checked;Ma.selection=ea.checked;Ma.pageView=oa.checked;Ma.crop=ra.checked;Ma.fit=ta.checked;return null!=x?x(!Ha,Ma):d.print(!Ha,Ma)}function K(Ha){try{d.hideDialog(),null!=x?G(Ha):d.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{G(Ha),d.spinner.stop()}catch(Ma){d.handleError(Ma)}},0)}catch(Ma){d.handleError(Ma)}}var Q=d.editor.graph,ba=document.createElement("div");
-ba.style.display="flex";ba.style.flexDirection="column";ba.style.minHeight="0";var T=document.createElement("div");T.style.flex="1 1 auto";T.style.minHeight="0";T.style.overflowY="auto";ba.appendChild(T);var Z=document.createElement("h3");mxUtils.write(Z,m||mxResources.get("print"));T.appendChild(Z);var X=1,da=1;Z=document.createElement("div");Z.className="geDialogSection";Z.style.whiteSpace="nowrap";var R=document.createElement("input");R.style.marginRight="8px";R.setAttribute("type","radio");R.setAttribute("name",
-"pages-printdialog");R.setAttribute("id","gePrintDlgAllPages");var Y=document.createElement("div");Y.className="geDialogCheckRow";Y.appendChild(R);m=document.createElement("label");m.setAttribute("for","gePrintDlgAllPages");mxUtils.write(m,mxResources.get("allPages"));Y.appendChild(m);Z.appendChild(Y);var ca=document.createElement("input");ca.style.marginRight="8px";ca.setAttribute("type","radio");ca.setAttribute("name","pages-printdialog");ca.setAttribute("id","gePrintDlgPages");Y=document.createElement("div");
-Y.className="geDialogCheckRow";Y.appendChild(ca);m=document.createElement("label");m.setAttribute("for","gePrintDlgPages");mxUtils.write(m,mxResources.get("pages")+":");Y.appendChild(m);var P=document.createElement("input");P.style.margin="0 4px";P.setAttribute("value","1");P.setAttribute("type","number");P.setAttribute("min","1");P.style.width="40px";Y.appendChild(P);m=document.createElement("span");mxUtils.write(m,mxResources.get("to"));Y.appendChild(m);var aa=P.cloneNode(!0);Y.appendChild(aa);
-mxEvent.addListener(P,"focus",function(){ca.checked=!0});mxEvent.addListener(aa,"focus",function(){ca.checked=!0});mxEvent.addListener(P,"change",F);mxEvent.addListener(aa,"change",F);if(null!=d.pages&&(da=d.pages.length,null!=d.currentPage))for(m=0;m<da;m++)if(d.currentPage==d.pages[m]){X=m+1;break}null!=d.lastPrintPagesFromInput&&null!=d.lastPrintPagesToInput?(P.value=Math.min(da,Math.max(1,d.lastPrintPagesFromInput)),aa.value=Math.min(da,Math.max(1,d.lastPrintPagesToInput))):(P.value=X,aa.value=
-X);P.setAttribute("max",da);aa.setAttribute("max",da);m=mxUtils.button(mxResources.get("currentPage"),function(Ha){P.value=X;aa.value=X;ca.checked=!0});m.className="geBtn";m.setAttribute("title",mxResources.get("currentPage"));m.style.marginLeft="4px";m.style.maxWidth="100px";Y.appendChild(m);Z.appendChild(Y);1<da&&T.appendChild(Z);Y=document.createElement("div");Y.className="geDialogCheckRow";var ea=document.createElement("input");ea.setAttribute("name","pages-printdialog");ea.setAttribute("type",
-1==da?"checkbox":"radio");ea.setAttribute("id","gePrintDlgSelectionOnly");ea.style.marginRight="8px";Q.isSelectionEmpty()&&ea.setAttribute("disabled","disabled");Q.isEnabled()&&(Y.appendChild(ea),m=document.createElement("label"),m.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(m,mxResources.get("selectionOnly")),Y.appendChild(m));Q.isEnabled()&&(1<da?Z.appendChild(Y):(m=document.createElement("div"),m.className="geDialogSection",m.appendChild(Y),T.appendChild(m)));!d.isPagesEnabled()||
-d.lastPrintPagesRadioChecked?ca.checked=!0:!Q.isSelectionEmpty()&&d.lastPrintSelectionOnlyChecked?ea.checked=!0:R.checked=!0;Q=d.addAdvancedSection(T);T=Q.content;Z=document.createElement("div");Z.className="geDialogCheckRow";var oa=document.createElement("input");oa.style.marginRight="8px";oa.setAttribute("type","radio");oa.setAttribute("name","printSize");oa.setAttribute("id","gePrintDlgPageView");Z.appendChild(oa);m=document.createElement("label");m.setAttribute("for","gePrintDlgPageView");mxUtils.write(m,
-mxResources.get("pageView"));Z.appendChild(m);mxEvent.addListener(Z,"click",function(){oa.checked=!0});T.appendChild(Z);Z=document.createElement("div");Z.className="geDialogCheckRow";var ra=document.createElement("input");ra.style.marginRight="8px";ra.setAttribute("type","radio");ra.setAttribute("name","printSize");ra.setAttribute("id","gePrintDlgCrop");Z.appendChild(ra);m=document.createElement("label");m.setAttribute("for","gePrintDlgCrop");mxUtils.write(m,mxResources.get("crop"));Z.appendChild(m);
-mxEvent.addListener(Z,"click",function(){ra.checked=!0});T.appendChild(Z);Z=document.createElement("div");Z.className="geDialogCheckRow";Z.style.alignItems="flex-start";var ta=document.createElement("input");ta.style.marginTop="4px";ta.setAttribute("type","radio");ta.setAttribute("name","printSize");Z.appendChild(ta);Y=document.createElement("table");Y.style.display="inline-block";Y.style.borderSpacing="0";var na=document.createElement("tbody"),wa=document.createElement("tr"),ya=wa.cloneNode(!0),
-Aa=document.createElement("td"),Ca=Aa.cloneNode(!0),ua=Aa.cloneNode(!0),qa=Aa.cloneNode(!0),ha=Aa.cloneNode(!0),ia=Aa.cloneNode(!0);Aa.style.textAlign="right";qa.style.textAlign="right";mxUtils.write(Aa,mxResources.get("fitTo"));mxEvent.addListener(Z,"click",function(Ha){mxEvent.getSource(Ha)!=ta&&(ta.checked=!ta.checked)});var pa=document.createElement("input");pa.style.margin="0 2px";pa.style.boxSizing="border-box";pa.setAttribute("value",d.lastPrintSheetsAcross||"1");pa.setAttribute("min","1");
-pa.setAttribute("type","number");pa.style.width="40px";Ca.appendChild(pa);m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsAcross"));ua.appendChild(m);mxUtils.write(qa,mxResources.get("fitToBy"));var za=pa.cloneNode(!0);za.setAttribute("value",d.lastPrintSheetsDown||"1");ha.appendChild(za);mxEvent.addListener(pa,"click",function(Ha){ta.checked=!0;mxEvent.consume(Ha)});mxEvent.addListener(za,"click",function(Ha){ta.checked=!0;mxEvent.consume(Ha)});d.lastPrintCropRadioChecked?
-ra.checked=!0:d.lastPrintFitRadioChecked?ta.checked=!0:oa.checked=!0;m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));ia.appendChild(m);wa.appendChild(Aa);wa.appendChild(Ca);wa.appendChild(ua);ya.appendChild(qa);ya.appendChild(ha);ya.appendChild(ia);na.appendChild(wa);na.appendChild(ya);Y.appendChild(na);Z.appendChild(Y);T.appendChild(Z);T=document.createElement("div");T.className="geDialogSection";m=document.createElement("div");m.className="geDialogFormRow";Z=
-document.createElement("label");Z.className="geDialogFormLabel";Z.setAttribute("for","gePrintDlgBorder");mxUtils.write(Z,mxResources.get("borderWidth"));m.appendChild(Z);var fa=document.createElement("input");fa.setAttribute("type","number");fa.setAttribute("min","0");fa.setAttribute("id","gePrintDlgBorder");fa.style.width="40px";fa.value=null!=d.lastPrintBorder?d.lastPrintBorder:mxPrintPreview.prototype.pageMargin;m.appendChild(fa);Z=document.createElement("label");Z.setAttribute("for","gePrintDlgZoom");
-Z.style.marginLeft="12px";Z.style.marginRight="4px";mxUtils.write(Z,mxResources.get("zoom"));m.appendChild(Z);var ka=document.createElement("input");ka.setAttribute("id","gePrintDlgZoom");ka.style.width="60px";ka.value=null!=d.lastPrintZoom?d.lastPrintZoom:"100%";m.appendChild(ka);T.appendChild(m);Z=document.createElement("div");Z.className="geDialogCheckRow";var xa=document.createElement("input");xa.setAttribute("type","checkbox");xa.setAttribute("id","gePrintDlgGrid");xa.style.marginRight="8px";
-xa.checked=null!=d.lastPrintGrid?d.lastPrintGrid:!1;Z.appendChild(xa);m=document.createElement("label");m.setAttribute("for","gePrintDlgGrid");mxUtils.write(m,mxResources.get("grid"));Z.appendChild(m);T.appendChild(Z);Z=document.createElement("div");Z.className="geDialogCheckRow";var Ba=document.createElement("input");Ba.setAttribute("type","checkbox");Ba.setAttribute("id","gePrintDlgShadows");Ba.style.marginRight="8px";Ba.checked=null!=d.lastPrintShadow?d.lastPrintShadow:!1;Z.appendChild(Ba);m=document.createElement("label");
-m.setAttribute("for","gePrintDlgShadows");mxUtils.write(m,mxResources.get("shadows"));Z.appendChild(m);d.isOffline()&&!mxClient.IS_CHROMEAPP||Z.appendChild(d.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(Z.style.display="none");T.appendChild(Z);var ma=document.createElement("input");ma.setAttribute("type","checkbox");ma.setAttribute("id","gePrintDlgTransparent");ma.style.marginRight="8px";ma.checked=null!=d.lastPrintTransparent?
-d.lastPrintTransparent:!1;null!=x&&(Z=document.createElement("div"),Z.className="geDialogCheckRow",Z.appendChild(ma),m=document.createElement("label"),m.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(m,mxResources.get("transparentBackground")),Z.appendChild(m),T.appendChild(Z));var la=document.createElement("input");la.setAttribute("type","checkbox");la.setAttribute("id","gePrintDlgInclude");la.style.marginRight="8px";la.checked=null!=d.lastPrintInclude?d.lastPrintInclude:Editor.defaultIncludeDiagram;
-null==x||mxClient.IS_CHROMEAPP||"draw.io"!=d.getServiceName()||(Z=document.createElement("div"),Z.className="geDialogCheckRow",Z.appendChild(la),m=document.createElement("label"),m.setAttribute("for","gePrintDlgInclude"),mxUtils.write(m,mxResources.get("includeCopyOfMyDiagram")),Z.appendChild(m),T.appendChild(Z));var Ea=document.createElement("input");Ea.setAttribute("type","checkbox");Ea.setAttribute("id","gePrintDlgIcons");Ea.style.marginRight="8px";Ea.checked=null!=d.lastPrintIcons?d.lastPrintIcons:
-!1;null!=x&&EditorUi.isElectronApp&&(Z=document.createElement("div"),Z.className="geDialogCheckRow",Z.appendChild(Ea),m=document.createElement("label"),m.setAttribute("for","gePrintDlgIcons"),mxUtils.write(m,mxResources.get("notes")),Z.appendChild(m),T.appendChild(Z));Q.wrapper.appendChild(T);m=document.createElement("div");m.style.flex="0 0 auto";m.style.marginTop="16px";m.style.textAlign="right";m.style.whiteSpace="nowrap";d.isOffline()&&!mxClient.IS_CHROMEAPP||null!=x||m.appendChild(d.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));
-Q=mxUtils.button(mxResources.get("cancel"),function(){d.hideDialog()});Q.className="geBtn";d.editor.cancelFirst&&m.appendChild(Q);PrintDialog.previewEnabled&&null==x&&(T=mxUtils.button(mxResources.get("preview"),function(){K(!1)}),T.className="geBtn",m.appendChild(T));C=null!=C?C:null!=x?"export":PrintDialog.previewEnabled?"print":"ok";C=mxUtils.button(mxResources.get(C),function(){K(!0)});C.className="geBtn gePrimaryBtn";m.appendChild(C);d.editor.cancelFirst||m.appendChild(Q);ba.appendChild(m);if(d.editor.isChromelessView()){var Fa=
-function(){Editor.isDarkMode()?(ba.classList.add("geDarkMode"),ba.style.colorScheme="dark"):(ba.classList.remove("geDarkMode"),ba.style.colorScheme="light")};d.addListener("darkModeChanged",Fa);Fa();var Ia=function(Ha,Ma){Ha=Ma.getProperty("dialog");ba.parentNode==Ha.container&&(d.editor.removeListener(Ia),d.removeListener(Fa))};d.editor.addListener("hideDialog",Ia)}this.container=ba};var v=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=
-this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var d=this.image;null!=d&&null!=d.src&&Graph.isPageLink(d.src)&&(d={originalSrc:d.src});this.page.viewState.backgroundImage=d}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);
-null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else v.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(d=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=d?d:"default"),null!=this.shadowVisible&&this.shadowVisible!=
-this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(d){var m=[];if(null==d)return m;var x=function(ba){if(null!=ba)return ba=parseFloat(ba),!isNaN(ba)&&0<=ba?ba:void 0},C={fade:!0,pop:!0,wipe:!0};d=d.split("\n");for(var F=0;F<d.length;F++){var G=mxUtils.trim(d[F]);if(""!=G&&"#"!=G.charAt(0)){G=G.split(/\s+/);var K={action:G[0],cell:G[1],arg:G[2]};if("wait"==K.action){if(K.delay=
-parseFloat(K.cell),isNaN(K.delay)||0>K.delay)K.delay=1E3}else if("setOpacity"==K.action)K.opacity=parseFloat(G[2]),isNaN(K.opacity)&&(K.opacity=1),K.opacity=Math.max(0,Math.min(1,K.opacity)),K.duration=x(G[3]),K.arg=void 0;else if("show"==K.action){if(null!=K.arg&&!C[K.arg]){var Q=x(K.arg);null!=Q&&(K.duration=Q,K.arg=void 0)}null==K.duration&&(K.duration=x(G[3]))}else"hide"==K.action&&(K.duration=x(G[2]),K.arg=void 0);m.push(K)}}return m};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=
-function(d,m){return d.action!=m.action||"wait"==d.action||(d.arg||"")!=(m.arg||"")||(null!=d.opacity?d.opacity:"")!=(null!=m.opacity?m.opacity:"")||(null!=d.duration?d.duration:"")!=(null!=m.duration?m.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(d){if("wait"==d.action)return{wait:d.delay};var m="all"==d.cell?"*":d.cell;if(null==m)return null;var x={cells:[m]};if(null!=d.duration)x.delay=d.duration;else if("show"==d.action&&"fade"==d.arg)x.delay=Editor.animationFadeDelay;else if("hide"==
-d.action||"setOpacity"==d.action)x.delay=Editor.animationFadeDelay;return"show"==d.action?"fade"==d.arg?{fadeIn:x}:"pop"==d.arg?{popIn:x}:{wipeIn:x}:"hide"==d.action?{fadeOut:x}:"setOpacity"==d.action?(x.value=d.opacity,{fadeTo:x}):"flow"==d.action?(m={cells:[m]},"start"==d.arg?m.start=!0:"stop"==d.arg&&(m.start=!1),{flow:m}):null};Editor.convertLegacyAnimation=function(d){d=Editor.parseAnimationScript(d);for(var m=[{opacity:{cells:["*"],value:0}}],x=null,C=function(){null!=x&&(m.push(x),x=null)},
-F=function(Q){null==x&&(x={});for(var ba in Q){var T=Q[ba],Z;if(Z=null!=x[ba]&&null!=T&&Array.isArray(x[ba].cells)&&Array.isArray(T.cells))Z=x[ba],Z=Z.delay===T.delay&&Z.value===T.value&&Z.start===T.start;if(Z)for(Z=0;Z<T.cells.length;Z++)x[ba].cells.push(T.cells[Z]);else null!=x[ba]&&(C(),x={}),x[ba]=T}},G=0;G<d.length;G++){var K=Editor.convertLegacyAnimationStep(d[G]);null!=K&&(null!=K.wait?(C(),m.push(K)):F(K))}C();return{animation:{steps:m}}};Editor.parseAnimationData=function(d){var m=function(C){null==
-C&&(C={});Array.isArray(C.steps)||(C.steps=[]);C.loop=null==C.loop?!0:!!C.loop;C.enabled=null==C.enabled?!0:!!C.enabled;return C};if(null==d||""===d)return m({steps:[]});if("string"==typeof d){var x=mxUtils.trim(d);return"{"==x.charAt(0)||"["==x.charAt(0)?Editor.parseAnimationData(JSON.parse(x)):m(Editor.convertLegacyAnimation(d).animation)}return null!=d.animation&&null!=d.animation.steps?m(d.animation):Array.isArray(d.steps)?m(d):m({steps:[]})};Editor.AnimationPlayer=function(d,m){this.graph=d;
-this.data=Editor.parseAnimationData(m);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(d){var m=[],x;for(x in d.cells){var C=d.cells[x];(d.isVertex(C)||d.isEdge(C))&&m.push(C)}return m};Editor.AnimationPlayer.prototype.collectReferencedCells=function(){for(var d=this.data.steps||[],m={},x=[],C=0;C<d.length;C++){var F=d[C],G;for(G in F)if("wait"!=G&&"open"!=G){var K=F[G];if("object"===typeof K&&null!=K){K=this.graph.getCellsForAction(K,
-!0);for(var Q=0;Q<K.length;Q++)m[K[Q].id]||(m[K[Q].id]=!0,x.push(K[Q]))}}}return x};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var d=this.collectReferencedCells();d=this.graph.getNodesForCells(d);this.snapshot=[];for(var m=0;m<d.length;m++)this.snapshot.push({node:d[m],opacity:d[m].style.opacity})};Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var d=0;d<this.snapshot.length;d++)Graph.setTransitionForNodes([this.snapshot[d].node],null),this.snapshot[d].node.style.opacity=
-this.snapshot[d].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(d){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){d=d||{};this.running=!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var m=this,x=this.data.steps||[],C=function(G,K){if(null==m.graph||m.graph.isGraphTornDown())m.running=!1;else if(m.cancelled||G>=x.length)K();else{for(var Q=G+1;Q<x.length&&!0===x[Q].immediate&&!m.cancelled;)Q++;if("function"==typeof d.onStep)try{d.onStep(G,
-Q)}catch(ba){}m.graph.executeCustomActions(Graph.flattenAnimationActions(x.slice(G,Q)),function(){C(Q,K)},null)}},F=function(){null==m.graph||m.graph.isGraphTornDown()?m.running=!1:m.cancelled?(m.restoreOpacity(),m.running=!1):(m.snapshotOpacity(),C(0,function(){if(m.cancelled)m.restoreOpacity(),m.running=!1;else{if("function"==typeof d.onStep)try{d.onStep(-1)}catch(G){}d.loop?(m.graph.refresh(),m.restoreOpacity(),window.setTimeout(F,0)):(m.running=!1,m.restoreOpacity(),null!=d.done&&d.done())}}))};
-d.defer?window.setTimeout(F,0):F()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var d=[],m=this.collectReferencedCells(),x=0;x<m.length;x++)this.graph.getModel().isEdge(m[x])&&d.push(m[x]);0<d.length&&Editor.toggleFlowAnimation(this.graph,d,"stop")};Editor.toggleFlowAnimation=function(d,m,x){x=x||"toggle";for(var C=0;C<m.length;C++)if(d.getModel().isEdge(m[C])){var F=d.view.getState(m[C]);if(null!=F&&null!=F.shape){var G=
-null!=F.shape.getFlowAnimationPath?F.shape.getFlowAnimationPath():null;if(null!=G){var K="mxEdgeFlow"==G.getAttribute("class"),Q="start"==x||"toggle"==x&&!K;K="stop"==x||"toggle"==x&&K;F="1"==mxUtils.getValue(F.style,mxConstants.STYLE_DASHED,"0");K?(G.removeAttribute("class"),F||G.removeAttribute("stroke-dasharray")):Q&&(G.setAttribute("class","mxEdgeFlow"),F||G.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(d,m){var x=d.getModel().getRoot(),C=null;null!=x.value&&"object"==
-typeof x.value&&(C=x.value.getAttribute("animation"));if(null==C||""==C)return null;try{var F=Editor.parseAnimationData(C)}catch(K){return null}if(!F.steps||0==F.steps.length||!1===F.enabled)return null;x={};if(null!=m)for(var G in m)x[G]=m[G];null==x.loop&&(x.loop=F.loop);null==x.defer&&(x.defer=!0);d=new Editor.AnimationPlayer(d,F);d.play(x);return d};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var d=document.createElement("style");
-d.type="text/css";d.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));document.getElementsByTagName("head")[0].appendChild(d)}catch(m){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="31.4.5";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",
+if(!0===d.descendants)for(x=G.slice(),m=0;m<x.length;m++)K(this.model.getDescendants(x[m]));if(null!=d.excludeCells&&0<d.excludeCells.length){K={};x=!1;for(m=0;m<d.excludeCells.length;m++){if("*"===d.excludeCells[m]){x=!0;break}K[d.excludeCells[m]]=!0}if(x)return[];d=[];for(m=0;m<G.length;m++)K[G[m].id]||d.push(G[m]);return d}return G};Graph.prototype.getCellsById=function(d){var m=[];if(null!=d)for(var x=0;x<d.length;x++)if("*"==d[x]){var C=this.model.getRoot();m=m.concat(this.model.filterDescendants(function(G){return G!=
+C},C))}else{var F=this.model.getCell(d[x]);null!=F&&m.push(F)}return m};Graph.prototype.getCellsForLayers=function(d){var m=[];if(Array.isArray(d))for(var x=0;x<d.length;x++){var C=this.model.getCell(d[x]);null!=C&&(m=m.concat(this.model.filterDescendants(function(F){return F!=C},C)))}return m};Graph.prototype.getLayerCells=function(d){var m=[];if(Array.isArray(d))for(var x=0;x<d.length;x++){var C=this.model.getCell(d[x]);null!=C&&m.push(C)}return m};var S=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=
+function(d){return S.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(d))};Graph.prototype.setHiddenTags=function(d){this.hiddenTags=d;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(d){var m=mxUtils.indexOf(this.hiddenTags,d);0>m?this.hiddenTags.push(d):0<=m&&this.hiddenTags.splice(m,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(d){if(null==d||0==d.length||0==this.hiddenTags.length)return!1;
+d=d.split(" ");if(d.length>this.hiddenTags.length)return!1;for(var m=0;m<d.length;m++)if(0>mxUtils.indexOf(this.hiddenTags,d[m]))return!1;return!0};Graph.prototype.getCellsForTags=function(d,m,x,C,F){var G=[];F="or"===F;if(null!=d){m=null!=m?m:this.model.getDescendants(this.model.getRoot());for(var K=0,Q={},ba=0;ba<d.length;ba++)0<d[ba].length&&(Q[d[ba]]=!0,K++);for(ba=0;ba<m.length;ba++)if(x&&this.model.getParent(m[ba])==this.model.root||this.model.isVertex(m[ba])||this.model.isEdge(m[ba])){var T=
+this.getTagsForCell(m[ba]),Z=!1;if(0<T.length&&(T=T.split(" "),F||T.length>=d.length)){for(var X=Z=0;X<T.length&&Z<K;X++)null!=Q[T[X]]&&Z++;Z=F?0<Z:Z==K}Z&&(1!=C||this.isCellVisible(m[ba]))&&G.push(m[ba])}}return G};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(d){for(var m=null,x=[],C=0;C<d.length;C++){var F=this.getTagsForCell(d[C]);x=[];if(0<F.length){F=F.split(" ");for(var G={},
+K=0;K<F.length;K++)if(null==m||null!=m[F[K]])G[F[K]]=!0,x.push(F[K]);m=G}else return[]}return x};Graph.prototype.getTagsForCells=function(d){for(var m=[],x={},C=0;C<d.length;C++){var F=this.getTagsForCell(d[C]);if(0<F.length){F=F.split(" ");for(var G=0;G<F.length;G++)null==x[F[G]]&&(x[F[G]]=!0,m.push(F[G]))}}return m};Graph.prototype.getTagsForCell=function(d){return this.getAttributeForCell(d,"tags","")};Graph.prototype.addTagsForCells=function(d,m){if(0<d.length&&0<m.length){this.model.beginUpdate();
+try{for(var x=0;x<d.length;x++){for(var C=this.getTagsForCell(d[x]),F=C.split(" "),G=!1,K=0;K<m.length;K++){var Q=mxUtils.trim(m[K]);""!=Q&&0>mxUtils.indexOf(F,Q)&&(C=0<C.length?C+" "+Q:Q,G=!0)}G&&this.setAttributeForCell(d[x],"tags",C)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(d,m){if(0<d.length&&0<m.length){this.model.beginUpdate();try{for(var x=0;x<d.length;x++){var C=this.getTagsForCell(d[x]);if(0<C.length){for(var F=C.split(" "),G=!1,K=0;K<m.length;K++){var Q=
+mxUtils.indexOf(F,m[K]);0<=Q&&(F.splice(Q,1),G=!0)}G&&this.setAttributeForCell(d[x],"tags",F.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(d){this.model.beginUpdate();try{for(var m=0;m<d.length;m++)this.model.setVisible(d[m],!this.model.isVisible(d[m]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(d,m){this.model.beginUpdate();try{for(var x=0;x<d.length;x++)this.model.setVisible(d[x],m)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=
+function(d,m,x,C){for(var F=0;F<d.length;F++)this.highlightCell(d[F],m,x,C)};Graph.prototype.highlightCell=function(d,m,x,C,F){m=null!=m?m:mxConstants.DEFAULT_VALID_COLOR;x=null!=x?x:1E3;d=this.view.getState(d);var G=null;null!=d&&(F=null!=F?F:4,F=Math.max(F+1,mxUtils.getValue(d.style,mxConstants.STYLE_STROKEWIDTH,1)+F),G=new mxCellHighlight(this,m,F,!1),null!=C&&(G.opacity=C),G.highlight(d),window.setTimeout(function(){null!=G.shape&&(mxUtils.setPrefixedStyle(G.shape.node.style,"transition","all 1200ms ease-in-out"),
+G.shape.node.style.opacity=0);window.setTimeout(function(){G.destroy()},1200)},x));return G};Graph.prototype.addSvgShadow=function(d,m,x,C){C=null!=C?C:!0;var F=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=x&&x||(m=null!=m?m:d.getElementsByTagName("g")[0],null!=m&&(this.updateShadowFilter(m,!0),!isNaN(parseInt(d.getAttribute("width")))&&C&&(d.setAttribute("width",parseInt(d.getAttribute("width"))+F),d.setAttribute("height",parseInt(d.getAttribute("height"))+F),m=d.getAttribute("viewBox"),
+null!=m&&0<m.length&&(m=m.split(" "),3<m.length&&(w=parseFloat(m[2])+F,h=parseFloat(m[3])+F,d.setAttribute("viewBox",m[0]+" "+m[1]+" "+w+" "+h))))));return F};Graph.prototype.updateShadowFilter=function(d,m){mxClient.IS_SF||(m?(m=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),d.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+m.cssText+")"):d.style.filter="")};Graph.prototype.setShadowVisible=
+function(d,m){m=null!=m?m:!0;this.shadowVisible=d;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);m&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var d=this.model.getChildCount(this.model.root),
+m=0;do var x=this.model.getChildAt(this.model.root,m);while(m++<d&&"1"==mxUtils.getValue(this.getCellStyle(x),"locked","0"));null!=x&&this.setDefaultParent(x)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+
+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+
+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];
+mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",
+STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",
+STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=
+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",
+STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",
+STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=
+[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate4=[SHAPES_PATH+"/mxArchiMate3.js",SHAPES_PATH+"/mxArchiMate4.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",
+STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.atlassian2=[SHAPES_PATH+"/mxAtlassian2.js",STENCIL_PATH+"/atlassian2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=
+[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=
+[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(d){var m=null;null!=d&&0<d.length&&("ER"==d.substring(0,2)?m="mxgraph.er":"sysML"==d.substring(0,5)&&(m="mxgraph.sysml"));return m};
+var V=mxMarker.createMarker;mxMarker.createMarker=function(d,m,x,C,F,G,K,Q,ba,T){if(null!=x&&null==mxMarker.markers[x]){var Z=this.getPackageForType(x);null!=Z&&mxStencilRegistry.getStencil(Z)}return V.apply(this,arguments)};var ja=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(d,m,x,C,F,G){"1"==mxUtils.getValue(m.style,"lineShape",null)&&d.setFillColor(mxUtils.getValue(m.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ja.apply(this,arguments)};PrintDialog.prototype.create=
+function(d,m,x,C){function F(){aa.value=Math.max(1,Math.min(da,Math.max(parseInt(aa.value),parseInt(P.value))));P.value=Math.max(1,Math.min(da,Math.min(parseInt(aa.value),parseInt(P.value))))}function G(Ha){d.lastPrintPagesRadioChecked=ca.checked;d.lastPrintSelectionOnlyChecked=ea.checked;d.lastPrintCropRadioChecked=sa.checked;d.lastPrintFitRadioChecked=ta.checked;ca.checked&&P.value<aa.value?(d.lastPrintPagesFromInput=P.value,d.lastPrintPagesToInput=aa.value):(d.lastPrintPagesFromInput=null,d.lastPrintPagesToInput=
+null);ka.value=Math.max(1,Math.min(1600,parseInt(ka.value)))+"%";d.lastPrintZoom=ka.value;d.lastPrintBorder=fa.value;d.lastPrintGrid=xa.checked;d.lastPrintShadow=Ba.checked;d.lastPrintTransparent=ma.checked;d.lastPrintInclude=la.checked;d.lastPrintIcons=Ea.checked;d.lastPrintSheetsAcross=pa.value;d.lastPrintSheetsDown=za.value;var Ma={};Ma.border=parseInt(fa.value);Ma.scale=parseInt(ka.value)/100;Ma.grid=xa.checked;Ma.shadows=Ba.checked;Ma.transparent=ma.checked;Ma.includeCopy=la.checked;Ma.icons=
+Ea.checked&&EditorUi.isElectronApp;Ma.sheetsAcross=parseInt(pa.value);Ma.sheetsDown=parseInt(za.value);Ma.pagesFrom=parseInt(P.value);Ma.pagesTo=parseInt(aa.value);Ma.allPages=R.checked;Ma.selection=ea.checked;Ma.pageView=oa.checked;Ma.crop=sa.checked;Ma.fit=ta.checked;return null!=x?x(!Ha,Ma):d.print(!Ha,Ma)}function K(Ha){try{d.hideDialog(),null!=x?G(Ha):d.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{G(Ha),d.spinner.stop()}catch(Ma){d.handleError(Ma)}},
+0)}catch(Ma){d.handleError(Ma)}}var Q=d.editor.graph,ba=document.createElement("div");ba.style.display="flex";ba.style.flexDirection="column";ba.style.minHeight="0";var T=document.createElement("div");T.style.flex="1 1 auto";T.style.minHeight="0";T.style.overflowY="auto";ba.appendChild(T);var Z=document.createElement("h3");mxUtils.write(Z,m||mxResources.get("print"));T.appendChild(Z);var X=1,da=1;Z=document.createElement("div");Z.className="geDialogSection";Z.style.whiteSpace="nowrap";var R=document.createElement("input");
+R.style.marginRight="8px";R.setAttribute("type","radio");R.setAttribute("name","pages-printdialog");R.setAttribute("id","gePrintDlgAllPages");var Y=document.createElement("div");Y.className="geDialogCheckRow";Y.appendChild(R);m=document.createElement("label");m.setAttribute("for","gePrintDlgAllPages");mxUtils.write(m,mxResources.get("allPages"));Y.appendChild(m);Z.appendChild(Y);var ca=document.createElement("input");ca.style.marginRight="8px";ca.setAttribute("type","radio");ca.setAttribute("name",
+"pages-printdialog");ca.setAttribute("id","gePrintDlgPages");Y=document.createElement("div");Y.className="geDialogCheckRow";Y.appendChild(ca);m=document.createElement("label");m.setAttribute("for","gePrintDlgPages");mxUtils.write(m,mxResources.get("pages")+":");Y.appendChild(m);var P=document.createElement("input");P.style.margin="0 4px";P.setAttribute("value","1");P.setAttribute("type","number");P.setAttribute("min","1");P.style.width="40px";Y.appendChild(P);m=document.createElement("span");mxUtils.write(m,
+mxResources.get("to"));Y.appendChild(m);var aa=P.cloneNode(!0);Y.appendChild(aa);mxEvent.addListener(P,"focus",function(){ca.checked=!0});mxEvent.addListener(aa,"focus",function(){ca.checked=!0});mxEvent.addListener(P,"change",F);mxEvent.addListener(aa,"change",F);if(null!=d.pages&&(da=d.pages.length,null!=d.currentPage))for(m=0;m<da;m++)if(d.currentPage==d.pages[m]){X=m+1;break}null!=d.lastPrintPagesFromInput&&null!=d.lastPrintPagesToInput?(P.value=Math.min(da,Math.max(1,d.lastPrintPagesFromInput)),
+aa.value=Math.min(da,Math.max(1,d.lastPrintPagesToInput))):(P.value=X,aa.value=X);P.setAttribute("max",da);aa.setAttribute("max",da);m=mxUtils.button(mxResources.get("currentPage"),function(Ha){P.value=X;aa.value=X;ca.checked=!0});m.className="geBtn";m.setAttribute("title",mxResources.get("currentPage"));m.style.marginLeft="4px";m.style.maxWidth="100px";Y.appendChild(m);Z.appendChild(Y);1<da&&T.appendChild(Z);Y=document.createElement("div");Y.className="geDialogCheckRow";var ea=document.createElement("input");
+ea.setAttribute("name","pages-printdialog");ea.setAttribute("type",1==da?"checkbox":"radio");ea.setAttribute("id","gePrintDlgSelectionOnly");ea.style.marginRight="8px";Q.isSelectionEmpty()&&ea.setAttribute("disabled","disabled");Q.isEnabled()&&(Y.appendChild(ea),m=document.createElement("label"),m.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(m,mxResources.get("selectionOnly")),Y.appendChild(m));Q.isEnabled()&&(1<da?Z.appendChild(Y):(m=document.createElement("div"),m.className="geDialogSection",
+m.appendChild(Y),T.appendChild(m)));!d.isPagesEnabled()||d.lastPrintPagesRadioChecked?ca.checked=!0:!Q.isSelectionEmpty()&&d.lastPrintSelectionOnlyChecked?ea.checked=!0:R.checked=!0;Q=d.addAdvancedSection(T);T=Q.content;Z=document.createElement("div");Z.className="geDialogCheckRow";var oa=document.createElement("input");oa.style.marginRight="8px";oa.setAttribute("type","radio");oa.setAttribute("name","printSize");oa.setAttribute("id","gePrintDlgPageView");Z.appendChild(oa);m=document.createElement("label");
+m.setAttribute("for","gePrintDlgPageView");mxUtils.write(m,mxResources.get("pageView"));Z.appendChild(m);mxEvent.addListener(Z,"click",function(){oa.checked=!0});T.appendChild(Z);Z=document.createElement("div");Z.className="geDialogCheckRow";var sa=document.createElement("input");sa.style.marginRight="8px";sa.setAttribute("type","radio");sa.setAttribute("name","printSize");sa.setAttribute("id","gePrintDlgCrop");Z.appendChild(sa);m=document.createElement("label");m.setAttribute("for","gePrintDlgCrop");
+mxUtils.write(m,mxResources.get("crop"));Z.appendChild(m);mxEvent.addListener(Z,"click",function(){sa.checked=!0});T.appendChild(Z);Z=document.createElement("div");Z.className="geDialogCheckRow";Z.style.alignItems="flex-start";var ta=document.createElement("input");ta.style.marginTop="4px";ta.setAttribute("type","radio");ta.setAttribute("name","printSize");Z.appendChild(ta);Y=document.createElement("table");Y.style.display="inline-block";Y.style.borderSpacing="0";var na=document.createElement("tbody"),
+wa=document.createElement("tr"),ya=wa.cloneNode(!0),Aa=document.createElement("td"),Da=Aa.cloneNode(!0),ua=Aa.cloneNode(!0),qa=Aa.cloneNode(!0),ha=Aa.cloneNode(!0),ia=Aa.cloneNode(!0);Aa.style.textAlign="right";qa.style.textAlign="right";mxUtils.write(Aa,mxResources.get("fitTo"));mxEvent.addListener(Z,"click",function(Ha){mxEvent.getSource(Ha)!=ta&&(ta.checked=!ta.checked)});var pa=document.createElement("input");pa.style.margin="0 2px";pa.style.boxSizing="border-box";pa.setAttribute("value",d.lastPrintSheetsAcross||
+"1");pa.setAttribute("min","1");pa.setAttribute("type","number");pa.style.width="40px";Da.appendChild(pa);m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsAcross"));ua.appendChild(m);mxUtils.write(qa,mxResources.get("fitToBy"));var za=pa.cloneNode(!0);za.setAttribute("value",d.lastPrintSheetsDown||"1");ha.appendChild(za);mxEvent.addListener(pa,"click",function(Ha){ta.checked=!0;mxEvent.consume(Ha)});mxEvent.addListener(za,"click",function(Ha){ta.checked=!0;mxEvent.consume(Ha)});
+d.lastPrintCropRadioChecked?sa.checked=!0:d.lastPrintFitRadioChecked?ta.checked=!0:oa.checked=!0;m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));ia.appendChild(m);wa.appendChild(Aa);wa.appendChild(Da);wa.appendChild(ua);ya.appendChild(qa);ya.appendChild(ha);ya.appendChild(ia);na.appendChild(wa);na.appendChild(ya);Y.appendChild(na);Z.appendChild(Y);T.appendChild(Z);T=document.createElement("div");T.className="geDialogSection";m=document.createElement("div");m.className=
+"geDialogFormRow";Z=document.createElement("label");Z.className="geDialogFormLabel";Z.setAttribute("for","gePrintDlgBorder");mxUtils.write(Z,mxResources.get("borderWidth"));m.appendChild(Z);var fa=document.createElement("input");fa.setAttribute("type","number");fa.setAttribute("min","0");fa.setAttribute("id","gePrintDlgBorder");fa.style.width="40px";fa.value=null!=d.lastPrintBorder?d.lastPrintBorder:mxPrintPreview.prototype.pageMargin;m.appendChild(fa);Z=document.createElement("label");Z.setAttribute("for",
+"gePrintDlgZoom");Z.style.marginLeft="12px";Z.style.marginRight="4px";mxUtils.write(Z,mxResources.get("zoom"));m.appendChild(Z);var ka=document.createElement("input");ka.setAttribute("id","gePrintDlgZoom");ka.style.width="60px";ka.value=null!=d.lastPrintZoom?d.lastPrintZoom:"100%";m.appendChild(ka);T.appendChild(m);Z=document.createElement("div");Z.className="geDialogCheckRow";var xa=document.createElement("input");xa.setAttribute("type","checkbox");xa.setAttribute("id","gePrintDlgGrid");xa.style.marginRight=
+"8px";xa.checked=null!=d.lastPrintGrid?d.lastPrintGrid:!1;Z.appendChild(xa);m=document.createElement("label");m.setAttribute("for","gePrintDlgGrid");mxUtils.write(m,mxResources.get("grid"));Z.appendChild(m);T.appendChild(Z);Z=document.createElement("div");Z.className="geDialogCheckRow";var Ba=document.createElement("input");Ba.setAttribute("type","checkbox");Ba.setAttribute("id","gePrintDlgShadows");Ba.style.marginRight="8px";Ba.checked=null!=d.lastPrintShadow?d.lastPrintShadow:!1;Z.appendChild(Ba);
+m=document.createElement("label");m.setAttribute("for","gePrintDlgShadows");mxUtils.write(m,mxResources.get("shadows"));Z.appendChild(m);d.isOffline()&&!mxClient.IS_CHROMEAPP||Z.appendChild(d.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(Z.style.display="none");T.appendChild(Z);var ma=document.createElement("input");ma.setAttribute("type","checkbox");ma.setAttribute("id","gePrintDlgTransparent");ma.style.marginRight=
+"8px";ma.checked=null!=d.lastPrintTransparent?d.lastPrintTransparent:!1;null!=x&&(Z=document.createElement("div"),Z.className="geDialogCheckRow",Z.appendChild(ma),m=document.createElement("label"),m.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(m,mxResources.get("transparentBackground")),Z.appendChild(m),T.appendChild(Z));var la=document.createElement("input");la.setAttribute("type","checkbox");la.setAttribute("id","gePrintDlgInclude");la.style.marginRight="8px";la.checked=null!=d.lastPrintInclude?
+d.lastPrintInclude:Editor.defaultIncludeDiagram;null==x||mxClient.IS_CHROMEAPP||"draw.io"!=d.getServiceName()||(Z=document.createElement("div"),Z.className="geDialogCheckRow",Z.appendChild(la),m=document.createElement("label"),m.setAttribute("for","gePrintDlgInclude"),mxUtils.write(m,mxResources.get("includeCopyOfMyDiagram")),Z.appendChild(m),T.appendChild(Z));var Ea=document.createElement("input");Ea.setAttribute("type","checkbox");Ea.setAttribute("id","gePrintDlgIcons");Ea.style.marginRight="8px";
+Ea.checked=null!=d.lastPrintIcons?d.lastPrintIcons:!1;null!=x&&EditorUi.isElectronApp&&(Z=document.createElement("div"),Z.className="geDialogCheckRow",Z.appendChild(Ea),m=document.createElement("label"),m.setAttribute("for","gePrintDlgIcons"),mxUtils.write(m,mxResources.get("notes")),Z.appendChild(m),T.appendChild(Z));Q.wrapper.appendChild(T);m=document.createElement("div");m.style.flex="0 0 auto";m.style.marginTop="16px";m.style.textAlign="right";m.style.whiteSpace="nowrap";d.isOffline()&&!mxClient.IS_CHROMEAPP||
+null!=x||m.appendChild(d.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));Q=mxUtils.button(mxResources.get("cancel"),function(){d.hideDialog()});Q.className="geBtn";d.editor.cancelFirst&&m.appendChild(Q);PrintDialog.previewEnabled&&null==x&&(T=mxUtils.button(mxResources.get("preview"),function(){K(!1)}),T.className="geBtn",m.appendChild(T));C=null!=C?C:null!=x?"export":PrintDialog.previewEnabled?"print":"ok";C=mxUtils.button(mxResources.get(C),function(){K(!0)});C.className="geBtn gePrimaryBtn";
+m.appendChild(C);d.editor.cancelFirst||m.appendChild(Q);ba.appendChild(m);if(d.editor.isChromelessView()){var Ga=function(){Editor.isDarkMode()?(ba.classList.add("geDarkMode"),ba.style.colorScheme="dark"):(ba.classList.remove("geDarkMode"),ba.style.colorScheme="light")};d.addListener("darkModeChanged",Ga);Ga();var Ja=function(Ha,Ma){Ha=Ma.getProperty("dialog");ba.parentNode==Ha.container&&(d.editor.removeListener(Ja),d.removeListener(Ga))};d.editor.addListener("hideDialog",Ja)}this.container=ba};
+var v=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var d=this.image;null!=d&&null!=d.src&&Graph.isPageLink(d.src)&&(d={originalSrc:d.src});this.page.viewState.backgroundImage=d}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=
+this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else v.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(d=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),
+this.adaptiveColors=null!=d?d:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(d){var m=[];if(null==d)return m;var x=function(ba){if(null!=ba)return ba=parseFloat(ba),!isNaN(ba)&&0<=ba?ba:void 0},C={fade:!0,pop:!0,wipe:!0};d=d.split("\n");for(var F=0;F<d.length;F++){var G=mxUtils.trim(d[F]);if(""!=G&&"#"!=G.charAt(0)){G=
+G.split(/\s+/);var K={action:G[0],cell:G[1],arg:G[2]};if("wait"==K.action){if(K.delay=parseFloat(K.cell),isNaN(K.delay)||0>K.delay)K.delay=1E3}else if("setOpacity"==K.action)K.opacity=parseFloat(G[2]),isNaN(K.opacity)&&(K.opacity=1),K.opacity=Math.max(0,Math.min(1,K.opacity)),K.duration=x(G[3]),K.arg=void 0;else if("show"==K.action){if(null!=K.arg&&!C[K.arg]){var Q=x(K.arg);null!=Q&&(K.duration=Q,K.arg=void 0)}null==K.duration&&(K.duration=x(G[3]))}else"hide"==K.action&&(K.duration=x(G[2]),K.arg=
+void 0);m.push(K)}}return m};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(d,m){return d.action!=m.action||"wait"==d.action||(d.arg||"")!=(m.arg||"")||(null!=d.opacity?d.opacity:"")!=(null!=m.opacity?m.opacity:"")||(null!=d.duration?d.duration:"")!=(null!=m.duration?m.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(d){if("wait"==d.action)return{wait:d.delay};var m="all"==d.cell?"*":d.cell;if(null==m)return null;var x={cells:[m]};if(null!=d.duration)x.delay=d.duration;
+else if("show"==d.action&&"fade"==d.arg)x.delay=Editor.animationFadeDelay;else if("hide"==d.action||"setOpacity"==d.action)x.delay=Editor.animationFadeDelay;return"show"==d.action?"fade"==d.arg?{fadeIn:x}:"pop"==d.arg?{popIn:x}:{wipeIn:x}:"hide"==d.action?{fadeOut:x}:"setOpacity"==d.action?(x.value=d.opacity,{fadeTo:x}):"flow"==d.action?(m={cells:[m]},"start"==d.arg?m.start=!0:"stop"==d.arg&&(m.start=!1),{flow:m}):null};Editor.convertLegacyAnimation=function(d){d=Editor.parseAnimationScript(d);for(var m=
+[{opacity:{cells:["*"],value:0}}],x=null,C=function(){null!=x&&(m.push(x),x=null)},F=function(Q){null==x&&(x={});for(var ba in Q){var T=Q[ba],Z;if(Z=null!=x[ba]&&null!=T&&Array.isArray(x[ba].cells)&&Array.isArray(T.cells))Z=x[ba],Z=Z.delay===T.delay&&Z.value===T.value&&Z.start===T.start;if(Z)for(Z=0;Z<T.cells.length;Z++)x[ba].cells.push(T.cells[Z]);else null!=x[ba]&&(C(),x={}),x[ba]=T}},G=0;G<d.length;G++){var K=Editor.convertLegacyAnimationStep(d[G]);null!=K&&(null!=K.wait?(C(),m.push(K)):F(K))}C();
+return{animation:{steps:m}}};Editor.parseAnimationData=function(d){var m=function(C){null==C&&(C={});Array.isArray(C.steps)||(C.steps=[]);C.loop=null==C.loop?!0:!!C.loop;C.enabled=null==C.enabled?!0:!!C.enabled;return C};if(null==d||""===d)return m({steps:[]});if("string"==typeof d){var x=mxUtils.trim(d);return"{"==x.charAt(0)||"["==x.charAt(0)?Editor.parseAnimationData(JSON.parse(x)):m(Editor.convertLegacyAnimation(d).animation)}return null!=d.animation&&null!=d.animation.steps?m(d.animation):Array.isArray(d.steps)?
+m(d):m({steps:[]})};Editor.AnimationPlayer=function(d,m){this.graph=d;this.data=Editor.parseAnimationData(m);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(d){var m=[],x;for(x in d.cells){var C=d.cells[x];(d.isVertex(C)||d.isEdge(C))&&m.push(C)}return m};Editor.AnimationPlayer.prototype.collectReferencedCells=function(){for(var d=this.data.steps||[],m={},x=[],C=0;C<d.length;C++){var F=d[C],G;for(G in F)if("wait"!=G&&"open"!=G){var K=
+F[G];if("object"===typeof K&&null!=K){K=this.graph.getCellsForAction(K,!0);for(var Q=0;Q<K.length;Q++)m[K[Q].id]||(m[K[Q].id]=!0,x.push(K[Q]))}}}return x};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var d=this.collectReferencedCells();d=this.graph.getNodesForCells(d);var m=new Set;if(null==this.snapshot)this.snapshot=[];else for(var x=0;x<this.snapshot.length;x++)m.add(this.snapshot[x].node);for(x=0;x<d.length;x++)m.has(d[x])||(m.add(d[x]),this.snapshot.push({node:d[x],opacity:d[x].style.opacity}))};
+Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var d=0;d<this.snapshot.length;d++)Graph.setTransitionForNodes([this.snapshot[d].node],null),this.snapshot[d].node.style.opacity=this.snapshot[d].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(d){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){d=d||{};this.running=!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var m=this,x=this.data.steps||
+[],C=function(G,K){if(null==m.graph||m.graph.isGraphTornDown())m.running=!1;else if(m.cancelled||G>=x.length)K();else{for(var Q=G+1;Q<x.length&&!0===x[Q].immediate&&!m.cancelled;)Q++;if("function"==typeof d.onStep)try{d.onStep(G,Q)}catch(ba){}m.graph.executeCustomActions(Graph.flattenAnimationActions(x.slice(G,Q)),function(){C(Q,K)},null)}},F=function(){null==m.graph||m.graph.isGraphTornDown()?m.running=!1:m.cancelled?(m.restoreOpacity(),m.running=!1):(null==m.snapshot&&m.snapshotOpacity(),C(0,function(){if(m.cancelled)m.restoreOpacity(),
+m.running=!1;else{if("function"==typeof d.onStep)try{d.onStep(-1)}catch(G){}d.loop?(m.graph.refresh(),m.restoreOpacity(),window.setTimeout(F,0)):(m.running=!1,m.restoreOpacity(),null!=d.done&&d.done())}}))};d.defer?window.setTimeout(F,0):F()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var d=[],m=this.collectReferencedCells(),x=0;x<m.length;x++)this.graph.getModel().isEdge(m[x])&&d.push(m[x]);0<d.length&&Editor.toggleFlowAnimation(this.graph,
+d,"stop")};Editor.toggleFlowAnimation=function(d,m,x){x=x||"toggle";for(var C=0;C<m.length;C++)if(d.getModel().isEdge(m[C])){var F=d.view.getState(m[C]);if(null!=F&&null!=F.shape){var G=null!=F.shape.getFlowAnimationPath?F.shape.getFlowAnimationPath():null;if(null!=G){var K="mxEdgeFlow"==G.getAttribute("class"),Q="start"==x||"toggle"==x&&!K;K="stop"==x||"toggle"==x&&K;F="1"==mxUtils.getValue(F.style,mxConstants.STYLE_DASHED,"0");K?(G.removeAttribute("class"),F||G.removeAttribute("stroke-dasharray")):
+Q&&(G.setAttribute("class","mxEdgeFlow"),F||G.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(d,m){var x=d.getModel().getRoot(),C=null;null!=x.value&&"object"==typeof x.value&&(C=x.value.getAttribute("animation"));if(null==C||""==C)return null;try{var F=Editor.parseAnimationData(C)}catch(K){return null}if(!F.steps||0==F.steps.length||!1===F.enabled)return null;x={};if(null!=m)for(var G in m)x[G]=m[G];null==x.loop&&(x.loop=F.loop);null==x.defer&&(x.defer=!0);d=new Editor.AnimationPlayer(d,
+F);d.play(x);return d};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var d=document.createElement("style");d.type="text/css";d.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));document.getElementsByTagName("head")[0].appendChild(d)}catch(m){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="31.4.6";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",
"elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},elkRadial:{layout:"elkRadial",config:{edgeStyle:"elkCompat"}},elkOrganic:{layout:"elkOrganic",config:{edgeStyle:"elkCompat"}},elkStress:{layout:"elkStress",config:{edgeStyle:"elkCompat"}}};EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging=
"1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars=
"\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.enabledTemplateSections=null;EditorUi.customTemplates=null;EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&
@@ -14359,8 +14369,8 @@ C.checked,G.getLink(),Q.checked,null!=S?S.value:null,null!=V?V.value:null,ba.che
t.style.whiteSpace="nowrap";var r=document.createElement("h3");mxUtils.write(r,mxResources.get("image"));t.appendChild(r);if(q){r=document.createElement("div");r.className="geDialogSection";var z=document.createElement("div");z.className="geDialogFormRow";var D=document.createElement("span");D.className="geDialogFormLabel";mxUtils.write(D,mxResources.get("zoom")+":");z.appendChild(D);var H=document.createElement("input");H.setAttribute("type","text");H.value=this.lastExportZoom||"100%";z.appendChild(H);
r.appendChild(z);z=document.createElement("div");z.className="geDialogFormRow";D=document.createElement("span");D.className="geDialogFormLabel";mxUtils.write(D,mxResources.get("borderWidth")+":");z.appendChild(D);var B=document.createElement("input");B.setAttribute("type","text");B.value=this.lastExportBorder||"0";z.appendChild(B);r.appendChild(z);t.appendChild(r)}r=document.createElement("div");r.className="geDialogSection";var W=this.addCheckbox(r,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&
!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),I=n?null:this.addCheckbox(r,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,null,null,null,null,null,!0);z=this.editor.graph;var N=z.background==mxConstants.NONE||null==z.background,U=n?null:this.addCheckbox(r,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?this.lastExportTransparent:N,null,null,null,null,null,!0);t.appendChild(r);c=new CustomDialog(this,
-t,mxUtils.bind(this,function(){this.lastExportSelectionOnly=W.checked;q&&(this.lastExportZoom=H.value,this.lastExportBorder=B.value);null!=U&&(this.lastExportTransparent=U.checked==N?null:U.checked);var S=parseInt(H.value)/100||1,V=parseInt(B.value)||0;k(!W.checked,null!=I?I.checked:!1,null!=U?U.checked:!1,S,V)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,k,n,q,t,r,z,D){function H(){return Math.max(0,parseFloat(S.value)||100)/100}function B(){var Ca=
-H();ca.value=Math.floor(da*Ca);P.value=Math.floor(R*Ca)}r=null!=r?r:Editor.defaultIncludeDiagram;var W=document.createElement("div");W.style.whiteSpace="nowrap";var I=this.editor.graph,N=document.createElement("h3");mxUtils.write(N,c);W.appendChild(N);c=document.createElement("div");c.className="geDialogSection";N=document.createElement("div");N.className="geDialogFormRow";var U=document.createElement("span");U.className="geDialogFormLabel";mxUtils.write(U,mxResources.get("zoom")+":");N.appendChild(U);
+t,mxUtils.bind(this,function(){this.lastExportSelectionOnly=W.checked;q&&(this.lastExportZoom=H.value,this.lastExportBorder=B.value);null!=U&&(this.lastExportTransparent=U.checked==N?null:U.checked);var S=parseInt(H.value)/100||1,V=parseInt(B.value)||0;k(!W.checked,null!=I?I.checked:!1,null!=U?U.checked:!1,S,V)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,k,n,q,t,r,z,D){function H(){return Math.max(0,parseFloat(S.value)||100)/100}function B(){var Da=
+H();ca.value=Math.floor(da*Da);P.value=Math.floor(R*Da)}r=null!=r?r:Editor.defaultIncludeDiagram;var W=document.createElement("div");W.style.whiteSpace="nowrap";var I=this.editor.graph,N=document.createElement("h3");mxUtils.write(N,c);W.appendChild(N);c=document.createElement("div");c.className="geDialogSection";N=document.createElement("div");N.className="geDialogFormRow";var U=document.createElement("span");U.className="geDialogFormLabel";mxUtils.write(U,mxResources.get("zoom")+":");N.appendChild(U);
var S=document.createElement("input");S.setAttribute("type","text");S.value=this.lastExportZoom||"100%";N.appendChild(S);c.appendChild(N);W.appendChild(c);c=document.createElement("div");c.className="geDialogSection";var V=this.addCheckbox(c,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!I.isSelectionEmpty(),I.isSelectionEmpty(),null,null,null,null,!0),ja=document.createElement("input");ja.setAttribute("disabled","disabled");ja.setAttribute("type","checkbox");var v=document.createElement("select");
v.style.marginLeft="8px";var d=["selectionOnly","diagram","page"];N={};for(U=0;U<d.length;U++)if(!I.isSelectionEmpty()||"selectionOnly"!=d[U]){var m=document.createElement("option");mxUtils.write(m,mxResources.get(d[U]));m.setAttribute("value",d[U]);v.appendChild(m);N[d[U]]=m}D?(U=document.createElement("div"),U.className="geDialogFormRow",t=document.createElement("span"),t.className="geDialogFormLabel",mxUtils.write(t,mxResources.get("size")+":"),U.appendChild(t),v.style.marginLeft="0",U.appendChild(v),
c.appendChild(U),mxEvent.addListener(v,"change",function(){"selectionOnly"==v.value&&(V.checked=!0)})):t&&(t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(ja),U=document.createElement("label"),mxUtils.write(U,mxResources.get("crop")),t.appendChild(U),c.appendChild(t),mxEvent.addListener(V,"change",function(){V.checked?ja.removeAttribute("disabled"):ja.setAttribute("disabled","disabled")}));I.isSelectionEmpty()?D&&null!=V.checkRow&&null!=V.checkRow.parentNode&&V.checkRow.parentNode.removeChild(V.checkRow):
@@ -14371,17 +14381,17 @@ r),r();var Q=document.createElement("input");Q.setAttribute("type","checkbox");Q
r.setAttribute("value","auto");mxUtils.write(r,mxResources.get("automatic"));X.appendChild(r);r=document.createElement("option");r.setAttribute("value","blank");mxUtils.write(r,mxResources.get("openInNewWindow"));X.appendChild(r);r=document.createElement("option");r.setAttribute("value","self");mxUtils.write(r,mxResources.get("openInThisWindow"));X.appendChild(r);"svg"==z&&null!=this.lastExportLinkTarget&&(X.value=this.lastExportLinkTarget,0>X.selectedIndex&&(X.value="auto"));t=document.createElement("div");
mxUtils.write(t,mxResources.get("LinksLost"));t.style.margin="7px";t.style.display="none";N&&W.appendChild(c);r=this.addAdvancedSection(W).content;c=I.getGraphBounds();N=I.view.scale;var da=Math.max(1,Math.ceil(c.width/N)),R=Math.max(1,Math.ceil(c.height/N)),Y=!1;U=document.createElement("div");U.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";N=document.createElement("label");mxUtils.write(N,mxResources.get("width")+":");c.appendChild(N);var ca=
document.createElement("input");ca.setAttribute("type","number");ca.value=Math.floor(da*H());c.appendChild(ca);U.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";N=document.createElement("label");mxUtils.write(N,mxResources.get("height")+":");c.appendChild(N);var P=document.createElement("input");P.setAttribute("type","number");P.value=Math.floor(R*H());c.appendChild(P);U.appendChild(c);r.appendChild(U);mxEvent.addListener(S,"change",function(){Y=!0;S.value=parseFloat((100*
-H()).toFixed(2))+"%";B()});mxEvent.addListener(ca,"change",function(){var Ca=parseInt(ca.value)/da;0<Ca&&(S.value=parseFloat((100*Ca).toFixed(2))+"%",P.value=Math.floor(R*Ca))});mxEvent.addListener(P,"change",function(){var Ca=parseInt(P.value)/R;0<Ca&&(S.value=parseFloat((100*Ca).toFixed(2))+"%",ca.value=Math.floor(da*Ca))});var aa=document.createElement("select"),ea=document.createElement("input");if("png"==z){c=["100","200","300","400"];for(U=0;U<c.length;U++)N=document.createElement("option"),
+H()).toFixed(2))+"%";B()});mxEvent.addListener(ca,"change",function(){var Da=parseInt(ca.value)/da;0<Da&&(S.value=parseFloat((100*Da).toFixed(2))+"%",P.value=Math.floor(R*Da))});mxEvent.addListener(P,"change",function(){var Da=parseInt(P.value)/R;0<Da&&(S.value=parseFloat((100*Da).toFixed(2))+"%",ca.value=Math.floor(da*Da))});var aa=document.createElement("select"),ea=document.createElement("input");if("png"==z){c=["100","200","300","400"];for(U=0;U<c.length;U++)N=document.createElement("option"),
N.setAttribute("value",c[U]),mxUtils.write(N,c[U]+"dpi"),aa.appendChild(N);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom"));aa.appendChild(c);ea.setAttribute("type","number");ea.setAttribute("value","100");ea.setAttribute("min","50");ea.setAttribute("step","50");ea.style.display="none";c=document.createElement("div");c.className="geDialogFormRow";N=document.createElement("span");N.className="geDialogFormLabel";mxUtils.write(N,mxResources.get("dpi")+
-":");c.appendChild(N);c.appendChild(aa);c.appendChild(ea);r.appendChild(c);null!=this.lastExportDpi&&(ea.value=this.lastExportDpi,aa.value=this.lastExportDpi,0>aa.selectedIndex&&(aa.value="custom",aa.style.display="none",ea.style.display=""));mxEvent.addListener(aa,"change",function(){"custom"==aa.value?(aa.style.display="none",ea.style.display="",ea.focus()):(ea.value=aa.value,Y||(S.value=aa.value+"%",B()))});mxEvent.addListener(ea,"change",function(){var Ca=parseInt(ea.value);isNaN(Ca)||0>=Ca?ea.style.backgroundColor=
-"red":(ea.style.backgroundColor="",Y||(S.value=Ca+"%",B()))})}c=document.createElement("div");c.className="geDialogFormRow";N=document.createElement("span");N.className="geDialogFormLabel";mxUtils.write(N,mxResources.get("borderWidth")+":");c.appendChild(N);var oa=document.createElement("input");oa.setAttribute("type","text");oa.value=this.lastExportBorder||"0";c.appendChild(oa);r.appendChild(c);var ra=document.createElement("select");ra.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value",
-"light");mxUtils.write(c,mxResources.get("light"));ra.appendChild(c);c=document.createElement("option");c.setAttribute("value","dark");mxUtils.write(c,mxResources.get("dark"));ra.appendChild(c);var ta=Editor.isDarkMode()?"dark":"light";"svg"==z&&mxUtils.lightDarkColorSupported&&(c=document.createElement("option"),c.setAttribute("value","auto"),mxUtils.write(c,mxResources.get("automatic")),ra.appendChild(c),ta="auto");ra.value=null!=this.lastExportTheme?this.lastExportTheme:ta;0>ra.selectedIndex&&
-(ra.value=ta);c=document.createElement("div");c.className="geDialogFormRow";N=document.createElement("span");N.className="geDialogFormLabel";mxUtils.write(N,mxResources.get("appearance")+":");c.appendChild(N);c.appendChild(ra);r.appendChild(c);"svg"==z&&(c=document.createElement("div"),c.className="geDialogFormRow",N=document.createElement("span"),N.className="geDialogFormLabel",mxUtils.write(N,mxResources.get("links")+":"),c.appendChild(N),c.appendChild(X),r.appendChild(c),r.appendChild(t));var na=
+":");c.appendChild(N);c.appendChild(aa);c.appendChild(ea);r.appendChild(c);null!=this.lastExportDpi&&(ea.value=this.lastExportDpi,aa.value=this.lastExportDpi,0>aa.selectedIndex&&(aa.value="custom",aa.style.display="none",ea.style.display=""));mxEvent.addListener(aa,"change",function(){"custom"==aa.value?(aa.style.display="none",ea.style.display="",ea.focus()):(ea.value=aa.value,Y||(S.value=aa.value+"%",B()))});mxEvent.addListener(ea,"change",function(){var Da=parseInt(ea.value);isNaN(Da)||0>=Da?ea.style.backgroundColor=
+"red":(ea.style.backgroundColor="",Y||(S.value=Da+"%",B()))})}c=document.createElement("div");c.className="geDialogFormRow";N=document.createElement("span");N.className="geDialogFormLabel";mxUtils.write(N,mxResources.get("borderWidth")+":");c.appendChild(N);var oa=document.createElement("input");oa.setAttribute("type","text");oa.value=this.lastExportBorder||"0";c.appendChild(oa);r.appendChild(c);var sa=document.createElement("select");sa.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value",
+"light");mxUtils.write(c,mxResources.get("light"));sa.appendChild(c);c=document.createElement("option");c.setAttribute("value","dark");mxUtils.write(c,mxResources.get("dark"));sa.appendChild(c);var ta=Editor.isDarkMode()?"dark":"light";"svg"==z&&mxUtils.lightDarkColorSupported&&(c=document.createElement("option"),c.setAttribute("value","auto"),mxUtils.write(c,mxResources.get("automatic")),sa.appendChild(c),ta="auto");sa.value=null!=this.lastExportTheme?this.lastExportTheme:ta;0>sa.selectedIndex&&
+(sa.value=ta);c=document.createElement("div");c.className="geDialogFormRow";N=document.createElement("span");N.className="geDialogFormLabel";mxUtils.write(N,mxResources.get("appearance")+":");c.appendChild(N);c.appendChild(sa);r.appendChild(c);"svg"==z&&(c=document.createElement("div"),c.className="geDialogFormRow",N=document.createElement("span"),N.className="geDialogFormLabel",mxUtils.write(N,mxResources.get("links")+":"),c.appendChild(N),c.appendChild(X),r.appendChild(c),r.appendChild(t));var na=
1==I.shadowVisible,wa=this.addCheckbox(r,mxResources.get("shadow"),null!=this.lastExportShadow?this.lastExportShadow:na,null,null,null,null,null,!0),ya=null,Aa="svg"!=z&&(this.isOffline()||!Editor.canvasSupported);if("png"==z||"jpeg"==z||"webp"==z||"svg"==z)ya=this.addCheckbox(r,mxResources.get("grid"),Aa||null==this.lastExportGrid?!1:this.lastExportGrid,Aa,!1,!0,null,null,!0);f&&(Q.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,t=document.createElement("div"),t.className="geDialogCheckRow",
t.appendChild(Q),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedImages")),I.setAttribute("for",Q.id),t.appendChild(I),r.appendChild(t),ba.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(ba),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedFonts")),I.setAttribute("for",ba.id),t.appendChild(I),r.appendChild(t),T.checked=null!=this.lastEmbedCellMetadata?
this.lastEmbedCellMetadata:!1,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(T),I=document.createElement("label"),mxUtils.write(I,mxResources.get("embedCellMetadata")),I.setAttribute("for",T.id),t.appendChild(I),r.appendChild(t),Z.checked=null!=this.lastEmbedIcons?this.lastEmbedIcons:!1,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(Z),I=document.createElement("label"),mxUtils.write(I,mxResources.get("icons")),I.setAttribute("for",Z.id),
-t.appendChild(I),r.appendChild(t));k=new CustomDialog(this,W,mxUtils.bind(this,function(){this.lastExportSelectionOnly=V.checked;this.lastExportBorder=oa.value;this.lastExportZoom=S.value;C&&(this.lastExportTransparent=0==F.checked?null:F.checked);this.lastExportTheme=ra.value==ta?null:ra.value;this.lastExportShadow=wa.checked==na?null:wa.checked;null==ya||Aa||(this.lastExportGrid=ya.checked?!0:null);"svg"==z&&(this.lastExportLinkTarget="auto"==X.value?null:X.value);if("png"==z){var Ca=parseInt(ea.value);
-this.lastExportDpi=!isNaN(Ca)&&0<Ca&&100!=Ca?Ca:null}D&&(this.lastExportType=v.value==x?null:v.value);f&&(this.lastEmbedImages=Q.checked,this.lastEmbedFonts=ba.checked,this.lastEmbedCellMetadata=T.checked,this.lastEmbedIcons=Z.checked);if("png"==z||"svg"==z)this.lastEmbedInclude=K.value;null!=q&&q(S.value,F.checked,!V.checked,wa.checked,G.checked,Q.checked&&f,oa.value,ja.checked,("png"==z||"svg"==z)&&"currentPage"==K.value,X.value,null!=ya?ya.checked:null,null!=ra?ra.value:null,v.value,ba.checked,
+t.appendChild(I),r.appendChild(t));k=new CustomDialog(this,W,mxUtils.bind(this,function(){this.lastExportSelectionOnly=V.checked;this.lastExportBorder=oa.value;this.lastExportZoom=S.value;C&&(this.lastExportTransparent=0==F.checked?null:F.checked);this.lastExportTheme=sa.value==ta?null:sa.value;this.lastExportShadow=wa.checked==na?null:wa.checked;null==ya||Aa||(this.lastExportGrid=ya.checked?!0:null);"svg"==z&&(this.lastExportLinkTarget="auto"==X.value?null:X.value);if("png"==z){var Da=parseInt(ea.value);
+this.lastExportDpi=!isNaN(Da)&&0<Da&&100!=Da?Da:null}D&&(this.lastExportType=v.value==x?null:v.value);f&&(this.lastEmbedImages=Q.checked,this.lastEmbedFonts=ba.checked,this.lastEmbedCellMetadata=T.checked,this.lastEmbedIcons=Z.checked);if("png"==z||"svg"==z)this.lastEmbedInclude=K.value;null!=q&&q(S.value,F.checked,!V.checked,wa.checked,G.checked,Q.checked&&f,oa.value,ja.checked,("png"==z||"svg"==z)&&"currentPage"==K.value,X.value,null!=ya?ya.checked:null,null!=sa?sa.value:null,v.value,ba.checked,
T.checked&&f,"png"==z&&0<parseInt(ea.value)&&100!=parseInt(ea.value)?parseInt(ea.value):null,Z.checked&&f)}),null,k,n);this.showDialog(k.container,360,null,!0,!0,null,null,null,null,!0);S.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?S.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,k,n,q,t,r){var z=document.createElement("div"),D=this.editor.graph;if(null!=f){var H=document.createElement("h3");mxUtils.write(H,f);z.appendChild(H)}f=
document.createElement("div");f.className="geDialogSection";var B=r?this.addPagesRow(f):null,W=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),I=this.addCheckbox(f,mxResources.get("shadow"),D.shadowVisible&&n,!n,null,null,null,null,!0),N=this.addCheckbox(f,k,!1,null,null,null,null,null,!0),U=this.addCheckbox(f,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);z.appendChild(f);k=this.addAdvancedSection(z).content;var S=null;t&&(S=document.createElement("select"),
S.style.maxWidth="260px",t=document.createElement("option"),t.setAttribute("value","light"),mxUtils.write(t,mxResources.get("light")),S.appendChild(t),t=document.createElement("option"),t.setAttribute("value","dark"),mxUtils.write(t,mxResources.get("dark")),S.appendChild(t),mxUtils.lightDarkColorSupported?(t=document.createElement("option"),t.setAttribute("value","auto"),mxUtils.write(t,mxResources.get("automatic")),S.appendChild(t),S.value="auto"):S.value=Editor.isDarkMode()?"dark":"light",t=document.createElement("div"),
@@ -14477,9 +14487,9 @@ m=d.gridSize;q=null!=q?q:mxUtils.bind(this,function(ba,T,Z,X,da,R,Y,ca,P){try{if
if(this.spinner.spin(document.body,mxResources.get("loading")))for(var x=this.currentPage,C=c.length,F=C,G=[],K=mxUtils.bind(this,function(ba,T){G[ba]=T;if(0==--F){this.spinner.stop();if(null!=z)z(G);else{var Z=[];d.getModel().beginUpdate();try{for(ba=0;ba<G.length;ba++){var X=G[ba]();null!=X&&(Z=Z.concat(X))}}finally{d.getModel().endUpdate()}}x!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);t(Z)}}),Q=0;Q<C;Q++)mxUtils.bind(this,function(ba){var T=
c[ba];if(null!=T){var Z=new FileReader;Z.onload=mxUtils.bind(this,function(X){if(null==r||r(T))try{if("image/"==T.type.substring(0,6))if("image/svg"==T.type.substring(0,9)){var da=Graph.clipSvgDataUri(X.target.result),R=da.indexOf(","),Y=decodeURIComponent(escape(atob(da.substring(R+1)))),ca=mxUtils.parseXml(Y),P=ca.getElementsByTagName("svg");if(0<P.length){var aa=P[0],ea=W?null:aa.getAttribute("content");null!=ea&&"<"!=ea.charAt(0)&&"%"!=ea.charAt(0)&&(ea=unescape(window.atob?atob(ea):Base64.decode(ea,
!0)));null!=ea&&"%"==ea.charAt(0)&&(ea=decodeURIComponent(ea));null==ea||"<mxfile "!==ea.substring(0,8)&&"<mxGraphModel>"!==ea.substring(0,14)&&"<mxGraphModel "!==ea.substring(0,14)?K(ba,mxUtils.bind(this,function(){try{if(null!=ca){var ta=ca.getElementsByTagName("svg");if(0<ta.length){var na=ta[0],wa=na.getAttribute("width"),ya=na.getAttribute("height");wa=null!=wa&&"%"!=wa.charAt(wa.length-1)?parseFloat(wa):NaN;ya=null!=ya&&"%"!=ya.charAt(ya.length-1)?parseFloat(ya):NaN;var Aa=na.getAttribute("viewBox");
-if(null==Aa||0==Aa.length)na.setAttribute("viewBox","0 0 "+wa+" "+ya);else if(isNaN(wa)||isNaN(ya)){var Ca=Aa.split(" ");3<Ca.length&&(wa=parseFloat(Ca[2]),ya=parseFloat(Ca[3]))}da=Editor.createSvgDataUri(mxUtils.getXml(na));var ua=Math.min(1,Math.min(n/Math.max(1,wa)),n/Math.max(1,ya)),qa=q(da,T.type,f+ba*m,k+ba*m,Math.max(1,Math.round(wa*ua)),Math.max(1,Math.round(ya*ua)),T.name);if(null!=qa&&(isNaN(wa)||isNaN(ya))){var ha=new Image;ha.onload=mxUtils.bind(this,function(){wa=Math.max(1,ha.width);
+if(null==Aa||0==Aa.length)na.setAttribute("viewBox","0 0 "+wa+" "+ya);else if(isNaN(wa)||isNaN(ya)){var Da=Aa.split(" ");3<Da.length&&(wa=parseFloat(Da[2]),ya=parseFloat(Da[3]))}da=Editor.createSvgDataUri(mxUtils.getXml(na));var ua=Math.min(1,Math.min(n/Math.max(1,wa)),n/Math.max(1,ya)),qa=q(da,T.type,f+ba*m,k+ba*m,Math.max(1,Math.round(wa*ua)),Math.max(1,Math.round(ya*ua)),T.name);if(null!=qa&&(isNaN(wa)||isNaN(ya))){var ha=new Image;ha.onload=mxUtils.bind(this,function(){wa=Math.max(1,ha.width);
ya=Math.max(1,ha.height);qa[0].geometry.width=wa;qa[0].geometry.height=ya;na.setAttribute("viewBox","0 0 "+wa+" "+ya);da=Editor.createSvgDataUri(mxUtils.getXml(na));var ia=da.indexOf(";");0<ia&&(da=da.substring(0,ia)+da.substring(da.indexOf(",",ia+1)));d.setCellStyles("image",da,[qa[0]])});ha.src=Editor.createSvgDataUri(mxUtils.getXml(na))}return qa}}}catch(ia){}return null})):K(ba,mxUtils.bind(this,function(){return q(ea,"text/xml",f+ba*m,k+ba*m,0,0,T.name)}))}else K(ba,mxUtils.bind(this,function(){return null}))}else{R=
-!1;if("image/png"==T.type){var oa=W?null:this.extractGraphModelFromPng(X.target.result);if(null!=oa&&0<oa.length){var ra=new Image;ra.src=X.target.result;K(ba,mxUtils.bind(this,function(){return q(oa,"text/xml",f+ba*m,k+ba*m,ra.width,ra.height,T.name)}));R=!0}}R||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):
+!1;if("image/png"==T.type){var oa=W?null:this.extractGraphModelFromPng(X.target.result);if(null!=oa&&0<oa.length){var sa=new Image;sa.src=X.target.result;K(ba,mxUtils.bind(this,function(){return q(oa,"text/xml",f+ba*m,k+ba*m,sa.width,sa.height,T.name)}));R=!0}}R||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):
this.loadImage(X.target.result,mxUtils.bind(this,function(ta){this.resizeImage(ta,Editor.stripImageMetadata(X.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(na,wa,ya){K(ba,mxUtils.bind(this,function(){if(null!=na&&na.length<H){var Aa=U&&this.isResampleImageSize(T.size,B)?Math.min(1,Math.min(n/wa,n/ya)):1;return q(na,T.type,f+ba*m,k+ba*m,Math.round(wa*Aa),Math.round(ya*Aa),T.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),U,n,B,T.size)}),mxUtils.bind(this,
function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else da=X.target.result,q(da,T.type,f+ba*m,k+ba*m,240,160,T.name,function(ta){K(ba,function(){return ta})},T)}catch(ta){K(ba,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(ta,T)}else K(ba,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(T.name)?q(null,T.type,f+ba*m,k+ba*m,240,160,T.name,function(X){K(ba,function(){return X})},T):"image"==T.type.substring(0,5)||
"application/pdf"==T.type?Z.readAsDataURL(T):Z.readAsText(T)}})(Q)});if(S){S=[];for(ja=0;ja<c.length;ja++)S.push(c[ja]);c=S;this.confirmImageResize(function(d){U=d;v()},D)}else v()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},
@@ -14494,13 +14504,13 @@ f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];f.sh
da)+1])}else if(this.isCustomLink(X))return this.getLinkTitle(X);return X};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(X){var da=X.getEvent();return null==X.getState()&&!mxEvent.isMouseEvent(da)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(da)&&(null==X.getState()||mxEvent.isControlDown(da)||mxEvent.isShiftDown(da))});var r=function(X){X=/(?:^|;)groupPadding=([^;]*)/.exec(null!=X?X:"");return null!=X?X[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(X,da){X=da.getProperty("edit");
if(null!=X&&null!=X.changes){da=X.changes.length;for(var R=[],Y=0;Y<da;Y++){var ca=X.changes[Y];ca instanceof mxStyleChange&&null!=ca.cell&&f.model.isVertex(ca.cell)&&r(ca.style)!=r(ca.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=ca.style?ca.style:"")&&(null!=f.getAttributeForCell(ca.cell,"mermaidData")||null!=f.getAttributeForCell(ca.cell,"plantUmlData"))&&0>mxUtils.indexOf(R,ca.cell)&&R.push(ca.cell)}for(Y=0;Y<R.length;Y++)c.refreshMermaidImage(R[Y])}});var z=function(X){var da=!1;c.showDialog(X.container,
640,420,!0,!0,function(R,Y){if(!da&&X.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){da=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);X.init()};f.cellEditor.editPlantUmlData=function(X,da,R){var Y=JSON.parse(R);da=f.getCurrentCellStyle(X);var ca=mxUtils.getValue(da,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,P=null==Y.format&&!ca;da="draw.io"==c.getServiceName()||"atlassian"==
-c.getServiceName();var aa=document.createElement("select");aa.className="geBtn";R=document.createElement("option");R.setAttribute("value","plantUmlDiagram");mxUtils.write(R,mxResources.get("diagram"));aa.appendChild(R);R=document.createElement("option");R.setAttribute("value","plantUmlImage");mxUtils.write(R,mxResources.get("image"));aa.appendChild(R);aa.value=ca?"plantUmlImage":"plantUmlDiagram";var ea=new SimpleTextareaDialog(c,Y.data,function(oa){if(null!=oa&&c.spinner.spin(document.body,mxResources.get("inserting"))){var ra=
-"plantUmlImage"==aa.value,ta=P?Y.config:null;c.parsePlantUmlDiagram(oa,ta,function(na,wa){c.spinner.stop();ea.hide();try{f.getModel().beginUpdate();try{if(ca&&ra)c.updateMermaidImage(X,oa,null,na,c.getMermaidImageBorder(X,Y.border),"plantUmlData");else if(P&&!ra)c.replaceLockedGroupChildren(X,na,oa,ta,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var ya=c.getMermaidImageBorder(X,Y.border),Aa=c.replaceMermaidCell(X,ra?c.createMermaidImageXml(oa,null,na,
-null,ya,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(na,oa,ta));ra||null==ya||f.setCellStyles("groupPadding",ya,Aa)}}finally{f.getModel().endUpdate()}c.showPlantUmlWarnings(wa)}catch(Ca){c.handleError(Ca)}},function(na){c.spinner.stop();c.handleError(na)})}},null,null,da?aa:null,!0,null==c.sidebar?null:function(oa,ra){c.spinner.spin(document.body,mxResources.get("loading"))&&c.parsePlantUmlDiagram(oa,P?Y.config:null,function(ta,na){c.spinner.stop();c.showPreviewTooltip(ta,ra);c.showPlantUmlWarnings(na)},
+c.getServiceName();var aa=document.createElement("select");aa.className="geBtn";R=document.createElement("option");R.setAttribute("value","plantUmlDiagram");mxUtils.write(R,mxResources.get("diagram"));aa.appendChild(R);R=document.createElement("option");R.setAttribute("value","plantUmlImage");mxUtils.write(R,mxResources.get("image"));aa.appendChild(R);aa.value=ca?"plantUmlImage":"plantUmlDiagram";var ea=new SimpleTextareaDialog(c,Y.data,function(oa){if(null!=oa&&c.spinner.spin(document.body,mxResources.get("inserting"))){var sa=
+"plantUmlImage"==aa.value,ta=P?Y.config:null;c.parsePlantUmlDiagram(oa,ta,function(na,wa){c.spinner.stop();ea.hide();try{f.getModel().beginUpdate();try{if(ca&&sa)c.updateMermaidImage(X,oa,null,na,c.getMermaidImageBorder(X,Y.border),"plantUmlData");else if(P&&!sa)c.replaceLockedGroupChildren(X,na,oa,ta,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var ya=c.getMermaidImageBorder(X,Y.border),Aa=c.replaceMermaidCell(X,sa?c.createMermaidImageXml(oa,null,na,
+null,ya,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(na,oa,ta));sa||null==ya||f.setCellStyles("groupPadding",ya,Aa)}}finally{f.getModel().endUpdate()}c.showPlantUmlWarnings(wa)}catch(Da){c.handleError(Da)}},function(na){c.spinner.stop();c.handleError(na)})}},null,null,da?aa:null,!0,null==c.sidebar?null:function(oa,sa){c.spinner.spin(document.body,mxResources.get("loading"))&&c.parsePlantUmlDiagram(oa,P?Y.config:null,function(ta,na){c.spinner.stop();c.showPreviewTooltip(ta,sa);c.showPlantUmlWarnings(na)},
function(ta){c.spinner.stop();c.handleError(ta)})});z(ea)};f.cellEditor.editMermaidData=function(X,da,R){var Y=JSON.parse(R);da=f.getCurrentCellStyle(X);var ca=mxUtils.getValue(da,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,P=ca&&null==Y.config;da="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var aa=document.createElement("select");aa.className="geBtn";R=document.createElement("option");R.setAttribute("value","mermaid");mxUtils.write(R,mxResources.get("diagram"));aa.appendChild(R);
-R=document.createElement("option");R.setAttribute("value","mermaidImage");mxUtils.write(R,mxResources.get("image"));aa.appendChild(R);aa.value=ca?"mermaidImage":"mermaid";var ea=new SimpleTextareaDialog(c,Y.data,function(oa){if(null!=oa&&c.spinner.spin(document.body,mxResources.get("inserting"))){var ra="mermaidImage"==aa.value;if(ra&&P){var ta=EditorUi.legacyMermaidConfig;var na=null}else na=ta=null!=Y.config?Y.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(oa,mxUtils.clone(ta),function(wa){c.spinner.stop();
-ea.hide();try{f.getModel().beginUpdate();try{if(ca&&ra)c.updateMermaidImage(X,oa,na,wa,c.getMermaidImageBorder(X,Y.border));else if(ca||ra){var ya=c.getMermaidImageBorder(X,Y.border),Aa=c.replaceMermaidCell(X,ra?c.createMermaidImageXml(oa,na,wa,null,ya):mxMermaidToDrawio.wrapGroup(wa,oa,na));ra||null==ya||f.setCellStyles("groupPadding",ya,Aa)}else c.replaceLockedGroupChildren(X,wa,oa,na)}finally{f.getModel().endUpdate()}}catch(Ca){c.handleError(Ca)}},function(wa){c.spinner.stop();c.handleError(wa)})}},
-null,null,da?aa:null,!0,null==c.sidebar?null:function(oa,ra){if(c.spinner.spin(document.body,mxResources.get("loading"))){var ta="mermaidImage"==aa.value&&P?EditorUi.legacyMermaidConfig:null!=Y.config?Y.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(oa,mxUtils.clone(ta),function(na){c.spinner.stop();c.showPreviewTooltip(na,ra)},function(na){c.spinner.stop();c.handleError(na)})}});z(ea)};var D=f.cellEditor.startEditing;f.cellEditor.startEditing=function(X,da,R){try{var Y=this.graph.getLockedGroupAncestor(X);
+R=document.createElement("option");R.setAttribute("value","mermaidImage");mxUtils.write(R,mxResources.get("image"));aa.appendChild(R);aa.value=ca?"mermaidImage":"mermaid";var ea=new SimpleTextareaDialog(c,Y.data,function(oa){if(null!=oa&&c.spinner.spin(document.body,mxResources.get("inserting"))){var sa="mermaidImage"==aa.value;if(sa&&P){var ta=EditorUi.legacyMermaidConfig;var na=null}else na=ta=null!=Y.config?Y.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(oa,mxUtils.clone(ta),function(wa){c.spinner.stop();
+ea.hide();try{f.getModel().beginUpdate();try{if(ca&&sa)c.updateMermaidImage(X,oa,na,wa,c.getMermaidImageBorder(X,Y.border));else if(ca||sa){var ya=c.getMermaidImageBorder(X,Y.border),Aa=c.replaceMermaidCell(X,sa?c.createMermaidImageXml(oa,na,wa,null,ya):mxMermaidToDrawio.wrapGroup(wa,oa,na));sa||null==ya||f.setCellStyles("groupPadding",ya,Aa)}else c.replaceLockedGroupChildren(X,wa,oa,na)}finally{f.getModel().endUpdate()}}catch(Da){c.handleError(Da)}},function(wa){c.spinner.stop();c.handleError(wa)})}},
+null,null,da?aa:null,!0,null==c.sidebar?null:function(oa,sa){if(c.spinner.spin(document.body,mxResources.get("loading"))){var ta="mermaidImage"==aa.value&&P?EditorUi.legacyMermaidConfig:null!=Y.config?Y.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(oa,mxUtils.clone(ta),function(na){c.spinner.stop();c.showPreviewTooltip(na,sa)},function(na){c.spinner.stop();c.handleError(na)})}});z(ea)};var D=f.cellEditor.startEditing;f.cellEditor.startEditing=function(X,da,R){try{var Y=this.graph.getLockedGroupAncestor(X);
null!=Y&&(X=Y);var ca=this.graph.getAttributeForCell(X,"plantUmlData");if(null!=ca)this.editPlantUmlData(X,da,ca);else if(ca=this.graph.getAttributeForCell(X,"mermaidData"),null!=ca&&EditorUi.isMermaidSupported())this.editMermaidData(X,da,ca);else{var P=f.getCellStyle(X);"1"==mxUtils.getValue(P,"metaEdit","0")?c.showDataDialog(X):D.call(this,X,da,R)}}catch(aa){c.handleError(aa)}};f.getLinkTitle=function(X){return c.getLinkTitle(X)};f.customLinkClicked=function(X,da){var R=!1;try{var Y=this.view.graphBounds,
ca=null!=Y?new mxRectangle(Y.x,Y.y,Y.width,Y.height):null;c.handleCustomLink(X,da);R=!0;var P=this.view.graphBounds;c.chromelessResize&&null!=ca&&null!=P&&!ca.equals(P)&&(c.chromelessResize(),this.scrollCellToVisible(da))}catch(aa){c.handleError(aa)}return R};var H=f.parseBackgroundImage;f.parseBackgroundImage=function(X){var da=H.apply(this,arguments);null!=da&&null!=da.src&&Graph.isPageLink(da.src)&&(da={originalSrc:da.src});return da};var B=f.setBackgroundImage;f.setBackgroundImage=function(X){null!=
X&&null!=X.originalSrc&&(X=c.createImageForPageLink(X.originalSrc,c.currentPage,this));B.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(X,da){X=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=X){var R=X.indexOf(",");if(0<R)for(X=X.substring(R+1),da=
@@ -14522,7 +14532,7 @@ n.setEnabled(!mxClient.IS_IOS||!navigator.standalone);n.visible=n.isEnabled();if
this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.ctrlAltActions[84]="runLastLayout",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),
Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(X,da){null!=da&&f.isEnabled()&&!f.isEditing()&&null!=da.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(X){var da=
f.cellEditor.text2,R=null;null!=da&&(mxEvent.addListener(da,"dragleave",function(Y){null!=R&&(R.parentNode.removeChild(R),R=null);Y.stopPropagation();Y.preventDefault()}),mxEvent.addListener(da,"dragover",mxUtils.bind(this,function(Y){null==R&&(R=this.highlightElement(da));Y.stopPropagation();Y.preventDefault()})),mxEvent.addListener(da,"drop",mxUtils.bind(this,function(Y){null!=R&&(R.parentNode.removeChild(R),R=null);if(0<Y.dataTransfer.files.length)this.importFiles(Y.dataTransfer.files,0,0,this.maxImageSize,
-function(P,aa,ea,oa,ra,ta){f.insertImage(P,ra,ta)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var aa=0;aa<P.length;aa++)P[aa]()},mxEvent.isControlDown(Y));else if(0<=mxUtils.indexOf(Y.dataTransfer.types,"text/uri-list")){var ca=Y.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ca)?this.loadImage(decodeURIComponent(ca),mxUtils.bind(this,function(P){var aa=Math.max(1,P.width);P=Math.max(1,P.height);var ea=this.maxImageSize;ea=Math.min(1,
+function(P,aa,ea,oa,sa,ta){f.insertImage(P,sa,ta)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var aa=0;aa<P.length;aa++)P[aa]()},mxEvent.isControlDown(Y));else if(0<=mxUtils.indexOf(Y.dataTransfer.types,"text/uri-list")){var ca=Y.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ca)?this.loadImage(decodeURIComponent(ca),mxUtils.bind(this,function(P){var aa=Math.max(1,P.width);P=Math.max(1,P.height);var ea=this.maxImageSize;ea=Math.min(1,
Math.min(ea/Math.max(1,aa)),ea/Math.max(1,P));f.insertImage(decodeURIComponent(ca),aa*ea,P*ea)})):document.execCommand("insertHTML",!1,Y.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(Y.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,Y.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(Y.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,Y.dataTransfer.getData("text/plain"));Y.stopPropagation();Y.preventDefault()})))}));if(Editor.isSettingsEnabled()){n=
this.editor.graph.view;var F=mxSettings.getUnit();n.setUnit(F);Editor.pageSizeUnit=F;n.addListener("unitChanged",function(X,da){X=da.getProperty("unit");mxSettings.setUnit(X);mxSettings.save();Editor.pageSizeUnit=X});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,n.unit);this.refresh()}if("1"==urlParams.styledev){n=document.getElementById("geFooter");null!=
n&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),n.appendChild(this.styleInput),
@@ -14530,8 +14540,8 @@ this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(th
null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var K=null;mxEvent.addListener(f.container,"dragleave",function(X){f.isEnabled()&&(null!=K&&(K.parentNode.removeChild(K),K=null),X.stopPropagation(),X.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(X){null==K&&(K=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();X.stopPropagation();X.preventDefault()}));mxEvent.addListener(f.container,
"drop",mxUtils.bind(this,function(X){null!=K&&(K.parentNode.removeChild(K),K=null);if(f.isEnabled()){var da=mxUtils.convertPoint(f.container,mxEvent.getClientX(X),mxEvent.getClientY(X)),R=X.dataTransfer.files,Y=f.view.translate,ca=f.view.scale,P=da.x/ca-Y.x,aa=da.y/ca-Y.y;if(0<R.length)da=this.isBlankFile()&&!this.canUndo(),Y=1==R.length&&(EditorUi.isVisioFilename(R[0].name)||/(\.drawio)$/i.test(R[0].name)||/(\.xml)$/i.test(R[0].name)),"1"!=urlParams.embed&&da&&(Y||mxEvent.isShiftDown(X))?(da=this.getCurrentFile(),
null!=da&&da.isModified()||this.fileLoaded(null,!0),this.openFiles(R,!0,mxUtils.bind(this,function(){var wa=this.getCurrentFile();null!=wa&&wa.fileChanged()}))):(mxEvent.isAltDown(X)&&(aa=P=null),this.importFiles(R,P,aa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(X),null,null,mxEvent.isShiftDown(X),X));else{mxEvent.isAltDown(X)&&(aa=P=0);var ea=0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")?X.dataTransfer.getData("text/uri-list"):null;R=this.extractGraphModelFromEvent(X,
-null!=this.pages);if(null!=R)f.setSelectionCells(this.importXml(R,P,aa,!0));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")){var oa=X.dataTransfer.getData("text/html");R=document.createElement("div");R.innerHTML=Graph.sanitizeHtml(oa);var ra=null;da=R.getElementsByTagName("img");null!=da&&1==da.length?(oa=da[0].getAttribute("src"),null==oa&&(oa=da[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(oa)||(ra=!0)):(da=R.getElementsByTagName("a"),null!=da&&1==da.length?oa=
-da[0].getAttribute("href"):(R=R.getElementsByTagName("pre"),null!=R&&1==R.length&&(oa=mxUtils.getTextContent(R[0]))));var ta=!0,na=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(oa,P,aa,!0,ra,null,ta,mxEvent.isControlDown(X)))});ra&&null!=oa&&oa.length>this.resampleThreshold?this.confirmImageResize(function(wa){ta=wa;na()},mxEvent.isControlDown(X)):na()}else null!=ea&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ea)?this.loadImage(decodeURIComponent(ea),mxUtils.bind(this,function(wa){var ya=
+null!=this.pages);if(null!=R)f.setSelectionCells(this.importXml(R,P,aa,!0));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")){var oa=X.dataTransfer.getData("text/html");R=document.createElement("div");R.innerHTML=Graph.sanitizeHtml(oa);var sa=null;da=R.getElementsByTagName("img");null!=da&&1==da.length?(oa=da[0].getAttribute("src"),null==oa&&(oa=da[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(oa)||(sa=!0)):(da=R.getElementsByTagName("a"),null!=da&&1==da.length?oa=
+da[0].getAttribute("href"):(R=R.getElementsByTagName("pre"),null!=R&&1==R.length&&(oa=mxUtils.getTextContent(R[0]))));var ta=!0,na=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(oa,P,aa,!0,sa,null,ta,mxEvent.isControlDown(X)))});sa&&null!=oa&&oa.length>this.resampleThreshold?this.confirmImageResize(function(wa){ta=wa;na()},mxEvent.isControlDown(X)):na()}else null!=ea&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ea)?this.loadImage(decodeURIComponent(ea),mxUtils.bind(this,function(wa){var ya=
Math.max(1,wa.width);wa=Math.max(1,wa.height);var Aa=this.maxImageSize;Aa=Math.min(1,Math.min(Aa/Math.max(1,ya)),Aa/Math.max(1,wa));f.setSelectionCell(f.insertVertex(null,null,"",P,aa,ya*Aa,wa*Aa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ea+";"))}),mxUtils.bind(this,function(wa){f.setSelectionCells(this.insertTextAt(ea,P,aa,!0))})):0<=mxUtils.indexOf(X.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(X.dataTransfer.getData("text/plain"),
P,aa,!0))}}X.stopPropagation();X.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});
f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var X=parseInt(this.div.offsetLeft),da=parseInt(this.div.offsetWidth),R=c.embedViewport.x+c.embedViewport.width,Y=parseInt(this.div.offsetTop),ca=parseInt(this.div.offsetHeight),P=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,
@@ -14548,21 +14558,21 @@ r=mxEvent.getClientY(H);n.popupMenuHandler.hideMenu();mxEvent.consume(H)}));q=q.
Math.max(20,z+mxEvent.getClientX(H)-t)+"px",B=!0);null!=r&&(this.diagramContainer.style.height=Math.max(20,D+mxEvent.getClientY(H)-r)+"px",B=!0);B&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(H){null==t&&null==r||mxEvent.consume(H);r=t=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius=
"4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(H){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(H){this.diagramContainer.style.width="10px";this.diagramContainer.style.height=
"10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML="&nbsp;";k.focus();try{var t=document.createRange();t.selectNodeContents(k);var r=window.getSelection();
-null!=r&&(r.removeAllRanges(),r.addRange(t))}catch(z){}},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";
-k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML="&nbsp;";this.clipboardElt=k;var n=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(t){var r=mxEvent.getSource(t);null==f.container||!f.isEnabled()||f.isMouseDown||
-f.isEditing()||null!=this.dialog||"INPUT"==r.nodeName||"TEXTAREA"==r.nodeName&&r!==this.typingShim||"true"==r.contentEditable||224!=t.keyCode&&(mxClient.IS_MAC||17!=t.keyCode)&&(!mxClient.IS_MAC||91!=t.keyCode&&93!=t.keyCode)||n||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",t=f.container.scrollLeft,r=f.container.scrollTop,f.container.appendChild(k),n=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=t,f.container.scrollTop=r)}));
-mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(t){var r=t.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=r&&17!=r&&91!=r&&93!=r||(n=!1,k.parentNode.removeChild(k),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(r){this.handleError(r)}}));mxEvent.addListener(k,"cut",
-mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(r){this.handleError(r)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(t){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML="&nbsp;",k.focus(),null!=t.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(t,k,!0,!0)),!mxEvent.isConsumed(t)){var r=f.container.scrollLeft,z=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=
-r,f.container.scrollTop=z,Graph.removePasteFormatting(k.firstChild),this.pasteCells(t,k,!1,!0)}catch(D){this.handleError(D)}}),0)}}catch(D){this.handleError(D)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==k?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==
-c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(k||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),
-this.restoreScrollState(f);return k};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,n=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,n-=this.embedViewport.y):(k+=this.embedViewport.x,n+=this.embedViewport.y));f={x:k,y:n,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=
-this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=c.boundingRect){var n=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-n.x;c.y-=c.boundingRect.y-n.y}this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&
-(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var n=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=n&&null!=n.getAttribute("class");if(!f&&null!=n){n=n.getAttribute("title");var q=this.getCurrentFile();
-q=null!=q?q.savingStatusKey:DrawioFile.prototype.savingStatusKey;n==mxResources.get(q)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(q))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";n=32>=c.clientWidth;c.style.visibility=n&&""==this.editor.getStatus()?"hidden":"";if(n||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=
-0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",k);k()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=
-function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),f=0;f<
-c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=
-null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=
+null!=r&&(r.removeAllRanges(),r.addRange(t))}catch(z){}},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");this.isVirtualKeyboardDevice()&&k.setAttribute("inputmode","none");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position=
+"absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1px";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML="&nbsp;";this.clipboardElt=k;var n=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(t){var r=
+mxEvent.getSource(t);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==r.nodeName||"TEXTAREA"==r.nodeName&&r!==this.typingShim||"true"==r.contentEditable||224!=t.keyCode&&(mxClient.IS_MAC||17!=t.keyCode)&&(!mxClient.IS_MAC||91!=t.keyCode&&93!=t.keyCode)||n||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",t=f.container.scrollLeft,r=f.container.scrollTop,f.container.appendChild(k),n=!0,k.focus({preventScroll:!0}),document.execCommand("selectAll",
+!1,null),f.container.scrollLeft=t,f.container.scrollTop=r)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(t){var r=t.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=r&&17!=r&&91!=r&&93!=r||(n=!1,k.parentNode.removeChild(k),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),
+c()}catch(r){this.handleError(r)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(r){this.handleError(r)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(t){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML="&nbsp;",k.focus(),null!=t.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(t,k,!0,!0)),!mxEvent.isConsumed(t)){var r=f.container.scrollLeft,z=f.container.scrollTop;
+window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=r,f.container.scrollTop=z,Graph.removePasteFormatting(k.firstChild),this.pasteCells(t,k,!1,!0)}catch(D){this.handleError(D)}}),0)}}catch(D){this.handleError(D)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==k?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};
+EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(k||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),
+this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return k};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,n=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,n-=this.embedViewport.y):(k+=this.embedViewport.x,n+=this.embedViewport.y));f={x:k,y:n,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};
+EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=c.boundingRect){var n=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-n.x;c.y-=c.boundingRect.y-n.y}this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,
+function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var n=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=n&&null!=n.getAttribute("class");
+if(!f&&null!=n){n=n.getAttribute("title");var q=this.getCurrentFile();q=null!=q?q.savingStatusKey:DrawioFile.prototype.savingStatusKey;n==mxResources.get(q)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(q))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";n=32>=c.clientWidth;c.style.visibility=n&&""==this.editor.getStatus()?"hidden":"";if(n||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?
+(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",k);k()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),
+this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=
+function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),
+this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=
null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.restoreVisibleWindows=function(){if(Editor.isSettingsEnabled()){var c={layers:"layers",outline:"outline",tags:"tags"},f;for(f in c){var k=mxSettings.getWindowState(f);null!=
k&&k.visible&&(k=this.actions.get(c[f]),null!=k&&k.funct())}}};EditorUi.prototype.saveWindowState=function(c,f){f=f.window;var k=f.minimized&&null!=f.height?parseInt(f.height):parseInt(f.div.style.height);mxSettings.setWindowState(c,{x:f.getX(),y:f.getY(),w:parseInt(f.div.style.width),h:k,visible:f.isVisible(),minimized:f.minimized||!1,dockState:f.dockState||null,dockAnchorRight:f._dockAnchorRight||null,dockAnchorBottom:f._dockAnchorBottom||null,dockOffsetX:f._dockOffsetX||null,dockOffsetY:f._dockOffsetY||
null});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,
@@ -14660,10 +14670,10 @@ if(null!=k)for(;0<k.length;)k[0].parentNode.removeChild(k[0]);if(null!=f.firstCh
q)}catch(t){}}null!=k&&(mxUtils.setTextContent(f,k),asHtml=!1)}asHtml?Graph.removePasteFormatting(f):f.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,k){this.showDialog((new PrintDialog(this,c,f,k)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,n=k.graph,q=this.getPageIndex(this.currentPage),t=null!=q?q+1:1,r=mxUtils.bind(this,
function(d,m,x,C){var F=d.useCssTransforms,G=d.currentTranslate,K=d.currentScale,Q=d.view.translate,ba=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var T=d.getGraphBounds(),Z=0,X=0,da=mxRectangle.fromRectangle(d.pageFormat),R=f.fit||f.crop||!d.pageVisible,Y=f.scale;da.width*=d.pageScale;da.height*=d.pageScale;var ca=1;if(f.fit){ca=f.sheetsAcross;var P=f.sheetsDown;isNaN(Y)||(da.width=
Math.ceil(da.width*Y),da.height=Math.ceil(da.height*Y));ca=Math.min(da.height*P/(T.height/d.view.scale),da.width*ca/(T.width/d.view.scale))}else ca=isNaN(Y)?1:Y;ca*=1;!R&&d.pageVisible?(Y=d.getPageLayout(),Z-=Y.x*da.width,X-=Y.y*da.height):R=!0;f.crop&&(f.selection&&(T=n.getBoundingBox(n.getSelectionCells())),da.width=(T.width+1)*ca/d.view.scale,da.height=(T.height+1)*ca/d.view.scale);da.width*=1;da.height*=1;C=null!=C?"page/id,"+C:null;T=f.selection?d.getBoundingBox(d.getSelectionCells()):d.getGraphBounds();
-if(null!=T){Y=d.view.scale/ca;P=T.width;var aa=T.height,ea=Z,oa=X;R||(ea-=d.view.translate.x*ca,oa-=d.view.translate.y*ca,P+=T.x,aa+=T.y);B+=Math.max(1,Math.ceil((P/Y+ea)/(da.width+1)))*Math.max(1,Math.ceil((aa/Y+oa)/(da.height+1)))}W=W||B>this.maxPrintPageCount;if(!W)if(null==m){m=PrintDialog.createPrintPreview(d,ca,null,0,Z,X,R);m.title=this.getBaseFilename(!0);m.pageSelector=!1;m.mathEnabled=!1;Z=f.border;isNaN(Z)||(m.pageMargin=Z);var ra=m.writeHead;m.writeHead=function(wa,ya){ya=null!=ya?ya:
-"";f.shadows||(ya+='g[style*="filter: drop-shadow("] {\n filter: none !important;\n}\n');mxClient.IS_GC&&(ya+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=k.fontCss&&(ya+=k.fontCss);ra.apply(this,arguments);for(var Aa=d.getCustomFonts(),Ca=0;Ca<Aa.length;Ca++){var ua=Aa[Ca].name,qa=Aa[Ca].url;Graph.isCssFontUrl(qa)?wa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(qa))+'" charset="UTF-8" type="text/css">'):(wa.writeln('<style type="text/css">'),
+if(null!=T){Y=d.view.scale/ca;P=T.width;var aa=T.height,ea=Z,oa=X;R||(ea-=d.view.translate.x*ca,oa-=d.view.translate.y*ca,P+=T.x,aa+=T.y);B+=Math.max(1,Math.ceil((P/Y+ea)/(da.width+1)))*Math.max(1,Math.ceil((aa/Y+oa)/(da.height+1)))}W=W||B>this.maxPrintPageCount;if(!W)if(null==m){m=PrintDialog.createPrintPreview(d,ca,null,0,Z,X,R);m.title=this.getBaseFilename(!0);m.pageSelector=!1;m.mathEnabled=!1;Z=f.border;isNaN(Z)||(m.pageMargin=Z);var sa=m.writeHead;m.writeHead=function(wa,ya){ya=null!=ya?ya:
+"";f.shadows||(ya+='g[style*="filter: drop-shadow("] {\n filter: none !important;\n}\n');mxClient.IS_GC&&(ya+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=k.fontCss&&(ya+=k.fontCss);sa.apply(this,arguments);for(var Aa=d.getCustomFonts(),Da=0;Da<Aa.length;Da++){var ua=Aa[Da].name,qa=Aa[Da].url;Graph.isCssFontUrl(qa)?wa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(qa))+'" charset="UTF-8" type="text/css">'):(wa.writeln('<style type="text/css">'),
wa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(ua))+'";\nsrc: url("'+mxUtils.htmlEntities(Graph.escapeCssString(qa))+'");\n}'),wa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var ta=m.drawBackgroundImage;m.drawBackgroundImage=function(wa){ta.apply(this,arguments);null!=wa.node&&(EditorUi.embedSvgImages(wa.node),n.disableSvgLinks(wa.node,function(ya){ya.setAttribute("href","javascript:void(0)")}))}}var na=m.addGraphFragment;m.addGraphFragment=function(wa,
-ya,Aa,Ca,ua,qa){na.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:ua.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var ha=ua.getElementsByTagName("svg"),ia=0;ia<ha.length;ia++)d.addSvgShadow(ha[ia])};f.grid&&(m.gridSize=d.gridSize,m.gridSteps=d.view.gridSteps,m.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:d.view.gridColor);m.isCellVisible=f.selection?function(wa){return d.isCellSelected(wa)&&d.isCellVisible(wa)}:function(wa){return d.isCellVisible(wa)};
+ya,Aa,Da,ua,qa){na.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:ua.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var ha=ua.getElementsByTagName("svg"),ia=0;ia<ha.length;ia++)d.addSvgShadow(ha[ia])};f.grid&&(m.gridSize=d.gridSize,m.gridSteps=d.view.gridSteps,m.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:d.view.gridColor);m.isCellVisible=f.selection?function(wa){return d.isCellSelected(wa)&&d.isCellVisible(wa)}:function(wa){return d.isCellVisible(wa)};
m.open(null,null,x,!0,C,da,f.selection?d.getSelectionCells():null)}else{T=d.background;if(null==T||""==T||T==mxConstants.NONE)T="#ffffff";m.backgroundColor=T;m.autoOrigin=R;f.grid&&(m.gridSize=d.gridSize,m.gridSteps=d.view.gridSteps,m.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:d.view.gridColor);m.isCellVisible=f.selection?function(wa){return d.isCellSelected(wa)&&d.isCellVisible(wa)}:function(wa){return d.isCellVisible(wa)};m.appendGraph(d,ca,Z,X,x,!0,C,da,f.selection?d.getSelectionCells():
null);x=d.getCustomFonts();if(null!=m.wnd)for(da=0;da<x.length;da++)Z=x[da].name,X=x[da].url,Graph.isCssFontUrl(X)?m.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(X))+'" charset="UTF-8" type="text/css">'):(m.wnd.document.writeln('<style type="text/css">'),m.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(Z))+'";\nsrc: url("'+mxUtils.htmlEntities(Graph.escapeCssString(X))+'");\n}'),m.wnd.document.writeln("</style>"))}F&&
(d.useCssTransforms=F,d.currentTranslate=G,d.currentScale=K,d.view.translate=Q,d.view.scale=ba);return m}),z=f.pagesFrom,D=f.pagesTo,H=!f.allPages,B=0,W=!1;q=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{H&&(H=f.selection||z==t&&D==t);if(!H&&null!=this.pages&&this.pages.length){H=0;t=this.pages.length-1;f.allPages||(H=parseInt(z)-1,t=parseInt(D)-1);for(var I=H;I<=t&&!W;I++){var N=this.pages[I];z=N==this.currentPage?n:null;if(null==z){z=this.createTemporaryGraph(n.stylesheet);
@@ -14698,208 +14708,208 @@ n-q.x,y:k.y/n-q.y,width:k.width/n,height:k.height/n},containerSize:{width:f.cont
this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(q){k.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(q)}),"*")}),null,null,!0,n,1,this.embedExportBorder,null,this.embedExportTheme)}else c||k.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),
this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(q){c||this.handleError(q)}};EditorUi.prototype.whenScriptReady=function(c,f,k){if(c())f();else var n=0,q=window.setInterval(function(){c()?(window.clearInterval(q),f()):100<=++n&&(window.clearInterval(q),null!=k&&k())},100)};EditorUi.prototype.lastLayoutSpec=null;EditorUi.prototype.resolveLayoutList=function(c){if("string"===typeof c){c=
mxUtils.trim(c);if("["==c.charAt(0))return JSON.parse(c);if("undefined"===typeof LibavoidRouting||c!==LibavoidRouting.SHORTHAND&&c!==LibavoidRouting.LAYOUT_NAME){if("parallels"===c)return[{layout:"mxParallelEdgeLayout",config:{checkOverlap:!0}}];if("undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS&&null!=ElkLayout.MENU_PRESETS[c]){c=ElkLayout.MENU_PRESETS[c];var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),
-config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainer=function(){var c=this.editor.graph,f=1==c.getSelectionCount()?c.getSelectionCell():null;return null!=f&&c.model.isVertex(f)&&(c=c.getCellStyle(f).childLayout,null!=c&&"tableLayout"!=c&&"stackLayout"!=c&&"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var k=this.editor.graph,n=f,q=null,
-t=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));n=[];for(var r=0;r<f.length;r++){var z=f[r];if(null!=z&&("mxRadialTreeLayout"==z.layout||"mxOrgChartLayout"==z.layout||"mxFastOrganicLayout"==z.layout||"mxCircleLayout"==z.layout))throw Error("Not supported as childLayout: "+z.layout);if(null!=z&&null!=Graph.elkLayoutAlgorithms[z.layout]){var D={},H;for(H in z.config)D[H]=z.config[H];delete D.rootCellIds;delete D.preserveOrigin;
-null==D.resizeNodes&&(D.resizeNodes=!1);null==D.resizeLayoutRoot&&(D.resizeLayoutRoot=!0);"elkLayered"==z.layout&&null==D.extractIsolated&&(D.extractIsolated=!1);null!=D.corners&&(t=D.corners);if(null!=D.groupPadding&&(q=String(D.groupPadding),/[;=]/.test(q)))throw Error("Invalid groupPadding: "+q);z={layout:z.layout,config:D}}n.push(z)}k.createLayouts(n);n=Graph.encodeChildLayout(n)}if(0<=n.indexOf(";"))throw Error("Invalid childLayout: "+n);k.model.beginUpdate();try{var B=k.model.getStyle(c);k.setCellStyles("childLayout",
-n,[c]);null!=q&&k.setCellStyles("groupPadding",q,[c]);null!=t&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(k,c,t);k.model.getStyle(c)==B&&null!=k.layoutManager&&k.layoutManager.executeLayout(c,!1)}finally{k.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,k){var n=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS},function(){try{var q=n.resolveLayoutList(c);if(null!=q){n.lastLayoutSpec=
-q;var t=k?n.getSelectedLayoutContainer():null;null!=t&&Array.isArray(q)&&0<q.length?(n.setContainerChildLayout(t,q),null!=f&&f()):n.executeLayouts(n.editor.graph.createLayouts(q),f)}else n.handleError(Error("Unknown layout: "+c))}catch(r){n.handleError(r)}},function(){n.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.applyChildLayouts=function(c){var f=this.editor.graph,k=function(){try{f.executeAllChildLayouts()}catch(n){null!=window.console&&console.error(n)}null!=
-c&&c()};(function(){if("undefined"!==typeof ElkLayout)return!1;for(var n=f.getChildLayoutCells(),q=0;q<n.length;q++)try{for(var t=Graph.decodeChildLayout(f.getCellStyle(n[q]).childLayout),r=0;null!=t&&r<t.length;r++)if(null!=t[r]&&"string"===typeof Graph.elkLayoutAlgorithms[t[r].layout])return!0}catch(z){}return!1})()?this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout},k,k):k()};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&null==this.passThroughKeysListener&&
-(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,k=c.ctrlKey||c.metaKey,n=null!=c.key?c.key.toLowerCase():"",q=0;q<f.length;q++){var t=f[q];if(n===String(t.key).toLowerCase()&&k===!!t.ctrl&&c.shiftKey===!!t.shift&&c.altKey===!!t.alt){c.preventDefault();c.stopImmediatePropagation();null!=t.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:t.command}),"*");break}}}),window.addEventListener("keydown",
-this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};
-EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===typeof c.keyCode&&1==c.keyCode.length,k=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(k))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var n=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:c.shift?this.altShiftActions:this.altActions;null!=c.action?n[k]=c.action:delete n[k]}else null!=c.action?(n=mxUtils.bind(this,function(){var q=this.actions.get(c.action);
-null!=q&&q.isEnabled()&&q.funct.apply(this,arguments)}),c.control?c.shift?this.keyHandler.bindControlShiftKey(k,n):this.keyHandler.bindControlKey(k,n):c.shift?this.keyHandler.bindShiftKey(k,n):this.keyHandler.bindKey(k,n)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:this.keyHandler.normalKeys)[k];null!=c.action&&(n=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=k&&57>=k||65<=k&&90>=k?String.fromCharCode(k):EditorUi.keyNames[k],
-null!=n&&null!=f&&(n.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,n=!1,q=null,t=null;this.installPassThroughKeys();var r=mxUtils.bind(this,function(H,B){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});
-this.editor.graph.model.addListener(mxEvent.CHANGE,r);mxEvent.addListener(window,"message",mxUtils.bind(this,function(H){if(H.source==(this.embedMessageSource||window.opener||window.parent)){var B=H.data,W=null,I=null,N=mxUtils.bind(this,function(ma){if(null!=ma&&"function"===typeof ma.charAt&&"<"!=ma.charAt(0))try{Editor.isPngDataUrl(ma)?ma=Editor.extractGraphModelFromPng(ma):"data:image/svg+xml;base64,"==ma.substring(0,26)?ma=atob(ma.substring(26)):"data:image/svg+xml;utf8,"==ma.substring(0,24)&&
-(ma=ma.substring(24)),null!=ma&&(""==ma.trim()?ma=null:"%"==ma.charAt(0)?ma=decodeURIComponent(ma):"<"!=ma.charAt(0)&&(ma=Graph.decompress(ma)))}catch(la){}return ma});if("json"==urlParams.proto){var U=!1;try{B=JSON.parse(B),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[H],"data",[B])}catch(ma){B=null}try{var S=B;if(null==B)return;if("dialog"==B.action){this.showError(null!=B.titleKey?mxResources.get(B.titleKey):B.title,null!=B.messageKey?mxResources.get(B.messageKey):mxUtils.htmlEntities(B.message),
-null!=B.buttonKey?mxResources.get(B.buttonKey):B.button);null!=B.modified&&(this.editor.modified=B.modified);return}if("layout"==B.action){this.executeLayoutSpec(B.layouts,mxUtils.bind(this,function(){var ma=this.createLoadMessage("layout");ma.message=B;z.postMessage(JSON.stringify(ma),"*")}));return}if("prompt"==B.action){this.spinner.stop();var V=new FilenameDialog(this,B.defaultValue||"",null!=B.okKey?mxResources.get(B.okKey):B.ok,function(ma){null!=ma?z.postMessage(JSON.stringify({event:"prompt",
-value:ma,message:B}),"*"):z.postMessage(JSON.stringify({event:"prompt-cancel",message:B}),"*")},null!=B.titleKey?mxResources.get(B.titleKey):B.title,null,null,null,null,function(){z.postMessage(JSON.stringify({event:"prompt-cancel",message:B}),"*")});this.showDialog(V.container,300,80,!0,!1);V.init();return}if("draft"==B.action){var ja=N(B.xml);this.spinner.stop();V=new DraftDialog(this,mxResources.get("draftFound",[B.name||this.defaultFilename]),ja,mxUtils.bind(this,function(){this.hideDialog();
-z.postMessage(JSON.stringify({event:"draft",result:"edit",message:B}),"*")}),mxUtils.bind(this,function(){this.hideDialog();z.postMessage(JSON.stringify({event:"draft",result:"discard",message:B}),"*")}),B.editKey?mxResources.get(B.editKey):null,B.discardKey?mxResources.get(B.discardKey):null,B.ignore?mxUtils.bind(this,function(){this.hideDialog();z.postMessage(JSON.stringify({event:"draft",result:"ignore",message:B}),"*")}):null);this.showDialog(V.container,640,480,!0,!1,mxUtils.bind(this,function(ma){ma&&
-this.actions.get("exit").funct()}));try{V.init()}catch(ma){z.postMessage(JSON.stringify({event:"draft",error:ma.toString(),message:B}),"*")}return}if("template"==B.action){this.spinner.stop();var v=1==B.enableRecent,d=1==B.enableSearch,m=1==B.enableCustomTemp;V=new NewDialog(this,!1,B.templatesOnly?!1:null!=B.callback,mxUtils.bind(this,function(ma,la,Ea,Fa){ma=ma||this.emptyDiagramXml;null!=B.callback?z.postMessage(JSON.stringify({event:"template",xml:ma,blank:ma==this.emptyDiagramXml,name:la,tempUrl:Ea,
-libs:Fa,builtIn:!0,message:B}),"*"):(c(ma,H,ma!=this.emptyDiagramXml,B.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,v?mxUtils.bind(this,function(ma){this.remoteInvoke("getRecentDiagrams",[null],null,ma,function(){ma(null,"Network Error!")})}):null,d?mxUtils.bind(this,function(ma,la){this.remoteInvoke("searchDiagrams",[ma,null],null,la,function(){la(null,"Network Error!")})}):null,mxUtils.bind(this,function(ma,la,Ea){z.postMessage(JSON.stringify({event:"template",
-docUrl:ma,info:la,name:Ea}),"*")}),null,null,m?mxUtils.bind(this,function(ma){this.remoteInvoke("getCustomTemplates",null,null,ma,function(){ma({},0)})}):null,1==B.withoutType,null,B.templatesOnly);this.showDialog(V.container,620,460,!0,!1,mxUtils.bind(this,function(ma){null!=this.sidebar&&this.sidebar.hideTooltip();ma&&!B.noExitOnCancel&&this.actions.get("exit").funct()}));V.init();return}if("textContent"==B.action){var x=this.getDiagramTextContent();z.postMessage(JSON.stringify({event:"textContent",
-data:x,message:B}),"*");return}if("status"==B.action){this.updateStatus(mxUtils.bind(this,function(){null!=B.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(B.messageKey))):null!=B.message&&this.editor.setStatus(mxUtils.htmlEntities(B.message))}));null!=B.modified&&(this.editor.modified=B.modified);return}if("spinner"==B.action){var C=null!=B.messageKey?mxResources.get(B.messageKey):B.message;null==B.show||B.show?this.spinner.spin(document.body,C):this.spinner.stop();return}if("exit"==
-B.action){this.actions.get("exit").funct();return}if("viewport"==B.action){if(null!=B.viewport){var F=this.editor.graph,G=F.view.translate.x,K=F.view.translate.y;this.embedViewport=B.viewport;F.refresh();this.diagramContainer.scrollTop-=(K-F.view.translate.y)*F.view.scale;this.diagramContainer.scrollLeft-=(G-F.view.translate.x)*F.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==B.action){var Q=this.actions.get(B.actionName);null!=Q&&Q.funct();return}if("resetEditor"==
-B.action){F=this.editor.graph;F.isEditing()&&F.stopEditing(!1);this.hideCurrentMenu();F.popupMenuHandler.hideMenu();F.clearSelection();return}if("fit"==B.action){F=this.editor.graph;var ba=F.maxFitScale;F.maxFitScale=null!=B.maxScale?B.maxScale:1;F.fit(null!=B.border?B.border:16,null,null,null,null,!0);F.maxFitScale=ba;C=this.createLoadMessage("fit");C.message=B;z.postMessage(JSON.stringify(C),"*");return}if("viewbox"==B.action){var T=EditorUi.parseViewBox(B.viewbox);null!=T&&this.applyViewBox(T);
-C=this.createLoadMessage("viewbox");C.message=B;z.postMessage(JSON.stringify(C),"*");return}if("fullscreenChanged"==B.action){var Z=null;try{var X=this.diagramContainer.getAttribute("data-scrollState");null!=X&&(this.diagramContainer.removeAttribute("data-scrollState"),Z=JSON.parse(X))}catch(ma){}Editor.inlineFullscreen=B.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=Z&&this.restoreScrollState(Z);return}if("snapshot"==B.action){this.sendEmbeddedSvgExport(!0);return}if("export"==
-B.action){if("png"==B.format||"xmlpng"==B.format){if(null==B.spin&&null==B.spinKey||this.spinner.spin(document.body,null!=B.spinKey?mxResources.get(B.spinKey):B.spin)){var da=null!=B.xml?B.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);F=this.editor.graph;var R=mxUtils.bind(this,function(ma,la){if(B.withSvg)B.withSvg=!1,this.getEmbeddedSvg(da,this.editor.graph,null,!0,function(Fa){R(ma,Fa)},null,null,B.embedImages,this.editor.graph.background,B.scale,B.border,B.shadow,"auto",null,B.embedFonts);
-else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ea=this.createLoadMessage("export");Ea.format=B.format;Ea.message=S;Ea.data=ma;Ea.svg=la;Ea.xml=da;z.postMessage(JSON.stringify(Ea),"*")}}),Y=mxUtils.bind(this,function(ma){null==ma&&(ma=Editor.blankImage);"xmlpng"==B.format&&(ma=Editor.writeGraphModelToPng(ma,"tEXt","mxfile",encodeURIComponent(da)));F!=this.editor.graph&&F.container.parentNode.removeChild(F.container);R(ma)}),ca=B.pageId||(null!=this.pages?B.currentPage?this.currentPage.getId():
-this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var P=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=ca){var ma=F.getGlobalVariable;F=this.createTemporaryGraph(F.getStylesheet());for(var la,Ea=0;Ea<this.pages.length;Ea++)if(this.pages[Ea].getId()==ca){la=this.updatePageRoot(this.pages[Ea]);break}null==la&&(la=this.currentPage);F.getGlobalVariable=function(Ma){return"page"==Ma?la.getName():"pagenumber"==Ma?1:ma.apply(this,arguments)};document.body.appendChild(F.container);
-F.model.setRoot(la.root)}if(null!=B.layerIds){var Fa=F.model,Ia=Fa.getChildCells(Fa.getRoot()),Ha=Object.create(null);for(Ea=0;Ea<B.layerIds.length;Ea++)Ha[B.layerIds[Ea]]=!0;for(Ea=0;Ea<Ia.length;Ea++)Fa.setVisible(Ia[Ea],Ha[Ia[Ea].id]||!1)}Ea=null;B.keepTheme&&(Ea=Editor.isDarkMode()?"dark":"light");null==B.width&&0<this.maxCanvasExportArea&&(Ia=F.getGraphBounds(),Ha=null!=B.border?B.border:0,Fa=Math.ceil(Ia.width/F.view.scale)+2*Ha,Ia=Math.ceil(Ia.height/F.view.scale)+2*Ha,Ha=null!=B.scale?B.scale:
-1,Fa*Ia*Ha*Ha>this.maxCanvasExportArea&&(B.scale=Math.sqrt(this.maxCanvasExportArea/(Fa*Ia))));this.editor.exportToCanvas(mxUtils.bind(this,function(Ma){Y(Ma.toDataURL("image/png"))}),B.width,null,B.background,mxUtils.bind(this,function(){Y(null)}),null,null,B.scale,B.transparent,B.shadow,null,F,B.border,null,B.grid,Ea,B.size)});null!=B.xml&&0<B.xml.length&&(k=!0,this.setFileData(da),k=!1);P()}else this.isRemoteExportEnabled()?(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==B.format?
-"1":"0")+(null!=ca?"&pageId="+ca:"")+(null!=B.layerIds&&0<B.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:B.layerIds})):"")+(null!=B.scale?"&scale="+B.scale:"")+"&base64=1&xml="+encodeURIComponent(da))).send(mxUtils.bind(this,function(ma){200<=ma.getStatus()&&299>=ma.getStatus()?R("data:image/png;base64,"+ma.getText()):Y(null)}),mxUtils.bind(this,function(){Y(null)})):Y(null)}}else if(P=mxUtils.bind(this,function(){var ma=this.createLoadMessage("export");ma.message=B;if("html2"==
-B.format||"html"==B.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var la=this.getXmlFileData();ma.xml=mxUtils.getXml(la);ma.data=this.getFileData(null,null,!0,null,null,null,la);ma.format=B.format}else if("html"==B.format)la=this.editor.getGraphXml(),ma.data=this.getHtml(la,this.editor.graph),ma.xml=mxUtils.getXml(la),ma.format=B.format;else{if("xml"==B.format)ma.xml=this.getFileData(!0),ma.format=B.format,z.postMessage(JSON.stringify(ma),"*");else if("json"==B.format)ma.format=
-B.format,ma.data=this.createJsonForExport(0!=B.allPages,1==B.includeData,1==B.compressed,1==B.selection),z.postMessage(JSON.stringify(ma),"*");else{mxSvgCanvas2D.prototype.foAltText=null;var Ea=null!=B.background?B.background:this.editor.graph.background;Ea==mxConstants.NONE&&(Ea=null);ma.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);ma.format="svg";var Fa=mxUtils.bind(this,function(bb){this.editor.graph.setEnabled(!0);this.spinner.stop();ma.data=B.asText?bb:Editor.createSvgDataUri(bb);
-z.postMessage(JSON.stringify(ma),"*")}),Ia="auto";B.keepTheme&&(Ia=Editor.isDarkMode()?"dark":"light");null!=B.theme&&(Ia=B.theme);if("xmlsvg"==B.format){if(null==B.spin&&null==B.spinKey||this.spinner.spin(document.body,null!=B.spinKey?mxResources.get(B.spinKey):B.spin)){Ia=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ia="auto";null!=B.theme&&(Ia=B.theme);this.getEmbeddedSvg(ma.xml,this.editor.graph,null,!0,Fa,null,null,B.embedImages,Ea,B.scale,B.border,B.shadow,Ia,B.embedCellMetadata,B.embedFonts)}}else if(null==
-B.spin&&null==B.spinKey||this.spinner.spin(document.body,null!=B.spinKey?mxResources.get(B.spinKey):B.spin)){this.editor.graph.setEnabled(!1);var Ha=this.editor.graph.createSvgImageExport(!1,B.embedCellMetadata?!0:!1);la=Object.create(null);var Ma=this.getSvgWithFontLookup(la,Ha,mxUtils.bind(this,function(){return this.editor.graph.getSvg(Ea,B.scale,B.border,null,null,null,null,Ha,null,this.editor.graph.shadowVisible||B.shadow,null,Ia)}));(this.editor.graph.shadowVisible||B.shadow)&&this.editor.graph.addSvgShadow(Ma);
-this.embedFonts(Ma,mxUtils.bind(this,function(bb){B.embedImages||null==B.embedImages?this.editor.convertImages(bb,mxUtils.bind(this,function(ab){Fa(mxUtils.getXml(ab))})):Fa(mxUtils.getXml(bb))}),B.embedFonts,la)}}return}z.postMessage(JSON.stringify(ma),"*")}),null!=B.xml&&0<B.xml.length){if(this.editor.graph.mathEnabled){var aa=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){aa.apply(this,arguments);P()}}k=!0;this.setFileData(B.xml);k=!1;this.editor.graph.mathEnabled||P()}else P();return}if("load"==
-B.action){U=B.toSketch;n=1==B.autosave;this.embedDiffSync=null!=B.diffSync&&!1!==B.diffSync;this.embedDiffSyncPatchOnly="object"===typeof B.diffSync&&null!=B.diffSync&&1==B.diffSync.patchOnly;this.embedExportProtocol=1==B.exportProtocol;var ea=B.sourceMetadata||null;I=null!=B.layout?B.layout:null;this.hideDialog();null!=B.modified&&null==urlParams.modified&&(urlParams.modified=B.modified);null!=B.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=B.saveAndExit);if("1"==urlParams.saveAndExit||
-"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=B.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=B.noSaveBtn);if(null!=B.rough){var oa=Editor.sketchMode;this.doSetSketchMode(B.rough);oa!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=
-B.dark&&this.setDarkMode(B.dark);null!=B.border&&(this.embedExportBorder=B.border);null!=B.theme&&(this.embedExportTheme=B.theme);null!=B.background&&(this.embedExportBackground=B.background);null!=B.viewport&&(this.embedViewport=B.viewport);this.embedExitPoint=null;var ra=EditorUi.parseViewBox(B.viewbox);null==ra&&null==B.viewbox&&null==B.scale&&null==B.fit&&(ra=EditorUi.getViewBoxParam());if(null!=ra)W=mxUtils.bind(this,function(){this.applyViewBox(ra)});else if(null!=B.scale){var ta=B.scale,na=
-null!=B.scaleBorder?B.scaleBorder:this.embedExportBorder||0,wa=null!=B.border?B.border:0;W=mxUtils.bind(this,function(){var ma=this.editor.graph,la=ma.getGraphBounds();if(0<la.width&&0<la.height){var Ea=ma.view.scale;ma.view.scaleAndTranslate(ta,ma.view.translate.x+wa-la.x/Ea+na/ta,ma.view.translate.y+wa-la.y/Ea+na/ta)}})}else if(null!=B.fit){var ya=null!=B.border?B.border:0,Aa=B.maxFitScale||1;W=mxUtils.bind(this,function(){var ma=this.editor.graph,la=ma.maxFitScale;ma.maxFitScale=Aa;ma.fit(ya,null,
-null,null,null,!0);ma.maxFitScale=la})}if(null!=B.scroll&&null!=B.scroll.x&&null!=B.scroll.y){var Ca=B.scroll,ua=W;W=mxUtils.bind(this,function(){null!=ua&&ua();var ma=this.editor.graph,la=ma.view.scale,Ea=ma.view.translate;mxUtils.hasScrollbars(ma.container)?(ma.container.scrollLeft=(Ea.x+Ca.x)*la,ma.container.scrollTop=(Ea.y+Ca.y)*la):ma.view.setTranslate(-Ca.x,-Ca.y)})}if(null!=B.rect){wa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,B.rect.left)+"px";this.diagramContainer.style.top=
-Math.max(40,B.rect.top)+"px";this.minInlineWidth=B.minWidth;this.minInlineHeight=B.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var qa=B.maxFitScale,ha=B.rect.width+2*wa,ia=B.rect.height+2*wa;W=mxUtils.bind(this,function(){var ma=mxUtils.getDocumentSize();ha=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ha):ha,ma.width-80);ma=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,
-ia):ia,ma.height-80);this.diagramContainer.style.width=ha+"px";this.diagramContainer.style.height=ma+"px";var la=this.editor.graph;ma=la.maxFitScale;la.maxFitScale=qa;la.fit(2*wa,null,null,null,null,null,ia);this.setPageVisible("1"==urlParams.pv);if(null!=this.minInlineWidth&&la.getGraphBounds().width<this.minInlineWidth){var Ea=la.container.scrollTop;this.resetScrollbars();la.container.scrollTop=Ea}la.maxFitScale=ma;la.container.scrollTop-=wa;la.container.scrollLeft-=wa;window.setTimeout(mxUtils.bind(this,
-function(){this.fireEvent(new mxEventObject("editInlineStart","data",[B]));la.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=la.container.style.top);var Fa=la.getGraphBounds();la.container.clientWidth>Fa.width+2*wa&&(la.container.scrollLeft=Fa.x+(Fa.width+wa-la.container.clientWidth)/2)}),10)})}null!=B.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=B.noExitBtn);null!=B.title&&null!=
-this.buttonContainer&&this.setEmbedTitle(B.title);try{B.libs&&this.sidebar.showEntries(B.libs)}catch(ma){}if(null!=B.xmlpng)B=this.extractGraphModelFromPng(B.xmlpng);else if(null!=B.descriptor){if(B=B.descriptor,"mermaid"==B.format){if(EditorUi.isMermaidSupported()){var pa=mxUtils.bind(this,function(ma){c(ma,H,null,U);ma=this.createLoadMessage("load");ma.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);ma.message=S;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ma),
-"*");if(null!=ea&&null!=ea.key&&null!=ea.value){ma=this.editor.graph;var la=ma.getModel().getRoot();if(null!=la){ma.getModel().beginUpdate();try{ma.setAttributeForCell(la,ea.key,ea.value)}finally{ma.getModel().endUpdate()}}}}),za=mxUtils.bind(this,function(ma){this.handleError(ma)});B.image?this.parseMermaidImage(B.data,pa,za):this.parseMermaidDiagram(B.data,null,mxUtils.bind(this,function(ma){B.wrap&&(ma=mxMermaidToDrawio.wrapGroup(ma,B.data,EditorUi.getInsertMermaidConfig(),{normalize:!0}));pa(ma)}),
-za)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else B=B.xml}else{if("merge"==B.action){var fa=this.getCurrentFile();null!=fa&&(ja=N(B.xml),null!=ja&&""!=ja&&fa.mergeFile(new LocalFile(this,ja),mxUtils.bind(this,function(){this.embedDiffSync&&(t=this.clonePages(this.pages),q=xa());z.postMessage(JSON.stringify({event:"merge",message:B}),"*")}),function(ma){z.postMessage(JSON.stringify({event:"merge",message:B,error:ma}),
-"*")}))}else if("patch"==B.action){if(fa=this.getCurrentFile(),null!=fa&&null!=B.patch)try{k=!0,fa.patch([B.patch]),this.embedDiffSync&&null!=t&&(t=this.applyPatches(t,[B.patch])),q=xa(),k=!1,X={event:"patch",message:B},Z=this.getHashValueForPages(this.pages),X.checksum=Z,null!=B.checksum&&B.checksum!=Z&&(X.checksumMismatch=!0),z.postMessage(JSON.stringify(X),"*")}catch(ma){k=!1,z.postMessage(JSON.stringify({event:"patch",message:B,error:ma.message||ma.toString()}),"*")}}else if("getDiff"==B.action){C=
-{event:"getDiff",message:B};if(this.embedDiffSync&&null!=t){var ka=this.clonePages(this.pages);C.patch=this.diffPages(t,ka);C.checksum=this.getHashValueForPages(ka)}else C.xml=xa();z.postMessage(JSON.stringify(C),"*")}else"resetDiff"==B.action?this.embedDiffSync&&(null!=B.xml?(ja=N(B.xml),fa=this.getCurrentFile(),null!=ja&&""!=ja&&null!=fa&&fa.mergeFile(new LocalFile(this,ja),mxUtils.bind(this,function(){t=this.clonePages(this.pages);q=xa();z.postMessage(JSON.stringify({event:"resetDiff",message:B,
-checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ma){z.postMessage(JSON.stringify({event:"resetDiff",message:B,error:ma}),"*")})):(t=this.clonePages(this.pages),q=xa(),z.postMessage(JSON.stringify({event:"resetDiff",message:B,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==B.action?this.handleRemoteInvokeReady(z):"remoteInvoke"==B.action?this.handleRemoteInvoke(B,H.origin):"remoteInvokeResponse"==B.action?this.handleRemoteInvokeResponse(B):z.postMessage(JSON.stringify({error:"unknownMessage",
-data:JSON.stringify(B)}),"*");return}}catch(ma){this.handleError(ma)}}var xa=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Ba=mxUtils.bind(this,function(ma,la){k=!0;try{c(ma,la,null,U)}catch(Ea){this.handleError(Ea)}k=!1;this.editor.graph.model.prefix=Editor.guid()+"-";la=mxUtils.bind(this,function(){null!=urlParams.modified&&this.clearStatus();q=xa();this.embedDiffSync&&(t=this.clonePages(this.pages));
-n&&null==f&&(f=mxUtils.bind(this,function(Fa,Ia){Fa=xa();if(Fa!=q&&!k){Ia=this.createLoadMessage("autosave");Ia.message=S;if(this.embedDiffSync&&null!=t){var Ha=this.clonePages(this.pages),Ma=this.diffPages(t,Ha);mxUtils.isEmptyObject(Ma)?Ia.xml=Fa:(Ia.patch=Ma,Ia.checksum=this.getHashValueForPages(Ha),this.embedDiffSyncPatchOnly||(Ia.xml=Fa));t=Ha}else Ia.xml=Fa;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Ia),"*")}q=Fa}),this.editor.graph.model.addListener(mxEvent.CHANGE,
-f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("tooltipsEnabledChanged",f),this.addListener("pageViewChanged",
-f),this.addListener("connectionPointsChanged",f),this.addListener("connectionArrowsChanged",f));null!=W&&W();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var Ea=this.createLoadMessage("load");Ea.xml=null!=I?xa():ma;this.embedDiffSync&&null!=this.pages&&(Ea.checksum=this.getHashValueForPages(this.pages));z.postMessage(JSON.stringify(Ea),"*")}});null!=I?this.executeLayoutSpec(I,la):la()});null!=B&&"function"===typeof B.substring&&"data:application/vnd.visio;base64,"==B.substring(0,34)?(N=
-"0M8R4KGxGuE"==B.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(B.substring(B.indexOf(",")+1)),function(ma){Ba(ma,H)},mxUtils.bind(this,function(ma){this.handleError(ma)}),N)):null!=B&&"function"===typeof B.substring&&this.isGliffyData(B,"")?this.importGliffy(B,mxUtils.bind(this,function(ma){"<mxGraphModel"==ma.substring(0,13)?Ba(ma,H):this.handleError({message:mxResources.get("unknownError")})}),mxUtils.bind(this,function(ma){this.handleError({message:null!=ma&&413==ma.status?
-mxResources.get("diagramTooLarge"):mxResources.get("unknownError")})}),""):null!=B&&"function"===typeof B.substring&&this.isLucidChartData(B)?this.convertLucidChart(B,mxUtils.bind(this,function(ma){Ba(ma)}),mxUtils.bind(this,function(ma){this.handleError(ma)})):null==B||"object"!==typeof B||null==B.format||null==B.data&&null==B.url?(B=N(B),Ba(B,H)):this.loadDescriptor(B,mxUtils.bind(this,function(ma){Ba(xa(),H)}),mxUtils.bind(this,function(ma){this.handleError(ma,mxResources.get("errorLoadingFile"))}))}}));
-var z=this.embedMessageSource||window.opener||window.parent;r="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";z.postMessage(r,"*");if("json"==urlParams.proto){var D=this.editor.graph.openLink;this.editor.graph.openLink=function(H,B,W){D.apply(this,arguments);z.postMessage(JSON.stringify({event:"openLink",href:H,target:B,allowOpener:W}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(H){for(var B=mxEvent.getSource(H);null!=
-B&&"A"!=B.nodeName;)B=B.parentNode;if(null!=B){var W=B.getAttribute("href");null==W||"#"==W.charAt(0)||"javascript:"==W.substring(0,11)||this.editor.graph.isCustomLink(W)||(H.preventDefault(),this.editor.graph.openLink(W,B.getAttribute("target")))}}),!0)}};EditorUi.prototype.createEmbedButton=function(c,f,k,n){var q=document.createElement("button");q.className="geEmbedBtn geBtn";q.setAttribute("title",c+(null!=k?" ("+k+")":""));mxUtils.write(q,c);n&&q.classList.add("gePrimaryBtn");mxEvent.addListener(q,
-"click",f);return q};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==
-this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),
-mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};
-EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,
-function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var n=JSON.parse(k),q=this.getSelectedLayoutContainer();null!=q&&Array.isArray(n)&&0<n.length?this.setContainerChildLayout(q,n):this.executeLayouts(this.editor.graph.createLayouts(n));this.lastLayoutSpec=this.customLayoutConfig=n;this.hideDialog()}catch(t){this.handleError(t)}}),null,null,null,null,mxUtils.bind(this,function(k,n){var q=this.createLayoutAddSelect(n);k.appendChild(q);
-q=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var t=n.value;n.value=JSON.stringify(JSON.parse(t));n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));n.value=t}catch(r){this.handleError(r)}}));q.setAttribute("title","copy");q.className="geBtn";k.appendChild(q)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,
-620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var k={},n=0;n<f.length;n++)null!=f[n]&&(k[f[n].id]=!0);var q=function(t){return null!=t&&!0===k[t.id]};for(n=0;n<c.length;n++)f=c[n],"undefined"!==typeof ElkLayout&&f instanceof ElkLayout||void 0!==f.cellFilter?f.cellFilter=q:"function"===typeof f.isVertexIgnored&&function(t){var r=
-t.isVertexIgnored;t.isVertexIgnored=function(z){return r.apply(this,arguments)||!q(z)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,k=document.createElement("select");k.className="geBtn";k.style.marginRight="8px";k.style.maxWidth="180px";var n=document.createElement("option");n.value="";mxUtils.write(n,mxResources.get("add")+"...");n.disabled=!0;n.selected=!0;k.appendChild(n);var q=[];"undefined"!==typeof ElkLayout&&(n=function(r,z){var D=ElkLayout.MENU_PRESETS[r];return{label:r,
-kind:"elk",algo:D.algorithm,preset:D.options,layoutName:z}},q.push(n("verticalFlow","elkLayered")),q.push(n("horizontalFlow","elkLayered")),q.push(n("verticalTree","elkTree")),q.push(n("horizontalTree","elkTree")),q.push(n("radialTree","elkRadial")),q.push(n("organic","elkOrganic")));q.push({label:"orgChart",kind:"orgchart"});q.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});q.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});
-"undefined"!==typeof LibavoidRouting&&q.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(n=0;n<q.length;n++){var t=document.createElement("option");t.value=String(n);mxUtils.write(t,mxResources.get(q[n].label)+("elk"===q[n].kind||"orgchart"===q[n].kind?"...":""));k.appendChild(t)}mxEvent.addListener(k,"change",mxUtils.bind(this,function(){var r=parseInt(k.value);k.selectedIndex=0;if(!(isNaN(r)||0>r||r>=q.length)){var z=q[r],D=c.value;if(0===mxUtils.trim(D).length)var H=
-[];else{try{H=JSON.parse(D)}catch(W){f.handleError(W);return}if(!Array.isArray(H)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var B=mxUtils.bind(this,function(W){H.push(W);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(H,null,2))});r=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(D)});"elk"===z.kind?(f.hideDialog(),ElkLayout.runWithDialog(f,z.algo,z.preset,mxResources.get(z.label),function(W,I){W=Graph.elkOptionsToConfig(W,I);B({layout:z.layoutName,
-config:W})},r)):"orgchart"===z.kind?(f.hideDialog(),f.showOrgChartConfigDialog(B,r)):B({layout:z.layoutName,config:z.config||{}})}}));return k};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var k=2,n=20,q=20,t=document.createElement("div"),r=function(N,U){var S=document.createElement("div");S.style.marginTop="6px";S.style.display="inline-block";S.style.width="180px";mxUtils.write(S,mxResources.get(N)+": ");t.appendChild(S);t.appendChild(U)},z=document.createElement("select");z.style.width=
-"160px";z.style.boxSizing="border-box";for(var D=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],H=0;H<D.length;H++){var B=document.createElement("option");mxUtils.write(B,D[H]);B.value=H;2===H&&B.setAttribute("selected","selected");z.appendChild(B)}mxEvent.addListener(z,"change",function(){k=parseInt(z.value)});r("orgChartType",
-z);var W=document.createElement("input");W.type="number";W.value=n;W.style.width="160px";W.style.boxSizing="border-box";mxEvent.addListener(W,"change",function(){n=parseInt(W.value)});r("parentChildSpacing",W);var I=document.createElement("input");I.type="number";I.value=q;I.style.width="160px";I.style.boxSizing="border-box";mxEvent.addListener(I,"change",function(){q=parseInt(I.value)});r("siblingSpacing",I);f=new CustomDialog(this,t,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:k,
-parentChildSpacing:n,siblingSpacing:q}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(k){var n=mxUtils.bind(this,function(){this.loadingOrgChart=!1;k.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),q=mxUtils.bind(this,function(t){this.loadingOrgChart=!1;k.clear()&&this.handleError(t)});
-if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))n();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",n,null,null,null,q)},null,null,null,q)},null,null,null,q)},null,null,null,q):mxscript(window.DRAWIO_SERVER_URL+
-"js/orgchart.min.js",n,null,null,null,q)}),onerror)};EditorUi.prototype.importCsv=function(c,f,k,n){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}),n)};EditorUi.prototype.doImportCsv=function(c,f,k){try{var n=c.split("\n"),q=[],t=[],r=[],z=Object.create(null);if(0<n.length){var D=Object.create(null);k=null!=k?k:this.editor.graph;var H=null,B=null,W=null,I=null,N=null,U=null,S=null,V="whiteSpace=wrap;html=1;",ja=null,v=null,d="",m="auto",x="auto",C=!1,F=null,G=null,
-K=40,Q=40,ba=100,T=0,Z=mxUtils.bind(this,function(){null!=f?f(Ea):(k.setSelectionCells(Ea),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),X=k.getFreeInsertPoint(!0),da=X.x,R=X.y;X=R;var Y=null,ca="auto";v=null;for(var P=[],aa=null,ea=null,oa=0;oa<n.length&&"#"==n[oa].charAt(0);){c=n[oa].replace(/\r$/,"");for(oa++;oa<n.length&&"\\"==c.charAt(c.length-1)&&"#"==n[oa].charAt(0);)c=c.substring(0,
-c.length-1)+mxUtils.trim(n[oa].substring(1)),oa++;if("#"!=c.charAt(1)){var ra=c.indexOf(":");if(0<ra){var ta=mxUtils.trim(c.substring(1,ra)),na=mxUtils.trim(c.substring(ra+1));"label"==ta?Y=Graph.sanitizeHtml(na):"labelname"==ta&&0<na.length&&"-"!=na?N=na:"labels"==ta&&0<na.length&&"-"!=na?S=JSON.parse(na):"style"==ta?B=na:"parentstyle"==ta?V=na:"unknownStyle"==ta&&"-"!=na?U=na:"stylename"==ta&&0<na.length&&"-"!=na?I=na:"styles"==ta&&0<na.length&&"-"!=na?W=JSON.parse(na):"vars"==ta&&0<na.length&&
-"-"!=na?H=JSON.parse(na):"identity"==ta&&0<na.length&&"-"!=na?ja=na:"parent"==ta&&0<na.length&&"-"!=na?v=na:"namespace"==ta&&0<na.length&&"-"!=na?d=na:"width"==ta?m=na:"height"==ta?x=na:"collapsed"==ta&&"-"!=na?C="true"==na:"left"==ta&&0<na.length?F=na:"top"==ta&&0<na.length?G=na:"ignore"==ta?ea=na.split(","):"connect"==ta?P.push(JSON.parse(na)):"link"==ta?aa=na:"padding"==ta?T=parseFloat(na):"edgespacing"==ta?K=parseFloat(na):"nodespacing"==ta?Q=parseFloat(na):"levelspacing"==ta?ba=parseFloat(na):
-"layout"==ta&&(ca=na)}}}if(null==n[oa])throw Error(mxResources.get("invalidOrMissingFile"));var wa=this.editor.csvToArray(n[oa].replace(/\r$/,""));ra=c=null;ta=[];for(na=0;na<wa.length;na++)ja==wa[na]&&(c=na),v==wa[na]&&(ra=na),ta.push(mxUtils.trim(wa[na]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Y&&(Y="%"+ta[0]+"%");if(null!=P)for(var ya=0;ya<P.length;ya++)null==D[P[ya].to]&&(D[P[ya].to]=Object.create(null));ja=[];for(na=oa+1;na<n.length;na++){var Aa=this.editor.csvToArray(n[na].replace(/\r$/,
-""));if(null==Aa){var Ca=40<n[na].length?n[na].substring(0,40)+"...":n[na];throw Error(Ca+" ("+na+"):\n"+mxResources.get("containsValidationErrors"));}0<Aa.length&&ja.push(Aa)}k.model.beginUpdate();try{for(na=0;na<ja.length;na++){Aa=ja[na];var ua=null,qa=null!=c?d+Aa[c]:null;n=!1;null!=qa&&(ua=k.model.getCell(qa),n=null==ua||0<=mxUtils.indexOf(q,ua));var ha=new mxCell(Y,new mxGeometry(da,X,0,0),B||"whiteSpace=wrap;html=1;");ha.collapsed=C;ha.vertex=!0;ha.id=qa;null==ua||n||k.model.setCollapsed(ua,
-C);for(var ia=0;ia<Aa.length;ia++)k.setAttributeForCell(ha,ta[ia],Aa[ia]),null==ua||n||k.setAttributeForCell(ua,ta[ia],Aa[ia]);if(null!=N&&null!=S){var pa=ha.getAttribute(N),za=null!=pa&&Object.prototype.hasOwnProperty.call(S,pa)?S[pa]:null;null!=za&&(k.labelChanged(ha,za),null==ua||n||k.cellLabelChanged(ua,za))}if(null!=I&&null!=W){var fa=ha.getAttribute(I),ka=null!=fa&&Object.prototype.hasOwnProperty.call(W,fa)?W[fa]:null;null!=ka&&(ha.style=ka)}k.setAttributeForCell(ha,"placeholders","1");ha.style=
-k.replacePlaceholders(ha,ha.style,H);null==ua||n?k.fireEvent(new mxEventObject("cellsInserted","cells",[ha])):(k.model.setStyle(ua,ha.style),0>mxUtils.indexOf(r,ua)&&r.push(ua),k.fireEvent(new mxEventObject("cellsInserted","cells",[ua])));n=null!=ua;ua=ha;if(!n)for(ya=0;ya<P.length;ya++)D[P[ya].to][ua.getAttribute(P[ya].to)]=ua;null!=aa&&"link"!=aa&&(k.setLinkForCell(ua,ua.getAttribute(aa)),k.setAttributeForCell(ua,aa,null));var xa=k.getPreferredSizeForCell(ua);v=null!=ra?k.model.getCell(d+Aa[ra]):
-null;if(ua.vertex){Ca=null!=v?0:da;oa=null!=v?0:R;null!=F&&null!=ua.getAttribute(F)&&(ua.geometry.x=Ca+parseFloat(ua.getAttribute(F)));null!=G&&null!=ua.getAttribute(G)&&(ua.geometry.y=oa+parseFloat(ua.getAttribute(G)));var Ba="@"==m.charAt(0)?ua.getAttribute(m.substring(1)):null;ua.geometry.width=null!=Ba&&"auto"!=Ba?parseFloat(ua.getAttribute(m.substring(1))):"auto"==m||"auto"==Ba?xa.width+T:parseFloat(m);var ma="@"==x.charAt(0)?ua.getAttribute(x.substring(1)):null;ua.geometry.height=null!=ma&&
-"auto"!=ma&&"width"!=x?parseFloat(ma):"auto"==x||"auto"==ma?xa.height+T:"width"==x?ua.geometry.width:parseFloat(x);X+=ua.geometry.height+Q}n?(null==z[qa]&&(z[qa]=[]),z[qa].push(ua)):(q.push(ua),null!=v?(v.style=k.replacePlaceholders(v,V,H),k.addCell(ua,v),t.push(v)):r.push(k.addCell(ua)))}for(na=0;na<t.length;na++)Ba="@"==m.charAt(0)?t[na].getAttribute(m.substring(1)):null,ma="@"==x.charAt(0)?t[na].getAttribute(x.substring(1)):null,"auto"!=m&&"auto"!=Ba||"auto"!=x&&"auto"!=ma||k.updateGroupBounds([t[na]],
-T,!0);var la=r.slice(),Ea=r.slice();for(ya=0;ya<P.length;ya++){var Fa=P[ya];for(na=0;na<q.length;na++){ua=q[na];var Ia=mxUtils.bind(this,function(fb,eb,Wa){var cb=eb.getAttribute(Wa.from);if(null!=cb&&""!=cb){cb=cb.split(",");for(var Gb=0;Gb<cb.length;Gb++){var sb=D[Wa.to][cb[Gb]];if(null==sb&&null!=U){sb=new mxCell(cb[Gb],new mxGeometry(da,R,0,0),U);sb.style=k.replacePlaceholders(eb,sb.style,H);var wb=k.getPreferredSizeForCell(sb);sb.geometry.width=wb.width+T;sb.geometry.height=wb.height+T;D[Wa.to][cb[Gb]]=
-sb;sb.vertex=!0;sb.id=cb[Gb];r.push(k.addCell(sb))}if(null!=sb){wb=Wa.label;null!=Wa.fromlabel&&(wb=(eb.getAttribute(Wa.fromlabel)||"")+(wb||""));null!=Wa.sourcelabel&&(wb=k.replacePlaceholders(eb,Wa.sourcelabel,H)+(wb||""));null!=Wa.tolabel&&(wb=(wb||"")+(sb.getAttribute(Wa.tolabel)||""));null!=Wa.targetlabel&&(wb=(wb||"")+k.replacePlaceholders(sb,Wa.targetlabel,H));var Eb="target"==Wa.placeholders==!Wa.invert?sb:fb;Eb=null!=Wa.style?k.replacePlaceholders(Eb,Wa.style,H):k.createCurrentEdgeStyle();
-wb=k.insertEdge(null,null,wb||"",Wa.invert?sb:fb,Wa.invert?fb:sb,Eb);if(null!=Wa.labels)for(Eb=0;Eb<Wa.labels.length;Eb++){var pb=Wa.labels[Eb],Ab=new mxCell(pb.label||Eb,new mxGeometry(null!=pb.x?pb.x:0,null!=pb.y?pb.y:0,0,0),"resizable=0;html=1;");Ab.vertex=!0;Ab.connectable=!1;Ab.geometry.relative=!0;null!=pb.placeholders&&(Ab.value=k.replacePlaceholders("target"==pb.placeholders==!Wa.invert?sb:fb,Ab.value,H));if(null!=pb.dx||null!=pb.dy)Ab.geometry.offset=new mxPoint(null!=pb.dx?pb.dx:0,null!=
-pb.dy?pb.dy:0);wb.insert(Ab)}if(null!=Wa.data)for(var Ib in Wa.data)k.setAttributeForCell(wb,Ib,Wa.data[Ib]);Ea.push(wb);mxUtils.remove(Wa.invert?fb:sb,la)}}}});Ia(ua,ua,Fa);if(null!=z[ua.id])for(ia=0;ia<z[ua.id].length;ia++)Ia(ua,z[ua.id][ia],Fa)}}if(null!=ea)for(na=0;na<q.length;na++)for(ua=q[na],ia=0;ia<ea.length;ia++)k.setAttributeForCell(ua,mxUtils.trim(ea[ia]),null);if(0<r.length){var Ha=new mxParallelEdgeLayout(k);Ha.spacing=K;Ha.checkOverlap=!0;var Ma=function(){0<Ha.spacing&&Ha.execute(k.getDefaultParent());
-var fb=0,eb=0;0<r.length&&(eb=k.getCellGeometry(r[0]),fb=Math.round(k.snap(eb.x))-eb.x,eb=Math.round(k.snap(eb.y))-eb.y);for(var Wa=0;Wa<r.length;Wa++){var cb=k.getCellGeometry(r[Wa]);cb.x=Math.round(cb.x+fb);cb.y=Math.round(cb.y+eb);"auto"==m&&(cb.width=Math.round(k.snap(cb.width)));"auto"==x&&(cb.height=Math.round(k.snap(cb.height)))}};"auto"==ca&&1==la.length&&(ca=Ea.length==2*r.length-1?"verticaltree":"verticalflow");var bb="organic"==ca||null!=EditorUi.CSV_ELK_LAYOUTS[ca]?null:this.resolveLayoutList(ca);
-if(null!=bb){var ab=Z;k.view.validate();var tb=k.createLayouts(bb);this.scopeLayoutsToCells(tb,Ea);this.executeLayouts(tb,function(){Ma();ab()});Z=null}else if("circle"==ca){var yb=new mxCircleLayout(k);yb.disableEdgeStyle=!1;yb.resetEdges=!1;var jb=yb.isVertexIgnored;yb.isVertexIgnored=function(fb){return jb.apply(this,arguments)||0>mxUtils.indexOf(r,fb)};this.executeLayout(function(){yb.execute(k.getDefaultParent());Ma()},!0,Z);Z=null}else if("verticaltree"==ca||"horizontaltree"==ca){k.view.validate();
-var hb=new mxCompactTreeLayout(k,"horizontaltree"==ca);hb.levelDistance=Q;hb.edgeRouting=!1;hb.resetEdges=!1;hb.sortEdges=!0;var rb=hb.isVertexIgnored;hb.isVertexIgnored=function(fb){return rb.apply(this,arguments)||0>mxUtils.indexOf(r,fb)};this.executeLayout(function(){hb.execute(k.getDefaultParent(),0<la.length?la[0]:null)},!0,Z);Z=null}else if("orgchart"==ca){k.view.validate();var Sa=new mxOrgChartLayout(k,2,ba,Q),Ua=Sa.isVertexIgnored;Sa.isVertexIgnored=function(fb){return Ua.apply(this,arguments)||
-0>mxUtils.indexOf(r,fb)};this.executeLayout(function(){Sa.execute(k.getDefaultParent());Ma()},!0,Z);Z=null}else if("organic"==ca||"auto"==ca&&Ea.length>r.length){k.view.validate();var vb=new mxFastOrganicLayout(k);vb.forceConstant=3*Q;vb.disableEdgeStyle=!1;vb.resetEdges=!1;var kb=vb.isVertexIgnored;vb.isVertexIgnored=function(fb){return kb.apply(this,arguments)||0>mxUtils.indexOf(r,fb)};this.executeLayout(function(){vb.execute(k.getDefaultParent());Ma()},!0,Z);Z=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[ca]){k.view.validate();
-ab=Z;var qb=EditorUi.CSV_ELK_LAYOUTS[ca],lb=mxUtils.clone(qb.config);lb["elk.spacing.nodeNode"]=Q;lb["elk.layered.spacing.nodeNodeBetweenLayers"]=ba;lb["elk.spacing.edgeEdge"]=K;lb["elk.layered.spacing.edgeEdgeBetweenLayers"]=K;var Za=k.createLayouts([{layout:qb.layout,config:lb}]);this.scopeLayoutsToCells(Za,Ea);k.model.beginUpdate();var Hb=!1,Db=function(){Hb||(Hb=!0,k.model.endUpdate())},Cb=this;try{Za[0].prepare(k.getDefaultParent(),function(fb,eb){null!=fb?(Db(),Cb.handleError(fb)):Cb.executeLayout(function(){eb();
-var Wa=k.getBoundingBoxFromGeometry(Ea);null!=Wa&&k.moveCells(Ea,da-Wa.x,R-Wa.y)},!0,function(){Db();ab()})})}catch(fb){throw Db(),fb;}Z=null}}this.hideDialog()}finally{k.model.endUpdate()}null!=Z&&Z()}}catch(fb){this.handleError(fb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(f+=k+n+"="+urlParams[n],k="&")}else f=window.location.search;
-return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),n;for(n in urlParams)0>mxUtils.indexOf(k,n)&&(c=0==f?c+"?":c+"&",null!=urlParams[n]&&(c+=n+"="+urlParams[n],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,k,n,q){c=new LinkDialog(this,c,f,k,!0,n,q);this.showDialog(c.container,
-440,null,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=
-this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var k=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();
-this.menus.get("extras").setEnabled(k);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(k),this.menus.get("newLibrary").setEnabled(k));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);
-this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||
-"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var L=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){L.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),k=this.getSelectionState(),n=this.isDiagramActive(),
-q="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&q);this.actions.get("redo").setEnabled(this.canRedo()&&q);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(n&&(1==k.edges.length||1==k.vertices.length));this.actions.get("editConnectionPoints").setEnabled(n&&
-0==k.edges.length&&1==k.vertices.length);this.actions.get("editPolygon").setEnabled(n&&1==k.vertices.length&&"mxgraph.basic.polygon"==k.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(n&&k.image&&0<k.cells.length);this.actions.get("crop").setEnabled(n&&k.image&&0<k.cells.length);this.actions.get("pageSetup").setEnabled(n);this.actions.get("shadowVisible").setEnabled(n);this.actions.get("connectionArrows").setEnabled(n);this.actions.get("connectionPoints").setEnabled(n);this.actions.get("copyStyle").setEnabled(n&&
-!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&n&&0<k.cells.length);this.actions.get("copyTextStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&n&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length&&!k.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<k.cells.length);this.actions.get("createShape").setEnabled(n);this.actions.get("createRevision").setEnabled(n);
-this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);
-this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):
-"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(n&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var O=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);O.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,n,q,t,r,z){var D=c.editor.graph;
-if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(D.getSvg(n,q,t)),"image/svg+xml");else{var H=c.getFileData(!0,null,null,null,null,!0),B=D.getGraphBounds(),W=Math.floor(B.width*q/D.view.scale),I=Math.floor(B.height*q/D.view.scale);if(H.length<=MAX_REQUEST_SIZE&&W*I<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas())if(c.isRemoteExportEnabled()){var N=
-{globalVars:D.getExportVariables()};z&&(N.grid={size:D.gridSize,steps:D.view.gridSteps,color:D.view.gridColor});c.saveRequest(f,k,function(U,S){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(S||"0")+(null!=U?"&filename="+encodeURIComponent(U):"")+"&extras="+encodeURIComponent(JSON.stringify(N))+(0<r?"&dpi="+r:"")+"&bg="+(null!=n?n:"none")+"&w="+W+"&h="+I+"&border="+t+"&xml="+encodeURIComponent(H))})}else c.handleError({message:mxResources.get("notAvailable")});else"png"==k?c.exportImage(q,
-null==n||"none"==n,!0,!1,!1,t,!0,!1,null,z,r):c.exportImage(q,!1,!0,!1,!1,t,!0,!1,"jpeg",z);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var n=c;this.currentPage!=this.pages[k]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),n.model.setRoot(this.pages[k].root));f+=this.pages[k].getName()+
-" "+n.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,k){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){k.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));k.html=f;return}k.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var k={id:c.getId()};k.type=f?"layer":c.edge?"edge":
-c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(k.parent=f.getId()));c.edge&&(null!=c.source&&(k.source=c.source.getId()),null!=c.target&&(k.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),k);c=f.attributes;f={};for(var n=0,q=0;q<c.length;q++){var t=c[q].nodeName;"label"!=t&&"placeholders"!=t&&"id"!=t&&(f[t]=c[q].nodeValue,n++)}0<n&&(k.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,k);return k};EditorUi.prototype.getJsonForPage=
-function(c,f){var k=this.editor.graph.getModel();var n=null==c||c==this.currentPage?k.getRoot():this.updatePageRoot(c).root;var q=[],t=mxUtils.bind(this,function(B,W){q.push(this.getJsonForExportCell(B,W));W=B.getChildCount();for(var I=0;I<W;I++)t(B.getChildAt(I),!1)});if(null!=f){n={};for(var r=0;r<f.length;r++)n[f[r].getId()]=!0;for(r=0;r<f.length;r++){for(var z=f[r],D=z.getParent(),H=!1;null!=D;){if(n[D.getId()]){H=!0;break}D=D.getParent()}H||t(z,k.isLayer(z))}}else for(f=n.getChildCount(),r=0;r<
-f;r++)t(n.getChildAt(r),!0);r={};null!=c&&(r.id=c.getId(),r.name=c.getName());r.cells=q;return r};EditorUi.prototype.createJsonForExport=function(c,f,k,n){var q={version:EditorUi.VERSION};f&&(q.data=mxUtils.getXml(this.getXmlFileData(!n,!c,!k)));f=[];if(n)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));q.pages=
-f;return q};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},k=document.createElement("div");k.style.whiteSpace="nowrap";var n=document.createElement("h3");mxUtils.write(n,mxUtils.htmlEntities(c));k.appendChild(n);var q=document.createElement("div");q.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";q.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var t={};try{var r=mxSettings.getCustomLibraries();for(c=0;c<
-r.length;c++){var z=r[c];if("R"==z.substring(0,1)){var D=JSON.parse(decodeURIComponent(z.substring(1)));t[D[0]]={id:D[0],title:D[1],downloadUrl:D[2]}}}}catch(H){}this.remoteInvoke("getCustomLibraries",null,null,function(H){q.innerText="";if(0==H.length)q.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var B=0;B<H.length;B++){var W=H[B];t[W.id]&&(f[W.id]=W);var I=this.addCheckbox(q,W.title,t[W.id]);(function(N,
-U){mxEvent.addListener(U,"change",function(){this.checked?f[N.id]=N:delete f[N.id]})})(W,I)}},mxUtils.bind(this,function(H){q.innerText="";var B=document.createElement("div");B.style.padding="8px";B.style.textAlign="center";mxUtils.write(B,mxResources.get("error")+": ");mxUtils.write(B,null!=H&&null!=H.message?H.message:mxResources.get("unknownError"));q.appendChild(B)}));k.appendChild(q);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));
-var H=0,B;for(B in f)null==t[B]&&(H++,mxUtils.bind(this,function(W){this.remoteInvoke("getFileContent",[W.downloadUrl],null,mxUtils.bind(this,function(I){H--;0==H&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,I,W)),this.showSidebar()}catch(N){this.handleError(N,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){H--;0==H&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[B]));for(B in t)f[B]||this.closeLibrary(new RemoteLibrary(this,
-null,t[B]));0==H&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=
-[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=null!=f?f.callbackId:null,n="number"===typeof k&&0<=k&&k<this.remoteInvokeCallbacks.length?this.remoteInvokeCallbacks[k]:null;if(null==n)throw Error("No callback for "+(null!=f?f.callbackId:
-"null"));c.error?n.error&&n.error(c.error.errResp):n.callback&&n.callback.apply(this,c.resp);this.remoteInvokeCallbacks[k]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,n,q){var t=!0,r=window.setTimeout(mxUtils.bind(this,function(){t=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),z=mxUtils.bind(this,function(){window.clearTimeout(r);t&&n.apply(this,arguments)}),D=mxUtils.bind(this,function(){window.clearTimeout(r);t&&q.apply(this,arguments)});k=k||{};k.callbackId=
-this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:z,error:D});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var k=mxUtils.bind(this,function(H,B){var W={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=B?W.error={errResp:B}:null!=H&&(W.resp=H);this.remoteWin.postMessage(JSON.stringify(W),
-"*")});try{var n=c.funtionName,q=null!=n&&Object.prototype.hasOwnProperty.call(this.remoteInvokableFns,n)?this.remoteInvokableFns[n]:null;if(null!=q&&"function"===typeof this[n]){if(q.allowedDomains){for(var t=!1,r=0;r<q.allowedDomains.length;r++)if(f=="https://"+q.allowedDomains[r]){t=!0;break}if(!t){k(null,"Invalid Call: "+n+" is not allowed.");return}}var z=c.functionArgs;Array.isArray(z)||(z=[]);if(q.isAsync)z.push(function(){k(Array.prototype.slice.apply(arguments))}),z.push(function(H){k(null,
-H||"Unkown Error")}),this[n].apply(this,z);else{var D=this[n].apply(this,z);k([D])}}else k(null,"Invalid Call: "+n+" is not found.")}catch(H){k(null,"Invalid Call: An error occurred, "+H.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var n=k.open("database",2);n.onupgradeneeded=function(q){try{var t=n.result;1>q.oldVersion&&t.createObjectStore("objects",{keyPath:"key"});2>q.oldVersion&&
-(t.createObjectStore("files",{keyPath:"title"}),t.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(r){null!=f&&f(r)}};n.onsuccess=mxUtils.bind(this,function(q){try{var t=n.result;this.database=t;EditorUi.migrateStorageFiles&&(StorageFile.migrate(t),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(r){if((!r||
-"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var z=document.createElement("iframe");z.style.display="none";z.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(z);var D=!0,H=!1,B,W=0,I=mxUtils.bind(this,function(){H=!0;this.setDatabaseItem(".drawioMigrated3",!0);z.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),N=mxUtils.bind(this,function(){W++;U()}),
-U=mxUtils.bind(this,function(){try{if(W>=B.length)I();else{var V=B[W];StorageFile.getFileContent(this,V,mxUtils.bind(this,function(ja){null==ja||".scratchpad"==V&&ja==this.emptyLibraryXml?z.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[V]}),"*"):N()}),N)}}catch(ja){console.log(ja)}}),S=mxUtils.bind(this,function(V){try{this.setDatabaseItem(null,[{title:V.title,size:V.data.length,lastModified:Date.now(),type:V.isLib?"L":"F"},{title:V.title,
-data:V.data}],N,N,["filesInfo","files"])}catch(ja){console.log(ja)}});r=mxUtils.bind(this,function(V){try{if(V.source==z.contentWindow){var ja={};try{ja=JSON.parse(V.data)}catch(v){}"init"==ja.event?(z.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),z.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=ja.event||H||(D?null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?(B=ja.resp[0],D=!1,U()):
-I():null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?S(ja.resp[0]):N())}}catch(v){console.log(v)}});window.addEventListener("message",r)}})));c(t);t.onversionchange=function(){t.close()}}catch(r){null!=f?f(r):null!=window.console&&console.warn(r)}});n.onerror=f;n.onblocked=function(){}}catch(q){null!=f?f(q):null!=window.console&&console.error(q)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,n,q){this.openDatabase(mxUtils.bind(this,
-function(t){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c],f=[f]);var r=t.transaction(q,"readwrite");r.oncomplete=k;r.onerror=n;for(t=0;t<q.length;t++)r.objectStore(q[t]).put(null!=c&&null!=c[t]?{key:c[t],data:f[t]}:f[t])}catch(z){null!=n&&n(z)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,n){this.openDatabase(mxUtils.bind(this,function(q){try{n=n||"objects";Array.isArray(n)||(n=[n],c=[c]);var t=q.transaction(n,"readwrite");t.oncomplete=f;t.onerror=k;for(q=0;q<n.length;q++)t.objectStore(n[q]).delete(c[q])}catch(r){null!=
-k&&k(r)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,n){this.openDatabase(mxUtils.bind(this,function(q){try{n=n||"objects";var t=q.transaction([n],"readonly").objectStore(n).get(c);t.onsuccess=function(){f(t.result)};t.onerror=k}catch(r){null!=k&&k(r)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(n){try{k=k||"objects";var q=n.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),t=[];q.onsuccess=function(r){null==
-r.target.result?c(t):(t.push(r.target.result.value),r.target.result.continue())};q.onerror=f}catch(r){null!=f&&f(r)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(n){try{k=k||"objects";var q=n.transaction([k],"readonly").objectStore(k).getAllKeys();q.onsuccess=function(){c(q.result)};q.onerror=f}catch(t){null!=f&&f(t)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};
-EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var k=this.getCurrentFile();null!=k?k.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,k){var n=this.getCurrentFile();null!=n?n.addComment(c,f,k):f(Date.now())};EditorUi.prototype.canReplyToReplies=
-function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.anchoredCommentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.anchoredCommentsSupported():!1};EditorUi.prototype.mentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionsSupported():!1};EditorUi.prototype.freeMentionsSupported=function(){var c=this.getCurrentFile();
-return null!=c?c.freeMentionsSupported():!1};EditorUi.prototype.mentionsLiveSearch=function(){var c=this.getCurrentFile();return null!=c?c.mentionsLiveSearch():!1};EditorUi.prototype.mentionNotificationsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionNotificationsSupported():!0};EditorUi.prototype.getMentionCandidates=function(c,f,k){var n=this.getCurrentFile();null!=n?n.getMentionCandidates(c,f,k):c([])};EditorUi.prototype.serializeMention=function(c){return"+"+c.email};
-EditorUi.prototype.parseMentionTokens=function(c){for(var f=/[+@]([A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,})/g,k=[],n=0,q;null!=(q=f.exec(c));)q.index>n&&k.push(c.substring(n,q.index)),k.push({email:q[1]}),n=q.index+q[0].length;n<c.length&&k.push(c.substring(n));return k};EditorUi.prototype.getCommentCacheTarget=function(){var c=this.getCurrentFile();return null!=c?c:this};EditorUi.prototype.refreshCommentCache=function(c,f){if(this.commentsSupported()){var k=this.getCommentCacheTarget();
-if(null!=k.commentCacheCallbacks)k.commentCacheCallbacks.push([c,f]);else{k.commentCacheCallbacks=[[c,f]];var n=mxUtils.bind(this,function(q,t){var r=k.commentCacheCallbacks;k.commentCacheCallbacks=null;for(var z=0;null!=r&&z<r.length;z++)if(null!=r[z][q])r[z][q](t)});this.getComments(mxUtils.bind(this,function(q){this.getCommentCacheTarget()==k&&(k.commentCache=q,this.fireEvent(new mxEventObject("commentsChanged")));n(0,q)}),mxUtils.bind(this,function(q){n(1,q)}))}}else null!=c&&c(null)};EditorUi.prototype.commentsUpdated=
-function(){if(this.commentsSupported()){var c=this.getCurrentFile();null!=c&&null!=c.sync&&c.sync.sendCommentsChangedMessage();this.refreshCommentCache()}};EditorUi.prototype.getUnresolvedCommentCount=function(){var c=this.getCommentCacheTarget().commentCache,f=0;if(null!=c)for(var k=0;k<c.length;k++)c[k].isResolved||f++;return f};EditorUi.prototype.getCommentAnchorCells=function(c){var f=c.getAnchorCellIds(),k=[];if(null!=f&&0<f.length){c=c.getAnchorPageId();var n=null==c?this.currentPage:this.getPageById(c);
-if(null!=n)if(n==this.currentPage)for(c=0;c<f.length;c++)n=this.editor.graph.model.getCell(f[c]),null!=n&&k.push(n);else{try{this.updatePageRoot(n)}catch(z){return k}if(null!=n.root){var q={},t=0;for(c=0;c<f.length;c++)q[f[c]]||(q[f[c]]=!0,t++);var r=function(z){if(0<t){q[z.getId()]&&(q[z.getId()]=!1,k.push(z),t--);for(var D=0;D<z.getChildCount();D++)r(z.getChildAt(D))}};r(n.root)}}}return k};EditorUi.prototype.gotoCommentAnchor=function(c){var f=c.getAnchorPageId();if(null!=f&&null!=this.currentPage&&
-f!=this.currentPage.getId()){f=this.getPageById(f);if(null==f)return!1;this.selectPage(f)}f=this.editor.graph;var k=c.getAnchorCellIds();if(null!=k&&0<k.length){c=[];for(var n=0;n<k.length;n++){var q=f.model.getCell(k[n]);null!=q&&c.push(q)}return 0<c.length?(f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c,"#0071e3",2E3),f.scrollCellToVisible(c[0]),!0):!1}k=c.getAnchorRect();null!=k&&0<k.w&&0<k.h&&f.fitWindow(new mxRectangle(k.x,k.y,k.w,k.h),0);c=c.getAnchorPoint();if(null!=c){k=f.view.scale;
-n=f.view.translate;f=f.container;f.scrollLeft=Math.round((c.x+n.x)*k-f.clientWidth/2);f.scrollTop=Math.round((c.y+n.y)*k-f.clientHeight/2);var t=document.createElement("div");t.className="geCommentAnchorMarker";t.style.left=Math.round((c.x+n.x)*k)+"px";t.style.top=Math.round((c.y+n.y)*k)+"px";f.appendChild(t);window.setTimeout(function(){null!=t.parentNode&&t.parentNode.removeChild(t)},2E3)}return!0};EditorUi.prototype.addCommentsBadge=function(c){var f=document.createElement("span");f.className=
-"geCommentsBadge";f.style.display="none";c.appendChild(f);c=mxUtils.bind(this,function(){var k=this.getUnresolvedCommentCount();f.style.display=0<k?"":"none";f.innerText="";mxUtils.write(f,99<k?"99+":String(k))});this.addListener("commentsChanged",c);this.editor.addListener("fileLoaded",c);c();return f};EditorUi.prototype.installCommentDragSource=function(c){var f=this,k=document.createElement("div");k.style.width="24px";k.style.height="24px";k.style.backgroundImage="url("+Editor.lightDarkCommentImage+
-")";k.style.backgroundSize="100% 100%";k.style.opacity="0.9";c=mxUtils.makeDraggable(c,function(){return f.editor.graph},function(q,t,r,z,D){null!=f.currentPage&&null!=f.menus&&null!=f.menus.showCommentsWindow&&(q=null!=r?{p:f.currentPage.getId(),c:r.id}:{p:f.currentPage.getId(),pt:{x:Math.round(z),y:Math.round(D)}},f.menus.showCommentsWindow(null,q))},k);var n=c.mouseDown;c.mouseDown=function(q){mxEvent.isMouseEvent(q)&&!mxEvent.isPopupTrigger(q)&&f.commentsSupported()&&f.anchoredCommentsSupported()&&
-f.canComment()&&n.apply(this,arguments)};return c};EditorUi.prototype.updateCommentOverlays=function(){var c=this.editor.graph;if(null!=this.commentOverlays)for(var f=0;f<this.commentOverlays.length;f++)c.removeCellOverlay(this.commentOverlays[f].cell,this.commentOverlays[f].overlay);this.commentOverlays=null;var k=this.getCurrentFile();if(null!=k&&k.anchoredCommentsSupported()&&null!=k.commentCache&&!this.editor.isChromelessView()){var n=null!=this.currentPage?this.currentPage.getId():null,q={};
-for(f=0;f<k.commentCache.length;f++){var t=k.commentCache[f],r=t.getAnchorCellIds();if(!t.isResolved&&null!=r&&t.getAnchorPageId()==n)for(t=0;t<r.length;t++)q[r[t]]=!0}this.commentOverlays=[];for(var z in q)mxUtils.bind(this,function(D){var H=c.model.getCell(D);if(null!=H){var B=new mxCellOverlay(new mxImage(Editor.lightDarkCommentImage,16,16),mxResources.get("comments"),mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,new mxPoint(8,8));B.isCommentOverlay=!0;B.cursor="pointer";B.addListener(mxEvent.CLICK,
-mxUtils.bind(this,function(){null!=this.menus&&null!=this.menus.showCommentsWindow&&this.menus.showCommentsWindow(D)}));c.addCellOverlay(H,B);this.commentOverlays.push({cell:H,overlay:B})}})(z)}};EditorUi.prototype.newComment=function(c,f){var k=this.getCurrentFile();return null!=k?k.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=
-function(c,f){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=
-function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,n,q,t,r,z){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,n,q,t,r,z)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=
-function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,k,n,q,t,r,z,D,H,B,W,I,N,U,S){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,n,q,t,r,z,D,H,B,W,I,N,U,S)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");
-return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,k,n)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=
-function(c,f,k,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,k,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,k,n,q){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,k,n,q)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=
-urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var k=localStorage.key(f),n=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<n.length){var q="<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(q||n)&&c.push(k)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;
-var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
+config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainers=function(){for(var c=this.editor.graph,f=c.getSelectionCells(),k=[],n=0;n<f.length;n++)if(c.model.isVertex(f[n])){var q=c.getCellStyle(f[n]).childLayout;if(null!=q&&"tableLayout"!=q&&"stackLayout"!=q&&"rack"!=q)k.push(f[n]);else return[]}return k};EditorUi.prototype.applyLayoutToSelectedContainers=function(c){var f=
+this.getSelectedLayoutContainers();if(0==f.length)return!1;var k=this.editor.graph.model;k.beginUpdate();try{for(var n=0;n<f.length;n++)this.setContainerChildLayout(f[n],c)}finally{k.endUpdate()}return!0};EditorUi.prototype.setContainerChildLayout=function(c,f){var k=this.editor.graph,n=f,q=null,t=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));n=[];for(var r=0;r<f.length;r++){var z=f[r];if(null!=z&&("mxRadialTreeLayout"==z.layout||
+"mxOrgChartLayout"==z.layout||"mxFastOrganicLayout"==z.layout||"mxCircleLayout"==z.layout))throw Error("Not supported as childLayout: "+z.layout);if(null!=z&&null!=Graph.elkLayoutAlgorithms[z.layout]){var D={},H;for(H in z.config)D[H]=z.config[H];delete D.rootCellIds;delete D.preserveOrigin;null==D.resizeNodes&&(D.resizeNodes=!1);null==D.resizeLayoutRoot&&(D.resizeLayoutRoot=!0);"elkLayered"==z.layout&&(null==D.extractIsolated&&(D.extractIsolated=!1),null==D["elk.layered.considerModelOrder.strategy"]&&
+(D["elk.layered.considerModelOrder.strategy"]=Menus.flowModelOrder));null!=D.corners&&(t=D.corners);if(null!=D.groupPadding&&(q=String(D.groupPadding),/[;=]/.test(q)))throw Error("Invalid groupPadding: "+q);z={layout:z.layout,config:D}}n.push(z)}k.createLayouts(n);n=Graph.encodeChildLayout(n)}if(0<=n.indexOf(";"))throw Error("Invalid childLayout: "+n);k.model.beginUpdate();try{var B=k.model.getStyle(c);k.setCellStyles("childLayout",n,[c]);null!=q&&k.setCellStyles("groupPadding",q,[c]);null!=t&&"undefined"!==
+typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(k,c,t);k.model.getStyle(c)==B&&null!=k.layoutManager&&k.layoutManager.executeLayout(c,!1)}finally{k.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,k){var n=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS},function(){try{var q=n.resolveLayoutList(c);null!=q?(n.lastLayoutSpec=q,k&&Array.isArray(q)&&0<q.length&&n.applyLayoutToSelectedContainers(q)?
+null!=f&&f():n.executeLayouts(n.editor.graph.createLayouts(q),f)):n.handleError(Error("Unknown layout: "+c))}catch(t){n.handleError(t)}},function(){n.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.applyChildLayouts=function(c){var f=this.editor.graph,k=function(){try{f.executeAllChildLayouts()}catch(n){null!=window.console&&console.error(n)}null!=c&&c()};(function(){if("undefined"!==typeof ElkLayout)return!1;for(var n=f.getChildLayoutCells(),q=0;q<n.length;q++)try{for(var t=
+Graph.decodeChildLayout(f.getCellStyle(n[q]).childLayout),r=0;null!=t&&r<t.length;r++)if(null!=t[r]&&"string"===typeof Graph.elkLayoutAlgorithms[t[r].layout])return!0}catch(z){}return!1})()?this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout},k,k):k()};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,k=c.ctrlKey||c.metaKey,
+n=null!=c.key?c.key.toLowerCase():"",q=0;q<f.length;q++){var t=f[q];if(n===String(t.key).toLowerCase()&&k===!!t.ctrl&&c.shiftKey===!!t.shift&&c.altKey===!!t.alt){c.preventDefault();c.stopImmediatePropagation();null!=t.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:t.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",
+34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===
+typeof c.keyCode&&1==c.keyCode.length,k=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(k))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var n=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:c.shift?this.altShiftActions:this.altActions;null!=c.action?n[k]=c.action:delete n[k]}else null!=c.action?(n=mxUtils.bind(this,function(){var q=this.actions.get(c.action);null!=q&&q.isEnabled()&&q.funct.apply(this,arguments)}),
+c.control?c.shift?this.keyHandler.bindControlShiftKey(k,n):this.keyHandler.bindControlKey(k,n):c.shift?this.keyHandler.bindShiftKey(k,n):this.keyHandler.bindKey(k,n)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:this.keyHandler.normalKeys)[k];null!=c.action&&(n=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=k&&57>=k||65<=k&&90>=k?String.fromCharCode(k):EditorUi.keyNames[k],null!=n&&null!=f&&(n.shortcut=(c.control?
+Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,n=!1,q=null,t=null;this.installPassThroughKeys();var r=mxUtils.bind(this,function(H,B){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,
+r);mxEvent.addListener(window,"message",mxUtils.bind(this,function(H){if(H.source==(this.embedMessageSource||window.opener||window.parent)){var B=H.data,W=null,I=null,N=mxUtils.bind(this,function(ma){if(null!=ma&&"function"===typeof ma.charAt&&"<"!=ma.charAt(0))try{Editor.isPngDataUrl(ma)?ma=Editor.extractGraphModelFromPng(ma):"data:image/svg+xml;base64,"==ma.substring(0,26)?ma=atob(ma.substring(26)):"data:image/svg+xml;utf8,"==ma.substring(0,24)&&(ma=ma.substring(24)),null!=ma&&(""==ma.trim()?ma=
+null:"%"==ma.charAt(0)?ma=decodeURIComponent(ma):"<"!=ma.charAt(0)&&(ma=Graph.decompress(ma)))}catch(la){}return ma});if("json"==urlParams.proto){var U=!1;try{B=JSON.parse(B),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[H],"data",[B])}catch(ma){B=null}try{var S=B;if(null==B)return;if("dialog"==B.action){this.showError(null!=B.titleKey?mxResources.get(B.titleKey):B.title,null!=B.messageKey?mxResources.get(B.messageKey):mxUtils.htmlEntities(B.message),null!=B.buttonKey?mxResources.get(B.buttonKey):
+B.button);null!=B.modified&&(this.editor.modified=B.modified);return}if("layout"==B.action){this.executeLayoutSpec(B.layouts,mxUtils.bind(this,function(){var ma=this.createLoadMessage("layout");ma.message=B;z.postMessage(JSON.stringify(ma),"*")}));return}if("prompt"==B.action){this.spinner.stop();var V=new FilenameDialog(this,B.defaultValue||"",null!=B.okKey?mxResources.get(B.okKey):B.ok,function(ma){null!=ma?z.postMessage(JSON.stringify({event:"prompt",value:ma,message:B}),"*"):z.postMessage(JSON.stringify({event:"prompt-cancel",
+message:B}),"*")},null!=B.titleKey?mxResources.get(B.titleKey):B.title,null,null,null,null,function(){z.postMessage(JSON.stringify({event:"prompt-cancel",message:B}),"*")});this.showDialog(V.container,300,80,!0,!1);V.init();return}if("draft"==B.action){var ja=N(B.xml);this.spinner.stop();V=new DraftDialog(this,mxResources.get("draftFound",[B.name||this.defaultFilename]),ja,mxUtils.bind(this,function(){this.hideDialog();z.postMessage(JSON.stringify({event:"draft",result:"edit",message:B}),"*")}),mxUtils.bind(this,
+function(){this.hideDialog();z.postMessage(JSON.stringify({event:"draft",result:"discard",message:B}),"*")}),B.editKey?mxResources.get(B.editKey):null,B.discardKey?mxResources.get(B.discardKey):null,B.ignore?mxUtils.bind(this,function(){this.hideDialog();z.postMessage(JSON.stringify({event:"draft",result:"ignore",message:B}),"*")}):null);this.showDialog(V.container,640,480,!0,!1,mxUtils.bind(this,function(ma){ma&&this.actions.get("exit").funct()}));try{V.init()}catch(ma){z.postMessage(JSON.stringify({event:"draft",
+error:ma.toString(),message:B}),"*")}return}if("template"==B.action){this.spinner.stop();var v=1==B.enableRecent,d=1==B.enableSearch,m=1==B.enableCustomTemp;V=new NewDialog(this,!1,B.templatesOnly?!1:null!=B.callback,mxUtils.bind(this,function(ma,la,Ea,Ga){ma=ma||this.emptyDiagramXml;null!=B.callback?z.postMessage(JSON.stringify({event:"template",xml:ma,blank:ma==this.emptyDiagramXml,name:la,tempUrl:Ea,libs:Ga,builtIn:!0,message:B}),"*"):(c(ma,H,ma!=this.emptyDiagramXml,B.toSketch),this.editor.modified||
+this.clearStatus())}),null,null,null,null,null,null,null,v?mxUtils.bind(this,function(ma){this.remoteInvoke("getRecentDiagrams",[null],null,ma,function(){ma(null,"Network Error!")})}):null,d?mxUtils.bind(this,function(ma,la){this.remoteInvoke("searchDiagrams",[ma,null],null,la,function(){la(null,"Network Error!")})}):null,mxUtils.bind(this,function(ma,la,Ea){z.postMessage(JSON.stringify({event:"template",docUrl:ma,info:la,name:Ea}),"*")}),null,null,m?mxUtils.bind(this,function(ma){this.remoteInvoke("getCustomTemplates",
+null,null,ma,function(){ma({},0)})}):null,1==B.withoutType,null,B.templatesOnly);this.showDialog(V.container,620,460,!0,!1,mxUtils.bind(this,function(ma){null!=this.sidebar&&this.sidebar.hideTooltip();ma&&!B.noExitOnCancel&&this.actions.get("exit").funct()}));V.init();return}if("textContent"==B.action){var x=this.getDiagramTextContent();z.postMessage(JSON.stringify({event:"textContent",data:x,message:B}),"*");return}if("status"==B.action){this.updateStatus(mxUtils.bind(this,function(){null!=B.messageKey?
+this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(B.messageKey))):null!=B.message&&this.editor.setStatus(mxUtils.htmlEntities(B.message))}));null!=B.modified&&(this.editor.modified=B.modified);return}if("spinner"==B.action){var C=null!=B.messageKey?mxResources.get(B.messageKey):B.message;null==B.show||B.show?this.spinner.spin(document.body,C):this.spinner.stop();return}if("exit"==B.action){this.actions.get("exit").funct();return}if("viewport"==B.action){if(null!=B.viewport){var F=this.editor.graph,
+G=F.view.translate.x,K=F.view.translate.y;this.embedViewport=B.viewport;F.refresh();this.diagramContainer.scrollTop-=(K-F.view.translate.y)*F.view.scale;this.diagramContainer.scrollLeft-=(G-F.view.translate.x)*F.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==B.action){var Q=this.actions.get(B.actionName);null!=Q&&Q.funct();return}if("resetEditor"==B.action){F=this.editor.graph;F.isEditing()&&F.stopEditing(!1);this.hideCurrentMenu();F.popupMenuHandler.hideMenu();
+F.clearSelection();return}if("fit"==B.action){F=this.editor.graph;var ba=F.maxFitScale;F.maxFitScale=null!=B.maxScale?B.maxScale:1;F.fit(null!=B.border?B.border:16,null,null,null,null,!0);F.maxFitScale=ba;C=this.createLoadMessage("fit");C.message=B;z.postMessage(JSON.stringify(C),"*");return}if("viewbox"==B.action){var T=EditorUi.parseViewBox(B.viewbox);null!=T&&this.applyViewBox(T);C=this.createLoadMessage("viewbox");C.message=B;z.postMessage(JSON.stringify(C),"*");return}if("fullscreenChanged"==
+B.action){var Z=null;try{var X=this.diagramContainer.getAttribute("data-scrollState");null!=X&&(this.diagramContainer.removeAttribute("data-scrollState"),Z=JSON.parse(X))}catch(ma){}Editor.inlineFullscreen=B.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=Z&&this.restoreScrollState(Z);return}if("snapshot"==B.action){this.sendEmbeddedSvgExport(!0);return}if("export"==B.action){if("png"==B.format||"xmlpng"==B.format){if(null==B.spin&&null==B.spinKey||this.spinner.spin(document.body,
+null!=B.spinKey?mxResources.get(B.spinKey):B.spin)){var da=null!=B.xml?B.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);F=this.editor.graph;var R=mxUtils.bind(this,function(ma,la){if(B.withSvg)B.withSvg=!1,this.getEmbeddedSvg(da,this.editor.graph,null,!0,function(Ga){R(ma,Ga)},null,null,B.embedImages,this.editor.graph.background,B.scale,B.border,B.shadow,"auto",null,B.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ea=this.createLoadMessage("export");Ea.format=
+B.format;Ea.message=S;Ea.data=ma;Ea.svg=la;Ea.xml=da;z.postMessage(JSON.stringify(Ea),"*")}}),Y=mxUtils.bind(this,function(ma){null==ma&&(ma=Editor.blankImage);"xmlpng"==B.format&&(ma=Editor.writeGraphModelToPng(ma,"tEXt","mxfile",encodeURIComponent(da)));F!=this.editor.graph&&F.container.parentNode.removeChild(F.container);R(ma)}),ca=B.pageId||(null!=this.pages?B.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var P=mxUtils.bind(this,function(){if(null!=
+this.pages&&this.currentPage.getId()!=ca){var ma=F.getGlobalVariable;F=this.createTemporaryGraph(F.getStylesheet());for(var la,Ea=0;Ea<this.pages.length;Ea++)if(this.pages[Ea].getId()==ca){la=this.updatePageRoot(this.pages[Ea]);break}null==la&&(la=this.currentPage);F.getGlobalVariable=function(Ma){return"page"==Ma?la.getName():"pagenumber"==Ma?1:ma.apply(this,arguments)};document.body.appendChild(F.container);F.model.setRoot(la.root)}if(null!=B.layerIds){var Ga=F.model,Ja=Ga.getChildCells(Ga.getRoot()),
+Ha=Object.create(null);for(Ea=0;Ea<B.layerIds.length;Ea++)Ha[B.layerIds[Ea]]=!0;for(Ea=0;Ea<Ja.length;Ea++)Ga.setVisible(Ja[Ea],Ha[Ja[Ea].id]||!1)}Ea=null;B.keepTheme&&(Ea=Editor.isDarkMode()?"dark":"light");null==B.width&&0<this.maxCanvasExportArea&&(Ja=F.getGraphBounds(),Ha=null!=B.border?B.border:0,Ga=Math.ceil(Ja.width/F.view.scale)+2*Ha,Ja=Math.ceil(Ja.height/F.view.scale)+2*Ha,Ha=null!=B.scale?B.scale:1,Ga*Ja*Ha*Ha>this.maxCanvasExportArea&&(B.scale=Math.sqrt(this.maxCanvasExportArea/(Ga*Ja))));
+this.editor.exportToCanvas(mxUtils.bind(this,function(Ma){Y(Ma.toDataURL("image/png"))}),B.width,null,B.background,mxUtils.bind(this,function(){Y(null)}),null,null,B.scale,B.transparent,B.shadow,null,F,B.border,null,B.grid,Ea,B.size)});null!=B.xml&&0<B.xml.length&&(k=!0,this.setFileData(da),k=!1);P()}else this.isRemoteExportEnabled()?(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==B.format?"1":"0")+(null!=ca?"&pageId="+ca:"")+(null!=B.layerIds&&0<B.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:B.layerIds})):
+"")+(null!=B.scale?"&scale="+B.scale:"")+"&base64=1&xml="+encodeURIComponent(da))).send(mxUtils.bind(this,function(ma){200<=ma.getStatus()&&299>=ma.getStatus()?R("data:image/png;base64,"+ma.getText()):Y(null)}),mxUtils.bind(this,function(){Y(null)})):Y(null)}}else if(P=mxUtils.bind(this,function(){var ma=this.createLoadMessage("export");ma.message=B;if("html2"==B.format||"html"==B.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var la=this.getXmlFileData();ma.xml=mxUtils.getXml(la);
+ma.data=this.getFileData(null,null,!0,null,null,null,la);ma.format=B.format}else if("html"==B.format)la=this.editor.getGraphXml(),ma.data=this.getHtml(la,this.editor.graph),ma.xml=mxUtils.getXml(la),ma.format=B.format;else{if("xml"==B.format)ma.xml=this.getFileData(!0),ma.format=B.format,z.postMessage(JSON.stringify(ma),"*");else if("json"==B.format)ma.format=B.format,ma.data=this.createJsonForExport(0!=B.allPages,1==B.includeData,1==B.compressed,1==B.selection),z.postMessage(JSON.stringify(ma),"*");
+else{mxSvgCanvas2D.prototype.foAltText=null;var Ea=null!=B.background?B.background:this.editor.graph.background;Ea==mxConstants.NONE&&(Ea=null);ma.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);ma.format="svg";var Ga=mxUtils.bind(this,function(eb){this.editor.graph.setEnabled(!0);this.spinner.stop();ma.data=B.asText?eb:Editor.createSvgDataUri(eb);z.postMessage(JSON.stringify(ma),"*")}),Ja="auto";B.keepTheme&&(Ja=Editor.isDarkMode()?"dark":"light");null!=B.theme&&(Ja=B.theme);
+if("xmlsvg"==B.format){if(null==B.spin&&null==B.spinKey||this.spinner.spin(document.body,null!=B.spinKey?mxResources.get(B.spinKey):B.spin)){Ja=null;if(this.isAutoDarkMode()||Editor.isDarkMode())Ja="auto";null!=B.theme&&(Ja=B.theme);this.getEmbeddedSvg(ma.xml,this.editor.graph,null,!0,Ga,null,null,B.embedImages,Ea,B.scale,B.border,B.shadow,Ja,B.embedCellMetadata,B.embedFonts)}}else if(null==B.spin&&null==B.spinKey||this.spinner.spin(document.body,null!=B.spinKey?mxResources.get(B.spinKey):B.spin)){this.editor.graph.setEnabled(!1);
+var Ha=this.editor.graph.createSvgImageExport(!1,B.embedCellMetadata?!0:!1);la=Object.create(null);var Ma=this.getSvgWithFontLookup(la,Ha,mxUtils.bind(this,function(){return this.editor.graph.getSvg(Ea,B.scale,B.border,null,null,null,null,Ha,null,this.editor.graph.shadowVisible||B.shadow,null,Ja)}));(this.editor.graph.shadowVisible||B.shadow)&&this.editor.graph.addSvgShadow(Ma);this.embedFonts(Ma,mxUtils.bind(this,function(eb){B.embedImages||null==B.embedImages?this.editor.convertImages(eb,mxUtils.bind(this,
+function(bb){Ga(mxUtils.getXml(bb))})):Ga(mxUtils.getXml(eb))}),B.embedFonts,la)}}return}z.postMessage(JSON.stringify(ma),"*")}),null!=B.xml&&0<B.xml.length){if(this.editor.graph.mathEnabled){var aa=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){aa.apply(this,arguments);P()}}k=!0;this.setFileData(B.xml);k=!1;this.editor.graph.mathEnabled||P()}else P();return}if("load"==B.action){U=B.toSketch;n=1==B.autosave;this.embedDiffSync=null!=B.diffSync&&!1!==B.diffSync;this.embedDiffSyncPatchOnly="object"===
+typeof B.diffSync&&null!=B.diffSync&&1==B.diffSync.patchOnly;this.embedExportProtocol=1==B.exportProtocol;var ea=B.sourceMetadata||null;I=null!=B.layout?B.layout:null;this.hideDialog();null!=B.modified&&null==urlParams.modified&&(urlParams.modified=B.modified);null!=B.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=B.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,
+!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=B.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=B.noSaveBtn);if(null!=B.rough){var oa=Editor.sketchMode;this.doSetSketchMode(B.rough);oa!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=B.dark&&this.setDarkMode(B.dark);null!=B.border&&(this.embedExportBorder=B.border);null!=B.theme&&(this.embedExportTheme=
+B.theme);null!=B.background&&(this.embedExportBackground=B.background);null!=B.viewport&&(this.embedViewport=B.viewport);this.embedExitPoint=null;var sa=EditorUi.parseViewBox(B.viewbox);null==sa&&null==B.viewbox&&null==B.scale&&null==B.fit&&(sa=EditorUi.getViewBoxParam());if(null!=sa)W=mxUtils.bind(this,function(){this.applyViewBox(sa)});else if(null!=B.scale){var ta=B.scale,na=null!=B.scaleBorder?B.scaleBorder:this.embedExportBorder||0,wa=null!=B.border?B.border:0;W=mxUtils.bind(this,function(){var ma=
+this.editor.graph,la=ma.getGraphBounds();if(0<la.width&&0<la.height){var Ea=ma.view.scale;ma.view.scaleAndTranslate(ta,ma.view.translate.x+wa-la.x/Ea+na/ta,ma.view.translate.y+wa-la.y/Ea+na/ta)}})}else if(null!=B.fit){var ya=null!=B.border?B.border:0,Aa=B.maxFitScale||1;W=mxUtils.bind(this,function(){var ma=this.editor.graph,la=ma.maxFitScale;ma.maxFitScale=Aa;ma.fit(ya,null,null,null,null,!0);ma.maxFitScale=la})}if(null!=B.scroll&&null!=B.scroll.x&&null!=B.scroll.y){var Da=B.scroll,ua=W;W=mxUtils.bind(this,
+function(){null!=ua&&ua();var ma=this.editor.graph,la=ma.view.scale,Ea=ma.view.translate;mxUtils.hasScrollbars(ma.container)?(ma.container.scrollLeft=(Ea.x+Da.x)*la,ma.container.scrollTop=(Ea.y+Da.y)*la):ma.view.setTranslate(-Da.x,-Da.y)})}if(null!=B.rect){wa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,B.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,B.rect.top)+"px";this.minInlineWidth=B.minWidth;this.minInlineHeight=B.minHeight;this.diagramContainer.style.border=
+"2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var qa=B.maxFitScale,ha=B.rect.width+2*wa,ia=B.rect.height+2*wa;W=mxUtils.bind(this,function(){var ma=mxUtils.getDocumentSize();ha=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ha):ha,ma.width-80);ma=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ia):ia,ma.height-80);this.diagramContainer.style.width=ha+"px";this.diagramContainer.style.height=ma+"px";var la=this.editor.graph;
+ma=la.maxFitScale;la.maxFitScale=qa;la.fit(2*wa,null,null,null,null,null,ia);this.setPageVisible("1"==urlParams.pv);if(null!=this.minInlineWidth&&la.getGraphBounds().width<this.minInlineWidth){var Ea=la.container.scrollTop;this.resetScrollbars();la.container.scrollTop=Ea}la.maxFitScale=ma;la.container.scrollTop-=wa;la.container.scrollLeft-=wa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[B]));la.container.focus();null!=this.formatWindow&&
+null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=la.container.style.top);var Ga=la.getGraphBounds();la.container.clientWidth>Ga.width+2*wa&&(la.container.scrollLeft=Ga.x+(Ga.width+wa-la.container.clientWidth)/2)}),10)})}null!=B.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=B.noExitBtn);null!=B.title&&null!=this.buttonContainer&&this.setEmbedTitle(B.title);try{B.libs&&this.sidebar.showEntries(B.libs)}catch(ma){}if(null!=B.xmlpng)B=
+this.extractGraphModelFromPng(B.xmlpng);else if(null!=B.descriptor){if(B=B.descriptor,"mermaid"==B.format){if(EditorUi.isMermaidSupported()){var pa=mxUtils.bind(this,function(ma){c(ma,H,null,U);ma=this.createLoadMessage("load");ma.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);ma.message=S;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ma),"*");if(null!=ea&&null!=ea.key&&null!=ea.value){ma=this.editor.graph;var la=ma.getModel().getRoot();if(null!=
+la){ma.getModel().beginUpdate();try{ma.setAttributeForCell(la,ea.key,ea.value)}finally{ma.getModel().endUpdate()}}}}),za=mxUtils.bind(this,function(ma){this.handleError(ma)});B.image?this.parseMermaidImage(B.data,pa,za):this.parseMermaidDiagram(B.data,null,mxUtils.bind(this,function(ma){B.wrap&&(ma=mxMermaidToDrawio.wrapGroup(ma,B.data,EditorUi.getInsertMermaidConfig(),{normalize:!0}));pa(ma)}),za)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));
+return}}else B=B.xml}else{if("merge"==B.action){var fa=this.getCurrentFile();null!=fa&&(ja=N(B.xml),null!=ja&&""!=ja&&fa.mergeFile(new LocalFile(this,ja),mxUtils.bind(this,function(){this.embedDiffSync&&(t=this.clonePages(this.pages),q=xa());z.postMessage(JSON.stringify({event:"merge",message:B}),"*")}),function(ma){z.postMessage(JSON.stringify({event:"merge",message:B,error:ma}),"*")}))}else if("patch"==B.action){if(fa=this.getCurrentFile(),null!=fa&&null!=B.patch)try{k=!0,fa.patch([B.patch]),this.embedDiffSync&&
+null!=t&&(t=this.applyPatches(t,[B.patch])),q=xa(),k=!1,X={event:"patch",message:B},Z=this.getHashValueForPages(this.pages),X.checksum=Z,null!=B.checksum&&B.checksum!=Z&&(X.checksumMismatch=!0),z.postMessage(JSON.stringify(X),"*")}catch(ma){k=!1,z.postMessage(JSON.stringify({event:"patch",message:B,error:ma.message||ma.toString()}),"*")}}else if("getDiff"==B.action){C={event:"getDiff",message:B};if(this.embedDiffSync&&null!=t){var ka=this.clonePages(this.pages);C.patch=this.diffPages(t,ka);C.checksum=
+this.getHashValueForPages(ka)}else C.xml=xa();z.postMessage(JSON.stringify(C),"*")}else"resetDiff"==B.action?this.embedDiffSync&&(null!=B.xml?(ja=N(B.xml),fa=this.getCurrentFile(),null!=ja&&""!=ja&&null!=fa&&fa.mergeFile(new LocalFile(this,ja),mxUtils.bind(this,function(){t=this.clonePages(this.pages);q=xa();z.postMessage(JSON.stringify({event:"resetDiff",message:B,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ma){z.postMessage(JSON.stringify({event:"resetDiff",message:B,error:ma}),
+"*")})):(t=this.clonePages(this.pages),q=xa(),z.postMessage(JSON.stringify({event:"resetDiff",message:B,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==B.action?this.handleRemoteInvokeReady(z):"remoteInvoke"==B.action?this.handleRemoteInvoke(B,H.origin):"remoteInvokeResponse"==B.action?this.handleRemoteInvokeResponse(B):z.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(B)}),"*");return}}catch(ma){this.handleError(ma)}}var xa=mxUtils.bind(this,function(){return"0"!=
+urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Ba=mxUtils.bind(this,function(ma,la){k=!0;try{c(ma,la,null,U)}catch(Ea){this.handleError(Ea)}k=!1;this.editor.graph.model.prefix=Editor.guid()+"-";la=mxUtils.bind(this,function(){null!=urlParams.modified&&this.clearStatus();q=xa();this.embedDiffSync&&(t=this.clonePages(this.pages));n&&null==f&&(f=mxUtils.bind(this,function(Ga,Ja){Ga=xa();if(Ga!=q&&!k){Ja=this.createLoadMessage("autosave");
+Ja.message=S;if(this.embedDiffSync&&null!=t){var Ha=this.clonePages(this.pages),Ma=this.diffPages(t,Ha);mxUtils.isEmptyObject(Ma)?Ja.xml=Ga:(Ja.patch=Ma,Ja.checksum=this.getHashValueForPages(Ha),this.embedDiffSyncPatchOnly||(Ja.xml=Ga));t=Ha}else Ja.xml=Ga;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Ja),"*")}q=Ga}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",
+f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("tooltipsEnabledChanged",f),this.addListener("pageViewChanged",f),this.addListener("connectionPointsChanged",f),this.addListener("connectionArrowsChanged",
+f));null!=W&&W();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var Ea=this.createLoadMessage("load");Ea.xml=null!=I?xa():ma;this.embedDiffSync&&null!=this.pages&&(Ea.checksum=this.getHashValueForPages(this.pages));z.postMessage(JSON.stringify(Ea),"*")}});null!=I?this.executeLayoutSpec(I,la):la()});null!=B&&"function"===typeof B.substring&&"data:application/vnd.visio;base64,"==B.substring(0,34)?(N="0M8R4KGxGuE"==B.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(B.substring(B.indexOf(",")+
+1)),function(ma){Ba(ma,H)},mxUtils.bind(this,function(ma){this.handleError(ma)}),N)):null!=B&&"function"===typeof B.substring&&this.isGliffyData(B,"")?this.importGliffy(B,mxUtils.bind(this,function(ma){"<mxGraphModel"==ma.substring(0,13)?Ba(ma,H):this.handleError({message:mxResources.get("unknownError")})}),mxUtils.bind(this,function(ma){this.handleError({message:null!=ma&&413==ma.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")})}),""):null!=B&&"function"===typeof B.substring&&
+this.isLucidChartData(B)?this.convertLucidChart(B,mxUtils.bind(this,function(ma){Ba(ma)}),mxUtils.bind(this,function(ma){this.handleError(ma)})):null==B||"object"!==typeof B||null==B.format||null==B.data&&null==B.url?(B=N(B),Ba(B,H)):this.loadDescriptor(B,mxUtils.bind(this,function(ma){Ba(xa(),H)}),mxUtils.bind(this,function(ma){this.handleError(ma,mxResources.get("errorLoadingFile"))}))}}));var z=this.embedMessageSource||window.opener||window.parent;r="json"==urlParams.proto?JSON.stringify({event:"init"}):
+urlParams.ready||"ready";z.postMessage(r,"*");if("json"==urlParams.proto){var D=this.editor.graph.openLink;this.editor.graph.openLink=function(H,B,W){D.apply(this,arguments);z.postMessage(JSON.stringify({event:"openLink",href:H,target:B,allowOpener:W}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(H){for(var B=mxEvent.getSource(H);null!=B&&"A"!=B.nodeName;)B=B.parentNode;if(null!=B){var W=B.getAttribute("href");null==W||"#"==W.charAt(0)||"javascript:"==
+W.substring(0,11)||this.editor.graph.isCustomLink(W)||(H.preventDefault(),this.editor.graph.openLink(W,B.getAttribute("target")))}}),!0)}};EditorUi.prototype.createEmbedButton=function(c,f,k,n){var q=document.createElement("button");q.className="geEmbedBtn geBtn";q.setAttribute("title",c+(null!=k?" ("+k+")":""));mxUtils.write(q,c);n&&q.classList.add("gePrimaryBtn");mxEvent.addListener(q,"click",f);return q};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&
+this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);
+this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),
+"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=
+function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,
+mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var n=JSON.parse(k);Array.isArray(n)&&0<n.length&&this.applyLayoutToSelectedContainers(n)||this.executeLayouts(this.editor.graph.createLayouts(n));this.lastLayoutSpec=this.customLayoutConfig=n;this.hideDialog()}catch(q){this.handleError(q)}}),null,null,null,null,mxUtils.bind(this,function(k,n){var q=this.createLayoutAddSelect(n);k.appendChild(q);q=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var t=
+n.value;n.value=JSON.stringify(JSON.parse(t));n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));n.value=t}catch(r){this.handleError(r)}}));q.setAttribute("title","copy");q.className="geBtn";k.appendChild(q)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};
+EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var k={},n=0;n<f.length;n++)null!=f[n]&&(k[f[n].id]=!0);var q=function(t){return null!=t&&!0===k[t.id]};for(n=0;n<c.length;n++)f=c[n],"undefined"!==typeof ElkLayout&&f instanceof ElkLayout||void 0!==f.cellFilter?f.cellFilter=q:"function"===typeof f.isVertexIgnored&&function(t){var r=t.isVertexIgnored;t.isVertexIgnored=function(z){return r.apply(this,
+arguments)||!q(z)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,k=document.createElement("select");k.className="geBtn";k.style.marginRight="8px";k.style.maxWidth="180px";var n=document.createElement("option");n.value="";mxUtils.write(n,mxResources.get("add")+"...");n.disabled=!0;n.selected=!0;k.appendChild(n);var q=[];"undefined"!==typeof ElkLayout&&(n=function(r,z){var D=ElkLayout.MENU_PRESETS[r];return{label:r,kind:"elk",algo:D.algorithm,preset:D.options,layoutName:z}},q.push(n("verticalFlow",
+"elkLayered")),q.push(n("horizontalFlow","elkLayered")),q.push(n("verticalTree","elkTree")),q.push(n("horizontalTree","elkTree")),q.push(n("radialTree","elkRadial")),q.push(n("organic","elkOrganic")));q.push({label:"orgChart",kind:"orgchart"});q.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});q.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&q.push({label:"orthogonalRouting",
+kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(n=0;n<q.length;n++){var t=document.createElement("option");t.value=String(n);mxUtils.write(t,mxResources.get(q[n].label)+("elk"===q[n].kind||"orgchart"===q[n].kind?"...":""));k.appendChild(t)}mxEvent.addListener(k,"change",mxUtils.bind(this,function(){var r=parseInt(k.value);k.selectedIndex=0;if(!(isNaN(r)||0>r||r>=q.length)){var z=q[r],D=c.value;if(0===mxUtils.trim(D).length)var H=[];else{try{H=JSON.parse(D)}catch(W){f.handleError(W);
+return}if(!Array.isArray(H)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var B=mxUtils.bind(this,function(W){H.push(W);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(H,null,2))});r=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(D)});"elk"===z.kind?(f.hideDialog(),ElkLayout.runWithDialog(f,z.algo,z.preset,mxResources.get(z.label),function(W,I){W=Graph.elkOptionsToConfig(W,I);B({layout:z.layoutName,config:W})},r)):"orgchart"===z.kind?
+(f.hideDialog(),f.showOrgChartConfigDialog(B,r)):B({layout:z.layoutName,config:z.config||{}})}}));return k};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var k=2,n=20,q=20,t=document.createElement("div"),r=function(N,U){var S=document.createElement("div");S.style.marginTop="6px";S.style.display="inline-block";S.style.width="180px";mxUtils.write(S,mxResources.get(N)+": ");t.appendChild(S);t.appendChild(U)},z=document.createElement("select");z.style.width="160px";z.style.boxSizing="border-box";
+for(var D=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],H=0;H<D.length;H++){var B=document.createElement("option");mxUtils.write(B,D[H]);B.value=H;2===H&&B.setAttribute("selected","selected");z.appendChild(B)}mxEvent.addListener(z,"change",function(){k=parseInt(z.value)});r("orgChartType",z);var W=document.createElement("input");
+W.type="number";W.value=n;W.style.width="160px";W.style.boxSizing="border-box";mxEvent.addListener(W,"change",function(){n=parseInt(W.value)});r("parentChildSpacing",W);var I=document.createElement("input");I.type="number";I.value=q;I.style.width="160px";I.style.boxSizing="border-box";mxEvent.addListener(I,"change",function(){q=parseInt(I.value)});r("siblingSpacing",I);f=new CustomDialog(this,t,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:k,parentChildSpacing:n,siblingSpacing:q}})},
+f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(k){var n=mxUtils.bind(this,function(){this.loadingOrgChart=!1;k.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),q=mxUtils.bind(this,function(t){this.loadingOrgChart=!1;k.clear()&&this.handleError(t)});if("undefined"!==typeof mxOrgChartLayout||
+this.loadingOrgChart||this.isOffline(!0))n();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",n,null,null,null,q)},null,null,null,q)},null,null,null,q)},null,null,null,q):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",n,
+null,null,null,q)}),onerror)};EditorUi.prototype.importCsv=function(c,f,k,n){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}),n)};EditorUi.prototype.doImportCsv=function(c,f,k){try{var n=c.split("\n"),q=[],t=[],r=[],z=Object.create(null);if(0<n.length){var D=Object.create(null);k=null!=k?k:this.editor.graph;var H=null,B=null,W=null,I=null,N=null,U=null,S=null,V="whiteSpace=wrap;html=1;",ja=null,v=null,d="",m="auto",x="auto",C=!1,F=null,G=null,K=40,Q=40,ba=100,T=0,Z=
+mxUtils.bind(this,function(){null!=f?f(Ea):(k.setSelectionCells(Ea),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),X=k.getFreeInsertPoint(!0),da=X.x,R=X.y;X=R;var Y=null,ca="auto";v=null;for(var P=[],aa=null,ea=null,oa=0;oa<n.length&&"#"==n[oa].charAt(0);){c=n[oa].replace(/\r$/,"");for(oa++;oa<n.length&&"\\"==c.charAt(c.length-1)&&"#"==n[oa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(n[oa].substring(1)),
+oa++;if("#"!=c.charAt(1)){var sa=c.indexOf(":");if(0<sa){var ta=mxUtils.trim(c.substring(1,sa)),na=mxUtils.trim(c.substring(sa+1));"label"==ta?Y=Graph.sanitizeHtml(na):"labelname"==ta&&0<na.length&&"-"!=na?N=na:"labels"==ta&&0<na.length&&"-"!=na?S=JSON.parse(na):"style"==ta?B=na:"parentstyle"==ta?V=na:"unknownStyle"==ta&&"-"!=na?U=na:"stylename"==ta&&0<na.length&&"-"!=na?I=na:"styles"==ta&&0<na.length&&"-"!=na?W=JSON.parse(na):"vars"==ta&&0<na.length&&"-"!=na?H=JSON.parse(na):"identity"==ta&&0<na.length&&
+"-"!=na?ja=na:"parent"==ta&&0<na.length&&"-"!=na?v=na:"namespace"==ta&&0<na.length&&"-"!=na?d=na:"width"==ta?m=na:"height"==ta?x=na:"collapsed"==ta&&"-"!=na?C="true"==na:"left"==ta&&0<na.length?F=na:"top"==ta&&0<na.length?G=na:"ignore"==ta?ea=na.split(","):"connect"==ta?P.push(JSON.parse(na)):"link"==ta?aa=na:"padding"==ta?T=parseFloat(na):"edgespacing"==ta?K=parseFloat(na):"nodespacing"==ta?Q=parseFloat(na):"levelspacing"==ta?ba=parseFloat(na):"layout"==ta&&(ca=na)}}}if(null==n[oa])throw Error(mxResources.get("invalidOrMissingFile"));
+var wa=this.editor.csvToArray(n[oa].replace(/\r$/,""));sa=c=null;ta=[];for(na=0;na<wa.length;na++)ja==wa[na]&&(c=na),v==wa[na]&&(sa=na),ta.push(mxUtils.trim(wa[na]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Y&&(Y="%"+ta[0]+"%");if(null!=P)for(var ya=0;ya<P.length;ya++)null==D[P[ya].to]&&(D[P[ya].to]=Object.create(null));ja=[];for(na=oa+1;na<n.length;na++){var Aa=this.editor.csvToArray(n[na].replace(/\r$/,""));if(null==Aa){var Da=40<n[na].length?n[na].substring(0,40)+
+"...":n[na];throw Error(Da+" ("+na+"):\n"+mxResources.get("containsValidationErrors"));}0<Aa.length&&ja.push(Aa)}k.model.beginUpdate();try{for(na=0;na<ja.length;na++){Aa=ja[na];var ua=null,qa=null!=c?d+Aa[c]:null;n=!1;null!=qa&&(ua=k.model.getCell(qa),n=null==ua||0<=mxUtils.indexOf(q,ua));var ha=new mxCell(Y,new mxGeometry(da,X,0,0),B||"whiteSpace=wrap;html=1;");ha.collapsed=C;ha.vertex=!0;ha.id=qa;null==ua||n||k.model.setCollapsed(ua,C);for(var ia=0;ia<Aa.length;ia++)k.setAttributeForCell(ha,ta[ia],
+Aa[ia]),null==ua||n||k.setAttributeForCell(ua,ta[ia],Aa[ia]);if(null!=N&&null!=S){var pa=ha.getAttribute(N),za=null!=pa&&Object.prototype.hasOwnProperty.call(S,pa)?S[pa]:null;null!=za&&(k.labelChanged(ha,za),null==ua||n||k.cellLabelChanged(ua,za))}if(null!=I&&null!=W){var fa=ha.getAttribute(I),ka=null!=fa&&Object.prototype.hasOwnProperty.call(W,fa)?W[fa]:null;null!=ka&&(ha.style=ka)}k.setAttributeForCell(ha,"placeholders","1");ha.style=k.replacePlaceholders(ha,ha.style,H);null==ua||n?k.fireEvent(new mxEventObject("cellsInserted",
+"cells",[ha])):(k.model.setStyle(ua,ha.style),0>mxUtils.indexOf(r,ua)&&r.push(ua),k.fireEvent(new mxEventObject("cellsInserted","cells",[ua])));n=null!=ua;ua=ha;if(!n)for(ya=0;ya<P.length;ya++)D[P[ya].to][ua.getAttribute(P[ya].to)]=ua;null!=aa&&"link"!=aa&&(k.setLinkForCell(ua,ua.getAttribute(aa)),k.setAttributeForCell(ua,aa,null));var xa=k.getPreferredSizeForCell(ua);v=null!=sa?k.model.getCell(d+Aa[sa]):null;if(ua.vertex){Da=null!=v?0:da;oa=null!=v?0:R;null!=F&&null!=ua.getAttribute(F)&&(ua.geometry.x=
+Da+parseFloat(ua.getAttribute(F)));null!=G&&null!=ua.getAttribute(G)&&(ua.geometry.y=oa+parseFloat(ua.getAttribute(G)));var Ba="@"==m.charAt(0)?ua.getAttribute(m.substring(1)):null;ua.geometry.width=null!=Ba&&"auto"!=Ba?parseFloat(ua.getAttribute(m.substring(1))):"auto"==m||"auto"==Ba?xa.width+T:parseFloat(m);var ma="@"==x.charAt(0)?ua.getAttribute(x.substring(1)):null;ua.geometry.height=null!=ma&&"auto"!=ma&&"width"!=x?parseFloat(ma):"auto"==x||"auto"==ma?xa.height+T:"width"==x?ua.geometry.width:
+parseFloat(x);X+=ua.geometry.height+Q}n?(null==z[qa]&&(z[qa]=[]),z[qa].push(ua)):(q.push(ua),null!=v?(v.style=k.replacePlaceholders(v,V,H),k.addCell(ua,v),t.push(v)):r.push(k.addCell(ua)))}for(na=0;na<t.length;na++)Ba="@"==m.charAt(0)?t[na].getAttribute(m.substring(1)):null,ma="@"==x.charAt(0)?t[na].getAttribute(x.substring(1)):null,"auto"!=m&&"auto"!=Ba||"auto"!=x&&"auto"!=ma||k.updateGroupBounds([t[na]],T,!0);var la=r.slice(),Ea=r.slice();for(ya=0;ya<P.length;ya++){var Ga=P[ya];for(na=0;na<q.length;na++){ua=
+q[na];var Ja=mxUtils.bind(this,function(fb,ib,Wa){var db=ib.getAttribute(Wa.from);if(null!=db&&""!=db){db=db.split(",");for(var Hb=0;Hb<db.length;Hb++){var ub=D[Wa.to][db[Hb]];if(null==ub&&null!=U){ub=new mxCell(db[Hb],new mxGeometry(da,R,0,0),U);ub.style=k.replacePlaceholders(ib,ub.style,H);var xb=k.getPreferredSizeForCell(ub);ub.geometry.width=xb.width+T;ub.geometry.height=xb.height+T;D[Wa.to][db[Hb]]=ub;ub.vertex=!0;ub.id=db[Hb];r.push(k.addCell(ub))}if(null!=ub){xb=Wa.label;null!=Wa.fromlabel&&
+(xb=(ib.getAttribute(Wa.fromlabel)||"")+(xb||""));null!=Wa.sourcelabel&&(xb=k.replacePlaceholders(ib,Wa.sourcelabel,H)+(xb||""));null!=Wa.tolabel&&(xb=(xb||"")+(ub.getAttribute(Wa.tolabel)||""));null!=Wa.targetlabel&&(xb=(xb||"")+k.replacePlaceholders(ub,Wa.targetlabel,H));var Bb="target"==Wa.placeholders==!Wa.invert?ub:fb;Bb=null!=Wa.style?k.replacePlaceholders(Bb,Wa.style,H):k.createCurrentEdgeStyle();xb=k.insertEdge(null,null,xb||"",Wa.invert?ub:fb,Wa.invert?fb:ub,Bb);if(null!=Wa.labels)for(Bb=
+0;Bb<Wa.labels.length;Bb++){var lb=Wa.labels[Bb],Gb=new mxCell(lb.label||Bb,new mxGeometry(null!=lb.x?lb.x:0,null!=lb.y?lb.y:0,0,0),"resizable=0;html=1;");Gb.vertex=!0;Gb.connectable=!1;Gb.geometry.relative=!0;null!=lb.placeholders&&(Gb.value=k.replacePlaceholders("target"==lb.placeholders==!Wa.invert?ub:fb,Gb.value,H));if(null!=lb.dx||null!=lb.dy)Gb.geometry.offset=new mxPoint(null!=lb.dx?lb.dx:0,null!=lb.dy?lb.dy:0);xb.insert(Gb)}if(null!=Wa.data)for(var Mb in Wa.data)k.setAttributeForCell(xb,Mb,
+Wa.data[Mb]);Ea.push(xb);mxUtils.remove(Wa.invert?fb:ub,la)}}}});Ja(ua,ua,Ga);if(null!=z[ua.id])for(ia=0;ia<z[ua.id].length;ia++)Ja(ua,z[ua.id][ia],Ga)}}if(null!=ea)for(na=0;na<q.length;na++)for(ua=q[na],ia=0;ia<ea.length;ia++)k.setAttributeForCell(ua,mxUtils.trim(ea[ia]),null);if(0<r.length){var Ha=new mxParallelEdgeLayout(k);Ha.spacing=K;Ha.checkOverlap=!0;var Ma=function(){0<Ha.spacing&&Ha.execute(k.getDefaultParent());var fb=0,ib=0;0<r.length&&(ib=k.getCellGeometry(r[0]),fb=Math.round(k.snap(ib.x))-
+ib.x,ib=Math.round(k.snap(ib.y))-ib.y);for(var Wa=0;Wa<r.length;Wa++){var db=k.getCellGeometry(r[Wa]);db.x=Math.round(db.x+fb);db.y=Math.round(db.y+ib);"auto"==m&&(db.width=Math.round(k.snap(db.width)));"auto"==x&&(db.height=Math.round(k.snap(db.height)))}};"auto"==ca&&1==la.length&&(ca=Ea.length==2*r.length-1?"verticaltree":"verticalflow");var eb="organic"==ca||null!=EditorUi.CSV_ELK_LAYOUTS[ca]?null:this.resolveLayoutList(ca);if(null!=eb){var bb=Z;k.view.validate();var tb=k.createLayouts(eb);this.scopeLayoutsToCells(tb,
+Ea);this.executeLayouts(tb,function(){Ma();bb()});Z=null}else if("circle"==ca){var Db=new mxCircleLayout(k);Db.disableEdgeStyle=!1;Db.resetEdges=!1;var cb=Db.isVertexIgnored;Db.isVertexIgnored=function(fb){return cb.apply(this,arguments)||0>mxUtils.indexOf(r,fb)};this.executeLayout(function(){Db.execute(k.getDefaultParent());Ma()},!0,Z);Z=null}else if("verticaltree"==ca||"horizontaltree"==ca){k.view.validate();var gb=new mxCompactTreeLayout(k,"horizontaltree"==ca);gb.levelDistance=Q;gb.edgeRouting=
+!1;gb.resetEdges=!1;gb.sortEdges=!0;var wb=gb.isVertexIgnored;gb.isVertexIgnored=function(fb){return wb.apply(this,arguments)||0>mxUtils.indexOf(r,fb)};this.executeLayout(function(){gb.execute(k.getDefaultParent(),0<la.length?la[0]:null)},!0,Z);Z=null}else if("orgchart"==ca){k.view.validate();var Sa=new mxOrgChartLayout(k,2,ba,Q),Xa=Sa.isVertexIgnored;Sa.isVertexIgnored=function(fb){return Xa.apply(this,arguments)||0>mxUtils.indexOf(r,fb)};this.executeLayout(function(){Sa.execute(k.getDefaultParent());
+Ma()},!0,Z);Z=null}else if("organic"==ca||"auto"==ca&&Ea.length>r.length){k.view.validate();var vb=new mxFastOrganicLayout(k);vb.forceConstant=3*Q;vb.disableEdgeStyle=!1;vb.resetEdges=!1;var pb=vb.isVertexIgnored;vb.isVertexIgnored=function(fb){return pb.apply(this,arguments)||0>mxUtils.indexOf(r,fb)};this.executeLayout(function(){vb.execute(k.getDefaultParent());Ma()},!0,Z);Z=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[ca]){k.view.validate();bb=Z;var jb=EditorUi.CSV_ELK_LAYOUTS[ca],qb=mxUtils.clone(jb.config);
+qb["elk.spacing.nodeNode"]=Q;qb["elk.layered.spacing.nodeNodeBetweenLayers"]=ba;qb["elk.spacing.edgeEdge"]=K;qb["elk.layered.spacing.edgeEdgeBetweenLayers"]=K;var Za=k.createLayouts([{layout:jb.layout,config:qb}]);this.scopeLayoutsToCells(Za,Ea);k.model.beginUpdate();var Jb=!1,Ab=function(){Jb||(Jb=!0,k.model.endUpdate())},yb=this;try{Za[0].prepare(k.getDefaultParent(),function(fb,ib){null!=fb?(Ab(),yb.handleError(fb)):yb.executeLayout(function(){ib();var Wa=k.getBoundingBoxFromGeometry(Ea);null!=
+Wa&&k.moveCells(Ea,da-Wa.x,R-Wa.y)},!0,function(){Ab();bb()})})}catch(fb){throw Ab(),fb;}Z=null}}this.hideDialog()}finally{k.model.endUpdate()}null!=Z&&Z()}}catch(fb){this.handleError(fb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(f+=k+n+"="+urlParams[n],k="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=
+function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),n;for(n in urlParams)0>mxUtils.indexOf(k,n)&&(c=0==f?c+"?":c+"&",null!=urlParams[n]&&(c+=n+"="+urlParams[n],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,k,n,q){c=new LinkDialog(this,c,f,k,!0,n,q);this.showDialog(c.container,440,null,!0,!0);c.init()};
+EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=
+c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var k=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(k);
+Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(k),this.menus.get("newLibrary").setEnabled(k));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(c);
+this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};
+EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var L=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){L.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),k=this.getSelectionState(),n=this.isDiagramActive(),q="1"==urlParams.embed&&this.editor.graph.isEnabled()||
+null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&q);this.actions.get("redo").setEnabled(this.canRedo()&&q);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(n&&(1==k.edges.length||1==k.vertices.length));this.actions.get("editConnectionPoints").setEnabled(n&&0==k.edges.length&&1==k.vertices.length);this.actions.get("editPolygon").setEnabled(n&&
+1==k.vertices.length&&"mxgraph.basic.polygon"==k.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(n&&k.image&&0<k.cells.length);this.actions.get("crop").setEnabled(n&&k.image&&0<k.cells.length);this.actions.get("pageSetup").setEnabled(n);this.actions.get("shadowVisible").setEnabled(n);this.actions.get("connectionArrows").setEnabled(n);this.actions.get("connectionPoints").setEnabled(n);this.actions.get("copyStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=
+this.copiedStyle&&n&&0<k.cells.length);this.actions.get("copyTextStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&n&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length&&!k.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<k.cells.length);this.actions.get("createShape").setEnabled(n);this.actions.get("createRevision").setEnabled(n);this.actions.get("moveToFolder").setEnabled(null!=
+f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=
+this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(n&&
+null!=c&&null!=c.shape&&null!=c.shape.stencil)};var O=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);O.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,n,q,t,r,z){var D=c.editor.graph;if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");
+else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(D.getSvg(n,q,t)),"image/svg+xml");else{var H=c.getFileData(!0,null,null,null,null,!0),B=D.getGraphBounds(),W=Math.floor(B.width*q/D.view.scale),I=Math.floor(B.height*q/D.view.scale);if(H.length<=MAX_REQUEST_SIZE&&W*I<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas())if(c.isRemoteExportEnabled()){var N={globalVars:D.getExportVariables()};z&&(N.grid={size:D.gridSize,steps:D.view.gridSteps,color:D.view.gridColor});
+c.saveRequest(f,k,function(U,S){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(S||"0")+(null!=U?"&filename="+encodeURIComponent(U):"")+"&extras="+encodeURIComponent(JSON.stringify(N))+(0<r?"&dpi="+r:"")+"&bg="+(null!=n?n:"none")+"&w="+W+"&h="+I+"&border="+t+"&xml="+encodeURIComponent(H))})}else c.handleError({message:mxResources.get("notAvailable")});else"png"==k?c.exportImage(q,null==n||"none"==n,!0,!1,!1,t,!0,!1,null,z,r):c.exportImage(q,!1,!0,!1,!1,t,!0,!1,"jpeg",z);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});
+EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var n=c;this.currentPage!=this.pages[k]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),n.model.setRoot(this.pages[k].root));f+=this.pages[k].getName()+" "+n.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,
+f,k){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){k.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));k.html=f;return}k.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var k={id:c.getId()};k.type=f?"layer":c.edge?"edge":c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(k.parent=f.getId()));c.edge&&(null!=c.source&&(k.source=c.source.getId()),null!=c.target&&
+(k.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),k);c=f.attributes;f={};for(var n=0,q=0;q<c.length;q++){var t=c[q].nodeName;"label"!=t&&"placeholders"!=t&&"id"!=t&&(f[t]=c[q].nodeValue,n++)}0<n&&(k.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,k);return k};EditorUi.prototype.getJsonForPage=function(c,f){var k=this.editor.graph.getModel();var n=null==c||c==this.currentPage?k.getRoot():this.updatePageRoot(c).root;var q=
+[],t=mxUtils.bind(this,function(B,W){q.push(this.getJsonForExportCell(B,W));W=B.getChildCount();for(var I=0;I<W;I++)t(B.getChildAt(I),!1)});if(null!=f){n={};for(var r=0;r<f.length;r++)n[f[r].getId()]=!0;for(r=0;r<f.length;r++){for(var z=f[r],D=z.getParent(),H=!1;null!=D;){if(n[D.getId()]){H=!0;break}D=D.getParent()}H||t(z,k.isLayer(z))}}else for(f=n.getChildCount(),r=0;r<f;r++)t(n.getChildAt(r),!0);r={};null!=c&&(r.id=c.getId(),r.name=c.getName());r.cells=q;return r};EditorUi.prototype.createJsonForExport=
+function(c,f,k,n){var q={version:EditorUi.VERSION};f&&(q.data=mxUtils.getXml(this.getXmlFileData(!n,!c,!k)));f=[];if(n)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));q.pages=f;return q};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},k=document.createElement("div");k.style.whiteSpace="nowrap";
+var n=document.createElement("h3");mxUtils.write(n,mxUtils.htmlEntities(c));k.appendChild(n);var q=document.createElement("div");q.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";q.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var t={};try{var r=mxSettings.getCustomLibraries();for(c=0;c<r.length;c++){var z=r[c];if("R"==z.substring(0,1)){var D=JSON.parse(decodeURIComponent(z.substring(1)));t[D[0]]={id:D[0],title:D[1],downloadUrl:D[2]}}}}catch(H){}this.remoteInvoke("getCustomLibraries",
+null,null,function(H){q.innerText="";if(0==H.length)q.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var B=0;B<H.length;B++){var W=H[B];t[W.id]&&(f[W.id]=W);var I=this.addCheckbox(q,W.title,t[W.id]);(function(N,U){mxEvent.addListener(U,"change",function(){this.checked?f[N.id]=N:delete f[N.id]})})(W,I)}},mxUtils.bind(this,function(H){q.innerText="";var B=document.createElement("div");B.style.padding="8px";
+B.style.textAlign="center";mxUtils.write(B,mxResources.get("error")+": ");mxUtils.write(B,null!=H&&null!=H.message?H.message:mxResources.get("unknownError"));q.appendChild(B)}));k.appendChild(q);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var H=0,B;for(B in f)null==t[B]&&(H++,mxUtils.bind(this,function(W){this.remoteInvoke("getFileContent",[W.downloadUrl],null,mxUtils.bind(this,function(I){H--;0==H&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,
+I,W)),this.showSidebar()}catch(N){this.handleError(N,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){H--;0==H&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[B]));for(B in t)f[B]||this.closeLibrary(new RemoteLibrary(this,null,t[B]));0==H&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns=
+{getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=
+[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=null!=f?f.callbackId:null,n="number"===typeof k&&0<=k&&k<this.remoteInvokeCallbacks.length?this.remoteInvokeCallbacks[k]:null;if(null==n)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?n.error&&n.error(c.error.errResp):n.callback&&n.callback.apply(this,c.resp);this.remoteInvokeCallbacks[k]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,n,q){var t=!0,r=window.setTimeout(mxUtils.bind(this,
+function(){t=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),z=mxUtils.bind(this,function(){window.clearTimeout(r);t&&n.apply(this,arguments)}),D=mxUtils.bind(this,function(){window.clearTimeout(r);t&&q.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:z,error:D});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,
+"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var k=mxUtils.bind(this,function(H,B){var W={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=B?W.error={errResp:B}:null!=H&&(W.resp=H);this.remoteWin.postMessage(JSON.stringify(W),"*")});try{var n=c.funtionName,q=null!=n&&Object.prototype.hasOwnProperty.call(this.remoteInvokableFns,n)?this.remoteInvokableFns[n]:null;if(null!=q&&"function"===typeof this[n]){if(q.allowedDomains){for(var t=!1,r=0;r<q.allowedDomains.length;r++)if(f==
+"https://"+q.allowedDomains[r]){t=!0;break}if(!t){k(null,"Invalid Call: "+n+" is not allowed.");return}}var z=c.functionArgs;Array.isArray(z)||(z=[]);if(q.isAsync)z.push(function(){k(Array.prototype.slice.apply(arguments))}),z.push(function(H){k(null,H||"Unkown Error")}),this[n].apply(this,z);else{var D=this[n].apply(this,z);k([D])}}else k(null,"Invalid Call: "+n+" is not found.")}catch(H){k(null,"Invalid Call: An error occurred, "+H.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==
+this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var n=k.open("database",2);n.onupgradeneeded=function(q){try{var t=n.result;1>q.oldVersion&&t.createObjectStore("objects",{keyPath:"key"});2>q.oldVersion&&(t.createObjectStore("files",{keyPath:"title"}),t.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(r){null!=f&&f(r)}};n.onsuccess=mxUtils.bind(this,function(q){try{var t=n.result;this.database=t;EditorUi.migrateStorageFiles&&
+(StorageFile.migrate(t),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(r){if((!r||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var z=document.createElement("iframe");z.style.display="none";z.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(z);var D=!0,H=!1,
+B,W=0,I=mxUtils.bind(this,function(){H=!0;this.setDatabaseItem(".drawioMigrated3",!0);z.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),N=mxUtils.bind(this,function(){W++;U()}),U=mxUtils.bind(this,function(){try{if(W>=B.length)I();else{var V=B[W];StorageFile.getFileContent(this,V,mxUtils.bind(this,function(ja){null==ja||".scratchpad"==V&&ja==this.emptyLibraryXml?z.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",
+functionArgs:[V]}),"*"):N()}),N)}}catch(ja){console.log(ja)}}),S=mxUtils.bind(this,function(V){try{this.setDatabaseItem(null,[{title:V.title,size:V.data.length,lastModified:Date.now(),type:V.isLib?"L":"F"},{title:V.title,data:V.data}],N,N,["filesInfo","files"])}catch(ja){console.log(ja)}});r=mxUtils.bind(this,function(V){try{if(V.source==z.contentWindow){var ja={};try{ja=JSON.parse(V.data)}catch(v){}"init"==ja.event?(z.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),z.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",
+funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=ja.event||H||(D?null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?(B=ja.resp[0],D=!1,U()):I():null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?S(ja.resp[0]):N())}}catch(v){console.log(v)}});window.addEventListener("message",r)}})));c(t);t.onversionchange=function(){t.close()}}catch(r){null!=f?f(r):null!=window.console&&console.warn(r)}});n.onerror=f;n.onblocked=function(){}}catch(q){null!=f?f(q):null!=window.console&&console.error(q)}else null!=
+f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,n,q){this.openDatabase(mxUtils.bind(this,function(t){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c],f=[f]);var r=t.transaction(q,"readwrite");r.oncomplete=k;r.onerror=n;for(t=0;t<q.length;t++)r.objectStore(q[t]).put(null!=c&&null!=c[t]?{key:c[t],data:f[t]}:f[t])}catch(z){null!=n&&n(z)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,n){this.openDatabase(mxUtils.bind(this,function(q){try{n=
+n||"objects";Array.isArray(n)||(n=[n],c=[c]);var t=q.transaction(n,"readwrite");t.oncomplete=f;t.onerror=k;for(q=0;q<n.length;q++)t.objectStore(n[q]).delete(c[q])}catch(r){null!=k&&k(r)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,n){this.openDatabase(mxUtils.bind(this,function(q){try{n=n||"objects";var t=q.transaction([n],"readonly").objectStore(n).get(c);t.onsuccess=function(){f(t.result)};t.onerror=k}catch(r){null!=k&&k(r)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,
+function(n){try{k=k||"objects";var q=n.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),t=[];q.onsuccess=function(r){null==r.target.result?c(t):(t.push(r.target.result.value),r.target.result.continue())};q.onerror=f}catch(r){null!=f&&f(r)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(n){try{k=k||"objects";var q=n.transaction([k],"readonly").objectStore(k).getAllKeys();q.onsuccess=function(){c(q.result)};q.onerror=
+f}catch(t){null!=f&&f(t)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var k=this.getCurrentFile();null!=k?k.getComments(c,f):c([])};EditorUi.prototype.addComment=
+function(c,f,k){var n=this.getCurrentFile();null!=n?n.addComment(c,f,k):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.anchoredCommentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.anchoredCommentsSupported():!1};EditorUi.prototype.mentionsSupported=function(){var c=this.getCurrentFile();
+return null!=c?c.mentionsSupported():!1};EditorUi.prototype.freeMentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.freeMentionsSupported():!1};EditorUi.prototype.mentionsLiveSearch=function(){var c=this.getCurrentFile();return null!=c?c.mentionsLiveSearch():!1};EditorUi.prototype.mentionNotificationsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionNotificationsSupported():!0};EditorUi.prototype.getMentionCandidates=function(c,f,k){var n=this.getCurrentFile();
+null!=n?n.getMentionCandidates(c,f,k):c([])};EditorUi.prototype.serializeMention=function(c){return"+"+c.email};EditorUi.prototype.parseMentionTokens=function(c){for(var f=/[+@]([A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,})/g,k=[],n=0,q;null!=(q=f.exec(c));)q.index>n&&k.push(c.substring(n,q.index)),k.push({email:q[1]}),n=q.index+q[0].length;n<c.length&&k.push(c.substring(n));return k};EditorUi.prototype.getCommentCacheTarget=function(){var c=this.getCurrentFile();return null!=c?
+c:this};EditorUi.prototype.refreshCommentCache=function(c,f){if(this.commentsSupported()){var k=this.getCommentCacheTarget();if(null!=k.commentCacheCallbacks)k.commentCacheCallbacks.push([c,f]);else{k.commentCacheCallbacks=[[c,f]];var n=mxUtils.bind(this,function(q,t){var r=k.commentCacheCallbacks;k.commentCacheCallbacks=null;for(var z=0;null!=r&&z<r.length;z++)if(null!=r[z][q])r[z][q](t)});this.getComments(mxUtils.bind(this,function(q){this.getCommentCacheTarget()==k&&(k.commentCache=q,this.fireEvent(new mxEventObject("commentsChanged")));
+n(0,q)}),mxUtils.bind(this,function(q){n(1,q)}))}}else null!=c&&c(null)};EditorUi.prototype.commentsUpdated=function(){if(this.commentsSupported()){var c=this.getCurrentFile();null!=c&&null!=c.sync&&c.sync.sendCommentsChangedMessage();this.refreshCommentCache()}};EditorUi.prototype.getUnresolvedCommentCount=function(){var c=this.getCommentCacheTarget().commentCache,f=0;if(null!=c)for(var k=0;k<c.length;k++)c[k].isResolved||f++;return f};EditorUi.prototype.getCommentAnchorCells=function(c){var f=c.getAnchorCellIds(),
+k=[];if(null!=f&&0<f.length){c=c.getAnchorPageId();var n=null==c?this.currentPage:this.getPageById(c);if(null!=n)if(n==this.currentPage)for(c=0;c<f.length;c++)n=this.editor.graph.model.getCell(f[c]),null!=n&&k.push(n);else{try{this.updatePageRoot(n)}catch(z){return k}if(null!=n.root){var q={},t=0;for(c=0;c<f.length;c++)q[f[c]]||(q[f[c]]=!0,t++);var r=function(z){if(0<t){q[z.getId()]&&(q[z.getId()]=!1,k.push(z),t--);for(var D=0;D<z.getChildCount();D++)r(z.getChildAt(D))}};r(n.root)}}}return k};EditorUi.prototype.gotoCommentAnchor=
+function(c){var f=c.getAnchorPageId();if(null!=f&&null!=this.currentPage&&f!=this.currentPage.getId()){f=this.getPageById(f);if(null==f)return!1;this.selectPage(f)}f=this.editor.graph;var k=c.getAnchorCellIds();if(null!=k&&0<k.length){c=[];for(var n=0;n<k.length;n++){var q=f.model.getCell(k[n]);null!=q&&c.push(q)}return 0<c.length?(f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c,"#0071e3",2E3),f.scrollCellToVisible(c[0]),!0):!1}k=c.getAnchorRect();null!=k&&0<k.w&&0<k.h&&f.fitWindow(new mxRectangle(k.x,
+k.y,k.w,k.h),0);c=c.getAnchorPoint();if(null!=c){k=f.view.scale;n=f.view.translate;f=f.container;f.scrollLeft=Math.round((c.x+n.x)*k-f.clientWidth/2);f.scrollTop=Math.round((c.y+n.y)*k-f.clientHeight/2);var t=document.createElement("div");t.className="geCommentAnchorMarker";t.style.left=Math.round((c.x+n.x)*k)+"px";t.style.top=Math.round((c.y+n.y)*k)+"px";f.appendChild(t);window.setTimeout(function(){null!=t.parentNode&&t.parentNode.removeChild(t)},2E3)}return!0};EditorUi.prototype.addCommentsBadge=
+function(c){var f=document.createElement("span");f.className="geCommentsBadge";f.style.display="none";c.appendChild(f);c=mxUtils.bind(this,function(){var k=this.getUnresolvedCommentCount();f.style.display=0<k?"":"none";f.innerText="";mxUtils.write(f,99<k?"99+":String(k))});this.addListener("commentsChanged",c);this.editor.addListener("fileLoaded",c);c();return f};EditorUi.prototype.installCommentDragSource=function(c){var f=this,k=document.createElement("div");k.style.width="24px";k.style.height=
+"24px";k.style.backgroundImage="url("+Editor.lightDarkCommentImage+")";k.style.backgroundSize="100% 100%";k.style.opacity="0.9";c=mxUtils.makeDraggable(c,function(){return f.editor.graph},function(q,t,r,z,D){null!=f.currentPage&&null!=f.menus&&null!=f.menus.showCommentsWindow&&(q=null!=r?{p:f.currentPage.getId(),c:r.id}:{p:f.currentPage.getId(),pt:{x:Math.round(z),y:Math.round(D)}},f.menus.showCommentsWindow(null,q))},k);var n=c.mouseDown;c.mouseDown=function(q){mxEvent.isMouseEvent(q)&&!mxEvent.isPopupTrigger(q)&&
+f.commentsSupported()&&f.anchoredCommentsSupported()&&f.canComment()&&n.apply(this,arguments)};return c};EditorUi.prototype.updateCommentOverlays=function(){var c=this.editor.graph;if(null!=this.commentOverlays)for(var f=0;f<this.commentOverlays.length;f++)c.removeCellOverlay(this.commentOverlays[f].cell,this.commentOverlays[f].overlay);this.commentOverlays=null;var k=this.getCurrentFile();if(null!=k&&k.anchoredCommentsSupported()&&null!=k.commentCache&&!this.editor.isChromelessView()){var n=null!=
+this.currentPage?this.currentPage.getId():null,q={};for(f=0;f<k.commentCache.length;f++){var t=k.commentCache[f],r=t.getAnchorCellIds();if(!t.isResolved&&null!=r&&t.getAnchorPageId()==n)for(t=0;t<r.length;t++)q[r[t]]=!0}this.commentOverlays=[];for(var z in q)mxUtils.bind(this,function(D){var H=c.model.getCell(D);if(null!=H){var B=new mxCellOverlay(new mxImage(Editor.lightDarkCommentImage,16,16),mxResources.get("comments"),mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,new mxPoint(8,8));B.isCommentOverlay=
+!0;B.cursor="pointer";B.addListener(mxEvent.CLICK,mxUtils.bind(this,function(){null!=this.menus&&null!=this.menus.showCommentsWindow&&this.menus.showCommentsWindow(D)}));c.addCellOverlay(H,B);this.commentOverlays.push({cell:H,overlay:B})}})(z)}};EditorUi.prototype.newComment=function(c,f){var k=this.getCurrentFile();return null!=k?k.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=
+c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};
+EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,n,q,t,r,z){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,n,q,t,r,z)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");
+return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,k,n,q,t,r,z,D,H,B,W,I,N,U,S){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,n,q,t,r,z,
+D,H,B,W,I,N,U,S)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,k,n)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};
+EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,k,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,k,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,k,n,q){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,
+f,k,n,q)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var k=localStorage.key(f),n=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<n.length){var q="<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(q||n)&&c.push(k)}}return c};EditorUi.prototype.getLocalStorageFile=
+function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
var CommentsWindow=function(b,l,p,g,u,y){function A(){for(var P=F.getElementsByTagName("div"),aa=0,ea=0;ea<P.length;ea++)"none"!=P[ea].style.display&&P[ea].parentNode==F&&aa++;G.style.display=0==aa?"block":"none"}function E(P){for(var aa=0;aa<v.length;aa++)if(null!=v[aa].email&&null!=P&&v[aa].email.toLowerCase()==P.toLowerCase())return v[aa].displayName||P;return P}function J(P){var aa=document.createElement("span");aa.className="geCommentMention";aa.setAttribute("data-mention",b.serializeMention(P));
-null!=P.email&&aa.setAttribute("data-email",P.email);aa.contentEditable="false";mxUtils.write(aa,"@"+(P.displayName||(null!=P.email?E(P.email):P.id)));return aa}function M(P,aa){P.innerText="";aa=null!=aa?aa:"";if(N){aa=b.parseMentionTokens(aa);for(var ea=0;ea<aa.length;ea++)"string"===typeof aa[ea]?mxUtils.write(P,aa[ea]):P.appendChild(J(aa[ea]))}else mxUtils.write(P,aa)}function L(P,aa,ea,oa){function ra(la){for(var Ea in za)for(var Fa=0;Fa<za[Ea].length;Fa++)la(za[Ea][Fa],"down"==Ea?xa:"move"==
-Ea?Ba:ma)}function ta(la){la=mxUtils.convertPoint(Aa,mxEvent.getClientX(la),mxEvent.getClientY(la));return new mxPoint(la.x/ya.view.scale-ya.view.translate.x,la.y/ya.view.scale-ya.view.translate.y)}function na(){ra(function(la,Ea){document.removeEventListener(la,Ea,!0)});document.removeEventListener("keydown",ka,!0);window.setTimeout(function(){document.removeEventListener("click",fa,!0)},0);Aa.classList.remove("geCommentAnchorPicking");ya.setEnabled(Ca);null!=ua&&null!=ua.parentNode&&ua.parentNode.removeChild(ua)}
-function wa(la){na();null!=la&&(P.anchor=la,f(P,aa,ea))}var ya=b.editor.graph,Aa=ya.container,Ca=ya.isEnabled(),ua=null,qa=null,ha=null,ia=null,pa=null;ya.setEnabled(!1);Aa.classList.add("geCommentAnchorPicking");var za=mxClient.IS_POINTER?{down:["pointerdown"],move:["pointermove"],up:["pointerup"]}:{down:["mousedown","touchstart"],move:["mousemove","touchmove"],up:["mouseup","touchend"]},fa=function(la){Aa.contains(mxEvent.getSource(la))&&mxEvent.consume(la)},ka=function(la){27==la.keyCode&&(wa(null),
-mxEvent.consume(la))},xa=function(la){Aa.contains(mxEvent.getSource(la))?(qa=ta(la),ha=new mxPoint(mxEvent.getClientX(la),mxEvent.getClientY(la)),oa&&(ua=document.createElement("div"),ua.className="geCommentAnchorPickPreview",Aa.appendChild(ua)),mxEvent.consume(la)):wa(null)},Ba=function(la){if(null!=qa&&(ia=ta(la),pa=new mxPoint(mxEvent.getClientX(la),mxEvent.getClientY(la)),null!=ua)){var Ea=ya.view.scale,Fa=ya.view.translate;ua.style.left=Math.round((Math.min(qa.x,ia.x)+Fa.x)*Ea)+"px";ua.style.top=
-Math.round((Math.min(qa.y,ia.y)+Fa.y)*Ea)+"px";ua.style.width=Math.round(Math.abs(ia.x-qa.x)*Ea)+"px";ua.style.height=Math.round(Math.abs(ia.y-qa.y)*Ea)+"px";mxEvent.consume(la)}},ma=function(la){if(null!=qa)if(null==b.currentPage)wa(null);else{var Ea=b.currentPage.getId();if(oa){var Fa=ia,Ia=pa;try{Fa=ta(la),Ia=new mxPoint(mxEvent.getClientX(la),mxEvent.getClientY(la))}catch(Ha){}null==Fa||null==Ia||4>Math.abs(Ia.x-ha.x)&&4>Math.abs(Ia.y-ha.y)?wa(null):wa({p:Ea,r:{x:Math.round(Math.min(qa.x,Fa.x)),
-y:Math.round(Math.min(qa.y,Fa.y)),w:Math.round(Math.abs(Fa.x-qa.x)),h:Math.round(Math.abs(Fa.y-qa.y))}})}else wa({p:Ea,pt:{x:Math.round(qa.x),y:Math.round(qa.y)}});mxEvent.consume(la)}};window.setTimeout(function(){ra(function(la,Ea){document.addEventListener(la,Ea,!0)});document.addEventListener("click",fa,!0);document.addEventListener("keydown",ka,!0)},0)}function O(P){P=null!=P?mxUtils.trim(P.replace(/\s+/g," ")):"";25<P.length&&(P=P.substring(0,25)+"…");return P}function c(P){var aa="";try{var ea=
-b.editor.graph.getLabel(P);"string"===typeof ea&&(aa=Editor.convertHtmlToText(ea))}catch(oa){}return O(aa)||mxResources.get("shape")}function f(P,aa,ea){function oa(ia){if(ea){var pa=document.createElement("span");pa.className="geCommentAnchorRemove";pa.setAttribute("title",mxResources.get("remove"));mxUtils.write(pa,"×");mxEvent.addListener(pa,"click",function(za){P.anchor=null;f(P,aa,ea);za.preventDefault();mxEvent.consume(za)});ia.appendChild(pa)}}function ra(ia,pa,za,fa){var ka=document.createElement(fa?
+null!=P.email&&aa.setAttribute("data-email",P.email);aa.contentEditable="false";mxUtils.write(aa,"@"+(P.displayName||(null!=P.email?E(P.email):P.id)));return aa}function M(P,aa){P.innerText="";aa=null!=aa?aa:"";if(N){aa=b.parseMentionTokens(aa);for(var ea=0;ea<aa.length;ea++)"string"===typeof aa[ea]?mxUtils.write(P,aa[ea]):P.appendChild(J(aa[ea]))}else mxUtils.write(P,aa)}function L(P,aa,ea,oa){function sa(la){for(var Ea in za)for(var Ga=0;Ga<za[Ea].length;Ga++)la(za[Ea][Ga],"down"==Ea?xa:"move"==
+Ea?Ba:ma)}function ta(la){la=mxUtils.convertPoint(Aa,mxEvent.getClientX(la),mxEvent.getClientY(la));return new mxPoint(la.x/ya.view.scale-ya.view.translate.x,la.y/ya.view.scale-ya.view.translate.y)}function na(){sa(function(la,Ea){document.removeEventListener(la,Ea,!0)});document.removeEventListener("keydown",ka,!0);window.setTimeout(function(){document.removeEventListener("click",fa,!0)},0);Aa.classList.remove("geCommentAnchorPicking");ya.setEnabled(Da);null!=ua&&null!=ua.parentNode&&ua.parentNode.removeChild(ua)}
+function wa(la){na();null!=la&&(P.anchor=la,f(P,aa,ea))}var ya=b.editor.graph,Aa=ya.container,Da=ya.isEnabled(),ua=null,qa=null,ha=null,ia=null,pa=null;ya.setEnabled(!1);Aa.classList.add("geCommentAnchorPicking");var za=mxClient.IS_POINTER?{down:["pointerdown"],move:["pointermove"],up:["pointerup"]}:{down:["mousedown","touchstart"],move:["mousemove","touchmove"],up:["mouseup","touchend"]},fa=function(la){Aa.contains(mxEvent.getSource(la))&&mxEvent.consume(la)},ka=function(la){27==la.keyCode&&(wa(null),
+mxEvent.consume(la))},xa=function(la){Aa.contains(mxEvent.getSource(la))?(qa=ta(la),ha=new mxPoint(mxEvent.getClientX(la),mxEvent.getClientY(la)),oa&&(ua=document.createElement("div"),ua.className="geCommentAnchorPickPreview",Aa.appendChild(ua)),mxEvent.consume(la)):wa(null)},Ba=function(la){if(null!=qa&&(ia=ta(la),pa=new mxPoint(mxEvent.getClientX(la),mxEvent.getClientY(la)),null!=ua)){var Ea=ya.view.scale,Ga=ya.view.translate;ua.style.left=Math.round((Math.min(qa.x,ia.x)+Ga.x)*Ea)+"px";ua.style.top=
+Math.round((Math.min(qa.y,ia.y)+Ga.y)*Ea)+"px";ua.style.width=Math.round(Math.abs(ia.x-qa.x)*Ea)+"px";ua.style.height=Math.round(Math.abs(ia.y-qa.y)*Ea)+"px";mxEvent.consume(la)}},ma=function(la){if(null!=qa)if(null==b.currentPage)wa(null);else{var Ea=b.currentPage.getId();if(oa){var Ga=ia,Ja=pa;try{Ga=ta(la),Ja=new mxPoint(mxEvent.getClientX(la),mxEvent.getClientY(la))}catch(Ha){}null==Ga||null==Ja||4>Math.abs(Ja.x-ha.x)&&4>Math.abs(Ja.y-ha.y)?wa(null):wa({p:Ea,r:{x:Math.round(Math.min(qa.x,Ga.x)),
+y:Math.round(Math.min(qa.y,Ga.y)),w:Math.round(Math.abs(Ga.x-qa.x)),h:Math.round(Math.abs(Ga.y-qa.y))}})}else wa({p:Ea,pt:{x:Math.round(qa.x),y:Math.round(qa.y)}});mxEvent.consume(la)}};window.setTimeout(function(){sa(function(la,Ea){document.addEventListener(la,Ea,!0)});document.addEventListener("click",fa,!0);document.addEventListener("keydown",ka,!0)},0)}function O(P){P=null!=P?mxUtils.trim(P.replace(/\s+/g," ")):"";25<P.length&&(P=P.substring(0,25)+"…");return P}function c(P){var aa="";try{var ea=
+b.editor.graph.getLabel(P);"string"===typeof ea&&(aa=Editor.convertHtmlToText(ea))}catch(oa){}return O(aa)||mxResources.get("shape")}function f(P,aa,ea){function oa(ia){if(ea){var pa=document.createElement("span");pa.className="geCommentAnchorRemove";pa.setAttribute("title",mxResources.get("remove"));mxUtils.write(pa,"×");mxEvent.addListener(pa,"click",function(za){P.anchor=null;f(P,aa,ea);za.preventDefault();mxEvent.consume(za)});ia.appendChild(pa)}}function sa(ia,pa,za,fa){var ka=document.createElement(fa?
"span":"a");ka.className="geCommentAnchorChip"+(fa?" geCommentAnchorChipDeleted":"");ka.innerHTML=ia;ia=document.createElement("span");mxUtils.write(ia,pa);ka.appendChild(ia);fa||(null!=za&&ka.setAttribute("title",za),mxEvent.addListener(ka,"click",function(xa){b.gotoCommentAnchor(P);xa.preventDefault();mxEvent.consume(xa)}));oa(ka);aa.appendChild(ka)}aa.innerText="";aa.style.display="";if(null!=P.getAnchorCellId()){var ta=b.getCommentAnchorCells(P),na=null,wa=null;if(0==ta.length)na=mxResources.get("shapeDeleted");
-else if(1==ta.length)na=c(ta[0]),wa=mxResources.get("shape");else{na=ta.length+" "+mxResources.get("cells");wa=[];for(var ya=0;ya<ta.length;ya++)wa.push(c(ta[ya]));wa=wa.join("\n")}ra('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',na,
+else if(1==ta.length)na=c(ta[0]),wa=mxResources.get("shape");else{na=ta.length+" "+mxResources.get("cells");wa=[];for(var ya=0;ya<ta.length;ya++)wa.push(c(ta[ya]));wa=wa.join("\n")}sa('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',na,
wa,0==ta.length)}else if(null!=P.getAnchorPageId())ta=b.getPageById(P.getAnchorPageId()),wa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 1.5h5.5L12.5 4.5v10h-8.5z M9.5 1.5v3h3"/></svg>',na=null,null!=P.getAnchorRect()?(wa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="8" rx="1" stroke-dasharray="2.6 2.2"/></svg>',
-na="area"):null!=P.getAnchorPoint()&&(wa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',na="point"),na=null==ta?mxResources.get("pageNotFound"):null!=na?mxResources.get(na):O(ta.getName())||mxResources.get("page"),ra(wa,na,null!=ta?ta.getName()||
-mxResources.get("page"):null,null==ta);else if(ea&&null!=b.currentPage){var Aa=function(ia,pa,za){var fa=document.createElement("div");fa.className="geCommentMentionRow";fa.innerHTML=ia;ia=document.createElement("span");mxUtils.write(ia,pa);fa.appendChild(ia);mxEvent.addListener(fa,"mousedown",function(ka){Ca();za();f(P,aa,ea);ka.preventDefault();mxEvent.consume(ka)});qa.appendChild(fa)},Ca=function(){null!=qa&&null!=qa.parentNode&&qa.parentNode.removeChild(qa);qa=null;null!=ha&&(mxEvent.removeListener(document,
+na="area"):null!=P.getAnchorPoint()&&(wa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',na="point"),na=null==ta?mxResources.get("pageNotFound"):null!=na?mxResources.get(na):O(ta.getName())||mxResources.get("page"),sa(wa,na,null!=ta?ta.getName()||
+mxResources.get("page"):null,null==ta);else if(ea&&null!=b.currentPage){var Aa=function(ia,pa,za){var fa=document.createElement("div");fa.className="geCommentMentionRow";fa.innerHTML=ia;ia=document.createElement("span");mxUtils.write(ia,pa);fa.appendChild(ia);mxEvent.addListener(fa,"mousedown",function(ka){Da();za();f(P,aa,ea);ka.preventDefault();mxEvent.consume(ka)});qa.appendChild(fa)},Da=function(){null!=qa&&null!=qa.parentNode&&qa.parentNode.removeChild(qa);qa=null;null!=ha&&(mxEvent.removeListener(document,
"mousedown",ha),ha=null)},ua=document.createElement("a");ua.className="geCommentAnchorChip geCommentAnchorAttach";ua.setAttribute("title",mxResources.get("attach"));ua.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8M4.5 6.5L8 10l3.5-3.5M3 13h10"/></svg>';na=document.createElement("span");mxUtils.write(na,mxResources.get("attach"));ua.appendChild(na);var qa=
-null,ha=null;mxEvent.addListener(ua,"click",function(ia){if(null!=qa)Ca();else if(null!=b.currentPage){var pa=b.editor.graph,za=b.currentPage.getId();qa=document.createElement("div");qa.className="geCommentMentionMenu";1==pa.getSelectionCount()?Aa('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
+null,ha=null;mxEvent.addListener(ua,"click",function(ia){if(null!=qa)Da();else if(null!=b.currentPage){var pa=b.editor.graph,za=b.currentPage.getId();qa=document.createElement("div");qa.className="geCommentMentionMenu";1==pa.getSelectionCount()?Aa('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
c(pa.getSelectionCell()),function(){P.anchor={p:za,c:pa.getSelectionCell().id}}):1<pa.getSelectionCount()&&Aa('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',pa.getSelectionCount()+" "+mxResources.get("cells"),function(){for(var fa=pa.getSelectionCells(),
ka=[],xa=0;xa<fa.length;xa++)ka.push(fa[xa].id);P.anchor={p:za,c:ka}});Aa('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',mxResources.get("point")+"…",function(){L(P,aa,ea,!1)});Aa('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="8" rx="1" stroke-dasharray="2.6 2.2"/></svg>',
mxResources.get("area")+"…",function(){L(P,aa,ea,!0)});Aa('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 1.5h5.5L12.5 4.5v10h-8.5z M9.5 1.5v3h3"/></svg>',mxResources.get("currentPage"),function(){P.anchor={p:za}});qa.style.left=ua.offsetLeft+"px";qa.style.top=ua.offsetTop+ua.offsetHeight+2+"px";aa.parentNode.insertBefore(qa,aa.nextSibling);ha=function(fa){fa=mxEvent.getSource(fa);
-null==qa||fa==ua||ua.contains(fa)||qa.contains(fa)||Ca()};mxEvent.addListener(document,"mousedown",ha)}ia.preventDefault();mxEvent.consume(ia)});aa.appendChild(ua)}else aa.style.display="none"}function k(P){if("TEXTAREA"==P.nodeName)return P.value;var aa=[],ea=function(oa){for(oa=oa.firstChild;null!=oa;oa=oa.nextSibling)3==oa.nodeType?aa.push(oa.nodeValue):1==oa.nodeType&&("BR"==oa.nodeName?aa.push("\n"):null!=oa.getAttribute&&null!=oa.getAttribute("data-mention")?aa.push(oa.getAttribute("data-mention")):
+null==qa||fa==ua||ua.contains(fa)||qa.contains(fa)||Da()};mxEvent.addListener(document,"mousedown",ha)}ia.preventDefault();mxEvent.consume(ia)});aa.appendChild(ua)}else aa.style.display="none"}function k(P){if("TEXTAREA"==P.nodeName)return P.value;var aa=[],ea=function(oa){for(oa=oa.firstChild;null!=oa;oa=oa.nextSibling)3==oa.nodeType?aa.push(oa.nodeValue):1==oa.nodeType&&("BR"==oa.nodeName?aa.push("\n"):null!=oa.getAttribute&&null!=oa.getAttribute("data-mention")?aa.push(oa.getAttribute("data-mention")):
(("DIV"==oa.nodeName||"P"==oa.nodeName)&&0<aa.length&&"\n"!=aa[aa.length-1]&&!/\n$/.test(aa[aa.length-1])&&aa.push("\n"),ea(oa)))};ea(P);return aa.join("").replace(/\u00a0/g," ")}function n(P){function aa(){null!=na&&null!=na.parentNode&&na.parentNode.removeChild(na);Aa=na=null}function ea(){var qa=window.getSelection();if(null==qa||0==qa.rangeCount)return null;qa=qa.getRangeAt(0);if(!qa.collapsed||3!=qa.startContainer.nodeType||!P.contains(qa.startContainer))return null;var ha=qa.startContainer.nodeValue.substring(0,
qa.startOffset);ha=/(^|[\s\u00a0])@([^\s\u00a0]*)$/.exec(ha);return null==ha?null:{node:qa.startContainer,start:ha.index+ha[1].length,end:qa.startOffset,query:ha[2]}}function oa(qa){if(null!=Aa){var ha=Aa.node,ia=ha.nodeValue.substring(Aa.end);ha.nodeValue=ha.nodeValue.substring(0,Aa.start);qa=J(qa);ia=document.createTextNode(" "+ia);ha.parentNode.insertBefore(qa,ha.nextSibling);qa.parentNode.insertBefore(ia,qa.nextSibling);V||null!=ua||(ua=document.createElement("div"),ua.style.cssText="font-size:11px;opacity:0.7;padding:2px 0;",
-mxUtils.write(ua,mxResources.get("mentionNoNotify",null,"People you mention are not notified")),P.parentNode.insertBefore(ua,P.nextSibling));ha=window.getSelection();qa=document.createRange();qa.setStart(ia,1);qa.collapse(!0);ha.removeAllRanges();ha.addRange(qa);aa()}}function ra(){Aa=ea();if(null==Aa)aa();else if(U)null!=Ca&&window.clearTimeout(Ca),Ca=window.setTimeout(function(){Ca=null;if(null!=Aa){var za=Aa.query;b.getMentionCandidates(function(fa){null!=Aa&&Aa.query==za&&ta(fa.slice(0,6))},function(){},
+mxUtils.write(ua,mxResources.get("mentionNoNotify",null,"People you mention are not notified")),P.parentNode.insertBefore(ua,P.nextSibling));ha=window.getSelection();qa=document.createRange();qa.setStart(ia,1);qa.collapse(!0);ha.removeAllRanges();ha.addRange(qa);aa()}}function sa(){Aa=ea();if(null==Aa)aa();else if(U)null!=Da&&window.clearTimeout(Da),Da=window.setTimeout(function(){Da=null;if(null!=Aa){var za=Aa.query;b.getMentionCandidates(function(fa){null!=Aa&&Aa.query==za&&ta(fa.slice(0,6))},function(){},
za)}},300);else{for(var qa=Aa.query.toLowerCase(),ha=[],ia=0;ia<v.length&&6>ha.length;ia++){var pa=v[ia];(0==qa.length||null!=pa.displayName&&0<=pa.displayName.toLowerCase().indexOf(qa)||null!=pa.email&&0<=pa.email.toLowerCase().indexOf(qa))&&ha.push(pa)}if(S&&/^[A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}$/.test(Aa.query)){pa=!1;for(ia=0;ia<ha.length;ia++)if(null!=ha[ia].email&&ha[ia].email.toLowerCase()==qa){pa=!0;break}pa||ha.push({email:Aa.query})}ta(ha)}}function ta(qa){ya=
qa;if(0==ya.length)aa();else for(wa=Math.min(wa,ya.length-1),null==na&&(na=document.createElement("div"),na.className="geCommentMentionMenu",P.parentNode.insertBefore(na,P.nextSibling)),na.style.left=P.offsetLeft+"px",na.style.top=P.offsetTop+P.offsetHeight+"px",na.innerText="",qa=0;qa<ya.length;qa++)(function(ha,ia){var pa=document.createElement("div");pa.className="geCommentMentionRow"+(ia==wa?" geCommentMentionRowSelected":"");ia=null;null==ha.pictureUrl&&ha.isGroup?(ia=document.createElement("span"),
ia.className="geCommentMentionImg",ia.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="6" cy="5.5" r="2.4"/><path d="M1.5 13.5c0-2.6 2-3.9 4.5-3.9s4.5 1.3 4.5 3.9"/><circle cx="11.3" cy="6" r="2"/><path d="M12.3 10.1c1.6.5 2.2 1.6 2.2 3.4"/></svg>'):(ia=document.createElement("img"),ia.className="geCommentMentionImg",ia.src=null!=ha.pictureUrl?ha.pictureUrl:
Editor.userImage);pa.appendChild(ia);ia=document.createElement("span");mxUtils.write(ia,ha.displayName||ha.email);pa.appendChild(ia);ha.isGroup&&(ia=document.createElement("span"),ia.className="geCommentMentionGroupTag",mxUtils.write(ia,mxResources.get("group")),pa.appendChild(ia));null!=ha.displayName&&null!=ha.email&&(ia=document.createElement("span"),ia.className="geCommentMentionMail",mxUtils.write(ia,ha.email),pa.appendChild(ia));mxEvent.addListener(pa,"mousedown",function(za){oa(ha);za.preventDefault();
-mxEvent.consume(za)});na.appendChild(pa)})(ya[qa],qa)}var na=null,wa=0,ya=[],Aa=null,Ca=null,ua=null;mxEvent.addListener(P,"keydown",function(qa){null==na||mxEvent.isConsumed(qa)||(40==qa.keyCode||38==qa.keyCode?(wa=(wa+(40==qa.keyCode?1:ya.length-1))%ya.length,ra(),qa.preventDefault(),mxEvent.consume(qa)):13!=qa.keyCode&&9!=qa.keyCode||mxEvent.isControlDown(qa)||mxEvent.isMetaDown(qa)?27==qa.keyCode&&(aa(),qa.preventDefault(),mxEvent.consume(qa)):(oa(ya[wa]),qa.preventDefault(),mxEvent.consume(qa)))});
-mxEvent.addListener(P,"input",ra);mxEvent.addListener(P,"keyup",function(qa){37!=qa.keyCode&&39!=qa.keyCode&&35!=qa.keyCode&&36!=qa.keyCode||ra()});mxEvent.addListener(P,"blur",function(){window.setTimeout(aa,200)});mxEvent.addListener(P,"paste",function(qa){qa.preventDefault();qa=null!=qa.clipboardData?qa.clipboardData.getData("text/plain"):null;null!=qa&&0<qa.length&&document.execCommand("insertText",!1,qa)})}function q(P,aa){if(N){var ea=document.createElement("div");ea.contentEditable=!0;M(ea,
-P);n(ea)}else ea=document.createElement("textarea"),ea.value=P;ea.className="geCommentEditTxtArea";ea.style.minHeight=aa+"px";return ea}function t(P,aa,ea,oa){function ra(){aa.removeChild(Aa);aa.removeChild(ua);na.style.display="block";ta.style.display="block"}m={div:aa,comment:P,saveCallback:ea,deleteOnCancel:oa};for(var ta=aa.querySelector(".geCommentTxt"),na=aa.querySelector(".geCommentActionsList"),wa=aa.querySelectorAll(".geCommentEditTxtArea, .geCommentEditBtns, .geCommentAnchorRowEdit"),ya=
-0;ya<wa.length;ya++)wa[ya].parentNode==aa&&aa.removeChild(wa[ya]);var Aa=q(P.content,ta.offsetHeight);aa.insertBefore(Aa,ta);var Ca=null;ja&&null==P.id&&null==P.pCommentId&&(Ca=document.createElement("div"),Ca.className="geCommentAnchorRow geCommentAnchorRowEdit",f(P,Ca,!0),aa.insertBefore(Ca,ta));var ua=document.createElement("div");ua.className="geCommentEditBtns";var qa=mxUtils.button(mxResources.get("cancel"),function(){oa?(aa.parentNode.removeChild(aa),A()):ra();m=null});qa.className="geCommentEditBtn";
-ua.appendChild(qa);var ha=mxUtils.button(mxResources.get("save"),function(){P.content=k(Aa);M(ta,P.content);ra();null!=Ca&&f(P,Ca,!1);ea(P);m=null});mxEvent.addListener(Aa,"keydown",mxUtils.bind(this,function(ia){mxEvent.isConsumed(ia)||((mxEvent.isControlDown(ia)||mxClient.IS_MAC&&mxEvent.isMetaDown(ia))&&13==ia.keyCode?(ha.click(),mxEvent.consume(ia)):27==ia.keyCode&&(qa.click(),mxEvent.consume(ia)))}));ha.focus();ha.className="geCommentEditBtn gePrimaryBtn";ua.appendChild(ha);aa.insertBefore(ua,
+mxEvent.consume(za)});na.appendChild(pa)})(ya[qa],qa)}var na=null,wa=0,ya=[],Aa=null,Da=null,ua=null;mxEvent.addListener(P,"keydown",function(qa){null==na||mxEvent.isConsumed(qa)||(40==qa.keyCode||38==qa.keyCode?(wa=(wa+(40==qa.keyCode?1:ya.length-1))%ya.length,sa(),qa.preventDefault(),mxEvent.consume(qa)):13!=qa.keyCode&&9!=qa.keyCode||mxEvent.isControlDown(qa)||mxEvent.isMetaDown(qa)?27==qa.keyCode&&(aa(),qa.preventDefault(),mxEvent.consume(qa)):(oa(ya[wa]),qa.preventDefault(),mxEvent.consume(qa)))});
+mxEvent.addListener(P,"input",sa);mxEvent.addListener(P,"keyup",function(qa){37!=qa.keyCode&&39!=qa.keyCode&&35!=qa.keyCode&&36!=qa.keyCode||sa()});mxEvent.addListener(P,"blur",function(){window.setTimeout(aa,200)});mxEvent.addListener(P,"paste",function(qa){qa.preventDefault();qa=null!=qa.clipboardData?qa.clipboardData.getData("text/plain"):null;null!=qa&&0<qa.length&&document.execCommand("insertText",!1,qa)})}function q(P,aa){if(N){var ea=document.createElement("div");ea.contentEditable=!0;M(ea,
+P);n(ea)}else ea=document.createElement("textarea"),ea.value=P;ea.className="geCommentEditTxtArea";ea.style.minHeight=aa+"px";return ea}function t(P,aa,ea,oa){function sa(){aa.removeChild(Aa);aa.removeChild(ua);na.style.display="block";ta.style.display="block"}m={div:aa,comment:P,saveCallback:ea,deleteOnCancel:oa};for(var ta=aa.querySelector(".geCommentTxt"),na=aa.querySelector(".geCommentActionsList"),wa=aa.querySelectorAll(".geCommentEditTxtArea, .geCommentEditBtns, .geCommentAnchorRowEdit"),ya=
+0;ya<wa.length;ya++)wa[ya].parentNode==aa&&aa.removeChild(wa[ya]);var Aa=q(P.content,ta.offsetHeight);aa.insertBefore(Aa,ta);var Da=null;ja&&null==P.id&&null==P.pCommentId&&(Da=document.createElement("div"),Da.className="geCommentAnchorRow geCommentAnchorRowEdit",f(P,Da,!0),aa.insertBefore(Da,ta));var ua=document.createElement("div");ua.className="geCommentEditBtns";var qa=mxUtils.button(mxResources.get("cancel"),function(){oa?(aa.parentNode.removeChild(aa),A()):sa();m=null});qa.className="geCommentEditBtn";
+ua.appendChild(qa);var ha=mxUtils.button(mxResources.get("save"),function(){P.content=k(Aa);M(ta,P.content);sa();null!=Da&&f(P,Da,!1);ea(P);m=null});mxEvent.addListener(Aa,"keydown",mxUtils.bind(this,function(ia){mxEvent.isConsumed(ia)||((mxEvent.isControlDown(ia)||mxClient.IS_MAC&&mxEvent.isMetaDown(ia))&&13==ia.keyCode?(ha.click(),mxEvent.consume(ia)):27==ia.keyCode&&(qa.click(),mxEvent.consume(ia)))}));ha.focus();ha.className="geCommentEditBtn gePrimaryBtn";ua.appendChild(ha);aa.insertBefore(ua,
ta);na.style.display="none";ta.style.display="none";Aa.focus()}function r(P,aa){aa.innerText="";P=new Date(P.modifiedDate);var ea=b.timeSince(P);null==ea&&(ea=mxResources.get("lessThanAMinute"));mxUtils.write(aa,mxResources.get("timeAgo",[ea],"{1} ago"));aa.setAttribute("title",P.toLocaleDateString()+" "+P.toLocaleTimeString())}function z(P){var aa=document.createElement("img");aa.className="geCommentBusyImg";aa.src=IMAGE_PATH+"/spin.gif";P.appendChild(aa);P.busyImg=aa}function D(P){P.style.border=
-"1px solid red";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function H(P){P.style.border="";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function B(P,aa,ea,oa,ra){function ta(ha,ia,pa){var za=document.createElement("li");za.className="geCommentAction";var fa=document.createElement("a");fa.className="geCommentActionLnk";mxUtils.write(fa,ha);za.appendChild(fa);mxEvent.addListener(fa,"click",function(ka){ia(ka,P);ka.preventDefault();mxEvent.consume(ka)});qa.appendChild(za);pa&&(za.style.display=
+"1px solid red";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function H(P){P.style.border="";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function B(P,aa,ea,oa,sa){function ta(ha,ia,pa){var za=document.createElement("li");za.className="geCommentAction";var fa=document.createElement("a");fa.className="geCommentActionLnk";mxUtils.write(fa,ha);za.appendChild(fa);mxEvent.addListener(fa,"click",function(ka){ia(ka,P);ka.preventDefault();mxEvent.consume(ka)});qa.appendChild(za);pa&&(za.style.display=
"none")}function na(){function ha(za){ia.push(pa);if(null!=za.replies)for(var fa=0;fa<za.replies.length;fa++)pa=pa.nextSibling,ha(za.replies[fa])}var ia=[],pa=ya;ha(P);return{pdiv:pa,replies:ia}}function wa(ha,ia,pa,za,fa){function ka(){z(la);P.addReply(ma,function(Ea){ma.id=Ea;P.replies.push(ma);H(la);pa&&pa();b.commentsUpdated()},function(Ea){xa();D(la);b.handleError(Ea,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},za,fa)}function xa(){t(ma,la,function(Ea){ka()},!0)}var Ba=
-na().pdiv,ma=b.newComment(ha,b.getCurrentUser());ma.pCommentId=P.id;null==P.replies&&(P.replies=[]);var la=B(ma,P.replies,Ba,oa+1);ia?xa():ka()}if(ra||!P.isResolved){G.style.display="none";var ya=document.createElement("div");ya.className="geCommentContainer";ya.setAttribute("data-commentId",P.id);ya.style.marginLeft=20*oa+5+"px";P.isResolved&&(x.style.opacity="0.7");var Aa=document.createElement("div");Aa.className="geCommentHeader";var Ca=document.createElement("img");Ca.className="geCommentUserImg";
-Ca.src=null!=P.user&&null!=P.user.pictureUrl?P.user.pictureUrl:Editor.userImage;Aa.appendChild(Ca);Ca=document.createElement("div");Ca.className="geCommentHeaderTxt";Aa.appendChild(Ca);var ua=document.createElement("div");ua.className="geCommentUsername";mxUtils.write(ua,null!=P.user?P.user.displayName:mxResources.get("unknownUser"));Ca.appendChild(ua);ua=document.createElement("div");ua.className="geCommentDate";ua.setAttribute("data-commentId",P.id);r(P,ua);Ca.appendChild(ua);ya.appendChild(Aa);
+na().pdiv,ma=b.newComment(ha,b.getCurrentUser());ma.pCommentId=P.id;null==P.replies&&(P.replies=[]);var la=B(ma,P.replies,Ba,oa+1);ia?xa():ka()}if(sa||!P.isResolved){G.style.display="none";var ya=document.createElement("div");ya.className="geCommentContainer";ya.setAttribute("data-commentId",P.id);ya.style.marginLeft=20*oa+5+"px";P.isResolved&&(x.style.opacity="0.7");var Aa=document.createElement("div");Aa.className="geCommentHeader";var Da=document.createElement("img");Da.className="geCommentUserImg";
+Da.src=null!=P.user&&null!=P.user.pictureUrl?P.user.pictureUrl:Editor.userImage;Aa.appendChild(Da);Da=document.createElement("div");Da.className="geCommentHeaderTxt";Aa.appendChild(Da);var ua=document.createElement("div");ua.className="geCommentUsername";mxUtils.write(ua,null!=P.user?P.user.displayName:mxResources.get("unknownUser"));Da.appendChild(ua);ua=document.createElement("div");ua.className="geCommentDate";ua.setAttribute("data-commentId",P.id);r(P,ua);Da.appendChild(ua);ya.appendChild(Aa);
ja&&0==oa&&null!=P.getAnchorCellId&&null!=P.anchor&&(null!=P.getAnchorCellIds()&&ya.setAttribute("data-anchor-cell",P.getAnchorCellIds().join(",")),null!=P.id&&(Aa=document.createElement("div"),Aa.className="geCommentAnchorRow",f(P,Aa,!1),ya.appendChild(Aa)));Aa=document.createElement("div");Aa.className="geCommentTxt";M(Aa,P.content);ya.appendChild(Aa);P.isLocked&&(ya.style.opacity="0.5");Aa=document.createElement("div");Aa.className="geCommentActions";var qa=document.createElement("ul");qa.className=
-"geCommentActionsList";Aa.appendChild(qa);W||P.isLocked||0!=oa&&!I||ta(mxResources.get("reply"),function(){wa("",!0)},P.isResolved);Ca=b.getCurrentUser();null==Ca||null==P.user||Ca.id!=P.user.id||W||P.isLocked||(ta(mxResources.get("edit"),function(){function ha(){t(P,ya,function(){z(ya);P.editComment(P.content,function(){H(ya);b.commentsUpdated()},function(ia){D(ya);ha();b.handleError(ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}ha()},P.isResolved),ta(mxResources.get("delete"),
+"geCommentActionsList";Aa.appendChild(qa);W||P.isLocked||0!=oa&&!I||ta(mxResources.get("reply"),function(){wa("",!0)},P.isResolved);Da=b.getCurrentUser();null==Da||null==P.user||Da.id!=P.user.id||W||P.isLocked||(ta(mxResources.get("edit"),function(){function ha(){t(P,ya,function(){z(ya);P.editComment(P.content,function(){H(ya);b.commentsUpdated()},function(ia){D(ya);ha();b.handleError(ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}ha()},P.isResolved),ta(mxResources.get("delete"),
function(){b.confirm(mxResources.get("areYouSure"),function(){z(ya);P.deleteComment(function(ha){if(!0===ha){ha=ya.querySelector(".geCommentTxt");ha.innerText="";mxUtils.write(ha,mxResources.get("msgDeleted"));var ia=ya.querySelectorAll(".geCommentAction");for(ha=0;ha<ia.length;ha++)ia[ha].parentNode.removeChild(ia[ha]);H(ya);ya.style.opacity="0.5"}else{ia=na(P).replies;for(ha=0;ha<ia.length;ha++)F.removeChild(ia[ha]);for(ha=0;ha<aa.length;ha++)if(aa[ha]==P){aa.splice(ha,1);break}G.style.display=
0==F.getElementsByTagName("div").length?"block":"none"}b.commentsUpdated()},function(ha){D(ya);b.handleError(ha,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},P.isResolved));W||P.isLocked||0!=oa||ta(P.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(ha){function ia(){var pa=ha.target;pa.innerText="";P.isResolved=!P.isResolved;mxUtils.write(pa,P.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var za=P.isResolved?"none":"",fa=
na(P).replies,ka="light-dark("+(P.isResolved?"ghostWhite":"white")+", transparent)",xa=0;xa<fa.length;xa++){fa[xa].style.backgroundColor=ka;for(var Ba=fa[xa].querySelectorAll(".geCommentAction"),ma=0;ma<Ba.length;ma++)Ba[ma]!=pa.parentNode&&(Ba[ma].style.display=za);Z||(fa[xa].style.display="none")}A()}P.isResolved?wa(mxResources.get("reOpened")+": ",!0,ia,!1,!0):wa(mxResources.get("markedAsResolved"),!1,ia,!0)});ya.appendChild(Aa);null!=ea?F.insertBefore(ya,ea.nextSibling):F.appendChild(ya);for(ea=
-0;null!=P.replies&&ea<P.replies.length;ea++)Aa=P.replies[ea],Aa.isResolved=P.isResolved,B(Aa,P.replies,null,oa+1,ra);null!=m&&(m.comment.id==P.id?(ra=P.content,P.content=m.comment.content,t(P,ya,m.saveCallback,m.deleteOnCancel),P.content=ra):null==m.comment.id&&m.comment.pCommentId==P.id&&(F.appendChild(m.div),t(m.comment,m.div,m.saveCallback,m.deleteOnCancel)));return ya}}var W=!b.canComment(),I=b.canReplyToReplies(),N=b.mentionsSupported(),U=N&&b.mentionsLiveSearch(),S=N&&b.freeMentionsSupported(),
+0;null!=P.replies&&ea<P.replies.length;ea++)Aa=P.replies[ea],Aa.isResolved=P.isResolved,B(Aa,P.replies,null,oa+1,sa);null!=m&&(m.comment.id==P.id?(sa=P.content,P.content=m.comment.content,t(P,ya,m.saveCallback,m.deleteOnCancel),P.content=sa):null==m.comment.id&&m.comment.pCommentId==P.id&&(F.appendChild(m.div),t(m.comment,m.div,m.saveCallback,m.deleteOnCancel)));return ya}}var W=!b.canComment(),I=b.canReplyToReplies(),N=b.mentionsSupported(),U=N&&b.mentionsLiveSearch(),S=N&&b.freeMentionsSupported(),
V=!N||b.mentionNotificationsSupported(),ja=b.anchoredCommentsSupported(),v=[],d=null,m=null,x=document.createElement("div");x.className="geCommentsWin";var C=EditorUi.compactUi?"26px":"30px",F=document.createElement("div");F.className="geCommentsList";F.style.bottom=parseInt(C)+7+"px";x.appendChild(F);var G=document.createElement("span");G.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(G,mxResources.get("noCommentsFound"));var K=document.createElement("div");K.className=
-"geToolbarContainer geCommentsToolbar";K.style.height=C;K.style.padding="3px 4px 4px 4px";C=document.createElement("a");C.className="geButton";N&&!U&&b.getMentionCandidates(function(P){v=P;P=F.querySelectorAll(".geCommentMention[data-email]");for(var aa=0;aa<P.length;aa++)P[aa].innerText="",mxUtils.write(P[aa],"@"+E(P[aa].getAttribute("data-email")))},function(){});var Q=mxUtils.bind(this,function(P){function aa(){t(ea,oa,function(ra){z(oa);b.addComment(ra,function(ta){ra.id=ta;X.push(ra);H(oa);b.commentsUpdated()},
+"geToolbarContainer geCommentsToolbar";K.style.height=C;K.style.padding="3px 4px 4px 4px";C=document.createElement("a");C.className="geButton";N&&!U&&b.getMentionCandidates(function(P){v=P;P=F.querySelectorAll(".geCommentMention[data-email]");for(var aa=0;aa<P.length;aa++)P[aa].innerText="",mxUtils.write(P[aa],"@"+E(P[aa].getAttribute("data-email")))},function(){});var Q=mxUtils.bind(this,function(P){function aa(){t(ea,oa,function(sa){z(oa);b.addComment(sa,function(ta){sa.id=ta;X.push(sa);H(oa);b.commentsUpdated()},
function(ta){D(oa);aa();b.handleError(ta,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}if(!W){var ea=b.newComment("",b.getCurrentUser());ea.anchor=null!=P?P:null;var oa=B(ea,X,null,0);aa()}});this.startNewComment=Q;if(!W){var ba=C.cloneNode();ba.style.backgroundImage="url("+Editor.plusImage+")";ba.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(ba,"click",function(P){Q();P.preventDefault();mxEvent.consume(P)});K.appendChild(ba)}var T=C.cloneNode();
T.style.backgroundImage="url("+Editor.checkImage+")";T.setAttribute("title",mxResources.get("showResolved"));var Z=!1;mxEvent.addListener(T,"click",function(P){(Z=!Z)?T.classList.add("geActiveItem"):T.classList.remove("geActiveItem");Y();P.preventDefault();mxEvent.consume(P)});K.appendChild(T);b.commentsRefreshNeeded()&&(ba=C.cloneNode(),ba.style.backgroundImage="url("+Editor.refreshImage+")",ba.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(ba,"click",function(P){Y();P.preventDefault();
mxEvent.consume(P)}),K.appendChild(ba));b.commentsSaveNeeded()&&(C=C.cloneNode(),C.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',C.setAttribute("title",mxResources.get("save")),C.className="geButton geAdaptiveAsset",mxEvent.addListener(C,"click",function(P){y();P.preventDefault();mxEvent.consume(P)}),K.appendChild(C));x.appendChild(K);var X=[],da=function(P){if(null!=d){for(var aa=F.childNodes,ea=0;ea<aa.length;ea++)if(null!=aa[ea].getAttribute&&null!=aa[ea].getAttribute("data-anchor-cell")&&
-0<=mxUtils.indexOf(aa[ea].getAttribute("data-anchor-cell").split(","),d)){F.scrollTop=aa[ea].offsetTop-F.offsetTop;d=null;break}P&&(d=null)}};this.scrollToCell=function(P){d=P;da(!1)};var R=mxUtils.bind(this,function(P){function aa(oa){if(null!=oa){oa.sort(function(ta,na){return new Date(ta.modifiedDate)-new Date(na.modifiedDate)});for(var ra=0;ra<oa.length;ra++)aa(oa[ra].replies)}}P.sort(function(oa,ra){return new Date(oa.modifiedDate)-new Date(ra.modifiedDate)});if(null!=m){var ea=m.div.querySelector(".geCommentEditTxtArea");
+0<=mxUtils.indexOf(aa[ea].getAttribute("data-anchor-cell").split(","),d)){F.scrollTop=aa[ea].offsetTop-F.offsetTop;d=null;break}P&&(d=null)}};this.scrollToCell=function(P){d=P;da(!1)};var R=mxUtils.bind(this,function(P){function aa(oa){if(null!=oa){oa.sort(function(ta,na){return new Date(ta.modifiedDate)-new Date(na.modifiedDate)});for(var sa=0;sa<oa.length;sa++)aa(oa[sa].replies)}}P.sort(function(oa,sa){return new Date(oa.modifiedDate)-new Date(sa.modifiedDate)});if(null!=m){var ea=m.div.querySelector(".geCommentEditTxtArea");
null!=ea&&(m.comment.content=k(ea))}ea=F.scrollTop;F.innerText="";F.appendChild(G);G.style.display="block";X=P;for(P=0;P<X.length;P++)aa(X[P].replies),B(X[P],X,null,0,Z);null!=m&&null==m.comment.id&&null==m.comment.pCommentId&&(F.appendChild(m.div),t(m.comment,m.div,m.saveCallback,m.deleteOnCancel));F.scrollTop=ea;da(!0)}),Y=mxUtils.bind(this,function(){this.hasError=!1;if(null!=m)try{m.div=m.div.cloneNode(!0);var P=m.div.querySelector(".geCommentEditTxtArea"),aa=m.div.querySelector(".geCommentEditBtns");
m.comment.content=k(P);P.parentNode.removeChild(P);aa.parentNode.removeChild(aa)}catch(ea){b.handleError(ea)}I=b.canReplyToReplies();b.commentsSupported()?(null!=b.getCommentCacheTarget().commentCache?null==m&&R(b.getCommentCacheTarget().commentCache):F.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>",b.refreshCommentCache(mxUtils.bind(this,function(ea){null!=ea&&null!=m&&
R(ea)}),mxUtils.bind(this,function(ea){null==b.getCommentCacheTarget().commentCache&&(F.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ea&&ea.message?": "+ea.message:"")),this.hasError=!0)}))):F.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))}),ca=mxUtils.bind(this,function(){if(null==m){var P=b.getCommentCacheTarget().commentCache;null!=P&&(this.hasError=!1,R(P))}});b.addListener("commentsChanged",ca);Y();this.refreshComments=Y;K=mxUtils.bind(this,function(){function P(ta){var na=
-ea[ta.id];if(null!=na)for(r(ta,na),na=0;null!=ta.replies&&na<ta.replies.length;na++)P(ta.replies[na])}if(this.window.isVisible()){for(var aa=F.querySelectorAll(".geCommentDate"),ea={},oa=0;oa<aa.length;oa++){var ra=aa[oa];ea[ra.getAttribute("data-commentId")]=ra}for(oa=0;oa<X.length;oa++)P(X[oa])}});setInterval(K,6E4);this.refreshCommentsTime=K;this.window=new mxWindow(mxResources.get("comments"),x,l,p,g,u,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
+ea[ta.id];if(null!=na)for(r(ta,na),na=0;null!=ta.replies&&na<ta.replies.length;na++)P(ta.replies[na])}if(this.window.isVisible()){for(var aa=F.querySelectorAll(".geCommentDate"),ea={},oa=0;oa<aa.length;oa++){var sa=aa[oa];ea[sa.getAttribute("data-commentId")]=sa}for(oa=0;oa<X.length;oa++)P(X[oa])}});setInterval(K,6E4);this.refreshCommentsTime=K;this.window=new mxWindow(mxResources.get("comments"),x,l,p,g,u,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0,function(){b.removeListener(ca)})},ConfirmDialog=function(b,l,p,g,u,y,A,E,J,M,L){var O=document.createElement("div");O.style.textAlign="center";L=null!=L?L:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=L+"px";c.style.lineHeight="1.2em";mxUtils.write(c,
l);O.appendChild(c);null!=M&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",l=document.createElement("img"),l.setAttribute("src",M),c.appendChild(l),O.appendChild(c));M=document.createElement("div");M.style.textAlign="center";M.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");y=mxUtils.button(y||mxResources.get("cancel"),function(){b.hideDialog();null!=g&&g(f.checked)});y.className="geBtn";null!=E&&(y.innerHTML=E+"<br>"+y.innerHTML,
y.style.display="inline-block",y.style.paddingBottom="8px",y.style.paddingTop="8px",y.style.height="auto",y.style.width="40%");b.editor.cancelFirst&&M.appendChild(y);var k=mxUtils.button(u||mxResources.get("ok"),function(){b.hideDialog();null!=p&&p(f.checked)});M.appendChild(k);null!=A?(k.innerHTML=A+"<br>"+k.innerHTML+"<br>",k.style.display="inline-block",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height="auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";
@@ -14910,15 +14920,15 @@ G[R].forEach(function(ca,P){P=Y[P];if(null!=P){ca=ca.i18n||J(ca.key);var aa=A(ca
R.classList.remove("input--invalid");R.removeAttribute("aria-invalid");R=R.nextElementSibling;null!=R&&R.classList.contains("field__error")&&R.parentNode.removeChild(R)}function c(R){var Y=u("#"+R+"-tags"),ca="";ja[R].forEach(function(P,aa){var ea=null!==P&&"object"===typeof P,oa=ea?String(P.fontFamily||""):String(P);P=ea&&P.fontUrl?String(P.fontUrl):null;ca+='<span class="tag"'+(null!=P?' title="'+g(P).replace(/"/g,"&quot;").replace(/'/g,"&#39;")+'"':"")+"><span>"+g(oa)+"</span>"+(null!=P?'<span class="tag__link">&#8599;</span>':
"")+'<button type="button" class="tag__remove" data-list="'+R+'" data-index="'+aa+'">&times;</button></span>'});Y.innerHTML=ca;Y.querySelectorAll(".tag__remove").forEach(function(P){P.addEventListener("click",function(){ja[P.getAttribute("data-list")].splice(parseInt(P.getAttribute("data-index")),1);f(P.getAttribute("data-list"));c(P.getAttribute("data-list"))})})}function f(R){0<ja[R].length?V[R]=ja[R].slice():delete V[R];p()}function k(R){function Y(){var ea=P.value.trim(),oa=aa.value.trim();ea&&
(ja[R].push(oa?{fontFamily:ea,fontUrl:oa}:ea),P.value="",aa.value="",f(R),c(R))}function ca(ea){"Enter"===ea.key&&(ea.preventDefault(),Y())}var P=u("#"+R+"-input"),aa=u("#"+R+"-url");u("#"+R+"-add").addEventListener("click",Y);P.addEventListener("keydown",ca);aa.addEventListener("keydown",ca);c(R)}function n(R){var Y=u("#"+R+"-list");Y.innerHTML="";v[R].forEach(function(ca,P){var aa="none"===ca||"null"===ca,ea=document.createElement("div");ea.className="color-swatch";ea.title=aa?ca:"#"+ca;aa?ea.style.cssText=
-"background: transparent; background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%); background-size: 8px 8px; background-position: 0 0, 4px 4px;":ea.style.background="#"+ca;if(!aa){var oa=document.createElement("input");oa.type="color";oa.className="color-swatch__picker";oa.value="#"+(3===ca.length?ca[0]+ca[0]+ca[1]+ca[1]+ca[2]+ca[2]:ca.padEnd(6,"0"));oa.addEventListener("input",function(ra){return function(){var ta=
-oa.value.substring(1).toUpperCase();v[R][ra]=ta;ea.style.background="#"+ta;ea.title="#"+ta;q(R)}}(P));ea.appendChild(oa)}ca=document.createElement("button");ca.className="color-swatch__delete";ca.textContent="×";ca.addEventListener("click",function(ra){return function(ta){ta.stopPropagation();v[R].splice(ra,1);q(R);n(R)}}(P));ea.appendChild(ca);Y.appendChild(ea)})}function q(R){0<v[R].length?V[R]=v[R].slice():delete V[R];p()}function t(R){function Y(){var ea=P.value.trim().replace(/^#/,"");"none"===
+"background: transparent; background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%); background-size: 8px 8px; background-position: 0 0, 4px 4px;":ea.style.background="#"+ca;if(!aa){var oa=document.createElement("input");oa.type="color";oa.className="color-swatch__picker";oa.value="#"+(3===ca.length?ca[0]+ca[0]+ca[1]+ca[1]+ca[2]+ca[2]:ca.padEnd(6,"0"));oa.addEventListener("input",function(sa){return function(){var ta=
+oa.value.substring(1).toUpperCase();v[R][sa]=ta;ea.style.background="#"+ta;ea.title="#"+ta;q(R)}}(P));ea.appendChild(oa)}ca=document.createElement("button");ca.className="color-swatch__delete";ca.textContent="×";ca.addEventListener("click",function(sa){return function(ta){ta.stopPropagation();v[R].splice(sa,1);q(R);n(R)}}(P));ea.appendChild(ca);Y.appendChild(ea)})}function q(R){0<v[R].length?V[R]=v[R].slice():delete V[R];p()}function t(R){function Y(){var ea=P.value.trim().replace(/^#/,"");"none"===
ea||"null"===ea?(v[R].push(ea),P.value="",q(R),n(R)):/^[0-9A-Fa-f]{3,8}$/.test(ea)&&(v[R].push(ea.toUpperCase()),P.value="",q(R),n(R))}var ca=u("#"+R+"-picker"),P=u("#"+R+"-input"),aa=u("#"+R+"-add");ca.addEventListener("input",function(){P.value=ca.value.substring(1).toUpperCase()});aa.addEventListener("click",Y);P.addEventListener("keydown",function(ea){"Enter"===ea.key&&(ea.preventDefault(),Y())});n(R)}function r(R){var Y=u("#"+R+"-editor");Y.innerHTML="";m[R].forEach(function(ca,P){var aa=document.createElement("div");
-aa.className="color-scheme-row";var ea=document.createElement("span");ea.className="color-scheme-row__label";ea.textContent=P+1;aa.appendChild(ea);ca.forEach(function(na,wa){if(null===na){var ya=document.createElement("span");ya.className="color-scheme-entry";ya.innerHTML='<span style="color: var(--color-text-secondary); font-style: italic;">default</span>';var Aa=document.createElement("button");Aa.className="color-scheme-entry__remove";Aa.textContent="×";Aa.addEventListener("click",function(Ca,
-ua){return function(){m[R][Ca].splice(ua,1);z(R);r(R)}}(P,wa));ya.appendChild(Aa);aa.appendChild(ya)}else K.forEach(function(Ca){if(na[Ca]){var ua=document.createElement("span");ua.className="color-scheme-entry";var qa=document.createElement("span");qa.className="color-scheme-entry__swatch";qa.style.background=na[Ca];var ha=document.createElement("input");ha.type="color";ha.value=na[Ca];ha.addEventListener("input",function(za,fa,ka){return function(){m[R][za][fa][ka]=ha.value;qa.style.background=
-ha.value;z(R)}}(P,wa,Ca));qa.appendChild(ha);var ia=document.createElement("span");ia.className="color-scheme-entry__key";ia.textContent=Ca.charAt(0).toUpperCase();ia.title=Ca;var pa=document.createElement("button");pa.className="color-scheme-entry__remove";pa.textContent="×";pa.addEventListener("click",function(za,fa,ka){return function(){delete m[R][za][fa][ka];0===Object.keys(m[R][za][fa]).filter(function(xa){return-1<K.indexOf(xa)}).length&&m[R][za].splice(fa,1);z(R);r(R)}}(P,wa,Ca));ua.appendChild(qa);
+aa.className="color-scheme-row";var ea=document.createElement("span");ea.className="color-scheme-row__label";ea.textContent=P+1;aa.appendChild(ea);ca.forEach(function(na,wa){if(null===na){var ya=document.createElement("span");ya.className="color-scheme-entry";ya.innerHTML='<span style="color: var(--color-text-secondary); font-style: italic;">default</span>';var Aa=document.createElement("button");Aa.className="color-scheme-entry__remove";Aa.textContent="×";Aa.addEventListener("click",function(Da,
+ua){return function(){m[R][Da].splice(ua,1);z(R);r(R)}}(P,wa));ya.appendChild(Aa);aa.appendChild(ya)}else K.forEach(function(Da){if(na[Da]){var ua=document.createElement("span");ua.className="color-scheme-entry";var qa=document.createElement("span");qa.className="color-scheme-entry__swatch";qa.style.background=na[Da];var ha=document.createElement("input");ha.type="color";ha.value=na[Da];ha.addEventListener("input",function(za,fa,ka){return function(){m[R][za][fa][ka]=ha.value;qa.style.background=
+ha.value;z(R)}}(P,wa,Da));qa.appendChild(ha);var ia=document.createElement("span");ia.className="color-scheme-entry__key";ia.textContent=Da.charAt(0).toUpperCase();ia.title=Da;var pa=document.createElement("button");pa.className="color-scheme-entry__remove";pa.textContent="×";pa.addEventListener("click",function(za,fa,ka){return function(){delete m[R][za][fa][ka];0===Object.keys(m[R][za][fa]).filter(function(xa){return-1<K.indexOf(xa)}).length&&m[R][za].splice(fa,1);z(R);r(R)}}(P,wa,Da));ua.appendChild(qa);
ua.appendChild(ia);ua.appendChild(pa);aa.appendChild(ua)}})});ca=document.createElement("span");ca.className="color-scheme-row__actions";ea=document.createElement("button");ea.className="color-scheme-row__btn";ea.textContent="+";ea.title="Add colour entry";ea.addEventListener("click",function(na){return function(){m[R][na].push({fill:"#dae8fc",stroke:"#6c8ebf"});z(R);r(R)}}(P));var oa=document.createElement("button");oa.className="color-scheme-row__btn";oa.textContent="ø";oa.title="Add default (null) entry";
-oa.addEventListener("click",function(na){return function(){m[R][na].unshift(null);z(R);r(R)}}(P));var ra=document.createElement("button");ra.className="color-scheme-row__btn";ra.title="Add colour key to last entry";ra.textContent="key";ra.addEventListener("click",function(na){return function(){for(var wa=m[R][na],ya=null,Aa=wa.length-1;0<=Aa;Aa--)if(null!==wa[Aa]){ya=wa[Aa];break}if(ya){wa=null;for(Aa=0;Aa<K.length;Aa++)if(!ya[K[Aa]]){wa=K[Aa];break}wa&&(ya[wa]="#888888",z(R),r(R))}}}(P));var ta=
-document.createElement("button");ta.className="color-scheme-row__btn";ta.textContent="−";ta.title="Remove row";ta.addEventListener("click",function(na){return function(){m[R].splice(na,1);z(R);r(R)}}(P));ca.appendChild(oa);ca.appendChild(ea);ca.appendChild(ra);ca.appendChild(ta);aa.appendChild(ca);Y.appendChild(aa)})}function z(R){0<m[R].length?V[R]=JSON.parse(JSON.stringify(m[R])):delete V[R];p()}function D(R){u("#"+R+"-addRow").addEventListener("click",function(){m[R].push([null,{fill:"#f5f5f5",
+oa.addEventListener("click",function(na){return function(){m[R][na].unshift(null);z(R);r(R)}}(P));var sa=document.createElement("button");sa.className="color-scheme-row__btn";sa.title="Add colour key to last entry";sa.textContent="key";sa.addEventListener("click",function(na){return function(){for(var wa=m[R][na],ya=null,Aa=wa.length-1;0<=Aa;Aa--)if(null!==wa[Aa]){ya=wa[Aa];break}if(ya){wa=null;for(Aa=0;Aa<K.length;Aa++)if(!ya[K[Aa]]){wa=K[Aa];break}wa&&(ya[wa]="#888888",z(R),r(R))}}}(P));var ta=
+document.createElement("button");ta.className="color-scheme-row__btn";ta.textContent="−";ta.title="Remove row";ta.addEventListener("click",function(na){return function(){m[R].splice(na,1);z(R);r(R)}}(P));ca.appendChild(oa);ca.appendChild(ea);ca.appendChild(sa);ca.appendChild(ta);aa.appendChild(ca);Y.appendChild(aa)})}function z(R){0<m[R].length?V[R]=JSON.parse(JSON.stringify(m[R])):delete V[R];p()}function D(R){u("#"+R+"-addRow").addEventListener("click",function(){m[R].push([null,{fill:"#f5f5f5",
stroke:"#666666"}]);z(R);r(R)});r(R)}function H(R){var Y=u("#"+R+"-tags"),ca="";d[R].forEach(function(P,aa){ca+='<span class="tag"><span>'+g(P)+'</span><button type="button" class="tag__remove" data-list="'+R+'" data-index="'+aa+'">&times;</button></span>'});Y.innerHTML=ca;Y.querySelectorAll(".tag__remove").forEach(function(P){P.addEventListener("click",function(){d[P.getAttribute("data-list")].splice(parseInt(P.getAttribute("data-index")),1);B(P.getAttribute("data-list"));H(P.getAttribute("data-list"))})})}
function B(R){0<d[R].length?V[R]=d[R].slice():delete V[R];p()}function W(R){function Y(){var P=ca.value.trim();P&&(d[R].push(P),ca.value="",B(R),H(R))}var ca=u("#"+R+"-input");u("#"+R+"-add").addEventListener("click",Y);ca.addEventListener("keydown",function(P){"Enter"===P.key&&(P.preventDefault(),Y())});H(R)}function I(R){var Y=V.defaultMacroParameters||{},ca=Q[R];ca.selects.forEach(function(P){u("#"+R+"-"+P).value=Y[P]||""});ca.numbers.forEach(function(P){u("#"+R+"-"+P).value=void 0!==Y[P]?Y[P]:
""});ca.booleans.forEach(function(P){var aa=u("#"+R+"-"+P);void 0!==Y[P]?(aa.checked=Y[P],aa.indeterminate=!1,aa.dataset.cycleState=Y[P]?"checked":"unchecked"):(aa.checked=!1,aa.indeterminate=!0,aa.dataset.cycleState="indeterminate")})}function N(R){R=R||{};V={};ja={defaultFonts:[],customFonts:[]};v={presetColors:[],customPresetColors:[],defaultColors:[]};d={enabledLibraries:[],defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[],enabledTemplateSections:[],defaultLanguages:[]};m={defaultColorSchemes:[],
@@ -14927,7 +14937,7 @@ Y||"defaultLanguages"===Y?Array.isArray(ca)&&(d[Y]=ca.map(function(P){return Str
ca;R.disabled=!ca;R.value=ca?V.tooltipMaxWidth:""}else Y.checked=!0,R.disabled=!1,R.value="";V.pageFormat?(u("#cfg-pageFormatWidth").value=V.pageFormat.width||"",u("#cfg-pageFormatHeight").value=V.pageFormat.height||""):(u("#cfg-pageFormatWidth").value="",u("#cfg-pageFormatHeight").value="");R=V.darkColor||"";/^#[0-9A-Fa-f]{6}$/.test(R)&&(u("#cfg-darkColorPicker").value=R);R=V.shadowColor||"";/^#[0-9A-Fa-f]{6}$/.test(R)&&(u("#cfg-shadowColorPicker").value=R);["defaultGridColor","defaultDarkGridColor",
"defaultPageBackgroundColor","defaultDarkPageBackgroundColor"].forEach(function(P){var aa=V[P]||"";/^#[0-9A-Fa-f]{6}$/.test(aa)&&(u("#cfg-"+P+"Picker").value=aa)});y(".tri-toggle").forEach(function(P){var aa=P.getAttribute("data-key");aa=V[aa];P.querySelectorAll("button").forEach(function(ea){ea.className=""});!0===aa?P.querySelector('[data-value="true"]').className="active--true":!1===aa?P.querySelector('[data-value="false"]').className="active--false":P.querySelector('[data-value="unset"]').className=
"active--unset"});["defaultFonts","customFonts"].forEach(c);["presetColors","customPresetColors","defaultColors"].forEach(n);"enabledLibraries defaultCustomLibraries hideMenuItems hideMenus enabledTemplateSections defaultLanguages".split(" ").forEach(H);["defaultColorSchemes","customColorSchemes"].forEach(r);ba.forEach(I)}function S(R){if(R=R.trim().toLowerCase()){var Y=R.split(/\s+/),ca=new Set,P=new Set,aa=0;X.forEach(function(ea){Y.every(function(oa){return-1<ea.keywords.indexOf(oa)})&&(P.add(ea.element),
-ca.add(ea.section),"section-title"!==ea.type&&aa++)});y(".config-section").forEach(function(ea){ea.classList.toggle("search-hidden",!ca.has(ea))});X.forEach(function(ea){if("section-title"!==ea.type&&ca.has(ea.section)){var oa=!1;X.forEach(function(ra){"section-title"===ra.type&&ra.section===ea.section&&P.has(ra.element)&&(oa=!0)});oa?ea.element.classList.remove("search-hidden"):ea.element.classList.toggle("search-hidden",!P.has(ea.element))}});Z.textContent=aa+" result"+(1!==aa?"s":"")}else y(".config-section, .toggle-field, .field, .field-row").forEach(function(ea){ea.classList.remove("search-hidden")}),
+ca.add(ea.section),"section-title"!==ea.type&&aa++)});y(".config-section").forEach(function(ea){ea.classList.toggle("search-hidden",!ca.has(ea))});X.forEach(function(ea){if("section-title"!==ea.type&&ca.has(ea.section)){var oa=!1;X.forEach(function(sa){"section-title"===sa.type&&sa.section===ea.section&&P.has(sa.element)&&(oa=!0)});oa?ea.element.classList.remove("search-hidden"):ea.element.classList.toggle("search-hidden",!P.has(ea.element))}});Z.textContent=aa+" result"+(1!==aa?"s":"")}else y(".config-section, .toggle-field, .field, .field-row").forEach(function(ea){ea.classList.remove("search-hidden")}),
Z.textContent=""}l=l||{};DrawioConfigEditor.installCss();b.classList.add("geConfigEditor");b.innerHTML=DrawioConfigEditor.html;var V={},ja={defaultFonts:[],customFonts:[]},v={presetColors:[],customPresetColors:[],defaultColors:[]},d={enabledLibraries:[],defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[],enabledTemplateSections:[],defaultLanguages:[]},m={defaultColorSchemes:[],customColorSchemes:[]},x={},C=l.editorContext||{},F=null!=l.isDesktop?l.isDesktop:0<=navigator.userAgent.indexOf("Electron");
(function(){y('label[for^="cfg-"]').forEach(function(ca){var P=J(ca.getAttribute("for").substring(4));P=null!=A(P+"Field")?P+"Field":P;var aa=A(P);null!=aa?ca.textContent=aa:""===ca.textContent&&(ca.textContent=P);ca=ca.closest(".field");ca=null!=ca?ca.querySelector(".field__help"):null;P=A(P+"Help");null!=ca&&null!=P&&(ca.textContent=P)});y("[data-i18n]").forEach(function(ca){ca.textContent=E(ca.getAttribute("data-i18n"))});var R=u("#searchInput"),Y=A("cfgSearchSettings");null!=R&&null!=Y&&R.setAttribute("placeholder",
Y)})();var G={"general-toggles":[{key:"override"},{key:"compact"},{key:"noAutoFocus"},{key:"showSplashOnStart"},{key:"updateDefaultStyle"},{key:"mathOutputSize"},{key:"browserTranslate"}],"canvas-toggles":[{key:"defaultPageVisible"},{key:"defaultGridEnabled"},{key:"enablePositionGuides"},{key:"enableDistanceGuides"},{key:"enableSizeGuides"},{key:"defaultConnectable"},{key:"defaultConnectionArrowsEnabled"},{key:"copyOnConnect"},{key:"defaultFoldingEnabled"},{key:"defaultTransparentGroups"},{key:"zoomWheel"},
@@ -15117,39 +15127,39 @@ mxLanguage))}catch(c){document.body.innerHTML="",O=document.createElement("pre")
"jgraph.github.io"===window.location.hostname||/drawio-dev\.pages\.dev$/.test(window.location.hostname))&&App.isSimpleThemePreferred()&&(Editor.currentTheme="simple")}catch(r){}"kennedy"!=Editor.currentTheme&&0>mxUtils.indexOf(Editor.themes,Editor.currentTheme)&&(Editor.currentTheme="kennedy");"1"==urlParams.transparent&&(document.body.style.background="transparent");var t=null!=l?l():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));"launchQueue"in window&&
"1"!=urlParams.embed&&window.launchQueue.setConsumer(function(r){null!=r.files&&0<r.files.length&&t.loadFileSystemEntry(r.files[0])});null!=window.mxscript&&("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},
"dropboxjs",App.DROPBOX_APPKEY)}):"undefined"===typeof window.Dropbox&&(window.DropboxClient=null),"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=
-null),"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null));null!=b&&b(t);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,t,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",
-EXPORT_URL))}catch(r){EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(r.stack)):(EditorUi.logError(r.message,null,null,null,r),window.setTimeout(function(){alert(r.message)},1))}}mxResources.parse(O[0].getText());try{"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(t){if(null!=t.active&&(t.active.postMessage({warmLazy:L,warmDev:"1"==urlParams.dev}),null!=Editor.defaultLanguages))for(var r=0;r<Editor.defaultLanguages.length;r++){var z=Editor.defaultLanguages[r];"string"===
-typeof z&&/^[a-z0-9-]+$/.test(z)&&t.active.postMessage({warmLazy:"resources/dia_"+z+".txt"})}})}catch(t){}if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var f=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=f){EditorUi.debug("Setting configuration",JSON.stringify(f));if(null!=f.merge){var k=localStorage.getItem(Editor.configurationKey);if(null!=k)try{var n=JSON.parse(k),q;for(q in f.merge)n[q]=f.merge[q];
-f=n}catch(t){window.location.hash="",alert(t)}else f=f.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(f)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(t){window.location.hash="",alert(t)}1<O.length&&(Graph.prototype.defaultThemes["default-style2"]=O[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=O[1].getDocumentElement());"1"==urlParams.dev||
-EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],c,function(t){document.body.innerHTML="";var r=document.createElement("pre");mxUtils.write(r,t.stack);document.body.appendChild(r)}))},function(O){O=document.getElementById("geStatus");null!=O&&(O.innerHTML="Error loading page. <a>Please try refreshing.</a>",O.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";g(mxResources.getDefaultBundle(RESOURCE_BASE,
-mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})};if(!App.isMainCalled)if(mxIsElectron&&"undefined"===typeof electron)alert("Runtime Environment not found."),document.body.innerHTML='<div style="grid-column:1 / -1;grid-row:1 / -1;margin-top:10%;text-align:center;"><img src="mxgraph/images/warning.png" align="top" style="padding-right:6px;"/>Runtime Environment not found.</div>';else{Editor.loadCompatibleCss();App.isMainCalled=!0;if("1"==urlParams.android||"0"!=urlParams.android&&
-!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC&&1<navigator.maxTouchPoints)mxClient.IS_ANDROID=!0;window.onerror=function(L,O,c,f,k){EditorUi.logError("Global: "+(null!=L?L:""),O,c,f,k,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",L,"\nURL:",O,"\nLine:",c,"\nColumn:",f,"\nError:",k)):console.error("Message:",L,"\nURL:",O,"\nLine:",c,"\nColumn:",f,"\nError:",k);window.setTimeout(function(){alert("Error: "+(null!=L?L:""))},100)};if(window.top!=window.self||
-"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var u=document.getElementById("geInfo");null!=u&&u.parentNode.removeChild(u)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&
-("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(L){var O="stable"==App.getReleaseChannel();O&&14<=App.getServiceWorkerFailures()&&(EditorUi.debug("App.main","Stable channel failing, reverting to beta"),
-App.setReleaseChannel(null),App.resetServiceWorkerFailures(),O=!1);var c=O?"stable/service-worker.js":"service-worker.js",f=null!=L?L.active||L.waiting||L.installing:null;null!=f&&O==/\/stable\/service-worker\.js$/.test(f.scriptURL)?(EditorUi.debug("App.main","Updating service worker"),L.update().then(function(){App.resetServiceWorkerFailures()})["catch"](function(k){App.logServiceWorkerError(c,k)})):null!=f||null!=App.getReleaseChannel()||!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||
-"1"==urlParams.enableSW?(EditorUi.debug("App.main","Installing service worker",c),navigator.serviceWorker.register(c,{scope:"./"}).then(function(){App.resetServiceWorkerFailures()})["catch"](function(k){App.logServiceWorkerError(c,k)})):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(L){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"1"==urlParams.local||
-"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var y=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var A=JSON.parse(localStorage.getItem(mxSettings.key));null!=A&&(y=A.plugins)}catch(L){}A=urlParams.p;App.initPluginCallback();null!=A&&App.loadPlugins(A.split(";"));
-if(null!=y&&0<y.length&&"0"!=urlParams.plugins)for(u=0;u<y.length;u++)try{("/"==y[u].charAt(0)&&(y[u]=PLUGINS_BASE_PATH+y[u]),App.isSameDomain(y[u]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(y[u])?null==App.pluginsLoaded[y[u]]&&(App.pluginsLoaded[y[u]]=!0,App.embedModePluginsCount++,mxscript(y[u])):null!=window.console&&console.log("Unknown plugin:",y[u]):null!=window.console&&console.log("Blocked plugin:",y[u])}catch(L){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=
-urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var E=window.opener||window.parent,J=function(L){if(L.source==E)try{var O=JSON.parse(L.data);null!=
-O&&"configure"==O.action&&(mxEvent.removeListener(window,"message",J),Editor.configure(O.config),mxSettings.load(),null!=O.config.darkColor&&document.body.style.setProperty("--dark-color",O.config.darkColor),O.colorSchemeMeta&&mxmeta("color-scheme","dark light"),p())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,L.data)}};mxEvent.addListener(window,"message",J);E.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",
-window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(L){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var M=localStorage.getItem(Editor.configurationKey);if(null!=M)try{M=JSON.parse(M),null!=M&&(EditorUi.debug("Using local configuration",M),Editor.configure(M),mxSettings.load())}catch(L){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):
-console.error(L)}}}p()}}else document.body.innerHTML='<div style="grid-column:1 / -1;grid-row:1 / -1;margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}}catch(L){document.body.innerHTML="",y=document.createElement("pre"),mxUtils.write(y,L.stack),document.body.appendChild(y)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;
-App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;
+null),"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null));null!=b&&b(t);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,t,(new Date).getTime()-t0.getTime()+"ms"]),EditorUi.debug("Export:",EXPORT_URL))}catch(r){EditorUi.isElectronApp?
+(mxLog.show(),mxLog.debug(r.stack)):(EditorUi.logError(r.message,null,null,null,r),window.setTimeout(function(){alert(r.message)},1))}}mxResources.parse(O[0].getText());try{"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(t){if(null!=t.active&&(t.active.postMessage({warmLazy:L,warmDev:"1"==urlParams.dev}),null!=Editor.defaultLanguages))for(var r=0;r<Editor.defaultLanguages.length;r++){var z=Editor.defaultLanguages[r];"string"===typeof z&&/^[a-z0-9-]+$/.test(z)&&t.active.postMessage({warmLazy:"resources/dia_"+
+z+".txt"})}})}catch(t){}if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var f=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=f){EditorUi.debug("Setting configuration",JSON.stringify(f));if(null!=f.merge){var k=localStorage.getItem(Editor.configurationKey);if(null!=k)try{var n=JSON.parse(k),q;for(q in f.merge)n[q]=f.merge[q];f=n}catch(t){window.location.hash="",alert(t)}else f=f.merge}confirm(mxResources.get("configLinkWarn"))&&
+confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(f)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(t){window.location.hash="",alert(t)}1<O.length&&(Graph.prototype.defaultThemes["default-style2"]=O[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=O[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js",
+"js/stencils.min.js","js/extensions.min.js"],c,function(t){document.body.innerHTML="";var r=document.createElement("pre");mxUtils.write(r,t.stack);document.body.appendChild(r)}))},function(O){O=document.getElementById("geStatus");null!=O&&(O.innerHTML="Error loading page. <a>Please try refreshing.</a>",O.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";g(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})};if(!App.isMainCalled)if(mxIsElectron&&
+"undefined"===typeof electron)alert("Runtime Environment not found."),document.body.innerHTML='<div style="grid-column:1 / -1;grid-row:1 / -1;margin-top:10%;text-align:center;"><img src="mxgraph/images/warning.png" align="top" style="padding-right:6px;"/>Runtime Environment not found.</div>';else{Editor.loadCompatibleCss();App.isMainCalled=!0;if("1"==urlParams.android||"0"!=urlParams.android&&!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC&&1<navigator.maxTouchPoints)mxClient.IS_ANDROID=!0;
+window.onerror=function(L,O,c,f,k){EditorUi.logError("Global: "+(null!=L?L:""),O,c,f,k,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",L,"\nURL:",O,"\nLine:",c,"\nColumn:",f,"\nError:",k)):console.error("Message:",L,"\nURL:",O,"\nLine:",c,"\nColumn:",f,"\nError:",k);window.setTimeout(function(){alert("Error: "+(null!=L?L:""))},100)};if(window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==
+window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var u=document.getElementById("geInfo");null!=u&&u.parentNode.removeChild(u)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=
+urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(L){var O="stable"==App.getReleaseChannel();O&&14<=App.getServiceWorkerFailures()&&(EditorUi.debug("App.main","Stable channel failing, reverting to beta"),App.setReleaseChannel(null),App.resetServiceWorkerFailures(),
+O=!1);var c=O?"stable/service-worker.js":"service-worker.js",f=null!=L?L.active||L.waiting||L.installing:null;null!=f&&O==/\/stable\/service-worker\.js$/.test(f.scriptURL)?(EditorUi.debug("App.main","Updating service worker"),L.update().then(function(){App.resetServiceWorkerFailures()})["catch"](function(k){App.logServiceWorkerError(c,k)})):null!=f||null!=App.getReleaseChannel()||!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main",
+"Installing service worker",c),navigator.serviceWorker.register(c,{scope:"./"}).then(function(){App.resetServiceWorkerFailures()})["catch"](function(k){App.logServiceWorkerError(c,k)})):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(L){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==
+urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var y=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var A=JSON.parse(localStorage.getItem(mxSettings.key));null!=A&&(y=A.plugins)}catch(L){}A=urlParams.p;App.initPluginCallback();null!=A&&App.loadPlugins(A.split(";"));if(null!=y&&0<y.length&&
+"0"!=urlParams.plugins)for(u=0;u<y.length;u++)try{("/"==y[u].charAt(0)&&(y[u]=PLUGINS_BASE_PATH+y[u]),App.isSameDomain(y[u]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(y[u])?null==App.pluginsLoaded[y[u]]&&(App.pluginsLoaded[y[u]]=!0,App.embedModePluginsCount++,mxscript(y[u])):null!=window.console&&console.log("Unknown plugin:",y[u]):null!=window.console&&console.log("Blocked plugin:",y[u])}catch(L){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||
+"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var E=window.opener||window.parent,J=function(L){if(L.source==E)try{var O=JSON.parse(L.data);null!=O&&"configure"==O.action&&(mxEvent.removeListener(window,
+"message",J),Editor.configure(O.config),mxSettings.load(),null!=O.config.darkColor&&document.body.style.setProperty("--dark-color",O.config.darkColor),O.colorSchemeMeta&&mxmeta("color-scheme","dark light"),p())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,L.data)}};mxEvent.addListener(window,"message",J);E.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),
+Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(L){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var M=localStorage.getItem(Editor.configurationKey);if(null!=M)try{M=JSON.parse(M),null!=M&&(EditorUi.debug("Using local configuration",M),Editor.configure(M),mxSettings.load())}catch(L){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}}}p()}}else document.body.innerHTML=
+'<div style="grid-column:1 / -1;grid-row:1 / -1;margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}}catch(L){document.body.innerHTML="",y=document.createElement("pre"),mxUtils.write(y,L.stack),document.body.appendChild(y)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};
+App.pluginsLoaded={};App.embedModePluginsCount=0;
App.loadPlugins=function(b,l){EditorUi.debug("Loading plugins",b);for(var p=0;p<b.length;p++)if(null!=b[p]&&0<b[p].length)try{if(null!=App.pluginRegistry[b[p]]){var g=PLUGINS_BASE_PATH+App.pluginRegistry[b[p]];null==App.pluginsLoaded[g]&&(App.pluginsLoaded[g]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?l?mxinclude(g):mxscript(g):l?mxinclude(g):mxscript(drawDevUrl+g))}else null!=window.console&&console.log("Unknown plugin:",b[p])}catch(u){null!=window.console&&console.log("Error loading plugin:",
b[p],u)}};App.prototype.initializeEmbedMode=function(){"1"==urlParams.embed&&("app.diagrams.net"==window.location.hostname&&this.showBanner("EmbedDeprecationFooter","app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net."),0<App.embedModePluginsCount||this.initEmbedDone||(this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments)))};
App.prototype.initializeViewerMode=function(){var b=window.opener||window.parent;null!=b&&this.editor.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){b.postMessage(JSON.stringify(this.createLoadMessage("size")),"*")}))};
App.prototype.init=function(){if(!App.blockedAncestorFrames()){this.buttonContainer=this.createButtonContainer();EditorUi.prototype.init.apply(this,arguments);this.descriptorChangedListener=mxUtils.bind(this,this.descriptorChanged);this.addListener("currentThemeChanged",mxUtils.bind(this,function(){this.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(!0)}));Editor.isSettingsEnabled()&&null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode);
Editor.isSettingsEnabled()&&(null!=mxSettings.settings.shareCursorPosition&&(this.shareCursorPosition=mxSettings.settings.shareCursorPosition),null!=mxSettings.settings.showRemoteCursors&&(this.showRemoteCursors=mxSettings.settings.showRemoteCursors));try{this.gitHub="0"==urlParams.gh||"1"==urlParams.embed&&"1"!=urlParams.gh?null:new GitHubClient(this),null!=this.gitHub&&this.gitHub.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()}))}catch(y){null!=
window.console&&console.log("GitHubClient disabled: "+y.message)}try{this.gitLab="0"==urlParams.gl||"1"==urlParams.embed&&"1"!=urlParams.gl?null:new GitLabClient(this),null!=this.gitLab&&this.gitLab.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()}))}catch(y){null!=window.console&&console.log("GitLabClient disabled: "+y.message)}if("1"!=urlParams.embed||"1"==urlParams.od){var b=mxUtils.bind(this,function(){if("undefined"!==typeof OneDrive)try{this.oneDrive=
-new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();this.checkReleaseChannel(this.oneDrive)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))}catch(y){null!=window.console&&console.log("OneDriveClient disabled: "+y.message)}else null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=b)});b()}if("0"!=urlParams.ms365&&!EditorUi.isElectronApp)try{this.m365=new OneDriveClient(this,
-!1,!1,!1,!0),this.m365.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();this.checkReleaseChannel(this.m365)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.m365))}catch(y){null!=window.console&&console.log("M365Client disabled: "+y.message)}if("1"!=urlParams.embed||"1"==urlParams.tr){var l=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=new TrelloClient(this),this.trello.addListener("userChanged",
-mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(y){null!=window.console&&console.log("TrelloClient disabled: "+y.message)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=l)});l()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var p=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var y=mxUtils.bind(this,function(){try{this.drive=new DriveClient(this),
-this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense();this.checkReleaseChannel(this.drive)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(A){null!=window.console&&console.log("DriveClient disabled: "+A.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,y),window.DrawGapiClientCallback=null):y()}else null==
-window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=p)});p()}if("1"!=urlParams.embed||"1"==urlParams.db){var g=mxUtils.bind(this,function(){if("function"===typeof Dropbox){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(y){null!=window.console&&console.log("DropboxClient disabled: "+
-y.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=g)});g()}"1"!=urlParams.embed&&(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(y){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),mxUtils.bind(this,function(){y.prompt()}),
-!0,!0)})),!this.isOwnGDriveDomain()||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var y=this.getCurrentFile();y=null!=y?y.getMode():null;mxClient.IS_CHROMEAPP||mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||y!=App.MODE_DEVICE&&y!=App.MODE_BROWSER||this.showDownloadDesktopBanner();Editor.fitDiagramOnLoad&&this.fitInitialView()})),DrawioFileSync.checkCacheAlive(this));
-this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var u=mxUtils.bind(this,function(){"1"!=urlParams.embed?this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});this.addListener("languageChanged",u);this.addListener("currentThemeChanged",u);u()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&"1"!=urlParams.embed)&&this.setCompactMode(!0);
-if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.className="geSmallAppIcon","1"!=urlParams.embed&&(this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(y){this.appIconClicked(y)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&
+new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();this.checkReleaseChannel(this.oneDrive)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))}catch(y){null!=window.console&&console.log("OneDriveClient disabled: "+y.message)}else null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=b)});b()}if("0"!=urlParams.ms365&&!EditorUi.isElectronApp&&("1"!=urlParams.embed||
+"1"==urlParams.ms365))try{this.m365=new OneDriveClient(this,!1,!1,!1,!0),this.m365.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();this.checkReleaseChannel(this.m365)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.m365))}catch(y){null!=window.console&&console.log("M365Client disabled: "+y.message)}if("1"!=urlParams.embed||"1"==urlParams.tr){var l=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=
+new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(y){null!=window.console&&console.log("TrelloClient disabled: "+y.message)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=l)});l()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var p=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var y=mxUtils.bind(this,
+function(){try{this.drive=new DriveClient(this),this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense();this.checkReleaseChannel(this.drive)})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(A){null!=window.console&&console.log("DriveClient disabled: "+A.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,y),
+window.DrawGapiClientCallback=null):y()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=p)});p()}if("1"!=urlParams.embed||"1"==urlParams.db){var g=mxUtils.bind(this,function(){if("function"===typeof Dropbox){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(y){null!=
+window.console&&console.log("DropboxClient disabled: "+y.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=g)});g()}"1"!=urlParams.embed&&(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(y){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),
+mxUtils.bind(this,function(){y.prompt()}),!0,!0)})),!this.isOwnGDriveDomain()||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var y=this.getCurrentFile();y=null!=y?y.getMode():null;mxClient.IS_CHROMEAPP||mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||y!=App.MODE_DEVICE&&y!=App.MODE_BROWSER||this.showDownloadDesktopBanner();Editor.fitDiagramOnLoad&&this.fitInitialView()})),
+DrawioFileSync.checkCacheAlive(this));this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var u=mxUtils.bind(this,function(){"1"!=urlParams.embed?this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});this.addListener("languageChanged",u);this.addListener("currentThemeChanged",u);u()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&
+"1"!=urlParams.embed)&&this.setCompactMode(!0);if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.className="geSmallAppIcon","1"!=urlParams.embed&&(this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(y){this.appIconClicked(y)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&
this.initializeViewerMode()}};App.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&b.substring(0,b.length-1);b="";for(var l=0;l<window.location.ancestorOrigins.length;l++)if(b+=" -> "+window.location.ancestorOrigins[l],b.endsWith("dan6v7pm1f1a1.cloudfront.net")||b.endsWith("confluence-cloud-excalidraw-2-ll3likebca-uc.a.run.app"))return!0}}catch(p){}return!1};
App.prototype.scheduleSanityCheck=function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=this.sanityCheckThread||(this.sanityCheckThread=window.setTimeout(mxUtils.bind(this,function(){this.sanityCheckThread=null;this.sanityCheck()}),this.warnInterval))};App.prototype.stopSanityCheck=function(){null!=this.sanityCheckThread&&(window.clearTimeout(this.sanityCheckThread),this.sanityCheckThread=null)};
App.prototype.sanityCheck=function(){var b=this.getCurrentFile();if(null!=b&&b.isModified()&&b.isAutosave()&&b.isOverdue()){b.getHash();b.savingFile&&null!=b.savingFileTime&&(Date.now(),b.savingFileTime.getTime());null!=b.ageStart&&(Date.now(),b.ageStart.getTime());b.isAutosave();null!=b.opened&&(Date.now(),b.opened.getTime());null!=b.lastSaved&&(Date.now(),b.lastSaved.getTime());null!=b.lastChanged&&(Date.now(),b.lastChanged.getTime());Date.now();App.startTime.getTime();var l=null!=b.sync?"client_"+
@@ -15360,54 +15370,54 @@ null,E,mxResources.get("cancel"),mxResources.get("discardChanges")):E()}else thi
E()}else this.trello.logout()}),mxResources.get("trello"));"min"==uiTheme&&(u=this.getCurrentFile(),null!=u&&u.isRealtimeEnabled()&&u.isRealtimeSupported()&&(b=document.createElement("div"),b.style.padding="10px",b.style.whiteSpace="nowrap",b.style.borderTop="1px solid rgb(224, 224, 224)",b.style.marginTop="4px",b.style.textAlign="center",b.style.padding="10px",b.style.fontSize="9pt",y=u.getRealtimeError(),1!=u.getRealtimeState()&&(mxUtils.write(b,mxResources.get("realtimeCollaboration")+": "+(null!=
y&&null!=y.message?y.message:mxResources.get("disconnected"))),this.userPanel.appendChild(b))));document.body.appendChild(this.userPanel)}};
App.prototype.getCurrentUser=function(){var b=null;null!=this.drive&&null!=this.drive.getUser()?b=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?b=this.oneDrive.getUser():null!=this.m365&&null!=this.m365.getUser()?b=this.m365.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?b=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()&&(b=this.gitHub.getUser());return b};var editorResetGraph=Editor.prototype.resetGraph;
-Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.layoutContainers=function(){var p=function(u,y){y.resizeLayoutRoot=!0;y.resizeNodes=!1;return"childLayout="+Graph.encodeChildLayout([{layout:u,config:y}])+";"},g=function(u,y,A,
-E){return{width:y,height:A,style:"group;connectable=0;transparentBounds=1;groupPadding=20;"+E,sidebarStyle:"swimlane;html=1;startSize=20;horizontal="+(u?"0":"1")+";resizable=0;fontSize=12;transparentBounds=1;groupPadding=20;"+E}};return{horizontalFlow:g(!0,460,150,"containerType=tree;"+p("elkLayered",{"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.padding":"[top=20,left=40,bottom=20,right=20]",edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),verticalFlow:g(!1,
-270,280,"containerType=tree;"+p("elkLayered",{"elk.direction":"DOWN","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.padding":"[top=40,left=20,bottom=20,right=20]",edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),horizontalTree:g(!0,300,160,"containerType=tree;"+p("elkTree",{"elk.direction":"RIGHT","elk.spacing.nodeNode":"40","elk.spacing.edgeNode":"20","elk.padding":"[top=20,left=40,bottom=20,right=20]",corners:"rounded"})),verticalTree:g(!1,280,180,"containerType=tree;"+
-p("elkTree",{"elk.direction":"DOWN","elk.spacing.nodeNode":"40","elk.spacing.edgeNode":"20","elk.padding":"[top=40,left=20,bottom=20,right=20]",corners:"rounded"})),radialTree:g(!1,320,320,"containerType=tree;"+p("elkRadial",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),organic:g(!1,320,320,p("elkOrganic",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),circle:g(!1,320,320,"childLayout=circleLayout;")}}();Menus.layoutContainerEdgeStyle="html=1;rounded=1;curved=0;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startSize=6;endSize=6;";
-Menus.prototype.createHelpLink=function(p){return this.editorUi.createHelpIcon(p)};Menus.prototype.addLinkToItem=function(p,g){null!=p&&p.firstChild.nextSibling.appendChild(this.createHelpLink(g))};Menus.prototype.removeCustomFont=function(p,g){for(var u=0;u<this.customFonts.length;u++)if(this.customFonts[u].name==p&&this.customFonts[u].url==g){this.customFonts.splice(u,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=
-function(p,g){for(var u=0;u<this.customFonts.length;u++)if(this.customFonts[u].name==p&&this.customFonts[u].url==g)return!0;for(u=0;u<this.defaultFonts.length;u++){var y=this.defaultFonts[u];if("string"!==typeof y&&y.fontFamily==p&&y.fontUrl==g||"string"===typeof y&&y==p&&null==g)return!0}return!1};Menus.prototype.addCustomFont=function(p,g){null==p||this.containsFont(p,g)||(this.customFonts.push({name:p,url:g}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};
-var l=Menus.prototype.init;Menus.prototype.init=function(){function p(v,d,m){g.editor.isExportToCanvas()?g.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(x,C,F,G,K,Q,ba,T,Z,X,da,R,Y,ca,P,aa){ca=parseInt(x);!isNaN(ca)&&0<ca&&(g.exportImage(ca/100,C&&"png"==v,F,G,K&&"png"==v,ba,!T,Z,v,da,"png"==v?aa:null,R,Y),null!=m&&m(x,C,F,G,K,Q,ba,T,Z,X,da,R,Y))}),!0,d,v,!0):!g.isRemoteExportEnabled()||mxClient.IS_IOS&&
-navigator.standalone||g.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(x,C,F,G,K){g.downloadFile(C&&"png"==v?"xmlpng":v,null,null,x,null,null,F,G,K)}),!1,!0)}l.apply(this,arguments);var g=this.editorUi,u=g.editor.graph,y=mxUtils.bind(u,u.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(v){return"file"!=v}));g.actions.addAction("new...",function(){var v=g.isOffline(),d=new NewDialog(g,v,!(g.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in
-window));g.showDialog(d.container,v?350:620,v?70:460,!0,!0,function(m){null!=g.sidebar&&g.sidebar.hideTooltip();m&&null==g.getCurrentFile()&&g.showSplash()});d.init()});g.actions.put("insertTemplate",new Action("template...",function(){g.openTemplateDialog()})).isEnabled=y;var A=mxResources.get("page");g.actions.put("insertPage",new Action(mxResources.get("insertPage"),function(){try{g.insertPage()}catch(v){g.handleError(v)}})).isEnabled=function(){return null!=g.currentPage};g.actions.put("removePage",
-new Action(mxResources.get("removeIt",[A]),function(){g.removePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("renamePage",new Action(mxResources.get("renameIt",[A])+"...",function(){g.renamePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("duplicatePage",new Action(mxResources.get("duplicateIt",[A]),function(){var v=g.currentPage;g.duplicatePage(v,mxResources.get("copyOf",[v.getName()]))})).isEnabled=function(){return null!=
-g.currentPage};g.actions.put("sortPages",new Action(mxResources.get("sortPages"),function(){g.sortPages()})).isEnabled=function(){return null!=g.pages&&1<g.pages.length&&g.editor.graph.isEnabled()};A=g.actions.addAction("shareCursor",function(){g.setShareCursorPosition(!g.isShareCursorPosition())});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.isShareCursorPosition()});A=g.actions.addAction("showRemoteCursors",function(){g.setShowRemoteCursors(!g.isShowRemoteCursors())});A.setToggleAction(!0);
-A.setSelectedCallback(function(){return g.isShowRemoteCursors()});A=g.actions.addAction("points",function(){g.editor.graph.view.setUnit(mxConstants.POINTS)});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.POINTS});A=g.actions.addAction("inches",function(){g.editor.graph.view.setUnit(mxConstants.INCHES)});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.INCHES});A=g.actions.addAction("millimeters",
-function(){g.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.MILLIMETERS});A=g.actions.addAction("meters",function(){g.editor.graph.view.setUnit(mxConstants.METERS)});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["points","inches","millimeters","meters"],
-d);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||g.menus.addMenuItems(v,["-","pageScale"],d)})));A=g.actions.addAction("pageTabs",function(){g.setTabContainerVisible(!g.isTabContainerVisible(),!0)});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.isTabContainerVisible()});A=g.actions.addAction("ruler",function(){g.setRulerVisible(!g.isRulerVisible())});A.setEnabled(Editor.canvasSupported&&9!=document.documentMode);A.setToggleAction(!0);A.setSelectedCallback(function(){return g.isRulerVisible()});
-A=g.actions.addAction("fullscreen",function(){if("1"==urlParams.embedInline)g.setInlineFullscreen(!Editor.inlineFullscreen);else{var v=mxUtils.isAncestorNode(document.body,g.container)?g.container:g.editor.graph.container;null!=v&&(null==document.fullscreenElement?(document.body.requestFullscreen(),v.classList.add("geFullscreen")):(document.exitFullscreen(),v.classList.remove("geFullscreen")))}});A.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&null!=document.body.requestFullscreen;
-A.setToggleAction(!0);A.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});A=g.actions.put("lightMode",new Action("light",function(v){g.setAndPersistDarkMode(!1)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&!Editor.isDarkMode()});A=g.actions.put("darkMode",new Action("dark",function(v){g.setAndPersistDarkMode(!0)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&
-Editor.isDarkMode()});A=g.actions.put("autoMode",new Action("automatic",function(v){g.setAndPersistDarkMode("auto")}));A.setToggleAction(!0);A.setSelectedCallback(function(){return g.isAutoDarkMode(!0)});g.actions.addAction("properties...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){v=new FilePropertiesDialog(g,v);g.showDialog(v.container,360,null,!0,!0);v.init()})}).isEnabled=y;window.mxFreehand&&(A=g.actions.put("insertFreehand",new Action("freehand",function(){if(u.isEnabled()){if(null==
-g.freehandWindow){var v=mxSettings.getWindowState("freehand");g.freehandWindow=new FreehandWindow(g,null!=v&&null!=v.x?v.x:document.body.offsetWidth-420,null!=v&&null!=v.y?v.y:102,null!=v&&null!=v.w?v.w:180,null!=v&&null!=v.h?v.h:126,!0);g.installWindowPersistence("freehand",g.freehandWindow);null!=v&&g.restoreWindowState("freehand",g.freehandWindow)}u.freehand.isDrawing()?u.freehand.stopDrawing():u.freehand.startDrawing();g.freehandWindow.window.setVisible(u.freehand.isDrawing())}},null,null,"X")),
-A.isEnabled=function(){return y()},A.setToggleAction(!0),A.setSelectedCallback(function(){return null!=g.freehandWindow&&g.freehandWindow.window.isVisible()}));g.actions.put("exportXml",new Action("formatXml...",function(){var v=document.createElement("div");v.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatXml"));v.appendChild(m);m=document.createElement("div");m.className="geDialogSection";var x=g.addCheckbox(m,
-mxResources.get("selectionOnly"),!1,u.isSelectionEmpty(),null,null,null,null,!0),C=g.addCheckbox(m,mxResources.get("allPages"),!d,d,null,null,null,null,!0),F=g.addCheckbox(m,mxResources.get("compressed"),Editor.defaultCompressed,null,null,null,null,null,!0);v.appendChild(m);mxEvent.addListener(x,"change",function(){x.checked?C.setAttribute("disabled","disabled"):C.removeAttribute("disabled")});v=new CustomDialog(g,v,mxUtils.bind(this,function(){g.downloadFile("xml",!F.checked,null,!x.checked,d||!C.checked)}),
-null,mxResources.get("export"));g.showDialog(v.container,300,null,!0,!0)}));Editor.enableExportUrl&&g.actions.put("exportUrl",new Action("url...",function(){g.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(v,d,m,x,C,F,G,K,Q,ba,T,Z,X,da,R,Y){G=[];x&&Q&&(Q=da?g.getHiddenTagsMap():null,G.push("tags="+encodeURIComponent(JSON.stringify(Q||{}))));v=new EmbedDialog(g,g.createLink(v,d,X,x,C,F,null,!0,G,null,m,null,Z,R,Y));g.showDialog(v.container,450,270,!0,!0,null,
-!1,null,new mxRectangle(0,0,400,250));v.init()},null,!0,!0)}));g.actions.put("exportJson",new Action("formatJson...",function(){var v=document.createElement("div");v.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatJson"));v.appendChild(m);m=document.createElement("div");m.className="geDialogSection";var x=g.editor.graph,C=g.addCheckbox(m,mxResources.get("selectionOnly"),!1,x.isSelectionEmpty(),null,null,null,null,
-!0),F=g.addCheckbox(m,mxResources.get("allPages"),!d,d,null,null,null,null,!0),G=g.addCheckbox(m,mxResources.get("includeCopyOfMyDiagram"),!1,null,null,null,null,null,!0),K=g.addCheckbox(m,mxResources.get("compressed"),Editor.defaultCompressed,!0,null,null,null,null,!0);v.appendChild(m);mxEvent.addListener(C,"change",function(){C.checked?F.setAttribute("disabled","disabled"):d||F.removeAttribute("disabled")});mxEvent.addListener(G,"change",function(){G.checked?K.removeAttribute("disabled"):K.setAttribute("disabled",
-"disabled")});v=new CustomDialog(g,v,mxUtils.bind(this,function(){var Q=C.checked&&!x.isSelectionEmpty(),ba=!Q&&!d&&F.checked;Q=g.createJsonForExport(ba,G.checked,G.checked&&K.checked,Q);g.saveData(g.getBaseFilename(ba)+".json","json",JSON.stringify(Q,null,2),"application/json")}),null,mxResources.get("export"));g.showDialog(v.container,300,null,!0,!0)}));g.actions.put("exportHtml",new Action("formatHtmlEmbedded...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){g.showHtmlDialog(mxResources.get("export"),
-"https://www.drawio.com/docs/manual/export/embed-html/",v,function(d,m,x,C,F,G,K,Q,ba,T,Z,X,da,R,Y){g.createHtml(d,m,x,C,F,G,K,Q,ba,T,Z,mxUtils.bind(this,function(ca,P){var aa=g.getBaseFilename(K);ca='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(aa)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+ca+"\n"+P+"\n</body>\n</html>";g.saveData(aa+(".drawio"==aa.substring(aa.lenth-7)?"":".drawio")+
-".html","html",ca,"text/html")}),X,da,R,Y)})})}));g.actions.put("exportPdf",new Action("formatPdf...",function(){g.showPrintDialog(mxResources.get("formatPdf"),!EditorUi.isElectronApp&&g.isPrintPdfExport()?null:mxUtils.bind(this,function(v,d){v=null!=g.pages?g.pages.length:1;var m=null==g.pages||1>=g.pages.length,x=g.getPageIndex(g.currentPage);x=null!=x?x+1:1;g.downloadFile("pdf",null,null,!d.selection,m||!d.allPages&&d.pagesFrom==x&&d.pagesTo==x,!d.crop,d.transparent,d.scale,null,d.grid,d.includeCopy,
-d.allPages||d.pagesFrom==x&&d.pagesTo==x?null:{from:Math.max(0,Math.min(v-1,d.pagesFrom-1)),to:Math.max(0,Math.min(v-1,d.pagesTo-1))},d.border,d.fit,d.sheetsAcross,d.sheetsDown,d.shadows,d.icons)}),mxResources.get("export"))}));g.actions.addAction("open...",function(){g.pickFile()});g.actions.addAction("close",function(){function v(){null!=d&&d.removeDraft();g.fileLoaded(new LocalFile(g,g.emptyDiagramXml,null,!0))}var d=g.getCurrentFile();null!=d&&d.isModified()?g.confirm(mxResources.get("allChangesLost"),
-null,v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()});g.actions.addAction("extractText",function(v){v=u.getIndexableText(v||u.isSelectionEmpty()?null:u.getSelectionCells());v=new EmbedDialog(g,v,null,null,null,mxResources.get("extractText"));g.showDialog(v.container,450,240,!0,!0);v.init()});g.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==u.getSelectionCount()){var v=u.getSelectionCell(),d=u.view.getState(v);null!=d&&null!=d.shape&&null!=d.shape.stencil&&
-(v=new EditShapeDialog(g,v,mxResources.get("editShape")),g.showDialog(v.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),v.init())}}));g.actions.addAction("revisionHistory...",function(){g.isRevisionHistorySupported()?g.spinner.spin(document.body,mxResources.get("loading"))&&g.getRevisions(mxUtils.bind(this,function(v,d){g.spinner.stop();v=new RevisionDialog(g,v,d);g.showDialog(v.container,640,480,!0,!0);v.init()}),mxUtils.bind(this,function(v){g.handleError(null!=v?v:mxResources.get("notAvailable"))})):
-g.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});g.actions.addAction("createRevision",function(){g.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");A=g.actions.addAction("synchronize",function(){g.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");"none"==DrawioFile.SYNC&&(A.label=mxResources.get("refresh"));g.actions.addAction("upload...",function(){var v=g.getCurrentFile();null!=v&&(window.drawdata=
-g.getFileData(),v=null!=v.getTitle()?v.getTitle():g.defaultFilename,g.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(g.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(v),null,!0))},null,null,null,navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown);"undefined"!==typeof MathJax&&(A=g.actions.addAction("mathematicalTypesetting",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.mathEnabled=!g.isMathEnabled();
-u.model.execute(v)}),A.setToggleAction(!0),A.setSelectedCallback(function(){return g.isMathEnabled()}),A.isEnabled=y);A=g.actions.put("defaultAdaptiveColors",new Action("defaultAdaptiveColors",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="default";u.model.execute(v)}));A.getTitle=function(){return mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+")"};A.setToggleAction(!0);A.setSelectedCallback(function(){return null==
-u.adaptiveColors});A=g.actions.put("automaticAdaptiveColors",new Action("automatic",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="auto";u.model.execute(v)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return"auto"==u.adaptiveColors});A=g.actions.put("simpleAdaptiveColors",new Action("simple",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="simple";u.model.execute(v)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return"simple"==
-u.adaptiveColors});A=g.actions.put("noAdaptiveColors",new Action("none",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="none";u.model.execute(v)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return"none"==u.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],d)})));var E=g.actions.addAction("autosave",
-function(){g.editor.setAutosave(!g.editor.autosave)});E.setToggleAction(!0);E.setSelectedCallback(function(){return E.isEnabled()&&g.editor.autosave});g.actions.addAction("editGeometry...",function(){for(var v=u.getSelectionCells(),d=[],m=0;m<v.length;m++)u.getModel().isVertex(v[m])&&d.push(v[m]);0<d.length&&(v=new EditGeometryDialog(g,d),g.showDialog(v.container,300,null,!0,!0),v.init())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+M");g.actions.addAction("copyStyle",function(){if(u.isEnabled()&&
-1==u.getSelectionCount()){var v=u.getSelectionCell(),d=u.getCellStyle(v,!1);g.copiedStyle={};var m=[],x=[],C;for(C in d)m.push(d[C]),x.push(C);u.copyCellStyles([v],x,m,g.copiedStyle,g.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");g.actions.addAction("pasteStyle",function(){u.isEnabled()&&!u.isSelectionEmpty()&&null!=g.copiedStyle&&u.pasteCellStyles(u.includeDescendantParts(u.getSelectionCells()),g.copiedStyle,g.copiedStyle,!0)},null,null,Editor.altKey+"+V");g.actions.addAction("copyTextStyle",
-function(){if(u.isEnabled()&&1==u.getSelectionCount()){var v=u.getSelectionCell();v=u.getCellStyle(v,!1);g.copiedTextStyle={};for(var d=0;d<Graph.pasteTextStyles.length;d++){var m=Graph.pasteTextStyles[d];null!=v[m]?g.copiedTextStyle[m]=v[m]:"fontStyle"==m&&(g.copiedTextStyle[m]=0)}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("pasteTextStyle",function(){u.isEnabled()&&!u.isSelectionEmpty()&&null!=g.copiedTextStyle&&u.pasteTextStyles(u.includeDescendantParts(u.getSelectionCells()),
-g.copiedTextStyle)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");g.actions.put("exportSvg",new Action("formatSvg...",function(){g.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(v,d,m,x,C,F,G,K,Q,ba,T,Z,X,da,R,Y,ca){v=parseInt(v);g.lastExportSvgEditable=C;!isNaN(v)&&0<v&&g.exportSvg(v/100,d,m,x,C,F,G,!K,Q,ba,Z,X,da,null,R,T,ca)}),!0,g.lastExportSvgEditable,"svg",!0)}));g.actions.put("exportPng",
-new Action("formatPng...",function(){p("png",g.lastExportPngEditable,function(v,d,m,x,C){g.lastExportPngEditable=C})}));g.actions.put("exportJpg",new Action("formatJpg...",function(){p("jpeg")}));g.actions.put("exportWebp",new Action("formatWebp...",function(){p("webp")}));g.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif")+"...",function(){g.showAnimatedGifExportDialog()}));A=g.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var v=mxUtils.sortCells(u.model.getTopmostCells(u.getSelectionCells()));
-g.copyImage(v)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");A.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();A=g.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var v=mxUtils.sortCells(u.model.getTopmostCells(u.getSelectionCells()));g.copySvg(v)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");A.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();A=g.actions.put("shadowVisible",new Action("shadow",function(){u.setShadowVisible(!u.shadowVisible)}));
-A.setToggleAction(!0);A.setSelectedCallback(function(){return u.shadowVisible});g.actions.put("about",new Action("v"+EditorUi.VERSION,function(v,d){mxEvent.isShiftDown(d)&&(EditorUi.isElectronApp||g.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));g.actions.addAction("support...",function(){EditorUi.isElectronApp?g.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):
-g.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});g.actions.addAction("downloadDesktop...",function(){g.openLink("https://get.diagrams.net/")});g.actions.addAction("exportOptionsDisabled...",function(){g.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});g.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||navigator.standalone?g.openLink("https://app.diagrams.net/shortcuts.svg"):
-g.openLink("shortcuts.svg")});g.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?g.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):g.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});A=g.actions.addAction("tags",mxUtils.bind(this,function(){if(null==this.tagsWindow){var v=mxSettings.getWindowState("tags");this.tagsWindow=new TagsWindow(g,null!=v&&null!=v.x?v.x:document.body.offsetWidth-400,null!=v&&null!=v.y?v.y:60,null!=v&&null!=v.w?v.w:212,null!=
-v&&null!=v.h?v.h:200);this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("tags"))}));this.tagsWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("tags"))});g.installWindowPersistence("tags",this.tagsWindow);null!=v&&g.restoreWindowState("tags",this.tagsWindow);this.tagsWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("tags"))}else this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+
-"+K");A.setToggleAction(!0);A.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));A=g.actions.addAction("animation",mxUtils.bind(this,function(){if(null==this.animationWindow){var v=mxSettings.getWindowState("animation");this.animationWindow=new AnimationDialog(g,null!=v&&null!=v.x?v.x:Math.max(0,(document.body.offsetWidth-480)/2),null!=v&&null!=v.y?v.y:120,null!=v&&null!=v.w?v.w:480,null!=v&&null!=v.h?v.h:460);this.animationWindow.window.addListener("show",
-mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("animation"))}));this.animationWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("animation"))});g.installWindowPersistence("animation",this.animationWindow);null!=v&&g.restoreWindowState("animation",this.animationWindow);this.animationWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("animation"))}else this.animationWindow.window.setVisible(!this.animationWindow.window.isVisible())}));A.setToggleAction(!0);
-A.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.animationWindow&&this.animationWindow.window.isVisible()}));(EditorUi.isElectronApp&&(Editor.enableAi||null==Editor.config||null==Editor.config.enableAi&&null==Editor.config.enableChatGpt)||(Editor.enableAi||(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!g.isOffline()&&0<Editor.aiActions.length&&g.isExternalDataComms())&&"draw.io"==
-g.getServiceName()&&EditorUi.isMermaidSupported()&&(A=g.actions.put("generate",new Action("generate",function(){EditorUi.isElectronApp||Editor.enableAi?null!=g.chatWindow?g.chatWindow.window.setVisible(!g.chatWindow.window.isVisible()):g.openGenerateDialog(""):g.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),A.isEnabled=function(){return y()},A.setToggleAction(!0),A.setSelectedCallback(function(){return null!=
+Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.flowModelOrder="NODES_AND_EDGES";Menus.layoutContainers=function(){var p=function(u,y){y.resizeLayoutRoot=!0;y.resizeNodes=!1;return"childLayout="+Graph.encodeChildLayout([{layout:u,
+config:y}])+";"},g=function(u,y,A,E){return{width:y,height:A,style:"group;connectable=0;transparentBounds=1;groupPadding=20;"+E,sidebarStyle:"swimlane;html=1;startSize=20;horizontal="+(u?"0":"1")+";resizable=0;fontSize=12;transparentBounds=1;groupPadding=20;"+E}};return{horizontalFlow:g(!0,460,150,"containerType=tree;"+p("elkLayered",{"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.layered.considerModelOrder.strategy":Menus.flowModelOrder,"elk.padding":"[top=20,left=40,bottom=20,right=20]",
+edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),verticalFlow:g(!1,270,280,"containerType=tree;"+p("elkLayered",{"elk.direction":"DOWN","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.layered.considerModelOrder.strategy":Menus.flowModelOrder,"elk.padding":"[top=40,left=20,bottom=20,right=20]",edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),horizontalTree:g(!0,300,160,"containerType=tree;"+p("elkTree",{"elk.direction":"RIGHT","elk.spacing.nodeNode":"40",
+"elk.spacing.edgeNode":"20","elk.padding":"[top=20,left=40,bottom=20,right=20]",corners:"rounded"})),verticalTree:g(!1,280,180,"containerType=tree;"+p("elkTree",{"elk.direction":"DOWN","elk.spacing.nodeNode":"40","elk.spacing.edgeNode":"20","elk.padding":"[top=40,left=20,bottom=20,right=20]",corners:"rounded"})),radialTree:g(!1,320,320,"containerType=tree;"+p("elkRadial",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),organic:g(!1,320,320,p("elkOrganic",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),
+circle:g(!1,320,320,"childLayout=circleLayout;")}}();Menus.layoutContainerEdgeStyle="html=1;rounded=1;curved=0;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startSize=6;endSize=6;";Menus.prototype.createHelpLink=function(p){return this.editorUi.createHelpIcon(p)};Menus.prototype.addLinkToItem=function(p,g){null!=p&&p.firstChild.nextSibling.appendChild(this.createHelpLink(g))};Menus.prototype.removeCustomFont=function(p,g){for(var u=0;u<this.customFonts.length;u++)if(this.customFonts[u].name==
+p&&this.customFonts[u].url==g){this.customFonts.splice(u,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(p,g){for(var u=0;u<this.customFonts.length;u++)if(this.customFonts[u].name==p&&this.customFonts[u].url==g)return!0;for(u=0;u<this.defaultFonts.length;u++){var y=this.defaultFonts[u];if("string"!==typeof y&&y.fontFamily==p&&y.fontUrl==g||"string"===typeof y&&y==p&&null==g)return!0}return!1};Menus.prototype.addCustomFont=
+function(p,g){null==p||this.containsFont(p,g)||(this.customFonts.push({name:p,url:g}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var l=Menus.prototype.init;Menus.prototype.init=function(){function p(v,d,m){g.editor.isExportToCanvas()?g.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(x,C,F,G,K,Q,ba,T,Z,X,da,R,Y,ca,P,aa){ca=parseInt(x);!isNaN(ca)&&
+0<ca&&(g.exportImage(ca/100,C&&"png"==v,F,G,K&&"png"==v,ba,!T,Z,v,da,"png"==v?aa:null,R,Y),null!=m&&m(x,C,F,G,K,Q,ba,T,Z,X,da,R,Y))}),!0,d,v,!0):!g.isRemoteExportEnabled()||mxClient.IS_IOS&&navigator.standalone||g.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(x,C,F,G,K){g.downloadFile(C&&"png"==v?"xmlpng":v,null,null,x,null,null,F,G,K)}),!1,!0)}l.apply(this,arguments);var g=this.editorUi,u=g.editor.graph,y=mxUtils.bind(u,u.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=
+this.defaultMenuItems.filter(function(v){return"file"!=v}));g.actions.addAction("new...",function(){var v=g.isOffline(),d=new NewDialog(g,v,!(g.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));g.showDialog(d.container,v?350:620,v?70:460,!0,!0,function(m){null!=g.sidebar&&g.sidebar.hideTooltip();m&&null==g.getCurrentFile()&&g.showSplash()});d.init()});g.actions.put("insertTemplate",new Action("template...",function(){g.openTemplateDialog()})).isEnabled=y;var A=mxResources.get("page");g.actions.put("insertPage",
+new Action(mxResources.get("insertPage"),function(){try{g.insertPage()}catch(v){g.handleError(v)}})).isEnabled=function(){return null!=g.currentPage};g.actions.put("removePage",new Action(mxResources.get("removeIt",[A]),function(){g.removePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("renamePage",new Action(mxResources.get("renameIt",[A])+"...",function(){g.renamePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("duplicatePage",
+new Action(mxResources.get("duplicateIt",[A]),function(){var v=g.currentPage;g.duplicatePage(v,mxResources.get("copyOf",[v.getName()]))})).isEnabled=function(){return null!=g.currentPage};g.actions.put("sortPages",new Action(mxResources.get("sortPages"),function(){g.sortPages()})).isEnabled=function(){return null!=g.pages&&1<g.pages.length&&g.editor.graph.isEnabled()};A=g.actions.addAction("shareCursor",function(){g.setShareCursorPosition(!g.isShareCursorPosition())});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.isShareCursorPosition()});
+A=g.actions.addAction("showRemoteCursors",function(){g.setShowRemoteCursors(!g.isShowRemoteCursors())});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.isShowRemoteCursors()});A=g.actions.addAction("points",function(){g.editor.graph.view.setUnit(mxConstants.POINTS)});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.POINTS});A=g.actions.addAction("inches",function(){g.editor.graph.view.setUnit(mxConstants.INCHES)});A.setToggleAction(!0);
+A.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.INCHES});A=g.actions.addAction("millimeters",function(){g.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.MILLIMETERS});A=g.actions.addAction("meters",function(){g.editor.graph.view.setUnit(mxConstants.METERS)});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.METERS});
+this.put("units",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["points","inches","millimeters","meters"],d);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||g.menus.addMenuItems(v,["-","pageScale"],d)})));A=g.actions.addAction("pageTabs",function(){g.setTabContainerVisible(!g.isTabContainerVisible(),!0)});A.setToggleAction(!0);A.setSelectedCallback(function(){return g.isTabContainerVisible()});A=g.actions.addAction("ruler",function(){g.setRulerVisible(!g.isRulerVisible())});
+A.setEnabled(Editor.canvasSupported&&9!=document.documentMode);A.setToggleAction(!0);A.setSelectedCallback(function(){return g.isRulerVisible()});A=g.actions.addAction("fullscreen",function(){if("1"==urlParams.embedInline)g.setInlineFullscreen(!Editor.inlineFullscreen);else{var v=mxUtils.isAncestorNode(document.body,g.container)?g.container:g.editor.graph.container;null!=v&&(null==document.fullscreenElement?(document.body.requestFullscreen(),v.classList.add("geFullscreen")):(document.exitFullscreen(),
+v.classList.remove("geFullscreen")))}});A.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&null!=document.body.requestFullscreen;A.setToggleAction(!0);A.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});A=g.actions.put("lightMode",new Action("light",function(v){g.setAndPersistDarkMode(!1)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&!Editor.isDarkMode()});
+A=g.actions.put("darkMode",new Action("dark",function(v){g.setAndPersistDarkMode(!0)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&Editor.isDarkMode()});A=g.actions.put("autoMode",new Action("automatic",function(v){g.setAndPersistDarkMode("auto")}));A.setToggleAction(!0);A.setSelectedCallback(function(){return g.isAutoDarkMode(!0)});g.actions.addAction("properties...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){v=new FilePropertiesDialog(g,v);
+g.showDialog(v.container,360,null,!0,!0);v.init()})}).isEnabled=y;window.mxFreehand&&(A=g.actions.put("insertFreehand",new Action("freehand",function(){if(u.isEnabled()){if(null==g.freehandWindow){var v=mxSettings.getWindowState("freehand");g.freehandWindow=new FreehandWindow(g,null!=v&&null!=v.x?v.x:document.body.offsetWidth-420,null!=v&&null!=v.y?v.y:102,null!=v&&null!=v.w?v.w:180,null!=v&&null!=v.h?v.h:126,!0);g.installWindowPersistence("freehand",g.freehandWindow);null!=v&&g.restoreWindowState("freehand",
+g.freehandWindow)}u.freehand.isDrawing()?u.freehand.stopDrawing():u.freehand.startDrawing();g.freehandWindow.window.setVisible(u.freehand.isDrawing())}},null,null,"X")),A.isEnabled=function(){return y()},A.setToggleAction(!0),A.setSelectedCallback(function(){return null!=g.freehandWindow&&g.freehandWindow.window.isVisible()}));g.actions.put("exportXml",new Action("formatXml...",function(){var v=document.createElement("div");v.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,m=document.createElement("h3");
+mxUtils.write(m,mxResources.get("formatXml"));v.appendChild(m);m=document.createElement("div");m.className="geDialogSection";var x=g.addCheckbox(m,mxResources.get("selectionOnly"),!1,u.isSelectionEmpty(),null,null,null,null,!0),C=g.addCheckbox(m,mxResources.get("allPages"),!d,d,null,null,null,null,!0),F=g.addCheckbox(m,mxResources.get("compressed"),Editor.defaultCompressed,null,null,null,null,null,!0);v.appendChild(m);mxEvent.addListener(x,"change",function(){x.checked?C.setAttribute("disabled","disabled"):
+C.removeAttribute("disabled")});v=new CustomDialog(g,v,mxUtils.bind(this,function(){g.downloadFile("xml",!F.checked,null,!x.checked,d||!C.checked)}),null,mxResources.get("export"));g.showDialog(v.container,300,null,!0,!0)}));Editor.enableExportUrl&&g.actions.put("exportUrl",new Action("url...",function(){g.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(v,d,m,x,C,F,G,K,Q,ba,T,Z,X,da,R,Y){G=[];x&&Q&&(Q=da?g.getHiddenTagsMap():null,G.push("tags="+encodeURIComponent(JSON.stringify(Q||
+{}))));v=new EmbedDialog(g,g.createLink(v,d,X,x,C,F,null,!0,G,null,m,null,Z,R,Y));g.showDialog(v.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));v.init()},null,!0,!0)}));g.actions.put("exportJson",new Action("formatJson...",function(){var v=document.createElement("div");v.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatJson"));v.appendChild(m);m=document.createElement("div");m.className="geDialogSection";
+var x=g.editor.graph,C=g.addCheckbox(m,mxResources.get("selectionOnly"),!1,x.isSelectionEmpty(),null,null,null,null,!0),F=g.addCheckbox(m,mxResources.get("allPages"),!d,d,null,null,null,null,!0),G=g.addCheckbox(m,mxResources.get("includeCopyOfMyDiagram"),!1,null,null,null,null,null,!0),K=g.addCheckbox(m,mxResources.get("compressed"),Editor.defaultCompressed,!0,null,null,null,null,!0);v.appendChild(m);mxEvent.addListener(C,"change",function(){C.checked?F.setAttribute("disabled","disabled"):d||F.removeAttribute("disabled")});
+mxEvent.addListener(G,"change",function(){G.checked?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});v=new CustomDialog(g,v,mxUtils.bind(this,function(){var Q=C.checked&&!x.isSelectionEmpty(),ba=!Q&&!d&&F.checked;Q=g.createJsonForExport(ba,G.checked,G.checked&&K.checked,Q);g.saveData(g.getBaseFilename(ba)+".json","json",JSON.stringify(Q,null,2),"application/json")}),null,mxResources.get("export"));g.showDialog(v.container,300,null,!0,!0)}));g.actions.put("exportHtml",new Action("formatHtmlEmbedded...",
+function(){g.getPublicUrl(g.getCurrentFile(),function(v){g.showHtmlDialog(mxResources.get("export"),"https://www.drawio.com/docs/manual/export/embed-html/",v,function(d,m,x,C,F,G,K,Q,ba,T,Z,X,da,R,Y){g.createHtml(d,m,x,C,F,G,K,Q,ba,T,Z,mxUtils.bind(this,function(ca,P){var aa=g.getBaseFilename(K);ca='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(aa)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+
+ca+"\n"+P+"\n</body>\n</html>";g.saveData(aa+(".drawio"==aa.substring(aa.lenth-7)?"":".drawio")+".html","html",ca,"text/html")}),X,da,R,Y)})})}));g.actions.put("exportPdf",new Action("formatPdf...",function(){g.showPrintDialog(mxResources.get("formatPdf"),!EditorUi.isElectronApp&&g.isPrintPdfExport()?null:mxUtils.bind(this,function(v,d){v=null!=g.pages?g.pages.length:1;var m=null==g.pages||1>=g.pages.length,x=g.getPageIndex(g.currentPage);x=null!=x?x+1:1;g.downloadFile("pdf",null,null,!d.selection,
+m||!d.allPages&&d.pagesFrom==x&&d.pagesTo==x,!d.crop,d.transparent,d.scale,null,d.grid,d.includeCopy,d.allPages||d.pagesFrom==x&&d.pagesTo==x?null:{from:Math.max(0,Math.min(v-1,d.pagesFrom-1)),to:Math.max(0,Math.min(v-1,d.pagesTo-1))},d.border,d.fit,d.sheetsAcross,d.sheetsDown,d.shadows,d.icons)}),mxResources.get("export"))}));g.actions.addAction("open...",function(){g.pickFile()});g.actions.addAction("close",function(){function v(){null!=d&&d.removeDraft();g.fileLoaded(new LocalFile(g,g.emptyDiagramXml,
+null,!0))}var d=g.getCurrentFile();null!=d&&d.isModified()?g.confirm(mxResources.get("allChangesLost"),null,v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()});g.actions.addAction("extractText",function(v){v=u.getIndexableText(v||u.isSelectionEmpty()?null:u.getSelectionCells());v=new EmbedDialog(g,v,null,null,null,mxResources.get("extractText"));g.showDialog(v.container,450,240,!0,!0);v.init()});g.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==u.getSelectionCount()){var v=
+u.getSelectionCell(),d=u.view.getState(v);null!=d&&null!=d.shape&&null!=d.shape.stencil&&(v=new EditShapeDialog(g,v,mxResources.get("editShape")),g.showDialog(v.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),v.init())}}));g.actions.addAction("revisionHistory...",function(){g.isRevisionHistorySupported()?g.spinner.spin(document.body,mxResources.get("loading"))&&g.getRevisions(mxUtils.bind(this,function(v,d){g.spinner.stop();v=new RevisionDialog(g,v,d);g.showDialog(v.container,
+640,480,!0,!0);v.init()}),mxUtils.bind(this,function(v){g.handleError(null!=v?v:mxResources.get("notAvailable"))})):g.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});g.actions.addAction("createRevision",function(){g.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");A=g.actions.addAction("synchronize",function(){g.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");"none"==DrawioFile.SYNC&&(A.label=
+mxResources.get("refresh"));g.actions.addAction("upload...",function(){var v=g.getCurrentFile();null!=v&&(window.drawdata=g.getFileData(),v=null!=v.getTitle()?v.getTitle():g.defaultFilename,g.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(g.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(v),null,!0))},null,null,null,navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown);"undefined"!==typeof MathJax&&(A=g.actions.addAction("mathematicalTypesetting",
+function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.mathEnabled=!g.isMathEnabled();u.model.execute(v)}),A.setToggleAction(!0),A.setSelectedCallback(function(){return g.isMathEnabled()}),A.isEnabled=y);A=g.actions.put("defaultAdaptiveColors",new Action("defaultAdaptiveColors",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="default";u.model.execute(v)}));A.getTitle=function(){return mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+
+")"};A.setToggleAction(!0);A.setSelectedCallback(function(){return null==u.adaptiveColors});A=g.actions.put("automaticAdaptiveColors",new Action("automatic",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="auto";u.model.execute(v)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return"auto"==u.adaptiveColors});A=g.actions.put("simpleAdaptiveColors",new Action("simple",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors=
+"simple";u.model.execute(v)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return"simple"==u.adaptiveColors});A=g.actions.put("noAdaptiveColors",new Action("none",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="none";u.model.execute(v)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return"none"==u.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["defaultAdaptiveColors","-","automaticAdaptiveColors",
+"simpleAdaptiveColors","noAdaptiveColors"],d)})));var E=g.actions.addAction("autosave",function(){g.editor.setAutosave(!g.editor.autosave)});E.setToggleAction(!0);E.setSelectedCallback(function(){return E.isEnabled()&&g.editor.autosave});g.actions.addAction("editGeometry...",function(){for(var v=u.getSelectionCells(),d=[],m=0;m<v.length;m++)u.getModel().isVertex(v[m])&&d.push(v[m]);0<d.length&&(v=new EditGeometryDialog(g,d),g.showDialog(v.container,300,null,!0,!0),v.init())},null,null,Editor.ctrlKey+
+"+"+Editor.shiftKey+"+M");g.actions.addAction("copyStyle",function(){if(u.isEnabled()&&1==u.getSelectionCount()){var v=u.getSelectionCell(),d=u.getCellStyle(v,!1);g.copiedStyle={};var m=[],x=[],C;for(C in d)m.push(d[C]),x.push(C);u.copyCellStyles([v],x,m,g.copiedStyle,g.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");g.actions.addAction("pasteStyle",function(){u.isEnabled()&&!u.isSelectionEmpty()&&null!=g.copiedStyle&&u.pasteCellStyles(u.includeDescendantParts(u.getSelectionCells()),
+g.copiedStyle,g.copiedStyle,!0)},null,null,Editor.altKey+"+V");g.actions.addAction("copyTextStyle",function(){if(u.isEnabled()&&1==u.getSelectionCount()){var v=u.getSelectionCell();v=u.getCellStyle(v,!1);g.copiedTextStyle={};for(var d=0;d<Graph.pasteTextStyles.length;d++){var m=Graph.pasteTextStyles[d];null!=v[m]?g.copiedTextStyle[m]=v[m]:"fontStyle"==m&&(g.copiedTextStyle[m]=0)}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("pasteTextStyle",function(){u.isEnabled()&&!u.isSelectionEmpty()&&
+null!=g.copiedTextStyle&&u.pasteTextStyles(u.includeDescendantParts(u.getSelectionCells()),g.copiedTextStyle)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");g.actions.put("exportSvg",new Action("formatSvg...",function(){g.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(v,d,m,x,C,F,G,K,Q,ba,T,Z,X,da,R,Y,ca){v=parseInt(v);g.lastExportSvgEditable=C;!isNaN(v)&&0<v&&g.exportSvg(v/100,d,m,x,C,F,G,!K,
+Q,ba,Z,X,da,null,R,T,ca)}),!0,g.lastExportSvgEditable,"svg",!0)}));g.actions.put("exportPng",new Action("formatPng...",function(){p("png",g.lastExportPngEditable,function(v,d,m,x,C){g.lastExportPngEditable=C})}));g.actions.put("exportJpg",new Action("formatJpg...",function(){p("jpeg")}));g.actions.put("exportWebp",new Action("formatWebp...",function(){p("webp")}));g.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif")+"...",function(){g.showAnimatedGifExportDialog()}));
+A=g.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var v=mxUtils.sortCells(u.model.getTopmostCells(u.getSelectionCells()));g.copyImage(v)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");A.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();A=g.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var v=mxUtils.sortCells(u.model.getTopmostCells(u.getSelectionCells()));g.copySvg(v)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");A.visible=Editor.enableNativeClipboard&&
+g.editor.isExportToCanvas();A=g.actions.put("shadowVisible",new Action("shadow",function(){u.setShadowVisible(!u.shadowVisible)}));A.setToggleAction(!0);A.setSelectedCallback(function(){return u.shadowVisible});g.actions.put("about",new Action("v"+EditorUi.VERSION,function(v,d){mxEvent.isShiftDown(d)&&(EditorUi.isElectronApp||g.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));g.actions.addAction("support...",
+function(){EditorUi.isElectronApp?g.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):g.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});g.actions.addAction("downloadDesktop...",function(){g.openLink("https://get.diagrams.net/")});g.actions.addAction("exportOptionsDisabled...",function(){g.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});g.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||
+EditorUi.isElectronApp||navigator.standalone?g.openLink("https://app.diagrams.net/shortcuts.svg"):g.openLink("shortcuts.svg")});g.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?g.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):g.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});A=g.actions.addAction("tags",mxUtils.bind(this,function(){if(null==this.tagsWindow){var v=mxSettings.getWindowState("tags");this.tagsWindow=new TagsWindow(g,null!=v&&null!=
+v.x?v.x:document.body.offsetWidth-400,null!=v&&null!=v.y?v.y:60,null!=v&&null!=v.w?v.w:212,null!=v&&null!=v.h?v.h:200);this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("tags"))}));this.tagsWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("tags"))});g.installWindowPersistence("tags",this.tagsWindow);null!=v&&g.restoreWindowState("tags",this.tagsWindow);this.tagsWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("tags"))}else this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),
+null,null,Editor.ctrlKey+"+K");A.setToggleAction(!0);A.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));A=g.actions.addAction("animation",mxUtils.bind(this,function(){if(null==this.animationWindow){var v=mxSettings.getWindowState("animation");this.animationWindow=new AnimationDialog(g,null!=v&&null!=v.x?v.x:Math.max(0,(document.body.offsetWidth-480)/2),null!=v&&null!=v.y?v.y:120,null!=v&&null!=v.w?v.w:480,null!=v&&null!=v.h?v.h:460);
+this.animationWindow.window.addListener("show",mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("animation"))}));this.animationWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("animation"))});g.installWindowPersistence("animation",this.animationWindow);null!=v&&g.restoreWindowState("animation",this.animationWindow);this.animationWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("animation"))}else this.animationWindow.window.setVisible(!this.animationWindow.window.isVisible())}));
+A.setToggleAction(!0);A.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.animationWindow&&this.animationWindow.window.isVisible()}));(EditorUi.isElectronApp&&(Editor.enableAi||null==Editor.config||null==Editor.config.enableAi&&null==Editor.config.enableChatGpt)||(Editor.enableAi||(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!g.isOffline()&&0<Editor.aiActions.length&&g.isExternalDataComms())&&
+"draw.io"==g.getServiceName()&&EditorUi.isMermaidSupported()&&(A=g.actions.put("generate",new Action("generate",function(){EditorUi.isElectronApp||Editor.enableAi?null!=g.chatWindow?g.chatWindow.window.setVisible(!g.chatWindow.window.isVisible()):g.openGenerateDialog(""):g.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),A.isEnabled=function(){return y()},A.setToggleAction(!0),A.setSelectedCallback(function(){return null!=
g.chatWindow&&g.chatWindow.window.isVisible()}));A=g.actions.addAction("findReplace",mxUtils.bind(this,function(v,d){g.showSearchWindow(u.isEnabled()&&(null==d||!mxEvent.isShiftDown(d)))}),null,null,Editor.ctrlKey+"+F");A=new Action("exportVsdx",function(){var v=null==g.pages||1>=g.pages.length;if(v)g.exportVisio();else{var d=document.createElement("div");d.style.whiteSpace="nowrap";var m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatVsdx"));d.appendChild(m);m=document.createElement("div");
m.className="geDialogSection";var x=g.addCheckbox(m,mxResources.get("allPages"),!v,v);d.appendChild(m);v=new CustomDialog(g,d,mxUtils.bind(this,function(){g.exportVisio(!x.checked)}),null,mxResources.get("export"));g.showDialog(v.container,300,146,!0,!0)}});A.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};g.actions.put("exportVsdx",A);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&g.actions.addAction("configuration...",function(){var v=[[mxResources.get("reset"),
function(){g.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),g.hideDialog(),g.alert(mxResources.get("restartForChangeRequired"))}catch(m){g.handleError(m)}})}]];if(!g.isOfflineApp()&&isLocalStorage&&g.mode!=App.MODE_ATLAS){var d=g.actions.get("plugins");null==d||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||v.push([mxResources.get("plugins"),d.funct])}EditorUi.isElectronApp||v.push([mxResources.get("link"),
@@ -15421,22 +15431,22 @@ x("verticalFlow"),x("horizontalFlow"),v.addSeparator(d),x("verticalTree"),x("hor
P.execute(aa)}))},Q=document.createElement("div"),ba=function(ca,P){var aa=document.createElement("div");aa.style.marginBottom="8px";var ea=document.createElement("div");ea.style.display="inline-block";ea.style.width="180px";ea.style.verticalAlign="middle";mxUtils.write(ea,mxResources.get(ca)+": ");aa.appendChild(ea);P.style.width="160px";P.style.boxSizing="border-box";P.style.verticalAlign="middle";aa.appendChild(P);Q.appendChild(aa)},T=document.createElement("select"),Z=[mxResources.get("linear"),
mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],X=0;X<Z.length;X++){var da=document.createElement("option");mxUtils.write(da,Z[X]);da.value=X;2==X&&da.setAttribute("selected","selected");T.appendChild(da)}mxEvent.addListener(T,"change",function(){C=T.value});ba("orgChartType",T);var R=document.createElement("input");R.type="number";R.value=F;mxEvent.addListener(R,
"change",function(){F=R.value});ba("parentChildSpacing",R);var Y=document.createElement("input");Y.type="number";Y.value=G;mxEvent.addListener(Y,"change",function(){G=Y.value});ba("siblingSpacing",Y);ba=new CustomDialog(g,Q,function(){null==C&&(C=2);g.loadOrgChartLayouts(K)},null,null,"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");g.showDialog(ba.container,355,null,!0,!0)},d,null,y());v.addItem(mxResources.get("circle"),null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,
-function(){var C=g.getSelectedLayoutContainer();if(null!=C)g.setContainerChildLayout(C,"circleLayout");else{var F=new mxCircleLayout(u);g.executeLayout(function(){var G=u.getSelectionCell();if(null==G||0==u.getModel().getChildCount(G))G=u.getDefaultParent();F.execute(G);u.getModel().isVertex(G)&&u.updateGroupBounds([G],2*u.gridSize,!0)},!0)}}))}),d);v.addSeparator(d);"undefined"!==typeof LibavoidRouting&&v.addItem(mxResources.get("orthogonalRouting")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,
-function(){g.prompt(mxResources.get("spacing"),LibavoidRouting.shapeBufferDistance,mxUtils.bind(this,function(C){g.tryAndHandle(mxUtils.bind(this,function(){var F=parseFloat(C);LibavoidRouting.run(g,isNaN(F)?null:{shapeBufferDistance:F})}))}))}))}),d);v.addItem(mxResources.get("parallels")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,function(){var C=new mxParallelEdgeLayout(u);C.checkOverlap=!0;g.prompt(mxResources.get("spacing"),C.spacing,mxUtils.bind(this,function(F){g.tryAndHandle(mxUtils.bind(this,
-function(){C.spacing=F;g.lastLayoutSpec=[{layout:"mxParallelEdgeLayout",config:{spacing:C.spacing,checkOverlap:!0}}];var G=g.getSelectedLayoutContainer();null!=G?g.setContainerChildLayout(G,g.lastLayoutSpec):g.executeLayout(function(){C.execute(u.getDefaultParent(),u.isSelectionEmpty()?null:u.getSelectionCells())},!1)}))}))}))}),d);"undefined"!==typeof ElkLayout&&(v.addSeparator(d),g.menus.addSubmenu("legacyLayout",v,d,mxResources.get("legacyLayouts")));v.addSeparator(d);g.menus.addMenuItem(v,"runLayout",
-d,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(v,d){if(mxClient.IS_CHROMEAPP||!g.isOffline()&&!navigator.standalone){var m=v.addItem(mxResources.get("search")+":",null,null,d,null,null,!1);m.style.cursor="default";var x=document.createElement("input");x.setAttribute("type","text");x.setAttribute("size","25");x.style.borderWidth="1px";x.style.marginLeft="8px";mxEvent.addListener(x,"keydown",mxUtils.bind(this,function(C){var F=mxUtils.trim(x.value);
-13==C.keyCode&&0<F.length?(this.editorUi.searchHelp(F),x.value="",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==C.keyCode&&(x.value="")}));m.firstChild.nextSibling.appendChild(x);mxEvent.addGestureListeners(x,function(C){document.activeElement!=x&&x.focus();mxEvent.consume(C)},function(C){mxEvent.consume(C)},function(C){mxEvent.consume(C)});window.setTimeout(function(){x.focus()},0);EditorUi.isElectronApp?(g.actions.addAction("website...",function(){g.openLink("https://www.drawio.com")}),
-g.actions.addAction("check4Updates",function(){g.checkForUpdates()}),g.actions.put("desktopZoomIn",new Action("zoomIn",function(){g.desktopZoomIn()})),g.actions.put("desktopZoomOut",new Action("zoomOut",function(){g.desktopZoomOut()})),g.actions.put("desktopResetZoom",new Action("actualSize",function(){g.desktopResetZoom()})),this.addMenuItems(v,"- keyboardShortcuts quickStart website support -".split(" "),d),"1"!=urlParams.disableUpdate&&this.addMenuItems(v,["check4Updates","-"],d),this.addMenuItems(v,
-"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),d)):this.addMenuItems(v,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),d)}else this.addMenuItems(v,["keyboardShortcuts","-","about"],d);"1"==urlParams.test&&(v.addSeparator(d),this.addSubmenu("testDevelop",v,d))})));g.actions.addAction("languageCode...",function(){var v=new FilenameDialog(g,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(d){null!=d&&(Graph.diagramLanguage=
-0<d.length?d:null,Graph.translateDiagram=!0,u.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");g.showDialog(v.container,340,80,!0,!0);v.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["languageCode","-"],d);d=v.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;u.refresh()},d);Graph.translateDiagram||v.addCheckmark(d,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");
-mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.parse("testCheckPages=Check Pages");mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");mxResources.parse("testOptimize=Remove Inline Images");
-mxResources.parse("testPerformance=Performance");g.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!u.isSelectionEmpty()){var v=u.cloneCells(u.getSelectionCells()),d=u.getBoundingBoxFromGeometry(v,!0);v=u.moveCells(v,-d.x,-d.y);g.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+d.width+", "+d.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(u.encodeCells(v)))+"'),")}}));g.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function v(G){return null==
-G||null==G.boundingBox||!isNaN(G.boundingBox.x)&&!isNaN(G.boundingBox.y)&&!isNaN(G.boundingBox.width)&&!isNaN(G.boundingBox.height)}var d=u.isSelectionEmpty()?u.getGraphBounds():u.getBoundingBox(u.getSelectionCells()),m=u.view.translate,x=u.view.scale;u.insertVertex(u.getDefaultParent(),null,"",d.x/x-m.x,d.y/x-m.y,d.width/x,d.height/x,"fillColor=none;strokeColor=red;");var C=0,F=0;u.view.states.visit(function(G,K){G=!0;v(K.shape)||(console.log("invalid shape",K.cell.id,K.shape),G=!1);v(K.text)||(console.log("invalid text",
-K.cell.id,K.text),G=!1);G||C++;F++});console.log("states checked",F,"invalid",C)}));g.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var v=null!=g.pages&&null!=g.getCurrentFile()?g.getCurrentFile().getAnonymizedXmlForPages(g.pages):"";v=new TextareaDialog(g,"Paste Data:",v,function(d){if(0<d.length)try{var m=function(K){function Q(aa){if(null==P[aa]){if(P[aa]=!0,null!=Z[aa]){for(;0<Z[aa].length;){var ea=Z[aa].pop();Q(ea)}delete Z[aa]}}else mxLog.debug(ba+": Visited: "+aa)}var ba=K.parentNode.id,
-T=K.childNodes;K={};for(var Z={},X=null,da={},R=0;R<T.length;R++){var Y=T[R];if(null!=Y.id&&0<Y.id.length)if(null==K[Y.id]){K[Y.id]=Y.id;var ca=Y.getAttribute("parent");null==ca?null!=X?mxLog.debug(ba+": Multiple roots: "+Y.id):X=Y.id:(null==Z[ca]&&(Z[ca]=[]),Z[ca].push(Y.id))}else da[Y.id]=Y.id}T=Object.keys(da);0<T.length?(T=ba+": "+T.length+" Duplicates: "+T.join(", "),mxLog.debug(T+" (see console)")):mxLog.debug(ba+": Checked");var P={};null==X?mxLog.debug(ba+": No root"):(Q(X),Object.keys(P).length!=
-Object.keys(K).length&&(mxLog.debug(ba+": Invalid tree: (see console)"),console.log(ba+": Invalid tree",Z)))};"<"!=d.charAt(0)&&(d=Graph.decompress(d),mxLog.debug("See console for uncompressed XML"),console.log("xml",d));var x=mxUtils.parseXml(d),C=g.getPagesForNode(x.documentElement,"mxGraphModel");if(null!=C&&0<C.length)try{var F=g.getHashValueForPages(C);mxLog.debug("Checksum: ",F)}catch(K){mxLog.debug("Error: ",K.message)}else mxLog.debug("No pages found for checksum");var G=x.getElementsByTagName("root");
-for(d=0;d<G.length;d++)m(G[d]);mxLog.show()}catch(K){g.handleError(K),null!=window.console&&console.error(K)}});g.showDialog(v.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));v.init()}));var O=null;g.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=g.pages){var v=new TextareaDialog(g,"Diff/Sync:","",function(d){var m=g.getCurrentFile();if(0<d.length&&null!=m)try{var x=JSON.parse(d);m.patch([x],null,!0,!0);g.hideDialog()}catch(C){g.handleError(C)}},null,"Close",
-null,null,null,!0,null,"Patch",null,[["Snapshot",function(d,m){try{O=g.getPagesForXml(g.getFileData(!0)),v.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(O)}catch(x){g.handleError(x)}}],["Diff",function(d,m){try{v.textarea.value=JSON.stringify(g.diffPages(O,g.pages),null,2)}catch(x){g.handleError(x)}}]]);if(null==O)try{O=g.getPagesForXml(g.getFileData(!0)),v.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(O)}catch(d){g.handleError(d)}else v.textarea.value=
+function(){if(!g.applyLayoutToSelectedContainers("circleLayout")){var C=new mxCircleLayout(u);g.executeLayout(function(){var F=u.getSelectionCell();if(null==F||0==u.getModel().getChildCount(F))F=u.getDefaultParent();C.execute(F);u.getModel().isVertex(F)&&u.updateGroupBounds([F],2*u.gridSize,!0)},!0)}}))}),d);v.addSeparator(d);"undefined"!==typeof LibavoidRouting&&v.addItem(mxResources.get("orthogonalRouting")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,function(){g.prompt(mxResources.get("spacing"),
+LibavoidRouting.shapeBufferDistance,mxUtils.bind(this,function(C){g.tryAndHandle(mxUtils.bind(this,function(){var F=parseFloat(C);LibavoidRouting.run(g,isNaN(F)?null:{shapeBufferDistance:F})}))}))}))}),d);v.addItem(mxResources.get("parallels")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,function(){var C=new mxParallelEdgeLayout(u);C.checkOverlap=!0;g.prompt(mxResources.get("spacing"),C.spacing,mxUtils.bind(this,function(F){g.tryAndHandle(mxUtils.bind(this,function(){C.spacing=
+F;g.lastLayoutSpec=[{layout:"mxParallelEdgeLayout",config:{spacing:C.spacing,checkOverlap:!0}}];g.applyLayoutToSelectedContainers(g.lastLayoutSpec)||g.executeLayout(function(){C.execute(u.getDefaultParent(),u.isSelectionEmpty()?null:u.getSelectionCells())},!1)}))}))}))}),d);"undefined"!==typeof ElkLayout&&(v.addSeparator(d),g.menus.addSubmenu("legacyLayout",v,d,mxResources.get("legacyLayouts")));v.addSeparator(d);g.menus.addMenuItem(v,"runLayout",d,null,null,mxResources.get("custom")+"...")};this.put("help",
+new Menu(mxUtils.bind(this,function(v,d){if(mxClient.IS_CHROMEAPP||!g.isOffline()&&!navigator.standalone){var m=v.addItem(mxResources.get("search")+":",null,null,d,null,null,!1);m.style.cursor="default";var x=document.createElement("input");x.setAttribute("type","text");x.setAttribute("size","25");x.style.borderWidth="1px";x.style.marginLeft="8px";mxEvent.addListener(x,"keydown",mxUtils.bind(this,function(C){var F=mxUtils.trim(x.value);13==C.keyCode&&0<F.length?(this.editorUi.searchHelp(F),x.value=
+"",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==C.keyCode&&(x.value="")}));m.firstChild.nextSibling.appendChild(x);mxEvent.addGestureListeners(x,function(C){document.activeElement!=x&&x.focus();mxEvent.consume(C)},function(C){mxEvent.consume(C)},function(C){mxEvent.consume(C)});window.setTimeout(function(){x.focus()},0);EditorUi.isElectronApp?(g.actions.addAction("website...",function(){g.openLink("https://www.drawio.com")}),g.actions.addAction("check4Updates",
+function(){g.checkForUpdates()}),g.actions.put("desktopZoomIn",new Action("zoomIn",function(){g.desktopZoomIn()})),g.actions.put("desktopZoomOut",new Action("zoomOut",function(){g.desktopZoomOut()})),g.actions.put("desktopResetZoom",new Action("actualSize",function(){g.desktopResetZoom()})),this.addMenuItems(v,"- keyboardShortcuts quickStart website support -".split(" "),d),"1"!=urlParams.disableUpdate&&this.addMenuItems(v,["check4Updates","-"],d),this.addMenuItems(v,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),
+d)):this.addMenuItems(v,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),d)}else this.addMenuItems(v,["keyboardShortcuts","-","about"],d);"1"==urlParams.test&&(v.addSeparator(d),this.addSubmenu("testDevelop",v,d))})));g.actions.addAction("languageCode...",function(){var v=new FilenameDialog(g,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(d){null!=d&&(Graph.diagramLanguage=0<d.length?d:null,Graph.translateDiagram=!0,u.refresh())}),mxResources.get("languageCode"),
+null,null,"https://www.drawio.com/blog/translate-diagrams");g.showDialog(v.container,340,80,!0,!0);v.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["languageCode","-"],d);d=v.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;u.refresh()},d);Graph.translateDiagram||v.addCheckmark(d,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");mxResources.parse("showBoundingBox=Show bounding box");
+mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.parse("testCheckPages=Check Pages");mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");mxResources.parse("testOptimize=Remove Inline Images");mxResources.parse("testPerformance=Performance");
+g.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!u.isSelectionEmpty()){var v=u.cloneCells(u.getSelectionCells()),d=u.getBoundingBoxFromGeometry(v,!0);v=u.moveCells(v,-d.x,-d.y);g.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+d.width+", "+d.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(u.encodeCells(v)))+"'),")}}));g.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function v(G){return null==G||null==G.boundingBox||!isNaN(G.boundingBox.x)&&
+!isNaN(G.boundingBox.y)&&!isNaN(G.boundingBox.width)&&!isNaN(G.boundingBox.height)}var d=u.isSelectionEmpty()?u.getGraphBounds():u.getBoundingBox(u.getSelectionCells()),m=u.view.translate,x=u.view.scale;u.insertVertex(u.getDefaultParent(),null,"",d.x/x-m.x,d.y/x-m.y,d.width/x,d.height/x,"fillColor=none;strokeColor=red;");var C=0,F=0;u.view.states.visit(function(G,K){G=!0;v(K.shape)||(console.log("invalid shape",K.cell.id,K.shape),G=!1);v(K.text)||(console.log("invalid text",K.cell.id,K.text),G=!1);
+G||C++;F++});console.log("states checked",F,"invalid",C)}));g.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var v=null!=g.pages&&null!=g.getCurrentFile()?g.getCurrentFile().getAnonymizedXmlForPages(g.pages):"";v=new TextareaDialog(g,"Paste Data:",v,function(d){if(0<d.length)try{var m=function(K){function Q(aa){if(null==P[aa]){if(P[aa]=!0,null!=Z[aa]){for(;0<Z[aa].length;){var ea=Z[aa].pop();Q(ea)}delete Z[aa]}}else mxLog.debug(ba+": Visited: "+aa)}var ba=K.parentNode.id,T=K.childNodes;
+K={};for(var Z={},X=null,da={},R=0;R<T.length;R++){var Y=T[R];if(null!=Y.id&&0<Y.id.length)if(null==K[Y.id]){K[Y.id]=Y.id;var ca=Y.getAttribute("parent");null==ca?null!=X?mxLog.debug(ba+": Multiple roots: "+Y.id):X=Y.id:(null==Z[ca]&&(Z[ca]=[]),Z[ca].push(Y.id))}else da[Y.id]=Y.id}T=Object.keys(da);0<T.length?(T=ba+": "+T.length+" Duplicates: "+T.join(", "),mxLog.debug(T+" (see console)")):mxLog.debug(ba+": Checked");var P={};null==X?mxLog.debug(ba+": No root"):(Q(X),Object.keys(P).length!=Object.keys(K).length&&
+(mxLog.debug(ba+": Invalid tree: (see console)"),console.log(ba+": Invalid tree",Z)))};"<"!=d.charAt(0)&&(d=Graph.decompress(d),mxLog.debug("See console for uncompressed XML"),console.log("xml",d));var x=mxUtils.parseXml(d),C=g.getPagesForNode(x.documentElement,"mxGraphModel");if(null!=C&&0<C.length)try{var F=g.getHashValueForPages(C);mxLog.debug("Checksum: ",F)}catch(K){mxLog.debug("Error: ",K.message)}else mxLog.debug("No pages found for checksum");var G=x.getElementsByTagName("root");for(d=0;d<
+G.length;d++)m(G[d]);mxLog.show()}catch(K){g.handleError(K),null!=window.console&&console.error(K)}});g.showDialog(v.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));v.init()}));var O=null;g.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=g.pages){var v=new TextareaDialog(g,"Diff/Sync:","",function(d){var m=g.getCurrentFile();if(0<d.length&&null!=m)try{var x=JSON.parse(d);m.patch([x],null,!0,!0);g.hideDialog()}catch(C){g.handleError(C)}},null,"Close",null,null,
+null,!0,null,"Patch",null,[["Snapshot",function(d,m){try{O=g.getPagesForXml(g.getFileData(!0)),v.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(O)}catch(x){g.handleError(x)}}],["Diff",function(d,m){try{v.textarea.value=JSON.stringify(g.diffPages(O,g.pages),null,2)}catch(x){g.handleError(x)}}]]);if(null==O)try{O=g.getPagesForXml(g.getFileData(!0)),v.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(O)}catch(d){g.handleError(d)}else v.textarea.value=
JSON.stringify(g.diffPages(O,g.pages),null,2);g.showDialog(v.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));v.init()}else g.alert("No pages")}));g.actions.addAction("testChecksum",mxUtils.bind(this,function(){var v=g.getCurrentFile();null!=g.pages&&null!=v?g.spinner.spin(document.body,mxResources.get("loading"))&&v.getLatestVersion(function(d){g.spinner.stop();var m=g.getHashValueForPages(g.pages),x=v.getCurrentRevisionId(),C=g.getHashValueForPages(d.getShadowPages()),F=d.getDescriptorChecksum(d.getDescriptor()),
G=d.getCurrentRevisionId();console.log("Local File",[v],"modified",v.isModified(),"checksum",m);console.log("Remote File",[d],"rev",G==x,"desc",F==C,"checksum",C);g.alert("Checksums "+(C==m?"match":"no not match"))},function(d){console.log("Error getLatestVersion",d);g.handleError(d)}):console.log("Checksum: no file or pages")}));g.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var v=g.getCurrentFile();console.log("editorUi",g,"file",v);if(null!=v&&v.isRealtime()){console.log("Checksum ownPages",
g.getHashValueForPages(v.ownPages));console.log("Checksum theirPages",g.getHashValueForPages(v.theirPages));console.log("diff ownPages/theirPages",g.diffPages(v.ownPages,v.theirPages));var d=v.getShadowPages();null!=d&&(console.log("Checksum shadowPages",g.getHashValueForPages(d)),console.log("diff shadowPages/ownPages",g.diffPages(d,v.ownPages)),console.log("diff ownPages/shadowPages",g.diffPages(v.ownPages,d)),console.log("diff theirPages/shadowPages",g.diffPages(v.theirPages,d)));null!=v.sync&&
@@ -15488,8 +15498,8 @@ null!=v&&g.openLink(v.getFileUrl())}));g.actions.addAction("moveToFolder...",mxU
C=0;C<x.length;C++)m[x[C]]=urlParams[x[C]];urlParams.pages="1";urlParams["page-id"]=null!=g.currentPage?g.currentPage.getId():null;urlParams.nav="1";urlParams.layers="1";urlParams.dark=v?"1":"0";urlParams.toolbar="0";C=EditorUi.prototype.updateActionStates;var F=EditorUi.prototype.addBeforeUnloadListener,G=EditorUi.prototype.addChromelessClickHandler;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=
function(){};var K=new EditorUi(new Editor(!0),document.createElement("div"),!0);EditorUi.prototype.updateActionStates=C;EditorUi.prototype.addBeforeUnloadListener=F;EditorUi.prototype.addChromelessClickHandler=G;K.refresh=function(){};K.updateHashObject=function(){};var Q=K.editor.graph;C=Q.container;C.style.cssText="position:fixed;inset:0;overflow:hidden;outline:none;z-index:999";var ba=document.body.style.overflow;document.body.style.overflow="hidden";var T=document.createElement("div");T.style.cssText=
"position:fixed;top:10px;right:10px;z-index:1000;display:inline-flex;align-items:center;gap:2px;padding:4px;white-space:nowrap;cursor:default;border:1px solid;border-radius:6px;background-color:"+(v?"#2a2a2a":"#ffffff")+";border-color:"+(v?"#505050":"#e0e0e0")+";box-shadow:0 2px 6px "+(v?"rgba(0,0,0,0.4)":"rgba(0,0,0,0.1)");var Z=v?"invert(80%)":"none",X=function(P,aa,ea){var oa=document.createElement("img");oa.setAttribute("src",aa);oa.setAttribute("title",ea||"");oa.setAttribute("border","0");oa.style.cssText=
-"width:16px;height:16px;cursor:pointer;display:block;padding:2px;opacity:0.6;filter:"+Z;oa.className="geAdaptiveAsset";mxEvent.addListener(oa,"mouseenter",function(){oa.style.opacity="1"});mxEvent.addListener(oa,"mouseleave",function(){oa.style.opacity="0.6"});mxEvent.addListener(oa,"click",function(ra){P(ra);mxEvent.consume(ra)});T.appendChild(oa);return oa},da=function(){if(null!=K.pages&&1<K.pages.length){var P=X(function(aa){K.showPopupMenu(function(ea,oa){for(oa=0;oa<K.pages.length;oa++)(function(ra){var ta=
-ea.addItem(K.getShortPageName(K.pages[ra]),null,function(){K.selectPage(K.pages[ra]);K.lightboxFit();K.chromelessResize()}),na=K.pages[ra].getId();ta.setAttribute("title",K.pages[ra].getName()+" ("+(ra+1)+"/"+K.pages.length+")"+(null!=na?" ["+na+"]":""));K.pages[ra]==K.currentPage&&ea.addCheckmark(ta,Editor.checkmarkImage)})(oa)},mxEvent.getClientX(aa),mxEvent.getClientY(aa),aa)},Editor.chevronDownImage,mxResources.get("pages"));T.insertBefore(P,T.firstChild)}};X(function(){Q.zoomOut();K.chromelessResize(!1)},
+"width:16px;height:16px;cursor:pointer;display:block;padding:2px;opacity:0.6;filter:"+Z;oa.className="geAdaptiveAsset";mxEvent.addListener(oa,"mouseenter",function(){oa.style.opacity="1"});mxEvent.addListener(oa,"mouseleave",function(){oa.style.opacity="0.6"});mxEvent.addListener(oa,"click",function(sa){P(sa);mxEvent.consume(sa)});T.appendChild(oa);return oa},da=function(){if(null!=K.pages&&1<K.pages.length){var P=X(function(aa){K.showPopupMenu(function(ea,oa){for(oa=0;oa<K.pages.length;oa++)(function(sa){var ta=
+ea.addItem(K.getShortPageName(K.pages[sa]),null,function(){K.selectPage(K.pages[sa]);K.lightboxFit();K.chromelessResize()}),na=K.pages[sa].getId();ta.setAttribute("title",K.pages[sa].getName()+" ("+(sa+1)+"/"+K.pages.length+")"+(null!=na?" ["+na+"]":""));K.pages[sa]==K.currentPage&&ea.addCheckmark(ta,Editor.checkmarkImage)})(oa)},mxEvent.getClientX(aa),mxEvent.getClientY(aa),aa)},Editor.chevronDownImage,mxResources.get("pages"));T.insertBefore(P,T.firstChild)}};X(function(){Q.zoomOut();K.chromelessResize(!1)},
Editor.zoomOutImage,mxResources.get("zoomOut"));X(function(){Q.zoomIn();K.chromelessResize(!1)},Editor.zoomInImage,mxResources.get("zoomIn"));X(function(){1==Q.view.scale?K.lightboxFit():Q.zoomTo(1);K.chromelessResize(!1)},Editor.zoomFitImage,mxResources.get("smartFit"));X(function(){K.destroy()},Editor.closeImage,mxResources.get("close")+" (Escape)");var R=K.destroy;K.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",Y);g.keyHandler.setEnabled(ca);document.body.removeChild(d);
document.body.removeChild(T);document.body.style.overflow=ba;for(var P=0;P<x.length;P++)urlParams[x[P]]=m[x[P]];R.apply(this,arguments)};var Y=function(P){if(27==P.keyCode)K.destroy();else if((37==P.keyCode||39==P.keyCode)&&!mxEvent.isShiftDown(P)&&(mxEvent.isControlDown(P)||mxClient.IS_MAC&&mxEvent.isMetaDown(P))&&null!=K.pages&&1<K.pages.length){var aa=K.getSelectedPageIndex()+(39==P.keyCode?1:-1);0<=aa&&aa<K.pages.length&&(K.selectPage(K.pages[aa]),K.lightboxFit(),K.chromelessResize());mxEvent.consume(P)}},
ca=g.keyHandler.isEnabled();g.keyHandler.setEnabled(!1);mxEvent.addListener(document.documentElement,"keydown",Y);document.body.appendChild(C);document.body.appendChild(T);window.setTimeout(function(){try{K.setFileData(g.getFileData(!0)),da(),K.lightboxFit(),K.chromelessResize()}catch(P){K.handleError(P,null,function(){K.destroy()})}},0)}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var v=g.getCurrentFile();null!=v&&v.share()}catch(d){g.handleError(d)}})).isEnabled=
@@ -15670,11 +15680,12 @@ x=(R.getCenterY()-da.getCenterY())/r.view.scale)}}}}Q=W.apply(this,arguments);if
r.model.getTerminal(X[0],!0);C=this.cloneCell(X[0]);this.addEdge(C,r.getDefaultParent(),Z,Q[T])}}finally{this.model.endUpdate()}return Q};if(null!=t.sidebar){var I=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(d,m,x,C){var F=r.model,G=null;F.beginUpdate();try{if(G=I.apply(this,arguments),g(d))for(var K=0;K<G.length;K++)if(F.isEdge(G[K])&&null==F.getTerminal(G[K],!0)){F.setTerminal(G[K],d,!0);var Q=r.getCellGeometry(G[K]);Q.points=null;null!=Q.getTerminalPoint(!0)&&Q.setTerminalPoint(null,
!0)}}finally{F.endUpdate()}return G}}var N={67:t.actions.get("selectChildren"),88:t.actions.get("selectDescendants"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},U={67:t.actions.get("copyStyle"),86:t.actions.get("pasteStyle")},S=t.onKeyDown;t.onKeyDown=function(d){try{var m=r.getSelectionCell();if(r.isEnabled()&&!r.isEditing()&&null!=m){var x=mxEvent.isAltDown(d)&&mxEvent.isShiftDown(d)?N[d.keyCode]:mxEvent.isAltDown(d)?U[d.keyCode]:null;null!=x?(x.funct(d),mxEvent.consume(d)):
g(m)&&(x=null,0<r.getIncomingTreeEdges(m).length&&(9==d.which?x=mxEvent.isShiftDown(d)?c(m):f(m):13==d.which&&(x=O(m,!mxEvent.isShiftDown(d)))),null!=x&&0<x.length?(1==x.length&&r.model.isEdge(x[0])?r.setSelectionCell(r.model.getTerminal(x[0],!1)):r.setSelectionCell(x[x.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(r.view.getState(m)),r.startEditingAtCell(m),mxEvent.consume(d)):37==d.keyCode?(n(m,mxConstants.DIRECTION_WEST),mxEvent.consume(d)):38==d.keyCode?(n(m,mxConstants.DIRECTION_NORTH),
-mxEvent.consume(d)):39==d.keyCode?(n(m,mxConstants.DIRECTION_EAST),mxEvent.consume(d)):40==d.keyCode&&(n(m,mxConstants.DIRECTION_SOUTH),mxEvent.consume(d)))}}catch(C){t.handleError(C)}mxEvent.isConsumed(d)||S.apply(this,arguments)};var V=r.connectVertex;r.connectVertex=function(d,m,x,C,F,G,K,Q,ba){var T=r.getIncomingTreeEdges(d);if(g(d)){var Z=M(d),X=Z==mxConstants.DIRECTION_EAST||Z==mxConstants.DIRECTION_WEST,da=m==mxConstants.DIRECTION_EAST||m==mxConstants.DIRECTION_WEST;T=Z==m||0==T.length?f(d,
-m,ba):X==da?c(d,ba):O(d,m!=mxConstants.DIRECTION_NORTH&&m!=mxConstants.DIRECTION_WEST,ba);if(null!=Q)Q(T);else return T}else return V.apply(this,arguments)};r.getSubtree=function(d){var m=[d];!u(d)&&!g(d)||E(d)||r.traverse(d,!0,function(x,C){var F=null!=C&&r.isTreeEdge(C);F&&0>mxUtils.indexOf(m,C)&&m.push(C);(null==C||F)&&0>mxUtils.indexOf(m,x)&&m.push(x);return null==C||F});return m};var ja=r.isMoveIconVisible;r.isMoveIconVisible=function(d){return ja.apply(this,arguments)||q(d)};var v=r.getMoveIconDragCells;
-r.getMoveIconDragCells=function(d){return q(d)?this.getSubtree(d):v.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var p=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var g=p.apply(this,arguments),u=this.graph,y=this;return g.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");A.vertex=!0;var E=new mxCell("Parent",
-new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');E.vertex=!0;var J=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');J.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");
-M.geometry.relative=!0;M.edge=!0;E.insertEdge(M,!0);J.insertEdge(M,!1);A.insert(M);A.insert(E);A.insert(J);return y.createVertexTemplateFromCells([A],160,180,A.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");A.vertex=!0;var E=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
+mxEvent.consume(d)):39==d.keyCode?(n(m,mxConstants.DIRECTION_EAST),mxEvent.consume(d)):40==d.keyCode&&(n(m,mxConstants.DIRECTION_SOUTH),mxEvent.consume(d)))}}catch(C){t.handleError(C)}mxEvent.isConsumed(d)||S.apply(this,arguments)};var V=r.connectVertex;r.connectVertex=function(d,m,x,C,F,G,K,Q,ba){var T=r.getIncomingTreeEdges(d);if(g(d)){var Z=M(d),X=Z==mxConstants.DIRECTION_EAST||Z==mxConstants.DIRECTION_WEST,da=m==mxConstants.DIRECTION_EAST||m==mxConstants.DIRECTION_WEST;if(!(T=Z==m||0==T.length))a:{Z=
+z.getParent(d);if(null!=Z){Z=r.getCurrentCellStyle(Z);Z=null!=Z?Z.childLayout:null;if("flowLayout"==Z){T=!0;break a}try{var R=Graph.decodeChildLayout(Z);T=null!=R&&0<R.length&&null!=R[0]&&"elkLayered"==R[0].layout;break a}catch(Y){}}T=!1}X=T?f(d,m,ba):X==da?c(d,ba):O(d,m!=mxConstants.DIRECTION_NORTH&&m!=mxConstants.DIRECTION_WEST,ba);if(null!=Q)Q(X);else return X}else return V.apply(this,arguments)};r.getSubtree=function(d){var m=[d];!u(d)&&!g(d)||E(d)||r.traverse(d,!0,function(x,C){var F=null!=C&&
+r.isTreeEdge(C);F&&0>mxUtils.indexOf(m,C)&&m.push(C);(null==C||F)&&0>mxUtils.indexOf(m,x)&&m.push(x);return null==C||F});return m};var ja=r.isMoveIconVisible;r.isMoveIconVisible=function(d){return ja.apply(this,arguments)||q(d)};var v=r.getMoveIconDragCells;r.getMoveIconDragCells=function(d){return q(d)?this.getSubtree(d):v.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var p=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var g=p.apply(this,arguments),
+u=this.graph,y=this;return g.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");A.vertex=!0;var E=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');E.vertex=!0;var J=new mxCell("Child",new mxGeometry(140,140,120,40),
+'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');J.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");M.geometry.relative=!0;M.edge=!0;E.insertEdge(M,!0);J.insertEdge(M,!1);A.insert(M);A.insert(E);A.insert(J);return y.createVertexTemplateFromCells([A],160,180,A.value)}),
+this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");A.vertex=!0;var E=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
E.vertex=!0;var J=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');J.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");
M.geometry.relative=!0;M.edge=!0;E.insertEdge(M,!0);J.insertEdge(M,!1);var L=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
L.vertex=!0;var O=new mxCell("",new mxGeometry(0,0,0,0),M.style);O.geometry.relative=!0;O.edge=!0;E.insertEdge(O,!0);L.insertEdge(O,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
@@ -17563,120 +17574,120 @@ https://github.com/nodeca/pako/blob/main/LICENSE
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=e()}}(function(){return function s(a,o,h){function u(r,e){if(!o[r]){if(!a[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(l)return l(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var i=o[r]={exports:{}};a[r][0].call(i.exports,function(e){var t=a[r][1][e];return u(t||e)},i,i.exports,s,a,o,h)}return o[r].exports}for(var l="function"==typeof require&&require,e=0;e<h.length;e++)u(h[e]);return u}({1:[function(e,t,r){"use strict";var d=e("./utils"),c=e("./support"),p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,n,i,s,a,o,h=[],u=0,l=e.length,f=l,c="string"!==d.getTypeOf(e);u<e.length;)f=l-u,n=c?(t=e[u++],r=u<l?e[u++]:0,u<l?e[u++]:0):(t=e.charCodeAt(u++),r=u<l?e.charCodeAt(u++):0,u<l?e.charCodeAt(u++):0),i=t>>2,s=(3&t)<<4|r>>4,a=1<f?(15&r)<<2|n>>6:64,o=2<f?63&n:64,h.push(p.charAt(i)+p.charAt(s)+p.charAt(a)+p.charAt(o));return h.join("")},r.decode=function(e){var t,r,n,i,s,a,o=0,h=0,u="data:";if(e.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var l,f=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===p.charAt(64)&&f--,e.charAt(e.length-2)===p.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(l=c.uint8array?new Uint8Array(0|f):new Array(0|f);o<e.length;)t=p.indexOf(e.charAt(o++))<<2|(i=p.indexOf(e.charAt(o++)))>>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(o++)))>>2,n=(3&s)<<6|(a=p.indexOf(e.charAt(o++))),l[h++]=t,64!==s&&(l[h++]=r),64!==a&&(l[h++]=n);return l}},{"./support":30,"./utils":32}],2:[function(e,t,r){"use strict";var n=e("./external"),i=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){"use strict";var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(e){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){"use strict";var n=e("./utils");var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^i[255&(e^t[a])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^i[255&(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){"use strict";var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),s=e("./utils"),a=e("./stream/GenericWorker"),o=n?"uint8array":"array";function h(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",s.inherits(h,a),h.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,e.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(e){return new h("Deflate",e)},r.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){"use strict";function A(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function n(e,t,r,n,i,s){var a,o,h=e.file,u=e.compression,l=s!==O.utf8encode,f=I.transformTo("string",s(h.name)),c=I.transformTo("string",O.utf8encode(h.name)),d=h.comment,p=I.transformTo("string",s(d)),m=I.transformTo("string",O.utf8encode(d)),_=c.length!==h.name.length,g=m.length!==d.length,b="",v="",y="",w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),l||!_&&!g||(S|=2048);var z=0,C=0;w&&(z|=16),"UNIX"===i?(C=798,z|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,w)):(C=20,z|=function(e){return 63&(e||0)}(h.dosPermissions)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v=A(1,1)+A(B(f),4)+c,b+="up"+A(v.length,2)+v),g&&(y=A(1,1)+A(B(p),4)+m,b+="uc"+A(y.length,2)+y);var E="";return E+="\n\0",E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+"\0\0\0\0"+A(z,4)+A(n,4)+f+b+p}}var I=e("../utils"),i=e("../stream/GenericWorker"),O=e("../utf8"),B=e("../crc32"),R=e("../signature");function s(e,t,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(s,i),s.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},s.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=n(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},s.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=n(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return R.DATA_DESCRIPTOR+A(e.crc32,4)+A(e.compressedSize,4)+A(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},s.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,n=function(e,t,r,n,i){var s=I.transformTo("string",i(n));return R.CENTRAL_DIRECTORY_END+"\0\0\0\0"+A(e,2)+A(e,2)+A(t,4)+A(r,4)+A(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},s.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},s.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},s.prototype.error=function(e){var t=this._sources;if(!i.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},s.prototype.lock=function(){i.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=s},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){"use strict";var u=e("../compressions"),n=e("./ZipFileWorker");r.generateWorker=function(e,a,t){var o=new n(a.streamFiles,t,a.platform,a.encodeFileName),h=0;try{e.forEach(function(e,t){h++;var r=function(e,t){var r=e||t,n=u[r];if(!n)throw new Error(r+" is not a valid compression method !");return n}(t.options.compression,a.compression),n=t.options.compressionOptions||a.compressionOptions||{},i=t.dir,s=t.date;t._compressWorker(r,n).withStreamInfo("file",{name:e,dir:i,date:s,comment:t.comment||"",unixPermissions:t.unixPermissions,dosPermissions:t.dosPermissions}).pipe(o)}),o.entriesCount=h}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.10.0",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){"use strict";var u=e("./utils"),i=e("./external"),n=e("./utf8"),s=e("./zipEntries"),a=e("./stream/Crc32Probe"),l=e("./nodejsUtils");function f(n){return new i.Promise(function(e,t){var r=n.decompressed.getContentWorker().pipe(new a);r.on("error",function(e){t(e)}).on("end",function(){r.streamInfo.crc32!==n.decompressed.crc32?t(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}t.exports=function(e,o){var h=this;return o=u.extend(o||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:n.utf8decode}),l.isNode&&l.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):u.prepareContent("the loaded zip file",e,!0,o.optimizedBinaryString,o.base64).then(function(e){var t=new s(o);return t.load(e),t}).then(function(e){var t=[i.Promise.resolve(e)],r=e.files;if(o.checkCRC32)for(var n=0;n<r.length;n++)t.push(f(r[n]));return i.Promise.all(t)}).then(function(e){for(var t=e.shift(),r=t.files,n=0;n<r.length;n++){var i=r[n],s=i.fileNameStr,a=u.resolve(i.fileNameStr);h.file(a,i.decompressed,{binary:!0,optimizedBinaryString:!0,date:i.date,dir:i.dir,comment:i.fileCommentStr.length?i.fileCommentStr:null,unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions,createFolders:o.createFolders}),i.dir||(h.file(a).unsafeOriginalName=s)}return t.zipComment.length&&(h.comment=t.zipComment),h})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../stream/GenericWorker");function s(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(s,i),s.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},s.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){"use strict";var i=e("readable-stream").Readable;function n(e,t,r){i.call(this,t),this._helper=e;var n=this;e.on("data",function(e,t){n.push(e)||n._helper.pause(),r&&r(t)}).on("error",function(e){n.emit("error",e)}).on("end",function(){n.push(null)})}e("../utils").inherits(n,i),n.prototype._read=function(){this._helper.resume()},t.exports=n},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){"use strict";t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){"use strict";function s(e,t,r){var n,i=u.getTypeOf(t),s=u.extend(r||{},f);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=g(e)),s.createFolders&&(n=_(e))&&b.call(this,n,!0);var a="string"===i&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!a),(t instanceof c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string");var o=null;o=t instanceof c||t instanceof l?t:p.isNode&&p.isStream(t)?new m(e,t):u.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var h=new d(e,o,s);this.files[e]=h}var i=e("./utf8"),u=e("./utils"),l=e("./stream/GenericWorker"),a=e("./stream/StreamHelper"),f=e("./defaults"),c=e("./compressedObject"),d=e("./zipObject"),o=e("./generate"),p=e("./nodejsUtils"),m=e("./nodejs/NodejsStreamInputAdapter"),_=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},g=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},b=function(e,t){return t=void 0!==t?t:f.createFolders,e=g(e),this.files[e]||s.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function h(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var n={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(r){var n=[];return this.forEach(function(e,t){r(e,t)&&n.push(t)}),n},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,s.call(this,e,t,r),this;if(h(e)){var n=e;return this.filter(function(e,t){return!t.dir&&n.test(e)})}var i=this.files[this.root+e];return i&&!i.dir?i:null},folder:function(r){if(!r)return this;if(h(r))return this.filter(function(e,t){return t.dir&&r.test(e)});var e=this.root+r,t=b.call(this,e),n=this.clone();return n.root=t.name,n},remove:function(r){r=this.root+r;var e=this.files[r];if(e||("/"!==r.slice(-1)&&(r+="/"),e=this.files[r]),e&&!e.dir)delete this.files[r];else for(var t=this.filter(function(e,t){return t.name.slice(0,r.length)===r}),n=0;n<t.length;n++)delete this.files[t[n].name];return this},generate:function(e){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=u.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");u.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=o.generateWorker(this,r,n)}catch(e){(t=new l("error")).error(e)}return new a(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=n},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),s=this.length-4;0<=s;--s)if(this.data[s]===t&&this.data[s+1]===r&&this.data[s+2]===n&&this.data[s+3]===i)return s-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),s=this.readData(4);return t===s[0]&&r===s[1]&&n===s[2]&&i===s[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){"use strict";var n=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){"use strict";var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){"use strict";var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../support"),s=e("./ArrayReader"),a=e("./StringReader"),o=e("./NodeBufferReader"),h=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new h(n.transformTo("uint8array",e)):new s(n.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../utils");function s(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,t,r){"use strict";var h=e("../utils"),i=e("./ConvertWorker"),s=e("./GenericWorker"),u=e("../base64"),n=e("../support"),a=e("../external"),o=null;if(n.nodestream)try{o=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,o){return new a.Promise(function(t,r){var n=[],i=e._internalType,s=e._outputType,a=e._mimeType;e.on("data",function(e,t){n.push(e),o&&o(t)}).on("error",function(e){n=[],r(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return h.newBlob(h.transformTo("arraybuffer",t),r);case"base64":return u.encode(t);default:return h.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r<t.length;r++)s+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(s),r=0;r<t.length;r++)i.set(t[r],n),n+=t[r].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(i,n),a);t(e)}catch(e){r(e)}n=[]}).resume()})}function f(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=t,this._mimeType=r,h.checkSupport(n),this._worker=e.pipe(new i(n)),e.lock()}catch(e){this._worker=new s("error"),this._worker.error(e)}}f.prototype={accumulate:function(e){return l(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,function(e){t.call(r,e.data,e.meta)}):this._worker.on(e,function(){h.delay(t,arguments,r)}),this},resume:function(){return h.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(h.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new o(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer="undefined"!=typeof Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=0===new Blob([n],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=0===i.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,s){"use strict";for(var o=e("./utils"),h=e("./support"),r=e("./nodejsUtils"),n=e("./stream/GenericWorker"),u=new Array(256),i=0;i<256;i++)u[i]=252<=i?6:248<=i?5:240<=i?4:224<=i?3:192<=i?2:1;u[254]=u[254]=1;function a(){n.call(this,"utf-8 decode"),this.leftOver=null}function l(){n.call(this,"utf-8 encode")}s.utf8encode=function(e){return h.nodebuffer?r.newBufferFrom(e,"utf-8"):function(e){var t,r,n,i,s,a=e.length,o=0;for(i=0;i<a;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=h.uint8array?new Uint8Array(o):new Array(o),i=s=0;s<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[s++]=r:(r<2048?t[s++]=192|r>>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return h.nodebuffer?o.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,n,i,s=e.length,a=new Array(2*s);for(t=r=0;t<s;)if((n=e[t++])<128)a[r++]=n;else if(4<(i=u[n]))a[r++]=65533,t+=i-1;else{for(n&=2===i?31:3===i?15:7;1<i&&t<s;)n=n<<6|63&e[t++],i--;1<i?a[r++]=65533:n<65536?a[r++]=n:(n-=65536,a[r++]=55296|n>>10&1023,a[r++]=56320|1023&n)}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(e=o.transformTo(h.uint8array?"uint8array":"array",e))},o.inherits(a,n),a.prototype.processChunk=function(e){var t=o.transformTo(h.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&&(h.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=a,o.inherits(l,n),l.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,a){"use strict";var o=e("./support"),h=e("./base64"),r=e("./nodejsUtils"),u=e("./external");function n(e){return e}function l(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}e("setimmediate"),a.newBlob=function(t,r){a.checkSupport("blob");try{return new Blob([t],{type:r})}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(r)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var i={stringifyByChunk:function(e,t,r){var n=[],i=0,s=e.length;if(s<=r)return String.fromCharCode.apply(null,e);for(;i<s;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,s)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,s)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(e){return!1}}()}};function s(e){var t=65536,r=a.getTypeOf(e),n=!0;if("uint8array"===r?n=i.applyCanBeUsed.uint8array:"nodebuffer"===r&&(n=i.applyCanBeUsed.nodebuffer),n)for(;1<t;)try{return i.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return i.stringifyByChar(e)}function f(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}a.applyFromCharCode=s;var c={};c.string={string:n,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return c.string.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:function(e){return l(e,r.allocBuffer(e.length))}},c.array={string:s,array:n,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return r.newBufferFrom(e)}},c.arraybuffer={string:function(e){return s(new Uint8Array(e))},array:function(e){return f(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:n,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return r.newBufferFrom(new Uint8Array(e))}},c.uint8array={string:s,array:function(e){return f(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:n,nodebuffer:function(e){return r.newBufferFrom(e)}},c.nodebuffer={string:s,array:function(e){return f(e,new Array(e.length))},arraybuffer:function(e){return c.nodebuffer.uint8array(e).buffer},uint8array:function(e){return f(e,new Uint8Array(e.length))},nodebuffer:n},a.transformTo=function(e,t){if(t=t||"",!e)return t;a.checkSupport(e);var r=a.getTypeOf(t);return c[r][e](t)},a.resolve=function(e){for(var t=e.split("/"),r=[],n=0;n<t.length;n++){var i=t[n];"."===i||""===i&&0!==n&&n!==t.length-1||(".."===i?r.pop():r.push(i))}return r.join("/")},a.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":o.nodebuffer&&r.isBuffer(e)?"nodebuffer":o.uint8array&&e instanceof Uint8Array?"uint8array":o.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},a.checkSupport=function(e){if(!o[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},a.MAX_VALUE_16BITS=65535,a.MAX_VALUE_32BITS=-1,a.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},a.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[])})},a.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},a.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},a.prepareContent=function(r,e,n,i,s){return u.Promise.resolve(e).then(function(n){return o.blob&&(n instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(n)))&&"undefined"!=typeof FileReader?new u.Promise(function(t,r){var e=new FileReader;e.onload=function(e){t(e.target.result)},e.onerror=function(e){r(e.target.error)},e.readAsArrayBuffer(n)}):n}).then(function(e){var t=a.getTypeOf(e);return t?("arraybuffer"===t?e=a.transformTo("uint8array",e):"string"===t&&(s?e=h.decode(e):n&&!0!==i&&(e=function(e){return l(e,o.uint8array?new Uint8Array(e.length):new Array(e.length))}(e))),e):u.Promise.reject(new Error("Can't read the data of '"+r+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),s=e("./signature"),a=e("./zipEntry"),o=(e("./utf8"),e("./support"));function h(e){this.files=[],this.loadOptions=e}h.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=o.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(e<0)throw!this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(e);var t=e;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,s.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),s=e("./utils"),i=e("./compressedObject"),a=e("./crc32"),o=e("./utf8"),h=e("./compressions"),u=e("./support");function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in h)if(h.hasOwnProperty(t)&&h[t].magic===e)return h[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=s.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var i=s.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)?null:a(this.fileName)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)?null:a(this.fileComment)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null}},t.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){"use strict";function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var s=e("./stream/StreamHelper"),i=e("./stream/DataWorker"),a=e("./utf8"),o=e("./compressedObject"),h=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var i=!this._dataBinary;i&&!n&&(t=t.pipe(new a.Utf8EncodeWorker)),!i&&n&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new h("error")).error(e)}return new s(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof o&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof h?this._data:new i(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<u.length;f++)n.prototype[u[f]]=l;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,l,t){(function(t){"use strict";var r,n,e=t.MutationObserver||t.WebKitMutationObserver;if(e){var i=0,s=new e(u),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){u(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(u,0)};else{var o=new t.MessageChannel;o.port1.onmessage=u,r=function(){o.port2.postMessage(0)}}var h=[];function u(){var e,t;n=!0;for(var r=h.length;r;){for(t=h,h=[],e=-1;++e<r;)t[e]();r=h.length}n=!1}l.exports=function(e){1!==h.push(e)||n||r()}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){"use strict";var i=e("immediate");function u(){}var l={},s=["REJECTED"],a=["FULFILLED"],n=["PENDING"];function o(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=n,this.queue=[],this.outcome=void 0,e!==u&&d(this,e)}function h(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(t,r,n){i(function(){var e;try{e=r(n)}catch(e){return l.reject(t,e)}e===t?l.reject(t,new TypeError("Cannot resolve promise with itself")):l.resolve(t,e)})}function c(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,l.reject(t,e))}function i(e){r||(r=!0,l.resolve(t,e))}var s=p(function(){e(i,n)});"error"===s.status&&n(s.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=o).prototype.finally=function(t){if("function"!=typeof t)return this;var r=this.constructor;return this.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})})},o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var r=new this.constructor(u);this.state!==n?f(r,this.state===a?e:t,this.outcome):this.queue.push(new h(r,e,t));return r},h.prototype.callFulfilled=function(e){l.resolve(this.promise,e)},h.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)},h.prototype.callRejected=function(e){l.reject(this.promise,e)},h.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)},l.resolve=function(e,t){var r=p(c,t);if("error"===r.status)return l.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},l.reject=function(e,t){e.state=s,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},o.resolve=function(e){if(e instanceof this)return e;return l.resolve(new this(u),e)},o.reject=function(e){var t=new this(u);return l.reject(t,e)},o.all=function(e){var r=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);var s=new Array(n),a=0,t=-1,o=new this(u);for(;++t<n;)h(e[t],t);return o;function h(e,t){r.resolve(e).then(function(e){s[t]=e,++a!==n||i||(i=!0,l.resolve(o,s))},function(e){i||(i=!0,l.reject(o,e))})}},o.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);var i=-1,s=new this(u);for(;++i<r;)a=e[i],t.resolve(a).then(function(e){n||(n=!0,l.resolve(s,e))},function(e){n||(n=!0,l.reject(s,e))});var a;return s}},{immediate:36}],38:[function(e,t,r){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){"use strict";var a=e("./zlib/deflate"),o=e("./utils/common"),h=e("./utils/strings"),i=e("./zlib/messages"),s=e("./zlib/zstream"),u=Object.prototype.toString,l=0,f=-1,c=0,d=8;function p(e){if(!(this instanceof p))return new p(e);this.options=o.assign({level:f,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==l)throw new Error(i[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?h.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,n))!==l)throw new Error(i[r]);this._dict_set=!0}}function n(e,t){var r=new p(t);if(r.push(e,!0),r.err)throw r.msg||i[r.err];return r.result}p.prototype.push=function(e,t){var r,n,i=this.strm,s=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=h.string2buf(e):"[object ArrayBuffer]"===u.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new o.Buf8(s),i.next_out=0,i.avail_out=s),1!==(r=a.deflate(i,n))&&r!==l)return this.onEnd(r),!(this.ended=!0);0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(h.buf2binstring(o.shrinkBuf(i.output,i.next_out))):this.onData(o.shrinkBuf(i.output,i.next_out)))}while((0<i.avail_in||0===i.avail_out)&&1!==r);return 4===n?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===l):2!==n||(this.onEnd(l),!(i.avail_out=0))},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=p,r.deflate=n,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,n(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,n(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){"use strict";var c=e("./zlib/inflate"),d=e("./utils/common"),p=e("./utils/strings"),m=e("./zlib/constants"),n=e("./zlib/messages"),i=e("./zlib/zstream"),s=e("./zlib/gzheader"),_=Object.prototype.toString;function a(e){if(!(this instanceof a))return new a(e);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new i,this.strm.avail_out=0;var r=c.inflateInit2(this.strm,t.windowBits);if(r!==m.Z_OK)throw new Error(n[r]);this.header=new s,c.inflateGetHeader(this.strm,this.header)}function o(e,t){var r=new a(t);if(r.push(e,!0),r.err)throw r.msg||n[r.err];return r.result}a.prototype.push=function(e,t){var r,n,i,s,a,o,h=this.strm,u=this.options.chunkSize,l=this.options.dictionary,f=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?m.Z_FINISH:m.Z_NO_FLUSH,"string"==typeof e?h.input=p.binstring2buf(e):"[object ArrayBuffer]"===_.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new d.Buf8(u),h.next_out=0,h.avail_out=u),(r=c.inflate(h,m.Z_NO_FLUSH))===m.Z_NEED_DICT&&l&&(o="string"==typeof l?p.string2buf(l):"[object ArrayBuffer]"===_.call(l)?new Uint8Array(l):l,r=c.inflateSetDictionary(this.strm,o)),r===m.Z_BUF_ERROR&&!0===f&&(r=m.Z_OK,f=!1),r!==m.Z_STREAM_END&&r!==m.Z_OK)return this.onEnd(r),!(this.ended=!0);h.next_out&&(0!==h.avail_out&&r!==m.Z_STREAM_END&&(0!==h.avail_in||n!==m.Z_FINISH&&n!==m.Z_SYNC_FLUSH)||("string"===this.options.to?(i=p.utf8border(h.output,h.next_out),s=h.next_out-i,a=p.buf2string(h.output,i),h.next_out=s,h.avail_out=u-s,s&&d.arraySet(h.output,h.output,i,s,0),this.onData(a)):this.onData(d.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(f=!0)}while((0<h.avail_in||0===h.avail_out)&&r!==m.Z_STREAM_END);return r===m.Z_STREAM_END&&(n=m.Z_FINISH),n===m.Z_FINISH?(r=c.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===m.Z_OK):n!==m.Z_SYNC_FLUSH||(this.onEnd(m.Z_OK),!(h.avail_out=0))},a.prototype.onData=function(e){this.chunks.push(e)},a.prototype.onEnd=function(e){e===m.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=a,r.inflate=o,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,o(e,t)},r.ungzip=o},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){var t,r,n,i,s,a;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),t=i=0,r=e.length;t<r;t++)s=e[t],a.set(s,i),i+=s.length;return a}},s={arraySet:function(e,t,r,n,i){for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,s))},r.setTyped(n)},{}],42:[function(e,t,r){"use strict";var h=e("./common"),i=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var u=new h.Buf8(256),n=0;n<256;n++)u[n]=252<=n?6:248<=n?5:240<=n?4:224<=n?3:192<=n?2:1;function l(e,t){if(t<65537&&(e.subarray&&s||!e.subarray&&i))return String.fromCharCode.apply(null,h.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}u[254]=u[254]=1,r.string2buf=function(e){var t,r,n,i,s,a=e.length,o=0;for(i=0;i<a;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=new h.Buf8(o),i=s=0;s<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[s++]=r:(r<2048?t[s++]=192|r>>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new h.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,s,a=t||e.length,o=new Array(2*a);for(r=n=0;r<a;)if((i=e[r++])<128)o[n++]=i;else if(4<(s=u[i]))o[n++]=65533,r+=s-1;else{for(i&=2===s?31:3===s?15:7;1<s&&r<a;)i=i<<6|63&e[r++],s--;1<s?o[n++]=65533:i<65536?o[n++]=i:(i-=65536,o[n++]=55296|i>>10&1023,o[n++]=56320|1023&i)}return l(o,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3<r?2e3:r;s=s+(i=i+t[n++]|0)|0,--a;);i%=65521,s%=65521}return i|s<<16|0}},{}],44:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){"use strict";var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^i[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,r){"use strict";var h,c=e("../utils/common"),u=e("./trees"),d=e("./adler32"),p=e("./crc32"),n=e("./messages"),l=0,f=4,m=0,_=-2,g=-1,b=4,i=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(e,t){return e.msg=n[t],t}function T(e){return(e<<1)-(4<e?9:0)}function D(e){for(var t=e.length;0<=--t;)e[t]=0}function F(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(c.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function N(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function U(e,t){e.pending_buf[e.pending++]=t}function P(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function L(e,t){var r,n,i=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match,h=e.strstart>e.w_size-z?e.strstart-(e.w_size-z):0,u=e.window,l=e.w_mask,f=e.prev,c=e.strstart+S,d=u[s+a-1],p=u[s+a];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(u[(r=t)+a]===p&&u[r+a-1]===d&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&s<c);if(n=S-(c-s),s=c-S,a<n){if(e.match_start=t,o<=(a=n))break;d=u[s+a-1],p=u[s+a]}}}while((t=f[t&l])>h&&0!=--i);return a<=e.lookahead?a:e.lookahead}function j(e){var t,r,n,i,s,a,o,h,u,l,f=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-z)){for(c.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=r=e.hash_size;n=e.head[--t],e.head[t]=f<=n?n-f:0,--r;);for(t=r=f;n=e.prev[--t],e.prev[t]=f<=n?n-f:0,--r;);i+=f}if(0===e.strm.avail_in)break;if(a=e.strm,o=e.window,h=e.strstart+e.lookahead,u=i,l=void 0,l=a.avail_in,u<l&&(l=u),r=0===l?0:(a.avail_in-=l,c.arraySet(o,a.input,a.next_in,l,h),1===a.state.wrap?a.adler=d(a.adler,o,l,h):2===a.state.wrap&&(a.adler=p(a.adler,o,l,h)),a.next_in+=l,a.total_in+=l,l),e.lookahead+=r,e.lookahead+e.insert>=x)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+x-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<x)););}while(e.lookahead<z&&0!==e.strm.avail_in)}function Z(e,t){for(var r,n;;){if(e.lookahead<z){if(j(e),e.lookahead<z&&t===l)return A;if(0===e.lookahead)break}if(r=0,e.lookahead>=x&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-z&&(e.match_length=L(e,r)),e.match_length>=x)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=e.strstart<x-1?e.strstart:x-1,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}function W(e,t){for(var r,n,i;;){if(e.lookahead<z){if(j(e),e.lookahead<z&&t===l)return A;if(0===e.lookahead)break}if(r=0,e.lookahead>=x&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=x-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-z&&(e.match_length=L(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===x&&4096<e.strstart-e.match_start)&&(e.match_length=x-1)),e.prev_length>=x&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-x,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=x-1,e.strstart++,n&&(N(e,!1),0===e.strm.avail_out))return A}else if(e.match_available){if((n=u._tr_tally(e,0,e.window[e.strstart-1]))&&N(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return A}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=u._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<x-1?e.strstart:x-1,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}function M(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new c.Buf16(2*w),this.dyn_dtree=new c.Buf16(2*(2*a+1)),this.bl_tree=new c.Buf16(2*(2*o+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new c.Buf16(k+1),this.heap=new c.Buf16(2*s+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new c.Buf16(2*s+1),D(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function G(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=i,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?C:E,e.adler=2===t.wrap?0:1,t.last_flush=l,u._tr_init(t),m):R(e,_)}function K(e){var t=G(e);return t===m&&function(e){e.window_size=2*e.w_size,D(e.head),e.max_lazy_match=h[e.level].max_lazy,e.good_match=h[e.level].good_length,e.nice_match=h[e.level].nice_length,e.max_chain_length=h[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=x-1,e.match_available=0,e.ins_h=0}(e.state),t}function Y(e,t,r,n,i,s){if(!e)return _;var a=1;if(t===g&&(t=6),n<0?(a=0,n=-n):15<n&&(a=2,n-=16),i<1||y<i||r!==v||n<8||15<n||t<0||9<t||s<0||b<s)return R(e,_);8===n&&(n=9);var o=new H;return(e.state=o).strm=e,o.wrap=a,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+x-1)/x),o.window=new c.Buf8(2*o.w_size),o.head=new c.Buf16(o.hash_size),o.prev=new c.Buf16(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new c.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=s,o.method=r,K(e)}h=[new M(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(j(e),0===e.lookahead&&t===l)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,N(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start>=e.w_size-z&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(e,t){return Y(e,t,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?_:(e.state.gzhead=t,m):_},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5<t||t<0)return e?R(e,_):_;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||666===n.status&&t!==f)return R(e,0===e.avail_out?-5:_);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===C)if(2===n.wrap)e.adler=0,U(n,31),U(n,139),U(n,8),n.gzhead?(U(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),U(n,255&n.gzhead.time),U(n,n.gzhead.time>>8&255),U(n,n.gzhead.time>>16&255),U(n,n.gzhead.time>>24&255),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(U(n,255&n.gzhead.extra.length),U(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(U(n,0),U(n,0),U(n,0),U(n,0),U(n,0),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,3),n.status=E);else{var a=v+(n.w_bits-8<<4)<<8;a|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=E,P(n,a),0!==n.strstart&&(P(n,e.adler>>>16),P(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending!==n.pending_buf_size));)U(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,U(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,U(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&F(e),n.pending+2<=n.pending_buf_size&&(U(n,255&e.adler),U(n,e.adler>>8&255),e.adler=0,n.status=E)):n.status=E),0!==n.pending){if(F(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&&T(t)<=T(r)&&t!==f)return R(e,-5);if(666===n.status&&0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==l&&666!==n.status){var o=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(j(e),0===e.lookahead)){if(t===l)return A;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=S){if(j(e),e.lookahead<=S&&t===l)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0<e.strstart&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+S;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<s);e.match_length=S-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):h[n.level].func(n,t);if(o!==O&&o!==B||(n.status=666),o===A||o===O)return 0===e.avail_out&&(n.last_flush=-1),m;if(o===I&&(1===t?u._tr_align(n):5!==t&&(u._tr_stored_block(n,0,0,!1),3===t&&(D(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),F(e),0===e.avail_out))return n.last_flush=-1,m}return t!==f?m:n.wrap<=0?1:(2===n.wrap?(U(n,255&e.adler),U(n,e.adler>>8&255),U(n,e.adler>>16&255),U(n,e.adler>>24&255),U(n,255&e.total_in),U(n,e.total_in>>8&255),U(n,e.total_in>>16&255),U(n,e.total_in>>24&255)):(P(n,e.adler>>>16),P(n,65535&e.adler)),F(e),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?m:1)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==C&&69!==t&&73!==t&&91!==t&&103!==t&&t!==E&&666!==t?R(e,_):(e.state=null,t===E?R(e,-3):m):_},r.deflateSetDictionary=function(e,t){var r,n,i,s,a,o,h,u,l=t.length;if(!e||!e.state)return _;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==C||r.lookahead)return _;for(1===s&&(e.adler=d(e.adler,t,l,0)),r.wrap=0,l>=r.w_size&&(0===s&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new c.Buf8(r.w_size),c.arraySet(u,t,l-r.w_size,r.w_size,0),t=u,l=r.w_size),a=e.avail_in,o=e.next_in,h=e.input,e.avail_in=l,e.next_in=0,e.input=t,j(r);r.lookahead>=x;){for(n=r.strstart,i=r.lookahead-(x-1);r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+x-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--i;);r.strstart=n,r.lookahead=x-1,j(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=x-1,r.match_available=0,e.next_in=o,e.input=h,e.avail_in=a,r.wrap=s,m},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,i,s,a,o,h,u,l,f,c,d,p,m,_,g,b,v,y,w,k,x,S,z,C;r=e.state,n=e.next_in,z=e.input,i=n+(e.avail_in-5),s=e.next_out,C=e.output,a=s-(t-e.avail_out),o=s+(e.avail_out-257),h=r.dmax,u=r.wsize,l=r.whave,f=r.wnext,c=r.window,d=r.hold,p=r.bits,m=r.lencode,_=r.distcode,g=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;e:do{p<15&&(d+=z[n++]<<p,p+=8,d+=z[n++]<<p,p+=8),v=m[d&g];t:for(;;){if(d>>>=y=v>>>24,p-=y,0===(y=v>>>16&255))C[s++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(d&(1<<y)-1)];continue t}if(32&y){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&v,(y&=15)&&(p<y&&(d+=z[n++]<<p,p+=8),w+=d&(1<<y)-1,d>>>=y,p-=y),p<15&&(d+=z[n++]<<p,p+=8,d+=z[n++]<<p,p+=8),v=_[d&b];r:for(;;){if(d>>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(d&(1<<y)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&v,p<(y&=15)&&(d+=z[n++]<<p,(p+=8)<y&&(d+=z[n++]<<p,p+=8)),h<(k+=d&(1<<y)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=y,p-=y,(y=s-a)<k){if(l<(y=k-y)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=c,(x=0)===f){if(x+=u-y,y<w){for(w-=y;C[s++]=c[x++],--y;);x=s-k,S=C}}else if(f<y){if(x+=u+f-y,(y-=f)<w){for(w-=y;C[s++]=c[x++],--y;);if(x=0,f<w){for(w-=y=f;C[s++]=c[x++],--y;);x=s-k,S=C}}}else if(x+=f-y,y<w){for(w-=y;C[s++]=c[x++],--y;);x=s-k,S=C}for(;2<w;)C[s++]=S[x++],C[s++]=S[x++],C[s++]=S[x++],w-=3;w&&(C[s++]=S[x++],1<w&&(C[s++]=S[x++]))}else{for(x=s-k;C[s++]=C[x++],C[s++]=C[x++],C[s++]=C[x++],2<(w-=3););w&&(C[s++]=C[x++],1<w&&(C[s++]=C[x++]))}break}}break}}while(n<i&&s<o);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=s<o?o-s+257:257-(s-o),r.hold=d,r.bits=p}},{}],49:[function(e,t,r){"use strict";var I=e("../utils/common"),O=e("./adler32"),B=e("./crc32"),R=e("./inffast"),T=e("./inftrees"),D=1,F=2,N=0,U=-2,P=1,n=852,i=592;function L(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new I.Buf32(n),t.distcode=t.distdyn=new I.Buf32(i),t.sane=1,t.back=-1,N):U}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):U}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?U:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,o(e))):U}function u(e,t){var r,n;return e?(n=new s,(e.state=n).window=null,(r=h(e,t))!==N&&(e.state=null),r):U}var l,f,c=!0;function j(e){if(c){var t;for(l=new I.Buf32(512),f=new I.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(T(D,e.lens,0,288,l,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;T(F,e.lens,0,32,f,0,e.work,{bits:5}),c=!1}e.lencode=l,e.lenbits=9,e.distcode=f,e.distbits=5}function Z(e,t,r,n){var i,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new I.Buf8(s.wsize)),n>=s.wsize?(I.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),I.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(I.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}r.inflateReset=o,r.inflateReset2=h,r.inflateResetKeep=a,r.inflateInit=function(e){return u(e,15)},r.inflateInit2=u,r.inflate=function(e,t){var r,n,i,s,a,o,h,u,l,f,c,d,p,m,_,g,b,v,y,w,k,x,S,z,C=0,E=new I.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return U;12===(r=e.state).mode&&(r.mode=13),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,f=o,c=h,x=N;e:for(;;)switch(r.mode){case P:if(0===r.wrap){r.mode=13;break}for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(2&r.wrap&&35615===u){E[r.check=0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<k,e.adler=r.check=1,r.mode=512&u?10:12,l=u=0;break;case 2:for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(r.flags=u,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.head&&(r.head.time=u),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(d=r.length)&&(d=o),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,n,s,d,k)),512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&d<o;);if(512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k)),k&&d<o;);if(512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,k)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(u!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}l=u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}e.adler=r.check=L(u),l=u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){u>>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}switch(r.last=1&u,l-=1,3&(u>>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,l-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(o<d&&(d=o),h<d&&(d=h),0===d)break e;I.arraySet(i,n,s,d,a),o-=d,s+=d,h-=d,a+=d,r.length-=d;break}r.mode=12;break;case 17:for(;l<14;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(r.nlen=257+(31&u),u>>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;l<3;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.lens[A[r.have++]]=7&u,u>>>=3,l-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;g=(C=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(b<16)u>>>=_,l-=_,r.lens[r.have++]=b;else{if(16===b){for(z=_+2;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(u>>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],d=3+(3&u),u>>>=2,l-=2}else if(17===b){for(z=_+3;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}l-=_,k=0,d=3+(7&(u>>>=_)),u>>>=3,l-=3}else{for(z=_+7;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}l-=_,k=0,d=11+(127&(u>>>=_)),u>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=h){e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,R(e,c),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(g&&0==(240&g)){for(v=_,y=g,w=b;g=(C=r.lencode[w+((u&(1<<v+y)-1)>>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}u>>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<<r.distbits)-1])>>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(0==(240&g)){for(v=_,y=g,w=b;g=(C=r.distcode[w+((u&(1<<v+y)-1)>>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}u>>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,64&g){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===h)break e;if(d=c-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=a-r.offset,d=r.length;for(h<d&&(d=h),h-=d,r.length-=d;i[a++]=m[p++],--d;);0===r.length&&(r.mode=21);break;case 26:if(0===h)break e;i[a++]=r.length,h--,r.mode=21;break;case 27:if(r.wrap){for(;l<32;){if(0===o)break e;o--,u|=n[s++]<<l,l+=8}if(c-=h,e.total_out+=c,r.total+=c,c&&(e.adler=r.check=r.flags?B(r.check,i,c,a-c):O(r.check,i,c,a-c)),c=h,(r.flags?u:L(u))!==r.check){e.msg="incorrect data check",r.mode=30;break}l=u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;l<32;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(u!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}l=u=0}r.mode=29;case 29:x=1;break e;case 30:x=-3;break e;case 31:return-4;case 32:default:return U}return e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,(r.wsize||c!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&Z(e,e.output,e.next_out,c-e.avail_out)?(r.mode=31,-4):(f-=e.avail_in,c-=e.avail_out,e.total_in+=f,e.total_out+=c,r.total+=c,r.wrap&&c&&(e.adler=r.check=r.flags?B(r.check,i,c,e.next_out-c):O(r.check,i,c,e.next_out-c)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==f&&0===c||4===t)&&x===N&&(x=-5),x)},r.inflateEnd=function(e){if(!e||!e.state)return U;var t=e.state;return t.window&&(t.window=null),e.state=null,N},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?U:((r.head=t).done=!1,N):U},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?U:11===r.mode&&O(1,t,n,0)!==r.check?-3:Z(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,N):U},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){"use strict";var D=e("../utils/common"),F=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],N=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],U=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],P=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,n,i,s,a,o){var h,u,l,f,c,d,p,m,_,g=o.bits,b=0,v=0,y=0,w=0,k=0,x=0,S=0,z=0,C=0,E=0,A=null,I=0,O=new D.Buf16(16),B=new D.Buf16(16),R=null,T=0;for(b=0;b<=15;b++)O[b]=0;for(v=0;v<n;v++)O[t[r+v]]++;for(k=g,w=15;1<=w&&0===O[w];w--);if(w<k&&(k=w),0===w)return i[s++]=20971520,i[s++]=20971520,o.bits=1,0;for(y=1;y<w&&0===O[y];y++);for(k<y&&(k=y),b=z=1;b<=15;b++)if(z<<=1,(z-=O[b])<0)return-1;if(0<z&&(0===e||1!==w))return-1;for(B[1]=0,b=1;b<15;b++)B[b+1]=B[b]+O[b];for(v=0;v<n;v++)0!==t[r+v]&&(a[B[t[r+v]]++]=v);if(d=0===e?(A=R=a,19):1===e?(A=F,I-=257,R=N,T-=257,256):(A=U,R=P,-1),b=y,c=s,S=v=E=0,l=-1,f=(C=1<<(x=k))-1,1===e&&852<C||2===e&&592<C)return 1;for(;;){for(p=b-S,_=a[v]<d?(m=0,a[v]):a[v]>d?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<<b-S,y=u=1<<x;i[c+(E>>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<<b-1;E&h;)h>>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=t[r+a[v]]}if(k<b&&(E&f)!==l){for(0===S&&(S=k),c+=y,z=1<<(x=b-S);x+S<w&&!((z-=O[x+S])<=0);)x++,z<<=1;if(C+=1<<x,1===e&&852<C||2===e&&592<C)return 1;i[l=E&f]=k<<24|x<<16|c-s|0}}return 0!==E&&(i[c+E]=b-S<<24|64<<16|0),o.bits=k,0}},{"../utils/common":41}],51:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){"use strict";var i=e("../utils/common"),o=0,h=1;function n(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,a=29,u=256,l=u+1+a,f=30,c=19,_=2*l+1,g=15,d=16,p=7,m=256,b=16,v=17,y=18,w=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],k=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],S=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],z=new Array(2*(l+2));n(z);var C=new Array(2*f);n(C);var E=new Array(512);n(E);var A=new Array(256);n(A);var I=new Array(a);n(I);var O,B,R,T=new Array(f);function D(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function N(e){return e<256?E[e]:E[256+(e>>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function P(e,t,r){e.bi_valid>d-r?(e.bi_buf|=t<<e.bi_valid&65535,U(e,e.bi_buf),e.bi_buf=t>>d-e.bi_valid,e.bi_valid+=r-d):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function L(e,t,r){P(e,r[2*t],r[2*t+1])}function j(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function Z(e,t,r){var n,i,s=new Array(g+1),a=0;for(n=1;n<=g;n++)s[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=j(s[o]++,o))}}function W(e){var t;for(t=0;t<l;t++)e.dyn_ltree[2*t]=0;for(t=0;t<f;t++)e.dyn_dtree[2*t]=0;for(t=0;t<c;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*m]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function M(e){8<e.bi_valid?U(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function H(e,t,r,n){var i=2*t,s=2*r;return e[i]<e[s]||e[i]===e[s]&&n[t]<=n[r]}function G(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&H(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!H(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function K(e,t,r){var n,i,s,a,o=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],i=e.pending_buf[e.l_buf+o],o++,0===n?L(e,i,t):(L(e,(s=A[i])+u+1,t),0!==(a=w[s])&&P(e,i-=I[s],a),L(e,s=N(--n),r),0!==(a=k[s])&&P(e,n-=T[s],a)),o<e.last_lit;);L(e,m,t)}function Y(e,t){var r,n,i,s=t.dyn_tree,a=t.stat_desc.static_tree,o=t.stat_desc.has_stree,h=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=_,r=0;r<h;r++)0!==s[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len<2;)s[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,o&&(e.static_len-=a[2*i+1]);for(t.max_code=u,r=e.heap_len>>1;1<=r;r--)G(e,s,r);for(i=h;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,G(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,a,o,h=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=g;s++)e.bl_count[s]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<_;r++)p<(s=h[2*h[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),h[2*n+1]=s,u<n||(e.bl_count[s]++,a=0,d<=n&&(a=c[n-d]),o=h[2*n],e.opt_len+=o*(s+a),f&&(e.static_len+=o*(l[2*n+1]+a)));if(0!==m){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,m-=2}while(0<m);for(s=p;0!==s;s--)for(n=e.bl_count[s];0!==n;)u<(i=e.heap[--r])||(h[2*i+1]!==s&&(e.opt_len+=(s-h[2*i+1])*h[2*i],h[2*i+1]=s),n--)}}(e,t),Z(s,u,e.bl_count)}function X(e,t,r){var n,i,s=-1,a=t[1],o=0,h=7,u=4;for(0===a&&(h=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++o<h&&i===a||(o<u?e.bl_tree[2*i]+=o:0!==i?(i!==s&&e.bl_tree[2*i]++,e.bl_tree[2*b]++):o<=10?e.bl_tree[2*v]++:e.bl_tree[2*y]++,s=i,u=(o=0)===a?(h=138,3):i===a?(h=6,3):(h=7,4))}function V(e,t,r){var n,i,s=-1,a=t[1],o=0,h=7,u=4;for(0===a&&(h=138,u=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++o<h&&i===a)){if(o<u)for(;L(e,i,e.bl_tree),0!=--o;);else 0!==i?(i!==s&&(L(e,i,e.bl_tree),o--),L(e,b,e.bl_tree),P(e,o-3,2)):o<=10?(L(e,v,e.bl_tree),P(e,o-3,3)):(L(e,y,e.bl_tree),P(e,o-11,7));s=i,u=(o=0)===a?(h=138,3):i===a?(h=6,3):(h=7,4)}}n(T);var q=!1;function J(e,t,r,n){P(e,(s<<1)+(n?1:0),3),function(e,t,r,n){M(e),n&&(U(e,r),U(e,~r)),i.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}r._tr_init=function(e){q||(function(){var e,t,r,n,i,s=new Array(g+1);for(n=r=0;n<a-1;n++)for(I[n]=r,e=0;e<1<<w[n];e++)A[r++]=n;for(A[r-1]=n,n=i=0;n<16;n++)for(T[n]=i,e=0;e<1<<k[n];e++)E[i++]=n;for(i>>=7;n<f;n++)for(T[n]=i<<7,e=0;e<1<<k[n]-7;e++)E[256+i++]=n;for(t=0;t<=g;t++)s[t]=0;for(e=0;e<=143;)z[2*e+1]=8,e++,s[8]++;for(;e<=255;)z[2*e+1]=9,e++,s[9]++;for(;e<=279;)z[2*e+1]=7,e++,s[7]++;for(;e<=287;)z[2*e+1]=8,e++,s[8]++;for(Z(z,l+1,s),e=0;e<f;e++)C[2*e+1]=5,C[2*e]=j(e,5);O=new D(z,w,u+1,l,g),B=new D(C,k,0,f,g),R=new D(new Array(0),x,0,c,p)}(),q=!0),e.l_desc=new F(e.dyn_ltree,O),e.d_desc=new F(e.dyn_dtree,B),e.bl_desc=new F(e.bl_tree,R),e.bi_buf=0,e.bi_valid=0,W(e)},r._tr_stored_block=J,r._tr_flush_block=function(e,t,r,n){var i,s,a=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(t=32;t<u;t++)if(0!==e.dyn_ltree[2*t])return h;return o}(e)),Y(e,e.l_desc),Y(e,e.d_desc),a=function(e){var t;for(X(e,e.dyn_ltree,e.l_desc.max_code),X(e,e.dyn_dtree,e.d_desc.max_code),Y(e,e.bl_desc),t=c-1;3<=t&&0===e.bl_tree[2*S[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?J(e,t,r,n):4===e.strategy||s===i?(P(e,2+(n?1:0),3),K(e,z,C)):(P(e,4+(n?1:0),3),function(e,t,r,n){var i;for(P(e,t-257,5),P(e,r-1,5),P(e,n-4,4),i=0;i<n;i++)P(e,e.bl_tree[2*S[i]+1],3);V(e,e.dyn_ltree,t-1),V(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),K(e,e.dyn_ltree,e.dyn_dtree)),W(e),n&&M(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(A[r]+u+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){P(e,2,3),L(e,m,z),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){(function(e){!function(r,n){"use strict";if(!r.setImmediate){var i,s,t,a,o=1,h={},u=!1,l=r.document,e=Object.getPrototypeOf&&Object.getPrototypeOf(r);e=e&&e.setTimeout?e:r,i="[object process]"==={}.toString.call(r.process)?function(e){process.nextTick(function(){c(e)})}:function(){if(r.postMessage&&!r.importScripts){var e=!0,t=r.onmessage;return r.onmessage=function(){e=!1},r.postMessage("","*"),r.onmessage=t,e}}()?(a="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",d,!1):r.attachEvent("onmessage",d),function(e){r.postMessage(a+e,"*")}):r.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){c(e.data)},function(e){t.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(s=l.documentElement,function(e){var t=l.createElement("script");t.onreadystatechange=function(){c(e),t.onreadystatechange=null,s.removeChild(t),t=null},s.appendChild(t)}):function(e){setTimeout(c,0,e)},e.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var n={callback:e,args:t};return h[o]=n,i(o),o++},e.clearImmediate=f}function f(e){delete h[e]}function c(e){if(u)setTimeout(c,0,e);else{var t=h[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{f(e),u=!1}}}}function d(e){e.source===r&&"string"==typeof e.data&&0===e.data.indexOf(a)&&c(+e.data.slice(a.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)});
-/*! @drawio/elk 0.1.0+commit.ddfc94b (built 2026-08-27) */
+/*! @drawio/elk 0.1.0+commit.09eed5e (built 2026-09-11) */
var ELK=(()=>{var Pl=Object.defineProperty;var AO=Object.getOwnPropertyDescriptor;var CO=Object.getOwnPropertyNames;var xO=Object.prototype.hasOwnProperty;var zf=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),Yf=n=>{throw TypeError(n)};var DO=(n,t,e)=>t in n?Pl(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var mp=(n,t)=>{for(var e in t)Pl(n,e,{get:t[e],enumerable:!0})},wO=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of CO(t))!xO.call(n,r)&&r!==e&&Pl(n,r,{get:()=>t[r],enumerable:!(o=AO(t,r))||o.enumerable});return n};var MO=n=>wO(Pl({},"__esModule",{value:!0}),n);var Z=(n,t,e)=>DO(n,typeof t!="symbol"?t+"":t,e),Pp=(n,t,e)=>t.has(n)||Yf("Cannot "+e);var $i=(n,t,e)=>(Pp(n,t,"read from private field"),e?e.call(n):t.get(n)),Vf=(n,t,e)=>t.has(n)?Yf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Xf=(n,t,e,o)=>(Pp(n,t,"write to private field"),o?o.call(n,e):t.set(n,e),e);var bO=function(n,t){this[0]=n,this[1]=t};var nr=n=>{var t=n[zf("asyncIterator")],e=!1,o,r={};return t==null?(t=n[zf("iterator")](),o=i=>r[i]=s=>t[i](s)):(t=t.call(n),o=i=>r[i]=s=>{if(e){if(e=!1,i==="throw")throw s;return s}return e=!0,{done:!1,value:new bO(new Promise(a=>{var l=t[i](s);l instanceof Object||Yf("Object expected"),a(l)}),1)}}),r[zf("iterator")]=()=>r,o("next"),"throw"in t?o("throw"):r.throw=i=>{throw i},"return"in t&&o("return"),r};var DR={};mp(DR,{ElkAdapter:()=>_t,ElkApplier:()=>Rt,ElkLayout:()=>ht,default:()=>xR});var ge=class{constructor(){this._byId=null}setProperty(t,e){let o=Ol(t);return e==null?this._byId&&this._byId.delete(o):(this._byId||(this._byId=new Map),this._byId.set(o,{prop:t,value:e})),this}getProperty(t){let e=Ol(t);if(this._byId){let r=this._byId.get(e);if(r!==void 0)return r.value}let o=t.getDefault();return o!==null&&typeof o=="object"&&(typeof o.clone=="function"||o instanceof Set||o instanceof Map||Array.isArray(o))&&(this._byId||(this._byId=new Map),this._byId.set(e,{prop:t,value:o})),o}hasProperty(t){return this._byId!==null&&this._byId.has(Ol(t))}copyProperties(t){if(!t)return this;let e=t.getAllProperties();if(e.size>0){this._byId||(this._byId=new Map);for(let[o,r]of e)this._byId.set(Ol(o),{prop:o,value:r})}return this}getAllProperties(){if(!this._byId)return new Map;let t=new Map;for(let{prop:e,value:o}of this._byId.values())t.set(e,o);return t}};function Ol(n){return n==null?"":typeof n.getId=="function"?n.getId():n._id||n.id||""}var ui,vs,Ge=class extends Array{constructor(e,o){super();Vf(this,ui);Vf(this,vs);Xf(this,ui,e||null),Xf(this,vs,o||null)}static get[Symbol.species](){return Array}push(...e){for(let o of e)super.push(o),$i(this,ui)&&$i(this,ui).call(this,o);return this.length}splice(e,o,...r){let i=super.splice(e,o,...r);if($i(this,vs))for(let s of i)$i(this,vs).call(this,s);if($i(this,ui))for(let s of r)$i(this,ui).call(this,s);return i}add(e){return this.push(e),this}remove(e){let o=this.indexOf(e);return o>=0&&this.splice(o,1),this}isEmpty(){return this.length===0}clear(){this.splice(0,this.length)}get(e){return this[e]}};ui=new WeakMap,vs=new WeakMap;var qi=class extends ge{constructor(){super(),this.identifier=null,this.labels=new Ge(t=>{t._parent!==this&&(t._parent=this)},t=>{t._parent===this&&(t._parent=null)})}getIdentifier(){return this.identifier}setIdentifier(t){this.identifier=t}getLabels(){return this.labels}};var Ji=class extends qi{constructor(){super(),this.x=0,this.y=0,this.width=0,this.height=0}getX(){return this.x}setX(t){this.x=t}getY(){return this.y}setY(t){this.y=t}getWidth(){return this.width}setWidth(t){this.width=t}getHeight(){return this.height}setHeight(t){this.height=t}setLocation(t,e){this.x=t,this.y=e}setDimensions(t,e){this.width=t,this.height=e}};var Qi=class extends Ji{constructor(){super(),this.outgoingEdges=new Ge(t=>{t.sources.includes(this)||t.sources.push(this)},t=>{t.sources.remove(this)}),this.incomingEdges=new Ge(t=>{t.targets.includes(this)||t.targets.push(this)},t=>{t.targets.remove(this)})}getOutgoingEdges(){return this.outgoingEdges}getIncomingEdges(){return this.incomingEdges}};var Or=class extends Qi{constructor(){super(),this._parent=null,this.children=new Ge(t=>{t._parent!==this&&(t._parent=this)},t=>{t._parent===this&&(t._parent=null)}),this.ports=new Ge(t=>{t._parent!==this&&(t._parent=this)},t=>{t._parent===this&&(t._parent=null)}),this.containedEdges=new Ge(t=>{t._containingNode!==this&&(t._containingNode=this)},t=>{t._containingNode===this&&(t._containingNode=null)})}getParent(){return this._parent}setParent(t){if(this._parent===t)return;let e=this._parent;this._parent=t,e!==null&&e.children.remove(this),t!==null&&!t.children.includes(this)&&t.children.push(this)}get parent(){return this._parent}set parent(t){this.setParent(t)}getChildren(){return this.children}getPorts(){return this.ports}getContainedEdges(){return this.containedEdges}isHierarchical(){return this.children.length>0}};var Ve=class extends Qi{constructor(){super(),this._parent=null}getParent(){return this._parent}setParent(t){if(this._parent===t)return;let e=this._parent;this._parent=t,e!==null&&e.ports.remove(this),t!==null&&!t.ports.includes(this)&&t.ports.push(this)}get parent(){return this._parent}set parent(t){this.setParent(t)}};var Bs=class extends qi{constructor(){super(),this._containingNode=null,this.sources=new Ge(t=>{t.outgoingEdges.includes(this)||t.outgoingEdges.push(this)},t=>{t.outgoingEdges.remove(this)}),this.targets=new Ge(t=>{t.incomingEdges.includes(this)||t.incomingEdges.push(this)},t=>{t.incomingEdges.remove(this)}),this.sections=new Ge(t=>{t._parent!==this&&(t._parent=this)},t=>{t._parent===this&&(t._parent=null)})}getContainingNode(){return this._containingNode}setContainingNode(t){if(this._containingNode===t)return;let e=this._containingNode;this._containingNode=t,e!==null&&e.containedEdges.remove(this),t!==null&&!t.containedEdges.includes(this)&&t.containedEdges.push(this)}getSources(){return this.sources}getTargets(){return this.targets}getSections(){return this.sections}isHyperedge(){return this.sources.length>1||this.targets.length>1}isConnected(){return this.sources.length>0&&this.targets.length>0}isSelfloop(){if(!this.isConnected())return!1;let t=[...this.sources,...this.targets],e=Sl(t[0]);return t.every(o=>Sl(o)===e)}isHierarchical(){var o,r;let t=[...this.sources,...this.targets];if(t.length===0)return!1;let e=(r=(o=Sl(t[0]))==null?void 0:o.parent)!=null?r:null;return!t.every(i=>{var s,a;return((a=(s=Sl(i))==null?void 0:s.parent)!=null?a:null)===e})}};function Sl(n){var t;return n?n.children!==void 0?n:(t=n.parent)!=null?t:null:null}var Vr=class extends ge{constructor(){super(),this.identifier=null,this.startX=0,this.startY=0,this.endX=0,this.endY=0,this.bendPoints=[],this._parent=null,this.incomingShape=null,this.outgoingShape=null,this.outgoingSections=new Ge(t=>{t.incomingSections.includes(this)||t.incomingSections.push(this)},t=>{t.incomingSections.remove(this)}),this.incomingSections=new Ge(t=>{t.outgoingSections.includes(this)||t.outgoingSections.push(this)},t=>{t.outgoingSections.remove(this)})}getIdentifier(){return this.identifier}setIdentifier(t){this.identifier=t}getStartX(){return this.startX}setStartX(t){this.startX=t}getStartY(){return this.startY}setStartY(t){this.startY=t}getEndX(){return this.endX}setEndX(t){this.endX=t}getEndY(){return this.endY}setEndY(t){this.endY=t}setStartLocation(t,e){this.startX=t,this.startY=e}setEndLocation(t,e){this.endX=t,this.endY=e}getBendPoints(){return this.bendPoints}getParent(){return this._parent}setParent(t){if(this._parent===t)return;let e=this._parent;this._parent=t,e!==null&&e.sections.remove(this),t!==null&&!t.sections.includes(this)&&t.sections.push(this)}getIncomingShape(){return this.incomingShape}setIncomingShape(t){this.incomingShape=t}getOutgoingShape(){return this.outgoingShape}setOutgoingShape(t){this.outgoingShape=t}getOutgoingSections(){return this.outgoingSections}getIncomingSections(){return this.incomingSections}};var Xr=class{constructor(t=0,e=0){this.x=t,this.y=e}getX(){return this.x}setX(t){this.x=t}getY(){return this.y}setY(t){this.y=t}set(t,e){this.x=t,this.y=e}toString(){return`(${this.x}, ${this.y})`}};var Us=class extends Ji{constructor(){super(),this.text="",this._parent=null}getText(){return this.text}setText(t){this.text=t}getParent(){return this._parent}setParent(t){if(this._parent===t)return;let e=this._parent;this._parent=t,e!==null&&e.labels.remove(this),t!==null&&!t.labels.includes(this)&&t.labels.push(this)}get parent(){return this._parent}set parent(t){this.setParent(t)}};function Oa(){return Fs(null)}function Fs(n){let t=new Or;return n!==null&&t.setParent(n),t}function Kf(n){let t=new Ve;return n!==null&&t.setParent(n),t}function Tl(n){let t=new Us;return n!==null&&t.setParent(n),t}function Sp(n){let t=new Bs;return n!==null&&t.setContainingNode(n),t}function Zf(n,t){if(n==null)throw new Error("source cannot be null");if(t==null)throw new Error("target cannot be null");let e=Sp(null);return e.sources.push(n),e.targets.push(t),Tp(e),e}function Nl(n){let t=new Vr;return n!==null&&n.sections.push(t),t}function ar(n,t,e){if(n.sections.isEmpty())return Nl(n);let o=n.sections[0];if(t&&(o.bendPoints.length=0,o.setStartLocation(0,0),o.setEndLocation(0,0)),e)for(;n.sections.length>1;)n.sections.splice(n.sections.length-1,1);return o}function Sa(n,t,e){let o=new Xr(t,e);return n!==null&&n.bendPoints.push(o),o}function Tp(n){if(n==null)throw new Error("edge cannot be null");n.setContainingNode(Np(n))}function Np(n){var r,i;if(n==null)throw new Error("edge cannot be null");let t=n.sources.length+n.targets.length;if(t===0)throw new Error("The edge must have at least one source or target.");if(t===1){let s=n.sources.length===0?n.targets[0]:n.sources[0];return(i=(r=Pt(s))==null?void 0:r.parent)!=null?i:null}if(n.sources.length===1&&n.targets.length===1){let s=Pt(n.sources[0]),a=Pt(n.targets[0]);if(s&&a){if(s.parent===a.parent)return s.parent;if(s===a.parent)return s;if(a===s.parent)return a}}let e=[...n.sources,...n.targets],o=Pt(e[0]);for(let s=1;s<e.length;s++){let a=Pt(e[s]);if(a!==o&&!mo(a,o)){if(a.parent===o.parent)o=a.parent;else if(o=yp(o,a),o===null)return null}}return o}function yp(n,t){let e=Op(n),o=Op(t),r=null,i=e.length-1,s=o.length-1;for(;i>=0&&s>=0&&e[i]===o[s];)r=e[i],i--,s--;return r}function Op(n){let t=[],e=n;for(;e!==null;)t.push(e),e=e.parent;return t}function _i(n){let t=[...n.incomingEdges];for(let e of n.ports)for(let o of e.incomingEdges)t.push(o);return t}function Ee(n){let t=[...n.outgoingEdges];for(let e of n.ports)for(let o of e.outgoingEdges)t.push(o);return t}function Ta(n){return[...n.incomingEdges,...n.outgoingEdges]}function mo(n,t){let e=n.parent;for(;e!==null;){if(e===t)return!0;e=e.parent}return!1}function Pt(n){if(n==null)throw new Error("connectableShape cannot be null");if(n instanceof Or)return n;if(n instanceof Ve)return n.parent;throw new Error("Only nodes and ports are supported as connectable shapes.")}function yl(n){if(n==null)throw new Error("connectableShape cannot be null");return n instanceof Ve?n:null}function ks(n){return Ip(n),Pt(n.sources[0])}function Na(n){return Ip(n),Pt(n.targets[0])}function Ip(n){if(n.sources.length!==1||n.targets.length!==1)throw new Error("Passed edge is not 'simple' (must have exactly 1 source and 1 target).")}var Gt=class n{constructor(t,e){this.first=t!==void 0?t:null,this.second=e!==void 0?e:null}static create(){return new n}static of(t,e){return new n(t,e)}static fromMap(t){let e=[];for(let[o,r]of t)e.push(new n(o,r));return e}getFirst(){return this.first}setFirst(t){this.first=t}getSecond(){return this.second}setSecond(t){this.second=t}clear(){this.first=null,this.second=null}equals(t){if(t instanceof n){let e=this.first===null?t.first===null:this.first===t.first,o=this.second===null?t.second===null:this.second===t.second;return e&&o}return!1}toString(){return this.first===null&&this.second===null?"pair(null,null)":this.first===null?`pair(null,${this.second})`:this.second===null?`pair(${this.first},null)`:`pair(${this.first},${this.second})`}[Symbol.iterator](){let t=0,e=this;return{next(){return t===0&&e.first!==null?(t++,{value:e.first,done:!1}):t<=1&&e.second!==null?(t=2,{value:e.second,done:!1}):{value:void 0,done:!0}}}}};var zs=class n{constructor(t){this._id=t.id||"",this._name=t.name||"",this._description=t.description||"",this._layouters=[]}getId(){return this._id}getName(){return this._name}getDescription(){return this._description}getLayouters(){return this._layouters}equals(t){return t instanceof n?this._id===t._id:!1}toString(){return`Layout Type: ${this._id}`}},jf=class{constructor(){this._id="",this._name="",this._description=""}create(){return new zs({id:this._id,name:this._name,description:this._description})}id(t){return this._id=t,this}name(t){return this._name=t,this}description(t){return this._description=t,this}};zs.Builder=jf;var Ht=class n{constructor(){this._algorithmMap=new Map,this._optionMap=new Map,this._legacyOptionMap=new Map,this._categoryMap=new Map,this._algorithmSuffixMap=new Map,this._optionSuffixMap=new Map}static getInstance(){return n._instance||(n._instance=new n),n._instance}static bootstrap(...t){let e=n.getInstance();return e.registerLayoutMetaDataProviders(...t),e}static unload(){if(n._instance){for(let t of n._instance._algorithmMap.values())typeof t.getInstancePool=="function"&&t.getInstancePool().clear();n._instance=null}}registerLayoutMetaDataProviders(...t){for(let e of t){let o=new $f(this);e.apply(o),o._applyDependencies()}this._optionSuffixMap.clear()}getAlgorithmData(t){return this._algorithmMap.get(t)||null}getAlgorithmDataAll(){return Array.from(this._algorithmMap.values())}getAlgorithmDataBySuffix(t){if(!t||t.trim()==="")return null;let e=this._algorithmSuffixMap.get(t);if(e!==void 0)return e;let o=null;for(let r of this._algorithmMap.values()){let i=r.getId();if(i.endsWith(t)&&(t.length===i.length||i[i.length-t.length-1]===".")){if(o!==null)return null;o=r}}return o!==null&&this._algorithmSuffixMap.set(t,o),o}getAlgorithmDataBySuffixOrDefault(t,e){if(t&&t.trim()!==""){let o=this.getAlgorithmDataBySuffix(t);if(o!==null)return o}return e&&e.trim()!==""?this.getAlgorithmDataBySuffix(e):null}getOptionData(t){return this._optionMap.get(t)||this._legacyOptionMap.get(t)||null}getOptionDataAll(){return Array.from(this._optionMap.values())}getOptionDataBySuffix(t){if(!t||t.trim()==="")return null;let e=this._optionSuffixMap.get(t);if(e!==void 0)return e;let o=null;for(let r of this._optionMap.values()){let i=r.getId();if(i.endsWith(t)&&(t.length===i.length||i[i.length-t.length-1]===".")){if(o!==null)return null;o=r}}if(o===null)t:for(let r of this._optionMap.values()){let i=r.getLegacyIds();if(i){for(let s of i)if(s.endsWith(t)&&(t.length===s.length||s[s.length-t.length-1]===".")){if(o!==null)return null;o=r;continue t}}}return o!==null&&this._optionSuffixMap.set(t,o),o}getOptionDataForAlgorithm(t,e){let o=[];for(let r of this._optionMap.values())t.knowsOption(r)&&r.getTargets().has(e)&&o.push(r);return o}getCategoryData(t){return this._categoryMap.get(t)||null}getCategoryDataAll(){return Array.from(this._categoryMap.values())}_getOrCreateBackupCategory(){let t=this._categoryMap.get("");return t||(t=new zs.Builder().id("").name("Other").create(),this._categoryMap.set("",t)),t}};Ht._instance=null;var $f=class{constructor(t){this._service=t,this._optionDependencies=[],this._optionSupport=[]}register(t){if(!(!t||typeof t.getId!="function"))if(typeof t.knowsOption=="function")this._service._algorithmMap.set(t.getId(),t),this._service._algorithmSuffixMap.clear();else if(typeof t.getType=="function"){let e=t.getId();this._service._optionMap.set(e,t);let o=t.getLegacyIds();if(o)for(let r of o)this._service._legacyOptionMap.set(r,t)}else this._service._categoryMap.set(t.getId(),t)}addDependency(t,e,o){this._optionDependencies.push({firstId:t,secondId:e,value:o})}addOptionSupport(t,e,o){this._optionSupport.push({firstId:t,secondId:e,value:o})}_applyDependencies(){for(let t of this._service._algorithmMap.values()){let e=t.getCategoryId()||"",o=this._service.getCategoryData(e);o===null&&e===""&&(o=this._service._getOrCreateBackupCategory()),o!==null&&!o.getLayouters().includes(t)&&o.getLayouters().push(t)}for(let t of this._optionDependencies){let e=this._service.getOptionData(t.firstId),o=this._service.getOptionData(t.secondId);e&&o&&e.getDependencies().push(Gt.of(o,t.value))}this._optionDependencies.length=0;for(let t of this._optionSupport){let e=this._service.getAlgorithmData(t.firstId),o=this._service.getOptionData(t.secondId);e&&o&&e.addKnownOption(o,t.value)}this._optionSupport.length=0}};var Rp=Object.freeze({compareTo(n){return-1},toString(){return"-\u221E"}}),Lp=Object.freeze({compareTo(n){return 1},toString(){return"+\u221E"}}),ts=class ts{constructor(t,e=null,o=null,r=null){this._id=t,this._defaultValue=e,this._lowerBound=o!==null?o:Rp,this._upperBound=r!==null?r:Lp,t&&!ts._byId.has(t)&&ts._byId.set(t,this)}static byId(t){return ts._byId.get(t)||null}static bySuffix(t){if(!t)return null;let e=null;for(let[o,r]of ts._byId){if(o===t)return r;if(o.endsWith(t)&&o[o.length-t.length-1]==="."){if(e!==null)return null;e=r}}return e}getId(){return this._id}getDefault(){let t=this._defaultValue;return typeof t=="function"&&(t=t()),t===null||typeof t!="object"?t:typeof t.clone=="function"?t.clone():t instanceof Set?new Set(t):t instanceof Map?new Map(t):Array.isArray(t)?[...t]:t}getLowerBound(){return this._lowerBound}getUpperBound(){return this._upperBound}equals(t){return t&&typeof t.getId=="function"?this._id===t.getId():!1}compareTo(t){return this._id<t.getId()?-1:this._id>t.getId()?1:0}toString(){return this._id}};Z(ts,"_byId",new Map);var m=ts;var wt={};mp(wt,{ALGORITHM:()=>mi,ALGORITHM_BOX:()=>GS,ALGORITHM_FIXED:()=>Yp,ALGORITHM_RANDOM:()=>HS,ALIGNMENT:()=>XO,ANIMATE:()=>PS,ANIM_TIME_FACTOR:()=>OS,ASPECT_RATIO:()=>KO,BEND_POINTS:()=>Cl,BOX_PACKING_MODE:()=>Il,CATEGORY_CIRCLE:()=>DS,CATEGORY_FORCE:()=>xS,CATEGORY_LAYERED:()=>AS,CATEGORY_ORTHOGONAL:()=>CS,CATEGORY_PLANAR:()=>MS,CATEGORY_RADIAL:()=>bS,CATEGORY_TREE:()=>wS,CHILD_AREA_HEIGHT:()=>Ei,CHILD_AREA_WIDTH:()=>pi,COMMENT_BOX:()=>nS,CONTENT_ALIGNMENT:()=>Rl,DEBUG_MODE:()=>Ks,DIRECTION:()=>lr,EDGE_LABELS_INLINE:()=>Ou,EDGE_LABELS_PLACEMENT:()=>Aa,EDGE_ROUTING:()=>cu,EDGE_THICKNESS:()=>ES,EDGE_TYPE:()=>mS,EXPAND_NODES:()=>Ll,FONT_NAME:()=>aS,FONT_SIZE:()=>lS,HIERARCHY_HANDLING:()=>yr,HYPERNODE:()=>cS,INSIDE_SELF_LOOPS_ACTIVATE:()=>ls,INSIDE_SELF_LOOPS_YO:()=>Ca,INTERACTIVE:()=>zo,INTERACTIVE_LAYOUT:()=>ZO,JSON_EDGE_COORDS:()=>$O,JSON_SHAPE_COORDS:()=>jO,JUNCTION_POINTS:()=>gr,LABEL_MANAGER:()=>gS,LAYOUT_ANCESTORS:()=>SS,MARGINS:()=>Nr,MAX_ANIM_TIME:()=>TS,MIN_ANIM_TIME:()=>NS,NODE_LABELS_PADDING:()=>pu,NODE_LABELS_PLACEMENT:()=>Kr,NODE_SIZE_CONSTRAINTS:()=>Mo,NODE_SIZE_FIXED_GRAPH_SIZE:()=>To,NODE_SIZE_MINIMUM:()=>Yo,NODE_SIZE_OPTIONS:()=>Oo,NO_LAYOUT:()=>bl,OMIT_NODE_MICRO_LAYOUT:()=>So,PADDING:()=>ns,PARTITIONING_ACTIVATE:()=>iS,PARTITIONING_PARTITION:()=>rS,PORT_ALIGNMENT_DEFAULT:()=>Eu,PORT_ALIGNMENT_EAST:()=>Ml,PORT_ALIGNMENT_NORTH:()=>xl,PORT_ALIGNMENT_SOUTH:()=>Dl,PORT_ALIGNMENT_WEST:()=>wl,PORT_ANCHOR:()=>au,PORT_BORDER_OFFSET:()=>Ke,PORT_CONSTRAINTS:()=>cr,PORT_INDEX:()=>Gl,PORT_LABELS_NEXT_TO_PORT_IF_POSSIBLE:()=>Hl,PORT_LABELS_PLACEMENT:()=>Ir,PORT_LABELS_TREAT_AS_GROUP:()=>Su,PORT_SIDE:()=>Tr,POSITION:()=>ho,PRIORITY:()=>mu,PROGRESS_BAR:()=>yS,RANDOM_SEED:()=>Pu,RESOLVED_ALGORITHM:()=>ss,SCALE_FACTOR:()=>lu,SEPARATE_CONNECTED_COMPONENTS:()=>sS,SOFTWRAPPING_FUZZINESS:()=>hS,SPACING_COMMENT_COMMENT:()=>qO,SPACING_COMMENT_NODE:()=>JO,SPACING_COMPONENT_COMPONENT:()=>QO,SPACING_EDGE_EDGE:()=>tS,SPACING_EDGE_LABEL:()=>gu,SPACING_EDGE_NODE:()=>eS,SPACING_INDIVIDUAL:()=>as,SPACING_LABEL_LABEL:()=>hu,SPACING_LABEL_NODE:()=>Zs,SPACING_LABEL_PORT_HORIZONTAL:()=>du,SPACING_LABEL_PORT_VERTICAL:()=>fu,SPACING_NODE_NODE:()=>Pi,SPACING_NODE_SELF_LOOP:()=>oS,SPACING_PORTS_SURROUNDING:()=>_u,SPACING_PORT_PORT:()=>uu,TOPDOWN_HIERARCHICAL_NODE_ASPECT_RATIO:()=>zp,TOPDOWN_HIERARCHICAL_NODE_WIDTH:()=>Wp,TOPDOWN_LAYOUT:()=>js,TOPDOWN_NODE_TYPE:()=>_S,TOPDOWN_SCALE_CAP:()=>pS,TOPDOWN_SCALE_FACTOR:()=>kp,TOPDOWN_SIZE_APPROXIMATOR:()=>uS,TOPDOWN_SIZE_CATEGORIES:()=>dS,TOPDOWN_SIZE_CATEGORIES_HIERARCHICAL_NODE_WEIGHT:()=>fS,VALIDATE_GRAPH:()=>IS,VALIDATE_OPTIONS:()=>RS,ZOOM_TO_FIT:()=>LS});var Kt=Object.freeze({AUTOMATIC:"AUTOMATIC",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP",BOTTOM:"BOTTOM",CENTER:"CENTER",values(){return[this.AUTOMATIC,this.LEFT,this.RIGHT,this.TOP,this.BOTTOM,this.CENTER]},valueOf(n){return this[n]}});var he=Object.freeze({V_TOP:"V_TOP",V_CENTER:"V_CENTER",V_BOTTOM:"V_BOTTOM",H_LEFT:"H_LEFT",H_CENTER:"H_CENTER",H_RIGHT:"H_RIGHT",centerCenter(){return new Set([he.V_CENTER,he.H_CENTER])},topLeft(){return new Set([he.V_TOP,he.H_LEFT])},bottomRight(){return new Set([he.V_BOTTOM,he.H_RIGHT])},topCenter(){return new Set([he.V_TOP,he.H_CENTER])},values(){return[this.V_TOP,this.V_CENTER,this.V_BOTTOM,this.H_LEFT,this.H_CENTER,this.H_RIGHT]},valueOf(n){return this[n]}});var Yt=class Yt{constructor(t){this.name=t,Object.freeze(this)}isHorizontal(){return this===Yt.LEFT||this===Yt.RIGHT}isVertical(){return this===Yt.UP||this===Yt.DOWN}opposite(){switch(this){case Yt.LEFT:return Yt.RIGHT;case Yt.RIGHT:return Yt.LEFT;case Yt.UP:return Yt.DOWN;case Yt.DOWN:return Yt.UP;default:return Yt.UNDEFINED}}toString(){return this.name}static values(){return[Yt.UNDEFINED,Yt.RIGHT,Yt.LEFT,Yt.DOWN,Yt.UP]}static valueOf(t){return Yt[t]}};Z(Yt,"UNDEFINED",new Yt("UNDEFINED")),Z(Yt,"RIGHT",new Yt("RIGHT")),Z(Yt,"LEFT",new Yt("LEFT")),Z(Yt,"DOWN",new Yt("DOWN")),Z(Yt,"UP",new Yt("UP"));var R=Yt;var Ap=Object.freeze({INHERIT:"INHERIT",CONTAINER:"CONTAINER",PARENT:"PARENT",ROOT:"ROOT",values(){return[this.INHERIT,this.CONTAINER,this.PARENT,this.ROOT]},valueOf(n){return this[n]}});var Po=class Po{constructor(t){this.name=t,Object.freeze(this)}isEndLabelPlacement(){return this===Po.HEAD||this===Po.TAIL}toString(){return this.name}static values(){return[Po.CENTER,Po.HEAD,Po.TAIL]}static valueOf(t){return Po[t]}};Z(Po,"CENTER",new Po("CENTER")),Z(Po,"HEAD",new Po("HEAD")),Z(Po,"TAIL",new Po("TAIL"));var St=Po;var At=Object.freeze({UNDEFINED:"UNDEFINED",POLYLINE:"POLYLINE",ORTHOGONAL:"ORTHOGONAL",SPLINES:"SPLINES",values(){return[this.UNDEFINED,this.POLYLINE,this.ORTHOGONAL,this.SPLINES]},valueOf(n){return this[n]}});var Cp=Object.freeze({NONE:"NONE",DIRECTED:"DIRECTED",UNDIRECTED:"UNDIRECTED",ASSOCIATION:"ASSOCIATION",GENERALIZATION:"GENERALIZATION",DEPENDENCY:"DEPENDENCY",values(){return[this.NONE,this.DIRECTED,this.UNDIRECTED,this.ASSOCIATION,this.GENERALIZATION,this.DEPENDENCY]},valueOf(n){return this[n]}});var Ys=class n{constructor(t=0,e=0,o=0,r=0){this.top=0,this.bottom=0,this.left=0,this.right=0,arguments.length>0&&this.set(t,e,o,r)}set(t,e,o,r){typeof t=="object"?(this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left):(this.top=t,this.right=e,this.bottom=o,this.left=r)}getTop(){return this.top}setTop(t){this.top=t}getRight(){return this.right}setRight(t){this.right=t}getBottom(){return this.bottom}setBottom(t){this.bottom=t}getLeft(){return this.left}setLeft(t){this.left=t}setLeftRight(t){this.left=t,this.right=t}setTopBottom(t){this.top=t,this.bottom=t}getHorizontal(){return this.left+this.right}getVertical(){return this.top+this.bottom}equals(t){return t instanceof n?this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right:!1}toString(){return`[top=${this.top},left=${this.left},bottom=${this.bottom},right=${this.right}]`}parse(t){let e=0;for(;e<t.length&&n._isdelim(t[e],`([{"' \r
`);)e++;let o=t.length;for(;o>0&&n._isdelim(t[o-1],`)]}"' \r
`);)o--;if(e<o){let r=t.substring(e,o).split(/,|;/);for(let i of r){let s=i.split("=");if(s.length!==2)throw new Error("Expecting a list of key-value pairs.");let a=s[0].trim(),l=parseFloat(s[1].trim());if(isNaN(l))throw new Error("The given string contains parts that cannot be parsed as numbers.");a==="top"?this.top=l:a==="left"?this.left=l:a==="bottom"?this.bottom=l:a==="right"&&(this.right=l)}}}static _isdelim(t,e){return e.includes(t)}copy(t){return this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this}add(t){return this.left+=t.left,this.right+=t.right,this.top+=t.top,this.bottom+=t.bottom,this}clone(){throw new Error("clone() must be implemented by subclass")}};var me=class n extends Ys{constructor(t,e,o,r){if(super(),arguments.length!==0)if(arguments.length===1)if(typeof t=="object"){let i=t;this.set(i.top,i.right,i.bottom,i.left)}else{let i=t;this.set(i,i,i,i)}else if(arguments.length===2){let i=t,s=e;this.set(s,i,s,i)}else this.set(t,e,o,r)}clone(){return new n(this)}};var yt=class n extends Ys{constructor(t,e,o,r){if(super(),arguments.length!==0)if(arguments.length===1)if(typeof t=="object"){let i=t;this.set(i.top,i.right,i.bottom,i.left)}else{let i=t;this.set(i,i,i,i)}else if(arguments.length===2){let i=t,s=e;this.set(s,i,s,i)}else this.set(t,e,o,r)}clone(){return new n(this)}};var Xe=class{static greaterThan(t){return new qf(t)}static lessThan(t){return new Jf(t)}},qf=class n{constructor(t){this._bound=t}compareTo(t){return this._bound<t?-1:1}equals(t){return t instanceof n&&this._bound===t._bound}toString(){return`${this._bound} (exclusive lower)`}},Jf=class n{constructor(t){this._bound=t}compareTo(t){return this._bound>t?1:-1}equals(t){return t instanceof n&&this._bound===t._bound}toString(){return`${this._bound} (exclusive upper)`}};var Oe=Object.freeze({INHERIT:"INHERIT",INCLUDE_CHILDREN:"INCLUDE_CHILDREN",SEPARATE_CHILDREN:"SEPARATE_CHILDREN",values(){return[this.INHERIT,this.INCLUDE_CHILDREN,this.SEPARATE_CHILDREN]},valueOf(n){return this[n]}});var Sr=class Sr{constructor(t,e){if(arguments.length===0)this.x=0,this.y=0;else if(arguments.length===1){let o=t;typeof o=="number"?(this.x=Math.cos(o),this.y=Math.sin(o)):(this.x=o.x,this.y=o.y)}else if(arguments.length===2){let o=t,r=e;typeof o=="number"?(this.x=o,this.y=r):(this.x=r.x-o.x,this.y=r.y-o.y)}}clone(){return new Sr(this.x,this.y)}toString(){return`(${this.x},${this.y})`}equals(t){return t instanceof Sr?this.x===t.x&&this.y===t.y:!1}equalsFuzzily(t,e=Sr.DEFAULT_FUZZYNESS){return Math.abs(this.x-t.x)<=e&&Math.abs(this.y-t.y)<=e}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}squareLength(){return this.x*this.x+this.y*this.y}reset(){return this.x=0,this.y=0,this}set(t,e){return typeof t=="object"?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}add(t,e){return typeof t=="object"?(this.x+=t.x,this.y+=t.y):(this.x+=t,this.y+=e),this}static sum(...t){let e=new Sr;for(let o of t)e.x+=o.x,e.y+=o.y;return e}sub(t,e){return typeof t=="object"?(this.x-=t.x,this.y-=t.y):(this.x-=t,this.y-=e),this}static diff(t,e){return new Sr(t.x-e.x,t.y-e.y)}scale(t,e){return e===void 0?(this.x*=t,this.y*=t):(this.x*=t,this.y*=e),this}normalize(){let t=this.length();return t>0&&(this.x/=t,this.y/=t),this}scaleToLength(t){return this.normalize(),this.scale(t),this}negate(){return this.x=-this.x,this.y=-this.y,this}toDegrees(){return this.toRadians()*(180/Math.PI)}toRadians(){let t=this.length();return this.x>=0&&this.y>=0?Math.asin(this.y/t):this.x<0?Math.PI-Math.asin(this.y/t):2*Math.PI+Math.asin(this.y/t)}wiggle(t,e){this.x+=t()*e-e/2,this.y+=t()*e-e/2}distance(t){let e=this.x-t.x,o=this.y-t.y;return Math.sqrt(e*e+o*o)}dotProduct(t){return this.x*t.x+this.y*t.y}static crossProduct(t,e){return t.x*e.y-t.y*e.x}rotate(t){let e=this.x*Math.cos(t)-this.y*Math.sin(t);return this.y=this.x*Math.sin(t)+this.y*Math.cos(t),this.x=e,this}angle(t){return Math.acos(this.dotProduct(t)/(this.length()*t.length()))}bound(t,e,o,r){if(o<t||r<e)throw new Error("The highx must be bigger than lowx and the highy must be bigger than lowy");return this.x<t?this.x=t:this.x>o&&(this.x=o),this.y<e?this.y=e:this.y>r&&(this.y=r),this}isNaN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}isInfinite(){return!isFinite(this.x)||!isFinite(this.y)}parse(t){let e=0;for(;e<t.length&&Sr._isdelim(t[e],`([{"' \r
`);)e++;let o=t.length;for(;o>0&&Sr._isdelim(t[o-1],`)]}"' \r
-`);)o--;if(e>=o)throw new Error("The given string does not contain any numbers.");let r=t.substring(e,o).split(/,|;|\r|\n/);if(r.length!==2)throw new Error(`Exactly two numbers are expected, ${r.length} were found.`);if(this.x=parseFloat(r[0].trim()),this.y=parseFloat(r[1].trim()),isNaN(this.x)||isNaN(this.y))throw new Error("The given string contains parts that cannot be parsed as numbers.")}static _isdelim(t,e){return e.includes(t)}};Z(Sr,"DEFAULT_FUZZYNESS",.05);var O=Sr;var st=class n extends Array{constructor(...t){if(super(),t.length===1&&Array.isArray(t[0]))for(let e of t[0])this.push(e);else if(t.length>0)for(let e of t)this.push(e)}toString(){let t="(";for(let e=0;e<this.length;e++){let o=this[e];t+=`${o.x},${o.y}`,e<this.length-1&&(t+="; ")}return t+")"}clone(){return new n(this.toArray())}toArray(t=0){if(t<0||t>this.length)throw new RangeError("Index out of bounds");return Array.prototype.slice.call(this,t)}parse(t){let e=t.split(/,|;|\(|\)|\[|\]|\{|\}| |\t|\n/);this.length=0;let o=0,r=0,i=0,s=0;for(;o<e.length;){let a=e[o];if(a!=null&&a.trim().length>0){let l=parseFloat(a);if(isNaN(l))throw new Error("The given string does not match the expected format for vectors.");r%2===0?i=l:s=l,r>0&&r%2!==0&&this.push(new O(i,s)),r++}o++}}add(t,e){arguments.length===0?this.push(new O):arguments.length===2?typeof t=="number"&&typeof e=="object"?this.splice(t,0,e):this.push(new O(t,e)):this.push(t)}addFirst(t,e){arguments.length===0?this.unshift(new O):arguments.length===2?this.unshift(new O(t,e)):this.unshift(t)}addLast(t,e){arguments.length===0?this.push(new O):arguments.length===2?this.push(new O(t,e)):this.push(t)}getFirst(){return this[0]}getLast(){return this[this.length-1]}removeFirst(){return this.shift()}removeLast(){return this.pop()}size(){return this.length}get(t){return this[t]}remove(t){for(let e=0;e<this.length;e++){let o=this[e];if(o===t||typeof o.equals=="function"&&o.equals(t))return this.splice(e,1),!0}return!1}addAll(t,e){if(e!==void 0){let o=Array.isArray(e)?e:[...e];this.splice(t,0,...o)}else if(Array.isArray(t))for(let o of t)this.push(o);else for(let o of t)this.push(o)}addAllAsCopies(t,e){let o=[];for(let r of e)o.push(new O(r));this.splice(t,0,...o)}scale(t,e){for(let o of this)o.scale(t,e);return this}offset(t,e){if(typeof t=="object")for(let o of this)o.add(t);else for(let o of this)o.add(t,e);return this}offsetNonMutating(t){let e=new n;for(let o of this)e.push(O.sum(o,t));return e}totalLength(){let t=0;if(this.length>=2){let e=this[0];for(let o=1;o<this.length;o++){let r=this[o];t+=e.distance(r),e=r}}return t}hasNaN(){for(let t of this)if(t.isNaN())return!0;return!1}hasInfinite(){for(let t of this)if(t.isInfinite())return!0;return!1}pointOnLine(t){if(this.length>=2){let e=Math.abs(t),o=0;if(t>=0){let r=this[0];for(let i=1;i<this.length;i++){let s=o,a=this[i],l=r.distance(a);if(l>0&&(o+=l,o>=e)){let c=(e-s)/l,g=a.clone().sub(r);return g.scale(c),g.add(r),g}r=a}return this[this.length-1]}else{let r=this[this.length-1];for(let i=this.length-2;i>=0;i--){let s=o,a=this[i],l=r.distance(a);if(l>0&&(o+=l,o>=e)){let c=(e-s)/l,g=a.clone().sub(r);return g.scale(c),g.add(r),g}r=a}return this[0]}}else{if(this.length===1)return this[0];throw new Error("Cannot determine a point on an empty vector chain.")}}angleOnLine(t){if(this.length>=2){let e=Math.abs(t),o=0;if(t>=0){let r,i=this[0];for(let s=1;s<this.length;s++){r=i,i=this[s];let a=r.distance(i);if(a>0&&(o+=a,o>=e))break}return i.clone().sub(r).toRadians()}else{let r,i=this[this.length-1];for(let s=this.length-2;s>=0;s--){r=i,i=this[s];let a=r.distance(i);if(a>0&&(o+=a,o>=e))break}return i.clone().sub(r).toRadians()}}else throw new Error("Need at least two points to determine an angle.")}static reverse(t){let e=new n;for(let o=t.length-1;o>=0;o--)e.push(new O(t[o]));return e}get(t){return this[t]}size(){return this.length}clear(){this.length=0}isEmpty(){return this.length===0}};var k=Object.freeze({H_LEFT:"H_LEFT",H_CENTER:"H_CENTER",H_RIGHT:"H_RIGHT",V_TOP:"V_TOP",V_CENTER:"V_CENTER",V_BOTTOM:"V_BOTTOM",INSIDE:"INSIDE",OUTSIDE:"OUTSIDE",H_PRIORITY:"H_PRIORITY",fixed(){return new Set},insideTopLeft(){return new Set([k.INSIDE,k.V_TOP,k.H_LEFT])},insideTopCenter(){return new Set([k.INSIDE,k.V_TOP,k.H_CENTER])},insideTopRight(){return new Set([k.INSIDE,k.V_TOP,k.H_RIGHT])},insideCenter(){return new Set([k.INSIDE,k.V_CENTER,k.H_CENTER])},insideBottomLeft(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_LEFT])},insideBottomCenter(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_CENTER])},insideBottomRight(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_RIGHT])},outsideTopLeft(){return new Set([k.OUTSIDE,k.V_TOP,k.H_LEFT])},outsideTopCenter(){return new Set([k.OUTSIDE,k.V_TOP,k.H_CENTER])},outsideTopRight(){return new Set([k.OUTSIDE,k.V_TOP,k.H_RIGHT])},outsideBottomLeft(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_LEFT])},outsideBottomCenter(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_CENTER])},outsideBottomRight(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_RIGHT])},isValid(n){return!([k.INSIDE,k.OUTSIDE].filter(r=>n.has(r)).length>1||[k.H_LEFT,k.H_CENTER,k.H_RIGHT].filter(r=>n.has(r)).length>1||[k.V_TOP,k.V_CENTER,k.V_BOTTOM].filter(r=>n.has(r)).length>1)},values(){return[this.H_LEFT,this.H_CENTER,this.H_RIGHT,this.V_TOP,this.V_CENTER,this.V_BOTTOM,this.INSIDE,this.OUTSIDE,this.H_PRIORITY]},valueOf(n){return this[n]},ensureSet(n){if(n instanceof Set)return n;if(n==null)return new Set;if(typeof n=="string"){let t=new Set;for(let e of n.split(/\s+/)){let o=e.trim();o&&k[o]!==void 0&&typeof k[o]=="string"&&t.add(k[o])}return t}return new Set}});var de=class{initialize(t){}dispose(){}layout(t,e){throw new Error(`${this.constructor.name}.layout() is not implemented`)}};var xp=new m("org.eclipse.elk.padding",new yt(15)),Dp=new m("org.eclipse.elk.spacing.nodeNode",15,0),Qf=new m("org.eclipse.elk.priority",0),tu=new m("org.eclipse.elk.aspectRatio",1.3,Xe.greaterThan(0));var dt=class n{constructor(t,e,o,r){arguments.length===0?(this.x=0,this.y=0,this.width=0,this.height=0):arguments.length===1?(this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height):(this.x=t,this.y=e,this.width=o,this.height=r)}setRect(t,e,o,r){this.x=t,this.y=e,this.width=o,this.height=r}getPosition(){return new O(this.x,this.y)}getTopLeft(){return new O(this.x,this.y)}getTopRight(){return new O(this.x+this.width,this.y)}getBottomLeft(){return new O(this.x,this.y+this.height)}getBottomRight(){return new O(this.x+this.width,this.y+this.height)}getCenter(){return new O(this.x+this.width/2,this.y+this.height/2)}union(t){let e=Math.min(this.x,t.x),o=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width),i=Math.max(this.y+this.height,t.y+t.height);if(r<e){let s=e;r=e}if(i<o){let s=o;i=o}this.setRect(e,o,r-e,i-o)}move(t){this.x+=t.x,this.y+=t.y}getMaxX(){return this.x+this.width}getMaxY(){return this.y+this.height}intersects(t){let e=this.x,o=this.y,r=this.x+this.width,i=this.y+this.height,s=t.x,a=t.y,l=t.x+t.width,c=t.y+t.height;return e<l&&r>s&&i>a&&o<c}equals(t){return t==null||!(t instanceof n)?!1:this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}toString(){return`Rect[x=${this.x},y=${this.y},w=${this.width},h=${this.height}]`}};var $t=class $t{constructor(t){this.name=t,Object.freeze(this)}isPosFixed(){return this===$t.FIXED_POS}isRatioFixed(){return this===$t.FIXED_RATIO}isOrderFixed(){return this===$t.FIXED_ORDER||this===$t.FIXED_RATIO||this===$t.FIXED_POS}isSideFixed(){return this!==$t.FREE&&this!==$t.UNDEFINED}toString(){return this.name}static values(){return[$t.UNDEFINED,$t.FREE,$t.FIXED_SIDE,$t.FIXED_ORDER,$t.FIXED_RATIO,$t.FIXED_POS]}static valueOf(t){return $t[t]}};Z($t,"UNDEFINED",new $t("UNDEFINED")),Z($t,"FREE",new $t("FREE")),Z($t,"FIXED_SIDE",new $t("FIXED_SIDE")),Z($t,"FIXED_ORDER",new $t("FIXED_ORDER")),Z($t,"FIXED_RATIO",new $t("FIXED_RATIO")),Z($t,"FIXED_POS",new $t("FIXED_POS"));var H=$t;var it=Object.freeze({OUTSIDE:"OUTSIDE",INSIDE:"INSIDE",NEXT_TO_PORT_IF_POSSIBLE:"NEXT_TO_PORT_IF_POSSIBLE",ALWAYS_SAME_SIDE:"ALWAYS_SAME_SIDE",ALWAYS_OTHER_SAME_SIDE:"ALWAYS_OTHER_SAME_SIDE",SPACE_EFFICIENT:"SPACE_EFFICIENT",fixed(){return new Set},inside(){return new Set([it.INSIDE])},outside(){return new Set([it.OUTSIDE])},isFixed(n){return!n.has(it.INSIDE)&&!n.has(it.OUTSIDE)},isValid(n){return!([it.INSIDE,it.OUTSIDE].filter(o=>n.has(o)).length>1||[it.ALWAYS_SAME_SIDE,it.ALWAYS_OTHER_SAME_SIDE,it.SPACE_EFFICIENT].filter(o=>n.has(o)).length>1)},values(){return[this.OUTSIDE,this.INSIDE,this.NEXT_TO_PORT_IF_POSSIBLE,this.ALWAYS_SAME_SIDE,this.ALWAYS_OTHER_SAME_SIDE,this.SPACE_EFFICIENT]},valueOf(n){return this[n]}});var q=class q{constructor(t){this.name=t,Object.freeze(this)}ordinal(){switch(this){case q.UNDEFINED:return 0;case q.NORTH:return 1;case q.EAST:return 2;case q.SOUTH:return 3;case q.WEST:return 4;default:return-1}}right(){switch(this){case q.NORTH:return q.EAST;case q.EAST:return q.SOUTH;case q.SOUTH:return q.WEST;case q.WEST:return q.NORTH;default:return q.UNDEFINED}}left(){switch(this){case q.NORTH:return q.WEST;case q.EAST:return q.NORTH;case q.SOUTH:return q.EAST;case q.WEST:return q.SOUTH;default:return q.UNDEFINED}}opposed(){switch(this){case q.NORTH:return q.SOUTH;case q.EAST:return q.WEST;case q.SOUTH:return q.NORTH;case q.WEST:return q.EAST;default:return q.UNDEFINED}}areAdjacent(t){return this===q.UNDEFINED?!1:this.left()===t||this.right()===t}static fromDirection(t){switch(t){case R.UP:return q.NORTH;case R.RIGHT:return q.EAST;case R.DOWN:return q.SOUTH;case R.LEFT:return q.WEST;default:return q.UNDEFINED}}static isVertical(t){return t===q.NORTH||t===q.SOUTH}static isHorizontal(t){return t===q.WEST||t===q.EAST}toString(){return this.name}static values(){return[q.UNDEFINED,q.NORTH,q.EAST,q.SOUTH,q.WEST]}static valueOf(t){return q[t]}};Z(q,"UNDEFINED",new q("UNDEFINED")),Z(q,"NORTH",new q("NORTH")),Z(q,"EAST",new q("EAST")),Z(q,"SOUTH",new q("SOUTH")),Z(q,"WEST",new q("WEST")),Z(q,"SIDES_NONE",new Set),Z(q,"SIDES_NORTH",null),Z(q,"SIDES_EAST",null),Z(q,"SIDES_SOUTH",null),Z(q,"SIDES_WEST",null),Z(q,"SIDES_NORTH_SOUTH",null),Z(q,"SIDES_EAST_WEST",null),Z(q,"SIDES_NORTH_WEST",null),Z(q,"SIDES_NORTH_EAST",null),Z(q,"SIDES_SOUTH_WEST",null),Z(q,"SIDES_EAST_SOUTH",null),Z(q,"SIDES_NORTH_EAST_WEST",null),Z(q,"SIDES_EAST_SOUTH_WEST",null),Z(q,"SIDES_NORTH_SOUTH_WEST",null),Z(q,"SIDES_NORTH_EAST_SOUTH",null),Z(q,"SIDES_NORTH_EAST_SOUTH_WEST",null);var u=q;u.SIDES_NORTH=Object.freeze(new Set([u.NORTH]));u.SIDES_EAST=Object.freeze(new Set([u.EAST]));u.SIDES_SOUTH=Object.freeze(new Set([u.SOUTH]));u.SIDES_WEST=Object.freeze(new Set([u.WEST]));u.SIDES_NORTH_SOUTH=Object.freeze(new Set([u.NORTH,u.SOUTH]));u.SIDES_EAST_WEST=Object.freeze(new Set([u.EAST,u.WEST]));u.SIDES_NORTH_WEST=Object.freeze(new Set([u.NORTH,u.WEST]));u.SIDES_NORTH_EAST=Object.freeze(new Set([u.NORTH,u.EAST]));u.SIDES_SOUTH_WEST=Object.freeze(new Set([u.SOUTH,u.WEST]));u.SIDES_EAST_SOUTH=Object.freeze(new Set([u.EAST,u.SOUTH]));u.SIDES_NORTH_EAST_WEST=Object.freeze(new Set([u.NORTH,u.EAST,u.WEST]));u.SIDES_EAST_SOUTH_WEST=Object.freeze(new Set([u.EAST,u.SOUTH,u.WEST]));u.SIDES_NORTH_SOUTH_WEST=Object.freeze(new Set([u.NORTH,u.SOUTH,u.WEST]));u.SIDES_NORTH_EAST_SOUTH=Object.freeze(new Set([u.NORTH,u.EAST,u.SOUTH]));u.SIDES_NORTH_EAST_SOUTH_WEST=Object.freeze(new Set([u.NORTH,u.EAST,u.SOUTH,u.WEST]));var HO=[u.SIDES_NONE,u.SIDES_NORTH,u.SIDES_EAST,u.SIDES_NORTH_EAST,u.SIDES_SOUTH,u.SIDES_NORTH_SOUTH,u.SIDES_EAST_SOUTH,u.SIDES_NORTH_EAST_SOUTH,u.SIDES_WEST,u.SIDES_NORTH_WEST,u.SIDES_EAST_WEST,u.SIDES_NORTH_EAST_WEST,u.SIDES_SOUTH_WEST,u.SIDES_NORTH_SOUTH_WEST,u.SIDES_EAST_SOUTH_WEST,u.SIDES_NORTH_EAST_SOUTH_WEST];u.sidesOf=function(t){let e=0;return t.has(u.NORTH)&&(e|=1),t.has(u.EAST)&&(e|=2),t.has(u.SOUTH)&&(e|=4),t.has(u.WEST)&&(e|=8),HO[e]};var mt=Object.freeze({PORTS:"PORTS",PORT_LABELS:"PORT_LABELS",NODE_LABELS:"NODE_LABELS",MINIMUM_SIZE:"MINIMUM_SIZE",fixed(){return new Set},minimumSize(){return new Set([mt.MINIMUM_SIZE])},minimumSizeWithPorts(){return new Set([mt.PORTS,mt.MINIMUM_SIZE])},free(){return new Set([mt.PORTS,mt.PORT_LABELS,mt.NODE_LABELS,mt.MINIMUM_SIZE])},values(){return[this.PORTS,this.PORT_LABELS,this.NODE_LABELS,this.MINIMUM_SIZE]},valueOf(n){return this[n]}});var Nt=Object.freeze({DEFAULT_MINIMUM_SIZE:"DEFAULT_MINIMUM_SIZE",MINIMUM_SIZE_ACCOUNTS_FOR_PADDING:"MINIMUM_SIZE_ACCOUNTS_FOR_PADDING",COMPUTE_PADDING:"COMPUTE_PADDING",OUTSIDE_NODE_LABELS_OVERHANG:"OUTSIDE_NODE_LABELS_OVERHANG",PORTS_OVERHANG:"PORTS_OVERHANG",UNIFORM_PORT_SPACING:"UNIFORM_PORT_SPACING",SPACE_EFFICIENT_PORT_LABELS:"SPACE_EFFICIENT_PORT_LABELS",FORCE_TABULAR_NODE_LABELS:"FORCE_TABULAR_NODE_LABELS",ASYMMETRICAL:"ASYMMETRICAL",valueOf(n){return typeof n=="number"?Nt.values()[n]:this[n]},values(){return[this.DEFAULT_MINIMUM_SIZE,this.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING,this.COMPUTE_PADDING,this.OUTSIDE_NODE_LABELS_OVERHANG,this.PORTS_OVERHANG,this.UNIFORM_PORT_SPACING,this.SPACE_EFFICIENT_PORT_LABELS,this.FORCE_TABULAR_NODE_LABELS,this.ASYMMETRICAL]}});var es=20,os=20;function bp(n,t){if(n.getParent()===null)throw new Error("port must have a parent node to calculate the port side");let e=n.getParent(),o=e.getWidth(),r=e.getHeight();if(o<=0&&r<=0)return u.UNDEFINED;let i=n.getX(),s=n.getY();if(t===R.LEFT||t===R.RIGHT){if(i<0)return u.WEST;if(i+n.getWidth()>o)return u.EAST}else if(t===R.UP||t===R.DOWN){if(s<0)return u.NORTH;if(s+n.getHeight()>r)return u.SOUTH}let a=(i+n.getWidth()/2)/o,l=(s+n.getHeight()/2)/r;return a+l<=1&&a-l<=0?u.WEST:a+l>=1&&a-l>=0?u.EAST:l<.5?u.NORTH:u.SOUTH}function eu(n,t){if(n.getParent()===null)throw new Error("port must have a parent node to calculate the port side");let e=n.getParent();switch(t){case u.NORTH:return-(n.getY()+n.getHeight());case u.EAST:return n.getX()-e.getWidth();case u.SOUTH:return n.getY()-e.getHeight();case u.WEST:return-(n.getX()+n.getWidth());default:return 0}}function ou(n){let t=n.getProperty(Mo);if(t.size===0)return null;let e=0,o=0;if(t.has(mt.PORTS)){let r=n.getProperty(cr),i=2,s=2,a=2,l=2,c=n.getParent()===null?n.getProperty(lr):n.getParent().getProperty(lr);for(let g of n.ports){let h=g.getProperty(Tr);if(h===u.UNDEFINED&&(h=bp(g,c),g.setProperty(Tr,h)),r===H.FIXED_POS)switch(h){case u.NORTH:i=Math.max(i,g.getX()+g.getWidth());break;case u.EAST:s=Math.max(s,g.getY()+g.getHeight());break;case u.SOUTH:a=Math.max(a,g.getX()+g.getWidth());break;case u.WEST:l=Math.max(l,g.getY()+g.getHeight());break}else switch(h){case u.NORTH:i+=g.getWidth()+2;break;case u.EAST:s+=g.getHeight()+2;break;case u.SOUTH:a+=g.getWidth()+2;break;case u.WEST:l+=g.getHeight()+2;break}}e=Math.max(i,a),o=Math.max(s,l)}return Ae(n,e,o,!0,!0)}function Ae(n,t,e,o,r){let i=new O(n.getWidth(),n.getHeight()),s=ya(n);s.x=Math.max(s.x,t),s.y=Math.max(s.y,e);let a=s.x/i.x,l=s.y/i.y,c=s.x-i.x,g=s.y-i.y;if(o){let h=n.getParent()===null?n.getProperty(lr):n.getParent().getProperty(lr),d=n.getProperty(cr)===H.FIXED_POS;for(let f of n.ports){let E=f.getProperty(Tr);switch(E===u.UNDEFINED&&(E=bp(f,h),f.setProperty(Tr,E)),E){case u.NORTH:d||f.setX(f.getX()*a);break;case u.EAST:f.setX(f.getX()+c),d||f.setY(f.getY()*l);break;case u.SOUTH:d||f.setX(f.getX()*a),f.setY(f.getY()+g);break;case u.WEST:d||f.setY(f.getY()*l);break}}}if(n.setDimensions(s.x,s.y),r)for(let h of n.labels){let d=h.getX()+h.getWidth()/2,f=h.getY()+h.getHeight()/2,E=d/i.x,P=f/i.y;E+P>=1&&(E-P>0&&f>=0?(h.setX(h.getX()+c),h.setY(h.getY()+g*P)):E-P<0&&d>=0&&(h.setX(h.getX()+c*E),h.setY(h.getY()+g)))}return n.setProperty(Mo,mt.fixed()),new O(a,l)}function ya(n){if(n.getProperty(Mo).has(mt.MINIMUM_SIZE)){let e=n.getProperty(Oo),o=new O(n.getProperty(Yo));return e.has(Nt.DEFAULT_MINIMUM_SIZE)&&(o.x<=0&&(o.x=es),o.y<=0&&(o.y=os)),o}return new O}function ru(n){let t=n.getProperty(lu);if(t===1)return;n.setDimensions(t*n.getWidth(),t*n.getHeight());let e=[];for(let r of n.ports)for(let i of r.labels)e.push(i);let o=[...n.labels,...n.ports,...e];for(let r of o){r.setLocation(t*r.getX(),t*r.getY()),r.setDimensions(t*r.getWidth(),t*r.getHeight());let i=r.getProperty(au);i!=null&&(i.x*=t,i.y*=t)}}function Gp(n){if(n.sections.length!==1)throw new Error("The edge needs to have exactly one edge section. Found: "+n.sections.length);let t=new st,e=yl(n.sources[0]);if(e!=null)for(let r of wp(n,e,!1))t.add(r);let o=yl(n.targets[0]);if(o!=null)for(let r of wp(n,o,!0))t.add(r);return t}function wp(n,t,e){let o=n.sections[0],r=new st,i=new Map,s=Mp(o);i.set(o,s);let a=new Map,l=[];for(let c of Ta(t)){if(c.sections.length!==1)throw new Error("The edge needs to have exactly one edge section. Found: "+c.sections.length);if(c!==n){let g=c.sections[0];l.push(g);let h=i.get(g);h||(h=Mp(g),i.set(g,h));let d=e?new O(s[s.length-1]).sub(h[h.length-1]):new O(s[0]).sub(h[0]);a.set(g,d)}}if(l.length>0){let c=s[e?s.length-1:0];for(let g=1;g<s.length;g++){let h=s[e?s.length-1-g:g];for(let d=l.length-1;d>=0;d--){let f=l[d],E=i.get(f);if(E.length<=g)l.splice(d,1);else{let P=new O(E[e?E.length-1-g:g]).add(a.get(f));if(h.x!==P.x||h.y!==P.y){let S=h.x-c.x,T=h.y-c.y,N=P.x-c.x,I=P.y-c.y;N*T===I*S&&Math.sign(S)===Math.sign(N)&&Math.sign(T)===Math.sign(I)?(Math.abs(S)<Math.abs(N)||Math.abs(T)<Math.abs(I))&&r.add(h):g>1&&r.add(c),l.splice(d,1)}}}c=h}}return r}function Mp(n){let t=[];t.push(new O(n.getStartX(),n.getStartY()));for(let o of n.getBendPoints())t.push(new O(o.getX(),o.getY()));t.push(new O(n.getEndX(),n.getEndY()));let e=1;for(;e<t.length-1;){let o=t[e-1],r=t[e],i=t[e+1];o.x===r.x&&r.x===i.x||o.y===r.y&&r.y===i.y?t.splice(e,1):e++}return t}function Ia(n){let t=null;for(let e of n.getLabels()){let o=new dt(e.getPosition().x,e.getPosition().y,e.getSize().x,e.getSize().y);t===null?t=o:t.union(o)}return t||new dt}function Hp(n,t){let e=Ia(n);return iu(new O(e.x,e.y),new O(e.width,e.height),n.getSize(),t,n.getSide())}function iu(n,t,e,o,r){switch(r){case u.NORTH:return Math.max(0,t.y+n.y-(e.y+o));case u.SOUTH:return Math.max(0,-n.y-o);case u.EAST:return Math.max(0,-n.x-o);case u.WEST:return Math.max(0,t.x+n.x-(e.x+o));default:return 0}}function Ra(n,t,e){for(let o of n.children)o.setLocation(o.getX()+t,o.getY()+e);for(let o of n.containedEdges)vO(o,t,e)}function vO(n,t,e){for(let r of n.sections)BO(r,t,e);for(let r of n.labels)r.setLocation(r.getX()+t,r.getY()+e);let o=n.getProperty(gr);o!=null&&o.offset(t,e)}function BO(n,t,e){n.setStartLocation(n.getStartX()+t,n.getStartY()+e);for(let o of n.getBendPoints())o.set(o.getX()+t,o.getY()+e);n.setEndLocation(n.getEndX()+t,n.getEndY()+e)}function Vs(n,t,e){let o=n.getProperty(Rl),r=0,i=0;t.x>e.x&&(o.has(he.H_CENTER)?r=(t.x-e.x)/2:o.has(he.H_RIGHT)&&(r=t.x-e.x)),t.y>e.y&&(o.has(he.V_CENTER)?i=(t.y-e.y)/2:o.has(he.V_BOTTOM)&&(i=t.y-e.y)),Ra(n,r,i)}function su(n,t){let e=t;for(;e!=null;)n.add(e.getX(),e.getY()),e=e.getParent();return n}function nu(n,t){let e=t;for(;e!=null;)n.add(-e.getX(),-e.getY()),e=e.getParent();return n}function Xs(n,t){if(n.size()<2)throw new Error("The vector chain must contain at least a source and a target point.");let e=n.getFirst();t.setStartLocation(e.x,e.y);let o=0,r=t.getBendPoints(),i=n.toArray();for(let a=1;a<i.length-1;a++){let l=i[a],c;o<r.length?c=r[o]:(c=new Xr,r.push(c)),c.set(l.x,l.y),o++}o<r.length&&r.splice(o,r.length-o);let s=n.getLast();t.setEndLocation(s.x,s.y)}function vp(n,...t){Bp(n,e=>{for(let o of t)o.visit(e)})}function Bp(n,t){t(n);for(let e of n.labels)t(e);for(let e of n.ports){t(e);for(let o of e.labels)t(o)}for(let e of n.containedEdges){t(e);for(let o of e.labels)t(o)}for(let e of n.children)Bp(e,t)}var Up=1.3,hr=Object.freeze({SIMPLE:"SIMPLE",GROUP_DEC:"GROUP_DEC",GROUP_MIXED:"GROUP_MIXED",GROUP_INC:"GROUP_INC",values(){return[hr.SIMPLE,hr.GROUP_DEC,hr.GROUP_MIXED,hr.GROUP_INC]},valueOf(n){return hr[n]}}),rs=class extends de{layout(t,e){e&&e.begin&&e.begin("Box layout",2);let o=t.getProperty(Dp),r=t.getProperty(xp),i=t.getProperty(Ll),s=t.getProperty(zo),a=t.getProperty(Il);a===hr.SIMPLE?this._placeBoxesSimple(t,o,r,i,s):this._placeBoxesGrouping(t,o,r,i,a),e&&e.done&&e.done()}_placeBoxesSimple(t,e,o,r,i){let s=UO(t,i),a=ya(t),l=t.getProperty(tu);(l==null||l<=0)&&(l=Up);let c=FO(s,e,o,a.x,a.y,r,l);Ae(t,c.x,c.y,!1,!0)}_placeBoxesGrouping(t,e,o,r,i){let s=t.getProperty(Yo),a=new O(s.x,s.y);a.x=Math.max(a.x-o.getLeft()-o.getRight(),0),a.y=Math.max(a.y-o.getTop()-o.getBottom(),0);let l=t.getProperty(tu);(l==null||l<=0)&&(l=Up);let c=[];for(let f of t.getChildren())c.push(new is(f));let g;i===hr.GROUP_INC?g=VO(c,e,a.x,a.y,r,l):i===hr.GROUP_DEC?g=zO(c,e,a.x,a.y,r,l):g=YO(c,e,a.x,a.y,r,l);let h=new is(g),d=Al(h,e,o,a.x,a.y,r,l);Ae(t,d.x,d.y,!1,!0)}};Z(rs,"PackingMode",hr);function UO(n,t){let e=[...n.getChildren()];return e.sort((o,r)=>{let i=o.getProperty(Qf)||0,s=r.getProperty(Qf)||0;if(i>s)return-1;if(i<s)return 1;if(t){let c=(o.getY()||0)-(r.getY()||0);if(c!==0)return c;let g=(o.getX()||0)-(r.getX()||0);if(g!==0)return g}let a=o.getWidth()*o.getHeight(),l=r.getWidth()*r.getHeight();return a-l}),e}function FO(n,t,e,o,r,i,s){let a=0,l=0;for(let N of n)ou(N),a=Math.max(a,N.getWidth()),l+=N.getWidth()*N.getHeight();let c=l/n.length,g=kO(n,c);l+=n.length*1*g,l+=Math.sqrt(l)*(e.getBottom()+e.getTop()),l+=Math.sqrt(l)*e.getRight(),a=Math.max(a,Math.sqrt(l*s))+e.getLeft();let h=e.getLeft(),d=e.getTop(),f=0,E=e.getHorizontal(),P=[0],S=[];for(let N=0;N<n.length;N++){let I=n[N],C=I.getWidth(),x=I.getHeight();h+C>a&&(i&&(S.push(f),P.push(N)),h=e.getLeft(),d+=f+t,f=0,E=Math.max(E,e.getHorizontal()+C)),I.setLocation(h,d),E=Math.max(E,h+C+e.getRight()),f=Math.max(f,x),h+=C+t}E=Math.max(E,o);let T=d+f+e.getBottom();if(T<r&&(f+=r-T,T=r),i){h=e.getLeft(),P.push(n.length),S.push(f);let N=0,I=P[N++],C=0,x=0;for(let M=0;M<n.length;M++){M===I&&(h=e.getLeft(),x=S[C++],I=P[N++]);let A=n[M],B=A.getHeight();A.setHeight(x);let Y=x;if(M+1===I){let j=E-h-e.getRight(),X=A.getWidth();A.setWidth(j),Vs(A,new O(j,Y),new O(X,B))}h+=A.getWidth()+t}}return new O(E,T)}function kO(n,t){let e=0;for(let o of n)e+=Math.pow(o.getWidth()*o.getHeight()-t,2);return Math.sqrt(e/(n.length-1))}function Al(n,t,e,o,r,i,s){let a=0,l=0;for(let x of n.groups)x.node!=null&&ou(x.node),a=Math.max(a,x.getWidth()),l+=x.getWidth()*x.getHeight();let c=l/n.groups.length,g=WO(n.groups,c);l+=n.groups.length*1*g,a=Math.max(a,Math.sqrt(l*s))+e.getLeft();let d=e.getLeft(),f=e.getTop(),E=0,P=e.getHorizontal(),S=[0],T=[],N=null,I=[];for(let x=0;x<n.groups.length;x++){let M=n.groups[x],A=M.getWidth(),B=M.getHeight();d+A>a&&(i&&(T.push(E),S.push(x),N!=null&&n.right.push(N),I=[]),d=e.getLeft(),f+=E+t,E=0,P=Math.max(P,e.getHorizontal()+A)),I.push(M),M.translate(d,f),P=Math.max(P,d+A+e.getRight()),E=Math.max(E,B),d+=A+t,N=M}for(let x of I)n.bottom.push(x);I.length>0&&n.right.push(I[I.length-1]),P=Math.max(P,o);let C=f+E+e.getBottom();if(C<r&&(E+=r-C,C=r),i){d=e.getLeft(),S.push(n.groups.length),T.push(E);let x=0,M=S[x++],A=0,B=0;for(let Y=0;Y<n.groups.length;Y++){Y===M&&(d=e.getLeft(),B=T[A++],M=S[x++]);let j=n.groups[Y];if(j.setHeight(B),Y+1===M){let X=P-d-e.getRight(),tt=j.getWidth();j.setWidth(X),j.translateInnerNodes((X-tt)/2,0)}d+=j.getWidth()+t}}return new O(P,C)}function WO(n,t){let e=0;for(let o of n)e+=Math.pow(o.area()-t,2);return Math.sqrt(e/(n.length-1))}function zO(n,t,e,o,r,i){n.sort((h,d)=>d.area()-h.area());let s=[...n],a=[],l=[],c=null,g=0;for(;s.length>0;){let h=s.shift();if(c==null||c.area()/2<h.area())c=h,a.push(h);else if(g+=h.area(),l.push(h),l.length>1&&(g>c.area()/2||s.length===0)){let d=new is(l),f=c.getWidth()/c.getHeight(),E=Al(d,t,new yt,e,o,r,f);d.size.x=E.x,d.size.y=E.y,c=d,a.push(d),g=0,l=[]}}for(let h of l)a.push(h);return a}function YO(n,t,e,o,r,i){let s=[...n].sort((g,h)=>g.area()-h.area()),a=new Array(n.length).fill(0),l=0,c=[];for(;s.length>0;){let g=s[0];if(l>1&&g.area()/2>a[0]){let h=0;for(;h<c.length-1&&g.area()/2>a[h];)h++;let d=c.slice(0,h+1),f=new is(d),E=g.getWidth()/g.getHeight(),P=Al(f,t,new yt,e,o,r,E);f.size.x=P.x,f.size.y=P.y;let S=c.slice(h+1);s.push(f);for(let T of S)s.push(T);s.sort((T,N)=>T.area()-N.area()),c.length=0,l=0,a.fill(0)}else s.shift(),l>0&&(a[l]=a[l-1]),a[l]+=g.area(),l++,c.push(g)}return c}function VO(n,t,e,o,r,i){n.sort((l,c)=>l.area()-c.area());let s=[],a=0;for(let l of n)if(s.length>0&&l.area()>a*2){let c=new is(s),g=l.getWidth()/l.getHeight(),h=Al(c,t,new yt,e,o,r,g);c.size.x=h.x,c.size.y=h.y,s=[],a=0,s.push(c),s.push(l),a=c.area()+l.area()}else s.push(l),a+=l.area();return s}var is=class{constructor(t){Array.isArray(t)?(this.groups=[...t],this.node=null,this.bottom=[],this.right=[],this.size=new O):(this.node=t,this.groups=null,this.bottom=null,this.right=null,this.size=null,this.node.setLocation(0,0))}area(){return this.getWidth()*this.getHeight()}getWidth(){return this.node!=null?this.node.getWidth():this.size.x}getHeight(){return this.node!=null?this.node.getHeight():this.size.y}setWidth(t){if(this.node!=null)this.node.setWidth(t);else{let e=t-this.getWidth();for(let o of this.right)o.setWidth(o.getWidth()+e)}}setHeight(t){if(this.node!=null)this.node.setHeight(t);else{let e=t-this.getHeight();for(let o of this.bottom)o.setHeight(o.getHeight()+e)}}translate(t,e){if(this.node!=null)this.node.setX(this.node.getX()+t),this.node.setY(this.node.getY()+e);else for(let o of this.groups)o.translate(t,e)}translateInnerNodes(t,e){if(this.node!=null)Ra(this.node,t,e);else for(let o of this.groups)o.translateInnerNodes(t,e)}};var qt=Object.freeze({DISTRIBUTED:"DISTRIBUTED",JUSTIFIED:"JUSTIFIED",BEGIN:"BEGIN",CENTER:"CENTER",END:"END",values(){return[this.DISTRIBUTED,this.JUSTIFIED,this.BEGIN,this.CENTER,this.END]},valueOf(n){return this[n]}});var Fp=Object.freeze({INHERIT:"INHERIT",PARENT:"PARENT",ROOT:"ROOT",values(){return[this.INHERIT,this.PARENT,this.ROOT]},valueOf(n){return this[n]}});var Il=new m("org.eclipse.elk.box.packingMode",()=>hr.SIMPLE),mi=new m("org.eclipse.elk.algorithm"),ss=new m("org.eclipse.elk.resolvedAlgorithm"),XO=new m("org.eclipse.elk.alignment",Kt.AUTOMATIC),KO=new m("org.eclipse.elk.aspectRatio",null,Xe.greaterThan(0)),Cl=new m("org.eclipse.elk.bendPoints"),Rl=new m("org.eclipse.elk.contentAlignment",he.topLeft()),Ks=new m("org.eclipse.elk.debugMode",!1),lr=new m("org.eclipse.elk.direction",R.UNDEFINED),cu=new m("org.eclipse.elk.edgeRouting",At.UNDEFINED),Ll=new m("org.eclipse.elk.expandNodes",!1),yr=new m("org.eclipse.elk.hierarchyHandling",Oe.INHERIT),ns=new m("org.eclipse.elk.padding",new yt(12)),zo=new m("org.eclipse.elk.interactive",!1),ZO=new m("org.eclipse.elk.interactiveLayout",!1),So=new m("org.eclipse.elk.omitNodeMicroLayout",!1),jO=new m("org.eclipse.elk.json.shapeCoords",Fp.INHERIT),$O=new m("org.eclipse.elk.json.edgeCoords",Ap.INHERIT),qO=new m("org.eclipse.elk.spacing.commentComment",10,0),JO=new m("org.eclipse.elk.spacing.commentNode",10,0),QO=new m("org.eclipse.elk.spacing.componentComponent",20,0),tS=new m("org.eclipse.elk.spacing.edgeEdge",10,0),gu=new m("org.eclipse.elk.spacing.edgeLabel",2,0),eS=new m("org.eclipse.elk.spacing.edgeNode",10,0),hu=new m("org.eclipse.elk.spacing.labelLabel",0,0),Zs=new m("org.eclipse.elk.spacing.labelNode",5,0),du=new m("org.eclipse.elk.spacing.labelPortHorizontal",1),fu=new m("org.eclipse.elk.spacing.labelPortVertical",1),Pi=new m("org.eclipse.elk.spacing.nodeNode",20,0),oS=new m("org.eclipse.elk.spacing.nodeSelfLoop",10,0),uu=new m("org.eclipse.elk.spacing.portPort",10,0),as=new m("org.eclipse.elk.spacing.individual"),_u=new m("org.eclipse.elk.spacing.portsSurrounding",new me(0)),rS=new m("org.eclipse.elk.partitioning.partition"),iS=new m("org.eclipse.elk.partitioning.activate",!1),pu=new m("org.eclipse.elk.nodeLabels.padding",new yt(5)),Kr=new m("org.eclipse.elk.nodeLabels.placement",k.fixed),Eu=new m("org.eclipse.elk.portAlignment.default",qt.DISTRIBUTED),xl=new m("org.eclipse.elk.portAlignment.north"),Dl=new m("org.eclipse.elk.portAlignment.south"),wl=new m("org.eclipse.elk.portAlignment.west"),Ml=new m("org.eclipse.elk.portAlignment.east"),cr=new m("org.eclipse.elk.portConstraints",H.UNDEFINED),ho=new m("org.eclipse.elk.position"),mu=new m("org.eclipse.elk.priority"),Pu=new m("org.eclipse.elk.randomSeed"),sS=new m("org.eclipse.elk.separateConnectedComponents"),Mo=new m("org.eclipse.elk.nodeSize.constraints",new Set),Oo=new m("org.eclipse.elk.nodeSize.options",new Set([Nt.DEFAULT_MINIMUM_SIZE])),Yo=new m("org.eclipse.elk.nodeSize.minimum",new O(0,0)),To=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1),gr=new m("org.eclipse.elk.junctionPoints",new st),nS=new m("org.eclipse.elk.commentBox",!1),Aa=new m("org.eclipse.elk.edgeLabels.placement",St.CENTER),Ou=new m("org.eclipse.elk.edgeLabels.inline",!1),aS=new m("org.eclipse.elk.font.name"),lS=new m("org.eclipse.elk.font.size",null,1),cS=new m("org.eclipse.elk.hypernode",!1),gS=new m("org.eclipse.elk.labelManager"),hS=new m("org.eclipse.elk.softwrappingFuzziness",0),Nr=new m("org.eclipse.elk.margins",new me),bl=new m("org.eclipse.elk.noLayout",!1),au=new m("org.eclipse.elk.port.anchor"),Gl=new m("org.eclipse.elk.port.index"),Tr=new m("org.eclipse.elk.port.side",u.UNDEFINED),Ke=new m("org.eclipse.elk.port.borderOffset"),Ir=new m("org.eclipse.elk.portLabels.placement",it.outside),Hl=new m("org.eclipse.elk.portLabels.nextToPortIfPossible",!1),Su=new m("org.eclipse.elk.portLabels.treatAsGroup",!0),lu=new m("org.eclipse.elk.scaleFactor",1,Xe.greaterThan(0)),pi=new m("org.eclipse.elk.childAreaWidth"),Ei=new m("org.eclipse.elk.childAreaHeight"),js=new m("org.eclipse.elk.topdownLayout",!1),dS=new m("org.eclipse.elk.topdown.sizeCategories",3,1),fS=new m("org.eclipse.elk.topdown.sizeCategoriesHierarchicalNodeWeight",4,1),kp=new m("org.eclipse.elk.topdown.scaleFactor",1,Xe.greaterThan(0)),uS=new m("org.eclipse.elk.topdown.sizeApproximator"),Wp=new m("org.eclipse.elk.topdown.hierarchicalNodeWidth",150),zp=new m("org.eclipse.elk.topdown.hierarchicalNodeAspectRatio",1.414),_S=new m("org.eclipse.elk.topdown.nodeType"),pS=new m("org.eclipse.elk.topdown.scaleCap",1),ls=new m("org.eclipse.elk.insideSelfLoops.activate",!1),Ca=new m("org.eclipse.elk.insideSelfLoops.yo",!1),ES=new m("org.eclipse.elk.edge.thickness",1),mS=new m("org.eclipse.elk.edge.type",Cp.NONE),PS=new m("org.eclipse.elk.animate",!0),OS=new m("org.eclipse.elk.animTimeFactor",100,0),SS=new m("org.eclipse.elk.layoutAncestors",!1),TS=new m("org.eclipse.elk.maxAnimTime",4e3,0),NS=new m("org.eclipse.elk.minAnimTime",400,0),yS=new m("org.eclipse.elk.progressBar",!1),IS=new m("org.eclipse.elk.validateGraph",!1),RS=new m("org.eclipse.elk.validateOptions",!0),LS=new m("org.eclipse.elk.zoomToFit",!1),AS="org.eclipse.elk.layered",CS="org.eclipse.elk.orthogonal",xS="org.eclipse.elk.force",DS="org.eclipse.elk.circle",wS="org.eclipse.elk.tree",MS="org.eclipse.elk.planar",bS="org.eclipse.elk.radial",Yp="org.eclipse.elk.fixed",GS="org.eclipse.elk.box",HS="org.eclipse.elk.random";var Bl=class{static forGraph(t){let e=new yu;if(typeof t=="string")e._graphString=t;else if(t!=null&&typeof t=="object"&&!(t instanceof Array)){if(typeof t.getChildren=="function"&&typeof t.getProperty=="function")return new Iu(t);e._jsonGraph=t}else throw new Error("ElkGraphJson.forGraph expects a string, plain JSON object, or ElkNode.");return e}},yu=class{constructor(){this._graphString=null,this._jsonGraph=null,this._importerMaybe=null,this._lenient=!0}rememberImporter(t){return this._importerMaybe=t,this}lenient(t){return this._lenient=t,this}toElk(){if(this._jsonGraph==null){if(this._graphString==null)throw new Error("No graph has been set on the import builder.");if(this._jsonGraph=JSON.parse(this._graphString),this._jsonGraph==null||typeof this._jsonGraph!="object"||Array.isArray(this._jsonGraph))throw new Oi("Top-level element of the graph must be a json object.")}let t=new Ru,e=t.transform(this._jsonGraph);return this._importerMaybe!=null&&(this._importerMaybe.value=t),e}},Iu=class{constructor(t){this._graph=t,this._prettyPrint=!1,this._omitZeroPosition=!0,this._omitZeroDimension=!0,this._omitLayoutInformation=!1,this._shortLayoutOptionKeys=!0,this._omitUnknownLayoutOptions=!0}prettyPrint(t){return this._prettyPrint=t,this}shortLayoutOptionKeys(t){return this._shortLayoutOptionKeys=t,this}omitZeroPositions(t){return this._omitZeroPosition=t,this}omitZeroDimension(t){return this._omitZeroDimension=t,this}omitLayout(t){return this._omitLayoutInformation=t,this}omitUnknownLayoutOptions(t){return this._omitUnknownLayoutOptions=t,this}toJson(){let t=new Lu;t.setOptions({omitZeroPosition:this._omitZeroPosition,omitZeroDimension:this._omitZeroDimension,omitLayoutInformation:this._omitLayoutInformation,shortLayoutOptionKeys:this._shortLayoutOptionKeys,omitUnknownLayoutOptions:this._omitUnknownLayoutOptions});let e=t.export(this._graph);return this._prettyPrint?JSON.stringify(e,null,2):JSON.stringify(e)}},Oi=class extends Error{constructor(t){super(t),this.name="JsonImportException"}},Ru=class{constructor(){this._nodeIdMap=new Map,this._portIdMap=new Map,this._edgeIdMap=new Map,this._nodeJsonMap=new Map,this._portJsonMap=new Map,this._edgeJsonMap=new Map,this._labelJsonMap=new Map,this._inputModel=null}getInputModel(){return this._inputModel}transform(t){this._inputModel=t,this._nodeIdMap.clear(),this._portIdMap.clear(),this._edgeIdMap.clear(),this._nodeJsonMap.clear(),this._portJsonMap.clear(),this._edgeJsonMap.clear(),this._labelJsonMap.clear();let e=this._transformNode(t,null);return this._transformEdges(t),e}_transformNode(t,e){let o=e==null?Oa():Fs(e),r=t.id;if(r==null)throw new Oi("Every element must have an id.");if(o.identifier=String(r),this._nodeIdMap.set(r,o),this._nodeJsonMap.set(o,t),Au(o,t),Zr(o,t.layoutOptions),Zr(o,t.properties),Array.isArray(t.labels))for(let i of t.labels)Tu(i,o,this._labelJsonMap);if(Array.isArray(t.ports))for(let i of t.ports)this._transformPort(i,o);if(Array.isArray(t.children))for(let i of t.children)this._transformNode(i,o);return o}_transformPort(t,e){let o=Kf(e),r=t.id;if(r==null)throw new Oi("Every element must have an id.");if(o.identifier=String(r),this._portIdMap.set(r,o),this._portJsonMap.set(o,t),Au(o,t),Zr(o,t.layoutOptions),Zr(o,t.properties),Array.isArray(t.labels))for(let i of t.labels)Tu(i,o,this._labelJsonMap);return o}_transformEdges(t){if(Array.isArray(t.edges))for(let e of t.edges)this._transformEdge(e,this._nodeIdMap.get(t.id));if(Array.isArray(t.children))for(let e of t.children)this._transformEdges(e)}_transformEdge(t,e){var c,g,h,d,f,E;let o=t.id;if(o==null)throw new Oi("Every element must have an id.");let r=t.sources||[],i=t.targets||[];if(r.length===0||i.length===0)throw new Oi(`Edge ${o} must have at least one source and one target.`);let s=this._resolveShape(r[0]),a=this._resolveShape(i[0]);if(s==null||a==null)throw new Oi(`Edge ${o} references an unknown source or target.`);let l=Zf(s,a);l.identifier=String(o);for(let P=1;P<r.length;P++){let S=this._resolveShape(r[P]);S!=null&&l.getSources().push(S)}for(let P=1;P<i.length;P++){let S=this._resolveShape(i[P]);S!=null&&l.getTargets().push(S)}if(this._edgeIdMap.set(o,l),this._edgeJsonMap.set(l,t),Zr(l,t.layoutOptions),Zr(l,t.properties),Array.isArray(t.sections))for(let P of t.sections){let S=Nl(l);if(P.id!=null&&(S.identifier=String(P.id)),P.startPoint!=null&&(S.startX=(c=P.startPoint.x)!=null?c:0,S.startY=(g=P.startPoint.y)!=null?g:0),P.endPoint!=null&&(S.endX=(h=P.endPoint.x)!=null?h:0,S.endY=(d=P.endPoint.y)!=null?d:0),Array.isArray(P.bendPoints))for(let T of P.bendPoints)Sa(S,(f=T.x)!=null?f:0,(E=T.y)!=null?E:0)}if(Array.isArray(t.labels))for(let P of t.labels)Tu(P,l,this._labelJsonMap)}_resolveShape(t){let e=this._portIdMap.get(t)||this._nodeIdMap.get(t);if(e!=null)return e;let o=String(t),r=o.indexOf(":");if(r>0){let i=o.substring(r+1),s=this._nodeIdMap.get(o.substring(0,r));if(s!=null&&typeof s.getPorts=="function"){for(let a of s.getPorts())if(typeof a.getIdentifier=="function"&&a.getIdentifier()===i)return a}return this._portIdMap.get(i)||null}return null}transferLayout(t){this._transferShapesAndPorts(t),this._transferEdges(t)}_transferShapesAndPorts(t){let e=this._nodeJsonMap.get(t);e!=null&&xa(e,t);for(let o of t.getLabels()){let r=this._labelJsonMap.get(o);r!=null&&xa(r,o)}for(let o of t.getPorts()){let r=this._portJsonMap.get(o);r!=null&&xa(r,o);for(let i of o.getLabels()){let s=this._labelJsonMap.get(i);s!=null&&xa(s,i)}}for(let o of t.getChildren())this._transferShapesAndPorts(o)}_transferEdges(t){for(let e of t.getContainedEdges()){let o=this._edgeJsonMap.get(e);o!=null&&vS(o,e);for(let r of e.getLabels()){let i=this._labelJsonMap.get(r);i!=null&&xa(i,r)}}for(let e of t.getChildren())this._transferEdges(e)}};function xa(n,t){n.x=t.x||0,n.y=t.y||0,n.width=t.width||0,n.height=t.height||0}function vS(n,t){let e=t.getSections?t.getSections():[];if(e.length>0){let o=n.id!=null?String(n.id):"";n.sections=e.map((r,i)=>{let s={id:r.identifier||o+"_s"+i,startPoint:{x:r.startX||0,y:r.startY||0},endPoint:{x:r.endX||0,y:r.endY||0}};r.bendPoints&&r.bendPoints.length>0&&(s.bendPoints=r.bendPoints.map(c=>({x:c.x,y:c.y})));let a=r.getIncomingShape?r.getIncomingShape():null;a!=null&&a.identifier&&(s.incomingShape=a.identifier);let l=r.getOutgoingShape?r.getOutgoingShape():null;return l!=null&&l.identifier&&(s.outgoingShape=l.identifier),s})}if(t.hasProperty&&t.hasProperty(gr)){let o=t.getProperty(gr);o!=null&&o.length>0&&(n.junctionPoints=o.map(r=>({x:r.x,y:r.y})))}}var Lu=class{constructor(){this._options={omitZeroPosition:!0,omitZeroDimension:!0,omitLayoutInformation:!1,shortLayoutOptionKeys:!1,omitUnknownLayoutOptions:!0}}setOptions(t){Object.assign(this._options,t)}export(t){return this._exportNode(t)}_exportNode(t){let e={id:t.identifier||cs(t)};Cu(e,t,this._options),vl(e,t,this._options);let o=t.getLabels?t.getLabels():[];o&&o.length>0&&(e.labels=o.map(a=>Nu(a,this._options)));let r=t.getPorts?t.getPorts():[];r&&r.length>0&&(e.ports=r.map(a=>this._exportPort(a)));let i=t.getChildren?t.getChildren():[];i&&i.length>0&&(e.children=i.map(a=>this._exportNode(a)));let s=t.getContainedEdges?t.getContainedEdges():[];return s&&s.length>0&&(e.edges=s.map(a=>this._exportEdge(a))),e}_exportPort(t){let e={id:t.identifier||cs(t)};Cu(e,t,this._options),vl(e,t,this._options);let o=t.getLabels?t.getLabels():[];return o&&o.length>0&&(e.labels=o.map(r=>Nu(r,this._options))),e}_exportEdge(t){let e={id:t.identifier||cs(t),sources:t.getSources().map(i=>i.identifier||cs(i)),targets:t.getTargets().map(i=>i.identifier||cs(i))};vl(e,t,this._options);let o=t.getSections?t.getSections():[];o&&o.length>0&&!this._options.omitLayoutInformation&&(e.sections=o.map(i=>({id:i.identifier||cs(i),startPoint:{x:i.startX||0,y:i.startY||0},endPoint:{x:i.endX||0,y:i.endY||0},bendPoints:(i.bendPoints||[]).map(s=>({x:s.x,y:s.y}))})));let r=t.getLabels?t.getLabels():[];return r&&r.length>0&&(e.labels=r.map(i=>Nu(i,this._options))),e}},Vp=0,Xp=new WeakMap;function cs(n){let t=Xp.get(n);return t===void 0&&(Vp+=1,t="__auto_"+Vp,Xp.set(n,t)),t}function Au(n,t){t.x!=null&&(n.x=Number(t.x)),t.y!=null&&(n.y=Number(t.y)),t.width!=null&&(n.width=Number(t.width)),t.height!=null&&(n.height=Number(t.height))}function Cu(n,t,e){let o=t.x||0,r=t.y||0;(!e.omitZeroPosition||o!==0||r!==0)&&(n.x=o,n.y=r);let i=t.width||0,s=t.height||0;(!e.omitZeroDimension||i!==0||s!==0)&&(n.width=i,n.height=s)}function Zr(n,t,e=!0){if(t==null||typeof t!="object")return;let o=Ht.getInstance();for(let[r,i]of Object.entries(t)){let s=m.byId(r)||m.bySuffix(r),a=null;if(o!=null&&(a=o.getOptionData(r),a==null&&typeof o.getOptionDataBySuffix=="function"&&(a=o.getOptionDataBySuffix(r))),s!=null){if(!e&&n.hasProperty(s))continue;let l=BS(s,a,i);l!==void 0&&n.setProperty(s,l)}else if(a!=null){if(!e&&n.hasProperty(a))continue;let l=typeof a.parseValue=="function"?a.parseValue(String(i)):i;l!=null&&n.setProperty(a,l)}else{let l=new m(r);if(!e&&n.hasProperty(l))continue;n.setProperty(l,i)}}}function gs(n,t,e=!0){Zr(n,t,e)}function BS(n,t,e){let o=US.get(n.getId());if(o)return FS(o,e);if(t&&typeof t.parseValue=="function"){let s=t.parseValue(String(e));return s!=null?s:void 0}if(typeof e!="string")return e;let r=n.getDefault();if(r!=null){if(typeof r.parse=="function"&&typeof r.clone=="function"){let a=r.clone();try{return a.parse(String(e)),a}catch(l){return}}if(r instanceof Set){let a=new Set;for(let l of e.split(/[[\]\s,]+/))l&&a.add(l);return a}let s=r.constructor;if(s&&s!==Number&&s!==String&&s!==Boolean&&s!==Object){let a=s[e];if(a instanceof s)return a;if(Object.prototype.hasOwnProperty.call(s,"valueOf")&&typeof s.valueOf=="function"){let l=s.valueOf(e);if(l instanceof s)return l}if(/^\d+$/.test(e)&&typeof s.values=="function"){let l=s.values(),c=parseInt(e,10);if(Array.isArray(l)&&c<l.length)return l[c]}return}if(typeof r=="number"){let a=Number(e);return Number.isNaN(a)?void 0:a}if(typeof r=="boolean")return e==="true"?!0:e==="false"?!1:void 0}if(e==="true")return!0;if(e==="false")return!1;let i=Number(e);return!Number.isNaN(i)&&e.trim()!==""?i:e}var US=new Map([["org.eclipse.elk.position",O],["org.eclipse.elk.bendPoints",st],["org.eclipse.elk.port.anchor",O]]);function FS(n,t){if(t instanceof n)return t;if(typeof t=="string"){let e=new n;try{return e.parse(t),e}catch(o){return}}if(n===O&&t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number")return new O(t.x,t.y);if(n===st&&Array.isArray(t)){let e=new st;for(let o of t){if(o==null||typeof o.x!="number"||typeof o.y!="number")return;e.add(new O(o.x,o.y))}return e}}function vl(n,t,e){if(e.omitLayoutInformation)return;let o=t.getAllProperties?t.getAllProperties():null;if(o==null||o.size===0)return;let r={},i=!1;for(let[s,a]of o.entries()){if(s==null)continue;let l=s.getId?s.getId():s.id||null;l!=null&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean"?r[l]=a:a!=null&&typeof a.toString=="function"&&(r[l]=a.toString()),i=!0)}i&&(n.layoutOptions=r)}function Tu(n,t,e){let o=Tl(t);return n.id!=null&&(o.identifier=String(n.id)),n.text!=null&&(o.text=String(n.text)),Au(o,n),Zr(o,n.layoutOptions),Zr(o,n.properties),e!=null&&e.set(o,n),o}function Nu(n,t){let e={id:n.identifier||cs(n)};return n.text!=null&&(e.text=n.text),Cu(e,n,t),vl(e,n,t),e}var hs=class{visit(t){let e=Ul();t&&typeof t.getChildren=="function"&&!t.getProperty(e.NO_LAYOUT)&&this.resolveAlgorithm(t)}resolveAlgorithm(t){let e=Ul(),o=t.getProperty(e.ALGORITHM);if(!this.resolveAndSetAlgorithm(o,t)&&this.mustResolve(t))if(!o||o.trim()===""){let r=this.getDefaultLayoutAlgorithmID();if(!this.resolveAndSetAlgorithm(r,t)){let i=`Unable to load default layout algorithm '${r}' for unconfigured node`;throw t.getIdentifier&&(i+=` '${t.getIdentifier()}'`),new Error(i)}}else{let r=`Layout algorithm '${o}' not found`;throw t.getIdentifier&&(r+=` for node '${t.getIdentifier()}'`),new Error(r)}}resolveAndSetAlgorithm(t,e){let o=Ht.getInstance().getAlgorithmDataBySuffix(t);if(o!==null){let r=Ul();return e.setProperty(r.RESOLVED_ALGORITHM,o),!0}return!1}mustResolve(t){let e=Ul();return!t.hasProperty(e.RESOLVED_ALGORITHM)&&(t.getChildren().length>0||t.getProperty(e.INSIDE_SELF_LOOPS_ACTIVATE))}getDefaultLayoutAlgorithmID(){return"org.eclipse.elk.layered"}},Fl=null;function Ul(){if(!Fl)try{Fl=_injectedCoreOptions}catch(n){throw new Error("CoreOptions not available. Call LayoutAlgorithmResolver.setCoreOptions(CoreOptions) before using this class, or ensure CoreOptions is registered with LayoutMetaDataService.")}return Fl}hs.setCoreOptions=function(n){Fl=n};var kS=n=>{n.getProperty(Ir).add(it.NEXT_TO_PORT_IF_POSSIBLE),n.setProperty(Hl,null)},WS=n=>{n.getProperty(Oo).has(Nt.SPACE_EFFICIENT_PORT_LABELS)&&(n.getProperty(Ir).add(it.SPACE_EFFICIENT),n.getProperty(Oo).delete(Nt.SPACE_EFFICIENT_PORT_LABELS))},zS=new Map([[Hl,kS],[Oo,WS]]),kl=class{visit(t){for(let[e,o]of zS)t.hasProperty(e)&&o(t)}};var Wl=class{layout(t,e){let o=this._countNodesRecursively(t,!0);e.begin("Recursive Graph Layout",o),vp(t,new kl),t.hasProperty&&t.hasProperty(ss)||Kp(t,new hs),this._layoutRecursively(t,e),e.done()}_layoutRecursively(t,e){if(e.isCanceled())return[];if(t.getProperty&&t.getProperty(bl))return[];let o=t.children&&t.children.length>0,r=this._gatherInsideSelfLoops(t),i=r.length>0;if(!o&&!i)return[];let s=t.getProperty?t.getProperty(ss):null;if(!s)throw new Error("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before layout.");let a=s.supportsFeature("INSIDE_SELF_LOOPS");if(this._evaluateHierarchyHandlingInheritance(t),!o&&i&&!a)return[];let l=[],c=t.getProperty?t.getProperty(yr):null,g=s.supportsFeature("COMPOUND"),h=s.supportsFeature("CLUSTERS");if(c===Oe.INCLUDE_CHILDREN&&(g||h)){if(t.getProperty&&t.getProperty(js))throw new Error("Topdown layout cannot be used together with hierarchy handling.");let f=(t.children||[]).slice();for(;f.length>0;){let E=f.shift();this._evaluateHierarchyHandlingInheritance(E);let S=(E.getProperty?E.getProperty(yr):null)===Oe.SEPARATE_CHILDREN,T=E.getProperty&&E.hasProperty&&E.hasProperty(mi)&&!s.equals(E.getProperty(ss));if(S||T){let N=this._layoutRecursively(E,e);l.push(...N),E.setProperty&&E.setProperty(yr,Oe.SEPARATE_CHILDREN),ru(E)}else f.push(...E.children||[])}}else for(let f of t.children||[]){let E=this._layoutRecursively(f,e);l.push(...E),ru(f)}if(e.isCanceled())return[];for(let f of l)f.setProperty&&f.setProperty(bl,!0);let d=t.children?t.children.length:0;return this._executeAlgorithm(t,s,e.subTask(d)),this._postProcessInsideSelfLoops(l),i&&a?r:[]}_executeAlgorithm(t,e,o){let r=e.createLayoutProvider();try{r.layout(t,o)}catch(i){throw r.dispose(),i}}_countNodesRecursively(t,e){let o=(t.children||[]).length;for(let r of t.children||[])r.children&&r.children.length>0&&(o+=this._countNodesRecursively(r,!1));if(e){let r=t.parent;for(;r;)o+=(r.children||[]).length,r=r.parent}return o}_countNodesWithHierarchy(t){let e=(t.children||[]).length;for(let o of t.children||[])if((o.getProperty?o.getProperty(yr):null)!==Oe.SEPARATE_CHILDREN){let i=t.getProperty?t.getProperty(ss):null,s=o.getProperty?o.getProperty(ss):null;(i===s||i&&i.equals&&i.equals(s))&&o.children&&o.children.length>0&&(e+=this._countNodesWithHierarchy(o))}return e}_evaluateHierarchyHandlingInheritance(t){if(!t.getProperty)return;if(t.getProperty(yr)===Oe.INHERIT)if(!t.parent)t.setProperty(yr,Oe.SEPARATE_CHILDREN);else{let o=t.parent.getProperty?t.parent.getProperty(yr):Oe.SEPARATE_CHILDREN;t.setProperty(yr,o)}}_gatherInsideSelfLoops(t){if(!t.getProperty||!t.getProperty(ls))return[];let e=[];for(let o of Ee(t))o.isSelfloop&&o.isSelfloop()&&o.getProperty&&o.getProperty(Ca)&&e.push(o);return e}_postProcessInsideSelfLoops(t){for(let e of t){let o=e.sources&&e.sources[0];if(!o)continue;let r=o.parent!==void 0?o.parent:o,i=r.x||0,s=r.y||0;if(!e.sections||e.sections.length===0)continue;let a=e.sections[0];a.setStartLocation(a.startX+i,a.startY+s),a.setEndLocation(a.endX+i,a.endY+s);for(let l of a.bendPoints||[])l.set(l.x+i,l.y+s);if(e.getProperty){let l=e.getProperty(gr);l&&typeof l.offset=="function"&&l.offset(i,s)}}}};function Kp(n,t){t.visit(n);for(let e of n.children||[])Kp(e,t);for(let e of n.ports||[])t.visit(e);for(let e of n.labels||[])t.visit(e);for(let e of n.containedEdges||[])t.visit(e)}var zl=class{isCanceled(){return!1}begin(t,e){return!1}worked(t){}done(){}isRunning(){return!1}getTaskName(){return null}subTask(t){return this}getSubMonitors(){return null}getParentMonitor(){return null}isLoggingEnabled(){return!1}isLogPersistenceEnabled(){return!1}log(t){}getLogs(){return null}logGraph(t,e,o){}getLoggedGraphs(){return null}isExecutionTimeMeasured(){return!1}getExecutionTime(){return 0}};var Se=class n{constructor(t){this._id=t.id||"",this._name=t.name||"",this._description=t.description||"",this._category=t.category||null,this._melkBundleName=t.melkBundleName||null,this._definingBundleId=t.definingBundleId||null,this._imagePath=t.imagePath||null,this._supportedFeatures=t.supportedFeatures||new Set,this._providerFactory=t.providerFactory||null,this._validatorClass=t.validatorClass||null,this._knownOptions=new Map}getId(){return this._id}getName(){return this._name}getDescription(){return this._description}getCategoryId(){return this._category}getBundleName(){return this._melkBundleName}getDefiningBundleId(){return this._definingBundleId}getPreviewImagePath(){return this._imagePath}getSupportedFeatures(){return this._supportedFeatures}supportsFeature(t){return this._supportedFeatures.has(t)}getValidatorClass(){return this._validatorClass}createLayoutProvider(){return this._providerFactory?this._providerFactory():null}getInstancePool(){let t=this._providerFactory;return{fetch(){return t?t():null},release(e){},clear(){}}}addKnownOption(t,e){this._knownOptions.set(t.getId(),e)}getKnownOptionIds(){return new Set(this._knownOptions.keys())}knowsOption(t){let e=typeof t=="string"?t:t.getId();return this._knownOptions.has(e)}getDefaultValue(t){let e=typeof t=="string"?t:t.getId();return this._knownOptions.get(e)}equals(t){return t instanceof n?this._id===t._id:!1}toString(){return`Layout Algorithm: ${this._id}`}},xu=class{constructor(){this._id="",this._name="",this._description="",this._category=null,this._melkBundleName=null,this._definingBundleId=null,this._imagePath=null,this._supportedFeatures=null,this._providerFactory=null,this._validatorClass=null}create(){return new Se({id:this._id,name:this._name,description:this._description,category:this._category,melkBundleName:this._melkBundleName,definingBundleId:this._definingBundleId,imagePath:this._imagePath,supportedFeatures:this._supportedFeatures||new Set,providerFactory:this._providerFactory,validatorClass:this._validatorClass})}id(t){return this._id=t,this}name(t){return this._name=t,this}description(t){return this._description=t,this}category(t){return this._category=t,this}melkBundleName(t){return this._melkBundleName=t,this}definingBundleId(t){return this._definingBundleId=t,this}imagePath(t){return this._imagePath=t,this}supportedFeatures(t){return this._supportedFeatures=t,this}providerFactory(t){return this._providerFactory=t,this}validatorClass(t){return this._validatorClass=t,this}};Se.Builder=xu;var Zp=new m("org.eclipse.elk.padding",new yt(15));var Yl=class extends de{layout(t,e){e.begin("Fixed Layout",1);let o=t.getProperty(cu),r=0,i=0;for(let s of t.children){let a=s.getProperty(ho);if(a!=null){s.setLocation(a.x,a.y);let l=s.getProperty(Mo);if(l&&l.has(mt.MINIMUM_SIZE)){let c=s.getProperty(Yo);c!=null&&c.x>0&&c.y>0&&Ae(s,c.x,c.y,!0,!0)}}r=Math.max(r,s.getX()+s.getWidth()),i=Math.max(i,s.getY()+s.getHeight());for(let l of s.labels)a=l.getProperty(ho),a!=null&&l.setLocation(a.x,a.y),r=Math.max(r,s.getX()+l.getX()+l.getWidth()),i=Math.max(i,s.getY()+l.getY()+l.getHeight());for(let l of s.ports){a=l.getProperty(ho),a!=null&&l.setLocation(a.x,a.y);let c=s.getX()+l.getX(),g=s.getY()+l.getY();r=Math.max(r,c+l.getWidth()),i=Math.max(i,g+l.getHeight());for(let h of l.labels)a=h.getProperty(ho),a!=null&&h.setLocation(a.x,a.y),r=Math.max(r,c+h.getX()+h.getWidth()),i=Math.max(i,g+h.getY()+h.getHeight())}for(let l of Ee(s)){let c=this._processEdge(l,o);r=Math.max(r,c.x),i=Math.max(i,c.y)}for(let l of _i(s)){let c=Pt(l.sources[0]);if(c&&c.parent!==t){let g=this._processEdge(l,o);r=Math.max(r,g.x),i=Math.max(i,g.y)}}}if(o===At.ORTHOGONAL)for(let s of t.children)for(let a of Ee(s))this._generateJunctionPoints(a);if(!t.getProperty(To)){let s=t.getProperty(Zp),a=r+s.getLeft()+s.getRight(),l=i+s.getTop()+s.getBottom();Ae(t,a,l,!0,!0)}e.done()}_processEdge(t,e){let o=Pt(t.sources[0]),r=Pt(t.targets[0]),i=o?o.parent:null,s=r?r.parent:null,a=i===s,l=new O,c=t.getProperty(Cl);if(c!=null&&c.size()>=2&&(t.sections.length===0?t.sections.push(new Vr):t.sections.length>1&&t.sections.splice(1,t.sections.length-1),Xs(c,t.sections[0])),a)for(let g of t.sections)for(let h of g.bendPoints)l.x=Math.max(l.x,h.getX()),l.y=Math.max(l.y,h.getY());for(let g of t.labels){let h=g.getProperty(ho);h!=null&&g.setLocation(h.x,h.y),a&&(l.x=Math.max(l.x,g.getX()+g.getWidth()),l.y=Math.max(l.y,g.getY()+g.getHeight()))}return l}_generateJunctionPoints(t){let e=Gp(t);e.isEmpty()?t.setProperty(gr,null):t.setProperty(gr,e)}};var jp=new m("org.eclipse.elk.padding",new yt(15)),$p=new m("org.eclipse.elk.spacing.nodeNode",15,0),qp=new m("org.eclipse.elk.randomSeed",0),Jp=new m("org.eclipse.elk.aspectRatio",1.6,Xe.greaterThan(0));var Qp=BigInt(0x5DEECE66D),XS=BigInt(11),tE=(BigInt(1)<<BigInt(48))-BigInt(1),dr=class{constructor(t){t==null||t===0?(this._mathFallback=!0,this._seed=BigInt(0)):(this._mathFallback=!1,this.setSeed(t))}setSeed(t){let e=typeof t=="bigint"?t:BigInt(t);this._seed=(e^Qp)&tE,this._mathFallback=!1,this._nextGaussianStored=void 0}_next(t){this._seed=this._seed*Qp+XS&tE;let e=this._seed>>BigInt(48-t);return Number(e&BigInt(0xFFFFFFFF))|0}nextDouble(){if(this._mathFallback)return Math.random();let t=BigInt(this._next(26)),e=BigInt(this._next(27)),o=(t<<BigInt(27))+e;return Number(o)/Number(BigInt(1)<<BigInt(53))}nextFloat(){return this._mathFallback?Math.random():this._next(24)/(1<<24)}nextInt(t){if(this._mathFallback)return Math.floor(Math.random()*t);if(t<=0)throw new Error("bound must be positive");if((t&-t)===t){let r=BigInt(this._next(31));return Number(BigInt(t)*r>>BigInt(31))}let e,o;do e=this._next(31),o=e%t;while((e-o+(t-1)|0)<0);return o}nextBoolean(){return this._mathFallback?Math.random()>=.5:this._next(1)!==0}nextLong(){if(this._mathFallback)return BigInt(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER));let t=BigInt(this._next(32)),e=BigInt(this._next(32));return BigInt.asIntN(64,(t<<BigInt(32))+e)}nextGaussian(){if(this._mathFallback)return KS();if(this._nextGaussianStored!==void 0){let i=this._nextGaussianStored;return this._nextGaussianStored=void 0,i}let t,e,o;do t=2*this.nextDouble()-1,e=2*this.nextDouble()-1,o=t*t+e*e;while(o>=1||o===0);let r=Math.sqrt(-2*Math.log(o)/o);return this._nextGaussianStored=e*r,t*r}};function KS(){let n=0,t=0;for(;n===0;)n=Math.random();for(;t===0;)t=Math.random();return Math.sqrt(-2*Math.log(n))*Math.cos(2*Math.PI*t)}var $s=class n extends de{layout(t,e){if(e.begin("Random Layout",1),t.children.length===0){e.done();return}let o=t.getProperty(qp),r=o!=null&&o!==0?new dr(o):new dr,i=t.getProperty(Jp),s=t.getProperty($p),a=t.getProperty(jp);this._randomizeGraph(t,r,i,s,a),e.done()}_randomizeGraph(t,e,o,r,i){let s=0,a=0,l=0,c=1;for(let T of t.children){for(let C of Ee(T))c++;let N=T.getWidth();a=Math.max(a,N);let I=T.getHeight();l=Math.max(l,I),s+=N*I}let g=t.children.length,h=s+2*r*r*c*g,d=Math.sqrt(h),f=Math.max(d*o,a),E=Math.max(d/o,l);for(let T of t.children){let N=i.getLeft()+e.nextDouble()*(f-T.getWidth()),I=i.getLeft()+e.nextDouble()*(E-T.getHeight());T.setLocation(N,I)}let P=f+i.getHorizontal(),S=E+i.getVertical();for(let T of t.children)for(let N of Ee(T))N.isHierarchical()||this._randomizeEdge(N,e,P,S);P+=i.getLeft()+i.getRight(),S+=i.getTop()+i.getBottom(),Ae(t,P,S,!1,!0)}_randomizeEdge(t,e,o,r){let i=t.sources[0],s=i.getX(),a=i.getY(),l=i.getWidth()/2,c=i.getHeight()/2;i instanceof Ve&&(s+=i.getParent().getX(),s+=i.getParent().getX()),s+=l,a+=c;let g=t.sources[0],h=g.getX(),d=g.getY(),f=g.getWidth()/2,E=g.getHeight()/2;if(g instanceof Ve&&(h+=g.getParent().getX(),h+=g.getParent().getX()),h+=f,d+=E,t.sections.length===0)t.sections.push(new Vr);else if(t.sections.length>1){let ot=t.sections[t.sections.length-1];t.sections.length=0,t.sections.push(ot)}let P=t.sections[0],S=h;h>s+l?S=s+l:h<s-l&&(S=s-l);let T=d;d>a+c?T=a+c:d<a-c&&(T=a-c),S>s-l&&S<s+l&&T>a-c&&T<a+c&&(S=s+l),P.setStartLocation(S,T);let N=s;s>h+f?N=h+f:s<h-f&&(N=h-f);let I=a;a>d+E?I=d+E:a<d-E&&(I=d-E),N>h-f&&N<h+f&&I>d-E&&I<d+E&&(I=d+E),P.setEndLocation(N,I),P.bendPoints.length=0;let C=e.nextInt(n.MAX_BENDS);i===g&&C++;let x=N-S,M=I-T,B=Math.sqrt(x*x+M*M)*n.RAND_FACT,Y=x/(C+1),j=M/(C+1),X=S,tt=T;for(let ot=0;ot<C;ot++){X+=Y,tt+=j;let Lt=X+e.nextFloat()*B-B/2;Lt<0?Lt=1:Lt>o&&(Lt=o-1);let zt=tt+e.nextFloat()*B-B/2;zt<0?zt=1:zt>r&&(zt=r-1);let be=new Xr;be.set(Lt,zt),P.bendPoints.push(be)}}};$s.MAX_BENDS=5;$s.RAND_FACT=.2;var ZS=[{id:"org.eclipse.elk.fixed",name:"ELK Fixed",description:"Keeps the current layout as it is, without any automatic modification. Optional coordinates can be given for nodes and edge bend points.",providerFactory:()=>new Yl},{id:"org.eclipse.elk.box",name:"ELK Box",description:"Algorithm for packing of unconnected boxes, i.e. graphs without edges.",providerFactory:()=>new rs},{id:"org.eclipse.elk.random",name:"ELK Randomizer",description:'Distributes the nodes randomly on the plane, leading to very obfuscating layouts. Can be useful to demonstrate the power of "real" layout algorithms.',providerFactory:()=>new $s}],jS=!1;function eE(){let n=Ht.getInstance(),t=[];for(let e of ZS){let o=n.getAlgorithmData(e.id);if(o){t.push(o);continue}let r=new Se.Builder().id(e.id).name(e.name).description(e.description).definingBundleId("org.eclipse.elk.core").providerFactory(e.providerFactory).supportedFeatures(new Set).create();n.registerLayoutMetaDataProviders({apply(i){i.register(r)}}),t.push(r)}return jS=!0,t}var Da=class{constructor(t){this._includeLabels=!0,this._includePorts=!0,this._includePortLabels=!0,this._includeEdgeHeadTailLabels=!0,this._adapter=t}excludeLabels(){return this._includeLabels=!1,this}excludePorts(){return this._includePorts=!1,this}excludePortLabels(){return this._includePortLabels=!1,this}excludeEdgeHeadTailLabels(){return this._includeEdgeHeadTailLabels=!1,this}process(){let t=this._adapter.getProperty(Zs);for(let e of this._adapter.getNodes())this._processNode(e,t)}processNode(t){let e=this._adapter.getProperty(Zs);this._processNode(t,e)}_processNode(t,e){let o=new dt(t.getPosition().x,t.getPosition().y,t.getSize().x,t.getSize().y),r=new dt;if(this._includeLabels)for(let s of t.getLabels())r.x=s.getPosition().x+t.getPosition().x,r.y=s.getPosition().y+t.getPosition().y,r.width=s.getSize().x,r.height=s.getSize().y,o.union(r);for(let s of t.getPorts()){let a=s.getPosition().x+t.getPosition().x,l=s.getPosition().y+t.getPosition().y;if(this._includePorts&&(r.x=a,r.y=l,r.width=s.getSize().x,r.height=s.getSize().y,o.union(r)),this._includePortLabels)for(let c of s.getLabels())r.x=c.getPosition().x+a,r.y=c.getPosition().y+l,r.width=c.getSize().x,r.height=c.getSize().y,o.union(r);if(this._includeEdgeHeadTailLabels){let c=new O(-e,-e);if(t.getProperty(Ir).has(it.OUTSIDE))for(let g of s.getLabels())c.x+=g.getSize().x+e,c.y+=g.getSize().y+e;c.x=Math.max(c.x,0),c.y=Math.max(c.y,0),this._processEdgeHeadTailLabels(o,s.getOutgoingEdges(),s.getIncomingEdges(),t,s,c,e)}}this._includeEdgeHeadTailLabels&&this._processEdgeHeadTailLabels(o,t.getOutgoingEdges(),t.getIncomingEdges(),t,null,null,e);let i=new me(t.getMargin());i.top=Math.max(0,t.getPosition().y-o.y),i.bottom=Math.max(0,o.y+o.height-(t.getPosition().y+t.getSize().y)),i.left=Math.max(0,t.getPosition().x-o.x),i.right=Math.max(0,o.x+o.width-(t.getPosition().x+t.getSize().x)),t.setMargin(i)}_processEdgeHeadTailLabels(t,e,o,r,i,s,a){let l=new dt;for(let c of e)for(let g of c.getLabels())g.getProperty(Aa)===St.TAIL&&(this._computeLabelBox(l,g,!1,r,i,s,a),t.union(l));for(let c of o)for(let g of c.getLabels())g.getProperty(Aa)===St.HEAD&&(this._computeLabelBox(l,g,!0,r,i,s,a),t.union(l))}_computeLabelBox(t,e,o,r,i,s,a){if(t.x=r.getPosition().x,t.y=r.getPosition().y,i!=null&&(t.x+=i.getPosition().x,t.y+=i.getPosition().y),t.width=e.getSize().x,t.height=e.getSize().y,i==null)o?t.x-=a+e.getSize().x:t.x+=r.getSize().x+a;else switch(i.getSide()){case u.UNDEFINED:case u.EAST:t.x+=i.getSize().x+a+s.x+a;break;case u.WEST:t.x-=a+s.x+a+e.getSize().x;break;case u.NORTH:t.x+=i.getSize().x+a,t.y-=a+s.y+a+e.getSize().y;break;case u.SOUTH:t.x+=i.getSize().x+a,t.y+=i.getSize().y+a+s.y+a;break}}};var G=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};G.BEGIN=new G("BEGIN");G.CENTER=new G("CENTER");G.END=new G("END");var Si=class{constructor(){this._padding=new yt,this._cellRectangle=new dt,this._contributesToMinimumWidth=!1,this._contributesToMinimumHeight=!1}getPadding(){return this._padding}getCellRectangle(){return this._cellRectangle}isContributingToMinimumWidth(){return this._contributesToMinimumWidth}setContributesToMinimumWidth(t){this._contributesToMinimumWidth=t}isContributingToMinimumHeight(){return this._contributesToMinimumHeight}setContributesToMinimumHeight(t){this._contributesToMinimumHeight=t}getMinimumWidth(){throw new Error("getMinimumWidth() must be implemented by subclass")}getMinimumHeight(){throw new Error("getMinimumHeight() must be implemented by subclass")}};var ds=class extends Si{constructor(){super(),this._minimumContentAreaSize=new O}getMinimumContentAreaSize(){return this._minimumContentAreaSize}setMinimumContentAreaSize(t,e){if(e){let o=this.getPadding();this._minimumContentAreaSize.x=t.x-o.left-o.right,this._minimumContentAreaSize.y=t.y-o.top-o.bottom}else this._minimumContentAreaSize.set(t)}getMinimumWidth(){let t=this.getPadding();return this._minimumContentAreaSize.x+t.left+t.right}getMinimumHeight(){let t=this.getPadding();return this._minimumContentAreaSize.y+t.top+t.bottom}};var Ze=class extends Si{layoutChildrenHorizontally(){throw new Error("layoutChildrenHorizontally() must be implemented by subclass")}layoutChildrenVertically(){throw new Error("layoutChildrenVertically() must be implemented by subclass")}static minWidthOfCell(t,e){return t==null||e&&!t.isContributingToMinimumWidth()||t instanceof ds&&t.getMinimumContentAreaSize().x===0?0:t.getMinimumWidth()}static minHeightOfCell(t,e){return t==null||e&&!t.isContributingToMinimumHeight()||t instanceof ds&&t.getMinimumContentAreaSize().y===0?0:t.getMinimumHeight()}applyHorizontalLayout(t,e,o){if(t!=null){let r=t.getCellRectangle();r.x=e,r.width=o}}applyVerticalLayout(t,e,o){if(t!=null){let r=t.getCellRectangle();r.y=e,r.height=o}}};var ve=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};ve.VERTICAL=new ve("VERTICAL");ve.HORIZONTAL=new ve("HORIZONTAL");var oE=new Map([[G.BEGIN,0],[G.CENTER,1],[G.END,2]]),Rr=class extends Ze{constructor(t,e,o){super(),this._containerMode=t,this._symmetrical=e,this._gap=o,this._cells=[null,null,null]}getContainerMode(){return this._containerMode}getGap(){return this._gap}getCell(t){return this._cells[oE.get(t)]}setCell(t,e){this._cells[oE.get(t)]=e}getMinimumWidth(){let t=0,e=this.getPadding();if(this._containerMode===ve.VERTICAL)for(let o of this._cells)o!=null&&o.isContributingToMinimumWidth()&&(t=Math.max(t,o.getMinimumWidth()));else{let o=this._minCellWidths(!0),r=0;for(let i of o)i>0&&(t+=i,r++);r>1&&(t+=this._gap*(r-1))}return t>0?t+e.left+e.right:0}getMinimumHeight(){let t=0,e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=this._minCellHeights(!0),r=0;for(let i of o)i>0&&(t+=i,r++);r>1&&(t+=this._gap*(r-1))}else for(let o of this._cells)o!=null&&o.isContributingToMinimumHeight()&&(t=Math.max(t,o.getMinimumHeight()));return t>0?t+e.top+e.bottom:0}layoutChildrenHorizontally(){let t=this.getCellRectangle(),e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=t.x+e.left,r=t.width-e.left-e.right;for(let i of this._cells)this.applyHorizontalLayout(i,o,r)}else{let o=this._minCellWidths(!1);this.applyHorizontalLayout(this._cells[0],t.x+e.left,o[0]),this.applyHorizontalLayout(this._cells[2],t.x+t.width-e.right-o[2],o[2]);let r=t.width-e.left-e.right;o[0]>0&&(r-=o[0]+this._gap,o[0]+=this._gap),o[2]>0&&(r-=o[2]+this._gap),o[1]=Math.max(o[1],r),this.applyHorizontalLayout(this._cells[1],t.x+e.left+o[0]-(o[1]-r)/2,o[1])}for(let o of this._cells)o instanceof Ze&&o.layoutChildrenHorizontally()}layoutChildrenVertically(){let t=this.getCellRectangle(),e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=this._minCellHeights(!1);this.applyVerticalLayout(this._cells[0],t.y+e.top,o[0]),this.applyVerticalLayout(this._cells[2],t.y+t.height-e.bottom-o[2],o[2]);let i=t.height-e.top-e.bottom;o[0]>0&&(o[0]+=this._gap,i-=o[0]),o[2]>0&&(i-=o[2]+this._gap),o[1]=Math.max(o[1],i),this.applyVerticalLayout(this._cells[1],t.y+e.top+o[0]-(o[1]-i)/2,o[1])}else{let o=t.y+e.top,r=t.height-e.top-e.bottom;for(let i of this._cells)this.applyVerticalLayout(i,o,r)}for(let o of this._cells)o instanceof Ze&&o.layoutChildrenVertically()}_minCellWidths(t){let e=[Ze.minWidthOfCell(this._cells[0],t),Ze.minWidthOfCell(this._cells[1],t),Ze.minWidthOfCell(this._cells[2],t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}_minCellHeights(t){let e=[Ze.minHeightOfCell(this._cells[0],t),Ze.minHeightOfCell(this._cells[1],t),Ze.minHeightOfCell(this._cells[2],t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}};var bo=class n extends ge{constructor(t){if(super(),t){let e=t.getAllProperties(),o=this.getAllProperties();for(let[r,i]of e)o.set(r,i)}}static getIndividualOrInherited(t,e){let o=null;if(t.hasProperty(as)){let r=t.getProperty(as);r&&r.hasProperty(e)&&(o=r.getProperty(e))}if(o==null)if(typeof t.getGraph=="function"){let r=t.getGraph();r!=null&&(o=r.getProperty(e)),o==null&&typeof e.getDefault=="function"&&(o=e.getDefault())}else{let r=typeof t.getParent=="function"?t.getParent():t.parent;r!=null&&(o=r.getProperty(e))}return o}toString(){let t=[];for(let[e,o]of this.getAllProperties())t.push(`${e.getId()}:${o}`);return t.join(n.SERIALIZED_OPTION_SEPARATOR)}parse(t){if(!(t==null||t===""))try{let e=t.split(n.SERIALIZED_OPTION_SEPARATOR);for(let o of e){let r=o.indexOf(":");if(r<0)throw new Error(`Invalid option format: ${o}`);let i=o.substring(0,r),s=o.substring(r+1),a=Ht.getInstance().getOptionDataBySuffix(i);if(a==null)throw new Error(`Invalid option id: ${i}`);let l=a.parseValue(s);if(l==null)throw new Error(`Invalid option value: ${s}`);this.setProperty(a,l)}}catch(e){throw new Error("The given string does not match the expected format for individual spacings: "+(e&&e.message?e.message:String(e)))}}};bo.SERIALIZED_OPTION_SEPARATOR=";,;";var Du=class{constructor(t,e){this._sideComparator=t,this._valueComparator=e,this._byKey=new Map}put(t,e){let o=this._byKey.get(t);o==null&&(o=[],this._byKey.set(t,o)),o.push(e),o.sort(this._valueComparator)}get(t){var e;return(e=this._byKey.get(t))!=null?e:[]}containsKey(t){return this._byKey.has(t)}values(){let t=[...this._byKey.keys()].sort(this._sideComparator),e=[];for(let o of t)for(let r of this._byKey.get(o))e.push(r);return e}get size(){let t=0;for(let e of this._byKey.values())t+=e.length;return t}},qs=class n{constructor(t,e){if(this.node=e,this.nodeSize=new O(e.getSize()),this.topdownLayout=e.getProperty(js),this.treatAsCompoundNode=e.isCompoundNode()||e.getProperty(ls),this.sizeConstraints=e.getProperty(Mo),this.sizeOptions=e.getProperty(Oo),this.portConstraints=e.getProperty(cr),this.portLabelsPlacement=e.getProperty(Ir),!it.isValid(this.portLabelsPlacement))throw new Error(`Invalid port label placement: ${[...this.portLabelsPlacement]}`);if(this.portLabelsTreatAsGroup=e.getProperty(Su),this.nodeLabelPlacement=k.ensureSet(e.getProperty(Kr)),!k.isValid(this.nodeLabelPlacement))throw new Error(`Invalid node label placement: ${[...this.nodeLabelPlacement]}`);this.nodeLabelsPadding=bo.getIndividualOrInherited(e,pu),this.nodeLabelSpacing=bo.getIndividualOrInherited(e,Zs),this.labelLabelSpacing=bo.getIndividualOrInherited(e,hu),this.portPortSpacing=bo.getIndividualOrInherited(e,uu),this.portLabelSpacingHorizontal=bo.getIndividualOrInherited(e,du),this.portLabelSpacingVertical=bo.getIndividualOrInherited(e,fu),this.surroundingPortMargins=bo.getIndividualOrInherited(e,_u),this.labelCellSpacing=2*this.labelLabelSpacing;let o=!this.sizeOptions.has(Nt.ASYMMETRICAL);this.nodeContainer=new Rr(ve.VERTICAL,o,0),this.nodeContainerMiddleRow=new Rr(ve.HORIZONTAL,o,0),this.nodeContainer.setCell(G.CENTER,this.nodeContainerMiddleRow),this.portContexts=new Du(n.comparePortSides,n.comparePortContexts),this.insideNodeLabelContainer=null,this.insidePortLabelCells=new Map,this.outsideNodeLabelContainers=new Map,this.nodeLabelCells=new Map}applyNodeSize(){this.node.setSize(this.nodeSize)}getPortAlignment(t){let e=null,o=this.node;switch(t){case u.NORTH:o.hasProperty(xl)&&(e=o.getProperty(xl));break;case u.SOUTH:o.hasProperty(Dl)&&(e=o.getProperty(Dl));break;case u.EAST:o.hasProperty(Ml)&&(e=o.getProperty(Ml));break;case u.WEST:o.hasProperty(wl)&&(e=o.getProperty(wl));break}return e==null&&(e=o.getProperty(Eu)),e}static comparePortSides(t,e){return n._PORT_SIDE_ORDINAL.get(t)-n._PORT_SIDE_ORDINAL.get(e)}static comparePortContexts(t,e){let o=n.comparePortSides(t.port.getSide(),e.port.getSide());if(o!==0)return o;switch(t.port.getSide()){case u.NORTH:case u.EAST:return t.port.getVolatileId()-e.port.getVolatileId();case u.SOUTH:case u.WEST:return e.port.getVolatileId()-t.port.getVolatileId();default:return 0}}};qs._PORT_SIDE_ORDINAL=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);var lt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};lt.LEFT=new lt("LEFT");lt.CENTER=new lt("CENTER");lt.RIGHT=new lt("RIGHT");var nt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};nt.TOP=new nt("TOP");nt.CENTER=new nt("CENTER");nt.BOTTOM=new nt("BOTTOM");function $S(n,t){if(n===t)return!0;if(!(n instanceof Set)||!(t instanceof Set)||n.size!==t.size)return!1;for(let e of n)if(!t.has(e))return!1;return!0}var Q=class n{constructor(t,e,o,r,i,s){this.name=t,this._horizontalAlignment=e,this._verticalAlignment=o,this._containerRow=r,this._containerColumn=i,this._assignedPlacements=s,Object.freeze(this)}getHorizontalAlignment(){return this._horizontalAlignment}getVerticalAlignment(){return this._verticalAlignment}getContainerRow(){return this._containerRow}getContainerColumn(){return this._containerColumn}static fromNodeLabelPlacement(t){for(let e of n.values())for(let o of e._assignedPlacements)if($S(o,t))return e;return n.UNDEFINED}static values(){return n._VALUES}isInsideLocation(){switch(this){case n.IN_T_L:case n.IN_T_C:case n.IN_T_R:case n.IN_C_L:case n.IN_C_C:case n.IN_C_R:case n.IN_B_L:case n.IN_B_C:case n.IN_B_R:return!0;default:return!1}}getOutsideSide(){switch(this){case n.OUT_T_L:case n.OUT_T_C:case n.OUT_T_R:return u.NORTH;case n.OUT_B_L:case n.OUT_B_C:case n.OUT_B_R:return u.SOUTH;case n.OUT_L_T:case n.OUT_L_C:case n.OUT_L_B:return u.WEST;case n.OUT_R_T:case n.OUT_R_C:case n.OUT_R_B:return u.EAST;default:return u.UNDEFINED}}toString(){return this.name}},b=k,vt=(...n)=>new Set(n);Q.OUT_T_L=new Q("OUT_T_L",lt.LEFT,nt.BOTTOM,G.BEGIN,G.BEGIN,[vt(b.OUTSIDE,b.V_TOP,b.H_LEFT)]);Q.OUT_T_C=new Q("OUT_T_C",lt.CENTER,nt.BOTTOM,G.BEGIN,G.CENTER,[vt(b.OUTSIDE,b.V_TOP,b.H_CENTER),vt(b.OUTSIDE,b.V_TOP,b.H_CENTER,b.H_PRIORITY)]);Q.OUT_T_R=new Q("OUT_T_R",lt.RIGHT,nt.BOTTOM,G.BEGIN,G.END,[vt(b.OUTSIDE,b.V_TOP,b.H_RIGHT)]);Q.OUT_B_L=new Q("OUT_B_L",lt.LEFT,nt.TOP,G.END,G.BEGIN,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_LEFT)]);Q.OUT_B_C=new Q("OUT_B_C",lt.CENTER,nt.TOP,G.END,G.CENTER,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_CENTER),vt(b.OUTSIDE,b.V_BOTTOM,b.H_CENTER,b.H_PRIORITY)]);Q.OUT_B_R=new Q("OUT_B_R",lt.RIGHT,nt.TOP,G.END,G.END,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_RIGHT)]);Q.OUT_L_T=new Q("OUT_L_T",lt.RIGHT,nt.TOP,G.BEGIN,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_TOP,b.H_PRIORITY)]);Q.OUT_L_C=new Q("OUT_L_C",lt.RIGHT,nt.CENTER,G.CENTER,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_CENTER),vt(b.OUTSIDE,b.H_LEFT,b.V_CENTER,b.H_PRIORITY)]);Q.OUT_L_B=new Q("OUT_L_B",lt.RIGHT,nt.BOTTOM,G.END,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_BOTTOM,b.H_PRIORITY)]);Q.OUT_R_T=new Q("OUT_R_T",lt.LEFT,nt.TOP,G.BEGIN,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_TOP,b.H_PRIORITY)]);Q.OUT_R_C=new Q("OUT_R_C",lt.LEFT,nt.CENTER,G.CENTER,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_CENTER),vt(b.OUTSIDE,b.H_RIGHT,b.V_CENTER,b.H_PRIORITY)]);Q.OUT_R_B=new Q("OUT_R_B",lt.LEFT,nt.BOTTOM,G.END,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_BOTTOM,b.H_PRIORITY)]);Q.IN_T_L=new Q("IN_T_L",lt.LEFT,nt.TOP,G.BEGIN,G.BEGIN,[vt(b.INSIDE,b.V_TOP,b.H_LEFT),vt(b.INSIDE,b.V_TOP,b.H_LEFT,b.H_PRIORITY)]);Q.IN_T_C=new Q("IN_T_C",lt.CENTER,nt.TOP,G.BEGIN,G.CENTER,[vt(b.INSIDE,b.V_TOP,b.H_CENTER),vt(b.INSIDE,b.V_TOP,b.H_CENTER,b.H_PRIORITY)]);Q.IN_T_R=new Q("IN_T_R",lt.RIGHT,nt.TOP,G.BEGIN,G.END,[vt(b.INSIDE,b.V_TOP,b.H_RIGHT),vt(b.INSIDE,b.V_TOP,b.H_RIGHT,b.H_PRIORITY)]);Q.IN_C_L=new Q("IN_C_L",lt.LEFT,nt.CENTER,G.CENTER,G.BEGIN,[vt(b.INSIDE,b.V_CENTER,b.H_LEFT),vt(b.INSIDE,b.V_CENTER,b.H_LEFT,b.H_PRIORITY)]);Q.IN_C_C=new Q("IN_C_C",lt.CENTER,nt.CENTER,G.CENTER,G.CENTER,[vt(b.INSIDE,b.V_CENTER,b.H_CENTER),vt(b.INSIDE,b.V_CENTER,b.H_CENTER,b.H_PRIORITY)]);Q.IN_C_R=new Q("IN_C_R",lt.RIGHT,nt.CENTER,G.CENTER,G.END,[vt(b.INSIDE,b.V_CENTER,b.H_RIGHT),vt(b.INSIDE,b.V_CENTER,b.H_RIGHT,b.H_PRIORITY)]);Q.IN_B_L=new Q("IN_B_L",lt.LEFT,nt.BOTTOM,G.END,G.BEGIN,[vt(b.INSIDE,b.V_BOTTOM,b.H_LEFT),vt(b.INSIDE,b.V_BOTTOM,b.H_LEFT,b.H_PRIORITY)]);Q.IN_B_C=new Q("IN_B_C",lt.CENTER,nt.BOTTOM,G.END,G.CENTER,[vt(b.INSIDE,b.V_BOTTOM,b.H_CENTER),vt(b.INSIDE,b.V_BOTTOM,b.H_CENTER,b.H_PRIORITY)]);Q.IN_B_R=new Q("IN_B_R",lt.RIGHT,nt.BOTTOM,G.END,G.END,[vt(b.INSIDE,b.V_BOTTOM,b.H_RIGHT),vt(b.INSIDE,b.V_BOTTOM,b.H_RIGHT,b.H_PRIORITY)]);Q.UNDEFINED=new Q("UNDEFINED",null,null,null,null,[]);Q._VALUES=[Q.OUT_T_L,Q.OUT_T_C,Q.OUT_T_R,Q.OUT_B_L,Q.OUT_B_C,Q.OUT_B_R,Q.OUT_L_T,Q.OUT_L_C,Q.OUT_L_B,Q.OUT_R_T,Q.OUT_R_C,Q.OUT_R_B,Q.IN_T_L,Q.IN_T_C,Q.IN_T_R,Q.IN_C_L,Q.IN_C_C,Q.IN_C_R,Q.IN_B_L,Q.IN_B_C,Q.IN_B_R,Q.UNDEFINED];var wa=class{static configureCellSystemSizeContributions(t){if(t.sizeConstraints.size!==0){if(t.sizeConstraints.has(mt.PORTS)){t.insidePortLabelCells.get(u.NORTH).setContributesToMinimumWidth(!0),t.insidePortLabelCells.get(u.SOUTH).setContributesToMinimumWidth(!0);let e=t.portConstraints!==H.FIXED_RATIO&&t.portConstraints!==H.FIXED_POS;t.insidePortLabelCells.get(u.EAST).setContributesToMinimumHeight(e),t.insidePortLabelCells.get(u.WEST).setContributesToMinimumHeight(e),t.nodeContainerMiddleRow.setContributesToMinimumHeight(e),t.sizeConstraints.has(mt.PORT_LABELS)&&(t.insidePortLabelCells.get(u.NORTH).setContributesToMinimumHeight(!0),t.insidePortLabelCells.get(u.SOUTH).setContributesToMinimumHeight(!0),t.insidePortLabelCells.get(u.EAST).setContributesToMinimumWidth(!0),t.insidePortLabelCells.get(u.WEST).setContributesToMinimumWidth(!0),t.nodeContainerMiddleRow.setContributesToMinimumWidth(!0))}if(t.sizeConstraints.has(mt.NODE_LABELS)){t.insideNodeLabelContainer.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.setContributesToMinimumWidth(!0),t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.nodeContainerMiddleRow.setContributesToMinimumWidth(!0);let e=t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG);for(let o of Q.values()){let r=t.nodeLabelCells.get(o);r!=null&&(o.isInsideLocation()?(r.setContributesToMinimumHeight(!0),r.setContributesToMinimumWidth(!0)):(r.setContributesToMinimumHeight(!e),r.setContributesToMinimumWidth(!e)))}}t.sizeConstraints.has(mt.MINIMUM_SIZE)&&t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)&&(t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.isContributingToMinimumHeight()||(t.insideNodeLabelContainer.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.setContributesToMinimumWidth(!0),t.insideNodeLabelContainer.setOnlyCenterCellContributesToMinimumSize(!0)))}}static updateVerticalInsidePortLabelCellPadding(t){if(t.portConstraints===H.FIXED_RATIO||t.portConstraints===H.FIXED_POS)return;let e=t.nodeContainer.getPadding().top+t.insidePortLabelCells.get(u.NORTH).getMinimumHeight()+t.labelCellSpacing,o=t.nodeContainer.getPadding().bottom+t.insidePortLabelCells.get(u.SOUTH).getMinimumHeight()+t.labelCellSpacing,r=t.insidePortLabelCells.get(u.EAST),i=t.insidePortLabelCells.get(u.WEST),s=Math.max(0,r.getPadding().top-e);s=Math.max(s,i.getPadding().top-e);let a=Math.max(0,r.getPadding().bottom-o);a=Math.max(a,i.getPadding().bottom-o),r.getPadding().top=s,i.getPadding().top=s,r.getPadding().bottom=a,i.getPadding().bottom=a}};var Lr=class n{static placeHorizontalPorts(t){switch(t.portConstraints){case H.FIXED_POS:n._placeHorizontalFixedPosPorts(t,u.NORTH),n._placeHorizontalFixedPosPorts(t,u.SOUTH);break;case H.FIXED_RATIO:n._placeHorizontalFixedRatioPorts(t,u.NORTH),n._placeHorizontalFixedRatioPorts(t,u.SOUTH);break;default:n._placeHorizontalFreePorts(t,u.NORTH),n._placeHorizontalFreePorts(t,u.SOUTH);break}}static _placeHorizontalFixedPosPorts(t,e){for(let o of t.portContexts.get(e))o.portPosition.y=n._calculateHorizontalPortYCoordinate(o)}static _placeHorizontalFixedRatioPorts(t,e){let o=t.nodeSize.x;for(let r of t.portContexts.get(e))r.portPosition.x=o*r.port.getProperty(n.PORT_RATIO_OR_POSITION),r.portPosition.y=n._calculateHorizontalPortYCoordinate(r)}static _placeHorizontalFreePorts(t,e){let o=t.portContexts.get(e);if(o.length===0)return;let r=t.insidePortLabelCells.get(e),i=r.getCellRectangle(),s=r.getPadding(),a=t.getPortAlignment(e),l=i.width-s.left-s.right,c=r.getMinimumContentAreaSize().x,g=i.x+s.left,h=t.portPortSpacing;if((a===qt.DISTRIBUTED||a===qt.JUSTIFIED)&&o.length===1&&(c=n._modifiedPortPlacementSize(t,a,c),a=qt.CENTER),l<c&&!t.sizeOptions.has(Nt.PORTS_OVERHANG))a===qt.DISTRIBUTED?(h+=(l-c)/(o.length+1),g+=h):h+=(l-c)/(o.length-1);else switch(l<c&&(c=n._modifiedPortPlacementSize(t,a,c),a=qt.CENTER),a){case qt.BEGIN:break;case qt.CENTER:g+=(l-c)/2;break;case qt.END:g+=l-c;break;case qt.DISTRIBUTED:{let d=(l-c)/(o.length+1);h+=Math.max(0,d),g+=h;break}case qt.JUSTIFIED:{let d=(l-c)/(o.length-1);h+=Math.max(0,d);break}}for(let d of o)d.portPosition.x=g+d.portMargin.left,d.portPosition.y=n._calculateHorizontalPortYCoordinate(d),g+=d.portMargin.left+d.port.getSize().x+d.portMargin.right+h}static _calculateHorizontalPortYCoordinate(t){let e=t.port;return e.hasProperty(Ke)?e.getSide()===u.NORTH?-e.getSize().y-e.getProperty(Ke):e.getProperty(Ke):e.getSide()===u.NORTH?-e.getSize().y:0}static placeVerticalPorts(t){switch(t.portConstraints){case H.FIXED_POS:n._placeVerticalFixedPosPorts(t,u.EAST),n._placeVerticalFixedPosPorts(t,u.WEST);break;case H.FIXED_RATIO:n._placeVerticalFixedRatioPorts(t,u.EAST),n._placeVerticalFixedRatioPorts(t,u.WEST);break;default:n._placeVerticalFreePorts(t,u.EAST),n._placeVerticalFreePorts(t,u.WEST);break}}static _placeVerticalFixedPosPorts(t,e){let o=t.nodeSize.x;for(let r of t.portContexts.get(e))r.portPosition.x=n._calculateVerticalPortXCoordinate(r,o)}static _placeVerticalFixedRatioPorts(t,e){let o=t.nodeSize;for(let r of t.portContexts.get(e))r.portPosition.x=n._calculateVerticalPortXCoordinate(r,o.x),r.portPosition.y=o.y*r.port.getProperty(n.PORT_RATIO_OR_POSITION)}static _placeVerticalFreePorts(t,e){let o=t.portContexts.get(e);if(o.length===0)return;let r=t.insidePortLabelCells.get(e),i=r.getCellRectangle(),s=r.getPadding(),a=t.getPortAlignment(e),l=i.height-s.top-s.bottom,c=r.getMinimumContentAreaSize().y,g=i.y+s.top,h=t.portPortSpacing,d=t.nodeSize.x;if((a===qt.DISTRIBUTED||a===qt.JUSTIFIED)&&o.length===1&&(c=n._modifiedPortPlacementSize(t,a,c),a=qt.CENTER),l<c&&!t.sizeOptions.has(Nt.PORTS_OVERHANG))a===qt.DISTRIBUTED?(h+=(l-c)/(o.length+1),g+=h):h+=(l-c)/(o.length-1);else switch(l<c&&(c=n._modifiedPortPlacementSize(t,a,c),a=qt.CENTER),a){case qt.BEGIN:break;case qt.CENTER:g+=(l-c)/2;break;case qt.END:g+=l-c;break;case qt.DISTRIBUTED:{let f=(l-c)/(o.length+1);h+=Math.max(0,f),g+=h;break}case qt.JUSTIFIED:{let f=(l-c)/(o.length-1);h+=Math.max(0,f);break}}for(let f of o)f.portPosition.x=n._calculateVerticalPortXCoordinate(f,d),f.portPosition.y=g+f.portMargin.top,g+=f.portMargin.top+f.port.getSize().y+f.portMargin.bottom+h}static _calculateVerticalPortXCoordinate(t,e){let o=t.port;return o.hasProperty(Ke)?o.getSide()===u.WEST?-o.getSize().x-o.getProperty(Ke):e+o.getProperty(Ke):o.getSide()===u.WEST?-o.getSize().x:e}static _modifiedPortPlacementSize(t,e,o){return e===qt.DISTRIBUTED?o-2*t.portPortSpacing:o}};Lr.PORT_RATIO_OR_POSITION=new m("portRatioOrPosition",0);var qS=.01;function JS(n,t,e){return Math.abs(n-t)<e}var Ti=class n{static calculateHorizontalPortPlacementSize(t){switch(t.portConstraints){case H.FIXED_POS:n._calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,u.SOUTH);break;case H.FIXED_RATIO:n._calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,u.SOUTH);break;default:n._calculateHorizontalNodeSizeRequiredByFreePorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFreePorts(t,u.SOUTH);break}}static _calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,e){let o=0;for(let i of t.portContexts.get(e))o=Math.max(o,i.portPosition.x+i.port.getSize().x);let r=t.insidePortLabelCells.get(e);r.getPadding().left=0,r.getMinimumContentAreaSize().x=o}static _calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,e){let o=t.insidePortLabelCells.get(e),r=t.portContexts.get(e);if(r.length===0){o.getPadding().left=0,o.getPadding().right=0;return}let i=t.portLabelsPlacement.has(it.INSIDE),s=0,a=null,l=0,c=0;for(let g of r){let h=g.port.getProperty(Lr.PORT_RATIO_OR_POSITION),d=g.port.getSize().x;if(t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e),a==null)t.surroundingPortMargins!=null&&t.surroundingPortMargins.left>0&&(s=Math.max(s,n.minSizeRequiredToRespectSpacing(t.surroundingPortMargins.left+g.portMargin.left,0,h)));else{let f=c+a.portMargin.right+t.portPortSpacing+g.portMargin.left;s=Math.max(s,n.minSizeRequiredToRespectSpacing(f,l,h))}a=g,l=h,c=d}if(t.surroundingPortMargins!=null&&t.surroundingPortMargins.right>0){let g=c+t.surroundingPortMargins.right;i&&(g+=a.portMargin.right),s=Math.max(s,n.minSizeRequiredToRespectSpacing(g,l,1))}o.getPadding().left=0,o.getMinimumContentAreaSize().x=s}static minSizeRequiredToRespectSpacing(t,e,o){return JS(e,o,qS)?0:t/(o-e)}static _calculateHorizontalNodeSizeRequiredByFreePorts(t,e){let o=t.insidePortLabelCells.get(e);if(t.portContexts.get(e).length===0){o.getPadding().left=0,o.getPadding().right=0;return}o.getPadding().left=t.surroundingPortMargins.left,o.getPadding().right=t.surroundingPortMargins.right,t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let r=n._portWidthPlusPortPortSpacing(t,e);t.getPortAlignment(e)===qt.DISTRIBUTED&&(r+=2*t.portPortSpacing),o.getMinimumContentAreaSize().x=r}static _setupPortMargins(t,e){let o=t.portContexts.get(e),r=t.portLabelsPlacement.has(it.OUTSIDE),i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE),a=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),l=t.sizeOptions.has(Nt.UNIFORM_PORT_SPACING),c=!i&&!s&&(a||o.length===2);n._computeHorizontalPortMargins(t,e,r);let g=null,h=null;r&&o.length>0&&(g=o[0],h=o[o.length-1],g.portMargin.left=0,h.portMargin.right=0,c&&!g.labelsNextToPort&&(g.portMargin.right=0)),l&&(n._unifyPortMargins(o),r&&g!=null&&(g.portMargin.left=0,h.portMargin.right=0))}static _computeHorizontalPortMargins(t,e,o){for(let r of t.portContexts.get(e)){let i=r.portLabelCell!=null?r.portLabelCell.getMinimumWidth():0;if(i>0)if(r.labelsNextToPort){let s=r.port.getSize().x;if(i>s){let a=(i-s)/2;r.portMargin.left=a,r.portMargin.right=a}}else r.portMargin.right=t.portLabelSpacingHorizontal+i;else if(it.isFixed(t.portLabelsPlacement)){let s=Ia(r.port);s.x<0&&(r.portMargin.left=-s.x),s.x+s.width>r.port.getSize().x&&(r.portMargin.right=s.x+s.width-r.port.getSize().x)}}}static _unifyPortMargins(t){let e=0,o=0;for(let r of t)e=Math.max(e,r.portMargin.left),o=Math.max(o,r.portMargin.right);for(let r of t)r.portMargin.left=e,r.portMargin.right=o}static _portWidthPlusPortPortSpacing(t,e){let o=0,r=t.portContexts.get(e);for(let i=0;i<r.length;i++){let s=r[i];o+=s.portMargin.left+s.port.getSize().x+s.portMargin.right,i<r.length-1&&(o+=t.portPortSpacing)}return o}};var Vl=class n{static createInsidePortLabelCells(t){n._createInsidePortLabelCell(t,t.nodeContainer,G.BEGIN,u.NORTH),n._createInsidePortLabelCell(t,t.nodeContainer,G.END,u.SOUTH),n._createInsidePortLabelCell(t,t.nodeContainerMiddleRow,G.BEGIN,u.WEST),n._createInsidePortLabelCell(t,t.nodeContainerMiddleRow,G.END,u.EAST),n._setupNorthOrSouthPortLabelCell(t,u.NORTH),n._setupNorthOrSouthPortLabelCell(t,u.SOUTH),n._setupEastOrWestPortLabelCell(t,u.EAST),n._setupEastOrWestPortLabelCell(t,u.WEST)}static _createInsidePortLabelCell(t,e,o,r){let i=new ds;e.setCell(o,i),t.insidePortLabelCells.set(r,i)}static _setupNorthOrSouthPortLabelCell(t,e){let o=t.insidePortLabelCells.get(e).getPadding();switch(e){case u.NORTH:t.portLabelSpacingVertical>=0&&(o.top=t.portLabelSpacingVertical);break;case u.SOUTH:t.portLabelSpacingVertical>=0&&(o.bottom=t.portLabelSpacingVertical);break}t.surroundingPortMargins!=null&&(o.left=t.surroundingPortMargins.left,o.right=t.surroundingPortMargins.right)}static _setupEastOrWestPortLabelCell(t,e){t.portLabelsPlacement.has(it.INSIDE)&&n._calculateWidthDueToLabels(t,e),n._setupTopAndBottomPadding(t,e)}static _calculateWidthDueToLabels(t,e){let o=t.insidePortLabelCells.get(e),r=o.getMinimumContentAreaSize();for(let i of t.portContexts.get(e))i.portLabelCell!=null&&(r.x=Math.max(r.x,i.portLabelCell.getMinimumWidth()));if(r.x>0)switch(e){case u.EAST:o.getPadding().right=t.portLabelSpacingHorizontal;break;case u.WEST:o.getPadding().left=t.portLabelSpacingHorizontal;break}}static _setupTopAndBottomPadding(t,e){if(t.surroundingPortMargins!=null){let o=t.insidePortLabelCells.get(e).getPadding();o.top=t.surroundingPortMargins.top,o.bottom=t.surroundingPortMargins.bottom}}};var Xl=class n{static placeLabels(t){n._placeOuterNodeLabelContainers(t);for(let e of t.nodeLabelCells.values())e.applyLabelLayout();for(let e of t.portContexts.values())e.portLabelCell!=null&&e.portLabelCell.applyLabelLayout()}static _placeOuterNodeLabelContainers(t){let e=t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG);n._placeHorizontalOuterNodeLabelContainer(t,e,u.NORTH),n._placeHorizontalOuterNodeLabelContainer(t,e,u.SOUTH),n._placeVerticalOuterNodeLabelContainer(t,e,u.EAST),n._placeVerticalOuterNodeLabelContainer(t,e,u.WEST)}static _placeHorizontalOuterNodeLabelContainer(t,e,o){let r=t.nodeSize,i=t.outsideNodeLabelContainers.get(o);if(i==null)return;let s=i.getCellRectangle();switch(s.width=i.getMinimumWidth(),s.height=i.getMinimumHeight(),s.width=Math.max(s.width,r.x),s.width>r.x&&!e&&(s.width=r.x),s.x=-(s.width-r.x)/2,o){case u.NORTH:s.y=-s.height;break;case u.SOUTH:s.y=r.y;break}i.layoutChildrenHorizontally(),i.layoutChildrenVertically()}static _placeVerticalOuterNodeLabelContainer(t,e,o){let r=t.nodeSize,i=t.outsideNodeLabelContainers.get(o);if(i==null)return;let s=i.getCellRectangle();switch(s.width=i.getMinimumWidth(),s.height=i.getMinimumHeight(),s.height=Math.max(s.height,r.y),s.height>r.y&&!e&&(s.height=r.y),s.y=-(s.height-r.y)/2,o){case u.WEST:s.x=-s.width;break;case u.EAST:s.x=r.x;break}i.layoutChildrenHorizontally(),i.layoutChildrenVertically()}};var fD=new Set([mt.PORT_LABELS]);function QS(n,t){return n.size===1&&n.has(t)}var fo=class n{static setupMinimumClientAreaSize(t){let e=n.getMinimumClientAreaSize(t);e!=null&&t.insideNodeLabelContainer.setCenterCellMinimumSize(e)}static setupNodePaddingForPortsWithOffset(t){let e=t.nodeContainer.getPadding();for(let o of t.portContexts.values()){let r=0;if(o.port.hasProperty(Ke)&&(r=o.port.getProperty(Ke),r<0))switch(o.port.getSide()){case u.NORTH:e.top=Math.max(e.top,-r);break;case u.SOUTH:e.bottom=Math.max(e.bottom,-r);break;case u.EAST:e.right=Math.max(e.right,-r);break;case u.WEST:e.left=Math.max(e.left,-r);break}if(it.isFixed(t.portLabelsPlacement)){let i=Hp(o.port,r),s=!t.node.getProperty(Oo).has(Nt.ASYMMETRICAL),a=!1;switch(o.port.getSide()){case u.NORTH:a=i>e.top,e.top=Math.max(e.top,i),s&&a&&(e.top=Math.max(e.top,e.bottom),e.bottom=e.top+r);break;case u.SOUTH:a=i>e.bottom,e.bottom=Math.max(e.bottom,i),s&&a&&(e.bottom=Math.max(e.bottom,e.top),e.top=e.bottom+r);break;case u.EAST:a=i>e.right,e.right=Math.max(e.right,i),s&&a&&(e.right=Math.max(e.left,e.right),e.left=e.right+r);break;case u.WEST:a=i>e.left,e.left=Math.max(e.left,i),s&&a&&(e.left=Math.max(e.left,e.right),e.right=e.left+r);break}}}}static offsetSouthernPortsByNodeSize(t){let e=t.nodeSize.y;for(let o of t.portContexts.get(u.SOUTH))o.portPosition.y+=e}static setNodePadding(t){if(!t.sizeOptions.has(Nt.COMPUTE_PADDING))return;let e=t.nodeContainer.getCellRectangle(),o=t.insideNodeLabelContainer.getCenterCellRectangle(),r=new yt;r.left=o.x-e.x,r.top=o.y-e.y,r.right=e.x+e.width-(o.x+o.width),r.bottom=e.y+e.height-(o.y+o.height),t.node.setPadding(r)}static applyStuff(t){t.applyNodeSize();for(let e of t.portContexts.values())e.applyPortPosition()}static getMinimumClientAreaSize(t){return t.sizeConstraints.has(mt.MINIMUM_SIZE)&&t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)?n.getMinimumNodeOrClientAreaSize(t):null}static getMinimumNodeSize(t){return t.sizeConstraints.has(mt.MINIMUM_SIZE)&&!t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)?n.getMinimumNodeOrClientAreaSize(t):null}static getMinimumNodeOrClientAreaSize(t){let e=new O(t.node.getProperty(Yo));return t.sizeOptions.has(Nt.DEFAULT_MINIMUM_SIZE)&&(e.x<=0&&(e.x=es),e.y<=0&&(e.y=os)),e}static areSizeConstraintsFixed(t){return t.sizeConstraints.size===0||QS(t.sizeConstraints,mt.PORT_LABELS)}static isFirstOutsidePortLabelPlacedDifferently(t,e){let o=t.portContexts.get(e);if(o.length>=2){let r=o[0],i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.SPACE_EFFICIENT);return!r.labelsNextToPort&&!i&&(o.length===2||s)}return!1}};var rE=3,iE=3,jr=new Map([[G.BEGIN,0],[G.CENTER,1],[G.END,2]]),Kl=class extends Ze{constructor(t,e,o){super(),this._gap=o,this._tabular=t,this._symmetrical=e,this._cells=[[null,null,null],[null,null,null],[null,null,null]],this._centerCellMinimumSize=null,this._onlyCenterCellContributesToMinimumSize=!1,this._centerCellRect=new dt}getGap(){return this._gap}getCell(t,e){return this._cells[jr.get(t)][jr.get(e)]}setCell(t,e,o){this._cells[jr.get(t)][jr.get(e)]=o}setCenterCellMinimumSize(t){this._centerCellMinimumSize=new O(t)}setOnlyCenterCellContributesToMinimumSize(t){this._onlyCenterCellContributesToMinimumSize=t}getCenterCellRectangle(){return new dt(this._centerCellRect)}getMinimumWidth(){let t=0,e=this.getPadding();if(this._onlyCenterCellContributesToMinimumSize)this._centerCellMinimumSize!=null?t=this._centerCellMinimumSize.x:this._cells[1][1]!=null&&(t=this._cells[1][1].getMinimumWidth());else if(this._tabular)t=this._sumWithGaps(this._minColumnWidths(null,!0));else for(let o of[G.BEGIN,G.CENTER,G.END])t=Math.max(t,this._sumWithGaps(this._minColumnWidths(o,!0)));return t>0?t+e.left+e.right:0}getMinimumHeight(){let t=0,e=this.getPadding();return this._onlyCenterCellContributesToMinimumSize?this._centerCellMinimumSize!=null?t=this._centerCellMinimumSize.y:this._cells[1][1]!=null&&(t=this._cells[1][1].getMinimumHeight()):t=this._sumWithGaps(this._minRowHeights(!0)),t>0?t+e.top+e.bottom:0}layoutChildrenHorizontally(){if(this._tabular){let t=this._minColumnWidths(null,!1);for(let e of[G.BEGIN,G.CENTER,G.END])this._applyWidthsToRow(e,t)}else for(let t of[G.BEGIN,G.CENTER,G.END]){let e=this._minColumnWidths(t,!1);this._applyWidthsToRow(t,e)}}layoutChildrenVertically(){let t=this.getCellRectangle(),e=this.getPadding(),o=this._minRowHeights(!1);this._applyHeightToRow(G.BEGIN,t.y+e.top,o),this._applyHeightToRow(G.END,t.y+t.height-e.bottom-o[2],o);let r=t.height-e.top-e.bottom;o[0]>0&&(o[0]+=this._gap,r-=o[0]),o[2]>0&&(o[2]+=this._gap,r-=o[2]),this._centerCellRect.height=Math.max(0,r),this._centerCellRect.y=t.y+e.top+(this._centerCellRect.height-r)/2,o[1]=Math.max(o[1],r),this._applyHeightToRow(G.CENTER,t.y+e.top+o[0]-(o[1]-r)/2,o)}_minColumnWidths(t,e){let o=[this._minWidthOfColumn(G.BEGIN,t,e),this._minWidthOfColumn(G.CENTER,t,e),this._minWidthOfColumn(G.END,t,e)];return this._symmetrical&&(o[0]=Math.max(o[0],o[2]),o[2]=o[0]),o}_minWidthOfColumn(t,e,o){let r=0,i=jr.get(t);if(e==null)for(let s=0;s<rE;s++)r=Math.max(r,Ze.minWidthOfCell(this._cells[s][i],o));else r=Ze.minWidthOfCell(this._cells[jr.get(e)][i],o);return t===G.CENTER&&this._centerCellMinimumSize!=null&&(r=Math.max(r,this._centerCellMinimumSize.x)),r}_minRowHeights(t){let e=[this._minHeightOfRow(G.BEGIN,t),this._minHeightOfRow(G.CENTER,t),this._minHeightOfRow(G.END,t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}_minHeightOfRow(t,e){let o=0,r=jr.get(t);for(let i=0;i<iE;i++)o=Math.max(o,Ze.minHeightOfCell(this._cells[r][i],e));return t===G.CENTER&&this._centerCellMinimumSize!=null&&(o=Math.max(o,this._centerCellMinimumSize.y)),o}_sumWithGaps(t){let e=0,o=0;for(let r of t)r>0&&(e+=r,o++);return o>1&&(e+=this._gap*(o-1)),e}_applyWidthsToRow(t,e){let o=this.getCellRectangle(),r=this.getPadding();this._applyWidthToColumn(G.BEGIN,o.x+r.left,e),this._applyWidthToColumn(G.END,o.x+o.width-r.right-e[2],e);let i=o.width-r.left-r.right;e[0]>0&&(e[0]+=this._gap,i-=e[0]),e[2]>0&&(e[2]+=this._gap,i-=e[2]);let s=Math.max(0,i);e[1]=Math.max(e[1],i),this._applyWidthToColumn(G.CENTER,o.x+r.left+e[0]-(e[1]-i)/2,e),t===G.CENTER&&(this._centerCellRect.width=s,this._centerCellRect.x=o.x+r.left+(s-i)/2)}_applyWidthToColumn(t,e,o){let r=jr.get(t);for(let i=0;i<rE;i++)this.applyHorizontalLayout(this._cells[i][r],e,o[r])}_applyHeightToRow(t,e,o){let r=jr.get(t);for(let i=0;i<iE;i++)this.applyVerticalLayout(this._cells[r][i],e,o[r])}};var Ni=class extends Si{constructor(t,e,o){super(),this._gap=t;let r=!0,i=lt.CENTER,s=nt.CENTER;e==null||(typeof e=="boolean"?r=e:(i=e.getHorizontalAlignment(),s=e.getVerticalAlignment(),o!=null&&(r=o))),this._horizontalLayoutMode=r,this._horizontalAlignment=i,this._verticalAlignment=s,this._labels=[],this._minimumContentAreaSize=new O}getHorizontalAlignment(){return this._horizontalAlignment}setHorizontalAlignment(t){if(t==null)throw new Error("Horizontal alignment cannot be null");return this._horizontalAlignment=t,this}getVerticalAlignment(){return this._verticalAlignment}setVerticalAlignment(t){if(t==null)throw new Error("Vertical alignment cannot be null");return this._verticalAlignment=t,this}getLabels(){return this._labels}getMinimumWidth(){let t=this.getPadding();return this._minimumContentAreaSize.x+t.left+t.right}getMinimumHeight(){let t=this.getPadding();return this._minimumContentAreaSize.y+t.top+t.bottom}addLabel(t){this._labels.push(t);let e=t.getSize();this._horizontalLayoutMode?(this._minimumContentAreaSize.x=Math.max(this._minimumContentAreaSize.x,e.x),this._minimumContentAreaSize.y+=e.y,this._labels.length>1&&(this._minimumContentAreaSize.y+=this._gap)):(this._minimumContentAreaSize.x+=e.x,this._minimumContentAreaSize.y=Math.max(this._minimumContentAreaSize.y,e.y),this._labels.length>1&&(this._minimumContentAreaSize.x+=this._gap))}hasLabels(){return this._labels.length>0}applyLabelLayout(){this._horizontalLayoutMode?this._applyHorizontalModeLabelLayout():this._applyVerticalModeLabelLayout()}_applyHorizontalModeLabelLayout(){let t=this.getCellRectangle(),e=this.getPadding(),o=t.y;this._verticalAlignment===nt.CENTER?o+=(t.height-this._minimumContentAreaSize.y)/2:this._verticalAlignment===nt.BOTTOM&&(o+=t.height-this._minimumContentAreaSize.y);for(let r of this._labels){let i=r.getSize(),s=new O;switch(s.y=o,o+=i.y+this._gap,this._horizontalAlignment){case lt.LEFT:s.x=t.x+e.left;break;case lt.CENTER:s.x=t.x+e.left+(t.width-i.x)/2;break;case lt.RIGHT:s.x=t.x+t.width-e.right-i.x;break}r.setPosition(s)}}_applyVerticalModeLabelLayout(){let t=this.getCellRectangle(),e=this.getPadding(),o=t.x;this._horizontalAlignment===lt.CENTER?o+=(t.width-this._minimumContentAreaSize.x)/2:this._horizontalAlignment===lt.RIGHT&&(o+=t.width-this._minimumContentAreaSize.x);for(let r of this._labels){let i=r.getSize(),s=new O;switch(s.x=o,o+=i.x+this._gap,this._verticalAlignment){case nt.TOP:s.y=t.y+e.top;break;case nt.CENTER:s.y=t.y+e.top+(t.height-i.y)/2;break;case nt.BOTTOM:s.y=t.y+t.height-e.bottom-i.y;break}r.setPosition(s)}}};var Ma=class n{static createNodeLabelCells(t,e,o){n._createNodeLabelCellContainers(t,e);for(let r of t.node.getLabels())n._handleNodeLabel(t,r,e,o)}static _handleNodeLabel(t,e,o,r){let i=e.hasProperty(Kr)?e.getProperty(Kr):t.nodeLabelPlacement,s=i instanceof Set?i:k.ensureSet(i),a=Q.fromNodeLabelPlacement(s);a!==Q.UNDEFINED&&(o&&!a.isInsideLocation()||n._retrieveNodeLabelCell(t,a,r).addLabel(e))}static _createNodeLabelCellContainers(t,e){let o=!t.sizeOptions.has(Nt.ASYMMETRICAL),r=t.sizeOptions.has(Nt.FORCE_TABULAR_NODE_LABELS);if(t.insideNodeLabelContainer=new Kl(r,o,t.labelCellSpacing),t.nodeLabelsPadding!=null&&t.insideNodeLabelContainer.getPadding().copy(t.nodeLabelsPadding),t.nodeContainerMiddleRow.setCell(G.CENTER,t.insideNodeLabelContainer),!e){let i=new Rr(ve.HORIZONTAL,o,t.labelCellSpacing);i.getPadding().bottom=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.NORTH,i);let s=new Rr(ve.HORIZONTAL,o,t.labelCellSpacing);s.getPadding().top=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.SOUTH,s);let a=new Rr(ve.VERTICAL,o,t.labelCellSpacing);a.getPadding().right=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.WEST,a);let l=new Rr(ve.VERTICAL,o,t.labelCellSpacing);l.getPadding().left=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.EAST,l)}}static _retrieveNodeLabelCell(t,e,o){let r=t.nodeLabelCells.get(e);if(r==null)if(r=new Ni(t.labelLabelSpacing,e,o),t.nodeLabelCells.set(e,r),e.isInsideLocation())t.insideNodeLabelContainer.setCell(e.getContainerRow(),e.getContainerColumn(),r);else{let i=e.getOutsideSide(),s=t.outsideNodeLabelContainers.get(i);switch(i){case u.NORTH:case u.SOUTH:r.setContributesToMinimumHeight(!0),s.setCell(e.getContainerColumn(),r);break;case u.WEST:case u.EAST:r.setContributesToMinimumWidth(!0),s.setCell(e.getContainerRow(),r);break}}return r}};var ba=class{static setNodeWidth(t){let e=t.nodeSize,o;if(fo.areSizeConstraintsFixed(t))o=e.x;else{if(t.topdownLayout?o=Math.max(e.x,t.nodeContainer.getMinimumWidth()):o=t.nodeContainer.getMinimumWidth(),t.sizeConstraints.has(mt.NODE_LABELS)&&!t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG)){let s=t.outsideNodeLabelContainers.get(u.NORTH),a=t.outsideNodeLabelContainers.get(u.SOUTH);s!=null&&(o=Math.max(o,s.getMinimumWidth())),a!=null&&(o=Math.max(o,a.getMinimumWidth()))}let i=fo.getMinimumNodeSize(t);i!=null&&(o=Math.max(o,i.x))}t.node.getGraph().getProperty(To)?e.x=Math.max(e.x,o):e.x=o;let r=t.nodeContainer.getCellRectangle();r.x=0,r.width=o,t.nodeContainer.layoutChildrenHorizontally()}static setNodeHeight(t){let e=t.nodeSize,o;if(fo.areSizeConstraintsFixed(t))o=e.y;else{if(t.topdownLayout?o=Math.max(e.y,t.nodeContainer.getMinimumHeight()):o=t.nodeContainer.getMinimumHeight(),t.sizeConstraints.has(mt.NODE_LABELS)&&!t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG)){let s=t.outsideNodeLabelContainers.get(u.EAST),a=t.outsideNodeLabelContainers.get(u.WEST);s!=null&&(o=Math.max(o,s.getMinimumHeight())),a!=null&&(o=Math.max(o,a.getMinimumHeight()))}let i=fo.getMinimumNodeSize(t);if(i!=null&&(o=Math.max(o,i.y)),t.sizeConstraints.has(mt.PORTS)&&(t.portConstraints===H.FIXED_RATIO||t.portConstraints===H.FIXED_POS)){let s=t.insidePortLabelCells.get(u.EAST),a=t.insidePortLabelCells.get(u.WEST);s!=null&&(o=Math.max(o,s.getMinimumHeight())),a!=null&&(o=Math.max(o,a.getMinimumHeight()))}}t.node.getGraph().getProperty(To)?e.y=Math.max(e.y,o):e.y=o;let r=t.nodeContainer.getCellRectangle();r.y=0,r.height=o,t.nodeContainer.layoutChildrenVertically()}};var Zl=class{constructor(t,e){this.parentNodeContext=t,this.port=e,this.portPosition=new O(e.getPosition()),this.portMargin=new me,this.portLabelCell=null;let o=t.portLabelsPlacement,r=o.has(it.NEXT_TO_PORT_IF_POSSIBLE);o.has(it.INSIDE)?t.treatAsCompoundNode?this.labelsNextToPort=r&&!e.hasCompoundConnections():this.labelsNextToPort=!0:o.has(it.OUTSIDE)?r?this.labelsNextToPort=!tT(e):this.labelsNextToPort=!1:this.labelsNextToPort=!1}applyPortPosition(){this.port.setPosition(this.portPosition)}};function tT(n){for(let t of n.getIncomingEdges())return!0;for(let t of n.getOutgoingEdges())return!0;return!1}var jl=class n{static createPortContexts(t,e){let o=!e||!t.portLabelsPlacement.has(it.INSIDE),r=0;for(let i of t.node.getPorts()){if(i.getSide()===u.UNDEFINED)throw new Error("Label and node size calculator can only be used with ports that have port sides assigned.");i.setVolatileId(r++),n._createPortContext(t,i,o)}}static _createPortContext(t,e,o){let r=new Zl(t,e);if(t.portContexts.put(e.getSide(),r),o&&!it.isFixed(t.portLabelsPlacement)){r.portLabelCell=new Ni(t.labelLabelSpacing);for(let i of e.getLabels())r.portLabelCell.addLabel(i)}}};var $l=class n{removeOverlaps(t){let e=t.getVerticalGap(),o=new Set,r=0;for(let i of t.getRectangleNodes()){let s=0;i.getOverlappingNodes().sort(n.compareByYCoordinate);for(let a of i.getOverlappingNodes())if(o.has(a)){let l=i.getRectangle(),c=a.getRectangle();s<c.y+c.height+e&&s+l.height+e>c.y&&(s=c.y+c.height+e)}i.getRectangle().y=s,o.add(i),r=Math.max(r,i.getRectangle().y+i.getRectangle().height)}return r}static compareByYCoordinate(t,e){return t.getRectangle().y-e.getRectangle().y}};var sE=5,Jt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Jt.UP=new Jt("UP");Jt.DOWN=new Jt("DOWN");Jt.LEFT=new Jt("LEFT");Jt.RIGHT=new Jt("RIGHT");var wu=class{constructor(t,e){this._originalRectangle=t,this._rectangle=e,this._overlappingNodes=[]}getRectangle(){return this._rectangle}getOverlappingNodes(){return this._overlappingNodes}get originalRectangle(){return this._originalRectangle}get rectangle(){return this._rectangle}get overlappingNodes(){return this._overlappingNodes}},fs=class n{constructor(){this._overlapRemovalDirection=null,this._gapVertical=sE,this._gapHorizontal=sE,this._startCoordinate=0,this._overlapRemovalStrategy=null,this._rectangleNodes=[]}static createForDirection(t){let e=new n;return e._overlapRemovalDirection=t,e}withGap(t,e){return this._gapHorizontal=t,this._gapVertical=e,this}withStartCoordinate(t){return this._startCoordinate=t,this}withOverlapRemovalStrategy(t){return this._overlapRemovalStrategy=t,this}addRectangle(t){return this._rectangleNodes.push(new wu(t,this._importRectangle(t))),this}getHorizontalGap(){return this._gapHorizontal}getVerticalGap(){return this._gapVertical}getRectangleNodes(){return this._rectangleNodes}_importRectangle(t){switch(this._overlapRemovalDirection){case Jt.UP:case Jt.DOWN:return t;case Jt.LEFT:case Jt.RIGHT:return new dt(t.y,0,t.height,t.width);default:return null}}_exportRectangle(t,e){let o=t.rectangle,r=t.originalRectangle;switch(this._overlapRemovalDirection){case Jt.UP:r.y=this._startCoordinate-o.height-o.y;break;case Jt.DOWN:r.y+=this._startCoordinate;break;case Jt.LEFT:r.x=this._startCoordinate-o.height-o.y;break;case Jt.RIGHT:r.x=this._startCoordinate+o.y;break}}removeOverlaps(){this._overlapRemovalStrategy==null&&(this._overlapRemovalStrategy=new $l),this._rectangleNodes.sort(n._compareLeftRectangleBorders),this._computeOverlaps();let t=this._overlapRemovalStrategy.removeOverlaps(this);for(let e of this._rectangleNodes)this._exportRectangle(e,t);return t}_computeOverlaps(){let t=[];for(let e of this._rectangleNodes){let o=e.rectangle.x;for(;t.length>0;){let s=t[0];if(s.rectangle.x+s.rectangle.width<o)t.shift();else break}for(let s of t)s.overlappingNodes.push(e),e.overlappingNodes.push(s);let r=e.rectangle.x+e.rectangle.width,i=0;for(;i<t.length;){let s=t[i];if(s.rectangle.x+s.rectangle.width>r)break;i++}t.splice(i,0,e)}}static _compareLeftRectangleBorders(t,e){return t.rectangle.x-e.rectangle.x}static _compareRightRectangleBorders(t,e){return t.rectangle.x+t.rectangle.width-(e.rectangle.x+e.rectangle.width)}};var Ga=class n{static placeHorizontalPortLabels(t){n._placePortLabels(t,u.NORTH),n._placePortLabels(t,u.SOUTH)}static placeVerticalPortLabels(t){n._placePortLabels(t,u.EAST),n._placePortLabels(t,u.WEST)}static _placePortLabels(t,e){let o=!t.sizeConstraints.has(mt.PORT_LABELS)||t.portConstraints===H.FIXED_POS;t.portLabelsPlacement.has(it.INSIDE)?o?n._constrainedInsidePortLabelPlacement(t,e):n._simpleInsidePortLabelPlacement(t,e):t.portLabelsPlacement.has(it.OUTSIDE)&&(o?n._constrainedOutsidePortLabelPlacement(t,e):n._simpleOutsidePortLabelPlacement(t,e))}static _simpleInsidePortLabelPlacement(t,e){let o=0,r=n._portLabelBorderOffsetForPortSide(t,e),i=t.portLabelSpacingHorizontal,s=t.portLabelSpacingVertical;for(let a of t.portContexts.get(e)){if(a.portLabelCell==null||!a.portLabelCell.hasLabels())continue;let l=a.port.getSize(),c=a.port.hasProperty(Ke)?a.port.getProperty(Ke):0,g=a.portLabelCell,h=g.getCellRectangle();switch(h.width=g.getMinimumWidth(),h.height=g.getMinimumHeight(),e){case u.NORTH:h.x=a.labelsNextToPort?(l.x-h.width)/2:l.x+i,h.y=l.y+c+r,g.setHorizontalAlignment(lt.CENTER),g.setVerticalAlignment(nt.TOP);break;case u.SOUTH:h.x=a.labelsNextToPort?(l.x-h.width)/2:l.x+i,h.y=-c-r-h.height,g.setHorizontalAlignment(lt.CENTER),g.setVerticalAlignment(nt.BOTTOM);break;case u.EAST:{if(h.x=-c-r-h.width,a.labelsNextToPort){let d=t.portLabelsTreatAsGroup?h.height:g.getLabels()[0].getSize().y;h.y=(l.y-d)/2}else h.y=l.y+s;g.setHorizontalAlignment(lt.RIGHT),g.setVerticalAlignment(nt.CENTER);break}case u.WEST:{if(h.x=l.x+c+r,a.labelsNextToPort){let d=t.portLabelsTreatAsGroup?h.height:g.getLabels()[0].getSize().y;h.y=(l.y-d)/2}else h.y=l.y+s;g.setHorizontalAlignment(lt.LEFT),g.setVerticalAlignment(nt.CENTER);break}}(e===u.NORTH||e===u.SOUTH)&&(o=Math.max(o,h.height))}o>0&&(t.insidePortLabelCells.get(e).getMinimumContentAreaSize().y=o)}static _portLabelBorderOffsetForPortSide(t,e){switch(e){case u.NORTH:return t.nodeContainer.getPadding().top+t.portLabelSpacingVertical;case u.SOUTH:return t.nodeContainer.getPadding().bottom+t.portLabelSpacingVertical;case u.EAST:return t.nodeContainer.getPadding().right+t.portLabelSpacingHorizontal;case u.WEST:return t.nodeContainer.getPadding().left+t.portLabelSpacingHorizontal;default:return 0}}static _constrainedInsidePortLabelPlacement(t,e){let o=t.portContexts.get(e);if(e===u.EAST||e===u.WEST){n._simpleInsidePortLabelPlacement(t,e);return}let r=e===u.NORTH?Jt.DOWN:Jt.UP,i=e===u.NORTH?nt.TOP:nt.BOTTOM,s=t.insidePortLabelCells.get(e),a=s.getCellRectangle(),l=a.x+Math.max(s.getPadding().left,t.surroundingPortMargins.left,t.nodeLabelSpacing),c=a.x+a.width-Math.max(s.getPadding().right,t.surroundingPortMargins.right,t.nodeLabelSpacing),g=fs.createForDirection(r).withGap(t.portLabelSpacingHorizontal,t.portLabelSpacingVertical),h=e===u.NORTH?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;for(let f of o){if(f.portLabelCell==null||!f.portLabelCell.hasLabels())continue;let E=f.port.getSize(),P=f.portPosition,S=f.portLabelCell,T=S.getCellRectangle();T.width=S.getMinimumWidth(),T.height=S.getMinimumHeight(),S.setVerticalAlignment(i),S.setHorizontalAlignment(lt.RIGHT),n._centerPortLabel(T,P,E,l,c),g.addRectangle(T),h=e===u.NORTH?Math.max(h,P.y+f.port.getSize().y):Math.min(h,P.y)}h+=e===u.NORTH?t.portLabelSpacingVertical:-t.portLabelSpacingVertical;let d=g.withStartCoordinate(h).removeOverlaps();d>0&&(t.insidePortLabelCells.get(e).getMinimumContentAreaSize().y=d);for(let f of o){if(f.portLabelCell==null||!f.portLabelCell.hasLabels())continue;let E=f.portLabelCell.getCellRectangle();E.x-=f.portPosition.x,E.y-=f.portPosition.y}}static _centerPortLabel(t,e,o,r,i){t.x=e.x-(t.width-o.x)/2;let s=Math.min(r,e.x),a=Math.max(i,e.x+o.x);t.x<s?t.x=s:t.x+t.width>a&&(t.x=a-t.width)}static _simpleOutsidePortLabelPlacement(t,e){let o=t.portContexts.get(e),r=fo.isFirstOutsidePortLabelPlacedDifferently(t,e),i=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE);for(let s of o){if(s.portLabelCell==null||!s.portLabelCell.hasLabels())continue;let a=s.port.getSize(),l=s.portLabelCell,c=l.getCellRectangle();switch(c.width=l.getMinimumWidth(),c.height=l.getMinimumHeight(),e){case u.NORTH:s.labelsNextToPort?(c.x=(a.x-c.width)/2,l.setHorizontalAlignment(lt.CENTER)):r||i?(c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT)):(c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT)),c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM);break;case u.SOUTH:s.labelsNextToPort?(c.x=(a.x-c.width)/2,l.setHorizontalAlignment(lt.CENTER)):r||i?(c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT)):(c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT)),c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP);break;case u.EAST:{if(s.labelsNextToPort){let g=t.portLabelsTreatAsGroup?c.height:l.getLabels()[0].getSize().y;c.y=(a.y-g)/2,l.setVerticalAlignment(nt.CENTER)}else r||i?(c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM)):(c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP));c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT);break}case u.WEST:{if(s.labelsNextToPort){let g=t.portLabelsTreatAsGroup?c.height:l.getLabels()[0].getSize().y;c.y=(a.y-g)/2,l.setVerticalAlignment(nt.CENTER)}else r||i?(c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM)):(c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP));c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT);break}}r=!1}}static _constrainedOutsidePortLabelPlacement(t,e){let o=t.portContexts.get(e);if(o.length<=2||e===u.EAST||e===u.WEST){n._simpleOutsidePortLabelPlacement(t,e);return}let r=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),i=e===u.NORTH?Jt.UP:Jt.DOWN,s=e===u.NORTH?nt.BOTTOM:nt.TOP,a=fs.createForDirection(i).withGap(t.portLabelSpacingVertical,t.portLabelSpacingHorizontal),l=e===u.NORTH?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;for(let c of o){if(c.portLabelCell==null||!c.portLabelCell.hasLabels())continue;let g=c.port.getSize(),h=c.portPosition,d=c.portLabelCell,f=d.getCellRectangle();f.width=d.getMinimumWidth(),f.height=d.getMinimumHeight(),r?(f.x=h.x-d.getMinimumWidth()-t.portLabelSpacingHorizontal,r=!1):f.x=h.x+g.x+t.portLabelSpacingHorizontal,d.setVerticalAlignment(s),d.setHorizontalAlignment(lt.RIGHT),a.addRectangle(f),l=e===u.NORTH?Math.min(l,h.y):Math.max(l,h.y+c.port.getSize().y)}l+=e===u.NORTH?-t.portLabelSpacingVertical:t.portLabelSpacingVertical,a.withStartCoordinate(l).removeOverlaps();for(let c of o){if(c.portLabelCell==null||!c.portLabelCell.hasLabels())continue;let g=c.portLabelCell.getCellRectangle();g.x-=c.portPosition.x,g.y-=c.portPosition.y}}};var ql=class n{static calculateVerticalPortPlacementSize(t){switch(t.portConstraints){case H.FIXED_POS:n._calculateVerticalNodeSizeRequiredByFixedPosPorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFixedPosPorts(t,u.WEST);break;case H.FIXED_RATIO:n._calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,u.WEST);break;default:n._calculateVerticalNodeSizeRequiredByFreePorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFreePorts(t,u.WEST);break}}static _calculateVerticalNodeSizeRequiredByFixedPosPorts(t,e){let o=0;for(let i of t.portContexts.get(e))o=Math.max(o,i.portPosition.y+i.port.getSize().y);let r=t.insidePortLabelCells.get(e);r.getPadding().top=0,r.getMinimumContentAreaSize().y=o}static _calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,e){let o=t.insidePortLabelCells.get(e),r=t.portContexts.get(e);if(r.length===0){o.getPadding().top=0,o.getPadding().bottom=0;return}let i=t.portLabelsPlacement.has(it.INSIDE),s=0;t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let a=null,l=0,c=0;for(let g of r){let h=g.port.getProperty(Lr.PORT_RATIO_OR_POSITION),d=g.port.getSize().y;if(a==null)t.surroundingPortMargins!=null&&t.surroundingPortMargins.top>0&&(s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(t.surroundingPortMargins.top+g.portMargin.top,0,h)));else{let f=c+a.portMargin.bottom+t.portPortSpacing+g.portMargin.top;s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(f,l,h))}a=g,l=h,c=d}if(t.surroundingPortMargins!=null&&t.surroundingPortMargins.bottom>0){let g=c+t.surroundingPortMargins.bottom;i&&(g+=a.portMargin.bottom),s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(g,l,1))}o.getPadding().top=0,o.getMinimumContentAreaSize().y=s}static _calculateVerticalNodeSizeRequiredByFreePorts(t,e){let o=t.insidePortLabelCells.get(e);if(t.portContexts.get(e).length===0){o.getPadding().top=0,o.getPadding().bottom=0;return}o.getPadding().top=t.surroundingPortMargins.top,o.getPadding().bottom=t.surroundingPortMargins.bottom,t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let r=n._portHeightPlusPortPortSpacing(t,e);t.getPortAlignment(e)===qt.DISTRIBUTED&&(r+=2*t.portPortSpacing),o.getMinimumContentAreaSize().y=r}static _setupPortMargins(t,e){let o=t.portContexts.get(e),r=t.portLabelsPlacement.has(it.OUTSIDE),i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE),a=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),l=t.sizeOptions.has(Nt.UNIFORM_PORT_SPACING),c=!i&&!s&&(a||o.length===2);n._computeVerticalPortMargins(t,e,r);let g=null,h=null;r&&o.length>0&&(g=o[0],h=o[o.length-1],g.portMargin.top=0,h.portMargin.bottom=0,c&&!g.labelsNextToPort&&(g.portMargin.bottom=0)),l&&(n._unifyPortMargins(o),r&&g!=null&&(g.portMargin.top=0,h.portMargin.bottom=0))}static _computeVerticalPortMargins(t,e,o){for(let r of t.portContexts.get(e)){let i=r.portLabelCell!=null?r.portLabelCell.getMinimumHeight():0;if(i>0)if(r.labelsNextToPort){let s=r.port.getSize().y;if(i>s)if(t.portLabelsTreatAsGroup||r.portLabelCell.getLabels().length===1){let a=(i-s)/2;r.portMargin.top=a,r.portMargin.bottom=a}else{let l=(r.portLabelCell.getLabels()[0].getSize().y-s)/2;r.portMargin.top=Math.max(0,l),r.portMargin.bottom=i-l-s}}else r.portMargin.bottom=t.portLabelSpacingVertical+i;else if(it.isFixed(t.portLabelsPlacement)){let s=Ia(r.port);s.y<0&&(r.portMargin.top=-s.y),s.y+s.height>r.port.getSize().y&&(r.portMargin.bottom=s.y+s.height-r.port.getSize().y)}}}static _unifyPortMargins(t){let e=0,o=0;for(let r of t)e=Math.max(e,r.portMargin.top),o=Math.max(o,r.portMargin.bottom);for(let r of t)r.portMargin.top=e,r.portMargin.bottom=o}static _portHeightPlusPortPortSpacing(t,e){let o=0,r=t.portContexts.get(e);for(let i=0;i<r.length;i++){let s=r[i];o+=s.portMargin.top+s.port.getSize().y+s.portMargin.bottom,i<r.length-1&&(o+=t.portPortSpacing)}return o}};var us=class n{static process(t,e,o=!0,r=!1){if(e==null){for(let a of t.getNodes())n.process(t,a,!0,!1);return}let i=new qs(t,e);jl.createPortContexts(i,r);let s=!0;if(t!=null&&t.hasProperty(lr)){let a=t.getProperty(lr);s=a===R.UNDEFINED||a.isHorizontal()}return Ma.createNodeLabelCells(i,!1,s),Vl.createInsidePortLabelCells(i),fo.setupMinimumClientAreaSize(i),fo.setupNodePaddingForPortsWithOffset(i),Ti.calculateHorizontalPortPlacementSize(i),ql.calculateVerticalPortPlacementSize(i),wa.configureCellSystemSizeContributions(i),ba.setNodeWidth(i),Lr.placeHorizontalPorts(i),Ga.placeHorizontalPortLabels(i),wa.updateVerticalInsidePortLabelCellPadding(i),ba.setNodeHeight(i),o&&(fo.offsetSouthernPortsByNodeSize(i),Lr.placeVerticalPorts(i),Ga.placeVerticalPortLabels(i),Xl.placeLabels(i),fo.setNodePadding(i),fo.applyStuff(i)),i.nodeSize}static computeInsideNodeLabelPadding(t,e,o){let r=new qs(null,e);Ma.createNodeLabelCells(r,!0,!o.isVertical());let i=r.insideNodeLabelContainer,s=new yt;for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(G.BEGIN,a);l!=null&&(s.top=Math.max(s.top,l.getMinimumHeight()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(G.END,a);l!=null&&(s.bottom=Math.max(s.bottom,l.getMinimumHeight()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(a,G.BEGIN);l!=null&&(s.left=Math.max(s.left,l.getMinimumWidth()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(a,G.END);l!=null&&(s.right=Math.max(s.right,l.getMinimumWidth()))}return s.top>0&&(s.top+=i.getPadding().top,s.top+=i.getGap()),s.bottom>0&&(s.bottom+=i.getPadding().bottom,s.bottom+=i.getGap()),s.left>0&&(s.left+=i.getPadding().left,s.left+=i.getGap()),s.right>0&&(s.right+=i.getPadding().right,s.right+=i.getGap()),s}};var No=class{static calculateLabelAndNodeSizes(t){us.process(t)}static calculateNodeMargins(t){new Da(t).process()}static getNodeMarginCalculator(t){return new Da(t)}static sortPortLists(t){for(let e of t.getNodes())e.sortPortList()}};var fe=class fe{constructor(t){this.name=t,Object.freeze(this)}opposite(){switch(this){case fe.ABOVE:return fe.BELOW;case fe.BELOW:return fe.ABOVE;case fe.INLINE:return fe.INLINE;default:return fe.UNKNOWN}}toString(){return this.name}static values(){return[fe.UNKNOWN,fe.ABOVE,fe.BELOW,fe.INLINE]}static valueOf(t){return fe[t]}};Z(fe,"UNKNOWN",new fe("UNKNOWN")),Z(fe,"ABOVE",new fe("ABOVE")),Z(fe,"BELOW",new fe("BELOW")),Z(fe,"INLINE",new fe("INLINE")),Z(fe,"LABEL_SIDE",new m("org.eclipse.elk.labelSide",fe.UNKNOWN));var Vt=fe;var yo=class n{constructor(){throw new Error("ElkGraphAdapters is a namespace and must not be instantiated.")}static adapt(t){return new Mu(t)}static adaptSingleNode(t){let e=t.getParent?t.getParent():t.parent;return new Jl(e==null?null:n.adapt(e),t)}static adaptSinglePort(t){return new Ql(t)}},Js=class{constructor(t){this.element=t,this._volatileId=0}getProperty(t){if(t===Ke){let e=this.element.getProperty(Ke);return e==null?0:e}return this.element.getProperty(t)}hasProperty(t){return this.element.hasProperty(t)}getPosition(){return new O(this.element.getX(),this.element.getY())}getSize(){return new O(this.element.getWidth(),this.element.getHeight())}setSize(t){this.element.setWidth(t.x),this.element.setHeight(t.y)}setPosition(t){this.element.setX(t.x),this.element.setY(t.y)}getPadding(){let t=this.element.getProperty(ns);return t==null?new yt:new yt(t)}setPadding(t){this.element.setProperty(ns,new yt(t))}getMargin(){let t=this.element.getProperty(Nr);return t==null&&(t=new me),t}setMargin(t){this.element.setProperty(Nr,new me(t))}getVolatileId(){return this._volatileId}setVolatileId(t){this._volatileId=t}},Mu=class extends Js{constructor(t){super(t),this._childNodes=null}getNodes(){if(this._childNodes==null){this._childNodes=[];for(let t of this.element.children)this._childNodes.push(new Jl(this,t))}return this._childNodes}},Jl=class extends Js{constructor(t,e){super(e),this._parentGraphAdapter=t,this._labelAdapters=null,this._portAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getGraph(){return this._parentGraphAdapter}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}getPorts(){if(this._portAdapters==null){this._portAdapters=[];for(let t of this.element.ports)this._portAdapters.push(new Ql(t))}return this._portAdapters}getIncomingEdges(){if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let t of _i(this.element))this._incomingEdgeAdapters.push(new Qs(t))}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let t of Ee(this.element))this._outgoingEdgeAdapters.push(new Qs(t))}return this._outgoingEdgeAdapters}sortPortList(t){if(this.element.getProperty(cr).isOrderFixed()){let e=t||aE;this.element.ports.sort(e)}}isCompoundNode(){return this.element.children.length>0||this.element.getProperty(ls)}},Ha=class extends Js{constructor(t){super(t)}getSide(){return this.element.getProperty(Vt.LABEL_SIDE)}getText(){return this.element.getText()}},Ql=class extends Js{constructor(t){super(t),this._labelAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getSide(){return this.element.getProperty(Tr)}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}getIncomingEdges(){if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let t of this.element.incomingEdges)this._incomingEdgeAdapters.push(new Qs(t))}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let t of this.element.outgoingEdges)this._outgoingEdgeAdapters.push(new Qs(t))}return this._outgoingEdgeAdapters}hasCompoundConnections(){let t=this.element.getParent();for(let e of this.element.outgoingEdges)for(let o of e.targets){let r=Pt(o);if(mo(r,t)||r===t&&e.getProperty(Ca))return!0}for(let e of this.element.incomingEdges)for(let o of e.sources)if(mo(Pt(o),t))return!0;return!1}},Qs=class{constructor(t){this.element=t,this._labelAdapters=null}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}},nE=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);function aE(n,t){var a,l;let e=n.getProperty(Tr),o=t.getProperty(Tr),r=((a=nE.get(e))!=null?a:0)-((l=nE.get(o))!=null?l:0);if(r!==0)return r;let i=n.getProperty(Gl),s=t.getProperty(Gl);if(i!=null&&s!=null){let c=i-s;if(c!==0)return c}switch(e){case u.NORTH:return n.getX()-t.getX();case u.EAST:return n.getY()-t.getY();case u.SOUTH:return t.getX()-n.getX();case u.WEST:return t.getY()-n.getY();default:throw new Error("Port side is undefined")}}yo.adapt=yo.adapt;yo.DEFAULT_PORTLIST_SORTER=aE;var Go=class n{constructor(t){this._adapter=t}static forGraph(t){return typeof t.getNodes=="function"&&typeof t.getLabels=="function"?new n(t):new n(yo.adapt(t))}execute(){No.sortPortLists(this._adapter),No.calculateLabelAndNodeSizes(this._adapter),No.calculateNodeMargins(this._adapter)}};var lE=Object.freeze({PARALLEL_NODE:"PARALLEL_NODE",HIERARCHICAL_NODE:"HIERARCHICAL_NODE",ROOT_NODE:"ROOT_NODE",values(){return[this.PARALLEL_NODE,this.HIERARCHICAL_NODE,this.ROOT_NODE]},valueOf(n){return this[n]}});var fr=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};fr.EADES=new fr("EADES");fr.FRUCHTERMAN_REINGOLD=new fr("FRUCHTERMAN_REINGOLD");var bu=new m("org.eclipse.elk.force.model",()=>fr.FRUCHTERMAN_REINGOLD),tn=new m("org.eclipse.elk.force.iterations",300,1),Gu=new m("org.eclipse.elk.force.repulsivePower",0,0),tc=new m("org.eclipse.elk.force.temperature",.001,Xe.greaterThan(0)),ec=new m("org.eclipse.elk.force.repulsion",5,Xe.greaterThan(0));var Vo=new m("org.eclipse.elk.priority",1),_s=new m("org.eclipse.elk.spacing.nodeNode",80,0),nM=new m("org.eclipse.elk.spacing.edgeLabel",5,0),cE=new m("org.eclipse.elk.aspectRatio",1.6,Xe.greaterThan(0)),gE=new m("org.eclipse.elk.randomSeed",1),hE=new m("org.eclipse.elk.separateConnectedComponents",!0),dE=new m("org.eclipse.elk.padding",new yt(50)),aM=new m("org.eclipse.elk.edgeLabels.inline",!1),lM=new m("org.eclipse.elk.topdown.nodeType",lE.HIERARCHICAL_NODE);var yi=class extends ge{constructor(){super(),this._displacement=new O,this._position=new O,this._size=new O}getPosition(){return this._position}getSize(){return this._size}getRadius(){return this._size.length()/2}getDisplacement(){return this._displacement}};var Es=class extends yi{constructor(t,e){super(),this.id=0,this._label=t!=null?t:null,this._parent=e!=null?e:null,this._children=null}toString(){return this._label==null||this._label.length===0?`n_${this.id}`:`n_${this._label}`}isCompound(){return this._children!=null&&this._children.length>0}getLabel(){return this._label}getParent(){return this._parent}getChildren(){return this._children==null&&(this._children=[]),this._children}getDepth(){let t=0,e=this._parent;for(;e!=null;)e=e.getParent(),t++;return t}};var $r=class extends yi{constructor(t){super(),this._edge=t,t.getBendpoints().push(this)}getEdge(){return this._edge}toString(){if(this._edge!=null){let t=this._edge.getBendpoints().indexOf(this);return t>=0?`b${t}[${this._edge}]`:`b[${this._edge}]`}return`b_${this}`}};var Ii=class extends ge{constructor(){super(),this._nodes=[],this._edges=[],this._labels=[],this._bendPoints=[],this._adjacency=null}getEdges(){return this._edges}getNodes(){return this._nodes}getLabels(){return this._labels}getBendpoints(){return this._bendPoints}*getParticles(){for(let t of this._nodes)yield t;for(let t of this._labels)yield t;for(let t of this._bendPoints)yield t}getConnection(t,e){return t instanceof Es&&e instanceof Es?this._adjacency[t.id][e.id]+this._adjacency[e.id][t.id]:t instanceof $r&&e instanceof $r&&t.getEdge()===e.getEdge()?e.getEdge().getProperty(Vo):0}calcAdjacency(){let t=this._nodes.length;this._adjacency=[];for(let e=0;e<t;e++)this._adjacency.push(new Array(t).fill(0));for(let e of this._edges)this._adjacency[e.getSource().id][e.getTarget().id]+=e.getProperty(Vo)}};var Ut=class{};Ut.ORIGIN=new m("origin");Ut.RANDOM=new m("random");Ut.BB_UPLEFT=new m("boundingBox.upLeft");Ut.BB_LOWRIGHT=new m("boundingBox.lowRight");var en=class{split(t){let e=t.getProperty(hE);if(e==null||e===!0){let o=new Array(t.getNodes().length).fill(!1),r=this._buildIncidenceLists(t),i=[];for(let s of t.getNodes()){let a=this._dfs(s,null,null,o,r);a!=null&&(a.copyProperties(t),i.push(a))}if(i.length>1)for(let s of i){let a=0;for(let l of s.getNodes())l.id=a++}return i}return[t]}_buildIncidenceLists(t){let e=t.getNodes().length,o=new Array(e);for(let r=0;r<e;r++)o[r]=[];for(let r of t.getEdges())o[r.getSource().id].push(r),o[r.getTarget().id].push(r);return o}_dfs(t,e,o,r,i){if(!r[t.id]){r[t.id]=!0;let s=o!=null?o:new Ii;s.getNodes().push(t);for(let a of i[t.id])if(!(a.getTarget()===e||a.getSource()===e)){a.getSource()!==t&&this._dfs(a.getSource(),t,s,r,i),a.getTarget()!==t&&this._dfs(a.getTarget(),t,s,r,i),s.getEdges().push(a);for(let l of a.getLabels())s.getLabels().push(l)}return s}return null}recombine(t){var g,h;if(t.length===1)return t[0];if(t.length<=0)return new Ii;for(let d of t){let f=0,E=Number.POSITIVE_INFINITY,P=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(let N of d.getNodes())f+=(g=N.getProperty(Vo))!=null?g:0,E=Math.min(E,N.getPosition().x-N.getSize().x/2),P=Math.min(P,N.getPosition().y-N.getSize().y/2),S=Math.max(S,N.getPosition().x+N.getSize().x/2),T=Math.max(T,N.getPosition().y+N.getSize().y/2);d.setProperty(Vo,f),d.setProperty(Ut.BB_UPLEFT,new O(E,P)),d.setProperty(Ut.BB_LOWRIGHT,new O(S,T))}t.sort((d,f)=>{var P,S;let E=((P=f.getProperty(Vo))!=null?P:0)-((S=d.getProperty(Vo))!=null?S:0);if(E===0){let T=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT)),N=f.getProperty(Ut.BB_LOWRIGHT).clone().sub(f.getProperty(Ut.BB_UPLEFT));return T.x*T.y-N.x*N.y}return E});let e=new Ii;e.copyProperties(t[0]);let o=0,r=0;for(let d of t){let f=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT));o=Math.max(o,f.x),r+=f.x*f.y}o=Math.max(o,Math.sqrt(r)*((h=e.getProperty(cE))!=null?h:1));let i=e.getProperty(_s),s=0,a=0,l=0,c=i;for(let d of t){let f=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT));s+f.x>o&&(s=0,a+=l+i,l=0),this._moveGraph(e,d,s,a),c=Math.max(c,s+f.x),l=Math.max(l,f.y),s+=f.x+i}return e}_moveGraph(t,e,o,r){let i=new O(o,r);i.sub(e.getProperty(Ut.BB_UPLEFT));for(let s of e.getNodes())s.getPosition().add(i),t.getNodes().push(s);for(let s of e.getEdges()){for(let a of s.getBendpoints())a.getPosition().add(i);t.getEdges().push(s)}for(let s of e.getLabels())s.getPosition().add(i),t.getLabels().push(s)}};var U=class U{constructor(){throw new Error("ElkMath is a static utility class")}static factl(t){if(t<0||t>=U._FACT_TABLE.length)throw new Error(`The input must be between 0 and ${U._FACT_TABLE.length}`);return U._FACT_TABLE[t]}static factd(t){if(t<0)throw new Error("The input must be positive");return t<U._FACT_TABLE.length?U._FACT_TABLE[t]:Math.sqrt(2*Math.PI*t)*(U.powf(t,t)/U.powd(Math.E,t))}static binomiall(t,e){if(t<0||e<0)throw new Error("k and n must be positive");if(e>t)throw new Error("k must be smaller than n");return e===0||e===t?1:t===0?0:t<U._FACT_TABLE.length?U.factl(t)/(U.factl(e)*U.factl(t-e)):U.binomiall(t-1,e-1)+U.binomiall(t-1,e)}static binomiald(t,e){if(t<0||e<0)throw new Error("k and n must be positive");if(e>t)throw new Error("k must be smaller than n");return e===0||e===t?1:t===0?0:U.factd(t)/(U.factd(e)*U.factd(t-e))}static powd(t,e){let o=1,r=t,i=e>=0?e:-e;for(;i>0;)i%2===0?(r*=r,i=Math.floor(i/2)):(o*=r,i-=1);return e<0?1/o:o}static powf(t,e){return U.powd(t,e)}static approximateBezierSegment(t,...e){let o,r;if(typeof t=="number"&&e.length>0&&e[0]instanceof O?(o=t,r=e):t instanceof O?(r=[t,...e],o=r.length+1):(o=t,r=e),o<=0)return[];let i=[],s=1/o,a=0;for(let l=0;l<o;l++)a+=s,i.push(U.getPointOnBezierSegment(a,r));return i}static getPointOnBezierSegment(t,e){let o=e.length-1,r=0,i=0;for(let s=0;s<=o;s++){let a=e[s],l=U.binomiald(o,s)*U.powd(1-t,o-s)*U.powd(t,s);r+=a.x*l,i+=a.y*l}return new O(r,i)}static approximateBezierSpline(t){let e=t.length,o=new st,r=0,i=t[r++];for(o.push(i);r<e;){let s=e-r;if(s===1)o.push(t[r++]);else if(s===2){let a=U.approximateBezierSegment(i,t[r++],t[r++]);for(let l of a)o.push(l)}else{let a=t[r++],l=t[r++],c=t[r++],g=U.approximateBezierSegment(i,a,l,c);for(let h of g)o.push(h);i=c}}return o}static distanceFromBezierSegment(t,e,o,r,i){let s=new Array(U._W_DEGREE),a=[t,e,o,r],l=U._convertToBezierForm(a,i),c=U._findRoots(l,U._W_DEGREE,s,0),g=i.distance(t),h=0;for(let E=0;E<c;E++){let P=U._bezier(a,U._DEGREE,s[E],null,null),S=i.distance(P);S<g&&(g=S,h=s[E])}i.distance(r)<g&&(h=1);let f=new O(U._bezier(a,U._DEGREE,h,null,null));return Math.sqrt(f.distance(i))}static _convertToBezierForm(t,e){let o=U._DEGREE,r=U._W_DEGREE,i=new Array(o+1),s=new Array(o),a=Array.from({length:o},()=>new Array(o+1).fill(0)),l=new Array(r+1);for(let d=0;d<=o;d++)i[d]=new O(t[d].x-e.x,t[d].y-e.y);let c=o;for(let d=0;d<=o-1;d++)s[d]=new O(c*(t[d+1].x-t[d].x),c*(t[d+1].y-t[d].y));for(let d=0;d<=o-1;d++)for(let f=0;f<=o;f++)a[d][f]=s[d].x*i[f].x+s[d].y*i[f].y;for(let d=0;d<=r;d++)l[d]=new O(d/r,0);let g=o,h=o-1;for(let d=0;d<=g+h;d++){let f=Math.max(0,d-h),E=Math.min(d,g);for(let P=f;P<=E;P++){let S=d-P;l[P+S].y+=a[S][P]*U._CUBIC_Z[S][P]}}return l}static _findRoots(t,e,o,r){switch(U._crossingCount(t,e)){case 0:return 0;case 1:if(r>=U._MAXDEPTH)return o[0]=(t[0].x+t[U._W_DEGREE].x)/2,1;if(U._controlPolygonFlatEnough(t,e))return o[0]=U._computeXIntercept(t,e),1;break;default:break}let i=new Array(U._W_DEGREE+1),s=new Array(U._W_DEGREE+1),a=new Array(U._W_DEGREE+1),l=new Array(U._W_DEGREE+1);U._bezier(t,e,.5,i,s);let c=U._findRoots(i,e,a,r+1),g=U._findRoots(s,e,l,r+1);for(let h=0;h<c;h++)o[h]=a[h];for(let h=0;h<g;h++)o[h+c]=l[h];return c+g}static _controlPolygonFlatEnough(t,e){let o=t[0].y-t[e].y,r=t[e].x-t[0].x,i=t[0].x*t[e].y-t[e].x*t[0].y,s=o*o+r*r,a=new Array(e+1).fill(0);for(let M=1;M<e;M++)a[M]=o*t[M].x+r*t[M].y+i,a[M]>0&&(a[M]=a[M]*a[M]/s),a[M]<0&&(a[M]=-(a[M]*a[M]/s));let l=0,c=0;for(let M=1;M<e;M++)a[M]<0&&(c=Math.min(c,a[M])),a[M]>0&&(l=Math.max(l,a[M]));let g=0,h=1,d=0,f=o,E=r,P=i+l,S=g*E-f*h,T=1/S,N=(h*P-E*d)*T;P=i+c,S=g*E-f*h,T=1/S;let I=(h*P-E*d)*T,C=Math.min(N,I);return(Math.max(N,I)-C)/2<U._EPSILON}static _computeXIntercept(t,e){let o=t[e].x-t[0].x,r=t[e].y-t[0].y,i=t[0].x,s=t[0].y,a=-1/r;return(o*s-r*i)*a}static _crossingCount(t,e){let o=0,r=t[0].y<0?-1:1,i=r;for(let s=1;s<=e;s++)r=t[s].y<0?-1:1,r!==i&&o++,i=r;return o}static _bezier(t,e,o,r,i){let s=U._W_DEGREE,a=Array.from({length:s+1},()=>new Array(s+1).fill(null));for(let l=0;l<=e;l++)a[0][l]=new O(t[l]);for(let l=1;l<=e;l++)for(let c=0;c<=e-l;c++)a[l][c]=new O((1-o)*a[l-1][c].x+o*a[l-1][c+1].x,(1-o)*a[l-1][c].y+o*a[l-1][c+1].y);if(r!=null)for(let l=0;l<=e;l++)r[l]=a[l][0];if(i!=null)for(let l=0;l<=e;l++)i[l]=a[e-l][l];return a[e][0]}static maxi(...t){let e=-1/0;for(let o of t)o>e&&(e=o);return e}static mini(...t){let e=1/0;for(let o of t)o<e&&(e=o);return e}static averagei(...t){let e=0;for(let o of t)e+=o;return Math.trunc(e/t.length)}static maxl(...t){return U.maxi(...t)}static minl(...t){return U.mini(...t)}static averagel(...t){return U.averagei(...t)}static maxf(...t){return U.maxi(...t)}static minf(...t){return U.mini(...t)}static averagef(...t){let e=0;for(let o of t)e+=o;return e/t.length}static maxd(...t){return U.maxi(...t)}static mind(...t){return U.mini(...t)}static averaged(...t){return U.averagef(...t)}static boundi(t,e,o){return t<=e?e:t>=o?o:t}static boundl(t,e,o){return U.boundi(t,e,o)}static boundf(t,e,o){return U.boundi(t,e,o)}static boundd(t,e,o){return U.boundi(t,e,o)}static clipVector(t,e,o){let r=e/2,i=o/2,s=Math.abs(t.x),a=Math.abs(t.y),l=1,c=1;return s>r&&(l=r/s),a>i&&(c=i/a),t.scale(Math.min(l,c)),t}static signum(t){return t<0?-1:t>0?1:0}static _fuzzyEquals(t,e,o=U._DOUBLE_EQ_EPSILON){return Math.abs(t-e)<=o}static _fuzzyCompare(t,e,o=U._DOUBLE_EQ_EPSILON){return Math.abs(t-e)<=o?0:t<e?-1:1}static intersects(t,e,o,r){if(t instanceof dt&&e instanceof st){let i=t,s=e;if(s.length<2)return!1;let a=s[0],l=a;for(let c=1;c<s.length;c++){let g=s[c];if(U.intersects(i,l,g))return!0;l=g}return U.intersects(i,l,a)}else if(t instanceof dt&&e instanceof O){let i=t,s=e,a=o;return U.contains(i,s,a)?!1:U._intersectsSegments(i.getTopLeft(),i.getTopRight(),s,a)||U._intersectsSegments(i.getTopRight(),i.getBottomRight(),s,a)||U._intersectsSegments(i.getBottomRight(),i.getBottomLeft(),s,a)||U._intersectsSegments(i.getBottomLeft(),i.getTopLeft(),s,a)}else return U._intersectsSegments(t,e,o,r)}static _intersectsSegments(t,e,o,r){let i=t,s=e.clone().sub(t),a=o,l=r.clone().sub(o),c=i.x,g=i.y,h=a.x,d=a.y,f=s.x,E=s.y,P=l.x,S=l.y,T=P*E-f*S;if(U._fuzzyEquals(0,T))return!1;let N=1/T*((c-h)*E-(g-d)*f),I=1/T*-(-(c-h)*S+(g-d)*P);return U._fuzzyCompare(0,N)<0&&U._fuzzyCompare(N,1)<0&&U._fuzzyCompare(0,I)<0&&U._fuzzyCompare(I,1)<0}static intersects2(t,e,o,r){let i=o.clone().sub(t),s=O.crossProduct(i,e),a=O.crossProduct(e,r),l=O.crossProduct(i,r)/a,c=s/a;if(a===0)if(s===0){let g=o.clone().add(r.clone().scale(.5)),h=t.distance(g),d=t.clone().add(e).distance(g),f=r.length()*.5;return h<d&&h<=f?t.clone():d<=f?t.clone().add(e):null}else return null;else return l>=0&&l<=1&&c>=0&&c<=1?t.clone().add(e.clone().scale(l)):null}static distance(t,e,o,r,i){return Math.min(U._traceRays(t,e,o,r,i),U._traceRays(o,r,t,e,i.clone().negate()))}static _traceRays(t,e,o,r,i){let s=1/0,a,l=!1;a=U.intersects2(t,e.clone().sub(t),o.clone().add(i),r.clone().sub(o));let c=a!=null&&!(a.equalsFuzzily(t)||a.equalsFuzzily(e));return a=U.intersects2(t,e.clone().sub(t),o,i),a!=null&&(a.equalsFuzzily(t)===a.equalsFuzzily(e)||c?s=Math.min(s,a.sub(o).length()):l=!0),a=U.intersects2(t,e.clone().sub(t),r,i),a!=null&&(l||a.equalsFuzzily(t)===a.equalsFuzzily(e)||c)&&(s=Math.min(s,a.sub(r).length())),s}static contains(t,e,o){if(e instanceof st){let r=e;if(r.length<2)return!1;let i=r[0],s=i;for(let a=1;a<r.length;a++){let l=r[a];if(!U.contains(t,s,l))return!1;s=l}return U.contains(t,s,i)}else return o!==void 0?U._containsPoint(t,e)&&U._containsPoint(t,o):U._containsPoint(t,e)}static _containsPoint(t,e){let o=t.x,r=t.x+t.width,i=t.y,s=t.y+t.height;return e.x>o&&e.x<r&&e.y>i&&e.y<s}static shortestDistance(t,e){let o=U._DOUBLE_EQ_EPSILON,r=e.x-(t.x+t.width),i=t.x-(e.x+e.width),s=t.y-(e.y+e.height),a=e.y-(t.y+t.height),l=Math.max(i,r),c=Math.max(s,a),g=U._fuzzyCompare(l,0,o)>=0,h=U._fuzzyCompare(c,0,o)>=0;return g!==h?Math.max(c,l):U._fuzzyCompare(l,0,o)>0?Math.sqrt(c*c+l*l):-Math.sqrt(c*c+l*l)}};Z(U,"_FACT_TABLE",[1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368e3,20922789888e3,355687428096e3,6402373705728e3,121645100408832e3,243290200817664e4]),Z(U,"_W_DEGREE",5),Z(U,"_DEGREE",3),Z(U,"_CUBIC_Z",[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]]),Z(U,"_MAXDEPTH",64),Z(U,"_EPSILON",1*Math.pow(2,-65)),Z(U,"_DOUBLE_EQ_EPSILON",1e-5);var Ft=U;var oc=class extends ge{constructor(){super(),this._bendpoints=[],this._labels=[],this._source=null,this._target=null}toString(){var t;return this._source!=null&&this._target!=null?`${this._source}->${this._target}`:"e_"+((t=this._id)!=null?t:"")}getSource(){return this._source}getTarget(){return this._target}getBendpoints(){return this._bendpoints}getLabels(){return this._labels}getSourcePoint(){let t=this._target.getPosition().clone().sub(this._source.getPosition());return Ft.clipVector(t,this._source.getSize().x,this._source.getSize().y),t.add(this._source.getPosition())}getTargetPoint(){let t=this._source.getPosition().clone().sub(this._target.getPosition());return Ft.clipVector(t,this._target.getSize().x,this._target.getSize().y),t.add(this._target.getPosition())}setSource(t){this._source=t}setTarget(t){this._target=t}toVectorChain(){let t=new st;t.add(this.getSourcePoint());for(let e of this._bendpoints)t.add(e.getPosition());return t.add(this.getTargetPoint()),t}distributeBendpoints(){let t=this._bendpoints.length;if(t>0){let e=this._source.getPosition(),r=this._target.getPosition().clone().sub(e).scale(1/(t+1)),i=e.clone();for(let s of this._bendpoints)s.getPosition().x=i.x+r.x,s.getPosition().y=i.y+r.y,i.add(r)}}};var rc=class extends yi{constructor(t,e){super(),this._edge=t,this._text=e,t.getLabels().push(this)}getText(){return this._text}getEdge(){return this._edge}toString(){return this._text==null||this._text.length===0?`l[${this._edge}]`:`l_${this._text}`}refreshPosition(){let t=this.getProperty(Ou),e=this._edge.getSource().getPosition(),o=this._edge.getTarget().getPosition();if(t){let r=o.clone().sub(e).scale(.5),i=this.getSize().clone().scale(.5),s=e.clone().add(r).sub(i);this.getPosition().set(s)}else{let r=this._edge.getProperty(gu),i=this.getPosition();e.x>=o.x?e.y>=o.y?(i.x=o.x+(e.x-o.x)/2+r,i.y=o.y+(e.y-o.y)/2-r-this.getSize().y):(i.x=o.x+(e.x-o.x)/2+r,i.y=e.y+(o.y-e.y)/2+r):e.y>=o.y?(i.x=e.x+(o.x-e.x)/2+r,i.y=o.y+(e.y-o.y)/2+r):(i.x=e.x+(o.x-e.x)/2+r,i.y=e.y+(o.y-e.y)/2-r-this.getSize().y)}}};var on=class{importGraph(t){let e=new Ii;e.copyProperties(t),e.setProperty(Ut.ORIGIN,t);let o=new Map;return this._transformNodes(t,e,o),this._transformEdges(t,e,o),e}_transformNodes(t,e,o){let r=0;for(let i of t.children){let s="";i.labels.length>0&&(s=i.labels[0].getText());let a=new Es(s);a.copyProperties(i),a.setProperty(Ut.ORIGIN,i),a.id=r++,a.getPosition().x=i.getX()+i.getWidth()/2,a.getPosition().y=i.getY()+i.getHeight()/2,a.getSize().x=Math.max(i.getWidth(),1),a.getSize().y=Math.max(i.getHeight(),1),e.getNodes().push(a),o.set(i,a);let l=i.getProperty(cr);l===H.UNDEFINED&&(l=H.FREE)}}_transformEdges(t,e,o){for(let r of t.children)for(let i of Ee(r)){if(i.isHyperedge())throw new Error("Graph must not contain hyperedges.");let s=Pt(i.targets[0]);if(!i.isHierarchical()&&r!==s){let a=new oc;a.copyProperties(i),a.setProperty(Ut.ORIGIN,i),a.setSource(o.get(r)),a.setTarget(o.get(s)),e.getEdges().push(a);for(let l of i.labels){let c=new rc(a,l.getText());c.copyProperties(l),c.setProperty(Ut.ORIGIN,l),c.getSize().x=Math.max(l.getWidth(),1),c.getSize().y=Math.max(l.getHeight(),1),c.refreshPosition(),e.getLabels().push(c)}}}}applyLayout(t){let e=t.getProperty(Ut.ORIGIN),o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let h of t.getNodes()){let d=h.getPosition(),f=h.getSize();o=Math.min(o,d.x-f.x/2),r=Math.min(r,d.y-f.y/2),i=Math.max(i,d.x+f.x/2),s=Math.max(s,d.y+f.y/2)}for(let h of t.getBendpoints()){let d=h.getPosition(),f=h.getSize();o=Math.min(o,d.x-f.x/2),r=Math.min(r,d.y-f.y/2),i=Math.max(i,d.x+f.x/2),s=Math.max(s,d.y+f.y/2)}let a=e.getProperty(dE),l=new O(a.getLeft()-o,a.getTop()-r);for(let h of t.getNodes()){let d=h.getProperty(Ut.ORIGIN);if(d!=null&&d.children!==void 0){let f=new O(h.getPosition()).add(l);d.setLocation(f.x-d.getWidth()/2,f.y-d.getHeight()/2)}}for(let h of t.getEdges()){let d=h.getProperty(Ut.ORIGIN),f=ar(d,!0,!0),E=new O(h.getSourcePoint());E.add(l),f.setStartLocation(E.x,E.y);for(let S of h.getBendpoints()){let T=new O(S.getPosition());T.add(l),Sa(f,T.x,T.y)}let P=new O(h.getTargetPoint());P.add(l),f.setEndLocation(P.x,P.y)}for(let h of t.getLabels()){let d=h.getProperty(Ut.ORIGIN),f=new O(h.getPosition()).add(l);d.setLocation(f.x,f.y)}let c=i-o+a.getHorizontal(),g=s-r+a.getVertical();e.getProperty(To)||Ae(e,c,g,!1,!0),e.setProperty(pi,c-a.getHorizontal()),e.setProperty(Ei,g-a.getVertical())}};var Hu=16,Ri=class{constructor(){this._random=null,this._graph=null,this._dispBound=0}initialize(t){if(this._graph=t,this._random=t.getProperty(Ut.RANDOM),t.calcAdjacency(),this._dispBound=Math.max(t.getNodes().length*Hu+t.getEdges().length,Hu*Hu),!t.getProperty(zo)){let o=this._graph.getNodes().length;for(let r of t.getNodes()){let i=r.getPosition();i.x=this._random.nextDouble()*o,i.y=this._random.nextDouble()*o}}let e=t.getBendpoints();for(let o of t.getEdges()){let r=o.getProperty(Gu);if(r>0){for(let i=0;i<r;i++)e.push(new $r(o));o.distributeBendpoints()}}}getGraph(){return this._graph}getRandom(){return this._random}layout(t,e){var r;e.begin("Component Layout",1),this.initialize(t);let o=0;for(;this.moreIterations(o)&&!((r=e.isCanceled)!=null&&r.call(e));){this.iterationDone();for(let i of t.getParticles())for(let s of t.getParticles())if(s!==i){let a=this.calcDisplacement(s,i);a!=null&&i.getDisplacement().add(a)}for(let i of t.getParticles()){let s=i.getDisplacement();s.bound(-this._dispBound,-this._dispBound,this._dispBound,this._dispBound),i.getPosition().add(s),s.reset()}o++}e.done()}iterationDone(){for(let t of this._graph.getEdges()){for(let e of t.getLabels())e.refreshPosition();t.distributeBendpoints()}}moreIterations(t){throw new Error("moreIterations must be implemented by subclass")}calcDisplacement(t,e){throw new Error("calcDisplacement must be implemented by subclass")}static avoidSamePosition(t,e,o){let r=e.getPosition(),i=o.getPosition();for(;r.x-i.x===0&&r.y-i.y===0;){let s=!1;if(e instanceof $r&&o instanceof $r&&!s){let a=e.getEdge(),l=new O(a.getTargetPoint()).sub(a.getSourcePoint()),c=2,g=new O(l.x/l.length()*c,-l.y/l.length()*c);r.add(g);let h=o.getEdge(),d=new O(h.getTargetPoint()).sub(h.getSourcePoint());c=l===d?-2:2;let f=new O(d.x/d.length()*c,-(d.y/d.length())*c);r.add(f),s=!0}else{let a=()=>t.nextDouble();r.wiggle(a,1),i.wiggle(a,1)}}}};var fE=100,va=class n extends Ri{constructor(){super(),this._maxIterations=tn.getDefault(),this._springLength=_s.getDefault(),this._repulsionFactor=ec.getDefault()}initialize(t){super.initialize(t),this._maxIterations=t.getProperty(tn),this._springLength=t.getProperty(_s),this._repulsionFactor=t.getProperty(ec)}moreIterations(t){return t<this._maxIterations}calcDisplacement(t,e){var l;Ri.avoidSamePosition(this.getRandom(),t,e);let o=e.getPosition().clone().sub(t.getPosition()),r=o.length(),i=Math.max(0,r-t.getRadius()-e.getRadius()),s,a=this.getGraph().getConnection(t,e);if(a>0)s=-n.attractive(i,this._springLength)*a;else{let c=(l=t.getProperty(Vo))!=null?l:0;s=n._repulsive(i,this._repulsionFactor)*c}return o.scale(s/r),o}static _repulsive(t,e){return t>0?e/(t*t):e*fE}static attractive(t,e){return t>0?Math.log(t/e):-fE}};var eT=.01,oT=100,Ba=class n extends Ri{constructor(){super(),this._temperature=tc.getDefault(),this._threshold=0,this._k=0}initialize(t){super.initialize(t),this._temperature=t.getProperty(tc),this._threshold=this._temperature/t.getProperty(tn);let e=t.getNodes().length,o=0,r=0;for(let a of t.getNodes())o+=a.getSize().x,r+=a.getSize().y;let i=o*r,s=t.getProperty(_s)*eT;this._k=Math.sqrt(i/(2*e))*s}moreIterations(t){return this._temperature>0}calcDisplacement(t,e){var c;Ri.avoidSamePosition(this.getRandom(),t,e);let o=e.getPosition().clone().sub(t.getPosition()),r=o.length(),i=Math.max(0,r-t.getRadius()-e.getRadius()),s=(c=t.getProperty(Vo))!=null?c:0,a=n._repulsive(i,this._k)*s,l=this.getGraph().getConnection(t,e);return l>0&&(a-=n.attractive(i,this._k)*l),o.scale(a*this._temperature/r),o}iterationDone(){super.iterationDone(),this._temperature-=this._threshold}static _repulsive(t,e){return t>0?e*e/t:e*e*oT}static attractive(t,e){return t*t/e}};var rn=class extends de{constructor(){super(),this._forceModel=null,this._componentsProcessor=new en}layout(t,e){e.begin("ELK Force",1),t.getProperty(So)||Go.forGraph(t).execute();let o=new on,r=o.importGraph(t);this._setOptions(r,t),this._updateModel(r.getProperty(bu));let i=this._componentsProcessor.split(r);for(let s of i){let a=typeof e.subTask=="function"?e.subTask(1/i.length):e;this._forceModel.layout(s,a)}r=this._componentsProcessor.recombine(i),o.applyLayout(r),e.done()}_setOptions(t,e){let o=t.getProperty(gE);o!=null?o===0?t.setProperty(Ut.RANDOM,new dr):t.setProperty(Ut.RANDOM,new dr(o)):t.setProperty(Ut.RANDOM,new dr(1))}_updateModel(t){switch(t){case fr.EADES:this._forceModel instanceof va||(this._forceModel=new va);break;case fr.FRUCHTERMAN_REINGOLD:default:this._forceModel instanceof Ba||(this._forceModel=new Ba);break}}};var uE="org.eclipse.elk.force",_E=!1;function pE(){let n=Ht.getInstance(),t=n.getAlgorithmData(uE);if(t)return _E=!0,t;let e=new Se.Builder().id(uE).name("ELK Force").description("Force-based algorithm provided by the Eclipse Layout Kernel.").category("org.eclipse.elk.force").definingBundleId("org.eclipse.elk.alg.force").providerFactory(()=>new rn).supportedFeatures(new Set(["MULTI_EDGES","EDGE_LABELS"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),_E=!0,e}var eo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};eo.XY=new eo("XY");eo.X=new eo("X");eo.Y=new eo("Y");var vu=new m("org.eclipse.elk.stress.fixed",!1),Ua=new m("org.eclipse.elk.stress.desiredEdgeLength",100),Bu=new m("org.eclipse.elk.stress.dimension",()=>eo.XY),Uu=new m("org.eclipse.elk.stress.epsilon",.001),Fu=new m("org.eclipse.elk.stress.iterationLimit",Number.MAX_SAFE_INTEGER);var N0=new m("org.eclipse.elk.edgeLabels.inline",!0);var ic=class n{constructor(){this._graph=null,this._apsp=null,this._w=null,this._desiredEdgeLength=0,this._dim=eo.XY,this._epsilon=0,this._iterationLimit=Number.MAX_SAFE_INTEGER,this._connectedEdges=new Map}initialize(t){if(t.getNodes().length<=1)return;this._graph=t,this._dim=t.getProperty(Bu),this._iterationLimit=t.getProperty(Fu),this._epsilon=t.getProperty(Uu),this._desiredEdgeLength=t.getProperty(Ua),this._connectedEdges.clear();for(let o of t.getEdges())this._pushEdge(o.getSource(),o),this._pushEdge(o.getTarget(),o);let e=t.getNodes().length;this._apsp=[];for(let o=0;o<e;o++)this._apsp.push(new Array(e).fill(0));for(let o of t.getNodes())this._dijkstra(o,this._apsp[o.id]);this._w=[];for(let o=0;o<e;o++)this._w.push(new Array(e).fill(0));for(let o=0;o<e;o++)for(let r=0;r<e;r++){let i=this._apsp[o][r];this._w[o][r]=i===0?0:1/(i*i)}}_pushEdge(t,e){let o=this._connectedEdges.get(t);o==null&&(o=[],this._connectedEdges.set(t,o)),o.push(e)}execute(){if(this._graph.getNodes().length<=1)return;let t=0,e=this._computeStress(),o=Number.POSITIVE_INFINITY;do{t>0&&(e=o);for(let r of this._graph.getNodes()){if(r.getProperty(vu))continue;let i=this._computeNewPosition(r);r.getPosition().reset().add(i)}o=this._computeStress(),t++}while(!this._done(t,e,o))}_dijkstra(t,e){var i;let o=this._graph.getNodes().length,r=new Array(o).fill(!1);for(let s of this._graph.getNodes())e[s.id]=s.id===t.id?0:Number.POSITIVE_INFINITY;for(let s=0;s<o;s++){let a=null,l=Number.POSITIVE_INFINITY;for(let g of this._graph.getNodes())!r[g.id]&&e[g.id]<l&&(l=e[g.id],a=g);if(a==null)break;r[a.id]=!0;let c=(i=this._connectedEdges.get(a))!=null?i:[];for(let g of c){let h=n._getOther(g,a);if(r[h.id])continue;let d;g.hasProperty(Ua)?d=g.getProperty(Ua):d=this._desiredEdgeLength;let f=e[a.id]+d;f<e[h.id]&&(e[h.id]=f)}}}_done(t,e,o){return e===0||(e-o)/e<this._epsilon||t>=this._iterationLimit}_computeStress(){let t=0,e=this._graph.getNodes();for(let o=0;o<e.length;o++){let r=e[o];for(let i=o+1;i<e.length;i++){let s=e[i],l=r.getPosition().distance(s.getPosition())-this._apsp[r.id][s.id];t+=this._w[r.id][s.id]*l*l}}return t}_computeNewPosition(t){let e=0,o=0,r=0;for(let i of this._graph.getNodes()){if(t===i)continue;let s=this._w[t.id][i.id];e+=s;let a=t.getPosition().distance(i.getPosition());a>0&&this._dim!==eo.Y&&(o+=s*(i.getPosition().x+this._apsp[t.id][i.id]*(t.getPosition().x-i.getPosition().x)/a)),a>0&&this._dim!==eo.X&&(r+=s*(i.getPosition().y+this._apsp[t.id][i.id]*(t.getPosition().y-i.getPosition().y)/a))}switch(this._dim){case eo.X:return new O(o/e,t.getPosition().y);case eo.Y:return new O(t.getPosition().x,r/e);default:return new O(o/e,r/e)}}static _getOther(t,e){if(t.getSource()===e)return t.getTarget();if(t.getTarget()===e)return t.getSource();throw new Error("Node must be either source or target of edge.")}};var sc=class extends de{constructor(){super(),this._componentsProcessor=new en,this._stressMajorization=new ic}layout(t,e){if(e.begin("ELK Stress",1),t.getProperty(zo))t.getProperty(So)||Go.forGraph(t).execute();else{let s=typeof e.subTask=="function"?e.subTask(1):e;new rn().layout(t,s)}let o=new on,r=o.importGraph(t),i=this._componentsProcessor.split(r);for(let s of i)if(!(s.getNodes().length<=1)){this._stressMajorization.initialize(s),this._stressMajorization.execute();for(let a of s.getLabels())a.refreshPosition()}r=this._componentsProcessor.recombine(i),o.applyLayout(r),e.done()}};var mE="org.eclipse.elk.stress",PE=!1;function OE(){let n=Ht.getInstance(),t=n.getAlgorithmData(mE);if(t)return PE=!0,t;let e=new Se.Builder().id(mE).name("ELK Stress").description("Minimizes the stress within a layout using stress majorization.").category("org.eclipse.elk.force").definingBundleId("org.eclipse.elk.alg.force").providerFactory(()=>new sc).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),PE=!0,e}var qr=class extends ge{constructor(){super(),this._nodes=[],this._edges=[]}getEdges(){return this._edges}getNodes(){return this._nodes}toString(){let t=[];for(let e of this._nodes)t.push(e.toString());for(let e of this._edges)t.push(e.toString());return t.join(`
-`)}};var L=class{};L.ORIGIN=new m("origin");L.RANDOM=new m("random");L.DEPTH=new m("DEPTH",0);L.FAN=new m("FAN",0);L.DESCENDANTS=new m("DESCENDANTS",0);L.ROOT=new m("ROOT",!1);L.LEFTNEIGHBOR=new m("LEFTNEIGHBOR",null);L.RIGHTNEIGHBOR=new m("RIGHTNEIGHBOR",null);L.LEFTSIBLING=new m("LEFTSIBLING",null);L.RIGHTSIBLING=new m("RIGHTSIBLING",null);L.DUMMY=new m("DUMMY",!1);L.LEVEL=new m("LEVEL",0);L.REMOVABLE_EDGES=new m("REMOVABLE_EDGES",[]);L.XCOOR=new m("XCOOR",0);L.YCOOR=new m("YCOOR",0);L.LEVELHEIGHT=new m("LEVELHEIGHT",0);L.LEVELMIN=new m("LEVELMIN",0);L.LEVELMAX=new m("LEVELMAX",0);L.GRAPH_XMIN=new m("GRAPH_XMIN",0);L.GRAPH_YMIN=new m("GRAPH_YMIN",0);L.GRAPH_XMAX=new m("GRAPH_XMAX",0);L.GRAPH_YMAX=new m("GRAPH_YMAX",0);L.COMPACT_LEVEL_ASCENSION=new m("COMPACT_LEVEL_ASCENSION",!1);L.COMPACT_CONSTRAINTS=new m("COMPACT_CONSTRAINTS",[]);L.ID=new m("ID","");L.POSITION=new m("POSITION",0);L.PRELIM=new m("PRELIM",0);L.MODIFIER=new m("MODIFIER",0);L.BB_UPLEFT=new m("boundingBox.upLeft");L.BB_LOWRIGHT=new m("boundingBox.lowRight");var ur=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};ur.DFS=new ur("DFS");ur.BFS=new ur("BFS");var je=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};je.MODEL_ORDER=new je("MODEL_ORDER");je.DESCENDANTS=new je("DESCENDANTS");je.FAN=new je("FAN");je.CONSTRAINT=new je("CONSTRAINT");var ms=Object.freeze({NONE:"NONE",MIDDLE_TO_MIDDLE:"MIDDLE_TO_MIDDLE",AVOID_OVERLAP:"AVOID_OVERLAP",values(){return[this.NONE,this.MIDDLE_TO_MIDDLE,this.AVOID_OVERLAP]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var V=class{};V.ALGORITHM_ID="org.eclipse.elk.mrtree";V.SEARCH_ORDER=new m("org.eclipse.elk.mrtree.searchOrder",ur.DFS);V.DIRECTION=new m("org.eclipse.elk.direction",R.UNDEFINED);V.ASPECT_RATIO=new m("org.eclipse.elk.aspectRatio",1.6);V.PADDING=new m("org.eclipse.elk.padding",new yt(20));V.SEPARATE_CONNECTED_COMPONENTS=new m("org.eclipse.elk.separateConnectedComponents",!0);V.PRIORITY=new m("org.eclipse.elk.priority",1);V.SPACING_NODE_NODE=new m("org.eclipse.elk.spacing.nodeNode",20,0);V.SPACING_EDGE_NODE=new m("org.eclipse.elk.spacing.edgeNode",3,0);V.OMIT_NODE_MICRO_LAYOUT=So;V.RANDOM_SEED=Pu;V.WEIGHTING=new m("org.eclipse.elk.mrtree.weighting",je.MODEL_ORDER);V.DEBUG_MODE=new m("org.eclipse.elk.debugMode",!1);V.POSITION_CONSTRAINT=new m("org.eclipse.elk.mrtree.positionConstraint",-1);V.EDGE_ROUTING_MODE=new m("org.eclipse.elk.mrtree.edgeRoutingMode",ms.AVOID_OVERLAP);V.TREE_LEVEL=new m("org.eclipse.elk.mrtree.treeLevel",0);V.EDGE_END_TEXTURE_LENGTH=new m("org.eclipse.elk.mrtree.edgeEndTextureLength",7);V.COMPACTION=new m("org.eclipse.elk.mrtree.compaction",!1);var nc=class{constructor(){this._incidence=null,this._visited=null}_initialize(t){let e=t.getNodes().length;this._incidence=new Array(e),this._visited=new Array(e).fill(!1);for(let o of t.getNodes())this._incidence[o.id]=[];for(let o of t.getEdges())this._incidence[o.getSource().id].push(o),this._incidence[o.getTarget().id].push(o)}split(t){let e=t.getProperty(V.SEPARATE_CONNECTED_COMPONENTS);if(e==null||e===!0){this._initialize(t);let o=[];for(let r of t.getNodes()){let i=this._dfs(r,null);i!=null&&(i.copyProperties(t),o.push(i))}if(this._incidence=null,this._visited=null,o.length>1)for(let r of o){let i=0;for(let s of r.getNodes())s.id=i++}return o}return[t]}_dfs(t,e){if(!this._visited[t.id]){this._visited[t.id]=!0;let o=e!=null?e:new qr;o.getNodes().push(t);for(let r of this._incidence[t.id])r.getSource()!==t&&this._dfs(r.getSource(),o),r.getTarget()!==t&&this._dfs(r.getTarget(),o),r.getSource()===t&&o.getEdges().push(r);return o}return null}pack(t){var d,f;if(t.length===1)return this._applyPaddingAndNormalizePositions(t[0]),t[0];if(t.length<=0)return new qr;for(let E of t){let P=0,S=Number.POSITIVE_INFINITY,T=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(let C of E.getNodes())P+=(d=C.getProperty(V.PRIORITY))!=null?d:0,S=Math.min(S,C.getPosition().x),T=Math.min(T,C.getPosition().y),N=Math.max(N,C.getPosition().x+C.getSize().x),I=Math.max(I,C.getPosition().y+C.getSize().y);E.setProperty(V.PRIORITY,P),E.setProperty(L.BB_UPLEFT,new O(S,T)),E.setProperty(L.BB_LOWRIGHT,new O(N,I))}t.sort((E,P)=>{var T,N;let S=((T=P.getProperty(V.PRIORITY))!=null?T:0)-((N=E.getProperty(V.PRIORITY))!=null?N:0);if(S===0){let I=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT)),C=P.getProperty(L.BB_LOWRIGHT).clone().sub(P.getProperty(L.BB_UPLEFT));return I.x*I.y-C.x*C.y}return S});let e=new qr;e.copyProperties(t[0]);let o=0,r=0;for(let E of t){let P=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT));o=Math.max(o,P.x),r+=P.x*P.y}o=Math.max(o,Math.sqrt(r)*((f=e.getProperty(V.ASPECT_RATIO))!=null?f:1));let i=e.getProperty(V.SPACING_NODE_NODE),s=0,a=0,l=0,c=i;for(let E of t){let P=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT));s+P.x>o&&(s=0,a+=l+i,l=0),this._moveGraph(e,E,s,a),c=Math.max(c,s+P.x),l=Math.max(l,P.y),s+=P.x+i}let g=new Map,h=new Map;for(let E of t){let P=E.getProperty(Ks),S=E.getAllProperties();for(let[T,N]of S)g.has(T)?T.getDefault()!==N&&(P&&h.has(T)||(g.set(T,N),e.setProperty(T,N),P&&h.set(T,N))):(g.set(T,N),e.setProperty(T,N))}return rT(e),this._applyPaddingAndNormalizePositions(e),e}_applyPaddingAndNormalizePositions(t){let e=t.getProperty(V.PADDING);t.setProperty(L.BB_UPLEFT,new O(0,0)),this._moveGraph(new qr,t,e.getLeft()-t.getProperty(L.GRAPH_XMIN),e.getTop()-t.getProperty(L.GRAPH_YMIN))}_moveGraph(t,e,o,r){let i=new O(o,r);i.sub(e.getProperty(L.BB_UPLEFT));for(let a of e.getNodes())a.getPosition().add(i),t.getNodes().push(a);let s=new Set;for(let a of e.getEdges())if(!s.has(a)){s.add(a);for(let l of a.getBendPoints())l.add(i);t.getEdges().push(a)}}};function rT(n){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let i of n.getNodes()){let s=i.getPosition(),a=i.getSize();t=Math.min(t,s.x),e=Math.min(e,s.y),o=Math.max(o,s.x+a.x),r=Math.max(r,s.y+a.y)}n.getNodes().length===0&&(t=e=o=r=0),n.setProperty(L.GRAPH_XMIN,t),n.setProperty(L.GRAPH_YMIN,e),n.setProperty(L.GRAPH_XMAX,o),n.setProperty(L.GRAPH_YMAX,r)}var sn=class extends ge{constructor(t=0){super(),this.id=t}};var nn=class extends sn{constructor(t,e){super(),this._source=t,this._target=e,this._labels=[],this._bendPoints=new st}getSource(){return this._source}setSource(t){if(this._source!==t){if(this._source!=null){let e=this._source.getOutgoingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}t!=null&&!t.getOutgoingEdges().includes(this)&&t.getOutgoingEdges().push(this),this._source=t}}getTarget(){return this._target}setTarget(t){if(this._target!==t){if(this._target!=null){let e=this._target.getIncomingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}t!=null&&!t.getIncomingEdges().includes(this)&&t.getIncomingEdges().push(this),this._target=t}}getLabels(){return this._labels}getBendPoints(){return this._bendPoints}toString(){return this._source!=null&&this._target!=null?`${this._source}->${this._target}`:`e_${this.id}`}};var ac=class extends sn{constructor(t=0){super(t),this._pos=new O,this._size=new O}getPosition(){return this._pos}getSize(){return this._size}};var Ps=class extends ac{constructor(t,e,o){super(t),this._graph=e,this._label=o!=null?o:null,this._outgoingEdges=[],this._incomingEdges=[]}getLabel(){return this._label}setLabel(t){this._label=t}*getParents(){for(let t of this.getIncomingEdges())yield t.getSource()}getParent(){let t=this.getIncomingEdges();return t.length===0?null:t[0].getSource()}getChildrenCopy(){let t=[];for(let e of this.getOutgoingEdges())t.push(e.getTarget());return t}*getChildren(){for(let t of this.getOutgoingEdges())yield t.getTarget()}getOutgoingEdges(){return this._outgoingEdges==null&&(this._outgoingEdges=[]),this._outgoingEdges}getIncomingEdges(){return this._incomingEdges==null&&(this._incomingEdges=[]),this._incomingEdges}addChild(t){let e=new nn(this,t);e.setProperty(L.DUMMY,!0),this._graph.getEdges().push(e),this.getOutgoingEdges().push(e),t.getIncomingEdges().push(e)}isLeaf(){return this.getOutgoingEdges().length===0}toString(){return this._label==null||this._label.length===0?`n_${this.id}`:`n_${this._label}`}};var lc=class{importGraph(t){let e=new qr;e.copyProperties(t),e.setProperty(L.ORIGIN,t);let o=new Map;return this._transformNodes(t,e,o),this._transformEdges(t,e,o),e}_transformNodes(t,e,o){let r=0;for(let i of t.children){let s="";i.labels.length>0&&(s=i.labels[0].getText());let a=new Ps(r++,e,s);a.copyProperties(i),a.setProperty(L.ORIGIN,i),a.getPosition().y=i.getY()+i.getHeight()/2,a.getSize().x=Math.max(i.getWidth(),1),a.getPosition().x=i.getX()+i.getWidth()/2,a.getSize().y=Math.max(i.getHeight(),1),e.getNodes().push(a),o.set(i,a)}}_transformEdges(t,e,o){for(let r of t.children)for(let i of Ee(r))if(!i.isHierarchical()&&!i.isSelfloop()){let s=o.get(r),a=o.get(Pt(i.targets[0]));if(s!=null&&a!=null){let l=new nn(s,a);l.setProperty(L.ORIGIN,i),l.copyProperties(i),s.getOutgoingEdges().push(l),a.getIncomingEdges().push(l),e.getEdges().push(l)}}}applyLayout(t){let e=t.getProperty(L.ORIGIN),o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let g of t.getNodes()){let h=g.getPosition(),d=g.getSize();o=Math.min(o,h.x-d.x/2),r=Math.min(r,h.y-d.y/2),i=Math.max(i,h.x+d.x/2),s=Math.max(s,h.y+d.y/2)}let a=e.getProperty(V.PADDING);for(let g of t.getNodes()){let h=g.getProperty(L.ORIGIN);h!=null&&h.children!==void 0&&(h.setLocation(g.getPosition().x,g.getPosition().y),h.copyProperties(g))}for(let g of t.getEdges()){let h=g.getProperty(L.ORIGIN);if(h!=null){let d=g.getBendPoints(),f=ar(h,!0,!0);Xs(d,f)}}let l=i-o+a.getHorizontal(),c=s-r+a.getVertical();e.getProperty(To)||Ae(e,l,c,!1,!1),e.setProperty(pi,l-a.getHorizontal()),e.setProperty(Ei,c-a.getVertical())}static _toNodeBorder(t,e,o){let r=o.x/2,i=o.y/2,s=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y),l=1,c=1;s>r&&(l=r/s),a>i&&(c=i/a);let g=Math.min(l,c);t.x+=g*(e.x-t.x),t.y+=g*(e.y-t.y)}};var an=class{constructor(){this._list=[]}provideDefault(){throw new Error(`${this.constructor.name}.provideDefault() is not implemented`)}getListItem(t){if(t<0)throw new RangeError(`Invalid index: ${t}`);return this._ensureListSize(t+1),this._list[t]}setListItem(t,e){if(t<0)throw new RangeError(`Invalid index: ${t}`);t<this._list.length?this._list[t]=e:(this._ensureListSize(t),this._list.push(e))}getListSize(){return this._list.length}clearList(){this._list.length=0}_ensureListSize(t){for(;this._list.length<t;)this._list.push(this.provideDefault())}};var cc=class{compare(t,e){return t.ordinal-e.ordinal}};var K=class n extends an{constructor(){super(),this._currentIndex=-1}static create(){return new n}static createFrom(t){return new n().addAll(t)}clear(){return this.clearList(),this._currentIndex=-1,this}before(t){return this._currentIndex=t.ordinal,this}after(t){return this._currentIndex=t.ordinal+1,this}add(t){if(this._currentIndex<0)throw new Error("Did not call before(...) or after(...) before calling add(...).");return this._doAdd(this._currentIndex,t),this}addBefore(t,e){return this._currentIndex=-1,this._doAdd(t.ordinal,e),this}addAfter(t,e){return this._currentIndex=-1,this._doAdd(t.ordinal+1,e),this}_doAdd(t,e){this.getListItem(t).add(e)}addAll(t){for(let e=0;e<t.getListSize();e++){let o=this.getListItem(e);for(let r of t.getListItem(e))o.add(r)}return this}processorsBefore(t){return this._processors(t.ordinal)}processorsAfter(t){return this._processors(t.ordinal+1)}_processors(t){return new Set(this.getListItem(t))}provideDefault(){return new Set}};var Io=class n extends an{static create(t){return new n(t)}constructor(t){if(super(),!t||t.length===0)throw new Error("There must be at least one phase in the phase enumeration.");this._phaseEnumConstants=t,this._numberOfPhases=t.length,this._enableCaching=!0,this._failOnMissingPhase=!0,this._processorComparator=new cc,this._configuredPhases=new Set,this._additionalProcessors=K.create(),this._cache=new Map}withCaching(t){return this._enableCaching=t,this}withFailOnMissingPhase(t){return this._failOnMissingPhase=t,this}withProcessorComparator(t){return this._processorComparator=t,this}clearCache(){return this._cache.clear(),this}reset(){return this.clearList(),this._configuredPhases.clear(),this._additionalProcessors.clear(),this}setPhase(t,e){return this.setListItem(t.ordinal,e),this._configuredPhases.add(t),this}addProcessorConfiguration(t){return this._additionalProcessors.addAll(t),this}build(t){if(this._failOnMissingPhase&&this._configuredPhases.size<this._numberOfPhases)throw new Error(`Expected ${this._numberOfPhases} phases to be configured; only found ${this._configuredPhases.size}`);let e=this._phaseEnumConstants,o=[];for(let a of e){let l=this.getListItem(a.ordinal);o.push(l!=null?this._retrievePhase(l):null)}let r=K.create();for(let a of o){if(a==null)continue;let l=a.getLayoutProcessorConfiguration(t);l!=null&&r.addAll(l)}r.addAll(this._additionalProcessors);let i=[];for(let a of e){for(let c of this._retrieveProcessors(r.processorsBefore(a)))i.push(c);let l=o[a.ordinal];l!=null&&i.push(l)}let s=e[e.length-1];for(let a of this._retrieveProcessors(r.processorsAfter(s)))i.push(a);return i}provideDefault(){return null}_retrieveProcessors(t){return[...t].sort((o,r)=>this._processorComparator.compare(o,r)).map(o=>this._retrieveProcessor(o))}_retrievePhase(t){return this._retrieveProcessor(t)}_retrieveProcessor(t){if(this._enableCaching){if(this._cache.has(t))return this._cache.get(t);let e=t.create();return this._cache.set(t,e),e}return t.create()}};var Ie=class n{constructor(t=-1){this._parentMonitor=null,this._children=[],this._maxLevels=t<0?-1:t,this._taskName=null,this._closed=!1,this._totalWork=0,this._completedWork=0,this._currentChildWork=-1,this._recordLogs=!1,this._logMessages=null,this._recordExecutionTime=!1,this._startTime=0,this._totalTime=0}withMaxHierarchyLevels(t){return this._maxLevels=t<0?-1:t,this}withLogging(t){return this._recordLogs=t,this._logMessages=t?[]:null,this}withLogPersistence(t){return this}withExecutionTimeMeasurement(t){return this._recordExecutionTime=t,this}begin(t,e){if(this._closed)throw new Error("The task is already done.");if(this._taskName!==null)return!1;if(t==null)throw new Error("Task name must not be null.");return this._taskName=t,this._totalWork=e,this._doBegin(t,e,this._parentMonitor===null,this._maxLevels),this._recordExecutionTime&&(this._startTime=performance.now()),!0}_doBegin(t,e,o,r){}worked(t){t>0&&!this._closed&&this._internalWorked(t)}_internalWorked(t){this._totalWork>0&&this._completedWork<this._totalWork&&(this._completedWork+=t,this._doWorked(this._completedWork,this._totalWork,this._parentMonitor===null),this._parentMonitor!==null&&this._parentMonitor._currentChildWork>0&&this._maxLevels!==0&&this._parentMonitor._internalWorked(t/this._totalWork*this._parentMonitor._currentChildWork))}_doWorked(t,e,o){}done(){if(this._taskName===null)throw new Error("The task has not begun yet.");this._closed||(this._recordExecutionTime&&(this._totalTime=(performance.now()-this._startTime)/1e3),this._completedWork<this._totalWork&&this._internalWorked(this._totalWork-this._completedWork),this._doDone(this._parentMonitor===null,this._maxLevels),this._closed=!0)}_doDone(t,e){}isRunning(){return this._taskName!==null&&!this._closed}isCanceled(){return!1}getTaskName(){return this._taskName}subTask(t){if(!this._closed){let e=this._doSubTask(t,this._maxLevels);return this._children.push(e),e._parentMonitor=this,this._currentChildWork=t,e}return null}_doSubTask(t,e){let o=e>0?e-1:e;return new n().withMaxHierarchyLevels(o).withLogging(this._recordLogs).withExecutionTimeMeasurement(this._recordExecutionTime)}getSubMonitors(){return this._children}getParentMonitor(){return this._parentMonitor}isLoggingEnabled(){return this._recordLogs}isLogPersistenceEnabled(){return!1}log(t){this._recordLogs&&t!==null&&t!==void 0&&this._logMessages.push(String(t))}getLogs(){return this._logMessages}logGraph(t,e,o){}getLoggedGraphs(){return null}isExecutionTimeMeasured(){return this._recordExecutionTime}getExecutionTime(){return this._totalTime}};var gc=class{constructor(){this._roots=[]}process(t,e){e.begin("Find roots",1),this._roots.length=0;for(let o of t.getNodes())o.getIncomingEdges().length===0&&(o.setProperty(L.ROOT,!0),this._roots.push(o));switch(this._roots.length){case 0:{let o=new Ps(0,t,"DUMMY_ROOT");o.setProperty(L.ROOT,!0),o.setProperty(L.DUMMY,!0),t.getNodes().push(o);break}case 1:break;default:{let o=new Ps(0,t,"SUPER_ROOT");for(let r of this._roots)o.addChild(r),r.setProperty(L.ROOT,!1);o.setProperty(L.ROOT,!0),o.setProperty(L.DUMMY,!0),t.getNodes().push(o);break}}e.done()}};var hc=class n{constructor(){this._gloFanMap=new Map,this._gloDescMap=new Map}process(t,e){var r,i;e.begin("Processor compute fanout",1),this._gloFanMap.clear(),this._gloDescMap.clear();let o=null;for(let s of t.getNodes())if(s.getProperty(L.ROOT)){o=s;break}if(o==null){e.done();return}this._calculateFan([o]);for(let s of t.getNodes()){let a=s.getProperty(L.ID),l=(r=this._gloFanMap.get(a))!=null?r:0;s.setProperty(L.FAN,l);let c=1+((i=this._gloDescMap.get(a))!=null?i:0);s.setProperty(L.DESCENDANTS,c)}e.done()}_calculateFan(t){var e,o;if(t.length>0){let r=[],i=null,s=null,a=Math.floor(Math.log10(t.length))+1,l=0;for(let g of t){s!==g.getProperty(L.ID)&&(s=g.getProperty(L.ID),l=0),s!=null?i=s+n.formatRight(l++,a):i=n.formatRight(l++,a),g.setProperty(L.ID,i);for(let h of g.getChildren())r.push(h),h.setProperty(L.ID,i)}let c=new Map;for(let g=0;g<(i!=null?i:"").length-a;g++)for(let h of t){let d=h.getProperty(L.ID).substring(0,g+1),f=((e=c.get(d))!=null?e:0)+1;c.set(d,f)}for(let[g,h]of c){let d=(o=this._gloDescMap.get(g))!=null?o:0;this._gloDescMap.set(g,h+d);let f=this._gloFanMap.get(g);(f==null||f<h)&&this._gloFanMap.set(g,h)}this._calculateFan(r)}}static formatRight(t,e){let o=`${t}`;for(;o.length<e;)o=`0${o}`;return o}};var dc=class{constructor(){this._gloLevelMap=new Map}process(t,e){var r;e.begin("Processor compute fanout",1);let o=t.getNodes().filter(i=>i.getProperty(L.ROOT));this._setLevel(o,0);for(let i of t.getNodes()){let s=(r=this._gloLevelMap.get(i.id))!=null?r:0;i.setProperty(V.TREE_LEVEL,s)}e.done()}_setLevel(t,e){if(t.length>0){let o=[];for(let r of t){this._gloLevelMap.set(r.id,e);for(let i of r.getChildren())o.push(i)}this._setLevel(o,e+1)}}};var fc=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor set neighbors",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let r of t.getNodes())if(r.getProperty(L.ROOT)){o=r;break}o!=null&&this._setNeighbors([...o.getChildren()],e),e.done()}_setNeighbors(t,e){if(t.length>0){let o=typeof e.subTask=="function"?e.subTask(t.length/this._numberOfNodes):e;o.begin("Set neighbors in level",1);let r=[],i=null;for(let s of t){for(let a of s.getChildren())r.push(a);i!=null&&(i.setProperty(L.RIGHTNEIGHBOR,s),s.setProperty(L.LEFTNEIGHBOR,i),s.getParent()===i.getParent()&&(i.setProperty(L.RIGHTSIBLING,s),s.setProperty(L.LEFTSIBLING,i))),i=s}o.done(),this._setNeighbors(r,e)}}};var uc=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor determine the height for each level",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let r of t.getNodes())if(r.getProperty(L.ROOT)){o=r;break}o!=null&&this._setLevelHeight([o],e,t.getProperty(V.DIRECTION)),e.done()}_setLevelHeight(t,e,o){if(t.length>0){let r=typeof e.subTask=="function"?e.subTask(t.length/this._numberOfNodes):e;r.begin("Set neighbors in level",1);let i=[],s=0;if(o.isHorizontal())for(let a of t){for(let l of a.getChildren())i.push(l);s<a.getSize().x&&(s=a.getSize().x)}else for(let a of t){for(let l of a.getChildren())i.push(l);s<a.getSize().y&&(s=a.getSize().y)}for(let a of t)a.setProperty(L.LEVELHEIGHT,s);r.done(),this._setLevelHeight(i,e,o)}}};var _c=class{process(t,e){e.begin("Processor determine the coords for each level",1);let o=[],r=t.getProperty(V.DIRECTION).isHorizontal();for(let i of t.getNodes()){let s=i.getProperty(V.TREE_LEVEL);for(;s>o.length-1;)o.push(new Gt(Number.MAX_VALUE,-Number.MAX_VALUE));let a=o[s];r?(i.getPosition().x<a.getFirst()&&a.setFirst(i.getPosition().x),i.getPosition().x+i.getSize().x>a.getSecond()&&a.setSecond(i.getPosition().x+i.getSize().x)):(i.getPosition().y<a.getFirst()&&a.setFirst(i.getPosition().y),i.getPosition().y+i.getSize().y>a.getSecond()&&a.setSecond(i.getPosition().y+i.getSize().y))}for(let i of t.getNodes()){let s=i.getProperty(V.TREE_LEVEL);i.setProperty(L.LEVELMIN,o[s].getFirst()),i.setProperty(L.LEVELMAX,o[s].getSecond())}e.done()}};var pc=class{process(t,e){e.begin("Process directions",1);let o=t.getProperty(V.DIRECTION);if(o!==R.DOWN)for(let r of t.getNodes()){let i=r.getProperty(L.XCOOR),s=r.getProperty(L.YCOOR);switch(o){case R.UP:s=-s;break;case R.RIGHT:{let a=i;i=s,s=a;break}case R.LEFT:{let a=i;i=-s,s=a;break}}r.setProperty(L.XCOOR,i),r.setProperty(L.YCOOR,s)}e.done()}};var Ec=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor set coordinates",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let s of t.getNodes())if(s.getProperty(L.ROOT)){o=s;let a=s.getPosition();a.x=s.getProperty(L.XCOOR),a.y=s.getProperty(L.YCOOR);break}if(o==null){e.done();return}let r=o.getChildrenCopy(),i=1;do{let s=typeof e.subTask=="function"?e.subTask(i):e;r=this._setCoordinates(r,s),i=r.length/this._numberOfNodes}while(r.length>0);for(let s of t.getNodes())s.getPosition().sub(new O(s.getSize().x/2,s.getSize().y/2));e.done()}_setCoordinates(t,e){if(t.length>0){let o=[];for(let r of t){for(let s of r.getChildrenCopy())o.push(s);let i=r.getPosition();i.x=r.getProperty(L.XCOOR),i.y=r.getProperty(L.YCOOR)}return o}return[]}};var Ro=class n{static getRoot(t){for(let e of t.getNodes())if(e.getProperty(L.ROOT))return e;throw new Error("No root found in tree graph.")}static depth(t){let e=n.getChildren(t);if(e.length===0)return 1;let o=0;for(let r of e)o=Math.max(o,n.depth(r));return o+1}static getChildren(t){let e=new Set,o=[];for(let r of t.getOutgoingEdges()){let i=r.getTarget();e.has(i)||(e.add(i),o.push(i))}return o}static getLeftMost(t,e=-1){let o=[...t];if(o.length>0){let r=e;if(r>1){r--;let i=[];for(let s of o)for(let a of s.getChildren())i.push(a);return n.getLeftMost(i,r)}if(r<0){let i=[];for(let s of o)for(let a of s.getChildren())i.push(a);if(i.length>0)return n.getLeftMost(i,r)}}return o.length>0?o[0]:null}static getDirection(t){return t.getProperty(V.DIRECTION)}static getDirectionVector(t){return t===R.UP?new O(0,-1):t===R.RIGHT?new O(1,0):t===R.LEFT?new O(-1,0):new O(0,1)}static getLowestParent(t,e){let o=n.getDirectionVector(n.getDirection(e)),r=t.getIncomingEdges();if(r.length===0)return null;let i=new Set;for(let g of r)i.add(g.getSource());let s=e.getNodes().filter(g=>i.has(g));if(s.length===0)return null;let a=g=>new O(g.getPosition().x+g.getSize().x/2,g.getPosition().y+g.getSize().y/2).dotProduct(o),l=s[0],c=a(s[0]);for(let g=1;g<s.length;g++){let h=a(s[g]);h>c&&(l=s[g],c=h)}return l}static getFirstPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getTarget().getPosition().x,t.getTarget().getPosition().y):e.getFirst()}static getLastPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getSource().getPosition().x,t.getSource().getPosition().y):e.getLast()}static isCycleInducing(t,e){let o=n.getDirectionVector(n.getDirection(e)),r=t.getTarget().getPosition().x-t.getSource().getPosition().x,i=t.getTarget().getPosition().y-t.getSource().getPosition().y;return o.x*r+o.y*i<=0}static getAllOutgoingEdges(t,e){let o=[];for(let r of e.getEdges())r.getSource()===t&&o.push(r);return o}static getAllIncomingEdges(t,e){let o=[];for(let r of e.getEdges())r.getTarget()===t&&o.push(r);return o}static getUniqueLong(t,e){return t+","+e}static toNodeBorder(t,e,o){let r=o.x/2,i=o.y/2,s=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y),l=1,c=1;s>r&&(l=r/s),a>i&&(c=i/a);let g=Math.min(l,c);t.x+=g*(e.x-t.x),t.y+=g*(e.y-t.y)}};var Os=class n{constructor(t,e,o){this._first=t,this._second=e,this._third=o}getFirst(){return this._first}getSecond(){return this._second}getThird(){return this._third}equals(t){return t instanceof n?ku(this._first,t._first)&&ku(this._second,t._second)&&ku(this._third,t._third):!1}toString(){return`(${this._first}, ${this._second}, ${this._third})`}};function ku(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):!1}var mc=class{constructor(){this._levels=[]}process(t,e){if(e.begin("Process compaction",1),!t.getProperty(V.COMPACTION)){e.done();return}let o=t.getProperty(V.DIRECTION),r=t.getProperty(V.SPACING_NODE_NODE);this._setUpLevels(t,o),this._computeNodeConstraints(t,r/2/2);let i=Ro.getDirectionVector(o),s=[...t.getNodes()].sort((a,l)=>{let c=i.dotProduct(new O(a.getPosition().x,a.getPosition().y)),g=i.dotProduct(new O(l.getPosition().x,l.getPosition().y));return c-g});for(let a of s){if(a.getProperty(L.ROOT))continue;let l=this._getLowestDependentNode(a,o),c=Ro.getLowestParent(a,t),g=0,h=0;if(l!=null){let d=l.getPosition();switch(o){case R.LEFT:g=d.x-r-a.getSize().x,c.getPosition().x-r-a.getSize().x<g&&(g=c.getPosition().x-r-a.getSize().x),h=g+a.getSize().x;break;case R.RIGHT:g=d.x+l.getSize().x+r,c.getPosition().x+r>g&&(g=c.getPosition().x+c.getSize().x+r),h=g+a.getSize().x;break;case R.UP:g=d.y-r-a.getSize().y,c.getPosition().y-r-a.getSize().y<g&&(g=c.getPosition().y-r-a.getSize().y),h=g+a.getSize().y;break;case R.DOWN:g=d.y+l.getSize().y+r,c.getPosition().y+r>g&&(g=c.getPosition().y+c.getSize().y+r),h=g+a.getSize().y;break}}else if(c!=null)switch(o){case R.LEFT:g=c.getPosition().x-r-a.getSize().x,h=g+a.getSize().x;break;case R.RIGHT:g=c.getPosition().x+c.getSize().x+r,h=g+a.getSize().x;break;case R.UP:g=c.getPosition().y-r-a.getSize().y,h=g+a.getSize().y;break;case R.DOWN:g=c.getPosition().y+c.getSize().y+r,h=g+a.getSize().y;break}if(t.getProperty(V.EDGE_ROUTING_MODE)===ms.AVOID_OVERLAP){let d=this._levels.find(f=>f.getFirst()<=g&&f.getSecond()>=h);if(d!=null)o.isHorizontal()?a.getPosition().x=g:a.getPosition().y=g;else{let f=this._levels.slice(1);o===R.LEFT||o===R.UP?d=f.find(E=>E.getFirst()<=g):d=f.find(E=>E.getFirst()>=g),d!=null&&(o.isHorizontal()?a.getPosition().x=d.getFirst():a.getPosition().y=d.getFirst())}if(d!=null){let f=this._levels.indexOf(d);f>0&&f!==a.getProperty(V.TREE_LEVEL)&&(a.setProperty(L.COMPACT_LEVEL_ASCENSION,!0),a.setProperty(V.TREE_LEVEL,f))}}else o.isHorizontal()?a.getPosition().x=g:a.getPosition().y=g}e.done()}_setUpLevels(t,e){this._levels=[];for(let o of t.getNodes()){for(;o.getProperty(V.TREE_LEVEL)>this._levels.length-1;)this._levels.push(new Gt(Number.MAX_VALUE,-Number.MAX_VALUE));let r=o.getProperty(V.TREE_LEVEL),i=this._levels[r];e.isHorizontal()?(o.getPosition().x<i.getFirst()&&i.setFirst(o.getPosition().x),o.getPosition().x+o.getSize().x>i.getSecond()&&i.setSecond(o.getPosition().x+o.getSize().x)):(o.getPosition().y<i.getFirst()&&i.setFirst(o.getPosition().y),o.getPosition().y+o.getSize().y>i.getSecond()&&i.setSecond(o.getPosition().y+o.getSize().y))}}_computeNodeConstraints(t,e){let o=t.getProperty(V.DIRECTION),r=o.isHorizontal()?R.DOWN:R.RIGHT,i=Ro.getDirectionVector(o),s=Ro.getDirectionVector(r),a=t.getNodes().filter(h=>{let d=typeof h.getLabel=="function"?h.getLabel():"";return!(d!=null&&d.includes("SUPER_ROOT"))}),l=[];for(let h of a){let d=h.getPosition().clone();d.sub(e,e),l.push(new Os(h,d,!0))}for(let h of a){let d=h.getPosition().clone();d.add(h.getSize().x+e,h.getSize().y+e),l.push(new Os(h,d,!1))}l.sort((h,d)=>s.dotProduct(h.getSecond().clone())-s.dotProduct(d.getSecond().clone()));let c=new Wu((h,d)=>i.dotProduct(h.getPosition().clone())-i.dotProduct(d.getPosition().clone())),g=new Map;for(let h of l){let d=h.getFirst();if(h.getThird()){c.add(d);let f=c.headSet(d);f.length>0&&g.set(d,f[f.length-1]),c.tailSet(d).length>1&&g.set(this._getRightElement(c,d),d)}else{let f=c.headSet(d);if(f.length>0){let P=f[f.length-1];P===g.get(d)&&d.getProperty(L.COMPACT_CONSTRAINTS).push(P)}if(c.tailSet(d).length>1){let P=this._getRightElement(c,d);g.get(P)===d&&P.getProperty(L.COMPACT_CONSTRAINTS).push(d)}c.remove(d)}}}_getRightElement(t,e){let o=t.tailSet(e);if(o.length<=1)throw new Error("NullPointerException: no right element");return o[1]}_getLowestDependentNode(t,e){let o=t.getProperty(L.COMPACT_CONSTRAINTS);if(o==null||o.length<1)return null;if(o.length===1)return o[0];let r=o[0];switch(e){case R.LEFT:for(let i of o)i.getPosition().x<r.getPosition().x&&(r=i);break;case R.RIGHT:for(let i of o)i.getPosition().x+i.getSize().x>r.getPosition().x+r.getSize().x&&(r=i);break;case R.UP:for(let i of o)i.getPosition().y<r.getPosition().y&&(r=i);break;case R.DOWN:for(let i of o)i.getPosition().y+i.getSize().y>r.getPosition().y+r.getSize().y&&(r=i);break}return r}},Wu=class{constructor(t){this._compare=t,this._items=[]}add(t){this._items.push(t),this._items.sort(this._compare)}remove(t){let e=this._items.indexOf(t);e>=0&&this._items.splice(e,1)}headSet(t){let e=this._items.indexOf(t);if(e<0){let o=0;for(;o<this._items.length&&this._compare(this._items[o],t)<0;)o++;return this._items.slice(0,o)}return this._items.slice(0,e)}tailSet(t){let e=this._items.indexOf(t);if(e<0){let o=0;for(;o<this._items.length&&this._compare(this._items[o],t)<0;)o++;return this._items.slice(o)}return this._items.slice(e)}};var Pc=class{process(t,e){e.begin("Process graph bounds",1);let o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let a of t.getNodes()){let l=a.getPosition(),c=a.getSize();l.x<o&&(o=l.x),l.y<r&&(r=l.y),l.x+c.x>i&&(i=l.x+c.x),l.y+c.y>s&&(s=l.y+c.y)}t.setProperty(L.GRAPH_XMIN,o),t.setProperty(L.GRAPH_YMIN,r),t.setProperty(L.GRAPH_XMAX,i),t.setProperty(L.GRAPH_YMAX,s),e.done()}};var Oc=class{process(t,e){e.begin("Untreeify",1);let o=t.getProperty(L.REMOVABLE_EDGES);for(let r of o)r.getSource().getOutgoingEdges().push(r),r.getTarget().getIncomingEdges().push(r);e.done()}};var pt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.ROOT_PROC:return new gc;case n.FAN_PROC:return new hc;case n.LEVEL_PROC:return new dc;case n.NEIGHBORS_PROC:return new fc;case n.LEVEL_HEIGHT:return new uc;case n.LEVEL_COORDS:return new _c;case n.DIRECTION_PROC:return new pc;case n.NODE_POSITION_PROC:return new Ec;case n.COMPACTION_PROC:return new mc;case n.GRAPH_BOUNDS_PROC:return new Pc;case n.DETREEIFYING_PROC:return new Oc;default:throw new Error(`No implementation available for processor ${this}`)}}};pt.ROOT_PROC=new pt("ROOT_PROC",0);pt.FAN_PROC=new pt("FAN_PROC",1);pt.LEVEL_PROC=new pt("LEVEL_PROC",2);pt.NEIGHBORS_PROC=new pt("NEIGHBORS_PROC",3);pt.LEVEL_HEIGHT=new pt("LEVEL_HEIGHT",4);pt.DIRECTION_PROC=new pt("DIRECTION_PROC",5);pt.NODE_POSITION_PROC=new pt("NODE_POSITION_PROC",6);pt.COMPACTION_PROC=new pt("COMPACTION_PROC",7);pt.LEVEL_COORDS=new pt("LEVEL_COORDS",8);pt.GRAPH_BOUNDS_PROC=new pt("GRAPH_BOUNDS_PROC",9);pt.DETREEIFYING_PROC=new pt("DETREEIFYING_PROC",10);pt.VALUES=[pt.ROOT_PROC,pt.FAN_PROC,pt.LEVEL_PROC,pt.NEIGHBORS_PROC,pt.LEVEL_HEIGHT,pt.DIRECTION_PROC,pt.NODE_POSITION_PROC,pt.COMPACTION_PROC,pt.LEVEL_COORDS,pt.GRAPH_BOUNDS_PROC,pt.DETREEIFYING_PROC];var Sc=class{constructor(){this._visited=null,this._eliminated=null}process(t,e){e.begin("DFS Treeifying phase",1),this._init(t),this._collectEdges(t),this._eliminated=null,this._visited=null,e.done()}getLayoutProcessorConfiguration(){return K.create().addAfter(Mt.P3_NODE_PLACEMENT,pt.DETREEIFYING_PROC)}_init(t){let e=t.getNodes().length;this._eliminated=[],this._visited=new Array(e).fill(0);let o=0;for(let r of t.getNodes())r.id=o++}_collectEdges(t){let e=t.getProperty(V.SEARCH_ORDER);for(let o of t.getNodes())if(this._visited[o.id]===0){switch(e){case ur.DFS:this._dfs(o);break;case ur.BFS:this._bfs(o);break}this._visited[o.id]=2}for(let o of this._eliminated)SE(o.getSource().getOutgoingEdges(),o),SE(o.getTarget().getIncomingEdges(),o);t.setProperty(L.REMOVABLE_EDGES,this._eliminated)}_dfs(t){this._visited[t.id]=1;for(let e of t.getOutgoingEdges()){let o=e.getTarget();this._visited[o.id]===1?this._eliminated.push(e):this._visited[o.id]===2?this._visited[o.id]=1:this._dfs(o)}}_bfs(t){let e=[t];for(;e.length>0;){let o=e.shift();this._visited[o.id]=1;for(let r of o.getOutgoingEdges()){let i=r.getTarget();this._visited[i.id]===1?this._eliminated.push(r):this._visited[i.id]===2?this._visited[i.id]=1:e.push(i)}}}};function SE(n,t){let e=n.indexOf(t);e>=0&&n.splice(e,1)}function TE(n){return(t,e)=>{var o,r;return((o=t.getProperty(n))!=null?o:0)-((r=e.getProperty(n))!=null?r:0)}}var Tc=class{constructor(){this._weighting=null,this._debug=!1}getLayoutProcessorConfiguration(){return K.create().before(Mt.P2_NODE_ORDERING).add(pt.ROOT_PROC).add(pt.FAN_PROC).add(pt.LEVEL_PROC)}process(t,e){var i;e.begin("Processor arrange node",1),this._debug=t.getProperty(V.DEBUG_MODE),this._debug&&((i=e.log)==null||i.call(e,"NodeOrderer!"));let o=t.getNodes().find(s=>s.getProperty(L.ROOT));if(o==null){e.done();return}this._weighting=t.getProperty(V.WEIGHTING);let r=typeof e.subTask=="function"?e.subTask(1):e;this._weighting===je.FAN||this._weighting===je.DESCENDANTS?this._orderLevelFanDescendants([o],r):this._weighting===je.CONSTRAINT&&this._orderLevelConstraint([o],r),e.done()}_orderLevelFanDescendants(t,e){var g,h;e.begin("Processor arrange level",1);let o=L.FAN;this._weighting===je.DESCENDANTS&&(o=L.DESCENDANTS);let r=0;t.sort(TE(o));let i=t.length,s=!0,a=t.length-1;for(;s&&a>=0;)((g=t[a].getProperty(o))!=null?g:0)===0?i--:s=!1,a--;let l=t.slice(0,i),c=t.slice(i);if(l.length===0)for(let d of c)d.setProperty(L.POSITION,r++);else{let d=l.length;for(let f of l){f.setProperty(L.POSITION,r++);let E=f.getChildrenCopy(),P=typeof e.subTask=="function"?e.subTask(1/d):e;this._orderLevelFanDescendants(E,P),E.sort((I,C)=>{var x,M;return((x=C.getProperty(L.POSITION))!=null?x:0)-((M=I.getProperty(L.POSITION))!=null?M:0)});let S=[];for(let I of E)for(let C of f.getOutgoingEdges())C.getTarget()===I&&S.push(C);f.getOutgoingEdges().length=0;for(let I of S)f.getOutgoingEdges().push(I);let T=f.getOutgoingEdges().length,N=c.length-1;for(s=!0;T>0&&s&&N>=0;){let I=c[N];((h=I.getProperty(o))!=null?h:0)===0?(I.setProperty(L.POSITION,r++),T--,c.splice(N,1)):s=!1,N--}}}e.done()}_orderLevelConstraint(t,e){var l;e.begin("Processor arrange level",1),this._debug&&((l=e.log)==null||l.call(e,"OrderLevelConstraint!"));let o=t.filter(c=>{var g;return((g=c.getProperty(V.POSITION_CONSTRAINT))!=null?g:-1)<0}),r=t.filter(c=>{var h;let g=(h=c.getProperty(V.POSITION_CONSTRAINT))!=null?h:-1;return g<t.length&&g>=0}),i=t.filter(c=>{var g;return((g=c.getProperty(V.POSITION_CONSTRAINT))!=null?g:-1)>=t.length}),s=new Array(t.length).fill(null);for(let c=0;c<r.length;c++){let g=r[c],h=g.getProperty(V.POSITION_CONSTRAINT);h>=0&&h<r.length&&s[h]==null&&(s[h]=g,r.splice(c,1),c--)}for(let c=0;c<r.length;c++){let g=r[c],h=g.getProperty(V.POSITION_CONSTRAINT);for(let d=0;;d++){let f=h+d;if(f<s.length&&f>=0&&s[f]==null){s[f]=g,r.splice(c,1),c--;break}if(f=h-d,f<s.length&&f>=0&&s[f]==null){s[f]=g,r.splice(c,1),c--;break}}}i.sort((c,g)=>{var h,d;return-(((h=c.getProperty(V.POSITION_CONSTRAINT))!=null?h:0)-((d=g.getProperty(V.POSITION_CONSTRAINT))!=null?d:0))});for(let c=s.length-1;c>=0;c--)s[c]==null&&i.length>0&&(s[c]=i[0],i.splice(0,1));for(let c=0;c<s.length;c++)s[c]==null&&o.length>0&&(s[c]=o[0],o.splice(0,1));for(let c=0;c<s.length;c++)s[c].setProperty(L.POSITION,c);let a=t.filter(c=>{var g;return((g=c.getProperty(L.FAN))!=null?g:0)!==0});for(let c of a){let g=c.getChildrenCopy(),h=typeof e.subTask=="function"?e.subTask(1/a.length):e;this._orderLevelConstraint(g,h),g.sort(TE(L.POSITION));let d=[];for(let f of g)for(let E of c.getOutgoingEdges())E.getTarget()===f&&d.push(E);c.getOutgoingEdges().length=0;for(let f of d)c.getOutgoingEdges().push(f)}e.done()}};var Nc=class{constructor(){this._spacing=0,this._xTopAdjustment=0,this._yTopAdjustment=0,this._direction=R.UNDEFINED}getLayoutProcessorConfiguration(){return K.create().addBefore(Mt.P2_NODE_ORDERING,pt.ROOT_PROC).before(Mt.P3_NODE_PLACEMENT).add(pt.LEVEL_HEIGHT).add(pt.NEIGHBORS_PROC).before(Mt.P4_EDGE_ROUTING).add(pt.DIRECTION_PROC).add(pt.NODE_POSITION_PROC)}process(t,e){e.begin("Processor order nodes",2),this._spacing=t.getProperty(V.SPACING_NODE_NODE),this._direction=t.getProperty(V.DIRECTION),this._direction===R.UNDEFINED&&(this._direction=R.DOWN,t.setProperty(V.DIRECTION,this._direction));let o=[];for(let i of t.getNodes())i.getProperty(L.ROOT)&&o.push(i);let r=o[0];this._firstWalk(r,0),e.worked(1),this._secondWalk(r,this._yTopAdjustment-r.getProperty(L.LEVELHEIGHT)/2,this._xTopAdjustment),e.worked(1),e.done()}_firstWalk(t,e){var r;t.setProperty(L.MODIFIER,0);let o=t.getProperty(L.LEFTSIBLING);if(t.isLeaf())if(o!=null){let i=o.getProperty(L.PRELIM)+this._spacing+this._meanNodeWidth(o,t);t.setProperty(L.PRELIM,i)}else t.setProperty(L.PRELIM,0);else{for(let c of t.getChildren())this._firstWalk(c,e+1);let i=t.getChildrenCopy(),s=(r=i[0])!=null?r:null,l=((i.length>0?i[i.length-1]:null).getProperty(L.PRELIM)+s.getProperty(L.PRELIM))/2;if(o!=null){let c=o.getProperty(L.PRELIM)+this._spacing+this._meanNodeWidth(o,t);t.setProperty(L.PRELIM,c),t.setProperty(L.MODIFIER,t.getProperty(L.PRELIM)-l),this._apportion(t,e)}else t.setProperty(L.PRELIM,l)}}_apportion(t,e){var a,l;let r=(a=t.getChildrenCopy()[0])!=null?a:null,i=r!=null?r.getProperty(L.LEFTNEIGHBOR):null,s=1;for(;r!=null&&i!=null;){let c=0,g=0,h=r,d=i;for(let T=0;T<s;T++)h=h.getParent(),d=d.getParent(),g+=h.getProperty(L.MODIFIER),c+=d.getProperty(L.MODIFIER);let f=i.getProperty(L.PRELIM),E=r.getProperty(L.PRELIM),P=this._meanNodeWidth(r,i),S=f+c+this._spacing+P-E-g;if(S>0){let T=t,N=0;for(;T!=null&&T!==d;)N++,T=T.getProperty(L.LEFTSIBLING);if(T!=null){let I=S/N;for(T=t;T!==d;){let C=T.getProperty(L.PRELIM)+S;T.setProperty(L.PRELIM,C);let x=T.getProperty(L.MODIFIER)+S;T.setProperty(L.MODIFIER,x),S-=I,T=T.getProperty(L.LEFTSIBLING)}}else return}if(s++,r.isLeaf())r=Ro.getLeftMost(t.getChildren(),s);else{let T=[];for(let N of r.getChildren()){T.push(N);break}r=(l=T[0])!=null?l:null}i=r!=null?r.getProperty(L.LEFTNEIGHBOR):null}}_meanNodeWidth(t,e){let o=0;return t!=null&&(this._direction.isVertical()?o+=t.getSize().x/2:o+=t.getSize().y/2),e!=null&&(this._direction.isVertical()?o+=e.getSize().x/2:o+=e.getSize().y/2),o}_secondWalk(t,e,o){var r;if(t!=null){let i=t.getProperty(L.PRELIM)+o,s=e+t.getProperty(L.LEVELHEIGHT)/2;if(t.setProperty(L.XCOOR,Math.round(i)),t.setProperty(L.YCOOR,Math.round(s)),!t.isLeaf()){let a=[];for(let l of t.getChildren()){a.push(l);break}this._secondWalk((r=a[0])!=null?r:null,e+t.getProperty(L.LEVELHEIGHT)+this._spacing,o+t.getProperty(L.MODIFIER))}t.getProperty(L.RIGHTSIBLING)!=null&&this._secondWalk(t.getProperty(L.RIGHTSIBLING),e,o)}}};var yc=class{constructor(t,e,o,r){this._neighborOne=t,this._neighborTwo=e,this._graph=r,this._bendPoints=[o],this._d=r.getProperty(V.DIRECTION),this._nodeBendpointPadding=r.getProperty(V.SPACING_EDGE_NODE),this._onFirstNodeSide=!1,this._onLastNodeSide=!1,this._updateBendPoints()}getNeighborOne(){return this._neighborOne}getNeighborTwo(){return this._neighborTwo}isOnFirstNodeSide(){return this._onFirstNodeSide}isOnLastNodeSide(){return this._onLastNodeSide}addBendPoints(t){this._bendPoints.push(t),this._d.isHorizontal()?this._bendPoints.sort((e,o)=>e.getThird().getTarget().getPosition().y-o.getThird().getTarget().getPosition().y):this._bendPoints.sort((e,o)=>e.getThird().getTarget().getPosition().x-o.getThird().getTarget().getPosition().x),this._updateBendPoints()}_updateBendPoints(){let t=0,e=this._bendPoints.length;for(let o of this._bendPoints){let r,i,s,a=(t+1)/(e+1);if(this._neighborOne==null&&this._neighborTwo==null)return;this._neighborOne!=null&&this._neighborTwo==null?(this._onLastNodeSide=!0,this._d===R.LEFT?(s=this._neighborOne.getPosition().y+this._neighborOne.getSize().y+this._nodeBendpointPadding*(t+1),r=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborOne.getPosition().y+this._neighborOne.getSize().y+this._nodeBendpointPadding*(t+1),r=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborOne.getPosition().x+this._neighborOne.getSize().x+this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborOne.getPosition().x+this._neighborOne.getSize().x+this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding))):this._neighborOne!=null&&this._neighborTwo!=null?this._d===R.LEFT?(s=this._neighborTwo.getPosition().y*a+(this._neighborOne.getPosition().y+this._neighborOne.getSize().y)*(1-a),r=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborTwo.getPosition().y*a+(this._neighborOne.getPosition().y+this._neighborOne.getSize().y)*(1-a),r=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborTwo.getPosition().x*a+(this._neighborOne.getPosition().x+this._neighborOne.getSize().x)*(1-a),r=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborTwo.getPosition().x*a+(this._neighborOne.getPosition().x+this._neighborOne.getSize().x)*(1-a),r=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding)):(this._onFirstNodeSide=!0,this._d===R.LEFT?(s=this._neighborTwo.getPosition().y-this._nodeBendpointPadding*(t+1),r=new O(this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborTwo.getPosition().y-this._nodeBendpointPadding*(t+1),r=new O(this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborTwo.getPosition().x-this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborTwo.getPosition().x-this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding))),o.getFirst().x=r.x,o.getFirst().y=r.y,o.getSecond().x=i.x,o.getSecond().y=i.y,t++}}};var Ic=class n{constructor(){this._steepEndEdgeTheresholdDistance=50,this._steepEndEdgeRatio=5.3,this._steepEndEdgeSampleHeight=40}getLayoutProcessorConfiguration(){return K.create().before(Mt.P4_EDGE_ROUTING).add(pt.LEVEL_COORDS).add(pt.COMPACTION_PROC).add(pt.GRAPH_BOUNDS_PROC)}process(t,e){e.begin("Edge routing",1);let o=t.getProperty(V.EDGE_ROUTING_MODE);if(o===ms.MIDDLE_TO_MIDDLE)this._middleToMiddle(t);else if(o===ms.AVOID_OVERLAP){this._avoidOverlap(t);for(let r of t.getEdges())r.getBendPoints().size()<2&&this._middleToMiddleEdgeRoute(r)}e.done()}_middleToMiddle(t){for(let e of t.getEdges())this._middleToMiddleEdgeRoute(e)}_middleToMiddleEdgeRoute(t){let e=t.getBendPoints(),o=t.getSource(),r=t.getTarget(),i=new O(o.getPosition().x+o.getSize().x/2,o.getPosition().y+o.getSize().y/2),s=new O(r.getPosition().x+r.getSize().x/2,r.getPosition().y+r.getSize().y/2);e.addFirst(i),e.addLast(s),Ro.toNodeBorder(i,e.get(1),o.getSize()),Ro.toNodeBorder(s,e.get(e.size()-2),r.getSize())}_avoidOverlap(t){let e=t.getProperty(V.DIRECTION),o=t.getProperty(V.SPACING_EDGE_NODE),r=t.getProperty(V.EDGE_END_TEXTURE_LENGTH);this._avoidOverlapSetStartPoints(t,e,o),this._avoidOverlapSpecialEdges(t,e,o,r),this._avoidOverlapSetEndPoints(t,e,o,r)}_avoidOverlapSpecialEdges(t,e,o,r){let i=0,s=0,a=new Map,l=0;for(let E of t.getNodes()){let P=E.getProperty(V.TREE_LEVEL);P>l&&(l=P)}l++;let c=new Array(l).fill(0),g=new Array(l).fill(0),h=new Set,d=[];for(let E of t.getEdges())h.has(E)||(h.add(E),d.push(E));let f=e===R.LEFT||e===R.RIGHT;for(let E of d){let P=E.getSource().getProperty(V.TREE_LEVEL),S=E.getTarget().getProperty(V.TREE_LEVEL),T=S-P;if(T>1)for(let N=P+1;N<S;N++){let I=t.getNodes().filter(X=>X.getProperty(V.TREE_LEVEL)===N),C=0,x=(N-P)/(S-P);if(f){I.sort((tt,ot)=>tt.getPosition().y-ot.getPosition().y);let X=E.getSource().getPosition().y*(1-x)+E.getTarget().getPosition().y*x;for(C=0;C<I.length&&!(I[C].getPosition().y>X);C++);}else{I.sort((tt,ot)=>tt.getPosition().x-ot.getPosition().x);let X=E.getSource().getPosition().x*(1-x)+E.getTarget().getPosition().x*x;for(C=0;C<I.length&&!(I[C].getPosition().x>X);C++);}if(I.length>0){let X=E.getBendPoints(),tt=X.size()===0?new O(E.getSource().getPosition().x,E.getSource().getPosition().y):X.getLast(),ot=I[I.length-1],Lt=new O(ot.getPosition().x+ot.getSize().x,ot.getPosition().y+ot.getSize().y),zt=I[0],be=new O(zt.getPosition().x+zt.getSize().x,zt.getPosition().y+zt.getSize().y);if(f){if(C>=I.length-1&&tt.y>Lt.y&&E.getTarget().getPosition().y>Lt.y||C<=0&&tt.y<be.x&&E.getTarget().getPosition().y<be.y)continue}else if(C>=I.length-1&&tt.x>Lt.x&&E.getTarget().getPosition().x>Lt.x||C<=0&&tt.x<be.x&&E.getTarget().getPosition().x<be.x)continue}let M=new O,A=new O;E.getBendPoints().add(M),E.getBendPoints().add(A);let B=new Os(M,A,E),Y=Ro.getUniqueLong(N,C),j=a.get(Y);j==null?(j=new yc(C===0?null:I[C-1],C===I.length?null:I[C],B,t),a.set(Y,j)):j.addBendPoints(B),f?(j.isOnFirstNodeSide()&&j.getNeighborTwo()!=null&&j.getNeighborTwo().getPosition().y<=t.getProperty(L.GRAPH_YMIN)&&i++,j.isOnLastNodeSide()&&j.getNeighborOne()!=null&&j.getNeighborOne().getPosition().y+j.getNeighborOne().getSize().y>=t.getProperty(L.GRAPH_YMAX)&&s++):(j.isOnFirstNodeSide()&&j.getNeighborTwo()!=null&&j.getNeighborTwo().getPosition().x<=t.getProperty(L.GRAPH_XMIN)&&i++,j.isOnLastNodeSide()&&j.getNeighborOne()!=null&&j.getNeighborOne().getPosition().x+j.getNeighborOne().getSize().x>=t.getProperty(L.GRAPH_XMAX)&&s++)}else if(T===0)this._middleToMiddleEdgeRoute(E);else if(T<0){c[P]++,g[S]++;let N=this._avoidOverlapHandleCycleInducingEdges(E,e,t,i,s,o,r,g[S],c[P]);i=N[0],s=N[1]}}}_avoidOverlapHandleCycleInducingEdges(t,e,o,r,i,s,a,l,c){let g=t.getSource(),h=t.getTarget(),d=o.getNodes(),f=0,E;if(e===R.LEFT||e===R.RIGHT){let S=0;for(let T of d)S+=T.getPosition().y+T.getSize().y/2;if(E=S/d.length,g.getPosition().y+g.getSize().y/2>E){i++;let T=-1/0;for(let N of d){let I=N.getPosition().y+N.getSize().y+s*i;I>T&&(T=I)}f=T}else{r++;let T=1/0;for(let N of d){let I=N.getPosition().y-s*r;I<T&&(T=I)}f=T}}else{let S=0;for(let T of d)S+=T.getPosition().x+T.getSize().x/2;if(E=S/d.length,g.getPosition().x+g.getSize().x/2>E){i++;let T=-1/0;for(let N of d){let I=N.getPosition().x+N.getSize().x+s*i;I>T&&(T=I)}f=T}else{r++;let T=1/0;for(let N of d){let I=N.getPosition().x-s*r;I<T&&(T=I)}f=T}}let P=t.getBendPoints();if(e===R.LEFT){P.add(g.getProperty(L.LEVELMIN)-s,f);let S=h.getPosition().x+h.getSize().x+s+a;P.add(S,f),P.add(S,h.getPosition().y+h.getSize().y/2),P.add(h.getPosition().x+h.getSize().x,h.getPosition().y+h.getSize().y/2)}else if(e===R.RIGHT){P.add(g.getProperty(L.LEVELMAX)+s,g.getPosition().y+g.getSize().y/2),P.add(g.getPosition().x+g.getSize().x+s,f);let S=h.getPosition().x-s-a;P.add(S,f),P.add(S,h.getPosition().y+h.getSize().y/2),P.add(h.getPosition().x,h.getPosition().y+h.getSize().y/2)}else if(e===R.UP){P.add(f,g.getProperty(L.LEVELMIN)-s);let S=h.getPosition().y+h.getSize().y+s+a;P.add(f,S),P.add(h.getPosition().x+h.getSize().x/2,S),P.add(h.getPosition().x+h.getSize().x/2,h.getPosition().y+h.getSize().y+s)}else P.isEmpty()||(P.getLast().y=g.getProperty(L.LEVELMAX)+s*c),P.add(f,g.getProperty(L.LEVELMAX)+s*c),P.add(f,h.getPosition().y-s*l-a);return[r,i]}_avoidOverlapSetStartPoints(t,e,o){for(let r of t.getNodes()){if(r.getLabel()==="SUPER_ROOT")continue;let i=[...r.getOutgoingEdges()];if(i.length===0)continue;e===R.LEFT||e===R.RIGHT?i.sort((a,l)=>n._getFirstPoint(a).y-n._getFirstPoint(l).y):i.sort((a,l)=>n._getFirstPoint(a).x-n._getFirstPoint(l).x);let s=i.length;for(let a=0;a<s;a++){if(r.getProperty(L.COMPACT_LEVEL_ASCENSION)&&!n._isCycleInducing(i[a],e))continue;let l=s===1?.5:(a+1)/(s+1);if(e===R.LEFT){let c=r.getProperty(L.LEVELMIN),g=r.getPosition().y+r.getSize().y*l;i[a].getBendPoints().addFirst(Math.min(c,r.getPosition().x-o),g),i[a].getBendPoints().addFirst(r.getPosition().x,g)}else if(e===R.RIGHT){let c=r.getProperty(L.LEVELMAX)+o,g=r.getPosition().y+r.getSize().y*l;i[a].getBendPoints().addFirst(c,g),i[a].getBendPoints().addFirst(r.getPosition().x+r.getSize().x,g)}else if(e===R.UP){let c=r.getProperty(L.LEVELMIN),g=r.getPosition().x+r.getSize().x*l;i[a].getBendPoints().addFirst(g,Math.min(r.getPosition().y-o,c)),i[a].getBendPoints().addFirst(g,r.getPosition().y)}else{let c=r.getProperty(L.LEVELMAX)+o,g=r.getPosition().x+r.getSize().x*l;i[a].getBendPoints().addFirst(g,c),i[a].getBendPoints().addFirst(g,r.getPosition().y+r.getSize().y)}}}}_avoidOverlapSetEndPoints(t,e,o,r){for(let i of t.getNodes()){if(i.getLabel()==="SUPER_ROOT")continue;let s=[...i.getIncomingEdges()];if(s.length===0)continue;e===R.LEFT||e===R.RIGHT?s.sort((l,c)=>n._getLastPoint(l).y-n._getLastPoint(c).y):s.sort((l,c)=>n._getLastPoint(l).x-n._getLastPoint(c).x);let a=s.length;for(let l=0;l<a;l++){let c=a===1?.5:(1+l)/(a+1),g=s[l].getBendPoints();if(e===R.LEFT){let h=i.getProperty(L.LEVELMAX);i.getPosition().x+i.getSize().x+r<h?g.add(h+o,i.getPosition().y+i.getSize().y*c):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x,i.getPosition().y+i.getSize().y*c)}else if(e===R.RIGHT){let h=i.getProperty(L.LEVELMIN);i.getPosition().x-r>h?g.add(h-o,i.getPosition().y+i.getSize().y*c):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x,i.getPosition().y+i.getSize().y*c)}else if(e===R.UP){let h=i.getProperty(L.LEVELMAX);i.getPosition().y+i.getSize().y+r<h?g.add(i.getPosition().x+i.getSize().x*c,h+o):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x*c,i.getPosition().y+i.getSize().y)}else{let h=i.getProperty(L.LEVELMIN);n._isCycleInducing(s[l],e)?g.add(i.getPosition().x+i.getSize().x*c,g.getLast().y):i.getPosition().y-r>h?g.add(i.getPosition().x+i.getSize().x*c,h-o):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x*c,i.getPosition().y)}}}}_maybeAddSteepBend(t,e,o,r,i){if(r<=0)return;let s=t.getLast(),a=s.x,l=s.y,c=e.getPosition().x+e.getSize().x/2,g=e.getPosition().y+e.getSize().y/2,h=this._steepEndEdgeSampleHeight,d=this._steepEndEdgeRatio,f=this._steepEndEdgeTheresholdDistance;if(i===R.LEFT||i===R.RIGHT){let E=Math.abs(l-g),P=Math.abs(a-c)/h;if(!(E/P>f))return;let S=e.getPosition().y+e.getSize().y*o;g>l?t.add(i===R.LEFT?e.getPosition().x+e.getSize().x+r/d:e.getPosition().x-r/d,S-r/2):t.add(i===R.LEFT?e.getPosition().x+e.getSize().x+r/d:e.getPosition().x-r/d,S+r/2)}else{let E=Math.abs(a-c),P=Math.abs(l-g)/h;if(!(E/P>f))return;let S=e.getPosition().x+e.getSize().x*o,T=i===R.UP?e.getPosition().y+e.getSize().y+r/d:e.getPosition().y-r/d;c>a?t.add(S-r/2,T):t.add(S+r/2,T)}}static _getFirstPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getTarget().getPosition().x,t.getTarget().getPosition().y):e.getFirst()}static _getLastPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getSource().getPosition().x,t.getSource().getPosition().y):e.getLast()}static _isCycleInducing(t,e){let o=Ro.getDirectionVector(e),r=t.getTarget().getPosition().x-t.getSource().getPosition().x,i=t.getTarget().getPosition().y-t.getSource().getPosition().y;return o.x*r+o.y*i<=0}};var Mt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.P1_TREEIFICATION:return new Sc;case n.P2_NODE_ORDERING:return new Tc;case n.P3_NODE_PLACEMENT:return new Nc;case n.P4_EDGE_ROUTING:return new Ic;default:throw new Error(`No implementation available for phase ${this}`)}}};Mt.P1_TREEIFICATION=new Mt("P1_TREEIFICATION",0);Mt.P2_NODE_ORDERING=new Mt("P2_NODE_ORDERING",1);Mt.P3_NODE_PLACEMENT=new Mt("P3_NODE_PLACEMENT",2);Mt.P4_EDGE_ROUTING=new Mt("P4_EDGE_ROUTING",3);Mt.VALUES=[Mt.P1_TREEIFICATION,Mt.P2_NODE_ORDERING,Mt.P3_NODE_PLACEMENT,Mt.P4_EDGE_ROUTING];var Rc=class{constructor(){this._algorithmAssembler=Io.create(Mt.VALUES),this._algorithm=[]}doLayout(t,e){if(e.begin("Tree layout",1),t.getProperty(V.DEBUG_MODE)){let r=new Date,i=String(r.getHours()).padStart(2,"0"),s=String(r.getMinutes()).padStart(2,"0"),a=String(r.getSeconds()).padStart(2,"0");e.log(`MrTree! called at ${i}:${s}:${a}`)}this._updateModules(t);let o=typeof e.subTask=="function"?e.subTask(1):e;return this._layout(t,o),e.done(),t}_updateModules(t){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Mt.P1_TREEIFICATION,Mt.P1_TREEIFICATION),this._algorithmAssembler.setPhase(Mt.P2_NODE_ORDERING,Mt.P2_NODE_ORDERING),this._algorithmAssembler.setPhase(Mt.P3_NODE_PLACEMENT,Mt.P3_NODE_PLACEMENT),this._algorithmAssembler.setPhase(Mt.P4_EDGE_ROUTING,Mt.P4_EDGE_ROUTING),this._algorithm=this._algorithmAssembler.build(t)}_layout(t,e){let o=e!=null?e:new Ie;if(o.begin("Layout",this._algorithm.length),t.getProperty(V.DEBUG_MODE)){e.log(`ELK MrTree uses the following ${this._algorithm.length} modules:`);for(let r=0;r<this._algorithm.length;r++)e.log(` Slot ${r}: ${this._algorithm[r].constructor.name}`)}for(let r of this._algorithm){if(typeof o.isCanceled=="function"&&o.isCanceled())return;let i=typeof o.subTask=="function"?o.subTask(1):o;r.process(t,i)}o.done()}};var Lc=class extends de{constructor(){super(),this._klayTree=new Rc,this._componentsProcessor=new nc,this._defaultWork=.1}layout(t,e){t.getProperty(V.OMIT_NODE_MICRO_LAYOUT)||Go.forGraph(t).execute();let o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e;o.begin("build tGraph",1);let r=new lc,i=r.importGraph(t);o.done(),o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Split graph",1);let s=this._componentsProcessor.split(i);o.done();let a=(1-this._defaultWork*4)/Math.max(s.length,1);for(let l of s){let c=typeof e.subTask=="function"?e.subTask(a):e;this._klayTree.doLayout(l,c)}o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Pack components",1),i=this._componentsProcessor.pack(s),o.done(),o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Apply layout results",1),r.applyLayout(i),o.done()}};var NE="org.eclipse.elk.mrtree",yE=!1;function IE(){let n=Ht.getInstance(),t=n.getAlgorithmData(NE);if(t)return yE=!0,t;let e=new Se.Builder().id(NE).name("ELK Mr. Tree").description("Tree-based algorithm provided by the Eclipse Layout Kernel.").category("org.eclipse.elk.tree").definingBundleId("org.eclipse.elk.alg.mrtree").providerFactory(()=>new Lc).supportedFeatures(new Set(["DISCONNECTED"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),yE=!0,e}var Re=class{};Re.ROOT_NODE=new m("root");var zu=2*Math.PI,Yu=1e-10,bt=class n{static getSuccessors(t){let e=[],o=new Set(t.children);for(let r of Ee(t)){let i=r.sources||[];if(i.length===0)continue;let s=i[0];if(s&&s.parent!==void 0&&s.children===void 0)continue;let a=r.targets||[];if(a.length===0)continue;let l=Pt(a[0]);l!=null&&!o.has(l)&&e.push(l)}return e}static getSuccessorSet(t){return new Set(n.getSuccessors(t))}static findRoot(t){for(let e of t.children)if([..._i(e)].length===0)return e;return null}static findRootOfNode(t){let e=n.getTreeParent(t);return e==null?t:n.findRootOfNode(e)}static getNumberOfLeaves(t){let e=n.getSuccessors(t);if(e.length===0)return 1;let o=0;for(let r of e)o+=n.getNumberOfLeaves(r);return o}static createPolarComparator(t,e){return(o,r)=>{let i=n._arc(o,t,e),s=n._arc(r,t,e);return Math.abs(i-s)<Yu?0:i<s?-1:1}}static _arc(t,e,o){let r=t.getProperty(ho),i=Math.atan2(r.y+o,r.x);return i<0&&(i+=zu),i+=e,i>zu&&(i-=zu),i}static findLargestNodeInGraph(t){let e=0;for(let o of t.children){let r=Math.sqrt(o.width*o.width+o.height*o.height);r>e&&(e=r);let i=n.findLargestNodeInGraph(o);i>e&&(e=i)}return e}static getNextLevelNodes(t){let e=[];for(let o of t)for(let r of n.getSuccessors(o))e.push(r);return e}static getNextLevelNodeSet(t){let e=new Set;for(let o of t)for(let r of n.getSuccessorSet(o))e.add(r);return e}static getLastLevelNodes(t){let e=[];for(let o of t)e.push(n.getTreeParent(o));return e}static centerNodesOnRadi(t,e,o){t.x=e-t.width/2,t.y=o-t.height/2}static shiftClosestEdgeToRadi(t,e,o){if(Math.abs(e)<Yu&&Math.abs(o)<Yu){t.x=e-t.width/2,t.y=o-t.height/2;return}e<0?o<0?(t.x=e-t.width,t.y=o):(t.x=e-t.width,t.y=o+t.height):o<0?(t.x=e,t.y=o):(t.x=e,t.y=o+t.height)}static getTreeParent(t){let e=[..._i(t)];if(e.length===0)return null;let r=e[0].sources||[];return r.length===0?null:Pt(r[0])}};var Ac=class{calculateWedgeSpace(t){return bt.getNumberOfLeaves(t)}};var Cc=class{calculateWedgeSpace(t){let e=bt.getSuccessors(t),o=t.height,r=t.width,i=Math.sqrt(o*o+r*r),s=0;for(let a of e)s+=this.calculateWedgeSpace(a);return Math.max(s,i)}};var Li=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.LEAF_NUMBER:return new Ac;case n.NODE_SIZE:return new Cc;default:throw new Error(`AnnulusWedgeCriteria.${this}: no implementation available.`)}}};Li.LEAF_NUMBER=new Li("LEAF_NUMBER");Li.NODE_SIZE=new Li("NODE_SIZE");var Ai=class{constructor(){this._compactionStep=1,this._spacing=0,this._root=null}contractLayer(t,e){for(let o of t){let r=o.x+o.width/2,i=o.y+o.height/2,s=this._root,a=s.x+s.width/2,l=s.y+s.height/2,c=r-a,g=i-l,h=Math.sqrt(c*c+g*g);h!==0&&(c*=this._compactionStep/h,g*=this._compactionStep/h,e?(r-=c,i-=g):(r+=c,i+=g),o.x=r-o.width/2,o.y=i-o.height/2)}}moveNode(t,e){let o=this._root,r=o.x+o.width/2,i=o.y+o.height/2,s=t.x+t.width/2,a=t.y+t.height/2,l=s-r,c=a-i,g=Math.sqrt(l*l+c*c);if(g===0)return;let h=l/g,d=c/g;t.x=t.x+h*e,t.y=t.y+d*e}overlap(t,e){let o=t.x-this._spacing/2,r=e.x-this._spacing/2,i=t.y-this._spacing/2,s=e.y-this._spacing/2,a=t.width+this._spacing,l=e.width+this._spacing,c=t.height+this._spacing,g=e.height+this._spacing;return o<r+l&&r<o&&i<s+g&&s<i||r<o+a&&o<r&&s<i+c&&i<s||o<r+l&&r<o&&i<s&&s<i+c||r<o+a&&o<r&&i<s+g&&s<i}overlapLayer(t){if(t.length<2)return!1;let e=!1;for(let o=0;o<t.length;o++)o<t.length-1?e=e||this.overlap(t[o],t[o+1]):e=e||this.overlap(t[o],t[0]);return e}getCompactionStep(){return this._compactionStep}setCompactionStep(t){this._compactionStep=t}getSpacing(){return this._spacing}setSpacing(t){this._spacing=t}setRoot(t){this._root=t}getRoot(){return this._root}};var xc=class extends Ai{constructor(){super(),this._sorter=null,this._lastRadius=0}compact(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Dc);o!=null&&this.setCompactionStep(o);let r=t.getProperty(Pi);this.setSpacing(r);let i=bt.getSuccessors(e);this._sorter!=null&&this._sorter.sort(i),this._contract(i)}_contract(t){if(t.length===0)return;let e=this._overlapping(t),o=!1;for(;!e;)this.contractLayer(t,!0),o=!0,e=this._overlapping(t);o&&this.contractLayer(t,!1);let r=bt.getNextLevelNodes(t);this._sorter!=null&&this._sorter.sort(r),this._lastRadius=this._calculateRadius(t[0]),this._contract(r)}_calculateRadius(t){let e=this.getRoot(),o=t.x-e.x,r=t.y-e.y;return Math.sqrt(o*o+r*r)}_overlapping(t){if(this.overlapLayer(t))return!0;for(let e of t){let o=bt.getTreeParent(e);if(o!=null&&this.overlap(e,o)||this._calculateRadius(e)-this.getSpacing()<=this._lastRadius)return!0}return!1}};var wc=class extends Ai{constructor(){super(),this._leftContour=new Map,this._rightContour=new Map,this._sorter=null}compact(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Dc);o!=null&&this.setCompactionStep(o);let r=t.getProperty(Pi);this.setSpacing(r);let i=bt.getSuccessors(e);this._sorter!=null&&this._sorter.sort(i),this._constructContour(i);let s=[e];for(let a=0;a<2;a++)for(let l=0;l<i.length;l++){let c=[i[l]],g=l<i.length-1?i[l+1]:i[0],h=l===0?i[i.length-1]:i[l-1];this._contractWedge(i[l],s,h,g,c)}}_contractWedge(t,e,o,r,i){let s=this._overlapping(e,o,r,i),a=!1;for(;!s;)this.contractLayer(i,!0),a=!0,s=this._overlapping(e,o,r,i);a&&this.contractLayer(i,!1);let l=bt.getNextLevelNodes(i);l.length>0&&(this._sorter!=null&&this._sorter.sort(l),this._contractWedge(t,i,o,r,l))}_overlapping(t,e,o,r){this._sorter!=null&&this._sorter.sort(r);let i=r[0];if(this._contourOverlap(e,i,!1))return!0;let s=r[r.length-1];if(this._contourOverlap(o,s,!0)||this.overlapLayer(r))return!0;for(let a of r)for(let l of t)if(this.overlap(a,l))return!0;return!1}_contourOverlap(t,e,o){let r=o?this._leftContour.get(t)||[]:this._rightContour.get(t)||[];for(let i of r)if(this.overlap(e,i))return!0;return!1}_constructContour(t){for(let e of t){let o=[e],r=[e];this._leftContour.set(e,o),this._rightContour.set(e,r);let i=bt.getSuccessors(e);if(i.length>0)for(this._sorter!=null&&this._sorter.sort(i),o.push(i[0]),r.push(i[i.length-1]);bt.getNextLevelNodes(i).length>0;)i=bt.getNextLevelNodes(i),this._sorter!=null&&this._sorter.sort(i),o.push(i[0]),r.push(i[i.length-1])}}};var Xo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.RADIAL_COMPACTION:return new xc;case n.WEDGE_COMPACTION:return new wc;case n.NONE:return null;default:throw new Error(`CompactionStrategy.${this}: no implementation available.`)}}};Xo.NONE=new Xo("NONE");Xo.RADIAL_COMPACTION=new Xo("RADIAL_COMPACTION");Xo.WEDGE_COMPACTION=new Xo("WEDGE_COMPACTION");var Mc=class{evaluate(t){let e=0;for(let o of Ee(t)){let r=o.targets||[];if(r.length===0)continue;let i=Pt(r[0]);if(i==null)continue;let s=i.x+i.width/2,a=i.y+i.height/2,l=t.x+t.width/2,c=t.y+t.height/2,g=new O(s-l,a-c),h=new O(g.x,g.y);Ft.clipVector(h,t.width,t.height),g.x-=h.x,g.y-=h.y,l=s-g.x,c=a-g.y;let d=new O(g.x,g.y);Ft.clipVector(d,i.width,i.height),g.x-=d.x,g.y-=d.y,s=l+g.x,a=c+g.y;let f=s-l,E=a-c;e+=Math.sqrt(f*f+E*E)}return e}};var bc=class{evaluate(t){let e=0;for(let o of Ee(t)){let r=o.targets||[];if(r.length===0)continue;let i=Pt(r[0]);if(i==null)continue;let s=i.x+i.width/2,a=i.y+i.height/2,l=i.getProperty(ho),c=t.x+l.x+t.width/2,g=t.y+l.y+t.height,h=s-c,d=a-g;e+=Math.sqrt(h*h+d*d)}return e}};var Gc=class{constructor(){this._root=null}evaluate(t){this._root=t;let e=0,o=bt.getSuccessors(t);for(let r=0;r<o.length;r++)for(let i=r+1;i<o.length;i++)this._isCrossing(o[r],o[i])&&(e+=1);return e}_isCrossing(t,e){let o=this._root.x+this._root.width/2,r=this._root.x+this._root.width/2,i=new O(t.x+t.width/2,t.y+t.height/2),s=t.getProperty(ho);s.x=s.x+o,s.y=s.y+r;let a=(i.y-s.y)/(i.x-s.x),l=i.y-a*i.x,c=new O(e.x+e.width/2,e.y+e.height/2),g=e.getProperty(ho);g.x=g.x+o,g.y=g.y+r;let h=(c.y-g.y)/(c.x-g.x),d=c.y-h*c.x,f=(l-d)/(h-a);return!(s.x<f&&i.x<f||f<s.x&&f<i.x||g.x<f&&c.x<f||f<g.x&&f<c.x)}};var Ko=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NONE:return null;case n.EDGE_LENGTH:return new Mc;case n.EDGE_LENGTH_BY_POSITION:return new bc;case n.CROSSING_MINIMIZATION_BY_POSITION:return new Gc;default:throw new Error(`RadialTranslationStrategy.${this}: no implementation available.`)}}};Ko.NONE=new Ko("NONE");Ko.EDGE_LENGTH=new Ko("EDGE_LENGTH");Ko.EDGE_LENGTH_BY_POSITION=new Ko("EDGE_LENGTH_BY_POSITION");Ko.CROSSING_MINIMIZATION_BY_POSITION=new Ko("CROSSING_MINIMIZATION_BY_POSITION");var ln=class{sort(t){t.sort((e,o)=>{let r=e.getProperty(Fa),i=o.getProperty(Fa);return r-i})}initialize(t){}};var iT=.25*Math.PI,sT=.5*Math.PI,RE=.75*Math.PI,LE=1.25*Math.PI,nT=1.5*Math.PI,AE=1.75*Math.PI,Hc=class{constructor(){this._compRight=bt.createPolarComparator(0,0),this._compLeft=bt.createPolarComparator(Math.PI,0),this._compTop=bt.createPolarComparator(nT,0),this._compBottom=bt.createPolarComparator(sT,0),this._idSorter=null}initialize(t){this._idSorter=new ln;let e=bt.getSuccessors(t);e.sort(this._compRight),this._setIDForNodes(e,0)}_setIDForNodes(t,e){let o=e,r=0;for(let i of t){i.setProperty(Fa,o++);let s=bt.getSuccessors(i),a=Math.atan2(i.y+i.height/2,i.x+i.width/2);a<0&&(a+=2*Math.PI),a<iT||a>AE?s.sort(this._compLeft):a<=AE&&a>LE?s.sort(this._compTop):a<=LE&&a>RE?s.sort(this._compRight):a<=RE&&s.sort(this._compBottom),r=this._setIDForNodes(s,r)}return o}sort(t){if(t.length>0){if(this._idSorter==null){let e=bt.findRootOfNode(t[0]);this.initialize(e)}this._idSorter.sort(t)}}};var Ar=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NONE:return null;case n.POLAR_COORDINATE:return new Hc;case n.ID:return new ln;default:throw new Error(`SortingStrategy.${this}: no implementation available.`)}}};Ar.NONE=new Ar("NONE");Ar.POLAR_COORDINATE=new Ar("POLAR_COORDINATE");Ar.ID=new Ar("ID");var CE=new m("org.eclipse.elk.radial.centerOnRoot",!1),Fa=new m("org.eclipse.elk.radial.orderId",0),ka=new m("org.eclipse.elk.radial.radius",0),xE=new m("org.eclipse.elk.radial.rotate",!1),vc=new m("org.eclipse.elk.radial.rotation.targetAngle",0),DE=new m("org.eclipse.elk.radial.rotation.computeAdditionalWedgeSpace",!1),wE=new m("org.eclipse.elk.radial.rotation.outgoingEdgeAngles",!1),Bc=new m("org.eclipse.elk.radial.compactor",()=>Xo.NONE),Dc=new m("org.eclipse.elk.radial.compactionStepSize",1,0),Ci=new m("org.eclipse.elk.radial.sorter",()=>Ar.NONE),ME=new m("org.eclipse.elk.radial.wedgeCriteria",()=>Li.NODE_SIZE),bE=new m("org.eclipse.elk.radial.optimizationCriteria",()=>Ko.NONE);var aT=360,lT=Math.PI/180,Uc=class{constructor(){this._radius=0,this._sorter=null,this._annulusWedgeCriteria=null,this._optimizer=null,this._root=null}process(t,e){e.begin("Eades radial",1),this._root=t.getProperty(Re.ROOT_NODE),this._radius=t.getProperty(ka),this._sorter=t.getProperty(Ci).create(),this._annulusWedgeCriteria=t.getProperty(ME).create(),this._optimizer=t.getProperty(bE).create(),this._translate(t),e.done()}_translate(t){let e=0,o=Number.MAX_VALUE;if(this._optimizer!=null)for(let r=0;r<aT;r++){let i=r*lT;this._positionNodes(this._root,0,0,2*Math.PI,i);let s=this._optimizer.evaluate(this._root);s<o&&(e=i,o=s)}this._positionNodes(this._root,0,0,2*Math.PI,e)}_positionNodes(t,e,o,r,i){let s=(o+r)/2+i,a=e*Math.cos(s),l=e*Math.sin(s);bt.centerNodesOnRadi(t,a,l);let c=this._annulusWedgeCriteria.calculateWedgeSpace(t),g=2*Math.acos(e/e+this._radius),h,d;g<r-o?(h=g/c,d=(o+r-g)/2):(h=(r-o)/c,d=o);let f=bt.getSuccessors(t);this._sorter!=null&&(this._sorter.initialize(this._root),this._sorter.sort(f));for(let E of f){let P=this._annulusWedgeCriteria.calculateWedgeSpace(E);this._positionNodes(E,e+this._radius,d,d+h*P,i),d+=h*P}}getLayoutProcessorConfiguration(){return null}};var Fc=class{process(t,e){e.begin("Straight Line Edge Routing",1);let o=t.getProperty(Re.ROOT_NODE);o!=null&&this.routeEdges(o),e.done()}routeEdges(t){for(let e of Ee(t)){let o=e.sources||[];if(o.length===0)continue;let r=o[0];if(r&&r.parent!==void 0&&r.children===void 0||e.isHierarchical&&e.isHierarchical())continue;let i=e.targets||[];if(i.length===0)continue;let s=Pt(i[0]);if(s==null)continue;let a=t.x+t.width/2,l=t.y+t.height/2,c=s.x+s.width/2,g=s.y+s.height/2,h=new O(c-a,g-l),d=new O(h.x,h.y);Ft.clipVector(d,t.width,t.height),h.x-=d.x,h.y-=d.y,a=c-h.x,l=g-h.y;let f=new O(h.x,h.y);Ft.clipVector(f,s.width,s.height),h.x-=f.x,h.y-=f.y,c=a+h.x,g=l+h.y;let E=ar(e,!0,!0);E.setStartLocation(a,l),E.setEndLocation(c,g),this.routeEdges(s)}}getLayoutProcessorConfiguration(){return null}};var Ce=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.P1_NODE_PLACEMENT:return new Uc;case n.P2_EDGE_ROUTING:return new Fc;default:throw new Error(`RadialLayoutPhases.${this}: no implementation available.`)}}};Ce.P1_NODE_PLACEMENT=new Ce("P1_NODE_PLACEMENT",0);Ce.P2_EDGE_ROUTING=new Ce("P2_EDGE_ROUTING",1);Ce.VALUES=[Ce.P1_NODE_PLACEMENT,Ce.P2_EDGE_ROUTING];var kc=class extends Ai{constructor(){super(),this._sorter=null}process(t,e){e.begin("Remove overlaps",1),this._removeOverlaps(t),e.done()}_removeOverlaps(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Pi);this.setSpacing(o);let r=bt.getSuccessors(e);this._extend(r)}_extend(t){if(t.length===0)return;let e=t.map(l=>new O(l.x,l.y));for(;this.overlapLayer(t);)this.contractLayer(t,!1);let o=0,r=0;if(t.length>0){let l=t[0];o=l.x-e[0].x,r=l.y-e[0].y}let i=Math.sqrt(o*o+r*r),s=bt.getNextLevelNodeSet(t);if(s.size>0)for(let l of s)this.moveNode(l,i);let a=[...s];this._sorter!=null&&this._sorter.sort(a),this._extend(a)}};var Wc=class{process(t,e){e.begin("Calculate Graph Size",1);let o=Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let h of t.children){let d=h.getProperty(Nr);o=Math.min(o,h.x-d.left),r=Math.min(r,h.y-d.top),i=Math.max(i,h.x+h.width+d.right),s=Math.max(s,h.y+h.height+d.bottom)}let a=t.getProperty(ns),l=new O(o-a.getLeft(),r-a.getTop()),c=i-o+a.getHorizontal(),g=s-r+a.getVertical();if(t.getProperty(CE)){let h=t.getProperty(Re.ROOT_NODE),d=h.getProperty(Nr),f=h.x+h.width/2+(d.left+d.right)/2-l.x,E=h.y+h.height/2+(d.top+d.bottom)/2-l.y,P=c-f,S=g-E;if(P<c/2){let T=P-f;c+=T,l.x-=T}else{let T=f-P;c+=T}if(S<g/2){let T=S-E;g+=T,l.y-=T}else{let T=E-S;g+=T}}for(let h of t.children)h.x=h.x-l.x,h.y=h.y-l.y;t.getProperty(To)||(t.width=c,t.height=g),t.setProperty(pi,c-a.getHorizontal()),t.setProperty(Ei,g-a.getVertical()),e.done()}};var zc=class{process(t,e){e.begin("Calculate outgoing edge angles",1);let o=t.getProperty(Re.ROOT_NODE);if(o!=null)for(let r of o.getOutgoingEdges()){let i=r.sections||[];if(i.length===0)continue;let s=i[0],a=new O(s.startX,s.startY),l=new O(s.endX,s.endY),c=O.diff(l,a),g=Math.atan2(c.y,c.x),h=r.targets||[];h.length>0&&typeof h[0].setProperty=="function"&&h[0].setProperty(vc,g)}e.done()}};var Yc=class{process(t,e){e.begin("General Compactor",1);let o=t.getProperty(Bc).create();o!=null&&o.compact(t),e.done()}};var Vc=class{rotate(t){let e=t.getProperty(vc);if(t.getProperty(DE)){let r=t.getProperty(Re.ROOT_NODE).getOutgoingEdges();if(r.length>0){let i=r[r.length-1],s=r[0],a=i.targets[0],l=s.targets[0],c=new O(a.x+a.width/2,a.y+a.height/2),g=new O(l.x+l.width/2,l.y+l.height/2),h=e;h<=0&&(h+=2*Math.PI);let d=c.angle(g);d<=0&&(d+=2*Math.PI);let f=Math.atan2(c.y,c.x);f<=0&&(f+=2*Math.PI),e=Math.PI-(f-h+d/2)}}for(let o of t.children){let r=new O(o.x+o.width/2,o.y+o.height/2);r.rotate(e),o.setLocation(r.x-o.width/2,r.y-o.height/2)}}};var Xc=class{process(t,e){e.begin("General Rotator",1),new Vc().rotate(t),e.done()}};var ue=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.OVERLAP_REMOVAL:return new kc;case n.COMPACTION:return new Yc;case n.ROTATION:return new Xc;case n.GRAPH_SIZE_CALCULATION:return new Wc;case n.OUTGOING_EDGE_ANGLES:return new zc;default:throw new Error(`IntermediateProcessorStrategy.${this}: processor is not yet ported.`)}}};ue.OVERLAP_REMOVAL=new ue("OVERLAP_REMOVAL",0);ue.COMPACTION=new ue("COMPACTION",1);ue.ROTATION=new ue("ROTATION",2);ue.GRAPH_SIZE_CALCULATION=new ue("GRAPH_SIZE_CALCULATION",3);ue.OUTGOING_EDGE_ANGLES=new ue("OUTGOING_EDGE_ANGLES",4);ue.VALUES=[ue.OVERLAP_REMOVAL,ue.COMPACTION,ue.ROTATION,ue.GRAPH_SIZE_CALCULATION,ue.OUTGOING_EDGE_ANGLES];var Kc=class extends de{constructor(){super(),this._algorithmAssembler=Io.create(Ce.VALUES)}layout(t,e){let o=this._assembleAlgorithm(t);e.begin("Radial layout",o.length),t.getProperty(So)||Go.forGraph(t).execute();let r=bt.findRoot(t);if(t.setProperty(Re.ROOT_NODE,r),r==null)throw new Error("The given graph is not a tree!");let i=t.getProperty(ka);i===0&&(i=bt.findLargestNodeInGraph(t)),t.setProperty(ka,i);for(let s of o){let a=typeof e.subTask=="function"?e.subTask(1):e;s.process(t,a)}e.done()}_assembleAlgorithm(t){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ce.P1_NODE_PLACEMENT,Ce.P1_NODE_PLACEMENT),this._algorithmAssembler.setPhase(Ce.P2_EDGE_ROUTING,Ce.P2_EDGE_ROUTING);let e=K.create();return e.addBefore(Ce.P2_EDGE_ROUTING,ue.OVERLAP_REMOVAL),t.getProperty(Bc)!==Xo.NONE&&e.addBefore(Ce.P2_EDGE_ROUTING,ue.COMPACTION),t.getProperty(xE)&&e.addBefore(Ce.P2_EDGE_ROUTING,ue.ROTATION),e.addBefore(Ce.P2_EDGE_ROUTING,ue.GRAPH_SIZE_CALCULATION),t.getProperty(wE)&&e.addAfter(Ce.P2_EDGE_ROUTING,ue.OUTGOING_EDGE_ANGLES),this._algorithmAssembler.addProcessorConfiguration(e),this._algorithmAssembler.build(t)}};var GE="org.eclipse.elk.radial",HE=!1;function vE(){let n=Ht.getInstance(),t=n.getAlgorithmData(GE);if(t)return HE=!0,t;let e=new Se.Builder().id(GE).name("ELK Radial").description("Radial layout provider for tree graphs.").category("org.eclipse.elk.tree").definingBundleId("org.eclipse.elk.alg.radial").providerFactory(()=>new Kc).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),HE=!0,e}var Le=class{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}};Le.P1_WIDTH_APPROXIMATION=new Le("P1_WIDTH_APPROXIMATION",0);Le.P2_PACKING=new Le("P2_PACKING",1);Le.P3_WHITESPACE_ELIMINATION=new Le("P3_WHITESPACE_ELIMINATION",2);Le.VALUES=[Le.P1_WIDTH_APPROXIMATION,Le.P2_PACKING,Le.P3_WHITESPACE_ELIMINATION];var $=class{};$.ADDITIONAL_HEIGHT=new m("additionalHeight");$.DRAWING_HEIGHT=new m("drawingHeight");$.DRAWING_WIDTH=new m("drawingWidth");$.MIN_HEIGHT=new m("minHeight");$.MIN_WIDTH=new m("minWidth");$.ROWS=new m("rows");$.TARGET_WIDTH=new m("targetWidth");$.MIN_ROW_INCREASE=new m("minRowIncrease",0);$.MAX_ROW_INCREASE=new m("maxRowIncrease",0);$.MIN_ROW_DECREASE=new m("minRowDecrease",0);$.MAX_ROW_DECREASE=new m("maxRowDecrease",0);var Lo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Lo.ASPECT_RATIO_DRIVEN=new Lo("ASPECT_RATIO_DRIVEN");Lo.MAX_SCALE_DRIVEN=new Lo("MAX_SCALE_DRIVEN");Lo.AREA_DRIVEN=new Lo("AREA_DRIVEN");var Be=class{static computeScaleMeasure(t,e,o){return Math.min(o/t,1/e)}static resetCoordinates(t){for(let e of t)e.setLocation(0,0)}static calculateDimensions(t,e){let o=0,r=0,i=0;for(let s of t)o=Math.max(o,s.getWidth()),r+=s.getHeight()+(i>0&&e||0),i++;return new O(o,r)}static calculateDimensionsOfRectangles(t){let e=0,o=0;for(let r of t)e=Math.max(r.width+r.x,e),o=Math.max(r.height+r.y,o);return new O(e,o)}};var Ss=class{constructor(t,e,o,r,i=0,s=0){this._dar=t,this._drawingWidth=e,this._drawingHeight=o,this._placementOption=r,this._nextXcoordinate=i,this._nextYcoordinate=s,this._area=0,this._aspectRatio=0,this._scaleMeasure=0,this._calcAreaAspectRatioScaleMeasure()}_calcAreaAspectRatioScaleMeasure(){this._drawingWidth>0&&this._drawingHeight>0&&(this._area=this._drawingWidth*this._drawingHeight,this._aspectRatio=this._drawingWidth/this._drawingHeight,this._scaleMeasure=Be.computeScaleMeasure(this._drawingWidth,this._drawingHeight,this._dar))}getDrawingWidth(){return this._drawingWidth}setDrawingWidth(t){this._drawingWidth=t,this._calcAreaAspectRatioScaleMeasure()}getDrawingHeight(){return this._drawingHeight}setDrawingHeight(t){this._drawingHeight=t,this._calcAreaAspectRatioScaleMeasure()}getScaleMeasure(){return this._scaleMeasure}getArea(){return this._area}getAspectRatio(){return this._aspectRatio}getPlacementOption(){return this._placementOption}setPlacementOption(t){this._placementOption=t}getNextXcoordinate(){return this._nextXcoordinate}setNextXcoordinate(t){this._nextXcoordinate=t}getNextYcoordinate(){return this._nextYcoordinate}setNextYcoordinate(t){this._nextYcoordinate=t}getDesiredAspectRatio(){return this._dar}};var Ot=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT=new Ot("CANDIDATE_POSITION_LAST_PLACED_RIGHT");Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW=new Ot("CANDIDATE_POSITION_LAST_PLACED_BELOW");Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT=new Ot("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT");Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW=new Ot("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW");Ot.WHOLE_DRAWING=new Ot("WHOLE_DRAWING");var Ts=class{constructor(t,e,o){this._x=t,this._y=e,this._width=0,this._height=0,this._nodeNodeSpacing=o,this._rects=[]}addRectangle(t){return t.x=this._x+this._width+(this._rects.length===0?0:this._nodeNodeSpacing),t.y=this._y,this._height=Math.max(this._height,t.height),this._width+=t.width+(this._rects.length===0?0:this._nodeNodeSpacing),this._rects.push(t),!0}removeRectangle(t,e){let o=this._rects.indexOf(t);o>=0&&this._rects.splice(o,1),e&&this.updateRow()}updateRow(){let t=0,e=0;for(let o of this._rects)o.x=this._x+t,o.y=this._y,t+=o.width+this._nodeNodeSpacing,e=Math.max(e,o.height+this._nodeNodeSpacing);this._width=t-this._nodeNodeSpacing,this._height=e-this._nodeNodeSpacing}expand(t,e,o){let r=(t-this._width)/this._rects.length;this._height+=e,this._width=t;let i=0;for(let s of this._rects){let a=s.width,l=s.height;s.x=s.x+i*r,s.y=s.y+o*e,s.width=s.width+r,s.height=this._height,i++;let c=s.width,g=s.height;Vs(s,new O(c,g),new O(a,l))}}getY(){return this._y}setY(t){this._y=t}getX(){return this._x}setX(t){this._x=t}getWidth(){return this._width}getHeight(){return this._height}getNodes(){return this._rects}};var cn=class{constructor(t,e,o,r){this._smallestRectWidth=Number.POSITIVE_INFINITY,this._minWidth=0,this._width=0,this._minHeight=0,this._smallestRectHeight=Number.POSITIVE_INFINITY,this._averageHeight=0,this._maxHeight=0,this._height=0,this._children=[],this._rows=[],this._x=t,this._y=e,this._parentRow=o,this._stack=null,this._nodeNodeSpacing=r,this._fixed=!1,this._positionFixed=!1}addChild(t){this._rows.length===0&&this._rows.push(new Ts(this._x,this._y,this._nodeNodeSpacing)),this._children.push(t),this._rows[this._rows.length-1].addRectangle(t),this._adjustSizeAdd(t)}addChildInNewRow(t){this._children.push(t);let e=this.getLastRow();this._rows.push(new Ts(this._x,e.getY()+e.getHeight()+this._nodeNodeSpacing,this._nodeNodeSpacing)),this.getLastRow().addRectangle(t),this._adjustSizeAdd(t)}removeChild(t){let e=this._children.indexOf(t);e>=0&&this._children.splice(e,1);for(let o=0;o<this._rows.length;o++){let r=this._rows[o];if(r.getNodes().includes(t)){r.removeRectangle(t,!0),r.getNodes().length===0&&this._rows.splice(o,1);break}}this._adjustSizeAfterRemove()}setLocation(t,e){this._adjustChildrensXandY(t-this._x,e-this._y);for(let o of this._rows)o.setX(o.getX()+t-this._x),o.setY(o.getY()+e-this._y);this._x=t,this._y=e}_adjustChildrensXandY(t,e){for(let o of this._children)o.setLocation(o.x+t,o.y+e)}_adjustSizeAdd(t){let e=this.getLastRow().getWidth();this._smallestRectWidth=Math.min(this._smallestRectWidth,t.width),this._width=Math.max(this._width,e),this._minWidth=Math.max(this._minWidth,t.width+(this._children.length===1?0:this._nodeNodeSpacing)),this._smallestRectHeight=Math.min(this._smallestRectHeight,t.height),this._maxHeight+=t.height+(this._children.length===1?0:this._nodeNodeSpacing),this._minHeight=Math.max(this._minHeight,t.height);let o=this._rows.length>0?(this._rows.length-1)*this._nodeNodeSpacing:0;for(let r of this._rows)o+=r.getHeight();this._height=o,this._averageHeight=this._maxHeight/this._children.length-this._nodeNodeSpacing*((this._children.length-1)/this._children.length),this._parentRow.notifyAboutNodeChange()}getWidthForTargetHeight(t){if(this._maxHeight<=t)return this._minWidth;if(this._placeRectsInWH(this._minWidth,t,!1))return this._minWidth;let e=this._width,o=this._minWidth,r=this._width,i=(e-o)/2+o;for(;o+1<e;)this._placeRectsInWH(i,t,!1)?(r=i,e=i):o=i,i=(e-o)/2+o;return r}getHeightForTargetWidth(t){return this._placeRectsInW(t,!1).height}_placeRectsInW(t,e){let o=0,r=this._y,i=0,s=0,a=0,l=0,c=0;e&&(this._rows.length=0,this._rows.push(new Ts(this._x,this._y,this._nodeNodeSpacing)));let g=0;for(let h of this._children)o+h.width+(g>0?this._nodeNodeSpacing:0)>t&&a>0&&(o=0,r+=a+this._nodeNodeSpacing,i=Math.max(i,l),s+=a+this._nodeNodeSpacing,a=0,l=0,e&&(c++,this._rows.push(new Ts(this._x,r,this._nodeNodeSpacing))),g=0),l+=h.width+(g>0?this._nodeNodeSpacing:0),a=Math.max(a,h.height),e&&this._rows[c].addRectangle(h),o+=h.width+(g>0?this._nodeNodeSpacing:0),g++;return i=Math.max(i,l),s+=a,e&&(this._width=i,this._height=s,this._parentRow.notifyAboutNodeChange()),new dt(this._x,this._y,i,s)}_placeRectsInWH(t,e,o){let r=this._placeRectsInW(t,o);return r.width<=t&&r.height<=e}placeRectsIn(t,e){if(e===void 0){let o=this._width,r=this._height,i=this._placeRectsInW(t,!0);return i.width!==o||i.height!==r}return this._placeRectsInWH(t,e,!0)}_adjustSizeAfterRemove(){let t=0,e=0,o=[],r=0;for(let i of this._rows)i.getNodes().length!==0&&(o.push(i),t=Math.max(t,i.getWidth()),e+=i.getHeight()+(r>0?this._nodeNodeSpacing:0),r++);this._rows=o,this._height=e,this._width=t,this._minWidth=0,this._minHeight=0,this._maxHeight=0,this._smallestRectHeight=Number.POSITIVE_INFINITY,this._smallestRectWidth=Number.POSITIVE_INFINITY;for(let i of this._children)this._smallestRectWidth=Math.min(this._smallestRectWidth,i.width),this._minWidth=Math.max(this._minWidth,i.width),this._minHeight=Math.max(this._minHeight,i.height),this._smallestRectHeight=Math.min(this._smallestRectHeight,i.height),this._maxHeight+=i.height+this._nodeNodeSpacing;this._children.length>0&&(this._averageHeight=this._maxHeight/this._children.length-this._nodeNodeSpacing*((this._children.length-1)/this._children.length)),this._parentRow.notifyAboutNodeChange()}expand(t,e){let o=this._width+t;this._width+=t,this._height+=e;let r=e/this._rows.length,i=0;for(let s of this._rows)s.expand(o,r,i),i++}getWidth(){return this._width}setWidth(t){this._width=t}getHeight(){return this._height}setHeight(t){this._height=t}getChildren(){return this._children}getX(){return this._x}getY(){return this._y}getParentRow(){return this._parentRow}setParentRow(t){this._parentRow=t}getMinWidth(){return this._minWidth}getMinHeight(){return this._minHeight}getMaxHeight(){return this._maxHeight}getSmallestRectHeight(){return this._smallestRectHeight}getSmallestRectWidth(){return this._smallestRectWidth}setSmallestRectWidth(t){this._smallestRectWidth=t}getAverageHeight(){return this._averageHeight}isFixed(){return this._fixed}setFixed(t){this._fixed=t}isPositionFixed(){return this._positionFixed}setPositionFixed(t){this._positionFixed=t}getRows(){return this._rows}getLastRow(){return this._rows[this._rows.length-1]}getLastRowNewX(){let t=this.getLastRow();return t.getX()+t.getWidth()}getLastRowY(){return this.getLastRow().getY()}getStack(){return this._stack}setStack(t){this._stack=t}resetBlock(){this._adjustSizeAfterRemove()}};var xi=class{constructor(t,e,o){this._blocks=[],this._x=t,this._y=e,this._width=0,this._height=0,this._nodeNodeSpacing=o}addBlock(t){t.setStack(this),this._width=Math.max(this._width,t.getWidth()),this._height+=t.getHeight()+(this._blocks.length===0?0:this._nodeNodeSpacing),this._blocks.push(t)}updateDimension(){let t=0,e=0,o=0;for(let r of this._blocks)e=Math.max(e,r.getWidth()),t+=r.getHeight()+(o>0?this._nodeNodeSpacing:0),o++;this._height=t,this._width=e}setLocation(t,e){let o=t-this._x,r=e-this._y;for(let i of this._blocks)i.setLocation(i.getX()+o,i.getY()+r);this._x=t,this._y=e}getWidthForFixedHeight(t){if(this._blocks.length===1)return this._blocks[0].getWidthForTargetHeight(t);let e=this._getMinimumWidth(),o=0,r=this._width,i=e,s=this._width,a=(r-i)/2+i;for(;i+1<r;){o=0;for(let l of this._blocks)o+=l.getHeightForTargetWidth(a);o<t?(s=a,r=a):i=a,a=(r-i)/2+i}return s}placeRectsIn(t){let e=this._y,o=0,r=0;for(let i of this._blocks)i.setLocation(this._x,e),i.placeRectsIn(t),r=Math.max(r,i.getWidth()),e+=i.getHeight()+this._nodeNodeSpacing,o=e;this._width=r,this._height=o}expand(t,e){let o=e/this._blocks.length,r=0;for(let i of this._blocks)i.setLocation(i.getX(),i.getY()+r*o),i.expand(this.getWidth()-i.getWidth()+t,o),r++}_getMinimumWidth(){let t=0;for(let e of this._blocks)t=Math.max(t,e.getMinWidth());return t}getBlocks(){return this._blocks}getX(){return this._x}getY(){return this._y}getWidth(){return this._width}setWidth(t){this._width=t}getHeight(){return this._height}setHeight(t){this._height=t}};var Wa=class{constructor(t,e){this._height=0,this._width=0,this._y=t,this._nodeNodeSpacing=e,this._children=[],this._stacks=[],this._potentialAdditionalWidthToGetLastBlock=0}notifyAboutNodeChange(){let t=0,e=Number.NEGATIVE_INFINITY,o=0;for(let r of this._children)t+=r.getWidth()+(o>0?this._nodeNodeSpacing:0),e=Math.max(e,r.getHeight()),o++;this._width=t,this._height=e}expand(t,e){let r=(t-this._width)/this._stacks.length,i=0;for(let s of this._stacks){let a=this.getHeight()-s.getHeight()+e;s.setLocation(s.getX()+i*r,s.getY()),s.expand(r,a),i++}}calculateBlockStacks(){let t=-1;for(let e of this._children)if(e.getX()!==t){let o=new xi(e.getX(),this._y,this._nodeNodeSpacing);this._stacks.push(o),o.addBlock(e),t=e.getX()}else this._stacks[this._stacks.length-1].addBlock(e)}getFirstBlock(){return this._children[0]}getLastBlock(){return this._children[this._children.length-1]}getNumberOfAssignedBlocks(){return this._children.length}addBlock(t){this._height=Math.max(this._height,t.getHeight()),this._width+=t.getWidth()+(this._children.length===0?0:this._nodeNodeSpacing),this._children.push(t)}removeBlock(t){let e=this._children.indexOf(t);e>=0&&this._children.splice(e,1),this._width-=t.getWidth()+(this._children.length===0?0:this._nodeNodeSpacing);let o=Number.MIN_VALUE;for(let r of this._children)o=Math.max(o,r.getHeight());this._height=o}getHeight(){return this._height}setHeight(t){this._height=t}getWidth(){return this._width}setWidth(t){this._width=t}getY(){return this._y}setY(t){let e=t-this._y;for(let o of this._stacks)o.setLocation(o.getX(),o.getY()+e);this._y=t}getChildren(){return this._children}getStacks(){return this._stacks}getPotentialAdditionalWidthToGetLastBlock(){return this._potentialAdditionalWidthToGetLastBlock}setPotentialAdditionalWidthToGetLastBlock(t){this._potentialAdditionalWidthToGetLastBlock=t}resetStacks(){this._stacks=[]}};var Di=class n{static place(t,e,o){let r=[],i=new Wa(0,o),s=0;i.addBlock(new cn(0,0,i,o));let a=0;for(let l of t){let c=i.getLastBlock();if((a+l.width+(i.getChildren()[0].getChildren().length===0?0:o)>e||l.getProperty(gn))&&(a=0,s+=i.getHeight()+o,r.push(i),i=new Wa(s,o),c=new cn(0,i.getY(),i,o),i.addBlock(c),a=0),c.getChildren().length===0||!l.parent.getProperty(Zc)&&n.isSimilarHeight(c,l,o))c.addChild(l);else{let h=new cn(c.getX()+c.getWidth()+o,i.getY(),i,o);i.addBlock(h),h.addChild(l)}a=l.x+l.width}return r.push(i),r}static placeRectInBlock(t,e,o,r,i){if(n.isSimilarHeight(e,o,i)){if(e.getLastRowNewX()+o.width+i<=r&&(e.getLastRowY()-t.getY()+o.height<=t.getHeight()||t.getChildren().length===1))return e.addChild(o),!0;if(e.getX()+o.width<=r&&e.getY()+e.getHeight()+o.height+i<=t.getY()+t.getHeight())return e.addChildInNewRow(o),!0}return!1}static isSimilarHeight(t,e,o){return e.height>=t.getSmallestRectHeight()&&e.height<=t.getMinHeight()?!0:t.getAverageHeight()*.5<=e.height&&t.getAverageHeight()*1.5>=e.height}};var jc=class n{static compact(t,e,o,r,i){let s=!1,a=!1,l=t+1,c=e[t],g=c.getChildren(),h=null;for(let d=0;d<c.getNumberOfAssignedBlocks();d++){let f=g[d];if(f.isFixed())continue;if(f.getChildren().length===0){c.removeBlock(f),d--,s=!0;continue}if(!f.isPositionFixed()){h!=null&&h.updateDimension();let S=h==null?0:h.getX()+h.getWidth()+r;h=new xi(S,c.getY(),r),f.setLocation(h.getX()+h.getWidth(),c.getY()),c.getStacks().push(h),h.addBlock(f),f.setPositionFixed(!0)}let E=n._getNextBlock(e,c,d,l),P=!1;if(E!=null&&(P=E.getParentRow()!==c),E!=null){if(E.getChildren().length>0&&!E.getChildren()[0].getProperty(gn))n._useRowWidth(f,o),n._absorbBlocks(c,f,E,o,r)&&(s=!0);else{c.removeBlock(E);break}if(E.getChildren().length===0)for(e.length>l&&e[l].removeBlock(E),E=null;e.length>l&&e[l].getChildren().length===0;)e.splice(l,1);if(E==null){d--;continue}if(!E.getChildren()[0].getProperty(gn)&&n._placeBelow(e,c,f,E,P,o,l,r)){s=!0;continue}if(P){let S=c.getHeight(),T=E.getMinHeight();if(!E.getChildren()[0].getProperty(gn)&&n._placeBeside(e,c,f,E,P,o,l,r,i)){if(s=!0,S<T){a=!0,E.setParentRow(c);break}continue}if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0;continue}}else if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0;continue}if(s)continue}if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0,E!=null&&E.setPositionFixed(!1);continue}else f.getStack().updateDimension()}return Gt.of(s,a)}static _getNextBlock(t,e,o,r){return o<e.getNumberOfAssignedBlocks()-1?e.getChildren()[o+1]:r<t.length&&t[r].getChildren().length>0?t[r].getChildren()[0]:null}static _useRowHeight(t,e){let o=!1,r=e.getStack().getWidth();if(e.getHeight()<t.getHeight()){let i=e.getStack().getWidthForFixedHeight(t.getHeight());e.getStack().getWidth()>i&&(e.getStack().placeRectsIn(i),o=r!==e.getStack().getWidth())}return o}static _useRowWidth(t,e){t.placeRectsIn(e-t.getX()),t.getStack().updateDimension()}static _absorbBlocks(t,e,o,r,i){let s=!1,a=o.getChildren()[0];for(;Di.placeRectInBlock(t,e,a,r,i)&&(s=!0,o.removeChild(a),o.getChildren().length!==0);)a=o.getChildren()[0];return o.getChildren().length===0&&o.getParentRow().removeBlock(o),s&&e.getStack().updateDimension(),s}static _placeBelow(t,e,o,r,i,s,a,l){let c=!1,g=s-o.getX(),h=o.getY()-e.getY()+o.getHeightForTargetWidth(g);if(r.getMinWidth()+l>g)return!1;let d=r.getHeightForTargetWidth(g);return h+l+d<=e.getHeight()&&(o.placeRectsIn(s-o.getX()),o.setFixed(!0),r.placeRectsIn(s-o.getX()),r.setLocation(o.getX(),o.getY()+o.getHeight()+l),r.setPositionFixed(!0),o.getStack().addBlock(r),c=!0,i&&(e.addBlock(r),r.setParentRow(e),t.length>a&&(t[a].removeBlock(r),t[a].getChildren().length===0&&t.splice(a,1)))),c}static _placeBeside(t,e,o,r,i,s,a,l,c){let g=!1,h=o.getStack().getWidthForFixedHeight(e.getY()+e.getHeight()-o.getStack().getY()),d=r.getMinHeight()>e.getHeight()&&c,f=s-(o.getStack().getX()+h-l),E=r.getHeightForTargetWidth(f);if(d&&E>r.getMinHeight())return!1;if(d){let S=0;for(let T of e.getStacks())S+=T.getWidthForFixedHeight(r.getMinHeight())+l;f=s-S}if(f<r.getMinWidth())return!1;let P=a===t.length-1&&f>=t[a].getWidth();return!d&&E>e.getHeight()&&!P?!1:((P||d||E<=e.getHeight())&&(P&&E>e.getHeight()?(o.setHeight(E),o.placeRectsIn(o.getWidthForTargetHeight(E))):(o.getStack().placeRectsIn(h),o.setFixed(!0)),r.placeRectsIn(s-(o.getX()+o.getWidth())),r.setLocation(o.getStack().getX()+o.getStack().getWidth(),e.getY()),e.addBlock(r),t.length>a&&(t[a].removeBlock(r),t[a].getChildren().length===0&&t.splice(a,1)),g=!0),g)}};var za=class{constructor(t,e){this._aspectRatio=t,this._nodeNodeSpacing=e,this.potentialRowWidthDecreaseMin=Number.POSITIVE_INFINITY,this.potentialRowWidthDecreaseMax=0,this.potentialRowWidthIncreaseMin=Number.POSITIVE_INFINITY,this.potentialRowWidthIncreaseMax=0}start(t,e,o,r){let i=o.getProperty($.TARGET_WIDTH),s=o.getProperty($.MIN_WIDTH),a=o.getProperty($.MIN_HEIGHT);Be.resetCoordinates(o.children);let l=Di.place(o.children,i,this._nodeNodeSpacing);for(let f=0;f<l.length;f++){let E=l[f];if(f!==0){let S=l[f-1];E.setY(S.getY()+S.getHeight()+this._nodeNodeSpacing)}if(jc.compact(f,l,i,this._nodeNodeSpacing,o.getProperty(Zc)).getSecond()){for(let S of E.getChildren())S.setFixed(!1),S.setPositionFixed(!1),S.resetBlock();E.resetStacks(),E.setWidth(i),f--}else{if(this._adjustWidthAndHeight(E),f+1<l.length){let S=l[f+1].getFirstBlock(),T=E.getWidth()+this._nodeNodeSpacing+S.getWidth()-i;if(this.potentialRowWidthIncreaseMax=Math.max(T,this.potentialRowWidthDecreaseMax),this.potentialRowWidthIncreaseMin=Math.min(T,this.potentialRowWidthDecreaseMin),E.getStacks().length!==0){let N=E.getStacks()[E.getStacks().length-1],I=E.getStacks().length<=1?0:this._nodeNodeSpacing;this.potentialRowWidthDecreaseMax=Math.max(this.potentialRowWidthDecreaseMax,N.getWidth()+I),this.potentialRowWidthDecreaseMin=Math.min(this.potentialRowWidthDecreaseMax,N.getWidth()+I)}}if(l.length===1){let S=E.getStacks()[E.getStacks().length-1],T=S.getBlocks()[S.getBlocks().length-1];for(let N of T.getRows())this.potentialRowWidthDecreaseMax=Math.max(this.potentialRowWidthDecreaseMax,T.getWidth()-N.getWidth()),this.potentialRowWidthDecreaseMin=Math.min(this.potentialRowWidthDecreaseMin,T.getWidth()-N.getWidth()),this.potentialRowWidthIncreaseMax=Math.max(this.potentialRowWidthIncreaseMax,N.getWidth()+this._nodeNodeSpacing),this.potentialRowWidthIncreaseMin=Math.min(this.potentialRowWidthIncreaseMin,N.getWidth()+this._nodeNodeSpacing)}}}let c=Be.calculateDimensions(l,this._nodeNodeSpacing),g=Math.max(c.x,s-r.getHorizontal()),d=Math.max(c.y,a-r.getVertical())-c.y;return o.setProperty($.ADDITIONAL_HEIGHT,d),o.setProperty($.ROWS,l),new Ss(this._aspectRatio,g,c.y+d,Ot.WHOLE_DRAWING)}_adjustWidthAndHeight(t){let e=0,o=0,r=0;for(let i of t.getStacks())i.updateDimension(),e=Math.max(e,i.getHeight()),o+=i.getWidth()+(r>0?this._nodeNodeSpacing:0),r++;t.setHeight(e),t.setWidth(o)}};var _r=new m("org.eclipse.elk.padding",new yt(15)),Cr=new m("org.eclipse.elk.spacing.nodeNode",15,0),Ns=new m("org.eclipse.elk.aspectRatio",1.3),BE=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1);var $c=class{process(t,e){e.begin("Compaction",1);let o=t.children,r=t.getProperty(Ns),i=t.getProperty(Cr),s=t.getProperty(_r),a=new za(r,i),l=a.start(o,e,t,s);this._copyRowWidthChangeValues(t,a);let c=t.getProperty(UE);for(;c>1;){let g=this._clone(t),h=l.getScaleMeasure();this._configureSecondIteration(t,g,l),a=new za(r,i);let d=a.start(o,e,g,s),f=d.getScaleMeasure();if(f>=h&&Number.isFinite(f)){for(let E=0;E<g.children.length;E++)this._copyPosition(g.children[E],t.children[E]);this._copyRowWidthChangeValues(t,a),l.setDrawingWidth(d.getDrawingWidth()),l.setDrawingHeight(d.getDrawingHeight())}c--}t.setProperty($.DRAWING_HEIGHT,l.getDrawingHeight()),t.setProperty($.DRAWING_WIDTH,l.getDrawingWidth()),e.done()}_copyRowWidthChangeValues(t,e){t.setProperty($.MIN_ROW_INCREASE,e.potentialRowWidthIncreaseMin),t.setProperty($.MAX_ROW_INCREASE,e.potentialRowWidthIncreaseMax),t.setProperty($.MIN_ROW_DECREASE,e.potentialRowWidthDecreaseMin),t.setProperty($.MAX_ROW_DECREASE,e.potentialRowWidthDecreaseMax)}_configureSecondIteration(t,e,o){let r=t.getProperty(_r),i=t.getProperty(Ns);t.children.length>1&&t.getProperty($.MIN_ROW_INCREASE)!==Number.POSITIVE_INFINITY&&(o.getDrawingWidth()+r.getHorizontal())/(o.getDrawingHeight()+r.getVertical())<i?e.setProperty($.TARGET_WIDTH,t.getProperty($.TARGET_WIDTH)+t.getProperty($.MIN_ROW_INCREASE)):t.children.length>1&&t.getProperty($.MIN_ROW_DECREASE)!==Number.POSITIVE_INFINITY&&(o.getDrawingWidth()+r.getHorizontal())/(o.getDrawingHeight()+r.getVertical())>i&&e.setProperty($.TARGET_WIDTH,Math.max(t.getProperty($.MIN_WIDTH),e.getProperty($.TARGET_WIDTH)-t.getProperty($.MIN_ROW_DECREASE)))}_clone(t){let e=Oa();typeof t.copyProperties=="function"&&e.copyProperties(t);for(let o of t.children){let r=Fs(e);r.width=o.width,r.height=o.height,r.identifier=o.identifier,r.x=o.x,r.y=o.y,typeof r.copyProperties=="function"&&r.copyProperties(o)}return e}_copyPosition(t,e){e.width=t.width,e.height=t.height,e.x=t.x,e.y=t.y;for(let o=0;o<t.children.length;o++)this._copyPosition(t.children[o],e.children[o])}getLayoutProcessorConfiguration(){return null}};var qc=class{process(t,e){e.begin("Simple Placement",1);let o=t.getProperty($.TARGET_WIDTH),r=t.getProperty(Cr),i=t.getProperty(_r);Be.resetCoordinates(t.children);let s=Di.place(t.children,o,r),a,l=t.children;if(s==null)a=Be.calculateDimensionsOfRectangles(l);else{for(let d of s)for(let f of d.getChildren()){let E=new xi(f.getX(),f.getY(),r);E.addBlock(f),d.getStacks().push(E)}a=Be.calculateDimensions(s,r)}let c=Math.max(a.x,t.getProperty($.MIN_WIDTH)-i.getHorizontal()),g=Math.max(a.y,t.getProperty($.MIN_HEIGHT)-i.getVertical()),h=g-a.y;t.setProperty($.ADDITIONAL_HEIGHT,h),t.setProperty($.DRAWING_WIDTH,c),t.setProperty($.DRAWING_HEIGHT,g+h),t.setProperty($.ROWS,s),e.done()}getLayoutProcessorConfiguration(){return null}};var Jc=class{process(t,e){e.begin("No Compaction",1);let o=t.getProperty(_r),r=t.children,i=Be.calculateDimensionsOfRectangles(r),s=Math.max(i.x,t.getProperty($.MIN_WIDTH)-o.getHorizontal()),a=Math.max(i.y,t.getProperty($.MIN_HEIGHT)-o.getVertical()),l=a-i.y;t.setProperty($.ADDITIONAL_HEIGHT,l),t.setProperty($.DRAWING_WIDTH,s),t.setProperty($.DRAWING_HEIGHT,a+l),e.done()}getLayoutProcessorConfiguration(){return null}};var xr=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.COMPACTION:return new $c;case n.SIMPLE:return new qc;case n.NONE:return new Jc;default:return null}}};xr.COMPACTION=new xr("COMPACTION",0);xr.SIMPLE=new xr("SIMPLE",1);xr.NONE=new xr("NONE",2);var Qc=class{static expand(t,e,o,r){let i=o/t.length,s=0;for(let a of t)a.setY(a.getY()+i*s),a.expand(e,i),s++}};var hn=class{process(t,e){if(e.begin("Equal Whitespace Eliminator",1),t.hasProperty($.ROWS))Qc.expand(t.getProperty($.ROWS),t.getProperty($.DRAWING_WIDTH),t.getProperty($.ADDITIONAL_HEIGHT),t.getProperty(Cr));else throw new Error("The graph does not contain rows.");e.done()}getLayoutProcessorConfiguration(){return null}};var tg=class extends hn{process(t,e){e.begin("To Aspect Ratio Whitespace Eliminator",1);let o=t.getProperty($.DRAWING_WIDTH),r=t.getProperty($.DRAWING_HEIGHT),i=t.getProperty(Ns),s=t.getProperty($.ADDITIONAL_HEIGHT);o/r<i?(o=r*i,t.setProperty($.DRAWING_WIDTH,o)):(s+=o/i-r,t.setProperty($.ADDITIONAL_HEIGHT,s),t.setProperty($.DRAWING_HEIGHT,r+s)),super.process(t,e),e.done()}};var Dr=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.EQUAL_BETWEEN_STRUCTURES:return new hn;case n.TO_ASPECT_RATIO:return new tg;case n.NONE:default:return null}}};Dr.EQUAL_BETWEEN_STRUCTURES=new Dr("EQUAL_BETWEEN_STRUCTURES",0);Dr.TO_ASPECT_RATIO=new Dr("TO_ASPECT_RATIO",1);Dr.NONE=new Dr("NONE",2);var pr=class n{static getWidthLPRorLPB(t,e,o){return Math.max(t,e+o)}static getHeightLPRorLPB(t,e,o){return Math.max(t,e+o)}static calculateYforLPR(t,e,o,r){let i=null,s=0;for(let a of e)if(n._verticalOrderConstraint(a,t,r)){if(i==null)i=a;else{let l=a.y+a.height;o.y-l<o.y-s&&(i=a)}s=i.y+i.height}return i==null?0:s+r}static calculateXforLPB(t,e,o,r){let i=null,s=0;for(let a of e)if(n._horizontalOrderConstraint(a,t,r)){if(i==null)i=a;else{let l=a.x+a.width;o.x-l<o.x-s&&(i=a)}s=i.x+i.width}return i==null?0:s+r}static calculateAreaLPR(t,e,o){let r=t.y+t.height,i=o.getNextYcoordinate()+e.height,a=Math.max(r,i)-Math.min(t.y,o.getNextYcoordinate());return(o.getNextXcoordinate()+e.width-t.x)*a}static calculateAreaLPB(t,e,o){let r=t.x+t.width,i=o.getNextXcoordinate()+e.width,a=Math.max(r,i)-Math.min(t.x,o.getNextXcoordinate()),l=o.getNextYcoordinate()+e.height-t.y;return a*l}static _verticalOrderConstraint(t,e,o){return e<t.x+t.width+o}static _horizontalOrderConstraint(t,e,o){return e<t.y+t.height+o}};var dn=class{filterList(t,e,o){let r=Number.NEGATIVE_INFINITY;for(let s of t){let a=Be.computeScaleMeasure(s.getDrawingWidth()+o.getHorizontal(),s.getDrawingHeight()+o.getVertical(),s.getDesiredAspectRatio());a>r&&(r=a)}let i=[];for(let s of t)Be.computeScaleMeasure(s.getDrawingWidth()+o.getHorizontal(),s.getDrawingHeight()+o.getVertical(),s.getDesiredAspectRatio())===r&&i.push(s);return i}};var fn=class{filterList(t,e,o){let r=Number.POSITIVE_INFINITY;for(let s of t){let a=(s.getDrawingWidth()+o.getHorizontal())*(s.getDrawingHeight()+o.getVertical());a<r&&(r=a)}let i=[];for(let s of t)(s.getDrawingWidth()+o.getHorizontal())*(s.getDrawingHeight()+o.getVertical())===r&&i.push(s);return i}};var un=class{filterList(t,e,o){let r=Number.POSITIVE_INFINITY;for(let s of t){let a=Math.abs((s.getDrawingWidth()+o.getHorizontal())/(s.getDrawingHeight()+o.getVertical())-e);a<r&&(r=a)}let i=[];for(let s of t)Math.abs((s.getDrawingWidth()+o.getHorizontal())/(s.getDrawingHeight()+o.getVertical())-e)===r&&i.push(s);return i}};var eg=class{constructor(t,e,o){this._aspectRatio=t,this._goal=e,this._lpShift=o}approxBoundingBox(t,e,o){let r=t[0];r.x=0,r.y=0;let i=[r],s=r,a=new Ss(this._aspectRatio,r.width,r.height,Ot.WHOLE_DRAWING);for(let l=1;l<t.length;l++){let c=t[l],g=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT,c,s,a,i,e),h=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW,c,s,a,i,e),d=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,c,s,a,i,e),f=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,c,s,a,i,e),E=this._findBestCandidate(g,h,d,f,c,s,o);c.x=E.getNextXcoordinate(),c.y=E.getNextYcoordinate(),E.setPlacementOption(Ot.WHOLE_DRAWING),a=E,s=c,i.push(c)}return a}_findBestCandidate(t,e,o,r,i,s,a){let l=[t,e,o,r],c;switch(this._goal){case Lo.MAX_SCALE_DRIVEN:c=[new dn,new fn,new un];break;case Lo.ASPECT_RATIO_DRIVEN:c=[new un,new fn,new dn];break;case Lo.AREA_DRIVEN:c=[new fn,new dn,new un];break;default:c=[]}for(let g of c)l.length>1&&(l=g.filterList(l,this._aspectRatio,a));return l.length===1?l[0]:l.length===2?this._checkSpecialCases(l[0],l[1],s,i):null}_checkSpecialCases(t,e,o,r){let i=t.getPlacementOption(),s=e.getPlacementOption(),a=i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW||i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,l=s===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW||s===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,c=i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,g=s===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||s===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,h=i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW,d=s===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||s===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW;if(a&&l)return i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW?t:e;if(c&&g)return i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT?t:e;if(h&&d){let f,E;i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT?(f=t,E=e):(f=e,E=t);let P=pr.calculateAreaLPR(o,r,f),S=pr.calculateAreaLPB(o,r,E);return P<=S?i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT?t:e:i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW?t:e}return t}_calcValuesForOpt(t,e,o,r,i,s){let a=0,l=0,c=r.getDrawingWidth(),g=r.getDrawingHeight(),h=e.height,d=e.width,f,E;switch(t){case Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT:a=o.x+o.width+s,this._lpShift?l=pr.calculateYforLPR(a,i,o,s):l=o.y,f=pr.getWidthLPRorLPB(c,a,d),E=pr.getHeightLPRorLPB(g,l,h);break;case Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW:l=o.y+o.height+s,this._lpShift?a=pr.calculateXforLPB(l,i,o,s):a=o.x,f=pr.getWidthLPRorLPB(c,a,d),E=pr.getHeightLPRorLPB(g,l,h);break;case Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT:a=c+s,l=0,f=c+s+d,E=Math.max(g,h);break;case Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW:a=0,l=g+s,f=Math.max(c,d),E=g+s+h;break;default:throw new Error("IllegalPlacementOption")}return new Ss(this._aspectRatio,f,E,t,a,l)}};var og=class{process(t,e){e.begin("Greedy Width Approximator",1);let o=t.getProperty(Ns),r=t.getProperty(_r),i=t.getProperty(FE),s=t.getProperty(kE),a=t.getProperty(Cr),l=t.children;Be.resetCoordinates(l);let g=new eg(o,i,s).approxBoundingBox(l,a,r);t.setProperty($.TARGET_WIDTH,g.getDrawingWidth()),e.done()}getLayoutProcessorConfiguration(){return null}};var rg=class{process(t,e){if(e.begin("Target Width Setter",1),t.hasProperty(Vu))t.setProperty($.TARGET_WIDTH,t.getProperty(Vu));else throw new Error("A target width has to be set if the TargetWidthWidthApproximator should be used.");e.done()}getLayoutProcessorConfiguration(){return null}};var Mi=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.GREEDY:return new og;case n.TARGET_WIDTH:return new rg;default:throw new Error(`WidthApproximationStrategy.${this}: no implementation available.`)}}};Mi.GREEDY=new Mi("GREEDY",0);Mi.TARGET_WIDTH=new Mi("TARGET_WIDTH",1);var WE=new m("org.eclipse.elk.rectpacking.widthApproximation.strategy",()=>Mi.GREEDY),Vu=new m("org.eclipse.elk.rectpacking.widthApproximation.targetWidth",-1),FE=new m("org.eclipse.elk.rectpacking.widthApproximation.optimizationGoal",()=>Lo.MAX_SCALE_DRIVEN),kE=new m("org.eclipse.elk.rectpacking.widthApproximation.lastPlaceShift",!0),zE=new m("org.eclipse.elk.rectpacking.packing.strategy",()=>xr.COMPACTION),Zc=new m("org.eclipse.elk.rectpacking.packing.compaction.rowHeightReevaluation",!1),UE=new m("org.eclipse.elk.rectpacking.packing.compaction.iterations",1,1),YE=new m("org.eclipse.elk.rectpacking.whiteSpaceElimination.strategy",()=>Dr.NONE),VE=new m("org.eclipse.elk.rectpacking.trybox",!1),XE=new m("org.eclipse.elk.rectpacking.currentPosition",-1,-1),Ya=new m("org.eclipse.elk.rectpacking.desiredPosition",-1,-1),gn=new m("org.eclipse.elk.rectpacking.inNewRow",!1),KE=new m("org.eclipse.elk.rectpacking.orderBySize",!1);var ig=class{static compare(t,e){return e.height-t.height}};var sg=class{process(t,e){e.begin("Node Size Reorderer",1),t.children.sort(ig.compare),e.done()}};var ng=class{process(t,e){e.begin("Interactive Node Reorderer",1);let o=t.children,r=[];for(let s of o)s.hasProperty(Ya)&&r.push(s);for(let s of r){let a=o.indexOf(s);a>=0&&o.splice(a,1)}r.sort((s,a)=>{let l=s.getProperty(Ya),c=a.getProperty(Ya);return l===c?-1:l-c});for(let s of r){let a=s.getProperty(Ya);a=Math.min(a,o.length),o.splice(a,0,s)}let i=0;for(let s of o)s.setProperty(XE,i),i++;e.done()}};var ag=class{process(t,e){e.begin("Min Size Preprocessing",1);let o=ya(t);t.setProperty($.MIN_WIDTH,o.x),t.setProperty($.MIN_HEIGHT,o.y),e.done()}};var lg=class{process(t,e){e.begin("Min Size Postprocessing",1),t.setProperty($.TARGET_WIDTH,Math.max(t.getProperty($.TARGET_WIDTH),t.getProperty($.MIN_WIDTH))),e.done()}};var xe=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NODE_SIZE_REORDERER:return new sg;case n.INTERACTIVE_NODE_REORDERER:return new ng;case n.MIN_SIZE_PRE_PROCESSOR:return new ag;case n.MIN_SIZE_POST_PROCESSOR:return new lg;default:throw new Error(`IntermediateProcessorStrategy.${this}: no implementation available.`)}}};xe.NODE_SIZE_REORDERER=new xe("NODE_SIZE_REORDERER",0);xe.INTERACTIVE_NODE_REORDERER=new xe("INTERACTIVE_NODE_REORDERER",1);xe.MIN_SIZE_PRE_PROCESSOR=new xe("MIN_SIZE_PRE_PROCESSOR",2);xe.MIN_SIZE_POST_PROCESSOR=new xe("MIN_SIZE_POST_PROCESSOR",3);xe.VALUES=[xe.NODE_SIZE_REORDERER,xe.INTERACTIVE_NODE_REORDERER,xe.MIN_SIZE_PRE_PROCESSOR,xe.MIN_SIZE_POST_PROCESSOR];var cg=class n extends de{constructor(){super(),this._algorithmAssembler=Io.create(Le.VALUES)}layout(t,e){e.begin("Rectangle Packing",1);let o=t.getProperty(_r),r=t.getProperty(BE),i=t.getProperty(Cr),s=t.getProperty(VE),a=t.children;t.getProperty(So)||Go.forGraph(t).execute();let l=!1;if(s&&a.length>=3){let d=a[0],f=a[1],E=0;for(;E+2<a.length;){let P=d;if(d=f,f=a[E+2],P.height>=d.height+f.height+i||f.height>=P.height+d.height+i){l=!0;break}E++}}else l=!0;if(!l){let d=a.length;for(let f of a)f.setProperty(mu,d),d--;new rs().layout(t,new Ie),e.done();return}let c=this._assembleAlgorithm(t);for(let d of c){if(typeof e.isCanceled=="function"&&e.isCanceled())return;let f=typeof e.subTask=="function"?e.subTask(1/c.length):e;d.process(t,f)}let g=0,h=0;for(let d of a)g=Math.max(g,d.x+d.width),h=Math.max(h,d.y+d.height);Vs(t,new O(t.getProperty($.DRAWING_WIDTH),t.getProperty($.DRAWING_HEIGHT)),new O(g,h)),n._applyPadding(a,o),r||Ae(t,t.getProperty($.DRAWING_WIDTH)+o.getHorizontal(),t.getProperty($.DRAWING_HEIGHT)+o.getVertical(),!1,!0),t.getProperty(So)||Go.forGraph(t).execute(),e.done()}static _applyPadding(t,e){for(let o of t)o.setLocation(o.x+e.getLeft(),o.y+e.getTop())}_assembleAlgorithm(t){return this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Le.P1_WIDTH_APPROXIMATION,t.getProperty(WE)),this._algorithmAssembler.setPhase(Le.P2_PACKING,t.getProperty(zE)),this._algorithmAssembler.setPhase(Le.P3_WHITESPACE_ELIMINATION,t.getProperty(YE)),this._algorithmAssembler.addProcessorConfiguration(this._getPhaseIndependentConfig(t)),this._algorithmAssembler.build(t)}_getPhaseIndependentConfig(t){let e=K.create();return e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.MIN_SIZE_PRE_PROCESSOR),e.addBefore(Le.P2_PACKING,xe.MIN_SIZE_POST_PROCESSOR),t.getProperty(KE)&&e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.NODE_SIZE_REORDERER),t.getProperty(zo)&&e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.INTERACTIVE_NODE_REORDERER),e}};var ZE="org.eclipse.elk.rectpacking",jE=!1;function $E(){let n=Ht.getInstance(),t=n.getAlgorithmData(ZE);if(t)return jE=!0,t;let e=new Se.Builder().id(ZE).name("ELK Rectpacking").description("Rectangle packing layout.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.rectpacking").providerFactory(()=>new cg).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),jE=!0,e}var Zo=class{static execute(t,e,o){let r=[...t],i;typeof o=="function"?i=[o]:o!=null&&typeof o.handle=="function"?i=[o]:i=[...o],r.sort(e);for(let s of r)for(let a of i)typeof a=="function"?a(s):a.handle(s)}};var ee=class{};ee.FUZZINESS=1e-4;ee.DEBUG_SVG=new m("debugSVG",!1);ee.OVERLAPS_EXISTED=new m("overlapsExisted",!0);function qE(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var gg=class{constructor(t,e){this.node=t,this.low=e}},Xu=class n{constructor(){this._items=[]}static _compare(t,e){let o=t.rect.x-e.rect.x;return o!==0||(o=t.originalVertex.x-e.originalVertex.x,o!==0)?o:t.originalVertex.y-e.originalVertex.y}add(t){for(let e=0;e<this._items.length;e++){let o=n._compare(this._items[e],t);if(o===0)return!1;if(o>0)return this._items.splice(e,0,t),!0}return this._items.push(t),!0}remove(t){let e=this._items.indexOf(t);return e>=0?(this._items.splice(e,1),!0):!1}clear(){this._items.length=0}[Symbol.iterator](){return this._items[Symbol.iterator]()}},hg=class n{constructor(t,e){this._overlapHandler=t}_applyHandler(t,e){typeof this._overlapHandler=="function"?this._overlapHandler(t,e):this._overlapHandler.handle(t,e)}sweep(t){let e=[];for(let r of t)e.push(new gg(r,!0)),e.push(new gg(r,!1));let o=new Ku(this);o.init(),Zo.execute(e,n._compareTimestamps,o)}static _compareTimestamps(t,e){let o=t.node.rect.y;t.low||(o+=t.node.rect.height);let r=e.node.rect.y;e.low||(r+=e.node.rect.height);let i=o-r;if(i===0){if(!t.low&&e.low)return-1;if(!e.low&&t.low)return 1}return i}},Ku=class{constructor(t){this._owner=t,this._intervalsSortLeft=new Xu}init(){this._intervalsSortLeft.clear()}handle(t){t.low?this._insert(t):this._delete(t)}_insert(t){if(!this._intervalsSortLeft.add(t.node))throw new Error("Invalid hitboxes for scanline overlap calculation.");let o=!1;for(let r of this._intervalsSortLeft)if(this._overlap(t.node,r))this._owner._applyHandler(t.node,r),o=!0;else if(o)break}_delete(t){this._intervalsSortLeft.remove(t.node)}_overlap(t,e){if(t==null||e==null||t===e)return!1;let o=ee.FUZZINESS;return qE(t.rect.x,e.rect.x+e.rect.width,o)<0&&qE(e.rect.x,t.rect.x+t.rect.width,o)<0}};var Ue=class n{constructor(t,e){this.u=t,this.v=e}equals(t){return t instanceof n?dg(this.u,t.u)&&dg(this.v,t.v)||dg(this.u,t.v)&&dg(this.v,t.u):!1}};function dg(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):n.x===t.x&&n.y===t.y}var fg=class{constructor(t){this._spacing=20,this._viewBoxX=Number.POSITIVE_INFINITY,this._viewBoxY=Number.POSITIVE_INFINITY,this._viewBoxW=0,this._viewBoxH=0,this._viewBoxX2=Number.NEGATIVE_INFINITY,this._viewBoxY2=Number.NEGATIVE_INFINITY,this._enableUpdateViewBox=!0,this._current="main",this._groups=new Map,this.fileName=null,this._index=0,this.debug=!1,this.maxArea=8294400,t!=null&&t.length>0&&!t.startsWith("null")&&(this.fileName=t,this.debug=!0),this._groups.set(this._current,"")}g(t){return this.debug&&(this._groups.has(t)||this._groups.set(t,""),this._current=t),this}addGroups(...t){if(this.debug)for(let e of t)this._groups.set(e,"")}clearGroup(t){this.debug&&this._groups.has(t)&&this._groups.set(t,"")}removeGroup(t){this.debug&&(t==="main"?this.clearGroup(t):this._groups.delete(t))}setViewBox(t,e,o,r){this.debug&&(this._viewBoxX=t,this._viewBoxY=e,this._viewBoxW=o,this._viewBoxH=r,this._enableUpdateViewBox=!1)}clear(){this.debug=this.fileName!=null&&this.fileName.length>0,this.debug&&(this._groups.clear(),this._current="main",this._groups.set(this._current,""),this._enableUpdateViewBox&&(this._viewBoxX=Number.POSITIVE_INFINITY,this._viewBoxY=Number.POSITIVE_INFINITY,this._viewBoxW=0,this._viewBoxH=0,this._viewBoxX2=Number.NEGATIVE_INFINITY,this._viewBoxY2=Number.NEGATIVE_INFINITY))}addElementStr(t){if(this.debug){let e=this._groups.get(this._current)||"";this._groups.set(this._current,e+t+`
+`);)o--;if(e>=o)throw new Error("The given string does not contain any numbers.");let r=t.substring(e,o).split(/,|;|\r|\n/);if(r.length!==2)throw new Error(`Exactly two numbers are expected, ${r.length} were found.`);if(this.x=parseFloat(r[0].trim()),this.y=parseFloat(r[1].trim()),isNaN(this.x)||isNaN(this.y))throw new Error("The given string contains parts that cannot be parsed as numbers.")}static _isdelim(t,e){return e.includes(t)}};Z(Sr,"DEFAULT_FUZZYNESS",.05);var O=Sr;var st=class n extends Array{constructor(...t){if(super(),t.length===1&&Array.isArray(t[0]))for(let e of t[0])this.push(e);else if(t.length>0)for(let e of t)this.push(e)}toString(){let t="(";for(let e=0;e<this.length;e++){let o=this[e];t+=`${o.x},${o.y}`,e<this.length-1&&(t+="; ")}return t+")"}clone(){return new n(this.toArray())}toArray(t=0){if(t<0||t>this.length)throw new RangeError("Index out of bounds");return Array.prototype.slice.call(this,t)}parse(t){let e=t.split(/,|;|\(|\)|\[|\]|\{|\}| |\t|\n/);this.length=0;let o=0,r=0,i=0,s=0;for(;o<e.length;){let a=e[o];if(a!=null&&a.trim().length>0){let l=parseFloat(a);if(isNaN(l))throw new Error("The given string does not match the expected format for vectors.");r%2===0?i=l:s=l,r>0&&r%2!==0&&this.push(new O(i,s)),r++}o++}}add(t,e){arguments.length===0?this.push(new O):arguments.length===2?typeof t=="number"&&typeof e=="object"?this.splice(t,0,e):this.push(new O(t,e)):this.push(t)}addFirst(t,e){arguments.length===0?this.unshift(new O):arguments.length===2?this.unshift(new O(t,e)):this.unshift(t)}addLast(t,e){arguments.length===0?this.push(new O):arguments.length===2?this.push(new O(t,e)):this.push(t)}getFirst(){return this[0]}getLast(){return this[this.length-1]}removeFirst(){return this.shift()}removeLast(){return this.pop()}size(){return this.length}get(t){return this[t]}remove(t){for(let e=0;e<this.length;e++){let o=this[e];if(o===t||typeof o.equals=="function"&&o.equals(t))return this.splice(e,1),!0}return!1}addAll(t,e){if(e!==void 0){let o=Array.isArray(e)?e:[...e];this.splice(t,0,...o)}else if(Array.isArray(t))for(let o of t)this.push(o);else for(let o of t)this.push(o)}addAllAsCopies(t,e){let o=[];for(let r of e)o.push(new O(r));this.splice(t,0,...o)}scale(t,e){for(let o of this)o.scale(t,e);return this}offset(t,e){if(typeof t=="object")for(let o of this)o.add(t);else for(let o of this)o.add(t,e);return this}offsetNonMutating(t){let e=new n;for(let o of this)e.push(O.sum(o,t));return e}totalLength(){let t=0;if(this.length>=2){let e=this[0];for(let o=1;o<this.length;o++){let r=this[o];t+=e.distance(r),e=r}}return t}hasNaN(){for(let t of this)if(t.isNaN())return!0;return!1}hasInfinite(){for(let t of this)if(t.isInfinite())return!0;return!1}pointOnLine(t){if(this.length>=2){let e=Math.abs(t),o=0;if(t>=0){let r=this[0];for(let i=1;i<this.length;i++){let s=o,a=this[i],l=r.distance(a);if(l>0&&(o+=l,o>=e)){let c=(e-s)/l,g=a.clone().sub(r);return g.scale(c),g.add(r),g}r=a}return this[this.length-1]}else{let r=this[this.length-1];for(let i=this.length-2;i>=0;i--){let s=o,a=this[i],l=r.distance(a);if(l>0&&(o+=l,o>=e)){let c=(e-s)/l,g=a.clone().sub(r);return g.scale(c),g.add(r),g}r=a}return this[0]}}else{if(this.length===1)return this[0];throw new Error("Cannot determine a point on an empty vector chain.")}}angleOnLine(t){if(this.length>=2){let e=Math.abs(t),o=0;if(t>=0){let r,i=this[0];for(let s=1;s<this.length;s++){r=i,i=this[s];let a=r.distance(i);if(a>0&&(o+=a,o>=e))break}return i.clone().sub(r).toRadians()}else{let r,i=this[this.length-1];for(let s=this.length-2;s>=0;s--){r=i,i=this[s];let a=r.distance(i);if(a>0&&(o+=a,o>=e))break}return i.clone().sub(r).toRadians()}}else throw new Error("Need at least two points to determine an angle.")}static reverse(t){let e=new n;for(let o=t.length-1;o>=0;o--)e.push(new O(t[o]));return e}get(t){return this[t]}size(){return this.length}clear(){this.length=0}isEmpty(){return this.length===0}};var k=Object.freeze({H_LEFT:"H_LEFT",H_CENTER:"H_CENTER",H_RIGHT:"H_RIGHT",V_TOP:"V_TOP",V_CENTER:"V_CENTER",V_BOTTOM:"V_BOTTOM",INSIDE:"INSIDE",OUTSIDE:"OUTSIDE",H_PRIORITY:"H_PRIORITY",fixed(){return new Set},insideTopLeft(){return new Set([k.INSIDE,k.V_TOP,k.H_LEFT])},insideTopCenter(){return new Set([k.INSIDE,k.V_TOP,k.H_CENTER])},insideTopRight(){return new Set([k.INSIDE,k.V_TOP,k.H_RIGHT])},insideCenter(){return new Set([k.INSIDE,k.V_CENTER,k.H_CENTER])},insideBottomLeft(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_LEFT])},insideBottomCenter(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_CENTER])},insideBottomRight(){return new Set([k.INSIDE,k.V_BOTTOM,k.H_RIGHT])},outsideTopLeft(){return new Set([k.OUTSIDE,k.V_TOP,k.H_LEFT])},outsideTopCenter(){return new Set([k.OUTSIDE,k.V_TOP,k.H_CENTER])},outsideTopRight(){return new Set([k.OUTSIDE,k.V_TOP,k.H_RIGHT])},outsideBottomLeft(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_LEFT])},outsideBottomCenter(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_CENTER])},outsideBottomRight(){return new Set([k.OUTSIDE,k.V_BOTTOM,k.H_RIGHT])},isValid(n){return!([k.INSIDE,k.OUTSIDE].filter(r=>n.has(r)).length>1||[k.H_LEFT,k.H_CENTER,k.H_RIGHT].filter(r=>n.has(r)).length>1||[k.V_TOP,k.V_CENTER,k.V_BOTTOM].filter(r=>n.has(r)).length>1)},values(){return[this.H_LEFT,this.H_CENTER,this.H_RIGHT,this.V_TOP,this.V_CENTER,this.V_BOTTOM,this.INSIDE,this.OUTSIDE,this.H_PRIORITY]},valueOf(n){return this[n]},ensureSet(n){if(n instanceof Set)return n;if(n==null)return new Set;if(typeof n=="string"){let t=new Set;for(let e of n.split(/\s+/)){let o=e.trim();o&&k[o]!==void 0&&typeof k[o]=="string"&&t.add(k[o])}return t}return new Set}});var de=class{initialize(t){}dispose(){}layout(t,e){throw new Error(`${this.constructor.name}.layout() is not implemented`)}};var xp=new m("org.eclipse.elk.padding",new yt(15)),Dp=new m("org.eclipse.elk.spacing.nodeNode",15,0),Qf=new m("org.eclipse.elk.priority",0),tu=new m("org.eclipse.elk.aspectRatio",1.3,Xe.greaterThan(0));var dt=class n{constructor(t,e,o,r){arguments.length===0?(this.x=0,this.y=0,this.width=0,this.height=0):arguments.length===1?(this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height):(this.x=t,this.y=e,this.width=o,this.height=r)}setRect(t,e,o,r){this.x=t,this.y=e,this.width=o,this.height=r}getPosition(){return new O(this.x,this.y)}getTopLeft(){return new O(this.x,this.y)}getTopRight(){return new O(this.x+this.width,this.y)}getBottomLeft(){return new O(this.x,this.y+this.height)}getBottomRight(){return new O(this.x+this.width,this.y+this.height)}getCenter(){return new O(this.x+this.width/2,this.y+this.height/2)}union(t){let e=Math.min(this.x,t.x),o=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width),i=Math.max(this.y+this.height,t.y+t.height);if(r<e){let s=e;r=e}if(i<o){let s=o;i=o}this.setRect(e,o,r-e,i-o)}move(t){this.x+=t.x,this.y+=t.y}getMaxX(){return this.x+this.width}getMaxY(){return this.y+this.height}intersects(t){let e=this.x,o=this.y,r=this.x+this.width,i=this.y+this.height,s=t.x,a=t.y,l=t.x+t.width,c=t.y+t.height;return e<l&&r>s&&i>a&&o<c}equals(t){return t==null||!(t instanceof n)?!1:this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}toString(){return`Rect[x=${this.x},y=${this.y},w=${this.width},h=${this.height}]`}};var qt=class qt{constructor(t){this.name=t,Object.freeze(this)}isPosFixed(){return this===qt.FIXED_POS}isRatioFixed(){return this===qt.FIXED_RATIO}isOrderFixed(){return this===qt.FIXED_ORDER||this===qt.FIXED_RATIO||this===qt.FIXED_POS}isSideFixed(){return this!==qt.FREE&&this!==qt.UNDEFINED}toString(){return this.name}static values(){return[qt.UNDEFINED,qt.FREE,qt.FIXED_SIDE,qt.FIXED_ORDER,qt.FIXED_RATIO,qt.FIXED_POS]}static valueOf(t){return qt[t]}};Z(qt,"UNDEFINED",new qt("UNDEFINED")),Z(qt,"FREE",new qt("FREE")),Z(qt,"FIXED_SIDE",new qt("FIXED_SIDE")),Z(qt,"FIXED_ORDER",new qt("FIXED_ORDER")),Z(qt,"FIXED_RATIO",new qt("FIXED_RATIO")),Z(qt,"FIXED_POS",new qt("FIXED_POS"));var H=qt;var it=Object.freeze({OUTSIDE:"OUTSIDE",INSIDE:"INSIDE",NEXT_TO_PORT_IF_POSSIBLE:"NEXT_TO_PORT_IF_POSSIBLE",ALWAYS_SAME_SIDE:"ALWAYS_SAME_SIDE",ALWAYS_OTHER_SAME_SIDE:"ALWAYS_OTHER_SAME_SIDE",SPACE_EFFICIENT:"SPACE_EFFICIENT",fixed(){return new Set},inside(){return new Set([it.INSIDE])},outside(){return new Set([it.OUTSIDE])},isFixed(n){return!n.has(it.INSIDE)&&!n.has(it.OUTSIDE)},isValid(n){return!([it.INSIDE,it.OUTSIDE].filter(o=>n.has(o)).length>1||[it.ALWAYS_SAME_SIDE,it.ALWAYS_OTHER_SAME_SIDE,it.SPACE_EFFICIENT].filter(o=>n.has(o)).length>1)},values(){return[this.OUTSIDE,this.INSIDE,this.NEXT_TO_PORT_IF_POSSIBLE,this.ALWAYS_SAME_SIDE,this.ALWAYS_OTHER_SAME_SIDE,this.SPACE_EFFICIENT]},valueOf(n){return this[n]}});var q=class q{constructor(t){this.name=t,Object.freeze(this)}ordinal(){switch(this){case q.UNDEFINED:return 0;case q.NORTH:return 1;case q.EAST:return 2;case q.SOUTH:return 3;case q.WEST:return 4;default:return-1}}right(){switch(this){case q.NORTH:return q.EAST;case q.EAST:return q.SOUTH;case q.SOUTH:return q.WEST;case q.WEST:return q.NORTH;default:return q.UNDEFINED}}left(){switch(this){case q.NORTH:return q.WEST;case q.EAST:return q.NORTH;case q.SOUTH:return q.EAST;case q.WEST:return q.SOUTH;default:return q.UNDEFINED}}opposed(){switch(this){case q.NORTH:return q.SOUTH;case q.EAST:return q.WEST;case q.SOUTH:return q.NORTH;case q.WEST:return q.EAST;default:return q.UNDEFINED}}areAdjacent(t){return this===q.UNDEFINED?!1:this.left()===t||this.right()===t}static fromDirection(t){switch(t){case R.UP:return q.NORTH;case R.RIGHT:return q.EAST;case R.DOWN:return q.SOUTH;case R.LEFT:return q.WEST;default:return q.UNDEFINED}}static isVertical(t){return t===q.NORTH||t===q.SOUTH}static isHorizontal(t){return t===q.WEST||t===q.EAST}toString(){return this.name}static values(){return[q.UNDEFINED,q.NORTH,q.EAST,q.SOUTH,q.WEST]}static valueOf(t){return q[t]}};Z(q,"UNDEFINED",new q("UNDEFINED")),Z(q,"NORTH",new q("NORTH")),Z(q,"EAST",new q("EAST")),Z(q,"SOUTH",new q("SOUTH")),Z(q,"WEST",new q("WEST")),Z(q,"SIDES_NONE",new Set),Z(q,"SIDES_NORTH",null),Z(q,"SIDES_EAST",null),Z(q,"SIDES_SOUTH",null),Z(q,"SIDES_WEST",null),Z(q,"SIDES_NORTH_SOUTH",null),Z(q,"SIDES_EAST_WEST",null),Z(q,"SIDES_NORTH_WEST",null),Z(q,"SIDES_NORTH_EAST",null),Z(q,"SIDES_SOUTH_WEST",null),Z(q,"SIDES_EAST_SOUTH",null),Z(q,"SIDES_NORTH_EAST_WEST",null),Z(q,"SIDES_EAST_SOUTH_WEST",null),Z(q,"SIDES_NORTH_SOUTH_WEST",null),Z(q,"SIDES_NORTH_EAST_SOUTH",null),Z(q,"SIDES_NORTH_EAST_SOUTH_WEST",null);var u=q;u.SIDES_NORTH=Object.freeze(new Set([u.NORTH]));u.SIDES_EAST=Object.freeze(new Set([u.EAST]));u.SIDES_SOUTH=Object.freeze(new Set([u.SOUTH]));u.SIDES_WEST=Object.freeze(new Set([u.WEST]));u.SIDES_NORTH_SOUTH=Object.freeze(new Set([u.NORTH,u.SOUTH]));u.SIDES_EAST_WEST=Object.freeze(new Set([u.EAST,u.WEST]));u.SIDES_NORTH_WEST=Object.freeze(new Set([u.NORTH,u.WEST]));u.SIDES_NORTH_EAST=Object.freeze(new Set([u.NORTH,u.EAST]));u.SIDES_SOUTH_WEST=Object.freeze(new Set([u.SOUTH,u.WEST]));u.SIDES_EAST_SOUTH=Object.freeze(new Set([u.EAST,u.SOUTH]));u.SIDES_NORTH_EAST_WEST=Object.freeze(new Set([u.NORTH,u.EAST,u.WEST]));u.SIDES_EAST_SOUTH_WEST=Object.freeze(new Set([u.EAST,u.SOUTH,u.WEST]));u.SIDES_NORTH_SOUTH_WEST=Object.freeze(new Set([u.NORTH,u.SOUTH,u.WEST]));u.SIDES_NORTH_EAST_SOUTH=Object.freeze(new Set([u.NORTH,u.EAST,u.SOUTH]));u.SIDES_NORTH_EAST_SOUTH_WEST=Object.freeze(new Set([u.NORTH,u.EAST,u.SOUTH,u.WEST]));var HO=[u.SIDES_NONE,u.SIDES_NORTH,u.SIDES_EAST,u.SIDES_NORTH_EAST,u.SIDES_SOUTH,u.SIDES_NORTH_SOUTH,u.SIDES_EAST_SOUTH,u.SIDES_NORTH_EAST_SOUTH,u.SIDES_WEST,u.SIDES_NORTH_WEST,u.SIDES_EAST_WEST,u.SIDES_NORTH_EAST_WEST,u.SIDES_SOUTH_WEST,u.SIDES_NORTH_SOUTH_WEST,u.SIDES_EAST_SOUTH_WEST,u.SIDES_NORTH_EAST_SOUTH_WEST];u.sidesOf=function(t){let e=0;return t.has(u.NORTH)&&(e|=1),t.has(u.EAST)&&(e|=2),t.has(u.SOUTH)&&(e|=4),t.has(u.WEST)&&(e|=8),HO[e]};var mt=Object.freeze({PORTS:"PORTS",PORT_LABELS:"PORT_LABELS",NODE_LABELS:"NODE_LABELS",MINIMUM_SIZE:"MINIMUM_SIZE",fixed(){return new Set},minimumSize(){return new Set([mt.MINIMUM_SIZE])},minimumSizeWithPorts(){return new Set([mt.PORTS,mt.MINIMUM_SIZE])},free(){return new Set([mt.PORTS,mt.PORT_LABELS,mt.NODE_LABELS,mt.MINIMUM_SIZE])},values(){return[this.PORTS,this.PORT_LABELS,this.NODE_LABELS,this.MINIMUM_SIZE]},valueOf(n){return this[n]}});var Nt=Object.freeze({DEFAULT_MINIMUM_SIZE:"DEFAULT_MINIMUM_SIZE",MINIMUM_SIZE_ACCOUNTS_FOR_PADDING:"MINIMUM_SIZE_ACCOUNTS_FOR_PADDING",COMPUTE_PADDING:"COMPUTE_PADDING",OUTSIDE_NODE_LABELS_OVERHANG:"OUTSIDE_NODE_LABELS_OVERHANG",PORTS_OVERHANG:"PORTS_OVERHANG",UNIFORM_PORT_SPACING:"UNIFORM_PORT_SPACING",SPACE_EFFICIENT_PORT_LABELS:"SPACE_EFFICIENT_PORT_LABELS",FORCE_TABULAR_NODE_LABELS:"FORCE_TABULAR_NODE_LABELS",ASYMMETRICAL:"ASYMMETRICAL",valueOf(n){return typeof n=="number"?Nt.values()[n]:this[n]},values(){return[this.DEFAULT_MINIMUM_SIZE,this.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING,this.COMPUTE_PADDING,this.OUTSIDE_NODE_LABELS_OVERHANG,this.PORTS_OVERHANG,this.UNIFORM_PORT_SPACING,this.SPACE_EFFICIENT_PORT_LABELS,this.FORCE_TABULAR_NODE_LABELS,this.ASYMMETRICAL]}});var es=20,os=20;function bp(n,t){if(n.getParent()===null)throw new Error("port must have a parent node to calculate the port side");let e=n.getParent(),o=e.getWidth(),r=e.getHeight();if(o<=0&&r<=0)return u.UNDEFINED;let i=n.getX(),s=n.getY();if(t===R.LEFT||t===R.RIGHT){if(i<0)return u.WEST;if(i+n.getWidth()>o)return u.EAST}else if(t===R.UP||t===R.DOWN){if(s<0)return u.NORTH;if(s+n.getHeight()>r)return u.SOUTH}let a=(i+n.getWidth()/2)/o,l=(s+n.getHeight()/2)/r;return a+l<=1&&a-l<=0?u.WEST:a+l>=1&&a-l>=0?u.EAST:l<.5?u.NORTH:u.SOUTH}function eu(n,t){if(n.getParent()===null)throw new Error("port must have a parent node to calculate the port side");let e=n.getParent();switch(t){case u.NORTH:return-(n.getY()+n.getHeight());case u.EAST:return n.getX()-e.getWidth();case u.SOUTH:return n.getY()-e.getHeight();case u.WEST:return-(n.getX()+n.getWidth());default:return 0}}function ou(n){let t=n.getProperty(Mo);if(t.size===0)return null;let e=0,o=0;if(t.has(mt.PORTS)){let r=n.getProperty(cr),i=2,s=2,a=2,l=2,c=n.getParent()===null?n.getProperty(lr):n.getParent().getProperty(lr);for(let g of n.ports){let h=g.getProperty(Tr);if(h===u.UNDEFINED&&(h=bp(g,c),g.setProperty(Tr,h)),r===H.FIXED_POS)switch(h){case u.NORTH:i=Math.max(i,g.getX()+g.getWidth());break;case u.EAST:s=Math.max(s,g.getY()+g.getHeight());break;case u.SOUTH:a=Math.max(a,g.getX()+g.getWidth());break;case u.WEST:l=Math.max(l,g.getY()+g.getHeight());break}else switch(h){case u.NORTH:i+=g.getWidth()+2;break;case u.EAST:s+=g.getHeight()+2;break;case u.SOUTH:a+=g.getWidth()+2;break;case u.WEST:l+=g.getHeight()+2;break}}e=Math.max(i,a),o=Math.max(s,l)}return Ae(n,e,o,!0,!0)}function Ae(n,t,e,o,r){let i=new O(n.getWidth(),n.getHeight()),s=ya(n);s.x=Math.max(s.x,t),s.y=Math.max(s.y,e);let a=s.x/i.x,l=s.y/i.y,c=s.x-i.x,g=s.y-i.y;if(o){let h=n.getParent()===null?n.getProperty(lr):n.getParent().getProperty(lr),d=n.getProperty(cr)===H.FIXED_POS;for(let f of n.ports){let E=f.getProperty(Tr);switch(E===u.UNDEFINED&&(E=bp(f,h),f.setProperty(Tr,E)),E){case u.NORTH:d||f.setX(f.getX()*a);break;case u.EAST:f.setX(f.getX()+c),d||f.setY(f.getY()*l);break;case u.SOUTH:d||f.setX(f.getX()*a),f.setY(f.getY()+g);break;case u.WEST:d||f.setY(f.getY()*l);break}}}if(n.setDimensions(s.x,s.y),r)for(let h of n.labels){let d=h.getX()+h.getWidth()/2,f=h.getY()+h.getHeight()/2,E=d/i.x,P=f/i.y;E+P>=1&&(E-P>0&&f>=0?(h.setX(h.getX()+c),h.setY(h.getY()+g*P)):E-P<0&&d>=0&&(h.setX(h.getX()+c*E),h.setY(h.getY()+g)))}return n.setProperty(Mo,mt.fixed()),new O(a,l)}function ya(n){if(n.getProperty(Mo).has(mt.MINIMUM_SIZE)){let e=n.getProperty(Oo),o=new O(n.getProperty(Yo));return e.has(Nt.DEFAULT_MINIMUM_SIZE)&&(o.x<=0&&(o.x=es),o.y<=0&&(o.y=os)),o}return new O}function ru(n){let t=n.getProperty(lu);if(t===1)return;n.setDimensions(t*n.getWidth(),t*n.getHeight());let e=[];for(let r of n.ports)for(let i of r.labels)e.push(i);let o=[...n.labels,...n.ports,...e];for(let r of o){r.setLocation(t*r.getX(),t*r.getY()),r.setDimensions(t*r.getWidth(),t*r.getHeight());let i=r.getProperty(au);i!=null&&(i.x*=t,i.y*=t)}}function Gp(n){if(n.sections.length!==1)throw new Error("The edge needs to have exactly one edge section. Found: "+n.sections.length);let t=new st,e=yl(n.sources[0]);if(e!=null)for(let r of wp(n,e,!1))t.add(r);let o=yl(n.targets[0]);if(o!=null)for(let r of wp(n,o,!0))t.add(r);return t}function wp(n,t,e){let o=n.sections[0],r=new st,i=new Map,s=Mp(o);i.set(o,s);let a=new Map,l=[];for(let c of Ta(t)){if(c.sections.length!==1)throw new Error("The edge needs to have exactly one edge section. Found: "+c.sections.length);if(c!==n){let g=c.sections[0];l.push(g);let h=i.get(g);h||(h=Mp(g),i.set(g,h));let d=e?new O(s[s.length-1]).sub(h[h.length-1]):new O(s[0]).sub(h[0]);a.set(g,d)}}if(l.length>0){let c=s[e?s.length-1:0];for(let g=1;g<s.length;g++){let h=s[e?s.length-1-g:g];for(let d=l.length-1;d>=0;d--){let f=l[d],E=i.get(f);if(E.length<=g)l.splice(d,1);else{let P=new O(E[e?E.length-1-g:g]).add(a.get(f));if(h.x!==P.x||h.y!==P.y){let S=h.x-c.x,T=h.y-c.y,N=P.x-c.x,I=P.y-c.y;N*T===I*S&&Math.sign(S)===Math.sign(N)&&Math.sign(T)===Math.sign(I)?(Math.abs(S)<Math.abs(N)||Math.abs(T)<Math.abs(I))&&r.add(h):g>1&&r.add(c),l.splice(d,1)}}}c=h}}return r}function Mp(n){let t=[];t.push(new O(n.getStartX(),n.getStartY()));for(let o of n.getBendPoints())t.push(new O(o.getX(),o.getY()));t.push(new O(n.getEndX(),n.getEndY()));let e=1;for(;e<t.length-1;){let o=t[e-1],r=t[e],i=t[e+1];o.x===r.x&&r.x===i.x||o.y===r.y&&r.y===i.y?t.splice(e,1):e++}return t}function Ia(n){let t=null;for(let e of n.getLabels()){let o=new dt(e.getPosition().x,e.getPosition().y,e.getSize().x,e.getSize().y);t===null?t=o:t.union(o)}return t||new dt}function Hp(n,t){let e=Ia(n);return iu(new O(e.x,e.y),new O(e.width,e.height),n.getSize(),t,n.getSide())}function iu(n,t,e,o,r){switch(r){case u.NORTH:return Math.max(0,t.y+n.y-(e.y+o));case u.SOUTH:return Math.max(0,-n.y-o);case u.EAST:return Math.max(0,-n.x-o);case u.WEST:return Math.max(0,t.x+n.x-(e.x+o));default:return 0}}function Ra(n,t,e){for(let o of n.children)o.setLocation(o.getX()+t,o.getY()+e);for(let o of n.containedEdges)vO(o,t,e)}function vO(n,t,e){for(let r of n.sections)BO(r,t,e);for(let r of n.labels)r.setLocation(r.getX()+t,r.getY()+e);let o=n.getProperty(gr);o!=null&&o.offset(t,e)}function BO(n,t,e){n.setStartLocation(n.getStartX()+t,n.getStartY()+e);for(let o of n.getBendPoints())o.set(o.getX()+t,o.getY()+e);n.setEndLocation(n.getEndX()+t,n.getEndY()+e)}function Vs(n,t,e){let o=n.getProperty(Rl),r=0,i=0;t.x>e.x&&(o.has(he.H_CENTER)?r=(t.x-e.x)/2:o.has(he.H_RIGHT)&&(r=t.x-e.x)),t.y>e.y&&(o.has(he.V_CENTER)?i=(t.y-e.y)/2:o.has(he.V_BOTTOM)&&(i=t.y-e.y)),Ra(n,r,i)}function su(n,t){let e=t;for(;e!=null;)n.add(e.getX(),e.getY()),e=e.getParent();return n}function nu(n,t){let e=t;for(;e!=null;)n.add(-e.getX(),-e.getY()),e=e.getParent();return n}function Xs(n,t){if(n.size()<2)throw new Error("The vector chain must contain at least a source and a target point.");let e=n.getFirst();t.setStartLocation(e.x,e.y);let o=0,r=t.getBendPoints(),i=n.toArray();for(let a=1;a<i.length-1;a++){let l=i[a],c;o<r.length?c=r[o]:(c=new Xr,r.push(c)),c.set(l.x,l.y),o++}o<r.length&&r.splice(o,r.length-o);let s=n.getLast();t.setEndLocation(s.x,s.y)}function vp(n,...t){Bp(n,e=>{for(let o of t)o.visit(e)})}function Bp(n,t){t(n);for(let e of n.labels)t(e);for(let e of n.ports){t(e);for(let o of e.labels)t(o)}for(let e of n.containedEdges){t(e);for(let o of e.labels)t(o)}for(let e of n.children)Bp(e,t)}var Up=1.3,hr=Object.freeze({SIMPLE:"SIMPLE",GROUP_DEC:"GROUP_DEC",GROUP_MIXED:"GROUP_MIXED",GROUP_INC:"GROUP_INC",values(){return[hr.SIMPLE,hr.GROUP_DEC,hr.GROUP_MIXED,hr.GROUP_INC]},valueOf(n){return hr[n]}}),rs=class extends de{layout(t,e){e&&e.begin&&e.begin("Box layout",2);let o=t.getProperty(Dp),r=t.getProperty(xp),i=t.getProperty(Ll),s=t.getProperty(zo),a=t.getProperty(Il);a===hr.SIMPLE?this._placeBoxesSimple(t,o,r,i,s):this._placeBoxesGrouping(t,o,r,i,a),e&&e.done&&e.done()}_placeBoxesSimple(t,e,o,r,i){let s=UO(t,i),a=ya(t),l=t.getProperty(tu);(l==null||l<=0)&&(l=Up);let c=FO(s,e,o,a.x,a.y,r,l);Ae(t,c.x,c.y,!1,!0)}_placeBoxesGrouping(t,e,o,r,i){let s=t.getProperty(Yo),a=new O(s.x,s.y);a.x=Math.max(a.x-o.getLeft()-o.getRight(),0),a.y=Math.max(a.y-o.getTop()-o.getBottom(),0);let l=t.getProperty(tu);(l==null||l<=0)&&(l=Up);let c=[];for(let f of t.getChildren())c.push(new is(f));let g;i===hr.GROUP_INC?g=VO(c,e,a.x,a.y,r,l):i===hr.GROUP_DEC?g=zO(c,e,a.x,a.y,r,l):g=YO(c,e,a.x,a.y,r,l);let h=new is(g),d=Al(h,e,o,a.x,a.y,r,l);Ae(t,d.x,d.y,!1,!0)}};Z(rs,"PackingMode",hr);function UO(n,t){let e=[...n.getChildren()];return e.sort((o,r)=>{let i=o.getProperty(Qf)||0,s=r.getProperty(Qf)||0;if(i>s)return-1;if(i<s)return 1;if(t){let c=(o.getY()||0)-(r.getY()||0);if(c!==0)return c;let g=(o.getX()||0)-(r.getX()||0);if(g!==0)return g}let a=o.getWidth()*o.getHeight(),l=r.getWidth()*r.getHeight();return a-l}),e}function FO(n,t,e,o,r,i,s){let a=0,l=0;for(let N of n)ou(N),a=Math.max(a,N.getWidth()),l+=N.getWidth()*N.getHeight();let c=l/n.length,g=kO(n,c);l+=n.length*1*g,l+=Math.sqrt(l)*(e.getBottom()+e.getTop()),l+=Math.sqrt(l)*e.getRight(),a=Math.max(a,Math.sqrt(l*s))+e.getLeft();let h=e.getLeft(),d=e.getTop(),f=0,E=e.getHorizontal(),P=[0],S=[];for(let N=0;N<n.length;N++){let I=n[N],C=I.getWidth(),x=I.getHeight();h+C>a&&(i&&(S.push(f),P.push(N)),h=e.getLeft(),d+=f+t,f=0,E=Math.max(E,e.getHorizontal()+C)),I.setLocation(h,d),E=Math.max(E,h+C+e.getRight()),f=Math.max(f,x),h+=C+t}E=Math.max(E,o);let T=d+f+e.getBottom();if(T<r&&(f+=r-T,T=r),i){h=e.getLeft(),P.push(n.length),S.push(f);let N=0,I=P[N++],C=0,x=0;for(let M=0;M<n.length;M++){M===I&&(h=e.getLeft(),x=S[C++],I=P[N++]);let A=n[M],B=A.getHeight();A.setHeight(x);let Y=x;if(M+1===I){let j=E-h-e.getRight(),X=A.getWidth();A.setWidth(j),Vs(A,new O(j,Y),new O(X,B))}h+=A.getWidth()+t}}return new O(E,T)}function kO(n,t){let e=0;for(let o of n)e+=Math.pow(o.getWidth()*o.getHeight()-t,2);return Math.sqrt(e/(n.length-1))}function Al(n,t,e,o,r,i,s){let a=0,l=0;for(let x of n.groups)x.node!=null&&ou(x.node),a=Math.max(a,x.getWidth()),l+=x.getWidth()*x.getHeight();let c=l/n.groups.length,g=WO(n.groups,c);l+=n.groups.length*1*g,a=Math.max(a,Math.sqrt(l*s))+e.getLeft();let d=e.getLeft(),f=e.getTop(),E=0,P=e.getHorizontal(),S=[0],T=[],N=null,I=[];for(let x=0;x<n.groups.length;x++){let M=n.groups[x],A=M.getWidth(),B=M.getHeight();d+A>a&&(i&&(T.push(E),S.push(x),N!=null&&n.right.push(N),I=[]),d=e.getLeft(),f+=E+t,E=0,P=Math.max(P,e.getHorizontal()+A)),I.push(M),M.translate(d,f),P=Math.max(P,d+A+e.getRight()),E=Math.max(E,B),d+=A+t,N=M}for(let x of I)n.bottom.push(x);I.length>0&&n.right.push(I[I.length-1]),P=Math.max(P,o);let C=f+E+e.getBottom();if(C<r&&(E+=r-C,C=r),i){d=e.getLeft(),S.push(n.groups.length),T.push(E);let x=0,M=S[x++],A=0,B=0;for(let Y=0;Y<n.groups.length;Y++){Y===M&&(d=e.getLeft(),B=T[A++],M=S[x++]);let j=n.groups[Y];if(j.setHeight(B),Y+1===M){let X=P-d-e.getRight(),tt=j.getWidth();j.setWidth(X),j.translateInnerNodes((X-tt)/2,0)}d+=j.getWidth()+t}}return new O(P,C)}function WO(n,t){let e=0;for(let o of n)e+=Math.pow(o.area()-t,2);return Math.sqrt(e/(n.length-1))}function zO(n,t,e,o,r,i){n.sort((h,d)=>d.area()-h.area());let s=[...n],a=[],l=[],c=null,g=0;for(;s.length>0;){let h=s.shift();if(c==null||c.area()/2<h.area())c=h,a.push(h);else if(g+=h.area(),l.push(h),l.length>1&&(g>c.area()/2||s.length===0)){let d=new is(l),f=c.getWidth()/c.getHeight(),E=Al(d,t,new yt,e,o,r,f);d.size.x=E.x,d.size.y=E.y,c=d,a.push(d),g=0,l=[]}}for(let h of l)a.push(h);return a}function YO(n,t,e,o,r,i){let s=[...n].sort((g,h)=>g.area()-h.area()),a=new Array(n.length).fill(0),l=0,c=[];for(;s.length>0;){let g=s[0];if(l>1&&g.area()/2>a[0]){let h=0;for(;h<c.length-1&&g.area()/2>a[h];)h++;let d=c.slice(0,h+1),f=new is(d),E=g.getWidth()/g.getHeight(),P=Al(f,t,new yt,e,o,r,E);f.size.x=P.x,f.size.y=P.y;let S=c.slice(h+1);s.push(f);for(let T of S)s.push(T);s.sort((T,N)=>T.area()-N.area()),c.length=0,l=0,a.fill(0)}else s.shift(),l>0&&(a[l]=a[l-1]),a[l]+=g.area(),l++,c.push(g)}return c}function VO(n,t,e,o,r,i){n.sort((l,c)=>l.area()-c.area());let s=[],a=0;for(let l of n)if(s.length>0&&l.area()>a*2){let c=new is(s),g=l.getWidth()/l.getHeight(),h=Al(c,t,new yt,e,o,r,g);c.size.x=h.x,c.size.y=h.y,s=[],a=0,s.push(c),s.push(l),a=c.area()+l.area()}else s.push(l),a+=l.area();return s}var is=class{constructor(t){Array.isArray(t)?(this.groups=[...t],this.node=null,this.bottom=[],this.right=[],this.size=new O):(this.node=t,this.groups=null,this.bottom=null,this.right=null,this.size=null,this.node.setLocation(0,0))}area(){return this.getWidth()*this.getHeight()}getWidth(){return this.node!=null?this.node.getWidth():this.size.x}getHeight(){return this.node!=null?this.node.getHeight():this.size.y}setWidth(t){if(this.node!=null)this.node.setWidth(t);else{let e=t-this.getWidth();for(let o of this.right)o.setWidth(o.getWidth()+e)}}setHeight(t){if(this.node!=null)this.node.setHeight(t);else{let e=t-this.getHeight();for(let o of this.bottom)o.setHeight(o.getHeight()+e)}}translate(t,e){if(this.node!=null)this.node.setX(this.node.getX()+t),this.node.setY(this.node.getY()+e);else for(let o of this.groups)o.translate(t,e)}translateInnerNodes(t,e){if(this.node!=null)Ra(this.node,t,e);else for(let o of this.groups)o.translateInnerNodes(t,e)}};var Jt=Object.freeze({DISTRIBUTED:"DISTRIBUTED",JUSTIFIED:"JUSTIFIED",BEGIN:"BEGIN",CENTER:"CENTER",END:"END",values(){return[this.DISTRIBUTED,this.JUSTIFIED,this.BEGIN,this.CENTER,this.END]},valueOf(n){return this[n]}});var Fp=Object.freeze({INHERIT:"INHERIT",PARENT:"PARENT",ROOT:"ROOT",values(){return[this.INHERIT,this.PARENT,this.ROOT]},valueOf(n){return this[n]}});var Il=new m("org.eclipse.elk.box.packingMode",()=>hr.SIMPLE),mi=new m("org.eclipse.elk.algorithm"),ss=new m("org.eclipse.elk.resolvedAlgorithm"),XO=new m("org.eclipse.elk.alignment",Kt.AUTOMATIC),KO=new m("org.eclipse.elk.aspectRatio",null,Xe.greaterThan(0)),Cl=new m("org.eclipse.elk.bendPoints"),Rl=new m("org.eclipse.elk.contentAlignment",he.topLeft()),Ks=new m("org.eclipse.elk.debugMode",!1),lr=new m("org.eclipse.elk.direction",R.UNDEFINED),cu=new m("org.eclipse.elk.edgeRouting",At.UNDEFINED),Ll=new m("org.eclipse.elk.expandNodes",!1),yr=new m("org.eclipse.elk.hierarchyHandling",Oe.INHERIT),ns=new m("org.eclipse.elk.padding",new yt(12)),zo=new m("org.eclipse.elk.interactive",!1),ZO=new m("org.eclipse.elk.interactiveLayout",!1),So=new m("org.eclipse.elk.omitNodeMicroLayout",!1),jO=new m("org.eclipse.elk.json.shapeCoords",Fp.INHERIT),$O=new m("org.eclipse.elk.json.edgeCoords",Ap.INHERIT),qO=new m("org.eclipse.elk.spacing.commentComment",10,0),JO=new m("org.eclipse.elk.spacing.commentNode",10,0),QO=new m("org.eclipse.elk.spacing.componentComponent",20,0),tS=new m("org.eclipse.elk.spacing.edgeEdge",10,0),gu=new m("org.eclipse.elk.spacing.edgeLabel",2,0),eS=new m("org.eclipse.elk.spacing.edgeNode",10,0),hu=new m("org.eclipse.elk.spacing.labelLabel",0,0),Zs=new m("org.eclipse.elk.spacing.labelNode",5,0),du=new m("org.eclipse.elk.spacing.labelPortHorizontal",1),fu=new m("org.eclipse.elk.spacing.labelPortVertical",1),Pi=new m("org.eclipse.elk.spacing.nodeNode",20,0),oS=new m("org.eclipse.elk.spacing.nodeSelfLoop",10,0),uu=new m("org.eclipse.elk.spacing.portPort",10,0),as=new m("org.eclipse.elk.spacing.individual"),_u=new m("org.eclipse.elk.spacing.portsSurrounding",new me(0)),rS=new m("org.eclipse.elk.partitioning.partition"),iS=new m("org.eclipse.elk.partitioning.activate",!1),pu=new m("org.eclipse.elk.nodeLabels.padding",new yt(5)),Kr=new m("org.eclipse.elk.nodeLabels.placement",k.fixed),Eu=new m("org.eclipse.elk.portAlignment.default",Jt.DISTRIBUTED),xl=new m("org.eclipse.elk.portAlignment.north"),Dl=new m("org.eclipse.elk.portAlignment.south"),wl=new m("org.eclipse.elk.portAlignment.west"),Ml=new m("org.eclipse.elk.portAlignment.east"),cr=new m("org.eclipse.elk.portConstraints",H.UNDEFINED),ho=new m("org.eclipse.elk.position"),mu=new m("org.eclipse.elk.priority"),Pu=new m("org.eclipse.elk.randomSeed"),sS=new m("org.eclipse.elk.separateConnectedComponents"),Mo=new m("org.eclipse.elk.nodeSize.constraints",new Set),Oo=new m("org.eclipse.elk.nodeSize.options",new Set([Nt.DEFAULT_MINIMUM_SIZE])),Yo=new m("org.eclipse.elk.nodeSize.minimum",new O(0,0)),To=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1),gr=new m("org.eclipse.elk.junctionPoints",new st),nS=new m("org.eclipse.elk.commentBox",!1),Aa=new m("org.eclipse.elk.edgeLabels.placement",St.CENTER),Ou=new m("org.eclipse.elk.edgeLabels.inline",!1),aS=new m("org.eclipse.elk.font.name"),lS=new m("org.eclipse.elk.font.size",null,1),cS=new m("org.eclipse.elk.hypernode",!1),gS=new m("org.eclipse.elk.labelManager"),hS=new m("org.eclipse.elk.softwrappingFuzziness",0),Nr=new m("org.eclipse.elk.margins",new me),bl=new m("org.eclipse.elk.noLayout",!1),au=new m("org.eclipse.elk.port.anchor"),Gl=new m("org.eclipse.elk.port.index"),Tr=new m("org.eclipse.elk.port.side",u.UNDEFINED),Ke=new m("org.eclipse.elk.port.borderOffset"),Ir=new m("org.eclipse.elk.portLabels.placement",it.outside),Hl=new m("org.eclipse.elk.portLabels.nextToPortIfPossible",!1),Su=new m("org.eclipse.elk.portLabels.treatAsGroup",!0),lu=new m("org.eclipse.elk.scaleFactor",1,Xe.greaterThan(0)),pi=new m("org.eclipse.elk.childAreaWidth"),Ei=new m("org.eclipse.elk.childAreaHeight"),js=new m("org.eclipse.elk.topdownLayout",!1),dS=new m("org.eclipse.elk.topdown.sizeCategories",3,1),fS=new m("org.eclipse.elk.topdown.sizeCategoriesHierarchicalNodeWeight",4,1),kp=new m("org.eclipse.elk.topdown.scaleFactor",1,Xe.greaterThan(0)),uS=new m("org.eclipse.elk.topdown.sizeApproximator"),Wp=new m("org.eclipse.elk.topdown.hierarchicalNodeWidth",150),zp=new m("org.eclipse.elk.topdown.hierarchicalNodeAspectRatio",1.414),_S=new m("org.eclipse.elk.topdown.nodeType"),pS=new m("org.eclipse.elk.topdown.scaleCap",1),ls=new m("org.eclipse.elk.insideSelfLoops.activate",!1),Ca=new m("org.eclipse.elk.insideSelfLoops.yo",!1),ES=new m("org.eclipse.elk.edge.thickness",1),mS=new m("org.eclipse.elk.edge.type",Cp.NONE),PS=new m("org.eclipse.elk.animate",!0),OS=new m("org.eclipse.elk.animTimeFactor",100,0),SS=new m("org.eclipse.elk.layoutAncestors",!1),TS=new m("org.eclipse.elk.maxAnimTime",4e3,0),NS=new m("org.eclipse.elk.minAnimTime",400,0),yS=new m("org.eclipse.elk.progressBar",!1),IS=new m("org.eclipse.elk.validateGraph",!1),RS=new m("org.eclipse.elk.validateOptions",!0),LS=new m("org.eclipse.elk.zoomToFit",!1),AS="org.eclipse.elk.layered",CS="org.eclipse.elk.orthogonal",xS="org.eclipse.elk.force",DS="org.eclipse.elk.circle",wS="org.eclipse.elk.tree",MS="org.eclipse.elk.planar",bS="org.eclipse.elk.radial",Yp="org.eclipse.elk.fixed",GS="org.eclipse.elk.box",HS="org.eclipse.elk.random";var Bl=class{static forGraph(t){let e=new yu;if(typeof t=="string")e._graphString=t;else if(t!=null&&typeof t=="object"&&!(t instanceof Array)){if(typeof t.getChildren=="function"&&typeof t.getProperty=="function")return new Iu(t);e._jsonGraph=t}else throw new Error("ElkGraphJson.forGraph expects a string, plain JSON object, or ElkNode.");return e}},yu=class{constructor(){this._graphString=null,this._jsonGraph=null,this._importerMaybe=null,this._lenient=!0}rememberImporter(t){return this._importerMaybe=t,this}lenient(t){return this._lenient=t,this}toElk(){if(this._jsonGraph==null){if(this._graphString==null)throw new Error("No graph has been set on the import builder.");if(this._jsonGraph=JSON.parse(this._graphString),this._jsonGraph==null||typeof this._jsonGraph!="object"||Array.isArray(this._jsonGraph))throw new Oi("Top-level element of the graph must be a json object.")}let t=new Ru,e=t.transform(this._jsonGraph);return this._importerMaybe!=null&&(this._importerMaybe.value=t),e}},Iu=class{constructor(t){this._graph=t,this._prettyPrint=!1,this._omitZeroPosition=!0,this._omitZeroDimension=!0,this._omitLayoutInformation=!1,this._shortLayoutOptionKeys=!0,this._omitUnknownLayoutOptions=!0}prettyPrint(t){return this._prettyPrint=t,this}shortLayoutOptionKeys(t){return this._shortLayoutOptionKeys=t,this}omitZeroPositions(t){return this._omitZeroPosition=t,this}omitZeroDimension(t){return this._omitZeroDimension=t,this}omitLayout(t){return this._omitLayoutInformation=t,this}omitUnknownLayoutOptions(t){return this._omitUnknownLayoutOptions=t,this}toJson(){let t=new Lu;t.setOptions({omitZeroPosition:this._omitZeroPosition,omitZeroDimension:this._omitZeroDimension,omitLayoutInformation:this._omitLayoutInformation,shortLayoutOptionKeys:this._shortLayoutOptionKeys,omitUnknownLayoutOptions:this._omitUnknownLayoutOptions});let e=t.export(this._graph);return this._prettyPrint?JSON.stringify(e,null,2):JSON.stringify(e)}},Oi=class extends Error{constructor(t){super(t),this.name="JsonImportException"}},Ru=class{constructor(){this._nodeIdMap=new Map,this._portIdMap=new Map,this._edgeIdMap=new Map,this._nodeJsonMap=new Map,this._portJsonMap=new Map,this._edgeJsonMap=new Map,this._labelJsonMap=new Map,this._inputModel=null}getInputModel(){return this._inputModel}transform(t){this._inputModel=t,this._nodeIdMap.clear(),this._portIdMap.clear(),this._edgeIdMap.clear(),this._nodeJsonMap.clear(),this._portJsonMap.clear(),this._edgeJsonMap.clear(),this._labelJsonMap.clear();let e=this._transformNode(t,null);return this._transformEdges(t),e}_transformNode(t,e){let o=e==null?Oa():Fs(e),r=t.id;if(r==null)throw new Oi("Every element must have an id.");if(o.identifier=String(r),this._nodeIdMap.set(r,o),this._nodeJsonMap.set(o,t),Au(o,t),Zr(o,t.layoutOptions),Zr(o,t.properties),Array.isArray(t.labels))for(let i of t.labels)Tu(i,o,this._labelJsonMap);if(Array.isArray(t.ports))for(let i of t.ports)this._transformPort(i,o);if(Array.isArray(t.children))for(let i of t.children)this._transformNode(i,o);return o}_transformPort(t,e){let o=Kf(e),r=t.id;if(r==null)throw new Oi("Every element must have an id.");if(o.identifier=String(r),this._portIdMap.set(r,o),this._portJsonMap.set(o,t),Au(o,t),Zr(o,t.layoutOptions),Zr(o,t.properties),Array.isArray(t.labels))for(let i of t.labels)Tu(i,o,this._labelJsonMap);return o}_transformEdges(t){if(Array.isArray(t.edges))for(let e of t.edges)this._transformEdge(e,this._nodeIdMap.get(t.id));if(Array.isArray(t.children))for(let e of t.children)this._transformEdges(e)}_transformEdge(t,e){var c,g,h,d,f,E;let o=t.id;if(o==null)throw new Oi("Every element must have an id.");let r=t.sources||[],i=t.targets||[];if(r.length===0||i.length===0)throw new Oi(`Edge ${o} must have at least one source and one target.`);let s=this._resolveShape(r[0]),a=this._resolveShape(i[0]);if(s==null||a==null)throw new Oi(`Edge ${o} references an unknown source or target.`);let l=Zf(s,a);l.identifier=String(o);for(let P=1;P<r.length;P++){let S=this._resolveShape(r[P]);S!=null&&l.getSources().push(S)}for(let P=1;P<i.length;P++){let S=this._resolveShape(i[P]);S!=null&&l.getTargets().push(S)}if(this._edgeIdMap.set(o,l),this._edgeJsonMap.set(l,t),Zr(l,t.layoutOptions),Zr(l,t.properties),Array.isArray(t.sections))for(let P of t.sections){let S=Nl(l);if(P.id!=null&&(S.identifier=String(P.id)),P.startPoint!=null&&(S.startX=(c=P.startPoint.x)!=null?c:0,S.startY=(g=P.startPoint.y)!=null?g:0),P.endPoint!=null&&(S.endX=(h=P.endPoint.x)!=null?h:0,S.endY=(d=P.endPoint.y)!=null?d:0),Array.isArray(P.bendPoints))for(let T of P.bendPoints)Sa(S,(f=T.x)!=null?f:0,(E=T.y)!=null?E:0)}if(Array.isArray(t.labels))for(let P of t.labels)Tu(P,l,this._labelJsonMap)}_resolveShape(t){let e=this._portIdMap.get(t)||this._nodeIdMap.get(t);if(e!=null)return e;let o=String(t),r=o.indexOf(":");if(r>0){let i=o.substring(r+1),s=this._nodeIdMap.get(o.substring(0,r));if(s!=null&&typeof s.getPorts=="function"){for(let a of s.getPorts())if(typeof a.getIdentifier=="function"&&a.getIdentifier()===i)return a}return this._portIdMap.get(i)||null}return null}transferLayout(t){this._transferShapesAndPorts(t),this._transferEdges(t)}_transferShapesAndPorts(t){let e=this._nodeJsonMap.get(t);e!=null&&xa(e,t);for(let o of t.getLabels()){let r=this._labelJsonMap.get(o);r!=null&&xa(r,o)}for(let o of t.getPorts()){let r=this._portJsonMap.get(o);r!=null&&xa(r,o);for(let i of o.getLabels()){let s=this._labelJsonMap.get(i);s!=null&&xa(s,i)}}for(let o of t.getChildren())this._transferShapesAndPorts(o)}_transferEdges(t){for(let e of t.getContainedEdges()){let o=this._edgeJsonMap.get(e);o!=null&&vS(o,e);for(let r of e.getLabels()){let i=this._labelJsonMap.get(r);i!=null&&xa(i,r)}}for(let e of t.getChildren())this._transferEdges(e)}};function xa(n,t){n.x=t.x||0,n.y=t.y||0,n.width=t.width||0,n.height=t.height||0}function vS(n,t){let e=t.getSections?t.getSections():[];if(e.length>0){let o=n.id!=null?String(n.id):"";n.sections=e.map((r,i)=>{let s={id:r.identifier||o+"_s"+i,startPoint:{x:r.startX||0,y:r.startY||0},endPoint:{x:r.endX||0,y:r.endY||0}};r.bendPoints&&r.bendPoints.length>0&&(s.bendPoints=r.bendPoints.map(c=>({x:c.x,y:c.y})));let a=r.getIncomingShape?r.getIncomingShape():null;a!=null&&a.identifier&&(s.incomingShape=a.identifier);let l=r.getOutgoingShape?r.getOutgoingShape():null;return l!=null&&l.identifier&&(s.outgoingShape=l.identifier),s})}if(t.hasProperty&&t.hasProperty(gr)){let o=t.getProperty(gr);o!=null&&o.length>0&&(n.junctionPoints=o.map(r=>({x:r.x,y:r.y})))}}var Lu=class{constructor(){this._options={omitZeroPosition:!0,omitZeroDimension:!0,omitLayoutInformation:!1,shortLayoutOptionKeys:!1,omitUnknownLayoutOptions:!0}}setOptions(t){Object.assign(this._options,t)}export(t){return this._exportNode(t)}_exportNode(t){let e={id:t.identifier||cs(t)};Cu(e,t,this._options),vl(e,t,this._options);let o=t.getLabels?t.getLabels():[];o&&o.length>0&&(e.labels=o.map(a=>Nu(a,this._options)));let r=t.getPorts?t.getPorts():[];r&&r.length>0&&(e.ports=r.map(a=>this._exportPort(a)));let i=t.getChildren?t.getChildren():[];i&&i.length>0&&(e.children=i.map(a=>this._exportNode(a)));let s=t.getContainedEdges?t.getContainedEdges():[];return s&&s.length>0&&(e.edges=s.map(a=>this._exportEdge(a))),e}_exportPort(t){let e={id:t.identifier||cs(t)};Cu(e,t,this._options),vl(e,t,this._options);let o=t.getLabels?t.getLabels():[];return o&&o.length>0&&(e.labels=o.map(r=>Nu(r,this._options))),e}_exportEdge(t){let e={id:t.identifier||cs(t),sources:t.getSources().map(i=>i.identifier||cs(i)),targets:t.getTargets().map(i=>i.identifier||cs(i))};vl(e,t,this._options);let o=t.getSections?t.getSections():[];o&&o.length>0&&!this._options.omitLayoutInformation&&(e.sections=o.map(i=>({id:i.identifier||cs(i),startPoint:{x:i.startX||0,y:i.startY||0},endPoint:{x:i.endX||0,y:i.endY||0},bendPoints:(i.bendPoints||[]).map(s=>({x:s.x,y:s.y}))})));let r=t.getLabels?t.getLabels():[];return r&&r.length>0&&(e.labels=r.map(i=>Nu(i,this._options))),e}},Vp=0,Xp=new WeakMap;function cs(n){let t=Xp.get(n);return t===void 0&&(Vp+=1,t="__auto_"+Vp,Xp.set(n,t)),t}function Au(n,t){t.x!=null&&(n.x=Number(t.x)),t.y!=null&&(n.y=Number(t.y)),t.width!=null&&(n.width=Number(t.width)),t.height!=null&&(n.height=Number(t.height))}function Cu(n,t,e){let o=t.x||0,r=t.y||0;(!e.omitZeroPosition||o!==0||r!==0)&&(n.x=o,n.y=r);let i=t.width||0,s=t.height||0;(!e.omitZeroDimension||i!==0||s!==0)&&(n.width=i,n.height=s)}function Zr(n,t,e=!0){if(t==null||typeof t!="object")return;let o=Ht.getInstance();for(let[r,i]of Object.entries(t)){let s=m.byId(r)||m.bySuffix(r),a=null;if(o!=null&&(a=o.getOptionData(r),a==null&&typeof o.getOptionDataBySuffix=="function"&&(a=o.getOptionDataBySuffix(r))),s!=null){if(!e&&n.hasProperty(s))continue;let l=BS(s,a,i);l!==void 0&&n.setProperty(s,l)}else if(a!=null){if(!e&&n.hasProperty(a))continue;let l=typeof a.parseValue=="function"?a.parseValue(String(i)):i;l!=null&&n.setProperty(a,l)}else{let l=new m(r);if(!e&&n.hasProperty(l))continue;n.setProperty(l,i)}}}function gs(n,t,e=!0){Zr(n,t,e)}function BS(n,t,e){let o=US.get(n.getId());if(o)return FS(o,e);if(t&&typeof t.parseValue=="function"){let s=t.parseValue(String(e));return s!=null?s:void 0}if(typeof e!="string")return e;let r=n.getDefault();if(r!=null){if(typeof r.parse=="function"&&typeof r.clone=="function"){let a=r.clone();try{return a.parse(String(e)),a}catch(l){return}}if(r instanceof Set){let a=new Set;for(let l of e.split(/[[\]\s,]+/))l&&a.add(l);return a}let s=r.constructor;if(s&&s!==Number&&s!==String&&s!==Boolean&&s!==Object){let a=s[e];if(a instanceof s)return a;if(Object.prototype.hasOwnProperty.call(s,"valueOf")&&typeof s.valueOf=="function"){let l=s.valueOf(e);if(l instanceof s)return l}if(/^\d+$/.test(e)&&typeof s.values=="function"){let l=s.values(),c=parseInt(e,10);if(Array.isArray(l)&&c<l.length)return l[c]}return}if(typeof r=="number"){let a=Number(e);return Number.isNaN(a)?void 0:a}if(typeof r=="boolean")return e==="true"?!0:e==="false"?!1:void 0}if(e==="true")return!0;if(e==="false")return!1;let i=Number(e);return!Number.isNaN(i)&&e.trim()!==""?i:e}var US=new Map([["org.eclipse.elk.position",O],["org.eclipse.elk.bendPoints",st],["org.eclipse.elk.port.anchor",O]]);function FS(n,t){if(t instanceof n)return t;if(typeof t=="string"){let e=new n;try{return e.parse(t),e}catch(o){return}}if(n===O&&t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number")return new O(t.x,t.y);if(n===st&&Array.isArray(t)){let e=new st;for(let o of t){if(o==null||typeof o.x!="number"||typeof o.y!="number")return;e.add(new O(o.x,o.y))}return e}}function vl(n,t,e){if(e.omitLayoutInformation)return;let o=t.getAllProperties?t.getAllProperties():null;if(o==null||o.size===0)return;let r={},i=!1;for(let[s,a]of o.entries()){if(s==null)continue;let l=s.getId?s.getId():s.id||null;l!=null&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean"?r[l]=a:a!=null&&typeof a.toString=="function"&&(r[l]=a.toString()),i=!0)}i&&(n.layoutOptions=r)}function Tu(n,t,e){let o=Tl(t);return n.id!=null&&(o.identifier=String(n.id)),n.text!=null&&(o.text=String(n.text)),Au(o,n),Zr(o,n.layoutOptions),Zr(o,n.properties),e!=null&&e.set(o,n),o}function Nu(n,t){let e={id:n.identifier||cs(n)};return n.text!=null&&(e.text=n.text),Cu(e,n,t),vl(e,n,t),e}var hs=class{visit(t){let e=Ul();t&&typeof t.getChildren=="function"&&!t.getProperty(e.NO_LAYOUT)&&this.resolveAlgorithm(t)}resolveAlgorithm(t){let e=Ul(),o=t.getProperty(e.ALGORITHM);if(!this.resolveAndSetAlgorithm(o,t)&&this.mustResolve(t))if(!o||o.trim()===""){let r=this.getDefaultLayoutAlgorithmID();if(!this.resolveAndSetAlgorithm(r,t)){let i=`Unable to load default layout algorithm '${r}' for unconfigured node`;throw t.getIdentifier&&(i+=` '${t.getIdentifier()}'`),new Error(i)}}else{let r=`Layout algorithm '${o}' not found`;throw t.getIdentifier&&(r+=` for node '${t.getIdentifier()}'`),new Error(r)}}resolveAndSetAlgorithm(t,e){let o=Ht.getInstance().getAlgorithmDataBySuffix(t);if(o!==null){let r=Ul();return e.setProperty(r.RESOLVED_ALGORITHM,o),!0}return!1}mustResolve(t){let e=Ul();return!t.hasProperty(e.RESOLVED_ALGORITHM)&&(t.getChildren().length>0||t.getProperty(e.INSIDE_SELF_LOOPS_ACTIVATE))}getDefaultLayoutAlgorithmID(){return"org.eclipse.elk.layered"}},Fl=null;function Ul(){if(!Fl)try{Fl=_injectedCoreOptions}catch(n){throw new Error("CoreOptions not available. Call LayoutAlgorithmResolver.setCoreOptions(CoreOptions) before using this class, or ensure CoreOptions is registered with LayoutMetaDataService.")}return Fl}hs.setCoreOptions=function(n){Fl=n};var kS=n=>{n.getProperty(Ir).add(it.NEXT_TO_PORT_IF_POSSIBLE),n.setProperty(Hl,null)},WS=n=>{n.getProperty(Oo).has(Nt.SPACE_EFFICIENT_PORT_LABELS)&&(n.getProperty(Ir).add(it.SPACE_EFFICIENT),n.getProperty(Oo).delete(Nt.SPACE_EFFICIENT_PORT_LABELS))},zS=new Map([[Hl,kS],[Oo,WS]]),kl=class{visit(t){for(let[e,o]of zS)t.hasProperty(e)&&o(t)}};var Wl=class{layout(t,e){let o=this._countNodesRecursively(t,!0);e.begin("Recursive Graph Layout",o),vp(t,new kl),t.hasProperty&&t.hasProperty(ss)||Kp(t,new hs),this._layoutRecursively(t,e),e.done()}_layoutRecursively(t,e){if(e.isCanceled())return[];if(t.getProperty&&t.getProperty(bl))return[];let o=t.children&&t.children.length>0,r=this._gatherInsideSelfLoops(t),i=r.length>0;if(!o&&!i)return[];let s=t.getProperty?t.getProperty(ss):null;if(!s)throw new Error("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before layout.");let a=s.supportsFeature("INSIDE_SELF_LOOPS");if(this._evaluateHierarchyHandlingInheritance(t),!o&&i&&!a)return[];let l=[],c=t.getProperty?t.getProperty(yr):null,g=s.supportsFeature("COMPOUND"),h=s.supportsFeature("CLUSTERS");if(c===Oe.INCLUDE_CHILDREN&&(g||h)){if(t.getProperty&&t.getProperty(js))throw new Error("Topdown layout cannot be used together with hierarchy handling.");let f=(t.children||[]).slice();for(;f.length>0;){let E=f.shift();this._evaluateHierarchyHandlingInheritance(E);let S=(E.getProperty?E.getProperty(yr):null)===Oe.SEPARATE_CHILDREN,T=E.getProperty&&E.hasProperty&&E.hasProperty(mi)&&!s.equals(E.getProperty(ss));if(S||T){let N=this._layoutRecursively(E,e);l.push(...N),E.setProperty&&E.setProperty(yr,Oe.SEPARATE_CHILDREN),ru(E)}else f.push(...E.children||[])}}else for(let f of t.children||[]){let E=this._layoutRecursively(f,e);l.push(...E),ru(f)}if(e.isCanceled())return[];for(let f of l)f.setProperty&&f.setProperty(bl,!0);let d=t.children?t.children.length:0;return this._executeAlgorithm(t,s,e.subTask(d)),this._postProcessInsideSelfLoops(l),i&&a?r:[]}_executeAlgorithm(t,e,o){let r=e.createLayoutProvider();try{r.layout(t,o)}catch(i){throw r.dispose(),i}}_countNodesRecursively(t,e){let o=(t.children||[]).length;for(let r of t.children||[])r.children&&r.children.length>0&&(o+=this._countNodesRecursively(r,!1));if(e){let r=t.parent;for(;r;)o+=(r.children||[]).length,r=r.parent}return o}_countNodesWithHierarchy(t){let e=(t.children||[]).length;for(let o of t.children||[])if((o.getProperty?o.getProperty(yr):null)!==Oe.SEPARATE_CHILDREN){let i=t.getProperty?t.getProperty(ss):null,s=o.getProperty?o.getProperty(ss):null;(i===s||i&&i.equals&&i.equals(s))&&o.children&&o.children.length>0&&(e+=this._countNodesWithHierarchy(o))}return e}_evaluateHierarchyHandlingInheritance(t){if(!t.getProperty)return;if(t.getProperty(yr)===Oe.INHERIT)if(!t.parent)t.setProperty(yr,Oe.SEPARATE_CHILDREN);else{let o=t.parent.getProperty?t.parent.getProperty(yr):Oe.SEPARATE_CHILDREN;t.setProperty(yr,o)}}_gatherInsideSelfLoops(t){if(!t.getProperty||!t.getProperty(ls))return[];let e=[];for(let o of Ee(t))o.isSelfloop&&o.isSelfloop()&&o.getProperty&&o.getProperty(Ca)&&e.push(o);return e}_postProcessInsideSelfLoops(t){for(let e of t){let o=e.sources&&e.sources[0];if(!o)continue;let r=o.parent!==void 0?o.parent:o,i=r.x||0,s=r.y||0;if(!e.sections||e.sections.length===0)continue;let a=e.sections[0];a.setStartLocation(a.startX+i,a.startY+s),a.setEndLocation(a.endX+i,a.endY+s);for(let l of a.bendPoints||[])l.set(l.x+i,l.y+s);if(e.getProperty){let l=e.getProperty(gr);l&&typeof l.offset=="function"&&l.offset(i,s)}}}};function Kp(n,t){t.visit(n);for(let e of n.children||[])Kp(e,t);for(let e of n.ports||[])t.visit(e);for(let e of n.labels||[])t.visit(e);for(let e of n.containedEdges||[])t.visit(e)}var zl=class{isCanceled(){return!1}begin(t,e){return!1}worked(t){}done(){}isRunning(){return!1}getTaskName(){return null}subTask(t){return this}getSubMonitors(){return null}getParentMonitor(){return null}isLoggingEnabled(){return!1}isLogPersistenceEnabled(){return!1}log(t){}getLogs(){return null}logGraph(t,e,o){}getLoggedGraphs(){return null}isExecutionTimeMeasured(){return!1}getExecutionTime(){return 0}};var Se=class n{constructor(t){this._id=t.id||"",this._name=t.name||"",this._description=t.description||"",this._category=t.category||null,this._melkBundleName=t.melkBundleName||null,this._definingBundleId=t.definingBundleId||null,this._imagePath=t.imagePath||null,this._supportedFeatures=t.supportedFeatures||new Set,this._providerFactory=t.providerFactory||null,this._validatorClass=t.validatorClass||null,this._knownOptions=new Map}getId(){return this._id}getName(){return this._name}getDescription(){return this._description}getCategoryId(){return this._category}getBundleName(){return this._melkBundleName}getDefiningBundleId(){return this._definingBundleId}getPreviewImagePath(){return this._imagePath}getSupportedFeatures(){return this._supportedFeatures}supportsFeature(t){return this._supportedFeatures.has(t)}getValidatorClass(){return this._validatorClass}createLayoutProvider(){return this._providerFactory?this._providerFactory():null}getInstancePool(){let t=this._providerFactory;return{fetch(){return t?t():null},release(e){},clear(){}}}addKnownOption(t,e){this._knownOptions.set(t.getId(),e)}getKnownOptionIds(){return new Set(this._knownOptions.keys())}knowsOption(t){let e=typeof t=="string"?t:t.getId();return this._knownOptions.has(e)}getDefaultValue(t){let e=typeof t=="string"?t:t.getId();return this._knownOptions.get(e)}equals(t){return t instanceof n?this._id===t._id:!1}toString(){return`Layout Algorithm: ${this._id}`}},xu=class{constructor(){this._id="",this._name="",this._description="",this._category=null,this._melkBundleName=null,this._definingBundleId=null,this._imagePath=null,this._supportedFeatures=null,this._providerFactory=null,this._validatorClass=null}create(){return new Se({id:this._id,name:this._name,description:this._description,category:this._category,melkBundleName:this._melkBundleName,definingBundleId:this._definingBundleId,imagePath:this._imagePath,supportedFeatures:this._supportedFeatures||new Set,providerFactory:this._providerFactory,validatorClass:this._validatorClass})}id(t){return this._id=t,this}name(t){return this._name=t,this}description(t){return this._description=t,this}category(t){return this._category=t,this}melkBundleName(t){return this._melkBundleName=t,this}definingBundleId(t){return this._definingBundleId=t,this}imagePath(t){return this._imagePath=t,this}supportedFeatures(t){return this._supportedFeatures=t,this}providerFactory(t){return this._providerFactory=t,this}validatorClass(t){return this._validatorClass=t,this}};Se.Builder=xu;var Zp=new m("org.eclipse.elk.padding",new yt(15));var Yl=class extends de{layout(t,e){e.begin("Fixed Layout",1);let o=t.getProperty(cu),r=0,i=0;for(let s of t.children){let a=s.getProperty(ho);if(a!=null){s.setLocation(a.x,a.y);let l=s.getProperty(Mo);if(l&&l.has(mt.MINIMUM_SIZE)){let c=s.getProperty(Yo);c!=null&&c.x>0&&c.y>0&&Ae(s,c.x,c.y,!0,!0)}}r=Math.max(r,s.getX()+s.getWidth()),i=Math.max(i,s.getY()+s.getHeight());for(let l of s.labels)a=l.getProperty(ho),a!=null&&l.setLocation(a.x,a.y),r=Math.max(r,s.getX()+l.getX()+l.getWidth()),i=Math.max(i,s.getY()+l.getY()+l.getHeight());for(let l of s.ports){a=l.getProperty(ho),a!=null&&l.setLocation(a.x,a.y);let c=s.getX()+l.getX(),g=s.getY()+l.getY();r=Math.max(r,c+l.getWidth()),i=Math.max(i,g+l.getHeight());for(let h of l.labels)a=h.getProperty(ho),a!=null&&h.setLocation(a.x,a.y),r=Math.max(r,c+h.getX()+h.getWidth()),i=Math.max(i,g+h.getY()+h.getHeight())}for(let l of Ee(s)){let c=this._processEdge(l,o);r=Math.max(r,c.x),i=Math.max(i,c.y)}for(let l of _i(s)){let c=Pt(l.sources[0]);if(c&&c.parent!==t){let g=this._processEdge(l,o);r=Math.max(r,g.x),i=Math.max(i,g.y)}}}if(o===At.ORTHOGONAL)for(let s of t.children)for(let a of Ee(s))this._generateJunctionPoints(a);if(!t.getProperty(To)){let s=t.getProperty(Zp),a=r+s.getLeft()+s.getRight(),l=i+s.getTop()+s.getBottom();Ae(t,a,l,!0,!0)}e.done()}_processEdge(t,e){let o=Pt(t.sources[0]),r=Pt(t.targets[0]),i=o?o.parent:null,s=r?r.parent:null,a=i===s,l=new O,c=t.getProperty(Cl);if(c!=null&&c.size()>=2&&(t.sections.length===0?t.sections.push(new Vr):t.sections.length>1&&t.sections.splice(1,t.sections.length-1),Xs(c,t.sections[0])),a)for(let g of t.sections)for(let h of g.bendPoints)l.x=Math.max(l.x,h.getX()),l.y=Math.max(l.y,h.getY());for(let g of t.labels){let h=g.getProperty(ho);h!=null&&g.setLocation(h.x,h.y),a&&(l.x=Math.max(l.x,g.getX()+g.getWidth()),l.y=Math.max(l.y,g.getY()+g.getHeight()))}return l}_generateJunctionPoints(t){let e=Gp(t);e.isEmpty()?t.setProperty(gr,null):t.setProperty(gr,e)}};var jp=new m("org.eclipse.elk.padding",new yt(15)),$p=new m("org.eclipse.elk.spacing.nodeNode",15,0),qp=new m("org.eclipse.elk.randomSeed",0),Jp=new m("org.eclipse.elk.aspectRatio",1.6,Xe.greaterThan(0));var Qp=BigInt(0x5DEECE66D),XS=BigInt(11),tE=(BigInt(1)<<BigInt(48))-BigInt(1),dr=class{constructor(t){t==null||t===0?(this._mathFallback=!0,this._seed=BigInt(0)):(this._mathFallback=!1,this.setSeed(t))}setSeed(t){let e=typeof t=="bigint"?t:BigInt(t);this._seed=(e^Qp)&tE,this._mathFallback=!1,this._nextGaussianStored=void 0}_next(t){this._seed=this._seed*Qp+XS&tE;let e=this._seed>>BigInt(48-t);return Number(e&BigInt(0xFFFFFFFF))|0}nextDouble(){if(this._mathFallback)return Math.random();let t=BigInt(this._next(26)),e=BigInt(this._next(27)),o=(t<<BigInt(27))+e;return Number(o)/Number(BigInt(1)<<BigInt(53))}nextFloat(){return this._mathFallback?Math.random():this._next(24)/(1<<24)}nextInt(t){if(this._mathFallback)return Math.floor(Math.random()*t);if(t<=0)throw new Error("bound must be positive");if((t&-t)===t){let r=BigInt(this._next(31));return Number(BigInt(t)*r>>BigInt(31))}let e,o;do e=this._next(31),o=e%t;while((e-o+(t-1)|0)<0);return o}nextBoolean(){return this._mathFallback?Math.random()>=.5:this._next(1)!==0}nextLong(){if(this._mathFallback)return BigInt(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER));let t=BigInt(this._next(32)),e=BigInt(this._next(32));return BigInt.asIntN(64,(t<<BigInt(32))+e)}nextGaussian(){if(this._mathFallback)return KS();if(this._nextGaussianStored!==void 0){let i=this._nextGaussianStored;return this._nextGaussianStored=void 0,i}let t,e,o;do t=2*this.nextDouble()-1,e=2*this.nextDouble()-1,o=t*t+e*e;while(o>=1||o===0);let r=Math.sqrt(-2*Math.log(o)/o);return this._nextGaussianStored=e*r,t*r}};function KS(){let n=0,t=0;for(;n===0;)n=Math.random();for(;t===0;)t=Math.random();return Math.sqrt(-2*Math.log(n))*Math.cos(2*Math.PI*t)}var $s=class n extends de{layout(t,e){if(e.begin("Random Layout",1),t.children.length===0){e.done();return}let o=t.getProperty(qp),r=o!=null&&o!==0?new dr(o):new dr,i=t.getProperty(Jp),s=t.getProperty($p),a=t.getProperty(jp);this._randomizeGraph(t,r,i,s,a),e.done()}_randomizeGraph(t,e,o,r,i){let s=0,a=0,l=0,c=1;for(let T of t.children){for(let C of Ee(T))c++;let N=T.getWidth();a=Math.max(a,N);let I=T.getHeight();l=Math.max(l,I),s+=N*I}let g=t.children.length,h=s+2*r*r*c*g,d=Math.sqrt(h),f=Math.max(d*o,a),E=Math.max(d/o,l);for(let T of t.children){let N=i.getLeft()+e.nextDouble()*(f-T.getWidth()),I=i.getLeft()+e.nextDouble()*(E-T.getHeight());T.setLocation(N,I)}let P=f+i.getHorizontal(),S=E+i.getVertical();for(let T of t.children)for(let N of Ee(T))N.isHierarchical()||this._randomizeEdge(N,e,P,S);P+=i.getLeft()+i.getRight(),S+=i.getTop()+i.getBottom(),Ae(t,P,S,!1,!0)}_randomizeEdge(t,e,o,r){let i=t.sources[0],s=i.getX(),a=i.getY(),l=i.getWidth()/2,c=i.getHeight()/2;i instanceof Ve&&(s+=i.getParent().getX(),s+=i.getParent().getX()),s+=l,a+=c;let g=t.sources[0],h=g.getX(),d=g.getY(),f=g.getWidth()/2,E=g.getHeight()/2;if(g instanceof Ve&&(h+=g.getParent().getX(),h+=g.getParent().getX()),h+=f,d+=E,t.sections.length===0)t.sections.push(new Vr);else if(t.sections.length>1){let ot=t.sections[t.sections.length-1];t.sections.length=0,t.sections.push(ot)}let P=t.sections[0],S=h;h>s+l?S=s+l:h<s-l&&(S=s-l);let T=d;d>a+c?T=a+c:d<a-c&&(T=a-c),S>s-l&&S<s+l&&T>a-c&&T<a+c&&(S=s+l),P.setStartLocation(S,T);let N=s;s>h+f?N=h+f:s<h-f&&(N=h-f);let I=a;a>d+E?I=d+E:a<d-E&&(I=d-E),N>h-f&&N<h+f&&I>d-E&&I<d+E&&(I=d+E),P.setEndLocation(N,I),P.bendPoints.length=0;let C=e.nextInt(n.MAX_BENDS);i===g&&C++;let x=N-S,M=I-T,B=Math.sqrt(x*x+M*M)*n.RAND_FACT,Y=x/(C+1),j=M/(C+1),X=S,tt=T;for(let ot=0;ot<C;ot++){X+=Y,tt+=j;let Lt=X+e.nextFloat()*B-B/2;Lt<0?Lt=1:Lt>o&&(Lt=o-1);let zt=tt+e.nextFloat()*B-B/2;zt<0?zt=1:zt>r&&(zt=r-1);let be=new Xr;be.set(Lt,zt),P.bendPoints.push(be)}}};$s.MAX_BENDS=5;$s.RAND_FACT=.2;var ZS=[{id:"org.eclipse.elk.fixed",name:"ELK Fixed",description:"Keeps the current layout as it is, without any automatic modification. Optional coordinates can be given for nodes and edge bend points.",providerFactory:()=>new Yl},{id:"org.eclipse.elk.box",name:"ELK Box",description:"Algorithm for packing of unconnected boxes, i.e. graphs without edges.",providerFactory:()=>new rs},{id:"org.eclipse.elk.random",name:"ELK Randomizer",description:'Distributes the nodes randomly on the plane, leading to very obfuscating layouts. Can be useful to demonstrate the power of "real" layout algorithms.',providerFactory:()=>new $s}],jS=!1;function eE(){let n=Ht.getInstance(),t=[];for(let e of ZS){let o=n.getAlgorithmData(e.id);if(o){t.push(o);continue}let r=new Se.Builder().id(e.id).name(e.name).description(e.description).definingBundleId("org.eclipse.elk.core").providerFactory(e.providerFactory).supportedFeatures(new Set).create();n.registerLayoutMetaDataProviders({apply(i){i.register(r)}}),t.push(r)}return jS=!0,t}var Da=class{constructor(t){this._includeLabels=!0,this._includePorts=!0,this._includePortLabels=!0,this._includeEdgeHeadTailLabels=!0,this._adapter=t}excludeLabels(){return this._includeLabels=!1,this}excludePorts(){return this._includePorts=!1,this}excludePortLabels(){return this._includePortLabels=!1,this}excludeEdgeHeadTailLabels(){return this._includeEdgeHeadTailLabels=!1,this}process(){let t=this._adapter.getProperty(Zs);for(let e of this._adapter.getNodes())this._processNode(e,t)}processNode(t){let e=this._adapter.getProperty(Zs);this._processNode(t,e)}_processNode(t,e){let o=new dt(t.getPosition().x,t.getPosition().y,t.getSize().x,t.getSize().y),r=new dt;if(this._includeLabels)for(let s of t.getLabels())r.x=s.getPosition().x+t.getPosition().x,r.y=s.getPosition().y+t.getPosition().y,r.width=s.getSize().x,r.height=s.getSize().y,o.union(r);for(let s of t.getPorts()){let a=s.getPosition().x+t.getPosition().x,l=s.getPosition().y+t.getPosition().y;if(this._includePorts&&(r.x=a,r.y=l,r.width=s.getSize().x,r.height=s.getSize().y,o.union(r)),this._includePortLabels)for(let c of s.getLabels())r.x=c.getPosition().x+a,r.y=c.getPosition().y+l,r.width=c.getSize().x,r.height=c.getSize().y,o.union(r);if(this._includeEdgeHeadTailLabels){let c=new O(-e,-e);if(t.getProperty(Ir).has(it.OUTSIDE))for(let g of s.getLabels())c.x+=g.getSize().x+e,c.y+=g.getSize().y+e;c.x=Math.max(c.x,0),c.y=Math.max(c.y,0),this._processEdgeHeadTailLabels(o,s.getOutgoingEdges(),s.getIncomingEdges(),t,s,c,e)}}this._includeEdgeHeadTailLabels&&this._processEdgeHeadTailLabels(o,t.getOutgoingEdges(),t.getIncomingEdges(),t,null,null,e);let i=new me(t.getMargin());i.top=Math.max(0,t.getPosition().y-o.y),i.bottom=Math.max(0,o.y+o.height-(t.getPosition().y+t.getSize().y)),i.left=Math.max(0,t.getPosition().x-o.x),i.right=Math.max(0,o.x+o.width-(t.getPosition().x+t.getSize().x)),t.setMargin(i)}_processEdgeHeadTailLabels(t,e,o,r,i,s,a){let l=new dt;for(let c of e)for(let g of c.getLabels())g.getProperty(Aa)===St.TAIL&&(this._computeLabelBox(l,g,!1,r,i,s,a),t.union(l));for(let c of o)for(let g of c.getLabels())g.getProperty(Aa)===St.HEAD&&(this._computeLabelBox(l,g,!0,r,i,s,a),t.union(l))}_computeLabelBox(t,e,o,r,i,s,a){if(t.x=r.getPosition().x,t.y=r.getPosition().y,i!=null&&(t.x+=i.getPosition().x,t.y+=i.getPosition().y),t.width=e.getSize().x,t.height=e.getSize().y,i==null)o?t.x-=a+e.getSize().x:t.x+=r.getSize().x+a;else switch(i.getSide()){case u.UNDEFINED:case u.EAST:t.x+=i.getSize().x+a+s.x+a;break;case u.WEST:t.x-=a+s.x+a+e.getSize().x;break;case u.NORTH:t.x+=i.getSize().x+a,t.y-=a+s.y+a+e.getSize().y;break;case u.SOUTH:t.x+=i.getSize().x+a,t.y+=i.getSize().y+a+s.y+a;break}}};var G=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};G.BEGIN=new G("BEGIN");G.CENTER=new G("CENTER");G.END=new G("END");var Si=class{constructor(){this._padding=new yt,this._cellRectangle=new dt,this._contributesToMinimumWidth=!1,this._contributesToMinimumHeight=!1}getPadding(){return this._padding}getCellRectangle(){return this._cellRectangle}isContributingToMinimumWidth(){return this._contributesToMinimumWidth}setContributesToMinimumWidth(t){this._contributesToMinimumWidth=t}isContributingToMinimumHeight(){return this._contributesToMinimumHeight}setContributesToMinimumHeight(t){this._contributesToMinimumHeight=t}getMinimumWidth(){throw new Error("getMinimumWidth() must be implemented by subclass")}getMinimumHeight(){throw new Error("getMinimumHeight() must be implemented by subclass")}};var ds=class extends Si{constructor(){super(),this._minimumContentAreaSize=new O}getMinimumContentAreaSize(){return this._minimumContentAreaSize}setMinimumContentAreaSize(t,e){if(e){let o=this.getPadding();this._minimumContentAreaSize.x=t.x-o.left-o.right,this._minimumContentAreaSize.y=t.y-o.top-o.bottom}else this._minimumContentAreaSize.set(t)}getMinimumWidth(){let t=this.getPadding();return this._minimumContentAreaSize.x+t.left+t.right}getMinimumHeight(){let t=this.getPadding();return this._minimumContentAreaSize.y+t.top+t.bottom}};var Ze=class extends Si{layoutChildrenHorizontally(){throw new Error("layoutChildrenHorizontally() must be implemented by subclass")}layoutChildrenVertically(){throw new Error("layoutChildrenVertically() must be implemented by subclass")}static minWidthOfCell(t,e){return t==null||e&&!t.isContributingToMinimumWidth()||t instanceof ds&&t.getMinimumContentAreaSize().x===0?0:t.getMinimumWidth()}static minHeightOfCell(t,e){return t==null||e&&!t.isContributingToMinimumHeight()||t instanceof ds&&t.getMinimumContentAreaSize().y===0?0:t.getMinimumHeight()}applyHorizontalLayout(t,e,o){if(t!=null){let r=t.getCellRectangle();r.x=e,r.width=o}}applyVerticalLayout(t,e,o){if(t!=null){let r=t.getCellRectangle();r.y=e,r.height=o}}};var ve=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};ve.VERTICAL=new ve("VERTICAL");ve.HORIZONTAL=new ve("HORIZONTAL");var oE=new Map([[G.BEGIN,0],[G.CENTER,1],[G.END,2]]),Rr=class extends Ze{constructor(t,e,o){super(),this._containerMode=t,this._symmetrical=e,this._gap=o,this._cells=[null,null,null]}getContainerMode(){return this._containerMode}getGap(){return this._gap}getCell(t){return this._cells[oE.get(t)]}setCell(t,e){this._cells[oE.get(t)]=e}getMinimumWidth(){let t=0,e=this.getPadding();if(this._containerMode===ve.VERTICAL)for(let o of this._cells)o!=null&&o.isContributingToMinimumWidth()&&(t=Math.max(t,o.getMinimumWidth()));else{let o=this._minCellWidths(!0),r=0;for(let i of o)i>0&&(t+=i,r++);r>1&&(t+=this._gap*(r-1))}return t>0?t+e.left+e.right:0}getMinimumHeight(){let t=0,e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=this._minCellHeights(!0),r=0;for(let i of o)i>0&&(t+=i,r++);r>1&&(t+=this._gap*(r-1))}else for(let o of this._cells)o!=null&&o.isContributingToMinimumHeight()&&(t=Math.max(t,o.getMinimumHeight()));return t>0?t+e.top+e.bottom:0}layoutChildrenHorizontally(){let t=this.getCellRectangle(),e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=t.x+e.left,r=t.width-e.left-e.right;for(let i of this._cells)this.applyHorizontalLayout(i,o,r)}else{let o=this._minCellWidths(!1);this.applyHorizontalLayout(this._cells[0],t.x+e.left,o[0]),this.applyHorizontalLayout(this._cells[2],t.x+t.width-e.right-o[2],o[2]);let r=t.width-e.left-e.right;o[0]>0&&(r-=o[0]+this._gap,o[0]+=this._gap),o[2]>0&&(r-=o[2]+this._gap),o[1]=Math.max(o[1],r),this.applyHorizontalLayout(this._cells[1],t.x+e.left+o[0]-(o[1]-r)/2,o[1])}for(let o of this._cells)o instanceof Ze&&o.layoutChildrenHorizontally()}layoutChildrenVertically(){let t=this.getCellRectangle(),e=this.getPadding();if(this._containerMode===ve.VERTICAL){let o=this._minCellHeights(!1);this.applyVerticalLayout(this._cells[0],t.y+e.top,o[0]),this.applyVerticalLayout(this._cells[2],t.y+t.height-e.bottom-o[2],o[2]);let i=t.height-e.top-e.bottom;o[0]>0&&(o[0]+=this._gap,i-=o[0]),o[2]>0&&(i-=o[2]+this._gap),o[1]=Math.max(o[1],i),this.applyVerticalLayout(this._cells[1],t.y+e.top+o[0]-(o[1]-i)/2,o[1])}else{let o=t.y+e.top,r=t.height-e.top-e.bottom;for(let i of this._cells)this.applyVerticalLayout(i,o,r)}for(let o of this._cells)o instanceof Ze&&o.layoutChildrenVertically()}_minCellWidths(t){let e=[Ze.minWidthOfCell(this._cells[0],t),Ze.minWidthOfCell(this._cells[1],t),Ze.minWidthOfCell(this._cells[2],t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}_minCellHeights(t){let e=[Ze.minHeightOfCell(this._cells[0],t),Ze.minHeightOfCell(this._cells[1],t),Ze.minHeightOfCell(this._cells[2],t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}};var bo=class n extends ge{constructor(t){if(super(),t){let e=t.getAllProperties(),o=this.getAllProperties();for(let[r,i]of e)o.set(r,i)}}static getIndividualOrInherited(t,e){let o=null;if(t.hasProperty(as)){let r=t.getProperty(as);r&&r.hasProperty(e)&&(o=r.getProperty(e))}if(o==null)if(typeof t.getGraph=="function"){let r=t.getGraph();r!=null&&(o=r.getProperty(e)),o==null&&typeof e.getDefault=="function"&&(o=e.getDefault())}else{let r=typeof t.getParent=="function"?t.getParent():t.parent;r!=null&&(o=r.getProperty(e))}return o}toString(){let t=[];for(let[e,o]of this.getAllProperties())t.push(`${e.getId()}:${o}`);return t.join(n.SERIALIZED_OPTION_SEPARATOR)}parse(t){if(!(t==null||t===""))try{let e=t.split(n.SERIALIZED_OPTION_SEPARATOR);for(let o of e){let r=o.indexOf(":");if(r<0)throw new Error(`Invalid option format: ${o}`);let i=o.substring(0,r),s=o.substring(r+1),a=Ht.getInstance().getOptionDataBySuffix(i);if(a==null)throw new Error(`Invalid option id: ${i}`);let l=a.parseValue(s);if(l==null)throw new Error(`Invalid option value: ${s}`);this.setProperty(a,l)}}catch(e){throw new Error("The given string does not match the expected format for individual spacings: "+(e&&e.message?e.message:String(e)))}}};bo.SERIALIZED_OPTION_SEPARATOR=";,;";var Du=class{constructor(t,e){this._sideComparator=t,this._valueComparator=e,this._byKey=new Map}put(t,e){let o=this._byKey.get(t);o==null&&(o=[],this._byKey.set(t,o)),o.push(e),o.sort(this._valueComparator)}get(t){var e;return(e=this._byKey.get(t))!=null?e:[]}containsKey(t){return this._byKey.has(t)}values(){let t=[...this._byKey.keys()].sort(this._sideComparator),e=[];for(let o of t)for(let r of this._byKey.get(o))e.push(r);return e}get size(){let t=0;for(let e of this._byKey.values())t+=e.length;return t}},qs=class n{constructor(t,e){if(this.node=e,this.nodeSize=new O(e.getSize()),this.topdownLayout=e.getProperty(js),this.treatAsCompoundNode=e.isCompoundNode()||e.getProperty(ls),this.sizeConstraints=e.getProperty(Mo),this.sizeOptions=e.getProperty(Oo),this.portConstraints=e.getProperty(cr),this.portLabelsPlacement=e.getProperty(Ir),!it.isValid(this.portLabelsPlacement))throw new Error(`Invalid port label placement: ${[...this.portLabelsPlacement]}`);if(this.portLabelsTreatAsGroup=e.getProperty(Su),this.nodeLabelPlacement=k.ensureSet(e.getProperty(Kr)),!k.isValid(this.nodeLabelPlacement))throw new Error(`Invalid node label placement: ${[...this.nodeLabelPlacement]}`);this.nodeLabelsPadding=bo.getIndividualOrInherited(e,pu),this.nodeLabelSpacing=bo.getIndividualOrInherited(e,Zs),this.labelLabelSpacing=bo.getIndividualOrInherited(e,hu),this.portPortSpacing=bo.getIndividualOrInherited(e,uu),this.portLabelSpacingHorizontal=bo.getIndividualOrInherited(e,du),this.portLabelSpacingVertical=bo.getIndividualOrInherited(e,fu),this.surroundingPortMargins=bo.getIndividualOrInherited(e,_u),this.labelCellSpacing=2*this.labelLabelSpacing;let o=!this.sizeOptions.has(Nt.ASYMMETRICAL);this.nodeContainer=new Rr(ve.VERTICAL,o,0),this.nodeContainerMiddleRow=new Rr(ve.HORIZONTAL,o,0),this.nodeContainer.setCell(G.CENTER,this.nodeContainerMiddleRow),this.portContexts=new Du(n.comparePortSides,n.comparePortContexts),this.insideNodeLabelContainer=null,this.insidePortLabelCells=new Map,this.outsideNodeLabelContainers=new Map,this.nodeLabelCells=new Map}applyNodeSize(){this.node.setSize(this.nodeSize)}getPortAlignment(t){let e=null,o=this.node;switch(t){case u.NORTH:o.hasProperty(xl)&&(e=o.getProperty(xl));break;case u.SOUTH:o.hasProperty(Dl)&&(e=o.getProperty(Dl));break;case u.EAST:o.hasProperty(Ml)&&(e=o.getProperty(Ml));break;case u.WEST:o.hasProperty(wl)&&(e=o.getProperty(wl));break}return e==null&&(e=o.getProperty(Eu)),e}static comparePortSides(t,e){return n._PORT_SIDE_ORDINAL.get(t)-n._PORT_SIDE_ORDINAL.get(e)}static comparePortContexts(t,e){let o=n.comparePortSides(t.port.getSide(),e.port.getSide());if(o!==0)return o;switch(t.port.getSide()){case u.NORTH:case u.EAST:return t.port.getVolatileId()-e.port.getVolatileId();case u.SOUTH:case u.WEST:return e.port.getVolatileId()-t.port.getVolatileId();default:return 0}}};qs._PORT_SIDE_ORDINAL=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);var lt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};lt.LEFT=new lt("LEFT");lt.CENTER=new lt("CENTER");lt.RIGHT=new lt("RIGHT");var nt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};nt.TOP=new nt("TOP");nt.CENTER=new nt("CENTER");nt.BOTTOM=new nt("BOTTOM");function $S(n,t){if(n===t)return!0;if(!(n instanceof Set)||!(t instanceof Set)||n.size!==t.size)return!1;for(let e of n)if(!t.has(e))return!1;return!0}var Q=class n{constructor(t,e,o,r,i,s){this.name=t,this._horizontalAlignment=e,this._verticalAlignment=o,this._containerRow=r,this._containerColumn=i,this._assignedPlacements=s,Object.freeze(this)}getHorizontalAlignment(){return this._horizontalAlignment}getVerticalAlignment(){return this._verticalAlignment}getContainerRow(){return this._containerRow}getContainerColumn(){return this._containerColumn}static fromNodeLabelPlacement(t){for(let e of n.values())for(let o of e._assignedPlacements)if($S(o,t))return e;return n.UNDEFINED}static values(){return n._VALUES}isInsideLocation(){switch(this){case n.IN_T_L:case n.IN_T_C:case n.IN_T_R:case n.IN_C_L:case n.IN_C_C:case n.IN_C_R:case n.IN_B_L:case n.IN_B_C:case n.IN_B_R:return!0;default:return!1}}getOutsideSide(){switch(this){case n.OUT_T_L:case n.OUT_T_C:case n.OUT_T_R:return u.NORTH;case n.OUT_B_L:case n.OUT_B_C:case n.OUT_B_R:return u.SOUTH;case n.OUT_L_T:case n.OUT_L_C:case n.OUT_L_B:return u.WEST;case n.OUT_R_T:case n.OUT_R_C:case n.OUT_R_B:return u.EAST;default:return u.UNDEFINED}}toString(){return this.name}},b=k,vt=(...n)=>new Set(n);Q.OUT_T_L=new Q("OUT_T_L",lt.LEFT,nt.BOTTOM,G.BEGIN,G.BEGIN,[vt(b.OUTSIDE,b.V_TOP,b.H_LEFT)]);Q.OUT_T_C=new Q("OUT_T_C",lt.CENTER,nt.BOTTOM,G.BEGIN,G.CENTER,[vt(b.OUTSIDE,b.V_TOP,b.H_CENTER),vt(b.OUTSIDE,b.V_TOP,b.H_CENTER,b.H_PRIORITY)]);Q.OUT_T_R=new Q("OUT_T_R",lt.RIGHT,nt.BOTTOM,G.BEGIN,G.END,[vt(b.OUTSIDE,b.V_TOP,b.H_RIGHT)]);Q.OUT_B_L=new Q("OUT_B_L",lt.LEFT,nt.TOP,G.END,G.BEGIN,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_LEFT)]);Q.OUT_B_C=new Q("OUT_B_C",lt.CENTER,nt.TOP,G.END,G.CENTER,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_CENTER),vt(b.OUTSIDE,b.V_BOTTOM,b.H_CENTER,b.H_PRIORITY)]);Q.OUT_B_R=new Q("OUT_B_R",lt.RIGHT,nt.TOP,G.END,G.END,[vt(b.OUTSIDE,b.V_BOTTOM,b.H_RIGHT)]);Q.OUT_L_T=new Q("OUT_L_T",lt.RIGHT,nt.TOP,G.BEGIN,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_TOP,b.H_PRIORITY)]);Q.OUT_L_C=new Q("OUT_L_C",lt.RIGHT,nt.CENTER,G.CENTER,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_CENTER),vt(b.OUTSIDE,b.H_LEFT,b.V_CENTER,b.H_PRIORITY)]);Q.OUT_L_B=new Q("OUT_L_B",lt.RIGHT,nt.BOTTOM,G.END,G.BEGIN,[vt(b.OUTSIDE,b.H_LEFT,b.V_BOTTOM,b.H_PRIORITY)]);Q.OUT_R_T=new Q("OUT_R_T",lt.LEFT,nt.TOP,G.BEGIN,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_TOP,b.H_PRIORITY)]);Q.OUT_R_C=new Q("OUT_R_C",lt.LEFT,nt.CENTER,G.CENTER,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_CENTER),vt(b.OUTSIDE,b.H_RIGHT,b.V_CENTER,b.H_PRIORITY)]);Q.OUT_R_B=new Q("OUT_R_B",lt.LEFT,nt.BOTTOM,G.END,G.END,[vt(b.OUTSIDE,b.H_RIGHT,b.V_BOTTOM,b.H_PRIORITY)]);Q.IN_T_L=new Q("IN_T_L",lt.LEFT,nt.TOP,G.BEGIN,G.BEGIN,[vt(b.INSIDE,b.V_TOP,b.H_LEFT),vt(b.INSIDE,b.V_TOP,b.H_LEFT,b.H_PRIORITY)]);Q.IN_T_C=new Q("IN_T_C",lt.CENTER,nt.TOP,G.BEGIN,G.CENTER,[vt(b.INSIDE,b.V_TOP,b.H_CENTER),vt(b.INSIDE,b.V_TOP,b.H_CENTER,b.H_PRIORITY)]);Q.IN_T_R=new Q("IN_T_R",lt.RIGHT,nt.TOP,G.BEGIN,G.END,[vt(b.INSIDE,b.V_TOP,b.H_RIGHT),vt(b.INSIDE,b.V_TOP,b.H_RIGHT,b.H_PRIORITY)]);Q.IN_C_L=new Q("IN_C_L",lt.LEFT,nt.CENTER,G.CENTER,G.BEGIN,[vt(b.INSIDE,b.V_CENTER,b.H_LEFT),vt(b.INSIDE,b.V_CENTER,b.H_LEFT,b.H_PRIORITY)]);Q.IN_C_C=new Q("IN_C_C",lt.CENTER,nt.CENTER,G.CENTER,G.CENTER,[vt(b.INSIDE,b.V_CENTER,b.H_CENTER),vt(b.INSIDE,b.V_CENTER,b.H_CENTER,b.H_PRIORITY)]);Q.IN_C_R=new Q("IN_C_R",lt.RIGHT,nt.CENTER,G.CENTER,G.END,[vt(b.INSIDE,b.V_CENTER,b.H_RIGHT),vt(b.INSIDE,b.V_CENTER,b.H_RIGHT,b.H_PRIORITY)]);Q.IN_B_L=new Q("IN_B_L",lt.LEFT,nt.BOTTOM,G.END,G.BEGIN,[vt(b.INSIDE,b.V_BOTTOM,b.H_LEFT),vt(b.INSIDE,b.V_BOTTOM,b.H_LEFT,b.H_PRIORITY)]);Q.IN_B_C=new Q("IN_B_C",lt.CENTER,nt.BOTTOM,G.END,G.CENTER,[vt(b.INSIDE,b.V_BOTTOM,b.H_CENTER),vt(b.INSIDE,b.V_BOTTOM,b.H_CENTER,b.H_PRIORITY)]);Q.IN_B_R=new Q("IN_B_R",lt.RIGHT,nt.BOTTOM,G.END,G.END,[vt(b.INSIDE,b.V_BOTTOM,b.H_RIGHT),vt(b.INSIDE,b.V_BOTTOM,b.H_RIGHT,b.H_PRIORITY)]);Q.UNDEFINED=new Q("UNDEFINED",null,null,null,null,[]);Q._VALUES=[Q.OUT_T_L,Q.OUT_T_C,Q.OUT_T_R,Q.OUT_B_L,Q.OUT_B_C,Q.OUT_B_R,Q.OUT_L_T,Q.OUT_L_C,Q.OUT_L_B,Q.OUT_R_T,Q.OUT_R_C,Q.OUT_R_B,Q.IN_T_L,Q.IN_T_C,Q.IN_T_R,Q.IN_C_L,Q.IN_C_C,Q.IN_C_R,Q.IN_B_L,Q.IN_B_C,Q.IN_B_R,Q.UNDEFINED];var wa=class{static configureCellSystemSizeContributions(t){if(t.sizeConstraints.size!==0){if(t.sizeConstraints.has(mt.PORTS)){t.insidePortLabelCells.get(u.NORTH).setContributesToMinimumWidth(!0),t.insidePortLabelCells.get(u.SOUTH).setContributesToMinimumWidth(!0);let e=t.portConstraints!==H.FIXED_RATIO&&t.portConstraints!==H.FIXED_POS;t.insidePortLabelCells.get(u.EAST).setContributesToMinimumHeight(e),t.insidePortLabelCells.get(u.WEST).setContributesToMinimumHeight(e),t.nodeContainerMiddleRow.setContributesToMinimumHeight(e),t.sizeConstraints.has(mt.PORT_LABELS)&&(t.insidePortLabelCells.get(u.NORTH).setContributesToMinimumHeight(!0),t.insidePortLabelCells.get(u.SOUTH).setContributesToMinimumHeight(!0),t.insidePortLabelCells.get(u.EAST).setContributesToMinimumWidth(!0),t.insidePortLabelCells.get(u.WEST).setContributesToMinimumWidth(!0),t.nodeContainerMiddleRow.setContributesToMinimumWidth(!0))}if(t.sizeConstraints.has(mt.NODE_LABELS)){t.insideNodeLabelContainer.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.setContributesToMinimumWidth(!0),t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.nodeContainerMiddleRow.setContributesToMinimumWidth(!0);let e=t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG);for(let o of Q.values()){let r=t.nodeLabelCells.get(o);r!=null&&(o.isInsideLocation()?(r.setContributesToMinimumHeight(!0),r.setContributesToMinimumWidth(!0)):(r.setContributesToMinimumHeight(!e),r.setContributesToMinimumWidth(!e)))}}t.sizeConstraints.has(mt.MINIMUM_SIZE)&&t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)&&(t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.nodeContainerMiddleRow.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.isContributingToMinimumHeight()||(t.insideNodeLabelContainer.setContributesToMinimumHeight(!0),t.insideNodeLabelContainer.setContributesToMinimumWidth(!0),t.insideNodeLabelContainer.setOnlyCenterCellContributesToMinimumSize(!0)))}}static updateVerticalInsidePortLabelCellPadding(t){if(t.portConstraints===H.FIXED_RATIO||t.portConstraints===H.FIXED_POS)return;let e=t.nodeContainer.getPadding().top+t.insidePortLabelCells.get(u.NORTH).getMinimumHeight()+t.labelCellSpacing,o=t.nodeContainer.getPadding().bottom+t.insidePortLabelCells.get(u.SOUTH).getMinimumHeight()+t.labelCellSpacing,r=t.insidePortLabelCells.get(u.EAST),i=t.insidePortLabelCells.get(u.WEST),s=Math.max(0,r.getPadding().top-e);s=Math.max(s,i.getPadding().top-e);let a=Math.max(0,r.getPadding().bottom-o);a=Math.max(a,i.getPadding().bottom-o),r.getPadding().top=s,i.getPadding().top=s,r.getPadding().bottom=a,i.getPadding().bottom=a}};var Lr=class n{static placeHorizontalPorts(t){switch(t.portConstraints){case H.FIXED_POS:n._placeHorizontalFixedPosPorts(t,u.NORTH),n._placeHorizontalFixedPosPorts(t,u.SOUTH);break;case H.FIXED_RATIO:n._placeHorizontalFixedRatioPorts(t,u.NORTH),n._placeHorizontalFixedRatioPorts(t,u.SOUTH);break;default:n._placeHorizontalFreePorts(t,u.NORTH),n._placeHorizontalFreePorts(t,u.SOUTH);break}}static _placeHorizontalFixedPosPorts(t,e){for(let o of t.portContexts.get(e))o.portPosition.y=n._calculateHorizontalPortYCoordinate(o)}static _placeHorizontalFixedRatioPorts(t,e){let o=t.nodeSize.x;for(let r of t.portContexts.get(e))r.portPosition.x=o*r.port.getProperty(n.PORT_RATIO_OR_POSITION),r.portPosition.y=n._calculateHorizontalPortYCoordinate(r)}static _placeHorizontalFreePorts(t,e){let o=t.portContexts.get(e);if(o.length===0)return;let r=t.insidePortLabelCells.get(e),i=r.getCellRectangle(),s=r.getPadding(),a=t.getPortAlignment(e),l=i.width-s.left-s.right,c=r.getMinimumContentAreaSize().x,g=i.x+s.left,h=t.portPortSpacing;if((a===Jt.DISTRIBUTED||a===Jt.JUSTIFIED)&&o.length===1&&(c=n._modifiedPortPlacementSize(t,a,c),a=Jt.CENTER),l<c&&!t.sizeOptions.has(Nt.PORTS_OVERHANG))a===Jt.DISTRIBUTED?(h+=(l-c)/(o.length+1),g+=h):h+=(l-c)/(o.length-1);else switch(l<c&&(c=n._modifiedPortPlacementSize(t,a,c),a=Jt.CENTER),a){case Jt.BEGIN:break;case Jt.CENTER:g+=(l-c)/2;break;case Jt.END:g+=l-c;break;case Jt.DISTRIBUTED:{let d=(l-c)/(o.length+1);h+=Math.max(0,d),g+=h;break}case Jt.JUSTIFIED:{let d=(l-c)/(o.length-1);h+=Math.max(0,d);break}}for(let d of o)d.portPosition.x=g+d.portMargin.left,d.portPosition.y=n._calculateHorizontalPortYCoordinate(d),g+=d.portMargin.left+d.port.getSize().x+d.portMargin.right+h}static _calculateHorizontalPortYCoordinate(t){let e=t.port;return e.hasProperty(Ke)?e.getSide()===u.NORTH?-e.getSize().y-e.getProperty(Ke):e.getProperty(Ke):e.getSide()===u.NORTH?-e.getSize().y:0}static placeVerticalPorts(t){switch(t.portConstraints){case H.FIXED_POS:n._placeVerticalFixedPosPorts(t,u.EAST),n._placeVerticalFixedPosPorts(t,u.WEST);break;case H.FIXED_RATIO:n._placeVerticalFixedRatioPorts(t,u.EAST),n._placeVerticalFixedRatioPorts(t,u.WEST);break;default:n._placeVerticalFreePorts(t,u.EAST),n._placeVerticalFreePorts(t,u.WEST);break}}static _placeVerticalFixedPosPorts(t,e){let o=t.nodeSize.x;for(let r of t.portContexts.get(e))r.portPosition.x=n._calculateVerticalPortXCoordinate(r,o)}static _placeVerticalFixedRatioPorts(t,e){let o=t.nodeSize;for(let r of t.portContexts.get(e))r.portPosition.x=n._calculateVerticalPortXCoordinate(r,o.x),r.portPosition.y=o.y*r.port.getProperty(n.PORT_RATIO_OR_POSITION)}static _placeVerticalFreePorts(t,e){let o=t.portContexts.get(e);if(o.length===0)return;let r=t.insidePortLabelCells.get(e),i=r.getCellRectangle(),s=r.getPadding(),a=t.getPortAlignment(e),l=i.height-s.top-s.bottom,c=r.getMinimumContentAreaSize().y,g=i.y+s.top,h=t.portPortSpacing,d=t.nodeSize.x;if((a===Jt.DISTRIBUTED||a===Jt.JUSTIFIED)&&o.length===1&&(c=n._modifiedPortPlacementSize(t,a,c),a=Jt.CENTER),l<c&&!t.sizeOptions.has(Nt.PORTS_OVERHANG))a===Jt.DISTRIBUTED?(h+=(l-c)/(o.length+1),g+=h):h+=(l-c)/(o.length-1);else switch(l<c&&(c=n._modifiedPortPlacementSize(t,a,c),a=Jt.CENTER),a){case Jt.BEGIN:break;case Jt.CENTER:g+=(l-c)/2;break;case Jt.END:g+=l-c;break;case Jt.DISTRIBUTED:{let f=(l-c)/(o.length+1);h+=Math.max(0,f),g+=h;break}case Jt.JUSTIFIED:{let f=(l-c)/(o.length-1);h+=Math.max(0,f);break}}for(let f of o)f.portPosition.x=n._calculateVerticalPortXCoordinate(f,d),f.portPosition.y=g+f.portMargin.top,g+=f.portMargin.top+f.port.getSize().y+f.portMargin.bottom+h}static _calculateVerticalPortXCoordinate(t,e){let o=t.port;return o.hasProperty(Ke)?o.getSide()===u.WEST?-o.getSize().x-o.getProperty(Ke):e+o.getProperty(Ke):o.getSide()===u.WEST?-o.getSize().x:e}static _modifiedPortPlacementSize(t,e,o){return e===Jt.DISTRIBUTED?o-2*t.portPortSpacing:o}};Lr.PORT_RATIO_OR_POSITION=new m("portRatioOrPosition",0);var qS=.01;function JS(n,t,e){return Math.abs(n-t)<e}var Ti=class n{static calculateHorizontalPortPlacementSize(t){switch(t.portConstraints){case H.FIXED_POS:n._calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,u.SOUTH);break;case H.FIXED_RATIO:n._calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,u.SOUTH);break;default:n._calculateHorizontalNodeSizeRequiredByFreePorts(t,u.NORTH),n._calculateHorizontalNodeSizeRequiredByFreePorts(t,u.SOUTH);break}}static _calculateHorizontalNodeSizeRequiredByFixedPosPorts(t,e){let o=0;for(let i of t.portContexts.get(e))o=Math.max(o,i.portPosition.x+i.port.getSize().x);let r=t.insidePortLabelCells.get(e);r.getPadding().left=0,r.getMinimumContentAreaSize().x=o}static _calculateHorizontalNodeSizeRequiredByFixedRatioPorts(t,e){let o=t.insidePortLabelCells.get(e),r=t.portContexts.get(e);if(r.length===0){o.getPadding().left=0,o.getPadding().right=0;return}let i=t.portLabelsPlacement.has(it.INSIDE),s=0,a=null,l=0,c=0;for(let g of r){let h=g.port.getProperty(Lr.PORT_RATIO_OR_POSITION),d=g.port.getSize().x;if(t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e),a==null)t.surroundingPortMargins!=null&&t.surroundingPortMargins.left>0&&(s=Math.max(s,n.minSizeRequiredToRespectSpacing(t.surroundingPortMargins.left+g.portMargin.left,0,h)));else{let f=c+a.portMargin.right+t.portPortSpacing+g.portMargin.left;s=Math.max(s,n.minSizeRequiredToRespectSpacing(f,l,h))}a=g,l=h,c=d}if(t.surroundingPortMargins!=null&&t.surroundingPortMargins.right>0){let g=c+t.surroundingPortMargins.right;i&&(g+=a.portMargin.right),s=Math.max(s,n.minSizeRequiredToRespectSpacing(g,l,1))}o.getPadding().left=0,o.getMinimumContentAreaSize().x=s}static minSizeRequiredToRespectSpacing(t,e,o){return JS(e,o,qS)?0:t/(o-e)}static _calculateHorizontalNodeSizeRequiredByFreePorts(t,e){let o=t.insidePortLabelCells.get(e);if(t.portContexts.get(e).length===0){o.getPadding().left=0,o.getPadding().right=0;return}o.getPadding().left=t.surroundingPortMargins.left,o.getPadding().right=t.surroundingPortMargins.right,t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let r=n._portWidthPlusPortPortSpacing(t,e);t.getPortAlignment(e)===Jt.DISTRIBUTED&&(r+=2*t.portPortSpacing),o.getMinimumContentAreaSize().x=r}static _setupPortMargins(t,e){let o=t.portContexts.get(e),r=t.portLabelsPlacement.has(it.OUTSIDE),i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE),a=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),l=t.sizeOptions.has(Nt.UNIFORM_PORT_SPACING),c=!i&&!s&&(a||o.length===2);n._computeHorizontalPortMargins(t,e,r);let g=null,h=null;r&&o.length>0&&(g=o[0],h=o[o.length-1],g.portMargin.left=0,h.portMargin.right=0,c&&!g.labelsNextToPort&&(g.portMargin.right=0)),l&&(n._unifyPortMargins(o),r&&g!=null&&(g.portMargin.left=0,h.portMargin.right=0))}static _computeHorizontalPortMargins(t,e,o){for(let r of t.portContexts.get(e)){let i=r.portLabelCell!=null?r.portLabelCell.getMinimumWidth():0;if(i>0)if(r.labelsNextToPort){let s=r.port.getSize().x;if(i>s){let a=(i-s)/2;r.portMargin.left=a,r.portMargin.right=a}}else r.portMargin.right=t.portLabelSpacingHorizontal+i;else if(it.isFixed(t.portLabelsPlacement)){let s=Ia(r.port);s.x<0&&(r.portMargin.left=-s.x),s.x+s.width>r.port.getSize().x&&(r.portMargin.right=s.x+s.width-r.port.getSize().x)}}}static _unifyPortMargins(t){let e=0,o=0;for(let r of t)e=Math.max(e,r.portMargin.left),o=Math.max(o,r.portMargin.right);for(let r of t)r.portMargin.left=e,r.portMargin.right=o}static _portWidthPlusPortPortSpacing(t,e){let o=0,r=t.portContexts.get(e);for(let i=0;i<r.length;i++){let s=r[i];o+=s.portMargin.left+s.port.getSize().x+s.portMargin.right,i<r.length-1&&(o+=t.portPortSpacing)}return o}};var Vl=class n{static createInsidePortLabelCells(t){n._createInsidePortLabelCell(t,t.nodeContainer,G.BEGIN,u.NORTH),n._createInsidePortLabelCell(t,t.nodeContainer,G.END,u.SOUTH),n._createInsidePortLabelCell(t,t.nodeContainerMiddleRow,G.BEGIN,u.WEST),n._createInsidePortLabelCell(t,t.nodeContainerMiddleRow,G.END,u.EAST),n._setupNorthOrSouthPortLabelCell(t,u.NORTH),n._setupNorthOrSouthPortLabelCell(t,u.SOUTH),n._setupEastOrWestPortLabelCell(t,u.EAST),n._setupEastOrWestPortLabelCell(t,u.WEST)}static _createInsidePortLabelCell(t,e,o,r){let i=new ds;e.setCell(o,i),t.insidePortLabelCells.set(r,i)}static _setupNorthOrSouthPortLabelCell(t,e){let o=t.insidePortLabelCells.get(e).getPadding();switch(e){case u.NORTH:t.portLabelSpacingVertical>=0&&(o.top=t.portLabelSpacingVertical);break;case u.SOUTH:t.portLabelSpacingVertical>=0&&(o.bottom=t.portLabelSpacingVertical);break}t.surroundingPortMargins!=null&&(o.left=t.surroundingPortMargins.left,o.right=t.surroundingPortMargins.right)}static _setupEastOrWestPortLabelCell(t,e){t.portLabelsPlacement.has(it.INSIDE)&&n._calculateWidthDueToLabels(t,e),n._setupTopAndBottomPadding(t,e)}static _calculateWidthDueToLabels(t,e){let o=t.insidePortLabelCells.get(e),r=o.getMinimumContentAreaSize();for(let i of t.portContexts.get(e))i.portLabelCell!=null&&(r.x=Math.max(r.x,i.portLabelCell.getMinimumWidth()));if(r.x>0)switch(e){case u.EAST:o.getPadding().right=t.portLabelSpacingHorizontal;break;case u.WEST:o.getPadding().left=t.portLabelSpacingHorizontal;break}}static _setupTopAndBottomPadding(t,e){if(t.surroundingPortMargins!=null){let o=t.insidePortLabelCells.get(e).getPadding();o.top=t.surroundingPortMargins.top,o.bottom=t.surroundingPortMargins.bottom}}};var Xl=class n{static placeLabels(t){n._placeOuterNodeLabelContainers(t);for(let e of t.nodeLabelCells.values())e.applyLabelLayout();for(let e of t.portContexts.values())e.portLabelCell!=null&&e.portLabelCell.applyLabelLayout()}static _placeOuterNodeLabelContainers(t){let e=t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG);n._placeHorizontalOuterNodeLabelContainer(t,e,u.NORTH),n._placeHorizontalOuterNodeLabelContainer(t,e,u.SOUTH),n._placeVerticalOuterNodeLabelContainer(t,e,u.EAST),n._placeVerticalOuterNodeLabelContainer(t,e,u.WEST)}static _placeHorizontalOuterNodeLabelContainer(t,e,o){let r=t.nodeSize,i=t.outsideNodeLabelContainers.get(o);if(i==null)return;let s=i.getCellRectangle();switch(s.width=i.getMinimumWidth(),s.height=i.getMinimumHeight(),s.width=Math.max(s.width,r.x),s.width>r.x&&!e&&(s.width=r.x),s.x=-(s.width-r.x)/2,o){case u.NORTH:s.y=-s.height;break;case u.SOUTH:s.y=r.y;break}i.layoutChildrenHorizontally(),i.layoutChildrenVertically()}static _placeVerticalOuterNodeLabelContainer(t,e,o){let r=t.nodeSize,i=t.outsideNodeLabelContainers.get(o);if(i==null)return;let s=i.getCellRectangle();switch(s.width=i.getMinimumWidth(),s.height=i.getMinimumHeight(),s.height=Math.max(s.height,r.y),s.height>r.y&&!e&&(s.height=r.y),s.y=-(s.height-r.y)/2,o){case u.WEST:s.x=-s.width;break;case u.EAST:s.x=r.x;break}i.layoutChildrenHorizontally(),i.layoutChildrenVertically()}};var fD=new Set([mt.PORT_LABELS]);function QS(n,t){return n.size===1&&n.has(t)}var fo=class n{static setupMinimumClientAreaSize(t){let e=n.getMinimumClientAreaSize(t);e!=null&&t.insideNodeLabelContainer.setCenterCellMinimumSize(e)}static setupNodePaddingForPortsWithOffset(t){let e=t.nodeContainer.getPadding();for(let o of t.portContexts.values()){let r=0;if(o.port.hasProperty(Ke)&&(r=o.port.getProperty(Ke),r<0))switch(o.port.getSide()){case u.NORTH:e.top=Math.max(e.top,-r);break;case u.SOUTH:e.bottom=Math.max(e.bottom,-r);break;case u.EAST:e.right=Math.max(e.right,-r);break;case u.WEST:e.left=Math.max(e.left,-r);break}if(it.isFixed(t.portLabelsPlacement)){let i=Hp(o.port,r),s=!t.node.getProperty(Oo).has(Nt.ASYMMETRICAL),a=!1;switch(o.port.getSide()){case u.NORTH:a=i>e.top,e.top=Math.max(e.top,i),s&&a&&(e.top=Math.max(e.top,e.bottom),e.bottom=e.top+r);break;case u.SOUTH:a=i>e.bottom,e.bottom=Math.max(e.bottom,i),s&&a&&(e.bottom=Math.max(e.bottom,e.top),e.top=e.bottom+r);break;case u.EAST:a=i>e.right,e.right=Math.max(e.right,i),s&&a&&(e.right=Math.max(e.left,e.right),e.left=e.right+r);break;case u.WEST:a=i>e.left,e.left=Math.max(e.left,i),s&&a&&(e.left=Math.max(e.left,e.right),e.right=e.left+r);break}}}}static offsetSouthernPortsByNodeSize(t){let e=t.nodeSize.y;for(let o of t.portContexts.get(u.SOUTH))o.portPosition.y+=e}static setNodePadding(t){if(!t.sizeOptions.has(Nt.COMPUTE_PADDING))return;let e=t.nodeContainer.getCellRectangle(),o=t.insideNodeLabelContainer.getCenterCellRectangle(),r=new yt;r.left=o.x-e.x,r.top=o.y-e.y,r.right=e.x+e.width-(o.x+o.width),r.bottom=e.y+e.height-(o.y+o.height),t.node.setPadding(r)}static applyStuff(t){t.applyNodeSize();for(let e of t.portContexts.values())e.applyPortPosition()}static getMinimumClientAreaSize(t){return t.sizeConstraints.has(mt.MINIMUM_SIZE)&&t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)?n.getMinimumNodeOrClientAreaSize(t):null}static getMinimumNodeSize(t){return t.sizeConstraints.has(mt.MINIMUM_SIZE)&&!t.sizeOptions.has(Nt.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING)?n.getMinimumNodeOrClientAreaSize(t):null}static getMinimumNodeOrClientAreaSize(t){let e=new O(t.node.getProperty(Yo));return t.sizeOptions.has(Nt.DEFAULT_MINIMUM_SIZE)&&(e.x<=0&&(e.x=es),e.y<=0&&(e.y=os)),e}static areSizeConstraintsFixed(t){return t.sizeConstraints.size===0||QS(t.sizeConstraints,mt.PORT_LABELS)}static isFirstOutsidePortLabelPlacedDifferently(t,e){let o=t.portContexts.get(e);if(o.length>=2){let r=o[0],i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.SPACE_EFFICIENT);return!r.labelsNextToPort&&!i&&(o.length===2||s)}return!1}};var rE=3,iE=3,jr=new Map([[G.BEGIN,0],[G.CENTER,1],[G.END,2]]),Kl=class extends Ze{constructor(t,e,o){super(),this._gap=o,this._tabular=t,this._symmetrical=e,this._cells=[[null,null,null],[null,null,null],[null,null,null]],this._centerCellMinimumSize=null,this._onlyCenterCellContributesToMinimumSize=!1,this._centerCellRect=new dt}getGap(){return this._gap}getCell(t,e){return this._cells[jr.get(t)][jr.get(e)]}setCell(t,e,o){this._cells[jr.get(t)][jr.get(e)]=o}setCenterCellMinimumSize(t){this._centerCellMinimumSize=new O(t)}setOnlyCenterCellContributesToMinimumSize(t){this._onlyCenterCellContributesToMinimumSize=t}getCenterCellRectangle(){return new dt(this._centerCellRect)}getMinimumWidth(){let t=0,e=this.getPadding();if(this._onlyCenterCellContributesToMinimumSize)this._centerCellMinimumSize!=null?t=this._centerCellMinimumSize.x:this._cells[1][1]!=null&&(t=this._cells[1][1].getMinimumWidth());else if(this._tabular)t=this._sumWithGaps(this._minColumnWidths(null,!0));else for(let o of[G.BEGIN,G.CENTER,G.END])t=Math.max(t,this._sumWithGaps(this._minColumnWidths(o,!0)));return t>0?t+e.left+e.right:0}getMinimumHeight(){let t=0,e=this.getPadding();return this._onlyCenterCellContributesToMinimumSize?this._centerCellMinimumSize!=null?t=this._centerCellMinimumSize.y:this._cells[1][1]!=null&&(t=this._cells[1][1].getMinimumHeight()):t=this._sumWithGaps(this._minRowHeights(!0)),t>0?t+e.top+e.bottom:0}layoutChildrenHorizontally(){if(this._tabular){let t=this._minColumnWidths(null,!1);for(let e of[G.BEGIN,G.CENTER,G.END])this._applyWidthsToRow(e,t)}else for(let t of[G.BEGIN,G.CENTER,G.END]){let e=this._minColumnWidths(t,!1);this._applyWidthsToRow(t,e)}}layoutChildrenVertically(){let t=this.getCellRectangle(),e=this.getPadding(),o=this._minRowHeights(!1);this._applyHeightToRow(G.BEGIN,t.y+e.top,o),this._applyHeightToRow(G.END,t.y+t.height-e.bottom-o[2],o);let r=t.height-e.top-e.bottom;o[0]>0&&(o[0]+=this._gap,r-=o[0]),o[2]>0&&(o[2]+=this._gap,r-=o[2]),this._centerCellRect.height=Math.max(0,r),this._centerCellRect.y=t.y+e.top+(this._centerCellRect.height-r)/2,o[1]=Math.max(o[1],r),this._applyHeightToRow(G.CENTER,t.y+e.top+o[0]-(o[1]-r)/2,o)}_minColumnWidths(t,e){let o=[this._minWidthOfColumn(G.BEGIN,t,e),this._minWidthOfColumn(G.CENTER,t,e),this._minWidthOfColumn(G.END,t,e)];return this._symmetrical&&(o[0]=Math.max(o[0],o[2]),o[2]=o[0]),o}_minWidthOfColumn(t,e,o){let r=0,i=jr.get(t);if(e==null)for(let s=0;s<rE;s++)r=Math.max(r,Ze.minWidthOfCell(this._cells[s][i],o));else r=Ze.minWidthOfCell(this._cells[jr.get(e)][i],o);return t===G.CENTER&&this._centerCellMinimumSize!=null&&(r=Math.max(r,this._centerCellMinimumSize.x)),r}_minRowHeights(t){let e=[this._minHeightOfRow(G.BEGIN,t),this._minHeightOfRow(G.CENTER,t),this._minHeightOfRow(G.END,t)];return this._symmetrical&&(e[0]=Math.max(e[0],e[2]),e[2]=e[0]),e}_minHeightOfRow(t,e){let o=0,r=jr.get(t);for(let i=0;i<iE;i++)o=Math.max(o,Ze.minHeightOfCell(this._cells[r][i],e));return t===G.CENTER&&this._centerCellMinimumSize!=null&&(o=Math.max(o,this._centerCellMinimumSize.y)),o}_sumWithGaps(t){let e=0,o=0;for(let r of t)r>0&&(e+=r,o++);return o>1&&(e+=this._gap*(o-1)),e}_applyWidthsToRow(t,e){let o=this.getCellRectangle(),r=this.getPadding();this._applyWidthToColumn(G.BEGIN,o.x+r.left,e),this._applyWidthToColumn(G.END,o.x+o.width-r.right-e[2],e);let i=o.width-r.left-r.right;e[0]>0&&(e[0]+=this._gap,i-=e[0]),e[2]>0&&(e[2]+=this._gap,i-=e[2]);let s=Math.max(0,i);e[1]=Math.max(e[1],i),this._applyWidthToColumn(G.CENTER,o.x+r.left+e[0]-(e[1]-i)/2,e),t===G.CENTER&&(this._centerCellRect.width=s,this._centerCellRect.x=o.x+r.left+(s-i)/2)}_applyWidthToColumn(t,e,o){let r=jr.get(t);for(let i=0;i<rE;i++)this.applyHorizontalLayout(this._cells[i][r],e,o[r])}_applyHeightToRow(t,e,o){let r=jr.get(t);for(let i=0;i<iE;i++)this.applyVerticalLayout(this._cells[r][i],e,o[r])}};var Ni=class extends Si{constructor(t,e,o){super(),this._gap=t;let r=!0,i=lt.CENTER,s=nt.CENTER;e==null||(typeof e=="boolean"?r=e:(i=e.getHorizontalAlignment(),s=e.getVerticalAlignment(),o!=null&&(r=o))),this._horizontalLayoutMode=r,this._horizontalAlignment=i,this._verticalAlignment=s,this._labels=[],this._minimumContentAreaSize=new O}getHorizontalAlignment(){return this._horizontalAlignment}setHorizontalAlignment(t){if(t==null)throw new Error("Horizontal alignment cannot be null");return this._horizontalAlignment=t,this}getVerticalAlignment(){return this._verticalAlignment}setVerticalAlignment(t){if(t==null)throw new Error("Vertical alignment cannot be null");return this._verticalAlignment=t,this}getLabels(){return this._labels}getMinimumWidth(){let t=this.getPadding();return this._minimumContentAreaSize.x+t.left+t.right}getMinimumHeight(){let t=this.getPadding();return this._minimumContentAreaSize.y+t.top+t.bottom}addLabel(t){this._labels.push(t);let e=t.getSize();this._horizontalLayoutMode?(this._minimumContentAreaSize.x=Math.max(this._minimumContentAreaSize.x,e.x),this._minimumContentAreaSize.y+=e.y,this._labels.length>1&&(this._minimumContentAreaSize.y+=this._gap)):(this._minimumContentAreaSize.x+=e.x,this._minimumContentAreaSize.y=Math.max(this._minimumContentAreaSize.y,e.y),this._labels.length>1&&(this._minimumContentAreaSize.x+=this._gap))}hasLabels(){return this._labels.length>0}applyLabelLayout(){this._horizontalLayoutMode?this._applyHorizontalModeLabelLayout():this._applyVerticalModeLabelLayout()}_applyHorizontalModeLabelLayout(){let t=this.getCellRectangle(),e=this.getPadding(),o=t.y;this._verticalAlignment===nt.CENTER?o+=(t.height-this._minimumContentAreaSize.y)/2:this._verticalAlignment===nt.BOTTOM&&(o+=t.height-this._minimumContentAreaSize.y);for(let r of this._labels){let i=r.getSize(),s=new O;switch(s.y=o,o+=i.y+this._gap,this._horizontalAlignment){case lt.LEFT:s.x=t.x+e.left;break;case lt.CENTER:s.x=t.x+e.left+(t.width-i.x)/2;break;case lt.RIGHT:s.x=t.x+t.width-e.right-i.x;break}r.setPosition(s)}}_applyVerticalModeLabelLayout(){let t=this.getCellRectangle(),e=this.getPadding(),o=t.x;this._horizontalAlignment===lt.CENTER?o+=(t.width-this._minimumContentAreaSize.x)/2:this._horizontalAlignment===lt.RIGHT&&(o+=t.width-this._minimumContentAreaSize.x);for(let r of this._labels){let i=r.getSize(),s=new O;switch(s.x=o,o+=i.x+this._gap,this._verticalAlignment){case nt.TOP:s.y=t.y+e.top;break;case nt.CENTER:s.y=t.y+e.top+(t.height-i.y)/2;break;case nt.BOTTOM:s.y=t.y+t.height-e.bottom-i.y;break}r.setPosition(s)}}};var Ma=class n{static createNodeLabelCells(t,e,o){n._createNodeLabelCellContainers(t,e);for(let r of t.node.getLabels())n._handleNodeLabel(t,r,e,o)}static _handleNodeLabel(t,e,o,r){let i=e.hasProperty(Kr)?e.getProperty(Kr):t.nodeLabelPlacement,s=i instanceof Set?i:k.ensureSet(i),a=Q.fromNodeLabelPlacement(s);a!==Q.UNDEFINED&&(o&&!a.isInsideLocation()||n._retrieveNodeLabelCell(t,a,r).addLabel(e))}static _createNodeLabelCellContainers(t,e){let o=!t.sizeOptions.has(Nt.ASYMMETRICAL),r=t.sizeOptions.has(Nt.FORCE_TABULAR_NODE_LABELS);if(t.insideNodeLabelContainer=new Kl(r,o,t.labelCellSpacing),t.nodeLabelsPadding!=null&&t.insideNodeLabelContainer.getPadding().copy(t.nodeLabelsPadding),t.nodeContainerMiddleRow.setCell(G.CENTER,t.insideNodeLabelContainer),!e){let i=new Rr(ve.HORIZONTAL,o,t.labelCellSpacing);i.getPadding().bottom=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.NORTH,i);let s=new Rr(ve.HORIZONTAL,o,t.labelCellSpacing);s.getPadding().top=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.SOUTH,s);let a=new Rr(ve.VERTICAL,o,t.labelCellSpacing);a.getPadding().right=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.WEST,a);let l=new Rr(ve.VERTICAL,o,t.labelCellSpacing);l.getPadding().left=t.nodeLabelSpacing,t.outsideNodeLabelContainers.set(u.EAST,l)}}static _retrieveNodeLabelCell(t,e,o){let r=t.nodeLabelCells.get(e);if(r==null)if(r=new Ni(t.labelLabelSpacing,e,o),t.nodeLabelCells.set(e,r),e.isInsideLocation())t.insideNodeLabelContainer.setCell(e.getContainerRow(),e.getContainerColumn(),r);else{let i=e.getOutsideSide(),s=t.outsideNodeLabelContainers.get(i);switch(i){case u.NORTH:case u.SOUTH:r.setContributesToMinimumHeight(!0),s.setCell(e.getContainerColumn(),r);break;case u.WEST:case u.EAST:r.setContributesToMinimumWidth(!0),s.setCell(e.getContainerRow(),r);break}}return r}};var ba=class{static setNodeWidth(t){let e=t.nodeSize,o;if(fo.areSizeConstraintsFixed(t))o=e.x;else{if(t.topdownLayout?o=Math.max(e.x,t.nodeContainer.getMinimumWidth()):o=t.nodeContainer.getMinimumWidth(),t.sizeConstraints.has(mt.NODE_LABELS)&&!t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG)){let s=t.outsideNodeLabelContainers.get(u.NORTH),a=t.outsideNodeLabelContainers.get(u.SOUTH);s!=null&&(o=Math.max(o,s.getMinimumWidth())),a!=null&&(o=Math.max(o,a.getMinimumWidth()))}let i=fo.getMinimumNodeSize(t);i!=null&&(o=Math.max(o,i.x))}t.node.getGraph().getProperty(To)?e.x=Math.max(e.x,o):e.x=o;let r=t.nodeContainer.getCellRectangle();r.x=0,r.width=o,t.nodeContainer.layoutChildrenHorizontally()}static setNodeHeight(t){let e=t.nodeSize,o;if(fo.areSizeConstraintsFixed(t))o=e.y;else{if(t.topdownLayout?o=Math.max(e.y,t.nodeContainer.getMinimumHeight()):o=t.nodeContainer.getMinimumHeight(),t.sizeConstraints.has(mt.NODE_LABELS)&&!t.sizeOptions.has(Nt.OUTSIDE_NODE_LABELS_OVERHANG)){let s=t.outsideNodeLabelContainers.get(u.EAST),a=t.outsideNodeLabelContainers.get(u.WEST);s!=null&&(o=Math.max(o,s.getMinimumHeight())),a!=null&&(o=Math.max(o,a.getMinimumHeight()))}let i=fo.getMinimumNodeSize(t);if(i!=null&&(o=Math.max(o,i.y)),t.sizeConstraints.has(mt.PORTS)&&(t.portConstraints===H.FIXED_RATIO||t.portConstraints===H.FIXED_POS)){let s=t.insidePortLabelCells.get(u.EAST),a=t.insidePortLabelCells.get(u.WEST);s!=null&&(o=Math.max(o,s.getMinimumHeight())),a!=null&&(o=Math.max(o,a.getMinimumHeight()))}}t.node.getGraph().getProperty(To)?e.y=Math.max(e.y,o):e.y=o;let r=t.nodeContainer.getCellRectangle();r.y=0,r.height=o,t.nodeContainer.layoutChildrenVertically()}};var Zl=class{constructor(t,e){this.parentNodeContext=t,this.port=e,this.portPosition=new O(e.getPosition()),this.portMargin=new me,this.portLabelCell=null;let o=t.portLabelsPlacement,r=o.has(it.NEXT_TO_PORT_IF_POSSIBLE);o.has(it.INSIDE)?t.treatAsCompoundNode?this.labelsNextToPort=r&&!e.hasCompoundConnections():this.labelsNextToPort=!0:o.has(it.OUTSIDE)?r?this.labelsNextToPort=!tT(e):this.labelsNextToPort=!1:this.labelsNextToPort=!1}applyPortPosition(){this.port.setPosition(this.portPosition)}};function tT(n){for(let t of n.getIncomingEdges())return!0;for(let t of n.getOutgoingEdges())return!0;return!1}var jl=class n{static createPortContexts(t,e){let o=!e||!t.portLabelsPlacement.has(it.INSIDE),r=0;for(let i of t.node.getPorts()){if(i.getSide()===u.UNDEFINED)throw new Error("Label and node size calculator can only be used with ports that have port sides assigned.");i.setVolatileId(r++),n._createPortContext(t,i,o)}}static _createPortContext(t,e,o){let r=new Zl(t,e);if(t.portContexts.put(e.getSide(),r),o&&!it.isFixed(t.portLabelsPlacement)){r.portLabelCell=new Ni(t.labelLabelSpacing);for(let i of e.getLabels())r.portLabelCell.addLabel(i)}}};var $l=class n{removeOverlaps(t){let e=t.getVerticalGap(),o=new Set,r=0;for(let i of t.getRectangleNodes()){let s=0;i.getOverlappingNodes().sort(n.compareByYCoordinate);for(let a of i.getOverlappingNodes())if(o.has(a)){let l=i.getRectangle(),c=a.getRectangle();s<c.y+c.height+e&&s+l.height+e>c.y&&(s=c.y+c.height+e)}i.getRectangle().y=s,o.add(i),r=Math.max(r,i.getRectangle().y+i.getRectangle().height)}return r}static compareByYCoordinate(t,e){return t.getRectangle().y-e.getRectangle().y}};var sE=5,Qt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Qt.UP=new Qt("UP");Qt.DOWN=new Qt("DOWN");Qt.LEFT=new Qt("LEFT");Qt.RIGHT=new Qt("RIGHT");var wu=class{constructor(t,e){this._originalRectangle=t,this._rectangle=e,this._overlappingNodes=[]}getRectangle(){return this._rectangle}getOverlappingNodes(){return this._overlappingNodes}get originalRectangle(){return this._originalRectangle}get rectangle(){return this._rectangle}get overlappingNodes(){return this._overlappingNodes}},fs=class n{constructor(){this._overlapRemovalDirection=null,this._gapVertical=sE,this._gapHorizontal=sE,this._startCoordinate=0,this._overlapRemovalStrategy=null,this._rectangleNodes=[]}static createForDirection(t){let e=new n;return e._overlapRemovalDirection=t,e}withGap(t,e){return this._gapHorizontal=t,this._gapVertical=e,this}withStartCoordinate(t){return this._startCoordinate=t,this}withOverlapRemovalStrategy(t){return this._overlapRemovalStrategy=t,this}addRectangle(t){return this._rectangleNodes.push(new wu(t,this._importRectangle(t))),this}getHorizontalGap(){return this._gapHorizontal}getVerticalGap(){return this._gapVertical}getRectangleNodes(){return this._rectangleNodes}_importRectangle(t){switch(this._overlapRemovalDirection){case Qt.UP:case Qt.DOWN:return t;case Qt.LEFT:case Qt.RIGHT:return new dt(t.y,0,t.height,t.width);default:return null}}_exportRectangle(t,e){let o=t.rectangle,r=t.originalRectangle;switch(this._overlapRemovalDirection){case Qt.UP:r.y=this._startCoordinate-o.height-o.y;break;case Qt.DOWN:r.y+=this._startCoordinate;break;case Qt.LEFT:r.x=this._startCoordinate-o.height-o.y;break;case Qt.RIGHT:r.x=this._startCoordinate+o.y;break}}removeOverlaps(){this._overlapRemovalStrategy==null&&(this._overlapRemovalStrategy=new $l),this._rectangleNodes.sort(n._compareLeftRectangleBorders),this._computeOverlaps();let t=this._overlapRemovalStrategy.removeOverlaps(this);for(let e of this._rectangleNodes)this._exportRectangle(e,t);return t}_computeOverlaps(){let t=[];for(let e of this._rectangleNodes){let o=e.rectangle.x;for(;t.length>0;){let s=t[0];if(s.rectangle.x+s.rectangle.width<o)t.shift();else break}for(let s of t)s.overlappingNodes.push(e),e.overlappingNodes.push(s);let r=e.rectangle.x+e.rectangle.width,i=0;for(;i<t.length;){let s=t[i];if(s.rectangle.x+s.rectangle.width>r)break;i++}t.splice(i,0,e)}}static _compareLeftRectangleBorders(t,e){return t.rectangle.x-e.rectangle.x}static _compareRightRectangleBorders(t,e){return t.rectangle.x+t.rectangle.width-(e.rectangle.x+e.rectangle.width)}};var Ga=class n{static placeHorizontalPortLabels(t){n._placePortLabels(t,u.NORTH),n._placePortLabels(t,u.SOUTH)}static placeVerticalPortLabels(t){n._placePortLabels(t,u.EAST),n._placePortLabels(t,u.WEST)}static _placePortLabels(t,e){let o=!t.sizeConstraints.has(mt.PORT_LABELS)||t.portConstraints===H.FIXED_POS;t.portLabelsPlacement.has(it.INSIDE)?o?n._constrainedInsidePortLabelPlacement(t,e):n._simpleInsidePortLabelPlacement(t,e):t.portLabelsPlacement.has(it.OUTSIDE)&&(o?n._constrainedOutsidePortLabelPlacement(t,e):n._simpleOutsidePortLabelPlacement(t,e))}static _simpleInsidePortLabelPlacement(t,e){let o=0,r=n._portLabelBorderOffsetForPortSide(t,e),i=t.portLabelSpacingHorizontal,s=t.portLabelSpacingVertical;for(let a of t.portContexts.get(e)){if(a.portLabelCell==null||!a.portLabelCell.hasLabels())continue;let l=a.port.getSize(),c=a.port.hasProperty(Ke)?a.port.getProperty(Ke):0,g=a.portLabelCell,h=g.getCellRectangle();switch(h.width=g.getMinimumWidth(),h.height=g.getMinimumHeight(),e){case u.NORTH:h.x=a.labelsNextToPort?(l.x-h.width)/2:l.x+i,h.y=l.y+c+r,g.setHorizontalAlignment(lt.CENTER),g.setVerticalAlignment(nt.TOP);break;case u.SOUTH:h.x=a.labelsNextToPort?(l.x-h.width)/2:l.x+i,h.y=-c-r-h.height,g.setHorizontalAlignment(lt.CENTER),g.setVerticalAlignment(nt.BOTTOM);break;case u.EAST:{if(h.x=-c-r-h.width,a.labelsNextToPort){let d=t.portLabelsTreatAsGroup?h.height:g.getLabels()[0].getSize().y;h.y=(l.y-d)/2}else h.y=l.y+s;g.setHorizontalAlignment(lt.RIGHT),g.setVerticalAlignment(nt.CENTER);break}case u.WEST:{if(h.x=l.x+c+r,a.labelsNextToPort){let d=t.portLabelsTreatAsGroup?h.height:g.getLabels()[0].getSize().y;h.y=(l.y-d)/2}else h.y=l.y+s;g.setHorizontalAlignment(lt.LEFT),g.setVerticalAlignment(nt.CENTER);break}}(e===u.NORTH||e===u.SOUTH)&&(o=Math.max(o,h.height))}o>0&&(t.insidePortLabelCells.get(e).getMinimumContentAreaSize().y=o)}static _portLabelBorderOffsetForPortSide(t,e){switch(e){case u.NORTH:return t.nodeContainer.getPadding().top+t.portLabelSpacingVertical;case u.SOUTH:return t.nodeContainer.getPadding().bottom+t.portLabelSpacingVertical;case u.EAST:return t.nodeContainer.getPadding().right+t.portLabelSpacingHorizontal;case u.WEST:return t.nodeContainer.getPadding().left+t.portLabelSpacingHorizontal;default:return 0}}static _constrainedInsidePortLabelPlacement(t,e){let o=t.portContexts.get(e);if(e===u.EAST||e===u.WEST){n._simpleInsidePortLabelPlacement(t,e);return}let r=e===u.NORTH?Qt.DOWN:Qt.UP,i=e===u.NORTH?nt.TOP:nt.BOTTOM,s=t.insidePortLabelCells.get(e),a=s.getCellRectangle(),l=a.x+Math.max(s.getPadding().left,t.surroundingPortMargins.left,t.nodeLabelSpacing),c=a.x+a.width-Math.max(s.getPadding().right,t.surroundingPortMargins.right,t.nodeLabelSpacing),g=fs.createForDirection(r).withGap(t.portLabelSpacingHorizontal,t.portLabelSpacingVertical),h=e===u.NORTH?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;for(let f of o){if(f.portLabelCell==null||!f.portLabelCell.hasLabels())continue;let E=f.port.getSize(),P=f.portPosition,S=f.portLabelCell,T=S.getCellRectangle();T.width=S.getMinimumWidth(),T.height=S.getMinimumHeight(),S.setVerticalAlignment(i),S.setHorizontalAlignment(lt.RIGHT),n._centerPortLabel(T,P,E,l,c),g.addRectangle(T),h=e===u.NORTH?Math.max(h,P.y+f.port.getSize().y):Math.min(h,P.y)}h+=e===u.NORTH?t.portLabelSpacingVertical:-t.portLabelSpacingVertical;let d=g.withStartCoordinate(h).removeOverlaps();d>0&&(t.insidePortLabelCells.get(e).getMinimumContentAreaSize().y=d);for(let f of o){if(f.portLabelCell==null||!f.portLabelCell.hasLabels())continue;let E=f.portLabelCell.getCellRectangle();E.x-=f.portPosition.x,E.y-=f.portPosition.y}}static _centerPortLabel(t,e,o,r,i){t.x=e.x-(t.width-o.x)/2;let s=Math.min(r,e.x),a=Math.max(i,e.x+o.x);t.x<s?t.x=s:t.x+t.width>a&&(t.x=a-t.width)}static _simpleOutsidePortLabelPlacement(t,e){let o=t.portContexts.get(e),r=fo.isFirstOutsidePortLabelPlacedDifferently(t,e),i=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE);for(let s of o){if(s.portLabelCell==null||!s.portLabelCell.hasLabels())continue;let a=s.port.getSize(),l=s.portLabelCell,c=l.getCellRectangle();switch(c.width=l.getMinimumWidth(),c.height=l.getMinimumHeight(),e){case u.NORTH:s.labelsNextToPort?(c.x=(a.x-c.width)/2,l.setHorizontalAlignment(lt.CENTER)):r||i?(c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT)):(c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT)),c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM);break;case u.SOUTH:s.labelsNextToPort?(c.x=(a.x-c.width)/2,l.setHorizontalAlignment(lt.CENTER)):r||i?(c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT)):(c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT)),c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP);break;case u.EAST:{if(s.labelsNextToPort){let g=t.portLabelsTreatAsGroup?c.height:l.getLabels()[0].getSize().y;c.y=(a.y-g)/2,l.setVerticalAlignment(nt.CENTER)}else r||i?(c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM)):(c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP));c.x=a.x+t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.LEFT);break}case u.WEST:{if(s.labelsNextToPort){let g=t.portLabelsTreatAsGroup?c.height:l.getLabels()[0].getSize().y;c.y=(a.y-g)/2,l.setVerticalAlignment(nt.CENTER)}else r||i?(c.y=-c.height-t.portLabelSpacingVertical,l.setVerticalAlignment(nt.BOTTOM)):(c.y=a.y+t.portLabelSpacingVertical,l.setVerticalAlignment(nt.TOP));c.x=-c.width-t.portLabelSpacingHorizontal,l.setHorizontalAlignment(lt.RIGHT);break}}r=!1}}static _constrainedOutsidePortLabelPlacement(t,e){let o=t.portContexts.get(e);if(o.length<=2||e===u.EAST||e===u.WEST){n._simpleOutsidePortLabelPlacement(t,e);return}let r=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),i=e===u.NORTH?Qt.UP:Qt.DOWN,s=e===u.NORTH?nt.BOTTOM:nt.TOP,a=fs.createForDirection(i).withGap(t.portLabelSpacingVertical,t.portLabelSpacingHorizontal),l=e===u.NORTH?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;for(let c of o){if(c.portLabelCell==null||!c.portLabelCell.hasLabels())continue;let g=c.port.getSize(),h=c.portPosition,d=c.portLabelCell,f=d.getCellRectangle();f.width=d.getMinimumWidth(),f.height=d.getMinimumHeight(),r?(f.x=h.x-d.getMinimumWidth()-t.portLabelSpacingHorizontal,r=!1):f.x=h.x+g.x+t.portLabelSpacingHorizontal,d.setVerticalAlignment(s),d.setHorizontalAlignment(lt.RIGHT),a.addRectangle(f),l=e===u.NORTH?Math.min(l,h.y):Math.max(l,h.y+c.port.getSize().y)}l+=e===u.NORTH?-t.portLabelSpacingVertical:t.portLabelSpacingVertical,a.withStartCoordinate(l).removeOverlaps();for(let c of o){if(c.portLabelCell==null||!c.portLabelCell.hasLabels())continue;let g=c.portLabelCell.getCellRectangle();g.x-=c.portPosition.x,g.y-=c.portPosition.y}}};var ql=class n{static calculateVerticalPortPlacementSize(t){switch(t.portConstraints){case H.FIXED_POS:n._calculateVerticalNodeSizeRequiredByFixedPosPorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFixedPosPorts(t,u.WEST);break;case H.FIXED_RATIO:n._calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,u.WEST);break;default:n._calculateVerticalNodeSizeRequiredByFreePorts(t,u.EAST),n._calculateVerticalNodeSizeRequiredByFreePorts(t,u.WEST);break}}static _calculateVerticalNodeSizeRequiredByFixedPosPorts(t,e){let o=0;for(let i of t.portContexts.get(e))o=Math.max(o,i.portPosition.y+i.port.getSize().y);let r=t.insidePortLabelCells.get(e);r.getPadding().top=0,r.getMinimumContentAreaSize().y=o}static _calculateVerticalNodeSizeRequiredByFixedRatioPorts(t,e){let o=t.insidePortLabelCells.get(e),r=t.portContexts.get(e);if(r.length===0){o.getPadding().top=0,o.getPadding().bottom=0;return}let i=t.portLabelsPlacement.has(it.INSIDE),s=0;t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let a=null,l=0,c=0;for(let g of r){let h=g.port.getProperty(Lr.PORT_RATIO_OR_POSITION),d=g.port.getSize().y;if(a==null)t.surroundingPortMargins!=null&&t.surroundingPortMargins.top>0&&(s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(t.surroundingPortMargins.top+g.portMargin.top,0,h)));else{let f=c+a.portMargin.bottom+t.portPortSpacing+g.portMargin.top;s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(f,l,h))}a=g,l=h,c=d}if(t.surroundingPortMargins!=null&&t.surroundingPortMargins.bottom>0){let g=c+t.surroundingPortMargins.bottom;i&&(g+=a.portMargin.bottom),s=Math.max(s,Ti.minSizeRequiredToRespectSpacing(g,l,1))}o.getPadding().top=0,o.getMinimumContentAreaSize().y=s}static _calculateVerticalNodeSizeRequiredByFreePorts(t,e){let o=t.insidePortLabelCells.get(e);if(t.portContexts.get(e).length===0){o.getPadding().top=0,o.getPadding().bottom=0;return}o.getPadding().top=t.surroundingPortMargins.top,o.getPadding().bottom=t.surroundingPortMargins.bottom,t.sizeConstraints.has(mt.PORT_LABELS)&&n._setupPortMargins(t,e);let r=n._portHeightPlusPortPortSpacing(t,e);t.getPortAlignment(e)===Jt.DISTRIBUTED&&(r+=2*t.portPortSpacing),o.getMinimumContentAreaSize().y=r}static _setupPortMargins(t,e){let o=t.portContexts.get(e),r=t.portLabelsPlacement.has(it.OUTSIDE),i=t.portLabelsPlacement.has(it.ALWAYS_SAME_SIDE),s=t.portLabelsPlacement.has(it.ALWAYS_OTHER_SAME_SIDE),a=t.portLabelsPlacement.has(it.SPACE_EFFICIENT),l=t.sizeOptions.has(Nt.UNIFORM_PORT_SPACING),c=!i&&!s&&(a||o.length===2);n._computeVerticalPortMargins(t,e,r);let g=null,h=null;r&&o.length>0&&(g=o[0],h=o[o.length-1],g.portMargin.top=0,h.portMargin.bottom=0,c&&!g.labelsNextToPort&&(g.portMargin.bottom=0)),l&&(n._unifyPortMargins(o),r&&g!=null&&(g.portMargin.top=0,h.portMargin.bottom=0))}static _computeVerticalPortMargins(t,e,o){for(let r of t.portContexts.get(e)){let i=r.portLabelCell!=null?r.portLabelCell.getMinimumHeight():0;if(i>0)if(r.labelsNextToPort){let s=r.port.getSize().y;if(i>s)if(t.portLabelsTreatAsGroup||r.portLabelCell.getLabels().length===1){let a=(i-s)/2;r.portMargin.top=a,r.portMargin.bottom=a}else{let l=(r.portLabelCell.getLabels()[0].getSize().y-s)/2;r.portMargin.top=Math.max(0,l),r.portMargin.bottom=i-l-s}}else r.portMargin.bottom=t.portLabelSpacingVertical+i;else if(it.isFixed(t.portLabelsPlacement)){let s=Ia(r.port);s.y<0&&(r.portMargin.top=-s.y),s.y+s.height>r.port.getSize().y&&(r.portMargin.bottom=s.y+s.height-r.port.getSize().y)}}}static _unifyPortMargins(t){let e=0,o=0;for(let r of t)e=Math.max(e,r.portMargin.top),o=Math.max(o,r.portMargin.bottom);for(let r of t)r.portMargin.top=e,r.portMargin.bottom=o}static _portHeightPlusPortPortSpacing(t,e){let o=0,r=t.portContexts.get(e);for(let i=0;i<r.length;i++){let s=r[i];o+=s.portMargin.top+s.port.getSize().y+s.portMargin.bottom,i<r.length-1&&(o+=t.portPortSpacing)}return o}};var us=class n{static process(t,e,o=!0,r=!1){if(e==null){for(let a of t.getNodes())n.process(t,a,!0,!1);return}let i=new qs(t,e);jl.createPortContexts(i,r);let s=!0;if(t!=null&&t.hasProperty(lr)){let a=t.getProperty(lr);s=a===R.UNDEFINED||a.isHorizontal()}return Ma.createNodeLabelCells(i,!1,s),Vl.createInsidePortLabelCells(i),fo.setupMinimumClientAreaSize(i),fo.setupNodePaddingForPortsWithOffset(i),Ti.calculateHorizontalPortPlacementSize(i),ql.calculateVerticalPortPlacementSize(i),wa.configureCellSystemSizeContributions(i),ba.setNodeWidth(i),Lr.placeHorizontalPorts(i),Ga.placeHorizontalPortLabels(i),wa.updateVerticalInsidePortLabelCellPadding(i),ba.setNodeHeight(i),o&&(fo.offsetSouthernPortsByNodeSize(i),Lr.placeVerticalPorts(i),Ga.placeVerticalPortLabels(i),Xl.placeLabels(i),fo.setNodePadding(i),fo.applyStuff(i)),i.nodeSize}static computeInsideNodeLabelPadding(t,e,o){let r=new qs(null,e);Ma.createNodeLabelCells(r,!0,!o.isVertical());let i=r.insideNodeLabelContainer,s=new yt;for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(G.BEGIN,a);l!=null&&(s.top=Math.max(s.top,l.getMinimumHeight()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(G.END,a);l!=null&&(s.bottom=Math.max(s.bottom,l.getMinimumHeight()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(a,G.BEGIN);l!=null&&(s.left=Math.max(s.left,l.getMinimumWidth()))}for(let a of[G.BEGIN,G.CENTER,G.END]){let l=i.getCell(a,G.END);l!=null&&(s.right=Math.max(s.right,l.getMinimumWidth()))}return s.top>0&&(s.top+=i.getPadding().top,s.top+=i.getGap()),s.bottom>0&&(s.bottom+=i.getPadding().bottom,s.bottom+=i.getGap()),s.left>0&&(s.left+=i.getPadding().left,s.left+=i.getGap()),s.right>0&&(s.right+=i.getPadding().right,s.right+=i.getGap()),s}};var No=class{static calculateLabelAndNodeSizes(t){us.process(t)}static calculateNodeMargins(t){new Da(t).process()}static getNodeMarginCalculator(t){return new Da(t)}static sortPortLists(t){for(let e of t.getNodes())e.sortPortList()}};var fe=class fe{constructor(t){this.name=t,Object.freeze(this)}opposite(){switch(this){case fe.ABOVE:return fe.BELOW;case fe.BELOW:return fe.ABOVE;case fe.INLINE:return fe.INLINE;default:return fe.UNKNOWN}}toString(){return this.name}static values(){return[fe.UNKNOWN,fe.ABOVE,fe.BELOW,fe.INLINE]}static valueOf(t){return fe[t]}};Z(fe,"UNKNOWN",new fe("UNKNOWN")),Z(fe,"ABOVE",new fe("ABOVE")),Z(fe,"BELOW",new fe("BELOW")),Z(fe,"INLINE",new fe("INLINE")),Z(fe,"LABEL_SIDE",new m("org.eclipse.elk.labelSide",fe.UNKNOWN));var Vt=fe;var yo=class n{constructor(){throw new Error("ElkGraphAdapters is a namespace and must not be instantiated.")}static adapt(t){return new Mu(t)}static adaptSingleNode(t){let e=t.getParent?t.getParent():t.parent;return new Jl(e==null?null:n.adapt(e),t)}static adaptSinglePort(t){return new Ql(t)}},Js=class{constructor(t){this.element=t,this._volatileId=0}getProperty(t){if(t===Ke){let e=this.element.getProperty(Ke);return e==null?0:e}return this.element.getProperty(t)}hasProperty(t){return this.element.hasProperty(t)}getPosition(){return new O(this.element.getX(),this.element.getY())}getSize(){return new O(this.element.getWidth(),this.element.getHeight())}setSize(t){this.element.setWidth(t.x),this.element.setHeight(t.y)}setPosition(t){this.element.setX(t.x),this.element.setY(t.y)}getPadding(){let t=this.element.getProperty(ns);return t==null?new yt:new yt(t)}setPadding(t){this.element.setProperty(ns,new yt(t))}getMargin(){let t=this.element.getProperty(Nr);return t==null&&(t=new me),t}setMargin(t){this.element.setProperty(Nr,new me(t))}getVolatileId(){return this._volatileId}setVolatileId(t){this._volatileId=t}},Mu=class extends Js{constructor(t){super(t),this._childNodes=null}getNodes(){if(this._childNodes==null){this._childNodes=[];for(let t of this.element.children)this._childNodes.push(new Jl(this,t))}return this._childNodes}},Jl=class extends Js{constructor(t,e){super(e),this._parentGraphAdapter=t,this._labelAdapters=null,this._portAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getGraph(){return this._parentGraphAdapter}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}getPorts(){if(this._portAdapters==null){this._portAdapters=[];for(let t of this.element.ports)this._portAdapters.push(new Ql(t))}return this._portAdapters}getIncomingEdges(){if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let t of _i(this.element))this._incomingEdgeAdapters.push(new Qs(t))}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let t of Ee(this.element))this._outgoingEdgeAdapters.push(new Qs(t))}return this._outgoingEdgeAdapters}sortPortList(t){if(this.element.getProperty(cr).isOrderFixed()){let e=t||aE;this.element.ports.sort(e)}}isCompoundNode(){return this.element.children.length>0||this.element.getProperty(ls)}},Ha=class extends Js{constructor(t){super(t)}getSide(){return this.element.getProperty(Vt.LABEL_SIDE)}getText(){return this.element.getText()}},Ql=class extends Js{constructor(t){super(t),this._labelAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getSide(){return this.element.getProperty(Tr)}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}getIncomingEdges(){if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let t of this.element.incomingEdges)this._incomingEdgeAdapters.push(new Qs(t))}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let t of this.element.outgoingEdges)this._outgoingEdgeAdapters.push(new Qs(t))}return this._outgoingEdgeAdapters}hasCompoundConnections(){let t=this.element.getParent();for(let e of this.element.outgoingEdges)for(let o of e.targets){let r=Pt(o);if(mo(r,t)||r===t&&e.getProperty(Ca))return!0}for(let e of this.element.incomingEdges)for(let o of e.sources)if(mo(Pt(o),t))return!0;return!1}},Qs=class{constructor(t){this.element=t,this._labelAdapters=null}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this.element.labels)this._labelAdapters.push(new Ha(t))}return this._labelAdapters}},nE=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);function aE(n,t){var a,l;let e=n.getProperty(Tr),o=t.getProperty(Tr),r=((a=nE.get(e))!=null?a:0)-((l=nE.get(o))!=null?l:0);if(r!==0)return r;let i=n.getProperty(Gl),s=t.getProperty(Gl);if(i!=null&&s!=null){let c=i-s;if(c!==0)return c}switch(e){case u.NORTH:return n.getX()-t.getX();case u.EAST:return n.getY()-t.getY();case u.SOUTH:return t.getX()-n.getX();case u.WEST:return t.getY()-n.getY();default:throw new Error("Port side is undefined")}}yo.adapt=yo.adapt;yo.DEFAULT_PORTLIST_SORTER=aE;var Go=class n{constructor(t){this._adapter=t}static forGraph(t){return typeof t.getNodes=="function"&&typeof t.getLabels=="function"?new n(t):new n(yo.adapt(t))}execute(){No.sortPortLists(this._adapter),No.calculateLabelAndNodeSizes(this._adapter),No.calculateNodeMargins(this._adapter)}};var lE=Object.freeze({PARALLEL_NODE:"PARALLEL_NODE",HIERARCHICAL_NODE:"HIERARCHICAL_NODE",ROOT_NODE:"ROOT_NODE",values(){return[this.PARALLEL_NODE,this.HIERARCHICAL_NODE,this.ROOT_NODE]},valueOf(n){return this[n]}});var fr=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};fr.EADES=new fr("EADES");fr.FRUCHTERMAN_REINGOLD=new fr("FRUCHTERMAN_REINGOLD");var bu=new m("org.eclipse.elk.force.model",()=>fr.FRUCHTERMAN_REINGOLD),tn=new m("org.eclipse.elk.force.iterations",300,1),Gu=new m("org.eclipse.elk.force.repulsivePower",0,0),tc=new m("org.eclipse.elk.force.temperature",.001,Xe.greaterThan(0)),ec=new m("org.eclipse.elk.force.repulsion",5,Xe.greaterThan(0));var Vo=new m("org.eclipse.elk.priority",1),_s=new m("org.eclipse.elk.spacing.nodeNode",80,0),nM=new m("org.eclipse.elk.spacing.edgeLabel",5,0),cE=new m("org.eclipse.elk.aspectRatio",1.6,Xe.greaterThan(0)),gE=new m("org.eclipse.elk.randomSeed",1),hE=new m("org.eclipse.elk.separateConnectedComponents",!0),dE=new m("org.eclipse.elk.padding",new yt(50)),aM=new m("org.eclipse.elk.edgeLabels.inline",!1),lM=new m("org.eclipse.elk.topdown.nodeType",lE.HIERARCHICAL_NODE);var yi=class extends ge{constructor(){super(),this._displacement=new O,this._position=new O,this._size=new O}getPosition(){return this._position}getSize(){return this._size}getRadius(){return this._size.length()/2}getDisplacement(){return this._displacement}};var Es=class extends yi{constructor(t,e){super(),this.id=0,this._label=t!=null?t:null,this._parent=e!=null?e:null,this._children=null}toString(){return this._label==null||this._label.length===0?`n_${this.id}`:`n_${this._label}`}isCompound(){return this._children!=null&&this._children.length>0}getLabel(){return this._label}getParent(){return this._parent}getChildren(){return this._children==null&&(this._children=[]),this._children}getDepth(){let t=0,e=this._parent;for(;e!=null;)e=e.getParent(),t++;return t}};var $r=class extends yi{constructor(t){super(),this._edge=t,t.getBendpoints().push(this)}getEdge(){return this._edge}toString(){if(this._edge!=null){let t=this._edge.getBendpoints().indexOf(this);return t>=0?`b${t}[${this._edge}]`:`b[${this._edge}]`}return`b_${this}`}};var Ii=class extends ge{constructor(){super(),this._nodes=[],this._edges=[],this._labels=[],this._bendPoints=[],this._adjacency=null}getEdges(){return this._edges}getNodes(){return this._nodes}getLabels(){return this._labels}getBendpoints(){return this._bendPoints}*getParticles(){for(let t of this._nodes)yield t;for(let t of this._labels)yield t;for(let t of this._bendPoints)yield t}getConnection(t,e){return t instanceof Es&&e instanceof Es?this._adjacency[t.id][e.id]+this._adjacency[e.id][t.id]:t instanceof $r&&e instanceof $r&&t.getEdge()===e.getEdge()?e.getEdge().getProperty(Vo):0}calcAdjacency(){let t=this._nodes.length;this._adjacency=[];for(let e=0;e<t;e++)this._adjacency.push(new Array(t).fill(0));for(let e of this._edges)this._adjacency[e.getSource().id][e.getTarget().id]+=e.getProperty(Vo)}};var Ut=class{};Ut.ORIGIN=new m("origin");Ut.RANDOM=new m("random");Ut.BB_UPLEFT=new m("boundingBox.upLeft");Ut.BB_LOWRIGHT=new m("boundingBox.lowRight");var en=class{split(t){let e=t.getProperty(hE);if(e==null||e===!0){let o=new Array(t.getNodes().length).fill(!1),r=this._buildIncidenceLists(t),i=[];for(let s of t.getNodes()){let a=this._dfs(s,null,null,o,r);a!=null&&(a.copyProperties(t),i.push(a))}if(i.length>1)for(let s of i){let a=0;for(let l of s.getNodes())l.id=a++}return i}return[t]}_buildIncidenceLists(t){let e=t.getNodes().length,o=new Array(e);for(let r=0;r<e;r++)o[r]=[];for(let r of t.getEdges())o[r.getSource().id].push(r),o[r.getTarget().id].push(r);return o}_dfs(t,e,o,r,i){if(!r[t.id]){r[t.id]=!0;let s=o!=null?o:new Ii;s.getNodes().push(t);for(let a of i[t.id])if(!(a.getTarget()===e||a.getSource()===e)){a.getSource()!==t&&this._dfs(a.getSource(),t,s,r,i),a.getTarget()!==t&&this._dfs(a.getTarget(),t,s,r,i),s.getEdges().push(a);for(let l of a.getLabels())s.getLabels().push(l)}return s}return null}recombine(t){var g,h;if(t.length===1)return t[0];if(t.length<=0)return new Ii;for(let d of t){let f=0,E=Number.POSITIVE_INFINITY,P=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(let N of d.getNodes())f+=(g=N.getProperty(Vo))!=null?g:0,E=Math.min(E,N.getPosition().x-N.getSize().x/2),P=Math.min(P,N.getPosition().y-N.getSize().y/2),S=Math.max(S,N.getPosition().x+N.getSize().x/2),T=Math.max(T,N.getPosition().y+N.getSize().y/2);d.setProperty(Vo,f),d.setProperty(Ut.BB_UPLEFT,new O(E,P)),d.setProperty(Ut.BB_LOWRIGHT,new O(S,T))}t.sort((d,f)=>{var P,S;let E=((P=f.getProperty(Vo))!=null?P:0)-((S=d.getProperty(Vo))!=null?S:0);if(E===0){let T=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT)),N=f.getProperty(Ut.BB_LOWRIGHT).clone().sub(f.getProperty(Ut.BB_UPLEFT));return T.x*T.y-N.x*N.y}return E});let e=new Ii;e.copyProperties(t[0]);let o=0,r=0;for(let d of t){let f=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT));o=Math.max(o,f.x),r+=f.x*f.y}o=Math.max(o,Math.sqrt(r)*((h=e.getProperty(cE))!=null?h:1));let i=e.getProperty(_s),s=0,a=0,l=0,c=i;for(let d of t){let f=d.getProperty(Ut.BB_LOWRIGHT).clone().sub(d.getProperty(Ut.BB_UPLEFT));s+f.x>o&&(s=0,a+=l+i,l=0),this._moveGraph(e,d,s,a),c=Math.max(c,s+f.x),l=Math.max(l,f.y),s+=f.x+i}return e}_moveGraph(t,e,o,r){let i=new O(o,r);i.sub(e.getProperty(Ut.BB_UPLEFT));for(let s of e.getNodes())s.getPosition().add(i),t.getNodes().push(s);for(let s of e.getEdges()){for(let a of s.getBendpoints())a.getPosition().add(i);t.getEdges().push(s)}for(let s of e.getLabels())s.getPosition().add(i),t.getLabels().push(s)}};var U=class U{constructor(){throw new Error("ElkMath is a static utility class")}static factl(t){if(t<0||t>=U._FACT_TABLE.length)throw new Error(`The input must be between 0 and ${U._FACT_TABLE.length}`);return U._FACT_TABLE[t]}static factd(t){if(t<0)throw new Error("The input must be positive");return t<U._FACT_TABLE.length?U._FACT_TABLE[t]:Math.sqrt(2*Math.PI*t)*(U.powf(t,t)/U.powd(Math.E,t))}static binomiall(t,e){if(t<0||e<0)throw new Error("k and n must be positive");if(e>t)throw new Error("k must be smaller than n");return e===0||e===t?1:t===0?0:t<U._FACT_TABLE.length?U.factl(t)/(U.factl(e)*U.factl(t-e)):U.binomiall(t-1,e-1)+U.binomiall(t-1,e)}static binomiald(t,e){if(t<0||e<0)throw new Error("k and n must be positive");if(e>t)throw new Error("k must be smaller than n");return e===0||e===t?1:t===0?0:U.factd(t)/(U.factd(e)*U.factd(t-e))}static powd(t,e){let o=1,r=t,i=e>=0?e:-e;for(;i>0;)i%2===0?(r*=r,i=Math.floor(i/2)):(o*=r,i-=1);return e<0?1/o:o}static powf(t,e){return U.powd(t,e)}static approximateBezierSegment(t,...e){let o,r;if(typeof t=="number"&&e.length>0&&e[0]instanceof O?(o=t,r=e):t instanceof O?(r=[t,...e],o=r.length+1):(o=t,r=e),o<=0)return[];let i=[],s=1/o,a=0;for(let l=0;l<o;l++)a+=s,i.push(U.getPointOnBezierSegment(a,r));return i}static getPointOnBezierSegment(t,e){let o=e.length-1,r=0,i=0;for(let s=0;s<=o;s++){let a=e[s],l=U.binomiald(o,s)*U.powd(1-t,o-s)*U.powd(t,s);r+=a.x*l,i+=a.y*l}return new O(r,i)}static approximateBezierSpline(t){let e=t.length,o=new st,r=0,i=t[r++];for(o.push(i);r<e;){let s=e-r;if(s===1)o.push(t[r++]);else if(s===2){let a=U.approximateBezierSegment(i,t[r++],t[r++]);for(let l of a)o.push(l)}else{let a=t[r++],l=t[r++],c=t[r++],g=U.approximateBezierSegment(i,a,l,c);for(let h of g)o.push(h);i=c}}return o}static distanceFromBezierSegment(t,e,o,r,i){let s=new Array(U._W_DEGREE),a=[t,e,o,r],l=U._convertToBezierForm(a,i),c=U._findRoots(l,U._W_DEGREE,s,0),g=i.distance(t),h=0;for(let E=0;E<c;E++){let P=U._bezier(a,U._DEGREE,s[E],null,null),S=i.distance(P);S<g&&(g=S,h=s[E])}i.distance(r)<g&&(h=1);let f=new O(U._bezier(a,U._DEGREE,h,null,null));return Math.sqrt(f.distance(i))}static _convertToBezierForm(t,e){let o=U._DEGREE,r=U._W_DEGREE,i=new Array(o+1),s=new Array(o),a=Array.from({length:o},()=>new Array(o+1).fill(0)),l=new Array(r+1);for(let d=0;d<=o;d++)i[d]=new O(t[d].x-e.x,t[d].y-e.y);let c=o;for(let d=0;d<=o-1;d++)s[d]=new O(c*(t[d+1].x-t[d].x),c*(t[d+1].y-t[d].y));for(let d=0;d<=o-1;d++)for(let f=0;f<=o;f++)a[d][f]=s[d].x*i[f].x+s[d].y*i[f].y;for(let d=0;d<=r;d++)l[d]=new O(d/r,0);let g=o,h=o-1;for(let d=0;d<=g+h;d++){let f=Math.max(0,d-h),E=Math.min(d,g);for(let P=f;P<=E;P++){let S=d-P;l[P+S].y+=a[S][P]*U._CUBIC_Z[S][P]}}return l}static _findRoots(t,e,o,r){switch(U._crossingCount(t,e)){case 0:return 0;case 1:if(r>=U._MAXDEPTH)return o[0]=(t[0].x+t[U._W_DEGREE].x)/2,1;if(U._controlPolygonFlatEnough(t,e))return o[0]=U._computeXIntercept(t,e),1;break;default:break}let i=new Array(U._W_DEGREE+1),s=new Array(U._W_DEGREE+1),a=new Array(U._W_DEGREE+1),l=new Array(U._W_DEGREE+1);U._bezier(t,e,.5,i,s);let c=U._findRoots(i,e,a,r+1),g=U._findRoots(s,e,l,r+1);for(let h=0;h<c;h++)o[h]=a[h];for(let h=0;h<g;h++)o[h+c]=l[h];return c+g}static _controlPolygonFlatEnough(t,e){let o=t[0].y-t[e].y,r=t[e].x-t[0].x,i=t[0].x*t[e].y-t[e].x*t[0].y,s=o*o+r*r,a=new Array(e+1).fill(0);for(let M=1;M<e;M++)a[M]=o*t[M].x+r*t[M].y+i,a[M]>0&&(a[M]=a[M]*a[M]/s),a[M]<0&&(a[M]=-(a[M]*a[M]/s));let l=0,c=0;for(let M=1;M<e;M++)a[M]<0&&(c=Math.min(c,a[M])),a[M]>0&&(l=Math.max(l,a[M]));let g=0,h=1,d=0,f=o,E=r,P=i+l,S=g*E-f*h,T=1/S,N=(h*P-E*d)*T;P=i+c,S=g*E-f*h,T=1/S;let I=(h*P-E*d)*T,C=Math.min(N,I);return(Math.max(N,I)-C)/2<U._EPSILON}static _computeXIntercept(t,e){let o=t[e].x-t[0].x,r=t[e].y-t[0].y,i=t[0].x,s=t[0].y,a=-1/r;return(o*s-r*i)*a}static _crossingCount(t,e){let o=0,r=t[0].y<0?-1:1,i=r;for(let s=1;s<=e;s++)r=t[s].y<0?-1:1,r!==i&&o++,i=r;return o}static _bezier(t,e,o,r,i){let s=U._W_DEGREE,a=Array.from({length:s+1},()=>new Array(s+1).fill(null));for(let l=0;l<=e;l++)a[0][l]=new O(t[l]);for(let l=1;l<=e;l++)for(let c=0;c<=e-l;c++)a[l][c]=new O((1-o)*a[l-1][c].x+o*a[l-1][c+1].x,(1-o)*a[l-1][c].y+o*a[l-1][c+1].y);if(r!=null)for(let l=0;l<=e;l++)r[l]=a[l][0];if(i!=null)for(let l=0;l<=e;l++)i[l]=a[e-l][l];return a[e][0]}static maxi(...t){let e=-1/0;for(let o of t)o>e&&(e=o);return e}static mini(...t){let e=1/0;for(let o of t)o<e&&(e=o);return e}static averagei(...t){let e=0;for(let o of t)e+=o;return Math.trunc(e/t.length)}static maxl(...t){return U.maxi(...t)}static minl(...t){return U.mini(...t)}static averagel(...t){return U.averagei(...t)}static maxf(...t){return U.maxi(...t)}static minf(...t){return U.mini(...t)}static averagef(...t){let e=0;for(let o of t)e+=o;return e/t.length}static maxd(...t){return U.maxi(...t)}static mind(...t){return U.mini(...t)}static averaged(...t){return U.averagef(...t)}static boundi(t,e,o){return t<=e?e:t>=o?o:t}static boundl(t,e,o){return U.boundi(t,e,o)}static boundf(t,e,o){return U.boundi(t,e,o)}static boundd(t,e,o){return U.boundi(t,e,o)}static clipVector(t,e,o){let r=e/2,i=o/2,s=Math.abs(t.x),a=Math.abs(t.y),l=1,c=1;return s>r&&(l=r/s),a>i&&(c=i/a),t.scale(Math.min(l,c)),t}static signum(t){return t<0?-1:t>0?1:0}static _fuzzyEquals(t,e,o=U._DOUBLE_EQ_EPSILON){return Math.abs(t-e)<=o}static _fuzzyCompare(t,e,o=U._DOUBLE_EQ_EPSILON){return Math.abs(t-e)<=o?0:t<e?-1:1}static intersects(t,e,o,r){if(t instanceof dt&&e instanceof st){let i=t,s=e;if(s.length<2)return!1;let a=s[0],l=a;for(let c=1;c<s.length;c++){let g=s[c];if(U.intersects(i,l,g))return!0;l=g}return U.intersects(i,l,a)}else if(t instanceof dt&&e instanceof O){let i=t,s=e,a=o;return U.contains(i,s,a)?!1:U._intersectsSegments(i.getTopLeft(),i.getTopRight(),s,a)||U._intersectsSegments(i.getTopRight(),i.getBottomRight(),s,a)||U._intersectsSegments(i.getBottomRight(),i.getBottomLeft(),s,a)||U._intersectsSegments(i.getBottomLeft(),i.getTopLeft(),s,a)}else return U._intersectsSegments(t,e,o,r)}static _intersectsSegments(t,e,o,r){let i=t,s=e.clone().sub(t),a=o,l=r.clone().sub(o),c=i.x,g=i.y,h=a.x,d=a.y,f=s.x,E=s.y,P=l.x,S=l.y,T=P*E-f*S;if(U._fuzzyEquals(0,T))return!1;let N=1/T*((c-h)*E-(g-d)*f),I=1/T*-(-(c-h)*S+(g-d)*P);return U._fuzzyCompare(0,N)<0&&U._fuzzyCompare(N,1)<0&&U._fuzzyCompare(0,I)<0&&U._fuzzyCompare(I,1)<0}static intersects2(t,e,o,r){let i=o.clone().sub(t),s=O.crossProduct(i,e),a=O.crossProduct(e,r),l=O.crossProduct(i,r)/a,c=s/a;if(a===0)if(s===0){let g=o.clone().add(r.clone().scale(.5)),h=t.distance(g),d=t.clone().add(e).distance(g),f=r.length()*.5;return h<d&&h<=f?t.clone():d<=f?t.clone().add(e):null}else return null;else return l>=0&&l<=1&&c>=0&&c<=1?t.clone().add(e.clone().scale(l)):null}static distance(t,e,o,r,i){return Math.min(U._traceRays(t,e,o,r,i),U._traceRays(o,r,t,e,i.clone().negate()))}static _traceRays(t,e,o,r,i){let s=1/0,a,l=!1;a=U.intersects2(t,e.clone().sub(t),o.clone().add(i),r.clone().sub(o));let c=a!=null&&!(a.equalsFuzzily(t)||a.equalsFuzzily(e));return a=U.intersects2(t,e.clone().sub(t),o,i),a!=null&&(a.equalsFuzzily(t)===a.equalsFuzzily(e)||c?s=Math.min(s,a.sub(o).length()):l=!0),a=U.intersects2(t,e.clone().sub(t),r,i),a!=null&&(l||a.equalsFuzzily(t)===a.equalsFuzzily(e)||c)&&(s=Math.min(s,a.sub(r).length())),s}static contains(t,e,o){if(e instanceof st){let r=e;if(r.length<2)return!1;let i=r[0],s=i;for(let a=1;a<r.length;a++){let l=r[a];if(!U.contains(t,s,l))return!1;s=l}return U.contains(t,s,i)}else return o!==void 0?U._containsPoint(t,e)&&U._containsPoint(t,o):U._containsPoint(t,e)}static _containsPoint(t,e){let o=t.x,r=t.x+t.width,i=t.y,s=t.y+t.height;return e.x>o&&e.x<r&&e.y>i&&e.y<s}static shortestDistance(t,e){let o=U._DOUBLE_EQ_EPSILON,r=e.x-(t.x+t.width),i=t.x-(e.x+e.width),s=t.y-(e.y+e.height),a=e.y-(t.y+t.height),l=Math.max(i,r),c=Math.max(s,a),g=U._fuzzyCompare(l,0,o)>=0,h=U._fuzzyCompare(c,0,o)>=0;return g!==h?Math.max(c,l):U._fuzzyCompare(l,0,o)>0?Math.sqrt(c*c+l*l):-Math.sqrt(c*c+l*l)}};Z(U,"_FACT_TABLE",[1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368e3,20922789888e3,355687428096e3,6402373705728e3,121645100408832e3,243290200817664e4]),Z(U,"_W_DEGREE",5),Z(U,"_DEGREE",3),Z(U,"_CUBIC_Z",[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]]),Z(U,"_MAXDEPTH",64),Z(U,"_EPSILON",1*Math.pow(2,-65)),Z(U,"_DOUBLE_EQ_EPSILON",1e-5);var Ft=U;var oc=class extends ge{constructor(){super(),this._bendpoints=[],this._labels=[],this._source=null,this._target=null}toString(){var t;return this._source!=null&&this._target!=null?`${this._source}->${this._target}`:"e_"+((t=this._id)!=null?t:"")}getSource(){return this._source}getTarget(){return this._target}getBendpoints(){return this._bendpoints}getLabels(){return this._labels}getSourcePoint(){let t=this._target.getPosition().clone().sub(this._source.getPosition());return Ft.clipVector(t,this._source.getSize().x,this._source.getSize().y),t.add(this._source.getPosition())}getTargetPoint(){let t=this._source.getPosition().clone().sub(this._target.getPosition());return Ft.clipVector(t,this._target.getSize().x,this._target.getSize().y),t.add(this._target.getPosition())}setSource(t){this._source=t}setTarget(t){this._target=t}toVectorChain(){let t=new st;t.add(this.getSourcePoint());for(let e of this._bendpoints)t.add(e.getPosition());return t.add(this.getTargetPoint()),t}distributeBendpoints(){let t=this._bendpoints.length;if(t>0){let e=this._source.getPosition(),r=this._target.getPosition().clone().sub(e).scale(1/(t+1)),i=e.clone();for(let s of this._bendpoints)s.getPosition().x=i.x+r.x,s.getPosition().y=i.y+r.y,i.add(r)}}};var rc=class extends yi{constructor(t,e){super(),this._edge=t,this._text=e,t.getLabels().push(this)}getText(){return this._text}getEdge(){return this._edge}toString(){return this._text==null||this._text.length===0?`l[${this._edge}]`:`l_${this._text}`}refreshPosition(){let t=this.getProperty(Ou),e=this._edge.getSource().getPosition(),o=this._edge.getTarget().getPosition();if(t){let r=o.clone().sub(e).scale(.5),i=this.getSize().clone().scale(.5),s=e.clone().add(r).sub(i);this.getPosition().set(s)}else{let r=this._edge.getProperty(gu),i=this.getPosition();e.x>=o.x?e.y>=o.y?(i.x=o.x+(e.x-o.x)/2+r,i.y=o.y+(e.y-o.y)/2-r-this.getSize().y):(i.x=o.x+(e.x-o.x)/2+r,i.y=e.y+(o.y-e.y)/2+r):e.y>=o.y?(i.x=e.x+(o.x-e.x)/2+r,i.y=o.y+(e.y-o.y)/2+r):(i.x=e.x+(o.x-e.x)/2+r,i.y=e.y+(o.y-e.y)/2-r-this.getSize().y)}}};var on=class{importGraph(t){let e=new Ii;e.copyProperties(t),e.setProperty(Ut.ORIGIN,t);let o=new Map;return this._transformNodes(t,e,o),this._transformEdges(t,e,o),e}_transformNodes(t,e,o){let r=0;for(let i of t.children){let s="";i.labels.length>0&&(s=i.labels[0].getText());let a=new Es(s);a.copyProperties(i),a.setProperty(Ut.ORIGIN,i),a.id=r++,a.getPosition().x=i.getX()+i.getWidth()/2,a.getPosition().y=i.getY()+i.getHeight()/2,a.getSize().x=Math.max(i.getWidth(),1),a.getSize().y=Math.max(i.getHeight(),1),e.getNodes().push(a),o.set(i,a);let l=i.getProperty(cr);l===H.UNDEFINED&&(l=H.FREE)}}_transformEdges(t,e,o){for(let r of t.children)for(let i of Ee(r)){if(i.isHyperedge())throw new Error("Graph must not contain hyperedges.");let s=Pt(i.targets[0]);if(!i.isHierarchical()&&r!==s){let a=new oc;a.copyProperties(i),a.setProperty(Ut.ORIGIN,i),a.setSource(o.get(r)),a.setTarget(o.get(s)),e.getEdges().push(a);for(let l of i.labels){let c=new rc(a,l.getText());c.copyProperties(l),c.setProperty(Ut.ORIGIN,l),c.getSize().x=Math.max(l.getWidth(),1),c.getSize().y=Math.max(l.getHeight(),1),c.refreshPosition(),e.getLabels().push(c)}}}}applyLayout(t){let e=t.getProperty(Ut.ORIGIN),o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let h of t.getNodes()){let d=h.getPosition(),f=h.getSize();o=Math.min(o,d.x-f.x/2),r=Math.min(r,d.y-f.y/2),i=Math.max(i,d.x+f.x/2),s=Math.max(s,d.y+f.y/2)}for(let h of t.getBendpoints()){let d=h.getPosition(),f=h.getSize();o=Math.min(o,d.x-f.x/2),r=Math.min(r,d.y-f.y/2),i=Math.max(i,d.x+f.x/2),s=Math.max(s,d.y+f.y/2)}let a=e.getProperty(dE),l=new O(a.getLeft()-o,a.getTop()-r);for(let h of t.getNodes()){let d=h.getProperty(Ut.ORIGIN);if(d!=null&&d.children!==void 0){let f=new O(h.getPosition()).add(l);d.setLocation(f.x-d.getWidth()/2,f.y-d.getHeight()/2)}}for(let h of t.getEdges()){let d=h.getProperty(Ut.ORIGIN),f=ar(d,!0,!0),E=new O(h.getSourcePoint());E.add(l),f.setStartLocation(E.x,E.y);for(let S of h.getBendpoints()){let T=new O(S.getPosition());T.add(l),Sa(f,T.x,T.y)}let P=new O(h.getTargetPoint());P.add(l),f.setEndLocation(P.x,P.y)}for(let h of t.getLabels()){let d=h.getProperty(Ut.ORIGIN),f=new O(h.getPosition()).add(l);d.setLocation(f.x,f.y)}let c=i-o+a.getHorizontal(),g=s-r+a.getVertical();e.getProperty(To)||Ae(e,c,g,!1,!0),e.setProperty(pi,c-a.getHorizontal()),e.setProperty(Ei,g-a.getVertical())}};var Hu=16,Ri=class{constructor(){this._random=null,this._graph=null,this._dispBound=0}initialize(t){if(this._graph=t,this._random=t.getProperty(Ut.RANDOM),t.calcAdjacency(),this._dispBound=Math.max(t.getNodes().length*Hu+t.getEdges().length,Hu*Hu),!t.getProperty(zo)){let o=this._graph.getNodes().length;for(let r of t.getNodes()){let i=r.getPosition();i.x=this._random.nextDouble()*o,i.y=this._random.nextDouble()*o}}let e=t.getBendpoints();for(let o of t.getEdges()){let r=o.getProperty(Gu);if(r>0){for(let i=0;i<r;i++)e.push(new $r(o));o.distributeBendpoints()}}}getGraph(){return this._graph}getRandom(){return this._random}layout(t,e){var r;e.begin("Component Layout",1),this.initialize(t);let o=0;for(;this.moreIterations(o)&&!((r=e.isCanceled)!=null&&r.call(e));){this.iterationDone();for(let i of t.getParticles())for(let s of t.getParticles())if(s!==i){let a=this.calcDisplacement(s,i);a!=null&&i.getDisplacement().add(a)}for(let i of t.getParticles()){let s=i.getDisplacement();s.bound(-this._dispBound,-this._dispBound,this._dispBound,this._dispBound),i.getPosition().add(s),s.reset()}o++}e.done()}iterationDone(){for(let t of this._graph.getEdges()){for(let e of t.getLabels())e.refreshPosition();t.distributeBendpoints()}}moreIterations(t){throw new Error("moreIterations must be implemented by subclass")}calcDisplacement(t,e){throw new Error("calcDisplacement must be implemented by subclass")}static avoidSamePosition(t,e,o){let r=e.getPosition(),i=o.getPosition();for(;r.x-i.x===0&&r.y-i.y===0;){let s=!1;if(e instanceof $r&&o instanceof $r&&!s){let a=e.getEdge(),l=new O(a.getTargetPoint()).sub(a.getSourcePoint()),c=2,g=new O(l.x/l.length()*c,-l.y/l.length()*c);r.add(g);let h=o.getEdge(),d=new O(h.getTargetPoint()).sub(h.getSourcePoint());c=l===d?-2:2;let f=new O(d.x/d.length()*c,-(d.y/d.length())*c);r.add(f),s=!0}else{let a=()=>t.nextDouble();r.wiggle(a,1),i.wiggle(a,1)}}}};var fE=100,va=class n extends Ri{constructor(){super(),this._maxIterations=tn.getDefault(),this._springLength=_s.getDefault(),this._repulsionFactor=ec.getDefault()}initialize(t){super.initialize(t),this._maxIterations=t.getProperty(tn),this._springLength=t.getProperty(_s),this._repulsionFactor=t.getProperty(ec)}moreIterations(t){return t<this._maxIterations}calcDisplacement(t,e){var l;Ri.avoidSamePosition(this.getRandom(),t,e);let o=e.getPosition().clone().sub(t.getPosition()),r=o.length(),i=Math.max(0,r-t.getRadius()-e.getRadius()),s,a=this.getGraph().getConnection(t,e);if(a>0)s=-n.attractive(i,this._springLength)*a;else{let c=(l=t.getProperty(Vo))!=null?l:0;s=n._repulsive(i,this._repulsionFactor)*c}return o.scale(s/r),o}static _repulsive(t,e){return t>0?e/(t*t):e*fE}static attractive(t,e){return t>0?Math.log(t/e):-fE}};var eT=.01,oT=100,Ba=class n extends Ri{constructor(){super(),this._temperature=tc.getDefault(),this._threshold=0,this._k=0}initialize(t){super.initialize(t),this._temperature=t.getProperty(tc),this._threshold=this._temperature/t.getProperty(tn);let e=t.getNodes().length,o=0,r=0;for(let a of t.getNodes())o+=a.getSize().x,r+=a.getSize().y;let i=o*r,s=t.getProperty(_s)*eT;this._k=Math.sqrt(i/(2*e))*s}moreIterations(t){return this._temperature>0}calcDisplacement(t,e){var c;Ri.avoidSamePosition(this.getRandom(),t,e);let o=e.getPosition().clone().sub(t.getPosition()),r=o.length(),i=Math.max(0,r-t.getRadius()-e.getRadius()),s=(c=t.getProperty(Vo))!=null?c:0,a=n._repulsive(i,this._k)*s,l=this.getGraph().getConnection(t,e);return l>0&&(a-=n.attractive(i,this._k)*l),o.scale(a*this._temperature/r),o}iterationDone(){super.iterationDone(),this._temperature-=this._threshold}static _repulsive(t,e){return t>0?e*e/t:e*e*oT}static attractive(t,e){return t*t/e}};var rn=class extends de{constructor(){super(),this._forceModel=null,this._componentsProcessor=new en}layout(t,e){e.begin("ELK Force",1),t.getProperty(So)||Go.forGraph(t).execute();let o=new on,r=o.importGraph(t);this._setOptions(r,t),this._updateModel(r.getProperty(bu));let i=this._componentsProcessor.split(r);for(let s of i){let a=typeof e.subTask=="function"?e.subTask(1/i.length):e;this._forceModel.layout(s,a)}r=this._componentsProcessor.recombine(i),o.applyLayout(r),e.done()}_setOptions(t,e){let o=t.getProperty(gE);o!=null?o===0?t.setProperty(Ut.RANDOM,new dr):t.setProperty(Ut.RANDOM,new dr(o)):t.setProperty(Ut.RANDOM,new dr(1))}_updateModel(t){switch(t){case fr.EADES:this._forceModel instanceof va||(this._forceModel=new va);break;case fr.FRUCHTERMAN_REINGOLD:default:this._forceModel instanceof Ba||(this._forceModel=new Ba);break}}};var uE="org.eclipse.elk.force",_E=!1;function pE(){let n=Ht.getInstance(),t=n.getAlgorithmData(uE);if(t)return _E=!0,t;let e=new Se.Builder().id(uE).name("ELK Force").description("Force-based algorithm provided by the Eclipse Layout Kernel.").category("org.eclipse.elk.force").definingBundleId("org.eclipse.elk.alg.force").providerFactory(()=>new rn).supportedFeatures(new Set(["MULTI_EDGES","EDGE_LABELS"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),_E=!0,e}var eo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};eo.XY=new eo("XY");eo.X=new eo("X");eo.Y=new eo("Y");var vu=new m("org.eclipse.elk.stress.fixed",!1),Ua=new m("org.eclipse.elk.stress.desiredEdgeLength",100),Bu=new m("org.eclipse.elk.stress.dimension",()=>eo.XY),Uu=new m("org.eclipse.elk.stress.epsilon",.001),Fu=new m("org.eclipse.elk.stress.iterationLimit",Number.MAX_SAFE_INTEGER);var N0=new m("org.eclipse.elk.edgeLabels.inline",!0);var ic=class n{constructor(){this._graph=null,this._apsp=null,this._w=null,this._desiredEdgeLength=0,this._dim=eo.XY,this._epsilon=0,this._iterationLimit=Number.MAX_SAFE_INTEGER,this._connectedEdges=new Map}initialize(t){if(t.getNodes().length<=1)return;this._graph=t,this._dim=t.getProperty(Bu),this._iterationLimit=t.getProperty(Fu),this._epsilon=t.getProperty(Uu),this._desiredEdgeLength=t.getProperty(Ua),this._connectedEdges.clear();for(let o of t.getEdges())this._pushEdge(o.getSource(),o),this._pushEdge(o.getTarget(),o);let e=t.getNodes().length;this._apsp=[];for(let o=0;o<e;o++)this._apsp.push(new Array(e).fill(0));for(let o of t.getNodes())this._dijkstra(o,this._apsp[o.id]);this._w=[];for(let o=0;o<e;o++)this._w.push(new Array(e).fill(0));for(let o=0;o<e;o++)for(let r=0;r<e;r++){let i=this._apsp[o][r];this._w[o][r]=i===0?0:1/(i*i)}}_pushEdge(t,e){let o=this._connectedEdges.get(t);o==null&&(o=[],this._connectedEdges.set(t,o)),o.push(e)}execute(){if(this._graph.getNodes().length<=1)return;let t=0,e=this._computeStress(),o=Number.POSITIVE_INFINITY;do{t>0&&(e=o);for(let r of this._graph.getNodes()){if(r.getProperty(vu))continue;let i=this._computeNewPosition(r);r.getPosition().reset().add(i)}o=this._computeStress(),t++}while(!this._done(t,e,o))}_dijkstra(t,e){var i;let o=this._graph.getNodes().length,r=new Array(o).fill(!1);for(let s of this._graph.getNodes())e[s.id]=s.id===t.id?0:Number.POSITIVE_INFINITY;for(let s=0;s<o;s++){let a=null,l=Number.POSITIVE_INFINITY;for(let g of this._graph.getNodes())!r[g.id]&&e[g.id]<l&&(l=e[g.id],a=g);if(a==null)break;r[a.id]=!0;let c=(i=this._connectedEdges.get(a))!=null?i:[];for(let g of c){let h=n._getOther(g,a);if(r[h.id])continue;let d;g.hasProperty(Ua)?d=g.getProperty(Ua):d=this._desiredEdgeLength;let f=e[a.id]+d;f<e[h.id]&&(e[h.id]=f)}}}_done(t,e,o){return e===0||(e-o)/e<this._epsilon||t>=this._iterationLimit}_computeStress(){let t=0,e=this._graph.getNodes();for(let o=0;o<e.length;o++){let r=e[o];for(let i=o+1;i<e.length;i++){let s=e[i],l=r.getPosition().distance(s.getPosition())-this._apsp[r.id][s.id];t+=this._w[r.id][s.id]*l*l}}return t}_computeNewPosition(t){let e=0,o=0,r=0;for(let i of this._graph.getNodes()){if(t===i)continue;let s=this._w[t.id][i.id];e+=s;let a=t.getPosition().distance(i.getPosition());a>0&&this._dim!==eo.Y&&(o+=s*(i.getPosition().x+this._apsp[t.id][i.id]*(t.getPosition().x-i.getPosition().x)/a)),a>0&&this._dim!==eo.X&&(r+=s*(i.getPosition().y+this._apsp[t.id][i.id]*(t.getPosition().y-i.getPosition().y)/a))}switch(this._dim){case eo.X:return new O(o/e,t.getPosition().y);case eo.Y:return new O(t.getPosition().x,r/e);default:return new O(o/e,r/e)}}static _getOther(t,e){if(t.getSource()===e)return t.getTarget();if(t.getTarget()===e)return t.getSource();throw new Error("Node must be either source or target of edge.")}};var sc=class extends de{constructor(){super(),this._componentsProcessor=new en,this._stressMajorization=new ic}layout(t,e){if(e.begin("ELK Stress",1),t.getProperty(zo))t.getProperty(So)||Go.forGraph(t).execute();else{let s=typeof e.subTask=="function"?e.subTask(1):e;new rn().layout(t,s)}let o=new on,r=o.importGraph(t),i=this._componentsProcessor.split(r);for(let s of i)if(!(s.getNodes().length<=1)){this._stressMajorization.initialize(s),this._stressMajorization.execute();for(let a of s.getLabels())a.refreshPosition()}r=this._componentsProcessor.recombine(i),o.applyLayout(r),e.done()}};var mE="org.eclipse.elk.stress",PE=!1;function OE(){let n=Ht.getInstance(),t=n.getAlgorithmData(mE);if(t)return PE=!0,t;let e=new Se.Builder().id(mE).name("ELK Stress").description("Minimizes the stress within a layout using stress majorization.").category("org.eclipse.elk.force").definingBundleId("org.eclipse.elk.alg.force").providerFactory(()=>new sc).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),PE=!0,e}var qr=class extends ge{constructor(){super(),this._nodes=[],this._edges=[]}getEdges(){return this._edges}getNodes(){return this._nodes}toString(){let t=[];for(let e of this._nodes)t.push(e.toString());for(let e of this._edges)t.push(e.toString());return t.join(`
+`)}};var L=class{};L.ORIGIN=new m("origin");L.RANDOM=new m("random");L.DEPTH=new m("DEPTH",0);L.FAN=new m("FAN",0);L.DESCENDANTS=new m("DESCENDANTS",0);L.ROOT=new m("ROOT",!1);L.LEFTNEIGHBOR=new m("LEFTNEIGHBOR",null);L.RIGHTNEIGHBOR=new m("RIGHTNEIGHBOR",null);L.LEFTSIBLING=new m("LEFTSIBLING",null);L.RIGHTSIBLING=new m("RIGHTSIBLING",null);L.DUMMY=new m("DUMMY",!1);L.LEVEL=new m("LEVEL",0);L.REMOVABLE_EDGES=new m("REMOVABLE_EDGES",[]);L.XCOOR=new m("XCOOR",0);L.YCOOR=new m("YCOOR",0);L.LEVELHEIGHT=new m("LEVELHEIGHT",0);L.LEVELMIN=new m("LEVELMIN",0);L.LEVELMAX=new m("LEVELMAX",0);L.GRAPH_XMIN=new m("GRAPH_XMIN",0);L.GRAPH_YMIN=new m("GRAPH_YMIN",0);L.GRAPH_XMAX=new m("GRAPH_XMAX",0);L.GRAPH_YMAX=new m("GRAPH_YMAX",0);L.COMPACT_LEVEL_ASCENSION=new m("COMPACT_LEVEL_ASCENSION",!1);L.COMPACT_CONSTRAINTS=new m("COMPACT_CONSTRAINTS",[]);L.ID=new m("ID","");L.POSITION=new m("POSITION",0);L.PRELIM=new m("PRELIM",0);L.MODIFIER=new m("MODIFIER",0);L.BB_UPLEFT=new m("boundingBox.upLeft");L.BB_LOWRIGHT=new m("boundingBox.lowRight");var ur=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};ur.DFS=new ur("DFS");ur.BFS=new ur("BFS");var je=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};je.MODEL_ORDER=new je("MODEL_ORDER");je.DESCENDANTS=new je("DESCENDANTS");je.FAN=new je("FAN");je.CONSTRAINT=new je("CONSTRAINT");var ms=Object.freeze({NONE:"NONE",MIDDLE_TO_MIDDLE:"MIDDLE_TO_MIDDLE",AVOID_OVERLAP:"AVOID_OVERLAP",values(){return[this.NONE,this.MIDDLE_TO_MIDDLE,this.AVOID_OVERLAP]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var V=class{};V.ALGORITHM_ID="org.eclipse.elk.mrtree";V.SEARCH_ORDER=new m("org.eclipse.elk.mrtree.searchOrder",ur.DFS);V.DIRECTION=new m("org.eclipse.elk.direction",R.UNDEFINED);V.ASPECT_RATIO=new m("org.eclipse.elk.aspectRatio",1.6);V.PADDING=new m("org.eclipse.elk.padding",new yt(20));V.SEPARATE_CONNECTED_COMPONENTS=new m("org.eclipse.elk.separateConnectedComponents",!0);V.PRIORITY=new m("org.eclipse.elk.priority",1);V.SPACING_NODE_NODE=new m("org.eclipse.elk.spacing.nodeNode",20,0);V.SPACING_EDGE_NODE=new m("org.eclipse.elk.spacing.edgeNode",3,0);V.OMIT_NODE_MICRO_LAYOUT=So;V.RANDOM_SEED=Pu;V.WEIGHTING=new m("org.eclipse.elk.mrtree.weighting",je.MODEL_ORDER);V.DEBUG_MODE=new m("org.eclipse.elk.debugMode",!1);V.POSITION_CONSTRAINT=new m("org.eclipse.elk.mrtree.positionConstraint",-1);V.EDGE_ROUTING_MODE=new m("org.eclipse.elk.mrtree.edgeRoutingMode",ms.AVOID_OVERLAP);V.TREE_LEVEL=new m("org.eclipse.elk.mrtree.treeLevel",0);V.EDGE_END_TEXTURE_LENGTH=new m("org.eclipse.elk.mrtree.edgeEndTextureLength",7);V.COMPACTION=new m("org.eclipse.elk.mrtree.compaction",!1);var nc=class{constructor(){this._incidence=null,this._visited=null}_initialize(t){let e=t.getNodes().length;this._incidence=new Array(e),this._visited=new Array(e).fill(!1);for(let o of t.getNodes())this._incidence[o.id]=[];for(let o of t.getEdges())this._incidence[o.getSource().id].push(o),this._incidence[o.getTarget().id].push(o)}split(t){let e=t.getProperty(V.SEPARATE_CONNECTED_COMPONENTS);if(e==null||e===!0){this._initialize(t);let o=[];for(let r of t.getNodes()){let i=this._dfs(r,null);i!=null&&(i.copyProperties(t),o.push(i))}if(this._incidence=null,this._visited=null,o.length>1)for(let r of o){let i=0;for(let s of r.getNodes())s.id=i++}return o}return[t]}_dfs(t,e){if(!this._visited[t.id]){this._visited[t.id]=!0;let o=e!=null?e:new qr;o.getNodes().push(t);for(let r of this._incidence[t.id])r.getSource()!==t&&this._dfs(r.getSource(),o),r.getTarget()!==t&&this._dfs(r.getTarget(),o),r.getSource()===t&&o.getEdges().push(r);return o}return null}pack(t){var d,f;if(t.length===1)return this._applyPaddingAndNormalizePositions(t[0]),t[0];if(t.length<=0)return new qr;for(let E of t){let P=0,S=Number.POSITIVE_INFINITY,T=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(let C of E.getNodes())P+=(d=C.getProperty(V.PRIORITY))!=null?d:0,S=Math.min(S,C.getPosition().x),T=Math.min(T,C.getPosition().y),N=Math.max(N,C.getPosition().x+C.getSize().x),I=Math.max(I,C.getPosition().y+C.getSize().y);E.setProperty(V.PRIORITY,P),E.setProperty(L.BB_UPLEFT,new O(S,T)),E.setProperty(L.BB_LOWRIGHT,new O(N,I))}t.sort((E,P)=>{var T,N;let S=((T=P.getProperty(V.PRIORITY))!=null?T:0)-((N=E.getProperty(V.PRIORITY))!=null?N:0);if(S===0){let I=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT)),C=P.getProperty(L.BB_LOWRIGHT).clone().sub(P.getProperty(L.BB_UPLEFT));return I.x*I.y-C.x*C.y}return S});let e=new qr;e.copyProperties(t[0]);let o=0,r=0;for(let E of t){let P=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT));o=Math.max(o,P.x),r+=P.x*P.y}o=Math.max(o,Math.sqrt(r)*((f=e.getProperty(V.ASPECT_RATIO))!=null?f:1));let i=e.getProperty(V.SPACING_NODE_NODE),s=0,a=0,l=0,c=i;for(let E of t){let P=E.getProperty(L.BB_LOWRIGHT).clone().sub(E.getProperty(L.BB_UPLEFT));s+P.x>o&&(s=0,a+=l+i,l=0),this._moveGraph(e,E,s,a),c=Math.max(c,s+P.x),l=Math.max(l,P.y),s+=P.x+i}let g=new Map,h=new Map;for(let E of t){let P=E.getProperty(Ks),S=E.getAllProperties();for(let[T,N]of S)g.has(T)?T.getDefault()!==N&&(P&&h.has(T)||(g.set(T,N),e.setProperty(T,N),P&&h.set(T,N))):(g.set(T,N),e.setProperty(T,N))}return rT(e),this._applyPaddingAndNormalizePositions(e),e}_applyPaddingAndNormalizePositions(t){let e=t.getProperty(V.PADDING);t.setProperty(L.BB_UPLEFT,new O(0,0)),this._moveGraph(new qr,t,e.getLeft()-t.getProperty(L.GRAPH_XMIN),e.getTop()-t.getProperty(L.GRAPH_YMIN))}_moveGraph(t,e,o,r){let i=new O(o,r);i.sub(e.getProperty(L.BB_UPLEFT));for(let a of e.getNodes())a.getPosition().add(i),t.getNodes().push(a);let s=new Set;for(let a of e.getEdges())if(!s.has(a)){s.add(a);for(let l of a.getBendPoints())l.add(i);t.getEdges().push(a)}}};function rT(n){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let i of n.getNodes()){let s=i.getPosition(),a=i.getSize();t=Math.min(t,s.x),e=Math.min(e,s.y),o=Math.max(o,s.x+a.x),r=Math.max(r,s.y+a.y)}n.getNodes().length===0&&(t=e=o=r=0),n.setProperty(L.GRAPH_XMIN,t),n.setProperty(L.GRAPH_YMIN,e),n.setProperty(L.GRAPH_XMAX,o),n.setProperty(L.GRAPH_YMAX,r)}var sn=class extends ge{constructor(t=0){super(),this.id=t}};var nn=class extends sn{constructor(t,e){super(),this._source=t,this._target=e,this._labels=[],this._bendPoints=new st}getSource(){return this._source}setSource(t){if(this._source!==t){if(this._source!=null){let e=this._source.getOutgoingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}t!=null&&!t.getOutgoingEdges().includes(this)&&t.getOutgoingEdges().push(this),this._source=t}}getTarget(){return this._target}setTarget(t){if(this._target!==t){if(this._target!=null){let e=this._target.getIncomingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}t!=null&&!t.getIncomingEdges().includes(this)&&t.getIncomingEdges().push(this),this._target=t}}getLabels(){return this._labels}getBendPoints(){return this._bendPoints}toString(){return this._source!=null&&this._target!=null?`${this._source}->${this._target}`:`e_${this.id}`}};var ac=class extends sn{constructor(t=0){super(t),this._pos=new O,this._size=new O}getPosition(){return this._pos}getSize(){return this._size}};var Ps=class extends ac{constructor(t,e,o){super(t),this._graph=e,this._label=o!=null?o:null,this._outgoingEdges=[],this._incomingEdges=[]}getLabel(){return this._label}setLabel(t){this._label=t}*getParents(){for(let t of this.getIncomingEdges())yield t.getSource()}getParent(){let t=this.getIncomingEdges();return t.length===0?null:t[0].getSource()}getChildrenCopy(){let t=[];for(let e of this.getOutgoingEdges())t.push(e.getTarget());return t}*getChildren(){for(let t of this.getOutgoingEdges())yield t.getTarget()}getOutgoingEdges(){return this._outgoingEdges==null&&(this._outgoingEdges=[]),this._outgoingEdges}getIncomingEdges(){return this._incomingEdges==null&&(this._incomingEdges=[]),this._incomingEdges}addChild(t){let e=new nn(this,t);e.setProperty(L.DUMMY,!0),this._graph.getEdges().push(e),this.getOutgoingEdges().push(e),t.getIncomingEdges().push(e)}isLeaf(){return this.getOutgoingEdges().length===0}toString(){return this._label==null||this._label.length===0?`n_${this.id}`:`n_${this._label}`}};var lc=class{importGraph(t){let e=new qr;e.copyProperties(t),e.setProperty(L.ORIGIN,t);let o=new Map;return this._transformNodes(t,e,o),this._transformEdges(t,e,o),e}_transformNodes(t,e,o){let r=0;for(let i of t.children){let s="";i.labels.length>0&&(s=i.labels[0].getText());let a=new Ps(r++,e,s);a.copyProperties(i),a.setProperty(L.ORIGIN,i),a.getPosition().y=i.getY()+i.getHeight()/2,a.getSize().x=Math.max(i.getWidth(),1),a.getPosition().x=i.getX()+i.getWidth()/2,a.getSize().y=Math.max(i.getHeight(),1),e.getNodes().push(a),o.set(i,a)}}_transformEdges(t,e,o){for(let r of t.children)for(let i of Ee(r))if(!i.isHierarchical()&&!i.isSelfloop()){let s=o.get(r),a=o.get(Pt(i.targets[0]));if(s!=null&&a!=null){let l=new nn(s,a);l.setProperty(L.ORIGIN,i),l.copyProperties(i),s.getOutgoingEdges().push(l),a.getIncomingEdges().push(l),e.getEdges().push(l)}}}applyLayout(t){let e=t.getProperty(L.ORIGIN),o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let g of t.getNodes()){let h=g.getPosition(),d=g.getSize();o=Math.min(o,h.x-d.x/2),r=Math.min(r,h.y-d.y/2),i=Math.max(i,h.x+d.x/2),s=Math.max(s,h.y+d.y/2)}let a=e.getProperty(V.PADDING);for(let g of t.getNodes()){let h=g.getProperty(L.ORIGIN);h!=null&&h.children!==void 0&&(h.setLocation(g.getPosition().x,g.getPosition().y),h.copyProperties(g))}for(let g of t.getEdges()){let h=g.getProperty(L.ORIGIN);if(h!=null){let d=g.getBendPoints(),f=ar(h,!0,!0);Xs(d,f)}}let l=i-o+a.getHorizontal(),c=s-r+a.getVertical();e.getProperty(To)||Ae(e,l,c,!1,!1),e.setProperty(pi,l-a.getHorizontal()),e.setProperty(Ei,c-a.getVertical())}static _toNodeBorder(t,e,o){let r=o.x/2,i=o.y/2,s=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y),l=1,c=1;s>r&&(l=r/s),a>i&&(c=i/a);let g=Math.min(l,c);t.x+=g*(e.x-t.x),t.y+=g*(e.y-t.y)}};var an=class{constructor(){this._list=[]}provideDefault(){throw new Error(`${this.constructor.name}.provideDefault() is not implemented`)}getListItem(t){if(t<0)throw new RangeError(`Invalid index: ${t}`);return this._ensureListSize(t+1),this._list[t]}setListItem(t,e){if(t<0)throw new RangeError(`Invalid index: ${t}`);t<this._list.length?this._list[t]=e:(this._ensureListSize(t),this._list.push(e))}getListSize(){return this._list.length}clearList(){this._list.length=0}_ensureListSize(t){for(;this._list.length<t;)this._list.push(this.provideDefault())}};var cc=class{compare(t,e){return t.ordinal-e.ordinal}};var K=class n extends an{constructor(){super(),this._currentIndex=-1}static create(){return new n}static createFrom(t){return new n().addAll(t)}clear(){return this.clearList(),this._currentIndex=-1,this}before(t){return this._currentIndex=t.ordinal,this}after(t){return this._currentIndex=t.ordinal+1,this}add(t){if(this._currentIndex<0)throw new Error("Did not call before(...) or after(...) before calling add(...).");return this._doAdd(this._currentIndex,t),this}addBefore(t,e){return this._currentIndex=-1,this._doAdd(t.ordinal,e),this}addAfter(t,e){return this._currentIndex=-1,this._doAdd(t.ordinal+1,e),this}_doAdd(t,e){this.getListItem(t).add(e)}addAll(t){for(let e=0;e<t.getListSize();e++){let o=this.getListItem(e);for(let r of t.getListItem(e))o.add(r)}return this}processorsBefore(t){return this._processors(t.ordinal)}processorsAfter(t){return this._processors(t.ordinal+1)}_processors(t){return new Set(this.getListItem(t))}provideDefault(){return new Set}};var Io=class n extends an{static create(t){return new n(t)}constructor(t){if(super(),!t||t.length===0)throw new Error("There must be at least one phase in the phase enumeration.");this._phaseEnumConstants=t,this._numberOfPhases=t.length,this._enableCaching=!0,this._failOnMissingPhase=!0,this._processorComparator=new cc,this._configuredPhases=new Set,this._additionalProcessors=K.create(),this._cache=new Map}withCaching(t){return this._enableCaching=t,this}withFailOnMissingPhase(t){return this._failOnMissingPhase=t,this}withProcessorComparator(t){return this._processorComparator=t,this}clearCache(){return this._cache.clear(),this}reset(){return this.clearList(),this._configuredPhases.clear(),this._additionalProcessors.clear(),this}setPhase(t,e){return this.setListItem(t.ordinal,e),this._configuredPhases.add(t),this}addProcessorConfiguration(t){return this._additionalProcessors.addAll(t),this}build(t){if(this._failOnMissingPhase&&this._configuredPhases.size<this._numberOfPhases)throw new Error(`Expected ${this._numberOfPhases} phases to be configured; only found ${this._configuredPhases.size}`);let e=this._phaseEnumConstants,o=[];for(let a of e){let l=this.getListItem(a.ordinal);o.push(l!=null?this._retrievePhase(l):null)}let r=K.create();for(let a of o){if(a==null)continue;let l=a.getLayoutProcessorConfiguration(t);l!=null&&r.addAll(l)}r.addAll(this._additionalProcessors);let i=[];for(let a of e){for(let c of this._retrieveProcessors(r.processorsBefore(a)))i.push(c);let l=o[a.ordinal];l!=null&&i.push(l)}let s=e[e.length-1];for(let a of this._retrieveProcessors(r.processorsAfter(s)))i.push(a);return i}provideDefault(){return null}_retrieveProcessors(t){return[...t].sort((o,r)=>this._processorComparator.compare(o,r)).map(o=>this._retrieveProcessor(o))}_retrievePhase(t){return this._retrieveProcessor(t)}_retrieveProcessor(t){if(this._enableCaching){if(this._cache.has(t))return this._cache.get(t);let e=t.create();return this._cache.set(t,e),e}return t.create()}};var Ie=class n{constructor(t=-1){this._parentMonitor=null,this._children=[],this._maxLevels=t<0?-1:t,this._taskName=null,this._closed=!1,this._totalWork=0,this._completedWork=0,this._currentChildWork=-1,this._recordLogs=!1,this._logMessages=null,this._recordExecutionTime=!1,this._startTime=0,this._totalTime=0}withMaxHierarchyLevels(t){return this._maxLevels=t<0?-1:t,this}withLogging(t){return this._recordLogs=t,this._logMessages=t?[]:null,this}withLogPersistence(t){return this}withExecutionTimeMeasurement(t){return this._recordExecutionTime=t,this}begin(t,e){if(this._closed)throw new Error("The task is already done.");if(this._taskName!==null)return!1;if(t==null)throw new Error("Task name must not be null.");return this._taskName=t,this._totalWork=e,this._doBegin(t,e,this._parentMonitor===null,this._maxLevels),this._recordExecutionTime&&(this._startTime=performance.now()),!0}_doBegin(t,e,o,r){}worked(t){t>0&&!this._closed&&this._internalWorked(t)}_internalWorked(t){this._totalWork>0&&this._completedWork<this._totalWork&&(this._completedWork+=t,this._doWorked(this._completedWork,this._totalWork,this._parentMonitor===null),this._parentMonitor!==null&&this._parentMonitor._currentChildWork>0&&this._maxLevels!==0&&this._parentMonitor._internalWorked(t/this._totalWork*this._parentMonitor._currentChildWork))}_doWorked(t,e,o){}done(){if(this._taskName===null)throw new Error("The task has not begun yet.");this._closed||(this._recordExecutionTime&&(this._totalTime=(performance.now()-this._startTime)/1e3),this._completedWork<this._totalWork&&this._internalWorked(this._totalWork-this._completedWork),this._doDone(this._parentMonitor===null,this._maxLevels),this._closed=!0)}_doDone(t,e){}isRunning(){return this._taskName!==null&&!this._closed}isCanceled(){return!1}getTaskName(){return this._taskName}subTask(t){if(!this._closed){let e=this._doSubTask(t,this._maxLevels);return this._children.push(e),e._parentMonitor=this,this._currentChildWork=t,e}return null}_doSubTask(t,e){let o=e>0?e-1:e;return new n().withMaxHierarchyLevels(o).withLogging(this._recordLogs).withExecutionTimeMeasurement(this._recordExecutionTime)}getSubMonitors(){return this._children}getParentMonitor(){return this._parentMonitor}isLoggingEnabled(){return this._recordLogs}isLogPersistenceEnabled(){return!1}log(t){this._recordLogs&&t!==null&&t!==void 0&&this._logMessages.push(String(t))}getLogs(){return this._logMessages}logGraph(t,e,o){}getLoggedGraphs(){return null}isExecutionTimeMeasured(){return this._recordExecutionTime}getExecutionTime(){return this._totalTime}};var gc=class{constructor(){this._roots=[]}process(t,e){e.begin("Find roots",1),this._roots.length=0;for(let o of t.getNodes())o.getIncomingEdges().length===0&&(o.setProperty(L.ROOT,!0),this._roots.push(o));switch(this._roots.length){case 0:{let o=new Ps(0,t,"DUMMY_ROOT");o.setProperty(L.ROOT,!0),o.setProperty(L.DUMMY,!0),t.getNodes().push(o);break}case 1:break;default:{let o=new Ps(0,t,"SUPER_ROOT");for(let r of this._roots)o.addChild(r),r.setProperty(L.ROOT,!1);o.setProperty(L.ROOT,!0),o.setProperty(L.DUMMY,!0),t.getNodes().push(o);break}}e.done()}};var hc=class n{constructor(){this._gloFanMap=new Map,this._gloDescMap=new Map}process(t,e){var r,i;e.begin("Processor compute fanout",1),this._gloFanMap.clear(),this._gloDescMap.clear();let o=null;for(let s of t.getNodes())if(s.getProperty(L.ROOT)){o=s;break}if(o==null){e.done();return}this._calculateFan([o]);for(let s of t.getNodes()){let a=s.getProperty(L.ID),l=(r=this._gloFanMap.get(a))!=null?r:0;s.setProperty(L.FAN,l);let c=1+((i=this._gloDescMap.get(a))!=null?i:0);s.setProperty(L.DESCENDANTS,c)}e.done()}_calculateFan(t){var e,o;if(t.length>0){let r=[],i=null,s=null,a=Math.floor(Math.log10(t.length))+1,l=0;for(let g of t){s!==g.getProperty(L.ID)&&(s=g.getProperty(L.ID),l=0),s!=null?i=s+n.formatRight(l++,a):i=n.formatRight(l++,a),g.setProperty(L.ID,i);for(let h of g.getChildren())r.push(h),h.setProperty(L.ID,i)}let c=new Map;for(let g=0;g<(i!=null?i:"").length-a;g++)for(let h of t){let d=h.getProperty(L.ID).substring(0,g+1),f=((e=c.get(d))!=null?e:0)+1;c.set(d,f)}for(let[g,h]of c){let d=(o=this._gloDescMap.get(g))!=null?o:0;this._gloDescMap.set(g,h+d);let f=this._gloFanMap.get(g);(f==null||f<h)&&this._gloFanMap.set(g,h)}this._calculateFan(r)}}static formatRight(t,e){let o=`${t}`;for(;o.length<e;)o=`0${o}`;return o}};var dc=class{constructor(){this._gloLevelMap=new Map}process(t,e){var r;e.begin("Processor compute fanout",1);let o=t.getNodes().filter(i=>i.getProperty(L.ROOT));this._setLevel(o,0);for(let i of t.getNodes()){let s=(r=this._gloLevelMap.get(i.id))!=null?r:0;i.setProperty(V.TREE_LEVEL,s)}e.done()}_setLevel(t,e){if(t.length>0){let o=[];for(let r of t){this._gloLevelMap.set(r.id,e);for(let i of r.getChildren())o.push(i)}this._setLevel(o,e+1)}}};var fc=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor set neighbors",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let r of t.getNodes())if(r.getProperty(L.ROOT)){o=r;break}o!=null&&this._setNeighbors([...o.getChildren()],e),e.done()}_setNeighbors(t,e){if(t.length>0){let o=typeof e.subTask=="function"?e.subTask(t.length/this._numberOfNodes):e;o.begin("Set neighbors in level",1);let r=[],i=null;for(let s of t){for(let a of s.getChildren())r.push(a);i!=null&&(i.setProperty(L.RIGHTNEIGHBOR,s),s.setProperty(L.LEFTNEIGHBOR,i),s.getParent()===i.getParent()&&(i.setProperty(L.RIGHTSIBLING,s),s.setProperty(L.LEFTSIBLING,i))),i=s}o.done(),this._setNeighbors(r,e)}}};var uc=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor determine the height for each level",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let r of t.getNodes())if(r.getProperty(L.ROOT)){o=r;break}o!=null&&this._setLevelHeight([o],e,t.getProperty(V.DIRECTION)),e.done()}_setLevelHeight(t,e,o){if(t.length>0){let r=typeof e.subTask=="function"?e.subTask(t.length/this._numberOfNodes):e;r.begin("Set neighbors in level",1);let i=[],s=0;if(o.isHorizontal())for(let a of t){for(let l of a.getChildren())i.push(l);s<a.getSize().x&&(s=a.getSize().x)}else for(let a of t){for(let l of a.getChildren())i.push(l);s<a.getSize().y&&(s=a.getSize().y)}for(let a of t)a.setProperty(L.LEVELHEIGHT,s);r.done(),this._setLevelHeight(i,e,o)}}};var _c=class{process(t,e){e.begin("Processor determine the coords for each level",1);let o=[],r=t.getProperty(V.DIRECTION).isHorizontal();for(let i of t.getNodes()){let s=i.getProperty(V.TREE_LEVEL);for(;s>o.length-1;)o.push(new Gt(Number.MAX_VALUE,-Number.MAX_VALUE));let a=o[s];r?(i.getPosition().x<a.getFirst()&&a.setFirst(i.getPosition().x),i.getPosition().x+i.getSize().x>a.getSecond()&&a.setSecond(i.getPosition().x+i.getSize().x)):(i.getPosition().y<a.getFirst()&&a.setFirst(i.getPosition().y),i.getPosition().y+i.getSize().y>a.getSecond()&&a.setSecond(i.getPosition().y+i.getSize().y))}for(let i of t.getNodes()){let s=i.getProperty(V.TREE_LEVEL);i.setProperty(L.LEVELMIN,o[s].getFirst()),i.setProperty(L.LEVELMAX,o[s].getSecond())}e.done()}};var pc=class{process(t,e){e.begin("Process directions",1);let o=t.getProperty(V.DIRECTION);if(o!==R.DOWN)for(let r of t.getNodes()){let i=r.getProperty(L.XCOOR),s=r.getProperty(L.YCOOR);switch(o){case R.UP:s=-s;break;case R.RIGHT:{let a=i;i=s,s=a;break}case R.LEFT:{let a=i;i=-s,s=a;break}}r.setProperty(L.XCOOR,i),r.setProperty(L.YCOOR,s)}e.done()}};var Ec=class{constructor(){this._numberOfNodes=0}process(t,e){e.begin("Processor set coordinates",1),this._numberOfNodes=t.getNodes().length===0?1:t.getNodes().length;let o=null;for(let s of t.getNodes())if(s.getProperty(L.ROOT)){o=s;let a=s.getPosition();a.x=s.getProperty(L.XCOOR),a.y=s.getProperty(L.YCOOR);break}if(o==null){e.done();return}let r=o.getChildrenCopy(),i=1;do{let s=typeof e.subTask=="function"?e.subTask(i):e;r=this._setCoordinates(r,s),i=r.length/this._numberOfNodes}while(r.length>0);for(let s of t.getNodes())s.getPosition().sub(new O(s.getSize().x/2,s.getSize().y/2));e.done()}_setCoordinates(t,e){if(t.length>0){let o=[];for(let r of t){for(let s of r.getChildrenCopy())o.push(s);let i=r.getPosition();i.x=r.getProperty(L.XCOOR),i.y=r.getProperty(L.YCOOR)}return o}return[]}};var Ro=class n{static getRoot(t){for(let e of t.getNodes())if(e.getProperty(L.ROOT))return e;throw new Error("No root found in tree graph.")}static depth(t){let e=n.getChildren(t);if(e.length===0)return 1;let o=0;for(let r of e)o=Math.max(o,n.depth(r));return o+1}static getChildren(t){let e=new Set,o=[];for(let r of t.getOutgoingEdges()){let i=r.getTarget();e.has(i)||(e.add(i),o.push(i))}return o}static getLeftMost(t,e=-1){let o=[...t];if(o.length>0){let r=e;if(r>1){r--;let i=[];for(let s of o)for(let a of s.getChildren())i.push(a);return n.getLeftMost(i,r)}if(r<0){let i=[];for(let s of o)for(let a of s.getChildren())i.push(a);if(i.length>0)return n.getLeftMost(i,r)}}return o.length>0?o[0]:null}static getDirection(t){return t.getProperty(V.DIRECTION)}static getDirectionVector(t){return t===R.UP?new O(0,-1):t===R.RIGHT?new O(1,0):t===R.LEFT?new O(-1,0):new O(0,1)}static getLowestParent(t,e){let o=n.getDirectionVector(n.getDirection(e)),r=t.getIncomingEdges();if(r.length===0)return null;let i=new Set;for(let g of r)i.add(g.getSource());let s=e.getNodes().filter(g=>i.has(g));if(s.length===0)return null;let a=g=>new O(g.getPosition().x+g.getSize().x/2,g.getPosition().y+g.getSize().y/2).dotProduct(o),l=s[0],c=a(s[0]);for(let g=1;g<s.length;g++){let h=a(s[g]);h>c&&(l=s[g],c=h)}return l}static getFirstPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getTarget().getPosition().x,t.getTarget().getPosition().y):e.getFirst()}static getLastPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getSource().getPosition().x,t.getSource().getPosition().y):e.getLast()}static isCycleInducing(t,e){let o=n.getDirectionVector(n.getDirection(e)),r=t.getTarget().getPosition().x-t.getSource().getPosition().x,i=t.getTarget().getPosition().y-t.getSource().getPosition().y;return o.x*r+o.y*i<=0}static getAllOutgoingEdges(t,e){let o=[];for(let r of e.getEdges())r.getSource()===t&&o.push(r);return o}static getAllIncomingEdges(t,e){let o=[];for(let r of e.getEdges())r.getTarget()===t&&o.push(r);return o}static getUniqueLong(t,e){return t+","+e}static toNodeBorder(t,e,o){let r=o.x/2,i=o.y/2,s=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y),l=1,c=1;s>r&&(l=r/s),a>i&&(c=i/a);let g=Math.min(l,c);t.x+=g*(e.x-t.x),t.y+=g*(e.y-t.y)}};var Os=class n{constructor(t,e,o){this._first=t,this._second=e,this._third=o}getFirst(){return this._first}getSecond(){return this._second}getThird(){return this._third}equals(t){return t instanceof n?ku(this._first,t._first)&&ku(this._second,t._second)&&ku(this._third,t._third):!1}toString(){return`(${this._first}, ${this._second}, ${this._third})`}};function ku(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):!1}var mc=class{constructor(){this._levels=[]}process(t,e){if(e.begin("Process compaction",1),!t.getProperty(V.COMPACTION)){e.done();return}let o=t.getProperty(V.DIRECTION),r=t.getProperty(V.SPACING_NODE_NODE);this._setUpLevels(t,o),this._computeNodeConstraints(t,r/2/2);let i=Ro.getDirectionVector(o),s=[...t.getNodes()].sort((a,l)=>{let c=i.dotProduct(new O(a.getPosition().x,a.getPosition().y)),g=i.dotProduct(new O(l.getPosition().x,l.getPosition().y));return c-g});for(let a of s){if(a.getProperty(L.ROOT))continue;let l=this._getLowestDependentNode(a,o),c=Ro.getLowestParent(a,t),g=0,h=0;if(l!=null){let d=l.getPosition();switch(o){case R.LEFT:g=d.x-r-a.getSize().x,c.getPosition().x-r-a.getSize().x<g&&(g=c.getPosition().x-r-a.getSize().x),h=g+a.getSize().x;break;case R.RIGHT:g=d.x+l.getSize().x+r,c.getPosition().x+r>g&&(g=c.getPosition().x+c.getSize().x+r),h=g+a.getSize().x;break;case R.UP:g=d.y-r-a.getSize().y,c.getPosition().y-r-a.getSize().y<g&&(g=c.getPosition().y-r-a.getSize().y),h=g+a.getSize().y;break;case R.DOWN:g=d.y+l.getSize().y+r,c.getPosition().y+r>g&&(g=c.getPosition().y+c.getSize().y+r),h=g+a.getSize().y;break}}else if(c!=null)switch(o){case R.LEFT:g=c.getPosition().x-r-a.getSize().x,h=g+a.getSize().x;break;case R.RIGHT:g=c.getPosition().x+c.getSize().x+r,h=g+a.getSize().x;break;case R.UP:g=c.getPosition().y-r-a.getSize().y,h=g+a.getSize().y;break;case R.DOWN:g=c.getPosition().y+c.getSize().y+r,h=g+a.getSize().y;break}if(t.getProperty(V.EDGE_ROUTING_MODE)===ms.AVOID_OVERLAP){let d=this._levels.find(f=>f.getFirst()<=g&&f.getSecond()>=h);if(d!=null)o.isHorizontal()?a.getPosition().x=g:a.getPosition().y=g;else{let f=this._levels.slice(1);o===R.LEFT||o===R.UP?d=f.find(E=>E.getFirst()<=g):d=f.find(E=>E.getFirst()>=g),d!=null&&(o.isHorizontal()?a.getPosition().x=d.getFirst():a.getPosition().y=d.getFirst())}if(d!=null){let f=this._levels.indexOf(d);f>0&&f!==a.getProperty(V.TREE_LEVEL)&&(a.setProperty(L.COMPACT_LEVEL_ASCENSION,!0),a.setProperty(V.TREE_LEVEL,f))}}else o.isHorizontal()?a.getPosition().x=g:a.getPosition().y=g}e.done()}_setUpLevels(t,e){this._levels=[];for(let o of t.getNodes()){for(;o.getProperty(V.TREE_LEVEL)>this._levels.length-1;)this._levels.push(new Gt(Number.MAX_VALUE,-Number.MAX_VALUE));let r=o.getProperty(V.TREE_LEVEL),i=this._levels[r];e.isHorizontal()?(o.getPosition().x<i.getFirst()&&i.setFirst(o.getPosition().x),o.getPosition().x+o.getSize().x>i.getSecond()&&i.setSecond(o.getPosition().x+o.getSize().x)):(o.getPosition().y<i.getFirst()&&i.setFirst(o.getPosition().y),o.getPosition().y+o.getSize().y>i.getSecond()&&i.setSecond(o.getPosition().y+o.getSize().y))}}_computeNodeConstraints(t,e){let o=t.getProperty(V.DIRECTION),r=o.isHorizontal()?R.DOWN:R.RIGHT,i=Ro.getDirectionVector(o),s=Ro.getDirectionVector(r),a=t.getNodes().filter(h=>{let d=typeof h.getLabel=="function"?h.getLabel():"";return!(d!=null&&d.includes("SUPER_ROOT"))}),l=[];for(let h of a){let d=h.getPosition().clone();d.sub(e,e),l.push(new Os(h,d,!0))}for(let h of a){let d=h.getPosition().clone();d.add(h.getSize().x+e,h.getSize().y+e),l.push(new Os(h,d,!1))}l.sort((h,d)=>s.dotProduct(h.getSecond().clone())-s.dotProduct(d.getSecond().clone()));let c=new Wu((h,d)=>i.dotProduct(h.getPosition().clone())-i.dotProduct(d.getPosition().clone())),g=new Map;for(let h of l){let d=h.getFirst();if(h.getThird()){c.add(d);let f=c.headSet(d);f.length>0&&g.set(d,f[f.length-1]),c.tailSet(d).length>1&&g.set(this._getRightElement(c,d),d)}else{let f=c.headSet(d);if(f.length>0){let P=f[f.length-1];P===g.get(d)&&d.getProperty(L.COMPACT_CONSTRAINTS).push(P)}if(c.tailSet(d).length>1){let P=this._getRightElement(c,d);g.get(P)===d&&P.getProperty(L.COMPACT_CONSTRAINTS).push(d)}c.remove(d)}}}_getRightElement(t,e){let o=t.tailSet(e);if(o.length<=1)throw new Error("NullPointerException: no right element");return o[1]}_getLowestDependentNode(t,e){let o=t.getProperty(L.COMPACT_CONSTRAINTS);if(o==null||o.length<1)return null;if(o.length===1)return o[0];let r=o[0];switch(e){case R.LEFT:for(let i of o)i.getPosition().x<r.getPosition().x&&(r=i);break;case R.RIGHT:for(let i of o)i.getPosition().x+i.getSize().x>r.getPosition().x+r.getSize().x&&(r=i);break;case R.UP:for(let i of o)i.getPosition().y<r.getPosition().y&&(r=i);break;case R.DOWN:for(let i of o)i.getPosition().y+i.getSize().y>r.getPosition().y+r.getSize().y&&(r=i);break}return r}},Wu=class{constructor(t){this._compare=t,this._items=[]}add(t){this._items.push(t),this._items.sort(this._compare)}remove(t){let e=this._items.indexOf(t);e>=0&&this._items.splice(e,1)}headSet(t){let e=this._items.indexOf(t);if(e<0){let o=0;for(;o<this._items.length&&this._compare(this._items[o],t)<0;)o++;return this._items.slice(0,o)}return this._items.slice(0,e)}tailSet(t){let e=this._items.indexOf(t);if(e<0){let o=0;for(;o<this._items.length&&this._compare(this._items[o],t)<0;)o++;return this._items.slice(o)}return this._items.slice(e)}};var Pc=class{process(t,e){e.begin("Process graph bounds",1);let o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let a of t.getNodes()){let l=a.getPosition(),c=a.getSize();l.x<o&&(o=l.x),l.y<r&&(r=l.y),l.x+c.x>i&&(i=l.x+c.x),l.y+c.y>s&&(s=l.y+c.y)}t.setProperty(L.GRAPH_XMIN,o),t.setProperty(L.GRAPH_YMIN,r),t.setProperty(L.GRAPH_XMAX,i),t.setProperty(L.GRAPH_YMAX,s),e.done()}};var Oc=class{process(t,e){e.begin("Untreeify",1);let o=t.getProperty(L.REMOVABLE_EDGES);for(let r of o)r.getSource().getOutgoingEdges().push(r),r.getTarget().getIncomingEdges().push(r);e.done()}};var pt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.ROOT_PROC:return new gc;case n.FAN_PROC:return new hc;case n.LEVEL_PROC:return new dc;case n.NEIGHBORS_PROC:return new fc;case n.LEVEL_HEIGHT:return new uc;case n.LEVEL_COORDS:return new _c;case n.DIRECTION_PROC:return new pc;case n.NODE_POSITION_PROC:return new Ec;case n.COMPACTION_PROC:return new mc;case n.GRAPH_BOUNDS_PROC:return new Pc;case n.DETREEIFYING_PROC:return new Oc;default:throw new Error(`No implementation available for processor ${this}`)}}};pt.ROOT_PROC=new pt("ROOT_PROC",0);pt.FAN_PROC=new pt("FAN_PROC",1);pt.LEVEL_PROC=new pt("LEVEL_PROC",2);pt.NEIGHBORS_PROC=new pt("NEIGHBORS_PROC",3);pt.LEVEL_HEIGHT=new pt("LEVEL_HEIGHT",4);pt.DIRECTION_PROC=new pt("DIRECTION_PROC",5);pt.NODE_POSITION_PROC=new pt("NODE_POSITION_PROC",6);pt.COMPACTION_PROC=new pt("COMPACTION_PROC",7);pt.LEVEL_COORDS=new pt("LEVEL_COORDS",8);pt.GRAPH_BOUNDS_PROC=new pt("GRAPH_BOUNDS_PROC",9);pt.DETREEIFYING_PROC=new pt("DETREEIFYING_PROC",10);pt.VALUES=[pt.ROOT_PROC,pt.FAN_PROC,pt.LEVEL_PROC,pt.NEIGHBORS_PROC,pt.LEVEL_HEIGHT,pt.DIRECTION_PROC,pt.NODE_POSITION_PROC,pt.COMPACTION_PROC,pt.LEVEL_COORDS,pt.GRAPH_BOUNDS_PROC,pt.DETREEIFYING_PROC];var Sc=class{constructor(){this._visited=null,this._eliminated=null}process(t,e){e.begin("DFS Treeifying phase",1),this._init(t),this._collectEdges(t),this._eliminated=null,this._visited=null,e.done()}getLayoutProcessorConfiguration(){return K.create().addAfter(Mt.P3_NODE_PLACEMENT,pt.DETREEIFYING_PROC)}_init(t){let e=t.getNodes().length;this._eliminated=[],this._visited=new Array(e).fill(0);let o=0;for(let r of t.getNodes())r.id=o++}_collectEdges(t){let e=t.getProperty(V.SEARCH_ORDER);for(let o of t.getNodes())if(this._visited[o.id]===0){switch(e){case ur.DFS:this._dfs(o);break;case ur.BFS:this._bfs(o);break}this._visited[o.id]=2}for(let o of this._eliminated)SE(o.getSource().getOutgoingEdges(),o),SE(o.getTarget().getIncomingEdges(),o);t.setProperty(L.REMOVABLE_EDGES,this._eliminated)}_dfs(t){this._visited[t.id]=1;for(let e of t.getOutgoingEdges()){let o=e.getTarget();this._visited[o.id]===1?this._eliminated.push(e):this._visited[o.id]===2?this._visited[o.id]=1:this._dfs(o)}}_bfs(t){let e=[t];for(;e.length>0;){let o=e.shift();this._visited[o.id]=1;for(let r of o.getOutgoingEdges()){let i=r.getTarget();this._visited[i.id]===1?this._eliminated.push(r):this._visited[i.id]===2?this._visited[i.id]=1:e.push(i)}}}};function SE(n,t){let e=n.indexOf(t);e>=0&&n.splice(e,1)}function TE(n){return(t,e)=>{var o,r;return((o=t.getProperty(n))!=null?o:0)-((r=e.getProperty(n))!=null?r:0)}}var Tc=class{constructor(){this._weighting=null,this._debug=!1}getLayoutProcessorConfiguration(){return K.create().before(Mt.P2_NODE_ORDERING).add(pt.ROOT_PROC).add(pt.FAN_PROC).add(pt.LEVEL_PROC)}process(t,e){var i;e.begin("Processor arrange node",1),this._debug=t.getProperty(V.DEBUG_MODE),this._debug&&((i=e.log)==null||i.call(e,"NodeOrderer!"));let o=t.getNodes().find(s=>s.getProperty(L.ROOT));if(o==null){e.done();return}this._weighting=t.getProperty(V.WEIGHTING);let r=typeof e.subTask=="function"?e.subTask(1):e;this._weighting===je.FAN||this._weighting===je.DESCENDANTS?this._orderLevelFanDescendants([o],r):this._weighting===je.CONSTRAINT&&this._orderLevelConstraint([o],r),e.done()}_orderLevelFanDescendants(t,e){var g,h;e.begin("Processor arrange level",1);let o=L.FAN;this._weighting===je.DESCENDANTS&&(o=L.DESCENDANTS);let r=0;t.sort(TE(o));let i=t.length,s=!0,a=t.length-1;for(;s&&a>=0;)((g=t[a].getProperty(o))!=null?g:0)===0?i--:s=!1,a--;let l=t.slice(0,i),c=t.slice(i);if(l.length===0)for(let d of c)d.setProperty(L.POSITION,r++);else{let d=l.length;for(let f of l){f.setProperty(L.POSITION,r++);let E=f.getChildrenCopy(),P=typeof e.subTask=="function"?e.subTask(1/d):e;this._orderLevelFanDescendants(E,P),E.sort((I,C)=>{var x,M;return((x=C.getProperty(L.POSITION))!=null?x:0)-((M=I.getProperty(L.POSITION))!=null?M:0)});let S=[];for(let I of E)for(let C of f.getOutgoingEdges())C.getTarget()===I&&S.push(C);f.getOutgoingEdges().length=0;for(let I of S)f.getOutgoingEdges().push(I);let T=f.getOutgoingEdges().length,N=c.length-1;for(s=!0;T>0&&s&&N>=0;){let I=c[N];((h=I.getProperty(o))!=null?h:0)===0?(I.setProperty(L.POSITION,r++),T--,c.splice(N,1)):s=!1,N--}}}e.done()}_orderLevelConstraint(t,e){var l;e.begin("Processor arrange level",1),this._debug&&((l=e.log)==null||l.call(e,"OrderLevelConstraint!"));let o=t.filter(c=>{var g;return((g=c.getProperty(V.POSITION_CONSTRAINT))!=null?g:-1)<0}),r=t.filter(c=>{var h;let g=(h=c.getProperty(V.POSITION_CONSTRAINT))!=null?h:-1;return g<t.length&&g>=0}),i=t.filter(c=>{var g;return((g=c.getProperty(V.POSITION_CONSTRAINT))!=null?g:-1)>=t.length}),s=new Array(t.length).fill(null);for(let c=0;c<r.length;c++){let g=r[c],h=g.getProperty(V.POSITION_CONSTRAINT);h>=0&&h<r.length&&s[h]==null&&(s[h]=g,r.splice(c,1),c--)}for(let c=0;c<r.length;c++){let g=r[c],h=g.getProperty(V.POSITION_CONSTRAINT);for(let d=0;;d++){let f=h+d;if(f<s.length&&f>=0&&s[f]==null){s[f]=g,r.splice(c,1),c--;break}if(f=h-d,f<s.length&&f>=0&&s[f]==null){s[f]=g,r.splice(c,1),c--;break}}}i.sort((c,g)=>{var h,d;return-(((h=c.getProperty(V.POSITION_CONSTRAINT))!=null?h:0)-((d=g.getProperty(V.POSITION_CONSTRAINT))!=null?d:0))});for(let c=s.length-1;c>=0;c--)s[c]==null&&i.length>0&&(s[c]=i[0],i.splice(0,1));for(let c=0;c<s.length;c++)s[c]==null&&o.length>0&&(s[c]=o[0],o.splice(0,1));for(let c=0;c<s.length;c++)s[c].setProperty(L.POSITION,c);let a=t.filter(c=>{var g;return((g=c.getProperty(L.FAN))!=null?g:0)!==0});for(let c of a){let g=c.getChildrenCopy(),h=typeof e.subTask=="function"?e.subTask(1/a.length):e;this._orderLevelConstraint(g,h),g.sort(TE(L.POSITION));let d=[];for(let f of g)for(let E of c.getOutgoingEdges())E.getTarget()===f&&d.push(E);c.getOutgoingEdges().length=0;for(let f of d)c.getOutgoingEdges().push(f)}e.done()}};var Nc=class{constructor(){this._spacing=0,this._xTopAdjustment=0,this._yTopAdjustment=0,this._direction=R.UNDEFINED}getLayoutProcessorConfiguration(){return K.create().addBefore(Mt.P2_NODE_ORDERING,pt.ROOT_PROC).before(Mt.P3_NODE_PLACEMENT).add(pt.LEVEL_HEIGHT).add(pt.NEIGHBORS_PROC).before(Mt.P4_EDGE_ROUTING).add(pt.DIRECTION_PROC).add(pt.NODE_POSITION_PROC)}process(t,e){e.begin("Processor order nodes",2),this._spacing=t.getProperty(V.SPACING_NODE_NODE),this._direction=t.getProperty(V.DIRECTION),this._direction===R.UNDEFINED&&(this._direction=R.DOWN,t.setProperty(V.DIRECTION,this._direction));let o=[];for(let i of t.getNodes())i.getProperty(L.ROOT)&&o.push(i);let r=o[0];this._firstWalk(r,0),e.worked(1),this._secondWalk(r,this._yTopAdjustment-r.getProperty(L.LEVELHEIGHT)/2,this._xTopAdjustment),e.worked(1),e.done()}_firstWalk(t,e){var r;t.setProperty(L.MODIFIER,0);let o=t.getProperty(L.LEFTSIBLING);if(t.isLeaf())if(o!=null){let i=o.getProperty(L.PRELIM)+this._spacing+this._meanNodeWidth(o,t);t.setProperty(L.PRELIM,i)}else t.setProperty(L.PRELIM,0);else{for(let c of t.getChildren())this._firstWalk(c,e+1);let i=t.getChildrenCopy(),s=(r=i[0])!=null?r:null,l=((i.length>0?i[i.length-1]:null).getProperty(L.PRELIM)+s.getProperty(L.PRELIM))/2;if(o!=null){let c=o.getProperty(L.PRELIM)+this._spacing+this._meanNodeWidth(o,t);t.setProperty(L.PRELIM,c),t.setProperty(L.MODIFIER,t.getProperty(L.PRELIM)-l),this._apportion(t,e)}else t.setProperty(L.PRELIM,l)}}_apportion(t,e){var a,l;let r=(a=t.getChildrenCopy()[0])!=null?a:null,i=r!=null?r.getProperty(L.LEFTNEIGHBOR):null,s=1;for(;r!=null&&i!=null;){let c=0,g=0,h=r,d=i;for(let T=0;T<s;T++)h=h.getParent(),d=d.getParent(),g+=h.getProperty(L.MODIFIER),c+=d.getProperty(L.MODIFIER);let f=i.getProperty(L.PRELIM),E=r.getProperty(L.PRELIM),P=this._meanNodeWidth(r,i),S=f+c+this._spacing+P-E-g;if(S>0){let T=t,N=0;for(;T!=null&&T!==d;)N++,T=T.getProperty(L.LEFTSIBLING);if(T!=null){let I=S/N;for(T=t;T!==d;){let C=T.getProperty(L.PRELIM)+S;T.setProperty(L.PRELIM,C);let x=T.getProperty(L.MODIFIER)+S;T.setProperty(L.MODIFIER,x),S-=I,T=T.getProperty(L.LEFTSIBLING)}}else return}if(s++,r.isLeaf())r=Ro.getLeftMost(t.getChildren(),s);else{let T=[];for(let N of r.getChildren()){T.push(N);break}r=(l=T[0])!=null?l:null}i=r!=null?r.getProperty(L.LEFTNEIGHBOR):null}}_meanNodeWidth(t,e){let o=0;return t!=null&&(this._direction.isVertical()?o+=t.getSize().x/2:o+=t.getSize().y/2),e!=null&&(this._direction.isVertical()?o+=e.getSize().x/2:o+=e.getSize().y/2),o}_secondWalk(t,e,o){var r;if(t!=null){let i=t.getProperty(L.PRELIM)+o,s=e+t.getProperty(L.LEVELHEIGHT)/2;if(t.setProperty(L.XCOOR,Math.round(i)),t.setProperty(L.YCOOR,Math.round(s)),!t.isLeaf()){let a=[];for(let l of t.getChildren()){a.push(l);break}this._secondWalk((r=a[0])!=null?r:null,e+t.getProperty(L.LEVELHEIGHT)+this._spacing,o+t.getProperty(L.MODIFIER))}t.getProperty(L.RIGHTSIBLING)!=null&&this._secondWalk(t.getProperty(L.RIGHTSIBLING),e,o)}}};var yc=class{constructor(t,e,o,r){this._neighborOne=t,this._neighborTwo=e,this._graph=r,this._bendPoints=[o],this._d=r.getProperty(V.DIRECTION),this._nodeBendpointPadding=r.getProperty(V.SPACING_EDGE_NODE),this._onFirstNodeSide=!1,this._onLastNodeSide=!1,this._updateBendPoints()}getNeighborOne(){return this._neighborOne}getNeighborTwo(){return this._neighborTwo}isOnFirstNodeSide(){return this._onFirstNodeSide}isOnLastNodeSide(){return this._onLastNodeSide}addBendPoints(t){this._bendPoints.push(t),this._d.isHorizontal()?this._bendPoints.sort((e,o)=>e.getThird().getTarget().getPosition().y-o.getThird().getTarget().getPosition().y):this._bendPoints.sort((e,o)=>e.getThird().getTarget().getPosition().x-o.getThird().getTarget().getPosition().x),this._updateBendPoints()}_updateBendPoints(){let t=0,e=this._bendPoints.length;for(let o of this._bendPoints){let r,i,s,a=(t+1)/(e+1);if(this._neighborOne==null&&this._neighborTwo==null)return;this._neighborOne!=null&&this._neighborTwo==null?(this._onLastNodeSide=!0,this._d===R.LEFT?(s=this._neighborOne.getPosition().y+this._neighborOne.getSize().y+this._nodeBendpointPadding*(t+1),r=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborOne.getPosition().y+this._neighborOne.getSize().y+this._nodeBendpointPadding*(t+1),r=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborOne.getPosition().x+this._neighborOne.getSize().x+this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborOne.getPosition().x+this._neighborOne.getSize().x+this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding))):this._neighborOne!=null&&this._neighborTwo!=null?this._d===R.LEFT?(s=this._neighborTwo.getPosition().y*a+(this._neighborOne.getPosition().y+this._neighborOne.getSize().y)*(1-a),r=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborTwo.getPosition().y*a+(this._neighborOne.getPosition().y+this._neighborOne.getSize().y)*(1-a),r=new O(this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborTwo.getPosition().x*a+(this._neighborOne.getPosition().x+this._neighborOne.getSize().x)*(1-a),r=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborTwo.getPosition().x*a+(this._neighborOne.getPosition().x+this._neighborOne.getSize().x)*(1-a),r=new O(s,this._neighborOne.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborOne.getProperty(L.LEVELMAX)+this._nodeBendpointPadding)):(this._onFirstNodeSide=!0,this._d===R.LEFT?(s=this._neighborTwo.getPosition().y-this._nodeBendpointPadding*(t+1),r=new O(this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s),i=new O(this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s)):this._d===R.RIGHT?(s=this._neighborTwo.getPosition().y-this._nodeBendpointPadding*(t+1),r=new O(this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding,s),i=new O(this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding,s)):this._d===R.UP?(s=this._neighborTwo.getPosition().x-this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding),i=new O(s,this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding)):(s=this._neighborTwo.getPosition().x-this._nodeBendpointPadding*(t+1),r=new O(s,this._neighborTwo.getProperty(L.LEVELMIN)-this._nodeBendpointPadding),i=new O(s,this._neighborTwo.getProperty(L.LEVELMAX)+this._nodeBendpointPadding))),o.getFirst().x=r.x,o.getFirst().y=r.y,o.getSecond().x=i.x,o.getSecond().y=i.y,t++}}};var Ic=class n{constructor(){this._steepEndEdgeTheresholdDistance=50,this._steepEndEdgeRatio=5.3,this._steepEndEdgeSampleHeight=40}getLayoutProcessorConfiguration(){return K.create().before(Mt.P4_EDGE_ROUTING).add(pt.LEVEL_COORDS).add(pt.COMPACTION_PROC).add(pt.GRAPH_BOUNDS_PROC)}process(t,e){e.begin("Edge routing",1);let o=t.getProperty(V.EDGE_ROUTING_MODE);if(o===ms.MIDDLE_TO_MIDDLE)this._middleToMiddle(t);else if(o===ms.AVOID_OVERLAP){this._avoidOverlap(t);for(let r of t.getEdges())r.getBendPoints().size()<2&&this._middleToMiddleEdgeRoute(r)}e.done()}_middleToMiddle(t){for(let e of t.getEdges())this._middleToMiddleEdgeRoute(e)}_middleToMiddleEdgeRoute(t){let e=t.getBendPoints(),o=t.getSource(),r=t.getTarget(),i=new O(o.getPosition().x+o.getSize().x/2,o.getPosition().y+o.getSize().y/2),s=new O(r.getPosition().x+r.getSize().x/2,r.getPosition().y+r.getSize().y/2);e.addFirst(i),e.addLast(s),Ro.toNodeBorder(i,e.get(1),o.getSize()),Ro.toNodeBorder(s,e.get(e.size()-2),r.getSize())}_avoidOverlap(t){let e=t.getProperty(V.DIRECTION),o=t.getProperty(V.SPACING_EDGE_NODE),r=t.getProperty(V.EDGE_END_TEXTURE_LENGTH);this._avoidOverlapSetStartPoints(t,e,o),this._avoidOverlapSpecialEdges(t,e,o,r),this._avoidOverlapSetEndPoints(t,e,o,r)}_avoidOverlapSpecialEdges(t,e,o,r){let i=0,s=0,a=new Map,l=0;for(let E of t.getNodes()){let P=E.getProperty(V.TREE_LEVEL);P>l&&(l=P)}l++;let c=new Array(l).fill(0),g=new Array(l).fill(0),h=new Set,d=[];for(let E of t.getEdges())h.has(E)||(h.add(E),d.push(E));let f=e===R.LEFT||e===R.RIGHT;for(let E of d){let P=E.getSource().getProperty(V.TREE_LEVEL),S=E.getTarget().getProperty(V.TREE_LEVEL),T=S-P;if(T>1)for(let N=P+1;N<S;N++){let I=t.getNodes().filter(X=>X.getProperty(V.TREE_LEVEL)===N),C=0,x=(N-P)/(S-P);if(f){I.sort((tt,ot)=>tt.getPosition().y-ot.getPosition().y);let X=E.getSource().getPosition().y*(1-x)+E.getTarget().getPosition().y*x;for(C=0;C<I.length&&!(I[C].getPosition().y>X);C++);}else{I.sort((tt,ot)=>tt.getPosition().x-ot.getPosition().x);let X=E.getSource().getPosition().x*(1-x)+E.getTarget().getPosition().x*x;for(C=0;C<I.length&&!(I[C].getPosition().x>X);C++);}if(I.length>0){let X=E.getBendPoints(),tt=X.size()===0?new O(E.getSource().getPosition().x,E.getSource().getPosition().y):X.getLast(),ot=I[I.length-1],Lt=new O(ot.getPosition().x+ot.getSize().x,ot.getPosition().y+ot.getSize().y),zt=I[0],be=new O(zt.getPosition().x+zt.getSize().x,zt.getPosition().y+zt.getSize().y);if(f){if(C>=I.length-1&&tt.y>Lt.y&&E.getTarget().getPosition().y>Lt.y||C<=0&&tt.y<be.x&&E.getTarget().getPosition().y<be.y)continue}else if(C>=I.length-1&&tt.x>Lt.x&&E.getTarget().getPosition().x>Lt.x||C<=0&&tt.x<be.x&&E.getTarget().getPosition().x<be.x)continue}let M=new O,A=new O;E.getBendPoints().add(M),E.getBendPoints().add(A);let B=new Os(M,A,E),Y=Ro.getUniqueLong(N,C),j=a.get(Y);j==null?(j=new yc(C===0?null:I[C-1],C===I.length?null:I[C],B,t),a.set(Y,j)):j.addBendPoints(B),f?(j.isOnFirstNodeSide()&&j.getNeighborTwo()!=null&&j.getNeighborTwo().getPosition().y<=t.getProperty(L.GRAPH_YMIN)&&i++,j.isOnLastNodeSide()&&j.getNeighborOne()!=null&&j.getNeighborOne().getPosition().y+j.getNeighborOne().getSize().y>=t.getProperty(L.GRAPH_YMAX)&&s++):(j.isOnFirstNodeSide()&&j.getNeighborTwo()!=null&&j.getNeighborTwo().getPosition().x<=t.getProperty(L.GRAPH_XMIN)&&i++,j.isOnLastNodeSide()&&j.getNeighborOne()!=null&&j.getNeighborOne().getPosition().x+j.getNeighborOne().getSize().x>=t.getProperty(L.GRAPH_XMAX)&&s++)}else if(T===0)this._middleToMiddleEdgeRoute(E);else if(T<0){c[P]++,g[S]++;let N=this._avoidOverlapHandleCycleInducingEdges(E,e,t,i,s,o,r,g[S],c[P]);i=N[0],s=N[1]}}}_avoidOverlapHandleCycleInducingEdges(t,e,o,r,i,s,a,l,c){let g=t.getSource(),h=t.getTarget(),d=o.getNodes(),f=0,E;if(e===R.LEFT||e===R.RIGHT){let S=0;for(let T of d)S+=T.getPosition().y+T.getSize().y/2;if(E=S/d.length,g.getPosition().y+g.getSize().y/2>E){i++;let T=-1/0;for(let N of d){let I=N.getPosition().y+N.getSize().y+s*i;I>T&&(T=I)}f=T}else{r++;let T=1/0;for(let N of d){let I=N.getPosition().y-s*r;I<T&&(T=I)}f=T}}else{let S=0;for(let T of d)S+=T.getPosition().x+T.getSize().x/2;if(E=S/d.length,g.getPosition().x+g.getSize().x/2>E){i++;let T=-1/0;for(let N of d){let I=N.getPosition().x+N.getSize().x+s*i;I>T&&(T=I)}f=T}else{r++;let T=1/0;for(let N of d){let I=N.getPosition().x-s*r;I<T&&(T=I)}f=T}}let P=t.getBendPoints();if(e===R.LEFT){P.add(g.getProperty(L.LEVELMIN)-s,f);let S=h.getPosition().x+h.getSize().x+s+a;P.add(S,f),P.add(S,h.getPosition().y+h.getSize().y/2),P.add(h.getPosition().x+h.getSize().x,h.getPosition().y+h.getSize().y/2)}else if(e===R.RIGHT){P.add(g.getProperty(L.LEVELMAX)+s,g.getPosition().y+g.getSize().y/2),P.add(g.getPosition().x+g.getSize().x+s,f);let S=h.getPosition().x-s-a;P.add(S,f),P.add(S,h.getPosition().y+h.getSize().y/2),P.add(h.getPosition().x,h.getPosition().y+h.getSize().y/2)}else if(e===R.UP){P.add(f,g.getProperty(L.LEVELMIN)-s);let S=h.getPosition().y+h.getSize().y+s+a;P.add(f,S),P.add(h.getPosition().x+h.getSize().x/2,S),P.add(h.getPosition().x+h.getSize().x/2,h.getPosition().y+h.getSize().y+s)}else P.isEmpty()||(P.getLast().y=g.getProperty(L.LEVELMAX)+s*c),P.add(f,g.getProperty(L.LEVELMAX)+s*c),P.add(f,h.getPosition().y-s*l-a);return[r,i]}_avoidOverlapSetStartPoints(t,e,o){for(let r of t.getNodes()){if(r.getLabel()==="SUPER_ROOT")continue;let i=[...r.getOutgoingEdges()];if(i.length===0)continue;e===R.LEFT||e===R.RIGHT?i.sort((a,l)=>n._getFirstPoint(a).y-n._getFirstPoint(l).y):i.sort((a,l)=>n._getFirstPoint(a).x-n._getFirstPoint(l).x);let s=i.length;for(let a=0;a<s;a++){if(r.getProperty(L.COMPACT_LEVEL_ASCENSION)&&!n._isCycleInducing(i[a],e))continue;let l=s===1?.5:(a+1)/(s+1);if(e===R.LEFT){let c=r.getProperty(L.LEVELMIN),g=r.getPosition().y+r.getSize().y*l;i[a].getBendPoints().addFirst(Math.min(c,r.getPosition().x-o),g),i[a].getBendPoints().addFirst(r.getPosition().x,g)}else if(e===R.RIGHT){let c=r.getProperty(L.LEVELMAX)+o,g=r.getPosition().y+r.getSize().y*l;i[a].getBendPoints().addFirst(c,g),i[a].getBendPoints().addFirst(r.getPosition().x+r.getSize().x,g)}else if(e===R.UP){let c=r.getProperty(L.LEVELMIN),g=r.getPosition().x+r.getSize().x*l;i[a].getBendPoints().addFirst(g,Math.min(r.getPosition().y-o,c)),i[a].getBendPoints().addFirst(g,r.getPosition().y)}else{let c=r.getProperty(L.LEVELMAX)+o,g=r.getPosition().x+r.getSize().x*l;i[a].getBendPoints().addFirst(g,c),i[a].getBendPoints().addFirst(g,r.getPosition().y+r.getSize().y)}}}}_avoidOverlapSetEndPoints(t,e,o,r){for(let i of t.getNodes()){if(i.getLabel()==="SUPER_ROOT")continue;let s=[...i.getIncomingEdges()];if(s.length===0)continue;e===R.LEFT||e===R.RIGHT?s.sort((l,c)=>n._getLastPoint(l).y-n._getLastPoint(c).y):s.sort((l,c)=>n._getLastPoint(l).x-n._getLastPoint(c).x);let a=s.length;for(let l=0;l<a;l++){let c=a===1?.5:(1+l)/(a+1),g=s[l].getBendPoints();if(e===R.LEFT){let h=i.getProperty(L.LEVELMAX);i.getPosition().x+i.getSize().x+r<h?g.add(h+o,i.getPosition().y+i.getSize().y*c):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x,i.getPosition().y+i.getSize().y*c)}else if(e===R.RIGHT){let h=i.getProperty(L.LEVELMIN);i.getPosition().x-r>h?g.add(h-o,i.getPosition().y+i.getSize().y*c):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x,i.getPosition().y+i.getSize().y*c)}else if(e===R.UP){let h=i.getProperty(L.LEVELMAX);i.getPosition().y+i.getSize().y+r<h?g.add(i.getPosition().x+i.getSize().x*c,h+o):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x*c,i.getPosition().y+i.getSize().y)}else{let h=i.getProperty(L.LEVELMIN);n._isCycleInducing(s[l],e)?g.add(i.getPosition().x+i.getSize().x*c,g.getLast().y):i.getPosition().y-r>h?g.add(i.getPosition().x+i.getSize().x*c,h-o):g.size()>0&&this._maybeAddSteepBend(g,i,c,r,e),g.add(i.getPosition().x+i.getSize().x*c,i.getPosition().y)}}}}_maybeAddSteepBend(t,e,o,r,i){if(r<=0)return;let s=t.getLast(),a=s.x,l=s.y,c=e.getPosition().x+e.getSize().x/2,g=e.getPosition().y+e.getSize().y/2,h=this._steepEndEdgeSampleHeight,d=this._steepEndEdgeRatio,f=this._steepEndEdgeTheresholdDistance;if(i===R.LEFT||i===R.RIGHT){let E=Math.abs(l-g),P=Math.abs(a-c)/h;if(!(E/P>f))return;let S=e.getPosition().y+e.getSize().y*o;g>l?t.add(i===R.LEFT?e.getPosition().x+e.getSize().x+r/d:e.getPosition().x-r/d,S-r/2):t.add(i===R.LEFT?e.getPosition().x+e.getSize().x+r/d:e.getPosition().x-r/d,S+r/2)}else{let E=Math.abs(a-c),P=Math.abs(l-g)/h;if(!(E/P>f))return;let S=e.getPosition().x+e.getSize().x*o,T=i===R.UP?e.getPosition().y+e.getSize().y+r/d:e.getPosition().y-r/d;c>a?t.add(S-r/2,T):t.add(S+r/2,T)}}static _getFirstPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getTarget().getPosition().x,t.getTarget().getPosition().y):e.getFirst()}static _getLastPoint(t){let e=t.getBendPoints();return e.size()===0?new O(t.getSource().getPosition().x,t.getSource().getPosition().y):e.getLast()}static _isCycleInducing(t,e){let o=Ro.getDirectionVector(e),r=t.getTarget().getPosition().x-t.getSource().getPosition().x,i=t.getTarget().getPosition().y-t.getSource().getPosition().y;return o.x*r+o.y*i<=0}};var Mt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.P1_TREEIFICATION:return new Sc;case n.P2_NODE_ORDERING:return new Tc;case n.P3_NODE_PLACEMENT:return new Nc;case n.P4_EDGE_ROUTING:return new Ic;default:throw new Error(`No implementation available for phase ${this}`)}}};Mt.P1_TREEIFICATION=new Mt("P1_TREEIFICATION",0);Mt.P2_NODE_ORDERING=new Mt("P2_NODE_ORDERING",1);Mt.P3_NODE_PLACEMENT=new Mt("P3_NODE_PLACEMENT",2);Mt.P4_EDGE_ROUTING=new Mt("P4_EDGE_ROUTING",3);Mt.VALUES=[Mt.P1_TREEIFICATION,Mt.P2_NODE_ORDERING,Mt.P3_NODE_PLACEMENT,Mt.P4_EDGE_ROUTING];var Rc=class{constructor(){this._algorithmAssembler=Io.create(Mt.VALUES),this._algorithm=[]}doLayout(t,e){if(e.begin("Tree layout",1),t.getProperty(V.DEBUG_MODE)){let r=new Date,i=String(r.getHours()).padStart(2,"0"),s=String(r.getMinutes()).padStart(2,"0"),a=String(r.getSeconds()).padStart(2,"0");e.log(`MrTree! called at ${i}:${s}:${a}`)}this._updateModules(t);let o=typeof e.subTask=="function"?e.subTask(1):e;return this._layout(t,o),e.done(),t}_updateModules(t){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Mt.P1_TREEIFICATION,Mt.P1_TREEIFICATION),this._algorithmAssembler.setPhase(Mt.P2_NODE_ORDERING,Mt.P2_NODE_ORDERING),this._algorithmAssembler.setPhase(Mt.P3_NODE_PLACEMENT,Mt.P3_NODE_PLACEMENT),this._algorithmAssembler.setPhase(Mt.P4_EDGE_ROUTING,Mt.P4_EDGE_ROUTING),this._algorithm=this._algorithmAssembler.build(t)}_layout(t,e){let o=e!=null?e:new Ie;if(o.begin("Layout",this._algorithm.length),t.getProperty(V.DEBUG_MODE)){e.log(`ELK MrTree uses the following ${this._algorithm.length} modules:`);for(let r=0;r<this._algorithm.length;r++)e.log(` Slot ${r}: ${this._algorithm[r].constructor.name}`)}for(let r of this._algorithm){if(typeof o.isCanceled=="function"&&o.isCanceled())return;let i=typeof o.subTask=="function"?o.subTask(1):o;r.process(t,i)}o.done()}};var Lc=class extends de{constructor(){super(),this._klayTree=new Rc,this._componentsProcessor=new nc,this._defaultWork=.1}layout(t,e){t.getProperty(V.OMIT_NODE_MICRO_LAYOUT)||Go.forGraph(t).execute();let o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e;o.begin("build tGraph",1);let r=new lc,i=r.importGraph(t);o.done(),o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Split graph",1);let s=this._componentsProcessor.split(i);o.done();let a=(1-this._defaultWork*4)/Math.max(s.length,1);for(let l of s){let c=typeof e.subTask=="function"?e.subTask(a):e;this._klayTree.doLayout(l,c)}o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Pack components",1),i=this._componentsProcessor.pack(s),o.done(),o=typeof e.subTask=="function"?e.subTask(this._defaultWork):e,o.begin("Apply layout results",1),r.applyLayout(i),o.done()}};var NE="org.eclipse.elk.mrtree",yE=!1;function IE(){let n=Ht.getInstance(),t=n.getAlgorithmData(NE);if(t)return yE=!0,t;let e=new Se.Builder().id(NE).name("ELK Mr. Tree").description("Tree-based algorithm provided by the Eclipse Layout Kernel.").category("org.eclipse.elk.tree").definingBundleId("org.eclipse.elk.alg.mrtree").providerFactory(()=>new Lc).supportedFeatures(new Set(["DISCONNECTED"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),yE=!0,e}var Re=class{};Re.ROOT_NODE=new m("root");var zu=2*Math.PI,Yu=1e-10,bt=class n{static getSuccessors(t){let e=[],o=new Set(t.children);for(let r of Ee(t)){let i=r.sources||[];if(i.length===0)continue;let s=i[0];if(s&&s.parent!==void 0&&s.children===void 0)continue;let a=r.targets||[];if(a.length===0)continue;let l=Pt(a[0]);l!=null&&!o.has(l)&&e.push(l)}return e}static getSuccessorSet(t){return new Set(n.getSuccessors(t))}static findRoot(t){for(let e of t.children)if([..._i(e)].length===0)return e;return null}static findRootOfNode(t){let e=n.getTreeParent(t);return e==null?t:n.findRootOfNode(e)}static getNumberOfLeaves(t){let e=n.getSuccessors(t);if(e.length===0)return 1;let o=0;for(let r of e)o+=n.getNumberOfLeaves(r);return o}static createPolarComparator(t,e){return(o,r)=>{let i=n._arc(o,t,e),s=n._arc(r,t,e);return Math.abs(i-s)<Yu?0:i<s?-1:1}}static _arc(t,e,o){let r=t.getProperty(ho),i=Math.atan2(r.y+o,r.x);return i<0&&(i+=zu),i+=e,i>zu&&(i-=zu),i}static findLargestNodeInGraph(t){let e=0;for(let o of t.children){let r=Math.sqrt(o.width*o.width+o.height*o.height);r>e&&(e=r);let i=n.findLargestNodeInGraph(o);i>e&&(e=i)}return e}static getNextLevelNodes(t){let e=[];for(let o of t)for(let r of n.getSuccessors(o))e.push(r);return e}static getNextLevelNodeSet(t){let e=new Set;for(let o of t)for(let r of n.getSuccessorSet(o))e.add(r);return e}static getLastLevelNodes(t){let e=[];for(let o of t)e.push(n.getTreeParent(o));return e}static centerNodesOnRadi(t,e,o){t.x=e-t.width/2,t.y=o-t.height/2}static shiftClosestEdgeToRadi(t,e,o){if(Math.abs(e)<Yu&&Math.abs(o)<Yu){t.x=e-t.width/2,t.y=o-t.height/2;return}e<0?o<0?(t.x=e-t.width,t.y=o):(t.x=e-t.width,t.y=o+t.height):o<0?(t.x=e,t.y=o):(t.x=e,t.y=o+t.height)}static getTreeParent(t){let e=[..._i(t)];if(e.length===0)return null;let r=e[0].sources||[];return r.length===0?null:Pt(r[0])}};var Ac=class{calculateWedgeSpace(t){return bt.getNumberOfLeaves(t)}};var Cc=class{calculateWedgeSpace(t){let e=bt.getSuccessors(t),o=t.height,r=t.width,i=Math.sqrt(o*o+r*r),s=0;for(let a of e)s+=this.calculateWedgeSpace(a);return Math.max(s,i)}};var Li=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.LEAF_NUMBER:return new Ac;case n.NODE_SIZE:return new Cc;default:throw new Error(`AnnulusWedgeCriteria.${this}: no implementation available.`)}}};Li.LEAF_NUMBER=new Li("LEAF_NUMBER");Li.NODE_SIZE=new Li("NODE_SIZE");var Ai=class{constructor(){this._compactionStep=1,this._spacing=0,this._root=null}contractLayer(t,e){for(let o of t){let r=o.x+o.width/2,i=o.y+o.height/2,s=this._root,a=s.x+s.width/2,l=s.y+s.height/2,c=r-a,g=i-l,h=Math.sqrt(c*c+g*g);h!==0&&(c*=this._compactionStep/h,g*=this._compactionStep/h,e?(r-=c,i-=g):(r+=c,i+=g),o.x=r-o.width/2,o.y=i-o.height/2)}}moveNode(t,e){let o=this._root,r=o.x+o.width/2,i=o.y+o.height/2,s=t.x+t.width/2,a=t.y+t.height/2,l=s-r,c=a-i,g=Math.sqrt(l*l+c*c);if(g===0)return;let h=l/g,d=c/g;t.x=t.x+h*e,t.y=t.y+d*e}overlap(t,e){let o=t.x-this._spacing/2,r=e.x-this._spacing/2,i=t.y-this._spacing/2,s=e.y-this._spacing/2,a=t.width+this._spacing,l=e.width+this._spacing,c=t.height+this._spacing,g=e.height+this._spacing;return o<r+l&&r<o&&i<s+g&&s<i||r<o+a&&o<r&&s<i+c&&i<s||o<r+l&&r<o&&i<s&&s<i+c||r<o+a&&o<r&&i<s+g&&s<i}overlapLayer(t){if(t.length<2)return!1;let e=!1;for(let o=0;o<t.length;o++)o<t.length-1?e=e||this.overlap(t[o],t[o+1]):e=e||this.overlap(t[o],t[0]);return e}getCompactionStep(){return this._compactionStep}setCompactionStep(t){this._compactionStep=t}getSpacing(){return this._spacing}setSpacing(t){this._spacing=t}setRoot(t){this._root=t}getRoot(){return this._root}};var xc=class extends Ai{constructor(){super(),this._sorter=null,this._lastRadius=0}compact(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Dc);o!=null&&this.setCompactionStep(o);let r=t.getProperty(Pi);this.setSpacing(r);let i=bt.getSuccessors(e);this._sorter!=null&&this._sorter.sort(i),this._contract(i)}_contract(t){if(t.length===0)return;let e=this._overlapping(t),o=!1;for(;!e;)this.contractLayer(t,!0),o=!0,e=this._overlapping(t);o&&this.contractLayer(t,!1);let r=bt.getNextLevelNodes(t);this._sorter!=null&&this._sorter.sort(r),this._lastRadius=this._calculateRadius(t[0]),this._contract(r)}_calculateRadius(t){let e=this.getRoot(),o=t.x-e.x,r=t.y-e.y;return Math.sqrt(o*o+r*r)}_overlapping(t){if(this.overlapLayer(t))return!0;for(let e of t){let o=bt.getTreeParent(e);if(o!=null&&this.overlap(e,o)||this._calculateRadius(e)-this.getSpacing()<=this._lastRadius)return!0}return!1}};var wc=class extends Ai{constructor(){super(),this._leftContour=new Map,this._rightContour=new Map,this._sorter=null}compact(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Dc);o!=null&&this.setCompactionStep(o);let r=t.getProperty(Pi);this.setSpacing(r);let i=bt.getSuccessors(e);this._sorter!=null&&this._sorter.sort(i),this._constructContour(i);let s=[e];for(let a=0;a<2;a++)for(let l=0;l<i.length;l++){let c=[i[l]],g=l<i.length-1?i[l+1]:i[0],h=l===0?i[i.length-1]:i[l-1];this._contractWedge(i[l],s,h,g,c)}}_contractWedge(t,e,o,r,i){let s=this._overlapping(e,o,r,i),a=!1;for(;!s;)this.contractLayer(i,!0),a=!0,s=this._overlapping(e,o,r,i);a&&this.contractLayer(i,!1);let l=bt.getNextLevelNodes(i);l.length>0&&(this._sorter!=null&&this._sorter.sort(l),this._contractWedge(t,i,o,r,l))}_overlapping(t,e,o,r){this._sorter!=null&&this._sorter.sort(r);let i=r[0];if(this._contourOverlap(e,i,!1))return!0;let s=r[r.length-1];if(this._contourOverlap(o,s,!0)||this.overlapLayer(r))return!0;for(let a of r)for(let l of t)if(this.overlap(a,l))return!0;return!1}_contourOverlap(t,e,o){let r=o?this._leftContour.get(t)||[]:this._rightContour.get(t)||[];for(let i of r)if(this.overlap(e,i))return!0;return!1}_constructContour(t){for(let e of t){let o=[e],r=[e];this._leftContour.set(e,o),this._rightContour.set(e,r);let i=bt.getSuccessors(e);if(i.length>0)for(this._sorter!=null&&this._sorter.sort(i),o.push(i[0]),r.push(i[i.length-1]);bt.getNextLevelNodes(i).length>0;)i=bt.getNextLevelNodes(i),this._sorter!=null&&this._sorter.sort(i),o.push(i[0]),r.push(i[i.length-1])}}};var Xo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.RADIAL_COMPACTION:return new xc;case n.WEDGE_COMPACTION:return new wc;case n.NONE:return null;default:throw new Error(`CompactionStrategy.${this}: no implementation available.`)}}};Xo.NONE=new Xo("NONE");Xo.RADIAL_COMPACTION=new Xo("RADIAL_COMPACTION");Xo.WEDGE_COMPACTION=new Xo("WEDGE_COMPACTION");var Mc=class{evaluate(t){let e=0;for(let o of Ee(t)){let r=o.targets||[];if(r.length===0)continue;let i=Pt(r[0]);if(i==null)continue;let s=i.x+i.width/2,a=i.y+i.height/2,l=t.x+t.width/2,c=t.y+t.height/2,g=new O(s-l,a-c),h=new O(g.x,g.y);Ft.clipVector(h,t.width,t.height),g.x-=h.x,g.y-=h.y,l=s-g.x,c=a-g.y;let d=new O(g.x,g.y);Ft.clipVector(d,i.width,i.height),g.x-=d.x,g.y-=d.y,s=l+g.x,a=c+g.y;let f=s-l,E=a-c;e+=Math.sqrt(f*f+E*E)}return e}};var bc=class{evaluate(t){let e=0;for(let o of Ee(t)){let r=o.targets||[];if(r.length===0)continue;let i=Pt(r[0]);if(i==null)continue;let s=i.x+i.width/2,a=i.y+i.height/2,l=i.getProperty(ho),c=t.x+l.x+t.width/2,g=t.y+l.y+t.height,h=s-c,d=a-g;e+=Math.sqrt(h*h+d*d)}return e}};var Gc=class{constructor(){this._root=null}evaluate(t){this._root=t;let e=0,o=bt.getSuccessors(t);for(let r=0;r<o.length;r++)for(let i=r+1;i<o.length;i++)this._isCrossing(o[r],o[i])&&(e+=1);return e}_isCrossing(t,e){let o=this._root.x+this._root.width/2,r=this._root.x+this._root.width/2,i=new O(t.x+t.width/2,t.y+t.height/2),s=t.getProperty(ho);s.x=s.x+o,s.y=s.y+r;let a=(i.y-s.y)/(i.x-s.x),l=i.y-a*i.x,c=new O(e.x+e.width/2,e.y+e.height/2),g=e.getProperty(ho);g.x=g.x+o,g.y=g.y+r;let h=(c.y-g.y)/(c.x-g.x),d=c.y-h*c.x,f=(l-d)/(h-a);return!(s.x<f&&i.x<f||f<s.x&&f<i.x||g.x<f&&c.x<f||f<g.x&&f<c.x)}};var Ko=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NONE:return null;case n.EDGE_LENGTH:return new Mc;case n.EDGE_LENGTH_BY_POSITION:return new bc;case n.CROSSING_MINIMIZATION_BY_POSITION:return new Gc;default:throw new Error(`RadialTranslationStrategy.${this}: no implementation available.`)}}};Ko.NONE=new Ko("NONE");Ko.EDGE_LENGTH=new Ko("EDGE_LENGTH");Ko.EDGE_LENGTH_BY_POSITION=new Ko("EDGE_LENGTH_BY_POSITION");Ko.CROSSING_MINIMIZATION_BY_POSITION=new Ko("CROSSING_MINIMIZATION_BY_POSITION");var ln=class{sort(t){t.sort((e,o)=>{let r=e.getProperty(Fa),i=o.getProperty(Fa);return r-i})}initialize(t){}};var iT=.25*Math.PI,sT=.5*Math.PI,RE=.75*Math.PI,LE=1.25*Math.PI,nT=1.5*Math.PI,AE=1.75*Math.PI,Hc=class{constructor(){this._compRight=bt.createPolarComparator(0,0),this._compLeft=bt.createPolarComparator(Math.PI,0),this._compTop=bt.createPolarComparator(nT,0),this._compBottom=bt.createPolarComparator(sT,0),this._idSorter=null}initialize(t){this._idSorter=new ln;let e=bt.getSuccessors(t);e.sort(this._compRight),this._setIDForNodes(e,0)}_setIDForNodes(t,e){let o=e,r=0;for(let i of t){i.setProperty(Fa,o++);let s=bt.getSuccessors(i),a=Math.atan2(i.y+i.height/2,i.x+i.width/2);a<0&&(a+=2*Math.PI),a<iT||a>AE?s.sort(this._compLeft):a<=AE&&a>LE?s.sort(this._compTop):a<=LE&&a>RE?s.sort(this._compRight):a<=RE&&s.sort(this._compBottom),r=this._setIDForNodes(s,r)}return o}sort(t){if(t.length>0){if(this._idSorter==null){let e=bt.findRootOfNode(t[0]);this.initialize(e)}this._idSorter.sort(t)}}};var Ar=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NONE:return null;case n.POLAR_COORDINATE:return new Hc;case n.ID:return new ln;default:throw new Error(`SortingStrategy.${this}: no implementation available.`)}}};Ar.NONE=new Ar("NONE");Ar.POLAR_COORDINATE=new Ar("POLAR_COORDINATE");Ar.ID=new Ar("ID");var CE=new m("org.eclipse.elk.radial.centerOnRoot",!1),Fa=new m("org.eclipse.elk.radial.orderId",0),ka=new m("org.eclipse.elk.radial.radius",0),xE=new m("org.eclipse.elk.radial.rotate",!1),vc=new m("org.eclipse.elk.radial.rotation.targetAngle",0),DE=new m("org.eclipse.elk.radial.rotation.computeAdditionalWedgeSpace",!1),wE=new m("org.eclipse.elk.radial.rotation.outgoingEdgeAngles",!1),Bc=new m("org.eclipse.elk.radial.compactor",()=>Xo.NONE),Dc=new m("org.eclipse.elk.radial.compactionStepSize",1,0),Ci=new m("org.eclipse.elk.radial.sorter",()=>Ar.NONE),ME=new m("org.eclipse.elk.radial.wedgeCriteria",()=>Li.NODE_SIZE),bE=new m("org.eclipse.elk.radial.optimizationCriteria",()=>Ko.NONE);var aT=360,lT=Math.PI/180,Uc=class{constructor(){this._radius=0,this._sorter=null,this._annulusWedgeCriteria=null,this._optimizer=null,this._root=null}process(t,e){e.begin("Eades radial",1),this._root=t.getProperty(Re.ROOT_NODE),this._radius=t.getProperty(ka),this._sorter=t.getProperty(Ci).create(),this._annulusWedgeCriteria=t.getProperty(ME).create(),this._optimizer=t.getProperty(bE).create(),this._translate(t),e.done()}_translate(t){let e=0,o=Number.MAX_VALUE;if(this._optimizer!=null)for(let r=0;r<aT;r++){let i=r*lT;this._positionNodes(this._root,0,0,2*Math.PI,i);let s=this._optimizer.evaluate(this._root);s<o&&(e=i,o=s)}this._positionNodes(this._root,0,0,2*Math.PI,e)}_positionNodes(t,e,o,r,i){let s=(o+r)/2+i,a=e*Math.cos(s),l=e*Math.sin(s);bt.centerNodesOnRadi(t,a,l);let c=this._annulusWedgeCriteria.calculateWedgeSpace(t),g=2*Math.acos(e/e+this._radius),h,d;g<r-o?(h=g/c,d=(o+r-g)/2):(h=(r-o)/c,d=o);let f=bt.getSuccessors(t);this._sorter!=null&&(this._sorter.initialize(this._root),this._sorter.sort(f));for(let E of f){let P=this._annulusWedgeCriteria.calculateWedgeSpace(E);this._positionNodes(E,e+this._radius,d,d+h*P,i),d+=h*P}}getLayoutProcessorConfiguration(){return null}};var Fc=class{process(t,e){e.begin("Straight Line Edge Routing",1);let o=t.getProperty(Re.ROOT_NODE);o!=null&&this.routeEdges(o),e.done()}routeEdges(t){for(let e of Ee(t)){let o=e.sources||[];if(o.length===0)continue;let r=o[0];if(r&&r.parent!==void 0&&r.children===void 0||e.isHierarchical&&e.isHierarchical())continue;let i=e.targets||[];if(i.length===0)continue;let s=Pt(i[0]);if(s==null)continue;let a=t.x+t.width/2,l=t.y+t.height/2,c=s.x+s.width/2,g=s.y+s.height/2,h=new O(c-a,g-l),d=new O(h.x,h.y);Ft.clipVector(d,t.width,t.height),h.x-=d.x,h.y-=d.y,a=c-h.x,l=g-h.y;let f=new O(h.x,h.y);Ft.clipVector(f,s.width,s.height),h.x-=f.x,h.y-=f.y,c=a+h.x,g=l+h.y;let E=ar(e,!0,!0);E.setStartLocation(a,l),E.setEndLocation(c,g),this.routeEdges(s)}}getLayoutProcessorConfiguration(){return null}};var Ce=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.P1_NODE_PLACEMENT:return new Uc;case n.P2_EDGE_ROUTING:return new Fc;default:throw new Error(`RadialLayoutPhases.${this}: no implementation available.`)}}};Ce.P1_NODE_PLACEMENT=new Ce("P1_NODE_PLACEMENT",0);Ce.P2_EDGE_ROUTING=new Ce("P2_EDGE_ROUTING",1);Ce.VALUES=[Ce.P1_NODE_PLACEMENT,Ce.P2_EDGE_ROUTING];var kc=class extends Ai{constructor(){super(),this._sorter=null}process(t,e){e.begin("Remove overlaps",1),this._removeOverlaps(t),e.done()}_removeOverlaps(t){let e=t.getProperty(Re.ROOT_NODE);this.setRoot(e),this._sorter=t.getProperty(Ci).create();let o=t.getProperty(Pi);this.setSpacing(o);let r=bt.getSuccessors(e);this._extend(r)}_extend(t){if(t.length===0)return;let e=t.map(l=>new O(l.x,l.y));for(;this.overlapLayer(t);)this.contractLayer(t,!1);let o=0,r=0;if(t.length>0){let l=t[0];o=l.x-e[0].x,r=l.y-e[0].y}let i=Math.sqrt(o*o+r*r),s=bt.getNextLevelNodeSet(t);if(s.size>0)for(let l of s)this.moveNode(l,i);let a=[...s];this._sorter!=null&&this._sorter.sort(a),this._extend(a)}};var Wc=class{process(t,e){e.begin("Calculate Graph Size",1);let o=Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let h of t.children){let d=h.getProperty(Nr);o=Math.min(o,h.x-d.left),r=Math.min(r,h.y-d.top),i=Math.max(i,h.x+h.width+d.right),s=Math.max(s,h.y+h.height+d.bottom)}let a=t.getProperty(ns),l=new O(o-a.getLeft(),r-a.getTop()),c=i-o+a.getHorizontal(),g=s-r+a.getVertical();if(t.getProperty(CE)){let h=t.getProperty(Re.ROOT_NODE),d=h.getProperty(Nr),f=h.x+h.width/2+(d.left+d.right)/2-l.x,E=h.y+h.height/2+(d.top+d.bottom)/2-l.y,P=c-f,S=g-E;if(P<c/2){let T=P-f;c+=T,l.x-=T}else{let T=f-P;c+=T}if(S<g/2){let T=S-E;g+=T,l.y-=T}else{let T=E-S;g+=T}}for(let h of t.children)h.x=h.x-l.x,h.y=h.y-l.y;t.getProperty(To)||(t.width=c,t.height=g),t.setProperty(pi,c-a.getHorizontal()),t.setProperty(Ei,g-a.getVertical()),e.done()}};var zc=class{process(t,e){e.begin("Calculate outgoing edge angles",1);let o=t.getProperty(Re.ROOT_NODE);if(o!=null)for(let r of o.getOutgoingEdges()){let i=r.sections||[];if(i.length===0)continue;let s=i[0],a=new O(s.startX,s.startY),l=new O(s.endX,s.endY),c=O.diff(l,a),g=Math.atan2(c.y,c.x),h=r.targets||[];h.length>0&&typeof h[0].setProperty=="function"&&h[0].setProperty(vc,g)}e.done()}};var Yc=class{process(t,e){e.begin("General Compactor",1);let o=t.getProperty(Bc).create();o!=null&&o.compact(t),e.done()}};var Vc=class{rotate(t){let e=t.getProperty(vc);if(t.getProperty(DE)){let r=t.getProperty(Re.ROOT_NODE).getOutgoingEdges();if(r.length>0){let i=r[r.length-1],s=r[0],a=i.targets[0],l=s.targets[0],c=new O(a.x+a.width/2,a.y+a.height/2),g=new O(l.x+l.width/2,l.y+l.height/2),h=e;h<=0&&(h+=2*Math.PI);let d=c.angle(g);d<=0&&(d+=2*Math.PI);let f=Math.atan2(c.y,c.x);f<=0&&(f+=2*Math.PI),e=Math.PI-(f-h+d/2)}}for(let o of t.children){let r=new O(o.x+o.width/2,o.y+o.height/2);r.rotate(e),o.setLocation(r.x-o.width/2,r.y-o.height/2)}}};var Xc=class{process(t,e){e.begin("General Rotator",1),new Vc().rotate(t),e.done()}};var ue=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.OVERLAP_REMOVAL:return new kc;case n.COMPACTION:return new Yc;case n.ROTATION:return new Xc;case n.GRAPH_SIZE_CALCULATION:return new Wc;case n.OUTGOING_EDGE_ANGLES:return new zc;default:throw new Error(`IntermediateProcessorStrategy.${this}: processor is not yet ported.`)}}};ue.OVERLAP_REMOVAL=new ue("OVERLAP_REMOVAL",0);ue.COMPACTION=new ue("COMPACTION",1);ue.ROTATION=new ue("ROTATION",2);ue.GRAPH_SIZE_CALCULATION=new ue("GRAPH_SIZE_CALCULATION",3);ue.OUTGOING_EDGE_ANGLES=new ue("OUTGOING_EDGE_ANGLES",4);ue.VALUES=[ue.OVERLAP_REMOVAL,ue.COMPACTION,ue.ROTATION,ue.GRAPH_SIZE_CALCULATION,ue.OUTGOING_EDGE_ANGLES];var Kc=class extends de{constructor(){super(),this._algorithmAssembler=Io.create(Ce.VALUES)}layout(t,e){let o=this._assembleAlgorithm(t);e.begin("Radial layout",o.length),t.getProperty(So)||Go.forGraph(t).execute();let r=bt.findRoot(t);if(t.setProperty(Re.ROOT_NODE,r),r==null)throw new Error("The given graph is not a tree!");let i=t.getProperty(ka);i===0&&(i=bt.findLargestNodeInGraph(t)),t.setProperty(ka,i);for(let s of o){let a=typeof e.subTask=="function"?e.subTask(1):e;s.process(t,a)}e.done()}_assembleAlgorithm(t){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ce.P1_NODE_PLACEMENT,Ce.P1_NODE_PLACEMENT),this._algorithmAssembler.setPhase(Ce.P2_EDGE_ROUTING,Ce.P2_EDGE_ROUTING);let e=K.create();return e.addBefore(Ce.P2_EDGE_ROUTING,ue.OVERLAP_REMOVAL),t.getProperty(Bc)!==Xo.NONE&&e.addBefore(Ce.P2_EDGE_ROUTING,ue.COMPACTION),t.getProperty(xE)&&e.addBefore(Ce.P2_EDGE_ROUTING,ue.ROTATION),e.addBefore(Ce.P2_EDGE_ROUTING,ue.GRAPH_SIZE_CALCULATION),t.getProperty(wE)&&e.addAfter(Ce.P2_EDGE_ROUTING,ue.OUTGOING_EDGE_ANGLES),this._algorithmAssembler.addProcessorConfiguration(e),this._algorithmAssembler.build(t)}};var GE="org.eclipse.elk.radial",HE=!1;function vE(){let n=Ht.getInstance(),t=n.getAlgorithmData(GE);if(t)return HE=!0,t;let e=new Se.Builder().id(GE).name("ELK Radial").description("Radial layout provider for tree graphs.").category("org.eclipse.elk.tree").definingBundleId("org.eclipse.elk.alg.radial").providerFactory(()=>new Kc).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),HE=!0,e}var Le=class{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}};Le.P1_WIDTH_APPROXIMATION=new Le("P1_WIDTH_APPROXIMATION",0);Le.P2_PACKING=new Le("P2_PACKING",1);Le.P3_WHITESPACE_ELIMINATION=new Le("P3_WHITESPACE_ELIMINATION",2);Le.VALUES=[Le.P1_WIDTH_APPROXIMATION,Le.P2_PACKING,Le.P3_WHITESPACE_ELIMINATION];var $=class{};$.ADDITIONAL_HEIGHT=new m("additionalHeight");$.DRAWING_HEIGHT=new m("drawingHeight");$.DRAWING_WIDTH=new m("drawingWidth");$.MIN_HEIGHT=new m("minHeight");$.MIN_WIDTH=new m("minWidth");$.ROWS=new m("rows");$.TARGET_WIDTH=new m("targetWidth");$.MIN_ROW_INCREASE=new m("minRowIncrease",0);$.MAX_ROW_INCREASE=new m("maxRowIncrease",0);$.MIN_ROW_DECREASE=new m("minRowDecrease",0);$.MAX_ROW_DECREASE=new m("maxRowDecrease",0);var Lo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Lo.ASPECT_RATIO_DRIVEN=new Lo("ASPECT_RATIO_DRIVEN");Lo.MAX_SCALE_DRIVEN=new Lo("MAX_SCALE_DRIVEN");Lo.AREA_DRIVEN=new Lo("AREA_DRIVEN");var Be=class{static computeScaleMeasure(t,e,o){return Math.min(o/t,1/e)}static resetCoordinates(t){for(let e of t)e.setLocation(0,0)}static calculateDimensions(t,e){let o=0,r=0,i=0;for(let s of t)o=Math.max(o,s.getWidth()),r+=s.getHeight()+(i>0&&e||0),i++;return new O(o,r)}static calculateDimensionsOfRectangles(t){let e=0,o=0;for(let r of t)e=Math.max(r.width+r.x,e),o=Math.max(r.height+r.y,o);return new O(e,o)}};var Ss=class{constructor(t,e,o,r,i=0,s=0){this._dar=t,this._drawingWidth=e,this._drawingHeight=o,this._placementOption=r,this._nextXcoordinate=i,this._nextYcoordinate=s,this._area=0,this._aspectRatio=0,this._scaleMeasure=0,this._calcAreaAspectRatioScaleMeasure()}_calcAreaAspectRatioScaleMeasure(){this._drawingWidth>0&&this._drawingHeight>0&&(this._area=this._drawingWidth*this._drawingHeight,this._aspectRatio=this._drawingWidth/this._drawingHeight,this._scaleMeasure=Be.computeScaleMeasure(this._drawingWidth,this._drawingHeight,this._dar))}getDrawingWidth(){return this._drawingWidth}setDrawingWidth(t){this._drawingWidth=t,this._calcAreaAspectRatioScaleMeasure()}getDrawingHeight(){return this._drawingHeight}setDrawingHeight(t){this._drawingHeight=t,this._calcAreaAspectRatioScaleMeasure()}getScaleMeasure(){return this._scaleMeasure}getArea(){return this._area}getAspectRatio(){return this._aspectRatio}getPlacementOption(){return this._placementOption}setPlacementOption(t){this._placementOption=t}getNextXcoordinate(){return this._nextXcoordinate}setNextXcoordinate(t){this._nextXcoordinate=t}getNextYcoordinate(){return this._nextYcoordinate}setNextYcoordinate(t){this._nextYcoordinate=t}getDesiredAspectRatio(){return this._dar}};var Ot=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT=new Ot("CANDIDATE_POSITION_LAST_PLACED_RIGHT");Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW=new Ot("CANDIDATE_POSITION_LAST_PLACED_BELOW");Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT=new Ot("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT");Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW=new Ot("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW");Ot.WHOLE_DRAWING=new Ot("WHOLE_DRAWING");var Ts=class{constructor(t,e,o){this._x=t,this._y=e,this._width=0,this._height=0,this._nodeNodeSpacing=o,this._rects=[]}addRectangle(t){return t.x=this._x+this._width+(this._rects.length===0?0:this._nodeNodeSpacing),t.y=this._y,this._height=Math.max(this._height,t.height),this._width+=t.width+(this._rects.length===0?0:this._nodeNodeSpacing),this._rects.push(t),!0}removeRectangle(t,e){let o=this._rects.indexOf(t);o>=0&&this._rects.splice(o,1),e&&this.updateRow()}updateRow(){let t=0,e=0;for(let o of this._rects)o.x=this._x+t,o.y=this._y,t+=o.width+this._nodeNodeSpacing,e=Math.max(e,o.height+this._nodeNodeSpacing);this._width=t-this._nodeNodeSpacing,this._height=e-this._nodeNodeSpacing}expand(t,e,o){let r=(t-this._width)/this._rects.length;this._height+=e,this._width=t;let i=0;for(let s of this._rects){let a=s.width,l=s.height;s.x=s.x+i*r,s.y=s.y+o*e,s.width=s.width+r,s.height=this._height,i++;let c=s.width,g=s.height;Vs(s,new O(c,g),new O(a,l))}}getY(){return this._y}setY(t){this._y=t}getX(){return this._x}setX(t){this._x=t}getWidth(){return this._width}getHeight(){return this._height}getNodes(){return this._rects}};var cn=class{constructor(t,e,o,r){this._smallestRectWidth=Number.POSITIVE_INFINITY,this._minWidth=0,this._width=0,this._minHeight=0,this._smallestRectHeight=Number.POSITIVE_INFINITY,this._averageHeight=0,this._maxHeight=0,this._height=0,this._children=[],this._rows=[],this._x=t,this._y=e,this._parentRow=o,this._stack=null,this._nodeNodeSpacing=r,this._fixed=!1,this._positionFixed=!1}addChild(t){this._rows.length===0&&this._rows.push(new Ts(this._x,this._y,this._nodeNodeSpacing)),this._children.push(t),this._rows[this._rows.length-1].addRectangle(t),this._adjustSizeAdd(t)}addChildInNewRow(t){this._children.push(t);let e=this.getLastRow();this._rows.push(new Ts(this._x,e.getY()+e.getHeight()+this._nodeNodeSpacing,this._nodeNodeSpacing)),this.getLastRow().addRectangle(t),this._adjustSizeAdd(t)}removeChild(t){let e=this._children.indexOf(t);e>=0&&this._children.splice(e,1);for(let o=0;o<this._rows.length;o++){let r=this._rows[o];if(r.getNodes().includes(t)){r.removeRectangle(t,!0),r.getNodes().length===0&&this._rows.splice(o,1);break}}this._adjustSizeAfterRemove()}setLocation(t,e){this._adjustChildrensXandY(t-this._x,e-this._y);for(let o of this._rows)o.setX(o.getX()+t-this._x),o.setY(o.getY()+e-this._y);this._x=t,this._y=e}_adjustChildrensXandY(t,e){for(let o of this._children)o.setLocation(o.x+t,o.y+e)}_adjustSizeAdd(t){let e=this.getLastRow().getWidth();this._smallestRectWidth=Math.min(this._smallestRectWidth,t.width),this._width=Math.max(this._width,e),this._minWidth=Math.max(this._minWidth,t.width+(this._children.length===1?0:this._nodeNodeSpacing)),this._smallestRectHeight=Math.min(this._smallestRectHeight,t.height),this._maxHeight+=t.height+(this._children.length===1?0:this._nodeNodeSpacing),this._minHeight=Math.max(this._minHeight,t.height);let o=this._rows.length>0?(this._rows.length-1)*this._nodeNodeSpacing:0;for(let r of this._rows)o+=r.getHeight();this._height=o,this._averageHeight=this._maxHeight/this._children.length-this._nodeNodeSpacing*((this._children.length-1)/this._children.length),this._parentRow.notifyAboutNodeChange()}getWidthForTargetHeight(t){if(this._maxHeight<=t)return this._minWidth;if(this._placeRectsInWH(this._minWidth,t,!1))return this._minWidth;let e=this._width,o=this._minWidth,r=this._width,i=(e-o)/2+o;for(;o+1<e;)this._placeRectsInWH(i,t,!1)?(r=i,e=i):o=i,i=(e-o)/2+o;return r}getHeightForTargetWidth(t){return this._placeRectsInW(t,!1).height}_placeRectsInW(t,e){let o=0,r=this._y,i=0,s=0,a=0,l=0,c=0;e&&(this._rows.length=0,this._rows.push(new Ts(this._x,this._y,this._nodeNodeSpacing)));let g=0;for(let h of this._children)o+h.width+(g>0?this._nodeNodeSpacing:0)>t&&a>0&&(o=0,r+=a+this._nodeNodeSpacing,i=Math.max(i,l),s+=a+this._nodeNodeSpacing,a=0,l=0,e&&(c++,this._rows.push(new Ts(this._x,r,this._nodeNodeSpacing))),g=0),l+=h.width+(g>0?this._nodeNodeSpacing:0),a=Math.max(a,h.height),e&&this._rows[c].addRectangle(h),o+=h.width+(g>0?this._nodeNodeSpacing:0),g++;return i=Math.max(i,l),s+=a,e&&(this._width=i,this._height=s,this._parentRow.notifyAboutNodeChange()),new dt(this._x,this._y,i,s)}_placeRectsInWH(t,e,o){let r=this._placeRectsInW(t,o);return r.width<=t&&r.height<=e}placeRectsIn(t,e){if(e===void 0){let o=this._width,r=this._height,i=this._placeRectsInW(t,!0);return i.width!==o||i.height!==r}return this._placeRectsInWH(t,e,!0)}_adjustSizeAfterRemove(){let t=0,e=0,o=[],r=0;for(let i of this._rows)i.getNodes().length!==0&&(o.push(i),t=Math.max(t,i.getWidth()),e+=i.getHeight()+(r>0?this._nodeNodeSpacing:0),r++);this._rows=o,this._height=e,this._width=t,this._minWidth=0,this._minHeight=0,this._maxHeight=0,this._smallestRectHeight=Number.POSITIVE_INFINITY,this._smallestRectWidth=Number.POSITIVE_INFINITY;for(let i of this._children)this._smallestRectWidth=Math.min(this._smallestRectWidth,i.width),this._minWidth=Math.max(this._minWidth,i.width),this._minHeight=Math.max(this._minHeight,i.height),this._smallestRectHeight=Math.min(this._smallestRectHeight,i.height),this._maxHeight+=i.height+this._nodeNodeSpacing;this._children.length>0&&(this._averageHeight=this._maxHeight/this._children.length-this._nodeNodeSpacing*((this._children.length-1)/this._children.length)),this._parentRow.notifyAboutNodeChange()}expand(t,e){let o=this._width+t;this._width+=t,this._height+=e;let r=e/this._rows.length,i=0;for(let s of this._rows)s.expand(o,r,i),i++}getWidth(){return this._width}setWidth(t){this._width=t}getHeight(){return this._height}setHeight(t){this._height=t}getChildren(){return this._children}getX(){return this._x}getY(){return this._y}getParentRow(){return this._parentRow}setParentRow(t){this._parentRow=t}getMinWidth(){return this._minWidth}getMinHeight(){return this._minHeight}getMaxHeight(){return this._maxHeight}getSmallestRectHeight(){return this._smallestRectHeight}getSmallestRectWidth(){return this._smallestRectWidth}setSmallestRectWidth(t){this._smallestRectWidth=t}getAverageHeight(){return this._averageHeight}isFixed(){return this._fixed}setFixed(t){this._fixed=t}isPositionFixed(){return this._positionFixed}setPositionFixed(t){this._positionFixed=t}getRows(){return this._rows}getLastRow(){return this._rows[this._rows.length-1]}getLastRowNewX(){let t=this.getLastRow();return t.getX()+t.getWidth()}getLastRowY(){return this.getLastRow().getY()}getStack(){return this._stack}setStack(t){this._stack=t}resetBlock(){this._adjustSizeAfterRemove()}};var xi=class{constructor(t,e,o){this._blocks=[],this._x=t,this._y=e,this._width=0,this._height=0,this._nodeNodeSpacing=o}addBlock(t){t.setStack(this),this._width=Math.max(this._width,t.getWidth()),this._height+=t.getHeight()+(this._blocks.length===0?0:this._nodeNodeSpacing),this._blocks.push(t)}updateDimension(){let t=0,e=0,o=0;for(let r of this._blocks)e=Math.max(e,r.getWidth()),t+=r.getHeight()+(o>0?this._nodeNodeSpacing:0),o++;this._height=t,this._width=e}setLocation(t,e){let o=t-this._x,r=e-this._y;for(let i of this._blocks)i.setLocation(i.getX()+o,i.getY()+r);this._x=t,this._y=e}getWidthForFixedHeight(t){if(this._blocks.length===1)return this._blocks[0].getWidthForTargetHeight(t);let e=this._getMinimumWidth(),o=0,r=this._width,i=e,s=this._width,a=(r-i)/2+i;for(;i+1<r;){o=0;for(let l of this._blocks)o+=l.getHeightForTargetWidth(a);o<t?(s=a,r=a):i=a,a=(r-i)/2+i}return s}placeRectsIn(t){let e=this._y,o=0,r=0;for(let i of this._blocks)i.setLocation(this._x,e),i.placeRectsIn(t),r=Math.max(r,i.getWidth()),e+=i.getHeight()+this._nodeNodeSpacing,o=e;this._width=r,this._height=o}expand(t,e){let o=e/this._blocks.length,r=0;for(let i of this._blocks)i.setLocation(i.getX(),i.getY()+r*o),i.expand(this.getWidth()-i.getWidth()+t,o),r++}_getMinimumWidth(){let t=0;for(let e of this._blocks)t=Math.max(t,e.getMinWidth());return t}getBlocks(){return this._blocks}getX(){return this._x}getY(){return this._y}getWidth(){return this._width}setWidth(t){this._width=t}getHeight(){return this._height}setHeight(t){this._height=t}};var Wa=class{constructor(t,e){this._height=0,this._width=0,this._y=t,this._nodeNodeSpacing=e,this._children=[],this._stacks=[],this._potentialAdditionalWidthToGetLastBlock=0}notifyAboutNodeChange(){let t=0,e=Number.NEGATIVE_INFINITY,o=0;for(let r of this._children)t+=r.getWidth()+(o>0?this._nodeNodeSpacing:0),e=Math.max(e,r.getHeight()),o++;this._width=t,this._height=e}expand(t,e){let r=(t-this._width)/this._stacks.length,i=0;for(let s of this._stacks){let a=this.getHeight()-s.getHeight()+e;s.setLocation(s.getX()+i*r,s.getY()),s.expand(r,a),i++}}calculateBlockStacks(){let t=-1;for(let e of this._children)if(e.getX()!==t){let o=new xi(e.getX(),this._y,this._nodeNodeSpacing);this._stacks.push(o),o.addBlock(e),t=e.getX()}else this._stacks[this._stacks.length-1].addBlock(e)}getFirstBlock(){return this._children[0]}getLastBlock(){return this._children[this._children.length-1]}getNumberOfAssignedBlocks(){return this._children.length}addBlock(t){this._height=Math.max(this._height,t.getHeight()),this._width+=t.getWidth()+(this._children.length===0?0:this._nodeNodeSpacing),this._children.push(t)}removeBlock(t){let e=this._children.indexOf(t);e>=0&&this._children.splice(e,1),this._width-=t.getWidth()+(this._children.length===0?0:this._nodeNodeSpacing);let o=Number.MIN_VALUE;for(let r of this._children)o=Math.max(o,r.getHeight());this._height=o}getHeight(){return this._height}setHeight(t){this._height=t}getWidth(){return this._width}setWidth(t){this._width=t}getY(){return this._y}setY(t){let e=t-this._y;for(let o of this._stacks)o.setLocation(o.getX(),o.getY()+e);this._y=t}getChildren(){return this._children}getStacks(){return this._stacks}getPotentialAdditionalWidthToGetLastBlock(){return this._potentialAdditionalWidthToGetLastBlock}setPotentialAdditionalWidthToGetLastBlock(t){this._potentialAdditionalWidthToGetLastBlock=t}resetStacks(){this._stacks=[]}};var Di=class n{static place(t,e,o){let r=[],i=new Wa(0,o),s=0;i.addBlock(new cn(0,0,i,o));let a=0;for(let l of t){let c=i.getLastBlock();if((a+l.width+(i.getChildren()[0].getChildren().length===0?0:o)>e||l.getProperty(gn))&&(a=0,s+=i.getHeight()+o,r.push(i),i=new Wa(s,o),c=new cn(0,i.getY(),i,o),i.addBlock(c),a=0),c.getChildren().length===0||!l.parent.getProperty(Zc)&&n.isSimilarHeight(c,l,o))c.addChild(l);else{let h=new cn(c.getX()+c.getWidth()+o,i.getY(),i,o);i.addBlock(h),h.addChild(l)}a=l.x+l.width}return r.push(i),r}static placeRectInBlock(t,e,o,r,i){if(n.isSimilarHeight(e,o,i)){if(e.getLastRowNewX()+o.width+i<=r&&(e.getLastRowY()-t.getY()+o.height<=t.getHeight()||t.getChildren().length===1))return e.addChild(o),!0;if(e.getX()+o.width<=r&&e.getY()+e.getHeight()+o.height+i<=t.getY()+t.getHeight())return e.addChildInNewRow(o),!0}return!1}static isSimilarHeight(t,e,o){return e.height>=t.getSmallestRectHeight()&&e.height<=t.getMinHeight()?!0:t.getAverageHeight()*.5<=e.height&&t.getAverageHeight()*1.5>=e.height}};var jc=class n{static compact(t,e,o,r,i){let s=!1,a=!1,l=t+1,c=e[t],g=c.getChildren(),h=null;for(let d=0;d<c.getNumberOfAssignedBlocks();d++){let f=g[d];if(f.isFixed())continue;if(f.getChildren().length===0){c.removeBlock(f),d--,s=!0;continue}if(!f.isPositionFixed()){h!=null&&h.updateDimension();let S=h==null?0:h.getX()+h.getWidth()+r;h=new xi(S,c.getY(),r),f.setLocation(h.getX()+h.getWidth(),c.getY()),c.getStacks().push(h),h.addBlock(f),f.setPositionFixed(!0)}let E=n._getNextBlock(e,c,d,l),P=!1;if(E!=null&&(P=E.getParentRow()!==c),E!=null){if(E.getChildren().length>0&&!E.getChildren()[0].getProperty(gn))n._useRowWidth(f,o),n._absorbBlocks(c,f,E,o,r)&&(s=!0);else{c.removeBlock(E);break}if(E.getChildren().length===0)for(e.length>l&&e[l].removeBlock(E),E=null;e.length>l&&e[l].getChildren().length===0;)e.splice(l,1);if(E==null){d--;continue}if(!E.getChildren()[0].getProperty(gn)&&n._placeBelow(e,c,f,E,P,o,l,r)){s=!0;continue}if(P){let S=c.getHeight(),T=E.getMinHeight();if(!E.getChildren()[0].getProperty(gn)&&n._placeBeside(e,c,f,E,P,o,l,r,i)){if(s=!0,S<T){a=!0,E.setParentRow(c);break}continue}if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0;continue}}else if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0;continue}if(s)continue}if(n._useRowHeight(c,f)){f.setFixed(!0),s=!0,E!=null&&E.setPositionFixed(!1);continue}else f.getStack().updateDimension()}return Gt.of(s,a)}static _getNextBlock(t,e,o,r){return o<e.getNumberOfAssignedBlocks()-1?e.getChildren()[o+1]:r<t.length&&t[r].getChildren().length>0?t[r].getChildren()[0]:null}static _useRowHeight(t,e){let o=!1,r=e.getStack().getWidth();if(e.getHeight()<t.getHeight()){let i=e.getStack().getWidthForFixedHeight(t.getHeight());e.getStack().getWidth()>i&&(e.getStack().placeRectsIn(i),o=r!==e.getStack().getWidth())}return o}static _useRowWidth(t,e){t.placeRectsIn(e-t.getX()),t.getStack().updateDimension()}static _absorbBlocks(t,e,o,r,i){let s=!1,a=o.getChildren()[0];for(;Di.placeRectInBlock(t,e,a,r,i)&&(s=!0,o.removeChild(a),o.getChildren().length!==0);)a=o.getChildren()[0];return o.getChildren().length===0&&o.getParentRow().removeBlock(o),s&&e.getStack().updateDimension(),s}static _placeBelow(t,e,o,r,i,s,a,l){let c=!1,g=s-o.getX(),h=o.getY()-e.getY()+o.getHeightForTargetWidth(g);if(r.getMinWidth()+l>g)return!1;let d=r.getHeightForTargetWidth(g);return h+l+d<=e.getHeight()&&(o.placeRectsIn(s-o.getX()),o.setFixed(!0),r.placeRectsIn(s-o.getX()),r.setLocation(o.getX(),o.getY()+o.getHeight()+l),r.setPositionFixed(!0),o.getStack().addBlock(r),c=!0,i&&(e.addBlock(r),r.setParentRow(e),t.length>a&&(t[a].removeBlock(r),t[a].getChildren().length===0&&t.splice(a,1)))),c}static _placeBeside(t,e,o,r,i,s,a,l,c){let g=!1,h=o.getStack().getWidthForFixedHeight(e.getY()+e.getHeight()-o.getStack().getY()),d=r.getMinHeight()>e.getHeight()&&c,f=s-(o.getStack().getX()+h-l),E=r.getHeightForTargetWidth(f);if(d&&E>r.getMinHeight())return!1;if(d){let S=0;for(let T of e.getStacks())S+=T.getWidthForFixedHeight(r.getMinHeight())+l;f=s-S}if(f<r.getMinWidth())return!1;let P=a===t.length-1&&f>=t[a].getWidth();return!d&&E>e.getHeight()&&!P?!1:((P||d||E<=e.getHeight())&&(P&&E>e.getHeight()?(o.setHeight(E),o.placeRectsIn(o.getWidthForTargetHeight(E))):(o.getStack().placeRectsIn(h),o.setFixed(!0)),r.placeRectsIn(s-(o.getX()+o.getWidth())),r.setLocation(o.getStack().getX()+o.getStack().getWidth(),e.getY()),e.addBlock(r),t.length>a&&(t[a].removeBlock(r),t[a].getChildren().length===0&&t.splice(a,1)),g=!0),g)}};var za=class{constructor(t,e){this._aspectRatio=t,this._nodeNodeSpacing=e,this.potentialRowWidthDecreaseMin=Number.POSITIVE_INFINITY,this.potentialRowWidthDecreaseMax=0,this.potentialRowWidthIncreaseMin=Number.POSITIVE_INFINITY,this.potentialRowWidthIncreaseMax=0}start(t,e,o,r){let i=o.getProperty($.TARGET_WIDTH),s=o.getProperty($.MIN_WIDTH),a=o.getProperty($.MIN_HEIGHT);Be.resetCoordinates(o.children);let l=Di.place(o.children,i,this._nodeNodeSpacing);for(let f=0;f<l.length;f++){let E=l[f];if(f!==0){let S=l[f-1];E.setY(S.getY()+S.getHeight()+this._nodeNodeSpacing)}if(jc.compact(f,l,i,this._nodeNodeSpacing,o.getProperty(Zc)).getSecond()){for(let S of E.getChildren())S.setFixed(!1),S.setPositionFixed(!1),S.resetBlock();E.resetStacks(),E.setWidth(i),f--}else{if(this._adjustWidthAndHeight(E),f+1<l.length){let S=l[f+1].getFirstBlock(),T=E.getWidth()+this._nodeNodeSpacing+S.getWidth()-i;if(this.potentialRowWidthIncreaseMax=Math.max(T,this.potentialRowWidthDecreaseMax),this.potentialRowWidthIncreaseMin=Math.min(T,this.potentialRowWidthDecreaseMin),E.getStacks().length!==0){let N=E.getStacks()[E.getStacks().length-1],I=E.getStacks().length<=1?0:this._nodeNodeSpacing;this.potentialRowWidthDecreaseMax=Math.max(this.potentialRowWidthDecreaseMax,N.getWidth()+I),this.potentialRowWidthDecreaseMin=Math.min(this.potentialRowWidthDecreaseMax,N.getWidth()+I)}}if(l.length===1){let S=E.getStacks()[E.getStacks().length-1],T=S.getBlocks()[S.getBlocks().length-1];for(let N of T.getRows())this.potentialRowWidthDecreaseMax=Math.max(this.potentialRowWidthDecreaseMax,T.getWidth()-N.getWidth()),this.potentialRowWidthDecreaseMin=Math.min(this.potentialRowWidthDecreaseMin,T.getWidth()-N.getWidth()),this.potentialRowWidthIncreaseMax=Math.max(this.potentialRowWidthIncreaseMax,N.getWidth()+this._nodeNodeSpacing),this.potentialRowWidthIncreaseMin=Math.min(this.potentialRowWidthIncreaseMin,N.getWidth()+this._nodeNodeSpacing)}}}let c=Be.calculateDimensions(l,this._nodeNodeSpacing),g=Math.max(c.x,s-r.getHorizontal()),d=Math.max(c.y,a-r.getVertical())-c.y;return o.setProperty($.ADDITIONAL_HEIGHT,d),o.setProperty($.ROWS,l),new Ss(this._aspectRatio,g,c.y+d,Ot.WHOLE_DRAWING)}_adjustWidthAndHeight(t){let e=0,o=0,r=0;for(let i of t.getStacks())i.updateDimension(),e=Math.max(e,i.getHeight()),o+=i.getWidth()+(r>0?this._nodeNodeSpacing:0),r++;t.setHeight(e),t.setWidth(o)}};var _r=new m("org.eclipse.elk.padding",new yt(15)),Cr=new m("org.eclipse.elk.spacing.nodeNode",15,0),Ns=new m("org.eclipse.elk.aspectRatio",1.3),BE=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1);var $c=class{process(t,e){e.begin("Compaction",1);let o=t.children,r=t.getProperty(Ns),i=t.getProperty(Cr),s=t.getProperty(_r),a=new za(r,i),l=a.start(o,e,t,s);this._copyRowWidthChangeValues(t,a);let c=t.getProperty(UE);for(;c>1;){let g=this._clone(t),h=l.getScaleMeasure();this._configureSecondIteration(t,g,l),a=new za(r,i);let d=a.start(o,e,g,s),f=d.getScaleMeasure();if(f>=h&&Number.isFinite(f)){for(let E=0;E<g.children.length;E++)this._copyPosition(g.children[E],t.children[E]);this._copyRowWidthChangeValues(t,a),l.setDrawingWidth(d.getDrawingWidth()),l.setDrawingHeight(d.getDrawingHeight())}c--}t.setProperty($.DRAWING_HEIGHT,l.getDrawingHeight()),t.setProperty($.DRAWING_WIDTH,l.getDrawingWidth()),e.done()}_copyRowWidthChangeValues(t,e){t.setProperty($.MIN_ROW_INCREASE,e.potentialRowWidthIncreaseMin),t.setProperty($.MAX_ROW_INCREASE,e.potentialRowWidthIncreaseMax),t.setProperty($.MIN_ROW_DECREASE,e.potentialRowWidthDecreaseMin),t.setProperty($.MAX_ROW_DECREASE,e.potentialRowWidthDecreaseMax)}_configureSecondIteration(t,e,o){let r=t.getProperty(_r),i=t.getProperty(Ns);t.children.length>1&&t.getProperty($.MIN_ROW_INCREASE)!==Number.POSITIVE_INFINITY&&(o.getDrawingWidth()+r.getHorizontal())/(o.getDrawingHeight()+r.getVertical())<i?e.setProperty($.TARGET_WIDTH,t.getProperty($.TARGET_WIDTH)+t.getProperty($.MIN_ROW_INCREASE)):t.children.length>1&&t.getProperty($.MIN_ROW_DECREASE)!==Number.POSITIVE_INFINITY&&(o.getDrawingWidth()+r.getHorizontal())/(o.getDrawingHeight()+r.getVertical())>i&&e.setProperty($.TARGET_WIDTH,Math.max(t.getProperty($.MIN_WIDTH),e.getProperty($.TARGET_WIDTH)-t.getProperty($.MIN_ROW_DECREASE)))}_clone(t){let e=Oa();typeof t.copyProperties=="function"&&e.copyProperties(t);for(let o of t.children){let r=Fs(e);r.width=o.width,r.height=o.height,r.identifier=o.identifier,r.x=o.x,r.y=o.y,typeof r.copyProperties=="function"&&r.copyProperties(o)}return e}_copyPosition(t,e){e.width=t.width,e.height=t.height,e.x=t.x,e.y=t.y;for(let o=0;o<t.children.length;o++)this._copyPosition(t.children[o],e.children[o])}getLayoutProcessorConfiguration(){return null}};var qc=class{process(t,e){e.begin("Simple Placement",1);let o=t.getProperty($.TARGET_WIDTH),r=t.getProperty(Cr),i=t.getProperty(_r);Be.resetCoordinates(t.children);let s=Di.place(t.children,o,r),a,l=t.children;if(s==null)a=Be.calculateDimensionsOfRectangles(l);else{for(let d of s)for(let f of d.getChildren()){let E=new xi(f.getX(),f.getY(),r);E.addBlock(f),d.getStacks().push(E)}a=Be.calculateDimensions(s,r)}let c=Math.max(a.x,t.getProperty($.MIN_WIDTH)-i.getHorizontal()),g=Math.max(a.y,t.getProperty($.MIN_HEIGHT)-i.getVertical()),h=g-a.y;t.setProperty($.ADDITIONAL_HEIGHT,h),t.setProperty($.DRAWING_WIDTH,c),t.setProperty($.DRAWING_HEIGHT,g+h),t.setProperty($.ROWS,s),e.done()}getLayoutProcessorConfiguration(){return null}};var Jc=class{process(t,e){e.begin("No Compaction",1);let o=t.getProperty(_r),r=t.children,i=Be.calculateDimensionsOfRectangles(r),s=Math.max(i.x,t.getProperty($.MIN_WIDTH)-o.getHorizontal()),a=Math.max(i.y,t.getProperty($.MIN_HEIGHT)-o.getVertical()),l=a-i.y;t.setProperty($.ADDITIONAL_HEIGHT,l),t.setProperty($.DRAWING_WIDTH,s),t.setProperty($.DRAWING_HEIGHT,a+l),e.done()}getLayoutProcessorConfiguration(){return null}};var xr=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.COMPACTION:return new $c;case n.SIMPLE:return new qc;case n.NONE:return new Jc;default:return null}}};xr.COMPACTION=new xr("COMPACTION",0);xr.SIMPLE=new xr("SIMPLE",1);xr.NONE=new xr("NONE",2);var Qc=class{static expand(t,e,o,r){let i=o/t.length,s=0;for(let a of t)a.setY(a.getY()+i*s),a.expand(e,i),s++}};var hn=class{process(t,e){if(e.begin("Equal Whitespace Eliminator",1),t.hasProperty($.ROWS))Qc.expand(t.getProperty($.ROWS),t.getProperty($.DRAWING_WIDTH),t.getProperty($.ADDITIONAL_HEIGHT),t.getProperty(Cr));else throw new Error("The graph does not contain rows.");e.done()}getLayoutProcessorConfiguration(){return null}};var tg=class extends hn{process(t,e){e.begin("To Aspect Ratio Whitespace Eliminator",1);let o=t.getProperty($.DRAWING_WIDTH),r=t.getProperty($.DRAWING_HEIGHT),i=t.getProperty(Ns),s=t.getProperty($.ADDITIONAL_HEIGHT);o/r<i?(o=r*i,t.setProperty($.DRAWING_WIDTH,o)):(s+=o/i-r,t.setProperty($.ADDITIONAL_HEIGHT,s),t.setProperty($.DRAWING_HEIGHT,r+s)),super.process(t,e),e.done()}};var Dr=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.EQUAL_BETWEEN_STRUCTURES:return new hn;case n.TO_ASPECT_RATIO:return new tg;case n.NONE:default:return null}}};Dr.EQUAL_BETWEEN_STRUCTURES=new Dr("EQUAL_BETWEEN_STRUCTURES",0);Dr.TO_ASPECT_RATIO=new Dr("TO_ASPECT_RATIO",1);Dr.NONE=new Dr("NONE",2);var pr=class n{static getWidthLPRorLPB(t,e,o){return Math.max(t,e+o)}static getHeightLPRorLPB(t,e,o){return Math.max(t,e+o)}static calculateYforLPR(t,e,o,r){let i=null,s=0;for(let a of e)if(n._verticalOrderConstraint(a,t,r)){if(i==null)i=a;else{let l=a.y+a.height;o.y-l<o.y-s&&(i=a)}s=i.y+i.height}return i==null?0:s+r}static calculateXforLPB(t,e,o,r){let i=null,s=0;for(let a of e)if(n._horizontalOrderConstraint(a,t,r)){if(i==null)i=a;else{let l=a.x+a.width;o.x-l<o.x-s&&(i=a)}s=i.x+i.width}return i==null?0:s+r}static calculateAreaLPR(t,e,o){let r=t.y+t.height,i=o.getNextYcoordinate()+e.height,a=Math.max(r,i)-Math.min(t.y,o.getNextYcoordinate());return(o.getNextXcoordinate()+e.width-t.x)*a}static calculateAreaLPB(t,e,o){let r=t.x+t.width,i=o.getNextXcoordinate()+e.width,a=Math.max(r,i)-Math.min(t.x,o.getNextXcoordinate()),l=o.getNextYcoordinate()+e.height-t.y;return a*l}static _verticalOrderConstraint(t,e,o){return e<t.x+t.width+o}static _horizontalOrderConstraint(t,e,o){return e<t.y+t.height+o}};var dn=class{filterList(t,e,o){let r=Number.NEGATIVE_INFINITY;for(let s of t){let a=Be.computeScaleMeasure(s.getDrawingWidth()+o.getHorizontal(),s.getDrawingHeight()+o.getVertical(),s.getDesiredAspectRatio());a>r&&(r=a)}let i=[];for(let s of t)Be.computeScaleMeasure(s.getDrawingWidth()+o.getHorizontal(),s.getDrawingHeight()+o.getVertical(),s.getDesiredAspectRatio())===r&&i.push(s);return i}};var fn=class{filterList(t,e,o){let r=Number.POSITIVE_INFINITY;for(let s of t){let a=(s.getDrawingWidth()+o.getHorizontal())*(s.getDrawingHeight()+o.getVertical());a<r&&(r=a)}let i=[];for(let s of t)(s.getDrawingWidth()+o.getHorizontal())*(s.getDrawingHeight()+o.getVertical())===r&&i.push(s);return i}};var un=class{filterList(t,e,o){let r=Number.POSITIVE_INFINITY;for(let s of t){let a=Math.abs((s.getDrawingWidth()+o.getHorizontal())/(s.getDrawingHeight()+o.getVertical())-e);a<r&&(r=a)}let i=[];for(let s of t)Math.abs((s.getDrawingWidth()+o.getHorizontal())/(s.getDrawingHeight()+o.getVertical())-e)===r&&i.push(s);return i}};var eg=class{constructor(t,e,o){this._aspectRatio=t,this._goal=e,this._lpShift=o}approxBoundingBox(t,e,o){let r=t[0];r.x=0,r.y=0;let i=[r],s=r,a=new Ss(this._aspectRatio,r.width,r.height,Ot.WHOLE_DRAWING);for(let l=1;l<t.length;l++){let c=t[l],g=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT,c,s,a,i,e),h=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW,c,s,a,i,e),d=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,c,s,a,i,e),f=this._calcValuesForOpt(Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,c,s,a,i,e),E=this._findBestCandidate(g,h,d,f,c,s,o);c.x=E.getNextXcoordinate(),c.y=E.getNextYcoordinate(),E.setPlacementOption(Ot.WHOLE_DRAWING),a=E,s=c,i.push(c)}return a}_findBestCandidate(t,e,o,r,i,s,a){let l=[t,e,o,r],c;switch(this._goal){case Lo.MAX_SCALE_DRIVEN:c=[new dn,new fn,new un];break;case Lo.ASPECT_RATIO_DRIVEN:c=[new un,new fn,new dn];break;case Lo.AREA_DRIVEN:c=[new fn,new dn,new un];break;default:c=[]}for(let g of c)l.length>1&&(l=g.filterList(l,this._aspectRatio,a));return l.length===1?l[0]:l.length===2?this._checkSpecialCases(l[0],l[1],s,i):null}_checkSpecialCases(t,e,o,r){let i=t.getPlacementOption(),s=e.getPlacementOption(),a=i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW||i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,l=s===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW||s===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW,c=i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,g=s===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||s===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT,h=i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW,d=s===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT||s===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW;if(a&&l)return i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW?t:e;if(c&&g)return i===Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT?t:e;if(h&&d){let f,E;i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT?(f=t,E=e):(f=e,E=t);let P=pr.calculateAreaLPR(o,r,f),S=pr.calculateAreaLPB(o,r,E);return P<=S?i===Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT?t:e:i===Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW?t:e}return t}_calcValuesForOpt(t,e,o,r,i,s){let a=0,l=0,c=r.getDrawingWidth(),g=r.getDrawingHeight(),h=e.height,d=e.width,f,E;switch(t){case Ot.CANDIDATE_POSITION_LAST_PLACED_RIGHT:a=o.x+o.width+s,this._lpShift?l=pr.calculateYforLPR(a,i,o,s):l=o.y,f=pr.getWidthLPRorLPB(c,a,d),E=pr.getHeightLPRorLPB(g,l,h);break;case Ot.CANDIDATE_POSITION_LAST_PLACED_BELOW:l=o.y+o.height+s,this._lpShift?a=pr.calculateXforLPB(l,i,o,s):a=o.x,f=pr.getWidthLPRorLPB(c,a,d),E=pr.getHeightLPRorLPB(g,l,h);break;case Ot.CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT:a=c+s,l=0,f=c+s+d,E=Math.max(g,h);break;case Ot.CANDIDATE_POSITION_WHOLE_DRAWING_BELOW:a=0,l=g+s,f=Math.max(c,d),E=g+s+h;break;default:throw new Error("IllegalPlacementOption")}return new Ss(this._aspectRatio,f,E,t,a,l)}};var og=class{process(t,e){e.begin("Greedy Width Approximator",1);let o=t.getProperty(Ns),r=t.getProperty(_r),i=t.getProperty(FE),s=t.getProperty(kE),a=t.getProperty(Cr),l=t.children;Be.resetCoordinates(l);let g=new eg(o,i,s).approxBoundingBox(l,a,r);t.setProperty($.TARGET_WIDTH,g.getDrawingWidth()),e.done()}getLayoutProcessorConfiguration(){return null}};var rg=class{process(t,e){if(e.begin("Target Width Setter",1),t.hasProperty(Vu))t.setProperty($.TARGET_WIDTH,t.getProperty(Vu));else throw new Error("A target width has to be set if the TargetWidthWidthApproximator should be used.");e.done()}getLayoutProcessorConfiguration(){return null}};var Mi=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.GREEDY:return new og;case n.TARGET_WIDTH:return new rg;default:throw new Error(`WidthApproximationStrategy.${this}: no implementation available.`)}}};Mi.GREEDY=new Mi("GREEDY",0);Mi.TARGET_WIDTH=new Mi("TARGET_WIDTH",1);var WE=new m("org.eclipse.elk.rectpacking.widthApproximation.strategy",()=>Mi.GREEDY),Vu=new m("org.eclipse.elk.rectpacking.widthApproximation.targetWidth",-1),FE=new m("org.eclipse.elk.rectpacking.widthApproximation.optimizationGoal",()=>Lo.MAX_SCALE_DRIVEN),kE=new m("org.eclipse.elk.rectpacking.widthApproximation.lastPlaceShift",!0),zE=new m("org.eclipse.elk.rectpacking.packing.strategy",()=>xr.COMPACTION),Zc=new m("org.eclipse.elk.rectpacking.packing.compaction.rowHeightReevaluation",!1),UE=new m("org.eclipse.elk.rectpacking.packing.compaction.iterations",1,1),YE=new m("org.eclipse.elk.rectpacking.whiteSpaceElimination.strategy",()=>Dr.NONE),VE=new m("org.eclipse.elk.rectpacking.trybox",!1),XE=new m("org.eclipse.elk.rectpacking.currentPosition",-1,-1),Ya=new m("org.eclipse.elk.rectpacking.desiredPosition",-1,-1),gn=new m("org.eclipse.elk.rectpacking.inNewRow",!1),KE=new m("org.eclipse.elk.rectpacking.orderBySize",!1);var ig=class{static compare(t,e){return e.height-t.height}};var sg=class{process(t,e){e.begin("Node Size Reorderer",1),t.children.sort(ig.compare),e.done()}};var ng=class{process(t,e){e.begin("Interactive Node Reorderer",1);let o=t.children,r=[];for(let s of o)s.hasProperty(Ya)&&r.push(s);for(let s of r){let a=o.indexOf(s);a>=0&&o.splice(a,1)}r.sort((s,a)=>{let l=s.getProperty(Ya),c=a.getProperty(Ya);return l===c?-1:l-c});for(let s of r){let a=s.getProperty(Ya);a=Math.min(a,o.length),o.splice(a,0,s)}let i=0;for(let s of o)s.setProperty(XE,i),i++;e.done()}};var ag=class{process(t,e){e.begin("Min Size Preprocessing",1);let o=ya(t);t.setProperty($.MIN_WIDTH,o.x),t.setProperty($.MIN_HEIGHT,o.y),e.done()}};var lg=class{process(t,e){e.begin("Min Size Postprocessing",1),t.setProperty($.TARGET_WIDTH,Math.max(t.getProperty($.TARGET_WIDTH),t.getProperty($.MIN_WIDTH))),e.done()}};var xe=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.NODE_SIZE_REORDERER:return new sg;case n.INTERACTIVE_NODE_REORDERER:return new ng;case n.MIN_SIZE_PRE_PROCESSOR:return new ag;case n.MIN_SIZE_POST_PROCESSOR:return new lg;default:throw new Error(`IntermediateProcessorStrategy.${this}: no implementation available.`)}}};xe.NODE_SIZE_REORDERER=new xe("NODE_SIZE_REORDERER",0);xe.INTERACTIVE_NODE_REORDERER=new xe("INTERACTIVE_NODE_REORDERER",1);xe.MIN_SIZE_PRE_PROCESSOR=new xe("MIN_SIZE_PRE_PROCESSOR",2);xe.MIN_SIZE_POST_PROCESSOR=new xe("MIN_SIZE_POST_PROCESSOR",3);xe.VALUES=[xe.NODE_SIZE_REORDERER,xe.INTERACTIVE_NODE_REORDERER,xe.MIN_SIZE_PRE_PROCESSOR,xe.MIN_SIZE_POST_PROCESSOR];var cg=class n extends de{constructor(){super(),this._algorithmAssembler=Io.create(Le.VALUES)}layout(t,e){e.begin("Rectangle Packing",1);let o=t.getProperty(_r),r=t.getProperty(BE),i=t.getProperty(Cr),s=t.getProperty(VE),a=t.children;t.getProperty(So)||Go.forGraph(t).execute();let l=!1;if(s&&a.length>=3){let d=a[0],f=a[1],E=0;for(;E+2<a.length;){let P=d;if(d=f,f=a[E+2],P.height>=d.height+f.height+i||f.height>=P.height+d.height+i){l=!0;break}E++}}else l=!0;if(!l){let d=a.length;for(let f of a)f.setProperty(mu,d),d--;new rs().layout(t,new Ie),e.done();return}let c=this._assembleAlgorithm(t);for(let d of c){if(typeof e.isCanceled=="function"&&e.isCanceled())return;let f=typeof e.subTask=="function"?e.subTask(1/c.length):e;d.process(t,f)}let g=0,h=0;for(let d of a)g=Math.max(g,d.x+d.width),h=Math.max(h,d.y+d.height);Vs(t,new O(t.getProperty($.DRAWING_WIDTH),t.getProperty($.DRAWING_HEIGHT)),new O(g,h)),n._applyPadding(a,o),r||Ae(t,t.getProperty($.DRAWING_WIDTH)+o.getHorizontal(),t.getProperty($.DRAWING_HEIGHT)+o.getVertical(),!1,!0),t.getProperty(So)||Go.forGraph(t).execute(),e.done()}static _applyPadding(t,e){for(let o of t)o.setLocation(o.x+e.getLeft(),o.y+e.getTop())}_assembleAlgorithm(t){return this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Le.P1_WIDTH_APPROXIMATION,t.getProperty(WE)),this._algorithmAssembler.setPhase(Le.P2_PACKING,t.getProperty(zE)),this._algorithmAssembler.setPhase(Le.P3_WHITESPACE_ELIMINATION,t.getProperty(YE)),this._algorithmAssembler.addProcessorConfiguration(this._getPhaseIndependentConfig(t)),this._algorithmAssembler.build(t)}_getPhaseIndependentConfig(t){let e=K.create();return e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.MIN_SIZE_PRE_PROCESSOR),e.addBefore(Le.P2_PACKING,xe.MIN_SIZE_POST_PROCESSOR),t.getProperty(KE)&&e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.NODE_SIZE_REORDERER),t.getProperty(zo)&&e.addBefore(Le.P1_WIDTH_APPROXIMATION,xe.INTERACTIVE_NODE_REORDERER),e}};var ZE="org.eclipse.elk.rectpacking",jE=!1;function $E(){let n=Ht.getInstance(),t=n.getAlgorithmData(ZE);if(t)return jE=!0,t;let e=new Se.Builder().id(ZE).name("ELK Rectpacking").description("Rectangle packing layout.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.rectpacking").providerFactory(()=>new cg).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),jE=!0,e}var Zo=class{static execute(t,e,o){let r=[...t],i;typeof o=="function"?i=[o]:o!=null&&typeof o.handle=="function"?i=[o]:i=[...o],r.sort(e);for(let s of r)for(let a of i)typeof a=="function"?a(s):a.handle(s)}};var oe=class{};oe.FUZZINESS=1e-4;oe.DEBUG_SVG=new m("debugSVG",!1);oe.OVERLAPS_EXISTED=new m("overlapsExisted",!0);function qE(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var gg=class{constructor(t,e){this.node=t,this.low=e}},Xu=class n{constructor(){this._items=[]}static _compare(t,e){let o=t.rect.x-e.rect.x;return o!==0||(o=t.originalVertex.x-e.originalVertex.x,o!==0)?o:t.originalVertex.y-e.originalVertex.y}add(t){for(let e=0;e<this._items.length;e++){let o=n._compare(this._items[e],t);if(o===0)return!1;if(o>0)return this._items.splice(e,0,t),!0}return this._items.push(t),!0}remove(t){let e=this._items.indexOf(t);return e>=0?(this._items.splice(e,1),!0):!1}clear(){this._items.length=0}[Symbol.iterator](){return this._items[Symbol.iterator]()}},hg=class n{constructor(t,e){this._overlapHandler=t}_applyHandler(t,e){typeof this._overlapHandler=="function"?this._overlapHandler(t,e):this._overlapHandler.handle(t,e)}sweep(t){let e=[];for(let r of t)e.push(new gg(r,!0)),e.push(new gg(r,!1));let o=new Ku(this);o.init(),Zo.execute(e,n._compareTimestamps,o)}static _compareTimestamps(t,e){let o=t.node.rect.y;t.low||(o+=t.node.rect.height);let r=e.node.rect.y;e.low||(r+=e.node.rect.height);let i=o-r;if(i===0){if(!t.low&&e.low)return-1;if(!e.low&&t.low)return 1}return i}},Ku=class{constructor(t){this._owner=t,this._intervalsSortLeft=new Xu}init(){this._intervalsSortLeft.clear()}handle(t){t.low?this._insert(t):this._delete(t)}_insert(t){if(!this._intervalsSortLeft.add(t.node))throw new Error("Invalid hitboxes for scanline overlap calculation.");let o=!1;for(let r of this._intervalsSortLeft)if(this._overlap(t.node,r))this._owner._applyHandler(t.node,r),o=!0;else if(o)break}_delete(t){this._intervalsSortLeft.remove(t.node)}_overlap(t,e){if(t==null||e==null||t===e)return!1;let o=oe.FUZZINESS;return qE(t.rect.x,e.rect.x+e.rect.width,o)<0&&qE(e.rect.x,t.rect.x+t.rect.width,o)<0}};var Ue=class n{constructor(t,e){this.u=t,this.v=e}equals(t){return t instanceof n?dg(this.u,t.u)&&dg(this.v,t.v)||dg(this.u,t.v)&&dg(this.v,t.u):!1}};function dg(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):n.x===t.x&&n.y===t.y}var fg=class{constructor(t){this._spacing=20,this._viewBoxX=Number.POSITIVE_INFINITY,this._viewBoxY=Number.POSITIVE_INFINITY,this._viewBoxW=0,this._viewBoxH=0,this._viewBoxX2=Number.NEGATIVE_INFINITY,this._viewBoxY2=Number.NEGATIVE_INFINITY,this._enableUpdateViewBox=!0,this._current="main",this._groups=new Map,this.fileName=null,this._index=0,this.debug=!1,this.maxArea=8294400,t!=null&&t.length>0&&!t.startsWith("null")&&(this.fileName=t,this.debug=!0),this._groups.set(this._current,"")}g(t){return this.debug&&(this._groups.has(t)||this._groups.set(t,""),this._current=t),this}addGroups(...t){if(this.debug)for(let e of t)this._groups.set(e,"")}clearGroup(t){this.debug&&this._groups.has(t)&&this._groups.set(t,"")}removeGroup(t){this.debug&&(t==="main"?this.clearGroup(t):this._groups.delete(t))}setViewBox(t,e,o,r){this.debug&&(this._viewBoxX=t,this._viewBoxY=e,this._viewBoxW=o,this._viewBoxH=r,this._enableUpdateViewBox=!1)}clear(){this.debug=this.fileName!=null&&this.fileName.length>0,this.debug&&(this._groups.clear(),this._current="main",this._groups.set(this._current,""),this._enableUpdateViewBox&&(this._viewBoxX=Number.POSITIVE_INFINITY,this._viewBoxY=Number.POSITIVE_INFINITY,this._viewBoxW=0,this._viewBoxH=0,this._viewBoxX2=Number.NEGATIVE_INFINITY,this._viewBoxY2=Number.NEGATIVE_INFINITY))}addElementStr(t){if(this.debug){let e=this._groups.get(this._current)||"";this._groups.set(this._current,e+t+`
`),this._current="main"}}addCircle(t,e,o,r){if(this.debug){if(o==null){this.addCircle(t,e,5,'stroke="black" stroke-width="1" fill="none"');return}this.addElementStr(`<circle cx="${t}" cy="${e}" r="${o}" ${r} />`),this._updateViewBox(new O(t-o,e-o),new O(t+o,e+o))}}addLine(t,e,o,r,i){if(this.debug){if(i==null){this.addLine(t,e,o,r,'stroke="black" stroke-width="1"');return}this.addElementStr(`<line x1="${t}" y1="${e}" x2="${o}" y2="${r}" ${i} />`),this._updateViewBox(new O(t,e),new O(o,r))}}addRect(t,e,o,r,i){if(!this.debug)return;if(typeof t=="object"&&t!=null){let l=t,c=e;this.addRect(l.x,l.y,l.width,l.height,c);return}let s=t,a=e;this.addElementStr(`<rect x="${s}" y="${a}" width="${o}" height="${r}" ${i} />`),this._updateViewBox(new O(s,a),new O(s+o,a+r))}addPoly(t,...e){if(!this.debug)return;let o='<polyline points="';for(let r of e)o+=`${r.x},${r.y} `;this.addElementStr(o+`" ${t} />`),this._updateViewBox(...e)}addText(t,e,o,r){this.debug&&this.addElementStr(`<text x="${t}" y="${e}" ${r}>${o}</text>`)}_updateViewBox(...t){if(this.debug&&this._enableUpdateViewBox){for(let e of t)Number.isFinite(e.x)&&Number.isFinite(e.y)&&(this._viewBoxX=Math.min(this._viewBoxX,e.x),this._viewBoxY=Math.min(this._viewBoxY,e.y),this._viewBoxX2=Math.max(this._viewBoxX2,e.x),this._viewBoxY2=Math.max(this._viewBoxY2,e.y));this._viewBoxW=this._viewBoxX2-this._viewBoxX,this._viewBoxH=this._viewBoxY2-this._viewBoxY}}getSVG(){if(!this.debug)return"";let t=this._viewBoxH*this._viewBoxW,e=1;t>this.maxArea&&(e=Math.sqrt(this.maxArea/t));let o=[];o.push('<?xml version="1.0" encoding="UTF-8"?>'),o.push(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="${this._viewBoxX*e-this._spacing} ${this._viewBoxY*e-this._spacing} ${this._viewBoxW*e+2*this._spacing} ${this._viewBoxH*e+2*this._spacing}">`);for(let[r,i]of this._groups.entries())o.push(`<g transform="scale(${e})" id="${r}">
${i}</g>`);return o.push("</svg>"),o.join(`
-`)}save(t){}isave(t){this._index++}};function ug(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var _g=class n{static compact(t,e,o=null){let r={root:t,orthogonal:e};n._compactTree(t,r)}static _compactTree(t,e){for(let o of t.children)n._compactTree(o,e);for(let o of t.children){let r=t.node.vertex.clone().sub(o.node.vertex);if(e.orthogonal){let s=t.node.rect,a=o.node.rect;Math.abs(r.x)>=Math.abs(r.y)?(r.y=0,a.y+a.height>s.y&&a.y<s.y+s.height&&r.scaleToLength(Math.max(s.x-(a.x+a.width),a.x-(s.x+s.width)))):(r.x=0,a.x+a.width>s.x&&a.x<s.x+s.width&&r.scaleToLength(Math.max(s.y-(a.y+a.height),a.y-(s.y+s.height))))}else r.scaleToLength(t.node.underlap(o.node));let i=r.length();i=n._getMinUnderlap(e.root,o,i,r),r.scaleToLength(i),n._translateSubtree(o,r)}}static _getMinUnderlap(t,e,o,r){let i=Math.min(o,n._minUnderlapWithSubtree(t.node,e,o,r));for(let s of t.children)s!==e&&(i=Math.min(i,n._getMinUnderlap(s,e,i,r)));return i}static _minUnderlapWithSubtree(t,e,o,r){let i=o,s=ee.FUZZINESS;for(let a of e.children){let l=a.node;if(t.touches(l)){if(ug(l.rect.x,t.rect.x+t.rect.width,s)===0&&r.x<0||ug(l.rect.x+l.rect.width,t.rect.x,s)===0&&r.x>0||ug(l.rect.y,t.rect.y+t.rect.height,s)===0&&r.y<0||ug(l.rect.y+l.rect.height,t.rect.y,s)===0&&r.y>0){i=0;break}}else i=Math.min(i,t.distance(l,r));i=Math.min(i,n._minUnderlapWithSubtree(t,a,i,r))}return i}static _translateSubtree(t,e){t.node.translate(e);for(let o of t.children)n._translateSubtree(o,e)}};var pg=class{process(t,e){e.begin("Shrinking tree compaction",1);let o=t.getProperty(ee.DEBUG_SVG)?"spore/60compaction":null;_g.compact(t.tree,t.orthogonalCompaction,o),e.done()}getLayoutProcessorConfiguration(){return K.create()}};var _n=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.DEPTH_FIRST:return new pg;default:throw new Error(`No implementation for CompactionStrategy.${this}`)}}};_n.DEPTH_FIRST=new _n("DEPTH_FIRST");var Ho=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Ho.FIXED=new Ho("FIXED");Ho.CENTER_NODE=new Ho("CENTER_NODE");var Te=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Te.CENTER_DISTANCE=new Te("CENTER_DISTANCE");Te.CIRCLE_UNDERLAP=new Te("CIRCLE_UNDERLAP");Te.RECTANGLE_UNDERLAP=new Te("RECTANGLE_UNDERLAP");Te.INVERTED_OVERLAP=new Te("INVERTED_OVERLAP");Te.MINIMUM_ROOT_DISTANCE=new Te("MINIMUM_ROOT_DISTANCE");var cT=ee.FUZZINESS;function gT(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var Va=class n{constructor(t,e,o){this.a=t,this.b=e,this.c=o,this.tEdges=[new Ue(t,e),new Ue(e,o),new Ue(o,t)],this.vertices=[t,e,o],this._circumcenter=this._calculateCircumcenter()}getCircumcenter(){return this._circumcenter}_calculateCircumcenter(){let t=this.b.clone().sub(this.a),e=this.c.clone().sub(this.a),o=this.c.clone().sub(this.b),r=t.x*(this.a.x+this.b.x)+t.y*(this.a.y+this.b.y),i=e.x*(this.a.x+this.c.x)+e.y*(this.a.y+this.c.y),s=2*(t.x*o.y-t.y*o.x),a=(e.y*r-t.y*i)/s,l=(t.x*i-e.x*r)/s;return new O(a,l)}inCircumcircle(t){return gT(this._circumcenter.distance(t),this._circumcenter.distance(this.a),cT)<0}equals(t){return t instanceof n?this.containsVertex(t.a)&&this.containsVertex(t.b)&&this.containsVertex(t.c):!1}containsEdge(t){return ju(t,this.tEdges[0])||ju(t,this.tEdges[1])||ju(t,this.tEdges[2])}containsVertex(t){return Zu(t,this.vertices[0])||Zu(t,this.vertices[1])||Zu(t,this.vertices[2])}};function Zu(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):n.x===t.x&&n.y===t.y}function ju(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):!1}var Eg=class{static triangulate(t,e=null){let o=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let S of t)o.x=Math.min(o.x,S.x),o.y=Math.min(o.y,S.y),r.x=Math.max(r.x,S.x),r.y=Math.max(r.y,S.y);let i=new O(r.x-o.x,r.y-o.y),s=50,a=new O(o.x-s,o.y-i.x-s),l=new O(o.x-s,r.y+i.x+s),c=new O(r.x+i.y/2+s,o.y+i.y/2),g=new Va(a,l,c),h=[g],d=[],f=[];for(let S of t){d.length=0;for(let T of h)T.inCircumcircle(S)&&d.push(T);f.length=0;for(let T of d)for(let N of T.tEdges){let I=!0;for(let C of d)C!==T&&C.containsEdge(N)&&(I=!1);I&&f.push(N)}for(let T of d){let N=h.indexOf(T);N>=0&&h.splice(N,1)}for(let T of f)h.push(new Va(S,T.u,T.v))}let E=[];for(let S of h)for(let T of S.tEdges){let N=!1;for(let I of E)if(I.equals(T)){N=!0;break}N||E.push(T)}let P=new Set;for(let S of E)!g.containsVertex(S.u)&&!g.containsVertex(S.v)&&P.add(S);return P}};var mg=class{process(t,e){e.begin("Delaunay triangulation",1);let o=[];for(let s of t.vertices)o.push(s.originalVertex);let r=t.getProperty(ee.DEBUG_SVG)?"spore/10bw":null,i=Eg.triangulate(o,r);if(t.tEdges==null)t.tEdges=i;else for(let s of i)t.tEdges.add(s);e.done()}getLayoutProcessorConfiguration(){return K.create()}};var wr=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.DELAUNAY_TRIANGULATION:return new mg;default:throw new Error(`No implementation for StructureExtractionStrategy.${this}`)}}};wr.DELAUNAY_TRIANGULATION=new wr("DELAUNAY_TRIANGULATION");var bi=class{constructor(t){this.node=t,this.children=[]}};var pn=class{static createSpanningTree(t,e,o,r=null){let i=typeof o=="function"?o:h=>o.cost(h),s=new Map;for(let h of t)s.set(h,i(h));let a=[...t];a.sort((h,d)=>s.get(h)-s.get(d));let l=new Set(a),c=new bi(e),g=new Map;for(g.set(e,c);l.size>0;){let h=null,d=null,f=null;for(let P of l){if(g.has(P.u)&&!g.has(P.v)){d=P.v,f=P.u,h=P;break}if(g.has(P.v)&&!g.has(P.u)){d=P.u,f=P.v,h=P;break}}if(h==null)break;let E=new bi(d);g.get(f).children.push(E),g.set(d,E),l.delete(h)}return c}};var En=class{constructor(){this._nodeMap=new Map}process(t,e){e.begin("Minimum spanning tree construction",1);let o=t.preferredRoot!=null?t.preferredRoot.originalVertex:t.vertices[0].originalVertex,r=t.getProperty(ee.DEBUG_SVG)?"spore/20minst":null,i=pn.createSpanningTree(t.tEdges,o,t.costFunction,r);this._convert(i,t),e.done()}_convert(t,e){this._nodeMap.clear();for(let r of e.vertices)this._nodeMap.set(r.originalVertex,r);let o=new bi(this._nodeMap.get(t.node));this._addNode(o,t),e.tree=o}_addNode(t,e){for(let o of e.children){let r=new bi(this._nodeMap.get(o.node));t.children.push(r),this._addNode(r,o)}}getLayoutProcessorConfiguration(){return K.create()}};var Pg=class extends En{process(t,e){e.begin("Maximum spanning tree construction",1);let o=a=>-t.costFunction(a),r=t.preferredRoot!=null?t.preferredRoot.originalVertex:t.vertices[0].originalVertex,i=t.getProperty(ee.DEBUG_SVG)?"spore/20minst":null,s=pn.createSpanningTree(t.tEdges,r,o,i);this._convert(s,t),e.done()}};var Mr=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.MINIMUM_SPANNING_TREE:return new En;case n.MAXIMUM_SPANNING_TREE:return new Pg;default:throw new Error(`No implementation for TreeConstructionStrategy.${this}`)}}};Mr.MINIMUM_SPANNING_TREE=new Mr("MINIMUM_SPANNING_TREE");Mr.MAXIMUM_SPANNING_TREE=new Mr("MAXIMUM_SPANNING_TREE");var mn=new m("org.eclipse.elk.underlyingLayoutAlgorithm"),Gk=new m("org.eclipse.elk.structure.structureExtractionStrategy",()=>wr.DELAUNAY_TRIANGULATION),Og=new m("org.eclipse.elk.processingOrder.treeConstruction",()=>Mr.MINIMUM_SPANNING_TREE),Sg=new m("org.eclipse.elk.processingOrder.spanningTreeCostFunction",()=>Te.CIRCLE_UNDERLAP),JE=new m("org.eclipse.elk.processingOrder.preferredRoot"),Tg=new m("org.eclipse.elk.processingOrder.rootSelection",()=>Ho.CENTER_NODE),QE=new m("org.eclipse.elk.compaction.compactionStrategy",()=>_n.DEPTH_FIRST),tm=new m("org.eclipse.elk.compaction.orthogonal",!1),em=new m("org.eclipse.elk.overlapRemoval.maxIterations",64),om=new m("org.eclipse.elk.overlapRemoval.runScanline",!0);var Pn=class{static overlap(t,e){let o=Math.min(Math.abs(t.x-(e.x+e.width)),Math.abs(t.x+t.width-e.x)),r=Math.min(Math.abs(t.y-(e.y+e.height)),Math.abs(t.y+t.height-e.y)),i=Math.abs(t.x+t.width/2-(e.x+e.width/2));if(i>t.width/2+e.width/2)return 1;let s=Math.abs(t.y+t.height/2-(e.y+e.height/2));return s>t.height/2+e.height/2?1:i===0&&s===0?0:i===0?r/s+1:s===0?o/i+1:Math.min(o/i,r/s)+1}static getRectEdges(t){let e=[];return e.push(new Ue(t.getTopLeft(),t.getTopRight())),e.push(new Ue(t.getTopLeft(),t.getBottomLeft())),e.push(new Ue(t.getBottomRight(),t.getTopRight())),e.push(new Ue(t.getBottomRight(),t.getBottomLeft())),e}};var Ng=class{constructor(){this._root=null,this._overlapsExisted=!1}process(t,e){e.begin("Grow Tree",1),this._root=t.tree,this._overlapsExisted=!1,this._growAt(t.tree),t.setProperty(ee.OVERLAPS_EXISTED,this._overlapsExisted),e.done()}_growAt(t){for(let e of t.children){e.node.translate(t.node.vertex.clone().sub(t.node.originalVertex));let o=Pn.overlap(t.node.rect,e.node.rect);o>1&&(this._overlapsExisted=!0),e.node.setCenterPosition(t.node.vertex.clone().add(e.node.originalVertex.clone().sub(t.node.originalVertex).scale(o))),this._growAt(e)}}getLayoutProcessorConfiguration(){return K.create()}};var On=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.GROW_TREE:return new Ng;default:throw new Error(`No implementation for OverlapRemovalStrategy.${this}`)}}};On.GROW_TREE=new On("GROW_TREE");var Ne=class{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}};Ne.P1_STRUCTURE=new Ne("P1_STRUCTURE",0);Ne.P2_PROCESSING_ORDER=new Ne("P2_PROCESSING_ORDER",1);Ne.P3_EXECUTION=new Ne("P3_EXECUTION",2);Ne.VALUES=[Ne.P1_STRUCTURE,Ne.P2_PROCESSING_ORDER,Ne.P3_EXECUTION];var rm=new m("org.eclipse.elk.padding",new yt(8)),im=new m("org.eclipse.elk.spacing.nodeNode",8,0);function yg(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}function sm(n){return[new Ue(n.getTopLeft(),n.getTopRight()),new Ue(n.getTopLeft(),n.getBottomLeft()),new Ue(n.getBottomRight(),n.getTopRight()),new Ue(n.getBottomRight(),n.getBottomLeft())]}var Ig=class{constructor(t,e){this.originalVertex=t,this.vertex=this.originalVertex.clone(),this.rect=new dt(e)}translate(t){this.vertex.add(t),this.rect.x+=t.x,this.rect.y+=t.y}setCenterPosition(t){this.translate(t.clone().sub(this.vertex))}underlap(t){let e=Math.abs(this.rect.getCenter().x-t.rect.getCenter().x),o=Math.abs(this.rect.getCenter().y-t.rect.getCenter().y),r=0,i=0,s=1,a=1;return e>this.rect.width/2+t.rect.width/2&&(r=Math.min(Math.abs(this.rect.x-(t.rect.x+t.rect.width)),Math.abs(this.rect.x+this.rect.width-t.rect.x)),s=1-r/e),o>this.rect.height/2+t.rect.height/2&&(i=Math.min(Math.abs(this.rect.y-(t.rect.y+t.rect.height)),Math.abs(this.rect.y+this.rect.height-t.rect.y)),a=1-i/o),(1-Math.min(s,a))*Math.sqrt(e*e+o*o)}distance(t,e){let o=Number.POSITIVE_INFINITY;for(let r of sm(this.rect))for(let i of sm(t.rect)){let s=Ft.distance(r.u,r.v,i.u,i.v,e);o=Math.min(o,s)}return o}touches(t){let e=ee.FUZZINESS;return yg(this.rect.x,t.rect.x+t.rect.width,e)<=0&&yg(t.rect.x,this.rect.x+this.rect.width,e)<=0&&yg(this.rect.y,t.rect.y+t.rect.height,e)<=0&&yg(t.rect.y,this.rect.y+this.rect.height,e)<=0}};var Rg=class extends ge{constructor(t,e,o){super(),this.vertices=[],this.tEdges=null,this.treeConstructionStrategy=e,this.tree=null,this.compactionStrategy=o,this.costFunction=t,this.preferredRoot=null,this.orthogonalCompaction=!1}};var Sn=class{constructor(){this._graph=null,this._nodeMap=new Map,this._elkGraph=null,this._spacingNodeNode=0,this._centerDistance=t=>t.u.distance(t.v),this._minimumRootDistance=t=>Math.min(t.u.distance(this._graph.preferredRoot.vertex),t.v.distance(this._graph.preferredRoot.vertex)),this._circleUnderlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst();return t.u.distance(t.v)-t.u.distance(e.rect.getPosition())-t.v.distance(o.rect.getPosition())},this._rectangleUnderlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst();return e.underlap(o)},this._invertedOverlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst(),r=e.rect,i=o.rect,s=Ft.shortestDistance(r,i);if(s>=0)return s;let a=i.getCenter().sub(r.getCenter()).length();return-(Pn.overlap(r,i)-1)*a}}importGraph(t){this._elkGraph=t,this._nodeMap=new Map,this._seenCoords=new Set;let e=yo.adapt(this._elkGraph);No.calculateNodeMargins(e);let o=this._elkGraph.getProperty(JE),r=this._elkGraph.getProperty(Sg),i=this._elkGraph.getProperty(Og),s=this._elkGraph.getProperty(QE),a=this._elkGraph.getProperty(Tg);this._spacingNodeNode=this._elkGraph.getProperty(im);let l;switch(r){case Te.CENTER_DISTANCE:l=this._centerDistance;break;case Te.CIRCLE_UNDERLAP:l=this._circleUnderlap;break;case Te.RECTANGLE_UNDERLAP:l=this._rectangleUnderlap;break;case Te.INVERTED_OVERLAP:l=this._invertedOverlap;break;case Te.MINIMUM_ROOT_DISTANCE:l=this._minimumRootDistance;break;default:throw new Error("No implementation available for "+r)}if(this._graph=new Rg(l,i,s),this._graph.setProperty(ee.DEBUG_SVG,this._elkGraph.getProperty(Ks)),this._graph.orthogonalCompaction=this._elkGraph.getProperty(tm),this._elkGraph.children.length===0)return this._graph;for(let c of this._elkGraph.children){let g=c.width/2,h=c.height/2,d=new O(c.x+g,c.y+h),f=d.x+","+d.y;for(;this._seenCoords.has(f);)d.add((Math.random()-.5)*.001,(Math.random()-.5)*.001),f=d.x+","+d.y;this._seenCoords.add(f);let E=c.getProperty(Nr),P=new Ig(d,new dt(d.x-g-this._spacingNodeNode/2-E.left,d.y-h-this._spacingNodeNode/2-E.top,c.width+this._spacingNodeNode+E.getHorizontal(),c.height+this._spacingNodeNode+E.getVertical()));this._graph.vertices.push(P),this._nodeMap.set(d,Gt.of(P,c))}if(a===Ho.FIXED)if(o==null)this._graph.preferredRoot=this._graph.vertices[0];else for(let c of this._graph.vertices){let g=this._nodeMap.get(c.originalVertex).getSecond().getIdentifier();g!==null&&g===o&&(this._graph.preferredRoot=c)}else if(a===Ho.CENTER_NODE){let c=new O(this._elkGraph.width,this._elkGraph.height);c.scale(.5),c.add(this._elkGraph.x,this._elkGraph.y);let g=Number.POSITIVE_INFINITY;for(let h of this._graph.vertices){let d=h.originalVertex.distance(c);d<g&&(g=d,this._graph.preferredRoot=h)}}else throw new Error("No implementation available for "+a);return this._graph}updateGraph(t){let e=new Map;t.tEdges=null,t.tree=null;for(let o of t.vertices){let r=this._nodeMap.get(o.originalVertex);o.originalVertex=o.rect.getCenter(),e.set(o.originalVertex,r)}this._nodeMap=e}applyPositions(t){let e=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let a of t.vertices){let l=this._nodeMap.get(a.originalVertex).getSecond();l.setLocation(a.rect.x,a.rect.y),e=Math.min(e,l.x),o=Math.min(o,l.y),r=Math.max(r,l.x+l.width),i=Math.max(i,l.y+l.height)}let s=this._elkGraph.getProperty(rm);Ae(this._elkGraph,r-e+s.getHorizontal(),i-o+s.getVertical(),!0,!0),Ra(this._elkGraph,-e+s.left,-o+s.top);for(let a of this._elkGraph.containedEdges){let l=ar(a,!0,!0),c=ks(a),g=Na(a),h=new O(c.x+c.width/2,c.y+c.height/2),d=new O(g.x+g.width/2,g.y+g.height/2),f=d.clone().sub(h);Ft.clipVector(f,c.width,c.height),h.add(f);let E=h.clone().sub(d);Ft.clipVector(E,g.width,g.height),d.add(E),l.setStartLocation(h.x,h.y),l.setEndLocation(d.x,d.y)}}};var Lg=class extends de{constructor(){super(),this._algorithmAssembler=Io.create(Ne.VALUES)}layout(t,e){if(t.hasProperty(mn)){let h=t.getProperty(mn),d=Ht.getInstance().getAlgorithmDataBySuffix(h);if(d!=null){let f=d.getInstancePool().fetch(),E=typeof e.subTask=="function"?e.subTask(1):e;f.layout(t,E)}}t.setProperty(Tg,Ho.CENTER_NODE),t.setProperty(Sg,Te.INVERTED_OVERLAP),t.setProperty(Og,Mr.MINIMUM_SPANNING_TREE);let o=t.getProperty(em);e.begin("Overlap removal",1);let r=new fg(null),i=new Set,s={handle(h,d){i.add(new Ue(h.originalVertex,d.originalVertex))}},a=new Sn,l=a.importGraph(t),c=!0,g=0;for(;g<o&&c;){if(t.getProperty(om)){if(i.clear(),new hg(s,r).sweep(l.vertices),i.size===0)break;l.tEdges=i}this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ne.P1_STRUCTURE,wr.DELAUNAY_TRIANGULATION),this._algorithmAssembler.setPhase(Ne.P2_PROCESSING_ORDER,l.treeConstructionStrategy),this._algorithmAssembler.setPhase(Ne.P3_EXECUTION,On.GROW_TREE);let h=this._algorithmAssembler.build(l);for(let d of h){let f=typeof e.subTask=="function"?e.subTask(1):e;d.process(l,f)}a.updateGraph(l),c=l.getProperty(ee.OVERLAPS_EXISTED),g++}a.applyPositions(l),e.done()}};var Ag=class{constructor(){this._algorithmAssembler=Io.create(Ne.VALUES)}shrink(t,e){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ne.P1_STRUCTURE,wr.DELAUNAY_TRIANGULATION),this._algorithmAssembler.setPhase(Ne.P2_PROCESSING_ORDER,t.treeConstructionStrategy),this._algorithmAssembler.setPhase(Ne.P3_EXECUTION,t.compactionStrategy);let o=this._algorithmAssembler.build(t);if(e.begin("Compaction by shrinking a tree",o.length),t.vertices.length>1)for(let r of o){let i=typeof e.subTask=="function"?e.subTask(1):e;r.process(t,i)}e.done()}};var Cg=class extends de{constructor(){super(),this._shrinktree=new Ag}layout(t,e){if(t.hasProperty(mn)){let s=t.getProperty(mn),a=Ht.getInstance().getAlgorithmDataBySuffix(s);if(a!=null){let l=a.getInstancePool().fetch(),c=typeof e.subTask=="function"?e.subTask(1):e;l.layout(t,c)}}let o=new Sn,r=o.importGraph(t),i=typeof e.subTask=="function"?e.subTask(1):e;this._shrinktree.shrink(r,i),o.applyPositions(r)}};var nm="org.eclipse.elk.sporeOverlap",am="org.eclipse.elk.sporeCompaction",lm=!1;function cm(){let n=Ht.getInstance(),t=n.getAlgorithmData(nm),e=n.getAlgorithmData(am);if(t&&e)return lm=!0,{overlap:t,compaction:e};let o=new Se.Builder().id(nm).name("ELK SPOrE Overlap").description("Node-overlap removal via Nachmanson et al. 2016.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.spore").providerFactory(()=>new Lg).supportedFeatures(new Set([])).create(),r=new Se.Builder().id(am).name("ELK SPOrE Compaction").description("Tree-based compaction to tighten whitespace between nodes.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.spore").providerFactory(()=>new Cg).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(i){i.register(o),i.register(r)}}),lm=!0,{overlap:o,compaction:r}}var br=class extends ge{constructor(){super(),this.id=0}getDesignation(){return null}};var Tn=class n extends yt{constructor(){super()}clone(){let t=new n;return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t}};var Nn=class extends br{constructor(){super(),this._size=new O,this._padding=new Tn,this._offset=new O,this._layerlessNodes=[],this._layers=[],this._parentNode=null}getSize(){return this._size}getActualSize(){return new O(this._size.x+this._padding.left+this._padding.right,this._size.y+this._padding.top+this._padding.bottom)}getPadding(){return this._padding}getOffset(){return this._offset}getLayerlessNodes(){return this._layerlessNodes}getLayers(){return this._layers}getParentNode(){return this._parentNode}setParentNode(t){this._parentNode=t}[Symbol.iterator](){return this._layers[Symbol.iterator]()}toNodeArray(){let t=new Array(this._layers.length);for(let e=0;e<this._layers.length;e++)t[e]=this._layers[e].getNodes().slice();return t}toString(){return this._layers.length===0?`G-unlayered[${this._layerlessNodes.join(",")}]`:this._layerlessNodes.length===0?`G-layered[${this._layers.join(",")}]`:`G[layerless[${this._layerlessNodes.join(",")}], layers[${this._layers.join(",")}]]`}};var p=class{};p.REVERSED=new m("reversed",!1);p.INPUT_COLLECT=new m("inputCollect",!1);p.OUTPUT_COLLECT=new m("outputCollect",!1);p.REPRESENTED_LABELS=new m("representedLabels");p.RANDOM=new m("random");p.CYCLIC=new m("cyclic",!1);p.MODEL_ORDER=new m("modelOrder");p.MAX_MODEL_ORDER_NODES=new m("maxModelOrderNodes",0);p.CB_NUM_MODEL_ORDER_GROUPS=new m("cbNumModelOrderGroups",1);p.TARJAN_ID=new m("tarjanId",-1);p.TARJAN_LOWLINK=new m("tarjanLowlink",-1);p.TARJAN_ON_STACK=new m("tarjanOnStack",!1);p.IS_PART_OF_CYCLE=new m("isPartOfCycle",!1);p.IN_LAYER_LAYOUT_UNIT=new m("inLayerLayoutUnit");p.ORIGIN=new m("origin");p.PORT_DUMMY=new m("portDummy");p.WEIGHT=new m("weight");p.IN_LAYER_SUCCESSOR_CONSTRAINTS=new m("inLayerSuccessorConstraints",[]);p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES=new m("inLayerSuccessorConstraintsBetweenNonDummies",!1);p.BARYCENTER_ASSOCIATES=new m("barycenterAssociates");p.GRAPH_PROPERTIES=new m("graphProperties",()=>new Set);p.FIRST_TRY_WITH_INITIAL_ORDER=new m("firstTryWithInitialOrder",!1);p.SECOND_TRY_WITH_INITIAL_ORDER=new m("secondTryWithInitialOrder",!1);p.INSIDE_CONNECTIONS=new m("insideConnections",!1);p.SPACINGS=new m("spacings");p.ORIGINAL_DUMMY_NODE_POSITION=new m("originalDummyNodePosition");p.LONG_EDGE_SOURCE=new m("longEdgeSource");p.LONG_EDGE_TARGET=new m("longEdgeTarget");p.LONG_EDGE_HAS_LABEL_DUMMIES=new m("longEdgeHasLabelDummies",!1);p.END_LABEL_EDGE=new m("endLabelEdge");p.EXT_PORT_SIDE=new m("extPortSide");p.IN_LAYER_CONSTRAINT=new m("inLayerConstraint");p.EDGE_CONSTRAINT=new m("edgeConstraint");p.TOP_COMMENTS=new m("topComments");p.BOTTOM_COMMENTS=new m("bottomComments");p.COMMENT_CONN_PORT=new m("commentConnPort");p.HIDDEN_NODES=new m("hiddenNodes");p.ORIGINAL_OPPOSITE_PORT=new m("originalOppositePort");p.LONG_EDGE_BEFORE_LABEL_DUMMY=new m("longEdgeBeforeLabelDummy",!1);p.PARTITION_DUMMY=new m("partitionDummy",!1);p.LABEL_SIDE=new m("labelSide");p.END_LABELS=new m("endLabels");p.MAX_EDGE_THICKNESS=new m("maxEdgeThickness",0);p.SPLINE_NS_PORT_Y_COORD=new m("splineNsPortYCoord");p.PORT_RATIO_OR_POSITION=new m("portRatioOrPosition",0);p.EXT_PORT_REPLACED_DUMMIES=new m("extPortReplacedDummies");p.EXT_PORT_REPLACED_DUMMY=new m("extPortReplacedDummy");p.SELF_LOOP_HOLDER=new m("selfLoopHolder");p.ORIGINAL_PORT_CONSTRAINTS=new m("originalPortConstraints");p.CROSSING_HINT=new m("crossingHint",0);p.BREAKING_POINT_INFO=new m("breakingPointInfo");p.SPLINE_ROUTE_START=new m("splineRouteStart");p.SPLINE_EDGE_CHAIN=new m("splineEdgeChain");p.SPLINE_SURVIVING_EDGE=new m("splineSurvivingEdge");p.COMPOUND_NODE=new m("compoundNode",!1);p.PROCESSORS=new m("processors");p.EXT_PORT_CONNECTIONS=new m("extPortConnections");p.EXT_PORT_SIZE=new m("extPortSize");p.COORDINATE_SYSTEM_ORIGIN=new m("coordinateSystemOrigin");p.ORIGINAL_BENDPOINTS=new m("originalBendpoints");p.TARGET_OFFSET=new m("targetOffset");p.CROSS_HIERARCHY_MAP=new m("crossHierarchyMap");p.ORIGINAL_LABEL_EDGE=new m("originalLabelEdge");p.TARGET_NODE_MODEL_ORDER=new m("targetNodeModelOrder");p.LONG_EDGE_TARGET_NODE=new m("longEdgeTargetNode");var oe=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};oe.BARYCENTER=new oe("BARYCENTER");oe.ONE_SIDED_GREEDY_SWITCH=new oe("ONE_SIDED_GREEDY_SWITCH");oe.TWO_SIDED_GREEDY_SWITCH=new oe("TWO_SIDED_GREEDY_SWITCH");oe.MEDIAN=new oe("MEDIAN");var Gi=class extends br{constructor(){super(),this._pos=new O,this._size=new O}getPosition(){return this._pos}getSize(){return this._size}};var Gr=class extends me{constructor(){super()}};var rt=class extends Gi{constructor(){super(),this._owner=null,this._side=u.UNDEFINED,this._anchor=new O,this._explicitlySuppliedPortAnchor=!1,this._margin=new Gr,this._labels=[],this._incomingEdges=[],this._outgoingEdges=[],this._connectedToExternalNodes=!0}getNode(){return this._owner}setNode(t){if(this._owner!=null){let e=this._owner.getPorts(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._owner=t,this._owner!=null&&this._owner.getPorts().push(this)}getSide(){return this._side}setSide(t){if(t==null)throw new TypeError("PortSide must not be null");if(this._side=t,!this.isExplicitlySuppliedPortAnchor()){let e=this.getSize(),o=this.getAnchor();switch(t){case u.NORTH:o.x=e.x/2,o.y=0;break;case u.EAST:o.x=e.x,o.y=e.y/2;break;case u.SOUTH:o.x=e.x/2,o.y=e.y;break;case u.WEST:o.x=0,o.y=e.y/2;break}}}getAnchor(){return this._anchor}isExplicitlySuppliedPortAnchor(){return this._explicitlySuppliedPortAnchor}setExplicitlySuppliedPortAnchor(t){this._explicitlySuppliedPortAnchor=t}getAbsoluteAnchor(){let t=this._owner.getPosition(),e=this.getPosition();return new O(t.x+e.x+this._anchor.x,t.y+e.y+this._anchor.y)}getMargin(){return this._margin}getLabels(){return this._labels}getName(){return this._labels.length>0?this._labels[0].getText():null}getDegree(){return this._incomingEdges.length+this._outgoingEdges.length}getNetFlow(){return this._incomingEdges.length-this._outgoingEdges.length}getIncomingEdges(){return this._incomingEdges}getOutgoingEdges(){return this._outgoingEdges}*getConnectedEdges(){yield*nr(this._incomingEdges),yield*nr(this._outgoingEdges)}isConnectedToExternalNodes(){return this._connectedToExternalNodes}setConnectedToExternalNodes(t){this._connectedToExternalNodes=t}*getPredecessorPorts(){for(let t of this._incomingEdges)yield t.getSource()}*getSuccessorPorts(){for(let t of this._outgoingEdges)yield t.getTarget()}*getConnectedPorts(){yield*nr(this.getPredecessorPorts()),yield*nr(this.getSuccessorPorts())}getIndex(){return this._owner==null?-1:this._owner.getPorts().indexOf(this)}getDesignation(){if(this._labels.length>0&&this._labels[0].getText())return this._labels[0].getText();let t=super.getDesignation();return t!=null?t:String(this.getIndex())}toString(){let t=`p_${this.getDesignation()}`;if(this._owner!=null&&(t+=`[${this._owner}]`),this._incomingEdges.length===1&&this._outgoingEdges.length===0&&this._incomingEdges[0].getSource()!==this){let e=this._incomingEdges[0].getSource();t+=` << ${e.getDesignation()}[${e._owner}]`}if(this._incomingEdges.length===0&&this._outgoingEdges.length===1&&this._outgoingEdges[0].getTarget()!==this){let e=this._outgoingEdges[0].getTarget();t+=` >> ${e.getDesignation()}[${e._owner}]`}return t}};Z(rt,"OUTPUT_PREDICATE",t=>t._outgoingEdges.length>0),Z(rt,"INPUT_PREDICATE",t=>t._incomingEdges.length>0),Z(rt,"NORTH_PREDICATE",t=>t._side===u.NORTH),Z(rt,"EAST_PREDICATE",t=>t._side===u.EAST),Z(rt,"SOUTH_PREDICATE",t=>t._side===u.SOUTH),Z(rt,"WEST_PREDICATE",t=>t._side===u.WEST);var W=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};W.UNDEFINED=new W("UNDEFINED");W.INPUT=new W("INPUT");W.OUTPUT=new W("OUTPUT");var ft=class extends Gi{constructor(t){super(),this._graph=t,this._layer=null,this._type=y.NORMAL,this._ports=[],this._labels=[],this._nestedGraph=null,this._margin=new Gr,this._padding=new Tn,this._portSideIndices=null,this._portSidesCached=!1}getLayer(){return this._layer}setLayer(t,e){let o,r=-1;if(e===void 0)o=t;else if(r=t,o=e,o!=null&&(r<0||r>o.getNodes().length))throw new RangeError("index must be >= 0 and <= layer node count");if(this._layer!=null){let i=this._layer.getNodes(),s=i.indexOf(this);s>=0&&i.splice(s,1)}this._layer=o,this._layer!=null&&(r>=0?this._layer.getNodes().splice(r,0,this):this._layer.getNodes().push(this))}getGraph(){return this._graph==null&&this._layer!=null?this._layer.getGraph():this._graph}setGraph(t){if(this._layer!=null)throw new Error("setGraph called on a node that is already in a layer");this._graph=t}getType(){return this._type}setType(t){this._type=t}getPorts(t,e){return t===void 0?this._ports:fT(this._ports,t,e)}getPortSideView(t){this._portSidesCached||this._findPortIndices();let e=this._portSideIndices.get(t);return e==null?[]:this._ports.slice(e[0],e[1])}*getIncomingEdges(){for(let t of this._ports)yield*nr(t.getIncomingEdges())}*getOutgoingEdges(){for(let t of this._ports)yield*nr(t.getOutgoingEdges())}*getConnectedEdges(){for(let t of this._ports)yield*nr(t.getConnectedEdges())}getLabels(){return this._labels}getNestedGraph(){return this._nestedGraph}setNestedGraph(t){this._nestedGraph=t}getMargin(){return this._margin}getPadding(){return this._padding}getIndex(){return this._layer==null?-1:this._layer.getNodes().indexOf(this)}borderToContentAreaCoordinates(t,e){let o=this.getGraph(),r=o.getPadding(),i=o.getOffset(),s=this.getPosition();t&&(s.x=s.x-r.left-i.x),e&&(s.y=s.y-r.top-i.y)}getInteractiveReferencePoint(){switch(this.getGraph().getProperty(_.INTERACTIVE_REFERENCE_POINT)){case vo.CENTER:{let e=this.getPosition(),o=this.getSize();return new O(e.x+o.x/2,e.y+o.y/2)}case vo.TOP_LEFT:return new O(this.getPosition().x,this.getPosition().y);default:return null}}cachePortSides(){this._portSidesCached=!0,this._findPortIndices()}_findPortIndices(){this._portSideIndices=new Map;let t=0,e=u.NORTH,o=0;for(;o<this._ports.length;o++){let r=this._ports[o];r.getSide()!==e&&(t!==o&&this._portSideIndices.set(e,[t,o]),e=r.getSide(),t=o)}this._portSideIndices.set(e,[t,o])}getDesignation(){if(this._labels.length>0&&this._labels[0].getText())return this._labels[0].getText();let t=super.getDesignation();return t!=null?t:String(this.getIndex())}isInlineEdgeLabel(){if(this._type!==y.LABEL)return!1;let t=this.getProperty(p.REPRESENTED_LABELS);return t?t.every(e=>e.getProperty(_.EDGE_LABELS_INLINE)):!1}toString(){let t="n";return this._type!==y.NORMAL&&(t+=`(${this._type.name.toLowerCase()})`),t+=`_${this.getDesignation()}`,t}},y=class{constructor(t,e){this.name=t,this._color=e,Object.freeze(this)}getColor(){return this._color}toString(){return this.name}};y.NORMAL=new y("NORMAL","#eeeeee");y.LONG_EDGE=new y("LONG_EDGE","#eaed00");y.EXTERNAL_PORT=new y("EXTERNAL_PORT","#cc99cc");y.NORTH_SOUTH_PORT=new y("NORTH_SOUTH_PORT","#0034de");y.LABEL=new y("LABEL","#75c3c3");y.BREAKING_POINT=new y("BREAKING_POINT","#eeeeff");y.PLACEHOLDER=new y("PLACEHOLDER","#eeeeee");y.NONSHIFTING_PLACEHOLDER=new y("NONSHIFTING_PLACEHOLDER","#eeeeee");function dT(n){return n===W.INPUT?rt.INPUT_PREDICATE:n===W.OUTPUT?rt.OUTPUT_PREDICATE:null}function gm(n){return n===u.NORTH?rt.NORTH_PREDICATE:n===u.EAST?rt.EAST_PREDICATE:n===u.SOUTH?rt.SOUTH_PREDICATE:n===u.WEST?rt.WEST_PREDICATE:null}function*fT(n,t,e){let o=null,r=null;t instanceof W?o=dT(t):t instanceof u&&(r=gm(t)),e!=null&&(r=gm(e));for(let i of n)o&&!o(i)||r&&!r(i)||(yield i)}var D=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}static values(){return[n.P1_CYCLE_BREAKING,n.P2_LAYERING,n.P3_NODE_ORDERING,n.P4_NODE_PLACEMENT,n.P5_EDGE_ROUTING]}};D.P1_CYCLE_BREAKING=new D("P1_CYCLE_BREAKING",0);D.P2_LAYERING=new D("P2_LAYERING",1);D.P3_NODE_ORDERING=new D("P3_NODE_ORDERING",2);D.P4_NODE_PLACEMENT=new D("P4_NODE_PLACEMENT",3);D.P5_EDGE_ROUTING=new D("P5_EDGE_ROUTING",4);var oo=class n{constructor(t){this._graph=t;let e=hm().size;this._horizontal=Array.from({length:e},()=>new Array(e).fill(null)),this._vertical=Array.from({length:e},()=>new Array(e).fill(null)),this._precalculate()}_precalculate(){this._set(y.NORMAL,_.SPACING_NODE_NODE,_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._setPair(y.NORMAL,y.LONG_EDGE,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.NORMAL,y.NORTH_SOUTH_PORT,_.SPACING_EDGE_NODE),this._setPair(y.NORMAL,y.EXTERNAL_PORT,_.SPACING_EDGE_NODE),this._setPair(y.NORMAL,y.LABEL,_.SPACING_NODE_NODE,_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._set(y.LONG_EDGE,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this._setPair(y.LONG_EDGE,y.NORTH_SOUTH_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.LONG_EDGE,y.EXTERNAL_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.LONG_EDGE,y.LABEL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._set(y.NORTH_SOUTH_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.NORTH_SOUTH_PORT,y.EXTERNAL_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.NORTH_SOUTH_PORT,y.LABEL,_.SPACING_LABEL_NODE),this._set(y.EXTERNAL_PORT,_.SPACING_PORT_PORT),this._setPair(y.EXTERNAL_PORT,y.LABEL,_.SPACING_LABEL_PORT_VERTICAL,_.SPACING_LABEL_PORT_HORIZONTAL),this._set(y.LABEL,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE),this._set(y.BREAKING_POINT,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.NORMAL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.LABEL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.LONG_EDGE,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS)}_set(t,e,o){let r=Is(t);this._vertical[r][r]=e,o!==void 0&&(this._horizontal[r][r]=o)}_setPair(t,e,o,r){let i=Is(t),s=Is(e);this._vertical[i][s]=o,this._vertical[s][i]=o,r!==void 0&&(this._horizontal[i][s]=r,this._horizontal[s][i]=r)}getHorizontalSpacing(t,e){if(xg(t)&&xg(e))return this._getLocalSpacingNodes(t,e,this._horizontal);if(Dg(t)&&Dg(e))return this._getLocalSpacingTypes(t,e,this._horizontal);throw new yn("getHorizontalSpacing requires two nodes or two node types")}getVerticalSpacing(t,e){if(xg(t)&&xg(e))return this._getLocalSpacingNodes(t,e,this._vertical);if(Dg(t)&&Dg(e))return this._getLocalSpacingTypes(t,e,this._vertical);throw new yn("getVerticalSpacing requires two nodes or two node types")}_getLocalSpacingNodes(t,e,o){let r=o[Is(t.getType())][Is(e.getType())];if(r==null)throw new yn(`No spacing between ${t.getType()} and ${e.getType()}`);let i=n.getIndividualOrDefault(t,r),s=n.getIndividualOrDefault(e,r);return Math.max(i,s)}_getLocalSpacingTypes(t,e,o){let r=o[Is(t)][Is(e)];if(r==null)throw new yn(`No spacing between ${t} and ${e}`);return this._graph.getProperty(r)}static getIndividualOrDefault(t,e){let o=null;if(t.hasProperty(_.SPACING_INDIVIDUAL)){let r=t.getProperty(_.SPACING_INDIVIDUAL);r&&r.hasProperty&&r.hasProperty(e)&&(o=r.getProperty(e))}return o==null&&(o=t.getGraph().getProperty(e)),o}},yn=class extends Error{constructor(t="unspecified spacing"){super(t),this.name="UnspecifiedSpacingException"}};function xg(n){return n!=null&&typeof n.getType=="function"&&typeof n.getPorts=="function"}function Dg(n){return n instanceof y}var qu=null;function hm(){return qu===null&&(qu=new Map([y.NORMAL,y.LONG_EDGE,y.EXTERNAL_PORT,y.NORTH_SOUTH_PORT,y.LABEL,y.BREAKING_POINT,y.PLACEHOLDER,y.NONSHIFTING_PLACEHOLDER].map((n,t)=>[n,t]))),qu}function Is(n){let t=hm().get(n);if(t===void 0)throw new Error(`Unknown NodeType ${n}`);return t}var wg=class{process(t,e){e.begin("Node margin calculation",1);for(let o of t.getLayers())for(let r of o.getNodes())uT(r);e.done()}};function uT(n){let t=n.getMargin(),e=n.getProperty(p.TOP_COMMENTS),o=n.getProperty(p.BOTTOM_COMMENTS);if(e==null&&o==null)return;let r=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_COMMENT),i=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_NODE),s=0;if(e!=null){let c=0;for(let g of e)g.getSize().y>c&&(c=g.getSize().y),s+=g.getSize().x;s+=r*(e.length-1),t.top+=c+i}let a=0;if(o!=null){let c=0;for(let g of o)g.getSize().y>c&&(c=g.getSize().y),a+=g.getSize().x;a+=r*(o.length-1),t.bottom+=c+i}let l=Math.max(s,a);if(l>n.getSize().x){let c=(l-n.getSize().x)/2;c>t.left&&(t.left=c),c>t.right&&(t.right=c)}}var Mg=class{process(t,e){e.begin("Comment post-processing",1);for(let o of t){let r=[];for(let i of o){let s=i.getProperty(p.TOP_COMMENTS),a=i.getProperty(p.BOTTOM_COMMENTS);if(s!=null||a!=null){if(_T(i,s,a),s!=null)for(let l of s)r.push(l);if(a!=null)for(let l of a)r.push(l)}}for(let i of r)o.getNodes().push(i)}e.done()}};function _T(n,t,e){let o=n.getPosition(),r=n.getSize(),i=n.getMargin(),s=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_COMMENT);if(t!=null){let a=s*(t.length-1),l=0;for(let f of t)a+=f.getSize().x,f.getSize().y>l&&(l=f.getSize().y);let c=o.x-(a-r.x)/2,g=o.y-i.top+l,h=r.x/(t.length+1),d=h;for(let f of t){f.getPosition().x=c,f.getPosition().y=g-f.getSize().y,c+=f.getSize().x+s;let E=dm(f);E.getPosition().x=f.getSize().x/2-E.getAnchor().x,E.getPosition().y=f.getSize().y;let P=f.getProperty(p.COMMENT_CONN_PORT);P.getDegree()===1&&(P.getPosition().x=d-P.getAnchor().x,P.getPosition().y=0,P.setNode(n)),d+=h}}if(e!=null){let a=s*(e.length-1),l=0;for(let f of e)a+=f.getSize().x,f.getSize().y>l&&(l=f.getSize().y);let c=o.x-(a-r.x)/2,g=o.y+r.y+i.bottom-l,h=r.x/(e.length+1),d=h;for(let f of e){f.getPosition().x=c,f.getPosition().y=g,c+=f.getSize().x+s;let E=dm(f);E.getPosition().x=f.getSize().x/2-E.getAnchor().x,E.getPosition().y=0;let P=f.getProperty(p.COMMENT_CONN_PORT);P.getDegree()===1&&(P.getPosition().x=d-P.getAnchor().x,P.getPosition().y=r.y,P.setNode(n)),d+=h}}}function dm(n){let t=n.getProperty(p.COMMENT_CONN_PORT);for(let e of n.getPorts()){for(let o of e.getOutgoingEdges())return o.setTarget(t),e;for(let o of e.getIncomingEdges())return o.setSource(t),e}return null}var bg=class{process(t,e){e.begin("Comment pre-processing",1);let o=t.getLayerlessNodes(),r=0;for(;r<o.length;){let i=o[r];if(!i.getProperty(_.COMMENT_BOX)){r++;continue}let s=0,a=null,l=null;for(let c of i.getPorts())s+=c.getDegree(),c.getIncomingEdges().length===1&&(a=c.getIncomingEdges()[0],l=a.getSource()),c.getOutgoingEdges().length===1&&(a=c.getOutgoingEdges()[0],l=a.getTarget());if(s===1&&l!=null&&l.getDegree()===1&&!l.getNode().getProperty(_.COMMENT_BOX))pT(i,a,l,l.getNode()),o.splice(r,1);else{let c=[];for(let g of i.getPorts()){for(let h of g.getOutgoingEdges())h.getTarget().getOutgoingEdges().length>0&&c.push(h);for(let h of g.getIncomingEdges())h.getSource().getIncomingEdges().length>0&&c.push(h)}for(let g of c)g.reverse(t,!0);r++}}e.done()}};function pT(n,t,e,o){let r,i=!1,s=!1;if(o.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){let l=!1,c=!1;t:for(let g of o.getPorts())for(let h of g.getConnectedPorts())if(!h.getNode().getProperty(_.COMMENT_BOX)){if(g.getSide()===u.NORTH){l=!0;break t}if(g.getSide()===u.SOUTH){c=!0;break t}}i=c&&!l,s=l&&!c}if(!i&&!s&&o.getLabels().length>0){let l=0;for(let c of o.getLabels())l+=c.getPosition().y+c.getSize().y/2;l/=o.getLabels().length,r=l>=o.getSize().y/2}else r=!s;ET(o,r,i,s).push(n),n.setProperty(p.COMMENT_CONN_PORT,e),t.getTarget()===e?(t.setTarget(null),e.getDegree()===0&&e.setNode(null),mT(e)):(t.setSource(null),e.getDegree()===0&&e.setNode(null)),t.getBendPoints().clear()}function ET(n,t,e,o){if(t){let s=n.getProperty(p.TOP_COMMENTS);if(s==null)return s=[],n.setProperty(p.TOP_COMMENTS,s),s;if(e)return s;let a=n.getProperty(p.BOTTOM_COMMENTS);return a==null?(a=[],n.setProperty(p.BOTTOM_COMMENTS,a),a):s.length<=a.length?s:a}let r=n.getProperty(p.BOTTOM_COMMENTS);if(r==null)return r=[],n.setProperty(p.BOTTOM_COMMENTS,r),r;if(o)return r;let i=n.getProperty(p.TOP_COMMENTS);return i==null?(i=[],n.setProperty(p.TOP_COMMENTS,i),i):r.length<=i.length?r:i}function mT(n){let t=n.getProperty(p.PORT_DUMMY);if(t!=null){let e=t.getLayer(),o=e.getNodes().indexOf(t);if(o>=0&&e.getNodes().splice(o,1),e.getNodes().length===0){let r=t.getGraph(),i=r.getLayers().indexOf(e);i>=0&&r.getLayers().splice(i,1)}}}var Gg=class{process(t,e){e.begin("Constraints Postprocessor",1);let o=0;for(let r of t.getLayers()){let i=0,s=!1;for(let a of r.getNodes())a.getType()===y.NORMAL&&(s=!0,a.setProperty(_.LAYERING_LAYER_ID,o),a.setProperty(_.CROSSING_MINIMIZATION_POSITION_ID,i),i++);s&&o++}e.done()}};var J=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};J.NONE=new J("NONE");J.FIRST=new J("FIRST");J.FIRST_SEPARATE=new J("FIRST_SEPARATE");J.LAST=new J("LAST");J.LAST_SEPARATE=new J("LAST_SEPARATE");var De=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};De.NONE=new De("NONE");De.OUTGOING_ONLY=new De("OUTGOING_ONLY");De.INCOMING_ONLY=new De("INCOMING_ONLY");var Hg=class{process(t,e){e.begin("Edge and layer constraint edge reversal",1);let o=PT(t);OT(t,o),e.done()}};function PT(n){let t=[];for(let e of n.getLayerlessNodes()){let o=e.getProperty(_.LAYERING_LAYER_CONSTRAINT),r=fm(o);r!=null?(e.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),r===De.INCOMING_ONLY?Xa(n,e,o,W.INPUT):r===De.OUTGOING_ONLY&&Xa(n,e,o,W.OUTPUT)):t.push(e)}return t}function OT(n,t){for(let e of t){let o=e.getProperty(_.LAYERING_LAYER_CONSTRAINT),r=fm(o);r!=null?(e.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),r===De.INCOMING_ONLY?Xa(n,e,o,W.INPUT):r===De.OUTGOING_ONLY&&Xa(n,e,o,W.OUTPUT)):e.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&e.getPorts().length>0&&ST(e)&&Xa(n,e,o,W.UNDEFINED)}}function ST(n){for(let t of n.getPorts()){let e=t.getSide()===u.EAST&&t.getNetFlow()>0,o=t.getSide()===u.WEST&&t.getNetFlow()<0;if(!(e||o))return!1;for(let r of t.getOutgoingEdges()){let i=r.getTarget().getNode().getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.LAST||i===J.LAST_SEPARATE)return!1}for(let r of t.getIncomingEdges()){let i=r.getSource().getNode().getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.FIRST||i===J.FIRST_SEPARATE)return!1}}return!0}function fm(n){switch(n){case J.FIRST:case J.FIRST_SEPARATE:return De.OUTGOING_ONLY;case J.LAST:case J.LAST_SEPARATE:return De.INCOMING_ONLY;default:return null}}function Xa(n,t,e,o){let r=t.getPorts().slice();for(let i of r){if(o===W.INPUT||o===W.UNDEFINED){let s=i.getOutgoingEdges().slice();for(let a of s)TT(e,a)&&a.reverse(n,!0)}if(o===W.OUTPUT||o===W.UNDEFINED){let s=i.getIncomingEdges().slice();for(let a of s)NT(e,a)&&a.reverse(n,!0)}}}function TT(n,t){if(t.getProperty(p.REVERSED))return!1;let e=t.getTarget().getNode();return!(n===J.LAST&&e.getType()===y.LABEL||e.getProperty(_.LAYERING_LAYER_CONSTRAINT)===J.LAST_SEPARATE)}function NT(n,t){if(t.getProperty(p.REVERSED))return!1;let e=t.getSource().getNode();return!(n===J.FIRST&&e.getType()===y.LABEL||e.getProperty(_.LAYERING_LAYER_CONSTRAINT)===J.FIRST_SEPARATE)}var vg=class{process(t,e){e.begin("End label post-processing",1);for(let o of t.getLayers())for(let r of o.getNodes())(r.getType()===y.NORMAL||r.getType()===y.EXTERNAL_PORT)&&r.hasProperty(p.END_LABELS)&&yT(r);e.done()}};function yT(n){let t=n.getProperty(p.END_LABELS);if(t==null||t.size===0)return;let e=n.getPosition();for(let o of t.values())o.getCellRectangle().move(e),o.applyLabelLayout();n.setProperty(p.END_LABELS,null)}var _m=-1,In=class{process(t,e){e.begin("End label pre-processing",1);let o=t.getProperty(_.SPACING_EDGE_LABEL),r=t.getProperty(_.SPACING_LABEL_LABEL),i=t.getProperty(_.DIRECTION),s=i!=null&&i.isVertical&&i.isVertical();for(let a of t.getLayers())for(let l of a.getNodes())IT(l,o,r,s);e.done()}static gatherLabels(t){return pm(t)}};function IT(n,t,e,o){let r=n.getPorts(),i=r.length,s=new Array(i);for(let l=0;l<i;l++){let c=r[l];c.id=l,s[l]=RT(pm(c),e,o)}LT(n,s,e,t,o);let a=new Map;for(let l=0;l<s.length;l++)s[l]!=null&&a.set(r[l],s[l]);a.size>0&&(n.setProperty(p.END_LABELS,a),xT(n,s))}function RT(n,t,e){if(n==null||n.length===0)return null;let o=new Ni(t,!e);for(let i of n)o.addLabel(i);let r=o.getCellRectangle();return r.height=o.getMinimumHeight(),r.width=o.getMinimumWidth(),o}function pm(n){let t=[],e=um(n,t),o=n.getProperty(p.PORT_DUMMY);if(o!=null){for(let r of o.getPorts())if(r.getProperty(p.ORIGIN)===n){let i=um(r,t);i>e&&(e=i)}}return t.length>0&&n.setProperty(p.MAX_EDGE_THICKNESS,e),e!==_m?t:null}function um(n,t){let e=_m,o=[];for(let r of n.getConnectedEdges()){let i=r.getProperty(_.EDGE_THICKNESS);if(i>e&&(e=i),r.getSource()===n)for(let s of r.getLabels())s.getProperty(_.EDGE_LABELS_PLACEMENT)===St.TAIL&&o.push(s);else for(let s of r.getLabels())s.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD&&o.push(s);for(let s of o)s.hasProperty(p.END_LABEL_EDGE)||s.setProperty(p.END_LABEL_EDGE,r),t.push(s);o.length=0}return e}function LT(n,t,e,o,r){let i=new Set;for(let s of n.getPorts())t[s.id]!=null&&(AT(s,t[s.id],o),i.add(s.getSide()));r?(Bg(n,t,u.EAST,2*e,o),Bg(n,t,u.WEST,2*e,o)):(Bg(n,t,u.NORTH,2*e,o),Bg(n,t,u.SOUTH,2*e,o))}function AT(n,t,e){let o=t.getCellRectangle(),r=n.getNode(),i=r.getSize(),s=r.getMargin(),a=n.getPosition(),l=new O(a.x+n.getAnchor().x,a.y+n.getAnchor().y),c=n.getProperty(p.MAX_EDGE_THICKNESS),g=DT(t)===Vt.ABOVE;switch(n.getSide()){case u.NORTH:{t.setVerticalAlignment(nt.BOTTOM),o.y=-s.top-e-o.height,g?(t.setHorizontalAlignment(lt.RIGHT),o.x=l.x-c-e-o.width):(t.setHorizontalAlignment(lt.LEFT),o.x=l.x+c+e);break}case u.EAST:{t.setHorizontalAlignment(lt.LEFT),o.x=i.x+s.right+e,g?(t.setVerticalAlignment(nt.BOTTOM),o.y=l.y-c-e-o.height):(t.setVerticalAlignment(nt.TOP),o.y=l.y+c+e);break}case u.SOUTH:{t.setVerticalAlignment(nt.TOP),o.y=i.y+s.bottom+e,g?(t.setHorizontalAlignment(lt.RIGHT),o.x=l.x-c-e-o.width):(t.setHorizontalAlignment(lt.LEFT),o.x=l.x+c+e);break}case u.WEST:{t.setHorizontalAlignment(lt.RIGHT),o.x=-s.left-e-o.width,g?(t.setVerticalAlignment(nt.BOTTOM),o.y=l.y-c-e-o.height):(t.setVerticalAlignment(nt.TOP),o.y=l.y+c+e);break}default:break}}function Bg(n,t,e,o,r){let i=fs.createForDirection(wT(e)).withGap(o,o).withStartCoordinate(CT(n,e,r));for(let s of n.getPorts(e))t[s.id]!=null&&i.addRectangle(t[s.id].getCellRectangle());i.removeOverlaps()}function CT(n,t,e){let o=n.getSize(),r=n.getMargin();switch(t){case u.NORTH:return-r.top-e;case u.SOUTH:return o.y+r.bottom+e;case u.EAST:return o.x+r.right+e;case u.WEST:return-r.left-e;default:return 0}}function xT(n,t){let e=n.getMargin(),o=n.getSize(),r=new dt(-e.left,-e.top,e.left+o.x+e.right,e.top+o.y+e.bottom);for(let i of t)i!=null&&r.union(i.getCellRectangle());e.left=-r.x,e.top=-r.y,e.right=r.width-e.left-o.x,e.bottom=r.height-e.top-o.y}function DT(n){return n.getLabels()[0].getProperty(p.LABEL_SIDE)}function wT(n){switch(n){case u.NORTH:return Jt.UP;case u.SOUTH:return Jt.DOWN;case u.EAST:return Jt.RIGHT;case u.WEST:return Jt.LEFT;default:return null}}var Ug=class{process(t,e){e.begin("Sort end labels",1);for(let o of t.getLayers())for(let r of o.getNodes())r.getType()===y.NORMAL&&MT(r,t);e.done()}};function MT(n,t){if(!n.hasProperty(p.END_LABELS))return;let e=n.getProperty(p.END_LABELS),o=!1;for(let r of n.getPorts())bT(r)&&(o||(GT(t),o=!0),HT(e.get(r)))}function bT(n){let t=0;for(let e of n.getIncomingEdges())e.getLabels().some(o=>o.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD)&&t++;for(let e of n.getOutgoingEdges())e.getLabels().some(o=>o.getProperty(_.EDGE_LABELS_PLACEMENT)===St.TAIL)&&t++;return t>=2}function GT(n){let t=0;for(let e of n)for(let o of e){o.id=t++;for(let r of o.getPorts())r.id=t++}}function HT(n){if(n==null)return;let t=new Map,e=n.getLabels();for(let r of e){let i=r.getProperty(p.END_LABEL_EDGE),s=t.get(i);s==null&&(s=[],t.set(i,s)),s.push(r)}let o=Array.from(t.entries());o.sort((r,i)=>{let s=r[0],a=i[0];if(s==null||a==null)return 0;let l=s.getSource().id-a.getSource().id;if(l!==0)return l;let c=s.getTarget().getNode().id-a.getTarget().getNode().id;return c!==0?c:a.getTarget().id-s.getTarget().id}),e.length=0;for(let[,r]of o)for(let i of r)e.push(i)}var re=class{constructor(t){this.name=t}toString(){return this.name}};re.NONE=new re("NONE");re.LEFT=new re("LEFT");re.RIGHT=new re("RIGHT");re.LEFT_RIGHT_CONSTRAINT_LOCKING=new re("LEFT_RIGHT_CONSTRAINT_LOCKING");re.LEFT_RIGHT_CONNECTION_LOCKING=new re("LEFT_RIGHT_CONNECTION_LOCKING");re.EDGE_LENGTH=new re("EDGE_LENGTH");var Qr=Object.freeze({CONSERVATIVE:"CONSERVATIVE",CONSERVATIVE_SOFT:"CONSERVATIVE_SOFT",SLOPPY:"SLOPPY",values(){return[this.CONSERVATIVE,this.CONSERVATIVE_SOFT,this.SLOPPY]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var Fg=class n{constructor(...t){if(this.top=Number.MAX_VALUE,this.bottom=-Number.MAX_VALUE,this.left=Number.MAX_VALUE,this.right=-Number.MAX_VALUE,t.length===4&&t.every(e=>typeof e=="number")){let[e,o,r,i]=t;if(o>i)throw new RangeError("Top must be smaller or equal to bottom.");if(e>r)throw new RangeError("Left must be smaller or equal to right.");this.top=o,this.right=r,this.bottom=i,this.left=e;return}if(t.length===1){let e=t[0];if(e instanceof n){this.top=e.top,this.right=e.right,this.bottom=e.bottom,this.left=e.left;return}if(e instanceof O){this.top=e.y,this.bottom=e.y,this.right=e.x,this.left=e.x;return}if(typeof e.getPosition=="function"&&typeof e.getSize=="function"){let o=e.getPosition(),r=new O(o.x+e.getSize().x,o.y+e.getSize().y);this.top=Math.min(o.y,r.y),this.bottom=Math.max(o.y,r.y),this.left=Math.min(o.x,r.x),this.right=Math.max(o.x,r.x);return}if(Array.isArray(e)||typeof e[Symbol.iterator]=="function"){for(let o of e)this.union(o);return}}if(t.length>=1){for(let e of t)this.union(e);return}}union(t){if(t instanceof n){this.top=Math.min(this.top,t.top),this.right=Math.max(this.right,t.right),this.bottom=Math.max(this.bottom,t.bottom),this.left=Math.min(this.left,t.left);return}if(t instanceof O){this.top=Math.min(this.top,t.y),this.right=Math.max(this.right,t.x),this.bottom=Math.max(this.bottom,t.y),this.left=Math.min(this.left,t.x);return}if(typeof t.getPosition=="function"&&typeof t.getSize=="function"){this.union(t.getPosition());let e=t.getPosition();this.union(new O(e.x+t.getSize().x,e.y+t.getSize().y));return}}static union(t,e){if(e instanceof n){let s=new n(t);return s.union(e),s}let o=e[Symbol.iterator](),r=o.next();if(r.done)throw new RangeError("Empty rectangle collection");let i=new n(r.value);for(let s of o)i.union(s);return i}enlarge(t){this.top-=t,this.left-=t,this.right+=t,this.bottom+=t}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}getTop(){return this.top}getRight(){return this.right}getBottom(){return this.bottom}getLeft(){return this.left}getFromPortSide(t){switch(t){case u.NORTH:return this.top;case u.EAST:return this.right;case u.SOUTH:return this.bottom;case u.WEST:return this.left;default:return 0}}toNodeMargins(t){let e=new me,o=new n(0,0,t.getSize().x,t.getSize().y);return e.top=Math.max(0,o.top-this.top),e.left=Math.max(0,o.left-this.left),e.bottom=Math.max(0,this.bottom-o.bottom),e.right=Math.max(0,this.right-o.right),e}toString(){return"[top= "+this.top.toFixed(1)+",left= "+this.left.toFixed(1)+",bottom= "+this.bottom.toFixed(1)+",right= "+this.right.toFixed(1)+"]"}};var uo=1e-6,Rs=class n{constructor(...t){if(this.knotVector=[],this.controlPoints=[],this.dimNUBS=0,this.isUniform=!1,this.isClamped=!1,this.outerBox=null,this.isBezier=!1,this.minKnot=0,this.maxKnot=0,t.length===1&&t[0]instanceof n){let a=t[0];this.dimNUBS=a.dimNUBS,this.isUniform=a.isUniform,this.isClamped=a.isClamped,this.outerBox=a.outerBox,this.isBezier=a.isBezier,this.knotVector=a.knotVector.slice(),this.minKnot=a.minKnot,this.maxKnot=a.maxKnot,this.controlPoints=a.controlPoints.slice();return}if(t.length===6){let[a,l,c,g,h,d]=t;this.isClamped=a,this.isUniform=l,this.isBezier=c,this.dimNUBS=g,this.knotVector=h,this.controlPoints=d,this.minKnot=h[0],this.maxKnot=h[h.length-1];return}let e=t[0],o=t[1],r;if(t.length===3&&Array.isArray(t[2])?r=t[2].slice():t.length===3&&t[2]instanceof st?r=Array.from(t[2]):r=t.slice(2),o<1)throw new RangeError("The dimension must be at least 1!");for(;r.length<o+1;)r.unshift(r[0]);if(r.length<o+1)throw new RangeError("At least (dimension + 1) control points are necessary!");this.dimNUBS=o,this.isClamped=e,this.isUniform=!0,this.isBezier=!1,this._createUniformKnotVector(e,r.length+this.dimNUBS-1);let i=[],s=0;for(let a=0;a<this.dimNUBS-1;a++)i.push(this.knotVector[s++]);for(let a of r)i.push(this.knotVector[s++]),this.controlPoints.push(new Rn(a,i)),i.shift()}static generateDerivedNUBS(t){let e=t.isClamped,o=t.isUniform,r=t.isBezier,i=t.dimNUBS,s=i-1,a=t.knotVector,l=t.knotVector.slice(1,t.knotVector.length-1),c=[];for(let f=0;f<t.controlPoints.length-1;f++){let E=t.controlPoints[f+1].getCp().clone().sub(t.controlPoints[f].getCp()).scale(i/(a[f+i]-a[f]));c.push(E)}let g=[],h=0,d=[];for(let f=0;f<s-1;f++)g.push(l[h++]);for(let f of c)g.push(l[h++]),d.push(new Rn(f,g)),g.shift();return new n(e,o,r,s,l,d)}static generateInvertedNUBS(t){let e=[],o=t.knotVector[t.knotVector.length-1];for(let l of t.knotVector)e.unshift(o-l);let r=st.reverse(t.getControlPoints()),i=[],s=0,a=[];for(let l=0;l<t.dimNUBS-1;l++)i.push(e[s++]);for(let l of r)i.push(e[s++]),a.push(new Rn(l,i)),i.shift();return new n(t.isClamped,t.isUniform,t.isBezier,t.dimNUBS,e,a)}getDim(){return this.dimNUBS}getOuterBox(){return this.outerBox===null&&this._calculateOuterBox(),this.outerBox}setOuterBox(t){this.outerBox=t}getControlPoints(){let t=new st;for(let e of this.controlPoints)t.push(e.getCp());return t}getControlPoint(t){return this.controlPoints[t].getCp()}getControlPointsSize(){return this.controlPoints.length}getKnotVector(){return this.knotVector.slice()}_getIndexInKnotVector(t){for(let e=0;e<this.knotVector.length;e++)if(Math.abs(this.knotVector[e]-t)<uo)return e;return this.knotVector.length}_getMultiplicity(t){let e=0;for(let o of this.knotVector){let r=o-t;if(r>uo)return e;r>-uo&&e++}return e}_createUniformKnotVector(t,e){if(e<2*this.dimNUBS)throw new RangeError("The knot vector must have at least two times the dimension elements.");let o;if(t){this.minKnot=0,this.maxKnot=1;for(let i=0;i<this.dimNUBS;i++)this.knotVector.push(0);o=e+1-2*this.dimNUBS}else{o=e+1;let i=this.dimNUBS;this.minKnot=i/(o+1),this.maxKnot=(o-i)/o}let r=o;for(let i=1;i<o;i++)this.knotVector.push(i/r);if(this.isClamped)for(let i=0;i<this.dimNUBS;i++)this.knotVector.push(1)}_calculateOuterBox(){this.outerBox=new Fg(this.getControlPoints())}static _getTFromPolar(t){let e=0;for(let o of t)e+=o;return e/t.length}_insertKnot(t,e){let o;this.isClamped?o=this.dimNUBS:o=this.dimNUBS-1;let r=this.knotVector[o++],i=0;for(;r-t<uo;)r=this.knotVector[o++],i++;o--,this._insertKnotAtCurrentPosition(e,t,i,o)}_insertKnotAtCurrentPosition(t,e,o,r){let i=this._getMultiplicity(e);for(let s=0;s<t;s++){this.knotVector.splice(r,0,e),r++;let a=[],l=o,c=this.controlPoints[l++];for(let d=i+s;d<this.dimNUBS;d++){let f=c;c=this.controlPoints[l++],a.push(new Rn(f,c,e))}let g=o+1,h=Math.max(0,a.length-1);this.controlPoints.splice(g,h,...a),s<t-1?o+=1:o+=1+a.length}return{cpIdx:o,knotIdx:r}}static _getFirstVerticalPoint(t,e,o){let r=n.generateDerivedNUBS(t),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroXOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.x),a++;return t._getPointOnCurve(l,!1)}static _getLastVerticalPoint(t,e,o){let r=n.generateInvertedNUBS(n.generateDerivedNUBS(t)),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroXOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.x),a++;let c=t.getKnotVector()[t.getKnotVector().length-1];return t._getPointOnCurve(c-l,!1)}static _getFirstHorizontalPoint(t,e,o){let r=n.generateDerivedNUBS(t),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroYOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.y),a++;return t._getPointOnCurve(l,!1)}static _getLastHorizontalPoint(t,e,o){let r=n.generateInvertedNUBS(n.generateDerivedNUBS(t)),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroYOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.y),a++;let c=t.getKnotVector()[t.getKnotVector().length-1];return t._getPointOnCurve(c-l,!1)}_getPointOnCurve(t,e=!1){let o=this._getMultiplicity(t);if(o===this.dimNUBS)return this.getControlPoint(this._getIndexInKnotVector(t));if(e)return this._insertKnot(t,this.dimNUBS-o),this.getControlPoint(this._getIndexInKnotVector(t));let r=new n(this);return r._insertKnot(t,this.dimNUBS-o),r.getControlPoint(r._getIndexInKnotVector(t))}static _getZeroYOfControlPoligon(t){let e=t.controlPoints;if(e.length===0)return 0;let o=e[0],r=o.getCp().y,i=r>uo,s=r<-uo;for(let a=1;a<e.length;a++){let l=o,c=r,g=i,h=s;if(o=e[a],r=o.getCp().y,i=r>uo,s=r<-uo,!(i||s))return n._getTFromPolar(o.getPolarCoordinate());if(g&&s||h&&i){let d=c/(c-r),f=n._getTFromPolar(l.getPolarCoordinate()),E=n._getTFromPolar(o.getPolarCoordinate());return d*f+(1-d)*E}}return 0}static _getZeroXOfControlPoligon(t){let e=t.controlPoints;if(e.length===0)return 0;let o=e[0],r=o.getCp().x,i=r>uo,s=r<-uo;for(let a=1;a<e.length;a++){let l=o,c=r,g=i,h=s;if(o=e[a],r=o.getCp().x,i=r>uo,s=r<-uo,!(i||s))return n._getTFromPolar(o.getPolarCoordinate());if(g&&s||h&&i){let d=c/(c-r),f=n._getTFromPolar(l.getPolarCoordinate()),E=n._getTFromPolar(o.getPolarCoordinate());return d*f+(1-d)*E}}return 0}toBezier(){if(this.isBezier)return;let t;this.isClamped?t=this.dimNUBS:(this.knotVector.splice(0,this.dimNUBS-1),t=0);let e=0,o=this.knotVector[t++];for(;this.maxKnot-o>uo;){let r=o,i=0;for(;Math.abs(o-r)<uo;)i++,o=this.knotVector[t++],e++;if(i<this.dimNUBS){t--;let s=this._insertKnotAtCurrentPosition(this.dimNUBS-i,r,e,t);e=s.cpIdx,t=s.knotIdx,o=this.knotVector[t++]}e--}this.isClamped||this.knotVector.splice(t,this.dimNUBS-1),this.isClamped=!0,this.isBezier=!0}getBezierCP(t=!1,e=!1){this.isBezier||this.toBezier();let o=new st,r=0;t||(r=1);for(let i=r;i<this.controlPoints.length;i++)o.push(this.controlPoints[i].getCp());return e||o.pop(),o}static generateNiceCurve(){let t=new st,e=new O(5.5,23),o=new O(2.5,12),r=new O(5,10),i=new O(5,9),s=new O(3.8,5.5),a=new O(7,4),l=new O(7,3.5),c=new O(6,2.2),g=new O(8,.5),h=(d,f)=>new O(f+f-d.x,d.y);return t.push(e,e,e,o,r,i,s,a,l,c,g,h(c,g.x),h(l,g.x),h(a,g.x),h(s,g.x),h(i,g.x),h(r,g.x),h(o,g.x),h(e,g.x),h(e,g.x),h(e,g.x)),t.scale(5),t.offset(-50,-80),new n(!0,3,t)}toString(){return`[${this.controlPoints.join(", ")}]`}};Rs.DIM=3;var Rn=class n{constructor(t,e,o){if(arguments.length===2){if(t instanceof n){this.cp=t.getCp().clone(),this.polarCoordinate=t.polarCoordinate.slice();return}this.cp=t.clone(),this.polarCoordinate=e.slice();return}if(arguments.length===1){let f=t;this.cp=f.getCp().clone(),this.polarCoordinate=f.polarCoordinate.slice();return}let r=t,i=e,s=o,a=r.polarCoordinate[0],l=i.polarCoordinate[i.polarCoordinate.length-1],c=r.cp.clone().scale(l-s),g=i.cp.clone().scale(s-a),h=c.add(g);h.scale(1/(l-a)),this.cp=h,this.polarCoordinate=[];let d=!0;for(let f=1;f<r.polarCoordinate.length;f++){let E=r.polarCoordinate[f];d&&E-s>uo&&(this.polarCoordinate.push(s),d=!1),this.polarCoordinate.push(E)}d&&this.polarCoordinate.push(s)}getCp(){return this.cp}setCp(t){this.cp=t}getPolarCoordinate(){return this.polarCoordinate}setPolarCoordinate(t){this.polarCoordinate=t}toString(){return`[${this.polarCoordinate.join(",")}] (${this.cp.x.toFixed(2)}, ${this.cp.y.toFixed(2)})`}};var v=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};v.COMMENTS=new v("COMMENTS");v.EXTERNAL_PORTS=new v("EXTERNAL_PORTS");v.HYPEREDGES=new v("HYPEREDGES");v.HYPERNODES=new v("HYPERNODES");v.NON_FREE_PORTS=new v("NON_FREE_PORTS");v.NORTH_SOUTH_PORTS=new v("NORTH_SOUTH_PORTS");v.SELF_LOOPS=new v("SELF_LOOPS");v.CENTER_LABELS=new v("CENTER_LABELS");v.END_LABELS=new v("END_LABELS");v.PARTITIONS=new v("PARTITIONS");var Ln=class Ln{constructor(t,e,o,r){this._type=t,this._weight=r,this._source=null,this._target=null,this.setSource(e),this.setTarget(o)}static createAndAddRegular(t,e,o){return new Ln(Hr.REGULAR,t,e,o)}static createAndAddCritical(t,e){return new Ln(Hr.CRITICAL,t,e,Ln.CRITICAL_DEPENDENCY_WEIGHT)}remove(){this.setSource(null),this.setTarget(null)}reverse(){let t=this._source,e=this._target;this.setSource(e),this.setTarget(t)}getType(){return this._type}getSource(){return this._source}setSource(t){if(this._source!=null){let e=this._source.getOutgoingSegmentDependencies(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._source=t,this._source!=null&&this._source.getOutgoingSegmentDependencies().push(this)}getTarget(){return this._target}setTarget(t){if(this._target!=null){let e=this._target.getIncomingSegmentDependencies(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._target=t,this._target!=null&&this._target.getIncomingSegmentDependencies().push(this)}getWeight(){return this._weight}toString(){return`${this._source}->${this._target} (${this._type})`}};Z(Ln,"CRITICAL_DEPENDENCY_WEIGHT",1);var $e=Ln,Hr=Object.freeze({REGULAR:"REGULAR",CRITICAL:"CRITICAL"});var Ka=class{static detectCycles(t,e,o){let r=[],i=[],s=[];vT(t,i,s,e),BT(t,i,s,e,o);for(let a of t)for(let l of a.getOutgoingSegmentDependencies())(!e||l.getType()===Hr.CRITICAL)&&a.mark>l.getTarget().mark&&r.push(l);return r}};function vT(n,t,e,o){let r=-1;for(let i of n){i.mark=r--;let s=0;for(let g of i.getIncomingSegmentDependencies())g.getType()===Hr.CRITICAL&&(s+=g.getWeight());let a=0;for(let g of i.getOutgoingSegmentDependencies())g.getType()===Hr.CRITICAL&&(a+=g.getWeight());let l=s,c=a;if(!o){l=0;for(let g of i.getIncomingSegmentDependencies())l+=g.getWeight();c=0;for(let g of i.getOutgoingSegmentDependencies())c+=g.getWeight()}i.setInWeight(l),i.setCriticalInWeight(s),i.setOutWeight(c),i.setCriticalOutWeight(a),c===0?e.push(i):l===0&&t.push(i)}}function BT(n,t,e,o,r){let i=new Set(n),s=[],a=n.length,l=a-1,c=a+1;for(;i.size>0;){for(;e.length>0;){let f=e.shift();i.delete(f),f.mark=l--,Ju(f,t,e,o)}for(;t.length>0;){let f=t.shift();i.delete(f),f.mark=c++,Ju(f,t,e,o)}let h=Number.MIN_SAFE_INTEGER;s.length=0;let d=!1;for(let f of[...i].sort((E,P)=>E.mark-P.mark)){if(!o&&f.getCriticalOutWeight()>0&&f.getCriticalInWeight()<=0){s.length=0,s.push(f),d=!0;break}let E=f.getOutWeight()-f.getInWeight();E>=h&&(E>h&&(s.length=0,h=E),s.push(f))}if(s.length>0){let f=s[r.nextInt(s.length)];i.delete(f),f.mark=c++,Ju(f,t,e,o),s.length=0}}let g=n.length+1;for(let h of n)h.mark<a&&(h.mark=h.mark+g)}function Ju(n,t,e,o){for(let r of n.getOutgoingSegmentDependencies())if(!o||r.getType()===Hr.CRITICAL){let i=r.getTarget();i.mark<0&&r.getWeight()>0&&(i.setInWeight(i.getInWeight()-r.getWeight()),r.getType()===Hr.CRITICAL&&i.setCriticalInWeight(i.getCriticalInWeight()-r.getWeight()),i.getInWeight()<=0&&i.getOutWeight()>0&&t.push(i))}for(let r of n.getIncomingSegmentDependencies())if(!o||r.getType()===Hr.CRITICAL){let i=r.getSource();i.mark<0&&r.getWeight()>0&&(i.setOutWeight(i.getOutWeight()-r.getWeight()),r.getType()===Hr.CRITICAL&&i.setCriticalOutWeight(i.getCriticalOutWeight()-r.getWeight()),i.getOutWeight()<=0&&i.getInWeight()>0&&e.push(i))}}var An=class n{constructor(t){this._routingStrategy=t,this._ports=[],this.mark=0,this._routingSlot=0,this._startPosition=Number.NaN,this._endPosition=Number.NaN,this._incomingConnectionCoordinates=[],this._outgoingConnectionCoordinates=[],this._outgoingSegmentDependencies=[],this._outDepWeight=0,this._criticalOutDepWeight=0,this._incomingSegmentDependencies=[],this._inDepWeight=0,this._criticalInDepWeight=0,this._splitPartner=null,this._splitBy=null}addPortPositions(t,e){e.set(t,this),this._ports.push(t);let o=this._routingStrategy.getPortPositionOnHyperNode(t);t.getSide()===this._routingStrategy.getSourcePortSide()?Em(this._incomingConnectionCoordinates,o):Em(this._outgoingConnectionCoordinates,o),this.recomputeExtent();for(let r of t.getConnectedPorts())e.has(r)||this.addPortPositions(r,e)}getPorts(){return this._ports}getRoutingSlot(){return this._routingSlot}setRoutingSlot(t){this._routingSlot=t}getStartCoordinate(){return this._startPosition}getEndCoordinate(){return this._endPosition}getIncomingConnectionCoordinates(){return this._incomingConnectionCoordinates}getOutgoingConnectionCoordinates(){return this._outgoingConnectionCoordinates}getOutgoingSegmentDependencies(){return this._outgoingSegmentDependencies}getIncomingSegmentDependencies(){return this._incomingSegmentDependencies}getOutWeight(){return this._outDepWeight}setOutWeight(t){this._outDepWeight=t}getCriticalOutWeight(){return this._criticalOutDepWeight}setCriticalOutWeight(t){this._criticalOutDepWeight=t}getInWeight(){return this._inDepWeight}setInWeight(t){this._inDepWeight=t}getCriticalInWeight(){return this._criticalInDepWeight}setCriticalInWeight(t){this._criticalInDepWeight=t}getSplitPartner(){return this._splitPartner}setSplitPartner(t){this._splitPartner=t}getSplitBy(){return this._splitBy}setSplitBy(t){this._splitBy=t}getLength(){return this.getEndCoordinate()-this.getStartCoordinate()}representsHyperedge(){return this._incomingConnectionCoordinates.length+this._outgoingConnectionCoordinates.length>2}isDummy(){return this._splitPartner!=null&&this._splitBy==null}recomputeExtent(){this._startPosition=Number.NaN,this._endPosition=Number.NaN,this._recomputeExtentOne(this._incomingConnectionCoordinates),this._recomputeExtentOne(this._outgoingConnectionCoordinates)}_recomputeExtentOne(t){if(t.length===0)return;let e=t[0],o=t[t.length-1];this._startPosition=Number.isNaN(this._startPosition)?e:Math.min(this._startPosition,e),this._endPosition=Number.isNaN(this._endPosition)?o:Math.max(this._endPosition,o)}simulateSplit(){let t=new n(this._routingStrategy),e=new n(this._routingStrategy);return t._incomingConnectionCoordinates.push(...this._incomingConnectionCoordinates),t._splitBy=this._splitBy,t._splitPartner=e,t.recomputeExtent(),e._outgoingConnectionCoordinates.push(...this._outgoingConnectionCoordinates),e._splitPartner=t,e.recomputeExtent(),Gt.of(t,e)}splitAt(t){for(this._splitPartner=new n(this._routingStrategy),this._splitPartner.setSplitPartner(this),this._splitPartner._outgoingConnectionCoordinates.push(...this._outgoingConnectionCoordinates),this._outgoingConnectionCoordinates.length=0,this._outgoingConnectionCoordinates.push(t),this._splitPartner._incomingConnectionCoordinates.push(t),this.recomputeExtent(),this._splitPartner.recomputeExtent();this._incomingSegmentDependencies.length>0;)this._incomingSegmentDependencies[0].remove();for(;this._outgoingSegmentDependencies.length>0;)this._outgoingSegmentDependencies[0].remove();return this._splitPartner}compareTo(t){return this.mark-t.mark}toString(){let t=[];for(let e of this._ports){let o=e.getNode().getDesignation();o==null&&(o="n"+e.getNode().getIndex()),t.push(o)}return"{"+t.join(",")+"}"}};function Em(n,t){for(let e=0;e<n.length;e++){if(n[e]===t)return;if(n[e]>t){n.splice(e,0,t);return}}n.push(t)}var kg=class{constructor(t){this._routingGenerator=t}splitSegments(t,e,o){if(t.length===0)return;let r=this._findFreeAreas(e,o),s=[...this._decideWhichSegmentsToSplit(t)].sort((a,l)=>a.getLength()-l.getLength());for(let a of s)this._split(a,e,r,o)}_findFreeAreas(t,e){let o=[],r=[];for(let i of t){for(let s of i.getIncomingConnectionCoordinates())r.push(s);for(let s of i.getOutgoingConnectionCoordinates())r.push(s)}r.sort((i,s)=>i-s);for(let i=1;i<r.length;i++)r[i]-r[i-1]>=2*e&&o.push(new Za(r[i-1]+e,r[i]-e));return o}_decideWhichSegmentsToSplit(t){let e=new Set;for(let o of t){let r=o.getSource(),i=o.getTarget();if(e.has(r)||e.has(i))continue;let s=r,a=i;r.representsHyperedge()&&!i.representsHyperedge()&&(s=i,a=r),e.add(s),s.setSplitBy(a)}return e}_split(t,e,o,r){let i=this._computePositionToSplitAndUpdateFreeAreas(t,o,r);e.push(t.splitAt(i)),this._updateDependencies(t,e)}_updateDependencies(t,e){let o=t.getSplitBy(),r=t.getSplitPartner();$e.createAndAddCritical(t,o),$e.createAndAddCritical(o,r);for(let i of e)i!==o&&i!==t&&i!==r&&(this._routingGenerator.createDependencyIfNecessary(i,t),this._routingGenerator.createDependencyIfNecessary(i,r))}_computePositionToSplitAndUpdateFreeAreas(t,e,o){let r=-1,i=-1;for(let a=0;a<e.length;a++){let l=e[a];if(l.startPosition>t.getEndCoordinate())break;l.endPosition>=t.getStartCoordinate()&&(r<0&&(r=a),i=a)}let s=UT(t);if(r>=0){let a=this._chooseBestAreaIndex(t,e,r,i);s=Qu(e[a]),this._useArea(e,a,o)}return s}_chooseBestAreaIndex(t,e,o,r){let i=o;if(o<r){let s=t.simulateSplit(),a=s.getFirst(),l=s.getSecond(),c=e[i],g=this._rateArea(t,a,l,c);for(let h=o+1;h<=r;h++){let d=e[h],f=this._rateArea(t,a,l,d);this._isBetter(d,f,c,g)&&(c=d,g=f,i=h)}}return i}_rateArea(t,e,o,r){let i=Qu(r);e.getOutgoingConnectionCoordinates().length=0,e.getOutgoingConnectionCoordinates().push(i),o.getIncomingConnectionCoordinates().length=0,o.getIncomingConnectionCoordinates().push(i);let s=new t_(0,0);for(let a of t.getIncomingSegmentDependencies()){let l=a.getSource();this._updateConsideringBothOrderings(s,e,l),this._updateConsideringBothOrderings(s,o,l)}for(let a of t.getOutgoingSegmentDependencies()){let l=a.getTarget();this._updateConsideringBothOrderings(s,e,l),this._updateConsideringBothOrderings(s,o,l)}return s.dependencies+=2,s.crossings+=this._countCrossingsForSingleOrdering(e,t.getSplitBy()),s.crossings+=this._countCrossingsForSingleOrdering(t.getSplitBy(),o),s}_updateConsideringBothOrderings(t,e,o){let r=this._countCrossingsForSingleOrdering(e,o),i=this._countCrossingsForSingleOrdering(o,e);r===i?r>0&&(t.dependencies+=2,t.crossings+=r):(t.dependencies+=1,t.crossings+=Math.min(r,i))}_countCrossingsForSingleOrdering(t,e){return ie.countCrossings(t.getOutgoingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate())+ie.countCrossings(e.getIncomingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate())}_isBetter(t,e,o,r){return e.crossings<r.crossings||e.crossings===r.crossings&&(e.dependencies<r.dependencies||e.dependencies===r.dependencies&&t.size>o.size)}_useArea(t,e,o){let r=t[e];if(t.splice(e,1),r.size/2>=o){let i=e,s=Qu(r),a=s-o;r.startPosition<=a&&t.splice(i++,0,new Za(r.startPosition,a));let l=s+o;l<=r.endPosition&&t.splice(i,0,new Za(l,r.endPosition))}}},Za=class{constructor(t,e){this.startPosition=t,this.endPosition=e,this.size=e-t}},t_=class{constructor(t,e){this.dependencies=t,this.crossings=e}};function UT(n){return(n.getStartCoordinate()+n.getEndCoordinate())/2}function Qu(n){return(n.startPosition+n.endPosition)/2}var Hi=class{constructor(){this._createdJunctionPoints=new Set}addJunctionPointIfNecessary(t,e,o,r){let i=r?o.y:o.x;if(this._createdJunctionPoints.has(o.x+","+o.y))return;let s=i>e.getStartCoordinate()&&i<e.getEndCoordinate(),a=!1,l=e.getIncomingConnectionCoordinates(),c=e.getOutgoingConnectionCoordinates();if(l.length>0&&c.length>0&&(a=a||Math.abs(i-l[0])<ie.TOLERANCE&&Math.abs(i-c[0])<ie.TOLERANCE,a=a||Math.abs(i-l[l.length-1])<ie.TOLERANCE&&Math.abs(i-c[c.length-1])<ie.TOLERANCE),s||a){let g=t.getProperty(_.JUNCTION_POINTS);g==null&&(g=new st,t.setProperty(_.JUNCTION_POINTS,g));let h=o.clone?o.clone():{x:o.x,y:o.y};g.add(h),this._createdJunctionPoints.add(h.x+","+h.y)}}getCreatedJunctionPoints(){return this._createdJunctionPoints}clearCreatedJunctionPoints(){this._createdJunctionPoints.clear()}getPortPositionOnHyperNode(t){throw new Error("Abstract method")}getSourcePortSide(){throw new Error("Abstract method")}getTargetPortSide(){throw new Error("Abstract method")}calculateBendPoints(t,e,o){throw new Error("Abstract method")}};var Wg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().x+t.getPosition().x+t.getAnchor().x}getSourcePortSide(){return u.SOUTH}getTargetPortSide(){return u.NORTH}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e+t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().x;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().x;if(Math.abs(s-c)<=ie.TOLERANCE)continue;let g=r,h=t,d=new O(s,g);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1),g=e+f.getRoutingSlot()*o,h=f,d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}d=new O(c,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}}}};var qe=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};qe.WEST_TO_EAST=new qe("WEST_TO_EAST");qe.NORTH_TO_SOUTH=new qe("NORTH_TO_SOUTH");qe.SOUTH_TO_NORTH=new qe("SOUTH_TO_NORTH");var zg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().x+t.getPosition().x+t.getAnchor().x}getSourcePortSide(){return u.NORTH}getTargetPortSide(){return u.SOUTH}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e-t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().x;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().x;if(Math.abs(s-c)<=ie.TOLERANCE)continue;let g=r,h=t,d=new O(s,g);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1),g=e-f.getRoutingSlot()*o,h=f,d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}d=new O(c,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}}}};var Yg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().y+t.getPosition().y+t.getAnchor().y}getSourcePortSide(){return u.EAST}getTargetPortSide(){return u.WEST}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e+t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().y;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().y;if(Math.abs(s-c)<=ie.TOLERANCE)continue;let g=r,h=t,d=new O(g,s);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(g,E),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0),g=e+f.getRoutingSlot()*o,h=f,d=new O(g,E),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0)}d=new O(g,c),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0)}}}};function mm(n){switch(n){case qe.WEST_TO_EAST:return new Yg;case qe.NORTH_TO_SOUTH:return new Wg;case qe.SOUTH_TO_NORTH:return new zg;default:throw new Error("Unknown routing direction: "+n)}}var ja=-1,FT=.5,kT=.2,Pm=1,Om=16,ie=class n{constructor(t,e,o=null){this._routingStrategy=mm(t),this._edgeSpacing=e,this._conflictThreshold=FT*e,this._criticalConflictThreshold=0,this._debugPrefix=o,this._segmentSplitter=null}routeEdges(t,e,o,r,i,s){let a=new Map,l=[];this._createHyperEdgeSegments(o,this._routingStrategy.getSourcePortSide(),l,a),this._createHyperEdgeSegments(i,this._routingStrategy.getTargetPortSide(),l,a),this._criticalConflictThreshold=kT*this._minimumHorizontalSegmentDistance(l);let c=0;for(let d=0;d<l.length-1;d++){let f=l[d];for(let E=d+1;E<l.length;E++)c+=this.createDependencyIfNecessary(f,l[E])}let g=e.getProperty(p.RANDOM);c>=2&&this._breakCriticalCycles(l,g),n.breakNonCriticalCycles(l,g),n._topologicalNumbering(l);let h=-1;for(let d of l)Math.abs(d.getStartCoordinate()-d.getEndCoordinate())<n.TOLERANCE||(h=Math.max(h,d.getRoutingSlot()),this._routingStrategy.calculateBendPoints(d,s,this._edgeSpacing));return this._routingStrategy.clearCreatedJunctionPoints(),h+1}_createHyperEdgeSegments(t,e,o,r){if(t!=null)for(let i of t)for(let s of i.getPorts(W.OUTPUT,e)){let a=r.get(s);a==null&&(a=new An(this._routingStrategy),o.push(a),a.addPortPositions(s,r))}}createDependencyIfNecessary(t,e){if(Math.abs(t.getStartCoordinate()-t.getEndCoordinate())<n.TOLERANCE||Math.abs(e.getStartCoordinate()-e.getEndCoordinate())<n.TOLERANCE)return 0;let o=this._countConflicts(t.getOutgoingConnectionCoordinates(),e.getIncomingConnectionCoordinates()),r=this._countConflicts(e.getOutgoingConnectionCoordinates(),t.getIncomingConnectionCoordinates()),i=o===ja||r===ja,s=0;if(i)o===ja&&($e.createAndAddCritical(e,t),s++),r===ja&&($e.createAndAddCritical(t,e),s++);else{let a=n.countCrossings(t.getOutgoingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate());a+=n.countCrossings(e.getIncomingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate());let l=n.countCrossings(e.getOutgoingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate());l+=n.countCrossings(t.getIncomingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate());let c=Pm*o+Om*a,g=Pm*r+Om*l;c<g?$e.createAndAddRegular(t,e,g-c):c>g?$e.createAndAddRegular(e,t,c-g):c>0&&g>0&&($e.createAndAddRegular(t,e,0),$e.createAndAddRegular(e,t,0))}return s}_countConflicts(t,e){let o=0;if(t.length===0||e.length===0)return 0;let r=0,i=0,s=t[r],a=e[i],l=!0;do{if(s>a-this._criticalConflictThreshold&&s<a+this._criticalConflictThreshold)return ja;s>a-this._conflictThreshold&&s<a+this._conflictThreshold&&o++,s<=a&&r+1<t.length?s=t[++r]:a<=s&&i+1<e.length?a=e[++i]:l=!1}while(l);return o}static countCrossings(t,e,o){let r=0;for(let i of t){if(i>o)break;i>=e&&r++}return r}_minimumHorizontalSegmentDistance(t){let e=[],o=[];for(let s of t){for(let a of s.getIncomingConnectionCoordinates())e.push(a);for(let a of s.getOutgoingConnectionCoordinates())o.push(a)}let r=n._minimumDifference(e),i=n._minimumDifference(o);return Math.min(r,i)}static _minimumDifference(t){let e=[...new Set(t)].sort((r,i)=>r-i),o=Number.MAX_VALUE;for(let r=1;r<e.length;r++)o=Math.min(o,e[r]-e[r-1]);return o}_breakCriticalCycles(t,e){let o=Ka.detectCycles(t,!0,e);this._segmentSplitter==null&&(this._segmentSplitter=new kg(this)),this._segmentSplitter.splitSegments(o,t,this._criticalConflictThreshold)}static breakNonCriticalCycles(t,e){let o=Ka.detectCycles(t,!1,e);for(let r of o)r.getWeight()===0?r.remove():r.reverse()}static _topologicalNumbering(t){let e=[],o=[];for(let i of t)i.setInWeight(i.getIncomingSegmentDependencies().length),i.setOutWeight(i.getOutgoingSegmentDependencies().length),i.getInWeight()===0&&e.push(i),i.getOutWeight()===0&&i.getIncomingConnectionCoordinates().length===0&&o.push(i);let r=-1;for(;e.length>0;){let i=e.shift();for(let s of i.getOutgoingSegmentDependencies()){let a=s.getTarget();a.setRoutingSlot(Math.max(a.getRoutingSlot(),i.getRoutingSlot()+1)),r=Math.max(r,a.getRoutingSlot()),a.setInWeight(a.getInWeight()-1),a.getInWeight()===0&&e.push(a)}}if(r>-1){for(let i of o)i.setRoutingSlot(r);for(;o.length>0;){let i=o.shift();for(let s of i.getIncomingSegmentDependencies()){let a=s.getSource();a.getIncomingConnectionCoordinates().length>0||(a.setRoutingSlot(Math.min(a.getRoutingSlot(),i.getRoutingSlot()-1)),a.setOutWeight(a.getOutWeight()-1),a.getOutWeight()===0&&o.push(a))}}}}};ie.TOLERANCE=.001;function Ls(n){let t=n.getProperty(p.EXT_PORT_SIDE);return n.getType()===y.EXTERNAL_PORT&&(t===u.WEST||t===u.EAST)}var Vg=class{getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);if(!e)return null;let o=K.create(),r=!1;return e.has(v.HYPEREDGES)&&(o.addBefore(D.P4_NODE_PLACEMENT,w.HYPEREDGE_DUMMY_MERGER),o.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR),r=!0),(e.has(v.NON_FREE_PORTS)||t.getProperty(_.FEEDBACK_EDGES))&&(o.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR),e.has(v.NORTH_SOUTH_PORTS)&&(o.addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)),r=!0),e.has(v.EXTERNAL_PORTS)&&(o.addBefore(D.P3_NODE_ORDERING,w.HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR),o.addBefore(D.P4_NODE_PLACEMENT,w.HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER),r=!0),e.has(v.SELF_LOOPS)&&(o.addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR),o.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER),o.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER),o.addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR),r=!0),e.has(v.HYPERNODES)&&(o.addAfter(D.P5_EDGE_ROUTING,w.HYPERNODE_PROCESSOR),r=!0),e.has(v.CENTER_LABELS)&&(o.addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER),o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER),o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),o.addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER),r=!0),e.has(v.END_LABELS)&&(o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),o.addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR),r=!0),r?o:null}process(t,e){e&&e.begin&&e.begin("Orthogonal edge routing",1);let o=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),r=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),s=new ie(qe.WEST_TO_EAST,r,null),a=0,l=t.getLayers(),c=-1,g=null,h=null,d=-1;for(;;){c++;let f=c<l.length?l[c]:null,E=f==null?null:f.getNodes(),P=c-1;g!=null&&(z.placeNodesHorizontally(g,a),a+=g.getSize().x);let S=g==null?a:a+i,T=s.routeEdges(e,t,h,d,E,S),N=g==null||h.every(Ls),I=f==null||E.every(Ls);if(T>0){let C=(T-1)*r;g!=null&&(C+=i),f!=null&&(C+=i),C<o&&!N&&!I&&(C=o),a+=C}else!N&&!I&&(a+=o);if(g=f,h=E,d=P,f==null)break}t.getSize().x=a,e&&e.done&&e.done()}};var Cn=class n{constructor(t,e,o){if(this.handled=!1,this.leftPorts=new Set,this.rightPorts=new Set,this.outgoing=[],this.incoming=[],this.mark=0,this.inweight=0,this.outweight=0,this.rank=0,this.edges=new Set,this.boundingBox=new dt,this.isWestOfInitialLayer=!1,this.xDelta=0,this.sourcePort=null,this.targetPort=null,this.initialSegment=!1,this.lastSegment=!1,this.sourceNode=null,this.targetNode=null,this.inverseOrder=!1,this.hyperEdgeTopYPos=0,this.hyperEdgeBottomYPos=0,this.centerControlPointY=0,this.edgeInformation=new Map,e instanceof Set||Array.isArray(e)){let r=t,i=e;o===Fe.LEFT?this.leftPorts.add(r):this.rightPorts.add(r);let a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of i){let h=g.getFirst(),d=g.getSecond(),f=d.getSource();f===r&&(f=d.getTarget()),h===Fe.LEFT?this.leftPorts.add(f):this.rightPorts.add(f);let E=n._anchorY(f);a=Math.min(a,E),l=Math.max(l,E)}let c=n._anchorY(r);this._setRelevantPositions(c,a,l);for(let g of i)this._addEdge(g.getSecond());this.isStraight=!1}else{let r=t,i=e,s=o;i===Fe.LEFT?this.leftPorts.add(r.getSource()):this.rightPorts.add(r.getSource()),s===Fe.LEFT?this.leftPorts.add(r.getTarget()):this.rightPorts.add(r.getTarget()),this._addEdge(r);let a=n._anchorY(r.getSource()),l=n._anchorY(r.getTarget());this._setRelevantPositions(a,l,l),this.isStraight=Math.abs(a-l)<WT}}_addEdge(t){this.edges.add(t);let e=new e_;this.edgeInformation.set(t,e),e.startY=n._anchorY(t.getSource()),e.endY=n._anchorY(t.getTarget()),e.normalSourceNode=n._isNormalNode(t.getSource().getNode()),e.normalTargetNode=n._isNormalNode(t.getTarget().getNode()),e.invertedLeft=t.getSource().getSide()===u.WEST,e.invertedRight=t.getTarget().getSide()===u.EAST}static _anchorY(t){return u.SIDES_NORTH_SOUTH.has(t.getSide())?t.getProperty(p.SPLINE_NS_PORT_Y_COORD):t.getAbsoluteAnchor().y}static _isNormalNode(t){let e=t.getType();return e===y.NORMAL||e===y.BREAKING_POINT}isHyperEdge(){return this.edges.size>1}compareTo(t){return this.mark-t.mark}_setRelevantPositions(t,e,o){this.boundingBox.y=Math.min(t,e),this.boundingBox.height=Math.max(t,o)-this.boundingBox.y,t<e?(this.centerControlPointY=Sm*(t+e),this.hyperEdgeTopYPos=Xg*this.centerControlPointY+$a*t,this.hyperEdgeBottomYPos=Xg*this.centerControlPointY+$a*e):(this.centerControlPointY=Sm*(t+o),this.hyperEdgeTopYPos=Xg*this.centerControlPointY+$a*o,this.hyperEdgeBottomYPos=Xg*this.centerControlPointY+$a*t)}},e_=class{constructor(){this.startY=0,this.endY=0,this.normalSourceNode=!1,this.normalTargetNode=!1,this.invertedLeft=!1,this.invertedRight=!1}},Fe=Object.freeze({LEFT:"LEFT",RIGHT:"RIGHT"}),WT=.2,$a=.9,Xg=1-$a,Sm=.5;var zT=.2,vi=class n{constructor(){this.edgesRemainingLayer=[],this.splineSegmentsLayer=[],this.leftPortsLayer=new Set,this.rightPortsLayer=new Set,this.selfLoopsLayer=new Set,this.lGraph=null,this.startEdges=[],this.allSplineSegments=[],this.edgeToSegmentMap=new Map,this.successingEdge=new Map}getLayoutProcessorConfiguration(t){let e=K.create();e.addAll(YT());let o=t.getProperty(p.GRAPH_PROPERTIES);return o&&o.has(v.SELF_LOOPS)&&e.addAll(VT()),o&&o.has(v.CENTER_LABELS)&&e.addAll(XT()),o&&o.has(v.NORTH_SOUTH_PORTS)&&e.addAll(KT()),o&&o.has(v.END_LABELS)&&e.addAll(ZT()),e}process(t,e){if(e&&e.begin&&e.begin("Spline edge routing",1),t.getLayers().length===0){t.getSize().x=0,e&&e.done&&e.done();return}let o=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),r=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),a=t.getProperty(_.EDGE_ROUTING_SPLINES_MODE)===Qr.SLOPPY,l=t.getProperty(_.EDGE_ROUTING_SPLINES_SLOPPY_LAYER_SPACING_FACTOR);this.lGraph=t,this.startEdges=[],this.allSplineSegments=[],this.successingEdge.clear();let c=t.getLayers(),g=c[0],h=g.getNodes().every(Ls),d=c[c.length-1],f=d.getNodes().every(Ls),E=0,P=null,S,T=0;do{S=E<c.length?c[E++]:null,this._clearThenFillMappings(P,S),this._createSegmentsAndComputeRanking();let N=0;for(let A of this.splineSegmentsLayer)!A.isStraight&&A.rank+1>N&&(N=A.rank+1);let I=0,C=T,x=P===null||h&&P===g,M=S===null||f&&S===d;if(N>0){let A=0;P!==null&&(A+=r),A+=(N-1)*i,S!==null&&(A+=r),a&&S!==null&&(A=Math.max(A,n._computeSloppySpacing(S,i,o,l))),A<o&&!x&&!M&&(I=(o-A)/2,A=o),C+=A}else!x&&!M&&(C+=o);S!==null&&z.placeNodesHorizontally(S,C);for(let A of this.splineSegmentsLayer)A.boundingBox.x=T,A.boundingBox.width=C-T,A.xDelta=I,A.isWestOfInitialLayer=P===null;for(let A of this.splineSegmentsLayer)this.allSplineSegments.push(A);T=C,S!==null&&(T+=S.getSize().x),P=S}while(S!==null);for(let N of this.startEdges){let I=this._getEdgeChain(N);N.setProperty(p.SPLINE_EDGE_CHAIN,I);let C=this._getSplinePath(N);N.setProperty(p.SPLINE_ROUTE_START,C)}t.getSize().x=T,this.lGraph=null,e&&e.done&&e.done()}_createSegmentsAndComputeRanking(){this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.LEFT,!0,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.LEFT,!1,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.RIGHT,!0,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.RIGHT,!1,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegments(this.edgesRemainingLayer,this.leftPortsLayer,this.rightPortsLayer,this.splineSegmentsLayer);for(let t=0;t<this.splineSegmentsLayer.length;t++){let e=this.splineSegmentsLayer[t];for(let o=t+1;o<this.splineSegmentsLayer.length;o++){let r=this.splineSegmentsLayer[o];n._createDependency(e,r)}}n._breakCycles(this.splineSegmentsLayer,this.lGraph.getProperty(p.RANDOM)),n._topologicalNumbering(this.splineSegmentsLayer)}_clearThenFillMappings(t,e){if(this.leftPortsLayer.clear(),this.rightPortsLayer.clear(),this.edgesRemainingLayer=[],this.splineSegmentsLayer=[],this.selfLoopsLayer.clear(),t!==null)for(let o of t.getNodes())for(let r of o.getPorts(u.EAST)){this.leftPortsLayer.add(r);for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;this.edgesRemainingLayer.push(i),this._findAndAddSuccessor(i),n.isQualifiedAsStartingNode(i.getSource().getNode())&&this.startEdges.push(i);let s=i.getTarget(),a=s.getNode().getLayer();if(a===e)this.rightPortsLayer.add(s);else if(a===t)this.leftPortsLayer.add(s);else{let l=this.edgesRemainingLayer.indexOf(i);l>=0&&this.edgesRemainingLayer.splice(l,1)}}}if(e!==null)for(let o of e.getNodes()){for(let r of o.getPorts())for(let i of r.getOutgoingEdges())i.isSelfLoop()&&this.selfLoopsLayer.add(i);for(let r of o.getPorts(u.WEST)){this.rightPortsLayer.add(r);for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;this.edgesRemainingLayer.push(i),this._findAndAddSuccessor(i),n.isQualifiedAsStartingNode(i.getSource().getNode())&&this.startEdges.push(i);let s=i.getTarget(),a=s.getNode().getLayer();if(a===e)this.rightPortsLayer.add(s);else if(a===t)this.leftPortsLayer.add(s);else{let l=this.edgesRemainingLayer.indexOf(i);l>=0&&this.edgesRemainingLayer.splice(l,1)}}}}}static _computeSloppySpacing(t,e,o,r){let i=0;for(let s of t.getNodes()){let a=0;for(let l of s.getIncomingEdges()){let c=l.getSource().getAbsoluteAnchor().y,g=l.getTarget().getAbsoluteAnchor().y;a=Math.max(a,Math.abs(g-c))}i=Math.max(i,a)}return r*Math.min(1,e/o)*i}_findAndAddSuccessor(t){let e=t.getTarget().getNode();if(n.isNormalNode(e))return;let r=e.getOutgoingEdges()[Symbol.iterator]().next();r.done||this.successingEdge.set(t,r.value)}_createSplineSegments(t,e,o,r){for(let i of t){let s=i.getSource(),a;if(e.has(s))a=Fe.LEFT;else if(o.has(s))a=Fe.RIGHT;else throw new Error("Source port must be in one of the port sets.");let l=i.getTarget(),c;if(e.has(l))c=Fe.LEFT;else if(o.has(l))c=Fe.RIGHT;else throw new Error("Target port must be in one of the port sets.");let g=new Cn(i,a,c);this.edgeToSegmentMap.set(i,g),r.push(g)}}_createSplineSegmentsForHyperEdges(t,e,o,r,i,s){let a;o===Fe.LEFT?a=t:a=e;for(let l of a){let c=l.getAbsoluteAnchor().y,g=new Set,h=new Set;for(let d of l.getConnectedEdges()){if(!!d.getProperty(p.REVERSED)!=!!r||!i.includes(d))continue;let f;d.getTarget()===l?f=d.getSource():f=d.getTarget();let E=f.getAbsoluteAnchor().y;n.isStraight(E,c)||(E<c?t.has(f)?g.add(Gt.of(Fe.LEFT,d)):g.add(Gt.of(Fe.RIGHT,d)):t.has(f)?h.add(Gt.of(Fe.LEFT,d)):h.add(Gt.of(Fe.RIGHT,d)))}if(g.size>1){let d=new Cn(l,g,o);for(let f of g)this.edgeToSegmentMap.set(f.getSecond(),d);s.push(d);for(let f of g){let E=i.indexOf(f.getSecond());E>=0&&i.splice(E,1)}}if(h.size>1){let d=new Cn(l,h,o);for(let f of h)this.edgeToSegmentMap.set(f.getSecond(),d);s.push(d);for(let f of h){let E=i.indexOf(f.getSecond());E>=0&&i.splice(E,1)}}}}static _isBetween(t,e,o){return Math.abs(e-t)<1e-8||Math.abs(o-t)<1e-8?!0:e-t>1e-8?t-o>1e-8:o-t>1e-8}static _createDependency(t,e){if(t.hyperEdgeTopYPos>e.hyperEdgeBottomYPos||e.hyperEdgeTopYPos>t.hyperEdgeBottomYPos)return;let o=0,r=0;for(let i of t.rightPorts)n._isBetween(i.getAbsoluteAnchor().y,e.hyperEdgeTopYPos,e.hyperEdgeBottomYPos)&&o++;for(let i of t.leftPorts)n._isBetween(i.getAbsoluteAnchor().y,e.hyperEdgeTopYPos,e.hyperEdgeBottomYPos)&&o--;for(let i of e.rightPorts)n._isBetween(i.getAbsoluteAnchor().y,t.hyperEdgeTopYPos,t.hyperEdgeBottomYPos)&&r++;for(let i of e.leftPorts)n._isBetween(i.getAbsoluteAnchor().y,t.hyperEdgeTopYPos,t.hyperEdgeBottomYPos)&&r--;o<r?new xn(t,e,r-o):r<o?new xn(e,t,o-r):(new xn(e,t,0),new xn(t,e,0))}static _breakCycles(t,e){let o=[],r=[],i=-1;for(let d of t){d.mark=i--;let f=0,E=0;for(let P of d.outgoing)E+=P.weight;for(let P of d.incoming)f+=P.weight;d.inweight=f,d.outweight=E,E===0?r.push(d):f===0&&o.push(d)}let s=new Set(t),a=t.length,l=a+1,c=a-1,g=[];for(;s.size>0;){for(;r.length>0;){let f=r.shift();s.delete(f),f.mark=c--,n._updateNeighbors(f,o,r)}for(;o.length>0;){let f=o.shift();s.delete(f),f.mark=l++,n._updateNeighbors(f,o,r)}let d=Number.MIN_SAFE_INTEGER;for(let f of s){let E=f.outweight-f.inweight;E>=d&&(E>d&&(g.length=0,d=E),g.push(f))}if(g.length>0){let f=g[e.nextInt(g.length)];s.delete(f),f.mark=l++,n._updateNeighbors(f,o,r),g.length=0}}let h=t.length+1;for(let d of t)d.mark<a&&(d.mark+=h);for(let d of t){let f=d.outgoing.slice();for(let E of f){let P=E.target;if(d.mark>P.mark){let S=d.outgoing.indexOf(E);S>=0&&d.outgoing.splice(S,1);let T=P.incoming.indexOf(E);T>=0&&P.incoming.splice(T,1),E.weight>0&&(E.source=P,P.outgoing.push(E),E.target=d,d.incoming.push(E))}}}}static _updateNeighbors(t,e,o){for(let r of t.outgoing)r.target.mark<0&&r.weight>0&&(r.target.inweight-=r.weight,r.target.inweight<=0&&r.target.outweight>0&&e.push(r.target));for(let r of t.incoming)r.source.mark<0&&r.weight>0&&(r.source.outweight-=r.weight,r.source.outweight<=0&&r.source.inweight>0&&o.push(r.source))}static _topologicalNumbering(t){let e=[],o=[];for(let i of t)i.rank=0,i.inweight=i.incoming.length,i.outweight=i.outgoing.length,i.inweight===0&&e.push(i),i.outweight===0&&i.leftPorts.size===0&&o.push(i);let r=-1;for(;e.length>0;){let i=e.shift();for(let s of i.outgoing){let a=s.target;a.rank=Math.max(a.rank,i.rank+1),r=Math.max(r,a.rank),a.inweight--,a.inweight===0&&e.push(a)}}if(r>-1){for(let i of o)i.rank=r;for(;o.length>0;){let i=o.shift();for(let s of i.incoming){let a=s.source;a.leftPorts.size>0||(a.rank=Math.min(a.rank,i.rank-1),a.outweight--,a.outweight===0&&o.push(a))}}}}static isStraight(t,e){return Math.abs(t-e)<zT}_getEdgeChain(t){let e=[],o=t;do e.push(o),o=this.successingEdge.get(o)||null;while(o!==null);return e}_getSplinePath(t){let e=[],o=t;do{let s=this.edgeToSegmentMap.get(o);s.sourcePort=o.getSource(),s.targetPort=o.getTarget(),e.push(s),o=this.successingEdge.get(o)||null}while(o!==null);let r=e[0];r.initialSegment=!0,r.sourceNode=r.edges.values().next().value.getSource().getNode();let i=e[e.length-1];return i.lastSegment=!0,i.targetNode=i.edges.values().next().value.getTarget().getNode(),e}static isNormalNode(t){let e=t.getType();return e===y.NORMAL||e===y.BREAKING_POINT}static isQualifiedAsStartingNode(t){let e=t.getType();return e===y.NORMAL||e===y.NORTH_SOUTH_PORT||e===y.EXTERNAL_PORT||e===y.BREAKING_POINT}};vi.SPLINE_DIMENSION=3;var xn=class{constructor(t,e,o){this.source=t,this.target=e,this.weight=o,t.outgoing.push(this),e.incoming.push(this)}};function YT(){return K.create().addAfter(D.P5_EDGE_ROUTING,w.FINAL_SPLINE_BENDPOINTS_CALCULATOR).addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR)}function VT(){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER).addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER)}function XT(){return K.create().addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR).addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER)}function KT(){return K.create().addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR).addBefore(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)}function ZT(){return K.create().addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR).addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR)}var se=class{},Dn=1e-8;se.HALF_PI=Math.PI/2;se.QUATER_PI=se.HALF_PI/2;se.THREE_HALF_PI=se.HALF_PI*3;se.TWO_PI=2*Math.PI;se.THREE=3;se.intersect=function(t,e,o,r){return typeof o=="number"?se._intersect4(t,new O(o).add(t),e,new O(r).add(e)):se._intersect4(t,e,o,r)};se._intersect4=function(t,e,o,r){let i=t.x,s=t.y,a=e.x,l=e.y,c=o.x,g=o.y,h=r.x,d=r.y,f=(i-a)*(g-d)-(s-l)*(c-h);if(Math.abs(f)<Dn)return null;let E=i*l-s*a,P=c*d-g*h,S=(E*(c-h)-P*(i-a))/f,T=(E*(g-d)-P*(s-l))/f;return new O(S,T)};se.innerAngle=function(t,e){if(typeof t=="number")return Math.abs(t-e)%Math.PI;let o=t,r=e;return Math.acos((o.x*r.x+o.y*r.y)/(o.length()*r.length()))};se.lengthToOrthogonal=function(t,e){let o=se.innerAngle(t,e.toRadians()),r=1;return o>se.HALF_PI&&(r=-1,o=o-se.QUATER_PI),r*Math.cos(o)*e.length()};se.portSideToDirection=function(t){switch(t){case u.NORTH:return se.THREE_HALF_PI;case u.EAST:return 0;case u.SOUTH:return se.HALF_PI;case u.WEST:return Math.PI;default:return 0}};se.distPortToNodeEdge=function(t,e){let o=t.getPosition().clone().add(t.getAnchor()),r=t.getNode().getSize();switch(e){case u.NORTH:return-o.y;case u.EAST:return-o.x+r.x;case u.SOUTH:return-o.y+r.y;case u.WEST:return-o.x;default:return 0}};se.isBetween=function(t,e,o){return Math.abs(e-t)<Dn||Math.abs(o-t)<Dn?!0:e-t>Dn?t-o>Dn:o-t>Dn};se.getMarginOnPortSide=function(t,e){let o=t.getMargin();switch(e){case u.NORTH:return o.top;case u.EAST:return o.right;case u.SOUTH:return o.bottom;case u.WEST:return o.left;default:return 0}};var jT=.5,Tm=5,$T=.4,Kg=class n{constructor(){this.edgeEdgeSpacing=0,this.edgeNodeSpacing=0,this.splineRoutingMode=null,this.compactionStrategy=null}process(t,e){e&&e.begin&&e.begin("Spline bendpoints",1),this.edgeEdgeSpacing=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this.edgeNodeSpacing=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this.splineRoutingMode=t.getProperty(_.EDGE_ROUTING_SPLINES_MODE),this.compactionStrategy=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY),this._indexNodesPerLayer(t);let o=[];for(let r of t.getLayers())for(let i of r.getNodes())for(let s of i.getOutgoingEdges())s.isSelfLoop()||s.hasProperty(p.SPLINE_ROUTE_START)&&o.push(s);for(let r of o){let i=r.getProperty(p.SPLINE_ROUTE_START);for(let s of i)this._calculateControlPoints(s);r.setProperty(p.SPLINE_ROUTE_START,null)}for(let r of o){let i=r.getProperty(p.SPLINE_SURVIVING_EDGE),s=r.getProperty(p.SPLINE_EDGE_CHAIN);this._calculateBezierBendPoints(s,i),r.setProperty(p.SPLINE_EDGE_CHAIN,null)}e&&e.done&&e.done()}_indexNodesPerLayer(t){for(let e of t.getLayers()){let o=0;for(let r of e.getNodes())r.id=o++}}_calculateControlPoints(t){if(!t.handled){t.handled=!0;for(let e of t.edges){if(t.isStraight&&!t.isHyperEdge()){this._calculateControlPointsStraight(t);continue}let o=t.edgeInformation.get(e);if(o.invertedLeft||o.invertedRight){this._calculateControlPointsInvertedEdge(e,t);continue}this.splineRoutingMode===Qr.SLOPPY&&(o.normalSourceNode||o.normalTargetNode)&&this._segmentAllowsSloppyRouting(t)&&!t.isHyperEdge()?this._calculateControlPointsSloppy(e,t):this._calculateControlPointsConservative(e,t)}if(t.inverseOrder)for(let e of t.edges)e.getBendPoints().reverse()}}_calculateControlPointsStraight(t){let e=t.boundingBox.x,o=t.boundingBox.x+t.boundingBox.width,r=new O(e+(o-e)/2,t.centerControlPointY);t.edges.values().next().value.getBendPoints().push(r)}_calculateControlPointsInvertedEdge(t,e){let o=e.boundingBox.x,r=e.boundingBox.x+e.boundingBox.width,i=e.edgeInformation.get(t),s=i.startY,a=i.endY,l,c;i.invertedLeft?l=new O(r,s):l=new O(o,s),i.invertedRight?c=new O(o,a):c=new O(r,a);let g=o;e.isWestOfInitialLayer||(g+=this.edgeNodeSpacing),g+=e.xDelta+e.rank*this.edgeEdgeSpacing;let h=new O(g,s),d=new O(g,a),f=t.getBendPoints();if(f.push(l,h),e.edges.size>1){let P=new O(g,e.centerControlPointY);f.push(P)}f.push(d,c)}_calculateControlPointsConservative(t,e){let o=e.boundingBox.x,r=e.boundingBox.x+e.boundingBox.width,i=e.edgeInformation.get(t),s=i.startY,a=i.endY,l=new O(o,s),c=new O(r,a),g=o;e.isWestOfInitialLayer||(g+=this.edgeNodeSpacing),g+=e.xDelta+e.rank*this.edgeEdgeSpacing;let h=new O(g,s),d=new O(g,a),f=t.getBendPoints();if(f.push(l,h),e.edges.size>1){let P=new O(g,e.centerControlPointY);f.push(P)}f.push(d,c)}_calculateControlPointsSloppy(t,e){let o=e.edgeInformation.get(t),r=e.boundingBox.x,i=e.boundingBox.x+e.boundingBox.width,s=o.startY,a=o.endY,l=s<a,c=new O(r,s),g=new O(i,a),h=(r+i)/2,d=new O(h,s),f=new O(h,a),E=this._computeSloppyCenterY(t,s,a),P=e.sourcePort.getAbsoluteAnchor(),S=new O(h,E),T=e.targetPort.getAbsoluteAnchor(),N=Ft.approximateBezierSegment(2,P,S,T),I=!1,C=e.sourcePort.getNode();if(C!==null&&C.getLayer()!==null&&o.normalSourceNode)if(!(l&&C.id<C.getLayer().getNodes().length-1||!l&&C.id>0))I=!0;else{let Y=C.id;l?Y++:Y--;let j=C.getLayer().getNodes()[Y],X=n._nodeToBoundingBox(j);I=!(Ft.intersects(X,P,N[0])||Ft.contains(X,P,N[0]))}let x=!1,M=e.targetPort.getNode();if(M!==null&&M.getLayer()!==null&&o.normalTargetNode)if(!(l&&M.id>0||!l&&M.id<M.getLayer().getNodes().length-1))x=!0;else{let Y=M.id;l?Y--:Y++;let j=M.getLayer().getNodes()[Y],X=n._nodeToBoundingBox(j);x=!(Ft.intersects(X,N[0],T)||Ft.contains(X,N[0],T))}let A=t.getBendPoints();I&&x&&A.push(S),I||A.push(c,d),x||A.push(f,g)}static _nodeToBoundingBox(t){let e=t.getPosition(),o=t.getSize(),r=t.getMargin();return new dt(e.x-r.left,e.y-r.top,o.x+r.getHorizontal(),o.y+r.getVertical())}_computeSloppyCenterY(t,e,o){let r=0,i=0;if(t.getSource()!==null)for(let a of t.getTarget().getNode().getPorts())r+=a.getIncomingEdges().length;else r=1;if(t.getTarget()!==null)for(let a of t.getSource().getNode().getPorts())i+=a.getOutgoingEdges().length;else i=1;let s=Math.sign(i-r);return(o+e)/2+(o-e)*($T*s)}_calculateBezierBendPoints(t,e){if(!t||t.length===0)return;let o=new st,r=e!=null?e:t[0],i=r.getSource();if(!vi.isQualifiedAsStartingNode(i.getNode()))throw new Error("The source node of the edge must be a normal node or a northSouthPort.");if(o.addLast(i.getAbsoluteAnchor()),u.SIDES_NORTH_SOUTH.has(i.getSide())){let d=i.getProperty(p.SPLINE_NS_PORT_Y_COORD),f=new O(i.getAbsoluteAnchor().x,d);o.addLast(f)}let s=null,a=!1;for(let d of t){let f=d.getBendPoints();if(f.length>0){if(a){let E=s.add(f.getFirst()).scale(jT);o.addLast(E),a=!1}else a=!0;s=f.getLast().clone();for(let E of f)o.addLast(E);f.length=0}}let l=r.getTarget();if(u.SIDES_NORTH_SOUTH.has(l.getSide())){let d=l.getProperty(p.SPLINE_NS_PORT_Y_COORD),f=new O(l.getAbsoluteAnchor().x,d);o.addLast(f)}o.addLast(l.getAbsoluteAnchor()),this.splineRoutingMode===Qr.CONSERVATIVE&&n._insertStraighteningControlPoints(o,i,l);let g=new Rs(!0,vi.SPLINE_DIMENSION,o).getBezierCP(),h=r.getBendPoints();for(let d of g)h.push(d)}static _insertStraighteningControlPoints(t,e,o){let r=t.getFirst(),i=t[1],s=new O(se.portSideToDirection(e.getSide()));s.scale(Tm);let a=i.clone().sub(r),l=new O(n._absMin(s.x,a.x),n._absMin(s.y,a.y));l.add(r),t.splice(1,0,l);let c=t.getLast(),g=t[t.length-2];s=new O(se.portSideToDirection(o.getSide())),s.scale(Tm),a=g.clone().sub(c);let h=new O(n._absMin(s.x,a.x),n._absMin(s.y,a.y));h.add(c),t.splice(t.length-1,0,h)}static _absMin(t,e){return Math.abs(t)<Math.abs(e)?t:e}_segmentAllowsSloppyRouting(t){if(this.compactionStrategy===re.NONE)return!0;let e=t.boundingBox.x,o=t.boundingBox.x+t.boundingBox.width;if(t.initialSegment){let r=t.sourceNode,i=n._segmentNodeDistanceThreshold(r);if(e-(r.getPosition().x+r.getSize().x)>i)return!1}if(t.lastSegment){let r=t.targetNode,i=n._segmentNodeDistanceThreshold(r);if(r.getPosition().x-o>i)return!1}return!0}static _segmentNodeDistanceThreshold(t){return t.getLayer().getSize().x-t.getSize().x/2}};var jo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};jo.ROTATION=new jo("ROTATION");jo.READING_DIRECTION=new jo("READING_DIRECTION");var jt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};jt.NONE=new jt("NONE");jt.TOP=new jt("TOP");jt.BOTTOM=new jt("BOTTOM");var wn=class{constructor(t){this._mode=t}process(t,e){e.begin(`Graph transformation (${this._mode})`,1);let o=[...t.getLayerlessNodes()];for(let a of t.getLayers())for(let l of a.getNodes())o.push(l);let r=t.getProperty(_.DIRECTION_CONGRUENCY),i=t.getProperty(_.DIRECTION),s=i!=null&&i.name?i.name:null;if(r===jo.READING_DIRECTION||r==="READING_DIRECTION")switch(s){case"LEFT":qa(t,o);break;case"DOWN":Ja(t,o);break;case"UP":this._mode===$o.TO_INTERNAL_LTR?(Ja(t,o),Zg(t,o)):(Zg(t,o),Ja(t,o));break;default:break}else if(this._mode===$o.TO_INTERNAL_LTR)switch(s){case"LEFT":qa(t,o),Zg(t,o);break;case"DOWN":Nm(t,o);break;case"UP":ym(t,o);break;default:break}else switch(s){case"LEFT":qa(t,o),Zg(t,o);break;case"DOWN":ym(t,o);break;case"UP":Nm(t,o);break;default:break}e.done()}},$o=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};$o.TO_INTERNAL_LTR=new $o("TO_INTERNAL_LTR");$o.TO_INPUT_DIRECTION=new $o("TO_INPUT_DIRECTION");wn.Mode=$o;function Nm(n,t){Ja(n,t),qa(n,t)}function ym(n,t){qa(n,t),Ja(n,t)}function qa(n,t){qT(t,n),o_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&o_(e)}function Zg(n,t){QT(t,n),r_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&r_(e)}function Ja(n,t){eN(t),oN(n),_o(n.getOffset()),_o(n.getSize()),i_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&i_(e)}function qT(n,t){let e=0;if(t.getSize().x===0)for(let o of n){let r=o.getPosition().x+o.getSize().x+o.getMargin().right;r>e&&(e=r)}else e=t.getSize().x-t.getOffset().x;e-=t.getOffset().x;for(let o of n){switch(ti(o.getPosition(),e-o.getSize().x),o_(o.getPadding()),Im(o),o.hasProperty(_.POSITION)&&ti(o.getProperty(_.POSITION),e-o.getSize().x),o.getProperty(_.ALIGNMENT)){case Kt.LEFT:o.setProperty(_.ALIGNMENT,Kt.RIGHT);break;case Kt.RIGHT:o.setProperty(_.ALIGNMENT,Kt.LEFT);break;default:break}let r=o.getSize();for(let i of o.getPorts()){ti(i.getPosition(),r.x-i.getSize().x),ti(i.getAnchor(),i.getSize().x),i.setSide(Rm(i.getSide())),s_(i);for(let s of i.getOutgoingEdges()){for(let l of s.getBendPoints())ti(l,e);let a=s.getProperty(_.JUNCTION_POINTS);if(a!=null)for(let l of a)ti(l,e);for(let l of s.getLabels())ti(l.getPosition(),e-l.getSize().x)}for(let s of i.getLabels())ti(s.getPosition(),i.getSize().x-s.getSize().x)}o.getType()===y.EXTERNAL_PORT&&(o.setProperty(p.EXT_PORT_SIDE,Rm(o.getProperty(p.EXT_PORT_SIDE))),JT(o));for(let i of o.getLabels())Im(i),ti(i.getPosition(),r.x-i.getSize().x)}}function ti(n,t){n.x=t-n.x}function o_(n){if(n==null)return;let t=n.left;n.left=n.right,n.right=t}function Im(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);t!=null&&(t.has(k.H_LEFT)?(t.delete(k.H_LEFT),t.add(k.H_RIGHT)):t.has(k.H_RIGHT)&&(t.delete(k.H_RIGHT),t.add(k.H_LEFT)))}function Rm(n){return n===u.EAST?u.WEST:n===u.WEST?u.EAST:n}function JT(n){switch(n.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST);break;case J.FIRST_SEPARATE:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE);break;case J.LAST:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST);break;case J.LAST_SEPARATE:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE);break;default:break}}function QT(n,t){let e=0;if(t.getSize().y===0)for(let o of n){let r=o.getPosition().y+o.getSize().y+o.getMargin().bottom;r>e&&(e=r)}else e=t.getSize().y-t.getOffset().y;e-=t.getOffset().y;for(let o of n){switch(ei(o.getPosition(),e-o.getSize().y),r_(o.getPadding()),Lm(o),o.hasProperty(_.POSITION)&&ei(o.getProperty(_.POSITION),e-o.getSize().y),o.getProperty(_.ALIGNMENT)){case Kt.TOP:o.setProperty(_.ALIGNMENT,Kt.BOTTOM);break;case Kt.BOTTOM:o.setProperty(_.ALIGNMENT,Kt.TOP);break;default:break}let r=o.getSize();for(let i of o.getPorts()){ei(i.getPosition(),r.y-i.getSize().y),ei(i.getAnchor(),i.getSize().y),i.setSide(Am(i.getSide())),s_(i);for(let s of i.getOutgoingEdges()){for(let l of s.getBendPoints())ei(l,e);let a=s.getProperty(_.JUNCTION_POINTS);if(a!=null)for(let l of a)ei(l,e);for(let l of s.getLabels())ei(l.getPosition(),e-l.getSize().y)}for(let s of i.getLabels())ei(s.getPosition(),i.getSize().y-s.getSize().y)}o.getType()===y.EXTERNAL_PORT&&(o.setProperty(p.EXT_PORT_SIDE,Am(o.getProperty(p.EXT_PORT_SIDE))),tN(o));for(let i of o.getLabels())Lm(i),ei(i.getPosition(),r.y-i.getSize().y)}}function ei(n,t){n.y=t-n.y}function r_(n){if(n==null)return;let t=n.top;n.top=n.bottom,n.bottom=t}function Lm(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);t!=null&&(t.has(k.V_TOP)?(t.delete(k.V_TOP),t.add(k.V_BOTTOM)):t.has(k.V_BOTTOM)&&(t.delete(k.V_BOTTOM),t.add(k.V_TOP)))}function Am(n){return n===u.NORTH?u.SOUTH:n===u.SOUTH?u.NORTH:n}function tN(n){let t=n.getProperty(p.IN_LAYER_CONSTRAINT);t===jt.TOP?n.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM):t===jt.BOTTOM&&n.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP)}function eN(n){for(let t of n){_o(t.getPosition()),_o(t.getSize()),i_(t.getPadding()),Cm(t),iN(t);for(let e of t.getPorts()){_o(e.getPosition()),_o(e.getAnchor()),_o(e.getSize()),e.setSide(xm(e.getSide())),s_(e);for(let o of e.getOutgoingEdges()){for(let i of o.getBendPoints())_o(i);let r=o.getProperty(_.JUNCTION_POINTS);if(r!=null)for(let i of r)_o(i);for(let i of o.getLabels())_o(i.getPosition()),_o(i.getSize())}for(let o of e.getLabels())_o(o.getPosition()),_o(o.getSize())}t.getType()===y.EXTERNAL_PORT&&(t.setProperty(p.EXT_PORT_SIDE,xm(t.getProperty(p.EXT_PORT_SIDE))),rN(t));for(let e of t.getLabels())Cm(e),_o(e.getSize()),_o(e.getPosition())}}function _o(n){let t=n.x;n.x=n.y,n.y=t}function i_(n){if(n==null)return;let t=n.top,e=n.bottom,o=n.left,r=n.right;n.top=o,n.bottom=r,n.left=t,n.right=e}function Cm(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);if(t==null||t.size===0)return;let e=new Set;t.has(k.INSIDE)?e.add(k.INSIDE):e.add(k.OUTSIDE),t.has(k.H_PRIORITY)||e.add(k.H_PRIORITY),t.has(k.H_LEFT)?e.add(k.V_TOP):t.has(k.H_CENTER)?e.add(k.V_CENTER):t.has(k.H_RIGHT)&&e.add(k.V_BOTTOM),t.has(k.V_TOP)?e.add(k.H_LEFT):t.has(k.V_CENTER)?e.add(k.H_CENTER):t.has(k.V_BOTTOM)&&e.add(k.H_RIGHT),n.setProperty(_.NODE_LABELS_PLACEMENT,e)}function xm(n){switch(n){case u.NORTH:return u.WEST;case u.WEST:return u.NORTH;case u.SOUTH:return u.EAST;case u.EAST:return u.SOUTH;default:return u.UNDEFINED}}function oN(n){let t=n.getProperty(_.EDGE_LABELS_SIDE_SELECTION);t!=null&&typeof t.transpose=="function"&&n.setProperty(_.EDGE_LABELS_SIDE_SELECTION,t.transpose())}function rN(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT),e=n.getProperty(p.IN_LAYER_CONSTRAINT);t===J.FIRST_SEPARATE?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.NONE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP)):t===J.LAST_SEPARATE?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.NONE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM)):e===jt.TOP?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.NONE)):e===jt.BOTTOM&&(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.NONE))}function iN(n){let t=n.getProperty(_.NODE_SIZE_MINIMUM);switch(t!=null&&n.setProperty(_.NODE_SIZE_MINIMUM,new O(t.y,t.x)),n.getProperty(_.ALIGNMENT)){case Kt.LEFT:n.setProperty(_.ALIGNMENT,Kt.TOP);break;case Kt.RIGHT:n.setProperty(_.ALIGNMENT,Kt.BOTTOM);break;case Kt.TOP:n.setProperty(_.ALIGNMENT,Kt.LEFT);break;case Kt.BOTTOM:n.setProperty(_.ALIGNMENT,Kt.RIGHT);break;default:break}if(n.hasProperty(_.POSITION)){let e=n.getProperty(_.POSITION),o=e.x;e.x=e.y,e.y=o}}function s_(n){let t=n.getProperty(_.PORT_INDEX);t!=null&&n.setProperty(_.PORT_INDEX,-t)}var jg=class{process(t,e){e.begin("Resize child graph to fit parent.",1);for(let o of t){for(let r of o.getNodes())t.getLayerlessNodes().push(r);o.getNodes().length=0}for(let o of t.getLayerlessNodes())o.setLayer(null);t.getLayers().length=0,this._resizeGraph(t),t.getParentNode()!=null&&this._graphLayoutToNode(t.getParentNode(),t),e.done()}_graphLayoutToNode(t,e){for(let i of e.getLayerlessNodes()){let s=i.getProperty(p.ORIGIN);if(s instanceof rt){let a=s,l=z.getExternalPortPosition(e,i,a.getSize().x,a.getSize().y);a.getPosition().x=l.x,a.getPosition().y=l.y,a.setSide(i.getProperty(p.EXT_PORT_SIDE))}}let o=e.getActualSize();e.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)?(t.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),t.getGraph().getProperty(p.GRAPH_PROPERTIES).add(v.NON_FREE_PORTS),z.resizeNode(t,o,!1,!0)):z.resizeNode(t,o,!0,!0)}_resizeGraph(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS),o=t.getProperty(_.NODE_SIZE_OPTIONS),r=t.getActualSize(),i=new O(r.x,r.y);if(e!=null&&e.has(mt.MINIMUM_SIZE)){let s=new O(0,0),a=t.getProperty(_.NODE_SIZE_MINIMUM);a!=null&&(s.x=a.x||0,s.y=a.y||0),o!=null&&o.has(Nt.DEFAULT_MINIMUM_SIZE)&&(s.x<=0&&(s.x=es),s.y<=0&&(s.y=os)),i.x=Math.max(r.x,s.x),i.y=Math.max(r.y,s.y)}this._resizeGraphNoReallyIMeanIt(t,r,i)}_resizeGraphNoReallyIMeanIt(t,e,o){let r=t.getProperty(_.CONTENT_ALIGNMENT);if(o.x>e.x&&r!=null&&(r.has(he.H_CENTER)?t.getOffset().x+=(o.x-e.x)/2:r.has(he.H_RIGHT)&&(t.getOffset().x+=o.x-e.x)),o.y>e.y&&r!=null&&(r.has(he.V_CENTER)?t.getOffset().y+=(o.y-e.y)/2:r.has(he.V_BOTTOM)&&(t.getOffset().y+=o.y-e.y)),t.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)&&(o.x>e.x||o.y>e.y))for(let a of t.getLayerlessNodes()){if(a.getType()!==y.EXTERNAL_PORT)continue;let l=a.getProperty(p.EXT_PORT_SIDE);l===u.EAST?a.getPosition().x+=o.x-e.x:l===u.SOUTH&&(a.getPosition().y+=o.y-e.y)}let s=t.getPadding();t.getSize().x=o.x-s.left-s.right,t.getSize().y=o.y-s.top-s.bottom}};var Et=class extends br{constructor(t){super(),this._owner=t,this._size=new O,this._nodes=[]}getSize(){return this._size}getNodes(){return this._nodes}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}getGraph(){return this._owner}getIndex(){return this._owner.getLayers().indexOf(this)}toString(){return`L_${this.getIndex()}[${this._nodes.join(",")}]`}};var $g=class{process(t,e){e.begin("Hierarchical port constraint processing",1),lN(t),cN(t),e.done()}},sN=0,nN=1;function aN(n,t){let e=n.getType();if(t.getType()!==y.EXTERNAL_PORT)return-1;if(e!==y.EXTERNAL_PORT)return 1;let r=n.getProperty(p.PORT_RATIO_OR_POSITION),i=t.getProperty(p.PORT_RATIO_OR_POSITION);return r===i?0:r<i?-1:1}function lN(n){if(!n.getProperty(_.PORT_CONSTRAINTS).isOrderFixed())return;let t=n.getLayers();t.length!==0&&(Dm(t[0]),Dm(t[t.length-1]))}function Dm(n){let t=z.toNodeArray(n.getNodes());t.sort(aN);let e=null;for(let o of t){if(o.getType()!==y.EXTERNAL_PORT)break;let r=o.getProperty(p.EXT_PORT_SIDE);r!==u.WEST&&r!==u.EAST||(e!=null&&e.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(o),e=o)}}function cN(n){if(!n.getProperty(_.PORT_CONSTRAINTS).isSideFixed())return;let e=n.getLayers(),o=e.length,r=[new Map,new Map],i=[[],[]],s=[];for(let a=0;a<o;a++){let l=e[a],c=r[a],g=new Map;r.push(g);let h=i[a],d=[];i.push(d);for(let f of l){if(n_(f)){s.push(f);continue}for(let E of z.toEdgeArray(f.getIncomingEdges())){let P=E.getSource().getNode();if(!n_(P))continue;let S=P.getProperty(p.ORIGIN),T=c.get(S);T==null&&(T=wm(n,P),c.set(S,T),h.push(T)),E.setSource(T.getPorts()[nN])}for(let E of z.toEdgeArray(f.getOutgoingEdges())){let P=E.getTarget().getNode();if(!n_(P))continue;let S=P.getProperty(p.ORIGIN),T=g.get(S);T==null&&(T=wm(n,P),g.set(S,T),d.push(T)),E.setTarget(T.getPorts()[sN])}}}for(let a=0;a<i.length;a++){let l=i[a];if(l.length===0)continue;let c;a===0?(c=new Et(n),e.unshift(c)):a===r.length-1?(c=new Et(n),e.push(c)):c=e[a-1];for(let g of l)g.setLayer(c)}for(let a of s)a.setLayer(null);n.setProperty(p.EXT_PORT_REPLACED_DUMMIES,s)}function n_(n){if(n.getType()!==y.EXTERNAL_PORT)return!1;let t=n.getProperty(p.EXT_PORT_SIDE);return t===u.NORTH||t===u.SOUTH}function wm(n,t){let e=new ft(n);e.copyProperties(t),e.setProperty(p.EXT_PORT_REPLACED_DUMMY,t),e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),e.setProperty(_.ALIGNMENT,Kt.CENTER),e.setType(y.EXTERNAL_PORT);let o=new rt;o.setNode(e),o.setSide(u.WEST);let r=new rt;return r.setNode(e),r.setSide(u.EAST),e}var _e=class extends br{constructor(){super(),this._bendPoints=new st,this._source=null,this._target=null,this._labels=[]}reverse(t,e){let o=this.getSource(),r=this.getTarget();this.setSource(null),this.setTarget(null),e&&r!=null&&r.getProperty(p.INPUT_COLLECT)?this.setSource(z.provideCollectorPort(t,r.getNode(),W.OUTPUT,u.EAST)):this.setSource(r),e&&o!=null&&o.getProperty(p.OUTPUT_COLLECT)?this.setTarget(z.provideCollectorPort(t,o.getNode(),W.INPUT,u.WEST)):this.setTarget(o);for(let s of this._labels){let a=s.getProperty(_.EDGE_LABELS_PLACEMENT);a===St.TAIL?s.setProperty(_.EDGE_LABELS_PLACEMENT,St.HEAD):a===St.HEAD&&s.setProperty(_.EDGE_LABELS_PLACEMENT,St.TAIL)}let i=this.getProperty(p.REVERSED);this.setProperty(p.REVERSED,!i),this._bendPoints=st.reverse(this._bendPoints)}getSource(){return this._source}setSource(t){if(this._source!=null){let e=this._source.getOutgoingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._source=t,this._source!=null&&this._source.getOutgoingEdges().push(this)}getTarget(){return this._target}setTarget(t){if(this._target!=null){let e=this._target.getIncomingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._target=t,this._target!=null&&this._target.getIncomingEdges().push(this)}setTargetAndInsertAtIndex(t,e){if(this._target!=null){let o=this._target.getIncomingEdges(),r=o.indexOf(this);r>=0&&o.splice(r,1)}this._target=t,this._target!=null&&this._target.getIncomingEdges().splice(e,0,this)}isSelfLoop(){if(this._source==null||this._target==null)return!1;let t=this._source.getNode();return t!=null&&t===this._target.getNode()}isInLayerEdge(){return!this.isSelfLoop()&&this._source.getNode().getLayer()===this._target.getNode().getLayer()}getBendPoints(){return this._bendPoints}getLabels(){return this._labels}getOther(t){if(t===this._source)return this._target;if(t===this._target)return this._source;if(this._source!=null&&t===this._source.getNode())return this._target.getNode();if(this._target!=null&&t===this._target.getNode())return this._source.getNode();throw new Error("'portOrNode' must be either the source or target of the edge.")}getDesignation(){return this._labels.length>0&&this._labels[0].getText()?this._labels[0].getText():super.getDesignation()}toString(){let t="e_",e=this.getDesignation();return e!=null&&(t+=e),this._source!=null&&this._target!=null&&(t+=` ${this._source.getDesignation()}[${this._source.getNode()}]`,t+=` -> ${this._target.getDesignation()}[${this._target.getNode()}]`),t}};var oi=class{static adapt(t,e=!1,o=!1,r=()=>!0){return new a_(t,e,o,r)}static adaptNode(t,e){return new Mn(null,t,e)}static adaptLabel(t){return new bn(t)}},Qa=class{constructor(t){this._element=t}getElement(){return this._element}getSize(){return this._element.getSize()}setSize(t){this._element.getSize().x=t.x,this._element.getSize().y=t.y}getPosition(){return this._element.getPosition()}setPosition(t){this._element.getPosition().x=t.x,this._element.getPosition().y=t.y}getProperty(t){return this._element.getProperty(t)}hasProperty(t){return this._element.hasProperty(t)}getVolatileId(){return this._element.id}setVolatileId(t){this._element.id=t}},a_=class{constructor(t,e,o,r){this._element=t,this._transparentNorthSouthEdges=e,this._transparentCommentNodes=o,this._nodeFilter=r,this._nodeAdapters=null}getSize(){return this._element.getSize()}setSize(t){this._element.getSize().x=t.x,this._element.getSize().y=t.y}getPosition(){throw new Error("Not supported by LGraph")}setPosition(){throw new Error("Not supported by LGraph")}getProperty(t){return this._element.getProperty(t)}hasProperty(t){return this._element.hasProperty(t)}getVolatileId(){return this._element.id}setVolatileId(t){this._element.id=t}getNodes(){if(this._nodeAdapters==null){this._nodeAdapters=[];for(let t of this._element.getLayers())for(let e of t.getNodes())if(this._nodeFilter(e)&&(this._nodeAdapters.push(new Mn(this,e,this._transparentNorthSouthEdges)),this._transparentCommentNodes)){if(e.hasProperty(p.TOP_COMMENTS))for(let o of e.getProperty(p.TOP_COMMENTS))this._nodeAdapters.push(new Mn(this,o,!1));if(e.hasProperty(p.BOTTOM_COMMENTS))for(let o of e.getProperty(p.BOTTOM_COMMENTS))this._nodeAdapters.push(new Mn(this,o,!1))}}return this._nodeAdapters}},Mn=class extends Qa{constructor(t,e,o){super(e),this._parentGraphAdapter=t,this._transparentNorthSouthEdges=o,this._labelAdapters=null,this._portAdapters=null}getGraph(){return this._parentGraphAdapter}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}getPorts(){if(this._portAdapters==null){this._portAdapters=[];for(let t of this._element.getPorts())this._portAdapters.push(new l_(t,this._transparentNorthSouthEdges))}return this._portAdapters}getIncomingEdges(){return[]}getOutgoingEdges(){return[]}sortPortList(t){let e=t||gN;this._element.getProperty(_.PORT_CONSTRAINTS).isOrderFixed()&&this._element.getPorts().sort(e)}isCompoundNode(){return this._element.getProperty(p.COMPOUND_NODE)}getPadding(){let t=this._element.getPadding();return new yt(t.top,t.right,t.bottom,t.left)}setPadding(t){let e=this._element.getPadding();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}getMargin(){let t=this._element.getMargin();return new me(t.top,t.right,t.bottom,t.left)}setMargin(t){let e=this._element.getMargin();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}},l_=class extends Qa{constructor(t,e){super(t),this._transparentNorthSouthEdges=e,this._labelAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getSide(){return this._element.getSide()}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}getMargin(){let t=this._element.getMargin?this._element.getMargin():{top:0,right:0,bottom:0,left:0};return new me(t.top,t.right,t.bottom,t.left)}setMargin(t){if(!this._element.getMargin)return;let e=this._element.getMargin();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}getIncomingEdges(){if(this._transparentNorthSouthEdges&&this._element.getNode().getType()===y.NORTH_SOUTH_PORT)return[];if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let e of this._element.getIncomingEdges())this._incomingEdgeAdapters.push(new Bi(e));if(this._transparentNorthSouthEdges){let e=this._element.getProperty(p.PORT_DUMMY);if(e!=null)for(let o of e.getIncomingEdges())this._incomingEdgeAdapters.push(new Bi(o))}let t=this._element.getNode();if(t.hasProperty(p.SELF_LOOP_HOLDER)){let o=t.getProperty(p.SELF_LOOP_HOLDER).getSLPortMap().get(this._element);if(o!=null)for(let r of o.getIncomingSLEdges())this._incomingEdgeAdapters.push(new Bi(r.getLEdge()))}}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._transparentNorthSouthEdges&&this._element.getNode().getType()===y.NORTH_SOUTH_PORT)return[];if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let e of this._element.getOutgoingEdges())this._outgoingEdgeAdapters.push(new Bi(e));if(this._transparentNorthSouthEdges){let e=this._element.getProperty(p.PORT_DUMMY);if(e!=null)for(let o of e.getOutgoingEdges())this._outgoingEdgeAdapters.push(new Bi(o))}let t=this._element.getNode();if(t.hasProperty(p.SELF_LOOP_HOLDER)){let o=t.getProperty(p.SELF_LOOP_HOLDER).getSLPortMap().get(this._element);if(o!=null)for(let r of o.getOutgoingSLEdges())this._outgoingEdgeAdapters.push(new Bi(r.getLEdge()))}}return this._outgoingEdgeAdapters}hasCompoundConnections(){return this._element.getProperty(p.INSIDE_CONNECTIONS)}},bn=class extends Qa{constructor(t){super(t)}getSide(){return this._element.getProperty(Vt.LABEL_SIDE)}getText(){return this._element.getText?this._element.getText():""}},Bi=class{constructor(t){this._element=t,this._labelAdapters=null}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}},gN=(n,t)=>{let e=n.getSide().ordinal()-t.getSide().ordinal();if(e!==0)return e;let o=n.getProperty(_.PORT_INDEX),r=t.getProperty(_.PORT_INDEX);if(o!=null&&r!=null){let i=o-r;if(i!==0)return i}switch(n.getSide().toString()){case"NORTH":return n.getPosition().x-t.getPosition().x;case"EAST":return n.getPosition().y-t.getPosition().y;case"SOUTH":return t.getPosition().x-n.getPosition().x;case"WEST":return t.getPosition().y-n.getPosition().y;default:throw new Error("Port side is undefined")}};var qg=class{constructor(){this._northernExtPortEdgeRoutingHeight=0}process(t,e){e&&e.begin&&e.begin("Orthogonally routing hierarchical port edges",1),this._northernExtPortEdgeRoutingHeight=0;let o=this._restoreNorthSouthDummies(t);this._setNorthSouthDummyCoordinates(t,o),this._routeEdges(e,t,o),this._removeTemporaryNorthSouthDummies(t),this._fixCoordinates(t),this._correctSlantedEdgeSegments(t),e&&e.done&&e.done()}_restoreNorthSouthDummies(t){let e=[];if(!t.hasProperty(p.EXT_PORT_REPLACED_DUMMIES))return e;for(let i of t.getProperty(p.EXT_PORT_REPLACED_DUMMIES))this._restoreDummy(i,t),e.push(i);for(let i of t.getLayers())for(let s of i.getNodes()){if(s.getType()!==y.EXTERNAL_PORT)continue;let a=s.getProperty(p.EXT_PORT_REPLACED_DUMMY);a!=null&&this._connectNodeToDummy(t,s,a)}let o=t.getLayers(),r=o[o.length-1];for(let i of e)i.setLayer(r);return e}_restoreDummy(t,e){let o=t.getProperty(p.EXT_PORT_SIDE),r=t.getPorts()[0];o===u.NORTH?r.setSide(u.SOUTH):o===u.SOUTH&&r.setSide(u.NORTH);let i=e.getProperty(_.NODE_SIZE_CONSTRAINTS);if(i!=null&&i.has&&i.has(mt.PORT_LABELS)){let s=t.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL)||0,a=t.getProperty(_.SPACING_LABEL_PORT_VERTICAL)||0,l=t.getProperty(_.SPACING_LABEL_LABEL)||0,c=e.getProperty(_.PORT_LABELS_PLACEMENT);if(c!=null&&c.has){if(c.has(it.INSIDE)){let g=a,h=t.getSize().x/2-r.getPosition().x;for(let d of r.getLabels())d.getPosition().y=g,d.getPosition().x=h-d.getSize().x/2,g+=d.getSize().y+l}else if(c.has(it.OUTSIDE))for(let g of r.getLabels())g.getPosition().x=s+t.getSize().x-r.getPosition().x}No.getNodeMarginCalculator(oi.adapt(e,!1)).processNode(oi.adapt(t,!1))}}_connectNodeToDummy(t,e,o){let r=new rt;r.setNode(e);let i=e.getProperty(p.EXT_PORT_SIDE);r.setSide(i);let s=o.getPorts()[0],a=new _e;a.setSource(r),a.setTarget(s)}_setNorthSouthDummyCoordinates(t,e){let o=t.getProperty(_.PORT_CONSTRAINTS),r=t.getSize(),i=t.getPadding(),s=r.x+i.left+i.right,a=0-i.top-t.getOffset().y,l=r.y+i.top+i.bottom-t.getOffset().y,c=[],g=[];for(let h of e){o===H.FREE||o===H.FIXED_SIDE||o===H.FIXED_ORDER?this._calculateNorthSouthDummyPositions(h):o===H.FIXED_RATIO?(this._applyNorthSouthDummyRatio(h,s),h.borderToContentAreaCoordinates(!0,!1)):o===H.FIXED_POS&&(this._applyNorthSouthDummyPosition(h),h.borderToContentAreaCoordinates(!0,!1),r.x=Math.max(r.x,h.getPosition().x+h.getSize().x/2));let d=h.getProperty(p.EXT_PORT_SIDE);d===u.NORTH?(h.getPosition().y=a,c.push(h)):d===u.SOUTH&&(h.getPosition().y=l,g.push(h))}o===H.FREE||o===H.FIXED_SIDE?(this._ensureUniquePositions(c,t),this._ensureUniquePositions(g,t)):o===H.FIXED_ORDER&&(this._restoreProperOrder(c,t),this._restoreProperOrder(g,t))}_calculateNorthSouthDummyPositions(t){let e=t.getPorts()[0];if(e.getDegree()===0){t.getPosition().x=0;return}let o=0;for(let s of e.getConnectedPorts())o+=s.getNode().getPosition().x+s.getPosition().x+s.getAnchor().x;let r=t.getProperty(_.PORT_ANCHOR),i=r==null?0:r.x;t.getPosition().x=o/e.getDegree()-i}_applyNorthSouthDummyRatio(t,e){let o=t.getProperty(_.PORT_ANCHOR),r=o==null?0:o.x;t.getPosition().x=e*t.getProperty(p.PORT_RATIO_OR_POSITION)-r}_applyNorthSouthDummyPosition(t){let e=t.getProperty(_.PORT_ANCHOR),o=e==null?0:e.x;t.getPosition().x=t.getProperty(p.PORT_RATIO_OR_POSITION)-o}_ensureUniquePositions(t,e){if(t.length===0)return;let o=z.toNodeArray(t);o.sort((r,i)=>r.getPosition().x-i.getPosition().x),this._assignAscendingCoordinates(o,e)}_restoreProperOrder(t,e){if(t.length===0)return;let o=z.toNodeArray(t);o.sort((r,i)=>r.getProperty(p.PORT_RATIO_OR_POSITION)-i.getProperty(p.PORT_RATIO_OR_POSITION)),this._assignAscendingCoordinates(o,e)}_assignAscendingCoordinates(t,e){let o=e.getProperty(_.SPACING_PORT_PORT)||10,r=t[0].getPosition().x+t[0].getSize().x+t[0].getMargin().right+o;for(let i=1;i<t.length;i++){let s=t[i].getPosition(),a=t[i].getSize(),l=t[i].getMargin(),c=s.x-l.left-r;c<0&&(s.x-=c);let g=e.getSize();g.x=Math.max(g.x,s.x+a.x),r=s.x+a.x+l.right+o}}_routeEdges(t,e,o){let r=new Set,i=new Set,s=new Set,a=new Set,l=e.getProperty(_.SPACING_NODE_NODE),c=e.getProperty(_.SPACING_EDGE_EDGE);for(let g of o){let h=g.getProperty(p.EXT_PORT_SIDE);if(h===u.NORTH){i.add(g);for(let d of g.getIncomingEdges())r.add(d.getSource().getNode())}else if(h===u.SOUTH){a.add(g);for(let d of g.getIncomingEdges())s.add(d.getSource().getNode())}}if(r.size>0){let h=new ie(qe.SOUTH_TO_NORTH,c,"extnorth").routeEdges(t,e,r,0,i,-l-e.getOffset().y);h>0&&(this._northernExtPortEdgeRoutingHeight=l+(h-1)*c,e.getOffset().y+=this._northernExtPortEdgeRoutingHeight,e.getSize().y+=this._northernExtPortEdgeRoutingHeight)}if(s.size>0){let h=new ie(qe.NORTH_TO_SOUTH,c,"extsouth").routeEdges(t,e,s,0,a,e.getSize().y+l-e.getOffset().y);h>0&&(e.getSize().y+=l+(h-1)*c)}}_removeTemporaryNorthSouthDummies(t){let e=[];for(let o of t.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.EXTERNAL_PORT||!r.hasProperty(p.EXT_PORT_REPLACED_DUMMY))continue;let i=null,s=null,a=null;for(let T of r.getPorts())T.getSide()===u.WEST?i=T:T.getSide()===u.EAST?s=T:a=T;let l=a.getOutgoingEdges()[0],c=new st(l.getBendPoints()),g=new O(a.getPosition().x,a.getPosition().y);g.x+=r.getPosition().x,g.y+=r.getPosition().y,c.splice(0,0,g);let h=st.reverse(l.getBendPoints()),d=new O(a.getPosition().x,a.getPosition().y);d.x+=r.getPosition().x,d.y+=r.getPosition().y,h.add(d);let E=r.getProperty(p.EXT_PORT_REPLACED_DUMMY).getPorts()[0],P=[...i.getIncomingEdges()];for(let T of P)T.setTarget(E),T.getBendPoints().addAllAsCopies(T.getBendPoints().length,c);let S=z.toEdgeArray(s.getOutgoingEdges());for(let T of S)T.setSource(E),T.getBendPoints().addAllAsCopies(0,h);l.setSource(null),l.setTarget(null),e.push(r)}for(let o of e)o.setLayer(null)}_fixCoordinates(t){let e=t.getProperty(_.PORT_CONSTRAINTS),o=t.getLayers();this._fixCoordinatesInLayer(o[0],e,t),this._fixCoordinatesInLayer(o[o.length-1],e,t)}_fixCoordinatesInLayer(t,e,o){let r=o.getPadding(),i=o.getOffset(),s=o.getActualSize(),a=s.y;for(let l of t.getNodes()){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE),g=l.getProperty(p.EXT_PORT_SIZE),h=l.getPosition();c===u.EAST?h.x=o.getSize().x+r.right-i.x:c===u.WEST&&(h.x=-i.x-r.left);let d=0;if(c===u.EAST||c===u.WEST)if(e===H.FIXED_RATIO){let f=l.getProperty(p.PORT_RATIO_OR_POSITION);h.y=s.y*f-l.getProperty(_.PORT_ANCHOR).y,d=h.y+g.y,l.borderToContentAreaCoordinates(!1,!0)}else e===H.FIXED_POS&&(h.y=l.getProperty(p.PORT_RATIO_OR_POSITION)-l.getProperty(_.PORT_ANCHOR).y,d=h.y+g.y,l.borderToContentAreaCoordinates(!1,!0));a=Math.max(a,d)}o.getSize().y+=a-s.y;for(let l of t.getNodes()){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE),g=l.getPosition();c===u.NORTH?g.y=-i.y-r.top:c===u.SOUTH&&(g.y=o.getSize().y+r.bottom-i.y)}}_correctSlantedEdgeSegments(t){let e=t.getLayers();this._correctSlantedEdgeSegmentsInLayer(e[0]),this._correctSlantedEdgeSegmentsInLayer(e[e.length-1])}_correctSlantedEdgeSegmentsInLayer(t){for(let e of t.getNodes()){if(e.getType()!==y.EXTERNAL_PORT)continue;let o=e.getProperty(p.EXT_PORT_SIDE);if(!(o!==u.EAST&&o!==u.WEST))for(let r of e.getConnectedEdges()){let i=r.getBendPoints();if(i.length===0)continue;let s=r.getSource();if(s&&s.getNode()===e){let l=i[0];l.y=s.getAbsoluteAnchor().y}let a=r.getTarget();if(a&&a.getNode()===e){let l=i[i.length-1];l.y=a.getAbsoluteAnchor().y}}}}};var Jg=class{process(t,e){e.begin("Hierarchical port dummy size processing",1);let r=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS)*2,i=[],s=[];for(let a of t){i.length=0,s.length=0;for(let l of a){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE);c===u.NORTH?i.push(l):c===u.SOUTH&&s.push(l)}Mm(i,!0,r),Mm(s,!1,r)}e.done()}};function Mm(n,t,e){let o=0,r=e;t||(o=e*(n.length-1),r*=-1);for(let i of n){i.setProperty(_.ALIGNMENT,Kt.CENTER),i.getSize().x=o;for(let s of i.getPorts(u.EAST))s.getPosition().x=o;o+=r}}var Qg=class{process(t,e){e.begin("Hierarchical port position processing",1);let o=t.getLayers();o.length>0&&bm(o[0],t),o.length>1&&bm(o[o.length-1],t),e.done()}};function bm(n,t){let e=t.getProperty(_.PORT_CONSTRAINTS);if(!(e.isRatioFixed()||e.isPosFixed()))return;let o=t.getActualSize().y;for(let r of n){if(r.getType()!==y.EXTERNAL_PORT)continue;let i=r.getProperty(p.EXT_PORT_SIDE);if(i!==u.EAST&&i!==u.WEST)continue;let s=r.getProperty(p.PORT_RATIO_OR_POSITION);e===H.FIXED_RATIO&&(s*=o),r.getPosition().y=s-r.getProperty(_.PORT_ANCHOR).y,r.borderToContentAreaCoordinates(!1,!0)}}var oh=class{constructor(){this._layeredGraph=null,this._degreeThreshold=0,this._treeHeightThreshold=0}process(t,e){this._layeredGraph=t,this._degreeThreshold=t.getProperty(_.HIGH_DEGREE_NODES_THRESHOLD);let o=t.getProperty(_.HIGH_DEGREE_NODES_TREE_HEIGHT);o===0&&(o=Number.MAX_SAFE_INTEGER),this._treeHeightThreshold=o;let r=t.getLayers(),i=0;for(;i<r.length;){let s=r[i],a=[],l=-1,c=-1;for(let d of s.getNodes())if(this._isHighDegreeNode(d)){let f=this._calculateInformation(d);l=Math.max(l,f.incTreesMaxHeight),c=Math.max(c,f.outTreesMaxHeight),a.push([d,f])}let g=[];for(let d=0;d<l;d++){let f=new Et(t);r.splice(i,0,f),g.unshift(f),i++}for(let[,d]of a)if(d.incTreeRoots!=null)for(let f of d.incTreeRoots)this._moveTree(f,th,g);let h=[];for(let d=0;d<c;d++){let f=new Et(t);r.splice(i+1+d,0,f),h.push(f)}for(let[,d]of a)if(d.outTreeRoots!=null)for(let f of d.outTreeRoots)this._moveTree(f,eh,h);i+=1+Math.max(c,0)}for(let s=r.length-1;s>=0;s--)r[s].getNodes().length===0&&r.splice(s,1)}_isHighDegreeNode(t){return dN(t)>=this._degreeThreshold}_calculateInformation(t){let e=new g_;for(let o of t.getIncomingEdges()){if(o.isSelfLoop())continue;let r=o.getSource().getNode();if(c_(r,eh)){let i=this._isTreeRoot(r,eh,th);if(i===-1)continue;e.incTreesMaxHeight=Math.max(e.incTreesMaxHeight,i),e.incTreeRoots==null&&(e.incTreeRoots=[]),e.incTreeRoots.push(r)}}for(let o of t.getOutgoingEdges()){if(o.isSelfLoop())continue;let r=o.getTarget().getNode();if(c_(r,th)){let i=this._isTreeRoot(r,th,eh);if(i===-1)continue;e.outTreesMaxHeight=Math.max(e.outTreesMaxHeight,i),e.outTreeRoots==null&&(e.outTreeRoots=[]),e.outTreeRoots.push(r)}}return e}_moveTree(t,e,o){t.setLayer(o[0]);let r=o.slice(1);for(let i of e(t)){let s=h_(i,t);r.length>0&&this._moveTree(s,e,r)}}_isTreeRoot(t,e,o){if(this._isHighDegreeNode(t)||!c_(t,e))return-1;if(fN(o(t)))return 1;let r=0;for(let i of o(t)){let s=h_(i,t),a=this._isTreeRoot(s,e,o);if(a===-1||(r=Math.max(r,a),r>this._treeHeightThreshold-1))return-1}return r+1}},g_=class{constructor(){this.incTreesMaxHeight=-1,this.incTreeRoots=null,this.outTreesMaxHeight=-1,this.outTreeRoots=null}},th=n=>n.getIncomingEdges(),eh=n=>n.getOutgoingEdges(),hN=n=>n.getConnectedEdges();function dN(n){let t=0;for(let e of hN(n))t++;return t}function fN(n){for(let t of n)return!1;return!0}function c_(n,t){let e=null;for(let o of t(n)){let r=h_(o,n);if(e==null)e=r;else if(r!==e)return!1}return!0}function h_(n,t){return n.getSource().getNode()===t?n.getTarget().getNode():n.getSource().getNode()}var rh=class{process(t,e){e.begin("Hyperedge merging",1),pN(t);for(let o of t.getLayers()){let r=o.getNodes();if(r.length===0)continue;let i=null,s=null,a=null,l=null;for(let c=0;c<r.length;c++){if(i=r[c],s=i.getType(),s===y.LONG_EDGE&&l===y.LONG_EDGE){let g=uN(i,a);g.allowMerge&&(_N(i,a,g.sameSource,g.sameTarget),r.splice(c,1),c--,i=a,s=l)}a=i,l=s}}e.done()}};function uN(n,t){let e=n.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES),o=t.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES),r=n.getProperty(p.LONG_EDGE_SOURCE),i=t.getProperty(p.LONG_EDGE_SOURCE),s=n.getProperty(p.LONG_EDGE_TARGET),a=t.getProperty(p.LONG_EDGE_TARGET),l=r!=null&&r===i,c=s!=null&&s===a;if(!e&&!o){let d=n.getPorts()[0],f=t.getPorts()[0];return{allowMerge:d.id===f.id,sameSource:l,sameTarget:c}}let g=(!e||n.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY))&&(!o||t.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY)),h=(!e||!n.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY))&&(!o||!t.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY));return{allowMerge:l&&g||c&&h,sameSource:l,sameTarget:c}}function _N(n,t,e,o){let r=Gm(t.getPorts(u.WEST)),i=Gm(t.getPorts(u.EAST));for(let s of n.getPorts()){for(;s.getIncomingEdges().length>0;)s.getIncomingEdges()[0].setTarget(r);for(;s.getOutgoingEdges().length>0;)s.getOutgoingEdges()[0].setSource(i)}e||t.setProperty(p.LONG_EDGE_SOURCE,null),o||t.setProperty(p.LONG_EDGE_TARGET,null)}function Gm(n){for(let t of n)return t;return null}function pN(n){let t=[];for(let o of n.getLayers())for(let r of o.getNodes())for(let i of r.getPorts())t.push(i);for(let o of t)o.id=-1;let e=0;for(let o of t)o.id===-1&&d_(o,e++)}function d_(n,t){n.id=t;for(let e of n.getConnectedPorts())e.id===-1&&d_(e,t);if(n.getNode().getType()===y.LONG_EDGE)for(let e of n.getNode().getPorts())e!==n&&e.id===-1&&d_(e,t)}var ih=class{process(t,e){e.begin("Hypernodes processing",1);for(let o of t)for(let r of o){if(!r.getProperty(_.HYPERNODE)||r.getPorts().length>2)continue;let i=0,s=0,a=0,l=0;for(let c of r.getPorts())switch(c.getSide()){case u.NORTH:i++;break;case u.EAST:s++;break;case u.SOUTH:a++;break;case u.WEST:l++;break}i===0&&a===0&&EN(t,r,l<=s)}e.done()}};function EN(n,t,e){let o=[],r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;if(e){r=n.getSize().x;for(let c of t.getPorts())for(let g of c.getOutgoingEdges()){let h=g.getBendPoints();if(h.isEmpty())continue;let d=h.getFirst();d.x<r&&(i=r-d.x,s=Number.MAX_SAFE_INTEGER,o.length=0,r=d.x),d.x<=r&&(o.push(g),h.size()>1&&(s=Math.min(s,Math.abs(h.get(1).y-d.y))))}}else for(let c of t.getPorts())for(let g of c.getIncomingEdges()){let h=g.getBendPoints();if(h.isEmpty())continue;let d=h.getLast();d.x>r&&(i=d.x-r,s=Number.MAX_SAFE_INTEGER,o.length=0,r=d.x),d.x>=r&&(o.push(g),h.size()>1&&(s=Math.min(s,Math.abs(h.get(h.size()-2).y-d.y))))}if(o.length===0||i<=t.getSize().x/2||s<=t.getSize().y/2)return;let a=new rt;a.setNode(t),a.setSide(u.NORTH),a.getPosition().x=t.getSize().x/2;let l=new rt;l.setNode(t),l.setSide(u.SOUTH),l.getPosition().x=t.getSize().x/2,l.getPosition().y=t.getSize().y;for(let c of o){let g=c.getBendPoints(),h,d;e?(h=g.removeFirst(),d=g.isEmpty()?c.getTarget().getAbsoluteAnchor():g.getFirst(),d.y>=h.y?c.setSource(l):c.setSource(a)):(h=g.removeLast(),d=g.isEmpty()?c.getSource().getAbsoluteAnchor():g.getLast(),d.y>=h.y?c.setTarget(l):c.setTarget(a));let f=c.getProperty(_.JUNCTION_POINTS);f!=null&&f.remove(h)}t.getPosition().x=r-t.getSize().x/2}var sh=class{process(t,e){e.begin("Layer constraint edge reversal",1);for(let o of t){let r=-1,i=[],s=o.getNodes().slice();for(let a=0;a<s.length;a++){let l=s[a].getProperty(p.IN_LAYER_CONSTRAINT);r===-1?l!==jt.TOP&&(r=a):l===jt.TOP&&(s[a].setLayer(null),s[a].setLayer(r++,o)),l===jt.BOTTOM&&i.push(s[a])}for(let a of i)a.setLayer(null),a.setLayer(o)}e.done()}};var nh=class{process(t,e){e.begin("Node margin calculation",1),No.getNodeMarginCalculator(oi.adapt(t,!1)).excludeEdgeHeadTailLabels().process(),e.done()}};var Gn=10,ah=class{constructor(){this._minX=Number.POSITIVE_INFINITY,this._maxX=Number.NEGATIVE_INFINITY,this._minY=Number.POSITIVE_INFINITY,this._maxY=Number.NEGATIVE_INFINITY}process(t,e){if(t.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)){for(let r of t.getLayerlessNodes()){if(r.getType()!==y.NORMAL)continue;let i=r.getProperty(_.MARGINS),s=i!=null?i.left:0,a=i!=null?i.right:0,l=i!=null?i.top:0,c=i!=null?i.bottom:0,g=r.getPosition(),h=r.getSize();g.x-s<this._minX&&(this._minX=g.x-s),g.x+h.x+a>this._maxX&&(this._maxX=g.x+h.x+a),g.y-l<this._minY&&(this._minY=g.y-l),g.y+h.y+c>this._maxY&&(this._maxY=g.y+h.y+c)}for(let r of t.getLayerlessNodes()){if(r.getType()===y.NORMAL)continue;if(r.getType()!==y.EXTERNAL_PORT)throw new Error(`InteractiveExternalPortPositioner: unsupported node type ${r.getType()}`);let i=r.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.FIRST_SEPARATE){r.getPosition().x=this._minX-Gn;let a=Hm(r,l=>l.getTarget().getNode());a!=null&&(r.getPosition().y=a);continue}if(i===J.LAST_SEPARATE){r.getPosition().x=this._maxX+Gn;let a=Hm(r,l=>l.getSource().getNode());a!=null&&(r.getPosition().y=a);continue}let s=r.getProperty(p.IN_LAYER_CONSTRAINT);if(s===jt.TOP){let a=vm(r);a!=null&&(r.getPosition().x=a+Gn),r.getPosition().y=this._minY-Gn;continue}if(s===jt.BOTTOM){let a=vm(r);a!=null&&(r.getPosition().x=a+Gn),r.getPosition().y=this._maxY+Gn}}}}};function Hm(n,t){for(let e of n.getConnectedEdges()){let o=t(e);return o.getPosition().y+o.getSize().y/2}return null}function vm(n){if(n.getPorts().length!==1)throw new Error("external port dummy must have exactly one port");let t=n.getPorts()[0],e=t.getOutgoingEdges().length>0,o=t.getIncomingEdges().length>0;if(e&&o)throw new Error("Interactive layout does not support N/S ports with incoming AND outgoing edges");if(e){let r=Number.POSITIVE_INFINITY;for(let i of t.getOutgoingEdges()){let s=i.getTarget().getNode(),a=s.getProperty(_.MARGINS),l=a!=null?a.left:0,c=s.getPosition().x-l;c<r&&(r=c)}return r}if(o){let r=Number.NEGATIVE_INFINITY;for(let i of t.getIncomingEdges()){let s=i.getSource().getNode(),a=s.getProperty(_.MARGINS),l=a!=null?a.right:0,c=s.getPosition().x+s.getSize().x+l;c>r&&(r=c)}return r}return null}var lh=class{process(t,e){e.begin("Inverted port preprocessing",1);let o=t.getLayers(),r=[],i=null;for(let s=0;s<o.length;s++){let a=i;i=o[s];for(let c of r)c.setLayer(a);r=[];let l=i.getNodes().slice();for(let c of l)if(c.getType()===y.NORMAL&&c.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){for(let g of c.getPorts(W.INPUT,u.EAST)){let h=g.getIncomingEdges().slice();for(let d of h)mN(t,g,d,r)}for(let g of c.getPorts(W.OUTPUT,u.WEST)){let h=g.getOutgoingEdges().slice();for(let d of h)PN(t,g,d,r)}}}for(let s of r)s.setLayer(i);e.done()}};function mN(n,t,e,o){if(e.getSource().getNode()===t.getNode())return;let r=new ft(n);r.setType(y.LONG_EDGE),r.setProperty(p.ORIGIN,e),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.push(r);let i=new rt;i.setNode(r),i.setSide(u.WEST);let s=new rt;s.setNode(r),s.setSide(u.EAST),e.setTarget(i);let a=new _e;a.copyProperties(e),a.setProperty(_.JUNCTION_POINTS,null),a.setSource(s),a.setTarget(t),Um(r,i,s),Bm(e,a,!1)}function PN(n,t,e,o){if(e.getTarget().getNode()===t.getNode())return;let r=new ft(n);r.setType(y.LONG_EDGE),r.setProperty(p.ORIGIN,e),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.push(r);let i=new rt;i.setNode(r),i.setSide(u.WEST);let s=new rt;s.setNode(r),s.setSide(u.EAST);let a=e.getTarget();e.setTarget(i);let l=new _e;l.copyProperties(e),l.setProperty(_.JUNCTION_POINTS,null),l.setSource(s),l.setTarget(a),Bm(e,l,!0),Um(r,i,s)}function Bm(n,t,e){let o=n.getLabels(),r=0;for(;r<o.length;){let i=o[r];i.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD?((e||!i.hasProperty(p.END_LABEL_EDGE))&&i.setProperty(p.END_LABEL_EDGE,n),o.splice(r,1),t.getLabels().push(i)):r++}}function Um(n,t,e){let o=t.getIncomingEdges()[0].getSource(),r=o.getNode(),i=e.getOutgoingEdges()[0].getTarget(),s=i.getNode();r.getType()===y.LONG_EDGE?n.setProperty(p.LONG_EDGE_SOURCE,r.getProperty(p.LONG_EDGE_SOURCE)):n.setProperty(p.LONG_EDGE_SOURCE,o),s.getType()===y.LONG_EDGE?n.setProperty(p.LONG_EDGE_TARGET,s.getProperty(p.LONG_EDGE_TARGET)):n.setProperty(p.LONG_EDGE_TARGET,i)}var ch=class{process(t,e){e.begin("Node and Port Label Placement and Node Sizing",1),No.calculateLabelAndNodeSizes(oi.adapt(t,!0,!0,r=>r.getType()===y.NORMAL));let o=t.getProperty(p.GRAPH_PROPERTIES);if(o!=null&&o.has(v.EXTERNAL_PORTS)){let r=t.getProperty(_.PORT_LABELS_PLACEMENT),i=r!=null&&r.has(it.NEXT_TO_PORT_IF_POSSIBLE),s=t.getProperty(_.PORT_LABELS_TREAT_AS_GROUP);for(let a of t.getLayers())for(let l of a.getNodes())l.getType()===y.EXTERNAL_PORT&&this._placeExternalPortDummyLabels(l,r,i,s)}e.done()}_placeExternalPortDummyLabels(t,e,o,r){let i=t.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL),s=t.getProperty(_.SPACING_LABEL_PORT_VERTICAL),a=t.getProperty(_.SPACING_LABEL_LABEL),l=t.getSize(),c=t.getPorts()[0],g=c.getPosition(),h=this._computePortLabelBox(c,a);if(h==null)return;if(e!=null&&e.has(it.INSIDE))switch(t.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:h.x=(l.x-h.width)/2-g.x,h.y=s;break;case u.SOUTH:h.x=(l.x-h.width)/2-g.x,h.y=-s-h.height;break;case u.EAST:{if(f_(c,!0,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=l.y+s-g.y;h.x=-i-h.width;break}case u.WEST:{if(f_(c,!0,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=l.y+s-g.y;h.x=i;break}default:break}else if(e!=null&&e.has(it.OUTSIDE))switch(t.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:case u.SOUTH:h.x=g.x+i;break;case u.EAST:case u.WEST:{if(f_(c,!1,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=g.y+s;break}default:break}let d=h.y;for(let f of c.getLabels()){let E=f.getPosition();E.x=h.x,E.y=d,d+=f.getSize().y+a}}_computePortLabelBox(t,e){let o=t.getLabels();if(o.length===0)return null;let r=new dt;for(let i of o){let s=i.getSize();s.x>r.width&&(r.width=s.x),r.height+=s.y}return r.height+=(o.length-1)*e,r}};function f_(n,t,e){return e?t?n.getIncomingEdges().length===0&&n.getOutgoingEdges().length===0:!n.isConnectedToExternalNodes():!1}var ri=class n{process(t,e){e.begin("Edge splitting",1);let o=t.getLayers();if(o.length<=2){e.done();return}for(let r=0;r<o.length-1;r++){let i=o[r],s=o[r+1];for(let a of i)for(let l of a.getPorts()){let c=l.getOutgoingEdges().slice();for(let g of c){let h=g.getTarget().getNode().getLayer();if(h!==i&&h!==s){let d=ON(t,s,g);n.splitEdge(g,d)}}}}e.done()}static splitEdge(t,e){let o=t.getTarget(),r=t.getProperty(_.EDGE_THICKNESS);r<0&&(r=0,t.setProperty(_.EDGE_THICKNESS,r)),e.getSize().y=r;let i=Math.floor(r/2),s=new rt;s.setSide(u.WEST),s.setNode(e),s.getPosition().y=i;let a=new rt;a.setSide(u.EAST),a.setNode(e),a.getPosition().y=i,t.setTarget(s);let l=new _e;return l.copyProperties(t),l.setProperty(_.JUNCTION_POINTS,null),l.setSource(a),l.setTarget(o),SN(e,t,l),TN(t,l),l}};function ON(n,t,e){let o=new ft(n);return o.setType(y.LONG_EDGE),o.setProperty(p.ORIGIN,e),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setLayer(t),o}function SN(n,t,e){let o=t.getSource().getNode(),r=e.getTarget().getNode();o.getType()===y.LONG_EDGE?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,o.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES))):o.getType()===y.LABEL?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,!0)):r.getType()===y.LABEL?(n.setProperty(p.LONG_EDGE_SOURCE,r.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,r.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,!0)):(n.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),n.setProperty(p.LONG_EDGE_TARGET,e.getTarget()))}function TN(n,t){let e=n.getLabels(),o=0;for(;o<e.length;){let r=e[o];r.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD?(e.splice(o,1),t.getLabels().push(r),r.hasProperty(p.END_LABEL_EDGE)||r.setProperty(p.END_LABEL_EDGE,n)):o++}}var gh=class{process(t,e){e.begin("Label dummy insertions",1);let o=[],r=t.getProperty(_.SPACING_EDGE_LABEL),i=t.getProperty(_.SPACING_LABEL_LABEL),s=t.getProperty(_.DIRECTION),a=s!=null&&s.isVertical&&s.isVertical();for(let l of t.getLayerlessNodes()){let c=[...l.getOutgoingEdges()];for(let g of c){if(!NN(g))continue;let h=yN(g),d=[],f=IN(t,g,d);o.push(f);let E=f.getSize(),P=g.getLabels(),S=0;for(;S<P.length;){let N=P[S];N.getProperty(_.EDGE_LABELS_PLACEMENT)===St.CENTER?(a?(E.x+=N.getSize().x+i,N.getSize().y>E.y&&(E.y=N.getSize().y)):(N.getSize().x>E.x&&(E.x=N.getSize().x),E.y+=N.getSize().y+i),d.push(N),P.splice(S,1)):S++}a?(E.x-=i,E.y+=r+h):E.y+=r-i+h;let T=Math.floor(h/2);for(let N of f.getPorts())N.getPosition().y=T}}for(let l of o)t.getLayerlessNodes().push(l);e.done()}};function NN(n){if(n.getSource().getNode()===n.getTarget().getNode())return!1;for(let t of n.getLabels())if(t.getProperty(_.EDGE_LABELS_PLACEMENT)===St.CENTER)return!0;return!1}function yN(n){let t=n.getProperty(_.EDGE_THICKNESS);return t<0&&(t=0,n.setProperty(_.EDGE_THICKNESS,t)),t}function IN(n,t,e){let o=new ft(n);return o.setType(y.LABEL),o.setProperty(p.ORIGIN,t),o.setProperty(p.REPRESENTED_LABELS,e),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),o.setProperty(p.LONG_EDGE_TARGET,t.getTarget()),ri.splitEdge(t,o),o}var ii=class n{process(t,e){e.begin("Edge joining",1);let o=t.getProperty(_.UNNECESSARY_BENDPOINTS);for(let r of t){let i=r.getNodes(),s=0;for(;s<i.length;){let a=i[s];a.getType()===y.LONG_EDGE?(n.joinAt(a,o),i.splice(s,1)):s++}}e.done()}static joinAt(t,e){let o=t.getPorts(u.WEST),r=t.getPorts(u.EAST),i=Fm(o),s=Fm(r),a=i.getIncomingEdges(),l=s.getOutgoingEdges(),c=a.length,g=t.getPorts()[0].getAbsoluteAnchor();for(;c-- >0;){let h=a[0],d=l[0],E=d.getTarget().getIncomingEdges().indexOf(d);h.setTargetAndInsertAtIndex(d.getTarget(),E),d.setSource(null),d.setTarget(null);let P=h.getBendPoints();e&&P.add(new O(g.x,g.y));for(let N of d.getBendPoints())P.add(new O(N.x,N.y));for(let N of d.getLabels())h.getLabels().push(N);let S=h.getProperty(_.JUNCTION_POINTS),T=d.getProperty(_.JUNCTION_POINTS);if(T!=null){S==null&&(S=new st,h.setProperty(_.JUNCTION_POINTS,S));for(let N of T)S.add(new O(N.x,N.y))}}}};function Fm(n){for(let t of n)return t;return null}var hh=class{process(t,e){e.begin("Label dummy removal",1);let o=t.getProperty(_.SPACING_EDGE_LABEL),r=t.getProperty(_.SPACING_LABEL_LABEL),i=t.getProperty(_.DIRECTION);for(let s of t.getLayers()){let a=s.getNodes(),l=0;for(;l<a.length;){let c=a[l];if(c.getType()!==y.LABEL){l++;continue}let g=c.getProperty(p.ORIGIN),h=Number(g.getProperty(_.EDGE_THICKNESS)),d=c.getProperty(p.LABEL_SIDE)===Vt.BELOW,f=new O(c.getPosition().x,c.getPosition().y);d&&(f.y+=h+o);let E=new O(c.getSize().x,c.getSize().y+(c.isInlineEdgeLabel()?0:-h-o)),P=c.getProperty(p.REPRESENTED_LABELS);i!=null&&i.isVertical&&i.isVertical()?LN(P,f,r,E,d,i):RN(P,f,r,E);for(let T of P)g.getLabels().push(T);let S=t.getProperty(_.EDGE_ROUTING);ii.joinAt(c,S===At.POLYLINE),a.splice(l,1)}}e.done()}};function RN(n,t,e,o){for(let r of n)r.getPosition().x=t.x+(o.x-r.getSize().x)/2,r.getPosition().y=t.y,t.y+=r.getSize().y+e}function LN(n,t,e,o,r,i){let s=n.every(l=>l.getProperty(_.EDGE_LABELS_INLINE)),a=i===R.UP?[...n].reverse():n;for(let l of a)l.getPosition().x=t.x,s?l.getPosition().y=t.y+(o.y-l.getSize().y)/2:r?l.getPosition().y=t.y:l.getPosition().y=t.y+o.y-l.getSize().y,t.x+=l.getSize().x+e}var Ct=class{constructor(t,e){this._name=t,this._usesLabelSize=e}toString(){return this._name}usesLabelSizeInformation(){return this._usesLabelSize}};Ct.MEDIAN_LAYER=new Ct("MEDIAN_LAYER",!1);Ct.TAIL_LAYER=new Ct("TAIL_LAYER",!1);Ct.HEAD_LAYER=new Ct("HEAD_LAYER",!1);Ct.SPACE_EFFICIENT_LAYER=new Ct("SPACE_EFFICIENT_LAYER",!0);Ct.WIDEST_LAYER=new Ct("WIDEST_LAYER",!0);Ct.CENTER_LAYER=new Ct("CENTER_LAYER",!0);Ct.values=()=>[Ct.MEDIAN_LAYER,Ct.TAIL_LAYER,Ct.HEAD_LAYER,Ct.SPACE_EFFICIENT_LAYER,Ct.WIDEST_LAYER,Ct.CENTER_LAYER];var tl=class n{constructor(){this._layerWidths=null}process(t,e){var i;e.begin("Label dummy switching",1);let o=(i=t.getProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY))!=null?i:Ct.MEDIAN_LAYER;AN(t);let r=CN(t,o);this._layerWidths=new Array(t.getLayers().length).fill(0);for(let s of Ct.values())if(s.usesLabelSizeInformation()&&r.get(s).length>0){this._calculateLayerWidths(t);break}for(let s of Ct.values())s.usesLabelSizeInformation()||this._processStrategy(r.get(s));for(let s of Ct.values())s.usesLabelSizeInformation()&&this._processStrategy(r.get(s));this._layerWidths=null,e.done()}_calculateLayerWidths(t){for(let e of t.getLayers())this._layerWidths[e.id]=z.findMaxNonDummyNodeWidth(e,!1)}_processStrategy(t){if(t.length!==0){if(t[0].placementStrategy===Ct.SPACE_EFFICIENT_LAYER){this._computeSpaceEfficientAssignment(t);return}for(let e of t){switch(e.placementStrategy){case Ct.CENTER_LAYER:this._assignLayer(e,this._findCenterLayerTargetId(e));break;case Ct.MEDIAN_LAYER:this._assignLayer(e,xN(e));break;case Ct.WIDEST_LAYER:this._assignLayer(e,this._findWidestLayerTargetId(e));break;case Ct.HEAD_LAYER:Wm(e),this._assignLayer(e,km(e,!0));break;case Ct.TAIL_LAYER:Wm(e),this._assignLayer(e,km(e,!1));break}wN(e)}}}_findWidestLayerTargetId(t){let e=t.leftmostLayerId;for(let o=e+1;o<=t.rightmostLayerId;o++)this._layerWidths[o]>this._layerWidths[e]&&(e=o);return e}_findCenterLayerTargetId(t){let e=this._computeLayerWidthSums(t),o=e[e.length-1]/2;for(let r=0;r<e.length;r++)if(e[r]>=o)return t.leftmostLayerId+r;return t.leftmostLayerId+t.leftLongEdgeDummies.length}_computeLayerWidthSums(t){let e=t.labelDummy.getGraph(),o=e.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS)*2,r=e.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),i=Math.max(o,r),s=new Array(t.totalDummyCount()),a=-i,l=0;for(let c of t.leftLongEdgeDummies)a+=this._layerWidths[c.getLayer().id]+i,s[l++]=a;a+=this._layerWidths[t.labelDummy.getLayer().id]+i,s[l++]=a;for(let c of t.rightLongEdgeDummies)a+=this._layerWidths[c.getLayer().id]+i,s[l++]=a;return s}_computeSpaceEfficientAssignment(t){let e=this._performTrivialAssignments(t);if(e.length!==0){e.sort((o,r)=>r.labelDummy.getSize().x-o.labelDummy.getSize().x);for(let o=0;o<e.length;o++)this._assignLayer(e[o],this._findPotentiallyWidestLayer(e,o))}}_performTrivialAssignments(t){let e=[];for(let o of t)o.leftmostLayerId===o.rightmostLayerId?this._assignLayer(o,o.leftmostLayerId):this._assignToWiderLayer(o)||e.push(o);return e}_assignToWiderLayer(t){let e=t.labelDummy.getSize().x,r=t.labelDummy.getGraph().getLayers().slice(t.leftmostLayerId,t.rightmostLayerId+1);for(let i of r)if(i.getSize().x>=e)return this._assignLayer(t,i.id),!0;return!1}_findPotentiallyWidestLayer(t,e){let o=t[e],r=o.labelDummy.getSize().x,i=o.leftmostLayerId,s=0;for(let a=o.leftmostLayerId;a<=o.rightmostLayerId;a++){if(r<=this._layerWidths[a])return a;let l=this._layerWidths[a],c=null;for(let g=e+1;g<t.length;g++){let h=t[g];h.leftmostLayerId<=a&&h.rightmostLayerId>=a&&(c=h)}c!=null&&(l=Math.max(l,c.labelDummy.getSize().x)),l>s&&(i=a,s=l)}return i}_assignLayer(t,e){e!==t.leftmostLayerId+t.leftLongEdgeDummies.length&&DN(t.labelDummy,t.ithDummyNode(e-t.leftmostLayerId));let o=t.labelDummy.getLayer().id;this._layerWidths[o]=Math.max(this._layerWidths[o],t.labelDummy.getSize().x);let r=t.labelDummy.getProperty(p.REPRESENTED_LABELS);if(r!=null)for(let i of r)i.setProperty(n.INCLUDE_LABEL,!0)}};tl.INCLUDE_LABEL=new m("edgelabelcenterednessanalysis.includelabel",!1);function AN(n){let t=0;for(let e of n)e.id=t++}function CN(n,t){let e=new Map;for(let o of Ct.values())e.set(o,[]);for(let o of n.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.LABEL)continue;let i=new u_(r,t);e.get(i.placementStrategy).push(i)}return e}function xN(n){let t=n.totalDummyCount(),e=Math.floor((t-1)/2);return n.leftmostLayerId+e}function km(n,t){let e=Ym(n);return t&&!e||!t&&e?n.rightmostLayerId:n.leftmostLayerId}function Wm(n){let t=n.placementStrategy===Ct.HEAD_LAYER,e=Ym(n);t&&!e||!t&&e?n.labelDummy.setProperty(_.ALIGNMENT,Kt.RIGHT):n.labelDummy.setProperty(_.ALIGNMENT,Kt.LEFT)}function Ym(n){let t=null;for(let o of n.labelDummy.getIncomingEdges()){t=o;break}let e=null;for(let o of n.labelDummy.getOutgoingEdges()){e=o;break}return t!=null&&t.getProperty(p.REVERSED)||e!=null&&e.getProperty(p.REVERSED)}function DN(n,t){let e=n.getLayer(),o=t.getLayer(),r=e.getNodes().indexOf(n),i=o.getNodes().indexOf(t),s=null;for(let E of n.getPorts(W.INPUT)){s=E;break}let a=null;for(let E of n.getPorts(W.OUTPUT)){a=E;break}let l=null;for(let E of t.getPorts(W.INPUT)){l=E;break}let c=null;for(let E of t.getPorts(W.OUTPUT)){c=E;break}let g=z.toEdgeArray(s.getIncomingEdges()),h=z.toEdgeArray(a.getOutgoingEdges()),d=z.toEdgeArray(l.getIncomingEdges()),f=z.toEdgeArray(c.getOutgoingEdges());n.setLayer(i,o);for(let E of d)E.setTarget(s);for(let E of f)E.setSource(a);t.setLayer(r,e);for(let E of g)E.setTarget(l);for(let E of h)E.setSource(c)}function wN(n){let t=n.labelDummy,e=zm(t);for(;e!=null&&e.getType()===y.LONG_EDGE;)e.setProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY,!0),e=zm(e)}function zm(n){for(let t of n.getIncomingEdges())return t.getSource().getNode();return null}var u_=class{constructor(t,e){this.labelDummy=t,this.placementStrategy=e,this.leftLongEdgeDummies=[],this.rightLongEdgeDummies=[],this.leftmostLayerId=0,this.rightmostLayerId=0,this._gatherLeftLongEdgeDummies(),this._gatherRightLongEdgeDummies(),this.leftLongEdgeDummies.length===0?this.leftmostLayerId=t.getLayer().id:this.leftmostLayerId=this.leftLongEdgeDummies[0].getLayer().id,this.rightLongEdgeDummies.length===0?this.rightmostLayerId=t.getLayer().id:this.rightmostLayerId=this.rightLongEdgeDummies[this.rightLongEdgeDummies.length-1].getLayer().id;let o=t.getProperty(p.REPRESENTED_LABELS);if(o!=null){for(let r of o)if(r.hasProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY)){this.placementStrategy=r.getProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY);break}}}_gatherLeftLongEdgeDummies(){let t=this.labelDummy;do{let e=null;for(let o of t.getIncomingEdges()){e=o.getSource().getNode();break}if(e==null)break;t=e,t.getType()===y.LONG_EDGE&&this.leftLongEdgeDummies.push(t)}while(t.getType()===y.LONG_EDGE);this.leftLongEdgeDummies.reverse()}_gatherRightLongEdgeDummies(){let t=this.labelDummy;do{let e=null;for(let o of t.getOutgoingEdges()){e=o.getTarget().getNode();break}if(e==null)break;t=e,t.getType()===y.LONG_EDGE&&this.rightLongEdgeDummies.push(t)}while(t.getType()===y.LONG_EDGE)}totalDummyCount(){return this.rightmostLayerId-this.leftmostLayerId+1}ithDummyNode(t){return t<this.leftLongEdgeDummies.length?this.leftLongEdgeDummies[t]:t===this.leftLongEdgeDummies.length?this.labelDummy:this.rightLongEdgeDummies[t-this.leftLongEdgeDummies.length-1]}};var Hn=new m("org.eclipse.elk.labels.labelManager");var MN=20,__=40,ol=60,el=class{constructor(t){this._centerLabels=!!t}process(t,e){e.begin("Label management",1);let o=t.getProperty(Hn);if(o!=null){let r=t.getProperty(_.SPACING_EDGE_LABEL),i=t.getProperty(_.SPACING_LABEL_LABEL);this._centerLabels?GN(t,o,r,i):bN(t,o,i)}e.done()}};function bN(n,t,e){let o=n.getProperty(_.DIRECTION),r=o!=null&&o.isVertical&&o.isVertical();for(let i of n)for(let s of i){if(s.getType()===y.NORMAL){As(t,s.getLabels(),__,e,r);for(let a of s.getPorts())As(t,a.getLabels(),MN,e,r);s.hasProperty(p.TOP_COMMENTS)&&Vm(t,s.getProperty(p.TOP_COMMENTS),__,r),s.hasProperty(p.BOTTOM_COMMENTS)&&Vm(t,s.getProperty(p.BOTTOM_COMMENTS),__,r)}for(let a of s.getOutgoingEdges())As(t,a.getLabels(),ol,0,r)}}function Vm(n,t,e,o){for(let r of t)r.getLabels().length!==0&&As(n,r.getLabels(),e,0,o)}function GN(n,t,e,o){let r=n.getProperty(_.DIRECTION),i=r!=null&&r.isVertical&&r.isVertical();for(let s of n){let a=Math.max(ol,z.findMaxNonDummyNodeWidth(s,!1));for(let l of s){if(l.getType()!==y.LABEL)continue;let c=null;for(let f of l.getConnectedEdges()){c=f;break}let g=c.getProperty(_.EDGE_THICKNESS),h=l.getProperty(p.REPRESENTED_LABELS),d=As(t,h,a,o,i);l.getSize().x=d.x,l.getSize().y=d.y+g+e}}}function As(n,t,e,o,r){let i=new O,s=!1;for(let a of t){s=!0;let l=a.getSize(),c=a.getProperty(p.ORIGIN);if(c!=null){let g=n.manageLabelSize(c,e);g!=null&&(r?(l.x=g.y,l.y=g.x):(l.x=g.x,l.y=g.y))}r?(i.x+=o+a.getSize().x,i.y=Math.max(i.y,l.y)):(i.x=Math.max(i.x,l.x),i.y+=o+a.getSize().y)}return s&&(r?i.x-=o:i.y-=o),i}var Tt=class{constructor(t){this.name=t,this._transposed=null}toString(){return this.name}transpose(){return this._transposed||this}};Tt.ALWAYS_UP=new Tt("ALWAYS_UP");Tt.ALWAYS_DOWN=new Tt("ALWAYS_DOWN");Tt.DIRECTION_UP=new Tt("DIRECTION_UP");Tt.DIRECTION_DOWN=new Tt("DIRECTION_DOWN");Tt.SMART_UP=new Tt("SMART_UP");Tt.SMART_DOWN=new Tt("SMART_DOWN");Tt.ALWAYS_UP._transposed=Tt.ALWAYS_DOWN;Tt.ALWAYS_DOWN._transposed=Tt.ALWAYS_UP;Tt.DIRECTION_UP._transposed=Tt.DIRECTION_DOWN;Tt.DIRECTION_DOWN._transposed=Tt.DIRECTION_UP;Tt.SMART_UP._transposed=Tt.SMART_DOWN;Tt.SMART_DOWN._transposed=Tt.SMART_UP;[Tt.ALWAYS_UP,Tt.ALWAYS_DOWN,Tt.DIRECTION_UP,Tt.DIRECTION_DOWN,Tt.SMART_UP,Tt.SMART_DOWN].forEach(n=>Object.freeze(n));var dh=class{process(t,e){let o=t.getProperty(_.EDGE_LABELS_SIDE_SELECTION);switch(e.begin(`Label side selection (${o})`,1),o){case Tt.ALWAYS_UP:Xm(t,Vt.ABOVE);break;case Tt.ALWAYS_DOWN:Xm(t,Vt.BELOW);break;case Tt.DIRECTION_UP:Km(t,Vt.ABOVE);break;case Tt.DIRECTION_DOWN:Km(t,Vt.BELOW);break;case Tt.SMART_UP:Zm(t,Vt.ABOVE);break;case Tt.SMART_DOWN:Zm(t,Vt.BELOW);break}e.done()}};function Xm(n,t){for(let e of n)for(let o of e){o.getType()===y.LABEL&&si(o,t);for(let r of o.getOutgoingEdges())Qm(r,t)}}function Km(n,t){for(let e of n)for(let o of e){if(o.getType()===y.LABEL){let r=BN(o)?t:t.opposite();si(o,r)}for(let r of o.getOutgoingEdges()){let i=p_(r)?t:t.opposite();Qm(r,i)}}}function Zm(n,t){let e=[];for(let o of n){let r=!0,i=0;for(let s of o){let a=s.getType();if(a===y.LABEL){i++,e.push(s);continue}if(a===y.LONG_EDGE){e.push(s);continue}a===y.NORMAL&&vN(s,t),e.length>0&&jm(e,i,r,!1,t),r=!1,i=0}e.length>0&&jm(e,i,r,!0,t)}}function jm(n,t,e,o,r){e&&(!o||n.length>1)&&t===1&&n[0].getType()===y.LABEL?si(n[0],Vt.ABOVE):o&&(!e||n.length>1)&&t===1&&n[n.length-1].getType()===y.LABEL?si(n[n.length-1],Vt.BELOW):n.length===2?(si(n.shift(),Vt.ABOVE),si(n.shift(),Vt.BELOW)):HN(n,t,r),n.length=0}function HN(n,t,e){let o=[],r=null,i=null;for(let s of n){let a=$m(s,!0),l=$m(s,!1);(r!==a||i!==l)&&(qm(o,e),r=a,i=l),o.push(s)}qm(o,e)}function $m(n,t){let e=n.getProperty(t?p.LONG_EDGE_SOURCE:p.LONG_EDGE_TARGET);return e==null?null:e.getNode()}function qm(n,t){if(n.length>0){if(n.length===2)si(n[0],Vt.ABOVE),si(n[1],Vt.BELOW);else for(let e of n)si(e,t);n.length=0}}function vN(n,t){let e=[],o=null;for(let r of n.getPorts()){r.getSide()!==o&&(e.length>0&&Jm(e,o,t),e.length=0,o=r.getSide());let i=In.gatherLabels(r);i!=null&&e.push(i)}e.length>0&&Jm(e,o,t)}function Jm(n,t,e){if(n.length===2)t===u.NORTH||t===u.EAST?(rl(n.shift(),Vt.ABOVE),rl(n.shift(),Vt.BELOW)):(rl(n.shift(),Vt.BELOW),rl(n.shift(),Vt.ABOVE));else for(let o of n)rl(o,e)}function si(n,t){if(n.getType()!==y.LABEL)return;let e=n.isInlineEdgeLabel()?Vt.INLINE:t;if(n.setProperty(p.LABEL_SIDE,e),e!==Vt.BELOW){let r=n.getProperty(p.ORIGIN).getProperty(_.EDGE_THICKNESS),i=0;if(e===Vt.ABOVE)i=n.getSize().y-Math.ceil(r/2);else if(e===Vt.INLINE){let s=n.getGraph().getProperty(_.SPACING_EDGE_LABEL);i=Math.ceil(n.getSize().y-s-r)/2,n.getSize().y-=s,n.getSize().y-=r}for(let s of n.getPorts())s.getPosition().y=i}}function Qm(n,t){for(let e of n.getLabels())e.setProperty(p.LABEL_SIDE,t)}function rl(n,t){for(let e of n)e.setProperty(p.LABEL_SIDE,t)}function p_(n){return!n.getProperty(p.REVERSED)}function BN(n){let t=null;for(let o of n.getIncomingEdges()){t=o;break}let e=null;for(let o of n.getOutgoingEdges()){e=o;break}return t!=null&&p_(t)||e!=null&&p_(e)}var fh=class{process(t,e){e.begin("Layer constraint postprocessing",1);let o=t.getLayers();if(o.length>0){let r=o[0],i=o[o.length-1],s=new Et(t),a=new Et(t);UN(t,r,i,s,a),s.getNodes().length>0&&o.unshift(s),a.getNodes().length>0&&o.push(a)}if(t.hasProperty(p.HIDDEN_NODES)){let r=new Et(t),i=new Et(t);FN(t,r,i),r.getNodes().length>0&&o.unshift(r),i.getNodes().length>0&&o.push(i)}e.done()}};function UN(n,t,e,o,r){for(let a of n){let l=a.getNodes().slice();for(let c of l)switch(c.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST:kN(c),c.setLayer(t),tP(c,!0,o);break;case J.LAST:WN(c),c.setLayer(e),tP(c,!1,r);break;default:break}}let i=n.getLayers(),s=0;for(;s<i.length;)i[s].getNodes().length===0?i.splice(s,1):s++}function tP(n,t,e){let o=t?n.getIncomingEdges():n.getOutgoingEdges();for(let r of o){let i=t?r.getSource().getNode():r.getTarget().getNode();i.getType()===y.LABEL&&i.setLayer(e)}}function FN(n,t,e){for(let o of n.getProperty(p.HIDDEN_NODES)){let r=o.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(r===J.FIRST_SEPARATE)o.setLayer(t);else if(r===J.LAST_SEPARATE)o.setLayer(e);else throw new Error(`Hidden node ${o} has unexpected layer constraint ${r}`);for(let i of o.getConnectedEdges()){if(i.getSource()!=null&&i.getTarget()!=null)continue;let s=i.getTarget()==null,a=i.getProperty(p.ORIGINAL_OPPOSITE_PORT);s?i.setTarget(a):i.setSource(a)}}}function kN(n){for(let t of n.getIncomingEdges())if(t.getSource().getNode().getType()!==y.LABEL)throw new Error(`Node '${n.getDesignation()}' has FIRST layer constraint with a non-LABEL incoming edge.`)}function WN(n){for(let t of n.getOutgoingEdges())if(t.getTarget().getNode().getType()!==y.LABEL)throw new Error(`Node '${n.getDesignation()}' has LAST layer constraint with a non-LABEL outgoing edge.`)}var oP="NONE",vn="FIRST_SEPARATE",uh="LAST_SEPARATE",E_="BOTH",$K=Symbol("separateLayerConnections"),_h=class{process(t,e){e.begin("Layer constraint preprocessing",1);let o=[],r=t.getLayerlessNodes(),i=0;for(;i<r.length;){let s=r[i];zN(s)?(YN(s),o.push(s),r.splice(i,1)):i++}o.length>0&&t.setProperty(p.HIDDEN_NODES,o),e.done()}};function zN(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT);return t===J.FIRST_SEPARATE||t===J.LAST_SEPARATE}function YN(n){$N(n);let t=[];for(let e of n.getConnectedEdges())t.push(e);for(let e of t)VN(n,e)}function VN(n,t){let e=t.getSource().getNode()===n,o=e?t.getTarget():t.getSource();e?t.setTarget(null):t.setSource(null),t.setProperty(p.ORIGINAL_OPPOSITE_PORT,o),XN(n,o.getNode())}function XN(n,t){if(t.hasProperty(_.LAYERING_LAYER_CONSTRAINT))return;let e=KN(t),o=jN(e,n.getProperty(_.LAYERING_LAYER_CONSTRAINT));ZN(t,o),t.getConnectedEdges()[Symbol.iterator]().next().done&&(o===vn?t.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST):o===uh&&t.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST))}function KN(n){return n._hiddenConnections||oP}function ZN(n,t){n._hiddenConnections=t}function jN(n,t){let e=t===J.FIRST_SEPARATE?vn:uh;return n===oP?e:n===vn?e===vn?vn:E_:n===uh?e===vn?E_:uh:E_}function $N(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(t===J.FIRST_SEPARATE){for(let e of n.getIncomingEdges())if(!eP(e))throw new Error(`Node '${n.getDesignation()}' has FIRST_SEPARATE with an incoming edge.`)}else if(t===J.LAST_SEPARATE){for(let e of n.getOutgoingEdges())if(!eP(e))throw new Error(`Node '${n.getDesignation()}' has LAST_SEPARATE with an outgoing edge.`)}}function eP(n){let t=n.getSource().getNode(),e=n.getTarget().getNode();return t.getType()===y.EXTERNAL_PORT&&e.getType()===y.EXTERNAL_PORT}var ph=class{process(t,e){e.begin("Layer size calculation",1);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=!1;for(let s of t){let a=s.getSize();if(a.x=0,a.y=0,s.getNodes().length===0)continue;i=!0;for(let d of s){let f=d.getSize(),E=d.getMargin(),P=f.x+E.left+E.right;P>a.x&&(a.x=P)}let l=s.getNodes()[0],c=l.getPosition().y-l.getMargin().top;if(l.getType()===y.EXTERNAL_PORT){let d=t.getProperty(_.SPACING_PORTS_SURROUNDING);d!=null&&(c-=d.top)}let g=s.getNodes()[s.getNodes().length-1],h=g.getPosition().y+g.getSize().y+g.getMargin().bottom;if(g.getType()===y.EXTERNAL_PORT){let d=t.getProperty(_.SPACING_PORTS_SURROUNDING);d!=null&&(h+=d.bottom)}a.y=h-c,c<o&&(o=c),h>r&&(r=h)}i||(o=0,r=0),t.getSize().y=r-o,t.getOffset().y=t.getOffset().y-o,e.done()}};var il=class{constructor(){this._keyToValues=new Map,this._valueToKey=new Map}putAll(t,e){for(let o of e)this.put(t,o)}put(t,e){let o=this._valueToKey.get(e);if(o!==void 0){let i=this._keyToValues.get(o);if(i){let s=i.indexOf(e);s>=0&&i.splice(s,1)}}let r=this._keyToValues.get(t);r==null&&(r=[],this._keyToValues.set(t,r)),r.push(e),this._valueToKey.set(e,t)}getKey(t){return this._valueToKey.get(t)}getValues(t){let e=this._keyToValues.get(t);return e==null?[]:e}keySet(){return this._keyToValues.keys()}isMaximalKey(t){for(let e of this._keyToValues.keys())if(typeof t.compareTo=="function"?t.compareTo(e)<0:t<e)return!1;return!0}isMinimalKey(t){for(let e of this._keyToValues.keys())if(typeof t.compareTo=="function"?t.compareTo(e)>0:t>e)return!1;return!0}};var ut=class{constructor(t){this._name=t}toString(){return this._name}};ut.NONE=new ut("NONE");ut.NIKOLOV=new ut("NIKOLOV");ut.NIKOLOV_PIXEL=new ut("NIKOLOV_PIXEL");ut.NIKOLOV_IMPROVED=new ut("NIKOLOV_IMPROVED");ut.NIKOLOV_IMPROVED_PIXEL=new ut("NIKOLOV_IMPROVED_PIXEL");ut.DUMMYNODE_PERCENTAGE=new ut("DUMMYNODE_PERCENTAGE");ut.NODECOUNT_PERCENTAGE=new ut("NODECOUNT_PERCENTAGE");ut.NO_BOUNDARY=new ut("NO_BOUNDARY");ut.MODEL_ORDER_LEFT_TO_RIGHT=new ut("MODEL_ORDER_LEFT_TO_RIGHT");ut.MODEL_ORDER_RIGHT_TO_LEFT=new ut("MODEL_ORDER_RIGHT_TO_LEFT");var Eh=class{constructor(){this._masterGraph=null,this._nodesWithIncomingEdges=[],this._nodes=[],this._currentWidth=[],this._currentWidthPixel=[],this._layers=[],this._degreeDiff=[],this._maxWidth=0,this._maxWidthPixel=0,this._dummyNodeCount=0,this._maxHeight=0,this._nodeSizeAffix=0,this._dummySize=0,this._promotionStrategy=null,this._biLayerMap=new il}process(t,e){e.begin("Node promotion heuristic",1),this._masterGraph=t,this._promotionStrategy=t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY),this._promotionStrategy!==ut.MODEL_ORDER_LEFT_TO_RIGHT&&this._promotionStrategy!==ut.MODEL_ORDER_RIGHT_TO_LEFT?this._precalculateAndSetInformation():this._precalculateAndSetInformationModelOrder();let o=t.getProperty(_.LAYERING_NODE_PROMOTION_MAX_ITERATIONS),r=()=>!0;switch(this._promotionStrategy){case ut.NIKOLOV:this._promotionMagic(r);break;case ut.NIKOLOV_PIXEL:this._promotionMagic(r);break;case ut.NIKOLOV_IMPROVED:{this._promotionStrategy=ut.NO_BOUNDARY,this._promotionMagic(r);let i=0;for(let s of this._currentWidth)i=Math.max(i,s);i>this._maxWidth&&(this._promotionStrategy=ut.NIKOLOV,this._promotionMagic(r));break}case ut.NIKOLOV_IMPROVED_PIXEL:{this._promotionStrategy=ut.NO_BOUNDARY,this._promotionMagic(r);let i=0;for(let s of this._currentWidthPixel)i=Math.max(i,s);i>this._maxWidthPixel&&(this._promotionStrategy=ut.NIKOLOV_PIXEL,this._promotionMagic(r));break}case ut.NODECOUNT_PERCENTAGE:{let i=Math.ceil(this._layers.length*o/100);this._promotionMagic(s=>s.getSecond()<i);break}case ut.DUMMYNODE_PERCENTAGE:{let i=Math.ceil(this._dummyNodeCount*o/100);this._promotionMagic(s=>s.getFirst()<i);break}case ut.MODEL_ORDER_LEFT_TO_RIGHT:this._modelOrderNodePromotion(!0);break;case ut.MODEL_ORDER_RIGHT_TO_LEFT:this._modelOrderNodePromotion(!1);break;default:this._promotionMagic(r);break}this._promotionStrategy!==ut.MODEL_ORDER_LEFT_TO_RIGHT&&this._promotionStrategy!==ut.MODEL_ORDER_RIGHT_TO_LEFT?this._setNewLayering(t):this._setNewLayeringModelOrder(t),e.done()}_precalculateAndSetInformation(){this._nodeSizeAffix=this._masterGraph.getProperty(_.SPACING_NODE_NODE),this._dummySize=this._masterGraph.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._maxHeight=this._masterGraph.getLayers().length;let t=this._maxHeight-1,e=0;this._maxWidth=0,this._maxWidthPixel=0,this._currentWidth=new Array(this._maxHeight).fill(0),this._currentWidthPixel=new Array(this._maxHeight).fill(0);for(let r of this._masterGraph.getLayers()){r.id=t;for(let i of r.getNodes())i.id=e,e++;t--}this._layers=new Array(e).fill(0),this._degreeDiff=new Array(e);for(let r=0;r<e;r++)this._degreeDiff[r]=[0,0,0];this._nodes=[],this._nodesWithIncomingEdges=[];let o=0;this._dummyNodeCount=0;for(let r of this._masterGraph){t=r.id;let i=0,s=0,a=r.getNodes().length,l=0;for(let g of r.getNodes()){e=g.id,this._layers[e]=g.getLayer().id,l+=g.getSize().y+this._nodeSizeAffix;let h=0;for(let f of g.getIncomingEdges())h++;let d=0;for(let f of g.getOutgoingEdges())d++;this._degreeDiff[e][0]=d-h,this._degreeDiff[e][1]=h,this._degreeDiff[e][2]=d,i+=h,s+=d,h>0&&this._nodesWithIncomingEdges.push(g),this._nodes.push(g)}o-=i;let c=a+o;l+=o*this._dummySize,this._currentWidth[t]=c,this._currentWidthPixel[t]=l,this._maxWidth=Math.max(this._maxWidth,c),this._maxWidthPixel=Math.max(this._maxWidthPixel,l),this._dummyNodeCount+=o,o+=s}}_precalculateAndSetInformationModelOrder(){this._biLayerMap=new il;let t=0,e=0;for(let i of this._masterGraph.getLayers()){i.id=e;for(let s of i.getNodes())s.id=t,t++;e++}let r=this._promotionStrategy===ut.MODEL_ORDER_LEFT_TO_RIGHT?qN:JN;for(let i of this._masterGraph)i.getNodes().sort(r),this._biLayerMap.putAll(i.id,i.getNodes())}_modelOrderNodePromotion(t){let e=0;for(let s of this._masterGraph.getLayers())e+=s.getNodes().length;let o=2*(this._masterGraph.getLayers().length+e)+10,r=0,i;do{i=!1;let a=[...this._biLayerMap.keySet()].length,l=t?a-2:1,c=t?h=>h>=0:h=>h<a,g=t?-1:1;for(let h=l;c(h);h+=g){let d=this._biLayerMap.getValues(h);for(let f=0;f<d.length;f++){let E=d[f];if(!E.hasProperty(p.MODEL_ORDER)||this._biLayerMap.isMaximalKey(h)&&this._promotionStrategy===ut.MODEL_ORDER_LEFT_TO_RIGHT||this._biLayerMap.isMinimalKey(h)&&this._promotionStrategy===ut.MODEL_ORDER_RIGHT_TO_LEFT)continue;let P=!0;for(let x of d){if(!x.hasProperty(p.MODEL_ORDER))continue;let M=E.getProperty(p.MODEL_ORDER),A=x.getProperty(p.MODEL_ORDER);if(t&&M<A||!t&&M>A){P=!1;break}}if(!P)continue;let S=t?h+1:h-1,T=this._biLayerMap.getValues(S),N=!1,I=!0,C=!1;for(let x of T)if(x.hasProperty(p.MODEL_ORDER)){if(x.id!==E.id){let M=x.getProperty(p.MODEL_ORDER),A=E.getProperty(p.MODEL_ORDER);N||(N=t?M<A:M>A),I=!1}}else if(!N&&I&&x.getType()===y.LABEL){C=!0;let M;if(t?M=Bn(x.getIncomingEdges()).getSource().getNode():M=Bn(x.getOutgoingEdges()).getTarget().getNode(),M===E){let A;t?A=Bn(x.getOutgoingEdges()).getTarget().getNode():A=Bn(x.getIncomingEdges()).getSource().getNode(),(t?this._biLayerMap.getKey(A)-this._biLayerMap.getKey(M):this._biLayerMap.getKey(M)-this._biLayerMap.getKey(A))<=2&&(I=!1)}}if(C&&I){let x;t?x=Bn(E.getOutgoingEdges()).getTarget().getNode():x=Bn(E.getIncomingEdges()).getSource().getNode(),(t?this._biLayerMap.getKey(x)-this._biLayerMap.getKey(E):this._biLayerMap.getKey(E)-this._biLayerMap.getKey(x))<=2&&x.getType()===y.NORMAL&&(I=!1)}if(N||I){let x=this._promoteNodeByModelOrder(E,t);for(;x.size>0;){let M=x.values().next().value;x.delete(M);for(let A of this._promoteNodeByModelOrder(M,t))x.add(A)}f--,i=!0}}}}while(i&&++r<o)}_promoteNodeByModelOrder(t,e){let o=this._biLayerMap.getKey(t);e?this._biLayerMap.put(o+1,t):this._biLayerMap.put(o-1,t);let r=new Set,i=e?t.getOutgoingEdges():t.getIncomingEdges();for(let s of i){let a=e?s.getTarget().getNode():s.getSource().getNode();this._biLayerMap.getKey(a)===this._biLayerMap.getKey(t)&&r.add(a)}return r}_promotionMagic(t){let e,o,r=0,i=0,s=this._layers.slice(),a=this._dummyNodeCount,l=this._maxHeight,c=this._currentWidth.slice(),g=this._currentWidthPixel.slice();do{e=0;for(let h of this._nodesWithIncomingEdges){let d=this._promoteNode(h),f=!0;(this._promotionStrategy===ut.NIKOLOV||this._promotionStrategy===ut.NIKOLOV_PIXEL)&&(f=d.getSecond()),d.getFirst()<0&&f?(e++,s=this._layers.slice(),this._dummyNodeCount=this._dummyNodeCount+d.getFirst(),i+=a-this._dummyNodeCount,a=this._dummyNodeCount+d.getFirst(),l=this._maxHeight,c=this._currentWidth.slice(),g=this._currentWidthPixel.slice()):(this._layers=s.slice(),this._dummyNodeCount=a,this._currentWidth=c.slice(),this._currentWidthPixel=g.slice(),this._maxHeight=l)}r++,o=e!==0&&t(Gt.of(i,r))}while(o)}_promoteNode(t){let e=!0,o=0,r=this._layers[t.id],i=t.getSize().y+this._nodeSizeAffix,s=this._degreeDiff[t.id][2];if(this._currentWidth[r]=this._currentWidth[r]-1+s,this._currentWidthPixel[r]=this._currentWidthPixel[r]-i+s*this._dummySize,r++,r>=this._maxHeight)this._maxHeight++,this._currentWidth.push(1),this._currentWidthPixel.push(i);else{let a=this._degreeDiff[t.id][1];this._currentWidth[r]=this._currentWidth[r]+1-a,this._currentWidthPixel[r]=this._currentWidthPixel[r]+i-a*this._dummySize}(this._promotionStrategy===ut.NIKOLOV&&(this._currentWidth[r]>this._maxWidth||this._currentWidth[r-1]>this._maxWidth)||this._promotionStrategy===ut.NIKOLOV_PIXEL&&(this._currentWidthPixel[r]>this._maxWidthPixel||this._currentWidthPixel[r-1]>this._maxWidthPixel))&&(e=!1);for(let a of t.getIncomingEdges()){let l=a.getSource().getNode();if(this._layers[l.id]===r){let c=this._promoteNode(l);o=o+c.getFirst(),e=e&&c.getSecond()}}return this._layers[t.id]=r,o=o+this._degreeDiff[t.id][0],Gt.of(o,e)}_setNewLayering(t){let e=[];for(let o=0;o<=this._maxHeight;o++){let r=new Et(t);r.id=this._maxHeight-o,e.push(r)}for(let o of this._nodes)o.setLayer(e[this._maxHeight-this._layers[o.id]]);for(let o=e.length-1;o>=0;o--)e[o].getNodes().length===0&&e.splice(o,1);t.getLayers().length=0;for(let o of e)t.getLayers().push(o)}_setNewLayeringModelOrder(t){let e=[];t.getLayers().length=0;let o=[...this._biLayerMap.keySet()].sort((r,i)=>r-i);for(let r of o){let i=this._biLayerMap.getValues(r);if(i.length===0)continue;let s=new Et(t);e.push(s),s.id=r;for(let a of i)a.setLayer(s)}for(let r of e)t.getLayers().push(r)}};function qN(n,t){return n.hasProperty(p.MODEL_ORDER)&&t.hasProperty(p.MODEL_ORDER)?t.getProperty(p.MODEL_ORDER)-n.getProperty(p.MODEL_ORDER):0}function JN(n,t){return n.hasProperty(p.MODEL_ORDER)&&t.hasProperty(p.MODEL_ORDER)?n.getProperty(p.MODEL_ORDER)-t.getProperty(p.MODEL_ORDER):0}function Bn(n){for(let t of n)return t;return null}var mh=class{process(t,e){e.begin("Odd port side processing",1);let o=t.getProperty(_.EDGE_ROUTING);for(let r of t){let i=z.toNodeArray(r.getNodes());for(let s of i)if(s.getType()===y.NORTH_SOUTH_PORT){if(o===At.SPLINES)for(let a of s.getPorts())a.getIncomingEdges().length>0&&oy(a),a.getOutgoingEdges().length>0&&ry(a);else if(s.getProperty(p.ORIGIN)instanceof _e)ey(s);else{let a=s.getPorts(),l=!1;if(a.length>=2){l=!0;for(let c=1;c<a.length;c++)if(a[c-1].getProperty(p.ORIGIN)!==a[c].getProperty(p.ORIGIN)){l=!1;break}}for(let c of a)c.getIncomingEdges().length>0&&QN(c,l),c.getOutgoingEdges().length>0&&ty(c,l)}s.setLayer(null)}}e.done()}};function QN(n,t){let e=n.getProperty(p.ORIGIN),o=e.getAbsoluteAnchor().x,r=n.getNode().getPosition().y,i=z.toEdgeArray(n.getIncomingEdges());for(let s of i)if(s.setTarget(e),s.getBendPoints().addLast(o,r),t){let a=s.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,s.setProperty(_.JUNCTION_POINTS,a)),a.add(new O(o,r))}}function ty(n,t){let e=n.getProperty(p.ORIGIN),o=e.getAbsoluteAnchor().x,r=n.getNode().getPosition().y,i=z.toEdgeArray(n.getOutgoingEdges());for(let s of i)if(s.setSource(e),s.getBendPoints().addFirst(o,r),t){let a=s.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,s.setProperty(_.JUNCTION_POINTS,a)),a.add(new O(o,r))}}function ey(n){let t=n.getProperty(p.ORIGIN),e=[...n.getPorts(u.WEST)][0],o=[...n.getPorts(u.EAST)][0],r=e.getProperty(p.ORIGIN),i=o.getProperty(p.ORIGIN);t.setSource(i),t.setTarget(r);let s=new O(o.getNode().getPosition());s.x=i.getAbsoluteAnchor().x,t.getBendPoints().add(s);let a=new O(e.getNode().getPosition());a.x=r.getAbsoluteAnchor().x,t.getBendPoints().add(a)}function oy(n){let t=n.getProperty(p.ORIGIN);t.setProperty(p.SPLINE_NS_PORT_Y_COORD,n.getNode().getPosition().y);let e=z.toEdgeArray(n.getIncomingEdges());for(let o of e)o.setTarget(t)}function ry(n){let t=n.getProperty(p.ORIGIN);t.setProperty(p.SPLINE_NS_PORT_Y_COORD,n.getNode().getPosition().y);let e=z.toEdgeArray(n.getOutgoingEdges());for(let o of e)o.setSource(t)}var ce=class{constructor(t){this._name=t,Object.freeze(this)}toString(){return this._name}};ce.NONE=new ce("NONE");ce.NODES_AND_EDGES=new ce("NODES_AND_EDGES");ce.PREFER_EDGES=new ce("PREFER_EDGES");ce.PREFER_NODES=new ce("PREFER_NODES");var Ph=class{process(t,e){e.begin("Odd port side processing",1);let o=[],r=[];for(let i of t){let s=-1,a=z.toNodeArray(i.getNodes());for(let l of a){s++;let c=l.getProperty(_.PORT_CONSTRAINTS);if(l.getType()!==y.NORMAL||!c.isSideFixed())continue;!c.isOrderFixed()&&l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)===ce.NONE&&iy(l),l.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),o.length=0,r.length=0;let g=[],h=[...l.getPorts(u.NORTH)];l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==ce.NONE&&(h=iP(h)),sP(t,h,o,r,g);let d=s,f=l;for(let S of o)S.setLayer(d,i),s++,S.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),S.getPorts()[0].getProperty(p.ORIGIN).getProperty(_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES)||S.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(f);let E=[];for(let S of l.getPorts(u.SOUTH))E.unshift(S);l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==ce.NONE&&(E=iP(E)),sP(t,E,r,null,g);let P=l;for(let S of r)S.setLayer(++s,i),S.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),S.getPorts()[0].getProperty(p.ORIGIN).getProperty(_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES)||P.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(S);g.length>0&&l.setProperty(p.BARYCENTER_ASSOCIATES,g)}}e.done()}};function iy(n){let t=n.getPorts().length,e=0,o=t,r=2*t;for(let i of n.getPorts()){let s=i.getSide();if(s===u.EAST||s===u.WEST){i.id=-1;continue}if(s!==u.NORTH&&s!==u.SOUTH)continue;let a=i.getIncomingEdges().length,l=i.getOutgoingEdges().length;a>0&&l>0?i.id=o++:a>0?i.id=e++:l>0?i.id=r++:i.id=e++}n.getPorts().sort((i,s)=>{let a=i.getSide(),l=s.getSide();return a!==l?rP(a)-rP(l):i.id===s.id?0:a===u.NORTH?i.id-s.id:s.id-i.id})}function rP(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function iP(n){let t=[],e=[];for(let o of n)o.getIncomingEdges().length>0?t.push(o):e.push(o);return t.reverse(),t.concat(e)}function sP(n,t,e,o,r){let i=[],s=[],a=[],l=[],c=[];for(let g of t)for(let h of g.getOutgoingEdges())h.getSource().getNode()===h.getTarget().getNode()&&(g.getSide()===h.getTarget().getSide()?l.push(h):g.getSide()===u.NORTH&&h.getTarget().getSide()===u.SOUTH&&c.push(h));for(let g of c)ny(n,g,e,o,u.EAST);for(let g of l)sy(n,g,e);for(let g of t){let h=g.getIncomingEdges().length>0,d=g.getOutgoingEdges().length>0;h&&d?a.push(g):h?i.push(g):d&&s.push(g)}for(let g of i)r.push(m_(n,g,null,e));for(let g of s)r.push(m_(n,null,g,e));for(let g of a)r.push(m_(n,g,g,e))}function m_(n,t,e,o){let r=new ft(n);r.setType(y.NORTH_SOUTH_PORT),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS);let i=0;if(t!=null){let s=new rt;s.setProperty(p.ORIGIN,t),r.setProperty(p.ORIGIN,t.getNode()),s.setSide(u.WEST),s.setNode(r);let a=z.toEdgeArray(t.getIncomingEdges());for(let l of a)l.setTarget(s);t.setProperty(p.PORT_DUMMY,r),i++}if(e!=null){let s=new rt;r.setProperty(p.ORIGIN,e.getNode()),s.setProperty(p.ORIGIN,e),s.setSide(u.EAST),s.setNode(r);let a=z.toEdgeArray(e.getOutgoingEdges());for(let l of a)l.setSource(s);e.setProperty(p.PORT_DUMMY,r),i++}return r.setProperty(p.CROSSING_HINT,i),o.push(r),r}function sy(n,t,e){let o=new ft(n);o.setType(y.NORTH_SOUTH_PORT),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setProperty(p.ORIGIN,t);let r=new rt;r.setProperty(p.ORIGIN,t.getTarget()),r.setSide(u.WEST),r.setNode(o);let i=new rt;i.setProperty(p.ORIGIN,t.getSource()),i.setSide(u.EAST),i.setNode(o),t.getSource().setProperty(p.PORT_DUMMY,o),t.getTarget().setProperty(p.PORT_DUMMY,o),t.setSource(null),t.setTarget(null),e.push(o),o.setProperty(p.CROSSING_HINT,2)}function ny(n,t,e,o,r){let i=new ft(n);i.setType(y.NORTH_SOUTH_PORT),i.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),i.setProperty(p.ORIGIN,t.getSource().getNode());let s=new rt;s.setProperty(p.ORIGIN,t.getSource()),s.setSide(r),s.setNode(i),t.getSource().setProperty(p.PORT_DUMMY,i);let a=new ft(n);a.setType(y.NORTH_SOUTH_PORT),a.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),a.setProperty(p.ORIGIN,t.getTarget().getNode());let l=new rt;l.setProperty(p.ORIGIN,t.getTarget()),l.setSide(r),l.setNode(a),t.getTarget().setProperty(p.PORT_DUMMY,a),t.setSource(s),t.setTarget(l),e.unshift(i),o.push(a),i.setProperty(p.CROSSING_HINT,1),a.setProperty(p.CROSSING_HINT,1)}var Oh=class{process(t,e){e.begin("Partition midprocessing",1);let o=new Map;for(let i of t.getLayerlessNodes()){if(!i.hasProperty(_.PARTITIONING_PARTITION))continue;let s=i.getProperty(_.PARTITIONING_PARTITION),a=o.get(s);a==null&&(a=[],o.set(s,a)),a.push(i)}if(o.size===0){e.done();return}let r=Array.from(o.keys()).sort((i,s)=>i-s);for(let i=0;i<r.length-1;i++){let s=o.get(r[i]),a=o.get(r[i+1]);ay(s,a)}e.done()}};function ay(n,t){for(let e of n){let o=new rt;o.setNode(e),o.setSide(u.EAST),o.setProperty(p.PARTITION_DUMMY,!0);for(let r of t){let i=new rt;i.setNode(r),i.setSide(u.WEST),i.setProperty(p.PARTITION_DUMMY,!0);let s=new _e;s.setProperty(p.PARTITION_DUMMY,!0),s.setSource(o),s.setTarget(i)}}}var Sh=class{process(t,e){e.begin("Partition postprocessing",1);for(let o of t)for(let r of o){let i=r.getPorts(),s=0;for(;s<i.length;)i[s].getProperty(p.PARTITION_DUMMY)?i.splice(s,1):s++}e.done()}};var ly=1e3,Th=class{process(t,e){e.begin("Partition preprocessing",1);let o=[];for(let i of t.getLayerlessNodes())i.hasProperty(_.PARTITIONING_PARTITION)&&o.push(i);let r=[];for(let i of o)for(let s of i.getOutgoingEdges())cy(s,o)&&r.push(s);for(let i of r)gy(i,t);e.done()}};function cy(n,t){let e=n.getSource().getNode(),o=n.getTarget().getNode();if(o.hasProperty(_.PARTITIONING_PARTITION)){let l=e.getProperty(_.PARTITIONING_PARTITION),c=o.getProperty(_.PARTITIONING_PARTITION);return l>c}let r=e.getProperty(_.PARTITIONING_PARTITION),i=new Set;for(let l of t)l.getProperty(_.PARTITIONING_PARTITION)<r&&i.add(l);let s=[e],a=new Set([e]);for(;s.length>0;){let l=s.shift();if(i.has(l))return!0;for(let c of l.getOutgoingEdges()){let g=c.getTarget().getNode();a.has(g)||(a.add(g),s.push(g))}}return!1}function gy(n,t){n.reverse(t,!0);let e=ly;n.hasProperty(_.PRIORITY_DIRECTION)&&(e+=n.getProperty(_.PRIORITY_DIRECTION)),n.setProperty(_.PRIORITY_DIRECTION,e)}var Ih=class{process(t,e){e.begin("Port order processing",1);let o=t.getProperty(_.PORT_SORTING_STRATEGY);for(let r of t)for(let i of r){let s=i.getProperty(_.PORT_CONSTRAINTS),a=i.getPorts();s.isOrderFixed()?a.sort(P_):s.isSideFixed()&&(a.sort(gP),hy(a),o==="PORT_DEGREE"&&a.sort(dy)),i.cachePortSides()}e.done()}};function hy(n){if(n.length<=1)return;let t=nP(n,u.SOUTH);aP(n,t[0],t[1]);let e=nP(n,u.WEST);aP(n,e[0],e[1])}function nP(n,t){if(n.length===0)return[0,0];let e=n[0].getSide(),o=0,r=t.ordinal(),i=t.ordinal()+1;for(;o<n.length-1&&e.ordinal()<r;)o++,e=n[o].getSide();let s=o;for(;s<n.length-1&&e.ordinal()<i;)s++,e=n[o].getSide();return[o,s]}function aP(n,t,e){if(e<=t+2)return;let o=Math.floor((e-t)/2);for(let r=0;r<o;r++){let i=n[t+r];n[t+r]=n[e-r-1],n[e-r-1]=i}}var gP=(n,t)=>{let e=n.getSide().ordinal()-t.getSide().ordinal();return e!==0?e:0},dy=(n,t)=>{if(n.getSide().ordinal()!==t.getSide().ordinal())return 0;switch(n.getSide()){case u.EAST:return Nh(t,lP)-Nh(n,lP);case u.WEST:return Nh(n,cP)-Nh(t,cP);default:return 0}};function lP(n){return n.getOutgoingEdges()}function cP(n){return n.getIncomingEdges()}function Nh(n,t){let e=0;for(let o of t(n))o.getProperty(p.REVERSED)||e++;return e}var fy=(n,t)=>{let e=n.getNode().getProperty(_.PORT_CONSTRAINTS);if(n.getSide().ordinal()-t.getSide().ordinal()!==0||!e.isOrderFixed())return 0;if(e===H.FIXED_ORDER){let r=n.getProperty(_.PORT_INDEX),i=t.getProperty(_.PORT_INDEX);if(r!=null&&i!=null){let s=r-i;if(s!==0)return s}}switch(n.getSide()){case u.NORTH:return yh(n.getPosition().x,t.getPosition().x);case u.EAST:return yh(n.getPosition().y,t.getPosition().y);case u.SOUTH:return yh(t.getPosition().x,n.getPosition().x);case u.WEST:return yh(t.getPosition().y,n.getPosition().y);default:throw new Error("Port side is undefined")}};function yh(n,t){return n<t?-1:n>t?1:0}var P_=(n,t)=>{let e=gP(n,t);return e!==0?e:fy(n,t)};var Un=class{process(t,e){e.begin("Port side processing",1);for(let o of t.getLayerlessNodes())hP(o);for(let o of t)for(let r of o)hP(r);e.done()}static setPortSide(t){let e=t.getProperty(p.PORT_DUMMY);e!=null?t.setSide(e.getProperty(p.EXT_PORT_SIDE)):t.getNetFlow()<0?t.setSide(u.EAST):t.setSide(u.WEST)}};function hP(n){if(n.getProperty(_.PORT_CONSTRAINTS).isSideFixed())for(let t of n.getPorts())t.getSide()===u.UNDEFINED&&Un.setPortSide(t);else{for(let t of n.getPorts())Un.setPortSide(t);n.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE)}}var Rh=class{process(t,e){e.begin("Restoring reversed edges",1);for(let o of t)for(let r of o)for(let i of r.getPorts()){let s=i.getOutgoingEdges().slice();for(let a of s)a.getProperty(p.REVERSED)&&a.reverse(t,!1)}e.done()}};var Je=class{constructor(t){this._name=t}toString(){return this._name}};Je.STACKED=new Je("STACKED");Je.REVERSE_STACKED=new Je("REVERSE_STACKED");Je.SEQUENCED=new Je("SEQUENCED");var kt=class n{constructor(t){this._name=t}toString(){return this._name}static fromPortSides(t){if(t.has(u.UNDEFINED))throw new Error("Port sides must not contain UNDEFINED");switch(t.size){case 1:return n.ONE_SIDE;case 2:{let e=t.has(u.EAST)&&t.has(u.WEST),o=t.has(u.NORTH)&&t.has(u.SOUTH);return e||o?n.TWO_SIDES_OPPOSING:n.TWO_SIDES_CORNER}case 3:return n.THREE_SIDES;case 4:return n.FOUR_SIDES;default:return null}}};kt.ONE_SIDE=new kt("ONE_SIDE");kt.TWO_SIDES_CORNER=new kt("TWO_SIDES_CORNER");kt.TWO_SIDES_OPPOSING=new kt("TWO_SIDES_OPPOSING");kt.THREE_SIDES=new kt("THREE_SIDES");kt.FOUR_SIDES=new kt("FOUR_SIDES");var Lh=class{constructor(){this._slLoopsByType=null,this._targetAreas=null}restorePorts(t,e){this._initTargetAreas(),this._slLoopsByType=uy(t),this._processOneSideLoops(t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_ORDERING)),this._processTwoSideCornerLoops(),this._processThreeSideLoops(),this._processFourSideLoops(),this._processTwoSideOpposingLoops(),this._restorePorts(t);for(let o=0;o<4;o++)for(let r=0;r<3;r++)for(let i of this._targetAreas[o][r])i.setHidden(!1);t.setPortsHidden(!1),this._slLoopsByType=null,this._targetAreas=null}_initTargetAreas(){this._targetAreas=[];for(let t=0;t<4;t++)this._targetAreas.push([[],[],[]])}_processOneSideLoops(t){var o;let e=(o=this._slLoopsByType.get(kt.ONE_SIDE))!=null?o:[];t===Je.REVERSE_STACKED&&e.reverse();for(let r of e){let i=r.getSLPorts()[0].getLPort().getSide(),s=r.getSLPorts().slice();if(s.sort((a,l)=>a.getSLNetFlow()-l.getSLNetFlow()),t===Je.SEQUENCED)this._addToTargetAreaPorts(s,i,Pe.MIDDLE,qo.APPEND);else{let a=_y(s);this._addToTargetAreaPorts(s.slice(0,a),i,Pe.MIDDLE,qo.PREPEND),this._addToTargetAreaPorts(s.slice(a),i,Pe.MIDDLE,qo.APPEND)}}}_processTwoSideCornerLoops(){var e;let t=(e=this._slLoopsByType.get(kt.TWO_SIDES_CORNER))!=null?e:[];for(let o of t){let r=Ah(o);this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.START,qo.APPEND)}}_processTwoSideOpposingLoops(){var e;let t=(e=this._slLoopsByType.get(kt.TWO_SIDES_OPPOSING))!=null?e:[];for(let o of t){let r=Ah(o);this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.START,qo.APPEND)}}_processThreeSideLoops(){var e;let t=(e=this._slLoopsByType.get(kt.THREE_SIDES))!=null?e:[];for(let o of t){let r=Oy(o);r!=null&&(this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.MIDDLE,qo.APPEND),this._addToTargetAreaLoop(o,r[2],Pe.START,qo.APPEND))}}_processFourSideLoops(){var e;let t=(e=this._slLoopsByType.get(kt.FOUR_SIDES))!=null?e:[];for(let o of t){let r=o.getSLPortsBySide();if(r!=null)for(let i of r.keys())this._addToTargetAreaLoop(o,i,Pe.MIDDLE,qo.APPEND)}}_addToTargetAreaLoop(t,e,o,r){let i=t.getSLPortsOnSide(e);this._addToTargetAreaPorts(i,e,o,r)}_addToTargetAreaPorts(t,e,o,r){let i=[];for(let a of t)a.isHidden()&&i.push(a);i.reverse();let s=this._targetAreas[Cs(e)][o];r===qo.PREPEND?s.unshift(...i):s.push(...i)}_restorePorts(t){let e=t.getLNode(),o=e.getPorts().slice(),r=0,i=e.getPorts();i.length=0;let s=Cs(u.NORTH),a=Cs(u.EAST),l=Cs(u.SOUTH),c=Cs(u.WEST),g=this._targetAreas;Jo(g[s][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.NORTH&&Sy(h),i),Jo(g[s][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.NORTH,i),Jo(g[s][Pe.END],e),Jo(g[a][Pe.START],e),Jo(g[a][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.EAST,i),Jo(g[a][Pe.END],e),Jo(g[l][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.SOUTH&&Ty(h),i),Jo(g[l][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.SOUTH,i),Jo(g[l][Pe.END],e),Jo(g[c][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.WEST,i),Jo(g[c][Pe.MIDDLE],e),Jo(g[c][Pe.END],e)}},Pe={START:0,MIDDLE:1,END:2},qo={PREPEND:"PREPEND",APPEND:"APPEND"};function Cs(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function uy(n){let t=new Map;for(let e of n.getSLHyperLoops()){let o=e.getSelfLoopType(),r=t.get(o);r==null&&(r=[],t.set(o,r)),r.push(e)}return t}function _y(n){let t=0;for(;t<n.length&&n[t].getSLNetFlow()<=0;)t++;if(t>0&&t<n.length-1)return t;let e=0;for(;e<n.length&&n[e].getSLNetFlow()<=0;)e++;return e>0&&t<n.length-1?e:Math.floor(n.length/2)}function Ah(n){let e=[...n.getSLPortsBySide().keys()];return e.sort((o,r)=>Cs(o)-Cs(r)),e[0]===u.NORTH&&e[1]===u.WEST&&(e[0]=u.WEST,e[1]=u.NORTH),e}var py=[u.NORTH,u.EAST,u.SOUTH],Ey=[u.EAST,u.SOUTH,u.WEST],my=[u.SOUTH,u.WEST,u.NORTH],Py=[u.WEST,u.NORTH,u.EAST];function Oy(n){let t=n.getSLPortsBySide();return t==null?null:t.has(u.NORTH)?t.has(u.EAST)?t.has(u.SOUTH)?t.has(u.WEST)?null:py:Py:my:Ey}function Jo(n,t){for(let e of n)e.getLPort().setNode(t)}function Fn(n,t,e,o){for(let r=t;r<n.length;r++){let i=n[r];if(e(i))o.push(i);else return r}return n.length}function Sy(n){return dP(n).has(u.WEST)}function Ty(n){return dP(n).has(u.EAST)}function dP(n){let t=new Set,e=n.getProperty(p.PORT_DUMMY);if(e!=null){for(let o of e.getPorts())if(o.getProperty(p.ORIGIN)===n){let r=o.getConnectedEdges();for(let i of r){t.add(o.getSide());break}}}return t}var Qo=class{constructor(t){this._name=t}toString(){return this._name}};Qo.EQUALLY=new Qo("EQUALLY");Qo.NORTH=new Qo("NORTH");Qo.NORTH_SOUTH=new Qo("NORTH_SOUTH");var Qt=class{constructor(t,e,o){this._name=t,this.firstSide=e,this.secondSide=o}toString(){return this._name}isCornerTarget(){return this.firstSide!==this.secondSide}};Qt.NORTH=new Qt("NORTH",u.NORTH,u.NORTH);Qt.SOUTH=new Qt("SOUTH",u.SOUTH,u.SOUTH);Qt.EAST=new Qt("EAST",u.EAST,u.EAST);Qt.WEST=new Qt("WEST",u.WEST,u.WEST);Qt.NORTH_WEST_CORNER=new Qt("NORTH_WEST_CORNER",u.WEST,u.NORTH);Qt.NORTH_EAST_CORNER=new Qt("NORTH_EAST_CORNER",u.NORTH,u.EAST);Qt.SOUTH_WEST_CORNER=new Qt("SOUTH_WEST_CORNER",u.SOUTH,u.WEST);Qt.SOUTH_EAST_CORNER=new Qt("SOUTH_EAST_CORNER",u.EAST,u.SOUTH);Qt._values=[Qt.NORTH,Qt.SOUTH,Qt.EAST,Qt.WEST,Qt.NORTH_WEST_CORNER,Qt.NORTH_EAST_CORNER,Qt.SOUTH_WEST_CORNER,Qt.SOUTH_EAST_CORNER];var Ch=class{assignPortSides(t){let e=t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_DISTRIBUTION);switch(e!=null?e.toString():null){case"NORTH":this._assignToNorthSide(t);break;case"NORTH_SOUTH":this._assignToNorthOrSouthSide(t);break;case"EQUALLY":this._assignToAllSides(t);break;default:this._assignToNorthSide(t);break}}_assignToNorthSide(t){for(let e of t.getSLHyperLoops())for(let o of this._hiddenSelfLoopPorts(e))o.getLPort().setSide(u.NORTH)}_assignToNorthOrSouthSide(t){let e=0,o=0;for(let r of t.getSLHyperLoops()){let i=this._hiddenSelfLoopPorts(r),s=null;if(e<=o?(s=u.NORTH,e+=i.length):o<e&&(s=u.SOUTH,o+=i.length),s!=null)for(let a of i)a.getLPort().setSide(s)}}_assignToAllSides(t){let e=t.getSLHyperLoops().slice();e.sort((i,s)=>s.getSLPorts().length-i.getSLPorts().length);let o=Qt._values,r=0;for(let i of e){let s=o[r%o.length];this._assignToTarget(i,s),r++}}_assignToTarget(t,e){let o=t.getSLPorts();e.isCornerTarget()&&o.sort((i,s)=>i.getLPort().getNetFlow()-s.getLPort().getNetFlow());let r=Math.floor(o.length/2);for(let i=0;i<r;i++){let s=o[i];s.isHidden()&&s.getLPort().setSide(e.firstSide)}for(let i=r;i<o.length;i++){let s=o[i];s.isHidden()&&s.getLPort().setSide(e.secondSide)}}_hiddenSelfLoopPorts(t){let e=[];for(let o of t.getSLPorts())o.isHidden()&&e.push(o);return e}};p.ORIGINAL_PORT_CONSTRAINTS;var xh=class{constructor(){this._portSideAssigner=new Ch,this._portRestorer=new Lh}process(t,e){e.begin("Self-Loop ordering",1);for(let o of t.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.NORMAL||!r.hasProperty(p.SELF_LOOP_HOLDER))continue;let i=r.getProperty(p.SELF_LOOP_HOLDER);this._processNode(i,e)}e.done()}_processNode(t,e){if(t.arePortsHidden()){let o=t.getLNode().getProperty(p.ORIGINAL_PORT_CONSTRAINTS);o===H.UNDEFINED||o===H.FREE||o==null?(this._portSideAssigner.assignPortSides(t),O_(t),this._portRestorer.restorePorts(t,e)):o===H.FIXED_SIDE&&(O_(t),this._portRestorer.restorePorts(t,e))}else O_(t)}};function O_(n){for(let t of n.getSLHyperLoops())t.computePortsPerSide()}var Dh=class{process(t,e){e.begin("Self-Loop post-processing",1);for(let o of t.getLayers())for(let r of o.getNodes())r.getType()===y.NORMAL&&r.hasProperty(p.SELF_LOOP_HOLDER)&&Ny(r);e.done()}};function Ny(n){let t=n.getProperty(p.SELF_LOOP_HOLDER);for(let e of t.getSLHyperLoops())for(let o of e.getSLEdges())yy(n,o);for(let e of t.getSLHyperLoops()){let o=e.getSLLabels();o!=null&&o.applyPlacement(n.getPosition())}}function yy(n,t){let e=t.getLEdge();e.setSource(t.getSLSource().getLPort()),e.setTarget(t.getSLTarget().getLPort()),e.getBendPoints().offset(n.getPosition())}var wh=class{constructor(t,e,o){this._lEdge=t,this._slHyperLoop=null,this._slSource=e,this._slTarget=o,e.getOutgoingSLEdges().push(this),o.getIncomingSLEdges().push(this)}getLEdge(){return this._lEdge}getSLHyperLoop(){return this._slHyperLoop}setSLHyperLoop(t){this._slHyperLoop=t}getSLSource(){return this._slSource}getSLTarget(){return this._slTarget}isInline(){for(let t of this._lEdge.getLabels())if(t.getProperty(_.EDGE_LABELS_INLINE))return!0;return!1}getLabelSide(){return this._slHyperLoop.getSLLabels().getSide()}};var Mh=class{constructor(t){this._lPort=t,this._incomingSLEdges=[],this._outgoingSLEdges=[],this._isHidden=!1;let e=!0;for(let o of t.getConnectedEdges())if(!o.isSelfLoop()){e=!1;break}this._hadOnlySelfLoops=e}getLPort(){return this._lPort}hadOnlySelfLoops(){return this._hadOnlySelfLoops}isHidden(){return this._isHidden}setHidden(t){this._isHidden=t}getIncomingSLEdges(){return this._incomingSLEdges}getOutgoingSLEdges(){return this._outgoingSLEdges}getSLNetFlow(){return this._incomingSLEdges.length-this._outgoingSLEdges.length}};var It=class{constructor(t){this._name=t}toString(){return this._name}};It.CENTER=new It("CENTER");It.LEFT=new It("LEFT");It.RIGHT=new It("RIGHT");It.TOP=new It("TOP");var bh=class{constructor(t){this.id=0,this._lLabels=[],this._size=new O,this._position=new O,this._side=null,this._alignment=null,this._alignmentReferenceSLPort=null;let e=t.getSLHolder().getLNode();this._layoutDirection=e.getGraph().getProperty(_.DIRECTION),this._labelLabelSpacing=z.getIndividualOrInherited(e,_.SPACING_LABEL_LABEL)}addLLabels(t){for(let e of t)this._lLabels.push(e),this._updateSize(e)}getLLabels(){return this._lLabels}_updateSize(t){let e=t.getSize();this._layoutDirection!=null&&this._layoutDirection.isHorizontal&&this._layoutDirection.isHorizontal()?(this._size.x=Math.max(this._size.x,e.x),this._size.y+=e.y,this._lLabels.length>1&&(this._size.y+=this._labelLabelSpacing)):(this._size.x+=e.x,this._size.y=Math.max(this._size.y,e.y),this._lLabels.length>1&&(this._size.x+=this._labelLabelSpacing))}applyLabelManagement(t,e){let o=this._layoutDirection!=null&&this._layoutDirection.isVertical&&this._layoutDirection.isVertical(),r=As(t,this._lLabels,e,this._labelLabelSpacing,o);this._size.x=r.x,this._size.y=r.y}applyPlacement(t){this._layoutDirection!=null&&this._layoutDirection.isHorizontal&&this._layoutDirection.isHorizontal()?this._applyPlacementForHorizontalLayout(t):this._applyPlacementForVerticalLayout(t)}_applyPlacementForHorizontalLayout(t){let e=this._position.x,o=this._position.y;for(let r of this._lLabels){let i=r.getPosition();this._alignment===It.LEFT||this._side===u.EAST?i.x=e:this._alignment===It.RIGHT||this._side===u.WEST?i.x=e+this._size.x-r.getSize().x:i.x=e+(this._size.x-r.getSize().x)/2,i.y=o,i.add(t),o+=r.getSize().y+this._labelLabelSpacing}}_applyPlacementForVerticalLayout(t){let e=this._position.x,o=this._position.y;for(let r of this._lLabels){let i=r.getPosition();i.x=e,this._side===u.NORTH?i.y=o+this._size.y-r.getSize().y:i.y=o,i.add(t),e+=r.getSize().x+this._labelLabelSpacing}}getSize(){return this._size}getPosition(){return this._position}getSide(){return this._side}setSide(t){this._side=t}getAlignment(){return this._alignment}setAlignment(t){this._alignment=t}getAlignmentReferenceSLPort(){return this._alignmentReferenceSLPort}setAlignmentReferenceSLPort(t){this._alignmentReferenceSLPort=t}};var Gh=class{constructor(t){this._slHolder=t,this._slPorts=[],this._slEdges=new Set,this._slLabels=null,this._selfLoopType=null,this._slPortsBySide=null,this._leftmostPort=null,this._rightmostPort=null,this._occupiedPortSides=new Set,this._routingSlot=new Array(4).fill(0)}computePortsPerSide(){this._slPortsBySide=new Map;let t=new Set;for(let e of this._slPorts){let o=e.getLPort().getSide();if(o===u.UNDEFINED)throw new Error("Port side must not be UNDEFINED");let r=this._slPortsBySide.get(o);r==null&&(r=[],this._slPortsBySide.set(o,r)),r.push(e),t.add(o)}this._selfLoopType=kt.fromPortSides(t)}getSLHolder(){return this._slHolder}addSelfLoopEdge(t){if(this._slEdges.has(t))return;this._slEdges.add(t),t.setSLHyperLoop(this);let e=t.getSLSource();this._slPorts.includes(e)||this._slPorts.push(e);let o=t.getSLTarget();this._slPorts.includes(o)||this._slPorts.push(o);let r=t.getLEdge().getLabels();r.length>0&&(this._slLabels==null&&(this._slLabels=new bh(this)),this._slLabels.addLLabels(r))}getSLPorts(){return this._slPorts}getSLEdges(){return this._slEdges}getSLLabels(){return this._slLabels}getSelfLoopType(){return this._selfLoopType}getSLPortsBySide(){return this._slPortsBySide}getSLPortsOnSide(t){return this._slPortsBySide!=null&&this._slPortsBySide.has(t)?this._slPortsBySide.get(t):[]}hasSLPortsOnSide(t){return this._slPortsBySide!=null&&this._slPortsBySide.has(t)}getLeftmostPort(){return this._leftmostPort}setLeftmostPort(t){this._leftmostPort=t}getRightmostPort(){return this._rightmostPort}setRightmostPort(t){this._rightmostPort=t}getOccupiedPortSides(){return this._occupiedPortSides}getRoutingSlot(t){return this._routingSlot[fP(t)]}setRoutingSlot(t,e){let o=fP(t);this._routingSlot[o]=e;let r=this._slHolder.getRoutingSlotCount();r[o]=Math.max(r[o],e+1)}},Iy=new Map([[u.NORTH,0],[u.EAST,1],[u.SOUTH,2],[u.WEST,3],[u.UNDEFINED,4]]);function fP(n){var t;return(t=Iy.get(n))!=null?t:4}var Hh=0,Ry=1,sl=class n{constructor(t){this._lNode=t,this._slHyperLoops=[],this._slPorts=new Map,this._arePortsHidden=!1,this._routingSlotCount=[0,0,0,0]}static install(t){let e=new n(t);return t.setProperty(p.SELF_LOOP_HOLDER,e),e._initialize(),e}static needsSelfLoopProcessing(t){if(t.getType()!==y.NORMAL)return!1;for(let e of t.getOutgoingEdges())if(e.isSelfLoop())return!0;return!1}_initialize(){for(let t of this._lNode.getOutgoingEdges())t.isSelfLoop()&&new wh(t,this._selfLoopPortFor(t.getSource()),this._selfLoopPortFor(t.getTarget()));for(let t of this._slPorts.values())t.getLPort().id=Hh;for(let t of this._slPorts.values())t.getLPort().id===Hh&&this._slHyperLoops.push(this._initializeHyperLoop(t))}_selfLoopPortFor(t){let e=this._slPorts.get(t);return e==null&&(e=new Mh(t),this._slPorts.set(t,e)),e}_initializeHyperLoop(t){let e=new Gh(this),o=[t];for(;o.length>0;){let r=o.shift();r.getLPort().id=Ry;for(let i of r.getOutgoingSLEdges()){e.addSelfLoopEdge(i);let s=i.getSLTarget();s.getLPort().id===Hh&&o.push(s)}for(let i of r.getIncomingSLEdges()){e.addSelfLoopEdge(i);let s=i.getSLSource();s.getLPort().id===Hh&&o.push(s)}}return e}getLNode(){return this._lNode}getSLHyperLoops(){return this._slHyperLoops}getSLPortMap(){return this._slPorts}arePortsHidden(){return this._arePortsHidden}setPortsHidden(t){this._arePortsHidden=t}getRoutingSlotCount(){return this._routingSlotCount}static ordinalOf(t){switch(t){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}};var vh=class{process(t,e){e.begin("Self-Loop pre-processing",1);for(let o of t.getLayerlessNodes())if(sl.needsSelfLoopProcessing(o)){let r=sl.install(o);Ly(r),Ay(r)}e.done()}};function Ly(n){for(let t of n.getSLHyperLoops())for(let e of t.getSLEdges()){let o=e.getLEdge();o.setSource(null),o.setTarget(null)}}function Ay(n){let t=n.getLNode(),e=t.getNestedGraph(),o=t.getProperty(_.PORT_CONSTRAINTS),r=o!=null&&o.isOrderFixed(),i=e!=null&&e.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS);if(!(r||i))for(let s of n.getSLPortMap().values()){if(!s.hadOnlySelfLoops())continue;s.getLPort().setNode(null),s.setHidden(!0),n.setPortsHidden(!0)}}var Bh=class{placeLabels(t,e,o){this._assignSideAndAlignment(t);for(let r of t.getSLHyperLoops())r.getSLLabels()!=null&&(e!=null&&this._manageLabels(r,e),this._computeCoordinates(r))}_assignSideAndAlignment(t){let e=null,o=null,r=t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_ORDERING);r===Je.SEQUENCED&&(e=[],o=[]);for(let i of t.getSLHyperLoops())if(i.getSLLabels()!=null)switch(i.getSelfLoopType()){case kt.ONE_SIDE:{let a=i.getOccupiedPortSides().values().next().value;r===Je.SEQUENCED&&a===u.NORTH?e.push(i):r===Je.SEQUENCED&&a===u.SOUTH?o.push(i):this._assignOneSidedSimpleSideAndAlignment(i,a);break}case kt.TWO_SIDES_CORNER:this._assignTwoSidesCornerSideAndAlignment(i);break;case kt.TWO_SIDES_OPPOSING:case kt.THREE_SIDES:this._assignTwoSidesOpposingAndThreeSidesSideAndAlignment(i);break;case kt.FOUR_SIDES:this._assignFourSidesSideAndAlignment(i);break;default:throw new Error("Unknown self loop type: "+i.getSelfLoopType())}e!=null&&(e.length>0&&this._assignOneSidedSequencedSideAndAlignment(e,u.NORTH),o.length>0&&this._assignOneSidedSequencedSideAndAlignment(o,u.SOUTH))}_assignOneSidedSimpleSideAndAlignment(t,e){for(let o of t.getSLLabels().getLLabels())o.setProperty(_.EDGE_LABELS_INLINE,null);switch(e){case u.EAST:case u.WEST:{let o=t.getLeftmostPort();t.getRightmostPort().getLPort().getPosition().y<o.getLPort().getPosition().y&&(o=t.getRightmostPort()),this._assignSideAndAlignmentFor(t,e,It.TOP,o);break}case u.NORTH:case u.SOUTH:this._assignSideAndAlignmentFor(t,e,It.CENTER,null);break;default:throw new Error("Invalid loop side: "+e)}}_assignOneSidedSequencedSideAndAlignment(t,e){let o=0;for(let s of t[0].getSLHolder().getLNode().getPorts())s.id=o++;e===u.NORTH?t.sort((s,a)=>s.getLeftmostPort().getLPort().id-a.getLeftmostPort().getLPort().id):t.sort((s,a)=>a.getLeftmostPort().getLPort().id-s.getLeftmostPort().getLPort().id);let r=0,i=t.length-1;for(;r<i;){let s=t[r],a=t[i],l=e===u.NORTH?s.getRightmostPort():s.getLeftmostPort(),c=e===u.NORTH?a.getLeftmostPort():a.getRightmostPort();this._assignSideAndAlignmentFor(s,e,It.RIGHT,l),this._assignSideAndAlignmentFor(a,e,It.LEFT,c),r++,i--}r===i&&this._assignSideAndAlignmentFor(t[r],e,It.CENTER,null)}_assignTwoSidesCornerSideAndAlignment(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getRightmostPort().getLPort().getSide();for(let r of t.getSLLabels().getLLabels())r.setProperty(_.EDGE_LABELS_INLINE,null);if(e===u.NORTH)this._assignSideAndAlignmentFor(t,u.NORTH,It.LEFT,t.getLeftmostPort());else if(o===u.NORTH)this._assignSideAndAlignmentFor(t,u.NORTH,It.RIGHT,t.getRightmostPort());else if(e===u.SOUTH)this._assignSideAndAlignmentFor(t,u.SOUTH,It.RIGHT,t.getLeftmostPort());else if(o===u.SOUTH)this._assignSideAndAlignmentFor(t,u.SOUTH,It.LEFT,t.getRightmostPort());else throw new Error("Invalid two-sides-corner configuration")}_assignTwoSidesOpposingAndThreeSidesSideAndAlignment(t){let e=t.getOccupiedPortSides(),o=!1;for(let r of t.getSLLabels().getLLabels())if(r.getProperty(_.EDGE_LABELS_INLINE)){o=!0;break}if(!e.has(u.NORTH))this._assignSideAndAlignmentFor(t,u.SOUTH,It.CENTER,null);else if(!e.has(u.SOUTH))this._assignSideAndAlignmentFor(t,u.NORTH,It.CENTER,null);else if(!e.has(u.WEST))this._assignSideAndAlignmentFor(t,o?u.EAST:u.NORTH,o?It.CENTER:It.LEFT,o?null:t.getLeftmostPort());else if(!e.has(u.EAST))this._assignSideAndAlignmentFor(t,o?u.WEST:u.NORTH,o?It.CENTER:It.RIGHT,o?null:t.getRightmostPort());else throw new Error("All sides occupied for two-sides-opposing / three-sides loop")}_assignFourSidesSideAndAlignment(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getLeftmostPort().getLPort().getSide();for(let r of t.getSLLabels().getLLabels())r.setProperty(_.EDGE_LABELS_INLINE,null);e===u.NORTH||o===u.NORTH?this._assignSideAndAlignmentFor(t,u.SOUTH,It.CENTER,null):this._assignSideAndAlignmentFor(t,u.NORTH,It.CENTER,null)}_assignSideAndAlignmentFor(t,e,o,r){let i=t.getSLLabels();i.setSide(e),i.setAlignment(o),i.setAlignmentReferenceSLPort(r)}_manageLabels(t,e){let o=t.getSLLabels(),r=o.getAlignmentReferenceSLPort(),s=t.getSLHolder().getLNode().getSize(),a=t.getSLHolder().getLNode().getMargin(),l=0;switch(o.getAlignment()){case It.CENTER:l=a.left+s.x+a.right;break;case It.LEFT:l=s.x-r.getLPort().getPosition().x-r.getLPort().getAnchor().x+a.right;break;case It.RIGHT:l=a.left+r.getLPort().getPosition().x+r.getLPort().getAnchor().x;break;case It.TOP:l=ol;break;default:throw new Error("Invalid alignment: "+o.getAlignment())}o.applyLabelManagement(e,Math.max(l,ol))}_computeCoordinates(t){let e=t.getSLLabels(),o=e.getAlignmentReferenceSLPort(),r=e.getSize(),i=e.getPosition();switch(e.getAlignment()){case It.CENTER:i.x=(t.getSLHolder().getLNode().getSize().x-r.x)/2;break;case It.LEFT:i.x=o.getLPort().getPosition().x+o.getLPort().getAnchor().x;break;case It.RIGHT:i.x=o.getLPort().getPosition().x+o.getLPort().getAnchor().x-r.x;break;case It.TOP:i.y=o.getLPort().getPosition().y+o.getLPort().getAnchor().y;break;default:throw new Error("Invalid alignment: "+e.getAlignment())}}};var Uh=class{routeSelfLoops(t){throw new Error("AbstractSelfLoopRouter.routeSelfLoops() must be overridden")}};var ni=Object.freeze({CLOCKWISE:"CLOCKWISE",COUNTER_CLOCKWISE:"COUNTER_CLOCKWISE"}),Ui=class extends Uh{routeSelfLoops(t){let e=t.getLNode(),o=e.getSize(),r=e.getMargin(),i=z.getIndividualOrInherited(e,_.SPACING_EDGE_EDGE),s=z.getIndividualOrInherited(e,_.SPACING_EDGE_LABEL),a=z.getIndividualOrInherited(e,_.SPACING_NODE_SELF_LOOP),l=new Gr;l.set(r);let c=this._computeRoutingSlotPositions(t,i,s,a);for(let g of t.getSLHyperLoops()){for(let d of g.getSLEdges()){let f=d.getLEdge(),E=xy(d),P=this.computeOrthogonalBendPoints(d,E,c);P=this.modifyBendPoints(d,E,P);let S=f.getBendPoints();S.length=0;for(let T of P)S.push(T);for(let T of P)S_(o,l,T)}let h=g.getSLLabels();h!=null&&(Dy(g,h,c,s),wy(o,l,h))}r.set(l)}_computeRoutingSlotPositions(t,e,o,r){let i=new Array(5);for(let s of u.values())i[s.ordinal()]=new Array(t.getRoutingSlotCount()[Cy(s)]).fill(0);return uP(i,t,u.NORTH),uP(i,t,u.SOUTH),Fh(i,t,u.NORTH,e,o,r),Fh(i,t,u.EAST,e,o,r),Fh(i,t,u.SOUTH,e,o,r),Fh(i,t,u.WEST,e,o,r),i}computeOrthogonalBendPoints(t,e,o){let r=new st;return _P(t,t.getSLSource(),o,r),by(t,e,o,r),_P(t,t.getSLTarget(),o,r),r}modifyBendPoints(t,e,o){return o}};function Cy(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function xy(n){let t=n.getSLSource().getLPort(),e=t.getSide(),o=n.getSLTarget().getLPort(),r=o.getSide();return e===r?t.id<o.id?ni.CLOCKWISE:ni.COUNTER_CLOCKWISE:e.right()===r?ni.CLOCKWISE:e.left()===r?ni.COUNTER_CLOCKWISE:n.getSLHyperLoop().getOccupiedPortSides().has(e.right())?ni.CLOCKWISE:ni.COUNTER_CLOCKWISE}function Dy(n,t,e,o){let r=t.getSide(),i=e[r.ordinal()][n.getRoutingSlot(r)],s=!1;for(let l of t.getLLabels())if(l.getProperty(_.EDGE_LABELS_INLINE)){s=!0;break}let a=s?0:o;switch(r){case u.NORTH:i-=a+t.getSize().y,t.getPosition().y=i;break;case u.SOUTH:i+=a,t.getPosition().y=i;break;case u.WEST:i-=a+t.getSize().x,t.getPosition().x=i;break;case u.EAST:i+=a,t.getPosition().x=i;break;default:throw new Error("Invalid label side: "+r)}}function S_(n,t,e){t.left=Math.max(t.left,-e.x),t.right=Math.max(t.right,e.x-n.x),t.top=Math.max(t.top,-e.y),t.bottom=Math.max(t.bottom,e.y-n.y)}function wy(n,t,e){let o=new O(e.getPosition().x,e.getPosition().y);S_(n,t,o),o.add(e.getSize()),S_(n,t,o)}function uP(n,t,e){let o=n[e.ordinal()];for(let r of t.getSLHyperLoops()){let i=r.getSLLabels();if(i!=null&&i.getSide()===e){let s=r.getRoutingSlot(e);o[s]=Math.max(o[s],i.getSize().y)}}}function Fh(n,t,e,o,r,i){let s=My(t,e,i),a=e===u.NORTH||e===u.WEST?-1:1,l=n[e.ordinal()];for(let c=0;c<l.length;c++){let g=l[c];g>0&&(g+=r),l[c]=s,s+=a*(g+o)}}function My(n,t,e){let o=n.getLNode(),r=o.getMargin();switch(t){case u.NORTH:return-r.top-e;case u.EAST:return o.getSize().x+r.right+e;case u.SOUTH:return o.getSize().y+r.bottom+e;case u.WEST:return-r.left-e;default:throw new Error("Invalid port side: "+t)}}function _P(n,t,e,o){let r=n.getSLHyperLoop(),i=t.getLPort(),s=i.getSide(),a=T_(s,r.getRoutingSlot(s),e),l=new O(i.getPosition().x,i.getPosition().y);switch(l.add(i.getAnchor()),s){case u.NORTH:case u.SOUTH:a.x+=l.x;break;case u.EAST:case u.WEST:a.y+=l.y;break;default:throw new Error("Invalid port side: "+s)}o.add(a)}function by(n,t,e,o){let r=n.getSLSource().getLPort(),i=n.getSLTarget().getLPort();if(r.getSide()===i.getSide())return;let s=n.getSLHyperLoop(),a=null,l=null,c=n.isInline();c&&s.getSLLabels()!=null&&(a=n.getLabelSide(),l=s.getSLLabels().getSize());let g=r.getSide();for(;g!==i.getSide();){let h=t===ni.CLOCKWISE?g.right():g.left(),d=T_(g,s.getRoutingSlot(g),e),f=T_(h,s.getRoutingSlot(h),e);c&&a!=null&&l!=null&&(g===a?pP(d,a,l):h===a&&pP(f,a,l)),o.add(d.add(f)),g=h}}function T_(n,t,e){let o=e[n.ordinal()][t];switch(n){case u.NORTH:case u.SOUTH:return new O(0,o);case u.EAST:case u.WEST:return new O(o,0);default:throw new Error("Invalid port side: "+n)}}function pP(n,t,e){switch(t){case u.NORTH:n.y-=e.y/2;break;case u.SOUTH:n.y+=e.y/2;break;case u.WEST:n.x-=e.x/2;break;case u.EAST:n.x+=e.x/2;break;default:break}}var Gy=10,kh=.01,Wh=class extends Ui{modifyBendPoints(t,e,o){let r=t.getSLSource().getLPort(),i=new O(r.getPosition().x,r.getPosition().y);i.add(r.getAnchor()),o.splice(0,0,i);let s=t.getSLTarget().getLPort(),a=new O(s.getPosition().x,s.getPosition().y);return a.add(s.getAnchor()),o.push(a),this.cutCorners(o,Gy)}cutCorners(t,e){let o=new st,r=null,i=t[0],s=t[1];for(let a=2;a<t.length;a++){r=i,i=s,s=t[a];let l=EP(new O(r.x-i.x,r.y-i.y)),c=EP(new O(s.x-i.x,s.y-i.y)),g=e;g=Math.min(g,Math.abs(l.x+l.y)/2),g=Math.min(g,Math.abs(c.x+c.y)/2),l.x=Math.sign(l.x)*g,l.y=Math.sign(l.y)*g,c.x=Math.sign(c.x)*g,c.y=Math.sign(c.y)*g,o.push(new O(l.x+i.x,l.y+i.y)),o.push(new O(c.x+i.x,c.y+i.y))}return o}};function EP(n){return n.x>=-kh&&n.x<=kh&&(n.x=0),n.y>=-kh&&n.y<=kh&&(n.y=0),n}var Hy=(n,t)=>n.getLPort().id-t.getLPort().id,vy=1,By=3,zh=class{constructor(){this._portPenalties=null}determineLoopRoutes(t){this._assignPortIds(t.getLNode().getPorts()),this._sortHyperLoopPortLists(t);for(let e of t.getSLHyperLoops()){switch(e.getSelfLoopType()){case kt.ONE_SIDE:this._determineOneSideLoopRoutes(e);break;case kt.TWO_SIDES_CORNER:this._determineTwoSideCornerLoopRoutes(e);break;case kt.TWO_SIDES_OPPOSING:this._determineTwoSideOpposingLoopRoutes(e);break;case kt.THREE_SIDES:this._determineThreeSideLoopRoutes(e);break;case kt.FOUR_SIDES:this._determineFourSideLoopRoutes(e);break;default:throw new Error("Unknown self loop type: "+e.getSelfLoopType())}this._computeOccupiedPortSides(e)}this._portPenalties=null}_assignPortIds(t){for(let e=0;e<t.length;e++)t[e].id=e}_sortHyperLoopPortLists(t){for(let e of t.getSLHyperLoops())e.getSLPorts().sort(Hy)}_computeOccupiedPortSides(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getRightmostPort().getLPort().getSide();for(;e!==o;)t.getOccupiedPortSides().add(e),e=e.right();t.getOccupiedPortSides().add(e)}_determineOneSideLoopRoutes(t){let e=t.getSLPorts()[0].getLPort().getSide();this._assignLeftmostRightmostPorts(t,e,e)}_determineTwoSideCornerLoopRoutes(t){let e=Ah(t);this._assignLeftmostRightmostPorts(t,e[0],e[1])}_determineTwoSideOpposingLoopRoutes(t){let e=[...t.getSLPortsBySide().keys()];if(e.length!==2)throw new Error("Expected exactly two occupied sides");let o=t.getSLHolder(),r=N_(t,e[0]),i=y_(t,e[1]),s=this._computeEdgePenalty(o,r,i),a=N_(t,e[1]),l=y_(t,e[0]),c=this._computeEdgePenalty(o,a,l);s<=c?(t.setLeftmostPort(r),t.setRightmostPort(i)):(t.setLeftmostPort(a),t.setRightmostPort(l))}_determineThreeSideLoopRoutes(t){let e=null,o=null;switch(this._computeMissingPortSide(t)){case u.NORTH:e=u.EAST,o=u.WEST;break;case u.EAST:e=u.SOUTH,o=u.NORTH;break;case u.SOUTH:e=u.WEST,o=u.EAST;break;case u.WEST:e=u.NORTH,o=u.SOUTH;break;default:throw new Error("Invalid missing port side")}this._assignLeftmostRightmostPorts(t,e,o)}_computeMissingPortSide(t){let e=t.getSLPortsBySide();for(let o of[u.NORTH,u.EAST,u.SOUTH,u.WEST])if(!e.has(o))return o;throw new Error("All sides occupied for three-sided loop")}_determineFourSideLoopRoutes(t){let e=t.getSLPorts(),o=t.getSLHolder(),r=e[e.length-1],i=e[0],s=this._computeEdgePenalty(o,r,i);for(let a=1;a<e.length;a++){let l=e[a-1],c=e[a],g=this._computeEdgePenalty(o,l,c);g>s&&(r=l,i=c,s=g)}t.setLeftmostPort(i),t.setRightmostPort(r)}_assignLeftmostRightmostPorts(t,e,o){t.setLeftmostPort(N_(t,e)),t.setRightmostPort(y_(t,o))}_computeEdgePenalty(t,e,o){this._portPenalties==null&&this._computePenalties(t);let r=t.getLNode().getPorts().length,i=e.getLPort().id,a=o.getLPort().id-1;return a<0&&(a=r-1),i<=a?this._portPenalties[a]-this._portPenalties[i]:this._portPenalties[r-1]-this._portPenalties[i]+this._portPenalties[a]}_computePenalties(t){let e=t.getLNode().getPorts();this._portPenalties=new Array(e.length).fill(0);let o=0;for(let r=0;r<e.length;r++){let i=e[r];i.getIncomingEdges().length===0&&i.getOutgoingEdges().length===0?o+=vy:o+=By,this._portPenalties[r]=o}}};function N_(n,t){let e=n.getSLPortsBySide().get(t),o=e[0];for(let r=1;r<e.length;r++)e[r].getLPort().id<o.getLPort().id&&(o=e[r]);return o}function y_(n,t){let e=n.getSLPortsBySide().get(t),o=e[0];for(let r=1;r<e.length;r++)e[r].getLPort().id>o.getLPort().id&&(o=e[r]);return o}var Yh=class{constructor(){this._hyperEdgeSegments=null,this._slLoopToSegmentMap=null,this._slLoopActivityOverPorts=null}assignRoutingSlots(t){let e=this._computeLabelCrossingMatrix(t);this._createCrossingGraph(t,e);let o=t.getLNode().getGraph().getProperty(p.RANDOM);ie.breakNonCriticalCycles(this._hyperEdgeSegments,o),this._doAssignRoutingSlots(t,e),this._hyperEdgeSegments=null,this._slLoopToSegmentMap=null,this._slLoopActivityOverPorts=null}_computeLabelCrossingMatrix(t){let e=0;for(let i of t.getSLHyperLoops())i.getSLLabels()!=null&&(i.getSLLabels().id=e++);let o=[];for(let i=0;i<e;i++)o.push(new Array(e).fill(!1));let r=t.getSLHyperLoops();for(let i=0;i<r.length;i++){let s=r[i];if(s.getSLLabels()!=null)for(let a=i+1;a<r.length;a++){let l=r[a];if(l.getSLLabels()==null)continue;let c=Uy(s,l);o[s.getSLLabels().id][l.getSLLabels().id]=c,o[l.getSLLabels().id][s.getSLLabels().id]=c}}return o}_createCrossingGraph(t,e){let o=t.getSLHyperLoops();this._hyperEdgeSegments=[],this._slLoopToSegmentMap=new Map;for(let r of o){let i=new An(null);this._hyperEdgeSegments.push(i),this._slLoopToSegmentMap.set(r,i)}this._slLoopActivityOverPorts=new Map,this._computeLoopActivity(t);for(let r=0;r<o.length-1;r++){let i=t.getSLHyperLoops()[r];for(let s=r+1;s<o.length;s++)this._createDependencies(i,t.getSLHyperLoops()[s],e)}}_computeLoopActivity(t){let e=t.getSLHyperLoops(),o=t.getLNode().getPorts();for(let r of e){let i=new Array(o.length).fill(!1);this._slLoopActivityOverPorts.set(r,i);let s=r.getLeftmostPort().getLPort().id-1,a=r.getRightmostPort().getLPort().id;for(;s!==a;)s=(s+1+o.length)%o.length,i[s]=!0}}_createDependencies(t,e,o){let r=this._countCrossings(t,e),i=this._countCrossings(e,t),s=this._slLoopToSegmentMap.get(t),a=this._slLoopToSegmentMap.get(e);r<i?$e.createAndAddRegular(s,a,i-r):i<r?$e.createAndAddRegular(a,s,r-i):(r!==0||Fy(t,e,o))&&($e.createAndAddRegular(s,a,0),$e.createAndAddRegular(a,s,0))}_countCrossings(t,e){let o=this._slLoopActivityOverPorts.get(e),r=0;for(let i of t.getSLPorts())o[i.getLPort().id]&&r++;return r}_doAssignRoutingSlots(t,e){this._assignRawRoutingSlotsToSegments(),this._assignRawRoutingSlotsToLoops(t),this._shiftTowardsNode(t,e)}_assignRawRoutingSlotsToSegments(){let t=[];for(let e of this._hyperEdgeSegments)e.setInWeight(e.getIncomingSegmentDependencies().length),e.setOutWeight(e.getOutgoingSegmentDependencies().length),e.getOutWeight()===0&&(e.setRoutingSlot(0),t.push(e));for(;t.length>0;){let e=t.shift(),o=e.getRoutingSlot()+1;for(let r of e.getIncomingSegmentDependencies()){let i=r.getSource();i.setRoutingSlot(Math.max(i.getRoutingSlot(),o)),i.setOutWeight(i.getOutWeight()-1),i.getOutWeight()===0&&t.push(i)}}}_assignRawRoutingSlotsToLoops(t){for(let e of t.getSLHyperLoops()){let o=this._slLoopToSegmentMap.get(e).getRoutingSlot();for(let r of e.getOccupiedPortSides())e.setRoutingSlot(r,o)}}_shiftTowardsNode(t,e){let o=new Array(t.getLNode().getPorts().length).fill(0);this._shiftTowardsNodeOnSide(t,u.NORTH,o,e),this._shiftTowardsNodeOnSide(t,u.EAST,o,e),this._shiftTowardsNodeOnSide(t,u.SOUTH,o,e),this._shiftTowardsNodeOnSide(t,u.WEST,o,e)}_shiftTowardsNodeOnSide(t,e,o,r){let i=t.getSLHyperLoops().filter(c=>c.getOccupiedPortSides().has(e));i.sort((c,g)=>c.getRoutingSlot(e)-g.getRoutingSlot(e));let s=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(let c of t.getLNode().getPorts())c.getSide()===e&&(c.id<s&&(s=c.id),c.id>a&&(a=c.id));if(s===Number.MAX_SAFE_INTEGER){for(let c=0;c<i.length;c++)i[c].setRoutingSlot(e,c);return}let l=new Array(r.length).fill(-1);for(let c of i){let g=this._slLoopActivityOverPorts.get(c),h=0;for(let d=s;d<=a;d++)g[d]&&(h=Math.max(h,o[d]));if(c.getSLLabels()!=null){let d=c.getSLLabels().id,f=new Set;for(let E=0;E<r.length;E++)r[d][E]&&f.add(l[E]);for(;f.has(h);)h++}c.setRoutingSlot(e,h);for(let d=s;d<=a;d++)g[d]&&(o[d]=h+1);c.getSLLabels()!=null&&(l[c.getSLLabels().id]=h)}}};function Uy(n,t){let e=n.getSLLabels(),o=t.getSLLabels();if(e==null||o==null||e.getSide()!==o.getSide()||e.getSide()===u.EAST||e.getSide()===u.WEST)return!1;let r=e.getPosition().x,i=r+e.getSize().x,s=o.getPosition().x,a=s+o.getSize().x;return r<=a&&i>=s}function Fy(n,t,e){return n.getSLLabels()==null||t.getSLLabels()==null?!1:e[n.getSLLabels().id][t.getSLLabels().id]}var ky=3,mP=.5,Vh=class extends Ui{modifyBendPoints(t,e,o){let r=z.getIndividualOrInherited(t.getSLHyperLoop().getSLHolder().getLNode(),_.SPACING_EDGE_LABEL),i=new st;return i.push(PP(t.getSLSource())),this._addSplineControlPoints(t,e,o,i,r),i.push(PP(t.getSLTarget())),new Rs(!0,ky,i).getBezierCP()}_addSplineControlPoints(t,e,o,r,i){let s=t.getSLSource().getLPort().getSide(),a=o[0];for(let l=1;l<o.length;l++){let c=o[l];r.push(a);let g=new O((a.x+c.x)*mP,(a.y+c.y)*mP),h=Wy(s);h.scale(i),g.add(h),r.push(g),a=c,s=e===ni.CLOCKWISE?s.right():s.left()}r.push(o[o.length-1])}};function PP(n){let t=n.getLPort(),e=new O(t.getPosition().x,t.getPosition().y);return e.add(t.getAnchor()),e}function Wy(n){switch(n.toString()){case"NORTH":return new O(0,-1);case"EAST":return new O(1,0);case"SOUTH":return new O(0,1);case"WEST":return new O(-1,0);default:return new O}}var Xh=class{constructor(){this._routingDirector=new zh,this._labelPlacer=new Bh,this._routingSlotAssigner=new Yh}process(t,e){e.begin("Self-Loop routing",1);let o=this._routerForGraph(t),r=t.getProperty(Hn);for(let i of t.getLayers())for(let s of i.getNodes()){if(s.getType()!==y.NORMAL||!s.hasProperty(p.SELF_LOOP_HOLDER))continue;let a=s.getProperty(p.SELF_LOOP_HOLDER);this._processNode(a,r,o,e)}e.done()}_routerForGraph(t){switch(t.getProperty(_.EDGE_ROUTING)){case At.POLYLINE:return new Wh;case At.SPLINES:return new Vh;default:return new Ui}}_processNode(t,e,o,r){this._routingDirector.determineLoopRoutes(t),this._labelPlacer.placeLabels(t,e,r),this._routingSlotAssigner.assignRoutingSlots(t),o.routeSelfLoops(t)}};var Kh=class{process(t,e){e.begin("Semi-Interactive Crossing Minimization Processor",1);let o=!1;for(let r of t){let i=[];for(let s of r.getNodes())s.getType()===y.NORMAL&&s.hasProperty(_.POSITION)&&i.push(s);if(i.sort((s,a)=>{let l=s.getProperty(_.POSITION).y,c=a.getProperty(_.POSITION).y;return l-c}),i.length>0){o=!0;for(let s=0;s<i.length-1;s++)i[s].getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(i[s+1])}}o&&t.setProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES,!0),e.done()}};var Ao=class{constructor(t,e){this.name=t,this._returnValue=e,Object.freeze(this)}toString(){return this.name}returnValue(){return this._returnValue}};Ao.DUMMY_NODE_OVER=new Ao("DUMMY_NODE_OVER",Number.MAX_SAFE_INTEGER);Ao.DUMMY_NODE_UNDER=new Ao("DUMMY_NODE_UNDER",Number.MIN_SAFE_INTEGER);Ao.EQUAL=new Ao("EQUAL",0);var Wt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Wt.ONLY_WITHIN_GROUP=new Wt("ONLY_WITHIN_GROUP");Wt.MODEL_ORDER=new Wt("MODEL_ORDER");Wt.ENFORCED=new Wt("ENFORCED");var Qe=class{static calculateModelOrderOrGroupModelOrder(t,e,o,r){let i=o.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,s=o.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_ENFORCED_GROUP_ORDERS);if(t.hasProperty(p.MODEL_ORDER))if(i){let a=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID),l=e.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID);if(s.indexOf(a)>=0&&s.indexOf(l)>=0)return r*a+t.getProperty(p.MODEL_ORDER)}else return t.getProperty(p.MODEL_ORDER);else return-1;return t.getProperty(p.MODEL_ORDER)}};var Zh=class{constructor(t,e,o,r,i){this._graph=t,this._strategy=o,this._targetNodeModelOrder=r,this._portModelOrder=i,e!=null&&typeof e.getNodes=="function"?this._previousLayer=[...e.getNodes()]:this._previousLayer=e||[],this._biggerThan=new Map,this._smallerThan=new Map}compare(t,e){if(!this._biggerThan.has(t))this._biggerThan.set(t,new Set);else if(this._biggerThan.get(t).has(e))return 1;if(!this._biggerThan.has(e))this._biggerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return-1;if(!this._smallerThan.has(t))this._smallerThan.set(t,new Set);else if(this._smallerThan.get(t).has(e))return-1;if(!this._smallerThan.has(e))this._smallerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return 1;if(t.getSide()!==e.getSide()){let r=OP(t.getSide())-OP(e.getSide());return r>0?this._updateAssoc(t,e,1):this._updateAssoc(e,t,1),r}let o=1;if(t.getIncomingEdges().length>0&&e.getIncomingEdges().length>0){(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.NORTH&&e.getSide()===u.NORTH||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o);let r=t.getIncomingEdges()[0].getSource(),i=e.getIncomingEdges()[0].getSource(),s=r.getNode(),a=i.getNode();if(s===a)for(let c of s.getPorts()){if(c===r)return this._updateAssoc(e,t,o),-o;if(c===i)return this._updateAssoc(t,e,o),o}if(r.getNode().getType()===y.LONG_EDGE&&i.getNode().getType()===y.LONG_EDGE&&s.getLayer().id===a.getLayer().id&&s.getLayer().id===t.getNode().getLayer().id){let c=s.getLayer().getNodes(),g=this._checkReferenceLayer(c,s,a,t,e);if(g!==0)return t.getSide()===u.EAST&&e.getSide()===u.EAST&&(o=-o),g>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}let l=this._checkReferenceLayer(this._previousLayer,s,a,t,e);if(l!==0)return l>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o);if(this._portModelOrder){let c=this.checkPortModelOrder(t,e);if(c!==0)return c>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}}if(t.getOutgoingEdges().length>0&&e.getOutgoingEdges().length>0){(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o);let r=t.getProperty(p.LONG_EDGE_TARGET_NODE),i=e.getProperty(p.LONG_EDGE_TARGET_NODE);if(this._strategy===ce.PREFER_NODES&&r!=null&&i!=null&&r.hasProperty(p.MODEL_ORDER)&&i.hasProperty(p.MODEL_ORDER)){let l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES),c=Qe.calculateModelOrderOrGroupModelOrder(r,i,this._graph,l),g=Qe.calculateModelOrderOrGroupModelOrder(i,r,this._graph,l);return c>g?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}if(this._portModelOrder){let l=this.checkPortModelOrder(t,e);if(l!==0)return l>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}let s=0,a=0;return t.getOutgoingEdges()[0].hasProperty(p.MODEL_ORDER)&&(s=Qe.calculateModelOrderOrGroupModelOrder(t.getOutgoingEdges()[0],e.getOutgoingEdges()[0],this._graph,t.getOutgoingEdges().length+t.getIncomingEdges().length)),e.getOutgoingEdges()[0].hasProperty(p.MODEL_ORDER)&&(a=Qe.calculateModelOrderOrGroupModelOrder(e.getOutgoingEdges()[0],t.getOutgoingEdges()[0],this._graph,e.getOutgoingEdges().length+e.getIncomingEdges().length)),r!=null&&r===i?s>a?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o):(this._targetNodeModelOrder!=null&&(this._targetNodeModelOrder.has(r)&&(s=this._targetNodeModelOrder.get(r)),this._targetNodeModelOrder.has(i)&&(a=this._targetNodeModelOrder.get(i))),s>a?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o))}if(t.getIncomingEdges().length>0&&e.getOutgoingEdges().length>0)return this._updateAssoc(t,e,o),1;if(t.getOutgoingEdges().length>0&&e.getIncomingEdges().length>0)return this._updateAssoc(e,t,o),-1;if(t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER)){let r=t.getNode().getPorts().length,i=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,r),s=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,r);return(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o),i>s?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}return this._updateAssoc(e,t,o),-o}checkPortModelOrder(t,e){let o=t.getNode().getPorts().length;if(t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER)){let r=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,o),i=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,o);return r-i}return 0}_updateAssoc(t,e,o){let r=t,i=e;o<0&&(r=e,i=t);let s=this._biggerThan.get(r),a=this._biggerThan.get(i),l=this._smallerThan.get(r),c=this._smallerThan.get(i);s.add(i),c.add(r);for(let g of a){s.add(g);let h=this._smallerThan.get(g);if(h){h.add(r);for(let d of l)h.add(d)}}for(let g of l){c.add(g);let h=this._biggerThan.get(g);if(h){h.add(i);for(let d of a)h.add(d)}}}_checkReferenceLayer(t,e,o,r,i){for(let s of t){if(s===e)return-1;if(s===o)return 1}return 0}clearTransitiveOrdering(){this._biggerThan=new Map,this._smallerThan=new Map}},zy=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);function OP(n){return zy.get(n)||0}var nl=class{constructor(t,e,o,r,i,s){this._graph=t,this._orderingStrategy=o,this._groupOrderStrategy=i,this._longEdgeNodeOrder=r||Ao.EQUAL,this._beforePorts=s,e!=null&&typeof e.getNodes=="function"?this._previousLayer=[...e.getNodes()]:this._previousLayer=e||[],this._biggerThan=new Map,this._smallerThan=new Map}compare(t,e){if(!this._biggerThan.has(t))this._biggerThan.set(t,new Set);else if(this._biggerThan.get(t).has(e))return 1;if(!this._biggerThan.has(e))this._biggerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return-1;if(!this._smallerThan.has(t))this._smallerThan.set(t,new Set);else if(this._smallerThan.get(t).has(e))return-1;if(!this._smallerThan.has(e))this._smallerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return 1;let o=t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER);if(this._orderingStrategy===ce.PREFER_EDGES||!o){let i=this._findPreviousLayerSourcePort(t),s=this._findPreviousLayerSourcePort(e);if(i!=null&&s!=null){let a=i.getNode(),l=s.getNode();if(a!=null&&a===l){for(let h of a.getPorts()){if(h===i)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(h===s)return this._updateBiggerAndSmallerAssociations(t,e),1}let c=this._getModelOrderFromConnectedEdges(t),g=this._getModelOrderFromConnectedEdges(e);return c>g?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}for(let c of this._previousLayer){if(c===a)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(c===l)return this._updateBiggerAndSmallerAssociations(t,e),1}}if(i!=null&&s==null||i==null&&s!=null){let a=this._handleHelperDummyNodes(t,e);if(a!==0)return a>0?this._updateBiggerAndSmallerAssociations(t,e):this._updateBiggerAndSmallerAssociations(e,t),a;if(!o){let l=this._getModelOrderFromConnectedEdges(t),c=this._getModelOrderFromConnectedEdges(e);return l>c?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}}if(i==null&&s==null){let a=this._handleHelperDummyNodes(t,e);if(a!==0)return a>0?this._updateBiggerAndSmallerAssociations(t,e):this._updateBiggerAndSmallerAssociations(e,t),a}}if(o){let i=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES),s=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,i),a=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,i);return s>a?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}return this._updateBiggerAndSmallerAssociations(e,t),-1}_findPreviousLayerSourcePort(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0){let o=e.getIncomingEdges()[0].getSource().getNode(),r=o.getLayer&&o.getLayer(),i=t.getLayer&&t.getLayer();if(r!=null&&i!=null&&r.id===i.id-1)return e.getIncomingEdges()[0].getSource()}return null}_getModelOrderFromConnectedEdges(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0)return e.getIncomingEdges()[0].getProperty(p.MODEL_ORDER);return this._longEdgeNodeOrder.returnValue()}_updateBiggerAndSmallerAssociations(t,e){let o=this._biggerThan.get(t),r=this._biggerThan.get(e),i=this._smallerThan.get(t),s=this._smallerThan.get(e);o.add(e),s.add(t);for(let a of r){o.add(a);let l=this._smallerThan.get(a);if(l){l.add(t);for(let c of i)l.add(c)}}for(let a of i){s.add(a);let l=this._biggerThan.get(a);if(l){l.add(e);for(let c of r)l.add(c)}}}_handleHelperDummyNodes(t,e){if(t.getType()===y.LONG_EDGE&&e.getType()===y.NORMAL){let o=this._getFirstIncomingSourcePortOfNode(t),r=this._getFirstOutgoingTargetPortOfNode(t);if(o==null||r==null)return 0;let i=t.getLayer().id;return o.getNode().getLayer().id!==i&&r.getNode().getLayer().id!==i?0:o.getNode()===e?(this._updateBiggerAndSmallerAssociations(t,e),1):r.getNode()===e?(this._updateBiggerAndSmallerAssociations(t,e),1):this.compare(o.getNode(),e)}if(t.getType()===y.NORMAL&&e.getType()===y.LONG_EDGE){let o=this._getFirstIncomingSourcePortOfNode(e),r=this._getFirstOutgoingTargetPortOfNode(e);if(o==null||r==null)return 0;let i=t.getLayer().id;return o.getNode().getLayer().id!==i&&r.getNode().getLayer().id!==i?0:o.getNode()===t?(this._updateBiggerAndSmallerAssociations(e,t),-1):r.getNode()===t?(this._updateBiggerAndSmallerAssociations(e,t),-1):this.compare(t,o.getNode())}if(t.getType()===y.LONG_EDGE&&e.getType()===y.LONG_EDGE){let o=this._getFirstIncomingSourcePortOfNode(t),r=this._getFirstOutgoingTargetPortOfNode(t),i=this._getFirstIncomingSourcePortOfNode(e),s=this._getFirstOutgoingTargetPortOfNode(e);if(o==null||r==null||i==null||s==null)return 0;let a=t.getLayer().id,l=e.getLayer().id,c=t,g=e;if(o.getNode().getLayer().id===a?c=o.getNode():r.getNode().getLayer().id===a&&(c=r.getNode()),i.getNode().getLayer().id===l?g=i.getNode():s.getNode().getLayer().id===l&&(g=s.getNode()),c===g)for(let h of c.getPorts()){if(h===o)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(h===i)return this._updateBiggerAndSmallerAssociations(t,e),1}return this.compare(c,g)}return 0}_getFirstIncomingSourcePortOfNode(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0)return e.getIncomingEdges()[0].getSource();return null}_getFirstOutgoingTargetPortOfNode(t){for(let e of t.getPorts())if(e.getOutgoingEdges().length>0)return e.getOutgoingEdges()[0].getTarget();return null}clearTransitiveOrdering(){this._biggerThan=new Map,this._smallerThan=new Map}};var jh=class n{process(t,e){e&&e.begin&&e.begin("Sort By Input Model "+t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),1);let o=0;for(let r of t.getLayers()){r.id=o;let i=o===0?0:o-1,s=t.getLayers()[i],a=new nl(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY),!0);n.insertionSort(r.getNodes(),a);for(let l of r.getNodes()){let c=l.getProperty(_.PORT_CONSTRAINTS);c!==H.FIXED_ORDER&&c!==H.FIXED_POS&&l.getPorts().sort((g,h)=>new Zh(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),n.longEdgeTargetNodePreprocessing(l),t.getProperty(_.CONSIDER_MODEL_ORDER_PORT_MODEL_ORDER)).compare(g,h))}a=new nl(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY),!1),n.insertionSort(r.getNodes(),a),o++}e&&e.done&&e.done()}static longEdgeTargetNodePreprocessing(t){let e=new Map;if(t.hasProperty(p.TARGET_NODE_MODEL_ORDER))return t.getProperty(p.TARGET_NODE_MODEL_ORDER);for(let o of t.getPorts()){if(o.getOutgoingEdges().length===0)continue;let r=n.getTargetNode(o);if(o.setProperty(p.LONG_EDGE_TARGET_NODE,r),r!=null){let i=o.getOutgoingEdges()[0];if(!i.getProperty(p.REVERSED)){let s=e.has(r)?e.get(r):Number.MAX_SAFE_INTEGER;e.set(r,Math.min(i.getProperty(p.MODEL_ORDER),s))}}}return t.setProperty(p.TARGET_NODE_MODEL_ORDER,e),e}static getTargetNode(t){let e=null,o=t.getOutgoingEdges()[0];do{if(e=o.getTarget().getNode(),e.hasProperty(p.LONG_EDGE_TARGET))return e.getProperty(p.LONG_EDGE_TARGET).getNode();if(e.getType()!==y.NORMAL){let i=e.getOutgoingEdges()[Symbol.iterator]().next();if(!i.done)o=i.value;else return null}}while(e!=null&&e.getType()!==y.NORMAL);return e}static insertionSort(t,e){for(let o=1;o<t.length;o++){let r=t[o],i=o;for(;i>0&&e.compare(t[i-1],r)>0;)t[i]=t[i-1],i--;t[i]=r}e.clearTransitiveOrdering()}};var $h=class{process(t,e){e.begin("Alternating layer unzipping",1);let o=1,r=[],i=t.getLayers();for(let s=0;s<i.length;s++){let a=i[s],l=Yy(a),c=Vy(a);if(Xy(a)){let h=0,d=0;for(let f of a)h=Math.max(h,f.getSize().x),d+=f.getSize().y;if(d/=a.getNodes().length,h+=Math.max(2*t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),Math.max(a.getNodes().length*t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS))),d+=Math.max(t.getProperty(_.SPACING_NODE_NODE),t.getProperty(_.SPACING_EDGE_NODE)),h/d>=a.getNodes().length/4)continue}if(a.getNodes().length>l){let h=[a];for(let f=0;f<l-1;f++){let E=new Et(t);r.push([E,s+f+o]),h.push(E)}o+=l-1;let d=h[0].getNodes().length;for(let f=0,E=0,P=0;f<d;f++,E++,P++){let S=h[0].getNodes()[E];S.getType()!==y.NONSHIFTING_PLACEHOLDER?E+=Ky(t,h,P%l,E):(f--,P--),c&&S.getType()===y.LONG_EDGE&&(P=-1)}}}for(let[s,a]of r)i.splice(a,0,s);for(let s of i){let a=s.getNodes();for(let l=a.length-1;l>=0;l--){let c=a[l].getType();(c===y.PLACEHOLDER||c===y.NONSHIFTING_PLACEHOLDER)&&a.splice(l,1)}}e.done()}};function Yy(n){let t=Number.MAX_SAFE_INTEGER,e=!0;for(let o of n)if(o.hasProperty(_.LAYER_UNZIPPING_LAYER_SPLIT)){e=!1;let r=o.getProperty(_.LAYER_UNZIPPING_LAYER_SPLIT);r<t&&(t=r)}return e?_.LAYER_UNZIPPING_LAYER_SPLIT.getDefault():t}function Vy(n){for(let t of n)if(t.hasProperty(_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES)&&!t.getProperty(_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES))return!1;return!0}function Xy(n){for(let t of n)if(t.hasProperty(_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH)&&t.getProperty(_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH))return!0;return!1}function Ky(n,t,e,o){let r=t[0].getNodes()[o];e>0&&r.setLayer(t[e]);let i=0,s=!0,a=[...r.getIncomingEdges()].reverse();for(let c of a){s=!1;let g=c;for(let h=0;h<e;h++){let d=SP(n,g);o+i>t[h].getNodes().length?d.setLayer(t[h]):d.setLayer(o+i,t[h]),g=ri.splitEdge(g,d)}e>0&&i++}if(s){for(let c=0;c<e;c++){let g=new ft(n);g.setType(y.PLACEHOLDER),o+i>t[c].getNodes().length?g.setLayer(t[c]):g.setLayer(o+i,t[c])}e>0&&i++}let l=!1;for(let c of r.getOutgoingEdges()){let g=c;for(let h=e+1;h<t.length;h++){let d=SP(n,g);d.setLayer(t[h]),g=ri.splitEdge(g,d)}for(let h=0;h<=e;h++)if(l){let d=new ft(n);d.setType(y.NONSHIFTING_PLACEHOLDER),o+1>t[h].getNodes().length?d.setLayer(t[h]):d.setLayer(o+1,t[h])}l&&i++,l=!0}return i>0?i-1:0}function SP(n,t){let e=new ft(n);return e.setType(y.LONG_EDGE),e.setProperty(p.ORIGIN,t),e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),e}var ro=class{constructor(t){this._name=t}toString(){return this._name}};ro.ARD=new ro("ARD");ro.MSD=new ro("MSD");ro.MANUAL=new ro("MANUAL");var io=class{constructor(t){this._name=t}toString(){return this._name}};io.NO=new io("NO");io.GREEDY=new io("GREEDY");io.LOOK_BACK=new io("LOOK_BACK");var kn=class{constructor(t){this.graph=t;let e=t.getProperty(_.DIRECTION),o=t.getProperty(_.ASPECT_RATIO),r=t.getProperty(_.WRAPPING_CORRECTION_FACTOR);e===R.LEFT||e===R.RIGHT||e===R.UNDEFINED||e==null?this.dar=o*r:this.dar=1/(o*r),this._spacing=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._inLayerSpacing=t.getProperty(_.SPACING_NODE_NODE),this.longestPath=t.getLayers().length,this._maxWidth=null,this._maxHeight=null,this._sumWidth=null,this._widths=null,this._heights=null,this._cutsAllowed=null}getApproximateLayerWidth(t){return this._determineLayerWidth(t)}getApproximateLayeringWidth(){return this.getSumWidth()}getApproximateChunkBasedLayeringWidth(t){if(t.length===0)return this.getApproximateLayeringWidth();let e=0,o=0;for(let r of t)e=Math.max(e,this._determineChunkWidth(o,r)),o=r;return e=Math.max(e,this._determineChunkWidth(o,this.graph.getLayers().length)),e}getApproximateLayerHeight(t){return this._determineLayerHeight(t)}getApproximateLayeringHeight(){return this.getMaxHeight()}getApproximateChunkBasedLayeringHeight(t){if(t.length===0)return 0;let e=0,o=0;for(let r of t)e+=this._determineChunkHeight(o,r),o=r;return e+=this._determineChunkHeight(o,this.graph.getLayers().length),e}getMaxWidth(){return this._maxWidth==null&&(this._maxWidth=this._determineWidth((t,e)=>Math.max(t,e))),this._maxWidth}getSumWidth(){return this._sumWidth==null&&(this._sumWidth=this._determineWidth((t,e)=>t+e)),this._sumWidth}getWidths(){return this._widths==null&&this._initWidthsAndHeights(),this._widths}_initWidthsAndHeights(){let t=this.longestPath;this._widths=new Array(t),this._heights=new Array(t);for(let e=0;e<t;e++){let o=this.graph.getLayers()[e];this._widths[e]=this._determineLayerWidth(o),this._heights[e]=this._determineLayerHeight(o)}}_determineWidth(t){let e=this.graph.getLayers();if(e.length===0)return 0;let o=this._determineLayerWidth(e[0]);for(let r=1;r<e.length;r++)o=t(o,this._determineLayerWidth(e[r]));return o}_determineLayerWidth(t){let e=0;for(let o of t.getNodes()){let r=o.getSize().x+o.getMargin().right+o.getMargin().left+this._spacing;r>e&&(e=r)}return e}_determineChunkWidth(t,e){let o=0,r=this.graph.getLayers();for(let i=t;i<e;i++)o+=this._determineLayerWidth(r[i]);return o}getMaxHeight(){return this._maxHeight==null&&(this._maxHeight=this._determineHeight((t,e)=>Math.max(t,e))),this._maxHeight}getHeights(){return this._heights==null&&this._initWidthsAndHeights(),this._heights}_determineHeight(t){let e=this.graph.getLayers();if(e.length===0)return 0;let o=this._determineLayerHeight(e[0]);for(let r=1;r<e.length;r++)o=t(o,this._determineLayerHeight(e[r]));return o}_determineLayerHeight(t){let e=0;for(let o of t.getNodes()){e+=o.getSize().y+o.getMargin().bottom+o.getMargin().top+this._inLayerSpacing;for(let r of o.getIncomingEdges())if(r.getSource().getNode().getType()===y.NORTH_SOUTH_PORT){let s=r.getSource().getNode().getProperty(p.ORIGIN);s!=null&&(e+=s.getSize().y+s.getMargin().bottom+s.getMargin().top)}}return e}_determineChunkHeight(t,e){let o=this.graph.getLayers(),r=0;for(let i=t;i<e;i++){let s=this._determineLayerHeight(o[i]);s>r&&(r=s)}return r}isCutAllowed(t){return this._cutsAllowed==null&&this._initCutAllowed(),this._cutsAllowed[t]}getCutsAllowed(){return this._cutsAllowed==null&&this._initCutAllowed(),this._cutsAllowed}_initCutAllowed(){if(this._cutsAllowed=new Array(this.graph.getLayers().length).fill(!0),this._cutsAllowed[0]=!1,this.graph.hasProperty(_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES)){let t=this.graph.getProperty(_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES);for(let e of t)e>0&&e<this._cutsAllowed.length&&(this._cutsAllowed[e]=!1)}else{let t=this.graph.getLayers();for(let e=1;e<t.length;e++)this._cutsAllowed[e]=Zy(t[e])}}};function Zy(n){let t=null,e=null;for(let o of n.getNodes())for(let r of o.getIncomingEdges()){if(t!=null&&t!==o)return!1;t=o;let i=r.getSource().getNode();if(e!=null&&e!==i)return!1;e=i}return!0}var Wn=class{getCutIndexes(t,e){let o=t.getProperty(_.WRAPPING_CUTTING_CUTS);return o!=null?o:[]}guaranteeValid(){return!1}};var Fi=class n{getCutIndexes(t,e){let o=n.getChunkCount(e),r=[],i=e.longestPath/o;for(let s=1;s<o;s++)r.push(Math.round(s*i));return r}static getChunkCount(t){let e=Math.sqrt(t.getSumWidth()/(t.dar*t.getMaxHeight())),o=Math.round(e);return o=Math.min(o,t.longestPath),o}guaranteeValid(){return!1}};var zn=class{guaranteeValid(){return!1}getCutIndexes(t,e){let o=e.getWidths(),r=e.getHeights(),i=new Array(o.length);i[0]=o[0];let s=o[0];for(let h=1;h<o.length;h++)i[h]=i[h-1]+o[h],s+=o[h];let a=Fi.getChunkCount(e)-1,l=t.getProperty(_.WRAPPING_CUTTING_MSD_FREEDOM),c=Number.NEGATIVE_INFINITY,g=[];for(let h=Math.max(0,a-l);h<=Math.min(e.longestPath-1,a+l);h++){let d=s/(h+1),f=0,E=1,P=[],S=Number.NEGATIVE_INFINITY,T=0,N=0,I=r[0];if(h===0)S=s,N=e.getMaxHeight();else{for(;E<e.longestPath;)i[E-1]-f>=d&&(P.push(E),S=Math.max(S,i[E-1]-T),N+=I,f+=i[E-1]-f,T=i[E-1],I=r[E]),I=Math.max(I,r[E]),E++;N+=I}let C=Math.min(1/S,1/e.dar/N);C>c&&(c=C,g=P)}return g}};var Yn=class{static insertDummies(t,e,o){let r=t.getProperty(_.SPACING_EDGE_NODE),i=t.getProperty(_.WRAPPING_ADDITIONAL_EDGE_SPACING),s=new bo;s.setProperty(_.SPACING_EDGE_NODE,r+i);let a=e,l=a.getTarget(),c=a.getSource().getNode(),g=a.getTarget().getNode(),h=c.getLayer().getIndex(),d=g.getLayer().getIndex(),f=[];for(let E=h;E<=d;E++){let P=new ft(t);P.setType(y.LONG_EDGE),P.setProperty(p.ORIGIN,a),P.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),P.setProperty(_.SPACING_INDIVIDUAL,s);let S=t.getLayers()[E];E===h?P.setLayer(S.getNodes().length-o,S):P.setLayer(S);let T=a.getProperty(_.EDGE_THICKNESS);T<0&&(T=0,a.setProperty(_.EDGE_THICKNESS,T)),P.getSize().y=T;let N=Math.floor(T/2),I=new rt;I.setSide(u.WEST),I.setNode(P),I.getPosition().y=N;let C=new rt;C.setSide(u.EAST),C.setNode(P),C.getPosition().y=N,a.setTarget(I);let x=new _e;x.copyProperties(a),x.setProperty(_.JUNCTION_POINTS,null),x.setSource(C),x.setTarget(l),jy(P,a,x),f.push(x),a=x}return f}};function jy(n,t,e){let o=t.getSource().getNode();o.getType()===y.LONG_EDGE?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET))):(n.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),n.setProperty(p.LONG_EDGE_TARGET,e.getTarget()))}var xs=class n{process(t,e){if(e.begin("Path-Like Graph Wrapping",1),t.getLayers().length===0){e.done();return}let o=new kn(t),i=o.getMaxWidth()*o.longestPath/o.getMaxWidth();if(o.dar>i){e.done();return}let s;switch(t.getProperty(_.WRAPPING_CUTTING_STRATEGY)){case ro.MANUAL:s=new Wn;break;case ro.ARD:s=new Fi;break;default:s=new zn}let a=s.getCutIndexes(t,o);if(!s.guaranteeValid())switch(t.getProperty(_.WRAPPING_VALIDIFY_STRATEGY)){case io.LOOK_BACK:a=n.validifyIndexesLookingBack(o,a);break;case io.GREEDY:a=n.validifyIndexesGreedily(o,a);break;default:}qy(t,o,a),e.done()}static validifyIndexesGreedily(t,e){let o=[],r=0;for(let i of e){let s=i+r;for(;s<t.longestPath&&!t.isCutAllowed(s);)s++,r++;if(s>=t.longestPath)break;o.push(s)}return o}static validifyIndexesLookingBack(t,e){if(e.length===0)return[];let o=[];o.push(Number.NEGATIVE_INFINITY);for(let r=1;r<t.longestPath;r++)t.isCutAllowed(r)&&o.push(r);return o.length===1?[]:(o.push(Number.POSITIVE_INFINITY),$y(e,o))}};function $y(n,t){let e=[],o=0,r=0,i=0;for(;o<t.length-1&&r<n.length;){let s=n[r]+i;for(;t[o+1]<s;)o++;let a=0,l=s-t[o],c=t[o+1]-s;l>c&&a++;let g=t[o+a];for(e.push(g),i+=g-s,r++;r<n.length&&n[r]+i<=g;)r++;o+=1+a}return e}function qy(n,t,e){if(e.length===0)return;let o=0,r=0,i=0,s=e[i++];for(;o<t.longestPath;){if(o===s&&(r=0,i<e.length?s=e[i++]:s=t.longestPath+1),o!==r){let l=n.getLayers()[o],c=n.getLayers()[r],g=l.getNodes().slice();for(let h of g)if(h.setLayer(c.getNodes().length,c),r===0){let d=[...h.getIncomingEdges()];for(let f of d)f.reverse(n,!0),n.setProperty(p.CYCLIC,!0),Yn.insertDummies(n,f,1)}}r++,o++}let a=n.getLayers();for(let l=a.length-1;l>=0;l--)a[l].getNodes().length===0&&a.splice(l,1)}var qh=class{process(t,e){e.begin("Breaking Point Insertion",1);let o=new kn(t),r;switch(t.getProperty(_.WRAPPING_CUTTING_STRATEGY)){case ro.MANUAL:r=new Wn;break;case ro.ARD:r=new Fi;break;default:r=new zn}let i=r.getCutIndexes(t,o);if(t.getProperty(_.WRAPPING_MULTI_EDGE_IMPROVE_CUTS)&&(i=Qy(t,i)),!r.guaranteeValid()&&t.hasProperty(_.WRAPPING_VALIDIFY_STRATEGY))switch(t.getProperty(_.WRAPPING_VALIDIFY_STRATEGY)){case io.LOOK_BACK:i=xs.validifyIndexesLookingBack(o,i);break;case io.GREEDY:i=xs.validifyIndexesGreedily(o,i);break;default:}if(i.length===0){e.done();return}Jy(t,i),e.done()}},vr=class{constructor(t,e,o,r,i){this.start=t,this.end=e,this.nodeStartEdge=o,this.startEndEdge=r,this.originalEdge=i,this.startInLayerDummy=null,this.startInLayerEdge=null,this.endInLayerDummy=null,this.endInLayerEdge=null,this.prev=null,this.next=null}static isStart(t){let e=t.getProperty(p.BREAKING_POINT_INFO);return e!=null&&e.start===t}static isEnd(t){let e=t.getProperty(p.BREAKING_POINT_INFO);return e!=null&&e.end===t}};function Jy(n,t){let e=n.getLayers(),o=0,r=t[o++],i=0,s=new Set,a=new Set,l=0,c=0;for(;l<e.length;){let g=e[l];for(let h of g){for(let d of h.getOutgoingEdges())a.add(d);for(let d of h.getIncomingEdges())a.delete(d)}if(c+1===r){let h=new Et(n),d=new Et(n);e.splice(l+1,0,h,d),l+=2;for(let f of a){s.has(f)||(i++,s.add(f));let E=new ft(n);E.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),E.setLayer(h),E.setType(y.BREAKING_POINT);let P=new rt;P.setNode(E),P.setSide(u.WEST);let S=new rt;S.setNode(E),S.setSide(u.EAST);let T=new ft(n);T.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),T.setLayer(d),T.setType(y.BREAKING_POINT);let N=new rt;N.setNode(T),N.setSide(u.WEST);let I=new rt;I.setNode(T),I.setSide(u.EAST);let C=new _e;C.setSource(f.getSource()),C.setTarget(P),C.setProperty(p.MODEL_ORDER,f.getProperty(p.MODEL_ORDER));let x=new _e;x.setSource(S),x.setTarget(N),x.setProperty(p.MODEL_ORDER,f.getProperty(p.MODEL_ORDER)),f.setSource(I);let M=new vr(E,T,C,x,f);E.setProperty(p.BREAKING_POINT_INFO,M),T.setProperty(p.BREAKING_POINT_INFO,M);let A=C.getSource().getNode();if(A.getType()===y.BREAKING_POINT){let B=A.getProperty(p.BREAKING_POINT_INFO);B.next=M,M.prev=B}}if(o<t.length)r=t[o++];else break}c++,l++}return i}function Qy(n,t){let e=[],o=[],r=null;for(let s of t){let a=new I_(s);o.push(a),r!=null&&(a.prev=r,r.suc=a),r=a}let i=eI(n);for(let s=0;s<o.length;s++){let a=null,l=o[0].selfOrNext(),c=null,g=Number.POSITIVE_INFINITY;for(let h=1;h<n.getLayers().length;h++){let d,f=l!=null?Math.abs(l.index-h):Math.abs(h-a.index)+1,E=a!=null?Math.abs(h-a.index):f+1,P;E<f?(d=a,P=E):(d=l,P=f);let S=tI(n,h,i[h],P);S<g&&(g=S,c=d,c.newIndex=h),l!=null&&h===l.index&&(a=l,l=l.next())}c!=null&&(e.push(c.newIndex),c.assigned=!0,c.offset())}return e.sort((s,a)=>s-a),e}function tI(n,t,e,o){let r=n.getProperty(_.WRAPPING_MULTI_EDGE_DISTANCE_PENALTY);return e+Math.pow(o,r)}function eI(n){let t=new Array(n.getLayers().length+1).fill(0),e=new Set,o=0;for(let r of n.getLayers()){t[o++]=e.size;for(let i of r.getNodes())for(let s of i.getOutgoingEdges())e.add(s);for(let i of r.getNodes())for(let s of i.getIncomingEdges())e.delete(s)}return t}var I_=class{constructor(t){this.index=t,this.newIndex=t,this.prev=null,this.suc=null,this.assigned=!1}selfOrNext(){return this.assigned?this.suc!=null?this.suc.selfOrNext():null:this}next(){return this.suc!=null?this.suc.selfOrNext():null}offset(){if(!this.assigned)throw new Error("Cannot offset an unassigned cut.");let t=this.newIndex-this.index;this._offset(t),this._offsetPrev(t),this._offsetSuc(t)}_offset(t){this.index+=t}_offsetPrev(t){this.prev!=null&&!this.prev.assigned&&(this.prev._offset(t),this.prev._offsetPrev(t))}_offsetSuc(t){this.suc!=null&&!this.suc.assigned&&(this.suc._offset(t),this.suc._offsetSuc(t))}};var Qh=class{process(t,e){if(e.begin("Breaking Point Processor",1),oI(t),t.getProperty(_.WRAPPING_MULTI_EDGE_IMPROVE_WRAPPED_EDGES)){for(let o of t.getLayers()){let r=0;for(let i of o.getNodes())i.id=r++}rI(t),TP(t,!0),TP(t,!1)}e.done()}};function oI(n){let t=n.getLayers();t.unshift(new Et(n));let e=!1,o=1,r=0;for(;r<t.length;){let i=t[r],s=t[o],a=i.getNodes().slice(),l=a.length;for(let c of a)c.setLayer(s);if(e){let c=a.slice().reverse();for(let g of c){let h=[...g.getIncomingEdges()];for(let d of h){d.reverse(n,!0),n.setProperty(p.CYCLIC,!0);let f=Yn.insertDummies(n,d,l),E=g.getProperty(p.BREAKING_POINT_INFO),P=f[f.length-1];E.startInLayerDummy=P.getSource().getNode(),E.startInLayerEdge=P,E.endInLayerDummy=d.getTarget().getNode(),E.endInLayerEdge=d}}e=!1}else a.length>0&&a[0].getType()===y.BREAKING_POINT&&(e=!0,o=-1);o++,r++}for(let i=t.length-1;i>=0;i--)t[i].getNodes().length===0&&t.splice(i,1)}function rI(n){for(let t of n.getLayers()){let e=t.getNodes().slice();for(let o of e){if(!vr.isStart(o))continue;let r=o.getProperty(p.BREAKING_POINT_INFO);if(r.prev!=null||r.next==null)continue;let i=r,s=r.next;for(;s!=null;){NP(s.start,s.startInLayerDummy,!1,!0),Vn(i.end),Vn(s.start),Vn(s.startInLayerDummy),Vn(s.endInLayerDummy),s.endInLayerEdge.setTarget(i.endInLayerEdge.getTarget()),i.endInLayerEdge.setTarget(null),i.end.setLayer(null),s.start.setLayer(null),s.startInLayerDummy.setLayer(null),s.endInLayerDummy.setLayer(null);let a=new vr(i.start,s.end,i.nodeStartEdge,s.startEndEdge,s.originalEdge);a.startInLayerDummy=i.startInLayerDummy,a.startInLayerEdge=i.startInLayerEdge,a.endInLayerDummy=i.endInLayerDummy,a.endInLayerEdge=s.endInLayerEdge,a.prev=i.prev,a.next=s.next,i.start.setProperty(p.BREAKING_POINT_INFO,a),s.end.setProperty(p.BREAKING_POINT_INFO,a),s=s.next,i=a}}}}function TP(n,t){let e=t?r=>vr.isEnd(r):r=>vr.isStart(r),o;do{o=!1;let r=t?n.getLayers().slice().reverse():n.getLayers();for(let i of r){let s=i.getNodes().slice();for(let a of s){if(!e(a))continue;let l=a.getProperty(p.BREAKING_POINT_INFO),c=t?l.endInLayerDummy:l.startInLayerDummy;NP(a,c,t,!1)&&(o=!0)}}}while(o)}function NP(n,t,e,o){let r=Jh(n,e),i=Jh(t,e),s=!1;for(;r!=null&&i!=null&&!(!o&&!iI(r,i,e));){let a=Jh(r,e),l=Jh(i,e);Vn(t),Vn(n);let c=r.getLayer();ii.joinAt(r,!1),ii.joinAt(i,!1),e?(t.setLayer(i.id,c),t.id=i.id,n.setLayer(r.id+1,c),n.id=r.id):(n.setLayer(r.id,c),n.id=r.id,t.setLayer(i.id+1,c),t.id=i.id),r.setLayer(null),i.setLayer(null),r=a,i=l,s=!0}return s}function iI(n,t,e){let o=n.getLayer(),r=e?t:n,i=e?n:t;for(let s=r.id+1;s<i.id;s++){let a=o.getNodes()[s];if(!(a.getType()===y.BREAKING_POINT||sI(a)))return!1}return!0}function Jh(n,t){let e=t?n.getOutgoingEdges():n.getIncomingEdges();for(let o of e){let r=o.getOther(n);if(r.getType()===y.LONG_EDGE&&r.getLayer()!==n.getLayer())return r}return null}function sI(n){if(n.getType()!==y.LONG_EDGE)return!1;for(let t of n.getConnectedEdges())if(!t.isSelfLoop()&&n.getLayer()===t.getOther(n).getLayer())return!0;return!1}function Vn(n){let t=n.getLayer();if(t==null)return;let e=t.getNodes();for(let o=n.id+1;o<e.length;o++)e[o].id--}var td=class{constructor(){this._edgeRouting=null}process(t,e){e.begin("Breaking Point Removing",1),this._edgeRouting=t.getProperty(_.EDGE_ROUTING);for(let o of t.getLayers()){let r=o.getNodes().slice();for(let i of r){if(!vr.isEnd(i))continue;let s=i.getProperty(p.BREAKING_POINT_INFO);s.next==null&&this._remove(t,s)}}e.done()}_remove(t,e){let o=new st;switch(this._edgeRouting){case At.SPLINES:{let l=e.nodeStartEdge.getProperty(p.SPLINE_ROUTE_START),c=e.startEndEdge.getProperty(p.SPLINE_ROUTE_START),g=e.originalEdge.getProperty(p.SPLINE_ROUTE_START),h=e.nodeStartEdge.getProperty(p.SPLINE_EDGE_CHAIN),d=e.startEndEdge.getProperty(p.SPLINE_EDGE_CHAIN),f=e.originalEdge.getProperty(p.SPLINE_EDGE_CHAIN),E=[];if(l&&E.push(...l),c){for(let S of c)S.inverseOrder=!0;E.push(...[...c].reverse())}g&&E.push(...g);let P=[];h&&P.push(...h),d&&P.push(...[...d].reverse()),f&&P.push(...f),e.originalEdge.setProperty(p.SPLINE_ROUTE_START,E),e.originalEdge.setProperty(p.SPLINE_EDGE_CHAIN,P),e.originalEdge.setProperty(p.SPLINE_SURVIVING_EDGE,e.originalEdge),e.nodeStartEdge.setProperty(p.SPLINE_ROUTE_START,null),e.nodeStartEdge.setProperty(p.SPLINE_EDGE_CHAIN,null),e.startEndEdge.setProperty(p.SPLINE_ROUTE_START,null),e.startEndEdge.setProperty(p.SPLINE_EDGE_CHAIN,null);break}case At.POLYLINE:{for(let c of e.nodeStartEdge.getBendPoints())o.add(c);o.add(e.start.getPosition());let l=[...e.startEndEdge.getBendPoints()].reverse();for(let c of l)o.add(c);o.add(e.end.getPosition());for(let c of e.originalEdge.getBendPoints())o.add(c);break}default:{for(let c of e.nodeStartEdge.getBendPoints())o.add(c);let l=[...e.startEndEdge.getBendPoints()].reverse();for(let c of l)o.add(c);for(let c of e.originalEdge.getBendPoints())o.add(c)}}let r=e.originalEdge.getBendPoints();r.length=0;for(let l of o)r.add(l);e.originalEdge.setSource(e.nodeStartEdge.getSource());let i=e.nodeStartEdge.getProperty(_.JUNCTION_POINTS),s=e.startEndEdge.getProperty(_.JUNCTION_POINTS),a=e.originalEdge.getProperty(_.JUNCTION_POINTS);if(i!=null||s!=null||a!=null){let l=new st;R_(l,a),R_(l,s),R_(l,i),e.originalEdge.setProperty(_.JUNCTION_POINTS,l)}e.startEndEdge.setSource(null),e.startEndEdge.setTarget(null),e.nodeStartEdge.setSource(null),e.nodeStartEdge.setTarget(null),e.end.setLayer(null),e.start.setLayer(null),e.prev!=null&&this._remove(t,e.prev)}};function R_(n,t){if(n==null||t==null)return!1;for(let e of t)n.add(e);return!0}var tr=class{constructor(){this.id=0,this.master=null,this.cNodes=new Set,this.startPos=Number.NEGATIVE_INFINITY,this.incomingConstraints=new Set,this.outDegree=0,this.outDegreeReal=0,this.reference=null,this.delta=0,this.deltaNormalized=0}static of(){return new L_}addCNode(t){if(t.cGroup!=null)throw new Error("CNode belongs to another CGroup.");this.cNodes.add(t),t.cGroup=this,this.reference==null&&(this.reference=t)}removeCNode(t){let e=this.cNodes.delete(t);return e&&(t.cGroup=null),e}},L_=class{constructor(){this.group=new tr}nodes(...t){for(let e of t)this.group.addCNode(e);return this}reference(t){return this.group.reference=t,this}master(t){return this.group.master=t,this}create(t){return t.cGroups.push(this.group),this.group}};var ed=class{compact(t){let e=Number.POSITIVE_INFINITY;for(let r of t.cGraph.cNodes)e=Math.min(e,r.cGroup.reference.hitbox.x+r.cGroupOffset.x);let o=[];for(let r of t.cGraph.cGroups)r.startPos=e,r.outDegree===0&&o.push(r);for(;o.length>0;){let r=o.shift(),i=r.reference.hitbox.x;for(let s of r.cNodes){let a=r.startPos+s.cGroupOffset.x;!t.isLocked(r,t.direction)||s.hitbox.x<a?s.startPos=a:s.startPos=s.hitbox.x}i-=r.reference.startPos,r.delta+=i,t.direction===R.RIGHT||t.direction===R.DOWN?r.deltaNormalized+=i:r.deltaNormalized-=i;for(let s of r.cNodes)for(let a of s.constraints){let l;t.direction.isHorizontal()?l=t.spacingsHandler.getHorizontalSpacing(s,a):l=t.spacingsHandler.getVerticalSpacing(s,a),a.cGroup.startPos=Math.max(a.cGroup.startPos,s.startPos+s.hitbox.width+l-a.cGroupOffset.x),t.isLocked(a,t.direction)&&(a.cGroup.startPos=Math.max(a.cGroup.startPos,a.hitbox.x-a.cGroupOffset.x)),a.cGroup.outDegree--,a.cGroup.outDegree===0&&o.push(a.cGroup)}}for(let r of t.cGraph.cNodes)r.hitbox.x=r.startPos}};var ne=class{};ne.TOLERANCE=1e-4;function od(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}ne.eq=(n,t)=>Math.abs(n-t)<=ne.TOLERANCE;ne.gt=(n,t)=>od(n,t,ne.TOLERANCE)>0;ne.lt=(n,t)=>od(n,t,ne.TOLERANCE)<0;ne.ge=(n,t)=>od(n,t,ne.TOLERANCE)>=0;ne.le=(n,t)=>od(n,t,ne.TOLERANCE)<=0;var rd=class{constructor(t,e){this.node=t,this.low=e}},A_=class n{constructor(){this._items=[]}static _key(t){return t.hitbox.x+t.hitbox.width/2}add(t){let e=n._key(t);for(let o=0;o<this._items.length;o++){let r=n._key(this._items[o]);if(r===e)return!1;if(r>e)return this._items.splice(o,0,t),!0}return this._items.push(t),!0}lower(t){let e=n._key(t),o=null;for(let r of this._items)if(n._key(r)<e)o=r;else break;return o}floor(t){let e=n._key(t),o=null;for(let r of this._items)if(n._key(r)<=e)o=r;else break;return o}higher(t){let e=n._key(t);for(let o of this._items)if(n._key(o)>e)return o;return null}ceiling(t){let e=n._key(t);for(let o of this._items)if(n._key(o)>=e)return o;return null}remove(t){let e=this._items.indexOf(t);return e>=0?(this._items.splice(e,1),!0):!1}clear(){this._items.length=0}},Xn=class n{constructor(){this.compactor=null,this._scanlineHandler=new C_(this)}calculateConstraints(t){this.compactor=t,this._sweep(()=>!0)}_sweep(t){let e=[];for(let o of this.compactor.cGraph.cNodes)t(o)&&(e.push(new rd(o,!0)),e.push(new rd(o,!1)));this._scanlineHandler.reset(),Zo.execute(e,n._compareTimestamps,this._scanlineHandler)}static _compareTimestamps(t,e){let o=t.node.hitbox.y;t.low||(o+=t.node.hitbox.height);let r=e.node.hitbox.y;e.low||(r+=e.node.hitbox.height);let i=o-r;if(i===0){if(!t.low&&e.low)return-1;if(!e.low&&t.low)return 1}return i}},C_=class{constructor(t){this._owner=t,this._intervals=new A_,this._cand=[]}reset(){this._intervals.clear();let t=this._owner.compactor.cGraph.cNodes;this._cand=new Array(t.length).fill(null);let e=0;for(let o of t)o.id=e++}handle(t){t.low?this._insert(t):this._delete(t)}_insert(t){if(!this._intervals.add(t.node))throw new Error("Invalid hitboxes for scanline constraint calculation.");this._overlap(t.node,this._intervals.floor(t.node))||this._overlap(t.node,this._intervals.ceiling(t.node)),this._cand[t.node.id]=this._intervals.lower(t.node);let o=this._intervals.higher(t.node);o!=null&&(this._cand[o.id]=t.node)}_delete(t){let e=this._intervals.lower(t.node);e!=null&&e===this._cand[t.node.id]&&e.cGroup!=null&&e.cGroup!==t.node.cGroup&&e.constraints.push(t.node);let o=this._intervals.higher(t.node);o!=null&&this._cand[o.id]===t.node&&o.cGroup!=null&&o.cGroup!==t.node.cGroup&&t.node.constraints.push(o),this._intervals.remove(t.node)}_overlap(t,e){return t==null||e==null||t===e?!1:ne.le(t.hitbox.x,e.hitbox.x+e.hitbox.width)&&ne.le(e.hitbox.x,t.hitbox.x+t.hitbox.width)}};var id=class{calculateConstraints(t){for(let e of t.cGraph.cNodes)e.constraints.length=0;for(let e of t.cGraph.cNodes)for(let o of t.cGraph.cNodes){if(e===o||e.cGroup!=null&&e.cGroup===o.cGroup)continue;let r;t.direction.isHorizontal()?r=t.spacingsHandler.getVerticalSpacing(e,o):r=t.spacingsHandler.getHorizontalSpacing(e,o),(o.hitbox.x>e.hitbox.x||e.hitbox.x===o.hitbox.x&&e.hitbox.width<o.hitbox.width)&&ne.gt(o.hitbox.y+o.hitbox.height+r,e.hitbox.y)&&ne.lt(o.hitbox.y,e.hitbox.y+e.hitbox.height+r)&&e.constraints.push(o)}}};var x_=Object.freeze({getHorizontalSpacing:()=>0,getVerticalSpacing:()=>0}),Vq=Object.freeze({DEFAULT_SPACING_HANDLER:x_});var Br=class n{constructor(t){this.cGraph=t,this.compactionAlgorithm=n.LONGEST_PATH_COMPACTION,this.constraintAlgorithm=n.SCANLINE_CONSTRAINTS,this.lockFun=null,this.spacingsHandler=x_,this.direction=R.UNDEFINED,this._finished=!1,this.calculateGroupOffsets();for(let e of t.cNodes)e.cGroup==null&&tr.of().nodes(e).create(t),e.hitboxPreCompaction=new dt(e.hitbox)}setSpacingsHandler(t){return this.spacingsHandler=t,this}setCompactionAlgorithm(t){return this.compactionAlgorithm=t,this}setConstraintAlgorithm(t){return this.constraintAlgorithm=t,this}compact(){if(this._finished)throw new Error("The OneDimensionalCompactor instance has been finished already.");this.direction===R.UNDEFINED&&this.changeDirection(R.LEFT);for(let t of this.cGraph.cGroups)t.outDegree=t.outDegreeReal;for(let t of this.cGraph.cNodes)t.startPos=Number.NEGATIVE_INFINITY;return this.compactionAlgorithm.compact(this),this}finish(){return this.changeDirection(R.LEFT),this._finished=!0,this}changeDirection(t){if(this._finished)throw new Error("The OneDimensionalCompactor instance has been finished already.");if(!this.cGraph.supports(t))throw new Error(`The direction ${t} is not supported by the CGraph instance.`);if(t===this.direction)return this;let e=this.direction;switch(this.direction=t,e){case R.UNDEFINED:switch(t){case R.LEFT:this._calculateConstraints();break;case R.RIGHT:this._mirrorHitboxes(),this._calculateConstraints();break;case R.UP:this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.LEFT:switch(t){case R.RIGHT:this._mirrorHitboxes(),this._reverseConstraints();break;case R.UP:this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.RIGHT:switch(t){case R.LEFT:this._mirrorHitboxes(),this._reverseConstraints();break;case R.UP:this._mirrorHitboxes(),this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._mirrorHitboxes(),this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.UP:switch(t){case R.LEFT:this._transposeHitboxes(),this._calculateConstraints();break;case R.RIGHT:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break;case R.DOWN:this._mirrorHitboxes(),this._reverseConstraints();break}break;case R.DOWN:switch(t){case R.LEFT:this._mirrorHitboxes(),this._transposeHitboxes(),this._calculateConstraints();break;case R.RIGHT:this._mirrorHitboxes(),this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break;case R.UP:this._mirrorHitboxes(),this._reverseConstraints();break}break}return this}isLocked(t,e){if(t.cNodes!=null){for(let o of t.cNodes)if(this.isLocked(o,e))return!0;return!1}return this.lockFun!=null?this.lockFun.isLocked(t,e):!1}setLockFunction(t){return this.lockFun=t,this}forceConstraintsRecalculation(){return this._calculateConstraints(),this}calculateGroupOffsets(){for(let t of this.cGraph.cGroups){t.reference=null;for(let e of t.cNodes)e.cGroupOffset.reset(),(t.reference==null||e.hitbox.x<t.reference.hitbox.x)&&(t.reference=e);for(let e of t.cNodes)e.cGroupOffset.x=e.hitbox.x-t.reference.hitbox.x,e.cGroupOffset.y=e.hitbox.y-t.reference.hitbox.y}return this}_mirrorHitboxes(){for(let t of this.cGraph.cNodes)t.hitbox.x=-t.hitbox.x-t.hitbox.width;this.calculateGroupOffsets()}_transposeHitboxes(){for(let t of this.cGraph.cNodes){let e=t.hitbox.x;t.hitbox.x=t.hitbox.y,t.hitbox.y=e,e=t.hitbox.width,t.hitbox.width=t.hitbox.height,t.hitbox.height=e,e=t.cGroupOffset.x,t.cGroupOffset.x=t.cGroupOffset.y,t.cGroupOffset.y=e}this.calculateGroupOffsets()}_calculateConstraints(){for(let e of this.cGraph.cNodes)e.constraints.length=0;let t=this.direction.isHorizontal()?this.cGraph.predefinedHorizontalConstraints:this.cGraph.predefinedVerticalConstraints;for(let e of t)this.direction===R.LEFT||this.direction===R.UP?e.getFirst().constraints.push(e.getSecond()):e.getSecond().constraints.push(e.getFirst());this.constraintAlgorithm.calculateConstraints(this),this._calculateConstraintsForCGroups()}_calculateConstraintsForCGroups(){for(let t of this.cGraph.cGroups)t.outDegree=0,t.outDegreeReal=0,t.incomingConstraints.clear();for(let t of this.cGraph.cGroups)for(let e of t.cNodes)for(let o of e.constraints)o.cGroup!==t&&(t.incomingConstraints.add(o),o.cGroup.outDegree++,o.cGroup.outDegreeReal++)}_reverseConstraints(){let t=new Map;for(let e of this.cGraph.cNodes)t.set(e,[]);for(let e of this.cGraph.cNodes){e.startPos=Number.NEGATIVE_INFINITY;for(let o of e.constraints)t.get(o).push(e)}for(let e of this.cGraph.cNodes)e.constraints=t.get(e);this._calculateConstraintsForCGroups()}};Br.LONGEST_PATH_COMPACTION=new ed;Br.SCANLINE_CONSTRAINTS=new Xn;Br.QUADRATIC_CONSTRAINTS=new id;var Ur=class{constructor(t){this.name=t}toString(){return this.name}};Ur.QUADRATIC=new Ur("QUADRATIC");Ur.SCANLINE=new Ur("SCANLINE");var ai=class{constructor(t=!1,e=!1,o=!1,r=!1){this.left=t,this.right=e,this.up=o,this.down=r}set(t,e,o,r){this.left=t,this.right=e,this.up=o,this.down=r}applyOr(t){this.left=this.left||t.left,this.right=this.right||t.right,this.up=this.up||t.up,this.down=this.down||t.down}setDirection(t,e){switch(e){case R.LEFT:this.left=t;break;case R.RIGHT:this.right=t;break;case R.UP:this.up=t;break;case R.DOWN:this.down=t;break}}getDirection(t){switch(t){case R.LEFT:return this.left;case R.RIGHT:return this.right;case R.UP:return this.up;case R.DOWN:return this.down;default:return!1}}};var we=class{constructor(t,e,o,r){this.potentialGroupParents=[],this.representedLEdges=[],this.affectedBends=[],this.affectedBoundingBoxes=[],this.hitbox=new dt,this.junctionPoints=new st,this.ignoreSpacing=new ai,this.constraints=[],this.aPort=null,this.joined=[],this.affectedBends.push(t),this.affectedBends.push(e),this.hitbox.x=Math.min(t.x,e.x),this.hitbox.y=Math.min(t.y,e.y),this.hitbox.width=Math.abs(t.x-e.x),this.hitbox.height=Math.abs(t.y-e.y);let i=r.getProperty(_.JUNCTION_POINTS);if(i!=null)for(let s of i)ne.eq(s.x,t.x)&&this.junctionPoints.add(s);o!=null&&this.potentialGroupParents.push(o),this.representedLEdges.push(r)}joinWith(t){for(let l of t.representedLEdges)this.representedLEdges.push(l);for(let l of t.affectedBends)this.affectedBends.push(l);for(let l of t.affectedBoundingBoxes)this.affectedBoundingBoxes.push(l);for(let l of t.junctionPoints)this.junctionPoints.add(l);for(let l of t.constraints)this.constraints.push(l);for(let l of t.potentialGroupParents)this.potentialGroupParents.push(l);let e=Math.min(this.hitbox.x,t.hitbox.x),o=Math.min(this.hitbox.y,t.hitbox.y),i=Math.max(this.hitbox.x+this.hitbox.width,t.hitbox.x+t.hitbox.width)-e,a=Math.max(this.hitbox.y+this.hitbox.height,t.hitbox.y+t.hitbox.height)-o;this.hitbox.x=e,this.hitbox.y=o,this.hitbox.width=i,this.hitbox.height=a,this.ignoreSpacing.applyOr(t.ignoreSpacing),this.aPort==null&&(this.aPort=t.aPort);for(let l of t.joined)this.joined.push(l);return this.joined.push(t),this}intersects(t){return ne.eq(this.hitbox.x,t.hitbox.x)&&!(ne.lt(this.hitbox.y+this.hitbox.height,t.hitbox.y)||ne.lt(t.hitbox.y+t.hitbox.height,this.hitbox.y))}compareTo(t){let e=ne.TOLERANCE,o=this.hitbox.x-t.hitbox.x;return Math.abs(o)<=e?this.hitbox.y-t.hitbox.y:o}toString(){return`VerticalSegment ${this.hitbox} ${this.representedLEdges.join(", ")}`}};var sd=.5,Kn=.01,nd=class extends Xn{constructor(t){super(),this._verticalEdgeEdgeSpacing=t.getProperty(_.SPACING_EDGE_EDGE),this._edgeRouting=t.getProperty(_.EDGE_ROUTING)}calculateConstraints(t){switch(this.compactor=t,this._edgeRouting){case At.ORTHOGONAL:this._calculateForOrthogonal();break;case At.SPLINES:this._calculateForSpline();break;default:throw new Error("Unsupported edge routing: "+this._edgeRouting)}}_calculateForSpline(){let t=[];this._sweep(o=>o.origin instanceof we);let e=this._computeMinSpacing();for(let o of this.compactor.cGraph.cNodes)o.origin instanceof ft&&(this._alterHitbox(o,e,1),t.push(()=>this._alterHitbox(o,e,-1)));this._sweep(()=>!0);for(let o of t)o();t.length=0}_calculateForOrthogonal(){let t=[];for(let o of this.compactor.cGraph.cNodes)if(o.origin instanceof we){let r=Math.max(0,this._verticalEdgeEdgeSpacing/2-sd);this._alterHitbox(o,r,1),t.push(()=>this._alterHitbox(o,r,-1))}this._sweep(o=>o.origin instanceof we);for(let o of t)o();t.length=0;for(let o of this.compactor.cGraph.cNodes)if(o.origin instanceof ft){let r=ke.getLNodeOrNull(o),i=oo.getIndividualOrDefault(r,_.SPACING_EDGE_EDGE),s=Math.max(0,i/2-sd);this._alterHitbox(o,s,1),t.push(()=>this._alterHitbox(o,s,-1))}this._sweep(o=>o.origin instanceof ft);for(let o of t)o();t.length=0;let e=this._computeMinSpacing();for(let o of this.compactor.cGraph.cGroups)this._alterGroupedHitboxOrthogonal(o,e,1),t.push(()=>this._alterGroupedHitboxOrthogonal(o,e,-1));this._sweep(()=>!0);for(let o of t)o();t.length=0}_computeMinSpacing(){let t=Number.POSITIVE_INFINITY;for(let e of this.compactor.cGraph.cNodes){let o;if(e.origin instanceof ft&&e.origin.getType()===y.EXTERNAL_PORT)o=Number.POSITIVE_INFINITY;else if(ke.getVerticalSegmentOrNull(e)!=null)o=Math.max(0,this._verticalEdgeEdgeSpacing/2-sd);else{let i=ke.getLNodeOrNull(e);if(i!=null){let s=oo.getIndividualOrDefault(i,_.SPACING_NODE_NODE);o=Math.max(0,s/2-sd)}else o=Number.POSITIVE_INFINITY}o<t&&(t=o)}return Number.isFinite(t)?t:0}_alterGroupedHitboxOrthogonal(t,e,o){let r=t.master;if(r==null&&(r=t.cNodes.values().next().value),this._alterHitbox(r,e,o),t.cNodes.size===1)return;let i=e*o;for(let s of t.cNodes){if(s===r)continue;let a=ke.getVerticalSegmentOrNull(s);a!=null&&(a.ignoreSpacing.up?(s.hitbox.y+=i+Kn,s.hitbox.height-=i+Kn):a.ignoreSpacing.down&&(s.hitbox.height-=i+Kn))}}_alterHitbox(t,e,o){let r=e*o;if(t.origin instanceof we){let i=ke.getVerticalSegmentOrNull(t);i.ignoreSpacing.up?i.ignoreSpacing.down||(t.hitbox.height+=r+Kn):(t.hitbox.y-=r+Kn,t.hitbox.height+=r+Kn)}else t.origin instanceof ft&&(t.hitbox.y-=r,t.hitbox.height+=2*r)}};var Zn=class{constructor(t){this.cNodes=[],this.cGroups=[],this.predefinedHorizontalConstraints=[],this.predefinedVerticalConstraints=[],this._supportedDirections=t}supports(t){return this._supportedDirections.has(t)}};var ki=class{constructor(){this.id=0,this.origin=null,this.type=null,this.toStringDelegate=null,this.cGroup=null,this.cGroupOffset=new O,this.hitboxPreCompaction=null,this.hitbox=null,this.constraints=[],this.startPos=Number.NEGATIVE_INFINITY,this.lock=new ai}static of(){return new D_}getDebugSVG(){let t=this.hitbox.x,e=this.hitbox.y,o=Math.max(1,this.hitbox.width),r=Math.max(1,this.hitbox.height);return`<rect x="${t}" y="${e}" width="${o}" height="${r}" fill="green" stroke="black" opacity="0.5"/><text x="${t+2}" y="${e+8+2+1}">(${Math.round(t)}, ${Math.round(e)})
-${this}</text>`}toString(){return this.toStringDelegate!=null?this.toStringDelegate(this):`CNode[id=${this.id}]`}},D_=class{constructor(){this.node=new ki,this.groupParent=null}id(t){return this.node.id=t,this}origin(t){return this.node.origin=t,this}type(t){return this.node.type=t,this}hitbox(t){return this.node.hitbox=t,this}toStringDelegate(t){return this.node.toStringDelegate=t,this}groupWith(t){return this.groupParent=t,this}create(t){return t.cNodes.push(this.node),this.groupParent!=null&&(this.groupParent.cGroup==null?tr.of().nodes(this.groupParent,this.node).create(t):this.groupParent.cGroup.addCNode(this.node)),this.node}};var ad=class{constructor(){this._cGraph=null,this._layeredGraph=null,this._edgeRouting=null,this._commentOffsets=new Map,this._nodesMap=new Map,this._verticalSegmentsMap=new Map,this._lockMap=new Map}transform(t){return this._layeredGraph=t,this._edgeRouting=this._layeredGraph.getProperty(_.EDGE_ROUTING),this._init(),this._transformNodes(),this._transformEdges(),this._cGraph}getLockMap(){return this._lockMap}_init(){let t=!1,e=0;for(let r of this._layeredGraph){r.id=e++;for(let i of r)if(!t)for(let s of i.getConnectedEdges()){t=!0;break}}let o=new Set([R.UNDEFINED,R.LEFT,R.RIGHT]);t||(o.add(R.UP),o.add(R.DOWN)),this._cGraph=new Zn(o),this._nodesMap.clear(),this._commentOffsets.clear(),this._lockMap.clear(),this._verticalSegmentsMap.clear()}_transformNodes(){for(let t of this._layeredGraph)for(let e of t){if(e.getProperty(_.COMMENT_BOX)){let c=[...e.getConnectedEdges()];if(c.length>0){let g=c[0],h=g.getSource().getNode();h===e&&(h=g.getTarget().getNode());let d=new O(e.getPosition().x-h.getPosition().x,e.getPosition().y-h.getPosition().y);this._commentOffsets.set(e,{other:h,offset:d});continue}}let o=new dt(e.getPosition().x-e.getMargin().left,e.getPosition().y-e.getMargin().top,e.getSize().x+e.getMargin().left+e.getMargin().right,e.getSize().y+e.getMargin().top+e.getMargin().bottom),r=ki.of().origin(e).hitbox(o).toStringDelegate(nI).create(this._cGraph);tr.of().nodes(r).master(r).create(this._cGraph);let i=new ai;this._lockMap.set(r,i);let s=0;for(let c of e.getIncomingEdges())s++;let a=0;for(let c of e.getOutgoingEdges())a++;let l=s-a;l<0?i.setDirection(!0,R.LEFT):l>0&&i.setDirection(!0,R.RIGHT),e.getType()===y.EXTERNAL_PORT&&i.set(!1,!1,!1,!1),this._nodesMap.set(e,r)}}_transformEdges(){let t=this._layeredGraph.getProperty(_.EDGE_ROUTING),e;switch(t){case At.ORTHOGONAL:e=this._collectVerticalSegmentsOrthogonal();break;case At.SPLINES:e=this._collectVerticalSegmentsSplines();break;default:throw new Error("Compaction not supported for "+t+" edges.")}this._mergeVerticalSegments(e);for(let o of this._verticalSegmentsMap.keys()){let r=this._verticalSegmentsMap.get(o);for(let i of o.constraints){let s=this._verticalSegmentsMap.get(i);this._cGraph.predefinedHorizontalConstraints.push([r,s])}}}_collectVerticalSegmentsOrthogonal(){let t=[];for(let e of this._layeredGraph)for(let o of e){let r=this._nodesMap.get(o);if(r!=null){for(let i of o.getOutgoingEdges()){let s=[...i.getBendPoints()];if(s.length===0)continue;let a=s[0],l=null,c=!0;if(i.getSource().getSide()===u.NORTH){let g=new we(a,new O(a.x,r.hitbox.y),r,i);g.ignoreSpacing.down=!0,g.aPort=i.getSource(),t.push(g)}if(i.getSource().getSide()===u.SOUTH){let g=new we(a,new O(a.x,r.hitbox.y+r.hitbox.height),r,i);g.ignoreSpacing.up=!0,g.aPort=i.getSource(),t.push(g)}for(let g=1;g<s.length;g++){let h=s[g];ne.eq(a.y,h.y)||(l=new we(a,h,null,i),t.push(l),c&&(c=!1,h.y<r.hitbox.y?l.ignoreSpacing.down=!0:h.y>r.hitbox.y+r.hitbox.height?l.ignoreSpacing.up=!0:(l.ignoreSpacing.up=!0,l.ignoreSpacing.down=!0))),g+1<s.length&&(a=h)}if(l!=null){let g=this._nodesMap.get(i.getTarget().getNode()),h=s[s.length-2];g!=null&&(h.y<g.hitbox.y?l.ignoreSpacing.down=!0:h.y>g.hitbox.y+g.hitbox.height?l.ignoreSpacing.up=!0:(l.ignoreSpacing.up=!0,l.ignoreSpacing.down=!0))}}for(let i of o.getIncomingEdges()){let s=i.getBendPoints();if(s.length===0)continue;let a=s[s.length-1];if(i.getTarget().getSide()===u.NORTH){let l=new we(a,new O(a.x,r.hitbox.y),r,i);l.ignoreSpacing.down=!0,l.aPort=i.getTarget(),t.push(l)}if(i.getTarget().getSide()===u.SOUTH){let l=new we(a,new O(a.x,r.hitbox.y+r.hitbox.height),r,i);l.ignoreSpacing.up=!0,l.aPort=i.getTarget(),t.push(l)}}}}return t}_collectVerticalSegmentsSplines(){let t=[];for(let e of this._layeredGraph.getLayers())for(let o of e.getNodes())for(let r of o.getOutgoingEdges()){let i=r.getProperty(p.SPLINE_ROUTE_START);if(i==null)continue;let s=null;for(let a of i){if(a.isStraight)continue;let l=a.boundingBox.getTopLeft(),c=a.boundingBox.getBottomRight(),g=new we(l,c,null,a.edges.values().next().value);g.affectedBoundingBoxes.push(a.boundingBox),t.push(g),s!=null&&s.constraints.push(g),s=g}}return t}_mergeVerticalSegments(t){if(t.length===0)return;t.sort((o,r)=>o.compareTo(r));let e=t[0];for(let o=1;o<t.length;o++){let r=t[o];e.intersects(r)?e=e.joinWith(r):(this._verticalSegmentToCNode(e),e=r)}this._verticalSegmentToCNode(e)}_verticalSegmentToCNode(t){let e=ki.of().origin(t).type("vs").hitbox(new dt(t.hitbox)).toStringDelegate(aI).create(this._cGraph);t.potentialGroupParents.length>0&&t.potentialGroupParents[0].cGroup.addCNode(e);let o=new ai;this._lockMap.set(e,o);let r=new Set,i=new Set;for(let a of t.representedLEdges)r.add(a.getSource()),i.add(a.getTarget());let s=r.size-i.size;s<0?(o.setDirection(!0,R.LEFT),o.setDirection(!1,R.RIGHT)):s>0&&(o.setDirection(!1,R.LEFT),o.setDirection(!0,R.RIGHT));for(let a of t.joined)this._verticalSegmentsMap.set(a,e);this._verticalSegmentsMap.set(t,e)}applyLayout(){for(let o of this._cGraph.cNodes)if(o.origin instanceof ft){let r=o.origin;r.getPosition().x=o.hitbox.x+r.getMargin().left}this._applyCommentPositions();for(let o of this._cGraph.cNodes)if(o.origin instanceof we){let r=o.hitbox.x-o.hitboxPreCompaction.x,i=o.origin;for(let s of i.affectedBends)s.x+=r;for(let s of i.affectedBoundingBoxes)s.x+=r;for(let s of i.junctionPoints)s.x+=r}for(let o of this._nodesMap.keys())for(let r of o.getOutgoingEdges()){if(!r.isSelfLoop())continue;let i=r.getSource().getNode(),s=this._nodesMap.get(i),a=s.hitbox.x-s.hitboxPreCompaction.x;for(let l of r.getBendPoints())l.x+=a;for(let l of r.getLabels())l.getPosition().x+=a}if(this._layeredGraph.getProperty(_.EDGE_ROUTING)===At.SPLINES)for(let o of this._layeredGraph.getLayers())for(let r of o.getNodes())for(let i of r.getOutgoingEdges()){let s=i.getProperty(p.SPLINE_ROUTE_START);s!=null&&s.length>0&&this._adjustSplineControlPoints(s)}let t=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),e=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let o of this._cGraph.cNodes)t.x=Math.min(t.x,o.hitbox.x),t.y=Math.min(t.y,o.hitbox.y),e.x=Math.max(e.x,o.hitbox.x+o.hitbox.width),e.y=Math.max(e.y,o.hitbox.y+o.hitbox.height);this._layeredGraph.getOffset().reset().add(-t.x,-t.y),this._layeredGraph.getSize().reset().add(e.x-t.x,e.y-t.y),this._applyExternalPortPositions(t,e),this._cleanup()}_applyCommentPositions(){for(let[t,e]of this._commentOffsets){let o=e.other,r=e.offset;t.getPosition().reset().add(o.getPosition().x+r.x,o.getPosition().y+r.y)}}_applyExternalPortPositions(t,e){for(let o of this._cGraph.cNodes){let r=o.origin instanceof ft?o.origin:null;if(!(r==null||r.getType()!==y.EXTERNAL_PORT))switch(r.getProperty(p.EXT_PORT_SIDE)){case u.WEST:r.getPosition().x=t.x;break;case u.EAST:r.getPosition().x=e.x-(r.getSize().x+r.getMargin().right);break;case u.NORTH:r.getPosition().y=t.y;break;case u.SOUTH:r.getPosition().y=e.y-(r.getSize().y+r.getMargin().bottom);break;default:break}}}_adjustSplineControlPoints(t){if(t.length===0)return;let e=t[0];if(t.length===1){this._adjustControlPointBetweenSegments(e,e,1,0,t);return}let o=1;for(;o<t.length;)if(e.initialSegment||!e.isStraight){let r=this._firstNonStraightSegment(t,o);if(r!=null){let i=r[0],s=r[1];this._adjustControlPointBetweenSegments(e,s,o,i,t),o=i+1,e=s}else break}else o++}_firstNonStraightSegment(t,e){if(e<0||e>=t.length)return null;for(let o=e;o<t.length;o++){let r=t[o];if(o===t.length-1||!r.isStraight)return[o,r]}return null}_adjustControlPointBetweenSegments(t,e,o,r,i){let s,a=o;if(t.initialSegment&&t.isStraight){let E=this._nodesMap.get(t.sourceNode);s=E.hitbox.x+E.hitbox.width,a--}else s=t.boundingBox.x+t.boundingBox.width;let l,c=r;e.lastSegment&&e.isStraight?(l=this._nodesMap.get(e.targetNode).hitbox.x,c++):l=e.boundingBox.x;let g=l-s,h=Math.max(2,c-a),d=g/h,f=s+d;for(let E=a;E<c;E++){let P=i[E],S=P.boundingBox.width;P.boundingBox.x=f-S/2,f+=d}}_cleanup(){this._nodesMap.clear(),this._commentOffsets.clear(),this._verticalSegmentsMap.clear(),this._lockMap.clear(),this._cGraph.cGroups.length=0,this._cGraph.cNodes.length=0,this._cGraph=null,this._layeredGraph=null}},nI=n=>{let t=n.origin,e=t&&t.getProperty?t.getProperty(p.ORIGIN):null;return e!=null?String(e):String(t)},aI=n=>String(n.origin);var te=class{constructor(){this.id=0,this.internalId=0,this.origin=null,this.source=null,this.target=null,this.weight=0,this.delta=1,this.treeEdge=!1}static of(t){return new w_}getSource(){return this.source}getTarget(){return this.target}getOther(t){if(t===this.source)return this.target;if(t===this.target)return this.source;throw new Error(`Node ${t} not part of edge ${this}`)}reverse(){let t=this.source;return this.source=this.target,this.target=t,yP(this.target.getOutgoingEdges(),this),this.target.getIncomingEdges().push(this),yP(this.source.getIncomingEdges(),this),this.source.getOutgoingEdges().push(this),this}toString(){return`NEdge[id=${this.id} w=${this.weight} d=${this.delta}]`}};function yP(n,t){let e=n.indexOf(t);e>=0&&n.splice(e,1)}var w_=class{constructor(){this.edge=new te}id(t){return this.edge.id=t,this}origin(t){return this.edge.origin=t,this}weight(t){return this.edge.weight=t,this}delta(t){return this.edge.delta=t,this}source(t){return this.edge.source=t,this}target(t){return this.edge.target=t,this}create(){if(this.edge.source==null||this.edge.target==null)throw new Error("NEdge must have a source and target NNode specified.");if(this.edge.source===this.edge.target)throw new Error(`Network simplex does not support self-loops: ${this.edge} ${this.edge.source} ${this.edge.target}`);return this.edge.source.getOutgoingEdges().push(this.edge),this.edge.target.getIncomingEdges().push(this.edge),this.edge}};var He=class{constructor(){this.id=0,this.internalId=0,this.origin=null,this.type="",this.layer=0,this.treeNode=!1,this.unknownCutvalues=[],this._outgoingEdges=new ld,this._incomingEdges=new ld,this._outgoingEdgesModCnt=-1,this._incomingEdgesModCnt=-1,this._allEdges=[]}static of(){return new M_}getOutgoingEdges(){return this._outgoingEdges}getIncomingEdges(){return this._incomingEdges}getConnectedEdges(){if(this._incomingEdgesModCnt!==this._incomingEdges.getModCnt()||this._outgoingEdgesModCnt!==this._outgoingEdges.getModCnt()){this._allEdges=[];for(let t of this._incomingEdges)this._allEdges.push(t);for(let t of this._outgoingEdges)this._allEdges.push(t);this._incomingEdgesModCnt=this._incomingEdges.getModCnt(),this._outgoingEdgesModCnt=this._outgoingEdges.getModCnt()}return this._allEdges}toString(){return`NNode[id=${this.id} layer=${this.layer}]`}},M_=class{constructor(){this.node=new He}id(t){return this.node.id=t,this}origin(t){return this.node.origin=t,this}type(t){return this.node.type=t,this}create(t){return t.nodes.push(this.node),this.node}},ld=class extends Array{constructor(){super(),this._modCount=0}getModCnt(){return this._modCount}push(...t){return this._modCount++,super.push(...t)}pop(){return this._modCount++,super.pop()}shift(){return this._modCount++,super.shift()}unshift(...t){return this._modCount++,super.unshift(...t)}splice(t,e,...o){return this._modCount++,super.splice(t,e,...o)}clear(){this._modCount++,this.length=0}};var Wi=class{constructor(){this.nodes=[]}makeConnected(){let t=0;for(let o of this.nodes)o.internalId=t++;let e=this._findConCompRepresentatives();return e.length>1?this._createArtificialRootAndConnect(e):null}_createArtificialRootAndConnect(t){let e=He.of().create(this);for(let o of t)te.of().delta(0).weight(0).source(e).target(o).create();return e}_findConCompRepresentatives(){let t=[],e=new Array(this.nodes.length).fill(!1);for(let o of this.nodes)e[o.internalId]||(t.push(o),this._dfs(o,e));return t}_dfs(t,e){if(!e[t.internalId]){e[t.internalId]=!0;for(let o of t.getConnectedEdges()){let r=o.getOther(t);this._dfs(r,e)}}}isAcyclic(){let t=0;for(let i of this.nodes)i.internalId=t++;let e=new Array(this.nodes.length).fill(0),o=new Array(this.nodes.length).fill(0);for(let i of this.nodes)e[i.internalId]+=i.getIncomingEdges().length;let r=[];for(let i of this.nodes)i.getIncomingEdges().length===0&&r.push(i);if(r.length===0&&this.nodes.length>0)return!1;for(;r.length>0;){let i=r.shift();for(let s of i.getOutgoingEdges()){let a=s.getTarget();o[a.internalId]=Math.max(o[a.internalId],o[i.internalId]+1),e[a.internalId]--,e[a.internalId]===0&&r.push(a)}}for(let i of this.nodes)for(let s of i.getOutgoingEdges())if(o[s.target.internalId]<=o[s.source.internalId])return!1;return!0}};var lI=40,cI=-1e-10,li=class n{constructor(){this._previousLayeringNodeCounts=null,this._balance=!1,this._iterationLimit=Number.MAX_SAFE_INTEGER,this.graph=null,this._edges=null,this._treeEdges=null,this._sources=null,this._edgeVisited=null,this._postOrder=1,this._poID=null,this._lowestPoID=null,this._cutvalue=null,this._subtreeNodesStack=null}static forGraph(t){let e=new n;return e.graph=t,e}withBalancing(t){return this._balance=t,this}withPreviousLayering(t){return this._previousLayeringNodeCounts=t,this}withIterationLimit(t){return this._iterationLimit=t,this}_initialize(){let t=this.graph.nodes.length;for(let s of this.graph.nodes)s.treeNode=!1;this._poID=new Array(t).fill(0),this._lowestPoID=new Array(t).fill(0),this._sources=[];let e=0,o=[];for(let s of this.graph.nodes){s.internalId=e++,s.getIncomingEdges().length===0&&this._sources.push(s);for(let a of s.getOutgoingEdges())o.push(a)}let r=0;for(let s of o)s.internalId=r++,s.treeEdge=!1;let i=o.length;this._cutvalue==null||this._cutvalue.length<i?(this._cutvalue=new Array(i).fill(0),this._edgeVisited=new Array(i).fill(!1)):this._edgeVisited.fill(!1),this._edges=o,this._treeEdges=new Set,this._postOrder=1}_dispose(){this._cutvalue=null,this._edges=null,this._treeEdges=null,this._edgeVisited=null,this._lowestPoID=null,this._poID=null,this._sources=null,this._subtreeNodesStack=null}execute(t){let e=t||new Ie;if(e.begin("Network simplex",1),this.graph.nodes.length<1){e.done();return}for(let s of this.graph.nodes)s.layer=0;let o=this.graph.nodes.length>=lI;o&&this._removeSubtrees(),this._initialize(),this._feasibleTree();let r=this._leaveEdge(),i=0;for(;r!=null&&i<this._iterationLimit;)this._exchange(r,this._enterEdge(r)),r=this._leaveEdge(),i++;o&&this._reattachSubtrees(),this._balance?this._balanceLayering(this._normalize()):this._normalize(),this._dispose(),e.done()}_removeSubtrees(){this._subtreeNodesStack=[];let t=[];for(let e of this.graph.nodes)e.getConnectedEdges().length===1&&t.push(e);for(;t.length>0;){let e=t.shift();if(e.getConnectedEdges().length===0)continue;let o=e.getConnectedEdges()[0],r=e.getOutgoingEdges().length>0,i=o.getOther(e);al(r?i.getIncomingEdges():i.getOutgoingEdges(),o),i.getConnectedEdges().length===1&&t.push(i),this._subtreeNodesStack.push(new Gt(e,o)),al(this.graph.nodes,e)}}_reattachSubtrees(){for(;this._subtreeNodesStack.length>0;){let t=this._subtreeNodesStack.pop(),e=t.getFirst(),o=t.getSecond(),r=o.getOther(e);o.target===e?(r.getOutgoingEdges().push(o),e.layer=r.layer+o.delta):(r.getIncomingEdges().push(o),e.layer=r.layer-o.delta),this.graph.nodes.push(e)}}_feasibleTree(){if(this._layeringTopologicalNumbering(this._sources),this._edges.length>0){for(this._edgeVisited.fill(!1);this._tightTreeDFS(this.graph.nodes[0])<this.graph.nodes.length;){let t=this._minimalSlack(),e=t.getTarget().layer-t.getSource().layer-t.delta;t.getTarget().treeNode&&(e=-e);for(let o of this.graph.nodes)o.treeNode&&(o.layer+=e);this._edgeVisited.fill(!1)}this._edgeVisited.fill(!1),this._postorderTraversal(this.graph.nodes[0]),this._cutvalues()}}_layeringTopologicalNumbering(t){let e=new Array(this.graph.nodes.length).fill(0);for(let r of this.graph.nodes)e[r.internalId]+=r.getIncomingEdges().length;let o=[...t];for(;o.length>0;){let r=o.shift();for(let i of r.getOutgoingEdges()){let s=i.getTarget();s.layer=Math.max(s.layer,r.layer+i.delta),e[s.internalId]--,e[s.internalId]===0&&o.push(s)}}}_minimalSpan(t){let e=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER;for(let r of t.getConnectedEdges()){let i=r.getTarget().layer-r.getSource().layer;r.getTarget()===t&&i<o?o=i:i<e&&(e=i)}return o===Number.MAX_SAFE_INTEGER&&(o=-1),e===Number.MAX_SAFE_INTEGER&&(e=-1),new Gt(o,e)}_tightTreeDFS(t){let e=1;t.treeNode=!0;for(let o of t.getConnectedEdges())if(!this._edgeVisited[o.internalId]){this._edgeVisited[o.internalId]=!0;let r=o.getOther(t);o.treeEdge?e+=this._tightTreeDFS(r):!r.treeNode&&o.delta===o.getTarget().layer-o.getSource().layer&&(o.treeEdge=!0,this._treeEdges.add(o),e+=this._tightTreeDFS(r))}return e}_minimalSlack(){let t=Number.MAX_SAFE_INTEGER,e=null;for(let o of this._edges)if(o.getSource().treeNode!==o.getTarget().treeNode){let r=o.getTarget().layer-o.getSource().layer-o.delta;r<t&&(t=r,e=o)}return e}_postorderTraversal(t){let e=Number.MAX_SAFE_INTEGER;for(let o of t.getConnectedEdges())o.treeEdge&&!this._edgeVisited[o.internalId]&&(this._edgeVisited[o.internalId]=!0,e=Math.min(e,this._postorderTraversal(o.getOther(t))));return this._poID[t.internalId]=this._postOrder,this._lowestPoID[t.internalId]=Math.min(e,this._postOrder++),this._lowestPoID[t.internalId]}_isInHead(t,e){let o=e.getSource(),r=e.getTarget();return this._lowestPoID[o.internalId]<=this._poID[t.internalId]&&this._poID[t.internalId]<=this._poID[o.internalId]&&this._lowestPoID[r.internalId]<=this._poID[t.internalId]&&this._poID[t.internalId]<=this._poID[r.internalId]?!(this._poID[o.internalId]<this._poID[r.internalId]):this._poID[o.internalId]<this._poID[r.internalId]}_cutvalues(){let t=[];for(let e of this.graph.nodes){let o=0;e.unknownCutvalues.length=0;for(let r of e.getConnectedEdges())r.treeEdge&&(e.unknownCutvalues.push(r),o++);o===1&&t.push(e)}for(let e of t)for(;e.unknownCutvalues.length===1;){let o=e.unknownCutvalues[0];this._cutvalue[o.internalId]=o.weight;let r=o.getSource(),i=o.getTarget();for(let s of e.getConnectedEdges())s!==o&&(s.treeEdge?r===s.getSource()||i===s.getTarget()?this._cutvalue[o.internalId]-=this._cutvalue[s.internalId]-s.weight:this._cutvalue[o.internalId]+=this._cutvalue[s.internalId]-s.weight:e===r?s.getSource()===e?this._cutvalue[o.internalId]+=s.weight:this._cutvalue[o.internalId]-=s.weight:s.getSource()===e?this._cutvalue[o.internalId]-=s.weight:this._cutvalue[o.internalId]+=s.weight);al(r.unknownCutvalues,o),al(i.unknownCutvalues,o),r===e?e=o.getTarget():e=o.getSource()}}_leaveEdge(){for(let t of this._treeEdges)if(t.treeEdge&&this._cutvalue[t.internalId]<cI)return t;return null}_enterEdge(t){if(!t.treeEdge)throw new Error("The input edge is not a tree edge.");let e=null,o=Number.MAX_SAFE_INTEGER;for(let r of this._edges){let i=r.getSource(),s=r.getTarget();if(this._isInHead(i,t)&&!this._isInHead(s,t)){let a=s.layer-i.layer-r.delta;a<o&&(o=a,e=r)}}return e}_exchange(t,e){if(!t.treeEdge)throw new Error("Given leave edge is no tree edge.");if(e.treeEdge)throw new Error("Given enter edge is a tree edge already.");t.treeEdge=!1,this._treeEdges.delete(t),e.treeEdge=!0,this._treeEdges.add(e);let o=e.getTarget().layer-e.getSource().layer-e.delta;this._isInHead(e.getTarget(),t)||(o=-o);for(let r of this.graph.nodes)this._isInHead(r,t)||(r.layer+=o);this._postOrder=1,this._edgeVisited.fill(!1),this._postorderTraversal(this.graph.nodes[0]),this._cutvalues()}_normalize(){let t=Number.MIN_SAFE_INTEGER,e=Number.MAX_SAFE_INTEGER;for(let i of this.graph.nodes)e=Math.min(e,i.layer),t=Math.max(t,i.layer);let o=new Array(t-e+1).fill(0);for(let i of this.graph.nodes)i.layer-=e,o[i.layer]++;let r=0;if(this._previousLayeringNodeCounts!=null){for(let i of this._previousLayeringNodeCounts)if(o[r++]+=i,o.length===r)break}return o}_balanceLayering(t){for(let e of this.graph.nodes)if(e.getIncomingEdges().length===e.getOutgoingEdges().length){let o=e.layer,r=this._minimalSpan(e);for(let i=e.layer-r.getFirst()+1;i<e.layer+r.getSecond();i++)t[i]<t[o]&&(o=i);t[o]<t[e.layer]&&(t[e.layer]--,t[o]++,e.layer=o)}}};function al(n,t){let e=n.indexOf(t);return e>=0?(n.splice(e,1),!0):!1}var b_=1,G_=100,cd=class{constructor(){this.compactor=null,this.networkSimplexGraph=null,this.nNodes=null,this.index=0}compact(t){this.compactor=t,this.networkSimplexGraph=new Wi,this.nNodes=new Array(this.compactor.cGraph.cGroups.length).fill(null),this.index=0;for(let e of this.compactor.cGraph.cGroups){e.id=this.index;let o=He.of().id(this.index).origin(e).create(this.networkSimplexGraph);this.nNodes[this.index]=o,this.index++}this._addSeparationConstraints(),this._addEdgeConstraints(),this._addArtificialSourceNode(),li.forGraph(this.networkSimplexGraph).execute(new Ie);for(let e of this.compactor.cGraph.cNodes)e.hitbox.x=this.nNodes[e.cGroup.id].layer+e.cGroupOffset.x}_addSeparationConstraints(){for(let t of this.compactor.cGraph.cNodes)for(let e of t.constraints){if(t.cGroup===e.cGroup)continue;let o;this.compactor.direction.isHorizontal()?o=this.compactor.spacingsHandler.getHorizontalSpacing(t,e):o=this.compactor.spacingsHandler.getVerticalSpacing(t,e);let r=t.cGroupOffset.x+t.hitbox.width+o-e.cGroupOffset.x;if(r=Math.ceil(r),r=Math.max(0,r),ke.isVerticalSegmentsOfSameEdge(t,e)){let i=He.of().create(this.networkSimplexGraph),s=Math.ceil(e.cGroupOffset.x-t.cGroupOffset.x),a=s-(e.cGroupOffset.x-t.cGroupOffset.x),l=ke.getVerticalSegmentOrNull(t).aPort,c=t;l==null&&(l=ke.getVerticalSegmentOrNull(e).aPort,a=-a,c=e),l!=null&&(c.cGroupOffset.x-=a,l.getPosition().x-=a),te.of().delta(Math.max(0,s)).weight(b_).source(i).target(this.nNodes[t.cGroup.id]).create(),te.of().delta(Math.max(0,-s)).weight(b_).source(i).target(this.nNodes[e.cGroup.id]).create()}else{let i=b_;(t.origin instanceof we&&e.origin instanceof ft||e.origin instanceof we&&t.origin instanceof ft)&&(i=2),te.of().delta(r).weight(i).source(this.nNodes[t.cGroup.id]).target(this.nNodes[e.cGroup.id]).create()}}}_addEdgeConstraints(){let t=new Map,e=new Map;for(let o of this.compactor.cGraph.cNodes){let r=ke.getLNodeOrNull(o);if(r!=null)t.set(r,o);else{let i=ke.getVerticalSegmentOrNull(o);if(i!=null)for(let s of i.representedLEdges){let a=e.get(s);a==null&&(a=new Set,e.set(s,a)),a.add(o)}}}for(let o of this.compactor.cGraph.cNodes){let r=ke.getLNodeOrNull(o);if(r!=null)for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;let s=i.getSource(),a=i.getTarget();if(u.SIDES_NORTH_SOUTH.has(s.getSide())&&u.SIDES_NORTH_SOUTH.has(a.getSide()))continue;let l=t.get(a.getNode());if(l!=null){if(te.of().delta(0).weight(G_).source(this.nNodes[o.cGroup.id]).target(this.nNodes[l.cGroup.id]).create(),s.getSide()===u.WEST&&rt.OUTPUT_PREDICATE(s)){let c=e.get(i);if(c!=null){for(let g of c)if(g.hitbox.x<o.hitbox.x){let h=this.nNodes[g.cGroup.id],d=this.nNodes[o.cGroup.id];if(h===d)continue;te.of().delta(1).weight(G_).source(h).target(d).create()}}}if(a.getSide()===u.EAST&&rt.INPUT_PREDICATE(a)){let c=e.get(i);if(c!=null){for(let g of c)if(g.hitbox.x>o.hitbox.x){let h=this.nNodes[o.cGroup.id],d=this.nNodes[g.cGroup.id];if(h===d)continue;te.of().delta(1).weight(G_).source(h).target(d).create()}}}}}}}_addArtificialSourceNode(){let t=[];for(let e of this.networkSimplexGraph.nodes)e.getIncomingEdges().length===0&&t.push(e);if(t.length>1){let e=He.of().id(this.index++).create(this.networkSimplexGraph);for(let o of t)te.of().delta(1).weight(0).source(e).target(o).create()}}};var ke=class n{constructor(){this._lGraph=null}process(t,e){let o=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY);if(o==null||o===re.NONE)return;e.begin("Horizontal Compaction",1),this._lGraph=t;let r=new ad,i=new Br(r.transform(t));switch(i.setSpacingsHandler(this._createSpacingsHandler()),t.getProperty(_.COMPACTION_POST_COMPACTION_CONSTRAINTS)===Ur.SCANLINE?i.setConstraintAlgorithm(new nd(this._lGraph)):i.setConstraintAlgorithm(Br.QUADRATIC_CONSTRAINTS),o){case re.LEFT:i.compact();break;case re.RIGHT:i.changeDirection(R.RIGHT).compact();break;case re.LEFT_RIGHT_CONSTRAINT_LOCKING:i.compact().changeDirection(R.RIGHT).setLockFunction((a,l)=>a.cGroup.outDegreeReal===0).compact();break;case re.LEFT_RIGHT_CONNECTION_LOCKING:i.compact().changeDirection(R.RIGHT).setLockFunction((a,l)=>r.getLockMap().get(a).getDirection(l)).compact();break;case re.EDGE_LENGTH:i.setCompactionAlgorithm(n.NETWORK_SIMPLEX_COMPACTION).compact();break;default:break}i.finish(),r.applyLayout(),e.done()}static isVerticalSegmentsOfSameEdge(t,e){let o=n.getVerticalSegmentOrNull(t),r=n.getVerticalSegmentOrNull(e);if(o==null||r==null)return!1;for(let i of o.representedLEdges)if(r.representedLEdges.includes(i))return!0;return!1}static getLNodeOrNull(t){return t.origin instanceof ft?t.origin:null}static getVerticalSegmentOrNull(t){return t.origin instanceof we?t.origin:null}_createSpacingsHandler(){let t=this;return{getHorizontalSpacing(e,o){if(n.isVerticalSegmentsOfSameEdge(e,o))return 0;let r=n.getLNodeOrNull(e),i=n.getLNodeOrNull(o);return r!=null&&r.getType()===y.EXTERNAL_PORT||i!=null&&i.getType()===y.EXTERNAL_PORT?0:t._lGraph.getProperty(p.SPACINGS).getHorizontalSpacing(r!=null?r.getType():y.LONG_EDGE,i!=null?i.getType():y.LONG_EDGE)},getVerticalSpacing(e,o){if(n.isVerticalSegmentsOfSameEdge(e,o))return 1;let r=n.getLNodeOrNull(e),i=n.getLNodeOrNull(o);return t._lGraph.getProperty(p.SPACINGS).getVerticalSpacing(r!=null?r.getType():y.LONG_EDGE,i!=null?i.getType():y.LONG_EDGE)}}}};ke.NETWORK_SIMPLEX_COMPACTION=new cd;var Ds=class{constructor(t){this._maxNum=t,this._binarySums=new Int32Array(t+1),this._numsPerIndex=new Int32Array(t),this._size=0}add(t){this._size++,this._numsPerIndex[t]++;let e=t+1;for(;e<this._binarySums.length;)this._binarySums[e]++,e+=e&-e}rank(t){let e=t,o=0;for(;e>0;)o+=this._binarySums[e],e-=e&-e;return o}size(){return this._size}removeAll(t){let e=this._numsPerIndex[t];if(e===0)return;this._numsPerIndex[t]=0,this._size-=e;let o=t+1;for(;o<this._binarySums.length;)this._binarySums[o]-=e,o+=o&-o}clear(){this._binarySums=new Int32Array(this._maxNum+1),this._numsPerIndex=new Int32Array(this._maxNum),this._size=0}isEmpty(){return this._size===0}};function zi(n,t){switch(t){case u.EAST:case u.NORTH:return n.getPortSideView(t);case u.SOUTH:case u.WEST:return[...n.getPortSideView(t)].reverse();default:return[]}}var gd={inNorthSouthEastWestOrder:zi};var Fr=class{constructor(t){this._portPositions=t,this._indexTree=null,this._ends=[],this._nodeCardinalities=null}countCrossingsBetweenLayers(t,e){let o=this._initPortPositionsCounterClockwise(t,e);return this._indexTree=new Ds(o.length),this._countCrossingsOnPorts(o)}countInLayerCrossingsOnSide(t,e){let o=this.initPortPositionsForInLayerCrossings(t,e);return this._countInLayerCrossingsOnPorts(o)}countNorthSouthPortCrossingsInLayer(t){let e=this._initPositionsForNorthSouthCounting(t);return this._indexTree=new Ds(e.length),this._countNorthSouthCrossingsOnPorts(e)}countCrossingsBetweenPortsInBothOrders(t,e){let o=this._connectedPortsSortedByPosition(t,e),r=this._countCrossingsOnPorts(o);this._indexTree.clear(),this.switchPorts(t,e),o.sort((s,a)=>this._positionOf(s)-this._positionOf(a));let i=this._countCrossingsOnPorts(o);return this._indexTree.clear(),this.switchPorts(e,t),Gt.of(r,i)}countInLayerCrossingsBetweenNodesInBothOrders(t,e,o){let r=this._connectedInLayerPortsSortedByPosition(t,e,o),i=this._countInLayerCrossingsOnPorts(r);this.switchNodes(t,e,o),this._indexTree.clear(),r.sort((a,l)=>this._positionOf(a)-this._positionOf(l));let s=this._countInLayerCrossingsOnPorts(r);return this.switchNodes(e,t,o),this._indexTree.clear(),Gt.of(i,s)}initForCountingBetween(t,e){let o=this._initPortPositionsCounterClockwise(t,e);this._indexTree=new Ds(o.length)}initPortPositionsForInLayerCrossings(t,e){let o=[];return this._initPositions(t,o,e,!0,!0),this._indexTree=new Ds(o.length),o}switchPorts(t,e){let o=this._portPositions[t.id];this._portPositions[t.id]=this._portPositions[e.id],this._portPositions[e.id]=o}switchNodes(t,e,o){for(let r of gd.inNorthSouthEastWestOrder(t,o))this._portPositions[r.id]=this._positionOf(r)+this._nodeCardinalities[e.id];for(let r of gd.inNorthSouthEastWestOrder(e,o))this._portPositions[r.id]=this._positionOf(r)-this._nodeCardinalities[t.id]}_connectedInLayerPortsSortedByPosition(t,e,o){let r=new Set,i=s=>r.add(s);for(let s of[t,e])for(let a of gd.inNorthSouthEastWestOrder(s,o))for(let l of a.getConnectedEdges())l.isSelfLoop()||(i(a),this._isInLayer(l)&&i(this._otherEndOf(l,a)));return[...r].sort((s,a)=>this._positionOf(s)-this._positionOf(a))}_connectedPortsSortedByPosition(t,e){let o=new Set;for(let r of[t,e]){o.add(r);for(let i of r.getConnectedEdges())this._isPortSelfLoop(i)||o.add(this._otherEndOf(i,r))}return[...o].sort((r,i)=>this._positionOf(r)-this._positionOf(i))}_countCrossingsOnPorts(t){let e=0;for(let o of t){this._indexTree.removeAll(this._positionOf(o));for(let r of o.getConnectedEdges()){let i=this._positionOf(this._otherEndOf(r,o));i>this._positionOf(o)&&(e+=this._indexTree.rank(i),this._ends.push(i))}for(;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_countInLayerCrossingsOnPorts(t){let e=0;for(let o of t){this._indexTree.removeAll(this._positionOf(o));let r=0;for(let i of o.getConnectedEdges())if(this._isInLayer(i)){let s=this._positionOf(this._otherEndOf(i,o));s>this._positionOf(o)&&(e+=this._indexTree.rank(s),this._ends.push(s))}else r++;for(e+=this._indexTree.size()*r;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_countNorthSouthCrossingsOnPorts(t){let e=0,o=[];for(let r of t){switch(this._indexTree.removeAll(this._positionOf(r)),o.length=0,r.getNode().getType()){case y.NORMAL:{let i=r.getProperty(p.PORT_DUMMY);if(i!=null)for(let s of i.getPorts())o.push([s,s.getDegree()]);break}case y.LONG_EDGE:{for(let i of r.getNode().getPorts())if(i!==r){o.push([i,i.getDegree()]);break}break}case y.NORTH_SOUTH_PORT:{let i=r.getProperty(p.ORIGIN);i!=null&&o.push([i,r.getDegree()]);break}default:break}for(let[i,s]of o){let a=this._positionOf(i);a>this._positionOf(r)&&(e+=this._indexTree.rank(a)*s,this._ends.push(a))}for(;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_initPositions(t,e,o,r,i){let s=e.length;i&&(this._nodeCardinalities=new Int32Array(t.length));let a=r?0:t.length-1,l=r?1:-1,c=g=>r?g<t.length:g>=0;for(let g=a;c(g);g+=l){let h=t[g],d=this._getPorts(h,o,r);i&&(this._nodeCardinalities[h.id]=d.length);for(let f of d)this._portPositions[f.id]=s++;for(let f of d)e.push(f)}}_initPortPositionsCounterClockwise(t,e){let o=[];return this._initPositions(t,o,u.EAST,!0,!1),this._initPositions(e,o,u.WEST,!1,!1),o}_initPositionsForNorthSouthCounting(t){let e=[],o=[],r=null,i=0;for(let s=0;s<t.length;s++){let a=t[s];switch(this._isLayoutUnitChanged(r,a)&&(i=this._emptyStack(o,e,hd,i)),a.hasProperty(p.IN_LAYER_LAYOUT_UNIT)&&(r=a.getProperty(p.IN_LAYER_LAYOUT_UNIT)),a.getType()){case y.NORMAL:for(let l of this._getNorthSouthPortsWithIncidentEdges(a,u.NORTH))this._portPositions[l.id]=i++,e.push(l);i=this._emptyStack(o,e,hd,i);for(let l of this._getNorthSouthPortsWithIncidentEdges(a,u.SOUTH))this._portPositions[l.id]=i++,e.push(l);break;case y.NORTH_SOUTH_PORT:{let l=a.getPortSideView(gI);if(l.length>0){let c=l[0];this._portPositions[c.id]=i++,e.push(c)}a.getPortSideView(hd).length>0&&o.push(a);break}case y.LONG_EDGE:{for(let l of a.getPortSideView(u.WEST))this._portPositions[l.id]=i++,e.push(l);for(let l of a.getPortSideView(u.EAST))o.push(a);break}default:break}}return this._emptyStack(o,e,hd,i),e}_emptyStack(t,e,o,r){let i=r;for(;t.length>0;){let a=t.pop().getPortSideView(o);if(a.length>0){let l=a[0];this._portPositions[l.id]=i++,e.push(l)}}return i}_getPorts(t,e,o){return e===u.EAST?o?t.getPortSideView(e):[...t.getPortSideView(e)].reverse():o?[...t.getPortSideView(e)].reverse():t.getPortSideView(e)}*_getNorthSouthPortsWithIncidentEdges(t,e){for(let o of t.getPortSideView(e))o.hasProperty(p.PORT_DUMMY)&&(yield o)}_isInLayer(t){return t.getSource().getNode().getLayer()===t.getTarget().getNode().getLayer()}_positionOf(t){return this._portPositions[t.id]}_otherEndOf(t,e){return e===t.getSource()?t.getTarget():t.getSource()}_isPortSelfLoop(t){return t.getSource()===t.getTarget()}_isLayoutUnitChanged(t,e){return t==null||t===e||!e.hasProperty(p.IN_LAYER_LAYOUT_UNIT)?!1:e.getProperty(p.IN_LAYER_LAYOUT_UNIT)!==t}},gI=u.WEST,hd=u.EAST;var dd=class{constructor(t,e,o){this._portPos=o}countCrossings(t,e){let o=this._portPos,r=0;for(let A of t)for(let B of A.getPorts()){let Y=0;for(let j of B.getOutgoingEdges())A.getLayer()!==j.getTarget().getNode().getLayer()&&Y++;Y>0&&(o[B.id]=r++)}let i=0;for(let A of e){let B=0;for(let X of A.getPorts())if(X.getSide()===u.NORTH){for(let tt of X.getIncomingEdges())if(A.getLayer()!==tt.getSource().getNode().getLayer()){B++;break}}else break;let Y=0,j=A.getPorts();for(let X=j.length-1;X>=0;X--){let tt=j[X],ot=0;for(let Lt of tt.getIncomingEdges())A.getLayer()!==Lt.getSource().getNode().getLayer()&&ot++;ot>0&&(tt.getSide()===u.NORTH?(o[tt.id]=i,i++):(o[tt.id]=i+B+Y,Y++))}i+=Y}let s=new Map,a=new Set,l=0;for(let A of t)for(let B of A.getPorts())for(let Y of B.getOutgoingEdges()){let j=Y.getTarget();if(A.getLayer()!==j.getNode().getLayer()){let X=s.get(B),tt=s.get(j);if(X==null&&tt==null){let ot=new H_(l++);a.add(ot),ot.edges.push(Y),ot.ports.push(B),s.set(B,ot),ot.ports.push(j),s.set(j,ot)}else if(X==null)tt.edges.push(Y),tt.ports.push(B),s.set(B,tt);else if(tt==null)X.edges.push(Y),X.ports.push(j),s.set(j,X);else if(X===tt)X.edges.push(Y);else{X.edges.push(Y);for(let ot of tt.ports)s.set(ot,X);for(let ot of tt.edges)X.edges.push(ot);for(let ot of tt.ports)X.ports.push(ot);a.delete(tt)}}}let c=[...a],g=t[0].getLayer(),h=e[0].getLayer();for(let A of c){A.upperLeft=r,A.upperRight=i,A.lowerLeft=0,A.lowerRight=0;for(let B of A.ports){let Y=o[B.id];B.getNode().getLayer()===g?(Y<A.upperLeft&&(A.upperLeft=Y),Y>A.lowerLeft&&(A.lowerLeft=Y)):B.getNode().getLayer()===h&&(Y<A.upperRight&&(A.upperRight=Y),Y>A.lowerRight&&(A.lowerRight=Y))}}c.sort((A,B)=>A.upperLeft!==B.upperLeft?A.upperLeft-B.upperLeft:A.upperRight!==B.upperRight?A.upperRight-B.upperRight:A.id-B.id);let d=new Int32Array(c.length),f=new Int32Array(i+1);for(let A=0;A<c.length;A++)d[A]=c[A].upperRight,f[d[A]]=1;let E=0;for(let A=0;A<f.length;A++)f[A]===1?f[A]=E:E--;let P=0;for(let A=0;A<d.length;A++)d[A]+=f[d[A]],d[A]+1>P&&(P=d[A]+1);let S=1;for(;S<P;)S*=2;let T=2*S-1;S-=1;let N=new Int32Array(T),I=0;for(let A=0;A<d.length;A++){let B=d[A]+S;for(N[B]++;B>0;)B%2>0&&(I+=N[B+1]),B=B-1>>1,N[B]++}let C=new Array(c.length*2);for(let A=0;A<c.length;A++)C[2*A]=new jn(c[A],c[A].upperLeft,c[A].lowerLeft,kr.UPPER),C[2*A+1]=new jn(c[A],c[A].lowerLeft,c[A].upperLeft,kr.LOWER);C.sort(IP);let x=0;for(let A of C)A.type===kr.UPPER?x++:(x--,I+=x);let M=new Array(c.length*2);for(let A=0;A<c.length;A++)M[2*A]=new jn(c[A],c[A].upperRight,c[A].lowerRight,kr.UPPER),M[2*A+1]=new jn(c[A],c[A].lowerRight,c[A].upperRight,kr.LOWER);M.sort(IP),x=0;for(let A of M)A.type===kr.UPPER?x++:(x--,I+=x);return I}},H_=class{constructor(t){this.id=t,this.edges=[],this.ports=[],this.upperLeft=0,this.lowerLeft=0,this.upperRight=0,this.lowerRight=0}},kr=Object.freeze({UPPER:"UPPER",LOWER:"LOWER"}),jn=class{constructor(t,e,o,r){this.hyperedge=t,this.position=e,this.oppositePosition=o,this.type=r}};function IP(n,t){return n.position!==t.position?n.position-t.position:n.oppositePosition!==t.oppositePosition?n.oppositePosition-t.oppositePosition:n.hyperedge!==t.hyperedge?n.hyperedge.id-t.hyperedge.id:n.type===kr.UPPER&&t.type===kr.LOWER?-1:n.type===kr.LOWER&&t.type===kr.UPPER?1:0}var fd=class{constructor(t){this._inLayerEdgeCounts=new Int32Array(t.length),this._hasNorthSouthPorts=new Array(t.length).fill(!1),this._hasHyperEdgesEastOfIndex=new Array(t.length).fill(!1),this._nPorts=0,this._crossingCounter=null,this._hyperedgeCrossingsCounter=null}countAllCrossings(t){if(t.length===0)return 0;let e=this._crossingCounter.countInLayerCrossingsOnSide(t[0],u.WEST);e+=this._crossingCounter.countInLayerCrossingsOnSide(t[t.length-1],u.EAST);for(let o=0;o<t.length;o++)e+=this._countCrossingsAt(o,t);return e}_countCrossingsAt(t,e){let o=0,r=e[t];if(t<e.length-1){let i=e[t+1];this._hasHyperEdgesEastOfIndex[t]?(o=this._hyperedgeCrossingsCounter.countCrossings(r,i),o+=this._crossingCounter.countInLayerCrossingsOnSide(r,u.EAST),o+=this._crossingCounter.countInLayerCrossingsOnSide(i,u.WEST)):o=this._crossingCounter.countCrossingsBetweenLayers(r,i)}return this._hasNorthSouthPorts[t]&&(o+=this._crossingCounter.countNorthSouthPortCrossingsInLayer(r)),o}initAtNodeLevel(t,e,o){o[t][e].getType()===y.NORTH_SOUTH_PORT&&(this._hasNorthSouthPorts[t]=!0)}initAtPortLevel(t,e,o,r){let i=r[t][e].getPorts()[o];i.id=this._nPorts++,i.getOutgoingEdges().length+i.getIncomingEdges().length>1&&(i.getSide()===u.EAST?this._hasHyperEdgesEastOfIndex[t]=!0:i.getSide()===u.WEST&&t>0&&(this._hasHyperEdgesEastOfIndex[t-1]=!0))}initAtEdgeLevel(t,e,o,r,i,s){let a=s[t][e].getPorts()[o];i.getSource()===a&&i.getSource().getNode().getLayer()===i.getTarget().getNode().getLayer()&&this._inLayerEdgeCounts[t]++}initAfterTraversal(){let t=new Int32Array(this._nPorts);this._hyperedgeCrossingsCounter=new dd(this._inLayerEdgeCounts,this._hasNorthSouthPorts,t),this._crossingCounter=new Fr(t)}};function hI(n,t){for(let e=0;e<t.length;e++){for(let o of n)typeof o.initAtLayerLevel=="function"&&o.initAtLayerLevel(e,t);for(let o=0;o<t[e].length;o++){for(let i of n)typeof i.initAtNodeLevel=="function"&&i.initAtNodeLevel(e,o,t);let r=t[e][o].getPorts();for(let i=0;i<r.length;i++){for(let l of n)typeof l.initAtPortLevel=="function"&&l.initAtPortLevel(e,o,i,t);let s=r[i],a=0;for(let l of s.getConnectedEdges()){for(let c of n)typeof c.initAtEdgeLevel=="function"&&c.initAtEdgeLevel(e,o,i,a,l,t);a++}}}}for(let e of n)typeof e.initAfterTraversal=="function"&&e.initAfterTraversal()}var ud={init:hI};var _d=class{constructor(t){this.node=t,this.summedWeight=0,this.degree=0,this.barycenter=null,this.visited=!1}toString(){return`BarycenterState [node=${this.node}, summedWeight=${this.summedWeight}, degree=${this.degree}, barycenter=${this.barycenter}, visited=${this.visited}]`}},ll=class{constructor(t){this._constraintsBetweenNonDummies=!1,t.length>0&&t[0].length>0&&(this._constraintsBetweenNonDummies=t[0][0].getGraph().getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES)),this.barycenterStates=new Array(t.length),this.constraintGroups=new Array(t.length),this.layoutUnits=new Map}initAtLayerLevel(t,e){this.barycenterStates[t]=new Array(e[t].length),this.constraintGroups[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){this._initAtNode(o[t][e],!0)}_initAtNode(t,e){let o=t.getLayer().id,r=t.id;if(this.constraintGroups[o][r]=new pd(this,t),e){this.barycenterStates[o][r]=new _d(t);let i=t.getProperty(p.IN_LAYER_LAYOUT_UNIT);if(i!=null){let s=this.layoutUnits.get(i);s==null&&(s=[],this.layoutUnits.set(i,s)),s.push(t)}}}getBarycenterStates(){return this.barycenterStates}processConstraints(t){if(this._constraintsBetweenNonDummies){this._processConstraints(t,!0);for(let e of t)this._initAtNode(e,!1)}this._processConstraints(t,!1)}_processConstraints(t,e){let o=new Array(t.length);for(let i=0;i<t.length;i++){let s=t[i];o[i]=this.constraintGroups[s.getLayer().id][s.id]}this._buildConstraintsGraph(o,e);let r;for(;(r=this._findViolatedConstraint(o))!=null;)this._handleViolatedConstraint(r.first,r.second,o);t.length=0;for(let i of o)for(let s of i.getNodes())t.push(s),this._stateOf(s).barycenter=i.getBarycenter()}_buildConstraintsGraph(t,e){for(let r of t)r.resetOutgoingConstraints(),r.incomingConstraintsCount=0;let o=null;for(let r of t){let i=r.getNode();if(!(e&&i.getType()!==y.NORMAL)){for(let s of i.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS))(!e||s.getType()===y.NORMAL)&&(r.getOutgoingConstraints().push(this._groupOf(s)),this._groupOf(s).incomingConstraintsCount++);if(!e&&i.getType()===y.NORMAL){if(o!=null){let s=this.layoutUnits.get(o)||[],a=this.layoutUnits.get(i)||[];for(let l of s)for(let c of a)this._groupOf(l).getOutgoingConstraints().push(this._groupOf(c)),this._groupOf(c).incomingConstraintsCount++}o=i}}}}_findViolatedConstraint(t){let e=null;for(let o of t)o.resetIncomingConstraints(),o.hasOutgoingConstraints()&&o.incomingConstraintsCount===0&&(e==null&&(e=[]),e.push(o));if(e!=null)for(;e.length>0;){let o=e.shift();if(o.hasIncomingConstraints()){for(let r of o.getIncomingConstraints())if(r.getBarycenter()===o.getBarycenter()){if(t.indexOf(r)>t.indexOf(o))return Gt.of(r,o)}else if(r.getBarycenter()>o.getBarycenter())return Gt.of(r,o)}for(let r of o.getOutgoingConstraints()){let i=r.getIncomingConstraints();i.unshift(o),r.incomingConstraintsCount===i.length&&e.push(r)}}return null}_handleViolatedConstraint(t,e,o){let r=pd.merge(this,t,e),i=!1,s=0;for(;s<o.length;){let a=o[s];if(a===t||a===e){o.splice(s,1);continue}if(!i&&a.getBarycenter()>r.getBarycenter()){o.splice(s,0,r),i=!0,s++;continue}if(a.hasOutgoingConstraints()){let l=a.getOutgoingConstraints(),c=Ed(l,t),g=Ed(l,e);(c||g)&&(l.push(r),r.incomingConstraintsCount++)}s++}i||o.push(r)}_groupOf(t){return this.constraintGroups[t.getLayer().id][t.id]}_stateOf(t){return this.barycenterStates[t.getLayer().id][t.id]}},RP=1e-4,pd=class n{constructor(t,e){this._resolver=t,this.nodes=[e],this.summedWeight=0,this.degree=0,this.outgoingConstraints=null,this.incomingConstraints=null,this.incomingConstraintsCount=0}static merge(t,e,o){let r=Object.create(n.prototype);if(r._resolver=t,r.nodes=e.nodes.concat(o.nodes),r.summedWeight=e.summedWeight+o.summedWeight,r.degree=e.degree+o.degree,r.outgoingConstraints=null,r.incomingConstraints=null,r.incomingConstraintsCount=0,e.outgoingConstraints!=null){if(r.outgoingConstraints=e.outgoingConstraints.slice(),Ed(r.outgoingConstraints,o),o.outgoingConstraints!=null)for(let s of o.outgoingConstraints)s!==e&&(r.outgoingConstraints.indexOf(s)>=0?s.incomingConstraintsCount--:r.outgoingConstraints.push(s))}else o.outgoingConstraints!=null&&(r.outgoingConstraints=o.outgoingConstraints.slice(),Ed(r.outgoingConstraints,e));r.degree>0?r.setBarycenter(r.summedWeight/r.degree):e.getBarycenter()!=null&&o.getBarycenter()!=null?r.setBarycenter((e.getBarycenter()+o.getBarycenter())/2):e.getBarycenter()!=null?r.setBarycenter(e.getBarycenter()):o.getBarycenter()!=null&&r.setBarycenter(o.getBarycenter());let i=r.getBarycenter();if(i!=null){let s=o.getBarycenter(),a=e.getBarycenter();if(s!=null&&i+RP<s)throw new Error("merged barycenter fell below second group barycenter");if(a!=null&&i-RP>a)throw new Error("merged barycenter rose above first group barycenter")}return r}setBarycenter(t){for(let e of this.nodes)this._resolver._stateOf(e).barycenter=t}getBarycenter(){return this._resolver._stateOf(this.nodes[0]).barycenter}getOutgoingConstraints(){return this.outgoingConstraints==null&&(this.outgoingConstraints=[]),this.outgoingConstraints}resetOutgoingConstraints(){this.outgoingConstraints=null}hasOutgoingConstraints(){return this.outgoingConstraints!=null&&this.outgoingConstraints.length>0}getIncomingConstraints(){return this.incomingConstraints==null&&(this.incomingConstraints=[]),this.incomingConstraints}resetIncomingConstraints(){this.incomingConstraints=null}hasIncomingConstraints(){return this.incomingConstraints!=null&&this.incomingConstraints.length>0}getNodes(){return this.nodes}getNode(){if(this.nodes.length!==1)throw new Error("ConstraintGroup.getNode called on a multi-node group");return this.nodes[0]}toString(){let t="[";for(let e=0;e<this.nodes.length;e++){t+=this.nodes[e].toString();let o=this.getBarycenter();o!=null&&(t+=`<${o}>`),e<this.nodes.length-1&&(t+=", ")}return t+"]"}};function Ed(n,t){let e=n.indexOf(t);return e<0?!1:(n.splice(e,1),!0)}var LP=.07,$n=class{constructor(t,e,o,r){this.constraintResolver=t,this.random=e,this.portDistributor=o,this.portRanks=null,this.barycenterState=null,this.barycenterStateComparator=(i,s)=>{let a=this.stateOf(i),l=this.stateOf(s);return a.barycenter!=null&&l.barycenter!=null?a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:0:a.barycenter!=null?-1:l.barycenter!=null?1:0}}minimizeCrossingsList(t,e,o,r){if(o?this.randomizeBarycenters(t):(this.calculateBarycenters(t,r),this.fillInUnknownBarycenters(t,e)),t.length>1){if(t[0].getGraph().getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER))throw new Error("CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER requires ModelOrderBarycenterHeuristic");t.sort(this.barycenterStateComparator),this.constraintResolver.processConstraints(t)}}randomizeBarycenters(t){for(let e of t){let o=this.stateOf(e);o.barycenter=this.random.nextDouble(),o.summedWeight=o.barycenter,o.degree=1}}fillInUnknownBarycenters(t,e){if(e){let o=-1;for(let r=0;r<t.length;r++){let i=t[r],s=this.stateOf(i),a=s.barycenter;if(a==null){let l=o+1;for(let c=r+1;c<t.length;c++){let g=this.stateOf(t[c]).barycenter;if(g!=null){l=g;break}}a=(o+l)/2,s.barycenter=a,s.summedWeight=a,s.degree=1}o=a}}else{let o=0;for(let r of t){let i=this.stateOf(r).barycenter;i!=null&&(o=Math.max(o,i))}o+=2;for(let r of t){let i=this.stateOf(r);if(i.barycenter==null){let s=this.random.nextFloat()*o-1;i.barycenter=s,i.summedWeight=s,i.degree=1}}}}calculateBarycenters(t,e){for(let o of t)this.stateOf(o).visited=!1;for(let o of t)this._calculateBarycenter(o,e)}_calculateBarycenter(t,e){let o=this.stateOf(t);if(o.visited)return;o.visited=!0,o.degree=0,o.summedWeight=0,o.barycenter=null;for(let i of t.getPorts()){let s=e?i.getPredecessorPorts():i.getSuccessorPorts();for(let a of s){let l=a.getNode();if(l.getLayer()===t.getLayer()){if(l!==t){this._calculateBarycenter(l,e);let c=this.stateOf(l);o.degree+=c.degree,o.summedWeight+=c.summedWeight}}else o.summedWeight+=this.portRanks[a.id],o.degree++}}let r=t.getProperty(p.BARYCENTER_ASSOCIATES);if(r!=null){for(let i of r)if(t.getLayer()===i.getLayer()){this._calculateBarycenter(i,e);let s=this.stateOf(i);o.degree+=s.degree,o.summedWeight+=s.summedWeight}}o.degree>0&&(o.summedWeight+=this.random.nextFloat()*LP-LP/2,o.barycenter=o.summedWeight/o.degree)}stateOf(t){return this.barycenterState[t.getLayer().id][t.id]}minimizeCrossings(t,e,o,r){if(!this._isFirstLayer(t,e,o)){let l=t[e-fI(o)];this.portDistributor.calculatePortRanksLayer(l,uI(o))}let i=t[e][0],s=!r||dI(i),a=Array.from(t[e]);this.minimizeCrossingsList(a,s,!1,o);for(let l=0;l<a.length;l++)t[e][l]=a[l];return!1}setFirstLayerOrder(t,e){let o=AP(e,t.length),r=Array.from(t[o]);this.minimizeCrossingsList(r,!1,!0,e);for(let i=0;i<r.length;i++)t[o][i]=r[i];return!1}alwaysImproves(){return!1}isDeterministic(){return!1}_isFirstLayer(t,e,o){return e===AP(o,t.length)}initAfterTraversal(){this.barycenterState=this.constraintResolver.getBarycenterStates(),this.portRanks=this.portDistributor.getPortRanks()}initAtLayerLevel(t,e){e[t][0].getLayer().id=t}};function dI(n){return n.getType()===y.EXTERNAL_PORT}function fI(n){return n?1:-1}function uI(n){return n?W.OUTPUT:W.INPUT}function AP(n,t){return n?0:Math.max(0,t-1)}var qn=class{constructor(t,e){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._portPositions=new Map,this._easternAdjacencies=new Map,this._westernAdjacencies=new Map,this._currentNodeOrder=t,this._freeLayerIndex=e,this._upperAdjacencies=null,this._lowerAdjacencies=null,this._setPortPositionsForNeighbouringLayers()}_setPortPositionsForNeighbouringLayers(){this._freeLayerIsNotFirstLayer()&&this._setPortPositionsForLayer(this._freeLayerIndex-1,u.EAST),this._freeLayerIsNotLastLayer()&&this._setPortPositionsForLayer(this._freeLayerIndex+1,u.WEST)}_freeLayerIsNotFirstLayer(){return this._freeLayerIndex>0}_freeLayerIsNotLastLayer(){return this._freeLayerIndex<this._currentNodeOrder.length-1}_setPortPositionsForLayer(t,e){let o=0;for(let r of this._currentNodeOrder[t]){let i=zi(r,e);for(let s of i)this._portPositions.set(s,o++)}}countEasternEdgeCrossings(t,e){this._resetCrossingCount(),t!==e&&this._addEasternCrossings(t,e)}countWesternEdgeCrossings(t,e){this._resetCrossingCount(),t!==e&&this._addWesternCrossings(t,e)}countBothSideCrossings(t,e){this._resetCrossingCount(),t!==e&&(this._addWesternCrossings(t,e),this._addEasternCrossings(t,e))}_resetCrossingCount(){this._upperLowerCrossings=0,this._lowerUpperCrossings=0}_addEasternCrossings(t,e){this._upperAdjacencies=this._getAdjacencyFor(t,u.EAST,this._easternAdjacencies),this._lowerAdjacencies=this._getAdjacencyFor(e,u.EAST,this._easternAdjacencies),!(this._upperAdjacencies.size()===0||this._lowerAdjacencies.size()===0)&&this._countCrossingsByMergingAdjacencyLists()}_addWesternCrossings(t,e){this._upperAdjacencies=this._getAdjacencyFor(t,u.WEST,this._westernAdjacencies),this._lowerAdjacencies=this._getAdjacencyFor(e,u.WEST,this._westernAdjacencies),!(this._upperAdjacencies.size()===0||this._lowerAdjacencies.size()===0)&&this._countCrossingsByMergingAdjacencyLists()}_getAdjacencyFor(t,e,o){if(o.size===0)for(let i of this._currentNodeOrder[this._freeLayerIndex])o.set(i,new v_(i,e,this._portPositions));let r=o.get(t);return r.reset(),r}_countCrossingsByMergingAdjacencyLists(){for(;!this._upperAdjacencies.isEmpty()&&!this._lowerAdjacencies.isEmpty();)CP(this._upperAdjacencies.first(),this._lowerAdjacencies.first())?(this._upperLowerCrossings+=this._upperAdjacencies.size(),this._lowerAdjacencies.removeFirst()):CP(this._lowerAdjacencies.first(),this._upperAdjacencies.first())?(this._lowerUpperCrossings+=this._lowerAdjacencies.size(),this._upperAdjacencies.removeFirst()):(this._upperLowerCrossings+=this._upperAdjacencies.countAdjacenciesBelowNodeOfFirstPort(),this._lowerUpperCrossings+=this._lowerAdjacencies.countAdjacenciesBelowNodeOfFirstPort(),this._upperAdjacencies.removeFirst(),this._lowerAdjacencies.removeFirst())}getUpperLowerCrossings(){return this._upperLowerCrossings}getLowerUpperCrossings(){return this._lowerUpperCrossings}};function CP(n,t){return n>t}var v_=class{constructor(t,e,o){this._node=t,this._side=e,this._portPositions=o,this._adjacencies=[],this._size=0,this._currentSize=0,this._currentIndex=0,this._collectSortedAdjacencies()}_collectSortedAdjacencies(){let t=zi(this._node,this._side);for(let e of t){let o=this._side===u.WEST?e.getIncomingEdges():e.getOutgoingEdges();for(let r of o)r.isSelfLoop()||r.getSource().getNode().getLayer()!==r.getTarget().getNode().getLayer()&&(this._addAdjacencyOf(r),this._size++,this._currentSize++)}this._adjacencies.sort((e,o)=>e.position-o.position)}_addAdjacencyOf(t){let e=this._side===u.WEST?t.getSource():t.getTarget(),o=this._portPositions.get(e),r=this._adjacencies.length-1;this._adjacencies.length>0&&this._adjacencies[r].position===o?(this._adjacencies[r].cardinality++,this._adjacencies[r].currentCardinality++):this._adjacencies.push(new B_(o))}reset(){this._currentIndex=0,this._currentSize=this._size,this.isEmpty()||this._currentAdjacency().reset()}countAdjacenciesBelowNodeOfFirstPort(){return this._currentSize-this._currentAdjacency().currentCardinality}removeFirst(){if(this.isEmpty())return;let t=this._currentAdjacency();t.currentCardinality===1?this._incrementCurrentIndex():t.currentCardinality--,this._currentSize--}_incrementCurrentIndex(){this._currentIndex++,this._currentIndex<this._adjacencies.length&&this._currentAdjacency().reset()}isEmpty(){return this._currentSize===0}first(){return this._currentAdjacency().position}size(){return this._currentSize}_currentAdjacency(){return this._adjacencies[this._currentIndex]}toString(){return`AdjacencyList [node=${this._node}, adjacencies=${this._adjacencies.map(t=>t.toString())}]`}},B_=class{constructor(t){this.position=t,this.cardinality=1,this.currentCardinality=1}reset(){this.currentCardinality=this.cardinality}toString(){return`Adjacency [position=${this.position}, cardinality=${this.cardinality}, currentCardinality=${this.currentCardinality}]`}};var md=class{constructor(){this.crossingsCounter=null,this._nPorts=0,this.portPos=null,this._hierarchicalCrossingsCounter=null}distributePortsWhileSweeping(t,e,o){return this._initialize(t,e,o),this._distributePortsInLayer(t,e,o)}_distributePortsInLayer(t,e,o){let r=o?u.WEST:u.EAST,i=!1;for(let s of t[e]){if(s.getProperty(_.PORT_CONSTRAINTS).isOrderFixed())continue;let a=s.getNestedGraph(),l=s.getPortSideView(r).length>0&&a!=null;if(l){let c=a.toNodeArray();this._hierarchicalCrossingsCounter=new qn(c,o?0:c.length-1)}i=this._distributePortsOnNode(s,r,l)||i}return i}_distributePortsOnNode(t,e,o){let r=t.getPortSideView(e);e===u.SOUTH||e===u.WEST?r=r.slice().reverse():r=r.slice();let i=!1,s;do{s=!1;for(let a=0;a<r.length-1;a++){let l=r[a],c=r[a+1];this._switchingDecreasesCrossings(l,c,o)&&(i=!0,this._switchPorts(r,a,a+1),s=!0)}}while(s);return i}_switchingDecreasesCrossings(t,e,o){let r=this.crossingsCounter.countCrossingsBetweenPortsInBothOrders(t,e),i=r.getFirst(),s=r.getSecond();if(o){let a=t.getProperty(p.PORT_DUMMY),l=e.getProperty(p.PORT_DUMMY);a!=null&&l!=null&&(this._hierarchicalCrossingsCounter.countBothSideCrossings(a,l),i+=this._hierarchicalCrossingsCounter.getUpperLowerCrossings(),s+=this._hierarchicalCrossingsCounter.getLowerUpperCrossings())}return i>s}_switchPorts(t,e,o){this.crossingsCounter.switchPorts(t[e],t[o]);let r=t[o];t[o]=t[e],t[e]=r}_initialize(t,e,o){o&&e>0?this.crossingsCounter.initForCountingBetween(t[e-1],t[e]):!o&&e<t.length-1?this.crossingsCounter.initForCountingBetween(t[e],t[e+1]):this.crossingsCounter.initPortPositionsForInLayerCrossings(t[e],o?u.WEST:u.EAST)}initAtNodeLevel(t,e,o){this._nPorts+=o[t][e].getPorts().length,this._nPorts}initAfterTraversal(){this.portPos=new Int32Array(this._nPorts),this.crossingsCounter=new Fr(this.portPos)}};var Jn=class{constructor(t){this.portRanks=null,this.minBarycenter=0,this.maxBarycenter=0,this.nodePositions=new Array(t),this.portBarycenter=null,this.inLayerPorts=[],this._nPorts=0}getPortRanks(){return this.portRanks}distributePortsWhileSweeping(t,e,o){this._updateNodePositions(t,e);let r=t[e],i=o?u.WEST:u.EAST;if(this._isNotFirstLayer(t.length,e,o)){let s=t[o?e-1:e+1];this.calculatePortRanksLayer(s,xP(o));for(let a of r)this._distributePorts(a,i);this.calculatePortRanksLayer(r,xP(!o));for(let a of s)_I(a)||this._distributePorts(a,i.opposed())}else for(let s of r)this._distributePorts(s,i);return!1}calculatePortRanksLayer(t,e){let o=0;for(let r=0;r<t.length;r++)o+=this.calculatePortRanks(t[r],o,e)}calculatePortRanks(t,e,o){throw new Error("abstract method \u2014 subclass must override calculatePortRanks(node, rankSum, type)")}_distributePorts(t,e){t.getProperty(_.PORT_CONSTRAINTS).isOrderFixed()||(this._distributePortsSubset(t,t.getPorts(e)),this._distributePortsSubset(t,t.getPorts(u.SOUTH)),this._distributePortsSubset(t,t.getPorts(u.NORTH)),this._sortPorts(t))}_distributePortsSubset(t,e){this.inLayerPorts.length=0,this._iteratePortsAndCollectInLayerPorts(t,e),this.inLayerPorts.length>0&&this._calculateInLayerPortsBarycenterValues(t)}_iteratePortsAndCollectInLayerPorts(t,e){this.minBarycenter=0,this.maxBarycenter=0;let o=2*t.getLayer().getNodes().length+1;t:for(let r of e){let i=r.getSide(),s=i===u.NORTH||i===u.SOUTH,a=0;if(s){let l=r.getProperty(p.PORT_DUMMY);if(l==null)continue;a+=this._dealWithNorthSouthPorts(o,r,l)}else{for(let l of r.getOutgoingEdges()){let c=l.getTarget();if(c.getNode().getLayer()===t.getLayer()){this.inLayerPorts.push(r);continue t}else a+=this.portRanks[c.id]}for(let l of r.getIncomingEdges()){let c=l.getSource();if(c.getNode().getLayer()===t.getLayer()){this.inLayerPorts.push(r);continue t}else a-=this.portRanks[c.id]}}r.getDegree()>0?(this.portBarycenter[r.id]=a/r.getDegree(),this.minBarycenter=Math.min(this.minBarycenter,this.portBarycenter[r.id]),this.maxBarycenter=Math.max(this.maxBarycenter,this.portBarycenter[r.id])):s&&(this.portBarycenter[r.id]=a)}}_calculateInLayerPortsBarycenterValues(t){let e=this._positionOfNode(t)+1,o=t.getLayer().getNodes().length+1;for(let r of this.inLayerPorts){let i=0,s=0;for(let c of r.getConnectedPorts())c.getNode().getLayer()===t.getLayer()&&(i+=this._positionOfNode(c.getNode())+1,s++);let a=i/s,l=r.getSide();l===u.EAST?a<e?this.portBarycenter[r.id]=this.minBarycenter-a:this.portBarycenter[r.id]=this.maxBarycenter+(o-a):l===u.WEST&&(a<e?this.portBarycenter[r.id]=this.maxBarycenter+a:this.portBarycenter[r.id]=this.minBarycenter-(o-a))}}_dealWithNorthSouthPorts(t,e,o){let r=!1,i=!1;for(let a of o.getPorts())a.getProperty(p.ORIGIN)===e&&(a.getOutgoingEdges().length>0?i=!0:a.getIncomingEdges().length>0&&(r=!0));let s=0;return r&&r!==i?s=e.getSide()===u.NORTH?-this._positionOfNode(o):t-this._positionOfNode(o):i&&r!==i?s=this._positionOfNode(o)+1:r&&i&&(s=e.getSide()===u.NORTH?0:t/2),s}_positionOfNode(t){return this.nodePositions[t.getLayer().id][t.id]}_updateNodePositions(t,e){let o=t[e];for(let r=0;r<o.length;r++){let i=o[r];this.nodePositions[i.getLayer().id][i.id]=r}}_isNotFirstLayer(t,e,o){return o?e!==0:e!==t-1}_sortPorts(t){let e=t.getPorts(),o=this.portBarycenter;e.sort((r,i)=>{let s=r.getSide(),a=i.getSide();if(s!==a)return s.ordinal()-a.ordinal();let l=o[r.id],c=o[i.id];return l===0&&c===0?0:l===0?-1:c===0?1:l<c?-1:l>c?1:0})}initAtLayerLevel(t,e){this.nodePositions[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){let r=o[t][e];r.id=e,this.nodePositions[t][e]=e}initAtPortLevel(t,e,o,r){r[t][e].getPorts()[o].id=this._nPorts++}initAfterTraversal(){this.portRanks=new Float32Array(this._nPorts),this.portBarycenter=new Float32Array(this._nPorts)}};function xP(n){return n?W.OUTPUT:W.INPUT}function _I(n){return n.getNestedGraph()!=null}var Qn=class extends Jn{constructor(t){super(t)}calculatePortRanks(t,e,o){let r=this.getPortRanks();if(o===W.INPUT){let i=0,s=0;for(let g of t.getPorts())g.getIncomingEdges().length>0&&(i++,g.getSide()===u.NORTH&&s++);let a=1/(i+1),l=e+s*a,c=e+1-a;for(let g of t.getPorts(W.INPUT))g.getSide()===u.NORTH?(r[g.id]=l,l-=a):(r[g.id]=c,c-=a)}else if(o===W.OUTPUT){let i=0;for(let l of t.getPorts())l.getOutgoingEdges().length>0&&i++;let s=1/(i+1),a=e+s;for(let l of t.getPorts(W.OUTPUT))r[l.id]=a,a+=s}else throw new Error("Port type is undefined");return 1}};var Pd=class extends Jn{constructor(t){super(t)}calculatePortRanks(t,e,o){let r=this.getPortRanks();if(o===W.INPUT){let i=0,s=0;for(let c of t.getPorts())c.getIncomingEdges().length>0&&(i++,c.getSide()===u.NORTH&&s++);let a=e+s,l=e+i;for(let c of t.getPorts(W.INPUT))c.getSide()===u.NORTH?(r[c.id]=a,a--):(r[c.id]=l,l--);return i}if(o===W.OUTPUT){let i=0;for(let s of t.getPorts(W.OUTPUT))i++,r[s.id]=e+i;return i}throw new Error("Port type is undefined")}};var Od=class{static create(t,e,o){return t===oe.TWO_SIDED_GREEDY_SWITCH?new md:e.nextBoolean()?new Qn(o.length):new Pd(o.length)}};var Sd=class{constructor(t){this.graphData=t,this.nodeInfo=new Array(t.currentNodeOrder().length)}useBottomUp(){let t=this.graphData.lGraph().getProperty(_.CROSSING_MINIMIZATION_HIERARCHICAL_SWEEPINESS);if(pI(t)||this._rootNode()||this._fixedPortOrder()||this._fewerThanTwoInOutEdges())return!0;if(this.graphData.crossMinDeterministic())return!1;let e=0,o=0,r=[];for(let a of this.graphData.currentNodeOrder()){for(let l of a){if(OI(l)){r.push(l);continue}let c=this._nodeInfoFor(l);PI(l)?(c.hierarchicalInfluence=1,SI(l)&&(o+=c.connectedEdges)):mI(l)?c.randomInfluence=1:EI(l)&&(e+=c.connectedEdges);for(let g of l.getOutgoingEdges())e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoToTarget(c,g);for(let g of l.getPortSideView(u.NORTH)){let h=g.getProperty(p.PORT_DUMMY);h!=null&&(e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoTo(c,h))}for(let g of l.getPortSideView(u.SOUTH)){let h=g.getProperty(p.PORT_DUMMY);h!=null&&(e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoTo(c,h))}}for(let l of r){let c=this._nodeInfoFor(l);for(let g of l.getOutgoingEdges())e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoToTarget(c,g)}r.length=0}let i=e+o;return(i===0?Number.POSITIVE_INFINITY:(e-o)/i)>=t}_fixedPortOrder(){return this.graphData.parent().getProperty(_.PORT_CONSTRAINTS).isOrderFixed()}_transferInfoToTarget(t,e){let o=e.getTarget().getNode();this._transferInfoTo(t,o)}_transferInfoTo(t,e){let o=this._nodeInfoFor(e);o.transfer(t),o.connectedEdges++}_fewerThanTwoInOutEdges(){let t=this.graphData.parent();return t.getPortSideView(u.EAST).length<2&&t.getPortSideView(u.WEST).length<2}_rootNode(){return!this.graphData.hasParent()}_nodeInfoFor(t){return this.nodeInfo[t.getLayer().id][t.id]}initAtLayerLevel(t,e){e[t][0].getLayer().id=t,this.nodeInfo[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){o[t][e].id=e,this.nodeInfo[t][e]=new U_}},U_=class{constructor(){this.connectedEdges=0,this.hierarchicalInfluence=0,this.randomInfluence=0}transfer(t){this.hierarchicalInfluence+=t.hierarchicalInfluence,this.randomInfluence+=t.randomInfluence,this.connectedEdges+=t.connectedEdges}toString(){return`NodeInfo [connectedEdges=${this.connectedEdges}, hierarchicalInfluence=${this.hierarchicalInfluence}, randomInfluence=${this.randomInfluence}]`}};function pI(n){return n<-1}function EI(n){let t=n.getPortSideView(u.EAST);if(t.length===0)return!0;for(let e of t)if(!e.getConnectedEdges()[Symbol.iterator]().next().done)return!1;return!0}function mI(n){let t=n.getPortSideView(u.WEST);if(t.length===0)return!0;for(let e of t)if(!e.getConnectedEdges()[Symbol.iterator]().next().done)return!1;return!0}function PI(n){return n.getType()===y.EXTERNAL_PORT}function OI(n){return n.getType()===y.NORTH_SOUTH_PORT}function SI(n){return n.getProperty(p.ORIGIN).getSide()===u.EAST}var Td=class{constructor(t){this.random=t,this.weightComparator=(e,o)=>{if(!e.hasProperty(p.WEIGHT))return 1;if(!o.hasProperty(p.WEIGHT))return-1;let r=e.getProperty(p.WEIGHT),i=o.getProperty(p.WEIGHT);return r!=null&&i!=null?r<i?-1:r>i?1:0:r!=null?-1:i!=null?1:0}}alwaysImproves(){return!1}isDeterministic(){return!0}setFirstLayerOrder(t,e){let o=e?0:Math.max(0,t.length-1),r=Array.from(t[o]);for(let i of r)i.setProperty(p.WEIGHT,this.random.nextDouble());r.sort(this.weightComparator);for(let i=0;i<r.length;i++){let s=r[i];t[o][i]=s,s.setProperty(p.WEIGHT,i+1)}return!1}minimizeCrossings(t,e,o,r){let i=Array.from(t[e]);this._calculateMedians(i,o?e-1:e+1),i.sort(this.weightComparator);for(let s=0;s<i.length;s++)t[e][s]=i[s];return!1}_calculateMedians(t,e){let o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=[];for(let a of t){let l=[];for(let c of a.getIncomingEdges()){let g=c.getTarget().getNode(),h=c.getSource().getNode();g.getLayer().id===e&&l.push(g),h.getLayer().id===e&&l.push(h)}for(let c of a.getOutgoingEdges()){let g=c.getTarget().getNode(),h=c.getSource().getNode();g.getLayer().id===e&&l.push(g),h.getLayer().id===e&&l.push(h)}if(l.length===0)i.push(a);else{l.sort(this.weightComparator);let c=Math.floor(l.length/2),g=l[c].getProperty(p.WEIGHT);a.setProperty(p.WEIGHT,g),o=Math.min(o,g),r=Math.max(r,g)}}let s=(r+o)/2;for(let a of i)a.setProperty(p.WEIGHT,s)}};var Nd=class n extends $n{constructor(t,e,o,r){super(t,e,o,r),this.biggerThan=new Map,this.smallerThan=new Map,this.barycenterStateComparator=(i,s)=>{let a=i.hasProperty(_.LAYERING_LAYER_CONSTRAINT)&&DP(i.getProperty(_.LAYERING_LAYER_CONSTRAINT)),l=s.hasProperty(_.LAYERING_LAYER_CONSTRAINT)&&DP(s.getProperty(_.LAYERING_LAYER_CONSTRAINT));if(a||l)return 0;let c=i.getGraph(),g=this._compareBasedOnTransitiveDependencies(i,s);if(g!==0)return g;if(i.hasProperty(p.MODEL_ORDER)&&s.hasProperty(p.MODEL_ORDER)){let h=c.getProperty(p.MAX_MODEL_ORDER_NODES),d=Qe.calculateModelOrderOrGroupModelOrder(i,s,c,h),f=Qe.calculateModelOrderOrGroupModelOrder(s,i,c,h),E=Math.sign(d-f);if(c.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY)===Wt.ONLY_WITHIN_GROUP&&i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID)!==s.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID)&&(E=0),E<0)return this._updateBiggerAndSmallerAssociations(i,s),E;if(E>0)return this._updateBiggerAndSmallerAssociations(s,i),E}return this._compareBasedOnBarycenter(i,s)}}minimizeCrossingsList(t,e,o,r){if(o?this.randomizeBarycenters(t):(this.calculateBarycenters(t,r),this.fillInUnknownBarycenters(t,e)),t.length>1){let s=t[0].getGraph().getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER);s?n.insertionSort(t,this.barycenterStateComparator,this):t.sort(this.barycenterStateComparator),s||this.constraintResolver.processConstraints(t)}}_compareBasedOnTransitiveDependencies(t,e){if(!this.biggerThan.has(t))this.biggerThan.set(t,new Set);else if(this.biggerThan.get(t).has(e))return 1;if(!this.biggerThan.has(e))this.biggerThan.set(e,new Set);else if(this.biggerThan.get(e).has(t))return-1;if(!this.smallerThan.has(t))this.smallerThan.set(t,new Set);else if(this.smallerThan.get(t).has(e))return-1;if(!this.smallerThan.has(e))this.smallerThan.set(e,new Set);else if(this.smallerThan.get(e).has(t))return 1;return 0}_compareBasedOnBarycenter(t,e){let o=this.stateOf(t),r=this.stateOf(e);if(o.barycenter!=null&&r.barycenter!=null){let i=0;return o.barycenter<r.barycenter?i=-1:o.barycenter>r.barycenter&&(i=1),i<0?this._updateBiggerAndSmallerAssociations(t,e):i>0&&this._updateBiggerAndSmallerAssociations(e,t),i}return o.barycenter!=null?(this._updateBiggerAndSmallerAssociations(t,e),-1):r.barycenter!=null?(this._updateBiggerAndSmallerAssociations(e,t),1):0}_updateBiggerAndSmallerAssociations(t,e){let o=this.biggerThan.get(t),r=this.biggerThan.get(e),i=this.smallerThan.get(t),s=this.smallerThan.get(e);o.add(e),s.add(t);for(let a of r){o.add(a);let l=this.smallerThan.get(a);l.add(t);for(let c of i)l.add(c)}for(let a of i){s.add(a);let l=this.biggerThan.get(a);l.add(e);for(let c of r)l.add(c)}}static insertionSort(t,e,o){for(let r=1;r<t.length;r++){let i=t[r],s=r;for(;s>0&&e(t[s-1],i)>0;)t[s]=t[s-1],s--;t[s]=i}o.clearTransitiveOrdering()}clearTransitiveOrdering(){this.biggerThan=new Map,this.smallerThan=new Map}};function DP(n){return n===J.FIRST_SEPARATE||n===J.LAST_SEPARATE}var er=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};er.WEST=new er("WEST");er.EAST=new er("EAST");var yd=class{constructor(t,e,o,r){this._direction=r,this._oneSided=t===oe.ONE_SIDED_GREEDY_SWITCH;let s=e[o].length;this._isCrossingMatrixFilled=new Array(s),this._crossingMatrix=new Array(s);for(let a=0;a<s;a++)this._isCrossingMatrixFilled[a]=new Array(s).fill(!1),this._crossingMatrix[a]=new Array(s).fill(0);this._inBetweenLayerCrossingCounter=new qn(e,o)}getCrossingMatrixEntry(t,e){return this._isCrossingMatrixFilled[t.id][e.id]||(this._fillCrossingMatrix(t,e),this._isCrossingMatrixFilled[t.id][e.id]=!0,this._isCrossingMatrixFilled[e.id][t.id]=!0),this._crossingMatrix[t.id][e.id]}_fillCrossingMatrix(t,e){this._oneSided?this._direction===er.EAST?this._inBetweenLayerCrossingCounter.countEasternEdgeCrossings(t,e):this._direction===er.WEST&&this._inBetweenLayerCrossingCounter.countWesternEdgeCrossings(t,e):this._inBetweenLayerCrossingCounter.countBothSideCrossings(t,e),this._crossingMatrix[t.id][e.id]=this._inBetweenLayerCrossingCounter.getUpperLowerCrossings(),this._crossingMatrix[e.id][t.id]=this._inBetweenLayerCrossingCounter.getLowerUpperCrossings()}};var Ad=class{constructor(t){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._portPositions=new Map,this._layer=t,this._initializePortPositions()}_initializePortPositions(){for(let t of this._layer)this._setPortIdsOn(t,u.SOUTH),this._setPortIdsOn(t,u.NORTH)}_setPortIdsOn(t,e){let o=0;for(let r of zi(t,e))this._portPositions.set(r,o++)}countCrossings(t,e){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._processIfTwoNorthSouthNodes(t,e),this._processIfNorthSouthLongEdgeDummyCrossing(t,e),this._processIfNormalNodeWithNSPortsAndLongEdgeDummy(t,e)}_processIfTwoNorthSouthNodes(t,e){Ld(t)&&Ld(e)&&!this._haveDifferentOrigins(t,e)&&(this._isNorthOfNormalNode(t)?this._countCrossingsOfTwoNorthSouthDummies(t,e):this._countCrossingsOfTwoNorthSouthDummies(e,t))}_countCrossingsOfTwoNorthSouthDummies(t,e){if(this._originPortPositionOf(t)>this._originPortPositionOf(e)){let o=e.getPortSideView(u.EAST);this._upperLowerCrossings=o.length===0?0:o[0].getDegree();let r=t.getPortSideView(u.WEST);this._lowerUpperCrossings=r.length===0?0:r[0].getDegree()}else{let o=e.getPortSideView(u.WEST);this._upperLowerCrossings=o.length===0?0:o[0].getDegree();let r=t.getPortSideView(u.EAST);this._lowerUpperCrossings=r.length===0?0:r[0].getDegree()}}_processIfNorthSouthLongEdgeDummyCrossing(t,e){Ld(t)&&Rd(e)?this._isNorthOfNormalNode(t)?this._upperLowerCrossings=1:this._lowerUpperCrossings=1:Ld(e)&&Rd(t)&&(this._isNorthOfNormalNode(e)?this._lowerUpperCrossings=1:this._upperLowerCrossings=1)}_processIfNormalNodeWithNSPortsAndLongEdgeDummy(t,e){bP(t)&&Rd(e)&&(this._upperLowerCrossings=Id(t,u.SOUTH),this._lowerUpperCrossings=Id(t,u.NORTH)),bP(e)&&Rd(t)&&(this._upperLowerCrossings=Id(e,u.NORTH),this._lowerUpperCrossings=Id(e,u.SOUTH))}_haveDifferentOrigins(t,e){return MP(t)!==MP(e)}_originPortPositionOf(t){let e=wP(t);return this._portPositions.get(e)}_isNorthOfNormalNode(t){return wP(t).getSide()===u.NORTH}getUpperLowerCrossings(){return this._upperLowerCrossings}getLowerUpperCrossings(){return this._lowerUpperCrossings}};function Id(n,t){let e=0;for(let o of n.getPortSideView(t))o.getProperty(p.PORT_DUMMY)!=null&&e++;return e}function wP(n){return n.getPorts()[0].getProperty(p.ORIGIN)}function MP(n){return n.getProperty(p.ORIGIN)}function Rd(n){return n.getType()===y.LONG_EDGE}function Ld(n){return n.getType()===y.NORTH_SOUTH_PORT}function bP(n){return n.getType()===y.NORMAL}var xd=class{constructor(t,e,o,r,i,s){if(this._crossingMatrixFiller=o,this._graphData=i,t>=e.length)throw new RangeError("Greedy SwitchDecider: Free layer not in graph.");this._freeLayer=e[t],this._leftInLayerCounter=new Fr(r),this._leftInLayerCounter.initPortPositionsForInLayerCrossings(this._freeLayer,u.WEST),this._rightInLayerCounter=new Fr(r),this._rightInLayerCounter.initPortPositionsForInLayerCrossings(this._freeLayer,u.EAST),this._northSouthCounter=new Ad(this._freeLayer),this._countCrossingsCausedByPortSwitch=!s&&i.hasParent()&&!i.dontSweepInto()&&this._freeLayer[0].getType()===y.EXTERNAL_PORT,this._parentCrossCounter=null,this._countCrossingsCausedByPortSwitch&&this._initParentCrossingsCounters(t,e.length)}_initParentCrossingsCounters(t,e){let o=this._graphData.parentGraphData(),r=o.currentNodeOrder(),i=o.portPositions();this._parentCrossCounter=new Fr(i);let s=this._graphData.parent().getLayer().id,a=s>0?r[s-1]:[],l=r[s],c=s<r.length-1?r[s+1]:[];t===e-1?this._parentCrossCounter.initForCountingBetween(l,c):this._parentCrossCounter.initForCountingBetween(a,l)}notifyOfSwitch(t,e){if(this._leftInLayerCounter.switchNodes(t,e,u.WEST),this._rightInLayerCounter.switchNodes(t,e,u.EAST),this._countCrossingsCausedByPortSwitch){let o=t.getProperty(p.ORIGIN),r=e.getProperty(p.ORIGIN);this._parentCrossCounter.switchPorts(o,r)}}doesSwitchReduceCrossings(t,e){if(this._constraintsPreventSwitch(t,e))return!1;let o=this._freeLayer[t],r=this._freeLayer[e],i=this._leftInLayerCounter.countInLayerCrossingsBetweenNodesInBothOrders(o,r,u.WEST),s=this._rightInLayerCounter.countInLayerCrossingsBetweenNodesInBothOrders(o,r,u.EAST);this._northSouthCounter.countCrossings(o,r);let a=this._crossingMatrixFiller.getCrossingMatrixEntry(o,r)+i.getFirst()+s.getFirst()+this._northSouthCounter.getUpperLowerCrossings(),l=this._crossingMatrixFiller.getCrossingMatrixEntry(r,o)+i.getSecond()+s.getSecond()+this._northSouthCounter.getLowerUpperCrossings();if(this._countCrossingsCausedByPortSwitch){let c=o.getProperty(p.ORIGIN),g=r.getProperty(p.ORIGIN),h=this._parentCrossCounter.countCrossingsBetweenPortsInBothOrders(c,g);a+=h.getFirst(),l+=h.getSecond()}return a>l}_constraintsPreventSwitch(t,e){let o=this._freeLayer[t],r=this._freeLayer[e];return TI(o,r)||NI(o,r)||yI(o,r)}};function TI(n,t){let e=n.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS);return e!=null&&e.length>0&&e.indexOf(t)>=0}function NI(n,t){let e=n.getType()!==y.LONG_EDGE&&t.getType()!==y.LONG_EDGE,o=n.getProperty(p.IN_LAYER_LAYOUT_UNIT),r=t.getProperty(p.IN_LAYER_LAYOUT_UNIT),i=o!==r,s=GP(n,o)||GP(t,r),a=Cd(n,u.NORTH),l=Cd(t,u.SOUTH);return s=s||Cd(n,u.SOUTH)||Cd(t,u.NORTH),e&&(s&&i||a||l)}function Cd(n,t){for(let e of n.getPortSideView(t))if(e.getProperty(p.PORT_DUMMY)!=null||!e.getConnectedEdges()[Symbol.iterator]().next().done)return!0;return!1}function GP(n,t){return t!=null&&t!==n}function yI(n,t){return vP(n)&&HP(t)||vP(t)&&HP(n)}function HP(n){return n.getType()===y.NORMAL}function vP(n){return n.getType()===y.NORTH_SOUTH_PORT}var Dd=class{constructor(t,e){this._graphData=e,this._greedySwitchType=t,this._currentNodeOrder=null,this._switchDecider=null,this._portPositions=null,this._nPorts=0}minimizeCrossings(t,e,o,r){return this._setUp(t,e,o),this._continueSwitchingUntilNoImprovementInLayer(e)}setFirstLayerOrder(t,e){let o=e?0:t.length-1;return this._setUp(t,o,e),this._sweepDownwardInLayer(o)}_setUp(t,e,o){this._currentNodeOrder=t;let r=o?er.WEST:er.EAST;this._switchDecider=this._getNewSwitchDecider(e,r)}_getNewSwitchDecider(t,e){let o=new yd(this._greedySwitchType,this._currentNodeOrder,t,e);return new xd(t,this._currentNodeOrder,o,this._portPositions,this._graphData,this._greedySwitchType===oe.ONE_SIDED_GREEDY_SWITCH)}_continueSwitchingUntilNoImprovementInLayer(t){let e=!1,o;do o=this._sweepDownwardInLayer(t),e=e||o;while(o);return e}_sweepDownwardInLayer(t){let e=!1,o=this._currentNodeOrder[t].length;for(let r=0;r<o-1;r++){let i=r+1;this._switchIfImproves(t,r,i)&&(e=!0)}return e}_switchIfImproves(t,e,o){return this._switchDecider.doesSwitchReduceCrossings(e,o)?(this._exchangeNodes(e,o,t),!0):!1}_exchangeNodes(t,e,o){let r=this._currentNodeOrder[o];this._switchDecider.notifyOfSwitch(r[t],r[e]);let i=r[e];r[e]=r[t],r[t]=i}alwaysImproves(){return this._greedySwitchType!==oe.ONE_SIDED_GREEDY_SWITCH}isDeterministic(){return!0}initAtLayerLevel(t,e){e[t][0].getLayer().id=t}initAtPortLevel(t,e,o,r){this._nPorts++}initAfterTraversal(){this._portPositions=new Int32Array(this._nPorts)}};var wd=class{constructor(t,e,o){this._lGraph=t,this._currentNodeOrder=t.toNodeArray(),this._parent=this._lGraph.getParentNode(),this._hasParent=this._parent!=null,this._parentGraphData=this._hasParent?o[this._parent.getGraph().id]:null;let r=t.getProperty(p.GRAPH_PROPERTIES);this._hasExternalPorts=r.has(v.EXTERNAL_PORTS),this._childGraphs=[],this._currentlyBestNodeAndPortOrder=null,this._bestNodeAndPortOrder=null,this._portPositions=null,this._nPorts=0,this._crossingsCounter=new fd(this._currentNodeOrder);let i=this._lGraph.getProperty(p.RANDOM);if(i==null){let a=this._lGraph.getParentNode?this._lGraph.getParentNode():null;for(;a!=null&&i==null;){let l=a.getGraph?a.getGraph():null;l&&(i=l.getProperty(p.RANDOM)),a=l&&l.getParentNode?l.getParentNode():null}i!=null&&this._lGraph.setProperty(p.RANDOM,i)}this._portDistributor=Od.create(e,i,this._currentNodeOrder),this._layerSweepTypeDecider=new Sd(this);let s=[this,this._crossingsCounter,this._layerSweepTypeDecider,this._portDistributor];if(e===oe.BARYCENTER&&!t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)){let a=new ll(this._currentNodeOrder);s.push(a),this._crossMinimizer=new $n(a,i,this._portDistributor,this._currentNodeOrder)}else if(e===oe.BARYCENTER&&t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)){let a=new ll(this._currentNodeOrder);s.push(a),this._crossMinimizer=new Nd(a,i,this._portDistributor,this._currentNodeOrder)}else e===oe.MEDIAN?this._crossMinimizer=new Td(i):this._crossMinimizer=new Dd(e,this);s.push(this._crossMinimizer),ud.init(s,this._currentNodeOrder),this._useBottomUp=this._layerSweepTypeDecider.useBottomUp()}dontSweepInto(){return this._useBottomUp}lGraph(){return this._lGraph}currentNodeOrder(){return this._currentNodeOrder}currentlyBestNodeAndPortOrder(){return this._currentlyBestNodeAndPortOrder}setCurrentlyBestNodeAndPortOrder(t){this._currentlyBestNodeAndPortOrder=t}bestNodeNPortOrder(){return this._bestNodeAndPortOrder}setBestNodeNPortOrder(t){this._bestNodeAndPortOrder=t}crossCounter(){return this._crossingsCounter}crossMinimizer(){return this._crossMinimizer}portDistributor(){return this._portDistributor}parent(){return this._parent}hasParent(){return this._hasParent}childGraphs(){return this._childGraphs}hasExternalPorts(){return this._hasExternalPorts}getBestSweep(){return this._crossMinimizer.isDeterministic()?this.currentlyBestNodeAndPortOrder():this.bestNodeNPortOrder()}parentGraphData(){return this._parentGraphData}crossMinDeterministic(){return this._crossMinimizer.isDeterministic()}crossMinAlwaysImproves(){return this._crossMinimizer.alwaysImproves()}portPositions(){return this._portPositions}toString(){return JSON.stringify(this._currentNodeOrder.map(t=>t.map(e=>String(e))))}initAtNodeLevel(t,e,o){let i=o[t][e].getNestedGraph();i!=null&&this._childGraphs.push(i)}initAtPortLevel(t,e,o,r){this._nPorts++}initAfterTraversal(){this._portPositions=new Int32Array(this._nPorts)}};var cl=class n{constructor(t){if(t instanceof n){this._nodeOrder=BP(t._nodeOrder),this._portOrders=t._portOrders.map(o=>o.map(r=>[...r]));return}let e=t;this._nodeOrder=BP(e),this._portOrders=[];for(let o of e){let r=[];this._portOrders.push(r);for(let i of o)r.push([...i.getPorts()])}}nodes(){return this._nodeOrder}transferNodeAndPortOrdersToGraph(t,e){let o=new Set,r=t.getLayers();for(let i=0;i<r.length;i++){let s=r[i].getNodes(),a=[];for(let l=0;l<s.length;l++){let c=this._nodeOrder[i][l];c.id=l,c.getType()===y.NORTH_SOUTH_PORT&&a.push(c),r[i].getNodes()[l]=c,c.getPorts().length=0;for(let g of this._portOrders[i][l])c.getPorts().push(g);if(e){let g=c.getProperty(_.PORT_CONSTRAINTS);(g==null||!g.isOrderFixed||!g.isOrderFixed())&&c.setProperty(_.PORT_CONSTRAINTS,H.FIXED_ORDER)}}for(let l of a){let c=this._assertCorrectPortSides(l);o.add(c),o.add(l)}}for(let i of o)i.getPorts().sort(P_),i.cachePortSides()}_assertCorrectPortSides(t){let e=t.getProperty(p.IN_LAYER_LAYOUT_UNIT);if(e==null)return null;let r=t.getPorts()[0].getProperty(p.ORIGIN);for(let i of e.getPorts())if(i===r){if(i.getSide()===u.NORTH&&t.id>e.id){if(i.setSide(u.SOUTH),i.isExplicitlySuppliedPortAnchor()){let s=i.getSize().y;i.getAnchor().y=s-i.getAnchor().y}}else if(i.getSide()===u.SOUTH&&e.id>t.id&&(i.setSide(u.NORTH),i.isExplicitlySuppliedPortAnchor())){let s=i.getSize().y;i.getAnchor().y=-(s-i.getAnchor().y)}break}return e}};function BP(n){if(n==null)return null;let t=new Array(n.length);for(let e=0;e<t.length;e++)t[e]=n[e].slice();return t}var ci=class{constructor(t){this._crossMinType=t,this._graphInfoHolders=[],this._graphsWhoseNodeOrderChanged=new Set,this._random=null,this._randomSeed=0}getLayoutProcessorConfiguration(t){let e=K.createFrom(MI());return e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}process(t,e){e.begin(`Minimize Crossings ${this._crossMinType}`,1);let o=t.getLayers(),r=o.length===0||o.every(c=>c.getNodes().length===0),i=o.length===1&&o[0].getNodes().length===1,s=t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN;if(r||i&&!s){e.done();return}let a=this._initialize(t),l=this._chooseMinimizingMethod(a);this._minimizeCrossings(a,l),this._transferNodeAndPortOrdersToGraph(),e.done()}_chooseMinimizingMethod(t){let e=t[0];return e.crossMinDeterministic()?e.crossMinAlwaysImproves()?o=>this._minimizeCrossingsNoCounter(o):o=>this._minimizeCrossingsWithCounter(o):o=>this._compareDifferentRandomizedLayouts(o)}_minimizeCrossings(t,e){for(let o of t)o.currentNodeOrder().length>0&&(e(o),o.hasParent()&&this._setPortOrderOnParentGraph(o))}_setPortOrderOnParentGraph(t){if(t.hasExternalPorts()&&t.getBestSweep()!=null){let e=t.getBestSweep();this._sortPortsByDummyPositionsInLastLayer(e.nodes(),t.parent(),!0),this._sortPortsByDummyPositionsInLastLayer(e.nodes(),t.parent(),!1),t.parent().setProperty(_.PORT_CONSTRAINTS,H.FIXED_ORDER)}}_minimizeCrossingsNoCounter(t){let e=this._random.nextBoolean(),o=!0;for(;o;)o=!1,o=t.crossMinimizer().setFirstLayerOrder(t.currentNodeOrder(),e),this._sweepReducingCrossings(t,e,!1)&&(o=!0),e=!e;this._setCurrentlyBestNodeOrders()}_compareDifferentRandomizedLayouts(t){typeof this._random.setSeed=="function"&&this._random.setSeed(this._randomSeed),this._graphsWhoseNodeOrderChanged.clear();let e=Number.POSITIVE_INFINITY,o=t.lGraph().getProperty(_.THOROUGHNESS);for(let r=0;r<o;r++){let i=this._minimizeCrossingsWithCounter(t);if(i<e&&(e=i,this._saveAllNodeOrdersOfChangedGraphs(),e===0))break}}_minimizeCrossingsWithCounter(t){let e=this._random.nextBoolean();if(this._countCurrentNumberOfCrossings(t)===0&&t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER))return 0;t.crossMinimizer().setFirstLayerOrder(t.currentNodeOrder(),e),this._sweepReducingCrossings(t,e,!0),t.lGraph().getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER)&&t.lGraph().setProperty(p.SECOND_TRY_WITH_INITIAL_ORDER,!1),t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER)&&(t.lGraph().setProperty(p.FIRST_TRY_WITH_INITIAL_ORDER,!1),t.lGraph().setProperty(p.SECOND_TRY_WITH_INITIAL_ORDER,!0));let r=this._countCurrentNumberOfCrossings(t),i;do{if(this._setCurrentlyBestNodeOrders(),r===0)return 0;e=!e,i=r,this._sweepReducingCrossings(t,e,!1),r=this._countCurrentNumberOfCrossings(t)}while(i>r);return i}_countCurrentNumberOfCrossings(t){let e=0,o=[t];for(;o.length>0;){let r=o.pop();e+=r.crossCounter().countAllCrossings(r.currentNodeOrder());for(let i of r.childGraphs()){let s=this._graphInfoHolders[i.id];s.dontSweepInto()||o.push(s)}}return e}_sweepReducingCrossings(t,e,o){let r=t.currentNodeOrder(),i=r.length,s=t.portDistributor().distributePortsWhileSweeping(r,Md(e,i),e),a=r[Md(e,i)];this._sweepInHierarchicalNodes(a,e,o)&&(s=!0);let l=t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER),c=t.lGraph().getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER),g=o&&!l&&!c;for(let h=RI(e,i);LI(i,h,e);h+=UP(e))t.crossMinimizer().minimizeCrossings(r,h,e,g)&&(s=!0),t.portDistributor().distributePortsWhileSweeping(r,h,e)&&(s=!0),this._sweepInHierarchicalNodes(r[h],e,o)&&(s=!0);return this._graphsWhoseNodeOrderChanged.add(t),s}_sweepInHierarchicalNodes(t,e,o){let r=!1;for(let i of t)AI(i)&&!this._graphInfoHolders[i.getNestedGraph().id].dontSweepInto()&&this._sweepInHierarchicalNode(e,i,o)&&(r=!0);return r}_sweepInHierarchicalNode(t,e,o){let r=e.getNestedGraph(),i=this._graphInfoHolders[r.id],s=i.currentNodeOrder(),a=Md(t,s.length),l=s[a][0];FP(l)?s[a]=this._sortPortDummiesByPortPositions(e,s[a],CI(t)):i.crossMinimizer().setFirstLayerOrder(s,t);let c=this._sweepReducingCrossings(i,t,o);return this._sortPortsByDummyPositionsInLastLayer(i.currentNodeOrder(),i.parent(),t),c}_sortPortsByDummyPositionsInLastLayer(t,e,o){let r=II(o,t.length),i=t[r],s=Md(o,i.length);if(!FP(i[s]))return;let a=e.getPorts();for(let l=0;l<a.length;l++){let c=a[l];wI(c,o)&&kP(c)&&(a[l]=xI(i[s]),s+=UP(o))}}_sortPortDummiesByPortPositions(t,e,o){let r=zi(t,o),i=new Array(e.length),s=0;for(let a of r)kP(a)&&(i[s++]=DI(a));if(s<e.length)throw new Error(`Expected ${e.length} hierarchical ports, but found only ${s}.`);return i}_saveAllNodeOrdersOfChangedGraphs(){for(let t of this._graphsWhoseNodeOrderChanged)t.setBestNodeNPortOrder(new cl(t.currentlyBestNodeAndPortOrder()))}_setCurrentlyBestNodeOrders(){for(let t of this._graphsWhoseNodeOrderChanged)t.setCurrentlyBestNodeAndPortOrder(new cl(t.currentNodeOrder()))}_initialize(t){this._graphInfoHolders=[],this._random=t.getProperty(p.RANDOM),this._randomSeed=typeof this._random.nextLong=="function"?this._random.nextLong():0;let e=[],o=[t],r=0;for(;r<o.length;){let i=o[r];i.id=r++;let s=new wd(i,this._crossMinType,this._graphInfoHolders);for(let a of s.childGraphs())o.push(a);this._graphInfoHolders.push(s),s.dontSweepInto()&&e.unshift(s)}return this._graphsWhoseNodeOrderChanged=new Set,e}_transferNodeAndPortOrdersToGraph(){for(let t of this._graphInfoHolders){let e=t.getBestSweep();e!=null&&e.transferNodeAndPortOrdersToGraph(t.lGraph(),!0)}}getGraphData(){return this._graphInfoHolders}};Z(ci,"isHierarchyAware",!0);function Md(n,t){return n?0:t-1}function II(n,t){return n?t-1:0}function RI(n,t){return n?1:t-2}function UP(n){return n?1:-1}function LI(n,t,e){return e?t<n:t>=0}function AI(n){return n.getNestedGraph()!=null}function CI(n){return n?u.WEST:u.EAST}function FP(n){return n.getType()===y.EXTERNAL_PORT}function xI(n){return n.getProperty(p.ORIGIN)}function kP(n){return n.getProperty(p.INSIDE_CONNECTIONS)}function DI(n){return n.getProperty(p.PORT_DUMMY)}function wI(n,t){return t?n.getSide()===u.EAST:n.getSide()===u.WEST}function MI(){return K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER)}var at=class{constructor(t,e,o){this.name=t,this.ordinal=e,this._factory=o,Object.freeze(this)}toString(){return this.name}create(){if(this._factory==null)throw new Error("No implementation available for layout processor "+this.name);return this._factory()}},w=class{},ct=0,gt=w;gt.DIRECTION_PREPROCESSOR=new at("DIRECTION_PREPROCESSOR",ct++,()=>new wn($o.TO_INPUT_DIRECTION));gt.COMMENT_PREPROCESSOR=new at("COMMENT_PREPROCESSOR",ct++,()=>new bg);gt.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER=new at("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER",ct++,()=>new Hg);gt.INTERACTIVE_EXTERNAL_PORT_POSITIONER=new at("INTERACTIVE_EXTERNAL_PORT_POSITIONER",ct++,()=>new ah);gt.PARTITION_PREPROCESSOR=new at("PARTITION_PREPROCESSOR",ct++,()=>new Th);gt.LABEL_DUMMY_INSERTER=new at("LABEL_DUMMY_INSERTER",ct++,()=>new gh);gt.SELF_LOOP_PREPROCESSOR=new at("SELF_LOOP_PREPROCESSOR",ct++,()=>new vh);gt.LAYER_CONSTRAINT_PREPROCESSOR=new at("LAYER_CONSTRAINT_PREPROCESSOR",ct++,()=>new _h);gt.PARTITION_MIDPROCESSOR=new at("PARTITION_MIDPROCESSOR",ct++,()=>new Oh);gt.HIGH_DEGREE_NODE_LAYER_PROCESSOR=new at("HIGH_DEGREE_NODE_LAYER_PROCESSOR",ct++,()=>new oh);gt.NODE_PROMOTION=new at("NODE_PROMOTION",ct++,()=>new Eh);gt.LAYER_CONSTRAINT_POSTPROCESSOR=new at("LAYER_CONSTRAINT_POSTPROCESSOR",ct++,()=>new fh);gt.PARTITION_POSTPROCESSOR=new at("PARTITION_POSTPROCESSOR",ct++,()=>new Sh);gt.HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR=new at("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR",ct++,()=>new $g);gt.SEMI_INTERACTIVE_CROSSMIN_PROCESSOR=new at("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR",ct++,()=>new Kh);gt.BREAKING_POINT_INSERTER=new at("BREAKING_POINT_INSERTER",ct++,()=>new qh);gt.LONG_EDGE_SPLITTER=new at("LONG_EDGE_SPLITTER",ct++,()=>new ri);gt.PORT_SIDE_PROCESSOR=new at("PORT_SIDE_PROCESSOR",ct++,()=>new Un);gt.INVERTED_PORT_PROCESSOR=new at("INVERTED_PORT_PROCESSOR",ct++,()=>new lh);gt.PORT_LIST_SORTER=new at("PORT_LIST_SORTER",ct++,()=>new Ih);gt.SORT_BY_INPUT_ORDER_OF_MODEL=new at("SORT_BY_INPUT_ORDER_OF_MODEL",ct++,()=>new jh);gt.NORTH_SOUTH_PORT_PREPROCESSOR=new at("NORTH_SOUTH_PORT_PREPROCESSOR",ct++,()=>new Ph);gt.BREAKING_POINT_PROCESSOR=new at("BREAKING_POINT_PROCESSOR",ct++,()=>new Qh);gt.ONE_SIDED_GREEDY_SWITCH=new at("ONE_SIDED_GREEDY_SWITCH",ct++,()=>new ci(oe.ONE_SIDED_GREEDY_SWITCH));gt.TWO_SIDED_GREEDY_SWITCH=new at("TWO_SIDED_GREEDY_SWITCH",ct++,()=>new ci(oe.TWO_SIDED_GREEDY_SWITCH));gt.SELF_LOOP_PORT_RESTORER=new at("SELF_LOOP_PORT_RESTORER",ct++,()=>new xh);gt.ALTERNATING_LAYER_UNZIPPER=new at("ALTERNATING_LAYER_UNZIPPER",ct++,()=>new $h);gt.SINGLE_EDGE_GRAPH_WRAPPER=new at("SINGLE_EDGE_GRAPH_WRAPPER",ct++,()=>new xs);gt.IN_LAYER_CONSTRAINT_PROCESSOR=new at("IN_LAYER_CONSTRAINT_PROCESSOR",ct++,()=>new sh);gt.END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR=new at("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR",ct++,()=>new el(!1));gt.LABEL_AND_NODE_SIZE_PROCESSOR=new at("LABEL_AND_NODE_SIZE_PROCESSOR",ct++,()=>new ch);gt.INNERMOST_NODE_MARGIN_CALCULATOR=new at("INNERMOST_NODE_MARGIN_CALCULATOR",ct++,()=>new nh);gt.SELF_LOOP_ROUTER=new at("SELF_LOOP_ROUTER",ct++,()=>new Xh);gt.COMMENT_NODE_MARGIN_CALCULATOR=new at("COMMENT_NODE_MARGIN_CALCULATOR",ct++,()=>new wg);gt.END_LABEL_PREPROCESSOR=new at("END_LABEL_PREPROCESSOR",ct++,()=>new In);gt.LABEL_DUMMY_SWITCHER=new at("LABEL_DUMMY_SWITCHER",ct++,()=>new tl);gt.CENTER_LABEL_MANAGEMENT_PROCESSOR=new at("CENTER_LABEL_MANAGEMENT_PROCESSOR",ct++,()=>new el(!0));gt.LABEL_SIDE_SELECTOR=new at("LABEL_SIDE_SELECTOR",ct++,()=>new dh);gt.HYPEREDGE_DUMMY_MERGER=new at("HYPEREDGE_DUMMY_MERGER",ct++,()=>new rh);gt.HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR=new at("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR",ct++,()=>new Jg);gt.LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR=new at("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR",ct++,()=>new ph);gt.HIERARCHICAL_PORT_POSITION_PROCESSOR=new at("HIERARCHICAL_PORT_POSITION_PROCESSOR",ct++,()=>new Qg);gt.CONSTRAINTS_POSTPROCESSOR=new at("CONSTRAINTS_POSTPROCESSOR",ct++,()=>new Gg);gt.COMMENT_POSTPROCESSOR=new at("COMMENT_POSTPROCESSOR",ct++,()=>new Mg);gt.HYPERNODE_PROCESSOR=new at("HYPERNODE_PROCESSOR",ct++,()=>new ih);gt.HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER=new at("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER",ct++,()=>new qg);gt.LONG_EDGE_JOINER=new at("LONG_EDGE_JOINER",ct++,()=>new ii);gt.SELF_LOOP_POSTPROCESSOR=new at("SELF_LOOP_POSTPROCESSOR",ct++,()=>new Dh);gt.BREAKING_POINT_REMOVER=new at("BREAKING_POINT_REMOVER",ct++,()=>new td);gt.NORTH_SOUTH_PORT_POSTPROCESSOR=new at("NORTH_SOUTH_PORT_POSTPROCESSOR",ct++,()=>new mh);gt.HORIZONTAL_COMPACTOR=new at("HORIZONTAL_COMPACTOR",ct++,()=>new ke);gt.LABEL_DUMMY_REMOVER=new at("LABEL_DUMMY_REMOVER",ct++,()=>new hh);gt.FINAL_SPLINE_BENDPOINTS_CALCULATOR=new at("FINAL_SPLINE_BENDPOINTS_CALCULATOR",ct++,()=>new Kg);gt.END_LABEL_SORTER=new at("END_LABEL_SORTER",ct++,()=>new Ug);gt.REVERSED_EDGE_RESTORER=new at("REVERSED_EDGE_RESTORER",ct++,()=>new Rh);gt.END_LABEL_POSTPROCESSOR=new at("END_LABEL_POSTPROCESSOR",ct++,()=>new vg);gt.HIERARCHICAL_NODE_RESIZER=new at("HIERARCHICAL_NODE_RESIZER",ct++,()=>new jg);gt.DIRECTION_POSTPROCESSOR=new at("DIRECTION_POSTPROCESSOR",ct++,()=>new wn($o.TO_INTERNAL_LTR));var bd=class n{getLayoutProcessorConfiguration(t){let e=K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER),o=t.getProperty(p.GRAPH_PROPERTIES);return o&&o.has(v.NON_FREE_PORTS)&&e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}process(t,e){e&&e.begin&&e.begin("Interactive crossing minimization",1);let o=0;for(let a of t.getLayers())a.id=o++;let r=t.toNodeArray(),i=new Qn(r.length);ud.init([i],r);let s=0;o=0;for(let a of t.getLayers()){let l=0,c=0;for(let d of a.getNodes()){d.getPosition().x>0&&(l+=d.getPosition().x+d.getSize().x/2,c++);for(let f of d.getPorts())f.id=s++}c>0&&(l/=c);let g=new Array(a.getNodes().length),h=0;for(let d of a.getNodes())d.id=h++,g[d.id]=n._getPos(d,l),d.getType()===y.LONG_EDGE&&d.setProperty(p.ORIGINAL_DUMMY_NODE_POSITION,g[d.id]);a.getNodes().sort((d,f)=>{let E=g[d.id]-g[f.id];if(E!==0)return E;let P=d.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS),S=f.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS);return P&&P.includes(f)?-1:S&&S.includes(d)?1:0}),i.distributePortsWhileSweeping(r,o,!0),o++}e&&e.done&&e.done()}static _getPos(t,e){if(t.getType()===y.LONG_EDGE){let o=t.getProperty(p.ORIGIN),r=o.getProperty(p.ORIGINAL_BENDPOINTS);r==null?r=new st:o.getProperty(p.REVERSED)&&(r=st.reverse(r));let i=t.getProperty(p.LONG_EDGE_SOURCE);if(i!=null){let a=i.getAbsoluteAnchor();if(e<=a.x)return a.y;r.addFirst(a)}let s=t.getProperty(p.LONG_EDGE_TARGET);if(s!=null){let a=s.getAbsoluteAnchor();if(a.x<=e)return a.y;r.addLast(a)}if(r.length>=2){let a=0,l=r[a++],c=r[a++];for(;c.x<e&&a<r.length;)l=c,c=r[a++];return l.y+(e-l.x)/(c.x-l.x)*(c.y-l.y)}}else if(t.getType()===y.NORTH_SOUTH_PORT){let o=t.getPorts()[0].getProperty(p.ORIGIN),r=o.getNode();if(o.getSide()===u.NORTH)return r.getPosition().y;if(o.getSide()===u.SOUTH)return r.getPosition().y+r.getSize().y}return t.getInteractiveReferencePoint().y}};var Gd=class{process(t,e){e.begin("No crossing minimization",1),e.done()}getLayoutProcessorConfiguration(t){let e=K.createFrom(bI);return e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}},bI=K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER);var We=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.LAYER_SWEEP:return new ci(oe.BARYCENTER);case n.MEDIAN_LAYER_SWEEP:return new ci(oe.MEDIAN);case n.INTERACTIVE:return new bd;case n.NONE:return new Gd;default:throw new Error("Unknown crossing minimization strategy: "+this.name)}}static valueOf(t){return n[t]}};We.LAYER_SWEEP=new We("LAYER_SWEEP");We.MEDIAN_LAYER_SWEEP=new We("MEDIAN_LAYER_SWEEP");We.INTERACTIVE=new We("INTERACTIVE");We.NONE=new We("NONE");var ta=class{constructor(){this._indeg=null,this._outdeg=null,this._mark=null,this._sources=[],this._sinks=[],this.layeredGraph=null,this._random=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Greedy cycle removal",1),this.layeredGraph=t;let o=t.getLayerlessNodes(),r=o.length;this._indeg=new Array(r).fill(0),this._outdeg=new Array(r).fill(0),this._mark=new Array(r).fill(0);let i=0;for(let g of o){g.id=i;for(let h of g.getPorts()){for(let d of h.getIncomingEdges()){if(d.getSource().getNode()===g)continue;let f=d.getProperty(_.PRIORITY_DIRECTION);this._indeg[i]+=f>0?f+1:1}for(let d of h.getOutgoingEdges()){if(d.getTarget().getNode()===g)continue;let f=d.getProperty(_.PRIORITY_DIRECTION);this._outdeg[i]+=f>0?f+1:1}}this._outdeg[i]===0?this._sinks.push(g):this._indeg[i]===0&&this._sources.push(g),i++}let s=-1,a=1,l=[];for(this._random=t.getProperty(p.RANDOM);r>0;){for(;this._sinks.length>0;){let g=this._sinks.shift();this._mark[g.id]=s--,this._updateNeighbors(g),r--}for(;this._sources.length>0;){let g=this._sources.shift();this._mark[g.id]=a++,this._updateNeighbors(g),r--}if(r>0){let g=Number.MIN_SAFE_INTEGER;l.length=0;for(let d of o)if(this._mark[d.id]===0){let f=this._outdeg[d.id]-this._indeg[d.id];f>=g&&(f>g&&(l.length=0,g=f),l.push(d))}let h=this.chooseNodeWithMaxOutflow(l);this._mark[h.id]=a++,this._updateNeighbors(h),r--}}let c=o.length+1;for(let g=0;g<o.length;g++)this._mark[g]<0&&(this._mark[g]+=c);for(let g of o){let h=z.toPortArray(g.getPorts());for(let d of h){let f=z.toEdgeArray(d.getOutgoingEdges());for(let E of f){let P=E.getTarget().getNode().id;this._mark[g.id]>this._mark[P]&&(E.reverse(t,!0),t.setProperty(p.CYCLIC,!0))}}}this._dispose(),e.done()}chooseNodeWithMaxOutflow(t){let e=this._random!=null?this._random.nextInt(t.length):Math.floor(Math.random()*t.length);return t[e]}_dispose(){this._indeg=null,this._outdeg=null,this._mark=null,this._sources.length=0,this._sinks.length=0}_updateNeighbors(t){for(let e of t.getPorts())for(let o of e.getConnectedEdges()){let r=o.getSource()===e?o.getTarget():o.getSource(),i=r.getNode();if(t===i)continue;let s=o.getProperty(_.PRIORITY_DIRECTION);s<0&&(s=0);let a=i.id;this._mark[a]===0&&(o.getTarget()===r?(this._indeg[a]-=s+1,this._indeg[a]<=0&&this._outdeg[a]>0&&this._sources.push(i)):(this._outdeg[a]-=s+1,this._outdeg[a]<=0&&this._indeg[a]>0&&this._sinks.push(i)))}}};var Hd=class{constructor(){this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Depth-first cycle removal",1);let o=t.getLayerlessNodes(),r=o.length;this._sources=[],this._visited=new Array(r).fill(!1),this._active=new Array(r).fill(!1),this._edgesToBeReversed=[];let i=0;for(let s of o){s.id=i;let a=!1;for(let l of s.getIncomingEdges()){a=!0;break}a||this._sources.push(s),i++}for(let s of this._sources)this._dfs(s);for(let s=0;s<r;s++)this._visited[s]||this._dfs(o[s]);for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,e.done()}_dfs(t){if(!this._visited[t.id]){this._visited[t.id]=!0,this._active[t.id]=!0;for(let e of t.getOutgoingEdges()){if(e.isSelfLoop())continue;let o=e.getTarget().getNode();this._active[o.id]?this._edgesToBeReversed.push(e):this._dfs(o)}this._active[t.id]=!1}}};var vd=class{constructor(){this._revEdges=[]}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.INTERACTIVE_EXTERNAL_PORT_POSITIONER).addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Interactive cycle breaking",1);let o=[];for(let r of t.getLayerlessNodes()){r.id=1;let i=r.getInteractiveReferencePoint().x;for(let s of r.getPorts(W.OUTPUT))for(let a of s.getOutgoingEdges()){let l=a.getTarget().getNode();l!==r&&l.getInteractiveReferencePoint().x<i&&o.push(a)}}for(let r of o)r.reverse(t,!0);o.length=0;for(let r of t.getLayerlessNodes())r.id>0&&this._findCycles(r,o);for(let r of o)r.reverse(t,!0);o.length=0,e.done()}_findCycles(t,e){t.id=-1;for(let o of t.getPorts(W.OUTPUT))for(let r of o.getOutgoingEdges()){let i=r.getTarget().getNode();t!==i&&(i.id<0?e.push(r):i.id>0&&this._findCycles(i,e))}t.id=0}};var or=class{constructor(){this._firstSeparateNodes=0,this._lastSeparateNodes=0}computeConstraintModelOrder(t,e){let o=0;switch(t.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST_SEPARATE:o=2*-e+this._firstSeparateNodes,this._firstSeparateNodes++;break;case J.FIRST:o=-e;break;case J.LAST:o=e;break;case J.LAST_SEPARATE:o=2*e+this._lastSeparateNodes,this._lastSeparateNodes++;break;default:break}return t.hasProperty(p.MODEL_ORDER)&&(o+=t.getProperty(p.MODEL_ORDER)),o}computeConstraintGroupModelOrder(t,e,o){let r=0;switch(t.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST_SEPARATE:r=2*-e+this._firstSeparateNodes,this._firstSeparateNodes++;break;case J.FIRST:r=-e;break;case J.LAST:r=e;break;case J.LAST_SEPARATE:r=2*e+this._lastSeparateNodes,this._lastSeparateNodes++;break;default:break}return t.hasProperty(p.MODEL_ORDER)&&(r+=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)*o+t.getProperty(p.MODEL_ORDER)),r}resetInternalCounters(){this._firstSeparateNodes=0,this._lastSeparateNodes=0}};var Bd=class{getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Model order cycle breaking",1);let o=[],r=Math.max(t.getLayerlessNodes().length,t.getProperty(p.MAX_MODEL_ORDER_NODES)),i=r*t.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),s=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;for(let a of t.getLayerlessNodes()){let l=new or,c=s?l.computeConstraintGroupModelOrder(a,i,r):l.computeConstraintModelOrder(a,r);for(let g of a.getPorts(W.OUTPUT))for(let h of g.getOutgoingEdges()){let d=h.getTarget().getNode();(s?l.computeConstraintGroupModelOrder(d,i,r):l.computeConstraintModelOrder(d,r))<c&&o.push(h)}}for(let a of o)a.reverse(t,!0),t.setProperty(p.CYCLIC,!0);o.length=0,e.done()}};var Ud=class extends ta{chooseNodeWithMaxOutflow(t){let e=null,o=Number.MAX_SAFE_INTEGER,r=Math.max(this.layeredGraph.getLayerlessNodes().length,this.layeredGraph.getProperty(p.MAX_MODEL_ORDER_NODES)),i=r*this.layeredGraph.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),s=new or,a=this.layeredGraph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;for(let l of t)if(l.hasProperty(p.MODEL_ORDER)){let c=a?s.computeConstraintGroupModelOrder(l,i,r):s.computeConstraintModelOrder(l,r);o>c&&(o=c,e=l)}return e==null?super.chooseNodeWithMaxOutflow(t):e}};var Fd=class{constructor(t,e,o){this._edgesToBeReversed=t,this.stronglyConnectedComponents=e,this._nodeToSCCID=o,this._index=0,this._stack=[]}tarjan(t){this._index=0,this._stack.length=0;for(let e of t.getLayerlessNodes())e.getProperty(p.TARJAN_ID)===-1&&(this._stronglyConnected(e),this._stack.length=0)}_stronglyConnected(t){t.setProperty(p.TARJAN_ID,this._index),t.setProperty(p.TARJAN_LOWLINK,this._index),this._index++,this._stack.push(t),t.setProperty(p.TARJAN_ON_STACK,!0);for(let e of t.getConnectedEdges()){let o=this._edgesToBeReversed.includes(e);if(e.getSource().getNode()!==t&&!o||e.getSource().getNode()===t&&o)continue;let r=e.getTarget().getNode()===t?e.getSource().getNode():e.getTarget().getNode();r.getProperty(p.TARJAN_ID)===-1?(this._stronglyConnected(r),t.setProperty(p.TARJAN_LOWLINK,Math.min(t.getProperty(p.TARJAN_LOWLINK),r.getProperty(p.TARJAN_LOWLINK)))):r.getProperty(p.TARJAN_ON_STACK)&&t.setProperty(p.TARJAN_LOWLINK,Math.min(t.getProperty(p.TARJAN_LOWLINK),r.getProperty(p.TARJAN_ID)))}if(t.getProperty(p.TARJAN_LOWLINK)===t.getProperty(p.TARJAN_ID)){let e=new Set,o=null;do o=this._stack.pop(),o.setProperty(p.TARJAN_ON_STACK,!1),e.add(o);while(t!==o);if(e.size>1){let r=this.stronglyConnectedComponents.length;this.stronglyConnectedComponents.push(e);for(let i of e)this._nodeToSCCID.set(i,r)}}}resetTarjan(t){for(let e of t.getLayerlessNodes()){e.setProperty(p.TARJAN_ON_STACK,!1),e.setProperty(p.TARJAN_LOWLINK,-1),e.setProperty(p.TARJAN_ID,-1),this._stack.length=0;for(let o of e.getConnectedEdges())o.setProperty(p.IS_PART_OF_CYCLE,!1)}}};var ea=class{constructor(){this.stronglyConnectedComponents=[],this.nodeToSCCID=new Map,this.revEdges=[],this.graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Model order cycle breaking",1),this.graph=t,this.revEdges=[];let o=Math.max(t.getLayerlessNodes().length,t.getProperty(p.MAX_MODEL_ORDER_NODES)),r=o*t.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),i=t.getLayerlessNodes().length*4+16,s=0;for(;;){if(s++>i)throw new Error("SCCModelOrderCycleBreaker: too many iterations \u2014 findNodes() is not breaking SCCs");let a=new Fd(this.revEdges,this.stronglyConnectedComponents,this.nodeToSCCID);if(a.resetTarjan(t),a.tarjan(t),this.stronglyConnectedComponents.length===0)break;this.findNodes(o,r);for(let l of this.revEdges){l.reverse(t,!1);let c=l.getSource().getNode();c.setProperty(_.LAYERING_LAYER_ID,c.getProperty(_.LAYERING_LAYER_ID)+1),t.setProperty(p.CYCLIC,!0)}this.stronglyConnectedComponents.length=0,this.nodeToSCCID.clear(),this.revEdges.length=0}e.done()}findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=null,i=new or,s=Number.MIN_SAFE_INTEGER;for(let a of this.stronglyConnectedComponents[o]){let l=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;if(r==null)r=a,s=l?i.computeConstraintGroupModelOrder(a,e,t):i.computeConstraintModelOrder(a,t);else{let c=l?i.computeConstraintGroupModelOrder(a,e,t):i.computeConstraintModelOrder(a,t);s<c&&(r=a,s=c)}}for(let a of r.getOutgoingEdges())this.stronglyConnectedComponents[o].has(a.getTarget().getNode())&&this.revEdges.push(a)}}};var kd=class extends ea{findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=this.stronglyConnectedComponents[o];if(r.size<=1)continue;let i=null,s=null,a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,g=new or;for(let h of r)if(i==null||s==null)i=h,a=c?g.computeConstraintGroupModelOrder(h,e,t):g.computeConstraintModelOrder(h,t),s=h,l=a;else{let d=c?g.computeConstraintGroupModelOrder(h,e,t):g.computeConstraintModelOrder(h,t);a>d&&(i=h,a=d),l<d&&(s=h,l=d)}if(WP(i.getIncomingEdges())>WP(s.getOutgoingEdges()))for(let h of i.getIncomingEdges())r.has(h.getSource().getNode())&&this.revEdges.push(h);else for(let h of s.getOutgoingEdges())r.has(h.getTarget().getNode())&&this.revEdges.push(h)}}};function WP(n){let t=0;for(let e of n)t++;return t}var Wd=class extends ea{findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=this.stronglyConnectedComponents[o];if(r.size<=1)continue;let i=null,s=null,a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,g=new or;for(let P of r)if(i==null||s==null)i=P,a=c?g.computeConstraintGroupModelOrder(P,e,t):g.computeConstraintModelOrder(P,t),s=P,l=a;else{let S=c?g.computeConstraintGroupModelOrder(P,e,t):g.computeConstraintModelOrder(P,t);a>S&&(i=P,a=S),l<S&&(s=P,l=S)}let h=i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID),d=s.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID),f=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_SOURCE_ID),E=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_TARGET_ID);if(h===f)for(let P of i.getIncomingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else if(d===E)for(let P of s.getOutgoingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else if(zP(i.getIncomingEdges())>zP(s.getOutgoingEdges()))for(let P of i.getIncomingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else for(let P of s.getOutgoingEdges())r.has(P.getTarget().getNode())&&this.revEdges.push(P)}}};function zP(n){let t=0;for(let e of n)t++;return t}var zd=class{constructor(){this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,this._graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Depth-first cycle removal",1),this._graph=t;let o=t.getLayerlessNodes(),r=o.length;this._sources=[],this._visited=new Array(r).fill(!1),this._active=new Array(r).fill(!1),this._edgesToBeReversed=[];let i=0;for(let s of o){s.id=i;let a=!1;for(let l of s.getIncomingEdges()){a=!0;break}a||this._sources.push(s),i++}for(let s of this._sources)this._dfs(s);for(let s=0;s<r;s++)this._visited[s]||this._dfs(o[s]);for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,e.done()}_dfs(t){if(this._visited[t.id])return;this._visited[t.id]=!0,this._active[t.id]=!0;let e=new Map,o=this._graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,r=Number.MAX_SAFE_INTEGER;for(let s of t.getOutgoingEdges()){let a=s.getTarget().getNode();if(!a.hasProperty(p.MODEL_ORDER))e.set(r--,new Set([s]));else{let l;o?l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES)*a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)+a.getProperty(p.MODEL_ORDER):l=a.getProperty(p.MODEL_ORDER);let c=e.get(l);c?c.add(s):e.set(l,new Set([s]))}}let i=[...e.keys()].sort((s,a)=>s-a);for(let s of i){let a=e.get(s),l=a.values().next().value;if(l.isSelfLoop())continue;let c=l.getTarget().getNode();if(this._active[c.id])for(let g of a)this._edgesToBeReversed.push(g);else this._dfs(c)}this._active[t.id]=!1}};var Yd=class{constructor(){this._sources=null,this._sinks=null,this._visited=null,this._bfsQueue=null,this._edgesToBeReversed=null,this._graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Breadth-first cycle removal",1),this._graph=t;let o=t.getLayerlessNodes();this._bfsQueue=[],this._sources=new Set,this._sinks=new Set,this._visited=new Array(o.length).fill(!1),this._edgesToBeReversed=[];let r=0;for(let s of o){s.id=r;let a=!1;for(let c of s.getIncomingEdges()){a=!0;break}a||this._sources.add(s);let l=!1;for(let c of s.getOutgoingEdges()){l=!0;break}l||this._sinks.add(s),r++}for(let s of this._sources)this._bfsQueue.push(s),this._bfsLoop();this._bfsLoop();let i=!0;for(;i;){i=!1;for(let s=0;s<o.length;s++)if(!this._visited[s]){this._bfsQueue.push(o[s]),i=!0;break}this._bfsLoop()}for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._sinks=null,this._visited=null,this._bfsQueue=null,this._edgesToBeReversed=null,e.done()}_bfsLoop(){for(;this._bfsQueue.length>0;)this._bfs(this._bfsQueue.shift())}_bfs(t){if(this._visited[t.id])return;this._visited[t.id]=!0;let e=new Map,o=this._graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,r=Number.MAX_SAFE_INTEGER;for(let s of t.getOutgoingEdges()){let a=s.getTarget().getNode();if(!a.hasProperty(p.MODEL_ORDER))e.set(r--,new Set([s]));else{let l;o?l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES)*a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)+a.getProperty(p.MODEL_ORDER):l=a.getProperty(p.MODEL_ORDER);let c=e.get(l);c?c.add(s):e.set(l,new Set([s]))}}let i=[...e.keys()].sort((s,a)=>s-a);for(let s of i){let a=e.get(s),l=a.values().next().value;if(l.isSelfLoop())continue;let c=l.getTarget().getNode();if(this._visited[c.id]&&!this._sources.has(t)&&!this._sinks.has(c))for(let g of a)this._edgesToBeReversed.push(g);else this._bfsQueue.push(c)}}};var Xt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}create(){switch(this){case n.GREEDY:return new ta;case n.DEPTH_FIRST:return new Hd;case n.INTERACTIVE:return new vd;case n.MODEL_ORDER:return new Bd;case n.GREEDY_MODEL_ORDER:return new Ud;case n.SCC_CONNECTIVITY:return new kd;case n.SCC_NODE_TYPE:return new Wd;case n.DFS_NODE_ORDER:return new zd;case n.BFS_NODE_ORDER:return new Yd;default:throw new Error(`Unknown cycle breaker strategy ${this.name}`)}}toString(){return this.name}static valueOf(t){return n[t]}};Xt.GREEDY=new Xt("GREEDY",0);Xt.DEPTH_FIRST=new Xt("DEPTH_FIRST",1);Xt.INTERACTIVE=new Xt("INTERACTIVE",2);Xt.MODEL_ORDER=new Xt("MODEL_ORDER",3);Xt.GREEDY_MODEL_ORDER=new Xt("GREEDY_MODEL_ORDER",4);Xt.SCC_CONNECTIVITY=new Xt("SCC_CONNECTIVITY",5);Xt.SCC_NODE_TYPE=new Xt("SCC_NODE_TYPE",6);Xt.DFS_NODE_ORDER=new Xt("DFS_NODE_ORDER",7);Xt.BFS_NODE_ORDER=new Xt("BFS_NODE_ORDER",8);var Vd=class{constructor(){this._layeredGraph=null,this._nodeHeights=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Longest path layering",1),this._layeredGraph=t;let o=t.getLayerlessNodes();this._nodeHeights=new Int32Array(o.length);for(let r=0;r<o.length;r++)o[r].id=r,this._nodeHeights[r]=-1;for(let r of o)this._visit(r);o.length=0,this._layeredGraph=null,this._nodeHeights=null,e.done()}_visit(t){let e=this._nodeHeights[t.id];if(e>=0)return e;let o=1;for(let r of t.getPorts())for(let i of r.getOutgoingEdges()){let s=i.getTarget().getNode();if(t!==s){let a=this._visit(s);a+1>o&&(o=a+1)}}return this._putNode(t,o),o}_putNode(t,e){let o=this._layeredGraph.getLayers();for(;o.length<e;)o.unshift(new Et(this._layeredGraph));t.setLayer(o[o.length-e]),this._nodeHeights[t.id]=e}};var Xd=class{constructor(){this._layeredGraph=null,this._nodeHeights=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Longest path to source layering",1),this._layeredGraph=t;let o=t.getLayerlessNodes();this._nodeHeights=new Int32Array(o.length);for(let r=0;r<o.length;r++)o[r].id=r,this._nodeHeights[r]=-1;for(let r of o)this._visit(r);o.length=0,this._layeredGraph=null,this._nodeHeights=null,e.done()}_visit(t){let e=this._nodeHeights[t.id];if(e>=0)return e;let o=1;for(let r of t.getPorts())for(let i of r.getIncomingEdges()){let s=i.getSource().getNode();if(t!==s){let a=this._visit(s);a+1>o&&(o=a+1)}}return this._putNode(t,o),o}_putNode(t,e){let o=this._layeredGraph.getLayers();for(;o.length<e;)o.push(new Et(this._layeredGraph));t.setLayer(o[e-1]),this._nodeHeights[t.id]=e}};var Bo=class extends Error{constructor(t,e){super(t),this.name="UnsupportedGraphException",e&&(this.cause=e)}};var Kd=class{constructor(){this._layeredGraph=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Breadth first model order layering",1),this._layeredGraph=t;let o=[];for(let l of t.getLayerlessNodes())l.getType()===y.NORMAL&&o.push(l);o.sort((l,c)=>{if(l.hasProperty(p.MODEL_ORDER)&&c.hasProperty(p.MODEL_ORDER)){let g=l.getProperty(p.MODEL_ORDER),h=c.getProperty(p.MODEL_ORDER);return g-h}throw new Bo("The BF model order layer assigner requires all real nodes to have a model order.")});let r=!0,i=new Et(t),s=null;t.getLayers().push(i);for(let l of o)if(r)l.setLayer(i),r=!1;else{for(let c of l.getIncomingEdges()){let g=c.getSource().getNode(),h=g.getType()===y.NORMAL&&g.getLayer()===i,d=!1;if(g.getType()===y.LABEL){let f=g.getIncomingEdges().next().value;f!=null&&f.getSource().getNode().getLayer()===i&&(d=!0)}if(h||d){s=new Et(t),t.getLayers().push(s),i=new Et(t),t.getLayers().push(i);break}}for(let c of l.getIncomingEdges()){let g=c.getSource().getNode();g.getType()===y.LABEL&&g.getLayer()==null&&g.setLayer(s)}l.setLayer(i)}t.getLayerlessNodes().length=0;let a=t.getLayers();for(let l=a.length-1;l>=0;l--)a[l].getNodes().length===0&&a.splice(l,1);for(let l=0;l<a.length;l++)a[l].id=l;e.done()}};var Zd=class{getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.INTERACTIVE_EXTERNAL_PORT_POSITIONER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Interactive node layering",1);let o=[];for(let s of t.getLayerlessNodes()){let a=s.getPosition().x,l=Math.max(a+1,a+s.getSize().x),c=null,g=0;for(;g<o.length;){let h=o[g];if(h.start>=l)break;if(h.end>a)if(c==null)h.nodes.push(s),h.start=Math.min(h.start,a),h.end=Math.max(h.end,l),c=h,g++;else{for(let d of h.nodes)c.nodes.push(d);c.end=Math.max(c.end,h.end),o.splice(g,1)}else g++}c==null&&o.splice(g,0,{start:a,end:l,nodes:[s]})}let r=t.getLayers(),i=0;for(let s of o){let a=new Et(t);a.id=i++,r.push(a);for(let l of s.nodes)l.setLayer(a),l.id=0}for(let s of t.getLayerlessNodes())if(s.id===0){let a=this._checkNode(s,t);for(;a.size>0;){let l=a.values().next().value;a.delete(l);let c=this._checkNode(l,t);for(let g of c)a.add(g)}}for(let s=r.length-1;s>=0;s--)r[s].getNodes().length===0&&r.splice(s,1);t.getLayerlessNodes().length=0,e.done()}_checkNode(t,e){t.id=1;let o=t.getLayer(),r=new Set;for(let i of t.getPorts(W.OUTPUT))for(let s of i.getOutgoingEdges()){let a=s.getTarget().getNode();if(t!==a&&a.getLayer().id<=o.id){let c=o.id+1;if(c===e.getLayers().length){let g=new Et(e);g.id=c,e.getLayers().push(g),a.setLayer(g)}else a.setLayer(e.getLayers()[c]);r.add(a)}}return r}};var jd=class{constructor(){this._nodeMark=null,this._edgeMark=null,this._inDeg=null,this._outDeg=null,this._topoOrd=null,this._inTopo=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){if(e.begin("Coffman-Graham Layering",1),t.getLayerlessNodes().length===0){e.done();return}let o=t.getProperty(_.LAYERING_COFFMAN_GRAHAM_LAYER_BOUND),r=0,i=0;for(let d of t.getLayerlessNodes()){d.id=r++;for(let f of d.getOutgoingEdges())f.id=i++}this._nodeMark=new Array(r).fill(!1),this._edgeMark=new Array(i).fill(!1),this._inDeg=new Int32Array(r),this._outDeg=new Int32Array(r),this._topoOrd=new Int32Array(r),this._inTopo=new Map,this._transitiveReduction(t);let s=[];for(let d of t.getLayerlessNodes()){for(let f of d.getIncomingEdges())this._edgeMark[f.id]||this._inDeg[d.id]++;this._inDeg[d.id]===0&&s.push(d)}let a=0;for(;s.length>0;){s.sort((f,E)=>this._compareNodesInTopo(f,E));let d=s.shift();this._topoOrd[d.id]=a++;for(let f of d.getOutgoingEdges()){if(this._edgeMark[f.id])continue;let E=f.getTarget().getNode();this._inDeg[E.id]--,this._pushInTopo(E,this._topoOrd[d.id]),this._inDeg[E.id]===0&&s.push(E)}}let l=[];for(let d of t.getLayerlessNodes()){for(let f of d.getOutgoingEdges())this._edgeMark[f.id]||this._outDeg[d.id]++;this._outDeg[d.id]===0&&l.push(d)}let c=(d,f)=>-(this._topoOrd[d.id]-this._topoOrd[f.id]),g=[],h=this._createLayer(t,g);for(;l.length>0;){l.sort(c);let d=l.shift();(this._isLayerFull(h,o)||!this._canAdd(d,h))&&(h=this._createLayer(t,g)),d.setLayer(h);for(let f of d.getIncomingEdges()){if(this._edgeMark[f.id])continue;let E=f.getSource().getNode();this._outDeg[E.id]--,this._outDeg[E.id]===0&&l.push(E)}}for(let d=g.length-1;d>=0;d--)t.getLayers().push(g[d]);t.getLayerlessNodes().length=0,e.done()}_pushInTopo(t,e){let o=this._inTopo.get(t);o?o.push(e):this._inTopo.set(t,[e])}_isLayerFull(t,e){return t.getNodes().length>=e}_canAdd(t,e){for(let o of t.getOutgoingEdges())if(o.getTarget().getNode().getLayer()===e)return!1;return!0}_createLayer(t,e){let o=new Et(t);return e.push(o),o}_compareNodesInTopo(t,e){let o=this._inTopo.get(t)||[],r=this._inTopo.get(e)||[],i=o.length-1,s=r.length-1;for(;i>=0&&s>=0;){let a=o[i--],l=r[s--];if(a!==l)return a-l}return i<0&&s<0?t.id<e.id?-1:t.id>e.id?1:0:i<0?-1:1}_transitiveReduction(t){for(let e of t.getLayerlessNodes()){this._nodeMark.fill(!1);for(let o of e.getOutgoingEdges())this._dfs(e,o.getTarget().getNode())}}_dfs(t,e){if(!this._nodeMark[e.id]){for(let o of e.getOutgoingEdges()){let r=o.getTarget().getNode();for(let i of r.getIncomingEdges())i.getSource().getNode()===t&&(this._edgeMark[i.id]=!0);this._dfs(t,r)}this._nodeMark[e.id]=!0}}};var $d=class{constructor(){this._layeredGraph=null,this._componentNodes=null,this._nodeVisited=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Network simplex layering",1),this._layeredGraph=t;let o=t.getProperty(_.THOROUGHNESS)*GI,r=t.getLayerlessNodes();if(r.length<1){e.done();return}let i=this._connectedComponents(r),s=null;for(let a of i){let l=o*Math.floor(Math.sqrt(a.length)),c=this._initialize(a);li.forGraph(c).withIterationLimit(l).withPreviousLayering(s).withBalancing(!0).execute(e.subTask(1));let g=t.getLayers();for(let h of c.nodes){for(;g.length<=h.layer;)g.push(new Et(t));h.origin.setLayer(g[h.layer])}if(i.length>1){s=new Array(g.length);for(let h=0;h<g.length;h++)s[h]=g[h].getNodes().length}}r.length=0,this._dispose(),e.done()}_connectedComponents(t){this._nodeVisited==null||this._nodeVisited.length<t.length?this._nodeVisited=new Array(t.length).fill(!1):this._nodeVisited.fill(!1),this._componentNodes=[];for(let o=0;o<t.length;o++)t[o].id=o;let e=[];for(let o of t)this._nodeVisited[o.id]||(this._connectedComponentsDFS(o),e.length===0||e[0].length<this._componentNodes.length?e.unshift(this._componentNodes):e.push(this._componentNodes),this._componentNodes=[]);return e}_connectedComponentsDFS(t){this._nodeVisited[t.id]=!0,this._componentNodes.push(t);for(let e of t.getPorts())for(let o of e.getConnectedEdges()){let r=this._getOpposite(e,o).getNode();this._nodeVisited[r.id]||this._connectedComponentsDFS(r)}}_initialize(t){let e=new Map,o=new Wi;for(let r of t){let i=He.of().origin(r).create(o);e.set(r,i)}for(let r of t)for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;let s=Math.max(1,i.getProperty(_.PRIORITY_SHORTNESS));te.of(i).weight(s).delta(1).source(e.get(i.getSource().getNode())).target(e.get(i.getTarget().getNode())).create()}return o}_dispose(){this._componentNodes=null,this._layeredGraph=null,this._nodeVisited=null}_getOpposite(t,e){if(e.getSource()===t)return e.getTarget();if(e.getTarget()===t)return e.getSource();throw new Error("Input edge is not connected to the input port.")}},GI=4;var qd=class{constructor(){this._layeredGraph=null,this._currentLayer=null,this._currentLayerId=0,this._currentDummyLayer=null,this._nodesToPlace=null,this._maxToPlace=0}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Depth first model order layering",1),this._layeredGraph=t;let o=[];for(let s of t.getLayerlessNodes())s.getType()===y.NORMAL&&o.push(s);o.sort((s,a)=>{if(s.hasProperty(p.MODEL_ORDER)&&a.hasProperty(p.MODEL_ORDER))return s.getProperty(p.MODEL_ORDER)-a.getProperty(p.MODEL_ORDER);throw new Bo("The DF model order layer assigner requires all real nodes to have a model order.")});let r=!0;this._currentLayer=new Et(t),this._currentDummyLayer=null,t.getLayers().push(this._currentLayer),this._currentLayer.id=0,this._currentLayerId=0,this._nodesToPlace=[];for(let s of o){if(r){s.setLayer(this._currentLayer),r=!1;continue}if(this._isConnectedToCurrentLayer(s)){let a=this._currentLayerId;a=this._getMaxConnectedLayer(a,s);let l=a+2,c=a-this._currentLayerId;if(this._nodesToPlace.length>0)if(c>0){for(let g of this._nodesToPlace)g.id+=a-this._maxToPlace;this._placeNodesToPlace(),this._nodesToPlace.length=0,this._addNodeToLayer(l,s)}else{this._nodesToPlace.push(s),s.id=l,l>this._maxToPlace&&(this._maxToPlace=l);for(let g of s.getIncomingEdges()){let h=g.getSource().getNode();h.getLayer()==null&&h.getType()===y.LABEL&&(this._nodesToPlace.push(h),h.id=l-1)}this._currentLayerId=l}else this._addNodeToLayer(l,s)}else if(this._placeNodesToPlace(),this._nodesToPlace.length=0,s.getIncomingEdges()[Symbol.iterator]().next().done)this._nodesToPlace.push(s),s.id=0,this._maxToPlace<0&&(this._maxToPlace=0),this._currentLayer=t.getLayers()[0],this._currentLayerId=0;else{let c=0;c=this._getMaxConnectedLayer(c,s);let g=c+2;this._addNodeToLayer(g,s)}}this._nodesToPlace.length>0&&this._placeNodesToPlace(),t.getLayerlessNodes().length=0;let i=t.getLayers();for(let s=i.length-1;s>=0;s--)i[s].getNodes().length===0&&i.splice(s,1);for(let s=0;s<i.length;s++)i[s].id=s;e.done()}_isConnectedToCurrentLayer(t){for(let e of t.getIncomingEdges()){let o=e.getSource().getNode(),r,i;if(this._nodesToPlace.length===0){r=o.getType()===y.NORMAL&&o.getLayer()!=null&&o.getLayer().id===this._currentLayerId;let a=o.getIncomingEdges()[Symbol.iterator]().next();if(a.done)i=!1;else{let l=a.value.getSource().getNode().getLayer();i=o.getType()===y.LABEL&&l!=null&&l.id===this._currentLayerId}}else{r=o.getType()===y.NORMAL&&o.id===this._currentLayerId;let a=o.getIncomingEdges()[Symbol.iterator]().next();i=o.getType()===y.LABEL&&!a.done&&a.value.getSource().getNode().id===this._currentLayerId}if(r||i)return!0}return!1}_addNodeToLayer(t,e){let o=this._layeredGraph.getLayers();t<o.length?(this._currentLayer=o[t],this._currentDummyLayer=o[t-1],this._currentLayerId=t):(this._currentDummyLayer=new Et(this._layeredGraph),this._currentDummyLayer.id=t-1,o.push(this._currentDummyLayer),this._currentLayer=new Et(this._layeredGraph),this._currentLayer.id=t,o.push(this._currentLayer),this._currentLayerId=t),e.setLayer(this._currentLayer);for(let r of e.getIncomingEdges()){let i=r.getSource().getNode();i.getLayer()==null&&i.getType()===y.LABEL&&i.setLayer(this._currentDummyLayer)}}_getMaxConnectedLayer(t,e){let o=t;for(let r of e.getIncomingEdges()){let i=r.getSource().getNode();i.getLayer()!=null&&i.getLayer().id>o&&(o=i.getLayer().id)}return o}_placeNodesToPlace(){this._maxToPlace=0;let t=this._layeredGraph.getLayers();for(let e of this._nodesToPlace){if(e.id>=t.length){let o=new Et(this._layeredGraph);o.id=e.id-1,t.push(o);let r=new Et(this._layeredGraph);r.id=e.id,t.push(r)}e.setLayer(t[e.id])}}};var Jd=class{constructor(){this._widthCurrent=0,this._widthUp=0,this._maxWidth=0,this._currentGraph=null,this._upperLayerInfluence=0,this._sortedLayerlessNodes=[],this._alreadyPlacedNodes=new Set,this._alreadyPlacedInOtherLayers=new Set,this._tempLayerlessNodes=[],this._successors=[],this._outDegree=null,this._remainingOutGoing=null,this._inDegree=null,this._selectedNode=null,this._minimumNodeSize=0,this._maximumNodeSize=0,this._normSize=null,this._dummySize=0}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){if(e.begin("StretchWidth layering",1),t.getLayerlessNodes().length===0){e.done();return}this._currentGraph=t,this._widthCurrent=0,this._widthUp=0,this._minimumNodeSize=Number.POSITIVE_INFINITY,this._maximumNodeSize=Number.NEGATIVE_INFINITY,this._dummySize=Number(t.getProperty(_.SPACING_EDGE_EDGE)),this._computeSortedNodes(),this._computeSuccessors(),this._computeDegrees(),this._minMaxNodeSize(),this._computeNormalizedSize(),this._minimumNodeSize=Math.max(1,this._minimumNodeSize),this._maximumNodeSize=Math.max(1,this._maximumNodeSize),this._dummySize/=this._minimumNodeSize,this._maxWidth=this._maximumNodeSize/this._minimumNodeSize,this._upperLayerInfluence=this._getAverageOutDegree();let o=new Et(this._currentGraph);for(this._currentGraph.getLayers().push(o),this._tempLayerlessNodes=this._sortedLayerlessNodes.slice(),this._remainingOutGoing=Int32Array.from(this._outDegree);this._tempLayerlessNodes.length>0;)if(this._selectedNode=this._selectNode(),this._selectedNode==null||this._conditionGoUp()&&this._alreadyPlacedNodes.size>0){this._updateOutGoing(o),o=new Et(this._currentGraph),this._currentGraph.getLayers().push(o);for(let r of this._alreadyPlacedNodes)this._alreadyPlacedInOtherLayers.add(r);this._alreadyPlacedNodes.clear(),this._widthCurrent=this._widthUp,this._widthUp=0}else if(this._conditionGoUp())this._currentGraph.getLayers().length=0,o=new Et(this._currentGraph),this._currentGraph.getLayers().push(o),this._widthCurrent=0,this._widthUp=0,this._alreadyPlacedNodes.clear(),this._alreadyPlacedInOtherLayers.clear(),this._maxWidth++,this._tempLayerlessNodes=this._sortedLayerlessNodes.slice(),this._remainingOutGoing=Int32Array.from(this._outDegree);else{this._selectedNode.setLayer(o);let r=this._tempLayerlessNodes.indexOf(this._selectedNode);r>=0&&this._tempLayerlessNodes.splice(r,1),this._alreadyPlacedNodes.add(this._selectedNode),this._widthCurrent=this._widthCurrent-this._outDegree[this._selectedNode.id]*this._dummySize+this._normSize[this._selectedNode.id],this._widthUp+=this._inDegree[this._selectedNode.id]*this._dummySize}t.getLayerlessNodes().length=0,t.getLayers().reverse(),e.done()}_conditionGoUp(){let t=this._widthCurrent-this._outDegree[this._selectedNode.id]*this._dummySize+this._normSize[this._selectedNode.id]>this._maxWidth,e=this._widthUp+this._inDegree[this._selectedNode.id]*this._dummySize>this._maxWidth*this._upperLayerInfluence*this._dummySize;return t||e}_selectNode(){for(let t of this._tempLayerlessNodes)if(this._remainingOutGoing[t.id]<=0)return t;return null}_computeSortedNodes(){let t=this._currentGraph.getLayerlessNodes();this._sortedLayerlessNodes=t.slice();for(let e of t)e.id=this._getRank(e);this._sortedLayerlessNodes.sort((e,o)=>o.id-e.id)}_getRank(t){let e=gl(t.getOutgoingEdges());for(let o of t.getIncomingEdges()){let r=o.getSource().getNode(),i=gl(r.getOutgoingEdges());i>e&&(e=i)}return e}_computeSuccessors(){let t=0;this._successors=[];let e=new Set;for(let o of this._sortedLayerlessNodes){o.id=t;for(let r of o.getOutgoingEdges())e.add(r.getTarget().getNode());e.delete(o),this._successors.push(new Set(e)),e.clear(),t++}}_computeDegrees(){let t=this._sortedLayerlessNodes.length;this._inDegree=new Int32Array(t),this._outDegree=new Int32Array(t);for(let e of this._sortedLayerlessNodes)this._inDegree[e.id]=gl(e.getIncomingEdges()),this._outDegree[e.id]=gl(e.getOutgoingEdges())}_minMaxNodeSize(){for(let t of this._sortedLayerlessNodes){if(t.getType()!==y.NORMAL)continue;let e=t.getSize().y;e<this._minimumNodeSize&&(this._minimumNodeSize=e),e>this._maximumNodeSize&&(this._maximumNodeSize=e)}}_computeNormalizedSize(){this._normSize=new Float64Array(this._sortedLayerlessNodes.length);for(let t of this._sortedLayerlessNodes)this._normSize[t.id]=t.getSize().y/this._minimumNodeSize}_getAverageOutDegree(){let t=0,e=this._currentGraph.getLayerlessNodes();for(let o of e)t+=gl(o.getOutgoingEdges());return e.length===0?0:t/e.length}_updateOutGoing(t){for(let e of t.getNodes())for(let o of e.getIncomingEdges()){let r=o.getSource().getNode().id;this._remainingOutGoing[r]--}}};function gl(n){let t=0;for(let e of n)t++;return t}var Qd=class{constructor(){this._dummySize=0,this._minimumNodeSize=0,this._normSize=null,this._avgSize=0,this._inDegree=null,this._outDegree=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("MinWidth layering",1);let o=t.getLayers(),r=t.getLayerlessNodes(),i=t.getProperty(_.LAYERING_MIN_WIDTH_UPPER_BOUND_ON_WIDTH),s=t.getProperty(_.LAYERING_MIN_WIDTH_UPPER_LAYER_ESTIMATION_SCALING_FACTOR);this._dummySize=Number(t.getProperty(_.SPACING_EDGE_EDGE)),this._minimumNodeSize=Number.POSITIVE_INFINITY;for(let T of r){if(T.getType()!==y.NORMAL)continue;let N=T.getSize().y;N<this._minimumNodeSize&&(this._minimumNodeSize=N)}this._minimumNodeSize=Math.max(1,this._minimumNodeSize);let a=r.length;this._inDegree=new Int32Array(a),this._outDegree=new Int32Array(a),this._normSize=new Float64Array(a);let l=0;this._avgSize=0;for(let T of r)T.id=l++,this._inDegree[T.id]=this._countEdgesExceptSelfLoops(T.getIncomingEdges()),this._outDegree[T.id]=this._countEdgesExceptSelfLoops(T.getOutgoingEdges()),this._normSize[T.id]=T.getSize().y/this._minimumNodeSize,this._avgSize+=this._normSize[T.id];this._dummySize/=this._minimumNodeSize,a>0&&(this._avgSize/=a);let c=this._precalcSuccessors(r);r.sort((T,N)=>this._outDegree[N.id]-this._outDegree[T.id]);let g=Number.POSITIVE_INFINITY,h=Number.MAX_SAFE_INTEGER,d=null,f=i,E=i,P=s,S=s;i<0&&(f=1,E=4),s<0&&(P=1,S=2);for(let T=f;T<=E;T++)for(let N=P;N<=S;N++){let{width:I,layering:C}=this._computeMinWidthLayering(T,N,r,c),x=C.length;(I<g||I===g&&x<h)&&(g=I,h=x,d=C)}for(let T of d){let N=new Et(t);for(let I of T)I.setLayer(N);o.push(N)}o.reverse(),r.length=0,e.done()}_precalcSuccessors(t){let e=new Array(t.length);for(let o of t){let r=new Set;for(let i of o.getOutgoingEdges())this._isSelfLoop(i)||r.add(i.getTarget().getNode());e[o.id]=r}return e}_computeMinWidthLayering(t,e,o,r){let i=[],s=new Set(o),a=t*this._avgSize,l=new Set,c=new Set,g=[],h=0,d=0,f=0,E=0,P=0,S=0,T=0,N=0;for(;s.size>0;){let I=this._selectNode(s,r,c);if(I!=null&&(s.delete(I),g.push(I),l.add(I),N=this._outDegree[I.id],h+=this._normSize[I.id]-N*this._dummySize,T=this._inDegree[I.id],d+=T*this._dummySize,S+=N*this._dummySize,E+=this._normSize[I.id]),I==null||s.size===0||h>=a&&this._normSize[I.id]>N*this._dummySize||d>=e*a){i.push(g),g=[];for(let M of l)c.add(M);l.clear(),P-=S;let x=P*this._dummySize+E;x>f&&(f=x),P+=d,h=d,d=0,S=0,E=0}}return{width:f,layering:i}}_selectNode(t,e,o){for(let r of t){let i=!0;for(let s of e[r.id])if(!o.has(s)){i=!1;break}if(i)return r}return null}_isSelfLoop(t){return t.getSource().getNode()===t.getTarget().getNode()}_countEdgesExceptSelfLoops(t){let e=0;for(let o of t)this._isSelfLoop(o)||e++;return e}};var ae=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}create(){switch(this){case n.NETWORK_SIMPLEX:return new $d;case n.LONGEST_PATH:return new Vd;case n.LONGEST_PATH_SOURCE:return new Xd;case n.COFFMAN_GRAHAM:return new jd;case n.INTERACTIVE:return new Zd;case n.BF_MODEL_ORDER:return new Kd;case n.DF_MODEL_ORDER:return new qd;case n.STRETCH_WIDTH:return new Jd;case n.MIN_WIDTH:return new Qd;default:throw new Error(`Unknown layering strategy ${this.name}`)}}toString(){return this.name}static valueOf(t){return n[t]}};ae.NETWORK_SIMPLEX=new ae("NETWORK_SIMPLEX",0);ae.LONGEST_PATH=new ae("LONGEST_PATH",1);ae.LONGEST_PATH_SOURCE=new ae("LONGEST_PATH_SOURCE",2);ae.COFFMAN_GRAHAM=new ae("COFFMAN_GRAHAM",3);ae.INTERACTIVE=new ae("INTERACTIVE",4);ae.STRETCH_WIDTH=new ae("STRETCH_WIDTH",5);ae.MIN_WIDTH=new ae("MIN_WIDTH",6);ae.BF_MODEL_ORDER=new ae("BF_MODEL_ORDER",7);ae.DF_MODEL_ORDER=new ae("DF_MODEL_ORDER",8);var tf=class{process(t,e){e.begin("Simple node placement",1);let o=t.getProperty(p.SPACINGS),r=0;for(let i of t.getLayers()){let s=i.getSize();s.y=0;let a=null;for(let l of i.getNodes())a!=null&&(s.y+=o.getVerticalSpacing(l,a)),s.y+=l.getMargin().top+l.getSize().y+l.getMargin().bottom,a=l;r=Math.max(r,s.y)}for(let i of t.getLayers()){let s=i.getSize(),a=(r-s.y)/2,l=null;for(let c of i.getNodes())l!=null&&(a+=o.getVerticalSpacing(c,l)),a+=c.getMargin().top,c.getPosition().y=a,a+=c.getSize().y+c.getMargin().bottom,l=c}e.done()}getLayoutProcessorConfiguration(t){return null}};var ef=class{constructor(){this._spacings=null}process(t,e){e.begin("Interactive node placement",1),this._spacings=t.getProperty(p.SPACINGS);for(let o of t)this._placeNodes(o);e.done()}_placeNodes(t){let e=Number.NEGATIVE_INFINITY,o=y.NORMAL;for(let r of t){let i=r.getType();if(i!==y.NORMAL){let a=r.getProperty(p.ORIGINAL_DUMMY_NODE_POSITION);a==null?(e=Math.max(e,0),r.getPosition().y=e+this._spacings.getVerticalSpacing(i,o)):r.getPosition().y=a}let s=this._spacings.getVerticalSpacing(i,o);r.getPosition().y<e+s+r.getMargin().top&&(r.getPosition().y=e+s+r.getMargin().top),e=r.getPosition().y+r.getSize().y+r.getMargin().bottom,o=i}}getLayoutProcessorConfiguration(t){return null}};var of=new m("linearSegments.inputPrio",0),rf=new m("linearSegments.outputPrio",0),HI=20,vI=4,BI=3,UI=1e-4,hl="FORW_PENDULUM",F_="BACKW_PENDULUM",FI="RUBBER",k_=class n{constructor(){this.nodes=[],this.id=0,this.indexInLastLayer=-1,this.lastLayer=-1,this.deflection=0,this.weight=0,this.refSegment=null,this.nodeType=null}region(){let t=this;for(;t.refSegment!=null;)t=t.refSegment;return t}split(t,e){let o=this.nodes.indexOf(t),r=new n;r.id=e;let i=this.nodes.splice(o);for(let s of i)s.id=e,r.nodes.push(s);return r}toString(){return`ls[${this.nodes.map(t=>String(t)).join(",")}]`}},sf=class{constructor(){this.linearSegments=null,this.spacings=null}process(t,e){e.begin("Linear segments node placement",1),this.spacings=t.getProperty(p.SPACINGS),this._sortLinearSegments(t),this._createUnbalancedPlacement(t),this._balancePlacement(t),this._postProcess(t),this.linearSegments=null,this.spacings=null,e.done()}getLayoutProcessorConfiguration(t){return null}_sortLinearSegments(t){for(let d of t)for(let f of d){f.id=-1;let E=Number.MIN_SAFE_INTEGER,P=Number.MIN_SAFE_INTEGER;for(let S of f.getPorts()){for(let T of S.getIncomingEdges()){let N=T.getProperty(_.PRIORITY_STRAIGHTNESS);N>E&&(E=N)}for(let T of S.getOutgoingEdges()){let N=T.getProperty(_.PRIORITY_STRAIGHTNESS);N>P&&(P=N)}}f.setProperty(of,E),f.setProperty(rf,P)}let e=[],o=0;for(let d of t)for(let f of d)if(f.id<0){let E=new k_;E.id=o++,this._fillSegment(f,E),e.push(E)}let r=[],i=[];for(let d=0;d<e.length;d++)r.push([]),i.push(0);this._createDependencyGraphEdges(t,e,r,i);let s=e.slice(),a=r.slice(),l=i.slice(),c=0,g=[];for(let d=0;d<s.length;d++)l[d]===0&&g.push(s[d]);let h=new Int32Array(s.length);for(;g.length>0;){let d=g.shift();for(h[d.id]=c++;a[d.id].length>0;){let f=a[d.id].shift();l[f.id]--,l[f.id]===0&&g.push(f)}}this.linearSegments=new Array(s.length);for(let d=0;d<s.length;d++){let f=s[d],E=h[d];this.linearSegments[E]=f,f.id=E;for(let P of f.nodes)P.id=E}}_createDependencyGraphEdges(t,e,o,r){let i=e.length,s=0;for(let a of t){let l=a.getNodes();if(l.length===0)continue;let c=null,g=0,h=0,d=l[h++];for(;d!=null;){let f=e[d.id];if(f.indexInLastLayer>=0){let P=null;for(let S=g+1;S<l.length;S++){let T=l[S],N=e[T.id];if(N.lastLayer===f.lastLayer&&N.indexInLastLayer<f.indexInLastLayer){P=N;break}}if(P!=null){if(c!=null){r[d.id]=r[d.id]-1;let S=o[c.id],T=S.indexOf(f);T>=0&&S.splice(T,1)}f=f.split(d,i++),e.push(f),o.push([]),c!=null?(o[c.id].push(f),r.push(1)):r.push(0)}}let E=null;if(h<l.length){E=l[h++];let P=e[E.id];o[d.id].push(P),r[E.id]=r[E.id]+1}f.lastLayer=s,f.indexInLastLayer=g++,c=d,d=E}s++}}_fillSegment(t,e){let o=t.getType();if(t.id>=0)return!1;if(t.id=e.id,e.nodes.push(t),e.nodeType=o,o===y.LONG_EDGE||o===y.NORTH_SOUTH_PORT)for(let r of t.getPorts())for(let i of r.getSuccessorPorts()){let s=i.getNode(),a=s.getType();if(t.getLayer()!==s.getLayer()&&(a===y.LONG_EDGE||a===y.NORTH_SOUTH_PORT)&&this._fillSegment(s,e))return!0}return!0}_createUnbalancedPlacement(t){let e=t.getLayers().length,o=new Int32Array(e),r=new Array(e).fill(null);for(let i of this.linearSegments){let s=0;for(let a of i.nodes){let l=a.getLayer().getIndex();o[l]++;let c=t.getProperty(_.SPACING_EDGE_EDGE);o[l]>0&&r[l]!=null&&(c=this.spacings.getVerticalSpacing(r[l],a)),s=Math.max(s,a.getLayer().getSize().y+c)}for(let a of i.nodes){a.getPosition().y=s+a.getMargin().top;let l=a.getLayer();l.getSize().y=s+a.getMargin().top+a.getSize().y+a.getMargin().bottom,r[l.getIndex()]=a}}}_balancePlacement(t){let e=Number(t.getProperty(_.NODE_PLACEMENT_LINEAR_SEGMENTS_DEFLECTION_DAMPENING)),o=t.getProperty(_.THOROUGHNESS),r=vI,i=BI,s=HI/o,a=!1,l=hl,c=Number.MAX_SAFE_INTEGER;do{let g=l!==F_,h=l!==hl,d=0;for(let E of this.linearSegments)E.refSegment=null,this._calcDeflection(E,g,h,e),d+=Math.abs(E.deflection);let f;do f=this._mergeRegions(t);while(f);for(let E of this.linearSegments){let P=E.region().deflection;if(P!==0)for(let S of E.nodes)S.getPosition().y+=P}l===hl||l===F_?(r--,r<=0&&(d<c||-r>o)?(l=FI,c=Number.MAX_SAFE_INTEGER):l===hl?(l=F_,c=d):(l=hl,c=d)):(a=d>=c||c-d<s,c=d,a&&i--)}while(!(a&&i<=0))}_calcDeflection(t,e,o,r){let i=0,s=0;for(let a of t.nodes){let l=0,c=0,g=e?a.getProperty(of):Number.MIN_SAFE_INTEGER,h=o?a.getProperty(rf):Number.MIN_SAFE_INTEGER,d=Math.max(g,h);for(let f of a.getPorts()){let E=a.getPosition().y+f.getPosition().y+f.getAnchor().y;if(o)for(let P of f.getOutgoingEdges()){let S=P.getTarget(),T=S.getNode();if(t!==this.linearSegments[T.id]){let N=Math.max(T.getProperty(of),T.getProperty(rf)),I=P.getProperty(_.PRIORITY_STRAIGHTNESS);I>=d&&I>=N&&(l+=T.getPosition().y+S.getPosition().y+S.getAnchor().y-E,c++)}}if(e)for(let P of f.getIncomingEdges()){let S=P.getSource(),T=S.getNode();if(t!==this.linearSegments[T.id]){let N=Math.max(T.getProperty(of),T.getProperty(rf)),I=P.getProperty(_.PRIORITY_STRAIGHTNESS);I>=d&&I>=N&&(l+=T.getPosition().y+S.getPosition().y+S.getAnchor().y-E,c++)}}}c>0&&(i+=l/c,s++)}s>0?(t.deflection=r*i/s,t.weight=s):(t.deflection=0,t.weight=0)}_mergeRegions(t){let e=!1,o=Number(t.getProperty(_.SPACING_NODE_NODE)),r=UI*o;for(let i of t){let s=i.getNodes();if(s.length===0)continue;let a=s[0],l=this.linearSegments[a.id].region();for(let c=1;c<s.length;c++){let g=s[c],h=this.linearSegments[g.id].region();if(l!==h){let d=this.spacings.getVerticalSpacing(a,g),f=a.getPosition().y+a.getSize().y+a.getMargin().bottom+l.deflection+d,E=g.getPosition().y-g.getMargin().top+h.deflection;if(f>E+r){let P=l.weight+h.weight;h.deflection=(h.weight*h.deflection+l.weight*l.deflection)/P,h.weight=P,l.refSegment=h,e=!0}}a=g,l=h}}return e}_postProcess(t){for(let e of this.linearSegments){let o=Number.MAX_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER;for(let c of e.nodes){let g=c.getIndex(),h;if(g>0){let f=c.getLayer().getNodes()[g-1],E=this.spacings.getVerticalSpacing(c,f);h=c.getPosition().y-c.getMargin().top-(f.getPosition().y+f.getSize().y+f.getMargin().bottom+E)}else h=c.getPosition().y-c.getMargin().top;h<o&&(o=h);let d;if(g<c.getLayer().getNodes().length-1){let f=c.getLayer().getNodes()[g+1],E=this.spacings.getVerticalSpacing(c,f);d=f.getPosition().y-f.getMargin().top-(c.getPosition().y+c.getSize().y+c.getMargin().bottom+E)}else d=2*c.getPosition().y;d<r&&(r=d)}let i=Number.MAX_SAFE_INTEGER,s=!1,a=e.nodes[0];for(let c of a.getPorts()){let g=a.getPosition().y+c.getPosition().y+c.getAnchor().y;for(let h of c.getIncomingEdges()){let d=h.getSource(),f=d.getNode().getPosition().y+d.getPosition().y+d.getAnchor().y-g;Math.abs(f)<Math.abs(i)&&Math.abs(f)<(f<0?o:r)&&(i=f,s=!0)}}let l=e.nodes[e.nodes.length-1];for(let c of l.getPorts()){let g=l.getPosition().y+c.getPosition().y+c.getAnchor().y;for(let h of c.getOutgoingEdges()){let d=h.getTarget(),f=d.getNode().getPosition().y+d.getPosition().y+d.getAnchor().y-g;Math.abs(f)<Math.abs(i)&&Math.abs(f)<(f<0?o:r)&&(i=f,s=!0)}}if(s&&i!==0)for(let c of e.nodes)c.getPosition().y+=i}}};var ye=class n{constructor(t){this.name=t}toString(){return this.name}isFlexibleSize(){return this===n.NODE_SIZE}isFlexibleSizeWhereSpacePermits(){return this===n.NODE_SIZE_WHERE_SPACE_PERMITS||this===n.NODE_SIZE}isFlexiblePorts(){return this===n.PORT_POSITION||this===n.NODE_SIZE_WHERE_SPACE_PERMITS||this===n.NODE_SIZE}isAtLeast(t){switch(this){case n.NODE_SIZE:return t.isFlexibleSize();case n.NODE_SIZE_WHERE_SPACE_PERMITS:return t.isFlexibleSizeWhereSpacePermits();case n.PORT_POSITION:return t.isFlexiblePorts();default:return!0}}static getNodeFlexibility(t){return typeof t.getAllProperties=="function"&&t.getAllProperties().has(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY)?t.getProperty(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY):t.getGraph().getProperty(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY_DEFAULT)}};ye.NONE=new ye("NONE");ye.PORT_POSITION=new ye("PORT_POSITION");ye.NODE_SIZE_WHERE_SPACE_PERMITS=new ye("NODE_SIZE_WHERE_SPACE_PERMITS");ye.NODE_SIZE=new ye("NODE_SIZE");var lf=4,YP=.1,kI=2,VP=1e4,XP=1,WI=1e-5,KP=-1,jP=0,cf=2,gf=class{constructor(){this._lGraph=null,this._spacings=null,this._nGraph=null,this._nodeReps=null,this._edgeReps=null,this._portMap=new Map,this._nodeCount=0,this._edgeCount=0,this._nodeState=null,this._twoPaths=null,this._crossing=null,this._flexibleWhereSpacePermitsEdges=new Set}getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);return e!=null&&e.has(v.EXTERNAL_PORTS)?K.create().addBefore(D.P5_EDGE_ROUTING,w.HIERARCHICAL_PORT_POSITION_PROCESSOR):null}process(t,e){e&&e.begin&&e.begin("Network simplex node placement",1),this._lGraph=t,this._spacings=t.getProperty(p.SPACINGS),this._prepare(),this._buildInitialAuxiliaryGraph(),this._insertNorthSouthAuxiliaryEdges(),this._insertInLayerEdgeAuxiliaryEdges();let o=t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES);o&&this._preferStraightEdges(),this._nGraph.makeConnected();let r=t.getProperty(_.THOROUGHNESS)*this._nGraph.nodes.length;if(li.forGraph(this._nGraph).withIterationLimit(r).withBalancing(!1).execute(ZP(e)),this._flexibleWhereSpacePermitsEdges.size>0){this._insertFlexibleWhereSpaceAuxiliaryEdges();for(let i of this._flexibleWhereSpacePermitsEdges)i.weight=XP;li.forGraph(this._nGraph).withIterationLimit(r).withBalancing(!1).execute(ZP(e))}o&&this._postProcessTwoPaths(),this._applyPositions(),this._cleanup(),e&&e.done&&e.done()}_prepare(){this._nGraph=new Wi;let t=0,e=0;for(let o of this._lGraph.getLayers())for(let r of o.getNodes()){r.id=t++;for(let s of r.getOutgoingEdges())s.id=e++;let i=af(r);for(let s of r.getPorts()){if(i){let l=s.getAnchor().y;if(l!==Math.floor(l)){let c=l-Math.round(l);s.getAnchor().y-=c}}let a=s.getPosition().y+s.getAnchor().y;if(a!==Math.floor(a)){let l=a-Math.round(a);s.getPosition().y-=l}}}this._nodeCount=t,this._edgeCount=e,this._nodeReps=new Array(t),this._edgeReps=new Array(e),this._flexibleWhereSpacePermitsEdges.clear(),this._portMap.clear()}_cleanup(){this._lGraph=null,this._nGraph=null,this._nodeReps=null,this._edgeReps=null,this._portMap.clear(),this._nodeState=null,this._crossing=null,this._twoPaths=null,this._flexibleWhereSpacePermitsEdges.clear()}_buildInitialAuxiliaryGraph(){for(let t of this._lGraph.getLayers())this._transformLayer(t);this._transformEdges()}_transformLayer(t){let e=null;for(let o of t.getNodes()){let r=af(o)?this._transformFixedOrderNode(o):this._transformFixedPosNode(o);if(this._nodeReps[o.id]=r,e!=null){let i=e.origin.getMargin().bottom+this._spacings.getVerticalSpacing(e.origin,o)+o.getMargin().top;e.isFlexible||(i+=e.origin.getSize().y),te.of().delta(Math.ceil(i)).weight(0).source(e.tail).target(r.head).create()}e=r}}_transformFixedPosNode(t){let e=He.of().origin(t).type("non-flexible").create(this._nGraph);for(let o of t.getPorts())u.SIDES_EAST_WEST.has(o.getSide())&&this._portMap.set(o,e);return new hf(t,!1,e,e)}_transformFixedOrderNode(t){let e=He.of().origin(t).type("flexible-head").create(this._nGraph),o=He.of().origin(t).type("flexible-tail").create(this._nGraph),r=new hf(t,!0,e,o),i=t.getSize().y,s=ye.getNodeFlexibility(t),a=s.isFlexibleSize()?XP:VP,l=te.of().weight(a).delta(Math.ceil(i)).source(e).target(o).create();s===ye.NODE_SIZE_WHERE_SPACE_PERMITS&&this._flexibleWhereSpacePermitsEdges.add(l);let c=t.getPortSideView(u.WEST);return this._transformPorts([...c].reverse(),r),this._transformPorts(t.getPortSideView(u.EAST),r),r}_transformPorts(t,e){if(t.length===0)return;let o=oo.getIndividualOrDefault(e.origin,_.SPACING_PORT_PORT),r=oo.getIndividualOrDefault(e.origin,_.SPACING_PORTS_SURROUNDING);r==null&&(r=new me);let i=e.head,s=null;for(let a of t){let l=s==null?r.top:o+s.getSize().y,c=He.of().origin(a).type("port").create(this._nGraph);this._portMap.set(a,c),te.of().weight(0).delta(Math.ceil(l)).source(i).target(c).create(),s=a,i=c}te.of().weight(0).delta(Math.ceil(r.bottom+s.getSize().y)).source(i).target(e.tail).create()}_transformEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes())for(let o of e.getOutgoingEdges())W_(o)&&this._transformEdge(o)}_transformEdge(t){let e=He.of().type("edge").create(this._nGraph),o=this._nodeReps[t.getSource().getNode().id],r=this._nodeReps[t.getTarget().getNode().id],i=t.getSource(),s=t.getTarget(),a=i.getAnchor().y,l=s.getAnchor().y;o.isFlexible||(a+=i.getPosition().y),r.isFlexible||(l+=s.getPosition().y);let c=Math.max(0,a-l),g=Math.max(0,l-a),h=this._getEdgeWeight(t),d=te.of(t).weight(h).delta(g).source(e).target(this._portMap.get(t.getSource())).create(),f=te.of(t).weight(h).delta(c).source(e).target(this._portMap.get(t.getTarget())).create();this._edgeReps[t.id]=new Y_(t,e,d,f)}_insertInLayerEdgeAuxiliaryEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes())if(e.getType()===y.NORMAL)for(let o of e.getConnectedEdges()){if(!o.isInLayerEdge())continue;let i=o.getSource().getNode().getType()!==y.NORMAL?o.getTarget():o.getSource(),s=o.getOther(i).getNode(),a=this._portMap.get(i),l=this._nodeReps[s.id].head,c,g;i.getNode().getIndex()<s.getIndex()?(c=a,g=l):(c=l,g=a),te.of().delta(0).weight(lf).source(c).target(g).create()}}_insertNorthSouthAuxiliaryEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes()){for(let o of e.getPortSideView(u.SOUTH)){let r=o.getProperty(p.PORT_DUMMY);r!=null&&te.of().delta(0).weight(YP).source(this._nodeReps[e.id].tail).target(this._nodeReps[r.id].head).create()}for(let o of e.getPortSideView(u.NORTH)){let r=o.getProperty(p.PORT_DUMMY);r!=null&&te.of().delta(0).weight(YP).source(this._nodeReps[r.id].tail).target(this._nodeReps[e.id].head).create()}}}_insertFlexibleWhereSpaceAuxiliaryEdges(){let t=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;for(let s of this._nGraph.nodes)s.layer<t&&(t=s.layer),s.layer>e&&(e=s.layer);let o=e-t,r=He.of().create(this._nGraph),i=He.of().create(this._nGraph);te.of().weight(VP*2).delta(o).source(r).target(i).create();for(let s of this._nodeReps)s.origin.getType()===y.NORMAL&&(s.origin.getPorts().length<=1||(te.of().weight(0).delta(s.tail.layer-t).source(r).target(s.tail).create(),te.of().weight(0).delta(o-s.head.layer).source(s.head).target(i).create()))}_applyPositions(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes()){let o=this._nodeReps[e.id],r=o.head.layer,i=o.tail.layer;e.getPosition().y=r;let s=i-r-e.getSize().y,a=af(e),l=ye.getNodeFlexibility(e);if(a&&l.isFlexibleSizeWhereSpacePermits()&&(e.getSize().y+=s),a&&l.isFlexiblePorts()){for(let c of e.getPorts())if(u.SIDES_EAST_WEST.has(c.getSide())){let g=this._portMap.get(c);c.getPosition().y=g.layer-r}for(let c of e.getLabels())zI(e,c,s);if(l.isFlexibleSizeWhereSpacePermits())for(let c of e.getPortSideView(u.SOUTH))c.getPosition().y+=s}}}_getEdgeWeight(t){let e=Math.max(1,t.getProperty(_.PRIORITY_STRAIGHTNESS)),o=z_(t.getSource().getNode().getType(),t.getTarget().getNode().getType());return e*o}_preferStraightEdges(){this._nodeState=new Array(this._nodeCount).fill(jP),this._twoPaths=[];for(let e of this._lGraph.getLayers())for(let o of e.getNodes())this._nodeState[o.id]=YI(o);this._markEdgeCrossings();let t=this._identifyPaths();for(let e of t){if(e.length<=1)continue;if(e.length===2){VI(e),af(e[0].getTarget().getNode())||this._twoPaths.push(e);continue}if(XI(e)||KI(e))continue;let o=null;for(let r=0;r<e.length;r++){let i=e[r],s=this._edgeReps[i.id],a;o==null||r===e.length-1?a=z_(y.NORMAL,y.LONG_EDGE):a=z_(y.LONG_EDGE,y.LONG_EDGE),a*=kI,s.left.weight=Math.max(s.left.weight,a),s.right.weight=Math.max(s.right.weight,a),o=i}}}_postProcessTwoPaths(){let t=[...this._twoPaths],e=[];for(;t.length>0;){let o=t.shift();this._improveTwoPath(o,!0)&&e.push(o)}for(;e.length>0;){let o=e.pop();this._improveTwoPath(o,!1)}}_improveTwoPath(t,e){let o=this._edgeReps[t[0].id],r=this._edgeReps[t[1].id];if(o.isStraight()&&r.isStraight())return!1;let i=o.right.target.origin;if(i==null||typeof i.getLayer!="function")return!1;let s=i,a=this._nodeReps[s.id],l=s.getIndex(),c=Number.POSITIVE_INFINITY;if(l>0){let C=s.getLayer().getNodes()[l-1],x=this._nodeReps[C.id],M=Math.ceil(this._spacings.getVerticalSpacing(C,s));c=a.head.layer-s.getMargin().top-(x.head.layer+C.getSize().y+C.getMargin().bottom)-M}let g=Number.POSITIVE_INFINITY;if(l<s.getLayer().getNodes().length-1){let C=s.getLayer().getNodes()[l+1],x=this._nodeReps[C.id],M=Math.ceil(this._spacings.getVerticalSpacing(C,s));g=x.head.layer-C.getMargin().top-(a.head.layer+s.getSize().y+s.getMargin().bottom)-M}if(e&&Math.abs(c-g)<WI)return!0;let h=+nf(o.left),d=-nf(o.right),f=-nf(r.left),E=+nf(r.right),P=o.notStraightBy()>0&&r.notStraightBy()<0,S=o.notStraightBy()<0&&r.notStraightBy()>0,T=o.left.target.layer+o.right.delta<r.right.target.layer+r.left.delta,N=o.left.target.layer+o.right.delta>r.right.target.layer+r.left.delta,I=0;return!P&&!S&&(N?c+f>0?I=f:g-h>0&&(I=h):T&&(c+d>0?I=d:g-E>0&&(I=E))),a.head.layer+=I,a.isFlexible&&(a.tail.layer+=I),!1}_identifyPaths(){let t=[];for(let e of this._lGraph.getLayers())for(let o of e.getNodes())if(this._nodeState[o.id]===cf)for(let r of o.getConnectedEdges()){if(!W_(r))continue;let i=this._follow(r,o,[]);i.length>1&&t.push(i)}return t}_follow(t,e,o){let r=t.getOther(e);if(o.push(t),this._nodeState[r.id]===KP||this._nodeState[r.id]===cf||this._crossing[t.id])return o;this._nodeState[r.id]=KP;for(let i of r.getConnectedEdges())if(!(!W_(i)||i===t))return this._follow(i,r,o);return o}_markEdgeCrossings(){this._crossing=new Array(this._edgeCount).fill(!1);let t=this._lGraph.getLayers();for(let e=0;e+1<t.length;e++)this._markCrossingEdges(t[e],t[e+1])}_markCrossingEdges(t,e){let o=[];for(let i of t.getNodes())for(let s of i.getPortSideView(u.EAST))for(let a of s.getOutgoingEdges())a.isInLayerEdge()||a.isSelfLoop()||a.getTarget().getNode().getLayer()!==e||o.push(a);let r=[...e.getNodes()].reverse();for(let i of r)for(let s of i.getPortSideView(u.WEST))for(let a of s.getIncomingEdges()){if(a.isInLayerEdge()||a.isSelfLoop()||a.getSource().getNode().getLayer()!==t||o.length===0)continue;let l=o.length-1;for(;l>=0&&o[l]!==a;)this._crossing[o[l].id]=!0,this._crossing[a.id]=!0,l--;l>=0&&o.splice(l,1)}}};function ZP(n){return n&&typeof n.subTask=="function"?n.subTask(1):n}function W_(n){return!n.isSelfLoop()&&!n.isInLayerEdge()}function z_(n,t){return n===y.NORMAL&&t===y.NORMAL?1*lf:n===y.NORMAL||t===y.NORMAL?2*lf:8*lf}function nf(n){return Math.abs(n.source.layer-n.target.layer)-n.delta}function zI(n,t,e){let o=n.getProperty(_.NODE_LABELS_PLACEMENT);o!=null&&(o.has&&o.has(k.V_BOTTOM)?t.getPosition().y+=e:o.has&&o.has(k.V_CENTER)&&(t.getPosition().y+=e/2))}function YI(n){let t=0,e=0;for(let o of n.getPorts()){for(let r of o.getIncomingEdges())r.isSelfLoop()||t++;for(let r of o.getOutgoingEdges())r.isSelfLoop()||e++;if(t>1||e>1)return cf}return t+e===1?cf:jP}function VI(n){let t=n[0],e=n[1];t.getTarget().getNode()!==e.getSource().getNode()&&(n[0]=e,n[1]=t)}function XI(n){if(n.length===0)return!1;if(n[0].getSource().getNode().getType()===y.LONG_EDGE)return!0;for(let t of n)if(t.getTarget().getNode().getType()===y.LONG_EDGE)return!0;return!1}function KI(n){if(n.length===0)return!1;if(ye.getNodeFlexibility(n[0].getSource().getNode()).isFlexibleSizeWhereSpacePermits())return!0;for(let e of n)if(ye.getNodeFlexibility(e.getTarget().getNode()).isFlexibleSizeWhereSpacePermits())return!0;return!1}function af(n){if(n.getType()!==y.NORMAL||n.getPorts().length<=1)return!1;let t=n.getProperty(_.PORT_CONSTRAINTS);if(t!=null&&typeof t.isPosFixed=="function"&&t.isPosFixed())return!1;let e=ye.getNodeFlexibility(n);if(e===ye.NONE)return!1;if(!e.isFlexibleSizeWhereSpacePermits()){let o=oo.getIndividualOrDefault(n,_.SPACING_PORT_PORT),r=n.getProperty(_.SPACING_PORTS_SURROUNDING);r==null&&(r=new me(o,o,o,o));let i=n.getPortSideView(u.WEST);if(r.top+r.bottom+(i.length-1)*o>n.getSize().y)return!1;let a=n.getPortSideView(u.EAST);if(r.top+r.bottom+(a.length-1)*o>n.getSize().y)return!1}return!0}var hf=class{constructor(t,e,o,r){this.origin=t,this.isFlexible=e,this.head=o,this.tail=r}},Y_=class{constructor(t,e,o,r){this.origin=t,this.left=o,this.right=r}isStraight(){return this.notStraightBy()===0}notStraightBy(){return this.left.target.layer-this.left.delta-(this.right.target.layer-this.right.delta)}};var rr=class{constructor(t,e,o,r){this.layeredGraph=t,this.spacings=t.getProperty(p.SPACINGS),this.root=new Array(e),this.blockSize=new Array(e),this.align=new Array(e),this.innerShift=new Array(e),this.sink=new Array(e),this.shift=new Array(e),this.y=new Array(e),this.su=new Array(e).fill(!1),this.od=new Array(e).fill(!0),this.vdir=o,this.hdir=r}cleanup(){this.root=null,this.blockSize=null,this.align=null,this.innerShift=null,this.sink=null,this.shift=null,this.y=null}layoutSize(){let t=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;for(let o of this.layeredGraph.getLayers())for(let r of o.getNodes()){let i=this.y[r.id],s=i+this.blockSize[this.root[r.id].id];i<t&&(t=i),s>e&&(e=s)}return e-t}calculateDelta(t,e){let o=this.y[t.getNode().id]+this.innerShift[t.getNode().id]+t.getPosition().y+t.getAnchor().y;return this.y[e.getNode().id]+this.innerShift[e.getNode().id]+e.getPosition().y+e.getAnchor().y-o}shiftBlock(t,e){let o=t;do this.y[o.id]=this.y[o.id]+e,o=this.align[o.id];while(o!==t)}checkSpaceAbove(t,e,o){let r=e,i=t,s=i;do{s=this.align[s.id];let a=this.getMinY(s),l=this._getUpperNeighbor(s,o);if(l!=null){let c=this.getMaxY(l),g=a-(c+this.spacings.getVerticalSpacing(s,l));g<r&&(r=g)}}while(i!==s);return r}checkSpaceBelow(t,e,o){let r=e,i=t,s=i;do{s=this.align[s.id];let a=this.getMaxY(s),l=this._getLowerNeighbor(s,o);if(l!=null){let g=this.getMinY(l)-(a+this.spacings.getVerticalSpacing(s,l));g<r&&(r=g)}}while(i!==s);return r}getMinY(t){let e=this.root[t.id];return this.y[e.id]+this.innerShift[t.id]-t.getMargin().top}getMaxY(t){let e=this.root[t.id];return this.y[e.id]+this.innerShift[t.id]+t.getSize().y+t.getMargin().bottom}_getLowerNeighbor(t,e){let o=t.getLayer(),r=e.nodeIndex[t.id];return r<o.getNodes().length-1?o.getNodes()[r+1]:null}_getUpperNeighbor(t,e){let o=t.getLayer(),r=e.nodeIndex[t.id];return r>0?o.getNodes()[r-1]:null}toString(){let t="";return this.hdir===Zt.RIGHT?t+="RIGHT":this.hdir===Zt.LEFT&&(t+="LEFT"),this.vdir===xt.DOWN?t+="DOWN":this.vdir===xt.UP?t+="UP":t+="BALANCED",t}},xt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};xt.DOWN=new xt("DOWN");xt.UP=new xt("UP");var Zt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Zt.RIGHT=new Zt("RIGHT");Zt.LEFT=new Zt("LEFT");function $P(n,t){for(let e of n.getConnectedEdges())if(e.getTarget().getNode()===t||e.getSource().getNode()===t)return e;return null}function V_(n){let t=new Map;for(let e of n.layeredGraph.getLayers())for(let o of e.getNodes()){let r=n.root[o.id],i=t.get(r);i==null&&(i=[],t.set(r,i)),i.push(o)}return t}var df=class{constructor(t,e){this.layeredGraph=t,this.ni=e}verticalAlignment(t,e){for(let r of this.layeredGraph.getLayers())for(let i of r.getNodes())t.root[i.id]=i,t.align[i.id]=i,t.innerShift[i.id]=0;let o=this.layeredGraph.getLayers();t.hdir===Zt.LEFT&&(o=[...o].reverse());for(let r of o){let i=-1,s=r.getNodes();t.vdir===xt.UP&&(i=Number.MAX_SAFE_INTEGER,s=[...s].reverse());for(let a of s){let l=t.hdir===Zt.LEFT?this.ni.rightNeighbors[a.id]:this.ni.leftNeighbors[a.id];if(l.length===0)continue;let c=l.length,g=Math.floor((c+1)/2)-1,h=Math.ceil((c+1)/2)-1;if(t.vdir===xt.UP){for(let d=h;d>=g;d--)if(t.align[a.id]===a){let f=l[d],E=f.getFirst();!e.has(f.getSecond())&&i>this.ni.nodeIndex[E.id]&&(t.align[E.id]=a,t.root[a.id]=t.root[E.id],t.align[a.id]=t.root[a.id],t.od[t.root[a.id].id]=t.od[t.root[a.id].id]&&a.getType()===y.LONG_EDGE,i=this.ni.nodeIndex[E.id])}}else for(let d=g;d<=h;d++)if(t.align[a.id]===a){let f=l[d],E=f.getFirst();!e.has(f.getSecond())&&i<this.ni.nodeIndex[E.id]&&(t.align[E.id]=a,t.root[a.id]=t.root[E.id],t.align[a.id]=t.root[a.id],t.od[t.root[a.id].id]=t.od[t.root[a.id].id]&&a.getType()===y.LONG_EDGE,i=this.ni.nodeIndex[E.id])}}}}insideBlockShift(t){let e=V_(t);for(let o of e.keys()){let r=o.getMargin().top,i=o.getSize().y+o.getMargin().bottom;t.innerShift[o.id]=0;let s=o,a;for(;(a=t.align[s.id])!==o;){let l=$P(s,a),c;t.hdir===Zt.LEFT?c=l.getTarget().getPosition().y+l.getTarget().getAnchor().y-l.getSource().getPosition().y-l.getSource().getAnchor().y:c=l.getSource().getPosition().y+l.getSource().getAnchor().y-l.getTarget().getPosition().y-l.getTarget().getAnchor().y;let g=t.innerShift[s.id]+c;t.innerShift[a.id]=g,r=Math.max(r,a.getMargin().top-g),i=Math.max(i,g+a.getSize().y+a.getMargin().bottom),s=a}s=o;do t.innerShift[s.id]=t.innerShift[s.id]+r,s=t.align[s.id];while(s!==o);t.blockSize[o.id]=r+i}}};var oa=Object.freeze({NONE:"NONE",IMPROVE_STRAIGHTNESS:"IMPROVE_STRAIGHTNESS",values(){return[this.NONE,this.IMPROVE_STRAIGHTNESS]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var qP=Number.MAX_VALUE;var ff=class{constructor(){this.bal=null,this.ni=null,this.blockFinished=new Set,this.postProcessablesQueue=[],this.postProcessablesStack=[]}init(t,e){this.bal=t,this.ni=e,this.blockFinished.clear(),this.postProcessablesQueue.length=0,this.postProcessablesStack.length=0}finishBlock(t){this.blockFinished.add(t)}calculateThreshold(t,e,o){throw new Error("abstract")}postProcess(){throw new Error("abstract")}getOther(t,e){if(t.getSource().getNode()===e)return t.getTarget().getNode();if(t.getTarget().getNode()===e)return t.getSource().getNode();throw new Error(`Node ${e} is neither source nor target of edge ${t}`)}},uf=class extends ff{calculateThreshold(t,e,o){return this.bal.vdir===xt.UP?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY}postProcess(){}},_f=class extends ff{calculateThreshold(t,e,o){let r=e===o,i=this.bal.align[o.id]===e;if(!(r||i))return t;let s=t;return r&&(s=this._getBound(e,!0)),!isFinite(s)&&i&&(s=this._getBound(o,!1)),s}_pickEdge(t){let e;t.isRoot?e=this.bal.hdir===Zt.RIGHT?t.free.getIncomingEdges():t.free.getOutgoingEdges():e=this.bal.hdir===Zt.LEFT?t.free.getIncomingEdges():t.free.getOutgoingEdges();let o=!1;for(let r of e)if(!(!this.bal.od[this.bal.root[t.free.id].id]&&r.isInLayerEdge())&&!this.bal.su[this.bal.root[t.free.id].id]&&(o=!0,this.blockFinished.has(this.bal.root[this.getOther(r,t.free).id])))return t.hasEdges=!0,t.edge=r,t;return t.hasEdges=o,t.edge=null,t}_getBound(t,e){let o=this.bal.vdir===xt.UP?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,r=this._pickEdge(new X_(t,e));if(r.edge==null&&r.hasEdges)return this.postProcessablesQueue.push(r),o;if(r.edge==null)return o;let i=r.edge.getSource(),s=r.edge.getTarget(),a;if(e){let l=this.bal.hdir===Zt.RIGHT?s:i,c=this.bal.hdir===Zt.RIGHT?i:s,g=this.bal.root[c.getNode().id];a=this.bal.y[g.id]+this.bal.innerShift[c.getNode().id]+c.getPosition().y+c.getAnchor().y-this.bal.innerShift[l.getNode().id]-l.getPosition().y-l.getAnchor().y}else{let l=this.bal.hdir===Zt.LEFT?s:i,c=this.bal.hdir===Zt.LEFT?i:s;a=this.bal.y[this.bal.root[c.getNode().id].id]+this.bal.innerShift[c.getNode().id]+c.getPosition().y+c.getAnchor().y-this.bal.innerShift[l.getNode().id]-l.getPosition().y-l.getAnchor().y}return this.bal.su[this.bal.root[i.getNode().id].id]=!0,this.bal.su[this.bal.root[s.getNode().id].id]=!0,a}postProcess(){for(;this.postProcessablesQueue.length>0;){let t=this.postProcessablesQueue.shift(),e=this._pickEdge(t);if(e.edge==null)continue;let o=e.edge;if(!this.bal.od[this.bal.root[t.free.id].id]&&o.isInLayerEdge())continue;this._process(t)||this.postProcessablesStack.push(t)}for(;this.postProcessablesStack.length>0;)this._process(this.postProcessablesStack.pop())}_process(t){let e=t.edge,o=e.getSource().getNode()===t.free?e.getTarget():e.getSource(),r=e.getSource().getNode()===t.free?e.getSource():e.getTarget(),i=this.bal.calculateDelta(o,r);if(i>0&&i<qP){let s=this.bal.checkSpaceAbove(r.getNode(),i,this.ni);return this.bal.shiftBlock(r.getNode(),-s),s>0}if(i<0&&-i<qP){let s=this.bal.checkSpaceBelow(r.getNode(),-i,this.ni);return this.bal.shiftBlock(r.getNode(),s),s>0}return!1}},X_=class{constructor(t,e){this.free=t,this.isRoot=e,this.hasEdges=!1,this.edge=null}};var pf=class{constructor(t,e){this.layeredGraph=t,this.ni=e,this.spacings=t.getProperty(p.SPACINGS),this.sinkNodes=new Map,t.getProperty(_.NODE_PLACEMENT_BK_EDGE_STRAIGHTENING)===oa.IMPROVE_STRAIGHTNESS?this.threshStrategy=new _f:this.threshStrategy=new uf}horizontalCompaction(t){for(let o of this.layeredGraph.getLayers())for(let r of o.getNodes())t.sink[r.id]=r,t.shift[r.id]=t.vdir===xt.UP?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;this.sinkNodes.clear();let e=this.layeredGraph.getLayers();t.hdir===Zt.LEFT&&(e=[...e].reverse()),this.threshStrategy.init(t,this.ni),t.y.fill(null);for(let o of e){let r=o.getNodes();t.vdir===xt.UP&&(r=[...r].reverse());for(let i of r)t.root[i.id]===i&&this._placeBlock(i,t)}this._placeClasses(t);for(let o of e)for(let r of o.getNodes())if(t.y[r.id]=t.y[t.root[r.id].id],r===t.root[r.id]){let i=t.shift[t.sink[r.id].id];(t.vdir===xt.UP&&i>Number.NEGATIVE_INFINITY||t.vdir===xt.DOWN&&i<Number.POSITIVE_INFINITY)&&(t.y[r.id]=t.y[r.id]+i)}this.threshStrategy.postProcess()}_placeBlock(t,e){if(e.y[t.id]!=null)return;let o=!0;e.y[t.id]=0;let r=t,i=e.vdir===xt.DOWN?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;do{let s=this.ni.nodeIndex[r.id],a=r.getLayer().getNodes().length;if(e.vdir===xt.DOWN&&s>0||e.vdir===xt.UP&&s<a-1){let c=e.vdir===xt.UP?s+1:s-1,g=r.getLayer().getNodes()[c],h=e.root[g.id];if(this._placeBlock(h,e),i=this.threshStrategy.calculateThreshold(i,t,r),e.sink[t.id]===t&&(e.sink[t.id]=e.sink[h.id]),e.sink[t.id]===e.sink[h.id]){let d=this.spacings.getVerticalSpacing(r,g);if(e.vdir===xt.UP){let f=e.y[t.id],E=e.y[h.id]+e.innerShift[g.id]-g.getMargin().top-d-r.getMargin().bottom-r.getSize().y-e.innerShift[r.id];o?(o=!1,e.y[t.id]=Math.min(E,i)):e.y[t.id]=Math.min(f,Math.min(E,i))}else{let f=e.y[t.id],E=e.y[h.id]+e.innerShift[g.id]+g.getSize().y+g.getMargin().bottom+d+r.getMargin().top-e.innerShift[r.id];o?(o=!1,e.y[t.id]=Math.max(E,i)):e.y[t.id]=Math.max(f,Math.max(E,i))}}else{let d=Number(this.layeredGraph.getProperty(_.SPACING_NODE_NODE)),f=this._getOrCreateClassNode(e.sink[t.id]),E=this._getOrCreateClassNode(e.sink[h.id]);if(e.vdir===xt.UP){let P=e.y[t.id]+e.innerShift[r.id]+r.getSize().y+r.getMargin().bottom+d-(e.y[h.id]+e.innerShift[g.id]-g.getMargin().top);f.addEdge(E,P)}else{let P=e.y[t.id]+e.innerShift[r.id]-r.getMargin().top-e.y[h.id]-e.innerShift[g.id]-g.getSize().y-g.getMargin().bottom-d;f.addEdge(E,P)}}}else i=this.threshStrategy.calculateThreshold(i,t,r);r=e.align[r.id]}while(r!==t);this.threshStrategy.finishBlock(t)}_placeClasses(t){let e=[];for(let o of this.sinkNodes.values())o.indegree===0&&e.push(o);for(;e.length>0;){let o=e.shift();o.classShift==null&&(o.classShift=0);for(let r of o.outgoing)r.target.classShift==null?r.target.classShift=o.classShift+r.separation:t.vdir===xt.DOWN?r.target.classShift=Math.min(r.target.classShift,o.classShift+r.separation):r.target.classShift=Math.max(r.target.classShift,o.classShift+r.separation),r.target.indegree--,r.target.indegree===0&&e.push(r.target)}for(let o of this.sinkNodes.values())t.shift[o.node.id]=o.classShift}_getOrCreateClassNode(t){let e=this.sinkNodes.get(t);return e==null&&(e=new K_,e.node=t,this.sinkNodes.set(t,e)),e}},K_=class{constructor(){this.classShift=null,this.node=null,this.outgoing=[],this.indegree=0}addEdge(t,e){let o=new Z_;o.target=t,o.separation=e,t.indegree++,this.outgoing.push(o)}},Z_=class{constructor(){this.separation=0,this.target=null}};var Ef=class n{constructor(){this.nodeCount=0,this.layerIndex=null,this.nodeIndex=null,this.leftNeighbors=[],this.rightNeighbors=[]}cleanup(){this.layerIndex=null,this.nodeIndex=null,this.leftNeighbors.length=0,this.rightNeighbors.length=0}static buildFor(t){let e=new n,o=0;for(let l of t)o+=l.getNodes().length;e.nodeCount=o,e.layerIndex=new Int32Array(t.getLayers().length),e.nodeIndex=new Int32Array(o);let r=0,i=0,s=0;for(let l of t.getLayers()){l.id=r++,e.layerIndex[l.id]=i++;let c=0;for(let g of l.getNodes())g.id=s++,e.nodeIndex[g.id]=c++}let a=(l,c)=>{let g=e.nodeIndex[l.getFirst().id]-e.nodeIndex[c.getFirst().id];return Math.sign(g)};return e.leftNeighbors=new Array(o),e.rightNeighbors=new Array(o),jI(e,t,a),ZI(e,t,a),e}};function ZI(n,t,e){for(let o of t)for(let r of o){let i=[],s=0;for(let a of r.getOutgoingEdges()){if(a.isSelfLoop()||a.isInLayerEdge())continue;let l=a.getProperty(_.PRIORITY_STRAIGHTNESS);l>s&&(s=l,i.length=0),l===s&&i.push(Gt.of(a.getTarget().getNode(),a))}i.sort(e),n.rightNeighbors[r.id]=i}}function jI(n,t,e){for(let o of t)for(let r of o){let i=[],s=0;for(let a of r.getIncomingEdges()){if(a.isSelfLoop()||a.isInLayerEdge())continue;let l=a.getProperty(_.PRIORITY_STRAIGHTNESS);l>s&&(s=l,i.length=0),l===s&&i.push(Gt.of(a.getSource().getNode(),a))}i.sort(e),n.leftNeighbors[r.id]=i}}var $I=3,mf=class{constructor(){this._lGraph=null,this._markedEdges=new Set,this._ni=null,this._produceBalancedLayout=!1}process(t,e){e.begin("Brandes & Koepf node placement",1),this._lGraph=t,this._ni=Ef.buildFor(t);let o=t.getProperty(_.NODE_PLACEMENT_BK_FIXED_ALIGNMENT),r=t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES);this._produceBalancedLayout=o==="NONE"&&!r||o==="BALANCED",this._markConflicts(t);let i=[];switch(o){case"LEFTDOWN":i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.LEFT));break;case"LEFTUP":i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.LEFT));break;case"RIGHTDOWN":i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.RIGHT));break;case"RIGHTUP":i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.RIGHT));break;default:i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.RIGHT)),i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.RIGHT)),i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.LEFT)),i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.LEFT))}let s=new df(t,this._ni);for(let c of i)s.verticalAlignment(c,this._markedEdges),s.insideBlockShift(c);let a=new pf(t,this._ni);for(let c of i)a.horizontalCompaction(c);let l=null;if(this._produceBalancedLayout){let c=this._createBalancedLayout(i,this._ni.nodeCount);this._checkOrderConstraint(t,c)&&(l=c)}if(l==null)for(let c of i)this._checkOrderConstraint(t,c)&&(l==null||l.layoutSize()>c.layoutSize())&&(l=c);l==null&&(l=i[0]);for(let c of t.getLayers())for(let g of c.getNodes())g.getPosition().y=l.y[g.id]+l.innerShift[g.id];for(let c of i)c.cleanup();this._ni.cleanup(),this._markedEdges.clear(),e.done()}_markConflicts(t){let e=t.getLayers().length;if(e<$I)return;let o=new Int32Array(e),r=t.getLayers();for(let i=0;i<e;i++)o[i]=r[i].getNodes().length;for(let i=1;i<e-1;i++){let s=r[i+1],a=s.getNodes(),l=0,c=0;for(let g=0;g<o[i+1];g++){let h=a[g];if(g===o[i+1]-1||this._incidentToInnerSegment(h,i+1,i)){let d=o[i]-1;for(this._incidentToInnerSegment(h,i+1,i)&&(d=this._ni.nodeIndex[this._ni.leftNeighbors[h.id][0].getFirst().id]);c<=g;){let f=s.getNodes()[c];if(!this._incidentToInnerSegment(f,i+1,i))for(let E of this._ni.leftNeighbors[f.id]){let P=this._ni.nodeIndex[E.getFirst().id];(P<l||P>d)&&this._markedEdges.add(E.getSecond())}c++}l=d}}}}_incidentToInnerSegment(t,e,o){if(t.getType()!==y.LONG_EDGE)return!1;for(let r of t.getIncomingEdges())if(r.getSource().getNode().getType()===y.LONG_EDGE&&this._ni.layerIndex[r.getSource().getNode().getLayer().id]===o&&this._ni.layerIndex[t.getLayer().id]===e)return!0;return!1}_createBalancedLayout(t,e){let o=t.length,r=new rr(this._lGraph,e,null,null),i=new Float64Array(o),s=new Float64Array(o),a=new Float64Array(o),l=0;for(let h=0;h<o;h++)s[h]=Number.POSITIVE_INFINITY,a[h]=Number.NEGATIVE_INFINITY;for(let h=0;h<o;h++){let d=t[h];i[h]=d.layoutSize(),i[l]>i[h]&&(l=h);for(let f of this._lGraph)for(let E of f){let P=d.y[E.id]+d.innerShift[E.id];P<s[h]&&(s[h]=P);let S=P+E.getSize().y;S>a[h]&&(a[h]=S)}}let c=new Float64Array(o);for(let h=0;h<o;h++)c[h]=t[h].vdir===xt.DOWN?s[l]-s[h]:a[l]-a[h];let g=new Array(o);for(let h of this._lGraph.getLayers())for(let d of h.getNodes()){for(let f=0;f<o;f++)g[f]=t[f].y[d.id]+t[f].innerShift[d.id]+c[f];g.sort((f,E)=>f-E),r.y[d.id]=(g[1]+g[2])/2,r.innerShift[d.id]=0}return r}_checkOrderConstraint(t,e){for(let o of t.getLayers()){let r=Number.NEGATIVE_INFINITY;for(let i of o.getNodes()){let s=e.y[i.id]+e.innerShift[i.id]-i.getMargin().top,a=e.y[i.id]+e.innerShift[i.id]+i.getSize().y+i.getMargin().bottom;if(s>r&&a>r)r=e.y[i.id]+e.innerShift[i.id]+i.getSize().y+i.getMargin().bottom;else return!1}}return!0}getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);return e&&e.has&&e.has("EXTERNAL_PORTS"),null}};var ze=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.SIMPLE:return new tf;case n.INTERACTIVE:return new ef;case n.LINEAR_SEGMENTS:return new sf;case n.BRANDES_KOEPF:return new mf;case n.NETWORK_SIMPLEX:return new gf;default:throw new Error("Unknown node placement strategy: "+this.name)}}static valueOf(t){return n[t]}};ze.SIMPLE=new ze("SIMPLE");ze.INTERACTIVE=new ze("INTERACTIVE");ze.LINEAR_SEGMENTS=new ze("LINEAR_SEGMENTS");ze.BRANDES_KOEPF=new ze("BRANDES_KOEPF");ze.NETWORK_SIMPLEX=new ze("NETWORK_SIMPLEX");var vo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};vo.CENTER=new vo("CENTER");vo.TOP_LEFT=new vo("TOP_LEFT");var Uo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};Uo.ONE_SIDED=new Uo("ONE_SIDED");Uo.TWO_SIDED=new Uo("TWO_SIDED");Uo.OFF=new Uo("OFF");var Me=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};Me.NONE=new Me("NONE");Me.INSIDE_PORT_SIDE_GROUPS=new Me("INSIDE_PORT_SIDE_GROUPS");Me.GROUP_MODEL_ORDER=new Me("GROUP_MODEL_ORDER");Me.MODEL_ORDER=new Me("MODEL_ORDER");var so=class{constructor(t){this.name=t}toString(){return this.name}};so.NONE=new so("NONE");so.LEFTUP=new so("LEFTUP");so.RIGHTUP=new so("RIGHTUP");so.LEFTDOWN=new so("LEFTDOWN");so.RIGHTDOWN=new so("RIGHTDOWN");so.BALANCED=new so("BALANCED");var Wr=class{constructor(t){this.name=t}toString(){return this.name}};Wr.NONE=new Wr("NONE");Wr.ALTERNATING=new Wr("ALTERNATING");var Yi=class{constructor(t){this.name=t}toString(){return this.name}};Yi.INPUT_ORDER=new Yi("INPUT_ORDER");Yi.PORT_DEGREE=new Yi("PORT_DEGREE");var Fo=class{constructor(t){this._name=t}toString(){return this._name}};Fo.OFF=new Fo("OFF");Fo.SINGLE_EDGE=new Fo("SINGLE_EDGE");Fo.MULTI_EDGE=new Fo("MULTI_EDGE");var zet=new m("org.eclipse.elk.layered.cycleBreaking.strategy",()=>Xt.GREEDY),Yet=new m("org.eclipse.elk.layered.layering.strategy",()=>ae.NETWORK_SIMPLEX),Vet=new m("org.eclipse.elk.layered.layering.layerConstraint",()=>J.NONE),Xet=new m("org.eclipse.elk.layered.layering.layerChoiceConstraint",null,-1),Ket=new m("org.eclipse.elk.layered.layering.layerId",-1,-1),Zet=new m("org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",4,-1),jet=new m("org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",2,-1),$et=new m("org.eclipse.elk.layered.layering.nodePromotion.strategy",()=>ut.NONE),qet=new m("org.eclipse.elk.layered.layering.nodePromotion.maxIterations",0,0),Jet=new m("org.eclipse.elk.layered.layering.coffmanGraham.layerBound",Number.MAX_SAFE_INTEGER),Qet=new m("org.eclipse.elk.layered.crossingMinimization.strategy",()=>We.LAYER_SWEEP),tot=new m("org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",!1),eot=new m("org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",.1),oot=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",40,0),rot=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",()=>Uo.TWO_SIDED),JP=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type",()=>Uo.OFF),iot=new m("org.eclipse.elk.layered.crossingMinimization.semiInteractive",!1),sot=new m("org.eclipse.elk.layered.crossingMinimization.inLayerPredOf"),not=new m("org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf"),aot=new m("org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint",null,-1),lot=new m("org.eclipse.elk.layered.crossingMinimization.positionId",-1,-1),cot=new m("org.eclipse.elk.layered.nodePlacement.strategy",()=>ze.BRANDES_KOEPF),got=new m("org.eclipse.elk.layered.nodePlacement.favorStraightEdges"),hot=new m("org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",()=>oa.IMPROVE_STRAIGHTNESS),dot=new m("org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment",()=>so.NONE),fot=new m("org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",.3,Xe.greaterThan(0)),uot=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility"),_ot=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",()=>ye.NONE),pot=new m("org.eclipse.elk.layered.edgeRouting.splines.mode",()=>Qr.SLOPPY),Eot=new m("org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",.2),mot=new m("org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",2),Pot=new m("org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",()=>Qo.NORTH),Oot=new m("org.eclipse.elk.layered.edgeRouting.selfLoopOrdering",()=>Je.STACKED),Sot=new m("org.eclipse.elk.layered.spacing.baseValue",null,0),Tot=new m("org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",10,0),Not=new m("org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",10,0),yot=new m("org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",20,0),QP=new m("org.eclipse.elk.layered.priority.direction",0,0),Iot=new m("org.eclipse.elk.layered.priority.shortness",0,0),tO=new m("org.eclipse.elk.layered.priority.straightness",0,0),Rot=new m("org.eclipse.elk.layered.compaction.postCompaction.strategy",()=>re.NONE),Lot=new m("org.eclipse.elk.layered.compaction.postCompaction.constraints",()=>Ur.SCANLINE),Aot=new m("org.eclipse.elk.layered.compaction.connectedComponents",!1),Cot=new m("org.eclipse.elk.layered.highDegreeNodes.treatment",!1),xot=new m("org.eclipse.elk.layered.highDegreeNodes.threshold",16,0),Dot=new m("org.eclipse.elk.layered.highDegreeNodes.treeHeight",5,0),wot=new m("org.eclipse.elk.layered.wrapping.strategy",()=>Fo.OFF),Mot=new m("org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",10),bot=new m("org.eclipse.elk.layered.wrapping.correctionFactor",1),Got=new m("org.eclipse.elk.layered.wrapping.cutting.strategy",()=>ro.MSD),Hot=new m("org.eclipse.elk.layered.wrapping.cutting.cuts"),vot=new m("org.eclipse.elk.layered.wrapping.cutting.msd.freedom",1,0),Bot=new m("org.eclipse.elk.layered.wrapping.validify.strategy",()=>io.GREEDY),Uot=new m("org.eclipse.elk.layered.wrapping.validify.forbiddenIndices"),Fot=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",!0),kot=new m("org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",2),Wot=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",!0),zot=new m("org.eclipse.elk.layered.layerUnzipping.strategy",()=>Wr.NONE),Yot=new m("org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",!1),eO=new m("org.eclipse.elk.layered.layerUnzipping.layerSplit",2,1),Vot=new m("org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",!0),oO=new m("org.eclipse.elk.layered.edgeLabels.sideSelection",()=>Tt.SMART_DOWN),Xot=new m("org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy",()=>Ct.MEDIAN_LAYER),Kot=new m("org.eclipse.elk.layered.considerModelOrder.strategy",()=>ce.NONE),Zot=new m("org.eclipse.elk.layered.considerModelOrder.portModelOrder",!1),jot=new m("org.eclipse.elk.layered.considerModelOrder.noModelOrder",!1),$ot=new m("org.eclipse.elk.layered.considerModelOrder.components",()=>Me.NONE),qot=new m("org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",()=>Ao.DUMMY_NODE_OVER),Jot=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",0),Qot=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",0),trt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",0),ert=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",0),ort=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.componentGroupId",0),rrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP),irt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredSourceId"),srt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredTargetId"),nrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP),art=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmEnforcedGroupOrders","1, 2, 6, 7, 10, 11"),lrt=new m("org.eclipse.elk.layered.directionCongruency",()=>jo.READING_DIRECTION),crt=new m("org.eclipse.elk.layered.feedbackEdges",!1),grt=new m("org.eclipse.elk.layered.interactiveReferencePoint",()=>vo.CENTER),hrt=new m("org.eclipse.elk.layered.mergeEdges",!1),drt=new m("org.eclipse.elk.layered.mergeHierarchyEdges",!0),frt=new m("org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",!1),urt=new m("org.eclipse.elk.layered.portSortingStrategy",()=>Yi.INPUT_ORDER),_rt=new m("org.eclipse.elk.layered.thoroughness",7,1),prt=new m("org.eclipse.elk.layered.unnecessaryBendpoints",!1),Ert=new m("org.eclipse.elk.layered.generatePositionAndLayerIds",!1);var _=class{};_.EDGE_LABELS_PLACEMENT=new m("org.eclipse.elk.edgeLabels.placement",()=>St.CENTER);_.EDGE_LABELS_INLINE=new m("org.eclipse.elk.edgeLabels.inline",!1);_.INTERACTIVE_REFERENCE_POINT=new m("org.eclipse.elk.layered.interactiveReferencePoint",()=>vo.CENTER);_.PRIORITY_DIRECTION=QP;_.LAYERING_LAYER_CONSTRAINT=new m("org.eclipse.elk.layered.layering.layerConstraint",()=>J.NONE);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",0);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_SOURCE_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingPreferredSourceId",-1);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_TARGET_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingPreferredTargetId",-1);_.LAYERING_LAYER_ID=new m("org.eclipse.elk.layered.layering.layerId",0);_.LAYERING_COFFMAN_GRAHAM_LAYER_BOUND=new m("org.eclipse.elk.layered.layering.coffmanGraham.layerBound",Number.MAX_SAFE_INTEGER);_.PRIORITY_SHORTNESS=new m("org.eclipse.elk.layered.priority.shortness",0);_.PRIORITY_STRAIGHTNESS=tO;_.NODE_PLACEMENT_BK_EDGE_STRAIGHTENING=new m("org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",()=>oa.IMPROVE_STRAIGHTNESS);_.NODE_PLACEMENT_BK_FIXED_ALIGNMENT=new m("org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment","NONE");_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES=new m("org.eclipse.elk.layered.nodePlacement.favorStraightEdges");_.NODE_PLACEMENT_LINEAR_SEGMENTS_DEFLECTION_DAMPENING=new m("org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",.3);_.UNNECESSARY_BENDPOINTS=new m("org.eclipse.elk.layered.unnecessaryBendpoints",!1);_.JUNCTION_POINTS=new m("org.eclipse.elk.junctionPoints");_.EDGE_THICKNESS=new m("org.eclipse.elk.edge.thickness",1);_.PORT_INDEX=new m("org.eclipse.elk.port.index");_.PORT_SORTING_STRATEGY=new m("org.eclipse.elk.layered.portSortingStrategy","INPUT_ORDER");_.SPACING_PORTS_SURROUNDING=new m("org.eclipse.elk.spacing.portsSurrounding");_.COMMENT_BOX=new m("org.eclipse.elk.commentBox",!1);_.SPACING_COMMENT_COMMENT=new m("org.eclipse.elk.spacing.commentComment",20);_.SPACING_COMMENT_NODE=new m("org.eclipse.elk.spacing.commentNode",20);_.MARGINS=new m("org.eclipse.elk.margins");_.SPACING_EDGE_LABEL=new m("org.eclipse.elk.spacing.edgeLabel",2);_.SPACING_LABEL_LABEL=new m("org.eclipse.elk.spacing.labelLabel",0);_.DIRECTION=new m("org.eclipse.elk.direction",R.UNDEFINED);_.EDGE_ROUTING=new m("org.eclipse.elk.edgeRouting",()=>At.ORTHOGONAL);_.DIRECTION_CONGRUENCY=new m("org.eclipse.elk.layered.directionCongruency",jo.READING_DIRECTION);_.NODE_LABELS_PADDING=new m("org.eclipse.elk.nodeLabels.padding");_.NODE_LABELS_PLACEMENT=new m("org.eclipse.elk.nodeLabels.placement");_.EDGE_LABELS_SIDE_SELECTION=oO;_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY=new m("org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy");_.ALIGNMENT=new m("org.eclipse.elk.alignment");_.POSITION=new m("org.eclipse.elk.position");_.NODE_SIZE_MINIMUM=new m("org.eclipse.elk.nodeSize.minimum");_.HYPERNODE=new m("org.eclipse.elk.hypernode",!1);_.CROSSING_MINIMIZATION_POSITION_ID=new m("org.eclipse.elk.layered.crossingMinimization.positionId",0);_.LAYERING_LAYER_CHOICE_CONSTRAINT=new m("org.eclipse.elk.layered.layering.layerChoiceConstraint");_.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF=new m("org.eclipse.elk.layered.crossingMinimization.inLayerPredOf");_.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF=new m("org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf");_.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT=new m("org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint");_.PARTITIONING_PARTITION=new m("org.eclipse.elk.partitioning.partition");_.PORT_ANCHOR=new m("org.eclipse.elk.port.anchor");_.ASPECT_RATIO=new m("org.eclipse.elk.aspectRatio",1.6);_.SPACING_COMPONENT_COMPONENT=new m("org.eclipse.elk.spacing.componentComponent",20);_.COMPACTION_CONNECTED_COMPONENTS=new m("org.eclipse.elk.layered.compaction.connectedComponents",!1);_.PRIORITY=new m("org.eclipse.elk.priority",0);_.WRAPPING_MULTI_EDGE_IMPROVE_WRAPPED_EDGES=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",!0);_.WRAPPING_MULTI_EDGE_IMPROVE_CUTS=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",!0);_.WRAPPING_MULTI_EDGE_DISTANCE_PENALTY=new m("org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",2);_.WRAPPING_CUTTING_STRATEGY=new m("org.eclipse.elk.layered.wrapping.cutting.strategy");_.WRAPPING_VALIDIFY_STRATEGY=new m("org.eclipse.elk.layered.wrapping.validify.strategy");_.WRAPPING_CORRECTION_FACTOR=new m("org.eclipse.elk.layered.wrapping.correctionFactor",1);_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES=new m("org.eclipse.elk.layered.wrapping.validify.forbiddenIndices");_.WRAPPING_CUTTING_CUTS=new m("org.eclipse.elk.layered.wrapping.cutting.cuts");_.WRAPPING_CUTTING_MSD_FREEDOM=new m("org.eclipse.elk.layered.wrapping.cutting.msd.freedom",2);_.WRAPPING_ADDITIONAL_EDGE_SPACING=new m("org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",10);_.LAYERING_NODE_PROMOTION_STRATEGY=new m("org.eclipse.elk.layered.layering.nodePromotion.strategy");_.LAYERING_NODE_PROMOTION_MAX_ITERATIONS=new m("org.eclipse.elk.layered.layering.nodePromotion.maxIterations",0);_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES=new m("org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",!1);_.EDGE_ROUTING_SELF_LOOP_DISTRIBUTION=new m("org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",Qo.NORTH);_.EDGE_ROUTING_SELF_LOOP_ORDERING=new m("org.eclipse.elk.layered.edgeRouting.selfLoopOrdering");_.LAYER_UNZIPPING_LAYER_SPLIT=eO;_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES=new m("org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",!0);_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH=new m("org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",!1);_.HIGH_DEGREE_NODES_THRESHOLD=new m("org.eclipse.elk.layered.highDegreeNodes.threshold",16);_.HIGH_DEGREE_NODES_TREE_HEIGHT=new m("org.eclipse.elk.layered.highDegreeNodes.treeHeight",5);_.THOROUGHNESS=new m("org.eclipse.elk.layered.thoroughness",7);_.SPACING_EDGE_EDGE=new m("org.eclipse.elk.spacing.edgeEdge",10);_.SPACING_NODE_SELF_LOOP=new m("org.eclipse.elk.spacing.nodeSelfLoop",10);_.PORT_BORDER_OFFSET=new m("org.eclipse.elk.port.borderOffset",0);_.NODE_SIZE_CONSTRAINTS=new m("org.eclipse.elk.nodeSize.constraints");_.NODE_SIZE_OPTIONS=new m("org.eclipse.elk.nodeSize.options");_.CONTENT_ALIGNMENT=new m("org.eclipse.elk.contentAlignment");_.PORT_LABELS_PLACEMENT=new m("org.eclipse.elk.portLabels.placement");_.PORT_LABELS_TREAT_AS_GROUP=new m("org.eclipse.elk.portLabels.treatAsGroup",!0);_.CYCLE_BREAKING_STRATEGY=new m("org.eclipse.elk.layered.cycleBreaking.strategy",()=>Xt.GREEDY);_.LAYERING_STRATEGY=new m("org.eclipse.elk.layered.layering.strategy",()=>ae.NETWORK_SIMPLEX);_.CROSSING_MINIMIZATION_STRATEGY=new m("org.eclipse.elk.layered.crossingMinimization.strategy",()=>We.LAYER_SWEEP);_.NODE_PLACEMENT_STRATEGY=new m("org.eclipse.elk.layered.nodePlacement.strategy",()=>ze.BRANDES_KOEPF);_.RANDOM_SEED=new m("org.eclipse.elk.randomSeed",1);_.FEEDBACK_EDGES=new m("org.eclipse.elk.layered.feedbackEdges",!1);_.INTERACTIVE_LAYOUT=new m("org.eclipse.elk.interactiveLayout",!1);_.GENERATE_POSITION_AND_LAYER_IDS=new m("org.eclipse.elk.layered.generatePositionAndLayerIds",!1);_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE=new m("org.eclipse.elk.layered.crossingMinimization.semiInteractive",!1);_.LAYER_UNZIPPING_STRATEGY=new m("org.eclipse.elk.layered.layerUnzipping.strategy");_.HIGH_DEGREE_NODES_TREATMENT=new m("org.eclipse.elk.layered.highDegreeNodes.treatment",!1);_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",Uo.TWO_SIDED);_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE=JP;_.CROSSING_MINIMIZATION_GREEDY_SWITCH_ACTIVATION_THRESHOLD=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",40);_.SEPARATE_CONNECTED_COMPONENTS=new m("org.eclipse.elk.separateConnectedComponents",!0);_.NODE_SIZE_FIXED_GRAPH_SIZE=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1);_.CONSIDER_MODEL_ORDER_COMPONENTS=new m("org.eclipse.elk.layered.considerModelOrder.components",Me.NONE);_.WRAPPING_STRATEGY=new m("org.eclipse.elk.layered.wrapping.strategy");_.COMPACTION_POST_COMPACTION_STRATEGY=new m("org.eclipse.elk.layered.compaction.postCompaction.strategy");_.COMPACTION_POST_COMPACTION_CONSTRAINTS=new m("org.eclipse.elk.layered.compaction.postCompaction.constraints");_.SPACING_NODE_NODE=new m("org.eclipse.elk.spacing.nodeNode",20);_.SPACING_EDGE_NODE=new m("org.eclipse.elk.spacing.edgeNode",10);_.SPACING_LABEL_NODE=new m("org.eclipse.elk.spacing.labelNode",5);_.SPACING_LABEL_PORT_HORIZONTAL=new m("org.eclipse.elk.spacing.labelPortHorizontal",1);_.SPACING_LABEL_PORT_VERTICAL=new m("org.eclipse.elk.spacing.labelPortVertical",1);_.SPACING_PORT_PORT=new m("org.eclipse.elk.spacing.portPort",10);_.SPACING_NODE_NODE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",20);_.SPACING_EDGE_NODE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",16);_.SPACING_EDGE_EDGE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",10);_.EDGE_ROUTING_SPLINES_MODE=new m("org.eclipse.elk.layered.edgeRouting.splines.mode",()=>Qr.SLOPPY);_.EDGE_ROUTING_POLYLINE_SLOPED_EDGE_ZONE_WIDTH=new m("org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",2);_.EDGE_ROUTING_SPLINES_SLOPPY_LAYER_SPACING_FACTOR=new m("org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",.2);_.SPACING_INDIVIDUAL=new m("org.eclipse.elk.spacing.individual");_.LAYERING_MIN_WIDTH_UPPER_BOUND_ON_WIDTH=new m("org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",4,-1);_.LAYERING_MIN_WIDTH_UPPER_LAYER_ESTIMATION_SCALING_FACTOR=new m("org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",2,-1);_.PORT_CONSTRAINTS=new m("org.eclipse.elk.portConstraints",()=>H.UNDEFINED);_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER=new m("org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",!1);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",0);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_ENFORCED_GROUP_ORDERS=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationEnforcedGroupOrders",()=>[]);_.CROSSING_MINIMIZATION_HIERARCHICAL_SWEEPINESS=new m("org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",.1);_.HIERARCHY_HANDLING=new m("org.eclipse.elk.hierarchyHandling","INHERIT");_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_NODE_INFLUENCE=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",0);_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_PORT_INFLUENCE=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",0);_.CONSIDER_MODEL_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.strategy",()=>ce.NONE);_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",()=>Ao.DUMMY_NODE_OVER);_.CONSIDER_MODEL_ORDER_PORT_MODEL_ORDER=new m("org.eclipse.elk.layered.considerModelOrder.portModelOrder",!1);_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility");_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY_DEFAULT=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",()=>ye.NODE_SIZE_WHERE_SPACE_PERMITS);_.NO_LAYOUT=new m("org.eclipse.elk.noLayout",!1);_.PORT_SIDE=new m("org.eclipse.elk.port.side");_.ALGORITHM=new m("org.eclipse.elk.algorithm");_.ALGORITHM_ID="org.eclipse.elk.layered";_.PARTITIONING_ACTIVATE=new m("org.eclipse.elk.partitioning.activate",!1);_.SPACING_BASE_VALUE=new m("org.eclipse.elk.spacing.baseValue");_.MERGE_EDGES=new m("org.eclipse.elk.layered.mergeEdges",!1);_.MERGE_HIERARCHY_EDGES=new m("org.eclipse.elk.layered.mergeHierarchyEdges",!0);_.INSIDE_SELF_LOOPS_ACTIVATE=new m("org.eclipse.elk.insideSelfLoops.activate",!1);_.INSIDE_SELF_LOOPS_YO=new m("org.eclipse.elk.insideSelfLoops.yo",!1);_.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER=new m("org.eclipse.elk.layered.considerModelOrder.noModelOrder",!1);_.PADDING=new m("org.eclipse.elk.padding",new yt(12));var z=class n{static toNodeArray(t){return[...t]}static toEdgeArray(t){return[...t]}static toPortArray(t){return[...t]}static resizeNode(t,e,o,r){let i=new O(t.getSize().x,t.getSize().y),s=e.x/i.x,a=e.y/i.y,l=e.x-i.x,c=e.y-i.y;if(o){let g=t.getProperty(_.PORT_CONSTRAINTS)===H.FIXED_POS;for(let h of t.getPorts())switch(h.getSide()){case u.NORTH:g||(h.getPosition().x*=s);break;case u.EAST:h.getPosition().x+=l,g||(h.getPosition().y*=a);break;case u.SOUTH:g||(h.getPosition().x*=s),h.getPosition().y+=c;break;case u.WEST:g||(h.getPosition().y*=a);break;default:break}}if(r)for(let g of t.getLabels()){let h=g.getPosition().x+g.getSize().x/2,d=g.getPosition().y+g.getSize().y/2,f=h/i.x,E=d/i.y;f+E>=1&&(f-E>0&&d>=0?(g.getPosition().x+=l,g.getPosition().y+=c*E):f-E<0&&h>=0&&(g.getPosition().x+=l*f,g.getPosition().y+=c))}t.getSize().x=e.x,t.getSize().y=e.y,t.setProperty(_.NODE_SIZE_CONSTRAINTS,mt.fixed())}static offsetGraphs(t,e,o){for(let r of t)n.offsetGraph(r,e,o)}static offsetGraph(t,e,o){let r=new O(e,o);for(let i of t.getLayerlessNodes()){i.getPosition().add(r);for(let s of i.getPorts())for(let a of s.getOutgoingEdges()){for(let c of a.getBendPoints())c.x+=e,c.y+=o;let l=a.getProperty(_.JUNCTION_POINTS);if(l!=null)for(let c of l)c.x+=e,c.y+=o;for(let c of a.getLabels())c.getPosition().add(r)}}}static placeNodesHorizontally(t,e){let o=0,r=0;for(let i of t.getNodes())o=Math.max(o,i.getMargin().left),r=Math.max(r,i.getMargin().right);for(let i of t.getNodes()){let s=i.getProperty(_.ALIGNMENT),a;switch(s){case Kt.LEFT:a=0;break;case Kt.RIGHT:a=1;break;case Kt.CENTER:a=.5;break;default:{let f=0,E=0;for(let P of i.getPorts())P.getIncomingEdges().length>0&&f++,P.getOutgoingEdges().length>0&&E++;a=f+E===0?.5:E/(f+E)}}let l=t.getSize(),c=i.getSize().x,g=(l.x-c)*a;a>.5?g-=r*2*(a-.5):a<.5&&(g+=o*2*(.5-a));let h=i.getMargin().left;g<h&&(g=h);let d=i.getMargin().right;g>l.x-d-c&&(g=l.x-d-c),i.getPosition().x=e+g}}static findMaxNonDummyNodeWidth(t,e){if(t.getGraph().getProperty(_.DIRECTION).isVertical())return 0;let o=0;for(let r of t.getNodes())if(r.getType()===y.NORMAL){let i=r.getSize().x;e&&(i+=r.getMargin().left+r.getMargin().right),i>o&&(o=i)}return o}static computeGraphProperties(t){let e=t.getProperty(p.GRAPH_PROPERTIES);e.size>0&&e.clear();let o=n.getDirection(t);for(let r of t.getLayerlessNodes()){r.getProperty(_.COMMENT_BOX)?e.add(v.COMMENTS):r.getProperty(_.HYPERNODE)?(e.add(v.HYPERNODES),e.add(v.HYPEREDGES)):r.getType()===y.EXTERNAL_PORT&&e.add(v.EXTERNAL_PORTS);let i=r.getProperty(_.PORT_CONSTRAINTS);i===H.UNDEFINED?r.setProperty(_.PORT_CONSTRAINTS,H.FREE):i!==H.FREE&&e.add(v.NON_FREE_PORTS);for(let s of r.getPorts()){s.getIncomingEdges().length+s.getOutgoingEdges().length>1&&e.add(v.HYPEREDGES);let a=s.getSide();o===R.UP||o===R.DOWN?(a===u.EAST||a===u.WEST)&&e.add(v.NORTH_SOUTH_PORTS):(a===u.NORTH||a===u.SOUTH)&&e.add(v.NORTH_SOUTH_PORTS);for(let l of s.getOutgoingEdges()){l.getTarget().getNode()===r&&e.add(v.SELF_LOOPS);for(let c of l.getLabels())switch(c.getProperty(_.EDGE_LABELS_PLACEMENT)){case St.CENTER:e.add(v.CENTER_LABELS);break;case St.HEAD:case St.TAIL:e.add(v.END_LABELS);break;default:break}}}}}static getExternalPortPosition(t,e,o,r){let i=new O(e.getPosition().x,e.getPosition().y);i.x+=e.getSize().x/2,i.y+=e.getSize().y/2;let s=e.getProperty(_.PORT_BORDER_OFFSET)||0,a=t.getSize(),l=t.getPadding(),c=t.getOffset();switch(e.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:i.x+=l.left+c.x-o/2,i.y=-r-s,e.getPosition().y=-(l.top+s+c.y);break;case u.EAST:i.x=a.x+l.left+l.right+s,i.y+=l.top+c.y-r/2,e.getPosition().x=a.x+l.right+s-c.x;break;case u.SOUTH:i.x+=l.left+c.x-o/2,i.y=a.y+l.top+l.bottom+s,e.getPosition().y=a.y+l.bottom+s-c.y;break;case u.WEST:i.x=-o-s,i.y+=l.top+c.y-r/2,e.getPosition().x=-(l.left+s+c.x);break;default:break}return i}static isDescendant(t,e){let o=t,r=o.getGraph().getParentNode();for(;r!=null;){if(o=r,o===e)return!0;r=o.getGraph().getParentNode()}return!1}static changeCoordSystem(t,e,o){if(e===o)return;let r=e,i;do if(t.add(r.getOffset()),i=r.getParentNode(),i!=null){let s=r.getPadding();t.add(s.left,s.top),t.add(i.getPosition()),r=i.getGraph()}while(i!=null);r=o;do if(t.sub(r.getOffset()),i=r.getParentNode(),i!=null){let s=r.getPadding();t.sub(s.left,s.top),t.sub(i.getPosition()),r=i.getGraph()}while(i!=null)}static getIndividualOrInherited(t,e){if(t!=null&&t.hasProperty&&t.hasProperty(as)){let o=t.getProperty(as);if(o!=null&&o.hasProperty&&o.hasProperty(e)){let r=o.getProperty(e);if(r!=null)return r}}if(t!=null&&t.hasProperty&&t.hasProperty(e))return t.getProperty(e);if(t!=null&&typeof t.getGraph=="function"){let o=t.getGraph();if(o!=null)return o.getProperty(e)}return t!=null?t.getProperty(e):null}static getDirection(t){let e=t.getProperty(_.DIRECTION);return e===R.UNDEFINED?t.getProperty(_.ASPECT_RATIO)>=1?R.RIGHT:R.DOWN:e}static getMinimalModelOrder(t){let e=Number.MAX_SAFE_INTEGER;for(let o of t.getLayerlessNodes())o.hasProperty(p.MODEL_ORDER)&&(e=Math.min(e,o.getProperty(p.MODEL_ORDER)));return e}static createPort(t,e,o,r){let i,s=n.getDirection(r);if((r.getProperty(_.MERGE_EDGES)||t.getProperty(_.HYPERNODE))&&!t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){let l=u.fromDirection(s);i=n.provideCollectorPort(r,t,o,o===W.OUTPUT?l:l.opposed())}else{if(i=new rt,i.setNode(t),e!=null){let g=i.getPosition();g.x=e.x-t.getPosition().x,g.y=e.y-t.getPosition().y,typeof g.bound=="function"?g.bound(0,0,t.getSize().x,t.getSize().y):(g.x=Math.min(Math.max(g.x,0),t.getSize().x),g.y=Math.min(Math.max(g.y,0),t.getSize().y)),i.setSide(n._calcPortSide(i,s))}else{let g=u.fromDirection(s);i.setSide(o===W.OUTPUT?g:g.opposed())}let l=r.getProperty(p.GRAPH_PROPERTIES),c=i.getSide();s===R.LEFT||s===R.RIGHT?(c===u.NORTH||c===u.SOUTH)&&l.add(v.NORTH_SOUTH_PORTS):(s===R.UP||s===R.DOWN)&&(c===u.EAST||c===u.WEST)&&l.add(v.NORTH_SOUTH_PORTS)}return i}static provideCollectorPort(t,e,o,r){let i=null;switch(o){case W.INPUT:for(let s of e.getPorts())if(s.getProperty(p.INPUT_COLLECT))return s;i=new rt,i.setProperty(p.INPUT_COLLECT,!0);break;case W.OUTPUT:for(let s of e.getPorts())if(s.getProperty(p.OUTPUT_COLLECT))return s;i=new rt,i.setProperty(p.OUTPUT_COLLECT,!0);break;default:break}return i!=null&&(i.setNode(e),i.setSide(r),n._centerPoint(i.getPosition(),e.getSize(),r)),i}static initializePort(t,e,o,r){let i=t.getSide();if(i===u.UNDEFINED&&e.isSideFixed()&&(i=n._calcPortSide(t,o),t.setSide(i),!t.hasProperty(_.PORT_BORDER_OFFSET)&&i!==u.UNDEFINED&&(t.getPosition().x!==0||t.getPosition().y!==0)&&t.setProperty(_.PORT_BORDER_OFFSET,n._calcPortOffset(t,i))),e.isRatioFixed()){let l=0;switch(i){case u.NORTH:case u.SOUTH:{let c=t.getNode().getSize().x;c>0&&(l=t.getPosition().x/c);break}case u.EAST:case u.WEST:{let c=t.getNode().getSize().y;c>0&&(l=t.getPosition().y/c);break}default:break}t.setProperty(p.PORT_RATIO_OR_POSITION,l)}let s=t.getSize(),a=t.getAnchor();if(r!=null)a.x=r.x,a.y=r.y,t.setExplicitlySuppliedPortAnchor(!0);else if(e.isSideFixed()&&i!==u.UNDEFINED)switch(i){case u.NORTH:a.x=s.x/2;break;case u.EAST:a.x=s.x,a.y=s.y/2;break;case u.SOUTH:a.x=s.x/2,a.y=s.y;break;case u.WEST:a.y=s.y/2;break;default:break}else a.x=s.x/2,a.y=s.y/2}static createExternalPortDummy(t,e,o,r,i,s,a,l,c){let g=o,h=new ft(c);h.setType(y.EXTERNAL_PORT),h.setProperty(p.EXT_PORT_SIZE,a),h.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS);let d=t.getProperty(_.PORT_BORDER_OFFSET)||0;h.setProperty(_.PORT_BORDER_OFFSET,d);let f=new rt;f.setNode(h),e.isSideFixed()||(r>=0?g=u.fromDirection(l):g=u.fromDirection(l).opposed(),t.setProperty(_.PORT_SIDE,g));let E=new O,P=!1;if(t.hasProperty(_.PORT_ANCHOR)){let S=t.getProperty(_.PORT_ANCHOR);E.x=S.x,E.y=S.y,P=!0}else E.x=a.x/2,E.y=a.y/2;switch(g){case u.WEST:h.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE),h.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),h.getSize().y=a.y,d<0&&(h.getSize().x=-d),f.setSide(u.EAST),P||(E.x=a.x),E.x-=a.x;break;case u.EAST:h.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE),h.setProperty(p.EDGE_CONSTRAINT,De.INCOMING_ONLY),h.getSize().y=a.y,d<0&&(h.getSize().x=-d),f.setSide(u.WEST),P||(E.x=0);break;case u.NORTH:h.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP),h.getSize().x=a.x,d<0&&(h.getSize().y=-d),f.setSide(u.SOUTH),P||(E.y=a.y),E.y-=a.y;break;case u.SOUTH:h.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM),h.getSize().x=a.x,d<0&&(h.getSize().y=-d),f.setSide(u.NORTH),P||(E.y=0);break;default:break}if(f.getPosition().x=E.x,f.getPosition().y=E.y,h.setProperty(_.PORT_ANCHOR,E),e.isOrderFixed()){let S=0;if(e===H.FIXED_ORDER&&t.hasProperty(_.PORT_INDEX))switch(g){case u.NORTH:case u.EAST:S=t.getProperty(_.PORT_INDEX);break;case u.SOUTH:case u.WEST:S=-t.getProperty(_.PORT_INDEX);break;default:break}else switch(g){case u.WEST:case u.EAST:S=s.y,e.isRatioFixed()&&(S/=i.y);break;case u.NORTH:case u.SOUTH:S=s.x,e.isRatioFixed()&&(S/=i.x);break;default:break}h.setProperty(p.PORT_RATIO_OR_POSITION,S)}return h.setProperty(p.EXT_PORT_SIDE,g),h}static _calcPortSide(t,e){let o=t.getNode(),r=o.getSize().x,i=o.getSize().y;if(r<=0&&i<=0)return u.UNDEFINED;let s=t.getPosition().x,a=t.getPosition().y,l=t.getSize().x,c=t.getSize().y;if(e===R.LEFT||e===R.RIGHT){if(s<0)return u.WEST;if(s+l>r)return u.EAST}else if(e===R.UP||e===R.DOWN){if(a<0)return u.NORTH;if(a+c>i)return u.SOUTH}let g=(s+l/2)/r,h=(a+c/2)/i;return g+h<=1&&g-h<=0?u.WEST:g+h>=1&&g-h>=0?u.EAST:h<.5?u.NORTH:u.SOUTH}static _calcPortOffset(t,e){let o=t.getNode();switch(e){case u.NORTH:return-(t.getPosition().y+t.getSize().y);case u.EAST:return t.getPosition().x-o.getSize().x;case u.SOUTH:return t.getPosition().y-o.getSize().y;case u.WEST:return-(t.getPosition().x+t.getSize().x);default:return 0}}static _centerPoint(t,e,o){switch(o){case u.NORTH:t.x=e.x/2,t.y=0;break;case u.EAST:t.x=e.x,t.y=e.y/2;break;case u.SOUTH:t.x=e.x/2,t.y=e.y;break;case u.WEST:t.x=0,t.y=e.y/2;break;default:break}}};var ra=class{combine(t,e){throw new Error("AbstractGraphPlacer.combine is abstract")}moveGraphs(t,e,o,r){for(let i of e)this.moveGraph(t,i,o,r)}moveGraph(t,e,o,r){let i=e.getOffset().clone().add(o,r);for(let s of e.getLayerlessNodes()){s.getPosition().add(i);for(let a of s.getPorts())for(let l of a.getOutgoingEdges()){l.getBendPoints().offset(i);let c=l.getProperty(_.JUNCTION_POINTS);c!=null&&c.offset(i);for(let g of l.getLabels())g.getPosition().add(i)}t.getLayerlessNodes().push(s),s.setGraph(t)}}offsetGraphs(t,e,o){for(let r of t)this.offsetGraph(r,e,o)}offsetGraph(t,e,o){let r=new O(e,o);for(let i of t.getLayerlessNodes()){i.getPosition().add(r);for(let s of i.getPorts())for(let a of s.getOutgoingEdges()){a.getBendPoints().offset(r);let l=a.getProperty(_.JUNCTION_POINTS);l!=null&&l.offset(r);for(let c of a.getLabels())c.getPosition().add(r)}}}};var{SIDES_EAST:JI,SIDES_EAST_SOUTH:QI,SIDES_EAST_SOUTH_WEST:tR,SIDES_EAST_WEST:eR,SIDES_NORTH:oR,SIDES_NORTH_EAST:rR,SIDES_NORTH_EAST_SOUTH_WEST:iR,SIDES_NORTH_EAST_WEST:sR,SIDES_NORTH_SOUTH:nR,SIDES_NORTH_SOUTH_WEST:aR,SIDES_NORTH_WEST:lR,SIDES_SOUTH:cR,SIDES_SOUTH_WEST:gR,SIDES_WEST:hR}=u,sa=class{constructor(t){this._spacing=t,this.cGraph=null,this._oldPosition=new Map,this._offsets=new Map,this._globalOffset=null,this._graphSize=null,this._externalExtensions=new Map,this._externalPlaceholder=new Map;for(let e of[R.LEFT,R.RIGHT,R.UP,R.DOWN])this._externalPlaceholder.set(e,[])}getOffset(t){let e=this._oldPosition.get(t),o=this._offsets.get(t).rect.getPosition();return e.clone().sub(o)}getGlobalOffset(){return this._globalOffset}getGraphSize(){return this._graphSize}getExternalExtensions(){return this._externalExtensions}getExternalPlaceholder(){return this._externalPlaceholder}transform(t){this.cGraph=new Zn(new Set([R.LEFT,R.RIGHT,R.UP,R.DOWN]));for(let e of t.getComponents()){let o=new tr;this.cGraph.cGroups.push(o);for(let r of e.getHull()){let i=new ia(r,null,this._spacing);this._setLock(i,e.getExternalExtensionSides()),this._oldPosition.has(e)||(this._oldPosition.set(e,new O(r.x,r.y)),this._offsets.set(e,i)),this.cGraph.cNodes.push(i),o.addCNode(i)}for(let r of e.getExternalExtensions()){let i=new ia(r.getRepresentor(),null,this._spacing);this._externalExtensions.set(r,{first:o,second:i}),this._setLock(i,e.getExternalExtensionSides());let s=r.getPlaceholder?r.getPlaceholder():null;if(s!=null){let a=new ia(s,1,this._spacing);this._setLock(a,e.getExternalExtensionSides()),new tr().addCNode(a);let c=this._externalPlaceholder.get(r.getDirection())||[];c.push({first:o,second:a}),this._externalPlaceholder.set(r.getDirection(),c)}}}return this.cGraph}_setLock(t,e){let o=r=>e.size===r.size&&[...r].every(i=>e.has(i));e.size===0&&t.lock.set(!0,!0,!0,!0),o(oR)&&t.lock.set(!0,!0,!0,!1),o(JI)&&t.lock.set(!1,!0,!0,!0),o(cR)&&t.lock.set(!0,!0,!1,!0),o(hR)&&t.lock.set(!0,!1,!0,!0),o(rR)&&t.lock.set(!1,!0,!0,!1),o(QI)&&t.lock.set(!1,!0,!1,!0),o(gR)&&t.lock.set(!0,!1,!1,!0),o(lR)&&t.lock.set(!0,!1,!0,!1),o(nR)&&t.lock.set(!0,!0,!0,!0),o(eR)&&t.lock.set(!0,!0,!0,!0),o(tR)&&t.lock.set(!0,!0,!0,!0),o(aR)&&t.lock.set(!0,!0,!0,!0),o(sR)&&t.lock.set(!0,!0,!0,!0),o(iR)&&t.lock.set(!0,!0,!0,!0)}applyLayout(){for(let o of this.cGraph.cNodes)o instanceof ia&&o.applyElementPosition();let t=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),e=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let o of this.cGraph.cNodes)t.x=Math.min(t.x,o.hitbox.x),t.y=Math.min(t.y,o.hitbox.y),e.x=Math.max(e.x,o.hitbox.x+o.hitbox.width),e.y=Math.max(e.y,o.hitbox.y+o.hitbox.height);for(let o of this._externalPlaceholder.values())for(let r of o){let i=r.second;t.x=Math.min(t.x,i.hitbox.x),t.y=Math.min(t.y,i.hitbox.y),e.x=Math.max(e.x,i.hitbox.x+i.hitbox.width),e.y=Math.max(e.y,i.hitbox.y+i.hitbox.height)}this._globalOffset=t.clone().negate(),this._graphSize=e.clone().sub(t),this.cGraph.cGroups.length=0,this.cGraph.cNodes.length=0}},ia=class extends ki{constructor(t,e,o){super(),this.rect=t,this.hitbox=new dt(t.x,t.y,t.width,t.height),this._individualSpacing=e,this._defaultSpacing=o}getHorizontalSpacing(){return this._individualSpacing!=null?this._individualSpacing:this._defaultSpacing}getVerticalSpacing(){return this._individualSpacing!=null?this._individualSpacing:this._defaultSpacing}applyElementPosition(){this.rect.x=this.hitbox.x,this.rect.y=this.hitbox.y}getElementPosition(){return this.rect.x}toString(){return""}};sa.SPACING_HANDLER={getHorizontalSpacing(n,t){let e=typeof n.getHorizontalSpacing=="function"?n.getHorizontalSpacing():0,o=typeof t.getHorizontalSpacing=="function"?t.getHorizontalSpacing():0;return Math.min(e,o)},getVerticalSpacing(n,t){let e=typeof n.getVerticalSpacing=="function"?n.getVerticalSpacing():0,o=typeof t.getVerticalSpacing=="function"?t.getVerticalSpacing():0;return Math.min(e,o)}};var ir=Object.freeze({HORZ:"HORZ",VERT:"VERT"}),j_=new Set([R.LEFT,R.RIGHT]),$_=new Set([R.UP,R.DOWN]),na=class n{constructor(){this._compactionGraph=null,this._transformer=null,this._verticalExternalExtensions=[],this._horizontalExternalExtensions=[],this._compactor=null,this._topLeft=new O,this._bottomRight=new O}static init(t,e){let o=new n;return o._transformer=new sa(e),o._compactionGraph=o._transformer.transform(t),o}compact(t){let e=[];this._verticalExternalExtensions=[],this._horizontalExternalExtensions=[];for(let[a,l]of this._transformer.getExternalExtensions()){e.push(l.second);let c=a.getDirection();c===R.LEFT||c===R.RIGHT?this._horizontalExternalExtensions.push(l):this._verticalExternalExtensions.push(l)}this._addExternalEdgeRepresentations(this._horizontalExternalExtensions),this._addExternalEdgeRepresentations(this._verticalExternalExtensions),this._compactor=new Br(this._compactionGraph),this._compactor.setSpacingsHandler(sa.SPACING_HANDLER),this._removeExternalEdgeRepresentations(this._horizontalExternalExtensions),this._removeExternalEdgeRepresentations(this._verticalExternalExtensions);for(let a of this._compactor.cGraph.cNodes)e.push(a);this._topLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this._bottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let a of e)this._topLeft.x=Math.min(this._topLeft.x,a.hitbox.x),this._topLeft.y=Math.min(this._topLeft.y,a.hitbox.y),this._bottomRight.x=Math.max(this._bottomRight.x,a.hitbox.x+a.hitbox.width),this._bottomRight.y=Math.max(this._bottomRight.y,a.hitbox.y+a.hitbox.height);let o={isLocked:(a,l)=>{let c=a.cGroup||a;return c.outDegree!=null&&c.outDegree!==0}};this._compactor.setLockFunction(o);let r=0,i;do i=this._compactIteration(r),r++;while((r<2||i>n.EPSILON)&&r<n.MAX_ITERATION);let s={isLocked:(a,l)=>{let c=a.cGroup!=null?a:null;if(c!=null){let g=c.lock&&c.lock.getDirection(l);if(g||c.cGroup.outDegree!==0&&g)return!0}return!1}};this._compactor.setLockFunction(s),this._compactIteration(0),this._compactor.finish(),this._transformer.applyLayout()}_compactIteration(t){let e=0;for(let r of this._compactionGraph.cGroups)r.delta=0,r.deltaNormalized=0;this._addPlaceholders(ir.HORZ),this._addExternalEdgeRepresentations(this._verticalExternalExtensions),this._compactor.calculateGroupOffsets(),this._compactor.forceConstraintsRecalculation();let o=R.LEFT;this._compactor.changeDirection(o).compact().changeDirection(R.RIGHT).compact().changeDirection(o).compact(),this._compactor.changeDirection(R.LEFT),this._removeExternalEdgeRepresentations(this._verticalExternalExtensions),this._removePlaceholders(ir.HORZ),this._updateExternalExtensionDimensions(ir.HORZ),this._updatePlaceholders(ir.VERT),this._addPlaceholders(ir.VERT),this._addExternalEdgeRepresentations(this._horizontalExternalExtensions),this._compactor.calculateGroupOffsets();for(let r of this._compactionGraph.cGroups)e+=Math.abs(r.deltaNormalized);for(let r of this._compactionGraph.cGroups)r.delta=0,r.deltaNormalized=0;o=R.UP,this._compactor.changeDirection(o).forceConstraintsRecalculation().compact().changeDirection(R.DOWN).compact().changeDirection(o).compact(),this._compactor.changeDirection(R.LEFT),this._removeExternalEdgeRepresentations(this._horizontalExternalExtensions),this._removePlaceholders(ir.VERT),this._updateExternalExtensionDimensions(ir.VERT),this._updatePlaceholders(ir.HORZ),this._compactor.forceConstraintsRecalculation();for(let r of this._compactionGraph.cGroups)e+=Math.abs(r.deltaNormalized);return e}getGraphSize(){return this._transformer.getGraphSize()}getOffset(t){return this._transformer.getOffset(t).negate().add(this._transformer.getGlobalOffset())}_addExternalEdgeRepresentations(t){for(let e of t)this._compactionGraph.cNodes.push(e.second),e.first.addCNode(e.second)}_removeExternalEdgeRepresentations(t){for(let e of t){let o=this._compactionGraph.cNodes.indexOf(e.second);o>=0&&this._compactionGraph.cNodes.splice(o,1),typeof e.first.removeCNode=="function"&&e.first.removeCNode(e.second)}}_addPlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[])this._compactionGraph.cNodes.push(r.second),r.second.cGroup!=null&&this._compactionGraph.cGroups.push(r.second.cGroup)}_removePlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[]){let i=this._compactionGraph.cNodes.indexOf(r.second);i>=0&&this._compactionGraph.cNodes.splice(i,1);let s=this._compactionGraph.cGroups.indexOf(r.second.cGroup);s>=0&&this._compactionGraph.cGroups.splice(s,1)}}_updatePlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[]){let i=r.second,a=r.first.deltaNormalized;switch(o){case R.LEFT:case R.RIGHT:i.hitbox.y+=a;break;case R.UP:case R.DOWN:i.hitbox.x+=a;break}}}_updateExternalExtensionDimensions(t){for(let[e,o]of this._transformer.getExternalExtensions()){if(t===ir.VERT){if(e.getDirection()!==R.UP&&e.getDirection()!==R.DOWN)continue}else if(e.getDirection()!==R.LEFT&&e.getDirection()!==R.RIGHT)continue;let r=o.second,s=o.first.deltaNormalized;switch(e.getDirection()){case R.LEFT:r.hitbox.x=this._topLeft.x,r.hitbox.width=Math.max(1,r.hitbox.width+s);break;case R.RIGHT:r.hitbox.x=r.hitbox.x+s,r.hitbox.width=Math.max(1,r.hitbox.width-s);break;case R.UP:r.hitbox.y=this._topLeft.y,r.hitbox.height=Math.max(1,r.hitbox.height+s);break;case R.DOWN:r.hitbox.y=r.hitbox.y+s,r.hitbox.height=Math.max(1,r.hitbox.height-s);break}}}};na.MAX_ITERATION=10;na.EPSILON=1e-4;var Ye=class n{constructor(t,e,o){this.x=t,this.y=e,this.quadrant=o,this.convex=!0}static from(t){return new n(t.x,t.y)}toString(){return`(${this.x}, ${this.y}${this.convex?"cx":""}${this.quadrant})`}equals(t){return t==null||!(t instanceof n)?!1:this.x===t.x&&this.y===t.y}},Bt=class n{constructor(t){this.name=t,Object.freeze(this)}isUpper(){return this===n.Q1||this===n.Q2}isLeft(){return this===n.Q1||this===n.Q4}static isBothLeftOrBothRight(t,e){return t===n.Q1&&e===n.Q4||t===n.Q4&&e===n.Q1||t===n.Q3&&e===n.Q2||t===n.Q2&&e===n.Q3}static isOneLeftOneRight(t,e){return t===n.Q1&&e===n.Q2||t===n.Q1&&e===n.Q3||t===n.Q4&&e===n.Q3||t===n.Q4&&e===n.Q2}toString(){return this.name}};Bt.Q1=new Bt("Q1");Bt.Q4=new Bt("Q4");Bt.Q2=new Bt("Q2");Bt.Q3=new Bt("Q3");var rO=new Map([[Bt.Q1,0],[Bt.Q4,1],[Bt.Q2,2],[Bt.Q3,3]]),dR=(n,t)=>n.x===t.x?t.y-n.y:n.x-t.x,fR=(n,t)=>n.x===t.x?n.y-t.y:n.x-t.x,uR=(n,t)=>n.x===t.x?t.y-n.y:t.x-n.x,_R=(n,t)=>n.x===t.x?n.y-t.y:t.x-n.x,pR=(n,t)=>{if(n.x===t.x){if(n.quadrant===t.quadrant||Bt.isBothLeftOrBothRight(n.quadrant,t.quadrant)){let e=n.quadrant.isLeft()?1:-1;if(n.convex&&!t.convex)return e;if(!n.convex&&t.convex)return-e}return rO.get(n.quadrant)-rO.get(t.quadrant)}return n.x-t.x},aa=class{constructor(t){switch(this.quadrant=t,this.points=[],t){case Bt.Q1:case Bt.Q2:this._compare=(e,o)=>o-e,this._maximalY=Number.POSITIVE_INFINITY;break;case Bt.Q3:case Bt.Q4:this._compare=(e,o)=>e-o,this._maximalY=Number.NEGATIVE_INFINITY;break}}handle(t){this._compare(t.y,this._maximalY)>0&&(this.points.push(new Ye(t.x,t.y,this.quadrant)),this._maximalY=t.y)}},dl=class n{constructor(){this.hull=[],this.xMax1=null,this.xMax2=null,this.xMin1=null,this.xMin2=null,this.yMax1=null,this.yMax2=null,this.yMin1=null,this.yMin2=null}static of(t){let e=new n;for(let a of t)(e.xMax1==null||a.x>=e.xMax1.x)&&(e.xMax2=e.xMax1,e.xMax1=a),(e.xMin1==null||a.x<=e.xMin1.x)&&(e.xMin2=e.xMin1,e.xMin1=a),(e.yMax1==null||a.y>=e.yMax1.y)&&(e.yMax2=e.yMax1,e.yMax1=a),(e.yMin1==null||a.y<=e.yMin1.y)&&(e.yMin2=e.yMin1,e.yMin1=a);let o=new aa(Bt.Q1);Zo.execute(t,fR,o);let r=new aa(Bt.Q4);Zo.execute(t,dR,r);let i=new aa(Bt.Q2);Zo.execute(t,_R,i);let s=new aa(Bt.Q3);Zo.execute(t,uR,s),n._addConcaveCorners(o.points,Bt.Q1),n._addConcaveCorners(i.points,Bt.Q2),n._addConcaveCorners(s.points,Bt.Q3),n._addConcaveCorners(r.points,Bt.Q4),e.hull=[];for(let a of o.points)e.hull.push(a);for(let a=i.points.length-1;a>=0;a--)e.hull.push(i.points[a]);for(let a of s.points)e.hull.push(a);for(let a=r.points.length-1;a>=0;a--)e.hull.push(r.points[a]);return e}getHull(){return this.hull}splitIntoRectangles(){let t=new q_(this);return Zo.execute(this.hull,pR,t),t.queued!=null&&t.rects.push(t.queued),t.rects}static _addConcaveCorners(t,e){let o=[];if(t.length!==0){o.push(t[0]);for(let r=1;r<t.length;r++){let i=t[r-1],s=t[r],a=new Ye(s.x,i.y,e);a.convex=!1,o.push(a),o.push(s)}t.length=0;for(let r of o)t.push(r)}}},q_=class{constructor(t){this._hull=t,this.rects=[],this._minY=null,this._maxY=null,this._lastX=Math.min(t.xMin1.x,t.xMin2.x),this.queued=null,this._queuedPnt=null}handle(t){if(this.queued!=null&&(t.x!==this._queuedPnt.x||Bt.isOneLeftOneRight(this._queuedPnt.quadrant,t.quadrant))&&(this.rects.push(this.queued),this._lastX=this.queued.x+this.queued.width,this.queued=null,this._queuedPnt=null),t.quadrant.isUpper()?this._minY=t:this._maxY=t,(t.quadrant===Bt.Q1&&!t.convex||t.quadrant===Bt.Q2&&t.convex||t.quadrant===Bt.Q3&&t.convex||t.quadrant===Bt.Q4&&!t.convex)&&this._minY!=null&&this._maxY!=null){let e=new dt(this._lastX,this._minY.y,t.x-this._lastX,this._maxY.y-this._minY.y);this.queued=e,this._queuedPnt=t}}};var Er=class n{constructor(){this._compactor=null,this._yetAnotherOffset=null,this._compactedGraphSize=null,this._graphTopLeft=null,this._graphBottomRight=null}compact(t,e,o){this._graphTopLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this._graphBottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let i of t)for(let s of i.getLayerlessNodes()){let a=s.getPosition(),l=s.getSize(),c=s.getMargin();this._graphTopLeft.x=Math.min(this._graphTopLeft.x,a.x-c.left),this._graphTopLeft.y=Math.min(this._graphTopLeft.y,a.y-c.top),this._graphBottomRight.x=Math.max(this._graphBottomRight.x,a.x+l.x+c.right),this._graphBottomRight.y=Math.max(this._graphBottomRight.y,a.y+l.y+c.bottom)}let r=new J_;for(let i of t){let s=this._transformLGraph(i);r.getComponents().push(s),s.containsRegularNodes|=s.getExternalExtensionSides().size!==0}this._compactor=na.init(r,o),this._compactor.compact(new Ie),this._yetAnotherOffset=new O,this._compactedGraphSize=this._compactor.getGraphSize();for(let i of r.getComponents()){let s=this._compactor.getOffset(i);z.offsetGraph(i.graph,s.x,s.y);for(let a of i.getNodes())if(a.getType()===y.EXTERNAL_PORT){let l=this._getExternalPortPosition(a.getPosition(),a.getProperty(p.EXT_PORT_SIDE));a.getPosition().reset().add(l)}}for(let i of r.getComponents())for(let s of i.getExternalEdges()){let a=new st;for(let c of s.getBendPoints())a.add(c);a.add(0,s.getSource().getAbsoluteAnchor()),a.add(s.getTarget().getAbsoluteAnchor());let l=null;for(let c of a){if(l==null){l=c;continue}Math.abs(l.x-c.x)<n.EPSILON?(this._yetAnotherOffset.x=Math.min(this._yetAnotherOffset.x,l.x),this._compactedGraphSize.x=Math.max(this._compactedGraphSize.x,l.x)):Math.abs(l.y-c.y)<n.EPSILON&&(this._yetAnotherOffset.y=Math.min(this._yetAnotherOffset.y,l.y),this._compactedGraphSize.y=Math.max(this._compactedGraphSize.y,l.y)),l=c}}this._yetAnotherOffset.negate(),this._compactedGraphSize.add(this._yetAnotherOffset)}getOffset(){return this._yetAnotherOffset}getGraphSize(){return this._compactedGraphSize}_transformLGraph(t){let e=new Q_(t);e.containsRegularNodes||this._createDummyNode(t);let o=new op;n._componentHullPoints(t,o);let r=new Map;for(let a of[R.LEFT,R.RIGHT,R.UP,R.DOWN,R.UNDEFINED])r.set(a,[]);let i=new ip;for(let a of t.getLayerlessNodes())for(let l of a.getOutgoingEdges())if(n._isExternalEdge(l)){let c=this._transformLEdge(l,o,i),g=c.getDirection(),h=r.get(g)||[];h.push(c.getRepresentative()),r.set(g,h)}let s=[];for(let a of e.getExternalExtensionSides()){let l=a.ordinal(),c=i.min[l],g=i.max[l],h=i.extent[l],d=null,f=null;switch(a){case u.WEST:d=new dt(this._graphTopLeft.x,c,o.topLeft.x-this._graphTopLeft.x,g-c),f=new dt(this._graphTopLeft.x,c,h,g-c),o.add(d.getTopRight()),o.add(d.getBottomRight());break;case u.EAST:d=new dt(o.bottomRight.x,c,this._graphBottomRight.x-o.bottomRight.x,g-c),f=new dt(this._graphBottomRight.x-h,c,h,g-c),o.add(d.getTopLeft()),o.add(d.getBottomLeft());break;case u.NORTH:d=new dt(c,this._graphTopLeft.y,g-c,o.topLeft.y-this._graphTopLeft.y),f=new dt(c,this._graphTopLeft.y,g-c,h),o.add(d.getBottomLeft()),o.add(d.getBottomRight());break;case u.SOUTH:d=new dt(c,o.bottomRight.y,g-c,this._graphBottomRight.y-o.bottomRight.y),f=new dt(c,this._graphBottomRight.y-h,g-c,h),o.add(d.getTopLeft()),o.add(d.getTopRight());break}if(d!=null){let E=new tp;E.side=a,E.extension=d,E.placeholder=f,E.edges=new Set(r.get(n._portSideToDirection(a))||[]),s.push(E)}}for(let a of s)e.externalExtensions.push(a);return e.rectilinearConvexHull=dl.of(o).splitIntoRectangles(),e}_createDummyNode(t){if(t.getLayerlessNodes().length!==1)throw new Error("_createDummyNode precondition failed");let e=t.getLayerlessNodes()[0],o=new ft(t);switch(t.getLayerlessNodes().push(o),o.getSize().x=Math.max(1,e.getSize().x),o.getSize().y=Math.max(1,e.getSize().y),o.getPosition().x=e.getPosition().x,o.getPosition().y=e.getPosition().y,e.getProperty(p.EXT_PORT_SIDE)){case u.WEST:o.getPosition().x+=2;break;case u.NORTH:o.getPosition().y+=2;break;case u.EAST:o.getPosition().x-=2;break;case u.SOUTH:o.getPosition().y-=2;break}let r=new rt;r.setNode(o);let i=new _e,s=e.getPorts()[0];return i.setSource(s),i.setTarget(r),r.getPosition().reset().add(s.getPosition()),r.getAnchor().reset().add(s.getAnchor()),o}static _componentHullPoints(t,e){for(let o of t.getLayerlessNodes())if(o.getType()!==y.EXTERNAL_PORT){n._addLGraphElementBounds(e,o,new O);for(let r of o.getOutgoingEdges())if(!n._isExternalEdge(r))for(let i of r.getBendPoints())e.add(Ye.from(i))}}static _addLGraphElementBounds(t,e,o){let r=null;e instanceof ft||e instanceof rt?r=e.getMargin():r=new Gr;let i=e.getPosition().x,s=e.getPosition().y,a=e.getSize().x,l=e.getSize().y;t.add(new Ye(i-r.left+o.x,s-r.top+o.y)),t.add(new Ye(i-r.left+o.x,s+l+r.bottom+o.y)),t.add(new Ye(i+a+r.right+o.x,s-r.top+o.y)),t.add(new Ye(i+a+r.right+o.x,s+l+r.bottom+o.y))}static _isExternalEdge(t){return t.getSource().getNode().getType()===y.EXTERNAL_PORT||t.getTarget().getNode().getType()===y.EXTERNAL_PORT}_transformLEdge(t,e,o){let r=new ep(t),i=n._edgeToSegments(t,r),s=Math.max(t.getProperty(_.EDGE_THICKNESS)||1,1);for(let d of i.innerSegments){let f=n._segmentToRectangle(d.first,d.second,s);e.addRect(f)}let a=r.externalPortSide,l=n._segmentToRectangle(i.outerSegment.first,i.outerSegment.second,s),c=a.ordinal();a===u.WEST||a===u.EAST?(o.min[c]=Math.min(o.min[c],l.y),o.max[c]=Math.max(o.max[c],l.y+l.height)):(o.min[c]=Math.min(o.min[c],l.x),o.max[c]=Math.max(o.max[c],l.x+l.width));let g=Number.NEGATIVE_INFINITY,h=r.externalPort.getNode().getMargin();switch(a){case u.WEST:g=h.right;break;case u.EAST:g=h.left;break;case u.NORTH:g=h.bottom;break;case u.SOUTH:g=h.top;break}return o.extent[c]=Math.max(o.extent[c],g),r}static _segmentToRectangle(t,e,o){return new dt(Math.min(t.x,e.x)-o/2,Math.min(t.y,e.y)-o/2,Math.abs(t.x-e.x)+o,Math.abs(t.y-e.y)+o)}static _edgeToSegments(t,e){let o=e.externalPort,r=e.externalPortSide,i=t.getSource().getAbsoluteAnchor(),s=t.getTarget().getAbsoluteAnchor();o===t.getSource()?(i=n._getExternalPortPositionStatic(i,r,null),s=n._getPortPositionOnMargin(t.getTarget())):(i=n._getPortPositionOnMargin(t.getSource()),s=n._getExternalPortPositionStatic(s,r,null));let a=new st;for(let g of t.getBendPoints())a.add(g);a.addFirst(i),a.addLast(s);let l=t.getSource()===o,c=new rp;for(let g=0;g<a.size()-1;g++){let h={first:a.get(g),second:a.get(g+1)};l&&g===0||!l&&g===a.size()-2?c.outerSegment=h:c.innerSegments.push(h)}return c}_getExternalPortPosition(t,e){return n._getExternalPortPositionStatic(t,e,this)}static _getExternalPortPositionStatic(t,e,o){if(o==null||o._graphTopLeft==null||o._graphBottomRight==null)return t.clone();switch(e){case u.NORTH:return new O(t.x,Math.min(o._graphTopLeft.y,t.y));case u.EAST:return new O(Math.max(o._graphBottomRight.x,t.x),t.y);case u.SOUTH:return new O(t.x,Math.max(o._graphBottomRight.y,t.y));case u.WEST:return new O(Math.min(t.x,o._graphTopLeft.x),t.y)}return t.clone()}static _getPortPositionOnMargin(t){let e=t.getAbsoluteAnchor().clone(),o=t.getNode().getMargin();switch(t.getSide()){case u.NORTH:e.y-=o.top;break;case u.EAST:e.x+=o.right;break;case u.SOUTH:e.y+=o.bottom;break;case u.WEST:e.x-=o.left;break}return e}static _portSideToDirection(t){switch(t){case u.NORTH:return R.UP;case u.WEST:return R.LEFT;case u.EAST:return R.RIGHT;case u.SOUTH:return R.DOWN}return R.UNDEFINED}};Er.EPSILON=1e-4;var J_=class{constructor(){this._components=[],this.containsExternalPorts=!1}getComponents(){return this._components}isContainsExternalExtensions(){return this.containsExternalPorts}*[Symbol.iterator](){yield*nr(this._components)}},Q_=class{constructor(t){this.graph=t,this.containsRegularNodes=!1;for(let e of t.getLayerlessNodes())this.containsRegularNodes|=e.getType()===y.NORMAL;this.rectilinearConvexHull=[],this.externalExtensions=[]}getExternalExtensionSides(){return this.graph.getProperty(p.EXT_PORT_CONNECTIONS)||new Set}getHull(){return this.rectilinearConvexHull}getExternalExtensions(){return this.externalExtensions}getNodes(){return this.graph.getLayerlessNodes()}getExternalEdges(){let t=[];for(let e of this.externalExtensions)for(let o of e.getRepresentative())t.push(o);return t}},tp=class{constructor(){this.edges=new Set,this.side=null,this.extension=null,this.placeholder=null}getRepresentative(){return this.edges}getRepresentor(){return this.extension}getParent(){throw new Error("InternalUnionExternalExtension.getParent is unsupported")}getDirection(){return Er._portSideToDirection(this.side)}getPlaceholder(){return this.placeholder}},ep=class{constructor(t){if(this.edge=t,this.externalPort=null,this.externalPortSide=null,this.externalExtensionRect=null,this.parent=null,t.getSource().getNode().getType()===y.EXTERNAL_PORT)this.externalPort=t.getSource(),this.externalPortSide=t.getSource().getNode().getProperty(p.EXT_PORT_SIDE);else if(t.getTarget().getNode().getType()===y.EXTERNAL_PORT)this.externalPort=t.getTarget(),this.externalPortSide=t.getTarget().getNode().getProperty(p.EXT_PORT_SIDE);else throw new Error(`Edge ${t} is not an external edge`)}getDirection(){return Er._portSideToDirection(this.externalPortSide)}getRepresentative(){return this.edge}getRepresentor(){return this.externalExtensionRect}getParent(){return this.parent}},op=class extends Array{constructor(){super(),this.topLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this.bottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)}add(t){let e=t instanceof Ye?t:Ye.from(t);return this.topLeft.x=Math.min(this.topLeft.x,e.x),this.topLeft.y=Math.min(this.topLeft.y,e.y),this.bottomRight.x=Math.max(this.bottomRight.x,e.x),this.bottomRight.y=Math.max(this.bottomRight.y,e.y),super.push(e),!0}addRect(t){this.add(new Ye(t.x,t.y)),this.add(new Ye(t.x+t.width,t.y)),this.add(new Ye(t.x,t.y+t.height)),this.add(new Ye(t.x+t.width,t.y+t.height))}},rp=class{constructor(){this.innerSegments=[],this.outerSegment=null}},ip=class{constructor(){this.min=new Array(5).fill(Number.POSITIVE_INFINITY),this.max=new Array(5).fill(Number.NEGATIVE_INFINITY),this.extent=new Array(5).fill(Number.NEGATIVE_INFINITY)}};var la=class extends ra{combine(t,e){if(t.length===1){let a=t[0];a!==e&&(e.getLayerlessNodes().length=0,this.moveGraph(e,a,0,0),e.copyProperties(a),e.getPadding().copy(a.getPadding()),e.getSize().x=a.getSize().x,e.getSize().y=a.getSize().y);return}else if(t.length===0){e.getLayerlessNodes().length=0,e.getSize().x=0,e.getSize().y=0;return}this.sortComponents(t,e);let o=t[0];e.getLayerlessNodes().length=0,e.copyProperties(o);let r=0,i=0;for(let a of t){let l=a.getSize();r=Math.max(r,l.x),i+=l.x*l.y}r=Math.max(r,Math.sqrt(i)*e.getProperty(_.ASPECT_RATIO));let s=e.getProperty(_.SPACING_COMPONENT_COMPONENT);if(this.placeComponents(t,e,r,s),o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)){let a=new Er;a.compact(t,e.getSize(),s);for(let l of t)l.getOffset().reset().add(a.getOffset());e.getSize().reset().add(a.getGraphSize())}this.moveGraphs(e,t,0,0)}sortComponents(t,e){if(e.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)===Me.NONE){for(let o of t){let r=0;for(let i of o.getLayerlessNodes())r+=i.getProperty(_.PRIORITY)||0;o.id=r}t.sort((o,r)=>{let i=r.id-o.id;if(i===0){let s=o.getSize().x*o.getSize().y,a=r.getSize().x*r.getSize().y;return s-a}return i})}}placeComponents(t,e,o,r){let i=0,s=0,a=0,l=r;for(let c of t){let g=c.getSize();i+g.x>o&&(i=0,s+=a+r,a=0);let h=c.getOffset();this.offsetGraph(c,i+h.x,s+h.y),h.reset(),l=Math.max(l,i+g.x),a=Math.max(a,g.y),i+=g.x+r}e.getSize().x=l,e.getSize().y=s+a}};var{SIDES_EAST:Pf,SIDES_EAST_SOUTH:ca,SIDES_EAST_SOUTH_WEST:no,SIDES_EAST_WEST:Vi,SIDES_NONE:iO,SIDES_NORTH:Of,SIDES_NORTH_EAST:ga,SIDES_NORTH_EAST_SOUTH:ao,SIDES_NORTH_EAST_SOUTH_WEST:pe,SIDES_NORTH_EAST_WEST:lo,SIDES_NORTH_SOUTH:Xi,SIDES_NORTH_SOUTH_WEST:co,SIDES_NORTH_WEST:ha,SIDES_SOUTH:Sf,SIDES_SOUTH_WEST:da,SIDES_WEST:Tf}=u,zr=class n{constructor(t){this.components=new Map,t!==void 0&&this.add(t)}add(t){if(this._canAdd(t)){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=this.components.get(e);return o===void 0&&(o=[],this.components.set(e,o)),o.push(t),!0}return!1}_canAdd(t){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=n.CONSTRAINTS.get(e);if(!o)return!0;for(let r of o){let i=this.components.get(r);if(i&&i.length>0)return!1}return!0}*getPortSides(){for(let[t,e]of this.components)for(let o=0;o<e.length;o++)yield t}getComponents(t){if(t!==void 0)return this.components.get(t)||[];let e=[];for(let o of this.components.values())for(let r of o)e.push(r);return e}};zr.CONSTRAINTS=new Map;function et(n,t){let e=zr.CONSTRAINTS.get(n);e||(e=[],zr.CONSTRAINTS.set(n,e)),e.push(t)}et(iO,pe);et(Tf,pe);et(Tf,co);et(Pf,ao);et(Pf,pe);et(Of,pe);et(Of,lo);et(Sf,no);et(Sf,pe);et(Xi,Vi);et(Xi,pe);et(Xi,lo);et(Xi,no);et(Vi,Xi);et(Vi,co);et(Vi,ao);et(Vi,pe);et(ha,ha);et(ha,lo);et(ha,co);et(ga,ga);et(ga,lo);et(ga,ao);et(da,da);et(da,no);et(da,co);et(ca,ca);et(ca,no);et(ca,ao);et(lo,Of);et(lo,Xi);et(lo,ha);et(lo,ga);et(lo,pe);et(lo,lo);et(lo,co);et(lo,ao);et(no,Sf);et(no,Xi);et(no,da);et(no,ca);et(no,no);et(no,co);et(no,ao);et(no,pe);et(co,Tf);et(co,Vi);et(co,ha);et(co,da);et(co,lo);et(co,no);et(co,co);et(co,pe);et(ao,Pf);et(ao,Vi);et(ao,ga);et(ao,ca);et(ao,lo);et(ao,no);et(ao,ao);et(ao,pe);et(pe,iO);et(pe,Tf);et(pe,Pf);et(pe,Of);et(pe,Sf);et(pe,Xi);et(pe,Vi);et(pe,lo);et(pe,no);et(pe,co);et(pe,ao);et(pe,pe);var{SIDES_EAST:sO,SIDES_EAST_SOUTH:nO,SIDES_EAST_SOUTH_WEST:aO,SIDES_EAST_WEST:lO,SIDES_NONE:cO,SIDES_NORTH:gO,SIDES_NORTH_EAST:hO,SIDES_NORTH_EAST_SOUTH:dO,SIDES_NORTH_EAST_SOUTH_WEST:fO,SIDES_NORTH_EAST_WEST:ER,SIDES_NORTH_SOUTH:uO,SIDES_NORTH_SOUTH_WEST:mR,SIDES_NORTH_WEST:PR,SIDES_SOUTH:_O,SIDES_SOUTH_WEST:pO,SIDES_WEST:EO}=u,fa=class extends ra{constructor(){super(),this.componentGroups=[]}combine(t,e){if(this.componentGroups.length=0,e.getLayerlessNodes().length=0,t.length===0){e.getSize().x=0,e.getSize().y=0;return}let o=t[0];e.copyProperties(o);for(let s of t)this._addComponent(s);let r=new O,i=o.getProperty(_.SPACING_COMPONENT_COMPONENT);for(let s of this.componentGroups){let a=this._placeComponents(s,i);this.offsetGraphs(s.getComponents(),r.x,r.y),r.x+=a.x,r.y+=a.y}if(e.getSize().x=r.x-i,e.getSize().y=r.y-i,o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)&&o.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL){for(let a of t)this.offsetGraph(a,a.getOffset().x,a.getOffset().y);let s=new Er;s.compact(t,e.getSize(),i);for(let a of t)a.getOffset().reset().add(s.getOffset());e.getSize().reset().add(s.getGraphSize())}for(let s of this.componentGroups)this.moveGraphs(e,s.getComponents(),0,0)}_addComponent(t){for(let e of this.componentGroups)if(e.add(t))return;this.componentGroups.push(new zr(t))}_placeComponents(t,e){let o=this._placeComponentsInRows(t.getComponents(cO),e),r=this._placeComponentsHorizontally(t.getComponents(gO),e),i=this._placeComponentsHorizontally(t.getComponents(_O),e),s=this._placeComponentsVertically(t.getComponents(EO),e),a=this._placeComponentsVertically(t.getComponents(sO),e),l=this._placeComponentsHorizontally(t.getComponents(PR),e),c=this._placeComponentsHorizontally(t.getComponents(hO),e),g=this._placeComponentsHorizontally(t.getComponents(pO),e),h=this._placeComponentsHorizontally(t.getComponents(nO),e),d=this._placeComponentsVertically(t.getComponents(lO),e),f=this._placeComponentsHorizontally(t.getComponents(uO),e),E=this._placeComponentsHorizontally(t.getComponents(ER),e),P=this._placeComponentsHorizontally(t.getComponents(aO),e),S=this._placeComponentsVertically(t.getComponents(mR),e),T=this._placeComponentsVertically(t.getComponents(dO),e),N=this._placeComponentsHorizontally(t.getComponents(fO),e),I=Ft.maxd(l.x,s.x,g.x,S.x),C=Ft.maxd(r.x,o.x,i.x,N.x),x=f.x,M=Ft.maxd(c.x,a.x,h.x,T.x),A=Ft.maxd(l.y,r.y,c.y,E.y),B=Ft.maxd(s.y,o.y,a.y,N.y),Y=d.y,j=Ft.maxd(g.y,i.y,h.y,P.y);this.offsetGraphs(t.getComponents(cO),I+x,A+Y),this.offsetGraphs(t.getComponents(fO),I+x,A+Y),this.offsetGraphs(t.getComponents(gO),I+x,0),this.offsetGraphs(t.getComponents(_O),I+x,A+Y+B),this.offsetGraphs(t.getComponents(EO),0,A+Y),this.offsetGraphs(t.getComponents(sO),I+x+C,A+Y),this.offsetGraphs(t.getComponents(hO),I+x+C,0),this.offsetGraphs(t.getComponents(pO),0,A+Y+B),this.offsetGraphs(t.getComponents(nO),I+x+C,A+Y+B),this.offsetGraphs(t.getComponents(lO),0,A),this.offsetGraphs(t.getComponents(uO),I,0),this.offsetGraphs(t.getComponents(aO),0,A+Y+B),this.offsetGraphs(t.getComponents(dO),I+x+C,0);let X=new O;return X.x=Ft.maxd(I+C+x+M,d.x,E.x,P.x),X.y=Ft.maxd(A+B+Y+j,f.y,S.y,T.y),X}_placeComponentsHorizontally(t,e){let o=new O;for(let r of t)this.offsetGraph(r,o.x,0),o.x+=r.getSize().x+e,o.y=Math.max(o.y,r.getSize().y);return o.y>0&&(o.y+=e),o}_placeComponentsVertically(t,e){let o=new O;for(let r of t)this.offsetGraph(r,0,o.y),o.y+=r.getSize().y+e,o.x=Math.max(o.x,r.getSize().x);return o.x>0&&(o.x+=e),o}_placeComponentsInRows(t,e){if(t.length===0)return new O;let o=0,r=0;for(let c of t){let g=c.getSize();o=Math.max(o,g.x),r+=g.x*g.y}o=Math.max(o,Math.sqrt(r)*t[0].getProperty(_.ASPECT_RATIO));let i=0,s=0,a=0,l=e;for(let c of t){let g=c.getSize();i+g.x>o&&(i=0,s+=a+e,a=0),this.offsetGraph(c,i,s),l=Math.max(l,i+g.x),a=Math.max(a,g.y),i+=g.x+e}return new O(l+e,s+a+e)}};var{SIDES_EAST:po,SIDES_EAST_SOUTH:ko,SIDES_EAST_SOUTH_WEST:gi,SIDES_EAST_WEST:Eo,SIDES_NONE:Co,SIDES_NORTH:Wo,SIDES_NORTH_EAST:to,SIDES_NORTH_EAST_SOUTH:hi,SIDES_NORTH_EAST_SOUTH_WEST:Nf,SIDES_NORTH_EAST_WEST:Ki,SIDES_NORTH_SOUTH:di,SIDES_NORTH_SOUTH_WEST:Yr,SIDES_NORTH_WEST:sr,SIDES_SOUTH:go,SIDES_SOUTH_WEST:xo,SIDES_WEST:Do}=u,ws=class n extends zr{constructor(t){super(),this.componentOrder=[],t!==void 0&&this.add(t)}add(t){if(this._canAdd(t)){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=this.components.get(e);return o===void 0&&(o=[],this.components.set(e,o)),o.push(t),this.componentOrder.push(t),!0}return!1}_canAdd(t){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=zr.CONSTRAINTS.get(e),r=n.MODEL_ORDER_CONSTRAINTS.get(e);if(o)for(let i of o){let s=this.components.get(i);if(s&&s.length>0)return!1}if(r)for(let i of r){let s=this.components.get(i);if(s&&s.length>0)return!1}return!0}getComponentOrder(){return this.componentOrder}};ws.MODEL_ORDER_CONSTRAINTS=new Map;function F(n,t){let e=ws.MODEL_ORDER_CONSTRAINTS.get(n);e||(e=[],ws.MODEL_ORDER_CONSTRAINTS.set(n,e)),e.push(t)}F(Wo,Co);F(Do,Co);F(to,Co);F(sr,Co);F(Yr,Co);F(Ki,Co);F(sr,Wo);F(Co,po);F(Wo,po);F(Do,po);F(to,po);F(di,po);F(sr,po);F(Yr,po);F(Ki,po);F(Eo,po);F(Co,go);F(Wo,go);F(po,go);F(Do,go);F(to,go);F(di,go);F(sr,go);F(Eo,go);F(xo,go);F(Yr,go);F(hi,go);F(Ki,go);F(Wo,Do);F(to,Do);F(sr,Do);F(Ki,Do);F(Wo,to);F(Do,to);F(sr,to);F(to,to);F(Yr,to);F(Co,ko);F(Wo,ko);F(po,ko);F(go,ko);F(Do,ko);F(to,ko);F(di,ko);F(sr,ko);F(xo,ko);F(Eo,ko);F(Ki,ko);F(Yr,ko);F(Nf,ko);F(Co,xo);F(Wo,xo);F(po,xo);F(Do,xo);F(to,xo);F(di,xo);F(sr,xo);F(Eo,xo);F(Ki,xo);F(hi,xo);F(Nf,xo);F(Wo,Eo);F(Do,Eo);F(to,Eo);F(sr,Eo);F(xo,Eo);F(Ki,Eo);F(Yr,Eo);F(Co,gi);F(Wo,gi);F(po,gi);F(Do,gi);F(to,gi);F(di,gi);F(sr,gi);F(Eo,gi);F(Ki,gi);F(Wo,Yr);F(po,Yr);F(go,Yr);F(to,Yr);F(Co,hi);F(Wo,hi);F(go,hi);F(Do,hi);F(to,hi);F(di,hi);F(sr,hi);F(sr,Nf);F(to,Nf);F(Eo,Co);F(Eo,Do);F(Eo,po);F(di,Co);F(di,Wo);F(di,go);var yf=class extends fa{combine(t,e){if(this.componentGroups.length=0,e.getLayerlessNodes().length=0,t.length===0){e.getSize().x=0,e.getSize().y=0;return}let o=t[0];e.copyProperties(o);for(let d of t)this._addComponent(d);let r=new O,i=new O,s=new O,a=new O,l=o.getProperty(_.SPACING_COMPONENT_COMPONENT),c=e.getProperty(lr),g=c&&c.isHorizontal&&c.isHorizontal(),h=c&&c.isVertical&&c.isVertical();for(let d of this.componentGroups){if(g){s.x=r.x;for(let E of d.getPortSides())if(E.has(u.NORTH)){s.x=i.x;break}}else if(h){s.y=r.y;for(let E of d.getPortSides())if(E.has(u.WEST)){s.y=i.y;break}}let f=this._placeComponents(d,l);if(this.offsetGraphs(d.getComponents(),s.x,s.y),g){i.x=s.x+f.x,a.x=Math.max(a.x,i.x);for(let E of d.getPortSides())if(E.has(u.SOUTH)){r.x=s.x+f.x;break}i.y=s.y+f.y,s.y=i.y,a.y=Math.max(a.y,s.y)}else if(h){i.y=s.y+f.y,a.y=Math.max(a.y,i.y);for(let E of d.getPortSides())if(E.has(u.EAST)){r.y=s.y+f.y;break}i.x=s.x+f.x,s.x=i.x,a.x=Math.max(a.x,s.x)}}if(e.getSize().x=a.x-l,e.getSize().y=a.y-l,o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)&&o.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL){for(let f of t)this.offsetGraph(f,f.getOffset().x,f.getOffset().y);let d=new Er;d.compact(t,e.getSize(),l);for(let f of t)f.getOffset().reset().add(d.getOffset());e.getSize().reset().add(d.getGraphSize())}for(let d of this.componentGroups)this.moveGraphs(e,d.getComponents(),0,0)}_addComponent(t){this.componentGroups.length>0&&this.componentGroups[this.componentGroups.length-1].add(t)||this.componentGroups.push(new ws(t))}};var If=class extends la{sortComponents(t,e){}placeComponents(t,e,o,r){let i=0,s=0,a=0,l=r,c=null,g=0;for(let h of t){let d=h.getSize(),f=h.getProperty(p.EXT_PORT_CONNECTIONS),E=c?c.getProperty(p.EXT_PORT_CONNECTIONS):null;(i+d.x>o&&!(f&&f.has(u.NORTH))||E&&E.has(u.EAST)||f&&f.has(u.WEST))&&(i=g,s+=a+r,a=0);let P=h.getOffset();f&&f.has(u.NORTH)&&(i=l+r),this.offsetGraph(h,i+P.x,s+P.y),l=Math.max(l,i+d.x),f&&f.has(u.SOUTH)&&(g=Math.max(g,i+d.x+r)),P.reset(),a=Math.max(a,d.y),i+=d.x+r,c=h}e.getSize().x=l,e.getSize().y=s+a}};var Rf=class{constructor(){this._componentGroupGraphPlacer=new fa,this._componentGroupModelOrderGraphPlacer=new yf,this._modelOrderRowGraphPlacer=new If,this._simpleRowGraphPlacer=new la,this._graphPlacer=this._simpleRowGraphPlacer}split(t){let e;this._graphPlacer=this._simpleRowGraphPlacer;let o=t.getProperty(_.SEPARATE_CONNECTED_COMPONENTS),r=o==null||o===!0,i=t.getProperty(p.GRAPH_PROPERTIES),s=i&&i.has(v.EXTERNAL_PORTS),a=t.getProperty(_.PORT_CONSTRAINTS),l=!(a&&typeof a.isOrderFixed=="function"&&a.isOrderFixed());if(r&&(l||!s)){for(let c of t.getLayerlessNodes())c.id=0;e=[];for(let c of t.getLayerlessNodes()){let g=this._dfs(c,null);if(g!=null){let h=new Nn;h.copyProperties(t),h.setProperty(p.EXT_PORT_CONNECTIONS,u.sidesOf(g.extPortSides)),h.getPadding().copy(t.getPadding()),h.setProperty(_.NODE_SIZE_MINIMUM,null);for(let d of g.nodes)h.getLayerlessNodes().push(d),d.setGraph(h);e.push(h)}}if(s){let c=t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS);c===Me.GROUP_MODEL_ORDER?this._graphPlacer=this._componentGroupModelOrderGraphPlacer:c===Me.MODEL_ORDER?this._graphPlacer=this._modelOrderRowGraphPlacer:this._graphPlacer=this._componentGroupGraphPlacer}}else e=[t];return t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)!==Me.NONE&&e.sort((c,g)=>{let h=z.getMinimalModelOrder(c),d=z.getMinimalModelOrder(g);return h-d}),e}_dfs(t,e){if(t.id===0){t.id=1;let o=e;o==null&&(o={nodes:[],extPortSides:new Set}),o.nodes.push(t),t.getType()===y.EXTERNAL_PORT&&o.extPortSides.add(t.getProperty(p.EXT_PORT_SIDE));for(let r of t.getPorts())for(let i of r.getConnectedPorts())this._dfs(i.getNode(),o);return o}return null}combine(t,e){this._graphPlacer.combine(t,e)}};var ua=class extends Gi{constructor(t=""){super(),this._text=t}getText(){return this._text}toString(){let t=this.getDesignation();return t==null?"label":`l_${t}`}getDesignation(){return this._text&&this._text.length>0?this._text:super.getDesignation()}};var Ms=class{constructor(t,e,o){this._newEdge=t,this._graph=e,this._type=o}toString(){return`${this._type.toString()}:${this._newEdge.toString()}`}getEdge(){return this._newEdge}getGraph(){return this._graph}getType(){return this._type}getActualSource(){let t=this._newEdge.getSource();return t.getNode().getType()===y.EXTERNAL_PORT?t.getNode().getProperty(p.ORIGIN):t}getActualTarget(){let t=this._newEdge.getTarget();return t.getNode().getType()===y.EXTERNAL_PORT?t.getNode().getProperty(p.ORIGIN):t}};var _a=class n{constructor(t){this._graph=t,this.compare=this.compare.bind(this)}compare(t,e){if(t.getType()===W.OUTPUT&&e.getType()===W.INPUT)return-1;if(t.getType()===W.INPUT&&e.getType()===W.OUTPUT)return 1;let o=n._hierarchyLevel(t.getGraph(),this._graph),r=n._hierarchyLevel(e.getGraph(),this._graph);return t.getType()===W.OUTPUT?r-o:o-r}static _hierarchyLevel(t,e){let o=t,r=0;for(;;){if(o===e)return r;let i=o.getParentNode();if(i==null)throw new Error("CrossHierarchyEdgeComparator: nestedGraph is not a descendant of topLevelGraph");o=i.getGraph(),r++}}};var fl=class n{constructor(){this._crossHierarchyMap=null,this._dummyNodeMap=new Map}process(t,e){e.begin("Compound graph preprocessor",1),this._crossHierarchyMap=new Map,this._transformHierarchyEdges(t,null),this._moveLabelsAndRemoveOriginalEdges(t),this._setSidesOfPortsToSidesOfDummyNodes(),t.setProperty(p.CROSS_HIERARCHY_MAP,this._crossHierarchyMap),this._crossHierarchyMap=null,this._dummyNodeMap.clear(),e.done()}_putCrossHierarchyEdge(t,e){let o=this._crossHierarchyMap.get(t);o==null&&(o=[],this._crossHierarchyMap.set(t,o)),o.push(e)}_setSidesOfPortsToSidesOfDummyNodes(){for(let[t,e]of this._dummyNodeMap.entries())e.setProperty(p.ORIGIN,t),t.setProperty(p.PORT_DUMMY,e),t.setProperty(p.INSIDE_CONNECTIONS,!0),t.setSide(e.getProperty(p.EXT_PORT_SIDE)),t.getNode().setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),t.getNode().getGraph().getProperty(p.GRAPH_PROPERTIES).add(v.NON_FREE_PORTS)}_transformHierarchyEdges(t,e){let o=[];for(let i of t.getLayerlessNodes()){let s=i.getNestedGraph();if(s==null)continue;let a=this._transformHierarchyEdges(s,i);if(o.push(...a),this._processInsideSelfLoops(s,i),s.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)){let l=i.getProperty(_.PORT_CONSTRAINTS),c=i.getProperty(_.PORT_LABELS_PLACEMENT),g=c!=null&&c.has!=null&&c.has(it.INSIDE);for(let h of i.getPorts()){let d=this._dummyNodeMap.get(h);d==null&&(d=z.createExternalPortDummy(h,l,h.getSide(),-h.getNetFlow(),null,new O,h.getSize(),s.getProperty(_.DIRECTION),s),d.setProperty(p.ORIGIN,h),this._dummyNodeMap.set(h,d),s.getLayerlessNodes().push(d));let f=d.getPorts()[0];for(let E of h.getLabels()){let P=new ua;if(P.getSize().x=E.getSize().x,P.getSize().y=E.getSize().y,f.getLabels().push(P),!g){let S=h.getSide(),T=0;c!=null&&it.isFixed(c)&&(T=iu(E.getPosition(),E.getSize(),h.getSize(),0,S)),l===H.FREE||u.SIDES_EAST_WEST.has(S)?P.getSize().x=T:P.getSize().y=T}}}}}let r=[];return this._processInnerHierarchicalEdgeSegments(t,e,o,r),e!=null&&this._processOuterHierarchicalEdgeSegments(t,e,r),r}_moveLabelsAndRemoveOriginalEdges(t){for(let e of this._crossHierarchyMap.keys()){let o=e.getLabels();if(o!=null&&o.length>0){let r=Array.from(this._crossHierarchyMap.get(e));r.sort(new _a(t).compare);let i=[];for(let s of o){let a=-1,l=s.getProperty(_.EDGE_LABELS_PLACEMENT);if(l===St.HEAD?a=r.length-1:l===St.CENTER?a=this._getShallowestEdgeSegment(r):l===St.TAIL&&(a=0),a!==-1){let c=r[a];c.getEdge().getLabels().push(s);let g=c.getEdge().getSource().getNode().getGraph().getProperty(p.GRAPH_PROPERTIES);g.add(v.END_LABELS),g.add(v.CENTER_LABELS),s.setProperty(p.ORIGINAL_LABEL_EDGE,e)}else i.push(s)}o.length=0,o.push(...i)}e.setSource(null),e.setTarget(null)}}_getShallowestEdgeSegment(t){let e=-1,o=0;for(let r of t){if(r.getType()===W.INPUT){e=o===0?0:o-1;break}else o===t.length-1&&(e=o);o+=1}return e}_processInnerHierarchicalEdgeSegments(t,e,o,r){let i=[];for(let s of o){let a=null;if(s.type===W.OUTPUT)for(let l of s.origEdges){let c=l.getTarget().getNode();if(c.getGraph()===t)this._connectChild(t,s,l,s.dummyPort,l.getTarget());else if(e==null||z.isDescendant(c,e))this._connectSiblings(t,s,o,l);else{let g=this._introduceHierarchicalEdgeSegment(t,e,l,s.dummyPort,W.OUTPUT,a);g!==a&&i.push(g),g.exported&&(a=g)}}else for(let l of s.origEdges){let c=l.getSource().getNode();if(c.getGraph()===t)this._connectChild(t,s,l,l.getSource(),s.dummyPort);else{if(e==null||z.isDescendant(c,e))continue;{let g=this._introduceHierarchicalEdgeSegment(t,e,l,s.dummyPort,W.INPUT,a);g!==a&&i.push(g),g.exported&&(a=g)}}}}for(let s of i){let a=t.getLayerlessNodes();a.includes(s.dummyNode)||a.push(s.dummyNode),s.exported&&r.push(s)}}_connectChild(t,e,o,r,i){let s=this._createDummyEdge(t,o);s.setSource(r),s.setTarget(i),this._putCrossHierarchyEdge(o,new Ms(s,t,e.type))}_connectSiblings(t,e,o,r){let i=null;for(let a of o)if(a!==e&&a.origEdges.includes(r)){i=a;break}let s=this._createDummyEdge(t,r);s.setSource(e.dummyPort),s.setTarget(i.dummyPort),this._putCrossHierarchyEdge(r,new Ms(s,t,e.type))}_processOuterHierarchicalEdgeSegments(t,e,o){let r=[];for(let i of t.getLayerlessNodes())for(let s of i.getPorts()){let a=null;for(let c of z.toEdgeArray(s.getOutgoingEdges()))if(!z.isDescendant(c.getTarget().getNode(),e)){let g=this._introduceHierarchicalEdgeSegment(t,e,c,c.getSource(),W.OUTPUT,a);g!==a&&r.push(g),g.exported&&(a=g)}let l=null;for(let c of z.toEdgeArray(s.getIncomingEdges()))if(!z.isDescendant(c.getSource().getNode(),e)){let g=this._introduceHierarchicalEdgeSegment(t,e,c,c.getTarget(),W.INPUT,l);g!==l&&r.push(g),g.exported&&(l=g)}}for(let i of r){let s=t.getLayerlessNodes();s.includes(i.dummyNode)||s.push(i.dummyNode),i.exported&&o.push(i)}}_processInsideSelfLoops(t,e){if(e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))for(let o of e.getPorts()){let r=z.toEdgeArray(o.getOutgoingEdges());for(let i of r){if(!(i.getTarget().getNode()===e&&i.getProperty(_.INSIDE_SELF_LOOPS_YO)))continue;let l=i.getSource(),c=this._dummyNodeMap.get(l);c==null&&(c=z.createExternalPortDummy(l,H.FREE,l.getSide(),-1,null,null,l.getSize(),t.getProperty(_.DIRECTION),t),c.setProperty(p.ORIGIN,l),this._dummyNodeMap.set(l,c),t.getLayerlessNodes().push(c));let g=i.getTarget(),h=this._dummyNodeMap.get(g);h==null&&(h=z.createExternalPortDummy(g,H.FREE,g.getSide(),1,null,null,g.getSize(),t.getProperty(_.DIRECTION),t),h.setProperty(p.ORIGIN,g),this._dummyNodeMap.set(g,h),t.getLayerlessNodes().push(h));let d=this._createDummyEdge(t,i);d.setSource(c.getPorts()[0]),d.setTarget(h.getPorts()[0]),this._putCrossHierarchyEdge(i,new Ms(d,t,W.OUTPUT)),t.getProperty(p.GRAPH_PROPERTIES).add(v.EXTERNAL_PORTS)}}}_introduceHierarchicalEdgeSegment(t,e,o,r,i,s){let a=t.getProperty(_.MERGE_HIERARCHY_EDGES),l=null;i===W.INPUT&&o.getSource().getNode()===e?l=o.getSource():i===W.OUTPUT&&o.getTarget().getNode()===e&&(l=o.getTarget());let c=s;if(c==null||!a||l!=null){let g=u.UNDEFINED;l!=null?g=l.getSide():e.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(g=i===W.INPUT?u.WEST:u.EAST);let h=this._createExternalPortDummyNode(t,e,i,g,o),d=this._createDummyEdge(e.getGraph(),o);i===W.INPUT?(d.setSource(h.getPorts()[0]),d.setTarget(r)):(d.setSource(r),d.setTarget(h.getPorts()[0])),c=new sp(o,d,h,h.getProperty(p.ORIGIN),i,l==null)}else{c.origEdges.push(o);let g=Math.max(c.newEdge.getProperty(_.EDGE_THICKNESS),o.getProperty(_.EDGE_THICKNESS));c.newEdge.setProperty(_.EDGE_THICKNESS,g)}return this._putCrossHierarchyEdge(o,new Ms(c.newEdge,t,i)),c}_createDummyEdge(t,e){let o=new _e;return o.copyProperties(e),o.setProperty(_.JUNCTION_POINTS,null),o}_calculateNetFlow(t){let e=t.getNode(),o=e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=0,i=0;for(let s of t.getOutgoingEdges()){let a=s.isSelfLoop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=s.getTarget().getNode();a&&l?i++:a&&!l?r++:c.getGraph().getParentNode()===e?i++:r++}for(let s of t.getIncomingEdges()){let a=s.isSelfLoop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=s.getSource().getNode();a&&l?r++:a&&!l?i++:c.getGraph().getParentNode()===e?r++:i++}return r-i}_createExternalPortDummyNode(t,e,o,r,i){let s=null,a=o===W.INPUT?i.getSource():i.getTarget(),l=z.getDirection(t);if(a.getNode()===e)s=this._dummyNodeMap.get(a),s==null&&(s=z.createExternalPortDummy(a,e.getProperty(_.PORT_CONSTRAINTS),r,this._calculateNetFlow(a),null,a.getPosition(),a.getSize(),l,t),s.setProperty(p.ORIGIN,a),this._dummyNodeMap.set(a,s));else{s=z.createExternalPortDummy(n._createExternalPortProperties(t),e.getProperty(_.PORT_CONSTRAINTS),r,o===W.INPUT?-1:1,null,new O,new O(0,0),l,t);let c=n._createPortForDummy(s,e,o);s.setProperty(p.ORIGIN,c),this._dummyNodeMap.set(c,s)}return t.getProperty(p.GRAPH_PROPERTIES).add(v.EXTERNAL_PORTS),t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()?t.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE):t.setProperty(_.PORT_CONSTRAINTS,H.FREE),s}static _createExternalPortProperties(t){let e=new ge,o=t.getProperty(_.SPACING_EDGE_EDGE)/2;return e.setProperty(_.PORT_BORDER_OFFSET,o),e}static _createPortForDummy(t,e,o){let r=e.getGraph(),i=z.getDirection(r),s=new rt;return s.setNode(e),o===W.INPUT?s.setSide(u.fromDirection(i).opposed()):o===W.OUTPUT&&s.setSide(u.fromDirection(i)),s.setProperty(_.PORT_BORDER_OFFSET,t.getProperty(_.PORT_BORDER_OFFSET)),s}};fl.isHierarchyAware=!0;var sp=class{constructor(t,e,o,r,i,s){this.origEdges=[t],this.newEdge=e,this.dummyNode=o,this.dummyPort=r,this.type=i!=null?i:W.UNDEFINED,this.exported=s}};var Lf=class n{process(t,e){e.begin("Compound graph postprocessor",1);let o=t.getProperty(_.UNNECESSARY_BENDPOINTS),r=t.getProperty(p.CROSS_HIERARCHY_MAP);if(r==null){e.done();return}let i=new Set;for(let s of r.keys()){let a=(r.get(s)||[]).slice();a.sort(new _a(t).compare);let l=a[0].getActualSource(),c=a[a.length-1].getActualTarget(),g=l.getNode(),h;z.isDescendant(c.getNode(),g)?h=g.getNestedGraph():h=g.getGraph();let d=n._clearJunctionPoints(s,a);s.getBendPoints().clear();let f=null;for(let E of a){let P=new O;z.changeCoordSystem(P,E.getGraph(),h);let S=E.getEdge(),T=new st;T.addAllAsCopies(0,S.getBendPoints()),T.offset(P);let N=S.getSource().getAbsoluteAnchor().clone(),I=S.getTarget().getAbsoluteAnchor().clone();if(N.add(P),I.add(P),f!=null){let C;T.isEmpty()?C=I:C=T.getFirst();let x=Math.abs(f.x-C.x)>ie.TOLERANCE,M=Math.abs(f.y-C.y)>ie.TOLERANCE;(!o&&x&&M||o&&(x||M))&&s.getBendPoints().add(N)}for(let C of T)s.getBendPoints().add(C);T.isEmpty()?f=N:f=T.getLast(),n._copyJunctionPoints(S,d,P),E.getActualTarget()===c&&(c.getNode().getGraph()!==E.getGraph()&&(P=new O,z.changeCoordSystem(P,c.getNode().getGraph(),h)),s.setProperty(p.TARGET_OFFSET,P)),n._copyLabelsBack(S,s,h),i.add(S)}s.setSource(l),s.setTarget(c)}for(let s of i)s.setSource(null),s.setTarget(null);e.done()}static _clearJunctionPoints(t,e){let o=t.getProperty(_.JUNCTION_POINTS),r=!1;for(let i of e){let s=i.getEdge().getProperty(_.JUNCTION_POINTS);if(s!=null&&!s.isEmpty()){r=!0;break}}return r?o==null?(o=new st,t.setProperty(_.JUNCTION_POINTS,o)):o.clear():o!=null&&(t.setProperty(_.JUNCTION_POINTS,null),o=null),o}static _copyJunctionPoints(t,e,o){if(e==null)return;let r=t.getProperty(_.JUNCTION_POINTS);if(r!=null){let i=new st;i.addAllAsCopies(0,r),i.offset(o);for(let s of i)e.add(s)}}static _copyLabelsBack(t,e,o){let r=t.getLabels();for(let i=r.length-1;i>=0;i--){let s=r[i];s.getProperty(p.ORIGINAL_LABEL_EDGE)===e&&(z.changeCoordSystem(s.getPosition(),t.getSource().getNode().getGraph(),o),r.splice(i,1),e.getLabels().push(s))}}};var OR=1,np=.4,Af=class{constructor(){this._createdJunctionPoints=new Set}getLayoutProcessorConfiguration(t){let e=K.create();e.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR);let o=t.getProperty(p.GRAPH_PROPERTIES);return o&&(o.has(v.NORTH_SOUTH_PORTS)&&(e.addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR),e.addAfter(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)),o.has(v.SELF_LOOPS)&&(e.addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR),e.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER),e.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER),e.addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR)),o.has(v.CENTER_LABELS)&&(e.addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER),e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER),e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),e.addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER)),o.has(v.END_LABELS)&&(e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),e.addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR),e.addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR))),e}process(t,e){e&&e.begin&&e.begin("Polyline edge routing",1);let o=t.getProperty(_.EDGE_ROUTING_POLYLINE_SLOPED_EDGE_ZONE_WIDTH),r=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),s=Math.min(1,i/r),a=t.getLayers(),l=0;if(a.length>0){let c=this._calculateWestInLayerEdgeYDiff(a[0]);l=np*s*c}for(let c=0;c<a.length;c++){let g=a[c],h=g.getNodes(),d=h.every(Ls);d&&l>0&&(l-=r),z.placeNodesHorizontally(g,l);let f=0;for(let P of h){let S=0;for(let N of P.getOutgoingEdges()){let I=N.getSource().getAbsoluteAnchor().y,C=N.getTarget().getAbsoluteAnchor().y;g===N.getTarget().getNode().getLayer()&&!N.isSelfLoop()&&(this._processInLayerEdge(N,l,np*s*Math.abs(I-C)),N.getSource().getSide()===u.WEST&&(I=0,C=0)),S=Math.max(S,Math.abs(C-I))}let T=P.getType();(T===y.NORMAL||T===y.LABEL||T===y.LONG_EDGE||T===y.NORTH_SOUTH_PORT||T===y.BREAKING_POINT)&&this._processNode(P,l,o),f=Math.max(f,S)}if(c+1<a.length){let P=this._calculateWestInLayerEdgeYDiff(a[c+1]);f=Math.max(f,P)}let E=np*s*f;!d&&c+1<a.length&&(E+=r),l+=g.getSize().x+E}this._createdJunctionPoints.clear(),t.getSize().x=l,e&&e.done&&e.done()}_processNode(t,e,o){let r=e+t.getLayer().getSize().x;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor();if(t.getType()===y.NORTH_SOUTH_PORT){let g=i.getProperty(p.ORIGIN);g&&(s.x=g.getAbsoluteAnchor().x,t.getPosition().x=s.x)}let a=new O(0,s.y);if(i.getSide()===u.EAST)a.x=r;else if(i.getSide()===u.WEST)a.x=e;else continue;if(Math.abs(s.x-a.x)<=o&&!this._isInLayerDummy(t))continue;let c=i.getOutgoingEdges().length+i.getIncomingEdges().length>1;for(let g of i.getConnectedEdges()){let h=g.getSource()===i?g.getTarget():g.getSource();Math.abs(h.getAbsoluteAnchor().y-a.y)>OR&&this._addBendPoint(g,a,c,i)}}}_processInLayerEdge(t,e,o){let r=t.getSource(),i=t.getTarget(),s=(r.getAbsoluteAnchor().y+i.getAbsoluteAnchor().y)/2,a;r.getSide()===u.EAST?a=new O(e+r.getNode().getLayer().getSize().x+o,s):a=new O(e-o,s),t.getBendPoints().splice(0,0,a)}_calculateWestInLayerEdgeYDiff(t){let e=0;for(let o of t.getNodes())for(let r of o.getOutgoingEdges())if(t===r.getTarget().getNode().getLayer()&&r.getSource().getSide()===u.WEST){let i=r.getSource().getAbsoluteAnchor().y,s=r.getTarget().getAbsoluteAnchor().y;e=Math.max(e,Math.abs(s-i))}return e}_addBendPoint(t,e,o,r){if(t.isSelfLoop()||!t.isInLayerEdge()&&r.getAbsoluteAnchor().equals(e))return;let i=new O(e.x,e.y);if(t.getSource()===r?t.getBendPoints().splice(0,0,i):t.getBendPoints().push(i),o){let s=e.x+","+e.y;if(!this._createdJunctionPoints.has(s)){let a=t.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,t.setProperty(_.JUNCTION_POINTS,a));let l=new O(e.x,e.y);a.push(l),this._createdJunctionPoints.add(s)}}}_isInLayerDummy(t){if(t.getType()!==y.LONG_EDGE)return!1;for(let e of t.getConnectedEdges())if(e.isInLayerEdge())return!0;return!1}};var bs=class bs{constructor(){this._edgeRoutingStrategy=null}static factoryFor(t){let e=String(t);if(!bs._factoryCache.has(e)){let o=new bs;o._edgeRoutingStrategy=t,bs._factoryCache.set(e,o)}return bs._factoryCache.get(e)}create(){switch(this._edgeRoutingStrategy){case At.POLYLINE:return new Af;case At.SPLINES:return new vi;default:return new Vg}}};Z(bs,"_factoryCache",new Map);var Cf=bs;var mO=2,SR=()=>K.create().addBefore(D.P4_NODE_PLACEMENT,w.INNERMOST_NODE_MARGIN_CALCULATOR).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_AND_NODE_SIZE_PROCESSOR).addBefore(D.P5_EDGE_ROUTING,w.LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR).addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_SORTER),TR=()=>K.create().addBefore(D.P4_NODE_PLACEMENT,w.CENTER_LABEL_MANAGEMENT_PROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR),NR=()=>K.create().addAfter(D.P5_EDGE_ROUTING,w.HIERARCHICAL_NODE_RESIZER),xf=class n{constructor(){this._algorithmAssembler=Io.create(D.values())}prepareGraphForLayout(t){this._configureGraphProperties(t),this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(D.P1_CYCLE_BREAKING,t.getProperty(_.CYCLE_BREAKING_STRATEGY)),this._algorithmAssembler.setPhase(D.P2_LAYERING,t.getProperty(_.LAYERING_STRATEGY)),this._algorithmAssembler.setPhase(D.P3_NODE_ORDERING,t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY)),this._algorithmAssembler.setPhase(D.P4_NODE_PLACEMENT,t.getProperty(_.NODE_PLACEMENT_STRATEGY)),this._algorithmAssembler.setPhase(D.P5_EDGE_ROUTING,Cf.factoryFor(t.getProperty(_.EDGE_ROUTING))),this._algorithmAssembler.addProcessorConfiguration(this._getPhaseIndependentLayoutProcessorConfiguration(t)),t.setProperty(p.PROCESSORS,this._algorithmAssembler.build(t))}_configureGraphProperties(t){let e=t.getProperty(_.SPACING_EDGE_EDGE);e!=null&&e<mO&&t.setProperty(_.SPACING_EDGE_EDGE,mO),t.getProperty(_.DIRECTION)===R.UNDEFINED&&t.setProperty(_.DIRECTION,z.getDirection(t));let r=t.getProperty(_.RANDOM_SEED);t.setProperty(p.RANDOM,new dr(r)),t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES)==null&&t.setProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES,t.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL),this._copyPortConstraints(t),t.setProperty(p.SPACINGS,new oo(t))}_copyPortConstraints(t){for(let e of t.getLayerlessNodes())this._copyPortConstraintsForNode(e);for(let e of t.getLayers())for(let o of e.getNodes())this._copyPortConstraintsForNode(o)}_copyPortConstraintsForNode(t){let e=t.getProperty(_.PORT_CONSTRAINTS);t.setProperty(p.ORIGINAL_PORT_CONSTRAINTS,e);let o=t.getNestedGraph&&t.getNestedGraph();o!=null&&this._copyPortConstraints(o)}_getPhaseIndependentLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES),o=SR();switch(t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN&&o.addAll(NR()),t.getProperty(_.FEEDBACK_EDGES)?o.addBefore(D.P1_CYCLE_BREAKING,w.PORT_SIDE_PROCESSOR):o.addBefore(D.P3_NODE_ORDERING,w.PORT_SIDE_PROCESSOR),t.getProperty(Hn)!=null&&o.addAll(TR()),(t.getProperty(_.INTERACTIVE_LAYOUT)||t.getProperty(_.GENERATE_POSITION_AND_LAYER_IDS))&&o.addAfter(D.P5_EDGE_ROUTING,w.CONSTRAINTS_POSTPROCESSOR),t.getProperty(_.DIRECTION)){case R.LEFT:case R.DOWN:case R.UP:o.addBefore(D.P1_CYCLE_BREAKING,w.DIRECTION_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.DIRECTION_POSTPROCESSOR);break;default:break}e!=null&&e.has(v.COMMENTS)&&o.addBefore(D.P1_CYCLE_BREAKING,w.COMMENT_PREPROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.COMMENT_NODE_MARGIN_CALCULATOR).addAfter(D.P5_EDGE_ROUTING,w.COMMENT_POSTPROCESSOR),t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY)!==ut.NONE&&t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY)!=null&&o.addBefore(D.P3_NODE_ORDERING,w.NODE_PROMOTION),e!=null&&e.has(v.PARTITIONS)&&(o.addBefore(D.P1_CYCLE_BREAKING,w.PARTITION_PREPROCESSOR),o.addBefore(D.P2_LAYERING,w.PARTITION_MIDPROCESSOR),o.addBefore(D.P3_NODE_ORDERING,w.PARTITION_POSTPROCESSOR));let i=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY);if(i!=null&&i!==re.NONE&&t.getProperty(_.EDGE_ROUTING)!==At.POLYLINE&&o.addAfter(D.P5_EDGE_ROUTING,w.HORIZONTAL_COMPACTOR),t.getProperty(_.HIGH_DEGREE_NODES_TREATMENT)&&o.addBefore(D.P3_NODE_ORDERING,w.HIGH_DEGREE_NODE_LAYER_PROCESSOR),t.getProperty(_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE)&&o.addBefore(D.P3_NODE_ORDERING,w.SEMI_INTERACTIVE_CROSSMIN_PROCESSOR),n.activateGreedySwitchFor(t)){let c=n._isHierarchicalLayout(t)?t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE):t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE),g=String(c)==="ONE_SIDED"?w.ONE_SIDED_GREEDY_SWITCH:w.TWO_SIDED_GREEDY_SWITCH;o.addBefore(D.P4_NODE_PLACEMENT,g)}t.getProperty(_.LAYER_UNZIPPING_STRATEGY)===Wr.ALTERNATING&&o.addBefore(D.P4_NODE_PLACEMENT,w.ALTERNATING_LAYER_UNZIPPER);let a=t.getProperty(_.WRAPPING_STRATEGY);return a===Fo.SINGLE_EDGE?o.addBefore(D.P4_NODE_PLACEMENT,w.SINGLE_EDGE_GRAPH_WRAPPER):a===Fo.MULTI_EDGE&&o.addBefore(D.P3_NODE_ORDERING,w.BREAKING_POINT_INSERTER).addBefore(D.P4_NODE_PLACEMENT,w.BREAKING_POINT_PROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.BREAKING_POINT_REMOVER),t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==ce.NONE&&t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!=null&&o.addBefore(D.P3_NODE_ORDERING,w.SORT_BY_INPUT_ORDER_OF_MODEL),o}static activateGreedySwitchFor(t){if(n._isHierarchicalLayout(t)){let s=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE);return t.getParentNode()==null&&s!=null&&String(s)!=="OFF"}let e=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE),o=t.getProperty(_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE)||t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY)===We.INTERACTIVE,r=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_ACTIVATION_THRESHOLD)||0,i=t.getLayerlessNodes().length;return!o&&e!=null&&String(e)!=="OFF"&&(r===0||r>i)}static _isHierarchicalLayout(t){return t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN}};var ap=Object.freeze({isInstance(n){return n!=null&&(n.constructor&&n.constructor.isHierarchyAware===!0||n.isHierarchyAware===!0)}});var Df=class{constructor(){this._graphConfigurator=new xf,this._componentsProcessor=new Rf}doLayout(t,e){let o=e!=null?e:new Ie;o.begin("Layered layout",1),this._graphConfigurator.prepareGraphForLayout(t);let r=this._componentsProcessor.split(t);for(let i of r)this._layout(i,o);this._componentsProcessor.combine(r,t),this._resizeGraph(t),o.done()}doCompoundLayout(t,e){let o=e!=null?e:new Ie;o.begin("Layered compound layout",2),new fl().process(t,o.subTask?o.subTask(1):new Ie),this._hierarchicalLayout(t,o.subTask?o.subTask(1):new Ie),new Lf().process(t,o.subTask?o.subTask(1):new Ie),o.done()}_hierarchicalLayout(t,e){let o=this._collectAllGraphsBottomUp(t);this._reviewAndCorrectHierarchicalProcessors(t,o);let r=[],i=0;for(let a of o){this._graphConfigurator.prepareGraphForLayout(a);let l=a.getProperty(p.PROCESSORS);i+=l.length,r.push({graph:a,processors:l,index:0})}e.begin("Recursive hierarchical layout",i);let s=r.find(a=>a.graph===t);for(;s.index<s.processors.length;)for(let a of r)for(;a.index<a.processors.length;){let l=a.processors[a.index];if(!ap.isInstance(l))l.process(a.graph,e.subTask?e.subTask(1):new Ie),a.index++;else if(a.graph===t){l.process(a.graph,e.subTask?e.subTask(1):new Ie),a.index++;for(let g of r)g!==a&&g.index<g.processors.length&&ap.isInstance(g.processors[g.index])&&g.index++;break}else break}for(let a of r){let l=a.graph;for(let c of l){for(let g of c.getNodes())l.getLayerlessNodes().push(g);c.getNodes().length=0}for(let c of l.getLayerlessNodes())c.setLayer(null);l.getLayers().length=0,this._resizeGraph(l)}e.done()}_reviewAndCorrectHierarchicalProcessors(t,e){let o=t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY);for(let i of e){let s=i.getProperty(_.CROSSING_MINIMIZATION_STRATEGY);if(s!==o)throw new Bo("The hierarchy aware processor "+s+" in child node "+i+" is only allowed if the root node specifies the same hierarchical processor.")}let r=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE);for(let i of e)i.setProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE,r)}_collectAllGraphsBottomUp(t){let e=[t],o=[t];for(;o.length>0;){let r=o.shift();for(let i of r.getLayerlessNodes()){let s=i.getNestedGraph();s!=null&&(e.unshift(s),o.push(s))}}return e}_layout(t,e){let o=e.isRunning&&e.isRunning();o||e.begin("Component Layout",1);let r=t.getProperty(p.PROCESSORS);if(r==null)throw new Error("ElkLayered.doLayout: algorithm processor list is missing. Did GraphConfigurator.prepareGraphForLayout succeed?");let i=1/Math.max(1,r.length);for(let s of r){if(e.isCanceled&&e.isCanceled())return;s.process(t,e.subTask?e.subTask(i):new Ie)}for(let s of t){for(let a of s.getNodes())t.getLayerlessNodes().push(a);s.getNodes().length=0}for(let s of t.getLayerlessNodes())s.setLayer(null);t.getLayers().length=0,o||e.done()}_resizeGraph(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS),o=t.getProperty(_.NODE_SIZE_OPTIONS),r=t.getActualSize(),i=new O(r.x,r.y);if(e!=null&&e.has&&e.has(mt.MINIMUM_SIZE)){let s=new O(0,0),a=t.getProperty(_.NODE_SIZE_MINIMUM);a!=null&&(s.x=a.x||0,s.y=a.y||0),o!=null&&o.has&&o.has(Nt.DEFAULT_MINIMUM_SIZE)&&(s.x<=0&&(s.x=es),s.y<=0&&(s.y=os)),i.x=Math.max(r.x,s.x),i.y=Math.max(r.y,s.y)}t.getProperty(_.NODE_SIZE_FIXED_GRAPH_SIZE)||this._resizeGraphNoReallyIMeanIt(t,r,i)}_resizeGraphNoReallyIMeanIt(t,e,o){let r=t.getProperty(_.CONTENT_ALIGNMENT);o.x>e.x&&r!=null&&(r.has(he.H_CENTER)?t.getOffset().x+=(o.x-e.x)/2:r.has(he.H_RIGHT)&&(t.getOffset().x+=o.x-e.x)),o.y>e.y&&r!=null&&(r.has(he.V_CENTER)?t.getOffset().y+=(o.y-e.y)/2:r.has(he.V_BOTTOM)&&(t.getOffset().y+=o.y-e.y));let i=t.getProperty(p.GRAPH_PROPERTIES);if(i!=null&&i.has(v.EXTERNAL_PORTS)&&(o.x>e.x||o.y>e.y))for(let a of t.getLayerlessNodes()){if(a.getType()!==y.EXTERNAL_PORT)continue;let l=a.getProperty(p.EXT_PORT_SIDE);l===u.EAST?a.getPosition().x+=o.x-e.x:l===u.SOUTH&&(a.getPosition().y+=o.y-e.y)}let s=t.getPadding();t.getSize().x=o.x-s.left-s.right,t.getSize().y=o.y-s.top-s.bottom}};var wf=class{constructor(){this._nodeAndPortMap=new Map}importGraph(t){let e=this._createLGraph(t);for(let r of t.getPorts())this._ensureDefinedPortSide(e,r);let o=e.getProperty(p.GRAPH_PROPERTIES);if(this._checkExternalPorts(t,o),o.has(v.EXTERNAL_PORTS))for(let r of t.getPorts())this._transformExternalPort(t,e,r);return this._shouldCalculateMinimumGraphSize(t)&&this._calculateMinimumGraphSize(t,e),e.getProperty(_.PARTITIONING_ACTIVATE)&&o.add(v.PARTITIONS),t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN?this._importHierarchicalGraph(t,e):this._importFlatGraph(t,e),e}_ensureDefinedPortSide(t,e){let o=t.getProperty(_.DIRECTION),r=e.getProperty(_.PORT_SIDE);t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()?(r==null||r===u.UNDEFINED)&&(r=u.fromDirection(o)):this._calculateNetFlow(e)>0?r=u.fromDirection(o):r=u.fromDirection(o).opposed(),e.setProperty(_.PORT_SIDE,r)}_shouldCalculateMinimumGraphSize(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS);return e!=null&&typeof e.size=="number"&&e.size>0}_calculateMinimumGraphSize(t,e){if(t.getParent()==null)return;let o=e.getProperty(_.NODE_SIZE_CONSTRAINTS);if(o==null||o.size===0)return;t.getProperty(_.PORT_CONSTRAINTS)===H.UNDEFINED&&t.setProperty(_.PORT_CONSTRAINTS,H.FREE);let r=yo.adapt(t.getParent()),i=yo.adaptSingleNode(t),s=us.process(r,i,!1,!0);o.add(mt.MINIMUM_SIZE);let a=e.getProperty(_.NODE_SIZE_MINIMUM)||new O;a.x=Math.max(s.x,a.x),a.y=Math.max(s.y,a.y),e.setProperty(_.NODE_SIZE_MINIMUM,a)}_importFlatGraph(t,e){let o=0,r=new Set;for(let i of t.getChildren())i.getProperty(_.NO_LAYOUT)||(this._needsModelOrder(i)&&(i.setProperty(p.MODEL_ORDER,o),o++,i.hasProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)&&r.add(i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID))),this._transformNode(i,e));e.setProperty(p.MAX_MODEL_ORDER_NODES,o),e.setProperty(p.CB_NUM_MODEL_ORDER_GROUPS,r.size),o=0;for(let i of t.getContainedEdges()){this._needsModelOrderBasedOnParent(t)&&(i.setProperty(p.MODEL_ORDER,o),o++);let s=ks(i),a=Na(i);if(s==null||a==null)continue;let l=s.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),c=!i.getProperty(_.NO_LAYOUT),g=l&&i.isSelfloop()&&i.getProperty(_.INSIDE_SELF_LOOPS_YO),h=s.getParent()===t&&s.getParent()===a.getParent(),d=s.getParent()===t&&a===t,f=a.getParent()===t&&s===t;c&&!g&&(d!==f||h)&&this._transformEdge(i,t,e)}if(t.getParent()!=null)for(let i of t.getParent().getContainedEdges()){let s=ks(i);s===t&&i.isSelfloop()&&s.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE)&&i.getProperty(_.INSIDE_SELF_LOOPS_YO)&&this._transformEdge(i,t,e)}}_importHierarchicalGraph(t,e){let o=[],r=e.getProperty(_.DIRECTION),i=0,s=new Set;for(o.push(...t.getChildren());o.length>0;){let a=o.shift();if(this._needsModelOrder(a)&&(a.setProperty(p.MODEL_ORDER,i++),a.hasProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)&&s.add(a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID))),a.getProperty(_.NO_LAYOUT))continue;let l=a.getChildren().length>0,c=this._hasInsideSelfLoops(a),g=a.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN,h=a.hasProperty(mi)?a.getProperty(mi):null,d=h==null||_.ALGORITHM_ID.endsWith(h),f=null;if(d&&g&&(l||c)&&(f=this._createLGraph(a),f.setProperty(_.DIRECTION,r),this._shouldCalculateMinimumGraphSize(a))){for(let T of a.getPorts())this._ensureDefinedPortSide(f,T);this._calculateMinimumGraphSize(a,f)}let E=e,P=this._nodeAndPortMap.get(a.getParent());P instanceof ft&&P.getNestedGraph()!=null&&(E=P.getNestedGraph());let S=this._transformNode(a,E);f!=null&&(S.setNestedGraph(f),f.setParentNode(S),o.push(...a.getChildren()))}for(e.setProperty(p.MAX_MODEL_ORDER_NODES,i),e.setProperty(p.CB_NUM_MODEL_ORDER_GROUPS,s.size),i=0,o.push(t);o.length>0;){let a=o.shift();for(let c of a.getContainedEdges()){this._checkEdgeValidity(c),this._needsModelOrderBasedOnParent(t)&&c.setProperty(p.MODEL_ORDER,i++);let g=Pt(c.getSources()[0]),h=Pt(c.getTargets()[0]);if(g==null||h==null||c.getProperty(_.NO_LAYOUT)||g.getProperty(_.NO_LAYOUT)||h.getProperty(_.NO_LAYOUT))continue;let d=c.isSelfloop()&&g.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE)&&c.getProperty(_.INSIDE_SELF_LOOPS_YO),f=a;d||mo(h,g)?f=g:mo(g,h)&&(f=h);let E=e,P=this._nodeAndPortMap.get(f);P instanceof ft&&P.getNestedGraph()!=null&&(E=P.getNestedGraph());let S=this._transformEdge(c,f,E);S!=null&&S.setProperty(p.COORDINATE_SYSTEM_ORIGIN,this._findCoordinateSystemOrigin(c,t,e))}if(a.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN)for(let c of a.getChildren()){let g=c.hasProperty(mi)?c.getProperty(mi):null,h=g==null||_.ALGORITHM_ID.endsWith(g),d=c.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN;h&&d&&o.push(c)}}}_needsModelOrder(t){let e=t.getParent();return this._needsModelOrderBasedOnParent(e)&&!t.getProperty(_.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER)}_needsModelOrderBasedOnParent(t){let e=t.getProperty(_.CYCLE_BREAKING_STRATEGY),o=e===Xt.MODEL_ORDER||e===Xt.BFS_NODE_ORDER||e===Xt.DFS_NODE_ORDER||e===Xt.GREEDY_MODEL_ORDER||e===Xt.SCC_CONNECTIVITY||e===Xt.SCC_NODE_TYPE,r=t.getProperty(_.LAYERING_STRATEGY),i=t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY),s=r===ae.BF_MODEL_ORDER||r===ae.DF_MODEL_ORDER||i===ut.MODEL_ORDER_LEFT_TO_RIGHT||i===ut.MODEL_ORDER_RIGHT_TO_LEFT,a=t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==ce.NONE||t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)||t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)!=="NONE"||t.getProperty(_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_NODE_INFLUENCE)!==0||t.getProperty(_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_PORT_INFLUENCE)!==0;return o||s||a}_hasInsideSelfLoops(t){if(!t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))return!1;for(let e of t.getPorts())for(let o of e.getOutgoingEdges())if(o.isSelfloop()&&o.getProperty(_.INSIDE_SELF_LOOPS_YO))return!0;return!1}_findCoordinateSystemOrigin(t,e,o){let r=Pt(t.getSources()[0]),i=Pt(t.getTargets()[0]);if(r==null||i==null||r.getParent()===i.getParent()||mo(i,r))return null;let s=t.getContainingNode();if(s===e)return o;let a=this._nodeAndPortMap.get(s);if(a instanceof ft){let l=a.getNestedGraph();if(l!=null)return l}return null}_createLGraph(t){let e=new Nn;e.copyProperties(t),e.getProperty(_.DIRECTION)===R.UNDEFINED&&e.setProperty(_.DIRECTION,z.getDirection(e)),e.setProperty(p.ORIGIN,t),e.setProperty(p.GRAPH_PROPERTIES,new Set);let o=t.getParent()==null?null:yo.adapt(t.getParent()),r=yo.adaptSingleNode(t),i=us.computeInsideNodeLabelPadding(o,r,R.RIGHT),s=e.getProperty(_.PADDING),a=e.getPadding();return s!=null&&(a.top+=s.top||0,a.bottom+=s.bottom||0,a.left+=s.left||0,a.right+=s.right||0),i!=null&&(a.top+=i.top||0,a.bottom+=i.bottom||0,a.left+=i.left||0,a.right+=i.right||0),e}_checkExternalPorts(t,e){let o=t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=t.getProperty(_.PORT_LABELS_PLACEMENT),i=!1,s=!1;for(let a of t.getPorts()){if(i&&s)break;let l=0;for(let c of Ta(a)){let g=o&&c.isSelfloop()&&c.getProperty(_.INSIDE_SELF_LOOPS_YO),d=c.getSources().includes(a)?Pt(c.getTargets()[0]):Pt(c.getSources()[0]),f=d!=null&&d.getParent()===t;if((g||f)&&(l++,l>1))break}(l>0||r!=null&&r.has&&r.has(it.INSIDE)&&a.getLabels().length>0)&&(i=!0),l>1&&(s=!0)}i&&e.add(v.EXTERNAL_PORTS),s&&e.add(v.HYPEREDGES)}_transformExternalPort(t,e,o){let r=new O(o.getX()+o.getWidth()/2,o.getY()+o.getHeight()/2),i=this._calculateNetFlow(o),s=t.getProperty(_.PORT_CONSTRAINTS),a=o.getProperty(_.PORT_SIDE);if(!o.getAllProperties().has(_.PORT_BORDER_OFFSET)){let f;o.getX()===0&&o.getY()===0?f=0:f=eu!=null?eu(o,a):0,o.setProperty(_.PORT_BORDER_OFFSET,f)}let l=new O(t.getWidth(),t.getHeight()),c=z.createExternalPortDummy(o,s,a,i,l,r,new O(o.getWidth(),o.getHeight()),e.getProperty(_.DIRECTION),e);c.setProperty(p.ORIGIN,o);let g=c.getPorts()[0];g.setConnectedToExternalNodes(this._isConnectedToExternalNodes(o)),c.setProperty(_.PORT_LABELS_PLACEMENT,it.outside());let h=t.getProperty(_.PORT_LABELS_PLACEMENT)!=null&&t.getProperty(_.PORT_LABELS_PLACEMENT).has&&t.getProperty(_.PORT_LABELS_PLACEMENT).has(it.INSIDE);for(let f of o.getLabels())if(!f.getProperty(_.NO_LAYOUT)&&f.getText()!=null&&f.getText().length>0){let E=this._transformLabel(f);if(g.getLabels().push(E),!h)switch(a){case u.EAST:case u.WEST:E.getSize().x=0;break;case u.NORTH:case u.SOUTH:E.getSize().y=0;break;default:break}}let d=t.getParent();d!=null&&(c.setProperty(_.SPACING_LABEL_PORT_HORIZONTAL,d.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL)),c.setProperty(_.SPACING_LABEL_PORT_VERTICAL,d.getProperty(_.SPACING_LABEL_PORT_VERTICAL)),c.setProperty(_.SPACING_LABEL_LABEL,d.getProperty(_.SPACING_LABEL_LABEL))),e.getLayerlessNodes().push(c),this._nodeAndPortMap.set(o,c)}_calculateNetFlow(t){let e=t.getParent(),o=e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=0,i=0;for(let s of t.getOutgoingEdges()){let a=s.isSelfloop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=Pt(s.getTargets()[0]);a&&l?i++:a&&!l?r++:c!=null&&(c.getParent()===e||c===e)?i++:r++}for(let s of t.getIncomingEdges()){let a=s.isSelfloop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=Pt(s.getSources()[0]);a&&l?r++:a&&!l?i++:c!=null&&(c.getParent()===e||c===e)?r++:i++}return r-i}_isConnectedToExternalNodes(t){let e=t.getParent();for(let o of t.getOutgoingEdges()){let r=Pt(o.getTargets()[0]);if(r!=null&&!mo(r,e))return!0}for(let o of t.getIncomingEdges()){let r=Pt(o.getSources()[0]);if(r!=null&&!mo(r,e))return!0}return!1}_transformNode(t,e){let o=new ft(e);o.copyProperties(t),o.setProperty(p.ORIGIN,t),o.getSize().x=t.getWidth(),o.getSize().y=t.getHeight(),o.getPosition().x=t.getX(),o.getPosition().y=t.getY(),e.getLayerlessNodes().push(o),this._nodeAndPortMap.set(t,o),(t.getChildren().length>0||t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))&&o.setProperty(p.COMPOUND_NODE,!0);let r=e.getProperty(p.GRAPH_PROPERTIES),i=o.getProperty(_.PORT_CONSTRAINTS);i===H.UNDEFINED?(o.setProperty(_.PORT_CONSTRAINTS,H.FREE),i=H.FREE):i!==H.FREE&&r.add(v.NON_FREE_PORTS);let s=0,a=e.getProperty(_.DIRECTION);for(let l of t.getPorts())this._needsModelOrder(t)&&l.setProperty(p.MODEL_ORDER,s++),l.getProperty(_.NO_LAYOUT)||this._transformPort(l,o,r,a,i);for(let l of t.getLabels())!l.getProperty(_.NO_LAYOUT)&&l.getText()!=null&&l.getText().length>0&&o.getLabels().push(this._transformLabel(l));return o.getProperty(_.COMMENT_BOX)&&r.add(v.COMMENTS),o.getProperty(_.HYPERNODE)&&(r.add(v.HYPERNODES),r.add(v.HYPEREDGES),o.setProperty(_.PORT_CONSTRAINTS,H.FREE)),o}_transformPort(t,e,o,r,i){let s=new rt;s.copyProperties(t),s.setSide(t.getProperty(_.PORT_SIDE)||u.UNDEFINED),s.setProperty(p.ORIGIN,t),s.setNode(e),s.getSize().x=t.getWidth(),s.getSize().y=t.getHeight(),s.getPosition().x=t.getX(),s.getPosition().y=t.getY(),this._nodeAndPortMap.set(t,s);let a=!1;for(let l of t.getOutgoingEdges()){for(let c of l.getTargets()){let g=Pt(c);if(g!=null&&mo(g,t.getParent())){a=!0;break}}if(a)break}if(!a)for(let l of t.getIncomingEdges()){for(let c of l.getSources()){let g=Pt(c);if(g!=null&&mo(g,t.getParent())){a=!0;break}}if(a)break}if(!a){for(let l of t.getOutgoingEdges())if(l.isSelfloop()&&l.getProperty(_.INSIDE_SELF_LOOPS_YO)){a=!0;break}}s.setProperty(p.INSIDE_CONNECTIONS,a),z.initializePort(s,i,r,t.getProperty(_.PORT_ANCHOR));for(let l of t.getLabels())!l.getProperty(_.NO_LAYOUT)&&l.getText()!=null&&l.getText().length>0&&s.getLabels().push(this._transformLabel(l));return r===R.LEFT||r===R.RIGHT?(s.getSide()===u.NORTH||s.getSide()===u.SOUTH)&&o.add(v.NORTH_SOUTH_PORTS):(r===R.UP||r===R.DOWN)&&(s.getSide()===u.EAST||s.getSide()===u.WEST)&&o.add(v.NORTH_SOUTH_PORTS),s}_transformEdge(t,e,o){this._checkEdgeValidity(t);let r=t.getSources()[0],i=t.getTargets()[0],s=Pt(r),a=Pt(i),l=t.getSections().length>0?t.getSections()[0]:null,c=this._nodeAndPortMap.get(s),g=this._nodeAndPortMap.get(a),h=null,d=null;if(r instanceof Ve){let N=this._nodeAndPortMap.get(r);N instanceof rt?h=N:N instanceof ft&&(c=N,h=c.getPorts()[0])}if(i instanceof Ve){let N=this._nodeAndPortMap.get(i);N instanceof rt?d=N:N instanceof ft&&(g=N,d=g.getPorts()[0])}if(!(c instanceof ft)||!(g instanceof ft))throw new Bo("The source or target of an edge could not be found. This usually happens when an edge connects nodes laid out by different algorithms. Try setting hierarchyHandling to INCLUDE_CHILDREN.");let f=new _e;f.copyProperties(t),f.setProperty(p.ORIGIN,t),f.setProperty(_.JUNCTION_POINTS,null);let E=o.getProperty(p.GRAPH_PROPERTIES);if(c===g&&E.add(v.SELF_LOOPS),h==null){let N=W.OUTPUT,I=null;l!=null&&c.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(I=new O(l.getStartX(),l.getStartY()),su(I,t.getContainingNode()),nu(I,e),mo(a,s)&&(N=W.INPUT,I.x+=c.getPosition().x,I.y+=c.getPosition().y)),h=z.createPort(c,I,N,o)}if(d==null){let N=W.INPUT,I=null;l!=null&&g.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(I=new O(l.getEndX(),l.getEndY()),su(I,t.getContainingNode()),nu(I,e)),d=z.createPort(g,I,N,g.getGraph())}f.setSource(h),f.setTarget(d),(h.getIncomingEdges().length>1||h.getOutgoingEdges().length>1||d.getIncomingEdges().length>1||d.getOutgoingEdges().length>1)&&E.add(v.HYPEREDGES);for(let N of t.getLabels())if(!N.getProperty(_.NO_LAYOUT)&&N.getText()!=null&&N.getText().length>0){let I=this._transformLabel(N);f.getLabels().push(I);let C=I.getProperty(_.EDGE_LABELS_PLACEMENT);C===St.HEAD||C===St.TAIL?E.add(v.END_LABELS):C===St.CENTER&&(E.add(v.CENTER_LABELS),I.setProperty(_.EDGE_LABELS_PLACEMENT,St.CENTER))}let P=o.getProperty(_.CROSSING_MINIMIZATION_STRATEGY),S=o.getProperty(_.NODE_PLACEMENT_STRATEGY),T=P===We.INTERACTIVE||S===ze.INTERACTIVE;if(l!=null&&l.getBendPoints().length>0&&T){let N=new st;for(let I of l.getBendPoints())N.add(new O(I.x,I.y));f.setProperty(p.ORIGINAL_BENDPOINTS,N)}return f}_checkEdgeValidity(t){if(t.getSources().length===0)throw new Bo("Edges must have a source.");if(t.getTargets().length===0)throw new Bo("Edges must have a target.");if(t.isHyperedge())throw new Bo("Hyperedges are not supported.")}_transformLabel(t){let e=new ua(t.getText());return e.copyProperties(t),e.setProperty(p.ORIGIN,t),e.getSize().x=t.getWidth(),e.getSize().y=t.getHeight(),e.getPosition().x=t.getX(),e.getPosition().y=t.getY(),e}};var Mf=class n{applyLayout(t){let e=t.getProperty(p.ORIGIN);if(!(e instanceof Or))return;let o=e,r=t.getParentNode(),i=new O(t.getOffset().x,t.getOffset().y),s=t.getPadding();i.x+=s.left,i.y+=s.top;let a=o.getProperty(_.NODE_SIZE_OPTIONS);if(a!=null&&a.has&&a.has(Nt.COMPUTE_PADDING)){let g=o.getProperty(_.PADDING);g!=null&&(g.bottom=s.bottom,g.top=s.top,g.left=s.left,g.right=s.right)}let l=[];for(let g of t.getLayerlessNodes()){if(n._representsNode(g))this._applyNodeLayout(g,i);else if(n._representsExternalPort(g)&&r==null){let h=g.getProperty(p.ORIGIN),d=z.getExternalPortPosition(t,g,h.getWidth(),h.getHeight());h.setLocation(d.x,d.y)}for(let h of g.getPorts())for(let d of h.getOutgoingEdges())z.isDescendant(d.getTarget().getNode(),g)||l.push(d)}if(r!=null)for(let g of r.getPorts())for(let h of g.getOutgoingEdges())z.isDescendant(h.getTarget().getNode(),r)&&l.push(h);let c=o.getProperty(_.EDGE_ROUTING);for(let g of l)this._applyEdgeLayout(g,c,i,s);this._applyParentNodeLayout(t);for(let g of t.getLayerlessNodes()){let h=g.getNestedGraph();h!=null&&this.applyLayout(h)}}_applyNodeLayout(t,e){let o=t.getProperty(p.ORIGIN),r=t.getProperty(_.CROSSING_MINIMIZATION_POSITION_ID),i=t.getProperty(_.LAYERING_LAYER_ID);o.setProperty(_.CROSSING_MINIMIZATION_POSITION_ID,r),o.setProperty(_.LAYERING_LAYER_ID,i),o.setX(t.getPosition().x+e.x),o.setY(t.getPosition().y+e.y);let s=o.getProperty(_.NODE_SIZE_CONSTRAINTS);(s!=null&&s.size>0||t.getNestedGraph()!=null)&&(o.setWidth(t.getSize().x),o.setHeight(t.getSize().y));for(let h of t.getPorts()){let d=h.getProperty(p.ORIGIN);d instanceof Ve&&(d.setLocation(h.getPosition().x,h.getPosition().y),d.setProperty(_.PORT_SIDE,h.getSide()))}let l=t.getProperty(_.NODE_LABELS_PLACEMENT),c=l!=null&&l.size>0;for(let h of t.getLabels()){let d=h.getProperty(_.NODE_LABELS_PLACEMENT),f=d!=null&&d.size>0;if(c||f){let E=h.getProperty(p.ORIGIN);E!=null&&(E.setDimensions(h.getSize().x,h.getSize().y),E.setLocation(h.getPosition().x,h.getPosition().y))}}let g=t.getProperty(_.PORT_LABELS_PLACEMENT);if(g!=null&&!it.isFixed(g))for(let h of t.getPorts())for(let d of h.getLabels()){let f=d.getProperty(p.ORIGIN);f!=null&&(f.setWidth(d.getSize().x),f.setHeight(d.getSize().y),f.setLocation(d.getPosition().x,d.getPosition().y))}}_applyEdgeLayout(t,e,o,r){let i=t.getProperty(p.ORIGIN);if(i==null)return;let s=t.getBendPoints(),a=new O(o.x,o.y),l=this._calculateHierarchicalOffset(t);a.x+=l.x,a.y+=l.y;let c;if(z.isDescendant(t.getTarget().getNode(),t.getSource().getNode())){let P=t.getSource();c=new O(P.getPosition().x+P.getAnchor().x,P.getPosition().y+P.getAnchor().y),c.x-=o.x,c.y-=o.y}else{let P=t.getSource().getAbsoluteAnchor();c=new O(P.x,P.y)}s.addFirst(c);let g=t.getTarget().getAbsoluteAnchor(),h=new O(g.x,g.y),d=t.getProperty(p.TARGET_OFFSET);d!=null&&(h.x+=d.x,h.y+=d.y),s.addLast(h);for(let P of s)P.x+=a.x,P.y+=a.y;let f=ar(i,!0,!0);f.setIncomingShape(i.getSources()[0]),f.setOutgoingShape(i.getTargets()[0]),Xs(s,f);for(let P of t.getLabels()){let S=P.getProperty(p.ORIGIN);S!=null&&(S.setWidth(P.getSize().x),S.setHeight(P.getSize().y),S.setLocation(P.getPosition().x+a.x,P.getPosition().y+a.y))}let E=t.getProperty(_.JUNCTION_POINTS);if(E!=null){for(let P of E)P.x+=a.x,P.y+=a.y;i.setProperty(_.JUNCTION_POINTS,E)}else i.setProperty(_.JUNCTION_POINTS,null);e===At.SPLINES?i.setProperty(_.EDGE_ROUTING,At.SPLINES):i.setProperty(_.EDGE_ROUTING,null)}_calculateHierarchicalOffset(t){let e=t.getProperty(p.COORDINATE_SYSTEM_ORIGIN);if(e==null)return new O;let o=new O,r=t.getSource().getNode().getGraph();for(;r!==e;){let i=r.getParentNode();if(i==null)break;r=i.getGraph(),o.x+=i.getPosition().x,o.y+=i.getPosition().y,o.x+=r.getOffset().x,o.y+=r.getOffset().y,o.x+=r.getPadding().left,o.y+=r.getPadding().top}return o}_applyParentNodeLayout(t){let e=t.getProperty(p.ORIGIN),o=e.getProperty(_.NODE_SIZE_CONSTRAINTS),r=o!=null&&o.has&&o.has(mt.PORT_LABELS);if(t.getParentNode()==null){let i=t.getProperty(p.GRAPH_PROPERTIES),s=t.getActualSize();i!=null&&i.has(v.EXTERNAL_PORTS)?(e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),Ae(e,s.x,s.y,!1,!0)):e.getProperty(_.NODE_SIZE_FIXED_GRAPH_SIZE)||Ae(e,s.x,s.y,!0,!0)}r?e.setProperty(_.NODE_SIZE_CONSTRAINTS,new Set([mt.PORT_LABELS])):e.setProperty(_.NODE_SIZE_CONSTRAINTS,mt.fixed())}static _representsNode(t){return t.getProperty(p.ORIGIN)instanceof Or}static _representsExternalPort(t){return t.getProperty(p.ORIGIN)instanceof Ve}};var bf=class n{importGraph(t){return new wf().importGraph(t)}applyLayout(t){new Mf().applyLayout(t)}static getOriginIdentifier(t){let e=t.getProperty(p.ORIGIN);return e!=null&&typeof e.getIdentifier=="function"?n._getIdentifier(e):null}static _getIdentifier(t){let e=t.getIdentifier!=null?t.getIdentifier():null;if(e!=null&&e.length>0){let o=typeof t.getParent=="function"?t.getParent():null;if(o!=null&&typeof o.getIdentifier=="function"){let r=n._getIdentifier(o);if(r!=null)return r+"."+e}return e}return null}};var Gf=class extends de{constructor(){super(),this.elkLayered=new Df}layout(t,e){let o=new bf,r=o.importGraph(t);t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN?this.elkLayered.doCompoundLayout(r,e):this.elkLayered.doLayout(r,e),(!e||!e.isCanceled||!e.isCanceled())&&o.applyLayout(r)}getLayoutAlgorithm(){return this.elkLayered}};var PO="org.eclipse.elk.layered",OO=!1;function SO(){let n=Ht.getInstance(),t=n.getAlgorithmData(PO);if(t)return OO=!0,t;let e=new Se.Builder().id(PO).name("ELK Layered").description("Layer-based algorithm with a hand-ported JS implementation.").category("org.eclipse.elk.layered").definingBundleId("org.eclipse.elk.alg.layered").providerFactory(()=>new Gf).supportedFeatures(new Set(["SELF_LOOPS","INSIDE_SELF_LOOPS","MULTI_EDGES","EDGE_LABELS","PORTS","COMPOUND","CLUSTERS"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),OO=!0,e}var le=class le{constructor(t,e=""){this.name=t,this.description=e,Object.freeze(this)}getDescription(){return this.description}toString(){return this.name}static values(){return[le.SELF_LOOPS,le.INSIDE_SELF_LOOPS,le.MULTI_EDGES,le.EDGE_LABELS,le.PORTS,le.COMPOUND,le.CLUSTERS,le.DISCONNECTED]}static valueOf(t){return le[t]||null}};Z(le,"SELF_LOOPS",new le("SELF_LOOPS","Edges connecting a node with itself.")),Z(le,"INSIDE_SELF_LOOPS",new le("INSIDE_SELF_LOOPS","Self-loops routed through a node instead of around it.")),Z(le,"MULTI_EDGES",new le("MULTI_EDGES","Multiple edges with the same source and target node.")),Z(le,"EDGE_LABELS",new le("EDGE_LABELS","Labels that are associated with edges.")),Z(le,"PORTS",new le("PORTS","Edges are connected to nodes over ports.")),Z(le,"COMPOUND",new le("COMPOUND","Edges that connect nodes from different hierarchy levels and are incident to compound nodes.")),Z(le,"CLUSTERS",new le("CLUSTERS","Edges that connect nodes from different clusters, but not the cluster parent nodes.")),Z(le,"DISCONNECTED",new le("DISCONNECTED","Multiple connected components."));var lp=le;function Rt(n,t,e,o){this.graph=n,this.model=n.getModel(),this.elkToCellMap=t,this.portCells=e||new Set,this.options=o||{},this._styles=this.options.styleBatch||new Zi(n),this._anchorCache={}}function Zi(n){this.graph=n,this.model=n.getModel(),this._pending=new Map}function yR(n,t,e){if(typeof mxUtils!="undefined"&&mxUtils!=null&&typeof mxUtils.setStyle=="function")return mxUtils.setStyle(n,t,e);var o=e!=null&&(typeof e.length=="undefined"||e.length>0);if(n!=null&&typeof n!="string"&&(n=""+n),n==null||n.length==0)o&&(n=t+"="+e+";");else if(n.substring(0,t.length+1)==t+"="){var r=n.indexOf(";");o?n=t+"="+e+(r<0?";":n.substring(r)):n=r<0||r==n.length-1?"":n.substring(r+1)}else{var i=n.indexOf(";"+t+"=");if(i<0){if(o){var s=n.charAt(n.length-1)==";"?"":";";n=n+s+t+"="+e+";"}}else{var a=n.indexOf(";",i+1);o?n=n.substring(0,i+1)+t+"="+e+(a<0?";":n.substring(a)):n=n.substring(0,i)+(a<0?";":n.substring(a))}}return n}Zi.prototype._read=function(n){var t=typeof this.model.getStyle=="function"?this.model.getStyle(n):n.style;return t!=null?t:""};Zi.prototype.get=function(n){return this._pending.has(n)?this._pending.get(n):this._read(n)};Zi.prototype.set=function(n,t,e){var o=yR(this.get(n),t,e);this._pending.set(n,o!=null?o:"")};Zi.prototype.flush=function(){var n=this;this._pending.forEach(function(t,e){n._read(e)!==t&&(typeof n.model.setStyle=="function"?n.model.setStyle(e,t):e.style=t)}),this._pending.clear()};function Dt(n){return Math.round(n*100)/100}function Hf(n){return n>0?n<1?n:1:0}function IR(n,t){var e=n!=null?n.length:0,o=t!=null?t.length:0;if(e!==o)return!1;for(var r=0;r<e;r++)if(n[r].x!==t[r].x||n[r].y!==t[r].y)return!1;return!0}function RR(n,t){return n==null&&t==null?!0:n!=null&&t!=null&&n.x===t.x&&n.y===t.y}function LR(n,t){return n.x===t.x&&n.y===t.y&&!n.relative==!t.relative&&IR(n.points,t.points)&&RR(n.offset,t.offset)}Rt.prototype.apply=function(n,t,e){this._applyNodes(n,t||0,e||0),this.options.portSpread&&this._spreadPorts(n),this._applyEdges(n,t||0,e||0),this._styles.flush()};Rt.prototype._spreadPorts=function(n){var t=1.3,e=.05,o=.5,r={};function i(A,B,Y){var j=B+(A.x||0),X=Y+(A.y||0);if(A.id!=null&&(r[A.id]={x:j,y:X,width:A.width||0,height:A.height||0}),A.children)for(var tt=0;tt<A.children.length;tt++)i(A.children[tt],j,X)}i(n,0,0);function s(A,B,Y){return Math.abs(B-Y.y)<o?"N":Math.abs(B-(Y.y+Y.height))<o?"S":Math.abs(A-Y.x)<o?"W":Math.abs(A-(Y.x+Y.width))<o?"E":null}var a={};function l(A,B,Y,j){var X=r[A];if(X!=null){var tt=s(Y+B.x,j+B.y,X);if(tt!=null){var ot=A+"|"+tt;(a[ot]=a[ot]||[]).push({box:X,side:tt,point:B,ox:Y,oy:j})}}}function c(A,B,Y){var j=B+(A.x||0),X=Y+(A.y||0);if(A.edges)for(var tt=0;tt<A.edges.length;tt++){var ot=A.edges[tt];if(!(!ot.sections||ot.sections.length===0)){var Lt=ot.sections[0];Lt.startPoint&&ot.sources&&ot.sources[0]!=null&&l(ot.sources[0],Lt.startPoint,j,X),Lt.endPoint&&ot.targets&&ot.targets[0]!=null&&l(ot.targets[0],Lt.endPoint,j,X)}}if(A.children)for(var tt=0;tt<A.children.length;tt++)c(A.children[tt],j,X)}c(n,0,0);for(var g in a){var h=a[g];if(!(h.length<2)){var d=h[0].box,f=h[0].side,E=f==="N"||f==="S",P=E?d.width:d.height;if(P>0)for(var S=E?d.x:d.y,T=0;T<h.length;T++){var N=h[T],I=E?N.ox+N.point.x:N.oy+N.point.y,C=(I-S)/P,x=.5+(C-.5)*t;x<e?x=e:x>1-e&&(x=1-e);var M=S+x*P;E?N.point.x=M-N.ox:N.point.y=M-N.oy}}}};Rt.prototype._applyNodes=function(n,t,e){if(n.children)for(var o=0;o<n.children.length;o++){var r=n.children[o],i=this.elkToCellMap[r.id];if(i!=null){var s=this.model.getGeometry(i);if(s!=null){var a=this._isTransparentBounds(i);if(a){if((r.children==null||r.children.length===0)&&r.x!=null&&r.y!=null){var g=r.x+t,h=r.y+e,d=fi(this.graph,i);d!=null&&pa(this.model,i,Dt(g-(s.x+d.x)),Dt(h-(s.y+d.y)))}}else{var l=s;if(s=s.clone(),s.x=Dt(r.x+t),s.y=Dt(r.y+e),r.width!=null&&r.height!=null&&(this.options.resizeParent||r.children!=null&&r.children.length>0)){s.width=Dt(r.width),s.height=Dt(r.height);var c=AR(this.graph,i);c!=null&&(s.width=Math.max(s.width,Dt(c.width)),s.height=Math.max(s.height,Dt(c.height)))}(s.x!==l.x||s.y!==l.y||s.width!==l.width||s.height!==l.height)&&this.model.setGeometry(i,s)}var f=a?Dt(r.x+t):0,E=a?Dt(r.y+e):0;r.children&&r.children.length>0&&this._applyNodes(r,f,E),r.edges&&this._applyEdges(r,f,E)}}}};Rt.prototype._applyEdges=function(n,t,e){if(n.edges)for(var o=0;o<n.edges.length;o++){var r=n.edges[o],i=this.elkToCellMap[r.id];if(i!=null){var s=this.model.getGeometry(i);if(s!=null){var a=s.clone(),l=null;if(r.sections){l=[];for(var c=0;c<r.sections.length;c++){var g=r.sections[c];if(g.startPoint&&l.push(new mxPoint(Dt(g.startPoint.x+t),Dt(g.startPoint.y+e))),g.bendPoints)for(var h=0;h<g.bendPoints.length;h++){var d=g.bendPoints[h];l.push(new mxPoint(Dt(d.x+t),Dt(d.y+e)))}g.endPoint&&l.push(new mxPoint(Dt(g.endPoint.x+t),Dt(g.endPoint.y+e)))}}var f=this.options.reversedEdges!=null&&this.options.reversedEdges.has(r.id);f&&l!=null&&l.reverse();var E=this.options.jettyEnds!=null?this.options.jettyEnds[r.id]:null;if(E!=null&&l!=null&&l.length>=2&&(E.source===!0&&this._appendAnchorPoint(i,i.source,l,!0),E.target===!0&&this._appendAnchorPoint(i,i.target,l,!1)),this.options.applyEdgeRouting&&l){var P=l.slice(1,l.length-1);a.points=P.length>0?P:null}else this.options.resetEdgePoints&&(a.points=null);var S=this.options.anchoredEnds!=null?this.options.anchoredEnds[r.id]:null,T=S!=null&&S.source===!0,N=S!=null&&S.target===!0;l&&l.length>=2&&this.options.applyEdgeRouting&&this.options.orthogonalRouting&&(T||(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),N||(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null)));var I=this.options.edgeStyleMode,C=this.options.climbedEnds!=null?this.options.climbedEnds[r.id]:null,x=this.options.maskedEnds!=null?this.options.maskedEnds[r.id]:null,M=C!=null&&C.source===!0,A=C!=null&&C.target===!0,B=x!=null&&x.source===!0,Y=x!=null&&x.target===!0,j=!1,X=!1;l&&l.length>=2&&this.options.applyEdgeRouting&&(j=!T&&!M&&this._snapEndpointToAnchor(i,i.source,l,!0),X=!N&&!A&&this._snapEndpointToAnchor(i,i.target,l,!1));var tt=M||T||B&&!j,ot=A||N||Y&&!X;tt&&!T&&this.options.applyEdgeRouting&&(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),ot&&!N&&this.options.applyEdgeRouting&&(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null));var Lt=a.points!=null&&a.points.length>=1,zt=l!=null?l[0]:null,be=l!=null?l[l.length-1]:null,mr=zt!=null&&be!=null&&(Math.abs(zt.x-be.x)>.5||Math.abs(zt.y-be.y)>.5),Ea=l&&l.length>=2&&this.options.applyEdgeRouting&&this.options.orthogonalRouting&&i.source!=null&&i.target!=null,Pr=!1;if(Ea&&I==="orthogonalEdgeStyle")if(this._isOrthogonalChain(l)&&(Lt||mr)){var ma=!tt&&!j&&this._terminalDiagonal(i,i.source,l,!0),Pa=!ot&&!X&&this._terminalDiagonal(i,i.target,l,!1);Lt?(!ma&&!tt&&this._alignEndpointSegment(a,l,!0),!Pa&&!ot&&this._alignEndpointSegment(a,l,!1)):this._synthesizeZ(a,l),tt||this._strictPinTerminal(i,i.source,l,!0,ma,j),ot||this._strictPinTerminal(i,i.target,l,!1,Pa,X),Pr=!0}else tt||this._applyEndpointConstraint(i,i.source,l,!0,j),ot||this._applyEndpointConstraint(i,i.target,l,!1,X),this._styles.set(i,mxConstants.STYLE_EDGE,null),this._styles.set(i,mxConstants.STYLE_NOEDGESTYLE,"1");else if(Ea&&(I==="elkCompat"||I==="orthogonal")){var Gs=tt?null:this._applyEndpointConstraint(i,i.source,l,!0,j),Hs=ot?null:this._applyEndpointConstraint(i,i.target,l,!1,X),ma=!tt&&!j&&this._terminalDiagonal(i,i.source,l,!0),Pa=!ot&&!X&&this._terminalDiagonal(i,i.target,l,!1),hp=ma||Pa,IO=!hp&&(Lt||mr&&(Math.abs(zt.x-be.x)<=.5||Math.abs(zt.y-be.y)<=.5));if(IO)Gs!=null&&(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),Hs!=null&&(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null)),Lt||(a.points=[new mxPoint(Dt((zt.x+be.x)/2),Dt((zt.y+be.y)/2))]),Pr=!0;else if(hp){if(ma)this._pinPerpendicularPerimeter(i,i.source,l,!0),this._anchorDiagonalBody(a,l,!0);else if(Gs!=null&&I==="orthogonal"){var dp=a.points!=null?a.points.slice():[];dp.unshift(Gs),a.points=dp}if(Pa)this._pinPerpendicularPerimeter(i,i.target,l,!1),this._anchorDiagonalBody(a,l,!1);else if(Hs!=null&&I==="orthogonal"){var fp=a.points!=null?a.points.slice():[];fp.push(Hs),a.points=fp}}else if(I==="orthogonal"&&(Gs!=null||Hs!=null)){var pl=a.points!=null?a.points.slice():[];Gs!=null&&pl.unshift(Gs),Hs!=null&&pl.push(Hs),a.points=pl.length>0?pl:null}}else if(l&&l.length>=2&&this.options.applyEdgeRouting&&i.source!=null&&i.target!=null){var Ff=tt?null:this._applyEndpointConstraint(i,i.source,l,!0,j),kf=ot?null:this._applyEndpointConstraint(i,i.target,l,!1,X);if(I!=="elkCompat"&&I!=="orthogonalEdgeStyle"&&(Ff!=null||kf!=null)){var El=a.points!=null?a.points.slice():[];Ff!=null&&El.unshift(Ff),kf!=null&&El.push(kf),a.points=El.length>0?El:null}}Pr&&(this._styles.set(i,mxConstants.STYLE_NOEDGESTYLE,null),this._styles.set(i,mxConstants.STYLE_ORTHOGONAL,null),this._styles.set(i,mxConstants.STYLE_EDGE,mxConstants.EDGESTYLE_ORTHOGONAL));var RO=Pr||I==="orthogonalEdgeStyle"||I==="elkCompat";if(this.options.applyEdgeRouting&&this.options.orthogonalRouting&&l&&l.length>=2&&!RO&&this._styles.set(i,mxConstants.STYLE_ORTHOGONAL,"1"),this.options.applyEdgeRouting&&this.options.orthogonalRouting&&a.points!=null&&a.points.length>2&&(a.points=this._simplifyOrthogonal(a.points)),r.labels&&r.labels.length>0&&l&&l.length>=2){var ji=r.labels[0];if(ji.x!=null&&ji.y!=null){var ml=new mxPoint(ji.x+(ji.width||0)/2+t,ji.y+(ji.height||0)/2+e),Wf=this._projectOntoPolyline(ml,l),up=ml.x-Wf.x,_p=ml.y-Wf.y,LO=Math.sqrt(up*up+_p*_p),pp=LO<=(ji.height||0)/2?Wf:ml,Ep=this._polylineMidpoint(l);a.relative=!0,a.x=0,a.y=0,a.offset=new mxPoint(Dt(pp.x-Ep.x),Dt(pp.y-Ep.y))}}LR(a,s)||this.model.setGeometry(i,a)}}}};Rt.prototype._terminalBox=function(n){var t=this.model.getGeometry(n);if(t==null)return null;if(!t.relative)return t;var e=n.parent!=null?this.model.getGeometry(n.parent):null;if(e==null)return null;var o=t.x*e.width,r=t.y*e.height;return t.offset!=null&&(o+=t.offset.x,r+=t.offset.y),{x:o,y:r,width:t.width,height:t.height}};Rt.prototype._applyEndpointConstraint=function(n,t,e,o,r){if(t!=null){var i=this._terminalBox(t);if(!(i==null||!(i.width>0)||!(i.height>0))){var s=o?e[0]:e[e.length-1],a=o?e[1]:e[e.length-2],l=this._coordsBetween(n.parent,t.parent),c=s.x+l.dx,g=s.y+l.dy,h=(c-i.x)/i.width,d=(g-i.y)/i.height,f=.02;if(a!=null&&this.options.orthogonalRouting&&!r){var E=a.x+l.dx,P=a.y+l.dy;h<f||h>1-f?d=(P-i.y)/i.height:(d<f||d>1-f)&&(h=(E-i.x)/i.width)}h<0?h=0:h>1&&(h=1),d<0?d=0:d>1&&(d=1),h=Math.round(h*1e4)/1e4,d=Math.round(d*1e4)/1e4;var S=o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,T=o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y;if(this._styles.set(n,S,h),this._styles.set(n,T,d),a==null||!this.options.orthogonalRouting)return null;var N=i.x+h*i.width-l.dx,I=i.y+d*i.height-l.dy,C=N-a.x,x=I-a.y,M=.5;if(Math.abs(C)<=M||Math.abs(x)<=M)return null;var A=d===0||d===1;return A?new mxPoint(Dt(N),Dt(a.y)):new mxPoint(Dt(a.x),Dt(I))}}};Rt.prototype._anchorDiagonalBody=function(n,t,e){var o=e?t[0]:t[t.length-1];if(o!=null){var r=n.points!=null?n.points.slice():[],i=e?r[0]:r[r.length-1],s=.5;if(!(i!=null&&(Math.abs(i.x-o.x)<=s||Math.abs(i.y-o.y)<=s))){var a=new mxPoint(o.x,o.y);e?r.unshift(a):r.push(a),n.points=r}}};Rt.prototype._strictPinTerminal=function(n,t,e,o,r,i){r&&this._pinPerpendicularPerimeter(n,t,e,o)||this._applyEndpointConstraint(n,t,e,o,i)};Rt.prototype._appendAnchorPoint=function(n,t,e,o){if(t!=null){var r=this.graph.getCellStyle(n);if(r!=null){var i=parseFloat(r[o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]),s=parseFloat(r[o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]);if(!(isNaN(i)||isNaN(s))){var a=parseFloat(r[o?"exitDx":"entryDx"])||0,l=parseFloat(r[o?"exitDy":"entryDy"])||0,c=this._terminalBox(t);if(!(c==null||!(c.width>0)||!(c.height>0))){var g=this._coordsBetween(n.parent,t.parent),h=Dt(c.x+i*c.width+a-g.dx),d=Dt(c.y+s*c.height+l-g.dy),f=o?e[0]:e[e.length-1];if(!(f!=null&&Math.abs(f.x-h)<=.5&&Math.abs(f.y-d)<=.5)){if(f!=null)for(var E=Math.abs(f.x-h)>=Math.abs(f.y-d),P=o?0:e.length-1,S=o?1:-1;P>=0&&P<e.length;P+=S)if(E){if(Math.abs(e[P].y-d)>.75)break;e[P].y=d}else{if(Math.abs(e[P].x-h)>.75)break;e[P].x=h}var T=new mxPoint(h,d);o?e.unshift(T):e.push(T)}}}}}};Rt.prototype._snapEndpointToAnchor=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=this.graph.getCellStyle(n),s=r!=null&&String(r.snapToPoint)==="1"||i!=null&&String(i.snapToPoint)==="1";if(!s)return!1;var a=this._terminalAnchors(t);if(a==null)return!1;var l=this._terminalBox(t);if(l==null||!(l.width>0)||!(l.height>0))return!1;var c=o?e[0]:e[e.length-1];if(c==null)return!1;for(var g=this._coordsBetween(n.parent,t.parent),h=c.x+g.dx,d=c.y+g.dy,f=null,E=1/0,P=0;P<a.length;P++){var S=l.x+a[P].x*l.width,T=l.y+a[P].y*l.height,N=(S-h)*(S-h)+(T-d)*(T-d);N<E&&(E=N,f={x:S,y:T})}return f==null?!1:(c.x=Dt(f.x-g.dx),c.y=Dt(f.y-g.dy),!0)};Rt.prototype._terminalAnchors=function(n){var t=this._anchorCache[n.id];if(t!==void 0)return t;var e=this.graph,o=null,r=e.view!=null&&e.view.getState!=null?e.view.getState(n):null;r!=null&&e.getAllConnectionConstraints!=null&&(o=e.getAllConnectionConstraints(r,!0));var i=this._terminalBox(n),s=i!=null&&i.width>0?i.width:1,a=i!=null&&i.height>0?i.height:1,l=[],c;if(o!=null)for(c=0;c<o.length;c++){var g=o[c];g!=null&&g.point!=null&&l.push({x:Hf(g.point.x+(g.dx||0)/s),y:Hf(g.point.y+(g.dy||0)/a)})}else{var h=e.getCellStyle(n),d=h!=null?h.points:null;if(d!=null)try{var f=typeof d=="string"?JSON.parse(d):d;for(c=0;c<f.length;c++){var E=f[c];E!=null&&E.length>=2&&l.push({x:Hf(parseFloat(E[0])+(E.length>3&&parseFloat(E[3])||0)/s),y:Hf(parseFloat(E[1])+(E.length>4&&parseFloat(E[4])||0)/a)})}}catch(S){}}var P=l.length>0?l:null;return this._anchorCache[n.id]=P,P};Rt.PERPENDICULAR_PERIMETER_SHAPES={rhombus:!0,ellipse:!0,doubleEllipse:!0};function vf(n,t,e){var o=n!=null?n[t]:null,r=typeof o=="number"?o:parseFloat(o);return isNaN(r)?e:r}Rt.PERIMETER_OUTLINES={parallelogramPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east";if(i==="north"||i==="south"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:s},{x:t,y:e},{x:0,y:e-s},{x:0,y:0}]}var a=o?Math.max(0,Math.min(t*.5,r)):t*Math.max(0,Math.min(1,r));return[{x:a,y:0},{x:t,y:0},{x:t-a,y:e},{x:0,y:e},{x:a,y:0}]},trapezoidPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east";if(i==="west"){var a=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:0},{x:t-a,y:e},{x:a,y:e},{x:0,y:0}]}if(i==="north"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:s},{x:t,y:0},{x:t,y:e},{x:0,y:e-s},{x:0,y:s}]}if(i==="south"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:s},{x:t,y:e-s},{x:0,y:e},{x:0,y:0}]}var a=o?Math.max(0,Math.min(t*.5,r)):t*Math.max(0,Math.min(1,r));return[{x:a,y:0},{x:t-a,y:0},{x:t,y:e},{x:0,y:e},{x:a,y:0}]},stepPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east",s=t/2,a=e/2;if(i==="west"){var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:c,y:0},{x:t,y:0},{x:t-c,y:a},{x:t,y:e},{x:c,y:e},{x:0,y:a},{x:c,y:0}]}if(i==="north"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:l},{x:s,y:0},{x:t,y:l},{x:t,y:e},{x:s,y:e-l},{x:0,y:e},{x:0,y:l}]}if(i==="south"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:s,y:l},{x:t,y:0},{x:t,y:e-l},{x:s,y:e},{x:0,y:e-l},{x:0,y:0}]}var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t-c,y:0},{x:t,y:a},{x:t-c,y:e},{x:0,y:e},{x:c,y:a},{x:0,y:0}]},hexagonPerimeter2:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.25),i=n.direction||"east",s=t/2,a=e/2;if(i==="north"||i==="south"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:s,y:0},{x:t,y:l},{x:t,y:e-l},{x:s,y:e},{x:0,y:e-l},{x:0,y:l},{x:s,y:0}]}var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:c,y:0},{x:t-c,y:0},{x:t,y:a},{x:t-c,y:e},{x:c,y:e},{x:0,y:a},{x:c,y:0}]},trianglePerimeter:function(n,t,e){var o=n.direction||"east";return o==="north"?[{x:0,y:e},{x:t/2,y:0},{x:t,y:e},{x:0,y:e}]:o==="south"?[{x:0,y:0},{x:t/2,y:e},{x:t,y:0},{x:0,y:0}]:o==="west"?[{x:t,y:0},{x:0,y:e/2},{x:t,y:e},{x:t,y:0}]:[{x:0,y:0},{x:t,y:e/2},{x:0,y:e},{x:0,y:0}]}};function TO(n,t){if(n==null)return null;var e=n*1e4;return(t==="right"||t==="bottom"?Math.ceil(e-1e-6):Math.floor(e+1e-6))/1e4}Rt.prototype._outlineCross=function(n,t,e,o,r){for(var i=t==="top"||t==="bottom",s=i?e*o:e*r,a=t==="top"||t==="left",l=null,c=function(N){(l==null||(a?N<l:N>l))&&(l=N)},g=1;g<n.length;g++){var h=n[g-1],d=n[g],f=i?h.x:h.y,E=i?d.x:d.y,P=i?h.y:h.x,S=i?d.y:d.x;if(!(s<Math.min(f,E)-1e-9||s>Math.max(f,E)+1e-9))if(Math.abs(E-f)<1e-9)c(P),c(S);else{var T=(s-f)/(E-f);c(P+T*(S-P))}}return l==null?null:l/(i?r:o)};Rt.prototype._pinPerpendicularPerimeter=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=r!=null?r[mxConstants.STYLE_SHAPE]:null,s=i!=null&&Rt.PERPENDICULAR_PERIMETER_SHAPES[i]===!0,a=!s&&r!=null?Rt.PERIMETER_OUTLINES[r.perimeter]:null;if(!s&&a==null)return!1;var l=this._terminalBox(t);if(l==null||!(l.width>0)||!(l.height>0))return!1;var c=o?e[0]:e[e.length-1],g=o?e[1]:e[e.length-2];if(c==null||g==null)return!1;var h=this._coordsBetween(n.parent,t.parent),d=(c.y+h.dy-l.y)/l.height,f=(c.x+h.dx-l.x)/l.width,E=(g.x+h.dx-l.x)/l.width,P=(g.y+h.dy-l.y)/l.height,S=.02,T=null;if(d<=S)T="top";else if(d>=1-S)T="bottom";else if(f<=S)T="left";else if(f>=1-S)T="right";else{var N=Math.abs(g.x-c.x),I=Math.abs(g.y-c.y),C=.5;I<=C&&N>C?T=g.x>c.x?"right":"left":N<=C&&I>C&&(T=g.y>c.y?"bottom":"top")}if(T==null)return!1;var x,M;if(T==="top"||T==="bottom"?(x=Math.round(E*1e4)/1e4,M=TO(s?this._perimeterCross(i,T,x):this._outlineCross(a(r,l.width,l.height),T,x,l.width,l.height),T)):(M=Math.round(P*1e4)/1e4,x=TO(s?this._perimeterCross(i,T,M):this._outlineCross(a(r,l.width,l.height),T,M,l.width,l.height),T)),x==null||M==null)return!1;x<0?x=0:x>1&&(x=1),M<0?M=0:M>1&&(M=1);var A=o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,B=o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y;return this._styles.set(n,A,x),this._styles.set(n,B,M),!0};Rt.prototype._perimeterCross=function(n,t,e){if(e<0?e=0:e>1&&(e=1),n==="rhombus")return t==="bottom"||t==="right"?e<=.5?.5+e:1.5-e:e<=.5?.5-e:e-.5;var o=2*e-1,r=Math.sqrt(Math.max(0,1-o*o))/2;return t==="bottom"||t==="right"?.5+r:.5-r};Rt.prototype._isOrthogonalChain=function(n){if(n==null)return!1;for(var t=.5,e=2;e<=n.length-2;e++){var o=Math.abs(n[e].x-n[e-1].x),r=Math.abs(n[e].y-n[e-1].y);if(o>t&&r>t)return!1}return!0};Rt.prototype._alignEndpointSegment=function(n,t,e){var o=n.points;if(!(o==null||o.length===0)){var r=e?0:o.length-1,i=o[r],s=e?t[0]:t[t.length-1],a=.5;if(!(Math.abs(i.x-s.x)<=a||Math.abs(i.y-s.y)<=a)){var l=e?t[2]:t[t.length-3];l==null&&(l=e?t[t.length-1]:t[0]),Math.abs(i.x-l.x)>=Math.abs(i.y-l.y)?i.x=Dt(s.x):i.y=Dt(s.y)}}};Rt.prototype._synthesizeZ=function(n,t){var e=t[0],o=t[t.length-1],r,i;if(Math.abs(o.y-e.y)>=Math.abs(o.x-e.x)){var s=Dt((e.y+o.y)/2);r=new mxPoint(Dt(e.x),s),i=new mxPoint(Dt(o.x),s)}else{var a=Dt((e.x+o.x)/2);r=new mxPoint(a,Dt(e.y)),i=new mxPoint(a,Dt(o.y))}n.points=Math.abs(r.x-i.x)<=.5&&Math.abs(r.y-i.y)<=.5?[r]:[r,i],t.splice.apply(t,[1,0].concat(n.points))};Rt.prototype._simplifyOrthogonal=function(n){if(n==null||n.length<=2)return n;for(var t=.5,e=[n[0]],o=1;o<n.length-1;o++){var r=e[e.length-1],i=n[o],s=n[o+1],a=Math.abs(r.x-i.x)<=t&&Math.abs(i.x-s.x)<=t,l=Math.abs(r.y-i.y)<=t&&Math.abs(i.y-s.y)<=t;a||l||e.push(i)}return e.push(n[n.length-1]),e};Rt.NON_RECT_PERIMETER_SHAPES={ellipse:!0,doubleEllipse:!0,rhombus:!0,triangle:!0,hexagon:!0,parallelogram:!0,step:!0,trapezoid:!0};Rt.prototype._terminalDiagonal=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=r!=null?r[mxConstants.STYLE_SHAPE]:null;if(i==null||!Rt.NON_RECT_PERIMETER_SHAPES[i])return!1;var s=this._terminalBox(t);if(s==null||!(s.width>0)||!(s.height>0))return!1;var a=o?e[0]:e[e.length-1],l=this._coordsBetween(n.parent,t.parent),c=(a.x+l.dx-s.x)/s.width,g=(a.y+l.dy-s.y)/s.height,h=.02,d=Math.abs(c-.5)<h&&(g<h||g>1-h)||Math.abs(g-.5)<h&&(c<h||c>1-h);return!d};Rt.prototype._coordsBetween=function(n,t){if(n===t)return{dx:0,dy:0};var e=this._parentAbsoluteOrigin(n),o=this._parentAbsoluteOrigin(t);return{dx:e.x-o.x,dy:e.y-o.y}};Rt.prototype._parentAbsoluteOrigin=function(n){for(var t=0,e=0,o=n;o!=null&&o.parent!=null;){var r=this.model.getGeometry(o);r!=null&&(t+=r.x,e+=r.y),o=o.parent}return{x:t,y:e}};Rt.prototype._projectOntoPolyline=function(n,t){for(var e=null,o=1/0,r=1;r<t.length;r++){var i=t[r-1],s=t[r],a=s.x-i.x,l=s.y-i.y,c=a*a+l*l,g=0;c>0&&(g=((n.x-i.x)*a+(n.y-i.y)*l)/c,g<0?g=0:g>1&&(g=1));var h=i.x+g*a,d=i.y+g*l,f=(n.x-h)*(n.x-h)+(n.y-d)*(n.y-d);f<o&&(o=f,e=new mxPoint(h,d))}return e||n.clone()};Rt.prototype._polylineMidpoint=function(n){if(n.length===1)return n[0].clone();for(var t=0,e=[],o=1;o<n.length;o++){var r=n[o].x-n[o-1].x,i=n[o].y-n[o-1].y,s=Math.sqrt(r*r+i*i);e.push(s),t+=s}for(var a=t/2,l=0,o=0;o<e.length;o++){if(l+e[o]>=a){var c=e[o]===0?0:(a-l)/e[o];return new mxPoint(n[o].x+(n[o+1].x-n[o].x)*c,n[o].y+(n[o+1].y-n[o].y)*c)}l+=e[o]}return n[n.length-1].clone()};Rt.prototype._isCompound=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isVertex(o)&&!this.portCells.has(o.id))return!0}return!1};function wo(n,t){var e=n.getStyle(t);if(e==null)return!1;for(var o=e.split(";"),r=0;r<o.length;r++)if(o[r]==="transparentBounds=1")return!0;return!1}Rt.prototype._isTransparentBounds=function(n){return wo(this.model,n)};function AR(n,t){for(var e=n.getModel(),o=e.getChildCount(t),r=null,i=0;i<o;i++){var s=e.getChildAt(t,i);if(!(!e.isVertex(s)||!e.isVisible(s))){var a=e.getGeometry(s);if(!(a==null||a.relative)){var l=typeof n.getCellStyle=="function"?n.getCellStyle(s):{};if(l.part=="1"){var c=a.x+a.width,g=a.y+a.height;r==null?r={width:c,height:g}:(r.width=Math.max(r.width,c),r.height=Math.max(r.height,g))}}}}return r}function Bf(n){if(n==null||n==="")return null;if(typeof n=="number")return isFinite(n)?{top:n,right:n,bottom:n,left:n}:null;var t=String(n);try{t=decodeURIComponent(t)}catch(s){}if(t=t.trim(),t==="")return null;for(var e=t.split(/\s+/),o=[],r=0;r<e.length;r++){var i=parseFloat(e[r]);o.push(isNaN(i)?0:i)}return o.length===0?null:o.length===1?{top:o[0],right:o[0],bottom:o[0],left:o[0]}:o.length===2?{top:o[0],right:o[1],bottom:o[0],left:o[1]}:o.length===3?{top:o[0],right:o[1],bottom:o[2],left:o[1]}:{top:o[0],right:o[1],bottom:o[2],left:o[3]}}function CR(n,t){for(var e=n.getModel(),o=e.getChildCount(t),r=null,i=function(d,f,E,P){if(r==null)r={x:d,y:f,width:E,height:P};else{var S=Math.max(r.x+r.width,d+E),T=Math.max(r.y+r.height,f+P);r.x=Math.min(r.x,d),r.y=Math.min(r.y,f),r.width=S-r.x,r.height=T-r.y}},s=0;s<o;s++){var a=e.getChildAt(t,s),l=e.getGeometry(a);if(l!=null){if(e.isVertex(a)&&!l.relative)if(wo(e,a)){var c=fi(n,a);c!=null&&i(l.x+c.x,l.y+c.y,c.width,c.height)}else i(l.x,l.y,l.width,l.height);else if(e.isEdge(a)){var g=l.points!=null?l.points.slice():[];typeof l.getTerminalPoint=="function"&&(e.getTerminal(a,!0)==null&&l.getTerminalPoint(!0)!=null&&g.push(l.getTerminalPoint(!0)),e.getTerminal(a,!1)==null&&l.getTerminalPoint(!1)!=null&&g.push(l.getTerminalPoint(!1)));for(var h=0;h<g.length;h++)g[h]!=null&&i(g[h].x,g[h].y,0,0)}}}return r}function fi(n,t){var e=CR(n,t);if(e==null)return null;var o=typeof n.getCellStyle=="function"?n.getCellStyle(t):{},r=Bf(o.groupPadding)||{top:0,right:0,bottom:0,left:0},i=o.shape==="swimlane"||o.swimlane!=null;if(i){var s=parseInt(o.startSize,10);isNaN(s)&&(s=40),o.horizontal==0||o.horizontal==="0"?r.left+=s:r.top+=s}var a=parseInt(o.footerSize,10);return!isNaN(a)&&a>0&&(i&&(o.horizontal==0||o.horizontal==="0")?r.right+=a:r.bottom+=a),{x:e.x-r.left,y:e.y-r.top,width:e.width+r.left+r.right,height:e.height+r.top+r.bottom}}function ul(n,t,e){for(var o=null,r=n.getChildCount(t),i=0;i<r;i++){var s=n.getChildAt(t,i);if(!(!n.isVertex(s)||!n.isVisible(s))&&!(e!=null&&!e(s))){var a=n.getGeometry(s);if(a!=null){var l=a.x,c=a.y;if(wo(n,s)){var g=ul(n,s,e);if(g==null)continue;l=a.x+g.x,c=a.y+g.y}o==null?o={x:l,y:c}:(l<o.x&&(o.x=l),c<o.y&&(o.y=c))}}}return o}function cp(n,t,e){for(var o=n.getModel(),r=null,i=0;i<(t.children!=null?t.children.length:0);i++){var s=t.children[i],a=e[s.id];if(!(a==null||s.x==null||s.y==null)){var l=s.x,c=s.y;if(wo(o,a))if(s.children!=null&&s.children.length>0){var g=cp(n,s,e);if(g==null)continue;l=s.x+g.x,c=s.y+g.y}else{var h=fi(n,a),d=ul(o,a),f=o.getGeometry(a);if(h==null||d==null)continue;l=s.x+d.x-((f!=null?f.x:0)+h.x),c=s.y+d.y-((f!=null?f.y:0)+h.y)}r==null?r={x:l,y:c}:(l<r.x&&(r.x=l),c<r.y&&(r.y=c))}}return r}function pa(n,t,e,o,r){if(!(Math.abs(e)<.01&&Math.abs(o)<.01))for(var i=n.getChildCount(t),s=0;s<i;s++){var a=n.getChildAt(t,s);if(!(r!=null&&!r(a))){if(n.isVertex(a)&&wo(n,a)){pa(n,a,e,o,r);continue}var l=n.getGeometry(a);if(l!=null){if(n.isVertex(a)){if(l.relative)continue;var c=l.clone();c.x=l.x+e,c.y=l.y+o,n.setGeometry(a,c)}else if(n.isEdge(a)){var c=null;if(l.points!=null&&l.points.length>0){c=l.clone(),c.points=[];for(var g=0;g<l.points.length;g++){var h=l.points[g];c.points.push(new mxPoint(h.x+e,h.y+o))}}if(typeof l.getTerminalPoint=="function"&&typeof l.setTerminalPoint=="function")for(var d=0;d<2;d++){var f=d===0,E=n.getTerminal(a,f)==null?l.getTerminalPoint(f):null;E!=null&&(c=c!=null?c:l.clone(),c.setTerminalPoint(new mxPoint(E.x+e,E.y+o),f))}c!=null&&n.setGeometry(a,c)}}}}}function _t(n){this.graph=n,this.model=n.getModel(),this._cellToElk={},this._elkToCell={},this._portCells=new Set,this._cellToElkNode={},this._constraintPorts={},this._constraintPortCounter=0,this._portThresholdSize=20,this._reversedEdges=new Set,this._climbedEnds={},this._maskedEnds={},this._maskPortCounter=0,this._freeEndPortCounter=0,this._layoutDirection=null,this._edgeRouting=null,this._anchoredEnds={},this._jettyEnds={},this.respectConnectionConstraints=!1,this.rootCellIds=null,this.useViewStateSizing=!0,this.respectFixedPosition=!0,this.cellFilter=null,this.includeEdgeLabels=!0,this.includeVertexLabels=!0,this.includeCompoundLabels=null,this.groupPadding=null}_t.prototype.convert=function(n,t){this._cellToElk={},this._elkToCell={},this._portCells=new Set,this._cellToElkNode={},this._constraintPorts={},this._constraintPortCounter=0,this._reversedEdges=new Set,this._climbedEnds={},this._maskedEnds={},this._anchoredEnds={},this._jettyEnds={},this._maskPortCounter=0,this._freeEndPortCounter=0;var e=mxUtils.clone(t)||{};if(this._layoutDirection=e["elk.direction"]!=null?String(e["elk.direction"]):null,this.preserveNodePositions=e["elk.interactive"]==="true",e["elk.algorithm"]==null&&(e["elk.algorithm"]="layered"),e["elk.hierarchyHandling"]==null&&(e["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),this._edgeLabelsInline=e["elk.edgeLabels.inline"]==="true"||e["elk.edgeLabels.inline"]===!0,e["elk.edgeRouting"]==null){var o=this._inferEdgeRouting(n);o!=null&&(e["elk.edgeRouting"]=o)}if(this._edgeRouting=e["elk.edgeRouting"]!=null?String(e["elk.edgeRouting"]):null,e["elk.padding"]==null&&n!=null&&this.model.isVertex(n)){var r=this._getGroupPadding(n);e["elk.padding"]="[top="+r.top+",left="+r.left+",bottom="+r.bottom+",right="+r.right+"]"}var i={id:"root",layoutOptions:e,children:[],edges:[]};this._inheritedCompoundOptions={};for(var s in e)(s==="elk.algorithm"||s==="elk.direction"||s==="elk.layered.cycleBreaking.strategy"||s.indexOf("elk.layered.spacing.")===0||s.indexOf("elk.spacing.")===0||s.indexOf("elk.force.")===0||s.indexOf("elk.stress.")===0||s.indexOf("elk.radial.")===0||s.indexOf("elk.mrtree.")===0)&&(this._inheritedCompoundOptions[s]=e[s]);return this._convertChildren(n,i),this._convertEdges(n,i),this._convertInternalEdges(n),this._portFixedPosFreeEnds(i),i};_t.prototype.getElkToCellMap=function(){return this._elkToCell};_t.prototype.getPortCells=function(){return this._portCells};_t.prototype.getReversedEdges=function(){return this._reversedEdges};_t.prototype.getClimbedEnds=function(){return this._climbedEnds};_t.prototype.getMaskedEnds=function(){return this._maskedEnds};_t.prototype.getAnchoredEnds=function(){return this._anchoredEnds};_t.prototype.getJettyEnds=function(){return this._jettyEnds};_t.prototype._convertChildren=function(n,t){var e=null;t.id!=="root"&&this.model.isVertex(n)&&wo(this.model,n)&&(e=fi(this.graph,n));for(var o=this.model.getChildCount(n),r=0;r<o;r++){var i=this.model.getChildAt(n,r);if(!(!this.model.isVertex(i)||!this.model.isVisible(i))){if(this._isShapePart(i)){var s=this.model.getGeometry(i);if(this.model.isVertex(n)||s!=null&&s.relative)continue}if(!(this.cellFilter!=null&&!this.cellFilter(i))){var a=this.model.getGeometry(i);if(a!=null){if(i.collapsed){var l=this._convertVertex(i,a,e);this._convertPorts(i,l),t.children.push(l);continue}var l=this._convertVertex(i,a,e),c=this._hasLayoutableChildren(i);if(c){l.children=[],l.edges=[];var g=this._getGroupPadding(i);l.layoutOptions=l.layoutOptions||{},l.layoutOptions["elk.padding"]="[top="+g.top+",left="+g.left+",bottom="+g.bottom+",right="+g.right+"]";for(var h in this._inheritedCompoundOptions)l.layoutOptions[h]==null&&(l.layoutOptions[h]=this._inheritedCompoundOptions[h]);this._convertChildren(i,l)}this._convertPorts(i,l),t.children.push(l)}}}}};_t.prototype._convertVertex=function(n,t,e){var o="n"+n.id;this._cellToElk[n.id]=o,this._elkToCell[o]=n;var r=t.width,i=t.height,s=wo(this.model,n),a=s?fi(this.graph,n):null;if(a!=null)r=a.width,i=a.height;else if(this.useViewStateSizing&&!n.collapsed&&this._hasNonPartChild(n)&&this.graph.view!=null&&typeof this.graph.view.getState=="function"){var l=this.graph.view.getState(n),c=this.graph.view.scale||1;l!=null&&l.width!=null&&l.height!=null&&(r=Math.max(r,l.width/c),i=Math.max(i,l.height/c))}var g={id:o,width:r,height:i},h=(t.x||0)+(a!=null?a.x:0)-(e!=null?e.x:0),d=(t.y||0)+(a!=null?a.y:0)-(e!=null?e.y:0);this.respectFixedPosition&&typeof this.graph.isCellMovable=="function"&&!this.graph.isCellMovable(n)?(g.x=h,g.y=d,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.position"]="("+h+","+d+")"):this.preserveNodePositions&&t.x!=null&&t.y!=null&&(g.x=h,g.y=d),this._cellToElkNode[n.id]=g;var f=this.includeVertexLabels;if(!f&&this.includeCompoundLabels===!0&&this._hasLayoutableChildren(n)&&(f=!0),f&&s&&(f=!1),f){var E=this._getVertexLabels(n);E.length>0&&(g.labels=E,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.nodeSize.constraints"]="NODE_LABELS MINIMUM_SIZE",g.layoutOptions["elk.nodeSize.minimum"]="("+r+", "+i+")")}return g};_t.prototype._convertEdges=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(!(!this.model.isEdge(r)||!this.model.isVisible(r))&&!(this.cellFilter!=null&&!this.cellFilter(r))){var i=this._convertEdge(r);i!=null&&t.edges.push(i)}}};_t.prototype._convertEdge=function(n){var t=this.model.getTerminal(n,!0),e=this.model.getTerminal(n,!1);if(t==null||e==null)return null;var o=this._resolveEdgeTerminal(t,n,!0),r=this._resolveEdgeTerminal(e,n,!1);if(o==null||r==null)return null;var i="e"+n.id;this._cellToElk[n.id]=i,this._elkToCell[i]=n;var s={id:i,sources:[o],targets:[r]};this.respectConnectionConstraints&&this._applyConnectionConstraints(n,t,e,s);var a=s.sources[0]===this._cellToElk[t.id]?this._anchoredPoint(n,!0):null,l=s.targets[0]===this._cellToElk[e.id]?this._anchoredPoint(n,!1):null,c=a!=null?this._jettyStubFor(n,t,a,!0):null,g=l!=null?this._jettyStubFor(n,e,l,!1):null;if((c!=null||g!=null)&&this.model.getParent(t)===this.model.getParent(e)){var h=this.model.getGeometry(t),d=this.model.getGeometry(e);if(h!=null&&d!=null&&a!=null&&l!=null){var f=h.x+a.x*h.width+a.dx,E=h.y+a.y*h.height+a.dy,P=d.x+l.x*d.width+l.dx,S=d.y+l.y*d.height+l.dy,T=P-f,N=S-E,I=(c!=null?c.jetty:0)+(g!=null?g.jetty:0);T*T+N*N<I*I&&(c=null,g=null)}}if(a!=null){var C=this._ensureConstraintPort(t,a.x,a.y,a.dx,a.dy,c);C!=null&&(s.sources=[C.id],this._markAnchoredEnd(i,!0),c!=null&&this._markJettyEnd(i,!0))}if(l!=null){var x=this._ensureConstraintPort(e,l.x,l.y,l.dx,l.dy,g);x!=null&&(s.targets=[x.id],this._markAnchoredEnd(i,!1),g!=null&&this._markJettyEnd(i,!1))}if(s.sources[0]===this._cellToElk[t.id]){var M=this._portConstraintSides(n,t,!0);if(M!=null){var A=this._createMaskPort(t,this._pickConstraintSide(M,t,e,!0),this._maskJettyFor(n,!0));A!=null&&(s.sources=[A.id],this._markMaskedEnd(i,!0))}}if(s.targets[0]===this._cellToElk[e.id]){var B=this._portConstraintSides(n,e,!1);if(B!=null){var Y=this._createMaskPort(e,this._pickConstraintSide(B,e,t,!1),this._maskJettyFor(n,!1));Y!=null&&(s.targets=[Y.id],this._markMaskedEnd(i,!1))}}if(this.rootCellIds!=null&&e!=null&&t!=null){for(var j=String(e.id),X=String(t.id),tt=!1,ot=!1,Lt=0;Lt<this.rootCellIds.length;Lt++){var zt=String(this.rootCellIds[Lt]);j===zt&&(tt=!0),X===zt&&(ot=!0)}if(tt&&!ot){var be=s.sources;s.sources=s.targets,s.targets=be,this._reversedEdges.add(i)}}if(this.includeEdgeLabels){var mr=this._getEdgeLabels(n);mr.length>0&&(s.labels=mr)}return s};_t.prototype._resolveEdgeTerminal=function(n,t,e){if(this._portCells.has(n.id))return"p"+n.id;if(this._cellToElk[n.id]!=null)return this._cellToElk[n.id];for(var o=this.model.getParent(n);o!=null;){if(this._cellToElk[o.id]!=null){var r="e"+t.id,i=this._climbedEnds[r];return i==null&&(i={source:!1,target:!1},this._climbedEnds[r]=i),i[e?"source":"target"]=!0,this._cellToElk[o.id]}o=this.model.getParent(o)}return null};_t.prototype._collectInternalEdges=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isEdge(r)&&this.model.isVisible(r)){if(this.cellFilter!=null&&!this.cellFilter(r))continue;var i=this._convertEdge(r);i!=null&&t.edges.push(i)}}};_t.prototype._convertInternalEdges=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(!(!this.model.isVertex(o)||!this.model.isVisible(o))&&!this._isPort(o)&&!(this.cellFilter!=null&&!this.cellFilter(o))&&!o.collapsed){var r=this._cellToElkNode[o.id];r==null||r.edges==null||(this._collectInternalEdges(o,r),this._convertInternalEdges(o))}}};_t.prototype._isPort=function(n){if(!this.model.isVertex(n))return!1;var t=this.model.getGeometry(n);if(t==null||!t.relative)return!1;var e=this.graph.getCellStyle(n);return e[mxConstants.STYLE_SHAPE]==="port"||e.portConstraint!=null?!0:t.width<=this._portThresholdSize&&t.height<=this._portThresholdSize};_t.prototype._isShapePart=function(n){var t=this.model.getGeometry(n);return t!=null&&t.relative?!0:this.graph.getCellStyle(n).part=="1"};_t.prototype._hasNonPartChild=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isVertex(o)&&this.model.isVisible(o)&&!this._isShapePart(o))return!0}return!1};_t.prototype._hasLayoutableEdge=function(n){if(typeof this.model.getEdgeCount!="function")return!1;var t=this.model.getEdgeCount(n);if(typeof this.model.getEdgeAt!="function")return t>0;for(var e=0;e<t;e++){var o=this.model.getEdgeAt(n,e);if(!(o==null||!this.model.isVisible(o))&&!(this.cellFilter!=null&&!this.cellFilter(o)))return!0}return!1};_t.prototype._convertPorts=function(n,t){var e=this.model.getChildCount(n);if(e!==0){for(var o=[],r=0;r<e;r++){var i=this.model.getChildAt(n,r);if(this._isPort(i)&&this.graph.getCellStyle(i).part!="1"&&this._hasLayoutableEdge(i)){var s=this._convertPort(i,n,t);s!=null&&(o.push(s),this._portCells.add(i.id))}}o.length>0&&(t.ports=o,t.layoutOptions=t.layoutOptions||{},t.layoutOptions["elk.portConstraints"]="FIXED_POS")}};_t.prototype._convertPort=function(n,t,e){var o=this.model.getGeometry(n),r=this.model.getGeometry(t);if(o==null||r==null)return null;var i="p"+n.id;this._cellToElk["p"+n.id]=i,this._elkToCell[i]=n;var s=e!=null&&e.width!=null?e.width:r.width,a=e!=null&&e.height!=null?e.height:r.height,l=o.x*s,c=o.y*a;o.offset&&(l+=o.offset.x,c+=o.offset.y);var g=this._inferPortSide(s>0?(l+o.width/2)/s:o.x,a>0?(c+o.height/2)/a:o.y),h=this.graph.getCellStyle(n);if(h.portConstraint){var d={north:"NORTH",south:"SOUTH",east:"EAST",west:"WEST",NORTH:"NORTH",SOUTH:"SOUTH",EAST:"EAST",WEST:"WEST"}[h.portConstraint];d&&(g=d)}return{id:i,x:l,y:c,width:o.width,height:o.height,layoutOptions:{"elk.port.side":g}}};_t.prototype._inferPortSide=function(n,t){if(t<=.01)return"NORTH";if(t>=.99)return"SOUTH";if(n<=.01)return"WEST";if(n>=.99)return"EAST";var e=t,o=1-t,r=n,i=1-n,s=Math.min(e,o,r,i);return s===e?"NORTH":s===o?"SOUTH":s===r?"WEST":"EAST"};_t.prototype._applyConnectionConstraints=function(n,t,e,o){var r=this.graph.getCellStyle(n);if(r[mxConstants.STYLE_EXIT_X]!=null&&r[mxConstants.STYLE_EXIT_Y]!=null){var i=parseFloat(r[mxConstants.STYLE_EXIT_X]),s=parseFloat(r[mxConstants.STYLE_EXIT_Y]);if(!isNaN(i)&&!isNaN(s)){var a=this._ensureConstraintPort(t,i,s);a!=null&&(o.sources=[a.id])}}if(r[mxConstants.STYLE_ENTRY_X]!=null&&r[mxConstants.STYLE_ENTRY_Y]!=null){var l=parseFloat(r[mxConstants.STYLE_ENTRY_X]),c=parseFloat(r[mxConstants.STYLE_ENTRY_Y]);if(!isNaN(l)&&!isNaN(c)){var a=this._ensureConstraintPort(e,l,c);a!=null&&(o.targets=[a.id])}}};_t.prototype._ensureConstraintPort=function(n,t,e,o,r,i){var s=this._cellToElkNode[n.id];if(s==null)return null;var a=this.model.getGeometry(n);if(a==null)return null;o=o||0,r=r||0;var l=n.id+"_"+t.toFixed(3)+"_"+e.toFixed(3)+"_"+o+"_"+r+(i!=null?"_"+i.side+i.jetty:"");if(this._constraintPorts[l]!=null)return this._constraintPorts[l];var c="cp"+ ++this._constraintPortCounter,g={id:c,x:t*(s.width!=null?s.width:a.width)+o,y:e*(s.height!=null?s.height:a.height)+r,width:1,height:1,layoutOptions:{"elk.port.side":this._inferPortSide(t,e)}};i!=null&&(g.layoutOptions["elk.port.borderOffset"]=String(i.jetty)),s.ports||(s.ports=[]),s.ports.push(g),s.layoutOptions=s.layoutOptions||{};var h=s.layoutOptions["elk.portConstraints"];return(h==null||h==="FIXED_SIDE")&&(s.layoutOptions["elk.portConstraints"]="FIXED_POS"),this._constraintPorts[l]=g,g};_t.prototype._anchoredPoint=function(n,t){var e=this.graph.getCellStyle(n)||{};if(e[t?"exitDx":"entryDx"]==null)return null;var o=parseFloat(e[t?"exitX":"entryX"]),r=parseFloat(e[t?"exitY":"entryY"]);return isNaN(o)||isNaN(r)?null:{x:o,y:r,dx:parseFloat(e[t?"exitDx":"entryDx"])||0,dy:parseFloat(e[t?"exitDy":"entryDy"])||0}};_t.prototype._markAnchoredEnd=function(n,t){var e=this._anchoredEnds[n];e==null&&(e={source:!1,target:!1},this._anchoredEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._markJettyEnd=function(n,t){var e=this._jettyEnds[n];e==null&&(e={source:!1,target:!1},this._jettyEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._jettyStubFor=function(n,t,e,o){if(this._edgeRouting!=="ORTHOGONAL")return null;var r=this.model.getGeometry(t);if(r==null||!(r.width>0)||!(r.height>0))return null;var i=e.x+e.dx/r.width,s=e.y+e.dy/r.height,a=.01,l=i<=a,c=i>=1-a,g=s<=a,h=s>=1-a;if(l+c+g+h!==1)return null;var d=this._jettyFor(this.graph.getCellStyle(n),o);return d>0?{side:g?"N":h?"S":l?"W":"E",jetty:d}:null};_t.prototype._jettyFor=function(n,t){if(n==null)return 0;var e=n[t?"sourceJettySize":"targetJettySize"];if(e==null&&(e=n.jettySize),e==null&&(e=10),e==="auto"){var o=n[t?"startArrow":"endArrow"];if(o!=null&&o!=="none"){var r=parseFloat(n[t?"startSize":"endSize"]);isNaN(r)&&(r=6),e=Math.max(2,Math.ceil((r+10)/10))*10}else e=20}return e=parseFloat(e),isNaN(e)?0:e};_t.prototype._maskJettyFor=function(n,t){if(this._edgeRouting!=="ORTHOGONAL")return null;var e=this.graph.getCellStyle(n);if(e==null||e.jettySize==null&&e[t?"sourceJettySize":"targetJettySize"]==null)return null;var o=this._jettyFor(e,t);return o>0?o:null};_t.prototype._portConstraintSides=function(n,t,e){var o=this.graph.getCellStyle(t)||{},r=this.graph.getCellStyle(n)||{},i=o.portConstraint;if(i==null&&(i=r[e?"sourcePortConstraint":"targetPortConstraint"]),i==null)return null;var s=String(i),a=0;if(o.portConstraintRotation==1){var l=parseFloat(o.rotation)||0;l>45?a=l>=135?2:1:l<-45&&(a=l<=-135?2:3)}for(var c=["NORTH","EAST","SOUTH","WEST"],g=["north","east","south","west"],h=[],d={},f=0;f<g.length;f++)if(s.indexOf(g[f])>=0){var E=c[(f+a)%4];d[E]||(d[E]=!0,h.push(E))}return h.length===0||h.length===4?null:h};_t.prototype._pickConstraintSide=function(n,t,e,o){if(n.length===1)return n[0];var r=function(E){return n.indexOf(E)>=0?E:null},i={RIGHT:["EAST","WEST"],LEFT:["WEST","EAST"],DOWN:["SOUTH","NORTH"],UP:["NORTH","SOUTH"]}[this._layoutDirection];if(i!=null){var s=r(o?i[0]:i[1]);if(s!=null)return s}var a=this._terminalCenter(t),l=this._terminalCenter(e);if(a!=null&&l!=null)for(var c=l.x-a.x,g=l.y-a.y,h=Math.abs(c)>=Math.abs(g)?[c>=0?"EAST":"WEST",g>=0?"SOUTH":"NORTH"]:[g>=0?"SOUTH":"NORTH",c>=0?"EAST":"WEST"],d=0;d<h.length;d++){var f=r(h[d]);if(f!=null)return f}return n[0]};_t.prototype._terminalCenter=function(n){var t=this.model.getGeometry(n);return t!=null&&!t.relative?{x:t.x+t.width/2,y:t.y+t.height/2}:null};_t.prototype._createMaskPort=function(n,t,e){var o=this._cellToElkNode[n.id];if(o==null)return null;var r=this.model.getGeometry(n),i=o.width!=null?o.width:r!=null?r.width:0,s=o.height!=null?o.height:r!=null?r.height:0,a={NORTH:{x:i/2,y:0},SOUTH:{x:i/2,y:s},WEST:{x:0,y:s/2},EAST:{x:i,y:s/2}}[t],l={id:"mp"+ ++this._maskPortCounter,x:a.x,y:a.y,width:1,height:1,layoutOptions:{"elk.port.side":t}};return e!=null&&(l.layoutOptions["elk.port.borderOffset"]=String(e)),o.ports||(o.ports=[]),o.ports.push(l),o.layoutOptions=o.layoutOptions||{},o.layoutOptions["elk.portConstraints"]==null&&(o.layoutOptions["elk.portConstraints"]="FIXED_SIDE"),l};_t.prototype._markMaskedEnd=function(n,t){var e=this._maskedEnds[n];e==null&&(e={source:!1,target:!1},this._maskedEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._portFixedPosFreeEnds=function(n){var t={RIGHT:["EAST","WEST"],LEFT:["WEST","EAST"],DOWN:["SOUTH","NORTH"],UP:["NORTH","SOUTH"]}[this._layoutDirection]||["EAST","WEST"],e=[];(function j(X){e.push(X);for(var tt=X.children||[],ot=0;ot<tt.length;ot++)j(tt[ot])})(n);for(var o={},r={},i=0;i<e.length;i++){var s=e[i].layoutOptions;e[i]!==n&&s!=null&&s["elk.portConstraints"]==="FIXED_POS"&&(o[e[i].id]=e[i]);var a=e[i].ports;if(a!=null)for(var l=0;l<a.length;l++)r[a[l].id]=e[i].id}for(var c={},g=[],i=0;i<e.length;i++){var h=e[i].edges;if(h!=null)for(var d=0;d<h.length;d++)for(var f=0;f<2;f++){var E=f===0?"sources":"targets",P=o[h[d][E][0]];if(P!=null){var S=t[f],T=P.id+"|"+S,N=c[T];N==null&&(N={node:P,side:S,ends:[]},c[T]=N,g.push(N)),N.ends.push({edge:h[d],key:E,other:h[d][f===0?"targets":"sources"][0]})}}}for(var i=0;i<g.length;i++){var N=g[i],I=this._elkToCell[N.node.id],C=I!=null?this.model.getGeometry(I):null,x=N.node.width!=null?N.node.width:C!=null?C.width:0,M=N.node.height!=null?N.node.height:C!=null?C.height:0;if(N.ends.length>1){for(var d=0;d<N.ends.length;d++)N.ends[d].order=d,N.ends[d].cross=this._endCrossCoord(N.ends[d].other,N.side,r);N.ends.sort(function(tt,ot){return tt.cross!=null&&ot.cross!=null&&tt.cross!==ot.cross?tt.cross-ot.cross:tt.order-ot.order})}for(var d=0;d<N.ends.length;d++){var A=(d+1)/(N.ends.length+1),B={NORTH:{x:x*A,y:0},SOUTH:{x:x*A,y:M},WEST:{x:0,y:M*A},EAST:{x,y:M*A}}[N.side],Y={id:"fp"+ ++this._freeEndPortCounter,x:B.x,y:B.y,width:1,height:1,layoutOptions:{"elk.port.side":N.side}};N.node.ports||(N.node.ports=[]),N.node.ports.push(Y),N.ends[d].edge[N.ends[d].key]=[Y.id]}}};_t.prototype._endCrossCoord=function(n,t,e){var o=e[n]!=null?e[n]:n,r=this._elkToCell[o];if(r==null)return null;var i=this.model.getGeometry(r);if(i==null)return null;for(var s=i.x+i.width/2,a=i.y+i.height/2,l=this.model.getParent(r);l!=null&&this.model.isVertex(l);){var c=this.model.getGeometry(l);c!=null&&(s+=c.x,a+=c.y),l=this.model.getParent(l)}return t==="EAST"||t==="WEST"?a:s};_t.prototype._getCellLabel=function(n){var t=this.graph.getLabel(n);if(t!=null&&typeof t=="string"&&t.length>0){var e=t.replace(/<[^>]*>/g,"");return e.length>0?e:null}return null};_t.prototype._measureLabel=function(n,t){if(typeof mxUtils!="undefined"&&mxUtils.getSizeForString){var e=t[mxConstants.STYLE_FONTSIZE]?parseInt(t[mxConstants.STYLE_FONTSIZE]):null,o=t[mxConstants.STYLE_FONTFAMILY]||null,r=t[mxConstants.STYLE_FONTSTYLE]?parseInt(t[mxConstants.STYLE_FONTSTYLE]):null,i=mxUtils.getSizeForString(n,e,o,null,r);return{width:i.width+2,height:i.height+2}}return{width:n.length*7,height:14}};_t.prototype._getVertexLabels=function(n){var t=this._getCellLabel(n);if(t==null)return[];var e=this.graph.getCellStyle(n),o="INSIDE V_CENTER H_CENTER";e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]==="bottom"?o="OUTSIDE V_BOTTOM H_CENTER":e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]==="top"?o="OUTSIDE V_TOP H_CENTER":e[mxConstants.STYLE_LABEL_POSITION]==="left"?o="OUTSIDE V_CENTER H_LEFT":e[mxConstants.STYLE_LABEL_POSITION]==="right"?o="OUTSIDE V_CENTER H_RIGHT":e.verticalAlign==="top"?o="INSIDE V_TOP H_CENTER":e.verticalAlign==="bottom"&&(o="INSIDE V_BOTTOM H_CENTER");var r=this._measureLabel(t,e);return[{text:t,width:r.width,height:r.height,layoutOptions:{"elk.nodeLabels.placement":o}}]};_t.prototype._getEdgeLabels=function(n){var t=[],e=this.graph.getCellStyle(n),o=this._getCellLabel(n);if(o!=null){var r=this._measureLabel(o,e),i={"elk.edgeLabels.placement":"CENTER"};this._edgeLabelsInline&&(i["elk.edgeLabels.inline"]="true"),t.push({text:o,width:r.width+4,height:r.height+14,layoutOptions:i})}return t};_t.prototype._getGroupPadding=function(n){var t=this.graph.getCellStyle(n),e=wo(this.model,n),o=t[mxConstants.STYLE_SHAPE]==="swimlane"||t.swimlane!=null,r=t.container==="1",i=Bf(t.groupPadding);if(i==null&&!e&&(i=Bf(this.groupPadding)),i==null&&(i=e?{top:0,right:0,bottom:0,left:0}:{top:o||r?10:20,right:10,bottom:10,left:10}),o||r&&!e){var s=parseInt(t[mxConstants.STYLE_STARTSIZE],10);isNaN(s)&&(s=e?40:r?20:30),t.horizontal==0||t.horizontal==="0"?i.left+=s:i.top+=s}var a=parseInt(t.footerSize,10);return!isNaN(a)&&a>0&&(o&&(t.horizontal==0||t.horizontal==="0")?i.right+=a:i.bottom+=a),{top:i.top,left:i.left,bottom:i.bottom,right:i.right}};_t.prototype._hasLayoutableChildren=function(n){var t=this.graph.getCellStyle(n);if(t.childLayout!=null)return!1;for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isVertex(r)&&this.model.isVisible(r)&&!this._isShapePart(r))return this._subtreeHasEdge(n)}return!1};_t.prototype._subtreeHasEdge=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isEdge(o))return!0;if(!(this.model.isVertex(o)&&this._isShapePart(o))&&(this.model.isVertex(o)&&typeof this.model.getEdgeCount=="function"&&this.model.getEdgeCount(o)>0||this._subtreeHasEdge(o)))return!0}return!1};_t.prototype._inferEdgeRouting=function(n){var t={orthogonal:0,spline:0,other:0};return this._countEdgeStyles(n,t),t.spline>t.orthogonal&&t.spline>t.other?"SPLINES":t.orthogonal>t.other?"ORTHOGONAL":null};_t.prototype._countEdgeStyles=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isEdge(r)&&this.model.isVisible(r)){var i=this.graph.getCellStyle(r);i[mxConstants.STYLE_CURVED]==="1"?t.spline++:i[mxConstants.STYLE_EDGE]==="orthogonalEdgeStyle"||i[mxConstants.STYLE_EDGE]==="elbowEdgeStyle"||i[mxConstants.STYLE_EDGE]==="entityRelationEdgeStyle"?t.orthogonal++:t.other++}this.model.isVertex(r)&&this.model.getChildCount(r)>0&&this._countEdgeStyles(r,t)}};ht.DEFAULTS={layered:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":"30","elk.layered.spacing.nodeNodeBetweenLayers":"30","elk.edgeLabels.inline":"true","elk.spacing.edgeLabel":"5","elk.layered.cycleBreaking.strategy":"DEPTH_FIRST","elk.layered.considerModelOrder.strategy":"NODES","elk.layered.crossingMinimization.forceNodeModelOrder":"true"},mrtree:{"elk.algorithm":"mrtree","elk.direction":"DOWN","elk.spacing.nodeNode":"20","elk.spacing.edgeNode":"10","elk.mrtree.weighting":"MODEL_ORDER"},force:{"elk.algorithm":"force","elk.spacing.nodeNode":"10","elk.force.iterations":"300","elk.force.repulsivePower":"0"},stress:{"elk.algorithm":"stress","elk.spacing.nodeNode":"80","elk.stress.desiredEdgeLength":"100"},radial:{"elk.algorithm":"radial","elk.spacing.nodeNode":"20","elk.edgeRouting":"POLYLINE"},routing:{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.interactive":"true","elk.layered.cycleBreaking.strategy":"INTERACTIVE","elk.layered.layering.strategy":"INTERACTIVE","elk.layered.crossingMinimization.strategy":"INTERACTIVE","elk.layered.nodePlacement.strategy":"INTERACTIVE","elk.layered.crossingMinimization.greedySwitch.type":"OFF","elk.layered.crossingMinimization.greedySwitchHierarchical.type":"OFF","elk.spacing.nodeNode":"30","elk.layered.spacing.nodeNodeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"20","elk.edgeLabels.inline":"true","elk.spacing.edgeLabel":"5"}};ht.MENU_PRESETS={verticalFlow:{algorithm:"layered",options:{"elk.direction":"DOWN"}},horizontalFlow:{algorithm:"layered",options:{"elk.direction":"RIGHT"}},verticalTree:{algorithm:"mrtree",options:{"elk.direction":"DOWN"}},horizontalTree:{algorithm:"mrtree",options:{"elk.direction":"RIGHT"}},radialTree:{algorithm:"radial",options:null},organic:{algorithm:"force",options:null}};ht.CANONICAL_EDGE={edgeStyleMode:"orthogonalEdgeStyle",corners:"rounded"};function ht(n,t,e,o){this.graph=n,this.algorithm=t||"layered",this.layoutOptions=e||{},this.edgeStyleMode=o!=null&&o.edgeStyleMode||"auto",this.corners=o!=null&&o.corners||"keep",this.enforceCorners=o==null||o.enforceCorners!==!1,this.applierOptions=o!=null&&o.applierOptions||null,this.useViewStateSizing=o==null||o.useViewStateSizing!==!1,this.respectFixedPosition=o==null||o.respectFixedPosition!==!1,o!=null&&o.rootCellIds!=null&&o.rootCellIds.length>0?this.rootCellIds=o.rootCellIds.slice():o!=null&&o.rootCellId!=null?this.rootCellIds=[o.rootCellId]:this.rootCellIds=null,this.cellFilter=o!=null&&typeof o.cellFilter=="function"?o.cellFilter:null,this._effectiveCellFilter=this.cellFilter,this.includeEdgeLabels=!(o!=null&&o.includeEdgeLabels===!1),this.includeCompoundLabels=null,o!=null&&o.includeVertexLabels!=null?this.includeVertexLabels=o.includeVertexLabels!==!1:o!=null&&o.applierOptions!=null&&o.applierOptions.resizeParent===!1?(this.includeVertexLabels=!1,this.includeCompoundLabels=!0):this.includeVertexLabels=!0,this.portSpread=o!=null&&o.portSpread===!0,o!=null&&o.mermaidPolicy===!1?this.mermaidPolicy=!1:this.mermaidPolicy=this.algorithm==="layered",this.preserveOrigin=o!=null&&o.preserveOrigin===!0,this.resizeLayoutRoot=o!=null&&o.resizeLayoutRoot===!0,this.extractIsolated=o==null||o.extractIsolated!==!1,this.sharedStems=o==null||o.sharedStems!==!1,this.nonTreeEdges=o!=null&&o.nonTreeEdges==="elk"?"elk":"route",this.siblingOrder=o!=null&&o.siblingOrder==="model"?"model":"geometry",this.groupPadding=o!=null&&o.groupPadding!=null?o.groupPadding:null}ht.prototype.moveCell=function(){};ht.prototype.resizeCell=function(){};ht.prototype.canRouteNonTreeEdges=function(n,t){return!1};ht.prototype.routeNonTreeEdges=function(n,t){};ht.componentScopeFilter=function(n,t,e){var o={},r;for(r=0;r<e.length;r++)o[String(e[r])]=!0;var i={},s=[],a=function(E){for(var P=n.getChildCount(E),S=0;S<P;S++){var T=n.getChildAt(E,S);if(T.id!=null&&o[String(T.id)]===!0&&s.push(T),n.isEdge(T)){var N=n.getTerminal(T,!0),I=n.getTerminal(T,!1);N!=null&&N.id!=null&&(i[N.id]=i[N.id]||[]).push(T),I!=null&&I.id!=null&&I!==N&&(i[I.id]=i[I.id]||[]).push(T)}a(T)}};if(a(t),s.length===0)return null;var l={},c=[],g=function(E){for(;E!=null&&E!==t&&(n.isVertex(E)||n.isEdge(E));){if(E.id==null||l[E.id]===!0)return;l[E.id]=!0,c.push(E),E=n.getParent(E)}};for(r=0;r<s.length;r++)g(s[r]);for(;c.length>0;){var h=c.pop();n.isEdge(h)&&(g(n.getTerminal(h,!0)),g(n.getTerminal(h,!1)));var d=h.id!=null?i[h.id]:null;if(d!=null)for(r=0;r<d.length;r++)g(d[r]);var f=n.getChildCount(h);for(r=0;r<f;r++)g(n.getChildAt(h,r))}return function(E){for(;E!=null&&E!==t;){if(E.id!=null&&l[E.id]===!0)return!0;E=n.getParent(E)}return!1}};ht.prototype.execute=function(n,t){var e=this.graph.getModel();this.prepare(n,function(o,r){if(o!=null){t!=null?t(o):typeof console!="undefined"&&console.error&&console.error("ElkLayout.execute failed:",o);return}e.beginUpdate();try{r()}finally{e.endUpdate()}t!=null&&t(null)})};ht.prototype.prepare=function(n,t){var e=this,o=this._convertGraph(n);ht.getElk(function(r,i){if(i!=null){t(i);return}r.layout(o.elkGraph).then(function(s){t(null,function(){e._applyResult(n,o,s)})},function(s){t(s)})})};ht.prototype.executeSync=function(n){var t=ht.getElkSync();if(t==null)throw new Error("No synchronous ELK engine available \u2014 use prepare()/execute().");var e=this._convertGraph(n),o=t.layoutSync(e.elkGraph),r=this.graph.getModel();r.beginUpdate();try{this._applyResult(n,e,o)}finally{r.endUpdate()}};ht.prototype.canExecuteSync=function(){return ht.getElkSync()!=null};ht.prototype._convertGraph=function(n){var t=ht.DEFAULTS[this.algorithm]||{},e={};for(var o in t)e[o]=t[o];for(var o in this.layoutOptions)e[o]=this.layoutOptions[o];var r=new _t(this.graph);r.rootCellIds=this.rootCellIds,r.useViewStateSizing=this.useViewStateSizing,r.respectFixedPosition=this.respectFixedPosition;var i=this.cellFilter;i==null&&this.rootCellIds!=null&&this.rootCellIds.length>0&&(i=ht.componentScopeFilter(this.graph.getModel(),n,this.rootCellIds)),this._effectiveCellFilter=i,r.cellFilter=i,r.includeEdgeLabels=this.includeEdgeLabels,r.includeVertexLabels=this.includeVertexLabels,r.includeCompoundLabels=this.includeCompoundLabels,r.groupPadding=this.groupPadding;var s=r.convert(n,e);this.mermaidPolicy&&ht.applyMermaidElkPolicy(s);var a=[];this.algorithm==="layered"&&this.extractIsolated&&(a=ht.extractIsolatedTopLevel(s)||[]);var l=r.getElkToCellMap(),c=[];if(this.algorithm==="mrtree"&&this.nonTreeEdges!=="elk")for(var g=ht.extractNonTreeEdges(s,e["elk.mrtree.searchOrder"]),h=0;h<g.length;h++){var d=l[g[h].id];d!=null&&(c.push(d),delete l[g[h].id])}return this.algorithm==="mrtree"&&this.siblingOrder!=="model"&&this.layoutOptions["elk.mrtree.weighting"]==null&&ht.stampSiblingOrderConstraints(s,l,this.graph,e["elk.direction"],e["elk.mrtree.searchOrder"]),{mergedOptions:e,elkGraph:s,elkToCellMap:l,portCells:r.getPortCells(),reversedEdges:r.getReversedEdges(),climbedEnds:r.getClimbedEnds(),maskedEnds:r.getMaskedEnds(),anchoredEnds:r.getAnchoredEnds(),jettyEnds:r.getJettyEnds(),isolatedNodes:a,nonTreeEdges:c}};ht._walkTreeStructure=function(n,t){var e={},o=[],r=function(S,T){if(e[S.id]={node:S,parent:T,outDirect:[],outPort:[],treeChildren:[]},S.ports!=null)for(var N=0;N<S.ports.length;N++)e[S.ports[N].id]=e[S.id];if(S.children!=null&&S.children.length>0){o.push(S);for(var I=0;I<S.children.length;I++)r(S.children[I],S)}};r(n,null);var i=function(S){if(S.edges!=null)for(var T=0;T<S.edges.length;T++){var N=S.edges[T],I=N.sources!=null?e[N.sources[0]]:null,C=N.targets!=null?e[N.targets[0]]:null;if(!(I==null||C==null||I===C||I.parent==null||I.parent!==C.parent)){var x={edge:N,container:S,target:C};N.sources[0]===I.node.id?I.outDirect.push(x):I.outPort.push(x)}}if(S.children!=null)for(var M=0;M<S.children.length;M++)i(S.children[M])};i(n);for(var s=[],a=t==="BFS",l=0;l<o.length;l++)for(var c=o[l].children,g={},h=function(S){return S.outDirect.concat(S.outPort)},d=function(S){g[S.node.id]=1;for(var T=h(S),N=0;N<T.length;N++){var I=T[N].target;g[I.node.id]===1?s.push(T[N]):g[I.node.id]===2?(g[I.node.id]=1,S.treeChildren.push(I)):(S.treeChildren.push(I),d(I))}},f=function(S){for(var T=[S];T.length>0;){var N=T.shift();g[N.node.id]=1;for(var I=h(N),C=0;C<I.length;C++){var x=I[C].target;g[x.node.id]===1?s.push(I[C]):g[x.node.id]===2?(g[x.node.id]=1,N.treeChildren.push(x)):(N.treeChildren.push(x),T.push(x))}}},E=0;E<c.length;E++){var P=e[c[E].id];g[P.node.id]==null&&(a?f(P):d(P),g[P.node.id]=2)}return{levels:o,nodeMeta:e,eliminated:s}};ht.extractNonTreeEdges=function(n,t){for(var e=ht._walkTreeStructure(n,t),o=[],r=0;r<e.eliminated.length;r++){var i=e.eliminated[r],s=i.container.edges.indexOf(i.edge);s>=0&&(i.container.edges.splice(s,1),o.push(i.edge))}return o};ht.stampSiblingOrderConstraints=function(n,t,e,o,r){for(var i=e.getModel(),s=!(o==="RIGHT"||o==="LEFT"),a=ht._walkTreeStructure(n,r),l=function(I){var C=t[I.id],x=C!=null?i.getGeometry(C):null;if(x==null)return 0;var M=wo(i,C)?fi(e,C):null;return s?(x.x||0)+(M!=null?M.x:0)+(M!=null?M.width:x.width||0)/2:(x.y||0)+(M!=null?M.y:0)+(M!=null?M.height:x.height||0)/2},c=0;c<a.levels.length;c++){var g=a.levels[c];g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.mrtree.weighting"]="CONSTRAINT"}var h={};for(var d in a.nodeMeta){var f=a.nodeMeta[d];if(!(f.node.id!==d||f.treeChildren.length===0)){for(var E=[],P=0;P<f.treeChildren.length;P++){var S=f.treeChildren[P].node;h[S.id]||(h[S.id]=!0,E.push({node:S,idx:E.length,coord:l(S)}))}E.sort(function(I,C){return I.coord-C.coord||I.idx-C.idx});for(var T=0;T<E.length;T++){var N=E[T].node;N.layoutOptions=N.layoutOptions||{},N.layoutOptions["elk.mrtree.positionConstraint"]=String(T)}}}};ht.collapseTreeStems=function(n,t){var e={},o;if(n.children!=null)for(o=0;o<n.children.length;o++)e[n.children[o].id]=n.children[o];if(n.edges!=null)for(o=0;o<n.edges.length;o++){var r=n.edges[o],i=r.sources!=null?e[r.sources[0]]:null,s=r.sections!=null&&r.sections.length>0?r.sections[0]:null;if(!(i==null||s==null||s.startPoint==null||s.bendPoints==null||s.bendPoints.length===0)){var a=s.bendPoints[0];if(t&&s.startPoint.y===a.y){var l=i.y+i.height/2;s.startPoint.y=l,a.y=l}else if(!t&&s.startPoint.x===a.x){var c=i.x+i.width/2;s.startPoint.x=c,a.x=c}var g=r.targets!=null?e[r.targets[0]]:null;if(!(g==null||s.endPoint==null)){var h=s.bendPoints,d=h[h.length-1];if(t){var f=g.y+g.height/2;s.endPoint.y===f&&d.y!==f&&(h.length>=2?d.y=f:h.push({x:d.x,y:f}))}else{var E=g.x+g.width/2;s.endPoint.x===E&&d.x!==E&&(h.length>=2?d.x=E:h.push({x:E,y:d.y}))}}}}if(n.children!=null)for(o=0;o<n.children.length;o++)ht.collapseTreeStems(n.children[o],t)};ht.prototype._applyResult=function(n,t,e){var o=this.graph,r=o.getModel(),i=t.mergedOptions,s=t.elkToCellMap,a=n!=null&&r.isVertex(n)&&wo(r,n),l=this.preserveOrigin||a,c=l&&t.isolatedNodes.length>0,g=l?ul(r,n,this._effectiveCellFilter):null,h=0,d=0;if(l&&!c&&g!=null){var f=cp(o,e,s);f!=null&&(h=g.x-f.x,d=g.y-f.y)}var E=new Zi(o),P=i["elk.edgeRouting"],S=this.algorithm==="layered"||this.algorithm==="mrtree",T=this.edgeStyleMode;T==="auto"&&(T=S&&P!=="POLYLINE"&&P!=="SPLINES"?"orthogonal":"straight");var N=t.nonTreeEdges!=null&&t.nonTreeEdges.length>0?new Set(t.nonTreeEdges):null,I=N!=null&&this.canRouteNonTreeEdges(n,t.nonTreeEdges);if(T!=="keep"){var C=new Set;for(var x in s){var M=s[x];M!=null&&r.isEdge(M)&&C.add(M)}I&&N.forEach(function(zt){C.add(zt)}),this._applyEdgeStyle(n,T,this.corners,C,E,N)}else if(N!=null&&!I){var A=this;N.forEach(function(zt){A.graph.resetEdge(zt)})}this.algorithm==="mrtree"&&this.sharedStems&&!this.portSpread&&ht.collapseTreeStems(e,i["elk.direction"]==="RIGHT"||i["elk.direction"]==="LEFT");var B={resizeParent:!0,applyEdgeRouting:this.edgeStyleMode!=="keep",resetEdgePoints:!0,orthogonalRouting:T!=="straight"&&P!=="POLYLINE"&&P!=="SPLINES",edgeStyleMode:T,portSpread:this.portSpread};if(this.applierOptions!=null)for(var Y in this.applierOptions)B[Y]=this.applierOptions[Y];B.reversedEdges=t.reversedEdges,B.climbedEnds=t.climbedEnds,B.maskedEnds=t.maskedEnds,B.anchoredEnds=t.anchoredEnds,B.jettyEnds=t.jettyEnds,B.styleBatch=E;var j=new Rt(o,s,t.portCells,B);if(j.apply(e,h,d),t.isolatedNodes.length>0&&ht.placeIsolatedTopLevelAbove(o,r,s,t.isolatedNodes,t.elkGraph.children,n,this._effectiveCellFilter),this.resizeLayoutRoot&&!a&&e.width!=null&&e.height!=null&&n!=null&&r.isVertex(n)){var X=r.getGeometry(n),tt=Math.round(e.width),ot=Math.round(e.height);X!=null&&(X.width!==tt||X.height!==ot)&&(X=X.clone(),X.width=tt,X.height=ot,r.setGeometry(n,X))}if(I&&this.routeNonTreeEdges(n,t.nonTreeEdges),c&&g!=null){var Lt=ul(r,n,this._effectiveCellFilter);Lt!=null&&pa(r,n,g.x-Lt.x,g.y-Lt.y,this._effectiveCellFilter)}};ht.prototype._applyEdgeStyle=function(n,t,e,o,r,i){var s=this.graph.getModel();this._applyEdgeStyleRecursive(n,s,t,e,o,r,i)};ht.prototype._applyEdgeStyleRecursive=function(n,t,e,o,r,i,s){for(var a=t.getChildCount(n),l=0;l<a;l++){var c=t.getChildAt(n,l);if(t.isEdge(c)&&t.isVisible(c)&&(this._effectiveCellFilter==null||this._effectiveCellFilter(c))){(r==null||!r.has(c))&&this.graph.resetEdge(c);var g=s!=null&&s.has(c)?"orthogonalEdgeStyle":e;g==="orthogonalEdgeStyle"?(i.set(c,mxConstants.STYLE_NOEDGESTYLE,null),i.set(c,mxConstants.STYLE_ORTHOGONAL,null),i.set(c,mxConstants.STYLE_EDGE,mxConstants.EDGESTYLE_ORTHOGONAL)):g==="elkCompat"?(i.set(c,mxConstants.STYLE_NOEDGESTYLE,"1"),i.set(c,mxConstants.STYLE_ORTHOGONAL,null),i.set(c,mxConstants.STYLE_EDGE,null)):(i.set(c,mxConstants.STYLE_NOEDGESTYLE,"1"),i.set(c,mxConstants.STYLE_ORTHOGONAL,g==="orthogonal"?"1":null),i.set(c,mxConstants.STYLE_EDGE,null)),o!=="keep"&&(this.enforceCorners||!gp(i.get(c),mxConstants.STYLE_CURVED))&&(i.set(c,mxConstants.STYLE_ROUNDED,o==="rounded"?"1":"0"),i.set(c,mxConstants.STYLE_CURVED,o==="curved"?"1":"0"));var h=i.get(c);gp(h,"exitDx")||(i.set(c,mxConstants.STYLE_EXIT_X,null),i.set(c,mxConstants.STYLE_EXIT_Y,null)),gp(h,"entryDx")||(i.set(c,mxConstants.STYLE_ENTRY_X,null),i.set(c,mxConstants.STYLE_ENTRY_Y,null))}t.isVertex(c)&&t.getChildCount(c)>0&&!c.collapsed&&this.graph.getCellStyle(c).childLayout==null&&this._applyEdgeStyleRecursive(c,t,e,o,r,i,s)}};function gp(n,t){return n!=null&&(n.substring(0,t.length+1)===t+"="||n.indexOf(";"+t+"=")>=0)}ht.applyCorners=function(n,t,e){if(!(e==null||e==="keep")){var o=n.getModel(),r=new Zi(n),i=function(s){for(var a=o.getChildCount(s),l=0;l<a;l++){var c=o.getChildAt(s,l);o.isEdge(c)&&o.isVisible(c)&&(r.set(c,mxConstants.STYLE_ROUNDED,e==="rounded"?"1":"0"),r.set(c,mxConstants.STYLE_CURVED,e==="curved"?"1":"0")),o.isVertex(c)&&o.getChildCount(c)>0&&!c.collapsed&&n.getCellStyle(c).childLayout==null&&i(c)}};i(t),r.flush()}};ht._elk=null;ht.getElkSync=function(){if(ht._elk!=null)return typeof ht._elk.layoutSync=="function"?ht._elk:null;if(typeof globalThis.ELK=="undefined"||globalThis.ELK==null||globalThis.ELK.prototype==null||typeof globalThis.ELK.prototype.layoutSync!="function")return null;try{return ht._elk=new globalThis.ELK,ht._elk}catch(n){return null}};ht.getElk=function(n){if(ht._elk!=null){n(ht._elk,null);return}if(typeof globalThis.ELK=="undefined"||globalThis.ELK==null){n(null,new Error("ELK engine not loaded \u2014 drawio-mermaid bundle must be included first."));return}try{ht._elk=new globalThis.ELK,n(ht._elk,null)}catch(t){n(null,t)}};ht.applyMermaidElkPolicy=function(n){var t={},e={},o={};function r(g,h){if(t[g.id]=g,e[g.id]=h,g.ports)for(var d=0;d<g.ports.length;d++)o[g.ports[d].id]=g;if(g.children)for(var f=0;f<g.children.length;f++)r(g.children[f],g)}r(n,null);function i(g){return t[g]!=null?t[g]:o[g]!=null?o[g]:null}n.layoutOptions=n.layoutOptions||{},n.layoutOptions["spacing.baseValue"]==null&&(n.layoutOptions["spacing.baseValue"]=35),n.layoutOptions["elk.layered.unnecessaryBendpoints"]==null&&(n.layoutOptions["elk.layered.unnecessaryBendpoints"]="true"),delete n.layoutOptions["elk.layered.crossingMinimization.forceNodeModelOrder"],delete n.layoutOptions["elk.layered.considerModelOrder.strategy"];function s(g){if(g!==n&&g.children!=null&&g.children.length>0&&(g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.hierarchyHandling"]==null&&(g.layoutOptions["elk.hierarchyHandling"]="SEPARATE_CHILDREN"),g.layoutOptions["spacing.baseValue"]==null&&(g.layoutOptions["spacing.baseValue"]=30),g.layoutOptions["nodeLabels.placement"]==null&&(g.layoutOptions["nodeLabels.placement"]="[H_CENTER V_TOP, INSIDE]"),delete g.width,delete g.height,delete g.layoutOptions["elk.nodeSize.constraints"],delete g.layoutOptions["elk.nodeSize.minimum"]),g.children)for(var h=0;h<g.children.length;h++)s(g.children[h])}s(n);function a(g,h){for(var d={},f=g;f!=null;)d[f.id]=f,f=e[f.id];for(f=h;f!=null;){if(d[f.id]!=null)return f;f=e[f.id]}return null}function l(g,h){for(var d=g;d!=null&&(d.children!=null&&d.children.length>0&&(d.layoutOptions=d.layoutOptions||{},d.layoutOptions["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),d!==h);)d=e[d.id]}function c(g){if(g.edges)for(var h=0;h<g.edges.length;h++){var d=g.edges[h],f=d.sources!=null?d.sources[0]:null,E=d.targets!=null?d.targets[0]:null,P=f!=null?i(f):null,S=E!=null?i(E):null;if(!(P==null||S==null)&&e[P.id]!==e[S.id]){var T=a(P,S);T!=null&&(l(P,T),l(S,T))}}if(g.children)for(var h=0;h<g.children.length;h++)c(g.children[h])}c(n)};ht.extractIsolatedTopLevel=function(n){if(n==null||n.children==null||n.children.length<2)return[];var t={};if(n.edges!=null)for(var e=0;e<n.edges.length;e++){var o=n.edges[e];if(o.sources!=null)for(var r=0;r<o.sources.length;r++)t[o.sources[r]]=!0;if(o.targets!=null)for(var i=0;i<o.targets.length;i++)t[o.targets[i]]=!0}for(var s=[],a=[],e=0;e<n.children.length;e++){var l=n.children[e],c=l.children!=null&&l.children.length>0,g=!1;if(l.ports!=null){for(var h=0;h<l.ports.length;h++)if(t[l.ports[h].id]){g=!0;break}}c||t[l.id]||g?s.push(l):a.push(l)}return a.length===0||s.length===0?[]:(n.children=s,a)};ht.placeIsolatedTopLevelAbove=function(n,t,e,o,r,i,s){if(!(o==null||o.length===0)&&!(e==null||r==null)){for(var a=1/0,l=1/0,c=-1/0,g=0;g<r.length;g++){var h=e[r[g].id];if(h!=null){var d=t.getGeometry(h);d!=null&&(d.x<a&&(a=d.x),d.y<l&&(l=d.y),d.x+d.width>c&&(c=d.x+d.width))}}if(a!==1/0){for(var f=c-a,E=30,P=10,S=0,g=0;g<o.length;g++)S+=o[g].height||30,g>0&&(S+=P);var T=S+E,N=Math.max(0,T-l);if(N>0){for(var I={},g=0;g<o.length;g++){var C=o[g],x=e[C.id];x!=null&&(I[x.id]=!0)}for(var M=i!=null?i:n.getDefaultParent(),A=t.getChildCount(M),g=0;g<A;g++){var B=t.getChildAt(M,g);if(!(B==null||I[B.id])&&!(s!=null&&!s(B))){var Y=t.getGeometry(B);if(Y!=null){if(t.isVertex(B))if(wo(t,B))pa(t,B,0,N);else{var j=Y.clone();j.y=Y.y+N,t.setGeometry(B,j)}else if(t.isEdge(B)&&Y.points!=null&&Y.points.length>0){var j=Y.clone();j.points=[];for(var X=0;X<Y.points.length;X++){var tt=Y.points[X];j.points.push(new mxPoint(tt.x,tt.y+N))}t.setGeometry(B,j)}}}}}for(var ot=l+N-S-E,g=0;g<o.length;g++){var C=o[g],x=e[C.id];if(x!=null){var Lt=t.getGeometry(x);if(Lt!=null){if(wo(t,x)){var zt=fi(n,x);if(zt!=null){var be=Math.min(zt.width,f);pa(t,x,a+(f-be)/2-(Lt.x+zt.x),ot-(Lt.y+zt.y)),ot+=zt.height+P}continue}var mr=C.width||Lt.width||100,Ea=C.height||Lt.height||30;mr>f&&(mr=f);var Pr=Lt.clone();Pr.x=a+(f-mr)/2,Pr.y=ot,Pr.width=mr,Pr.height=Ea,t.setGeometry(x,Pr),ot+=Ea+P}}}}}};ht.Adapter=_t;ht.Applier=Rt;hs.setCoreOptions(wt);var NO=!1;function Uf(){NO||(SO(),pE(),OE(),IE(),vE(),$E(),cm(),eE(),NO=!0)}function yO(n,t){gs(n,t,!1);for(let e of n.getLabels())gs(e,t,!1);for(let e of n.getPorts()){gs(e,t,!1);for(let o of e.getLabels())gs(o,t,!1)}for(let e of n.getContainedEdges()){gs(e,t,!1);for(let o of e.getLabels())gs(o,t,!1)}for(let e of n.getChildren())yO(e,t)}var _l=class{constructor(t={}){this.defaultLayoutOptions=t.defaultLayoutOptions||{},Uf()}layoutSync(t,e={}){let o=e.layoutOptions!==void 0?e.layoutOptions:this.defaultLayoutOptions,r={value:null},i=Bl.forGraph(t).rememberImporter(r).toElk();o!=null&&typeof o=="object"&&Object.keys(o).length>0&&yO(i,o);let s=e.progressMonitor||new zl;return new Wl().layout(i,s),r.value.transferLayout(i),t}layout(t,e={}){return new Promise((o,r)=>{try{o(this.layoutSync(t,e))}catch(i){r(i)}})}knownLayoutOptions(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getOptionDataAll().map(e=>({id:e.getId(),name:e.getName()||"",description:e.getDescription()||"",group:e.getGroup()||"",type:e.getType()||"",targets:e.getTargets()?Array.from(e.getTargets()):[]})))}knownLayoutAlgorithms(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getAlgorithmDataAll().map(e=>({id:e.getId(),name:e.getName()||"",description:e.getDescription()||"",knownOptions:Array.from(e.getKnownOptionIds())})))}knownLayoutCategories(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getCategoryDataAll().map(e=>({id:e.getId(),name:e.getName()||"",knownLayouters:e.getLayouters().map(o=>o.getId())})))}terminateWorker(){}};var xR=_l;return MO(DR);})();
+`)}save(t){}isave(t){this._index++}};function ug(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var _g=class n{static compact(t,e,o=null){let r={root:t,orthogonal:e};n._compactTree(t,r)}static _compactTree(t,e){for(let o of t.children)n._compactTree(o,e);for(let o of t.children){let r=t.node.vertex.clone().sub(o.node.vertex);if(e.orthogonal){let s=t.node.rect,a=o.node.rect;Math.abs(r.x)>=Math.abs(r.y)?(r.y=0,a.y+a.height>s.y&&a.y<s.y+s.height&&r.scaleToLength(Math.max(s.x-(a.x+a.width),a.x-(s.x+s.width)))):(r.x=0,a.x+a.width>s.x&&a.x<s.x+s.width&&r.scaleToLength(Math.max(s.y-(a.y+a.height),a.y-(s.y+s.height))))}else r.scaleToLength(t.node.underlap(o.node));let i=r.length();i=n._getMinUnderlap(e.root,o,i,r),r.scaleToLength(i),n._translateSubtree(o,r)}}static _getMinUnderlap(t,e,o,r){let i=Math.min(o,n._minUnderlapWithSubtree(t.node,e,o,r));for(let s of t.children)s!==e&&(i=Math.min(i,n._getMinUnderlap(s,e,i,r)));return i}static _minUnderlapWithSubtree(t,e,o,r){let i=o,s=oe.FUZZINESS;for(let a of e.children){let l=a.node;if(t.touches(l)){if(ug(l.rect.x,t.rect.x+t.rect.width,s)===0&&r.x<0||ug(l.rect.x+l.rect.width,t.rect.x,s)===0&&r.x>0||ug(l.rect.y,t.rect.y+t.rect.height,s)===0&&r.y<0||ug(l.rect.y+l.rect.height,t.rect.y,s)===0&&r.y>0){i=0;break}}else i=Math.min(i,t.distance(l,r));i=Math.min(i,n._minUnderlapWithSubtree(t,a,i,r))}return i}static _translateSubtree(t,e){t.node.translate(e);for(let o of t.children)n._translateSubtree(o,e)}};var pg=class{process(t,e){e.begin("Shrinking tree compaction",1);let o=t.getProperty(oe.DEBUG_SVG)?"spore/60compaction":null;_g.compact(t.tree,t.orthogonalCompaction,o),e.done()}getLayoutProcessorConfiguration(){return K.create()}};var _n=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.DEPTH_FIRST:return new pg;default:throw new Error(`No implementation for CompactionStrategy.${this}`)}}};_n.DEPTH_FIRST=new _n("DEPTH_FIRST");var Ho=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Ho.FIXED=new Ho("FIXED");Ho.CENTER_NODE=new Ho("CENTER_NODE");var Te=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Te.CENTER_DISTANCE=new Te("CENTER_DISTANCE");Te.CIRCLE_UNDERLAP=new Te("CIRCLE_UNDERLAP");Te.RECTANGLE_UNDERLAP=new Te("RECTANGLE_UNDERLAP");Te.INVERTED_OVERLAP=new Te("INVERTED_OVERLAP");Te.MINIMUM_ROOT_DISTANCE=new Te("MINIMUM_ROOT_DISTANCE");var cT=oe.FUZZINESS;function gT(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}var Va=class n{constructor(t,e,o){this.a=t,this.b=e,this.c=o,this.tEdges=[new Ue(t,e),new Ue(e,o),new Ue(o,t)],this.vertices=[t,e,o],this._circumcenter=this._calculateCircumcenter()}getCircumcenter(){return this._circumcenter}_calculateCircumcenter(){let t=this.b.clone().sub(this.a),e=this.c.clone().sub(this.a),o=this.c.clone().sub(this.b),r=t.x*(this.a.x+this.b.x)+t.y*(this.a.y+this.b.y),i=e.x*(this.a.x+this.c.x)+e.y*(this.a.y+this.c.y),s=2*(t.x*o.y-t.y*o.x),a=(e.y*r-t.y*i)/s,l=(t.x*i-e.x*r)/s;return new O(a,l)}inCircumcircle(t){return gT(this._circumcenter.distance(t),this._circumcenter.distance(this.a),cT)<0}equals(t){return t instanceof n?this.containsVertex(t.a)&&this.containsVertex(t.b)&&this.containsVertex(t.c):!1}containsEdge(t){return ju(t,this.tEdges[0])||ju(t,this.tEdges[1])||ju(t,this.tEdges[2])}containsVertex(t){return Zu(t,this.vertices[0])||Zu(t,this.vertices[1])||Zu(t,this.vertices[2])}};function Zu(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):n.x===t.x&&n.y===t.y}function ju(n,t){return n===t?!0:n==null||t==null?!1:typeof n.equals=="function"?n.equals(t):!1}var Eg=class{static triangulate(t,e=null){let o=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let S of t)o.x=Math.min(o.x,S.x),o.y=Math.min(o.y,S.y),r.x=Math.max(r.x,S.x),r.y=Math.max(r.y,S.y);let i=new O(r.x-o.x,r.y-o.y),s=50,a=new O(o.x-s,o.y-i.x-s),l=new O(o.x-s,r.y+i.x+s),c=new O(r.x+i.y/2+s,o.y+i.y/2),g=new Va(a,l,c),h=[g],d=[],f=[];for(let S of t){d.length=0;for(let T of h)T.inCircumcircle(S)&&d.push(T);f.length=0;for(let T of d)for(let N of T.tEdges){let I=!0;for(let C of d)C!==T&&C.containsEdge(N)&&(I=!1);I&&f.push(N)}for(let T of d){let N=h.indexOf(T);N>=0&&h.splice(N,1)}for(let T of f)h.push(new Va(S,T.u,T.v))}let E=[];for(let S of h)for(let T of S.tEdges){let N=!1;for(let I of E)if(I.equals(T)){N=!0;break}N||E.push(T)}let P=new Set;for(let S of E)!g.containsVertex(S.u)&&!g.containsVertex(S.v)&&P.add(S);return P}};var mg=class{process(t,e){e.begin("Delaunay triangulation",1);let o=[];for(let s of t.vertices)o.push(s.originalVertex);let r=t.getProperty(oe.DEBUG_SVG)?"spore/10bw":null,i=Eg.triangulate(o,r);if(t.tEdges==null)t.tEdges=i;else for(let s of i)t.tEdges.add(s);e.done()}getLayoutProcessorConfiguration(){return K.create()}};var wr=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.DELAUNAY_TRIANGULATION:return new mg;default:throw new Error(`No implementation for StructureExtractionStrategy.${this}`)}}};wr.DELAUNAY_TRIANGULATION=new wr("DELAUNAY_TRIANGULATION");var bi=class{constructor(t){this.node=t,this.children=[]}};var pn=class{static createSpanningTree(t,e,o,r=null){let i=typeof o=="function"?o:h=>o.cost(h),s=new Map;for(let h of t)s.set(h,i(h));let a=[...t];a.sort((h,d)=>s.get(h)-s.get(d));let l=new Set(a),c=new bi(e),g=new Map;for(g.set(e,c);l.size>0;){let h=null,d=null,f=null;for(let P of l){if(g.has(P.u)&&!g.has(P.v)){d=P.v,f=P.u,h=P;break}if(g.has(P.v)&&!g.has(P.u)){d=P.u,f=P.v,h=P;break}}if(h==null)break;let E=new bi(d);g.get(f).children.push(E),g.set(d,E),l.delete(h)}return c}};var En=class{constructor(){this._nodeMap=new Map}process(t,e){e.begin("Minimum spanning tree construction",1);let o=t.preferredRoot!=null?t.preferredRoot.originalVertex:t.vertices[0].originalVertex,r=t.getProperty(oe.DEBUG_SVG)?"spore/20minst":null,i=pn.createSpanningTree(t.tEdges,o,t.costFunction,r);this._convert(i,t),e.done()}_convert(t,e){this._nodeMap.clear();for(let r of e.vertices)this._nodeMap.set(r.originalVertex,r);let o=new bi(this._nodeMap.get(t.node));this._addNode(o,t),e.tree=o}_addNode(t,e){for(let o of e.children){let r=new bi(this._nodeMap.get(o.node));t.children.push(r),this._addNode(r,o)}}getLayoutProcessorConfiguration(){return K.create()}};var Pg=class extends En{process(t,e){e.begin("Maximum spanning tree construction",1);let o=a=>-t.costFunction(a),r=t.preferredRoot!=null?t.preferredRoot.originalVertex:t.vertices[0].originalVertex,i=t.getProperty(oe.DEBUG_SVG)?"spore/20minst":null,s=pn.createSpanningTree(t.tEdges,r,o,i);this._convert(s,t),e.done()}};var Mr=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.MINIMUM_SPANNING_TREE:return new En;case n.MAXIMUM_SPANNING_TREE:return new Pg;default:throw new Error(`No implementation for TreeConstructionStrategy.${this}`)}}};Mr.MINIMUM_SPANNING_TREE=new Mr("MINIMUM_SPANNING_TREE");Mr.MAXIMUM_SPANNING_TREE=new Mr("MAXIMUM_SPANNING_TREE");var mn=new m("org.eclipse.elk.underlyingLayoutAlgorithm"),Gk=new m("org.eclipse.elk.structure.structureExtractionStrategy",()=>wr.DELAUNAY_TRIANGULATION),Og=new m("org.eclipse.elk.processingOrder.treeConstruction",()=>Mr.MINIMUM_SPANNING_TREE),Sg=new m("org.eclipse.elk.processingOrder.spanningTreeCostFunction",()=>Te.CIRCLE_UNDERLAP),JE=new m("org.eclipse.elk.processingOrder.preferredRoot"),Tg=new m("org.eclipse.elk.processingOrder.rootSelection",()=>Ho.CENTER_NODE),QE=new m("org.eclipse.elk.compaction.compactionStrategy",()=>_n.DEPTH_FIRST),tm=new m("org.eclipse.elk.compaction.orthogonal",!1),em=new m("org.eclipse.elk.overlapRemoval.maxIterations",64),om=new m("org.eclipse.elk.overlapRemoval.runScanline",!0);var Pn=class{static overlap(t,e){let o=Math.min(Math.abs(t.x-(e.x+e.width)),Math.abs(t.x+t.width-e.x)),r=Math.min(Math.abs(t.y-(e.y+e.height)),Math.abs(t.y+t.height-e.y)),i=Math.abs(t.x+t.width/2-(e.x+e.width/2));if(i>t.width/2+e.width/2)return 1;let s=Math.abs(t.y+t.height/2-(e.y+e.height/2));return s>t.height/2+e.height/2?1:i===0&&s===0?0:i===0?r/s+1:s===0?o/i+1:Math.min(o/i,r/s)+1}static getRectEdges(t){let e=[];return e.push(new Ue(t.getTopLeft(),t.getTopRight())),e.push(new Ue(t.getTopLeft(),t.getBottomLeft())),e.push(new Ue(t.getBottomRight(),t.getTopRight())),e.push(new Ue(t.getBottomRight(),t.getBottomLeft())),e}};var Ng=class{constructor(){this._root=null,this._overlapsExisted=!1}process(t,e){e.begin("Grow Tree",1),this._root=t.tree,this._overlapsExisted=!1,this._growAt(t.tree),t.setProperty(oe.OVERLAPS_EXISTED,this._overlapsExisted),e.done()}_growAt(t){for(let e of t.children){e.node.translate(t.node.vertex.clone().sub(t.node.originalVertex));let o=Pn.overlap(t.node.rect,e.node.rect);o>1&&(this._overlapsExisted=!0),e.node.setCenterPosition(t.node.vertex.clone().add(e.node.originalVertex.clone().sub(t.node.originalVertex).scale(o))),this._growAt(e)}}getLayoutProcessorConfiguration(){return K.create()}};var On=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.GROW_TREE:return new Ng;default:throw new Error(`No implementation for OverlapRemovalStrategy.${this}`)}}};On.GROW_TREE=new On("GROW_TREE");var Ne=class{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}};Ne.P1_STRUCTURE=new Ne("P1_STRUCTURE",0);Ne.P2_PROCESSING_ORDER=new Ne("P2_PROCESSING_ORDER",1);Ne.P3_EXECUTION=new Ne("P3_EXECUTION",2);Ne.VALUES=[Ne.P1_STRUCTURE,Ne.P2_PROCESSING_ORDER,Ne.P3_EXECUTION];var rm=new m("org.eclipse.elk.padding",new yt(8)),im=new m("org.eclipse.elk.spacing.nodeNode",8,0);function yg(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}function sm(n){return[new Ue(n.getTopLeft(),n.getTopRight()),new Ue(n.getTopLeft(),n.getBottomLeft()),new Ue(n.getBottomRight(),n.getTopRight()),new Ue(n.getBottomRight(),n.getBottomLeft())]}var Ig=class{constructor(t,e){this.originalVertex=t,this.vertex=this.originalVertex.clone(),this.rect=new dt(e)}translate(t){this.vertex.add(t),this.rect.x+=t.x,this.rect.y+=t.y}setCenterPosition(t){this.translate(t.clone().sub(this.vertex))}underlap(t){let e=Math.abs(this.rect.getCenter().x-t.rect.getCenter().x),o=Math.abs(this.rect.getCenter().y-t.rect.getCenter().y),r=0,i=0,s=1,a=1;return e>this.rect.width/2+t.rect.width/2&&(r=Math.min(Math.abs(this.rect.x-(t.rect.x+t.rect.width)),Math.abs(this.rect.x+this.rect.width-t.rect.x)),s=1-r/e),o>this.rect.height/2+t.rect.height/2&&(i=Math.min(Math.abs(this.rect.y-(t.rect.y+t.rect.height)),Math.abs(this.rect.y+this.rect.height-t.rect.y)),a=1-i/o),(1-Math.min(s,a))*Math.sqrt(e*e+o*o)}distance(t,e){let o=Number.POSITIVE_INFINITY;for(let r of sm(this.rect))for(let i of sm(t.rect)){let s=Ft.distance(r.u,r.v,i.u,i.v,e);o=Math.min(o,s)}return o}touches(t){let e=oe.FUZZINESS;return yg(this.rect.x,t.rect.x+t.rect.width,e)<=0&&yg(t.rect.x,this.rect.x+this.rect.width,e)<=0&&yg(this.rect.y,t.rect.y+t.rect.height,e)<=0&&yg(t.rect.y,this.rect.y+this.rect.height,e)<=0}};var Rg=class extends ge{constructor(t,e,o){super(),this.vertices=[],this.tEdges=null,this.treeConstructionStrategy=e,this.tree=null,this.compactionStrategy=o,this.costFunction=t,this.preferredRoot=null,this.orthogonalCompaction=!1}};var Sn=class{constructor(){this._graph=null,this._nodeMap=new Map,this._elkGraph=null,this._spacingNodeNode=0,this._centerDistance=t=>t.u.distance(t.v),this._minimumRootDistance=t=>Math.min(t.u.distance(this._graph.preferredRoot.vertex),t.v.distance(this._graph.preferredRoot.vertex)),this._circleUnderlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst();return t.u.distance(t.v)-t.u.distance(e.rect.getPosition())-t.v.distance(o.rect.getPosition())},this._rectangleUnderlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst();return e.underlap(o)},this._invertedOverlap=t=>{let e=this._nodeMap.get(t.u).getFirst(),o=this._nodeMap.get(t.v).getFirst(),r=e.rect,i=o.rect,s=Ft.shortestDistance(r,i);if(s>=0)return s;let a=i.getCenter().sub(r.getCenter()).length();return-(Pn.overlap(r,i)-1)*a}}importGraph(t){this._elkGraph=t,this._nodeMap=new Map,this._seenCoords=new Set;let e=yo.adapt(this._elkGraph);No.calculateNodeMargins(e);let o=this._elkGraph.getProperty(JE),r=this._elkGraph.getProperty(Sg),i=this._elkGraph.getProperty(Og),s=this._elkGraph.getProperty(QE),a=this._elkGraph.getProperty(Tg);this._spacingNodeNode=this._elkGraph.getProperty(im);let l;switch(r){case Te.CENTER_DISTANCE:l=this._centerDistance;break;case Te.CIRCLE_UNDERLAP:l=this._circleUnderlap;break;case Te.RECTANGLE_UNDERLAP:l=this._rectangleUnderlap;break;case Te.INVERTED_OVERLAP:l=this._invertedOverlap;break;case Te.MINIMUM_ROOT_DISTANCE:l=this._minimumRootDistance;break;default:throw new Error("No implementation available for "+r)}if(this._graph=new Rg(l,i,s),this._graph.setProperty(oe.DEBUG_SVG,this._elkGraph.getProperty(Ks)),this._graph.orthogonalCompaction=this._elkGraph.getProperty(tm),this._elkGraph.children.length===0)return this._graph;for(let c of this._elkGraph.children){let g=c.width/2,h=c.height/2,d=new O(c.x+g,c.y+h),f=d.x+","+d.y;for(;this._seenCoords.has(f);)d.add((Math.random()-.5)*.001,(Math.random()-.5)*.001),f=d.x+","+d.y;this._seenCoords.add(f);let E=c.getProperty(Nr),P=new Ig(d,new dt(d.x-g-this._spacingNodeNode/2-E.left,d.y-h-this._spacingNodeNode/2-E.top,c.width+this._spacingNodeNode+E.getHorizontal(),c.height+this._spacingNodeNode+E.getVertical()));this._graph.vertices.push(P),this._nodeMap.set(d,Gt.of(P,c))}if(a===Ho.FIXED)if(o==null)this._graph.preferredRoot=this._graph.vertices[0];else for(let c of this._graph.vertices){let g=this._nodeMap.get(c.originalVertex).getSecond().getIdentifier();g!==null&&g===o&&(this._graph.preferredRoot=c)}else if(a===Ho.CENTER_NODE){let c=new O(this._elkGraph.width,this._elkGraph.height);c.scale(.5),c.add(this._elkGraph.x,this._elkGraph.y);let g=Number.POSITIVE_INFINITY;for(let h of this._graph.vertices){let d=h.originalVertex.distance(c);d<g&&(g=d,this._graph.preferredRoot=h)}}else throw new Error("No implementation available for "+a);return this._graph}updateGraph(t){let e=new Map;t.tEdges=null,t.tree=null;for(let o of t.vertices){let r=this._nodeMap.get(o.originalVertex);o.originalVertex=o.rect.getCenter(),e.set(o.originalVertex,r)}this._nodeMap=e}applyPositions(t){let e=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let a of t.vertices){let l=this._nodeMap.get(a.originalVertex).getSecond();l.setLocation(a.rect.x,a.rect.y),e=Math.min(e,l.x),o=Math.min(o,l.y),r=Math.max(r,l.x+l.width),i=Math.max(i,l.y+l.height)}let s=this._elkGraph.getProperty(rm);Ae(this._elkGraph,r-e+s.getHorizontal(),i-o+s.getVertical(),!0,!0),Ra(this._elkGraph,-e+s.left,-o+s.top);for(let a of this._elkGraph.containedEdges){let l=ar(a,!0,!0),c=ks(a),g=Na(a),h=new O(c.x+c.width/2,c.y+c.height/2),d=new O(g.x+g.width/2,g.y+g.height/2),f=d.clone().sub(h);Ft.clipVector(f,c.width,c.height),h.add(f);let E=h.clone().sub(d);Ft.clipVector(E,g.width,g.height),d.add(E),l.setStartLocation(h.x,h.y),l.setEndLocation(d.x,d.y)}}};var Lg=class extends de{constructor(){super(),this._algorithmAssembler=Io.create(Ne.VALUES)}layout(t,e){if(t.hasProperty(mn)){let h=t.getProperty(mn),d=Ht.getInstance().getAlgorithmDataBySuffix(h);if(d!=null){let f=d.getInstancePool().fetch(),E=typeof e.subTask=="function"?e.subTask(1):e;f.layout(t,E)}}t.setProperty(Tg,Ho.CENTER_NODE),t.setProperty(Sg,Te.INVERTED_OVERLAP),t.setProperty(Og,Mr.MINIMUM_SPANNING_TREE);let o=t.getProperty(em);e.begin("Overlap removal",1);let r=new fg(null),i=new Set,s={handle(h,d){i.add(new Ue(h.originalVertex,d.originalVertex))}},a=new Sn,l=a.importGraph(t),c=!0,g=0;for(;g<o&&c;){if(t.getProperty(om)){if(i.clear(),new hg(s,r).sweep(l.vertices),i.size===0)break;l.tEdges=i}this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ne.P1_STRUCTURE,wr.DELAUNAY_TRIANGULATION),this._algorithmAssembler.setPhase(Ne.P2_PROCESSING_ORDER,l.treeConstructionStrategy),this._algorithmAssembler.setPhase(Ne.P3_EXECUTION,On.GROW_TREE);let h=this._algorithmAssembler.build(l);for(let d of h){let f=typeof e.subTask=="function"?e.subTask(1):e;d.process(l,f)}a.updateGraph(l),c=l.getProperty(oe.OVERLAPS_EXISTED),g++}a.applyPositions(l),e.done()}};var Ag=class{constructor(){this._algorithmAssembler=Io.create(Ne.VALUES)}shrink(t,e){this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(Ne.P1_STRUCTURE,wr.DELAUNAY_TRIANGULATION),this._algorithmAssembler.setPhase(Ne.P2_PROCESSING_ORDER,t.treeConstructionStrategy),this._algorithmAssembler.setPhase(Ne.P3_EXECUTION,t.compactionStrategy);let o=this._algorithmAssembler.build(t);if(e.begin("Compaction by shrinking a tree",o.length),t.vertices.length>1)for(let r of o){let i=typeof e.subTask=="function"?e.subTask(1):e;r.process(t,i)}e.done()}};var Cg=class extends de{constructor(){super(),this._shrinktree=new Ag}layout(t,e){if(t.hasProperty(mn)){let s=t.getProperty(mn),a=Ht.getInstance().getAlgorithmDataBySuffix(s);if(a!=null){let l=a.getInstancePool().fetch(),c=typeof e.subTask=="function"?e.subTask(1):e;l.layout(t,c)}}let o=new Sn,r=o.importGraph(t),i=typeof e.subTask=="function"?e.subTask(1):e;this._shrinktree.shrink(r,i),o.applyPositions(r)}};var nm="org.eclipse.elk.sporeOverlap",am="org.eclipse.elk.sporeCompaction",lm=!1;function cm(){let n=Ht.getInstance(),t=n.getAlgorithmData(nm),e=n.getAlgorithmData(am);if(t&&e)return lm=!0,{overlap:t,compaction:e};let o=new Se.Builder().id(nm).name("ELK SPOrE Overlap").description("Node-overlap removal via Nachmanson et al. 2016.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.spore").providerFactory(()=>new Lg).supportedFeatures(new Set([])).create(),r=new Se.Builder().id(am).name("ELK SPOrE Compaction").description("Tree-based compaction to tighten whitespace between nodes.").category("org.eclipse.elk.packing").definingBundleId("org.eclipse.elk.alg.spore").providerFactory(()=>new Cg).supportedFeatures(new Set([])).create();return n.registerLayoutMetaDataProviders({apply(i){i.register(o),i.register(r)}}),lm=!0,{overlap:o,compaction:r}}var br=class extends ge{constructor(){super(),this.id=0}getDesignation(){return null}};var Tn=class n extends yt{constructor(){super()}clone(){let t=new n;return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t}};var Nn=class extends br{constructor(){super(),this._size=new O,this._padding=new Tn,this._offset=new O,this._layerlessNodes=[],this._layers=[],this._parentNode=null}getSize(){return this._size}getActualSize(){return new O(this._size.x+this._padding.left+this._padding.right,this._size.y+this._padding.top+this._padding.bottom)}getPadding(){return this._padding}getOffset(){return this._offset}getLayerlessNodes(){return this._layerlessNodes}getLayers(){return this._layers}getParentNode(){return this._parentNode}setParentNode(t){this._parentNode=t}[Symbol.iterator](){return this._layers[Symbol.iterator]()}toNodeArray(){let t=new Array(this._layers.length);for(let e=0;e<this._layers.length;e++)t[e]=this._layers[e].getNodes().slice();return t}toString(){return this._layers.length===0?`G-unlayered[${this._layerlessNodes.join(",")}]`:this._layerlessNodes.length===0?`G-layered[${this._layers.join(",")}]`:`G[layerless[${this._layerlessNodes.join(",")}], layers[${this._layers.join(",")}]]`}};var p=class{};p.REVERSED=new m("reversed",!1);p.INPUT_COLLECT=new m("inputCollect",!1);p.OUTPUT_COLLECT=new m("outputCollect",!1);p.REPRESENTED_LABELS=new m("representedLabels");p.RANDOM=new m("random");p.CYCLIC=new m("cyclic",!1);p.MODEL_ORDER=new m("modelOrder");p.MAX_MODEL_ORDER_NODES=new m("maxModelOrderNodes",0);p.CB_NUM_MODEL_ORDER_GROUPS=new m("cbNumModelOrderGroups",1);p.TARJAN_ID=new m("tarjanId",-1);p.TARJAN_LOWLINK=new m("tarjanLowlink",-1);p.TARJAN_ON_STACK=new m("tarjanOnStack",!1);p.IS_PART_OF_CYCLE=new m("isPartOfCycle",!1);p.IN_LAYER_LAYOUT_UNIT=new m("inLayerLayoutUnit");p.ORIGIN=new m("origin");p.PORT_DUMMY=new m("portDummy");p.WEIGHT=new m("weight");p.IN_LAYER_SUCCESSOR_CONSTRAINTS=new m("inLayerSuccessorConstraints",[]);p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES=new m("inLayerSuccessorConstraintsBetweenNonDummies",!1);p.BARYCENTER_ASSOCIATES=new m("barycenterAssociates");p.GRAPH_PROPERTIES=new m("graphProperties",()=>new Set);p.FIRST_TRY_WITH_INITIAL_ORDER=new m("firstTryWithInitialOrder",!1);p.SECOND_TRY_WITH_INITIAL_ORDER=new m("secondTryWithInitialOrder",!1);p.INSIDE_CONNECTIONS=new m("insideConnections",!1);p.SPACINGS=new m("spacings");p.ORIGINAL_DUMMY_NODE_POSITION=new m("originalDummyNodePosition");p.LONG_EDGE_SOURCE=new m("longEdgeSource");p.LONG_EDGE_TARGET=new m("longEdgeTarget");p.LONG_EDGE_HAS_LABEL_DUMMIES=new m("longEdgeHasLabelDummies",!1);p.END_LABEL_EDGE=new m("endLabelEdge");p.EXT_PORT_SIDE=new m("extPortSide");p.IN_LAYER_CONSTRAINT=new m("inLayerConstraint");p.EDGE_CONSTRAINT=new m("edgeConstraint");p.TOP_COMMENTS=new m("topComments");p.BOTTOM_COMMENTS=new m("bottomComments");p.COMMENT_CONN_PORT=new m("commentConnPort");p.HIDDEN_NODES=new m("hiddenNodes");p.ORIGINAL_OPPOSITE_PORT=new m("originalOppositePort");p.LONG_EDGE_BEFORE_LABEL_DUMMY=new m("longEdgeBeforeLabelDummy",!1);p.PARTITION_DUMMY=new m("partitionDummy",!1);p.LABEL_SIDE=new m("labelSide");p.END_LABELS=new m("endLabels");p.MAX_EDGE_THICKNESS=new m("maxEdgeThickness",0);p.SPLINE_NS_PORT_Y_COORD=new m("splineNsPortYCoord");p.PORT_RATIO_OR_POSITION=new m("portRatioOrPosition",0);p.EXT_PORT_REPLACED_DUMMIES=new m("extPortReplacedDummies");p.EXT_PORT_REPLACED_DUMMY=new m("extPortReplacedDummy");p.SELF_LOOP_HOLDER=new m("selfLoopHolder");p.ORIGINAL_PORT_CONSTRAINTS=new m("originalPortConstraints");p.CROSSING_HINT=new m("crossingHint",0);p.BREAKING_POINT_INFO=new m("breakingPointInfo");p.SPLINE_ROUTE_START=new m("splineRouteStart");p.SPLINE_EDGE_CHAIN=new m("splineEdgeChain");p.SPLINE_SURVIVING_EDGE=new m("splineSurvivingEdge");p.COMPOUND_NODE=new m("compoundNode",!1);p.PROCESSORS=new m("processors");p.EXT_PORT_CONNECTIONS=new m("extPortConnections");p.EXT_PORT_SIZE=new m("extPortSize");p.COORDINATE_SYSTEM_ORIGIN=new m("coordinateSystemOrigin");p.ORIGINAL_BENDPOINTS=new m("originalBendpoints");p.TARGET_OFFSET=new m("targetOffset");p.CROSS_HIERARCHY_MAP=new m("crossHierarchyMap");p.ORIGINAL_LABEL_EDGE=new m("originalLabelEdge");p.TARGET_NODE_MODEL_ORDER=new m("targetNodeModelOrder");p.LONG_EDGE_TARGET_NODE=new m("longEdgeTargetNode");var re=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};re.BARYCENTER=new re("BARYCENTER");re.ONE_SIDED_GREEDY_SWITCH=new re("ONE_SIDED_GREEDY_SWITCH");re.TWO_SIDED_GREEDY_SWITCH=new re("TWO_SIDED_GREEDY_SWITCH");re.MEDIAN=new re("MEDIAN");var Gi=class extends br{constructor(){super(),this._pos=new O,this._size=new O}getPosition(){return this._pos}getSize(){return this._size}};var Gr=class extends me{constructor(){super()}};var rt=class extends Gi{constructor(){super(),this._owner=null,this._side=u.UNDEFINED,this._anchor=new O,this._explicitlySuppliedPortAnchor=!1,this._margin=new Gr,this._labels=[],this._incomingEdges=[],this._outgoingEdges=[],this._connectedToExternalNodes=!0}getNode(){return this._owner}setNode(t){if(this._owner!=null){let e=this._owner.getPorts(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._owner=t,this._owner!=null&&this._owner.getPorts().push(this)}getSide(){return this._side}setSide(t){if(t==null)throw new TypeError("PortSide must not be null");if(this._side=t,!this.isExplicitlySuppliedPortAnchor()){let e=this.getSize(),o=this.getAnchor();switch(t){case u.NORTH:o.x=e.x/2,o.y=0;break;case u.EAST:o.x=e.x,o.y=e.y/2;break;case u.SOUTH:o.x=e.x/2,o.y=e.y;break;case u.WEST:o.x=0,o.y=e.y/2;break}}}getAnchor(){return this._anchor}isExplicitlySuppliedPortAnchor(){return this._explicitlySuppliedPortAnchor}setExplicitlySuppliedPortAnchor(t){this._explicitlySuppliedPortAnchor=t}getAbsoluteAnchor(){let t=this._owner.getPosition(),e=this.getPosition();return new O(t.x+e.x+this._anchor.x,t.y+e.y+this._anchor.y)}getMargin(){return this._margin}getLabels(){return this._labels}getName(){return this._labels.length>0?this._labels[0].getText():null}getDegree(){return this._incomingEdges.length+this._outgoingEdges.length}getNetFlow(){return this._incomingEdges.length-this._outgoingEdges.length}getIncomingEdges(){return this._incomingEdges}getOutgoingEdges(){return this._outgoingEdges}*getConnectedEdges(){yield*nr(this._incomingEdges),yield*nr(this._outgoingEdges)}isConnectedToExternalNodes(){return this._connectedToExternalNodes}setConnectedToExternalNodes(t){this._connectedToExternalNodes=t}*getPredecessorPorts(){for(let t of this._incomingEdges)yield t.getSource()}*getSuccessorPorts(){for(let t of this._outgoingEdges)yield t.getTarget()}*getConnectedPorts(){yield*nr(this.getPredecessorPorts()),yield*nr(this.getSuccessorPorts())}getIndex(){return this._owner==null?-1:this._owner.getPorts().indexOf(this)}getDesignation(){if(this._labels.length>0&&this._labels[0].getText())return this._labels[0].getText();let t=super.getDesignation();return t!=null?t:String(this.getIndex())}toString(){let t=`p_${this.getDesignation()}`;if(this._owner!=null&&(t+=`[${this._owner}]`),this._incomingEdges.length===1&&this._outgoingEdges.length===0&&this._incomingEdges[0].getSource()!==this){let e=this._incomingEdges[0].getSource();t+=` << ${e.getDesignation()}[${e._owner}]`}if(this._incomingEdges.length===0&&this._outgoingEdges.length===1&&this._outgoingEdges[0].getTarget()!==this){let e=this._outgoingEdges[0].getTarget();t+=` >> ${e.getDesignation()}[${e._owner}]`}return t}};Z(rt,"OUTPUT_PREDICATE",t=>t._outgoingEdges.length>0),Z(rt,"INPUT_PREDICATE",t=>t._incomingEdges.length>0),Z(rt,"NORTH_PREDICATE",t=>t._side===u.NORTH),Z(rt,"EAST_PREDICATE",t=>t._side===u.EAST),Z(rt,"SOUTH_PREDICATE",t=>t._side===u.SOUTH),Z(rt,"WEST_PREDICATE",t=>t._side===u.WEST);var W=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};W.UNDEFINED=new W("UNDEFINED");W.INPUT=new W("INPUT");W.OUTPUT=new W("OUTPUT");var ft=class extends Gi{constructor(t){super(),this._graph=t,this._layer=null,this._type=y.NORMAL,this._ports=[],this._labels=[],this._nestedGraph=null,this._margin=new Gr,this._padding=new Tn,this._portSideIndices=null,this._portSidesCached=!1}getLayer(){return this._layer}setLayer(t,e){let o,r=-1;if(e===void 0)o=t;else if(r=t,o=e,o!=null&&(r<0||r>o.getNodes().length))throw new RangeError("index must be >= 0 and <= layer node count");if(this._layer!=null){let i=this._layer.getNodes(),s=i.indexOf(this);s>=0&&i.splice(s,1)}this._layer=o,this._layer!=null&&(r>=0?this._layer.getNodes().splice(r,0,this):this._layer.getNodes().push(this))}getGraph(){return this._graph==null&&this._layer!=null?this._layer.getGraph():this._graph}setGraph(t){if(this._layer!=null)throw new Error("setGraph called on a node that is already in a layer");this._graph=t}getType(){return this._type}setType(t){this._type=t}getPorts(t,e){return t===void 0?this._ports:fT(this._ports,t,e)}getPortSideView(t){this._portSidesCached||this._findPortIndices();let e=this._portSideIndices.get(t);return e==null?[]:this._ports.slice(e[0],e[1])}*getIncomingEdges(){for(let t of this._ports)yield*nr(t.getIncomingEdges())}*getOutgoingEdges(){for(let t of this._ports)yield*nr(t.getOutgoingEdges())}*getConnectedEdges(){for(let t of this._ports)yield*nr(t.getConnectedEdges())}getLabels(){return this._labels}getNestedGraph(){return this._nestedGraph}setNestedGraph(t){this._nestedGraph=t}getMargin(){return this._margin}getPadding(){return this._padding}getIndex(){return this._layer==null?-1:this._layer.getNodes().indexOf(this)}borderToContentAreaCoordinates(t,e){let o=this.getGraph(),r=o.getPadding(),i=o.getOffset(),s=this.getPosition();t&&(s.x=s.x-r.left-i.x),e&&(s.y=s.y-r.top-i.y)}getInteractiveReferencePoint(){switch(this.getGraph().getProperty(_.INTERACTIVE_REFERENCE_POINT)){case vo.CENTER:{let e=this.getPosition(),o=this.getSize();return new O(e.x+o.x/2,e.y+o.y/2)}case vo.TOP_LEFT:return new O(this.getPosition().x,this.getPosition().y);default:return null}}cachePortSides(){this._portSidesCached=!0,this._findPortIndices()}_findPortIndices(){this._portSideIndices=new Map;let t=0,e=u.NORTH,o=0;for(;o<this._ports.length;o++){let r=this._ports[o];r.getSide()!==e&&(t!==o&&this._portSideIndices.set(e,[t,o]),e=r.getSide(),t=o)}this._portSideIndices.set(e,[t,o])}getDesignation(){if(this._labels.length>0&&this._labels[0].getText())return this._labels[0].getText();let t=super.getDesignation();return t!=null?t:String(this.getIndex())}isInlineEdgeLabel(){if(this._type!==y.LABEL)return!1;let t=this.getProperty(p.REPRESENTED_LABELS);return t?t.every(e=>e.getProperty(_.EDGE_LABELS_INLINE)):!1}toString(){let t="n";return this._type!==y.NORMAL&&(t+=`(${this._type.name.toLowerCase()})`),t+=`_${this.getDesignation()}`,t}},y=class{constructor(t,e){this.name=t,this._color=e,Object.freeze(this)}getColor(){return this._color}toString(){return this.name}};y.NORMAL=new y("NORMAL","#eeeeee");y.LONG_EDGE=new y("LONG_EDGE","#eaed00");y.EXTERNAL_PORT=new y("EXTERNAL_PORT","#cc99cc");y.NORTH_SOUTH_PORT=new y("NORTH_SOUTH_PORT","#0034de");y.LABEL=new y("LABEL","#75c3c3");y.BREAKING_POINT=new y("BREAKING_POINT","#eeeeff");y.PLACEHOLDER=new y("PLACEHOLDER","#eeeeee");y.NONSHIFTING_PLACEHOLDER=new y("NONSHIFTING_PLACEHOLDER","#eeeeee");function dT(n){return n===W.INPUT?rt.INPUT_PREDICATE:n===W.OUTPUT?rt.OUTPUT_PREDICATE:null}function gm(n){return n===u.NORTH?rt.NORTH_PREDICATE:n===u.EAST?rt.EAST_PREDICATE:n===u.SOUTH?rt.SOUTH_PREDICATE:n===u.WEST?rt.WEST_PREDICATE:null}function*fT(n,t,e){let o=null,r=null;t instanceof W?o=dT(t):t instanceof u&&(r=gm(t)),e!=null&&(r=gm(e));for(let i of n)o&&!o(i)||r&&!r(i)||(yield i)}var D=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}toString(){return this.name}static values(){return[n.P1_CYCLE_BREAKING,n.P2_LAYERING,n.P3_NODE_ORDERING,n.P4_NODE_PLACEMENT,n.P5_EDGE_ROUTING]}};D.P1_CYCLE_BREAKING=new D("P1_CYCLE_BREAKING",0);D.P2_LAYERING=new D("P2_LAYERING",1);D.P3_NODE_ORDERING=new D("P3_NODE_ORDERING",2);D.P4_NODE_PLACEMENT=new D("P4_NODE_PLACEMENT",3);D.P5_EDGE_ROUTING=new D("P5_EDGE_ROUTING",4);var oo=class n{constructor(t){this._graph=t;let e=hm().size;this._horizontal=Array.from({length:e},()=>new Array(e).fill(null)),this._vertical=Array.from({length:e},()=>new Array(e).fill(null)),this._precalculate()}_precalculate(){this._set(y.NORMAL,_.SPACING_NODE_NODE,_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._setPair(y.NORMAL,y.LONG_EDGE,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.NORMAL,y.NORTH_SOUTH_PORT,_.SPACING_EDGE_NODE),this._setPair(y.NORMAL,y.EXTERNAL_PORT,_.SPACING_EDGE_NODE),this._setPair(y.NORMAL,y.LABEL,_.SPACING_NODE_NODE,_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._set(y.LONG_EDGE,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this._setPair(y.LONG_EDGE,y.NORTH_SOUTH_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.LONG_EDGE,y.EXTERNAL_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.LONG_EDGE,y.LABEL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._set(y.NORTH_SOUTH_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.NORTH_SOUTH_PORT,y.EXTERNAL_PORT,_.SPACING_EDGE_EDGE),this._setPair(y.NORTH_SOUTH_PORT,y.LABEL,_.SPACING_LABEL_NODE),this._set(y.EXTERNAL_PORT,_.SPACING_PORT_PORT),this._setPair(y.EXTERNAL_PORT,y.LABEL,_.SPACING_LABEL_PORT_VERTICAL,_.SPACING_LABEL_PORT_HORIZONTAL),this._set(y.LABEL,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE),this._set(y.BREAKING_POINT,_.SPACING_EDGE_EDGE,_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.NORMAL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.LABEL,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._setPair(y.BREAKING_POINT,y.LONG_EDGE,_.SPACING_EDGE_NODE,_.SPACING_EDGE_NODE_BETWEEN_LAYERS)}_set(t,e,o){let r=Is(t);this._vertical[r][r]=e,o!==void 0&&(this._horizontal[r][r]=o)}_setPair(t,e,o,r){let i=Is(t),s=Is(e);this._vertical[i][s]=o,this._vertical[s][i]=o,r!==void 0&&(this._horizontal[i][s]=r,this._horizontal[s][i]=r)}getHorizontalSpacing(t,e){if(xg(t)&&xg(e))return this._getLocalSpacingNodes(t,e,this._horizontal);if(Dg(t)&&Dg(e))return this._getLocalSpacingTypes(t,e,this._horizontal);throw new yn("getHorizontalSpacing requires two nodes or two node types")}getVerticalSpacing(t,e){if(xg(t)&&xg(e))return this._getLocalSpacingNodes(t,e,this._vertical);if(Dg(t)&&Dg(e))return this._getLocalSpacingTypes(t,e,this._vertical);throw new yn("getVerticalSpacing requires two nodes or two node types")}_getLocalSpacingNodes(t,e,o){let r=o[Is(t.getType())][Is(e.getType())];if(r==null)throw new yn(`No spacing between ${t.getType()} and ${e.getType()}`);let i=n.getIndividualOrDefault(t,r),s=n.getIndividualOrDefault(e,r);return Math.max(i,s)}_getLocalSpacingTypes(t,e,o){let r=o[Is(t)][Is(e)];if(r==null)throw new yn(`No spacing between ${t} and ${e}`);return this._graph.getProperty(r)}static getIndividualOrDefault(t,e){let o=null;if(t.hasProperty(_.SPACING_INDIVIDUAL)){let r=t.getProperty(_.SPACING_INDIVIDUAL);r&&r.hasProperty&&r.hasProperty(e)&&(o=r.getProperty(e))}return o==null&&(o=t.getGraph().getProperty(e)),o}},yn=class extends Error{constructor(t="unspecified spacing"){super(t),this.name="UnspecifiedSpacingException"}};function xg(n){return n!=null&&typeof n.getType=="function"&&typeof n.getPorts=="function"}function Dg(n){return n instanceof y}var qu=null;function hm(){return qu===null&&(qu=new Map([y.NORMAL,y.LONG_EDGE,y.EXTERNAL_PORT,y.NORTH_SOUTH_PORT,y.LABEL,y.BREAKING_POINT,y.PLACEHOLDER,y.NONSHIFTING_PLACEHOLDER].map((n,t)=>[n,t]))),qu}function Is(n){let t=hm().get(n);if(t===void 0)throw new Error(`Unknown NodeType ${n}`);return t}var wg=class{process(t,e){e.begin("Node margin calculation",1);for(let o of t.getLayers())for(let r of o.getNodes())uT(r);e.done()}};function uT(n){let t=n.getMargin(),e=n.getProperty(p.TOP_COMMENTS),o=n.getProperty(p.BOTTOM_COMMENTS);if(e==null&&o==null)return;let r=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_COMMENT),i=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_NODE),s=0;if(e!=null){let c=0;for(let g of e)g.getSize().y>c&&(c=g.getSize().y),s+=g.getSize().x;s+=r*(e.length-1),t.top+=c+i}let a=0;if(o!=null){let c=0;for(let g of o)g.getSize().y>c&&(c=g.getSize().y),a+=g.getSize().x;a+=r*(o.length-1),t.bottom+=c+i}let l=Math.max(s,a);if(l>n.getSize().x){let c=(l-n.getSize().x)/2;c>t.left&&(t.left=c),c>t.right&&(t.right=c)}}var Mg=class{process(t,e){e.begin("Comment post-processing",1);for(let o of t){let r=[];for(let i of o){let s=i.getProperty(p.TOP_COMMENTS),a=i.getProperty(p.BOTTOM_COMMENTS);if(s!=null||a!=null){if(_T(i,s,a),s!=null)for(let l of s)r.push(l);if(a!=null)for(let l of a)r.push(l)}}for(let i of r)o.getNodes().push(i)}e.done()}};function _T(n,t,e){let o=n.getPosition(),r=n.getSize(),i=n.getMargin(),s=oo.getIndividualOrDefault(n,_.SPACING_COMMENT_COMMENT);if(t!=null){let a=s*(t.length-1),l=0;for(let f of t)a+=f.getSize().x,f.getSize().y>l&&(l=f.getSize().y);let c=o.x-(a-r.x)/2,g=o.y-i.top+l,h=r.x/(t.length+1),d=h;for(let f of t){f.getPosition().x=c,f.getPosition().y=g-f.getSize().y,c+=f.getSize().x+s;let E=dm(f);E.getPosition().x=f.getSize().x/2-E.getAnchor().x,E.getPosition().y=f.getSize().y;let P=f.getProperty(p.COMMENT_CONN_PORT);P.getDegree()===1&&(P.getPosition().x=d-P.getAnchor().x,P.getPosition().y=0,P.setNode(n)),d+=h}}if(e!=null){let a=s*(e.length-1),l=0;for(let f of e)a+=f.getSize().x,f.getSize().y>l&&(l=f.getSize().y);let c=o.x-(a-r.x)/2,g=o.y+r.y+i.bottom-l,h=r.x/(e.length+1),d=h;for(let f of e){f.getPosition().x=c,f.getPosition().y=g,c+=f.getSize().x+s;let E=dm(f);E.getPosition().x=f.getSize().x/2-E.getAnchor().x,E.getPosition().y=0;let P=f.getProperty(p.COMMENT_CONN_PORT);P.getDegree()===1&&(P.getPosition().x=d-P.getAnchor().x,P.getPosition().y=r.y,P.setNode(n)),d+=h}}}function dm(n){let t=n.getProperty(p.COMMENT_CONN_PORT);for(let e of n.getPorts()){for(let o of e.getOutgoingEdges())return o.setTarget(t),e;for(let o of e.getIncomingEdges())return o.setSource(t),e}return null}var bg=class{process(t,e){e.begin("Comment pre-processing",1);let o=t.getLayerlessNodes(),r=0;for(;r<o.length;){let i=o[r];if(!i.getProperty(_.COMMENT_BOX)){r++;continue}let s=0,a=null,l=null;for(let c of i.getPorts())s+=c.getDegree(),c.getIncomingEdges().length===1&&(a=c.getIncomingEdges()[0],l=a.getSource()),c.getOutgoingEdges().length===1&&(a=c.getOutgoingEdges()[0],l=a.getTarget());if(s===1&&l!=null&&l.getDegree()===1&&!l.getNode().getProperty(_.COMMENT_BOX))pT(i,a,l,l.getNode()),o.splice(r,1);else{let c=[];for(let g of i.getPorts()){for(let h of g.getOutgoingEdges())h.getTarget().getOutgoingEdges().length>0&&c.push(h);for(let h of g.getIncomingEdges())h.getSource().getIncomingEdges().length>0&&c.push(h)}for(let g of c)g.reverse(t,!0);r++}}e.done()}};function pT(n,t,e,o){let r,i=!1,s=!1;if(o.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){let l=!1,c=!1;t:for(let g of o.getPorts())for(let h of g.getConnectedPorts())if(!h.getNode().getProperty(_.COMMENT_BOX)){if(g.getSide()===u.NORTH){l=!0;break t}if(g.getSide()===u.SOUTH){c=!0;break t}}i=c&&!l,s=l&&!c}if(!i&&!s&&o.getLabels().length>0){let l=0;for(let c of o.getLabels())l+=c.getPosition().y+c.getSize().y/2;l/=o.getLabels().length,r=l>=o.getSize().y/2}else r=!s;ET(o,r,i,s).push(n),n.setProperty(p.COMMENT_CONN_PORT,e),t.getTarget()===e?(t.setTarget(null),e.getDegree()===0&&e.setNode(null),mT(e)):(t.setSource(null),e.getDegree()===0&&e.setNode(null)),t.getBendPoints().clear()}function ET(n,t,e,o){if(t){let s=n.getProperty(p.TOP_COMMENTS);if(s==null)return s=[],n.setProperty(p.TOP_COMMENTS,s),s;if(e)return s;let a=n.getProperty(p.BOTTOM_COMMENTS);return a==null?(a=[],n.setProperty(p.BOTTOM_COMMENTS,a),a):s.length<=a.length?s:a}let r=n.getProperty(p.BOTTOM_COMMENTS);if(r==null)return r=[],n.setProperty(p.BOTTOM_COMMENTS,r),r;if(o)return r;let i=n.getProperty(p.TOP_COMMENTS);return i==null?(i=[],n.setProperty(p.TOP_COMMENTS,i),i):r.length<=i.length?r:i}function mT(n){let t=n.getProperty(p.PORT_DUMMY);if(t!=null){let e=t.getLayer(),o=e.getNodes().indexOf(t);if(o>=0&&e.getNodes().splice(o,1),e.getNodes().length===0){let r=t.getGraph(),i=r.getLayers().indexOf(e);i>=0&&r.getLayers().splice(i,1)}}}var Gg=class{process(t,e){e.begin("Constraints Postprocessor",1);let o=0;for(let r of t.getLayers()){let i=0,s=!1;for(let a of r.getNodes())a.getType()===y.NORMAL&&(s=!0,a.setProperty(_.LAYERING_LAYER_ID,o),a.setProperty(_.CROSSING_MINIMIZATION_POSITION_ID,i),i++);s&&o++}e.done()}};var J=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};J.NONE=new J("NONE");J.FIRST=new J("FIRST");J.FIRST_SEPARATE=new J("FIRST_SEPARATE");J.LAST=new J("LAST");J.LAST_SEPARATE=new J("LAST_SEPARATE");var De=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};De.NONE=new De("NONE");De.OUTGOING_ONLY=new De("OUTGOING_ONLY");De.INCOMING_ONLY=new De("INCOMING_ONLY");var Hg=class{process(t,e){e.begin("Edge and layer constraint edge reversal",1);let o=PT(t);OT(t,o),e.done()}};function PT(n){let t=[];for(let e of n.getLayerlessNodes()){let o=e.getProperty(_.LAYERING_LAYER_CONSTRAINT),r=fm(o);r!=null?(e.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),r===De.INCOMING_ONLY?Xa(n,e,o,W.INPUT):r===De.OUTGOING_ONLY&&Xa(n,e,o,W.OUTPUT)):t.push(e)}return t}function OT(n,t){for(let e of t){let o=e.getProperty(_.LAYERING_LAYER_CONSTRAINT),r=fm(o);r!=null?(e.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),r===De.INCOMING_ONLY?Xa(n,e,o,W.INPUT):r===De.OUTGOING_ONLY&&Xa(n,e,o,W.OUTPUT)):e.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&e.getPorts().length>0&&ST(e)&&Xa(n,e,o,W.UNDEFINED)}}function ST(n){for(let t of n.getPorts()){let e=t.getSide()===u.EAST&&t.getNetFlow()>0,o=t.getSide()===u.WEST&&t.getNetFlow()<0;if(!(e||o))return!1;for(let r of t.getOutgoingEdges()){let i=r.getTarget().getNode().getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.LAST||i===J.LAST_SEPARATE)return!1}for(let r of t.getIncomingEdges()){let i=r.getSource().getNode().getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.FIRST||i===J.FIRST_SEPARATE)return!1}}return!0}function fm(n){switch(n){case J.FIRST:case J.FIRST_SEPARATE:return De.OUTGOING_ONLY;case J.LAST:case J.LAST_SEPARATE:return De.INCOMING_ONLY;default:return null}}function Xa(n,t,e,o){let r=t.getPorts().slice();for(let i of r){if(o===W.INPUT||o===W.UNDEFINED){let s=i.getOutgoingEdges().slice();for(let a of s)TT(e,a)&&a.reverse(n,!0)}if(o===W.OUTPUT||o===W.UNDEFINED){let s=i.getIncomingEdges().slice();for(let a of s)NT(e,a)&&a.reverse(n,!0)}}}function TT(n,t){if(t.getProperty(p.REVERSED))return!1;let e=t.getTarget().getNode();return!(n===J.LAST&&e.getType()===y.LABEL||e.getProperty(_.LAYERING_LAYER_CONSTRAINT)===J.LAST_SEPARATE)}function NT(n,t){if(t.getProperty(p.REVERSED))return!1;let e=t.getSource().getNode();return!(n===J.FIRST&&e.getType()===y.LABEL||e.getProperty(_.LAYERING_LAYER_CONSTRAINT)===J.FIRST_SEPARATE)}var vg=class{process(t,e){e.begin("End label post-processing",1);for(let o of t.getLayers())for(let r of o.getNodes())(r.getType()===y.NORMAL||r.getType()===y.EXTERNAL_PORT)&&r.hasProperty(p.END_LABELS)&&yT(r);e.done()}};function yT(n){let t=n.getProperty(p.END_LABELS);if(t==null||t.size===0)return;let e=n.getPosition();for(let o of t.values())o.getCellRectangle().move(e),o.applyLabelLayout();n.setProperty(p.END_LABELS,null)}var _m=-1,In=class{process(t,e){e.begin("End label pre-processing",1);let o=t.getProperty(_.SPACING_EDGE_LABEL),r=t.getProperty(_.SPACING_LABEL_LABEL),i=t.getProperty(_.DIRECTION),s=i!=null&&i.isVertical&&i.isVertical();for(let a of t.getLayers())for(let l of a.getNodes())IT(l,o,r,s);e.done()}static gatherLabels(t){return pm(t)}};function IT(n,t,e,o){let r=n.getPorts(),i=r.length,s=new Array(i);for(let l=0;l<i;l++){let c=r[l];c.id=l,s[l]=RT(pm(c),e,o)}LT(n,s,e,t,o);let a=new Map;for(let l=0;l<s.length;l++)s[l]!=null&&a.set(r[l],s[l]);a.size>0&&(n.setProperty(p.END_LABELS,a),xT(n,s))}function RT(n,t,e){if(n==null||n.length===0)return null;let o=new Ni(t,!e);for(let i of n)o.addLabel(i);let r=o.getCellRectangle();return r.height=o.getMinimumHeight(),r.width=o.getMinimumWidth(),o}function pm(n){let t=[],e=um(n,t),o=n.getProperty(p.PORT_DUMMY);if(o!=null){for(let r of o.getPorts())if(r.getProperty(p.ORIGIN)===n){let i=um(r,t);i>e&&(e=i)}}return t.length>0&&n.setProperty(p.MAX_EDGE_THICKNESS,e),e!==_m?t:null}function um(n,t){let e=_m,o=[];for(let r of n.getConnectedEdges()){let i=r.getProperty(_.EDGE_THICKNESS);if(i>e&&(e=i),r.getSource()===n)for(let s of r.getLabels())s.getProperty(_.EDGE_LABELS_PLACEMENT)===St.TAIL&&o.push(s);else for(let s of r.getLabels())s.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD&&o.push(s);for(let s of o)s.hasProperty(p.END_LABEL_EDGE)||s.setProperty(p.END_LABEL_EDGE,r),t.push(s);o.length=0}return e}function LT(n,t,e,o,r){let i=new Set;for(let s of n.getPorts())t[s.id]!=null&&(AT(s,t[s.id],o),i.add(s.getSide()));r?(Bg(n,t,u.EAST,2*e,o),Bg(n,t,u.WEST,2*e,o)):(Bg(n,t,u.NORTH,2*e,o),Bg(n,t,u.SOUTH,2*e,o))}function AT(n,t,e){let o=t.getCellRectangle(),r=n.getNode(),i=r.getSize(),s=r.getMargin(),a=n.getPosition(),l=new O(a.x+n.getAnchor().x,a.y+n.getAnchor().y),c=n.getProperty(p.MAX_EDGE_THICKNESS),g=DT(t)===Vt.ABOVE;switch(n.getSide()){case u.NORTH:{t.setVerticalAlignment(nt.BOTTOM),o.y=-s.top-e-o.height,g?(t.setHorizontalAlignment(lt.RIGHT),o.x=l.x-c-e-o.width):(t.setHorizontalAlignment(lt.LEFT),o.x=l.x+c+e);break}case u.EAST:{t.setHorizontalAlignment(lt.LEFT),o.x=i.x+s.right+e,g?(t.setVerticalAlignment(nt.BOTTOM),o.y=l.y-c-e-o.height):(t.setVerticalAlignment(nt.TOP),o.y=l.y+c+e);break}case u.SOUTH:{t.setVerticalAlignment(nt.TOP),o.y=i.y+s.bottom+e,g?(t.setHorizontalAlignment(lt.RIGHT),o.x=l.x-c-e-o.width):(t.setHorizontalAlignment(lt.LEFT),o.x=l.x+c+e);break}case u.WEST:{t.setHorizontalAlignment(lt.RIGHT),o.x=-s.left-e-o.width,g?(t.setVerticalAlignment(nt.BOTTOM),o.y=l.y-c-e-o.height):(t.setVerticalAlignment(nt.TOP),o.y=l.y+c+e);break}default:break}}function Bg(n,t,e,o,r){let i=fs.createForDirection(wT(e)).withGap(o,o).withStartCoordinate(CT(n,e,r));for(let s of n.getPorts(e))t[s.id]!=null&&i.addRectangle(t[s.id].getCellRectangle());i.removeOverlaps()}function CT(n,t,e){let o=n.getSize(),r=n.getMargin();switch(t){case u.NORTH:return-r.top-e;case u.SOUTH:return o.y+r.bottom+e;case u.EAST:return o.x+r.right+e;case u.WEST:return-r.left-e;default:return 0}}function xT(n,t){let e=n.getMargin(),o=n.getSize(),r=new dt(-e.left,-e.top,e.left+o.x+e.right,e.top+o.y+e.bottom);for(let i of t)i!=null&&r.union(i.getCellRectangle());e.left=-r.x,e.top=-r.y,e.right=r.width-e.left-o.x,e.bottom=r.height-e.top-o.y}function DT(n){return n.getLabels()[0].getProperty(p.LABEL_SIDE)}function wT(n){switch(n){case u.NORTH:return Qt.UP;case u.SOUTH:return Qt.DOWN;case u.EAST:return Qt.RIGHT;case u.WEST:return Qt.LEFT;default:return null}}var Ug=class{process(t,e){e.begin("Sort end labels",1);for(let o of t.getLayers())for(let r of o.getNodes())r.getType()===y.NORMAL&&MT(r,t);e.done()}};function MT(n,t){if(!n.hasProperty(p.END_LABELS))return;let e=n.getProperty(p.END_LABELS),o=!1;for(let r of n.getPorts())bT(r)&&(o||(GT(t),o=!0),HT(e.get(r)))}function bT(n){let t=0;for(let e of n.getIncomingEdges())e.getLabels().some(o=>o.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD)&&t++;for(let e of n.getOutgoingEdges())e.getLabels().some(o=>o.getProperty(_.EDGE_LABELS_PLACEMENT)===St.TAIL)&&t++;return t>=2}function GT(n){let t=0;for(let e of n)for(let o of e){o.id=t++;for(let r of o.getPorts())r.id=t++}}function HT(n){if(n==null)return;let t=new Map,e=n.getLabels();for(let r of e){let i=r.getProperty(p.END_LABEL_EDGE),s=t.get(i);s==null&&(s=[],t.set(i,s)),s.push(r)}let o=Array.from(t.entries());o.sort((r,i)=>{let s=r[0],a=i[0];if(s==null||a==null)return 0;let l=s.getSource().id-a.getSource().id;if(l!==0)return l;let c=s.getTarget().getNode().id-a.getTarget().getNode().id;return c!==0?c:a.getTarget().id-s.getTarget().id}),e.length=0;for(let[,r]of o)for(let i of r)e.push(i)}var ie=class{constructor(t){this.name=t}toString(){return this.name}};ie.NONE=new ie("NONE");ie.LEFT=new ie("LEFT");ie.RIGHT=new ie("RIGHT");ie.LEFT_RIGHT_CONSTRAINT_LOCKING=new ie("LEFT_RIGHT_CONSTRAINT_LOCKING");ie.LEFT_RIGHT_CONNECTION_LOCKING=new ie("LEFT_RIGHT_CONNECTION_LOCKING");ie.EDGE_LENGTH=new ie("EDGE_LENGTH");var Qr=Object.freeze({CONSERVATIVE:"CONSERVATIVE",CONSERVATIVE_SOFT:"CONSERVATIVE_SOFT",SLOPPY:"SLOPPY",values(){return[this.CONSERVATIVE,this.CONSERVATIVE_SOFT,this.SLOPPY]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var Fg=class n{constructor(...t){if(this.top=Number.MAX_VALUE,this.bottom=-Number.MAX_VALUE,this.left=Number.MAX_VALUE,this.right=-Number.MAX_VALUE,t.length===4&&t.every(e=>typeof e=="number")){let[e,o,r,i]=t;if(o>i)throw new RangeError("Top must be smaller or equal to bottom.");if(e>r)throw new RangeError("Left must be smaller or equal to right.");this.top=o,this.right=r,this.bottom=i,this.left=e;return}if(t.length===1){let e=t[0];if(e instanceof n){this.top=e.top,this.right=e.right,this.bottom=e.bottom,this.left=e.left;return}if(e instanceof O){this.top=e.y,this.bottom=e.y,this.right=e.x,this.left=e.x;return}if(typeof e.getPosition=="function"&&typeof e.getSize=="function"){let o=e.getPosition(),r=new O(o.x+e.getSize().x,o.y+e.getSize().y);this.top=Math.min(o.y,r.y),this.bottom=Math.max(o.y,r.y),this.left=Math.min(o.x,r.x),this.right=Math.max(o.x,r.x);return}if(Array.isArray(e)||typeof e[Symbol.iterator]=="function"){for(let o of e)this.union(o);return}}if(t.length>=1){for(let e of t)this.union(e);return}}union(t){if(t instanceof n){this.top=Math.min(this.top,t.top),this.right=Math.max(this.right,t.right),this.bottom=Math.max(this.bottom,t.bottom),this.left=Math.min(this.left,t.left);return}if(t instanceof O){this.top=Math.min(this.top,t.y),this.right=Math.max(this.right,t.x),this.bottom=Math.max(this.bottom,t.y),this.left=Math.min(this.left,t.x);return}if(typeof t.getPosition=="function"&&typeof t.getSize=="function"){this.union(t.getPosition());let e=t.getPosition();this.union(new O(e.x+t.getSize().x,e.y+t.getSize().y));return}}static union(t,e){if(e instanceof n){let s=new n(t);return s.union(e),s}let o=e[Symbol.iterator](),r=o.next();if(r.done)throw new RangeError("Empty rectangle collection");let i=new n(r.value);for(let s of o)i.union(s);return i}enlarge(t){this.top-=t,this.left-=t,this.right+=t,this.bottom+=t}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}getTop(){return this.top}getRight(){return this.right}getBottom(){return this.bottom}getLeft(){return this.left}getFromPortSide(t){switch(t){case u.NORTH:return this.top;case u.EAST:return this.right;case u.SOUTH:return this.bottom;case u.WEST:return this.left;default:return 0}}toNodeMargins(t){let e=new me,o=new n(0,0,t.getSize().x,t.getSize().y);return e.top=Math.max(0,o.top-this.top),e.left=Math.max(0,o.left-this.left),e.bottom=Math.max(0,this.bottom-o.bottom),e.right=Math.max(0,this.right-o.right),e}toString(){return"[top= "+this.top.toFixed(1)+",left= "+this.left.toFixed(1)+",bottom= "+this.bottom.toFixed(1)+",right= "+this.right.toFixed(1)+"]"}};var uo=1e-6,Rs=class n{constructor(...t){if(this.knotVector=[],this.controlPoints=[],this.dimNUBS=0,this.isUniform=!1,this.isClamped=!1,this.outerBox=null,this.isBezier=!1,this.minKnot=0,this.maxKnot=0,t.length===1&&t[0]instanceof n){let a=t[0];this.dimNUBS=a.dimNUBS,this.isUniform=a.isUniform,this.isClamped=a.isClamped,this.outerBox=a.outerBox,this.isBezier=a.isBezier,this.knotVector=a.knotVector.slice(),this.minKnot=a.minKnot,this.maxKnot=a.maxKnot,this.controlPoints=a.controlPoints.slice();return}if(t.length===6){let[a,l,c,g,h,d]=t;this.isClamped=a,this.isUniform=l,this.isBezier=c,this.dimNUBS=g,this.knotVector=h,this.controlPoints=d,this.minKnot=h[0],this.maxKnot=h[h.length-1];return}let e=t[0],o=t[1],r;if(t.length===3&&Array.isArray(t[2])?r=t[2].slice():t.length===3&&t[2]instanceof st?r=Array.from(t[2]):r=t.slice(2),o<1)throw new RangeError("The dimension must be at least 1!");for(;r.length<o+1;)r.unshift(r[0]);if(r.length<o+1)throw new RangeError("At least (dimension + 1) control points are necessary!");this.dimNUBS=o,this.isClamped=e,this.isUniform=!0,this.isBezier=!1,this._createUniformKnotVector(e,r.length+this.dimNUBS-1);let i=[],s=0;for(let a=0;a<this.dimNUBS-1;a++)i.push(this.knotVector[s++]);for(let a of r)i.push(this.knotVector[s++]),this.controlPoints.push(new Rn(a,i)),i.shift()}static generateDerivedNUBS(t){let e=t.isClamped,o=t.isUniform,r=t.isBezier,i=t.dimNUBS,s=i-1,a=t.knotVector,l=t.knotVector.slice(1,t.knotVector.length-1),c=[];for(let f=0;f<t.controlPoints.length-1;f++){let E=t.controlPoints[f+1].getCp().clone().sub(t.controlPoints[f].getCp()).scale(i/(a[f+i]-a[f]));c.push(E)}let g=[],h=0,d=[];for(let f=0;f<s-1;f++)g.push(l[h++]);for(let f of c)g.push(l[h++]),d.push(new Rn(f,g)),g.shift();return new n(e,o,r,s,l,d)}static generateInvertedNUBS(t){let e=[],o=t.knotVector[t.knotVector.length-1];for(let l of t.knotVector)e.unshift(o-l);let r=st.reverse(t.getControlPoints()),i=[],s=0,a=[];for(let l=0;l<t.dimNUBS-1;l++)i.push(e[s++]);for(let l of r)i.push(e[s++]),a.push(new Rn(l,i)),i.shift();return new n(t.isClamped,t.isUniform,t.isBezier,t.dimNUBS,e,a)}getDim(){return this.dimNUBS}getOuterBox(){return this.outerBox===null&&this._calculateOuterBox(),this.outerBox}setOuterBox(t){this.outerBox=t}getControlPoints(){let t=new st;for(let e of this.controlPoints)t.push(e.getCp());return t}getControlPoint(t){return this.controlPoints[t].getCp()}getControlPointsSize(){return this.controlPoints.length}getKnotVector(){return this.knotVector.slice()}_getIndexInKnotVector(t){for(let e=0;e<this.knotVector.length;e++)if(Math.abs(this.knotVector[e]-t)<uo)return e;return this.knotVector.length}_getMultiplicity(t){let e=0;for(let o of this.knotVector){let r=o-t;if(r>uo)return e;r>-uo&&e++}return e}_createUniformKnotVector(t,e){if(e<2*this.dimNUBS)throw new RangeError("The knot vector must have at least two times the dimension elements.");let o;if(t){this.minKnot=0,this.maxKnot=1;for(let i=0;i<this.dimNUBS;i++)this.knotVector.push(0);o=e+1-2*this.dimNUBS}else{o=e+1;let i=this.dimNUBS;this.minKnot=i/(o+1),this.maxKnot=(o-i)/o}let r=o;for(let i=1;i<o;i++)this.knotVector.push(i/r);if(this.isClamped)for(let i=0;i<this.dimNUBS;i++)this.knotVector.push(1)}_calculateOuterBox(){this.outerBox=new Fg(this.getControlPoints())}static _getTFromPolar(t){let e=0;for(let o of t)e+=o;return e/t.length}_insertKnot(t,e){let o;this.isClamped?o=this.dimNUBS:o=this.dimNUBS-1;let r=this.knotVector[o++],i=0;for(;r-t<uo;)r=this.knotVector[o++],i++;o--,this._insertKnotAtCurrentPosition(e,t,i,o)}_insertKnotAtCurrentPosition(t,e,o,r){let i=this._getMultiplicity(e);for(let s=0;s<t;s++){this.knotVector.splice(r,0,e),r++;let a=[],l=o,c=this.controlPoints[l++];for(let d=i+s;d<this.dimNUBS;d++){let f=c;c=this.controlPoints[l++],a.push(new Rn(f,c,e))}let g=o+1,h=Math.max(0,a.length-1);this.controlPoints.splice(g,h,...a),s<t-1?o+=1:o+=1+a.length}return{cpIdx:o,knotIdx:r}}static _getFirstVerticalPoint(t,e,o){let r=n.generateDerivedNUBS(t),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroXOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.x),a++;return t._getPointOnCurve(l,!1)}static _getLastVerticalPoint(t,e,o){let r=n.generateInvertedNUBS(n.generateDerivedNUBS(t)),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroXOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.x),a++;let c=t.getKnotVector()[t.getKnotVector().length-1];return t._getPointOnCurve(c-l,!1)}static _getFirstHorizontalPoint(t,e,o){let r=n.generateDerivedNUBS(t),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroYOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.y),a++;return t._getPointOnCurve(l,!1)}static _getLastHorizontalPoint(t,e,o){let r=n.generateInvertedNUBS(n.generateDerivedNUBS(t)),i=Number.POSITIVE_INFINITY,s=null,a=0,l=0;for(;i>e&&a<o;)l=n._getZeroYOfControlPoligon(r),s=r._getPointOnCurve(l,!0),i=Math.abs(s.y),a++;let c=t.getKnotVector()[t.getKnotVector().length-1];return t._getPointOnCurve(c-l,!1)}_getPointOnCurve(t,e=!1){let o=this._getMultiplicity(t);if(o===this.dimNUBS)return this.getControlPoint(this._getIndexInKnotVector(t));if(e)return this._insertKnot(t,this.dimNUBS-o),this.getControlPoint(this._getIndexInKnotVector(t));let r=new n(this);return r._insertKnot(t,this.dimNUBS-o),r.getControlPoint(r._getIndexInKnotVector(t))}static _getZeroYOfControlPoligon(t){let e=t.controlPoints;if(e.length===0)return 0;let o=e[0],r=o.getCp().y,i=r>uo,s=r<-uo;for(let a=1;a<e.length;a++){let l=o,c=r,g=i,h=s;if(o=e[a],r=o.getCp().y,i=r>uo,s=r<-uo,!(i||s))return n._getTFromPolar(o.getPolarCoordinate());if(g&&s||h&&i){let d=c/(c-r),f=n._getTFromPolar(l.getPolarCoordinate()),E=n._getTFromPolar(o.getPolarCoordinate());return d*f+(1-d)*E}}return 0}static _getZeroXOfControlPoligon(t){let e=t.controlPoints;if(e.length===0)return 0;let o=e[0],r=o.getCp().x,i=r>uo,s=r<-uo;for(let a=1;a<e.length;a++){let l=o,c=r,g=i,h=s;if(o=e[a],r=o.getCp().x,i=r>uo,s=r<-uo,!(i||s))return n._getTFromPolar(o.getPolarCoordinate());if(g&&s||h&&i){let d=c/(c-r),f=n._getTFromPolar(l.getPolarCoordinate()),E=n._getTFromPolar(o.getPolarCoordinate());return d*f+(1-d)*E}}return 0}toBezier(){if(this.isBezier)return;let t;this.isClamped?t=this.dimNUBS:(this.knotVector.splice(0,this.dimNUBS-1),t=0);let e=0,o=this.knotVector[t++];for(;this.maxKnot-o>uo;){let r=o,i=0;for(;Math.abs(o-r)<uo;)i++,o=this.knotVector[t++],e++;if(i<this.dimNUBS){t--;let s=this._insertKnotAtCurrentPosition(this.dimNUBS-i,r,e,t);e=s.cpIdx,t=s.knotIdx,o=this.knotVector[t++]}e--}this.isClamped||this.knotVector.splice(t,this.dimNUBS-1),this.isClamped=!0,this.isBezier=!0}getBezierCP(t=!1,e=!1){this.isBezier||this.toBezier();let o=new st,r=0;t||(r=1);for(let i=r;i<this.controlPoints.length;i++)o.push(this.controlPoints[i].getCp());return e||o.pop(),o}static generateNiceCurve(){let t=new st,e=new O(5.5,23),o=new O(2.5,12),r=new O(5,10),i=new O(5,9),s=new O(3.8,5.5),a=new O(7,4),l=new O(7,3.5),c=new O(6,2.2),g=new O(8,.5),h=(d,f)=>new O(f+f-d.x,d.y);return t.push(e,e,e,o,r,i,s,a,l,c,g,h(c,g.x),h(l,g.x),h(a,g.x),h(s,g.x),h(i,g.x),h(r,g.x),h(o,g.x),h(e,g.x),h(e,g.x),h(e,g.x)),t.scale(5),t.offset(-50,-80),new n(!0,3,t)}toString(){return`[${this.controlPoints.join(", ")}]`}};Rs.DIM=3;var Rn=class n{constructor(t,e,o){if(arguments.length===2){if(t instanceof n){this.cp=t.getCp().clone(),this.polarCoordinate=t.polarCoordinate.slice();return}this.cp=t.clone(),this.polarCoordinate=e.slice();return}if(arguments.length===1){let f=t;this.cp=f.getCp().clone(),this.polarCoordinate=f.polarCoordinate.slice();return}let r=t,i=e,s=o,a=r.polarCoordinate[0],l=i.polarCoordinate[i.polarCoordinate.length-1],c=r.cp.clone().scale(l-s),g=i.cp.clone().scale(s-a),h=c.add(g);h.scale(1/(l-a)),this.cp=h,this.polarCoordinate=[];let d=!0;for(let f=1;f<r.polarCoordinate.length;f++){let E=r.polarCoordinate[f];d&&E-s>uo&&(this.polarCoordinate.push(s),d=!1),this.polarCoordinate.push(E)}d&&this.polarCoordinate.push(s)}getCp(){return this.cp}setCp(t){this.cp=t}getPolarCoordinate(){return this.polarCoordinate}setPolarCoordinate(t){this.polarCoordinate=t}toString(){return`[${this.polarCoordinate.join(",")}] (${this.cp.x.toFixed(2)}, ${this.cp.y.toFixed(2)})`}};var v=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};v.COMMENTS=new v("COMMENTS");v.EXTERNAL_PORTS=new v("EXTERNAL_PORTS");v.HYPEREDGES=new v("HYPEREDGES");v.HYPERNODES=new v("HYPERNODES");v.NON_FREE_PORTS=new v("NON_FREE_PORTS");v.NORTH_SOUTH_PORTS=new v("NORTH_SOUTH_PORTS");v.SELF_LOOPS=new v("SELF_LOOPS");v.CENTER_LABELS=new v("CENTER_LABELS");v.END_LABELS=new v("END_LABELS");v.PARTITIONS=new v("PARTITIONS");var Ln=class Ln{constructor(t,e,o,r){this._type=t,this._weight=r,this._source=null,this._target=null,this.setSource(e),this.setTarget(o)}static createAndAddRegular(t,e,o){return new Ln(Hr.REGULAR,t,e,o)}static createAndAddCritical(t,e){return new Ln(Hr.CRITICAL,t,e,Ln.CRITICAL_DEPENDENCY_WEIGHT)}remove(){this.setSource(null),this.setTarget(null)}reverse(){let t=this._source,e=this._target;this.setSource(e),this.setTarget(t)}getType(){return this._type}getSource(){return this._source}setSource(t){if(this._source!=null){let e=this._source.getOutgoingSegmentDependencies(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._source=t,this._source!=null&&this._source.getOutgoingSegmentDependencies().push(this)}getTarget(){return this._target}setTarget(t){if(this._target!=null){let e=this._target.getIncomingSegmentDependencies(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._target=t,this._target!=null&&this._target.getIncomingSegmentDependencies().push(this)}getWeight(){return this._weight}toString(){return`${this._source}->${this._target} (${this._type})`}};Z(Ln,"CRITICAL_DEPENDENCY_WEIGHT",1);var $e=Ln,Hr=Object.freeze({REGULAR:"REGULAR",CRITICAL:"CRITICAL"});var Ka=class{static detectCycles(t,e,o){let r=[],i=[],s=[];vT(t,i,s,e),BT(t,i,s,e,o);for(let a of t)for(let l of a.getOutgoingSegmentDependencies())(!e||l.getType()===Hr.CRITICAL)&&a.mark>l.getTarget().mark&&r.push(l);return r}};function vT(n,t,e,o){let r=-1;for(let i of n){i.mark=r--;let s=0;for(let g of i.getIncomingSegmentDependencies())g.getType()===Hr.CRITICAL&&(s+=g.getWeight());let a=0;for(let g of i.getOutgoingSegmentDependencies())g.getType()===Hr.CRITICAL&&(a+=g.getWeight());let l=s,c=a;if(!o){l=0;for(let g of i.getIncomingSegmentDependencies())l+=g.getWeight();c=0;for(let g of i.getOutgoingSegmentDependencies())c+=g.getWeight()}i.setInWeight(l),i.setCriticalInWeight(s),i.setOutWeight(c),i.setCriticalOutWeight(a),c===0?e.push(i):l===0&&t.push(i)}}function BT(n,t,e,o,r){let i=new Set(n),s=[],a=n.length,l=a-1,c=a+1;for(;i.size>0;){for(;e.length>0;){let f=e.shift();i.delete(f),f.mark=l--,Ju(f,t,e,o)}for(;t.length>0;){let f=t.shift();i.delete(f),f.mark=c++,Ju(f,t,e,o)}let h=Number.MIN_SAFE_INTEGER;s.length=0;let d=!1;for(let f of[...i].sort((E,P)=>E.mark-P.mark)){if(!o&&f.getCriticalOutWeight()>0&&f.getCriticalInWeight()<=0){s.length=0,s.push(f),d=!0;break}let E=f.getOutWeight()-f.getInWeight();E>=h&&(E>h&&(s.length=0,h=E),s.push(f))}if(s.length>0){let f=s[r.nextInt(s.length)];i.delete(f),f.mark=c++,Ju(f,t,e,o),s.length=0}}let g=n.length+1;for(let h of n)h.mark<a&&(h.mark=h.mark+g)}function Ju(n,t,e,o){for(let r of n.getOutgoingSegmentDependencies())if(!o||r.getType()===Hr.CRITICAL){let i=r.getTarget();i.mark<0&&r.getWeight()>0&&(i.setInWeight(i.getInWeight()-r.getWeight()),r.getType()===Hr.CRITICAL&&i.setCriticalInWeight(i.getCriticalInWeight()-r.getWeight()),i.getInWeight()<=0&&i.getOutWeight()>0&&t.push(i))}for(let r of n.getIncomingSegmentDependencies())if(!o||r.getType()===Hr.CRITICAL){let i=r.getSource();i.mark<0&&r.getWeight()>0&&(i.setOutWeight(i.getOutWeight()-r.getWeight()),r.getType()===Hr.CRITICAL&&i.setCriticalOutWeight(i.getCriticalOutWeight()-r.getWeight()),i.getOutWeight()<=0&&i.getInWeight()>0&&e.push(i))}}var An=class n{constructor(t){this._routingStrategy=t,this._ports=[],this.mark=0,this._routingSlot=0,this._startPosition=Number.NaN,this._endPosition=Number.NaN,this._incomingConnectionCoordinates=[],this._outgoingConnectionCoordinates=[],this._outgoingSegmentDependencies=[],this._outDepWeight=0,this._criticalOutDepWeight=0,this._incomingSegmentDependencies=[],this._inDepWeight=0,this._criticalInDepWeight=0,this._splitPartner=null,this._splitBy=null}addPortPositions(t,e){e.set(t,this),this._ports.push(t);let o=this._routingStrategy.getPortPositionOnHyperNode(t);t.getSide()===this._routingStrategy.getSourcePortSide()?Em(this._incomingConnectionCoordinates,o):Em(this._outgoingConnectionCoordinates,o),this.recomputeExtent();for(let r of t.getConnectedPorts())e.has(r)||this.addPortPositions(r,e)}getPorts(){return this._ports}getRoutingSlot(){return this._routingSlot}setRoutingSlot(t){this._routingSlot=t}getStartCoordinate(){return this._startPosition}getEndCoordinate(){return this._endPosition}getIncomingConnectionCoordinates(){return this._incomingConnectionCoordinates}getOutgoingConnectionCoordinates(){return this._outgoingConnectionCoordinates}getOutgoingSegmentDependencies(){return this._outgoingSegmentDependencies}getIncomingSegmentDependencies(){return this._incomingSegmentDependencies}getOutWeight(){return this._outDepWeight}setOutWeight(t){this._outDepWeight=t}getCriticalOutWeight(){return this._criticalOutDepWeight}setCriticalOutWeight(t){this._criticalOutDepWeight=t}getInWeight(){return this._inDepWeight}setInWeight(t){this._inDepWeight=t}getCriticalInWeight(){return this._criticalInDepWeight}setCriticalInWeight(t){this._criticalInDepWeight=t}getSplitPartner(){return this._splitPartner}setSplitPartner(t){this._splitPartner=t}getSplitBy(){return this._splitBy}setSplitBy(t){this._splitBy=t}getLength(){return this.getEndCoordinate()-this.getStartCoordinate()}representsHyperedge(){return this._incomingConnectionCoordinates.length+this._outgoingConnectionCoordinates.length>2}isDummy(){return this._splitPartner!=null&&this._splitBy==null}recomputeExtent(){this._startPosition=Number.NaN,this._endPosition=Number.NaN,this._recomputeExtentOne(this._incomingConnectionCoordinates),this._recomputeExtentOne(this._outgoingConnectionCoordinates)}_recomputeExtentOne(t){if(t.length===0)return;let e=t[0],o=t[t.length-1];this._startPosition=Number.isNaN(this._startPosition)?e:Math.min(this._startPosition,e),this._endPosition=Number.isNaN(this._endPosition)?o:Math.max(this._endPosition,o)}simulateSplit(){let t=new n(this._routingStrategy),e=new n(this._routingStrategy);return t._incomingConnectionCoordinates.push(...this._incomingConnectionCoordinates),t._splitBy=this._splitBy,t._splitPartner=e,t.recomputeExtent(),e._outgoingConnectionCoordinates.push(...this._outgoingConnectionCoordinates),e._splitPartner=t,e.recomputeExtent(),Gt.of(t,e)}splitAt(t){for(this._splitPartner=new n(this._routingStrategy),this._splitPartner.setSplitPartner(this),this._splitPartner._outgoingConnectionCoordinates.push(...this._outgoingConnectionCoordinates),this._outgoingConnectionCoordinates.length=0,this._outgoingConnectionCoordinates.push(t),this._splitPartner._incomingConnectionCoordinates.push(t),this.recomputeExtent(),this._splitPartner.recomputeExtent();this._incomingSegmentDependencies.length>0;)this._incomingSegmentDependencies[0].remove();for(;this._outgoingSegmentDependencies.length>0;)this._outgoingSegmentDependencies[0].remove();return this._splitPartner}compareTo(t){return this.mark-t.mark}toString(){let t=[];for(let e of this._ports){let o=e.getNode().getDesignation();o==null&&(o="n"+e.getNode().getIndex()),t.push(o)}return"{"+t.join(",")+"}"}};function Em(n,t){for(let e=0;e<n.length;e++){if(n[e]===t)return;if(n[e]>t){n.splice(e,0,t);return}}n.push(t)}var kg=class{constructor(t){this._routingGenerator=t}splitSegments(t,e,o){if(t.length===0)return;let r=this._findFreeAreas(e,o),s=[...this._decideWhichSegmentsToSplit(t)].sort((a,l)=>a.getLength()-l.getLength());for(let a of s)this._split(a,e,r,o)}_findFreeAreas(t,e){let o=[],r=[];for(let i of t){for(let s of i.getIncomingConnectionCoordinates())r.push(s);for(let s of i.getOutgoingConnectionCoordinates())r.push(s)}r.sort((i,s)=>i-s);for(let i=1;i<r.length;i++)r[i]-r[i-1]>=2*e&&o.push(new Za(r[i-1]+e,r[i]-e));return o}_decideWhichSegmentsToSplit(t){let e=new Set;for(let o of t){let r=o.getSource(),i=o.getTarget();if(e.has(r)||e.has(i))continue;let s=r,a=i;r.representsHyperedge()&&!i.representsHyperedge()&&(s=i,a=r),e.add(s),s.setSplitBy(a)}return e}_split(t,e,o,r){let i=this._computePositionToSplitAndUpdateFreeAreas(t,o,r);e.push(t.splitAt(i)),this._updateDependencies(t,e)}_updateDependencies(t,e){let o=t.getSplitBy(),r=t.getSplitPartner();$e.createAndAddCritical(t,o),$e.createAndAddCritical(o,r);for(let i of e)i!==o&&i!==t&&i!==r&&(this._routingGenerator.createDependencyIfNecessary(i,t),this._routingGenerator.createDependencyIfNecessary(i,r))}_computePositionToSplitAndUpdateFreeAreas(t,e,o){let r=-1,i=-1;for(let a=0;a<e.length;a++){let l=e[a];if(l.startPosition>t.getEndCoordinate())break;l.endPosition>=t.getStartCoordinate()&&(r<0&&(r=a),i=a)}let s=UT(t);if(r>=0){let a=this._chooseBestAreaIndex(t,e,r,i);s=Qu(e[a]),this._useArea(e,a,o)}return s}_chooseBestAreaIndex(t,e,o,r){let i=o;if(o<r){let s=t.simulateSplit(),a=s.getFirst(),l=s.getSecond(),c=e[i],g=this._rateArea(t,a,l,c);for(let h=o+1;h<=r;h++){let d=e[h],f=this._rateArea(t,a,l,d);this._isBetter(d,f,c,g)&&(c=d,g=f,i=h)}}return i}_rateArea(t,e,o,r){let i=Qu(r);e.getOutgoingConnectionCoordinates().length=0,e.getOutgoingConnectionCoordinates().push(i),o.getIncomingConnectionCoordinates().length=0,o.getIncomingConnectionCoordinates().push(i);let s=new t_(0,0);for(let a of t.getIncomingSegmentDependencies()){let l=a.getSource();this._updateConsideringBothOrderings(s,e,l),this._updateConsideringBothOrderings(s,o,l)}for(let a of t.getOutgoingSegmentDependencies()){let l=a.getTarget();this._updateConsideringBothOrderings(s,e,l),this._updateConsideringBothOrderings(s,o,l)}return s.dependencies+=2,s.crossings+=this._countCrossingsForSingleOrdering(e,t.getSplitBy()),s.crossings+=this._countCrossingsForSingleOrdering(t.getSplitBy(),o),s}_updateConsideringBothOrderings(t,e,o){let r=this._countCrossingsForSingleOrdering(e,o),i=this._countCrossingsForSingleOrdering(o,e);r===i?r>0&&(t.dependencies+=2,t.crossings+=r):(t.dependencies+=1,t.crossings+=Math.min(r,i))}_countCrossingsForSingleOrdering(t,e){return se.countCrossings(t.getOutgoingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate())+se.countCrossings(e.getIncomingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate())}_isBetter(t,e,o,r){return e.crossings<r.crossings||e.crossings===r.crossings&&(e.dependencies<r.dependencies||e.dependencies===r.dependencies&&t.size>o.size)}_useArea(t,e,o){let r=t[e];if(t.splice(e,1),r.size/2>=o){let i=e,s=Qu(r),a=s-o;r.startPosition<=a&&t.splice(i++,0,new Za(r.startPosition,a));let l=s+o;l<=r.endPosition&&t.splice(i,0,new Za(l,r.endPosition))}}},Za=class{constructor(t,e){this.startPosition=t,this.endPosition=e,this.size=e-t}},t_=class{constructor(t,e){this.dependencies=t,this.crossings=e}};function UT(n){return(n.getStartCoordinate()+n.getEndCoordinate())/2}function Qu(n){return(n.startPosition+n.endPosition)/2}var Hi=class{constructor(){this._createdJunctionPoints=new Set}addJunctionPointIfNecessary(t,e,o,r){let i=r?o.y:o.x;if(this._createdJunctionPoints.has(o.x+","+o.y))return;let s=i>e.getStartCoordinate()&&i<e.getEndCoordinate(),a=!1,l=e.getIncomingConnectionCoordinates(),c=e.getOutgoingConnectionCoordinates();if(l.length>0&&c.length>0&&(a=a||Math.abs(i-l[0])<se.TOLERANCE&&Math.abs(i-c[0])<se.TOLERANCE,a=a||Math.abs(i-l[l.length-1])<se.TOLERANCE&&Math.abs(i-c[c.length-1])<se.TOLERANCE),s||a){let g=t.getProperty(_.JUNCTION_POINTS);g==null&&(g=new st,t.setProperty(_.JUNCTION_POINTS,g));let h=o.clone?o.clone():{x:o.x,y:o.y};g.add(h),this._createdJunctionPoints.add(h.x+","+h.y)}}getCreatedJunctionPoints(){return this._createdJunctionPoints}clearCreatedJunctionPoints(){this._createdJunctionPoints.clear()}getPortPositionOnHyperNode(t){throw new Error("Abstract method")}getSourcePortSide(){throw new Error("Abstract method")}getTargetPortSide(){throw new Error("Abstract method")}calculateBendPoints(t,e,o){throw new Error("Abstract method")}};var Wg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().x+t.getPosition().x+t.getAnchor().x}getSourcePortSide(){return u.SOUTH}getTargetPortSide(){return u.NORTH}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e+t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().x;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().x;if(Math.abs(s-c)<=se.TOLERANCE)continue;let g=r,h=t,d=new O(s,g);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1),g=e+f.getRoutingSlot()*o,h=f,d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}d=new O(c,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}}}};var qe=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};qe.WEST_TO_EAST=new qe("WEST_TO_EAST");qe.NORTH_TO_SOUTH=new qe("NORTH_TO_SOUTH");qe.SOUTH_TO_NORTH=new qe("SOUTH_TO_NORTH");var zg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().x+t.getPosition().x+t.getAnchor().x}getSourcePortSide(){return u.NORTH}getTargetPortSide(){return u.SOUTH}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e-t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().x;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().x;if(Math.abs(s-c)<=se.TOLERANCE)continue;let g=r,h=t,d=new O(s,g);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1),g=e-f.getRoutingSlot()*o,h=f,d=new O(E,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}d=new O(c,g),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!1)}}}};var Yg=class extends Hi{getPortPositionOnHyperNode(t){return t.getNode().getPosition().y+t.getPosition().y+t.getAnchor().y}getSourcePortSide(){return u.EAST}getTargetPortSide(){return u.WEST}calculateBendPoints(t,e,o){if(t.isDummy())return;let r=e+t.getRoutingSlot()*o;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor().y;for(let a of i.getOutgoingEdges()){if(a.isSelfLoop&&a.isSelfLoop())continue;let c=a.getTarget().getAbsoluteAnchor().y;if(Math.abs(s-c)<=se.TOLERANCE)continue;let g=r,h=t,d=new O(g,s);a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0);let f=t.getSplitPartner();if(f!=null){let E=f.getIncomingConnectionCoordinates()[0];d=new O(g,E),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0),g=e+f.getRoutingSlot()*o,h=f,d=new O(g,E),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0)}d=new O(g,c),a.getBendPoints().add(d),this.addJunctionPointIfNecessary(a,h,d,!0)}}}};function mm(n){switch(n){case qe.WEST_TO_EAST:return new Yg;case qe.NORTH_TO_SOUTH:return new Wg;case qe.SOUTH_TO_NORTH:return new zg;default:throw new Error("Unknown routing direction: "+n)}}var ja=-1,FT=.5,kT=.2,Pm=1,Om=16,se=class n{constructor(t,e,o=null){this._routingStrategy=mm(t),this._edgeSpacing=e,this._conflictThreshold=FT*e,this._criticalConflictThreshold=0,this._debugPrefix=o,this._segmentSplitter=null}routeEdges(t,e,o,r,i,s){let a=new Map,l=[];this._createHyperEdgeSegments(o,this._routingStrategy.getSourcePortSide(),l,a),this._createHyperEdgeSegments(i,this._routingStrategy.getTargetPortSide(),l,a),this._criticalConflictThreshold=kT*this._minimumHorizontalSegmentDistance(l);let c=0;for(let d=0;d<l.length-1;d++){let f=l[d];for(let E=d+1;E<l.length;E++)c+=this.createDependencyIfNecessary(f,l[E])}let g=e.getProperty(p.RANDOM);c>=2&&this._breakCriticalCycles(l,g),n.breakNonCriticalCycles(l,g),n._topologicalNumbering(l);let h=-1;for(let d of l)Math.abs(d.getStartCoordinate()-d.getEndCoordinate())<n.TOLERANCE||(h=Math.max(h,d.getRoutingSlot()),this._routingStrategy.calculateBendPoints(d,s,this._edgeSpacing));return this._routingStrategy.clearCreatedJunctionPoints(),h+1}_createHyperEdgeSegments(t,e,o,r){if(t!=null)for(let i of t)for(let s of i.getPorts(W.OUTPUT,e)){let a=r.get(s);a==null&&(a=new An(this._routingStrategy),o.push(a),a.addPortPositions(s,r))}}createDependencyIfNecessary(t,e){if(Math.abs(t.getStartCoordinate()-t.getEndCoordinate())<n.TOLERANCE||Math.abs(e.getStartCoordinate()-e.getEndCoordinate())<n.TOLERANCE)return 0;let o=this._countConflicts(t.getOutgoingConnectionCoordinates(),e.getIncomingConnectionCoordinates()),r=this._countConflicts(e.getOutgoingConnectionCoordinates(),t.getIncomingConnectionCoordinates()),i=o===ja||r===ja,s=0;if(i)o===ja&&($e.createAndAddCritical(e,t),s++),r===ja&&($e.createAndAddCritical(t,e),s++);else{let a=n.countCrossings(t.getOutgoingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate());a+=n.countCrossings(e.getIncomingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate());let l=n.countCrossings(e.getOutgoingConnectionCoordinates(),t.getStartCoordinate(),t.getEndCoordinate());l+=n.countCrossings(t.getIncomingConnectionCoordinates(),e.getStartCoordinate(),e.getEndCoordinate());let c=Pm*o+Om*a,g=Pm*r+Om*l;c<g?$e.createAndAddRegular(t,e,g-c):c>g?$e.createAndAddRegular(e,t,c-g):c>0&&g>0&&($e.createAndAddRegular(t,e,0),$e.createAndAddRegular(e,t,0))}return s}_countConflicts(t,e){let o=0;if(t.length===0||e.length===0)return 0;let r=0,i=0,s=t[r],a=e[i],l=!0;do{if(s>a-this._criticalConflictThreshold&&s<a+this._criticalConflictThreshold)return ja;s>a-this._conflictThreshold&&s<a+this._conflictThreshold&&o++,s<=a&&r+1<t.length?s=t[++r]:a<=s&&i+1<e.length?a=e[++i]:l=!1}while(l);return o}static countCrossings(t,e,o){let r=0;for(let i of t){if(i>o)break;i>=e&&r++}return r}_minimumHorizontalSegmentDistance(t){let e=[],o=[];for(let s of t){for(let a of s.getIncomingConnectionCoordinates())e.push(a);for(let a of s.getOutgoingConnectionCoordinates())o.push(a)}let r=n._minimumDifference(e),i=n._minimumDifference(o);return Math.min(r,i)}static _minimumDifference(t){let e=[...new Set(t)].sort((r,i)=>r-i),o=Number.MAX_VALUE;for(let r=1;r<e.length;r++)o=Math.min(o,e[r]-e[r-1]);return o}_breakCriticalCycles(t,e){let o=Ka.detectCycles(t,!0,e);this._segmentSplitter==null&&(this._segmentSplitter=new kg(this)),this._segmentSplitter.splitSegments(o,t,this._criticalConflictThreshold)}static breakNonCriticalCycles(t,e){let o=Ka.detectCycles(t,!1,e);for(let r of o)r.getWeight()===0?r.remove():r.reverse()}static _topologicalNumbering(t){let e=[],o=[];for(let i of t)i.setInWeight(i.getIncomingSegmentDependencies().length),i.setOutWeight(i.getOutgoingSegmentDependencies().length),i.getInWeight()===0&&e.push(i),i.getOutWeight()===0&&i.getIncomingConnectionCoordinates().length===0&&o.push(i);let r=-1;for(;e.length>0;){let i=e.shift();for(let s of i.getOutgoingSegmentDependencies()){let a=s.getTarget();a.setRoutingSlot(Math.max(a.getRoutingSlot(),i.getRoutingSlot()+1)),r=Math.max(r,a.getRoutingSlot()),a.setInWeight(a.getInWeight()-1),a.getInWeight()===0&&e.push(a)}}if(r>-1){for(let i of o)i.setRoutingSlot(r);for(;o.length>0;){let i=o.shift();for(let s of i.getIncomingSegmentDependencies()){let a=s.getSource();a.getIncomingConnectionCoordinates().length>0||(a.setRoutingSlot(Math.min(a.getRoutingSlot(),i.getRoutingSlot()-1)),a.setOutWeight(a.getOutWeight()-1),a.getOutWeight()===0&&o.push(a))}}}}};se.TOLERANCE=.001;function Ls(n){let t=n.getProperty(p.EXT_PORT_SIDE);return n.getType()===y.EXTERNAL_PORT&&(t===u.WEST||t===u.EAST)}var Vg=class{getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);if(!e)return null;let o=K.create(),r=!1;return e.has(v.HYPEREDGES)&&(o.addBefore(D.P4_NODE_PLACEMENT,w.HYPEREDGE_DUMMY_MERGER),o.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR),r=!0),(e.has(v.NON_FREE_PORTS)||t.getProperty(_.FEEDBACK_EDGES))&&(o.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR),e.has(v.NORTH_SOUTH_PORTS)&&(o.addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)),r=!0),e.has(v.EXTERNAL_PORTS)&&(o.addBefore(D.P3_NODE_ORDERING,w.HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR),o.addBefore(D.P4_NODE_PLACEMENT,w.HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER),r=!0),e.has(v.SELF_LOOPS)&&(o.addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR),o.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER),o.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER),o.addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR),r=!0),e.has(v.HYPERNODES)&&(o.addAfter(D.P5_EDGE_ROUTING,w.HYPERNODE_PROCESSOR),r=!0),e.has(v.CENTER_LABELS)&&(o.addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER),o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER),o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),o.addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER),r=!0),e.has(v.END_LABELS)&&(o.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),o.addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR),o.addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR),r=!0),r?o:null}process(t,e){e&&e.begin&&e.begin("Orthogonal edge routing",1);let o=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),r=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),s=new se(qe.WEST_TO_EAST,r,null),a=0,l=t.getLayers(),c=-1,g=null,h=null,d=-1;for(;;){c++;let f=c<l.length?l[c]:null,E=f==null?null:f.getNodes(),P=c-1;g!=null&&(z.placeNodesHorizontally(g,a),a+=g.getSize().x);let S=g==null?a:a+i,T=s.routeEdges(e,t,h,d,E,S),N=g==null||h.every(Ls),I=f==null||E.every(Ls);if(T>0){let C=(T-1)*r;g!=null&&(C+=i),f!=null&&(C+=i),C<o&&!N&&!I&&(C=o),a+=C}else!N&&!I&&(a+=o);if(g=f,h=E,d=P,f==null)break}t.getSize().x=a,e&&e.done&&e.done()}};var Cn=class n{constructor(t,e,o){if(this.handled=!1,this.leftPorts=new Set,this.rightPorts=new Set,this.outgoing=[],this.incoming=[],this.mark=0,this.inweight=0,this.outweight=0,this.rank=0,this.edges=new Set,this.boundingBox=new dt,this.isWestOfInitialLayer=!1,this.xDelta=0,this.sourcePort=null,this.targetPort=null,this.initialSegment=!1,this.lastSegment=!1,this.sourceNode=null,this.targetNode=null,this.inverseOrder=!1,this.hyperEdgeTopYPos=0,this.hyperEdgeBottomYPos=0,this.centerControlPointY=0,this.edgeInformation=new Map,e instanceof Set||Array.isArray(e)){let r=t,i=e;o===Fe.LEFT?this.leftPorts.add(r):this.rightPorts.add(r);let a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of i){let h=g.getFirst(),d=g.getSecond(),f=d.getSource();f===r&&(f=d.getTarget()),h===Fe.LEFT?this.leftPorts.add(f):this.rightPorts.add(f);let E=n._anchorY(f);a=Math.min(a,E),l=Math.max(l,E)}let c=n._anchorY(r);this._setRelevantPositions(c,a,l);for(let g of i)this._addEdge(g.getSecond());this.isStraight=!1}else{let r=t,i=e,s=o;i===Fe.LEFT?this.leftPorts.add(r.getSource()):this.rightPorts.add(r.getSource()),s===Fe.LEFT?this.leftPorts.add(r.getTarget()):this.rightPorts.add(r.getTarget()),this._addEdge(r);let a=n._anchorY(r.getSource()),l=n._anchorY(r.getTarget());this._setRelevantPositions(a,l,l),this.isStraight=Math.abs(a-l)<WT}}_addEdge(t){this.edges.add(t);let e=new e_;this.edgeInformation.set(t,e),e.startY=n._anchorY(t.getSource()),e.endY=n._anchorY(t.getTarget()),e.normalSourceNode=n._isNormalNode(t.getSource().getNode()),e.normalTargetNode=n._isNormalNode(t.getTarget().getNode()),e.invertedLeft=t.getSource().getSide()===u.WEST,e.invertedRight=t.getTarget().getSide()===u.EAST}static _anchorY(t){return u.SIDES_NORTH_SOUTH.has(t.getSide())?t.getProperty(p.SPLINE_NS_PORT_Y_COORD):t.getAbsoluteAnchor().y}static _isNormalNode(t){let e=t.getType();return e===y.NORMAL||e===y.BREAKING_POINT}isHyperEdge(){return this.edges.size>1}compareTo(t){return this.mark-t.mark}_setRelevantPositions(t,e,o){this.boundingBox.y=Math.min(t,e),this.boundingBox.height=Math.max(t,o)-this.boundingBox.y,t<e?(this.centerControlPointY=Sm*(t+e),this.hyperEdgeTopYPos=Xg*this.centerControlPointY+$a*t,this.hyperEdgeBottomYPos=Xg*this.centerControlPointY+$a*e):(this.centerControlPointY=Sm*(t+o),this.hyperEdgeTopYPos=Xg*this.centerControlPointY+$a*o,this.hyperEdgeBottomYPos=Xg*this.centerControlPointY+$a*t)}},e_=class{constructor(){this.startY=0,this.endY=0,this.normalSourceNode=!1,this.normalTargetNode=!1,this.invertedLeft=!1,this.invertedRight=!1}},Fe=Object.freeze({LEFT:"LEFT",RIGHT:"RIGHT"}),WT=.2,$a=.9,Xg=1-$a,Sm=.5;var zT=.2,vi=class n{constructor(){this.edgesRemainingLayer=[],this.splineSegmentsLayer=[],this.leftPortsLayer=new Set,this.rightPortsLayer=new Set,this.selfLoopsLayer=new Set,this.lGraph=null,this.startEdges=[],this.allSplineSegments=[],this.edgeToSegmentMap=new Map,this.successingEdge=new Map}getLayoutProcessorConfiguration(t){let e=K.create();e.addAll(YT());let o=t.getProperty(p.GRAPH_PROPERTIES);return o&&o.has(v.SELF_LOOPS)&&e.addAll(VT()),o&&o.has(v.CENTER_LABELS)&&e.addAll(XT()),o&&o.has(v.NORTH_SOUTH_PORTS)&&e.addAll(KT()),o&&o.has(v.END_LABELS)&&e.addAll(ZT()),e}process(t,e){if(e&&e.begin&&e.begin("Spline edge routing",1),t.getLayers().length===0){t.getSize().x=0,e&&e.done&&e.done();return}let o=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),r=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),a=t.getProperty(_.EDGE_ROUTING_SPLINES_MODE)===Qr.SLOPPY,l=t.getProperty(_.EDGE_ROUTING_SPLINES_SLOPPY_LAYER_SPACING_FACTOR);this.lGraph=t,this.startEdges=[],this.allSplineSegments=[],this.successingEdge.clear();let c=t.getLayers(),g=c[0],h=g.getNodes().every(Ls),d=c[c.length-1],f=d.getNodes().every(Ls),E=0,P=null,S,T=0;do{S=E<c.length?c[E++]:null,this._clearThenFillMappings(P,S),this._createSegmentsAndComputeRanking();let N=0;for(let A of this.splineSegmentsLayer)!A.isStraight&&A.rank+1>N&&(N=A.rank+1);let I=0,C=T,x=P===null||h&&P===g,M=S===null||f&&S===d;if(N>0){let A=0;P!==null&&(A+=r),A+=(N-1)*i,S!==null&&(A+=r),a&&S!==null&&(A=Math.max(A,n._computeSloppySpacing(S,i,o,l))),A<o&&!x&&!M&&(I=(o-A)/2,A=o),C+=A}else!x&&!M&&(C+=o);S!==null&&z.placeNodesHorizontally(S,C);for(let A of this.splineSegmentsLayer)A.boundingBox.x=T,A.boundingBox.width=C-T,A.xDelta=I,A.isWestOfInitialLayer=P===null;for(let A of this.splineSegmentsLayer)this.allSplineSegments.push(A);T=C,S!==null&&(T+=S.getSize().x),P=S}while(S!==null);for(let N of this.startEdges){let I=this._getEdgeChain(N);N.setProperty(p.SPLINE_EDGE_CHAIN,I);let C=this._getSplinePath(N);N.setProperty(p.SPLINE_ROUTE_START,C)}t.getSize().x=T,this.lGraph=null,e&&e.done&&e.done()}_createSegmentsAndComputeRanking(){this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.LEFT,!0,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.LEFT,!1,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.RIGHT,!0,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegmentsForHyperEdges(this.leftPortsLayer,this.rightPortsLayer,Fe.RIGHT,!1,this.edgesRemainingLayer,this.splineSegmentsLayer),this._createSplineSegments(this.edgesRemainingLayer,this.leftPortsLayer,this.rightPortsLayer,this.splineSegmentsLayer);for(let t=0;t<this.splineSegmentsLayer.length;t++){let e=this.splineSegmentsLayer[t];for(let o=t+1;o<this.splineSegmentsLayer.length;o++){let r=this.splineSegmentsLayer[o];n._createDependency(e,r)}}n._breakCycles(this.splineSegmentsLayer,this.lGraph.getProperty(p.RANDOM)),n._topologicalNumbering(this.splineSegmentsLayer)}_clearThenFillMappings(t,e){if(this.leftPortsLayer.clear(),this.rightPortsLayer.clear(),this.edgesRemainingLayer=[],this.splineSegmentsLayer=[],this.selfLoopsLayer.clear(),t!==null)for(let o of t.getNodes())for(let r of o.getPorts(u.EAST)){this.leftPortsLayer.add(r);for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;this.edgesRemainingLayer.push(i),this._findAndAddSuccessor(i),n.isQualifiedAsStartingNode(i.getSource().getNode())&&this.startEdges.push(i);let s=i.getTarget(),a=s.getNode().getLayer();if(a===e)this.rightPortsLayer.add(s);else if(a===t)this.leftPortsLayer.add(s);else{let l=this.edgesRemainingLayer.indexOf(i);l>=0&&this.edgesRemainingLayer.splice(l,1)}}}if(e!==null)for(let o of e.getNodes()){for(let r of o.getPorts())for(let i of r.getOutgoingEdges())i.isSelfLoop()&&this.selfLoopsLayer.add(i);for(let r of o.getPorts(u.WEST)){this.rightPortsLayer.add(r);for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;this.edgesRemainingLayer.push(i),this._findAndAddSuccessor(i),n.isQualifiedAsStartingNode(i.getSource().getNode())&&this.startEdges.push(i);let s=i.getTarget(),a=s.getNode().getLayer();if(a===e)this.rightPortsLayer.add(s);else if(a===t)this.leftPortsLayer.add(s);else{let l=this.edgesRemainingLayer.indexOf(i);l>=0&&this.edgesRemainingLayer.splice(l,1)}}}}}static _computeSloppySpacing(t,e,o,r){let i=0;for(let s of t.getNodes()){let a=0;for(let l of s.getIncomingEdges()){let c=l.getSource().getAbsoluteAnchor().y,g=l.getTarget().getAbsoluteAnchor().y;a=Math.max(a,Math.abs(g-c))}i=Math.max(i,a)}return r*Math.min(1,e/o)*i}_findAndAddSuccessor(t){let e=t.getTarget().getNode();if(n.isNormalNode(e))return;let r=e.getOutgoingEdges()[Symbol.iterator]().next();r.done||this.successingEdge.set(t,r.value)}_createSplineSegments(t,e,o,r){for(let i of t){let s=i.getSource(),a;if(e.has(s))a=Fe.LEFT;else if(o.has(s))a=Fe.RIGHT;else throw new Error("Source port must be in one of the port sets.");let l=i.getTarget(),c;if(e.has(l))c=Fe.LEFT;else if(o.has(l))c=Fe.RIGHT;else throw new Error("Target port must be in one of the port sets.");let g=new Cn(i,a,c);this.edgeToSegmentMap.set(i,g),r.push(g)}}_createSplineSegmentsForHyperEdges(t,e,o,r,i,s){let a;o===Fe.LEFT?a=t:a=e;for(let l of a){let c=l.getAbsoluteAnchor().y,g=new Set,h=new Set;for(let d of l.getConnectedEdges()){if(!!d.getProperty(p.REVERSED)!=!!r||!i.includes(d))continue;let f;d.getTarget()===l?f=d.getSource():f=d.getTarget();let E=f.getAbsoluteAnchor().y;n.isStraight(E,c)||(E<c?t.has(f)?g.add(Gt.of(Fe.LEFT,d)):g.add(Gt.of(Fe.RIGHT,d)):t.has(f)?h.add(Gt.of(Fe.LEFT,d)):h.add(Gt.of(Fe.RIGHT,d)))}if(g.size>1){let d=new Cn(l,g,o);for(let f of g)this.edgeToSegmentMap.set(f.getSecond(),d);s.push(d);for(let f of g){let E=i.indexOf(f.getSecond());E>=0&&i.splice(E,1)}}if(h.size>1){let d=new Cn(l,h,o);for(let f of h)this.edgeToSegmentMap.set(f.getSecond(),d);s.push(d);for(let f of h){let E=i.indexOf(f.getSecond());E>=0&&i.splice(E,1)}}}}static _isBetween(t,e,o){return Math.abs(e-t)<1e-8||Math.abs(o-t)<1e-8?!0:e-t>1e-8?t-o>1e-8:o-t>1e-8}static _createDependency(t,e){if(t.hyperEdgeTopYPos>e.hyperEdgeBottomYPos||e.hyperEdgeTopYPos>t.hyperEdgeBottomYPos)return;let o=0,r=0;for(let i of t.rightPorts)n._isBetween(i.getAbsoluteAnchor().y,e.hyperEdgeTopYPos,e.hyperEdgeBottomYPos)&&o++;for(let i of t.leftPorts)n._isBetween(i.getAbsoluteAnchor().y,e.hyperEdgeTopYPos,e.hyperEdgeBottomYPos)&&o--;for(let i of e.rightPorts)n._isBetween(i.getAbsoluteAnchor().y,t.hyperEdgeTopYPos,t.hyperEdgeBottomYPos)&&r++;for(let i of e.leftPorts)n._isBetween(i.getAbsoluteAnchor().y,t.hyperEdgeTopYPos,t.hyperEdgeBottomYPos)&&r--;o<r?new xn(t,e,r-o):r<o?new xn(e,t,o-r):(new xn(e,t,0),new xn(t,e,0))}static _breakCycles(t,e){let o=[],r=[],i=-1;for(let d of t){d.mark=i--;let f=0,E=0;for(let P of d.outgoing)E+=P.weight;for(let P of d.incoming)f+=P.weight;d.inweight=f,d.outweight=E,E===0?r.push(d):f===0&&o.push(d)}let s=new Set(t),a=t.length,l=a+1,c=a-1,g=[];for(;s.size>0;){for(;r.length>0;){let f=r.shift();s.delete(f),f.mark=c--,n._updateNeighbors(f,o,r)}for(;o.length>0;){let f=o.shift();s.delete(f),f.mark=l++,n._updateNeighbors(f,o,r)}let d=Number.MIN_SAFE_INTEGER;for(let f of s){let E=f.outweight-f.inweight;E>=d&&(E>d&&(g.length=0,d=E),g.push(f))}if(g.length>0){let f=g[e.nextInt(g.length)];s.delete(f),f.mark=l++,n._updateNeighbors(f,o,r),g.length=0}}let h=t.length+1;for(let d of t)d.mark<a&&(d.mark+=h);for(let d of t){let f=d.outgoing.slice();for(let E of f){let P=E.target;if(d.mark>P.mark){let S=d.outgoing.indexOf(E);S>=0&&d.outgoing.splice(S,1);let T=P.incoming.indexOf(E);T>=0&&P.incoming.splice(T,1),E.weight>0&&(E.source=P,P.outgoing.push(E),E.target=d,d.incoming.push(E))}}}}static _updateNeighbors(t,e,o){for(let r of t.outgoing)r.target.mark<0&&r.weight>0&&(r.target.inweight-=r.weight,r.target.inweight<=0&&r.target.outweight>0&&e.push(r.target));for(let r of t.incoming)r.source.mark<0&&r.weight>0&&(r.source.outweight-=r.weight,r.source.outweight<=0&&r.source.inweight>0&&o.push(r.source))}static _topologicalNumbering(t){let e=[],o=[];for(let i of t)i.rank=0,i.inweight=i.incoming.length,i.outweight=i.outgoing.length,i.inweight===0&&e.push(i),i.outweight===0&&i.leftPorts.size===0&&o.push(i);let r=-1;for(;e.length>0;){let i=e.shift();for(let s of i.outgoing){let a=s.target;a.rank=Math.max(a.rank,i.rank+1),r=Math.max(r,a.rank),a.inweight--,a.inweight===0&&e.push(a)}}if(r>-1){for(let i of o)i.rank=r;for(;o.length>0;){let i=o.shift();for(let s of i.incoming){let a=s.source;a.leftPorts.size>0||(a.rank=Math.min(a.rank,i.rank-1),a.outweight--,a.outweight===0&&o.push(a))}}}}static isStraight(t,e){return Math.abs(t-e)<zT}_getEdgeChain(t){let e=[],o=t;do e.push(o),o=this.successingEdge.get(o)||null;while(o!==null);return e}_getSplinePath(t){let e=[],o=t;do{let s=this.edgeToSegmentMap.get(o);s.sourcePort=o.getSource(),s.targetPort=o.getTarget(),e.push(s),o=this.successingEdge.get(o)||null}while(o!==null);let r=e[0];r.initialSegment=!0,r.sourceNode=r.edges.values().next().value.getSource().getNode();let i=e[e.length-1];return i.lastSegment=!0,i.targetNode=i.edges.values().next().value.getTarget().getNode(),e}static isNormalNode(t){let e=t.getType();return e===y.NORMAL||e===y.BREAKING_POINT}static isQualifiedAsStartingNode(t){let e=t.getType();return e===y.NORMAL||e===y.NORTH_SOUTH_PORT||e===y.EXTERNAL_PORT||e===y.BREAKING_POINT}};vi.SPLINE_DIMENSION=3;var xn=class{constructor(t,e,o){this.source=t,this.target=e,this.weight=o,t.outgoing.push(this),e.incoming.push(this)}};function YT(){return K.create().addAfter(D.P5_EDGE_ROUTING,w.FINAL_SPLINE_BENDPOINTS_CALCULATOR).addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR)}function VT(){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER).addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER)}function XT(){return K.create().addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR).addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER)}function KT(){return K.create().addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR).addBefore(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)}function ZT(){return K.create().addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR).addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR)}var ne=class{},Dn=1e-8;ne.HALF_PI=Math.PI/2;ne.QUATER_PI=ne.HALF_PI/2;ne.THREE_HALF_PI=ne.HALF_PI*3;ne.TWO_PI=2*Math.PI;ne.THREE=3;ne.intersect=function(t,e,o,r){return typeof o=="number"?ne._intersect4(t,new O(o).add(t),e,new O(r).add(e)):ne._intersect4(t,e,o,r)};ne._intersect4=function(t,e,o,r){let i=t.x,s=t.y,a=e.x,l=e.y,c=o.x,g=o.y,h=r.x,d=r.y,f=(i-a)*(g-d)-(s-l)*(c-h);if(Math.abs(f)<Dn)return null;let E=i*l-s*a,P=c*d-g*h,S=(E*(c-h)-P*(i-a))/f,T=(E*(g-d)-P*(s-l))/f;return new O(S,T)};ne.innerAngle=function(t,e){if(typeof t=="number")return Math.abs(t-e)%Math.PI;let o=t,r=e;return Math.acos((o.x*r.x+o.y*r.y)/(o.length()*r.length()))};ne.lengthToOrthogonal=function(t,e){let o=ne.innerAngle(t,e.toRadians()),r=1;return o>ne.HALF_PI&&(r=-1,o=o-ne.QUATER_PI),r*Math.cos(o)*e.length()};ne.portSideToDirection=function(t){switch(t){case u.NORTH:return ne.THREE_HALF_PI;case u.EAST:return 0;case u.SOUTH:return ne.HALF_PI;case u.WEST:return Math.PI;default:return 0}};ne.distPortToNodeEdge=function(t,e){let o=t.getPosition().clone().add(t.getAnchor()),r=t.getNode().getSize();switch(e){case u.NORTH:return-o.y;case u.EAST:return-o.x+r.x;case u.SOUTH:return-o.y+r.y;case u.WEST:return-o.x;default:return 0}};ne.isBetween=function(t,e,o){return Math.abs(e-t)<Dn||Math.abs(o-t)<Dn?!0:e-t>Dn?t-o>Dn:o-t>Dn};ne.getMarginOnPortSide=function(t,e){let o=t.getMargin();switch(e){case u.NORTH:return o.top;case u.EAST:return o.right;case u.SOUTH:return o.bottom;case u.WEST:return o.left;default:return 0}};var jT=.5,Tm=5,$T=.4,Kg=class n{constructor(){this.edgeEdgeSpacing=0,this.edgeNodeSpacing=0,this.splineRoutingMode=null,this.compactionStrategy=null}process(t,e){e&&e.begin&&e.begin("Spline bendpoints",1),this.edgeEdgeSpacing=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),this.edgeNodeSpacing=t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this.splineRoutingMode=t.getProperty(_.EDGE_ROUTING_SPLINES_MODE),this.compactionStrategy=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY),this._indexNodesPerLayer(t);let o=[];for(let r of t.getLayers())for(let i of r.getNodes())for(let s of i.getOutgoingEdges())s.isSelfLoop()||s.hasProperty(p.SPLINE_ROUTE_START)&&o.push(s);for(let r of o){let i=r.getProperty(p.SPLINE_ROUTE_START);for(let s of i)this._calculateControlPoints(s);r.setProperty(p.SPLINE_ROUTE_START,null)}for(let r of o){let i=r.getProperty(p.SPLINE_SURVIVING_EDGE),s=r.getProperty(p.SPLINE_EDGE_CHAIN);this._calculateBezierBendPoints(s,i),r.setProperty(p.SPLINE_EDGE_CHAIN,null)}e&&e.done&&e.done()}_indexNodesPerLayer(t){for(let e of t.getLayers()){let o=0;for(let r of e.getNodes())r.id=o++}}_calculateControlPoints(t){if(!t.handled){t.handled=!0;for(let e of t.edges){if(t.isStraight&&!t.isHyperEdge()){this._calculateControlPointsStraight(t);continue}let o=t.edgeInformation.get(e);if(o.invertedLeft||o.invertedRight){this._calculateControlPointsInvertedEdge(e,t);continue}this.splineRoutingMode===Qr.SLOPPY&&(o.normalSourceNode||o.normalTargetNode)&&this._segmentAllowsSloppyRouting(t)&&!t.isHyperEdge()?this._calculateControlPointsSloppy(e,t):this._calculateControlPointsConservative(e,t)}if(t.inverseOrder)for(let e of t.edges)e.getBendPoints().reverse()}}_calculateControlPointsStraight(t){let e=t.boundingBox.x,o=t.boundingBox.x+t.boundingBox.width,r=new O(e+(o-e)/2,t.centerControlPointY);t.edges.values().next().value.getBendPoints().push(r)}_calculateControlPointsInvertedEdge(t,e){let o=e.boundingBox.x,r=e.boundingBox.x+e.boundingBox.width,i=e.edgeInformation.get(t),s=i.startY,a=i.endY,l,c;i.invertedLeft?l=new O(r,s):l=new O(o,s),i.invertedRight?c=new O(o,a):c=new O(r,a);let g=o;e.isWestOfInitialLayer||(g+=this.edgeNodeSpacing),g+=e.xDelta+e.rank*this.edgeEdgeSpacing;let h=new O(g,s),d=new O(g,a),f=t.getBendPoints();if(f.push(l,h),e.edges.size>1){let P=new O(g,e.centerControlPointY);f.push(P)}f.push(d,c)}_calculateControlPointsConservative(t,e){let o=e.boundingBox.x,r=e.boundingBox.x+e.boundingBox.width,i=e.edgeInformation.get(t),s=i.startY,a=i.endY,l=new O(o,s),c=new O(r,a),g=o;e.isWestOfInitialLayer||(g+=this.edgeNodeSpacing),g+=e.xDelta+e.rank*this.edgeEdgeSpacing;let h=new O(g,s),d=new O(g,a),f=t.getBendPoints();if(f.push(l,h),e.edges.size>1){let P=new O(g,e.centerControlPointY);f.push(P)}f.push(d,c)}_calculateControlPointsSloppy(t,e){let o=e.edgeInformation.get(t),r=e.boundingBox.x,i=e.boundingBox.x+e.boundingBox.width,s=o.startY,a=o.endY,l=s<a,c=new O(r,s),g=new O(i,a),h=(r+i)/2,d=new O(h,s),f=new O(h,a),E=this._computeSloppyCenterY(t,s,a),P=e.sourcePort.getAbsoluteAnchor(),S=new O(h,E),T=e.targetPort.getAbsoluteAnchor(),N=Ft.approximateBezierSegment(2,P,S,T),I=!1,C=e.sourcePort.getNode();if(C!==null&&C.getLayer()!==null&&o.normalSourceNode)if(!(l&&C.id<C.getLayer().getNodes().length-1||!l&&C.id>0))I=!0;else{let Y=C.id;l?Y++:Y--;let j=C.getLayer().getNodes()[Y],X=n._nodeToBoundingBox(j);I=!(Ft.intersects(X,P,N[0])||Ft.contains(X,P,N[0]))}let x=!1,M=e.targetPort.getNode();if(M!==null&&M.getLayer()!==null&&o.normalTargetNode)if(!(l&&M.id>0||!l&&M.id<M.getLayer().getNodes().length-1))x=!0;else{let Y=M.id;l?Y--:Y++;let j=M.getLayer().getNodes()[Y],X=n._nodeToBoundingBox(j);x=!(Ft.intersects(X,N[0],T)||Ft.contains(X,N[0],T))}let A=t.getBendPoints();I&&x&&A.push(S),I||A.push(c,d),x||A.push(f,g)}static _nodeToBoundingBox(t){let e=t.getPosition(),o=t.getSize(),r=t.getMargin();return new dt(e.x-r.left,e.y-r.top,o.x+r.getHorizontal(),o.y+r.getVertical())}_computeSloppyCenterY(t,e,o){let r=0,i=0;if(t.getSource()!==null)for(let a of t.getTarget().getNode().getPorts())r+=a.getIncomingEdges().length;else r=1;if(t.getTarget()!==null)for(let a of t.getSource().getNode().getPorts())i+=a.getOutgoingEdges().length;else i=1;let s=Math.sign(i-r);return(o+e)/2+(o-e)*($T*s)}_calculateBezierBendPoints(t,e){if(!t||t.length===0)return;let o=new st,r=e!=null?e:t[0],i=r.getSource();if(!vi.isQualifiedAsStartingNode(i.getNode()))throw new Error("The source node of the edge must be a normal node or a northSouthPort.");if(o.addLast(i.getAbsoluteAnchor()),u.SIDES_NORTH_SOUTH.has(i.getSide())){let d=i.getProperty(p.SPLINE_NS_PORT_Y_COORD),f=new O(i.getAbsoluteAnchor().x,d);o.addLast(f)}let s=null,a=!1;for(let d of t){let f=d.getBendPoints();if(f.length>0){if(a){let E=s.add(f.getFirst()).scale(jT);o.addLast(E),a=!1}else a=!0;s=f.getLast().clone();for(let E of f)o.addLast(E);f.length=0}}let l=r.getTarget();if(u.SIDES_NORTH_SOUTH.has(l.getSide())){let d=l.getProperty(p.SPLINE_NS_PORT_Y_COORD),f=new O(l.getAbsoluteAnchor().x,d);o.addLast(f)}o.addLast(l.getAbsoluteAnchor()),this.splineRoutingMode===Qr.CONSERVATIVE&&n._insertStraighteningControlPoints(o,i,l);let g=new Rs(!0,vi.SPLINE_DIMENSION,o).getBezierCP(),h=r.getBendPoints();for(let d of g)h.push(d)}static _insertStraighteningControlPoints(t,e,o){let r=t.getFirst(),i=t[1],s=new O(ne.portSideToDirection(e.getSide()));s.scale(Tm);let a=i.clone().sub(r),l=new O(n._absMin(s.x,a.x),n._absMin(s.y,a.y));l.add(r),t.splice(1,0,l);let c=t.getLast(),g=t[t.length-2];s=new O(ne.portSideToDirection(o.getSide())),s.scale(Tm),a=g.clone().sub(c);let h=new O(n._absMin(s.x,a.x),n._absMin(s.y,a.y));h.add(c),t.splice(t.length-1,0,h)}static _absMin(t,e){return Math.abs(t)<Math.abs(e)?t:e}_segmentAllowsSloppyRouting(t){if(this.compactionStrategy===ie.NONE)return!0;let e=t.boundingBox.x,o=t.boundingBox.x+t.boundingBox.width;if(t.initialSegment){let r=t.sourceNode,i=n._segmentNodeDistanceThreshold(r);if(e-(r.getPosition().x+r.getSize().x)>i)return!1}if(t.lastSegment){let r=t.targetNode,i=n._segmentNodeDistanceThreshold(r);if(r.getPosition().x-o>i)return!1}return!0}static _segmentNodeDistanceThreshold(t){return t.getLayer().getSize().x-t.getSize().x/2}};var jo=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};jo.ROTATION=new jo("ROTATION");jo.READING_DIRECTION=new jo("READING_DIRECTION");var jt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};jt.NONE=new jt("NONE");jt.TOP=new jt("TOP");jt.BOTTOM=new jt("BOTTOM");var wn=class{constructor(t){this._mode=t}process(t,e){e.begin(`Graph transformation (${this._mode})`,1);let o=[...t.getLayerlessNodes()];for(let a of t.getLayers())for(let l of a.getNodes())o.push(l);let r=t.getProperty(_.DIRECTION_CONGRUENCY),i=t.getProperty(_.DIRECTION),s=i!=null&&i.name?i.name:null;if(r===jo.READING_DIRECTION||r==="READING_DIRECTION")switch(s){case"LEFT":qa(t,o);break;case"DOWN":Ja(t,o);break;case"UP":this._mode===$o.TO_INTERNAL_LTR?(Ja(t,o),Zg(t,o)):(Zg(t,o),Ja(t,o));break;default:break}else if(this._mode===$o.TO_INTERNAL_LTR)switch(s){case"LEFT":qa(t,o),Zg(t,o);break;case"DOWN":Nm(t,o);break;case"UP":ym(t,o);break;default:break}else switch(s){case"LEFT":qa(t,o),Zg(t,o);break;case"DOWN":ym(t,o);break;case"UP":Nm(t,o);break;default:break}e.done()}},$o=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};$o.TO_INTERNAL_LTR=new $o("TO_INTERNAL_LTR");$o.TO_INPUT_DIRECTION=new $o("TO_INPUT_DIRECTION");wn.Mode=$o;function Nm(n,t){Ja(n,t),qa(n,t)}function ym(n,t){qa(n,t),Ja(n,t)}function qa(n,t){qT(t,n),o_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&o_(e)}function Zg(n,t){QT(t,n),r_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&r_(e)}function Ja(n,t){eN(t),oN(n),_o(n.getOffset()),_o(n.getSize()),i_(n.getPadding());let e=n.getProperty(_.NODE_LABELS_PADDING);e!=null&&i_(e)}function qT(n,t){let e=0;if(t.getSize().x===0)for(let o of n){let r=o.getPosition().x+o.getSize().x+o.getMargin().right;r>e&&(e=r)}else e=t.getSize().x-t.getOffset().x;e-=t.getOffset().x;for(let o of n){switch(ti(o.getPosition(),e-o.getSize().x),o_(o.getPadding()),Im(o),o.hasProperty(_.POSITION)&&ti(o.getProperty(_.POSITION),e-o.getSize().x),o.getProperty(_.ALIGNMENT)){case Kt.LEFT:o.setProperty(_.ALIGNMENT,Kt.RIGHT);break;case Kt.RIGHT:o.setProperty(_.ALIGNMENT,Kt.LEFT);break;default:break}let r=o.getSize();for(let i of o.getPorts()){ti(i.getPosition(),r.x-i.getSize().x),ti(i.getAnchor(),i.getSize().x),i.setSide(Rm(i.getSide())),s_(i);for(let s of i.getOutgoingEdges()){for(let l of s.getBendPoints())ti(l,e);let a=s.getProperty(_.JUNCTION_POINTS);if(a!=null)for(let l of a)ti(l,e);for(let l of s.getLabels())ti(l.getPosition(),e-l.getSize().x)}for(let s of i.getLabels())ti(s.getPosition(),i.getSize().x-s.getSize().x)}o.getType()===y.EXTERNAL_PORT&&(o.setProperty(p.EXT_PORT_SIDE,Rm(o.getProperty(p.EXT_PORT_SIDE))),JT(o));for(let i of o.getLabels())Im(i),ti(i.getPosition(),r.x-i.getSize().x)}}function ti(n,t){n.x=t-n.x}function o_(n){if(n==null)return;let t=n.left;n.left=n.right,n.right=t}function Im(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);t!=null&&(t.has(k.H_LEFT)?(t.delete(k.H_LEFT),t.add(k.H_RIGHT)):t.has(k.H_RIGHT)&&(t.delete(k.H_RIGHT),t.add(k.H_LEFT)))}function Rm(n){return n===u.EAST?u.WEST:n===u.WEST?u.EAST:n}function JT(n){switch(n.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST);break;case J.FIRST_SEPARATE:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE);break;case J.LAST:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST);break;case J.LAST_SEPARATE:n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE);break;default:break}}function QT(n,t){let e=0;if(t.getSize().y===0)for(let o of n){let r=o.getPosition().y+o.getSize().y+o.getMargin().bottom;r>e&&(e=r)}else e=t.getSize().y-t.getOffset().y;e-=t.getOffset().y;for(let o of n){switch(ei(o.getPosition(),e-o.getSize().y),r_(o.getPadding()),Lm(o),o.hasProperty(_.POSITION)&&ei(o.getProperty(_.POSITION),e-o.getSize().y),o.getProperty(_.ALIGNMENT)){case Kt.TOP:o.setProperty(_.ALIGNMENT,Kt.BOTTOM);break;case Kt.BOTTOM:o.setProperty(_.ALIGNMENT,Kt.TOP);break;default:break}let r=o.getSize();for(let i of o.getPorts()){ei(i.getPosition(),r.y-i.getSize().y),ei(i.getAnchor(),i.getSize().y),i.setSide(Am(i.getSide())),s_(i);for(let s of i.getOutgoingEdges()){for(let l of s.getBendPoints())ei(l,e);let a=s.getProperty(_.JUNCTION_POINTS);if(a!=null)for(let l of a)ei(l,e);for(let l of s.getLabels())ei(l.getPosition(),e-l.getSize().y)}for(let s of i.getLabels())ei(s.getPosition(),i.getSize().y-s.getSize().y)}o.getType()===y.EXTERNAL_PORT&&(o.setProperty(p.EXT_PORT_SIDE,Am(o.getProperty(p.EXT_PORT_SIDE))),tN(o));for(let i of o.getLabels())Lm(i),ei(i.getPosition(),r.y-i.getSize().y)}}function ei(n,t){n.y=t-n.y}function r_(n){if(n==null)return;let t=n.top;n.top=n.bottom,n.bottom=t}function Lm(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);t!=null&&(t.has(k.V_TOP)?(t.delete(k.V_TOP),t.add(k.V_BOTTOM)):t.has(k.V_BOTTOM)&&(t.delete(k.V_BOTTOM),t.add(k.V_TOP)))}function Am(n){return n===u.NORTH?u.SOUTH:n===u.SOUTH?u.NORTH:n}function tN(n){let t=n.getProperty(p.IN_LAYER_CONSTRAINT);t===jt.TOP?n.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM):t===jt.BOTTOM&&n.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP)}function eN(n){for(let t of n){_o(t.getPosition()),_o(t.getSize()),i_(t.getPadding()),Cm(t),iN(t);for(let e of t.getPorts()){_o(e.getPosition()),_o(e.getAnchor()),_o(e.getSize()),e.setSide(xm(e.getSide())),s_(e);for(let o of e.getOutgoingEdges()){for(let i of o.getBendPoints())_o(i);let r=o.getProperty(_.JUNCTION_POINTS);if(r!=null)for(let i of r)_o(i);for(let i of o.getLabels())_o(i.getPosition()),_o(i.getSize())}for(let o of e.getLabels())_o(o.getPosition()),_o(o.getSize())}t.getType()===y.EXTERNAL_PORT&&(t.setProperty(p.EXT_PORT_SIDE,xm(t.getProperty(p.EXT_PORT_SIDE))),rN(t));for(let e of t.getLabels())Cm(e),_o(e.getSize()),_o(e.getPosition())}}function _o(n){let t=n.x;n.x=n.y,n.y=t}function i_(n){if(n==null)return;let t=n.top,e=n.bottom,o=n.left,r=n.right;n.top=o,n.bottom=r,n.left=t,n.right=e}function Cm(n){if(!n.hasProperty||!n.hasProperty(_.NODE_LABELS_PLACEMENT))return;let t=n.getProperty(_.NODE_LABELS_PLACEMENT);if(t==null||t.size===0)return;let e=new Set;t.has(k.INSIDE)?e.add(k.INSIDE):e.add(k.OUTSIDE),t.has(k.H_PRIORITY)||e.add(k.H_PRIORITY),t.has(k.H_LEFT)?e.add(k.V_TOP):t.has(k.H_CENTER)?e.add(k.V_CENTER):t.has(k.H_RIGHT)&&e.add(k.V_BOTTOM),t.has(k.V_TOP)?e.add(k.H_LEFT):t.has(k.V_CENTER)?e.add(k.H_CENTER):t.has(k.V_BOTTOM)&&e.add(k.H_RIGHT),n.setProperty(_.NODE_LABELS_PLACEMENT,e)}function xm(n){switch(n){case u.NORTH:return u.WEST;case u.WEST:return u.NORTH;case u.SOUTH:return u.EAST;case u.EAST:return u.SOUTH;default:return u.UNDEFINED}}function oN(n){let t=n.getProperty(_.EDGE_LABELS_SIDE_SELECTION);t!=null&&typeof t.transpose=="function"&&n.setProperty(_.EDGE_LABELS_SIDE_SELECTION,t.transpose())}function rN(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT),e=n.getProperty(p.IN_LAYER_CONSTRAINT);t===J.FIRST_SEPARATE?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.NONE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP)):t===J.LAST_SEPARATE?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.NONE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM)):e===jt.TOP?(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.NONE)):e===jt.BOTTOM&&(n.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE),n.setProperty(p.IN_LAYER_CONSTRAINT,jt.NONE))}function iN(n){let t=n.getProperty(_.NODE_SIZE_MINIMUM);switch(t!=null&&n.setProperty(_.NODE_SIZE_MINIMUM,new O(t.y,t.x)),n.getProperty(_.ALIGNMENT)){case Kt.LEFT:n.setProperty(_.ALIGNMENT,Kt.TOP);break;case Kt.RIGHT:n.setProperty(_.ALIGNMENT,Kt.BOTTOM);break;case Kt.TOP:n.setProperty(_.ALIGNMENT,Kt.LEFT);break;case Kt.BOTTOM:n.setProperty(_.ALIGNMENT,Kt.RIGHT);break;default:break}if(n.hasProperty(_.POSITION)){let e=n.getProperty(_.POSITION),o=e.x;e.x=e.y,e.y=o}}function s_(n){let t=n.getProperty(_.PORT_INDEX);t!=null&&n.setProperty(_.PORT_INDEX,-t)}var jg=class{process(t,e){e.begin("Resize child graph to fit parent.",1);for(let o of t){for(let r of o.getNodes())t.getLayerlessNodes().push(r);o.getNodes().length=0}for(let o of t.getLayerlessNodes())o.setLayer(null);t.getLayers().length=0,this._resizeGraph(t),t.getParentNode()!=null&&this._graphLayoutToNode(t.getParentNode(),t),e.done()}_graphLayoutToNode(t,e){for(let i of e.getLayerlessNodes()){let s=i.getProperty(p.ORIGIN);if(s instanceof rt){let a=s,l=z.getExternalPortPosition(e,i,a.getSize().x,a.getSize().y);a.getPosition().x=l.x,a.getPosition().y=l.y,a.setSide(i.getProperty(p.EXT_PORT_SIDE))}}let o=e.getActualSize();e.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)?(t.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),t.getGraph().getProperty(p.GRAPH_PROPERTIES).add(v.NON_FREE_PORTS),z.resizeNode(t,o,!1,!0)):z.resizeNode(t,o,!0,!0)}_resizeGraph(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS),o=t.getProperty(_.NODE_SIZE_OPTIONS),r=t.getActualSize(),i=new O(r.x,r.y);if(e!=null&&e.has(mt.MINIMUM_SIZE)){let s=new O(0,0),a=t.getProperty(_.NODE_SIZE_MINIMUM);a!=null&&(s.x=a.x||0,s.y=a.y||0),o!=null&&o.has(Nt.DEFAULT_MINIMUM_SIZE)&&(s.x<=0&&(s.x=es),s.y<=0&&(s.y=os)),i.x=Math.max(r.x,s.x),i.y=Math.max(r.y,s.y)}this._resizeGraphNoReallyIMeanIt(t,r,i)}_resizeGraphNoReallyIMeanIt(t,e,o){let r=t.getProperty(_.CONTENT_ALIGNMENT);if(o.x>e.x&&r!=null&&(r.has(he.H_CENTER)?t.getOffset().x+=(o.x-e.x)/2:r.has(he.H_RIGHT)&&(t.getOffset().x+=o.x-e.x)),o.y>e.y&&r!=null&&(r.has(he.V_CENTER)?t.getOffset().y+=(o.y-e.y)/2:r.has(he.V_BOTTOM)&&(t.getOffset().y+=o.y-e.y)),t.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)&&(o.x>e.x||o.y>e.y))for(let a of t.getLayerlessNodes()){if(a.getType()!==y.EXTERNAL_PORT)continue;let l=a.getProperty(p.EXT_PORT_SIDE);l===u.EAST?a.getPosition().x+=o.x-e.x:l===u.SOUTH&&(a.getPosition().y+=o.y-e.y)}let s=t.getPadding();t.getSize().x=o.x-s.left-s.right,t.getSize().y=o.y-s.top-s.bottom}};var Et=class extends br{constructor(t){super(),this._owner=t,this._size=new O,this._nodes=[]}getSize(){return this._size}getNodes(){return this._nodes}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}getGraph(){return this._owner}getIndex(){return this._owner.getLayers().indexOf(this)}toString(){return`L_${this.getIndex()}[${this._nodes.join(",")}]`}};var $g=class{process(t,e){e.begin("Hierarchical port constraint processing",1),lN(t),cN(t),e.done()}},sN=0,nN=1;function aN(n,t){let e=n.getType();if(t.getType()!==y.EXTERNAL_PORT)return-1;if(e!==y.EXTERNAL_PORT)return 1;let r=n.getProperty(p.PORT_RATIO_OR_POSITION),i=t.getProperty(p.PORT_RATIO_OR_POSITION);return r===i?0:r<i?-1:1}function lN(n){if(!n.getProperty(_.PORT_CONSTRAINTS).isOrderFixed())return;let t=n.getLayers();t.length!==0&&(Dm(t[0]),Dm(t[t.length-1]))}function Dm(n){let t=z.toNodeArray(n.getNodes());t.sort(aN);let e=null;for(let o of t){if(o.getType()!==y.EXTERNAL_PORT)break;let r=o.getProperty(p.EXT_PORT_SIDE);r!==u.WEST&&r!==u.EAST||(e!=null&&e.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(o),e=o)}}function cN(n){if(!n.getProperty(_.PORT_CONSTRAINTS).isSideFixed())return;let e=n.getLayers(),o=e.length,r=[new Map,new Map],i=[[],[]],s=[];for(let a=0;a<o;a++){let l=e[a],c=r[a],g=new Map;r.push(g);let h=i[a],d=[];i.push(d);for(let f of l){if(n_(f)){s.push(f);continue}for(let E of z.toEdgeArray(f.getIncomingEdges())){let P=E.getSource().getNode();if(!n_(P))continue;let S=P.getProperty(p.ORIGIN),T=c.get(S);T==null&&(T=wm(n,P),c.set(S,T),h.push(T)),E.setSource(T.getPorts()[nN])}for(let E of z.toEdgeArray(f.getOutgoingEdges())){let P=E.getTarget().getNode();if(!n_(P))continue;let S=P.getProperty(p.ORIGIN),T=g.get(S);T==null&&(T=wm(n,P),g.set(S,T),d.push(T)),E.setTarget(T.getPorts()[sN])}}}for(let a=0;a<i.length;a++){let l=i[a];if(l.length===0)continue;let c;a===0?(c=new Et(n),e.unshift(c)):a===r.length-1?(c=new Et(n),e.push(c)):c=e[a-1];for(let g of l)g.setLayer(c)}for(let a of s)a.setLayer(null);n.setProperty(p.EXT_PORT_REPLACED_DUMMIES,s)}function n_(n){if(n.getType()!==y.EXTERNAL_PORT)return!1;let t=n.getProperty(p.EXT_PORT_SIDE);return t===u.NORTH||t===u.SOUTH}function wm(n,t){let e=new ft(n);e.copyProperties(t),e.setProperty(p.EXT_PORT_REPLACED_DUMMY,t),e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),e.setProperty(_.ALIGNMENT,Kt.CENTER),e.setType(y.EXTERNAL_PORT);let o=new rt;o.setNode(e),o.setSide(u.WEST);let r=new rt;return r.setNode(e),r.setSide(u.EAST),e}var _e=class extends br{constructor(){super(),this._bendPoints=new st,this._source=null,this._target=null,this._labels=[]}reverse(t,e){let o=this.getSource(),r=this.getTarget();this.setSource(null),this.setTarget(null),e&&r!=null&&r.getProperty(p.INPUT_COLLECT)?this.setSource(z.provideCollectorPort(t,r.getNode(),W.OUTPUT,u.EAST)):this.setSource(r),e&&o!=null&&o.getProperty(p.OUTPUT_COLLECT)?this.setTarget(z.provideCollectorPort(t,o.getNode(),W.INPUT,u.WEST)):this.setTarget(o);for(let s of this._labels){let a=s.getProperty(_.EDGE_LABELS_PLACEMENT);a===St.TAIL?s.setProperty(_.EDGE_LABELS_PLACEMENT,St.HEAD):a===St.HEAD&&s.setProperty(_.EDGE_LABELS_PLACEMENT,St.TAIL)}let i=this.getProperty(p.REVERSED);this.setProperty(p.REVERSED,!i),this._bendPoints=st.reverse(this._bendPoints)}getSource(){return this._source}setSource(t){if(this._source!=null){let e=this._source.getOutgoingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._source=t,this._source!=null&&this._source.getOutgoingEdges().push(this)}getTarget(){return this._target}setTarget(t){if(this._target!=null){let e=this._target.getIncomingEdges(),o=e.indexOf(this);o>=0&&e.splice(o,1)}this._target=t,this._target!=null&&this._target.getIncomingEdges().push(this)}setTargetAndInsertAtIndex(t,e){if(this._target!=null){let o=this._target.getIncomingEdges(),r=o.indexOf(this);r>=0&&o.splice(r,1)}this._target=t,this._target!=null&&this._target.getIncomingEdges().splice(e,0,this)}isSelfLoop(){if(this._source==null||this._target==null)return!1;let t=this._source.getNode();return t!=null&&t===this._target.getNode()}isInLayerEdge(){return!this.isSelfLoop()&&this._source.getNode().getLayer()===this._target.getNode().getLayer()}getBendPoints(){return this._bendPoints}getLabels(){return this._labels}getOther(t){if(t===this._source)return this._target;if(t===this._target)return this._source;if(this._source!=null&&t===this._source.getNode())return this._target.getNode();if(this._target!=null&&t===this._target.getNode())return this._source.getNode();throw new Error("'portOrNode' must be either the source or target of the edge.")}getDesignation(){return this._labels.length>0&&this._labels[0].getText()?this._labels[0].getText():super.getDesignation()}toString(){let t="e_",e=this.getDesignation();return e!=null&&(t+=e),this._source!=null&&this._target!=null&&(t+=` ${this._source.getDesignation()}[${this._source.getNode()}]`,t+=` -> ${this._target.getDesignation()}[${this._target.getNode()}]`),t}};var oi=class{static adapt(t,e=!1,o=!1,r=()=>!0){return new a_(t,e,o,r)}static adaptNode(t,e){return new Mn(null,t,e)}static adaptLabel(t){return new bn(t)}},Qa=class{constructor(t){this._element=t}getElement(){return this._element}getSize(){return this._element.getSize()}setSize(t){this._element.getSize().x=t.x,this._element.getSize().y=t.y}getPosition(){return this._element.getPosition()}setPosition(t){this._element.getPosition().x=t.x,this._element.getPosition().y=t.y}getProperty(t){return this._element.getProperty(t)}hasProperty(t){return this._element.hasProperty(t)}getVolatileId(){return this._element.id}setVolatileId(t){this._element.id=t}},a_=class{constructor(t,e,o,r){this._element=t,this._transparentNorthSouthEdges=e,this._transparentCommentNodes=o,this._nodeFilter=r,this._nodeAdapters=null}getSize(){return this._element.getSize()}setSize(t){this._element.getSize().x=t.x,this._element.getSize().y=t.y}getPosition(){throw new Error("Not supported by LGraph")}setPosition(){throw new Error("Not supported by LGraph")}getProperty(t){return this._element.getProperty(t)}hasProperty(t){return this._element.hasProperty(t)}getVolatileId(){return this._element.id}setVolatileId(t){this._element.id=t}getNodes(){if(this._nodeAdapters==null){this._nodeAdapters=[];for(let t of this._element.getLayers())for(let e of t.getNodes())if(this._nodeFilter(e)&&(this._nodeAdapters.push(new Mn(this,e,this._transparentNorthSouthEdges)),this._transparentCommentNodes)){if(e.hasProperty(p.TOP_COMMENTS))for(let o of e.getProperty(p.TOP_COMMENTS))this._nodeAdapters.push(new Mn(this,o,!1));if(e.hasProperty(p.BOTTOM_COMMENTS))for(let o of e.getProperty(p.BOTTOM_COMMENTS))this._nodeAdapters.push(new Mn(this,o,!1))}}return this._nodeAdapters}},Mn=class extends Qa{constructor(t,e,o){super(e),this._parentGraphAdapter=t,this._transparentNorthSouthEdges=o,this._labelAdapters=null,this._portAdapters=null}getGraph(){return this._parentGraphAdapter}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}getPorts(){if(this._portAdapters==null){this._portAdapters=[];for(let t of this._element.getPorts())this._portAdapters.push(new l_(t,this._transparentNorthSouthEdges))}return this._portAdapters}getIncomingEdges(){return[]}getOutgoingEdges(){return[]}sortPortList(t){let e=t||gN;this._element.getProperty(_.PORT_CONSTRAINTS).isOrderFixed()&&this._element.getPorts().sort(e)}isCompoundNode(){return this._element.getProperty(p.COMPOUND_NODE)}getPadding(){let t=this._element.getPadding();return new yt(t.top,t.right,t.bottom,t.left)}setPadding(t){let e=this._element.getPadding();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}getMargin(){let t=this._element.getMargin();return new me(t.top,t.right,t.bottom,t.left)}setMargin(t){let e=this._element.getMargin();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}},l_=class extends Qa{constructor(t,e){super(t),this._transparentNorthSouthEdges=e,this._labelAdapters=null,this._incomingEdgeAdapters=null,this._outgoingEdgeAdapters=null}getSide(){return this._element.getSide()}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}getMargin(){let t=this._element.getMargin?this._element.getMargin():{top:0,right:0,bottom:0,left:0};return new me(t.top,t.right,t.bottom,t.left)}setMargin(t){if(!this._element.getMargin)return;let e=this._element.getMargin();e.left=t.left,e.top=t.top,e.right=t.right,e.bottom=t.bottom}getIncomingEdges(){if(this._transparentNorthSouthEdges&&this._element.getNode().getType()===y.NORTH_SOUTH_PORT)return[];if(this._incomingEdgeAdapters==null){this._incomingEdgeAdapters=[];for(let e of this._element.getIncomingEdges())this._incomingEdgeAdapters.push(new Bi(e));if(this._transparentNorthSouthEdges){let e=this._element.getProperty(p.PORT_DUMMY);if(e!=null)for(let o of e.getIncomingEdges())this._incomingEdgeAdapters.push(new Bi(o))}let t=this._element.getNode();if(t.hasProperty(p.SELF_LOOP_HOLDER)){let o=t.getProperty(p.SELF_LOOP_HOLDER).getSLPortMap().get(this._element);if(o!=null)for(let r of o.getIncomingSLEdges())this._incomingEdgeAdapters.push(new Bi(r.getLEdge()))}}return this._incomingEdgeAdapters}getOutgoingEdges(){if(this._transparentNorthSouthEdges&&this._element.getNode().getType()===y.NORTH_SOUTH_PORT)return[];if(this._outgoingEdgeAdapters==null){this._outgoingEdgeAdapters=[];for(let e of this._element.getOutgoingEdges())this._outgoingEdgeAdapters.push(new Bi(e));if(this._transparentNorthSouthEdges){let e=this._element.getProperty(p.PORT_DUMMY);if(e!=null)for(let o of e.getOutgoingEdges())this._outgoingEdgeAdapters.push(new Bi(o))}let t=this._element.getNode();if(t.hasProperty(p.SELF_LOOP_HOLDER)){let o=t.getProperty(p.SELF_LOOP_HOLDER).getSLPortMap().get(this._element);if(o!=null)for(let r of o.getOutgoingSLEdges())this._outgoingEdgeAdapters.push(new Bi(r.getLEdge()))}}return this._outgoingEdgeAdapters}hasCompoundConnections(){return this._element.getProperty(p.INSIDE_CONNECTIONS)}},bn=class extends Qa{constructor(t){super(t)}getSide(){return this._element.getProperty(Vt.LABEL_SIDE)}getText(){return this._element.getText?this._element.getText():""}},Bi=class{constructor(t){this._element=t,this._labelAdapters=null}getLabels(){if(this._labelAdapters==null){this._labelAdapters=[];for(let t of this._element.getLabels())this._labelAdapters.push(new bn(t))}return this._labelAdapters}},gN=(n,t)=>{let e=n.getSide().ordinal()-t.getSide().ordinal();if(e!==0)return e;let o=n.getProperty(_.PORT_INDEX),r=t.getProperty(_.PORT_INDEX);if(o!=null&&r!=null){let i=o-r;if(i!==0)return i}switch(n.getSide().toString()){case"NORTH":return n.getPosition().x-t.getPosition().x;case"EAST":return n.getPosition().y-t.getPosition().y;case"SOUTH":return t.getPosition().x-n.getPosition().x;case"WEST":return t.getPosition().y-n.getPosition().y;default:throw new Error("Port side is undefined")}};var qg=class{constructor(){this._northernExtPortEdgeRoutingHeight=0}process(t,e){e&&e.begin&&e.begin("Orthogonally routing hierarchical port edges",1),this._northernExtPortEdgeRoutingHeight=0;let o=this._restoreNorthSouthDummies(t);this._setNorthSouthDummyCoordinates(t,o),this._routeEdges(e,t,o),this._removeTemporaryNorthSouthDummies(t),this._fixCoordinates(t),this._correctSlantedEdgeSegments(t),e&&e.done&&e.done()}_restoreNorthSouthDummies(t){let e=[];if(!t.hasProperty(p.EXT_PORT_REPLACED_DUMMIES))return e;for(let i of t.getProperty(p.EXT_PORT_REPLACED_DUMMIES))this._restoreDummy(i,t),e.push(i);for(let i of t.getLayers())for(let s of i.getNodes()){if(s.getType()!==y.EXTERNAL_PORT)continue;let a=s.getProperty(p.EXT_PORT_REPLACED_DUMMY);a!=null&&this._connectNodeToDummy(t,s,a)}let o=t.getLayers(),r=o[o.length-1];for(let i of e)i.setLayer(r);return e}_restoreDummy(t,e){let o=t.getProperty(p.EXT_PORT_SIDE),r=t.getPorts()[0];o===u.NORTH?r.setSide(u.SOUTH):o===u.SOUTH&&r.setSide(u.NORTH);let i=e.getProperty(_.NODE_SIZE_CONSTRAINTS);if(i!=null&&i.has&&i.has(mt.PORT_LABELS)){let s=t.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL)||0,a=t.getProperty(_.SPACING_LABEL_PORT_VERTICAL)||0,l=t.getProperty(_.SPACING_LABEL_LABEL)||0,c=e.getProperty(_.PORT_LABELS_PLACEMENT);if(c!=null&&c.has){if(c.has(it.INSIDE)){let g=a,h=t.getSize().x/2-r.getPosition().x;for(let d of r.getLabels())d.getPosition().y=g,d.getPosition().x=h-d.getSize().x/2,g+=d.getSize().y+l}else if(c.has(it.OUTSIDE))for(let g of r.getLabels())g.getPosition().x=s+t.getSize().x-r.getPosition().x}No.getNodeMarginCalculator(oi.adapt(e,!1)).processNode(oi.adapt(t,!1))}}_connectNodeToDummy(t,e,o){let r=new rt;r.setNode(e);let i=e.getProperty(p.EXT_PORT_SIDE);r.setSide(i);let s=o.getPorts()[0],a=new _e;a.setSource(r),a.setTarget(s)}_setNorthSouthDummyCoordinates(t,e){let o=t.getProperty(_.PORT_CONSTRAINTS),r=t.getSize(),i=t.getPadding(),s=r.x+i.left+i.right,a=0-i.top-t.getOffset().y,l=r.y+i.top+i.bottom-t.getOffset().y,c=[],g=[];for(let h of e){o===H.FREE||o===H.FIXED_SIDE||o===H.FIXED_ORDER?this._calculateNorthSouthDummyPositions(h):o===H.FIXED_RATIO?(this._applyNorthSouthDummyRatio(h,s),h.borderToContentAreaCoordinates(!0,!1)):o===H.FIXED_POS&&(this._applyNorthSouthDummyPosition(h),h.borderToContentAreaCoordinates(!0,!1),r.x=Math.max(r.x,h.getPosition().x+h.getSize().x/2));let d=h.getProperty(p.EXT_PORT_SIDE);d===u.NORTH?(h.getPosition().y=a,c.push(h)):d===u.SOUTH&&(h.getPosition().y=l,g.push(h))}o===H.FREE||o===H.FIXED_SIDE?(this._ensureUniquePositions(c,t),this._ensureUniquePositions(g,t)):o===H.FIXED_ORDER&&(this._restoreProperOrder(c,t),this._restoreProperOrder(g,t))}_calculateNorthSouthDummyPositions(t){let e=t.getPorts()[0];if(e.getDegree()===0){t.getPosition().x=0;return}let o=0;for(let s of e.getConnectedPorts())o+=s.getNode().getPosition().x+s.getPosition().x+s.getAnchor().x;let r=t.getProperty(_.PORT_ANCHOR),i=r==null?0:r.x;t.getPosition().x=o/e.getDegree()-i}_applyNorthSouthDummyRatio(t,e){let o=t.getProperty(_.PORT_ANCHOR),r=o==null?0:o.x;t.getPosition().x=e*t.getProperty(p.PORT_RATIO_OR_POSITION)-r}_applyNorthSouthDummyPosition(t){let e=t.getProperty(_.PORT_ANCHOR),o=e==null?0:e.x;t.getPosition().x=t.getProperty(p.PORT_RATIO_OR_POSITION)-o}_ensureUniquePositions(t,e){if(t.length===0)return;let o=z.toNodeArray(t);o.sort((r,i)=>r.getPosition().x-i.getPosition().x),this._assignAscendingCoordinates(o,e)}_restoreProperOrder(t,e){if(t.length===0)return;let o=z.toNodeArray(t);o.sort((r,i)=>r.getProperty(p.PORT_RATIO_OR_POSITION)-i.getProperty(p.PORT_RATIO_OR_POSITION)),this._assignAscendingCoordinates(o,e)}_assignAscendingCoordinates(t,e){let o=e.getProperty(_.SPACING_PORT_PORT)||10,r=t[0].getPosition().x+t[0].getSize().x+t[0].getMargin().right+o;for(let i=1;i<t.length;i++){let s=t[i].getPosition(),a=t[i].getSize(),l=t[i].getMargin(),c=s.x-l.left-r;c<0&&(s.x-=c);let g=e.getSize();g.x=Math.max(g.x,s.x+a.x),r=s.x+a.x+l.right+o}}_routeEdges(t,e,o){let r=new Set,i=new Set,s=new Set,a=new Set,l=e.getProperty(_.SPACING_NODE_NODE),c=e.getProperty(_.SPACING_EDGE_EDGE);for(let g of o){let h=g.getProperty(p.EXT_PORT_SIDE);if(h===u.NORTH){i.add(g);for(let d of g.getIncomingEdges())r.add(d.getSource().getNode())}else if(h===u.SOUTH){a.add(g);for(let d of g.getIncomingEdges())s.add(d.getSource().getNode())}}if(r.size>0){let h=new se(qe.SOUTH_TO_NORTH,c,"extnorth").routeEdges(t,e,r,0,i,-l-e.getOffset().y);h>0&&(this._northernExtPortEdgeRoutingHeight=l+(h-1)*c,e.getOffset().y+=this._northernExtPortEdgeRoutingHeight,e.getSize().y+=this._northernExtPortEdgeRoutingHeight)}if(s.size>0){let h=new se(qe.NORTH_TO_SOUTH,c,"extsouth").routeEdges(t,e,s,0,a,e.getSize().y+l-e.getOffset().y);h>0&&(e.getSize().y+=l+(h-1)*c)}}_removeTemporaryNorthSouthDummies(t){let e=[];for(let o of t.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.EXTERNAL_PORT||!r.hasProperty(p.EXT_PORT_REPLACED_DUMMY))continue;let i=null,s=null,a=null;for(let T of r.getPorts())T.getSide()===u.WEST?i=T:T.getSide()===u.EAST?s=T:a=T;let l=a.getOutgoingEdges()[0],c=new st(l.getBendPoints()),g=new O(a.getPosition().x,a.getPosition().y);g.x+=r.getPosition().x,g.y+=r.getPosition().y,c.splice(0,0,g);let h=st.reverse(l.getBendPoints()),d=new O(a.getPosition().x,a.getPosition().y);d.x+=r.getPosition().x,d.y+=r.getPosition().y,h.add(d);let E=r.getProperty(p.EXT_PORT_REPLACED_DUMMY).getPorts()[0],P=[...i.getIncomingEdges()];for(let T of P)T.setTarget(E),T.getBendPoints().addAllAsCopies(T.getBendPoints().length,c);let S=z.toEdgeArray(s.getOutgoingEdges());for(let T of S)T.setSource(E),T.getBendPoints().addAllAsCopies(0,h);l.setSource(null),l.setTarget(null),e.push(r)}for(let o of e)o.setLayer(null)}_fixCoordinates(t){let e=t.getProperty(_.PORT_CONSTRAINTS),o=t.getLayers();this._fixCoordinatesInLayer(o[0],e,t),this._fixCoordinatesInLayer(o[o.length-1],e,t)}_fixCoordinatesInLayer(t,e,o){let r=o.getPadding(),i=o.getOffset(),s=o.getActualSize(),a=s.y;for(let l of t.getNodes()){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE),g=l.getProperty(p.EXT_PORT_SIZE),h=l.getPosition();c===u.EAST?h.x=o.getSize().x+r.right-i.x:c===u.WEST&&(h.x=-i.x-r.left);let d=0;if(c===u.EAST||c===u.WEST)if(e===H.FIXED_RATIO){let f=l.getProperty(p.PORT_RATIO_OR_POSITION);h.y=s.y*f-l.getProperty(_.PORT_ANCHOR).y,d=h.y+g.y,l.borderToContentAreaCoordinates(!1,!0)}else e===H.FIXED_POS&&(h.y=l.getProperty(p.PORT_RATIO_OR_POSITION)-l.getProperty(_.PORT_ANCHOR).y,d=h.y+g.y,l.borderToContentAreaCoordinates(!1,!0));a=Math.max(a,d)}o.getSize().y+=a-s.y;for(let l of t.getNodes()){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE),g=l.getPosition();c===u.NORTH?g.y=-i.y-r.top:c===u.SOUTH&&(g.y=o.getSize().y+r.bottom-i.y)}}_correctSlantedEdgeSegments(t){let e=t.getLayers();this._correctSlantedEdgeSegmentsInLayer(e[0]),this._correctSlantedEdgeSegmentsInLayer(e[e.length-1])}_correctSlantedEdgeSegmentsInLayer(t){for(let e of t.getNodes()){if(e.getType()!==y.EXTERNAL_PORT)continue;let o=e.getProperty(p.EXT_PORT_SIDE);if(!(o!==u.EAST&&o!==u.WEST))for(let r of e.getConnectedEdges()){let i=r.getBendPoints();if(i.length===0)continue;let s=r.getSource();if(s&&s.getNode()===e){let l=i[0];l.y=s.getAbsoluteAnchor().y}let a=r.getTarget();if(a&&a.getNode()===e){let l=i[i.length-1];l.y=a.getAbsoluteAnchor().y}}}}};var Jg=class{process(t,e){e.begin("Hierarchical port dummy size processing",1);let r=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS)*2,i=[],s=[];for(let a of t){i.length=0,s.length=0;for(let l of a){if(l.getType()!==y.EXTERNAL_PORT)continue;let c=l.getProperty(p.EXT_PORT_SIDE);c===u.NORTH?i.push(l):c===u.SOUTH&&s.push(l)}Mm(i,!0,r),Mm(s,!1,r)}e.done()}};function Mm(n,t,e){let o=0,r=e;t||(o=e*(n.length-1),r*=-1);for(let i of n){i.setProperty(_.ALIGNMENT,Kt.CENTER),i.getSize().x=o;for(let s of i.getPorts(u.EAST))s.getPosition().x=o;o+=r}}var Qg=class{process(t,e){e.begin("Hierarchical port position processing",1);let o=t.getLayers();o.length>0&&bm(o[0],t),o.length>1&&bm(o[o.length-1],t),e.done()}};function bm(n,t){let e=t.getProperty(_.PORT_CONSTRAINTS);if(!(e.isRatioFixed()||e.isPosFixed()))return;let o=t.getActualSize().y;for(let r of n){if(r.getType()!==y.EXTERNAL_PORT)continue;let i=r.getProperty(p.EXT_PORT_SIDE);if(i!==u.EAST&&i!==u.WEST)continue;let s=r.getProperty(p.PORT_RATIO_OR_POSITION);e===H.FIXED_RATIO&&(s*=o),r.getPosition().y=s-r.getProperty(_.PORT_ANCHOR).y,r.borderToContentAreaCoordinates(!1,!0)}}var oh=class{constructor(){this._layeredGraph=null,this._degreeThreshold=0,this._treeHeightThreshold=0}process(t,e){this._layeredGraph=t,this._degreeThreshold=t.getProperty(_.HIGH_DEGREE_NODES_THRESHOLD);let o=t.getProperty(_.HIGH_DEGREE_NODES_TREE_HEIGHT);o===0&&(o=Number.MAX_SAFE_INTEGER),this._treeHeightThreshold=o;let r=t.getLayers(),i=0;for(;i<r.length;){let s=r[i],a=[],l=-1,c=-1;for(let d of s.getNodes())if(this._isHighDegreeNode(d)){let f=this._calculateInformation(d);l=Math.max(l,f.incTreesMaxHeight),c=Math.max(c,f.outTreesMaxHeight),a.push([d,f])}let g=[];for(let d=0;d<l;d++){let f=new Et(t);r.splice(i,0,f),g.unshift(f),i++}for(let[,d]of a)if(d.incTreeRoots!=null)for(let f of d.incTreeRoots)this._moveTree(f,th,g);let h=[];for(let d=0;d<c;d++){let f=new Et(t);r.splice(i+1+d,0,f),h.push(f)}for(let[,d]of a)if(d.outTreeRoots!=null)for(let f of d.outTreeRoots)this._moveTree(f,eh,h);i+=1+Math.max(c,0)}for(let s=r.length-1;s>=0;s--)r[s].getNodes().length===0&&r.splice(s,1)}_isHighDegreeNode(t){return dN(t)>=this._degreeThreshold}_calculateInformation(t){let e=new g_;for(let o of t.getIncomingEdges()){if(o.isSelfLoop())continue;let r=o.getSource().getNode();if(c_(r,eh)){let i=this._isTreeRoot(r,eh,th);if(i===-1)continue;e.incTreesMaxHeight=Math.max(e.incTreesMaxHeight,i),e.incTreeRoots==null&&(e.incTreeRoots=[]),e.incTreeRoots.push(r)}}for(let o of t.getOutgoingEdges()){if(o.isSelfLoop())continue;let r=o.getTarget().getNode();if(c_(r,th)){let i=this._isTreeRoot(r,th,eh);if(i===-1)continue;e.outTreesMaxHeight=Math.max(e.outTreesMaxHeight,i),e.outTreeRoots==null&&(e.outTreeRoots=[]),e.outTreeRoots.push(r)}}return e}_moveTree(t,e,o){t.setLayer(o[0]);let r=o.slice(1);for(let i of e(t)){let s=h_(i,t);r.length>0&&this._moveTree(s,e,r)}}_isTreeRoot(t,e,o){if(this._isHighDegreeNode(t)||!c_(t,e))return-1;if(fN(o(t)))return 1;let r=0;for(let i of o(t)){let s=h_(i,t),a=this._isTreeRoot(s,e,o);if(a===-1||(r=Math.max(r,a),r>this._treeHeightThreshold-1))return-1}return r+1}},g_=class{constructor(){this.incTreesMaxHeight=-1,this.incTreeRoots=null,this.outTreesMaxHeight=-1,this.outTreeRoots=null}},th=n=>n.getIncomingEdges(),eh=n=>n.getOutgoingEdges(),hN=n=>n.getConnectedEdges();function dN(n){let t=0;for(let e of hN(n))t++;return t}function fN(n){for(let t of n)return!1;return!0}function c_(n,t){let e=null;for(let o of t(n)){let r=h_(o,n);if(e==null)e=r;else if(r!==e)return!1}return!0}function h_(n,t){return n.getSource().getNode()===t?n.getTarget().getNode():n.getSource().getNode()}var rh=class{process(t,e){e.begin("Hyperedge merging",1),pN(t);for(let o of t.getLayers()){let r=o.getNodes();if(r.length===0)continue;let i=null,s=null,a=null,l=null;for(let c=0;c<r.length;c++){if(i=r[c],s=i.getType(),s===y.LONG_EDGE&&l===y.LONG_EDGE){let g=uN(i,a);g.allowMerge&&(_N(i,a,g.sameSource,g.sameTarget),r.splice(c,1),c--,i=a,s=l)}a=i,l=s}}e.done()}};function uN(n,t){let e=n.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES),o=t.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES),r=n.getProperty(p.LONG_EDGE_SOURCE),i=t.getProperty(p.LONG_EDGE_SOURCE),s=n.getProperty(p.LONG_EDGE_TARGET),a=t.getProperty(p.LONG_EDGE_TARGET),l=r!=null&&r===i,c=s!=null&&s===a;if(!e&&!o){let d=n.getPorts()[0],f=t.getPorts()[0];return{allowMerge:d.id===f.id,sameSource:l,sameTarget:c}}let g=(!e||n.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY))&&(!o||t.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY)),h=(!e||!n.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY))&&(!o||!t.getProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY));return{allowMerge:l&&g||c&&h,sameSource:l,sameTarget:c}}function _N(n,t,e,o){let r=Gm(t.getPorts(u.WEST)),i=Gm(t.getPorts(u.EAST));for(let s of n.getPorts()){for(;s.getIncomingEdges().length>0;)s.getIncomingEdges()[0].setTarget(r);for(;s.getOutgoingEdges().length>0;)s.getOutgoingEdges()[0].setSource(i)}e||t.setProperty(p.LONG_EDGE_SOURCE,null),o||t.setProperty(p.LONG_EDGE_TARGET,null)}function Gm(n){for(let t of n)return t;return null}function pN(n){let t=[];for(let o of n.getLayers())for(let r of o.getNodes())for(let i of r.getPorts())t.push(i);for(let o of t)o.id=-1;let e=0;for(let o of t)o.id===-1&&d_(o,e++)}function d_(n,t){n.id=t;for(let e of n.getConnectedPorts())e.id===-1&&d_(e,t);if(n.getNode().getType()===y.LONG_EDGE)for(let e of n.getNode().getPorts())e!==n&&e.id===-1&&d_(e,t)}var ih=class{process(t,e){e.begin("Hypernodes processing",1);for(let o of t)for(let r of o){if(!r.getProperty(_.HYPERNODE)||r.getPorts().length>2)continue;let i=0,s=0,a=0,l=0;for(let c of r.getPorts())switch(c.getSide()){case u.NORTH:i++;break;case u.EAST:s++;break;case u.SOUTH:a++;break;case u.WEST:l++;break}i===0&&a===0&&EN(t,r,l<=s)}e.done()}};function EN(n,t,e){let o=[],r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;if(e){r=n.getSize().x;for(let c of t.getPorts())for(let g of c.getOutgoingEdges()){let h=g.getBendPoints();if(h.isEmpty())continue;let d=h.getFirst();d.x<r&&(i=r-d.x,s=Number.MAX_SAFE_INTEGER,o.length=0,r=d.x),d.x<=r&&(o.push(g),h.size()>1&&(s=Math.min(s,Math.abs(h.get(1).y-d.y))))}}else for(let c of t.getPorts())for(let g of c.getIncomingEdges()){let h=g.getBendPoints();if(h.isEmpty())continue;let d=h.getLast();d.x>r&&(i=d.x-r,s=Number.MAX_SAFE_INTEGER,o.length=0,r=d.x),d.x>=r&&(o.push(g),h.size()>1&&(s=Math.min(s,Math.abs(h.get(h.size()-2).y-d.y))))}if(o.length===0||i<=t.getSize().x/2||s<=t.getSize().y/2)return;let a=new rt;a.setNode(t),a.setSide(u.NORTH),a.getPosition().x=t.getSize().x/2;let l=new rt;l.setNode(t),l.setSide(u.SOUTH),l.getPosition().x=t.getSize().x/2,l.getPosition().y=t.getSize().y;for(let c of o){let g=c.getBendPoints(),h,d;e?(h=g.removeFirst(),d=g.isEmpty()?c.getTarget().getAbsoluteAnchor():g.getFirst(),d.y>=h.y?c.setSource(l):c.setSource(a)):(h=g.removeLast(),d=g.isEmpty()?c.getSource().getAbsoluteAnchor():g.getLast(),d.y>=h.y?c.setTarget(l):c.setTarget(a));let f=c.getProperty(_.JUNCTION_POINTS);f!=null&&f.remove(h)}t.getPosition().x=r-t.getSize().x/2}var sh=class{process(t,e){e.begin("Layer constraint edge reversal",1);for(let o of t){let r=-1,i=[],s=o.getNodes().slice();for(let a=0;a<s.length;a++){let l=s[a].getProperty(p.IN_LAYER_CONSTRAINT);r===-1?l!==jt.TOP&&(r=a):l===jt.TOP&&(s[a].setLayer(null),s[a].setLayer(r++,o)),l===jt.BOTTOM&&i.push(s[a])}for(let a of i)a.setLayer(null),a.setLayer(o)}e.done()}};var nh=class{process(t,e){e.begin("Node margin calculation",1),No.getNodeMarginCalculator(oi.adapt(t,!1)).excludeEdgeHeadTailLabels().process(),e.done()}};var Gn=10,ah=class{constructor(){this._minX=Number.POSITIVE_INFINITY,this._maxX=Number.NEGATIVE_INFINITY,this._minY=Number.POSITIVE_INFINITY,this._maxY=Number.NEGATIVE_INFINITY}process(t,e){if(t.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)){for(let r of t.getLayerlessNodes()){if(r.getType()!==y.NORMAL)continue;let i=r.getProperty(_.MARGINS),s=i!=null?i.left:0,a=i!=null?i.right:0,l=i!=null?i.top:0,c=i!=null?i.bottom:0,g=r.getPosition(),h=r.getSize();g.x-s<this._minX&&(this._minX=g.x-s),g.x+h.x+a>this._maxX&&(this._maxX=g.x+h.x+a),g.y-l<this._minY&&(this._minY=g.y-l),g.y+h.y+c>this._maxY&&(this._maxY=g.y+h.y+c)}for(let r of t.getLayerlessNodes()){if(r.getType()===y.NORMAL)continue;if(r.getType()!==y.EXTERNAL_PORT)throw new Error(`InteractiveExternalPortPositioner: unsupported node type ${r.getType()}`);let i=r.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(i===J.FIRST_SEPARATE){r.getPosition().x=this._minX-Gn;let a=Hm(r,l=>l.getTarget().getNode());a!=null&&(r.getPosition().y=a);continue}if(i===J.LAST_SEPARATE){r.getPosition().x=this._maxX+Gn;let a=Hm(r,l=>l.getSource().getNode());a!=null&&(r.getPosition().y=a);continue}let s=r.getProperty(p.IN_LAYER_CONSTRAINT);if(s===jt.TOP){let a=vm(r);a!=null&&(r.getPosition().x=a+Gn),r.getPosition().y=this._minY-Gn;continue}if(s===jt.BOTTOM){let a=vm(r);a!=null&&(r.getPosition().x=a+Gn),r.getPosition().y=this._maxY+Gn}}}}};function Hm(n,t){for(let e of n.getConnectedEdges()){let o=t(e);return o.getPosition().y+o.getSize().y/2}return null}function vm(n){if(n.getPorts().length!==1)throw new Error("external port dummy must have exactly one port");let t=n.getPorts()[0],e=t.getOutgoingEdges().length>0,o=t.getIncomingEdges().length>0;if(e&&o)throw new Error("Interactive layout does not support N/S ports with incoming AND outgoing edges");if(e){let r=Number.POSITIVE_INFINITY;for(let i of t.getOutgoingEdges()){let s=i.getTarget().getNode(),a=s.getProperty(_.MARGINS),l=a!=null?a.left:0,c=s.getPosition().x-l;c<r&&(r=c)}return r}if(o){let r=Number.NEGATIVE_INFINITY;for(let i of t.getIncomingEdges()){let s=i.getSource().getNode(),a=s.getProperty(_.MARGINS),l=a!=null?a.right:0,c=s.getPosition().x+s.getSize().x+l;c>r&&(r=c)}return r}return null}var lh=class{process(t,e){e.begin("Inverted port preprocessing",1);let o=t.getLayers(),r=[],i=null;for(let s=0;s<o.length;s++){let a=i;i=o[s];for(let c of r)c.setLayer(a);r=[];let l=i.getNodes().slice();for(let c of l)if(c.getType()===y.NORMAL&&c.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){for(let g of c.getPorts(W.INPUT,u.EAST)){let h=g.getIncomingEdges().slice();for(let d of h)mN(t,g,d,r)}for(let g of c.getPorts(W.OUTPUT,u.WEST)){let h=g.getOutgoingEdges().slice();for(let d of h)PN(t,g,d,r)}}}for(let s of r)s.setLayer(i);e.done()}};function mN(n,t,e,o){if(e.getSource().getNode()===t.getNode())return;let r=new ft(n);r.setType(y.LONG_EDGE),r.setProperty(p.ORIGIN,e),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.push(r);let i=new rt;i.setNode(r),i.setSide(u.WEST);let s=new rt;s.setNode(r),s.setSide(u.EAST),e.setTarget(i);let a=new _e;a.copyProperties(e),a.setProperty(_.JUNCTION_POINTS,null),a.setSource(s),a.setTarget(t),Um(r,i,s),Bm(e,a,!1)}function PN(n,t,e,o){if(e.getTarget().getNode()===t.getNode())return;let r=new ft(n);r.setType(y.LONG_EDGE),r.setProperty(p.ORIGIN,e),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.push(r);let i=new rt;i.setNode(r),i.setSide(u.WEST);let s=new rt;s.setNode(r),s.setSide(u.EAST);let a=e.getTarget();e.setTarget(i);let l=new _e;l.copyProperties(e),l.setProperty(_.JUNCTION_POINTS,null),l.setSource(s),l.setTarget(a),Bm(e,l,!0),Um(r,i,s)}function Bm(n,t,e){let o=n.getLabels(),r=0;for(;r<o.length;){let i=o[r];i.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD?((e||!i.hasProperty(p.END_LABEL_EDGE))&&i.setProperty(p.END_LABEL_EDGE,n),o.splice(r,1),t.getLabels().push(i)):r++}}function Um(n,t,e){let o=t.getIncomingEdges()[0].getSource(),r=o.getNode(),i=e.getOutgoingEdges()[0].getTarget(),s=i.getNode();r.getType()===y.LONG_EDGE?n.setProperty(p.LONG_EDGE_SOURCE,r.getProperty(p.LONG_EDGE_SOURCE)):n.setProperty(p.LONG_EDGE_SOURCE,o),s.getType()===y.LONG_EDGE?n.setProperty(p.LONG_EDGE_TARGET,s.getProperty(p.LONG_EDGE_TARGET)):n.setProperty(p.LONG_EDGE_TARGET,i)}var ch=class{process(t,e){e.begin("Node and Port Label Placement and Node Sizing",1),No.calculateLabelAndNodeSizes(oi.adapt(t,!0,!0,r=>r.getType()===y.NORMAL));let o=t.getProperty(p.GRAPH_PROPERTIES);if(o!=null&&o.has(v.EXTERNAL_PORTS)){let r=t.getProperty(_.PORT_LABELS_PLACEMENT),i=r!=null&&r.has(it.NEXT_TO_PORT_IF_POSSIBLE),s=t.getProperty(_.PORT_LABELS_TREAT_AS_GROUP);for(let a of t.getLayers())for(let l of a.getNodes())l.getType()===y.EXTERNAL_PORT&&this._placeExternalPortDummyLabels(l,r,i,s)}e.done()}_placeExternalPortDummyLabels(t,e,o,r){let i=t.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL),s=t.getProperty(_.SPACING_LABEL_PORT_VERTICAL),a=t.getProperty(_.SPACING_LABEL_LABEL),l=t.getSize(),c=t.getPorts()[0],g=c.getPosition(),h=this._computePortLabelBox(c,a);if(h==null)return;if(e!=null&&e.has(it.INSIDE))switch(t.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:h.x=(l.x-h.width)/2-g.x,h.y=s;break;case u.SOUTH:h.x=(l.x-h.width)/2-g.x,h.y=-s-h.height;break;case u.EAST:{if(f_(c,!0,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=l.y+s-g.y;h.x=-i-h.width;break}case u.WEST:{if(f_(c,!0,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=l.y+s-g.y;h.x=i;break}default:break}else if(e!=null&&e.has(it.OUTSIDE))switch(t.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:case u.SOUTH:h.x=g.x+i;break;case u.EAST:case u.WEST:{if(f_(c,!1,o)){let f=r?h.height:c.getLabels()[0].getSize().y;h.y=(l.y-f)/2-g.y}else h.y=g.y+s;break}default:break}let d=h.y;for(let f of c.getLabels()){let E=f.getPosition();E.x=h.x,E.y=d,d+=f.getSize().y+a}}_computePortLabelBox(t,e){let o=t.getLabels();if(o.length===0)return null;let r=new dt;for(let i of o){let s=i.getSize();s.x>r.width&&(r.width=s.x),r.height+=s.y}return r.height+=(o.length-1)*e,r}};function f_(n,t,e){return e?t?n.getIncomingEdges().length===0&&n.getOutgoingEdges().length===0:!n.isConnectedToExternalNodes():!1}var ri=class n{process(t,e){e.begin("Edge splitting",1);let o=t.getLayers();if(o.length<=2){e.done();return}for(let r=0;r<o.length-1;r++){let i=o[r],s=o[r+1];for(let a of i)for(let l of a.getPorts()){let c=l.getOutgoingEdges().slice();for(let g of c){let h=g.getTarget().getNode().getLayer();if(h!==i&&h!==s){let d=ON(t,s,g);n.splitEdge(g,d)}}}}e.done()}static splitEdge(t,e){let o=t.getTarget(),r=t.getProperty(_.EDGE_THICKNESS);r<0&&(r=0,t.setProperty(_.EDGE_THICKNESS,r)),e.getSize().y=r;let i=Math.floor(r/2),s=new rt;s.setSide(u.WEST),s.setNode(e),s.getPosition().y=i;let a=new rt;a.setSide(u.EAST),a.setNode(e),a.getPosition().y=i,t.setTarget(s);let l=new _e;return l.copyProperties(t),l.setProperty(_.JUNCTION_POINTS,null),l.setSource(a),l.setTarget(o),SN(e,t,l),TN(t,l),l}};function ON(n,t,e){let o=new ft(n);return o.setType(y.LONG_EDGE),o.setProperty(p.ORIGIN,e),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setLayer(t),o}function SN(n,t,e){let o=t.getSource().getNode(),r=e.getTarget().getNode();o.getType()===y.LONG_EDGE?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,o.getProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES))):o.getType()===y.LABEL?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,!0)):r.getType()===y.LABEL?(n.setProperty(p.LONG_EDGE_SOURCE,r.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,r.getProperty(p.LONG_EDGE_TARGET)),n.setProperty(p.LONG_EDGE_HAS_LABEL_DUMMIES,!0)):(n.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),n.setProperty(p.LONG_EDGE_TARGET,e.getTarget()))}function TN(n,t){let e=n.getLabels(),o=0;for(;o<e.length;){let r=e[o];r.getProperty(_.EDGE_LABELS_PLACEMENT)===St.HEAD?(e.splice(o,1),t.getLabels().push(r),r.hasProperty(p.END_LABEL_EDGE)||r.setProperty(p.END_LABEL_EDGE,n)):o++}}var gh=class{process(t,e){e.begin("Label dummy insertions",1);let o=[],r=t.getProperty(_.SPACING_EDGE_LABEL),i=t.getProperty(_.SPACING_LABEL_LABEL),s=t.getProperty(_.DIRECTION),a=s!=null&&s.isVertical&&s.isVertical();for(let l of t.getLayerlessNodes()){let c=[...l.getOutgoingEdges()];for(let g of c){if(!NN(g))continue;let h=yN(g),d=[],f=IN(t,g,d);o.push(f);let E=f.getSize(),P=g.getLabels(),S=0;for(;S<P.length;){let N=P[S];N.getProperty(_.EDGE_LABELS_PLACEMENT)===St.CENTER?(a?(E.x+=N.getSize().x+i,N.getSize().y>E.y&&(E.y=N.getSize().y)):(N.getSize().x>E.x&&(E.x=N.getSize().x),E.y+=N.getSize().y+i),d.push(N),P.splice(S,1)):S++}a?(E.x-=i,E.y+=r+h):E.y+=r-i+h;let T=Math.floor(h/2);for(let N of f.getPorts())N.getPosition().y=T}}for(let l of o)t.getLayerlessNodes().push(l);e.done()}};function NN(n){if(n.getSource().getNode()===n.getTarget().getNode())return!1;for(let t of n.getLabels())if(t.getProperty(_.EDGE_LABELS_PLACEMENT)===St.CENTER)return!0;return!1}function yN(n){let t=n.getProperty(_.EDGE_THICKNESS);return t<0&&(t=0,n.setProperty(_.EDGE_THICKNESS,t)),t}function IN(n,t,e){let o=new ft(n);return o.setType(y.LABEL),o.setProperty(p.ORIGIN,t),o.setProperty(p.REPRESENTED_LABELS,e),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),o.setProperty(p.LONG_EDGE_TARGET,t.getTarget()),ri.splitEdge(t,o),o}var ii=class n{process(t,e){e.begin("Edge joining",1);let o=t.getProperty(_.UNNECESSARY_BENDPOINTS);for(let r of t){let i=r.getNodes(),s=0;for(;s<i.length;){let a=i[s];a.getType()===y.LONG_EDGE?(n.joinAt(a,o),i.splice(s,1)):s++}}e.done()}static joinAt(t,e){let o=t.getPorts(u.WEST),r=t.getPorts(u.EAST),i=Fm(o),s=Fm(r),a=i.getIncomingEdges(),l=s.getOutgoingEdges(),c=a.length,g=t.getPorts()[0].getAbsoluteAnchor();for(;c-- >0;){let h=a[0],d=l[0],E=d.getTarget().getIncomingEdges().indexOf(d);h.setTargetAndInsertAtIndex(d.getTarget(),E),d.setSource(null),d.setTarget(null);let P=h.getBendPoints();e&&P.add(new O(g.x,g.y));for(let N of d.getBendPoints())P.add(new O(N.x,N.y));for(let N of d.getLabels())h.getLabels().push(N);let S=h.getProperty(_.JUNCTION_POINTS),T=d.getProperty(_.JUNCTION_POINTS);if(T!=null){S==null&&(S=new st,h.setProperty(_.JUNCTION_POINTS,S));for(let N of T)S.add(new O(N.x,N.y))}}}};function Fm(n){for(let t of n)return t;return null}var hh=class{process(t,e){e.begin("Label dummy removal",1);let o=t.getProperty(_.SPACING_EDGE_LABEL),r=t.getProperty(_.SPACING_LABEL_LABEL),i=t.getProperty(_.DIRECTION);for(let s of t.getLayers()){let a=s.getNodes(),l=0;for(;l<a.length;){let c=a[l];if(c.getType()!==y.LABEL){l++;continue}let g=c.getProperty(p.ORIGIN),h=Number(g.getProperty(_.EDGE_THICKNESS)),d=c.getProperty(p.LABEL_SIDE)===Vt.BELOW,f=new O(c.getPosition().x,c.getPosition().y);d&&(f.y+=h+o);let E=new O(c.getSize().x,c.getSize().y+(c.isInlineEdgeLabel()?0:-h-o)),P=c.getProperty(p.REPRESENTED_LABELS);i!=null&&i.isVertical&&i.isVertical()?LN(P,f,r,E,d,i):RN(P,f,r,E);for(let T of P)g.getLabels().push(T);let S=t.getProperty(_.EDGE_ROUTING);ii.joinAt(c,S===At.POLYLINE),a.splice(l,1)}}e.done()}};function RN(n,t,e,o){for(let r of n)r.getPosition().x=t.x+(o.x-r.getSize().x)/2,r.getPosition().y=t.y,t.y+=r.getSize().y+e}function LN(n,t,e,o,r,i){let s=n.every(l=>l.getProperty(_.EDGE_LABELS_INLINE)),a=i===R.UP?[...n].reverse():n;for(let l of a)l.getPosition().x=t.x,s?l.getPosition().y=t.y+(o.y-l.getSize().y)/2:r?l.getPosition().y=t.y:l.getPosition().y=t.y+o.y-l.getSize().y,t.x+=l.getSize().x+e}var Ct=class{constructor(t,e){this._name=t,this._usesLabelSize=e}toString(){return this._name}usesLabelSizeInformation(){return this._usesLabelSize}};Ct.MEDIAN_LAYER=new Ct("MEDIAN_LAYER",!1);Ct.TAIL_LAYER=new Ct("TAIL_LAYER",!1);Ct.HEAD_LAYER=new Ct("HEAD_LAYER",!1);Ct.SPACE_EFFICIENT_LAYER=new Ct("SPACE_EFFICIENT_LAYER",!0);Ct.WIDEST_LAYER=new Ct("WIDEST_LAYER",!0);Ct.CENTER_LAYER=new Ct("CENTER_LAYER",!0);Ct.values=()=>[Ct.MEDIAN_LAYER,Ct.TAIL_LAYER,Ct.HEAD_LAYER,Ct.SPACE_EFFICIENT_LAYER,Ct.WIDEST_LAYER,Ct.CENTER_LAYER];var tl=class n{constructor(){this._layerWidths=null}process(t,e){var i;e.begin("Label dummy switching",1);let o=(i=t.getProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY))!=null?i:Ct.MEDIAN_LAYER;AN(t);let r=CN(t,o);this._layerWidths=new Array(t.getLayers().length).fill(0);for(let s of Ct.values())if(s.usesLabelSizeInformation()&&r.get(s).length>0){this._calculateLayerWidths(t);break}for(let s of Ct.values())s.usesLabelSizeInformation()||this._processStrategy(r.get(s));for(let s of Ct.values())s.usesLabelSizeInformation()&&this._processStrategy(r.get(s));this._layerWidths=null,e.done()}_calculateLayerWidths(t){for(let e of t.getLayers())this._layerWidths[e.id]=z.findMaxNonDummyNodeWidth(e,!1)}_processStrategy(t){if(t.length!==0){if(t[0].placementStrategy===Ct.SPACE_EFFICIENT_LAYER){this._computeSpaceEfficientAssignment(t);return}for(let e of t){switch(e.placementStrategy){case Ct.CENTER_LAYER:this._assignLayer(e,this._findCenterLayerTargetId(e));break;case Ct.MEDIAN_LAYER:this._assignLayer(e,xN(e));break;case Ct.WIDEST_LAYER:this._assignLayer(e,this._findWidestLayerTargetId(e));break;case Ct.HEAD_LAYER:Wm(e),this._assignLayer(e,km(e,!0));break;case Ct.TAIL_LAYER:Wm(e),this._assignLayer(e,km(e,!1));break}wN(e)}}}_findWidestLayerTargetId(t){let e=t.leftmostLayerId;for(let o=e+1;o<=t.rightmostLayerId;o++)this._layerWidths[o]>this._layerWidths[e]&&(e=o);return e}_findCenterLayerTargetId(t){let e=this._computeLayerWidthSums(t),o=e[e.length-1]/2;for(let r=0;r<e.length;r++)if(e[r]>=o)return t.leftmostLayerId+r;return t.leftmostLayerId+t.leftLongEdgeDummies.length}_computeLayerWidthSums(t){let e=t.labelDummy.getGraph(),o=e.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS)*2,r=e.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),i=Math.max(o,r),s=new Array(t.totalDummyCount()),a=-i,l=0;for(let c of t.leftLongEdgeDummies)a+=this._layerWidths[c.getLayer().id]+i,s[l++]=a;a+=this._layerWidths[t.labelDummy.getLayer().id]+i,s[l++]=a;for(let c of t.rightLongEdgeDummies)a+=this._layerWidths[c.getLayer().id]+i,s[l++]=a;return s}_computeSpaceEfficientAssignment(t){let e=this._performTrivialAssignments(t);if(e.length!==0){e.sort((o,r)=>r.labelDummy.getSize().x-o.labelDummy.getSize().x);for(let o=0;o<e.length;o++)this._assignLayer(e[o],this._findPotentiallyWidestLayer(e,o))}}_performTrivialAssignments(t){let e=[];for(let o of t)o.leftmostLayerId===o.rightmostLayerId?this._assignLayer(o,o.leftmostLayerId):this._assignToWiderLayer(o)||e.push(o);return e}_assignToWiderLayer(t){let e=t.labelDummy.getSize().x,r=t.labelDummy.getGraph().getLayers().slice(t.leftmostLayerId,t.rightmostLayerId+1);for(let i of r)if(i.getSize().x>=e)return this._assignLayer(t,i.id),!0;return!1}_findPotentiallyWidestLayer(t,e){let o=t[e],r=o.labelDummy.getSize().x,i=o.leftmostLayerId,s=0;for(let a=o.leftmostLayerId;a<=o.rightmostLayerId;a++){if(r<=this._layerWidths[a])return a;let l=this._layerWidths[a],c=null;for(let g=e+1;g<t.length;g++){let h=t[g];h.leftmostLayerId<=a&&h.rightmostLayerId>=a&&(c=h)}c!=null&&(l=Math.max(l,c.labelDummy.getSize().x)),l>s&&(i=a,s=l)}return i}_assignLayer(t,e){e!==t.leftmostLayerId+t.leftLongEdgeDummies.length&&DN(t.labelDummy,t.ithDummyNode(e-t.leftmostLayerId));let o=t.labelDummy.getLayer().id;this._layerWidths[o]=Math.max(this._layerWidths[o],t.labelDummy.getSize().x);let r=t.labelDummy.getProperty(p.REPRESENTED_LABELS);if(r!=null)for(let i of r)i.setProperty(n.INCLUDE_LABEL,!0)}};tl.INCLUDE_LABEL=new m("edgelabelcenterednessanalysis.includelabel",!1);function AN(n){let t=0;for(let e of n)e.id=t++}function CN(n,t){let e=new Map;for(let o of Ct.values())e.set(o,[]);for(let o of n.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.LABEL)continue;let i=new u_(r,t);e.get(i.placementStrategy).push(i)}return e}function xN(n){let t=n.totalDummyCount(),e=Math.floor((t-1)/2);return n.leftmostLayerId+e}function km(n,t){let e=Ym(n);return t&&!e||!t&&e?n.rightmostLayerId:n.leftmostLayerId}function Wm(n){let t=n.placementStrategy===Ct.HEAD_LAYER,e=Ym(n);t&&!e||!t&&e?n.labelDummy.setProperty(_.ALIGNMENT,Kt.RIGHT):n.labelDummy.setProperty(_.ALIGNMENT,Kt.LEFT)}function Ym(n){let t=null;for(let o of n.labelDummy.getIncomingEdges()){t=o;break}let e=null;for(let o of n.labelDummy.getOutgoingEdges()){e=o;break}return t!=null&&t.getProperty(p.REVERSED)||e!=null&&e.getProperty(p.REVERSED)}function DN(n,t){let e=n.getLayer(),o=t.getLayer(),r=e.getNodes().indexOf(n),i=o.getNodes().indexOf(t),s=null;for(let E of n.getPorts(W.INPUT)){s=E;break}let a=null;for(let E of n.getPorts(W.OUTPUT)){a=E;break}let l=null;for(let E of t.getPorts(W.INPUT)){l=E;break}let c=null;for(let E of t.getPorts(W.OUTPUT)){c=E;break}let g=z.toEdgeArray(s.getIncomingEdges()),h=z.toEdgeArray(a.getOutgoingEdges()),d=z.toEdgeArray(l.getIncomingEdges()),f=z.toEdgeArray(c.getOutgoingEdges());n.setLayer(i,o);for(let E of d)E.setTarget(s);for(let E of f)E.setSource(a);t.setLayer(r,e);for(let E of g)E.setTarget(l);for(let E of h)E.setSource(c)}function wN(n){let t=n.labelDummy,e=zm(t);for(;e!=null&&e.getType()===y.LONG_EDGE;)e.setProperty(p.LONG_EDGE_BEFORE_LABEL_DUMMY,!0),e=zm(e)}function zm(n){for(let t of n.getIncomingEdges())return t.getSource().getNode();return null}var u_=class{constructor(t,e){this.labelDummy=t,this.placementStrategy=e,this.leftLongEdgeDummies=[],this.rightLongEdgeDummies=[],this.leftmostLayerId=0,this.rightmostLayerId=0,this._gatherLeftLongEdgeDummies(),this._gatherRightLongEdgeDummies(),this.leftLongEdgeDummies.length===0?this.leftmostLayerId=t.getLayer().id:this.leftmostLayerId=this.leftLongEdgeDummies[0].getLayer().id,this.rightLongEdgeDummies.length===0?this.rightmostLayerId=t.getLayer().id:this.rightmostLayerId=this.rightLongEdgeDummies[this.rightLongEdgeDummies.length-1].getLayer().id;let o=t.getProperty(p.REPRESENTED_LABELS);if(o!=null){for(let r of o)if(r.hasProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY)){this.placementStrategy=r.getProperty(_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY);break}}}_gatherLeftLongEdgeDummies(){let t=this.labelDummy;do{let e=null;for(let o of t.getIncomingEdges()){e=o.getSource().getNode();break}if(e==null)break;t=e,t.getType()===y.LONG_EDGE&&this.leftLongEdgeDummies.push(t)}while(t.getType()===y.LONG_EDGE);this.leftLongEdgeDummies.reverse()}_gatherRightLongEdgeDummies(){let t=this.labelDummy;do{let e=null;for(let o of t.getOutgoingEdges()){e=o.getTarget().getNode();break}if(e==null)break;t=e,t.getType()===y.LONG_EDGE&&this.rightLongEdgeDummies.push(t)}while(t.getType()===y.LONG_EDGE)}totalDummyCount(){return this.rightmostLayerId-this.leftmostLayerId+1}ithDummyNode(t){return t<this.leftLongEdgeDummies.length?this.leftLongEdgeDummies[t]:t===this.leftLongEdgeDummies.length?this.labelDummy:this.rightLongEdgeDummies[t-this.leftLongEdgeDummies.length-1]}};var Hn=new m("org.eclipse.elk.labels.labelManager");var MN=20,__=40,ol=60,el=class{constructor(t){this._centerLabels=!!t}process(t,e){e.begin("Label management",1);let o=t.getProperty(Hn);if(o!=null){let r=t.getProperty(_.SPACING_EDGE_LABEL),i=t.getProperty(_.SPACING_LABEL_LABEL);this._centerLabels?GN(t,o,r,i):bN(t,o,i)}e.done()}};function bN(n,t,e){let o=n.getProperty(_.DIRECTION),r=o!=null&&o.isVertical&&o.isVertical();for(let i of n)for(let s of i){if(s.getType()===y.NORMAL){As(t,s.getLabels(),__,e,r);for(let a of s.getPorts())As(t,a.getLabels(),MN,e,r);s.hasProperty(p.TOP_COMMENTS)&&Vm(t,s.getProperty(p.TOP_COMMENTS),__,r),s.hasProperty(p.BOTTOM_COMMENTS)&&Vm(t,s.getProperty(p.BOTTOM_COMMENTS),__,r)}for(let a of s.getOutgoingEdges())As(t,a.getLabels(),ol,0,r)}}function Vm(n,t,e,o){for(let r of t)r.getLabels().length!==0&&As(n,r.getLabels(),e,0,o)}function GN(n,t,e,o){let r=n.getProperty(_.DIRECTION),i=r!=null&&r.isVertical&&r.isVertical();for(let s of n){let a=Math.max(ol,z.findMaxNonDummyNodeWidth(s,!1));for(let l of s){if(l.getType()!==y.LABEL)continue;let c=null;for(let f of l.getConnectedEdges()){c=f;break}let g=c.getProperty(_.EDGE_THICKNESS),h=l.getProperty(p.REPRESENTED_LABELS),d=As(t,h,a,o,i);l.getSize().x=d.x,l.getSize().y=d.y+g+e}}}function As(n,t,e,o,r){let i=new O,s=!1;for(let a of t){s=!0;let l=a.getSize(),c=a.getProperty(p.ORIGIN);if(c!=null){let g=n.manageLabelSize(c,e);g!=null&&(r?(l.x=g.y,l.y=g.x):(l.x=g.x,l.y=g.y))}r?(i.x+=o+a.getSize().x,i.y=Math.max(i.y,l.y)):(i.x=Math.max(i.x,l.x),i.y+=o+a.getSize().y)}return s&&(r?i.x-=o:i.y-=o),i}var Tt=class{constructor(t){this.name=t,this._transposed=null}toString(){return this.name}transpose(){return this._transposed||this}};Tt.ALWAYS_UP=new Tt("ALWAYS_UP");Tt.ALWAYS_DOWN=new Tt("ALWAYS_DOWN");Tt.DIRECTION_UP=new Tt("DIRECTION_UP");Tt.DIRECTION_DOWN=new Tt("DIRECTION_DOWN");Tt.SMART_UP=new Tt("SMART_UP");Tt.SMART_DOWN=new Tt("SMART_DOWN");Tt.ALWAYS_UP._transposed=Tt.ALWAYS_DOWN;Tt.ALWAYS_DOWN._transposed=Tt.ALWAYS_UP;Tt.DIRECTION_UP._transposed=Tt.DIRECTION_DOWN;Tt.DIRECTION_DOWN._transposed=Tt.DIRECTION_UP;Tt.SMART_UP._transposed=Tt.SMART_DOWN;Tt.SMART_DOWN._transposed=Tt.SMART_UP;[Tt.ALWAYS_UP,Tt.ALWAYS_DOWN,Tt.DIRECTION_UP,Tt.DIRECTION_DOWN,Tt.SMART_UP,Tt.SMART_DOWN].forEach(n=>Object.freeze(n));var dh=class{process(t,e){let o=t.getProperty(_.EDGE_LABELS_SIDE_SELECTION);switch(e.begin(`Label side selection (${o})`,1),o){case Tt.ALWAYS_UP:Xm(t,Vt.ABOVE);break;case Tt.ALWAYS_DOWN:Xm(t,Vt.BELOW);break;case Tt.DIRECTION_UP:Km(t,Vt.ABOVE);break;case Tt.DIRECTION_DOWN:Km(t,Vt.BELOW);break;case Tt.SMART_UP:Zm(t,Vt.ABOVE);break;case Tt.SMART_DOWN:Zm(t,Vt.BELOW);break}e.done()}};function Xm(n,t){for(let e of n)for(let o of e){o.getType()===y.LABEL&&si(o,t);for(let r of o.getOutgoingEdges())Qm(r,t)}}function Km(n,t){for(let e of n)for(let o of e){if(o.getType()===y.LABEL){let r=BN(o)?t:t.opposite();si(o,r)}for(let r of o.getOutgoingEdges()){let i=p_(r)?t:t.opposite();Qm(r,i)}}}function Zm(n,t){let e=[];for(let o of n){let r=!0,i=0;for(let s of o){let a=s.getType();if(a===y.LABEL){i++,e.push(s);continue}if(a===y.LONG_EDGE){e.push(s);continue}a===y.NORMAL&&vN(s,t),e.length>0&&jm(e,i,r,!1,t),r=!1,i=0}e.length>0&&jm(e,i,r,!0,t)}}function jm(n,t,e,o,r){e&&(!o||n.length>1)&&t===1&&n[0].getType()===y.LABEL?si(n[0],Vt.ABOVE):o&&(!e||n.length>1)&&t===1&&n[n.length-1].getType()===y.LABEL?si(n[n.length-1],Vt.BELOW):n.length===2?(si(n.shift(),Vt.ABOVE),si(n.shift(),Vt.BELOW)):HN(n,t,r),n.length=0}function HN(n,t,e){let o=[],r=null,i=null;for(let s of n){let a=$m(s,!0),l=$m(s,!1);(r!==a||i!==l)&&(qm(o,e),r=a,i=l),o.push(s)}qm(o,e)}function $m(n,t){let e=n.getProperty(t?p.LONG_EDGE_SOURCE:p.LONG_EDGE_TARGET);return e==null?null:e.getNode()}function qm(n,t){if(n.length>0){if(n.length===2)si(n[0],Vt.ABOVE),si(n[1],Vt.BELOW);else for(let e of n)si(e,t);n.length=0}}function vN(n,t){let e=[],o=null;for(let r of n.getPorts()){r.getSide()!==o&&(e.length>0&&Jm(e,o,t),e.length=0,o=r.getSide());let i=In.gatherLabels(r);i!=null&&e.push(i)}e.length>0&&Jm(e,o,t)}function Jm(n,t,e){if(n.length===2)t===u.NORTH||t===u.EAST?(rl(n.shift(),Vt.ABOVE),rl(n.shift(),Vt.BELOW)):(rl(n.shift(),Vt.BELOW),rl(n.shift(),Vt.ABOVE));else for(let o of n)rl(o,e)}function si(n,t){if(n.getType()!==y.LABEL)return;let e=n.isInlineEdgeLabel()?Vt.INLINE:t;if(n.setProperty(p.LABEL_SIDE,e),e!==Vt.BELOW){let r=n.getProperty(p.ORIGIN).getProperty(_.EDGE_THICKNESS),i=0;if(e===Vt.ABOVE)i=n.getSize().y-Math.ceil(r/2);else if(e===Vt.INLINE){let s=n.getGraph().getProperty(_.SPACING_EDGE_LABEL);i=Math.ceil(n.getSize().y-s-r)/2,n.getSize().y-=s,n.getSize().y-=r}for(let s of n.getPorts())s.getPosition().y=i}}function Qm(n,t){for(let e of n.getLabels())e.setProperty(p.LABEL_SIDE,t)}function rl(n,t){for(let e of n)e.setProperty(p.LABEL_SIDE,t)}function p_(n){return!n.getProperty(p.REVERSED)}function BN(n){let t=null;for(let o of n.getIncomingEdges()){t=o;break}let e=null;for(let o of n.getOutgoingEdges()){e=o;break}return t!=null&&p_(t)||e!=null&&p_(e)}var fh=class{process(t,e){e.begin("Layer constraint postprocessing",1);let o=t.getLayers();if(o.length>0){let r=o[0],i=o[o.length-1],s=new Et(t),a=new Et(t);UN(t,r,i,s,a),s.getNodes().length>0&&o.unshift(s),a.getNodes().length>0&&o.push(a)}if(t.hasProperty(p.HIDDEN_NODES)){let r=new Et(t),i=new Et(t);FN(t,r,i),r.getNodes().length>0&&o.unshift(r),i.getNodes().length>0&&o.push(i)}e.done()}};function UN(n,t,e,o,r){for(let a of n){let l=a.getNodes().slice();for(let c of l)switch(c.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST:kN(c),c.setLayer(t),tP(c,!0,o);break;case J.LAST:WN(c),c.setLayer(e),tP(c,!1,r);break;default:break}}let i=n.getLayers(),s=0;for(;s<i.length;)i[s].getNodes().length===0?i.splice(s,1):s++}function tP(n,t,e){let o=t?n.getIncomingEdges():n.getOutgoingEdges();for(let r of o){let i=t?r.getSource().getNode():r.getTarget().getNode();i.getType()===y.LABEL&&i.setLayer(e)}}function FN(n,t,e){for(let o of n.getProperty(p.HIDDEN_NODES)){let r=o.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(r===J.FIRST_SEPARATE)o.setLayer(t);else if(r===J.LAST_SEPARATE)o.setLayer(e);else throw new Error(`Hidden node ${o} has unexpected layer constraint ${r}`);for(let i of o.getConnectedEdges()){if(i.getSource()!=null&&i.getTarget()!=null)continue;let s=i.getTarget()==null,a=i.getProperty(p.ORIGINAL_OPPOSITE_PORT);s?i.setTarget(a):i.setSource(a)}}}function kN(n){for(let t of n.getIncomingEdges())if(t.getSource().getNode().getType()!==y.LABEL)throw new Error(`Node '${n.getDesignation()}' has FIRST layer constraint with a non-LABEL incoming edge.`)}function WN(n){for(let t of n.getOutgoingEdges())if(t.getTarget().getNode().getType()!==y.LABEL)throw new Error(`Node '${n.getDesignation()}' has LAST layer constraint with a non-LABEL outgoing edge.`)}var oP="NONE",vn="FIRST_SEPARATE",uh="LAST_SEPARATE",E_="BOTH",$K=Symbol("separateLayerConnections"),_h=class{process(t,e){e.begin("Layer constraint preprocessing",1);let o=[],r=t.getLayerlessNodes(),i=0;for(;i<r.length;){let s=r[i];zN(s)?(YN(s),o.push(s),r.splice(i,1)):i++}o.length>0&&t.setProperty(p.HIDDEN_NODES,o),e.done()}};function zN(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT);return t===J.FIRST_SEPARATE||t===J.LAST_SEPARATE}function YN(n){$N(n);let t=[];for(let e of n.getConnectedEdges())t.push(e);for(let e of t)VN(n,e)}function VN(n,t){let e=t.getSource().getNode()===n,o=e?t.getTarget():t.getSource();e?t.setTarget(null):t.setSource(null),t.setProperty(p.ORIGINAL_OPPOSITE_PORT,o),XN(n,o.getNode())}function XN(n,t){if(t.hasProperty(_.LAYERING_LAYER_CONSTRAINT))return;let e=KN(t),o=jN(e,n.getProperty(_.LAYERING_LAYER_CONSTRAINT));ZN(t,o),t.getConnectedEdges()[Symbol.iterator]().next().done&&(o===vn?t.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST):o===uh&&t.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST))}function KN(n){return n._hiddenConnections||oP}function ZN(n,t){n._hiddenConnections=t}function jN(n,t){let e=t===J.FIRST_SEPARATE?vn:uh;return n===oP?e:n===vn?e===vn?vn:E_:n===uh?e===vn?E_:uh:E_}function $N(n){let t=n.getProperty(_.LAYERING_LAYER_CONSTRAINT);if(t===J.FIRST_SEPARATE){for(let e of n.getIncomingEdges())if(!eP(e))throw new Error(`Node '${n.getDesignation()}' has FIRST_SEPARATE with an incoming edge.`)}else if(t===J.LAST_SEPARATE){for(let e of n.getOutgoingEdges())if(!eP(e))throw new Error(`Node '${n.getDesignation()}' has LAST_SEPARATE with an outgoing edge.`)}}function eP(n){let t=n.getSource().getNode(),e=n.getTarget().getNode();return t.getType()===y.EXTERNAL_PORT&&e.getType()===y.EXTERNAL_PORT}var ph=class{process(t,e){e.begin("Layer size calculation",1);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=!1;for(let s of t){let a=s.getSize();if(a.x=0,a.y=0,s.getNodes().length===0)continue;i=!0;for(let d of s){let f=d.getSize(),E=d.getMargin(),P=f.x+E.left+E.right;P>a.x&&(a.x=P)}let l=s.getNodes()[0],c=l.getPosition().y-l.getMargin().top;if(l.getType()===y.EXTERNAL_PORT){let d=t.getProperty(_.SPACING_PORTS_SURROUNDING);d!=null&&(c-=d.top)}let g=s.getNodes()[s.getNodes().length-1],h=g.getPosition().y+g.getSize().y+g.getMargin().bottom;if(g.getType()===y.EXTERNAL_PORT){let d=t.getProperty(_.SPACING_PORTS_SURROUNDING);d!=null&&(h+=d.bottom)}a.y=h-c,c<o&&(o=c),h>r&&(r=h)}i||(o=0,r=0),t.getSize().y=r-o,t.getOffset().y=t.getOffset().y-o,e.done()}};var il=class{constructor(){this._keyToValues=new Map,this._valueToKey=new Map}putAll(t,e){for(let o of e)this.put(t,o)}put(t,e){let o=this._valueToKey.get(e);if(o!==void 0){let i=this._keyToValues.get(o);if(i){let s=i.indexOf(e);s>=0&&i.splice(s,1)}}let r=this._keyToValues.get(t);r==null&&(r=[],this._keyToValues.set(t,r)),r.push(e),this._valueToKey.set(e,t)}getKey(t){return this._valueToKey.get(t)}getValues(t){let e=this._keyToValues.get(t);return e==null?[]:e}keySet(){return this._keyToValues.keys()}isMaximalKey(t){for(let e of this._keyToValues.keys())if(typeof t.compareTo=="function"?t.compareTo(e)<0:t<e)return!1;return!0}isMinimalKey(t){for(let e of this._keyToValues.keys())if(typeof t.compareTo=="function"?t.compareTo(e)>0:t>e)return!1;return!0}};var ut=class{constructor(t){this._name=t}toString(){return this._name}};ut.NONE=new ut("NONE");ut.NIKOLOV=new ut("NIKOLOV");ut.NIKOLOV_PIXEL=new ut("NIKOLOV_PIXEL");ut.NIKOLOV_IMPROVED=new ut("NIKOLOV_IMPROVED");ut.NIKOLOV_IMPROVED_PIXEL=new ut("NIKOLOV_IMPROVED_PIXEL");ut.DUMMYNODE_PERCENTAGE=new ut("DUMMYNODE_PERCENTAGE");ut.NODECOUNT_PERCENTAGE=new ut("NODECOUNT_PERCENTAGE");ut.NO_BOUNDARY=new ut("NO_BOUNDARY");ut.MODEL_ORDER_LEFT_TO_RIGHT=new ut("MODEL_ORDER_LEFT_TO_RIGHT");ut.MODEL_ORDER_RIGHT_TO_LEFT=new ut("MODEL_ORDER_RIGHT_TO_LEFT");var Eh=class{constructor(){this._masterGraph=null,this._nodesWithIncomingEdges=[],this._nodes=[],this._currentWidth=[],this._currentWidthPixel=[],this._layers=[],this._degreeDiff=[],this._maxWidth=0,this._maxWidthPixel=0,this._dummyNodeCount=0,this._maxHeight=0,this._nodeSizeAffix=0,this._dummySize=0,this._promotionStrategy=null,this._biLayerMap=new il}process(t,e){e.begin("Node promotion heuristic",1),this._masterGraph=t,this._promotionStrategy=t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY),this._promotionStrategy!==ut.MODEL_ORDER_LEFT_TO_RIGHT&&this._promotionStrategy!==ut.MODEL_ORDER_RIGHT_TO_LEFT?this._precalculateAndSetInformation():this._precalculateAndSetInformationModelOrder();let o=t.getProperty(_.LAYERING_NODE_PROMOTION_MAX_ITERATIONS),r=()=>!0;switch(this._promotionStrategy){case ut.NIKOLOV:this._promotionMagic(r);break;case ut.NIKOLOV_PIXEL:this._promotionMagic(r);break;case ut.NIKOLOV_IMPROVED:{this._promotionStrategy=ut.NO_BOUNDARY,this._promotionMagic(r);let i=0;for(let s of this._currentWidth)i=Math.max(i,s);i>this._maxWidth&&(this._promotionStrategy=ut.NIKOLOV,this._promotionMagic(r));break}case ut.NIKOLOV_IMPROVED_PIXEL:{this._promotionStrategy=ut.NO_BOUNDARY,this._promotionMagic(r);let i=0;for(let s of this._currentWidthPixel)i=Math.max(i,s);i>this._maxWidthPixel&&(this._promotionStrategy=ut.NIKOLOV_PIXEL,this._promotionMagic(r));break}case ut.NODECOUNT_PERCENTAGE:{let i=Math.ceil(this._layers.length*o/100);this._promotionMagic(s=>s.getSecond()<i);break}case ut.DUMMYNODE_PERCENTAGE:{let i=Math.ceil(this._dummyNodeCount*o/100);this._promotionMagic(s=>s.getFirst()<i);break}case ut.MODEL_ORDER_LEFT_TO_RIGHT:this._modelOrderNodePromotion(!0);break;case ut.MODEL_ORDER_RIGHT_TO_LEFT:this._modelOrderNodePromotion(!1);break;default:this._promotionMagic(r);break}this._promotionStrategy!==ut.MODEL_ORDER_LEFT_TO_RIGHT&&this._promotionStrategy!==ut.MODEL_ORDER_RIGHT_TO_LEFT?this._setNewLayering(t):this._setNewLayeringModelOrder(t),e.done()}_precalculateAndSetInformation(){this._nodeSizeAffix=this._masterGraph.getProperty(_.SPACING_NODE_NODE),this._dummySize=this._masterGraph.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),this._maxHeight=this._masterGraph.getLayers().length;let t=this._maxHeight-1,e=0;this._maxWidth=0,this._maxWidthPixel=0,this._currentWidth=new Array(this._maxHeight).fill(0),this._currentWidthPixel=new Array(this._maxHeight).fill(0);for(let r of this._masterGraph.getLayers()){r.id=t;for(let i of r.getNodes())i.id=e,e++;t--}this._layers=new Array(e).fill(0),this._degreeDiff=new Array(e);for(let r=0;r<e;r++)this._degreeDiff[r]=[0,0,0];this._nodes=[],this._nodesWithIncomingEdges=[];let o=0;this._dummyNodeCount=0;for(let r of this._masterGraph){t=r.id;let i=0,s=0,a=r.getNodes().length,l=0;for(let g of r.getNodes()){e=g.id,this._layers[e]=g.getLayer().id,l+=g.getSize().y+this._nodeSizeAffix;let h=0;for(let f of g.getIncomingEdges())h++;let d=0;for(let f of g.getOutgoingEdges())d++;this._degreeDiff[e][0]=d-h,this._degreeDiff[e][1]=h,this._degreeDiff[e][2]=d,i+=h,s+=d,h>0&&this._nodesWithIncomingEdges.push(g),this._nodes.push(g)}o-=i;let c=a+o;l+=o*this._dummySize,this._currentWidth[t]=c,this._currentWidthPixel[t]=l,this._maxWidth=Math.max(this._maxWidth,c),this._maxWidthPixel=Math.max(this._maxWidthPixel,l),this._dummyNodeCount+=o,o+=s}}_precalculateAndSetInformationModelOrder(){this._biLayerMap=new il;let t=0,e=0;for(let i of this._masterGraph.getLayers()){i.id=e;for(let s of i.getNodes())s.id=t,t++;e++}let r=this._promotionStrategy===ut.MODEL_ORDER_LEFT_TO_RIGHT?qN:JN;for(let i of this._masterGraph)i.getNodes().sort(r),this._biLayerMap.putAll(i.id,i.getNodes())}_modelOrderNodePromotion(t){let e=0;for(let s of this._masterGraph.getLayers())e+=s.getNodes().length;let o=2*(this._masterGraph.getLayers().length+e)+10,r=0,i;do{i=!1;let a=[...this._biLayerMap.keySet()].length,l=t?a-2:1,c=t?h=>h>=0:h=>h<a,g=t?-1:1;for(let h=l;c(h);h+=g){let d=this._biLayerMap.getValues(h);for(let f=0;f<d.length;f++){let E=d[f];if(!E.hasProperty(p.MODEL_ORDER)||this._biLayerMap.isMaximalKey(h)&&this._promotionStrategy===ut.MODEL_ORDER_LEFT_TO_RIGHT||this._biLayerMap.isMinimalKey(h)&&this._promotionStrategy===ut.MODEL_ORDER_RIGHT_TO_LEFT)continue;let P=!0;for(let x of d){if(!x.hasProperty(p.MODEL_ORDER))continue;let M=E.getProperty(p.MODEL_ORDER),A=x.getProperty(p.MODEL_ORDER);if(t&&M<A||!t&&M>A){P=!1;break}}if(!P)continue;let S=t?h+1:h-1,T=this._biLayerMap.getValues(S),N=!1,I=!0,C=!1;for(let x of T)if(x.hasProperty(p.MODEL_ORDER)){if(x.id!==E.id){let M=x.getProperty(p.MODEL_ORDER),A=E.getProperty(p.MODEL_ORDER);N||(N=t?M<A:M>A),I=!1}}else if(!N&&I&&x.getType()===y.LABEL){C=!0;let M;if(t?M=Bn(x.getIncomingEdges()).getSource().getNode():M=Bn(x.getOutgoingEdges()).getTarget().getNode(),M===E){let A;t?A=Bn(x.getOutgoingEdges()).getTarget().getNode():A=Bn(x.getIncomingEdges()).getSource().getNode(),(t?this._biLayerMap.getKey(A)-this._biLayerMap.getKey(M):this._biLayerMap.getKey(M)-this._biLayerMap.getKey(A))<=2&&(I=!1)}}if(C&&I){let x;t?x=Bn(E.getOutgoingEdges()).getTarget().getNode():x=Bn(E.getIncomingEdges()).getSource().getNode(),(t?this._biLayerMap.getKey(x)-this._biLayerMap.getKey(E):this._biLayerMap.getKey(E)-this._biLayerMap.getKey(x))<=2&&x.getType()===y.NORMAL&&(I=!1)}if(N||I){let x=this._promoteNodeByModelOrder(E,t);for(;x.size>0;){let M=x.values().next().value;x.delete(M);for(let A of this._promoteNodeByModelOrder(M,t))x.add(A)}f--,i=!0}}}}while(i&&++r<o)}_promoteNodeByModelOrder(t,e){let o=this._biLayerMap.getKey(t);e?this._biLayerMap.put(o+1,t):this._biLayerMap.put(o-1,t);let r=new Set,i=e?t.getOutgoingEdges():t.getIncomingEdges();for(let s of i){let a=e?s.getTarget().getNode():s.getSource().getNode();this._biLayerMap.getKey(a)===this._biLayerMap.getKey(t)&&r.add(a)}return r}_promotionMagic(t){let e,o,r=0,i=0,s=this._layers.slice(),a=this._dummyNodeCount,l=this._maxHeight,c=this._currentWidth.slice(),g=this._currentWidthPixel.slice();do{e=0;for(let h of this._nodesWithIncomingEdges){let d=this._promoteNode(h),f=!0;(this._promotionStrategy===ut.NIKOLOV||this._promotionStrategy===ut.NIKOLOV_PIXEL)&&(f=d.getSecond()),d.getFirst()<0&&f?(e++,s=this._layers.slice(),this._dummyNodeCount=this._dummyNodeCount+d.getFirst(),i+=a-this._dummyNodeCount,a=this._dummyNodeCount+d.getFirst(),l=this._maxHeight,c=this._currentWidth.slice(),g=this._currentWidthPixel.slice()):(this._layers=s.slice(),this._dummyNodeCount=a,this._currentWidth=c.slice(),this._currentWidthPixel=g.slice(),this._maxHeight=l)}r++,o=e!==0&&t(Gt.of(i,r))}while(o)}_promoteNode(t){let e=!0,o=0,r=this._layers[t.id],i=t.getSize().y+this._nodeSizeAffix,s=this._degreeDiff[t.id][2];if(this._currentWidth[r]=this._currentWidth[r]-1+s,this._currentWidthPixel[r]=this._currentWidthPixel[r]-i+s*this._dummySize,r++,r>=this._maxHeight)this._maxHeight++,this._currentWidth.push(1),this._currentWidthPixel.push(i);else{let a=this._degreeDiff[t.id][1];this._currentWidth[r]=this._currentWidth[r]+1-a,this._currentWidthPixel[r]=this._currentWidthPixel[r]+i-a*this._dummySize}(this._promotionStrategy===ut.NIKOLOV&&(this._currentWidth[r]>this._maxWidth||this._currentWidth[r-1]>this._maxWidth)||this._promotionStrategy===ut.NIKOLOV_PIXEL&&(this._currentWidthPixel[r]>this._maxWidthPixel||this._currentWidthPixel[r-1]>this._maxWidthPixel))&&(e=!1);for(let a of t.getIncomingEdges()){let l=a.getSource().getNode();if(this._layers[l.id]===r){let c=this._promoteNode(l);o=o+c.getFirst(),e=e&&c.getSecond()}}return this._layers[t.id]=r,o=o+this._degreeDiff[t.id][0],Gt.of(o,e)}_setNewLayering(t){let e=[];for(let o=0;o<=this._maxHeight;o++){let r=new Et(t);r.id=this._maxHeight-o,e.push(r)}for(let o of this._nodes)o.setLayer(e[this._maxHeight-this._layers[o.id]]);for(let o=e.length-1;o>=0;o--)e[o].getNodes().length===0&&e.splice(o,1);t.getLayers().length=0;for(let o of e)t.getLayers().push(o)}_setNewLayeringModelOrder(t){let e=[];t.getLayers().length=0;let o=[...this._biLayerMap.keySet()].sort((r,i)=>r-i);for(let r of o){let i=this._biLayerMap.getValues(r);if(i.length===0)continue;let s=new Et(t);e.push(s),s.id=r;for(let a of i)a.setLayer(s)}for(let r of e)t.getLayers().push(r)}};function qN(n,t){return n.hasProperty(p.MODEL_ORDER)&&t.hasProperty(p.MODEL_ORDER)?t.getProperty(p.MODEL_ORDER)-n.getProperty(p.MODEL_ORDER):0}function JN(n,t){return n.hasProperty(p.MODEL_ORDER)&&t.hasProperty(p.MODEL_ORDER)?n.getProperty(p.MODEL_ORDER)-t.getProperty(p.MODEL_ORDER):0}function Bn(n){for(let t of n)return t;return null}var mh=class{process(t,e){e.begin("Odd port side processing",1);let o=t.getProperty(_.EDGE_ROUTING);for(let r of t){let i=z.toNodeArray(r.getNodes());for(let s of i)if(s.getType()===y.NORTH_SOUTH_PORT){if(o===At.SPLINES)for(let a of s.getPorts())a.getIncomingEdges().length>0&&oy(a),a.getOutgoingEdges().length>0&&ry(a);else if(s.getProperty(p.ORIGIN)instanceof _e)ey(s);else{let a=s.getPorts(),l=!1;if(a.length>=2){l=!0;for(let c=1;c<a.length;c++)if(a[c-1].getProperty(p.ORIGIN)!==a[c].getProperty(p.ORIGIN)){l=!1;break}}for(let c of a)c.getIncomingEdges().length>0&&QN(c,l),c.getOutgoingEdges().length>0&&ty(c,l)}s.setLayer(null)}}e.done()}};function QN(n,t){let e=n.getProperty(p.ORIGIN),o=e.getAbsoluteAnchor().x,r=n.getNode().getPosition().y,i=z.toEdgeArray(n.getIncomingEdges());for(let s of i)if(s.setTarget(e),s.getBendPoints().addLast(o,r),t){let a=s.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,s.setProperty(_.JUNCTION_POINTS,a)),a.add(new O(o,r))}}function ty(n,t){let e=n.getProperty(p.ORIGIN),o=e.getAbsoluteAnchor().x,r=n.getNode().getPosition().y,i=z.toEdgeArray(n.getOutgoingEdges());for(let s of i)if(s.setSource(e),s.getBendPoints().addFirst(o,r),t){let a=s.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,s.setProperty(_.JUNCTION_POINTS,a)),a.add(new O(o,r))}}function ey(n){let t=n.getProperty(p.ORIGIN),e=[...n.getPorts(u.WEST)][0],o=[...n.getPorts(u.EAST)][0],r=e.getProperty(p.ORIGIN),i=o.getProperty(p.ORIGIN);t.setSource(i),t.setTarget(r);let s=new O(o.getNode().getPosition());s.x=i.getAbsoluteAnchor().x,t.getBendPoints().add(s);let a=new O(e.getNode().getPosition());a.x=r.getAbsoluteAnchor().x,t.getBendPoints().add(a)}function oy(n){let t=n.getProperty(p.ORIGIN);t.setProperty(p.SPLINE_NS_PORT_Y_COORD,n.getNode().getPosition().y);let e=z.toEdgeArray(n.getIncomingEdges());for(let o of e)o.setTarget(t)}function ry(n){let t=n.getProperty(p.ORIGIN);t.setProperty(p.SPLINE_NS_PORT_Y_COORD,n.getNode().getPosition().y);let e=z.toEdgeArray(n.getOutgoingEdges());for(let o of e)o.setSource(t)}var $t=class{constructor(t){this._name=t,Object.freeze(this)}toString(){return this._name}};$t.NONE=new $t("NONE");$t.NODES_AND_EDGES=new $t("NODES_AND_EDGES");$t.PREFER_EDGES=new $t("PREFER_EDGES");$t.PREFER_NODES=new $t("PREFER_NODES");var Ph=class{process(t,e){e.begin("Odd port side processing",1);let o=[],r=[];for(let i of t){let s=-1,a=z.toNodeArray(i.getNodes());for(let l of a){s++;let c=l.getProperty(_.PORT_CONSTRAINTS);if(l.getType()!==y.NORMAL||!c.isSideFixed())continue;!c.isOrderFixed()&&l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)===$t.NONE&&iy(l),l.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),o.length=0,r.length=0;let g=[],h=[...l.getPorts(u.NORTH)];l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==$t.NONE&&(h=iP(h)),sP(t,h,o,r,g);let d=s,f=l;for(let S of o)S.setLayer(d,i),s++,S.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),S.getPorts()[0].getProperty(p.ORIGIN).getProperty(_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES)||S.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(f);let E=[];for(let S of l.getPorts(u.SOUTH))E.unshift(S);l.getGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==$t.NONE&&(E=iP(E)),sP(t,E,r,null,g);let P=l;for(let S of r)S.setLayer(++s,i),S.setProperty(p.IN_LAYER_LAYOUT_UNIT,l),S.getPorts()[0].getProperty(p.ORIGIN).getProperty(_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES)||P.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(S);g.length>0&&l.setProperty(p.BARYCENTER_ASSOCIATES,g)}}e.done()}};function iy(n){let t=n.getPorts().length,e=0,o=t,r=2*t;for(let i of n.getPorts()){let s=i.getSide();if(s===u.EAST||s===u.WEST){i.id=-1;continue}if(s!==u.NORTH&&s!==u.SOUTH)continue;let a=i.getIncomingEdges().length,l=i.getOutgoingEdges().length;a>0&&l>0?i.id=o++:a>0?i.id=e++:l>0?i.id=r++:i.id=e++}n.getPorts().sort((i,s)=>{let a=i.getSide(),l=s.getSide();return a!==l?rP(a)-rP(l):i.id===s.id?0:a===u.NORTH?i.id-s.id:s.id-i.id})}function rP(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function iP(n){let t=[],e=[];for(let o of n)o.getIncomingEdges().length>0?t.push(o):e.push(o);return t.reverse(),t.concat(e)}function sP(n,t,e,o,r){let i=[],s=[],a=[],l=[],c=[];for(let g of t)for(let h of g.getOutgoingEdges())h.getSource().getNode()===h.getTarget().getNode()&&(g.getSide()===h.getTarget().getSide()?l.push(h):g.getSide()===u.NORTH&&h.getTarget().getSide()===u.SOUTH&&c.push(h));for(let g of c)ny(n,g,e,o,u.EAST);for(let g of l)sy(n,g,e);for(let g of t){let h=g.getIncomingEdges().length>0,d=g.getOutgoingEdges().length>0;h&&d?a.push(g):h?i.push(g):d&&s.push(g)}for(let g of i)r.push(m_(n,g,null,e));for(let g of s)r.push(m_(n,null,g,e));for(let g of a)r.push(m_(n,g,g,e))}function m_(n,t,e,o){let r=new ft(n);r.setType(y.NORTH_SOUTH_PORT),r.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS);let i=0;if(t!=null){let s=new rt;s.setProperty(p.ORIGIN,t),r.setProperty(p.ORIGIN,t.getNode()),s.setSide(u.WEST),s.setNode(r);let a=z.toEdgeArray(t.getIncomingEdges());for(let l of a)l.setTarget(s);t.setProperty(p.PORT_DUMMY,r),i++}if(e!=null){let s=new rt;r.setProperty(p.ORIGIN,e.getNode()),s.setProperty(p.ORIGIN,e),s.setSide(u.EAST),s.setNode(r);let a=z.toEdgeArray(e.getOutgoingEdges());for(let l of a)l.setSource(s);e.setProperty(p.PORT_DUMMY,r),i++}return r.setProperty(p.CROSSING_HINT,i),o.push(r),r}function sy(n,t,e){let o=new ft(n);o.setType(y.NORTH_SOUTH_PORT),o.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),o.setProperty(p.ORIGIN,t);let r=new rt;r.setProperty(p.ORIGIN,t.getTarget()),r.setSide(u.WEST),r.setNode(o);let i=new rt;i.setProperty(p.ORIGIN,t.getSource()),i.setSide(u.EAST),i.setNode(o),t.getSource().setProperty(p.PORT_DUMMY,o),t.getTarget().setProperty(p.PORT_DUMMY,o),t.setSource(null),t.setTarget(null),e.push(o),o.setProperty(p.CROSSING_HINT,2)}function ny(n,t,e,o,r){let i=new ft(n);i.setType(y.NORTH_SOUTH_PORT),i.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),i.setProperty(p.ORIGIN,t.getSource().getNode());let s=new rt;s.setProperty(p.ORIGIN,t.getSource()),s.setSide(r),s.setNode(i),t.getSource().setProperty(p.PORT_DUMMY,i);let a=new ft(n);a.setType(y.NORTH_SOUTH_PORT),a.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),a.setProperty(p.ORIGIN,t.getTarget().getNode());let l=new rt;l.setProperty(p.ORIGIN,t.getTarget()),l.setSide(r),l.setNode(a),t.getTarget().setProperty(p.PORT_DUMMY,a),t.setSource(s),t.setTarget(l),e.unshift(i),o.push(a),i.setProperty(p.CROSSING_HINT,1),a.setProperty(p.CROSSING_HINT,1)}var Oh=class{process(t,e){e.begin("Partition midprocessing",1);let o=new Map;for(let i of t.getLayerlessNodes()){if(!i.hasProperty(_.PARTITIONING_PARTITION))continue;let s=i.getProperty(_.PARTITIONING_PARTITION),a=o.get(s);a==null&&(a=[],o.set(s,a)),a.push(i)}if(o.size===0){e.done();return}let r=Array.from(o.keys()).sort((i,s)=>i-s);for(let i=0;i<r.length-1;i++){let s=o.get(r[i]),a=o.get(r[i+1]);ay(s,a)}e.done()}};function ay(n,t){for(let e of n){let o=new rt;o.setNode(e),o.setSide(u.EAST),o.setProperty(p.PARTITION_DUMMY,!0);for(let r of t){let i=new rt;i.setNode(r),i.setSide(u.WEST),i.setProperty(p.PARTITION_DUMMY,!0);let s=new _e;s.setProperty(p.PARTITION_DUMMY,!0),s.setSource(o),s.setTarget(i)}}}var Sh=class{process(t,e){e.begin("Partition postprocessing",1);for(let o of t)for(let r of o){let i=r.getPorts(),s=0;for(;s<i.length;)i[s].getProperty(p.PARTITION_DUMMY)?i.splice(s,1):s++}e.done()}};var ly=1e3,Th=class{process(t,e){e.begin("Partition preprocessing",1);let o=[];for(let i of t.getLayerlessNodes())i.hasProperty(_.PARTITIONING_PARTITION)&&o.push(i);let r=[];for(let i of o)for(let s of i.getOutgoingEdges())cy(s,o)&&r.push(s);for(let i of r)gy(i,t);e.done()}};function cy(n,t){let e=n.getSource().getNode(),o=n.getTarget().getNode();if(o.hasProperty(_.PARTITIONING_PARTITION)){let l=e.getProperty(_.PARTITIONING_PARTITION),c=o.getProperty(_.PARTITIONING_PARTITION);return l>c}let r=e.getProperty(_.PARTITIONING_PARTITION),i=new Set;for(let l of t)l.getProperty(_.PARTITIONING_PARTITION)<r&&i.add(l);let s=[e],a=new Set([e]);for(;s.length>0;){let l=s.shift();if(i.has(l))return!0;for(let c of l.getOutgoingEdges()){let g=c.getTarget().getNode();a.has(g)||(a.add(g),s.push(g))}}return!1}function gy(n,t){n.reverse(t,!0);let e=ly;n.hasProperty(_.PRIORITY_DIRECTION)&&(e+=n.getProperty(_.PRIORITY_DIRECTION)),n.setProperty(_.PRIORITY_DIRECTION,e)}var Ih=class{process(t,e){e.begin("Port order processing",1);let o=t.getProperty(_.PORT_SORTING_STRATEGY);for(let r of t)for(let i of r){let s=i.getProperty(_.PORT_CONSTRAINTS),a=i.getPorts();s.isOrderFixed()?a.sort(P_):s.isSideFixed()&&(a.sort(gP),hy(a),o==="PORT_DEGREE"&&a.sort(dy)),i.cachePortSides()}e.done()}};function hy(n){if(n.length<=1)return;let t=nP(n,u.SOUTH);aP(n,t[0],t[1]);let e=nP(n,u.WEST);aP(n,e[0],e[1])}function nP(n,t){if(n.length===0)return[0,0];let e=n[0].getSide(),o=0,r=t.ordinal(),i=t.ordinal()+1;for(;o<n.length-1&&e.ordinal()<r;)o++,e=n[o].getSide();let s=o;for(;s<n.length-1&&e.ordinal()<i;)s++,e=n[o].getSide();return[o,s]}function aP(n,t,e){if(e<=t+2)return;let o=Math.floor((e-t)/2);for(let r=0;r<o;r++){let i=n[t+r];n[t+r]=n[e-r-1],n[e-r-1]=i}}var gP=(n,t)=>{let e=n.getSide().ordinal()-t.getSide().ordinal();return e!==0?e:0},dy=(n,t)=>{if(n.getSide().ordinal()!==t.getSide().ordinal())return 0;switch(n.getSide()){case u.EAST:return Nh(t,lP)-Nh(n,lP);case u.WEST:return Nh(n,cP)-Nh(t,cP);default:return 0}};function lP(n){return n.getOutgoingEdges()}function cP(n){return n.getIncomingEdges()}function Nh(n,t){let e=0;for(let o of t(n))o.getProperty(p.REVERSED)||e++;return e}var fy=(n,t)=>{let e=n.getNode().getProperty(_.PORT_CONSTRAINTS);if(n.getSide().ordinal()-t.getSide().ordinal()!==0||!e.isOrderFixed())return 0;if(e===H.FIXED_ORDER){let r=n.getProperty(_.PORT_INDEX),i=t.getProperty(_.PORT_INDEX);if(r!=null&&i!=null){let s=r-i;if(s!==0)return s}}switch(n.getSide()){case u.NORTH:return yh(n.getPosition().x,t.getPosition().x);case u.EAST:return yh(n.getPosition().y,t.getPosition().y);case u.SOUTH:return yh(t.getPosition().x,n.getPosition().x);case u.WEST:return yh(t.getPosition().y,n.getPosition().y);default:throw new Error("Port side is undefined")}};function yh(n,t){return n<t?-1:n>t?1:0}var P_=(n,t)=>{let e=gP(n,t);return e!==0?e:fy(n,t)};var Un=class{process(t,e){e.begin("Port side processing",1);for(let o of t.getLayerlessNodes())hP(o);for(let o of t)for(let r of o)hP(r);e.done()}static setPortSide(t){let e=t.getProperty(p.PORT_DUMMY);e!=null?t.setSide(e.getProperty(p.EXT_PORT_SIDE)):t.getNetFlow()<0?t.setSide(u.EAST):t.setSide(u.WEST)}};function hP(n){if(n.getProperty(_.PORT_CONSTRAINTS).isSideFixed())for(let t of n.getPorts())t.getSide()===u.UNDEFINED&&Un.setPortSide(t);else{for(let t of n.getPorts())Un.setPortSide(t);n.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE)}}var Rh=class{process(t,e){e.begin("Restoring reversed edges",1);for(let o of t)for(let r of o)for(let i of r.getPorts()){let s=i.getOutgoingEdges().slice();for(let a of s)a.getProperty(p.REVERSED)&&a.reverse(t,!1)}e.done()}};var Je=class{constructor(t){this._name=t}toString(){return this._name}};Je.STACKED=new Je("STACKED");Je.REVERSE_STACKED=new Je("REVERSE_STACKED");Je.SEQUENCED=new Je("SEQUENCED");var kt=class n{constructor(t){this._name=t}toString(){return this._name}static fromPortSides(t){if(t.has(u.UNDEFINED))throw new Error("Port sides must not contain UNDEFINED");switch(t.size){case 1:return n.ONE_SIDE;case 2:{let e=t.has(u.EAST)&&t.has(u.WEST),o=t.has(u.NORTH)&&t.has(u.SOUTH);return e||o?n.TWO_SIDES_OPPOSING:n.TWO_SIDES_CORNER}case 3:return n.THREE_SIDES;case 4:return n.FOUR_SIDES;default:return null}}};kt.ONE_SIDE=new kt("ONE_SIDE");kt.TWO_SIDES_CORNER=new kt("TWO_SIDES_CORNER");kt.TWO_SIDES_OPPOSING=new kt("TWO_SIDES_OPPOSING");kt.THREE_SIDES=new kt("THREE_SIDES");kt.FOUR_SIDES=new kt("FOUR_SIDES");var Lh=class{constructor(){this._slLoopsByType=null,this._targetAreas=null}restorePorts(t,e){this._initTargetAreas(),this._slLoopsByType=uy(t),this._processOneSideLoops(t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_ORDERING)),this._processTwoSideCornerLoops(),this._processThreeSideLoops(),this._processFourSideLoops(),this._processTwoSideOpposingLoops(),this._restorePorts(t);for(let o=0;o<4;o++)for(let r=0;r<3;r++)for(let i of this._targetAreas[o][r])i.setHidden(!1);t.setPortsHidden(!1),this._slLoopsByType=null,this._targetAreas=null}_initTargetAreas(){this._targetAreas=[];for(let t=0;t<4;t++)this._targetAreas.push([[],[],[]])}_processOneSideLoops(t){var o;let e=(o=this._slLoopsByType.get(kt.ONE_SIDE))!=null?o:[];t===Je.REVERSE_STACKED&&e.reverse();for(let r of e){let i=r.getSLPorts()[0].getLPort().getSide(),s=r.getSLPorts().slice();if(s.sort((a,l)=>a.getSLNetFlow()-l.getSLNetFlow()),t===Je.SEQUENCED)this._addToTargetAreaPorts(s,i,Pe.MIDDLE,qo.APPEND);else{let a=_y(s);this._addToTargetAreaPorts(s.slice(0,a),i,Pe.MIDDLE,qo.PREPEND),this._addToTargetAreaPorts(s.slice(a),i,Pe.MIDDLE,qo.APPEND)}}}_processTwoSideCornerLoops(){var e;let t=(e=this._slLoopsByType.get(kt.TWO_SIDES_CORNER))!=null?e:[];for(let o of t){let r=Ah(o);this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.START,qo.APPEND)}}_processTwoSideOpposingLoops(){var e;let t=(e=this._slLoopsByType.get(kt.TWO_SIDES_OPPOSING))!=null?e:[];for(let o of t){let r=Ah(o);this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.START,qo.APPEND)}}_processThreeSideLoops(){var e;let t=(e=this._slLoopsByType.get(kt.THREE_SIDES))!=null?e:[];for(let o of t){let r=Oy(o);r!=null&&(this._addToTargetAreaLoop(o,r[0],Pe.END,qo.PREPEND),this._addToTargetAreaLoop(o,r[1],Pe.MIDDLE,qo.APPEND),this._addToTargetAreaLoop(o,r[2],Pe.START,qo.APPEND))}}_processFourSideLoops(){var e;let t=(e=this._slLoopsByType.get(kt.FOUR_SIDES))!=null?e:[];for(let o of t){let r=o.getSLPortsBySide();if(r!=null)for(let i of r.keys())this._addToTargetAreaLoop(o,i,Pe.MIDDLE,qo.APPEND)}}_addToTargetAreaLoop(t,e,o,r){let i=t.getSLPortsOnSide(e);this._addToTargetAreaPorts(i,e,o,r)}_addToTargetAreaPorts(t,e,o,r){let i=[];for(let a of t)a.isHidden()&&i.push(a);i.reverse();let s=this._targetAreas[Cs(e)][o];r===qo.PREPEND?s.unshift(...i):s.push(...i)}_restorePorts(t){let e=t.getLNode(),o=e.getPorts().slice(),r=0,i=e.getPorts();i.length=0;let s=Cs(u.NORTH),a=Cs(u.EAST),l=Cs(u.SOUTH),c=Cs(u.WEST),g=this._targetAreas;Jo(g[s][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.NORTH&&Sy(h),i),Jo(g[s][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.NORTH,i),Jo(g[s][Pe.END],e),Jo(g[a][Pe.START],e),Jo(g[a][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.EAST,i),Jo(g[a][Pe.END],e),Jo(g[l][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.SOUTH&&Ty(h),i),Jo(g[l][Pe.MIDDLE],e),r=Fn(o,r,h=>h.getSide()===u.SOUTH,i),Jo(g[l][Pe.END],e),Jo(g[c][Pe.START],e),r=Fn(o,r,h=>h.getSide()===u.WEST,i),Jo(g[c][Pe.MIDDLE],e),Jo(g[c][Pe.END],e)}},Pe={START:0,MIDDLE:1,END:2},qo={PREPEND:"PREPEND",APPEND:"APPEND"};function Cs(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function uy(n){let t=new Map;for(let e of n.getSLHyperLoops()){let o=e.getSelfLoopType(),r=t.get(o);r==null&&(r=[],t.set(o,r)),r.push(e)}return t}function _y(n){let t=0;for(;t<n.length&&n[t].getSLNetFlow()<=0;)t++;if(t>0&&t<n.length-1)return t;let e=0;for(;e<n.length&&n[e].getSLNetFlow()<=0;)e++;return e>0&&t<n.length-1?e:Math.floor(n.length/2)}function Ah(n){let e=[...n.getSLPortsBySide().keys()];return e.sort((o,r)=>Cs(o)-Cs(r)),e[0]===u.NORTH&&e[1]===u.WEST&&(e[0]=u.WEST,e[1]=u.NORTH),e}var py=[u.NORTH,u.EAST,u.SOUTH],Ey=[u.EAST,u.SOUTH,u.WEST],my=[u.SOUTH,u.WEST,u.NORTH],Py=[u.WEST,u.NORTH,u.EAST];function Oy(n){let t=n.getSLPortsBySide();return t==null?null:t.has(u.NORTH)?t.has(u.EAST)?t.has(u.SOUTH)?t.has(u.WEST)?null:py:Py:my:Ey}function Jo(n,t){for(let e of n)e.getLPort().setNode(t)}function Fn(n,t,e,o){for(let r=t;r<n.length;r++){let i=n[r];if(e(i))o.push(i);else return r}return n.length}function Sy(n){return dP(n).has(u.WEST)}function Ty(n){return dP(n).has(u.EAST)}function dP(n){let t=new Set,e=n.getProperty(p.PORT_DUMMY);if(e!=null){for(let o of e.getPorts())if(o.getProperty(p.ORIGIN)===n){let r=o.getConnectedEdges();for(let i of r){t.add(o.getSide());break}}}return t}var Qo=class{constructor(t){this._name=t}toString(){return this._name}};Qo.EQUALLY=new Qo("EQUALLY");Qo.NORTH=new Qo("NORTH");Qo.NORTH_SOUTH=new Qo("NORTH_SOUTH");var te=class{constructor(t,e,o){this._name=t,this.firstSide=e,this.secondSide=o}toString(){return this._name}isCornerTarget(){return this.firstSide!==this.secondSide}};te.NORTH=new te("NORTH",u.NORTH,u.NORTH);te.SOUTH=new te("SOUTH",u.SOUTH,u.SOUTH);te.EAST=new te("EAST",u.EAST,u.EAST);te.WEST=new te("WEST",u.WEST,u.WEST);te.NORTH_WEST_CORNER=new te("NORTH_WEST_CORNER",u.WEST,u.NORTH);te.NORTH_EAST_CORNER=new te("NORTH_EAST_CORNER",u.NORTH,u.EAST);te.SOUTH_WEST_CORNER=new te("SOUTH_WEST_CORNER",u.SOUTH,u.WEST);te.SOUTH_EAST_CORNER=new te("SOUTH_EAST_CORNER",u.EAST,u.SOUTH);te._values=[te.NORTH,te.SOUTH,te.EAST,te.WEST,te.NORTH_WEST_CORNER,te.NORTH_EAST_CORNER,te.SOUTH_WEST_CORNER,te.SOUTH_EAST_CORNER];var Ch=class{assignPortSides(t){let e=t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_DISTRIBUTION);switch(e!=null?e.toString():null){case"NORTH":this._assignToNorthSide(t);break;case"NORTH_SOUTH":this._assignToNorthOrSouthSide(t);break;case"EQUALLY":this._assignToAllSides(t);break;default:this._assignToNorthSide(t);break}}_assignToNorthSide(t){for(let e of t.getSLHyperLoops())for(let o of this._hiddenSelfLoopPorts(e))o.getLPort().setSide(u.NORTH)}_assignToNorthOrSouthSide(t){let e=0,o=0;for(let r of t.getSLHyperLoops()){let i=this._hiddenSelfLoopPorts(r),s=null;if(e<=o?(s=u.NORTH,e+=i.length):o<e&&(s=u.SOUTH,o+=i.length),s!=null)for(let a of i)a.getLPort().setSide(s)}}_assignToAllSides(t){let e=t.getSLHyperLoops().slice();e.sort((i,s)=>s.getSLPorts().length-i.getSLPorts().length);let o=te._values,r=0;for(let i of e){let s=o[r%o.length];this._assignToTarget(i,s),r++}}_assignToTarget(t,e){let o=t.getSLPorts();e.isCornerTarget()&&o.sort((i,s)=>i.getLPort().getNetFlow()-s.getLPort().getNetFlow());let r=Math.floor(o.length/2);for(let i=0;i<r;i++){let s=o[i];s.isHidden()&&s.getLPort().setSide(e.firstSide)}for(let i=r;i<o.length;i++){let s=o[i];s.isHidden()&&s.getLPort().setSide(e.secondSide)}}_hiddenSelfLoopPorts(t){let e=[];for(let o of t.getSLPorts())o.isHidden()&&e.push(o);return e}};p.ORIGINAL_PORT_CONSTRAINTS;var xh=class{constructor(){this._portSideAssigner=new Ch,this._portRestorer=new Lh}process(t,e){e.begin("Self-Loop ordering",1);for(let o of t.getLayers())for(let r of o.getNodes()){if(r.getType()!==y.NORMAL||!r.hasProperty(p.SELF_LOOP_HOLDER))continue;let i=r.getProperty(p.SELF_LOOP_HOLDER);this._processNode(i,e)}e.done()}_processNode(t,e){if(t.arePortsHidden()){let o=t.getLNode().getProperty(p.ORIGINAL_PORT_CONSTRAINTS);o===H.UNDEFINED||o===H.FREE||o==null?(this._portSideAssigner.assignPortSides(t),O_(t),this._portRestorer.restorePorts(t,e)):o===H.FIXED_SIDE&&(O_(t),this._portRestorer.restorePorts(t,e))}else O_(t)}};function O_(n){for(let t of n.getSLHyperLoops())t.computePortsPerSide()}var Dh=class{process(t,e){e.begin("Self-Loop post-processing",1);for(let o of t.getLayers())for(let r of o.getNodes())r.getType()===y.NORMAL&&r.hasProperty(p.SELF_LOOP_HOLDER)&&Ny(r);e.done()}};function Ny(n){let t=n.getProperty(p.SELF_LOOP_HOLDER);for(let e of t.getSLHyperLoops())for(let o of e.getSLEdges())yy(n,o);for(let e of t.getSLHyperLoops()){let o=e.getSLLabels();o!=null&&o.applyPlacement(n.getPosition())}}function yy(n,t){let e=t.getLEdge();e.setSource(t.getSLSource().getLPort()),e.setTarget(t.getSLTarget().getLPort()),e.getBendPoints().offset(n.getPosition())}var wh=class{constructor(t,e,o){this._lEdge=t,this._slHyperLoop=null,this._slSource=e,this._slTarget=o,e.getOutgoingSLEdges().push(this),o.getIncomingSLEdges().push(this)}getLEdge(){return this._lEdge}getSLHyperLoop(){return this._slHyperLoop}setSLHyperLoop(t){this._slHyperLoop=t}getSLSource(){return this._slSource}getSLTarget(){return this._slTarget}isInline(){for(let t of this._lEdge.getLabels())if(t.getProperty(_.EDGE_LABELS_INLINE))return!0;return!1}getLabelSide(){return this._slHyperLoop.getSLLabels().getSide()}};var Mh=class{constructor(t){this._lPort=t,this._incomingSLEdges=[],this._outgoingSLEdges=[],this._isHidden=!1;let e=!0;for(let o of t.getConnectedEdges())if(!o.isSelfLoop()){e=!1;break}this._hadOnlySelfLoops=e}getLPort(){return this._lPort}hadOnlySelfLoops(){return this._hadOnlySelfLoops}isHidden(){return this._isHidden}setHidden(t){this._isHidden=t}getIncomingSLEdges(){return this._incomingSLEdges}getOutgoingSLEdges(){return this._outgoingSLEdges}getSLNetFlow(){return this._incomingSLEdges.length-this._outgoingSLEdges.length}};var It=class{constructor(t){this._name=t}toString(){return this._name}};It.CENTER=new It("CENTER");It.LEFT=new It("LEFT");It.RIGHT=new It("RIGHT");It.TOP=new It("TOP");var bh=class{constructor(t){this.id=0,this._lLabels=[],this._size=new O,this._position=new O,this._side=null,this._alignment=null,this._alignmentReferenceSLPort=null;let e=t.getSLHolder().getLNode();this._layoutDirection=e.getGraph().getProperty(_.DIRECTION),this._labelLabelSpacing=z.getIndividualOrInherited(e,_.SPACING_LABEL_LABEL)}addLLabels(t){for(let e of t)this._lLabels.push(e),this._updateSize(e)}getLLabels(){return this._lLabels}_updateSize(t){let e=t.getSize();this._layoutDirection!=null&&this._layoutDirection.isHorizontal&&this._layoutDirection.isHorizontal()?(this._size.x=Math.max(this._size.x,e.x),this._size.y+=e.y,this._lLabels.length>1&&(this._size.y+=this._labelLabelSpacing)):(this._size.x+=e.x,this._size.y=Math.max(this._size.y,e.y),this._lLabels.length>1&&(this._size.x+=this._labelLabelSpacing))}applyLabelManagement(t,e){let o=this._layoutDirection!=null&&this._layoutDirection.isVertical&&this._layoutDirection.isVertical(),r=As(t,this._lLabels,e,this._labelLabelSpacing,o);this._size.x=r.x,this._size.y=r.y}applyPlacement(t){this._layoutDirection!=null&&this._layoutDirection.isHorizontal&&this._layoutDirection.isHorizontal()?this._applyPlacementForHorizontalLayout(t):this._applyPlacementForVerticalLayout(t)}_applyPlacementForHorizontalLayout(t){let e=this._position.x,o=this._position.y;for(let r of this._lLabels){let i=r.getPosition();this._alignment===It.LEFT||this._side===u.EAST?i.x=e:this._alignment===It.RIGHT||this._side===u.WEST?i.x=e+this._size.x-r.getSize().x:i.x=e+(this._size.x-r.getSize().x)/2,i.y=o,i.add(t),o+=r.getSize().y+this._labelLabelSpacing}}_applyPlacementForVerticalLayout(t){let e=this._position.x,o=this._position.y;for(let r of this._lLabels){let i=r.getPosition();i.x=e,this._side===u.NORTH?i.y=o+this._size.y-r.getSize().y:i.y=o,i.add(t),e+=r.getSize().x+this._labelLabelSpacing}}getSize(){return this._size}getPosition(){return this._position}getSide(){return this._side}setSide(t){this._side=t}getAlignment(){return this._alignment}setAlignment(t){this._alignment=t}getAlignmentReferenceSLPort(){return this._alignmentReferenceSLPort}setAlignmentReferenceSLPort(t){this._alignmentReferenceSLPort=t}};var Gh=class{constructor(t){this._slHolder=t,this._slPorts=[],this._slEdges=new Set,this._slLabels=null,this._selfLoopType=null,this._slPortsBySide=null,this._leftmostPort=null,this._rightmostPort=null,this._occupiedPortSides=new Set,this._routingSlot=new Array(4).fill(0)}computePortsPerSide(){this._slPortsBySide=new Map;let t=new Set;for(let e of this._slPorts){let o=e.getLPort().getSide();if(o===u.UNDEFINED)throw new Error("Port side must not be UNDEFINED");let r=this._slPortsBySide.get(o);r==null&&(r=[],this._slPortsBySide.set(o,r)),r.push(e),t.add(o)}this._selfLoopType=kt.fromPortSides(t)}getSLHolder(){return this._slHolder}addSelfLoopEdge(t){if(this._slEdges.has(t))return;this._slEdges.add(t),t.setSLHyperLoop(this);let e=t.getSLSource();this._slPorts.includes(e)||this._slPorts.push(e);let o=t.getSLTarget();this._slPorts.includes(o)||this._slPorts.push(o);let r=t.getLEdge().getLabels();r.length>0&&(this._slLabels==null&&(this._slLabels=new bh(this)),this._slLabels.addLLabels(r))}getSLPorts(){return this._slPorts}getSLEdges(){return this._slEdges}getSLLabels(){return this._slLabels}getSelfLoopType(){return this._selfLoopType}getSLPortsBySide(){return this._slPortsBySide}getSLPortsOnSide(t){return this._slPortsBySide!=null&&this._slPortsBySide.has(t)?this._slPortsBySide.get(t):[]}hasSLPortsOnSide(t){return this._slPortsBySide!=null&&this._slPortsBySide.has(t)}getLeftmostPort(){return this._leftmostPort}setLeftmostPort(t){this._leftmostPort=t}getRightmostPort(){return this._rightmostPort}setRightmostPort(t){this._rightmostPort=t}getOccupiedPortSides(){return this._occupiedPortSides}getRoutingSlot(t){return this._routingSlot[fP(t)]}setRoutingSlot(t,e){let o=fP(t);this._routingSlot[o]=e;let r=this._slHolder.getRoutingSlotCount();r[o]=Math.max(r[o],e+1)}},Iy=new Map([[u.NORTH,0],[u.EAST,1],[u.SOUTH,2],[u.WEST,3],[u.UNDEFINED,4]]);function fP(n){var t;return(t=Iy.get(n))!=null?t:4}var Hh=0,Ry=1,sl=class n{constructor(t){this._lNode=t,this._slHyperLoops=[],this._slPorts=new Map,this._arePortsHidden=!1,this._routingSlotCount=[0,0,0,0]}static install(t){let e=new n(t);return t.setProperty(p.SELF_LOOP_HOLDER,e),e._initialize(),e}static needsSelfLoopProcessing(t){if(t.getType()!==y.NORMAL)return!1;for(let e of t.getOutgoingEdges())if(e.isSelfLoop())return!0;return!1}_initialize(){for(let t of this._lNode.getOutgoingEdges())t.isSelfLoop()&&new wh(t,this._selfLoopPortFor(t.getSource()),this._selfLoopPortFor(t.getTarget()));for(let t of this._slPorts.values())t.getLPort().id=Hh;for(let t of this._slPorts.values())t.getLPort().id===Hh&&this._slHyperLoops.push(this._initializeHyperLoop(t))}_selfLoopPortFor(t){let e=this._slPorts.get(t);return e==null&&(e=new Mh(t),this._slPorts.set(t,e)),e}_initializeHyperLoop(t){let e=new Gh(this),o=[t];for(;o.length>0;){let r=o.shift();r.getLPort().id=Ry;for(let i of r.getOutgoingSLEdges()){e.addSelfLoopEdge(i);let s=i.getSLTarget();s.getLPort().id===Hh&&o.push(s)}for(let i of r.getIncomingSLEdges()){e.addSelfLoopEdge(i);let s=i.getSLSource();s.getLPort().id===Hh&&o.push(s)}}return e}getLNode(){return this._lNode}getSLHyperLoops(){return this._slHyperLoops}getSLPortMap(){return this._slPorts}arePortsHidden(){return this._arePortsHidden}setPortsHidden(t){this._arePortsHidden=t}getRoutingSlotCount(){return this._routingSlotCount}static ordinalOf(t){switch(t){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}};var vh=class{process(t,e){e.begin("Self-Loop pre-processing",1);for(let o of t.getLayerlessNodes())if(sl.needsSelfLoopProcessing(o)){let r=sl.install(o);Ly(r),Ay(r)}e.done()}};function Ly(n){for(let t of n.getSLHyperLoops())for(let e of t.getSLEdges()){let o=e.getLEdge();o.setSource(null),o.setTarget(null)}}function Ay(n){let t=n.getLNode(),e=t.getNestedGraph(),o=t.getProperty(_.PORT_CONSTRAINTS),r=o!=null&&o.isOrderFixed(),i=e!=null&&e.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS);if(!(r||i))for(let s of n.getSLPortMap().values()){if(!s.hadOnlySelfLoops())continue;s.getLPort().setNode(null),s.setHidden(!0),n.setPortsHidden(!0)}}var Bh=class{placeLabels(t,e,o){this._assignSideAndAlignment(t);for(let r of t.getSLHyperLoops())r.getSLLabels()!=null&&(e!=null&&this._manageLabels(r,e),this._computeCoordinates(r))}_assignSideAndAlignment(t){let e=null,o=null,r=t.getLNode().getProperty(_.EDGE_ROUTING_SELF_LOOP_ORDERING);r===Je.SEQUENCED&&(e=[],o=[]);for(let i of t.getSLHyperLoops())if(i.getSLLabels()!=null)switch(i.getSelfLoopType()){case kt.ONE_SIDE:{let a=i.getOccupiedPortSides().values().next().value;r===Je.SEQUENCED&&a===u.NORTH?e.push(i):r===Je.SEQUENCED&&a===u.SOUTH?o.push(i):this._assignOneSidedSimpleSideAndAlignment(i,a);break}case kt.TWO_SIDES_CORNER:this._assignTwoSidesCornerSideAndAlignment(i);break;case kt.TWO_SIDES_OPPOSING:case kt.THREE_SIDES:this._assignTwoSidesOpposingAndThreeSidesSideAndAlignment(i);break;case kt.FOUR_SIDES:this._assignFourSidesSideAndAlignment(i);break;default:throw new Error("Unknown self loop type: "+i.getSelfLoopType())}e!=null&&(e.length>0&&this._assignOneSidedSequencedSideAndAlignment(e,u.NORTH),o.length>0&&this._assignOneSidedSequencedSideAndAlignment(o,u.SOUTH))}_assignOneSidedSimpleSideAndAlignment(t,e){for(let o of t.getSLLabels().getLLabels())o.setProperty(_.EDGE_LABELS_INLINE,null);switch(e){case u.EAST:case u.WEST:{let o=t.getLeftmostPort();t.getRightmostPort().getLPort().getPosition().y<o.getLPort().getPosition().y&&(o=t.getRightmostPort()),this._assignSideAndAlignmentFor(t,e,It.TOP,o);break}case u.NORTH:case u.SOUTH:this._assignSideAndAlignmentFor(t,e,It.CENTER,null);break;default:throw new Error("Invalid loop side: "+e)}}_assignOneSidedSequencedSideAndAlignment(t,e){let o=0;for(let s of t[0].getSLHolder().getLNode().getPorts())s.id=o++;e===u.NORTH?t.sort((s,a)=>s.getLeftmostPort().getLPort().id-a.getLeftmostPort().getLPort().id):t.sort((s,a)=>a.getLeftmostPort().getLPort().id-s.getLeftmostPort().getLPort().id);let r=0,i=t.length-1;for(;r<i;){let s=t[r],a=t[i],l=e===u.NORTH?s.getRightmostPort():s.getLeftmostPort(),c=e===u.NORTH?a.getLeftmostPort():a.getRightmostPort();this._assignSideAndAlignmentFor(s,e,It.RIGHT,l),this._assignSideAndAlignmentFor(a,e,It.LEFT,c),r++,i--}r===i&&this._assignSideAndAlignmentFor(t[r],e,It.CENTER,null)}_assignTwoSidesCornerSideAndAlignment(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getRightmostPort().getLPort().getSide();for(let r of t.getSLLabels().getLLabels())r.setProperty(_.EDGE_LABELS_INLINE,null);if(e===u.NORTH)this._assignSideAndAlignmentFor(t,u.NORTH,It.LEFT,t.getLeftmostPort());else if(o===u.NORTH)this._assignSideAndAlignmentFor(t,u.NORTH,It.RIGHT,t.getRightmostPort());else if(e===u.SOUTH)this._assignSideAndAlignmentFor(t,u.SOUTH,It.RIGHT,t.getLeftmostPort());else if(o===u.SOUTH)this._assignSideAndAlignmentFor(t,u.SOUTH,It.LEFT,t.getRightmostPort());else throw new Error("Invalid two-sides-corner configuration")}_assignTwoSidesOpposingAndThreeSidesSideAndAlignment(t){let e=t.getOccupiedPortSides(),o=!1;for(let r of t.getSLLabels().getLLabels())if(r.getProperty(_.EDGE_LABELS_INLINE)){o=!0;break}if(!e.has(u.NORTH))this._assignSideAndAlignmentFor(t,u.SOUTH,It.CENTER,null);else if(!e.has(u.SOUTH))this._assignSideAndAlignmentFor(t,u.NORTH,It.CENTER,null);else if(!e.has(u.WEST))this._assignSideAndAlignmentFor(t,o?u.EAST:u.NORTH,o?It.CENTER:It.LEFT,o?null:t.getLeftmostPort());else if(!e.has(u.EAST))this._assignSideAndAlignmentFor(t,o?u.WEST:u.NORTH,o?It.CENTER:It.RIGHT,o?null:t.getRightmostPort());else throw new Error("All sides occupied for two-sides-opposing / three-sides loop")}_assignFourSidesSideAndAlignment(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getLeftmostPort().getLPort().getSide();for(let r of t.getSLLabels().getLLabels())r.setProperty(_.EDGE_LABELS_INLINE,null);e===u.NORTH||o===u.NORTH?this._assignSideAndAlignmentFor(t,u.SOUTH,It.CENTER,null):this._assignSideAndAlignmentFor(t,u.NORTH,It.CENTER,null)}_assignSideAndAlignmentFor(t,e,o,r){let i=t.getSLLabels();i.setSide(e),i.setAlignment(o),i.setAlignmentReferenceSLPort(r)}_manageLabels(t,e){let o=t.getSLLabels(),r=o.getAlignmentReferenceSLPort(),s=t.getSLHolder().getLNode().getSize(),a=t.getSLHolder().getLNode().getMargin(),l=0;switch(o.getAlignment()){case It.CENTER:l=a.left+s.x+a.right;break;case It.LEFT:l=s.x-r.getLPort().getPosition().x-r.getLPort().getAnchor().x+a.right;break;case It.RIGHT:l=a.left+r.getLPort().getPosition().x+r.getLPort().getAnchor().x;break;case It.TOP:l=ol;break;default:throw new Error("Invalid alignment: "+o.getAlignment())}o.applyLabelManagement(e,Math.max(l,ol))}_computeCoordinates(t){let e=t.getSLLabels(),o=e.getAlignmentReferenceSLPort(),r=e.getSize(),i=e.getPosition();switch(e.getAlignment()){case It.CENTER:i.x=(t.getSLHolder().getLNode().getSize().x-r.x)/2;break;case It.LEFT:i.x=o.getLPort().getPosition().x+o.getLPort().getAnchor().x;break;case It.RIGHT:i.x=o.getLPort().getPosition().x+o.getLPort().getAnchor().x-r.x;break;case It.TOP:i.y=o.getLPort().getPosition().y+o.getLPort().getAnchor().y;break;default:throw new Error("Invalid alignment: "+e.getAlignment())}}};var Uh=class{routeSelfLoops(t){throw new Error("AbstractSelfLoopRouter.routeSelfLoops() must be overridden")}};var ni=Object.freeze({CLOCKWISE:"CLOCKWISE",COUNTER_CLOCKWISE:"COUNTER_CLOCKWISE"}),Ui=class extends Uh{routeSelfLoops(t){let e=t.getLNode(),o=e.getSize(),r=e.getMargin(),i=z.getIndividualOrInherited(e,_.SPACING_EDGE_EDGE),s=z.getIndividualOrInherited(e,_.SPACING_EDGE_LABEL),a=z.getIndividualOrInherited(e,_.SPACING_NODE_SELF_LOOP),l=new Gr;l.set(r);let c=this._computeRoutingSlotPositions(t,i,s,a);for(let g of t.getSLHyperLoops()){for(let d of g.getSLEdges()){let f=d.getLEdge(),E=xy(d),P=this.computeOrthogonalBendPoints(d,E,c);P=this.modifyBendPoints(d,E,P);let S=f.getBendPoints();S.length=0;for(let T of P)S.push(T);for(let T of P)S_(o,l,T)}let h=g.getSLLabels();h!=null&&(Dy(g,h,c,s),wy(o,l,h))}r.set(l)}_computeRoutingSlotPositions(t,e,o,r){let i=new Array(5);for(let s of u.values())i[s.ordinal()]=new Array(t.getRoutingSlotCount()[Cy(s)]).fill(0);return uP(i,t,u.NORTH),uP(i,t,u.SOUTH),Fh(i,t,u.NORTH,e,o,r),Fh(i,t,u.EAST,e,o,r),Fh(i,t,u.SOUTH,e,o,r),Fh(i,t,u.WEST,e,o,r),i}computeOrthogonalBendPoints(t,e,o){let r=new st;return _P(t,t.getSLSource(),o,r),by(t,e,o,r),_P(t,t.getSLTarget(),o,r),r}modifyBendPoints(t,e,o){return o}};function Cy(n){switch(n){case u.NORTH:return 0;case u.EAST:return 1;case u.SOUTH:return 2;case u.WEST:return 3;default:return 4}}function xy(n){let t=n.getSLSource().getLPort(),e=t.getSide(),o=n.getSLTarget().getLPort(),r=o.getSide();return e===r?t.id<o.id?ni.CLOCKWISE:ni.COUNTER_CLOCKWISE:e.right()===r?ni.CLOCKWISE:e.left()===r?ni.COUNTER_CLOCKWISE:n.getSLHyperLoop().getOccupiedPortSides().has(e.right())?ni.CLOCKWISE:ni.COUNTER_CLOCKWISE}function Dy(n,t,e,o){let r=t.getSide(),i=e[r.ordinal()][n.getRoutingSlot(r)],s=!1;for(let l of t.getLLabels())if(l.getProperty(_.EDGE_LABELS_INLINE)){s=!0;break}let a=s?0:o;switch(r){case u.NORTH:i-=a+t.getSize().y,t.getPosition().y=i;break;case u.SOUTH:i+=a,t.getPosition().y=i;break;case u.WEST:i-=a+t.getSize().x,t.getPosition().x=i;break;case u.EAST:i+=a,t.getPosition().x=i;break;default:throw new Error("Invalid label side: "+r)}}function S_(n,t,e){t.left=Math.max(t.left,-e.x),t.right=Math.max(t.right,e.x-n.x),t.top=Math.max(t.top,-e.y),t.bottom=Math.max(t.bottom,e.y-n.y)}function wy(n,t,e){let o=new O(e.getPosition().x,e.getPosition().y);S_(n,t,o),o.add(e.getSize()),S_(n,t,o)}function uP(n,t,e){let o=n[e.ordinal()];for(let r of t.getSLHyperLoops()){let i=r.getSLLabels();if(i!=null&&i.getSide()===e){let s=r.getRoutingSlot(e);o[s]=Math.max(o[s],i.getSize().y)}}}function Fh(n,t,e,o,r,i){let s=My(t,e,i),a=e===u.NORTH||e===u.WEST?-1:1,l=n[e.ordinal()];for(let c=0;c<l.length;c++){let g=l[c];g>0&&(g+=r),l[c]=s,s+=a*(g+o)}}function My(n,t,e){let o=n.getLNode(),r=o.getMargin();switch(t){case u.NORTH:return-r.top-e;case u.EAST:return o.getSize().x+r.right+e;case u.SOUTH:return o.getSize().y+r.bottom+e;case u.WEST:return-r.left-e;default:throw new Error("Invalid port side: "+t)}}function _P(n,t,e,o){let r=n.getSLHyperLoop(),i=t.getLPort(),s=i.getSide(),a=T_(s,r.getRoutingSlot(s),e),l=new O(i.getPosition().x,i.getPosition().y);switch(l.add(i.getAnchor()),s){case u.NORTH:case u.SOUTH:a.x+=l.x;break;case u.EAST:case u.WEST:a.y+=l.y;break;default:throw new Error("Invalid port side: "+s)}o.add(a)}function by(n,t,e,o){let r=n.getSLSource().getLPort(),i=n.getSLTarget().getLPort();if(r.getSide()===i.getSide())return;let s=n.getSLHyperLoop(),a=null,l=null,c=n.isInline();c&&s.getSLLabels()!=null&&(a=n.getLabelSide(),l=s.getSLLabels().getSize());let g=r.getSide();for(;g!==i.getSide();){let h=t===ni.CLOCKWISE?g.right():g.left(),d=T_(g,s.getRoutingSlot(g),e),f=T_(h,s.getRoutingSlot(h),e);c&&a!=null&&l!=null&&(g===a?pP(d,a,l):h===a&&pP(f,a,l)),o.add(d.add(f)),g=h}}function T_(n,t,e){let o=e[n.ordinal()][t];switch(n){case u.NORTH:case u.SOUTH:return new O(0,o);case u.EAST:case u.WEST:return new O(o,0);default:throw new Error("Invalid port side: "+n)}}function pP(n,t,e){switch(t){case u.NORTH:n.y-=e.y/2;break;case u.SOUTH:n.y+=e.y/2;break;case u.WEST:n.x-=e.x/2;break;case u.EAST:n.x+=e.x/2;break;default:break}}var Gy=10,kh=.01,Wh=class extends Ui{modifyBendPoints(t,e,o){let r=t.getSLSource().getLPort(),i=new O(r.getPosition().x,r.getPosition().y);i.add(r.getAnchor()),o.splice(0,0,i);let s=t.getSLTarget().getLPort(),a=new O(s.getPosition().x,s.getPosition().y);return a.add(s.getAnchor()),o.push(a),this.cutCorners(o,Gy)}cutCorners(t,e){let o=new st,r=null,i=t[0],s=t[1];for(let a=2;a<t.length;a++){r=i,i=s,s=t[a];let l=EP(new O(r.x-i.x,r.y-i.y)),c=EP(new O(s.x-i.x,s.y-i.y)),g=e;g=Math.min(g,Math.abs(l.x+l.y)/2),g=Math.min(g,Math.abs(c.x+c.y)/2),l.x=Math.sign(l.x)*g,l.y=Math.sign(l.y)*g,c.x=Math.sign(c.x)*g,c.y=Math.sign(c.y)*g,o.push(new O(l.x+i.x,l.y+i.y)),o.push(new O(c.x+i.x,c.y+i.y))}return o}};function EP(n){return n.x>=-kh&&n.x<=kh&&(n.x=0),n.y>=-kh&&n.y<=kh&&(n.y=0),n}var Hy=(n,t)=>n.getLPort().id-t.getLPort().id,vy=1,By=3,zh=class{constructor(){this._portPenalties=null}determineLoopRoutes(t){this._assignPortIds(t.getLNode().getPorts()),this._sortHyperLoopPortLists(t);for(let e of t.getSLHyperLoops()){switch(e.getSelfLoopType()){case kt.ONE_SIDE:this._determineOneSideLoopRoutes(e);break;case kt.TWO_SIDES_CORNER:this._determineTwoSideCornerLoopRoutes(e);break;case kt.TWO_SIDES_OPPOSING:this._determineTwoSideOpposingLoopRoutes(e);break;case kt.THREE_SIDES:this._determineThreeSideLoopRoutes(e);break;case kt.FOUR_SIDES:this._determineFourSideLoopRoutes(e);break;default:throw new Error("Unknown self loop type: "+e.getSelfLoopType())}this._computeOccupiedPortSides(e)}this._portPenalties=null}_assignPortIds(t){for(let e=0;e<t.length;e++)t[e].id=e}_sortHyperLoopPortLists(t){for(let e of t.getSLHyperLoops())e.getSLPorts().sort(Hy)}_computeOccupiedPortSides(t){let e=t.getLeftmostPort().getLPort().getSide(),o=t.getRightmostPort().getLPort().getSide();for(;e!==o;)t.getOccupiedPortSides().add(e),e=e.right();t.getOccupiedPortSides().add(e)}_determineOneSideLoopRoutes(t){let e=t.getSLPorts()[0].getLPort().getSide();this._assignLeftmostRightmostPorts(t,e,e)}_determineTwoSideCornerLoopRoutes(t){let e=Ah(t);this._assignLeftmostRightmostPorts(t,e[0],e[1])}_determineTwoSideOpposingLoopRoutes(t){let e=[...t.getSLPortsBySide().keys()];if(e.length!==2)throw new Error("Expected exactly two occupied sides");let o=t.getSLHolder(),r=N_(t,e[0]),i=y_(t,e[1]),s=this._computeEdgePenalty(o,r,i),a=N_(t,e[1]),l=y_(t,e[0]),c=this._computeEdgePenalty(o,a,l);s<=c?(t.setLeftmostPort(r),t.setRightmostPort(i)):(t.setLeftmostPort(a),t.setRightmostPort(l))}_determineThreeSideLoopRoutes(t){let e=null,o=null;switch(this._computeMissingPortSide(t)){case u.NORTH:e=u.EAST,o=u.WEST;break;case u.EAST:e=u.SOUTH,o=u.NORTH;break;case u.SOUTH:e=u.WEST,o=u.EAST;break;case u.WEST:e=u.NORTH,o=u.SOUTH;break;default:throw new Error("Invalid missing port side")}this._assignLeftmostRightmostPorts(t,e,o)}_computeMissingPortSide(t){let e=t.getSLPortsBySide();for(let o of[u.NORTH,u.EAST,u.SOUTH,u.WEST])if(!e.has(o))return o;throw new Error("All sides occupied for three-sided loop")}_determineFourSideLoopRoutes(t){let e=t.getSLPorts(),o=t.getSLHolder(),r=e[e.length-1],i=e[0],s=this._computeEdgePenalty(o,r,i);for(let a=1;a<e.length;a++){let l=e[a-1],c=e[a],g=this._computeEdgePenalty(o,l,c);g>s&&(r=l,i=c,s=g)}t.setLeftmostPort(i),t.setRightmostPort(r)}_assignLeftmostRightmostPorts(t,e,o){t.setLeftmostPort(N_(t,e)),t.setRightmostPort(y_(t,o))}_computeEdgePenalty(t,e,o){this._portPenalties==null&&this._computePenalties(t);let r=t.getLNode().getPorts().length,i=e.getLPort().id,a=o.getLPort().id-1;return a<0&&(a=r-1),i<=a?this._portPenalties[a]-this._portPenalties[i]:this._portPenalties[r-1]-this._portPenalties[i]+this._portPenalties[a]}_computePenalties(t){let e=t.getLNode().getPorts();this._portPenalties=new Array(e.length).fill(0);let o=0;for(let r=0;r<e.length;r++){let i=e[r];i.getIncomingEdges().length===0&&i.getOutgoingEdges().length===0?o+=vy:o+=By,this._portPenalties[r]=o}}};function N_(n,t){let e=n.getSLPortsBySide().get(t),o=e[0];for(let r=1;r<e.length;r++)e[r].getLPort().id<o.getLPort().id&&(o=e[r]);return o}function y_(n,t){let e=n.getSLPortsBySide().get(t),o=e[0];for(let r=1;r<e.length;r++)e[r].getLPort().id>o.getLPort().id&&(o=e[r]);return o}var Yh=class{constructor(){this._hyperEdgeSegments=null,this._slLoopToSegmentMap=null,this._slLoopActivityOverPorts=null}assignRoutingSlots(t){let e=this._computeLabelCrossingMatrix(t);this._createCrossingGraph(t,e);let o=t.getLNode().getGraph().getProperty(p.RANDOM);se.breakNonCriticalCycles(this._hyperEdgeSegments,o),this._doAssignRoutingSlots(t,e),this._hyperEdgeSegments=null,this._slLoopToSegmentMap=null,this._slLoopActivityOverPorts=null}_computeLabelCrossingMatrix(t){let e=0;for(let i of t.getSLHyperLoops())i.getSLLabels()!=null&&(i.getSLLabels().id=e++);let o=[];for(let i=0;i<e;i++)o.push(new Array(e).fill(!1));let r=t.getSLHyperLoops();for(let i=0;i<r.length;i++){let s=r[i];if(s.getSLLabels()!=null)for(let a=i+1;a<r.length;a++){let l=r[a];if(l.getSLLabels()==null)continue;let c=Uy(s,l);o[s.getSLLabels().id][l.getSLLabels().id]=c,o[l.getSLLabels().id][s.getSLLabels().id]=c}}return o}_createCrossingGraph(t,e){let o=t.getSLHyperLoops();this._hyperEdgeSegments=[],this._slLoopToSegmentMap=new Map;for(let r of o){let i=new An(null);this._hyperEdgeSegments.push(i),this._slLoopToSegmentMap.set(r,i)}this._slLoopActivityOverPorts=new Map,this._computeLoopActivity(t);for(let r=0;r<o.length-1;r++){let i=t.getSLHyperLoops()[r];for(let s=r+1;s<o.length;s++)this._createDependencies(i,t.getSLHyperLoops()[s],e)}}_computeLoopActivity(t){let e=t.getSLHyperLoops(),o=t.getLNode().getPorts();for(let r of e){let i=new Array(o.length).fill(!1);this._slLoopActivityOverPorts.set(r,i);let s=r.getLeftmostPort().getLPort().id-1,a=r.getRightmostPort().getLPort().id;for(;s!==a;)s=(s+1+o.length)%o.length,i[s]=!0}}_createDependencies(t,e,o){let r=this._countCrossings(t,e),i=this._countCrossings(e,t),s=this._slLoopToSegmentMap.get(t),a=this._slLoopToSegmentMap.get(e);r<i?$e.createAndAddRegular(s,a,i-r):i<r?$e.createAndAddRegular(a,s,r-i):(r!==0||Fy(t,e,o))&&($e.createAndAddRegular(s,a,0),$e.createAndAddRegular(a,s,0))}_countCrossings(t,e){let o=this._slLoopActivityOverPorts.get(e),r=0;for(let i of t.getSLPorts())o[i.getLPort().id]&&r++;return r}_doAssignRoutingSlots(t,e){this._assignRawRoutingSlotsToSegments(),this._assignRawRoutingSlotsToLoops(t),this._shiftTowardsNode(t,e)}_assignRawRoutingSlotsToSegments(){let t=[];for(let e of this._hyperEdgeSegments)e.setInWeight(e.getIncomingSegmentDependencies().length),e.setOutWeight(e.getOutgoingSegmentDependencies().length),e.getOutWeight()===0&&(e.setRoutingSlot(0),t.push(e));for(;t.length>0;){let e=t.shift(),o=e.getRoutingSlot()+1;for(let r of e.getIncomingSegmentDependencies()){let i=r.getSource();i.setRoutingSlot(Math.max(i.getRoutingSlot(),o)),i.setOutWeight(i.getOutWeight()-1),i.getOutWeight()===0&&t.push(i)}}}_assignRawRoutingSlotsToLoops(t){for(let e of t.getSLHyperLoops()){let o=this._slLoopToSegmentMap.get(e).getRoutingSlot();for(let r of e.getOccupiedPortSides())e.setRoutingSlot(r,o)}}_shiftTowardsNode(t,e){let o=new Array(t.getLNode().getPorts().length).fill(0);this._shiftTowardsNodeOnSide(t,u.NORTH,o,e),this._shiftTowardsNodeOnSide(t,u.EAST,o,e),this._shiftTowardsNodeOnSide(t,u.SOUTH,o,e),this._shiftTowardsNodeOnSide(t,u.WEST,o,e)}_shiftTowardsNodeOnSide(t,e,o,r){let i=t.getSLHyperLoops().filter(c=>c.getOccupiedPortSides().has(e));i.sort((c,g)=>c.getRoutingSlot(e)-g.getRoutingSlot(e));let s=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(let c of t.getLNode().getPorts())c.getSide()===e&&(c.id<s&&(s=c.id),c.id>a&&(a=c.id));if(s===Number.MAX_SAFE_INTEGER){for(let c=0;c<i.length;c++)i[c].setRoutingSlot(e,c);return}let l=new Array(r.length).fill(-1);for(let c of i){let g=this._slLoopActivityOverPorts.get(c),h=0;for(let d=s;d<=a;d++)g[d]&&(h=Math.max(h,o[d]));if(c.getSLLabels()!=null){let d=c.getSLLabels().id,f=new Set;for(let E=0;E<r.length;E++)r[d][E]&&f.add(l[E]);for(;f.has(h);)h++}c.setRoutingSlot(e,h);for(let d=s;d<=a;d++)g[d]&&(o[d]=h+1);c.getSLLabels()!=null&&(l[c.getSLLabels().id]=h)}}};function Uy(n,t){let e=n.getSLLabels(),o=t.getSLLabels();if(e==null||o==null||e.getSide()!==o.getSide()||e.getSide()===u.EAST||e.getSide()===u.WEST)return!1;let r=e.getPosition().x,i=r+e.getSize().x,s=o.getPosition().x,a=s+o.getSize().x;return r<=a&&i>=s}function Fy(n,t,e){return n.getSLLabels()==null||t.getSLLabels()==null?!1:e[n.getSLLabels().id][t.getSLLabels().id]}var ky=3,mP=.5,Vh=class extends Ui{modifyBendPoints(t,e,o){let r=z.getIndividualOrInherited(t.getSLHyperLoop().getSLHolder().getLNode(),_.SPACING_EDGE_LABEL),i=new st;return i.push(PP(t.getSLSource())),this._addSplineControlPoints(t,e,o,i,r),i.push(PP(t.getSLTarget())),new Rs(!0,ky,i).getBezierCP()}_addSplineControlPoints(t,e,o,r,i){let s=t.getSLSource().getLPort().getSide(),a=o[0];for(let l=1;l<o.length;l++){let c=o[l];r.push(a);let g=new O((a.x+c.x)*mP,(a.y+c.y)*mP),h=Wy(s);h.scale(i),g.add(h),r.push(g),a=c,s=e===ni.CLOCKWISE?s.right():s.left()}r.push(o[o.length-1])}};function PP(n){let t=n.getLPort(),e=new O(t.getPosition().x,t.getPosition().y);return e.add(t.getAnchor()),e}function Wy(n){switch(n.toString()){case"NORTH":return new O(0,-1);case"EAST":return new O(1,0);case"SOUTH":return new O(0,1);case"WEST":return new O(-1,0);default:return new O}}var Xh=class{constructor(){this._routingDirector=new zh,this._labelPlacer=new Bh,this._routingSlotAssigner=new Yh}process(t,e){e.begin("Self-Loop routing",1);let o=this._routerForGraph(t),r=t.getProperty(Hn);for(let i of t.getLayers())for(let s of i.getNodes()){if(s.getType()!==y.NORMAL||!s.hasProperty(p.SELF_LOOP_HOLDER))continue;let a=s.getProperty(p.SELF_LOOP_HOLDER);this._processNode(a,r,o,e)}e.done()}_routerForGraph(t){switch(t.getProperty(_.EDGE_ROUTING)){case At.POLYLINE:return new Wh;case At.SPLINES:return new Vh;default:return new Ui}}_processNode(t,e,o,r){this._routingDirector.determineLoopRoutes(t),this._labelPlacer.placeLabels(t,e,r),this._routingSlotAssigner.assignRoutingSlots(t),o.routeSelfLoops(t)}};var Kh=class{process(t,e){e.begin("Semi-Interactive Crossing Minimization Processor",1);let o=!1;for(let r of t){let i=[];for(let s of r.getNodes())s.getType()===y.NORMAL&&s.hasProperty(_.POSITION)&&i.push(s);if(i.sort((s,a)=>{let l=s.getProperty(_.POSITION).y,c=a.getProperty(_.POSITION).y;return l-c}),i.length>0){o=!0;for(let s=0;s<i.length-1;s++)i[s].getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS).push(i[s+1])}}o&&t.setProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES,!0),e.done()}};var Ao=class{constructor(t,e){this.name=t,this._returnValue=e,Object.freeze(this)}toString(){return this.name}returnValue(){return this._returnValue}};Ao.DUMMY_NODE_OVER=new Ao("DUMMY_NODE_OVER",Number.MAX_SAFE_INTEGER);Ao.DUMMY_NODE_UNDER=new Ao("DUMMY_NODE_UNDER",Number.MIN_SAFE_INTEGER);Ao.EQUAL=new Ao("EQUAL",0);var Wt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Wt.ONLY_WITHIN_GROUP=new Wt("ONLY_WITHIN_GROUP");Wt.MODEL_ORDER=new Wt("MODEL_ORDER");Wt.ENFORCED=new Wt("ENFORCED");var Qe=class{static calculateModelOrderOrGroupModelOrder(t,e,o,r){let i=o.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,s=o.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_ENFORCED_GROUP_ORDERS);if(t.hasProperty(p.MODEL_ORDER))if(i){let a=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID),l=e.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID);if(s.indexOf(a)>=0&&s.indexOf(l)>=0)return r*a+t.getProperty(p.MODEL_ORDER)}else return t.getProperty(p.MODEL_ORDER);else return-1;return t.getProperty(p.MODEL_ORDER)}};var Zh=class{constructor(t,e,o,r,i){this._graph=t,this._strategy=o,this._targetNodeModelOrder=r,this._portModelOrder=i,e!=null&&typeof e.getNodes=="function"?this._previousLayer=[...e.getNodes()]:this._previousLayer=e||[],this._biggerThan=new Map,this._smallerThan=new Map}compare(t,e){if(!this._biggerThan.has(t))this._biggerThan.set(t,new Set);else if(this._biggerThan.get(t).has(e))return 1;if(!this._biggerThan.has(e))this._biggerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return-1;if(!this._smallerThan.has(t))this._smallerThan.set(t,new Set);else if(this._smallerThan.get(t).has(e))return-1;if(!this._smallerThan.has(e))this._smallerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return 1;if(t.getSide()!==e.getSide()){let r=OP(t.getSide())-OP(e.getSide());return r>0?this._updateAssoc(t,e,1):this._updateAssoc(e,t,1),r}let o=1;if(t.getIncomingEdges().length>0&&e.getIncomingEdges().length>0){(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.NORTH&&e.getSide()===u.NORTH||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o);let r=t.getIncomingEdges()[0].getSource(),i=e.getIncomingEdges()[0].getSource(),s=r.getNode(),a=i.getNode();if(s===a)for(let c of s.getPorts()){if(c===r)return this._updateAssoc(e,t,o),-o;if(c===i)return this._updateAssoc(t,e,o),o}if(r.getNode().getType()===y.LONG_EDGE&&i.getNode().getType()===y.LONG_EDGE&&s.getLayer().id===a.getLayer().id&&s.getLayer().id===t.getNode().getLayer().id){let c=s.getLayer().getNodes(),g=this._checkReferenceLayer(c,s,a,t,e);if(g!==0)return t.getSide()===u.EAST&&e.getSide()===u.EAST&&(o=-o),g>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}let l=this._checkReferenceLayer(this._previousLayer,s,a,t,e);if(l!==0)return l>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o);if(this._portModelOrder){let c=this.checkPortModelOrder(t,e);if(c!==0)return c>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}}if(t.getOutgoingEdges().length>0&&e.getOutgoingEdges().length>0){(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o);let r=t.getProperty(p.LONG_EDGE_TARGET_NODE),i=e.getProperty(p.LONG_EDGE_TARGET_NODE);if(this._strategy===$t.PREFER_NODES&&r!=null&&i!=null&&r.hasProperty(p.MODEL_ORDER)&&i.hasProperty(p.MODEL_ORDER)){let l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES),c=Qe.calculateModelOrderOrGroupModelOrder(r,i,this._graph,l),g=Qe.calculateModelOrderOrGroupModelOrder(i,r,this._graph,l);return c>g?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}if(this._portModelOrder){let l=this.checkPortModelOrder(t,e);if(l!==0)return l>0?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}let s=0,a=0;return t.getOutgoingEdges()[0].hasProperty(p.MODEL_ORDER)&&(s=Qe.calculateModelOrderOrGroupModelOrder(t.getOutgoingEdges()[0],e.getOutgoingEdges()[0],this._graph,t.getOutgoingEdges().length+t.getIncomingEdges().length)),e.getOutgoingEdges()[0].hasProperty(p.MODEL_ORDER)&&(a=Qe.calculateModelOrderOrGroupModelOrder(e.getOutgoingEdges()[0],t.getOutgoingEdges()[0],this._graph,e.getOutgoingEdges().length+e.getIncomingEdges().length)),r!=null&&r===i?s>a?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o):(this._targetNodeModelOrder!=null&&(this._targetNodeModelOrder.has(r)&&(s=this._targetNodeModelOrder.get(r)),this._targetNodeModelOrder.has(i)&&(a=this._targetNodeModelOrder.get(i))),s>a?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o))}if(t.getIncomingEdges().length>0&&e.getOutgoingEdges().length>0)return this._updateAssoc(t,e,o),1;if(t.getOutgoingEdges().length>0&&e.getIncomingEdges().length>0)return this._updateAssoc(e,t,o),-1;if(t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER)){let r=t.getNode().getPorts().length,i=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,r),s=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,r);return(t.getSide()===u.WEST&&e.getSide()===u.WEST||t.getSide()===u.SOUTH&&e.getSide()===u.SOUTH)&&(o=-o),i>s?(this._updateAssoc(t,e,o),o):(this._updateAssoc(e,t,o),-o)}return this._updateAssoc(e,t,o),-o}checkPortModelOrder(t,e){let o=t.getNode().getPorts().length;if(t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER)){let r=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,o),i=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,o);return r-i}return 0}_updateAssoc(t,e,o){let r=t,i=e;o<0&&(r=e,i=t);let s=this._biggerThan.get(r),a=this._biggerThan.get(i),l=this._smallerThan.get(r),c=this._smallerThan.get(i);s.add(i),c.add(r);for(let g of a){s.add(g);let h=this._smallerThan.get(g);if(h){h.add(r);for(let d of l)h.add(d)}}for(let g of l){c.add(g);let h=this._biggerThan.get(g);if(h){h.add(i);for(let d of a)h.add(d)}}}_checkReferenceLayer(t,e,o,r,i){for(let s of t){if(s===e)return-1;if(s===o)return 1}return 0}clearTransitiveOrdering(){this._biggerThan=new Map,this._smallerThan=new Map}},zy=new Map([[u.UNDEFINED,0],[u.NORTH,1],[u.EAST,2],[u.SOUTH,3],[u.WEST,4]]);function OP(n){return zy.get(n)||0}var nl=class{constructor(t,e,o,r,i,s){this._graph=t,this._orderingStrategy=o,this._groupOrderStrategy=i,this._longEdgeNodeOrder=r||Ao.EQUAL,this._beforePorts=s,e!=null&&typeof e.getNodes=="function"?this._previousLayer=[...e.getNodes()]:this._previousLayer=e||[],this._biggerThan=new Map,this._smallerThan=new Map}compare(t,e){if(!this._biggerThan.has(t))this._biggerThan.set(t,new Set);else if(this._biggerThan.get(t).has(e))return 1;if(!this._biggerThan.has(e))this._biggerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return-1;if(!this._smallerThan.has(t))this._smallerThan.set(t,new Set);else if(this._smallerThan.get(t).has(e))return-1;if(!this._smallerThan.has(e))this._smallerThan.set(e,new Set);else if(this._biggerThan.get(e).has(t))return 1;let o=t.hasProperty(p.MODEL_ORDER)&&e.hasProperty(p.MODEL_ORDER);if(this._orderingStrategy===$t.PREFER_EDGES||!o){let i=this._findPreviousLayerSourcePort(t),s=this._findPreviousLayerSourcePort(e);if(i!=null&&s!=null){let a=i.getNode(),l=s.getNode();if(a!=null&&a===l){for(let h of a.getPorts()){if(h===i)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(h===s)return this._updateBiggerAndSmallerAssociations(t,e),1}let c=this._getModelOrderFromConnectedEdges(t),g=this._getModelOrderFromConnectedEdges(e);return c>g?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}for(let c of this._previousLayer){if(c===a)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(c===l)return this._updateBiggerAndSmallerAssociations(t,e),1}}if(i!=null&&s==null||i==null&&s!=null){let a=this._handleHelperDummyNodes(t,e);if(a!==0)return a>0?this._updateBiggerAndSmallerAssociations(t,e):this._updateBiggerAndSmallerAssociations(e,t),a;if(!o){let l=this._getModelOrderFromConnectedEdges(t),c=this._getModelOrderFromConnectedEdges(e);return l>c?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}}if(i==null&&s==null){let a=this._handleHelperDummyNodes(t,e);if(a!==0)return a>0?this._updateBiggerAndSmallerAssociations(t,e):this._updateBiggerAndSmallerAssociations(e,t),a}}if(o){let i=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES),s=Qe.calculateModelOrderOrGroupModelOrder(t,e,this._graph,i),a=Qe.calculateModelOrderOrGroupModelOrder(e,t,this._graph,i);return s>a?(this._updateBiggerAndSmallerAssociations(t,e),1):(this._updateBiggerAndSmallerAssociations(e,t),-1)}return this._updateBiggerAndSmallerAssociations(e,t),-1}_findPreviousLayerSourcePort(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0){let o=e.getIncomingEdges()[0].getSource().getNode(),r=o.getLayer&&o.getLayer(),i=t.getLayer&&t.getLayer();if(r!=null&&i!=null&&r.id===i.id-1)return e.getIncomingEdges()[0].getSource()}return null}_getModelOrderFromConnectedEdges(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0)return e.getIncomingEdges()[0].getProperty(p.MODEL_ORDER);return this._longEdgeNodeOrder.returnValue()}_updateBiggerAndSmallerAssociations(t,e){let o=this._biggerThan.get(t),r=this._biggerThan.get(e),i=this._smallerThan.get(t),s=this._smallerThan.get(e);o.add(e),s.add(t);for(let a of r){o.add(a);let l=this._smallerThan.get(a);if(l){l.add(t);for(let c of i)l.add(c)}}for(let a of i){s.add(a);let l=this._biggerThan.get(a);if(l){l.add(e);for(let c of r)l.add(c)}}}_handleHelperDummyNodes(t,e){if(t.getType()===y.LONG_EDGE&&e.getType()===y.NORMAL){let o=this._getFirstIncomingSourcePortOfNode(t),r=this._getFirstOutgoingTargetPortOfNode(t);if(o==null||r==null)return 0;let i=t.getLayer().id;return o.getNode().getLayer().id!==i&&r.getNode().getLayer().id!==i?0:o.getNode()===e?(this._updateBiggerAndSmallerAssociations(t,e),1):r.getNode()===e?(this._updateBiggerAndSmallerAssociations(t,e),1):this.compare(o.getNode(),e)}if(t.getType()===y.NORMAL&&e.getType()===y.LONG_EDGE){let o=this._getFirstIncomingSourcePortOfNode(e),r=this._getFirstOutgoingTargetPortOfNode(e);if(o==null||r==null)return 0;let i=t.getLayer().id;return o.getNode().getLayer().id!==i&&r.getNode().getLayer().id!==i?0:o.getNode()===t?(this._updateBiggerAndSmallerAssociations(e,t),-1):r.getNode()===t?(this._updateBiggerAndSmallerAssociations(e,t),-1):this.compare(t,o.getNode())}if(t.getType()===y.LONG_EDGE&&e.getType()===y.LONG_EDGE){let o=this._getFirstIncomingSourcePortOfNode(t),r=this._getFirstOutgoingTargetPortOfNode(t),i=this._getFirstIncomingSourcePortOfNode(e),s=this._getFirstOutgoingTargetPortOfNode(e);if(o==null||r==null||i==null||s==null)return 0;let a=t.getLayer().id,l=e.getLayer().id,c=t,g=e;if(o.getNode().getLayer().id===a?c=o.getNode():r.getNode().getLayer().id===a&&(c=r.getNode()),i.getNode().getLayer().id===l?g=i.getNode():s.getNode().getLayer().id===l&&(g=s.getNode()),c===g)for(let h of c.getPorts()){if(h===o)return this._updateBiggerAndSmallerAssociations(e,t),-1;if(h===i)return this._updateBiggerAndSmallerAssociations(t,e),1}return this.compare(c,g)}return 0}_getFirstIncomingSourcePortOfNode(t){for(let e of t.getPorts())if(e.getIncomingEdges().length>0)return e.getIncomingEdges()[0].getSource();return null}_getFirstOutgoingTargetPortOfNode(t){for(let e of t.getPorts())if(e.getOutgoingEdges().length>0)return e.getOutgoingEdges()[0].getTarget();return null}clearTransitiveOrdering(){this._biggerThan=new Map,this._smallerThan=new Map}};var jh=class n{process(t,e){e&&e.begin&&e.begin("Sort By Input Model "+t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),1);let o=0;for(let r of t.getLayers()){r.id=o;let i=o===0?0:o-1,s=t.getLayers()[i],a=new nl(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY),!0);n.insertionSort(r.getNodes(),a);for(let l of r.getNodes()){let c=l.getProperty(_.PORT_CONSTRAINTS);c!==H.FIXED_ORDER&&c!==H.FIXED_POS&&l.getPorts().sort((g,h)=>new Zh(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),n.longEdgeTargetNodePreprocessing(l),t.getProperty(_.CONSIDER_MODEL_ORDER_PORT_MODEL_ORDER)).compare(g,h))}a=new nl(t,s,t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY),t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY),!1),n.insertionSort(r.getNodes(),a),o++}e&&e.done&&e.done()}static longEdgeTargetNodePreprocessing(t){let e=new Map;if(t.hasProperty(p.TARGET_NODE_MODEL_ORDER))return t.getProperty(p.TARGET_NODE_MODEL_ORDER);for(let o of t.getPorts()){if(o.getOutgoingEdges().length===0)continue;let r=n.getTargetNode(o);if(o.setProperty(p.LONG_EDGE_TARGET_NODE,r),r!=null){let i=o.getOutgoingEdges()[0];if(!i.getProperty(p.REVERSED)){let s=e.has(r)?e.get(r):Number.MAX_SAFE_INTEGER;e.set(r,Math.min(i.getProperty(p.MODEL_ORDER),s))}}}return t.setProperty(p.TARGET_NODE_MODEL_ORDER,e),e}static getTargetNode(t){let e=null,o=t.getOutgoingEdges()[0];do{if(e=o.getTarget().getNode(),e.hasProperty(p.LONG_EDGE_TARGET))return e.getProperty(p.LONG_EDGE_TARGET).getNode();if(e.getType()!==y.NORMAL){let i=e.getOutgoingEdges()[Symbol.iterator]().next();if(!i.done)o=i.value;else return null}}while(e!=null&&e.getType()!==y.NORMAL);return e}static insertionSort(t,e){for(let o=1;o<t.length;o++){let r=t[o],i=o;for(;i>0&&e.compare(t[i-1],r)>0;)t[i]=t[i-1],i--;t[i]=r}e.clearTransitiveOrdering()}};var $h=class{process(t,e){e.begin("Alternating layer unzipping",1);let o=1,r=[],i=t.getLayers();for(let s=0;s<i.length;s++){let a=i[s],l=Yy(a),c=Vy(a);if(Xy(a)){let h=0,d=0;for(let f of a)h=Math.max(h,f.getSize().x),d+=f.getSize().y;if(d/=a.getNodes().length,h+=Math.max(2*t.getProperty(_.SPACING_EDGE_NODE_BETWEEN_LAYERS),Math.max(a.getNodes().length*t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS))),d+=Math.max(t.getProperty(_.SPACING_NODE_NODE),t.getProperty(_.SPACING_EDGE_NODE)),h/d>=a.getNodes().length/4)continue}if(a.getNodes().length>l){let h=[a];for(let f=0;f<l-1;f++){let E=new Et(t);r.push([E,s+f+o]),h.push(E)}o+=l-1;let d=h[0].getNodes().length;for(let f=0,E=0,P=0;f<d;f++,E++,P++){let S=h[0].getNodes()[E];S.getType()!==y.NONSHIFTING_PLACEHOLDER?E+=Ky(t,h,P%l,E):(f--,P--),c&&S.getType()===y.LONG_EDGE&&(P=-1)}}}for(let[s,a]of r)i.splice(a,0,s);for(let s of i){let a=s.getNodes();for(let l=a.length-1;l>=0;l--){let c=a[l].getType();(c===y.PLACEHOLDER||c===y.NONSHIFTING_PLACEHOLDER)&&a.splice(l,1)}}e.done()}};function Yy(n){let t=Number.MAX_SAFE_INTEGER,e=!0;for(let o of n)if(o.hasProperty(_.LAYER_UNZIPPING_LAYER_SPLIT)){e=!1;let r=o.getProperty(_.LAYER_UNZIPPING_LAYER_SPLIT);r<t&&(t=r)}return e?_.LAYER_UNZIPPING_LAYER_SPLIT.getDefault():t}function Vy(n){for(let t of n)if(t.hasProperty(_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES)&&!t.getProperty(_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES))return!1;return!0}function Xy(n){for(let t of n)if(t.hasProperty(_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH)&&t.getProperty(_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH))return!0;return!1}function Ky(n,t,e,o){let r=t[0].getNodes()[o];e>0&&r.setLayer(t[e]);let i=0,s=!0,a=[...r.getIncomingEdges()].reverse();for(let c of a){s=!1;let g=c;for(let h=0;h<e;h++){let d=SP(n,g);o+i>t[h].getNodes().length?d.setLayer(t[h]):d.setLayer(o+i,t[h]),g=ri.splitEdge(g,d)}e>0&&i++}if(s){for(let c=0;c<e;c++){let g=new ft(n);g.setType(y.PLACEHOLDER),o+i>t[c].getNodes().length?g.setLayer(t[c]):g.setLayer(o+i,t[c])}e>0&&i++}let l=!1;for(let c of r.getOutgoingEdges()){let g=c;for(let h=e+1;h<t.length;h++){let d=SP(n,g);d.setLayer(t[h]),g=ri.splitEdge(g,d)}for(let h=0;h<=e;h++)if(l){let d=new ft(n);d.setType(y.NONSHIFTING_PLACEHOLDER),o+1>t[h].getNodes().length?d.setLayer(t[h]):d.setLayer(o+1,t[h])}l&&i++,l=!0}return i>0?i-1:0}function SP(n,t){let e=new ft(n);return e.setType(y.LONG_EDGE),e.setProperty(p.ORIGIN,t),e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),e}var ro=class{constructor(t){this._name=t}toString(){return this._name}};ro.ARD=new ro("ARD");ro.MSD=new ro("MSD");ro.MANUAL=new ro("MANUAL");var io=class{constructor(t){this._name=t}toString(){return this._name}};io.NO=new io("NO");io.GREEDY=new io("GREEDY");io.LOOK_BACK=new io("LOOK_BACK");var kn=class{constructor(t){this.graph=t;let e=t.getProperty(_.DIRECTION),o=t.getProperty(_.ASPECT_RATIO),r=t.getProperty(_.WRAPPING_CORRECTION_FACTOR);e===R.LEFT||e===R.RIGHT||e===R.UNDEFINED||e==null?this.dar=o*r:this.dar=1/(o*r),this._spacing=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),this._inLayerSpacing=t.getProperty(_.SPACING_NODE_NODE),this.longestPath=t.getLayers().length,this._maxWidth=null,this._maxHeight=null,this._sumWidth=null,this._widths=null,this._heights=null,this._cutsAllowed=null}getApproximateLayerWidth(t){return this._determineLayerWidth(t)}getApproximateLayeringWidth(){return this.getSumWidth()}getApproximateChunkBasedLayeringWidth(t){if(t.length===0)return this.getApproximateLayeringWidth();let e=0,o=0;for(let r of t)e=Math.max(e,this._determineChunkWidth(o,r)),o=r;return e=Math.max(e,this._determineChunkWidth(o,this.graph.getLayers().length)),e}getApproximateLayerHeight(t){return this._determineLayerHeight(t)}getApproximateLayeringHeight(){return this.getMaxHeight()}getApproximateChunkBasedLayeringHeight(t){if(t.length===0)return 0;let e=0,o=0;for(let r of t)e+=this._determineChunkHeight(o,r),o=r;return e+=this._determineChunkHeight(o,this.graph.getLayers().length),e}getMaxWidth(){return this._maxWidth==null&&(this._maxWidth=this._determineWidth((t,e)=>Math.max(t,e))),this._maxWidth}getSumWidth(){return this._sumWidth==null&&(this._sumWidth=this._determineWidth((t,e)=>t+e)),this._sumWidth}getWidths(){return this._widths==null&&this._initWidthsAndHeights(),this._widths}_initWidthsAndHeights(){let t=this.longestPath;this._widths=new Array(t),this._heights=new Array(t);for(let e=0;e<t;e++){let o=this.graph.getLayers()[e];this._widths[e]=this._determineLayerWidth(o),this._heights[e]=this._determineLayerHeight(o)}}_determineWidth(t){let e=this.graph.getLayers();if(e.length===0)return 0;let o=this._determineLayerWidth(e[0]);for(let r=1;r<e.length;r++)o=t(o,this._determineLayerWidth(e[r]));return o}_determineLayerWidth(t){let e=0;for(let o of t.getNodes()){let r=o.getSize().x+o.getMargin().right+o.getMargin().left+this._spacing;r>e&&(e=r)}return e}_determineChunkWidth(t,e){let o=0,r=this.graph.getLayers();for(let i=t;i<e;i++)o+=this._determineLayerWidth(r[i]);return o}getMaxHeight(){return this._maxHeight==null&&(this._maxHeight=this._determineHeight((t,e)=>Math.max(t,e))),this._maxHeight}getHeights(){return this._heights==null&&this._initWidthsAndHeights(),this._heights}_determineHeight(t){let e=this.graph.getLayers();if(e.length===0)return 0;let o=this._determineLayerHeight(e[0]);for(let r=1;r<e.length;r++)o=t(o,this._determineLayerHeight(e[r]));return o}_determineLayerHeight(t){let e=0;for(let o of t.getNodes()){e+=o.getSize().y+o.getMargin().bottom+o.getMargin().top+this._inLayerSpacing;for(let r of o.getIncomingEdges())if(r.getSource().getNode().getType()===y.NORTH_SOUTH_PORT){let s=r.getSource().getNode().getProperty(p.ORIGIN);s!=null&&(e+=s.getSize().y+s.getMargin().bottom+s.getMargin().top)}}return e}_determineChunkHeight(t,e){let o=this.graph.getLayers(),r=0;for(let i=t;i<e;i++){let s=this._determineLayerHeight(o[i]);s>r&&(r=s)}return r}isCutAllowed(t){return this._cutsAllowed==null&&this._initCutAllowed(),this._cutsAllowed[t]}getCutsAllowed(){return this._cutsAllowed==null&&this._initCutAllowed(),this._cutsAllowed}_initCutAllowed(){if(this._cutsAllowed=new Array(this.graph.getLayers().length).fill(!0),this._cutsAllowed[0]=!1,this.graph.hasProperty(_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES)){let t=this.graph.getProperty(_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES);for(let e of t)e>0&&e<this._cutsAllowed.length&&(this._cutsAllowed[e]=!1)}else{let t=this.graph.getLayers();for(let e=1;e<t.length;e++)this._cutsAllowed[e]=Zy(t[e])}}};function Zy(n){let t=null,e=null;for(let o of n.getNodes())for(let r of o.getIncomingEdges()){if(t!=null&&t!==o)return!1;t=o;let i=r.getSource().getNode();if(e!=null&&e!==i)return!1;e=i}return!0}var Wn=class{getCutIndexes(t,e){let o=t.getProperty(_.WRAPPING_CUTTING_CUTS);return o!=null?o:[]}guaranteeValid(){return!1}};var Fi=class n{getCutIndexes(t,e){let o=n.getChunkCount(e),r=[],i=e.longestPath/o;for(let s=1;s<o;s++)r.push(Math.round(s*i));return r}static getChunkCount(t){let e=Math.sqrt(t.getSumWidth()/(t.dar*t.getMaxHeight())),o=Math.round(e);return o=Math.min(o,t.longestPath),o}guaranteeValid(){return!1}};var zn=class{guaranteeValid(){return!1}getCutIndexes(t,e){let o=e.getWidths(),r=e.getHeights(),i=new Array(o.length);i[0]=o[0];let s=o[0];for(let h=1;h<o.length;h++)i[h]=i[h-1]+o[h],s+=o[h];let a=Fi.getChunkCount(e)-1,l=t.getProperty(_.WRAPPING_CUTTING_MSD_FREEDOM),c=Number.NEGATIVE_INFINITY,g=[];for(let h=Math.max(0,a-l);h<=Math.min(e.longestPath-1,a+l);h++){let d=s/(h+1),f=0,E=1,P=[],S=Number.NEGATIVE_INFINITY,T=0,N=0,I=r[0];if(h===0)S=s,N=e.getMaxHeight();else{for(;E<e.longestPath;)i[E-1]-f>=d&&(P.push(E),S=Math.max(S,i[E-1]-T),N+=I,f+=i[E-1]-f,T=i[E-1],I=r[E]),I=Math.max(I,r[E]),E++;N+=I}let C=Math.min(1/S,1/e.dar/N);C>c&&(c=C,g=P)}return g}};var Yn=class{static insertDummies(t,e,o){let r=t.getProperty(_.SPACING_EDGE_NODE),i=t.getProperty(_.WRAPPING_ADDITIONAL_EDGE_SPACING),s=new bo;s.setProperty(_.SPACING_EDGE_NODE,r+i);let a=e,l=a.getTarget(),c=a.getSource().getNode(),g=a.getTarget().getNode(),h=c.getLayer().getIndex(),d=g.getLayer().getIndex(),f=[];for(let E=h;E<=d;E++){let P=new ft(t);P.setType(y.LONG_EDGE),P.setProperty(p.ORIGIN,a),P.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),P.setProperty(_.SPACING_INDIVIDUAL,s);let S=t.getLayers()[E];E===h?P.setLayer(S.getNodes().length-o,S):P.setLayer(S);let T=a.getProperty(_.EDGE_THICKNESS);T<0&&(T=0,a.setProperty(_.EDGE_THICKNESS,T)),P.getSize().y=T;let N=Math.floor(T/2),I=new rt;I.setSide(u.WEST),I.setNode(P),I.getPosition().y=N;let C=new rt;C.setSide(u.EAST),C.setNode(P),C.getPosition().y=N,a.setTarget(I);let x=new _e;x.copyProperties(a),x.setProperty(_.JUNCTION_POINTS,null),x.setSource(C),x.setTarget(l),jy(P,a,x),f.push(x),a=x}return f}};function jy(n,t,e){let o=t.getSource().getNode();o.getType()===y.LONG_EDGE?(n.setProperty(p.LONG_EDGE_SOURCE,o.getProperty(p.LONG_EDGE_SOURCE)),n.setProperty(p.LONG_EDGE_TARGET,o.getProperty(p.LONG_EDGE_TARGET))):(n.setProperty(p.LONG_EDGE_SOURCE,t.getSource()),n.setProperty(p.LONG_EDGE_TARGET,e.getTarget()))}var xs=class n{process(t,e){if(e.begin("Path-Like Graph Wrapping",1),t.getLayers().length===0){e.done();return}let o=new kn(t),i=o.getMaxWidth()*o.longestPath/o.getMaxWidth();if(o.dar>i){e.done();return}let s;switch(t.getProperty(_.WRAPPING_CUTTING_STRATEGY)){case ro.MANUAL:s=new Wn;break;case ro.ARD:s=new Fi;break;default:s=new zn}let a=s.getCutIndexes(t,o);if(!s.guaranteeValid())switch(t.getProperty(_.WRAPPING_VALIDIFY_STRATEGY)){case io.LOOK_BACK:a=n.validifyIndexesLookingBack(o,a);break;case io.GREEDY:a=n.validifyIndexesGreedily(o,a);break;default:}qy(t,o,a),e.done()}static validifyIndexesGreedily(t,e){let o=[],r=0;for(let i of e){let s=i+r;for(;s<t.longestPath&&!t.isCutAllowed(s);)s++,r++;if(s>=t.longestPath)break;o.push(s)}return o}static validifyIndexesLookingBack(t,e){if(e.length===0)return[];let o=[];o.push(Number.NEGATIVE_INFINITY);for(let r=1;r<t.longestPath;r++)t.isCutAllowed(r)&&o.push(r);return o.length===1?[]:(o.push(Number.POSITIVE_INFINITY),$y(e,o))}};function $y(n,t){let e=[],o=0,r=0,i=0;for(;o<t.length-1&&r<n.length;){let s=n[r]+i;for(;t[o+1]<s;)o++;let a=0,l=s-t[o],c=t[o+1]-s;l>c&&a++;let g=t[o+a];for(e.push(g),i+=g-s,r++;r<n.length&&n[r]+i<=g;)r++;o+=1+a}return e}function qy(n,t,e){if(e.length===0)return;let o=0,r=0,i=0,s=e[i++];for(;o<t.longestPath;){if(o===s&&(r=0,i<e.length?s=e[i++]:s=t.longestPath+1),o!==r){let l=n.getLayers()[o],c=n.getLayers()[r],g=l.getNodes().slice();for(let h of g)if(h.setLayer(c.getNodes().length,c),r===0){let d=[...h.getIncomingEdges()];for(let f of d)f.reverse(n,!0),n.setProperty(p.CYCLIC,!0),Yn.insertDummies(n,f,1)}}r++,o++}let a=n.getLayers();for(let l=a.length-1;l>=0;l--)a[l].getNodes().length===0&&a.splice(l,1)}var qh=class{process(t,e){e.begin("Breaking Point Insertion",1);let o=new kn(t),r;switch(t.getProperty(_.WRAPPING_CUTTING_STRATEGY)){case ro.MANUAL:r=new Wn;break;case ro.ARD:r=new Fi;break;default:r=new zn}let i=r.getCutIndexes(t,o);if(t.getProperty(_.WRAPPING_MULTI_EDGE_IMPROVE_CUTS)&&(i=Qy(t,i)),!r.guaranteeValid()&&t.hasProperty(_.WRAPPING_VALIDIFY_STRATEGY))switch(t.getProperty(_.WRAPPING_VALIDIFY_STRATEGY)){case io.LOOK_BACK:i=xs.validifyIndexesLookingBack(o,i);break;case io.GREEDY:i=xs.validifyIndexesGreedily(o,i);break;default:}if(i.length===0){e.done();return}Jy(t,i),e.done()}},vr=class{constructor(t,e,o,r,i){this.start=t,this.end=e,this.nodeStartEdge=o,this.startEndEdge=r,this.originalEdge=i,this.startInLayerDummy=null,this.startInLayerEdge=null,this.endInLayerDummy=null,this.endInLayerEdge=null,this.prev=null,this.next=null}static isStart(t){let e=t.getProperty(p.BREAKING_POINT_INFO);return e!=null&&e.start===t}static isEnd(t){let e=t.getProperty(p.BREAKING_POINT_INFO);return e!=null&&e.end===t}};function Jy(n,t){let e=n.getLayers(),o=0,r=t[o++],i=0,s=new Set,a=new Set,l=0,c=0;for(;l<e.length;){let g=e[l];for(let h of g){for(let d of h.getOutgoingEdges())a.add(d);for(let d of h.getIncomingEdges())a.delete(d)}if(c+1===r){let h=new Et(n),d=new Et(n);e.splice(l+1,0,h,d),l+=2;for(let f of a){s.has(f)||(i++,s.add(f));let E=new ft(n);E.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),E.setLayer(h),E.setType(y.BREAKING_POINT);let P=new rt;P.setNode(E),P.setSide(u.WEST);let S=new rt;S.setNode(E),S.setSide(u.EAST);let T=new ft(n);T.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),T.setLayer(d),T.setType(y.BREAKING_POINT);let N=new rt;N.setNode(T),N.setSide(u.WEST);let I=new rt;I.setNode(T),I.setSide(u.EAST);let C=new _e;C.setSource(f.getSource()),C.setTarget(P),C.setProperty(p.MODEL_ORDER,f.getProperty(p.MODEL_ORDER));let x=new _e;x.setSource(S),x.setTarget(N),x.setProperty(p.MODEL_ORDER,f.getProperty(p.MODEL_ORDER)),f.setSource(I);let M=new vr(E,T,C,x,f);E.setProperty(p.BREAKING_POINT_INFO,M),T.setProperty(p.BREAKING_POINT_INFO,M);let A=C.getSource().getNode();if(A.getType()===y.BREAKING_POINT){let B=A.getProperty(p.BREAKING_POINT_INFO);B.next=M,M.prev=B}}if(o<t.length)r=t[o++];else break}c++,l++}return i}function Qy(n,t){let e=[],o=[],r=null;for(let s of t){let a=new I_(s);o.push(a),r!=null&&(a.prev=r,r.suc=a),r=a}let i=eI(n);for(let s=0;s<o.length;s++){let a=null,l=o[0].selfOrNext(),c=null,g=Number.POSITIVE_INFINITY;for(let h=1;h<n.getLayers().length;h++){let d,f=l!=null?Math.abs(l.index-h):Math.abs(h-a.index)+1,E=a!=null?Math.abs(h-a.index):f+1,P;E<f?(d=a,P=E):(d=l,P=f);let S=tI(n,h,i[h],P);S<g&&(g=S,c=d,c.newIndex=h),l!=null&&h===l.index&&(a=l,l=l.next())}c!=null&&(e.push(c.newIndex),c.assigned=!0,c.offset())}return e.sort((s,a)=>s-a),e}function tI(n,t,e,o){let r=n.getProperty(_.WRAPPING_MULTI_EDGE_DISTANCE_PENALTY);return e+Math.pow(o,r)}function eI(n){let t=new Array(n.getLayers().length+1).fill(0),e=new Set,o=0;for(let r of n.getLayers()){t[o++]=e.size;for(let i of r.getNodes())for(let s of i.getOutgoingEdges())e.add(s);for(let i of r.getNodes())for(let s of i.getIncomingEdges())e.delete(s)}return t}var I_=class{constructor(t){this.index=t,this.newIndex=t,this.prev=null,this.suc=null,this.assigned=!1}selfOrNext(){return this.assigned?this.suc!=null?this.suc.selfOrNext():null:this}next(){return this.suc!=null?this.suc.selfOrNext():null}offset(){if(!this.assigned)throw new Error("Cannot offset an unassigned cut.");let t=this.newIndex-this.index;this._offset(t),this._offsetPrev(t),this._offsetSuc(t)}_offset(t){this.index+=t}_offsetPrev(t){this.prev!=null&&!this.prev.assigned&&(this.prev._offset(t),this.prev._offsetPrev(t))}_offsetSuc(t){this.suc!=null&&!this.suc.assigned&&(this.suc._offset(t),this.suc._offsetSuc(t))}};var Qh=class{process(t,e){if(e.begin("Breaking Point Processor",1),oI(t),t.getProperty(_.WRAPPING_MULTI_EDGE_IMPROVE_WRAPPED_EDGES)){for(let o of t.getLayers()){let r=0;for(let i of o.getNodes())i.id=r++}rI(t),TP(t,!0),TP(t,!1)}e.done()}};function oI(n){let t=n.getLayers();t.unshift(new Et(n));let e=!1,o=1,r=0;for(;r<t.length;){let i=t[r],s=t[o],a=i.getNodes().slice(),l=a.length;for(let c of a)c.setLayer(s);if(e){let c=a.slice().reverse();for(let g of c){let h=[...g.getIncomingEdges()];for(let d of h){d.reverse(n,!0),n.setProperty(p.CYCLIC,!0);let f=Yn.insertDummies(n,d,l),E=g.getProperty(p.BREAKING_POINT_INFO),P=f[f.length-1];E.startInLayerDummy=P.getSource().getNode(),E.startInLayerEdge=P,E.endInLayerDummy=d.getTarget().getNode(),E.endInLayerEdge=d}}e=!1}else a.length>0&&a[0].getType()===y.BREAKING_POINT&&(e=!0,o=-1);o++,r++}for(let i=t.length-1;i>=0;i--)t[i].getNodes().length===0&&t.splice(i,1)}function rI(n){for(let t of n.getLayers()){let e=t.getNodes().slice();for(let o of e){if(!vr.isStart(o))continue;let r=o.getProperty(p.BREAKING_POINT_INFO);if(r.prev!=null||r.next==null)continue;let i=r,s=r.next;for(;s!=null;){NP(s.start,s.startInLayerDummy,!1,!0),Vn(i.end),Vn(s.start),Vn(s.startInLayerDummy),Vn(s.endInLayerDummy),s.endInLayerEdge.setTarget(i.endInLayerEdge.getTarget()),i.endInLayerEdge.setTarget(null),i.end.setLayer(null),s.start.setLayer(null),s.startInLayerDummy.setLayer(null),s.endInLayerDummy.setLayer(null);let a=new vr(i.start,s.end,i.nodeStartEdge,s.startEndEdge,s.originalEdge);a.startInLayerDummy=i.startInLayerDummy,a.startInLayerEdge=i.startInLayerEdge,a.endInLayerDummy=i.endInLayerDummy,a.endInLayerEdge=s.endInLayerEdge,a.prev=i.prev,a.next=s.next,i.start.setProperty(p.BREAKING_POINT_INFO,a),s.end.setProperty(p.BREAKING_POINT_INFO,a),s=s.next,i=a}}}}function TP(n,t){let e=t?r=>vr.isEnd(r):r=>vr.isStart(r),o;do{o=!1;let r=t?n.getLayers().slice().reverse():n.getLayers();for(let i of r){let s=i.getNodes().slice();for(let a of s){if(!e(a))continue;let l=a.getProperty(p.BREAKING_POINT_INFO),c=t?l.endInLayerDummy:l.startInLayerDummy;NP(a,c,t,!1)&&(o=!0)}}}while(o)}function NP(n,t,e,o){let r=Jh(n,e),i=Jh(t,e),s=!1;for(;r!=null&&i!=null&&!(!o&&!iI(r,i,e));){let a=Jh(r,e),l=Jh(i,e);Vn(t),Vn(n);let c=r.getLayer();ii.joinAt(r,!1),ii.joinAt(i,!1),e?(t.setLayer(i.id,c),t.id=i.id,n.setLayer(r.id+1,c),n.id=r.id):(n.setLayer(r.id,c),n.id=r.id,t.setLayer(i.id+1,c),t.id=i.id),r.setLayer(null),i.setLayer(null),r=a,i=l,s=!0}return s}function iI(n,t,e){let o=n.getLayer(),r=e?t:n,i=e?n:t;for(let s=r.id+1;s<i.id;s++){let a=o.getNodes()[s];if(!(a.getType()===y.BREAKING_POINT||sI(a)))return!1}return!0}function Jh(n,t){let e=t?n.getOutgoingEdges():n.getIncomingEdges();for(let o of e){let r=o.getOther(n);if(r.getType()===y.LONG_EDGE&&r.getLayer()!==n.getLayer())return r}return null}function sI(n){if(n.getType()!==y.LONG_EDGE)return!1;for(let t of n.getConnectedEdges())if(!t.isSelfLoop()&&n.getLayer()===t.getOther(n).getLayer())return!0;return!1}function Vn(n){let t=n.getLayer();if(t==null)return;let e=t.getNodes();for(let o=n.id+1;o<e.length;o++)e[o].id--}var td=class{constructor(){this._edgeRouting=null}process(t,e){e.begin("Breaking Point Removing",1),this._edgeRouting=t.getProperty(_.EDGE_ROUTING);for(let o of t.getLayers()){let r=o.getNodes().slice();for(let i of r){if(!vr.isEnd(i))continue;let s=i.getProperty(p.BREAKING_POINT_INFO);s.next==null&&this._remove(t,s)}}e.done()}_remove(t,e){let o=new st;switch(this._edgeRouting){case At.SPLINES:{let l=e.nodeStartEdge.getProperty(p.SPLINE_ROUTE_START),c=e.startEndEdge.getProperty(p.SPLINE_ROUTE_START),g=e.originalEdge.getProperty(p.SPLINE_ROUTE_START),h=e.nodeStartEdge.getProperty(p.SPLINE_EDGE_CHAIN),d=e.startEndEdge.getProperty(p.SPLINE_EDGE_CHAIN),f=e.originalEdge.getProperty(p.SPLINE_EDGE_CHAIN),E=[];if(l&&E.push(...l),c){for(let S of c)S.inverseOrder=!0;E.push(...[...c].reverse())}g&&E.push(...g);let P=[];h&&P.push(...h),d&&P.push(...[...d].reverse()),f&&P.push(...f),e.originalEdge.setProperty(p.SPLINE_ROUTE_START,E),e.originalEdge.setProperty(p.SPLINE_EDGE_CHAIN,P),e.originalEdge.setProperty(p.SPLINE_SURVIVING_EDGE,e.originalEdge),e.nodeStartEdge.setProperty(p.SPLINE_ROUTE_START,null),e.nodeStartEdge.setProperty(p.SPLINE_EDGE_CHAIN,null),e.startEndEdge.setProperty(p.SPLINE_ROUTE_START,null),e.startEndEdge.setProperty(p.SPLINE_EDGE_CHAIN,null);break}case At.POLYLINE:{for(let c of e.nodeStartEdge.getBendPoints())o.add(c);o.add(e.start.getPosition());let l=[...e.startEndEdge.getBendPoints()].reverse();for(let c of l)o.add(c);o.add(e.end.getPosition());for(let c of e.originalEdge.getBendPoints())o.add(c);break}default:{for(let c of e.nodeStartEdge.getBendPoints())o.add(c);let l=[...e.startEndEdge.getBendPoints()].reverse();for(let c of l)o.add(c);for(let c of e.originalEdge.getBendPoints())o.add(c)}}let r=e.originalEdge.getBendPoints();r.length=0;for(let l of o)r.add(l);e.originalEdge.setSource(e.nodeStartEdge.getSource());let i=e.nodeStartEdge.getProperty(_.JUNCTION_POINTS),s=e.startEndEdge.getProperty(_.JUNCTION_POINTS),a=e.originalEdge.getProperty(_.JUNCTION_POINTS);if(i!=null||s!=null||a!=null){let l=new st;R_(l,a),R_(l,s),R_(l,i),e.originalEdge.setProperty(_.JUNCTION_POINTS,l)}e.startEndEdge.setSource(null),e.startEndEdge.setTarget(null),e.nodeStartEdge.setSource(null),e.nodeStartEdge.setTarget(null),e.end.setLayer(null),e.start.setLayer(null),e.prev!=null&&this._remove(t,e.prev)}};function R_(n,t){if(n==null||t==null)return!1;for(let e of t)n.add(e);return!0}var tr=class{constructor(){this.id=0,this.master=null,this.cNodes=new Set,this.startPos=Number.NEGATIVE_INFINITY,this.incomingConstraints=new Set,this.outDegree=0,this.outDegreeReal=0,this.reference=null,this.delta=0,this.deltaNormalized=0}static of(){return new L_}addCNode(t){if(t.cGroup!=null)throw new Error("CNode belongs to another CGroup.");this.cNodes.add(t),t.cGroup=this,this.reference==null&&(this.reference=t)}removeCNode(t){let e=this.cNodes.delete(t);return e&&(t.cGroup=null),e}},L_=class{constructor(){this.group=new tr}nodes(...t){for(let e of t)this.group.addCNode(e);return this}reference(t){return this.group.reference=t,this}master(t){return this.group.master=t,this}create(t){return t.cGroups.push(this.group),this.group}};var ed=class{compact(t){let e=Number.POSITIVE_INFINITY;for(let r of t.cGraph.cNodes)e=Math.min(e,r.cGroup.reference.hitbox.x+r.cGroupOffset.x);let o=[];for(let r of t.cGraph.cGroups)r.startPos=e,r.outDegree===0&&o.push(r);for(;o.length>0;){let r=o.shift(),i=r.reference.hitbox.x;for(let s of r.cNodes){let a=r.startPos+s.cGroupOffset.x;!t.isLocked(r,t.direction)||s.hitbox.x<a?s.startPos=a:s.startPos=s.hitbox.x}i-=r.reference.startPos,r.delta+=i,t.direction===R.RIGHT||t.direction===R.DOWN?r.deltaNormalized+=i:r.deltaNormalized-=i;for(let s of r.cNodes)for(let a of s.constraints){let l;t.direction.isHorizontal()?l=t.spacingsHandler.getHorizontalSpacing(s,a):l=t.spacingsHandler.getVerticalSpacing(s,a),a.cGroup.startPos=Math.max(a.cGroup.startPos,s.startPos+s.hitbox.width+l-a.cGroupOffset.x),t.isLocked(a,t.direction)&&(a.cGroup.startPos=Math.max(a.cGroup.startPos,a.hitbox.x-a.cGroupOffset.x)),a.cGroup.outDegree--,a.cGroup.outDegree===0&&o.push(a.cGroup)}}for(let r of t.cGraph.cNodes)r.hitbox.x=r.startPos}};var ae=class{};ae.TOLERANCE=1e-4;function od(n,t,e){return Math.abs(n-t)<=e?0:n<t?-1:1}ae.eq=(n,t)=>Math.abs(n-t)<=ae.TOLERANCE;ae.gt=(n,t)=>od(n,t,ae.TOLERANCE)>0;ae.lt=(n,t)=>od(n,t,ae.TOLERANCE)<0;ae.ge=(n,t)=>od(n,t,ae.TOLERANCE)>=0;ae.le=(n,t)=>od(n,t,ae.TOLERANCE)<=0;var rd=class{constructor(t,e){this.node=t,this.low=e}},A_=class n{constructor(){this._items=[]}static _key(t){return t.hitbox.x+t.hitbox.width/2}add(t){let e=n._key(t);for(let o=0;o<this._items.length;o++){let r=n._key(this._items[o]);if(r===e)return!1;if(r>e)return this._items.splice(o,0,t),!0}return this._items.push(t),!0}lower(t){let e=n._key(t),o=null;for(let r of this._items)if(n._key(r)<e)o=r;else break;return o}floor(t){let e=n._key(t),o=null;for(let r of this._items)if(n._key(r)<=e)o=r;else break;return o}higher(t){let e=n._key(t);for(let o of this._items)if(n._key(o)>e)return o;return null}ceiling(t){let e=n._key(t);for(let o of this._items)if(n._key(o)>=e)return o;return null}remove(t){let e=this._items.indexOf(t);return e>=0?(this._items.splice(e,1),!0):!1}clear(){this._items.length=0}},Xn=class n{constructor(){this.compactor=null,this._scanlineHandler=new C_(this)}calculateConstraints(t){this.compactor=t,this._sweep(()=>!0)}_sweep(t){let e=[];for(let o of this.compactor.cGraph.cNodes)t(o)&&(e.push(new rd(o,!0)),e.push(new rd(o,!1)));this._scanlineHandler.reset(),Zo.execute(e,n._compareTimestamps,this._scanlineHandler)}static _compareTimestamps(t,e){let o=t.node.hitbox.y;t.low||(o+=t.node.hitbox.height);let r=e.node.hitbox.y;e.low||(r+=e.node.hitbox.height);let i=o-r;if(i===0){if(!t.low&&e.low)return-1;if(!e.low&&t.low)return 1}return i}},C_=class{constructor(t){this._owner=t,this._intervals=new A_,this._cand=[]}reset(){this._intervals.clear();let t=this._owner.compactor.cGraph.cNodes;this._cand=new Array(t.length).fill(null);let e=0;for(let o of t)o.id=e++}handle(t){t.low?this._insert(t):this._delete(t)}_insert(t){if(!this._intervals.add(t.node))throw new Error("Invalid hitboxes for scanline constraint calculation.");this._overlap(t.node,this._intervals.floor(t.node))||this._overlap(t.node,this._intervals.ceiling(t.node)),this._cand[t.node.id]=this._intervals.lower(t.node);let o=this._intervals.higher(t.node);o!=null&&(this._cand[o.id]=t.node)}_delete(t){let e=this._intervals.lower(t.node);e!=null&&e===this._cand[t.node.id]&&e.cGroup!=null&&e.cGroup!==t.node.cGroup&&e.constraints.push(t.node);let o=this._intervals.higher(t.node);o!=null&&this._cand[o.id]===t.node&&o.cGroup!=null&&o.cGroup!==t.node.cGroup&&t.node.constraints.push(o),this._intervals.remove(t.node)}_overlap(t,e){return t==null||e==null||t===e?!1:ae.le(t.hitbox.x,e.hitbox.x+e.hitbox.width)&&ae.le(e.hitbox.x,t.hitbox.x+t.hitbox.width)}};var id=class{calculateConstraints(t){for(let e of t.cGraph.cNodes)e.constraints.length=0;for(let e of t.cGraph.cNodes)for(let o of t.cGraph.cNodes){if(e===o||e.cGroup!=null&&e.cGroup===o.cGroup)continue;let r;t.direction.isHorizontal()?r=t.spacingsHandler.getVerticalSpacing(e,o):r=t.spacingsHandler.getHorizontalSpacing(e,o),(o.hitbox.x>e.hitbox.x||e.hitbox.x===o.hitbox.x&&e.hitbox.width<o.hitbox.width)&&ae.gt(o.hitbox.y+o.hitbox.height+r,e.hitbox.y)&&ae.lt(o.hitbox.y,e.hitbox.y+e.hitbox.height+r)&&e.constraints.push(o)}}};var x_=Object.freeze({getHorizontalSpacing:()=>0,getVerticalSpacing:()=>0}),Vq=Object.freeze({DEFAULT_SPACING_HANDLER:x_});var Br=class n{constructor(t){this.cGraph=t,this.compactionAlgorithm=n.LONGEST_PATH_COMPACTION,this.constraintAlgorithm=n.SCANLINE_CONSTRAINTS,this.lockFun=null,this.spacingsHandler=x_,this.direction=R.UNDEFINED,this._finished=!1,this.calculateGroupOffsets();for(let e of t.cNodes)e.cGroup==null&&tr.of().nodes(e).create(t),e.hitboxPreCompaction=new dt(e.hitbox)}setSpacingsHandler(t){return this.spacingsHandler=t,this}setCompactionAlgorithm(t){return this.compactionAlgorithm=t,this}setConstraintAlgorithm(t){return this.constraintAlgorithm=t,this}compact(){if(this._finished)throw new Error("The OneDimensionalCompactor instance has been finished already.");this.direction===R.UNDEFINED&&this.changeDirection(R.LEFT);for(let t of this.cGraph.cGroups)t.outDegree=t.outDegreeReal;for(let t of this.cGraph.cNodes)t.startPos=Number.NEGATIVE_INFINITY;return this.compactionAlgorithm.compact(this),this}finish(){return this.changeDirection(R.LEFT),this._finished=!0,this}changeDirection(t){if(this._finished)throw new Error("The OneDimensionalCompactor instance has been finished already.");if(!this.cGraph.supports(t))throw new Error(`The direction ${t} is not supported by the CGraph instance.`);if(t===this.direction)return this;let e=this.direction;switch(this.direction=t,e){case R.UNDEFINED:switch(t){case R.LEFT:this._calculateConstraints();break;case R.RIGHT:this._mirrorHitboxes(),this._calculateConstraints();break;case R.UP:this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.LEFT:switch(t){case R.RIGHT:this._mirrorHitboxes(),this._reverseConstraints();break;case R.UP:this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.RIGHT:switch(t){case R.LEFT:this._mirrorHitboxes(),this._reverseConstraints();break;case R.UP:this._mirrorHitboxes(),this._transposeHitboxes(),this._calculateConstraints();break;case R.DOWN:this._mirrorHitboxes(),this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break}break;case R.UP:switch(t){case R.LEFT:this._transposeHitboxes(),this._calculateConstraints();break;case R.RIGHT:this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break;case R.DOWN:this._mirrorHitboxes(),this._reverseConstraints();break}break;case R.DOWN:switch(t){case R.LEFT:this._mirrorHitboxes(),this._transposeHitboxes(),this._calculateConstraints();break;case R.RIGHT:this._mirrorHitboxes(),this._transposeHitboxes(),this._mirrorHitboxes(),this._calculateConstraints();break;case R.UP:this._mirrorHitboxes(),this._reverseConstraints();break}break}return this}isLocked(t,e){if(t.cNodes!=null){for(let o of t.cNodes)if(this.isLocked(o,e))return!0;return!1}return this.lockFun!=null?this.lockFun.isLocked(t,e):!1}setLockFunction(t){return this.lockFun=t,this}forceConstraintsRecalculation(){return this._calculateConstraints(),this}calculateGroupOffsets(){for(let t of this.cGraph.cGroups){t.reference=null;for(let e of t.cNodes)e.cGroupOffset.reset(),(t.reference==null||e.hitbox.x<t.reference.hitbox.x)&&(t.reference=e);for(let e of t.cNodes)e.cGroupOffset.x=e.hitbox.x-t.reference.hitbox.x,e.cGroupOffset.y=e.hitbox.y-t.reference.hitbox.y}return this}_mirrorHitboxes(){for(let t of this.cGraph.cNodes)t.hitbox.x=-t.hitbox.x-t.hitbox.width;this.calculateGroupOffsets()}_transposeHitboxes(){for(let t of this.cGraph.cNodes){let e=t.hitbox.x;t.hitbox.x=t.hitbox.y,t.hitbox.y=e,e=t.hitbox.width,t.hitbox.width=t.hitbox.height,t.hitbox.height=e,e=t.cGroupOffset.x,t.cGroupOffset.x=t.cGroupOffset.y,t.cGroupOffset.y=e}this.calculateGroupOffsets()}_calculateConstraints(){for(let e of this.cGraph.cNodes)e.constraints.length=0;let t=this.direction.isHorizontal()?this.cGraph.predefinedHorizontalConstraints:this.cGraph.predefinedVerticalConstraints;for(let e of t)this.direction===R.LEFT||this.direction===R.UP?e.getFirst().constraints.push(e.getSecond()):e.getSecond().constraints.push(e.getFirst());this.constraintAlgorithm.calculateConstraints(this),this._calculateConstraintsForCGroups()}_calculateConstraintsForCGroups(){for(let t of this.cGraph.cGroups)t.outDegree=0,t.outDegreeReal=0,t.incomingConstraints.clear();for(let t of this.cGraph.cGroups)for(let e of t.cNodes)for(let o of e.constraints)o.cGroup!==t&&(t.incomingConstraints.add(o),o.cGroup.outDegree++,o.cGroup.outDegreeReal++)}_reverseConstraints(){let t=new Map;for(let e of this.cGraph.cNodes)t.set(e,[]);for(let e of this.cGraph.cNodes){e.startPos=Number.NEGATIVE_INFINITY;for(let o of e.constraints)t.get(o).push(e)}for(let e of this.cGraph.cNodes)e.constraints=t.get(e);this._calculateConstraintsForCGroups()}};Br.LONGEST_PATH_COMPACTION=new ed;Br.SCANLINE_CONSTRAINTS=new Xn;Br.QUADRATIC_CONSTRAINTS=new id;var Ur=class{constructor(t){this.name=t}toString(){return this.name}};Ur.QUADRATIC=new Ur("QUADRATIC");Ur.SCANLINE=new Ur("SCANLINE");var ai=class{constructor(t=!1,e=!1,o=!1,r=!1){this.left=t,this.right=e,this.up=o,this.down=r}set(t,e,o,r){this.left=t,this.right=e,this.up=o,this.down=r}applyOr(t){this.left=this.left||t.left,this.right=this.right||t.right,this.up=this.up||t.up,this.down=this.down||t.down}setDirection(t,e){switch(e){case R.LEFT:this.left=t;break;case R.RIGHT:this.right=t;break;case R.UP:this.up=t;break;case R.DOWN:this.down=t;break}}getDirection(t){switch(t){case R.LEFT:return this.left;case R.RIGHT:return this.right;case R.UP:return this.up;case R.DOWN:return this.down;default:return!1}}};var we=class{constructor(t,e,o,r){this.potentialGroupParents=[],this.representedLEdges=[],this.affectedBends=[],this.affectedBoundingBoxes=[],this.hitbox=new dt,this.junctionPoints=new st,this.ignoreSpacing=new ai,this.constraints=[],this.aPort=null,this.joined=[],this.affectedBends.push(t),this.affectedBends.push(e),this.hitbox.x=Math.min(t.x,e.x),this.hitbox.y=Math.min(t.y,e.y),this.hitbox.width=Math.abs(t.x-e.x),this.hitbox.height=Math.abs(t.y-e.y);let i=r.getProperty(_.JUNCTION_POINTS);if(i!=null)for(let s of i)ae.eq(s.x,t.x)&&this.junctionPoints.add(s);o!=null&&this.potentialGroupParents.push(o),this.representedLEdges.push(r)}joinWith(t){for(let l of t.representedLEdges)this.representedLEdges.push(l);for(let l of t.affectedBends)this.affectedBends.push(l);for(let l of t.affectedBoundingBoxes)this.affectedBoundingBoxes.push(l);for(let l of t.junctionPoints)this.junctionPoints.add(l);for(let l of t.constraints)this.constraints.push(l);for(let l of t.potentialGroupParents)this.potentialGroupParents.push(l);let e=Math.min(this.hitbox.x,t.hitbox.x),o=Math.min(this.hitbox.y,t.hitbox.y),i=Math.max(this.hitbox.x+this.hitbox.width,t.hitbox.x+t.hitbox.width)-e,a=Math.max(this.hitbox.y+this.hitbox.height,t.hitbox.y+t.hitbox.height)-o;this.hitbox.x=e,this.hitbox.y=o,this.hitbox.width=i,this.hitbox.height=a,this.ignoreSpacing.applyOr(t.ignoreSpacing),this.aPort==null&&(this.aPort=t.aPort);for(let l of t.joined)this.joined.push(l);return this.joined.push(t),this}intersects(t){return ae.eq(this.hitbox.x,t.hitbox.x)&&!(ae.lt(this.hitbox.y+this.hitbox.height,t.hitbox.y)||ae.lt(t.hitbox.y+t.hitbox.height,this.hitbox.y))}compareTo(t){let e=ae.TOLERANCE,o=this.hitbox.x-t.hitbox.x;return Math.abs(o)<=e?this.hitbox.y-t.hitbox.y:o}toString(){return`VerticalSegment ${this.hitbox} ${this.representedLEdges.join(", ")}`}};var sd=.5,Kn=.01,nd=class extends Xn{constructor(t){super(),this._verticalEdgeEdgeSpacing=t.getProperty(_.SPACING_EDGE_EDGE),this._edgeRouting=t.getProperty(_.EDGE_ROUTING)}calculateConstraints(t){switch(this.compactor=t,this._edgeRouting){case At.ORTHOGONAL:this._calculateForOrthogonal();break;case At.SPLINES:this._calculateForSpline();break;default:throw new Error("Unsupported edge routing: "+this._edgeRouting)}}_calculateForSpline(){let t=[];this._sweep(o=>o.origin instanceof we);let e=this._computeMinSpacing();for(let o of this.compactor.cGraph.cNodes)o.origin instanceof ft&&(this._alterHitbox(o,e,1),t.push(()=>this._alterHitbox(o,e,-1)));this._sweep(()=>!0);for(let o of t)o();t.length=0}_calculateForOrthogonal(){let t=[];for(let o of this.compactor.cGraph.cNodes)if(o.origin instanceof we){let r=Math.max(0,this._verticalEdgeEdgeSpacing/2-sd);this._alterHitbox(o,r,1),t.push(()=>this._alterHitbox(o,r,-1))}this._sweep(o=>o.origin instanceof we);for(let o of t)o();t.length=0;for(let o of this.compactor.cGraph.cNodes)if(o.origin instanceof ft){let r=ke.getLNodeOrNull(o),i=oo.getIndividualOrDefault(r,_.SPACING_EDGE_EDGE),s=Math.max(0,i/2-sd);this._alterHitbox(o,s,1),t.push(()=>this._alterHitbox(o,s,-1))}this._sweep(o=>o.origin instanceof ft);for(let o of t)o();t.length=0;let e=this._computeMinSpacing();for(let o of this.compactor.cGraph.cGroups)this._alterGroupedHitboxOrthogonal(o,e,1),t.push(()=>this._alterGroupedHitboxOrthogonal(o,e,-1));this._sweep(()=>!0);for(let o of t)o();t.length=0}_computeMinSpacing(){let t=Number.POSITIVE_INFINITY;for(let e of this.compactor.cGraph.cNodes){let o;if(e.origin instanceof ft&&e.origin.getType()===y.EXTERNAL_PORT)o=Number.POSITIVE_INFINITY;else if(ke.getVerticalSegmentOrNull(e)!=null)o=Math.max(0,this._verticalEdgeEdgeSpacing/2-sd);else{let i=ke.getLNodeOrNull(e);if(i!=null){let s=oo.getIndividualOrDefault(i,_.SPACING_NODE_NODE);o=Math.max(0,s/2-sd)}else o=Number.POSITIVE_INFINITY}o<t&&(t=o)}return Number.isFinite(t)?t:0}_alterGroupedHitboxOrthogonal(t,e,o){let r=t.master;if(r==null&&(r=t.cNodes.values().next().value),this._alterHitbox(r,e,o),t.cNodes.size===1)return;let i=e*o;for(let s of t.cNodes){if(s===r)continue;let a=ke.getVerticalSegmentOrNull(s);a!=null&&(a.ignoreSpacing.up?(s.hitbox.y+=i+Kn,s.hitbox.height-=i+Kn):a.ignoreSpacing.down&&(s.hitbox.height-=i+Kn))}}_alterHitbox(t,e,o){let r=e*o;if(t.origin instanceof we){let i=ke.getVerticalSegmentOrNull(t);i.ignoreSpacing.up?i.ignoreSpacing.down||(t.hitbox.height+=r+Kn):(t.hitbox.y-=r+Kn,t.hitbox.height+=r+Kn)}else t.origin instanceof ft&&(t.hitbox.y-=r,t.hitbox.height+=2*r)}};var Zn=class{constructor(t){this.cNodes=[],this.cGroups=[],this.predefinedHorizontalConstraints=[],this.predefinedVerticalConstraints=[],this._supportedDirections=t}supports(t){return this._supportedDirections.has(t)}};var ki=class{constructor(){this.id=0,this.origin=null,this.type=null,this.toStringDelegate=null,this.cGroup=null,this.cGroupOffset=new O,this.hitboxPreCompaction=null,this.hitbox=null,this.constraints=[],this.startPos=Number.NEGATIVE_INFINITY,this.lock=new ai}static of(){return new D_}getDebugSVG(){let t=this.hitbox.x,e=this.hitbox.y,o=Math.max(1,this.hitbox.width),r=Math.max(1,this.hitbox.height);return`<rect x="${t}" y="${e}" width="${o}" height="${r}" fill="green" stroke="black" opacity="0.5"/><text x="${t+2}" y="${e+8+2+1}">(${Math.round(t)}, ${Math.round(e)})
+${this}</text>`}toString(){return this.toStringDelegate!=null?this.toStringDelegate(this):`CNode[id=${this.id}]`}},D_=class{constructor(){this.node=new ki,this.groupParent=null}id(t){return this.node.id=t,this}origin(t){return this.node.origin=t,this}type(t){return this.node.type=t,this}hitbox(t){return this.node.hitbox=t,this}toStringDelegate(t){return this.node.toStringDelegate=t,this}groupWith(t){return this.groupParent=t,this}create(t){return t.cNodes.push(this.node),this.groupParent!=null&&(this.groupParent.cGroup==null?tr.of().nodes(this.groupParent,this.node).create(t):this.groupParent.cGroup.addCNode(this.node)),this.node}};var ad=class{constructor(){this._cGraph=null,this._layeredGraph=null,this._edgeRouting=null,this._commentOffsets=new Map,this._nodesMap=new Map,this._verticalSegmentsMap=new Map,this._lockMap=new Map}transform(t){return this._layeredGraph=t,this._edgeRouting=this._layeredGraph.getProperty(_.EDGE_ROUTING),this._init(),this._transformNodes(),this._transformEdges(),this._cGraph}getLockMap(){return this._lockMap}_init(){let t=!1,e=0;for(let r of this._layeredGraph){r.id=e++;for(let i of r)if(!t)for(let s of i.getConnectedEdges()){t=!0;break}}let o=new Set([R.UNDEFINED,R.LEFT,R.RIGHT]);t||(o.add(R.UP),o.add(R.DOWN)),this._cGraph=new Zn(o),this._nodesMap.clear(),this._commentOffsets.clear(),this._lockMap.clear(),this._verticalSegmentsMap.clear()}_transformNodes(){for(let t of this._layeredGraph)for(let e of t){if(e.getProperty(_.COMMENT_BOX)){let c=[...e.getConnectedEdges()];if(c.length>0){let g=c[0],h=g.getSource().getNode();h===e&&(h=g.getTarget().getNode());let d=new O(e.getPosition().x-h.getPosition().x,e.getPosition().y-h.getPosition().y);this._commentOffsets.set(e,{other:h,offset:d});continue}}let o=new dt(e.getPosition().x-e.getMargin().left,e.getPosition().y-e.getMargin().top,e.getSize().x+e.getMargin().left+e.getMargin().right,e.getSize().y+e.getMargin().top+e.getMargin().bottom),r=ki.of().origin(e).hitbox(o).toStringDelegate(nI).create(this._cGraph);tr.of().nodes(r).master(r).create(this._cGraph);let i=new ai;this._lockMap.set(r,i);let s=0;for(let c of e.getIncomingEdges())s++;let a=0;for(let c of e.getOutgoingEdges())a++;let l=s-a;l<0?i.setDirection(!0,R.LEFT):l>0&&i.setDirection(!0,R.RIGHT),e.getType()===y.EXTERNAL_PORT&&i.set(!1,!1,!1,!1),this._nodesMap.set(e,r)}}_transformEdges(){let t=this._layeredGraph.getProperty(_.EDGE_ROUTING),e;switch(t){case At.ORTHOGONAL:e=this._collectVerticalSegmentsOrthogonal();break;case At.SPLINES:e=this._collectVerticalSegmentsSplines();break;default:throw new Error("Compaction not supported for "+t+" edges.")}this._mergeVerticalSegments(e);for(let o of this._verticalSegmentsMap.keys()){let r=this._verticalSegmentsMap.get(o);for(let i of o.constraints){let s=this._verticalSegmentsMap.get(i);this._cGraph.predefinedHorizontalConstraints.push([r,s])}}}_collectVerticalSegmentsOrthogonal(){let t=[];for(let e of this._layeredGraph)for(let o of e){let r=this._nodesMap.get(o);if(r!=null){for(let i of o.getOutgoingEdges()){let s=[...i.getBendPoints()];if(s.length===0)continue;let a=s[0],l=null,c=!0;if(i.getSource().getSide()===u.NORTH){let g=new we(a,new O(a.x,r.hitbox.y),r,i);g.ignoreSpacing.down=!0,g.aPort=i.getSource(),t.push(g)}if(i.getSource().getSide()===u.SOUTH){let g=new we(a,new O(a.x,r.hitbox.y+r.hitbox.height),r,i);g.ignoreSpacing.up=!0,g.aPort=i.getSource(),t.push(g)}for(let g=1;g<s.length;g++){let h=s[g];ae.eq(a.y,h.y)||(l=new we(a,h,null,i),t.push(l),c&&(c=!1,h.y<r.hitbox.y?l.ignoreSpacing.down=!0:h.y>r.hitbox.y+r.hitbox.height?l.ignoreSpacing.up=!0:(l.ignoreSpacing.up=!0,l.ignoreSpacing.down=!0))),g+1<s.length&&(a=h)}if(l!=null){let g=this._nodesMap.get(i.getTarget().getNode()),h=s[s.length-2];g!=null&&(h.y<g.hitbox.y?l.ignoreSpacing.down=!0:h.y>g.hitbox.y+g.hitbox.height?l.ignoreSpacing.up=!0:(l.ignoreSpacing.up=!0,l.ignoreSpacing.down=!0))}}for(let i of o.getIncomingEdges()){let s=i.getBendPoints();if(s.length===0)continue;let a=s[s.length-1];if(i.getTarget().getSide()===u.NORTH){let l=new we(a,new O(a.x,r.hitbox.y),r,i);l.ignoreSpacing.down=!0,l.aPort=i.getTarget(),t.push(l)}if(i.getTarget().getSide()===u.SOUTH){let l=new we(a,new O(a.x,r.hitbox.y+r.hitbox.height),r,i);l.ignoreSpacing.up=!0,l.aPort=i.getTarget(),t.push(l)}}}}return t}_collectVerticalSegmentsSplines(){let t=[];for(let e of this._layeredGraph.getLayers())for(let o of e.getNodes())for(let r of o.getOutgoingEdges()){let i=r.getProperty(p.SPLINE_ROUTE_START);if(i==null)continue;let s=null;for(let a of i){if(a.isStraight)continue;let l=a.boundingBox.getTopLeft(),c=a.boundingBox.getBottomRight(),g=new we(l,c,null,a.edges.values().next().value);g.affectedBoundingBoxes.push(a.boundingBox),t.push(g),s!=null&&s.constraints.push(g),s=g}}return t}_mergeVerticalSegments(t){if(t.length===0)return;t.sort((o,r)=>o.compareTo(r));let e=t[0];for(let o=1;o<t.length;o++){let r=t[o];e.intersects(r)?e=e.joinWith(r):(this._verticalSegmentToCNode(e),e=r)}this._verticalSegmentToCNode(e)}_verticalSegmentToCNode(t){let e=ki.of().origin(t).type("vs").hitbox(new dt(t.hitbox)).toStringDelegate(aI).create(this._cGraph);t.potentialGroupParents.length>0&&t.potentialGroupParents[0].cGroup.addCNode(e);let o=new ai;this._lockMap.set(e,o);let r=new Set,i=new Set;for(let a of t.representedLEdges)r.add(a.getSource()),i.add(a.getTarget());let s=r.size-i.size;s<0?(o.setDirection(!0,R.LEFT),o.setDirection(!1,R.RIGHT)):s>0&&(o.setDirection(!1,R.LEFT),o.setDirection(!0,R.RIGHT));for(let a of t.joined)this._verticalSegmentsMap.set(a,e);this._verticalSegmentsMap.set(t,e)}applyLayout(){for(let o of this._cGraph.cNodes)if(o.origin instanceof ft){let r=o.origin;r.getPosition().x=o.hitbox.x+r.getMargin().left}this._applyCommentPositions();for(let o of this._cGraph.cNodes)if(o.origin instanceof we){let r=o.hitbox.x-o.hitboxPreCompaction.x,i=o.origin;for(let s of i.affectedBends)s.x+=r;for(let s of i.affectedBoundingBoxes)s.x+=r;for(let s of i.junctionPoints)s.x+=r}for(let o of this._nodesMap.keys())for(let r of o.getOutgoingEdges()){if(!r.isSelfLoop())continue;let i=r.getSource().getNode(),s=this._nodesMap.get(i),a=s.hitbox.x-s.hitboxPreCompaction.x;for(let l of r.getBendPoints())l.x+=a;for(let l of r.getLabels())l.getPosition().x+=a}if(this._layeredGraph.getProperty(_.EDGE_ROUTING)===At.SPLINES)for(let o of this._layeredGraph.getLayers())for(let r of o.getNodes())for(let i of r.getOutgoingEdges()){let s=i.getProperty(p.SPLINE_ROUTE_START);s!=null&&s.length>0&&this._adjustSplineControlPoints(s)}let t=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),e=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let o of this._cGraph.cNodes)t.x=Math.min(t.x,o.hitbox.x),t.y=Math.min(t.y,o.hitbox.y),e.x=Math.max(e.x,o.hitbox.x+o.hitbox.width),e.y=Math.max(e.y,o.hitbox.y+o.hitbox.height);this._layeredGraph.getOffset().reset().add(-t.x,-t.y),this._layeredGraph.getSize().reset().add(e.x-t.x,e.y-t.y),this._applyExternalPortPositions(t,e),this._cleanup()}_applyCommentPositions(){for(let[t,e]of this._commentOffsets){let o=e.other,r=e.offset;t.getPosition().reset().add(o.getPosition().x+r.x,o.getPosition().y+r.y)}}_applyExternalPortPositions(t,e){for(let o of this._cGraph.cNodes){let r=o.origin instanceof ft?o.origin:null;if(!(r==null||r.getType()!==y.EXTERNAL_PORT))switch(r.getProperty(p.EXT_PORT_SIDE)){case u.WEST:r.getPosition().x=t.x;break;case u.EAST:r.getPosition().x=e.x-(r.getSize().x+r.getMargin().right);break;case u.NORTH:r.getPosition().y=t.y;break;case u.SOUTH:r.getPosition().y=e.y-(r.getSize().y+r.getMargin().bottom);break;default:break}}}_adjustSplineControlPoints(t){if(t.length===0)return;let e=t[0];if(t.length===1){this._adjustControlPointBetweenSegments(e,e,1,0,t);return}let o=1;for(;o<t.length;)if(e.initialSegment||!e.isStraight){let r=this._firstNonStraightSegment(t,o);if(r!=null){let i=r[0],s=r[1];this._adjustControlPointBetweenSegments(e,s,o,i,t),o=i+1,e=s}else break}else o++}_firstNonStraightSegment(t,e){if(e<0||e>=t.length)return null;for(let o=e;o<t.length;o++){let r=t[o];if(o===t.length-1||!r.isStraight)return[o,r]}return null}_adjustControlPointBetweenSegments(t,e,o,r,i){let s,a=o;if(t.initialSegment&&t.isStraight){let E=this._nodesMap.get(t.sourceNode);s=E.hitbox.x+E.hitbox.width,a--}else s=t.boundingBox.x+t.boundingBox.width;let l,c=r;e.lastSegment&&e.isStraight?(l=this._nodesMap.get(e.targetNode).hitbox.x,c++):l=e.boundingBox.x;let g=l-s,h=Math.max(2,c-a),d=g/h,f=s+d;for(let E=a;E<c;E++){let P=i[E],S=P.boundingBox.width;P.boundingBox.x=f-S/2,f+=d}}_cleanup(){this._nodesMap.clear(),this._commentOffsets.clear(),this._verticalSegmentsMap.clear(),this._lockMap.clear(),this._cGraph.cGroups.length=0,this._cGraph.cNodes.length=0,this._cGraph=null,this._layeredGraph=null}},nI=n=>{let t=n.origin,e=t&&t.getProperty?t.getProperty(p.ORIGIN):null;return e!=null?String(e):String(t)},aI=n=>String(n.origin);var ee=class{constructor(){this.id=0,this.internalId=0,this.origin=null,this.source=null,this.target=null,this.weight=0,this.delta=1,this.treeEdge=!1}static of(t){return new w_}getSource(){return this.source}getTarget(){return this.target}getOther(t){if(t===this.source)return this.target;if(t===this.target)return this.source;throw new Error(`Node ${t} not part of edge ${this}`)}reverse(){let t=this.source;return this.source=this.target,this.target=t,yP(this.target.getOutgoingEdges(),this),this.target.getIncomingEdges().push(this),yP(this.source.getIncomingEdges(),this),this.source.getOutgoingEdges().push(this),this}toString(){return`NEdge[id=${this.id} w=${this.weight} d=${this.delta}]`}};function yP(n,t){let e=n.indexOf(t);e>=0&&n.splice(e,1)}var w_=class{constructor(){this.edge=new ee}id(t){return this.edge.id=t,this}origin(t){return this.edge.origin=t,this}weight(t){return this.edge.weight=t,this}delta(t){return this.edge.delta=t,this}source(t){return this.edge.source=t,this}target(t){return this.edge.target=t,this}create(){if(this.edge.source==null||this.edge.target==null)throw new Error("NEdge must have a source and target NNode specified.");if(this.edge.source===this.edge.target)throw new Error(`Network simplex does not support self-loops: ${this.edge} ${this.edge.source} ${this.edge.target}`);return this.edge.source.getOutgoingEdges().push(this.edge),this.edge.target.getIncomingEdges().push(this.edge),this.edge}};var He=class{constructor(){this.id=0,this.internalId=0,this.origin=null,this.type="",this.layer=0,this.treeNode=!1,this.unknownCutvalues=[],this._outgoingEdges=new ld,this._incomingEdges=new ld,this._outgoingEdgesModCnt=-1,this._incomingEdgesModCnt=-1,this._allEdges=[]}static of(){return new M_}getOutgoingEdges(){return this._outgoingEdges}getIncomingEdges(){return this._incomingEdges}getConnectedEdges(){if(this._incomingEdgesModCnt!==this._incomingEdges.getModCnt()||this._outgoingEdgesModCnt!==this._outgoingEdges.getModCnt()){this._allEdges=[];for(let t of this._incomingEdges)this._allEdges.push(t);for(let t of this._outgoingEdges)this._allEdges.push(t);this._incomingEdgesModCnt=this._incomingEdges.getModCnt(),this._outgoingEdgesModCnt=this._outgoingEdges.getModCnt()}return this._allEdges}toString(){return`NNode[id=${this.id} layer=${this.layer}]`}},M_=class{constructor(){this.node=new He}id(t){return this.node.id=t,this}origin(t){return this.node.origin=t,this}type(t){return this.node.type=t,this}create(t){return t.nodes.push(this.node),this.node}},ld=class extends Array{constructor(){super(),this._modCount=0}getModCnt(){return this._modCount}push(...t){return this._modCount++,super.push(...t)}pop(){return this._modCount++,super.pop()}shift(){return this._modCount++,super.shift()}unshift(...t){return this._modCount++,super.unshift(...t)}splice(t,e,...o){return this._modCount++,super.splice(t,e,...o)}clear(){this._modCount++,this.length=0}};var Wi=class{constructor(){this.nodes=[]}makeConnected(){let t=0;for(let o of this.nodes)o.internalId=t++;let e=this._findConCompRepresentatives();return e.length>1?this._createArtificialRootAndConnect(e):null}_createArtificialRootAndConnect(t){let e=He.of().create(this);for(let o of t)ee.of().delta(0).weight(0).source(e).target(o).create();return e}_findConCompRepresentatives(){let t=[],e=new Array(this.nodes.length).fill(!1);for(let o of this.nodes)e[o.internalId]||(t.push(o),this._dfs(o,e));return t}_dfs(t,e){if(!e[t.internalId]){e[t.internalId]=!0;for(let o of t.getConnectedEdges()){let r=o.getOther(t);this._dfs(r,e)}}}isAcyclic(){let t=0;for(let i of this.nodes)i.internalId=t++;let e=new Array(this.nodes.length).fill(0),o=new Array(this.nodes.length).fill(0);for(let i of this.nodes)e[i.internalId]+=i.getIncomingEdges().length;let r=[];for(let i of this.nodes)i.getIncomingEdges().length===0&&r.push(i);if(r.length===0&&this.nodes.length>0)return!1;for(;r.length>0;){let i=r.shift();for(let s of i.getOutgoingEdges()){let a=s.getTarget();o[a.internalId]=Math.max(o[a.internalId],o[i.internalId]+1),e[a.internalId]--,e[a.internalId]===0&&r.push(a)}}for(let i of this.nodes)for(let s of i.getOutgoingEdges())if(o[s.target.internalId]<=o[s.source.internalId])return!1;return!0}};var lI=40,cI=-1e-10,li=class n{constructor(){this._previousLayeringNodeCounts=null,this._balance=!1,this._iterationLimit=Number.MAX_SAFE_INTEGER,this.graph=null,this._edges=null,this._treeEdges=null,this._sources=null,this._edgeVisited=null,this._postOrder=1,this._poID=null,this._lowestPoID=null,this._cutvalue=null,this._subtreeNodesStack=null}static forGraph(t){let e=new n;return e.graph=t,e}withBalancing(t){return this._balance=t,this}withPreviousLayering(t){return this._previousLayeringNodeCounts=t,this}withIterationLimit(t){return this._iterationLimit=t,this}_initialize(){let t=this.graph.nodes.length;for(let s of this.graph.nodes)s.treeNode=!1;this._poID=new Array(t).fill(0),this._lowestPoID=new Array(t).fill(0),this._sources=[];let e=0,o=[];for(let s of this.graph.nodes){s.internalId=e++,s.getIncomingEdges().length===0&&this._sources.push(s);for(let a of s.getOutgoingEdges())o.push(a)}let r=0;for(let s of o)s.internalId=r++,s.treeEdge=!1;let i=o.length;this._cutvalue==null||this._cutvalue.length<i?(this._cutvalue=new Array(i).fill(0),this._edgeVisited=new Array(i).fill(!1)):this._edgeVisited.fill(!1),this._edges=o,this._treeEdges=new Set,this._postOrder=1}_dispose(){this._cutvalue=null,this._edges=null,this._treeEdges=null,this._edgeVisited=null,this._lowestPoID=null,this._poID=null,this._sources=null,this._subtreeNodesStack=null}execute(t){let e=t||new Ie;if(e.begin("Network simplex",1),this.graph.nodes.length<1){e.done();return}for(let s of this.graph.nodes)s.layer=0;let o=this.graph.nodes.length>=lI;o&&this._removeSubtrees(),this._initialize(),this._feasibleTree();let r=this._leaveEdge(),i=0;for(;r!=null&&i<this._iterationLimit;)this._exchange(r,this._enterEdge(r)),r=this._leaveEdge(),i++;o&&this._reattachSubtrees(),this._balance?this._balanceLayering(this._normalize()):this._normalize(),this._dispose(),e.done()}_removeSubtrees(){this._subtreeNodesStack=[];let t=[];for(let e of this.graph.nodes)e.getConnectedEdges().length===1&&t.push(e);for(;t.length>0;){let e=t.shift();if(e.getConnectedEdges().length===0)continue;let o=e.getConnectedEdges()[0],r=e.getOutgoingEdges().length>0,i=o.getOther(e);al(r?i.getIncomingEdges():i.getOutgoingEdges(),o),i.getConnectedEdges().length===1&&t.push(i),this._subtreeNodesStack.push(new Gt(e,o)),al(this.graph.nodes,e)}}_reattachSubtrees(){for(;this._subtreeNodesStack.length>0;){let t=this._subtreeNodesStack.pop(),e=t.getFirst(),o=t.getSecond(),r=o.getOther(e);o.target===e?(r.getOutgoingEdges().push(o),e.layer=r.layer+o.delta):(r.getIncomingEdges().push(o),e.layer=r.layer-o.delta),this.graph.nodes.push(e)}}_feasibleTree(){if(this._layeringTopologicalNumbering(this._sources),this._edges.length>0){for(this._edgeVisited.fill(!1);this._tightTreeDFS(this.graph.nodes[0])<this.graph.nodes.length;){let t=this._minimalSlack(),e=t.getTarget().layer-t.getSource().layer-t.delta;t.getTarget().treeNode&&(e=-e);for(let o of this.graph.nodes)o.treeNode&&(o.layer+=e);this._edgeVisited.fill(!1)}this._edgeVisited.fill(!1),this._postorderTraversal(this.graph.nodes[0]),this._cutvalues()}}_layeringTopologicalNumbering(t){let e=new Array(this.graph.nodes.length).fill(0);for(let r of this.graph.nodes)e[r.internalId]+=r.getIncomingEdges().length;let o=[...t];for(;o.length>0;){let r=o.shift();for(let i of r.getOutgoingEdges()){let s=i.getTarget();s.layer=Math.max(s.layer,r.layer+i.delta),e[s.internalId]--,e[s.internalId]===0&&o.push(s)}}}_minimalSpan(t){let e=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER;for(let r of t.getConnectedEdges()){let i=r.getTarget().layer-r.getSource().layer;r.getTarget()===t&&i<o?o=i:i<e&&(e=i)}return o===Number.MAX_SAFE_INTEGER&&(o=-1),e===Number.MAX_SAFE_INTEGER&&(e=-1),new Gt(o,e)}_tightTreeDFS(t){let e=1;t.treeNode=!0;for(let o of t.getConnectedEdges())if(!this._edgeVisited[o.internalId]){this._edgeVisited[o.internalId]=!0;let r=o.getOther(t);o.treeEdge?e+=this._tightTreeDFS(r):!r.treeNode&&o.delta===o.getTarget().layer-o.getSource().layer&&(o.treeEdge=!0,this._treeEdges.add(o),e+=this._tightTreeDFS(r))}return e}_minimalSlack(){let t=Number.MAX_SAFE_INTEGER,e=null;for(let o of this._edges)if(o.getSource().treeNode!==o.getTarget().treeNode){let r=o.getTarget().layer-o.getSource().layer-o.delta;r<t&&(t=r,e=o)}return e}_postorderTraversal(t){let e=Number.MAX_SAFE_INTEGER;for(let o of t.getConnectedEdges())o.treeEdge&&!this._edgeVisited[o.internalId]&&(this._edgeVisited[o.internalId]=!0,e=Math.min(e,this._postorderTraversal(o.getOther(t))));return this._poID[t.internalId]=this._postOrder,this._lowestPoID[t.internalId]=Math.min(e,this._postOrder++),this._lowestPoID[t.internalId]}_isInHead(t,e){let o=e.getSource(),r=e.getTarget();return this._lowestPoID[o.internalId]<=this._poID[t.internalId]&&this._poID[t.internalId]<=this._poID[o.internalId]&&this._lowestPoID[r.internalId]<=this._poID[t.internalId]&&this._poID[t.internalId]<=this._poID[r.internalId]?!(this._poID[o.internalId]<this._poID[r.internalId]):this._poID[o.internalId]<this._poID[r.internalId]}_cutvalues(){let t=[];for(let e of this.graph.nodes){let o=0;e.unknownCutvalues.length=0;for(let r of e.getConnectedEdges())r.treeEdge&&(e.unknownCutvalues.push(r),o++);o===1&&t.push(e)}for(let e of t)for(;e.unknownCutvalues.length===1;){let o=e.unknownCutvalues[0];this._cutvalue[o.internalId]=o.weight;let r=o.getSource(),i=o.getTarget();for(let s of e.getConnectedEdges())s!==o&&(s.treeEdge?r===s.getSource()||i===s.getTarget()?this._cutvalue[o.internalId]-=this._cutvalue[s.internalId]-s.weight:this._cutvalue[o.internalId]+=this._cutvalue[s.internalId]-s.weight:e===r?s.getSource()===e?this._cutvalue[o.internalId]+=s.weight:this._cutvalue[o.internalId]-=s.weight:s.getSource()===e?this._cutvalue[o.internalId]-=s.weight:this._cutvalue[o.internalId]+=s.weight);al(r.unknownCutvalues,o),al(i.unknownCutvalues,o),r===e?e=o.getTarget():e=o.getSource()}}_leaveEdge(){for(let t of this._treeEdges)if(t.treeEdge&&this._cutvalue[t.internalId]<cI)return t;return null}_enterEdge(t){if(!t.treeEdge)throw new Error("The input edge is not a tree edge.");let e=null,o=Number.MAX_SAFE_INTEGER;for(let r of this._edges){let i=r.getSource(),s=r.getTarget();if(this._isInHead(i,t)&&!this._isInHead(s,t)){let a=s.layer-i.layer-r.delta;a<o&&(o=a,e=r)}}return e}_exchange(t,e){if(!t.treeEdge)throw new Error("Given leave edge is no tree edge.");if(e.treeEdge)throw new Error("Given enter edge is a tree edge already.");t.treeEdge=!1,this._treeEdges.delete(t),e.treeEdge=!0,this._treeEdges.add(e);let o=e.getTarget().layer-e.getSource().layer-e.delta;this._isInHead(e.getTarget(),t)||(o=-o);for(let r of this.graph.nodes)this._isInHead(r,t)||(r.layer+=o);this._postOrder=1,this._edgeVisited.fill(!1),this._postorderTraversal(this.graph.nodes[0]),this._cutvalues()}_normalize(){let t=Number.MIN_SAFE_INTEGER,e=Number.MAX_SAFE_INTEGER;for(let i of this.graph.nodes)e=Math.min(e,i.layer),t=Math.max(t,i.layer);let o=new Array(t-e+1).fill(0);for(let i of this.graph.nodes)i.layer-=e,o[i.layer]++;let r=0;if(this._previousLayeringNodeCounts!=null){for(let i of this._previousLayeringNodeCounts)if(o[r++]+=i,o.length===r)break}return o}_balanceLayering(t){for(let e of this.graph.nodes)if(e.getIncomingEdges().length===e.getOutgoingEdges().length){let o=e.layer,r=this._minimalSpan(e);for(let i=e.layer-r.getFirst()+1;i<e.layer+r.getSecond();i++)t[i]<t[o]&&(o=i);t[o]<t[e.layer]&&(t[e.layer]--,t[o]++,e.layer=o)}}};function al(n,t){let e=n.indexOf(t);return e>=0?(n.splice(e,1),!0):!1}var b_=1,G_=100,cd=class{constructor(){this.compactor=null,this.networkSimplexGraph=null,this.nNodes=null,this.index=0}compact(t){this.compactor=t,this.networkSimplexGraph=new Wi,this.nNodes=new Array(this.compactor.cGraph.cGroups.length).fill(null),this.index=0;for(let e of this.compactor.cGraph.cGroups){e.id=this.index;let o=He.of().id(this.index).origin(e).create(this.networkSimplexGraph);this.nNodes[this.index]=o,this.index++}this._addSeparationConstraints(),this._addEdgeConstraints(),this._addArtificialSourceNode(),li.forGraph(this.networkSimplexGraph).execute(new Ie);for(let e of this.compactor.cGraph.cNodes)e.hitbox.x=this.nNodes[e.cGroup.id].layer+e.cGroupOffset.x}_addSeparationConstraints(){for(let t of this.compactor.cGraph.cNodes)for(let e of t.constraints){if(t.cGroup===e.cGroup)continue;let o;this.compactor.direction.isHorizontal()?o=this.compactor.spacingsHandler.getHorizontalSpacing(t,e):o=this.compactor.spacingsHandler.getVerticalSpacing(t,e);let r=t.cGroupOffset.x+t.hitbox.width+o-e.cGroupOffset.x;if(r=Math.ceil(r),r=Math.max(0,r),ke.isVerticalSegmentsOfSameEdge(t,e)){let i=He.of().create(this.networkSimplexGraph),s=Math.ceil(e.cGroupOffset.x-t.cGroupOffset.x),a=s-(e.cGroupOffset.x-t.cGroupOffset.x),l=ke.getVerticalSegmentOrNull(t).aPort,c=t;l==null&&(l=ke.getVerticalSegmentOrNull(e).aPort,a=-a,c=e),l!=null&&(c.cGroupOffset.x-=a,l.getPosition().x-=a),ee.of().delta(Math.max(0,s)).weight(b_).source(i).target(this.nNodes[t.cGroup.id]).create(),ee.of().delta(Math.max(0,-s)).weight(b_).source(i).target(this.nNodes[e.cGroup.id]).create()}else{let i=b_;(t.origin instanceof we&&e.origin instanceof ft||e.origin instanceof we&&t.origin instanceof ft)&&(i=2),ee.of().delta(r).weight(i).source(this.nNodes[t.cGroup.id]).target(this.nNodes[e.cGroup.id]).create()}}}_addEdgeConstraints(){let t=new Map,e=new Map;for(let o of this.compactor.cGraph.cNodes){let r=ke.getLNodeOrNull(o);if(r!=null)t.set(r,o);else{let i=ke.getVerticalSegmentOrNull(o);if(i!=null)for(let s of i.representedLEdges){let a=e.get(s);a==null&&(a=new Set,e.set(s,a)),a.add(o)}}}for(let o of this.compactor.cGraph.cNodes){let r=ke.getLNodeOrNull(o);if(r!=null)for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;let s=i.getSource(),a=i.getTarget();if(u.SIDES_NORTH_SOUTH.has(s.getSide())&&u.SIDES_NORTH_SOUTH.has(a.getSide()))continue;let l=t.get(a.getNode());if(l!=null){if(ee.of().delta(0).weight(G_).source(this.nNodes[o.cGroup.id]).target(this.nNodes[l.cGroup.id]).create(),s.getSide()===u.WEST&&rt.OUTPUT_PREDICATE(s)){let c=e.get(i);if(c!=null){for(let g of c)if(g.hitbox.x<o.hitbox.x){let h=this.nNodes[g.cGroup.id],d=this.nNodes[o.cGroup.id];if(h===d)continue;ee.of().delta(1).weight(G_).source(h).target(d).create()}}}if(a.getSide()===u.EAST&&rt.INPUT_PREDICATE(a)){let c=e.get(i);if(c!=null){for(let g of c)if(g.hitbox.x>o.hitbox.x){let h=this.nNodes[o.cGroup.id],d=this.nNodes[g.cGroup.id];if(h===d)continue;ee.of().delta(1).weight(G_).source(h).target(d).create()}}}}}}}_addArtificialSourceNode(){let t=[];for(let e of this.networkSimplexGraph.nodes)e.getIncomingEdges().length===0&&t.push(e);if(t.length>1){let e=He.of().id(this.index++).create(this.networkSimplexGraph);for(let o of t)ee.of().delta(1).weight(0).source(e).target(o).create()}}};var ke=class n{constructor(){this._lGraph=null}process(t,e){let o=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY);if(o==null||o===ie.NONE)return;e.begin("Horizontal Compaction",1),this._lGraph=t;let r=new ad,i=new Br(r.transform(t));switch(i.setSpacingsHandler(this._createSpacingsHandler()),t.getProperty(_.COMPACTION_POST_COMPACTION_CONSTRAINTS)===Ur.SCANLINE?i.setConstraintAlgorithm(new nd(this._lGraph)):i.setConstraintAlgorithm(Br.QUADRATIC_CONSTRAINTS),o){case ie.LEFT:i.compact();break;case ie.RIGHT:i.changeDirection(R.RIGHT).compact();break;case ie.LEFT_RIGHT_CONSTRAINT_LOCKING:i.compact().changeDirection(R.RIGHT).setLockFunction((a,l)=>a.cGroup.outDegreeReal===0).compact();break;case ie.LEFT_RIGHT_CONNECTION_LOCKING:i.compact().changeDirection(R.RIGHT).setLockFunction((a,l)=>r.getLockMap().get(a).getDirection(l)).compact();break;case ie.EDGE_LENGTH:i.setCompactionAlgorithm(n.NETWORK_SIMPLEX_COMPACTION).compact();break;default:break}i.finish(),r.applyLayout(),e.done()}static isVerticalSegmentsOfSameEdge(t,e){let o=n.getVerticalSegmentOrNull(t),r=n.getVerticalSegmentOrNull(e);if(o==null||r==null)return!1;for(let i of o.representedLEdges)if(r.representedLEdges.includes(i))return!0;return!1}static getLNodeOrNull(t){return t.origin instanceof ft?t.origin:null}static getVerticalSegmentOrNull(t){return t.origin instanceof we?t.origin:null}_createSpacingsHandler(){let t=this;return{getHorizontalSpacing(e,o){if(n.isVerticalSegmentsOfSameEdge(e,o))return 0;let r=n.getLNodeOrNull(e),i=n.getLNodeOrNull(o);return r!=null&&r.getType()===y.EXTERNAL_PORT||i!=null&&i.getType()===y.EXTERNAL_PORT?0:t._lGraph.getProperty(p.SPACINGS).getHorizontalSpacing(r!=null?r.getType():y.LONG_EDGE,i!=null?i.getType():y.LONG_EDGE)},getVerticalSpacing(e,o){if(n.isVerticalSegmentsOfSameEdge(e,o))return 1;let r=n.getLNodeOrNull(e),i=n.getLNodeOrNull(o);return t._lGraph.getProperty(p.SPACINGS).getVerticalSpacing(r!=null?r.getType():y.LONG_EDGE,i!=null?i.getType():y.LONG_EDGE)}}}};ke.NETWORK_SIMPLEX_COMPACTION=new cd;var Ds=class{constructor(t){this._maxNum=t,this._binarySums=new Int32Array(t+1),this._numsPerIndex=new Int32Array(t),this._size=0}add(t){this._size++,this._numsPerIndex[t]++;let e=t+1;for(;e<this._binarySums.length;)this._binarySums[e]++,e+=e&-e}rank(t){let e=t,o=0;for(;e>0;)o+=this._binarySums[e],e-=e&-e;return o}size(){return this._size}removeAll(t){let e=this._numsPerIndex[t];if(e===0)return;this._numsPerIndex[t]=0,this._size-=e;let o=t+1;for(;o<this._binarySums.length;)this._binarySums[o]-=e,o+=o&-o}clear(){this._binarySums=new Int32Array(this._maxNum+1),this._numsPerIndex=new Int32Array(this._maxNum),this._size=0}isEmpty(){return this._size===0}};function zi(n,t){switch(t){case u.EAST:case u.NORTH:return n.getPortSideView(t);case u.SOUTH:case u.WEST:return[...n.getPortSideView(t)].reverse();default:return[]}}var gd={inNorthSouthEastWestOrder:zi};var Fr=class{constructor(t){this._portPositions=t,this._indexTree=null,this._ends=[],this._nodeCardinalities=null}countCrossingsBetweenLayers(t,e){let o=this._initPortPositionsCounterClockwise(t,e);return this._indexTree=new Ds(o.length),this._countCrossingsOnPorts(o)}countInLayerCrossingsOnSide(t,e){let o=this.initPortPositionsForInLayerCrossings(t,e);return this._countInLayerCrossingsOnPorts(o)}countNorthSouthPortCrossingsInLayer(t){let e=this._initPositionsForNorthSouthCounting(t);return this._indexTree=new Ds(e.length),this._countNorthSouthCrossingsOnPorts(e)}countCrossingsBetweenPortsInBothOrders(t,e){let o=this._connectedPortsSortedByPosition(t,e),r=this._countCrossingsOnPorts(o);this._indexTree.clear(),this.switchPorts(t,e),o.sort((s,a)=>this._positionOf(s)-this._positionOf(a));let i=this._countCrossingsOnPorts(o);return this._indexTree.clear(),this.switchPorts(e,t),Gt.of(r,i)}countInLayerCrossingsBetweenNodesInBothOrders(t,e,o){let r=this._connectedInLayerPortsSortedByPosition(t,e,o),i=this._countInLayerCrossingsOnPorts(r);this.switchNodes(t,e,o),this._indexTree.clear(),r.sort((a,l)=>this._positionOf(a)-this._positionOf(l));let s=this._countInLayerCrossingsOnPorts(r);return this.switchNodes(e,t,o),this._indexTree.clear(),Gt.of(i,s)}initForCountingBetween(t,e){let o=this._initPortPositionsCounterClockwise(t,e);this._indexTree=new Ds(o.length)}initPortPositionsForInLayerCrossings(t,e){let o=[];return this._initPositions(t,o,e,!0,!0),this._indexTree=new Ds(o.length),o}switchPorts(t,e){let o=this._portPositions[t.id];this._portPositions[t.id]=this._portPositions[e.id],this._portPositions[e.id]=o}switchNodes(t,e,o){for(let r of gd.inNorthSouthEastWestOrder(t,o))this._portPositions[r.id]=this._positionOf(r)+this._nodeCardinalities[e.id];for(let r of gd.inNorthSouthEastWestOrder(e,o))this._portPositions[r.id]=this._positionOf(r)-this._nodeCardinalities[t.id]}_connectedInLayerPortsSortedByPosition(t,e,o){let r=new Set,i=s=>r.add(s);for(let s of[t,e])for(let a of gd.inNorthSouthEastWestOrder(s,o))for(let l of a.getConnectedEdges())l.isSelfLoop()||(i(a),this._isInLayer(l)&&i(this._otherEndOf(l,a)));return[...r].sort((s,a)=>this._positionOf(s)-this._positionOf(a))}_connectedPortsSortedByPosition(t,e){let o=new Set;for(let r of[t,e]){o.add(r);for(let i of r.getConnectedEdges())this._isPortSelfLoop(i)||o.add(this._otherEndOf(i,r))}return[...o].sort((r,i)=>this._positionOf(r)-this._positionOf(i))}_countCrossingsOnPorts(t){let e=0;for(let o of t){this._indexTree.removeAll(this._positionOf(o));for(let r of o.getConnectedEdges()){let i=this._positionOf(this._otherEndOf(r,o));i>this._positionOf(o)&&(e+=this._indexTree.rank(i),this._ends.push(i))}for(;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_countInLayerCrossingsOnPorts(t){let e=0;for(let o of t){this._indexTree.removeAll(this._positionOf(o));let r=0;for(let i of o.getConnectedEdges())if(this._isInLayer(i)){let s=this._positionOf(this._otherEndOf(i,o));s>this._positionOf(o)&&(e+=this._indexTree.rank(s),this._ends.push(s))}else r++;for(e+=this._indexTree.size()*r;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_countNorthSouthCrossingsOnPorts(t){let e=0,o=[];for(let r of t){switch(this._indexTree.removeAll(this._positionOf(r)),o.length=0,r.getNode().getType()){case y.NORMAL:{let i=r.getProperty(p.PORT_DUMMY);if(i!=null)for(let s of i.getPorts())o.push([s,s.getDegree()]);break}case y.LONG_EDGE:{for(let i of r.getNode().getPorts())if(i!==r){o.push([i,i.getDegree()]);break}break}case y.NORTH_SOUTH_PORT:{let i=r.getProperty(p.ORIGIN);i!=null&&o.push([i,r.getDegree()]);break}default:break}for(let[i,s]of o){let a=this._positionOf(i);a>this._positionOf(r)&&(e+=this._indexTree.rank(a)*s,this._ends.push(a))}for(;this._ends.length>0;)this._indexTree.add(this._ends.pop())}return e}_initPositions(t,e,o,r,i){let s=e.length;i&&(this._nodeCardinalities=new Int32Array(t.length));let a=r?0:t.length-1,l=r?1:-1,c=g=>r?g<t.length:g>=0;for(let g=a;c(g);g+=l){let h=t[g],d=this._getPorts(h,o,r);i&&(this._nodeCardinalities[h.id]=d.length);for(let f of d)this._portPositions[f.id]=s++;for(let f of d)e.push(f)}}_initPortPositionsCounterClockwise(t,e){let o=[];return this._initPositions(t,o,u.EAST,!0,!1),this._initPositions(e,o,u.WEST,!1,!1),o}_initPositionsForNorthSouthCounting(t){let e=[],o=[],r=null,i=0;for(let s=0;s<t.length;s++){let a=t[s];switch(this._isLayoutUnitChanged(r,a)&&(i=this._emptyStack(o,e,hd,i)),a.hasProperty(p.IN_LAYER_LAYOUT_UNIT)&&(r=a.getProperty(p.IN_LAYER_LAYOUT_UNIT)),a.getType()){case y.NORMAL:for(let l of this._getNorthSouthPortsWithIncidentEdges(a,u.NORTH))this._portPositions[l.id]=i++,e.push(l);i=this._emptyStack(o,e,hd,i);for(let l of this._getNorthSouthPortsWithIncidentEdges(a,u.SOUTH))this._portPositions[l.id]=i++,e.push(l);break;case y.NORTH_SOUTH_PORT:{let l=a.getPortSideView(gI);if(l.length>0){let c=l[0];this._portPositions[c.id]=i++,e.push(c)}a.getPortSideView(hd).length>0&&o.push(a);break}case y.LONG_EDGE:{for(let l of a.getPortSideView(u.WEST))this._portPositions[l.id]=i++,e.push(l);for(let l of a.getPortSideView(u.EAST))o.push(a);break}default:break}}return this._emptyStack(o,e,hd,i),e}_emptyStack(t,e,o,r){let i=r;for(;t.length>0;){let a=t.pop().getPortSideView(o);if(a.length>0){let l=a[0];this._portPositions[l.id]=i++,e.push(l)}}return i}_getPorts(t,e,o){return e===u.EAST?o?t.getPortSideView(e):[...t.getPortSideView(e)].reverse():o?[...t.getPortSideView(e)].reverse():t.getPortSideView(e)}*_getNorthSouthPortsWithIncidentEdges(t,e){for(let o of t.getPortSideView(e))o.hasProperty(p.PORT_DUMMY)&&(yield o)}_isInLayer(t){return t.getSource().getNode().getLayer()===t.getTarget().getNode().getLayer()}_positionOf(t){return this._portPositions[t.id]}_otherEndOf(t,e){return e===t.getSource()?t.getTarget():t.getSource()}_isPortSelfLoop(t){return t.getSource()===t.getTarget()}_isLayoutUnitChanged(t,e){return t==null||t===e||!e.hasProperty(p.IN_LAYER_LAYOUT_UNIT)?!1:e.getProperty(p.IN_LAYER_LAYOUT_UNIT)!==t}},gI=u.WEST,hd=u.EAST;var dd=class{constructor(t,e,o){this._portPos=o}countCrossings(t,e){let o=this._portPos,r=0;for(let A of t)for(let B of A.getPorts()){let Y=0;for(let j of B.getOutgoingEdges())A.getLayer()!==j.getTarget().getNode().getLayer()&&Y++;Y>0&&(o[B.id]=r++)}let i=0;for(let A of e){let B=0;for(let X of A.getPorts())if(X.getSide()===u.NORTH){for(let tt of X.getIncomingEdges())if(A.getLayer()!==tt.getSource().getNode().getLayer()){B++;break}}else break;let Y=0,j=A.getPorts();for(let X=j.length-1;X>=0;X--){let tt=j[X],ot=0;for(let Lt of tt.getIncomingEdges())A.getLayer()!==Lt.getSource().getNode().getLayer()&&ot++;ot>0&&(tt.getSide()===u.NORTH?(o[tt.id]=i,i++):(o[tt.id]=i+B+Y,Y++))}i+=Y}let s=new Map,a=new Set,l=0;for(let A of t)for(let B of A.getPorts())for(let Y of B.getOutgoingEdges()){let j=Y.getTarget();if(A.getLayer()!==j.getNode().getLayer()){let X=s.get(B),tt=s.get(j);if(X==null&&tt==null){let ot=new H_(l++);a.add(ot),ot.edges.push(Y),ot.ports.push(B),s.set(B,ot),ot.ports.push(j),s.set(j,ot)}else if(X==null)tt.edges.push(Y),tt.ports.push(B),s.set(B,tt);else if(tt==null)X.edges.push(Y),X.ports.push(j),s.set(j,X);else if(X===tt)X.edges.push(Y);else{X.edges.push(Y);for(let ot of tt.ports)s.set(ot,X);for(let ot of tt.edges)X.edges.push(ot);for(let ot of tt.ports)X.ports.push(ot);a.delete(tt)}}}let c=[...a],g=t[0].getLayer(),h=e[0].getLayer();for(let A of c){A.upperLeft=r,A.upperRight=i,A.lowerLeft=0,A.lowerRight=0;for(let B of A.ports){let Y=o[B.id];B.getNode().getLayer()===g?(Y<A.upperLeft&&(A.upperLeft=Y),Y>A.lowerLeft&&(A.lowerLeft=Y)):B.getNode().getLayer()===h&&(Y<A.upperRight&&(A.upperRight=Y),Y>A.lowerRight&&(A.lowerRight=Y))}}c.sort((A,B)=>A.upperLeft!==B.upperLeft?A.upperLeft-B.upperLeft:A.upperRight!==B.upperRight?A.upperRight-B.upperRight:A.id-B.id);let d=new Int32Array(c.length),f=new Int32Array(i+1);for(let A=0;A<c.length;A++)d[A]=c[A].upperRight,f[d[A]]=1;let E=0;for(let A=0;A<f.length;A++)f[A]===1?f[A]=E:E--;let P=0;for(let A=0;A<d.length;A++)d[A]+=f[d[A]],d[A]+1>P&&(P=d[A]+1);let S=1;for(;S<P;)S*=2;let T=2*S-1;S-=1;let N=new Int32Array(T),I=0;for(let A=0;A<d.length;A++){let B=d[A]+S;for(N[B]++;B>0;)B%2>0&&(I+=N[B+1]),B=B-1>>1,N[B]++}let C=new Array(c.length*2);for(let A=0;A<c.length;A++)C[2*A]=new jn(c[A],c[A].upperLeft,c[A].lowerLeft,kr.UPPER),C[2*A+1]=new jn(c[A],c[A].lowerLeft,c[A].upperLeft,kr.LOWER);C.sort(IP);let x=0;for(let A of C)A.type===kr.UPPER?x++:(x--,I+=x);let M=new Array(c.length*2);for(let A=0;A<c.length;A++)M[2*A]=new jn(c[A],c[A].upperRight,c[A].lowerRight,kr.UPPER),M[2*A+1]=new jn(c[A],c[A].lowerRight,c[A].upperRight,kr.LOWER);M.sort(IP),x=0;for(let A of M)A.type===kr.UPPER?x++:(x--,I+=x);return I}},H_=class{constructor(t){this.id=t,this.edges=[],this.ports=[],this.upperLeft=0,this.lowerLeft=0,this.upperRight=0,this.lowerRight=0}},kr=Object.freeze({UPPER:"UPPER",LOWER:"LOWER"}),jn=class{constructor(t,e,o,r){this.hyperedge=t,this.position=e,this.oppositePosition=o,this.type=r}};function IP(n,t){return n.position!==t.position?n.position-t.position:n.oppositePosition!==t.oppositePosition?n.oppositePosition-t.oppositePosition:n.hyperedge!==t.hyperedge?n.hyperedge.id-t.hyperedge.id:n.type===kr.UPPER&&t.type===kr.LOWER?-1:n.type===kr.LOWER&&t.type===kr.UPPER?1:0}var fd=class{constructor(t){this._inLayerEdgeCounts=new Int32Array(t.length),this._hasNorthSouthPorts=new Array(t.length).fill(!1),this._hasHyperEdgesEastOfIndex=new Array(t.length).fill(!1),this._nPorts=0,this._crossingCounter=null,this._hyperedgeCrossingsCounter=null}countAllCrossings(t){if(t.length===0)return 0;let e=this._crossingCounter.countInLayerCrossingsOnSide(t[0],u.WEST);e+=this._crossingCounter.countInLayerCrossingsOnSide(t[t.length-1],u.EAST);for(let o=0;o<t.length;o++)e+=this._countCrossingsAt(o,t);return e}_countCrossingsAt(t,e){let o=0,r=e[t];if(t<e.length-1){let i=e[t+1];this._hasHyperEdgesEastOfIndex[t]?(o=this._hyperedgeCrossingsCounter.countCrossings(r,i),o+=this._crossingCounter.countInLayerCrossingsOnSide(r,u.EAST),o+=this._crossingCounter.countInLayerCrossingsOnSide(i,u.WEST)):o=this._crossingCounter.countCrossingsBetweenLayers(r,i)}return this._hasNorthSouthPorts[t]&&(o+=this._crossingCounter.countNorthSouthPortCrossingsInLayer(r)),o}initAtNodeLevel(t,e,o){o[t][e].getType()===y.NORTH_SOUTH_PORT&&(this._hasNorthSouthPorts[t]=!0)}initAtPortLevel(t,e,o,r){let i=r[t][e].getPorts()[o];i.id=this._nPorts++,i.getOutgoingEdges().length+i.getIncomingEdges().length>1&&(i.getSide()===u.EAST?this._hasHyperEdgesEastOfIndex[t]=!0:i.getSide()===u.WEST&&t>0&&(this._hasHyperEdgesEastOfIndex[t-1]=!0))}initAtEdgeLevel(t,e,o,r,i,s){let a=s[t][e].getPorts()[o];i.getSource()===a&&i.getSource().getNode().getLayer()===i.getTarget().getNode().getLayer()&&this._inLayerEdgeCounts[t]++}initAfterTraversal(){let t=new Int32Array(this._nPorts);this._hyperedgeCrossingsCounter=new dd(this._inLayerEdgeCounts,this._hasNorthSouthPorts,t),this._crossingCounter=new Fr(t)}};function hI(n,t){for(let e=0;e<t.length;e++){for(let o of n)typeof o.initAtLayerLevel=="function"&&o.initAtLayerLevel(e,t);for(let o=0;o<t[e].length;o++){for(let i of n)typeof i.initAtNodeLevel=="function"&&i.initAtNodeLevel(e,o,t);let r=t[e][o].getPorts();for(let i=0;i<r.length;i++){for(let l of n)typeof l.initAtPortLevel=="function"&&l.initAtPortLevel(e,o,i,t);let s=r[i],a=0;for(let l of s.getConnectedEdges()){for(let c of n)typeof c.initAtEdgeLevel=="function"&&c.initAtEdgeLevel(e,o,i,a,l,t);a++}}}}for(let e of n)typeof e.initAfterTraversal=="function"&&e.initAfterTraversal()}var ud={init:hI};var _d=class{constructor(t){this.node=t,this.summedWeight=0,this.degree=0,this.barycenter=null,this.visited=!1}toString(){return`BarycenterState [node=${this.node}, summedWeight=${this.summedWeight}, degree=${this.degree}, barycenter=${this.barycenter}, visited=${this.visited}]`}},ll=class{constructor(t){this._constraintsBetweenNonDummies=!1,t.length>0&&t[0].length>0&&(this._constraintsBetweenNonDummies=t[0][0].getGraph().getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS_BETWEEN_NON_DUMMIES)),this.barycenterStates=new Array(t.length),this.constraintGroups=new Array(t.length),this.layoutUnits=new Map}initAtLayerLevel(t,e){this.barycenterStates[t]=new Array(e[t].length),this.constraintGroups[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){this._initAtNode(o[t][e],!0)}_initAtNode(t,e){let o=t.getLayer().id,r=t.id;if(this.constraintGroups[o][r]=new pd(this,t),e){this.barycenterStates[o][r]=new _d(t);let i=t.getProperty(p.IN_LAYER_LAYOUT_UNIT);if(i!=null){let s=this.layoutUnits.get(i);s==null&&(s=[],this.layoutUnits.set(i,s)),s.push(t)}}}getBarycenterStates(){return this.barycenterStates}processConstraints(t){if(this._constraintsBetweenNonDummies){this._processConstraints(t,!0);for(let e of t)this._initAtNode(e,!1)}this._processConstraints(t,!1)}_processConstraints(t,e){let o=new Array(t.length);for(let i=0;i<t.length;i++){let s=t[i];o[i]=this.constraintGroups[s.getLayer().id][s.id]}this._buildConstraintsGraph(o,e);let r;for(;(r=this._findViolatedConstraint(o))!=null;)this._handleViolatedConstraint(r.first,r.second,o);t.length=0;for(let i of o)for(let s of i.getNodes())t.push(s),this._stateOf(s).barycenter=i.getBarycenter()}_buildConstraintsGraph(t,e){for(let r of t)r.resetOutgoingConstraints(),r.incomingConstraintsCount=0;let o=null;for(let r of t){let i=r.getNode();if(!(e&&i.getType()!==y.NORMAL)){for(let s of i.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS))(!e||s.getType()===y.NORMAL)&&(r.getOutgoingConstraints().push(this._groupOf(s)),this._groupOf(s).incomingConstraintsCount++);if(!e&&i.getType()===y.NORMAL){if(o!=null){let s=this.layoutUnits.get(o)||[],a=this.layoutUnits.get(i)||[];for(let l of s)for(let c of a)this._groupOf(l).getOutgoingConstraints().push(this._groupOf(c)),this._groupOf(c).incomingConstraintsCount++}o=i}}}}_findViolatedConstraint(t){let e=null;for(let o of t)o.resetIncomingConstraints(),o.hasOutgoingConstraints()&&o.incomingConstraintsCount===0&&(e==null&&(e=[]),e.push(o));if(e!=null)for(;e.length>0;){let o=e.shift();if(o.hasIncomingConstraints()){for(let r of o.getIncomingConstraints())if(r.getBarycenter()===o.getBarycenter()){if(t.indexOf(r)>t.indexOf(o))return Gt.of(r,o)}else if(r.getBarycenter()>o.getBarycenter())return Gt.of(r,o)}for(let r of o.getOutgoingConstraints()){let i=r.getIncomingConstraints();i.unshift(o),r.incomingConstraintsCount===i.length&&e.push(r)}}return null}_handleViolatedConstraint(t,e,o){let r=pd.merge(this,t,e),i=!1,s=0;for(;s<o.length;){let a=o[s];if(a===t||a===e){o.splice(s,1);continue}if(!i&&a.getBarycenter()>r.getBarycenter()){o.splice(s,0,r),i=!0,s++;continue}if(a.hasOutgoingConstraints()){let l=a.getOutgoingConstraints(),c=Ed(l,t),g=Ed(l,e);(c||g)&&(l.push(r),r.incomingConstraintsCount++)}s++}i||o.push(r)}_groupOf(t){return this.constraintGroups[t.getLayer().id][t.id]}_stateOf(t){return this.barycenterStates[t.getLayer().id][t.id]}},RP=1e-4,pd=class n{constructor(t,e){this._resolver=t,this.nodes=[e],this.summedWeight=0,this.degree=0,this.outgoingConstraints=null,this.incomingConstraints=null,this.incomingConstraintsCount=0}static merge(t,e,o){let r=Object.create(n.prototype);if(r._resolver=t,r.nodes=e.nodes.concat(o.nodes),r.summedWeight=e.summedWeight+o.summedWeight,r.degree=e.degree+o.degree,r.outgoingConstraints=null,r.incomingConstraints=null,r.incomingConstraintsCount=0,e.outgoingConstraints!=null){if(r.outgoingConstraints=e.outgoingConstraints.slice(),Ed(r.outgoingConstraints,o),o.outgoingConstraints!=null)for(let s of o.outgoingConstraints)s!==e&&(r.outgoingConstraints.indexOf(s)>=0?s.incomingConstraintsCount--:r.outgoingConstraints.push(s))}else o.outgoingConstraints!=null&&(r.outgoingConstraints=o.outgoingConstraints.slice(),Ed(r.outgoingConstraints,e));r.degree>0?r.setBarycenter(r.summedWeight/r.degree):e.getBarycenter()!=null&&o.getBarycenter()!=null?r.setBarycenter((e.getBarycenter()+o.getBarycenter())/2):e.getBarycenter()!=null?r.setBarycenter(e.getBarycenter()):o.getBarycenter()!=null&&r.setBarycenter(o.getBarycenter());let i=r.getBarycenter();if(i!=null){let s=o.getBarycenter(),a=e.getBarycenter();if(s!=null&&i+RP<s)throw new Error("merged barycenter fell below second group barycenter");if(a!=null&&i-RP>a)throw new Error("merged barycenter rose above first group barycenter")}return r}setBarycenter(t){for(let e of this.nodes)this._resolver._stateOf(e).barycenter=t}getBarycenter(){return this._resolver._stateOf(this.nodes[0]).barycenter}getOutgoingConstraints(){return this.outgoingConstraints==null&&(this.outgoingConstraints=[]),this.outgoingConstraints}resetOutgoingConstraints(){this.outgoingConstraints=null}hasOutgoingConstraints(){return this.outgoingConstraints!=null&&this.outgoingConstraints.length>0}getIncomingConstraints(){return this.incomingConstraints==null&&(this.incomingConstraints=[]),this.incomingConstraints}resetIncomingConstraints(){this.incomingConstraints=null}hasIncomingConstraints(){return this.incomingConstraints!=null&&this.incomingConstraints.length>0}getNodes(){return this.nodes}getNode(){if(this.nodes.length!==1)throw new Error("ConstraintGroup.getNode called on a multi-node group");return this.nodes[0]}toString(){let t="[";for(let e=0;e<this.nodes.length;e++){t+=this.nodes[e].toString();let o=this.getBarycenter();o!=null&&(t+=`<${o}>`),e<this.nodes.length-1&&(t+=", ")}return t+"]"}};function Ed(n,t){let e=n.indexOf(t);return e<0?!1:(n.splice(e,1),!0)}var LP=.07,$n=class{constructor(t,e,o,r){this.constraintResolver=t,this.random=e,this.portDistributor=o,this.portRanks=null,this.barycenterState=null,this.barycenterStateComparator=(i,s)=>{let a=this.stateOf(i),l=this.stateOf(s);return a.barycenter!=null&&l.barycenter!=null?a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:0:a.barycenter!=null?-1:l.barycenter!=null?1:0}}minimizeCrossingsList(t,e,o,r){if(o?this.randomizeBarycenters(t):(this.calculateBarycenters(t,r),this.fillInUnknownBarycenters(t,e)),t.length>1){if(t[0].getGraph().getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER))throw new Error("CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER requires ModelOrderBarycenterHeuristic");t.sort(this.barycenterStateComparator),this.constraintResolver.processConstraints(t)}}randomizeBarycenters(t){for(let e of t){let o=this.stateOf(e);o.barycenter=this.random.nextDouble(),o.summedWeight=o.barycenter,o.degree=1}}fillInUnknownBarycenters(t,e){if(e){let o=-1;for(let r=0;r<t.length;r++){let i=t[r],s=this.stateOf(i),a=s.barycenter;if(a==null){let l=o+1;for(let c=r+1;c<t.length;c++){let g=this.stateOf(t[c]).barycenter;if(g!=null){l=g;break}}a=(o+l)/2,s.barycenter=a,s.summedWeight=a,s.degree=1}o=a}}else{let o=0;for(let r of t){let i=this.stateOf(r).barycenter;i!=null&&(o=Math.max(o,i))}o+=2;for(let r of t){let i=this.stateOf(r);if(i.barycenter==null){let s=this.random.nextFloat()*o-1;i.barycenter=s,i.summedWeight=s,i.degree=1}}}}calculateBarycenters(t,e){for(let o of t)this.stateOf(o).visited=!1;for(let o of t)this._calculateBarycenter(o,e)}_calculateBarycenter(t,e){let o=this.stateOf(t);if(o.visited)return;o.visited=!0,o.degree=0,o.summedWeight=0,o.barycenter=null;for(let i of t.getPorts()){let s=e?i.getPredecessorPorts():i.getSuccessorPorts();for(let a of s){let l=a.getNode();if(l.getLayer()===t.getLayer()){if(l!==t){this._calculateBarycenter(l,e);let c=this.stateOf(l);o.degree+=c.degree,o.summedWeight+=c.summedWeight}}else o.summedWeight+=this.portRanks[a.id],o.degree++}}let r=t.getProperty(p.BARYCENTER_ASSOCIATES);if(r!=null){for(let i of r)if(t.getLayer()===i.getLayer()){this._calculateBarycenter(i,e);let s=this.stateOf(i);o.degree+=s.degree,o.summedWeight+=s.summedWeight}}o.degree>0&&(o.summedWeight+=this.random.nextFloat()*LP-LP/2,o.barycenter=o.summedWeight/o.degree)}stateOf(t){return this.barycenterState[t.getLayer().id][t.id]}minimizeCrossings(t,e,o,r){if(!this._isFirstLayer(t,e,o)){let l=t[e-fI(o)];this.portDistributor.calculatePortRanksLayer(l,uI(o))}let i=t[e][0],s=!r||dI(i),a=Array.from(t[e]);this.minimizeCrossingsList(a,s,!1,o);for(let l=0;l<a.length;l++)t[e][l]=a[l];return!1}setFirstLayerOrder(t,e){let o=AP(e,t.length),r=Array.from(t[o]);this.minimizeCrossingsList(r,!1,!0,e);for(let i=0;i<r.length;i++)t[o][i]=r[i];return!1}alwaysImproves(){return!1}isDeterministic(){return!1}_isFirstLayer(t,e,o){return e===AP(o,t.length)}initAfterTraversal(){this.barycenterState=this.constraintResolver.getBarycenterStates(),this.portRanks=this.portDistributor.getPortRanks()}initAtLayerLevel(t,e){e[t][0].getLayer().id=t}};function dI(n){return n.getType()===y.EXTERNAL_PORT}function fI(n){return n?1:-1}function uI(n){return n?W.OUTPUT:W.INPUT}function AP(n,t){return n?0:Math.max(0,t-1)}var qn=class{constructor(t,e){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._portPositions=new Map,this._easternAdjacencies=new Map,this._westernAdjacencies=new Map,this._currentNodeOrder=t,this._freeLayerIndex=e,this._upperAdjacencies=null,this._lowerAdjacencies=null,this._setPortPositionsForNeighbouringLayers()}_setPortPositionsForNeighbouringLayers(){this._freeLayerIsNotFirstLayer()&&this._setPortPositionsForLayer(this._freeLayerIndex-1,u.EAST),this._freeLayerIsNotLastLayer()&&this._setPortPositionsForLayer(this._freeLayerIndex+1,u.WEST)}_freeLayerIsNotFirstLayer(){return this._freeLayerIndex>0}_freeLayerIsNotLastLayer(){return this._freeLayerIndex<this._currentNodeOrder.length-1}_setPortPositionsForLayer(t,e){let o=0;for(let r of this._currentNodeOrder[t]){let i=zi(r,e);for(let s of i)this._portPositions.set(s,o++)}}countEasternEdgeCrossings(t,e){this._resetCrossingCount(),t!==e&&this._addEasternCrossings(t,e)}countWesternEdgeCrossings(t,e){this._resetCrossingCount(),t!==e&&this._addWesternCrossings(t,e)}countBothSideCrossings(t,e){this._resetCrossingCount(),t!==e&&(this._addWesternCrossings(t,e),this._addEasternCrossings(t,e))}_resetCrossingCount(){this._upperLowerCrossings=0,this._lowerUpperCrossings=0}_addEasternCrossings(t,e){this._upperAdjacencies=this._getAdjacencyFor(t,u.EAST,this._easternAdjacencies),this._lowerAdjacencies=this._getAdjacencyFor(e,u.EAST,this._easternAdjacencies),!(this._upperAdjacencies.size()===0||this._lowerAdjacencies.size()===0)&&this._countCrossingsByMergingAdjacencyLists()}_addWesternCrossings(t,e){this._upperAdjacencies=this._getAdjacencyFor(t,u.WEST,this._westernAdjacencies),this._lowerAdjacencies=this._getAdjacencyFor(e,u.WEST,this._westernAdjacencies),!(this._upperAdjacencies.size()===0||this._lowerAdjacencies.size()===0)&&this._countCrossingsByMergingAdjacencyLists()}_getAdjacencyFor(t,e,o){if(o.size===0)for(let i of this._currentNodeOrder[this._freeLayerIndex])o.set(i,new v_(i,e,this._portPositions));let r=o.get(t);return r.reset(),r}_countCrossingsByMergingAdjacencyLists(){for(;!this._upperAdjacencies.isEmpty()&&!this._lowerAdjacencies.isEmpty();)CP(this._upperAdjacencies.first(),this._lowerAdjacencies.first())?(this._upperLowerCrossings+=this._upperAdjacencies.size(),this._lowerAdjacencies.removeFirst()):CP(this._lowerAdjacencies.first(),this._upperAdjacencies.first())?(this._lowerUpperCrossings+=this._lowerAdjacencies.size(),this._upperAdjacencies.removeFirst()):(this._upperLowerCrossings+=this._upperAdjacencies.countAdjacenciesBelowNodeOfFirstPort(),this._lowerUpperCrossings+=this._lowerAdjacencies.countAdjacenciesBelowNodeOfFirstPort(),this._upperAdjacencies.removeFirst(),this._lowerAdjacencies.removeFirst())}getUpperLowerCrossings(){return this._upperLowerCrossings}getLowerUpperCrossings(){return this._lowerUpperCrossings}};function CP(n,t){return n>t}var v_=class{constructor(t,e,o){this._node=t,this._side=e,this._portPositions=o,this._adjacencies=[],this._size=0,this._currentSize=0,this._currentIndex=0,this._collectSortedAdjacencies()}_collectSortedAdjacencies(){let t=zi(this._node,this._side);for(let e of t){let o=this._side===u.WEST?e.getIncomingEdges():e.getOutgoingEdges();for(let r of o)r.isSelfLoop()||r.getSource().getNode().getLayer()!==r.getTarget().getNode().getLayer()&&(this._addAdjacencyOf(r),this._size++,this._currentSize++)}this._adjacencies.sort((e,o)=>e.position-o.position)}_addAdjacencyOf(t){let e=this._side===u.WEST?t.getSource():t.getTarget(),o=this._portPositions.get(e),r=this._adjacencies.length-1;this._adjacencies.length>0&&this._adjacencies[r].position===o?(this._adjacencies[r].cardinality++,this._adjacencies[r].currentCardinality++):this._adjacencies.push(new B_(o))}reset(){this._currentIndex=0,this._currentSize=this._size,this.isEmpty()||this._currentAdjacency().reset()}countAdjacenciesBelowNodeOfFirstPort(){return this._currentSize-this._currentAdjacency().currentCardinality}removeFirst(){if(this.isEmpty())return;let t=this._currentAdjacency();t.currentCardinality===1?this._incrementCurrentIndex():t.currentCardinality--,this._currentSize--}_incrementCurrentIndex(){this._currentIndex++,this._currentIndex<this._adjacencies.length&&this._currentAdjacency().reset()}isEmpty(){return this._currentSize===0}first(){return this._currentAdjacency().position}size(){return this._currentSize}_currentAdjacency(){return this._adjacencies[this._currentIndex]}toString(){return`AdjacencyList [node=${this._node}, adjacencies=${this._adjacencies.map(t=>t.toString())}]`}},B_=class{constructor(t){this.position=t,this.cardinality=1,this.currentCardinality=1}reset(){this.currentCardinality=this.cardinality}toString(){return`Adjacency [position=${this.position}, cardinality=${this.cardinality}, currentCardinality=${this.currentCardinality}]`}};var md=class{constructor(){this.crossingsCounter=null,this._nPorts=0,this.portPos=null,this._hierarchicalCrossingsCounter=null}distributePortsWhileSweeping(t,e,o){return this._initialize(t,e,o),this._distributePortsInLayer(t,e,o)}_distributePortsInLayer(t,e,o){let r=o?u.WEST:u.EAST,i=!1;for(let s of t[e]){if(s.getProperty(_.PORT_CONSTRAINTS).isOrderFixed())continue;let a=s.getNestedGraph(),l=s.getPortSideView(r).length>0&&a!=null;if(l){let c=a.toNodeArray();this._hierarchicalCrossingsCounter=new qn(c,o?0:c.length-1)}i=this._distributePortsOnNode(s,r,l)||i}return i}_distributePortsOnNode(t,e,o){let r=t.getPortSideView(e);e===u.SOUTH||e===u.WEST?r=r.slice().reverse():r=r.slice();let i=!1,s;do{s=!1;for(let a=0;a<r.length-1;a++){let l=r[a],c=r[a+1];this._switchingDecreasesCrossings(l,c,o)&&(i=!0,this._switchPorts(r,a,a+1),s=!0)}}while(s);return i}_switchingDecreasesCrossings(t,e,o){let r=this.crossingsCounter.countCrossingsBetweenPortsInBothOrders(t,e),i=r.getFirst(),s=r.getSecond();if(o){let a=t.getProperty(p.PORT_DUMMY),l=e.getProperty(p.PORT_DUMMY);a!=null&&l!=null&&(this._hierarchicalCrossingsCounter.countBothSideCrossings(a,l),i+=this._hierarchicalCrossingsCounter.getUpperLowerCrossings(),s+=this._hierarchicalCrossingsCounter.getLowerUpperCrossings())}return i>s}_switchPorts(t,e,o){this.crossingsCounter.switchPorts(t[e],t[o]);let r=t[o];t[o]=t[e],t[e]=r}_initialize(t,e,o){o&&e>0?this.crossingsCounter.initForCountingBetween(t[e-1],t[e]):!o&&e<t.length-1?this.crossingsCounter.initForCountingBetween(t[e],t[e+1]):this.crossingsCounter.initPortPositionsForInLayerCrossings(t[e],o?u.WEST:u.EAST)}initAtNodeLevel(t,e,o){this._nPorts+=o[t][e].getPorts().length,this._nPorts}initAfterTraversal(){this.portPos=new Int32Array(this._nPorts),this.crossingsCounter=new Fr(this.portPos)}};var Jn=class{constructor(t){this.portRanks=null,this.minBarycenter=0,this.maxBarycenter=0,this.nodePositions=new Array(t),this.portBarycenter=null,this.inLayerPorts=[],this._nPorts=0}getPortRanks(){return this.portRanks}distributePortsWhileSweeping(t,e,o){this._updateNodePositions(t,e);let r=t[e],i=o?u.WEST:u.EAST;if(this._isNotFirstLayer(t.length,e,o)){let s=t[o?e-1:e+1];this.calculatePortRanksLayer(s,xP(o));for(let a of r)this._distributePorts(a,i);this.calculatePortRanksLayer(r,xP(!o));for(let a of s)_I(a)||this._distributePorts(a,i.opposed())}else for(let s of r)this._distributePorts(s,i);return!1}calculatePortRanksLayer(t,e){let o=0;for(let r=0;r<t.length;r++)o+=this.calculatePortRanks(t[r],o,e)}calculatePortRanks(t,e,o){throw new Error("abstract method \u2014 subclass must override calculatePortRanks(node, rankSum, type)")}_distributePorts(t,e){t.getProperty(_.PORT_CONSTRAINTS).isOrderFixed()||(this._distributePortsSubset(t,t.getPorts(e)),this._distributePortsSubset(t,t.getPorts(u.SOUTH)),this._distributePortsSubset(t,t.getPorts(u.NORTH)),this._sortPorts(t))}_distributePortsSubset(t,e){this.inLayerPorts.length=0,this._iteratePortsAndCollectInLayerPorts(t,e),this.inLayerPorts.length>0&&this._calculateInLayerPortsBarycenterValues(t)}_iteratePortsAndCollectInLayerPorts(t,e){this.minBarycenter=0,this.maxBarycenter=0;let o=2*t.getLayer().getNodes().length+1;t:for(let r of e){let i=r.getSide(),s=i===u.NORTH||i===u.SOUTH,a=0;if(s){let l=r.getProperty(p.PORT_DUMMY);if(l==null)continue;a+=this._dealWithNorthSouthPorts(o,r,l)}else{for(let l of r.getOutgoingEdges()){let c=l.getTarget();if(c.getNode().getLayer()===t.getLayer()){this.inLayerPorts.push(r);continue t}else a+=this.portRanks[c.id]}for(let l of r.getIncomingEdges()){let c=l.getSource();if(c.getNode().getLayer()===t.getLayer()){this.inLayerPorts.push(r);continue t}else a-=this.portRanks[c.id]}}r.getDegree()>0?(this.portBarycenter[r.id]=a/r.getDegree(),this.minBarycenter=Math.min(this.minBarycenter,this.portBarycenter[r.id]),this.maxBarycenter=Math.max(this.maxBarycenter,this.portBarycenter[r.id])):s&&(this.portBarycenter[r.id]=a)}}_calculateInLayerPortsBarycenterValues(t){let e=this._positionOfNode(t)+1,o=t.getLayer().getNodes().length+1;for(let r of this.inLayerPorts){let i=0,s=0;for(let c of r.getConnectedPorts())c.getNode().getLayer()===t.getLayer()&&(i+=this._positionOfNode(c.getNode())+1,s++);let a=i/s,l=r.getSide();l===u.EAST?a<e?this.portBarycenter[r.id]=this.minBarycenter-a:this.portBarycenter[r.id]=this.maxBarycenter+(o-a):l===u.WEST&&(a<e?this.portBarycenter[r.id]=this.maxBarycenter+a:this.portBarycenter[r.id]=this.minBarycenter-(o-a))}}_dealWithNorthSouthPorts(t,e,o){let r=!1,i=!1;for(let a of o.getPorts())a.getProperty(p.ORIGIN)===e&&(a.getOutgoingEdges().length>0?i=!0:a.getIncomingEdges().length>0&&(r=!0));let s=0;return r&&r!==i?s=e.getSide()===u.NORTH?-this._positionOfNode(o):t-this._positionOfNode(o):i&&r!==i?s=this._positionOfNode(o)+1:r&&i&&(s=e.getSide()===u.NORTH?0:t/2),s}_positionOfNode(t){return this.nodePositions[t.getLayer().id][t.id]}_updateNodePositions(t,e){let o=t[e];for(let r=0;r<o.length;r++){let i=o[r];this.nodePositions[i.getLayer().id][i.id]=r}}_isNotFirstLayer(t,e,o){return o?e!==0:e!==t-1}_sortPorts(t){let e=t.getPorts(),o=this.portBarycenter;e.sort((r,i)=>{let s=r.getSide(),a=i.getSide();if(s!==a)return s.ordinal()-a.ordinal();let l=o[r.id],c=o[i.id];return l===0&&c===0?0:l===0?-1:c===0?1:l<c?-1:l>c?1:0})}initAtLayerLevel(t,e){this.nodePositions[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){let r=o[t][e];r.id=e,this.nodePositions[t][e]=e}initAtPortLevel(t,e,o,r){r[t][e].getPorts()[o].id=this._nPorts++}initAfterTraversal(){this.portRanks=new Float32Array(this._nPorts),this.portBarycenter=new Float32Array(this._nPorts)}};function xP(n){return n?W.OUTPUT:W.INPUT}function _I(n){return n.getNestedGraph()!=null}var Qn=class extends Jn{constructor(t){super(t)}calculatePortRanks(t,e,o){let r=this.getPortRanks();if(o===W.INPUT){let i=0,s=0;for(let g of t.getPorts())g.getIncomingEdges().length>0&&(i++,g.getSide()===u.NORTH&&s++);let a=1/(i+1),l=e+s*a,c=e+1-a;for(let g of t.getPorts(W.INPUT))g.getSide()===u.NORTH?(r[g.id]=l,l-=a):(r[g.id]=c,c-=a)}else if(o===W.OUTPUT){let i=0;for(let l of t.getPorts())l.getOutgoingEdges().length>0&&i++;let s=1/(i+1),a=e+s;for(let l of t.getPorts(W.OUTPUT))r[l.id]=a,a+=s}else throw new Error("Port type is undefined");return 1}};var Pd=class extends Jn{constructor(t){super(t)}calculatePortRanks(t,e,o){let r=this.getPortRanks();if(o===W.INPUT){let i=0,s=0;for(let c of t.getPorts())c.getIncomingEdges().length>0&&(i++,c.getSide()===u.NORTH&&s++);let a=e+s,l=e+i;for(let c of t.getPorts(W.INPUT))c.getSide()===u.NORTH?(r[c.id]=a,a--):(r[c.id]=l,l--);return i}if(o===W.OUTPUT){let i=0;for(let s of t.getPorts(W.OUTPUT))i++,r[s.id]=e+i;return i}throw new Error("Port type is undefined")}};var Od=class{static create(t,e,o){return t===re.TWO_SIDED_GREEDY_SWITCH?new md:e.nextBoolean()?new Qn(o.length):new Pd(o.length)}};var Sd=class{constructor(t){this.graphData=t,this.nodeInfo=new Array(t.currentNodeOrder().length)}useBottomUp(){let t=this.graphData.lGraph().getProperty(_.CROSSING_MINIMIZATION_HIERARCHICAL_SWEEPINESS);if(pI(t)||this._rootNode()||this._fixedPortOrder()||this._fewerThanTwoInOutEdges())return!0;if(this.graphData.crossMinDeterministic())return!1;let e=0,o=0,r=[];for(let a of this.graphData.currentNodeOrder()){for(let l of a){if(OI(l)){r.push(l);continue}let c=this._nodeInfoFor(l);PI(l)?(c.hierarchicalInfluence=1,SI(l)&&(o+=c.connectedEdges)):mI(l)?c.randomInfluence=1:EI(l)&&(e+=c.connectedEdges);for(let g of l.getOutgoingEdges())e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoToTarget(c,g);for(let g of l.getPortSideView(u.NORTH)){let h=g.getProperty(p.PORT_DUMMY);h!=null&&(e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoTo(c,h))}for(let g of l.getPortSideView(u.SOUTH)){let h=g.getProperty(p.PORT_DUMMY);h!=null&&(e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoTo(c,h))}}for(let l of r){let c=this._nodeInfoFor(l);for(let g of l.getOutgoingEdges())e+=c.randomInfluence,o+=c.hierarchicalInfluence,this._transferInfoToTarget(c,g)}r.length=0}let i=e+o;return(i===0?Number.POSITIVE_INFINITY:(e-o)/i)>=t}_fixedPortOrder(){return this.graphData.parent().getProperty(_.PORT_CONSTRAINTS).isOrderFixed()}_transferInfoToTarget(t,e){let o=e.getTarget().getNode();this._transferInfoTo(t,o)}_transferInfoTo(t,e){let o=this._nodeInfoFor(e);o.transfer(t),o.connectedEdges++}_fewerThanTwoInOutEdges(){let t=this.graphData.parent();return t.getPortSideView(u.EAST).length<2&&t.getPortSideView(u.WEST).length<2}_rootNode(){return!this.graphData.hasParent()}_nodeInfoFor(t){return this.nodeInfo[t.getLayer().id][t.id]}initAtLayerLevel(t,e){e[t][0].getLayer().id=t,this.nodeInfo[t]=new Array(e[t].length)}initAtNodeLevel(t,e,o){o[t][e].id=e,this.nodeInfo[t][e]=new U_}},U_=class{constructor(){this.connectedEdges=0,this.hierarchicalInfluence=0,this.randomInfluence=0}transfer(t){this.hierarchicalInfluence+=t.hierarchicalInfluence,this.randomInfluence+=t.randomInfluence,this.connectedEdges+=t.connectedEdges}toString(){return`NodeInfo [connectedEdges=${this.connectedEdges}, hierarchicalInfluence=${this.hierarchicalInfluence}, randomInfluence=${this.randomInfluence}]`}};function pI(n){return n<-1}function EI(n){let t=n.getPortSideView(u.EAST);if(t.length===0)return!0;for(let e of t)if(!e.getConnectedEdges()[Symbol.iterator]().next().done)return!1;return!0}function mI(n){let t=n.getPortSideView(u.WEST);if(t.length===0)return!0;for(let e of t)if(!e.getConnectedEdges()[Symbol.iterator]().next().done)return!1;return!0}function PI(n){return n.getType()===y.EXTERNAL_PORT}function OI(n){return n.getType()===y.NORTH_SOUTH_PORT}function SI(n){return n.getProperty(p.ORIGIN).getSide()===u.EAST}var Td=class{constructor(t){this.random=t,this.weightComparator=(e,o)=>{if(!e.hasProperty(p.WEIGHT))return 1;if(!o.hasProperty(p.WEIGHT))return-1;let r=e.getProperty(p.WEIGHT),i=o.getProperty(p.WEIGHT);return r!=null&&i!=null?r<i?-1:r>i?1:0:r!=null?-1:i!=null?1:0}}alwaysImproves(){return!1}isDeterministic(){return!0}setFirstLayerOrder(t,e){let o=e?0:Math.max(0,t.length-1),r=Array.from(t[o]);for(let i of r)i.setProperty(p.WEIGHT,this.random.nextDouble());r.sort(this.weightComparator);for(let i=0;i<r.length;i++){let s=r[i];t[o][i]=s,s.setProperty(p.WEIGHT,i+1)}return!1}minimizeCrossings(t,e,o,r){let i=Array.from(t[e]);this._calculateMedians(i,o?e-1:e+1),i.sort(this.weightComparator);for(let s=0;s<i.length;s++)t[e][s]=i[s];return!1}_calculateMedians(t,e){let o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=[];for(let a of t){let l=[];for(let c of a.getIncomingEdges()){let g=c.getTarget().getNode(),h=c.getSource().getNode();g.getLayer().id===e&&l.push(g),h.getLayer().id===e&&l.push(h)}for(let c of a.getOutgoingEdges()){let g=c.getTarget().getNode(),h=c.getSource().getNode();g.getLayer().id===e&&l.push(g),h.getLayer().id===e&&l.push(h)}if(l.length===0)i.push(a);else{l.sort(this.weightComparator);let c=Math.floor(l.length/2),g=l[c].getProperty(p.WEIGHT);a.setProperty(p.WEIGHT,g),o=Math.min(o,g),r=Math.max(r,g)}}let s=(r+o)/2;for(let a of i)a.setProperty(p.WEIGHT,s)}};var Nd=class n extends $n{constructor(t,e,o,r){super(t,e,o,r),this.biggerThan=new Map,this.smallerThan=new Map,this.barycenterStateComparator=(i,s)=>{let a=i.hasProperty(_.LAYERING_LAYER_CONSTRAINT)&&DP(i.getProperty(_.LAYERING_LAYER_CONSTRAINT)),l=s.hasProperty(_.LAYERING_LAYER_CONSTRAINT)&&DP(s.getProperty(_.LAYERING_LAYER_CONSTRAINT));if(a||l)return 0;let c=i.getGraph(),g=this._compareBasedOnTransitiveDependencies(i,s);if(g!==0)return g;if(i.hasProperty(p.MODEL_ORDER)&&s.hasProperty(p.MODEL_ORDER)){let h=c.getProperty(p.MAX_MODEL_ORDER_NODES),d=Qe.calculateModelOrderOrGroupModelOrder(i,s,c,h),f=Qe.calculateModelOrderOrGroupModelOrder(s,i,c,h),E=Math.sign(d-f);if(c.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY)===Wt.ONLY_WITHIN_GROUP&&i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID)!==s.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID)&&(E=0),E<0)return this._updateBiggerAndSmallerAssociations(i,s),E;if(E>0)return this._updateBiggerAndSmallerAssociations(s,i),E}return this._compareBasedOnBarycenter(i,s)}}minimizeCrossingsList(t,e,o,r){if(o?this.randomizeBarycenters(t):(this.calculateBarycenters(t,r),this.fillInUnknownBarycenters(t,e)),t.length>1){let s=t[0].getGraph().getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER);s?n.insertionSort(t,this.barycenterStateComparator,this):t.sort(this.barycenterStateComparator),s||this.constraintResolver.processConstraints(t)}}_compareBasedOnTransitiveDependencies(t,e){if(!this.biggerThan.has(t))this.biggerThan.set(t,new Set);else if(this.biggerThan.get(t).has(e))return 1;if(!this.biggerThan.has(e))this.biggerThan.set(e,new Set);else if(this.biggerThan.get(e).has(t))return-1;if(!this.smallerThan.has(t))this.smallerThan.set(t,new Set);else if(this.smallerThan.get(t).has(e))return-1;if(!this.smallerThan.has(e))this.smallerThan.set(e,new Set);else if(this.smallerThan.get(e).has(t))return 1;return 0}_compareBasedOnBarycenter(t,e){let o=this.stateOf(t),r=this.stateOf(e);if(o.barycenter!=null&&r.barycenter!=null){let i=0;return o.barycenter<r.barycenter?i=-1:o.barycenter>r.barycenter&&(i=1),i<0?this._updateBiggerAndSmallerAssociations(t,e):i>0&&this._updateBiggerAndSmallerAssociations(e,t),i}return o.barycenter!=null?(this._updateBiggerAndSmallerAssociations(t,e),-1):r.barycenter!=null?(this._updateBiggerAndSmallerAssociations(e,t),1):0}_updateBiggerAndSmallerAssociations(t,e){let o=this.biggerThan.get(t),r=this.biggerThan.get(e),i=this.smallerThan.get(t),s=this.smallerThan.get(e);o.add(e),s.add(t);for(let a of r){o.add(a);let l=this.smallerThan.get(a);l.add(t);for(let c of i)l.add(c)}for(let a of i){s.add(a);let l=this.biggerThan.get(a);l.add(e);for(let c of r)l.add(c)}}static insertionSort(t,e,o){for(let r=1;r<t.length;r++){let i=t[r],s=r;for(;s>0&&e(t[s-1],i)>0;)t[s]=t[s-1],s--;t[s]=i}o.clearTransitiveOrdering()}clearTransitiveOrdering(){this.biggerThan=new Map,this.smallerThan=new Map}};function DP(n){return n===J.FIRST_SEPARATE||n===J.LAST_SEPARATE}var er=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};er.WEST=new er("WEST");er.EAST=new er("EAST");var yd=class{constructor(t,e,o,r){this._direction=r,this._oneSided=t===re.ONE_SIDED_GREEDY_SWITCH;let s=e[o].length;this._isCrossingMatrixFilled=new Array(s),this._crossingMatrix=new Array(s);for(let a=0;a<s;a++)this._isCrossingMatrixFilled[a]=new Array(s).fill(!1),this._crossingMatrix[a]=new Array(s).fill(0);this._inBetweenLayerCrossingCounter=new qn(e,o)}getCrossingMatrixEntry(t,e){return this._isCrossingMatrixFilled[t.id][e.id]||(this._fillCrossingMatrix(t,e),this._isCrossingMatrixFilled[t.id][e.id]=!0,this._isCrossingMatrixFilled[e.id][t.id]=!0),this._crossingMatrix[t.id][e.id]}_fillCrossingMatrix(t,e){this._oneSided?this._direction===er.EAST?this._inBetweenLayerCrossingCounter.countEasternEdgeCrossings(t,e):this._direction===er.WEST&&this._inBetweenLayerCrossingCounter.countWesternEdgeCrossings(t,e):this._inBetweenLayerCrossingCounter.countBothSideCrossings(t,e),this._crossingMatrix[t.id][e.id]=this._inBetweenLayerCrossingCounter.getUpperLowerCrossings(),this._crossingMatrix[e.id][t.id]=this._inBetweenLayerCrossingCounter.getLowerUpperCrossings()}};var Ad=class{constructor(t){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._portPositions=new Map,this._layer=t,this._initializePortPositions()}_initializePortPositions(){for(let t of this._layer)this._setPortIdsOn(t,u.SOUTH),this._setPortIdsOn(t,u.NORTH)}_setPortIdsOn(t,e){let o=0;for(let r of zi(t,e))this._portPositions.set(r,o++)}countCrossings(t,e){this._upperLowerCrossings=0,this._lowerUpperCrossings=0,this._processIfTwoNorthSouthNodes(t,e),this._processIfNorthSouthLongEdgeDummyCrossing(t,e),this._processIfNormalNodeWithNSPortsAndLongEdgeDummy(t,e)}_processIfTwoNorthSouthNodes(t,e){Ld(t)&&Ld(e)&&!this._haveDifferentOrigins(t,e)&&(this._isNorthOfNormalNode(t)?this._countCrossingsOfTwoNorthSouthDummies(t,e):this._countCrossingsOfTwoNorthSouthDummies(e,t))}_countCrossingsOfTwoNorthSouthDummies(t,e){if(this._originPortPositionOf(t)>this._originPortPositionOf(e)){let o=e.getPortSideView(u.EAST);this._upperLowerCrossings=o.length===0?0:o[0].getDegree();let r=t.getPortSideView(u.WEST);this._lowerUpperCrossings=r.length===0?0:r[0].getDegree()}else{let o=e.getPortSideView(u.WEST);this._upperLowerCrossings=o.length===0?0:o[0].getDegree();let r=t.getPortSideView(u.EAST);this._lowerUpperCrossings=r.length===0?0:r[0].getDegree()}}_processIfNorthSouthLongEdgeDummyCrossing(t,e){Ld(t)&&Rd(e)?this._isNorthOfNormalNode(t)?this._upperLowerCrossings=1:this._lowerUpperCrossings=1:Ld(e)&&Rd(t)&&(this._isNorthOfNormalNode(e)?this._lowerUpperCrossings=1:this._upperLowerCrossings=1)}_processIfNormalNodeWithNSPortsAndLongEdgeDummy(t,e){bP(t)&&Rd(e)&&(this._upperLowerCrossings=Id(t,u.SOUTH),this._lowerUpperCrossings=Id(t,u.NORTH)),bP(e)&&Rd(t)&&(this._upperLowerCrossings=Id(e,u.NORTH),this._lowerUpperCrossings=Id(e,u.SOUTH))}_haveDifferentOrigins(t,e){return MP(t)!==MP(e)}_originPortPositionOf(t){let e=wP(t);return this._portPositions.get(e)}_isNorthOfNormalNode(t){return wP(t).getSide()===u.NORTH}getUpperLowerCrossings(){return this._upperLowerCrossings}getLowerUpperCrossings(){return this._lowerUpperCrossings}};function Id(n,t){let e=0;for(let o of n.getPortSideView(t))o.getProperty(p.PORT_DUMMY)!=null&&e++;return e}function wP(n){return n.getPorts()[0].getProperty(p.ORIGIN)}function MP(n){return n.getProperty(p.ORIGIN)}function Rd(n){return n.getType()===y.LONG_EDGE}function Ld(n){return n.getType()===y.NORTH_SOUTH_PORT}function bP(n){return n.getType()===y.NORMAL}var xd=class{constructor(t,e,o,r,i,s){if(this._crossingMatrixFiller=o,this._graphData=i,t>=e.length)throw new RangeError("Greedy SwitchDecider: Free layer not in graph.");this._freeLayer=e[t],this._leftInLayerCounter=new Fr(r),this._leftInLayerCounter.initPortPositionsForInLayerCrossings(this._freeLayer,u.WEST),this._rightInLayerCounter=new Fr(r),this._rightInLayerCounter.initPortPositionsForInLayerCrossings(this._freeLayer,u.EAST),this._northSouthCounter=new Ad(this._freeLayer),this._countCrossingsCausedByPortSwitch=!s&&i.hasParent()&&!i.dontSweepInto()&&this._freeLayer[0].getType()===y.EXTERNAL_PORT,this._parentCrossCounter=null,this._countCrossingsCausedByPortSwitch&&this._initParentCrossingsCounters(t,e.length)}_initParentCrossingsCounters(t,e){let o=this._graphData.parentGraphData(),r=o.currentNodeOrder(),i=o.portPositions();this._parentCrossCounter=new Fr(i);let s=this._graphData.parent().getLayer().id,a=s>0?r[s-1]:[],l=r[s],c=s<r.length-1?r[s+1]:[];t===e-1?this._parentCrossCounter.initForCountingBetween(l,c):this._parentCrossCounter.initForCountingBetween(a,l)}notifyOfSwitch(t,e){if(this._leftInLayerCounter.switchNodes(t,e,u.WEST),this._rightInLayerCounter.switchNodes(t,e,u.EAST),this._countCrossingsCausedByPortSwitch){let o=t.getProperty(p.ORIGIN),r=e.getProperty(p.ORIGIN);this._parentCrossCounter.switchPorts(o,r)}}doesSwitchReduceCrossings(t,e){if(this._constraintsPreventSwitch(t,e))return!1;let o=this._freeLayer[t],r=this._freeLayer[e],i=this._leftInLayerCounter.countInLayerCrossingsBetweenNodesInBothOrders(o,r,u.WEST),s=this._rightInLayerCounter.countInLayerCrossingsBetweenNodesInBothOrders(o,r,u.EAST);this._northSouthCounter.countCrossings(o,r);let a=this._crossingMatrixFiller.getCrossingMatrixEntry(o,r)+i.getFirst()+s.getFirst()+this._northSouthCounter.getUpperLowerCrossings(),l=this._crossingMatrixFiller.getCrossingMatrixEntry(r,o)+i.getSecond()+s.getSecond()+this._northSouthCounter.getLowerUpperCrossings();if(this._countCrossingsCausedByPortSwitch){let c=o.getProperty(p.ORIGIN),g=r.getProperty(p.ORIGIN),h=this._parentCrossCounter.countCrossingsBetweenPortsInBothOrders(c,g);a+=h.getFirst(),l+=h.getSecond()}return a>l}_constraintsPreventSwitch(t,e){let o=this._freeLayer[t],r=this._freeLayer[e];return TI(o,r)||NI(o,r)||yI(o,r)}};function TI(n,t){let e=n.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS);return e!=null&&e.length>0&&e.indexOf(t)>=0}function NI(n,t){let e=n.getType()!==y.LONG_EDGE&&t.getType()!==y.LONG_EDGE,o=n.getProperty(p.IN_LAYER_LAYOUT_UNIT),r=t.getProperty(p.IN_LAYER_LAYOUT_UNIT),i=o!==r,s=GP(n,o)||GP(t,r),a=Cd(n,u.NORTH),l=Cd(t,u.SOUTH);return s=s||Cd(n,u.SOUTH)||Cd(t,u.NORTH),e&&(s&&i||a||l)}function Cd(n,t){for(let e of n.getPortSideView(t))if(e.getProperty(p.PORT_DUMMY)!=null||!e.getConnectedEdges()[Symbol.iterator]().next().done)return!0;return!1}function GP(n,t){return t!=null&&t!==n}function yI(n,t){return vP(n)&&HP(t)||vP(t)&&HP(n)}function HP(n){return n.getType()===y.NORMAL}function vP(n){return n.getType()===y.NORTH_SOUTH_PORT}var Dd=class{constructor(t,e){this._graphData=e,this._greedySwitchType=t,this._currentNodeOrder=null,this._switchDecider=null,this._portPositions=null,this._nPorts=0}minimizeCrossings(t,e,o,r){return this._setUp(t,e,o),this._continueSwitchingUntilNoImprovementInLayer(e)}setFirstLayerOrder(t,e){let o=e?0:t.length-1;return this._setUp(t,o,e),this._sweepDownwardInLayer(o)}_setUp(t,e,o){this._currentNodeOrder=t;let r=o?er.WEST:er.EAST;this._switchDecider=this._getNewSwitchDecider(e,r)}_getNewSwitchDecider(t,e){let o=new yd(this._greedySwitchType,this._currentNodeOrder,t,e);return new xd(t,this._currentNodeOrder,o,this._portPositions,this._graphData,this._greedySwitchType===re.ONE_SIDED_GREEDY_SWITCH)}_continueSwitchingUntilNoImprovementInLayer(t){let e=!1,o;do o=this._sweepDownwardInLayer(t),e=e||o;while(o);return e}_sweepDownwardInLayer(t){let e=!1,o=this._currentNodeOrder[t].length;for(let r=0;r<o-1;r++){let i=r+1;this._switchIfImproves(t,r,i)&&(e=!0)}return e}_switchIfImproves(t,e,o){return this._switchDecider.doesSwitchReduceCrossings(e,o)?(this._exchangeNodes(e,o,t),!0):!1}_exchangeNodes(t,e,o){let r=this._currentNodeOrder[o];this._switchDecider.notifyOfSwitch(r[t],r[e]);let i=r[e];r[e]=r[t],r[t]=i}alwaysImproves(){return this._greedySwitchType!==re.ONE_SIDED_GREEDY_SWITCH}isDeterministic(){return!0}initAtLayerLevel(t,e){e[t][0].getLayer().id=t}initAtPortLevel(t,e,o,r){this._nPorts++}initAfterTraversal(){this._portPositions=new Int32Array(this._nPorts)}};var wd=class{constructor(t,e,o){this._lGraph=t,this._currentNodeOrder=t.toNodeArray(),this._parent=this._lGraph.getParentNode(),this._hasParent=this._parent!=null,this._parentGraphData=this._hasParent?o[this._parent.getGraph().id]:null;let r=t.getProperty(p.GRAPH_PROPERTIES);this._hasExternalPorts=r.has(v.EXTERNAL_PORTS),this._childGraphs=[],this._currentlyBestNodeAndPortOrder=null,this._bestNodeAndPortOrder=null,this._portPositions=null,this._nPorts=0,this._crossingsCounter=new fd(this._currentNodeOrder);let i=this._lGraph.getProperty(p.RANDOM);if(i==null){let a=this._lGraph.getParentNode?this._lGraph.getParentNode():null;for(;a!=null&&i==null;){let l=a.getGraph?a.getGraph():null;l&&(i=l.getProperty(p.RANDOM)),a=l&&l.getParentNode?l.getParentNode():null}i!=null&&this._lGraph.setProperty(p.RANDOM,i)}this._portDistributor=Od.create(e,i,this._currentNodeOrder),this._layerSweepTypeDecider=new Sd(this);let s=[this,this._crossingsCounter,this._layerSweepTypeDecider,this._portDistributor];if(e===re.BARYCENTER&&!t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)){let a=new ll(this._currentNodeOrder);s.push(a),this._crossMinimizer=new $n(a,i,this._portDistributor,this._currentNodeOrder)}else if(e===re.BARYCENTER&&t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)){let a=new ll(this._currentNodeOrder);s.push(a),this._crossMinimizer=new Nd(a,i,this._portDistributor,this._currentNodeOrder)}else e===re.MEDIAN?this._crossMinimizer=new Td(i):this._crossMinimizer=new Dd(e,this);s.push(this._crossMinimizer),ud.init(s,this._currentNodeOrder),this._useBottomUp=this._layerSweepTypeDecider.useBottomUp()}dontSweepInto(){return this._useBottomUp}lGraph(){return this._lGraph}currentNodeOrder(){return this._currentNodeOrder}currentlyBestNodeAndPortOrder(){return this._currentlyBestNodeAndPortOrder}setCurrentlyBestNodeAndPortOrder(t){this._currentlyBestNodeAndPortOrder=t}bestNodeNPortOrder(){return this._bestNodeAndPortOrder}setBestNodeNPortOrder(t){this._bestNodeAndPortOrder=t}crossCounter(){return this._crossingsCounter}crossMinimizer(){return this._crossMinimizer}portDistributor(){return this._portDistributor}parent(){return this._parent}hasParent(){return this._hasParent}childGraphs(){return this._childGraphs}hasExternalPorts(){return this._hasExternalPorts}getBestSweep(){return this._crossMinimizer.isDeterministic()?this.currentlyBestNodeAndPortOrder():this.bestNodeNPortOrder()}parentGraphData(){return this._parentGraphData}crossMinDeterministic(){return this._crossMinimizer.isDeterministic()}crossMinAlwaysImproves(){return this._crossMinimizer.alwaysImproves()}portPositions(){return this._portPositions}toString(){return JSON.stringify(this._currentNodeOrder.map(t=>t.map(e=>String(e))))}initAtNodeLevel(t,e,o){let i=o[t][e].getNestedGraph();i!=null&&this._childGraphs.push(i)}initAtPortLevel(t,e,o,r){this._nPorts++}initAfterTraversal(){this._portPositions=new Int32Array(this._nPorts)}};var cl=class n{constructor(t){if(t instanceof n){this._nodeOrder=BP(t._nodeOrder),this._portOrders=t._portOrders.map(o=>o.map(r=>[...r]));return}let e=t;this._nodeOrder=BP(e),this._portOrders=[];for(let o of e){let r=[];this._portOrders.push(r);for(let i of o)r.push([...i.getPorts()])}}nodes(){return this._nodeOrder}transferNodeAndPortOrdersToGraph(t,e){let o=new Set,r=t.getLayers();for(let i=0;i<r.length;i++){let s=r[i].getNodes(),a=[];for(let l=0;l<s.length;l++){let c=this._nodeOrder[i][l];c.id=l,c.getType()===y.NORTH_SOUTH_PORT&&a.push(c),r[i].getNodes()[l]=c,c.getPorts().length=0;for(let g of this._portOrders[i][l])c.getPorts().push(g);if(e){let g=c.getProperty(_.PORT_CONSTRAINTS);(g==null||!g.isOrderFixed||!g.isOrderFixed())&&c.setProperty(_.PORT_CONSTRAINTS,H.FIXED_ORDER)}}for(let l of a){let c=this._assertCorrectPortSides(l);o.add(c),o.add(l)}}for(let i of o)i.getPorts().sort(P_),i.cachePortSides()}_assertCorrectPortSides(t){let e=t.getProperty(p.IN_LAYER_LAYOUT_UNIT);if(e==null)return null;let r=t.getPorts()[0].getProperty(p.ORIGIN);for(let i of e.getPorts())if(i===r){if(i.getSide()===u.NORTH&&t.id>e.id){if(i.setSide(u.SOUTH),i.isExplicitlySuppliedPortAnchor()){let s=i.getSize().y;i.getAnchor().y=s-i.getAnchor().y}}else if(i.getSide()===u.SOUTH&&e.id>t.id&&(i.setSide(u.NORTH),i.isExplicitlySuppliedPortAnchor())){let s=i.getSize().y;i.getAnchor().y=-(s-i.getAnchor().y)}break}return e}};function BP(n){if(n==null)return null;let t=new Array(n.length);for(let e=0;e<t.length;e++)t[e]=n[e].slice();return t}var ci=class{constructor(t){this._crossMinType=t,this._graphInfoHolders=[],this._graphsWhoseNodeOrderChanged=new Set,this._random=null,this._randomSeed=0}getLayoutProcessorConfiguration(t){let e=K.createFrom(MI());return e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}process(t,e){e.begin(`Minimize Crossings ${this._crossMinType}`,1);let o=t.getLayers(),r=o.length===0||o.every(c=>c.getNodes().length===0),i=o.length===1&&o[0].getNodes().length===1,s=t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN;if(r||i&&!s){e.done();return}let a=this._initialize(t),l=this._chooseMinimizingMethod(a);this._minimizeCrossings(a,l),this._transferNodeAndPortOrdersToGraph(),e.done()}_chooseMinimizingMethod(t){let e=t[0];return e.crossMinDeterministic()?e.crossMinAlwaysImproves()?o=>this._minimizeCrossingsNoCounter(o):o=>this._minimizeCrossingsWithCounter(o):o=>this._compareDifferentRandomizedLayouts(o)}_minimizeCrossings(t,e){for(let o of t)o.currentNodeOrder().length>0&&(e(o),o.hasParent()&&this._setPortOrderOnParentGraph(o))}_setPortOrderOnParentGraph(t){if(t.hasExternalPorts()&&t.getBestSweep()!=null){let e=t.getBestSweep();this._sortPortsByDummyPositionsInLastLayer(e.nodes(),t.parent(),!0),this._sortPortsByDummyPositionsInLastLayer(e.nodes(),t.parent(),!1),t.parent().setProperty(_.PORT_CONSTRAINTS,H.FIXED_ORDER)}}_minimizeCrossingsNoCounter(t){let e=this._random.nextBoolean(),o=!0;for(;o;)o=!1,o=t.crossMinimizer().setFirstLayerOrder(t.currentNodeOrder(),e),this._sweepReducingCrossings(t,e,!1)&&(o=!0),e=!e;this._setCurrentlyBestNodeOrders()}_compareDifferentRandomizedLayouts(t){typeof this._random.setSeed=="function"&&this._random.setSeed(this._randomSeed),this._graphsWhoseNodeOrderChanged.clear();let e=t.lGraph().getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY);e!=null&&e!==$t.NONE&&t.lGraph().setProperty(p.FIRST_TRY_WITH_INITIAL_ORDER,!0);let o=Number.POSITIVE_INFINITY,r=t.lGraph().getProperty(_.THOROUGHNESS);for(let i=0;i<r;i++){let s=this._minimizeCrossingsWithCounter(t);if(s<o&&(o=s,this._saveAllNodeOrdersOfChangedGraphs(),o===0))break}}_minimizeCrossingsWithCounter(t){let e=this._random.nextBoolean();if(this._countCurrentNumberOfCrossings(t)===0&&t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER))return 0;let r=t.lGraph();!r.getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER)&&!r.getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER)||r.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)==null||r.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)===$t.NONE?t.crossMinimizer().setFirstLayerOrder(t.currentNodeOrder(),e):e=!!r.getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER),this._sweepReducingCrossings(t,e,!0),t.lGraph().getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER)&&t.lGraph().setProperty(p.SECOND_TRY_WITH_INITIAL_ORDER,!1),t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER)&&(t.lGraph().setProperty(p.FIRST_TRY_WITH_INITIAL_ORDER,!1),t.lGraph().setProperty(p.SECOND_TRY_WITH_INITIAL_ORDER,!0));let i=this._countCurrentNumberOfCrossings(t),s;do{if(this._setCurrentlyBestNodeOrders(),i===0)return 0;e=!e,s=i,this._sweepReducingCrossings(t,e,!1),i=this._countCurrentNumberOfCrossings(t)}while(s>i);return s}_countCurrentNumberOfCrossings(t){let e=0,o=[t];for(;o.length>0;){let r=o.pop();e+=r.crossCounter().countAllCrossings(r.currentNodeOrder());for(let i of r.childGraphs()){let s=this._graphInfoHolders[i.id];s.dontSweepInto()||o.push(s)}}return e}_sweepReducingCrossings(t,e,o){let r=t.currentNodeOrder(),i=r.length,s=t.portDistributor().distributePortsWhileSweeping(r,Md(e,i),e),a=r[Md(e,i)];this._sweepInHierarchicalNodes(a,e,o)&&(s=!0);let l=t.lGraph().getProperty(p.FIRST_TRY_WITH_INITIAL_ORDER),c=t.lGraph().getProperty(p.SECOND_TRY_WITH_INITIAL_ORDER),g=o&&!l&&!c;for(let h=RI(e,i);LI(i,h,e);h+=UP(e))t.crossMinimizer().minimizeCrossings(r,h,e,g)&&(s=!0),t.portDistributor().distributePortsWhileSweeping(r,h,e)&&(s=!0),this._sweepInHierarchicalNodes(r[h],e,o)&&(s=!0);return this._graphsWhoseNodeOrderChanged.add(t),s}_sweepInHierarchicalNodes(t,e,o){let r=!1;for(let i of t)AI(i)&&!this._graphInfoHolders[i.getNestedGraph().id].dontSweepInto()&&this._sweepInHierarchicalNode(e,i,o)&&(r=!0);return r}_sweepInHierarchicalNode(t,e,o){let r=e.getNestedGraph(),i=this._graphInfoHolders[r.id],s=i.currentNodeOrder(),a=Md(t,s.length),l=s[a][0];FP(l)?s[a]=this._sortPortDummiesByPortPositions(e,s[a],CI(t)):i.crossMinimizer().setFirstLayerOrder(s,t);let c=this._sweepReducingCrossings(i,t,o);return this._sortPortsByDummyPositionsInLastLayer(i.currentNodeOrder(),i.parent(),t),c}_sortPortsByDummyPositionsInLastLayer(t,e,o){let r=II(o,t.length),i=t[r],s=Md(o,i.length);if(!FP(i[s]))return;let a=e.getPorts();for(let l=0;l<a.length;l++){let c=a[l];wI(c,o)&&kP(c)&&(a[l]=xI(i[s]),s+=UP(o))}}_sortPortDummiesByPortPositions(t,e,o){let r=zi(t,o),i=new Array(e.length),s=0;for(let a of r)kP(a)&&(i[s++]=DI(a));if(s<e.length)throw new Error(`Expected ${e.length} hierarchical ports, but found only ${s}.`);return i}_saveAllNodeOrdersOfChangedGraphs(){for(let t of this._graphsWhoseNodeOrderChanged)t.setBestNodeNPortOrder(new cl(t.currentlyBestNodeAndPortOrder()))}_setCurrentlyBestNodeOrders(){for(let t of this._graphsWhoseNodeOrderChanged)t.setCurrentlyBestNodeAndPortOrder(new cl(t.currentNodeOrder()))}_initialize(t){this._graphInfoHolders=[],this._random=t.getProperty(p.RANDOM),this._randomSeed=typeof this._random.nextLong=="function"?this._random.nextLong():0;let e=[],o=[t],r=0;for(;r<o.length;){let i=o[r];i.id=r++;let s=new wd(i,this._crossMinType,this._graphInfoHolders);for(let a of s.childGraphs())o.push(a);this._graphInfoHolders.push(s),s.dontSweepInto()&&e.unshift(s)}return this._graphsWhoseNodeOrderChanged=new Set,e}_transferNodeAndPortOrdersToGraph(){for(let t of this._graphInfoHolders){let e=t.getBestSweep();e!=null&&e.transferNodeAndPortOrdersToGraph(t.lGraph(),!0)}}getGraphData(){return this._graphInfoHolders}};Z(ci,"isHierarchyAware",!0);function Md(n,t){return n?0:t-1}function II(n,t){return n?t-1:0}function RI(n,t){return n?1:t-2}function UP(n){return n?1:-1}function LI(n,t,e){return e?t<n:t>=0}function AI(n){return n.getNestedGraph()!=null}function CI(n){return n?u.WEST:u.EAST}function FP(n){return n.getType()===y.EXTERNAL_PORT}function xI(n){return n.getProperty(p.ORIGIN)}function kP(n){return n.getProperty(p.INSIDE_CONNECTIONS)}function DI(n){return n.getProperty(p.PORT_DUMMY)}function wI(n,t){return t?n.getSide()===u.EAST:n.getSide()===u.WEST}function MI(){return K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER)}var at=class{constructor(t,e,o){this.name=t,this.ordinal=e,this._factory=o,Object.freeze(this)}toString(){return this.name}create(){if(this._factory==null)throw new Error("No implementation available for layout processor "+this.name);return this._factory()}},w=class{},ct=0,gt=w;gt.DIRECTION_PREPROCESSOR=new at("DIRECTION_PREPROCESSOR",ct++,()=>new wn($o.TO_INPUT_DIRECTION));gt.COMMENT_PREPROCESSOR=new at("COMMENT_PREPROCESSOR",ct++,()=>new bg);gt.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER=new at("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER",ct++,()=>new Hg);gt.INTERACTIVE_EXTERNAL_PORT_POSITIONER=new at("INTERACTIVE_EXTERNAL_PORT_POSITIONER",ct++,()=>new ah);gt.PARTITION_PREPROCESSOR=new at("PARTITION_PREPROCESSOR",ct++,()=>new Th);gt.LABEL_DUMMY_INSERTER=new at("LABEL_DUMMY_INSERTER",ct++,()=>new gh);gt.SELF_LOOP_PREPROCESSOR=new at("SELF_LOOP_PREPROCESSOR",ct++,()=>new vh);gt.LAYER_CONSTRAINT_PREPROCESSOR=new at("LAYER_CONSTRAINT_PREPROCESSOR",ct++,()=>new _h);gt.PARTITION_MIDPROCESSOR=new at("PARTITION_MIDPROCESSOR",ct++,()=>new Oh);gt.HIGH_DEGREE_NODE_LAYER_PROCESSOR=new at("HIGH_DEGREE_NODE_LAYER_PROCESSOR",ct++,()=>new oh);gt.NODE_PROMOTION=new at("NODE_PROMOTION",ct++,()=>new Eh);gt.LAYER_CONSTRAINT_POSTPROCESSOR=new at("LAYER_CONSTRAINT_POSTPROCESSOR",ct++,()=>new fh);gt.PARTITION_POSTPROCESSOR=new at("PARTITION_POSTPROCESSOR",ct++,()=>new Sh);gt.HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR=new at("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR",ct++,()=>new $g);gt.SEMI_INTERACTIVE_CROSSMIN_PROCESSOR=new at("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR",ct++,()=>new Kh);gt.BREAKING_POINT_INSERTER=new at("BREAKING_POINT_INSERTER",ct++,()=>new qh);gt.LONG_EDGE_SPLITTER=new at("LONG_EDGE_SPLITTER",ct++,()=>new ri);gt.PORT_SIDE_PROCESSOR=new at("PORT_SIDE_PROCESSOR",ct++,()=>new Un);gt.INVERTED_PORT_PROCESSOR=new at("INVERTED_PORT_PROCESSOR",ct++,()=>new lh);gt.PORT_LIST_SORTER=new at("PORT_LIST_SORTER",ct++,()=>new Ih);gt.SORT_BY_INPUT_ORDER_OF_MODEL=new at("SORT_BY_INPUT_ORDER_OF_MODEL",ct++,()=>new jh);gt.NORTH_SOUTH_PORT_PREPROCESSOR=new at("NORTH_SOUTH_PORT_PREPROCESSOR",ct++,()=>new Ph);gt.BREAKING_POINT_PROCESSOR=new at("BREAKING_POINT_PROCESSOR",ct++,()=>new Qh);gt.ONE_SIDED_GREEDY_SWITCH=new at("ONE_SIDED_GREEDY_SWITCH",ct++,()=>new ci(re.ONE_SIDED_GREEDY_SWITCH));gt.TWO_SIDED_GREEDY_SWITCH=new at("TWO_SIDED_GREEDY_SWITCH",ct++,()=>new ci(re.TWO_SIDED_GREEDY_SWITCH));gt.SELF_LOOP_PORT_RESTORER=new at("SELF_LOOP_PORT_RESTORER",ct++,()=>new xh);gt.ALTERNATING_LAYER_UNZIPPER=new at("ALTERNATING_LAYER_UNZIPPER",ct++,()=>new $h);gt.SINGLE_EDGE_GRAPH_WRAPPER=new at("SINGLE_EDGE_GRAPH_WRAPPER",ct++,()=>new xs);gt.IN_LAYER_CONSTRAINT_PROCESSOR=new at("IN_LAYER_CONSTRAINT_PROCESSOR",ct++,()=>new sh);gt.END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR=new at("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR",ct++,()=>new el(!1));gt.LABEL_AND_NODE_SIZE_PROCESSOR=new at("LABEL_AND_NODE_SIZE_PROCESSOR",ct++,()=>new ch);gt.INNERMOST_NODE_MARGIN_CALCULATOR=new at("INNERMOST_NODE_MARGIN_CALCULATOR",ct++,()=>new nh);gt.SELF_LOOP_ROUTER=new at("SELF_LOOP_ROUTER",ct++,()=>new Xh);gt.COMMENT_NODE_MARGIN_CALCULATOR=new at("COMMENT_NODE_MARGIN_CALCULATOR",ct++,()=>new wg);gt.END_LABEL_PREPROCESSOR=new at("END_LABEL_PREPROCESSOR",ct++,()=>new In);gt.LABEL_DUMMY_SWITCHER=new at("LABEL_DUMMY_SWITCHER",ct++,()=>new tl);gt.CENTER_LABEL_MANAGEMENT_PROCESSOR=new at("CENTER_LABEL_MANAGEMENT_PROCESSOR",ct++,()=>new el(!0));gt.LABEL_SIDE_SELECTOR=new at("LABEL_SIDE_SELECTOR",ct++,()=>new dh);gt.HYPEREDGE_DUMMY_MERGER=new at("HYPEREDGE_DUMMY_MERGER",ct++,()=>new rh);gt.HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR=new at("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR",ct++,()=>new Jg);gt.LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR=new at("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR",ct++,()=>new ph);gt.HIERARCHICAL_PORT_POSITION_PROCESSOR=new at("HIERARCHICAL_PORT_POSITION_PROCESSOR",ct++,()=>new Qg);gt.CONSTRAINTS_POSTPROCESSOR=new at("CONSTRAINTS_POSTPROCESSOR",ct++,()=>new Gg);gt.COMMENT_POSTPROCESSOR=new at("COMMENT_POSTPROCESSOR",ct++,()=>new Mg);gt.HYPERNODE_PROCESSOR=new at("HYPERNODE_PROCESSOR",ct++,()=>new ih);gt.HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER=new at("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER",ct++,()=>new qg);gt.LONG_EDGE_JOINER=new at("LONG_EDGE_JOINER",ct++,()=>new ii);gt.SELF_LOOP_POSTPROCESSOR=new at("SELF_LOOP_POSTPROCESSOR",ct++,()=>new Dh);gt.BREAKING_POINT_REMOVER=new at("BREAKING_POINT_REMOVER",ct++,()=>new td);gt.NORTH_SOUTH_PORT_POSTPROCESSOR=new at("NORTH_SOUTH_PORT_POSTPROCESSOR",ct++,()=>new mh);gt.HORIZONTAL_COMPACTOR=new at("HORIZONTAL_COMPACTOR",ct++,()=>new ke);gt.LABEL_DUMMY_REMOVER=new at("LABEL_DUMMY_REMOVER",ct++,()=>new hh);gt.FINAL_SPLINE_BENDPOINTS_CALCULATOR=new at("FINAL_SPLINE_BENDPOINTS_CALCULATOR",ct++,()=>new Kg);gt.END_LABEL_SORTER=new at("END_LABEL_SORTER",ct++,()=>new Ug);gt.REVERSED_EDGE_RESTORER=new at("REVERSED_EDGE_RESTORER",ct++,()=>new Rh);gt.END_LABEL_POSTPROCESSOR=new at("END_LABEL_POSTPROCESSOR",ct++,()=>new vg);gt.HIERARCHICAL_NODE_RESIZER=new at("HIERARCHICAL_NODE_RESIZER",ct++,()=>new jg);gt.DIRECTION_POSTPROCESSOR=new at("DIRECTION_POSTPROCESSOR",ct++,()=>new wn($o.TO_INTERNAL_LTR));var bd=class n{getLayoutProcessorConfiguration(t){let e=K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER),o=t.getProperty(p.GRAPH_PROPERTIES);return o&&o.has(v.NON_FREE_PORTS)&&e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}process(t,e){e&&e.begin&&e.begin("Interactive crossing minimization",1);let o=0;for(let a of t.getLayers())a.id=o++;let r=t.toNodeArray(),i=new Qn(r.length);ud.init([i],r);let s=0;o=0;for(let a of t.getLayers()){let l=0,c=0;for(let d of a.getNodes()){d.getPosition().x>0&&(l+=d.getPosition().x+d.getSize().x/2,c++);for(let f of d.getPorts())f.id=s++}c>0&&(l/=c);let g=new Array(a.getNodes().length),h=0;for(let d of a.getNodes())d.id=h++,g[d.id]=n._getPos(d,l),d.getType()===y.LONG_EDGE&&d.setProperty(p.ORIGINAL_DUMMY_NODE_POSITION,g[d.id]);a.getNodes().sort((d,f)=>{let E=g[d.id]-g[f.id];if(E!==0)return E;let P=d.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS),S=f.getProperty(p.IN_LAYER_SUCCESSOR_CONSTRAINTS);return P&&P.includes(f)?-1:S&&S.includes(d)?1:0}),i.distributePortsWhileSweeping(r,o,!0),o++}e&&e.done&&e.done()}static _getPos(t,e){if(t.getType()===y.LONG_EDGE){let o=t.getProperty(p.ORIGIN),r=o.getProperty(p.ORIGINAL_BENDPOINTS);r==null?r=new st:o.getProperty(p.REVERSED)&&(r=st.reverse(r));let i=t.getProperty(p.LONG_EDGE_SOURCE);if(i!=null){let a=i.getAbsoluteAnchor();if(e<=a.x)return a.y;r.addFirst(a)}let s=t.getProperty(p.LONG_EDGE_TARGET);if(s!=null){let a=s.getAbsoluteAnchor();if(a.x<=e)return a.y;r.addLast(a)}if(r.length>=2){let a=0,l=r[a++],c=r[a++];for(;c.x<e&&a<r.length;)l=c,c=r[a++];return l.y+(e-l.x)/(c.x-l.x)*(c.y-l.y)}}else if(t.getType()===y.NORTH_SOUTH_PORT){let o=t.getPorts()[0].getProperty(p.ORIGIN),r=o.getNode();if(o.getSide()===u.NORTH)return r.getPosition().y;if(o.getSide()===u.SOUTH)return r.getPosition().y+r.getSize().y}return t.getInteractiveReferencePoint().y}};var Gd=class{process(t,e){e.begin("No crossing minimization",1),e.done()}getLayoutProcessorConfiguration(t){let e=K.createFrom(bI);return e.addBefore(D.P3_NODE_ORDERING,w.PORT_LIST_SORTER),e}},bI=K.create().addBefore(D.P3_NODE_ORDERING,w.LONG_EDGE_SPLITTER).addBefore(D.P4_NODE_PLACEMENT,w.IN_LAYER_CONSTRAINT_PROCESSOR).after(D.P5_EDGE_ROUTING).add(w.LONG_EDGE_JOINER);var We=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.LAYER_SWEEP:return new ci(re.BARYCENTER);case n.MEDIAN_LAYER_SWEEP:return new ci(re.MEDIAN);case n.INTERACTIVE:return new bd;case n.NONE:return new Gd;default:throw new Error("Unknown crossing minimization strategy: "+this.name)}}static valueOf(t){return n[t]}};We.LAYER_SWEEP=new We("LAYER_SWEEP");We.MEDIAN_LAYER_SWEEP=new We("MEDIAN_LAYER_SWEEP");We.INTERACTIVE=new We("INTERACTIVE");We.NONE=new We("NONE");var ta=class{constructor(){this._indeg=null,this._outdeg=null,this._mark=null,this._sources=[],this._sinks=[],this.layeredGraph=null,this._random=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Greedy cycle removal",1),this.layeredGraph=t;let o=t.getLayerlessNodes(),r=o.length;this._indeg=new Array(r).fill(0),this._outdeg=new Array(r).fill(0),this._mark=new Array(r).fill(0);let i=0;for(let g of o){g.id=i;for(let h of g.getPorts()){for(let d of h.getIncomingEdges()){if(d.getSource().getNode()===g)continue;let f=d.getProperty(_.PRIORITY_DIRECTION);this._indeg[i]+=f>0?f+1:1}for(let d of h.getOutgoingEdges()){if(d.getTarget().getNode()===g)continue;let f=d.getProperty(_.PRIORITY_DIRECTION);this._outdeg[i]+=f>0?f+1:1}}this._outdeg[i]===0?this._sinks.push(g):this._indeg[i]===0&&this._sources.push(g),i++}let s=-1,a=1,l=[];for(this._random=t.getProperty(p.RANDOM);r>0;){for(;this._sinks.length>0;){let g=this._sinks.shift();this._mark[g.id]=s--,this._updateNeighbors(g),r--}for(;this._sources.length>0;){let g=this._sources.shift();this._mark[g.id]=a++,this._updateNeighbors(g),r--}if(r>0){let g=Number.MIN_SAFE_INTEGER;l.length=0;for(let d of o)if(this._mark[d.id]===0){let f=this._outdeg[d.id]-this._indeg[d.id];f>=g&&(f>g&&(l.length=0,g=f),l.push(d))}let h=this.chooseNodeWithMaxOutflow(l);this._mark[h.id]=a++,this._updateNeighbors(h),r--}}let c=o.length+1;for(let g=0;g<o.length;g++)this._mark[g]<0&&(this._mark[g]+=c);for(let g of o){let h=z.toPortArray(g.getPorts());for(let d of h){let f=z.toEdgeArray(d.getOutgoingEdges());for(let E of f){let P=E.getTarget().getNode().id;this._mark[g.id]>this._mark[P]&&(E.reverse(t,!0),t.setProperty(p.CYCLIC,!0))}}}this._dispose(),e.done()}chooseNodeWithMaxOutflow(t){let e=this._random!=null?this._random.nextInt(t.length):Math.floor(Math.random()*t.length);return t[e]}_dispose(){this._indeg=null,this._outdeg=null,this._mark=null,this._sources.length=0,this._sinks.length=0}_updateNeighbors(t){for(let e of t.getPorts())for(let o of e.getConnectedEdges()){let r=o.getSource()===e?o.getTarget():o.getSource(),i=r.getNode();if(t===i)continue;let s=o.getProperty(_.PRIORITY_DIRECTION);s<0&&(s=0);let a=i.id;this._mark[a]===0&&(o.getTarget()===r?(this._indeg[a]-=s+1,this._indeg[a]<=0&&this._outdeg[a]>0&&this._sources.push(i)):(this._outdeg[a]-=s+1,this._outdeg[a]<=0&&this._indeg[a]>0&&this._sinks.push(i)))}}};var Hd=class{constructor(){this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Depth-first cycle removal",1);let o=t.getLayerlessNodes(),r=o.length;this._sources=[],this._visited=new Array(r).fill(!1),this._active=new Array(r).fill(!1),this._edgesToBeReversed=[];let i=0;for(let s of o){s.id=i;let a=!1;for(let l of s.getIncomingEdges()){a=!0;break}a||this._sources.push(s),i++}for(let s of this._sources)this._dfs(s);for(let s=0;s<r;s++)this._visited[s]||this._dfs(o[s]);for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,e.done()}_dfs(t){if(!this._visited[t.id]){this._visited[t.id]=!0,this._active[t.id]=!0;for(let e of t.getOutgoingEdges()){if(e.isSelfLoop())continue;let o=e.getTarget().getNode();this._active[o.id]?this._edgesToBeReversed.push(e):this._dfs(o)}this._active[t.id]=!1}}};var vd=class{constructor(){this._revEdges=[]}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.INTERACTIVE_EXTERNAL_PORT_POSITIONER).addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Interactive cycle breaking",1);let o=[];for(let r of t.getLayerlessNodes()){r.id=1;let i=r.getInteractiveReferencePoint().x;for(let s of r.getPorts(W.OUTPUT))for(let a of s.getOutgoingEdges()){let l=a.getTarget().getNode();l!==r&&l.getInteractiveReferencePoint().x<i&&o.push(a)}}for(let r of o)r.reverse(t,!0);o.length=0;for(let r of t.getLayerlessNodes())r.id>0&&this._findCycles(r,o);for(let r of o)r.reverse(t,!0);o.length=0,e.done()}_findCycles(t,e){t.id=-1;for(let o of t.getPorts(W.OUTPUT))for(let r of o.getOutgoingEdges()){let i=r.getTarget().getNode();t!==i&&(i.id<0?e.push(r):i.id>0&&this._findCycles(i,e))}t.id=0}};var or=class{constructor(){this._firstSeparateNodes=0,this._lastSeparateNodes=0}computeConstraintModelOrder(t,e){let o=0;switch(t.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST_SEPARATE:o=2*-e+this._firstSeparateNodes,this._firstSeparateNodes++;break;case J.FIRST:o=-e;break;case J.LAST:o=e;break;case J.LAST_SEPARATE:o=2*e+this._lastSeparateNodes,this._lastSeparateNodes++;break;default:break}return t.hasProperty(p.MODEL_ORDER)&&(o+=t.getProperty(p.MODEL_ORDER)),o}computeConstraintGroupModelOrder(t,e,o){let r=0;switch(t.getProperty(_.LAYERING_LAYER_CONSTRAINT)){case J.FIRST_SEPARATE:r=2*-e+this._firstSeparateNodes,this._firstSeparateNodes++;break;case J.FIRST:r=-e;break;case J.LAST:r=e;break;case J.LAST_SEPARATE:r=2*e+this._lastSeparateNodes,this._lastSeparateNodes++;break;default:break}return t.hasProperty(p.MODEL_ORDER)&&(r+=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)*o+t.getProperty(p.MODEL_ORDER)),r}resetInternalCounters(){this._firstSeparateNodes=0,this._lastSeparateNodes=0}};var Bd=class{getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Model order cycle breaking",1);let o=[],r=Math.max(t.getLayerlessNodes().length,t.getProperty(p.MAX_MODEL_ORDER_NODES)),i=r*t.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),s=t.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;for(let a of t.getLayerlessNodes()){let l=new or,c=s?l.computeConstraintGroupModelOrder(a,i,r):l.computeConstraintModelOrder(a,r);for(let g of a.getPorts(W.OUTPUT))for(let h of g.getOutgoingEdges()){let d=h.getTarget().getNode();(s?l.computeConstraintGroupModelOrder(d,i,r):l.computeConstraintModelOrder(d,r))<c&&o.push(h)}}for(let a of o)a.reverse(t,!0),t.setProperty(p.CYCLIC,!0);o.length=0,e.done()}};var Ud=class extends ta{chooseNodeWithMaxOutflow(t){let e=null,o=Number.MAX_SAFE_INTEGER,r=Math.max(this.layeredGraph.getLayerlessNodes().length,this.layeredGraph.getProperty(p.MAX_MODEL_ORDER_NODES)),i=r*this.layeredGraph.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),s=new or,a=this.layeredGraph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;for(let l of t)if(l.hasProperty(p.MODEL_ORDER)){let c=a?s.computeConstraintGroupModelOrder(l,i,r):s.computeConstraintModelOrder(l,r);o>c&&(o=c,e=l)}return e==null?super.chooseNodeWithMaxOutflow(t):e}};var Fd=class{constructor(t,e,o){this._edgesToBeReversed=t,this.stronglyConnectedComponents=e,this._nodeToSCCID=o,this._index=0,this._stack=[]}tarjan(t){this._index=0,this._stack.length=0;for(let e of t.getLayerlessNodes())e.getProperty(p.TARJAN_ID)===-1&&(this._stronglyConnected(e),this._stack.length=0)}_stronglyConnected(t){t.setProperty(p.TARJAN_ID,this._index),t.setProperty(p.TARJAN_LOWLINK,this._index),this._index++,this._stack.push(t),t.setProperty(p.TARJAN_ON_STACK,!0);for(let e of t.getConnectedEdges()){let o=this._edgesToBeReversed.includes(e);if(e.getSource().getNode()!==t&&!o||e.getSource().getNode()===t&&o)continue;let r=e.getTarget().getNode()===t?e.getSource().getNode():e.getTarget().getNode();r.getProperty(p.TARJAN_ID)===-1?(this._stronglyConnected(r),t.setProperty(p.TARJAN_LOWLINK,Math.min(t.getProperty(p.TARJAN_LOWLINK),r.getProperty(p.TARJAN_LOWLINK)))):r.getProperty(p.TARJAN_ON_STACK)&&t.setProperty(p.TARJAN_LOWLINK,Math.min(t.getProperty(p.TARJAN_LOWLINK),r.getProperty(p.TARJAN_ID)))}if(t.getProperty(p.TARJAN_LOWLINK)===t.getProperty(p.TARJAN_ID)){let e=new Set,o=null;do o=this._stack.pop(),o.setProperty(p.TARJAN_ON_STACK,!1),e.add(o);while(t!==o);if(e.size>1){let r=this.stronglyConnectedComponents.length;this.stronglyConnectedComponents.push(e);for(let i of e)this._nodeToSCCID.set(i,r)}}}resetTarjan(t){for(let e of t.getLayerlessNodes()){e.setProperty(p.TARJAN_ON_STACK,!1),e.setProperty(p.TARJAN_LOWLINK,-1),e.setProperty(p.TARJAN_ID,-1),this._stack.length=0;for(let o of e.getConnectedEdges())o.setProperty(p.IS_PART_OF_CYCLE,!1)}}};var ea=class{constructor(){this.stronglyConnectedComponents=[],this.nodeToSCCID=new Map,this.revEdges=[],this.graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Model order cycle breaking",1),this.graph=t,this.revEdges=[];let o=Math.max(t.getLayerlessNodes().length,t.getProperty(p.MAX_MODEL_ORDER_NODES)),r=o*t.getProperty(p.CB_NUM_MODEL_ORDER_GROUPS),i=t.getLayerlessNodes().length*4+16,s=0;for(;;){if(s++>i)throw new Error("SCCModelOrderCycleBreaker: too many iterations \u2014 findNodes() is not breaking SCCs");let a=new Fd(this.revEdges,this.stronglyConnectedComponents,this.nodeToSCCID);if(a.resetTarjan(t),a.tarjan(t),this.stronglyConnectedComponents.length===0)break;this.findNodes(o,r);for(let l of this.revEdges){l.reverse(t,!1);let c=l.getSource().getNode();c.setProperty(_.LAYERING_LAYER_ID,c.getProperty(_.LAYERING_LAYER_ID)+1),t.setProperty(p.CYCLIC,!0)}this.stronglyConnectedComponents.length=0,this.nodeToSCCID.clear(),this.revEdges.length=0}e.done()}findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=null,i=new or,s=Number.MIN_SAFE_INTEGER;for(let a of this.stronglyConnectedComponents[o]){let l=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED;if(r==null)r=a,s=l?i.computeConstraintGroupModelOrder(a,e,t):i.computeConstraintModelOrder(a,t);else{let c=l?i.computeConstraintGroupModelOrder(a,e,t):i.computeConstraintModelOrder(a,t);s<c&&(r=a,s=c)}}for(let a of r.getOutgoingEdges())this.stronglyConnectedComponents[o].has(a.getTarget().getNode())&&this.revEdges.push(a)}}};var kd=class extends ea{findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=this.stronglyConnectedComponents[o];if(r.size<=1)continue;let i=null,s=null,a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,g=new or;for(let h of r)if(i==null||s==null)i=h,a=c?g.computeConstraintGroupModelOrder(h,e,t):g.computeConstraintModelOrder(h,t),s=h,l=a;else{let d=c?g.computeConstraintGroupModelOrder(h,e,t):g.computeConstraintModelOrder(h,t);a>d&&(i=h,a=d),l<d&&(s=h,l=d)}if(WP(i.getIncomingEdges())>WP(s.getOutgoingEdges()))for(let h of i.getIncomingEdges())r.has(h.getSource().getNode())&&this.revEdges.push(h);else for(let h of s.getOutgoingEdges())r.has(h.getTarget().getNode())&&this.revEdges.push(h)}}};function WP(n){let t=0;for(let e of n)t++;return t}var Wd=class extends ea{findNodes(t,e){for(let o=0;o<this.stronglyConnectedComponents.length;o++){let r=this.stronglyConnectedComponents[o];if(r.size<=1)continue;let i=null,s=null,a=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,g=new or;for(let P of r)if(i==null||s==null)i=P,a=c?g.computeConstraintGroupModelOrder(P,e,t):g.computeConstraintModelOrder(P,t),s=P,l=a;else{let S=c?g.computeConstraintGroupModelOrder(P,e,t):g.computeConstraintModelOrder(P,t);a>S&&(i=P,a=S),l<S&&(s=P,l=S)}let h=i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID),d=s.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID),f=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_SOURCE_ID),E=this.graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_TARGET_ID);if(h===f)for(let P of i.getIncomingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else if(d===E)for(let P of s.getOutgoingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else if(zP(i.getIncomingEdges())>zP(s.getOutgoingEdges()))for(let P of i.getIncomingEdges())r.has(P.getSource().getNode())&&this.revEdges.push(P);else for(let P of s.getOutgoingEdges())r.has(P.getTarget().getNode())&&this.revEdges.push(P)}}};function zP(n){let t=0;for(let e of n)t++;return t}var zd=class{constructor(){this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,this._graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Depth-first cycle removal",1),this._graph=t;let o=t.getLayerlessNodes(),r=o.length;this._sources=[],this._visited=new Array(r).fill(!1),this._active=new Array(r).fill(!1),this._edgesToBeReversed=[];let i=0;for(let s of o){s.id=i;let a=!1;for(let l of s.getIncomingEdges()){a=!0;break}a||this._sources.push(s),i++}for(let s of this._sources)this._dfs(s);for(let s=0;s<r;s++)this._visited[s]||this._dfs(o[s]);for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._visited=null,this._active=null,this._edgesToBeReversed=null,e.done()}_dfs(t){if(this._visited[t.id])return;this._visited[t.id]=!0,this._active[t.id]=!0;let e=new Map,o=this._graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,r=Number.MAX_SAFE_INTEGER;for(let s of t.getOutgoingEdges()){let a=s.getTarget().getNode();if(!a.hasProperty(p.MODEL_ORDER))e.set(r--,new Set([s]));else{let l;o?l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES)*a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)+a.getProperty(p.MODEL_ORDER):l=a.getProperty(p.MODEL_ORDER);let c=e.get(l);c?c.add(s):e.set(l,new Set([s]))}}let i=[...e.keys()].sort((s,a)=>s-a);for(let s of i){let a=e.get(s),l=a.values().next().value;if(l.isSelfLoop())continue;let c=l.getTarget().getNode();if(this._active[c.id])for(let g of a)this._edgesToBeReversed.push(g);else this._dfs(c)}this._active[t.id]=!1}};var Yd=class{constructor(){this._sources=null,this._sinks=null,this._visited=null,this._bfsQueue=null,this._edgesToBeReversed=null,this._graph=null}getLayoutProcessorConfiguration(t){return K.create().addAfter(D.P5_EDGE_ROUTING,w.REVERSED_EDGE_RESTORER)}process(t,e){e.begin("Breadth-first cycle removal",1),this._graph=t;let o=t.getLayerlessNodes();this._bfsQueue=[],this._sources=new Set,this._sinks=new Set,this._visited=new Array(o.length).fill(!1),this._edgesToBeReversed=[];let r=0;for(let s of o){s.id=r;let a=!1;for(let c of s.getIncomingEdges()){a=!0;break}a||this._sources.add(s);let l=!1;for(let c of s.getOutgoingEdges()){l=!0;break}l||this._sinks.add(s),r++}for(let s of this._sources)this._bfsQueue.push(s),this._bfsLoop();this._bfsLoop();let i=!0;for(;i;){i=!1;for(let s=0;s<o.length;s++)if(!this._visited[s]){this._bfsQueue.push(o[s]),i=!0;break}this._bfsLoop()}for(let s of this._edgesToBeReversed)s.reverse(t,!0),t.setProperty(p.CYCLIC,!0);this._sources=null,this._sinks=null,this._visited=null,this._bfsQueue=null,this._edgesToBeReversed=null,e.done()}_bfsLoop(){for(;this._bfsQueue.length>0;)this._bfs(this._bfsQueue.shift())}_bfs(t){if(this._visited[t.id])return;this._visited[t.id]=!0;let e=new Map,o=this._graph.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY)===Wt.ENFORCED,r=Number.MAX_SAFE_INTEGER;for(let s of t.getOutgoingEdges()){let a=s.getTarget().getNode();if(!a.hasProperty(p.MODEL_ORDER))e.set(r--,new Set([s]));else{let l;o?l=this._graph.getProperty(p.MAX_MODEL_ORDER_NODES)*a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)+a.getProperty(p.MODEL_ORDER):l=a.getProperty(p.MODEL_ORDER);let c=e.get(l);c?c.add(s):e.set(l,new Set([s]))}}let i=[...e.keys()].sort((s,a)=>s-a);for(let s of i){let a=e.get(s),l=a.values().next().value;if(l.isSelfLoop())continue;let c=l.getTarget().getNode();if(this._visited[c.id]&&!this._sources.has(t)&&!this._sinks.has(c))for(let g of a)this._edgesToBeReversed.push(g);else this._bfsQueue.push(c)}}};var Xt=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}create(){switch(this){case n.GREEDY:return new ta;case n.DEPTH_FIRST:return new Hd;case n.INTERACTIVE:return new vd;case n.MODEL_ORDER:return new Bd;case n.GREEDY_MODEL_ORDER:return new Ud;case n.SCC_CONNECTIVITY:return new kd;case n.SCC_NODE_TYPE:return new Wd;case n.DFS_NODE_ORDER:return new zd;case n.BFS_NODE_ORDER:return new Yd;default:throw new Error(`Unknown cycle breaker strategy ${this.name}`)}}toString(){return this.name}static valueOf(t){return n[t]}};Xt.GREEDY=new Xt("GREEDY",0);Xt.DEPTH_FIRST=new Xt("DEPTH_FIRST",1);Xt.INTERACTIVE=new Xt("INTERACTIVE",2);Xt.MODEL_ORDER=new Xt("MODEL_ORDER",3);Xt.GREEDY_MODEL_ORDER=new Xt("GREEDY_MODEL_ORDER",4);Xt.SCC_CONNECTIVITY=new Xt("SCC_CONNECTIVITY",5);Xt.SCC_NODE_TYPE=new Xt("SCC_NODE_TYPE",6);Xt.DFS_NODE_ORDER=new Xt("DFS_NODE_ORDER",7);Xt.BFS_NODE_ORDER=new Xt("BFS_NODE_ORDER",8);var Vd=class{constructor(){this._layeredGraph=null,this._nodeHeights=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Longest path layering",1),this._layeredGraph=t;let o=t.getLayerlessNodes();this._nodeHeights=new Int32Array(o.length);for(let r=0;r<o.length;r++)o[r].id=r,this._nodeHeights[r]=-1;for(let r of o)this._visit(r);o.length=0,this._layeredGraph=null,this._nodeHeights=null,e.done()}_visit(t){let e=this._nodeHeights[t.id];if(e>=0)return e;let o=1;for(let r of t.getPorts())for(let i of r.getOutgoingEdges()){let s=i.getTarget().getNode();if(t!==s){let a=this._visit(s);a+1>o&&(o=a+1)}}return this._putNode(t,o),o}_putNode(t,e){let o=this._layeredGraph.getLayers();for(;o.length<e;)o.unshift(new Et(this._layeredGraph));t.setLayer(o[o.length-e]),this._nodeHeights[t.id]=e}};var Xd=class{constructor(){this._layeredGraph=null,this._nodeHeights=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Longest path to source layering",1),this._layeredGraph=t;let o=t.getLayerlessNodes();this._nodeHeights=new Int32Array(o.length);for(let r=0;r<o.length;r++)o[r].id=r,this._nodeHeights[r]=-1;for(let r of o)this._visit(r);o.length=0,this._layeredGraph=null,this._nodeHeights=null,e.done()}_visit(t){let e=this._nodeHeights[t.id];if(e>=0)return e;let o=1;for(let r of t.getPorts())for(let i of r.getIncomingEdges()){let s=i.getSource().getNode();if(t!==s){let a=this._visit(s);a+1>o&&(o=a+1)}}return this._putNode(t,o),o}_putNode(t,e){let o=this._layeredGraph.getLayers();for(;o.length<e;)o.push(new Et(this._layeredGraph));t.setLayer(o[e-1]),this._nodeHeights[t.id]=e}};var Bo=class extends Error{constructor(t,e){super(t),this.name="UnsupportedGraphException",e&&(this.cause=e)}};var Kd=class{constructor(){this._layeredGraph=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Breadth first model order layering",1),this._layeredGraph=t;let o=[];for(let l of t.getLayerlessNodes())l.getType()===y.NORMAL&&o.push(l);o.sort((l,c)=>{if(l.hasProperty(p.MODEL_ORDER)&&c.hasProperty(p.MODEL_ORDER)){let g=l.getProperty(p.MODEL_ORDER),h=c.getProperty(p.MODEL_ORDER);return g-h}throw new Bo("The BF model order layer assigner requires all real nodes to have a model order.")});let r=!0,i=new Et(t),s=null;t.getLayers().push(i);for(let l of o)if(r)l.setLayer(i),r=!1;else{for(let c of l.getIncomingEdges()){let g=c.getSource().getNode(),h=g.getType()===y.NORMAL&&g.getLayer()===i,d=!1;if(g.getType()===y.LABEL){let f=g.getIncomingEdges().next().value;f!=null&&f.getSource().getNode().getLayer()===i&&(d=!0)}if(h||d){s=new Et(t),t.getLayers().push(s),i=new Et(t),t.getLayers().push(i);break}}for(let c of l.getIncomingEdges()){let g=c.getSource().getNode();g.getType()===y.LABEL&&g.getLayer()==null&&g.setLayer(s)}l.setLayer(i)}t.getLayerlessNodes().length=0;let a=t.getLayers();for(let l=a.length-1;l>=0;l--)a[l].getNodes().length===0&&a.splice(l,1);for(let l=0;l<a.length;l++)a[l].id=l;e.done()}};var Zd=class{getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.INTERACTIVE_EXTERNAL_PORT_POSITIONER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Interactive node layering",1);let o=[];for(let s of t.getLayerlessNodes()){let a=s.getPosition().x,l=Math.max(a+1,a+s.getSize().x),c=null,g=0;for(;g<o.length;){let h=o[g];if(h.start>=l)break;if(h.end>a)if(c==null)h.nodes.push(s),h.start=Math.min(h.start,a),h.end=Math.max(h.end,l),c=h,g++;else{for(let d of h.nodes)c.nodes.push(d);c.end=Math.max(c.end,h.end),o.splice(g,1)}else g++}c==null&&o.splice(g,0,{start:a,end:l,nodes:[s]})}let r=t.getLayers(),i=0;for(let s of o){let a=new Et(t);a.id=i++,r.push(a);for(let l of s.nodes)l.setLayer(a),l.id=0}for(let s of t.getLayerlessNodes())if(s.id===0){let a=this._checkNode(s,t);for(;a.size>0;){let l=a.values().next().value;a.delete(l);let c=this._checkNode(l,t);for(let g of c)a.add(g)}}for(let s=r.length-1;s>=0;s--)r[s].getNodes().length===0&&r.splice(s,1);t.getLayerlessNodes().length=0,e.done()}_checkNode(t,e){t.id=1;let o=t.getLayer(),r=new Set;for(let i of t.getPorts(W.OUTPUT))for(let s of i.getOutgoingEdges()){let a=s.getTarget().getNode();if(t!==a&&a.getLayer().id<=o.id){let c=o.id+1;if(c===e.getLayers().length){let g=new Et(e);g.id=c,e.getLayers().push(g),a.setLayer(g)}else a.setLayer(e.getLayers()[c]);r.add(a)}}return r}};var jd=class{constructor(){this._nodeMark=null,this._edgeMark=null,this._inDeg=null,this._outDeg=null,this._topoOrd=null,this._inTopo=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){if(e.begin("Coffman-Graham Layering",1),t.getLayerlessNodes().length===0){e.done();return}let o=t.getProperty(_.LAYERING_COFFMAN_GRAHAM_LAYER_BOUND),r=0,i=0;for(let d of t.getLayerlessNodes()){d.id=r++;for(let f of d.getOutgoingEdges())f.id=i++}this._nodeMark=new Array(r).fill(!1),this._edgeMark=new Array(i).fill(!1),this._inDeg=new Int32Array(r),this._outDeg=new Int32Array(r),this._topoOrd=new Int32Array(r),this._inTopo=new Map,this._transitiveReduction(t);let s=[];for(let d of t.getLayerlessNodes()){for(let f of d.getIncomingEdges())this._edgeMark[f.id]||this._inDeg[d.id]++;this._inDeg[d.id]===0&&s.push(d)}let a=0;for(;s.length>0;){s.sort((f,E)=>this._compareNodesInTopo(f,E));let d=s.shift();this._topoOrd[d.id]=a++;for(let f of d.getOutgoingEdges()){if(this._edgeMark[f.id])continue;let E=f.getTarget().getNode();this._inDeg[E.id]--,this._pushInTopo(E,this._topoOrd[d.id]),this._inDeg[E.id]===0&&s.push(E)}}let l=[];for(let d of t.getLayerlessNodes()){for(let f of d.getOutgoingEdges())this._edgeMark[f.id]||this._outDeg[d.id]++;this._outDeg[d.id]===0&&l.push(d)}let c=(d,f)=>-(this._topoOrd[d.id]-this._topoOrd[f.id]),g=[],h=this._createLayer(t,g);for(;l.length>0;){l.sort(c);let d=l.shift();(this._isLayerFull(h,o)||!this._canAdd(d,h))&&(h=this._createLayer(t,g)),d.setLayer(h);for(let f of d.getIncomingEdges()){if(this._edgeMark[f.id])continue;let E=f.getSource().getNode();this._outDeg[E.id]--,this._outDeg[E.id]===0&&l.push(E)}}for(let d=g.length-1;d>=0;d--)t.getLayers().push(g[d]);t.getLayerlessNodes().length=0,e.done()}_pushInTopo(t,e){let o=this._inTopo.get(t);o?o.push(e):this._inTopo.set(t,[e])}_isLayerFull(t,e){return t.getNodes().length>=e}_canAdd(t,e){for(let o of t.getOutgoingEdges())if(o.getTarget().getNode().getLayer()===e)return!1;return!0}_createLayer(t,e){let o=new Et(t);return e.push(o),o}_compareNodesInTopo(t,e){let o=this._inTopo.get(t)||[],r=this._inTopo.get(e)||[],i=o.length-1,s=r.length-1;for(;i>=0&&s>=0;){let a=o[i--],l=r[s--];if(a!==l)return a-l}return i<0&&s<0?t.id<e.id?-1:t.id>e.id?1:0:i<0?-1:1}_transitiveReduction(t){for(let e of t.getLayerlessNodes()){this._nodeMark.fill(!1);for(let o of e.getOutgoingEdges())this._dfs(e,o.getTarget().getNode())}}_dfs(t,e){if(!this._nodeMark[e.id]){for(let o of e.getOutgoingEdges()){let r=o.getTarget().getNode();for(let i of r.getIncomingEdges())i.getSource().getNode()===t&&(this._edgeMark[i.id]=!0);this._dfs(t,r)}this._nodeMark[e.id]=!0}}};var $d=class{constructor(){this._layeredGraph=null,this._componentNodes=null,this._nodeVisited=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Network simplex layering",1),this._layeredGraph=t;let o=t.getProperty(_.THOROUGHNESS)*GI,r=t.getLayerlessNodes();if(r.length<1){e.done();return}let i=this._connectedComponents(r),s=null;for(let a of i){let l=o*Math.floor(Math.sqrt(a.length)),c=this._initialize(a);li.forGraph(c).withIterationLimit(l).withPreviousLayering(s).withBalancing(!0).execute(e.subTask(1));let g=t.getLayers();for(let h of c.nodes){for(;g.length<=h.layer;)g.push(new Et(t));h.origin.setLayer(g[h.layer])}if(i.length>1){s=new Array(g.length);for(let h=0;h<g.length;h++)s[h]=g[h].getNodes().length}}r.length=0,this._dispose(),e.done()}_connectedComponents(t){this._nodeVisited==null||this._nodeVisited.length<t.length?this._nodeVisited=new Array(t.length).fill(!1):this._nodeVisited.fill(!1),this._componentNodes=[];for(let o=0;o<t.length;o++)t[o].id=o;let e=[];for(let o of t)this._nodeVisited[o.id]||(this._connectedComponentsDFS(o),e.length===0||e[0].length<this._componentNodes.length?e.unshift(this._componentNodes):e.push(this._componentNodes),this._componentNodes=[]);return e}_connectedComponentsDFS(t){this._nodeVisited[t.id]=!0,this._componentNodes.push(t);for(let e of t.getPorts())for(let o of e.getConnectedEdges()){let r=this._getOpposite(e,o).getNode();this._nodeVisited[r.id]||this._connectedComponentsDFS(r)}}_initialize(t){let e=new Map,o=new Wi;for(let r of t){let i=He.of().origin(r).create(o);e.set(r,i)}for(let r of t)for(let i of r.getOutgoingEdges()){if(i.isSelfLoop())continue;let s=Math.max(1,i.getProperty(_.PRIORITY_SHORTNESS));ee.of(i).weight(s).delta(1).source(e.get(i.getSource().getNode())).target(e.get(i.getTarget().getNode())).create()}return o}_dispose(){this._componentNodes=null,this._layeredGraph=null,this._nodeVisited=null}_getOpposite(t,e){if(e.getSource()===t)return e.getTarget();if(e.getTarget()===t)return e.getSource();throw new Error("Input edge is not connected to the input port.")}},GI=4;var qd=class{constructor(){this._layeredGraph=null,this._currentLayer=null,this._currentLayerId=0,this._currentDummyLayer=null,this._nodesToPlace=null,this._maxToPlace=0}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("Depth first model order layering",1),this._layeredGraph=t;let o=[];for(let s of t.getLayerlessNodes())s.getType()===y.NORMAL&&o.push(s);o.sort((s,a)=>{if(s.hasProperty(p.MODEL_ORDER)&&a.hasProperty(p.MODEL_ORDER))return s.getProperty(p.MODEL_ORDER)-a.getProperty(p.MODEL_ORDER);throw new Bo("The DF model order layer assigner requires all real nodes to have a model order.")});let r=!0;this._currentLayer=new Et(t),this._currentDummyLayer=null,t.getLayers().push(this._currentLayer),this._currentLayer.id=0,this._currentLayerId=0,this._nodesToPlace=[];for(let s of o){if(r){s.setLayer(this._currentLayer),r=!1;continue}if(this._isConnectedToCurrentLayer(s)){let a=this._currentLayerId;a=this._getMaxConnectedLayer(a,s);let l=a+2,c=a-this._currentLayerId;if(this._nodesToPlace.length>0)if(c>0){for(let g of this._nodesToPlace)g.id+=a-this._maxToPlace;this._placeNodesToPlace(),this._nodesToPlace.length=0,this._addNodeToLayer(l,s)}else{this._nodesToPlace.push(s),s.id=l,l>this._maxToPlace&&(this._maxToPlace=l);for(let g of s.getIncomingEdges()){let h=g.getSource().getNode();h.getLayer()==null&&h.getType()===y.LABEL&&(this._nodesToPlace.push(h),h.id=l-1)}this._currentLayerId=l}else this._addNodeToLayer(l,s)}else if(this._placeNodesToPlace(),this._nodesToPlace.length=0,s.getIncomingEdges()[Symbol.iterator]().next().done)this._nodesToPlace.push(s),s.id=0,this._maxToPlace<0&&(this._maxToPlace=0),this._currentLayer=t.getLayers()[0],this._currentLayerId=0;else{let c=0;c=this._getMaxConnectedLayer(c,s);let g=c+2;this._addNodeToLayer(g,s)}}this._nodesToPlace.length>0&&this._placeNodesToPlace(),t.getLayerlessNodes().length=0;let i=t.getLayers();for(let s=i.length-1;s>=0;s--)i[s].getNodes().length===0&&i.splice(s,1);for(let s=0;s<i.length;s++)i[s].id=s;e.done()}_isConnectedToCurrentLayer(t){for(let e of t.getIncomingEdges()){let o=e.getSource().getNode(),r,i;if(this._nodesToPlace.length===0){r=o.getType()===y.NORMAL&&o.getLayer()!=null&&o.getLayer().id===this._currentLayerId;let a=o.getIncomingEdges()[Symbol.iterator]().next();if(a.done)i=!1;else{let l=a.value.getSource().getNode().getLayer();i=o.getType()===y.LABEL&&l!=null&&l.id===this._currentLayerId}}else{r=o.getType()===y.NORMAL&&o.id===this._currentLayerId;let a=o.getIncomingEdges()[Symbol.iterator]().next();i=o.getType()===y.LABEL&&!a.done&&a.value.getSource().getNode().id===this._currentLayerId}if(r||i)return!0}return!1}_addNodeToLayer(t,e){let o=this._layeredGraph.getLayers();t<o.length?(this._currentLayer=o[t],this._currentDummyLayer=o[t-1],this._currentLayerId=t):(this._currentDummyLayer=new Et(this._layeredGraph),this._currentDummyLayer.id=t-1,o.push(this._currentDummyLayer),this._currentLayer=new Et(this._layeredGraph),this._currentLayer.id=t,o.push(this._currentLayer),this._currentLayerId=t),e.setLayer(this._currentLayer);for(let r of e.getIncomingEdges()){let i=r.getSource().getNode();i.getLayer()==null&&i.getType()===y.LABEL&&i.setLayer(this._currentDummyLayer)}}_getMaxConnectedLayer(t,e){let o=t;for(let r of e.getIncomingEdges()){let i=r.getSource().getNode();i.getLayer()!=null&&i.getLayer().id>o&&(o=i.getLayer().id)}return o}_placeNodesToPlace(){this._maxToPlace=0;let t=this._layeredGraph.getLayers();for(let e of this._nodesToPlace){if(e.id>=t.length){let o=new Et(this._layeredGraph);o.id=e.id-1,t.push(o);let r=new Et(this._layeredGraph);r.id=e.id,t.push(r)}e.setLayer(t[e.id])}}};var Jd=class{constructor(){this._widthCurrent=0,this._widthUp=0,this._maxWidth=0,this._currentGraph=null,this._upperLayerInfluence=0,this._sortedLayerlessNodes=[],this._alreadyPlacedNodes=new Set,this._alreadyPlacedInOtherLayers=new Set,this._tempLayerlessNodes=[],this._successors=[],this._outDegree=null,this._remainingOutGoing=null,this._inDegree=null,this._selectedNode=null,this._minimumNodeSize=0,this._maximumNodeSize=0,this._normSize=null,this._dummySize=0}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){if(e.begin("StretchWidth layering",1),t.getLayerlessNodes().length===0){e.done();return}this._currentGraph=t,this._widthCurrent=0,this._widthUp=0,this._minimumNodeSize=Number.POSITIVE_INFINITY,this._maximumNodeSize=Number.NEGATIVE_INFINITY,this._dummySize=Number(t.getProperty(_.SPACING_EDGE_EDGE)),this._computeSortedNodes(),this._computeSuccessors(),this._computeDegrees(),this._minMaxNodeSize(),this._computeNormalizedSize(),this._minimumNodeSize=Math.max(1,this._minimumNodeSize),this._maximumNodeSize=Math.max(1,this._maximumNodeSize),this._dummySize/=this._minimumNodeSize,this._maxWidth=this._maximumNodeSize/this._minimumNodeSize,this._upperLayerInfluence=this._getAverageOutDegree();let o=new Et(this._currentGraph);for(this._currentGraph.getLayers().push(o),this._tempLayerlessNodes=this._sortedLayerlessNodes.slice(),this._remainingOutGoing=Int32Array.from(this._outDegree);this._tempLayerlessNodes.length>0;)if(this._selectedNode=this._selectNode(),this._selectedNode==null||this._conditionGoUp()&&this._alreadyPlacedNodes.size>0){this._updateOutGoing(o),o=new Et(this._currentGraph),this._currentGraph.getLayers().push(o);for(let r of this._alreadyPlacedNodes)this._alreadyPlacedInOtherLayers.add(r);this._alreadyPlacedNodes.clear(),this._widthCurrent=this._widthUp,this._widthUp=0}else if(this._conditionGoUp())this._currentGraph.getLayers().length=0,o=new Et(this._currentGraph),this._currentGraph.getLayers().push(o),this._widthCurrent=0,this._widthUp=0,this._alreadyPlacedNodes.clear(),this._alreadyPlacedInOtherLayers.clear(),this._maxWidth++,this._tempLayerlessNodes=this._sortedLayerlessNodes.slice(),this._remainingOutGoing=Int32Array.from(this._outDegree);else{this._selectedNode.setLayer(o);let r=this._tempLayerlessNodes.indexOf(this._selectedNode);r>=0&&this._tempLayerlessNodes.splice(r,1),this._alreadyPlacedNodes.add(this._selectedNode),this._widthCurrent=this._widthCurrent-this._outDegree[this._selectedNode.id]*this._dummySize+this._normSize[this._selectedNode.id],this._widthUp+=this._inDegree[this._selectedNode.id]*this._dummySize}t.getLayerlessNodes().length=0,t.getLayers().reverse(),e.done()}_conditionGoUp(){let t=this._widthCurrent-this._outDegree[this._selectedNode.id]*this._dummySize+this._normSize[this._selectedNode.id]>this._maxWidth,e=this._widthUp+this._inDegree[this._selectedNode.id]*this._dummySize>this._maxWidth*this._upperLayerInfluence*this._dummySize;return t||e}_selectNode(){for(let t of this._tempLayerlessNodes)if(this._remainingOutGoing[t.id]<=0)return t;return null}_computeSortedNodes(){let t=this._currentGraph.getLayerlessNodes();this._sortedLayerlessNodes=t.slice();for(let e of t)e.id=this._getRank(e);this._sortedLayerlessNodes.sort((e,o)=>o.id-e.id)}_getRank(t){let e=gl(t.getOutgoingEdges());for(let o of t.getIncomingEdges()){let r=o.getSource().getNode(),i=gl(r.getOutgoingEdges());i>e&&(e=i)}return e}_computeSuccessors(){let t=0;this._successors=[];let e=new Set;for(let o of this._sortedLayerlessNodes){o.id=t;for(let r of o.getOutgoingEdges())e.add(r.getTarget().getNode());e.delete(o),this._successors.push(new Set(e)),e.clear(),t++}}_computeDegrees(){let t=this._sortedLayerlessNodes.length;this._inDegree=new Int32Array(t),this._outDegree=new Int32Array(t);for(let e of this._sortedLayerlessNodes)this._inDegree[e.id]=gl(e.getIncomingEdges()),this._outDegree[e.id]=gl(e.getOutgoingEdges())}_minMaxNodeSize(){for(let t of this._sortedLayerlessNodes){if(t.getType()!==y.NORMAL)continue;let e=t.getSize().y;e<this._minimumNodeSize&&(this._minimumNodeSize=e),e>this._maximumNodeSize&&(this._maximumNodeSize=e)}}_computeNormalizedSize(){this._normSize=new Float64Array(this._sortedLayerlessNodes.length);for(let t of this._sortedLayerlessNodes)this._normSize[t.id]=t.getSize().y/this._minimumNodeSize}_getAverageOutDegree(){let t=0,e=this._currentGraph.getLayerlessNodes();for(let o of e)t+=gl(o.getOutgoingEdges());return e.length===0?0:t/e.length}_updateOutGoing(t){for(let e of t.getNodes())for(let o of e.getIncomingEdges()){let r=o.getSource().getNode().id;this._remainingOutGoing[r]--}}};function gl(n){let t=0;for(let e of n)t++;return t}var Qd=class{constructor(){this._dummySize=0,this._minimumNodeSize=0,this._normSize=null,this._avgSize=0,this._inDegree=null,this._outDegree=null}getLayoutProcessorConfiguration(t){return K.create().addBefore(D.P1_CYCLE_BREAKING,w.EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER).addBefore(D.P2_LAYERING,w.LAYER_CONSTRAINT_PREPROCESSOR).addBefore(D.P3_NODE_ORDERING,w.LAYER_CONSTRAINT_POSTPROCESSOR)}process(t,e){e.begin("MinWidth layering",1);let o=t.getLayers(),r=t.getLayerlessNodes(),i=t.getProperty(_.LAYERING_MIN_WIDTH_UPPER_BOUND_ON_WIDTH),s=t.getProperty(_.LAYERING_MIN_WIDTH_UPPER_LAYER_ESTIMATION_SCALING_FACTOR);this._dummySize=Number(t.getProperty(_.SPACING_EDGE_EDGE)),this._minimumNodeSize=Number.POSITIVE_INFINITY;for(let T of r){if(T.getType()!==y.NORMAL)continue;let N=T.getSize().y;N<this._minimumNodeSize&&(this._minimumNodeSize=N)}this._minimumNodeSize=Math.max(1,this._minimumNodeSize);let a=r.length;this._inDegree=new Int32Array(a),this._outDegree=new Int32Array(a),this._normSize=new Float64Array(a);let l=0;this._avgSize=0;for(let T of r)T.id=l++,this._inDegree[T.id]=this._countEdgesExceptSelfLoops(T.getIncomingEdges()),this._outDegree[T.id]=this._countEdgesExceptSelfLoops(T.getOutgoingEdges()),this._normSize[T.id]=T.getSize().y/this._minimumNodeSize,this._avgSize+=this._normSize[T.id];this._dummySize/=this._minimumNodeSize,a>0&&(this._avgSize/=a);let c=this._precalcSuccessors(r);r.sort((T,N)=>this._outDegree[N.id]-this._outDegree[T.id]);let g=Number.POSITIVE_INFINITY,h=Number.MAX_SAFE_INTEGER,d=null,f=i,E=i,P=s,S=s;i<0&&(f=1,E=4),s<0&&(P=1,S=2);for(let T=f;T<=E;T++)for(let N=P;N<=S;N++){let{width:I,layering:C}=this._computeMinWidthLayering(T,N,r,c),x=C.length;(I<g||I===g&&x<h)&&(g=I,h=x,d=C)}for(let T of d){let N=new Et(t);for(let I of T)I.setLayer(N);o.push(N)}o.reverse(),r.length=0,e.done()}_precalcSuccessors(t){let e=new Array(t.length);for(let o of t){let r=new Set;for(let i of o.getOutgoingEdges())this._isSelfLoop(i)||r.add(i.getTarget().getNode());e[o.id]=r}return e}_computeMinWidthLayering(t,e,o,r){let i=[],s=new Set(o),a=t*this._avgSize,l=new Set,c=new Set,g=[],h=0,d=0,f=0,E=0,P=0,S=0,T=0,N=0;for(;s.size>0;){let I=this._selectNode(s,r,c);if(I!=null&&(s.delete(I),g.push(I),l.add(I),N=this._outDegree[I.id],h+=this._normSize[I.id]-N*this._dummySize,T=this._inDegree[I.id],d+=T*this._dummySize,S+=N*this._dummySize,E+=this._normSize[I.id]),I==null||s.size===0||h>=a&&this._normSize[I.id]>N*this._dummySize||d>=e*a){i.push(g),g=[];for(let M of l)c.add(M);l.clear(),P-=S;let x=P*this._dummySize+E;x>f&&(f=x),P+=d,h=d,d=0,S=0,E=0}}return{width:f,layering:i}}_selectNode(t,e,o){for(let r of t){let i=!0;for(let s of e[r.id])if(!o.has(s)){i=!1;break}if(i)return r}return null}_isSelfLoop(t){return t.getSource().getNode()===t.getTarget().getNode()}_countEdgesExceptSelfLoops(t){let e=0;for(let o of t)this._isSelfLoop(o)||e++;return e}};var le=class n{constructor(t,e){this.name=t,this.ordinal=e,Object.freeze(this)}create(){switch(this){case n.NETWORK_SIMPLEX:return new $d;case n.LONGEST_PATH:return new Vd;case n.LONGEST_PATH_SOURCE:return new Xd;case n.COFFMAN_GRAHAM:return new jd;case n.INTERACTIVE:return new Zd;case n.BF_MODEL_ORDER:return new Kd;case n.DF_MODEL_ORDER:return new qd;case n.STRETCH_WIDTH:return new Jd;case n.MIN_WIDTH:return new Qd;default:throw new Error(`Unknown layering strategy ${this.name}`)}}toString(){return this.name}static valueOf(t){return n[t]}};le.NETWORK_SIMPLEX=new le("NETWORK_SIMPLEX",0);le.LONGEST_PATH=new le("LONGEST_PATH",1);le.LONGEST_PATH_SOURCE=new le("LONGEST_PATH_SOURCE",2);le.COFFMAN_GRAHAM=new le("COFFMAN_GRAHAM",3);le.INTERACTIVE=new le("INTERACTIVE",4);le.STRETCH_WIDTH=new le("STRETCH_WIDTH",5);le.MIN_WIDTH=new le("MIN_WIDTH",6);le.BF_MODEL_ORDER=new le("BF_MODEL_ORDER",7);le.DF_MODEL_ORDER=new le("DF_MODEL_ORDER",8);var tf=class{process(t,e){e.begin("Simple node placement",1);let o=t.getProperty(p.SPACINGS),r=0;for(let i of t.getLayers()){let s=i.getSize();s.y=0;let a=null;for(let l of i.getNodes())a!=null&&(s.y+=o.getVerticalSpacing(l,a)),s.y+=l.getMargin().top+l.getSize().y+l.getMargin().bottom,a=l;r=Math.max(r,s.y)}for(let i of t.getLayers()){let s=i.getSize(),a=(r-s.y)/2,l=null;for(let c of i.getNodes())l!=null&&(a+=o.getVerticalSpacing(c,l)),a+=c.getMargin().top,c.getPosition().y=a,a+=c.getSize().y+c.getMargin().bottom,l=c}e.done()}getLayoutProcessorConfiguration(t){return null}};var ef=class{constructor(){this._spacings=null}process(t,e){e.begin("Interactive node placement",1),this._spacings=t.getProperty(p.SPACINGS);for(let o of t)this._placeNodes(o);e.done()}_placeNodes(t){let e=Number.NEGATIVE_INFINITY,o=y.NORMAL;for(let r of t){let i=r.getType();if(i!==y.NORMAL){let a=r.getProperty(p.ORIGINAL_DUMMY_NODE_POSITION);a==null?(e=Math.max(e,0),r.getPosition().y=e+this._spacings.getVerticalSpacing(i,o)):r.getPosition().y=a}let s=this._spacings.getVerticalSpacing(i,o);r.getPosition().y<e+s+r.getMargin().top&&(r.getPosition().y=e+s+r.getMargin().top),e=r.getPosition().y+r.getSize().y+r.getMargin().bottom,o=i}}getLayoutProcessorConfiguration(t){return null}};var of=new m("linearSegments.inputPrio",0),rf=new m("linearSegments.outputPrio",0),HI=20,vI=4,BI=3,UI=1e-4,hl="FORW_PENDULUM",F_="BACKW_PENDULUM",FI="RUBBER",k_=class n{constructor(){this.nodes=[],this.id=0,this.indexInLastLayer=-1,this.lastLayer=-1,this.deflection=0,this.weight=0,this.refSegment=null,this.nodeType=null}region(){let t=this;for(;t.refSegment!=null;)t=t.refSegment;return t}split(t,e){let o=this.nodes.indexOf(t),r=new n;r.id=e;let i=this.nodes.splice(o);for(let s of i)s.id=e,r.nodes.push(s);return r}toString(){return`ls[${this.nodes.map(t=>String(t)).join(",")}]`}},sf=class{constructor(){this.linearSegments=null,this.spacings=null}process(t,e){e.begin("Linear segments node placement",1),this.spacings=t.getProperty(p.SPACINGS),this._sortLinearSegments(t),this._createUnbalancedPlacement(t),this._balancePlacement(t),this._postProcess(t),this.linearSegments=null,this.spacings=null,e.done()}getLayoutProcessorConfiguration(t){return null}_sortLinearSegments(t){for(let d of t)for(let f of d){f.id=-1;let E=Number.MIN_SAFE_INTEGER,P=Number.MIN_SAFE_INTEGER;for(let S of f.getPorts()){for(let T of S.getIncomingEdges()){let N=T.getProperty(_.PRIORITY_STRAIGHTNESS);N>E&&(E=N)}for(let T of S.getOutgoingEdges()){let N=T.getProperty(_.PRIORITY_STRAIGHTNESS);N>P&&(P=N)}}f.setProperty(of,E),f.setProperty(rf,P)}let e=[],o=0;for(let d of t)for(let f of d)if(f.id<0){let E=new k_;E.id=o++,this._fillSegment(f,E),e.push(E)}let r=[],i=[];for(let d=0;d<e.length;d++)r.push([]),i.push(0);this._createDependencyGraphEdges(t,e,r,i);let s=e.slice(),a=r.slice(),l=i.slice(),c=0,g=[];for(let d=0;d<s.length;d++)l[d]===0&&g.push(s[d]);let h=new Int32Array(s.length);for(;g.length>0;){let d=g.shift();for(h[d.id]=c++;a[d.id].length>0;){let f=a[d.id].shift();l[f.id]--,l[f.id]===0&&g.push(f)}}this.linearSegments=new Array(s.length);for(let d=0;d<s.length;d++){let f=s[d],E=h[d];this.linearSegments[E]=f,f.id=E;for(let P of f.nodes)P.id=E}}_createDependencyGraphEdges(t,e,o,r){let i=e.length,s=0;for(let a of t){let l=a.getNodes();if(l.length===0)continue;let c=null,g=0,h=0,d=l[h++];for(;d!=null;){let f=e[d.id];if(f.indexInLastLayer>=0){let P=null;for(let S=g+1;S<l.length;S++){let T=l[S],N=e[T.id];if(N.lastLayer===f.lastLayer&&N.indexInLastLayer<f.indexInLastLayer){P=N;break}}if(P!=null){if(c!=null){r[d.id]=r[d.id]-1;let S=o[c.id],T=S.indexOf(f);T>=0&&S.splice(T,1)}f=f.split(d,i++),e.push(f),o.push([]),c!=null?(o[c.id].push(f),r.push(1)):r.push(0)}}let E=null;if(h<l.length){E=l[h++];let P=e[E.id];o[d.id].push(P),r[E.id]=r[E.id]+1}f.lastLayer=s,f.indexInLastLayer=g++,c=d,d=E}s++}}_fillSegment(t,e){let o=t.getType();if(t.id>=0)return!1;if(t.id=e.id,e.nodes.push(t),e.nodeType=o,o===y.LONG_EDGE||o===y.NORTH_SOUTH_PORT)for(let r of t.getPorts())for(let i of r.getSuccessorPorts()){let s=i.getNode(),a=s.getType();if(t.getLayer()!==s.getLayer()&&(a===y.LONG_EDGE||a===y.NORTH_SOUTH_PORT)&&this._fillSegment(s,e))return!0}return!0}_createUnbalancedPlacement(t){let e=t.getLayers().length,o=new Int32Array(e),r=new Array(e).fill(null);for(let i of this.linearSegments){let s=0;for(let a of i.nodes){let l=a.getLayer().getIndex();o[l]++;let c=t.getProperty(_.SPACING_EDGE_EDGE);o[l]>0&&r[l]!=null&&(c=this.spacings.getVerticalSpacing(r[l],a)),s=Math.max(s,a.getLayer().getSize().y+c)}for(let a of i.nodes){a.getPosition().y=s+a.getMargin().top;let l=a.getLayer();l.getSize().y=s+a.getMargin().top+a.getSize().y+a.getMargin().bottom,r[l.getIndex()]=a}}}_balancePlacement(t){let e=Number(t.getProperty(_.NODE_PLACEMENT_LINEAR_SEGMENTS_DEFLECTION_DAMPENING)),o=t.getProperty(_.THOROUGHNESS),r=vI,i=BI,s=HI/o,a=!1,l=hl,c=Number.MAX_SAFE_INTEGER;do{let g=l!==F_,h=l!==hl,d=0;for(let E of this.linearSegments)E.refSegment=null,this._calcDeflection(E,g,h,e),d+=Math.abs(E.deflection);let f;do f=this._mergeRegions(t);while(f);for(let E of this.linearSegments){let P=E.region().deflection;if(P!==0)for(let S of E.nodes)S.getPosition().y+=P}l===hl||l===F_?(r--,r<=0&&(d<c||-r>o)?(l=FI,c=Number.MAX_SAFE_INTEGER):l===hl?(l=F_,c=d):(l=hl,c=d)):(a=d>=c||c-d<s,c=d,a&&i--)}while(!(a&&i<=0))}_calcDeflection(t,e,o,r){let i=0,s=0;for(let a of t.nodes){let l=0,c=0,g=e?a.getProperty(of):Number.MIN_SAFE_INTEGER,h=o?a.getProperty(rf):Number.MIN_SAFE_INTEGER,d=Math.max(g,h);for(let f of a.getPorts()){let E=a.getPosition().y+f.getPosition().y+f.getAnchor().y;if(o)for(let P of f.getOutgoingEdges()){let S=P.getTarget(),T=S.getNode();if(t!==this.linearSegments[T.id]){let N=Math.max(T.getProperty(of),T.getProperty(rf)),I=P.getProperty(_.PRIORITY_STRAIGHTNESS);I>=d&&I>=N&&(l+=T.getPosition().y+S.getPosition().y+S.getAnchor().y-E,c++)}}if(e)for(let P of f.getIncomingEdges()){let S=P.getSource(),T=S.getNode();if(t!==this.linearSegments[T.id]){let N=Math.max(T.getProperty(of),T.getProperty(rf)),I=P.getProperty(_.PRIORITY_STRAIGHTNESS);I>=d&&I>=N&&(l+=T.getPosition().y+S.getPosition().y+S.getAnchor().y-E,c++)}}}c>0&&(i+=l/c,s++)}s>0?(t.deflection=r*i/s,t.weight=s):(t.deflection=0,t.weight=0)}_mergeRegions(t){let e=!1,o=Number(t.getProperty(_.SPACING_NODE_NODE)),r=UI*o;for(let i of t){let s=i.getNodes();if(s.length===0)continue;let a=s[0],l=this.linearSegments[a.id].region();for(let c=1;c<s.length;c++){let g=s[c],h=this.linearSegments[g.id].region();if(l!==h){let d=this.spacings.getVerticalSpacing(a,g),f=a.getPosition().y+a.getSize().y+a.getMargin().bottom+l.deflection+d,E=g.getPosition().y-g.getMargin().top+h.deflection;if(f>E+r){let P=l.weight+h.weight;h.deflection=(h.weight*h.deflection+l.weight*l.deflection)/P,h.weight=P,l.refSegment=h,e=!0}}a=g,l=h}}return e}_postProcess(t){for(let e of this.linearSegments){let o=Number.MAX_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER;for(let c of e.nodes){let g=c.getIndex(),h;if(g>0){let f=c.getLayer().getNodes()[g-1],E=this.spacings.getVerticalSpacing(c,f);h=c.getPosition().y-c.getMargin().top-(f.getPosition().y+f.getSize().y+f.getMargin().bottom+E)}else h=c.getPosition().y-c.getMargin().top;h<o&&(o=h);let d;if(g<c.getLayer().getNodes().length-1){let f=c.getLayer().getNodes()[g+1],E=this.spacings.getVerticalSpacing(c,f);d=f.getPosition().y-f.getMargin().top-(c.getPosition().y+c.getSize().y+c.getMargin().bottom+E)}else d=2*c.getPosition().y;d<r&&(r=d)}let i=Number.MAX_SAFE_INTEGER,s=!1,a=e.nodes[0];for(let c of a.getPorts()){let g=a.getPosition().y+c.getPosition().y+c.getAnchor().y;for(let h of c.getIncomingEdges()){let d=h.getSource(),f=d.getNode().getPosition().y+d.getPosition().y+d.getAnchor().y-g;Math.abs(f)<Math.abs(i)&&Math.abs(f)<(f<0?o:r)&&(i=f,s=!0)}}let l=e.nodes[e.nodes.length-1];for(let c of l.getPorts()){let g=l.getPosition().y+c.getPosition().y+c.getAnchor().y;for(let h of c.getOutgoingEdges()){let d=h.getTarget(),f=d.getNode().getPosition().y+d.getPosition().y+d.getAnchor().y-g;Math.abs(f)<Math.abs(i)&&Math.abs(f)<(f<0?o:r)&&(i=f,s=!0)}}if(s&&i!==0)for(let c of e.nodes)c.getPosition().y+=i}}};var ye=class n{constructor(t){this.name=t}toString(){return this.name}isFlexibleSize(){return this===n.NODE_SIZE}isFlexibleSizeWhereSpacePermits(){return this===n.NODE_SIZE_WHERE_SPACE_PERMITS||this===n.NODE_SIZE}isFlexiblePorts(){return this===n.PORT_POSITION||this===n.NODE_SIZE_WHERE_SPACE_PERMITS||this===n.NODE_SIZE}isAtLeast(t){switch(this){case n.NODE_SIZE:return t.isFlexibleSize();case n.NODE_SIZE_WHERE_SPACE_PERMITS:return t.isFlexibleSizeWhereSpacePermits();case n.PORT_POSITION:return t.isFlexiblePorts();default:return!0}}static getNodeFlexibility(t){return typeof t.getAllProperties=="function"&&t.getAllProperties().has(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY)?t.getProperty(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY):t.getGraph().getProperty(_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY_DEFAULT)}};ye.NONE=new ye("NONE");ye.PORT_POSITION=new ye("PORT_POSITION");ye.NODE_SIZE_WHERE_SPACE_PERMITS=new ye("NODE_SIZE_WHERE_SPACE_PERMITS");ye.NODE_SIZE=new ye("NODE_SIZE");var lf=4,YP=.1,kI=2,VP=1e4,XP=1,WI=1e-5,KP=-1,jP=0,cf=2,gf=class{constructor(){this._lGraph=null,this._spacings=null,this._nGraph=null,this._nodeReps=null,this._edgeReps=null,this._portMap=new Map,this._nodeCount=0,this._edgeCount=0,this._nodeState=null,this._twoPaths=null,this._crossing=null,this._flexibleWhereSpacePermitsEdges=new Set}getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);return e!=null&&e.has(v.EXTERNAL_PORTS)?K.create().addBefore(D.P5_EDGE_ROUTING,w.HIERARCHICAL_PORT_POSITION_PROCESSOR):null}process(t,e){e&&e.begin&&e.begin("Network simplex node placement",1),this._lGraph=t,this._spacings=t.getProperty(p.SPACINGS),this._prepare(),this._buildInitialAuxiliaryGraph(),this._insertNorthSouthAuxiliaryEdges(),this._insertInLayerEdgeAuxiliaryEdges();let o=t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES);o&&this._preferStraightEdges(),this._nGraph.makeConnected();let r=t.getProperty(_.THOROUGHNESS)*this._nGraph.nodes.length;if(li.forGraph(this._nGraph).withIterationLimit(r).withBalancing(!1).execute(ZP(e)),this._flexibleWhereSpacePermitsEdges.size>0){this._insertFlexibleWhereSpaceAuxiliaryEdges();for(let i of this._flexibleWhereSpacePermitsEdges)i.weight=XP;li.forGraph(this._nGraph).withIterationLimit(r).withBalancing(!1).execute(ZP(e))}o&&this._postProcessTwoPaths(),this._applyPositions(),this._cleanup(),e&&e.done&&e.done()}_prepare(){this._nGraph=new Wi;let t=0,e=0;for(let o of this._lGraph.getLayers())for(let r of o.getNodes()){r.id=t++;for(let s of r.getOutgoingEdges())s.id=e++;let i=af(r);for(let s of r.getPorts()){if(i){let l=s.getAnchor().y;if(l!==Math.floor(l)){let c=l-Math.round(l);s.getAnchor().y-=c}}let a=s.getPosition().y+s.getAnchor().y;if(a!==Math.floor(a)){let l=a-Math.round(a);s.getPosition().y-=l}}}this._nodeCount=t,this._edgeCount=e,this._nodeReps=new Array(t),this._edgeReps=new Array(e),this._flexibleWhereSpacePermitsEdges.clear(),this._portMap.clear()}_cleanup(){this._lGraph=null,this._nGraph=null,this._nodeReps=null,this._edgeReps=null,this._portMap.clear(),this._nodeState=null,this._crossing=null,this._twoPaths=null,this._flexibleWhereSpacePermitsEdges.clear()}_buildInitialAuxiliaryGraph(){for(let t of this._lGraph.getLayers())this._transformLayer(t);this._transformEdges()}_transformLayer(t){let e=null;for(let o of t.getNodes()){let r=af(o)?this._transformFixedOrderNode(o):this._transformFixedPosNode(o);if(this._nodeReps[o.id]=r,e!=null){let i=e.origin.getMargin().bottom+this._spacings.getVerticalSpacing(e.origin,o)+o.getMargin().top;e.isFlexible||(i+=e.origin.getSize().y),ee.of().delta(Math.ceil(i)).weight(0).source(e.tail).target(r.head).create()}e=r}}_transformFixedPosNode(t){let e=He.of().origin(t).type("non-flexible").create(this._nGraph);for(let o of t.getPorts())u.SIDES_EAST_WEST.has(o.getSide())&&this._portMap.set(o,e);return new hf(t,!1,e,e)}_transformFixedOrderNode(t){let e=He.of().origin(t).type("flexible-head").create(this._nGraph),o=He.of().origin(t).type("flexible-tail").create(this._nGraph),r=new hf(t,!0,e,o),i=t.getSize().y,s=ye.getNodeFlexibility(t),a=s.isFlexibleSize()?XP:VP,l=ee.of().weight(a).delta(Math.ceil(i)).source(e).target(o).create();s===ye.NODE_SIZE_WHERE_SPACE_PERMITS&&this._flexibleWhereSpacePermitsEdges.add(l);let c=t.getPortSideView(u.WEST);return this._transformPorts([...c].reverse(),r),this._transformPorts(t.getPortSideView(u.EAST),r),r}_transformPorts(t,e){if(t.length===0)return;let o=oo.getIndividualOrDefault(e.origin,_.SPACING_PORT_PORT),r=oo.getIndividualOrDefault(e.origin,_.SPACING_PORTS_SURROUNDING);r==null&&(r=new me);let i=e.head,s=null;for(let a of t){let l=s==null?r.top:o+s.getSize().y,c=He.of().origin(a).type("port").create(this._nGraph);this._portMap.set(a,c),ee.of().weight(0).delta(Math.ceil(l)).source(i).target(c).create(),s=a,i=c}ee.of().weight(0).delta(Math.ceil(r.bottom+s.getSize().y)).source(i).target(e.tail).create()}_transformEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes())for(let o of e.getOutgoingEdges())W_(o)&&this._transformEdge(o)}_transformEdge(t){let e=He.of().type("edge").create(this._nGraph),o=this._nodeReps[t.getSource().getNode().id],r=this._nodeReps[t.getTarget().getNode().id],i=t.getSource(),s=t.getTarget(),a=i.getAnchor().y,l=s.getAnchor().y;o.isFlexible||(a+=i.getPosition().y),r.isFlexible||(l+=s.getPosition().y);let c=Math.max(0,a-l),g=Math.max(0,l-a),h=this._getEdgeWeight(t),d=ee.of(t).weight(h).delta(g).source(e).target(this._portMap.get(t.getSource())).create(),f=ee.of(t).weight(h).delta(c).source(e).target(this._portMap.get(t.getTarget())).create();this._edgeReps[t.id]=new Y_(t,e,d,f)}_insertInLayerEdgeAuxiliaryEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes())if(e.getType()===y.NORMAL)for(let o of e.getConnectedEdges()){if(!o.isInLayerEdge())continue;let i=o.getSource().getNode().getType()!==y.NORMAL?o.getTarget():o.getSource(),s=o.getOther(i).getNode(),a=this._portMap.get(i),l=this._nodeReps[s.id].head,c,g;i.getNode().getIndex()<s.getIndex()?(c=a,g=l):(c=l,g=a),ee.of().delta(0).weight(lf).source(c).target(g).create()}}_insertNorthSouthAuxiliaryEdges(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes()){for(let o of e.getPortSideView(u.SOUTH)){let r=o.getProperty(p.PORT_DUMMY);r!=null&&ee.of().delta(0).weight(YP).source(this._nodeReps[e.id].tail).target(this._nodeReps[r.id].head).create()}for(let o of e.getPortSideView(u.NORTH)){let r=o.getProperty(p.PORT_DUMMY);r!=null&&ee.of().delta(0).weight(YP).source(this._nodeReps[r.id].tail).target(this._nodeReps[e.id].head).create()}}}_insertFlexibleWhereSpaceAuxiliaryEdges(){let t=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;for(let s of this._nGraph.nodes)s.layer<t&&(t=s.layer),s.layer>e&&(e=s.layer);let o=e-t,r=He.of().create(this._nGraph),i=He.of().create(this._nGraph);ee.of().weight(VP*2).delta(o).source(r).target(i).create();for(let s of this._nodeReps)s.origin.getType()===y.NORMAL&&(s.origin.getPorts().length<=1||(ee.of().weight(0).delta(s.tail.layer-t).source(r).target(s.tail).create(),ee.of().weight(0).delta(o-s.head.layer).source(s.head).target(i).create()))}_applyPositions(){for(let t of this._lGraph.getLayers())for(let e of t.getNodes()){let o=this._nodeReps[e.id],r=o.head.layer,i=o.tail.layer;e.getPosition().y=r;let s=i-r-e.getSize().y,a=af(e),l=ye.getNodeFlexibility(e);if(a&&l.isFlexibleSizeWhereSpacePermits()&&(e.getSize().y+=s),a&&l.isFlexiblePorts()){for(let c of e.getPorts())if(u.SIDES_EAST_WEST.has(c.getSide())){let g=this._portMap.get(c);c.getPosition().y=g.layer-r}for(let c of e.getLabels())zI(e,c,s);if(l.isFlexibleSizeWhereSpacePermits())for(let c of e.getPortSideView(u.SOUTH))c.getPosition().y+=s}}}_getEdgeWeight(t){let e=Math.max(1,t.getProperty(_.PRIORITY_STRAIGHTNESS)),o=z_(t.getSource().getNode().getType(),t.getTarget().getNode().getType());return e*o}_preferStraightEdges(){this._nodeState=new Array(this._nodeCount).fill(jP),this._twoPaths=[];for(let e of this._lGraph.getLayers())for(let o of e.getNodes())this._nodeState[o.id]=YI(o);this._markEdgeCrossings();let t=this._identifyPaths();for(let e of t){if(e.length<=1)continue;if(e.length===2){VI(e),af(e[0].getTarget().getNode())||this._twoPaths.push(e);continue}if(XI(e)||KI(e))continue;let o=null;for(let r=0;r<e.length;r++){let i=e[r],s=this._edgeReps[i.id],a;o==null||r===e.length-1?a=z_(y.NORMAL,y.LONG_EDGE):a=z_(y.LONG_EDGE,y.LONG_EDGE),a*=kI,s.left.weight=Math.max(s.left.weight,a),s.right.weight=Math.max(s.right.weight,a),o=i}}}_postProcessTwoPaths(){let t=[...this._twoPaths],e=[];for(;t.length>0;){let o=t.shift();this._improveTwoPath(o,!0)&&e.push(o)}for(;e.length>0;){let o=e.pop();this._improveTwoPath(o,!1)}}_improveTwoPath(t,e){let o=this._edgeReps[t[0].id],r=this._edgeReps[t[1].id];if(o.isStraight()&&r.isStraight())return!1;let i=o.right.target.origin;if(i==null||typeof i.getLayer!="function")return!1;let s=i,a=this._nodeReps[s.id],l=s.getIndex(),c=Number.POSITIVE_INFINITY;if(l>0){let C=s.getLayer().getNodes()[l-1],x=this._nodeReps[C.id],M=Math.ceil(this._spacings.getVerticalSpacing(C,s));c=a.head.layer-s.getMargin().top-(x.head.layer+C.getSize().y+C.getMargin().bottom)-M}let g=Number.POSITIVE_INFINITY;if(l<s.getLayer().getNodes().length-1){let C=s.getLayer().getNodes()[l+1],x=this._nodeReps[C.id],M=Math.ceil(this._spacings.getVerticalSpacing(C,s));g=x.head.layer-C.getMargin().top-(a.head.layer+s.getSize().y+s.getMargin().bottom)-M}if(e&&Math.abs(c-g)<WI)return!0;let h=+nf(o.left),d=-nf(o.right),f=-nf(r.left),E=+nf(r.right),P=o.notStraightBy()>0&&r.notStraightBy()<0,S=o.notStraightBy()<0&&r.notStraightBy()>0,T=o.left.target.layer+o.right.delta<r.right.target.layer+r.left.delta,N=o.left.target.layer+o.right.delta>r.right.target.layer+r.left.delta,I=0;return!P&&!S&&(N?c+f>0?I=f:g-h>0&&(I=h):T&&(c+d>0?I=d:g-E>0&&(I=E))),a.head.layer+=I,a.isFlexible&&(a.tail.layer+=I),!1}_identifyPaths(){let t=[];for(let e of this._lGraph.getLayers())for(let o of e.getNodes())if(this._nodeState[o.id]===cf)for(let r of o.getConnectedEdges()){if(!W_(r))continue;let i=this._follow(r,o,[]);i.length>1&&t.push(i)}return t}_follow(t,e,o){let r=t.getOther(e);if(o.push(t),this._nodeState[r.id]===KP||this._nodeState[r.id]===cf||this._crossing[t.id])return o;this._nodeState[r.id]=KP;for(let i of r.getConnectedEdges())if(!(!W_(i)||i===t))return this._follow(i,r,o);return o}_markEdgeCrossings(){this._crossing=new Array(this._edgeCount).fill(!1);let t=this._lGraph.getLayers();for(let e=0;e+1<t.length;e++)this._markCrossingEdges(t[e],t[e+1])}_markCrossingEdges(t,e){let o=[];for(let i of t.getNodes())for(let s of i.getPortSideView(u.EAST))for(let a of s.getOutgoingEdges())a.isInLayerEdge()||a.isSelfLoop()||a.getTarget().getNode().getLayer()!==e||o.push(a);let r=[...e.getNodes()].reverse();for(let i of r)for(let s of i.getPortSideView(u.WEST))for(let a of s.getIncomingEdges()){if(a.isInLayerEdge()||a.isSelfLoop()||a.getSource().getNode().getLayer()!==t||o.length===0)continue;let l=o.length-1;for(;l>=0&&o[l]!==a;)this._crossing[o[l].id]=!0,this._crossing[a.id]=!0,l--;l>=0&&o.splice(l,1)}}};function ZP(n){return n&&typeof n.subTask=="function"?n.subTask(1):n}function W_(n){return!n.isSelfLoop()&&!n.isInLayerEdge()}function z_(n,t){return n===y.NORMAL&&t===y.NORMAL?1*lf:n===y.NORMAL||t===y.NORMAL?2*lf:8*lf}function nf(n){return Math.abs(n.source.layer-n.target.layer)-n.delta}function zI(n,t,e){let o=n.getProperty(_.NODE_LABELS_PLACEMENT);o!=null&&(o.has&&o.has(k.V_BOTTOM)?t.getPosition().y+=e:o.has&&o.has(k.V_CENTER)&&(t.getPosition().y+=e/2))}function YI(n){let t=0,e=0;for(let o of n.getPorts()){for(let r of o.getIncomingEdges())r.isSelfLoop()||t++;for(let r of o.getOutgoingEdges())r.isSelfLoop()||e++;if(t>1||e>1)return cf}return t+e===1?cf:jP}function VI(n){let t=n[0],e=n[1];t.getTarget().getNode()!==e.getSource().getNode()&&(n[0]=e,n[1]=t)}function XI(n){if(n.length===0)return!1;if(n[0].getSource().getNode().getType()===y.LONG_EDGE)return!0;for(let t of n)if(t.getTarget().getNode().getType()===y.LONG_EDGE)return!0;return!1}function KI(n){if(n.length===0)return!1;if(ye.getNodeFlexibility(n[0].getSource().getNode()).isFlexibleSizeWhereSpacePermits())return!0;for(let e of n)if(ye.getNodeFlexibility(e.getTarget().getNode()).isFlexibleSizeWhereSpacePermits())return!0;return!1}function af(n){if(n.getType()!==y.NORMAL||n.getPorts().length<=1)return!1;let t=n.getProperty(_.PORT_CONSTRAINTS);if(t!=null&&typeof t.isPosFixed=="function"&&t.isPosFixed())return!1;let e=ye.getNodeFlexibility(n);if(e===ye.NONE)return!1;if(!e.isFlexibleSizeWhereSpacePermits()){let o=oo.getIndividualOrDefault(n,_.SPACING_PORT_PORT),r=n.getProperty(_.SPACING_PORTS_SURROUNDING);r==null&&(r=new me(o,o,o,o));let i=n.getPortSideView(u.WEST);if(r.top+r.bottom+(i.length-1)*o>n.getSize().y)return!1;let a=n.getPortSideView(u.EAST);if(r.top+r.bottom+(a.length-1)*o>n.getSize().y)return!1}return!0}var hf=class{constructor(t,e,o,r){this.origin=t,this.isFlexible=e,this.head=o,this.tail=r}},Y_=class{constructor(t,e,o,r){this.origin=t,this.left=o,this.right=r}isStraight(){return this.notStraightBy()===0}notStraightBy(){return this.left.target.layer-this.left.delta-(this.right.target.layer-this.right.delta)}};var rr=class{constructor(t,e,o,r){this.layeredGraph=t,this.spacings=t.getProperty(p.SPACINGS),this.root=new Array(e),this.blockSize=new Array(e),this.align=new Array(e),this.innerShift=new Array(e),this.sink=new Array(e),this.shift=new Array(e),this.y=new Array(e),this.su=new Array(e).fill(!1),this.od=new Array(e).fill(!0),this.vdir=o,this.hdir=r}cleanup(){this.root=null,this.blockSize=null,this.align=null,this.innerShift=null,this.sink=null,this.shift=null,this.y=null}layoutSize(){let t=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;for(let o of this.layeredGraph.getLayers())for(let r of o.getNodes()){let i=this.y[r.id],s=i+this.blockSize[this.root[r.id].id];i<t&&(t=i),s>e&&(e=s)}return e-t}calculateDelta(t,e){let o=this.y[t.getNode().id]+this.innerShift[t.getNode().id]+t.getPosition().y+t.getAnchor().y;return this.y[e.getNode().id]+this.innerShift[e.getNode().id]+e.getPosition().y+e.getAnchor().y-o}shiftBlock(t,e){let o=t;do this.y[o.id]=this.y[o.id]+e,o=this.align[o.id];while(o!==t)}checkSpaceAbove(t,e,o){let r=e,i=t,s=i;do{s=this.align[s.id];let a=this.getMinY(s),l=this._getUpperNeighbor(s,o);if(l!=null){let c=this.getMaxY(l),g=a-(c+this.spacings.getVerticalSpacing(s,l));g<r&&(r=g)}}while(i!==s);return r}checkSpaceBelow(t,e,o){let r=e,i=t,s=i;do{s=this.align[s.id];let a=this.getMaxY(s),l=this._getLowerNeighbor(s,o);if(l!=null){let g=this.getMinY(l)-(a+this.spacings.getVerticalSpacing(s,l));g<r&&(r=g)}}while(i!==s);return r}getMinY(t){let e=this.root[t.id];return this.y[e.id]+this.innerShift[t.id]-t.getMargin().top}getMaxY(t){let e=this.root[t.id];return this.y[e.id]+this.innerShift[t.id]+t.getSize().y+t.getMargin().bottom}_getLowerNeighbor(t,e){let o=t.getLayer(),r=e.nodeIndex[t.id];return r<o.getNodes().length-1?o.getNodes()[r+1]:null}_getUpperNeighbor(t,e){let o=t.getLayer(),r=e.nodeIndex[t.id];return r>0?o.getNodes()[r-1]:null}toString(){let t="";return this.hdir===Zt.RIGHT?t+="RIGHT":this.hdir===Zt.LEFT&&(t+="LEFT"),this.vdir===xt.DOWN?t+="DOWN":this.vdir===xt.UP?t+="UP":t+="BALANCED",t}},xt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};xt.DOWN=new xt("DOWN");xt.UP=new xt("UP");var Zt=class{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}};Zt.RIGHT=new Zt("RIGHT");Zt.LEFT=new Zt("LEFT");function $P(n,t){for(let e of n.getConnectedEdges())if(e.getTarget().getNode()===t||e.getSource().getNode()===t)return e;return null}function V_(n){let t=new Map;for(let e of n.layeredGraph.getLayers())for(let o of e.getNodes()){let r=n.root[o.id],i=t.get(r);i==null&&(i=[],t.set(r,i)),i.push(o)}return t}var df=class{constructor(t,e){this.layeredGraph=t,this.ni=e}verticalAlignment(t,e){for(let r of this.layeredGraph.getLayers())for(let i of r.getNodes())t.root[i.id]=i,t.align[i.id]=i,t.innerShift[i.id]=0;let o=this.layeredGraph.getLayers();t.hdir===Zt.LEFT&&(o=[...o].reverse());for(let r of o){let i=-1,s=r.getNodes();t.vdir===xt.UP&&(i=Number.MAX_SAFE_INTEGER,s=[...s].reverse());for(let a of s){let l=t.hdir===Zt.LEFT?this.ni.rightNeighbors[a.id]:this.ni.leftNeighbors[a.id];if(l.length===0)continue;let c=l.length,g=Math.floor((c+1)/2)-1,h=Math.ceil((c+1)/2)-1;if(t.vdir===xt.UP){for(let d=h;d>=g;d--)if(t.align[a.id]===a){let f=l[d],E=f.getFirst();!e.has(f.getSecond())&&i>this.ni.nodeIndex[E.id]&&(t.align[E.id]=a,t.root[a.id]=t.root[E.id],t.align[a.id]=t.root[a.id],t.od[t.root[a.id].id]=t.od[t.root[a.id].id]&&a.getType()===y.LONG_EDGE,i=this.ni.nodeIndex[E.id])}}else for(let d=g;d<=h;d++)if(t.align[a.id]===a){let f=l[d],E=f.getFirst();!e.has(f.getSecond())&&i<this.ni.nodeIndex[E.id]&&(t.align[E.id]=a,t.root[a.id]=t.root[E.id],t.align[a.id]=t.root[a.id],t.od[t.root[a.id].id]=t.od[t.root[a.id].id]&&a.getType()===y.LONG_EDGE,i=this.ni.nodeIndex[E.id])}}}}insideBlockShift(t){let e=V_(t);for(let o of e.keys()){let r=o.getMargin().top,i=o.getSize().y+o.getMargin().bottom;t.innerShift[o.id]=0;let s=o,a;for(;(a=t.align[s.id])!==o;){let l=$P(s,a),c;t.hdir===Zt.LEFT?c=l.getTarget().getPosition().y+l.getTarget().getAnchor().y-l.getSource().getPosition().y-l.getSource().getAnchor().y:c=l.getSource().getPosition().y+l.getSource().getAnchor().y-l.getTarget().getPosition().y-l.getTarget().getAnchor().y;let g=t.innerShift[s.id]+c;t.innerShift[a.id]=g,r=Math.max(r,a.getMargin().top-g),i=Math.max(i,g+a.getSize().y+a.getMargin().bottom),s=a}s=o;do t.innerShift[s.id]=t.innerShift[s.id]+r,s=t.align[s.id];while(s!==o);t.blockSize[o.id]=r+i}}};var oa=Object.freeze({NONE:"NONE",IMPROVE_STRAIGHTNESS:"IMPROVE_STRAIGHTNESS",values(){return[this.NONE,this.IMPROVE_STRAIGHTNESS]},valueOf(n){var t;return(t=this[n])!=null?t:null}});var qP=Number.MAX_VALUE;var ff=class{constructor(){this.bal=null,this.ni=null,this.blockFinished=new Set,this.postProcessablesQueue=[],this.postProcessablesStack=[]}init(t,e){this.bal=t,this.ni=e,this.blockFinished.clear(),this.postProcessablesQueue.length=0,this.postProcessablesStack.length=0}finishBlock(t){this.blockFinished.add(t)}calculateThreshold(t,e,o){throw new Error("abstract")}postProcess(){throw new Error("abstract")}getOther(t,e){if(t.getSource().getNode()===e)return t.getTarget().getNode();if(t.getTarget().getNode()===e)return t.getSource().getNode();throw new Error(`Node ${e} is neither source nor target of edge ${t}`)}},uf=class extends ff{calculateThreshold(t,e,o){return this.bal.vdir===xt.UP?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY}postProcess(){}},_f=class extends ff{calculateThreshold(t,e,o){let r=e===o,i=this.bal.align[o.id]===e;if(!(r||i))return t;let s=t;return r&&(s=this._getBound(e,!0)),!isFinite(s)&&i&&(s=this._getBound(o,!1)),s}_pickEdge(t){let e;t.isRoot?e=this.bal.hdir===Zt.RIGHT?t.free.getIncomingEdges():t.free.getOutgoingEdges():e=this.bal.hdir===Zt.LEFT?t.free.getIncomingEdges():t.free.getOutgoingEdges();let o=!1;for(let r of e)if(!(!this.bal.od[this.bal.root[t.free.id].id]&&r.isInLayerEdge())&&!this.bal.su[this.bal.root[t.free.id].id]&&(o=!0,this.blockFinished.has(this.bal.root[this.getOther(r,t.free).id])))return t.hasEdges=!0,t.edge=r,t;return t.hasEdges=o,t.edge=null,t}_getBound(t,e){let o=this.bal.vdir===xt.UP?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,r=this._pickEdge(new X_(t,e));if(r.edge==null&&r.hasEdges)return this.postProcessablesQueue.push(r),o;if(r.edge==null)return o;let i=r.edge.getSource(),s=r.edge.getTarget(),a;if(e){let l=this.bal.hdir===Zt.RIGHT?s:i,c=this.bal.hdir===Zt.RIGHT?i:s,g=this.bal.root[c.getNode().id];a=this.bal.y[g.id]+this.bal.innerShift[c.getNode().id]+c.getPosition().y+c.getAnchor().y-this.bal.innerShift[l.getNode().id]-l.getPosition().y-l.getAnchor().y}else{let l=this.bal.hdir===Zt.LEFT?s:i,c=this.bal.hdir===Zt.LEFT?i:s;a=this.bal.y[this.bal.root[c.getNode().id].id]+this.bal.innerShift[c.getNode().id]+c.getPosition().y+c.getAnchor().y-this.bal.innerShift[l.getNode().id]-l.getPosition().y-l.getAnchor().y}return this.bal.su[this.bal.root[i.getNode().id].id]=!0,this.bal.su[this.bal.root[s.getNode().id].id]=!0,a}postProcess(){for(;this.postProcessablesQueue.length>0;){let t=this.postProcessablesQueue.shift(),e=this._pickEdge(t);if(e.edge==null)continue;let o=e.edge;if(!this.bal.od[this.bal.root[t.free.id].id]&&o.isInLayerEdge())continue;this._process(t)||this.postProcessablesStack.push(t)}for(;this.postProcessablesStack.length>0;)this._process(this.postProcessablesStack.pop())}_process(t){let e=t.edge,o=e.getSource().getNode()===t.free?e.getTarget():e.getSource(),r=e.getSource().getNode()===t.free?e.getSource():e.getTarget(),i=this.bal.calculateDelta(o,r);if(i>0&&i<qP){let s=this.bal.checkSpaceAbove(r.getNode(),i,this.ni);return this.bal.shiftBlock(r.getNode(),-s),s>0}if(i<0&&-i<qP){let s=this.bal.checkSpaceBelow(r.getNode(),-i,this.ni);return this.bal.shiftBlock(r.getNode(),s),s>0}return!1}},X_=class{constructor(t,e){this.free=t,this.isRoot=e,this.hasEdges=!1,this.edge=null}};var pf=class{constructor(t,e){this.layeredGraph=t,this.ni=e,this.spacings=t.getProperty(p.SPACINGS),this.sinkNodes=new Map,t.getProperty(_.NODE_PLACEMENT_BK_EDGE_STRAIGHTENING)===oa.IMPROVE_STRAIGHTNESS?this.threshStrategy=new _f:this.threshStrategy=new uf}horizontalCompaction(t){for(let o of this.layeredGraph.getLayers())for(let r of o.getNodes())t.sink[r.id]=r,t.shift[r.id]=t.vdir===xt.UP?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;this.sinkNodes.clear();let e=this.layeredGraph.getLayers();t.hdir===Zt.LEFT&&(e=[...e].reverse()),this.threshStrategy.init(t,this.ni),t.y.fill(null);for(let o of e){let r=o.getNodes();t.vdir===xt.UP&&(r=[...r].reverse());for(let i of r)t.root[i.id]===i&&this._placeBlock(i,t)}this._placeClasses(t);for(let o of e)for(let r of o.getNodes())if(t.y[r.id]=t.y[t.root[r.id].id],r===t.root[r.id]){let i=t.shift[t.sink[r.id].id];(t.vdir===xt.UP&&i>Number.NEGATIVE_INFINITY||t.vdir===xt.DOWN&&i<Number.POSITIVE_INFINITY)&&(t.y[r.id]=t.y[r.id]+i)}this.threshStrategy.postProcess()}_placeBlock(t,e){if(e.y[t.id]!=null)return;let o=!0;e.y[t.id]=0;let r=t,i=e.vdir===xt.DOWN?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;do{let s=this.ni.nodeIndex[r.id],a=r.getLayer().getNodes().length;if(e.vdir===xt.DOWN&&s>0||e.vdir===xt.UP&&s<a-1){let c=e.vdir===xt.UP?s+1:s-1,g=r.getLayer().getNodes()[c],h=e.root[g.id];if(this._placeBlock(h,e),i=this.threshStrategy.calculateThreshold(i,t,r),e.sink[t.id]===t&&(e.sink[t.id]=e.sink[h.id]),e.sink[t.id]===e.sink[h.id]){let d=this.spacings.getVerticalSpacing(r,g);if(e.vdir===xt.UP){let f=e.y[t.id],E=e.y[h.id]+e.innerShift[g.id]-g.getMargin().top-d-r.getMargin().bottom-r.getSize().y-e.innerShift[r.id];o?(o=!1,e.y[t.id]=Math.min(E,i)):e.y[t.id]=Math.min(f,Math.min(E,i))}else{let f=e.y[t.id],E=e.y[h.id]+e.innerShift[g.id]+g.getSize().y+g.getMargin().bottom+d+r.getMargin().top-e.innerShift[r.id];o?(o=!1,e.y[t.id]=Math.max(E,i)):e.y[t.id]=Math.max(f,Math.max(E,i))}}else{let d=Number(this.layeredGraph.getProperty(_.SPACING_NODE_NODE)),f=this._getOrCreateClassNode(e.sink[t.id]),E=this._getOrCreateClassNode(e.sink[h.id]);if(e.vdir===xt.UP){let P=e.y[t.id]+e.innerShift[r.id]+r.getSize().y+r.getMargin().bottom+d-(e.y[h.id]+e.innerShift[g.id]-g.getMargin().top);f.addEdge(E,P)}else{let P=e.y[t.id]+e.innerShift[r.id]-r.getMargin().top-e.y[h.id]-e.innerShift[g.id]-g.getSize().y-g.getMargin().bottom-d;f.addEdge(E,P)}}}else i=this.threshStrategy.calculateThreshold(i,t,r);r=e.align[r.id]}while(r!==t);this.threshStrategy.finishBlock(t)}_placeClasses(t){let e=[];for(let o of this.sinkNodes.values())o.indegree===0&&e.push(o);for(;e.length>0;){let o=e.shift();o.classShift==null&&(o.classShift=0);for(let r of o.outgoing)r.target.classShift==null?r.target.classShift=o.classShift+r.separation:t.vdir===xt.DOWN?r.target.classShift=Math.min(r.target.classShift,o.classShift+r.separation):r.target.classShift=Math.max(r.target.classShift,o.classShift+r.separation),r.target.indegree--,r.target.indegree===0&&e.push(r.target)}for(let o of this.sinkNodes.values())t.shift[o.node.id]=o.classShift}_getOrCreateClassNode(t){let e=this.sinkNodes.get(t);return e==null&&(e=new K_,e.node=t,this.sinkNodes.set(t,e)),e}},K_=class{constructor(){this.classShift=null,this.node=null,this.outgoing=[],this.indegree=0}addEdge(t,e){let o=new Z_;o.target=t,o.separation=e,t.indegree++,this.outgoing.push(o)}},Z_=class{constructor(){this.separation=0,this.target=null}};var Ef=class n{constructor(){this.nodeCount=0,this.layerIndex=null,this.nodeIndex=null,this.leftNeighbors=[],this.rightNeighbors=[]}cleanup(){this.layerIndex=null,this.nodeIndex=null,this.leftNeighbors.length=0,this.rightNeighbors.length=0}static buildFor(t){let e=new n,o=0;for(let l of t)o+=l.getNodes().length;e.nodeCount=o,e.layerIndex=new Int32Array(t.getLayers().length),e.nodeIndex=new Int32Array(o);let r=0,i=0,s=0;for(let l of t.getLayers()){l.id=r++,e.layerIndex[l.id]=i++;let c=0;for(let g of l.getNodes())g.id=s++,e.nodeIndex[g.id]=c++}let a=(l,c)=>{let g=e.nodeIndex[l.getFirst().id]-e.nodeIndex[c.getFirst().id];return Math.sign(g)};return e.leftNeighbors=new Array(o),e.rightNeighbors=new Array(o),jI(e,t,a),ZI(e,t,a),e}};function ZI(n,t,e){for(let o of t)for(let r of o){let i=[],s=0;for(let a of r.getOutgoingEdges()){if(a.isSelfLoop()||a.isInLayerEdge())continue;let l=a.getProperty(_.PRIORITY_STRAIGHTNESS);l>s&&(s=l,i.length=0),l===s&&i.push(Gt.of(a.getTarget().getNode(),a))}i.sort(e),n.rightNeighbors[r.id]=i}}function jI(n,t,e){for(let o of t)for(let r of o){let i=[],s=0;for(let a of r.getIncomingEdges()){if(a.isSelfLoop()||a.isInLayerEdge())continue;let l=a.getProperty(_.PRIORITY_STRAIGHTNESS);l>s&&(s=l,i.length=0),l===s&&i.push(Gt.of(a.getSource().getNode(),a))}i.sort(e),n.leftNeighbors[r.id]=i}}var $I=3,mf=class{constructor(){this._lGraph=null,this._markedEdges=new Set,this._ni=null,this._produceBalancedLayout=!1}process(t,e){e.begin("Brandes & Koepf node placement",1),this._lGraph=t,this._ni=Ef.buildFor(t);let o=t.getProperty(_.NODE_PLACEMENT_BK_FIXED_ALIGNMENT),r=t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES);this._produceBalancedLayout=o==="NONE"&&!r||o==="BALANCED",this._markConflicts(t);let i=[];switch(o){case"LEFTDOWN":i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.LEFT));break;case"LEFTUP":i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.LEFT));break;case"RIGHTDOWN":i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.RIGHT));break;case"RIGHTUP":i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.RIGHT));break;default:i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.RIGHT)),i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.RIGHT)),i.push(new rr(t,this._ni.nodeCount,xt.DOWN,Zt.LEFT)),i.push(new rr(t,this._ni.nodeCount,xt.UP,Zt.LEFT))}let s=new df(t,this._ni);for(let c of i)s.verticalAlignment(c,this._markedEdges),s.insideBlockShift(c);let a=new pf(t,this._ni);for(let c of i)a.horizontalCompaction(c);let l=null;if(this._produceBalancedLayout){let c=this._createBalancedLayout(i,this._ni.nodeCount);this._checkOrderConstraint(t,c)&&(l=c)}if(l==null)for(let c of i)this._checkOrderConstraint(t,c)&&(l==null||l.layoutSize()>c.layoutSize())&&(l=c);l==null&&(l=i[0]);for(let c of t.getLayers())for(let g of c.getNodes())g.getPosition().y=l.y[g.id]+l.innerShift[g.id];for(let c of i)c.cleanup();this._ni.cleanup(),this._markedEdges.clear(),e.done()}_markConflicts(t){let e=t.getLayers().length;if(e<$I)return;let o=new Int32Array(e),r=t.getLayers();for(let i=0;i<e;i++)o[i]=r[i].getNodes().length;for(let i=1;i<e-1;i++){let s=r[i+1],a=s.getNodes(),l=0,c=0;for(let g=0;g<o[i+1];g++){let h=a[g];if(g===o[i+1]-1||this._incidentToInnerSegment(h,i+1,i)){let d=o[i]-1;for(this._incidentToInnerSegment(h,i+1,i)&&(d=this._ni.nodeIndex[this._ni.leftNeighbors[h.id][0].getFirst().id]);c<=g;){let f=s.getNodes()[c];if(!this._incidentToInnerSegment(f,i+1,i))for(let E of this._ni.leftNeighbors[f.id]){let P=this._ni.nodeIndex[E.getFirst().id];(P<l||P>d)&&this._markedEdges.add(E.getSecond())}c++}l=d}}}}_incidentToInnerSegment(t,e,o){if(t.getType()!==y.LONG_EDGE)return!1;for(let r of t.getIncomingEdges())if(r.getSource().getNode().getType()===y.LONG_EDGE&&this._ni.layerIndex[r.getSource().getNode().getLayer().id]===o&&this._ni.layerIndex[t.getLayer().id]===e)return!0;return!1}_createBalancedLayout(t,e){let o=t.length,r=new rr(this._lGraph,e,null,null),i=new Float64Array(o),s=new Float64Array(o),a=new Float64Array(o),l=0;for(let h=0;h<o;h++)s[h]=Number.POSITIVE_INFINITY,a[h]=Number.NEGATIVE_INFINITY;for(let h=0;h<o;h++){let d=t[h];i[h]=d.layoutSize(),i[l]>i[h]&&(l=h);for(let f of this._lGraph)for(let E of f){let P=d.y[E.id]+d.innerShift[E.id];P<s[h]&&(s[h]=P);let S=P+E.getSize().y;S>a[h]&&(a[h]=S)}}let c=new Float64Array(o);for(let h=0;h<o;h++)c[h]=t[h].vdir===xt.DOWN?s[l]-s[h]:a[l]-a[h];let g=new Array(o);for(let h of this._lGraph.getLayers())for(let d of h.getNodes()){for(let f=0;f<o;f++)g[f]=t[f].y[d.id]+t[f].innerShift[d.id]+c[f];g.sort((f,E)=>f-E),r.y[d.id]=(g[1]+g[2])/2,r.innerShift[d.id]=0}return r}_checkOrderConstraint(t,e){for(let o of t.getLayers()){let r=Number.NEGATIVE_INFINITY;for(let i of o.getNodes()){let s=e.y[i.id]+e.innerShift[i.id]-i.getMargin().top,a=e.y[i.id]+e.innerShift[i.id]+i.getSize().y+i.getMargin().bottom;if(s>r&&a>r)r=e.y[i.id]+e.innerShift[i.id]+i.getSize().y+i.getMargin().bottom;else return!1}}return!0}getLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES);return e&&e.has&&e.has("EXTERNAL_PORTS"),null}};var ze=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}create(){switch(this){case n.SIMPLE:return new tf;case n.INTERACTIVE:return new ef;case n.LINEAR_SEGMENTS:return new sf;case n.BRANDES_KOEPF:return new mf;case n.NETWORK_SIMPLEX:return new gf;default:throw new Error("Unknown node placement strategy: "+this.name)}}static valueOf(t){return n[t]}};ze.SIMPLE=new ze("SIMPLE");ze.INTERACTIVE=new ze("INTERACTIVE");ze.LINEAR_SEGMENTS=new ze("LINEAR_SEGMENTS");ze.BRANDES_KOEPF=new ze("BRANDES_KOEPF");ze.NETWORK_SIMPLEX=new ze("NETWORK_SIMPLEX");var vo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};vo.CENTER=new vo("CENTER");vo.TOP_LEFT=new vo("TOP_LEFT");var Uo=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};Uo.ONE_SIDED=new Uo("ONE_SIDED");Uo.TWO_SIDED=new Uo("TWO_SIDED");Uo.OFF=new Uo("OFF");var Me=class n{constructor(t){this.name=t,Object.freeze(this)}toString(){return this.name}static valueOf(t){return n[t]}};Me.NONE=new Me("NONE");Me.INSIDE_PORT_SIDE_GROUPS=new Me("INSIDE_PORT_SIDE_GROUPS");Me.GROUP_MODEL_ORDER=new Me("GROUP_MODEL_ORDER");Me.MODEL_ORDER=new Me("MODEL_ORDER");var so=class{constructor(t){this.name=t}toString(){return this.name}};so.NONE=new so("NONE");so.LEFTUP=new so("LEFTUP");so.RIGHTUP=new so("RIGHTUP");so.LEFTDOWN=new so("LEFTDOWN");so.RIGHTDOWN=new so("RIGHTDOWN");so.BALANCED=new so("BALANCED");var Wr=class{constructor(t){this.name=t}toString(){return this.name}};Wr.NONE=new Wr("NONE");Wr.ALTERNATING=new Wr("ALTERNATING");var Yi=class{constructor(t){this.name=t}toString(){return this.name}};Yi.INPUT_ORDER=new Yi("INPUT_ORDER");Yi.PORT_DEGREE=new Yi("PORT_DEGREE");var Fo=class{constructor(t){this._name=t}toString(){return this._name}};Fo.OFF=new Fo("OFF");Fo.SINGLE_EDGE=new Fo("SINGLE_EDGE");Fo.MULTI_EDGE=new Fo("MULTI_EDGE");var Yet=new m("org.eclipse.elk.layered.cycleBreaking.strategy",()=>Xt.GREEDY),Vet=new m("org.eclipse.elk.layered.layering.strategy",()=>le.NETWORK_SIMPLEX),Xet=new m("org.eclipse.elk.layered.layering.layerConstraint",()=>J.NONE),Ket=new m("org.eclipse.elk.layered.layering.layerChoiceConstraint",null,-1),Zet=new m("org.eclipse.elk.layered.layering.layerId",-1,-1),jet=new m("org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",4,-1),$et=new m("org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",2,-1),qet=new m("org.eclipse.elk.layered.layering.nodePromotion.strategy",()=>ut.NONE),Jet=new m("org.eclipse.elk.layered.layering.nodePromotion.maxIterations",0,0),Qet=new m("org.eclipse.elk.layered.layering.coffmanGraham.layerBound",Number.MAX_SAFE_INTEGER),tot=new m("org.eclipse.elk.layered.crossingMinimization.strategy",()=>We.LAYER_SWEEP),eot=new m("org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",!1),oot=new m("org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",.1),rot=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",40,0),iot=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",()=>Uo.TWO_SIDED),JP=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type",()=>Uo.OFF),sot=new m("org.eclipse.elk.layered.crossingMinimization.semiInteractive",!1),not=new m("org.eclipse.elk.layered.crossingMinimization.inLayerPredOf"),aot=new m("org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf"),lot=new m("org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint",null,-1),cot=new m("org.eclipse.elk.layered.crossingMinimization.positionId",-1,-1),got=new m("org.eclipse.elk.layered.nodePlacement.strategy",()=>ze.BRANDES_KOEPF),hot=new m("org.eclipse.elk.layered.nodePlacement.favorStraightEdges"),dot=new m("org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",()=>oa.IMPROVE_STRAIGHTNESS),fot=new m("org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment",()=>so.NONE),uot=new m("org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",.3,Xe.greaterThan(0)),_ot=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility"),pot=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",()=>ye.NONE),Eot=new m("org.eclipse.elk.layered.edgeRouting.splines.mode",()=>Qr.SLOPPY),mot=new m("org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",.2),Pot=new m("org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",2),Oot=new m("org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",()=>Qo.NORTH),Sot=new m("org.eclipse.elk.layered.edgeRouting.selfLoopOrdering",()=>Je.STACKED),Tot=new m("org.eclipse.elk.layered.spacing.baseValue",null,0),Not=new m("org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",10,0),yot=new m("org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",10,0),Iot=new m("org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",20,0),QP=new m("org.eclipse.elk.layered.priority.direction",0,0),Rot=new m("org.eclipse.elk.layered.priority.shortness",0,0),tO=new m("org.eclipse.elk.layered.priority.straightness",0,0),Lot=new m("org.eclipse.elk.layered.compaction.postCompaction.strategy",()=>ie.NONE),Aot=new m("org.eclipse.elk.layered.compaction.postCompaction.constraints",()=>Ur.SCANLINE),Cot=new m("org.eclipse.elk.layered.compaction.connectedComponents",!1),xot=new m("org.eclipse.elk.layered.highDegreeNodes.treatment",!1),Dot=new m("org.eclipse.elk.layered.highDegreeNodes.threshold",16,0),wot=new m("org.eclipse.elk.layered.highDegreeNodes.treeHeight",5,0),Mot=new m("org.eclipse.elk.layered.wrapping.strategy",()=>Fo.OFF),bot=new m("org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",10),Got=new m("org.eclipse.elk.layered.wrapping.correctionFactor",1),Hot=new m("org.eclipse.elk.layered.wrapping.cutting.strategy",()=>ro.MSD),vot=new m("org.eclipse.elk.layered.wrapping.cutting.cuts"),Bot=new m("org.eclipse.elk.layered.wrapping.cutting.msd.freedom",1,0),Uot=new m("org.eclipse.elk.layered.wrapping.validify.strategy",()=>io.GREEDY),Fot=new m("org.eclipse.elk.layered.wrapping.validify.forbiddenIndices"),kot=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",!0),Wot=new m("org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",2),zot=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",!0),Yot=new m("org.eclipse.elk.layered.layerUnzipping.strategy",()=>Wr.NONE),Vot=new m("org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",!1),eO=new m("org.eclipse.elk.layered.layerUnzipping.layerSplit",2,1),Xot=new m("org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",!0),oO=new m("org.eclipse.elk.layered.edgeLabels.sideSelection",()=>Tt.SMART_DOWN),Kot=new m("org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy",()=>Ct.MEDIAN_LAYER),Zot=new m("org.eclipse.elk.layered.considerModelOrder.strategy",()=>$t.NONE),jot=new m("org.eclipse.elk.layered.considerModelOrder.portModelOrder",!1),$ot=new m("org.eclipse.elk.layered.considerModelOrder.noModelOrder",!1),qot=new m("org.eclipse.elk.layered.considerModelOrder.components",()=>Me.NONE),Jot=new m("org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",()=>Ao.DUMMY_NODE_OVER),Qot=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",0),trt=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",0),ert=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",0),ort=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",0),rrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.componentGroupId",0),irt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP),srt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredSourceId"),nrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cbPreferredTargetId"),art=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP),lrt=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cmEnforcedGroupOrders","1, 2, 6, 7, 10, 11"),crt=new m("org.eclipse.elk.layered.directionCongruency",()=>jo.READING_DIRECTION),grt=new m("org.eclipse.elk.layered.feedbackEdges",!1),hrt=new m("org.eclipse.elk.layered.interactiveReferencePoint",()=>vo.CENTER),drt=new m("org.eclipse.elk.layered.mergeEdges",!1),frt=new m("org.eclipse.elk.layered.mergeHierarchyEdges",!0),urt=new m("org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",!1),_rt=new m("org.eclipse.elk.layered.portSortingStrategy",()=>Yi.INPUT_ORDER),prt=new m("org.eclipse.elk.layered.thoroughness",7,1),Ert=new m("org.eclipse.elk.layered.unnecessaryBendpoints",!1),mrt=new m("org.eclipse.elk.layered.generatePositionAndLayerIds",!1);var _=class{};_.EDGE_LABELS_PLACEMENT=new m("org.eclipse.elk.edgeLabels.placement",()=>St.CENTER);_.EDGE_LABELS_INLINE=new m("org.eclipse.elk.edgeLabels.inline",!1);_.INTERACTIVE_REFERENCE_POINT=new m("org.eclipse.elk.layered.interactiveReferencePoint",()=>vo.CENTER);_.PRIORITY_DIRECTION=QP;_.LAYERING_LAYER_CONSTRAINT=new m("org.eclipse.elk.layered.layering.layerConstraint",()=>J.NONE);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_GROUP_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingId",0);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_SOURCE_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingPreferredSourceId",-1);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CB_PREFERRED_TARGET_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.cycleBreakingPreferredTargetId",-1);_.LAYERING_LAYER_ID=new m("org.eclipse.elk.layered.layering.layerId",0);_.LAYERING_COFFMAN_GRAHAM_LAYER_BOUND=new m("org.eclipse.elk.layered.layering.coffmanGraham.layerBound",Number.MAX_SAFE_INTEGER);_.PRIORITY_SHORTNESS=new m("org.eclipse.elk.layered.priority.shortness",0);_.PRIORITY_STRAIGHTNESS=tO;_.NODE_PLACEMENT_BK_EDGE_STRAIGHTENING=new m("org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening",()=>oa.IMPROVE_STRAIGHTNESS);_.NODE_PLACEMENT_BK_FIXED_ALIGNMENT=new m("org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment","NONE");_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES=new m("org.eclipse.elk.layered.nodePlacement.favorStraightEdges");_.NODE_PLACEMENT_LINEAR_SEGMENTS_DEFLECTION_DAMPENING=new m("org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening",.3);_.UNNECESSARY_BENDPOINTS=new m("org.eclipse.elk.layered.unnecessaryBendpoints",!1);_.JUNCTION_POINTS=new m("org.eclipse.elk.junctionPoints");_.EDGE_THICKNESS=new m("org.eclipse.elk.edge.thickness",1);_.PORT_INDEX=new m("org.eclipse.elk.port.index");_.PORT_SORTING_STRATEGY=new m("org.eclipse.elk.layered.portSortingStrategy","INPUT_ORDER");_.SPACING_PORTS_SURROUNDING=new m("org.eclipse.elk.spacing.portsSurrounding");_.COMMENT_BOX=new m("org.eclipse.elk.commentBox",!1);_.SPACING_COMMENT_COMMENT=new m("org.eclipse.elk.spacing.commentComment",20);_.SPACING_COMMENT_NODE=new m("org.eclipse.elk.spacing.commentNode",20);_.MARGINS=new m("org.eclipse.elk.margins");_.SPACING_EDGE_LABEL=new m("org.eclipse.elk.spacing.edgeLabel",2);_.SPACING_LABEL_LABEL=new m("org.eclipse.elk.spacing.labelLabel",0);_.DIRECTION=new m("org.eclipse.elk.direction",R.UNDEFINED);_.EDGE_ROUTING=new m("org.eclipse.elk.edgeRouting",()=>At.ORTHOGONAL);_.DIRECTION_CONGRUENCY=new m("org.eclipse.elk.layered.directionCongruency",jo.READING_DIRECTION);_.NODE_LABELS_PADDING=new m("org.eclipse.elk.nodeLabels.padding");_.NODE_LABELS_PLACEMENT=new m("org.eclipse.elk.nodeLabels.placement");_.EDGE_LABELS_SIDE_SELECTION=oO;_.EDGE_LABELS_CENTER_LABEL_PLACEMENT_STRATEGY=new m("org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy");_.ALIGNMENT=new m("org.eclipse.elk.alignment");_.POSITION=new m("org.eclipse.elk.position");_.NODE_SIZE_MINIMUM=new m("org.eclipse.elk.nodeSize.minimum");_.HYPERNODE=new m("org.eclipse.elk.hypernode",!1);_.CROSSING_MINIMIZATION_POSITION_ID=new m("org.eclipse.elk.layered.crossingMinimization.positionId",0);_.LAYERING_LAYER_CHOICE_CONSTRAINT=new m("org.eclipse.elk.layered.layering.layerChoiceConstraint");_.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF=new m("org.eclipse.elk.layered.crossingMinimization.inLayerPredOf");_.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF=new m("org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf");_.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT=new m("org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint");_.PARTITIONING_PARTITION=new m("org.eclipse.elk.partitioning.partition");_.PORT_ANCHOR=new m("org.eclipse.elk.port.anchor");_.ASPECT_RATIO=new m("org.eclipse.elk.aspectRatio",1.6);_.SPACING_COMPONENT_COMPONENT=new m("org.eclipse.elk.spacing.componentComponent",20);_.COMPACTION_CONNECTED_COMPONENTS=new m("org.eclipse.elk.layered.compaction.connectedComponents",!1);_.PRIORITY=new m("org.eclipse.elk.priority",0);_.WRAPPING_MULTI_EDGE_IMPROVE_WRAPPED_EDGES=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges",!0);_.WRAPPING_MULTI_EDGE_IMPROVE_CUTS=new m("org.eclipse.elk.layered.wrapping.multiEdge.improveCuts",!0);_.WRAPPING_MULTI_EDGE_DISTANCE_PENALTY=new m("org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty",2);_.WRAPPING_CUTTING_STRATEGY=new m("org.eclipse.elk.layered.wrapping.cutting.strategy");_.WRAPPING_VALIDIFY_STRATEGY=new m("org.eclipse.elk.layered.wrapping.validify.strategy");_.WRAPPING_CORRECTION_FACTOR=new m("org.eclipse.elk.layered.wrapping.correctionFactor",1);_.WRAPPING_VALIDIFY_FORBIDDEN_INDICES=new m("org.eclipse.elk.layered.wrapping.validify.forbiddenIndices");_.WRAPPING_CUTTING_CUTS=new m("org.eclipse.elk.layered.wrapping.cutting.cuts");_.WRAPPING_CUTTING_MSD_FREEDOM=new m("org.eclipse.elk.layered.wrapping.cutting.msd.freedom",2);_.WRAPPING_ADDITIONAL_EDGE_SPACING=new m("org.eclipse.elk.layered.wrapping.additionalEdgeSpacing",10);_.LAYERING_NODE_PROMOTION_STRATEGY=new m("org.eclipse.elk.layered.layering.nodePromotion.strategy");_.LAYERING_NODE_PROMOTION_MAX_ITERATIONS=new m("org.eclipse.elk.layered.layering.nodePromotion.maxIterations",0);_.ALLOW_NON_FLOW_PORTS_TO_SWITCH_SIDES=new m("org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides",!1);_.EDGE_ROUTING_SELF_LOOP_DISTRIBUTION=new m("org.eclipse.elk.layered.edgeRouting.selfLoopDistribution",Qo.NORTH);_.EDGE_ROUTING_SELF_LOOP_ORDERING=new m("org.eclipse.elk.layered.edgeRouting.selfLoopOrdering");_.LAYER_UNZIPPING_LAYER_SPLIT=eO;_.LAYER_UNZIPPING_RESET_ON_LONG_EDGES=new m("org.eclipse.elk.layered.layerUnzipping.resetOnLongEdges",!0);_.LAYER_UNZIPPING_MINIMIZE_EDGE_LENGTH=new m("org.eclipse.elk.layered.layerUnzipping.minimizeEdgeLength",!1);_.HIGH_DEGREE_NODES_THRESHOLD=new m("org.eclipse.elk.layered.highDegreeNodes.threshold",16);_.HIGH_DEGREE_NODES_TREE_HEIGHT=new m("org.eclipse.elk.layered.highDegreeNodes.treeHeight",5);_.THOROUGHNESS=new m("org.eclipse.elk.layered.thoroughness",7);_.SPACING_EDGE_EDGE=new m("org.eclipse.elk.spacing.edgeEdge",10);_.SPACING_NODE_SELF_LOOP=new m("org.eclipse.elk.spacing.nodeSelfLoop",10);_.PORT_BORDER_OFFSET=new m("org.eclipse.elk.port.borderOffset",0);_.NODE_SIZE_CONSTRAINTS=new m("org.eclipse.elk.nodeSize.constraints");_.NODE_SIZE_OPTIONS=new m("org.eclipse.elk.nodeSize.options");_.CONTENT_ALIGNMENT=new m("org.eclipse.elk.contentAlignment");_.PORT_LABELS_PLACEMENT=new m("org.eclipse.elk.portLabels.placement");_.PORT_LABELS_TREAT_AS_GROUP=new m("org.eclipse.elk.portLabels.treatAsGroup",!0);_.CYCLE_BREAKING_STRATEGY=new m("org.eclipse.elk.layered.cycleBreaking.strategy",()=>Xt.GREEDY);_.LAYERING_STRATEGY=new m("org.eclipse.elk.layered.layering.strategy",()=>le.NETWORK_SIMPLEX);_.CROSSING_MINIMIZATION_STRATEGY=new m("org.eclipse.elk.layered.crossingMinimization.strategy",()=>We.LAYER_SWEEP);_.NODE_PLACEMENT_STRATEGY=new m("org.eclipse.elk.layered.nodePlacement.strategy",()=>ze.BRANDES_KOEPF);_.RANDOM_SEED=new m("org.eclipse.elk.randomSeed",1);_.FEEDBACK_EDGES=new m("org.eclipse.elk.layered.feedbackEdges",!1);_.INTERACTIVE_LAYOUT=new m("org.eclipse.elk.interactiveLayout",!1);_.GENERATE_POSITION_AND_LAYER_IDS=new m("org.eclipse.elk.layered.generatePositionAndLayerIds",!1);_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE=new m("org.eclipse.elk.layered.crossingMinimization.semiInteractive",!1);_.LAYER_UNZIPPING_STRATEGY=new m("org.eclipse.elk.layered.layerUnzipping.strategy");_.HIGH_DEGREE_NODES_TREATMENT=new m("org.eclipse.elk.layered.highDegreeNodes.treatment",!1);_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.type",Uo.TWO_SIDED);_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE=JP;_.CROSSING_MINIMIZATION_GREEDY_SWITCH_ACTIVATION_THRESHOLD=new m("org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold",40);_.SEPARATE_CONNECTED_COMPONENTS=new m("org.eclipse.elk.separateConnectedComponents",!0);_.NODE_SIZE_FIXED_GRAPH_SIZE=new m("org.eclipse.elk.nodeSize.fixedGraphSize",!1);_.CONSIDER_MODEL_ORDER_COMPONENTS=new m("org.eclipse.elk.layered.considerModelOrder.components",Me.NONE);_.WRAPPING_STRATEGY=new m("org.eclipse.elk.layered.wrapping.strategy");_.COMPACTION_POST_COMPACTION_STRATEGY=new m("org.eclipse.elk.layered.compaction.postCompaction.strategy");_.COMPACTION_POST_COMPACTION_CONSTRAINTS=new m("org.eclipse.elk.layered.compaction.postCompaction.constraints");_.SPACING_NODE_NODE=new m("org.eclipse.elk.spacing.nodeNode",20);_.SPACING_EDGE_NODE=new m("org.eclipse.elk.spacing.edgeNode",10);_.SPACING_LABEL_NODE=new m("org.eclipse.elk.spacing.labelNode",5);_.SPACING_LABEL_PORT_HORIZONTAL=new m("org.eclipse.elk.spacing.labelPortHorizontal",1);_.SPACING_LABEL_PORT_VERTICAL=new m("org.eclipse.elk.spacing.labelPortVertical",1);_.SPACING_PORT_PORT=new m("org.eclipse.elk.spacing.portPort",10);_.SPACING_NODE_NODE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers",20);_.SPACING_EDGE_NODE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers",16);_.SPACING_EDGE_EDGE_BETWEEN_LAYERS=new m("org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers",10);_.EDGE_ROUTING_SPLINES_MODE=new m("org.eclipse.elk.layered.edgeRouting.splines.mode",()=>Qr.SLOPPY);_.EDGE_ROUTING_POLYLINE_SLOPED_EDGE_ZONE_WIDTH=new m("org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth",2);_.EDGE_ROUTING_SPLINES_SLOPPY_LAYER_SPACING_FACTOR=new m("org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor",.2);_.SPACING_INDIVIDUAL=new m("org.eclipse.elk.spacing.individual");_.LAYERING_MIN_WIDTH_UPPER_BOUND_ON_WIDTH=new m("org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth",4,-1);_.LAYERING_MIN_WIDTH_UPPER_LAYER_ESTIMATION_SCALING_FACTOR=new m("org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor",2,-1);_.PORT_CONSTRAINTS=new m("org.eclipse.elk.portConstraints",()=>H.UNDEFINED);_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER=new m("org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder",!1);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_GROUP_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationGroupOrderStrategy",()=>Wt.ONLY_WITHIN_GROUP);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CROSSING_MINIMIZATION_ID=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationId",0);_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CM_ENFORCED_GROUP_ORDERS=new m("org.eclipse.elk.layered.considerModelOrder.groupModelOrder.crossingMinimizationEnforcedGroupOrders",()=>[]);_.CROSSING_MINIMIZATION_HIERARCHICAL_SWEEPINESS=new m("org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness",.1);_.HIERARCHY_HANDLING=new m("org.eclipse.elk.hierarchyHandling","INHERIT");_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_NODE_INFLUENCE=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence",0);_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_PORT_INFLUENCE=new m("org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence",0);_.CONSIDER_MODEL_ORDER_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.strategy",()=>$t.NONE);_.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY=new m("org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy",()=>Ao.DUMMY_NODE_OVER);_.CONSIDER_MODEL_ORDER_PORT_MODEL_ORDER=new m("org.eclipse.elk.layered.considerModelOrder.portModelOrder",!1);_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility");_.NODE_PLACEMENT_NETWORK_SIMPLEX_NODE_FLEXIBILITY_DEFAULT=new m("org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default",()=>ye.NODE_SIZE_WHERE_SPACE_PERMITS);_.NO_LAYOUT=new m("org.eclipse.elk.noLayout",!1);_.PORT_SIDE=new m("org.eclipse.elk.port.side");_.ALGORITHM=new m("org.eclipse.elk.algorithm");_.ALGORITHM_ID="org.eclipse.elk.layered";_.PARTITIONING_ACTIVATE=new m("org.eclipse.elk.partitioning.activate",!1);_.SPACING_BASE_VALUE=new m("org.eclipse.elk.spacing.baseValue");_.MERGE_EDGES=new m("org.eclipse.elk.layered.mergeEdges",!1);_.MERGE_HIERARCHY_EDGES=new m("org.eclipse.elk.layered.mergeHierarchyEdges",!0);_.INSIDE_SELF_LOOPS_ACTIVATE=new m("org.eclipse.elk.insideSelfLoops.activate",!1);_.INSIDE_SELF_LOOPS_YO=new m("org.eclipse.elk.insideSelfLoops.yo",!1);_.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER=new m("org.eclipse.elk.layered.considerModelOrder.noModelOrder",!1);_.PADDING=new m("org.eclipse.elk.padding",new yt(12));var z=class n{static toNodeArray(t){return[...t]}static toEdgeArray(t){return[...t]}static toPortArray(t){return[...t]}static resizeNode(t,e,o,r){let i=new O(t.getSize().x,t.getSize().y),s=e.x/i.x,a=e.y/i.y,l=e.x-i.x,c=e.y-i.y;if(o){let g=t.getProperty(_.PORT_CONSTRAINTS)===H.FIXED_POS;for(let h of t.getPorts())switch(h.getSide()){case u.NORTH:g||(h.getPosition().x*=s);break;case u.EAST:h.getPosition().x+=l,g||(h.getPosition().y*=a);break;case u.SOUTH:g||(h.getPosition().x*=s),h.getPosition().y+=c;break;case u.WEST:g||(h.getPosition().y*=a);break;default:break}}if(r)for(let g of t.getLabels()){let h=g.getPosition().x+g.getSize().x/2,d=g.getPosition().y+g.getSize().y/2,f=h/i.x,E=d/i.y;f+E>=1&&(f-E>0&&d>=0?(g.getPosition().x+=l,g.getPosition().y+=c*E):f-E<0&&h>=0&&(g.getPosition().x+=l*f,g.getPosition().y+=c))}t.getSize().x=e.x,t.getSize().y=e.y,t.setProperty(_.NODE_SIZE_CONSTRAINTS,mt.fixed())}static offsetGraphs(t,e,o){for(let r of t)n.offsetGraph(r,e,o)}static offsetGraph(t,e,o){let r=new O(e,o);for(let i of t.getLayerlessNodes()){i.getPosition().add(r);for(let s of i.getPorts())for(let a of s.getOutgoingEdges()){for(let c of a.getBendPoints())c.x+=e,c.y+=o;let l=a.getProperty(_.JUNCTION_POINTS);if(l!=null)for(let c of l)c.x+=e,c.y+=o;for(let c of a.getLabels())c.getPosition().add(r)}}}static placeNodesHorizontally(t,e){let o=0,r=0;for(let i of t.getNodes())o=Math.max(o,i.getMargin().left),r=Math.max(r,i.getMargin().right);for(let i of t.getNodes()){let s=i.getProperty(_.ALIGNMENT),a;switch(s){case Kt.LEFT:a=0;break;case Kt.RIGHT:a=1;break;case Kt.CENTER:a=.5;break;default:{let f=0,E=0;for(let P of i.getPorts())P.getIncomingEdges().length>0&&f++,P.getOutgoingEdges().length>0&&E++;a=f+E===0?.5:E/(f+E)}}let l=t.getSize(),c=i.getSize().x,g=(l.x-c)*a;a>.5?g-=r*2*(a-.5):a<.5&&(g+=o*2*(.5-a));let h=i.getMargin().left;g<h&&(g=h);let d=i.getMargin().right;g>l.x-d-c&&(g=l.x-d-c),i.getPosition().x=e+g}}static findMaxNonDummyNodeWidth(t,e){if(t.getGraph().getProperty(_.DIRECTION).isVertical())return 0;let o=0;for(let r of t.getNodes())if(r.getType()===y.NORMAL){let i=r.getSize().x;e&&(i+=r.getMargin().left+r.getMargin().right),i>o&&(o=i)}return o}static computeGraphProperties(t){let e=t.getProperty(p.GRAPH_PROPERTIES);e.size>0&&e.clear();let o=n.getDirection(t);for(let r of t.getLayerlessNodes()){r.getProperty(_.COMMENT_BOX)?e.add(v.COMMENTS):r.getProperty(_.HYPERNODE)?(e.add(v.HYPERNODES),e.add(v.HYPEREDGES)):r.getType()===y.EXTERNAL_PORT&&e.add(v.EXTERNAL_PORTS);let i=r.getProperty(_.PORT_CONSTRAINTS);i===H.UNDEFINED?r.setProperty(_.PORT_CONSTRAINTS,H.FREE):i!==H.FREE&&e.add(v.NON_FREE_PORTS);for(let s of r.getPorts()){s.getIncomingEdges().length+s.getOutgoingEdges().length>1&&e.add(v.HYPEREDGES);let a=s.getSide();o===R.UP||o===R.DOWN?(a===u.EAST||a===u.WEST)&&e.add(v.NORTH_SOUTH_PORTS):(a===u.NORTH||a===u.SOUTH)&&e.add(v.NORTH_SOUTH_PORTS);for(let l of s.getOutgoingEdges()){l.getTarget().getNode()===r&&e.add(v.SELF_LOOPS);for(let c of l.getLabels())switch(c.getProperty(_.EDGE_LABELS_PLACEMENT)){case St.CENTER:e.add(v.CENTER_LABELS);break;case St.HEAD:case St.TAIL:e.add(v.END_LABELS);break;default:break}}}}}static getExternalPortPosition(t,e,o,r){let i=new O(e.getPosition().x,e.getPosition().y);i.x+=e.getSize().x/2,i.y+=e.getSize().y/2;let s=e.getProperty(_.PORT_BORDER_OFFSET)||0,a=t.getSize(),l=t.getPadding(),c=t.getOffset();switch(e.getProperty(p.EXT_PORT_SIDE)){case u.NORTH:i.x+=l.left+c.x-o/2,i.y=-r-s,e.getPosition().y=-(l.top+s+c.y);break;case u.EAST:i.x=a.x+l.left+l.right+s,i.y+=l.top+c.y-r/2,e.getPosition().x=a.x+l.right+s-c.x;break;case u.SOUTH:i.x+=l.left+c.x-o/2,i.y=a.y+l.top+l.bottom+s,e.getPosition().y=a.y+l.bottom+s-c.y;break;case u.WEST:i.x=-o-s,i.y+=l.top+c.y-r/2,e.getPosition().x=-(l.left+s+c.x);break;default:break}return i}static isDescendant(t,e){let o=t,r=o.getGraph().getParentNode();for(;r!=null;){if(o=r,o===e)return!0;r=o.getGraph().getParentNode()}return!1}static changeCoordSystem(t,e,o){if(e===o)return;let r=e,i;do if(t.add(r.getOffset()),i=r.getParentNode(),i!=null){let s=r.getPadding();t.add(s.left,s.top),t.add(i.getPosition()),r=i.getGraph()}while(i!=null);r=o;do if(t.sub(r.getOffset()),i=r.getParentNode(),i!=null){let s=r.getPadding();t.sub(s.left,s.top),t.sub(i.getPosition()),r=i.getGraph()}while(i!=null)}static getIndividualOrInherited(t,e){if(t!=null&&t.hasProperty&&t.hasProperty(as)){let o=t.getProperty(as);if(o!=null&&o.hasProperty&&o.hasProperty(e)){let r=o.getProperty(e);if(r!=null)return r}}if(t!=null&&t.hasProperty&&t.hasProperty(e))return t.getProperty(e);if(t!=null&&typeof t.getGraph=="function"){let o=t.getGraph();if(o!=null)return o.getProperty(e)}return t!=null?t.getProperty(e):null}static getDirection(t){let e=t.getProperty(_.DIRECTION);return e===R.UNDEFINED?t.getProperty(_.ASPECT_RATIO)>=1?R.RIGHT:R.DOWN:e}static getMinimalModelOrder(t){let e=Number.MAX_SAFE_INTEGER;for(let o of t.getLayerlessNodes())o.hasProperty(p.MODEL_ORDER)&&(e=Math.min(e,o.getProperty(p.MODEL_ORDER)));return e}static createPort(t,e,o,r){let i,s=n.getDirection(r);if((r.getProperty(_.MERGE_EDGES)||t.getProperty(_.HYPERNODE))&&!t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()){let l=u.fromDirection(s);i=n.provideCollectorPort(r,t,o,o===W.OUTPUT?l:l.opposed())}else{if(i=new rt,i.setNode(t),e!=null){let g=i.getPosition();g.x=e.x-t.getPosition().x,g.y=e.y-t.getPosition().y,typeof g.bound=="function"?g.bound(0,0,t.getSize().x,t.getSize().y):(g.x=Math.min(Math.max(g.x,0),t.getSize().x),g.y=Math.min(Math.max(g.y,0),t.getSize().y)),i.setSide(n._calcPortSide(i,s))}else{let g=u.fromDirection(s);i.setSide(o===W.OUTPUT?g:g.opposed())}let l=r.getProperty(p.GRAPH_PROPERTIES),c=i.getSide();s===R.LEFT||s===R.RIGHT?(c===u.NORTH||c===u.SOUTH)&&l.add(v.NORTH_SOUTH_PORTS):(s===R.UP||s===R.DOWN)&&(c===u.EAST||c===u.WEST)&&l.add(v.NORTH_SOUTH_PORTS)}return i}static provideCollectorPort(t,e,o,r){let i=null;switch(o){case W.INPUT:for(let s of e.getPorts())if(s.getProperty(p.INPUT_COLLECT))return s;i=new rt,i.setProperty(p.INPUT_COLLECT,!0);break;case W.OUTPUT:for(let s of e.getPorts())if(s.getProperty(p.OUTPUT_COLLECT))return s;i=new rt,i.setProperty(p.OUTPUT_COLLECT,!0);break;default:break}return i!=null&&(i.setNode(e),i.setSide(r),n._centerPoint(i.getPosition(),e.getSize(),r)),i}static initializePort(t,e,o,r){let i=t.getSide();if(i===u.UNDEFINED&&e.isSideFixed()&&(i=n._calcPortSide(t,o),t.setSide(i),!t.hasProperty(_.PORT_BORDER_OFFSET)&&i!==u.UNDEFINED&&(t.getPosition().x!==0||t.getPosition().y!==0)&&t.setProperty(_.PORT_BORDER_OFFSET,n._calcPortOffset(t,i))),e.isRatioFixed()){let l=0;switch(i){case u.NORTH:case u.SOUTH:{let c=t.getNode().getSize().x;c>0&&(l=t.getPosition().x/c);break}case u.EAST:case u.WEST:{let c=t.getNode().getSize().y;c>0&&(l=t.getPosition().y/c);break}default:break}t.setProperty(p.PORT_RATIO_OR_POSITION,l)}let s=t.getSize(),a=t.getAnchor();if(r!=null)a.x=r.x,a.y=r.y,t.setExplicitlySuppliedPortAnchor(!0);else if(e.isSideFixed()&&i!==u.UNDEFINED)switch(i){case u.NORTH:a.x=s.x/2;break;case u.EAST:a.x=s.x,a.y=s.y/2;break;case u.SOUTH:a.x=s.x/2,a.y=s.y;break;case u.WEST:a.y=s.y/2;break;default:break}else a.x=s.x/2,a.y=s.y/2}static createExternalPortDummy(t,e,o,r,i,s,a,l,c){let g=o,h=new ft(c);h.setType(y.EXTERNAL_PORT),h.setProperty(p.EXT_PORT_SIZE,a),h.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS);let d=t.getProperty(_.PORT_BORDER_OFFSET)||0;h.setProperty(_.PORT_BORDER_OFFSET,d);let f=new rt;f.setNode(h),e.isSideFixed()||(r>=0?g=u.fromDirection(l):g=u.fromDirection(l).opposed(),t.setProperty(_.PORT_SIDE,g));let E=new O,P=!1;if(t.hasProperty(_.PORT_ANCHOR)){let S=t.getProperty(_.PORT_ANCHOR);E.x=S.x,E.y=S.y,P=!0}else E.x=a.x/2,E.y=a.y/2;switch(g){case u.WEST:h.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.FIRST_SEPARATE),h.setProperty(p.EDGE_CONSTRAINT,De.OUTGOING_ONLY),h.getSize().y=a.y,d<0&&(h.getSize().x=-d),f.setSide(u.EAST),P||(E.x=a.x),E.x-=a.x;break;case u.EAST:h.setProperty(_.LAYERING_LAYER_CONSTRAINT,J.LAST_SEPARATE),h.setProperty(p.EDGE_CONSTRAINT,De.INCOMING_ONLY),h.getSize().y=a.y,d<0&&(h.getSize().x=-d),f.setSide(u.WEST),P||(E.x=0);break;case u.NORTH:h.setProperty(p.IN_LAYER_CONSTRAINT,jt.TOP),h.getSize().x=a.x,d<0&&(h.getSize().y=-d),f.setSide(u.SOUTH),P||(E.y=a.y),E.y-=a.y;break;case u.SOUTH:h.setProperty(p.IN_LAYER_CONSTRAINT,jt.BOTTOM),h.getSize().x=a.x,d<0&&(h.getSize().y=-d),f.setSide(u.NORTH),P||(E.y=0);break;default:break}if(f.getPosition().x=E.x,f.getPosition().y=E.y,h.setProperty(_.PORT_ANCHOR,E),e.isOrderFixed()){let S=0;if(e===H.FIXED_ORDER&&t.hasProperty(_.PORT_INDEX))switch(g){case u.NORTH:case u.EAST:S=t.getProperty(_.PORT_INDEX);break;case u.SOUTH:case u.WEST:S=-t.getProperty(_.PORT_INDEX);break;default:break}else switch(g){case u.WEST:case u.EAST:S=s.y,e.isRatioFixed()&&(S/=i.y);break;case u.NORTH:case u.SOUTH:S=s.x,e.isRatioFixed()&&(S/=i.x);break;default:break}h.setProperty(p.PORT_RATIO_OR_POSITION,S)}return h.setProperty(p.EXT_PORT_SIDE,g),h}static _calcPortSide(t,e){let o=t.getNode(),r=o.getSize().x,i=o.getSize().y;if(r<=0&&i<=0)return u.UNDEFINED;let s=t.getPosition().x,a=t.getPosition().y,l=t.getSize().x,c=t.getSize().y;if(e===R.LEFT||e===R.RIGHT){if(s<0)return u.WEST;if(s+l>r)return u.EAST}else if(e===R.UP||e===R.DOWN){if(a<0)return u.NORTH;if(a+c>i)return u.SOUTH}let g=(s+l/2)/r,h=(a+c/2)/i;return g+h<=1&&g-h<=0?u.WEST:g+h>=1&&g-h>=0?u.EAST:h<.5?u.NORTH:u.SOUTH}static _calcPortOffset(t,e){let o=t.getNode();switch(e){case u.NORTH:return-(t.getPosition().y+t.getSize().y);case u.EAST:return t.getPosition().x-o.getSize().x;case u.SOUTH:return t.getPosition().y-o.getSize().y;case u.WEST:return-(t.getPosition().x+t.getSize().x);default:return 0}}static _centerPoint(t,e,o){switch(o){case u.NORTH:t.x=e.x/2,t.y=0;break;case u.EAST:t.x=e.x,t.y=e.y/2;break;case u.SOUTH:t.x=e.x/2,t.y=e.y;break;case u.WEST:t.x=0,t.y=e.y/2;break;default:break}}};var ra=class{combine(t,e){throw new Error("AbstractGraphPlacer.combine is abstract")}moveGraphs(t,e,o,r){for(let i of e)this.moveGraph(t,i,o,r)}moveGraph(t,e,o,r){let i=e.getOffset().clone().add(o,r);for(let s of e.getLayerlessNodes()){s.getPosition().add(i);for(let a of s.getPorts())for(let l of a.getOutgoingEdges()){l.getBendPoints().offset(i);let c=l.getProperty(_.JUNCTION_POINTS);c!=null&&c.offset(i);for(let g of l.getLabels())g.getPosition().add(i)}t.getLayerlessNodes().push(s),s.setGraph(t)}}offsetGraphs(t,e,o){for(let r of t)this.offsetGraph(r,e,o)}offsetGraph(t,e,o){let r=new O(e,o);for(let i of t.getLayerlessNodes()){i.getPosition().add(r);for(let s of i.getPorts())for(let a of s.getOutgoingEdges()){a.getBendPoints().offset(r);let l=a.getProperty(_.JUNCTION_POINTS);l!=null&&l.offset(r);for(let c of a.getLabels())c.getPosition().add(r)}}}};var{SIDES_EAST:JI,SIDES_EAST_SOUTH:QI,SIDES_EAST_SOUTH_WEST:tR,SIDES_EAST_WEST:eR,SIDES_NORTH:oR,SIDES_NORTH_EAST:rR,SIDES_NORTH_EAST_SOUTH_WEST:iR,SIDES_NORTH_EAST_WEST:sR,SIDES_NORTH_SOUTH:nR,SIDES_NORTH_SOUTH_WEST:aR,SIDES_NORTH_WEST:lR,SIDES_SOUTH:cR,SIDES_SOUTH_WEST:gR,SIDES_WEST:hR}=u,sa=class{constructor(t){this._spacing=t,this.cGraph=null,this._oldPosition=new Map,this._offsets=new Map,this._globalOffset=null,this._graphSize=null,this._externalExtensions=new Map,this._externalPlaceholder=new Map;for(let e of[R.LEFT,R.RIGHT,R.UP,R.DOWN])this._externalPlaceholder.set(e,[])}getOffset(t){let e=this._oldPosition.get(t),o=this._offsets.get(t).rect.getPosition();return e.clone().sub(o)}getGlobalOffset(){return this._globalOffset}getGraphSize(){return this._graphSize}getExternalExtensions(){return this._externalExtensions}getExternalPlaceholder(){return this._externalPlaceholder}transform(t){this.cGraph=new Zn(new Set([R.LEFT,R.RIGHT,R.UP,R.DOWN]));for(let e of t.getComponents()){let o=new tr;this.cGraph.cGroups.push(o);for(let r of e.getHull()){let i=new ia(r,null,this._spacing);this._setLock(i,e.getExternalExtensionSides()),this._oldPosition.has(e)||(this._oldPosition.set(e,new O(r.x,r.y)),this._offsets.set(e,i)),this.cGraph.cNodes.push(i),o.addCNode(i)}for(let r of e.getExternalExtensions()){let i=new ia(r.getRepresentor(),null,this._spacing);this._externalExtensions.set(r,{first:o,second:i}),this._setLock(i,e.getExternalExtensionSides());let s=r.getPlaceholder?r.getPlaceholder():null;if(s!=null){let a=new ia(s,1,this._spacing);this._setLock(a,e.getExternalExtensionSides()),new tr().addCNode(a);let c=this._externalPlaceholder.get(r.getDirection())||[];c.push({first:o,second:a}),this._externalPlaceholder.set(r.getDirection(),c)}}}return this.cGraph}_setLock(t,e){let o=r=>e.size===r.size&&[...r].every(i=>e.has(i));e.size===0&&t.lock.set(!0,!0,!0,!0),o(oR)&&t.lock.set(!0,!0,!0,!1),o(JI)&&t.lock.set(!1,!0,!0,!0),o(cR)&&t.lock.set(!0,!0,!1,!0),o(hR)&&t.lock.set(!0,!1,!0,!0),o(rR)&&t.lock.set(!1,!0,!0,!1),o(QI)&&t.lock.set(!1,!0,!1,!0),o(gR)&&t.lock.set(!0,!1,!1,!0),o(lR)&&t.lock.set(!0,!1,!0,!1),o(nR)&&t.lock.set(!0,!0,!0,!0),o(eR)&&t.lock.set(!0,!0,!0,!0),o(tR)&&t.lock.set(!0,!0,!0,!0),o(aR)&&t.lock.set(!0,!0,!0,!0),o(sR)&&t.lock.set(!0,!0,!0,!0),o(iR)&&t.lock.set(!0,!0,!0,!0)}applyLayout(){for(let o of this.cGraph.cNodes)o instanceof ia&&o.applyElementPosition();let t=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),e=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let o of this.cGraph.cNodes)t.x=Math.min(t.x,o.hitbox.x),t.y=Math.min(t.y,o.hitbox.y),e.x=Math.max(e.x,o.hitbox.x+o.hitbox.width),e.y=Math.max(e.y,o.hitbox.y+o.hitbox.height);for(let o of this._externalPlaceholder.values())for(let r of o){let i=r.second;t.x=Math.min(t.x,i.hitbox.x),t.y=Math.min(t.y,i.hitbox.y),e.x=Math.max(e.x,i.hitbox.x+i.hitbox.width),e.y=Math.max(e.y,i.hitbox.y+i.hitbox.height)}this._globalOffset=t.clone().negate(),this._graphSize=e.clone().sub(t),this.cGraph.cGroups.length=0,this.cGraph.cNodes.length=0}},ia=class extends ki{constructor(t,e,o){super(),this.rect=t,this.hitbox=new dt(t.x,t.y,t.width,t.height),this._individualSpacing=e,this._defaultSpacing=o}getHorizontalSpacing(){return this._individualSpacing!=null?this._individualSpacing:this._defaultSpacing}getVerticalSpacing(){return this._individualSpacing!=null?this._individualSpacing:this._defaultSpacing}applyElementPosition(){this.rect.x=this.hitbox.x,this.rect.y=this.hitbox.y}getElementPosition(){return this.rect.x}toString(){return""}};sa.SPACING_HANDLER={getHorizontalSpacing(n,t){let e=typeof n.getHorizontalSpacing=="function"?n.getHorizontalSpacing():0,o=typeof t.getHorizontalSpacing=="function"?t.getHorizontalSpacing():0;return Math.min(e,o)},getVerticalSpacing(n,t){let e=typeof n.getVerticalSpacing=="function"?n.getVerticalSpacing():0,o=typeof t.getVerticalSpacing=="function"?t.getVerticalSpacing():0;return Math.min(e,o)}};var ir=Object.freeze({HORZ:"HORZ",VERT:"VERT"}),j_=new Set([R.LEFT,R.RIGHT]),$_=new Set([R.UP,R.DOWN]),na=class n{constructor(){this._compactionGraph=null,this._transformer=null,this._verticalExternalExtensions=[],this._horizontalExternalExtensions=[],this._compactor=null,this._topLeft=new O,this._bottomRight=new O}static init(t,e){let o=new n;return o._transformer=new sa(e),o._compactionGraph=o._transformer.transform(t),o}compact(t){let e=[];this._verticalExternalExtensions=[],this._horizontalExternalExtensions=[];for(let[a,l]of this._transformer.getExternalExtensions()){e.push(l.second);let c=a.getDirection();c===R.LEFT||c===R.RIGHT?this._horizontalExternalExtensions.push(l):this._verticalExternalExtensions.push(l)}this._addExternalEdgeRepresentations(this._horizontalExternalExtensions),this._addExternalEdgeRepresentations(this._verticalExternalExtensions),this._compactor=new Br(this._compactionGraph),this._compactor.setSpacingsHandler(sa.SPACING_HANDLER),this._removeExternalEdgeRepresentations(this._horizontalExternalExtensions),this._removeExternalEdgeRepresentations(this._verticalExternalExtensions);for(let a of this._compactor.cGraph.cNodes)e.push(a);this._topLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this._bottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let a of e)this._topLeft.x=Math.min(this._topLeft.x,a.hitbox.x),this._topLeft.y=Math.min(this._topLeft.y,a.hitbox.y),this._bottomRight.x=Math.max(this._bottomRight.x,a.hitbox.x+a.hitbox.width),this._bottomRight.y=Math.max(this._bottomRight.y,a.hitbox.y+a.hitbox.height);let o={isLocked:(a,l)=>{let c=a.cGroup||a;return c.outDegree!=null&&c.outDegree!==0}};this._compactor.setLockFunction(o);let r=0,i;do i=this._compactIteration(r),r++;while((r<2||i>n.EPSILON)&&r<n.MAX_ITERATION);let s={isLocked:(a,l)=>{let c=a.cGroup!=null?a:null;if(c!=null){let g=c.lock&&c.lock.getDirection(l);if(g||c.cGroup.outDegree!==0&&g)return!0}return!1}};this._compactor.setLockFunction(s),this._compactIteration(0),this._compactor.finish(),this._transformer.applyLayout()}_compactIteration(t){let e=0;for(let r of this._compactionGraph.cGroups)r.delta=0,r.deltaNormalized=0;this._addPlaceholders(ir.HORZ),this._addExternalEdgeRepresentations(this._verticalExternalExtensions),this._compactor.calculateGroupOffsets(),this._compactor.forceConstraintsRecalculation();let o=R.LEFT;this._compactor.changeDirection(o).compact().changeDirection(R.RIGHT).compact().changeDirection(o).compact(),this._compactor.changeDirection(R.LEFT),this._removeExternalEdgeRepresentations(this._verticalExternalExtensions),this._removePlaceholders(ir.HORZ),this._updateExternalExtensionDimensions(ir.HORZ),this._updatePlaceholders(ir.VERT),this._addPlaceholders(ir.VERT),this._addExternalEdgeRepresentations(this._horizontalExternalExtensions),this._compactor.calculateGroupOffsets();for(let r of this._compactionGraph.cGroups)e+=Math.abs(r.deltaNormalized);for(let r of this._compactionGraph.cGroups)r.delta=0,r.deltaNormalized=0;o=R.UP,this._compactor.changeDirection(o).forceConstraintsRecalculation().compact().changeDirection(R.DOWN).compact().changeDirection(o).compact(),this._compactor.changeDirection(R.LEFT),this._removeExternalEdgeRepresentations(this._horizontalExternalExtensions),this._removePlaceholders(ir.VERT),this._updateExternalExtensionDimensions(ir.VERT),this._updatePlaceholders(ir.HORZ),this._compactor.forceConstraintsRecalculation();for(let r of this._compactionGraph.cGroups)e+=Math.abs(r.deltaNormalized);return e}getGraphSize(){return this._transformer.getGraphSize()}getOffset(t){return this._transformer.getOffset(t).negate().add(this._transformer.getGlobalOffset())}_addExternalEdgeRepresentations(t){for(let e of t)this._compactionGraph.cNodes.push(e.second),e.first.addCNode(e.second)}_removeExternalEdgeRepresentations(t){for(let e of t){let o=this._compactionGraph.cNodes.indexOf(e.second);o>=0&&this._compactionGraph.cNodes.splice(o,1),typeof e.first.removeCNode=="function"&&e.first.removeCNode(e.second)}}_addPlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[])this._compactionGraph.cNodes.push(r.second),r.second.cGroup!=null&&this._compactionGraph.cGroups.push(r.second.cGroup)}_removePlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[]){let i=this._compactionGraph.cNodes.indexOf(r.second);i>=0&&this._compactionGraph.cNodes.splice(i,1);let s=this._compactionGraph.cGroups.indexOf(r.second.cGroup);s>=0&&this._compactionGraph.cGroups.splice(s,1)}}_updatePlaceholders(t){let e=t===ir.VERT?$_:j_;for(let o of e)for(let r of this._transformer.getExternalPlaceholder().get(o)||[]){let i=r.second,a=r.first.deltaNormalized;switch(o){case R.LEFT:case R.RIGHT:i.hitbox.y+=a;break;case R.UP:case R.DOWN:i.hitbox.x+=a;break}}}_updateExternalExtensionDimensions(t){for(let[e,o]of this._transformer.getExternalExtensions()){if(t===ir.VERT){if(e.getDirection()!==R.UP&&e.getDirection()!==R.DOWN)continue}else if(e.getDirection()!==R.LEFT&&e.getDirection()!==R.RIGHT)continue;let r=o.second,s=o.first.deltaNormalized;switch(e.getDirection()){case R.LEFT:r.hitbox.x=this._topLeft.x,r.hitbox.width=Math.max(1,r.hitbox.width+s);break;case R.RIGHT:r.hitbox.x=r.hitbox.x+s,r.hitbox.width=Math.max(1,r.hitbox.width-s);break;case R.UP:r.hitbox.y=this._topLeft.y,r.hitbox.height=Math.max(1,r.hitbox.height+s);break;case R.DOWN:r.hitbox.y=r.hitbox.y+s,r.hitbox.height=Math.max(1,r.hitbox.height-s);break}}}};na.MAX_ITERATION=10;na.EPSILON=1e-4;var Ye=class n{constructor(t,e,o){this.x=t,this.y=e,this.quadrant=o,this.convex=!0}static from(t){return new n(t.x,t.y)}toString(){return`(${this.x}, ${this.y}${this.convex?"cx":""}${this.quadrant})`}equals(t){return t==null||!(t instanceof n)?!1:this.x===t.x&&this.y===t.y}},Bt=class n{constructor(t){this.name=t,Object.freeze(this)}isUpper(){return this===n.Q1||this===n.Q2}isLeft(){return this===n.Q1||this===n.Q4}static isBothLeftOrBothRight(t,e){return t===n.Q1&&e===n.Q4||t===n.Q4&&e===n.Q1||t===n.Q3&&e===n.Q2||t===n.Q2&&e===n.Q3}static isOneLeftOneRight(t,e){return t===n.Q1&&e===n.Q2||t===n.Q1&&e===n.Q3||t===n.Q4&&e===n.Q3||t===n.Q4&&e===n.Q2}toString(){return this.name}};Bt.Q1=new Bt("Q1");Bt.Q4=new Bt("Q4");Bt.Q2=new Bt("Q2");Bt.Q3=new Bt("Q3");var rO=new Map([[Bt.Q1,0],[Bt.Q4,1],[Bt.Q2,2],[Bt.Q3,3]]),dR=(n,t)=>n.x===t.x?t.y-n.y:n.x-t.x,fR=(n,t)=>n.x===t.x?n.y-t.y:n.x-t.x,uR=(n,t)=>n.x===t.x?t.y-n.y:t.x-n.x,_R=(n,t)=>n.x===t.x?n.y-t.y:t.x-n.x,pR=(n,t)=>{if(n.x===t.x){if(n.quadrant===t.quadrant||Bt.isBothLeftOrBothRight(n.quadrant,t.quadrant)){let e=n.quadrant.isLeft()?1:-1;if(n.convex&&!t.convex)return e;if(!n.convex&&t.convex)return-e}return rO.get(n.quadrant)-rO.get(t.quadrant)}return n.x-t.x},aa=class{constructor(t){switch(this.quadrant=t,this.points=[],t){case Bt.Q1:case Bt.Q2:this._compare=(e,o)=>o-e,this._maximalY=Number.POSITIVE_INFINITY;break;case Bt.Q3:case Bt.Q4:this._compare=(e,o)=>e-o,this._maximalY=Number.NEGATIVE_INFINITY;break}}handle(t){this._compare(t.y,this._maximalY)>0&&(this.points.push(new Ye(t.x,t.y,this.quadrant)),this._maximalY=t.y)}},dl=class n{constructor(){this.hull=[],this.xMax1=null,this.xMax2=null,this.xMin1=null,this.xMin2=null,this.yMax1=null,this.yMax2=null,this.yMin1=null,this.yMin2=null}static of(t){let e=new n;for(let a of t)(e.xMax1==null||a.x>=e.xMax1.x)&&(e.xMax2=e.xMax1,e.xMax1=a),(e.xMin1==null||a.x<=e.xMin1.x)&&(e.xMin2=e.xMin1,e.xMin1=a),(e.yMax1==null||a.y>=e.yMax1.y)&&(e.yMax2=e.yMax1,e.yMax1=a),(e.yMin1==null||a.y<=e.yMin1.y)&&(e.yMin2=e.yMin1,e.yMin1=a);let o=new aa(Bt.Q1);Zo.execute(t,fR,o);let r=new aa(Bt.Q4);Zo.execute(t,dR,r);let i=new aa(Bt.Q2);Zo.execute(t,_R,i);let s=new aa(Bt.Q3);Zo.execute(t,uR,s),n._addConcaveCorners(o.points,Bt.Q1),n._addConcaveCorners(i.points,Bt.Q2),n._addConcaveCorners(s.points,Bt.Q3),n._addConcaveCorners(r.points,Bt.Q4),e.hull=[];for(let a of o.points)e.hull.push(a);for(let a=i.points.length-1;a>=0;a--)e.hull.push(i.points[a]);for(let a of s.points)e.hull.push(a);for(let a=r.points.length-1;a>=0;a--)e.hull.push(r.points[a]);return e}getHull(){return this.hull}splitIntoRectangles(){let t=new q_(this);return Zo.execute(this.hull,pR,t),t.queued!=null&&t.rects.push(t.queued),t.rects}static _addConcaveCorners(t,e){let o=[];if(t.length!==0){o.push(t[0]);for(let r=1;r<t.length;r++){let i=t[r-1],s=t[r],a=new Ye(s.x,i.y,e);a.convex=!1,o.push(a),o.push(s)}t.length=0;for(let r of o)t.push(r)}}},q_=class{constructor(t){this._hull=t,this.rects=[],this._minY=null,this._maxY=null,this._lastX=Math.min(t.xMin1.x,t.xMin2.x),this.queued=null,this._queuedPnt=null}handle(t){if(this.queued!=null&&(t.x!==this._queuedPnt.x||Bt.isOneLeftOneRight(this._queuedPnt.quadrant,t.quadrant))&&(this.rects.push(this.queued),this._lastX=this.queued.x+this.queued.width,this.queued=null,this._queuedPnt=null),t.quadrant.isUpper()?this._minY=t:this._maxY=t,(t.quadrant===Bt.Q1&&!t.convex||t.quadrant===Bt.Q2&&t.convex||t.quadrant===Bt.Q3&&t.convex||t.quadrant===Bt.Q4&&!t.convex)&&this._minY!=null&&this._maxY!=null){let e=new dt(this._lastX,this._minY.y,t.x-this._lastX,this._maxY.y-this._minY.y);this.queued=e,this._queuedPnt=t}}};var Er=class n{constructor(){this._compactor=null,this._yetAnotherOffset=null,this._compactedGraphSize=null,this._graphTopLeft=null,this._graphBottomRight=null}compact(t,e,o){this._graphTopLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this._graphBottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let i of t)for(let s of i.getLayerlessNodes()){let a=s.getPosition(),l=s.getSize(),c=s.getMargin();this._graphTopLeft.x=Math.min(this._graphTopLeft.x,a.x-c.left),this._graphTopLeft.y=Math.min(this._graphTopLeft.y,a.y-c.top),this._graphBottomRight.x=Math.max(this._graphBottomRight.x,a.x+l.x+c.right),this._graphBottomRight.y=Math.max(this._graphBottomRight.y,a.y+l.y+c.bottom)}let r=new J_;for(let i of t){let s=this._transformLGraph(i);r.getComponents().push(s),s.containsRegularNodes|=s.getExternalExtensionSides().size!==0}this._compactor=na.init(r,o),this._compactor.compact(new Ie),this._yetAnotherOffset=new O,this._compactedGraphSize=this._compactor.getGraphSize();for(let i of r.getComponents()){let s=this._compactor.getOffset(i);z.offsetGraph(i.graph,s.x,s.y);for(let a of i.getNodes())if(a.getType()===y.EXTERNAL_PORT){let l=this._getExternalPortPosition(a.getPosition(),a.getProperty(p.EXT_PORT_SIDE));a.getPosition().reset().add(l)}}for(let i of r.getComponents())for(let s of i.getExternalEdges()){let a=new st;for(let c of s.getBendPoints())a.add(c);a.add(0,s.getSource().getAbsoluteAnchor()),a.add(s.getTarget().getAbsoluteAnchor());let l=null;for(let c of a){if(l==null){l=c;continue}Math.abs(l.x-c.x)<n.EPSILON?(this._yetAnotherOffset.x=Math.min(this._yetAnotherOffset.x,l.x),this._compactedGraphSize.x=Math.max(this._compactedGraphSize.x,l.x)):Math.abs(l.y-c.y)<n.EPSILON&&(this._yetAnotherOffset.y=Math.min(this._yetAnotherOffset.y,l.y),this._compactedGraphSize.y=Math.max(this._compactedGraphSize.y,l.y)),l=c}}this._yetAnotherOffset.negate(),this._compactedGraphSize.add(this._yetAnotherOffset)}getOffset(){return this._yetAnotherOffset}getGraphSize(){return this._compactedGraphSize}_transformLGraph(t){let e=new Q_(t);e.containsRegularNodes||this._createDummyNode(t);let o=new op;n._componentHullPoints(t,o);let r=new Map;for(let a of[R.LEFT,R.RIGHT,R.UP,R.DOWN,R.UNDEFINED])r.set(a,[]);let i=new ip;for(let a of t.getLayerlessNodes())for(let l of a.getOutgoingEdges())if(n._isExternalEdge(l)){let c=this._transformLEdge(l,o,i),g=c.getDirection(),h=r.get(g)||[];h.push(c.getRepresentative()),r.set(g,h)}let s=[];for(let a of e.getExternalExtensionSides()){let l=a.ordinal(),c=i.min[l],g=i.max[l],h=i.extent[l],d=null,f=null;switch(a){case u.WEST:d=new dt(this._graphTopLeft.x,c,o.topLeft.x-this._graphTopLeft.x,g-c),f=new dt(this._graphTopLeft.x,c,h,g-c),o.add(d.getTopRight()),o.add(d.getBottomRight());break;case u.EAST:d=new dt(o.bottomRight.x,c,this._graphBottomRight.x-o.bottomRight.x,g-c),f=new dt(this._graphBottomRight.x-h,c,h,g-c),o.add(d.getTopLeft()),o.add(d.getBottomLeft());break;case u.NORTH:d=new dt(c,this._graphTopLeft.y,g-c,o.topLeft.y-this._graphTopLeft.y),f=new dt(c,this._graphTopLeft.y,g-c,h),o.add(d.getBottomLeft()),o.add(d.getBottomRight());break;case u.SOUTH:d=new dt(c,o.bottomRight.y,g-c,this._graphBottomRight.y-o.bottomRight.y),f=new dt(c,this._graphBottomRight.y-h,g-c,h),o.add(d.getTopLeft()),o.add(d.getTopRight());break}if(d!=null){let E=new tp;E.side=a,E.extension=d,E.placeholder=f,E.edges=new Set(r.get(n._portSideToDirection(a))||[]),s.push(E)}}for(let a of s)e.externalExtensions.push(a);return e.rectilinearConvexHull=dl.of(o).splitIntoRectangles(),e}_createDummyNode(t){if(t.getLayerlessNodes().length!==1)throw new Error("_createDummyNode precondition failed");let e=t.getLayerlessNodes()[0],o=new ft(t);switch(t.getLayerlessNodes().push(o),o.getSize().x=Math.max(1,e.getSize().x),o.getSize().y=Math.max(1,e.getSize().y),o.getPosition().x=e.getPosition().x,o.getPosition().y=e.getPosition().y,e.getProperty(p.EXT_PORT_SIDE)){case u.WEST:o.getPosition().x+=2;break;case u.NORTH:o.getPosition().y+=2;break;case u.EAST:o.getPosition().x-=2;break;case u.SOUTH:o.getPosition().y-=2;break}let r=new rt;r.setNode(o);let i=new _e,s=e.getPorts()[0];return i.setSource(s),i.setTarget(r),r.getPosition().reset().add(s.getPosition()),r.getAnchor().reset().add(s.getAnchor()),o}static _componentHullPoints(t,e){for(let o of t.getLayerlessNodes())if(o.getType()!==y.EXTERNAL_PORT){n._addLGraphElementBounds(e,o,new O);for(let r of o.getOutgoingEdges())if(!n._isExternalEdge(r))for(let i of r.getBendPoints())e.add(Ye.from(i))}}static _addLGraphElementBounds(t,e,o){let r=null;e instanceof ft||e instanceof rt?r=e.getMargin():r=new Gr;let i=e.getPosition().x,s=e.getPosition().y,a=e.getSize().x,l=e.getSize().y;t.add(new Ye(i-r.left+o.x,s-r.top+o.y)),t.add(new Ye(i-r.left+o.x,s+l+r.bottom+o.y)),t.add(new Ye(i+a+r.right+o.x,s-r.top+o.y)),t.add(new Ye(i+a+r.right+o.x,s+l+r.bottom+o.y))}static _isExternalEdge(t){return t.getSource().getNode().getType()===y.EXTERNAL_PORT||t.getTarget().getNode().getType()===y.EXTERNAL_PORT}_transformLEdge(t,e,o){let r=new ep(t),i=n._edgeToSegments(t,r),s=Math.max(t.getProperty(_.EDGE_THICKNESS)||1,1);for(let d of i.innerSegments){let f=n._segmentToRectangle(d.first,d.second,s);e.addRect(f)}let a=r.externalPortSide,l=n._segmentToRectangle(i.outerSegment.first,i.outerSegment.second,s),c=a.ordinal();a===u.WEST||a===u.EAST?(o.min[c]=Math.min(o.min[c],l.y),o.max[c]=Math.max(o.max[c],l.y+l.height)):(o.min[c]=Math.min(o.min[c],l.x),o.max[c]=Math.max(o.max[c],l.x+l.width));let g=Number.NEGATIVE_INFINITY,h=r.externalPort.getNode().getMargin();switch(a){case u.WEST:g=h.right;break;case u.EAST:g=h.left;break;case u.NORTH:g=h.bottom;break;case u.SOUTH:g=h.top;break}return o.extent[c]=Math.max(o.extent[c],g),r}static _segmentToRectangle(t,e,o){return new dt(Math.min(t.x,e.x)-o/2,Math.min(t.y,e.y)-o/2,Math.abs(t.x-e.x)+o,Math.abs(t.y-e.y)+o)}static _edgeToSegments(t,e){let o=e.externalPort,r=e.externalPortSide,i=t.getSource().getAbsoluteAnchor(),s=t.getTarget().getAbsoluteAnchor();o===t.getSource()?(i=n._getExternalPortPositionStatic(i,r,null),s=n._getPortPositionOnMargin(t.getTarget())):(i=n._getPortPositionOnMargin(t.getSource()),s=n._getExternalPortPositionStatic(s,r,null));let a=new st;for(let g of t.getBendPoints())a.add(g);a.addFirst(i),a.addLast(s);let l=t.getSource()===o,c=new rp;for(let g=0;g<a.size()-1;g++){let h={first:a.get(g),second:a.get(g+1)};l&&g===0||!l&&g===a.size()-2?c.outerSegment=h:c.innerSegments.push(h)}return c}_getExternalPortPosition(t,e){return n._getExternalPortPositionStatic(t,e,this)}static _getExternalPortPositionStatic(t,e,o){if(o==null||o._graphTopLeft==null||o._graphBottomRight==null)return t.clone();switch(e){case u.NORTH:return new O(t.x,Math.min(o._graphTopLeft.y,t.y));case u.EAST:return new O(Math.max(o._graphBottomRight.x,t.x),t.y);case u.SOUTH:return new O(t.x,Math.max(o._graphBottomRight.y,t.y));case u.WEST:return new O(Math.min(t.x,o._graphTopLeft.x),t.y)}return t.clone()}static _getPortPositionOnMargin(t){let e=t.getAbsoluteAnchor().clone(),o=t.getNode().getMargin();switch(t.getSide()){case u.NORTH:e.y-=o.top;break;case u.EAST:e.x+=o.right;break;case u.SOUTH:e.y+=o.bottom;break;case u.WEST:e.x-=o.left;break}return e}static _portSideToDirection(t){switch(t){case u.NORTH:return R.UP;case u.WEST:return R.LEFT;case u.EAST:return R.RIGHT;case u.SOUTH:return R.DOWN}return R.UNDEFINED}};Er.EPSILON=1e-4;var J_=class{constructor(){this._components=[],this.containsExternalPorts=!1}getComponents(){return this._components}isContainsExternalExtensions(){return this.containsExternalPorts}*[Symbol.iterator](){yield*nr(this._components)}},Q_=class{constructor(t){this.graph=t,this.containsRegularNodes=!1;for(let e of t.getLayerlessNodes())this.containsRegularNodes|=e.getType()===y.NORMAL;this.rectilinearConvexHull=[],this.externalExtensions=[]}getExternalExtensionSides(){return this.graph.getProperty(p.EXT_PORT_CONNECTIONS)||new Set}getHull(){return this.rectilinearConvexHull}getExternalExtensions(){return this.externalExtensions}getNodes(){return this.graph.getLayerlessNodes()}getExternalEdges(){let t=[];for(let e of this.externalExtensions)for(let o of e.getRepresentative())t.push(o);return t}},tp=class{constructor(){this.edges=new Set,this.side=null,this.extension=null,this.placeholder=null}getRepresentative(){return this.edges}getRepresentor(){return this.extension}getParent(){throw new Error("InternalUnionExternalExtension.getParent is unsupported")}getDirection(){return Er._portSideToDirection(this.side)}getPlaceholder(){return this.placeholder}},ep=class{constructor(t){if(this.edge=t,this.externalPort=null,this.externalPortSide=null,this.externalExtensionRect=null,this.parent=null,t.getSource().getNode().getType()===y.EXTERNAL_PORT)this.externalPort=t.getSource(),this.externalPortSide=t.getSource().getNode().getProperty(p.EXT_PORT_SIDE);else if(t.getTarget().getNode().getType()===y.EXTERNAL_PORT)this.externalPort=t.getTarget(),this.externalPortSide=t.getTarget().getNode().getProperty(p.EXT_PORT_SIDE);else throw new Error(`Edge ${t} is not an external edge`)}getDirection(){return Er._portSideToDirection(this.externalPortSide)}getRepresentative(){return this.edge}getRepresentor(){return this.externalExtensionRect}getParent(){return this.parent}},op=class extends Array{constructor(){super(),this.topLeft=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this.bottomRight=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY)}add(t){let e=t instanceof Ye?t:Ye.from(t);return this.topLeft.x=Math.min(this.topLeft.x,e.x),this.topLeft.y=Math.min(this.topLeft.y,e.y),this.bottomRight.x=Math.max(this.bottomRight.x,e.x),this.bottomRight.y=Math.max(this.bottomRight.y,e.y),super.push(e),!0}addRect(t){this.add(new Ye(t.x,t.y)),this.add(new Ye(t.x+t.width,t.y)),this.add(new Ye(t.x,t.y+t.height)),this.add(new Ye(t.x+t.width,t.y+t.height))}},rp=class{constructor(){this.innerSegments=[],this.outerSegment=null}},ip=class{constructor(){this.min=new Array(5).fill(Number.POSITIVE_INFINITY),this.max=new Array(5).fill(Number.NEGATIVE_INFINITY),this.extent=new Array(5).fill(Number.NEGATIVE_INFINITY)}};var la=class extends ra{combine(t,e){if(t.length===1){let a=t[0];a!==e&&(e.getLayerlessNodes().length=0,this.moveGraph(e,a,0,0),e.copyProperties(a),e.getPadding().copy(a.getPadding()),e.getSize().x=a.getSize().x,e.getSize().y=a.getSize().y);return}else if(t.length===0){e.getLayerlessNodes().length=0,e.getSize().x=0,e.getSize().y=0;return}this.sortComponents(t,e);let o=t[0];e.getLayerlessNodes().length=0,e.copyProperties(o);let r=0,i=0;for(let a of t){let l=a.getSize();r=Math.max(r,l.x),i+=l.x*l.y}r=Math.max(r,Math.sqrt(i)*e.getProperty(_.ASPECT_RATIO));let s=e.getProperty(_.SPACING_COMPONENT_COMPONENT);if(this.placeComponents(t,e,r,s),o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)){let a=new Er;a.compact(t,e.getSize(),s);for(let l of t)l.getOffset().reset().add(a.getOffset());e.getSize().reset().add(a.getGraphSize())}this.moveGraphs(e,t,0,0)}sortComponents(t,e){if(e.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)===Me.NONE){for(let o of t){let r=0;for(let i of o.getLayerlessNodes())r+=i.getProperty(_.PRIORITY)||0;o.id=r}t.sort((o,r)=>{let i=r.id-o.id;if(i===0){let s=o.getSize().x*o.getSize().y,a=r.getSize().x*r.getSize().y;return s-a}return i})}}placeComponents(t,e,o,r){let i=0,s=0,a=0,l=r;for(let c of t){let g=c.getSize();i+g.x>o&&(i=0,s+=a+r,a=0);let h=c.getOffset();this.offsetGraph(c,i+h.x,s+h.y),h.reset(),l=Math.max(l,i+g.x),a=Math.max(a,g.y),i+=g.x+r}e.getSize().x=l,e.getSize().y=s+a}};var{SIDES_EAST:Pf,SIDES_EAST_SOUTH:ca,SIDES_EAST_SOUTH_WEST:no,SIDES_EAST_WEST:Vi,SIDES_NONE:iO,SIDES_NORTH:Of,SIDES_NORTH_EAST:ga,SIDES_NORTH_EAST_SOUTH:ao,SIDES_NORTH_EAST_SOUTH_WEST:pe,SIDES_NORTH_EAST_WEST:lo,SIDES_NORTH_SOUTH:Xi,SIDES_NORTH_SOUTH_WEST:co,SIDES_NORTH_WEST:ha,SIDES_SOUTH:Sf,SIDES_SOUTH_WEST:da,SIDES_WEST:Tf}=u,zr=class n{constructor(t){this.components=new Map,t!==void 0&&this.add(t)}add(t){if(this._canAdd(t)){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=this.components.get(e);return o===void 0&&(o=[],this.components.set(e,o)),o.push(t),!0}return!1}_canAdd(t){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=n.CONSTRAINTS.get(e);if(!o)return!0;for(let r of o){let i=this.components.get(r);if(i&&i.length>0)return!1}return!0}*getPortSides(){for(let[t,e]of this.components)for(let o=0;o<e.length;o++)yield t}getComponents(t){if(t!==void 0)return this.components.get(t)||[];let e=[];for(let o of this.components.values())for(let r of o)e.push(r);return e}};zr.CONSTRAINTS=new Map;function et(n,t){let e=zr.CONSTRAINTS.get(n);e||(e=[],zr.CONSTRAINTS.set(n,e)),e.push(t)}et(iO,pe);et(Tf,pe);et(Tf,co);et(Pf,ao);et(Pf,pe);et(Of,pe);et(Of,lo);et(Sf,no);et(Sf,pe);et(Xi,Vi);et(Xi,pe);et(Xi,lo);et(Xi,no);et(Vi,Xi);et(Vi,co);et(Vi,ao);et(Vi,pe);et(ha,ha);et(ha,lo);et(ha,co);et(ga,ga);et(ga,lo);et(ga,ao);et(da,da);et(da,no);et(da,co);et(ca,ca);et(ca,no);et(ca,ao);et(lo,Of);et(lo,Xi);et(lo,ha);et(lo,ga);et(lo,pe);et(lo,lo);et(lo,co);et(lo,ao);et(no,Sf);et(no,Xi);et(no,da);et(no,ca);et(no,no);et(no,co);et(no,ao);et(no,pe);et(co,Tf);et(co,Vi);et(co,ha);et(co,da);et(co,lo);et(co,no);et(co,co);et(co,pe);et(ao,Pf);et(ao,Vi);et(ao,ga);et(ao,ca);et(ao,lo);et(ao,no);et(ao,ao);et(ao,pe);et(pe,iO);et(pe,Tf);et(pe,Pf);et(pe,Of);et(pe,Sf);et(pe,Xi);et(pe,Vi);et(pe,lo);et(pe,no);et(pe,co);et(pe,ao);et(pe,pe);var{SIDES_EAST:sO,SIDES_EAST_SOUTH:nO,SIDES_EAST_SOUTH_WEST:aO,SIDES_EAST_WEST:lO,SIDES_NONE:cO,SIDES_NORTH:gO,SIDES_NORTH_EAST:hO,SIDES_NORTH_EAST_SOUTH:dO,SIDES_NORTH_EAST_SOUTH_WEST:fO,SIDES_NORTH_EAST_WEST:ER,SIDES_NORTH_SOUTH:uO,SIDES_NORTH_SOUTH_WEST:mR,SIDES_NORTH_WEST:PR,SIDES_SOUTH:_O,SIDES_SOUTH_WEST:pO,SIDES_WEST:EO}=u,fa=class extends ra{constructor(){super(),this.componentGroups=[]}combine(t,e){if(this.componentGroups.length=0,e.getLayerlessNodes().length=0,t.length===0){e.getSize().x=0,e.getSize().y=0;return}let o=t[0];e.copyProperties(o);for(let s of t)this._addComponent(s);let r=new O,i=o.getProperty(_.SPACING_COMPONENT_COMPONENT);for(let s of this.componentGroups){let a=this._placeComponents(s,i);this.offsetGraphs(s.getComponents(),r.x,r.y),r.x+=a.x,r.y+=a.y}if(e.getSize().x=r.x-i,e.getSize().y=r.y-i,o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)&&o.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL){for(let a of t)this.offsetGraph(a,a.getOffset().x,a.getOffset().y);let s=new Er;s.compact(t,e.getSize(),i);for(let a of t)a.getOffset().reset().add(s.getOffset());e.getSize().reset().add(s.getGraphSize())}for(let s of this.componentGroups)this.moveGraphs(e,s.getComponents(),0,0)}_addComponent(t){for(let e of this.componentGroups)if(e.add(t))return;this.componentGroups.push(new zr(t))}_placeComponents(t,e){let o=this._placeComponentsInRows(t.getComponents(cO),e),r=this._placeComponentsHorizontally(t.getComponents(gO),e),i=this._placeComponentsHorizontally(t.getComponents(_O),e),s=this._placeComponentsVertically(t.getComponents(EO),e),a=this._placeComponentsVertically(t.getComponents(sO),e),l=this._placeComponentsHorizontally(t.getComponents(PR),e),c=this._placeComponentsHorizontally(t.getComponents(hO),e),g=this._placeComponentsHorizontally(t.getComponents(pO),e),h=this._placeComponentsHorizontally(t.getComponents(nO),e),d=this._placeComponentsVertically(t.getComponents(lO),e),f=this._placeComponentsHorizontally(t.getComponents(uO),e),E=this._placeComponentsHorizontally(t.getComponents(ER),e),P=this._placeComponentsHorizontally(t.getComponents(aO),e),S=this._placeComponentsVertically(t.getComponents(mR),e),T=this._placeComponentsVertically(t.getComponents(dO),e),N=this._placeComponentsHorizontally(t.getComponents(fO),e),I=Ft.maxd(l.x,s.x,g.x,S.x),C=Ft.maxd(r.x,o.x,i.x,N.x),x=f.x,M=Ft.maxd(c.x,a.x,h.x,T.x),A=Ft.maxd(l.y,r.y,c.y,E.y),B=Ft.maxd(s.y,o.y,a.y,N.y),Y=d.y,j=Ft.maxd(g.y,i.y,h.y,P.y);this.offsetGraphs(t.getComponents(cO),I+x,A+Y),this.offsetGraphs(t.getComponents(fO),I+x,A+Y),this.offsetGraphs(t.getComponents(gO),I+x,0),this.offsetGraphs(t.getComponents(_O),I+x,A+Y+B),this.offsetGraphs(t.getComponents(EO),0,A+Y),this.offsetGraphs(t.getComponents(sO),I+x+C,A+Y),this.offsetGraphs(t.getComponents(hO),I+x+C,0),this.offsetGraphs(t.getComponents(pO),0,A+Y+B),this.offsetGraphs(t.getComponents(nO),I+x+C,A+Y+B),this.offsetGraphs(t.getComponents(lO),0,A),this.offsetGraphs(t.getComponents(uO),I,0),this.offsetGraphs(t.getComponents(aO),0,A+Y+B),this.offsetGraphs(t.getComponents(dO),I+x+C,0);let X=new O;return X.x=Ft.maxd(I+C+x+M,d.x,E.x,P.x),X.y=Ft.maxd(A+B+Y+j,f.y,S.y,T.y),X}_placeComponentsHorizontally(t,e){let o=new O;for(let r of t)this.offsetGraph(r,o.x,0),o.x+=r.getSize().x+e,o.y=Math.max(o.y,r.getSize().y);return o.y>0&&(o.y+=e),o}_placeComponentsVertically(t,e){let o=new O;for(let r of t)this.offsetGraph(r,0,o.y),o.y+=r.getSize().y+e,o.x=Math.max(o.x,r.getSize().x);return o.x>0&&(o.x+=e),o}_placeComponentsInRows(t,e){if(t.length===0)return new O;let o=0,r=0;for(let c of t){let g=c.getSize();o=Math.max(o,g.x),r+=g.x*g.y}o=Math.max(o,Math.sqrt(r)*t[0].getProperty(_.ASPECT_RATIO));let i=0,s=0,a=0,l=e;for(let c of t){let g=c.getSize();i+g.x>o&&(i=0,s+=a+e,a=0),this.offsetGraph(c,i,s),l=Math.max(l,i+g.x),a=Math.max(a,g.y),i+=g.x+e}return new O(l+e,s+a+e)}};var{SIDES_EAST:po,SIDES_EAST_SOUTH:ko,SIDES_EAST_SOUTH_WEST:gi,SIDES_EAST_WEST:Eo,SIDES_NONE:Co,SIDES_NORTH:Wo,SIDES_NORTH_EAST:to,SIDES_NORTH_EAST_SOUTH:hi,SIDES_NORTH_EAST_SOUTH_WEST:Nf,SIDES_NORTH_EAST_WEST:Ki,SIDES_NORTH_SOUTH:di,SIDES_NORTH_SOUTH_WEST:Yr,SIDES_NORTH_WEST:sr,SIDES_SOUTH:go,SIDES_SOUTH_WEST:xo,SIDES_WEST:Do}=u,ws=class n extends zr{constructor(t){super(),this.componentOrder=[],t!==void 0&&this.add(t)}add(t){if(this._canAdd(t)){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=this.components.get(e);return o===void 0&&(o=[],this.components.set(e,o)),o.push(t),this.componentOrder.push(t),!0}return!1}_canAdd(t){let e=t.getProperty(p.EXT_PORT_CONNECTIONS),o=zr.CONSTRAINTS.get(e),r=n.MODEL_ORDER_CONSTRAINTS.get(e);if(o)for(let i of o){let s=this.components.get(i);if(s&&s.length>0)return!1}if(r)for(let i of r){let s=this.components.get(i);if(s&&s.length>0)return!1}return!0}getComponentOrder(){return this.componentOrder}};ws.MODEL_ORDER_CONSTRAINTS=new Map;function F(n,t){let e=ws.MODEL_ORDER_CONSTRAINTS.get(n);e||(e=[],ws.MODEL_ORDER_CONSTRAINTS.set(n,e)),e.push(t)}F(Wo,Co);F(Do,Co);F(to,Co);F(sr,Co);F(Yr,Co);F(Ki,Co);F(sr,Wo);F(Co,po);F(Wo,po);F(Do,po);F(to,po);F(di,po);F(sr,po);F(Yr,po);F(Ki,po);F(Eo,po);F(Co,go);F(Wo,go);F(po,go);F(Do,go);F(to,go);F(di,go);F(sr,go);F(Eo,go);F(xo,go);F(Yr,go);F(hi,go);F(Ki,go);F(Wo,Do);F(to,Do);F(sr,Do);F(Ki,Do);F(Wo,to);F(Do,to);F(sr,to);F(to,to);F(Yr,to);F(Co,ko);F(Wo,ko);F(po,ko);F(go,ko);F(Do,ko);F(to,ko);F(di,ko);F(sr,ko);F(xo,ko);F(Eo,ko);F(Ki,ko);F(Yr,ko);F(Nf,ko);F(Co,xo);F(Wo,xo);F(po,xo);F(Do,xo);F(to,xo);F(di,xo);F(sr,xo);F(Eo,xo);F(Ki,xo);F(hi,xo);F(Nf,xo);F(Wo,Eo);F(Do,Eo);F(to,Eo);F(sr,Eo);F(xo,Eo);F(Ki,Eo);F(Yr,Eo);F(Co,gi);F(Wo,gi);F(po,gi);F(Do,gi);F(to,gi);F(di,gi);F(sr,gi);F(Eo,gi);F(Ki,gi);F(Wo,Yr);F(po,Yr);F(go,Yr);F(to,Yr);F(Co,hi);F(Wo,hi);F(go,hi);F(Do,hi);F(to,hi);F(di,hi);F(sr,hi);F(sr,Nf);F(to,Nf);F(Eo,Co);F(Eo,Do);F(Eo,po);F(di,Co);F(di,Wo);F(di,go);var yf=class extends fa{combine(t,e){if(this.componentGroups.length=0,e.getLayerlessNodes().length=0,t.length===0){e.getSize().x=0,e.getSize().y=0;return}let o=t[0];e.copyProperties(o);for(let d of t)this._addComponent(d);let r=new O,i=new O,s=new O,a=new O,l=o.getProperty(_.SPACING_COMPONENT_COMPONENT),c=e.getProperty(lr),g=c&&c.isHorizontal&&c.isHorizontal(),h=c&&c.isVertical&&c.isVertical();for(let d of this.componentGroups){if(g){s.x=r.x;for(let E of d.getPortSides())if(E.has(u.NORTH)){s.x=i.x;break}}else if(h){s.y=r.y;for(let E of d.getPortSides())if(E.has(u.WEST)){s.y=i.y;break}}let f=this._placeComponents(d,l);if(this.offsetGraphs(d.getComponents(),s.x,s.y),g){i.x=s.x+f.x,a.x=Math.max(a.x,i.x);for(let E of d.getPortSides())if(E.has(u.SOUTH)){r.x=s.x+f.x;break}i.y=s.y+f.y,s.y=i.y,a.y=Math.max(a.y,s.y)}else if(h){i.y=s.y+f.y,a.y=Math.max(a.y,i.y);for(let E of d.getPortSides())if(E.has(u.EAST)){r.y=s.y+f.y;break}i.x=s.x+f.x,s.x=i.x,a.x=Math.max(a.x,s.x)}}if(e.getSize().x=a.x-l,e.getSize().y=a.y-l,o.getProperty(_.COMPACTION_CONNECTED_COMPONENTS)&&o.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL){for(let f of t)this.offsetGraph(f,f.getOffset().x,f.getOffset().y);let d=new Er;d.compact(t,e.getSize(),l);for(let f of t)f.getOffset().reset().add(d.getOffset());e.getSize().reset().add(d.getGraphSize())}for(let d of this.componentGroups)this.moveGraphs(e,d.getComponents(),0,0)}_addComponent(t){this.componentGroups.length>0&&this.componentGroups[this.componentGroups.length-1].add(t)||this.componentGroups.push(new ws(t))}};var If=class extends la{sortComponents(t,e){}placeComponents(t,e,o,r){let i=0,s=0,a=0,l=r,c=null,g=0;for(let h of t){let d=h.getSize(),f=h.getProperty(p.EXT_PORT_CONNECTIONS),E=c?c.getProperty(p.EXT_PORT_CONNECTIONS):null;(i+d.x>o&&!(f&&f.has(u.NORTH))||E&&E.has(u.EAST)||f&&f.has(u.WEST))&&(i=g,s+=a+r,a=0);let P=h.getOffset();f&&f.has(u.NORTH)&&(i=l+r),this.offsetGraph(h,i+P.x,s+P.y),l=Math.max(l,i+d.x),f&&f.has(u.SOUTH)&&(g=Math.max(g,i+d.x+r)),P.reset(),a=Math.max(a,d.y),i+=d.x+r,c=h}e.getSize().x=l,e.getSize().y=s+a}};var Rf=class{constructor(){this._componentGroupGraphPlacer=new fa,this._componentGroupModelOrderGraphPlacer=new yf,this._modelOrderRowGraphPlacer=new If,this._simpleRowGraphPlacer=new la,this._graphPlacer=this._simpleRowGraphPlacer}split(t){let e;this._graphPlacer=this._simpleRowGraphPlacer;let o=t.getProperty(_.SEPARATE_CONNECTED_COMPONENTS),r=o==null||o===!0,i=t.getProperty(p.GRAPH_PROPERTIES),s=i&&i.has(v.EXTERNAL_PORTS),a=t.getProperty(_.PORT_CONSTRAINTS),l=!(a&&typeof a.isOrderFixed=="function"&&a.isOrderFixed());if(r&&(l||!s)){for(let c of t.getLayerlessNodes())c.id=0;e=[];for(let c of t.getLayerlessNodes()){let g=this._dfs(c,null);if(g!=null){let h=new Nn;h.copyProperties(t),h.setProperty(p.EXT_PORT_CONNECTIONS,u.sidesOf(g.extPortSides)),h.getPadding().copy(t.getPadding()),h.setProperty(_.NODE_SIZE_MINIMUM,null);for(let d of g.nodes)h.getLayerlessNodes().push(d),d.setGraph(h);e.push(h)}}if(s){let c=t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS);c===Me.GROUP_MODEL_ORDER?this._graphPlacer=this._componentGroupModelOrderGraphPlacer:c===Me.MODEL_ORDER?this._graphPlacer=this._modelOrderRowGraphPlacer:this._graphPlacer=this._componentGroupGraphPlacer}}else e=[t];return t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)!==Me.NONE&&e.sort((c,g)=>{let h=z.getMinimalModelOrder(c),d=z.getMinimalModelOrder(g);return h-d}),e}_dfs(t,e){if(t.id===0){t.id=1;let o=e;o==null&&(o={nodes:[],extPortSides:new Set}),o.nodes.push(t),t.getType()===y.EXTERNAL_PORT&&o.extPortSides.add(t.getProperty(p.EXT_PORT_SIDE));for(let r of t.getPorts())for(let i of r.getConnectedPorts())this._dfs(i.getNode(),o);return o}return null}combine(t,e){this._graphPlacer.combine(t,e)}};var ua=class extends Gi{constructor(t=""){super(),this._text=t}getText(){return this._text}toString(){let t=this.getDesignation();return t==null?"label":`l_${t}`}getDesignation(){return this._text&&this._text.length>0?this._text:super.getDesignation()}};var Ms=class{constructor(t,e,o){this._newEdge=t,this._graph=e,this._type=o}toString(){return`${this._type.toString()}:${this._newEdge.toString()}`}getEdge(){return this._newEdge}getGraph(){return this._graph}getType(){return this._type}getActualSource(){let t=this._newEdge.getSource();return t.getNode().getType()===y.EXTERNAL_PORT?t.getNode().getProperty(p.ORIGIN):t}getActualTarget(){let t=this._newEdge.getTarget();return t.getNode().getType()===y.EXTERNAL_PORT?t.getNode().getProperty(p.ORIGIN):t}};var _a=class n{constructor(t){this._graph=t,this.compare=this.compare.bind(this)}compare(t,e){if(t.getType()===W.OUTPUT&&e.getType()===W.INPUT)return-1;if(t.getType()===W.INPUT&&e.getType()===W.OUTPUT)return 1;let o=n._hierarchyLevel(t.getGraph(),this._graph),r=n._hierarchyLevel(e.getGraph(),this._graph);return t.getType()===W.OUTPUT?r-o:o-r}static _hierarchyLevel(t,e){let o=t,r=0;for(;;){if(o===e)return r;let i=o.getParentNode();if(i==null)throw new Error("CrossHierarchyEdgeComparator: nestedGraph is not a descendant of topLevelGraph");o=i.getGraph(),r++}}};var fl=class n{constructor(){this._crossHierarchyMap=null,this._dummyNodeMap=new Map}process(t,e){e.begin("Compound graph preprocessor",1),this._crossHierarchyMap=new Map,this._transformHierarchyEdges(t,null),this._moveLabelsAndRemoveOriginalEdges(t),this._setSidesOfPortsToSidesOfDummyNodes(),t.setProperty(p.CROSS_HIERARCHY_MAP,this._crossHierarchyMap),this._crossHierarchyMap=null,this._dummyNodeMap.clear(),e.done()}_putCrossHierarchyEdge(t,e){let o=this._crossHierarchyMap.get(t);o==null&&(o=[],this._crossHierarchyMap.set(t,o)),o.push(e)}_setSidesOfPortsToSidesOfDummyNodes(){for(let[t,e]of this._dummyNodeMap.entries())e.setProperty(p.ORIGIN,t),t.setProperty(p.PORT_DUMMY,e),t.setProperty(p.INSIDE_CONNECTIONS,!0),t.setSide(e.getProperty(p.EXT_PORT_SIDE)),t.getNode().setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE),t.getNode().getGraph().getProperty(p.GRAPH_PROPERTIES).add(v.NON_FREE_PORTS)}_transformHierarchyEdges(t,e){let o=[];for(let i of t.getLayerlessNodes()){let s=i.getNestedGraph();if(s==null)continue;let a=this._transformHierarchyEdges(s,i);if(o.push(...a),this._processInsideSelfLoops(s,i),s.getProperty(p.GRAPH_PROPERTIES).has(v.EXTERNAL_PORTS)){let l=i.getProperty(_.PORT_CONSTRAINTS),c=i.getProperty(_.PORT_LABELS_PLACEMENT),g=c!=null&&c.has!=null&&c.has(it.INSIDE);for(let h of i.getPorts()){let d=this._dummyNodeMap.get(h);d==null&&(d=z.createExternalPortDummy(h,l,h.getSide(),-h.getNetFlow(),null,new O,h.getSize(),s.getProperty(_.DIRECTION),s),d.setProperty(p.ORIGIN,h),this._dummyNodeMap.set(h,d),s.getLayerlessNodes().push(d));let f=d.getPorts()[0];for(let E of h.getLabels()){let P=new ua;if(P.getSize().x=E.getSize().x,P.getSize().y=E.getSize().y,f.getLabels().push(P),!g){let S=h.getSide(),T=0;c!=null&&it.isFixed(c)&&(T=iu(E.getPosition(),E.getSize(),h.getSize(),0,S)),l===H.FREE||u.SIDES_EAST_WEST.has(S)?P.getSize().x=T:P.getSize().y=T}}}}}let r=[];return this._processInnerHierarchicalEdgeSegments(t,e,o,r),e!=null&&this._processOuterHierarchicalEdgeSegments(t,e,r),r}_moveLabelsAndRemoveOriginalEdges(t){for(let e of this._crossHierarchyMap.keys()){let o=e.getLabels();if(o!=null&&o.length>0){let r=Array.from(this._crossHierarchyMap.get(e));r.sort(new _a(t).compare);let i=[];for(let s of o){let a=-1,l=s.getProperty(_.EDGE_LABELS_PLACEMENT);if(l===St.HEAD?a=r.length-1:l===St.CENTER?a=this._getShallowestEdgeSegment(r):l===St.TAIL&&(a=0),a!==-1){let c=r[a];c.getEdge().getLabels().push(s);let g=c.getEdge().getSource().getNode().getGraph().getProperty(p.GRAPH_PROPERTIES);g.add(v.END_LABELS),g.add(v.CENTER_LABELS),s.setProperty(p.ORIGINAL_LABEL_EDGE,e)}else i.push(s)}o.length=0,o.push(...i)}e.setSource(null),e.setTarget(null)}}_getShallowestEdgeSegment(t){let e=-1,o=0;for(let r of t){if(r.getType()===W.INPUT){e=o===0?0:o-1;break}else o===t.length-1&&(e=o);o+=1}return e}_processInnerHierarchicalEdgeSegments(t,e,o,r){let i=[];for(let s of o){let a=null;if(s.type===W.OUTPUT)for(let l of s.origEdges){let c=l.getTarget().getNode();if(c.getGraph()===t)this._connectChild(t,s,l,s.dummyPort,l.getTarget());else if(e==null||z.isDescendant(c,e))this._connectSiblings(t,s,o,l);else{let g=this._introduceHierarchicalEdgeSegment(t,e,l,s.dummyPort,W.OUTPUT,a);g!==a&&i.push(g),g.exported&&(a=g)}}else for(let l of s.origEdges){let c=l.getSource().getNode();if(c.getGraph()===t)this._connectChild(t,s,l,l.getSource(),s.dummyPort);else{if(e==null||z.isDescendant(c,e))continue;{let g=this._introduceHierarchicalEdgeSegment(t,e,l,s.dummyPort,W.INPUT,a);g!==a&&i.push(g),g.exported&&(a=g)}}}}for(let s of i){let a=t.getLayerlessNodes();a.includes(s.dummyNode)||a.push(s.dummyNode),s.exported&&r.push(s)}}_connectChild(t,e,o,r,i){let s=this._createDummyEdge(t,o);s.setSource(r),s.setTarget(i),this._putCrossHierarchyEdge(o,new Ms(s,t,e.type))}_connectSiblings(t,e,o,r){let i=null;for(let a of o)if(a!==e&&a.origEdges.includes(r)){i=a;break}let s=this._createDummyEdge(t,r);s.setSource(e.dummyPort),s.setTarget(i.dummyPort),this._putCrossHierarchyEdge(r,new Ms(s,t,e.type))}_processOuterHierarchicalEdgeSegments(t,e,o){let r=[];for(let i of t.getLayerlessNodes())for(let s of i.getPorts()){let a=null;for(let c of z.toEdgeArray(s.getOutgoingEdges()))if(!z.isDescendant(c.getTarget().getNode(),e)){let g=this._introduceHierarchicalEdgeSegment(t,e,c,c.getSource(),W.OUTPUT,a);g!==a&&r.push(g),g.exported&&(a=g)}let l=null;for(let c of z.toEdgeArray(s.getIncomingEdges()))if(!z.isDescendant(c.getSource().getNode(),e)){let g=this._introduceHierarchicalEdgeSegment(t,e,c,c.getTarget(),W.INPUT,l);g!==l&&r.push(g),g.exported&&(l=g)}}for(let i of r){let s=t.getLayerlessNodes();s.includes(i.dummyNode)||s.push(i.dummyNode),i.exported&&o.push(i)}}_processInsideSelfLoops(t,e){if(e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))for(let o of e.getPorts()){let r=z.toEdgeArray(o.getOutgoingEdges());for(let i of r){if(!(i.getTarget().getNode()===e&&i.getProperty(_.INSIDE_SELF_LOOPS_YO)))continue;let l=i.getSource(),c=this._dummyNodeMap.get(l);c==null&&(c=z.createExternalPortDummy(l,H.FREE,l.getSide(),-1,null,null,l.getSize(),t.getProperty(_.DIRECTION),t),c.setProperty(p.ORIGIN,l),this._dummyNodeMap.set(l,c),t.getLayerlessNodes().push(c));let g=i.getTarget(),h=this._dummyNodeMap.get(g);h==null&&(h=z.createExternalPortDummy(g,H.FREE,g.getSide(),1,null,null,g.getSize(),t.getProperty(_.DIRECTION),t),h.setProperty(p.ORIGIN,g),this._dummyNodeMap.set(g,h),t.getLayerlessNodes().push(h));let d=this._createDummyEdge(t,i);d.setSource(c.getPorts()[0]),d.setTarget(h.getPorts()[0]),this._putCrossHierarchyEdge(i,new Ms(d,t,W.OUTPUT)),t.getProperty(p.GRAPH_PROPERTIES).add(v.EXTERNAL_PORTS)}}}_introduceHierarchicalEdgeSegment(t,e,o,r,i,s){let a=t.getProperty(_.MERGE_HIERARCHY_EDGES),l=null;i===W.INPUT&&o.getSource().getNode()===e?l=o.getSource():i===W.OUTPUT&&o.getTarget().getNode()===e&&(l=o.getTarget());let c=s;if(c==null||!a||l!=null){let g=u.UNDEFINED;l!=null?g=l.getSide():e.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(g=i===W.INPUT?u.WEST:u.EAST);let h=this._createExternalPortDummyNode(t,e,i,g,o),d=this._createDummyEdge(e.getGraph(),o);i===W.INPUT?(d.setSource(h.getPorts()[0]),d.setTarget(r)):(d.setSource(r),d.setTarget(h.getPorts()[0])),c=new sp(o,d,h,h.getProperty(p.ORIGIN),i,l==null)}else{c.origEdges.push(o);let g=Math.max(c.newEdge.getProperty(_.EDGE_THICKNESS),o.getProperty(_.EDGE_THICKNESS));c.newEdge.setProperty(_.EDGE_THICKNESS,g)}return this._putCrossHierarchyEdge(o,new Ms(c.newEdge,t,i)),c}_createDummyEdge(t,e){let o=new _e;return o.copyProperties(e),o.setProperty(_.JUNCTION_POINTS,null),o}_calculateNetFlow(t){let e=t.getNode(),o=e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=0,i=0;for(let s of t.getOutgoingEdges()){let a=s.isSelfLoop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=s.getTarget().getNode();a&&l?i++:a&&!l?r++:c.getGraph().getParentNode()===e?i++:r++}for(let s of t.getIncomingEdges()){let a=s.isSelfLoop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=s.getSource().getNode();a&&l?r++:a&&!l?i++:c.getGraph().getParentNode()===e?r++:i++}return r-i}_createExternalPortDummyNode(t,e,o,r,i){let s=null,a=o===W.INPUT?i.getSource():i.getTarget(),l=z.getDirection(t);if(a.getNode()===e)s=this._dummyNodeMap.get(a),s==null&&(s=z.createExternalPortDummy(a,e.getProperty(_.PORT_CONSTRAINTS),r,this._calculateNetFlow(a),null,a.getPosition(),a.getSize(),l,t),s.setProperty(p.ORIGIN,a),this._dummyNodeMap.set(a,s));else{s=z.createExternalPortDummy(n._createExternalPortProperties(t),e.getProperty(_.PORT_CONSTRAINTS),r,o===W.INPUT?-1:1,null,new O,new O(0,0),l,t);let c=n._createPortForDummy(s,e,o);s.setProperty(p.ORIGIN,c),this._dummyNodeMap.set(c,s)}return t.getProperty(p.GRAPH_PROPERTIES).add(v.EXTERNAL_PORTS),t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()?t.setProperty(_.PORT_CONSTRAINTS,H.FIXED_SIDE):t.setProperty(_.PORT_CONSTRAINTS,H.FREE),s}static _createExternalPortProperties(t){let e=new ge,o=t.getProperty(_.SPACING_EDGE_EDGE)/2;return e.setProperty(_.PORT_BORDER_OFFSET,o),e}static _createPortForDummy(t,e,o){let r=e.getGraph(),i=z.getDirection(r),s=new rt;return s.setNode(e),o===W.INPUT?s.setSide(u.fromDirection(i).opposed()):o===W.OUTPUT&&s.setSide(u.fromDirection(i)),s.setProperty(_.PORT_BORDER_OFFSET,t.getProperty(_.PORT_BORDER_OFFSET)),s}};fl.isHierarchyAware=!0;var sp=class{constructor(t,e,o,r,i,s){this.origEdges=[t],this.newEdge=e,this.dummyNode=o,this.dummyPort=r,this.type=i!=null?i:W.UNDEFINED,this.exported=s}};var Lf=class n{process(t,e){e.begin("Compound graph postprocessor",1);let o=t.getProperty(_.UNNECESSARY_BENDPOINTS),r=t.getProperty(p.CROSS_HIERARCHY_MAP);if(r==null){e.done();return}let i=new Set;for(let s of r.keys()){let a=(r.get(s)||[]).slice();a.sort(new _a(t).compare);let l=a[0].getActualSource(),c=a[a.length-1].getActualTarget(),g=l.getNode(),h;z.isDescendant(c.getNode(),g)?h=g.getNestedGraph():h=g.getGraph();let d=n._clearJunctionPoints(s,a);s.getBendPoints().clear();let f=null;for(let E of a){let P=new O;z.changeCoordSystem(P,E.getGraph(),h);let S=E.getEdge(),T=new st;T.addAllAsCopies(0,S.getBendPoints()),T.offset(P);let N=S.getSource().getAbsoluteAnchor().clone(),I=S.getTarget().getAbsoluteAnchor().clone();if(N.add(P),I.add(P),f!=null){let C;T.isEmpty()?C=I:C=T.getFirst();let x=Math.abs(f.x-C.x)>se.TOLERANCE,M=Math.abs(f.y-C.y)>se.TOLERANCE;(!o&&x&&M||o&&(x||M))&&s.getBendPoints().add(N)}for(let C of T)s.getBendPoints().add(C);T.isEmpty()?f=N:f=T.getLast(),n._copyJunctionPoints(S,d,P),E.getActualTarget()===c&&(c.getNode().getGraph()!==E.getGraph()&&(P=new O,z.changeCoordSystem(P,c.getNode().getGraph(),h)),s.setProperty(p.TARGET_OFFSET,P)),n._copyLabelsBack(S,s,h),i.add(S)}s.setSource(l),s.setTarget(c)}for(let s of i)s.setSource(null),s.setTarget(null);e.done()}static _clearJunctionPoints(t,e){let o=t.getProperty(_.JUNCTION_POINTS),r=!1;for(let i of e){let s=i.getEdge().getProperty(_.JUNCTION_POINTS);if(s!=null&&!s.isEmpty()){r=!0;break}}return r?o==null?(o=new st,t.setProperty(_.JUNCTION_POINTS,o)):o.clear():o!=null&&(t.setProperty(_.JUNCTION_POINTS,null),o=null),o}static _copyJunctionPoints(t,e,o){if(e==null)return;let r=t.getProperty(_.JUNCTION_POINTS);if(r!=null){let i=new st;i.addAllAsCopies(0,r),i.offset(o);for(let s of i)e.add(s)}}static _copyLabelsBack(t,e,o){let r=t.getLabels();for(let i=r.length-1;i>=0;i--){let s=r[i];s.getProperty(p.ORIGINAL_LABEL_EDGE)===e&&(z.changeCoordSystem(s.getPosition(),t.getSource().getNode().getGraph(),o),r.splice(i,1),e.getLabels().push(s))}}};var OR=1,np=.4,Af=class{constructor(){this._createdJunctionPoints=new Set}getLayoutProcessorConfiguration(t){let e=K.create();e.addBefore(D.P3_NODE_ORDERING,w.INVERTED_PORT_PROCESSOR);let o=t.getProperty(p.GRAPH_PROPERTIES);return o&&(o.has(v.NORTH_SOUTH_PORTS)&&(e.addBefore(D.P3_NODE_ORDERING,w.NORTH_SOUTH_PORT_PREPROCESSOR),e.addAfter(D.P5_EDGE_ROUTING,w.NORTH_SOUTH_PORT_POSTPROCESSOR)),o.has(v.SELF_LOOPS)&&(e.addBefore(D.P1_CYCLE_BREAKING,w.SELF_LOOP_PREPROCESSOR),e.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_PORT_RESTORER),e.addBefore(D.P4_NODE_PLACEMENT,w.SELF_LOOP_ROUTER),e.addAfter(D.P5_EDGE_ROUTING,w.SELF_LOOP_POSTPROCESSOR)),o.has(v.CENTER_LABELS)&&(e.addBefore(D.P2_LAYERING,w.LABEL_DUMMY_INSERTER),e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_DUMMY_SWITCHER),e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),e.addAfter(D.P5_EDGE_ROUTING,w.LABEL_DUMMY_REMOVER)),o.has(v.END_LABELS)&&(e.addBefore(D.P4_NODE_PLACEMENT,w.LABEL_SIDE_SELECTOR),e.addBefore(D.P4_NODE_PLACEMENT,w.END_LABEL_PREPROCESSOR),e.addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_POSTPROCESSOR))),e}process(t,e){e&&e.begin&&e.begin("Polyline edge routing",1);let o=t.getProperty(_.EDGE_ROUTING_POLYLINE_SLOPED_EDGE_ZONE_WIDTH),r=t.getProperty(_.SPACING_NODE_NODE_BETWEEN_LAYERS),i=t.getProperty(_.SPACING_EDGE_EDGE_BETWEEN_LAYERS),s=Math.min(1,i/r),a=t.getLayers(),l=0;if(a.length>0){let c=this._calculateWestInLayerEdgeYDiff(a[0]);l=np*s*c}for(let c=0;c<a.length;c++){let g=a[c],h=g.getNodes(),d=h.every(Ls);d&&l>0&&(l-=r),z.placeNodesHorizontally(g,l);let f=0;for(let P of h){let S=0;for(let N of P.getOutgoingEdges()){let I=N.getSource().getAbsoluteAnchor().y,C=N.getTarget().getAbsoluteAnchor().y;g===N.getTarget().getNode().getLayer()&&!N.isSelfLoop()&&(this._processInLayerEdge(N,l,np*s*Math.abs(I-C)),N.getSource().getSide()===u.WEST&&(I=0,C=0)),S=Math.max(S,Math.abs(C-I))}let T=P.getType();(T===y.NORMAL||T===y.LABEL||T===y.LONG_EDGE||T===y.NORTH_SOUTH_PORT||T===y.BREAKING_POINT)&&this._processNode(P,l,o),f=Math.max(f,S)}if(c+1<a.length){let P=this._calculateWestInLayerEdgeYDiff(a[c+1]);f=Math.max(f,P)}let E=np*s*f;!d&&c+1<a.length&&(E+=r),l+=g.getSize().x+E}this._createdJunctionPoints.clear(),t.getSize().x=l,e&&e.done&&e.done()}_processNode(t,e,o){let r=e+t.getLayer().getSize().x;for(let i of t.getPorts()){let s=i.getAbsoluteAnchor();if(t.getType()===y.NORTH_SOUTH_PORT){let g=i.getProperty(p.ORIGIN);g&&(s.x=g.getAbsoluteAnchor().x,t.getPosition().x=s.x)}let a=new O(0,s.y);if(i.getSide()===u.EAST)a.x=r;else if(i.getSide()===u.WEST)a.x=e;else continue;if(Math.abs(s.x-a.x)<=o&&!this._isInLayerDummy(t))continue;let c=i.getOutgoingEdges().length+i.getIncomingEdges().length>1;for(let g of i.getConnectedEdges()){let h=g.getSource()===i?g.getTarget():g.getSource();Math.abs(h.getAbsoluteAnchor().y-a.y)>OR&&this._addBendPoint(g,a,c,i)}}}_processInLayerEdge(t,e,o){let r=t.getSource(),i=t.getTarget(),s=(r.getAbsoluteAnchor().y+i.getAbsoluteAnchor().y)/2,a;r.getSide()===u.EAST?a=new O(e+r.getNode().getLayer().getSize().x+o,s):a=new O(e-o,s),t.getBendPoints().splice(0,0,a)}_calculateWestInLayerEdgeYDiff(t){let e=0;for(let o of t.getNodes())for(let r of o.getOutgoingEdges())if(t===r.getTarget().getNode().getLayer()&&r.getSource().getSide()===u.WEST){let i=r.getSource().getAbsoluteAnchor().y,s=r.getTarget().getAbsoluteAnchor().y;e=Math.max(e,Math.abs(s-i))}return e}_addBendPoint(t,e,o,r){if(t.isSelfLoop()||!t.isInLayerEdge()&&r.getAbsoluteAnchor().equals(e))return;let i=new O(e.x,e.y);if(t.getSource()===r?t.getBendPoints().splice(0,0,i):t.getBendPoints().push(i),o){let s=e.x+","+e.y;if(!this._createdJunctionPoints.has(s)){let a=t.getProperty(_.JUNCTION_POINTS);a==null&&(a=new st,t.setProperty(_.JUNCTION_POINTS,a));let l=new O(e.x,e.y);a.push(l),this._createdJunctionPoints.add(s)}}}_isInLayerDummy(t){if(t.getType()!==y.LONG_EDGE)return!1;for(let e of t.getConnectedEdges())if(e.isInLayerEdge())return!0;return!1}};var bs=class bs{constructor(){this._edgeRoutingStrategy=null}static factoryFor(t){let e=String(t);if(!bs._factoryCache.has(e)){let o=new bs;o._edgeRoutingStrategy=t,bs._factoryCache.set(e,o)}return bs._factoryCache.get(e)}create(){switch(this._edgeRoutingStrategy){case At.POLYLINE:return new Af;case At.SPLINES:return new vi;default:return new Vg}}};Z(bs,"_factoryCache",new Map);var Cf=bs;var mO=2,SR=()=>K.create().addBefore(D.P4_NODE_PLACEMENT,w.INNERMOST_NODE_MARGIN_CALCULATOR).addBefore(D.P4_NODE_PLACEMENT,w.LABEL_AND_NODE_SIZE_PROCESSOR).addBefore(D.P5_EDGE_ROUTING,w.LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR).addAfter(D.P5_EDGE_ROUTING,w.END_LABEL_SORTER),TR=()=>K.create().addBefore(D.P4_NODE_PLACEMENT,w.CENTER_LABEL_MANAGEMENT_PROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR),NR=()=>K.create().addAfter(D.P5_EDGE_ROUTING,w.HIERARCHICAL_NODE_RESIZER),xf=class n{constructor(){this._algorithmAssembler=Io.create(D.values())}prepareGraphForLayout(t){this._configureGraphProperties(t),this._algorithmAssembler.reset(),this._algorithmAssembler.setPhase(D.P1_CYCLE_BREAKING,t.getProperty(_.CYCLE_BREAKING_STRATEGY)),this._algorithmAssembler.setPhase(D.P2_LAYERING,t.getProperty(_.LAYERING_STRATEGY)),this._algorithmAssembler.setPhase(D.P3_NODE_ORDERING,t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY)),this._algorithmAssembler.setPhase(D.P4_NODE_PLACEMENT,t.getProperty(_.NODE_PLACEMENT_STRATEGY)),this._algorithmAssembler.setPhase(D.P5_EDGE_ROUTING,Cf.factoryFor(t.getProperty(_.EDGE_ROUTING))),this._algorithmAssembler.addProcessorConfiguration(this._getPhaseIndependentLayoutProcessorConfiguration(t)),t.setProperty(p.PROCESSORS,this._algorithmAssembler.build(t))}_configureGraphProperties(t){let e=t.getProperty(_.SPACING_EDGE_EDGE);e!=null&&e<mO&&t.setProperty(_.SPACING_EDGE_EDGE,mO),t.getProperty(_.DIRECTION)===R.UNDEFINED&&t.setProperty(_.DIRECTION,z.getDirection(t));let r=t.getProperty(_.RANDOM_SEED);t.setProperty(p.RANDOM,new dr(r)),t.getProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES)==null&&t.setProperty(_.NODE_PLACEMENT_FAVOR_STRAIGHT_EDGES,t.getProperty(_.EDGE_ROUTING)===At.ORTHOGONAL),this._copyPortConstraints(t),t.setProperty(p.SPACINGS,new oo(t))}_copyPortConstraints(t){for(let e of t.getLayerlessNodes())this._copyPortConstraintsForNode(e);for(let e of t.getLayers())for(let o of e.getNodes())this._copyPortConstraintsForNode(o)}_copyPortConstraintsForNode(t){let e=t.getProperty(_.PORT_CONSTRAINTS);t.setProperty(p.ORIGINAL_PORT_CONSTRAINTS,e);let o=t.getNestedGraph&&t.getNestedGraph();o!=null&&this._copyPortConstraints(o)}_getPhaseIndependentLayoutProcessorConfiguration(t){let e=t.getProperty(p.GRAPH_PROPERTIES),o=SR();switch(t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN&&o.addAll(NR()),t.getProperty(_.FEEDBACK_EDGES)?o.addBefore(D.P1_CYCLE_BREAKING,w.PORT_SIDE_PROCESSOR):o.addBefore(D.P3_NODE_ORDERING,w.PORT_SIDE_PROCESSOR),t.getProperty(Hn)!=null&&o.addAll(TR()),(t.getProperty(_.INTERACTIVE_LAYOUT)||t.getProperty(_.GENERATE_POSITION_AND_LAYER_IDS))&&o.addAfter(D.P5_EDGE_ROUTING,w.CONSTRAINTS_POSTPROCESSOR),t.getProperty(_.DIRECTION)){case R.LEFT:case R.DOWN:case R.UP:o.addBefore(D.P1_CYCLE_BREAKING,w.DIRECTION_PREPROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.DIRECTION_POSTPROCESSOR);break;default:break}e!=null&&e.has(v.COMMENTS)&&o.addBefore(D.P1_CYCLE_BREAKING,w.COMMENT_PREPROCESSOR).addBefore(D.P4_NODE_PLACEMENT,w.COMMENT_NODE_MARGIN_CALCULATOR).addAfter(D.P5_EDGE_ROUTING,w.COMMENT_POSTPROCESSOR),t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY)!==ut.NONE&&t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY)!=null&&o.addBefore(D.P3_NODE_ORDERING,w.NODE_PROMOTION),e!=null&&e.has(v.PARTITIONS)&&(o.addBefore(D.P1_CYCLE_BREAKING,w.PARTITION_PREPROCESSOR),o.addBefore(D.P2_LAYERING,w.PARTITION_MIDPROCESSOR),o.addBefore(D.P3_NODE_ORDERING,w.PARTITION_POSTPROCESSOR));let i=t.getProperty(_.COMPACTION_POST_COMPACTION_STRATEGY);if(i!=null&&i!==ie.NONE&&t.getProperty(_.EDGE_ROUTING)!==At.POLYLINE&&o.addAfter(D.P5_EDGE_ROUTING,w.HORIZONTAL_COMPACTOR),t.getProperty(_.HIGH_DEGREE_NODES_TREATMENT)&&o.addBefore(D.P3_NODE_ORDERING,w.HIGH_DEGREE_NODE_LAYER_PROCESSOR),t.getProperty(_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE)&&o.addBefore(D.P3_NODE_ORDERING,w.SEMI_INTERACTIVE_CROSSMIN_PROCESSOR),n.activateGreedySwitchFor(t)){let c=n._isHierarchicalLayout(t)?t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE):t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE),g=String(c)==="ONE_SIDED"?w.ONE_SIDED_GREEDY_SWITCH:w.TWO_SIDED_GREEDY_SWITCH;o.addBefore(D.P4_NODE_PLACEMENT,g)}t.getProperty(_.LAYER_UNZIPPING_STRATEGY)===Wr.ALTERNATING&&o.addBefore(D.P4_NODE_PLACEMENT,w.ALTERNATING_LAYER_UNZIPPER);let a=t.getProperty(_.WRAPPING_STRATEGY);return a===Fo.SINGLE_EDGE?o.addBefore(D.P4_NODE_PLACEMENT,w.SINGLE_EDGE_GRAPH_WRAPPER):a===Fo.MULTI_EDGE&&o.addBefore(D.P3_NODE_ORDERING,w.BREAKING_POINT_INSERTER).addBefore(D.P4_NODE_PLACEMENT,w.BREAKING_POINT_PROCESSOR).addAfter(D.P5_EDGE_ROUTING,w.BREAKING_POINT_REMOVER),t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==$t.NONE&&t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!=null&&o.addBefore(D.P3_NODE_ORDERING,w.SORT_BY_INPUT_ORDER_OF_MODEL),o}static activateGreedySwitchFor(t){if(n._isHierarchicalLayout(t)){let s=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE);return t.getParentNode()==null&&s!=null&&String(s)!=="OFF"}let e=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_TYPE),o=t.getProperty(_.CROSSING_MINIMIZATION_SEMI_INTERACTIVE)||t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY)===We.INTERACTIVE,r=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_ACTIVATION_THRESHOLD)||0,i=t.getLayerlessNodes().length;return!o&&e!=null&&String(e)!=="OFF"&&(r===0||r>i)}static _isHierarchicalLayout(t){return t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN}};var ap=Object.freeze({isInstance(n){return n!=null&&(n.constructor&&n.constructor.isHierarchyAware===!0||n.isHierarchyAware===!0)}});var Df=class{constructor(){this._graphConfigurator=new xf,this._componentsProcessor=new Rf}doLayout(t,e){let o=e!=null?e:new Ie;o.begin("Layered layout",1),this._graphConfigurator.prepareGraphForLayout(t);let r=this._componentsProcessor.split(t);for(let i of r)this._layout(i,o);this._componentsProcessor.combine(r,t),this._resizeGraph(t),o.done()}doCompoundLayout(t,e){let o=e!=null?e:new Ie;o.begin("Layered compound layout",2),new fl().process(t,o.subTask?o.subTask(1):new Ie),this._hierarchicalLayout(t,o.subTask?o.subTask(1):new Ie),new Lf().process(t,o.subTask?o.subTask(1):new Ie),o.done()}_hierarchicalLayout(t,e){let o=this._collectAllGraphsBottomUp(t);this._reviewAndCorrectHierarchicalProcessors(t,o);let r=[],i=0;for(let a of o){this._graphConfigurator.prepareGraphForLayout(a);let l=a.getProperty(p.PROCESSORS);i+=l.length,r.push({graph:a,processors:l,index:0})}e.begin("Recursive hierarchical layout",i);let s=r.find(a=>a.graph===t);for(;s.index<s.processors.length;)for(let a of r)for(;a.index<a.processors.length;){let l=a.processors[a.index];if(!ap.isInstance(l))l.process(a.graph,e.subTask?e.subTask(1):new Ie),a.index++;else if(a.graph===t){l.process(a.graph,e.subTask?e.subTask(1):new Ie),a.index++;for(let g of r)g!==a&&g.index<g.processors.length&&ap.isInstance(g.processors[g.index])&&g.index++;break}else break}for(let a of r){let l=a.graph;for(let c of l){for(let g of c.getNodes())l.getLayerlessNodes().push(g);c.getNodes().length=0}for(let c of l.getLayerlessNodes())c.setLayer(null);l.getLayers().length=0,this._resizeGraph(l)}e.done()}_reviewAndCorrectHierarchicalProcessors(t,e){let o=t.getProperty(_.CROSSING_MINIMIZATION_STRATEGY);for(let i of e){let s=i.getProperty(_.CROSSING_MINIMIZATION_STRATEGY);if(s!==o)throw new Bo("The hierarchy aware processor "+s+" in child node "+i+" is only allowed if the root node specifies the same hierarchical processor.")}let r=t.getProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE);for(let i of e)i.setProperty(_.CROSSING_MINIMIZATION_GREEDY_SWITCH_HIERARCHICAL_TYPE,r)}_collectAllGraphsBottomUp(t){let e=[t],o=[t];for(;o.length>0;){let r=o.shift();for(let i of r.getLayerlessNodes()){let s=i.getNestedGraph();s!=null&&(e.unshift(s),o.push(s))}}return e}_layout(t,e){let o=e.isRunning&&e.isRunning();o||e.begin("Component Layout",1);let r=t.getProperty(p.PROCESSORS);if(r==null)throw new Error("ElkLayered.doLayout: algorithm processor list is missing. Did GraphConfigurator.prepareGraphForLayout succeed?");let i=1/Math.max(1,r.length);for(let s of r){if(e.isCanceled&&e.isCanceled())return;s.process(t,e.subTask?e.subTask(i):new Ie)}for(let s of t){for(let a of s.getNodes())t.getLayerlessNodes().push(a);s.getNodes().length=0}for(let s of t.getLayerlessNodes())s.setLayer(null);t.getLayers().length=0,o||e.done()}_resizeGraph(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS),o=t.getProperty(_.NODE_SIZE_OPTIONS),r=t.getActualSize(),i=new O(r.x,r.y);if(e!=null&&e.has&&e.has(mt.MINIMUM_SIZE)){let s=new O(0,0),a=t.getProperty(_.NODE_SIZE_MINIMUM);a!=null&&(s.x=a.x||0,s.y=a.y||0),o!=null&&o.has&&o.has(Nt.DEFAULT_MINIMUM_SIZE)&&(s.x<=0&&(s.x=es),s.y<=0&&(s.y=os)),i.x=Math.max(r.x,s.x),i.y=Math.max(r.y,s.y)}t.getProperty(_.NODE_SIZE_FIXED_GRAPH_SIZE)||this._resizeGraphNoReallyIMeanIt(t,r,i)}_resizeGraphNoReallyIMeanIt(t,e,o){let r=t.getProperty(_.CONTENT_ALIGNMENT);o.x>e.x&&r!=null&&(r.has(he.H_CENTER)?t.getOffset().x+=(o.x-e.x)/2:r.has(he.H_RIGHT)&&(t.getOffset().x+=o.x-e.x)),o.y>e.y&&r!=null&&(r.has(he.V_CENTER)?t.getOffset().y+=(o.y-e.y)/2:r.has(he.V_BOTTOM)&&(t.getOffset().y+=o.y-e.y));let i=t.getProperty(p.GRAPH_PROPERTIES);if(i!=null&&i.has(v.EXTERNAL_PORTS)&&(o.x>e.x||o.y>e.y))for(let a of t.getLayerlessNodes()){if(a.getType()!==y.EXTERNAL_PORT)continue;let l=a.getProperty(p.EXT_PORT_SIDE);l===u.EAST?a.getPosition().x+=o.x-e.x:l===u.SOUTH&&(a.getPosition().y+=o.y-e.y)}let s=t.getPadding();t.getSize().x=o.x-s.left-s.right,t.getSize().y=o.y-s.top-s.bottom}};var wf=class{constructor(){this._nodeAndPortMap=new Map}importGraph(t){let e=this._createLGraph(t);for(let r of t.getPorts())this._ensureDefinedPortSide(e,r);let o=e.getProperty(p.GRAPH_PROPERTIES);if(this._checkExternalPorts(t,o),o.has(v.EXTERNAL_PORTS))for(let r of t.getPorts())this._transformExternalPort(t,e,r);return this._shouldCalculateMinimumGraphSize(t)&&this._calculateMinimumGraphSize(t,e),e.getProperty(_.PARTITIONING_ACTIVATE)&&o.add(v.PARTITIONS),t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN?this._importHierarchicalGraph(t,e):this._importFlatGraph(t,e),e}_ensureDefinedPortSide(t,e){let o=t.getProperty(_.DIRECTION),r=e.getProperty(_.PORT_SIDE);t.getProperty(_.PORT_CONSTRAINTS).isSideFixed()?(r==null||r===u.UNDEFINED)&&(r=u.fromDirection(o)):this._calculateNetFlow(e)>0?r=u.fromDirection(o):r=u.fromDirection(o).opposed(),e.setProperty(_.PORT_SIDE,r)}_shouldCalculateMinimumGraphSize(t){let e=t.getProperty(_.NODE_SIZE_CONSTRAINTS);return e!=null&&typeof e.size=="number"&&e.size>0}_calculateMinimumGraphSize(t,e){if(t.getParent()==null)return;let o=e.getProperty(_.NODE_SIZE_CONSTRAINTS);if(o==null||o.size===0)return;t.getProperty(_.PORT_CONSTRAINTS)===H.UNDEFINED&&t.setProperty(_.PORT_CONSTRAINTS,H.FREE);let r=yo.adapt(t.getParent()),i=yo.adaptSingleNode(t),s=us.process(r,i,!1,!0);o.add(mt.MINIMUM_SIZE);let a=e.getProperty(_.NODE_SIZE_MINIMUM)||new O;a.x=Math.max(s.x,a.x),a.y=Math.max(s.y,a.y),e.setProperty(_.NODE_SIZE_MINIMUM,a)}_importFlatGraph(t,e){let o=0,r=new Set;for(let i of t.getChildren())i.getProperty(_.NO_LAYOUT)||(this._needsModelOrder(i)&&(i.setProperty(p.MODEL_ORDER,o),o++,i.hasProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)&&r.add(i.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID))),this._transformNode(i,e));e.setProperty(p.MAX_MODEL_ORDER_NODES,o),e.setProperty(p.CB_NUM_MODEL_ORDER_GROUPS,r.size),o=0;for(let i of t.getContainedEdges()){this._needsModelOrderBasedOnParent(t)&&(i.setProperty(p.MODEL_ORDER,o),o++);let s=ks(i),a=Na(i);if(s==null||a==null)continue;let l=s.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),c=!i.getProperty(_.NO_LAYOUT),g=l&&i.isSelfloop()&&i.getProperty(_.INSIDE_SELF_LOOPS_YO),h=s.getParent()===t&&s.getParent()===a.getParent(),d=s.getParent()===t&&a===t,f=a.getParent()===t&&s===t;c&&!g&&(d!==f||h)&&this._transformEdge(i,t,e)}if(t.getParent()!=null)for(let i of t.getParent().getContainedEdges()){let s=ks(i);s===t&&i.isSelfloop()&&s.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE)&&i.getProperty(_.INSIDE_SELF_LOOPS_YO)&&this._transformEdge(i,t,e)}}_importHierarchicalGraph(t,e){let o=[],r=e.getProperty(_.DIRECTION),i=0,s=new Set;for(o.push(...t.getChildren());o.length>0;){let a=o.shift();if(this._needsModelOrder(a)&&(a.setProperty(p.MODEL_ORDER,i++),a.hasProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID)&&s.add(a.getProperty(_.CONSIDER_MODEL_ORDER_GROUP_MODEL_ORDER_CYCLE_BREAKING_ID))),a.getProperty(_.NO_LAYOUT))continue;let l=a.getChildren().length>0,c=this._hasInsideSelfLoops(a),g=a.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN,h=a.hasProperty(mi)?a.getProperty(mi):null,d=h==null||_.ALGORITHM_ID.endsWith(h),f=null;if(d&&g&&(l||c)&&(f=this._createLGraph(a),f.setProperty(_.DIRECTION,r),this._shouldCalculateMinimumGraphSize(a))){for(let T of a.getPorts())this._ensureDefinedPortSide(f,T);this._calculateMinimumGraphSize(a,f)}let E=e,P=this._nodeAndPortMap.get(a.getParent());P instanceof ft&&P.getNestedGraph()!=null&&(E=P.getNestedGraph());let S=this._transformNode(a,E);f!=null&&(S.setNestedGraph(f),f.setParentNode(S),o.push(...a.getChildren()))}for(e.setProperty(p.MAX_MODEL_ORDER_NODES,i),e.setProperty(p.CB_NUM_MODEL_ORDER_GROUPS,s.size),i=0,o.push(t);o.length>0;){let a=o.shift();for(let c of a.getContainedEdges()){this._checkEdgeValidity(c),this._needsModelOrderBasedOnParent(t)&&c.setProperty(p.MODEL_ORDER,i++);let g=Pt(c.getSources()[0]),h=Pt(c.getTargets()[0]);if(g==null||h==null||c.getProperty(_.NO_LAYOUT)||g.getProperty(_.NO_LAYOUT)||h.getProperty(_.NO_LAYOUT))continue;let d=c.isSelfloop()&&g.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE)&&c.getProperty(_.INSIDE_SELF_LOOPS_YO),f=a;d||mo(h,g)?f=g:mo(g,h)&&(f=h);let E=e,P=this._nodeAndPortMap.get(f);P instanceof ft&&P.getNestedGraph()!=null&&(E=P.getNestedGraph());let S=this._transformEdge(c,f,E);S!=null&&S.setProperty(p.COORDINATE_SYSTEM_ORIGIN,this._findCoordinateSystemOrigin(c,t,e))}if(a.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN)for(let c of a.getChildren()){let g=c.hasProperty(mi)?c.getProperty(mi):null,h=g==null||_.ALGORITHM_ID.endsWith(g),d=c.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN;h&&d&&o.push(c)}}}_needsModelOrder(t){let e=t.getParent();return this._needsModelOrderBasedOnParent(e)&&!t.getProperty(_.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER)}_needsModelOrderBasedOnParent(t){let e=t.getProperty(_.CYCLE_BREAKING_STRATEGY),o=e===Xt.MODEL_ORDER||e===Xt.BFS_NODE_ORDER||e===Xt.DFS_NODE_ORDER||e===Xt.GREEDY_MODEL_ORDER||e===Xt.SCC_CONNECTIVITY||e===Xt.SCC_NODE_TYPE,r=t.getProperty(_.LAYERING_STRATEGY),i=t.getProperty(_.LAYERING_NODE_PROMOTION_STRATEGY),s=r===le.BF_MODEL_ORDER||r===le.DF_MODEL_ORDER||i===ut.MODEL_ORDER_LEFT_TO_RIGHT||i===ut.MODEL_ORDER_RIGHT_TO_LEFT,a=t.getProperty(_.CONSIDER_MODEL_ORDER_STRATEGY)!==$t.NONE||t.getProperty(_.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)||t.getProperty(_.CONSIDER_MODEL_ORDER_COMPONENTS)!=="NONE"||t.getProperty(_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_NODE_INFLUENCE)!==0||t.getProperty(_.CONSIDER_MODEL_ORDER_CROSSING_COUNTER_PORT_INFLUENCE)!==0;return o||s||a}_hasInsideSelfLoops(t){if(!t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))return!1;for(let e of t.getPorts())for(let o of e.getOutgoingEdges())if(o.isSelfloop()&&o.getProperty(_.INSIDE_SELF_LOOPS_YO))return!0;return!1}_findCoordinateSystemOrigin(t,e,o){let r=Pt(t.getSources()[0]),i=Pt(t.getTargets()[0]);if(r==null||i==null||r.getParent()===i.getParent()||mo(i,r))return null;let s=t.getContainingNode();if(s===e)return o;let a=this._nodeAndPortMap.get(s);if(a instanceof ft){let l=a.getNestedGraph();if(l!=null)return l}return null}_createLGraph(t){let e=new Nn;e.copyProperties(t),e.getProperty(_.DIRECTION)===R.UNDEFINED&&e.setProperty(_.DIRECTION,z.getDirection(e)),e.setProperty(p.ORIGIN,t),e.setProperty(p.GRAPH_PROPERTIES,new Set);let o=t.getParent()==null?null:yo.adapt(t.getParent()),r=yo.adaptSingleNode(t),i=us.computeInsideNodeLabelPadding(o,r,R.RIGHT),s=e.getProperty(_.PADDING),a=e.getPadding();return s!=null&&(a.top+=s.top||0,a.bottom+=s.bottom||0,a.left+=s.left||0,a.right+=s.right||0),i!=null&&(a.top+=i.top||0,a.bottom+=i.bottom||0,a.left+=i.left||0,a.right+=i.right||0),e}_checkExternalPorts(t,e){let o=t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=t.getProperty(_.PORT_LABELS_PLACEMENT),i=!1,s=!1;for(let a of t.getPorts()){if(i&&s)break;let l=0;for(let c of Ta(a)){let g=o&&c.isSelfloop()&&c.getProperty(_.INSIDE_SELF_LOOPS_YO),d=c.getSources().includes(a)?Pt(c.getTargets()[0]):Pt(c.getSources()[0]),f=d!=null&&d.getParent()===t;if((g||f)&&(l++,l>1))break}(l>0||r!=null&&r.has&&r.has(it.INSIDE)&&a.getLabels().length>0)&&(i=!0),l>1&&(s=!0)}i&&e.add(v.EXTERNAL_PORTS),s&&e.add(v.HYPEREDGES)}_transformExternalPort(t,e,o){let r=new O(o.getX()+o.getWidth()/2,o.getY()+o.getHeight()/2),i=this._calculateNetFlow(o),s=t.getProperty(_.PORT_CONSTRAINTS),a=o.getProperty(_.PORT_SIDE);if(!o.getAllProperties().has(_.PORT_BORDER_OFFSET)){let f;o.getX()===0&&o.getY()===0?f=0:f=eu!=null?eu(o,a):0,o.setProperty(_.PORT_BORDER_OFFSET,f)}let l=new O(t.getWidth(),t.getHeight()),c=z.createExternalPortDummy(o,s,a,i,l,r,new O(o.getWidth(),o.getHeight()),e.getProperty(_.DIRECTION),e);c.setProperty(p.ORIGIN,o);let g=c.getPorts()[0];g.setConnectedToExternalNodes(this._isConnectedToExternalNodes(o)),c.setProperty(_.PORT_LABELS_PLACEMENT,it.outside());let h=t.getProperty(_.PORT_LABELS_PLACEMENT)!=null&&t.getProperty(_.PORT_LABELS_PLACEMENT).has&&t.getProperty(_.PORT_LABELS_PLACEMENT).has(it.INSIDE);for(let f of o.getLabels())if(!f.getProperty(_.NO_LAYOUT)&&f.getText()!=null&&f.getText().length>0){let E=this._transformLabel(f);if(g.getLabels().push(E),!h)switch(a){case u.EAST:case u.WEST:E.getSize().x=0;break;case u.NORTH:case u.SOUTH:E.getSize().y=0;break;default:break}}let d=t.getParent();d!=null&&(c.setProperty(_.SPACING_LABEL_PORT_HORIZONTAL,d.getProperty(_.SPACING_LABEL_PORT_HORIZONTAL)),c.setProperty(_.SPACING_LABEL_PORT_VERTICAL,d.getProperty(_.SPACING_LABEL_PORT_VERTICAL)),c.setProperty(_.SPACING_LABEL_LABEL,d.getProperty(_.SPACING_LABEL_LABEL))),e.getLayerlessNodes().push(c),this._nodeAndPortMap.set(o,c)}_calculateNetFlow(t){let e=t.getParent(),o=e.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE),r=0,i=0;for(let s of t.getOutgoingEdges()){let a=s.isSelfloop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=Pt(s.getTargets()[0]);a&&l?i++:a&&!l?r++:c!=null&&(c.getParent()===e||c===e)?i++:r++}for(let s of t.getIncomingEdges()){let a=s.isSelfloop(),l=a&&o&&s.getProperty(_.INSIDE_SELF_LOOPS_YO),c=Pt(s.getSources()[0]);a&&l?r++:a&&!l?i++:c!=null&&(c.getParent()===e||c===e)?r++:i++}return r-i}_isConnectedToExternalNodes(t){let e=t.getParent();for(let o of t.getOutgoingEdges()){let r=Pt(o.getTargets()[0]);if(r!=null&&!mo(r,e))return!0}for(let o of t.getIncomingEdges()){let r=Pt(o.getSources()[0]);if(r!=null&&!mo(r,e))return!0}return!1}_transformNode(t,e){let o=new ft(e);o.copyProperties(t),o.setProperty(p.ORIGIN,t),o.getSize().x=t.getWidth(),o.getSize().y=t.getHeight(),o.getPosition().x=t.getX(),o.getPosition().y=t.getY(),e.getLayerlessNodes().push(o),this._nodeAndPortMap.set(t,o),(t.getChildren().length>0||t.getProperty(_.INSIDE_SELF_LOOPS_ACTIVATE))&&o.setProperty(p.COMPOUND_NODE,!0);let r=e.getProperty(p.GRAPH_PROPERTIES),i=o.getProperty(_.PORT_CONSTRAINTS);i===H.UNDEFINED?(o.setProperty(_.PORT_CONSTRAINTS,H.FREE),i=H.FREE):i!==H.FREE&&r.add(v.NON_FREE_PORTS);let s=0,a=e.getProperty(_.DIRECTION);for(let l of t.getPorts())this._needsModelOrder(t)&&l.setProperty(p.MODEL_ORDER,s++),l.getProperty(_.NO_LAYOUT)||this._transformPort(l,o,r,a,i);for(let l of t.getLabels())!l.getProperty(_.NO_LAYOUT)&&l.getText()!=null&&l.getText().length>0&&o.getLabels().push(this._transformLabel(l));return o.getProperty(_.COMMENT_BOX)&&r.add(v.COMMENTS),o.getProperty(_.HYPERNODE)&&(r.add(v.HYPERNODES),r.add(v.HYPEREDGES),o.setProperty(_.PORT_CONSTRAINTS,H.FREE)),o}_transformPort(t,e,o,r,i){let s=new rt;s.copyProperties(t),s.setSide(t.getProperty(_.PORT_SIDE)||u.UNDEFINED),s.setProperty(p.ORIGIN,t),s.setNode(e),s.getSize().x=t.getWidth(),s.getSize().y=t.getHeight(),s.getPosition().x=t.getX(),s.getPosition().y=t.getY(),this._nodeAndPortMap.set(t,s);let a=!1;for(let l of t.getOutgoingEdges()){for(let c of l.getTargets()){let g=Pt(c);if(g!=null&&mo(g,t.getParent())){a=!0;break}}if(a)break}if(!a)for(let l of t.getIncomingEdges()){for(let c of l.getSources()){let g=Pt(c);if(g!=null&&mo(g,t.getParent())){a=!0;break}}if(a)break}if(!a){for(let l of t.getOutgoingEdges())if(l.isSelfloop()&&l.getProperty(_.INSIDE_SELF_LOOPS_YO)){a=!0;break}}s.setProperty(p.INSIDE_CONNECTIONS,a),z.initializePort(s,i,r,t.getProperty(_.PORT_ANCHOR));for(let l of t.getLabels())!l.getProperty(_.NO_LAYOUT)&&l.getText()!=null&&l.getText().length>0&&s.getLabels().push(this._transformLabel(l));return r===R.LEFT||r===R.RIGHT?(s.getSide()===u.NORTH||s.getSide()===u.SOUTH)&&o.add(v.NORTH_SOUTH_PORTS):(r===R.UP||r===R.DOWN)&&(s.getSide()===u.EAST||s.getSide()===u.WEST)&&o.add(v.NORTH_SOUTH_PORTS),s}_transformEdge(t,e,o){this._checkEdgeValidity(t);let r=t.getSources()[0],i=t.getTargets()[0],s=Pt(r),a=Pt(i),l=t.getSections().length>0?t.getSections()[0]:null,c=this._nodeAndPortMap.get(s),g=this._nodeAndPortMap.get(a),h=null,d=null;if(r instanceof Ve){let N=this._nodeAndPortMap.get(r);N instanceof rt?h=N:N instanceof ft&&(c=N,h=c.getPorts()[0])}if(i instanceof Ve){let N=this._nodeAndPortMap.get(i);N instanceof rt?d=N:N instanceof ft&&(g=N,d=g.getPorts()[0])}if(!(c instanceof ft)||!(g instanceof ft))throw new Bo("The source or target of an edge could not be found. This usually happens when an edge connects nodes laid out by different algorithms. Try setting hierarchyHandling to INCLUDE_CHILDREN.");let f=new _e;f.copyProperties(t),f.setProperty(p.ORIGIN,t),f.setProperty(_.JUNCTION_POINTS,null);let E=o.getProperty(p.GRAPH_PROPERTIES);if(c===g&&E.add(v.SELF_LOOPS),h==null){let N=W.OUTPUT,I=null;l!=null&&c.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(I=new O(l.getStartX(),l.getStartY()),su(I,t.getContainingNode()),nu(I,e),mo(a,s)&&(N=W.INPUT,I.x+=c.getPosition().x,I.y+=c.getPosition().y)),h=z.createPort(c,I,N,o)}if(d==null){let N=W.INPUT,I=null;l!=null&&g.getProperty(_.PORT_CONSTRAINTS).isSideFixed()&&(I=new O(l.getEndX(),l.getEndY()),su(I,t.getContainingNode()),nu(I,e)),d=z.createPort(g,I,N,g.getGraph())}f.setSource(h),f.setTarget(d),(h.getIncomingEdges().length>1||h.getOutgoingEdges().length>1||d.getIncomingEdges().length>1||d.getOutgoingEdges().length>1)&&E.add(v.HYPEREDGES);for(let N of t.getLabels())if(!N.getProperty(_.NO_LAYOUT)&&N.getText()!=null&&N.getText().length>0){let I=this._transformLabel(N);f.getLabels().push(I);let C=I.getProperty(_.EDGE_LABELS_PLACEMENT);C===St.HEAD||C===St.TAIL?E.add(v.END_LABELS):C===St.CENTER&&(E.add(v.CENTER_LABELS),I.setProperty(_.EDGE_LABELS_PLACEMENT,St.CENTER))}let P=o.getProperty(_.CROSSING_MINIMIZATION_STRATEGY),S=o.getProperty(_.NODE_PLACEMENT_STRATEGY),T=P===We.INTERACTIVE||S===ze.INTERACTIVE;if(l!=null&&l.getBendPoints().length>0&&T){let N=new st;for(let I of l.getBendPoints())N.add(new O(I.x,I.y));f.setProperty(p.ORIGINAL_BENDPOINTS,N)}return f}_checkEdgeValidity(t){if(t.getSources().length===0)throw new Bo("Edges must have a source.");if(t.getTargets().length===0)throw new Bo("Edges must have a target.");if(t.isHyperedge())throw new Bo("Hyperedges are not supported.")}_transformLabel(t){let e=new ua(t.getText());return e.copyProperties(t),e.setProperty(p.ORIGIN,t),e.getSize().x=t.getWidth(),e.getSize().y=t.getHeight(),e.getPosition().x=t.getX(),e.getPosition().y=t.getY(),e}};var Mf=class n{applyLayout(t){let e=t.getProperty(p.ORIGIN);if(!(e instanceof Or))return;let o=e,r=t.getParentNode(),i=new O(t.getOffset().x,t.getOffset().y),s=t.getPadding();i.x+=s.left,i.y+=s.top;let a=o.getProperty(_.NODE_SIZE_OPTIONS);if(a!=null&&a.has&&a.has(Nt.COMPUTE_PADDING)){let g=o.getProperty(_.PADDING);g!=null&&(g.bottom=s.bottom,g.top=s.top,g.left=s.left,g.right=s.right)}let l=[];for(let g of t.getLayerlessNodes()){if(n._representsNode(g))this._applyNodeLayout(g,i);else if(n._representsExternalPort(g)&&r==null){let h=g.getProperty(p.ORIGIN),d=z.getExternalPortPosition(t,g,h.getWidth(),h.getHeight());h.setLocation(d.x,d.y)}for(let h of g.getPorts())for(let d of h.getOutgoingEdges())z.isDescendant(d.getTarget().getNode(),g)||l.push(d)}if(r!=null)for(let g of r.getPorts())for(let h of g.getOutgoingEdges())z.isDescendant(h.getTarget().getNode(),r)&&l.push(h);let c=o.getProperty(_.EDGE_ROUTING);for(let g of l)this._applyEdgeLayout(g,c,i,s);this._applyParentNodeLayout(t);for(let g of t.getLayerlessNodes()){let h=g.getNestedGraph();h!=null&&this.applyLayout(h)}}_applyNodeLayout(t,e){let o=t.getProperty(p.ORIGIN),r=t.getProperty(_.CROSSING_MINIMIZATION_POSITION_ID),i=t.getProperty(_.LAYERING_LAYER_ID);o.setProperty(_.CROSSING_MINIMIZATION_POSITION_ID,r),o.setProperty(_.LAYERING_LAYER_ID,i),o.setX(t.getPosition().x+e.x),o.setY(t.getPosition().y+e.y);let s=o.getProperty(_.NODE_SIZE_CONSTRAINTS);(s!=null&&s.size>0||t.getNestedGraph()!=null)&&(o.setWidth(t.getSize().x),o.setHeight(t.getSize().y));for(let h of t.getPorts()){let d=h.getProperty(p.ORIGIN);d instanceof Ve&&(d.setLocation(h.getPosition().x,h.getPosition().y),d.setProperty(_.PORT_SIDE,h.getSide()))}let l=t.getProperty(_.NODE_LABELS_PLACEMENT),c=l!=null&&l.size>0;for(let h of t.getLabels()){let d=h.getProperty(_.NODE_LABELS_PLACEMENT),f=d!=null&&d.size>0;if(c||f){let E=h.getProperty(p.ORIGIN);E!=null&&(E.setDimensions(h.getSize().x,h.getSize().y),E.setLocation(h.getPosition().x,h.getPosition().y))}}let g=t.getProperty(_.PORT_LABELS_PLACEMENT);if(g!=null&&!it.isFixed(g))for(let h of t.getPorts())for(let d of h.getLabels()){let f=d.getProperty(p.ORIGIN);f!=null&&(f.setWidth(d.getSize().x),f.setHeight(d.getSize().y),f.setLocation(d.getPosition().x,d.getPosition().y))}}_applyEdgeLayout(t,e,o,r){let i=t.getProperty(p.ORIGIN);if(i==null)return;let s=t.getBendPoints(),a=new O(o.x,o.y),l=this._calculateHierarchicalOffset(t);a.x+=l.x,a.y+=l.y;let c;if(z.isDescendant(t.getTarget().getNode(),t.getSource().getNode())){let P=t.getSource();c=new O(P.getPosition().x+P.getAnchor().x,P.getPosition().y+P.getAnchor().y),c.x-=o.x,c.y-=o.y}else{let P=t.getSource().getAbsoluteAnchor();c=new O(P.x,P.y)}s.addFirst(c);let g=t.getTarget().getAbsoluteAnchor(),h=new O(g.x,g.y),d=t.getProperty(p.TARGET_OFFSET);d!=null&&(h.x+=d.x,h.y+=d.y),s.addLast(h);for(let P of s)P.x+=a.x,P.y+=a.y;let f=ar(i,!0,!0);f.setIncomingShape(i.getSources()[0]),f.setOutgoingShape(i.getTargets()[0]),Xs(s,f);for(let P of t.getLabels()){let S=P.getProperty(p.ORIGIN);S!=null&&(S.setWidth(P.getSize().x),S.setHeight(P.getSize().y),S.setLocation(P.getPosition().x+a.x,P.getPosition().y+a.y))}let E=t.getProperty(_.JUNCTION_POINTS);if(E!=null){for(let P of E)P.x+=a.x,P.y+=a.y;i.setProperty(_.JUNCTION_POINTS,E)}else i.setProperty(_.JUNCTION_POINTS,null);e===At.SPLINES?i.setProperty(_.EDGE_ROUTING,At.SPLINES):i.setProperty(_.EDGE_ROUTING,null)}_calculateHierarchicalOffset(t){let e=t.getProperty(p.COORDINATE_SYSTEM_ORIGIN);if(e==null)return new O;let o=new O,r=t.getSource().getNode().getGraph();for(;r!==e;){let i=r.getParentNode();if(i==null)break;r=i.getGraph(),o.x+=i.getPosition().x,o.y+=i.getPosition().y,o.x+=r.getOffset().x,o.y+=r.getOffset().y,o.x+=r.getPadding().left,o.y+=r.getPadding().top}return o}_applyParentNodeLayout(t){let e=t.getProperty(p.ORIGIN),o=e.getProperty(_.NODE_SIZE_CONSTRAINTS),r=o!=null&&o.has&&o.has(mt.PORT_LABELS);if(t.getParentNode()==null){let i=t.getProperty(p.GRAPH_PROPERTIES),s=t.getActualSize();i!=null&&i.has(v.EXTERNAL_PORTS)?(e.setProperty(_.PORT_CONSTRAINTS,H.FIXED_POS),Ae(e,s.x,s.y,!1,!0)):e.getProperty(_.NODE_SIZE_FIXED_GRAPH_SIZE)||Ae(e,s.x,s.y,!0,!0)}r?e.setProperty(_.NODE_SIZE_CONSTRAINTS,new Set([mt.PORT_LABELS])):e.setProperty(_.NODE_SIZE_CONSTRAINTS,mt.fixed())}static _representsNode(t){return t.getProperty(p.ORIGIN)instanceof Or}static _representsExternalPort(t){return t.getProperty(p.ORIGIN)instanceof Ve}};var bf=class n{importGraph(t){return new wf().importGraph(t)}applyLayout(t){new Mf().applyLayout(t)}static getOriginIdentifier(t){let e=t.getProperty(p.ORIGIN);return e!=null&&typeof e.getIdentifier=="function"?n._getIdentifier(e):null}static _getIdentifier(t){let e=t.getIdentifier!=null?t.getIdentifier():null;if(e!=null&&e.length>0){let o=typeof t.getParent=="function"?t.getParent():null;if(o!=null&&typeof o.getIdentifier=="function"){let r=n._getIdentifier(o);if(r!=null)return r+"."+e}return e}return null}};var Gf=class extends de{constructor(){super(),this.elkLayered=new Df}layout(t,e){let o=new bf,r=o.importGraph(t);t.getProperty(_.HIERARCHY_HANDLING)===Oe.INCLUDE_CHILDREN?this.elkLayered.doCompoundLayout(r,e):this.elkLayered.doLayout(r,e),(!e||!e.isCanceled||!e.isCanceled())&&o.applyLayout(r)}getLayoutAlgorithm(){return this.elkLayered}};var PO="org.eclipse.elk.layered",OO=!1;function SO(){let n=Ht.getInstance(),t=n.getAlgorithmData(PO);if(t)return OO=!0,t;let e=new Se.Builder().id(PO).name("ELK Layered").description("Layer-based algorithm with a hand-ported JS implementation.").category("org.eclipse.elk.layered").definingBundleId("org.eclipse.elk.alg.layered").providerFactory(()=>new Gf).supportedFeatures(new Set(["SELF_LOOPS","INSIDE_SELF_LOOPS","MULTI_EDGES","EDGE_LABELS","PORTS","COMPOUND","CLUSTERS"])).create();return n.registerLayoutMetaDataProviders({apply(o){o.register(e)}}),OO=!0,e}var ce=class ce{constructor(t,e=""){this.name=t,this.description=e,Object.freeze(this)}getDescription(){return this.description}toString(){return this.name}static values(){return[ce.SELF_LOOPS,ce.INSIDE_SELF_LOOPS,ce.MULTI_EDGES,ce.EDGE_LABELS,ce.PORTS,ce.COMPOUND,ce.CLUSTERS,ce.DISCONNECTED]}static valueOf(t){return ce[t]||null}};Z(ce,"SELF_LOOPS",new ce("SELF_LOOPS","Edges connecting a node with itself.")),Z(ce,"INSIDE_SELF_LOOPS",new ce("INSIDE_SELF_LOOPS","Self-loops routed through a node instead of around it.")),Z(ce,"MULTI_EDGES",new ce("MULTI_EDGES","Multiple edges with the same source and target node.")),Z(ce,"EDGE_LABELS",new ce("EDGE_LABELS","Labels that are associated with edges.")),Z(ce,"PORTS",new ce("PORTS","Edges are connected to nodes over ports.")),Z(ce,"COMPOUND",new ce("COMPOUND","Edges that connect nodes from different hierarchy levels and are incident to compound nodes.")),Z(ce,"CLUSTERS",new ce("CLUSTERS","Edges that connect nodes from different clusters, but not the cluster parent nodes.")),Z(ce,"DISCONNECTED",new ce("DISCONNECTED","Multiple connected components."));var lp=ce;function Rt(n,t,e,o){this.graph=n,this.model=n.getModel(),this.elkToCellMap=t,this.portCells=e||new Set,this.options=o||{},this._styles=this.options.styleBatch||new Zi(n),this._anchorCache={}}function Zi(n){this.graph=n,this.model=n.getModel(),this._pending=new Map}function yR(n,t,e){if(typeof mxUtils!="undefined"&&mxUtils!=null&&typeof mxUtils.setStyle=="function")return mxUtils.setStyle(n,t,e);var o=e!=null&&(typeof e.length=="undefined"||e.length>0);if(n!=null&&typeof n!="string"&&(n=""+n),n==null||n.length==0)o&&(n=t+"="+e+";");else if(n.substring(0,t.length+1)==t+"="){var r=n.indexOf(";");o?n=t+"="+e+(r<0?";":n.substring(r)):n=r<0||r==n.length-1?"":n.substring(r+1)}else{var i=n.indexOf(";"+t+"=");if(i<0){if(o){var s=n.charAt(n.length-1)==";"?"":";";n=n+s+t+"="+e+";"}}else{var a=n.indexOf(";",i+1);o?n=n.substring(0,i+1)+t+"="+e+(a<0?";":n.substring(a)):n=n.substring(0,i)+(a<0?";":n.substring(a))}}return n}Zi.prototype._read=function(n){var t=typeof this.model.getStyle=="function"?this.model.getStyle(n):n.style;return t!=null?t:""};Zi.prototype.get=function(n){return this._pending.has(n)?this._pending.get(n):this._read(n)};Zi.prototype.set=function(n,t,e){var o=yR(this.get(n),t,e);this._pending.set(n,o!=null?o:"")};Zi.prototype.flush=function(){var n=this;this._pending.forEach(function(t,e){n._read(e)!==t&&(typeof n.model.setStyle=="function"?n.model.setStyle(e,t):e.style=t)}),this._pending.clear()};function Dt(n){return Math.round(n*100)/100}function Hf(n){return n>0?n<1?n:1:0}function IR(n,t){var e=n!=null?n.length:0,o=t!=null?t.length:0;if(e!==o)return!1;for(var r=0;r<e;r++)if(n[r].x!==t[r].x||n[r].y!==t[r].y)return!1;return!0}function RR(n,t){return n==null&&t==null?!0:n!=null&&t!=null&&n.x===t.x&&n.y===t.y}function LR(n,t){return n.x===t.x&&n.y===t.y&&!n.relative==!t.relative&&IR(n.points,t.points)&&RR(n.offset,t.offset)}Rt.prototype.apply=function(n,t,e){this._applyNodes(n,t||0,e||0),this.options.portSpread&&this._spreadPorts(n),this._applyEdges(n,t||0,e||0),this._styles.flush()};Rt.prototype._spreadPorts=function(n){var t=1.3,e=.05,o=.5,r={};function i(A,B,Y){var j=B+(A.x||0),X=Y+(A.y||0);if(A.id!=null&&(r[A.id]={x:j,y:X,width:A.width||0,height:A.height||0}),A.children)for(var tt=0;tt<A.children.length;tt++)i(A.children[tt],j,X)}i(n,0,0);function s(A,B,Y){return Math.abs(B-Y.y)<o?"N":Math.abs(B-(Y.y+Y.height))<o?"S":Math.abs(A-Y.x)<o?"W":Math.abs(A-(Y.x+Y.width))<o?"E":null}var a={};function l(A,B,Y,j){var X=r[A];if(X!=null){var tt=s(Y+B.x,j+B.y,X);if(tt!=null){var ot=A+"|"+tt;(a[ot]=a[ot]||[]).push({box:X,side:tt,point:B,ox:Y,oy:j})}}}function c(A,B,Y){var j=B+(A.x||0),X=Y+(A.y||0);if(A.edges)for(var tt=0;tt<A.edges.length;tt++){var ot=A.edges[tt];if(!(!ot.sections||ot.sections.length===0)){var Lt=ot.sections[0];Lt.startPoint&&ot.sources&&ot.sources[0]!=null&&l(ot.sources[0],Lt.startPoint,j,X),Lt.endPoint&&ot.targets&&ot.targets[0]!=null&&l(ot.targets[0],Lt.endPoint,j,X)}}if(A.children)for(var tt=0;tt<A.children.length;tt++)c(A.children[tt],j,X)}c(n,0,0);for(var g in a){var h=a[g];if(!(h.length<2)){var d=h[0].box,f=h[0].side,E=f==="N"||f==="S",P=E?d.width:d.height;if(P>0)for(var S=E?d.x:d.y,T=0;T<h.length;T++){var N=h[T],I=E?N.ox+N.point.x:N.oy+N.point.y,C=(I-S)/P,x=.5+(C-.5)*t;x<e?x=e:x>1-e&&(x=1-e);var M=S+x*P;E?N.point.x=M-N.ox:N.point.y=M-N.oy}}}};Rt.prototype._applyNodes=function(n,t,e){if(n.children)for(var o=0;o<n.children.length;o++){var r=n.children[o],i=this.elkToCellMap[r.id];if(i!=null){var s=this.model.getGeometry(i);if(s!=null){var a=this._isTransparentBounds(i);if(a){if((r.children==null||r.children.length===0)&&r.x!=null&&r.y!=null){var g=r.x+t,h=r.y+e,d=fi(this.graph,i);d!=null&&pa(this.model,i,Dt(g-(s.x+d.x)),Dt(h-(s.y+d.y)))}}else{var l=s;if(s=s.clone(),s.x=Dt(r.x+t),s.y=Dt(r.y+e),r.width!=null&&r.height!=null&&(this.options.resizeParent||r.children!=null&&r.children.length>0)){s.width=Dt(r.width),s.height=Dt(r.height);var c=AR(this.graph,i);c!=null&&(s.width=Math.max(s.width,Dt(c.width)),s.height=Math.max(s.height,Dt(c.height)))}(s.x!==l.x||s.y!==l.y||s.width!==l.width||s.height!==l.height)&&this.model.setGeometry(i,s)}var f=a?Dt(r.x+t):0,E=a?Dt(r.y+e):0;r.children&&r.children.length>0&&this._applyNodes(r,f,E),r.edges&&this._applyEdges(r,f,E)}}}};Rt.prototype._applyEdges=function(n,t,e){if(n.edges)for(var o=0;o<n.edges.length;o++){var r=n.edges[o],i=this.elkToCellMap[r.id];if(i!=null){var s=this.model.getGeometry(i);if(s!=null){var a=s.clone(),l=null;if(r.sections){l=[];for(var c=0;c<r.sections.length;c++){var g=r.sections[c];if(g.startPoint&&l.push(new mxPoint(Dt(g.startPoint.x+t),Dt(g.startPoint.y+e))),g.bendPoints)for(var h=0;h<g.bendPoints.length;h++){var d=g.bendPoints[h];l.push(new mxPoint(Dt(d.x+t),Dt(d.y+e)))}g.endPoint&&l.push(new mxPoint(Dt(g.endPoint.x+t),Dt(g.endPoint.y+e)))}}var f=this.options.reversedEdges!=null&&this.options.reversedEdges.has(r.id);f&&l!=null&&l.reverse();var E=this.options.jettyEnds!=null?this.options.jettyEnds[r.id]:null;if(E!=null&&l!=null&&l.length>=2&&(E.source===!0&&this._appendAnchorPoint(i,i.source,l,!0),E.target===!0&&this._appendAnchorPoint(i,i.target,l,!1)),this.options.applyEdgeRouting&&l){var P=l.slice(1,l.length-1);a.points=P.length>0?P:null}else this.options.resetEdgePoints&&(a.points=null);var S=this.options.anchoredEnds!=null?this.options.anchoredEnds[r.id]:null,T=S!=null&&S.source===!0,N=S!=null&&S.target===!0;l&&l.length>=2&&this.options.applyEdgeRouting&&this.options.orthogonalRouting&&(T||(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),N||(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null)));var I=this.options.edgeStyleMode,C=this.options.climbedEnds!=null?this.options.climbedEnds[r.id]:null,x=this.options.maskedEnds!=null?this.options.maskedEnds[r.id]:null,M=C!=null&&C.source===!0,A=C!=null&&C.target===!0,B=x!=null&&x.source===!0,Y=x!=null&&x.target===!0,j=!1,X=!1;l&&l.length>=2&&this.options.applyEdgeRouting&&(j=!T&&!M&&this._snapEndpointToAnchor(i,i.source,l,!0),X=!N&&!A&&this._snapEndpointToAnchor(i,i.target,l,!1));var tt=M||T||B&&!j,ot=A||N||Y&&!X;tt&&!T&&this.options.applyEdgeRouting&&(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),ot&&!N&&this.options.applyEdgeRouting&&(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null));var Lt=a.points!=null&&a.points.length>=1,zt=l!=null?l[0]:null,be=l!=null?l[l.length-1]:null,mr=zt!=null&&be!=null&&(Math.abs(zt.x-be.x)>.5||Math.abs(zt.y-be.y)>.5),Ea=l&&l.length>=2&&this.options.applyEdgeRouting&&this.options.orthogonalRouting&&i.source!=null&&i.target!=null,Pr=!1;if(Ea&&I==="orthogonalEdgeStyle")if(this._isOrthogonalChain(l)&&(Lt||mr)){var ma=!tt&&!j&&this._terminalDiagonal(i,i.source,l,!0),Pa=!ot&&!X&&this._terminalDiagonal(i,i.target,l,!1);Lt?(!ma&&!tt&&this._alignEndpointSegment(a,l,!0),!Pa&&!ot&&this._alignEndpointSegment(a,l,!1)):this._synthesizeZ(a,l),tt||this._strictPinTerminal(i,i.source,l,!0,ma,j),ot||this._strictPinTerminal(i,i.target,l,!1,Pa,X),Pr=!0}else tt||this._applyEndpointConstraint(i,i.source,l,!0,j),ot||this._applyEndpointConstraint(i,i.target,l,!1,X),this._styles.set(i,mxConstants.STYLE_EDGE,null),this._styles.set(i,mxConstants.STYLE_NOEDGESTYLE,"1");else if(Ea&&(I==="elkCompat"||I==="orthogonal")){var Gs=tt?null:this._applyEndpointConstraint(i,i.source,l,!0,j),Hs=ot?null:this._applyEndpointConstraint(i,i.target,l,!1,X),ma=!tt&&!j&&this._terminalDiagonal(i,i.source,l,!0),Pa=!ot&&!X&&this._terminalDiagonal(i,i.target,l,!1),hp=ma||Pa,IO=!hp&&(Lt||mr&&(Math.abs(zt.x-be.x)<=.5||Math.abs(zt.y-be.y)<=.5));if(IO)Gs!=null&&(this._styles.set(i,mxConstants.STYLE_EXIT_X,null),this._styles.set(i,mxConstants.STYLE_EXIT_Y,null)),Hs!=null&&(this._styles.set(i,mxConstants.STYLE_ENTRY_X,null),this._styles.set(i,mxConstants.STYLE_ENTRY_Y,null)),Lt||(a.points=[new mxPoint(Dt((zt.x+be.x)/2),Dt((zt.y+be.y)/2))]),Pr=!0;else if(hp){if(ma)this._pinPerpendicularPerimeter(i,i.source,l,!0),this._anchorDiagonalBody(a,l,!0);else if(Gs!=null&&I==="orthogonal"){var dp=a.points!=null?a.points.slice():[];dp.unshift(Gs),a.points=dp}if(Pa)this._pinPerpendicularPerimeter(i,i.target,l,!1),this._anchorDiagonalBody(a,l,!1);else if(Hs!=null&&I==="orthogonal"){var fp=a.points!=null?a.points.slice():[];fp.push(Hs),a.points=fp}}else if(I==="orthogonal"&&(Gs!=null||Hs!=null)){var pl=a.points!=null?a.points.slice():[];Gs!=null&&pl.unshift(Gs),Hs!=null&&pl.push(Hs),a.points=pl.length>0?pl:null}}else if(l&&l.length>=2&&this.options.applyEdgeRouting&&i.source!=null&&i.target!=null){var Ff=tt?null:this._applyEndpointConstraint(i,i.source,l,!0,j),kf=ot?null:this._applyEndpointConstraint(i,i.target,l,!1,X);if(I!=="elkCompat"&&I!=="orthogonalEdgeStyle"&&(Ff!=null||kf!=null)){var El=a.points!=null?a.points.slice():[];Ff!=null&&El.unshift(Ff),kf!=null&&El.push(kf),a.points=El.length>0?El:null}}Pr&&(this._styles.set(i,mxConstants.STYLE_NOEDGESTYLE,null),this._styles.set(i,mxConstants.STYLE_ORTHOGONAL,null),this._styles.set(i,mxConstants.STYLE_EDGE,mxConstants.EDGESTYLE_ORTHOGONAL));var RO=Pr||I==="orthogonalEdgeStyle"||I==="elkCompat";if(this.options.applyEdgeRouting&&this.options.orthogonalRouting&&l&&l.length>=2&&!RO&&this._styles.set(i,mxConstants.STYLE_ORTHOGONAL,"1"),this.options.applyEdgeRouting&&this.options.orthogonalRouting&&a.points!=null&&a.points.length>2&&(a.points=this._simplifyOrthogonal(a.points)),r.labels&&r.labels.length>0&&l&&l.length>=2){var ji=r.labels[0];if(ji.x!=null&&ji.y!=null){var ml=new mxPoint(ji.x+(ji.width||0)/2+t,ji.y+(ji.height||0)/2+e),Wf=this._projectOntoPolyline(ml,l),up=ml.x-Wf.x,_p=ml.y-Wf.y,LO=Math.sqrt(up*up+_p*_p),pp=LO<=(ji.height||0)/2?Wf:ml,Ep=this._polylineMidpoint(l);a.relative=!0,a.x=0,a.y=0,a.offset=new mxPoint(Dt(pp.x-Ep.x),Dt(pp.y-Ep.y))}}LR(a,s)||this.model.setGeometry(i,a)}}}};Rt.prototype._terminalBox=function(n){var t=this.model.getGeometry(n);if(t==null)return null;if(!t.relative)return t;var e=n.parent!=null?this.model.getGeometry(n.parent):null;if(e==null)return null;var o=t.x*e.width,r=t.y*e.height;return t.offset!=null&&(o+=t.offset.x,r+=t.offset.y),{x:o,y:r,width:t.width,height:t.height}};Rt.prototype._applyEndpointConstraint=function(n,t,e,o,r){if(t!=null){var i=this._terminalBox(t);if(!(i==null||!(i.width>0)||!(i.height>0))){var s=o?e[0]:e[e.length-1],a=o?e[1]:e[e.length-2],l=this._coordsBetween(n.parent,t.parent),c=s.x+l.dx,g=s.y+l.dy,h=(c-i.x)/i.width,d=(g-i.y)/i.height,f=.02;if(a!=null&&this.options.orthogonalRouting&&!r){var E=a.x+l.dx,P=a.y+l.dy;h<f||h>1-f?d=(P-i.y)/i.height:(d<f||d>1-f)&&(h=(E-i.x)/i.width)}h<0?h=0:h>1&&(h=1),d<0?d=0:d>1&&(d=1),h=Math.round(h*1e4)/1e4,d=Math.round(d*1e4)/1e4;var S=o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,T=o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y;if(this._styles.set(n,S,h),this._styles.set(n,T,d),a==null||!this.options.orthogonalRouting)return null;var N=i.x+h*i.width-l.dx,I=i.y+d*i.height-l.dy,C=N-a.x,x=I-a.y,M=.5;if(Math.abs(C)<=M||Math.abs(x)<=M)return null;var A=d===0||d===1;return A?new mxPoint(Dt(N),Dt(a.y)):new mxPoint(Dt(a.x),Dt(I))}}};Rt.prototype._anchorDiagonalBody=function(n,t,e){var o=e?t[0]:t[t.length-1];if(o!=null){var r=n.points!=null?n.points.slice():[],i=e?r[0]:r[r.length-1],s=.5;if(!(i!=null&&(Math.abs(i.x-o.x)<=s||Math.abs(i.y-o.y)<=s))){var a=new mxPoint(o.x,o.y);e?r.unshift(a):r.push(a),n.points=r}}};Rt.prototype._strictPinTerminal=function(n,t,e,o,r,i){r&&this._pinPerpendicularPerimeter(n,t,e,o)||this._applyEndpointConstraint(n,t,e,o,i)};Rt.prototype._appendAnchorPoint=function(n,t,e,o){if(t!=null){var r=this.graph.getCellStyle(n);if(r!=null){var i=parseFloat(r[o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]),s=parseFloat(r[o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]);if(!(isNaN(i)||isNaN(s))){var a=parseFloat(r[o?"exitDx":"entryDx"])||0,l=parseFloat(r[o?"exitDy":"entryDy"])||0,c=this._terminalBox(t);if(!(c==null||!(c.width>0)||!(c.height>0))){var g=this._coordsBetween(n.parent,t.parent),h=Dt(c.x+i*c.width+a-g.dx),d=Dt(c.y+s*c.height+l-g.dy),f=o?e[0]:e[e.length-1];if(!(f!=null&&Math.abs(f.x-h)<=.5&&Math.abs(f.y-d)<=.5)){if(f!=null)for(var E=Math.abs(f.x-h)>=Math.abs(f.y-d),P=o?0:e.length-1,S=o?1:-1;P>=0&&P<e.length;P+=S)if(E){if(Math.abs(e[P].y-d)>.75)break;e[P].y=d}else{if(Math.abs(e[P].x-h)>.75)break;e[P].x=h}var T=new mxPoint(h,d);o?e.unshift(T):e.push(T)}}}}}};Rt.prototype._snapEndpointToAnchor=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=this.graph.getCellStyle(n),s=r!=null&&String(r.snapToPoint)==="1"||i!=null&&String(i.snapToPoint)==="1";if(!s)return!1;var a=this._terminalAnchors(t);if(a==null)return!1;var l=this._terminalBox(t);if(l==null||!(l.width>0)||!(l.height>0))return!1;var c=o?e[0]:e[e.length-1];if(c==null)return!1;for(var g=this._coordsBetween(n.parent,t.parent),h=c.x+g.dx,d=c.y+g.dy,f=null,E=1/0,P=0;P<a.length;P++){var S=l.x+a[P].x*l.width,T=l.y+a[P].y*l.height,N=(S-h)*(S-h)+(T-d)*(T-d);N<E&&(E=N,f={x:S,y:T})}return f==null?!1:(c.x=Dt(f.x-g.dx),c.y=Dt(f.y-g.dy),!0)};Rt.prototype._terminalAnchors=function(n){var t=this._anchorCache[n.id];if(t!==void 0)return t;var e=this.graph,o=null,r=e.view!=null&&e.view.getState!=null?e.view.getState(n):null;r!=null&&e.getAllConnectionConstraints!=null&&(o=e.getAllConnectionConstraints(r,!0));var i=this._terminalBox(n),s=i!=null&&i.width>0?i.width:1,a=i!=null&&i.height>0?i.height:1,l=[],c;if(o!=null)for(c=0;c<o.length;c++){var g=o[c];g!=null&&g.point!=null&&l.push({x:Hf(g.point.x+(g.dx||0)/s),y:Hf(g.point.y+(g.dy||0)/a)})}else{var h=e.getCellStyle(n),d=h!=null?h.points:null;if(d!=null)try{var f=typeof d=="string"?JSON.parse(d):d;for(c=0;c<f.length;c++){var E=f[c];E!=null&&E.length>=2&&l.push({x:Hf(parseFloat(E[0])+(E.length>3&&parseFloat(E[3])||0)/s),y:Hf(parseFloat(E[1])+(E.length>4&&parseFloat(E[4])||0)/a)})}}catch(S){}}var P=l.length>0?l:null;return this._anchorCache[n.id]=P,P};Rt.PERPENDICULAR_PERIMETER_SHAPES={rhombus:!0,ellipse:!0,doubleEllipse:!0};function vf(n,t,e){var o=n!=null?n[t]:null,r=typeof o=="number"?o:parseFloat(o);return isNaN(r)?e:r}Rt.PERIMETER_OUTLINES={parallelogramPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east";if(i==="north"||i==="south"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:s},{x:t,y:e},{x:0,y:e-s},{x:0,y:0}]}var a=o?Math.max(0,Math.min(t*.5,r)):t*Math.max(0,Math.min(1,r));return[{x:a,y:0},{x:t,y:0},{x:t-a,y:e},{x:0,y:e},{x:a,y:0}]},trapezoidPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east";if(i==="west"){var a=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:0},{x:t-a,y:e},{x:a,y:e},{x:0,y:0}]}if(i==="north"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:s},{x:t,y:0},{x:t,y:e},{x:0,y:e-s},{x:0,y:s}]}if(i==="south"){var s=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t,y:s},{x:t,y:e-s},{x:0,y:e},{x:0,y:0}]}var a=o?Math.max(0,Math.min(t*.5,r)):t*Math.max(0,Math.min(1,r));return[{x:a,y:0},{x:t-a,y:0},{x:t,y:e},{x:0,y:e},{x:a,y:0}]},stepPerimeter:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.2),i=n.direction||"east",s=t/2,a=e/2;if(i==="west"){var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:c,y:0},{x:t,y:0},{x:t-c,y:a},{x:t,y:e},{x:c,y:e},{x:0,y:a},{x:c,y:0}]}if(i==="north"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:l},{x:s,y:0},{x:t,y:l},{x:t,y:e},{x:s,y:e-l},{x:0,y:e},{x:0,y:l}]}if(i==="south"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:s,y:l},{x:t,y:0},{x:t,y:e-l},{x:s,y:e},{x:0,y:e-l},{x:0,y:0}]}var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:0,y:0},{x:t-c,y:0},{x:t,y:a},{x:t-c,y:e},{x:0,y:e},{x:c,y:a},{x:0,y:0}]},hexagonPerimeter2:function(n,t,e){var o=(n.fixedSize||"0")!="0",r=vf(n,"size",o?20:.25),i=n.direction||"east",s=t/2,a=e/2;if(i==="north"||i==="south"){var l=o?Math.max(0,Math.min(e,r)):e*Math.max(0,Math.min(1,r));return[{x:s,y:0},{x:t,y:l},{x:t,y:e-l},{x:s,y:e},{x:0,y:e-l},{x:0,y:l},{x:s,y:0}]}var c=o?Math.max(0,Math.min(t,r)):t*Math.max(0,Math.min(1,r));return[{x:c,y:0},{x:t-c,y:0},{x:t,y:a},{x:t-c,y:e},{x:c,y:e},{x:0,y:a},{x:c,y:0}]},trianglePerimeter:function(n,t,e){var o=n.direction||"east";return o==="north"?[{x:0,y:e},{x:t/2,y:0},{x:t,y:e},{x:0,y:e}]:o==="south"?[{x:0,y:0},{x:t/2,y:e},{x:t,y:0},{x:0,y:0}]:o==="west"?[{x:t,y:0},{x:0,y:e/2},{x:t,y:e},{x:t,y:0}]:[{x:0,y:0},{x:t,y:e/2},{x:0,y:e},{x:0,y:0}]}};function TO(n,t){if(n==null)return null;var e=n*1e4;return(t==="right"||t==="bottom"?Math.ceil(e-1e-6):Math.floor(e+1e-6))/1e4}Rt.prototype._outlineCross=function(n,t,e,o,r){for(var i=t==="top"||t==="bottom",s=i?e*o:e*r,a=t==="top"||t==="left",l=null,c=function(N){(l==null||(a?N<l:N>l))&&(l=N)},g=1;g<n.length;g++){var h=n[g-1],d=n[g],f=i?h.x:h.y,E=i?d.x:d.y,P=i?h.y:h.x,S=i?d.y:d.x;if(!(s<Math.min(f,E)-1e-9||s>Math.max(f,E)+1e-9))if(Math.abs(E-f)<1e-9)c(P),c(S);else{var T=(s-f)/(E-f);c(P+T*(S-P))}}return l==null?null:l/(i?r:o)};Rt.prototype._pinPerpendicularPerimeter=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=r!=null?r[mxConstants.STYLE_SHAPE]:null,s=i!=null&&Rt.PERPENDICULAR_PERIMETER_SHAPES[i]===!0,a=!s&&r!=null?Rt.PERIMETER_OUTLINES[r.perimeter]:null;if(!s&&a==null)return!1;var l=this._terminalBox(t);if(l==null||!(l.width>0)||!(l.height>0))return!1;var c=o?e[0]:e[e.length-1],g=o?e[1]:e[e.length-2];if(c==null||g==null)return!1;var h=this._coordsBetween(n.parent,t.parent),d=(c.y+h.dy-l.y)/l.height,f=(c.x+h.dx-l.x)/l.width,E=(g.x+h.dx-l.x)/l.width,P=(g.y+h.dy-l.y)/l.height,S=.02,T=null;if(d<=S)T="top";else if(d>=1-S)T="bottom";else if(f<=S)T="left";else if(f>=1-S)T="right";else{var N=Math.abs(g.x-c.x),I=Math.abs(g.y-c.y),C=.5;I<=C&&N>C?T=g.x>c.x?"right":"left":N<=C&&I>C&&(T=g.y>c.y?"bottom":"top")}if(T==null)return!1;var x,M;if(T==="top"||T==="bottom"?(x=Math.round(E*1e4)/1e4,M=TO(s?this._perimeterCross(i,T,x):this._outlineCross(a(r,l.width,l.height),T,x,l.width,l.height),T)):(M=Math.round(P*1e4)/1e4,x=TO(s?this._perimeterCross(i,T,M):this._outlineCross(a(r,l.width,l.height),T,M,l.width,l.height),T)),x==null||M==null)return!1;x<0?x=0:x>1&&(x=1),M<0?M=0:M>1&&(M=1);var A=o?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,B=o?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y;return this._styles.set(n,A,x),this._styles.set(n,B,M),!0};Rt.prototype._perimeterCross=function(n,t,e){if(e<0?e=0:e>1&&(e=1),n==="rhombus")return t==="bottom"||t==="right"?e<=.5?.5+e:1.5-e:e<=.5?.5-e:e-.5;var o=2*e-1,r=Math.sqrt(Math.max(0,1-o*o))/2;return t==="bottom"||t==="right"?.5+r:.5-r};Rt.prototype._isOrthogonalChain=function(n){if(n==null)return!1;for(var t=.5,e=2;e<=n.length-2;e++){var o=Math.abs(n[e].x-n[e-1].x),r=Math.abs(n[e].y-n[e-1].y);if(o>t&&r>t)return!1}return!0};Rt.prototype._alignEndpointSegment=function(n,t,e){var o=n.points;if(!(o==null||o.length===0)){var r=e?0:o.length-1,i=o[r],s=e?t[0]:t[t.length-1],a=.5;if(!(Math.abs(i.x-s.x)<=a||Math.abs(i.y-s.y)<=a)){var l=e?t[2]:t[t.length-3];l==null&&(l=e?t[t.length-1]:t[0]),Math.abs(i.x-l.x)>=Math.abs(i.y-l.y)?i.x=Dt(s.x):i.y=Dt(s.y)}}};Rt.prototype._synthesizeZ=function(n,t){var e=t[0],o=t[t.length-1],r,i;if(Math.abs(o.y-e.y)>=Math.abs(o.x-e.x)){var s=Dt((e.y+o.y)/2);r=new mxPoint(Dt(e.x),s),i=new mxPoint(Dt(o.x),s)}else{var a=Dt((e.x+o.x)/2);r=new mxPoint(a,Dt(e.y)),i=new mxPoint(a,Dt(o.y))}n.points=Math.abs(r.x-i.x)<=.5&&Math.abs(r.y-i.y)<=.5?[r]:[r,i],t.splice.apply(t,[1,0].concat(n.points))};Rt.prototype._simplifyOrthogonal=function(n){if(n==null||n.length<=2)return n;for(var t=.5,e=[n[0]],o=1;o<n.length-1;o++){var r=e[e.length-1],i=n[o],s=n[o+1],a=Math.abs(r.x-i.x)<=t&&Math.abs(i.x-s.x)<=t,l=Math.abs(r.y-i.y)<=t&&Math.abs(i.y-s.y)<=t;a||l||e.push(i)}return e.push(n[n.length-1]),e};Rt.NON_RECT_PERIMETER_SHAPES={ellipse:!0,doubleEllipse:!0,rhombus:!0,triangle:!0,hexagon:!0,parallelogram:!0,step:!0,trapezoid:!0};Rt.prototype._terminalDiagonal=function(n,t,e,o){if(t==null)return!1;var r=this.graph.getCellStyle(t),i=r!=null?r[mxConstants.STYLE_SHAPE]:null;if(i==null||!Rt.NON_RECT_PERIMETER_SHAPES[i])return!1;var s=this._terminalBox(t);if(s==null||!(s.width>0)||!(s.height>0))return!1;var a=o?e[0]:e[e.length-1],l=this._coordsBetween(n.parent,t.parent),c=(a.x+l.dx-s.x)/s.width,g=(a.y+l.dy-s.y)/s.height,h=.02,d=Math.abs(c-.5)<h&&(g<h||g>1-h)||Math.abs(g-.5)<h&&(c<h||c>1-h);return!d};Rt.prototype._coordsBetween=function(n,t){if(n===t)return{dx:0,dy:0};var e=this._parentAbsoluteOrigin(n),o=this._parentAbsoluteOrigin(t);return{dx:e.x-o.x,dy:e.y-o.y}};Rt.prototype._parentAbsoluteOrigin=function(n){for(var t=0,e=0,o=n;o!=null&&o.parent!=null;){var r=this.model.getGeometry(o);r!=null&&(t+=r.x,e+=r.y),o=o.parent}return{x:t,y:e}};Rt.prototype._projectOntoPolyline=function(n,t){for(var e=null,o=1/0,r=1;r<t.length;r++){var i=t[r-1],s=t[r],a=s.x-i.x,l=s.y-i.y,c=a*a+l*l,g=0;c>0&&(g=((n.x-i.x)*a+(n.y-i.y)*l)/c,g<0?g=0:g>1&&(g=1));var h=i.x+g*a,d=i.y+g*l,f=(n.x-h)*(n.x-h)+(n.y-d)*(n.y-d);f<o&&(o=f,e=new mxPoint(h,d))}return e||n.clone()};Rt.prototype._polylineMidpoint=function(n){if(n.length===1)return n[0].clone();for(var t=0,e=[],o=1;o<n.length;o++){var r=n[o].x-n[o-1].x,i=n[o].y-n[o-1].y,s=Math.sqrt(r*r+i*i);e.push(s),t+=s}for(var a=t/2,l=0,o=0;o<e.length;o++){if(l+e[o]>=a){var c=e[o]===0?0:(a-l)/e[o];return new mxPoint(n[o].x+(n[o+1].x-n[o].x)*c,n[o].y+(n[o+1].y-n[o].y)*c)}l+=e[o]}return n[n.length-1].clone()};Rt.prototype._isCompound=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isVertex(o)&&!this.portCells.has(o.id))return!0}return!1};function wo(n,t){var e=n.getStyle(t);if(e==null)return!1;for(var o=e.split(";"),r=0;r<o.length;r++)if(o[r]==="transparentBounds=1")return!0;return!1}Rt.prototype._isTransparentBounds=function(n){return wo(this.model,n)};function AR(n,t){for(var e=n.getModel(),o=e.getChildCount(t),r=null,i=0;i<o;i++){var s=e.getChildAt(t,i);if(!(!e.isVertex(s)||!e.isVisible(s))){var a=e.getGeometry(s);if(!(a==null||a.relative)){var l=typeof n.getCellStyle=="function"?n.getCellStyle(s):{};if(l.part=="1"){var c=a.x+a.width,g=a.y+a.height;r==null?r={width:c,height:g}:(r.width=Math.max(r.width,c),r.height=Math.max(r.height,g))}}}}return r}function Bf(n){if(n==null||n==="")return null;if(typeof n=="number")return isFinite(n)?{top:n,right:n,bottom:n,left:n}:null;var t=String(n);try{t=decodeURIComponent(t)}catch(s){}if(t=t.trim(),t==="")return null;for(var e=t.split(/\s+/),o=[],r=0;r<e.length;r++){var i=parseFloat(e[r]);o.push(isNaN(i)?0:i)}return o.length===0?null:o.length===1?{top:o[0],right:o[0],bottom:o[0],left:o[0]}:o.length===2?{top:o[0],right:o[1],bottom:o[0],left:o[1]}:o.length===3?{top:o[0],right:o[1],bottom:o[2],left:o[1]}:{top:o[0],right:o[1],bottom:o[2],left:o[3]}}function CR(n,t){for(var e=n.getModel(),o=e.getChildCount(t),r=null,i=function(d,f,E,P){if(r==null)r={x:d,y:f,width:E,height:P};else{var S=Math.max(r.x+r.width,d+E),T=Math.max(r.y+r.height,f+P);r.x=Math.min(r.x,d),r.y=Math.min(r.y,f),r.width=S-r.x,r.height=T-r.y}},s=0;s<o;s++){var a=e.getChildAt(t,s),l=e.getGeometry(a);if(l!=null){if(e.isVertex(a)&&!l.relative)if(wo(e,a)){var c=fi(n,a);c!=null&&i(l.x+c.x,l.y+c.y,c.width,c.height)}else i(l.x,l.y,l.width,l.height);else if(e.isEdge(a)){var g=l.points!=null?l.points.slice():[];typeof l.getTerminalPoint=="function"&&(e.getTerminal(a,!0)==null&&l.getTerminalPoint(!0)!=null&&g.push(l.getTerminalPoint(!0)),e.getTerminal(a,!1)==null&&l.getTerminalPoint(!1)!=null&&g.push(l.getTerminalPoint(!1)));for(var h=0;h<g.length;h++)g[h]!=null&&i(g[h].x,g[h].y,0,0)}}}return r}function fi(n,t){var e=CR(n,t);if(e==null)return null;var o=typeof n.getCellStyle=="function"?n.getCellStyle(t):{},r=Bf(o.groupPadding)||{top:0,right:0,bottom:0,left:0},i=o.shape==="swimlane"||o.swimlane!=null;if(i){var s=parseInt(o.startSize,10);isNaN(s)&&(s=40),o.horizontal==0||o.horizontal==="0"?r.left+=s:r.top+=s}var a=parseInt(o.footerSize,10);return!isNaN(a)&&a>0&&(i&&(o.horizontal==0||o.horizontal==="0")?r.right+=a:r.bottom+=a),{x:e.x-r.left,y:e.y-r.top,width:e.width+r.left+r.right,height:e.height+r.top+r.bottom}}function ul(n,t,e){for(var o=null,r=n.getChildCount(t),i=0;i<r;i++){var s=n.getChildAt(t,i);if(!(!n.isVertex(s)||!n.isVisible(s))&&!(e!=null&&!e(s))){var a=n.getGeometry(s);if(a!=null){var l=a.x,c=a.y;if(wo(n,s)){var g=ul(n,s,e);if(g==null)continue;l=a.x+g.x,c=a.y+g.y}o==null?o={x:l,y:c}:(l<o.x&&(o.x=l),c<o.y&&(o.y=c))}}}return o}function cp(n,t,e){for(var o=n.getModel(),r=null,i=0;i<(t.children!=null?t.children.length:0);i++){var s=t.children[i],a=e[s.id];if(!(a==null||s.x==null||s.y==null)){var l=s.x,c=s.y;if(wo(o,a))if(s.children!=null&&s.children.length>0){var g=cp(n,s,e);if(g==null)continue;l=s.x+g.x,c=s.y+g.y}else{var h=fi(n,a),d=ul(o,a),f=o.getGeometry(a);if(h==null||d==null)continue;l=s.x+d.x-((f!=null?f.x:0)+h.x),c=s.y+d.y-((f!=null?f.y:0)+h.y)}r==null?r={x:l,y:c}:(l<r.x&&(r.x=l),c<r.y&&(r.y=c))}}return r}function pa(n,t,e,o,r){if(!(Math.abs(e)<.01&&Math.abs(o)<.01))for(var i=n.getChildCount(t),s=0;s<i;s++){var a=n.getChildAt(t,s);if(!(r!=null&&!r(a))){if(n.isVertex(a)&&wo(n,a)){pa(n,a,e,o,r);continue}var l=n.getGeometry(a);if(l!=null){if(n.isVertex(a)){if(l.relative)continue;var c=l.clone();c.x=l.x+e,c.y=l.y+o,n.setGeometry(a,c)}else if(n.isEdge(a)){var c=null;if(l.points!=null&&l.points.length>0){c=l.clone(),c.points=[];for(var g=0;g<l.points.length;g++){var h=l.points[g];c.points.push(new mxPoint(h.x+e,h.y+o))}}if(typeof l.getTerminalPoint=="function"&&typeof l.setTerminalPoint=="function")for(var d=0;d<2;d++){var f=d===0,E=n.getTerminal(a,f)==null?l.getTerminalPoint(f):null;E!=null&&(c=c!=null?c:l.clone(),c.setTerminalPoint(new mxPoint(E.x+e,E.y+o),f))}c!=null&&n.setGeometry(a,c)}}}}}function _t(n){this.graph=n,this.model=n.getModel(),this._cellToElk={},this._elkToCell={},this._portCells=new Set,this._cellToElkNode={},this._constraintPorts={},this._constraintPortCounter=0,this._portThresholdSize=20,this._reversedEdges=new Set,this._climbedEnds={},this._maskedEnds={},this._maskPortCounter=0,this._freeEndPortCounter=0,this._layoutDirection=null,this._edgeRouting=null,this._anchoredEnds={},this._jettyEnds={},this.respectConnectionConstraints=!1,this.rootCellIds=null,this.useViewStateSizing=!0,this.respectFixedPosition=!0,this.cellFilter=null,this.includeEdgeLabels=!0,this.includeVertexLabels=!0,this.includeCompoundLabels=null,this.groupPadding=null}_t.prototype.convert=function(n,t){this._cellToElk={},this._elkToCell={},this._portCells=new Set,this._cellToElkNode={},this._constraintPorts={},this._constraintPortCounter=0,this._reversedEdges=new Set,this._climbedEnds={},this._maskedEnds={},this._anchoredEnds={},this._jettyEnds={},this._maskPortCounter=0,this._freeEndPortCounter=0;var e=mxUtils.clone(t)||{};if(this._layoutDirection=e["elk.direction"]!=null?String(e["elk.direction"]):null,this.preserveNodePositions=e["elk.interactive"]==="true",e["elk.algorithm"]==null&&(e["elk.algorithm"]="layered"),e["elk.hierarchyHandling"]==null&&(e["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),this._edgeLabelsInline=e["elk.edgeLabels.inline"]==="true"||e["elk.edgeLabels.inline"]===!0,e["elk.edgeRouting"]==null){var o=this._inferEdgeRouting(n);o!=null&&(e["elk.edgeRouting"]=o)}if(this._edgeRouting=e["elk.edgeRouting"]!=null?String(e["elk.edgeRouting"]):null,e["elk.padding"]==null&&n!=null&&this.model.isVertex(n)){var r=this._getGroupPadding(n);e["elk.padding"]="[top="+r.top+",left="+r.left+",bottom="+r.bottom+",right="+r.right+"]"}var i={id:"root",layoutOptions:e,children:[],edges:[]};this._inheritedCompoundOptions={};for(var s in e)(s==="elk.algorithm"||s==="elk.direction"||s==="elk.layered.cycleBreaking.strategy"||s.indexOf("elk.layered.spacing.")===0||s.indexOf("elk.spacing.")===0||s.indexOf("elk.force.")===0||s.indexOf("elk.stress.")===0||s.indexOf("elk.radial.")===0||s.indexOf("elk.mrtree.")===0)&&(this._inheritedCompoundOptions[s]=e[s]);return this._convertChildren(n,i),this._convertEdges(n,i),this._convertInternalEdges(n),this._portFixedPosFreeEnds(i),i};_t.prototype.getElkToCellMap=function(){return this._elkToCell};_t.prototype.getPortCells=function(){return this._portCells};_t.prototype.getReversedEdges=function(){return this._reversedEdges};_t.prototype.getClimbedEnds=function(){return this._climbedEnds};_t.prototype.getMaskedEnds=function(){return this._maskedEnds};_t.prototype.getAnchoredEnds=function(){return this._anchoredEnds};_t.prototype.getJettyEnds=function(){return this._jettyEnds};_t.prototype._convertChildren=function(n,t){var e=null;t.id!=="root"&&this.model.isVertex(n)&&wo(this.model,n)&&(e=fi(this.graph,n));for(var o=this.model.getChildCount(n),r=0;r<o;r++){var i=this.model.getChildAt(n,r);if(!(!this.model.isVertex(i)||!this.model.isVisible(i))){if(this._isShapePart(i)){var s=this.model.getGeometry(i);if(this.model.isVertex(n)||s!=null&&s.relative)continue}if(!(this.cellFilter!=null&&!this.cellFilter(i))){var a=this.model.getGeometry(i);if(a!=null){if(i.collapsed){var l=this._convertVertex(i,a,e);this._convertPorts(i,l),t.children.push(l);continue}var l=this._convertVertex(i,a,e),c=this._hasLayoutableChildren(i);if(c){l.children=[],l.edges=[];var g=this._getGroupPadding(i);l.layoutOptions=l.layoutOptions||{},l.layoutOptions["elk.padding"]="[top="+g.top+",left="+g.left+",bottom="+g.bottom+",right="+g.right+"]";for(var h in this._inheritedCompoundOptions)l.layoutOptions[h]==null&&(l.layoutOptions[h]=this._inheritedCompoundOptions[h]);this._convertChildren(i,l)}this._convertPorts(i,l),t.children.push(l)}}}}};_t.prototype._convertVertex=function(n,t,e){var o="n"+n.id;this._cellToElk[n.id]=o,this._elkToCell[o]=n;var r=t.width,i=t.height,s=wo(this.model,n),a=s?fi(this.graph,n):null;if(a!=null)r=a.width,i=a.height;else if(this.useViewStateSizing&&!n.collapsed&&this._hasNonPartChild(n)&&this.graph.view!=null&&typeof this.graph.view.getState=="function"){var l=this.graph.view.getState(n),c=this.graph.view.scale||1;l!=null&&l.width!=null&&l.height!=null&&(r=Math.max(r,l.width/c),i=Math.max(i,l.height/c))}var g={id:o,width:r,height:i},h=(t.x||0)+(a!=null?a.x:0)-(e!=null?e.x:0),d=(t.y||0)+(a!=null?a.y:0)-(e!=null?e.y:0);this.respectFixedPosition&&typeof this.graph.isCellMovable=="function"&&!this.graph.isCellMovable(n)?(g.x=h,g.y=d,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.position"]="("+h+","+d+")"):this.preserveNodePositions&&t.x!=null&&t.y!=null&&(g.x=h,g.y=d),this._cellToElkNode[n.id]=g;var f=this.includeVertexLabels;if(!f&&this.includeCompoundLabels===!0&&this._hasLayoutableChildren(n)&&(f=!0),f&&s&&(f=!1),f){var E=this._getVertexLabels(n);E.length>0&&(g.labels=E,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.nodeSize.constraints"]="NODE_LABELS MINIMUM_SIZE",g.layoutOptions["elk.nodeSize.minimum"]="("+r+", "+i+")")}return g};_t.prototype._convertEdges=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(!(!this.model.isEdge(r)||!this.model.isVisible(r))&&!(this.cellFilter!=null&&!this.cellFilter(r))){var i=this._convertEdge(r);i!=null&&t.edges.push(i)}}};_t.prototype._convertEdge=function(n){var t=this.model.getTerminal(n,!0),e=this.model.getTerminal(n,!1);if(t==null||e==null)return null;var o=this._resolveEdgeTerminal(t,n,!0),r=this._resolveEdgeTerminal(e,n,!1);if(o==null||r==null)return null;var i="e"+n.id;this._cellToElk[n.id]=i,this._elkToCell[i]=n;var s={id:i,sources:[o],targets:[r]};this.respectConnectionConstraints&&this._applyConnectionConstraints(n,t,e,s);var a=s.sources[0]===this._cellToElk[t.id]?this._anchoredPoint(n,!0):null,l=s.targets[0]===this._cellToElk[e.id]?this._anchoredPoint(n,!1):null,c=a!=null?this._jettyStubFor(n,t,a,!0):null,g=l!=null?this._jettyStubFor(n,e,l,!1):null;if((c!=null||g!=null)&&this.model.getParent(t)===this.model.getParent(e)){var h=this.model.getGeometry(t),d=this.model.getGeometry(e);if(h!=null&&d!=null&&a!=null&&l!=null){var f=h.x+a.x*h.width+a.dx,E=h.y+a.y*h.height+a.dy,P=d.x+l.x*d.width+l.dx,S=d.y+l.y*d.height+l.dy,T=P-f,N=S-E,I=(c!=null?c.jetty:0)+(g!=null?g.jetty:0);T*T+N*N<I*I&&(c=null,g=null)}}if(a!=null){var C=this._ensureConstraintPort(t,a.x,a.y,a.dx,a.dy,c);C!=null&&(s.sources=[C.id],this._markAnchoredEnd(i,!0),c!=null&&this._markJettyEnd(i,!0))}if(l!=null){var x=this._ensureConstraintPort(e,l.x,l.y,l.dx,l.dy,g);x!=null&&(s.targets=[x.id],this._markAnchoredEnd(i,!1),g!=null&&this._markJettyEnd(i,!1))}if(s.sources[0]===this._cellToElk[t.id]){var M=this._portConstraintSides(n,t,!0);if(M!=null){var A=this._createMaskPort(t,this._pickConstraintSide(M,t,e,!0),this._maskJettyFor(n,!0));A!=null&&(s.sources=[A.id],this._markMaskedEnd(i,!0))}}if(s.targets[0]===this._cellToElk[e.id]){var B=this._portConstraintSides(n,e,!1);if(B!=null){var Y=this._createMaskPort(e,this._pickConstraintSide(B,e,t,!1),this._maskJettyFor(n,!1));Y!=null&&(s.targets=[Y.id],this._markMaskedEnd(i,!1))}}if(this.rootCellIds!=null&&e!=null&&t!=null){for(var j=String(e.id),X=String(t.id),tt=!1,ot=!1,Lt=0;Lt<this.rootCellIds.length;Lt++){var zt=String(this.rootCellIds[Lt]);j===zt&&(tt=!0),X===zt&&(ot=!0)}if(tt&&!ot){var be=s.sources;s.sources=s.targets,s.targets=be,this._reversedEdges.add(i)}}if(this.includeEdgeLabels){var mr=this._getEdgeLabels(n);mr.length>0&&(s.labels=mr)}return s};_t.prototype._resolveEdgeTerminal=function(n,t,e){if(this._portCells.has(n.id))return"p"+n.id;if(this._cellToElk[n.id]!=null)return this._cellToElk[n.id];for(var o=this.model.getParent(n);o!=null;){if(this._cellToElk[o.id]!=null){var r="e"+t.id,i=this._climbedEnds[r];return i==null&&(i={source:!1,target:!1},this._climbedEnds[r]=i),i[e?"source":"target"]=!0,this._cellToElk[o.id]}o=this.model.getParent(o)}return null};_t.prototype._collectInternalEdges=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isEdge(r)&&this.model.isVisible(r)){if(this.cellFilter!=null&&!this.cellFilter(r))continue;var i=this._convertEdge(r);i!=null&&t.edges.push(i)}}};_t.prototype._convertInternalEdges=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(!(!this.model.isVertex(o)||!this.model.isVisible(o))&&!this._isPort(o)&&!(this.cellFilter!=null&&!this.cellFilter(o))&&!o.collapsed){var r=this._cellToElkNode[o.id];r==null||r.edges==null||(this._collectInternalEdges(o,r),this._convertInternalEdges(o))}}};_t.prototype._isPort=function(n){if(!this.model.isVertex(n))return!1;var t=this.model.getGeometry(n);if(t==null||!t.relative)return!1;var e=this.graph.getCellStyle(n);return e[mxConstants.STYLE_SHAPE]==="port"||e.portConstraint!=null?!0:t.width<=this._portThresholdSize&&t.height<=this._portThresholdSize};_t.prototype._isShapePart=function(n){var t=this.model.getGeometry(n);return t!=null&&t.relative?!0:this.graph.getCellStyle(n).part=="1"};_t.prototype._hasNonPartChild=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isVertex(o)&&this.model.isVisible(o)&&!this._isShapePart(o))return!0}return!1};_t.prototype._hasLayoutableEdge=function(n){if(typeof this.model.getEdgeCount!="function")return!1;var t=this.model.getEdgeCount(n);if(typeof this.model.getEdgeAt!="function")return t>0;for(var e=0;e<t;e++){var o=this.model.getEdgeAt(n,e);if(!(o==null||!this.model.isVisible(o))&&!(this.cellFilter!=null&&!this.cellFilter(o)))return!0}return!1};_t.prototype._convertPorts=function(n,t){var e=this.model.getChildCount(n);if(e!==0){for(var o=[],r=0;r<e;r++){var i=this.model.getChildAt(n,r);if(this._isPort(i)&&this.graph.getCellStyle(i).part!="1"&&this._hasLayoutableEdge(i)){var s=this._convertPort(i,n,t);s!=null&&(o.push(s),this._portCells.add(i.id))}}o.length>0&&(t.ports=o,t.layoutOptions=t.layoutOptions||{},t.layoutOptions["elk.portConstraints"]="FIXED_POS")}};_t.prototype._convertPort=function(n,t,e){var o=this.model.getGeometry(n),r=this.model.getGeometry(t);if(o==null||r==null)return null;var i="p"+n.id;this._cellToElk["p"+n.id]=i,this._elkToCell[i]=n;var s=e!=null&&e.width!=null?e.width:r.width,a=e!=null&&e.height!=null?e.height:r.height,l=o.x*s,c=o.y*a;o.offset&&(l+=o.offset.x,c+=o.offset.y);var g=this._inferPortSide(s>0?(l+o.width/2)/s:o.x,a>0?(c+o.height/2)/a:o.y),h=this.graph.getCellStyle(n);if(h.portConstraint){var d={north:"NORTH",south:"SOUTH",east:"EAST",west:"WEST",NORTH:"NORTH",SOUTH:"SOUTH",EAST:"EAST",WEST:"WEST"}[h.portConstraint];d&&(g=d)}return{id:i,x:l,y:c,width:o.width,height:o.height,layoutOptions:{"elk.port.side":g}}};_t.prototype._inferPortSide=function(n,t){if(t<=.01)return"NORTH";if(t>=.99)return"SOUTH";if(n<=.01)return"WEST";if(n>=.99)return"EAST";var e=t,o=1-t,r=n,i=1-n,s=Math.min(e,o,r,i);return s===e?"NORTH":s===o?"SOUTH":s===r?"WEST":"EAST"};_t.prototype._applyConnectionConstraints=function(n,t,e,o){var r=this.graph.getCellStyle(n);if(r[mxConstants.STYLE_EXIT_X]!=null&&r[mxConstants.STYLE_EXIT_Y]!=null){var i=parseFloat(r[mxConstants.STYLE_EXIT_X]),s=parseFloat(r[mxConstants.STYLE_EXIT_Y]);if(!isNaN(i)&&!isNaN(s)){var a=this._ensureConstraintPort(t,i,s);a!=null&&(o.sources=[a.id])}}if(r[mxConstants.STYLE_ENTRY_X]!=null&&r[mxConstants.STYLE_ENTRY_Y]!=null){var l=parseFloat(r[mxConstants.STYLE_ENTRY_X]),c=parseFloat(r[mxConstants.STYLE_ENTRY_Y]);if(!isNaN(l)&&!isNaN(c)){var a=this._ensureConstraintPort(e,l,c);a!=null&&(o.targets=[a.id])}}};_t.prototype._ensureConstraintPort=function(n,t,e,o,r,i){var s=this._cellToElkNode[n.id];if(s==null)return null;var a=this.model.getGeometry(n);if(a==null)return null;o=o||0,r=r||0;var l=n.id+"_"+t.toFixed(3)+"_"+e.toFixed(3)+"_"+o+"_"+r+(i!=null?"_"+i.side+i.jetty:"");if(this._constraintPorts[l]!=null)return this._constraintPorts[l];var c="cp"+ ++this._constraintPortCounter,g={id:c,x:t*(s.width!=null?s.width:a.width)+o,y:e*(s.height!=null?s.height:a.height)+r,width:1,height:1,layoutOptions:{"elk.port.side":this._inferPortSide(t,e)}};i!=null&&(g.layoutOptions["elk.port.borderOffset"]=String(i.jetty)),s.ports||(s.ports=[]),s.ports.push(g),s.layoutOptions=s.layoutOptions||{};var h=s.layoutOptions["elk.portConstraints"];return(h==null||h==="FIXED_SIDE")&&(s.layoutOptions["elk.portConstraints"]="FIXED_POS"),this._constraintPorts[l]=g,g};_t.prototype._anchoredPoint=function(n,t){var e=this.graph.getCellStyle(n)||{};if(e[t?"exitDx":"entryDx"]==null)return null;var o=parseFloat(e[t?"exitX":"entryX"]),r=parseFloat(e[t?"exitY":"entryY"]);return isNaN(o)||isNaN(r)?null:{x:o,y:r,dx:parseFloat(e[t?"exitDx":"entryDx"])||0,dy:parseFloat(e[t?"exitDy":"entryDy"])||0}};_t.prototype._markAnchoredEnd=function(n,t){var e=this._anchoredEnds[n];e==null&&(e={source:!1,target:!1},this._anchoredEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._markJettyEnd=function(n,t){var e=this._jettyEnds[n];e==null&&(e={source:!1,target:!1},this._jettyEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._jettyStubFor=function(n,t,e,o){if(this._edgeRouting!=="ORTHOGONAL")return null;var r=this.model.getGeometry(t);if(r==null||!(r.width>0)||!(r.height>0))return null;var i=e.x+e.dx/r.width,s=e.y+e.dy/r.height,a=.01,l=i<=a,c=i>=1-a,g=s<=a,h=s>=1-a;if(l+c+g+h!==1)return null;var d=this._jettyFor(this.graph.getCellStyle(n),o);return d>0?{side:g?"N":h?"S":l?"W":"E",jetty:d}:null};_t.prototype._jettyFor=function(n,t){if(n==null)return 0;var e=n[t?"sourceJettySize":"targetJettySize"];if(e==null&&(e=n.jettySize),e==null&&(e=10),e==="auto"){var o=n[t?"startArrow":"endArrow"];if(o!=null&&o!=="none"){var r=parseFloat(n[t?"startSize":"endSize"]);isNaN(r)&&(r=6),e=Math.max(2,Math.ceil((r+10)/10))*10}else e=20}return e=parseFloat(e),isNaN(e)?0:e};_t.prototype._maskJettyFor=function(n,t){if(this._edgeRouting!=="ORTHOGONAL")return null;var e=this.graph.getCellStyle(n);if(e==null||e.jettySize==null&&e[t?"sourceJettySize":"targetJettySize"]==null)return null;var o=this._jettyFor(e,t);return o>0?o:null};_t.prototype._portConstraintSides=function(n,t,e){var o=this.graph.getCellStyle(t)||{},r=this.graph.getCellStyle(n)||{},i=o.portConstraint;if(i==null&&(i=r[e?"sourcePortConstraint":"targetPortConstraint"]),i==null)return null;var s=String(i),a=0;if(o.portConstraintRotation==1){var l=parseFloat(o.rotation)||0;l>45?a=l>=135?2:1:l<-45&&(a=l<=-135?2:3)}for(var c=["NORTH","EAST","SOUTH","WEST"],g=["north","east","south","west"],h=[],d={},f=0;f<g.length;f++)if(s.indexOf(g[f])>=0){var E=c[(f+a)%4];d[E]||(d[E]=!0,h.push(E))}return h.length===0||h.length===4?null:h};_t.prototype._pickConstraintSide=function(n,t,e,o){if(n.length===1)return n[0];var r=function(E){return n.indexOf(E)>=0?E:null},i={RIGHT:["EAST","WEST"],LEFT:["WEST","EAST"],DOWN:["SOUTH","NORTH"],UP:["NORTH","SOUTH"]}[this._layoutDirection];if(i!=null){var s=r(o?i[0]:i[1]);if(s!=null)return s}var a=this._terminalCenter(t),l=this._terminalCenter(e);if(a!=null&&l!=null)for(var c=l.x-a.x,g=l.y-a.y,h=Math.abs(c)>=Math.abs(g)?[c>=0?"EAST":"WEST",g>=0?"SOUTH":"NORTH"]:[g>=0?"SOUTH":"NORTH",c>=0?"EAST":"WEST"],d=0;d<h.length;d++){var f=r(h[d]);if(f!=null)return f}return n[0]};_t.prototype._terminalCenter=function(n){var t=this.model.getGeometry(n);return t!=null&&!t.relative?{x:t.x+t.width/2,y:t.y+t.height/2}:null};_t.prototype._createMaskPort=function(n,t,e){var o=this._cellToElkNode[n.id];if(o==null)return null;var r=this.model.getGeometry(n),i=o.width!=null?o.width:r!=null?r.width:0,s=o.height!=null?o.height:r!=null?r.height:0,a={NORTH:{x:i/2,y:0},SOUTH:{x:i/2,y:s},WEST:{x:0,y:s/2},EAST:{x:i,y:s/2}}[t],l={id:"mp"+ ++this._maskPortCounter,x:a.x,y:a.y,width:1,height:1,layoutOptions:{"elk.port.side":t}};return e!=null&&(l.layoutOptions["elk.port.borderOffset"]=String(e)),o.ports||(o.ports=[]),o.ports.push(l),o.layoutOptions=o.layoutOptions||{},o.layoutOptions["elk.portConstraints"]==null&&(o.layoutOptions["elk.portConstraints"]="FIXED_SIDE"),l};_t.prototype._markMaskedEnd=function(n,t){var e=this._maskedEnds[n];e==null&&(e={source:!1,target:!1},this._maskedEnds[n]=e),e[t?"source":"target"]=!0};_t.prototype._portFixedPosFreeEnds=function(n){var t={RIGHT:["EAST","WEST"],LEFT:["WEST","EAST"],DOWN:["SOUTH","NORTH"],UP:["NORTH","SOUTH"]}[this._layoutDirection]||["EAST","WEST"],e=[];(function j(X){e.push(X);for(var tt=X.children||[],ot=0;ot<tt.length;ot++)j(tt[ot])})(n);for(var o={},r={},i=0;i<e.length;i++){var s=e[i].layoutOptions;e[i]!==n&&s!=null&&s["elk.portConstraints"]==="FIXED_POS"&&(o[e[i].id]=e[i]);var a=e[i].ports;if(a!=null)for(var l=0;l<a.length;l++)r[a[l].id]=e[i].id}for(var c={},g=[],i=0;i<e.length;i++){var h=e[i].edges;if(h!=null)for(var d=0;d<h.length;d++)for(var f=0;f<2;f++){var E=f===0?"sources":"targets",P=o[h[d][E][0]];if(P!=null){var S=t[f],T=P.id+"|"+S,N=c[T];N==null&&(N={node:P,side:S,ends:[]},c[T]=N,g.push(N)),N.ends.push({edge:h[d],key:E,other:h[d][f===0?"targets":"sources"][0]})}}}for(var i=0;i<g.length;i++){var N=g[i],I=this._elkToCell[N.node.id],C=I!=null?this.model.getGeometry(I):null,x=N.node.width!=null?N.node.width:C!=null?C.width:0,M=N.node.height!=null?N.node.height:C!=null?C.height:0;if(N.ends.length>1){for(var d=0;d<N.ends.length;d++)N.ends[d].order=d,N.ends[d].cross=this._endCrossCoord(N.ends[d].other,N.side,r);N.ends.sort(function(tt,ot){return tt.cross!=null&&ot.cross!=null&&tt.cross!==ot.cross?tt.cross-ot.cross:tt.order-ot.order})}for(var d=0;d<N.ends.length;d++){var A=(d+1)/(N.ends.length+1),B={NORTH:{x:x*A,y:0},SOUTH:{x:x*A,y:M},WEST:{x:0,y:M*A},EAST:{x,y:M*A}}[N.side],Y={id:"fp"+ ++this._freeEndPortCounter,x:B.x,y:B.y,width:1,height:1,layoutOptions:{"elk.port.side":N.side}};N.node.ports||(N.node.ports=[]),N.node.ports.push(Y),N.ends[d].edge[N.ends[d].key]=[Y.id]}}};_t.prototype._endCrossCoord=function(n,t,e){var o=e[n]!=null?e[n]:n,r=this._elkToCell[o];if(r==null)return null;var i=this.model.getGeometry(r);if(i==null)return null;for(var s=i.x+i.width/2,a=i.y+i.height/2,l=this.model.getParent(r);l!=null&&this.model.isVertex(l);){var c=this.model.getGeometry(l);c!=null&&(s+=c.x,a+=c.y),l=this.model.getParent(l)}return t==="EAST"||t==="WEST"?a:s};_t.prototype._getCellLabel=function(n){var t=this.graph.getLabel(n);if(t!=null&&typeof t=="string"&&t.length>0){var e=t.replace(/<[^>]*>/g,"");return e.length>0?e:null}return null};_t.prototype._measureLabel=function(n,t){if(typeof mxUtils!="undefined"&&mxUtils.getSizeForString){var e=t[mxConstants.STYLE_FONTSIZE]?parseInt(t[mxConstants.STYLE_FONTSIZE]):null,o=t[mxConstants.STYLE_FONTFAMILY]||null,r=t[mxConstants.STYLE_FONTSTYLE]?parseInt(t[mxConstants.STYLE_FONTSTYLE]):null,i=mxUtils.getSizeForString(n,e,o,null,r);return{width:i.width+2,height:i.height+2}}return{width:n.length*7,height:14}};_t.prototype._getVertexLabels=function(n){var t=this._getCellLabel(n);if(t==null)return[];var e=this.graph.getCellStyle(n),o="INSIDE V_CENTER H_CENTER";e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]==="bottom"?o="OUTSIDE V_BOTTOM H_CENTER":e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]==="top"?o="OUTSIDE V_TOP H_CENTER":e[mxConstants.STYLE_LABEL_POSITION]==="left"?o="OUTSIDE V_CENTER H_LEFT":e[mxConstants.STYLE_LABEL_POSITION]==="right"?o="OUTSIDE V_CENTER H_RIGHT":e.verticalAlign==="top"?o="INSIDE V_TOP H_CENTER":e.verticalAlign==="bottom"&&(o="INSIDE V_BOTTOM H_CENTER");var r=this._measureLabel(t,e);return[{text:t,width:r.width,height:r.height,layoutOptions:{"elk.nodeLabels.placement":o}}]};_t.prototype._getEdgeLabels=function(n){var t=[],e=this.graph.getCellStyle(n),o=this._getCellLabel(n);if(o!=null){var r=this._measureLabel(o,e),i={"elk.edgeLabels.placement":"CENTER"};this._edgeLabelsInline&&(i["elk.edgeLabels.inline"]="true"),t.push({text:o,width:r.width+4,height:r.height+14,layoutOptions:i})}return t};_t.prototype._getGroupPadding=function(n){var t=this.graph.getCellStyle(n),e=wo(this.model,n),o=t[mxConstants.STYLE_SHAPE]==="swimlane"||t.swimlane!=null,r=t.container==="1",i=Bf(t.groupPadding);if(i==null&&!e&&(i=Bf(this.groupPadding)),i==null&&(i=e?{top:0,right:0,bottom:0,left:0}:{top:o||r?10:20,right:10,bottom:10,left:10}),o||r&&!e){var s=parseInt(t[mxConstants.STYLE_STARTSIZE],10);isNaN(s)&&(s=e?40:r?20:30),t.horizontal==0||t.horizontal==="0"?i.left+=s:i.top+=s}var a=parseInt(t.footerSize,10);return!isNaN(a)&&a>0&&(o&&(t.horizontal==0||t.horizontal==="0")?i.right+=a:i.bottom+=a),{top:i.top,left:i.left,bottom:i.bottom,right:i.right}};_t.prototype._hasLayoutableChildren=function(n){var t=this.graph.getCellStyle(n);if(t.childLayout!=null)return!1;for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isVertex(r)&&this.model.isVisible(r)&&!this._isShapePart(r))return this._subtreeHasEdge(n)}return!1};_t.prototype._subtreeHasEdge=function(n){for(var t=this.model.getChildCount(n),e=0;e<t;e++){var o=this.model.getChildAt(n,e);if(this.model.isEdge(o))return!0;if(!(this.model.isVertex(o)&&this._isShapePart(o))&&(this.model.isVertex(o)&&typeof this.model.getEdgeCount=="function"&&this.model.getEdgeCount(o)>0||this._subtreeHasEdge(o)))return!0}return!1};_t.prototype._inferEdgeRouting=function(n){var t={orthogonal:0,spline:0,other:0};return this._countEdgeStyles(n,t),t.spline>t.orthogonal&&t.spline>t.other?"SPLINES":t.orthogonal>t.other?"ORTHOGONAL":null};_t.prototype._countEdgeStyles=function(n,t){for(var e=this.model.getChildCount(n),o=0;o<e;o++){var r=this.model.getChildAt(n,o);if(this.model.isEdge(r)&&this.model.isVisible(r)){var i=this.graph.getCellStyle(r);i[mxConstants.STYLE_CURVED]==="1"?t.spline++:i[mxConstants.STYLE_EDGE]==="orthogonalEdgeStyle"||i[mxConstants.STYLE_EDGE]==="elbowEdgeStyle"||i[mxConstants.STYLE_EDGE]==="entityRelationEdgeStyle"?t.orthogonal++:t.other++}this.model.isVertex(r)&&this.model.getChildCount(r)>0&&this._countEdgeStyles(r,t)}};ht.DEFAULTS={layered:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":"30","elk.layered.spacing.nodeNodeBetweenLayers":"30","elk.edgeLabels.inline":"true","elk.spacing.edgeLabel":"5","elk.layered.cycleBreaking.strategy":"DEPTH_FIRST","elk.layered.considerModelOrder.strategy":"NODES","elk.layered.crossingMinimization.forceNodeModelOrder":"true"},mrtree:{"elk.algorithm":"mrtree","elk.direction":"DOWN","elk.spacing.nodeNode":"20","elk.spacing.edgeNode":"10","elk.mrtree.weighting":"MODEL_ORDER"},force:{"elk.algorithm":"force","elk.spacing.nodeNode":"10","elk.force.iterations":"300","elk.force.repulsivePower":"0"},stress:{"elk.algorithm":"stress","elk.spacing.nodeNode":"80","elk.stress.desiredEdgeLength":"100"},radial:{"elk.algorithm":"radial","elk.spacing.nodeNode":"20","elk.edgeRouting":"POLYLINE"},routing:{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.interactive":"true","elk.layered.cycleBreaking.strategy":"INTERACTIVE","elk.layered.layering.strategy":"INTERACTIVE","elk.layered.crossingMinimization.strategy":"INTERACTIVE","elk.layered.nodePlacement.strategy":"INTERACTIVE","elk.layered.crossingMinimization.greedySwitch.type":"OFF","elk.layered.crossingMinimization.greedySwitchHierarchical.type":"OFF","elk.spacing.nodeNode":"30","elk.layered.spacing.nodeNodeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"20","elk.edgeLabels.inline":"true","elk.spacing.edgeLabel":"5"}};ht.MENU_PRESETS={verticalFlow:{algorithm:"layered",options:{"elk.direction":"DOWN"}},horizontalFlow:{algorithm:"layered",options:{"elk.direction":"RIGHT"}},verticalTree:{algorithm:"mrtree",options:{"elk.direction":"DOWN"}},horizontalTree:{algorithm:"mrtree",options:{"elk.direction":"RIGHT"}},radialTree:{algorithm:"radial",options:null},organic:{algorithm:"force",options:null}};ht.CANONICAL_EDGE={edgeStyleMode:"orthogonalEdgeStyle",corners:"rounded"};function ht(n,t,e,o){this.graph=n,this.algorithm=t||"layered",this.layoutOptions=e||{},this.edgeStyleMode=o!=null&&o.edgeStyleMode||"auto",this.corners=o!=null&&o.corners||"keep",this.enforceCorners=o==null||o.enforceCorners!==!1,this.applierOptions=o!=null&&o.applierOptions||null,this.useViewStateSizing=o==null||o.useViewStateSizing!==!1,this.respectFixedPosition=o==null||o.respectFixedPosition!==!1,o!=null&&o.rootCellIds!=null&&o.rootCellIds.length>0?this.rootCellIds=o.rootCellIds.slice():o!=null&&o.rootCellId!=null?this.rootCellIds=[o.rootCellId]:this.rootCellIds=null,this.cellFilter=o!=null&&typeof o.cellFilter=="function"?o.cellFilter:null,this._effectiveCellFilter=this.cellFilter,this.includeEdgeLabels=!(o!=null&&o.includeEdgeLabels===!1),this.includeCompoundLabels=null,o!=null&&o.includeVertexLabels!=null?this.includeVertexLabels=o.includeVertexLabels!==!1:o!=null&&o.applierOptions!=null&&o.applierOptions.resizeParent===!1?(this.includeVertexLabels=!1,this.includeCompoundLabels=!0):this.includeVertexLabels=!0,this.portSpread=o!=null&&o.portSpread===!0,o!=null&&o.mermaidPolicy===!1?this.mermaidPolicy=!1:this.mermaidPolicy=this.algorithm==="layered",this.preserveOrigin=o!=null&&o.preserveOrigin===!0,this.resizeLayoutRoot=o!=null&&o.resizeLayoutRoot===!0,this.extractIsolated=o==null||o.extractIsolated!==!1,this.sharedStems=o==null||o.sharedStems!==!1,this.nonTreeEdges=o!=null&&o.nonTreeEdges==="elk"?"elk":"route",this.siblingOrder=o!=null&&o.siblingOrder==="model"?"model":"geometry",this.groupPadding=o!=null&&o.groupPadding!=null?o.groupPadding:null}ht.prototype.moveCell=function(){};ht.prototype.resizeCell=function(){};ht.prototype.canRouteNonTreeEdges=function(n,t){return!1};ht.prototype.routeNonTreeEdges=function(n,t){};ht.componentScopeFilter=function(n,t,e){var o={},r;for(r=0;r<e.length;r++)o[String(e[r])]=!0;var i={},s=[],a=function(E){for(var P=n.getChildCount(E),S=0;S<P;S++){var T=n.getChildAt(E,S);if(T.id!=null&&o[String(T.id)]===!0&&s.push(T),n.isEdge(T)){var N=n.getTerminal(T,!0),I=n.getTerminal(T,!1);N!=null&&N.id!=null&&(i[N.id]=i[N.id]||[]).push(T),I!=null&&I.id!=null&&I!==N&&(i[I.id]=i[I.id]||[]).push(T)}a(T)}};if(a(t),s.length===0)return null;var l={},c=[],g=function(E){for(;E!=null&&E!==t&&(n.isVertex(E)||n.isEdge(E));){if(E.id==null||l[E.id]===!0)return;l[E.id]=!0,c.push(E),E=n.getParent(E)}};for(r=0;r<s.length;r++)g(s[r]);for(;c.length>0;){var h=c.pop();n.isEdge(h)&&(g(n.getTerminal(h,!0)),g(n.getTerminal(h,!1)));var d=h.id!=null?i[h.id]:null;if(d!=null)for(r=0;r<d.length;r++)g(d[r]);var f=n.getChildCount(h);for(r=0;r<f;r++)g(n.getChildAt(h,r))}return function(E){for(;E!=null&&E!==t;){if(E.id!=null&&l[E.id]===!0)return!0;E=n.getParent(E)}return!1}};ht.prototype.execute=function(n,t){var e=this.graph.getModel();this.prepare(n,function(o,r){if(o!=null){t!=null?t(o):typeof console!="undefined"&&console.error&&console.error("ElkLayout.execute failed:",o);return}e.beginUpdate();try{r()}finally{e.endUpdate()}t!=null&&t(null)})};ht.prototype.prepare=function(n,t){var e=this,o=this._convertGraph(n);ht.getElk(function(r,i){if(i!=null){t(i);return}r.layout(o.elkGraph).then(function(s){t(null,function(){e._applyResult(n,o,s)})},function(s){t(s)})})};ht.prototype.executeSync=function(n){var t=ht.getElkSync();if(t==null)throw new Error("No synchronous ELK engine available \u2014 use prepare()/execute().");var e=this._convertGraph(n),o=t.layoutSync(e.elkGraph),r=this.graph.getModel();r.beginUpdate();try{this._applyResult(n,e,o)}finally{r.endUpdate()}};ht.prototype.canExecuteSync=function(){return ht.getElkSync()!=null};ht.prototype._convertGraph=function(n){var t=ht.DEFAULTS[this.algorithm]||{},e={};for(var o in t)e[o]=t[o];for(var o in this.layoutOptions)e[o]=this.layoutOptions[o];var r=new _t(this.graph);r.rootCellIds=this.rootCellIds,r.useViewStateSizing=this.useViewStateSizing,r.respectFixedPosition=this.respectFixedPosition;var i=this.cellFilter;i==null&&this.rootCellIds!=null&&this.rootCellIds.length>0&&(i=ht.componentScopeFilter(this.graph.getModel(),n,this.rootCellIds)),this._effectiveCellFilter=i,r.cellFilter=i,r.includeEdgeLabels=this.includeEdgeLabels,r.includeVertexLabels=this.includeVertexLabels,r.includeCompoundLabels=this.includeCompoundLabels,r.groupPadding=this.groupPadding;var s=r.convert(n,e);if(this.mermaidPolicy){ht.applyMermaidElkPolicy(s);for(var o in this.layoutOptions)(o==="elk.layered.considerModelOrder.strategy"||o==="elk.layered.crossingMinimization.forceNodeModelOrder")&&(s.layoutOptions[o]=this.layoutOptions[o])}var a=[];this.algorithm==="layered"&&this.extractIsolated&&(a=ht.extractIsolatedTopLevel(s)||[]);var l=r.getElkToCellMap(),c=[];if(this.algorithm==="mrtree"&&this.nonTreeEdges!=="elk")for(var g=ht.extractNonTreeEdges(s,e["elk.mrtree.searchOrder"]),h=0;h<g.length;h++){var d=l[g[h].id];d!=null&&(c.push(d),delete l[g[h].id])}return this.algorithm==="mrtree"&&this.siblingOrder!=="model"&&this.layoutOptions["elk.mrtree.weighting"]==null&&ht.stampSiblingOrderConstraints(s,l,this.graph,e["elk.direction"],e["elk.mrtree.searchOrder"]),{mergedOptions:e,elkGraph:s,elkToCellMap:l,portCells:r.getPortCells(),reversedEdges:r.getReversedEdges(),climbedEnds:r.getClimbedEnds(),maskedEnds:r.getMaskedEnds(),anchoredEnds:r.getAnchoredEnds(),jettyEnds:r.getJettyEnds(),isolatedNodes:a,nonTreeEdges:c}};ht._walkTreeStructure=function(n,t){var e={},o=[],r=function(S,T){if(e[S.id]={node:S,parent:T,outDirect:[],outPort:[],treeChildren:[]},S.ports!=null)for(var N=0;N<S.ports.length;N++)e[S.ports[N].id]=e[S.id];if(S.children!=null&&S.children.length>0){o.push(S);for(var I=0;I<S.children.length;I++)r(S.children[I],S)}};r(n,null);var i=function(S){if(S.edges!=null)for(var T=0;T<S.edges.length;T++){var N=S.edges[T],I=N.sources!=null?e[N.sources[0]]:null,C=N.targets!=null?e[N.targets[0]]:null;if(!(I==null||C==null||I===C||I.parent==null||I.parent!==C.parent)){var x={edge:N,container:S,target:C};N.sources[0]===I.node.id?I.outDirect.push(x):I.outPort.push(x)}}if(S.children!=null)for(var M=0;M<S.children.length;M++)i(S.children[M])};i(n);for(var s=[],a=t==="BFS",l=0;l<o.length;l++)for(var c=o[l].children,g={},h=function(S){return S.outDirect.concat(S.outPort)},d=function(S){g[S.node.id]=1;for(var T=h(S),N=0;N<T.length;N++){var I=T[N].target;g[I.node.id]===1?s.push(T[N]):g[I.node.id]===2?(g[I.node.id]=1,S.treeChildren.push(I)):(S.treeChildren.push(I),d(I))}},f=function(S){for(var T=[S];T.length>0;){var N=T.shift();g[N.node.id]=1;for(var I=h(N),C=0;C<I.length;C++){var x=I[C].target;g[x.node.id]===1?s.push(I[C]):g[x.node.id]===2?(g[x.node.id]=1,N.treeChildren.push(x)):(N.treeChildren.push(x),T.push(x))}}},E=0;E<c.length;E++){var P=e[c[E].id];g[P.node.id]==null&&(a?f(P):d(P),g[P.node.id]=2)}return{levels:o,nodeMeta:e,eliminated:s}};ht.extractNonTreeEdges=function(n,t){for(var e=ht._walkTreeStructure(n,t),o=[],r=0;r<e.eliminated.length;r++){var i=e.eliminated[r],s=i.container.edges.indexOf(i.edge);s>=0&&(i.container.edges.splice(s,1),o.push(i.edge))}return o};ht.stampSiblingOrderConstraints=function(n,t,e,o,r){for(var i=e.getModel(),s=!(o==="RIGHT"||o==="LEFT"),a=ht._walkTreeStructure(n,r),l=function(I){var C=t[I.id],x=C!=null?i.getGeometry(C):null;if(x==null)return 0;var M=wo(i,C)?fi(e,C):null;return s?(x.x||0)+(M!=null?M.x:0)+(M!=null?M.width:x.width||0)/2:(x.y||0)+(M!=null?M.y:0)+(M!=null?M.height:x.height||0)/2},c=0;c<a.levels.length;c++){var g=a.levels[c];g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.mrtree.weighting"]="CONSTRAINT"}var h={};for(var d in a.nodeMeta){var f=a.nodeMeta[d];if(!(f.node.id!==d||f.treeChildren.length===0)){for(var E=[],P=0;P<f.treeChildren.length;P++){var S=f.treeChildren[P].node;h[S.id]||(h[S.id]=!0,E.push({node:S,idx:E.length,coord:l(S)}))}E.sort(function(I,C){return I.coord-C.coord||I.idx-C.idx});for(var T=0;T<E.length;T++){var N=E[T].node;N.layoutOptions=N.layoutOptions||{},N.layoutOptions["elk.mrtree.positionConstraint"]=String(T)}}}};ht.collapseTreeStems=function(n,t){var e={},o;if(n.children!=null)for(o=0;o<n.children.length;o++)e[n.children[o].id]=n.children[o];if(n.edges!=null)for(o=0;o<n.edges.length;o++){var r=n.edges[o],i=r.sources!=null?e[r.sources[0]]:null,s=r.sections!=null&&r.sections.length>0?r.sections[0]:null;if(!(i==null||s==null||s.startPoint==null||s.bendPoints==null||s.bendPoints.length===0)){var a=s.bendPoints[0];if(t&&s.startPoint.y===a.y){var l=i.y+i.height/2;s.startPoint.y=l,a.y=l}else if(!t&&s.startPoint.x===a.x){var c=i.x+i.width/2;s.startPoint.x=c,a.x=c}var g=r.targets!=null?e[r.targets[0]]:null;if(!(g==null||s.endPoint==null)){var h=s.bendPoints,d=h[h.length-1];if(t){var f=g.y+g.height/2;s.endPoint.y===f&&d.y!==f&&(h.length>=2?d.y=f:h.push({x:d.x,y:f}))}else{var E=g.x+g.width/2;s.endPoint.x===E&&d.x!==E&&(h.length>=2?d.x=E:h.push({x:E,y:d.y}))}}}}if(n.children!=null)for(o=0;o<n.children.length;o++)ht.collapseTreeStems(n.children[o],t)};ht.prototype._applyResult=function(n,t,e){var o=this.graph,r=o.getModel(),i=t.mergedOptions,s=t.elkToCellMap,a=n!=null&&r.isVertex(n)&&wo(r,n),l=this.preserveOrigin||a,c=l&&t.isolatedNodes.length>0,g=l?ul(r,n,this._effectiveCellFilter):null,h=0,d=0;if(l&&!c&&g!=null){var f=cp(o,e,s);f!=null&&(h=g.x-f.x,d=g.y-f.y)}var E=new Zi(o),P=i["elk.edgeRouting"],S=this.algorithm==="layered"||this.algorithm==="mrtree",T=this.edgeStyleMode;T==="auto"&&(T=S&&P!=="POLYLINE"&&P!=="SPLINES"?"orthogonal":"straight");var N=t.nonTreeEdges!=null&&t.nonTreeEdges.length>0?new Set(t.nonTreeEdges):null,I=N!=null&&this.canRouteNonTreeEdges(n,t.nonTreeEdges);if(T!=="keep"){var C=new Set;for(var x in s){var M=s[x];M!=null&&r.isEdge(M)&&C.add(M)}I&&N.forEach(function(zt){C.add(zt)}),this._applyEdgeStyle(n,T,this.corners,C,E,N)}else if(N!=null&&!I){var A=this;N.forEach(function(zt){A.graph.resetEdge(zt)})}this.algorithm==="mrtree"&&this.sharedStems&&!this.portSpread&&ht.collapseTreeStems(e,i["elk.direction"]==="RIGHT"||i["elk.direction"]==="LEFT");var B={resizeParent:!0,applyEdgeRouting:this.edgeStyleMode!=="keep",resetEdgePoints:!0,orthogonalRouting:T!=="straight"&&P!=="POLYLINE"&&P!=="SPLINES",edgeStyleMode:T,portSpread:this.portSpread};if(this.applierOptions!=null)for(var Y in this.applierOptions)B[Y]=this.applierOptions[Y];B.reversedEdges=t.reversedEdges,B.climbedEnds=t.climbedEnds,B.maskedEnds=t.maskedEnds,B.anchoredEnds=t.anchoredEnds,B.jettyEnds=t.jettyEnds,B.styleBatch=E;var j=new Rt(o,s,t.portCells,B);if(j.apply(e,h,d),t.isolatedNodes.length>0&&ht.placeIsolatedTopLevelAbove(o,r,s,t.isolatedNodes,t.elkGraph.children,n,this._effectiveCellFilter),this.resizeLayoutRoot&&!a&&e.width!=null&&e.height!=null&&n!=null&&r.isVertex(n)){var X=r.getGeometry(n),tt=Math.round(e.width),ot=Math.round(e.height);X!=null&&(X.width!==tt||X.height!==ot)&&(X=X.clone(),X.width=tt,X.height=ot,r.setGeometry(n,X))}if(I&&this.routeNonTreeEdges(n,t.nonTreeEdges),c&&g!=null){var Lt=ul(r,n,this._effectiveCellFilter);Lt!=null&&pa(r,n,g.x-Lt.x,g.y-Lt.y,this._effectiveCellFilter)}};ht.prototype._applyEdgeStyle=function(n,t,e,o,r,i){var s=this.graph.getModel();this._applyEdgeStyleRecursive(n,s,t,e,o,r,i)};ht.prototype._applyEdgeStyleRecursive=function(n,t,e,o,r,i,s){for(var a=t.getChildCount(n),l=0;l<a;l++){var c=t.getChildAt(n,l);if(t.isEdge(c)&&t.isVisible(c)&&(this._effectiveCellFilter==null||this._effectiveCellFilter(c))){(r==null||!r.has(c))&&this.graph.resetEdge(c);var g=s!=null&&s.has(c)?"orthogonalEdgeStyle":e;g==="orthogonalEdgeStyle"?(i.set(c,mxConstants.STYLE_NOEDGESTYLE,null),i.set(c,mxConstants.STYLE_ORTHOGONAL,null),i.set(c,mxConstants.STYLE_EDGE,mxConstants.EDGESTYLE_ORTHOGONAL)):g==="elkCompat"?(i.set(c,mxConstants.STYLE_NOEDGESTYLE,"1"),i.set(c,mxConstants.STYLE_ORTHOGONAL,null),i.set(c,mxConstants.STYLE_EDGE,null)):(i.set(c,mxConstants.STYLE_NOEDGESTYLE,"1"),i.set(c,mxConstants.STYLE_ORTHOGONAL,g==="orthogonal"?"1":null),i.set(c,mxConstants.STYLE_EDGE,null)),o!=="keep"&&(this.enforceCorners||!gp(i.get(c),mxConstants.STYLE_CURVED))&&(i.set(c,mxConstants.STYLE_ROUNDED,o==="rounded"?"1":"0"),i.set(c,mxConstants.STYLE_CURVED,o==="curved"?"1":"0"));var h=i.get(c);gp(h,"exitDx")||(i.set(c,mxConstants.STYLE_EXIT_X,null),i.set(c,mxConstants.STYLE_EXIT_Y,null)),gp(h,"entryDx")||(i.set(c,mxConstants.STYLE_ENTRY_X,null),i.set(c,mxConstants.STYLE_ENTRY_Y,null))}t.isVertex(c)&&t.getChildCount(c)>0&&!c.collapsed&&this.graph.getCellStyle(c).childLayout==null&&this._applyEdgeStyleRecursive(c,t,e,o,r,i,s)}};function gp(n,t){return n!=null&&(n.substring(0,t.length+1)===t+"="||n.indexOf(";"+t+"=")>=0)}ht.applyCorners=function(n,t,e){if(!(e==null||e==="keep")){var o=n.getModel(),r=new Zi(n),i=function(s){for(var a=o.getChildCount(s),l=0;l<a;l++){var c=o.getChildAt(s,l);o.isEdge(c)&&o.isVisible(c)&&(r.set(c,mxConstants.STYLE_ROUNDED,e==="rounded"?"1":"0"),r.set(c,mxConstants.STYLE_CURVED,e==="curved"?"1":"0")),o.isVertex(c)&&o.getChildCount(c)>0&&!c.collapsed&&n.getCellStyle(c).childLayout==null&&i(c)}};i(t),r.flush()}};ht._elk=null;ht.getElkSync=function(){if(ht._elk!=null)return typeof ht._elk.layoutSync=="function"?ht._elk:null;if(typeof globalThis.ELK=="undefined"||globalThis.ELK==null||globalThis.ELK.prototype==null||typeof globalThis.ELK.prototype.layoutSync!="function")return null;try{return ht._elk=new globalThis.ELK,ht._elk}catch(n){return null}};ht.getElk=function(n){if(ht._elk!=null){n(ht._elk,null);return}if(typeof globalThis.ELK=="undefined"||globalThis.ELK==null){n(null,new Error("ELK engine not loaded \u2014 drawio-mermaid bundle must be included first."));return}try{ht._elk=new globalThis.ELK,n(ht._elk,null)}catch(t){n(null,t)}};ht.applyMermaidElkPolicy=function(n){var t={},e={},o={};function r(g,h){if(t[g.id]=g,e[g.id]=h,g.ports)for(var d=0;d<g.ports.length;d++)o[g.ports[d].id]=g;if(g.children)for(var f=0;f<g.children.length;f++)r(g.children[f],g)}r(n,null);function i(g){return t[g]!=null?t[g]:o[g]!=null?o[g]:null}n.layoutOptions=n.layoutOptions||{},n.layoutOptions["spacing.baseValue"]==null&&(n.layoutOptions["spacing.baseValue"]=35),n.layoutOptions["elk.layered.unnecessaryBendpoints"]==null&&(n.layoutOptions["elk.layered.unnecessaryBendpoints"]="true"),delete n.layoutOptions["elk.layered.crossingMinimization.forceNodeModelOrder"],delete n.layoutOptions["elk.layered.considerModelOrder.strategy"];function s(g){if(g!==n&&g.children!=null&&g.children.length>0&&(g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.hierarchyHandling"]==null&&(g.layoutOptions["elk.hierarchyHandling"]="SEPARATE_CHILDREN"),g.layoutOptions["spacing.baseValue"]==null&&(g.layoutOptions["spacing.baseValue"]=30),g.layoutOptions["nodeLabels.placement"]==null&&(g.layoutOptions["nodeLabels.placement"]="[H_CENTER V_TOP, INSIDE]"),delete g.width,delete g.height,delete g.layoutOptions["elk.nodeSize.constraints"],delete g.layoutOptions["elk.nodeSize.minimum"]),g.children)for(var h=0;h<g.children.length;h++)s(g.children[h])}s(n);function a(g,h){for(var d={},f=g;f!=null;)d[f.id]=f,f=e[f.id];for(f=h;f!=null;){if(d[f.id]!=null)return f;f=e[f.id]}return null}function l(g,h){for(var d=g;d!=null&&(d.children!=null&&d.children.length>0&&(d.layoutOptions=d.layoutOptions||{},d.layoutOptions["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),d!==h);)d=e[d.id]}function c(g){if(g.edges)for(var h=0;h<g.edges.length;h++){var d=g.edges[h],f=d.sources!=null?d.sources[0]:null,E=d.targets!=null?d.targets[0]:null,P=f!=null?i(f):null,S=E!=null?i(E):null;if(!(P==null||S==null)&&e[P.id]!==e[S.id]){var T=a(P,S);T!=null&&(l(P,T),l(S,T))}}if(g.children)for(var h=0;h<g.children.length;h++)c(g.children[h])}c(n)};ht.extractIsolatedTopLevel=function(n){if(n==null||n.children==null||n.children.length<2)return[];var t={};if(n.edges!=null)for(var e=0;e<n.edges.length;e++){var o=n.edges[e];if(o.sources!=null)for(var r=0;r<o.sources.length;r++)t[o.sources[r]]=!0;if(o.targets!=null)for(var i=0;i<o.targets.length;i++)t[o.targets[i]]=!0}for(var s=[],a=[],e=0;e<n.children.length;e++){var l=n.children[e],c=l.children!=null&&l.children.length>0,g=!1;if(l.ports!=null){for(var h=0;h<l.ports.length;h++)if(t[l.ports[h].id]){g=!0;break}}c||t[l.id]||g?s.push(l):a.push(l)}return a.length===0||s.length===0?[]:(n.children=s,a)};ht.placeIsolatedTopLevelAbove=function(n,t,e,o,r,i,s){if(!(o==null||o.length===0)&&!(e==null||r==null)){for(var a=1/0,l=1/0,c=-1/0,g=0;g<r.length;g++){var h=e[r[g].id];if(h!=null){var d=t.getGeometry(h);d!=null&&(d.x<a&&(a=d.x),d.y<l&&(l=d.y),d.x+d.width>c&&(c=d.x+d.width))}}if(a!==1/0){for(var f=c-a,E=30,P=10,S=0,g=0;g<o.length;g++)S+=o[g].height||30,g>0&&(S+=P);var T=S+E,N=Math.max(0,T-l);if(N>0){for(var I={},g=0;g<o.length;g++){var C=o[g],x=e[C.id];x!=null&&(I[x.id]=!0)}for(var M=i!=null?i:n.getDefaultParent(),A=t.getChildCount(M),g=0;g<A;g++){var B=t.getChildAt(M,g);if(!(B==null||I[B.id])&&!(s!=null&&!s(B))){var Y=t.getGeometry(B);if(Y!=null){if(t.isVertex(B))if(wo(t,B))pa(t,B,0,N);else{var j=Y.clone();j.y=Y.y+N,t.setGeometry(B,j)}else if(t.isEdge(B)&&Y.points!=null&&Y.points.length>0){var j=Y.clone();j.points=[];for(var X=0;X<Y.points.length;X++){var tt=Y.points[X];j.points.push(new mxPoint(tt.x,tt.y+N))}t.setGeometry(B,j)}}}}}for(var ot=l+N-S-E,g=0;g<o.length;g++){var C=o[g],x=e[C.id];if(x!=null){var Lt=t.getGeometry(x);if(Lt!=null){if(wo(t,x)){var zt=fi(n,x);if(zt!=null){var be=Math.min(zt.width,f);pa(t,x,a+(f-be)/2-(Lt.x+zt.x),ot-(Lt.y+zt.y)),ot+=zt.height+P}continue}var mr=C.width||Lt.width||100,Ea=C.height||Lt.height||30;mr>f&&(mr=f);var Pr=Lt.clone();Pr.x=a+(f-mr)/2,Pr.y=ot,Pr.width=mr,Pr.height=Ea,t.setGeometry(x,Pr),ot+=Ea+P}}}}}};ht.Adapter=_t;ht.Applier=Rt;hs.setCoreOptions(wt);var NO=!1;function Uf(){NO||(SO(),pE(),OE(),IE(),vE(),$E(),cm(),eE(),NO=!0)}function yO(n,t){gs(n,t,!1);for(let e of n.getLabels())gs(e,t,!1);for(let e of n.getPorts()){gs(e,t,!1);for(let o of e.getLabels())gs(o,t,!1)}for(let e of n.getContainedEdges()){gs(e,t,!1);for(let o of e.getLabels())gs(o,t,!1)}for(let e of n.getChildren())yO(e,t)}var _l=class{constructor(t={}){this.defaultLayoutOptions=t.defaultLayoutOptions||{},Uf()}layoutSync(t,e={}){let o=e.layoutOptions!==void 0?e.layoutOptions:this.defaultLayoutOptions,r={value:null},i=Bl.forGraph(t).rememberImporter(r).toElk();o!=null&&typeof o=="object"&&Object.keys(o).length>0&&yO(i,o);let s=e.progressMonitor||new zl;return new Wl().layout(i,s),r.value.transferLayout(i),t}layout(t,e={}){return new Promise((o,r)=>{try{o(this.layoutSync(t,e))}catch(i){r(i)}})}knownLayoutOptions(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getOptionDataAll().map(e=>({id:e.getId(),name:e.getName()||"",description:e.getDescription()||"",group:e.getGroup()||"",type:e.getType()||"",targets:e.getTargets()?Array.from(e.getTargets()):[]})))}knownLayoutAlgorithms(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getAlgorithmDataAll().map(e=>({id:e.getId(),name:e.getName()||"",description:e.getDescription()||"",knownOptions:Array.from(e.getKnownOptionIds())})))}knownLayoutCategories(){Uf();let t=Ht.getInstance();return Promise.resolve(t.getCategoryDataAll().map(e=>({id:e.getId(),name:e.getName()||"",knownLayouters:e.getLayouters().map(o=>o.getId())})))}terminateWorker(){}};var xR=_l;return MO(DR);})();
var ElkLayout=ELK.ElkLayout,ElkAdapter=ELK.ElkAdapter,ElkApplier=ELK.ElkApplier;ELK=ELK.default;
var elkLayoutLoaded="undefined"!==typeof ElkLayout&&null!=ElkLayout,ElkLayoutBindings=elkLayoutLoaded?ElkLayout:{};
-ElkLayoutBindings.run=function(a,b,k,v,m){var w=a.editor.graph,c=w.getDefaultParent(),e=w.getSelectionCell();null!=e&&1<w.model.getChildCount(e)&&w.model.isVertex(e)&&(c=e);w=new ElkLayout(w,b,k,v);var x=a.spinner;b=Graph.elkLayoutNameForAlgorithm(b);if(null!=b&&(a.lastLayoutSpec=[{layout:b,config:Graph.elkOptionsToConfig(k,v)}],k=a.getSelectedLayoutContainer(),null!=k)){a.setContainerChildLayout(k,a.lastLayoutSpec);null!=m&&m();return}null!=x&&null!=x.spin&&x.spin(document.body,mxResources.get("loading"));
-w.prepare(c,function(q,n){null!=x&&null!=x.stop&&x.stop();null!=q?a.handleError(q):a.executeLayout(n,!0,m)})};ElkLayoutBindings.SETTINGS_KEY=".drawio-elk-layout-settings";ElkLayoutBindings.SETTINGS={};ElkLayoutBindings._settingsLoaded=!1;ElkLayoutBindings._loadSettings=function(){if(!ElkLayout._settingsLoaded&&(ElkLayout._settingsLoaded=!0,isLocalStorage))try{var a=localStorage.getItem(ElkLayout.SETTINGS_KEY);if(null!=a){var b=JSON.parse(a);null!=b&&"object"===typeof b&&(ElkLayout.SETTINGS=b)}}catch(k){}};
+ElkLayoutBindings.run=function(a,b,k,w,m){var x=a.editor.graph,c=x.getDefaultParent(),e=x.getSelectionCell();null!=e&&1<x.model.getChildCount(e)&&x.model.isVertex(e)&&(c=e);x=new ElkLayout(x,b,k,w);var y=a.spinner;b=Graph.elkLayoutNameForAlgorithm(b);if(null!=b&&(a.lastLayoutSpec=[{layout:b,config:Graph.elkOptionsToConfig(k,w)}],a.applyLayoutToSelectedContainers(a.lastLayoutSpec))){null!=m&&m();return}null!=y&&null!=y.spin&&y.spin(document.body,mxResources.get("loading"));x.prepare(c,function(r,n){null!=
+y&&null!=y.stop&&y.stop();null!=r?a.handleError(r):a.executeLayout(n,!0,m)})};ElkLayoutBindings.SETTINGS_KEY=".drawio-elk-layout-settings";ElkLayoutBindings.SETTINGS={};ElkLayoutBindings._settingsLoaded=!1;ElkLayoutBindings._loadSettings=function(){if(!ElkLayout._settingsLoaded&&(ElkLayout._settingsLoaded=!0,isLocalStorage))try{var a=localStorage.getItem(ElkLayout.SETTINGS_KEY);if(null!=a){var b=JSON.parse(a);null!=b&&"object"===typeof b&&(ElkLayout.SETTINGS=b)}}catch(k){}};
ElkLayoutBindings._saveSettings=function(){if(isLocalStorage)try{localStorage.setItem(ElkLayout.SETTINGS_KEY,JSON.stringify(ElkLayout.SETTINGS))}catch(a){}};ElkLayoutBindings.HELP_URL="https://www.drawio.com/docs/manual/layouts/";ElkLayoutBindings.HELP_ANCHORS={layered:"flow-layouts/",mrtree:"tree-layouts/",radial:"radial-tree-layout/",force:"organic-layout/",stress:"organic-layout/"};ElkLayoutBindings.MAX_ROOTS={layered:Infinity,mrtree:Infinity,radial:1};
ElkLayoutBindings.DIALOG_FIELDS={layered:[{key:"elk.spacing.nodeNode",type:"number",label:"nodeSpacing",def:30},{key:"elk.layered.spacing.nodeNodeBetweenLayers",type:"number",label:"rankSpacing",def:30},{key:"elk.layered.layering.strategy",type:"select",label:"layeringStrategy",def:"NETWORK_SIMPLEX",choices:[{value:"NETWORK_SIMPLEX",label:"networkSimplex"},{value:"LONGEST_PATH",label:"longestPath"},{value:"COFFMAN_GRAHAM",label:"coffmanGraham"}]}],mrtree:[{key:"elk.spacing.nodeNode",type:"number",
label:"nodeSpacing",def:20},{key:"elk.mrtree.weighting",type:"select",label:"weighting",def:"MODEL_ORDER",choices:[{value:"MODEL_ORDER",label:"modelOrder"},{value:"DESCENDANTS",label:"descendants"},{value:"CONSTRAINT",label:"constraint"},{value:"FAN",label:"fan"}]}],radial:[{key:"elk.spacing.nodeNode",type:"number",label:"nodeSpacing",def:20},{key:"elk.radial.optimizationCriteria",type:"select",label:"optimization",def:"NONE",choices:[{value:"NONE",label:"none"},{value:"EDGE_LENGTH",label:"edgeLength"},
{value:"EDGE_LENGTH_BY_POSITION",label:"edgeLengthByPosition"},{value:"CROSSING_MINIMIZATION_BY_POSITION",label:"crossingMinimization"}]}],force:[{key:"elk.spacing.nodeNode",type:"number",label:"nodeSpacing",def:10},{key:"elk.force.iterations",type:"number",label:"iterations",def:300},{key:"elk.force.repulsivePower",type:"number",label:"repulsivePower",def:0}],stress:[{key:"elk.spacing.nodeNode",type:"number",label:"nodeSpacing",def:80},{key:"elk.stress.desiredEdgeLength",type:"number",label:"edgeLength",
def:100},{key:"elk.stress.iterationLimit",type:"number",label:"iterations",def:-1,omitIfNegative:!0}]};(function(){for(var a in ElkLayoutBindings.DIALOG_FIELDS)ElkLayoutBindings.DIALOG_FIELDS[a].push({key:"groupPadding",type:"number",label:"groupPadding",def:"",runOption:!0})})();
-ElkLayoutBindings.runWithDialog=function(a,b,k,v,m,w){ElkLayout._loadSettings();var c=ElkLayout.DIALOG_FIELDS[b]||[],e=ElkLayout.SETTINGS[b]||{},x=a.editor.graph,q=x.getSelectionCells(),n=ElkLayout.MAX_ROOTS[b]||0,E=[],g="function"===typeof m?null:a.getSelectedLayoutContainer();if(0<n&&("function"===typeof m||null==g))for(var z=0;z<q.length&&E.length<n;z++)x.model.isVertex(q[z])&&E.push(q[z]);q=document.createElement("div");n=document.createElement("h3");mxUtils.write(n,v||mxResources.get("layout"));
-q.appendChild(n);n=document.createElement("div");n.className="geDialogSection";z=document.createElement("div");z.className="geDialogSection";var I=document.createElement("div");I.className="geDialogSection";if("force"===b||"stress"===b){var r=document.createElement("div");r.className="geDialogFormRow";var d=document.createElement("span");d.className="geDialogFormLabel";d.style.minWidth="140px";d.style.marginRight="8px";mxUtils.write(d,mxResources.get("method")+":");r.appendChild(d);var J=document.createElement("select");
-J.style.marginLeft="0";d=document.createElement("option");d.value="force";mxUtils.write(d,mxResources.get("forceDirected"));"force"===b&&(d.selected=!0);J.appendChild(d);d=document.createElement("option");d.value="stress";mxUtils.write(d,mxResources.get("stress"));"stress"===b&&(d.selected=!0);J.appendChild(d);r.appendChild(J);n.appendChild(r);mxEvent.addListener(J,"change",function(){var t=J.value;t!==b&&(a.hideDialog(),ElkLayout.runWithDialog(a,t,k,v,m,w))})}var M={};for(r=0;r<c.length;r++){d=c[r];
-var K=document.createElement("div");K.className="geDialogFormRow";var D=document.createElement("span");D.className="geDialogFormLabel";D.style.minWidth="140px";D.style.marginRight="8px";mxUtils.write(D,mxResources.get(d.label)+":");K.appendChild(D);D=null!=e[d.key]?e[d.key]:d.def;if("groupPadding"===d.key&&null!=g){var u=x.getCellStyle(g).groupPadding;if(null!=u){try{u=decodeURIComponent(String(u))}catch(t){}D=u}}if("select"===d.type){u=document.createElement("select");for(var N=0;N<d.choices.length;N++){var O=
-d.choices[N],L=document.createElement("option");L.value=O.value;mxUtils.write(L,mxResources.get(O.label));String(D)===String(O.value)&&(L.selected=!0);u.appendChild(L)}u.style.marginLeft="0"}else u=document.createElement("input"),u.setAttribute("type","text"),u.value=String(D);K.appendChild(u);n.appendChild(K);M[d.key]={input:u,type:d.type,omitIfNegative:!0===d.omitIfNegative,runOption:!0===d.runOption}}c=function(t,A,f,y,h){var F=document.createElement("div");F.className="geDialogFormRow";var p=
-document.createElement("span");p.className="geDialogFormLabel";p.style.minWidth="140px";p.style.marginRight="8px";mxUtils.write(p,mxResources.get(A)+":");F.appendChild(p);A=document.createElement("select");A.style.marginLeft="0";y=y||h;for(h=0;h<f.length;h++)p=document.createElement("option"),p.value=f[h].value,mxUtils.write(p,mxResources.get(f[h].label)),f[h].value===y&&(p.selected=!0),A.appendChild(p);F.appendChild(A);t.appendChild(F);return A};var P="layered"===b,Q=null,R=null;P?Q=c(z,"connector",
-[{value:"orthogonal",label:"orthogonal"},{value:"polyline",label:"polyline"}],"orthogonalStrict"===e.__connector?"orthogonal":e.__connector,"orthogonal"):R=c(z,"edgeStyle",[{value:"auto",label:"automatic"},{value:"keep",label:"keepStyle"},{value:"orthogonal",label:"orthogonal"},{value:"straight",label:"straight"}],e.__edgeStyle,"auto");var S=c(z,"corners",[{value:"keep",label:"keepStyle"},{value:"straight",label:"straight"},{value:"rounded",label:"rounded"},{value:"curved",label:"curved"}],e.__corners,
+ElkLayoutBindings.runWithDialog=function(a,b,k,w,m,x){ElkLayout._loadSettings();var c=ElkLayout.DIALOG_FIELDS[b]||[],e=ElkLayout.SETTINGS[b]||{},y=a.editor.graph,r=y.getSelectionCells(),n=ElkLayout.MAX_ROOTS[b]||0,E=[],p="function"===typeof m?[]:a.getSelectedLayoutContainers(),g=0<p.length?p[0]:null;if(0<n&&("function"===typeof m||null==g))for(p=0;p<r.length&&E.length<n;p++)y.model.isVertex(r[p])&&E.push(r[p]);r=document.createElement("div");n=document.createElement("h3");mxUtils.write(n,w||mxResources.get("layout"));
+r.appendChild(n);n=document.createElement("div");n.className="geDialogSection";p=document.createElement("div");p.className="geDialogSection";var I=document.createElement("div");I.className="geDialogSection";if("force"===b||"stress"===b){var t=document.createElement("div");t.className="geDialogFormRow";var d=document.createElement("span");d.className="geDialogFormLabel";d.style.minWidth="140px";d.style.marginRight="8px";mxUtils.write(d,mxResources.get("method")+":");t.appendChild(d);var J=document.createElement("select");
+J.style.marginLeft="0";d=document.createElement("option");d.value="force";mxUtils.write(d,mxResources.get("forceDirected"));"force"===b&&(d.selected=!0);J.appendChild(d);d=document.createElement("option");d.value="stress";mxUtils.write(d,mxResources.get("stress"));"stress"===b&&(d.selected=!0);J.appendChild(d);t.appendChild(J);n.appendChild(t);mxEvent.addListener(J,"change",function(){var u=J.value;u!==b&&(a.hideDialog(),ElkLayout.runWithDialog(a,u,k,w,m,x))})}var M={};for(t=0;t<c.length;t++){d=c[t];
+var K=document.createElement("div");K.className="geDialogFormRow";var D=document.createElement("span");D.className="geDialogFormLabel";D.style.minWidth="140px";D.style.marginRight="8px";mxUtils.write(D,mxResources.get(d.label)+":");K.appendChild(D);D=null!=e[d.key]?e[d.key]:d.def;if("groupPadding"===d.key&&null!=g){var v=y.getCellStyle(g).groupPadding;if(null!=v){try{v=decodeURIComponent(String(v))}catch(u){}D=v}}if("select"===d.type){v=document.createElement("select");for(var N=0;N<d.choices.length;N++){var O=
+d.choices[N],L=document.createElement("option");L.value=O.value;mxUtils.write(L,mxResources.get(O.label));String(D)===String(O.value)&&(L.selected=!0);v.appendChild(L)}v.style.marginLeft="0"}else v=document.createElement("input"),v.setAttribute("type","text"),v.value=String(D);K.appendChild(v);n.appendChild(K);M[d.key]={input:v,type:d.type,omitIfNegative:!0===d.omitIfNegative,runOption:!0===d.runOption}}c=function(u,A,f,z,h){var F=document.createElement("div");F.className="geDialogFormRow";var q=
+document.createElement("span");q.className="geDialogFormLabel";q.style.minWidth="140px";q.style.marginRight="8px";mxUtils.write(q,mxResources.get(A)+":");F.appendChild(q);A=document.createElement("select");A.style.marginLeft="0";z=z||h;for(h=0;h<f.length;h++)q=document.createElement("option"),q.value=f[h].value,mxUtils.write(q,mxResources.get(f[h].label)),f[h].value===z&&(q.selected=!0),A.appendChild(q);F.appendChild(A);u.appendChild(F);return A};var P="layered"===b,Q=null,R=null;P?Q=c(p,"connector",
+[{value:"orthogonal",label:"orthogonal"},{value:"polyline",label:"polyline"}],"orthogonalStrict"===e.__connector?"orthogonal":e.__connector,"orthogonal"):R=c(p,"edgeStyle",[{value:"auto",label:"automatic"},{value:"keep",label:"keepStyle"},{value:"orthogonal",label:"orthogonal"},{value:"straight",label:"straight"}],e.__edgeStyle,"auto");var S=c(p,"corners",[{value:"keep",label:"keepStyle"},{value:"straight",label:"straight"},{value:"rounded",label:"rounded"},{value:"curved",label:"curved"}],e.__corners,
P?(ElkLayout.CANONICAL_EDGE||{}).corners||"rounded":"keep");g=!0===e.__resize;c=document.createElement("div");c.className="geDialogCheckRow";var G=document.createElement("input");G.setAttribute("type","checkbox");G.id="geElkResize";g&&(G.checked=!0);c.appendChild(G);g=document.createElement("label");g.setAttribute("for",G.id);mxUtils.write(g,mxResources.get("resizeNodes"));c.appendChild(g);I.appendChild(c);c=document.createElement("div");c.className="geDialogCheckRow";var H=document.createElement("input");
H.setAttribute("type","checkbox");H.id="geElkPreserveOrigin";!1!==e.__preserveOrigin&&(H.checked=!0);c.appendChild(H);g=document.createElement("label");g.setAttribute("for",H.id);mxUtils.write(g,mxResources.get("preserveOrigin"));c.appendChild(g);I.appendChild(c);var B=null;"mrtree"===b&&(c=document.createElement("div"),c.className="geDialogCheckRow",B=document.createElement("input"),B.setAttribute("type","checkbox"),B.id="geElkSharedStems",!1!==e.__sharedStems&&(B.checked=!0),c.appendChild(B),g=
-document.createElement("label"),g.setAttribute("for",B.id),mxUtils.write(g,mxResources.get("sharedStems")),c.appendChild(g),I.appendChild(c));var C=null;if(0<E.length){c=document.createElement("div");c.className="geDialogCheckRow";C=document.createElement("input");C.setAttribute("type","checkbox");C.id="geElkRoot";g=!1;for(r=0;r<E.length;r++)if(0<x.model.getEdgeCount(E[r])){g=!0;break}if(g||!0===e.__root)C.checked=!0;c.appendChild(C);e=document.createElement("label");e.setAttribute("for",C.id);mxUtils.write(e,
-mxResources.get(1===E.length?"useSelectionAsRoot":"useSelectionAsRoots"));c.appendChild(e);I.appendChild(c)}0<n.childNodes.length&&q.appendChild(n);q.appendChild(z);q.appendChild(I);e=null;isLocalStorage&&(e=mxUtils.button(mxResources.get("reset"),function(){delete ElkLayout.SETTINGS[b];ElkLayout._saveSettings();a.hideDialog();ElkLayout.runWithDialog(a,b,k,v,m,w)}),e.className="geBtn");e=new CustomDialog(a,q,function(){var t={},A={},f={};for(l in M){var y=M[l],h=y.input.value;if(y.runOption)h=String(h).trim(),
-""!==h&&(y=parseFloat(h),A[l]=String(y)===h?y:h,f[l]=h);else{if("number"===y.type){var F=parseFloat(h);if(isNaN(F))continue;h=String(F);if(y.omitIfNegative&&0>F){f[l]=h;continue}}t[l]=h;f[l]=h}}if(null!=k)for(var p in k)t[p]=k[p];f.__resize=!!G.checked;f.__root=null!=C&&C.checked;f.__corners=S.value;f.__preserveOrigin=!!H.checked;null!=B&&(f.__sharedStems=!!B.checked);if(P){var l=Q.value;f.__connector=l;"polyline"===l?(t["elk.edgeRouting"]="POLYLINE",l="straight"):(t["elk.edgeRouting"]="ORTHOGONAL",
-l=(ElkLayout.CANONICAL_EDGE||{}).edgeStyleMode||"orthogonalEdgeStyle")}else l=R.value,f.__edgeStyle=l;ElkLayout.SETTINGS[b]=f;ElkLayout._saveSettings();f={applierOptions:{resizeParent:!!G.checked},edgeStyleMode:l,corners:S.value,preserveOrigin:!!H.checked};for(var T in A)f[T]=A[T];null!=C&&C.checked&&0<E.length&&(f.rootCellIds=E.map(function(U){return U.id}));null==B||B.checked||(f.sharedStems=!1);"function"===typeof m?m(t,f):ElkLayout.run(a,b,t,f)},w||null,mxResources.get("apply"),ElkLayout.HELP_URL+
+document.createElement("label"),g.setAttribute("for",B.id),mxUtils.write(g,mxResources.get("sharedStems")),c.appendChild(g),I.appendChild(c));var C=null;if(0<E.length){c=document.createElement("div");c.className="geDialogCheckRow";C=document.createElement("input");C.setAttribute("type","checkbox");C.id="geElkRoot";g=!1;for(t=0;t<E.length;t++)if(0<y.model.getEdgeCount(E[t])){g=!0;break}if(g||!0===e.__root)C.checked=!0;c.appendChild(C);e=document.createElement("label");e.setAttribute("for",C.id);mxUtils.write(e,
+mxResources.get(1===E.length?"useSelectionAsRoot":"useSelectionAsRoots"));c.appendChild(e);I.appendChild(c)}0<n.childNodes.length&&r.appendChild(n);r.appendChild(p);r.appendChild(I);e=null;isLocalStorage&&(e=mxUtils.button(mxResources.get("reset"),function(){delete ElkLayout.SETTINGS[b];ElkLayout._saveSettings();a.hideDialog();ElkLayout.runWithDialog(a,b,k,w,m,x)}),e.className="geBtn");e=new CustomDialog(a,r,function(){var u={},A={},f={};for(l in M){var z=M[l],h=z.input.value;if(z.runOption)h=String(h).trim(),
+""!==h&&(z=parseFloat(h),A[l]=String(z)===h?z:h,f[l]=h);else{if("number"===z.type){var F=parseFloat(h);if(isNaN(F))continue;h=String(F);if(z.omitIfNegative&&0>F){f[l]=h;continue}}u[l]=h;f[l]=h}}if(null!=k)for(var q in k)u[q]=k[q];f.__resize=!!G.checked;f.__root=null!=C&&C.checked;f.__corners=S.value;f.__preserveOrigin=!!H.checked;null!=B&&(f.__sharedStems=!!B.checked);if(P){var l=Q.value;f.__connector=l;"polyline"===l?(u["elk.edgeRouting"]="POLYLINE",l="straight"):(u["elk.edgeRouting"]="ORTHOGONAL",
+l=(ElkLayout.CANONICAL_EDGE||{}).edgeStyleMode||"orthogonalEdgeStyle")}else l=R.value,f.__edgeStyle=l;ElkLayout.SETTINGS[b]=f;ElkLayout._saveSettings();f={applierOptions:{resizeParent:!!G.checked},edgeStyleMode:l,corners:S.value,preserveOrigin:!!H.checked};for(var T in A)f[T]=A[T];null!=C&&C.checked&&0<E.length&&(f.rootCellIds=E.map(function(U){return U.id}));null==B||B.checked||(f.sharedStems=!1);"function"===typeof m?m(u,f):ElkLayout.run(a,b,u,f)},x||null,mxResources.get("apply"),ElkLayout.HELP_URL+
(ElkLayout.HELP_ANCHORS[b]||""),e);a.showDialog(e.container,360,null,!0,!0)};
-var installElkLibavoidRelease=function(a){var b=a.prototype._applyResult;a.prototype._applyResult=function(k,v,m){b.apply(this,arguments);"keep"!==this.edgeStyleMode&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.releaseEdges&&LibavoidRouting.releaseEdges(this.graph,k,this._effectiveCellFilter)}},installElkNonTreeRouting=function(a){a.prototype.canRouteNonTreeEdges=function(b,k){if("undefined"===typeof LibavoidRouting)return!1;if(null!=window.Avoid)return!0;if(null!=window.__libavoidReady&&
-!this.__nonTreeUpgradeKicked){this.__nonTreeUpgradeKicked=!0;var v=this.graph;window.__libavoidReady.then(function(m){null!=m&&null!=b&&v.getModel().contains(b)&&null!=v.layoutManager&&v.layoutManager.executeLayout(b,!1)})}return!1};a.prototype.routeNonTreeEdges=function(b,k){LibavoidRouting.routeCells(this.graph,window.Avoid,k,null,!1)}};elkLayoutLoaded&&(installElkLibavoidRelease(ElkLayout),installElkNonTreeRouting(ElkLayout));
+var installElkLibavoidRelease=function(a){var b=a.prototype._applyResult;a.prototype._applyResult=function(k,w,m){b.apply(this,arguments);"keep"!==this.edgeStyleMode&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.releaseEdges&&LibavoidRouting.releaseEdges(this.graph,k,this._effectiveCellFilter)}},installElkNonTreeRouting=function(a){a.prototype.canRouteNonTreeEdges=function(b,k){if("undefined"===typeof LibavoidRouting)return!1;if(null!=window.Avoid)return!0;if(null!=window.__libavoidReady&&
+!this.__nonTreeUpgradeKicked){this.__nonTreeUpgradeKicked=!0;var w=this.graph;window.__libavoidReady.then(function(m){null!=m&&null!=b&&w.getModel().contains(b)&&null!=w.layoutManager&&w.layoutManager.executeLayout(b,!1)})}return!1};a.prototype.routeNonTreeEdges=function(b,k){LibavoidRouting.routeCells(this.graph,window.Avoid,k,null,!1)}};elkLayoutLoaded&&(installElkLibavoidRelease(ElkLayout),installElkNonTreeRouting(ElkLayout));
if(!elkLayoutLoaded)var elkAttachTries=0,elkAttachPoll=setInterval(function(){if("undefined"!==typeof ElkLayout&&null!=ElkLayout){clearInterval(elkAttachPoll);for(var a in ElkLayoutBindings)ElkLayout[a]=ElkLayoutBindings[a];installElkLibavoidRelease(ElkLayout);installElkNonTreeRouting(ElkLayout)}else 600<++elkAttachTries&&(clearInterval(elkAttachPoll),null!=window.console&&console.error("drawio-elk.min.js (ElkLayout) failed to load; Arrange > Layout ELK menu items are disabled."))},30);
-/*! @drawio/mermaid 0.1.0+commit.be7192b (built 2026-08-26) */
+/*! @drawio/mermaid 0.1.0+commit.7003579 (built 2026-09-08) */
var Mermaid=(()=>{var $i=Object.defineProperty;var Mg=Object.getOwnPropertyDescriptor;var _g=Object.getOwnPropertyNames,eh=Object.getOwnPropertySymbols;var ah=Object.prototype.hasOwnProperty,Tg=Object.prototype.propertyIsEnumerable;var rh=(L,j,P)=>j in L?$i(L,j,{enumerable:!0,configurable:!0,writable:!0,value:P}):L[j]=P,Bo=(L,j)=>{for(var P in j||(j={}))ah.call(j,P)&&rh(L,P,j[P]);if(eh)for(var P of eh(j))Tg.call(j,P)&&rh(L,P,j[P]);return L};var nh=(L,j)=>{for(var P in j)$i(L,P,{get:j[P],enumerable:!0})},Sg=(L,j,P,E)=>{if(j&&typeof j=="object"||typeof j=="function")for(let w of _g(j))!ah.call(L,w)&&w!==P&&$i(L,w,{get:()=>j[w],enumerable:!(E=Mg(j,w))||E.enumerable});return L};var Ag=L=>Sg($i({},"__esModule",{value:!0}),L);var s2={};nh(s2,{default:()=>o2});var Cs={};nh(Cs,{MermaidCellFactory:()=>Oa,MermaidLayout:()=>xi,MermaidLexer:()=>Ua,MermaidParser:()=>si,mxMermaidToDrawio:()=>Ya});var Ua=(function(){function L(s){this.input=s,this.pos=0,this.line=1,this.col=1,this.len=s.length}L.prototype.peek=function(s){return this.input[this.pos+(s||0)]||""},L.prototype.peekStr=function(s){return this.input.substring(this.pos,this.pos+s)},L.prototype.advance=function(s){s=s||1;for(var o=0;o<s&&this.pos<this.len;o++)this.input[this.pos]===`
`?(this.line++,this.col=1):this.col++,this.pos++},L.prototype.isEof=function(){return this.pos>=this.len},L.prototype.skipSpaces=function(){for(;this.pos<this.len;){var s=this.input[this.pos];if(s===" "||s===" ")this.advance();else break}},L.prototype.skipWhitespace=function(){for(;this.pos<this.len;){var s=this.input[this.pos];if(s===" "||s===" "||s===`
`||s==="\r")this.advance();else break}},L.prototype.skipWhitespaceAndComments=function(){for(;this.pos<this.len&&(this.skipWhitespace(),this.peekStr(2)==="%%"&&this.peekStr(3)!=="%%{");)this.skipToEol()},L.prototype.skipToEol=function(){for(;this.pos<this.len&&this.input[this.pos]!==`
-`;)this.advance();this.pos<this.len&&this.advance()},L.prototype.readUntil=function(s){for(var o=this.pos,v=s.length;this.pos<this.len;){if(this.input.substring(this.pos,this.pos+v)===s){var M=this.input.substring(o,this.pos);return this.advance(v),M}this.advance()}return this.input.substring(o)},L.prototype.readQuoted=function(){var s=this.input[this.pos];if(s!=='"'&&s!=="'"&&s!=="`")return null;this.advance();for(var o="";this.pos<this.len;){var v=this.input[this.pos];if(v==="\\"&&this.pos+1<this.len)o+=this.input[this.pos+1],this.advance(2);else{if(v===s)return this.advance(),P(o);o+=v,this.advance()}}return P(o)};var j={quot:'"',apos:"'",amp:"&",lt:"<",gt:">",nbsp:"\xA0",copy:"\xA9",reg:"\xAE",hearts:"\u2665",spades:"\u2660",clubs:"\u2663",diams:"\u2666"};function P(s){return!s||s.indexOf("#")<0?s:s.replace(/#(\w+);/g,function(o,v){return/^\d+$/.test(v)?String.fromCharCode(parseInt(v,10)):/^x[0-9a-f]+$/i.test(v)?String.fromCharCode(parseInt(v.substring(1),16)):j[v]!=null?j[v]:o})}L.prototype.readWord=function(){for(var s=this.pos;this.pos<this.len;){var o=this.input[this.pos];if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o>="0"&&o<="9"||o==="_"||o==="-")this.advance();else break}return this.input.substring(s,this.pos)},L.prototype.readId=function(){var s=this.pos,o=this.peek();if(o==='"'||o==="'"||o==="`")return this.readQuoted();for(;this.pos<this.len;){o=this.input[this.pos];var v=o.charCodeAt(0);if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o>="0"&&o<="9"||o==="_"||o==="-"||o==="."||o==="/"||v>127)this.advance();else break}return this.input.substring(s,this.pos)},L.prototype.match=function(s){return this.input.substring(this.pos,this.pos+s.length)===s?(this.advance(s.length),!0):!1},L.prototype.matchI=function(s){return this.input.substring(this.pos,this.pos+s.length).toLowerCase()===s.toLowerCase()?(this.advance(s.length),!0):!1},L.prototype.expect=function(s){if(!this.match(s))throw new Error('Expected "'+s+'" at line '+this.line+", col "+this.col+' but found "'+this.peekStr(Math.min(s.length+5,20))+'"')},L.prototype.readLine=function(){for(var s=this.pos;this.pos<this.len&&this.input[this.pos]!==`
+`;)this.advance();this.pos<this.len&&this.advance()},L.prototype.readUntil=function(s){for(var o=this.pos,d=s.length;this.pos<this.len;){if(this.input.substring(this.pos,this.pos+d)===s){var M=this.input.substring(o,this.pos);return this.advance(d),M}this.advance()}return this.input.substring(o)},L.prototype.readQuoted=function(){var s=this.input[this.pos];if(s!=='"'&&s!=="'"&&s!=="`")return null;this.advance();for(var o="";this.pos<this.len;){var d=this.input[this.pos];if(d==="\\"&&this.pos+1<this.len)o+=this.input[this.pos+1],this.advance(2);else{if(d===s)return this.advance(),P(o);o+=d,this.advance()}}return P(o)};var j={quot:'"',apos:"'",amp:"&",lt:"<",gt:">",nbsp:"\xA0",copy:"\xA9",reg:"\xAE",hearts:"\u2665",spades:"\u2660",clubs:"\u2663",diams:"\u2666"};function P(s){return!s||s.indexOf("#")<0?s:s.replace(/#(\w+);/g,function(o,d){return/^\d+$/.test(d)?String.fromCharCode(parseInt(d,10)):/^x[0-9a-f]+$/i.test(d)?String.fromCharCode(parseInt(d.substring(1),16)):j[d]!=null?j[d]:o})}L.prototype.readWord=function(){for(var s=this.pos;this.pos<this.len;){var o=this.input[this.pos];if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o>="0"&&o<="9"||o==="_"||o==="-")this.advance();else break}return this.input.substring(s,this.pos)},L.prototype.readId=function(){var s=this.pos,o=this.peek();if(o==='"'||o==="'"||o==="`")return this.readQuoted();for(;this.pos<this.len;){o=this.input[this.pos];var d=o.charCodeAt(0);if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o>="0"&&o<="9"||o==="_"||o==="-"||o==="."||o==="/"||d>127)this.advance();else break}return this.input.substring(s,this.pos)},L.prototype.match=function(s){return this.input.substring(this.pos,this.pos+s.length)===s?(this.advance(s.length),!0):!1},L.prototype.matchI=function(s){return this.input.substring(this.pos,this.pos+s.length).toLowerCase()===s.toLowerCase()?(this.advance(s.length),!0):!1},L.prototype.expect=function(s){if(!this.match(s))throw new Error('Expected "'+s+'" at line '+this.line+", col "+this.col+' but found "'+this.peekStr(Math.min(s.length+5,20))+'"')},L.prototype.readLine=function(){for(var s=this.pos;this.pos<this.len&&this.input[this.pos]!==`
`&&this.input[this.pos]!=="\r";)this.advance();var o=this.input.substring(s,this.pos);return this.pos<this.len&&this.input[this.pos]==="\r"&&this.advance(),this.pos<this.len&&this.input[this.pos]===`
`&&this.advance(),o},L.prototype.isEol=function(){return this.isEof()||this.input[this.pos]===`
-`||this.input[this.pos]==="\r"},L.prototype.save=function(){return{pos:this.pos,line:this.line,col:this.col}},L.prototype.restore=function(s){this.pos=s.pos,this.line=s.line,this.col=s.col},L.prototype.readBalanced=function(s,o){if(this.input[this.pos]!==s)return null;this.advance();for(var v=1,M=this.pos;this.pos<this.len&&v>0;){var f=this.input[this.pos];if(f===s)v++;else if(f===o){if(v--,v===0){var u=this.input.substring(M,this.pos);return this.advance(),u}}else if(f==='"'||f==="'"){var r=f;for(this.advance();this.pos<this.len&&this.input[this.pos]!==r;)this.input[this.pos]==="\\"&&this.advance(),this.advance();this.pos<this.len&&this.advance();continue}this.advance()}return this.input.substring(M)},L.prototype.parseDirective=function(){if(this.peekStr(3)!=="%%{")return null;this.advance(3);var s=this.readUntil("}%%");try{var o=s.indexOf(":");if(o>=0){var v=s.substring(0,o).trim(),M=s.substring(o+1).trim();if(v==="init"||v==="initialize")try{return JSON.parse(M)}catch(f){return JSON.parse(M.replace(/'/g,'"'))}}}catch(f){}return null},L.prototype.parseFrontmatter=function(){if(this.peekStr(3)!=="---")return null;this.advance(3),this.pos<this.len&&this.input[this.pos]==="\r"&&this.advance(),this.pos<this.len&&this.input[this.pos]===`
-`&&this.advance();var s=this.readUntil("---");try{return E(s)}catch(o){return null}},L.prototype.parseClassDef=function(){this.skipSpaces();var s=this.readWord();if(!s)return null;this.skipSpaces();var o=this.readLine().trim();return{name:s,styles:o}},L.prototype.parseStyleDef=function(){this.skipSpaces();for(var s=[],o=this.readId();o&&(s.push(o),this.skipSpaces(),this.peek()===",");)this.advance(),this.skipSpaces(),o=this.readId();this.skipSpaces();var v=this.readLine().trim();return{nodeIds:s,styles:v}},L.prototype.parseClick=function(){this.skipSpaces();var s=this.readId();if(!s)return null;this.skipSpaces();var o=null,v=null,M=null,f=this.readWord();f==="href"||f==="call"?(o=f,this.skipSpaces(),this.peek()==='"'||this.peek()==="'"?v=this.readQuoted():v=this.readWord()):this.peek()==='"'||this.peek()==="'"?(o="href",v=this.readQuoted()):(o="callback",v=f),this.skipSpaces(),(this.peek()==='"'||this.peek()==="'")&&(M=this.readQuoted()),this.skipSpaces();var u=null;if(this.peek()==="_"){var r=this.readWord();(r==="_blank"||r==="_self"||r==="_parent"||r==="_top")&&(u=r)}for(;!this.isEof()&&!this.isEol();){if(this.peek()===";"){this.advance();break}this.advance()}return{nodeId:s,action:o,url:v,tooltip:M,linkTarget:u}};function E(s){for(var o={},v=s.split(`
-`),M=o,f=[{indent:-1,obj:o}],u=0;u<v.length;u++){var r=v[u],h=r.replace(/^\s+/,"");if(!(!h||h[0]==="#")){var d=r.length-r.replace(/^\s+/,"").length;if(h[0]==="-"&&h[1]===" "){for(;f.length>1&&f[f.length-1].indent>=d;)f.pop();if(M=f[f.length-1].obj,M._lastKey!=null){var n=M._lastKey;Array.isArray(M[n])||(M[n]=[]),M[n].push(p(h.substring(2).trim()))}continue}var y=h.indexOf(":");if(!(y<0)){for(var b=h.substring(0,y).trim(),T=h.substring(y+1).trim();f.length>1&&f[f.length-1].indent>=d;)f.pop();if(M=f[f.length-1].obj,T===""||T===null){var I={};M[b]=I,M._lastKey=b,f.push({indent:d,obj:I})}else M[b]=p(T),M._lastKey=b}}}return w(o),o}function w(s){if(s&&typeof s=="object"&&!Array.isArray(s)){delete s._lastKey;for(var o in s)s.hasOwnProperty(o)&&w(s[o])}}function p(s){if(s==="true")return!0;if(s==="false")return!1;if(s==="null")return null;if(s[0]==="["&&s[s.length-1]==="]")try{return JSON.parse(s)}catch(u){for(var o=s.substring(1,s.length-1).split(","),v=[],M=0;M<o.length;M++)v.push(p(o[M].trim()));return v}if(s[0]==="{"&&s[s.length-1]==="}")try{return JSON.parse(s)}catch(u){}var f=Number(s);return!isNaN(f)&&s!==""?f:s[0]==='"'&&s[s.length-1]==='"'||s[0]==="'"&&s[s.length-1]==="'"?s.substring(1,s.length-1):s}return L.decodeEntities=P,L})();var Ho=(function(){var L=[["(((",")))","doublecircle"],["((","))","circle"],["([","])","stadium"],["([-","-])","stadium"],["((","))","circle"],["(-","-)","circle"],["(",")","rounded"],["[[","]]","subroutine"],["[(",")]","cylinder"],["[/","/]","lean_right"],["[/","\\]","trapezoid"],["[\\","/]","inv_trapezoid"],["[\\","\\]","lean_left"],["[","]","rect"],["{{","}}","hexagon"],["{","}","diamond"],[">","]","odd"]],j={rectangle:"rect",rect:"rect",process:"rect",proc:"rect",rounded:"rounded",round:"rounded",stadium:"stadium",pill:"stadium",terminal:"terminal",subroutine:"subroutine",subprocess:"subroutine",subproc:"subroutine","framed-rectangle":"subroutine","fr-rect":"subroutine",database:"cylinder",cylinder:"cylinder",cyl:"cylinder",db:"cylinder",circle:"circle",circ:"circle",diamond:"diamond",decision:"diamond",diam:"diamond",hexagon:"hexagon",hex:"hexagon",prepare:"hexagon",parallelogram:"lean_right","lean-right":"lean_right","lean-r":"lean_right","in-out":"lean_right","parallelogram-alt":"lean_left","lean-left":"lean_left","lean-l":"lean_left","out-in":"lean_left",trapezoid:"trapezoid","trap-b":"trapezoid",priority:"trapezoid","trapezoid-bottom":"trapezoid","trapezoid-top":"inv_trapezoid","inv-trapezoid":"inv_trapezoid",manual:"inv_trapezoid","trap-t":"inv_trapezoid","double-circle":"doublecircle","dbl-circ":"doublecircle","framed-circle":"doublecircle","fr-circ":"doublecircle",stop:"doublecircle",odd:"odd",odd_right:"odd",flag:"paper-tape","paper-tape":"paper-tape",document:"doc",doc:"doc",delay:"delay","half-rounded-rectangle":"delay","horizontal-cylinder":"das","h-cyl":"das",das:"das","lined-cylinder":"lin-cyl",disk:"lin-cyl","lin-cyl":"lin-cyl","curved-trapezoid":"curv-trap",display:"curv-trap","curv-trap":"curv-trap","divided-process":"div-rect","divided-rectangle":"div-rect","div-rect":"div-rect","div-proc":"div-rect",triangle:"tri",extract:"tri",tri:"tri","window-pane":"win-pane","internal-storage":"win-pane","win-pane":"win-pane","lined-document":"lin-doc","lin-doc":"lin-doc","notched-pentagon":"notch-pent","loop-limit":"notch-pent","notch-pent":"notch-pent","flipped-triangle":"flip-tri","flip-tri":"flip-tri","bow-tie-rectangle":"bow-rect","stored-data":"bow-rect","bow-rect":"bow-rect","crossed-circle":"cross-circ",summary:"cross-circ","cross-circ":"cross-circ","tagged-document":"tag-doc","tag-doc":"tag-doc","tagged-rectangle":"tag-rect","tagged-process":"tag-rect","tag-rect":"tag-rect","tag-proc":"tag-rect","stacked-document":"docs",documents:"docs",docs:"docs","st-doc":"docs","stacked-rectangle":"procs",processes:"procs",procs:"procs","st-rect":"procs","notched-rectangle":"notch-rect",card:"notch-rect","notch-rect":"notch-rect","lined-process":"lin-rect","lined-rectangle":"lin-rect","shaded-process":"lin-rect","lin-rect":"lin-rect","lin-proc":"lin-rect","small-circle":"sm-circ","sm-circ":"sm-circ","filled-circle":"start","f-circ":"start",junction:"start",hourglass:"hourglass",collate:"hourglass",brace:"brace-l","brace-l":"brace-l",comment:"brace-l","brace-r":"brace-r",braces:"braces","lightning-bolt":"bolt",bolt:"bolt","com-link":"bolt",text:"text","manual-file":"manual-file","manual-input":"manual-input","sloped-rectangle":"manual-input","sl-rect":"manual-input","off-page-connector":"manual-file"};function P(_){return _===">"||_==="x"||_==="o"}function E(_){return _==="x"?"arrow_cross":_==="o"?"arrow_circle":"arrow_point"}function w(_){throw new Error("Lexical error on line "+_.line+", col "+_.col+': unrecognized text "'+_.input.substring(_.pos,_.pos+20).replace(/\n/g," ")+'"')}function p(_,l){throw new Error("Parse error on line "+l+": expected edge text before the closing link")}function s(_){for(_.advance();!_.isEof()&&_.peek()!=='"';)_.advance();_.isEof()||_.advance()}function o(_,l){var O=_.input.substring(l,_.pos).replace(/\r\n/g,`
-`).trim();return O.length>0?O:null}function v(_,l){for(var O=_.pos,z=_.line;;){if(_.isEof())throw new Error("Unclosed edge text starting on line "+z+': expected a closing "'+l+l+'" link');var lt=_.peek();if(lt==='"'){s(_);continue}for(var W=lt==="x"||lt==="o"||lt==="<"?1:0,pt=0;_.peek(W+pt)===l;)pt++;if(pt>=3||pt===2&&P(_.peek(W+pt))){var mt=o(_,O);return mt==null&&p(_,z),W===1&&_.advance(),{text:mt,startMarker:W===1?lt:null}}W===0&&(pt===2||pt===1&&l==="=")&&w(_),_.advance()}}function M(_){for(var l=_.pos,O=_.line;;){if(_.isEof())throw new Error("Unclosed edge text starting on line "+O+': expected a closing ".-" link');var z=_.peek();if(z==='"'){s(_);continue}var lt=z==="x"||z==="o"||z==="<",W=lt?1:0;_.peek(W)==="-"&&W++;for(var pt=0;_.peek(W+pt)===".";)pt++;if(pt>0&&_.peek(W+pt)==="-"){var mt=o(_,l);return mt==null&&p(_,O),_.advance(W+pt+1),{text:mt,startMarker:lt?z:null}}z==="."&&w(_),_.advance()}}function f(_){var l=_.save(),O=_.peek(),z="none",lt="none",W="solid",pt=null,mt=0;if(O==="<"?(z="arrow_point",_.advance(),O=_.peek()):O==="o"&&u(_.peek(1))?(z="arrow_circle",_.advance(),O=_.peek()):O==="x"&&u(_.peek(1))&&(z="arrow_cross",_.advance(),O=_.peek()),O==="-")if(_.peek(1)==="."){W="dotted",_.advance(2);for(var Tt=0;_.peek(Tt)===".";)Tt++;if(_.peek(Tt)==="-")_.advance(Tt+1);else{var Rt=M(_);pt=Rt.text,Rt.startMarker!=null&&z==="none"&&(z=E(Rt.startMarker))}}else{if(W="solid",_.advance(),mt=1,_.peek()!=="-")return _.restore(l),null;for(;_.peek()==="-";)_.advance(),mt++;if(mt===2&&!P(_.peek())){var Rt=v(_,"-");pt=Rt.text,Rt.startMarker!=null&&z==="none"&&(z=E(Rt.startMarker));for(var It=0;_.peek()==="-";)_.advance(),It++;mt=Math.max(mt,It)}}else if(O==="="){if(W="thick",_.advance(),mt=1,_.peek()!=="=")return _.restore(l),null;for(;_.peek()==="=";)_.advance(),mt++;if(mt===2&&!P(_.peek())){var Rt=v(_,"=");pt=Rt.text,Rt.startMarker!=null&&z==="none"&&(z=E(Rt.startMarker));for(var te=0;_.peek()==="=";)_.advance(),te++;mt=Math.max(mt,te)}}else if(O==="~"){W="invisible";for(var Qt=0;_.peek(Qt)==="~";)Qt++;return Qt<3&&w(_),_.advance(Qt),{arrowStart:"none",arrowEnd:"none",pattern:W,text:null}}else return _.restore(l),null;O=_.peek(),O===">"?(lt="arrow_point",_.advance()):O==="o"?(lt="arrow_circle",_.advance()):O==="x"&&(lt="arrow_cross",_.advance()),_.skipSpaces(),_.peek()==="|"&&(_.advance(),pt=_.readUntil("|")),pt!=null&&(pt=pt.trim(),(pt[0]==='"'&&pt[pt.length-1]==='"'||pt[0]==="'"&&pt[pt.length-1]==="'")&&(pt=pt.substring(1,pt.length-1)));var pe=lt!=null&&lt!=="none"||z!=null&&z!=="none",ue=pe?2:3,me=mt>ue?mt-(ue-1):1;return me<1&&(me=1),{arrowStart:z,arrowEnd:lt,pattern:W,text:pt,length:me}}function u(_){return _==="-"||_==="."||_==="="||_==="~"}function r(_){if(_==null||_===!1)return!1;if(_===!0)return!0;var l=(""+_).trim().toLowerCase();return l!==""&&l!=="false"&&l!=="0"&&l!=="none"&&l!=="off"}function h(_){var l=_.peek(),O=_.peek(1),z=_.peek(2);if(l==="@"&&O==="{"){_.advance();var lt=_.readBalanced("{","}");try{var W=y(lt),pt=W.shape||W.type||"rect",mt=W.label||W.text||"",Tt=W.icon||null,Rt=W.img||null,It=W.form||null,te=W.pos||null,Qt=W.h!=null?Number(W.h):null,pe=W.w!=null?Number(W.w):null,ue=j[pt]||pt;return Rt?ue="imageSquare":Tt&&(It==="circle"?ue="iconCircle":It==="square"?ue="iconSquare":It==="rounded"?ue="iconRounded":ue="icon"),{shape:ue,label:mt,icon:Tt,img:Rt,form:It,pos:te,assetH:Qt,assetW:pe}}catch(xr){return{shape:"rect",label:lt}}}if(l==="[")return d(_);for(var me=0;me<L.length;me++){var Ee=L[me][0],xe=L[me][1],ar=L[me][2];if(Ee[0]!=="["&&_.input.substring(_.pos,_.pos+Ee.length)===Ee){_.advance(Ee.length);var mt=n(_,xe);return{shape:ar,label:mt}}}return null}function d(_){var l=_.peek(1);if(l==="["){_.advance(2);var W=n(_,"]]");return{shape:"subroutine",label:W}}if(l==="("){_.advance(2);var W=n(_,")]");return{shape:"cylinder",label:W}}if(l==="/"||l==="\\"){_.advance(2);for(var O="",z=null;!_.isEof();){var lt=_.peek();if((lt==="/"||lt==="\\")&&_.peek(1)==="]"){z=lt,_.advance(2);break}if(lt==="]"){z=null,_.advance();break}O+=lt,_.advance()}var W=O.trim();return W.length>=2&&(W[0]==='"'&&W[W.length-1]==='"'||W[0]==="'"&&W[W.length-1]==="'")&&(W=W.substring(1,W.length-1)),l==="/"&&z==="/"?{shape:"lean_right",label:W}:l==="\\"&&z==="\\"?{shape:"lean_left",label:W}:l==="/"&&z==="\\"?{shape:"trapezoid",label:W}:l==="\\"&&z==="/"?{shape:"inv_trapezoid",label:W}:{shape:"lean_right",label:W}}_.advance(1);var W=n(_,"]");return{shape:"rect",label:W}}function n(_,l){for(var O="",z=l.length;!_.isEof();){if(_.input.substring(_.pos,_.pos+z)===l)return _.advance(z),O=O.trim(),O.length>=2&&(O[0]==='"'&&O[O.length-1]==='"'||O[0]==="'"&&O[O.length-1]==="'")&&(O=O.substring(1,O.length-1)),Ua.decodeEntities(O);O+=_.peek(),_.advance()}return Ua.decodeEntities(O)}function y(_){var l=_.replace(/(^|[{,])\s*([a-zA-Z_]\w*)\s*:/g,'$1"$2":');return l=l.replace(/'/g,'"'),l=l.replace(/:\s*([a-zA-Z][a-zA-Z0-9_-]*)\s*([,}]|$)/g,':"$1"$2'),JSON.parse("{"+l+"}")}function b(_){var l=_.peek();if(l==='"'||l==="'")return _.readQuoted();for(var O=_.pos;!_.isEof();){l=_.input[_.pos];var z=l.charCodeAt(0);if(l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||l==="_"||z>127)_.advance();else if(l==="-"){var lt=_.peek(1);if(lt==="-"||lt===">"||lt===".")break;_.advance()}else break}return _.input.substring(O,_.pos)}function T(_){var l=_.save(),O=b(_);if(O&&_.peek()==="@"){var z=_.peek(1);if(u(z)||z==="<"||(z==="o"||z==="x")&&u(_.peek(2)))return _.advance(),O}return _.restore(l),null}function I(_,l,O){var z=new Ua(_),lt={},W=[],pt=[],mt={},Tt={},Rt={},It={},te=[],Qt={},pe=[],ue=null;for(l=l||"TD",z.skipWhitespaceAndComments();!z.isEof()&&(z.skipWhitespaceAndComments(),!z.isEof());)F(z,lt,W,pt,mt,Tt,Rt,It,pe,te,Qt);return re(lt,mt,It),N(lt,Tt,pt),Q(lt,Rt),at(lt,W,pt,l,O,te,Qt)}function F(_,l,O,z,lt,W,pt,mt,Tt,Rt,It){if(_.skipSpaces(),_.isEol()||_.isEof()){(_.peek()===`
-`||_.peek()==="\r")&&_.advance();return}var te=_.save(),Qt=_.readWord();if(Qt==="subgraph"){dt(_,z,Tt);return}else if(Qt==="end"){if(Tt.length>0&&Tt.pop(),_.skipSpaces(),_.peek()===`
-`||_.peek()==="\r"||_.peek()===";"||_.isEof()){_.peek()===";"&&_.advance();return}_.restore(te)}else if(Qt==="classDef"){var pe=_.parseClassDef();pe&&(lt[pe.name]=pe.styles);return}else if(Qt==="style"){var pe=_.parseStyleDef();if(pe)for(var ue=0;ue<pe.nodeIds.length;ue++)W[pe.nodeIds[ue]]=(W[pe.nodeIds[ue]]||"")+pe.styles;return}else if(Qt==="click"){var pe=_.parseClick();pe&&(pt[pe.nodeId]=pe);return}else if(Qt==="class"){_.skipSpaces();for(var me=[],Ee=_.readId();Ee&&(me.push(Ee),_.skipSpaces(),_.peek()===",");)_.advance(),_.skipSpaces(),Ee=_.readId();_.skipSpaces();var xe=_.readWord();if(xe)for(var ue=0;ue<me.length;ue++)mt[me[ue]]||(mt[me[ue]]=[]),mt[me[ue]].push(xe);xt(_);return}else if(Qt==="direction"){_.skipSpaces();var ar=_.readWord();if(Tt.length>0&&ar){for(var xr=Tt[Tt.length-1],sr=z.length-1;sr>=0;sr--)if(z[sr].id===xr){z[sr].direction=ar.toUpperCase();break}}xt(_);return}else if(Qt==="linkStyle"){_.skipSpaces();var Qe=[],or=_.readWord();if(or==="default")Qe="default";else for(/^\d+$/.test(or)&&Qe.push(parseInt(or,10));_.skipSpaces(),_.peek()===",";){_.advance(),_.skipSpaces();var Wr=_.readWord();if(/^\d+$/.test(Wr))Qe.push(parseInt(Wr,10));else break}_.skipSpaces();for(var oa=_.pos;!_.isEof();){var Sr=_.peek();if(Sr===`
-`||Sr==="\r"||Sr===";")break;_.advance()}var Rr=_.input.substring(oa,_.pos).trim();xt(_),Rr&&(Qe==="default"||Qe.length>0)&&Rt.push({targets:Qe,css:Rr});return}else if(_.peek()==="@"&&_.peek(1)==="{"){_.advance();var Mr=_.readBalanced("{","}"),er=null;try{er=y(Mr)}catch(Xr){er=null}if(er&&("animate"in er||"animation"in er)){It[Qt]=er,xt(_);return}_.restore(te)}else _.restore(te);X(_,l,O,Tt)}function X(_,l,O,z){var lt=Z(_,l,z);if(!lt||lt.length===0){xt(_);return}for(;!_.isEof();){_.skipSpaces();var W=_.peek();if(W===`
-`||W==="\r"||W===";"||W===""||_.isEof()){W===";"&&_.advance();break}var pt=_.save(),mt=T(_),Tt=f(_);if(!Tt){_.restore(pt);break}_.skipSpaces();var Rt=Z(_,l,z);if(!Rt||Rt.length===0){_.restore(pt);break}for(var It=0;It<lt.length;It++)for(var te=0;te<Rt.length;te++)O.push({sourceId:lt[It],targetId:Rt[te],arrowStart:Tt.arrowStart,arrowEnd:Tt.arrowEnd,pattern:Tt.pattern,text:Tt.text,length:Tt.length||1,edgeId:mt});lt=Rt}}function Z(_,l,O){var z=[],lt=ot(_,l,O);if(!lt)return z;for(z.push(lt);!_.isEof();){var W=_.save();if(_.skipSpaces(),_.peek()!=="&"){_.restore(W);break}_.advance(),_.skipSpaces();var pt=ot(_,l,O);if(!pt){_.restore(W);break}z.push(pt)}return z}function ot(_,l,O){var z=b(_);if(!z)return null;var lt=h(_),W=null;if(_.peekStr(3)===":::"){_.advance(3);for(var pt=_.pos;!_.isEof();){var mt=_.input[_.pos];if(mt>="a"&&mt<="z"||mt>="A"&&mt<="Z"||mt>="0"&&mt<="9"||mt==="_")_.advance();else break}W=_.input.substring(pt,_.pos)}return l[z]?(lt&&(l[z].shape=lt.shape,l[z].label=lt.label,lt.icon&&(l[z].icon=lt.icon),lt.img&&(l[z].img=lt.img),lt.form&&(l[z].form=lt.form),lt.pos&&(l[z].pos=lt.pos),lt.assetH!=null&&(l[z].assetH=lt.assetH),lt.assetW!=null&&(l[z].assetW=lt.assetW)),W&&l[z].classes.push(W),O.length>0&&!l[z].subgraph&&(l[z].subgraph=O[O.length-1])):l[z]={id:z,shape:lt?lt.shape:"rect",label:lt?lt.label:z,icon:lt?lt.icon:null,img:lt?lt.img:null,form:lt?lt.form:null,pos:lt?lt.pos:null,assetH:lt?lt.assetH:null,assetW:lt?lt.assetW:null,classes:W?[W]:[],cssStyles:null,link:null,linkTarget:null,tooltip:null,subgraph:O.length>0?O[O.length-1]:null},z}function dt(_,l,O){_.skipSpaces();var z=null,lt=null,W=_.save(),pt=_.readLine().trim();pt[pt.length-1]===";"&&(pt=pt.substring(0,pt.length-1).trim());var mt=pt.indexOf("[");mt>=0?(z=pt.substring(0,mt).trim(),lt=pt.substring(mt+1),lt[lt.length-1]==="]"&&(lt=lt.substring(0,lt.length-1)),lt=lt.trim(),lt.length>=2&&(lt[0]==='"'&&lt[lt.length-1]==='"'||lt[0]==="'"&&lt[lt.length-1]==="'")&&(lt=lt.substring(1,lt.length-1))):(z=pt.trim(),lt=z,lt.length>=2&&(lt[0]==='"'&&lt[lt.length-1]==='"'||lt[0]==="'"&&lt[lt.length-1]==="'")&&(lt=lt.substring(1,lt.length-1),z=lt)),z||(z="subgraph_"+l.length);var Tt={id:z,label:mt>=0?lt:lt||z,parent:O.length>0?O[O.length-1]:null};l.push(Tt),O.push(z)}function xt(_){for(;!_.isEof();){var l=_.peek();if(l===`
-`||l==="\r"||l===";"){l===";"&&_.advance();return}_.advance()}}function re(_,l,O){if(l.default)for(var z in _)_[z].classes.length===0&&(_[z].cssStyles=(_[z].cssStyles||"")+l.default);for(var z in O)if(_[z])for(var lt=0;lt<O[z].length;lt++){var W=O[z][lt];l[W]&&(_[z].cssStyles=(_[z].cssStyles||"")+l[W])}for(var z in _)for(var pt=_[z],lt=0;lt<pt.classes.length;lt++){var W=pt.classes[lt];l[W]&&(pt.cssStyles=(pt.cssStyles||"")+l[W])}}function N(_,l,O){var z={};if(O)for(var lt=0;lt<O.length;lt++)z[O[lt].id]=O[lt];for(var W in l)_[W]?_[W].cssStyles=(_[W].cssStyles||"")+l[W]:z[W]&&(z[W].cssStyles=(z[W].cssStyles||"")+l[W])}function Q(_,l){for(var O in l)if(_[O]){var z=l[O];z.action==="href"&&(_[O].link=z.url,_[O].linkTarget=z.linkTarget||"_blank"),z.tooltip&&(_[O].tooltip=z.tooltip)}}function at(_,l,O,z,lt,W,pt){W=W||[],pt=pt||{};var mt;switch(z.toUpperCase()){case"LR":mt="RIGHT";break;case"RL":mt="LEFT";break;case"BT":mt="UP";break;case"TB":case"TD":default:mt="DOWN";break}for(var Tt={},Rt=[],It=0;It<O.length;It++){var te=O[It],Qt="DOWN",pe=!1;if(te.direction)switch(pe=!0,te.direction){case"LR":Qt="RIGHT";break;case"RL":Qt="LEFT";break;case"BT":Qt="UP";break;case"TB":case"TD":Qt="DOWN";break}Tt[te.id]={id:te.id,labels:[{text:te.label}],layoutOptions:{"elk.algorithm":"layered","elk.direction":Qt,"elk.hierarchyHandling":"INCLUDE_CHILDREN"},children:[],edges:[],drawio:{shape:"group",labelText:te.label,type:"group",cssStyles:te.cssStyles||null,isSubgraph:!0,autoDirection:!pe}},Rt.push(te.id)}for(var It=0;It<O.length;It++){var te=O[It];te.parent&&Tt[te.parent]&&Tt[te.parent].children.push(Tt[te.id])}var ue={};for(var me in _){var Ee=_[me];if(Tt[me]){Ee.label!=null&&Ee.label!==""&&Ee.label!==me&&(Tt[me].drawio.labelText=Ee.label,Tt[me].labels=[{text:Ee.label}]),Ee.cssStyles&&(Tt[me].drawio.cssStyles=Ee.cssStyles),ue[me]=Tt[me];continue}var xe={id:me,labels:[{text:Ee.label}],width:0,height:0,drawio:{shape:Ee.shape,labelText:Ee.label,cssStyles:Ee.cssStyles,link:Ee.link,linkTarget:Ee.linkTarget,tooltip:Ee.tooltip,icon:Ee.icon,img:Ee.img,form:Ee.form,pos:Ee.pos,assetH:Ee.assetH,assetW:Ee.assetW}};ue[me]=xe,Ee.subgraph&&Tt[Ee.subgraph]&&Tt[Ee.subgraph].children.push(xe)}for(var ar=[],It=0;It<O.length;It++)O[It].parent||ar.push(Tt[O[It].id]);for(var me in _)!_[me].subgraph&&!Tt[me]&&ar.push(ue[me]);for(var xr=0,sr=[],Qe={},It=0;It<O.length;It++)Qe[O[It].id]=O[It].parent||null;function or(la){for(var qr=[],ma=la,Ja=0;ma&&Ja++<1e3;)qr.push(ma),ma=Qe[ma];return qr}function Wr(la,qr){if(!la||!qr)return null;for(var ma={},Ja=or(qr),sn=0;sn<Ja.length;sn++)ma[Ja[sn]]=!0;for(var fn=or(la),Na=0;Na<fn.length;Na++)if(ma[fn[Na]])return fn[Na];return null}for(var oa={},Sr={},It=0;It<l.length;It++){var Rr=l[It];oa[Rr.sourceId]=(oa[Rr.sourceId]||0)+1;var Mr=Rr.length||1;(!Sr[Rr.targetId]||Sr[Rr.targetId]<Mr)&&(Sr[Rr.targetId]=Mr)}for(var It=0;It<l.length;It++){var er=l[It],Xr=er.pattern,Kr=null;Xr==="thick"&&(Kr="thick",Xr="solid");var Ur={id:"e"+xr++,sources:[er.sourceId],targets:[er.targetId],drawio:{arrowTypeStart:er.arrowStart,arrowTypeEnd:er.arrowEnd,pattern:Xr,thickness:Kr,text:er.text,length:er.length||1}};er.text&&(Ur.labels=[{text:er.text}]);for(var Jr=0;Jr<W.length;Jr++){var Yr=W[Jr].targets;(Yr==="default"||Yr.indexOf&&Yr.indexOf(It)!==-1)&&(Ur.drawio.style=(Ur.drawio.style?Ur.drawio.style+";":"")+W[Jr].css)}if(er.edgeId&&pt[er.edgeId]){var ke=pt[er.edgeId];if(r(ke.animate)||r(ke.animation)){var ze=(""+ke.animation).trim().toLowerCase()=="slow";Ur.drawio.extraStyle=(Ur.drawio.extraStyle?Ur.drawio.extraStyle+";":"")+"flowAnimation=1;dashed=1;dashPattern=9 5;fixDash=1;flowAnimationDuration="+(ze?889:356)}}var lr=_[er.sourceId]?_[er.sourceId].subgraph:null,ir=_[er.targetId]?_[er.targetId].subgraph:null,ur=Wr(lr,ir);ur&&Tt[ur]?Tt[ur].edges.push(Ur):sr.push(Ur)}for(var zr={},cr={},It=0;It<l.length;It++){var er=l[It];zr[er.sourceId]=(zr[er.sourceId]||0)+1,cr[er.targetId]=(cr[er.targetId]||0)+1}var Nr=!1;for(var me in zr)if(zr[me]>=2){Nr=!0;break}if(!Nr){for(var me in cr)if(cr[me]>=2){Nr=!0;break}}for(var Fr=O.length>0,sa={"elk.algorithm":"layered","elk.direction":mt,"elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":50,"elk.layered.spacing.nodeNodeBetweenLayers":50,"elk.edgeRouting":"ORTHOGONAL","elk.layered.mergeEdges":!0,"elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED"},yr=!1,It=0;It<O.length;It++)if(O[It].parent){yr=!0;break}for(var kr={},It=0;It<l.length;It++){var er=l[It],pr=_[er.sourceId],rr=_[er.targetId];pr&&rr&&pr.subgraph&&pr.subgraph===rr.subgraph&&(kr[er.targetId]=(kr[er.targetId]||0)+1)}for(var Pr=!1,It=0;It<l.length;It++){var er=l[It],ta=_[er.sourceId]?_[er.sourceId].subgraph:null,wr=_[er.targetId]?_[er.targetId].subgraph:null;if(!(Tt[er.sourceId]||Tt[er.targetId])){var Sa=ta!==wr;if(Sa&&kr[er.targetId]){Pr=!0;break}}}Pr&&!yr&&(sa["elk.hierarchyHandling"]="SEPARATE_CHILDREN"),Nr&&!Fr&&(sa["elk.layered.considerModelOrder.strategy"]="PREFER_EDGES");for(var me in ue)if(!Tt[me]){var ca=ue[me],ba=!oa[me],ra=(Sr[me]||1)>=3;ba&&ra&&(ca.layoutOptions||(ca.layoutOptions={}),ca.layoutOptions["elk.layered.layering.layerConstraint"]="LAST_SEPARATE")}var Dr=ar.length>=2&&ar.every(function(la){return la.drawio&&la.drawio.isSubgraph});return sr.length===0&&Dr&&(ar=ar.slice().reverse()),{id:"root",layoutOptions:sa,children:ar,edges:sr,drawio:{direction:z,orthEdges:!1}}}return{parse:I}})();var Wo=(function(){var L={"<|--|>":{type:"extension",startArrow:"extension",endArrow:"extension"},"<|..|>":{type:"extension",startArrow:"extension",endArrow:"extension",dashed:!0},"<|--":{type:"extension",startArrow:"extension",endArrow:"none"},"--|>":{type:"extension",startArrow:"none",endArrow:"extension"},"<|..":{type:"extension",startArrow:"extension",endArrow:"none",dashed:!0},"..|>":{type:"extension",startArrow:"none",endArrow:"extension",dashed:!0},"*--":{type:"composition",startArrow:"composition",endArrow:"none"},"--*":{type:"composition",startArrow:"none",endArrow:"composition"},"*--*":{type:"composition",startArrow:"composition",endArrow:"composition"},"*..*":{type:"composition",startArrow:"composition",endArrow:"composition",dashed:!0},"*..":{type:"composition",startArrow:"composition",endArrow:"none",dashed:!0},"..*":{type:"composition",startArrow:"none",endArrow:"composition",dashed:!0},"o--":{type:"aggregation",startArrow:"aggregation",endArrow:"none"},"--o":{type:"aggregation",startArrow:"none",endArrow:"aggregation"},"o--o":{type:"aggregation",startArrow:"aggregation",endArrow:"aggregation"},"o..o":{type:"aggregation",startArrow:"aggregation",endArrow:"aggregation",dashed:!0},"o..":{type:"aggregation",startArrow:"aggregation",endArrow:"none",dashed:!0},"..o":{type:"aggregation",startArrow:"none",endArrow:"aggregation",dashed:!0},"()--":{type:"lollipop",startArrow:"lollipop",endArrow:"none"},"--()":{type:"lollipop",startArrow:"none",endArrow:"lollipop"},"<--":{type:"association",startArrow:"arrow_barb",endArrow:"none"},"-->":{type:"association",startArrow:"none",endArrow:"arrow_barb"},"<..":{type:"dependency",startArrow:"arrow_barb",endArrow:"none",dashed:!0},"..>":{type:"dependency",startArrow:"none",endArrow:"arrow_barb",dashed:!0},"--":{type:"association",startArrow:"none",endArrow:"none"},"..":{type:"dependency",startArrow:"none",endArrow:"none",dashed:!0},"<..>":{type:"dependency",startArrow:"arrow_barb",endArrow:"arrow_barb",dashed:!0},"<-->":{type:"association",startArrow:"arrow_barb",endArrow:"arrow_barb"}},j=Object.keys(L).sort(function(n,y){return y.length-n.length});function P(n,y,b){var T=new Ua(n),I={},F=[],X=[],Z=[],ot={},dt={},xt={},re={},N=[],Q=[y];for(T.skipWhitespaceAndComments();!T.isEof()&&(T.skipWhitespaceAndComments(),!T.isEof());)E(T,I,F,X,Z,ot,dt,xt,re,N,Q);return h(I,ot,dt,xt,re),d(I,F,X,Z,Q[0],b)}function E(n,y,b,T,I,F,X,Z,ot,dt,xt){var re=n.save(),N=n.readWord();if(N==="class"){w(n,y,dt);return}else if(N==="namespace"){s(n,T,y,b,F,X,Z,ot,dt);return}else if(N==="classDef"){var Q=n.parseClassDef();Q&&(F[Q.name]=Q.styles);return}else if(N==="style"){var Q=n.parseStyleDef();if(Q)for(var at=0;at<Q.nodeIds.length;at++)X[Q.nodeIds[at]]=(X[Q.nodeIds[at]]||"")+Q.styles;return}else if(N==="click"||N==="link"){var Q=n.parseClick();Q&&(ot[Q.nodeId]=Q);return}else if(N==="note"){n.skipSpaces();var _=null,l=n.save(),O=n.readWord();O==="for"?(n.skipSpaces(),_=n.readId(),n.skipSpaces()):n.restore(l);var z=null;(n.peek()==='"'||n.peek()==="'"||n.peek()==="`")&&(z=n.readQuoted()),z!=null&&I.push({id:"_note_"+I.length,text:z,forTarget:_}),r(n);return}else if(N==="direction"){n.skipSpaces();var lt=n.readWord();lt&&xt&&(xt[0]=lt),r(n);return}else if(N==="accTitle"||N==="accDescr"){n.skipSpaces(),n.peek()==="{"&&(n.advance(1),n.readUntil("}"),n.peek()==="}"&&n.advance(1)),r(n);return}else n.restore(re);if(n.peekStr(2)==="<<"){n.advance(2);var W=n.readUntil(">>");n.skipSpaces();var pt=n.readId();pt&&(o(y,pt,dt),y[pt].annotations.push(W)),r(n);return}var mt=f(n);if(!mt){r(n);return}if(n.peekStr(3)===":::"){n.advance(3);var Tt=n.readWord();o(y,mt,dt),Z[mt]||(Z[mt]=[]),Z[mt].push(Tt)}n.skipSpaces();var Rt=null;n.peek()==='"'&&(Rt=n.readQuoted(),n.skipSpaces());var It=u(n);if(It){n.skipSpaces();var te=null;n.peek()==='"'&&(te=n.readQuoted(),n.skipSpaces());var Qt=f(n);if(Qt){var pe=mt,ue=Qt;It.type==="lollipop"?(It.startArrow==="lollipop"?pe=v(y,mt,dt):o(y,mt,dt),It.endArrow==="lollipop"?ue=v(y,Qt,dt):o(y,Qt,dt)):(o(y,mt,dt),o(y,Qt,dt));var me=null;n.skipSpaces(),n.peek()===":"?(n.advance(),n.skipSpaces(),me=n.readLine().trim()):r(n),b.push({sourceId:pe,targetId:ue,rel:It,label:me,sourceCard:Rt,targetCard:te})}else r(n);return}if(n.peek()===":"){n.advance(),n.skipSpaces();var Ee=n.readLine().trim();o(y,mt,dt),Ee&&(Ee.indexOf("(")>=0?y[mt].methods.push(Ee):y[mt].members.push(Ee));return}o(y,mt,dt),r(n)}function w(n,y,b){n.skipSpaces();var T=n.readId();if(!T){r(n);return}if(o(y,T,b),n.peek()==="["){n.advance(),n.skipSpaces();var I=null;if(n.peek()==='"')I=n.readQuoted();else{for(var F="";!n.isEof()&&n.peek()!=="]"&&n.peek()!==`
-`&&n.peek()!=="\r";)F+=n.peek(),n.advance();I=F.trim()}n.peek()==="]"&&n.advance(),I&&(y[T].label=I),n.skipSpaces()}if(n.peekStr(3)===":::"){n.advance(3);var X=n.readWord();y[T].styleClass=X}if(n.skipSpaces(),n.peek()==="~"){n.advance();var Z=n.readUntil("~");y[T].type=Z}if(n.skipSpaces(),n.peekStr(2)==="<<"){n.advance(2);var ot=n.readUntil(">>");ot&&y[T].annotations.push(ot)}n.skipSpaces(),n.peek()==="{"&&(n.advance(),p(n,y[T])),r(n)}function p(n,y){for(;!n.isEof();){if(n.skipWhitespaceAndComments(),n.peek()==="}"){n.advance();return}if(n.isEof())return;if(n.peekStr(2)==="<<"){n.advance(2);var b=n.readUntil(">>");y.annotations.push(b);continue}var T=n.readLine().trim();if(!T||T==="}")return;T[T.length-1]===";"&&(T=T.substring(0,T.length-1).trim()),T&&(T.indexOf("(")>=0?y.methods.push(T):y.members.push(T))}}function s(n,y,b,T,I,F,X,Z,ot){n.skipSpaces();var dt=n.readId();n.skipSpaces();var xt={id:dt,label:dt,classIds:[]};if(y.push(xt),ot.push(dt),n.peek()==="{")for(n.advance();!n.isEof();){if(n.skipWhitespaceAndComments(),n.peek()==="}"){n.advance();break}E(n,b,T,y,[],I,F,X,Z,ot,null)}ot.pop()}function o(n,y,b){n[y]||(n[y]={id:y,label:y,members:[],methods:[],annotations:[],type:null,cssStyles:null,link:null,linkTarget:null,tooltip:null,styleClass:null,namespace:b.length>0?b[b.length-1]:null})}function v(n,y,b){var T=0;for(var I in n)I.indexOf("__iface_")===0&&T++;var F="__iface_"+T;return n[F]={id:F,label:y,members:[],methods:[],annotations:[],type:null,cssStyles:null,link:null,linkTarget:null,tooltip:null,styleClass:null,namespace:b.length>0?b[b.length-1]:null,isLollipopInterface:!0},F}function M(n){if(n==null)return!1;var y=n.charCodeAt(0);return n>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"||n==="_"||y>127}function f(n){var y=n.peek();if(y==='"'||y==="'"||y==="`")return n.readQuoted();for(var b=n.pos;n.pos<n.len;){var T=n.input[n.pos];if(M(T))n.advance();else if(T==="-"||T==="."||T==="/")if(M(n.input[n.pos+1]))n.advance();else break;else break}return n.input.substring(b,n.pos)}function u(n){for(var y=0;y<j.length;y++){var b=j[y];if(n.peekStr(b.length)===b)return n.advance(b.length),L[b]}return null}function r(n){for(;!n.isEof();){var y=n.peek();if(y===`
-`||y==="\r"||y===";"){y===";"&&n.advance();return}n.advance()}}function h(n,y,b,T,I){function F(re,N){if(!N)return re||"";if(!re)return N;var Q=/[;,]\s*$/.test(re)?"":";";return re+Q+N}var X=y.default||"";for(var Z in n)X&&(n[Z].cssStyles=F(n[Z].cssStyles,X));for(var Z in T)if(n[Z])for(var ot=0;ot<T[Z].length;ot++){var dt=T[Z][ot];dt!=="default"&&y[dt]&&(n[Z].cssStyles=F(n[Z].cssStyles,y[dt]))}for(var Z in n)n[Z].styleClass&&n[Z].styleClass!=="default"&&y[n[Z].styleClass]&&(n[Z].cssStyles=F(n[Z].cssStyles,y[n[Z].styleClass]));for(var Z in b)n[Z]&&(n[Z].cssStyles=F(n[Z].cssStyles,b[Z]));for(var Z in I)if(n[Z]){var xt=I[Z];xt.action==="href"&&(n[Z].link=xt.url),xt.tooltip&&(n[Z].tooltip=xt.tooltip)}}function d(n,y,b,T,I,F){var X="DOWN";if(I)switch(I.toUpperCase()){case"LR":X="RIGHT";break;case"RL":X="LEFT";break;case"BT":X="UP";break}for(var Z={},ot=0;ot<b.length;ot++){var dt=b[ot];Z[dt.id]={id:dt.id,labels:[{text:dt.label}],layoutOptions:{"elk.algorithm":"layered","elk.direction":X,"elk.hierarchyHandling":"INCLUDE_CHILDREN"},children:[],edges:[],drawio:{shape:"rounded",labelText:dt.label,type:"group",cssStyles:null,isSubgraph:!0,isClassNamespace:!0}}}var xt={},re=[],N=!!(F&&F.class&&F.class.hideEmptyMembersBox);for(var Q in n){var at=n[Q],_={id:Q,labels:[{text:at.label}],width:0,height:0,drawio:{shape:at.isLollipopInterface?"lollipopInterface":"class_box",labelText:at.label,type:at.type,cssStyles:at.cssStyles,link:at.link,linkTarget:at.linkTarget,tooltip:at.tooltip,members:at.members,methods:at.methods,annotations:at.annotations,classData:{members:at.members,methods:at.methods,annotations:at.annotations,hideEmptyMembersBox:N}}};xt[Q]=_,at.namespace&&Z[at.namespace]?Z[at.namespace].children.push(_):re.push(_)}for(var ot=0;ot<b.length;ot++){var l=Z[b[ot].id];if(l&&l.children.length>1)for(var O=0;O<l.children.length-1;O++)l.edges.push({id:"ns_order_"+b[ot].id+"_"+O,sources:[l.children[O].id],targets:[l.children[O+1].id],drawio:{arrowTypeStart:"none",arrowTypeEnd:"none",pattern:"invisible",text:null,invisible:!0}})}for(var ot=0;ot<b.length;ot++)Z[b[ot].id]&&re.push(Z[b[ot].id]);for(var z=[],lt=0,ot=0;ot<y.length;ot++){var W=y[ot],pt={id:"e"+lt++,sources:[W.sourceId],targets:[W.targetId],drawio:{arrowTypeStart:W.rel.startArrow,arrowTypeEnd:W.rel.endArrow,pattern:W.rel.dashed?"dashed":"solid",text:W.label,relationship:{type:W.rel.type}}};W.label&&(pt.labels=[{text:W.label}]),W.sourceCard&&(pt.drawio.startLabelRight=W.sourceCard),W.targetCard&&(pt.drawio.endLabelLeft=W.targetCard),z.push(pt)}for(var mt=[],Tt={},ot=0;ot<y.length;ot++){var W=y[ot];if(W.rel.type==="extension"){var Rt=W.rel.startArrow==="extension"?W.targetId:W.rel.endArrow==="extension"?W.sourceId:null;Rt&&xt[Rt]&&!Tt[Rt]&&(mt.push(Rt),Tt[Rt]=!0)}}for(var ot=0;T&&ot<T.length;ot++){var It=T[ot],te=(It.text||"").replace(/<br\s*\/?>/gi,`
-`),Qt={id:It.id,labels:[{text:te}],width:0,height:0,drawio:{shape:"note",labelText:te,type:"note",cssStyles:"fill:#fff5ad,stroke:#aaaa33,stroke-width:1.3"}};It.forTarget&&xt[It.forTarget]?(xt[It.id]=Qt,re.push(Qt),z.push({id:"ne"+lt++,sources:[It.id],targets:[It.forTarget],drawio:{arrowTypeStart:"none",arrowTypeEnd:"none",pattern:"dashed",text:null,relationship:{type:"note"}}})):(Qt.layoutOptions={"org.eclipse.elk.layered.layering.layerConstraint":"FIRST"},xt[It.id]=Qt,re.push(Qt))}return{id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":X,"elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":50,"elk.layered.spacing.nodeNodeBetweenLayers":50,"elk.edgeRouting":"ORTHOGONAL"},children:re,edges:z,drawio:{orthEdges:!1,isClassDiagram:!0}}}return{parse:P}})();var Uo=(function(){var L=0,j=0;function P(r,h,d){L=0,j=0;var n=new Ua(r),y={},b=[],T=[],I={},F={},X={},Z=[],ot={value:h},dt={root:0};for(n.skipWhitespaceAndComments();!n.isEof()&&(n.skipWhitespaceAndComments(),!n.isEof());)E(n,y,b,T,I,F,X,Z,ot,dt);return M(y,I,F,X),u(y,b,T,ot.value,d)}function E(r,h,d,n,y,b,T,I,F,X){var Z=r.save(),ot=r.readWord();if(ot==="state"){w(r,h,d,n,y,b,T,I,F,X);return}else if(ot==="classDef"){var dt=r.parseClassDef();dt&&(y[dt.name]=dt.styles);return}else if(ot==="style"){var dt=r.parseStyleDef();if(dt)for(var xt=0;xt<dt.nodeIds.length;xt++)b[dt.nodeIds[xt]]=(b[dt.nodeIds[xt]]||"")+dt.styles;return}else if(ot==="note"){o(r,n);return}else if(ot==="class"){r.skipSpaces();for(var re=[];;){var N=r.readId();if(!N)break;if(re.push(N),r.skipSpaces(),r.peek()===",")r.advance(),r.skipSpaces();else break}r.skipSpaces();var Q=r.readWord();if(Q)for(var at=0;at<re.length;at++)T[re[at]]||(T[re[at]]=[]),T[re[at]].push(Q);v(r);return}else if(ot==="direction"){r.skipSpaces();var _=r.readWord(),l=(_||"").toUpperCase();if(l==="TB"||l==="TD"||l==="BT"||l==="LR"||l==="RL")if(I.length===0)F&&(F.value=l);else{var O=I[I.length-1];h[O]&&(h[O].direction=l)}v(r);return}else if(ot==="accTitle"||ot==="accDescr"||ot==="accDescription"||ot==="title"){if(r.skipSpaces(),r.peek()===":")r.advance(),v(r);else if(r.peek()==="{")for(var z=0;!r.isEof();){var lt=r.peek();if(lt==="{")z++;else if(lt==="}"){if(z--,r.advance(),z<=0)break;continue}r.advance()}else v(r);return}else r.restore(Z);var W=p(r,h,I,"source",X);if(!W){v(r);return}if(r.peekStr(3)===":::"){r.advance(3);var Q=r.readWord();T[W]||(T[W]=[]),T[W].push(Q)}if(r.skipSpaces(),r.peekStr(3)==="-->"){r.advance(3),r.skipSpaces();var pt=p(r,h,I,"target",X);if(pt){var mt=null;if(r.skipSpaces(),r.peekStr(3)===":::"){r.advance(3);var Q=r.readWord();T[pt]||(T[pt]=[]),T[pt].push(Q),r.skipSpaces()}r.peek()===":"&&r.peekStr(3)!==":::"?(r.advance(),r.skipSpaces(),mt=r.readLine().trim()):v(r),d.push({sourceId:W,targetId:pt,label:mt,parent:I.length>0?I[I.length-1]:null})}else v(r);return}if(r.peek()===":"){r.advance(),r.skipSpaces();var Tt=r.readLine().trim();h[W]&&(h[W].description=(h[W].description||"")+(h[W].description?`
-`:"")+Tt);return}v(r)}function w(r,h,d,n,y,b,T,I,F,X){r.skipSpaces();var Z=null,ot=null;if(r.peek()==='"')ot=r.readQuoted(),r.skipSpaces(),r.matchI("as")?(r.skipSpaces(),Z=r.readId()):Z="state_"+L++;else if(Z=r.readId(),!Z){v(r);return}if(s(h,Z,I),ot&&(h[Z].label=ot),r.skipSpaces(),r.peekStr(2)==="<<"){r.advance(2);var dt=r.readUntil(">>");h[Z].type=dt}if(r.skipSpaces(),r.peek()==="{"){for(r.advance(),h[Z].isCompound=!0,I.push(Z),X[Z]=0;!r.isEof();){if(r.skipWhitespaceAndComments(),r.peek()==="}"){r.advance();break}if(r.peekStr(2)==="--"){r.advance(2),r.skipSpaces();var xt=I[I.length-1];if(xt){var re="_divider_"+ ++j;h[re]={id:re,label:"",description:null,type:"divider",isCompound:!1,isStar:!1,cssStyles:null,parent:xt},X[xt]=(X[xt]||0)+1}continue}E(r,h,d,n,y,b,T,I,F,X)}I.pop()}v(r)}function p(r,h,d,n,y){if(r.skipSpaces(),r.peekStr(3)==="[*]"){r.advance(3);var b=d.length>0?d[d.length-1]:"root",T=y&&y[b]||0,I=T>0?"_r"+T:"",F=n==="target"?"_end":"_start",X=b+I+F;return s(h,X,d),h[X].isStar=!0,X}var X=r.readId();return X&&s(h,X,d),X||null}function s(r,h,d){r[h]||(r[h]={id:h,label:h,description:null,type:null,isCompound:!1,isStar:!1,cssStyles:null,parent:d.length>0?d[d.length-1]:null})}function o(r,h){r.skipSpaces();var d=r.readWord(),n=null;if(d==="left"||d==="right"){n=d,r.skipSpaces();var y=r.readWord();if(y!=="of"){v(r);return}}r.skipSpaces();var b=r.readId();if(!b){v(r);return}r.skipSpaces();var T="";if(r.peek()===":")r.advance(),r.skipSpaces(),T=r.readLine().trim();else{v(r);for(var I=[];!r.isEof();){r.skipSpaces();var F=r.save(),X=r.readWord();if(X==="end"){r.skipSpaces();var Z=r.readWord();if(Z==="note"){v(r);break}r.restore(F)}else r.restore(F);var ot=r.readLine();ot!=null&&I.push(ot.trim()),r.skipWhitespaceAndComments()}T=I.join(`
-`).trim()}h.push({id:"_note_"+h.length,text:T,forTarget:b,placement:n})}function v(r){for(;!r.isEof();){var h=r.peek();if(h===`
-`||h==="\r"||h===";"){h===";"&&r.advance();return}r.advance()}}function M(r,h,d,n){function y(Z,ot){return ot?Z?Z.replace(/;\s*$/,"")+";"+ot:ot:Z||""}for(var b in n){var T=[];r[b]&&T.push(b);for(var I=0;I<T.length;I++)for(var F=0;F<n[b].length;F++){var X=n[b][F];h[X]&&(r[T[I]].cssStyles=y(r[T[I]].cssStyles,h[X]))}}for(var b in d)r[b]&&(r[b].cssStyles=y(r[b].cssStyles,d[b]))}function f(r){switch((r||"").toUpperCase()){case"LR":return"RIGHT";case"RL":return"LEFT";case"BT":return"UP";default:return"DOWN"}}function u(r,h,d,n,y){var b=f(n),T={};function I(kr){for(var pr=0,rr=r[kr];rr&&rr.parent&&r[rr.parent]&&r[rr.parent].isCompound;)pr++,rr=r[rr.parent];return pr}for(var F in r){var X=r[F];if(X.isCompound){var Z=X.direction?f(X.direction):b;T[F]={id:F,labels:[{text:X.label}],layoutOptions:{"elk.algorithm":"layered","elk.direction":Z,"elk.hierarchyHandling":"INCLUDE_CHILDREN"},children:[],edges:[],drawio:{shape:"roundedWithTitle",labelText:X.description?X.description:X.label,cssStyles:X.cssStyles,isSubgraph:!0,isStateDiagram:!0,compoundDepth:I(F)}}}}for(var ot={},dt=0;dt<h.length;dt++)for(var xt=h[dt],re=dt+1;re<h.length;re++){var N=h[re];if(xt.sourceId===N.targetId&&xt.targetId===N.sourceId){var Q=r[xt.sourceId],at=r[xt.targetId];Q&&at&&Q.parent&&Q.parent===at.parent&&(ot[Q.parent]=!0)}}for(var _ in ot)T[_]&&(T[_].drawio.bidiCompound=!0);var l={},O=[];for(var F in r){var X=r[F];if(X.isCompound){l[F]=T[F],!X.parent||!T[X.parent]?O.push(T[F]):T[X.parent].children.push(T[F]);continue}var z="rounded";if(X.isStar){for(var lt=!1,W=!1,pt=0;pt<h.length;pt++)h[pt].sourceId===F&&(lt=!0),h[pt].targetId===F&&(W=!0);z=!lt&&W?"stateEnd":"stateStart"}else X.type==="fork"||X.type==="join"?z=X.type:X.type==="choice"?z="choice":X.type==="divider"&&(z="stateDivider");var mt=X.label&&X.label!==X.id,Tt="";X.isStar||(X.description&&mt?Tt=X.label+`
-`+X.description:X.description?Tt=X.description:Tt=X.label);var Rt={id:F,labels:[{text:Tt}],width:0,height:0,drawio:{shape:z,labelText:Tt,cssStyles:X.cssStyles,isStateDiagram:!0,type:X.type}};l[F]=Rt,X.parent&&T[X.parent]?T[X.parent].children.push(Rt):O.push(Rt)}for(var It=[],te=0,pt=0;pt<h.length;pt++){var Qt=h[pt],pe={id:"e"+te++,sources:[Qt.sourceId],targets:[Qt.targetId],drawio:{arrowTypeStart:"none",arrowTypeEnd:"arrow_barb",pattern:"solid",text:Qt.label,extraStyle:"fillColor=none;",isStateDiagram:!0}};Qt.label&&(pe.labels=[{text:Qt.label}]),Qt.parent&&T[Qt.parent]?T[Qt.parent].edges.push(pe):It.push(pe)}for(var ue=0;d&&ue<d.length;ue++){var me=d[ue],Tt=(me.text||"").replace(/<br\s*\/?>/gi,`
-`),Ee={id:me.id,labels:[{text:Tt}],width:0,height:0,drawio:{shape:"note",labelText:Tt,type:"note",isStateDiagram:!0,notePlacement:me.placement||null,noteFor:me.forTarget||null}};l[me.id]=Ee;var xe=me.forTarget?l[me.forTarget]:null;if(!xe){O.push(Ee);continue}var ar=xe.id+"-group",xr=me.placement==="left"?[Ee,xe]:[xe,Ee],sr={id:ar,labels:[{text:""}],layoutOptions:{"elk.algorithm":"layered","elk.direction":"RIGHT"},children:xr,edges:[],drawio:{shape:"noteGroup",labelText:"",isSubgraph:!0,isStateDiagram:!0,isNoteGroup:!0}};T[ar]=sr;var Qe=xe.parent&&T[xe.parent]?T[xe.parent].children:O,or=Qe.indexOf(xe);or>=0?Qe.splice(or,1,sr):Qe.push(sr),sr.parent=xe.parent||null,xe.parent=ar,Ee.parent=ar;var Wr=me.placement==="left"?me.id:me.forTarget,oa=me.placement==="left"?me.forTarget:me.id,Sr={id:"e"+te++,sources:[Wr],targets:[oa],drawio:{arrowTypeStart:"none",arrowTypeEnd:"none",pattern:"dashed",extraStyle:"fillColor=none;strokeColor=#aaaa33;",isStateDiagram:!0,classes:["note-edge"]}};sr.edges.push(Sr)}for(var Rr in T){for(var Mr=T[Rr],er=!1,Xr=0;Xr<Mr.children.length;Xr++)if(Mr.children[Xr].drawio&&Mr.children[Xr].drawio.shape==="stateDivider"){er=!0;break}if(er){for(var Kr=[[]],Xr=0;Xr<Mr.children.length;Xr++){var Ur=Mr.children[Xr];Ur.drawio&&Ur.drawio.shape==="stateDivider"?Kr.push([]):Kr[Kr.length-1].push(Ur)}for(var Jr={},Yr=0;Yr<Kr.length;Yr++)for(var ke=0;ke<Kr[Yr].length;ke++)Jr[Kr[Yr][ke].id]=Yr;for(var ze=Kr.map(function(){return[]}),lr=[],ir=0;ir<Mr.edges.length;ir++){var Sr=Mr.edges[ir],ur=Jr[Sr.sources[0]],zr=Jr[Sr.targets[0]];ur!=null&&ur===zr?ze[ur].push(Sr):lr.push(Sr)}for(var cr=[],Yr=0;Yr<Kr.length;Yr++){var Nr=Rr+"__region_"+Yr,Fr={id:Nr,labels:[{text:""}],layoutOptions:{"elk.algorithm":"layered","elk.direction":b,"elk.hierarchyHandling":"INCLUDE_CHILDREN"},children:Kr[Yr],edges:ze[Yr],drawio:{shape:"parallelRegion",labelText:"",isSubgraph:!0,isStateDiagram:!0,regionIdx:Yr}};cr.push(Fr)}Mr.children=cr,Mr.edges=lr}}var sa=!1;for(var Rr in T){sa=!0;break}var yr={"elk.algorithm":"layered","elk.direction":b,"elk.spacing.nodeNode":50,"elk.layered.spacing.nodeNodeBetweenLayers":sa?75:50,"elk.edgeRouting":"ORTHOGONAL","elk.layered.cycleBreaking.strategy":"DEPTH_FIRST","elk.layered.layering.strategy":"LONGEST_PATH"};return sa&&(yr["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),{id:"root",layoutOptions:yr,children:O,edges:It,drawio:{orthEdges:!1,diagramType:"state"}}}return{parse:P}})();var Yo=(function(){var L={"||":"ONLY_ONE","|o":"ZERO_OR_ONE","}|":"ONE_OR_MORE","}o":"ZERO_OR_MORE","o|":"ZERO_OR_ONE","|{":"ONE_OR_MORE","o{":"ZERO_OR_MORE"},j={"||":"ONLY_ONE","o|":"ZERO_OR_ONE","|{":"ONE_OR_MORE","o{":"ZERO_OR_MORE","|o":"ZERO_OR_ONE","}|":"ONE_OR_MORE","}o":"ZERO_OR_MORE"};function P(n,y,b){var T=new Ua(n),I={},F=[],X={},Z={},ot={},dt={value:y};for(T.skipWhitespaceAndComments();!T.isEof()&&(T.skipWhitespaceAndComments(),!T.isEof());)E(T,I,F,X,Z,ot,dt);return u(I,X,ot),r(I,Z),d(I,F,dt.value,b)}function E(n,y,b,T,I,F,X){if(n.skipSpaces(),n.isEol()||n.isEof()){(n.peek()===`
-`||n.peek()==="\r")&&n.advance();return}var Z=n.readId();if(!Z){h(n);return}if(Z==="classDef"){var ot=n.parseClassDef();ot&&(T[ot.name]=(T[ot.name]||"")+(T[ot.name]?",":"")+ot.styles);return}if(Z==="style"){var ot=n.parseStyleDef();if(ot)for(var dt=0;dt<ot.nodeIds.length;dt++)I[ot.nodeIds[dt]]=(I[ot.nodeIds[dt]]||"")+(I[ot.nodeIds[dt]]?",":"")+ot.styles;return}if(Z==="class"){n.skipSpaces();for(var xt=[],re=n.readId();re&&(xt.push(re),n.skipSpaces(),n.peek()===",");)n.advance(),n.skipSpaces(),re=n.readId();n.skipSpaces();var N=n.readId();if(N)for(var dt=0;dt<xt.length;dt++)F[xt[dt]]=F[xt[dt]]||[],F[xt[dt]].push(N);h(n);return}if(Z==="direction"&&X){n.skipSpaces();var Q=n.readWord(),at=(Q||"").toUpperCase();(at==="TB"||at==="TD"||at==="BT"||at==="LR"||at==="RL")&&(X.value=at),h(n);return}if(Z==="click"||Z==="title"||Z==="accTitle"||Z==="accDescr"||Z==="accDescription"){h(n);return}var _=null;if(n.peek()==="["){if(n.advance(),n.skipSpaces(),n.peek()==='"')_=n.readQuoted();else{for(var l="";!n.isEof()&&n.peek()!=="]"&&n.peek()!==`
-`&&n.peek()!=="\r";)l+=n.peek(),n.advance();_=l.trim()}n.peek()==="]"&&n.advance()}if(n.skipSpaces(),n.peek()===":"&&n.input[n.pos+1]===":"&&n.input[n.pos+2]===":"){n.advance(3);for(var N=n.readId();N;)F[Z]=F[Z]||[],F[Z].push(N),n.peek()===","?(n.advance(),N=n.readId()):N=null;n.skipSpaces()}if(n.peek()==="{"){n.advance(),f(y,Z,_),w(n,y[Z]);return}var O=s(n)||M(n);if(O){n.skipSpaces();var z=n.readId();if(z){if(f(y,Z),f(y,z),n.skipSpaces(),n.peek()===":"&&n.input[n.pos+1]===":"&&n.input[n.pos+2]===":"){n.advance(3);for(var lt=n.readId();lt;)F[z]=F[z]||[],F[z].push(lt),n.peek()===","?(n.advance(),lt=n.readId()):lt=null;n.skipSpaces()}var W=null;n.peek()===":"?(n.advance(),n.skipSpaces(),W=n.readLine().trim()):h(n),b.push({entity1:Z,entity2:z,card1:O.card1,card2:O.card2,relType:O.relType,label:W})}else h(n);return}f(y,Z,_),h(n)}function w(n,y){for(;!n.isEof();){if(n.skipWhitespaceAndComments(),n.peek()==="}"){n.advance();return}if(n.isEof())return;var b=n.readLine().trim();if(!b||b==="}")return;if(b[b.length-1]===";"&&(b=b.substring(0,b.length-1).trim()),!!b){var T=p(b);T&&y.attributes.push(T)}}}function p(n){var y=n.match(/^(\S+)\s+(\S+)(?:\s+(PK|FK|UK)(?:\s*,\s*(PK|FK|UK))*)?(?:\s+"([^"]*)")?/);if(y){var b=[];return y[3]&&b.push(y[3]),y[4]&&b.push(y[4]),{attributeType:y[1],attributeName:y[2],attributeKeyType:b.length>0?b[0]:null,attributeKeyTypeList:b.length>0?b:null,attributeComment:y[5]||null}}var T=n.split(/\s+/);return T.length>=2?{attributeType:T[0],attributeName:T[1],attributeKeyType:T[2]||null,attributeKeyTypeList:T[2]?[T[2]]:null,attributeComment:null}:null}function s(n){var y=n.save(),b=n.peekStr(10),T=b.substring(0,2),I=L[T];if(!I)return n.restore(y),null;n.advance(2);var F="IDENTIFYING";if(n.peekStr(2)==="--")F="IDENTIFYING",n.advance(2);else if(n.peekStr(2)==="..")F="NON_IDENTIFYING",n.advance(2);else return n.restore(y),null;var X=n.peekStr(2),Z=j[X];return Z?(n.advance(2),{card1:I,card2:Z,relType:F}):(n.restore(y),null)}var o=[{re:/^only one\b/i,card:"ONLY_ONE"},{re:/^one or zero\b/i,card:"ZERO_OR_ONE"},{re:/^one or more\b/i,card:"ONE_OR_MORE"},{re:/^one or many\b/i,card:"ONE_OR_MORE"},{re:/^zero or one\b/i,card:"ZERO_OR_ONE"},{re:/^zero or more\b/i,card:"ZERO_OR_MORE"},{re:/^zero or many\b/i,card:"ZERO_OR_MORE"},{re:/^many\(0\)/i,card:"ZERO_OR_MORE"},{re:/^many\(1\)/i,card:"ONE_OR_MORE"},{re:/^many\b/i,card:"ZERO_OR_MORE"},{re:/^one\b/i,card:"ONLY_ONE"},{re:/^1\+/,card:"ONE_OR_MORE"},{re:/^0\+/,card:"ZERO_OR_MORE"},{re:/^1\b/,card:"ONLY_ONE"}];function v(n){for(var y=n.input.substring(n.pos),b=0;b<o.length;b++){var T=y.match(o[b].re);if(T)return n.advance(T[0].length),o[b].card}return null}function M(n){var y=n.save(),b=v(n);if(!b)return n.restore(y),null;n.skipSpaces();var T=n.input.substring(n.pos),I;if(/^optionally to\b/i.test(T))n.advance(13),I="NON_IDENTIFYING";else if(/^to\b/i.test(T))n.advance(2),I="IDENTIFYING";else return n.restore(y),null;n.skipSpaces();var F=v(n);return F?{card1:b,card2:F,relType:I}:(n.restore(y),null)}function f(n,y,b){n[y]?b&&n[y].displayName===n[y].name&&(n[y].displayName=b):n[y]={name:y,displayName:b||y,attributes:[],cssStyles:null}}function u(n,y,b){if(y.default)for(var T in n)n[T].cssStyles=(n[T].cssStyles||"")+(n[T].cssStyles?",":"")+y.default;for(var T in b)if(n[T])for(var I=b[T],F=0;F<I.length;F++){var X=I[F];y[X]&&(n[T].cssStyles=(n[T].cssStyles||"")+(n[T].cssStyles?",":"")+y[X])}}function r(n,y){for(var b in y)n[b]&&(n[b].cssStyles=(n[b].cssStyles||"")+(n[b].cssStyles?",":"")+y[b])}function h(n){for(;!n.isEof();){var y=n.peek();if(y===`
-`||y==="\r"||y===";"){y===";"&&n.advance();return}n.advance()}}function d(n,y,b,T){var I="DOWN";if(b)switch(b.toUpperCase()){case"LR":I="RIGHT";break;case"BT":I="UP";break;case"RL":I="LEFT";break}var F=[],X={};for(var Z in n){var ot=n[Z],dt={id:Z,labels:[{text:ot.displayName||Z}],width:0,height:0,drawio:{shape:"erdEntity",labelText:ot.displayName||Z,cssStyles:ot.cssStyles||null,entityData:{alias:ot.displayName&&ot.displayName!==Z?ot.displayName:null,attributes:ot.attributes}}};F.push(dt),X[Z]=dt}for(var xt=[],re=0,N=0;N<y.length;N++){var Q=y[N];xt.push({id:"e"+re++,sources:[Q.entity1],targets:[Q.entity2],labels:Q.label?[{text:Q.label}]:[],drawio:{arrowTypeStart:Q.card1,arrowTypeEnd:Q.card2,pattern:Q.relType==="NON_IDENTIFYING"?"dashed":"solid",text:Q.label,relationship:{relSpec:{cardA:Q.card2,cardB:Q.card1,relType:Q.relType}}}})}return{id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":I,"elk.spacing.nodeNode":80,"elk.layered.spacing.nodeNodeBetweenLayers":100,"elk.edgeRouting":"ORTHOGONAL"},children:F,edges:xt,drawio:{orthEdges:!0}}}return{parse:P}})();var Vo=(function(){var L={requirement:"Requirement",functionalrequirement:"Functional Requirement",performancerequirement:"Performance Requirement",interfacerequirement:"Interface Requirement",physicalrequirement:"Physical Requirement",designconstraint:"Design Constraint"},j=["traces","derives","satisfies","verifies","refines","contains","copies"];function P(u,r,h){var d=new Ua(u),n={},y={},b=[],T={},I={},F={},X={value:r};for(d.skipWhitespaceAndComments();!d.isEof()&&(d.skipWhitespaceAndComments(),!d.isEof());)E(d,n,y,b,T,I,F,X);return o(n,y,T,F),v(n,y,I),f(n,y,b,X.value,h)}function E(u,r,h,d,n,y,b,T){if(u.skipSpaces(),u.isEol()||u.isEof()){(u.peek()===`
-`||u.peek()==="\r")&&u.advance();return}var I=u.save(),F=u.readWord(),X=F.toLowerCase();if(L[X]){w(u,r,L[X],b);return}if(X==="element"){p(u,h,b);return}if(X==="direction"&&T){u.skipSpaces();var Z=u.readWord(),ot=(Z||"").toUpperCase();(ot==="TB"||ot==="TD"||ot==="BT"||ot==="LR"||ot==="RL")&&(T.value=ot);return}if(X==="classdef"){var dt=u.parseClassDef();dt&&(n[dt.name]=(n[dt.name]||"")+(n[dt.name]?",":"")+dt.styles);return}if(X==="style"){var xt=u.parseStyleDef();if(xt)for(var re=0;re<xt.nodeIds.length;re++)y[xt.nodeIds[re]]=(y[xt.nodeIds[re]]||"")+(y[xt.nodeIds[re]]?",":"")+xt.styles;return}if(X==="class"){u.skipSpaces();for(var N=[],Q=u.readId();Q&&(N.push(Q),u.skipSpaces(),u.peek()===",");)u.advance(),u.skipSpaces(),Q=u.readId();u.skipSpaces();var at=u.readId();if(at)for(var _=0;_<N.length;_++)b[N[_]]=b[N[_]]||[],b[N[_]].push(at);M(u);return}u.restore(I);var l=u.readId();if(!l){M(u);return}if(u.skipSpaces(),u.peek()==="-"){u.advance(),u.skipSpaces();var O=u.readWord();if(O&&j.indexOf(O.toLowerCase())>=0){u.skipSpaces(),u.peek()==="-"&&u.advance(),u.peek()===">"&&u.advance(),u.skipSpaces();var z=u.readId();z&&d.push({sourceId:l,targetId:z,relType:O.toLowerCase()})}}else if(u.peek()==="<"&&(u.advance(),u.peek()==="-")){u.advance(),u.skipSpaces();var O=u.readWord();if(O&&j.indexOf(O.toLowerCase())>=0){u.skipSpaces(),u.peek()==="-"&&u.advance(),u.skipSpaces();var z=u.readId();z&&d.push({sourceId:z,targetId:l,relType:O.toLowerCase()})}}M(u)}function w(u,r,h,d){u.skipSpaces();var n=u.readId();if(!n){M(u);return}var y={name:n,type:h,requirementId:null,text:"",risk:"low",verifyMethod:"test",cssStyles:null};if(u.skipSpaces(),u.peekStr(3)===":::"){u.advance(3);for(var b=u.readWord();b;)d[n]=d[n]||[],d[n].push(b),u.peek()===","?(u.advance(),b=u.readWord()):b=null;u.skipSpaces()}u.peek()==="{"&&(u.advance(),s(u,y)),r[n]=y}function p(u,r,h){u.skipSpaces();var d=u.readId();if(!d){M(u);return}var n={name:d,type:"",docRef:"",cssStyles:null};if(u.skipSpaces(),u.peekStr(3)===":::"){u.advance(3);for(var y=u.readWord();y;)h[d]=h[d]||[],h[d].push(y),u.peek()===","?(u.advance(),y=u.readWord()):y=null;u.skipSpaces()}u.peek()==="{"&&(u.advance(),s(u,n)),r[d]=n}function s(u,r){for(;!u.isEof();){if(u.skipWhitespaceAndComments(),u.peek()==="}"){u.advance();return}var h=u.readLine().trim();if(!h||h==="}")return;h[h.length-1]===";"&&(h=h.substring(0,h.length-1).trim());var d=h.indexOf(":");if(d>=0){var n=h.substring(0,d).trim().toLowerCase(),y=h.substring(d+1).trim();switch(y.length>=2&&(y.charAt(0)==='"'&&y.charAt(y.length-1)==='"'||y.charAt(0)==="'"&&y.charAt(y.length-1)==="'")&&(y=y.substring(1,y.length-1)),n){case"id":r.requirementId=y,r.id=y;break;case"text":r.text=y;break;case"risk":r.risk=y;break;case"verifymethod":r.verifyMethod=y;break;case"type":r.type=y;break;case"docref":r.docRef=y;break}}}}function o(u,r,h,d){if(h.default){for(var n in u)u[n].cssStyles=(u[n].cssStyles||"")+(u[n].cssStyles?",":"")+h.default;for(var y in r)r[y].cssStyles=(r[y].cssStyles||"")+(r[y].cssStyles?",":"")+h.default}for(var b in d){var T=u[b]||r[b];if(T)for(var I=d[b],F=0;F<I.length;F++){var X=I[F];h[X]&&(T.cssStyles=(T.cssStyles||"")+(T.cssStyles?",":"")+h[X])}}}function v(u,r,h){for(var d in h){var n=u[d]||r[d];n&&(n.cssStyles=(n.cssStyles||"")+(n.cssStyles?",":"")+h[d])}}function M(u){for(;!u.isEof();){var r=u.peek();if(r===`
-`||r==="\r"||r===";"){r===";"&&u.advance();return}u.advance()}}function f(u,r,h,d,n){var y="DOWN";if(d)switch(d.toUpperCase()){case"LR":y="RIGHT";break;case"RL":y="LEFT";break;case"BT":y="UP";break}var b=[],T={};for(var I in u){var F=u[I],X={id:I,labels:[{text:F.name}],width:0,height:0,drawio:{shape:"requirement",labelText:F.name,cssStyles:F.cssStyles||null,data:{type:F.type,name:F.name,requirementId:F.requirementId||F.id,text:F.text,risk:F.risk,verifyMethod:F.verifyMethod}}};b.push(X),T[I]=X}for(var I in r){var Z=r[I],X={id:I,labels:[{text:Z.name}],width:0,height:0,drawio:{shape:"element",labelText:Z.name,cssStyles:Z.cssStyles||null,data:{type:Z.type,name:Z.name,docRef:Z.docRef}}};b.push(X),T[I]=X}for(var ot=[],dt=0,xt=0;xt<h.length;xt++){var re=h[xt],N=re.relType==="contains";ot.push({id:"e"+dt++,sources:[re.sourceId],targets:[re.targetId],labels:[{text:re.relType}],drawio:{arrowTypeStart:N?"circlePlus":"none",arrowTypeEnd:N?"none":"dependency",pattern:N?"solid":"bigDashed",text:re.relType,relationship:{type:re.relType,wrapAngleBrackets:!0}}})}return{id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":y,"elk.spacing.nodeNode":40,"elk.layered.spacing.nodeNodeBetweenLayers":80,"elk.edgeRouting":"POLYLINE"},children:b,edges:ot,drawio:{orthEdges:!1,diagramType:"requirement"}}}return{parse:P}})();var jo=(function(){var L=0,j=1,P=3,E=4,w=5,p=6,s=24,o=25,v={"->>":L,"-->>":j,"-x":P,"--x":E,"-)":s,"--)":o,"->":w,"-->":p},M=Object.keys(v).sort(function(F,X){return X.length-F.length}),f=["loop","alt","else","opt","par","and","critical","option","break","rect","ref"];function u(F,X,Z){var ot=new Ua(F),dt=[],xt={},re=[],N=[],Q=[],at=[],_={autonumber:!1,currentBox:null,activationEvents:[]},l=[];for(ot.skipWhitespaceAndComments();!ot.isEof()&&(ot.skipWhitespaceAndComments(),!ot.isEof());)r(ot,dt,xt,re,N,Q,at,l,_);for(;l.length>0;)l.pop();return{type:"sequence",actors:dt,messages:re,notes:N,fragments:Q,boxes:at,autonumber:_.autonumber,activationEvents:_.activationEvents}}function r(F,X,Z,ot,dt,xt,re,N,Q){if(F.skipSpaces(),F.isEol()||F.isEof()){(F.peek()===`
-`||F.peek()==="\r")&&F.advance();return}var at=F.save(),_=F.readWord(),l=_.toLowerCase();if(l==="participant"||l==="actor"){h(F,X,Z,l==="actor"?"actor":"participant",Q);return}if(l==="boundary"||l==="control"||l==="entity"||l==="database"||l==="collections"||l==="queue"){h(F,X,Z,l,Q);return}if(l==="create"){F.skipSpaces();var O=F.readWord(),z;O==="participant"||O==="actor"?z=h(F,X,Z,O==="actor"?"actor":"participant",Q):(z=O,T(X,Z,O,O,"participant",Q)),z&&Z[z]&&(Z[z].createMessageIndex=ot.length);return}if(l==="destroy"){F.skipSpaces();var lt=F.readId();I(F),lt&&Z[lt]&&(Z[lt].destroyMessageIndex=ot.length);return}if(l==="activate"||l==="deactivate"){F.skipSpaces();var W=F.readId();I(F),W&&Q.activationEvents.push({type:l,actor:W,afterMsgIdx:ot.length-1});return}if(l==="autonumber"){Q.autonumber=!0,I(F);return}if(l==="note"){d(F,X,Z,dt,ot);return}if(l==="box"){n(F,re,Q);return}if(f.indexOf(l)>=0){if(l==="else"||l==="and"||l==="option"){F.skipSpaces();var pt=F.readLine().trim();if(N.length>0){var mt=N[N.length-1];mt.sections.push({title:pt,startIdx:ot.length})}}else{F.skipSpaces();var Tt=F.readLine().trim(),Rt={type:l,title:Tt,startIdx:ot.length,sections:[],endIdx:-1};if(l==="rect"){var It=Tt.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);if(It){var te="#"+[It[1],It[2],It[3]].map(function(Rr){var Mr=parseInt(Rr,10).toString(16);return Mr.length===1?"0"+Mr:Mr}).join("");Rt.bgColor=te,Rt.bgAlpha=It[4]!=null?parseFloat(It[4]):1,Rt.title=""}}xt.push(Rt),N.push(Rt)}return}if(l==="end"){if(Q.currentBox)Q.currentBox=null;else if(N.length>0){var Rt=N.pop();Rt.endIdx=ot.length}I(F);return}if(l==="title"){I(F);return}if(l==="links"||l==="link"){F.skipSpaces();var Qt=y(F);if(Qt&&(F.skipSpaces(),F.peek()===":")){F.advance(),F.skipSpaces();var pe=F.readLine().trim();try{var ue=JSON.parse(pe),me=Z[Qt];if(me&&ue){me.links||(me.links=[]);for(var Ee in ue)ue.hasOwnProperty(Ee)&&me.links.push({label:Ee,url:ue[Ee]})}}catch(Rr){}}I(F);return}F.restore(at);var xe=y(F);if(!xe){I(F);return}var ar=!1;xe.length>2&&xe.slice(-2)==="()"&&(xe=xe.slice(0,-2),ar=!0),F.skipSpaces();var xr=b(F);if(!xr){T(X,Z,xe,xe,"participant",Q),I(F);return}F.skipSpaces();var sr=!1,Qe=!1;F.peek()==="+"?(sr=!0,F.advance()):F.peek()==="-"&&(Qe=!0,F.advance());var or=!1;F.peek()==="("&&F.peekStr(2)==="()"&&(F.advance(2),or=!0);var Wr=y(F);if(!Wr){I(F);return}Wr.length>2&&Wr.slice(-2)==="()"&&(Wr=Wr.slice(0,-2),sr=!0),T(X,Z,xe,xe,"participant",Q),T(X,Z,Wr,Wr,"participant",Q),!sr&&!Qe&&(F.peek()==="+"?(sr=!0,F.advance()):F.peek()==="-"&&(Qe=!0,F.advance()));var oa="";F.skipSpaces(),F.peek()===":"?(F.advance(),F.skipSpaces(),oa=F.readLine().trim()):I(F);var Sr=0;ar&&or?Sr=61:or?Sr=59:ar&&(Sr=60),ot.push({from:xe,to:Wr,text:oa,type:xr.type,activate:sr,deactivate:Qe,centralConnection:Sr})}function h(F,X,Z,ot,dt){F.skipSpaces();var xt=null,re=null;if(F.peek()==='"'||F.peek()==="'")re=F.readQuoted(),F.skipSpaces(),F.matchI("as")?(F.skipSpaces(),xt=F.readId()):xt=re;else{if(xt=F.readId(),!xt)return I(F),null;if(F.peek()==="@"&&F.peekStr(2)==="@{"){F.advance(),F.advance();for(var N=1,Q="";!F.isEof()&&N>0;){var at=F.peek();if(at==="{")N++;else if(at==="}"&&(N--,N===0)){F.advance();break}Q+=at,F.advance()}var _=Q.match(/["']type["']\s*:\s*["']([^"']+)["']/),l=Q.match(/["']alias["']\s*:\s*["']([^"']+)["']/);_&&(ot=_[1].toLowerCase()),l&&(re=l[1])}if(F.skipSpaces(),F.matchI("as"))if(F.skipSpaces(),F.peek()==='"'||F.peek()==="'")re=F.readQuoted();else return re=F.readLine().trim(),T(X,Z,xt,re||xt,ot,dt),xt}return T(X,Z,xt,re||xt,ot,dt),I(F),xt}function d(F,X,Z,ot,dt){F.skipSpaces();var xt="right",re=F.readWord();re==="right"||re==="left"?(xt=re,F.skipSpaces(),F.matchI("of")):re==="over"&&(xt="over"),F.skipSpaces();var N=y(F),Q=null;xt==="over"&&F.peek()===","&&(F.advance(),F.skipSpaces(),Q=y(F)),F.skipSpaces();var at="";F.peek()===":"&&(F.advance(),F.skipSpaces()),at=F.readLine().trim(),N&&T(X,Z,N,N,"participant"),ot.push({actor:N,actor2:Q,text:at,placement:xt,beforeMessageIdx:dt.length})}function n(F,X,Z){F.skipSpaces();var ot="",dt="";if(F.peek()==='"'||F.peek()==="'")dt=F.readQuoted();else{var xt=F.readLine().trim(),re=xt.match(/^(rgb\([^)]*\)|rgba\([^)]*\)|#[0-9a-fA-F]{3,8})\s*(.*)/i);if(re)ot=re[1],dt=re[2]||"";else{var N=xt.split(/\s+/),Q="aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow,yellowgreen,transparent";N.length>1&&Q.indexOf(N[0].toLowerCase())>=0?(ot=N[0],dt=N.slice(1).join(" ")):dt=xt}}var at={name:dt,color:ot,actors:[]};X.push(at),Z.currentBox=at}function y(F){if(F.skipSpaces(),F.peek()==='"'||F.peek()==="'")return F.readQuoted();for(var X=F.pos;!F.isEof();){var Z=F.peek();if(Z==="-"||Z===":"||Z===`
-`||Z==="\r"||Z===";"||Z==="+"||Z==="#"||Z===",")break;if(Z===" "||Z===" "){var ot=F.save();if(F.skipSpaces(),b(F)){F.restore(ot);break}F.restore(ot);break}F.advance()}var dt=F.input.substring(X,F.pos).trim();return dt||null}function b(F){for(var X=F.save(),Z=0;Z<M.length;Z++){var ot=M[Z];if(F.peekStr(ot.length)===ot)return F.advance(ot.length),{pattern:ot,type:v[ot]}}return F.restore(X),null}function T(F,X,Z,ot,dt,xt){if(!X[Z]){var re={name:Z,label:ot||Z,type:dt};F.push(re),X[Z]=re,xt&&xt.currentBox&&xt.currentBox.actors.push(Z)}}function I(F){for(;!F.isEof();){var X=F.peek();if(X===`
-`||X==="\r"||X===";"){X===";"&&F.advance();return}F.advance()}}return{parse:u}})();var Xo=(function(){var L=0,j=1,P=2,E=3,w=4,p=0;function s(){p=p+2654435769|0;for(var r=p>>>0,h=r.toString(16);h.length<7;)h="0"+h;return h.slice(0,7)}function o(r,h,d){v=null,p=0;var n=new Ua(r),y=[],b={},T="main",I=0,F={},X=!0,Z=!0,ot=!1,dt=!0,xt=!1,re=null;d&&d.gitGraph&&(d.gitGraph.showBranches===!1&&(X=!1),d.gitGraph.showCommitLabel===!1&&(Z=!1),d.gitGraph.parallelCommits===!0&&(ot=!0),d.gitGraph.rotateCommitLabel===!1&&(dt=!1),d.gitGraph.mainBranchName&&(T=d.gitGraph.mainBranchName),typeof d.gitGraph.mainBranchOrder=="number"&&(re=d.gitGraph.mainBranchOrder)),b[T]={name:T,commits:[],order:re};var N="LR";if(h){var Q=h.toUpperCase();(Q==="TB"||Q==="TD"||Q==="BT"||Q==="LR"||Q==="RL")&&(N=Q==="TD"?"TB":Q,xt=N==="TB"||N==="BT")}for(n.skipWhitespaceAndComments();!n.isEof()&&(n.skipWhitespaceAndComments(),!n.isEof());)M(n,y,b,F,T,I),T=v||T,I=y.length;return{type:"gitgraph",commits:y,branches:b,commitMap:F,showBranches:X,showCommitLabel:Z,parallelCommits:ot,rotateCommitLabel:dt,isVertical:xt,dir:N}}var v=null;function M(r,h,d,n,y,b){r.skipSpaces();var T=r.save(),I=r.readWord(),F=I.toLowerCase();if(F==="commit"){f(r,h,d,n,y);return}else if(F==="branch"){r.skipSpaces();var X=r.readId(),Z=null;for(r.skipSpaces();!r.isEol()&&!r.isEof();){var ot=r.readWord();if(!ot)break;if(r.peek()===":"&&(r.advance(),r.skipSpaces(),ot==="order")){var dt=r.readWord(),xt=parseFloat(dt);isNaN(xt)||(Z=xt)}r.skipSpaces()}if(X){if(d[X])Z!=null&&(d[X].order=Z);else{var re=null,N=d[y];N&&N.commits.length>0?re=N.commits[N.commits.length-1]:N&&N.startCommit&&(re=N.startCommit),d[X]={name:X,commits:[],startCommit:re,order:Z}}v=X}u(r);return}else if(F==="checkout"||F==="switch"){r.skipSpaces();var X=r.readId();X&&(v=X,d[X]||(d[X]={name:X,commits:[]})),u(r);return}else if(F==="merge"){r.skipSpaces();var Q=r.readId(),at=null,_=null,l=null;for(r.skipSpaces();!r.isEol()&&!r.isEof();){var ot=r.readWord();if(!ot)break;if(r.peek()===":"){if(r.advance(),r.skipSpaces(),ot==="id")at=r.peek()==='"'?r.readQuoted():r.readId();else if(ot==="tag")_=r.peek()==='"'?r.readQuoted():r.readId();else if(ot==="type"){var O=r.readWord();O==="REVERSE"?l=j:O==="HIGHLIGHT"&&(l=P)}}r.skipSpaces()}at||(at=h.length+"-"+s());var z=[];d[y]&&d[y].commits.length>0&&z.push(d[y].commits[d[y].commits.length-1]),Q&&d[Q]&&d[Q].commits.length>0&&z.push(d[Q].commits[d[Q].commits.length-1]);var lt={id:at,message:"merge "+(Q||""),tag:_,tags:_?[_]:[],type:E,customType:l,branch:y,parents:z};n[at]=h.length,h.push(lt),d[y]&&d[y].commits.push(at),u(r);return}else if(F==="cherry-pick"||F==="cherrypick"){r.skipSpaces();for(var at=null,W=null,pt=null;!r.isEol()&&!r.isEof();){var ot=r.readWord();if(!ot)break;if(r.peek()===":"){r.advance(),r.skipSpaces();var mt=r.peek()==='"'?r.readQuoted():r.readId();ot==="id"?at=mt:ot==="parent"?W=mt:ot==="tag"&&(pt=mt)}r.skipSpaces()}if(at){var Tt=h.length+"-"+s(),z=[];d[y]&&d[y].commits.length>0&&z.push(d[y].commits[d[y].commits.length-1]),n[at]!=null&&z.push(at);var Rt=pt!=null?pt:"cherry-pick:"+at+(W?"|parent:"+W:""),lt={id:Tt,message:"cherry-pick from "+at,tag:Rt,tags:[Rt],type:w,branch:y,parents:z,cherryPickSource:at};n[Tt]=h.length,h.push(lt),d[y]&&d[y].commits.push(Tt)}u(r);return}u(r)}function f(r,h,d,n,y){var b=null,T="",I=null,F=L;for(r.skipSpaces();!r.isEol()&&!r.isEof();){var X=r.readWord();if(!X)break;if(r.peek()===":"){if(r.advance(),r.skipSpaces(),X==="id")b=r.peek()==='"'?r.readQuoted():r.readId();else if(X==="msg"||X==="message")T=r.peek()==='"'?r.readQuoted():r.readLine().trim();else if(X==="tag")I=r.peek()==='"'?r.readQuoted():r.readId();else if(X==="type"){var Z=r.readWord();Z==="REVERSE"?F=j:Z==="HIGHLIGHT"&&(F=P)}}r.skipSpaces()}if(!b)b=h.length+"-"+s();else if(n[b]!=null){var ot=n[b],dt=h[ot];if(dt&&d[dt.branch]){var xt=d[dt.branch].commits.indexOf(b);xt>=0&&d[dt.branch].commits.splice(xt,1)}h.splice(ot,1);for(var re in n)n.hasOwnProperty(re)&&n[re]>ot&&n[re]--;delete n[b]}var N=[];d[y]&&d[y].commits.length>0?N.push(d[y].commits[d[y].commits.length-1]):d[y]&&d[y].startCommit&&N.push(d[y].startCommit);var Q={id:b,message:T,tag:I,tags:I?[I]:[],type:F,branch:y,parents:N};n[b]=h.length,h.push(Q),d[y]&&d[y].commits.push(b)}function u(r){for(;!r.isEof();){var h=r.peek();if(h===`
-`||h==="\r"||h===";"){h===";"&&r.advance();return}r.advance()}}return{parse:o}})();var qo=(function(){var L=["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"];function j(E,w,p){var s=new Ua(E),o="",v=[],M=null,f={};for(s.skipWhitespaceAndComments();!s.isEof()&&(s.skipWhitespaceAndComments(),!s.isEof());){if(s.skipSpaces(),s.isEol()){s.advance();continue}var u=s.save(),r=s.readWord();if(r==="title"){s.skipSpaces(),o=s.readLine().trim();continue}else if(r==="section"){s.skipSpaces();var h=s.readLine().trim();M={name:h,tasks:[]},v.push(M);continue}else s.restore(u);var d=s.readLine().trim();if(d){var n=P(d,f);n&&(M||(M={name:"",tasks:[]},v.push(M)),M.tasks.push(n))}}for(var y=Object.keys(f).sort(),b=0;b<y.length;b++)f[y[b]].color=L[b%L.length],f[y[b]].position=b;return{type:"journey",title:o,sections:v,actors:f}}function P(E,w){var p=E.split(":");if(p.length<2)return null;var s=p[0].trim(),o=parseInt(p[1].trim());(isNaN(o)||o<1)&&(o=3),o>5&&(o=5);var v={};if(p.length>=3)for(var M=p[2].split(","),f=0;f<M.length;f++){var u=M[f].trim();u&&(w[u]||(w[u]={color:null,position:-1}),v[u]=w[u])}return{task:s,score:o,actors:v}}return{parse:j}})();var $o=(function(){var L=[["((","))","circle"],["(",")","roundedRect"],["[[","]]","subroutine"],["[","]","rect"],["{{","}}","hexagon"],["))","((","mindmapBang"],[")","(","cloud"]],j=11,P=["#FFFF78","#D7FF86","#C286FF","#FF86FF","#FF86C2","#FF8686","#FFC286","#C2FF86","#86FFC2","#86FFFF","#86C2FF"],E=["#000000","#000000","#FFFFFF","#000000","#000000","#000000","#000000","#000000","#000000","#000000","#000000"],w=["#ABABFF","#D0B9FF","#DCFFB9","#B9FFB9","#B9FFDC","#B9FFFF","#B9DCFF","#DCB9FF","#FFB9DC","#FFB9B9","#FFDCB9"],p="#0000EC",s="#FFFFFF",o="#FFFFB9";function v(h,d,n){h=h.replace(/\["`([^`"]*)`"\]/g,function(lt,W){return'["`'+W.replace(/\n+/g,"<br>")+'`"]'});for(var y=h.split(`
-`),b=[],T=[],I=0,F=[],X=null,Z=0;Z<y.length;Z++){var ot=y[Z],dt=ot.replace(/^\s+/,"");if(!(!dt||dt.substring(0,2)==="%%")&&!(dt==="mindmap"&&b.length===0)&&!/^::icon\(/.test(dt)){if(/^:::/.test(dt)){var xt=b[b.length-1];xt&&(xt.classes=dt.substring(3).trim());continue}for(var re=0,N=0;N<ot.length;N++)if(ot[N]===" ")re+=4;else if(ot[N]===" ")re+=1;else break;var Q=u(dt),at="mm"+I++;X===null&&(X=re);var _=re-X,l={id:at,label:Q.label,shape:Q.shape,level:_,rawIndent:re,classes:Q.classes};b.push(l);for(var O=b.length-1;F.length>0&&F[F.length-1].rawIndent>=re;)F.pop();if(F.length>0){var z=F[F.length-1].nodeIdx;l.parentIdx=z,l.isRoot=!1,T.push({sourceId:b[z].id,targetId:at,sourceLevel:b[z].level})}else l.parentIdx=-1,l.isRoot=!0;F.push({rawIndent:re,nodeIdx:O})}}return M(b),r(b,T,d,n)}function M(h){if(h.length!==0){for(var d={},n=0;n<h.length;n++){var y=h[n];if(y.parentIdx>=0){var b=h[y.parentIdx].id;d[b]||(d[b]=[]),d[b].push(n)}}var T=h[0];T.section=void 0;for(var I=d[T.id]||[],n=0;n<I.length;n++){var F=I[n],X=n%j;f(F,X,h,d,0)}}}function f(h,d,n,y,b){var T=n[h];if(T.section=d,!(b>=1e3))for(var I=y[T.id]||[],F=0;F<I.length;F++)f(I[F],d,n,y,b+1)}function u(h){var d="default",n=h,y=null,b=h.indexOf(":::");b>=0&&(y=h.substring(b+3).trim(),h=h.substring(0,b).trim(),n=h);var T=h.indexOf("::icon(");T>=0&&(h=h.substring(0,T).trim(),n=h);for(var I=0;I<L.length;I++){var F=L[I][0],X=L[I][1],Z=L[I][2],ot=h.indexOf(F);if(ot>=0){var dt=h.lastIndexOf(X);if(dt>ot+F.length-1){var xt=h.substring(0,ot).trim();n=h.substring(ot+F.length,dt).trim(),d=Z,!n&&xt&&(n=xt);break}}}return n||(n=h.trim()),n.length>=4&&n.charAt(0)==='"'&&n.charAt(1)==="`"&&n.charAt(n.length-1)==='"'&&n.charAt(n.length-2)==="`"?n="`"+n.substring(2,n.length-2)+"`":n.length>=2&&n.charAt(0)==='"'&&n.charAt(n.length-1)==='"'&&(n=n.substring(1,n.length-1)),{shape:d,label:n,classes:y}}function r(h,d,n,y){if(h.length===0)return{id:"root",children:[],edges:[],layoutOptions:{}};for(var b={},T={},I=0;I<h.length;I++){var F=h[I];T[F.id]=F;var X=F.shape==="default",Z=F.shape;Z==="default"&&(Z="roundedRect");var ot,dt,xt,re;if(F.isRoot)ot=p,dt=p,xt=s,re=X?o:null;else{var N=F.section!=null?F.section:0;ot=P[N],dt=ot,xt=E[N],re=X?w[N]:null}b[F.id]={id:F.id,labels:[{text:F.label}],width:0,height:0,children:[],edges:[],drawio:{shape:Z,labelText:F.label,cssStyles:null,mindmap:!0,mindmapRoot:F.isRoot,mindmapSection:F.section,mindmapFill:ot,mindmapStroke:dt,mindmapFont:xt,mindmapLine:re}}}for(var Q=[],I=0;I<h.length;I++)Q.push(b[h[I].id]);for(var at=[],I=0;I<d.length;I++){var _=d[I],l=T[_.sourceId],O=T[_.targetId],z=(l?l.level:0)+1,lt=14-3*z,W=lt>0?lt:3,N=O&&O.section!=null?O.section:0,pt=P[N];at.push({id:"e"+I,sources:[_.sourceId],targets:[_.targetId],drawio:{arrowTypeStart:"none",arrowTypeEnd:"none",pattern:"solid",thickness:null,strokeWidth:W,strokeColor:pt,mindmapEdge:!0}})}return{id:"root",layoutOptions:{"elk.algorithm":"mrtree","elk.direction":"RIGHT","elk.spacing.nodeNode":30,"elk.layered.spacing.nodeNodeBetweenLayers":40},drawio:{isMindmap:!0},children:Q,edges:at}}return{parse:v}})();var Go=(function(){function L(j,P,E,w){var p="",s=!1,o=[];if(w&&w.remainder){var v=w.remainder.trim(),M=v.match(/^showdata\b/i);M&&(s=!0,v=v.substring(M[0].length).trim());var f=v.match(/^title\b\s*(.*)$/i);f&&(p=f[1].trim())}for(var u=new Ua(j);!u.isEof()&&(u.skipWhitespaceAndComments(),!u.isEof());){if(u.skipSpaces(),u.isEol()){u.advance();continue}var r=u.save(),h=u.readWord();if(h==="title"&&!p){u.skipSpaces(),p=u.readLine().trim();continue}else if(h.toLowerCase()==="showdata"){s=!0,u.skipSpaces();var d=u.save(),n=u.readWord();n==="title"?(u.skipSpaces(),p=u.readLine().trim()):(u.restore(d),u.readLine());continue}else u.restore(r);var y=u.readLine().trim();if(y){var b=y.match(/^"([^"]*)"\s*:\s*([0-9]+(?:\.[0-9]+)?)\s*$/);if(b){var T=parseFloat(b[2]);!isNaN(T)&&T>0&&o.push({label:b[1],value:T})}}}for(var I=0,F=0;F<o.length;F++)I+=o[F].value;return{type:"pie",title:p,showData:s,sections:o,total:I}}return{parse:L}})();var Zo=(function(){var L=1e6;function j(E,w,p){var s=new Ua(E),o="",v=[],M=0;for(s.skipWhitespaceAndComments();!s.isEof()&&(s.skipWhitespaceAndComments(),!s.isEof());){if(s.skipSpaces(),s.isEol()){s.advance();continue}var f=s.save(),u=s.readWord();if(u.toLowerCase()==="title"){s.skipSpaces(),o=s.readLine().trim();continue}s.restore(f);var r=s.readLine().trim();if(!(!r||r.substring(0,2)==="%%")){var h=P(r,M);h&&(v.push(h),M=h.end+1)}}return!o&&p&&typeof p.title=="string"&&(o=p.title),{type:"packet",title:o,fields:v}}function P(E,w){var p=E.indexOf(":");if(p<0)return null;var s=E.substring(0,p).trim(),o=E.substring(p+1).trim(),v=o;(v[0]==='"'&&v[v.length-1]==='"'||v[0]==="'"&&v[v.length-1]==="'")&&(v=v.substring(1,v.length-1));var M,f;if(s[0]==="+"){var u=parseInt(s.substring(1),10);if(isNaN(u)||u<1)return null;M=w,f=w+u-1}else{var r=s.indexOf("-");if(r>=0?(M=parseInt(s.substring(0,r),10),f=parseInt(s.substring(r+1),10)):(M=parseInt(s,10),f=M),isNaN(M)||isNaN(f)||f<M)return null}return M>L||f>L?null:{start:M,end:f,label:v}}return{parse:j}})();var Ko=(function(){function L(p,s,o,v){for(var M="",f=null,u=null,r={q1:"",q2:"",q3:"",q4:""},h=[],d={},n=p.split(`
-`),y=0;y<n.length;y++){var b=n[y].trim();if(!(!b||b.substring(0,2)==="%%")){var T;if(T=b.match(/^title\s+(.*)$/i))M=T[1].trim();else if(T=b.match(/^x-axis\s+(.*)$/i))f=j(T[1].trim());else if(T=b.match(/^y-axis\s+(.*)$/i))u=j(T[1].trim());else if(T=b.match(/^quadrant-([1-4])\s+(.*)$/i))r["q"+T[1]]=T[2].trim();else if(T=b.match(/^classDef\s+(\S+)\s+(.*)$/i))d[T[1]]=E(T[2]);else{var I=P(b);I&&h.push(I)}}}return!M&&o&&typeof o.title=="string"&&(M=o.title),{type:"quadrant",title:M,xAxis:f,yAxis:u,quadrants:r,points:h,classes:d}}function j(p){var s=p.indexOf("-->");return s>=0?{left:w(p.substring(0,s).trim()),right:w(p.substring(s+3).trim())}:{left:w(p.trim()),right:null}}function P(p){var s=p.match(/^([^:]+?)(?::::(\w+))?:\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\](.*)$/);if(!s)return null;var o=parseFloat(s[3]),v=parseFloat(s[4]);return isNaN(o)||isNaN(v)?null:{name:w(s[1].trim()),className:s[2]||null,x:o,y:v,styles:E((s[5]||"").trim())}}function E(p){var s={};if(!p)return s;for(var o=p.split(","),v=0;v<o.length;v++){var M=o[v].trim(),f=M.indexOf(":");if(!(f<=0)){var u=M.substring(0,f).trim().toLowerCase(),r=M.substring(f+1).trim();u&&r&&(s[u]=r)}}return s}function w(p){return p&&(p.charAt(0)==='"'&&p.charAt(p.length-1)==='"'||p.charAt(0)==="'"&&p.charAt(p.length-1)==="'"?p.substring(1,p.length-1):p)}return{parse:L}})();var Qo=(function(){function L(j,P,E,w){for(var p="",s=[],o=null,v=null,M=!1,f=j.split(`
-`),u=0;u<f.length;u++){var r=f[u],h=r.trim();if(!(!h||h.substring(0,2)==="%%")){var d;if(d=h.match(/^title\s+(.*)$/i)){p=d[1].trim();continue}if(d=h.match(/^section\s+(.*)$/i)){o={name:d[1].trim(),periods:[]},s.push(o),v=null,M=!0;continue}if(h.charAt(0)===":"){if(v)for(var b=h.split(":"),n=1;n<b.length;n++){var y=b[n].trim();y&&v.events.push(y)}continue}var b=h.split(":");if(!(b.length<2)){for(var T=b[0].trim(),I=[],n=1;n<b.length;n++){var y=b[n].trim();y&&I.push(y)}o||(o={name:"",periods:[]},s.push(o)),v={name:T,events:I},o.periods.push(v)}}}return!p&&E&&typeof E.title=="string"&&(p=E.title),{type:"timeline",title:p,sections:s,explicitSections:M,direction:P||""}}return{parse:L}})();var Jo=(function(){function L(P,E,w,p){for(var s=[],o=null,v=-1,M=P.split(`
-`),f=0;f<M.length;f++){var u=M[f],r=u.replace(/\s+$/,"");if(r){var h=r.match(/^(\s*)/),d=h?h[1].length:0,n=r.substring(d);if(n.substring(0,2)!=="%%"){var y,b,T,I=n.match(/^(\w[\w-]*)\s*\[([^\]]*)\]\s*(@\{[\s\S]*\})?\s*$/);if(I)y=I[1],b=I[2],T=I[3];else if(I=n.match(/^\[([^\]]*)\]\s*(@\{[\s\S]*\})?\s*$/))b=I[1],y="_anon_"+(s.length+1)+"_"+f,T=I[2];else if(n.length>500)b=n,y=b.replace(/\W+/g,"_");else if(I=n.match(/^([^\[\]@\s][^\[\]@]*?)\s*(@\{[\s\S]*\})?\s*$/))b=I[1],y=b.replace(/\W+/g,"_"),T=I[2];else continue;var F=null;T&&(F=j(T.substring(2,T.length-1))),v<0&&(v=d),d<=v?(o={id:y,label:b,cards:[],metadata:F},s.push(o)):(o||(o={id:"_implicit",label:"",cards:[],metadata:null},s.push(o)),o.cards.push({id:y,label:b,metadata:F}))}}}return{type:"kanban",columns:s}}function j(P){for(var E={},w=/(\w+)\s*:\s*(?:"([^"]*)"|'([^']*)'|([^,}\s][^,}]*))/g,p;(p=w.exec(P))!==null;){var s=p[1],o=p[2]!==void 0?p[2]:p[3]!==void 0?p[3]:(p[4]||"").trim();E[s]=o}return E}return{parse:L}})();var ts=(function(){function L(p,s,o,v){for(var M="",f=null,u=null,r=[],h="vertical",d=p.split(`
-`),n=0;n<d.length;n++){var y=d[n].trim();if(!(!y||y.substring(0,2)==="%%")){if(y==="horizontal"||y==="vertical"){h=y;continue}var b;if(b=y.match(/^title\s+(.*)$/i)){M=w(b[1].trim());continue}if(b=y.match(/^x-axis\s+(.*)$/i)){f=j(b[1].trim(),!0);continue}if(b=y.match(/^y-axis\s+(.*)$/i)){u=j(b[1].trim(),!1);continue}if(b=y.match(/^bar\s*\[([^\]]*)\]\s*$/i)){r.push({type:"bar",values:E(b[1])});continue}if(b=y.match(/^line\s*\[([^\]]*)\]\s*$/i)){r.push({type:"line",values:E(b[1])});continue}}}!M&&o&&typeof o.title=="string"&&(M=o.title);var T=!1,I=!1;return o&&o.xyChart&&(o.xyChart.showDataLabel&&(T=!0),o.xyChart.showDataLabelOutsideBar&&(I=!0)),{type:"xychart",title:M,orientation:h,xAxis:f||{title:"",type:"numeric",min:null,max:null},yAxis:u||{title:"",type:"numeric",min:null,max:null},series:r,showDataLabel:T,showDataLabelOutsideBar:I}}function j(p,s){var o="",v=p;if(v.charAt(0)==='"'){var M=v.indexOf('"',1);M>0&&(o=v.substring(1,M),v=v.substring(M+1).trim())}if(v.charAt(0)==="["&&s)return{title:o,type:"categorical",categories:P(v)};var f=v.indexOf("-->");if(f>=0){var u=v.substring(0,f).trim(),r=v.substring(f+3).trim(),h=u.length>0?u.split(/\s+/):[],d=h.length>0?h[h.length-1]:"";return!o&&h.length>1&&(o=h.slice(0,-1).join(" ")),{title:o,type:"numeric",min:parseFloat(d),max:parseFloat(r)}}return!o&&v&&(o=v),{title:o,type:"numeric",min:null,max:null}}function P(p){for(var s=p.lastIndexOf("]"),o=p.substring(1,s>=0?s:p.length),v=[],M="",f=!1,u="",r=0;r<o.length;r++){var h=o.charAt(r);f?h===u?f=!1:M+=h:h==='"'||h==="'"?(f=!0,u=h):h===","?(M.trim()&&v.push(M.trim()),M=""):M+=h}return M.trim()&&v.push(M.trim()),v}function E(p){for(var s=p.split(","),o=[],v=0;v<s.length;v++){var M=parseFloat(s[v].trim());isNaN(M)||o.push(M)}return o}function w(p){return p&&(p.charAt(0)==='"'&&p.charAt(p.length-1)==='"'||p.charAt(0)==="'"&&p.charAt(p.length-1)==="'"?p.substring(1,p.length-1):p)}return{parse:L}})();var es=(function(){function L(p,s,o,v){for(var M="",f=[],u=[],r="circle",h=null,d=null,n=null,y=p.split(`
-`),b=0;b<y.length;b++){var T=y[b].trim();if(!(!T||T.substring(0,2)==="%%")){var I;if(I=T.match(/^title\s+(.*)$/i)){M=w(I[1].trim());continue}if(I=T.match(/^axis\s+(.*)$/i)){j(I[1],f);continue}if(I=T.match(/^curve\s+(.*)$/i)){P(I[1],u);continue}if(I=T.match(/^graticule\s+(\w+)\s*$/i)){r=I[1].toLowerCase();continue}if(I=T.match(/^max\s+(-?\d+(?:\.\d+)?)\s*$/i)){h=parseFloat(I[1]);continue}if(I=T.match(/^min\s+(-?\d+(?:\.\d+)?)\s*$/i)){d=parseFloat(I[1]);continue}if(I=T.match(/^ticks\s+(\d+)\s*$/i)){n=parseInt(I[1],10);continue}}}return!M&&o&&typeof o.title=="string"&&(M=o.title),{type:"radar",title:M,axes:f,curves:u,graticule:r,max:h,min:d,ticks:n}}function j(p,s){for(var o=E(p,","),v=0;v<o.length;v++){var M=o[v].trim();if(M){var f=M.match(/^(\w+)\s*(?:\[\s*"([^"]*)"\s*\])?\s*$/);f&&s.push({id:f[1],label:f[2]!=null?f[2]:f[1]})}}}function P(p,s){for(var o=E(p,","),v=0;v<o.length;){var M=o[v].trim();if(!M){v++;continue}var f=M.match(/^(\w+)\s*(?:\[\s*"([^"]*)"\s*\])?\s*\{(.*)$/);if(!f){v++;continue}var u=f[1],r=f[2]!=null?f[2]:u,h=f[3],d=[h];for(v++;v<o.length&&h.indexOf("}")<0;){var n=o[v];d.push(n),h=n,v++}var y=d.join(","),b=y.lastIndexOf("}");if(!(b<0)){var T=y.substring(0,b).trim(),I;if(T.indexOf(":")>=0){I={};for(var F=T.split(","),X=0;X<F.length;X++){var Z=F[X].split(":");if(Z.length===2){var ot=Z[0].trim(),dt=parseFloat(Z[1].trim());ot&&!isNaN(dt)&&(I[ot]=dt)}}}else{I=[];for(var xt=T.split(","),X=0;X<xt.length;X++){var dt=parseFloat(xt[X].trim());isNaN(dt)||I.push(dt)}}s.push({id:u,label:r,values:I})}}}function E(p,s){for(var o=[],v=0,M="",f=0;f<p.length;f++){var u=p.charAt(f);u==="{"||u==="["?(v++,M+=u):u==="}"||u==="]"?(v--,M+=u):u===s&&v===0?(o.push(M),M=""):M+=u}return M&&o.push(M),o}function w(p){return p&&(p.charAt(0)==='"'&&p.charAt(p.length-1)==='"'||p.charAt(0)==="'"&&p.charAt(p.length-1)==="'"?p.substring(1,p.length-1):p)}return{parse:L}})();var rs=(function(){function L(o,v,M,f){var u={id:"root",type:"root",columns:-1,columnsExplicit:!1,children:[]},r=[u],h=[],d={},n={},y={},b=0,T=0;if(f&&f.remainder){var I=f.remainder.trim().match(/^columns\s+(\S+)/i);I&&(u.columns=j(I[1]),u.columnsExplicit=!0)}for(var F=o.split(`
-`),X=0;X<F.length;X++){var Z=F[X].trim();if(!(!Z||Z.substring(0,2)==="%%")){var ot=Z.match(/^columns\s+(\S+)/i);if(ot){var dt=r[r.length-1];dt.columns=j(ot[1]),dt.columnsExplicit=!0;continue}var xt=Z.match(/^style\s+([\w-]+(?:\s*,\s*[\w-]+)*)\s+(.+?)\s*;?\s*$/i);if(xt){for(var re=xt[1].split(/\s*,\s*/),N=xt[2],Q=0;Q<re.length;Q++)n[re[Q]]=(n[re[Q]]||"")+N+";";continue}var at=Z.match(/^classdef\s+([\w-]+)\s+(.+?)\s*;?\s*$/i);if(at){var _=at[1];y[_]=(y[_]||"")+at[2]+";";continue}var l=Z.match(/^class\s+([\w-]+(?:\s*,\s*[\w-]+)*)\s+([\w-]+)\s*;?\s*$/i);if(l){for(var O=l[1].split(/\s*,\s*/),z=l[2],lt=y[z]||"",Q=0;Q<O.length;Q++)n[O[Q]]=(n[O[Q]]||"")+lt;continue}if(!/^(link|click)\b/i.test(Z)){if(/^end\b/i.test(Z)){r.length>1&&r.pop();continue}var W=Z.match(/^block(?::([\w-]+)(?::(\d+))?)?(?=\s|$)\s*(.*)$/);if(W){var pt=W[1],mt=pt||"_anon_block_"+ ++T,Tt={id:mt,type:"container",label:"",shape:"rect",widthInColumns:W[2]?parseInt(W[2],10):1,columns:-1,columnsExplicit:!1,children:[]};r[r.length-1].children.push(Tt),r.push(Tt);var Rt=W[3].trim(),It=Rt.match(/^columns\s+(\S+)/i);It&&(Tt.columns=j(It[1]),Tt.columnsExplicit=!0);continue}if(/-->|---|\.->|===/.test(Z)){if(E(Z,r[r.length-1],h,d))continue;s(Z,h);continue}var te=r[r.length-1],Qt=te.children.length;P(Z,te.children,d);for(var pe=0,ue=Qt;ue<te.children.length;ue++)pe+=te.children[ue].widthInColumns||1;pe>b&&(b=pe)}}}return!u.columnsExplicit&&b>1&&(u.columns=b),{type:"block",root:u,columns:u.columns,nodes:[],edges:h,styles:n}}function j(o){if(o==="auto")return-1;var v=parseInt(o,10);return isNaN(v)?-1:v}function P(o,v,M){for(var f=0,u=o.length;f<u;){for(;f<u&&(o.charAt(f)===" "||o.charAt(f)===" ");)f++;if(f>=u)break;for(var r=f;f<u;){var h=o.charAt(f);if(/[\w-]/.test(h))f++;else break}var d=o.substring(r,f);if(!d)break;var n=d,y="rect",b=1,T=null,I=d.toLowerCase()==="space";if(o.charAt(f)==="["&&o.charAt(f+1)==="("){for(var F=f+2,X="";F<u;){var h=o.charAt(F);if(h==='"'){var Z=o.indexOf('"',F+1);if(Z<0)break;X+=o.substring(F+1,Z),F=Z+1}else if(h===")"&&o.charAt(F+1)==="]"){n=X.trim(),y="cylinder",F+=2;break}else X+=h,F++}f=F}else if(o.charAt(f)==="["&&o.charAt(f+1)==="["){for(var F=f+2,X="";F<u;){var h=o.charAt(F);if(h==='"'){var Z=o.indexOf('"',F+1);if(Z<0)break;X+=o.substring(F+1,Z),F=Z+1}else if(h==="]"&&o.charAt(F+1)==="]"){n=X.trim(),y="subroutine",F+=2;break}else X+=h,F++}f=F}else if(o.charAt(f)==="["&&(o.charAt(f+1)==="/"||o.charAt(f+1)==="\\")){for(var ot=o.charAt(f+1),F=f+2,X="";F<u;){var h=o.charAt(F);if(h==='"'){var Z=o.indexOf('"',F+1);if(Z<0)break;X+=o.substring(F+1,Z),F=Z+1}else if((h==="/"||h==="\\")&&o.charAt(F+1)==="]"){var dt=h;ot==="/"&&dt==="/"?y="lean_right":ot==="\\"&&dt==="\\"?y="lean_left":ot==="/"&&dt==="\\"?y="trapezoid":ot==="\\"&&dt==="/"&&(y="inv_trapezoid"),n=X.trim(),F+=2;break}else X+=h,F++}f=F}else if(o.charAt(f)==="["){var xt=0,re=f,X="",N=o.charAt(f);for(f++;f<u;){var h=o.charAt(f);if(h==='"'){var Z=o.indexOf('"',f+1);if(Z<0)break;X+=o.substring(f+1,Z),f=Z+1}else if(h==="]"){f++;break}else X+=h,f++}n=X.trim()}else if(o.charAt(f)==="("&&o.charAt(f+1)==="["){var Q=o.indexOf("])",f+2);Q>0&&(n=o.substring(f+2,Q).replace(/^"|"$/g,"").trim(),y="stadium",f=Q+2)}else if(o.charAt(f)==="("&&o.charAt(f+1)==="("&&o.charAt(f+2)==="("){var Q=o.indexOf(")))",f+3);Q>0&&(n=o.substring(f+3,Q).replace(/^"|"$/g,"").trim(),y="doublecircle",f=Q+3)}else if(o.charAt(f)==="("&&o.charAt(f+1)==="("){var Q=o.indexOf("))",f+2);Q>0&&(n=o.substring(f+2,Q).replace(/^"|"$/g,"").trim(),y="circle",f=Q+2)}else if(o.charAt(f)==="("){for(var F=f+1,Q=-1;F<u;){var at=o.charAt(F);if(at==='"'){var Z=o.indexOf('"',F+1);if(Z<0)break;F=Z+1}else if(at===")"){Q=F;break}else F++}Q>0&&(n=o.substring(f+1,Q).replace(/^"|"$/g,"").trim(),y="rounded",f=Q+1)}else if(o.charAt(f)==="{")if(o.charAt(f+1)==="{"){var Q=o.indexOf("}}",f+2);Q>0&&(n=o.substring(f+2,Q).replace(/^"|"$/g,"").trim(),y="hexagon",f=Q+2)}else{var Q=o.indexOf("}",f+1);Q>0&&(n=o.substring(f+1,Q).replace(/^"|"$/g,"").trim(),y="diamond",f=Q+1)}else if(o.charAt(f)===">"){var Q=o.indexOf("]",f+1);Q>0&&(n=o.substring(f+1,Q).replace(/^"|"$/g,"").trim(),y="odd",f=Q+1)}else if(o.charAt(f)==="<"&&o.charAt(f+1)==="["){var _=o.indexOf("]>",f+2);if(_>0&&(n=o.substring(f+2,_).replace(/^"|"$/g,"").trim(),y="block-arrow",f=_+2,o.charAt(f)==="(")){var l=o.indexOf(")",f+1);l>0&&(T=o.substring(f+1,l).split(/\s*,\s*/).map(function(lt){return lt.trim().toLowerCase()}).filter(Boolean),f=l+1)}}if(o.charAt(f)===":"){f++;for(var O=f;f<u&&/\d/.test(o.charAt(f));)f++;b=parseInt(o.substring(O,f),10)||1}if(I)v.push({id:"_space_"+v.length,type:"space",label:"",shape:"rect",widthInColumns:b,span:b,isSpace:!0});else{var z={id:d,type:"leaf",label:n,shape:y,widthInColumns:b,span:b,isSpace:!1};T&&(z.directions=T),v.push(z),M[d]=v.length-1}}}function E(o,v,M,f){if(o.length>500)return!1;var u=o.match(/^\s*([\w-]+(?:\([^)]*\)|\[[^\]]*\]|\{[^}]*\}|<\[[^\]]*\]>\([^)]*\)|>[^\]]*\])?)\s*((?:-+\.?>|-+|=+>|=+|-\.->))\s*(?:\|([^|]*)\|\s*)?([\w-]+(?:\([^)]*\)|\[[^\]]*\]|\{[^}]*\}|<\[[^\]]*\]>\([^)]*\)|>[^\]]*\])?)\s*$/);if(!u)return!1;var r=u[1],h=u[2],d=u[3]||"",n=u[4];if(!/[([{<>]/.test(r)&&!/[([{<>]/.test(n))return!1;var y=w(r),b=w(n);if(!y||!b)return!1;p(v,y,f),p(v,b,f);var T="solid",I="none";return h.indexOf(".")>=0?T="dotted":h.indexOf("=")>=0&&(T="thick"),h.indexOf(">")>=0&&(I="block"),M.push({source:y.id,target:b.id,text:d,pattern:T,arrowEnd:I}),!0}function w(o){var v=[];return P(o,v,{}),v.length!==1?null:v[0]}function p(o,v,M){for(var f=0;f<o.children.length;f++)if(o.children[f].id===v.id){v.label&&v.label!==v.id&&(o.children[f].label=v.label),v.shape&&v.shape!=="rect"&&(o.children[f].shape=v.shape),v.directions&&(o.children[f].directions=v.directions);return}o.children.push(v),M[v.id]=o.children.length-1}function s(o,v){var M="",f=o.replace(/\s*"([^"]*)"\s*/,function(T,I){return M=I,""}),u=f.match(/^(\w+(?:-+\w+)*)\s*((?:-+\.?>|-+|=+>|=+|-\.->))\s*(?:\|([^|]*)\|\s*)?(\w+(?:-+\w+)*)\s*$/);if(u){var r=u[1],h=u[2],d=u[3]||M||"",n=u[4],y="solid",b="none";h.indexOf(".")>=0?y="dotted":h.indexOf("=")>=0&&(y="thick"),h.indexOf(">")>=0&&(b="block"),v.push({source:r,target:n,text:d,pattern:y,arrowEnd:b})}}return{parse:L}})();var as=(function(){var L={person:!0,person_ext:!0,system:!0,system_ext:!0,systemdb:!0,systemdb_ext:!0,systemqueue:!0,systemqueue_ext:!0,container:!0,container_ext:!0,containerdb:!0,containerdb_ext:!0,containerqueue:!0,containerqueue_ext:!0,component:!0,component_ext:!0,componentdb:!0,componentdb_ext:!0,componentqueue:!0,componentqueue_ext:!0,node:!0,node_l:!0,node_r:!0,deployment_node:!0,boundary:!0,system_boundary:!0,enterprise_boundary:!0,container_boundary:!0},j={rel:!0,birel:!0,rel_u:!0,rel_up:!0,rel_d:!0,rel_down:!0,rel_l:!0,rel_left:!0,rel_r:!0,rel_right:!0,rel_back:!0,relindex:!0};function P(f,u,r,h){for(var d="",n=[],y=[],b=h&&h.keyword||"C4Context",T=4,I=2,F=[],X={},Z=f.split(`
-`),ot=0;ot<Z.length;ot++){var dt=Z[ot].trim();if(!(!dt||dt.substring(0,2)==="%%")){var xt;if(xt=dt.match(/^title\s+(.*)$/i)){d=xt[1].trim();continue}if(/^UpdateLayoutConfig/i.test(dt)){var re=dt.match(/\$c4ShapeInRow\s*=\s*"?(\d+)"?/i);re&&(T=parseInt(re[1],10));var N=dt.match(/\$c4BoundaryInRow\s*=\s*"?(\d+)"?/i);N&&(I=parseInt(N[1],10));continue}var Q=dt.match(/^UpdateRelStyle\s*\(([^)]*)\)\s*$/i);if(Q){for(var at=M(Q[1]),_=at[0]&&at[0].replace(/^"|"$/g,"").trim(),l=at[1]&&at[1].replace(/^"|"$/g,"").trim(),O={},z=2;z<at.length;z++){var lt=at[z].match(/^\$(\w+)\s*=\s*"?([^"]+)"?\s*$/);lt&&(O[lt[1]]=lt[2])}F.push({from:_,to:l,overrides:O});continue}var W=dt.match(/^UpdateElementStyle\s*\(([^)]*)\)\s*$/i);if(W){for(var pt=M(W[1]),mt=pt[0]&&pt[0].replace(/^"|"$/g,"").trim(),Tt={},Rt=1;Rt<pt.length;Rt++){var It=pt[Rt].match(/^\$(\w+)\s*=\s*"?([^"]+)"?\s*$/);It&&(Tt[It[1]]=It[2])}mt&&(X[mt]=Tt);continue}if(!/^(SHOW_LEGEND|LAYOUT)/i.test(dt)&&dt!=="}"){var te=E(dt);if(te){var Qt=te.name.toLowerCase();if(L[Qt]){var pe=s(te.name,Qt,te.args);te.hasBlock&&(pe.children=[],ot=p(Z,ot+1,pe.children,y)),n.push(pe)}else j[Qt]&&y.push(o(te.name,Qt,te.args))}}}}if(!d&&r&&typeof r.title=="string"&&(d=r.title),b==="C4Dynamic"||b==="c4dynamic")for(var z=0;z<y.length;z++)y[z].label=z+1+": "+(y[z].label||"");for(var z=0;z<F.length;z++){for(var ue=F[z],me=null,Ee=0;Ee<y.length;Ee++){var xe=y[Ee];if(xe.from===ue.from&&xe.to===ue.to||xe.direction==="bi"&&xe.from===ue.to&&xe.to===ue.from){me=xe;break}}me&&(me.styleOverrides=ue.overrides)}return(function ar(xr){for(var sr=0;sr<xr.length;sr++){var Qe=xr[sr];X[Qe.id]&&(Qe.styleOverrides=X[Qe.id]),Qe.children&&ar(Qe.children)}})(n),{type:"c4",flavor:b,title:d,elements:n,relations:y,c4ShapeInRow:T,c4BoundaryInRow:I}}function E(f){var u=f.match(/^(\w+)\s*\((.*)\)\s*(\{?)\s*$/);return u?{name:u[1],args:v(u[2]),hasBlock:u[3]==="{"}:null}var w=100;function p(f,u,r,h,d){d=d||0;for(var n=u;n<f.length;n++){var y=f[n].trim();if(!(!y||y.substring(0,2)==="%%")){if(y==="}")return n;if(!/^(UpdateElementStyle|UpdateRelStyle|SHOW_LEGEND|LAYOUT|UpdateLayoutConfig)/i.test(y)){var b=E(y);if(b){var T=b.name.toLowerCase();if(L[T]){var I=s(b.name,T,b.args);if(b.hasBlock)if(I.children=[],d<w)n=p(f,n+1,I.children,h,d+1);else{var F=1;for(n++;n<f.length;n++){var X=f[n].trim();if(X==="}"){if(F--,F===0)break;continue}var Z=E(X);Z&&Z.hasBlock&&F++}}r.push(I)}else j[T]&&h.push(o(b.name,T,b.args))}}}}return n}function s(f,u,r){var h=r[0]||"_e"+Math.random().toString(36).substring(2,8),d=r[1]||h,n=u.indexOf("container")>=0,y=u.indexOf("component")>=0,b=u.indexOf("node")>=0,T=n||y||b,I=null,F=null;T?(I=r[2]||null,F=r[3]||null):F=r[2]||null;var X=/_ext$/i.test(u),Z=/db/.test(u),ot=/queue/.test(u),dt=/^person/.test(u),xt=/^system/.test(u)&&!u.indexOf("system_boundary")===0,re=/boundary$/.test(u)||u==="system_boundary"||u==="container_boundary"||u==="enterprise_boundary",N;re?N="boundary":dt?N="person":y?N="component":n?N="container":b?N="node":N="system";var Q=null,at=!1;return re&&(u==="boundary"&&r[2]?(Q=r[2],at=!0):/^enterprise/i.test(u)?Q="Enterprise":/^system/i.test(u)?Q="System":/^container/i.test(u)&&(Q="Container")),{id:h,macroName:f,category:N,isExternal:X,isDb:Z,isQueue:ot,label:d,technology:I,description:F,boundaryType:Q,boundaryTypeExplicit:at}}function o(f,u,r){var h="none";u==="rel_u"||u==="rel_up"?h="up":u==="rel_d"||u==="rel_down"?h="down":u==="rel_l"||u==="rel_left"?h="left":u==="rel_r"||u==="rel_right"?h="right":u==="rel_back"?h="back":u==="birel"&&(h="bi");var d,n,y,b;return u==="relindex"?(d=r[1],n=r[2],y=r[3]||"",b=r[4]||null):(d=r[0],n=r[1],y=r[2]||"",b=r[3]||null),{from:d,to:n,label:y,technology:b,direction:h}}function v(f){for(var u=[],r="",h=!1,d=0,n=0;n<f.length;n++){var y=f.charAt(n);h?y==='"'?h=!1:y==="\\"&&n+1<f.length?(r+=f.charAt(n+1),n++):r+=y:y==='"'?h=!0:y==="("||y==="["?(d++,r+=y):y===")"||y==="]"?(d--,r+=y):y===","&&d===0?(u.push(r.trim()),r=""):r+=y}r.trim()&&u.push(r.trim());for(var b=[],n=0;n<u.length;n++)u[n].charAt(0)!=="$"&&b.push(u[n]);return b}function M(f){for(var u=[],r="",h=!1,d=0,n=0;n<f.length;n++){var y=f.charAt(n);h?y==='"'?h=!1:y==="\\"&&n+1<f.length?(r+=f.charAt(n+1),n++):r+=y:y==='"'?h=!0:y==="("||y==="["?(d++,r+=y):y===")"||y==="]"?(d--,r+=y):y===","&&d===0?(u.push(r.trim()),r=""):r+=y}return r.trim()&&u.push(r.trim()),u}return{parse:P}})();var ns=(function(){function L(P,E,w,p){for(var s=[],o=[],v=[],M=[],f=P.split(`
-`),u=0;u<f.length;u++){var r=f[u].trim();if(!(!r||r.substring(0,2)==="%%")){var h;if(h=r.match(/^group\s+(\w+)(?:\(([^)]*)\))?(?:\[([^\]]*)\])?(?:\s+in\s+(\w+))?\s*$/i)){o.push({id:h[1],icon:h[2]||"cloud",label:h[3]||h[1],parent:h[4]||null});continue}if(h=r.match(/^service\s+(\w+)(?:\(([^)]*)\))?(?:\[([^\]]*)\])?(?:\s+in\s+(\w+))?\s*$/i)){s.push({id:h[1],icon:h[2]||"server",label:h[3]||h[1],parent:h[4]||null});continue}if(h=r.match(/^junction\s+(\w+)(?:\s+in\s+(\w+))?\s*$/i)){v.push({id:h[1],parent:h[2]||null});continue}var d=j(r);d&&M.push(d)}}return{type:"architecture",services:s,groups:o,junctions:v,edges:M}}function j(P){var E=P.match(/^(\w+)(\{group\})?:([TBLR])\s*(<?-->?|<?--|<->|<-->)\s*([TBLR]):(\w+)(\{group\})?\s*$/i);if(!E)return null;var w=E[4],p=/^</.test(w),s=/>$/.test(w);return{source:E[1],sourceIsGroup:!!E[2],sourcePort:E[3].toUpperCase(),targetPort:E[5].toUpperCase(),target:E[6],targetIsGroup:!!E[7],arrowStart:p,arrowEnd:s}}return{parse:L}})();var is=(function(){function L(P,E,w,p){for(var s=[],o=P.split(`
-`),v=0;v<o.length;v++){var M=o[v].trim();if(!(!M||M.substring(0,2)==="%%")&&!/^source\s*,\s*target\s*,\s*value/i.test(M)){var f=j(M);if(!(f.length<3)){var u=f[0],r=f[1],h=parseFloat(f[2]);!u||!r||isNaN(h)||h<=0||s.push({source:u,target:r,value:h})}}}return{type:"sankey",links:s}}function j(P){for(var E=[],w="",p=!1,s=0;s<P.length;){var o=P.charAt(s);p?o==='"'?s+1<P.length&&P.charAt(s+1)==='"'?(w+='"',s+=2):(p=!1,s++):(w+=o,s++):o==='"'?(p=!0,s++):o===","?(E.push(w.trim()),w="",s++):(w+=o,s++)}return E.push(w.trim()),E}return{parse:L}})();var os=(function(){function L(j,P,E,w){var p=E&&E.title||"";if(w&&w.remainder){var s=w.remainder.trim(),o=s.match(/^title\s+(.*)$/i);o&&(p=o[1].trim())}for(var v={label:"",value:0,children:[],depth:0,isLeaf:!1,parent:null},M=[{node:v,indent:-1}],f={},u=j.split(`
-`),r=0;r<u.length;r++){var h=u[r],d=h.indexOf("%%");d>=0&&(h=h.substring(0,d));var n=h.replace(/^[ \t]+/,"");if(n){n=n.replace(/[ \t]+$/,"");for(var y=0,b=0;b<h.length;b++)if(h[b]===" ")y++;else if(h[b]===" ")y+=4;else break;var o=n.match(/^title\s+(.*)$/i);if(o&&y===0){p=o[1].trim();continue}var T=n.match(/^classDef\s+(\w+)\s+(.+?);?\s*$/);if(T){f[T[1]]=T[2];continue}var I=n.match(/^"([^"]*)"\s*(?::\s*([-+]?\d+(?:\.\d+)?))?\s*(?::::(\w+))?\s*$/);if(I){for(var F=I[1],X=I[2]!=null?parseFloat(I[2]):null,Z=I[3]||null;M.length>1&&M[M.length-1].indent>=y;)M.pop();var ot=M[M.length-1].node,dt={label:F,value:X==null?0:X,rawValue:X,children:[],depth:ot.depth+1,isLeaf:X!=null,parent:ot,className:Z};ot.children.push(dt),dt.isLeaf||M.push({node:dt,indent:y})}}}return(function xt(re){if(re.isLeaf)return re.value;for(var N=0,Q=0;Q<re.children.length;Q++)N+=xt(re.children[Q]);return re.value=N,N})(v),{type:"treemap",title:p,root:v,classDefs:f}}return{parse:L}})();var ss=(function(){var L=864e5;function j(r,h,d,n){for(var y=d&&d.title||"",b="YYYY-MM-DD",T="%Y-%m-%d",I=null,F=null,X=[],Z="saturday",ot=[],dt=[],xt=null,re=r.split(`
-`),N=0;N<re.length;N++){var Q=re[N],at=Q.indexOf("%%");if(at>=0&&(Q=Q.substring(0,at)),Q=Q.trim(),!!Q){var _;if(_=Q.match(/^title\s+(.*)$/i)){y=_[1].trim();continue}if(_=Q.match(/^dateFormat\s+(.*)$/i)){b=_[1].trim();continue}if(_=Q.match(/^axisFormat\s+(.*)$/i)){T=_[1].trim();continue}if(_=Q.match(/^excludes\s+(.*)$/i)){X.push(_[1].trim());continue}if(_=Q.match(/^weekend\s+(friday|saturday)\s*$/i)){Z=_[1].toLowerCase();continue}if(_=Q.match(/^todayMarker\s+(.*)$/i)){I=_[1].trim();continue}if(_=Q.match(/^tickInterval\s+(.*)$/i)){F=_[1].trim();continue}if(_=Q.match(/^section\s+(.*)$/i)){xt={name:_[1].trim(),tasks:[],idx:ot.length},ot.push(xt);continue}var l=Q.indexOf(":");if(!(l<0)){var O=Q.substring(0,l).trim(),z=Q.substring(l+1).trim(),lt=o(O,z);lt&&(xt==null&&(xt={name:"",tasks:[],idx:ot.length},ot.push(xt)),lt.sectionIdx=xt.idx,xt.tasks.push(lt),dt.push(lt))}}}var W=E(X,Z,b);v(dt,b,W);for(var pt=null,mt=null,N=0;N<dt.length;N++)dt[N].startDate&&((!pt||dt[N].startDate.getTime()<pt.getTime())&&(pt=new Date(dt[N].startDate)),(!mt||dt[N].endDate.getTime()>mt.getTime())&&(mt=new Date(dt[N].endDate)));return{type:"gantt",title:y,dateFormat:b,axisFormat:T,tickInterval:F,todayMarker:I,excludes:X,weekendStart:Z,excludeInfo:W,displayMode:d&&d.displayMode||null,sections:ot,tasks:dt,startDate:pt,endDate:mt}}var P={sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,tues:2,wednesday:3,wed:3,thursday:4,thu:4,thurs:4,friday:5,fri:5,saturday:6,sat:6};function E(r,h,d){var n={},y={},b={},T=!1,I=P[h]!=null?P[h]:6;n[I]=!0,n[(I+1)%7]=!0;for(var F=0;F<r.length;F++)for(var X=r[F].split(/[\s,]+/),Z=0;Z<X.length;Z++){var ot=X[Z].toLowerCase();if(ot)if(ot==="weekends")T=!0;else if(P[ot]!=null)y[P[ot]]=!0;else{var dt=M(X[Z],d);dt&&(b[w(dt)]=!0)}}return{hasWeekends:T,weekendDays:n,weekdays:y,dates:b}}function w(r){return r.getUTCFullYear()+"-"+(r.getUTCMonth()+1)+"-"+r.getUTCDate()}function p(r,h){return h?!!(h.hasWeekends&&h.weekendDays[r.getUTCDay()]||h.weekdays[r.getUTCDay()]||h.dates[w(r)]):!1}function s(r,h,d){var n=new Date(r.getTime()),y=new Date(h.getTime());n.setUTCDate(n.getUTCDate()+1);for(var b=null,T=!1;n.getTime()<=y.getTime();)T||(b=new Date(y.getTime())),T=p(n,d),T&&y.setUTCDate(y.getUTCDate()+1),n.setUTCDate(n.getUTCDate()+1);return{endDate:y,renderEndDate:b}}function o(r,h){for(var d=h.split(",").map(function(I){return I.trim()}),n={done:!1,active:!1,crit:!1,milestone:!1,vert:!1};d.length>0&&/^(done|active|crit|milestone|vert)$/i.test(d[0]);)n[d.shift().toLowerCase()]=!0;var y=null,b,T;if(d.length===3)y=d[0],b=d[1],T=d[2];else if(d.length===2)b=d[0],T=d[1];else if(d.length===1)b=null,T=d[0];else return null;return{label:r,id:y,flags:n,startSpec:b,endSpec:T,startDate:null,endDate:null,sectionIdx:-1}}function v(r,h,d){for(var n={},y=0;y<r.length;y++)r[y].id&&(n[r[y].id]=r[y]);for(var b=d&&(d.hasWeekends||Object.keys(d.weekdays).length>0||Object.keys(d.dates).length>0),T=[],I=null,y=0;y<r.length;y++){var F=r[y],X=null;if(F.startSpec){var Z=F.startSpec.match(/^after\s+(.+)$/i);if(Z){for(var ot=Z[1].split(/\s+/),dt=null,xt=0;xt<ot.length;xt++){var re=n[ot[xt]];re&&re.endDate&&(!dt||re.endDate.getTime()>dt.getTime())&&(dt=re.endDate)}X=dt||I||new Date}else X=M(F.startSpec,h)||new Date}else X=I||new Date;var N,Q=!1,at=F.endSpec?F.endSpec.match(/^until\s+(.+)$/i):null;if(at){F.startDate=X,F.endDate=X,T.push({task:F,ids:at[1].trim().split(/\s+/)}),I=X;continue}else/^\d+(?:\.\d+)?\s*[a-zA-Z]+$/.test(F.endSpec)?(N=new Date(X.getTime()+u(F.endSpec)),Q=!1):(N=M(F.endSpec,h)||X,Q=!0);if(F.startDate=X,F.manualEndDate=Q,b&&!Q&&N.getTime()>X.getTime()){var _=s(X,N,d);F.endDate=_.endDate,F.renderEndDate=_.renderEndDate}else F.endDate=N,F.renderEndDate=null;I=F.endDate}for(var l=0;l<T.length;l++){for(var O=T[l],z=null,lt=0;lt<O.ids.length;lt++){var W=n[O.ids[lt]];W&&W.startDate&&(z==null||W.startDate.getTime()<z.getTime())&&(z=W.startDate)}O.task.endDate=z||O.task.startDate,O.task.renderEndDate=null,O.task.manualEndDate=!0}}function M(r,h){if(!r)return null;if(r=r.trim(),h==="X"&&/^\d+$/.test(r))return new Date(parseInt(r,10)*1e3);if(h==="x"&&/^\d+$/.test(r))return new Date(parseInt(r,10));var d=r.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(d&&/HH?:mm/i.test(h||""))return new Date(1970,0,1,+d[1],+d[2],+(d[3]||0));if(d=r.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/),d)return new Date(Date.UTC(+d[1],+d[2]-1,+d[3]));if(d=r.match(/^(\d{4})-(\d{1,2})-(\d{1,2})[\sT](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/),d)return new Date(Date.UTC(+d[1],+d[2]-1,+d[3],+d[4],+d[5],+(d[6]||0)));if(d=r.match(/^(\d{4})\/(\d{1,2})\/(\d{1,2})$/),d)return new Date(Date.UTC(+d[1],+d[2]-1,+d[3]));if(d=r.match(/^(\d{1,2})-(\d{1,2})-(\d{4})$/),d)return new Date(Date.UTC(+d[3],+d[2]-1,+d[1]));if(d=r.match(/^(\d{4})$/),d&&/YYYY/.test(h||""))return new Date(+d[1],0,1);var n=f(r,h);if(n)return n;var y=new Date(r);return isNaN(y.getTime())?null:y}function f(r,h){if(!h)return null;for(var d=["YYYY","YY","MM","M","DD","D","HH","H","mm","m","ss","s"],n=[],y="",b=0;b<h.length;){for(var T=null,I=0;I<d.length;I++)if(h.substring(b,b+d[I].length)===d[I]){T=d[I];break}T?(n.push(T),y+=T==="YYYY"?"(\\d{4})":T==="YY"?"(\\d{2})":"(\\d{1,2})",b+=T.length):(y+=h[b].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),b++)}if(n.length===0)return null;var F=r.match(new RegExp("^"+y+"$"));if(!F)return null;for(var X=1970,Z=1,ot=1,dt=0,xt=0,re=0,N=!1,Q=0;Q<n.length;Q++){var at=parseInt(F[Q+1],10);switch(n[Q]){case"YYYY":X=at,N=!0;break;case"YY":X=at+(at>68?1900:2e3),N=!0;break;case"MM":case"M":Z=at,N=!0;break;case"DD":case"D":ot=at,N=!0;break;case"HH":case"H":dt=at;break;case"mm":case"m":xt=at;break;case"ss":case"s":re=at;break}}if(Z<1||Z>12||ot<1||ot>31||dt>23||xt>59||re>59)return null;if(!N)return new Date(1970,0,1,dt,xt,re);var _=new Date(Date.UTC(X,Z-1,ot,dt,xt,re));return _.getUTCMonth()!==Z-1||_.getUTCDate()!==ot?null:_}function u(r){var h=r.trim().match(/^(\d+(?:\.\d+)?)\s*([a-zA-Z]+)$/);if(!h)return 0;var d=parseFloat(h[1]),n=h[2],y;switch(n){case"ms":y=1;break;case"s":y=1e3;break;case"h":y=36e5;break;case"d":y=L;break;case"w":y=7*L;break;case"M":y=30*L;break;case"y":y=365*L;break;case"m":y=6e4;break;default:y=0}return d*y}return{parse:j}})();var ls=(function(){var L=0,j=1,P="_STARTER_",E={actor:"actor",boundary:"boundary",control:"control",entity:"entity",database:"database",collections:"collections",queue:"queue",starter:"actor"};function w(b,T,I,F){for(var X={actors:[],actorMap:{},messages:[],notes:[],fragments:[],activations:[],contextStack:[],pendingComments:[],pendingReturn:!1,title:I&&I.title||""},Z=b.split(`
-`),ot=0;ot<Z.length;ot++){var dt=Z[ot],xt=dt.indexOf("//"),re=null;if(xt>=0&&(re=dt.substring(xt+2).trim(),dt=dt.substring(0,xt)),dt=dt.trim(),!dt&&re!=null){re&&X.pendingComments.push(re);continue}dt&&p(dt,X)}for(;X.contextStack.length>0;)n(X);for(var N=!1,Q=0;Q<X.messages.length;Q++)if(X.messages[Q].from===P||X.messages[Q].to===P){N=!0;break}return!N&&X.actorMap[P]&&(X.actors=X.actors.filter(function(at){return at.name!==P}),delete X.actorMap[P]),{type:"sequence",zenuml:!0,actors:X.actors,messages:X.messages,notes:X.notes,fragments:X.fragments,activations:X.activations,boxes:[],autonumber:!1,title:X.title}}function p(b,T){var I;if(I=b.match(/^\}\s*else\s+if\s*\(([^)]*)\)\s*\{$/i)){r(T,"else if "+I[1].trim());return}if(I=b.match(/^\}\s*else\s*\{$/i)){r(T,"else");return}if(I=b.match(/^\}\s*and\s*(?:\(([^)]*)\))?\s*\{$/i)){r(T,"and"+(I[1]?" "+I[1].trim():""));return}if(I=b.match(/^\}\s*catch\s*(?:\(([^)]*)\))?\s*\{$/i)){r(T,"catch"+(I[1]?" "+I[1].trim():""));return}if(I=b.match(/^\}\s*finally\s*\{$/i)){r(T,"finally");return}if(b==="}"){n(T);return}if(I=b.match(/^title\s+(.*)$/i)){T.title=I[1].trim();return}if(/^@(return|reply)\s*$/i.test(b)){T.pendingReturn=!0;return}if(I=b.match(/^@(\w+)\s+(\w+)(?:\s+as\s+(.+))?$/i)){var F=I[1].toLowerCase(),X=E[F],Z=X||"participant",ot=I[2],dt=I[3]?I[3].trim():ot;M(T,ot,dt,Z),!X&&T.actorMap[ot]&&(T.actorMap[ot].iconName=F),T.pendingComments=[];return}if(I=b.match(/^(participant|actor)\s+(\w+)(?:\s+as\s+(.+))?$/i)){var Z=I[1].toLowerCase(),ot=I[2],dt=I[3]?I[3].trim():ot;M(T,ot,dt,Z),T.pendingComments=[];return}if(I=b.match(/^if\s*\(([^)]*)\)\s*\{$/i)){u(T,"alt",I[1].trim());return}if(I=b.match(/^(while|for|foreach|forEach|loop)\s*(?:\(([^)]*)\))?\s*\{$/i)){var xt=I[1].toLowerCase(),re=I[2]?I[2].trim():xt;u(T,"loop",re);return}if(I=b.match(/^opt\s*(?:\(([^)]*)\))?\s*\{$/i)){u(T,"opt",I[1]?I[1].trim():"");return}if(I=b.match(/^par\s*(?:\(([^)]*)\))?\s*\{$/i)){u(T,"par",I[1]?I[1].trim():"");return}if(I=b.match(/^try\s*\{$/i)){u(T,"critical","try");return}if(I=b.match(/^return\b\s*(.*)$/i)){y(T,I[1].trim());return}if(I=b.match(/^new\s+(\w+)(?:\s*\(([^)]*)\))?\s*(\{)?$/i)){var N=I[1],Q=I[2]||"",at=I[3]==="{";M(T,N,N,"participant");var _=f(T),dt="\xABcreate\xBB "+N+(Q?"("+Q+")":"");_==null?(v(T),o(T,s(P,N,dt,j,at,!1,!0))):o(T,s(_,N,dt,j,at,!1,!0)),at?d(T,N):h(T,N);return}if(I=b.match(/^(\w+)\s*->\s*(\w+)\s*:\s*(.*)$/)){M(T,I[1],I[1],"participant"),M(T,I[2],I[2],"participant"),o(T,s(I[1],I[2],I[3].trim(),L,!1,!1,!1));return}if(I=b.match(/^(\w+)\s*->\s*(\w+)\.(\w+)(?:\s*\(([^)]*)\))?\s*(\{)?$/)){var l=I[1],O=I[2],z=I[3],Q=I[4]||"",at=I[5]==="{";M(T,l,l,"participant"),M(T,O,O,"participant");var dt=z+"("+Q+")";o(T,s(l,O,dt,L,at,!1,!0)),at?d(T,O):h(T,O);return}if(I=b.match(/^(\w+)\.(\w+)(?:\s*\(([^)]*)\))?\s*(\{)?$/)){var N=I[1],z=I[2],Q=I[3]||"",at=I[4]==="{";M(T,N,N,"participant");var _=f(T),dt=z+"("+Q+")";_==null?(v(T),o(T,s(P,N,dt,L,at,!1,!0))):o(T,s(_,N,dt,L,at,!1,!0)),at?d(T,N):h(T,N);return}if(I=b.match(/^(\w+)\s+as\s+(.+)$/i)){M(T,I[1],I[2].trim(),"participant"),T.pendingComments=[];return}if(I=b.match(/^(\w+)$/)){M(T,I[1],I[1],"participant"),T.pendingComments=[];return}}function s(b,T,I,F,X,Z,ot){return{from:b,to:T,text:I,type:F,activate:!!X,deactivate:!!Z,sync:!!ot}}function o(b,T){b.pendingComments&&b.pendingComments.length>0&&(T.comments=b.pendingComments,b.pendingComments=[]),b.pendingReturn&&(T.type=j,T.sync=!1,b.pendingReturn=!1),b.messages.push(T)}function v(b){if(!b.actorMap[P]){var T={name:P,label:"",type:"actor"};b.actors.unshift(T),b.actorMap[P]=T}}function M(b,T,I,F){if(b.actorMap[T])return b.actorMap[T];var X={name:T,label:I||T,type:F||"participant"};return b.actors.push(X),b.actorMap[T]=X,X}function f(b){for(var T=b.contextStack.length-1;T>=0;T--)if(b.contextStack[T].kind==="caller")return b.contextStack[T].name;return null}function u(b,T,I){var F={type:T,title:I,startIdx:b.messages.length,sections:[],endIdx:-1};b.fragments.push(F),b.contextStack.push({kind:"fragment",fragment:F})}function r(b,T){for(var I=b.contextStack.length-1;I>=0;I--)if(b.contextStack[I].kind==="fragment"){var F=b.contextStack[I].fragment;F.sections.push({title:T,startIdx:b.messages.length});return}}function h(b,T){for(var I=0,F=0;F<b.contextStack.length;F++){var X=b.contextStack[F];X.kind==="caller"&&X.name===T&&I++}b.activations.push({actor:T,startIdx:b.messages.length-1,endIdx:b.messages.length-1,depth:I})}function d(b,T){for(var I=0,F=0;F<b.contextStack.length;F++){var X=b.contextStack[F];X.kind==="caller"&&X.name===T&&I++}var Z=null,ot=b.messages[b.messages.length-1];ot&&(Z=ot.from);var dt={actor:T,startIdx:b.messages.length-1,endIdx:-1,depth:I};b.activations.push(dt),b.contextStack.push({kind:"caller",name:T,callerOf:Z,returnEmitted:!1,activation:dt})}function n(b){if(b.contextStack.length!==0){var T=b.contextStack.pop();if(T.kind==="fragment")T.fragment.endIdx=b.messages.length;else if(T.kind==="caller"){if(!T.returnEmitted){var I=T.callerOf;I!=null&&I!==T.name&&I!==P&&o(b,s(T.name,I,"",j,!1,!0))}T.activation&&(T.activation.endIdx=b.messages.length-1)}}}function y(b,T){for(var I=null,F=b.contextStack.length-1;F>=0;F--)if(b.contextStack[F].kind==="caller"){I=b.contextStack[F];break}if(I){I.returnEmitted=!0;var X=I.callerOf;X!=null&&(X===P&&v(b),o(b,s(I.name,X,T,j,!1,!1)))}}return{parse:w}})();var hs=(function(){function L(P,E,w){var p=E,s=w,o=!1,v=P.match(/\[\s*"([^"]*)"\s*\]/);v&&(p=v[1]);var M=P.match(/:(\d+(?:\.\d+)?)/);return M&&(s=parseFloat(M[1]),o=!0),{label:p,size:s,sizeExplicit:o}}function j(P,E,w,p){for(var s=w&&w.title||"",o=[],v=Object.create(null),M=[],f=[],u={},r=null,h=P.split(`
-`),d=0;d<h.length;){var n=h[d],y=n.indexOf("%%");if(y>=0&&(n=n.substring(0,y)),n=n.trim(),!n){d++;continue}var b;if(b=n.match(/^title\s+(.*)$/i)){s=b[1].trim(),d++;continue}if(b=n.match(/^set\s+(\w+)(.*?)\s*$/i)){var T=b[1],I=L(b[2],T,void 0);if(v[T])v[T].label=I.label,v[T].size=I.size,v[T].sizeExplicit=I.sizeExplicit;else{var F={id:T,label:I.label,size:I.size,sizeExplicit:I.sizeExplicit};o.push(F),v[T]=F}r=[T],d++;continue}if(b=n.match(/^union\s+([A-Za-z_][\w]*(?:\s*,\s*[A-Za-z_][\w]*)+)(.*?)\s*$/i)){var X=b[1].split(/\s*,\s*/),I=L(b[2],"",void 0);M.push({ids:X,size:I.size,sizeExplicit:I.sizeExplicit,label:I.label}),I.label&&f.push({ids:X,text:I.label,kind:"union"}),r=X.slice(),d++;continue}if(b=n.match(/^text\s+([A-Za-z_][\w]*(?:\s*,\s*[A-Za-z_][\w]*)*)\s*(?:\[\s*"([^"]*)"\s*\])?\s*$/i)){var Z=b[1].split(/\s*,\s*/),ot=b[2]||"";if(!ot&&d+1<h.length){var dt=h[d+1].trim(),xt=dt.match(/^\[\s*"([^"]*)"\s*\]\s*$/);xt&&(ot=xt[1],d++)}if(Z.length>1)f.push({ids:Z,text:ot,kind:"text",id:ot||Z[0]});else{var re=Z[0];if(v[re])f.push({ids:[re],text:ot||re,kind:"text",id:ot||re});else{var N;r&&r.length>0?N=r.slice():N=[re],f.push({ids:N,text:ot||re,kind:"text",id:re})}}d++;continue}if(b=n.match(/^style\s+([A-Za-z_][\w]*(?:\s*,\s*[A-Za-z_][\w]*)*)\s+(.+?)\s*$/i)){for(var X=b[1].split(/\s*,\s*/),Q=b[2],at=0;at<X.length;at++)u[X[at]]=(u[X[at]]||"")+(u[X[at]]?",":"")+Q;d++;continue}d++}return{type:"venn",title:s,sets:o,unions:M,labels:f,styles:u}}return{parse:j}})();var cs=(function(){function L(j,P,E,w){for(var p=E&&E.title||"",s="",o=[],v=[],M=!1,f=-1,u=j.split(`
-`),r=0;r<u.length;r++){var h=u[r],d=h.indexOf("%%");d>=0&&(h=h.substring(0,d));var n=h.replace(/^[ \t]+/,"").replace(/[ \t]+$/,"");if(n){for(var y=0,b=0;b<h.length;b++)if(h[b]===" ")y++;else if(h[b]===" ")y+=4;else break;var T=n.match(/^title\s+(.*)$/i);if(T){p=T[1].trim();continue}if(!M){s=n,M=!0;continue}for(f<0&&(f=y);v.length>0&&v[v.length-1].indent>=y;)v.pop();if(y<=f||v.length===0){var I={name:n,children:[]};o.push(I),v=[{indent:y,children:I.children}]}else{var F=v[v.length-1].children,X={text:n,children:[]};F.push(X),v.push({indent:y,children:X.children})}}}return{type:"ishikawa",title:p,effect:s,categories:o}}return{parse:L}})();var fs=(function(){function L(j,P,E,w){for(var p=E&&E.title||"",s=[],o=j.split(`
-`),v=[],M=0;M<o.length;M++){var f=o[M],u=f.indexOf("%%");u>=0&&(f=f.substring(0,u));var r=f.replace(/^[ \t]+/,"").replace(/\s+$/,"");if(r){var h=r.match(/^title\s+(.*)$/i);if(h){p=h[1].trim();continue}for(var d=0,n=0;n<f.length;n++)if(f[n]===" ")d++;else if(f[n]===" ")d+=4;else break;var y=r;y.length>=2&&(y.charAt(0)==='"'&&y.charAt(y.length-1)==='"'||y.charAt(0)==="'"&&y.charAt(y.length-1)==="'")&&(y=y.substring(1,y.length-1)),v.push({indent:d,label:y})}}if(v.length===0)return{type:"treeView",title:p,roots:[]};for(var b=[],T=0;T<v.length;T++){for(var I=v[T],F={label:I.label,children:[]};b.length>0&&b[b.length-1].indent>=I.indent;)b.pop();b.length===0?s.push(F):b[b.length-1].node.children.push(F),b.push({indent:I.indent,node:F})}return{type:"treeView",title:p,roots:s}}return{parse:L}})();var us=(function(){function L(r,h,d,n){for(var y={type:"wardley",title:null,size:null,nodes:[],links:[],trends:[],pipelines:[],notes:[],annotationsBox:null,annotations:[],accelerators:[],deaccelerators:[],axes:{stages:[],stageBoundaries:[],xLabel:null,yLabel:null}},b={},T=r.split(`
-`),I=0;I<T.length;I++){var F=T[I],X=F.trim();if(!(!X||X.substring(0,2)==="%%")){var Z;if(Z=X.match(/^title\s+(.*)$/i))y.title=u(Z[1].trim());else if(Z=X.match(/^size\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]/i))y.size={width:parseFloat(Z[1]),height:parseFloat(Z[2])};else if(Z=X.match(/^evolution\s+(.*)$/i))s(Z[1].trim(),y);else if(Z=X.match(/^(component|anchor)\s+(.*)$/i))I=E(Z[1].toLowerCase(),Z[2],T,I,y,b);else if(Z=X.match(/^pipeline\s+(.*)$/i))I=p(Z[1],T,I,y,b);else if(Z=X.match(/^note\s+(.*)$/i)){var ot=o(Z[1]);ot&&y.notes.push(ot)}else if(Z=X.match(/^evolve\s+(.+?)\s+([-\d.]+)\s*$/i))f(y,b,Z[1].trim(),j(parseFloat(Z[2])),null);else if(Z=X.match(/^trend\s+(.+?)\s+([-\d.]+)\s*,\s*([-\d.]+)\s*$/i))f(y,b,Z[1].trim(),j(parseFloat(Z[2])),j(parseFloat(Z[3])));else if(Z=X.match(/^annotations\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]/i))y.annotationsBox={x:j(parseFloat(Z[2])),y:j(parseFloat(Z[1]))};else if(Z=X.match(/^annotation\s+(\d+)\s*,\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]\s*(.*)$/i))y.annotations.push({number:parseInt(Z[1],10),x:j(parseFloat(Z[3])),y:j(parseFloat(Z[2])),text:u(Z[4].trim())});else if(Z=X.match(/^accelerator\s+(.*)$/i)){var dt=v(Z[1]);dt&&y.accelerators.push(dt)}else if(Z=X.match(/^deaccelerator\s+(.*)$/i)){var xt=v(Z[1]);xt&&y.deaccelerators.push(xt)}else{var re=M(X);re&&y.links.push(re)}}}return!y.title&&d&&typeof d.title=="string"&&(y.title=d.title),y}function j(r){return isNaN(r)?0:r<=1?r*100:r}function P(r){var h=r.match(/\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]/);return h?{x:j(parseFloat(h[2])),y:j(parseFloat(h[1]))}:null}function E(r,h,d,n,y,b){var T=P(h);if(!T)return n;for(var I=h.indexOf("["),F=u(h.substring(0,I).trim()),X=h.substring(h.indexOf("]",I)+1),Z={id:F,name:F,x:T.x,y:T.y,kind:r,strategy:null,inertia:!1,labelOffsetX:null,labelOffsetY:null,isPipelineParent:!1,inPipeline:!1},ot,dt=/\(([^)]+)\)/g;(ot=dt.exec(X))!==null;){var xt=ot[1].trim().toLowerCase();xt==="inertia"?Z.inertia=!0:(xt==="build"||xt==="buy"||xt==="outsource"||xt==="market")&&(Z.strategy=xt)}if(X.indexOf("{")>=0){var re=X.substring(X.indexOf("{")+1);if(X.indexOf("}")<0){for(n++;n<d.length&&d[n].indexOf("}")<0;)re+=" "+d[n],n++;n<d.length&&(re+=" "+d[n])}var N=re.match(/label\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]/i);N&&(Z.labelOffsetX=parseFloat(N[1]),Z.labelOffsetY=parseFloat(N[2]))}return w(y,b,Z),n}function w(r,h,d){var n=h[d.id];if(n)for(var y in d)d[y]!=null&&d[y]!==!1&&(n[y]=d[y]);else h[d.id]=d,r.nodes.push(d)}function p(r,h,d,n,y){var b=r.match(/^(.+?)\s*\{?\s*$/),T=u((b?b[1]:r).trim());n.nodes.forEach(function(Q){Q.id===T&&(Q.isPipelineParent=!0)});var I={parent:T,componentIds:[]};n.pipelines.push(I);var F=y[T],X=F?F.y:50;if(r.indexOf("{")<0)for(;d+1<h.length&&h[d+1].trim()==="";)d++;for(d++;d<h.length;d++){var Z=h[d].trim();if(!(Z===""||Z.substring(0,2)==="%%")){if(Z.indexOf("}")>=0)break;var ot=P(Z);if(ot){var dt=Z.indexOf("["),xt=u(Z.substring(0,dt).trim()),re=T+"_"+xt,N={id:re,name:xt,x:ot.x,y:X,kind:"pipeline-component",strategy:null,inertia:!1,labelOffsetX:null,labelOffsetY:null,isPipelineParent:!1,inPipeline:!0};w(n,y,N),I.componentIds.push(re)}}}return d}function s(r,h){for(var d=r.split("->"),n=[],y=[],b=!1,T=0;T<d.length;T++){var I=d[T].trim(),F=I.match(/^@([-\d.]+)\s+(.*)$/);F&&(b=!0,y.push(parseFloat(F[1])),I=F[2].trim());var X=I.match(/^(\S[^"]*?)\s+"([^"]*)"\s*$/);X?n.push(X[1].trim()+" / "+X[2].trim()):n.push(u(I))}h.axes.stages=n,b&&y.length===n.length&&(h.axes.stageBoundaries=y)}function o(r){var h=P(r);if(!h)return null;var d=r.substring(0,r.indexOf("[")).trim();return{text:u(d),x:h.x,y:h.y}}function v(r){var h=P(r);if(!h)return null;var d=u(r.substring(0,r.indexOf("[")).trim());return{name:d,x:h.x,y:h.y}}function M(r){var h=r.match(/^(.+?)\s+(-\.->|->|\+(?:'[^']*')?(?:<>|<|>)?)\s+(.+)$/);if(!h)return null;var d=u(h[1].trim()),n=h[2],y=u(h[3].trim()),b=n.indexOf("-.")>=0,T=null,I=null,F=n.match(/'([^']*)'/);return F&&(I=F[1]),n.charAt(0)==="+"&&(n.indexOf("<>")>=0?T="bidirectional":n.indexOf("<")>=0?T="backward":T="forward"),{from:d,to:y,dashed:b,label:I,flow:T}}function f(r,h,d,n,y){var b=h[d],T=y!=null?y:b?b.y:50;r.trends.push({nodeId:d,targetX:n,targetY:T})}function u(r){return r&&(r.charAt(0)==='"'&&r.charAt(r.length-1)==='"'||r.charAt(0)==="'"&&r.charAt(r.length-1)==="'"?r.substring(1,r.length-1):r)}return{parse:L}})();var vs=(function(){var L={ui:1,pcr:1,processor:1,cmd:1,command:1,rmo:1,readmodel:1,evt:1,event:1};function j(E,w,p,s){for(var o={type:"eventmodeling",title:null,frames:[],dataEntities:[]},v=E.split(`
-`),M=0;M<v.length;M++){var f=v[M].trim();if(!(!f||f.substring(0,2)==="%%")){var u;if(u=f.match(/^title\s+(.*)$/i)){o.title=u[1].trim();continue}if(!(/^accTitle\s*:/i.test(f)||/^accDescr/i.test(f))){if(u=f.match(/^data\s+(\S+)\s*(\{?)\s*$/i)){var r=u[1],h=[];if(!u[2]){for(;M+1<v.length&&v[M+1].trim()==="";)M++;M+1<v.length&&v[M+1].trim()==="{"&&M++}for(M++;M<v.length&&!(v[M].indexOf("}")>=0);M++)v[M].trim()!==""&&h.push(v[M].trim());o.dataEntities.push({name:r,lines:h});continue}if(u=f.match(/^(tf|timeframe|rf|resetframe)\s+(\d{1,3})\s+(\S+)\s+(\S+)\s*(.*)$/i),u&&L[u[3].toLowerCase()]){var d={name:u[2],entityType:u[3].toLowerCase(),entityIdentifier:u[4],isReset:/^(rf|resetframe)$/i.test(u[1]),sourceFrames:[],dataReference:null,dataInline:null};P(u[5]||"",d),o.frames.push(d)}}}}return!o.title&&p&&typeof p.title=="string"&&(o.title=p.title),o}function P(E,w){for(var p,s=/->>\s*(\d{1,3})/g;(p=s.exec(E))!==null;)w.sourceFrames.push(p[1]);var o=E.match(/\[\[\s*([^\]]+?)\s*\]\]/);o&&(w.dataReference=o[1].trim());var v=E.match(/\{([^}]*)\}/);if(v)w.dataInline=v[1].trim();else{var M=E.match(/"([^"]*)"|'([^']*)'/);M&&(w.dataInline=(M[1]!=null?M[1]:M[2]).trim())}}return{parse:j}})();var si=(function(){var L={flowchart:"flowchart",graph:"flowchart",classDiagram:"class",classdiagram:"class","classDiagram-v2":"class",stateDiagram:"state",statediagram:"state","stateDiagram-v2":"state","statediagram-v2":"state",erDiagram:"er",erdiagram:"er",sequenceDiagram:"sequence",sequencediagram:"sequence",gitGraph:"gitgraph",gitgraph:"gitgraph",journey:"journey",mindmap:"mindmap",requirementDiagram:"requirement",requirementdiagram:"requirement",gantt:"gantt",pie:"pie",packet:"packet","packet-beta":"packet",packetbeta:"packet",quadrantChart:"quadrant",quadrantchart:"quadrant",timeline:"timeline",kanban:"kanban","xychart-beta":"xychart",xychartbeta:"xychart",xychart:"xychart","radar-beta":"radar",radarbeta:"radar",radar:"radar","block-beta":"block",blockbeta:"block",block:"block",C4Context:"c4",c4context:"c4",C4Container:"c4",c4container:"c4",C4Component:"c4",c4component:"c4",C4Dynamic:"c4",c4dynamic:"c4",C4Deployment:"c4",c4deployment:"c4","architecture-beta":"architecture",architecturebeta:"architecture",architecture:"architecture","sankey-beta":"sankey",sankeybeta:"sankey",sankey:"sankey",treemap:"treemap","treemap-beta":"treemap",treemapbeta:"treemap",gantt:"gantt",zenuml:"zenuml",venn:"venn","venn-beta":"venn",vennbeta:"venn",ishikawa:"ishikawa","ishikawa-beta":"ishikawa",ishikawabeta:"ishikawa",fishbone:"ishikawa",treeView:"treeView",treeview:"treeView","treeView-beta":"treeView","treeview-beta":"treeView",treeviewbeta:"treeView",wardley:"wardley","wardley-beta":"wardley",wardleybeta:"wardley",eventmodeling:"eventmodeling","eventmodeling-beta":"eventmodeling"},j={};function P(u,r){j[u]=r}function E(u,r){for(;r<u.length;){var h=u[r].trim();if(h.length===0)r++;else if(h.substring(0,3)==="%%{"){for(;r<u.length&&u[r].indexOf("}%%")<0;)r++;r++}else if(h.substring(0,2)==="%%")r++;else break}return r}function w(u){var r=u.split(`
-`),h=E(r,0);if(h>=r.length)return null;if(r[h].trim()==="---"){for(h++;h<r.length&&r[h].trim()!=="---";)h++;h++,h=E(r,h)}if(h>=r.length)return null;var d=r[h].trim();if(d==="mermaid"||d.indexOf(`mermaid
-`)===0){if(h++,h>=r.length)return null;d=r[h].trim()}var n=d.split(/\s+/),y=n[0];y[y.length-1]===":"&&(y=y.substring(0,y.length-1));var b=L[y]||L[y.toLowerCase()];if(!b)return null;var T=null,I=1,F=h+1,X=p(u,h+1);if(b==="flowchart"&&n.length>1){var Z=d.substring(n[0].length),ot=/^\s*(TB|TD|LR|RL|BT)(?=[\s;]|$)/i.exec(Z);T="TD",ot!=null&&(T=ot[1].toUpperCase(),Z=Z.substring(ot[0].length),I=2),Z.trim().length>0&&(F=h,X=p(u,h)+r[h].indexOf(d)+(d.length-Z.length))}else if(b==="gitgraph"&&n.length>1){var dt=n[1].replace(/:$/,"").toUpperCase();(dt==="TB"||dt==="TD"||dt==="BT"||dt==="LR"||dt==="RL")&&(T=dt,I=2)}else if(b==="timeline"&&n.length>1){var xt=n[1].toUpperCase();(xt==="TB"||xt==="TD"||xt==="BT"||xt==="LR"||xt==="RL")&&(T=xt,I=2)}var re=n.slice(I).join(" ");return{type:b,keyword:y,direction:T,remainder:re,bodyStartLine:F,bodyStart:X}}function p(u,r){for(var h=0,d=0;d<r&&h<u.length;d++){var n=u.indexOf(`
-`,h);if(n<0)return u.length;h=n+1}return h}function s(u){var r={},h=new Ua(u);h.skipWhitespace();var d=h.parseFrontmatter();for(d&&d.config&&v(r,d.config),d&&typeof d.title=="string"&&(r.title=d.title),d&&typeof d.displayMode=="string"&&(r.displayMode=d.displayMode),h.skipWhitespace();h.peekStr(3)==="%%{";){var n=h.parseDirective();n&&v(r,n),h.skipWhitespace()}return{config:r,textOffset:h.pos}}function o(u){return u==="__proto__"||u==="constructor"||u==="prototype"}function v(u,r){for(var h in r)r.hasOwnProperty(h)&&!o(h)&&(typeof r[h]=="object"&&r[h]!==null&&typeof u[h]=="object"&&u[h]!==null?v(u[h],r[h]):u[h]=r[h])}function M(u){u=u.trim();var r=s(u),h=r.config,d=w(u);if(!d)throw new Error("Unsupported or unrecognized Mermaid diagram type");var n=u.substring(d.bodyStart),y=j[d.type];if(!y)throw new Error("No parser registered for diagram type: "+d.type);var b=y.parse(n,d.direction,h,d);return{type:d.type,ir:b,config:h,direction:d.direction}}function f(u){var r=w(u);return r!=null&&j[r.type]!=null}return typeof Ho!="undefined"&&P("flowchart",Ho),typeof Wo!="undefined"&&P("class",Wo),typeof Uo!="undefined"&&P("state",Uo),typeof Yo!="undefined"&&P("er",Yo),typeof Vo!="undefined"&&P("requirement",Vo),typeof jo!="undefined"&&P("sequence",jo),typeof Xo!="undefined"&&P("gitgraph",Xo),typeof qo!="undefined"&&P("journey",qo),typeof $o!="undefined"&&P("mindmap",$o),typeof Go!="undefined"&&P("pie",Go),typeof Zo!="undefined"&&P("packet",Zo),typeof Ko!="undefined"&&P("quadrant",Ko),typeof Qo!="undefined"&&P("timeline",Qo),typeof Jo!="undefined"&&P("kanban",Jo),typeof ts!="undefined"&&P("xychart",ts),typeof es!="undefined"&&P("radar",es),typeof rs!="undefined"&&P("block",rs),typeof as!="undefined"&&P("c4",as),typeof ns!="undefined"&&P("architecture",ns),typeof is!="undefined"&&P("sankey",is),typeof os!="undefined"&&P("treemap",os),typeof ss!="undefined"&&P("gantt",ss),typeof ls!="undefined"&&P("zenuml",ls),typeof hs!="undefined"&&P("venn",hs),typeof cs!="undefined"&&P("ishikawa",cs),typeof fs!="undefined"&&P("treeView",fs),typeof us!="undefined"&&P("wardley",us),typeof vs!="undefined"&&P("eventmodeling",vs),{parse:M,detectType:w,isSupported:f,registerParser:P}})();var Lg=(()=>{var L=Object.defineProperty,j=Object.getOwnPropertyDescriptor,P=Object.getOwnPropertyNames,E=Object.prototype.hasOwnProperty,w=(i,m,k)=>m in i?L(i,m,{enumerable:!0,configurable:!0,writable:!0,value:k}):i[m]=k,p=(i,m)=>{for(var k in m)L(i,k,{get:m[k],enumerable:!0})},s=(i,m,k,R)=>{if(m&&typeof m=="object"||typeof m=="function")for(let $ of P(m))!E.call(i,$)&&$!==k&&L(i,$,{get:()=>m[$],enumerable:!(R=j(m,$))||R.enumerable});return i},o=i=>s(L({},"__esModule",{value:!0}),i),v=(i,m,k)=>w(i,typeof m!="symbol"?m+"":m,k),M={};p(M,{Graph:()=>h,debug:()=>Gr,default:()=>pa,graphlib:()=>f,layout:()=>le,util:()=>ya,version:()=>sa});var f={};p(f,{Graph:()=>h,alg:()=>xt,json:()=>F,version:()=>I});var u=Object.defineProperty,r=(i,m)=>{for(var k in m)u(i,k,{get:m[k],enumerable:!0})},h=class{constructor(i){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=()=>{},i&&(this._isDirected="directed"in i?i.directed:!0,this._isMultigraph="multigraph"in i?i.multigraph:!1,this._isCompound="compound"in i?i.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(i){return this._label=i,this}graph(){return this._label}setDefaultNodeLabel(i){return typeof i!="function"?this._defaultNodeLabelFn=()=>i:this._defaultNodeLabelFn=i,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(i=>Object.keys(this._in[i]).length===0)}sinks(){return this.nodes().filter(i=>Object.keys(this._out[i]).length===0)}setNodes(i,m){return i.forEach(k=>{m!==void 0?this.setNode(k,m):this.setNode(k)}),this}setNode(i,m){return i in this._nodes?(arguments.length>1&&(this._nodes[i]=m),this):(this._nodes[i]=arguments.length>1?m:this._defaultNodeLabelFn(i),this._isCompound&&(this._parent[i]="\0",this._children[i]={},this._children["\0"][i]=!0),this._in[i]={},this._preds[i]={},this._out[i]={},this._sucs[i]={},++this._nodeCount,this)}node(i){return this._nodes[i]}hasNode(i){return i in this._nodes}removeNode(i){if(i in this._nodes){let m=k=>this.removeEdge(this._edgeObjs[k]);delete this._nodes[i],this._isCompound&&(this._removeFromParentsChildList(i),delete this._parent[i],this.children(i).forEach(k=>{this.setParent(k)}),delete this._children[i]),Object.keys(this._in[i]).forEach(m),delete this._in[i],delete this._preds[i],Object.keys(this._out[i]).forEach(m),delete this._out[i],delete this._sucs[i],--this._nodeCount}return this}setParent(i,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(m===void 0)m="\0";else{m+="";for(let k=m;k!==void 0;k=this.parent(k))if(k===i)throw new Error("Setting "+m+" as parent of "+i+" would create a cycle");this.setNode(m)}return this.setNode(i),this._removeFromParentsChildList(i),this._parent[i]=m,this._children[m][i]=!0,this}parent(i){if(this._isCompound){let m=this._parent[i];if(m!=="\0")return m}}children(i="\0"){if(this._isCompound){let m=this._children[i];if(m)return Object.keys(m)}else{if(i==="\0")return this.nodes();if(this.hasNode(i))return[]}return[]}predecessors(i){let m=this._preds[i];if(m)return Object.keys(m)}successors(i){let m=this._sucs[i];if(m)return Object.keys(m)}neighbors(i){let m=this.predecessors(i);if(m){let k=new Set(m);for(let R of this.successors(i))k.add(R);return Array.from(k.values())}}isLeaf(i){let m;return this.isDirected()?m=this.successors(i):m=this.neighbors(i),m.length===0}filterNodes(i){let m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph()),Object.entries(this._nodes).forEach(([$,et])=>{i($)&&m.setNode($,et)}),Object.values(this._edgeObjs).forEach($=>{m.hasNode($.v)&&m.hasNode($.w)&&m.setEdge($,this.edge($))});let k={},R=$=>{let et=this.parent($);return!et||m.hasNode(et)?(k[$]=et!=null?et:void 0,et!=null?et:void 0):et in k?k[et]:R(et)};return this._isCompound&&m.nodes().forEach($=>m.setParent($,R($))),m}setDefaultEdgeLabel(i){return typeof i!="function"?this._defaultEdgeLabelFn=()=>i:this._defaultEdgeLabelFn=i,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(i,m){return i.reduce((k,R)=>(m!==void 0?this.setEdge(k,R,m):this.setEdge(k,R),R)),this}setEdge(i,m,k,R){let $,et,vt,Et,Yt=!1;typeof i=="object"&&i!==null&&"v"in i?($=i.v,et=i.w,vt=i.name,arguments.length===2&&(Et=m,Yt=!0)):($=i,et=m,vt=R,arguments.length>2&&(Et=k,Yt=!0)),$=""+$,et=""+et,vt!==void 0&&(vt=""+vt);let Gt=y(this._isDirected,$,et,vt);if(Gt in this._edgeLabels)return Yt&&(this._edgeLabels[Gt]=Et),this;if(vt!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode($),this.setNode(et),this._edgeLabels[Gt]=Yt?Et:this._defaultEdgeLabelFn($,et,vt);let he=b(this._isDirected,$,et,vt);return $=he.v,et=he.w,Object.freeze(he),this._edgeObjs[Gt]=he,d(this._preds[et],$),d(this._sucs[$],et),this._in[et][Gt]=he,this._out[$][Gt]=he,this._edgeCount++,this}edge(i,m,k){let R=arguments.length===1?T(this._isDirected,i):y(this._isDirected,i,m,k);return this._edgeLabels[R]}edgeAsObj(i,m,k){let R=arguments.length===1?this.edge(i):this.edge(i,m,k);return typeof R!="object"?{label:R}:R}hasEdge(i,m,k){return(arguments.length===1?T(this._isDirected,i):y(this._isDirected,i,m,k))in this._edgeLabels}removeEdge(i,m,k){let R=arguments.length===1?T(this._isDirected,i):y(this._isDirected,i,m,k),$=this._edgeObjs[R];if($){let et=$.v,vt=$.w;delete this._edgeLabels[R],delete this._edgeObjs[R],n(this._preds[vt],et),n(this._sucs[et],vt),delete this._in[vt][R],delete this._out[et][R],this._edgeCount--}return this}inEdges(i,m){return this.isDirected()?this.filterEdges(this._in[i],i,m):this.nodeEdges(i,m)}outEdges(i,m){return this.isDirected()?this.filterEdges(this._out[i],i,m):this.nodeEdges(i,m)}nodeEdges(i,m){if(i in this._nodes)return this.filterEdges(Bo(Bo({},this._in[i]),this._out[i]),i,m)}_removeFromParentsChildList(i){delete this._children[this._parent[i]][i]}filterEdges(i,m,k){if(!i)return;let R=Object.values(i);return k?R.filter($=>$.v===m&&$.w===k||$.v===k&&$.w===m):R}};function d(i,m){i[m]?i[m]++:i[m]=1}function n(i,m){i[m]!==void 0&&!--i[m]&&delete i[m]}function y(i,m,k,R){let $=""+m,et=""+k;if(!i&&$>et){let vt=$;$=et,et=vt}return $+""+et+""+(R===void 0?"\0":R)}function b(i,m,k,R){let $=""+m,et=""+k;if(!i&&$>et){let Et=$;$=et,et=Et}let vt={v:$,w:et};return R&&(vt.name=R),vt}function T(i,m){return y(i,m.v,m.w,m.name)}var I="4.0.1",F={};r(F,{read:()=>dt,write:()=>X});function X(i){let m={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:Z(i),edges:ot(i)},k=i.graph();return k!==void 0&&(m.value=structuredClone(k)),m}function Z(i){return i.nodes().map(m=>{let k=i.node(m),R=i.parent(m),$={v:m};return k!==void 0&&($.value=k),R!==void 0&&($.parent=R),$})}function ot(i){return i.edges().map(m=>{let k=i.edge(m),R={v:m.v,w:m.w};return m.name!==void 0&&(R.name=m.name),k!==void 0&&(R.value=k),R})}function dt(i){let m=new h(i.options);return i.value!==void 0&&m.setGraph(i.value),i.nodes.forEach(k=>{m.setNode(k.v,k.value),k.parent&&m.setParent(k.v,k.parent)}),i.edges.forEach(k=>{m.setEdge({v:k.v,w:k.w,name:k.name},k.value)}),m}var xt={};r(xt,{CycleException:()=>It,bellmanFord:()=>N,components:()=>at,dijkstra:()=>O,dijkstraAll:()=>lt,findCycles:()=>pt,floydWarshall:()=>Tt,isAcyclic:()=>Qt,postorder:()=>Ee,preorder:()=>xe,prim:()=>ar,shortestPaths:()=>xr,tarjan:()=>W,topsort:()=>te});var re=()=>1;function N(i,m,k,R){return Q(i,String(m),k||re,R||function($){return i.outEdges($)})}function Q(i,m,k,R){let $={},et,vt=0,Et=i.nodes(),Yt=function(_e){let He=k(_e);$[_e.v].distance+He<$[_e.w].distance&&($[_e.w]={distance:$[_e.v].distance+He,predecessor:_e.v},et=!0)},Gt=function(){Et.forEach(function(_e){R(_e).forEach(function(He){let qe=He.v===_e?He.v:He.w,Er=qe===He.v?He.w:He.v;Yt({v:qe,w:Er})})})};Et.forEach(function(_e){let He=_e===m?0:Number.POSITIVE_INFINITY;$[_e]={distance:He,predecessor:""}});let he=Et.length;for(let _e=1;_e<he&&(et=!1,vt++,Gt(),!!et);_e++);if(vt===he-1&&(et=!1,Gt(),et))throw new Error("The graph contains a negative weight cycle");return $}function at(i){let m={},k=[],R;function $(et){et in m||(m[et]=!0,R.push(et),i.successors(et).forEach($),i.predecessors(et).forEach($))}return i.nodes().forEach(function(et){R=[],$(et),R.length&&k.push(R)}),k}var _=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(i=>i.key)}has(i){return i in this._keyIndices}priority(i){let m=this._keyIndices[i];if(m!==void 0)return this._arr[m].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(i,m){let k=this._keyIndices,R=String(i);if(!(R in k)){let $=this._arr,et=$.length;return k[R]=et,$.push({key:R,priority:m}),this._decrease(et),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let i=this._arr.pop();return delete this._keyIndices[i.key],this._heapify(0),i.key}decrease(i,m){let k=this._keyIndices[i];if(k===void 0)throw new Error(`Key not found: ${i}`);let R=this._arr[k].priority;if(m>R)throw new Error(`New priority is greater than current priority. Key: ${i} Old: ${R} New: ${m}`);this._arr[k].priority=m,this._decrease(k)}_heapify(i){let m=this._arr,k=2*i,R=k+1,$=i;k<m.length&&($=m[k].priority<m[$].priority?k:$,R<m.length&&($=m[R].priority<m[$].priority?R:$),$!==i&&(this._swap(i,$),this._heapify($)))}_decrease(i){let m=this._arr,k=m[i].priority,R;for(;i!==0&&(R=i>>1,!(m[R].priority<k));)this._swap(i,R),i=R}_swap(i,m){let k=this._arr,R=this._keyIndices,$=k[i],et=k[m];k[i]=et,k[m]=$,R[et.key]=i,R[$.key]=m}},l=()=>1;function O(i,m,k,R){let $=function(et){return i.outEdges(et)};return z(i,String(m),k||l,R||$)}function z(i,m,k,R){let $={},et=new _,vt,Et,Yt=function(Gt){let he=Gt.v!==vt?Gt.v:Gt.w,_e=$[he],He=k(Gt),qe=Et.distance+He;if(He<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+Gt+" Weight: "+He);qe<_e.distance&&(_e.distance=qe,_e.predecessor=vt,et.decrease(he,qe))};for(i.nodes().forEach(function(Gt){let he=Gt===m?0:Number.POSITIVE_INFINITY;$[Gt]={distance:he,predecessor:""},et.add(Gt,he)});et.size()>0&&(vt=et.removeMin(),Et=$[vt],Et.distance!==Number.POSITIVE_INFINITY);)R(vt).forEach(Yt);return $}function lt(i,m,k){return i.nodes().reduce(function(R,$){return R[$]=O(i,$,m,k),R},{})}function W(i){let m=0,k=[],R={},$=[];function et(vt){let Et=R[vt]={onStack:!0,lowlink:m,index:m++};if(k.push(vt),i.successors(vt).forEach(function(Yt){Yt in R?R[Yt].onStack&&(Et.lowlink=Math.min(Et.lowlink,R[Yt].index)):(et(Yt),Et.lowlink=Math.min(Et.lowlink,R[Yt].lowlink))}),Et.lowlink===Et.index){let Yt=[],Gt;do Gt=k.pop(),R[Gt].onStack=!1,Yt.push(Gt);while(vt!==Gt);$.push(Yt)}}return i.nodes().forEach(function(vt){vt in R||et(vt)}),$}function pt(i){return W(i).filter(function(m){return m.length>1||m.length===1&&i.hasEdge(m[0],m[0])})}var mt=()=>1;function Tt(i,m,k){return Rt(i,m||mt,k||function(R){return i.outEdges(R)})}function Rt(i,m,k){let R={},$=i.nodes();return $.forEach(function(et){R[et]={},R[et][et]={distance:0,predecessor:""},$.forEach(function(vt){et!==vt&&(R[et][vt]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),k(et).forEach(function(vt){let Et=vt.v===et?vt.w:vt.v,Yt=m(vt);R[et][Et]={distance:Yt,predecessor:et}})}),$.forEach(function(et){let vt=R[et];$.forEach(function(Et){let Yt=R[Et];$.forEach(function(Gt){let he=Yt[et],_e=vt[Gt],He=Yt[Gt],qe=he.distance+_e.distance;qe<He.distance&&(He.distance=qe,He.predecessor=_e.predecessor)})})}),R}var It=class extends Error{constructor(...i){super(...i)}};function te(i){let m={},k={},R=[];function $(et){if(et in k)throw new It;et in m||(k[et]=!0,m[et]=!0,i.predecessors(et).forEach($),delete k[et],R.push(et))}if(i.sinks().forEach($),Object.keys(m).length!==i.nodeCount())throw new It;return R}function Qt(i){try{te(i)}catch(m){if(m instanceof It)return!1;throw m}return!0}function pe(i,m,k,R,$){Array.isArray(m)||(m=[m]);let et=(Et=>{var Yt;return(Yt=i.isDirected()?i.successors(Et):i.neighbors(Et))!=null?Yt:[]}),vt={};return m.forEach(function(Et){if(!i.hasNode(Et))throw new Error("Graph does not have node: "+Et);$=ue(i,Et,k==="post",vt,et,R,$)}),$}function ue(i,m,k,R,$,et,vt){return m in R||(R[m]=!0,k||(vt=et(vt,m)),$(m).forEach(function(Et){vt=ue(i,Et,k,R,$,et,vt)}),k&&(vt=et(vt,m))),vt}function me(i,m,k){return pe(i,m,k,function(R,$){return R.push($),R},[])}function Ee(i,m){return me(i,m,"post")}function xe(i,m){return me(i,m,"pre")}function ar(i,m){let k=new h,R={},$=new _,et;function vt(Yt){let Gt=Yt.v===et?Yt.w:Yt.v,he=$.priority(Gt);if(he!==void 0){let _e=m(Yt);_e<he&&(R[Gt]=et,$.decrease(Gt,_e))}}if(i.nodeCount()===0)return k;i.nodes().forEach(function(Yt){$.add(Yt,Number.POSITIVE_INFINITY),k.setNode(Yt)}),$.decrease(i.nodes()[0],0);let Et=!1;for(;$.size()>0;){if(et=$.removeMin(),et in R)k.setEdge(et,R[et]);else{if(Et)throw new Error("Input graph is not connected: "+i);Et=!0}i.nodeEdges(et).forEach(vt)}return k}function xr(i,m,k,R){return sr(i,m,k,R!=null?R:($=>{let et=i.outEdges($);return et!=null?et:[]}))}function sr(i,m,k,R){if(k===void 0)return O(i,m,k,R);let $=!1,et=i.nodes();for(let vt=0;vt<et.length;vt++){let Et=R(et[vt]);for(let Yt=0;Yt<Et.length;Yt++){let Gt=Et[Yt],he=Gt.v===et[vt]?Gt.v:Gt.w,_e=he===Gt.v?Gt.w:Gt.v;k({v:he,w:_e})<0&&($=!0)}if($)return N(i,m,k,R)}return O(i,m,k,R)}function Qe(i,m,k,R){let $=R;for(;i.hasNode($);)$=ir(R);return k.dummy=m,i.setNode($,k),$}function or(i){let m=new h().setGraph(i.graph());return i.nodes().forEach(k=>m.setNode(k,i.node(k))),i.edges().forEach(k=>{let R=m.edge(k.v,k.w)||{weight:0,minlen:1},$=i.edge(k);m.setEdge(k.v,k.w,{weight:R.weight+$.weight,minlen:Math.max(R.minlen,$.minlen)})}),m}function Wr(i){let m=new h({multigraph:i.isMultigraph()}).setGraph(i.graph());return i.nodes().forEach(k=>{i.children(k).length||m.setNode(k,i.node(k))}),i.edges().forEach(k=>{m.setEdge(k,i.edge(k))}),m}function oa(i,m){let k=i.x,R=i.y,$=m.x-k,et=m.y-R,vt=i.width/2,Et=i.height/2;if(!$&&!et)throw new Error("Not possible to find intersection inside of the rectangle");let Yt,Gt;return Math.abs(et)*vt>Math.abs($)*Et?(et<0&&(Et=-Et),Yt=Et*$/et,Gt=Et):($<0&&(vt=-vt),Yt=vt,Gt=vt*et/$),{x:k+Yt,y:R+Gt}}function Sr(i){let m=ur(Jr(i)+1).map(()=>[]);return i.nodes().forEach(k=>{let R=i.node(k),$=R.rank;$!==void 0&&(m[$]||(m[$]=[]),m[$][R.order]=k)}),m}function Rr(i){let m=i.nodes().map(R=>{let $=i.node(R).rank;return $===void 0?Number.MAX_VALUE:$}),k=Ur(Math.min,m);i.nodes().forEach(R=>{let $=i.node(R);Object.hasOwn($,"rank")&&($.rank-=k)})}function Mr(i){let m=i.nodes().map(vt=>i.node(vt).rank).filter(vt=>vt!==void 0),k=Ur(Math.min,m),R=[];i.nodes().forEach(vt=>{let Et=i.node(vt).rank-k;R[Et]||(R[Et]=[]),R[Et].push(vt)});let $=0,et=i.graph().nodeRankFactor;Array.from(R).forEach((vt,Et)=>{vt===void 0&&Et%et!==0?--$:vt!==void 0&&$&&vt.forEach(Yt=>i.node(Yt).rank+=$)})}function er(i,m,k,R){let $={width:0,height:0};return arguments.length>=4&&($.rank=k,$.order=R),Qe(i,"border",$,m)}function Xr(i,m=Kr){let k=[];for(let R=0;R<i.length;R+=m){let $=i.slice(R,R+m);k.push($)}return k}var Kr=65535;function Ur(i,m){if(m.length>Kr){let k=Xr(m);return i(...k.map(R=>i(...R)))}else return i(...m)}function Jr(i){let m=i.nodes().map(k=>{let R=i.node(k).rank;return R===void 0?Number.MIN_VALUE:R});return Ur(Math.max,m)}function Yr(i,m){let k={lhs:[],rhs:[]};return i.forEach(R=>{m(R)?k.lhs.push(R):k.rhs.push(R)}),k}function ke(i,m){let k=Date.now();try{return m()}finally{console.log(i+" time: "+(Date.now()-k)+"ms")}}function ze(i,m){return m()}var lr=0;function ir(i){let m=++lr;return i+(""+m)}function ur(i,m,k=1){m==null&&(m=i,i=0);let R=et=>et<m;k<0&&(R=et=>m<et);let $=[];for(let et=i;R(et);et+=k)$.push(et);return $}function zr(i,m){let k={};for(let R of m)i[R]!==void 0&&(k[R]=i[R]);return k}function cr(i,m){let k;return typeof m=="string"?k=R=>R[m]:k=m,Object.entries(i).reduce((R,[$,et])=>(R[$]=k(et,$),R),{})}function Nr(i,m){return i.reduce((k,R,$)=>(k[R]=m[$],k),{})}var Fr="\0",sa="3.0.0",yr=class{constructor(){v(this,"_sentinel");let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,m=i._prev;if(m!==i)return kr(m),m}enqueue(i){let m=this._sentinel;i._prev&&i._next&&kr(i),i._next=m._next,m._next._prev=i,m._next=i,i._prev=m}toString(){let i=[],m=this._sentinel,k=m._prev;for(;k!==m;)i.push(JSON.stringify(k,pr)),k=k._prev;return"["+i.join(", ")+"]"}};function kr(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function pr(i,m){if(i!=="_next"&&i!=="_prev")return m}var rr=yr,Pr=()=>1;function ta(i,m){if(i.nodeCount()<=1)return[];let k=ca(i,m||Pr);return wr(k.graph,k.buckets,k.zeroIdx).flatMap(R=>i.outEdges(R.v,R.w)||[])}function wr(i,m,k){var R;let $=[],et=m[m.length-1],vt=m[0],Et;for(;i.nodeCount();){for(;Et=vt.dequeue();)Sa(i,m,k,Et);for(;Et=et.dequeue();)Sa(i,m,k,Et);if(i.nodeCount()){for(let Yt=m.length-2;Yt>0;--Yt)if(Et=(R=m[Yt])==null?void 0:R.dequeue(),Et){$=$.concat(Sa(i,m,k,Et,!0)||[]);break}}}return $}function Sa(i,m,k,R,$){let et=[],vt=$?et:void 0;return(i.inEdges(R.v)||[]).forEach(Et=>{let Yt=i.edge(Et),Gt=i.node(Et.v);$&&et.push({v:Et.v,w:Et.w}),Gt.out-=Yt,ba(m,k,Gt)}),(i.outEdges(R.v)||[]).forEach(Et=>{let Yt=i.edge(Et),Gt=Et.w,he=i.node(Gt);he.in-=Yt,ba(m,k,he)}),i.removeNode(R.v),vt}function ca(i,m){let k=new h,R=0,$=0;i.nodes().forEach(Et=>{k.setNode(Et,{v:Et,in:0,out:0})}),i.edges().forEach(Et=>{let Yt=k.edge(Et.v,Et.w)||0,Gt=m(Et),he=Yt+Gt;k.setEdge(Et.v,Et.w,he);let _e=k.node(Et.v),He=k.node(Et.w);$=Math.max($,_e.out+=Gt),R=Math.max(R,He.in+=Gt)});let et=ra($+R+3).map(()=>new rr),vt=R+1;return k.nodes().forEach(Et=>{ba(et,vt,k.node(Et))}),{graph:k,buckets:et,zeroIdx:vt}}function ba(i,m,k){var R,$,et;k.out?k.in?(et=i[k.out-k.in+m])==null||et.enqueue(k):($=i[i.length-1])==null||$.enqueue(k):(R=i[0])==null||R.enqueue(k)}function ra(i){let m=[];for(let k=0;k<i;k++)m.push(k);return m}function Dr(i){(i.graph().acyclicer==="greedy"?ta(i,m(i)):la(i)).forEach(k=>{let R=i.edge(k);i.removeEdge(k),R.forwardName=k.name,R.reversed=!0,i.setEdge(k.w,k.v,R,ir("rev"))});function m(k){return R=>k.edge(R).weight}}function la(i){let m=[],k={},R={};function $(et){Object.hasOwn(R,et)||(R[et]=!0,k[et]=!0,i.outEdges(et).forEach(vt=>{Object.hasOwn(k,vt.w)?m.push(vt):$(vt.w)}),delete k[et])}return i.nodes().forEach($),m}function qr(i){i.edges().forEach(m=>{let k=i.edge(m);if(k.reversed){i.removeEdge(m);let R=k.forwardName;delete k.reversed,delete k.forwardName,i.setEdge(m.w,m.v,k,R)}})}function ma(i){i.graph().dummyChains=[],i.edges().forEach(m=>Ja(i,m))}function Ja(i,m){let k=m.v,R=i.node(k).rank,$=m.w,et=i.node($).rank,vt=m.name,Et=i.edge(m),Yt=Et.labelRank;if(et===R+1)return;i.removeEdge(m);let Gt,he,_e;for(_e=0,++R;R<et;++_e,++R)Et.points=[],he={width:0,height:0,edgeLabel:Et,edgeObj:m,rank:R},Gt=Qe(i,"edge",he,"_d"),R===Yt&&(he.width=Et.width,he.height=Et.height,he.dummy="edge-label",he.labelpos=Et.labelpos),i.setEdge(k,Gt,{weight:Et.weight},vt),_e===0&&i.graph().dummyChains.push(Gt),k=Gt;i.setEdge(k,$,{weight:Et.weight},vt)}function sn(i){i.graph().dummyChains.forEach(m=>{let k=i.node(m),R=k.edgeLabel,$;for(i.setEdge(k.edgeObj,R);k.dummy;)$=i.successors(m)[0],i.removeNode(m),R.points.push({x:k.x,y:k.y}),k.dummy==="edge-label"&&(R.x=k.x,R.y=k.y,R.width=k.width,R.height=k.height),m=$,k=i.node(m)})}function fn(i){let m={};function k(R){let $=i.node(R);if(Object.hasOwn(m,R))return $.rank;m[R]=!0;let et=i.outEdges(R),vt=et?et.map(Yt=>Yt==null?Number.POSITIVE_INFINITY:k(Yt.w)-i.edge(Yt).minlen):[],Et=Ur(Math.min,vt);return Et===Number.POSITIVE_INFINITY&&(Et=0),$.rank=Et}i.sources().forEach(k)}function Na(i,m){return i.node(m.w).rank-i.node(m.v).rank-i.edge(m).minlen}var Cn=Mn;function Mn(i){let m=new h({directed:!1}),k=i.nodes();if(k.length===0)throw new Error("Graph must have at least one node");let R=k[0],$=i.nodeCount();m.setNode(R,{});let et,vt;for(;nn(m,i)<$&&(et=An(m,i),!!et);)vt=m.hasNode(et.v)?Na(i,et):-Na(i,et),dn(m,i,vt);return m}function nn(i,m){function k(R){let $=m.nodeEdges(R);$&&$.forEach(et=>{let vt=et.v,Et=R===vt?et.w:vt;!i.hasNode(Et)&&!Na(m,et)&&(i.setNode(Et,{}),i.setEdge(R,Et,{}),k(Et))})}return i.nodes().forEach(k),i.nodeCount()}function An(i,m){return m.edges().reduce((k,R)=>{let $=Number.POSITIVE_INFINITY;return i.hasNode(R.v)!==i.hasNode(R.w)&&($=Na(m,R)),$<k[0]?[$,R]:k},[Number.POSITIVE_INFINITY,null])[1]}function dn(i,m,k){i.nodes().forEach(R=>m.node(R).rank+=k)}var{preorder:Ln,postorder:Fn}=xt,g=tt;tt.initLowLimValues=yt,tt.initCutValues=B,tt.calcCutValue=H,tt.leaveEdge=ht,tt.enterEdge=bt,tt.exchangeEdges=Nt;function tt(i){i=or(i),fn(i);let m=Cn(i);yt(m),B(m,i);let k,R;for(;k=ht(m);)R=bt(m,i,k),Nt(m,i,k,R)}function B(i,m){let k=Fn(i,i.nodes());k=k.slice(0,k.length-1),k.forEach(R=>K(i,m,R))}function K(i,m,k){let R=i.node(k).parent,$=i.edge(k,R);$.cutvalue=H(i,m,k)}function H(i,m,k){let R=i.node(k).parent,$=!0,et=m.edge(k,R),vt=0;et||($=!1,et=m.edge(R,k)),vt=et.weight;let Et=m.nodeEdges(k);return Et&&Et.forEach(Yt=>{let Gt=Yt.v===k,he=Gt?Yt.w:Yt.v;if(he!==R){let _e=Gt===$,He=m.edge(Yt).weight;if(vt+=_e?He:-He,st(i,k,he)){let qe=i.edge(k,he).cutvalue;vt+=_e?-qe:qe}}}),vt}function yt(i,m){arguments.length<2&&(m=i.nodes()[0]),ut(i,{},1,m)}function ut(i,m,k,R,$){let et=k,vt=i.node(R);m[R]=!0;let Et=i.neighbors(R);return Et&&Et.forEach(Yt=>{Object.hasOwn(m,Yt)||(k=ut(i,m,k,Yt,R))}),vt.low=et,vt.lim=k++,$?vt.parent=$:delete vt.parent,k}function ht(i){return i.edges().find(m=>i.edge(m).cutvalue<0)}function bt(i,m,k){let R=k.v,$=k.w;m.hasEdge(R,$)||(R=k.w,$=k.v);let et=i.node(R),vt=i.node($),Et=et,Yt=!1;return et.lim>vt.lim&&(Et=vt,Yt=!0),m.edges().filter(Gt=>Yt===Lt(i,i.node(Gt.v),Et)&&Yt!==Lt(i,i.node(Gt.w),Et)).reduce((Gt,he)=>Na(m,he)<Na(m,Gt)?he:Gt)}function Nt(i,m,k,R){let $=k.v,et=k.w;i.removeEdge($,et),i.setEdge(R.v,R.w,{}),yt(i),B(i,m),Dt(i,m)}function Dt(i,m){let k=i.nodes().find($=>!i.node($).parent);if(!k)return;let R=Ln(i,[k]);R=R.slice(1),R.forEach($=>{let et=i.node($).parent,vt=m.edge($,et),Et=!1;vt||(vt=m.edge(et,$),Et=!0),m.node($).rank=m.node(et).rank+(Et?vt.minlen:-vt.minlen)})}function st(i,m,k){return i.hasEdge(m,k)}function Lt(i,m,k){return k.low<=m.lim&&m.lim<=k.lim}var ft=Ct;function Ct(i){let m=i.graph().ranker;if(typeof m=="function")return m(i);switch(m){case"network-simplex":Zt(i);break;case"tight-tree":St(i);break;case"longest-path":Xt(i);break;case"none":break;default:Zt(i)}}var Xt=fn;function St(i){fn(i),Cn(i)}function Zt(i){g(i)}var G=gt;function gt(i){let m=ae(i);i.graph().dummyChains.forEach(k=>{let R=i.node(k),$=R.edgeObj,et=oe(i,m,$.v,$.w),vt=et.path,Et=et.lca,Yt=0,Gt=vt[Yt],he=!0;for(;k!==$.w;){if(R=i.node(k),he){for(;(Gt=vt[Yt])!==Et&&i.node(Gt).maxRank<R.rank;)Yt++;Gt===Et&&(he=!1)}if(!he){for(;Yt<vt.length-1&&i.node(vt[Yt+1]).minRank<=R.rank;)Yt++;Gt=vt[Yt]}Gt!==void 0&&i.setParent(k,Gt),k=i.successors(k)[0]}})}function oe(i,m,k,R){let $=[],et=[],vt=Math.min(m[k].low,m[R].low),Et=Math.max(m[k].lim,m[R].lim),Yt;Yt=k;do Yt=i.parent(Yt),$.push(Yt);while(Yt&&(m[Yt].low>vt||Et>m[Yt].lim));let Gt=Yt,he=R;for(;(he=i.parent(he))!==Gt;)et.push(he);return{path:$.concat(et.reverse()),lca:Gt}}function ae(i){let m={},k=0;function R($){let et=k;i.children($).forEach(R),m[$]={low:et,lim:k++}}return i.children(Fr).forEach(R),m}function fe(i){let m=Qe(i,"root",{},"_root"),k=ye(i),R=Object.values(k),$=Ur(Math.max,R)-1,et=2*$+1;i.graph().nestingRoot=m,i.edges().forEach(Et=>i.edge(Et).minlen*=et);let vt=Mt(i)+1;i.children(Fr).forEach(Et=>ne(i,m,et,vt,$,k,Et)),i.graph().nodeRankFactor=et}function ne(i,m,k,R,$,et,vt){var Et;let Yt=i.children(vt);if(!Yt.length){vt!==m&&i.setEdge(m,vt,{weight:0,minlen:k});return}let Gt=er(i,"_bt"),he=er(i,"_bb"),_e=i.node(vt);i.setParent(Gt,vt),_e.borderTop=Gt,i.setParent(he,vt),_e.borderBottom=he,Yt.forEach(He=>{var qe;ne(i,m,k,R,$,et,He);let Er=i.node(He),Tr=Er.borderTop?Er.borderTop:He,Vr=Er.borderBottom?Er.borderBottom:He,Zr=Er.borderTop?R:2*R,ua=Tr!==Vr?1:$-((qe=et[vt])!=null?qe:0)+1;i.setEdge(Gt,Tr,{weight:Zr,minlen:ua,nestingEdge:!0}),i.setEdge(Vr,he,{weight:Zr,minlen:ua,nestingEdge:!0})}),i.parent(vt)||i.setEdge(m,Gt,{weight:0,minlen:$+((Et=et[vt])!=null?Et:0)})}function ye(i){let m={};function k(R,$){let et=i.children(R);et&&et.length&&et.forEach(vt=>k(vt,$+1)),m[R]=$}return i.children(Fr).forEach(R=>k(R,1)),m}function Mt(i){return i.edges().reduce((m,k)=>m+i.edge(k).weight,0)}function $t(i){let m=i.graph();i.removeNode(m.nestingRoot),delete m.nestingRoot,i.edges().forEach(k=>{i.edge(k).nestingEdge&&i.removeEdge(k)})}var Jt=e;function e(i){function m(k){let R=i.children(k),$=i.node(k);if(R.length&&R.forEach(m),Object.hasOwn($,"minRank")){$.borderLeft=[],$.borderRight=[];for(let et=$.minRank,vt=$.maxRank+1;et<vt;++et)x(i,"borderLeft","_bl",k,$,et),x(i,"borderRight","_br",k,$,et)}}i.children(Fr).forEach(m)}function x(i,m,k,R,$,et){let vt={width:0,height:0,rank:et,borderType:m},Et=$[m][et-1],Yt=Qe(i,"border",vt,k);$[m][et]=Yt,i.setParent(Yt,R),Et&&i.setEdge(Et,Yt,{weight:1})}function C(i){var m;let k=(m=i.graph().rankdir)==null?void 0:m.toLowerCase();(k==="lr"||k==="rl")&&Y(i)}function S(i){var m;let k=(m=i.graph().rankdir)==null?void 0:m.toLowerCase();(k==="bt"||k==="rl")&&At(i),(k==="lr"||k==="rl")&&(q(i),Y(i))}function Y(i){i.nodes().forEach(m=>D(i.node(m))),i.edges().forEach(m=>D(i.edge(m)))}function D(i){let m=i.width;i.width=i.height,i.height=m}function At(i){i.nodes().forEach(m=>U(i.node(m))),i.edges().forEach(m=>{var k;let R=i.edge(m);(k=R.points)==null||k.forEach(U),Object.hasOwn(R,"y")&&U(R)})}function U(i){i.y=-i.y}function q(i){i.nodes().forEach(m=>rt(i.node(m))),i.edges().forEach(m=>{var k;let R=i.edge(m);(k=R.points)==null||k.forEach(rt),Object.hasOwn(R,"x")&&rt(R)})}function rt(i){let m=i.x;i.x=i.y,i.y=m}function ct(i){let m={},k=i.nodes().filter(Et=>!i.children(Et).length),R=k.map(Et=>i.node(Et).rank),$=Ur(Math.max,R),et=ur($+1).map(()=>[]);function vt(Et){if(m[Et])return;m[Et]=!0;let Yt=i.node(Et);et[Yt.rank].push(Et);let Gt=i.successors(Et);Gt&&Gt.forEach(vt)}return k.sort((Et,Yt)=>i.node(Et).rank-i.node(Yt).rank).forEach(vt),et}function nt(i,m){let k=0;for(let R=1;R<m.length;++R)k+=zt(i,m[R-1],m[R]);return k}function zt(i,m,k){let R=Nr(k,k.map((Gt,he)=>he)),$=m.flatMap(Gt=>{let he=i.outEdges(Gt);return he?he.map(_e=>({pos:R[_e.w],weight:i.edge(_e).weight})).sort((_e,He)=>_e.pos-He.pos):[]}),et=1;for(;et<k.length;)et<<=1;let vt=2*et-1;et-=1;let Et=new Array(vt).fill(0),Yt=0;return $.forEach(Gt=>{let he=Gt.pos+et;Et[he]+=Gt.weight;let _e=0;for(;he>0;)he%2&&(_e+=Et[he+1]),he=he-1>>1,Et[he]+=Gt.weight;Yt+=Gt.weight*_e}),Yt}function Ot(i,m=[]){return m.map(k=>{let R=i.inEdges(k);if(!R||!R.length)return{v:k};{let $=R.reduce((et,vt)=>{let Et=i.edge(vt),Yt=i.node(vt.v);return{sum:et.sum+Et.weight*Yt.order,weight:et.weight+Et.weight}},{sum:0,weight:0});return{v:k,barycenter:$.sum/$.weight,weight:$.weight}}})}function Ft(i,m){let k={};i.forEach(($,et)=>{let vt={indegree:0,in:[],out:[],vs:[$.v],i:et};$.barycenter!==void 0&&(vt.barycenter=$.barycenter,vt.weight=$.weight),k[$.v]=vt}),m.edges().forEach($=>{let et=k[$.v],vt=k[$.w];et!==void 0&&vt!==void 0&&(vt.indegree++,et.out.push(vt))});let R=Object.values(k).filter($=>!$.indegree);return Pt(R)}function Pt(i){let m=[];function k($){return et=>{et.merged||(et.barycenter===void 0||$.barycenter===void 0||et.barycenter>=$.barycenter)&&Wt($,et)}}function R($){return et=>{et.in.push($),--et.indegree===0&&i.push(et)}}for(;i.length;){let $=i.pop();m.push($),$.in.reverse().forEach(k($)),$.out.forEach(R($))}return m.filter($=>!$.merged).map($=>zr($,["vs","i","barycenter","weight"]))}function Wt(i,m){let k=0,R=0;i.weight&&(k+=i.barycenter*i.weight,R+=i.weight),m.weight&&(k+=m.barycenter*m.weight,R+=m.weight),i.vs=m.vs.concat(i.vs),i.barycenter=k/R,i.weight=R,i.i=Math.min(m.i,i.i),m.merged=!0}function Kt(i,m){let k=Yr(i,he=>Object.hasOwn(he,"barycenter")),R=k.lhs,$=k.rhs.sort((he,_e)=>_e.i-he.i),et=[],vt=0,Et=0,Yt=0;R.sort(ce(!!m)),Yt=Bt(et,$,Yt),R.forEach(he=>{Yt+=he.vs.length,et.push(he.vs),vt+=he.barycenter*he.weight,Et+=he.weight,Yt=Bt(et,$,Yt)});let Gt={vs:et.flat(1)};return Et&&(Gt.barycenter=vt/Et,Gt.weight=Et),Gt}function Bt(i,m,k){let R;for(;m.length&&(R=m[m.length-1]).i<=k;)m.pop(),i.push(R.vs),k++;return k}function ce(i){return(m,k)=>m.barycenter<k.barycenter?-1:m.barycenter>k.barycenter?1:i?k.i-m.i:m.i-k.i}function kt(i,m,k,R){let $=i.children(m),et=i.node(m),vt=et?et.borderLeft:void 0,Et=et?et.borderRight:void 0,Yt={};vt&&($=$.filter(He=>He!==vt&&He!==Et));let Gt=Ot(i,$);Gt.forEach(He=>{if(i.children(He.v).length){let qe=kt(i,He.v,k,R);Yt[He.v]=qe,Object.hasOwn(qe,"barycenter")&&jt(He,qe)}});let he=Ft(Gt,k);wt(he,Yt);let _e=Kt(he,R);if(vt&&Et){_e.vs=[vt,_e.vs,Et].flat(1);let He=i.predecessors(vt);if(He&&He.length){let qe=i.node(He[0]),Er=i.predecessors(Et),Tr=i.node(Er[0]);Object.hasOwn(_e,"barycenter")||(_e.barycenter=0,_e.weight=0),_e.barycenter=(_e.barycenter*_e.weight+qe.order+Tr.order)/(_e.weight+2),_e.weight+=2}}return _e}function wt(i,m){i.forEach(k=>{k.vs=k.vs.flatMap(R=>m[R]?m[R].vs:R)})}function jt(i,m){i.barycenter!==void 0?(i.barycenter=(i.barycenter*i.weight+m.barycenter*m.weight)/(i.weight+m.weight),i.weight+=m.weight):(i.barycenter=m.barycenter,i.weight=m.weight)}function Ht(i,m,k,R){R||(R=i.nodes());let $=qt(i),et=new h({compound:!0}).setGraph({root:$}).setDefaultNodeLabel(vt=>i.node(vt));return R.forEach(vt=>{let Et=i.node(vt),Yt=i.parent(vt);if(Et.rank===m||Et.minRank<=m&&m<=Et.maxRank){et.setNode(vt),et.setParent(vt,Yt||$);let Gt=i[k](vt);Gt&&Gt.forEach(he=>{let _e=he.v===vt?he.w:he.v,He=et.edge(_e,vt),qe=He!==void 0?He.weight:0;et.setEdge(_e,vt,{weight:i.edge(he).weight+qe})}),Object.hasOwn(Et,"minRank")&&et.setNode(vt,{borderLeft:Et.borderLeft[m],borderRight:Et.borderRight[m]})}}),et}function qt(i){let m;for(;i.hasNode(m=ir("_root")););return m}function ee(i,m,k){let R={},$;k.forEach(et=>{let vt=i.parent(et),Et,Yt;for(;vt;){if(Et=i.parent(vt),Et?(Yt=R[Et],R[Et]=vt):(Yt=$,$=vt),Yt&&Yt!==vt){m.setEdge(Yt,vt);return}vt=Et}})}function Ut(i,m={}){if(typeof m.customOrder=="function"){m.customOrder(i,Ut);return}let k=Jr(i),R=ve(i,ur(1,k+1),"inEdges"),$=ve(i,ur(k-1,-1,-1),"outEdges"),et=ct(i);if(Se(i,et),m.disableOptimalOrderHeuristic)return;let vt=Number.POSITIVE_INFINITY,Et,Yt=m.constraints||[];for(let Gt=0,he=0;he<4;++Gt,++he){we(Gt%2?R:$,Gt%4>=2,Yt),et=Sr(i);let _e=nt(i,et);_e<vt?(he=0,Et=Object.assign({},et),vt=_e):_e===vt&&(Et=structuredClone(et))}Se(i,Et)}function ve(i,m,k){let R=new Map,$=(et,vt)=>{R.has(et)||R.set(et,[]),R.get(et).push(vt)};for(let et of i.nodes()){let vt=i.node(et);if(typeof vt.rank=="number"&&$(vt.rank,et),typeof vt.minRank=="number"&&typeof vt.maxRank=="number")for(let Et=vt.minRank;Et<=vt.maxRank;Et++)Et!==vt.rank&&$(Et,et)}return m.map(function(et){return Ht(i,et,k,R.get(et)||[])})}function we(i,m,k){let R=new h;i.forEach(function($){k.forEach(Et=>R.setEdge(Et.left,Et.right));let et=$.graph().root,vt=kt($,et,R,m);vt.vs.forEach((Et,Yt)=>$.node(Et).order=Yt),ee($,R,vt.vs)})}function Se(i,m){Object.values(m).forEach(k=>k.forEach((R,$)=>i.node(R).order=$))}function be(i,m){let k={};function R($,et){let vt=0,Et=0,Yt=$.length,Gt=et[et.length-1];return et.forEach((he,_e)=>{let He=Fe(i,he),qe=He?i.node(He).order:Yt;(He||he===Gt)&&(et.slice(Et,_e+1).forEach(Er=>{let Tr=i.predecessors(Er);Tr&&Tr.forEach(Vr=>{let Zr=i.node(Vr),ua=Zr.order;(ua<vt||qe<ua)&&!(Zr.dummy&&i.node(Er).dummy)&&Ue(k,Vr,Er)})}),Et=_e+1,vt=qe)}),et}return m.length&&m.reduce(R),k}function Me(i,m){let k={};function R(et,vt,Et,Yt,Gt){ur(vt,Et).forEach(he=>{let _e=et[he];if(_e!==void 0&&i.node(_e).dummy){let He=i.predecessors(_e);He&&He.forEach(qe=>{if(qe===void 0)return;let Er=i.node(qe);Er.dummy&&(Er.order<Yt||Er.order>Gt)&&Ue(k,qe,_e)})}})}function $(et,vt){let Et=-1,Yt=-1,Gt=0;return vt.forEach((he,_e)=>{if(i.node(he).dummy==="border"){let He=i.predecessors(he);if(He&&He.length){let qe=He[0];if(qe===void 0)return;Yt=i.node(qe).order,R(vt,Gt,_e,Et,Yt),Gt=_e,Et=Yt}}R(vt,Gt,vt.length,Yt,et.length)}),vt}return m.length&&m.reduce($),k}function Fe(i,m){if(i.node(m).dummy){let k=i.predecessors(m);if(k)return k.find(R=>i.node(R).dummy)}}function Ue(i,m,k){if(m>k){let $=m;m=k,k=$}let R=i[m];R||(i[m]=R={}),R[k]=!0}function De(i,m,k){if(m>k){let $=m;m=k,k=$}let R=i[m];return R!==void 0&&Object.hasOwn(R,k)}function Ye(i,m,k,R){let $={},et={},vt={};return m.forEach(Et=>{Et.forEach((Yt,Gt)=>{$[Yt]=Yt,et[Yt]=Yt,vt[Yt]=Gt})}),m.forEach(Et=>{let Yt=-1;Et.forEach(Gt=>{let he=R(Gt);if(he&&he.length){let _e=he.sort((qe,Er)=>{let Tr=vt[qe],Vr=vt[Er];return(Tr!==void 0?Tr:0)-(Vr!==void 0?Vr:0)}),He=(_e.length-1)/2;for(let qe=Math.floor(He),Er=Math.ceil(He);qe<=Er;++qe){let Tr=_e[qe];if(Tr===void 0)continue;let Vr=vt[Tr];if(Vr!==void 0&&et[Gt]===Gt&&Yt<Vr&&!De(k,Gt,Tr)){let Zr=$[Tr];Zr!==void 0&&(et[Tr]=Gt,et[Gt]=$[Gt]=Zr,Yt=Vr)}}}})}),{root:$,align:et}}function Pe(i,m,k,R,$=!1){let et={},vt=de(i,m,k,$),Et=$?"borderLeft":"borderRight";function Yt(qe,Er){let Tr=vt.nodes().slice(),Vr={},Zr=Tr.pop();for(;Zr;){if(Vr[Zr])qe(Zr);else{Vr[Zr]=!0,Tr.push(Zr);for(let ua of Er(Zr))Tr.push(ua)}Zr=Tr.pop()}}function Gt(qe){let Er=vt.inEdges(qe);Er?et[qe]=Er.reduce((Tr,Vr)=>{var Zr;let ua=(Zr=et[Vr.v])!=null?Zr:0,Aa=vt.edge(Vr);return Math.max(Tr,ua+(Aa!==void 0?Aa:0))},0):et[qe]=0}function he(qe){let Er=vt.outEdges(qe),Tr=Number.POSITIVE_INFINITY;Er&&(Tr=Er.reduce((Zr,ua)=>{let Aa=et[ua.w],La=vt.edge(ua);return Math.min(Zr,(Aa!==void 0?Aa:0)-(La!==void 0?La:0))},Number.POSITIVE_INFINITY));let Vr=i.node(qe);Tr!==Number.POSITIVE_INFINITY&&Vr.borderType!==Et&&(et[qe]=Math.max(et[qe]!==void 0?et[qe]:0,Tr))}function _e(qe){return vt.predecessors(qe)||[]}function He(qe){return vt.successors(qe)||[]}return Yt(Gt,_e),Yt(he,He),Object.keys(R).forEach(qe=>{var Er;let Tr=k[qe];Tr!==void 0&&(et[qe]=(Er=et[Tr])!=null?Er:0)}),et}function de(i,m,k,R){let $=new h,et=i.graph(),vt=Ie(et.nodesep,et.edgesep,R);return m.forEach(Et=>{let Yt;Et.forEach(Gt=>{let he=k[Gt];if(he!==void 0){if($.setNode(he),Yt!==void 0){let _e=k[Yt];if(_e!==void 0){let He=$.edge(_e,he);$.setEdge(_e,he,Math.max(vt(i,Gt,Yt),He||0))}}Yt=Gt}})}),$}function Ve(i,m){return Object.values(m).reduce((k,R)=>{let $=Number.NEGATIVE_INFINITY,et=Number.POSITIVE_INFINITY;Object.entries(R).forEach(([Et,Yt])=>{let Gt=Ce(i,Et)/2;$=Math.max(Yt+Gt,$),et=Math.min(Yt-Gt,et)});let vt=$-et;return vt<k[0]&&(k=[vt,R]),k},[Number.POSITIVE_INFINITY,null])[1]}function Ne(i,m){let k=Object.values(m),R=Ur(Math.min,k),$=Ur(Math.max,k);["u","d"].forEach(et=>{["l","r"].forEach(vt=>{let Et=et+vt,Yt=i[Et];if(!Yt||Yt===m)return;let Gt=Object.values(Yt),he=R-Ur(Math.min,Gt);vt!=="l"&&(he=$-Ur(Math.max,Gt)),he&&(i[Et]=cr(Yt,_e=>_e+he))})})}function nr(i,m=void 0){let k=i.ul;return k?cr(k,(R,$)=>{var et,vt;if(m){let Yt=m.toLowerCase(),Gt=i[Yt];if(Gt&&Gt[$]!==void 0)return Gt[$]}let Et=Object.values(i).map(Yt=>{let Gt=Yt[$];return Gt!==void 0?Gt:0}).sort((Yt,Gt)=>Yt-Gt);return(((et=Et[1])!=null?et:0)+((vt=Et[2])!=null?vt:0))/2}):{}}function Ge(i){let m=Sr(i),k=Object.assign(be(i,m),Me(i,m)),R={},$;["u","d"].forEach(vt=>{$=vt==="u"?m:Object.values(m).reverse(),["l","r"].forEach(Et=>{Et==="r"&&($=$.map(he=>Object.values(he).reverse()));let Yt=Ye(i,$,k,he=>(vt==="u"?i.predecessors(he):i.successors(he))||[]),Gt=Pe(i,$,Yt.root,Yt.align,Et==="r");Et==="r"&&(Gt=cr(Gt,he=>-he)),R[vt+Et]=Gt})});let et=Ve(i,R);return Ne(R,et),nr(R,i.graph().align)}function Ie(i,m,k){return(R,$,et)=>{let vt=R.node($),Et=R.node(et),Yt=0,Gt;if(Yt+=vt.width/2,Object.hasOwn(vt,"labelpos"))switch(vt.labelpos.toLowerCase()){case"l":Gt=-vt.width/2;break;case"r":Gt=vt.width/2;break}if(Gt&&(Yt+=k?Gt:-Gt),Gt=void 0,Yt+=(vt.dummy?m:i)/2,Yt+=(Et.dummy?m:i)/2,Yt+=Et.width/2,Object.hasOwn(Et,"labelpos"))switch(Et.labelpos.toLowerCase()){case"l":Gt=Et.width/2;break;case"r":Gt=-Et.width/2;break}return Gt&&(Yt+=k?Gt:-Gt),Yt}}function Ce(i,m){return i.node(m).width}function Ke(i){i=Wr(i),We(i),Object.entries(Ge(i)).forEach(([m,k])=>i.node(m).x=k)}function We(i){let m=Sr(i),k=i.graph(),R=k.ranksep,$=k.rankalign,et=0;m.forEach(vt=>{let Et=vt.reduce((Yt,Gt)=>{var he;let _e=(he=i.node(Gt).height)!=null?he:0;return Yt>_e?Yt:_e},0);vt.forEach(Yt=>{let Gt=i.node(Yt);$==="top"?Gt.y=et+Gt.height/2:$==="bottom"?Gt.y=et+Et-Gt.height/2:Gt.y=et+Et/2}),et+=Et+R})}function le(i,m={}){let k=m.debugTiming?ke:ze;return k("layout",()=>{let R=k(" buildLayoutGraph",()=>dr(i));return k(" runLayout",()=>Ae(R,k,m)),k(" updateInputGraph",()=>Le(i,R)),R})}function Ae(i,m,k){m(" makeSpaceForEdgeLabels",()=>Xe(i)),m(" removeSelfEdges",()=>Ir(i)),m(" acyclic",()=>Dr(i)),m(" nestingGraph.run",()=>fe(i)),m(" rank",()=>ft(Wr(i))),m(" injectEdgeLabelProxies",()=>br(i)),m(" removeEmptyRanks",()=>Mr(i)),m(" nestingGraph.cleanup",()=>$t(i)),m(" normalizeRanks",()=>Rr(i)),m(" assignRankMinMax",()=>vr(i)),m(" removeEdgeLabelProxies",()=>gr(i)),m(" normalize.run",()=>ma(i)),m(" parentDummyChains",()=>G(i)),m(" addBorderSegments",()=>Jt(i)),m(" order",()=>Ut(i,k)),m(" insertSelfEdges",()=>Cr(i)),m(" adjustCoordinateSystem",()=>C(i)),m(" position",()=>Ke(i)),m(" positionSelfEdges",()=>Ea(i)),m(" removeBorderNodes",()=>$r(i)),m(" normalize.undo",()=>sn(i)),m(" fixupEdgeLabelCoords",()=>$e(i)),m(" undoCoordinateSystem",()=>S(i)),m(" translateGraph",()=>fa(i)),m(" assignNodeIntersects",()=>Je(i)),m(" reversePoints",()=>Qr(i)),m(" acyclic.undo",()=>qr(i))}function Le(i,m){i.nodes().forEach(k=>{let R=i.node(k),$=m.node(k);R&&(R.x=$.x,R.y=$.y,R.order=$.order,R.rank=$.rank,m.children(k).length&&(R.width=$.width,R.height=$.height))}),i.edges().forEach(k=>{let R=i.edge(k),$=m.edge(k);R.points=$.points,Object.hasOwn($,"x")&&(R.x=$.x,R.y=$.y)}),i.graph().width=m.graph().width,i.graph().height=m.graph().height}var Re=["nodesep","edgesep","ranksep","marginx","marginy"],Be={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},je=["acyclicer","ranker","rankdir","align","rankalign"],ie=["width","height","rank"],fr={width:0,height:0},Ar=["minlen","weight","width","height","labeloffset"],Lr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ze=["labelpos"];function dr(i){let m=new h({multigraph:!0,compound:!0}),k=aa(i.graph());return m.setGraph(Object.assign({},Be,xa(k,Re),zr(k,je))),i.nodes().forEach(R=>{let $=aa(i.node(R)),et=xa($,ie);Object.keys(fr).forEach(Et=>{et[Et]===void 0&&(et[Et]=fr[Et])}),m.setNode(R,et);let vt=i.parent(R);vt!==void 0&&m.setParent(R,vt)}),i.edges().forEach(R=>{let $=aa(i.edge(R));m.setEdge(R,Object.assign({},Lr,xa($,Ar),zr($,Ze)))}),m}function Xe(i){let m=i.graph();m.ranksep/=2,i.edges().forEach(k=>{let R=i.edge(k);R.minlen*=2,R.labelpos.toLowerCase()!=="c"&&(m.rankdir==="TB"||m.rankdir==="BT"?R.width+=R.labeloffset:R.height+=R.labeloffset)})}function br(i){i.edges().forEach(m=>{let k=i.edge(m);if(k.width&&k.height){let R=i.node(m.v),$={rank:(i.node(m.w).rank-R.rank)/2+R.rank,e:m};Qe(i,"edge-proxy",$,"_ep")}})}function vr(i){let m=0;i.nodes().forEach(k=>{let R=i.node(k);R.borderTop&&(R.minRank=i.node(R.borderTop).rank,R.maxRank=i.node(R.borderBottom).rank,m=Math.max(m,R.maxRank))}),i.graph().maxRank=m}function gr(i){i.nodes().forEach(m=>{let k=i.node(m);if(k.dummy==="edge-proxy"){let R=k;i.edge(R.e).labelRank=k.rank,i.removeNode(m)}})}function fa(i){let m=Number.POSITIVE_INFINITY,k=0,R=Number.POSITIVE_INFINITY,$=0,et=i.graph(),vt=et.marginx||0,Et=et.marginy||0;function Yt(Gt){let he=Gt.x,_e=Gt.y,He=Gt.width,qe=Gt.height;m=Math.min(m,he-He/2),k=Math.max(k,he+He/2),R=Math.min(R,_e-qe/2),$=Math.max($,_e+qe/2)}i.nodes().forEach(Gt=>Yt(i.node(Gt))),i.edges().forEach(Gt=>{let he=i.edge(Gt);Object.hasOwn(he,"x")&&Yt(he)}),m-=vt,R-=Et,i.nodes().forEach(Gt=>{let he=i.node(Gt);he.x-=m,he.y-=R}),i.edges().forEach(Gt=>{let he=i.edge(Gt);he.points.forEach(_e=>{_e.x-=m,_e.y-=R}),Object.hasOwn(he,"x")&&(he.x-=m),Object.hasOwn(he,"y")&&(he.y-=R)}),et.width=k-m+vt,et.height=$-R+Et}function Je(i){i.edges().forEach(m=>{let k=i.edge(m),R=i.node(m.v),$=i.node(m.w),et,vt;k.points?(et=k.points[0],vt=k.points[k.points.length-1]):(k.points=[],et=$,vt=R),k.points.unshift(oa(R,et)),k.points.push(oa($,vt))})}function $e(i){i.edges().forEach(m=>{let k=i.edge(m);if(Object.hasOwn(k,"x"))switch((k.labelpos==="l"||k.labelpos==="r")&&(k.width-=k.labeloffset),k.labelpos){case"l":k.x-=k.width/2+k.labeloffset;break;case"r":k.x+=k.width/2+k.labeloffset;break}})}function Qr(i){i.edges().forEach(m=>{let k=i.edge(m);k.reversed&&k.points.reverse()})}function $r(i){i.nodes().forEach(m=>{if(i.children(m).length){let k=i.node(m),R=i.node(k.borderTop),$=i.node(k.borderBottom),et=i.node(k.borderLeft[k.borderLeft.length-1]),vt=i.node(k.borderRight[k.borderRight.length-1]);k.width=Math.abs(vt.x-et.x),k.height=Math.abs($.y-R.y),k.x=et.x+k.width/2,k.y=R.y+k.height/2}}),i.nodes().forEach(m=>{i.node(m).dummy==="border"&&i.removeNode(m)})}function Ir(i){i.edges().forEach(m=>{if(m.v===m.w){let k=i.node(m.v);k.selfEdges||(k.selfEdges=[]),k.selfEdges.push({e:m,label:i.edge(m)}),i.removeEdge(m)}})}function Cr(i){Sr(i).forEach(m=>{let k=0;m.forEach((R,$)=>{let et=i.node(R);et.order=$+k,(et.selfEdges||[]).forEach(vt=>{Qe(i,"selfedge",{width:vt.label.width,height:vt.label.height,rank:et.rank,order:$+ ++k,e:vt.e,label:vt.label},"_se")}),delete et.selfEdges})})}function Ea(i){i.nodes().forEach(m=>{let k=i.node(m);if(k.dummy==="selfedge"){let R=k,$=i.node(R.e.v),et=$.x+$.width/2,vt=$.y,Et=k.x-et,Yt=$.height/2;i.setEdge(R.e,R.label),i.removeNode(m),R.label.points=[{x:et+2*Et/3,y:vt-Yt},{x:et+5*Et/6,y:vt-Yt},{x:et+Et,y:vt},{x:et+5*Et/6,y:vt+Yt},{x:et+2*Et/3,y:vt+Yt}],R.label.x=k.x,R.label.y=k.y}})}function xa(i,m){return cr(zr(i,m),Number)}function aa(i){let m={};return i&&Object.entries(i).forEach(([k,R])=>{typeof k=="string"&&(k=k.toLowerCase()),m[k]=R}),m}function Gr(i){let m=Sr(i),k=new h({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(R=>{k.setNode(R,{label:R}),k.setParent(R,"layer"+i.node(R).rank)}),i.edges().forEach(R=>k.setEdge(R.v,R.w,{},R.name)),m.forEach((R,$)=>{let et="layer"+$;k.setNode(et,{rank:"same"}),R.reduce((vt,Et)=>(k.setEdge(vt,Et,{style:"invis"}),Et))}),k}var ya={time:ke,notime:ze},Br={graphlib:f,version:sa,layout:le,debug:Gr,util:{time:ke,notime:ze}},pa=Br;return o(M)})();var li=Lg;var Fg=(()=>{var L=Object.defineProperty,j=Object.getOwnPropertyDescriptor,P=Object.getOwnPropertyNames,E=Object.prototype.hasOwnProperty,w=(t,a)=>{for(var c in a)L(t,c,{get:a[c],enumerable:!0})},p=(t,a,c,A)=>{if(a&&typeof a=="object"||typeof a=="function")for(let V of P(a))!E.call(t,V)&&V!==c&&L(t,V,{get:()=>a[V],enumerable:!(A=j(a,V))||A.enumerable});return t},s=t=>p(L({},"__esModule",{value:!0}),t),o={};w(o,{graphlib:()=>v,layout:()=>eg});var v={};w(v,{Graph:()=>Nn,version:()=>Dv});var M=typeof global=="object"&&global&&global.Object===Object&&global,f=M,u=typeof self=="object"&&self&&self.Object===Object&&self,r=f||u||Function("return this")(),h=r,d=h.Symbol,n=d,y=Object.prototype,b=y.hasOwnProperty,T=y.toString,I=n?n.toStringTag:void 0;function F(t){var a=b.call(t,I),c=t[I];try{t[I]=void 0;var A=!0}catch(J){}var V=T.call(t);return A&&(a?t[I]=c:delete t[I]),V}var X=F,Z=Object.prototype,ot=Z.toString;function dt(t){return ot.call(t)}var xt=dt,re="[object Null]",N="[object Undefined]",Q=n?n.toStringTag:void 0;function at(t){return t==null?t===void 0?N:re:Q&&Q in Object(t)?X(t):xt(t)}var _=at;function l(t){return t!=null&&typeof t=="object"}var O=l,z="[object Symbol]";function lt(t){return typeof t=="symbol"||O(t)&&_(t)==z}var W=lt;function pt(t,a){for(var c=-1,A=t==null?0:t.length,V=Array(A);++c<A;)V[c]=a(t[c],c,t);return V}var mt=pt,Tt=Array.isArray,Rt=Tt,It=1/0,te=n?n.prototype:void 0,Qt=te?te.toString:void 0;function pe(t){if(typeof t=="string")return t;if(Rt(t))return mt(t,pe)+"";if(W(t))return Qt?Qt.call(t):"";var a=t+"";return a=="0"&&1/t==-It?"-0":a}var ue=pe,me=/\s/;function Ee(t){for(var a=t.length;a--&&me.test(t.charAt(a)););return a}var xe=Ee,ar=/^\s+/;function xr(t){return t&&t.slice(0,xe(t)+1).replace(ar,"")}var sr=xr;function Qe(t){var a=typeof t;return t!=null&&(a=="object"||a=="function")}var or=Qe,Wr=NaN,oa=/^[-+]0x[0-9a-f]+$/i,Sr=/^0b[01]+$/i,Rr=/^0o[0-7]+$/i,Mr=parseInt;function er(t){if(typeof t=="number")return t;if(W(t))return Wr;if(or(t)){var a=typeof t.valueOf=="function"?t.valueOf():t;t=or(a)?a+"":a}if(typeof t!="string")return t===0?t:+t;t=sr(t);var c=Sr.test(t);return c||Rr.test(t)?Mr(t.slice(2),c?2:8):oa.test(t)?Wr:+t}var Xr=er,Kr=1/0,Ur=17976931348623157e292;function Jr(t){if(!t)return t===0?t:0;if(t=Xr(t),t===Kr||t===-Kr){var a=t<0?-1:1;return a*Ur}return t===t?t:0}var Yr=Jr;function ke(t){var a=Yr(t),c=a%1;return a===a?c?a-c:a:0}var ze=ke;function lr(t){return t}var ir=lr,ur="[object AsyncFunction]",zr="[object Function]",cr="[object GeneratorFunction]",Nr="[object Proxy]";function Fr(t){if(!or(t))return!1;var a=_(t);return a==zr||a==cr||a==ur||a==Nr}var sa=Fr,yr=h["__core-js_shared__"],kr=yr,pr=(function(){var t=/[^.]+$/.exec(kr&&kr.keys&&kr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function rr(t){return!!pr&&pr in t}var Pr=rr,ta=Function.prototype,wr=ta.toString;function Sa(t){if(t!=null){try{return wr.call(t)}catch(a){}try{return t+""}catch(a){}}return""}var ca=Sa,ba=/[\\^$.*+?()[\]{}|]/g,ra=/^\[object .+?Constructor\]$/,Dr=Function.prototype,la=Object.prototype,qr=Dr.toString,ma=la.hasOwnProperty,Ja=RegExp("^"+qr.call(ma).replace(ba,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sn(t){if(!or(t)||Pr(t))return!1;var a=sa(t)?Ja:ra;return a.test(ca(t))}var fn=sn;function Na(t,a){return t==null?void 0:t[a]}var Cn=Na;function Mn(t,a){var c=Cn(t,a);return fn(c)?c:void 0}var nn=Mn,An=nn(h,"WeakMap"),dn=An,Ln=Object.create,Fn=(function(){function t(){}return function(a){if(!or(a))return{};if(Ln)return Ln(a);t.prototype=a;var c=new t;return t.prototype=void 0,c}})(),g=Fn;function tt(t,a,c){switch(c.length){case 0:return t.call(a);case 1:return t.call(a,c[0]);case 2:return t.call(a,c[0],c[1]);case 3:return t.call(a,c[0],c[1],c[2])}return t.apply(a,c)}var B=tt;function K(){}var H=K;function yt(t,a){var c=-1,A=t.length;for(a||(a=Array(A));++c<A;)a[c]=t[c];return a}var ut=yt,ht=800,bt=16,Nt=Date.now;function Dt(t){var a=0,c=0;return function(){var A=Nt(),V=bt-(A-c);if(c=A,V>0){if(++a>=ht)return arguments[0]}else a=0;return t.apply(void 0,arguments)}}var st=Dt;function Lt(t){return function(){return t}}var ft=Lt,Ct=(function(){try{var t=nn(Object,"defineProperty");return t({},"",{}),t}catch(a){}})(),Xt=Ct,St=Xt?function(t,a){return Xt(t,"toString",{configurable:!0,enumerable:!1,value:ft(a),writable:!0})}:ir,Zt=St,G=st(Zt),gt=G;function oe(t,a){for(var c=-1,A=t==null?0:t.length;++c<A&&a(t[c],c,t)!==!1;);return t}var ae=oe;function fe(t,a,c,A){for(var V=t.length,J=c+(A?1:-1);A?J--:++J<V;)if(a(t[J],J,t))return J;return-1}var ne=fe;function ye(t){return t!==t}var Mt=ye;function $t(t,a,c){for(var A=c-1,V=t.length;++A<V;)if(t[A]===a)return A;return-1}var Jt=$t;function e(t,a,c){return a===a?Jt(t,a,c):ne(t,Mt,c)}var x=e;function C(t,a){var c=t==null?0:t.length;return!!c&&x(t,a,0)>-1}var S=C,Y=9007199254740991,D=/^(?:0|[1-9]\d*)$/;function At(t,a){var c=typeof t;return a=a!=null?a:Y,!!a&&(c=="number"||c!="symbol"&&D.test(t))&&t>-1&&t%1==0&&t<a}var U=At;function q(t,a,c){a=="__proto__"&&Xt?Xt(t,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):t[a]=c}var rt=q;function ct(t,a){return t===a||t!==t&&a!==a}var nt=ct,zt=Object.prototype,Ot=zt.hasOwnProperty;function Ft(t,a,c){var A=t[a];(!(Ot.call(t,a)&&nt(A,c))||c===void 0&&!(a in t))&&rt(t,a,c)}var Pt=Ft;function Wt(t,a,c,A){var V=!c;c||(c={});for(var J=-1,it=a.length;++J<it;){var _t=a[J],Vt=A?A(c[_t],t[_t],_t,c,t):void 0;Vt===void 0&&(Vt=t[_t]),V?rt(c,_t,Vt):Pt(c,_t,Vt)}return c}var Kt=Wt,Bt=Math.max;function ce(t,a,c){return a=Bt(a===void 0?t.length-1:a,0),function(){for(var A=arguments,V=-1,J=Bt(A.length-a,0),it=Array(J);++V<J;)it[V]=A[a+V];V=-1;for(var _t=Array(a+1);++V<a;)_t[V]=A[V];return _t[a]=c(it),B(t,this,_t)}}var kt=ce;function wt(t,a){return gt(kt(t,a,ir),t+"")}var jt=wt,Ht=9007199254740991;function qt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ht}var ee=qt;function Ut(t){return t!=null&&ee(t.length)&&!sa(t)}var ve=Ut;function we(t,a,c){if(!or(c))return!1;var A=typeof a;return(A=="number"?ve(c)&&U(a,c.length):A=="string"&&a in c)?nt(c[a],t):!1}var Se=we;function be(t){return jt(function(a,c){var A=-1,V=c.length,J=V>1?c[V-1]:void 0,it=V>2?c[2]:void 0;for(J=t.length>3&&typeof J=="function"?(V--,J):void 0,it&&Se(c[0],c[1],it)&&(J=V<3?void 0:J,V=1),a=Object(a);++A<V;){var _t=c[A];_t&&t(a,_t,A,J)}return a})}var Me=be,Fe=Object.prototype;function Ue(t){var a=t&&t.constructor,c=typeof a=="function"&&a.prototype||Fe;return t===c}var De=Ue;function Ye(t,a){for(var c=-1,A=Array(t);++c<t;)A[c]=a(c);return A}var Pe=Ye,de="[object Arguments]";function Ve(t){return O(t)&&_(t)==de}var Ne=Ve,nr=Object.prototype,Ge=nr.hasOwnProperty,Ie=nr.propertyIsEnumerable,Ce=Ne((function(){return arguments})())?Ne:function(t){return O(t)&&Ge.call(t,"callee")&&!Ie.call(t,"callee")},Ke=Ce;function We(){return!1}var le=We,Ae=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Le=Ae&&typeof module=="object"&&module&&!module.nodeType&&module,Re=Le&&Le.exports===Ae,Be=Re?h.Buffer:void 0,je=Be?Be.isBuffer:void 0,ie=je||le,fr=ie,Ar="[object Arguments]",Lr="[object Array]",Ze="[object Boolean]",dr="[object Date]",Xe="[object Error]",br="[object Function]",vr="[object Map]",gr="[object Number]",fa="[object Object]",Je="[object RegExp]",$e="[object Set]",Qr="[object String]",$r="[object WeakMap]",Ir="[object ArrayBuffer]",Cr="[object DataView]",Ea="[object Float32Array]",xa="[object Float64Array]",aa="[object Int8Array]",Gr="[object Int16Array]",ya="[object Int32Array]",Br="[object Uint8Array]",pa="[object Uint8ClampedArray]",i="[object Uint16Array]",m="[object Uint32Array]",k={};k[Ea]=k[xa]=k[aa]=k[Gr]=k[ya]=k[Br]=k[pa]=k[i]=k[m]=!0,k[Ar]=k[Lr]=k[Ir]=k[Ze]=k[Cr]=k[dr]=k[Xe]=k[br]=k[vr]=k[gr]=k[fa]=k[Je]=k[$e]=k[Qr]=k[$r]=!1;function R(t){return O(t)&&ee(t.length)&&!!k[_(t)]}var $=R;function et(t){return function(a){return t(a)}}var vt=et,Et=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yt=Et&&typeof module=="object"&&module&&!module.nodeType&&module,Gt=Yt&&Yt.exports===Et,he=Gt&&f.process,_e=(function(){try{var t=Yt&&Yt.require&&Yt.require("util").types;return t||he&&he.binding&&he.binding("util")}catch(a){}})(),He=_e,qe=He&&He.isTypedArray,Er=qe?vt(qe):$,Tr=Er,Vr=Object.prototype,Zr=Vr.hasOwnProperty;function ua(t,a){var c=Rt(t),A=!c&&Ke(t),V=!c&&!A&&fr(t),J=!c&&!A&&!V&&Tr(t),it=c||A||V||J,_t=it?Pe(t.length,String):[],Vt=_t.length;for(var se in t)(a||Zr.call(t,se))&&!(it&&(se=="length"||V&&(se=="offset"||se=="parent")||J&&(se=="buffer"||se=="byteLength"||se=="byteOffset")||U(se,Vt)))&&_t.push(se);return _t}var Aa=ua;function La(t,a){return function(c){return t(a(c))}}var Fa=La,$a=Fa(Object.keys,Object),_r=$a,wa=Object.prototype,mr=wa.hasOwnProperty;function tr(t){if(!De(t))return _r(t);var a=[];for(var c in Object(t))mr.call(t,c)&&c!="constructor"&&a.push(c);return a}var jr=tr;function va(t){return ve(t)?Aa(t):jr(t)}var na=va;function da(t){var a=[];if(t!=null)for(var c in Object(t))a.push(c);return a}var Ia=da,Ma=Object.prototype,ln=Ma.hasOwnProperty;function hn(t){if(!or(t))return Ia(t);var a=De(t),c=[];for(var A in t)A=="constructor"&&(a||!ln.call(t,A))||c.push(A);return c}var Ra=hn;function wn(t){return ve(t)?Aa(t,!0):Ra(t)}var tn=wn,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gn=/^\w*$/;function un(t,a){if(Rt(t))return!1;var c=typeof t;return c=="number"||c=="symbol"||c=="boolean"||t==null||W(t)?!0:gn.test(t)||!yn.test(t)||a!=null&&t in Object(a)}var za=un,bn=nn(Object,"create"),ja=bn;function vn(){this.__data__=ja?ja(null):{},this.size=0}var Pa=vn;function Ba(t){var a=this.has(t)&&delete this.__data__[t];return this.size-=a?1:0,a}var en=Ba,Da="__lodash_hash_undefined__",xn=Object.prototype,Va=xn.hasOwnProperty;function ea(t){var a=this.__data__;if(ja){var c=a[t];return c===Da?void 0:c}return Va.call(a,t)?a[t]:void 0}var ka=ea,_a=Object.prototype,ga=_a.hasOwnProperty;function Xa(t){var a=this.__data__;return ja?a[t]!==void 0:ga.call(a,t)}var rn=Xa,cn="__lodash_hash_undefined__";function ia(t,a){var c=this.__data__;return this.size+=this.has(t)?0:1,c[t]=ja&&a===void 0?cn:a,this}var Ga=ia;function ha(t){var a=-1,c=t==null?0:t.length;for(this.clear();++a<c;){var A=t[a];this.set(A[0],A[1])}}ha.prototype.clear=Pa,ha.prototype.delete=en,ha.prototype.get=ka,ha.prototype.has=rn,ha.prototype.set=Ga;var on=ha;function Ta(){this.__data__=[],this.size=0}var Ha=Ta;function qa(t,a){for(var c=t.length;c--;)if(nt(t[c][0],a))return c;return-1}var Za=qa,_n=Array.prototype,an=_n.splice;function Ka(t){var a=this.__data__,c=Za(a,t);if(c<0)return!1;var A=a.length-1;return c==A?a.pop():an.call(a,c,1),--this.size,!0}var En=Ka;function Dn(t){var a=this.__data__,c=Za(a,t);return c<0?void 0:a[c][1]}var Tn=Dn;function On(t){return Za(this.__data__,t)>-1}var Ji=On;function ci(t,a){var c=this.__data__,A=Za(c,t);return A<0?(++this.size,c.push([t,a])):c[A][1]=a,this}var Ci=ci;function Rn(t){var a=-1,c=t==null?0:t.length;for(this.clear();++a<c;){var A=t[a];this.set(A[0],A[1])}}Rn.prototype.clear=Ha,Rn.prototype.delete=En,Rn.prototype.get=Tn,Rn.prototype.has=Ji,Rn.prototype.set=Ci;var Qn=Rn,to=nn(h,"Map"),jn=to;function Ei(){this.size=0,this.__data__={hash:new on,map:new(jn||Qn),string:new on}}var fi=Ei;function Mi(t){var a=typeof t;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?t!=="__proto__":t===null}var eo=Mi;function Jn(t,a){var c=t.__data__;return eo(a)?c[typeof a=="string"?"string":"hash"]:c.map}var Pn=Jn;function ui(t){var a=Pn(this,t).delete(t);return this.size-=a?1:0,a}var _i=ui;function ro(t){return Pn(this,t).get(t)}var ao=ro;function Ti(t){return Pn(this,t).has(t)}var no=Ti;function io(t,a){var c=Pn(this,t),A=c.size;return c.set(t,a),this.size+=c.size==A?0:1,this}var Si=io;function zn(t){var a=-1,c=t==null?0:t.length;for(this.clear();++a<c;){var A=t[a];this.set(A[0],A[1])}}zn.prototype.clear=fi,zn.prototype.delete=_i,zn.prototype.get=ao,zn.prototype.has=no,zn.prototype.set=Si;var Yn=zn,vi="Expected a function";function ti(t,a){if(typeof t!="function"||a!=null&&typeof a!="function")throw new TypeError(vi);var c=function(){var A=arguments,V=a?a.apply(this,A):A[0],J=c.cache;if(J.has(V))return J.get(V);var it=t.apply(this,A);return c.cache=J.set(V,it)||J,it};return c.cache=new(ti.Cache||Yn),c}ti.Cache=Yn;var Ai=ti,Li=500;function Fi(t){var a=Ai(t,function(A){return c.size===Li&&c.clear(),A}),c=a.cache;return a}var Ni=Fi,Ii=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,di=/\\(\\)?/g,gh=Ni(function(t){var a=[];return t.charCodeAt(0)===46&&a.push(""),t.replace(Ii,function(c,A,V,J){a.push(V?J.replace(di,"$1"):A||c)}),a}),ph=gh;function mh(t){return t==null?"":ue(t)}var Es=mh;function yh(t,a){return Rt(t)?t:za(t,a)?[t]:ph(Es(t))}var Pi=yh,wh=1/0;function bh(t){if(typeof t=="string"||W(t))return t;var a=t+"";return a=="0"&&1/t==-wh?"-0":a}var gi=bh;function xh(t,a){a=Pi(a,t);for(var c=0,A=a.length;t!=null&&c<A;)t=t[gi(a[c++])];return c&&c==A?t:void 0}var Di=xh;function kh(t,a,c){var A=t==null?void 0:Di(t,a);return A===void 0?c:A}var Ch=kh;function Eh(t,a){for(var c=-1,A=a.length,V=t.length;++c<A;)t[V+c]=a[c];return t}var oo=Eh,Ms=n?n.isConcatSpreadable:void 0;function Mh(t){return Rt(t)||Ke(t)||!!(Ms&&t&&t[Ms])}var _h=Mh;function _s(t,a,c,A,V){var J=-1,it=t.length;for(c||(c=_h),V||(V=[]);++J<it;){var _t=t[J];a>0&&c(_t)?a>1?_s(_t,a-1,c,A,V):oo(V,_t):A||(V[V.length]=_t)}return V}var so=_s;function Th(t){var a=t==null?0:t.length;return a?so(t,1):[]}var ei=Th;function Sh(t){return gt(kt(t,void 0,ei),t+"")}var Ah=Sh,Lh=Fa(Object.getPrototypeOf,Object),lo=Lh,Fh="[object Object]",Nh=Function.prototype,Ih=Object.prototype,Ts=Nh.toString,Ph=Ih.hasOwnProperty,Dh=Ts.call(Object);function Oh(t){if(!O(t)||_(t)!=Fh)return!1;var a=lo(t);if(a===null)return!0;var c=Ph.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&Ts.call(c)==Dh}var Rh=Oh,zh="\\ud800-\\udfff",Bh="\\u0300-\\u036f",Hh="\\ufe20-\\ufe2f",Wh="\\u20d0-\\u20ff",Uh=Bh+Hh+Wh,Yh="\\ufe0e\\ufe0f",Vh="\\u200d",jh=RegExp("["+Vh+zh+Uh+Yh+"]");function Xh(t){return jh.test(t)}var qh=Xh;function $h(t,a,c,A){var V=-1,J=t==null?0:t.length;for(A&&J&&(c=t[++V]);++V<J;)c=a(c,t[V],V,t);return c}var Gh=$h;function Zh(){this.__data__=new Qn,this.size=0}var Kh=Zh;function Qh(t){var a=this.__data__,c=a.delete(t);return this.size=a.size,c}var Jh=Qh;function tc(t){return this.__data__.get(t)}var ec=tc;function rc(t){return this.__data__.has(t)}var ac=rc,nc=200;function ic(t,a){var c=this.__data__;if(c instanceof Qn){var A=c.__data__;if(!jn||A.length<nc-1)return A.push([t,a]),this.size=++c.size,this;c=this.__data__=new Yn(A)}return c.set(t,a),this.size=c.size,this}var oc=ic;function ri(t){var a=this.__data__=new Qn(t);this.size=a.size}ri.prototype.clear=Kh,ri.prototype.delete=Jh,ri.prototype.get=ec,ri.prototype.has=ac,ri.prototype.set=oc;var ai=ri;function sc(t,a){return t&&Kt(a,na(a),t)}var lc=sc;function hc(t,a){return t&&Kt(a,tn(a),t)}var cc=hc,Ss=typeof exports=="object"&&exports&&!exports.nodeType&&exports,As=Ss&&typeof module=="object"&&module&&!module.nodeType&&module,fc=As&&As.exports===Ss,Ls=fc?h.Buffer:void 0,Fs=Ls?Ls.allocUnsafe:void 0;function uc(t,a){if(a)return t.slice();var c=t.length,A=Fs?Fs(c):new t.constructor(c);return t.copy(A),A}var Ns=uc;function vc(t,a){for(var c=-1,A=t==null?0:t.length,V=0,J=[];++c<A;){var it=t[c];a(it,c,t)&&(J[V++]=it)}return J}var Is=vc;function dc(){return[]}var Ps=dc,gc=Object.prototype,pc=gc.propertyIsEnumerable,Ds=Object.getOwnPropertySymbols,mc=Ds?function(t){return t==null?[]:(t=Object(t),Is(Ds(t),function(a){return pc.call(t,a)}))}:Ps,ho=mc;function yc(t,a){return Kt(t,ho(t),a)}var wc=yc,bc=Object.getOwnPropertySymbols,xc=bc?function(t){for(var a=[];t;)oo(a,ho(t)),t=lo(t);return a}:Ps,Os=xc;function kc(t,a){return Kt(t,Os(t),a)}var Cc=kc;function Ec(t,a,c){var A=a(t);return Rt(t)?A:oo(A,c(t))}var Rs=Ec;function Mc(t){return Rs(t,na,ho)}var co=Mc;function _c(t){return Rs(t,tn,Os)}var Tc=_c,Sc=nn(h,"DataView"),fo=Sc,Ac=nn(h,"Promise"),uo=Ac,Lc=nn(h,"Set"),ni=Lc,zs="[object Map]",Fc="[object Object]",Bs="[object Promise]",Hs="[object Set]",Ws="[object WeakMap]",Us="[object DataView]",Nc=ca(fo),Ic=ca(jn),Pc=ca(uo),Dc=ca(ni),Oc=ca(dn),Xn=_;(fo&&Xn(new fo(new ArrayBuffer(1)))!=Us||jn&&Xn(new jn)!=zs||uo&&Xn(uo.resolve())!=Bs||ni&&Xn(new ni)!=Hs||dn&&Xn(new dn)!=Ws)&&(Xn=function(t){var a=_(t),c=a==Fc?t.constructor:void 0,A=c?ca(c):"";if(A)switch(A){case Nc:return Us;case Ic:return zs;case Pc:return Bs;case Dc:return Hs;case Oc:return Ws}return a});var qn=Xn,Rc=Object.prototype,zc=Rc.hasOwnProperty;function Bc(t){var a=t.length,c=new t.constructor(a);return a&&typeof t[0]=="string"&&zc.call(t,"index")&&(c.index=t.index,c.input=t.input),c}var Hc=Bc,Wc=h.Uint8Array,Oi=Wc;function Uc(t){var a=new t.constructor(t.byteLength);return new Oi(a).set(new Oi(t)),a}var vo=Uc;function Yc(t,a){var c=a?vo(t.buffer):t.buffer;return new t.constructor(c,t.byteOffset,t.byteLength)}var Vc=Yc,jc=/\w*$/;function Xc(t){var a=new t.constructor(t.source,jc.exec(t));return a.lastIndex=t.lastIndex,a}var qc=Xc,Ys=n?n.prototype:void 0,Vs=Ys?Ys.valueOf:void 0;function $c(t){return Vs?Object(Vs.call(t)):{}}var Gc=$c;function Zc(t,a){var c=a?vo(t.buffer):t.buffer;return new t.constructor(c,t.byteOffset,t.length)}var js=Zc,Kc="[object Boolean]",Qc="[object Date]",Jc="[object Map]",tf="[object Number]",ef="[object RegExp]",rf="[object Set]",af="[object String]",nf="[object Symbol]",of="[object ArrayBuffer]",sf="[object DataView]",lf="[object Float32Array]",hf="[object Float64Array]",cf="[object Int8Array]",ff="[object Int16Array]",uf="[object Int32Array]",vf="[object Uint8Array]",df="[object Uint8ClampedArray]",gf="[object Uint16Array]",pf="[object Uint32Array]";function mf(t,a,c){var A=t.constructor;switch(a){case of:return vo(t);case Kc:case Qc:return new A(+t);case sf:return Vc(t,c);case lf:case hf:case cf:case ff:case uf:case vf:case df:case gf:case pf:return js(t,c);case Jc:return new A;case tf:case af:return new A(t);case ef:return qc(t);case rf:return new A;case nf:return Gc(t)}}var yf=mf;function wf(t){return typeof t.constructor=="function"&&!De(t)?g(lo(t)):{}}var Xs=wf,bf="[object Map]";function xf(t){return O(t)&&qn(t)==bf}var kf=xf,qs=He&&He.isMap,Cf=qs?vt(qs):kf,Ef=Cf,Mf="[object Set]";function _f(t){return O(t)&&qn(t)==Mf}var Tf=_f,$s=He&&He.isSet,Sf=$s?vt($s):Tf,Af=Sf,Lf=1,Ff=2,Nf=4,Gs="[object Arguments]",If="[object Array]",Pf="[object Boolean]",Df="[object Date]",Of="[object Error]",Zs="[object Function]",Rf="[object GeneratorFunction]",zf="[object Map]",Bf="[object Number]",Ks="[object Object]",Hf="[object RegExp]",Wf="[object Set]",Uf="[object String]",Yf="[object Symbol]",Vf="[object WeakMap]",jf="[object ArrayBuffer]",Xf="[object DataView]",qf="[object Float32Array]",$f="[object Float64Array]",Gf="[object Int8Array]",Zf="[object Int16Array]",Kf="[object Int32Array]",Qf="[object Uint8Array]",Jf="[object Uint8ClampedArray]",t0="[object Uint16Array]",e0="[object Uint32Array]",Wa={};Wa[Gs]=Wa[If]=Wa[jf]=Wa[Xf]=Wa[Pf]=Wa[Df]=Wa[qf]=Wa[$f]=Wa[Gf]=Wa[Zf]=Wa[Kf]=Wa[zf]=Wa[Bf]=Wa[Ks]=Wa[Hf]=Wa[Wf]=Wa[Uf]=Wa[Yf]=Wa[Qf]=Wa[Jf]=Wa[t0]=Wa[e0]=!0,Wa[Of]=Wa[Zs]=Wa[Vf]=!1;function Ri(t,a,c,A,V,J){var it,_t=a&Lf,Vt=a&Ff,se=a&Nf;if(c&&(it=V?c(t,A,V,J):c(t)),it!==void 0)return it;if(!or(t))return t;var ge=Rt(t);if(ge){if(it=Hc(t),!_t)return ut(t,it)}else{var Oe=qn(t),hr=Oe==Zs||Oe==Rf;if(fr(t))return Ns(t,_t);if(Oe==Ks||Oe==Gs||hr&&!V){if(it=Vt||hr?{}:Xs(t),!_t)return Vt?Cc(t,cc(it,t)):wc(t,lc(it,t))}else{if(!Wa[Oe])return V?t:{};it=yf(t,Oe,_t)}}J||(J=new ai);var Hr=J.get(t);if(Hr)return Hr;J.set(t,it),Af(t)?t.forEach(function(Qa){it.add(Ri(Qa,a,c,Qa,t,J))}):Ef(t)&&t.forEach(function(Qa,mn){it.set(mn,Ri(Qa,a,c,mn,t,J))});var Or=se?Vt?Tc:co:Vt?tn:na,Ca=ge?void 0:Or(t);return ae(Ca||t,function(Qa,mn){Ca&&(mn=Qa,Qa=t[mn]),Pt(it,mn,Ri(Qa,a,c,mn,t,J))}),it}var r0=Ri,a0=1,n0=4;function i0(t){return r0(t,a0|n0)}var o0=i0,s0="__lodash_hash_undefined__";function l0(t){return this.__data__.set(t,s0),this}var h0=l0;function c0(t){return this.__data__.has(t)}var f0=c0;function zi(t){var a=-1,c=t==null?0:t.length;for(this.__data__=new Yn;++a<c;)this.add(t[a])}zi.prototype.add=zi.prototype.push=h0,zi.prototype.has=f0;var Qs=zi;function u0(t,a){for(var c=-1,A=t==null?0:t.length;++c<A;)if(a(t[c],c,t))return!0;return!1}var v0=u0;function d0(t,a){return t.has(a)}var Js=d0,g0=1,p0=2;function m0(t,a,c,A,V,J){var it=c&g0,_t=t.length,Vt=a.length;if(_t!=Vt&&!(it&&Vt>_t))return!1;var se=J.get(t),ge=J.get(a);if(se&&ge)return se==a&&ge==t;var Oe=-1,hr=!0,Hr=c&p0?new Qs:void 0;for(J.set(t,a),J.set(a,t);++Oe<_t;){var Or=t[Oe],Ca=a[Oe];if(A)var Qa=it?A(Ca,Or,Oe,a,t,J):A(Or,Ca,Oe,t,a,J);if(Qa!==void 0){if(Qa)continue;hr=!1;break}if(Hr){if(!v0(a,function(mn,Kn){if(!Js(Hr,Kn)&&(Or===mn||V(Or,mn,c,A,J)))return Hr.push(Kn)})){hr=!1;break}}else if(!(Or===Ca||V(Or,Ca,c,A,J))){hr=!1;break}}return J.delete(t),J.delete(a),hr}var tl=m0;function y0(t){var a=-1,c=Array(t.size);return t.forEach(function(A,V){c[++a]=[V,A]}),c}var w0=y0;function b0(t){var a=-1,c=Array(t.size);return t.forEach(function(A){c[++a]=A}),c}var go=b0,x0=1,k0=2,C0="[object Boolean]",E0="[object Date]",M0="[object Error]",_0="[object Map]",T0="[object Number]",S0="[object RegExp]",A0="[object Set]",L0="[object String]",F0="[object Symbol]",N0="[object ArrayBuffer]",I0="[object DataView]",el=n?n.prototype:void 0,po=el?el.valueOf:void 0;function P0(t,a,c,A,V,J,it){switch(c){case I0:if(t.byteLength!=a.byteLength||t.byteOffset!=a.byteOffset)return!1;t=t.buffer,a=a.buffer;case N0:return!(t.byteLength!=a.byteLength||!J(new Oi(t),new Oi(a)));case C0:case E0:case T0:return nt(+t,+a);case M0:return t.name==a.name&&t.message==a.message;case S0:case L0:return t==a+"";case _0:var _t=w0;case A0:var Vt=A&x0;if(_t||(_t=go),t.size!=a.size&&!Vt)return!1;var se=it.get(t);if(se)return se==a;A|=k0,it.set(t,a);var ge=tl(_t(t),_t(a),A,V,J,it);return it.delete(t),ge;case F0:if(po)return po.call(t)==po.call(a)}return!1}var D0=P0,O0=1,R0=Object.prototype,z0=R0.hasOwnProperty;function B0(t,a,c,A,V,J){var it=c&O0,_t=co(t),Vt=_t.length,se=co(a),ge=se.length;if(Vt!=ge&&!it)return!1;for(var Oe=Vt;Oe--;){var hr=_t[Oe];if(!(it?hr in a:z0.call(a,hr)))return!1}var Hr=J.get(t),Or=J.get(a);if(Hr&&Or)return Hr==a&&Or==t;var Ca=!0;J.set(t,a),J.set(a,t);for(var Qa=it;++Oe<Vt;){hr=_t[Oe];var mn=t[hr],Kn=a[hr];if(A)var th=it?A(Kn,mn,hr,a,t,J):A(mn,Kn,hr,t,a,J);if(!(th===void 0?mn===Kn||V(mn,Kn,c,A,J):th)){Ca=!1;break}Qa||(Qa=hr=="constructor")}if(Ca&&!Qa){var Xi=t.constructor,qi=a.constructor;Xi!=qi&&"constructor"in t&&"constructor"in a&&!(typeof Xi=="function"&&Xi instanceof Xi&&typeof qi=="function"&&qi instanceof qi)&&(Ca=!1)}return J.delete(t),J.delete(a),Ca}var H0=B0,W0=1,rl="[object Arguments]",al="[object Array]",Bi="[object Object]",U0=Object.prototype,nl=U0.hasOwnProperty;function Y0(t,a,c,A,V,J){var it=Rt(t),_t=Rt(a),Vt=it?al:qn(t),se=_t?al:qn(a);Vt=Vt==rl?Bi:Vt,se=se==rl?Bi:se;var ge=Vt==Bi,Oe=se==Bi,hr=Vt==se;if(hr&&fr(t)){if(!fr(a))return!1;it=!0,ge=!1}if(hr&&!ge)return J||(J=new ai),it||Tr(t)?tl(t,a,c,A,V,J):D0(t,a,Vt,c,A,V,J);if(!(c&W0)){var Hr=ge&&nl.call(t,"__wrapped__"),Or=Oe&&nl.call(a,"__wrapped__");if(Hr||Or){var Ca=Hr?t.value():t,Qa=Or?a.value():a;return J||(J=new ai),V(Ca,Qa,c,A,J)}}return hr?(J||(J=new ai),H0(t,a,c,A,V,J)):!1}var V0=Y0;function il(t,a,c,A,V){return t===a?!0:t==null||a==null||!O(t)&&!O(a)?t!==t&&a!==a:V0(t,a,c,A,il,V)}var ol=il,j0=1,X0=2;function q0(t,a,c,A){var V=c.length,J=V,it=!A;if(t==null)return!J;for(t=Object(t);V--;){var _t=c[V];if(it&&_t[2]?_t[1]!==t[_t[0]]:!(_t[0]in t))return!1}for(;++V<J;){_t=c[V];var Vt=_t[0],se=t[Vt],ge=_t[1];if(it&&_t[2]){if(se===void 0&&!(Vt in t))return!1}else{var Oe=new ai;if(A)var hr=A(se,ge,Vt,t,a,Oe);if(!(hr===void 0?ol(ge,se,j0|X0,A,Oe):hr))return!1}}return!0}var $0=q0;function G0(t){return t===t&&!or(t)}var sl=G0;function Z0(t){for(var a=na(t),c=a.length;c--;){var A=a[c],V=t[A];a[c]=[A,V,sl(V)]}return a}var K0=Z0;function Q0(t,a){return function(c){return c==null?!1:c[t]===a&&(a!==void 0||t in Object(c))}}var ll=Q0;function J0(t){var a=K0(t);return a.length==1&&a[0][2]?ll(a[0][0],a[0][1]):function(c){return c===t||$0(c,t,a)}}var t1=J0;function e1(t,a){return t!=null&&a in Object(t)}var r1=e1;function a1(t,a,c){a=Pi(a,t);for(var A=-1,V=a.length,J=!1;++A<V;){var it=gi(a[A]);if(!(J=t!=null&&c(t,it)))break;t=t[it]}return J||++A!=V?J:(V=t==null?0:t.length,!!V&&ee(V)&&U(it,V)&&(Rt(t)||Ke(t)))}var hl=a1;function n1(t,a){return t!=null&&hl(t,a,r1)}var cl=n1,i1=1,o1=2;function s1(t,a){return za(t)&&sl(a)?ll(gi(t),a):function(c){var A=Ch(c,t);return A===void 0&&A===a?cl(c,t):ol(a,A,i1|o1)}}var l1=s1;function h1(t){return function(a){return a==null?void 0:a[t]}}var fl=h1;function c1(t){return function(a){return Di(a,t)}}var f1=c1;function u1(t){return za(t)?fl(gi(t)):f1(t)}var v1=u1;function d1(t){return typeof t=="function"?t:t==null?ir:typeof t=="object"?Rt(t)?l1(t[0],t[1]):t1(t):v1(t)}var Vn=d1;function g1(t){return function(a,c,A){for(var V=-1,J=Object(a),it=A(a),_t=it.length;_t--;){var Vt=it[t?_t:++V];if(c(J[Vt],Vt,J)===!1)break}return a}}var p1=g1,m1=p1(),mo=m1;function y1(t,a){return t&&mo(t,a,na)}var yo=y1;function w1(t,a){return function(c,A){if(c==null)return c;if(!ve(c))return t(c,A);for(var V=c.length,J=a?V:-1,it=Object(c);(a?J--:++J<V)&&A(it[J],J,it)!==!1;);return c}}var b1=w1,x1=b1(yo),Hi=x1,k1=function(){return h.Date.now()},ul=k1,vl=Object.prototype,C1=vl.hasOwnProperty,E1=jt(function(t,a){t=Object(t);var c=-1,A=a.length,V=A>2?a[2]:void 0;for(V&&Se(a[0],a[1],V)&&(A=1);++c<A;)for(var J=a[c],it=tn(J),_t=-1,Vt=it.length;++_t<Vt;){var se=it[_t],ge=t[se];(ge===void 0||nt(ge,vl[se])&&!C1.call(t,se))&&(t[se]=J[se])}return t}),M1=E1;function _1(t,a,c){(c!==void 0&&!nt(t[a],c)||c===void 0&&!(a in t))&&rt(t,a,c)}var wo=_1;function T1(t){return O(t)&&ve(t)}var dl=T1;function S1(t,a){if(!(a==="constructor"&&typeof t[a]=="function")&&a!="__proto__")return t[a]}var bo=S1;function A1(t){return Kt(t,tn(t))}var L1=A1;function F1(t,a,c,A,V,J,it){var _t=bo(t,c),Vt=bo(a,c),se=it.get(Vt);if(se){wo(t,c,se);return}var ge=J?J(_t,Vt,c+"",t,a,it):void 0,Oe=ge===void 0;if(Oe){var hr=Rt(Vt),Hr=!hr&&fr(Vt),Or=!hr&&!Hr&&Tr(Vt);ge=Vt,hr||Hr||Or?Rt(_t)?ge=_t:dl(_t)?ge=ut(_t):Hr?(Oe=!1,ge=Ns(Vt,!0)):Or?(Oe=!1,ge=js(Vt,!0)):ge=[]:Rh(Vt)||Ke(Vt)?(ge=_t,Ke(_t)?ge=L1(_t):(!or(_t)||sa(_t))&&(ge=Xs(Vt))):Oe=!1}Oe&&(it.set(Vt,ge),V(ge,Vt,A,J,it),it.delete(Vt)),wo(t,c,ge)}var N1=F1;function gl(t,a,c,A,V){t!==a&&mo(a,function(J,it){if(V||(V=new ai),or(J))N1(t,a,it,c,gl,A,V);else{var _t=A?A(bo(t,it),J,it+"",t,a,V):void 0;_t===void 0&&(_t=J),wo(t,it,_t)}},tn)}var I1=gl;function P1(t,a,c){for(var A=-1,V=t==null?0:t.length;++A<V;)if(c(a,t[A]))return!0;return!1}var D1=P1;function O1(t){var a=t==null?0:t.length;return a?t[a-1]:void 0}var Wi=O1;function R1(t){return typeof t=="function"?t:ir}var xo=R1;function z1(t,a){var c=Rt(t)?ae:Hi;return c(t,xo(a))}var Te=z1;function B1(t,a){var c=[];return Hi(t,function(A,V,J){a(A,V,J)&&c.push(A)}),c}var H1=B1;function W1(t,a){var c=Rt(t)?Is:H1;return c(t,Vn(a,3))}var Bn=W1;function U1(t){return function(a,c,A){var V=Object(a);if(!ve(a)){var J=Vn(c,3);a=na(a),c=function(_t){return J(V[_t],_t,V)}}var it=t(a,c,A);return it>-1?V[J?a[it]:it]:void 0}}var Y1=U1,V1=Math.max;function j1(t,a,c){var A=t==null?0:t.length;if(!A)return-1;var V=c==null?0:ze(c);return V<0&&(V=V1(A+V,0)),ne(t,Vn(a,3),V)}var X1=j1,q1=Y1(X1),ko=q1;function $1(t,a){var c=-1,A=ve(t)?Array(t.length):[];return Hi(t,function(V,J,it){A[++c]=a(V,J,it)}),A}var pl=$1;function G1(t,a){var c=Rt(t)?mt:pl;return c(t,Vn(a,3))}var pn=G1;function Z1(t,a){return t==null?t:mo(t,xo(a),tn)}var K1=Z1;function Q1(t,a){return t&&yo(t,xo(a))}var J1=Q1;function tu(t,a){return t>a}var eu=tu,ru=Object.prototype,au=ru.hasOwnProperty;function nu(t,a){return t!=null&&au.call(t,a)}var iu=nu;function ou(t,a){return t!=null&&hl(t,a,iu)}var ml=ou,su="[object String]";function lu(t){return typeof t=="string"||!Rt(t)&&O(t)&&_(t)==su}var hu=lu;function cu(t,a){return mt(a,function(c){return t[c]})}var fu=cu;function uu(t){return t==null?[]:fu(t,na(t))}var Hn=uu,vu="[object Map]",du="[object Set]",gu=Object.prototype,pu=gu.hasOwnProperty;function mu(t){if(t==null)return!0;if(ve(t)&&(Rt(t)||typeof t=="string"||typeof t.splice=="function"||fr(t)||Tr(t)||Ke(t)))return!t.length;var a=qn(t);if(a==vu||a==du)return!t.size;if(De(t))return!jr(t).length;for(var c in t)if(pu.call(t,c))return!1;return!0}var yl=mu;function yu(t){return t===void 0}var kn=yu;function wu(t,a){return t<a}var wl=wu;function bu(t,a){var c={};return a=Vn(a,3),yo(t,function(A,V,J){rt(c,V,a(A,V,J))}),c}var Ui=bu;function xu(t,a,c){for(var A=-1,V=t.length;++A<V;){var J=t[A],it=a(J);if(it!=null&&(_t===void 0?it===it&&!W(it):c(it,_t)))var _t=it,Vt=J}return Vt}var Co=xu;function ku(t){return t&&t.length?Co(t,ir,eu):void 0}var $n=ku,Cu=Me(function(t,a,c){I1(t,a,c)}),Eo=Cu;function Eu(t){return t&&t.length?Co(t,ir,wl):void 0}var pi=Eu;function Mu(t,a){return t&&t.length?Co(t,Vn(a,2),wl):void 0}var Mo=Mu;function _u(t,a,c,A){if(!or(t))return t;a=Pi(a,t);for(var V=-1,J=a.length,it=J-1,_t=t;_t!=null&&++V<J;){var Vt=gi(a[V]),se=c;if(Vt==="__proto__"||Vt==="constructor"||Vt==="prototype")return t;if(V!=it){var ge=_t[Vt];se=A?A(ge,Vt,_t):void 0,se===void 0&&(se=or(ge)?ge:U(a[V+1])?[]:{})}Pt(_t,Vt,se),_t=_t[Vt]}return t}var Tu=_u;function Su(t,a,c){for(var A=-1,V=a.length,J={};++A<V;){var it=a[A],_t=Di(t,it);c(_t,it)&&Tu(J,Pi(it,t),_t)}return J}var Au=Su;function Lu(t,a){var c=t.length;for(t.sort(a);c--;)t[c]=t[c].value;return t}var Fu=Lu;function Nu(t,a){if(t!==a){var c=t!==void 0,A=t===null,V=t===t,J=W(t),it=a!==void 0,_t=a===null,Vt=a===a,se=W(a);if(!_t&&!se&&!J&&t>a||J&&it&&Vt&&!_t&&!se||A&&it&&Vt||!c&&Vt||!V)return 1;if(!A&&!J&&!se&&t<a||se&&c&&V&&!A&&!J||_t&&c&&V||!it&&V||!Vt)return-1}return 0}var Iu=Nu;function Pu(t,a,c){for(var A=-1,V=t.criteria,J=a.criteria,it=V.length,_t=c.length;++A<it;){var Vt=Iu(V[A],J[A]);if(Vt){if(A>=_t)return Vt;var se=c[A];return Vt*(se=="desc"?-1:1)}}return t.index-a.index}var Du=Pu;function Ou(t,a,c){a.length?a=mt(a,function(J){return Rt(J)?function(it){return Di(it,J.length===1?J[0]:J)}:J}):a=[ir];var A=-1;a=mt(a,vt(Vn));var V=pl(t,function(J,it,_t){var Vt=mt(a,function(se){return se(J)});return{criteria:Vt,index:++A,value:J}});return Fu(V,function(J,it){return Du(J,it,c)})}var Ru=Ou,zu=fl("length"),Bu=zu,bl="\\ud800-\\udfff",Hu="\\u0300-\\u036f",Wu="\\ufe20-\\ufe2f",Uu="\\u20d0-\\u20ff",Yu=Hu+Wu+Uu,Vu="\\ufe0e\\ufe0f",ju="["+bl+"]",_o="["+Yu+"]",To="\\ud83c[\\udffb-\\udfff]",Xu="(?:"+_o+"|"+To+")",xl="[^"+bl+"]",kl="(?:\\ud83c[\\udde6-\\uddff]){2}",Cl="[\\ud800-\\udbff][\\udc00-\\udfff]",qu="\\u200d",El=Xu+"?",Ml="["+Vu+"]?",$u="(?:"+qu+"(?:"+[xl,kl,Cl].join("|")+")"+Ml+El+")*",Gu=Ml+El+$u,Zu="(?:"+[xl+_o+"?",_o,kl,Cl,ju].join("|")+")",_l=RegExp(To+"(?="+To+")|"+Zu+Gu,"g");function Ku(t){for(var a=_l.lastIndex=0;_l.test(t);)++a;return a}var Qu=Ku;function Ju(t){return qh(t)?Qu(t):Bu(t)}var tv=Ju;function ev(t,a){return Au(t,a,function(c,A){return cl(t,A)})}var rv=ev,av=Ah(function(t,a){return t==null?{}:rv(t,a)}),Yi=av,nv=Math.ceil,iv=Math.max;function ov(t,a,c,A){for(var V=-1,J=iv(nv((a-t)/(c||1)),0),it=Array(J);J--;)it[A?J:++V]=t,t+=c;return it}var sv=ov;function lv(t){return function(a,c,A){return A&&typeof A!="number"&&Se(a,c,A)&&(c=A=void 0),a=Yr(a),c===void 0?(c=a,a=0):c=Yr(c),A=A===void 0?a<c?1:-1:Yr(A),sv(a,c,A,t)}}var hv=lv,cv=hv(),ii=cv;function fv(t,a,c,A,V){return V(t,function(J,it,_t){c=A?(A=!1,J):a(c,J,it,_t)}),c}var uv=fv;function vv(t,a,c){var A=Rt(t)?Gh:uv,V=arguments.length<3;return A(t,Vn(a,4),c,V,Hi)}var mi=vv,dv="[object Map]",gv="[object Set]";function pv(t){if(t==null)return 0;if(ve(t))return hu(t)?tv(t):t.length;var a=qn(t);return a==dv||a==gv?t.size:jr(t).length}var mv=pv,yv=jt(function(t,a){if(t==null)return[];var c=a.length;return c>1&&Se(t,a[0],a[1])?a=[]:c>2&&Se(a[0],a[1],a[2])&&(a=[a[0]]),Ru(t,so(a,1),[])}),yi=yv,wv=1/0,bv=ni&&1/go(new ni([,-0]))[1]==wv?function(t){return new ni(t)}:H,xv=bv,kv=200;function Cv(t,a,c){var A=-1,V=S,J=t.length,it=!0,_t=[],Vt=_t;if(c)it=!1,V=D1;else if(J>=kv){var se=a?null:xv(t);if(se)return go(se);it=!1,V=Js,Vt=new Qs}else Vt=a?[]:_t;t:for(;++A<J;){var ge=t[A],Oe=a?a(ge):ge;if(ge=c||ge!==0?ge:0,it&&Oe===Oe){for(var hr=Vt.length;hr--;)if(Vt[hr]===Oe)continue t;a&&Vt.push(Oe),_t.push(ge)}else V(Vt,Oe,c)||(Vt!==_t&&Vt.push(Oe),_t.push(ge))}return _t}var Ev=Cv,Mv=jt(function(t){return Ev(so(t,1,dl,!0))}),_v=Mv,Tv=0;function Sv(t){var a=++Tv;return Es(t)+a}var So=Sv;function Av(t,a,c){for(var A=-1,V=t.length,J=a.length,it={};++A<V;){var _t=A<J?a[A]:void 0;c(it,t[A],_t)}return it}var Lv=Av;function Fv(t,a){return Lv(t||[],a||[],Pt)}var Nv=Fv,Iv="\0",Gn="\0",Tl="",Nn=class{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=ft(void 0),this._defaultEdgeLabelFn=ft(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Gn]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return sa(t)||(t=ft(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return na(this._nodes)}sources(){var t=this;return Bn(this.nodes(),function(a){return yl(t._in[a])})}sinks(){var t=this;return Bn(this.nodes(),function(a){return yl(t._out[a])})}setNodes(t,a){var c=arguments,A=this;return Te(t,function(V){c.length>1?A.setNode(V,a):A.setNode(V)}),this}setNode(t,a){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=a),this):(this._nodes[t]=arguments.length>1?a:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Gn,this._children[t]={},this._children[Gn][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var a=c=>this.removeEdge(this._edgeObjs[c]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],Te(this.children(t),c=>{this.setParent(c)}),delete this._children[t]),Te(na(this._in[t]),a),delete this._in[t],delete this._preds[t],Te(na(this._out[t]),a),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,a){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(kn(a))a=Gn;else{a+="";for(var c=a;!kn(c);c=this.parent(c))if(c===t)throw new Error("Setting "+a+" as parent of "+t+" would create a cycle");this.setNode(a)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=a,this._children[a][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var a=this._parent[t];if(a!==Gn)return a}}children(t){if(kn(t)&&(t=Gn),this._isCompound){var a=this._children[t];if(a)return na(a)}else{if(t===Gn)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var a=this._preds[t];if(a)return na(a)}successors(t){var a=this._sucs[t];if(a)return na(a)}neighbors(t){var a=this.predecessors(t);if(a)return _v(a,this.successors(t))}isLeaf(t){var a;return this.isDirected()?a=this.successors(t):a=this.neighbors(t),a.length===0}filterNodes(t){var a=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});a.setGraph(this.graph());var c=this;Te(this._nodes,function(J,it){t(it)&&a.setNode(it,J)}),Te(this._edgeObjs,function(J){a.hasNode(J.v)&&a.hasNode(J.w)&&a.setEdge(J,c.edge(J))});var A={};function V(J){var it=c.parent(J);return it===void 0||a.hasNode(it)?(A[J]=it,it):it in A?A[it]:V(it)}return this._isCompound&&Te(a.nodes(),function(J){a.setParent(J,V(J))}),a}setDefaultEdgeLabel(t){return sa(t)||(t=ft(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Hn(this._edgeObjs)}setPath(t,a){var c=this,A=arguments;return mi(t,function(V,J){return A.length>1?c.setEdge(V,J,a):c.setEdge(V,J),J}),this}setEdge(){var t,a,c,A,V=!1,J=arguments[0];typeof J=="object"&&J!==null&&"v"in J?(t=J.v,a=J.w,c=J.name,arguments.length===2&&(A=arguments[1],V=!0)):(t=J,a=arguments[1],c=arguments[3],arguments.length>2&&(A=arguments[2],V=!0)),t=""+t,a=""+a,kn(c)||(c=""+c);var it=wi(this._isDirected,t,a,c);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,it))return V&&(this._edgeLabels[it]=A),this;if(!kn(c)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(a),this._edgeLabels[it]=V?A:this._defaultEdgeLabelFn(t,a,c);var _t=Pv(this._isDirected,t,a,c);return t=_t.v,a=_t.w,Object.freeze(_t),this._edgeObjs[it]=_t,Sl(this._preds[a],t),Sl(this._sucs[t],a),this._in[a][it]=_t,this._out[t][it]=_t,this._edgeCount++,this}edge(t,a,c){var A=arguments.length===1?Ao(this._isDirected,arguments[0]):wi(this._isDirected,t,a,c);return this._edgeLabels[A]}hasEdge(t,a,c){var A=arguments.length===1?Ao(this._isDirected,arguments[0]):wi(this._isDirected,t,a,c);return Object.prototype.hasOwnProperty.call(this._edgeLabels,A)}removeEdge(t,a,c){var A=arguments.length===1?Ao(this._isDirected,arguments[0]):wi(this._isDirected,t,a,c),V=this._edgeObjs[A];return V&&(t=V.v,a=V.w,delete this._edgeLabels[A],delete this._edgeObjs[A],Al(this._preds[a],t),Al(this._sucs[t],a),delete this._in[a][A],delete this._out[t][A],this._edgeCount--),this}inEdges(t,a){var c=this._in[t];if(c){var A=Hn(c);return a?Bn(A,function(V){return V.v===a}):A}}outEdges(t,a){var c=this._out[t];if(c){var A=Hn(c);return a?Bn(A,function(V){return V.w===a}):A}}nodeEdges(t,a){var c=this.inEdges(t,a);if(c)return c.concat(this.outEdges(t,a))}};Nn.prototype._nodeCount=0,Nn.prototype._edgeCount=0;function Sl(t,a){t[a]?t[a]++:t[a]=1}function Al(t,a){--t[a]||delete t[a]}function wi(t,a,c,A){var V=""+a,J=""+c;if(!t&&V>J){var it=V;V=J,J=it}return V+Tl+J+Tl+(kn(A)?Iv:A)}function Pv(t,a,c,A){var V=""+a,J=""+c;if(!t&&V>J){var it=V;V=J,J=it}var _t={v:V,w:J};return A&&(_t.name=A),_t}function Ao(t,a){return wi(t,a.v,a.w,a.name)}var Dv="2.1.9-pre";function oi(t,a,c,A){var V;do V=So(A);while(t.hasNode(V));return c.dummy=a,t.setNode(V,c),V}function Ov(t){var a=new Nn().setGraph(t.graph());return Te(t.nodes(),function(c){a.setNode(c,t.node(c))}),Te(t.edges(),function(c){var A=a.edge(c.v,c.w)||{weight:0,minlen:1},V=t.edge(c);a.setEdge(c.v,c.w,{weight:A.weight+V.weight,minlen:Math.max(A.minlen,V.minlen)})}),a}function Ll(t){var a=new Nn({multigraph:t.isMultigraph()}).setGraph(t.graph());return Te(t.nodes(),function(c){t.children(c).length||a.setNode(c,t.node(c))}),Te(t.edges(),function(c){a.setEdge(c,t.edge(c))}),a}function Fl(t,a){var c=t.x,A=t.y,V=a.x-c,J=a.y-A,it=t.width/2,_t=t.height/2;if(!V&&!J)throw new Error("Not possible to find intersection inside of the rectangle");var Vt,se;return Math.abs(J)*it>Math.abs(V)*_t?(J<0&&(_t=-_t),Vt=_t*V/J,se=_t):(V<0&&(it=-it),Vt=it,se=it*J/V),{x:c+Vt,y:A+se}}function Vi(t){var a=pn(ii(Il(t)+1),function(){return[]});return Te(t.nodes(),function(c){var A=t.node(c),V=A.rank;kn(V)||(a[V][A.order]=c)}),a}function Rv(t){var a=pi(pn(t.nodes(),function(c){return t.node(c).rank}));Te(t.nodes(),function(c){var A=t.node(c);ml(A,"rank")&&(A.rank-=a)})}function zv(t){var a=pi(pn(t.nodes(),function(J){return t.node(J).rank})),c=[];Te(t.nodes(),function(J){var it=t.node(J).rank-a;c[it]||(c[it]=[]),c[it].push(J)});var A=0,V=t.graph().nodeRankFactor;Te(c,function(J,it){kn(J)&&it%V!==0?--A:A&&Te(J,function(_t){t.node(_t).rank+=A})})}function Nl(t,a,c,A){var V={width:0,height:0};return arguments.length>=4&&(V.rank=c,V.order=A),oi(t,"border",V,a)}function Il(t){return $n(pn(t.nodes(),function(a){var c=t.node(a).rank;if(!kn(c))return c}))}function Bv(t,a){var c={lhs:[],rhs:[]};return Te(t,function(A){a(A)?c.lhs.push(A):c.rhs.push(A)}),c}function Hv(t,a){var c=ul();try{return a()}finally{console.log(t+" time: "+(ul()-c)+"ms")}}function Wv(t,a){return a()}function Uv(t){function a(c){var A=t.children(c),V=t.node(c);if(A.length&&Te(A,a),Object.prototype.hasOwnProperty.call(V,"minRank")){V.borderLeft=[],V.borderRight=[];for(var J=V.minRank,it=V.maxRank+1;J<it;++J)Pl(t,"borderLeft","_bl",c,V,J),Pl(t,"borderRight","_br",c,V,J)}}Te(t.children(),a)}function Pl(t,a,c,A,V,J){var it={width:0,height:0,rank:J,borderType:a},_t=V[a][J-1],Vt=oi(t,"border",it,c);V[a][J]=Vt,t.setParent(Vt,A),_t&&t.setEdge(_t,Vt,{weight:1})}function Yv(t){var a=t.graph().rankdir.toLowerCase();(a==="lr"||a==="rl")&&Dl(t)}function Vv(t){var a=t.graph().rankdir.toLowerCase();(a==="bt"||a==="rl")&&jv(t),(a==="lr"||a==="rl")&&(Xv(t),Dl(t))}function Dl(t){Te(t.nodes(),function(a){Ol(t.node(a))}),Te(t.edges(),function(a){Ol(t.edge(a))})}function Ol(t){var a=t.width;t.width=t.height,t.height=a}function jv(t){Te(t.nodes(),function(a){Lo(t.node(a))}),Te(t.edges(),function(a){var c=t.edge(a);Te(c.points,Lo),Object.prototype.hasOwnProperty.call(c,"y")&&Lo(c)})}function Lo(t){t.y=-t.y}function Xv(t){Te(t.nodes(),function(a){Fo(t.node(a))}),Te(t.edges(),function(a){var c=t.edge(a);Te(c.points,Fo),Object.prototype.hasOwnProperty.call(c,"x")&&Fo(c)})}function Fo(t){var a=t.x;t.x=t.y,t.y=a}var qv=class{constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,a=t._prev;if(a!==t)return Rl(a),a}enqueue(t){var a=this._sentinel;t._prev&&t._next&&Rl(t),t._next=a._next,a._next._prev=t,a._next=t,t._prev=a}toString(){for(var t=[],a=this._sentinel,c=a._prev;c!==a;)t.push(JSON.stringify(c,$v)),c=c._prev;return"["+t.join(", ")+"]"}};function Rl(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function $v(t,a){if(t!=="_next"&&t!=="_prev")return a}var Gv=ft(1);function Zv(t,a){if(t.nodeCount()<=1)return[];var c=Qv(t,a||Gv),A=Kv(c.graph,c.buckets,c.zeroIdx);return ei(pn(A,function(V){return t.outEdges(V.v,V.w)}))}function Kv(t,a,c){for(var A=[],V=a[a.length-1],J=a[0],it;t.nodeCount();){for(;it=J.dequeue();)No(t,a,c,it);for(;it=V.dequeue();)No(t,a,c,it);if(t.nodeCount()){for(var _t=a.length-2;_t>0;--_t)if(it=a[_t].dequeue(),it){A=A.concat(No(t,a,c,it,!0));break}}}return A}function No(t,a,c,A,V){var J=V?[]:void 0;return Te(t.inEdges(A.v),function(it){var _t=t.edge(it),Vt=t.node(it.v);V&&J.push({v:it.v,w:it.w}),Vt.out-=_t,Io(a,c,Vt)}),Te(t.outEdges(A.v),function(it){var _t=t.edge(it),Vt=it.w,se=t.node(Vt);se.in-=_t,Io(a,c,se)}),t.removeNode(A.v),J}function Qv(t,a){var c=new Nn,A=0,V=0;Te(t.nodes(),function(_t){c.setNode(_t,{v:_t,in:0,out:0})}),Te(t.edges(),function(_t){var Vt=c.edge(_t.v,_t.w)||0,se=a(_t),ge=Vt+se;c.setEdge(_t.v,_t.w,ge),V=Math.max(V,c.node(_t.v).out+=se),A=Math.max(A,c.node(_t.w).in+=se)});var J=ii(V+A+3).map(function(){return new qv}),it=A+1;return Te(c.nodes(),function(_t){Io(J,it,c.node(_t))}),{graph:c,buckets:J,zeroIdx:it}}function Io(t,a,c){c.out?c.in?t[c.out-c.in+a].enqueue(c):t[t.length-1].enqueue(c):t[0].enqueue(c)}function Jv(t){var a=t.graph().acyclicer==="greedy"?Zv(t,c(t)):td(t);Te(a,function(A){var V=t.edge(A);t.removeEdge(A),V.forwardName=A.name,V.reversed=!0,t.setEdge(A.w,A.v,V,So("rev"))});function c(A){return function(V){return A.edge(V).weight}}}function td(t){var a=[],c={},A={};function V(J){Object.prototype.hasOwnProperty.call(A,J)||(A[J]=!0,c[J]=!0,Te(t.outEdges(J),function(it){Object.prototype.hasOwnProperty.call(c,it.w)?a.push(it):V(it.w)}),delete c[J])}return Te(t.nodes(),V),a}function ed(t){Te(t.edges(),function(a){var c=t.edge(a);if(c.reversed){t.removeEdge(a);var A=c.forwardName;delete c.reversed,delete c.forwardName,t.setEdge(a.w,a.v,c,A)}})}function rd(t){t.graph().dummyChains=[],Te(t.edges(),function(a){ad(t,a)})}function ad(t,a){var c=a.v,A=t.node(c).rank,V=a.w,J=t.node(V).rank,it=a.name,_t=t.edge(a),Vt=_t.labelRank;if(J!==A+1){t.removeEdge(a);var se=void 0,ge,Oe;for(Oe=0,++A;A<J;++Oe,++A)_t.points=[],se={width:0,height:0,edgeLabel:_t,edgeObj:a,rank:A},ge=oi(t,"edge",se,"_d"),A===Vt&&(se.width=_t.width,se.height=_t.height,se.dummy="edge-label",se.labelpos=_t.labelpos),t.setEdge(c,ge,{weight:_t.weight},it),Oe===0&&t.graph().dummyChains.push(ge),c=ge;t.setEdge(c,V,{weight:_t.weight},it)}}function nd(t){Te(t.graph().dummyChains,function(a){var c=t.node(a),A=c.edgeLabel,V;for(t.setEdge(c.edgeObj,A);c.dummy;)V=t.successors(a)[0],t.removeNode(a),A.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(A.x=c.x,A.y=c.y,A.width=c.width,A.height=c.height),a=V,c=t.node(a)})}function Po(t){var a={};function c(A){var V=t.node(A);if(Object.prototype.hasOwnProperty.call(a,A))return V.rank;a[A]=!0;var J=pi(pn(t.outEdges(A),function(it){return c(it.w)-t.edge(it).minlen}));return(J===Number.POSITIVE_INFINITY||J===void 0||J===null)&&(J=0),V.rank=J}Te(t.sources(),c)}function bi(t,a){return t.node(a.w).rank-t.node(a.v).rank-t.edge(a).minlen}function zl(t){var a=new Nn({directed:!1}),c=t.nodes()[0],A=t.nodeCount();a.setNode(c,{});for(var V,J;id(a,t)<A;)V=od(a,t),J=a.hasNode(V.v)?bi(t,V):-bi(t,V),sd(a,t,J);return a}function id(t,a){function c(A){Te(a.nodeEdges(A),function(V){var J=V.v,it=A===J?V.w:J;!t.hasNode(it)&&!bi(a,V)&&(t.setNode(it,{}),t.setEdge(A,it,{}),c(it))})}return Te(t.nodes(),c),t.nodeCount()}function od(t,a){return Mo(a.edges(),function(c){if(t.hasNode(c.v)!==t.hasNode(c.w))return bi(a,c)})}function sd(t,a,c){Te(t.nodes(),function(A){a.node(A).rank+=c})}var l2=ft(1),h2=ft(1);ld.CycleException=ji;function ld(t){var a={},c={},A=[];function V(J){if(Object.prototype.hasOwnProperty.call(c,J))throw new ji;Object.prototype.hasOwnProperty.call(a,J)||(c[J]=!0,a[J]=!0,Te(t.predecessors(J),V),delete c[J],A.push(J))}if(Te(t.sinks(),V),mv(a)!==t.nodeCount())throw new ji;return A}function ji(){}ji.prototype=new Error;function Bl(t,a,c){Rt(a)||(a=[a]);var A=(t.isDirected()?t.successors:t.neighbors).bind(t),V=[],J={};return Te(a,function(it){if(!t.hasNode(it))throw new Error("Graph does not have node: "+it);Hl(t,it,c==="post",J,A,V)}),V}function Hl(t,a,c,A,V,J){Object.prototype.hasOwnProperty.call(A,a)||(A[a]=!0,c||J.push(a),Te(V(a),function(it){Hl(t,it,c,A,V,J)}),c&&J.push(a))}function hd(t,a){return Bl(t,a,"post")}function cd(t,a){return Bl(t,a,"pre")}Zn.initLowLimValues=Oo,Zn.initCutValues=Do,Zn.calcCutValue=Wl,Zn.leaveEdge=Yl,Zn.enterEdge=Vl,Zn.exchangeEdges=jl;function Zn(t){t=Ov(t),Po(t);var a=zl(t);Oo(a),Do(a,t);for(var c,A;c=Yl(a);)A=Vl(a,t,c),jl(a,t,c,A)}function Do(t,a){var c=hd(t,t.nodes());c=c.slice(0,c.length-1),Te(c,function(A){fd(t,a,A)})}function fd(t,a,c){var A=t.node(c),V=A.parent;t.edge(c,V).cutvalue=Wl(t,a,c)}function Wl(t,a,c){var A=t.node(c),V=A.parent,J=!0,it=a.edge(c,V),_t=0;return it||(J=!1,it=a.edge(V,c)),_t=it.weight,Te(a.nodeEdges(c),function(Vt){var se=Vt.v===c,ge=se?Vt.w:Vt.v;if(ge!==V){var Oe=se===J,hr=a.edge(Vt).weight;if(_t+=Oe?hr:-hr,vd(t,c,ge)){var Hr=t.edge(c,ge).cutvalue;_t+=Oe?-Hr:Hr}}}),_t}function Oo(t,a){arguments.length<2&&(a=t.nodes()[0]),Ul(t,{},1,a)}function Ul(t,a,c,A,V){var J=c,it=t.node(A);return a[A]=!0,Te(t.neighbors(A),function(_t){Object.prototype.hasOwnProperty.call(a,_t)||(c=Ul(t,a,c,_t,A))}),it.low=J,it.lim=c++,V?it.parent=V:delete it.parent,c}function Yl(t){return ko(t.edges(),function(a){return t.edge(a).cutvalue<0})}function Vl(t,a,c){var A=c.v,V=c.w;a.hasEdge(A,V)||(A=c.w,V=c.v);var J=t.node(A),it=t.node(V),_t=J,Vt=!1;J.lim>it.lim&&(_t=it,Vt=!0);var se=Bn(a.edges(),function(ge){return Vt===Xl(t,t.node(ge.v),_t)&&Vt!==Xl(t,t.node(ge.w),_t)});return Mo(se,function(ge){return bi(a,ge)})}function jl(t,a,c,A){var V=c.v,J=c.w;t.removeEdge(V,J),t.setEdge(A.v,A.w,{}),Oo(t),Do(t,a),ud(t,a)}function ud(t,a){var c=ko(t.nodes(),function(V){return!a.node(V).parent}),A=cd(t,c);A=A.slice(1),Te(A,function(V){var J=t.node(V).parent,it=a.edge(V,J),_t=!1;it||(it=a.edge(J,V),_t=!0),a.node(V).rank=a.node(J).rank+(_t?it.minlen:-it.minlen)})}function vd(t,a,c){return t.hasEdge(a,c)}function Xl(t,a,c){return c.low<=a.lim&&a.lim<=c.lim}function dd(t){switch(t.graph().ranker){case"network-simplex":ql(t);break;case"tight-tree":pd(t);break;case"longest-path":gd(t);break;default:ql(t)}}var gd=Po;function pd(t){Po(t),zl(t)}function ql(t){Zn(t)}function md(t){var a=oi(t,"root",{},"_root"),c=yd(t),A=$n(Hn(c))-1,V=2*A+1;t.graph().nestingRoot=a,Te(t.edges(),function(it){t.edge(it).minlen*=V});var J=wd(t)+1;Te(t.children(),function(it){$l(t,a,V,J,A,c,it)}),t.graph().nodeRankFactor=V}function $l(t,a,c,A,V,J,it){var _t=t.children(it);if(!_t.length){it!==a&&t.setEdge(a,it,{weight:0,minlen:c});return}var Vt=Nl(t,"_bt"),se=Nl(t,"_bb"),ge=t.node(it);t.setParent(Vt,it),ge.borderTop=Vt,t.setParent(se,it),ge.borderBottom=se,Te(_t,function(Oe){$l(t,a,c,A,V,J,Oe);var hr=t.node(Oe),Hr=hr.borderTop?hr.borderTop:Oe,Or=hr.borderBottom?hr.borderBottom:Oe,Ca=hr.borderTop?A:2*A,Qa=Hr!==Or?1:V-J[it]+1;t.setEdge(Vt,Hr,{weight:Ca,minlen:Qa,nestingEdge:!0}),t.setEdge(Or,se,{weight:Ca,minlen:Qa,nestingEdge:!0})}),t.parent(it)||t.setEdge(a,Vt,{weight:0,minlen:V+J[it]})}function yd(t){var a={};function c(A,V){var J=t.children(A);J&&J.length&&Te(J,function(it){c(it,V+1)}),a[A]=V}return Te(t.children(),function(A){c(A,1)}),a}function wd(t){return mi(t.edges(),function(a,c){return a+t.edge(c).weight},0)}function bd(t){var a=t.graph();t.removeNode(a.nestingRoot),delete a.nestingRoot,Te(t.edges(),function(c){var A=t.edge(c);A.nestingEdge&&t.removeEdge(c)})}function xd(t,a,c){var A={},V;Te(c,function(J){for(var it=t.parent(J),_t,Vt;it;){if(_t=t.parent(it),_t?(Vt=A[_t],A[_t]=it):(Vt=V,V=it),Vt&&Vt!==it){a.setEdge(Vt,it);return}it=_t}})}function kd(t,a,c){var A=Cd(t),V=new Nn({compound:!0}).setGraph({root:A}).setDefaultNodeLabel(function(J){return t.node(J)});return Te(t.nodes(),function(J){var it=t.node(J),_t=t.parent(J);(it.rank===a||it.minRank<=a&&a<=it.maxRank)&&(V.setNode(J),V.setParent(J,_t||A),Te(t[c](J),function(Vt){var se=Vt.v===J?Vt.w:Vt.v,ge=V.edge(se,J),Oe=kn(ge)?0:ge.weight;V.setEdge(se,J,{weight:t.edge(Vt).weight+Oe})}),Object.prototype.hasOwnProperty.call(it,"minRank")&&V.setNode(J,{borderLeft:it.borderLeft[a],borderRight:it.borderRight[a]}))}),V}function Cd(t){for(var a;t.hasNode(a=So("_root")););return a}function Ed(t,a){for(var c=0,A=1;A<a.length;++A)c+=Md(t,a[A-1],a[A]);return c}function Md(t,a,c){for(var A=Nv(c,pn(c,function(se,ge){return ge})),V=ei(pn(a,function(se){return yi(pn(t.outEdges(se),function(ge){return{pos:A[ge.w],weight:t.edge(ge).weight}}),"pos")})),J=1;J<c.length;)J<<=1;var it=2*J-1;J-=1;var _t=pn(new Array(it),function(){return 0}),Vt=0;return Te(V.forEach(function(se){var ge=se.pos+J;_t[ge]+=se.weight;for(var Oe=0;ge>0;)ge%2&&(Oe+=_t[ge+1]),ge=ge-1>>1,_t[ge]+=se.weight;Vt+=se.weight*Oe})),Vt}function _d(t){var a={},c=Bn(t.nodes(),function(_t){return!t.children(_t).length}),A=$n(pn(c,function(_t){return t.node(_t).rank})),V=pn(ii(A+1),function(){return[]});function J(_t){if(!ml(a,_t)){a[_t]=!0;var Vt=t.node(_t);V[Vt.rank].push(_t),Te(t.successors(_t),J)}}var it=yi(c,function(_t){return t.node(_t).rank});return Te(it,J),V}function Td(t,a){return pn(a,function(c){var A=t.inEdges(c);if(A.length){var V=mi(A,function(J,it){var _t=t.edge(it),Vt=t.node(it.v);return{sum:J.sum+_t.weight*Vt.order,weight:J.weight+_t.weight}},{sum:0,weight:0});return{v:c,barycenter:V.sum/V.weight,weight:V.weight}}else return{v:c}})}function Sd(t,a){var c={};Te(t,function(V,J){var it=c[V.v]={indegree:0,in:[],out:[],vs:[V.v],i:J};kn(V.barycenter)||(it.barycenter=V.barycenter,it.weight=V.weight)}),Te(a.edges(),function(V){var J=c[V.v],it=c[V.w];!kn(J)&&!kn(it)&&(it.indegree++,J.out.push(c[V.w]))});var A=Bn(c,function(V){return!V.indegree});return Ad(A)}function Ad(t){var a=[];function c(J){return function(it){it.merged||(kn(it.barycenter)||kn(J.barycenter)||it.barycenter>=J.barycenter)&&Ld(J,it)}}function A(J){return function(it){it.in.push(J),--it.indegree===0&&t.push(it)}}for(;t.length;){var V=t.pop();a.push(V),Te(V.in.reverse(),c(V)),Te(V.out,A(V))}return pn(Bn(a,function(J){return!J.merged}),function(J){return Yi(J,["vs","i","barycenter","weight"])})}function Ld(t,a){var c=0,A=0;t.weight&&(c+=t.barycenter*t.weight,A+=t.weight),a.weight&&(c+=a.barycenter*a.weight,A+=a.weight),t.vs=a.vs.concat(t.vs),t.barycenter=c/A,t.weight=A,t.i=Math.min(a.i,t.i),a.merged=!0}function Fd(t,a){var c=Bv(t,function(ge){return Object.prototype.hasOwnProperty.call(ge,"barycenter")}),A=c.lhs,V=yi(c.rhs,function(ge){return-ge.i}),J=[],it=0,_t=0,Vt=0;A.sort(Nd(!!a)),Vt=Gl(J,V,Vt),Te(A,function(ge){Vt+=ge.vs.length,J.push(ge.vs),it+=ge.barycenter*ge.weight,_t+=ge.weight,Vt=Gl(J,V,Vt)});var se={vs:ei(J)};return _t&&(se.barycenter=it/_t,se.weight=_t),se}function Gl(t,a,c){for(var A;a.length&&(A=Wi(a)).i<=c;)a.pop(),t.push(A.vs),c++;return c}function Nd(t){return function(a,c){return a.barycenter<c.barycenter?-1:a.barycenter>c.barycenter?1:t?c.i-a.i:a.i-c.i}}function Zl(t,a,c,A){var V=t.children(a),J=t.node(a),it=J?J.borderLeft:void 0,_t=J?J.borderRight:void 0,Vt={};it&&(V=Bn(V,function(Or){return Or!==it&&Or!==_t}));var se=Td(t,V);Te(se,function(Or){if(t.children(Or.v).length){var Ca=Zl(t,Or.v,c,A);Vt[Or.v]=Ca,Object.prototype.hasOwnProperty.call(Ca,"barycenter")&&Pd(Or,Ca)}});var ge=Sd(se,c);Id(ge,Vt);var Oe=Fd(ge,A);if(it&&(Oe.vs=ei([it,Oe.vs,_t]),t.predecessors(it).length)){var hr=t.node(t.predecessors(it)[0]),Hr=t.node(t.predecessors(_t)[0]);Object.prototype.hasOwnProperty.call(Oe,"barycenter")||(Oe.barycenter=0,Oe.weight=0),Oe.barycenter=(Oe.barycenter*Oe.weight+hr.order+Hr.order)/(Oe.weight+2),Oe.weight+=2}return Oe}function Id(t,a){Te(t,function(c){c.vs=ei(c.vs.map(function(A){return a[A]?a[A].vs:A}))})}function Pd(t,a){kn(t.barycenter)?(t.barycenter=a.barycenter,t.weight=a.weight):(t.barycenter=(t.barycenter*t.weight+a.barycenter*a.weight)/(t.weight+a.weight),t.weight+=a.weight)}function Dd(t){var a=Il(t),c=Kl(t,ii(1,a+1),"inEdges"),A=Kl(t,ii(a-1,-1,-1),"outEdges"),V=_d(t);Ql(t,V);for(var J=Number.POSITIVE_INFINITY,it,_t=0,Vt=0;Vt<4;++_t,++Vt){Od(_t%2?c:A,_t%4>=2),V=Vi(t);var se=Ed(t,V);se<J&&(Vt=0,it=o0(V),J=se)}Ql(t,it)}function Kl(t,a,c){return pn(a,function(A){return kd(t,A,c)})}function Od(t,a){var c=new Nn;Te(t,function(A){var V=A.graph().root,J=Zl(A,V,c,a);Te(J.vs,function(it,_t){A.node(it).order=_t}),xd(A,c,J.vs)})}function Ql(t,a){Te(a,function(c){Te(c,function(A,V){t.node(A).order=V})})}function Rd(t){var a=Bd(t);Te(t.graph().dummyChains,function(c){for(var A=t.node(c),V=A.edgeObj,J=zd(t,a,V.v,V.w),it=J.path,_t=J.lca,Vt=0,se=it[Vt],ge=!0;c!==V.w;){if(A=t.node(c),ge){for(;(se=it[Vt])!==_t&&t.node(se).maxRank<A.rank;)Vt++;se===_t&&(ge=!1)}if(!ge){for(;Vt<it.length-1&&t.node(se=it[Vt+1]).minRank<=A.rank;)Vt++;se=it[Vt]}t.setParent(c,se),c=t.successors(c)[0]}})}function zd(t,a,c,A){var V=[],J=[],it=Math.min(a[c].low,a[A].low),_t=Math.max(a[c].lim,a[A].lim),Vt,se;Vt=c;do Vt=t.parent(Vt),V.push(Vt);while(Vt&&(a[Vt].low>it||_t>a[Vt].lim));for(se=Vt,Vt=A;(Vt=t.parent(Vt))!==se;)J.push(Vt);return{path:V.concat(J.reverse()),lca:se}}function Bd(t){var a={},c=0;function A(V){var J=c;Te(t.children(V),A),a[V]={low:J,lim:c++}}return Te(t.children(),A),a}function Hd(t,a){var c={};function A(V,J){var it=0,_t=0,Vt=V.length,se=Wi(J);return Te(J,function(ge,Oe){var hr=Ud(t,ge),Hr=hr?t.node(hr).order:Vt;(hr||ge===se)&&(Te(J.slice(_t,Oe+1),function(Or){Te(t.predecessors(Or),function(Ca){var Qa=t.node(Ca),mn=Qa.order;(mn<it||Hr<mn)&&!(Qa.dummy&&t.node(Or).dummy)&&Jl(c,Ca,Or)})}),_t=Oe+1,it=Hr)}),J}return mi(a,A),c}function Wd(t,a){var c={};function A(J,it,_t,Vt,se){var ge;Te(ii(it,_t),function(Oe){ge=J[Oe],t.node(ge).dummy&&Te(t.predecessors(ge),function(hr){var Hr=t.node(hr);Hr.dummy&&(Hr.order<Vt||Hr.order>se)&&Jl(c,hr,ge)})})}function V(J,it){var _t=-1,Vt,se=0;return Te(it,function(ge,Oe){if(t.node(ge).dummy==="border"){var hr=t.predecessors(ge);hr.length&&(Vt=t.node(hr[0]).order,A(it,se,Oe,_t,Vt),se=Oe,_t=Vt)}A(it,se,it.length,Vt,J.length)}),it}return mi(a,V),c}function Ud(t,a){if(t.node(a).dummy)return ko(t.predecessors(a),function(c){return t.node(c).dummy})}function Jl(t,a,c){if(a>c){var A=a;a=c,c=A}Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{enumerable:!0,configurable:!0,value:{},writable:!0});var V=t[a];Object.defineProperty(V,c,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Yd(t,a,c){if(a>c){var A=a;a=c,c=A}return!!t[a]&&Object.prototype.hasOwnProperty.call(t[a],c)}function Vd(t,a,c,A){var V={},J={},it={};return Te(a,function(_t){Te(_t,function(Vt,se){V[Vt]=Vt,J[Vt]=Vt,it[Vt]=se})}),Te(a,function(_t){var Vt=-1;Te(_t,function(se){var ge=A(se);if(ge.length){ge=yi(ge,function(Ca){return it[Ca]});for(var Oe=(ge.length-1)/2,hr=Math.floor(Oe),Hr=Math.ceil(Oe);hr<=Hr;++hr){var Or=ge[hr];J[se]===se&&Vt<it[Or]&&!Yd(c,se,Or)&&(J[Or]=se,J[se]=V[se]=V[Or],Vt=it[Or])}}})}),{root:V,align:J}}function jd(t,a,c,A,V){var J={},it=Xd(t,a,c,V),_t=V?"borderLeft":"borderRight";function Vt(Oe,hr){for(var Hr=it.nodes(),Or=Hr.pop(),Ca={};Or;)Ca[Or]?Oe(Or):(Ca[Or]=!0,Hr.push(Or),Hr=Hr.concat(hr(Or))),Or=Hr.pop()}function se(Oe){J[Oe]=it.inEdges(Oe).reduce(function(hr,Hr){return Math.max(hr,J[Hr.v]+it.edge(Hr))},0)}function ge(Oe){var hr=it.outEdges(Oe).reduce(function(Or,Ca){return Math.min(Or,J[Ca.w]-it.edge(Ca))},Number.POSITIVE_INFINITY),Hr=t.node(Oe);hr!==Number.POSITIVE_INFINITY&&Hr.borderType!==_t&&(J[Oe]=Math.max(J[Oe],hr))}return Vt(se,it.predecessors.bind(it)),Vt(ge,it.successors.bind(it)),Te(A,function(Oe){J[Oe]=J[c[Oe]]}),J}function Xd(t,a,c,A){var V=new Nn,J=t.graph(),it=Kd(J.nodesep,J.edgesep,A);return Te(a,function(_t){var Vt;Te(_t,function(se){var ge=c[se];if(V.setNode(ge),Vt){var Oe=c[Vt],hr=V.edge(Oe,ge);V.setEdge(Oe,ge,Math.max(it(t,se,Vt),hr||0))}Vt=se})}),V}function qd(t,a){return Mo(Hn(a),function(c){var A=Number.NEGATIVE_INFINITY,V=Number.POSITIVE_INFINITY;return K1(c,function(J,it){var _t=Qd(t,it)/2;A=Math.max(J+_t,A),V=Math.min(J-_t,V)}),A-V})}function $d(t,a){var c=Hn(a),A=pi(c),V=$n(c);Te(["u","d"],function(J){Te(["l","r"],function(it){var _t=J+it,Vt=t[_t],se;if(Vt!==a){var ge=Hn(Vt);se=it==="l"?A-pi(ge):V-$n(ge),se&&(t[_t]=Ui(Vt,function(Oe){return Oe+se}))}})})}function Gd(t,a){return Ui(t.ul,function(c,A){if(a)return t[a.toLowerCase()][A];var V=yi(pn(t,A));return(V[1]+V[2])/2})}function Zd(t){var a=Vi(t),c=Eo(Hd(t,a),Wd(t,a)),A={},V;Te(["u","d"],function(it){V=it==="u"?a:Hn(a).reverse(),Te(["l","r"],function(_t){_t==="r"&&(V=pn(V,function(Oe){return Hn(Oe).reverse()}));var Vt=(it==="u"?t.predecessors:t.successors).bind(t),se=Vd(t,V,c,Vt),ge=jd(t,V,se.root,se.align,_t==="r");_t==="r"&&(ge=Ui(ge,function(Oe){return-Oe})),A[it+_t]=ge})});var J=qd(t,A);return $d(A,J),Gd(A,t.graph().align)}function Kd(t,a,c){return function(A,V,J){var it=A.node(V),_t=A.node(J),Vt=0,se;if(Vt+=it.width/2,Object.prototype.hasOwnProperty.call(it,"labelpos"))switch(it.labelpos.toLowerCase()){case"l":se=-it.width/2;break;case"r":se=it.width/2;break}if(se&&(Vt+=c?se:-se),se=0,Vt+=(it.dummy?a:t)/2,Vt+=(_t.dummy?a:t)/2,Vt+=_t.width/2,Object.prototype.hasOwnProperty.call(_t,"labelpos"))switch(_t.labelpos.toLowerCase()){case"l":se=_t.width/2;break;case"r":se=-_t.width/2;break}return se&&(Vt+=c?se:-se),se=0,Vt}}function Qd(t,a){return t.node(a).width}function Jd(t){t=Ll(t),tg(t),J1(Zd(t),function(a,c){t.node(c).x=a})}function tg(t){var a=Vi(t),c=t.graph().ranksep,A=0;Te(a,function(V){var J=$n(pn(V,function(it){return t.node(it).height}));Te(V,function(it){t.node(it).y=A+J/2}),A+=J+c})}function eg(t,a){var c=a&&a.debugTiming?Hv:Wv;c("layout",()=>{var A=c(" buildLayoutGraph",()=>ug(t));c(" runLayout",()=>rg(A,c)),c(" updateInputGraph",()=>ag(t,A))})}function rg(t,a){a(" makeSpaceForEdgeLabels",()=>vg(t)),a(" removeSelfEdges",()=>kg(t)),a(" acyclic",()=>Jv(t)),a(" nestingGraph.run",()=>md(t)),a(" rank",()=>dd(Ll(t))),a(" injectEdgeLabelProxies",()=>dg(t)),a(" removeEmptyRanks",()=>zv(t)),a(" nestingGraph.cleanup",()=>bd(t)),a(" normalizeRanks",()=>Rv(t)),a(" assignRankMinMax",()=>gg(t)),a(" removeEdgeLabelProxies",()=>pg(t)),a(" normalize.run",()=>rd(t)),a(" parentDummyChains",()=>Rd(t)),a(" addBorderSegments",()=>Uv(t)),a(" order",()=>Dd(t)),a(" insertSelfEdges",()=>Cg(t)),a(" adjustCoordinateSystem",()=>Yv(t)),a(" position",()=>Jd(t)),a(" positionSelfEdges",()=>Eg(t)),a(" removeBorderNodes",()=>xg(t)),a(" normalize.undo",()=>nd(t)),a(" fixupEdgeLabelCoords",()=>wg(t)),a(" undoCoordinateSystem",()=>Vv(t)),a(" translateGraph",()=>mg(t)),a(" assignNodeIntersects",()=>yg(t)),a(" reversePoints",()=>bg(t)),a(" acyclic.undo",()=>ed(t))}function ag(t,a){Te(t.nodes(),function(c){var A=t.node(c),V=a.node(c);A&&(A.x=V.x,A.y=V.y,a.children(c).length&&(A.width=V.width,A.height=V.height))}),Te(t.edges(),function(c){var A=t.edge(c),V=a.edge(c);A.points=V.points,Object.prototype.hasOwnProperty.call(V,"x")&&(A.x=V.x,A.y=V.y)}),t.graph().width=a.graph().width,t.graph().height=a.graph().height}var ng=["nodesep","edgesep","ranksep","marginx","marginy"],ig={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},og=["acyclicer","ranker","rankdir","align"],sg=["width","height"],lg={width:0,height:0},hg=["minlen","weight","width","height","labeloffset"],cg={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},fg=["labelpos"];function ug(t){var a=new Nn({multigraph:!0,compound:!0}),c=zo(t.graph());return a.setGraph(Eo({},ig,Ro(c,ng),Yi(c,og))),Te(t.nodes(),function(A){var V=zo(t.node(A));a.setNode(A,M1(Ro(V,sg),lg)),a.setParent(A,t.parent(A))}),Te(t.edges(),function(A){var V=zo(t.edge(A));a.setEdge(A,Eo({},cg,Ro(V,hg),Yi(V,fg)))}),a}function vg(t){var a=t.graph();a.ranksep/=2,Te(t.edges(),function(c){var A=t.edge(c);A.minlen*=2,A.labelpos.toLowerCase()!=="c"&&(a.rankdir==="TB"||a.rankdir==="BT"?A.width+=A.labeloffset:A.height+=A.labeloffset)})}function dg(t){Te(t.edges(),function(a){var c=t.edge(a);if(c.width&&c.height){var A=t.node(a.v),V=t.node(a.w),J={rank:(V.rank-A.rank)/2+A.rank,e:a};oi(t,"edge-proxy",J,"_ep")}})}function gg(t){var a=0;Te(t.nodes(),function(c){var A=t.node(c);A.borderTop&&(A.minRank=t.node(A.borderTop).rank,A.maxRank=t.node(A.borderBottom).rank,a=$n(a,A.maxRank))}),t.graph().maxRank=a}function pg(t){Te(t.nodes(),function(a){var c=t.node(a);c.dummy==="edge-proxy"&&(t.edge(c.e).labelRank=c.rank,t.removeNode(a))})}function mg(t){var a=Number.POSITIVE_INFINITY,c=0,A=Number.POSITIVE_INFINITY,V=0,J=t.graph(),it=J.marginx||0,_t=J.marginy||0;function Vt(se){var ge=se.x,Oe=se.y,hr=se.width,Hr=se.height;a=Math.min(a,ge-hr/2),c=Math.max(c,ge+hr/2),A=Math.min(A,Oe-Hr/2),V=Math.max(V,Oe+Hr/2)}Te(t.nodes(),function(se){Vt(t.node(se))}),Te(t.edges(),function(se){var ge=t.edge(se);Object.prototype.hasOwnProperty.call(ge,"x")&&Vt(ge)}),a-=it,A-=_t,Te(t.nodes(),function(se){var ge=t.node(se);ge.x-=a,ge.y-=A}),Te(t.edges(),function(se){var ge=t.edge(se);Te(ge.points,function(Oe){Oe.x-=a,Oe.y-=A}),Object.prototype.hasOwnProperty.call(ge,"x")&&(ge.x-=a),Object.prototype.hasOwnProperty.call(ge,"y")&&(ge.y-=A)}),J.width=c-a+it,J.height=V-A+_t}function yg(t){Te(t.edges(),function(a){var c=t.edge(a),A=t.node(a.v),V=t.node(a.w),J,it;c.points?(J=c.points[0],it=c.points[c.points.length-1]):(c.points=[],J=V,it=A),c.points.unshift(Fl(A,J)),c.points.push(Fl(V,it))})}function wg(t){Te(t.edges(),function(a){var c=t.edge(a);if(Object.prototype.hasOwnProperty.call(c,"x"))switch((c.labelpos==="l"||c.labelpos==="r")&&(c.width-=c.labeloffset),c.labelpos){case"l":c.x-=c.width/2+c.labeloffset;break;case"r":c.x+=c.width/2+c.labeloffset;break}})}function bg(t){Te(t.edges(),function(a){var c=t.edge(a);c.reversed&&c.points.reverse()})}function xg(t){Te(t.nodes(),function(a){if(t.children(a).length){var c=t.node(a),A=t.node(c.borderTop),V=t.node(c.borderBottom),J=t.node(Wi(c.borderLeft)),it=t.node(Wi(c.borderRight));c.width=Math.abs(it.x-J.x),c.height=Math.abs(V.y-A.y),c.x=J.x+c.width/2,c.y=A.y+c.height/2}}),Te(t.nodes(),function(a){t.node(a).dummy==="border"&&t.removeNode(a)})}function kg(t){Te(t.edges(),function(a){if(a.v===a.w){var c=t.node(a.v);c.selfEdges||(c.selfEdges=[]),c.selfEdges.push({e:a,label:t.edge(a)}),t.removeEdge(a)}})}function Cg(t){var a=Vi(t);Te(a,function(c){var A=0;Te(c,function(V,J){var it=t.node(V);it.order=J+A,Te(it.selfEdges,function(_t){oi(t,"selfedge",{width:_t.label.width,height:_t.label.height,rank:it.rank,order:J+ ++A,e:_t.e,label:_t.label},"_se")}),delete it.selfEdges})})}function Eg(t){Te(t.nodes(),function(a){var c=t.node(a);if(c.dummy==="selfedge"){var A=t.node(c.e.v),V=A.x+A.width/2,J=A.y,it=c.x-V,_t=A.height/2;t.setEdge(c.e,c.label),t.removeNode(a),c.label.points=[{x:V+2*it/3,y:J-_t},{x:V+5*it/6,y:J-_t},{x:V+it,y:J},{x:V+5*it/6,y:J+_t},{x:V+2*it/3,y:J+_t}],c.label.x=c.x,c.label.y=c.y}})}function Ro(t,a){return Ui(Yi(t,a),Number)}function zo(t){var a={};return Te(t,function(c,A){a[A.toLowerCase()]=c}),a}return s(o)})(),ih=Fg;var Gi={};(function(L,j){typeof exports=="object"&&typeof module=="object"?module.exports=j():typeof define=="function"&&define.amd?define([],j):typeof exports=="object"?exports.layoutBase=j():L.layoutBase=j()})(Gi,function(){return(function(L){var j={};function P(E){if(j[E])return j[E].exports;var w=j[E]={i:E,l:!1,exports:{}};return L[E].call(w.exports,w,w.exports,P),w.l=!0,w.exports}return P.m=L,P.c=j,P.i=function(E){return E},P.d=function(E,w,p){P.o(E,w)||Object.defineProperty(E,w,{configurable:!1,enumerable:!0,get:p})},P.n=function(E){var w=E&&E.__esModule?function(){return E.default}:function(){return E};return P.d(w,"a",w),w},P.o=function(E,w){return Object.prototype.hasOwnProperty.call(E,w)},P.p="",P(P.s=28)})([function(L,j,P){"use strict";function E(){}E.QUALITY=1,E.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,E.DEFAULT_INCREMENTAL=!1,E.DEFAULT_ANIMATION_ON_LAYOUT=!0,E.DEFAULT_ANIMATION_DURING_LAYOUT=!1,E.DEFAULT_ANIMATION_PERIOD=50,E.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,E.DEFAULT_GRAPH_MARGIN=15,E.NODE_DIMENSIONS_INCLUDE_LABELS=!1,E.SIMPLE_NODE_SIZE=40,E.SIMPLE_NODE_HALF_SIZE=E.SIMPLE_NODE_SIZE/2,E.EMPTY_COMPOUND_NODE_SIZE=40,E.MIN_EDGE_LENGTH=1,E.WORLD_BOUNDARY=1e6,E.INITIAL_WORLD_BOUNDARY=E.WORLD_BOUNDARY/1e3,E.WORLD_CENTER_X=1200,E.WORLD_CENTER_Y=900,L.exports=E},function(L,j,P){"use strict";var E=P(2),w=P(8),p=P(9);function s(v,M,f){E.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=v,this.target=M}for(var o in s.prototype=Object.create(E.prototype),E)s[o]=E[o];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(v){if(this.source===v)return this.target;if(this.target===v)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(v,M){for(var f=this.getOtherEnd(v),u=M.getGraphManager().getRoot();;){if(f.getOwner()==M)return f;if(f.getOwner()==u)break;f=f.getOwner().getParent()}return null},s.prototype.updateLength=function(){var v=new Array(4);this.isOverlapingSourceAndTarget=w.getIntersection(this.target.getRect(),this.source.getRect(),v),this.isOverlapingSourceAndTarget||(this.lengthX=v[0]-v[2],this.lengthY=v[1]-v[3],Math.abs(this.lengthX)<1&&(this.lengthX=p.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=p.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=p.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=p.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},L.exports=s},function(L,j,P){"use strict";L.exports=function(E){this.vGraphObject=E}},function(L,j,P){"use strict";var E=P(2),w=P(10),p=P(13),s=P(0),o=P(16),v=P(5);function M(u,r,h,d){h==null&&d==null&&(d=r),E.call(this,d),u.graphManager!=null&&(u=u.graphManager),this.estimatedSize=w.MIN_VALUE,this.inclusionTreeDepth=w.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=u,this.rect=h!=null&&r!=null?new p(r.x,r.y,h.width,h.height):new p}for(var f in M.prototype=Object.create(E.prototype),E)M[f]=E[f];M.prototype.getEdges=function(){return this.edges},M.prototype.getChild=function(){return this.child},M.prototype.getOwner=function(){return this.owner},M.prototype.getWidth=function(){return this.rect.width},M.prototype.setWidth=function(u){this.rect.width=u},M.prototype.getHeight=function(){return this.rect.height},M.prototype.setHeight=function(u){this.rect.height=u},M.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},M.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},M.prototype.getCenter=function(){return new v(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},M.prototype.getLocation=function(){return new v(this.rect.x,this.rect.y)},M.prototype.getRect=function(){return this.rect},M.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},M.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},M.prototype.setRect=function(u,r){this.rect.x=u.x,this.rect.y=u.y,this.rect.width=r.width,this.rect.height=r.height},M.prototype.setCenter=function(u,r){this.rect.x=u-this.rect.width/2,this.rect.y=r-this.rect.height/2},M.prototype.setLocation=function(u,r){this.rect.x=u,this.rect.y=r},M.prototype.moveBy=function(u,r){this.rect.x+=u,this.rect.y+=r},M.prototype.getEdgeListToNode=function(u){var r=[],h=this;return h.edges.forEach(function(d){if(d.target==u){if(d.source!=h)throw"Incorrect edge source!";r.push(d)}}),r},M.prototype.getEdgesBetween=function(u){var r=[],h=this;return h.edges.forEach(function(d){if(d.source!=h&&d.target!=h)throw"Incorrect edge source and/or target";d.target!=u&&d.source!=u||r.push(d)}),r},M.prototype.getNeighborsList=function(){var u=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)u.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";u.add(h.source)}}),u},M.prototype.withChildren=function(){var u=new Set;if(u.add(this),this.child!=null)for(var r=this.child.getNodes(),h=0;h<r.length;h++)r[h].withChildren().forEach(function(d){u.add(d)});return u},M.prototype.getNoOfChildren=function(){var u=0;if(this.child==null)u=1;else for(var r=this.child.getNodes(),h=0;h<r.length;h++)u+=r[h].getNoOfChildren();return u==0&&(u=1),u},M.prototype.getEstimatedSize=function(){if(this.estimatedSize==w.MIN_VALUE)throw"assert failed";return this.estimatedSize},M.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},M.prototype.scatter=function(){var u,r,h=-s.INITIAL_WORLD_BOUNDARY,d=s.INITIAL_WORLD_BOUNDARY;u=s.WORLD_CENTER_X+o.nextDouble()*(d-h)+h;var n=-s.INITIAL_WORLD_BOUNDARY,y=s.INITIAL_WORLD_BOUNDARY;r=s.WORLD_CENTER_Y+o.nextDouble()*(y-n)+n,this.rect.x=u,this.rect.y=r},M.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var u=this.getChild();if(u.updateBounds(!0),this.rect.x=u.getLeft(),this.rect.y=u.getTop(),this.setWidth(u.getRight()-u.getLeft()),this.setHeight(u.getBottom()-u.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var r=u.getRight()-u.getLeft(),h=u.getBottom()-u.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(r+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>r?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},M.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==w.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},M.prototype.transform=function(u){var r=this.rect.x;r>s.WORLD_BOUNDARY?r=s.WORLD_BOUNDARY:r<-s.WORLD_BOUNDARY&&(r=-s.WORLD_BOUNDARY);var h=this.rect.y;h>s.WORLD_BOUNDARY?h=s.WORLD_BOUNDARY:h<-s.WORLD_BOUNDARY&&(h=-s.WORLD_BOUNDARY);var d=new v(r,h),n=u.inverseTransformPoint(d);this.setLocation(n.x,n.y)},M.prototype.getLeft=function(){return this.rect.x},M.prototype.getRight=function(){return this.rect.x+this.rect.width},M.prototype.getTop=function(){return this.rect.y},M.prototype.getBottom=function(){return this.rect.y+this.rect.height},M.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},L.exports=M},function(L,j,P){"use strict";var E=P(0);function w(){}for(var p in E)w[p]=E[p];w.MAX_ITERATIONS=2500,w.DEFAULT_EDGE_LENGTH=50,w.DEFAULT_SPRING_STRENGTH=.45,w.DEFAULT_REPULSION_STRENGTH=4500,w.DEFAULT_GRAVITY_STRENGTH=.4,w.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,w.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,w.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,w.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,w.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,w.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,w.COOLING_ADAPTATION_FACTOR=.33,w.ADAPTATION_LOWER_NODE_LIMIT=1e3,w.ADAPTATION_UPPER_NODE_LIMIT=5e3,w.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,w.MAX_NODE_DISPLACEMENT=3*w.MAX_NODE_DISPLACEMENT_INCREMENTAL,w.MIN_REPULSION_DIST=w.DEFAULT_EDGE_LENGTH/10,w.CONVERGENCE_CHECK_PERIOD=100,w.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,w.MIN_EDGE_LENGTH=1,w.GRID_CALCULATION_CHECK_PERIOD=10,L.exports=w},function(L,j,P){"use strict";function E(w,p){w==null&&p==null?(this.x=0,this.y=0):(this.x=w,this.y=p)}E.prototype.getX=function(){return this.x},E.prototype.getY=function(){return this.y},E.prototype.setX=function(w){this.x=w},E.prototype.setY=function(w){this.y=w},E.prototype.getDifference=function(w){return new DimensionD(this.x-w.x,this.y-w.y)},E.prototype.getCopy=function(){return new E(this.x,this.y)},E.prototype.translate=function(w){return this.x+=w.width,this.y+=w.height,this},L.exports=E},function(L,j,P){"use strict";var E=P(2),w=P(10),p=P(0),s=P(7),o=P(3),v=P(1),M=P(13),f=P(12),u=P(11);function r(d,n,y){E.call(this,y),this.estimatedSize=w.MIN_VALUE,this.margin=p.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,n!=null&&n instanceof s?this.graphManager=n:n!=null&&n instanceof Layout&&(this.graphManager=n.graphManager)}for(var h in r.prototype=Object.create(E.prototype),E)r[h]=E[h];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(d,n,y){if(n==null&&y==null){var b=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}var T=d;if(!(this.getNodes().indexOf(n)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(n.owner!=y.owner||n.owner!=this)throw"Both owners must be this graph!";return n.owner!=y.owner?null:(T.source=n,T.target=y,T.isInterGraph=!1,this.getEdges().push(T),n.edges.push(T),y!=n&&y.edges.push(T),T)},r.prototype.remove=function(d){var n=d;if(d instanceof o){if(n==null)throw"Node is null!";if(n.owner==null||n.owner!=this)throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=n.edges.slice(),b=y.length,T=0;T<b;T++)(I=y[T]).isInterGraph?this.graphManager.remove(I):I.source.owner.remove(I);if((F=this.nodes.indexOf(n))==-1)throw"Node not in owner node list!";this.nodes.splice(F,1)}else if(d instanceof v){var I;if((I=d)==null)throw"Edge is null!";if(I.source==null||I.target==null)throw"Source and/or target is null!";if(I.source.owner==null||I.target.owner==null||I.source.owner!=this||I.target.owner!=this)throw"Source and/or target owner is invalid!";var F,X=I.source.edges.indexOf(I),Z=I.target.edges.indexOf(I);if(!(X>-1&&Z>-1))throw"Source and/or target doesn't know this edge!";if(I.source.edges.splice(X,1),I.target!=I.source&&I.target.edges.splice(Z,1),(F=I.source.owner.getEdges().indexOf(I))==-1)throw"Not in owner's edge list!";I.source.owner.getEdges().splice(F,1)}},r.prototype.updateLeftTop=function(){for(var d,n,y,b=w.MAX_VALUE,T=w.MAX_VALUE,I=this.getNodes(),F=I.length,X=0;X<F;X++){var Z=I[X];b>(d=Z.getTop())&&(b=d),T>(n=Z.getLeft())&&(T=n)}return b==w.MAX_VALUE?null:(y=I[0].getParent().paddingLeft!=null?I[0].getParent().paddingLeft:this.margin,this.left=T-y,this.top=b-y,new f(this.left,this.top))},r.prototype.updateBounds=function(d){for(var n,y,b,T,I,F=w.MAX_VALUE,X=-w.MAX_VALUE,Z=w.MAX_VALUE,ot=-w.MAX_VALUE,dt=this.nodes,xt=dt.length,re=0;re<xt;re++){var N=dt[re];d&&N.child!=null&&N.updateBounds(),F>(n=N.getLeft())&&(F=n),X<(y=N.getRight())&&(X=y),Z>(b=N.getTop())&&(Z=b),ot<(T=N.getBottom())&&(ot=T)}var Q=new M(F,Z,X-F,ot-Z);F==w.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),I=dt[0].getParent().paddingLeft!=null?dt[0].getParent().paddingLeft:this.margin,this.left=Q.x-I,this.right=Q.x+Q.width+I,this.top=Q.y-I,this.bottom=Q.y+Q.height+I},r.calculateBounds=function(d){for(var n,y,b,T,I=w.MAX_VALUE,F=-w.MAX_VALUE,X=w.MAX_VALUE,Z=-w.MAX_VALUE,ot=d.length,dt=0;dt<ot;dt++){var xt=d[dt];I>(n=xt.getLeft())&&(I=n),F<(y=xt.getRight())&&(F=y),X>(b=xt.getTop())&&(X=b),Z<(T=xt.getBottom())&&(Z=T)}return new M(I,X,F-I,Z-X)},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==w.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var d=0,n=this.nodes,y=n.length,b=0;b<y;b++)d+=n[b].calcEstimatedSize();return this.estimatedSize=d==0?p.EMPTY_COMPOUND_NODE_SIZE:d/Math.sqrt(this.nodes.length),this.estimatedSize},r.prototype.updateConnected=function(){var d=this;if(this.nodes.length!=0){var n,y,b=new u,T=new Set,I=this.nodes[0];for(I.withChildren().forEach(function(ot){b.push(ot),T.add(ot)});b.length!==0;)for(var F=(n=(I=b.shift()).getEdges()).length,X=0;X<F;X++)(y=n[X].getOtherEndInGraph(I,this))!=null&&!T.has(y)&&y.withChildren().forEach(function(ot){b.push(ot),T.add(ot)});if(this.isConnected=!1,T.size>=this.nodes.length){var Z=0;T.forEach(function(ot){ot.owner==d&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},L.exports=r},function(L,j,P){"use strict";var E,w=P(1);function p(s){E=P(6),this.layout=s,this.graphs=[],this.edges=[]}p.prototype.addRoot=function(){var s=this.layout.newGraph(),o=this.layout.newNode(null),v=this.add(s,o);return this.setRootGraph(v),this.rootGraph},p.prototype.add=function(s,o,v,M,f){if(v==null&&M==null&&f==null){if(s==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return s.parent=o,o.child=s,s}f=v,v=s;var u=(M=o).getOwner(),r=f.getOwner();if(u==null||u.getGraphManager()!=this)throw"Source not in this graph mgr!";if(r==null||r.getGraphManager()!=this)throw"Target not in this graph mgr!";if(u==r)return v.isInterGraph=!1,u.add(v,M,f);if(v.isInterGraph=!0,v.source=M,v.target=f,this.edges.indexOf(v)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(v),v.source==null||v.target==null)throw"Edge source and/or target is null!";if(v.source.edges.indexOf(v)!=-1||v.target.edges.indexOf(v)!=-1)throw"Edge already in source and/or target incidency list!";return v.source.edges.push(v),v.target.edges.push(v),v},p.prototype.remove=function(s){if(s instanceof E){var o=s;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(o!=this.rootGraph&&(o.parent==null||o.parent.graphManager!=this))throw"Invalid parent node!";for(var v,M=[],f=(M=M.concat(o.getEdges())).length,u=0;u<f;u++)v=M[u],o.remove(v);var r,h=[];for(f=(h=h.concat(o.getNodes())).length,u=0;u<f;u++)r=h[u],o.remove(r);o==this.rootGraph&&this.setRootGraph(null);var d=this.graphs.indexOf(o);this.graphs.splice(d,1),o.parent=null}else if(s instanceof w){if((v=s)==null)throw"Edge is null!";if(!v.isInterGraph)throw"Not an inter-graph edge!";if(v.source==null||v.target==null)throw"Source and/or target is null!";if(v.source.edges.indexOf(v)==-1||v.target.edges.indexOf(v)==-1)throw"Source and/or target doesn't know this edge!";if(d=v.source.edges.indexOf(v),v.source.edges.splice(d,1),d=v.target.edges.indexOf(v),v.target.edges.splice(d,1),v.source.owner==null||v.source.owner.getGraphManager()==null)throw"Edge owner graph or owner graph manager is null!";if(v.source.owner.getGraphManager().edges.indexOf(v)==-1)throw"Not in owner graph manager's edge list!";d=v.source.owner.getGraphManager().edges.indexOf(v),v.source.owner.getGraphManager().edges.splice(d,1)}},p.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},p.prototype.getGraphs=function(){return this.graphs},p.prototype.getAllNodes=function(){if(this.allNodes==null){for(var s=[],o=this.getGraphs(),v=o.length,M=0;M<v;M++)s=s.concat(o[M].getNodes());this.allNodes=s}return this.allNodes},p.prototype.resetAllNodes=function(){this.allNodes=null},p.prototype.resetAllEdges=function(){this.allEdges=null},p.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},p.prototype.getAllEdges=function(){if(this.allEdges==null){for(var s=[],o=this.getGraphs(),v=(o.length,0);v<o.length;v++)s=s.concat(o[v].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},p.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},p.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},p.prototype.getRoot=function(){return this.rootGraph},p.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=s,s.parent==null&&(s.parent=this.layout.newNode("Root node"))},p.prototype.getLayout=function(){return this.layout},p.prototype.isOneAncestorOfOther=function(s,o){if(s==null||o==null)throw"assert failed";if(s==o)return!0;for(var v,M=s.getOwner();(v=M.getParent())!=null;){if(v==o)return!0;if((M=v.getOwner())==null)break}for(M=o.getOwner();(v=M.getParent())!=null;){if(v==s)return!0;if((M=v.getOwner())==null)break}return!1},p.prototype.calcLowestCommonAncestors=function(){for(var s,o,v,M,f,u=this.getAllEdges(),r=u.length,h=0;h<r;h++)if(o=(s=u[h]).source,v=s.target,s.lca=null,s.sourceInLca=o,s.targetInLca=v,o!=v){for(M=o.getOwner();s.lca==null;){for(s.targetInLca=v,f=v.getOwner();s.lca==null;){if(f==M){s.lca=f;break}if(f==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=f.getParent(),f=s.targetInLca.getOwner()}if(M==this.rootGraph)break;s.lca==null&&(s.sourceInLca=M.getParent(),M=s.sourceInLca.getOwner())}if(s.lca==null)throw"assert failed"}else s.lca=o.getOwner()},p.prototype.calcLowestCommonAncestor=function(s,o){if(s==o)return s.getOwner();for(var v=s.getOwner();v!=null;){for(var M=o.getOwner();M!=null;){if(M==v)return M;M=M.getParent().getOwner()}v=v.getParent().getOwner()}return v},p.prototype.calcInclusionTreeDepths=function(s,o){var v;s==null&&o==null&&(s=this.rootGraph,o=1);for(var M=s.getNodes(),f=M.length,u=0;u<f;u++)(v=M[u]).inclusionTreeDepth=o,v.child!=null&&this.calcInclusionTreeDepths(v.child,o+1)},p.prototype.includesInvalidEdge=function(){for(var s,o=[],v=this.edges.length,M=0;M<v;M++)s=this.edges[M],this.isOneAncestorOfOther(s.source,s.target)&&o.push(s);for(M=0;M<o.length;M++)this.remove(o[M]);return!1},L.exports=p},function(L,j,P){"use strict";var E=P(12);function w(){}w.calcSeparationAmount=function(p,s,o,v){if(!p.intersects(s))throw"assert failed";var M=new Array(2);this.decideDirectionsForOverlappingNodes(p,s,M),o[0]=Math.min(p.getRight(),s.getRight())-Math.max(p.x,s.x),o[1]=Math.min(p.getBottom(),s.getBottom())-Math.max(p.y,s.y),p.getX()<=s.getX()&&p.getRight()>=s.getRight()?o[0]+=Math.min(s.getX()-p.getX(),p.getRight()-s.getRight()):s.getX()<=p.getX()&&s.getRight()>=p.getRight()&&(o[0]+=Math.min(p.getX()-s.getX(),s.getRight()-p.getRight())),p.getY()<=s.getY()&&p.getBottom()>=s.getBottom()?o[1]+=Math.min(s.getY()-p.getY(),p.getBottom()-s.getBottom()):s.getY()<=p.getY()&&s.getBottom()>=p.getBottom()&&(o[1]+=Math.min(p.getY()-s.getY(),s.getBottom()-p.getBottom()));var f=Math.abs((s.getCenterY()-p.getCenterY())/(s.getCenterX()-p.getCenterX()));s.getCenterY()===p.getCenterY()&&s.getCenterX()===p.getCenterX()&&(f=1);var u=f*o[0],r=o[1]/f;o[0]<r?r=o[0]:u=o[1],o[0]=-1*M[0]*(r/2+v),o[1]=-1*M[1]*(u/2+v)},w.decideDirectionsForOverlappingNodes=function(p,s,o){p.getCenterX()<s.getCenterX()?o[0]=-1:o[0]=1,p.getCenterY()<s.getCenterY()?o[1]=-1:o[1]=1},w.getIntersection2=function(p,s,o){var v=p.getCenterX(),M=p.getCenterY(),f=s.getCenterX(),u=s.getCenterY();if(p.intersects(s))return o[0]=v,o[1]=M,o[2]=f,o[3]=u,!0;var r=p.getX(),h=p.getY(),d=p.getRight(),n=p.getX(),y=p.getBottom(),b=p.getRight(),T=p.getWidthHalf(),I=p.getHeightHalf(),F=s.getX(),X=s.getY(),Z=s.getRight(),ot=s.getX(),dt=s.getBottom(),xt=s.getRight(),re=s.getWidthHalf(),N=s.getHeightHalf(),Q=!1,at=!1;if(v===f){if(M>u)return o[0]=v,o[1]=h,o[2]=f,o[3]=dt,!1;if(M<u)return o[0]=v,o[1]=y,o[2]=f,o[3]=X,!1}else if(M===u){if(v>f)return o[0]=r,o[1]=M,o[2]=Z,o[3]=u,!1;if(v<f)return o[0]=d,o[1]=M,o[2]=F,o[3]=u,!1}else{var _=p.height/p.width,l=s.height/s.width,O=(u-M)/(f-v),z=void 0,lt=void 0,W=void 0,pt=void 0,mt=void 0,Tt=void 0;if(-_===O?v>f?(o[0]=n,o[1]=y,Q=!0):(o[0]=d,o[1]=h,Q=!0):_===O&&(v>f?(o[0]=r,o[1]=h,Q=!0):(o[0]=b,o[1]=y,Q=!0)),-l===O?f>v?(o[2]=ot,o[3]=dt,at=!0):(o[2]=Z,o[3]=X,at=!0):l===O&&(f>v?(o[2]=F,o[3]=X,at=!0):(o[2]=xt,o[3]=dt,at=!0)),Q&&at)return!1;if(v>f?M>u?(z=this.getCardinalDirection(_,O,4),lt=this.getCardinalDirection(l,O,2)):(z=this.getCardinalDirection(-_,O,3),lt=this.getCardinalDirection(-l,O,1)):M>u?(z=this.getCardinalDirection(-_,O,1),lt=this.getCardinalDirection(-l,O,3)):(z=this.getCardinalDirection(_,O,2),lt=this.getCardinalDirection(l,O,4)),!Q)switch(z){case 1:pt=h,W=v+-I/O,o[0]=W,o[1]=pt;break;case 2:W=b,pt=M+T*O,o[0]=W,o[1]=pt;break;case 3:pt=y,W=v+I/O,o[0]=W,o[1]=pt;break;case 4:W=n,pt=M+-T*O,o[0]=W,o[1]=pt}if(!at)switch(lt){case 1:Tt=X,mt=f+-N/O,o[2]=mt,o[3]=Tt;break;case 2:mt=xt,Tt=u+re*O,o[2]=mt,o[3]=Tt;break;case 3:Tt=dt,mt=f+N/O,o[2]=mt,o[3]=Tt;break;case 4:mt=ot,Tt=u+-re*O,o[2]=mt,o[3]=Tt}}return!1},w.getCardinalDirection=function(p,s,o){return p>s?o:1+o%4},w.getIntersection=function(p,s,o,v){if(v==null)return this.getIntersection2(p,s,o);var M,f,u,r,h,d,n,y=p.x,b=p.y,T=s.x,I=s.y,F=o.x,X=o.y,Z=v.x,ot=v.y;return(n=(M=I-b)*(r=F-Z)-(f=ot-X)*(u=y-T))===0?null:new E((u*(d=Z*X-F*ot)-r*(h=T*b-y*I))/n,(f*h-M*d)/n)},w.angleOfVector=function(p,s,o,v){var M=void 0;return p!==o?(M=Math.atan((v-s)/(o-p)),o<p?M+=Math.PI:v<s&&(M+=this.TWO_PI)):M=v<s?this.ONE_AND_HALF_PI:this.HALF_PI,M},w.doIntersect=function(p,s,o,v){var M=p.x,f=p.y,u=s.x,r=s.y,h=o.x,d=o.y,n=v.x,y=v.y,b=(u-M)*(y-d)-(n-h)*(r-f);if(b===0)return!1;var T=((y-d)*(n-M)+(h-n)*(y-f))/b,I=((f-r)*(n-M)+(u-M)*(y-f))/b;return 0<T&&T<1&&0<I&&I<1},w.findCircleLineIntersections=function(p,s,o,v,M,f,u){var r=(o-p)*(o-p)+(v-s)*(v-s),h=2*((p-M)*(o-p)+(s-f)*(v-s)),d=(p-M)*(p-M)+(s-f)*(s-f)-u*u;if(h*h-4*r*d>=0){var n=(-h+Math.sqrt(h*h-4*r*d))/(2*r),y=(-h-Math.sqrt(h*h-4*r*d))/(2*r);return n>=0&&n<=1?[n]:y>=0&&y<=1?[y]:null}return null},w.HALF_PI=.5*Math.PI,w.ONE_AND_HALF_PI=1.5*Math.PI,w.TWO_PI=2*Math.PI,w.THREE_PI=3*Math.PI,L.exports=w},function(L,j,P){"use strict";function E(){}E.sign=function(w){return w>0?1:w<0?-1:0},E.floor=function(w){return w<0?Math.ceil(w):Math.floor(w)},E.ceil=function(w){return w<0?Math.floor(w):Math.ceil(w)},L.exports=E},function(L,j,P){"use strict";function E(){}E.MAX_VALUE=2147483647,E.MIN_VALUE=-2147483648,L.exports=E},function(L,j,P){"use strict";var E=(function(){function v(M,f){for(var u=0;u<f.length;u++){var r=f[u];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(M,r.key,r)}}return function(M,f,u){return f&&v(M.prototype,f),u&&v(M,u),M}})(),w=function(v){return{value:v,next:null,prev:null}},p=function(v,M,f,u){return v!==null?v.next=M:u.head=M,f!==null?f.prev=M:u.tail=M,M.prev=v,M.next=f,u.length++,M},s=function(v,M){var f=v.prev,u=v.next;return f!==null?f.next=u:M.head=u,u!==null?u.prev=f:M.tail=f,v.prev=v.next=null,M.length--,v},o=(function(){function v(M){var f=this;(function(u,r){if(!(u instanceof r))throw new TypeError("Cannot call a class as a function")})(this,v),this.length=0,this.head=null,this.tail=null,M!=null&&M.forEach(function(u){return f.push(u)})}return E(v,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(M,f){return p(f.prev,w(M),f,this)}},{key:"insertAfter",value:function(M,f){return p(f,w(M),f.next,this)}},{key:"insertNodeBefore",value:function(M,f){return p(f.prev,M,f,this)}},{key:"insertNodeAfter",value:function(M,f){return p(f,M,f.next,this)}},{key:"push",value:function(M){return p(this.tail,w(M),null,this)}},{key:"unshift",value:function(M){return p(null,w(M),this.head,this)}},{key:"remove",value:function(M){return s(M,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(M){if(M<=this.length()){for(var f=1,u=this.head;f<M;)u=u.next,f++;return u.value}}},{key:"set_object_at",value:function(M,f){if(M<=this.length()){for(var u=1,r=this.head;u<M;)r=r.next,u++;r.value=f}}}]),v})();L.exports=o},function(L,j,P){"use strict";function E(w,p,s){this.x=null,this.y=null,w==null&&p==null&&s==null?(this.x=0,this.y=0):typeof w=="number"&&typeof p=="number"&&s==null?(this.x=w,this.y=p):w.constructor.name=="Point"&&p==null&&s==null&&(s=w,this.x=s.x,this.y=s.y)}E.prototype.getX=function(){return this.x},E.prototype.getY=function(){return this.y},E.prototype.getLocation=function(){return new E(this.x,this.y)},E.prototype.setLocation=function(w,p,s){w.constructor.name=="Point"&&p==null&&s==null?(s=w,this.setLocation(s.x,s.y)):typeof w=="number"&&typeof p=="number"&&s==null&&(parseInt(w)==w&&parseInt(p)==p?this.move(w,p):(this.x=Math.floor(w+.5),this.y=Math.floor(p+.5)))},E.prototype.move=function(w,p){this.x=w,this.y=p},E.prototype.translate=function(w,p){this.x+=w,this.y+=p},E.prototype.equals=function(w){if(w.constructor.name=="Point"){var p=w;return this.x==p.x&&this.y==p.y}return this==w},E.prototype.toString=function(){return new E().constructor.name+"[x="+this.x+",y="+this.y+"]"},L.exports=E},function(L,j,P){"use strict";function E(w,p,s,o){this.x=0,this.y=0,this.width=0,this.height=0,w!=null&&p!=null&&s!=null&&o!=null&&(this.x=w,this.y=p,this.width=s,this.height=o)}E.prototype.getX=function(){return this.x},E.prototype.setX=function(w){this.x=w},E.prototype.getY=function(){return this.y},E.prototype.setY=function(w){this.y=w},E.prototype.getWidth=function(){return this.width},E.prototype.setWidth=function(w){this.width=w},E.prototype.getHeight=function(){return this.height},E.prototype.setHeight=function(w){this.height=w},E.prototype.getRight=function(){return this.x+this.width},E.prototype.getBottom=function(){return this.y+this.height},E.prototype.intersects=function(w){return!(this.getRight()<w.x)&&!(this.getBottom()<w.y)&&!(w.getRight()<this.x)&&!(w.getBottom()<this.y)},E.prototype.getCenterX=function(){return this.x+this.width/2},E.prototype.getMinX=function(){return this.getX()},E.prototype.getMaxX=function(){return this.getX()+this.width},E.prototype.getCenterY=function(){return this.y+this.height/2},E.prototype.getMinY=function(){return this.getY()},E.prototype.getMaxY=function(){return this.getY()+this.height},E.prototype.getWidthHalf=function(){return this.width/2},E.prototype.getHeightHalf=function(){return this.height/2},L.exports=E},function(L,j,P){"use strict";var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p};function w(){}w.lastID=0,w.createID=function(p){return w.isPrimitive(p)?p:(p.uniqueID!=null||(p.uniqueID=w.getString(),w.lastID++),p.uniqueID)},w.getString=function(p){return p==null&&(p=w.lastID),"Object#"+p},w.isPrimitive=function(p){var s=p===void 0?"undefined":E(p);return p==null||s!="object"&&s!="function"},L.exports=w},function(L,j,P){"use strict";function E(h){if(Array.isArray(h)){for(var d=0,n=Array(h.length);d<h.length;d++)n[d]=h[d];return n}return Array.from(h)}var w=P(0),p=P(7),s=P(3),o=P(1),v=P(6),M=P(5),f=P(17),u=P(29);function r(h){u.call(this),this.layoutQuality=w.QUALITY,this.createBendsAsNeeded=w.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=w.DEFAULT_INCREMENTAL,this.animationOnLayout=w.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=w.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=w.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=w.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new p(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,h!=null&&(this.isRemoteUse=h)}r.RANDOM_SEED=1,r.prototype=Object.create(u.prototype),r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},r.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},r.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},r.prototype.newGraphManager=function(){var h=new p(this);return this.graphManager=h,h},r.prototype.newGraph=function(h){return new v(null,this.graphManager,h)},r.prototype.newNode=function(h){return new s(this.graphManager,h)},r.prototype.newEdge=function(h){return new o(null,null,h)},r.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},r.prototype.runLayout=function(){var h;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),h=!this.checkLayoutSuccess()&&this.layout(),w.ANIMATE!=="during"&&(h&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,h)},r.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},r.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var h=this.graphManager.getAllEdges(),d=0;d<h.length;d++)h[d];var n=this.graphManager.getRoot().getNodes();for(d=0;d<n.length;d++)n[d];this.update(this.graphManager.getRoot())}},r.prototype.update=function(h){if(h==null)this.update2();else if(h instanceof s){var d=h;if(d.getChild()!=null)for(var n=d.getChild().getNodes(),y=0;y<n.length;y++)update(n[y]);d.vGraphObject!=null&&d.vGraphObject.update(d)}else if(h instanceof o){var b=h;b.vGraphObject!=null&&b.vGraphObject.update(b)}else if(h instanceof v){var T=h;T.vGraphObject!=null&&T.vGraphObject.update(T)}},r.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=w.QUALITY,this.animationDuringLayout=w.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=w.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=w.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=w.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=w.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=w.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},r.prototype.transform=function(h){if(h==null)this.transform(new M(0,0));else{var d=new f,n=this.graphManager.getRoot().updateLeftTop();if(n!=null){d.setWorldOrgX(h.x),d.setWorldOrgY(h.y),d.setDeviceOrgX(n.x),d.setDeviceOrgY(n.y);for(var y=this.getAllNodes(),b=0;b<y.length;b++)y[b].transform(d)}}},r.prototype.positionNodesRandomly=function(h){if(h==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var d,n,y=h.getNodes(),b=0;b<y.length;b++)(n=(d=y[b]).getChild())==null||n.getNodes().length==0?d.scatter():(this.positionNodesRandomly(n),d.updateBounds())},r.prototype.getFlatForest=function(){for(var h=[],d=!0,n=this.graphManager.getRoot().getNodes(),y=!0,b=0;b<n.length;b++)n[b].getChild()!=null&&(y=!1);if(!y)return h;var T=new Set,I=[],F=new Map,X=[];for(X=X.concat(n);X.length>0&&d;){for(I.push(X[0]);I.length>0&&d;){var Z=I[0];I.splice(0,1),T.add(Z);var ot=Z.getEdges();for(b=0;b<ot.length;b++){var dt=ot[b].getOtherEnd(Z);if(F.get(Z)!=dt){if(T.has(dt)){d=!1;break}I.push(dt),F.set(dt,Z)}}}if(d){var xt=[].concat(E(T));for(h.push(xt),b=0;b<xt.length;b++){var re=xt[b],N=X.indexOf(re);N>-1&&X.splice(N,1)}T=new Set,F=new Map}else h=[]}return h},r.prototype.createDummyNodesForBendpoints=function(h){for(var d=[],n=h.source,y=this.graphManager.calcLowestCommonAncestor(h.source,h.target),b=0;b<h.bendpoints.length;b++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),y.add(T);var I=this.newEdge(null);this.graphManager.add(I,n,T),d.add(T),n=T}return I=this.newEdge(null),this.graphManager.add(I,n,h.target),this.edgeToDummyNodes.set(h,d),h.isInterGraph()?this.graphManager.remove(h):y.remove(h),d},r.prototype.createBendpointsFromDummyNodes=function(){var h=[];h=h.concat(this.graphManager.getAllEdges()),h=[].concat(E(this.edgeToDummyNodes.keys())).concat(h);for(var d=0;d<h.length;d++){var n=h[d];if(n.bendpoints.length>0){for(var y=this.edgeToDummyNodes.get(n),b=0;b<y.length;b++){var T=y[b],I=new M(T.getCenterX(),T.getCenterY()),F=n.bendpoints.get(b);F.x=I.x,F.y=I.y,T.getOwner().remove(T)}this.graphManager.add(n,n.source,n.target)}}},r.transform=function(h,d,n,y){if(n!=null&&y!=null){var b=d;return h<=50?b-=(d-d/n)/50*(50-h):b+=(d*y-d)/50*(h-50),b}var T,I;return h<=50?(T=9*d/500,I=d/10):(T=9*d/50,I=-8*d),T*h+I},r.findCenterOfTree=function(h){var d=[];d=d.concat(h);var n=[],y=new Map,b=!1,T=null;d.length!=1&&d.length!=2||(b=!0,T=d[0]);for(var I=0;I<d.length;I++){var F=(ot=d[I]).getNeighborsList().size;y.set(ot,ot.getNeighborsList().size),F==1&&n.push(ot)}var X=[];for(X=X.concat(n);!b;){var Z=[];for(Z=Z.concat(X),X=[],I=0;I<d.length;I++){var ot=d[I],dt=d.indexOf(ot);dt>=0&&d.splice(dt,1),ot.getNeighborsList().forEach(function(xt){if(n.indexOf(xt)<0){var re=y.get(xt)-1;re==1&&X.push(xt),y.set(xt,re)}})}n=n.concat(X),d.length!=1&&d.length!=2||(b=!0,T=d[0])}return T},r.prototype.setGraphManager=function(h){this.graphManager=h},L.exports=r},function(L,j,P){"use strict";function E(){}E.seed=1,E.x=0,E.nextDouble=function(){return E.x=1e4*Math.sin(E.seed++),E.x-Math.floor(E.x)},L.exports=E},function(L,j,P){"use strict";var E=P(5);function w(p,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}w.prototype.getWorldOrgX=function(){return this.lworldOrgX},w.prototype.setWorldOrgX=function(p){this.lworldOrgX=p},w.prototype.getWorldOrgY=function(){return this.lworldOrgY},w.prototype.setWorldOrgY=function(p){this.lworldOrgY=p},w.prototype.getWorldExtX=function(){return this.lworldExtX},w.prototype.setWorldExtX=function(p){this.lworldExtX=p},w.prototype.getWorldExtY=function(){return this.lworldExtY},w.prototype.setWorldExtY=function(p){this.lworldExtY=p},w.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},w.prototype.setDeviceOrgX=function(p){this.ldeviceOrgX=p},w.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},w.prototype.setDeviceOrgY=function(p){this.ldeviceOrgY=p},w.prototype.getDeviceExtX=function(){return this.ldeviceExtX},w.prototype.setDeviceExtX=function(p){this.ldeviceExtX=p},w.prototype.getDeviceExtY=function(){return this.ldeviceExtY},w.prototype.setDeviceExtY=function(p){this.ldeviceExtY=p},w.prototype.transformX=function(p){var s=0,o=this.lworldExtX;return o!=0&&(s=this.ldeviceOrgX+(p-this.lworldOrgX)*this.ldeviceExtX/o),s},w.prototype.transformY=function(p){var s=0,o=this.lworldExtY;return o!=0&&(s=this.ldeviceOrgY+(p-this.lworldOrgY)*this.ldeviceExtY/o),s},w.prototype.inverseTransformX=function(p){var s=0,o=this.ldeviceExtX;return o!=0&&(s=this.lworldOrgX+(p-this.ldeviceOrgX)*this.lworldExtX/o),s},w.prototype.inverseTransformY=function(p){var s=0,o=this.ldeviceExtY;return o!=0&&(s=this.lworldOrgY+(p-this.ldeviceOrgY)*this.lworldExtY/o),s},w.prototype.inverseTransformPoint=function(p){return new E(this.inverseTransformX(p.x),this.inverseTransformY(p.y))},L.exports=w},function(L,j,P){"use strict";var E=P(15),w=P(4),p=P(0),s=P(8),o=P(9);function v(){E.call(this),this.useSmartIdealEdgeLengthCalculation=w.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=w.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=w.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=w.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=w.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*w.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=w.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=w.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=w.MAX_ITERATIONS}for(var M in v.prototype=Object.create(E.prototype),E)v[M]=E[M];v.prototype.initParameters=function(){E.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=w.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},v.prototype.calcIdealEdgeLengths=function(){for(var f,u,r,h,d,n,y,b=this.getGraphManager().getAllEdges(),T=0;T<b.length;T++)u=(f=b[T]).idealLength,f.isInterGraph&&(h=f.getSource(),d=f.getTarget(),n=f.getSourceInLca().getEstimatedSize(),y=f.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(f.idealLength+=n+y-2*p.SIMPLE_NODE_SIZE),r=f.getLca().getInclusionTreeDepth(),f.idealLength+=u*w.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(h.getInclusionTreeDepth()+d.getInclusionTreeDepth()-2*r))},v.prototype.initSpringEmbedder=function(){var f=this.getAllNodes().length;this.incremental?(f>w.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*w.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(f-w.ADAPTATION_LOWER_NODE_LIMIT)/(w.ADAPTATION_UPPER_NODE_LIMIT-w.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-w.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=w.MAX_NODE_DISPLACEMENT_INCREMENTAL):(f>w.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(w.COOLING_ADAPTATION_FACTOR,1-(f-w.ADAPTATION_LOWER_NODE_LIMIT)/(w.ADAPTATION_UPPER_NODE_LIMIT-w.ADAPTATION_LOWER_NODE_LIMIT)*(1-w.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=w.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*w.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},v.prototype.calcSpringForces=function(){for(var f,u=this.getAllEdges(),r=0;r<u.length;r++)f=u[r],this.calcSpringForce(f,f.idealLength)},v.prototype.calcRepulsionForces=function(){var f,u,r,h,d,n=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],y=arguments.length>1&&arguments[1]!==void 0&&arguments[1],b=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%w.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),d=new Set,f=0;f<b.length;f++)r=b[f],this.calculateRepulsionForceOfANode(r,d,n,y),d.add(r);else for(f=0;f<b.length;f++)for(r=b[f],u=f+1;u<b.length;u++)h=b[u],r.getOwner()==h.getOwner()&&this.calcRepulsionForce(r,h)},v.prototype.calcGravitationalForces=function(){for(var f,u=this.getAllNodesToApplyGravitation(),r=0;r<u.length;r++)f=u[r],this.calcGravitationalForce(f)},v.prototype.moveNodes=function(){for(var f=this.getAllNodes(),u=0;u<f.length;u++)f[u].move()},v.prototype.calcSpringForce=function(f,u){var r,h,d,n,y=f.getSource(),b=f.getTarget();if(this.uniformLeafNodeSizes&&y.getChild()==null&&b.getChild()==null)f.updateLengthSimple();else if(f.updateLength(),f.isOverlapingSourceAndTarget)return;(r=f.getLength())!=0&&(d=(h=f.edgeElasticity*(r-u))*(f.lengthX/r),n=h*(f.lengthY/r),y.springForceX+=d,y.springForceY+=n,b.springForceX-=d,b.springForceY-=n)},v.prototype.calcRepulsionForce=function(f,u){var r,h,d,n,y,b,T,I=f.getRect(),F=u.getRect(),X=new Array(2),Z=new Array(4);if(I.intersects(F)){s.calcSeparationAmount(I,F,X,w.DEFAULT_EDGE_LENGTH/2),b=2*X[0],T=2*X[1];var ot=f.noOfChildren*u.noOfChildren/(f.noOfChildren+u.noOfChildren);f.repulsionForceX-=ot*b,f.repulsionForceY-=ot*T,u.repulsionForceX+=ot*b,u.repulsionForceY+=ot*T}else this.uniformLeafNodeSizes&&f.getChild()==null&&u.getChild()==null?(r=F.getCenterX()-I.getCenterX(),h=F.getCenterY()-I.getCenterY()):(s.getIntersection(I,F,Z),r=Z[2]-Z[0],h=Z[3]-Z[1]),Math.abs(r)<w.MIN_REPULSION_DIST&&(r=o.sign(r)*w.MIN_REPULSION_DIST),Math.abs(h)<w.MIN_REPULSION_DIST&&(h=o.sign(h)*w.MIN_REPULSION_DIST),d=r*r+h*h,n=Math.sqrt(d),b=(y=(f.nodeRepulsion/2+u.nodeRepulsion/2)*f.noOfChildren*u.noOfChildren/d)*r/n,T=y*h/n,f.repulsionForceX-=b,f.repulsionForceY-=T,u.repulsionForceX+=b,u.repulsionForceY+=T},v.prototype.calcGravitationalForce=function(f){var u,r,h,d,n,y,b,T;r=((u=f.getOwner()).getRight()+u.getLeft())/2,h=(u.getTop()+u.getBottom())/2,d=f.getCenterX()-r,n=f.getCenterY()-h,y=Math.abs(d)+f.getWidth()/2,b=Math.abs(n)+f.getHeight()/2,f.getOwner()==this.graphManager.getRoot()?(y>(T=u.getEstimatedSize()*this.gravityRangeFactor)||b>T)&&(f.gravitationForceX=-this.gravityConstant*d,f.gravitationForceY=-this.gravityConstant*n):(y>(T=u.getEstimatedSize()*this.compoundGravityRangeFactor)||b>T)&&(f.gravitationForceX=-this.gravityConstant*d*this.compoundGravityConstant,f.gravitationForceY=-this.gravityConstant*n*this.compoundGravityConstant)},v.prototype.isConverged=function(){var f,u=!1;return this.totalIterations>this.maxIterations/3&&(u=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),f=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,f||u},v.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},v.prototype.calcNoOfChildrenForAllNodes=function(){for(var f,u=this.graphManager.getAllNodes(),r=0;r<u.length;r++)(f=u[r]).noOfChildren=f.getNoOfChildren()},v.prototype.calcGrid=function(f){var u,r;u=parseInt(Math.ceil((f.getRight()-f.getLeft())/this.repulsionRange)),r=parseInt(Math.ceil((f.getBottom()-f.getTop())/this.repulsionRange));for(var h=new Array(u),d=0;d<u;d++)h[d]=new Array(r);for(d=0;d<u;d++)for(var n=0;n<r;n++)h[d][n]=new Array;return h},v.prototype.addNodeToGrid=function(f,u,r){var h,d,n,y;h=parseInt(Math.floor((f.getRect().x-u)/this.repulsionRange)),d=parseInt(Math.floor((f.getRect().width+f.getRect().x-u)/this.repulsionRange)),n=parseInt(Math.floor((f.getRect().y-r)/this.repulsionRange)),y=parseInt(Math.floor((f.getRect().height+f.getRect().y-r)/this.repulsionRange));for(var b=h;b<=d;b++)for(var T=n;T<=y;T++)this.grid[b][T].push(f),f.setGridCoordinates(h,d,n,y)},v.prototype.updateGrid=function(){var f,u,r=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),f=0;f<r.length;f++)u=r[f],this.addNodeToGrid(u,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},v.prototype.calculateRepulsionForceOfANode=function(f,u,r,h){if(this.totalIterations%w.GRID_CALCULATION_CHECK_PERIOD==1&&r||h){var d,n=new Set;f.surrounding=new Array;for(var y=this.grid,b=f.startX-1;b<f.finishX+2;b++)for(var T=f.startY-1;T<f.finishY+2;T++)if(!(b<0||T<0||b>=y.length||T>=y[0].length)){for(var I=0;I<y[b][T].length;I++)if(d=y[b][T][I],f.getOwner()==d.getOwner()&&f!=d&&!u.has(d)&&!n.has(d)){var F=Math.abs(f.getCenterX()-d.getCenterX())-(f.getWidth()/2+d.getWidth()/2),X=Math.abs(f.getCenterY()-d.getCenterY())-(f.getHeight()/2+d.getHeight()/2);F<=this.repulsionRange&&X<=this.repulsionRange&&n.add(d)}}f.surrounding=[].concat((function(Z){if(Array.isArray(Z)){for(var ot=0,dt=Array(Z.length);ot<Z.length;ot++)dt[ot]=Z[ot];return dt}return Array.from(Z)})(n))}for(b=0;b<f.surrounding.length;b++)this.calcRepulsionForce(f,f.surrounding[b])},v.prototype.calcRepulsionRange=function(){return 0},L.exports=v},function(L,j,P){"use strict";var E=P(1),w=P(4);function p(o,v,M){E.call(this,o,v,M),this.idealLength=w.DEFAULT_EDGE_LENGTH,this.edgeElasticity=w.DEFAULT_SPRING_STRENGTH}for(var s in p.prototype=Object.create(E.prototype),E)p[s]=E[s];L.exports=p},function(L,j,P){"use strict";var E=P(3),w=P(4);function p(o,v,M,f){E.call(this,o,v,M,f),this.nodeRepulsion=w.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var s in p.prototype=Object.create(E.prototype),E)p[s]=E[s];p.prototype.setGridCoordinates=function(o,v,M,f){this.startX=o,this.finishX=v,this.startY=M,this.finishY=f},L.exports=p},function(L,j,P){"use strict";function E(w,p){this.width=0,this.height=0,w!==null&&p!==null&&(this.height=p,this.width=w)}E.prototype.getWidth=function(){return this.width},E.prototype.setWidth=function(w){this.width=w},E.prototype.getHeight=function(){return this.height},E.prototype.setHeight=function(w){this.height=w},L.exports=E},function(L,j,P){"use strict";var E=P(14);function w(){this.map={},this.keys=[]}w.prototype.put=function(p,s){var o=E.createID(p);this.contains(o)||(this.map[o]=s,this.keys.push(p))},w.prototype.contains=function(p){return E.createID(p),this.map[p]!=null},w.prototype.get=function(p){var s=E.createID(p);return this.map[s]},w.prototype.keySet=function(){return this.keys},L.exports=w},function(L,j,P){"use strict";var E=P(14);function w(){this.set={}}w.prototype.add=function(p){var s=E.createID(p);this.contains(s)||(this.set[s]=p)},w.prototype.remove=function(p){delete this.set[E.createID(p)]},w.prototype.clear=function(){this.set={}},w.prototype.contains=function(p){return this.set[E.createID(p)]==p},w.prototype.isEmpty=function(){return this.size()===0},w.prototype.size=function(){return Object.keys(this.set).length},w.prototype.addAllTo=function(p){for(var s=Object.keys(this.set),o=s.length,v=0;v<o;v++)p.push(this.set[s[v]])},w.prototype.size=function(){return Object.keys(this.set).length},w.prototype.addAll=function(p){for(var s=p.length,o=0;o<s;o++){var v=p[o];this.add(v)}},L.exports=w},function(L,j,P){"use strict";function E(){}E.multMat=function(w,p){for(var s=[],o=0;o<w.length;o++){s[o]=[];for(var v=0;v<p[0].length;v++){s[o][v]=0;for(var M=0;M<w[0].length;M++)s[o][v]+=w[o][M]*p[M][v]}}return s},E.transpose=function(w){for(var p=[],s=0;s<w[0].length;s++){p[s]=[];for(var o=0;o<w.length;o++)p[s][o]=w[o][s]}return p},E.multCons=function(w,p){for(var s=[],o=0;o<w.length;o++)s[o]=w[o]*p;return s},E.minusOp=function(w,p){for(var s=[],o=0;o<w.length;o++)s[o]=w[o]-p[o];return s},E.dotProduct=function(w,p){for(var s=0,o=0;o<w.length;o++)s+=w[o]*p[o];return s},E.mag=function(w){return Math.sqrt(this.dotProduct(w,w))},E.normalize=function(w){for(var p=[],s=this.mag(w),o=0;o<w.length;o++)p[o]=w[o]/s;return p},E.multGamma=function(w){for(var p=[],s=0,o=0;o<w.length;o++)s+=w[o];s*=-1/w.length;for(var v=0;v<w.length;v++)p[v]=s+w[v];return p},E.multL=function(w,p,s){for(var o=[],v=[],M=[],f=0;f<p[0].length;f++){for(var u=0,r=0;r<p.length;r++)u+=-.5*p[r][f]*w[r];v[f]=u}for(var h=0;h<s.length;h++){for(var d=0,n=0;n<s.length;n++)d+=s[h][n]*v[n];M[h]=d}for(var y=0;y<p.length;y++){for(var b=0,T=0;T<p[0].length;T++)b+=p[y][T]*M[T];o[y]=b}return o},L.exports=E},function(L,j,P){"use strict";var E=(function(){function s(o,v){for(var M=0;M<v.length;M++){var f=v[M];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(o,f.key,f)}}return function(o,v,M){return v&&s(o.prototype,v),M&&s(o,M),o}})(),w=P(11),p=(function(){function s(o,v){(function(f,u){if(!(f instanceof u))throw new TypeError("Cannot call a class as a function")})(this,s),v===null&&v===void 0||(this.compareFunction=this._defaultCompareFunction);var M=void 0;M=o instanceof w?o.size():o.length,this._quicksort(o,0,M-1)}return E(s,[{key:"_quicksort",value:function(o,v,M){if(v<M){var f=this._partition(o,v,M);this._quicksort(o,v,f),this._quicksort(o,f+1,M)}}},{key:"_partition",value:function(o,v,M){for(var f=this._get(o,v),u=v,r=M;;){for(;this.compareFunction(f,this._get(o,r));)r--;for(;this.compareFunction(this._get(o,u),f);)u++;if(!(u<r))return r;this._swap(o,u,r),u++,r--}}},{key:"_get",value:function(o,v){return o instanceof w?o.get_object_at(v):o[v]}},{key:"_set",value:function(o,v,M){o instanceof w?o.set_object_at(v,M):o[v]=M}},{key:"_swap",value:function(o,v,M){var f=this._get(o,v);this._set(o,v,this._get(o,M)),this._set(o,M,f)}},{key:"_defaultCompareFunction",value:function(o,v){return v>o}}]),s})();L.exports=p},function(L,j,P){"use strict";function E(){}E.svd=function(w){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=w.length,this.n=w[0].length;var p=Math.min(this.m,this.n);this.s=(function(ra){for(var Dr=[];ra-- >0;)Dr.push(0);return Dr})(Math.min(this.m+1,this.n)),this.U=(function ra(Dr){if(Dr.length==0)return 0;for(var la=[],qr=0;qr<Dr[0];qr++)la.push(ra(Dr.slice(1)));return la})([this.m,p]),this.V=(function(ra){return(function Dr(la){if(la.length==0)return 0;for(var qr=[],ma=0;ma<la[0];ma++)qr.push(Dr(la.slice(1)));return qr})(ra)})([this.n,this.n]);for(var s=(function(ra){for(var Dr=[];ra-- >0;)Dr.push(0);return Dr})(this.n),o=(function(ra){for(var Dr=[];ra-- >0;)Dr.push(0);return Dr})(this.m),v=Math.min(this.m-1,this.n),M=Math.max(0,Math.min(this.n-2,this.m)),f=0;f<Math.max(v,M);f++){if(f<v){this.s[f]=0;for(var u=f;u<this.m;u++)this.s[f]=E.hypot(this.s[f],w[u][f]);if(this.s[f]!==0){w[f][f]<0&&(this.s[f]=-this.s[f]);for(var r=f;r<this.m;r++)w[r][f]/=this.s[f];w[f][f]+=1}this.s[f]=-this.s[f]}for(var h=f+1;h<this.n;h++){if((function(ra,Dr){return ra&&Dr})(f<v,this.s[f]!==0)){for(var d=0,n=f;n<this.m;n++)d+=w[n][f]*w[n][h];d=-d/w[f][f];for(var y=f;y<this.m;y++)w[y][h]+=d*w[y][f]}s[h]=w[f][h]}if((function(ra,Dr){return Dr})(0,f<v))for(var b=f;b<this.m;b++)this.U[b][f]=w[b][f];if(f<M){s[f]=0;for(var T=f+1;T<this.n;T++)s[f]=E.hypot(s[f],s[T]);if(s[f]!==0){s[f+1]<0&&(s[f]=-s[f]);for(var I=f+1;I<this.n;I++)s[I]/=s[f];s[f+1]+=1}if(s[f]=-s[f],(function(ra,Dr){return ra&&Dr})(f+1<this.m,s[f]!==0)){for(var F=f+1;F<this.m;F++)o[F]=0;for(var X=f+1;X<this.n;X++)for(var Z=f+1;Z<this.m;Z++)o[Z]+=s[X]*w[Z][X];for(var ot=f+1;ot<this.n;ot++)for(var dt=-s[ot]/s[f+1],xt=f+1;xt<this.m;xt++)w[xt][ot]+=dt*o[xt]}for(var re=f+1;re<this.n;re++)this.V[re][f]=s[re]}}var N=Math.min(this.n,this.m+1);v<this.n&&(this.s[v]=w[v][v]),this.m<N&&(this.s[N-1]=0),M+1<N&&(s[M]=w[M][N-1]),s[N-1]=0;for(var Q=v;Q<p;Q++){for(var at=0;at<this.m;at++)this.U[at][Q]=0;this.U[Q][Q]=1}for(var _=v-1;_>=0;_--)if(this.s[_]!==0){for(var l=_+1;l<p;l++){for(var O=0,z=_;z<this.m;z++)O+=this.U[z][_]*this.U[z][l];O=-O/this.U[_][_];for(var lt=_;lt<this.m;lt++)this.U[lt][l]+=O*this.U[lt][_]}for(var W=_;W<this.m;W++)this.U[W][_]=-this.U[W][_];this.U[_][_]=1+this.U[_][_];for(var pt=0;pt<_-1;pt++)this.U[pt][_]=0}else{for(var mt=0;mt<this.m;mt++)this.U[mt][_]=0;this.U[_][_]=1}for(var Tt=this.n-1;Tt>=0;Tt--){if((function(ra,Dr){return ra&&Dr})(Tt<M,s[Tt]!==0))for(var Rt=Tt+1;Rt<p;Rt++){for(var It=0,te=Tt+1;te<this.n;te++)It+=this.V[te][Tt]*this.V[te][Rt];It=-It/this.V[Tt+1][Tt];for(var Qt=Tt+1;Qt<this.n;Qt++)this.V[Qt][Rt]+=It*this.V[Qt][Tt]}for(var pe=0;pe<this.n;pe++)this.V[pe][Tt]=0;this.V[Tt][Tt]=1}for(var ue=N-1,me=Math.pow(2,-52),Ee=Math.pow(2,-966);N>0;){var xe=void 0,ar=void 0;for(xe=N-2;xe>=-1&&xe!==-1;xe--)if(Math.abs(s[xe])<=Ee+me*(Math.abs(this.s[xe])+Math.abs(this.s[xe+1]))){s[xe]=0;break}if(xe===N-2)ar=4;else{var xr=void 0;for(xr=N-1;xr>=xe&&xr!==xe;xr--){var sr=(xr!==N?Math.abs(s[xr]):0)+(xr!==xe+1?Math.abs(s[xr-1]):0);if(Math.abs(this.s[xr])<=Ee+me*sr){this.s[xr]=0;break}}xr===xe?ar=3:xr===N-1?ar=1:(ar=2,xe=xr)}switch(xe++,ar){case 1:var Qe=s[N-2];s[N-2]=0;for(var or=N-2;or>=xe;or--){var Wr=E.hypot(this.s[or],Qe),oa=this.s[or]/Wr,Sr=Qe/Wr;this.s[or]=Wr,or!==xe&&(Qe=-Sr*s[or-1],s[or-1]=oa*s[or-1]);for(var Rr=0;Rr<this.n;Rr++)Wr=oa*this.V[Rr][or]+Sr*this.V[Rr][N-1],this.V[Rr][N-1]=-Sr*this.V[Rr][or]+oa*this.V[Rr][N-1],this.V[Rr][or]=Wr}break;case 2:var Mr=s[xe-1];s[xe-1]=0;for(var er=xe;er<N;er++){var Xr=E.hypot(this.s[er],Mr),Kr=this.s[er]/Xr,Ur=Mr/Xr;this.s[er]=Xr,Mr=-Ur*s[er],s[er]=Kr*s[er];for(var Jr=0;Jr<this.m;Jr++)Xr=Kr*this.U[Jr][er]+Ur*this.U[Jr][xe-1],this.U[Jr][xe-1]=-Ur*this.U[Jr][er]+Kr*this.U[Jr][xe-1],this.U[Jr][er]=Xr}break;case 3:var Yr=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[N-1]),Math.abs(this.s[N-2])),Math.abs(s[N-2])),Math.abs(this.s[xe])),Math.abs(s[xe])),ke=this.s[N-1]/Yr,ze=this.s[N-2]/Yr,lr=s[N-2]/Yr,ir=this.s[xe]/Yr,ur=s[xe]/Yr,zr=((ze+ke)*(ze-ke)+lr*lr)/2,cr=ke*lr*(ke*lr),Nr=0;(function(ra,Dr){return ra||Dr})(zr!==0,cr!==0)&&(Nr=Math.sqrt(zr*zr+cr),zr<0&&(Nr=-Nr),Nr=cr/(zr+Nr));for(var Fr=(ir+ke)*(ir-ke)+Nr,sa=ir*ur,yr=xe;yr<N-1;yr++){var kr=E.hypot(Fr,sa),pr=Fr/kr,rr=sa/kr;yr!==xe&&(s[yr-1]=kr),Fr=pr*this.s[yr]+rr*s[yr],s[yr]=pr*s[yr]-rr*this.s[yr],sa=rr*this.s[yr+1],this.s[yr+1]=pr*this.s[yr+1];for(var Pr=0;Pr<this.n;Pr++)kr=pr*this.V[Pr][yr]+rr*this.V[Pr][yr+1],this.V[Pr][yr+1]=-rr*this.V[Pr][yr]+pr*this.V[Pr][yr+1],this.V[Pr][yr]=kr;if(pr=Fr/(kr=E.hypot(Fr,sa)),rr=sa/kr,this.s[yr]=kr,Fr=pr*s[yr]+rr*this.s[yr+1],this.s[yr+1]=-rr*s[yr]+pr*this.s[yr+1],sa=rr*s[yr+1],s[yr+1]=pr*s[yr+1],yr<this.m-1)for(var ta=0;ta<this.m;ta++)kr=pr*this.U[ta][yr]+rr*this.U[ta][yr+1],this.U[ta][yr+1]=-rr*this.U[ta][yr]+pr*this.U[ta][yr+1],this.U[ta][yr]=kr}s[N-2]=Fr;break;case 4:if(this.s[xe]<=0){this.s[xe]=this.s[xe]<0?-this.s[xe]:0;for(var wr=0;wr<=ue;wr++)this.V[wr][xe]=-this.V[wr][xe]}for(;xe<ue&&!(this.s[xe]>=this.s[xe+1]);){var Sa=this.s[xe];if(this.s[xe]=this.s[xe+1],this.s[xe+1]=Sa,xe<this.n-1)for(var ca=0;ca<this.n;ca++)Sa=this.V[ca][xe+1],this.V[ca][xe+1]=this.V[ca][xe],this.V[ca][xe]=Sa;if(xe<this.m-1)for(var ba=0;ba<this.m;ba++)Sa=this.U[ba][xe+1],this.U[ba][xe+1]=this.U[ba][xe],this.U[ba][xe]=Sa;xe++}N--}}return{U:this.U,V:this.V,S:this.s}},E.hypot=function(w,p){var s=void 0;return Math.abs(w)>Math.abs(p)?(s=p/w,s=Math.abs(w)*Math.sqrt(1+s*s)):p!=0?(s=w/p,s=Math.abs(p)*Math.sqrt(1+s*s)):s=0,s},L.exports=E},function(L,j,P){"use strict";var E=(function(){function p(s,o){for(var v=0;v<o.length;v++){var M=o[v];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(s,M.key,M)}}return function(s,o,v){return o&&p(s.prototype,o),v&&p(s,v),s}})(),w=(function(){function p(s,o){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;(function(n,y){if(!(n instanceof y))throw new TypeError("Cannot call a class as a function")})(this,p),this.sequence1=s,this.sequence2=o,this.match_score=v,this.mismatch_penalty=M,this.gap_penalty=f,this.iMax=s.length+1,this.jMax=o.length+1,this.grid=new Array(this.iMax);for(var u=0;u<this.iMax;u++){this.grid[u]=new Array(this.jMax);for(var r=0;r<this.jMax;r++)this.grid[u][r]=0}this.tracebackGrid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=new Array(this.jMax);for(var d=0;d<this.jMax;d++)this.tracebackGrid[h][d]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return E(p,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var s=1;s<this.jMax;s++)this.grid[0][s]=this.grid[0][s-1]+this.gap_penalty,this.tracebackGrid[0][s]=[!1,!1,!0];for(var o=1;o<this.iMax;o++)this.grid[o][0]=this.grid[o-1][0]+this.gap_penalty,this.tracebackGrid[o][0]=[!1,!0,!1];for(var v=1;v<this.iMax;v++)for(var M=1;M<this.jMax;M++){var f=[this.sequence1[v-1]===this.sequence2[M-1]?this.grid[v-1][M-1]+this.match_score:this.grid[v-1][M-1]+this.mismatch_penalty,this.grid[v-1][M]+this.gap_penalty,this.grid[v][M-1]+this.gap_penalty],u=this.arrayAllMaxIndexes(f);this.grid[v][M]=f[u[0]],this.tracebackGrid[v][M]=[u.includes(0),u.includes(1),u.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var s=[];for(s.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});s[0];){var o=s[0],v=this.tracebackGrid[o.pos[0]][o.pos[1]];v[0]&&s.push({pos:[o.pos[0]-1,o.pos[1]-1],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2}),v[1]&&s.push({pos:[o.pos[0]-1,o.pos[1]],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:"-"+o.seq2}),v[2]&&s.push({pos:[o.pos[0],o.pos[1]-1],seq1:"-"+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2}),o.pos[0]===0&&o.pos[1]===0&&this.alignments.push({sequence1:o.seq1,sequence2:o.seq2}),s.shift()}return this.alignments}},{key:"getAllIndexes",value:function(s,o){for(var v=[],M=-1;(M=s.indexOf(o,M+1))!==-1;)v.push(M);return v}},{key:"arrayAllMaxIndexes",value:function(s){return this.getAllIndexes(s,Math.max.apply(null,s))}}]),p})();L.exports=w},function(L,j,P){"use strict";var E=function(){};E.FDLayout=P(18),E.FDLayoutConstants=P(4),E.FDLayoutEdge=P(19),E.FDLayoutNode=P(20),E.DimensionD=P(21),E.HashMap=P(22),E.HashSet=P(23),E.IGeometry=P(8),E.IMath=P(9),E.Integer=P(10),E.Point=P(12),E.PointD=P(5),E.RandomSeed=P(16),E.RectangleD=P(13),E.Transform=P(17),E.UniqueIDGeneretor=P(14),E.Quicksort=P(25),E.LinkedList=P(11),E.LGraphObject=P(2),E.LGraph=P(6),E.LEdge=P(1),E.LGraphManager=P(7),E.LNode=P(3),E.Layout=P(15),E.LayoutConstants=P(0),E.NeedlemanWunsch=P(27),E.Matrix=P(24),E.SVD=P(26),L.exports=E},function(L,j,P){"use strict";function E(){this.listeners=[]}var w=E.prototype;w.addListener=function(p,s){this.listeners.push({event:p,callback:s})},w.removeListener=function(p,s){for(var o=this.listeners.length;o>=0;o--){var v=this.listeners[o];v.event===p&&v.callback===s&&this.listeners.splice(o,1)}},w.emit=function(p,s){for(var o=0;o<this.listeners.length;o++){var v=this.listeners[o];p===v.event&&v.callback(s)}},L.exports=E}])});(function(L,j){typeof exports=="object"&&typeof module=="object"?module.exports=j("layout-base"):typeof define=="function"&&define.amd?define(["layout-base"],j):typeof exports=="object"?exports.coseBase=j("layout-base"):L.coseBase=j(L.layoutBase)})(Gi,function(L){return(()=>{"use strict";var j={45:(w,p,s)=>{var o={};o.layoutBase=s(551),o.CoSEConstants=s(806),o.CoSEEdge=s(767),o.CoSEGraph=s(880),o.CoSEGraphManager=s(578),o.CoSELayout=s(765),o.CoSENode=s(991),o.ConstraintHandler=s(902),w.exports=o},806:(w,p,s)=>{var o=s(551).FDLayoutConstants;function v(){}for(var M in o)v[M]=o[M];v.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,v.DEFAULT_RADIAL_SEPARATION=o.DEFAULT_EDGE_LENGTH,v.DEFAULT_COMPONENT_SEPERATION=60,v.TILE=!0,v.TILING_PADDING_VERTICAL=10,v.TILING_PADDING_HORIZONTAL=10,v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0,v.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,v.TREE_REDUCTION_ON_INCREMENTAL=!0,v.PURE_INCREMENTAL=v.DEFAULT_INCREMENTAL,w.exports=v},767:(w,p,s)=>{var o=s(551).FDLayoutEdge;function v(f,u,r){o.call(this,f,u,r)}for(var M in v.prototype=Object.create(o.prototype),o)v[M]=o[M];w.exports=v},880:(w,p,s)=>{var o=s(551).LGraph;function v(f,u,r){o.call(this,f,u,r)}for(var M in v.prototype=Object.create(o.prototype),o)v[M]=o[M];w.exports=v},578:(w,p,s)=>{var o=s(551).LGraphManager;function v(f){o.call(this,f)}for(var M in v.prototype=Object.create(o.prototype),o)v[M]=o[M];w.exports=v},765:(w,p,s)=>{var o=s(551).FDLayout,v=s(578),M=s(880),f=s(991),u=s(767),r=s(806),h=s(902),d=s(551).FDLayoutConstants,n=s(551).LayoutConstants,y=s(551).Point,b=s(551).PointD,T=s(551).DimensionD,I=s(551).Layout,F=s(551).Integer,X=s(551).IGeometry,Z=s(551).LGraph,ot=s(551).Transform,dt=s(551).LinkedList;function xt(){o.call(this),this.toBeTiled={},this.constraints={}}for(var re in xt.prototype=Object.create(o.prototype),o)xt[re]=o[re];xt.prototype.newGraphManager=function(){var N=new v(this);return this.graphManager=N,N},xt.prototype.newGraph=function(N){return new M(null,this.graphManager,N)},xt.prototype.newNode=function(N){return new f(this.graphManager,N)},xt.prototype.newEdge=function(N){return new u(null,null,N)},xt.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.isSubLayout||(r.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=r.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},xt.prototype.initSpringEmbedder=function(){o.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},xt.prototype.layout=function(){return n.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},xt.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)r.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),Q=new Set(this.getAllNodes()),at=this.nodesWithGravity.filter(function(_){return Q.has(_)}),this.graphManager.setAllNodesToApplyGravitation(at));else{var N=this.getFlatForest();if(N.length>0)this.positionNodesRadially(N);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var Q=new Set(this.getAllNodes()),at=this.nodesWithGravity.filter(function(_){return Q.has(_)});this.graphManager.setAllNodesToApplyGravitation(at),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(h.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),r.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},xt.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),Q=this.nodesWithGravity.filter(function(l){return N.has(l)});this.graphManager.setAllNodesToApplyGravitation(Q),this.graphManager.updateBounds(),this.updateGrid(),r.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),r.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var at=!this.isTreeGrowing&&!this.isGrowthFinished,_=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(at,_),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},xt.prototype.getPositionsData=function(){for(var N=this.graphManager.getAllNodes(),Q={},at=0;at<N.length;at++){var _=N[at].rect,l=N[at].id;Q[l]={id:l,x:_.getCenterX(),y:_.getCenterY(),w:_.width,h:_.height}}return Q},xt.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var N=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!N;)N=this.tick();this.graphManager.updateBounds()}},xt.prototype.moveNodes=function(){for(var N=this.getAllNodes(),Q=0;Q<N.length;Q++)N[Q].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),Q=0;Q<N.length;Q++)N[Q].move()},xt.prototype.initConstraintVariables=function(){var N=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var Q=this.graphManager.getAllNodes(),at=0;at<Q.length;at++){var _=Q[at];this.idToNodeMap.set(_.id,_)}var l=function Qt(pe){for(var ue,me=pe.getChild().getNodes(),Ee=0,xe=0;xe<me.length;xe++)(ue=me[xe]).getChild()==null?N.fixedNodeSet.has(ue.id)&&(Ee+=100):Ee+=Qt(ue);return Ee};if(this.constraints.fixedNodeConstraint){for(this.constraints.fixedNodeConstraint.forEach(function(Qt){N.fixedNodeSet.add(Qt.nodeId)}),Q=this.graphManager.getAllNodes(),at=0;at<Q.length;at++)if((_=Q[at]).getChild()!=null){var O=l(_);O>0&&(_.fixedNodeWeight=O)}}if(this.constraints.relativePlacementConstraint){var z=new Map,lt=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Qt){N.fixedNodesOnHorizontal.add(Qt),N.fixedNodesOnVertical.add(Qt)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var W=this.constraints.alignmentConstraint.vertical;for(at=0;at<W.length;at++)this.dummyToNodeForVerticalAlignment.set("dummy"+at,[]),W[at].forEach(function(Qt){z.set(Qt,"dummy"+at),N.dummyToNodeForVerticalAlignment.get("dummy"+at).push(Qt),N.fixedNodeSet.has(Qt)&&N.fixedNodesOnHorizontal.add("dummy"+at)})}if(this.constraints.alignmentConstraint.horizontal){var pt=this.constraints.alignmentConstraint.horizontal;for(at=0;at<pt.length;at++)this.dummyToNodeForHorizontalAlignment.set("dummy"+at,[]),pt[at].forEach(function(Qt){lt.set(Qt,"dummy"+at),N.dummyToNodeForHorizontalAlignment.get("dummy"+at).push(Qt),N.fixedNodeSet.has(Qt)&&N.fixedNodesOnVertical.add("dummy"+at)})}}if(r.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(Qt){var pe,ue,me;for(me=Qt.length-1;me>=2*Qt.length/3;me--)pe=Math.floor(Math.random()*(me+1)),ue=Qt[me],Qt[me]=Qt[pe],Qt[pe]=ue;return Qt},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(Qt){if(Qt.left){var pe=z.has(Qt.left)?z.get(Qt.left):Qt.left,ue=z.has(Qt.right)?z.get(Qt.right):Qt.right;N.nodesInRelativeHorizontal.includes(pe)||(N.nodesInRelativeHorizontal.push(pe),N.nodeToRelativeConstraintMapHorizontal.set(pe,[]),N.dummyToNodeForVerticalAlignment.has(pe)?N.nodeToTempPositionMapHorizontal.set(pe,N.idToNodeMap.get(N.dummyToNodeForVerticalAlignment.get(pe)[0]).getCenterX()):N.nodeToTempPositionMapHorizontal.set(pe,N.idToNodeMap.get(pe).getCenterX())),N.nodesInRelativeHorizontal.includes(ue)||(N.nodesInRelativeHorizontal.push(ue),N.nodeToRelativeConstraintMapHorizontal.set(ue,[]),N.dummyToNodeForVerticalAlignment.has(ue)?N.nodeToTempPositionMapHorizontal.set(ue,N.idToNodeMap.get(N.dummyToNodeForVerticalAlignment.get(ue)[0]).getCenterX()):N.nodeToTempPositionMapHorizontal.set(ue,N.idToNodeMap.get(ue).getCenterX())),N.nodeToRelativeConstraintMapHorizontal.get(pe).push({right:ue,gap:Qt.gap}),N.nodeToRelativeConstraintMapHorizontal.get(ue).push({left:pe,gap:Qt.gap})}else{var me=lt.has(Qt.top)?lt.get(Qt.top):Qt.top,Ee=lt.has(Qt.bottom)?lt.get(Qt.bottom):Qt.bottom;N.nodesInRelativeVertical.includes(me)||(N.nodesInRelativeVertical.push(me),N.nodeToRelativeConstraintMapVertical.set(me,[]),N.dummyToNodeForHorizontalAlignment.has(me)?N.nodeToTempPositionMapVertical.set(me,N.idToNodeMap.get(N.dummyToNodeForHorizontalAlignment.get(me)[0]).getCenterY()):N.nodeToTempPositionMapVertical.set(me,N.idToNodeMap.get(me).getCenterY())),N.nodesInRelativeVertical.includes(Ee)||(N.nodesInRelativeVertical.push(Ee),N.nodeToRelativeConstraintMapVertical.set(Ee,[]),N.dummyToNodeForHorizontalAlignment.has(Ee)?N.nodeToTempPositionMapVertical.set(Ee,N.idToNodeMap.get(N.dummyToNodeForHorizontalAlignment.get(Ee)[0]).getCenterY()):N.nodeToTempPositionMapVertical.set(Ee,N.idToNodeMap.get(Ee).getCenterY())),N.nodeToRelativeConstraintMapVertical.get(me).push({bottom:Ee,gap:Qt.gap}),N.nodeToRelativeConstraintMapVertical.get(Ee).push({top:me,gap:Qt.gap})}});else{var mt=new Map,Tt=new Map;this.constraints.relativePlacementConstraint.forEach(function(Qt){if(Qt.left){var pe=z.has(Qt.left)?z.get(Qt.left):Qt.left,ue=z.has(Qt.right)?z.get(Qt.right):Qt.right;mt.has(pe)?mt.get(pe).push(ue):mt.set(pe,[ue]),mt.has(ue)?mt.get(ue).push(pe):mt.set(ue,[pe])}else{var me=lt.has(Qt.top)?lt.get(Qt.top):Qt.top,Ee=lt.has(Qt.bottom)?lt.get(Qt.bottom):Qt.bottom;Tt.has(me)?Tt.get(me).push(Ee):Tt.set(me,[Ee]),Tt.has(Ee)?Tt.get(Ee).push(me):Tt.set(Ee,[me])}});var Rt=function(Qt,pe){var ue=[],me=[],Ee=new dt,xe=new Set,ar=0;return Qt.forEach(function(xr,sr){if(!xe.has(sr)){ue[ar]=[],me[ar]=!1;var Qe=sr;for(Ee.push(Qe),xe.add(Qe),ue[ar].push(Qe);Ee.length!=0;)Qe=Ee.shift(),pe.has(Qe)&&(me[ar]=!0),Qt.get(Qe).forEach(function(or){xe.has(or)||(Ee.push(or),xe.add(or),ue[ar].push(or))});ar++}}),{components:ue,isFixed:me}},It=Rt(mt,N.fixedNodesOnHorizontal);this.componentsOnHorizontal=It.components,this.fixedComponentsOnHorizontal=It.isFixed;var te=Rt(Tt,N.fixedNodesOnVertical);this.componentsOnVertical=te.components,this.fixedComponentsOnVertical=te.isFixed}}},xt.prototype.updateDisplacements=function(){var N=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(te){var Qt=N.idToNodeMap.get(te.nodeId);Qt.displacementX=0,Qt.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var Q=this.constraints.alignmentConstraint.vertical,at=0;at<Q.length;at++){for(var _=0,l=0;l<Q[at].length;l++){if(this.fixedNodeSet.has(Q[at][l])){_=0;break}_+=this.idToNodeMap.get(Q[at][l]).displacementX}var O=_/Q[at].length;for(l=0;l<Q[at].length;l++)this.idToNodeMap.get(Q[at][l]).displacementX=O}if(this.constraints.alignmentConstraint.horizontal){var z=this.constraints.alignmentConstraint.horizontal;for(at=0;at<z.length;at++){var lt=0;for(l=0;l<z[at].length;l++){if(this.fixedNodeSet.has(z[at][l])){lt=0;break}lt+=this.idToNodeMap.get(z[at][l]).displacementY}var W=lt/z[at].length;for(l=0;l<z[at].length;l++)this.idToNodeMap.get(z[at][l]).displacementY=W}}}if(this.constraints.relativePlacementConstraint)if(r.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(te){if(!N.fixedNodesOnHorizontal.has(te)){var Qt=0;Qt=N.dummyToNodeForVerticalAlignment.has(te)?N.idToNodeMap.get(N.dummyToNodeForVerticalAlignment.get(te)[0]).displacementX:N.idToNodeMap.get(te).displacementX,N.nodeToRelativeConstraintMapHorizontal.get(te).forEach(function(pe){var ue;pe.right?(ue=N.nodeToTempPositionMapHorizontal.get(pe.right)-N.nodeToTempPositionMapHorizontal.get(te)-Qt)<pe.gap&&(Qt-=pe.gap-ue):(ue=N.nodeToTempPositionMapHorizontal.get(te)-N.nodeToTempPositionMapHorizontal.get(pe.left)+Qt)<pe.gap&&(Qt+=pe.gap-ue)}),N.nodeToTempPositionMapHorizontal.set(te,N.nodeToTempPositionMapHorizontal.get(te)+Qt),N.dummyToNodeForVerticalAlignment.has(te)?N.dummyToNodeForVerticalAlignment.get(te).forEach(function(pe){N.idToNodeMap.get(pe).displacementX=Qt}):N.idToNodeMap.get(te).displacementX=Qt}}),this.nodesInRelativeVertical.forEach(function(te){if(!N.fixedNodesOnHorizontal.has(te)){var Qt=0;Qt=N.dummyToNodeForHorizontalAlignment.has(te)?N.idToNodeMap.get(N.dummyToNodeForHorizontalAlignment.get(te)[0]).displacementY:N.idToNodeMap.get(te).displacementY,N.nodeToRelativeConstraintMapVertical.get(te).forEach(function(pe){var ue;pe.bottom?(ue=N.nodeToTempPositionMapVertical.get(pe.bottom)-N.nodeToTempPositionMapVertical.get(te)-Qt)<pe.gap&&(Qt-=pe.gap-ue):(ue=N.nodeToTempPositionMapVertical.get(te)-N.nodeToTempPositionMapVertical.get(pe.top)+Qt)<pe.gap&&(Qt+=pe.gap-ue)}),N.nodeToTempPositionMapVertical.set(te,N.nodeToTempPositionMapVertical.get(te)+Qt),N.dummyToNodeForHorizontalAlignment.has(te)?N.dummyToNodeForHorizontalAlignment.get(te).forEach(function(pe){N.idToNodeMap.get(pe).displacementY=Qt}):N.idToNodeMap.get(te).displacementY=Qt}});else{for(at=0;at<this.componentsOnHorizontal.length;at++){var pt=this.componentsOnHorizontal[at];if(this.fixedComponentsOnHorizontal[at])for(l=0;l<pt.length;l++)this.dummyToNodeForVerticalAlignment.has(pt[l])?this.dummyToNodeForVerticalAlignment.get(pt[l]).forEach(function(te){N.idToNodeMap.get(te).displacementX=0}):this.idToNodeMap.get(pt[l]).displacementX=0;else{var mt=0,Tt=0;for(l=0;l<pt.length;l++)this.dummyToNodeForVerticalAlignment.has(pt[l])?(mt+=(It=this.dummyToNodeForVerticalAlignment.get(pt[l])).length*this.idToNodeMap.get(It[0]).displacementX,Tt+=It.length):(mt+=this.idToNodeMap.get(pt[l]).displacementX,Tt++);var Rt=mt/Tt;for(l=0;l<pt.length;l++)this.dummyToNodeForVerticalAlignment.has(pt[l])?this.dummyToNodeForVerticalAlignment.get(pt[l]).forEach(function(te){N.idToNodeMap.get(te).displacementX=Rt}):this.idToNodeMap.get(pt[l]).displacementX=Rt}}for(at=0;at<this.componentsOnVertical.length;at++)if(pt=this.componentsOnVertical[at],this.fixedComponentsOnVertical[at])for(l=0;l<pt.length;l++)this.dummyToNodeForHorizontalAlignment.has(pt[l])?this.dummyToNodeForHorizontalAlignment.get(pt[l]).forEach(function(te){N.idToNodeMap.get(te).displacementY=0}):this.idToNodeMap.get(pt[l]).displacementY=0;else{for(mt=0,Tt=0,l=0;l<pt.length;l++){var It;this.dummyToNodeForHorizontalAlignment.has(pt[l])?(mt+=(It=this.dummyToNodeForHorizontalAlignment.get(pt[l])).length*this.idToNodeMap.get(It[0]).displacementY,Tt+=It.length):(mt+=this.idToNodeMap.get(pt[l]).displacementY,Tt++)}for(Rt=mt/Tt,l=0;l<pt.length;l++)this.dummyToNodeForHorizontalAlignment.has(pt[l])?this.dummyToNodeForHorizontalAlignment.get(pt[l]).forEach(function(te){N.idToNodeMap.get(te).displacementY=Rt}):this.idToNodeMap.get(pt[l]).displacementY=Rt}}},xt.prototype.calculateNodesToApplyGravitationTo=function(){var N,Q,at=[],_=this.graphManager.getGraphs(),l=_.length;for(Q=0;Q<l;Q++)(N=_[Q]).updateConnected(),N.isConnected||(at=at.concat(N.getNodes()));return at},xt.prototype.createBendpoints=function(){var N=[];N=N.concat(this.graphManager.getAllEdges());var Q,at=new Set;for(Q=0;Q<N.length;Q++){var _=N[Q];if(!at.has(_)){var l=_.getSource(),O=_.getTarget();if(l==O)_.getBendpoints().push(new b),_.getBendpoints().push(new b),this.createDummyNodesForBendpoints(_),at.add(_);else{var z=[];if(z=(z=z.concat(l.getEdgeListToNode(O))).concat(O.getEdgeListToNode(l)),!at.has(z[0])){var lt;if(z.length>1)for(lt=0;lt<z.length;lt++){var W=z[lt];W.getBendpoints().push(new b),this.createDummyNodesForBendpoints(W)}z.forEach(function(pt){at.add(pt)})}}}if(at.size==N.length)break}},xt.prototype.positionNodesRadially=function(N){for(var Q=new y(0,0),at=Math.ceil(Math.sqrt(N.length)),_=0,l=0,O=0,z=new b(0,0),lt=0;lt<N.length;lt++){lt%at==0&&(O=0,l=_,lt!=0&&(l+=r.DEFAULT_COMPONENT_SEPERATION),_=0);var W=N[lt],pt=I.findCenterOfTree(W);Q.x=O,Q.y=l,(z=xt.radialLayout(W,pt,Q)).y>_&&(_=Math.floor(z.y)),O=Math.floor(z.x+r.DEFAULT_COMPONENT_SEPERATION)}this.transform(new b(n.WORLD_CENTER_X-z.x/2,n.WORLD_CENTER_Y-z.y/2))},xt.radialLayout=function(N,Q,at){var _=Math.max(this.maxDiagonalInTree(N),r.DEFAULT_RADIAL_SEPARATION);xt.branchRadialLayout(Q,null,0,359,0,_);var l=Z.calculateBounds(N),O=new ot;O.setDeviceOrgX(l.getMinX()),O.setDeviceOrgY(l.getMinY()),O.setWorldOrgX(at.x),O.setWorldOrgY(at.y);for(var z=0;z<N.length;z++)N[z].transform(O);var lt=new b(l.getMaxX(),l.getMaxY());return O.inverseTransformPoint(lt)},xt.branchRadialLayout=function(N,Q,at,_,l,O){var z=(_-at+1)/2;z<0&&(z+=180);var lt=(z+at)%360*X.TWO_PI/360,W=(Math.cos(lt),l*Math.cos(lt)),pt=l*Math.sin(lt);N.setCenter(W,pt);var mt=[],Tt=(mt=mt.concat(N.getEdges())).length;Q!=null&&Tt--;for(var Rt,It=0,te=mt.length,Qt=N.getEdgesBetween(Q);Qt.length>1;){var pe=Qt[0];Qt.splice(0,1);var ue=mt.indexOf(pe);ue>=0&&mt.splice(ue,1),te--,Tt--}Rt=Q!=null?(mt.indexOf(Qt[0])+1)%te:0;for(var me=Math.abs(_-at)/Tt,Ee=Rt;It!=Tt;Ee=++Ee%te){var xe=mt[Ee].getOtherEnd(N);if(xe!=Q){var ar=(at+It*me)%360,xr=(ar+me)%360;xt.branchRadialLayout(xe,N,ar,xr,l+O,O),It++}}},xt.maxDiagonalInTree=function(N){for(var Q=F.MIN_VALUE,at=0;at<N.length;at++){var _=N[at].getDiagonal();_>Q&&(Q=_)}return Q},xt.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},xt.prototype.groupZeroDegreeMembers=function(){var N=this,Q={};this.memberGroups={},this.idToDummyNode={};for(var at=[],_=this.graphManager.getAllNodes(),l=0;l<_.length;l++){var O=(z=_[l]).getParent();this.getNodeDegreeWithChildren(z)!==0||O.id!=null&&this.getToBeTiled(O)||at.push(z)}for(l=0;l<at.length;l++){var z,lt=(z=at[l]).getParent().id;Q[lt]===void 0&&(Q[lt]=[]),Q[lt]=Q[lt].concat(z)}Object.keys(Q).forEach(function(W){if(Q[W].length>1){var pt="DummyCompound_"+W;N.memberGroups[pt]=Q[W];var mt=Q[W][0].getParent(),Tt=new f(N.graphManager);Tt.id=pt,Tt.paddingLeft=mt.paddingLeft||0,Tt.paddingRight=mt.paddingRight||0,Tt.paddingBottom=mt.paddingBottom||0,Tt.paddingTop=mt.paddingTop||0,N.idToDummyNode[pt]=Tt;var Rt=N.getGraphManager().add(N.newGraph(),Tt),It=mt.getChild();It.add(Tt);for(var te=0;te<Q[W].length;te++){var Qt=Q[W][te];It.remove(Qt),Rt.add(Qt)}}})},xt.prototype.clearCompounds=function(){var N={},Q={};this.performDFSOnCompounds();for(var at=0;at<this.compoundOrder.length;at++)Q[this.compoundOrder[at].id]=this.compoundOrder[at],N[this.compoundOrder[at].id]=[].concat(this.compoundOrder[at].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[at].getChild()),this.compoundOrder[at].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(N,Q)},xt.prototype.clearZeroDegreeMembers=function(){var N=this,Q=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(at){var _=N.idToDummyNode[at];if(Q[at]=N.tileNodes(N.memberGroups[at],_.paddingLeft+_.paddingRight),_.rect.width=Q[at].width,_.rect.height=Q[at].height,_.setCenter(Q[at].centerX,Q[at].centerY),_.labelMarginLeft=0,_.labelMarginTop=0,r.NODE_DIMENSIONS_INCLUDE_LABELS){var l=_.rect.width,O=_.rect.height;_.labelWidth&&(_.labelPosHorizontal=="left"?(_.rect.x-=_.labelWidth,_.setWidth(l+_.labelWidth),_.labelMarginLeft=_.labelWidth):_.labelPosHorizontal=="center"&&_.labelWidth>l?(_.rect.x-=(_.labelWidth-l)/2,_.setWidth(_.labelWidth),_.labelMarginLeft=(_.labelWidth-l)/2):_.labelPosHorizontal=="right"&&_.setWidth(l+_.labelWidth)),_.labelHeight&&(_.labelPosVertical=="top"?(_.rect.y-=_.labelHeight,_.setHeight(O+_.labelHeight),_.labelMarginTop=_.labelHeight):_.labelPosVertical=="center"&&_.labelHeight>O?(_.rect.y-=(_.labelHeight-O)/2,_.setHeight(_.labelHeight),_.labelMarginTop=(_.labelHeight-O)/2):_.labelPosVertical=="bottom"&&_.setHeight(O+_.labelHeight))}})},xt.prototype.repopulateCompounds=function(){for(var N=this.compoundOrder.length-1;N>=0;N--){var Q=this.compoundOrder[N],at=Q.id,_=Q.paddingLeft,l=Q.paddingTop,O=Q.labelMarginLeft,z=Q.labelMarginTop;this.adjustLocations(this.tiledMemberPack[at],Q.rect.x,Q.rect.y,_,l,O,z)}},xt.prototype.repopulateZeroDegreeMembers=function(){var N=this,Q=this.tiledZeroDegreePack;Object.keys(Q).forEach(function(at){var _=N.idToDummyNode[at],l=_.paddingLeft,O=_.paddingTop,z=_.labelMarginLeft,lt=_.labelMarginTop;N.adjustLocations(Q[at],_.rect.x,_.rect.y,l,O,z,lt)})},xt.prototype.getToBeTiled=function(N){var Q=N.id;if(this.toBeTiled[Q]!=null)return this.toBeTiled[Q];var at=N.getChild();if(at==null)return this.toBeTiled[Q]=!1,!1;for(var _=at.getNodes(),l=0;l<_.length;l++){var O=_[l];if(this.getNodeDegree(O)>0)return this.toBeTiled[Q]=!1,!1;if(O.getChild()!=null){if(!this.getToBeTiled(O))return this.toBeTiled[Q]=!1,!1}else this.toBeTiled[O.id]=!1}return this.toBeTiled[Q]=!0,!0},xt.prototype.getNodeDegree=function(N){N.id;for(var Q=N.getEdges(),at=0,_=0;_<Q.length;_++){var l=Q[_];l.getSource().id!==l.getTarget().id&&(at+=1)}return at},xt.prototype.getNodeDegreeWithChildren=function(N){var Q=this.getNodeDegree(N);if(N.getChild()==null)return Q;for(var at=N.getChild().getNodes(),_=0;_<at.length;_++){var l=at[_];Q+=this.getNodeDegreeWithChildren(l)}return Q},xt.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},xt.prototype.fillCompexOrderByDFS=function(N){for(var Q=0;Q<N.length;Q++){var at=N[Q];at.getChild()!=null&&this.fillCompexOrderByDFS(at.getChild().getNodes()),this.getToBeTiled(at)&&this.compoundOrder.push(at)}},xt.prototype.adjustLocations=function(N,Q,at,_,l,O,z){at+=l+z;for(var lt=Q+=_+O,W=0;W<N.rows.length;W++){var pt=N.rows[W];Q=lt;for(var mt=0,Tt=0;Tt<pt.length;Tt++){var Rt=pt[Tt];Rt.rect.x=Q,Rt.rect.y=at,Q+=Rt.rect.width+N.horizontalPadding,Rt.rect.height>mt&&(mt=Rt.rect.height)}at+=mt+N.verticalPadding}},xt.prototype.tileCompoundMembers=function(N,Q){var at=this;this.tiledMemberPack=[],Object.keys(N).forEach(function(_){var l=Q[_];if(at.tiledMemberPack[_]=at.tileNodes(N[_],l.paddingLeft+l.paddingRight),l.rect.width=at.tiledMemberPack[_].width,l.rect.height=at.tiledMemberPack[_].height,l.setCenter(at.tiledMemberPack[_].centerX,at.tiledMemberPack[_].centerY),l.labelMarginLeft=0,l.labelMarginTop=0,r.NODE_DIMENSIONS_INCLUDE_LABELS){var O=l.rect.width,z=l.rect.height;l.labelWidth&&(l.labelPosHorizontal=="left"?(l.rect.x-=l.labelWidth,l.setWidth(O+l.labelWidth),l.labelMarginLeft=l.labelWidth):l.labelPosHorizontal=="center"&&l.labelWidth>O?(l.rect.x-=(l.labelWidth-O)/2,l.setWidth(l.labelWidth),l.labelMarginLeft=(l.labelWidth-O)/2):l.labelPosHorizontal=="right"&&l.setWidth(O+l.labelWidth)),l.labelHeight&&(l.labelPosVertical=="top"?(l.rect.y-=l.labelHeight,l.setHeight(z+l.labelHeight),l.labelMarginTop=l.labelHeight):l.labelPosVertical=="center"&&l.labelHeight>z?(l.rect.y-=(l.labelHeight-z)/2,l.setHeight(l.labelHeight),l.labelMarginTop=(l.labelHeight-z)/2):l.labelPosVertical=="bottom"&&l.setHeight(z+l.labelHeight))}})},xt.prototype.tileNodes=function(N,Q){var at=this.tileNodesByFavoringDim(N,Q,!0),_=this.tileNodesByFavoringDim(N,Q,!1),l=this.getOrgRatio(at);return this.getOrgRatio(_)<l?_:at},xt.prototype.getOrgRatio=function(N){var Q=N.width/N.height;return Q<1&&(Q=1/Q),Q},xt.prototype.calcIdealRowWidth=function(N,Q){var at=r.TILING_PADDING_VERTICAL,_=r.TILING_PADDING_HORIZONTAL,l=N.length,O=0,z=0,lt=0;N.forEach(function(te){O+=te.getWidth(),z+=te.getHeight(),te.getWidth()>lt&&(lt=te.getWidth())});var W,pt=O/l,mt=z/l,Tt=Math.pow(at-_,2)+4*(pt+_)*(mt+at)*l,Rt=(_-at+Math.sqrt(Tt))/(2*(pt+_));Q?(W=Math.ceil(Rt))==Rt&&W++:W=Math.floor(Rt);var It=W*(pt+_)-_;return lt>It&&(It=lt),It+=2*_},xt.prototype.tileNodesByFavoringDim=function(N,Q,at){var _=r.TILING_PADDING_VERTICAL,l=r.TILING_PADDING_HORIZONTAL,O=r.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:Q,verticalPadding:_,horizontalPadding:l,centerX:0,centerY:0};O&&(z.idealRowWidth=this.calcIdealRowWidth(N,at));var lt=function(te){return te.rect.width*te.rect.height},W=function(te,Qt){return lt(Qt)-lt(te)};N.sort(function(te,Qt){var pe=W;return z.idealRowWidth?(pe=O)(te.id,Qt.id):pe(te,Qt)});for(var pt=0,mt=0,Tt=0;Tt<N.length;Tt++)pt+=(Rt=N[Tt]).getCenterX(),mt+=Rt.getCenterY();for(z.centerX=pt/N.length,z.centerY=mt/N.length,Tt=0;Tt<N.length;Tt++){var Rt=N[Tt];if(z.rows.length==0)this.insertNodeToRow(z,Rt,0,Q);else if(this.canAddHorizontal(z,Rt.rect.width,Rt.rect.height)){var It=z.rows.length-1;z.idealRowWidth||(It=this.getShortestRowIndex(z)),this.insertNodeToRow(z,Rt,It,Q)}else this.insertNodeToRow(z,Rt,z.rows.length,Q);this.shiftToLastRow(z)}return z},xt.prototype.insertNodeToRow=function(N,Q,at,_){var l=_;at==N.rows.length&&(N.rows.push([]),N.rowWidth.push(l),N.rowHeight.push(0));var O=N.rowWidth[at]+Q.rect.width;N.rows[at].length>0&&(O+=N.horizontalPadding),N.rowWidth[at]=O,N.width<O&&(N.width=O);var z=Q.rect.height;at>0&&(z+=N.verticalPadding);var lt=0;z>N.rowHeight[at]&&(lt=N.rowHeight[at],N.rowHeight[at]=z,lt=N.rowHeight[at]-lt),N.height+=lt,N.rows[at].push(Q)},xt.prototype.getShortestRowIndex=function(N){for(var Q=-1,at=Number.MAX_VALUE,_=0;_<N.rows.length;_++)N.rowWidth[_]<at&&(Q=_,at=N.rowWidth[_]);return Q},xt.prototype.getLongestRowIndex=function(N){for(var Q=-1,at=Number.MIN_VALUE,_=0;_<N.rows.length;_++)N.rowWidth[_]>at&&(Q=_,at=N.rowWidth[_]);return Q},xt.prototype.canAddHorizontal=function(N,Q,at){if(N.idealRowWidth){var _=N.rows.length-1;return N.rowWidth[_]+Q+N.horizontalPadding<=N.idealRowWidth}var l=this.getShortestRowIndex(N);if(l<0)return!0;var O=N.rowWidth[l];if(O+N.horizontalPadding+Q<=N.width)return!0;var z,lt,W=0;return N.rowHeight[l]<at&&l>0&&(W=at+N.verticalPadding-N.rowHeight[l]),z=N.width-O>=Q+N.horizontalPadding?(N.height+W)/(O+Q+N.horizontalPadding):(N.height+W)/N.width,W=at+N.verticalPadding,(lt=N.width<Q?(N.height+W)/Q:(N.height+W)/N.width)<1&&(lt=1/lt),z<1&&(z=1/z),z<lt},xt.prototype.shiftToLastRow=function(N){var Q=this.getLongestRowIndex(N),at=N.rowWidth.length-1,_=N.rows[Q],l=_[_.length-1],O=l.width+N.horizontalPadding;if(N.width-N.rowWidth[at]>O&&Q!=at){_.splice(-1,1),N.rows[at].push(l),N.rowWidth[Q]=N.rowWidth[Q]-O,N.rowWidth[at]=N.rowWidth[at]+O,N.width=N.rowWidth[instance.getLongestRowIndex(N)];for(var z=Number.MIN_VALUE,lt=0;lt<_.length;lt++)_[lt].height>z&&(z=_[lt].height);Q>0&&(z+=N.verticalPadding);var W=N.rowHeight[Q]+N.rowHeight[at];N.rowHeight[Q]=z,N.rowHeight[at]<l.height+N.verticalPadding&&(N.rowHeight[at]=l.height+N.verticalPadding);var pt=N.rowHeight[Q]+N.rowHeight[at];N.height+=pt-W,this.shiftToLastRow(N)}},xt.prototype.tilingPreLayout=function(){r.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},xt.prototype.tilingPostLayout=function(){r.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},xt.prototype.reduceTrees=function(){for(var N,Q=[],at=!0;at;){var _=this.graphManager.getAllNodes(),l=[];at=!1;for(var O=0;O<_.length;O++)if((N=_[O]).getEdges().length==1&&!N.getEdges()[0].isInterGraph&&N.getChild()==null){if(r.PURE_INCREMENTAL){var z=N.getEdges()[0].getOtherEnd(N),lt=new T(N.getCenterX()-z.getCenterX(),N.getCenterY()-z.getCenterY());l.push([N,N.getEdges()[0],N.getOwner(),lt])}else l.push([N,N.getEdges()[0],N.getOwner()]);at=!0}if(at==1){for(var W=[],pt=0;pt<l.length;pt++)l[pt][0].getEdges().length==1&&(W.push(l[pt]),l[pt][0].getOwner().remove(l[pt][0]));Q.push(W),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=Q},xt.prototype.growTree=function(N){for(var Q,at=N[N.length-1],_=0;_<at.length;_++)Q=at[_],this.findPlaceforPrunedNode(Q),Q[2].add(Q[0]),Q[2].add(Q[1],Q[1].source,Q[1].target);N.splice(N.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},xt.prototype.findPlaceforPrunedNode=function(N){var Q,at,_=N[0];if(at=_==N[1].source?N[1].target:N[1].source,r.PURE_INCREMENTAL)_.setCenter(at.getCenterX()+N[3].getWidth(),at.getCenterY()+N[3].getHeight());else{var l=at.startX,O=at.finishX,z=at.startY,lt=at.finishY,W=[0,0,0,0];if(z>0)for(var pt=l;pt<=O;pt++)W[0]+=this.grid[pt][z-1].length+this.grid[pt][z].length-1;if(O<this.grid.length-1)for(pt=z;pt<=lt;pt++)W[1]+=this.grid[O+1][pt].length+this.grid[O][pt].length-1;if(lt<this.grid[0].length-1)for(pt=l;pt<=O;pt++)W[2]+=this.grid[pt][lt+1].length+this.grid[pt][lt].length-1;if(l>0)for(pt=z;pt<=lt;pt++)W[3]+=this.grid[l-1][pt].length+this.grid[l][pt].length-1;for(var mt,Tt,Rt=F.MAX_VALUE,It=0;It<W.length;It++)W[It]<Rt?(Rt=W[It],mt=1,Tt=It):W[It]==Rt&&mt++;if(mt==3&&Rt==0)W[0]==0&&W[1]==0&&W[2]==0?Q=1:W[0]==0&&W[1]==0&&W[3]==0?Q=0:W[0]==0&&W[2]==0&&W[3]==0?Q=3:W[1]==0&&W[2]==0&&W[3]==0&&(Q=2);else if(mt==2&&Rt==0){var te=Math.floor(2*Math.random());Q=W[0]==0&&W[1]==0?te==0?0:1:W[0]==0&&W[2]==0?te==0?0:2:W[0]==0&&W[3]==0?te==0?0:3:W[1]==0&&W[2]==0?te==0?1:2:W[1]==0&&W[3]==0?te==0?1:3:te==0?2:3}else mt==4&&Rt==0?Q=te=Math.floor(4*Math.random()):Q=Tt;Q==0?_.setCenter(at.getCenterX(),at.getCenterY()-at.getHeight()/2-d.DEFAULT_EDGE_LENGTH-_.getHeight()/2):Q==1?_.setCenter(at.getCenterX()+at.getWidth()/2+d.DEFAULT_EDGE_LENGTH+_.getWidth()/2,at.getCenterY()):Q==2?_.setCenter(at.getCenterX(),at.getCenterY()+at.getHeight()/2+d.DEFAULT_EDGE_LENGTH+_.getHeight()/2):_.setCenter(at.getCenterX()-at.getWidth()/2-d.DEFAULT_EDGE_LENGTH-_.getWidth()/2,at.getCenterY())}},w.exports=xt},991:(w,p,s)=>{var o=s(551).FDLayoutNode,v=s(551).IMath;function M(u,r,h,d){o.call(this,u,r,h,d)}for(var f in M.prototype=Object.create(o.prototype),o)M[f]=o[f];M.prototype.calculateDisplacement=function(){var u=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=u.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=u.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=u.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=u.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementX=u.coolingFactor*u.maxNodeDisplacement*v.sign(this.displacementX)),Math.abs(this.displacementY)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementY=u.coolingFactor*u.maxNodeDisplacement*v.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},M.prototype.propogateDisplacementToChildren=function(u,r){for(var h,d=this.getChild().getNodes(),n=0;n<d.length;n++)(h=d[n]).getChild()==null?(h.displacementX+=u,h.displacementY+=r):h.propogateDisplacementToChildren(u,r)},M.prototype.move=function(){var u=this.graphManager.getLayout();this.child!=null&&this.child.getNodes().length!=0||(this.moveBy(this.displacementX,this.displacementY),u.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},M.prototype.setPred1=function(u){this.pred1=u},M.prototype.getPred1=function(){return pred1},M.prototype.getPred2=function(){return pred2},M.prototype.setNext=function(u){this.next=u},M.prototype.getNext=function(){return next},M.prototype.setProcessed=function(u){this.processed=u},M.prototype.isProcessed=function(){return processed},w.exports=M},902:(w,p,s)=>{function o(h){if(Array.isArray(h)){for(var d=0,n=Array(h.length);d<h.length;d++)n[d]=h[d];return n}return Array.from(h)}var v=s(806),M=s(551).LinkedList,f=s(551).Matrix,u=s(551).SVD;function r(){}r.handleConstraints=function(h){var d={};d.fixedNodeConstraint=h.constraints.fixedNodeConstraint,d.alignmentConstraint=h.constraints.alignmentConstraint,d.relativePlacementConstraint=h.constraints.relativePlacementConstraint;for(var n=new Map,y=new Map,b=[],T=[],I=h.getAllNodes(),F=0,X=0;X<I.length;X++){var Z=I[X];Z.getChild()==null&&(y.set(Z.id,F++),b.push(Z.getCenterX()),T.push(Z.getCenterY()),n.set(Z.id,Z))}d.relativePlacementConstraint&&d.relativePlacementConstraint.forEach(function(ke){ke.gap||ke.gap==0||(ke.left?ke.gap=v.DEFAULT_EDGE_LENGTH+n.get(ke.left).getWidth()/2+n.get(ke.right).getWidth()/2:ke.gap=v.DEFAULT_EDGE_LENGTH+n.get(ke.top).getHeight()/2+n.get(ke.bottom).getHeight()/2)});var ot=function(ke){var ze=0,lr=0;return ke.forEach(function(ir){ze+=b[y.get(ir)],lr+=T[y.get(ir)]}),{x:ze/ke.size,y:lr/ke.size}},dt=function(ke,ze,lr,ir,ur){var zr=new Map;ke.forEach(function(pr,rr){zr.set(rr,0)}),ke.forEach(function(pr,rr){pr.forEach(function(Pr){zr.set(Pr.id,zr.get(Pr.id)+1)})});var cr=new Map,Nr=new Map,Fr=new M;zr.forEach(function(pr,rr){pr==0?(Fr.push(rr),lr||(ze=="horizontal"?cr.set(rr,y.has(rr)?b[y.get(rr)]:ir.get(rr)):cr.set(rr,y.has(rr)?T[y.get(rr)]:ir.get(rr)))):cr.set(rr,Number.NEGATIVE_INFINITY),lr&&Nr.set(rr,new Set([rr]))}),lr&&ur.forEach(function(pr){var rr=[];if(pr.forEach(function(wr){lr.has(wr)&&rr.push(wr)}),rr.length>0){var Pr=0;rr.forEach(function(wr){ze=="horizontal"?(cr.set(wr,y.has(wr)?b[y.get(wr)]:ir.get(wr)),Pr+=cr.get(wr)):(cr.set(wr,y.has(wr)?T[y.get(wr)]:ir.get(wr)),Pr+=cr.get(wr))}),Pr/=rr.length,pr.forEach(function(wr){lr.has(wr)||cr.set(wr,Pr)})}else{var ta=0;pr.forEach(function(wr){ta+=ze=="horizontal"?y.has(wr)?b[y.get(wr)]:ir.get(wr):y.has(wr)?T[y.get(wr)]:ir.get(wr)}),ta/=pr.length,pr.forEach(function(wr){cr.set(wr,ta)})}});for(var sa=function(){var pr=Fr.shift();ke.get(pr).forEach(function(rr){if(cr.get(rr.id)<cr.get(pr)+rr.gap)if(lr&&lr.has(rr.id)){var Pr=void 0;if(Pr=ze=="horizontal"?y.has(rr.id)?b[y.get(rr.id)]:ir.get(rr.id):y.has(rr.id)?T[y.get(rr.id)]:ir.get(rr.id),cr.set(rr.id,Pr),Pr<cr.get(pr)+rr.gap){var ta=cr.get(pr)+rr.gap-Pr;Nr.get(pr).forEach(function(wr){cr.set(wr,cr.get(wr)-ta)})}}else cr.set(rr.id,cr.get(pr)+rr.gap);zr.set(rr.id,zr.get(rr.id)-1),zr.get(rr.id)==0&&Fr.push(rr.id),lr&&Nr.set(rr.id,(function(wr,Sa){var ca=new Set(wr),ba=!0,ra=!1,Dr=void 0;try{for(var la,qr=Sa[Symbol.iterator]();!(ba=(la=qr.next()).done);ba=!0){var ma=la.value;ca.add(ma)}}catch(Ja){ra=!0,Dr=Ja}finally{try{!ba&&qr.return&&qr.return()}finally{if(ra)throw Dr}}return ca})(Nr.get(pr),Nr.get(rr.id)))})};Fr.length!=0;)sa();if(lr){var yr=new Set;ke.forEach(function(pr,rr){pr.length==0&&yr.add(rr)});var kr=[];Nr.forEach(function(pr,rr){if(yr.has(rr)){var Pr=!1,ta=!0,wr=!1,Sa=void 0;try{for(var ca,ba=pr[Symbol.iterator]();!(ta=(ca=ba.next()).done);ta=!0){var ra=ca.value;lr.has(ra)&&(Pr=!0)}}catch(qr){wr=!0,Sa=qr}finally{try{!ta&&ba.return&&ba.return()}finally{if(wr)throw Sa}}if(!Pr){var Dr=!1,la=void 0;kr.forEach(function(qr,ma){qr.has([].concat(o(pr))[0])&&(Dr=!0,la=ma)}),Dr?pr.forEach(function(qr){kr[la].add(qr)}):kr.push(new Set(pr))}}}),kr.forEach(function(pr,rr){var Pr=Number.POSITIVE_INFINITY,ta=Number.POSITIVE_INFINITY,wr=Number.NEGATIVE_INFINITY,Sa=Number.NEGATIVE_INFINITY,ca=!0,ba=!1,ra=void 0;try{for(var Dr,la=pr[Symbol.iterator]();!(ca=(Dr=la.next()).done);ca=!0){var qr=Dr.value,ma=void 0;ma=ze=="horizontal"?y.has(qr)?b[y.get(qr)]:ir.get(qr):y.has(qr)?T[y.get(qr)]:ir.get(qr);var Ja=cr.get(qr);ma<Pr&&(Pr=ma),ma>wr&&(wr=ma),Ja<ta&&(ta=Ja),Ja>Sa&&(Sa=Ja)}}catch(dn){ba=!0,ra=dn}finally{try{!ca&&la.return&&la.return()}finally{if(ba)throw ra}}var sn=(Pr+wr)/2-(ta+Sa)/2,fn=!0,Na=!1,Cn=void 0;try{for(var Mn,nn=pr[Symbol.iterator]();!(fn=(Mn=nn.next()).done);fn=!0){var An=Mn.value;cr.set(An,cr.get(An)+sn)}}catch(dn){Na=!0,Cn=dn}finally{try{!fn&&nn.return&&nn.return()}finally{if(Na)throw Cn}}})}return cr},xt=function(ke){var ze=0,lr=0,ir=0,ur=0;if(ke.forEach(function(Fr){Fr.left?b[y.get(Fr.left)]-b[y.get(Fr.right)]>=0?ze++:lr++:T[y.get(Fr.top)]-T[y.get(Fr.bottom)]>=0?ir++:ur++}),ze>lr&&ir>ur)for(var zr=0;zr<y.size;zr++)b[zr]=-1*b[zr],T[zr]=-1*T[zr];else if(ze>lr)for(var cr=0;cr<y.size;cr++)b[cr]=-1*b[cr];else if(ir>ur)for(var Nr=0;Nr<y.size;Nr++)T[Nr]=-1*T[Nr]},re=function(ke){var ze=[],lr=new M,ir=new Set,ur=0;return ke.forEach(function(zr,cr){if(!ir.has(cr)){ze[ur]=[];var Nr=cr;for(lr.push(Nr),ir.add(Nr),ze[ur].push(Nr);lr.length!=0;)Nr=lr.shift(),ke.get(Nr).forEach(function(Fr){ir.has(Fr.id)||(lr.push(Fr.id),ir.add(Fr.id),ze[ur].push(Fr.id))});ur++}}),ze},N=function(ke){var ze=new Map;return ke.forEach(function(lr,ir){ze.set(ir,[])}),ke.forEach(function(lr,ir){lr.forEach(function(ur){ze.get(ir).push(ur),ze.get(ur.id).push({id:ir,gap:ur.gap,direction:ur.direction})})}),ze},Q=function(ke){var ze=new Map;return ke.forEach(function(lr,ir){ze.set(ir,[])}),ke.forEach(function(lr,ir){lr.forEach(function(ur){ze.get(ur.id).push({id:ir,gap:ur.gap,direction:ur.direction})})}),ze},at=[],_=[],l=!1,O=!1,z=new Set,lt=new Map,W=new Map,pt=[];if(d.fixedNodeConstraint&&d.fixedNodeConstraint.forEach(function(ke){z.add(ke.nodeId)}),d.relativePlacementConstraint&&(d.relativePlacementConstraint.forEach(function(ke){ke.left?(lt.has(ke.left)?lt.get(ke.left).push({id:ke.right,gap:ke.gap,direction:"horizontal"}):lt.set(ke.left,[{id:ke.right,gap:ke.gap,direction:"horizontal"}]),lt.has(ke.right)||lt.set(ke.right,[])):(lt.has(ke.top)?lt.get(ke.top).push({id:ke.bottom,gap:ke.gap,direction:"vertical"}):lt.set(ke.top,[{id:ke.bottom,gap:ke.gap,direction:"vertical"}]),lt.has(ke.bottom)||lt.set(ke.bottom,[]))}),W=N(lt),pt=re(W)),v.TRANSFORM_ON_CONSTRAINT_HANDLING){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>1)d.fixedNodeConstraint.forEach(function(ke,ze){at[ze]=[ke.position.x,ke.position.y],_[ze]=[b[y.get(ke.nodeId)],T[y.get(ke.nodeId)]]}),l=!0;else if(d.alignmentConstraint)(function(){var ke=0;if(d.alignmentConstraint.vertical){for(var ze=d.alignmentConstraint.vertical,lr=function(Nr){var Fr=new Set;ze[Nr].forEach(function(kr){Fr.add(kr)});var sa=new Set([].concat(o(Fr)).filter(function(kr){return z.has(kr)})),yr=void 0;yr=sa.size>0?b[y.get(sa.values().next().value)]:ot(Fr).x,ze[Nr].forEach(function(kr){at[ke]=[yr,T[y.get(kr)]],_[ke]=[b[y.get(kr)],T[y.get(kr)]],ke++})},ir=0;ir<ze.length;ir++)lr(ir);l=!0}if(d.alignmentConstraint.horizontal){for(var ur=d.alignmentConstraint.horizontal,zr=function(Nr){var Fr=new Set;ur[Nr].forEach(function(kr){Fr.add(kr)});var sa=new Set([].concat(o(Fr)).filter(function(kr){return z.has(kr)})),yr=void 0;yr=sa.size>0?b[y.get(sa.values().next().value)]:ot(Fr).y,ur[Nr].forEach(function(kr){at[ke]=[b[y.get(kr)],yr],_[ke]=[b[y.get(kr)],T[y.get(kr)]],ke++})},cr=0;cr<ur.length;cr++)zr(cr);l=!0}d.relativePlacementConstraint&&(O=!0)})();else if(d.relativePlacementConstraint){for(var mt=0,Tt=0,Rt=0;Rt<pt.length;Rt++)pt[Rt].length>mt&&(mt=pt[Rt].length,Tt=Rt);if(mt<W.size/2)xt(d.relativePlacementConstraint),l=!1,O=!1;else{var It=new Map,te=new Map,Qt=[];pt[Tt].forEach(function(ke){lt.get(ke).forEach(function(ze){ze.direction=="horizontal"?(It.has(ke)?It.get(ke).push(ze):It.set(ke,[ze]),It.has(ze.id)||It.set(ze.id,[]),Qt.push({left:ke,right:ze.id})):(te.has(ke)?te.get(ke).push(ze):te.set(ke,[ze]),te.has(ze.id)||te.set(ze.id,[]),Qt.push({top:ke,bottom:ze.id}))})}),xt(Qt),O=!1;var pe=dt(It,"horizontal"),ue=dt(te,"vertical");pt[Tt].forEach(function(ke,ze){_[ze]=[b[y.get(ke)],T[y.get(ke)]],at[ze]=[],pe.has(ke)?at[ze][0]=pe.get(ke):at[ze][0]=b[y.get(ke)],ue.has(ke)?at[ze][1]=ue.get(ke):at[ze][1]=T[y.get(ke)]}),l=!0}}if(l){for(var me,Ee=f.transpose(at),xe=f.transpose(_),ar=0;ar<Ee.length;ar++)Ee[ar]=f.multGamma(Ee[ar]),xe[ar]=f.multGamma(xe[ar]);var xr=f.multMat(Ee,f.transpose(xe)),sr=u.svd(xr);me=f.multMat(sr.V,f.transpose(sr.U));for(var Qe=0;Qe<y.size;Qe++){var or=[b[Qe],T[Qe]],Wr=[me[0][0],me[1][0]],oa=[me[0][1],me[1][1]];b[Qe]=f.dotProduct(or,Wr),T[Qe]=f.dotProduct(or,oa)}O&&xt(d.relativePlacementConstraint)}}if(v.ENFORCE_CONSTRAINTS){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>0){var Sr={x:0,y:0};d.fixedNodeConstraint.forEach(function(ke,ze){var lr,ir,ur={x:b[y.get(ke.nodeId)],y:T[y.get(ke.nodeId)]},zr=ke.position,cr=(ir=ur,{x:(lr=zr).x-ir.x,y:lr.y-ir.y});Sr.x+=cr.x,Sr.y+=cr.y}),Sr.x/=d.fixedNodeConstraint.length,Sr.y/=d.fixedNodeConstraint.length,b.forEach(function(ke,ze){b[ze]+=Sr.x}),T.forEach(function(ke,ze){T[ze]+=Sr.y}),d.fixedNodeConstraint.forEach(function(ke){b[y.get(ke.nodeId)]=ke.position.x,T[y.get(ke.nodeId)]=ke.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var Rr=d.alignmentConstraint.vertical,Mr=function(ke){var ze=new Set;Rr[ke].forEach(function(ur){ze.add(ur)});var lr=new Set([].concat(o(ze)).filter(function(ur){return z.has(ur)})),ir=void 0;ir=lr.size>0?b[y.get(lr.values().next().value)]:ot(ze).x,ze.forEach(function(ur){z.has(ur)||(b[y.get(ur)]=ir)})},er=0;er<Rr.length;er++)Mr(er);if(d.alignmentConstraint.horizontal)for(var Xr=d.alignmentConstraint.horizontal,Kr=function(ke){var ze=new Set;Xr[ke].forEach(function(ur){ze.add(ur)});var lr=new Set([].concat(o(ze)).filter(function(ur){return z.has(ur)})),ir=void 0;ir=lr.size>0?T[y.get(lr.values().next().value)]:ot(ze).y,ze.forEach(function(ur){z.has(ur)||(T[y.get(ur)]=ir)})},Ur=0;Ur<Xr.length;Ur++)Kr(Ur)}d.relativePlacementConstraint&&(function(){var ke=new Map,ze=new Map,lr=new Map,ir=new Map,ur=new Map,zr=new Map,cr=new Set,Nr=new Set;if(z.forEach(function(bt){cr.add(bt),Nr.add(bt)}),d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var Fr=d.alignmentConstraint.vertical,sa=function(bt){lr.set("dummy"+bt,[]),Fr[bt].forEach(function(Nt){ke.set(Nt,"dummy"+bt),lr.get("dummy"+bt).push(Nt),z.has(Nt)&&cr.add("dummy"+bt)}),ur.set("dummy"+bt,b[y.get(Fr[bt][0])])},yr=0;yr<Fr.length;yr++)sa(yr);if(d.alignmentConstraint.horizontal)for(var kr=d.alignmentConstraint.horizontal,pr=function(bt){ir.set("dummy"+bt,[]),kr[bt].forEach(function(Nt){ze.set(Nt,"dummy"+bt),ir.get("dummy"+bt).push(Nt),z.has(Nt)&&Nr.add("dummy"+bt)}),zr.set("dummy"+bt,T[y.get(kr[bt][0])])},rr=0;rr<kr.length;rr++)pr(rr)}var Pr=new Map,ta=new Map,wr=function(bt){lt.get(bt).forEach(function(Nt){var Dt=void 0,st=void 0;Nt.direction=="horizontal"?(Dt=ke.get(bt)?ke.get(bt):bt,st=ke.get(Nt.id)?{id:ke.get(Nt.id),gap:Nt.gap,direction:Nt.direction}:Nt,Pr.has(Dt)?Pr.get(Dt).push(st):Pr.set(Dt,[st]),Pr.has(st.id)||Pr.set(st.id,[])):(Dt=ze.get(bt)?ze.get(bt):bt,st=ze.get(Nt.id)?{id:ze.get(Nt.id),gap:Nt.gap,direction:Nt.direction}:Nt,ta.has(Dt)?ta.get(Dt).push(st):ta.set(Dt,[st]),ta.has(st.id)||ta.set(st.id,[]))})},Sa=!0,ca=!1,ba=void 0;try{for(var ra,Dr=lt.keys()[Symbol.iterator]();!(Sa=(ra=Dr.next()).done);Sa=!0)wr(ra.value)}catch(bt){ca=!0,ba=bt}finally{try{!Sa&&Dr.return&&Dr.return()}finally{if(ca)throw ba}}var la=N(Pr),qr=N(ta),ma=re(la),Ja=re(qr),sn=Q(Pr),fn=Q(ta),Na=[],Cn=[];ma.forEach(function(bt,Nt){Na[Nt]=[],bt.forEach(function(Dt){sn.get(Dt).length==0&&Na[Nt].push(Dt)})}),Ja.forEach(function(bt,Nt){Cn[Nt]=[],bt.forEach(function(Dt){fn.get(Dt).length==0&&Cn[Nt].push(Dt)})});var Mn=dt(Pr,"horizontal",cr,ur,Na),nn=dt(ta,"vertical",Nr,zr,Cn),An=function(bt){lr.get(bt)?lr.get(bt).forEach(function(Nt){b[y.get(Nt)]=Mn.get(bt)}):b[y.get(bt)]=Mn.get(bt)},dn=!0,Ln=!1,Fn=void 0;try{for(var g,tt=Mn.keys()[Symbol.iterator]();!(dn=(g=tt.next()).done);dn=!0)An(g.value)}catch(bt){Ln=!0,Fn=bt}finally{try{!dn&&tt.return&&tt.return()}finally{if(Ln)throw Fn}}var B=function(bt){ir.get(bt)?ir.get(bt).forEach(function(Nt){T[y.get(Nt)]=nn.get(bt)}):T[y.get(bt)]=nn.get(bt)},K=!0,H=!1,yt=void 0;try{for(var ut,ht=nn.keys()[Symbol.iterator]();!(K=(ut=ht.next()).done);K=!0)B(ut.value)}catch(bt){H=!0,yt=bt}finally{try{!K&&ht.return&&ht.return()}finally{if(H)throw yt}}})()}for(var Jr=0;Jr<I.length;Jr++){var Yr=I[Jr];Yr.getChild()==null&&Yr.setCenter(b[y.get(Yr.id)],T[y.get(Yr.id)])}},w.exports=r},551:w=>{w.exports=L}},P={},E=(function w(p){var s=P[p];if(s!==void 0)return s.exports;var o=P[p]={exports:{}};return j[p](o,o.exports,w),o.exports})(45);return E})()});var Wn=Gi.coseBase,Dp=Gi.layoutBase;function Zi(L,j){let P=Ig(L),E=P.filter(o=>Ng(o,L)),w=0,p=0,s=[];if(E.length>1){let o=lh(E);for(let M=0;M<E.length;++M){let f=E[M];f.angle=Math.atan2(f.x-o.x,f.y-o.y)}E.sort((M,f)=>f.angle-M.angle);let v=E[E.length-1];for(let M=0;M<E.length;++M){let f=E[M];p+=(v.x+f.x)*(f.y-v.y);let u={x:(f.x+v.x)/2,y:(f.y+v.y)/2},r=null;for(let h=0;h<f.parentIndex.length;++h)if(v.parentIndex.includes(f.parentIndex[h])){let d=L[f.parentIndex[h]],n=Math.atan2(f.x-d.x,f.y-d.y),y=Math.atan2(v.x-d.x,v.y-d.y),b=y-n;b<0&&(b+=2*Math.PI);let T=y-b/2,I=Sn(u,{x:d.x+d.radius*Math.sin(T),y:d.y+d.radius*Math.cos(T)});I>d.radius*2&&(I=d.radius*2),(r==null||r.width>I)&&(r={circle:d,width:I,p1:f,p2:v,large:I>d.radius,sweep:!0})}r!=null&&(s.push(r),w+=gs(r.circle.radius,r.width),v=f)}}else{let o=L[0];for(let M=1;M<L.length;++M)L[M].radius<o.radius&&(o=L[M]);let v=!1;for(let M=0;M<L.length;++M)if(Sn(L[M],o)>Math.abs(o.radius-L[M].radius)){v=!0;break}v?w=p=0:(w=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-1e-10,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return p/=2,j&&(j.area=w+p,j.arcArea=w,j.polygonArea=p,j.arcs=s,j.innerPoints=E,j.intersectionPoints=P),w+p}function Ng(L,j){return j.every(P=>Sn(L,P)<P.radius+1e-10)}function Ig(L){let j=[];for(let P=0;P<L.length;++P)for(let E=P+1;E<L.length;++E){let w=sh(L[P],L[E]);for(let p of w)p.parentIndex=[P,E],j.push(p)}return j}function gs(L,j){return L*L*Math.acos(1-j/L)-(L-j)*Math.sqrt(j*(2*L-j))}function Sn(L,j){return Math.sqrt((L.x-j.x)*(L.x-j.x)+(L.y-j.y)*(L.y-j.y))}function xs(L,j,P){if(P>=L+j)return 0;if(P<=Math.abs(L-j))return Math.PI*Math.min(L,j)*Math.min(L,j);let E=L-(P*P-j*j+L*L)/(2*P),w=j-(P*P-L*L+j*j)/(2*P);return gs(L,E)+gs(j,w)}function sh(L,j){let P=Sn(L,j),E=L.radius,w=j.radius;if(P>=E+w||P<=Math.abs(E-w))return[];let p=(E*E-w*w+P*P)/(2*P),s=Math.sqrt(E*E-p*p),o=L.x+p*(j.x-L.x)/P,v=L.y+p*(j.y-L.y)/P,M=-(j.y-L.y)*(s/P),f=-(j.x-L.x)*(s/P);return[{x:o+M,y:v-f},{x:o-M,y:v+f}]}function lh(L){let j={x:0,y:0};for(let P of L)j.x+=P.x,j.y+=P.y;return j.x/=L.length,j.y/=L.length,j}function Pg(L,j,P,E){E=E||{};let w=E.maxIterations||100,p=E.tolerance||1e-10,s=L(j),o=L(P),v=P-j;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return j;if(o===0)return P;for(let M=0;M<w;++M){v/=2;let f=j+v,u=L(f);if(u*s>=0&&(j=f),Math.abs(v)<p||u===0)return f}return j+v}function ps(L){let j=new Array(L);for(let P=0;P<L;++P)j[P]=0;return j}function oh(L,j){return ps(L).map(()=>ps(j))}function hi(L,j){let P=0;for(let E=0;E<L.length;++E)P+=L[E]*j[E];return P}function ms(L){return Math.sqrt(hi(L,L))}function ys(L,j,P){for(let E=0;E<j.length;++E)L[E]=j[E]*P}function Un(L,j,P,E,w){for(let p=0;p<L.length;++p)L[p]=j*P[p]+E*w[p]}function hh(L,j,P){P=P||{};let E=P.maxIterations||j.length*200,w=P.nonZeroDelta||1.05,p=P.zeroDelta||.001,s=P.minErrorDelta||1e-6,o=P.minErrorDelta||1e-5,v=P.rho!==void 0?P.rho:1,M=P.chi!==void 0?P.chi:2,f=P.psi!==void 0?P.psi:-.5,u=P.sigma!==void 0?P.sigma:.5,r,h=j.length,d=new Array(h+1);d[0]=j,d[0].fx=L(j),d[0].id=0;for(let X=0;X<h;++X){let Z=j.slice();Z[X]=Z[X]?Z[X]*w:p,d[X+1]=Z,d[X+1].fx=L(Z),d[X+1].id=X+1}function n(X){for(let Z=0;Z<X.length;Z++)d[h][Z]=X[Z];d[h].fx=X.fx}let y=(X,Z)=>X.fx-Z.fx,b=j.slice(),T=j.slice(),I=j.slice(),F=j.slice();for(let X=0;X<E;++X){if(d.sort(y),P.history){let ot=d.map(dt=>{let xt=dt.slice();return xt.fx=dt.fx,xt.id=dt.id,xt});ot.sort((dt,xt)=>dt.id-xt.id),P.history.push({x:d[0].slice(),fx:d[0].fx,simplex:ot})}r=0;for(let ot=0;ot<h;++ot)r=Math.max(r,Math.abs(d[0][ot]-d[1][ot]));if(Math.abs(d[0].fx-d[h].fx)<s&&r<o)break;for(let ot=0;ot<h;++ot){b[ot]=0;for(let dt=0;dt<h;++dt)b[ot]+=d[dt][ot];b[ot]/=h}let Z=d[h];if(Un(T,1+v,b,-v,Z),T.fx=L(T),T.fx<d[0].fx)Un(F,1+M,b,-M,Z),F.fx=L(F),F.fx<T.fx?n(F):n(T);else if(T.fx>=d[h-1].fx){let ot=!1;if(T.fx>Z.fx?(Un(I,1+f,b,-f,Z),I.fx=L(I),I.fx<Z.fx?n(I):ot=!0):(Un(I,1-f*v,b,f*v,Z),I.fx=L(I),I.fx<T.fx?n(I):ot=!0),ot){if(u>=1)break;for(let dt=1;dt<d.length;++dt)Un(d[dt],1-u,d[0],u,d[dt]),d[dt].fx=L(d[dt])}}else n(T)}return d.sort(y),{fx:d[0].fx,x:d[0]}}function Dg(L,j,P,E,w,p,s){let o=P.fx,v=hi(P.fxprime,j),M=o,f=o,u=v,r=0;w=w||1,p=p||1e-6,s=s||.1;function h(d,n,y){for(let b=0;b<16;++b)if(w=(d+n)/2,Un(E.x,1,P.x,w,j),M=E.fx=L(E.x,E.fxprime),u=hi(E.fxprime,j),M>o+p*w*v||M>=y)n=w;else{if(Math.abs(u)<=-s*v)return w;u*(n-d)>=0&&(n=d),d=w,y=M}return 0}for(let d=0;d<10;++d){if(Un(E.x,1,P.x,w,j),M=E.fx=L(E.x,E.fxprime),u=hi(E.fxprime,j),M>o+p*w*v||d&&M>=f)return h(r,w,f);if(Math.abs(u)<=-s*v)return w;if(u>=0)return h(w,r,M);f=M,r=w,w*=2}return w}function Og(L,j,P){let E={x:j.slice(),fx:0,fxprime:j.slice()},w={x:j.slice(),fx:0,fxprime:j.slice()},p=j.slice(),s,o,v=1,M;P=P||{},M=P.maxIterations||j.length*20,E.fx=L(E.x,E.fxprime),s=E.fxprime.slice(),ys(s,E.fxprime,-1);for(let f=0;f<M;++f){if(v=Dg(L,s,E,w,v),P.history&&P.history.push({x:E.x.slice(),fx:E.fx,fxprime:E.fxprime.slice(),alpha:v}),!v)ys(s,E.fxprime,-1);else{Un(p,1,w.fxprime,-1,E.fxprime);let u=hi(E.fxprime,E.fxprime),r=Math.max(0,hi(p,w.fxprime)/u);Un(s,r,s,-1,w.fxprime),o=E,E=w,w=o}if(ms(E.fxprime)<=1e-5)break}return P.history&&P.history.push({x:E.x.slice(),fx:E.fx,fxprime:E.fxprime.slice(),alpha:v}),E}function Rg(L,j={}){j.maxIterations=j.maxIterations||500;let P=j.initialLayout||Wg,E=j.lossFunction||Ki,w=zg(L,j),p=P(w,j),s=Object.keys(p),o=[];for(let f of s)o.push(p[f].x),o.push(p[f].y);let M=hh(f=>{let u={};for(let r=0;r<s.length;++r){let h=s[r];u[h]={x:f[2*r],y:f[2*r+1],radius:p[h].radius}}return E(u,w)},o,j).x;for(let f=0;f<s.length;++f){let u=s[f];p[u].x=M[2*f],p[u].y=M[2*f+1]}return p}var ch=1e-10;function ws(L,j,P){return Math.min(L,j)*Math.min(L,j)*Math.PI<=P+ch?Math.abs(L-j):Pg(E=>xs(L,j,E)-P,0,L+j)}function zg(L,j={}){let P=j.distinct,E=L.map(o=>Object.assign({},o));function w(o){return o.join(";")}if(P){let o=new Map;for(let v of E)for(let M=0;M<v.sets.length;M++){let f=String(v.sets[M]);o.set(f,v.size+(o.get(f)||0));for(let u=M+1;u<v.sets.length;u++){let r=String(v.sets[u]),h=`${f};${r}`,d=`${r};${f}`;o.set(h,v.size+(o.get(h)||0)),o.set(d,v.size+(o.get(d)||0))}}for(let v of E)v.sets.length<3&&(v.size=o.get(w(v.sets)))}let p=[],s=new Set;for(let o of E)if(o.sets.length===1)p.push(o.sets[0]);else if(o.sets.length===2){let v=o.sets[0],M=o.sets[1];s.add(w(o.sets)),s.add(w([M,v]))}p.sort((o,v)=>o===v?0:o<v?-1:1);for(let o=0;o<p.length;++o){let v=p[o];for(let M=o+1;M<p.length;++M){let f=p[M];s.has(w([v,f]))||E.push({sets:[v,f],size:0})}}return E}function Bg(L,j,P){let E=oh(j.length,j.length),w=oh(j.length,j.length);return L.filter(p=>p.sets.length===2).forEach(p=>{let s=P[p.sets[0]],o=P[p.sets[1]],v=Math.sqrt(j[s].size/Math.PI),M=Math.sqrt(j[o].size/Math.PI),f=ws(v,M,p.size);E[s][o]=E[o][s]=f;let u=0;p.size+1e-10>=Math.min(j[s].size,j[o].size)?u=1:p.size<=1e-10&&(u=-1),w[s][o]=w[o][s]=u}),{distances:E,constraints:w}}function Hg(L,j,P,E){for(let p=0;p<j.length;++p)j[p]=0;let w=0;for(let p=0;p<P.length;++p){let s=L[2*p],o=L[2*p+1];for(let v=p+1;v<P.length;++v){let M=L[2*v],f=L[2*v+1],u=P[p][v],r=E[p][v],h=(M-s)*(M-s)+(f-o)*(f-o),d=Math.sqrt(h),n=h-u*u;r>0&&d<=u||r<0&&d>=u||(w+=2*n*n,j[2*p]+=4*n*(s-M),j[2*p+1]+=4*n*(o-f),j[2*v]+=4*n*(M-s),j[2*v+1]+=4*n*(f-o))}}return w}function Wg(L,j={}){let P=Yg(L,j),E=j.lossFunction||Ki;if(L.length>=8){let w=Ug(L,j),p=E(w,L),s=E(P,L);p+1e-8<s&&(P=w)}return P}function Ug(L,j={}){let P=j.restarts||10,E=[],w={};for(let r of L)r.sets.length===1&&(w[r.sets[0]]=E.length,E.push(r));let{distances:p,constraints:s}=Bg(L,E,w),o=ms(p.map(ms))/p.length;p=p.map(r=>r.map(h=>h/o));let v=(r,h)=>Hg(r,h,p,s),M=null;for(let r=0;r<P;++r){let h=ps(p.length*2).map(Math.random),d=Og(v,h,j);(!M||d.fx<M.fx)&&(M=d)}let f=M.x,u={};for(let r=0;r<E.length;++r){let h=E[r];u[h.sets[0]]={x:f[2*r]*o,y:f[2*r+1]*o,radius:Math.sqrt(h.size/Math.PI)}}if(j.history)for(let r of j.history)ys(r.x,o);return u}function Yg(L,j){let P=j&&j.lossFunction?j.lossFunction:Ki,E={},w={};for(let u of L)if(u.sets.length===1){let r=u.sets[0];E[r]={x:1e10,y:1e10,rowid:E.length,size:u.size,radius:Math.sqrt(u.size/Math.PI)},w[r]=[]}L=L.filter(u=>u.sets.length===2);for(let u of L){let r=u.weight!=null?u.weight:1,h=u.sets[0],d=u.sets[1];u.size+ch>=Math.min(E[h].size,E[d].size)&&(r=0),w[h].push({set:d,size:u.size,weight:r}),w[d].push({set:h,size:u.size,weight:r})}let p=[];Object.keys(w).forEach(u=>{let r=0;for(let h=0;h<w[u].length;++h)r+=w[u][h].size*w[u][h].weight;p.push({set:u,size:r})});function s(u,r){return r.size-u.size}p.sort(s);let o={};function v(u){return u.set in o}function M(u,r){E[r].x=u.x,E[r].y=u.y,o[r]=!0}M({x:0,y:0},p[0].set);for(let u=1;u<p.length;++u){let r=p[u].set,h=w[r].filter(v),d=E[r];if(h.sort(s),h.length===0)throw"ERROR: missing pairwise overlap information";let n=[];for(var f=0;f<h.length;++f){let T=E[h[f].set],I=ws(d.radius,T.radius,h[f].size);n.push({x:T.x+I,y:T.y}),n.push({x:T.x-I,y:T.y}),n.push({y:T.y+I,x:T.x}),n.push({y:T.y-I,x:T.x});for(let F=f+1;F<h.length;++F){let X=E[h[F].set],Z=ws(d.radius,X.radius,h[F].size),ot=sh({x:T.x,y:T.y,radius:I},{x:X.x,y:X.y,radius:Z});n.push(...ot)}}let y=1e50,b=n[0];for(let T of n){E[r].x=T.x,E[r].y=T.y;let I=P(E,L);I<y&&(y=I,b=T)}M(b,r)}return E}function Ki(L,j){let P=0;for(let E of j){if(E.sets.length===1)continue;let w;if(E.sets.length===2){let s=L[E.sets[0]],o=L[E.sets[1]];w=xs(s.radius,o.radius,Sn(s,o))}else w=Zi(E.sets.map(s=>L[s]));let p=E.weight!=null?E.weight:1;P+=p*(w-E.size)*(w-E.size)}return P}function Vg(L,j){let P=0;for(let E of j){if(E.sets.length===1)continue;let w;if(E.sets.length===2){let o=L[E.sets[0]],v=L[E.sets[1]];w=xs(o.radius,v.radius,Sn(o,v))}else w=Zi(E.sets.map(o=>L[o]));let p=E.weight!=null?E.weight:1,s=Math.log((w+1)/(E.size+1));P+=p*s*s}return P}function jg(L,j,P){if(P==null?L.sort((w,p)=>p.radius-w.radius):L.sort(P),L.length>0){let w=L[0].x,p=L[0].y;for(let s of L)s.x-=w,s.y-=p}if(L.length===2&&Sn(L[0],L[1])<Math.abs(L[1].radius-L[0].radius)&&(L[1].x=L[0].x+L[0].radius-L[1].radius-1e-10,L[1].y=L[0].y),L.length>1){let w=Math.atan2(L[1].x,L[1].y)-j,p=Math.cos(w),s=Math.sin(w);for(let o of L){let v=o.x,M=o.y;o.x=p*v-s*M,o.y=s*v+p*M}}if(L.length>2){let w=Math.atan2(L[2].x,L[2].y)-j;for(;w<0;)w+=2*Math.PI;for(;w>2*Math.PI;)w-=2*Math.PI;if(w>Math.PI){let p=L[1].y/(1e-10+L[1].x);for(let s of L){var E=(s.x+p*s.y)/(1+p*p);s.x=2*E-s.x,s.y=2*E*p-s.y}}}}function Xg(L){L.forEach(w=>{w.parent=w});function j(w){return w.parent!==w&&(w.parent=j(w.parent)),w.parent}function P(w,p){let s=j(w),o=j(p);s.parent=o}for(let w=0;w<L.length;++w)for(let p=w+1;p<L.length;++p){let s=L[w].radius+L[p].radius;Sn(L[w],L[p])+1e-10<s&&P(L[p],L[w])}let E=new Map;for(let w=0;w<L.length;++w){let p=j(L[w]).parent.setid;E.has(p)||E.set(p,[]),E.get(p).push(L[w])}return L.forEach(w=>{delete w.parent}),Array.from(E.values())}function bs(L){let j=P=>{let E=L.reduce((p,s)=>Math.max(p,s[P]+s.radius),Number.NEGATIVE_INFINITY),w=L.reduce((p,s)=>Math.min(p,s[P]-s.radius),Number.POSITIVE_INFINITY);return{max:E,min:w}};return{xRange:j("x"),yRange:j("y")}}function qg(L,j,P){j==null&&(j=Math.PI/2);let E=uh(L).map(M=>Object.assign({},M)),w=Xg(E);for(let M of w){jg(M,j,P);let f=bs(M);M.size=(f.xRange.max-f.xRange.min)*(f.yRange.max-f.yRange.min),M.bounds=f}w.sort((M,f)=>f.size-M.size),E=w[0];let p=E.bounds,s=(p.xRange.max-p.xRange.min)/50;function o(M,f,u){if(!M)return;let r=M.bounds,h,d;if(f)h=p.xRange.max-r.xRange.min+s;else{h=p.xRange.max-r.xRange.max;let n=(r.xRange.max-r.xRange.min)/2-(p.xRange.max-p.xRange.min)/2;n<0&&(h+=n)}if(u)d=p.yRange.max-r.yRange.min+s;else{d=p.yRange.max-r.yRange.max;let n=(r.yRange.max-r.yRange.min)/2-(p.yRange.max-p.yRange.min)/2;n<0&&(d+=n)}for(let n of M)n.x+=h,n.y+=d,E.push(n)}let v=1;for(;v<w.length;)o(w[v],!0,!1),o(w[v+1],!1,!0),o(w[v+2],!0,!0),v+=3,p=bs(E);return fh(E)}function $g(L,j,P,E,w){let p=uh(L);j-=2*E,P-=2*E;let{xRange:s,yRange:o}=bs(p);if(s.max===s.min||o.max===o.min)return console.log("not scaling solution: zero size detected"),L;let v,M;if(w){let h=Math.sqrt(w/Math.PI)*2;v=j/h,M=P/h}else v=j/(s.max-s.min),M=P/(o.max-o.min);let f=Math.min(M,v),u=(j-(s.max-s.min)*f)/2,r=(P-(o.max-o.min)*f)/2;return fh(p.map(h=>({radius:f*h.radius,x:E+u+(h.x-s.min)*f,y:E+r+(h.y-o.min)*f,setid:h.setid})))}function fh(L){let j={};for(let P of L)j[P.setid]=P;return j}function uh(L){return Object.keys(L).map(P=>Object.assign(L[P],{setid:P}))}function ds(L,j,P){let E=j[0].radius-Sn(j[0],L);for(let w=1;w<j.length;++w){let p=j[w].radius-Sn(j[w],L);p<=E&&(E=p)}for(let w=0;w<P.length;++w){let p=Sn(P[w],L)-P[w].radius;p<=E&&(E=p)}return E}function vh(L,j,P){let E=[];for(let f of L)E.push({x:f.x,y:f.y}),E.push({x:f.x+f.radius/2,y:f.y}),E.push({x:f.x-f.radius/2,y:f.y}),E.push({x:f.x,y:f.y+f.radius/2}),E.push({x:f.x,y:f.y-f.radius/2});let w=E[0],p=ds(E[0],L,j);for(let f=1;f<E.length;++f){let u=ds(E[f],L,j);u>=p&&(w=E[f],p=u)}let s=hh(f=>-1*ds({x:f[0],y:f[1]},L,j),[w.x,w.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:P?0:s[0],y:s[1]},v=!0;for(let f of L)if(Sn(o,f)>f.radius){v=!1;break}for(let f of j)if(Sn(o,f)<f.radius){v=!1;break}if(v)return o;if(L.length==1)return{x:L[0].x,y:L[0].y};let M={};return Zi(L,M),M.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:M.arcs.length==1?{x:M.arcs[0].circle.x,y:M.arcs[0].circle.y}:j.length?vh(L,[]):lh(M.arcs.map(f=>f.p1))}function Gg(L){let j={},P=Object.keys(L);for(let E of P)j[E]=[];for(let E=0;E<P.length;E++){let w=P[E],p=L[w];for(let s=E+1;s<P.length;++s){let o=P[s],v=L[o],M=Sn(p,v);M+v.radius<=p.radius+1e-10?j[o].push(w):M+p.radius<=v.radius+1e-10&&j[w].push(o)}}return j}function Zg(L,j,P){let E={},w=Gg(L);for(let p=0;p<j.length;++p){let s=j[p].sets,o={},v={};for(let r=0;r<s.length;++r){o[s[r]]=!0;let h=w[s[r]];for(let d=0;d<h.length;++d)v[h[d]]=!0}let M=[],f=[];for(let r in L)r in o?M.push(L[r]):r in v||f.push(L[r]);let u=vh(M,f,P);E[s]=u,u.disjoint&&j[p].size>0&&console.log("WARNING: area "+s+" not represented on screen")}return E}function Kg(L,j,P){let E=[];return E.push(`
+`||this.input[this.pos]==="\r"},L.prototype.save=function(){return{pos:this.pos,line:this.line,col:this.col}},L.prototype.restore=function(s){this.pos=s.pos,this.line=s.line,this.col=s.col},L.prototype.readBalanced=function(s,o){if(this.input[this.pos]!==s)return null;this.advance();for(var d=1,M=this.pos;this.pos<this.len&&d>0;){var f=this.input[this.pos];if(f===s)d++;else if(f===o){if(d--,d===0){var u=this.input.substring(M,this.pos);return this.advance(),u}}else if(f==='"'||f==="'"){var r=f;for(this.advance();this.pos<this.len&&this.input[this.pos]!==r;)this.input[this.pos]==="\\"&&this.advance(),this.advance();this.pos<this.len&&this.advance();continue}this.advance()}return this.input.substring(M)},L.prototype.parseDirective=function(){if(this.peekStr(3)!=="%%{")return null;this.advance(3);var s=this.readUntil("}%%");try{var o=s.indexOf(":");if(o>=0){var d=s.substring(0,o).trim(),M=s.substring(o+1).trim();if(d==="init"||d==="initialize")try{return JSON.parse(M)}catch(f){return JSON.parse(M.replace(/'/g,'"'))}}}catch(f){}return null},L.prototype.parseFrontmatter=function(){if(this.peekStr(3)!=="---")return null;this.advance(3),this.pos<this.len&&this.input[this.pos]==="\r"&&this.advance(),this.pos<this.len&&this.input[this.pos]===`
+`&&this.advance();var s=this.readUntil("---");try{return E(s)}catch(o){return null}},L.prototype.parseClassDef=function(){this.skipSpaces();var s=this.readWord();if(!s)return null;this.skipSpaces();var o=this.readLine().trim();return{name:s,styles:o}},L.prototype.parseStyleDef=function(){this.skipSpaces();for(var s=[],o=this.readId();o&&(s.push(o),this.skipSpaces(),this.peek()===",");)this.advance(),this.skipSpaces(),o=this.readId();this.skipSpaces();var d=this.readLine().trim();return{nodeIds:s,styles:d}},L.prototype.parseClick=function(){this.skipSpaces();var s=this.readId();if(!s)return null;this.skipSpaces();var o=null,d=null,M=null,f=this.readWord();f==="href"||f==="call"?(o=f,this.skipSpaces(),this.peek()==='"'||this.peek()==="'"?d=this.readQuoted():d=this.readWord()):this.peek()==='"'||this.peek()==="'"?(o="href",d=this.readQuoted()):(o="callback",d=f),this.skipSpaces(),(this.peek()==='"'||this.peek()==="'")&&(M=this.readQuoted()),this.skipSpaces();var u=null;if(this.peek()==="_"){var r=this.readWord();(r==="_blank"||r==="_self"||r==="_parent"||r==="_top")&&(u=r)}for(;!this.isEof()&&!this.isEol();){if(this.peek()===";"){this.advance();break}this.advance()}return{nodeId:s,action:o,url:d,tooltip:M,linkTarget:u}};function E(s){for(var o={},d=s.split(`
+`),M=o,f=[{indent:-1,obj:o}],u=0;u<d.length;u++){var r=d[u],h=r.replace(/^\s+/,"");if(!(!h||h[0]==="#")){var v=r.length-r.replace(/^\s+/,"").length;if(h[0]==="-"&&h[1]===" "){for(;f.length>1&&f[f.length-1].indent>=v;)f.pop();if(M=f[f.length-1].obj,M._lastKey!=null){var n=M._lastKey;Array.isArray(M[n])||(M[n]=[]),M[n].push(p(h.substring(2).trim()))}continue}var y=h.indexOf(":");if(!(y<0)){for(var b=h.substring(0,y).trim(),T=h.substring(y+1).trim();f.length>1&&f[f.length-1].indent>=v;)f.pop();if(M=f[f.length-1].obj,T===""||T===null){var I={};M[b]=I,M._lastKey=b,f.push({indent:v,obj:I})}else M[b]=p(T),M._lastKey=b}}}return w(o),o}function w(s){if(s&&typeof s=="object"&&!Array.isArray(s)){delete s._lastKey;for(var o in s)s.hasOwnProperty(o)&&w(s[o])}}function p(s){if(s==="true")return!0;if(s==="false")return!1;if(s==="null")return null;if(s[0]==="["&&s[s.length-1]==="]")try{return JSON.parse(s)}catch(u){for(var o=s.substring(1,s.length-1).split(","),d=[],M=0;M<o.length;M++)d.push(p(o[M].trim()));return d}if(s[0]==="{"&&s[s.length-1]==="}")try{return JSON.parse(s)}catch(u){}var f=Number(s);return!isNaN(f)&&s!==""?f:s[0]==='"'&&s[s.length-1]==='"'||s[0]==="'"&&s[s.length-1]==="'"?s.substring(1,s.length-1):s}return L.decodeEntities=P,L})();var Ho=(function(){var L=[["(((",")))","doublecircle"],["((","))","circle"],["([","])","stadium"],["([-","-])","stadium"],["((","))","circle"],["(-","-)","circle"],["(",")","rounded"],["[[","]]","subroutine"],["[(",")]","cylinder"],["[/","/]","lean_right"],["[/","\\]","trapezoid"],["[\\","/]","inv_trapezoid"],["[\\","\\]","lean_left"],["[","]","rect"],["{{","}}","hexagon"],["{","}","diamond"],[">","]","odd"]],j={rectangle:"rect",rect:"rect",process:"rect",proc:"rect",rounded:"rounded",round:"rounded",stadium:"stadium",pill:"stadium",terminal:"terminal",subroutine:"subroutine",subprocess:"subroutine",subproc:"subroutine","framed-rectangle":"subroutine","fr-rect":"subroutine",database:"cylinder",cylinder:"cylinder",cyl:"cylinder",db:"cylinder",circle:"circle",circ:"circle",diamond:"diamond",decision:"diamond",diam:"diamond",hexagon:"hexagon",hex:"hexagon",prepare:"hexagon",parallelogram:"lean_right","lean-right":"lean_right","lean-r":"lean_right","in-out":"lean_right","parallelogram-alt":"lean_left","lean-left":"lean_left","lean-l":"lean_left","out-in":"lean_left",trapezoid:"trapezoid","trap-b":"trapezoid",priority:"trapezoid","trapezoid-bottom":"trapezoid","trapezoid-top":"inv_trapezoid","inv-trapezoid":"inv_trapezoid",manual:"inv_trapezoid","trap-t":"inv_trapezoid","double-circle":"doublecircle","dbl-circ":"doublecircle","framed-circle":"doublecircle","fr-circ":"doublecircle",stop:"doublecircle",odd:"odd",odd_right:"odd",flag:"paper-tape","paper-tape":"paper-tape",document:"doc",doc:"doc",delay:"delay","half-rounded-rectangle":"delay","horizontal-cylinder":"das","h-cyl":"das",das:"das","lined-cylinder":"lin-cyl",disk:"lin-cyl","lin-cyl":"lin-cyl","curved-trapezoid":"curv-trap",display:"curv-trap","curv-trap":"curv-trap","divided-process":"div-rect","divided-rectangle":"div-rect","div-rect":"div-rect","div-proc":"div-rect",triangle:"tri",extract:"tri",tri:"tri","window-pane":"win-pane","internal-storage":"win-pane","win-pane":"win-pane","lined-document":"lin-doc","lin-doc":"lin-doc","notched-pentagon":"notch-pent","loop-limit":"notch-pent","notch-pent":"notch-pent","flipped-triangle":"flip-tri","flip-tri":"flip-tri","bow-tie-rectangle":"bow-rect","stored-data":"bow-rect","bow-rect":"bow-rect","crossed-circle":"cross-circ",summary:"cross-circ","cross-circ":"cross-circ","tagged-document":"tag-doc","tag-doc":"tag-doc","tagged-rectangle":"tag-rect","tagged-process":"tag-rect","tag-rect":"tag-rect","tag-proc":"tag-rect","stacked-document":"docs",documents:"docs",docs:"docs","st-doc":"docs","stacked-rectangle":"procs",processes:"procs",procs:"procs","st-rect":"procs","notched-rectangle":"notch-rect",card:"notch-rect","notch-rect":"notch-rect","lined-process":"lin-rect","lined-rectangle":"lin-rect","shaded-process":"lin-rect","lin-rect":"lin-rect","lin-proc":"lin-rect","small-circle":"sm-circ","sm-circ":"sm-circ","filled-circle":"start","f-circ":"start",junction:"start",hourglass:"hourglass",collate:"hourglass",brace:"brace-l","brace-l":"brace-l",comment:"brace-l","brace-r":"brace-r",braces:"braces","lightning-bolt":"bolt",bolt:"bolt","com-link":"bolt",text:"text","manual-file":"manual-file","manual-input":"manual-input","sloped-rectangle":"manual-input","sl-rect":"manual-input","off-page-connector":"manual-file"};function P(_){return _===">"||_==="x"||_==="o"}function E(_){return _==="x"?"arrow_cross":_==="o"?"arrow_circle":"arrow_point"}function w(_){throw new Error("Lexical error on line "+_.line+", col "+_.col+': unrecognized text "'+_.input.substring(_.pos,_.pos+20).replace(/\n/g," ")+'"')}function p(_,l){throw new Error("Parse error on line "+l+": expected edge text before the closing link")}function s(_){for(_.advance();!_.isEof()&&_.peek()!=='"';)_.advance();_.isEof()||_.advance()}function o(_,l){var O=_.input.substring(l,_.pos).replace(/\r\n/g,`
+`).trim();return O.length>0?O:null}function d(_,l){for(var O=_.pos,z=_.line;;){if(_.isEof())throw new Error("Unclosed edge text starting on line "+z+': expected a closing "'+l+l+'" link');var lt=_.peek();if(lt==='"'){s(_);continue}for(var W=lt==="x"||lt==="o"||lt==="<"?1:0,gt=0;_.peek(W+gt)===l;)gt++;if(gt>=3||gt===2&&P(_.peek(W+gt))){var mt=o(_,O);return mt==null&&p(_,z),W===1&&_.advance(),{text:mt,startMarker:W===1?lt:null}}W===0&&(gt===2||gt===1&&l==="=")&&w(_),_.advance()}}function M(_){for(var l=_.pos,O=_.line;;){if(_.isEof())throw new Error("Unclosed edge text starting on line "+O+': expected a closing ".-" link');var z=_.peek();if(z==='"'){s(_);continue}var lt=z==="x"||z==="o"||z==="<",W=lt?1:0;_.peek(W)==="-"&&W++;for(var gt=0;_.peek(W+gt)===".";)gt++;if(gt>0&&_.peek(W+gt)==="-"){var mt=o(_,l);return mt==null&&p(_,O),_.advance(W+gt+1),{text:mt,startMarker:lt?z:null}}z==="."&&w(_),_.advance()}}function f(_){var l=_.save(),O=_.peek(),z="none",lt="none",W="solid",gt=null,mt=0;if(O==="<"?(z="arrow_point",_.advance(),O=_.peek()):O==="o"&&u(_.peek(1))?(z="arrow_circle",_.advance(),O=_.peek()):O==="x"&&u(_.peek(1))&&(z="arrow_cross",_.advance(),O=_.peek()),O==="-")if(_.peek(1)==="."){W="dotted",_.advance(2);for(var Tt=0;_.peek(Tt)===".";)Tt++;if(_.peek(Tt)==="-")_.advance(Tt+1);else{var Rt=M(_);gt=Rt.text,Rt.startMarker!=null&&z==="none"&&(z=E(Rt.startMarker))}}else{if(W="solid",_.advance(),mt=1,_.peek()!=="-")return _.restore(l),null;for(;_.peek()==="-";)_.advance(),mt++;if(mt===2&&!P(_.peek())){var Rt=d(_,"-");gt=Rt.text,Rt.startMarker!=null&&z==="none"&&(z=E(Rt.startMarker));for(var It=0;_.peek()==="-";)_.advance(),It++;mt=Math.max(mt,It)}}else if(O==="="){if(W="thick",_.advance(),mt=1,_.peek()!=="=")return _.restore(l),null;for(;_.peek()==="=";)_.advance(),mt++;if(mt===2&&!P(_.peek())){var Rt=d(_,"=");gt=Rt.text,Rt.startMarker!=null&&z==="none"&&(z=E(Rt.startMarker));for(var te=0;_.peek()==="=";)_.advance(),te++;mt=Math.max(mt,te)}}else if(O==="~"){W="invisible";for(var Qt=0;_.peek(Qt)==="~";)Qt++;return Qt<3&&w(_),_.advance(Qt),{arrowStart:"none",arrowEnd:"none",pattern:W,text:null}}else return _.restore(l),null;O=_.peek(),O===">"?(lt="arrow_point",_.advance()):O==="o"?(lt="arrow_circle",_.advance()):O==="x"&&(lt="arrow_cross",_.advance()),_.skipSpaces(),_.peek()==="|"&&(_.advance(),gt=_.readUntil("|")),gt!=null&&(gt=gt.trim(),(gt[0]==='"'&&gt[gt.length-1]==='"'||gt[0]==="'"&&gt[gt.length-1]==="'")&&(gt=gt.substring(1,gt.length-1)));var pe=lt!=null&&lt!=="none"||z!=null&&z!=="none",ue=pe?2:3,me=mt>ue?mt-(ue-1):1;return me<1&&(me=1),{arrowStart:z,arrowEnd:lt,pattern:W,text:gt,length:me}}function u(_){return _==="-"||_==="."||_==="="||_==="~"}function r(_){if(_==null||_===!1)return!1;if(_===!0)return!0;var l=(""+_).trim().toLowerCase();return l!==""&&l!=="false"&&l!=="0"&&l!=="none"&&l!=="off"}function h(_){var l=_.peek(),O=_.peek(1),z=_.peek(2);if(l==="@"&&O==="{"){_.advance();var lt=_.readBalanced("{","}");try{var W=y(lt),gt=W.shape||W.type||"rect",mt=W.label||W.text||"",Tt=W.icon||null,Rt=W.img||null,It=W.form||null,te=W.pos||null,Qt=W.h!=null?Number(W.h):null,pe=W.w!=null?Number(W.w):null,ue=j[gt]||gt;return Rt?ue="imageSquare":Tt&&(It==="circle"?ue="iconCircle":It==="square"?ue="iconSquare":It==="rounded"?ue="iconRounded":ue="icon"),{shape:ue,label:mt,icon:Tt,img:Rt,form:It,pos:te,assetH:Qt,assetW:pe}}catch(xr){return{shape:"rect",label:lt}}}if(l==="[")return v(_);for(var me=0;me<L.length;me++){var Ee=L[me][0],xe=L[me][1],ar=L[me][2];if(Ee[0]!=="["&&_.input.substring(_.pos,_.pos+Ee.length)===Ee){_.advance(Ee.length);var mt=n(_,xe);return{shape:ar,label:mt}}}return null}function v(_){var l=_.peek(1);if(l==="["){_.advance(2);var W=n(_,"]]");return{shape:"subroutine",label:W}}if(l==="("){_.advance(2);var W=n(_,")]");return{shape:"cylinder",label:W}}if(l==="/"||l==="\\"){_.advance(2);for(var O="",z=null;!_.isEof();){var lt=_.peek();if((lt==="/"||lt==="\\")&&_.peek(1)==="]"){z=lt,_.advance(2);break}if(lt==="]"){z=null,_.advance();break}O+=lt,_.advance()}var W=O.trim();return W.length>=2&&(W[0]==='"'&&W[W.length-1]==='"'||W[0]==="'"&&W[W.length-1]==="'")&&(W=W.substring(1,W.length-1)),l==="/"&&z==="/"?{shape:"lean_right",label:W}:l==="\\"&&z==="\\"?{shape:"lean_left",label:W}:l==="/"&&z==="\\"?{shape:"trapezoid",label:W}:l==="\\"&&z==="/"?{shape:"inv_trapezoid",label:W}:{shape:"lean_right",label:W}}_.advance(1);var W=n(_,"]");return{shape:"rect",label:W}}function n(_,l){for(var O="",z=l.length;!_.isEof();){if(_.input.substring(_.pos,_.pos+z)===l)return _.advance(z),O=O.trim(),O.length>=2&&(O[0]==='"'&&O[O.length-1]==='"'||O[0]==="'"&&O[O.length-1]==="'")&&(O=O.substring(1,O.length-1)),Ua.decodeEntities(O);O+=_.peek(),_.advance()}return Ua.decodeEntities(O)}function y(_){var l=_.replace(/(^|[{,])\s*([a-zA-Z_]\w*)\s*:/g,'$1"$2":');return l=l.replace(/'/g,'"'),l=l.replace(/:\s*([a-zA-Z][a-zA-Z0-9_-]*)\s*([,}]|$)/g,':"$1"$2'),JSON.parse("{"+l+"}")}function b(_){var l=_.peek();if(l==='"'||l==="'")return _.readQuoted();for(var O=_.pos;!_.isEof();){l=_.input[_.pos];var z=l.charCodeAt(0);if(l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||l==="_"||z>127)_.advance();else if(l==="-"){var lt=_.peek(1);if(lt==="-"||lt===">"||lt===".")break;_.advance()}else break}return _.input.substring(O,_.pos)}function T(_){var l=_.save(),O=b(_);if(O&&_.peek()==="@"){var z=_.peek(1);if(u(z)||z==="<"||(z==="o"||z==="x")&&u(_.peek(2)))return _.advance(),O}return _.restore(l),null}function I(_,l,O){var z=new Ua(_),lt={},W=[],gt=[],mt={},Tt={},Rt={},It={},te=[],Qt={},pe=[],ue=null;for(l=l||"TD",z.skipWhitespaceAndComments();!z.isEof()&&(z.skipWhitespaceAndComments(),!z.isEof());)F(z,lt,W,gt,mt,Tt,Rt,It,pe,te,Qt);return ee(lt,mt,It),N(lt,Tt,gt),Q(lt,Rt),at(lt,W,gt,l,O,te,Qt)}function F(_,l,O,z,lt,W,gt,mt,Tt,Rt,It){if(_.skipSpaces(),_.isEol()||_.isEof()){(_.peek()===`
+`||_.peek()==="\r")&&_.advance();return}var te=_.save(),Qt=_.readWord();if(Qt==="subgraph"){pt(_,z,Tt);return}else if(Qt==="end"){if(Tt.length>0&&Tt.pop(),_.skipSpaces(),_.peek()===`
+`||_.peek()==="\r"||_.peek()===";"||_.isEof()){_.peek()===";"&&_.advance();return}_.restore(te)}else if(Qt==="classDef"){var pe=_.parseClassDef();pe&&(lt[pe.name]=pe.styles);return}else if(Qt==="style"){var pe=_.parseStyleDef();if(pe)for(var ue=0;ue<pe.nodeIds.length;ue++)W[pe.nodeIds[ue]]=(W[pe.nodeIds[ue]]||"")+pe.styles;return}else if(Qt==="click"){var pe=_.parseClick();pe&&(gt[pe.nodeId]=pe);return}else if(Qt==="class"){_.skipSpaces();for(var me=[],Ee=_.readId();Ee&&(me.push(Ee),_.skipSpaces(),_.peek()===",");)_.advance(),_.skipSpaces(),Ee=_.readId();_.skipSpaces();var xe=_.readWord();if(xe)for(var ue=0;ue<me.length;ue++)mt[me[ue]]||(mt[me[ue]]=[]),mt[me[ue]].push(xe);xt(_);return}else if(Qt==="direction"){_.skipSpaces();var ar=_.readWord();if(Tt.length>0&&ar){for(var xr=Tt[Tt.length-1],sr=z.length-1;sr>=0;sr--)if(z[sr].id===xr){z[sr].direction=ar.toUpperCase();break}}xt(_);return}else if(Qt==="linkStyle"){_.skipSpaces();var Qe=[],or=_.readWord();if(or==="default")Qe="default";else for(/^\d+$/.test(or)&&Qe.push(parseInt(or,10));_.skipSpaces(),_.peek()===",";){_.advance(),_.skipSpaces();var Wr=_.readWord();if(/^\d+$/.test(Wr))Qe.push(parseInt(Wr,10));else break}_.skipSpaces();for(var oa=_.pos;!_.isEof();){var Sr=_.peek();if(Sr===`
+`||Sr==="\r"||Sr===";")break;_.advance()}var Rr=_.input.substring(oa,_.pos).trim();xt(_),Rr&&(Qe==="default"||Qe.length>0)&&Rt.push({targets:Qe,css:Rr});return}else if(_.peek()==="@"&&_.peek(1)==="{"){_.advance();var Mr=_.readBalanced("{","}"),er=null;try{er=y(Mr)}catch(Xr){er=null}if(er&&("animate"in er||"animation"in er)){It[Qt]=er,xt(_);return}_.restore(te)}else _.restore(te);X(_,l,O,Tt)}function X(_,l,O,z){var lt=K(_,l,z);if(!lt||lt.length===0){xt(_);return}for(;!_.isEof();){_.skipSpaces();var W=_.peek();if(W===`
+`||W==="\r"||W===";"||W===""||_.isEof()){W===";"&&_.advance();break}var gt=_.save(),mt=T(_),Tt=f(_);if(!Tt){_.restore(gt);break}_.skipSpaces();var Rt=K(_,l,z);if(!Rt||Rt.length===0){_.restore(gt);break}for(var It=0;It<lt.length;It++)for(var te=0;te<Rt.length;te++)O.push({sourceId:lt[It],targetId:Rt[te],arrowStart:Tt.arrowStart,arrowEnd:Tt.arrowEnd,pattern:Tt.pattern,text:Tt.text,length:Tt.length||1,edgeId:mt});lt=Rt}}function K(_,l,O){var z=[],lt=ot(_,l,O);if(!lt)return z;for(z.push(lt);!_.isEof();){var W=_.save();if(_.skipSpaces(),_.peek()!=="&"){_.restore(W);break}_.advance(),_.skipSpaces();var gt=ot(_,l,O);if(!gt){_.restore(W);break}z.push(gt)}return z}function ot(_,l,O){var z=b(_);if(!z)return null;var lt=h(_),W=null;if(_.peekStr(3)===":::"){_.advance(3);for(var gt=_.pos;!_.isEof();){var mt=_.input[_.pos];if(mt>="a"&&mt<="z"||mt>="A"&&mt<="Z"||mt>="0"&&mt<="9"||mt==="_")_.advance();else break}W=_.input.substring(gt,_.pos)}return l[z]?(lt&&(l[z].shape=lt.shape,l[z].label=lt.label,lt.icon&&(l[z].icon=lt.icon),lt.img&&(l[z].img=lt.img),lt.form&&(l[z].form=lt.form),lt.pos&&(l[z].pos=lt.pos),lt.assetH!=null&&(l[z].assetH=lt.assetH),lt.assetW!=null&&(l[z].assetW=lt.assetW)),W&&l[z].classes.push(W),O.length>0&&!l[z].subgraph&&(l[z].subgraph=O[O.length-1])):l[z]={id:z,shape:lt?lt.shape:"rect",label:lt?lt.label:z,icon:lt?lt.icon:null,img:lt?lt.img:null,form:lt?lt.form:null,pos:lt?lt.pos:null,assetH:lt?lt.assetH:null,assetW:lt?lt.assetW:null,classes:W?[W]:[],cssStyles:null,link:null,linkTarget:null,tooltip:null,subgraph:O.length>0?O[O.length-1]:null},z}function pt(_,l,O){_.skipSpaces();var z=null,lt=null,W=_.save(),gt=_.readLine().trim();gt[gt.length-1]===";"&&(gt=gt.substring(0,gt.length-1).trim());var mt=gt.indexOf("[");mt>=0?(z=gt.substring(0,mt).trim(),lt=gt.substring(mt+1),lt[lt.length-1]==="]"&&(lt=lt.substring(0,lt.length-1)),lt=lt.trim(),lt.length>=2&&(lt[0]==='"'&&lt[lt.length-1]==='"'||lt[0]==="'"&&lt[lt.length-1]==="'")&&(lt=lt.substring(1,lt.length-1))):(z=gt.trim(),lt=z,lt.length>=2&&(lt[0]==='"'&&lt[lt.length-1]==='"'||lt[0]==="'"&&lt[lt.length-1]==="'")&&(lt=lt.substring(1,lt.length-1),z=lt)),z||(z="subgraph_"+l.length);var Tt={id:z,label:mt>=0?lt:lt||z,parent:O.length>0?O[O.length-1]:null};l.push(Tt),O.push(z)}function xt(_){for(;!_.isEof();){var l=_.peek();if(l===`
+`||l==="\r"||l===";"){l===";"&&_.advance();return}_.advance()}}function ee(_,l,O){if(l.default)for(var z in _)_[z].classes.length===0&&(_[z].cssStyles=(_[z].cssStyles||"")+l.default);for(var z in O)if(_[z])for(var lt=0;lt<O[z].length;lt++){var W=O[z][lt];l[W]&&(_[z].cssStyles=(_[z].cssStyles||"")+l[W])}for(var z in _)for(var gt=_[z],lt=0;lt<gt.classes.length;lt++){var W=gt.classes[lt];l[W]&&(gt.cssStyles=(gt.cssStyles||"")+l[W])}}function N(_,l,O){var z={};if(O)for(var lt=0;lt<O.length;lt++)z[O[lt].id]=O[lt];for(var W in l)_[W]?_[W].cssStyles=(_[W].cssStyles||"")+l[W]:z[W]&&(z[W].cssStyles=(z[W].cssStyles||"")+l[W])}function Q(_,l){for(var O in l)if(_[O]){var z=l[O];z.action==="href"&&(_[O].link=z.url,_[O].linkTarget=z.linkTarget||"_blank"),z.tooltip&&(_[O].tooltip=z.tooltip)}}function at(_,l,O,z,lt,W,gt){W=W||[],gt=gt||{};var mt;switch(z.toUpperCase()){case"LR":mt="RIGHT";break;case"RL":mt="LEFT";break;case"BT":mt="UP";break;case"TB":case"TD":default:mt="DOWN";break}for(var Tt={},Rt=[],It=0;It<O.length;It++){var te=O[It],Qt="DOWN",pe=!1;if(te.direction)switch(pe=!0,te.direction){case"LR":Qt="RIGHT";break;case"RL":Qt="LEFT";break;case"BT":Qt="UP";break;case"TB":case"TD":Qt="DOWN";break}Tt[te.id]={id:te.id,labels:[{text:te.label}],layoutOptions:{"elk.algorithm":"layered","elk.direction":Qt,"elk.hierarchyHandling":"INCLUDE_CHILDREN"},children:[],edges:[],drawio:{shape:"group",labelText:te.label,type:"group",cssStyles:te.cssStyles||null,isSubgraph:!0,autoDirection:!pe}},Rt.push(te.id)}for(var It=0;It<O.length;It++){var te=O[It];te.parent&&Tt[te.parent]&&Tt[te.parent].children.push(Tt[te.id])}var ue={};for(var me in _){var Ee=_[me];if(Tt[me]){Ee.label!=null&&Ee.label!==""&&Ee.label!==me&&(Tt[me].drawio.labelText=Ee.label,Tt[me].labels=[{text:Ee.label}]),Ee.cssStyles&&(Tt[me].drawio.cssStyles=Ee.cssStyles),ue[me]=Tt[me];continue}var xe={id:me,labels:[{text:Ee.label}],width:0,height:0,drawio:{shape:Ee.shape,labelText:Ee.label,cssStyles:Ee.cssStyles,link:Ee.link,linkTarget:Ee.linkTarget,tooltip:Ee.tooltip,icon:Ee.icon,img:Ee.img,form:Ee.form,pos:Ee.pos,assetH:Ee.assetH,assetW:Ee.assetW}};ue[me]=xe,Ee.subgraph&&Tt[Ee.subgraph]&&Tt[Ee.subgraph].children.push(xe)}for(var ar=[],It=0;It<O.length;It++)O[It].parent||ar.push(Tt[O[It].id]);for(var me in _)!_[me].subgraph&&!Tt[me]&&ar.push(ue[me]);for(var xr=0,sr=[],Qe={},It=0;It<O.length;It++)Qe[O[It].id]=O[It].parent||null;function or(la){for(var qr=[],ma=la,Ja=0;ma&&Ja++<1e3;)qr.push(ma),ma=Qe[ma];return qr}function Wr(la,qr){if(!la||!qr)return null;for(var ma={},Ja=or(qr),sn=0;sn<Ja.length;sn++)ma[Ja[sn]]=!0;for(var fn=or(la),Na=0;Na<fn.length;Na++)if(ma[fn[Na]])return fn[Na];return null}for(var oa={},Sr={},It=0;It<l.length;It++){var Rr=l[It];oa[Rr.sourceId]=(oa[Rr.sourceId]||0)+1;var Mr=Rr.length||1;(!Sr[Rr.targetId]||Sr[Rr.targetId]<Mr)&&(Sr[Rr.targetId]=Mr)}for(var It=0;It<l.length;It++){var er=l[It],Xr=er.pattern,Kr=null;Xr==="thick"&&(Kr="thick",Xr="solid");var Ur={id:"e"+xr++,sources:[er.sourceId],targets:[er.targetId],drawio:{arrowTypeStart:er.arrowStart,arrowTypeEnd:er.arrowEnd,pattern:Xr,thickness:Kr,text:er.text,length:er.length||1}};er.text&&(Ur.labels=[{text:er.text}]);for(var Jr=0;Jr<W.length;Jr++){var Yr=W[Jr].targets;(Yr==="default"||Yr.indexOf&&Yr.indexOf(It)!==-1)&&(Ur.drawio.style=(Ur.drawio.style?Ur.drawio.style+";":"")+W[Jr].css)}if(er.edgeId&&gt[er.edgeId]){var ke=gt[er.edgeId];if(r(ke.animate)||r(ke.animation)){var ze=(""+ke.animation).trim().toLowerCase()=="slow";Ur.drawio.extraStyle=(Ur.drawio.extraStyle?Ur.drawio.extraStyle+";":"")+"flowAnimation=1;dashed=1;dashPattern=9 5;fixDash=1;flowAnimationDuration="+(ze?889:356)}}var lr=_[er.sourceId]?_[er.sourceId].subgraph:null,ir=_[er.targetId]?_[er.targetId].subgraph:null,ur=Wr(lr,ir);ur&&Tt[ur]?Tt[ur].edges.push(Ur):sr.push(Ur)}for(var zr={},cr={},It=0;It<l.length;It++){var er=l[It];zr[er.sourceId]=(zr[er.sourceId]||0)+1,cr[er.targetId]=(cr[er.targetId]||0)+1}var Nr=!1;for(var me in zr)if(zr[me]>=2){Nr=!0;break}if(!Nr){for(var me in cr)if(cr[me]>=2){Nr=!0;break}}for(var Fr=O.length>0,sa={"elk.algorithm":"layered","elk.direction":mt,"elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":50,"elk.layered.spacing.nodeNodeBetweenLayers":50,"elk.edgeRouting":"ORTHOGONAL","elk.layered.mergeEdges":!0,"elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED"},yr=!1,It=0;It<O.length;It++)if(O[It].parent){yr=!0;break}for(var kr={},It=0;It<l.length;It++){var er=l[It],pr=_[er.sourceId],rr=_[er.targetId];pr&&rr&&pr.subgraph&&pr.subgraph===rr.subgraph&&(kr[er.targetId]=(kr[er.targetId]||0)+1)}for(var Pr=!1,It=0;It<l.length;It++){var er=l[It],ta=_[er.sourceId]?_[er.sourceId].subgraph:null,wr=_[er.targetId]?_[er.targetId].subgraph:null;if(!(Tt[er.sourceId]||Tt[er.targetId])){var Sa=ta!==wr;if(Sa&&kr[er.targetId]){Pr=!0;break}}}Pr&&!yr&&(sa["elk.hierarchyHandling"]="SEPARATE_CHILDREN"),Nr&&!Fr&&(sa["elk.layered.considerModelOrder.strategy"]="PREFER_EDGES");for(var me in ue)if(!Tt[me]){var ca=ue[me],ba=!oa[me],ra=(Sr[me]||1)>=3;ba&&ra&&(ca.layoutOptions||(ca.layoutOptions={}),ca.layoutOptions["elk.layered.layering.layerConstraint"]="LAST_SEPARATE")}var Dr=ar.length>=2&&ar.every(function(la){return la.drawio&&la.drawio.isSubgraph});return sr.length===0&&Dr&&(ar=ar.slice().reverse()),{id:"root",layoutOptions:sa,children:ar,edges:sr,drawio:{direction:z,orthEdges:!1}}}return{parse:I}})();var Wo=(function(){var L={"<|--|>":{type:"extension",startArrow:"extension",endArrow:"extension"},"<|..|>":{type:"extension",startArrow:"extension",endArrow:"extension",dashed:!0},"<|--":{type:"extension",startArrow:"extension",endArrow:"none"},"--|>":{type:"extension",startArrow:"none",endArrow:"extension"},"<|..":{type:"extension",startArrow:"extension",endArrow:"none",dashed:!0},"..|>":{type:"extension",startArrow:"none",endArrow:"extension",dashed:!0},"*--":{type:"composition",startArrow:"composition",endArrow:"none"},"--*":{type:"composition",startArrow:"none",endArrow:"composition"},"*--*":{type:"composition",startArrow:"composition",endArrow:"composition"},"*..*":{type:"composition",startArrow:"composition",endArrow:"composition",dashed:!0},"*..":{type:"composition",startArrow:"composition",endArrow:"none",dashed:!0},"..*":{type:"composition",startArrow:"none",endArrow:"composition",dashed:!0},"o--":{type:"aggregation",startArrow:"aggregation",endArrow:"none"},"--o":{type:"aggregation",startArrow:"none",endArrow:"aggregation"},"o--o":{type:"aggregation",startArrow:"aggregation",endArrow:"aggregation"},"o..o":{type:"aggregation",startArrow:"aggregation",endArrow:"aggregation",dashed:!0},"o..":{type:"aggregation",startArrow:"aggregation",endArrow:"none",dashed:!0},"..o":{type:"aggregation",startArrow:"none",endArrow:"aggregation",dashed:!0},"()--":{type:"lollipop",startArrow:"lollipop",endArrow:"none"},"--()":{type:"lollipop",startArrow:"none",endArrow:"lollipop"},"<--":{type:"association",startArrow:"arrow_barb",endArrow:"none"},"-->":{type:"association",startArrow:"none",endArrow:"arrow_barb"},"<..":{type:"dependency",startArrow:"arrow_barb",endArrow:"none",dashed:!0},"..>":{type:"dependency",startArrow:"none",endArrow:"arrow_barb",dashed:!0},"--":{type:"association",startArrow:"none",endArrow:"none"},"..":{type:"dependency",startArrow:"none",endArrow:"none",dashed:!0},"<..>":{type:"dependency",startArrow:"arrow_barb",endArrow:"arrow_barb",dashed:!0},"<-->":{type:"association",startArrow:"arrow_barb",endArrow:"arrow_barb"}},j=Object.keys(L).sort(function(n,y){return y.length-n.length});function P(n,y,b){var T=new Ua(n),I={},F=[],X=[],K=[],ot={},pt={},xt={},ee={},N=[],Q=[y];for(T.skipWhitespaceAndComments();!T.isEof()&&(T.skipWhitespaceAndComments(),!T.isEof());)E(T,I,F,X,K,ot,pt,xt,ee,N,Q);return h(I,ot,pt,xt,ee),v(I,F,X,K,Q[0],b)}function E(n,y,b,T,I,F,X,K,ot,pt,xt){var ee=n.save(),N=n.readWord();if(N==="class"){w(n,y,pt);return}else if(N==="namespace"){s(n,T,y,b,F,X,K,ot,pt);return}else if(N==="classDef"){var Q=n.parseClassDef();Q&&(F[Q.name]=Q.styles);return}else if(N==="style"){var Q=n.parseStyleDef();if(Q)for(var at=0;at<Q.nodeIds.length;at++)X[Q.nodeIds[at]]=(X[Q.nodeIds[at]]||"")+Q.styles;return}else if(N==="click"||N==="link"){var Q=n.parseClick();Q&&(ot[Q.nodeId]=Q);return}else if(N==="note"){n.skipSpaces();var _=null,l=n.save(),O=n.readWord();O==="for"?(n.skipSpaces(),_=n.readId(),n.skipSpaces()):n.restore(l);var z=null;(n.peek()==='"'||n.peek()==="'"||n.peek()==="`")&&(z=n.readQuoted()),z!=null&&I.push({id:"_note_"+I.length,text:z,forTarget:_}),r(n);return}else if(N==="direction"){n.skipSpaces();var lt=n.readWord();lt&&xt&&(xt[0]=lt),r(n);return}else if(N==="accTitle"||N==="accDescr"){n.skipSpaces(),n.peek()==="{"&&(n.advance(1),n.readUntil("}"),n.peek()==="}"&&n.advance(1)),r(n);return}else n.restore(ee);if(n.peekStr(2)==="<<"){n.advance(2);var W=n.readUntil(">>");n.skipSpaces();var gt=n.readId();gt&&(o(y,gt,pt),y[gt].annotations.push(W)),r(n);return}var mt=f(n);if(!mt){r(n);return}if(n.peekStr(3)===":::"){n.advance(3);var Tt=n.readWord();o(y,mt,pt),K[mt]||(K[mt]=[]),K[mt].push(Tt)}n.skipSpaces();var Rt=null;n.peek()==='"'&&(Rt=n.readQuoted(),n.skipSpaces());var It=u(n);if(It){n.skipSpaces();var te=null;n.peek()==='"'&&(te=n.readQuoted(),n.skipSpaces());var Qt=f(n);if(Qt){var pe=mt,ue=Qt;It.type==="lollipop"?(It.startArrow==="lollipop"?pe=d(y,mt,pt):o(y,mt,pt),It.endArrow==="lollipop"?ue=d(y,Qt,pt):o(y,Qt,pt)):(o(y,mt,pt),o(y,Qt,pt));var me=null;n.skipSpaces(),n.peek()===":"?(n.advance(),n.skipSpaces(),me=n.readLine().trim()):r(n),b.push({sourceId:pe,targetId:ue,rel:It,label:me,sourceCard:Rt,targetCard:te})}else r(n);return}if(n.peek()===":"){n.advance(),n.skipSpaces();var Ee=n.readLine().trim();o(y,mt,pt),Ee&&(Ee.indexOf("(")>=0?y[mt].methods.push(Ee):y[mt].members.push(Ee));return}o(y,mt,pt),r(n)}function w(n,y,b){n.skipSpaces();var T=n.readId();if(!T){r(n);return}if(o(y,T,b),n.peek()==="["){n.advance(),n.skipSpaces();var I=null;if(n.peek()==='"')I=n.readQuoted();else{for(var F="";!n.isEof()&&n.peek()!=="]"&&n.peek()!==`
+`&&n.peek()!=="\r";)F+=n.peek(),n.advance();I=F.trim()}n.peek()==="]"&&n.advance(),I&&(y[T].label=I),n.skipSpaces()}if(n.peekStr(3)===":::"){n.advance(3);var X=n.readWord();y[T].styleClass=X}if(n.skipSpaces(),n.peek()==="~"){n.advance();var K=n.readUntil("~");y[T].type=K}if(n.skipSpaces(),n.peekStr(2)==="<<"){n.advance(2);var ot=n.readUntil(">>");ot&&y[T].annotations.push(ot)}n.skipSpaces(),n.peek()==="{"&&(n.advance(),p(n,y[T])),r(n)}function p(n,y){for(;!n.isEof();){if(n.skipWhitespaceAndComments(),n.peek()==="}"){n.advance();return}if(n.isEof())return;if(n.peekStr(2)==="<<"){n.advance(2);var b=n.readUntil(">>");y.annotations.push(b);continue}var T=n.readLine().trim();if(!T||T==="}")return;T[T.length-1]===";"&&(T=T.substring(0,T.length-1).trim()),T&&(T.indexOf("(")>=0?y.methods.push(T):y.members.push(T))}}function s(n,y,b,T,I,F,X,K,ot){n.skipSpaces();var pt=n.readId();n.skipSpaces();var xt={id:pt,label:pt,classIds:[]};if(y.push(xt),ot.push(pt),n.peek()==="{")for(n.advance();!n.isEof();){if(n.skipWhitespaceAndComments(),n.peek()==="}"){n.advance();break}E(n,b,T,y,[],I,F,X,K,ot,null)}ot.pop()}function o(n,y,b){n[y]||(n[y]={id:y,label:y,members:[],methods:[],annotations:[],type:null,cssStyles:null,link:null,linkTarget:null,tooltip:null,styleClass:null,namespace:b.length>0?b[b.length-1]:null})}function d(n,y,b){var T=0;for(var I in n)I.indexOf("__iface_")===0&&T++;var F="__iface_"+T;return n[F]={id:F,label:y,members:[],methods:[],annotations:[],type:null,cssStyles:null,link:null,linkTarget:null,tooltip:null,styleClass:null,namespace:b.length>0?b[b.length-1]:null,isLollipopInterface:!0},F}function M(n){if(n==null)return!1;var y=n.charCodeAt(0);return n>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"||n==="_"||y>127}function f(n){var y=n.peek();if(y==='"'||y==="'"||y==="`")return n.readQuoted();for(var b=n.pos;n.pos<n.len;){var T=n.input[n.pos];if(M(T))n.advance();else if(T==="-"||T==="."||T==="/")if(M(n.input[n.pos+1]))n.advance();else break;else break}return n.input.substring(b,n.pos)}function u(n){for(var y=0;y<j.length;y++){var b=j[y];if(n.peekStr(b.length)===b)return n.advance(b.length),L[b]}return null}function r(n){for(;!n.isEof();){var y=n.peek();if(y===`
+`||y==="\r"||y===";"){y===";"&&n.advance();return}n.advance()}}function h(n,y,b,T,I){function F(ee,N){if(!N)return ee||"";if(!ee)return N;var Q=/[;,]\s*$/.test(ee)?"":";";return ee+Q+N}var X=y.default||"";for(var K in n)X&&(n[K].cssStyles=F(n[K].cssStyles,X));for(var K in T)if(n[K])for(var ot=0;ot<T[K].length;ot++){var pt=T[K][ot];pt!=="default"&&y[pt]&&(n[K].cssStyles=F(n[K].cssStyles,y[pt]))}for(var K in n)n[K].styleClass&&n[K].styleClass!=="default"&&y[n[K].styleClass]&&(n[K].cssStyles=F(n[K].cssStyles,y[n[K].styleClass]));for(var K in b)n[K]&&(n[K].cssStyles=F(n[K].cssStyles,b[K]));for(var K in I)if(n[K]){var xt=I[K];xt.action==="href"&&(n[K].link=xt.url),xt.tooltip&&(n[K].tooltip=xt.tooltip)}}function v(n,y,b,T,I,F){var X="DOWN";if(I)switch(I.toUpperCase()){case"LR":X="RIGHT";break;case"RL":X="LEFT";break;case"BT":X="UP";break}for(var K={},ot=0;ot<b.length;ot++){var pt=b[ot];K[pt.id]={id:pt.id,labels:[{text:pt.label}],layoutOptions:{"elk.algorithm":"layered","elk.direction":X,"elk.hierarchyHandling":"INCLUDE_CHILDREN"},children:[],edges:[],drawio:{shape:"rounded",labelText:pt.label,type:"group",cssStyles:null,isSubgraph:!0,isClassNamespace:!0}}}var xt={},ee=[],N=!!(F&&F.class&&F.class.hideEmptyMembersBox);for(var Q in n){var at=n[Q],_={id:Q,labels:[{text:at.label}],width:0,height:0,drawio:{shape:at.isLollipopInterface?"lollipopInterface":"class_box",labelText:at.label,type:at.type,cssStyles:at.cssStyles,link:at.link,linkTarget:at.linkTarget,tooltip:at.tooltip,members:at.members,methods:at.methods,annotations:at.annotations,classData:{members:at.members,methods:at.methods,annotations:at.annotations,hideEmptyMembersBox:N}}};xt[Q]=_,at.namespace&&K[at.namespace]?K[at.namespace].children.push(_):ee.push(_)}for(var ot=0;ot<b.length;ot++){var l=K[b[ot].id];if(l&&l.children.length>1)for(var O=0;O<l.children.length-1;O++)l.edges.push({id:"ns_order_"+b[ot].id+"_"+O,sources:[l.children[O].id],targets:[l.children[O+1].id],drawio:{arrowTypeStart:"none",arrowTypeEnd:"none",pattern:"invisible",text:null,invisible:!0}})}for(var ot=0;ot<b.length;ot++)K[b[ot].id]&&ee.push(K[b[ot].id]);for(var z=[],lt=0,ot=0;ot<y.length;ot++){var W=y[ot],gt={id:"e"+lt++,sources:[W.sourceId],targets:[W.targetId],drawio:{arrowTypeStart:W.rel.startArrow,arrowTypeEnd:W.rel.endArrow,pattern:W.rel.dashed?"dashed":"solid",text:W.label,relationship:{type:W.rel.type}}};W.label&&(gt.labels=[{text:W.label}]),W.sourceCard&&(gt.drawio.startLabelRight=W.sourceCard),W.targetCard&&(gt.drawio.endLabelLeft=W.targetCard),z.push(gt)}for(var mt=[],Tt={},ot=0;ot<y.length;ot++){var W=y[ot];if(W.rel.type==="extension"){var Rt=W.rel.startArrow==="extension"?W.targetId:W.rel.endArrow==="extension"?W.sourceId:null;Rt&&xt[Rt]&&!Tt[Rt]&&(mt.push(Rt),Tt[Rt]=!0)}}for(var ot=0;T&&ot<T.length;ot++){var It=T[ot],te=(It.text||"").replace(/<br\s*\/?>/gi,`
+`),Qt={id:It.id,labels:[{text:te}],width:0,height:0,drawio:{shape:"note",labelText:te,type:"note",cssStyles:"fill:#fff5ad,stroke:#aaaa33,stroke-width:1.3"}};It.forTarget&&xt[It.forTarget]?(xt[It.id]=Qt,ee.push(Qt),z.push({id:"ne"+lt++,sources:[It.id],targets:[It.forTarget],drawio:{arrowTypeStart:"none",arrowTypeEnd:"none",pattern:"dashed",text:null,relationship:{type:"note"}}})):(Qt.layoutOptions={"org.eclipse.elk.layered.layering.layerConstraint":"FIRST"},xt[It.id]=Qt,ee.push(Qt))}return{id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":X,"elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":50,"elk.layered.spacing.nodeNodeBetweenLayers":50,"elk.edgeRouting":"ORTHOGONAL"},children:ee,edges:z,drawio:{orthEdges:!1,isClassDiagram:!0}}}return{parse:P}})();var Uo=(function(){var L=0,j=0;function P(r,h,v){L=0,j=0;var n=new Ua(r),y={},b=[],T=[],I={},F={},X={},K=[],ot={value:h},pt={root:0};for(n.skipWhitespaceAndComments();!n.isEof()&&(n.skipWhitespaceAndComments(),!n.isEof());)E(n,y,b,T,I,F,X,K,ot,pt);return M(y,I,F,X),u(y,b,T,ot.value,v)}function E(r,h,v,n,y,b,T,I,F,X){var K=r.save(),ot=r.readWord();if(ot==="state"){w(r,h,v,n,y,b,T,I,F,X);return}else if(ot==="classDef"){var pt=r.parseClassDef();pt&&(y[pt.name]=pt.styles);return}else if(ot==="style"){var pt=r.parseStyleDef();if(pt)for(var xt=0;xt<pt.nodeIds.length;xt++)b[pt.nodeIds[xt]]=(b[pt.nodeIds[xt]]||"")+pt.styles;return}else if(ot==="note"){o(r,n);return}else if(ot==="class"){r.skipSpaces();for(var ee=[];;){var N=r.readId();if(!N)break;if(ee.push(N),r.skipSpaces(),r.peek()===",")r.advance(),r.skipSpaces();else break}r.skipSpaces();var Q=r.readWord();if(Q)for(var at=0;at<ee.length;at++)T[ee[at]]||(T[ee[at]]=[]),T[ee[at]].push(Q);d(r);return}else if(ot==="direction"){r.skipSpaces();var _=r.readWord(),l=(_||"").toUpperCase();if(l==="TB"||l==="TD"||l==="BT"||l==="LR"||l==="RL")if(I.length===0)F&&(F.value=l);else{var O=I[I.length-1];h[O]&&(h[O].direction=l)}d(r);return}else if(ot==="accTitle"||ot==="accDescr"||ot==="accDescription"||ot==="title"){if(r.skipSpaces(),r.peek()===":")r.advance(),d(r);else if(r.peek()==="{")for(var z=0;!r.isEof();){var lt=r.peek();if(lt==="{")z++;else if(lt==="}"){if(z--,r.advance(),z<=0)break;continue}r.advance()}else d(r);return}else r.restore(K);var W=p(r,h,I,"source",X);if(!W){d(r);return}if(r.peekStr(3)===":::"){r.advance(3);var Q=r.readWord();T[W]||(T[W]=[]),T[W].push(Q)}if(r.skipSpaces(),r.peekStr(3)==="-->"){r.advance(3),r.skipSpaces();var gt=p(r,h,I,"target",X);if(gt){var mt=null;if(r.skipSpaces(),r.peekStr(3)===":::"){r.advance(3);var Q=r.readWord();T[gt]||(T[gt]=[]),T[gt].push(Q),r.skipSpaces()}r.peek()===":"&&r.peekStr(3)!==":::"?(r.advance(),r.skipSpaces(),mt=r.readLine().trim()):d(r),v.push({sourceId:W,targetId:gt,label:mt,parent:I.length>0?I[I.length-1]:null})}else d(r);return}if(r.peek()===":"){r.advance(),r.skipSpaces();var Tt=r.readLine().trim();h[W]&&(h[W].description=(h[W].description||"")+(h[W].description?`
+`:"")+Tt);return}d(r)}function w(r,h,v,n,y,b,T,I,F,X){r.skipSpaces();var K=null,ot=null;if(r.peek()==='"')ot=r.readQuoted(),r.skipSpaces(),r.matchI("as")?(r.skipSpaces(),K=r.readId()):K="state_"+L++;else if(K=r.readId(),!K){d(r);return}if(s(h,K,I),ot&&(h[K].label=ot),r.skipSpaces(),r.peekStr(2)==="<<"){r.advance(2);var pt=r.readUntil(">>");h[K].type=pt}if(r.skipSpaces(),r.peek()==="{"){for(r.advance(),h[K].isCompound=!0,I.push(K),X[K]=0;!r.isEof();){if(r.skipWhitespaceAndComments(),r.peek()==="}"){r.advance();break}if(r.peekStr(2)==="--"){r.advance(2),r.skipSpaces();var xt=I[I.length-1];if(xt){var ee="_divider_"+ ++j;h[ee]={id:ee,label:"",description:null,type:"divider",isCompound:!1,isStar:!1,cssStyles:null,parent:xt},X[xt]=(X[xt]||0)+1}continue}E(r,h,v,n,y,b,T,I,F,X)}I.pop()}d(r)}function p(r,h,v,n,y){if(r.skipSpaces(),r.peekStr(3)==="[*]"){r.advance(3);var b=v.length>0?v[v.length-1]:"root",T=y&&y[b]||0,I=T>0?"_r"+T:"",F=n==="target"?"_end":"_start",X=b+I+F;return s(h,X,v),h[X].isStar=!0,X}var X=r.readId();return X&&s(h,X,v),X||null}function s(r,h,v){r[h]||(r[h]={id:h,label:h,description:null,type:null,isCompound:!1,isStar:!1,cssStyles:null,parent:v.length>0?v[v.length-1]:null})}function o(r,h){r.skipSpaces();var v=r.readWord(),n=null;if(v==="left"||v==="right"){n=v,r.skipSpaces();var y=r.readWord();if(y!=="of"){d(r);return}}r.skipSpaces();var b=r.readId();if(!b){d(r);return}r.skipSpaces();var T="";if(r.peek()===":")r.advance(),r.skipSpaces(),T=r.readLine().trim();else{d(r);for(var I=[];!r.isEof();){r.skipSpaces();var F=r.save(),X=r.readWord();if(X==="end"){r.skipSpaces();var K=r.readWord();if(K==="note"){d(r);break}r.restore(F)}else r.restore(F);var ot=r.readLine();ot!=null&&I.push(ot.trim()),r.skipWhitespaceAndComments()}T=I.join(`
+`).trim()}h.push({id:"_note_"+h.length,text:T,forTarget:b,placement:n})}function d(r){for(;!r.isEof();){var h=r.peek();if(h===`
+`||h==="\r"||h===";"){h===";"&&r.advance();return}r.advance()}}function M(r,h,v,n){function y(K,ot){return ot?K?K.replace(/;\s*$/,"")+";"+ot:ot:K||""}for(var b in n){var T=[];r[b]&&T.push(b);for(var I=0;I<T.length;I++)for(var F=0;F<n[b].length;F++){var X=n[b][F];h[X]&&(r[T[I]].cssStyles=y(r[T[I]].cssStyles,h[X]))}}for(var b in v)r[b]&&(r[b].cssStyles=y(r[b].cssStyles,v[b]))}function f(r){switch((r||"").toUpperCase()){case"LR":return"RIGHT";case"RL":return"LEFT";case"BT":return"UP";default:return"DOWN"}}function u(r,h,v,n,y){var b=f(n),T={};function I(kr){for(var pr=0,rr=r[kr];rr&&rr.parent&&r[rr.parent]&&r[rr.parent].isCompound;)pr++,rr=r[rr.parent];return pr}for(var F in r){var X=r[F];if(X.isCompound){var K=X.direction?f(X.direction):b;T[F]={id:F,labels:[{text:X.label}],layoutOptions:{"elk.algorithm":"layered","elk.direction":K,"elk.hierarchyHandling":"INCLUDE_CHILDREN"},children:[],edges:[],drawio:{shape:"roundedWithTitle",labelText:X.description?X.description:X.label,cssStyles:X.cssStyles,isSubgraph:!0,isStateDiagram:!0,compoundDepth:I(F)}}}}for(var ot={},pt=0;pt<h.length;pt++)for(var xt=h[pt],ee=pt+1;ee<h.length;ee++){var N=h[ee];if(xt.sourceId===N.targetId&&xt.targetId===N.sourceId){var Q=r[xt.sourceId],at=r[xt.targetId];Q&&at&&Q.parent&&Q.parent===at.parent&&(ot[Q.parent]=!0)}}for(var _ in ot)T[_]&&(T[_].drawio.bidiCompound=!0);var l={},O=[];for(var F in r){var X=r[F];if(X.isCompound){l[F]=T[F],!X.parent||!T[X.parent]?O.push(T[F]):T[X.parent].children.push(T[F]);continue}var z="rounded";if(X.isStar){for(var lt=!1,W=!1,gt=0;gt<h.length;gt++)h[gt].sourceId===F&&(lt=!0),h[gt].targetId===F&&(W=!0);z=!lt&&W?"stateEnd":"stateStart"}else X.type==="fork"||X.type==="join"?z=X.type:X.type==="choice"?z="choice":X.type==="divider"&&(z="stateDivider");var mt=X.label&&X.label!==X.id,Tt="";X.isStar||(X.description&&mt?Tt=X.label+`
+`+X.description:X.description?Tt=X.description:Tt=X.label);var Rt={id:F,labels:[{text:Tt}],width:0,height:0,drawio:{shape:z,labelText:Tt,cssStyles:X.cssStyles,isStateDiagram:!0,type:X.type}};l[F]=Rt,X.parent&&T[X.parent]?T[X.parent].children.push(Rt):O.push(Rt)}for(var It=[],te=0,gt=0;gt<h.length;gt++){var Qt=h[gt],pe={id:"e"+te++,sources:[Qt.sourceId],targets:[Qt.targetId],drawio:{arrowTypeStart:"none",arrowTypeEnd:"arrow_barb",pattern:"solid",text:Qt.label,extraStyle:"fillColor=none;",isStateDiagram:!0}};Qt.label&&(pe.labels=[{text:Qt.label}]),Qt.parent&&T[Qt.parent]?T[Qt.parent].edges.push(pe):It.push(pe)}for(var ue=0;v&&ue<v.length;ue++){var me=v[ue],Tt=(me.text||"").replace(/<br\s*\/?>/gi,`
+`),Ee={id:me.id,labels:[{text:Tt}],width:0,height:0,drawio:{shape:"note",labelText:Tt,type:"note",isStateDiagram:!0,notePlacement:me.placement||null,noteFor:me.forTarget||null}};l[me.id]=Ee;var xe=me.forTarget?l[me.forTarget]:null;if(!xe){O.push(Ee);continue}var ar=xe.id+"-group",xr=me.placement==="left"?[Ee,xe]:[xe,Ee],sr={id:ar,labels:[{text:""}],layoutOptions:{"elk.algorithm":"layered","elk.direction":"RIGHT"},children:xr,edges:[],drawio:{shape:"noteGroup",labelText:"",isSubgraph:!0,isStateDiagram:!0,isNoteGroup:!0}};T[ar]=sr;var Qe=xe.parent&&T[xe.parent]?T[xe.parent].children:O,or=Qe.indexOf(xe);or>=0?Qe.splice(or,1,sr):Qe.push(sr),sr.parent=xe.parent||null,xe.parent=ar,Ee.parent=ar;var Wr=me.placement==="left"?me.id:me.forTarget,oa=me.placement==="left"?me.forTarget:me.id,Sr={id:"e"+te++,sources:[Wr],targets:[oa],drawio:{arrowTypeStart:"none",arrowTypeEnd:"none",pattern:"dashed",extraStyle:"fillColor=none;strokeColor=#aaaa33;",isStateDiagram:!0,classes:["note-edge"]}};sr.edges.push(Sr)}for(var Rr in T){for(var Mr=T[Rr],er=!1,Xr=0;Xr<Mr.children.length;Xr++)if(Mr.children[Xr].drawio&&Mr.children[Xr].drawio.shape==="stateDivider"){er=!0;break}if(er){for(var Kr=[[]],Xr=0;Xr<Mr.children.length;Xr++){var Ur=Mr.children[Xr];Ur.drawio&&Ur.drawio.shape==="stateDivider"?Kr.push([]):Kr[Kr.length-1].push(Ur)}for(var Jr={},Yr=0;Yr<Kr.length;Yr++)for(var ke=0;ke<Kr[Yr].length;ke++)Jr[Kr[Yr][ke].id]=Yr;for(var ze=Kr.map(function(){return[]}),lr=[],ir=0;ir<Mr.edges.length;ir++){var Sr=Mr.edges[ir],ur=Jr[Sr.sources[0]],zr=Jr[Sr.targets[0]];ur!=null&&ur===zr?ze[ur].push(Sr):lr.push(Sr)}for(var cr=[],Yr=0;Yr<Kr.length;Yr++){var Nr=Rr+"__region_"+Yr,Fr={id:Nr,labels:[{text:""}],layoutOptions:{"elk.algorithm":"layered","elk.direction":b,"elk.hierarchyHandling":"INCLUDE_CHILDREN"},children:Kr[Yr],edges:ze[Yr],drawio:{shape:"parallelRegion",labelText:"",isSubgraph:!0,isStateDiagram:!0,regionIdx:Yr}};cr.push(Fr)}Mr.children=cr,Mr.edges=lr}}var sa=!1;for(var Rr in T){sa=!0;break}var yr={"elk.algorithm":"layered","elk.direction":b,"elk.spacing.nodeNode":50,"elk.layered.spacing.nodeNodeBetweenLayers":sa?75:50,"elk.edgeRouting":"ORTHOGONAL","elk.layered.cycleBreaking.strategy":"DEPTH_FIRST","elk.layered.layering.strategy":"LONGEST_PATH"};return sa&&(yr["elk.hierarchyHandling"]="INCLUDE_CHILDREN"),{id:"root",layoutOptions:yr,children:O,edges:It,drawio:{orthEdges:!1,diagramType:"state"}}}return{parse:P}})();var Yo=(function(){var L={"||":"ONLY_ONE","|o":"ZERO_OR_ONE","}|":"ONE_OR_MORE","}o":"ZERO_OR_MORE","o|":"ZERO_OR_ONE","|{":"ONE_OR_MORE","o{":"ZERO_OR_MORE"},j={"||":"ONLY_ONE","o|":"ZERO_OR_ONE","|{":"ONE_OR_MORE","o{":"ZERO_OR_MORE","|o":"ZERO_OR_ONE","}|":"ONE_OR_MORE","}o":"ZERO_OR_MORE"};function P(n,y,b){var T=new Ua(n),I={},F=[],X={},K={},ot={},pt={value:y};for(T.skipWhitespaceAndComments();!T.isEof()&&(T.skipWhitespaceAndComments(),!T.isEof());)E(T,I,F,X,K,ot,pt);return u(I,X,ot),r(I,K),v(I,F,pt.value,b)}function E(n,y,b,T,I,F,X){if(n.skipSpaces(),n.isEol()||n.isEof()){(n.peek()===`
+`||n.peek()==="\r")&&n.advance();return}var K=n.readId();if(!K){h(n);return}if(K==="classDef"){var ot=n.parseClassDef();ot&&(T[ot.name]=(T[ot.name]||"")+(T[ot.name]?",":"")+ot.styles);return}if(K==="style"){var ot=n.parseStyleDef();if(ot)for(var pt=0;pt<ot.nodeIds.length;pt++)I[ot.nodeIds[pt]]=(I[ot.nodeIds[pt]]||"")+(I[ot.nodeIds[pt]]?",":"")+ot.styles;return}if(K==="class"){n.skipSpaces();for(var xt=[],ee=n.readId();ee&&(xt.push(ee),n.skipSpaces(),n.peek()===",");)n.advance(),n.skipSpaces(),ee=n.readId();n.skipSpaces();var N=n.readId();if(N)for(var pt=0;pt<xt.length;pt++)F[xt[pt]]=F[xt[pt]]||[],F[xt[pt]].push(N);h(n);return}if(K==="direction"&&X){n.skipSpaces();var Q=n.readWord(),at=(Q||"").toUpperCase();(at==="TB"||at==="TD"||at==="BT"||at==="LR"||at==="RL")&&(X.value=at),h(n);return}if(K==="click"||K==="title"||K==="accTitle"||K==="accDescr"||K==="accDescription"){h(n);return}var _=null;if(n.peek()==="["){if(n.advance(),n.skipSpaces(),n.peek()==='"')_=n.readQuoted();else{for(var l="";!n.isEof()&&n.peek()!=="]"&&n.peek()!==`
+`&&n.peek()!=="\r";)l+=n.peek(),n.advance();_=l.trim()}n.peek()==="]"&&n.advance()}if(n.skipSpaces(),n.peek()===":"&&n.input[n.pos+1]===":"&&n.input[n.pos+2]===":"){n.advance(3);for(var N=n.readId();N;)F[K]=F[K]||[],F[K].push(N),n.peek()===","?(n.advance(),N=n.readId()):N=null;n.skipSpaces()}if(n.peek()==="{"){n.advance(),f(y,K,_),w(n,y[K]);return}var O=s(n)||M(n);if(O){n.skipSpaces();var z=n.readId();if(z){if(f(y,K),f(y,z),n.skipSpaces(),n.peek()===":"&&n.input[n.pos+1]===":"&&n.input[n.pos+2]===":"){n.advance(3);for(var lt=n.readId();lt;)F[z]=F[z]||[],F[z].push(lt),n.peek()===","?(n.advance(),lt=n.readId()):lt=null;n.skipSpaces()}var W=null;n.peek()===":"?(n.advance(),n.skipSpaces(),W=n.readLine().trim()):h(n),b.push({entity1:K,entity2:z,card1:O.card1,card2:O.card2,relType:O.relType,label:W})}else h(n);return}f(y,K,_),h(n)}function w(n,y){for(;!n.isEof();){if(n.skipWhitespaceAndComments(),n.peek()==="}"){n.advance();return}if(n.isEof())return;var b=n.readLine().trim();if(!b||b==="}")return;if(b[b.length-1]===";"&&(b=b.substring(0,b.length-1).trim()),!!b){var T=p(b);T&&y.attributes.push(T)}}}function p(n){var y=n.match(/^(\S+)\s+(\S+)(?:\s+(PK|FK|UK)(?:\s*,\s*(PK|FK|UK))*)?(?:\s+"([^"]*)")?/);if(y){var b=[];return y[3]&&b.push(y[3]),y[4]&&b.push(y[4]),{attributeType:y[1],attributeName:y[2],attributeKeyType:b.length>0?b[0]:null,attributeKeyTypeList:b.length>0?b:null,attributeComment:y[5]||null}}var T=n.split(/\s+/);return T.length>=2?{attributeType:T[0],attributeName:T[1],attributeKeyType:T[2]||null,attributeKeyTypeList:T[2]?[T[2]]:null,attributeComment:null}:null}function s(n){var y=n.save(),b=n.peekStr(10),T=b.substring(0,2),I=L[T];if(!I)return n.restore(y),null;n.advance(2);var F="IDENTIFYING";if(n.peekStr(2)==="--")F="IDENTIFYING",n.advance(2);else if(n.peekStr(2)==="..")F="NON_IDENTIFYING",n.advance(2);else return n.restore(y),null;var X=n.peekStr(2),K=j[X];return K?(n.advance(2),{card1:I,card2:K,relType:F}):(n.restore(y),null)}var o=[{re:/^only one\b/i,card:"ONLY_ONE"},{re:/^one or zero\b/i,card:"ZERO_OR_ONE"},{re:/^one or more\b/i,card:"ONE_OR_MORE"},{re:/^one or many\b/i,card:"ONE_OR_MORE"},{re:/^zero or one\b/i,card:"ZERO_OR_ONE"},{re:/^zero or more\b/i,card:"ZERO_OR_MORE"},{re:/^zero or many\b/i,card:"ZERO_OR_MORE"},{re:/^many\(0\)/i,card:"ZERO_OR_MORE"},{re:/^many\(1\)/i,card:"ONE_OR_MORE"},{re:/^many\b/i,card:"ZERO_OR_MORE"},{re:/^one\b/i,card:"ONLY_ONE"},{re:/^1\+/,card:"ONE_OR_MORE"},{re:/^0\+/,card:"ZERO_OR_MORE"},{re:/^1\b/,card:"ONLY_ONE"}];function d(n){for(var y=n.input.substring(n.pos),b=0;b<o.length;b++){var T=y.match(o[b].re);if(T)return n.advance(T[0].length),o[b].card}return null}function M(n){var y=n.save(),b=d(n);if(!b)return n.restore(y),null;n.skipSpaces();var T=n.input.substring(n.pos),I;if(/^optionally to\b/i.test(T))n.advance(13),I="NON_IDENTIFYING";else if(/^to\b/i.test(T))n.advance(2),I="IDENTIFYING";else return n.restore(y),null;n.skipSpaces();var F=d(n);return F?{card1:b,card2:F,relType:I}:(n.restore(y),null)}function f(n,y,b){n[y]?b&&n[y].displayName===n[y].name&&(n[y].displayName=b):n[y]={name:y,displayName:b||y,attributes:[],cssStyles:null}}function u(n,y,b){if(y.default)for(var T in n)n[T].cssStyles=(n[T].cssStyles||"")+(n[T].cssStyles?",":"")+y.default;for(var T in b)if(n[T])for(var I=b[T],F=0;F<I.length;F++){var X=I[F];y[X]&&(n[T].cssStyles=(n[T].cssStyles||"")+(n[T].cssStyles?",":"")+y[X])}}function r(n,y){for(var b in y)n[b]&&(n[b].cssStyles=(n[b].cssStyles||"")+(n[b].cssStyles?",":"")+y[b])}function h(n){for(;!n.isEof();){var y=n.peek();if(y===`
+`||y==="\r"||y===";"){y===";"&&n.advance();return}n.advance()}}function v(n,y,b,T){var I="DOWN";if(b)switch(b.toUpperCase()){case"LR":I="RIGHT";break;case"BT":I="UP";break;case"RL":I="LEFT";break}var F=[],X={};for(var K in n){var ot=n[K],pt={id:K,labels:[{text:ot.displayName||K}],width:0,height:0,drawio:{shape:"erdEntity",labelText:ot.displayName||K,cssStyles:ot.cssStyles||null,entityData:{alias:ot.displayName&&ot.displayName!==K?ot.displayName:null,attributes:ot.attributes}}};F.push(pt),X[K]=pt}for(var xt=[],ee=0,N=0;N<y.length;N++){var Q=y[N];xt.push({id:"e"+ee++,sources:[Q.entity1],targets:[Q.entity2],labels:Q.label?[{text:Q.label}]:[],drawio:{arrowTypeStart:Q.card1,arrowTypeEnd:Q.card2,pattern:Q.relType==="NON_IDENTIFYING"?"dashed":"solid",text:Q.label,relationship:{relSpec:{cardA:Q.card2,cardB:Q.card1,relType:Q.relType}}}})}return{id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":I,"elk.spacing.nodeNode":80,"elk.layered.spacing.nodeNodeBetweenLayers":100,"elk.edgeRouting":"ORTHOGONAL"},children:F,edges:xt,drawio:{orthEdges:!0}}}return{parse:P}})();var Vo=(function(){var L={requirement:"Requirement",functionalrequirement:"Functional Requirement",performancerequirement:"Performance Requirement",interfacerequirement:"Interface Requirement",physicalrequirement:"Physical Requirement",designconstraint:"Design Constraint"},j=["traces","derives","satisfies","verifies","refines","contains","copies"];function P(u,r,h){var v=new Ua(u),n={},y={},b=[],T={},I={},F={},X={value:r};for(v.skipWhitespaceAndComments();!v.isEof()&&(v.skipWhitespaceAndComments(),!v.isEof());)E(v,n,y,b,T,I,F,X);return o(n,y,T,F),d(n,y,I),f(n,y,b,X.value,h)}function E(u,r,h,v,n,y,b,T){if(u.skipSpaces(),u.isEol()||u.isEof()){(u.peek()===`
+`||u.peek()==="\r")&&u.advance();return}var I=u.save(),F=u.readWord(),X=F.toLowerCase();if(L[X]){w(u,r,L[X],b);return}if(X==="element"){p(u,h,b);return}if(X==="direction"&&T){u.skipSpaces();var K=u.readWord(),ot=(K||"").toUpperCase();(ot==="TB"||ot==="TD"||ot==="BT"||ot==="LR"||ot==="RL")&&(T.value=ot);return}if(X==="classdef"){var pt=u.parseClassDef();pt&&(n[pt.name]=(n[pt.name]||"")+(n[pt.name]?",":"")+pt.styles);return}if(X==="style"){var xt=u.parseStyleDef();if(xt)for(var ee=0;ee<xt.nodeIds.length;ee++)y[xt.nodeIds[ee]]=(y[xt.nodeIds[ee]]||"")+(y[xt.nodeIds[ee]]?",":"")+xt.styles;return}if(X==="class"){u.skipSpaces();for(var N=[],Q=u.readId();Q&&(N.push(Q),u.skipSpaces(),u.peek()===",");)u.advance(),u.skipSpaces(),Q=u.readId();u.skipSpaces();var at=u.readId();if(at)for(var _=0;_<N.length;_++)b[N[_]]=b[N[_]]||[],b[N[_]].push(at);M(u);return}u.restore(I);var l=u.readId();if(!l){M(u);return}if(u.skipSpaces(),u.peek()==="-"){u.advance(),u.skipSpaces();var O=u.readWord();if(O&&j.indexOf(O.toLowerCase())>=0){u.skipSpaces(),u.peek()==="-"&&u.advance(),u.peek()===">"&&u.advance(),u.skipSpaces();var z=u.readId();z&&v.push({sourceId:l,targetId:z,relType:O.toLowerCase()})}}else if(u.peek()==="<"&&(u.advance(),u.peek()==="-")){u.advance(),u.skipSpaces();var O=u.readWord();if(O&&j.indexOf(O.toLowerCase())>=0){u.skipSpaces(),u.peek()==="-"&&u.advance(),u.skipSpaces();var z=u.readId();z&&v.push({sourceId:z,targetId:l,relType:O.toLowerCase()})}}M(u)}function w(u,r,h,v){u.skipSpaces();var n=u.readId();if(!n){M(u);return}var y={name:n,type:h,requirementId:null,text:"",risk:"low",verifyMethod:"test",cssStyles:null};if(u.skipSpaces(),u.peekStr(3)===":::"){u.advance(3);for(var b=u.readWord();b;)v[n]=v[n]||[],v[n].push(b),u.peek()===","?(u.advance(),b=u.readWord()):b=null;u.skipSpaces()}u.peek()==="{"&&(u.advance(),s(u,y)),r[n]=y}function p(u,r,h){u.skipSpaces();var v=u.readId();if(!v){M(u);return}var n={name:v,type:"",docRef:"",cssStyles:null};if(u.skipSpaces(),u.peekStr(3)===":::"){u.advance(3);for(var y=u.readWord();y;)h[v]=h[v]||[],h[v].push(y),u.peek()===","?(u.advance(),y=u.readWord()):y=null;u.skipSpaces()}u.peek()==="{"&&(u.advance(),s(u,n)),r[v]=n}function s(u,r){for(;!u.isEof();){if(u.skipWhitespaceAndComments(),u.peek()==="}"){u.advance();return}var h=u.readLine().trim();if(!h||h==="}")return;h[h.length-1]===";"&&(h=h.substring(0,h.length-1).trim());var v=h.indexOf(":");if(v>=0){var n=h.substring(0,v).trim().toLowerCase(),y=h.substring(v+1).trim();switch(y.length>=2&&(y.charAt(0)==='"'&&y.charAt(y.length-1)==='"'||y.charAt(0)==="'"&&y.charAt(y.length-1)==="'")&&(y=y.substring(1,y.length-1)),n){case"id":r.requirementId=y,r.id=y;break;case"text":r.text=y;break;case"risk":r.risk=y;break;case"verifymethod":r.verifyMethod=y;break;case"type":r.type=y;break;case"docref":r.docRef=y;break}}}}function o(u,r,h,v){if(h.default){for(var n in u)u[n].cssStyles=(u[n].cssStyles||"")+(u[n].cssStyles?",":"")+h.default;for(var y in r)r[y].cssStyles=(r[y].cssStyles||"")+(r[y].cssStyles?",":"")+h.default}for(var b in v){var T=u[b]||r[b];if(T)for(var I=v[b],F=0;F<I.length;F++){var X=I[F];h[X]&&(T.cssStyles=(T.cssStyles||"")+(T.cssStyles?",":"")+h[X])}}}function d(u,r,h){for(var v in h){var n=u[v]||r[v];n&&(n.cssStyles=(n.cssStyles||"")+(n.cssStyles?",":"")+h[v])}}function M(u){for(;!u.isEof();){var r=u.peek();if(r===`
+`||r==="\r"||r===";"){r===";"&&u.advance();return}u.advance()}}function f(u,r,h,v,n){var y="DOWN";if(v)switch(v.toUpperCase()){case"LR":y="RIGHT";break;case"RL":y="LEFT";break;case"BT":y="UP";break}var b=[],T={};for(var I in u){var F=u[I],X={id:I,labels:[{text:F.name}],width:0,height:0,drawio:{shape:"requirement",labelText:F.name,cssStyles:F.cssStyles||null,data:{type:F.type,name:F.name,requirementId:F.requirementId||F.id,text:F.text,risk:F.risk,verifyMethod:F.verifyMethod}}};b.push(X),T[I]=X}for(var I in r){var K=r[I],X={id:I,labels:[{text:K.name}],width:0,height:0,drawio:{shape:"element",labelText:K.name,cssStyles:K.cssStyles||null,data:{type:K.type,name:K.name,docRef:K.docRef}}};b.push(X),T[I]=X}for(var ot=[],pt=0,xt=0;xt<h.length;xt++){var ee=h[xt],N=ee.relType==="contains";ot.push({id:"e"+pt++,sources:[ee.sourceId],targets:[ee.targetId],labels:[{text:ee.relType}],drawio:{arrowTypeStart:N?"circlePlus":"none",arrowTypeEnd:N?"none":"dependency",pattern:N?"solid":"bigDashed",text:ee.relType,relationship:{type:ee.relType,wrapAngleBrackets:!0}}})}return{id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":y,"elk.spacing.nodeNode":40,"elk.layered.spacing.nodeNodeBetweenLayers":80,"elk.edgeRouting":"POLYLINE"},children:b,edges:ot,drawio:{orthEdges:!1,diagramType:"requirement"}}}return{parse:P}})();var jo=(function(){var L=0,j=1,P=3,E=4,w=5,p=6,s=24,o=25,d={"->>":L,"-->>":j,"-x":P,"--x":E,"-)":s,"--)":o,"->":w,"-->":p},M=Object.keys(d).sort(function(F,X){return X.length-F.length}),f=["loop","alt","else","opt","par","and","critical","option","break","rect","ref"];function u(F,X,K){var ot=new Ua(F),pt=[],xt={},ee=[],N=[],Q=[],at=[],_={autonumber:!1,currentBox:null,activationEvents:[]},l=[];for(ot.skipWhitespaceAndComments();!ot.isEof()&&(ot.skipWhitespaceAndComments(),!ot.isEof());)r(ot,pt,xt,ee,N,Q,at,l,_);for(;l.length>0;)l.pop();return{type:"sequence",actors:pt,messages:ee,notes:N,fragments:Q,boxes:at,autonumber:_.autonumber,activationEvents:_.activationEvents}}function r(F,X,K,ot,pt,xt,ee,N,Q){if(F.skipSpaces(),F.isEol()||F.isEof()){(F.peek()===`
+`||F.peek()==="\r")&&F.advance();return}var at=F.save(),_=F.readWord(),l=_.toLowerCase();if(l==="participant"||l==="actor"){h(F,X,K,l==="actor"?"actor":"participant",Q);return}if(l==="boundary"||l==="control"||l==="entity"||l==="database"||l==="collections"||l==="queue"){h(F,X,K,l,Q);return}if(l==="create"){F.skipSpaces();var O=F.readWord(),z;O==="participant"||O==="actor"?z=h(F,X,K,O==="actor"?"actor":"participant",Q):(z=O,T(X,K,O,O,"participant",Q)),z&&K[z]&&(K[z].createMessageIndex=ot.length);return}if(l==="destroy"){F.skipSpaces();var lt=F.readId();I(F),lt&&K[lt]&&(K[lt].destroyMessageIndex=ot.length);return}if(l==="activate"||l==="deactivate"){F.skipSpaces();var W=F.readId();I(F),W&&Q.activationEvents.push({type:l,actor:W,afterMsgIdx:ot.length-1});return}if(l==="autonumber"){Q.autonumber=!0,I(F);return}if(l==="note"){v(F,X,K,pt,ot);return}if(l==="box"){n(F,ee,Q);return}if(f.indexOf(l)>=0){if(l==="else"||l==="and"||l==="option"){F.skipSpaces();var gt=F.readLine().trim();if(N.length>0){var mt=N[N.length-1];mt.sections.push({title:gt,startIdx:ot.length})}}else{F.skipSpaces();var Tt=F.readLine().trim(),Rt={type:l,title:Tt,startIdx:ot.length,sections:[],endIdx:-1};if(l==="rect"){var It=Tt.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);if(It){var te="#"+[It[1],It[2],It[3]].map(function(Rr){var Mr=parseInt(Rr,10).toString(16);return Mr.length===1?"0"+Mr:Mr}).join("");Rt.bgColor=te,Rt.bgAlpha=It[4]!=null?parseFloat(It[4]):1,Rt.title=""}}xt.push(Rt),N.push(Rt)}return}if(l==="end"){if(Q.currentBox)Q.currentBox=null;else if(N.length>0){var Rt=N.pop();Rt.endIdx=ot.length}I(F);return}if(l==="title"){I(F);return}if(l==="links"||l==="link"){F.skipSpaces();var Qt=y(F);if(Qt&&(F.skipSpaces(),F.peek()===":")){F.advance(),F.skipSpaces();var pe=F.readLine().trim();try{var ue=JSON.parse(pe),me=K[Qt];if(me&&ue){me.links||(me.links=[]);for(var Ee in ue)ue.hasOwnProperty(Ee)&&me.links.push({label:Ee,url:ue[Ee]})}}catch(Rr){}}I(F);return}F.restore(at);var xe=y(F);if(!xe){I(F);return}var ar=!1;xe.length>2&&xe.slice(-2)==="()"&&(xe=xe.slice(0,-2),ar=!0),F.skipSpaces();var xr=b(F);if(!xr){T(X,K,xe,xe,"participant",Q),I(F);return}F.skipSpaces();var sr=!1,Qe=!1;F.peek()==="+"?(sr=!0,F.advance()):F.peek()==="-"&&(Qe=!0,F.advance());var or=!1;F.peek()==="("&&F.peekStr(2)==="()"&&(F.advance(2),or=!0);var Wr=y(F);if(!Wr){I(F);return}Wr.length>2&&Wr.slice(-2)==="()"&&(Wr=Wr.slice(0,-2),sr=!0),T(X,K,xe,xe,"participant",Q),T(X,K,Wr,Wr,"participant",Q),!sr&&!Qe&&(F.peek()==="+"?(sr=!0,F.advance()):F.peek()==="-"&&(Qe=!0,F.advance()));var oa="";F.skipSpaces(),F.peek()===":"?(F.advance(),F.skipSpaces(),oa=F.readLine().trim()):I(F);var Sr=0;ar&&or?Sr=61:or?Sr=59:ar&&(Sr=60),ot.push({from:xe,to:Wr,text:oa,type:xr.type,activate:sr,deactivate:Qe,centralConnection:Sr})}function h(F,X,K,ot,pt){F.skipSpaces();var xt=null,ee=null;if(F.peek()==='"'||F.peek()==="'")ee=F.readQuoted(),F.skipSpaces(),F.matchI("as")?(F.skipSpaces(),xt=F.readId()):xt=ee;else{if(xt=F.readId(),!xt)return I(F),null;if(F.peek()==="@"&&F.peekStr(2)==="@{"){F.advance(),F.advance();for(var N=1,Q="";!F.isEof()&&N>0;){var at=F.peek();if(at==="{")N++;else if(at==="}"&&(N--,N===0)){F.advance();break}Q+=at,F.advance()}var _=Q.match(/["']type["']\s*:\s*["']([^"']+)["']/),l=Q.match(/["']alias["']\s*:\s*["']([^"']+)["']/);_&&(ot=_[1].toLowerCase()),l&&(ee=l[1])}if(F.skipSpaces(),F.matchI("as"))if(F.skipSpaces(),F.peek()==='"'||F.peek()==="'")ee=F.readQuoted();else return ee=F.readLine().trim(),T(X,K,xt,ee||xt,ot,pt),xt}return T(X,K,xt,ee||xt,ot,pt),I(F),xt}function v(F,X,K,ot,pt){F.skipSpaces();var xt="right",ee=F.readWord();ee==="right"||ee==="left"?(xt=ee,F.skipSpaces(),F.matchI("of")):ee==="over"&&(xt="over"),F.skipSpaces();var N=y(F),Q=null;xt==="over"&&F.peek()===","&&(F.advance(),F.skipSpaces(),Q=y(F)),F.skipSpaces();var at="";F.peek()===":"&&(F.advance(),F.skipSpaces()),at=F.readLine().trim(),N&&T(X,K,N,N,"participant"),ot.push({actor:N,actor2:Q,text:at,placement:xt,beforeMessageIdx:pt.length})}function n(F,X,K){F.skipSpaces();var ot="",pt="";if(F.peek()==='"'||F.peek()==="'")pt=F.readQuoted();else{var xt=F.readLine().trim(),ee=xt.match(/^(rgb\([^)]*\)|rgba\([^)]*\)|#[0-9a-fA-F]{3,8})\s*(.*)/i);if(ee)ot=ee[1],pt=ee[2]||"";else{var N=xt.split(/\s+/),Q="aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow,yellowgreen,transparent";N.length>1&&Q.indexOf(N[0].toLowerCase())>=0?(ot=N[0],pt=N.slice(1).join(" ")):pt=xt}}var at={name:pt,color:ot,actors:[]};X.push(at),K.currentBox=at}function y(F){if(F.skipSpaces(),F.peek()==='"'||F.peek()==="'")return F.readQuoted();for(var X=F.pos;!F.isEof();){var K=F.peek();if(K==="-"||K===":"||K===`
+`||K==="\r"||K===";"||K==="+"||K==="#"||K===",")break;if(K===" "||K===" "){var ot=F.save();if(F.skipSpaces(),b(F)){F.restore(ot);break}F.restore(ot);break}F.advance()}var pt=F.input.substring(X,F.pos).trim();return pt||null}function b(F){for(var X=F.save(),K=0;K<M.length;K++){var ot=M[K];if(F.peekStr(ot.length)===ot)return F.advance(ot.length),{pattern:ot,type:d[ot]}}return F.restore(X),null}function T(F,X,K,ot,pt,xt){if(!X[K]){var ee={name:K,label:ot||K,type:pt};F.push(ee),X[K]=ee,xt&&xt.currentBox&&xt.currentBox.actors.push(K)}}function I(F){for(;!F.isEof();){var X=F.peek();if(X===`
+`||X==="\r"||X===";"){X===";"&&F.advance();return}F.advance()}}return{parse:u}})();var Xo=(function(){var L=0,j=1,P=2,E=3,w=4,p=0;function s(){p=p+2654435769|0;for(var r=p>>>0,h=r.toString(16);h.length<7;)h="0"+h;return h.slice(0,7)}function o(r,h,v){d=null,p=0;var n=new Ua(r),y=[],b={},T="main",I=0,F={},X=!0,K=!0,ot=!1,pt=!0,xt=!1,ee=null;v&&v.gitGraph&&(v.gitGraph.showBranches===!1&&(X=!1),v.gitGraph.showCommitLabel===!1&&(K=!1),v.gitGraph.parallelCommits===!0&&(ot=!0),v.gitGraph.rotateCommitLabel===!1&&(pt=!1),v.gitGraph.mainBranchName&&(T=v.gitGraph.mainBranchName),typeof v.gitGraph.mainBranchOrder=="number"&&(ee=v.gitGraph.mainBranchOrder)),b[T]={name:T,commits:[],order:ee};var N="LR";if(h){var Q=h.toUpperCase();(Q==="TB"||Q==="TD"||Q==="BT"||Q==="LR"||Q==="RL")&&(N=Q==="TD"?"TB":Q,xt=N==="TB"||N==="BT")}for(n.skipWhitespaceAndComments();!n.isEof()&&(n.skipWhitespaceAndComments(),!n.isEof());)M(n,y,b,F,T,I),T=d||T,I=y.length;return{type:"gitgraph",commits:y,branches:b,commitMap:F,showBranches:X,showCommitLabel:K,parallelCommits:ot,rotateCommitLabel:pt,isVertical:xt,dir:N}}var d=null;function M(r,h,v,n,y,b){r.skipSpaces();var T=r.save(),I=r.readWord(),F=I.toLowerCase();if(F==="commit"){f(r,h,v,n,y);return}else if(F==="branch"){r.skipSpaces();var X=r.readId(),K=null;for(r.skipSpaces();!r.isEol()&&!r.isEof();){var ot=r.readWord();if(!ot)break;if(r.peek()===":"&&(r.advance(),r.skipSpaces(),ot==="order")){var pt=r.readWord(),xt=parseFloat(pt);isNaN(xt)||(K=xt)}r.skipSpaces()}if(X){if(v[X])K!=null&&(v[X].order=K);else{var ee=null,N=v[y];N&&N.commits.length>0?ee=N.commits[N.commits.length-1]:N&&N.startCommit&&(ee=N.startCommit),v[X]={name:X,commits:[],startCommit:ee,order:K}}d=X}u(r);return}else if(F==="checkout"||F==="switch"){r.skipSpaces();var X=r.readId();X&&(d=X,v[X]||(v[X]={name:X,commits:[]})),u(r);return}else if(F==="merge"){r.skipSpaces();var Q=r.readId(),at=null,_=null,l=null;for(r.skipSpaces();!r.isEol()&&!r.isEof();){var ot=r.readWord();if(!ot)break;if(r.peek()===":"){if(r.advance(),r.skipSpaces(),ot==="id")at=r.peek()==='"'?r.readQuoted():r.readId();else if(ot==="tag")_=r.peek()==='"'?r.readQuoted():r.readId();else if(ot==="type"){var O=r.readWord();O==="REVERSE"?l=j:O==="HIGHLIGHT"&&(l=P)}}r.skipSpaces()}at||(at=h.length+"-"+s());var z=[];v[y]&&v[y].commits.length>0&&z.push(v[y].commits[v[y].commits.length-1]),Q&&v[Q]&&v[Q].commits.length>0&&z.push(v[Q].commits[v[Q].commits.length-1]);var lt={id:at,message:"merge "+(Q||""),tag:_,tags:_?[_]:[],type:E,customType:l,branch:y,parents:z};n[at]=h.length,h.push(lt),v[y]&&v[y].commits.push(at),u(r);return}else if(F==="cherry-pick"||F==="cherrypick"){r.skipSpaces();for(var at=null,W=null,gt=null;!r.isEol()&&!r.isEof();){var ot=r.readWord();if(!ot)break;if(r.peek()===":"){r.advance(),r.skipSpaces();var mt=r.peek()==='"'?r.readQuoted():r.readId();ot==="id"?at=mt:ot==="parent"?W=mt:ot==="tag"&&(gt=mt)}r.skipSpaces()}if(at){var Tt=h.length+"-"+s(),z=[];v[y]&&v[y].commits.length>0&&z.push(v[y].commits[v[y].commits.length-1]),n[at]!=null&&z.push(at);var Rt=gt!=null?gt:"cherry-pick:"+at+(W?"|parent:"+W:""),lt={id:Tt,message:"cherry-pick from "+at,tag:Rt,tags:[Rt],type:w,branch:y,parents:z,cherryPickSource:at};n[Tt]=h.length,h.push(lt),v[y]&&v[y].commits.push(Tt)}u(r);return}u(r)}function f(r,h,v,n,y){var b=null,T="",I=null,F=L;for(r.skipSpaces();!r.isEol()&&!r.isEof();){var X=r.readWord();if(!X)break;if(r.peek()===":"){if(r.advance(),r.skipSpaces(),X==="id")b=r.peek()==='"'?r.readQuoted():r.readId();else if(X==="msg"||X==="message")T=r.peek()==='"'?r.readQuoted():r.readLine().trim();else if(X==="tag")I=r.peek()==='"'?r.readQuoted():r.readId();else if(X==="type"){var K=r.readWord();K==="REVERSE"?F=j:K==="HIGHLIGHT"&&(F=P)}}r.skipSpaces()}if(!b)b=h.length+"-"+s();else if(n[b]!=null){var ot=n[b],pt=h[ot];if(pt&&v[pt.branch]){var xt=v[pt.branch].commits.indexOf(b);xt>=0&&v[pt.branch].commits.splice(xt,1)}h.splice(ot,1);for(var ee in n)n.hasOwnProperty(ee)&&n[ee]>ot&&n[ee]--;delete n[b]}var N=[];v[y]&&v[y].commits.length>0?N.push(v[y].commits[v[y].commits.length-1]):v[y]&&v[y].startCommit&&N.push(v[y].startCommit);var Q={id:b,message:T,tag:I,tags:I?[I]:[],type:F,branch:y,parents:N};n[b]=h.length,h.push(Q),v[y]&&v[y].commits.push(b)}function u(r){for(;!r.isEof();){var h=r.peek();if(h===`
+`||h==="\r"||h===";"){h===";"&&r.advance();return}r.advance()}}return{parse:o}})();var qo=(function(){var L=["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"];function j(E,w,p){var s=new Ua(E),o="",d=[],M=null,f={};for(s.skipWhitespaceAndComments();!s.isEof()&&(s.skipWhitespaceAndComments(),!s.isEof());){if(s.skipSpaces(),s.isEol()){s.advance();continue}var u=s.save(),r=s.readWord();if(r==="title"){s.skipSpaces(),o=s.readLine().trim();continue}else if(r==="section"){s.skipSpaces();var h=s.readLine().trim();M={name:h,tasks:[]},d.push(M);continue}else s.restore(u);var v=s.readLine().trim();if(v){var n=P(v,f);n&&(M||(M={name:"",tasks:[]},d.push(M)),M.tasks.push(n))}}for(var y=Object.keys(f).sort(),b=0;b<y.length;b++)f[y[b]].color=L[b%L.length],f[y[b]].position=b;return{type:"journey",title:o,sections:d,actors:f}}function P(E,w){var p=E.split(":");if(p.length<2)return null;var s=p[0].trim(),o=parseInt(p[1].trim());(isNaN(o)||o<1)&&(o=3),o>5&&(o=5);var d={};if(p.length>=3)for(var M=p[2].split(","),f=0;f<M.length;f++){var u=M[f].trim();u&&(w[u]||(w[u]={color:null,position:-1}),d[u]=w[u])}return{task:s,score:o,actors:d}}return{parse:j}})();var $o=(function(){var L=[["((","))","circle"],["(",")","roundedRect"],["[[","]]","subroutine"],["[","]","rect"],["{{","}}","hexagon"],["))","((","mindmapBang"],[")","(","cloud"]],j=11,P=["#FFFF78","#D7FF86","#C286FF","#FF86FF","#FF86C2","#FF8686","#FFC286","#C2FF86","#86FFC2","#86FFFF","#86C2FF"],E=["#000000","#000000","#FFFFFF","#000000","#000000","#000000","#000000","#000000","#000000","#000000","#000000"],w=["#ABABFF","#D0B9FF","#DCFFB9","#B9FFB9","#B9FFDC","#B9FFFF","#B9DCFF","#DCB9FF","#FFB9DC","#FFB9B9","#FFDCB9"],p="#0000EC",s="#FFFFFF",o="#FFFFB9";function d(h,v,n){h=h.replace(/\["`([^`"]*)`"\]/g,function(lt,W){return'["`'+W.replace(/\n+/g,"<br>")+'`"]'});for(var y=h.split(`
+`),b=[],T=[],I=0,F=[],X=null,K=0;K<y.length;K++){var ot=y[K],pt=ot.replace(/^\s+/,"");if(!(!pt||pt.substring(0,2)==="%%")&&!(pt==="mindmap"&&b.length===0)&&!/^::icon\(/.test(pt)){if(/^:::/.test(pt)){var xt=b[b.length-1];xt&&(xt.classes=pt.substring(3).trim());continue}for(var ee=0,N=0;N<ot.length;N++)if(ot[N]===" ")ee+=4;else if(ot[N]===" ")ee+=1;else break;var Q=u(pt),at="mm"+I++;X===null&&(X=ee);var _=ee-X,l={id:at,label:Q.label,shape:Q.shape,level:_,rawIndent:ee,classes:Q.classes};b.push(l);for(var O=b.length-1;F.length>0&&F[F.length-1].rawIndent>=ee;)F.pop();if(F.length>0){var z=F[F.length-1].nodeIdx;l.parentIdx=z,l.isRoot=!1,T.push({sourceId:b[z].id,targetId:at,sourceLevel:b[z].level})}else l.parentIdx=-1,l.isRoot=!0;F.push({rawIndent:ee,nodeIdx:O})}}return M(b),r(b,T,v,n)}function M(h){if(h.length!==0){for(var v={},n=0;n<h.length;n++){var y=h[n];if(y.parentIdx>=0){var b=h[y.parentIdx].id;v[b]||(v[b]=[]),v[b].push(n)}}var T=h[0];T.section=void 0;for(var I=v[T.id]||[],n=0;n<I.length;n++){var F=I[n],X=n%j;f(F,X,h,v,0)}}}function f(h,v,n,y,b){var T=n[h];if(T.section=v,!(b>=1e3))for(var I=y[T.id]||[],F=0;F<I.length;F++)f(I[F],v,n,y,b+1)}function u(h){var v="default",n=h,y=null,b=h.indexOf(":::");b>=0&&(y=h.substring(b+3).trim(),h=h.substring(0,b).trim(),n=h);var T=h.indexOf("::icon(");T>=0&&(h=h.substring(0,T).trim(),n=h);for(var I=0;I<L.length;I++){var F=L[I][0],X=L[I][1],K=L[I][2],ot=h.indexOf(F);if(ot>=0){var pt=h.lastIndexOf(X);if(pt>ot+F.length-1){var xt=h.substring(0,ot).trim();n=h.substring(ot+F.length,pt).trim(),v=K,!n&&xt&&(n=xt);break}}}return n||(n=h.trim()),n.length>=4&&n.charAt(0)==='"'&&n.charAt(1)==="`"&&n.charAt(n.length-1)==='"'&&n.charAt(n.length-2)==="`"?n="`"+n.substring(2,n.length-2)+"`":n.length>=2&&n.charAt(0)==='"'&&n.charAt(n.length-1)==='"'&&(n=n.substring(1,n.length-1)),{shape:v,label:n,classes:y}}function r(h,v,n,y){if(h.length===0)return{id:"root",children:[],edges:[],layoutOptions:{}};for(var b={},T={},I=0;I<h.length;I++){var F=h[I];T[F.id]=F;var X=F.shape==="default",K=F.shape;K==="default"&&(K="roundedRect");var ot,pt,xt,ee;if(F.isRoot)ot=p,pt=p,xt=s,ee=X?o:null;else{var N=F.section!=null?F.section:0;ot=P[N],pt=ot,xt=E[N],ee=X?w[N]:null}b[F.id]={id:F.id,labels:[{text:F.label}],width:0,height:0,children:[],edges:[],drawio:{shape:K,labelText:F.label,cssStyles:null,mindmap:!0,mindmapRoot:F.isRoot,mindmapSection:F.section,mindmapFill:ot,mindmapStroke:pt,mindmapFont:xt,mindmapLine:ee}}}for(var Q=[],I=0;I<h.length;I++)Q.push(b[h[I].id]);for(var at=[],I=0;I<v.length;I++){var _=v[I],l=T[_.sourceId],O=T[_.targetId],z=(l?l.level:0)+1,lt=14-3*z,W=lt>0?lt:3,N=O&&O.section!=null?O.section:0,gt=P[N];at.push({id:"e"+I,sources:[_.sourceId],targets:[_.targetId],drawio:{arrowTypeStart:"none",arrowTypeEnd:"none",pattern:"solid",thickness:null,strokeWidth:W,strokeColor:gt,mindmapEdge:!0}})}return{id:"root",layoutOptions:{"elk.algorithm":"mrtree","elk.direction":"RIGHT","elk.spacing.nodeNode":30,"elk.layered.spacing.nodeNodeBetweenLayers":40},drawio:{isMindmap:!0},children:Q,edges:at}}return{parse:d}})();var Go=(function(){function L(j,P,E,w){var p="",s=!1,o=[];if(w&&w.remainder){var d=w.remainder.trim(),M=d.match(/^showdata\b/i);M&&(s=!0,d=d.substring(M[0].length).trim());var f=d.match(/^title\b\s*(.*)$/i);f&&(p=f[1].trim())}for(var u=new Ua(j);!u.isEof()&&(u.skipWhitespaceAndComments(),!u.isEof());){if(u.skipSpaces(),u.isEol()){u.advance();continue}var r=u.save(),h=u.readWord();if(h==="title"&&!p){u.skipSpaces(),p=u.readLine().trim();continue}else if(h.toLowerCase()==="showdata"){s=!0,u.skipSpaces();var v=u.save(),n=u.readWord();n==="title"?(u.skipSpaces(),p=u.readLine().trim()):(u.restore(v),u.readLine());continue}else u.restore(r);var y=u.readLine().trim();if(y){var b=y.match(/^"([^"]*)"\s*:\s*([0-9]+(?:\.[0-9]+)?)\s*$/);if(b){var T=parseFloat(b[2]);!isNaN(T)&&T>0&&o.push({label:b[1],value:T})}}}for(var I=0,F=0;F<o.length;F++)I+=o[F].value;return{type:"pie",title:p,showData:s,sections:o,total:I}}return{parse:L}})();var Zo=(function(){var L=1e6;function j(E,w,p){var s=new Ua(E),o="",d=[],M=0;for(s.skipWhitespaceAndComments();!s.isEof()&&(s.skipWhitespaceAndComments(),!s.isEof());){if(s.skipSpaces(),s.isEol()){s.advance();continue}var f=s.save(),u=s.readWord();if(u.toLowerCase()==="title"){s.skipSpaces(),o=s.readLine().trim();continue}s.restore(f);var r=s.readLine().trim();if(!(!r||r.substring(0,2)==="%%")){var h=P(r,M);h&&(d.push(h),M=h.end+1)}}return!o&&p&&typeof p.title=="string"&&(o=p.title),{type:"packet",title:o,fields:d}}function P(E,w){var p=E.indexOf(":");if(p<0)return null;var s=E.substring(0,p).trim(),o=E.substring(p+1).trim(),d=o;(d[0]==='"'&&d[d.length-1]==='"'||d[0]==="'"&&d[d.length-1]==="'")&&(d=d.substring(1,d.length-1));var M,f;if(s[0]==="+"){var u=parseInt(s.substring(1),10);if(isNaN(u)||u<1)return null;M=w,f=w+u-1}else{var r=s.indexOf("-");if(r>=0?(M=parseInt(s.substring(0,r),10),f=parseInt(s.substring(r+1),10)):(M=parseInt(s,10),f=M),isNaN(M)||isNaN(f)||f<M)return null}return M>L||f>L?null:{start:M,end:f,label:d}}return{parse:j}})();var Ko=(function(){function L(p,s,o,d){for(var M="",f=null,u=null,r={q1:"",q2:"",q3:"",q4:""},h=[],v={},n=p.split(`
+`),y=0;y<n.length;y++){var b=n[y].trim();if(!(!b||b.substring(0,2)==="%%")){var T;if(T=b.match(/^title\s+(.*)$/i))M=T[1].trim();else if(T=b.match(/^x-axis\s+(.*)$/i))f=j(T[1].trim());else if(T=b.match(/^y-axis\s+(.*)$/i))u=j(T[1].trim());else if(T=b.match(/^quadrant-([1-4])\s+(.*)$/i))r["q"+T[1]]=T[2].trim();else if(T=b.match(/^classDef\s+(\S+)\s+(.*)$/i))v[T[1]]=E(T[2]);else{var I=P(b);I&&h.push(I)}}}return!M&&o&&typeof o.title=="string"&&(M=o.title),{type:"quadrant",title:M,xAxis:f,yAxis:u,quadrants:r,points:h,classes:v}}function j(p){var s=p.indexOf("-->");return s>=0?{left:w(p.substring(0,s).trim()),right:w(p.substring(s+3).trim())}:{left:w(p.trim()),right:null}}function P(p){var s=p.match(/^([^:]+?)(?::::(\w+))?:\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\](.*)$/);if(!s)return null;var o=parseFloat(s[3]),d=parseFloat(s[4]);return isNaN(o)||isNaN(d)?null:{name:w(s[1].trim()),className:s[2]||null,x:o,y:d,styles:E((s[5]||"").trim())}}function E(p){var s={};if(!p)return s;for(var o=p.split(","),d=0;d<o.length;d++){var M=o[d].trim(),f=M.indexOf(":");if(!(f<=0)){var u=M.substring(0,f).trim().toLowerCase(),r=M.substring(f+1).trim();u&&r&&(s[u]=r)}}return s}function w(p){return p&&(p.charAt(0)==='"'&&p.charAt(p.length-1)==='"'||p.charAt(0)==="'"&&p.charAt(p.length-1)==="'"?p.substring(1,p.length-1):p)}return{parse:L}})();var Qo=(function(){function L(j,P,E,w){for(var p="",s=[],o=null,d=null,M=!1,f=j.split(`
+`),u=0;u<f.length;u++){var r=f[u],h=r.trim();if(!(!h||h.substring(0,2)==="%%")){var v;if(v=h.match(/^title\s+(.*)$/i)){p=v[1].trim();continue}if(v=h.match(/^section\s+(.*)$/i)){o={name:v[1].trim(),periods:[]},s.push(o),d=null,M=!0;continue}if(h.charAt(0)===":"){if(d)for(var b=h.split(":"),n=1;n<b.length;n++){var y=b[n].trim();y&&d.events.push(y)}continue}var b=h.split(":");if(!(b.length<2)){for(var T=b[0].trim(),I=[],n=1;n<b.length;n++){var y=b[n].trim();y&&I.push(y)}o||(o={name:"",periods:[]},s.push(o)),d={name:T,events:I},o.periods.push(d)}}}return!p&&E&&typeof E.title=="string"&&(p=E.title),{type:"timeline",title:p,sections:s,explicitSections:M,direction:P||""}}return{parse:L}})();var Jo=(function(){function L(P,E,w,p){for(var s=[],o=null,d=-1,M=P.split(`
+`),f=0;f<M.length;f++){var u=M[f],r=u.replace(/\s+$/,"");if(r){var h=r.match(/^(\s*)/),v=h?h[1].length:0,n=r.substring(v);if(n.substring(0,2)!=="%%"){var y,b,T,I=n.match(/^(\w[\w-]*)\s*\[([^\]]*)\]\s*(@\{[\s\S]*\})?\s*$/);if(I)y=I[1],b=I[2],T=I[3];else if(I=n.match(/^\[([^\]]*)\]\s*(@\{[\s\S]*\})?\s*$/))b=I[1],y="_anon_"+(s.length+1)+"_"+f,T=I[2];else if(n.length>500)b=n,y=b.replace(/\W+/g,"_");else if(I=n.match(/^([^\[\]@\s][^\[\]@]*?)\s*(@\{[\s\S]*\})?\s*$/))b=I[1],y=b.replace(/\W+/g,"_"),T=I[2];else continue;var F=null;T&&(F=j(T.substring(2,T.length-1))),d<0&&(d=v),v<=d?(o={id:y,label:b,cards:[],metadata:F},s.push(o)):(o||(o={id:"_implicit",label:"",cards:[],metadata:null},s.push(o)),o.cards.push({id:y,label:b,metadata:F}))}}}return{type:"kanban",columns:s}}function j(P){for(var E={},w=/(\w+)\s*:\s*(?:"([^"]*)"|'([^']*)'|([^,}\s][^,}]*))/g,p;(p=w.exec(P))!==null;){var s=p[1],o=p[2]!==void 0?p[2]:p[3]!==void 0?p[3]:(p[4]||"").trim();E[s]=o}return E}return{parse:L}})();var ts=(function(){function L(p,s,o,d){for(var M="",f=null,u=null,r=[],h="vertical",v=p.split(`
+`),n=0;n<v.length;n++){var y=v[n].trim();if(!(!y||y.substring(0,2)==="%%")){if(y==="horizontal"||y==="vertical"){h=y;continue}var b;if(b=y.match(/^title\s+(.*)$/i)){M=w(b[1].trim());continue}if(b=y.match(/^x-axis\s+(.*)$/i)){f=j(b[1].trim(),!0);continue}if(b=y.match(/^y-axis\s+(.*)$/i)){u=j(b[1].trim(),!1);continue}if(b=y.match(/^bar\s*\[([^\]]*)\]\s*$/i)){r.push({type:"bar",values:E(b[1])});continue}if(b=y.match(/^line\s*\[([^\]]*)\]\s*$/i)){r.push({type:"line",values:E(b[1])});continue}}}!M&&o&&typeof o.title=="string"&&(M=o.title);var T=!1,I=!1;return o&&o.xyChart&&(o.xyChart.showDataLabel&&(T=!0),o.xyChart.showDataLabelOutsideBar&&(I=!0)),{type:"xychart",title:M,orientation:h,xAxis:f||{title:"",type:"numeric",min:null,max:null},yAxis:u||{title:"",type:"numeric",min:null,max:null},series:r,showDataLabel:T,showDataLabelOutsideBar:I}}function j(p,s){var o="",d=p;if(d.charAt(0)==='"'){var M=d.indexOf('"',1);M>0&&(o=d.substring(1,M),d=d.substring(M+1).trim())}if(d.charAt(0)==="["&&s)return{title:o,type:"categorical",categories:P(d)};var f=d.indexOf("-->");if(f>=0){var u=d.substring(0,f).trim(),r=d.substring(f+3).trim(),h=u.length>0?u.split(/\s+/):[],v=h.length>0?h[h.length-1]:"";return!o&&h.length>1&&(o=h.slice(0,-1).join(" ")),{title:o,type:"numeric",min:parseFloat(v),max:parseFloat(r)}}return!o&&d&&(o=d),{title:o,type:"numeric",min:null,max:null}}function P(p){for(var s=p.lastIndexOf("]"),o=p.substring(1,s>=0?s:p.length),d=[],M="",f=!1,u="",r=0;r<o.length;r++){var h=o.charAt(r);f?h===u?f=!1:M+=h:h==='"'||h==="'"?(f=!0,u=h):h===","?(M.trim()&&d.push(M.trim()),M=""):M+=h}return M.trim()&&d.push(M.trim()),d}function E(p){for(var s=p.split(","),o=[],d=0;d<s.length;d++){var M=parseFloat(s[d].trim());isNaN(M)||o.push(M)}return o}function w(p){return p&&(p.charAt(0)==='"'&&p.charAt(p.length-1)==='"'||p.charAt(0)==="'"&&p.charAt(p.length-1)==="'"?p.substring(1,p.length-1):p)}return{parse:L}})();var es=(function(){function L(p,s,o,d){for(var M="",f=[],u=[],r="circle",h=null,v=null,n=null,y=p.split(`
+`),b=0;b<y.length;b++){var T=y[b].trim();if(!(!T||T.substring(0,2)==="%%")){var I;if(I=T.match(/^title\s+(.*)$/i)){M=w(I[1].trim());continue}if(I=T.match(/^axis\s+(.*)$/i)){j(I[1],f);continue}if(I=T.match(/^curve\s+(.*)$/i)){P(I[1],u);continue}if(I=T.match(/^graticule\s+(\w+)\s*$/i)){r=I[1].toLowerCase();continue}if(I=T.match(/^max\s+(-?\d+(?:\.\d+)?)\s*$/i)){h=parseFloat(I[1]);continue}if(I=T.match(/^min\s+(-?\d+(?:\.\d+)?)\s*$/i)){v=parseFloat(I[1]);continue}if(I=T.match(/^ticks\s+(\d+)\s*$/i)){n=parseInt(I[1],10);continue}}}return!M&&o&&typeof o.title=="string"&&(M=o.title),{type:"radar",title:M,axes:f,curves:u,graticule:r,max:h,min:v,ticks:n}}function j(p,s){for(var o=E(p,","),d=0;d<o.length;d++){var M=o[d].trim();if(M){var f=M.match(/^(\w+)\s*(?:\[\s*"([^"]*)"\s*\])?\s*$/);f&&s.push({id:f[1],label:f[2]!=null?f[2]:f[1]})}}}function P(p,s){for(var o=E(p,","),d=0;d<o.length;){var M=o[d].trim();if(!M){d++;continue}var f=M.match(/^(\w+)\s*(?:\[\s*"([^"]*)"\s*\])?\s*\{(.*)$/);if(!f){d++;continue}var u=f[1],r=f[2]!=null?f[2]:u,h=f[3],v=[h];for(d++;d<o.length&&h.indexOf("}")<0;){var n=o[d];v.push(n),h=n,d++}var y=v.join(","),b=y.lastIndexOf("}");if(!(b<0)){var T=y.substring(0,b).trim(),I;if(T.indexOf(":")>=0){I={};for(var F=T.split(","),X=0;X<F.length;X++){var K=F[X].split(":");if(K.length===2){var ot=K[0].trim(),pt=parseFloat(K[1].trim());ot&&!isNaN(pt)&&(I[ot]=pt)}}}else{I=[];for(var xt=T.split(","),X=0;X<xt.length;X++){var pt=parseFloat(xt[X].trim());isNaN(pt)||I.push(pt)}}s.push({id:u,label:r,values:I})}}}function E(p,s){for(var o=[],d=0,M="",f=0;f<p.length;f++){var u=p.charAt(f);u==="{"||u==="["?(d++,M+=u):u==="}"||u==="]"?(d--,M+=u):u===s&&d===0?(o.push(M),M=""):M+=u}return M&&o.push(M),o}function w(p){return p&&(p.charAt(0)==='"'&&p.charAt(p.length-1)==='"'||p.charAt(0)==="'"&&p.charAt(p.length-1)==="'"?p.substring(1,p.length-1):p)}return{parse:L}})();var rs=(function(){function L(o,d,M,f){var u={id:"root",type:"root",columns:-1,columnsExplicit:!1,children:[]},r=[u],h=[],v={},n={},y={},b=0,T=0;if(f&&f.remainder){var I=f.remainder.trim().match(/^columns\s+(\S+)/i);I&&(u.columns=j(I[1]),u.columnsExplicit=!0)}for(var F=o.split(`
+`),X=0;X<F.length;X++){var K=F[X].trim();if(!(!K||K.substring(0,2)==="%%")){var ot=K.match(/^columns\s+(\S+)/i);if(ot){var pt=r[r.length-1];pt.columns=j(ot[1]),pt.columnsExplicit=!0;continue}var xt=K.match(/^style\s+([\w-]+(?:\s*,\s*[\w-]+)*)\s+(.+?)\s*;?\s*$/i);if(xt){for(var ee=xt[1].split(/\s*,\s*/),N=xt[2],Q=0;Q<ee.length;Q++)n[ee[Q]]=(n[ee[Q]]||"")+N+";";continue}var at=K.match(/^classdef\s+([\w-]+)\s+(.+?)\s*;?\s*$/i);if(at){var _=at[1];y[_]=(y[_]||"")+at[2]+";";continue}var l=K.match(/^class\s+([\w-]+(?:\s*,\s*[\w-]+)*)\s+([\w-]+)\s*;?\s*$/i);if(l){for(var O=l[1].split(/\s*,\s*/),z=l[2],lt=y[z]||"",Q=0;Q<O.length;Q++)n[O[Q]]=(n[O[Q]]||"")+lt;continue}if(!/^(link|click)\b/i.test(K)){if(/^end\b/i.test(K)){r.length>1&&r.pop();continue}var W=K.match(/^block(?::([\w-]+)(?::(\d+))?)?(?=\s|$)\s*(.*)$/);if(W){var gt=W[1],mt=gt||"_anon_block_"+ ++T,Tt={id:mt,type:"container",label:"",shape:"rect",widthInColumns:W[2]?parseInt(W[2],10):1,columns:-1,columnsExplicit:!1,children:[]};r[r.length-1].children.push(Tt),r.push(Tt);var Rt=W[3].trim(),It=Rt.match(/^columns\s+(\S+)/i);It&&(Tt.columns=j(It[1]),Tt.columnsExplicit=!0);continue}if(/-->|---|\.->|===/.test(K)){if(E(K,r[r.length-1],h,v))continue;s(K,h);continue}var te=r[r.length-1],Qt=te.children.length;P(K,te.children,v);for(var pe=0,ue=Qt;ue<te.children.length;ue++)pe+=te.children[ue].widthInColumns||1;pe>b&&(b=pe)}}}return!u.columnsExplicit&&b>1&&(u.columns=b),{type:"block",root:u,columns:u.columns,nodes:[],edges:h,styles:n}}function j(o){if(o==="auto")return-1;var d=parseInt(o,10);return isNaN(d)?-1:d}function P(o,d,M){for(var f=0,u=o.length;f<u;){for(;f<u&&(o.charAt(f)===" "||o.charAt(f)===" ");)f++;if(f>=u)break;for(var r=f;f<u;){var h=o.charAt(f);if(/[\w-]/.test(h))f++;else break}var v=o.substring(r,f);if(!v)break;var n=v,y="rect",b=1,T=null,I=v.toLowerCase()==="space";if(o.charAt(f)==="["&&o.charAt(f+1)==="("){for(var F=f+2,X="";F<u;){var h=o.charAt(F);if(h==='"'){var K=o.indexOf('"',F+1);if(K<0)break;X+=o.substring(F+1,K),F=K+1}else if(h===")"&&o.charAt(F+1)==="]"){n=X.trim(),y="cylinder",F+=2;break}else X+=h,F++}f=F}else if(o.charAt(f)==="["&&o.charAt(f+1)==="["){for(var F=f+2,X="";F<u;){var h=o.charAt(F);if(h==='"'){var K=o.indexOf('"',F+1);if(K<0)break;X+=o.substring(F+1,K),F=K+1}else if(h==="]"&&o.charAt(F+1)==="]"){n=X.trim(),y="subroutine",F+=2;break}else X+=h,F++}f=F}else if(o.charAt(f)==="["&&(o.charAt(f+1)==="/"||o.charAt(f+1)==="\\")){for(var ot=o.charAt(f+1),F=f+2,X="";F<u;){var h=o.charAt(F);if(h==='"'){var K=o.indexOf('"',F+1);if(K<0)break;X+=o.substring(F+1,K),F=K+1}else if((h==="/"||h==="\\")&&o.charAt(F+1)==="]"){var pt=h;ot==="/"&&pt==="/"?y="lean_right":ot==="\\"&&pt==="\\"?y="lean_left":ot==="/"&&pt==="\\"?y="trapezoid":ot==="\\"&&pt==="/"&&(y="inv_trapezoid"),n=X.trim(),F+=2;break}else X+=h,F++}f=F}else if(o.charAt(f)==="["){var xt=0,ee=f,X="",N=o.charAt(f);for(f++;f<u;){var h=o.charAt(f);if(h==='"'){var K=o.indexOf('"',f+1);if(K<0)break;X+=o.substring(f+1,K),f=K+1}else if(h==="]"){f++;break}else X+=h,f++}n=X.trim()}else if(o.charAt(f)==="("&&o.charAt(f+1)==="["){var Q=o.indexOf("])",f+2);Q>0&&(n=o.substring(f+2,Q).replace(/^"|"$/g,"").trim(),y="stadium",f=Q+2)}else if(o.charAt(f)==="("&&o.charAt(f+1)==="("&&o.charAt(f+2)==="("){var Q=o.indexOf(")))",f+3);Q>0&&(n=o.substring(f+3,Q).replace(/^"|"$/g,"").trim(),y="doublecircle",f=Q+3)}else if(o.charAt(f)==="("&&o.charAt(f+1)==="("){var Q=o.indexOf("))",f+2);Q>0&&(n=o.substring(f+2,Q).replace(/^"|"$/g,"").trim(),y="circle",f=Q+2)}else if(o.charAt(f)==="("){for(var F=f+1,Q=-1;F<u;){var at=o.charAt(F);if(at==='"'){var K=o.indexOf('"',F+1);if(K<0)break;F=K+1}else if(at===")"){Q=F;break}else F++}Q>0&&(n=o.substring(f+1,Q).replace(/^"|"$/g,"").trim(),y="rounded",f=Q+1)}else if(o.charAt(f)==="{")if(o.charAt(f+1)==="{"){var Q=o.indexOf("}}",f+2);Q>0&&(n=o.substring(f+2,Q).replace(/^"|"$/g,"").trim(),y="hexagon",f=Q+2)}else{var Q=o.indexOf("}",f+1);Q>0&&(n=o.substring(f+1,Q).replace(/^"|"$/g,"").trim(),y="diamond",f=Q+1)}else if(o.charAt(f)===">"){var Q=o.indexOf("]",f+1);Q>0&&(n=o.substring(f+1,Q).replace(/^"|"$/g,"").trim(),y="odd",f=Q+1)}else if(o.charAt(f)==="<"&&o.charAt(f+1)==="["){var _=o.indexOf("]>",f+2);if(_>0&&(n=o.substring(f+2,_).replace(/^"|"$/g,"").trim(),y="block-arrow",f=_+2,o.charAt(f)==="(")){var l=o.indexOf(")",f+1);l>0&&(T=o.substring(f+1,l).split(/\s*,\s*/).map(function(lt){return lt.trim().toLowerCase()}).filter(Boolean),f=l+1)}}if(o.charAt(f)===":"){f++;for(var O=f;f<u&&/\d/.test(o.charAt(f));)f++;b=parseInt(o.substring(O,f),10)||1}if(I)d.push({id:"_space_"+d.length,type:"space",label:"",shape:"rect",widthInColumns:b,span:b,isSpace:!0});else{var z={id:v,type:"leaf",label:n,shape:y,widthInColumns:b,span:b,isSpace:!1};T&&(z.directions=T),d.push(z),M[v]=d.length-1}}}function E(o,d,M,f){if(o.length>500)return!1;var u=o.match(/^\s*([\w-]+(?:\([^)]*\)|\[[^\]]*\]|\{[^}]*\}|<\[[^\]]*\]>\([^)]*\)|>[^\]]*\])?)\s*((?:-+\.?>|-+|=+>|=+|-\.->))\s*(?:\|([^|]*)\|\s*)?([\w-]+(?:\([^)]*\)|\[[^\]]*\]|\{[^}]*\}|<\[[^\]]*\]>\([^)]*\)|>[^\]]*\])?)\s*$/);if(!u)return!1;var r=u[1],h=u[2],v=u[3]||"",n=u[4];if(!/[([{<>]/.test(r)&&!/[([{<>]/.test(n))return!1;var y=w(r),b=w(n);if(!y||!b)return!1;p(d,y,f),p(d,b,f);var T="solid",I="none";return h.indexOf(".")>=0?T="dotted":h.indexOf("=")>=0&&(T="thick"),h.indexOf(">")>=0&&(I="block"),M.push({source:y.id,target:b.id,text:v,pattern:T,arrowEnd:I}),!0}function w(o){var d=[];return P(o,d,{}),d.length!==1?null:d[0]}function p(o,d,M){for(var f=0;f<o.children.length;f++)if(o.children[f].id===d.id){d.label&&d.label!==d.id&&(o.children[f].label=d.label),d.shape&&d.shape!=="rect"&&(o.children[f].shape=d.shape),d.directions&&(o.children[f].directions=d.directions);return}o.children.push(d),M[d.id]=o.children.length-1}function s(o,d){var M="",f=o.replace(/\s*"([^"]*)"\s*/,function(T,I){return M=I,""}),u=f.match(/^(\w+(?:-+\w+)*)\s*((?:-+\.?>|-+|=+>|=+|-\.->))\s*(?:\|([^|]*)\|\s*)?(\w+(?:-+\w+)*)\s*$/);if(u){var r=u[1],h=u[2],v=u[3]||M||"",n=u[4],y="solid",b="none";h.indexOf(".")>=0?y="dotted":h.indexOf("=")>=0&&(y="thick"),h.indexOf(">")>=0&&(b="block"),d.push({source:r,target:n,text:v,pattern:y,arrowEnd:b})}}return{parse:L}})();var as=(function(){var L={person:!0,person_ext:!0,system:!0,system_ext:!0,systemdb:!0,systemdb_ext:!0,systemqueue:!0,systemqueue_ext:!0,container:!0,container_ext:!0,containerdb:!0,containerdb_ext:!0,containerqueue:!0,containerqueue_ext:!0,component:!0,component_ext:!0,componentdb:!0,componentdb_ext:!0,componentqueue:!0,componentqueue_ext:!0,node:!0,node_l:!0,node_r:!0,deployment_node:!0,boundary:!0,system_boundary:!0,enterprise_boundary:!0,container_boundary:!0},j={rel:!0,birel:!0,rel_u:!0,rel_up:!0,rel_d:!0,rel_down:!0,rel_l:!0,rel_left:!0,rel_r:!0,rel_right:!0,rel_back:!0,relindex:!0};function P(f,u,r,h){for(var v="",n=[],y=[],b=h&&h.keyword||"C4Context",T=4,I=2,F=[],X={},K=f.split(`
+`),ot=0;ot<K.length;ot++){var pt=K[ot].trim();if(!(!pt||pt.substring(0,2)==="%%")){var xt;if(xt=pt.match(/^title\s+(.*)$/i)){v=xt[1].trim();continue}if(/^UpdateLayoutConfig/i.test(pt)){var ee=pt.match(/\$c4ShapeInRow\s*=\s*"?(\d+)"?/i);ee&&(T=parseInt(ee[1],10));var N=pt.match(/\$c4BoundaryInRow\s*=\s*"?(\d+)"?/i);N&&(I=parseInt(N[1],10));continue}var Q=pt.match(/^UpdateRelStyle\s*\(([^)]*)\)\s*$/i);if(Q){for(var at=M(Q[1]),_=at[0]&&at[0].replace(/^"|"$/g,"").trim(),l=at[1]&&at[1].replace(/^"|"$/g,"").trim(),O={},z=2;z<at.length;z++){var lt=at[z].match(/^\$(\w+)\s*=\s*"?([^"]+)"?\s*$/);lt&&(O[lt[1]]=lt[2])}F.push({from:_,to:l,overrides:O});continue}var W=pt.match(/^UpdateElementStyle\s*\(([^)]*)\)\s*$/i);if(W){for(var gt=M(W[1]),mt=gt[0]&&gt[0].replace(/^"|"$/g,"").trim(),Tt={},Rt=1;Rt<gt.length;Rt++){var It=gt[Rt].match(/^\$(\w+)\s*=\s*"?([^"]+)"?\s*$/);It&&(Tt[It[1]]=It[2])}mt&&(X[mt]=Tt);continue}if(!/^(SHOW_LEGEND|LAYOUT)/i.test(pt)&&pt!=="}"){var te=E(pt);if(te){var Qt=te.name.toLowerCase();if(L[Qt]){var pe=s(te.name,Qt,te.args);te.hasBlock&&(pe.children=[],ot=p(K,ot+1,pe.children,y)),n.push(pe)}else j[Qt]&&y.push(o(te.name,Qt,te.args))}}}}if(!v&&r&&typeof r.title=="string"&&(v=r.title),b==="C4Dynamic"||b==="c4dynamic")for(var z=0;z<y.length;z++)y[z].label=z+1+": "+(y[z].label||"");for(var z=0;z<F.length;z++){for(var ue=F[z],me=null,Ee=0;Ee<y.length;Ee++){var xe=y[Ee];if(xe.from===ue.from&&xe.to===ue.to||xe.direction==="bi"&&xe.from===ue.to&&xe.to===ue.from){me=xe;break}}me&&(me.styleOverrides=ue.overrides)}return(function ar(xr){for(var sr=0;sr<xr.length;sr++){var Qe=xr[sr];X[Qe.id]&&(Qe.styleOverrides=X[Qe.id]),Qe.children&&ar(Qe.children)}})(n),{type:"c4",flavor:b,title:v,elements:n,relations:y,c4ShapeInRow:T,c4BoundaryInRow:I}}function E(f){var u=f.match(/^(\w+)\s*\((.*)\)\s*(\{?)\s*$/);return u?{name:u[1],args:d(u[2]),hasBlock:u[3]==="{"}:null}var w=100;function p(f,u,r,h,v){v=v||0;for(var n=u;n<f.length;n++){var y=f[n].trim();if(!(!y||y.substring(0,2)==="%%")){if(y==="}")return n;if(!/^(UpdateElementStyle|UpdateRelStyle|SHOW_LEGEND|LAYOUT|UpdateLayoutConfig)/i.test(y)){var b=E(y);if(b){var T=b.name.toLowerCase();if(L[T]){var I=s(b.name,T,b.args);if(b.hasBlock)if(I.children=[],v<w)n=p(f,n+1,I.children,h,v+1);else{var F=1;for(n++;n<f.length;n++){var X=f[n].trim();if(X==="}"){if(F--,F===0)break;continue}var K=E(X);K&&K.hasBlock&&F++}}r.push(I)}else j[T]&&h.push(o(b.name,T,b.args))}}}}return n}function s(f,u,r){var h=r[0]||"_e"+Math.random().toString(36).substring(2,8),v=r[1]||h,n=u.indexOf("container")>=0,y=u.indexOf("component")>=0,b=u.indexOf("node")>=0,T=n||y||b,I=null,F=null;T?(I=r[2]||null,F=r[3]||null):F=r[2]||null;var X=/_ext$/i.test(u),K=/db/.test(u),ot=/queue/.test(u),pt=/^person/.test(u),xt=/^system/.test(u)&&!u.indexOf("system_boundary")===0,ee=/boundary$/.test(u)||u==="system_boundary"||u==="container_boundary"||u==="enterprise_boundary",N;ee?N="boundary":pt?N="person":y?N="component":n?N="container":b?N="node":N="system";var Q=null,at=!1;return ee&&(u==="boundary"&&r[2]?(Q=r[2],at=!0):/^enterprise/i.test(u)?Q="Enterprise":/^system/i.test(u)?Q="System":/^container/i.test(u)&&(Q="Container")),{id:h,macroName:f,category:N,isExternal:X,isDb:K,isQueue:ot,label:v,technology:I,description:F,boundaryType:Q,boundaryTypeExplicit:at}}function o(f,u,r){var h="none";u==="rel_u"||u==="rel_up"?h="up":u==="rel_d"||u==="rel_down"?h="down":u==="rel_l"||u==="rel_left"?h="left":u==="rel_r"||u==="rel_right"?h="right":u==="rel_back"?h="back":u==="birel"&&(h="bi");var v,n,y,b;return u==="relindex"?(v=r[1],n=r[2],y=r[3]||"",b=r[4]||null):(v=r[0],n=r[1],y=r[2]||"",b=r[3]||null),{from:v,to:n,label:y,technology:b,direction:h}}function d(f){for(var u=[],r="",h=!1,v=0,n=0;n<f.length;n++){var y=f.charAt(n);h?y==='"'?h=!1:y==="\\"&&n+1<f.length?(r+=f.charAt(n+1),n++):r+=y:y==='"'?h=!0:y==="("||y==="["?(v++,r+=y):y===")"||y==="]"?(v--,r+=y):y===","&&v===0?(u.push(r.trim()),r=""):r+=y}r.trim()&&u.push(r.trim());for(var b=[],n=0;n<u.length;n++)u[n].charAt(0)!=="$"&&b.push(u[n]);return b}function M(f){for(var u=[],r="",h=!1,v=0,n=0;n<f.length;n++){var y=f.charAt(n);h?y==='"'?h=!1:y==="\\"&&n+1<f.length?(r+=f.charAt(n+1),n++):r+=y:y==='"'?h=!0:y==="("||y==="["?(v++,r+=y):y===")"||y==="]"?(v--,r+=y):y===","&&v===0?(u.push(r.trim()),r=""):r+=y}return r.trim()&&u.push(r.trim()),u}return{parse:P}})();var ns=(function(){function L(P,E,w,p){for(var s=[],o=[],d=[],M=[],f=P.split(`
+`),u=0;u<f.length;u++){var r=f[u].trim();if(!(!r||r.substring(0,2)==="%%")){var h;if(h=r.match(/^group\s+(\w+)(?:\(([^)]*)\))?(?:\[([^\]]*)\])?(?:\s+in\s+(\w+))?\s*$/i)){o.push({id:h[1],icon:h[2]||"cloud",label:h[3]||h[1],parent:h[4]||null});continue}if(h=r.match(/^service\s+(\w+)(?:\(([^)]*)\))?(?:\[([^\]]*)\])?(?:\s+in\s+(\w+))?\s*$/i)){s.push({id:h[1],icon:h[2]||"server",label:h[3]||h[1],parent:h[4]||null});continue}if(h=r.match(/^junction\s+(\w+)(?:\s+in\s+(\w+))?\s*$/i)){d.push({id:h[1],parent:h[2]||null});continue}var v=j(r);v&&M.push(v)}}return{type:"architecture",services:s,groups:o,junctions:d,edges:M}}function j(P){var E=P.match(/^(\w+)(\{group\})?:([TBLR])\s*(<?-->?|<?--|<->|<-->)\s*([TBLR]):(\w+)(\{group\})?\s*$/i);if(!E)return null;var w=E[4],p=/^</.test(w),s=/>$/.test(w);return{source:E[1],sourceIsGroup:!!E[2],sourcePort:E[3].toUpperCase(),targetPort:E[5].toUpperCase(),target:E[6],targetIsGroup:!!E[7],arrowStart:p,arrowEnd:s}}return{parse:L}})();var is=(function(){function L(P,E,w,p){for(var s=[],o=P.split(`
+`),d=0;d<o.length;d++){var M=o[d].trim();if(!(!M||M.substring(0,2)==="%%")&&!/^source\s*,\s*target\s*,\s*value/i.test(M)){var f=j(M);if(!(f.length<3)){var u=f[0],r=f[1],h=parseFloat(f[2]);!u||!r||isNaN(h)||h<=0||s.push({source:u,target:r,value:h})}}}return{type:"sankey",links:s}}function j(P){for(var E=[],w="",p=!1,s=0;s<P.length;){var o=P.charAt(s);p?o==='"'?s+1<P.length&&P.charAt(s+1)==='"'?(w+='"',s+=2):(p=!1,s++):(w+=o,s++):o==='"'?(p=!0,s++):o===","?(E.push(w.trim()),w="",s++):(w+=o,s++)}return E.push(w.trim()),E}return{parse:L}})();var os=(function(){function L(j,P,E,w){var p=E&&E.title||"";if(w&&w.remainder){var s=w.remainder.trim(),o=s.match(/^title\s+(.*)$/i);o&&(p=o[1].trim())}for(var d={label:"",value:0,children:[],depth:0,isLeaf:!1,parent:null},M=[{node:d,indent:-1}],f={},u=j.split(`
+`),r=0;r<u.length;r++){var h=u[r],v=h.indexOf("%%");v>=0&&(h=h.substring(0,v));var n=h.replace(/^[ \t]+/,"");if(n){n=n.replace(/[ \t]+$/,"");for(var y=0,b=0;b<h.length;b++)if(h[b]===" ")y++;else if(h[b]===" ")y+=4;else break;var o=n.match(/^title\s+(.*)$/i);if(o&&y===0){p=o[1].trim();continue}var T=n.match(/^classDef\s+(\w+)\s+(.+?);?\s*$/);if(T){f[T[1]]=T[2];continue}var I=n.match(/^"([^"]*)"\s*(?::\s*([-+]?\d+(?:\.\d+)?))?\s*(?::::(\w+))?\s*$/);if(I){for(var F=I[1],X=I[2]!=null?parseFloat(I[2]):null,K=I[3]||null;M.length>1&&M[M.length-1].indent>=y;)M.pop();var ot=M[M.length-1].node,pt={label:F,value:X==null?0:X,rawValue:X,children:[],depth:ot.depth+1,isLeaf:X!=null,parent:ot,className:K};ot.children.push(pt),pt.isLeaf||M.push({node:pt,indent:y})}}}return(function xt(ee){if(ee.isLeaf)return ee.value;for(var N=0,Q=0;Q<ee.children.length;Q++)N+=xt(ee.children[Q]);return ee.value=N,N})(d),{type:"treemap",title:p,root:d,classDefs:f}}return{parse:L}})();var ss=(function(){var L=864e5;function j(r,h,v,n){for(var y=v&&v.title||"",b="YYYY-MM-DD",T="%Y-%m-%d",I=null,F=null,X=[],K="saturday",ot=[],pt=[],xt=null,ee=r.split(`
+`),N=0;N<ee.length;N++){var Q=ee[N],at=Q.indexOf("%%");if(at>=0&&(Q=Q.substring(0,at)),Q=Q.trim(),!!Q){var _;if(_=Q.match(/^title\s+(.*)$/i)){y=_[1].trim();continue}if(_=Q.match(/^dateFormat\s+(.*)$/i)){b=_[1].trim();continue}if(_=Q.match(/^axisFormat\s+(.*)$/i)){T=_[1].trim();continue}if(_=Q.match(/^excludes\s+(.*)$/i)){X.push(_[1].trim());continue}if(_=Q.match(/^weekend\s+(friday|saturday)\s*$/i)){K=_[1].toLowerCase();continue}if(_=Q.match(/^todayMarker\s+(.*)$/i)){I=_[1].trim();continue}if(_=Q.match(/^tickInterval\s+(.*)$/i)){F=_[1].trim();continue}if(_=Q.match(/^section\s+(.*)$/i)){xt={name:_[1].trim(),tasks:[],idx:ot.length},ot.push(xt);continue}var l=Q.indexOf(":");if(!(l<0)){var O=Q.substring(0,l).trim(),z=Q.substring(l+1).trim(),lt=o(O,z);lt&&(xt==null&&(xt={name:"",tasks:[],idx:ot.length},ot.push(xt)),lt.sectionIdx=xt.idx,xt.tasks.push(lt),pt.push(lt))}}}var W=E(X,K,b);d(pt,b,W);for(var gt=null,mt=null,N=0;N<pt.length;N++)pt[N].startDate&&((!gt||pt[N].startDate.getTime()<gt.getTime())&&(gt=new Date(pt[N].startDate)),(!mt||pt[N].endDate.getTime()>mt.getTime())&&(mt=new Date(pt[N].endDate)));return{type:"gantt",title:y,dateFormat:b,axisFormat:T,tickInterval:F,todayMarker:I,excludes:X,weekendStart:K,excludeInfo:W,displayMode:v&&v.displayMode||null,sections:ot,tasks:pt,startDate:gt,endDate:mt}}var P={sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,tues:2,wednesday:3,wed:3,thursday:4,thu:4,thurs:4,friday:5,fri:5,saturday:6,sat:6};function E(r,h,v){var n={},y={},b={},T=!1,I=P[h]!=null?P[h]:6;n[I]=!0,n[(I+1)%7]=!0;for(var F=0;F<r.length;F++)for(var X=r[F].split(/[\s,]+/),K=0;K<X.length;K++){var ot=X[K].toLowerCase();if(ot)if(ot==="weekends")T=!0;else if(P[ot]!=null)y[P[ot]]=!0;else{var pt=M(X[K],v);pt&&(b[w(pt)]=!0)}}return{hasWeekends:T,weekendDays:n,weekdays:y,dates:b}}function w(r){return r.getUTCFullYear()+"-"+(r.getUTCMonth()+1)+"-"+r.getUTCDate()}function p(r,h){return h?!!(h.hasWeekends&&h.weekendDays[r.getUTCDay()]||h.weekdays[r.getUTCDay()]||h.dates[w(r)]):!1}function s(r,h,v){var n=new Date(r.getTime()),y=new Date(h.getTime());n.setUTCDate(n.getUTCDate()+1);for(var b=null,T=!1;n.getTime()<=y.getTime();)T||(b=new Date(y.getTime())),T=p(n,v),T&&y.setUTCDate(y.getUTCDate()+1),n.setUTCDate(n.getUTCDate()+1);return{endDate:y,renderEndDate:b}}function o(r,h){for(var v=h.split(",").map(function(I){return I.trim()}),n={done:!1,active:!1,crit:!1,milestone:!1,vert:!1};v.length>0&&/^(done|active|crit|milestone|vert)$/i.test(v[0]);)n[v.shift().toLowerCase()]=!0;var y=null,b,T;if(v.length===3)y=v[0],b=v[1],T=v[2];else if(v.length===2)b=v[0],T=v[1];else if(v.length===1)b=null,T=v[0];else return null;return{label:r,id:y,flags:n,startSpec:b,endSpec:T,startDate:null,endDate:null,sectionIdx:-1}}function d(r,h,v){for(var n={},y=0;y<r.length;y++)r[y].id&&(n[r[y].id]=r[y]);for(var b=v&&(v.hasWeekends||Object.keys(v.weekdays).length>0||Object.keys(v.dates).length>0),T=[],I=null,y=0;y<r.length;y++){var F=r[y],X=null;if(F.startSpec){var K=F.startSpec.match(/^after\s+(.+)$/i);if(K){for(var ot=K[1].split(/\s+/),pt=null,xt=0;xt<ot.length;xt++){var ee=n[ot[xt]];ee&&ee.endDate&&(!pt||ee.endDate.getTime()>pt.getTime())&&(pt=ee.endDate)}X=pt||I||new Date}else X=M(F.startSpec,h)||new Date}else X=I||new Date;var N,Q=!1,at=F.endSpec?F.endSpec.match(/^until\s+(.+)$/i):null;if(at){F.startDate=X,F.endDate=X,T.push({task:F,ids:at[1].trim().split(/\s+/)}),I=X;continue}else/^\d+(?:\.\d+)?\s*[a-zA-Z]+$/.test(F.endSpec)?(N=new Date(X.getTime()+u(F.endSpec)),Q=!1):(N=M(F.endSpec,h)||X,Q=!0);if(F.startDate=X,F.manualEndDate=Q,b&&!Q&&N.getTime()>X.getTime()){var _=s(X,N,v);F.endDate=_.endDate,F.renderEndDate=_.renderEndDate}else F.endDate=N,F.renderEndDate=null;I=F.endDate}for(var l=0;l<T.length;l++){for(var O=T[l],z=null,lt=0;lt<O.ids.length;lt++){var W=n[O.ids[lt]];W&&W.startDate&&(z==null||W.startDate.getTime()<z.getTime())&&(z=W.startDate)}O.task.endDate=z||O.task.startDate,O.task.renderEndDate=null,O.task.manualEndDate=!0}}function M(r,h){if(!r)return null;if(r=r.trim(),h==="X"&&/^\d+$/.test(r))return new Date(parseInt(r,10)*1e3);if(h==="x"&&/^\d+$/.test(r))return new Date(parseInt(r,10));var v=r.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(v&&/HH?:mm/i.test(h||""))return new Date(1970,0,1,+v[1],+v[2],+(v[3]||0));if(v=r.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/),v)return new Date(Date.UTC(+v[1],+v[2]-1,+v[3]));if(v=r.match(/^(\d{4})-(\d{1,2})-(\d{1,2})[\sT](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/),v)return new Date(Date.UTC(+v[1],+v[2]-1,+v[3],+v[4],+v[5],+(v[6]||0)));if(v=r.match(/^(\d{4})\/(\d{1,2})\/(\d{1,2})$/),v)return new Date(Date.UTC(+v[1],+v[2]-1,+v[3]));if(v=r.match(/^(\d{1,2})-(\d{1,2})-(\d{4})$/),v)return new Date(Date.UTC(+v[3],+v[2]-1,+v[1]));if(v=r.match(/^(\d{4})$/),v&&/YYYY/.test(h||""))return new Date(+v[1],0,1);var n=f(r,h);if(n)return n;var y=new Date(r);return isNaN(y.getTime())?null:y}function f(r,h){if(!h)return null;for(var v=["YYYY","YY","MM","M","DD","D","HH","H","mm","m","ss","s"],n=[],y="",b=0;b<h.length;){for(var T=null,I=0;I<v.length;I++)if(h.substring(b,b+v[I].length)===v[I]){T=v[I];break}T?(n.push(T),y+=T==="YYYY"?"(\\d{4})":T==="YY"?"(\\d{2})":"(\\d{1,2})",b+=T.length):(y+=h[b].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),b++)}if(n.length===0)return null;var F=r.match(new RegExp("^"+y+"$"));if(!F)return null;for(var X=1970,K=1,ot=1,pt=0,xt=0,ee=0,N=!1,Q=0;Q<n.length;Q++){var at=parseInt(F[Q+1],10);switch(n[Q]){case"YYYY":X=at,N=!0;break;case"YY":X=at+(at>68?1900:2e3),N=!0;break;case"MM":case"M":K=at,N=!0;break;case"DD":case"D":ot=at,N=!0;break;case"HH":case"H":pt=at;break;case"mm":case"m":xt=at;break;case"ss":case"s":ee=at;break}}if(K<1||K>12||ot<1||ot>31||pt>23||xt>59||ee>59)return null;if(!N)return new Date(1970,0,1,pt,xt,ee);var _=new Date(Date.UTC(X,K-1,ot,pt,xt,ee));return _.getUTCMonth()!==K-1||_.getUTCDate()!==ot?null:_}function u(r){var h=r.trim().match(/^(\d+(?:\.\d+)?)\s*([a-zA-Z]+)$/);if(!h)return 0;var v=parseFloat(h[1]),n=h[2],y;switch(n){case"ms":y=1;break;case"s":y=1e3;break;case"h":y=36e5;break;case"d":y=L;break;case"w":y=7*L;break;case"M":y=30*L;break;case"y":y=365*L;break;case"m":y=6e4;break;default:y=0}return v*y}return{parse:j}})();var ls=(function(){var L=0,j=1,P="_STARTER_",E={actor:"actor",boundary:"boundary",control:"control",entity:"entity",database:"database",collections:"collections",queue:"queue",starter:"actor"};function w(b,T,I,F){for(var X={actors:[],actorMap:{},messages:[],notes:[],fragments:[],activations:[],contextStack:[],pendingComments:[],pendingReturn:!1,title:I&&I.title||""},K=b.split(`
+`),ot=0;ot<K.length;ot++){var pt=K[ot],xt=pt.indexOf("//"),ee=null;if(xt>=0&&(ee=pt.substring(xt+2).trim(),pt=pt.substring(0,xt)),pt=pt.trim(),!pt&&ee!=null){ee&&X.pendingComments.push(ee);continue}pt&&p(pt,X)}for(;X.contextStack.length>0;)n(X);for(var N=!1,Q=0;Q<X.messages.length;Q++)if(X.messages[Q].from===P||X.messages[Q].to===P){N=!0;break}return!N&&X.actorMap[P]&&(X.actors=X.actors.filter(function(at){return at.name!==P}),delete X.actorMap[P]),{type:"sequence",zenuml:!0,actors:X.actors,messages:X.messages,notes:X.notes,fragments:X.fragments,activations:X.activations,boxes:[],autonumber:!1,title:X.title}}function p(b,T){var I;if(I=b.match(/^\}\s*else\s+if\s*\(([^)]*)\)\s*\{$/i)){r(T,"else if "+I[1].trim());return}if(I=b.match(/^\}\s*else\s*\{$/i)){r(T,"else");return}if(I=b.match(/^\}\s*and\s*(?:\(([^)]*)\))?\s*\{$/i)){r(T,"and"+(I[1]?" "+I[1].trim():""));return}if(I=b.match(/^\}\s*catch\s*(?:\(([^)]*)\))?\s*\{$/i)){r(T,"catch"+(I[1]?" "+I[1].trim():""));return}if(I=b.match(/^\}\s*finally\s*\{$/i)){r(T,"finally");return}if(b==="}"){n(T);return}if(I=b.match(/^title\s+(.*)$/i)){T.title=I[1].trim();return}if(/^@(return|reply)\s*$/i.test(b)){T.pendingReturn=!0;return}if(I=b.match(/^@(\w+)\s+(\w+)(?:\s+as\s+(.+))?$/i)){var F=I[1].toLowerCase(),X=E[F],K=X||"participant",ot=I[2],pt=I[3]?I[3].trim():ot;M(T,ot,pt,K),!X&&T.actorMap[ot]&&(T.actorMap[ot].iconName=F),T.pendingComments=[];return}if(I=b.match(/^(participant|actor)\s+(\w+)(?:\s+as\s+(.+))?$/i)){var K=I[1].toLowerCase(),ot=I[2],pt=I[3]?I[3].trim():ot;M(T,ot,pt,K),T.pendingComments=[];return}if(I=b.match(/^if\s*\(([^)]*)\)\s*\{$/i)){u(T,"alt",I[1].trim());return}if(I=b.match(/^(while|for|foreach|forEach|loop)\s*(?:\(([^)]*)\))?\s*\{$/i)){var xt=I[1].toLowerCase(),ee=I[2]?I[2].trim():xt;u(T,"loop",ee);return}if(I=b.match(/^opt\s*(?:\(([^)]*)\))?\s*\{$/i)){u(T,"opt",I[1]?I[1].trim():"");return}if(I=b.match(/^par\s*(?:\(([^)]*)\))?\s*\{$/i)){u(T,"par",I[1]?I[1].trim():"");return}if(I=b.match(/^try\s*\{$/i)){u(T,"critical","try");return}if(I=b.match(/^return\b\s*(.*)$/i)){y(T,I[1].trim());return}if(I=b.match(/^new\s+(\w+)(?:\s*\(([^)]*)\))?\s*(\{)?$/i)){var N=I[1],Q=I[2]||"",at=I[3]==="{";M(T,N,N,"participant");var _=f(T),pt="\xABcreate\xBB "+N+(Q?"("+Q+")":"");_==null?(d(T),o(T,s(P,N,pt,j,at,!1,!0))):o(T,s(_,N,pt,j,at,!1,!0)),at?v(T,N):h(T,N);return}if(I=b.match(/^(\w+)\s*->\s*(\w+)\s*:\s*(.*)$/)){M(T,I[1],I[1],"participant"),M(T,I[2],I[2],"participant"),o(T,s(I[1],I[2],I[3].trim(),L,!1,!1,!1));return}if(I=b.match(/^(\w+)\s*->\s*(\w+)\.(\w+)(?:\s*\(([^)]*)\))?\s*(\{)?$/)){var l=I[1],O=I[2],z=I[3],Q=I[4]||"",at=I[5]==="{";M(T,l,l,"participant"),M(T,O,O,"participant");var pt=z+"("+Q+")";o(T,s(l,O,pt,L,at,!1,!0)),at?v(T,O):h(T,O);return}if(I=b.match(/^(\w+)\.(\w+)(?:\s*\(([^)]*)\))?\s*(\{)?$/)){var N=I[1],z=I[2],Q=I[3]||"",at=I[4]==="{";M(T,N,N,"participant");var _=f(T),pt=z+"("+Q+")";_==null?(d(T),o(T,s(P,N,pt,L,at,!1,!0))):o(T,s(_,N,pt,L,at,!1,!0)),at?v(T,N):h(T,N);return}if(I=b.match(/^(\w+)\s+as\s+(.+)$/i)){M(T,I[1],I[2].trim(),"participant"),T.pendingComments=[];return}if(I=b.match(/^(\w+)$/)){M(T,I[1],I[1],"participant"),T.pendingComments=[];return}}function s(b,T,I,F,X,K,ot){return{from:b,to:T,text:I,type:F,activate:!!X,deactivate:!!K,sync:!!ot}}function o(b,T){b.pendingComments&&b.pendingComments.length>0&&(T.comments=b.pendingComments,b.pendingComments=[]),b.pendingReturn&&(T.type=j,T.sync=!1,b.pendingReturn=!1),b.messages.push(T)}function d(b){if(!b.actorMap[P]){var T={name:P,label:"",type:"actor"};b.actors.unshift(T),b.actorMap[P]=T}}function M(b,T,I,F){if(b.actorMap[T])return b.actorMap[T];var X={name:T,label:I||T,type:F||"participant"};return b.actors.push(X),b.actorMap[T]=X,X}function f(b){for(var T=b.contextStack.length-1;T>=0;T--)if(b.contextStack[T].kind==="caller")return b.contextStack[T].name;return null}function u(b,T,I){var F={type:T,title:I,startIdx:b.messages.length,sections:[],endIdx:-1};b.fragments.push(F),b.contextStack.push({kind:"fragment",fragment:F})}function r(b,T){for(var I=b.contextStack.length-1;I>=0;I--)if(b.contextStack[I].kind==="fragment"){var F=b.contextStack[I].fragment;F.sections.push({title:T,startIdx:b.messages.length});return}}function h(b,T){for(var I=0,F=0;F<b.contextStack.length;F++){var X=b.contextStack[F];X.kind==="caller"&&X.name===T&&I++}b.activations.push({actor:T,startIdx:b.messages.length-1,endIdx:b.messages.length-1,depth:I})}function v(b,T){for(var I=0,F=0;F<b.contextStack.length;F++){var X=b.contextStack[F];X.kind==="caller"&&X.name===T&&I++}var K=null,ot=b.messages[b.messages.length-1];ot&&(K=ot.from);var pt={actor:T,startIdx:b.messages.length-1,endIdx:-1,depth:I};b.activations.push(pt),b.contextStack.push({kind:"caller",name:T,callerOf:K,returnEmitted:!1,activation:pt})}function n(b){if(b.contextStack.length!==0){var T=b.contextStack.pop();if(T.kind==="fragment")T.fragment.endIdx=b.messages.length;else if(T.kind==="caller"){if(!T.returnEmitted){var I=T.callerOf;I!=null&&I!==T.name&&I!==P&&o(b,s(T.name,I,"",j,!1,!0))}T.activation&&(T.activation.endIdx=b.messages.length-1)}}}function y(b,T){for(var I=null,F=b.contextStack.length-1;F>=0;F--)if(b.contextStack[F].kind==="caller"){I=b.contextStack[F];break}if(I){I.returnEmitted=!0;var X=I.callerOf;X!=null&&(X===P&&d(b),o(b,s(I.name,X,T,j,!1,!1)))}}return{parse:w}})();var hs=(function(){function L(P,E,w){var p=E,s=w,o=!1,d=P.match(/\[\s*"([^"]*)"\s*\]/);d&&(p=d[1]);var M=P.match(/:(\d+(?:\.\d+)?)/);return M&&(s=parseFloat(M[1]),o=!0),{label:p,size:s,sizeExplicit:o}}function j(P,E,w,p){for(var s=w&&w.title||"",o=[],d=Object.create(null),M=[],f=[],u={},r=null,h=P.split(`
+`),v=0;v<h.length;){var n=h[v],y=n.indexOf("%%");if(y>=0&&(n=n.substring(0,y)),n=n.trim(),!n){v++;continue}var b;if(b=n.match(/^title\s+(.*)$/i)){s=b[1].trim(),v++;continue}if(b=n.match(/^set\s+(\w+)(.*?)\s*$/i)){var T=b[1],I=L(b[2],T,void 0);if(d[T])d[T].label=I.label,d[T].size=I.size,d[T].sizeExplicit=I.sizeExplicit;else{var F={id:T,label:I.label,size:I.size,sizeExplicit:I.sizeExplicit};o.push(F),d[T]=F}r=[T],v++;continue}if(b=n.match(/^union\s+([A-Za-z_][\w]*(?:\s*,\s*[A-Za-z_][\w]*)+)(.*?)\s*$/i)){var X=b[1].split(/\s*,\s*/),I=L(b[2],"",void 0);M.push({ids:X,size:I.size,sizeExplicit:I.sizeExplicit,label:I.label}),I.label&&f.push({ids:X,text:I.label,kind:"union"}),r=X.slice(),v++;continue}if(b=n.match(/^text\s+([A-Za-z_][\w]*(?:\s*,\s*[A-Za-z_][\w]*)*)\s*(?:\[\s*"([^"]*)"\s*\])?\s*$/i)){var K=b[1].split(/\s*,\s*/),ot=b[2]||"";if(!ot&&v+1<h.length){var pt=h[v+1].trim(),xt=pt.match(/^\[\s*"([^"]*)"\s*\]\s*$/);xt&&(ot=xt[1],v++)}if(K.length>1)f.push({ids:K,text:ot,kind:"text",id:ot||K[0]});else{var ee=K[0];if(d[ee])f.push({ids:[ee],text:ot||ee,kind:"text",id:ot||ee});else{var N;r&&r.length>0?N=r.slice():N=[ee],f.push({ids:N,text:ot||ee,kind:"text",id:ee})}}v++;continue}if(b=n.match(/^style\s+([A-Za-z_][\w]*(?:\s*,\s*[A-Za-z_][\w]*)*)\s+(.+?)\s*$/i)){for(var X=b[1].split(/\s*,\s*/),Q=b[2],at=0;at<X.length;at++)u[X[at]]=(u[X[at]]||"")+(u[X[at]]?",":"")+Q;v++;continue}v++}return{type:"venn",title:s,sets:o,unions:M,labels:f,styles:u}}return{parse:j}})();var cs=(function(){function L(j,P,E,w){for(var p=E&&E.title||"",s="",o=[],d=[],M=!1,f=-1,u=j.split(`
+`),r=0;r<u.length;r++){var h=u[r],v=h.indexOf("%%");v>=0&&(h=h.substring(0,v));var n=h.replace(/^[ \t]+/,"").replace(/[ \t]+$/,"");if(n){for(var y=0,b=0;b<h.length;b++)if(h[b]===" ")y++;else if(h[b]===" ")y+=4;else break;var T=n.match(/^title\s+(.*)$/i);if(T){p=T[1].trim();continue}if(!M){s=n,M=!0;continue}for(f<0&&(f=y);d.length>0&&d[d.length-1].indent>=y;)d.pop();if(y<=f||d.length===0){var I={name:n,children:[]};o.push(I),d=[{indent:y,children:I.children}]}else{var F=d[d.length-1].children,X={text:n,children:[]};F.push(X),d.push({indent:y,children:X.children})}}}return{type:"ishikawa",title:p,effect:s,categories:o}}return{parse:L}})();var fs=(function(){function L(j,P,E,w){for(var p=E&&E.title||"",s=[],o=j.split(`
+`),d=[],M=0;M<o.length;M++){var f=o[M],u=f.indexOf("%%");u>=0&&(f=f.substring(0,u));var r=f.replace(/^[ \t]+/,"").replace(/\s+$/,"");if(r){var h=r.match(/^title\s+(.*)$/i);if(h){p=h[1].trim();continue}for(var v=0,n=0;n<f.length;n++)if(f[n]===" ")v++;else if(f[n]===" ")v+=4;else break;var y=r;y.length>=2&&(y.charAt(0)==='"'&&y.charAt(y.length-1)==='"'||y.charAt(0)==="'"&&y.charAt(y.length-1)==="'")&&(y=y.substring(1,y.length-1)),d.push({indent:v,label:y})}}if(d.length===0)return{type:"treeView",title:p,roots:[]};for(var b=[],T=0;T<d.length;T++){for(var I=d[T],F={label:I.label,children:[]};b.length>0&&b[b.length-1].indent>=I.indent;)b.pop();b.length===0?s.push(F):b[b.length-1].node.children.push(F),b.push({indent:I.indent,node:F})}return{type:"treeView",title:p,roots:s}}return{parse:L}})();var us=(function(){function L(r,h,v,n){for(var y={type:"wardley",title:null,size:null,nodes:[],links:[],trends:[],pipelines:[],notes:[],annotationsBox:null,annotations:[],accelerators:[],deaccelerators:[],axes:{stages:[],stageBoundaries:[],xLabel:null,yLabel:null}},b={},T=r.split(`
+`),I=0;I<T.length;I++){var F=T[I],X=F.trim();if(!(!X||X.substring(0,2)==="%%")){var K;if(K=X.match(/^title\s+(.*)$/i))y.title=u(K[1].trim());else if(K=X.match(/^size\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]/i))y.size={width:parseFloat(K[1]),height:parseFloat(K[2])};else if(K=X.match(/^evolution\s+(.*)$/i))s(K[1].trim(),y);else if(K=X.match(/^(component|anchor)\s+(.*)$/i))I=E(K[1].toLowerCase(),K[2],T,I,y,b);else if(K=X.match(/^pipeline\s+(.*)$/i))I=p(K[1],T,I,y,b);else if(K=X.match(/^note\s+(.*)$/i)){var ot=o(K[1]);ot&&y.notes.push(ot)}else if(K=X.match(/^evolve\s+(.+?)\s+([-\d.]+)\s*$/i))f(y,b,K[1].trim(),j(parseFloat(K[2])),null);else if(K=X.match(/^trend\s+(.+?)\s+([-\d.]+)\s*,\s*([-\d.]+)\s*$/i))f(y,b,K[1].trim(),j(parseFloat(K[2])),j(parseFloat(K[3])));else if(K=X.match(/^annotations\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]/i))y.annotationsBox={x:j(parseFloat(K[2])),y:j(parseFloat(K[1]))};else if(K=X.match(/^annotation\s+(\d+)\s*,\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]\s*(.*)$/i))y.annotations.push({number:parseInt(K[1],10),x:j(parseFloat(K[3])),y:j(parseFloat(K[2])),text:u(K[4].trim())});else if(K=X.match(/^accelerator\s+(.*)$/i)){var pt=d(K[1]);pt&&y.accelerators.push(pt)}else if(K=X.match(/^deaccelerator\s+(.*)$/i)){var xt=d(K[1]);xt&&y.deaccelerators.push(xt)}else{var ee=M(X);ee&&y.links.push(ee)}}}return!y.title&&v&&typeof v.title=="string"&&(y.title=v.title),y}function j(r){return isNaN(r)?0:r<=1?r*100:r}function P(r){var h=r.match(/\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]/);return h?{x:j(parseFloat(h[2])),y:j(parseFloat(h[1]))}:null}function E(r,h,v,n,y,b){var T=P(h);if(!T)return n;for(var I=h.indexOf("["),F=u(h.substring(0,I).trim()),X=h.substring(h.indexOf("]",I)+1),K={id:F,name:F,x:T.x,y:T.y,kind:r,strategy:null,inertia:!1,labelOffsetX:null,labelOffsetY:null,isPipelineParent:!1,inPipeline:!1},ot,pt=/\(([^)]+)\)/g;(ot=pt.exec(X))!==null;){var xt=ot[1].trim().toLowerCase();xt==="inertia"?K.inertia=!0:(xt==="build"||xt==="buy"||xt==="outsource"||xt==="market")&&(K.strategy=xt)}if(X.indexOf("{")>=0){var ee=X.substring(X.indexOf("{")+1);if(X.indexOf("}")<0){for(n++;n<v.length&&v[n].indexOf("}")<0;)ee+=" "+v[n],n++;n<v.length&&(ee+=" "+v[n])}var N=ee.match(/label\s*\[\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\]/i);N&&(K.labelOffsetX=parseFloat(N[1]),K.labelOffsetY=parseFloat(N[2]))}return w(y,b,K),n}function w(r,h,v){var n=h[v.id];if(n)for(var y in v)v[y]!=null&&v[y]!==!1&&(n[y]=v[y]);else h[v.id]=v,r.nodes.push(v)}function p(r,h,v,n,y){var b=r.match(/^(.+?)\s*\{?\s*$/),T=u((b?b[1]:r).trim());n.nodes.forEach(function(Q){Q.id===T&&(Q.isPipelineParent=!0)});var I={parent:T,componentIds:[]};n.pipelines.push(I);var F=y[T],X=F?F.y:50;if(r.indexOf("{")<0)for(;v+1<h.length&&h[v+1].trim()==="";)v++;for(v++;v<h.length;v++){var K=h[v].trim();if(!(K===""||K.substring(0,2)==="%%")){if(K.indexOf("}")>=0)break;var ot=P(K);if(ot){var pt=K.indexOf("["),xt=u(K.substring(0,pt).trim()),ee=T+"_"+xt,N={id:ee,name:xt,x:ot.x,y:X,kind:"pipeline-component",strategy:null,inertia:!1,labelOffsetX:null,labelOffsetY:null,isPipelineParent:!1,inPipeline:!0};w(n,y,N),I.componentIds.push(ee)}}}return v}function s(r,h){for(var v=r.split("->"),n=[],y=[],b=!1,T=0;T<v.length;T++){var I=v[T].trim(),F=I.match(/^@([-\d.]+)\s+(.*)$/);F&&(b=!0,y.push(parseFloat(F[1])),I=F[2].trim());var X=I.match(/^(\S[^"]*?)\s+"([^"]*)"\s*$/);X?n.push(X[1].trim()+" / "+X[2].trim()):n.push(u(I))}h.axes.stages=n,b&&y.length===n.length&&(h.axes.stageBoundaries=y)}function o(r){var h=P(r);if(!h)return null;var v=r.substring(0,r.indexOf("[")).trim();return{text:u(v),x:h.x,y:h.y}}function d(r){var h=P(r);if(!h)return null;var v=u(r.substring(0,r.indexOf("[")).trim());return{name:v,x:h.x,y:h.y}}function M(r){var h=r.match(/^(.+?)\s+(-\.->|->|\+(?:'[^']*')?(?:<>|<|>)?)\s+(.+)$/);if(!h)return null;var v=u(h[1].trim()),n=h[2],y=u(h[3].trim()),b=n.indexOf("-.")>=0,T=null,I=null,F=n.match(/'([^']*)'/);return F&&(I=F[1]),n.charAt(0)==="+"&&(n.indexOf("<>")>=0?T="bidirectional":n.indexOf("<")>=0?T="backward":T="forward"),{from:v,to:y,dashed:b,label:I,flow:T}}function f(r,h,v,n,y){var b=h[v],T=y!=null?y:b?b.y:50;r.trends.push({nodeId:v,targetX:n,targetY:T})}function u(r){return r&&(r.charAt(0)==='"'&&r.charAt(r.length-1)==='"'||r.charAt(0)==="'"&&r.charAt(r.length-1)==="'"?r.substring(1,r.length-1):r)}return{parse:L}})();var vs=(function(){var L={ui:1,pcr:1,processor:1,cmd:1,command:1,rmo:1,readmodel:1,evt:1,event:1};function j(E,w,p,s){for(var o={type:"eventmodeling",title:null,frames:[],dataEntities:[]},d=E.split(`
+`),M=0;M<d.length;M++){var f=d[M].trim();if(!(!f||f.substring(0,2)==="%%")){var u;if(u=f.match(/^title\s+(.*)$/i)){o.title=u[1].trim();continue}if(!(/^accTitle\s*:/i.test(f)||/^accDescr/i.test(f))){if(u=f.match(/^data\s+(\S+)\s*(\{?)\s*$/i)){var r=u[1],h=[];if(!u[2]){for(;M+1<d.length&&d[M+1].trim()==="";)M++;M+1<d.length&&d[M+1].trim()==="{"&&M++}for(M++;M<d.length&&!(d[M].indexOf("}")>=0);M++)d[M].trim()!==""&&h.push(d[M].trim());o.dataEntities.push({name:r,lines:h});continue}if(u=f.match(/^(tf|timeframe|rf|resetframe)\s+(\d{1,3})\s+(\S+)\s+(\S+)\s*(.*)$/i),u&&L[u[3].toLowerCase()]){var v={name:u[2],entityType:u[3].toLowerCase(),entityIdentifier:u[4],isReset:/^(rf|resetframe)$/i.test(u[1]),sourceFrames:[],dataReference:null,dataInline:null};P(u[5]||"",v),o.frames.push(v)}}}}return!o.title&&p&&typeof p.title=="string"&&(o.title=p.title),o}function P(E,w){for(var p,s=/->>\s*(\d{1,3})/g;(p=s.exec(E))!==null;)w.sourceFrames.push(p[1]);var o=E.match(/\[\[\s*([^\]]+?)\s*\]\]/);o&&(w.dataReference=o[1].trim());var d=E.match(/\{([^}]*)\}/);if(d)w.dataInline=d[1].trim();else{var M=E.match(/"([^"]*)"|'([^']*)'/);M&&(w.dataInline=(M[1]!=null?M[1]:M[2]).trim())}}return{parse:j}})();var si=(function(){var L={flowchart:"flowchart",graph:"flowchart",classDiagram:"class",classdiagram:"class","classDiagram-v2":"class",stateDiagram:"state",statediagram:"state","stateDiagram-v2":"state","statediagram-v2":"state",erDiagram:"er",erdiagram:"er",sequenceDiagram:"sequence",sequencediagram:"sequence",gitGraph:"gitgraph",gitgraph:"gitgraph",journey:"journey",mindmap:"mindmap",requirementDiagram:"requirement",requirementdiagram:"requirement",gantt:"gantt",pie:"pie",packet:"packet","packet-beta":"packet",packetbeta:"packet",quadrantChart:"quadrant",quadrantchart:"quadrant",timeline:"timeline",kanban:"kanban","xychart-beta":"xychart",xychartbeta:"xychart",xychart:"xychart","radar-beta":"radar",radarbeta:"radar",radar:"radar","block-beta":"block",blockbeta:"block",block:"block",C4Context:"c4",c4context:"c4",C4Container:"c4",c4container:"c4",C4Component:"c4",c4component:"c4",C4Dynamic:"c4",c4dynamic:"c4",C4Deployment:"c4",c4deployment:"c4","architecture-beta":"architecture",architecturebeta:"architecture",architecture:"architecture","sankey-beta":"sankey",sankeybeta:"sankey",sankey:"sankey",treemap:"treemap","treemap-beta":"treemap",treemapbeta:"treemap",gantt:"gantt",zenuml:"zenuml",venn:"venn","venn-beta":"venn",vennbeta:"venn",ishikawa:"ishikawa","ishikawa-beta":"ishikawa",ishikawabeta:"ishikawa",fishbone:"ishikawa",treeView:"treeView",treeview:"treeView","treeView-beta":"treeView","treeview-beta":"treeView",treeviewbeta:"treeView",wardley:"wardley","wardley-beta":"wardley",wardleybeta:"wardley",eventmodeling:"eventmodeling","eventmodeling-beta":"eventmodeling"},j={};function P(r,h){j[r]=h}function E(r,h){for(;h<r.length;){var v=r[h].trim();if(v.length===0)h++;else if(v.substring(0,3)==="%%{"){for(;h<r.length&&r[h].indexOf("}%%")<0;)h++;h++}else if(v.substring(0,2)==="%%")h++;else break}return h}function w(r){return typeof r!="string"?r:r.replace(/[\u000b\u000c\u00a0\u1680\u2000-\u200a\u202f\u205f\u3000]/g," ").replace(/[\u200b\u200c\u200d\u2060\ufeff]/g,"")}function p(r){r=w(r);var h=r.split(`
+`),v=E(h,0);if(v>=h.length)return null;if(h[v].trim()==="---"){for(v++;v<h.length&&h[v].trim()!=="---";)v++;v++,v=E(h,v)}if(v>=h.length)return null;var n=h[v].trim();if(n==="mermaid"||n.indexOf(`mermaid
+`)===0){if(v++,v>=h.length)return null;n=h[v].trim()}var y=n.split(/\s+/),b=y[0];b[b.length-1]===":"&&(b=b.substring(0,b.length-1));var T=L[b]||L[b.toLowerCase()];if(!T)return null;var I=null,F=1,X=v+1,K=s(r,v+1);if(T==="flowchart"&&y.length>1){var ot=n.substring(y[0].length),pt=/^\s*(TB|TD|LR|RL|BT)(?=[\s;]|$)/i.exec(ot);I="TD",pt!=null&&(I=pt[1].toUpperCase(),ot=ot.substring(pt[0].length),F=2),ot.trim().length>0&&(X=v,K=s(r,v)+h[v].indexOf(n)+(n.length-ot.length))}else if(T==="gitgraph"&&y.length>1){var xt=y[1].replace(/:$/,"").toUpperCase();(xt==="TB"||xt==="TD"||xt==="BT"||xt==="LR"||xt==="RL")&&(I=xt,F=2)}else if(T==="timeline"&&y.length>1){var ee=y[1].toUpperCase();(ee==="TB"||ee==="TD"||ee==="BT"||ee==="LR"||ee==="RL")&&(I=ee,F=2)}var N=y.slice(F).join(" ");return{type:T,keyword:b,direction:I,remainder:N,bodyStartLine:X,bodyStart:K}}function s(r,h){for(var v=0,n=0;n<h&&v<r.length;n++){var y=r.indexOf(`
+`,v);if(y<0)return r.length;v=y+1}return v}function o(r){var h={},v=new Ua(r);v.skipWhitespace();var n=v.parseFrontmatter();for(n&&n.config&&M(h,n.config),n&&typeof n.title=="string"&&(h.title=n.title),n&&typeof n.displayMode=="string"&&(h.displayMode=n.displayMode),v.skipWhitespace();v.peekStr(3)==="%%{";){var y=v.parseDirective();y&&M(h,y),v.skipWhitespace()}return{config:h,textOffset:v.pos}}function d(r){return r==="__proto__"||r==="constructor"||r==="prototype"}function M(r,h){for(var v in h)h.hasOwnProperty(v)&&!d(v)&&(typeof h[v]=="object"&&h[v]!==null&&typeof r[v]=="object"&&r[v]!==null?M(r[v],h[v]):r[v]=h[v])}function f(r){r=w(r),r=r.trim();var h=o(r),v=h.config,n=p(r);if(!n)throw new Error("Unsupported or unrecognized Mermaid diagram type");var y=r.substring(n.bodyStart),b=j[n.type];if(!b)throw new Error("No parser registered for diagram type: "+n.type);var T=b.parse(y,n.direction,v,n);return{type:n.type,ir:T,config:v,direction:n.direction}}function u(r){var h=p(w(r));return h!=null&&j[h.type]!=null}return typeof Ho!="undefined"&&P("flowchart",Ho),typeof Wo!="undefined"&&P("class",Wo),typeof Uo!="undefined"&&P("state",Uo),typeof Yo!="undefined"&&P("er",Yo),typeof Vo!="undefined"&&P("requirement",Vo),typeof jo!="undefined"&&P("sequence",jo),typeof Xo!="undefined"&&P("gitgraph",Xo),typeof qo!="undefined"&&P("journey",qo),typeof $o!="undefined"&&P("mindmap",$o),typeof Go!="undefined"&&P("pie",Go),typeof Zo!="undefined"&&P("packet",Zo),typeof Ko!="undefined"&&P("quadrant",Ko),typeof Qo!="undefined"&&P("timeline",Qo),typeof Jo!="undefined"&&P("kanban",Jo),typeof ts!="undefined"&&P("xychart",ts),typeof es!="undefined"&&P("radar",es),typeof rs!="undefined"&&P("block",rs),typeof as!="undefined"&&P("c4",as),typeof ns!="undefined"&&P("architecture",ns),typeof is!="undefined"&&P("sankey",is),typeof os!="undefined"&&P("treemap",os),typeof ss!="undefined"&&P("gantt",ss),typeof ls!="undefined"&&P("zenuml",ls),typeof hs!="undefined"&&P("venn",hs),typeof cs!="undefined"&&P("ishikawa",cs),typeof fs!="undefined"&&P("treeView",fs),typeof us!="undefined"&&P("wardley",us),typeof vs!="undefined"&&P("eventmodeling",vs),{parse:f,detectType:p,isSupported:u,registerParser:P}})();var Lg=(()=>{var L=Object.defineProperty,j=Object.getOwnPropertyDescriptor,P=Object.getOwnPropertyNames,E=Object.prototype.hasOwnProperty,w=(i,m,k)=>m in i?L(i,m,{enumerable:!0,configurable:!0,writable:!0,value:k}):i[m]=k,p=(i,m)=>{for(var k in m)L(i,k,{get:m[k],enumerable:!0})},s=(i,m,k,R)=>{if(m&&typeof m=="object"||typeof m=="function")for(let $ of P(m))!E.call(i,$)&&$!==k&&L(i,$,{get:()=>m[$],enumerable:!(R=j(m,$))||R.enumerable});return i},o=i=>s(L({},"__esModule",{value:!0}),i),d=(i,m,k)=>w(i,typeof m!="symbol"?m+"":m,k),M={};p(M,{Graph:()=>h,debug:()=>Gr,default:()=>pa,graphlib:()=>f,layout:()=>le,util:()=>ya,version:()=>sa});var f={};p(f,{Graph:()=>h,alg:()=>xt,json:()=>F,version:()=>I});var u=Object.defineProperty,r=(i,m)=>{for(var k in m)u(i,k,{get:m[k],enumerable:!0})},h=class{constructor(i){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=()=>{},i&&(this._isDirected="directed"in i?i.directed:!0,this._isMultigraph="multigraph"in i?i.multigraph:!1,this._isCompound="compound"in i?i.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(i){return this._label=i,this}graph(){return this._label}setDefaultNodeLabel(i){return typeof i!="function"?this._defaultNodeLabelFn=()=>i:this._defaultNodeLabelFn=i,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(i=>Object.keys(this._in[i]).length===0)}sinks(){return this.nodes().filter(i=>Object.keys(this._out[i]).length===0)}setNodes(i,m){return i.forEach(k=>{m!==void 0?this.setNode(k,m):this.setNode(k)}),this}setNode(i,m){return i in this._nodes?(arguments.length>1&&(this._nodes[i]=m),this):(this._nodes[i]=arguments.length>1?m:this._defaultNodeLabelFn(i),this._isCompound&&(this._parent[i]="\0",this._children[i]={},this._children["\0"][i]=!0),this._in[i]={},this._preds[i]={},this._out[i]={},this._sucs[i]={},++this._nodeCount,this)}node(i){return this._nodes[i]}hasNode(i){return i in this._nodes}removeNode(i){if(i in this._nodes){let m=k=>this.removeEdge(this._edgeObjs[k]);delete this._nodes[i],this._isCompound&&(this._removeFromParentsChildList(i),delete this._parent[i],this.children(i).forEach(k=>{this.setParent(k)}),delete this._children[i]),Object.keys(this._in[i]).forEach(m),delete this._in[i],delete this._preds[i],Object.keys(this._out[i]).forEach(m),delete this._out[i],delete this._sucs[i],--this._nodeCount}return this}setParent(i,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(m===void 0)m="\0";else{m+="";for(let k=m;k!==void 0;k=this.parent(k))if(k===i)throw new Error("Setting "+m+" as parent of "+i+" would create a cycle");this.setNode(m)}return this.setNode(i),this._removeFromParentsChildList(i),this._parent[i]=m,this._children[m][i]=!0,this}parent(i){if(this._isCompound){let m=this._parent[i];if(m!=="\0")return m}}children(i="\0"){if(this._isCompound){let m=this._children[i];if(m)return Object.keys(m)}else{if(i==="\0")return this.nodes();if(this.hasNode(i))return[]}return[]}predecessors(i){let m=this._preds[i];if(m)return Object.keys(m)}successors(i){let m=this._sucs[i];if(m)return Object.keys(m)}neighbors(i){let m=this.predecessors(i);if(m){let k=new Set(m);for(let R of this.successors(i))k.add(R);return Array.from(k.values())}}isLeaf(i){let m;return this.isDirected()?m=this.successors(i):m=this.neighbors(i),m.length===0}filterNodes(i){let m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph()),Object.entries(this._nodes).forEach(([$,et])=>{i($)&&m.setNode($,et)}),Object.values(this._edgeObjs).forEach($=>{m.hasNode($.v)&&m.hasNode($.w)&&m.setEdge($,this.edge($))});let k={},R=$=>{let et=this.parent($);return!et||m.hasNode(et)?(k[$]=et!=null?et:void 0,et!=null?et:void 0):et in k?k[et]:R(et)};return this._isCompound&&m.nodes().forEach($=>m.setParent($,R($))),m}setDefaultEdgeLabel(i){return typeof i!="function"?this._defaultEdgeLabelFn=()=>i:this._defaultEdgeLabelFn=i,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(i,m){return i.reduce((k,R)=>(m!==void 0?this.setEdge(k,R,m):this.setEdge(k,R),R)),this}setEdge(i,m,k,R){let $,et,vt,Et,Yt=!1;typeof i=="object"&&i!==null&&"v"in i?($=i.v,et=i.w,vt=i.name,arguments.length===2&&(Et=m,Yt=!0)):($=i,et=m,vt=R,arguments.length>2&&(Et=k,Yt=!0)),$=""+$,et=""+et,vt!==void 0&&(vt=""+vt);let Gt=y(this._isDirected,$,et,vt);if(Gt in this._edgeLabels)return Yt&&(this._edgeLabels[Gt]=Et),this;if(vt!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode($),this.setNode(et),this._edgeLabels[Gt]=Yt?Et:this._defaultEdgeLabelFn($,et,vt);let he=b(this._isDirected,$,et,vt);return $=he.v,et=he.w,Object.freeze(he),this._edgeObjs[Gt]=he,v(this._preds[et],$),v(this._sucs[$],et),this._in[et][Gt]=he,this._out[$][Gt]=he,this._edgeCount++,this}edge(i,m,k){let R=arguments.length===1?T(this._isDirected,i):y(this._isDirected,i,m,k);return this._edgeLabels[R]}edgeAsObj(i,m,k){let R=arguments.length===1?this.edge(i):this.edge(i,m,k);return typeof R!="object"?{label:R}:R}hasEdge(i,m,k){return(arguments.length===1?T(this._isDirected,i):y(this._isDirected,i,m,k))in this._edgeLabels}removeEdge(i,m,k){let R=arguments.length===1?T(this._isDirected,i):y(this._isDirected,i,m,k),$=this._edgeObjs[R];if($){let et=$.v,vt=$.w;delete this._edgeLabels[R],delete this._edgeObjs[R],n(this._preds[vt],et),n(this._sucs[et],vt),delete this._in[vt][R],delete this._out[et][R],this._edgeCount--}return this}inEdges(i,m){return this.isDirected()?this.filterEdges(this._in[i],i,m):this.nodeEdges(i,m)}outEdges(i,m){return this.isDirected()?this.filterEdges(this._out[i],i,m):this.nodeEdges(i,m)}nodeEdges(i,m){if(i in this._nodes)return this.filterEdges(Bo(Bo({},this._in[i]),this._out[i]),i,m)}_removeFromParentsChildList(i){delete this._children[this._parent[i]][i]}filterEdges(i,m,k){if(!i)return;let R=Object.values(i);return k?R.filter($=>$.v===m&&$.w===k||$.v===k&&$.w===m):R}};function v(i,m){i[m]?i[m]++:i[m]=1}function n(i,m){i[m]!==void 0&&!--i[m]&&delete i[m]}function y(i,m,k,R){let $=""+m,et=""+k;if(!i&&$>et){let vt=$;$=et,et=vt}return $+""+et+""+(R===void 0?"\0":R)}function b(i,m,k,R){let $=""+m,et=""+k;if(!i&&$>et){let Et=$;$=et,et=Et}let vt={v:$,w:et};return R&&(vt.name=R),vt}function T(i,m){return y(i,m.v,m.w,m.name)}var I="4.0.1",F={};r(F,{read:()=>pt,write:()=>X});function X(i){let m={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:K(i),edges:ot(i)},k=i.graph();return k!==void 0&&(m.value=structuredClone(k)),m}function K(i){return i.nodes().map(m=>{let k=i.node(m),R=i.parent(m),$={v:m};return k!==void 0&&($.value=k),R!==void 0&&($.parent=R),$})}function ot(i){return i.edges().map(m=>{let k=i.edge(m),R={v:m.v,w:m.w};return m.name!==void 0&&(R.name=m.name),k!==void 0&&(R.value=k),R})}function pt(i){let m=new h(i.options);return i.value!==void 0&&m.setGraph(i.value),i.nodes.forEach(k=>{m.setNode(k.v,k.value),k.parent&&m.setParent(k.v,k.parent)}),i.edges.forEach(k=>{m.setEdge({v:k.v,w:k.w,name:k.name},k.value)}),m}var xt={};r(xt,{CycleException:()=>It,bellmanFord:()=>N,components:()=>at,dijkstra:()=>O,dijkstraAll:()=>lt,findCycles:()=>gt,floydWarshall:()=>Tt,isAcyclic:()=>Qt,postorder:()=>Ee,preorder:()=>xe,prim:()=>ar,shortestPaths:()=>xr,tarjan:()=>W,topsort:()=>te});var ee=()=>1;function N(i,m,k,R){return Q(i,String(m),k||ee,R||function($){return i.outEdges($)})}function Q(i,m,k,R){let $={},et,vt=0,Et=i.nodes(),Yt=function(_e){let He=k(_e);$[_e.v].distance+He<$[_e.w].distance&&($[_e.w]={distance:$[_e.v].distance+He,predecessor:_e.v},et=!0)},Gt=function(){Et.forEach(function(_e){R(_e).forEach(function(He){let qe=He.v===_e?He.v:He.w,Er=qe===He.v?He.w:He.v;Yt({v:qe,w:Er})})})};Et.forEach(function(_e){let He=_e===m?0:Number.POSITIVE_INFINITY;$[_e]={distance:He,predecessor:""}});let he=Et.length;for(let _e=1;_e<he&&(et=!1,vt++,Gt(),!!et);_e++);if(vt===he-1&&(et=!1,Gt(),et))throw new Error("The graph contains a negative weight cycle");return $}function at(i){let m={},k=[],R;function $(et){et in m||(m[et]=!0,R.push(et),i.successors(et).forEach($),i.predecessors(et).forEach($))}return i.nodes().forEach(function(et){R=[],$(et),R.length&&k.push(R)}),k}var _=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(i=>i.key)}has(i){return i in this._keyIndices}priority(i){let m=this._keyIndices[i];if(m!==void 0)return this._arr[m].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(i,m){let k=this._keyIndices,R=String(i);if(!(R in k)){let $=this._arr,et=$.length;return k[R]=et,$.push({key:R,priority:m}),this._decrease(et),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let i=this._arr.pop();return delete this._keyIndices[i.key],this._heapify(0),i.key}decrease(i,m){let k=this._keyIndices[i];if(k===void 0)throw new Error(`Key not found: ${i}`);let R=this._arr[k].priority;if(m>R)throw new Error(`New priority is greater than current priority. Key: ${i} Old: ${R} New: ${m}`);this._arr[k].priority=m,this._decrease(k)}_heapify(i){let m=this._arr,k=2*i,R=k+1,$=i;k<m.length&&($=m[k].priority<m[$].priority?k:$,R<m.length&&($=m[R].priority<m[$].priority?R:$),$!==i&&(this._swap(i,$),this._heapify($)))}_decrease(i){let m=this._arr,k=m[i].priority,R;for(;i!==0&&(R=i>>1,!(m[R].priority<k));)this._swap(i,R),i=R}_swap(i,m){let k=this._arr,R=this._keyIndices,$=k[i],et=k[m];k[i]=et,k[m]=$,R[et.key]=i,R[$.key]=m}},l=()=>1;function O(i,m,k,R){let $=function(et){return i.outEdges(et)};return z(i,String(m),k||l,R||$)}function z(i,m,k,R){let $={},et=new _,vt,Et,Yt=function(Gt){let he=Gt.v!==vt?Gt.v:Gt.w,_e=$[he],He=k(Gt),qe=Et.distance+He;if(He<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+Gt+" Weight: "+He);qe<_e.distance&&(_e.distance=qe,_e.predecessor=vt,et.decrease(he,qe))};for(i.nodes().forEach(function(Gt){let he=Gt===m?0:Number.POSITIVE_INFINITY;$[Gt]={distance:he,predecessor:""},et.add(Gt,he)});et.size()>0&&(vt=et.removeMin(),Et=$[vt],Et.distance!==Number.POSITIVE_INFINITY);)R(vt).forEach(Yt);return $}function lt(i,m,k){return i.nodes().reduce(function(R,$){return R[$]=O(i,$,m,k),R},{})}function W(i){let m=0,k=[],R={},$=[];function et(vt){let Et=R[vt]={onStack:!0,lowlink:m,index:m++};if(k.push(vt),i.successors(vt).forEach(function(Yt){Yt in R?R[Yt].onStack&&(Et.lowlink=Math.min(Et.lowlink,R[Yt].index)):(et(Yt),Et.lowlink=Math.min(Et.lowlink,R[Yt].lowlink))}),Et.lowlink===Et.index){let Yt=[],Gt;do Gt=k.pop(),R[Gt].onStack=!1,Yt.push(Gt);while(vt!==Gt);$.push(Yt)}}return i.nodes().forEach(function(vt){vt in R||et(vt)}),$}function gt(i){return W(i).filter(function(m){return m.length>1||m.length===1&&i.hasEdge(m[0],m[0])})}var mt=()=>1;function Tt(i,m,k){return Rt(i,m||mt,k||function(R){return i.outEdges(R)})}function Rt(i,m,k){let R={},$=i.nodes();return $.forEach(function(et){R[et]={},R[et][et]={distance:0,predecessor:""},$.forEach(function(vt){et!==vt&&(R[et][vt]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),k(et).forEach(function(vt){let Et=vt.v===et?vt.w:vt.v,Yt=m(vt);R[et][Et]={distance:Yt,predecessor:et}})}),$.forEach(function(et){let vt=R[et];$.forEach(function(Et){let Yt=R[Et];$.forEach(function(Gt){let he=Yt[et],_e=vt[Gt],He=Yt[Gt],qe=he.distance+_e.distance;qe<He.distance&&(He.distance=qe,He.predecessor=_e.predecessor)})})}),R}var It=class extends Error{constructor(...i){super(...i)}};function te(i){let m={},k={},R=[];function $(et){if(et in k)throw new It;et in m||(k[et]=!0,m[et]=!0,i.predecessors(et).forEach($),delete k[et],R.push(et))}if(i.sinks().forEach($),Object.keys(m).length!==i.nodeCount())throw new It;return R}function Qt(i){try{te(i)}catch(m){if(m instanceof It)return!1;throw m}return!0}function pe(i,m,k,R,$){Array.isArray(m)||(m=[m]);let et=(Et=>{var Yt;return(Yt=i.isDirected()?i.successors(Et):i.neighbors(Et))!=null?Yt:[]}),vt={};return m.forEach(function(Et){if(!i.hasNode(Et))throw new Error("Graph does not have node: "+Et);$=ue(i,Et,k==="post",vt,et,R,$)}),$}function ue(i,m,k,R,$,et,vt){return m in R||(R[m]=!0,k||(vt=et(vt,m)),$(m).forEach(function(Et){vt=ue(i,Et,k,R,$,et,vt)}),k&&(vt=et(vt,m))),vt}function me(i,m,k){return pe(i,m,k,function(R,$){return R.push($),R},[])}function Ee(i,m){return me(i,m,"post")}function xe(i,m){return me(i,m,"pre")}function ar(i,m){let k=new h,R={},$=new _,et;function vt(Yt){let Gt=Yt.v===et?Yt.w:Yt.v,he=$.priority(Gt);if(he!==void 0){let _e=m(Yt);_e<he&&(R[Gt]=et,$.decrease(Gt,_e))}}if(i.nodeCount()===0)return k;i.nodes().forEach(function(Yt){$.add(Yt,Number.POSITIVE_INFINITY),k.setNode(Yt)}),$.decrease(i.nodes()[0],0);let Et=!1;for(;$.size()>0;){if(et=$.removeMin(),et in R)k.setEdge(et,R[et]);else{if(Et)throw new Error("Input graph is not connected: "+i);Et=!0}i.nodeEdges(et).forEach(vt)}return k}function xr(i,m,k,R){return sr(i,m,k,R!=null?R:($=>{let et=i.outEdges($);return et!=null?et:[]}))}function sr(i,m,k,R){if(k===void 0)return O(i,m,k,R);let $=!1,et=i.nodes();for(let vt=0;vt<et.length;vt++){let Et=R(et[vt]);for(let Yt=0;Yt<Et.length;Yt++){let Gt=Et[Yt],he=Gt.v===et[vt]?Gt.v:Gt.w,_e=he===Gt.v?Gt.w:Gt.v;k({v:he,w:_e})<0&&($=!0)}if($)return N(i,m,k,R)}return O(i,m,k,R)}function Qe(i,m,k,R){let $=R;for(;i.hasNode($);)$=ir(R);return k.dummy=m,i.setNode($,k),$}function or(i){let m=new h().setGraph(i.graph());return i.nodes().forEach(k=>m.setNode(k,i.node(k))),i.edges().forEach(k=>{let R=m.edge(k.v,k.w)||{weight:0,minlen:1},$=i.edge(k);m.setEdge(k.v,k.w,{weight:R.weight+$.weight,minlen:Math.max(R.minlen,$.minlen)})}),m}function Wr(i){let m=new h({multigraph:i.isMultigraph()}).setGraph(i.graph());return i.nodes().forEach(k=>{i.children(k).length||m.setNode(k,i.node(k))}),i.edges().forEach(k=>{m.setEdge(k,i.edge(k))}),m}function oa(i,m){let k=i.x,R=i.y,$=m.x-k,et=m.y-R,vt=i.width/2,Et=i.height/2;if(!$&&!et)throw new Error("Not possible to find intersection inside of the rectangle");let Yt,Gt;return Math.abs(et)*vt>Math.abs($)*Et?(et<0&&(Et=-Et),Yt=Et*$/et,Gt=Et):($<0&&(vt=-vt),Yt=vt,Gt=vt*et/$),{x:k+Yt,y:R+Gt}}function Sr(i){let m=ur(Jr(i)+1).map(()=>[]);return i.nodes().forEach(k=>{let R=i.node(k),$=R.rank;$!==void 0&&(m[$]||(m[$]=[]),m[$][R.order]=k)}),m}function Rr(i){let m=i.nodes().map(R=>{let $=i.node(R).rank;return $===void 0?Number.MAX_VALUE:$}),k=Ur(Math.min,m);i.nodes().forEach(R=>{let $=i.node(R);Object.hasOwn($,"rank")&&($.rank-=k)})}function Mr(i){let m=i.nodes().map(vt=>i.node(vt).rank).filter(vt=>vt!==void 0),k=Ur(Math.min,m),R=[];i.nodes().forEach(vt=>{let Et=i.node(vt).rank-k;R[Et]||(R[Et]=[]),R[Et].push(vt)});let $=0,et=i.graph().nodeRankFactor;Array.from(R).forEach((vt,Et)=>{vt===void 0&&Et%et!==0?--$:vt!==void 0&&$&&vt.forEach(Yt=>i.node(Yt).rank+=$)})}function er(i,m,k,R){let $={width:0,height:0};return arguments.length>=4&&($.rank=k,$.order=R),Qe(i,"border",$,m)}function Xr(i,m=Kr){let k=[];for(let R=0;R<i.length;R+=m){let $=i.slice(R,R+m);k.push($)}return k}var Kr=65535;function Ur(i,m){if(m.length>Kr){let k=Xr(m);return i(...k.map(R=>i(...R)))}else return i(...m)}function Jr(i){let m=i.nodes().map(k=>{let R=i.node(k).rank;return R===void 0?Number.MIN_VALUE:R});return Ur(Math.max,m)}function Yr(i,m){let k={lhs:[],rhs:[]};return i.forEach(R=>{m(R)?k.lhs.push(R):k.rhs.push(R)}),k}function ke(i,m){let k=Date.now();try{return m()}finally{console.log(i+" time: "+(Date.now()-k)+"ms")}}function ze(i,m){return m()}var lr=0;function ir(i){let m=++lr;return i+(""+m)}function ur(i,m,k=1){m==null&&(m=i,i=0);let R=et=>et<m;k<0&&(R=et=>m<et);let $=[];for(let et=i;R(et);et+=k)$.push(et);return $}function zr(i,m){let k={};for(let R of m)i[R]!==void 0&&(k[R]=i[R]);return k}function cr(i,m){let k;return typeof m=="string"?k=R=>R[m]:k=m,Object.entries(i).reduce((R,[$,et])=>(R[$]=k(et,$),R),{})}function Nr(i,m){return i.reduce((k,R,$)=>(k[R]=m[$],k),{})}var Fr="\0",sa="3.0.0",yr=class{constructor(){d(this,"_sentinel");let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,m=i._prev;if(m!==i)return kr(m),m}enqueue(i){let m=this._sentinel;i._prev&&i._next&&kr(i),i._next=m._next,m._next._prev=i,m._next=i,i._prev=m}toString(){let i=[],m=this._sentinel,k=m._prev;for(;k!==m;)i.push(JSON.stringify(k,pr)),k=k._prev;return"["+i.join(", ")+"]"}};function kr(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function pr(i,m){if(i!=="_next"&&i!=="_prev")return m}var rr=yr,Pr=()=>1;function ta(i,m){if(i.nodeCount()<=1)return[];let k=ca(i,m||Pr);return wr(k.graph,k.buckets,k.zeroIdx).flatMap(R=>i.outEdges(R.v,R.w)||[])}function wr(i,m,k){var R;let $=[],et=m[m.length-1],vt=m[0],Et;for(;i.nodeCount();){for(;Et=vt.dequeue();)Sa(i,m,k,Et);for(;Et=et.dequeue();)Sa(i,m,k,Et);if(i.nodeCount()){for(let Yt=m.length-2;Yt>0;--Yt)if(Et=(R=m[Yt])==null?void 0:R.dequeue(),Et){$=$.concat(Sa(i,m,k,Et,!0)||[]);break}}}return $}function Sa(i,m,k,R,$){let et=[],vt=$?et:void 0;return(i.inEdges(R.v)||[]).forEach(Et=>{let Yt=i.edge(Et),Gt=i.node(Et.v);$&&et.push({v:Et.v,w:Et.w}),Gt.out-=Yt,ba(m,k,Gt)}),(i.outEdges(R.v)||[]).forEach(Et=>{let Yt=i.edge(Et),Gt=Et.w,he=i.node(Gt);he.in-=Yt,ba(m,k,he)}),i.removeNode(R.v),vt}function ca(i,m){let k=new h,R=0,$=0;i.nodes().forEach(Et=>{k.setNode(Et,{v:Et,in:0,out:0})}),i.edges().forEach(Et=>{let Yt=k.edge(Et.v,Et.w)||0,Gt=m(Et),he=Yt+Gt;k.setEdge(Et.v,Et.w,he);let _e=k.node(Et.v),He=k.node(Et.w);$=Math.max($,_e.out+=Gt),R=Math.max(R,He.in+=Gt)});let et=ra($+R+3).map(()=>new rr),vt=R+1;return k.nodes().forEach(Et=>{ba(et,vt,k.node(Et))}),{graph:k,buckets:et,zeroIdx:vt}}function ba(i,m,k){var R,$,et;k.out?k.in?(et=i[k.out-k.in+m])==null||et.enqueue(k):($=i[i.length-1])==null||$.enqueue(k):(R=i[0])==null||R.enqueue(k)}function ra(i){let m=[];for(let k=0;k<i;k++)m.push(k);return m}function Dr(i){(i.graph().acyclicer==="greedy"?ta(i,m(i)):la(i)).forEach(k=>{let R=i.edge(k);i.removeEdge(k),R.forwardName=k.name,R.reversed=!0,i.setEdge(k.w,k.v,R,ir("rev"))});function m(k){return R=>k.edge(R).weight}}function la(i){let m=[],k={},R={};function $(et){Object.hasOwn(R,et)||(R[et]=!0,k[et]=!0,i.outEdges(et).forEach(vt=>{Object.hasOwn(k,vt.w)?m.push(vt):$(vt.w)}),delete k[et])}return i.nodes().forEach($),m}function qr(i){i.edges().forEach(m=>{let k=i.edge(m);if(k.reversed){i.removeEdge(m);let R=k.forwardName;delete k.reversed,delete k.forwardName,i.setEdge(m.w,m.v,k,R)}})}function ma(i){i.graph().dummyChains=[],i.edges().forEach(m=>Ja(i,m))}function Ja(i,m){let k=m.v,R=i.node(k).rank,$=m.w,et=i.node($).rank,vt=m.name,Et=i.edge(m),Yt=Et.labelRank;if(et===R+1)return;i.removeEdge(m);let Gt,he,_e;for(_e=0,++R;R<et;++_e,++R)Et.points=[],he={width:0,height:0,edgeLabel:Et,edgeObj:m,rank:R},Gt=Qe(i,"edge",he,"_d"),R===Yt&&(he.width=Et.width,he.height=Et.height,he.dummy="edge-label",he.labelpos=Et.labelpos),i.setEdge(k,Gt,{weight:Et.weight},vt),_e===0&&i.graph().dummyChains.push(Gt),k=Gt;i.setEdge(k,$,{weight:Et.weight},vt)}function sn(i){i.graph().dummyChains.forEach(m=>{let k=i.node(m),R=k.edgeLabel,$;for(i.setEdge(k.edgeObj,R);k.dummy;)$=i.successors(m)[0],i.removeNode(m),R.points.push({x:k.x,y:k.y}),k.dummy==="edge-label"&&(R.x=k.x,R.y=k.y,R.width=k.width,R.height=k.height),m=$,k=i.node(m)})}function fn(i){let m={};function k(R){let $=i.node(R);if(Object.hasOwn(m,R))return $.rank;m[R]=!0;let et=i.outEdges(R),vt=et?et.map(Yt=>Yt==null?Number.POSITIVE_INFINITY:k(Yt.w)-i.edge(Yt).minlen):[],Et=Ur(Math.min,vt);return Et===Number.POSITIVE_INFINITY&&(Et=0),$.rank=Et}i.sources().forEach(k)}function Na(i,m){return i.node(m.w).rank-i.node(m.v).rank-i.edge(m).minlen}var Cn=Mn;function Mn(i){let m=new h({directed:!1}),k=i.nodes();if(k.length===0)throw new Error("Graph must have at least one node");let R=k[0],$=i.nodeCount();m.setNode(R,{});let et,vt;for(;nn(m,i)<$&&(et=An(m,i),!!et);)vt=m.hasNode(et.v)?Na(i,et):-Na(i,et),dn(m,i,vt);return m}function nn(i,m){function k(R){let $=m.nodeEdges(R);$&&$.forEach(et=>{let vt=et.v,Et=R===vt?et.w:vt;!i.hasNode(Et)&&!Na(m,et)&&(i.setNode(Et,{}),i.setEdge(R,Et,{}),k(Et))})}return i.nodes().forEach(k),i.nodeCount()}function An(i,m){return m.edges().reduce((k,R)=>{let $=Number.POSITIVE_INFINITY;return i.hasNode(R.v)!==i.hasNode(R.w)&&($=Na(m,R)),$<k[0]?[$,R]:k},[Number.POSITIVE_INFINITY,null])[1]}function dn(i,m,k){i.nodes().forEach(R=>m.node(R).rank+=k)}var{preorder:Ln,postorder:Fn}=xt,g=tt;tt.initLowLimValues=yt,tt.initCutValues=B,tt.calcCutValue=H,tt.leaveEdge=ht,tt.enterEdge=bt,tt.exchangeEdges=Nt;function tt(i){i=or(i),fn(i);let m=Cn(i);yt(m),B(m,i);let k,R;for(;k=ht(m);)R=bt(m,i,k),Nt(m,i,k,R)}function B(i,m){let k=Fn(i,i.nodes());k=k.slice(0,k.length-1),k.forEach(R=>Z(i,m,R))}function Z(i,m,k){let R=i.node(k).parent,$=i.edge(k,R);$.cutvalue=H(i,m,k)}function H(i,m,k){let R=i.node(k).parent,$=!0,et=m.edge(k,R),vt=0;et||($=!1,et=m.edge(R,k)),vt=et.weight;let Et=m.nodeEdges(k);return Et&&Et.forEach(Yt=>{let Gt=Yt.v===k,he=Gt?Yt.w:Yt.v;if(he!==R){let _e=Gt===$,He=m.edge(Yt).weight;if(vt+=_e?He:-He,st(i,k,he)){let qe=i.edge(k,he).cutvalue;vt+=_e?-qe:qe}}}),vt}function yt(i,m){arguments.length<2&&(m=i.nodes()[0]),ut(i,{},1,m)}function ut(i,m,k,R,$){let et=k,vt=i.node(R);m[R]=!0;let Et=i.neighbors(R);return Et&&Et.forEach(Yt=>{Object.hasOwn(m,Yt)||(k=ut(i,m,k,Yt,R))}),vt.low=et,vt.lim=k++,$?vt.parent=$:delete vt.parent,k}function ht(i){return i.edges().find(m=>i.edge(m).cutvalue<0)}function bt(i,m,k){let R=k.v,$=k.w;m.hasEdge(R,$)||(R=k.w,$=k.v);let et=i.node(R),vt=i.node($),Et=et,Yt=!1;return et.lim>vt.lim&&(Et=vt,Yt=!0),m.edges().filter(Gt=>Yt===Lt(i,i.node(Gt.v),Et)&&Yt!==Lt(i,i.node(Gt.w),Et)).reduce((Gt,he)=>Na(m,he)<Na(m,Gt)?he:Gt)}function Nt(i,m,k,R){let $=k.v,et=k.w;i.removeEdge($,et),i.setEdge(R.v,R.w,{}),yt(i),B(i,m),Dt(i,m)}function Dt(i,m){let k=i.nodes().find($=>!i.node($).parent);if(!k)return;let R=Ln(i,[k]);R=R.slice(1),R.forEach($=>{let et=i.node($).parent,vt=m.edge($,et),Et=!1;vt||(vt=m.edge(et,$),Et=!0),m.node($).rank=m.node(et).rank+(Et?vt.minlen:-vt.minlen)})}function st(i,m,k){return i.hasEdge(m,k)}function Lt(i,m,k){return k.low<=m.lim&&m.lim<=k.lim}var ft=Ct;function Ct(i){let m=i.graph().ranker;if(typeof m=="function")return m(i);switch(m){case"network-simplex":Zt(i);break;case"tight-tree":St(i);break;case"longest-path":Xt(i);break;case"none":break;default:Zt(i)}}var Xt=fn;function St(i){fn(i),Cn(i)}function Zt(i){g(i)}var G=dt;function dt(i){let m=ae(i);i.graph().dummyChains.forEach(k=>{let R=i.node(k),$=R.edgeObj,et=oe(i,m,$.v,$.w),vt=et.path,Et=et.lca,Yt=0,Gt=vt[Yt],he=!0;for(;k!==$.w;){if(R=i.node(k),he){for(;(Gt=vt[Yt])!==Et&&i.node(Gt).maxRank<R.rank;)Yt++;Gt===Et&&(he=!1)}if(!he){for(;Yt<vt.length-1&&i.node(vt[Yt+1]).minRank<=R.rank;)Yt++;Gt=vt[Yt]}Gt!==void 0&&i.setParent(k,Gt),k=i.successors(k)[0]}})}function oe(i,m,k,R){let $=[],et=[],vt=Math.min(m[k].low,m[R].low),Et=Math.max(m[k].lim,m[R].lim),Yt;Yt=k;do Yt=i.parent(Yt),$.push(Yt);while(Yt&&(m[Yt].low>vt||Et>m[Yt].lim));let Gt=Yt,he=R;for(;(he=i.parent(he))!==Gt;)et.push(he);return{path:$.concat(et.reverse()),lca:Gt}}function ae(i){let m={},k=0;function R($){let et=k;i.children($).forEach(R),m[$]={low:et,lim:k++}}return i.children(Fr).forEach(R),m}function fe(i){let m=Qe(i,"root",{},"_root"),k=ye(i),R=Object.values(k),$=Ur(Math.max,R)-1,et=2*$+1;i.graph().nestingRoot=m,i.edges().forEach(Et=>i.edge(Et).minlen*=et);let vt=Mt(i)+1;i.children(Fr).forEach(Et=>ne(i,m,et,vt,$,k,Et)),i.graph().nodeRankFactor=et}function ne(i,m,k,R,$,et,vt){var Et;let Yt=i.children(vt);if(!Yt.length){vt!==m&&i.setEdge(m,vt,{weight:0,minlen:k});return}let Gt=er(i,"_bt"),he=er(i,"_bb"),_e=i.node(vt);i.setParent(Gt,vt),_e.borderTop=Gt,i.setParent(he,vt),_e.borderBottom=he,Yt.forEach(He=>{var qe;ne(i,m,k,R,$,et,He);let Er=i.node(He),Tr=Er.borderTop?Er.borderTop:He,Vr=Er.borderBottom?Er.borderBottom:He,Zr=Er.borderTop?R:2*R,ua=Tr!==Vr?1:$-((qe=et[vt])!=null?qe:0)+1;i.setEdge(Gt,Tr,{weight:Zr,minlen:ua,nestingEdge:!0}),i.setEdge(Vr,he,{weight:Zr,minlen:ua,nestingEdge:!0})}),i.parent(vt)||i.setEdge(m,Gt,{weight:0,minlen:$+((Et=et[vt])!=null?Et:0)})}function ye(i){let m={};function k(R,$){let et=i.children(R);et&&et.length&&et.forEach(vt=>k(vt,$+1)),m[R]=$}return i.children(Fr).forEach(R=>k(R,1)),m}function Mt(i){return i.edges().reduce((m,k)=>m+i.edge(k).weight,0)}function $t(i){let m=i.graph();i.removeNode(m.nestingRoot),delete m.nestingRoot,i.edges().forEach(k=>{i.edge(k).nestingEdge&&i.removeEdge(k)})}var Jt=e;function e(i){function m(k){let R=i.children(k),$=i.node(k);if(R.length&&R.forEach(m),Object.hasOwn($,"minRank")){$.borderLeft=[],$.borderRight=[];for(let et=$.minRank,vt=$.maxRank+1;et<vt;++et)x(i,"borderLeft","_bl",k,$,et),x(i,"borderRight","_br",k,$,et)}}i.children(Fr).forEach(m)}function x(i,m,k,R,$,et){let vt={width:0,height:0,rank:et,borderType:m},Et=$[m][et-1],Yt=Qe(i,"border",vt,k);$[m][et]=Yt,i.setParent(Yt,R),Et&&i.setEdge(Et,Yt,{weight:1})}function C(i){var m;let k=(m=i.graph().rankdir)==null?void 0:m.toLowerCase();(k==="lr"||k==="rl")&&Y(i)}function S(i){var m;let k=(m=i.graph().rankdir)==null?void 0:m.toLowerCase();(k==="bt"||k==="rl")&&At(i),(k==="lr"||k==="rl")&&(q(i),Y(i))}function Y(i){i.nodes().forEach(m=>D(i.node(m))),i.edges().forEach(m=>D(i.edge(m)))}function D(i){let m=i.width;i.width=i.height,i.height=m}function At(i){i.nodes().forEach(m=>U(i.node(m))),i.edges().forEach(m=>{var k;let R=i.edge(m);(k=R.points)==null||k.forEach(U),Object.hasOwn(R,"y")&&U(R)})}function U(i){i.y=-i.y}function q(i){i.nodes().forEach(m=>rt(i.node(m))),i.edges().forEach(m=>{var k;let R=i.edge(m);(k=R.points)==null||k.forEach(rt),Object.hasOwn(R,"x")&&rt(R)})}function rt(i){let m=i.x;i.x=i.y,i.y=m}function ct(i){let m={},k=i.nodes().filter(Et=>!i.children(Et).length),R=k.map(Et=>i.node(Et).rank),$=Ur(Math.max,R),et=ur($+1).map(()=>[]);function vt(Et){if(m[Et])return;m[Et]=!0;let Yt=i.node(Et);et[Yt.rank].push(Et);let Gt=i.successors(Et);Gt&&Gt.forEach(vt)}return k.sort((Et,Yt)=>i.node(Et).rank-i.node(Yt).rank).forEach(vt),et}function nt(i,m){let k=0;for(let R=1;R<m.length;++R)k+=zt(i,m[R-1],m[R]);return k}function zt(i,m,k){let R=Nr(k,k.map((Gt,he)=>he)),$=m.flatMap(Gt=>{let he=i.outEdges(Gt);return he?he.map(_e=>({pos:R[_e.w],weight:i.edge(_e).weight})).sort((_e,He)=>_e.pos-He.pos):[]}),et=1;for(;et<k.length;)et<<=1;let vt=2*et-1;et-=1;let Et=new Array(vt).fill(0),Yt=0;return $.forEach(Gt=>{let he=Gt.pos+et;Et[he]+=Gt.weight;let _e=0;for(;he>0;)he%2&&(_e+=Et[he+1]),he=he-1>>1,Et[he]+=Gt.weight;Yt+=Gt.weight*_e}),Yt}function Ot(i,m=[]){return m.map(k=>{let R=i.inEdges(k);if(!R||!R.length)return{v:k};{let $=R.reduce((et,vt)=>{let Et=i.edge(vt),Yt=i.node(vt.v);return{sum:et.sum+Et.weight*Yt.order,weight:et.weight+Et.weight}},{sum:0,weight:0});return{v:k,barycenter:$.sum/$.weight,weight:$.weight}}})}function Ft(i,m){let k={};i.forEach(($,et)=>{let vt={indegree:0,in:[],out:[],vs:[$.v],i:et};$.barycenter!==void 0&&(vt.barycenter=$.barycenter,vt.weight=$.weight),k[$.v]=vt}),m.edges().forEach($=>{let et=k[$.v],vt=k[$.w];et!==void 0&&vt!==void 0&&(vt.indegree++,et.out.push(vt))});let R=Object.values(k).filter($=>!$.indegree);return Pt(R)}function Pt(i){let m=[];function k($){return et=>{et.merged||(et.barycenter===void 0||$.barycenter===void 0||et.barycenter>=$.barycenter)&&Wt($,et)}}function R($){return et=>{et.in.push($),--et.indegree===0&&i.push(et)}}for(;i.length;){let $=i.pop();m.push($),$.in.reverse().forEach(k($)),$.out.forEach(R($))}return m.filter($=>!$.merged).map($=>zr($,["vs","i","barycenter","weight"]))}function Wt(i,m){let k=0,R=0;i.weight&&(k+=i.barycenter*i.weight,R+=i.weight),m.weight&&(k+=m.barycenter*m.weight,R+=m.weight),i.vs=m.vs.concat(i.vs),i.barycenter=k/R,i.weight=R,i.i=Math.min(m.i,i.i),m.merged=!0}function Kt(i,m){let k=Yr(i,he=>Object.hasOwn(he,"barycenter")),R=k.lhs,$=k.rhs.sort((he,_e)=>_e.i-he.i),et=[],vt=0,Et=0,Yt=0;R.sort(ce(!!m)),Yt=Bt(et,$,Yt),R.forEach(he=>{Yt+=he.vs.length,et.push(he.vs),vt+=he.barycenter*he.weight,Et+=he.weight,Yt=Bt(et,$,Yt)});let Gt={vs:et.flat(1)};return Et&&(Gt.barycenter=vt/Et,Gt.weight=Et),Gt}function Bt(i,m,k){let R;for(;m.length&&(R=m[m.length-1]).i<=k;)m.pop(),i.push(R.vs),k++;return k}function ce(i){return(m,k)=>m.barycenter<k.barycenter?-1:m.barycenter>k.barycenter?1:i?k.i-m.i:m.i-k.i}function kt(i,m,k,R){let $=i.children(m),et=i.node(m),vt=et?et.borderLeft:void 0,Et=et?et.borderRight:void 0,Yt={};vt&&($=$.filter(He=>He!==vt&&He!==Et));let Gt=Ot(i,$);Gt.forEach(He=>{if(i.children(He.v).length){let qe=kt(i,He.v,k,R);Yt[He.v]=qe,Object.hasOwn(qe,"barycenter")&&jt(He,qe)}});let he=Ft(Gt,k);wt(he,Yt);let _e=Kt(he,R);if(vt&&Et){_e.vs=[vt,_e.vs,Et].flat(1);let He=i.predecessors(vt);if(He&&He.length){let qe=i.node(He[0]),Er=i.predecessors(Et),Tr=i.node(Er[0]);Object.hasOwn(_e,"barycenter")||(_e.barycenter=0,_e.weight=0),_e.barycenter=(_e.barycenter*_e.weight+qe.order+Tr.order)/(_e.weight+2),_e.weight+=2}}return _e}function wt(i,m){i.forEach(k=>{k.vs=k.vs.flatMap(R=>m[R]?m[R].vs:R)})}function jt(i,m){i.barycenter!==void 0?(i.barycenter=(i.barycenter*i.weight+m.barycenter*m.weight)/(i.weight+m.weight),i.weight+=m.weight):(i.barycenter=m.barycenter,i.weight=m.weight)}function Ht(i,m,k,R){R||(R=i.nodes());let $=qt(i),et=new h({compound:!0}).setGraph({root:$}).setDefaultNodeLabel(vt=>i.node(vt));return R.forEach(vt=>{let Et=i.node(vt),Yt=i.parent(vt);if(Et.rank===m||Et.minRank<=m&&m<=Et.maxRank){et.setNode(vt),et.setParent(vt,Yt||$);let Gt=i[k](vt);Gt&&Gt.forEach(he=>{let _e=he.v===vt?he.w:he.v,He=et.edge(_e,vt),qe=He!==void 0?He.weight:0;et.setEdge(_e,vt,{weight:i.edge(he).weight+qe})}),Object.hasOwn(Et,"minRank")&&et.setNode(vt,{borderLeft:Et.borderLeft[m],borderRight:Et.borderRight[m]})}}),et}function qt(i){let m;for(;i.hasNode(m=ir("_root")););return m}function re(i,m,k){let R={},$;k.forEach(et=>{let vt=i.parent(et),Et,Yt;for(;vt;){if(Et=i.parent(vt),Et?(Yt=R[Et],R[Et]=vt):(Yt=$,$=vt),Yt&&Yt!==vt){m.setEdge(Yt,vt);return}vt=Et}})}function Ut(i,m={}){if(typeof m.customOrder=="function"){m.customOrder(i,Ut);return}let k=Jr(i),R=ve(i,ur(1,k+1),"inEdges"),$=ve(i,ur(k-1,-1,-1),"outEdges"),et=ct(i);if(Se(i,et),m.disableOptimalOrderHeuristic)return;let vt=Number.POSITIVE_INFINITY,Et,Yt=m.constraints||[];for(let Gt=0,he=0;he<4;++Gt,++he){we(Gt%2?R:$,Gt%4>=2,Yt),et=Sr(i);let _e=nt(i,et);_e<vt?(he=0,Et=Object.assign({},et),vt=_e):_e===vt&&(Et=structuredClone(et))}Se(i,Et)}function ve(i,m,k){let R=new Map,$=(et,vt)=>{R.has(et)||R.set(et,[]),R.get(et).push(vt)};for(let et of i.nodes()){let vt=i.node(et);if(typeof vt.rank=="number"&&$(vt.rank,et),typeof vt.minRank=="number"&&typeof vt.maxRank=="number")for(let Et=vt.minRank;Et<=vt.maxRank;Et++)Et!==vt.rank&&$(Et,et)}return m.map(function(et){return Ht(i,et,k,R.get(et)||[])})}function we(i,m,k){let R=new h;i.forEach(function($){k.forEach(Et=>R.setEdge(Et.left,Et.right));let et=$.graph().root,vt=kt($,et,R,m);vt.vs.forEach((Et,Yt)=>$.node(Et).order=Yt),re($,R,vt.vs)})}function Se(i,m){Object.values(m).forEach(k=>k.forEach((R,$)=>i.node(R).order=$))}function be(i,m){let k={};function R($,et){let vt=0,Et=0,Yt=$.length,Gt=et[et.length-1];return et.forEach((he,_e)=>{let He=Fe(i,he),qe=He?i.node(He).order:Yt;(He||he===Gt)&&(et.slice(Et,_e+1).forEach(Er=>{let Tr=i.predecessors(Er);Tr&&Tr.forEach(Vr=>{let Zr=i.node(Vr),ua=Zr.order;(ua<vt||qe<ua)&&!(Zr.dummy&&i.node(Er).dummy)&&Ue(k,Vr,Er)})}),Et=_e+1,vt=qe)}),et}return m.length&&m.reduce(R),k}function Me(i,m){let k={};function R(et,vt,Et,Yt,Gt){ur(vt,Et).forEach(he=>{let _e=et[he];if(_e!==void 0&&i.node(_e).dummy){let He=i.predecessors(_e);He&&He.forEach(qe=>{if(qe===void 0)return;let Er=i.node(qe);Er.dummy&&(Er.order<Yt||Er.order>Gt)&&Ue(k,qe,_e)})}})}function $(et,vt){let Et=-1,Yt=-1,Gt=0;return vt.forEach((he,_e)=>{if(i.node(he).dummy==="border"){let He=i.predecessors(he);if(He&&He.length){let qe=He[0];if(qe===void 0)return;Yt=i.node(qe).order,R(vt,Gt,_e,Et,Yt),Gt=_e,Et=Yt}}R(vt,Gt,vt.length,Yt,et.length)}),vt}return m.length&&m.reduce($),k}function Fe(i,m){if(i.node(m).dummy){let k=i.predecessors(m);if(k)return k.find(R=>i.node(R).dummy)}}function Ue(i,m,k){if(m>k){let $=m;m=k,k=$}let R=i[m];R||(i[m]=R={}),R[k]=!0}function De(i,m,k){if(m>k){let $=m;m=k,k=$}let R=i[m];return R!==void 0&&Object.hasOwn(R,k)}function Ye(i,m,k,R){let $={},et={},vt={};return m.forEach(Et=>{Et.forEach((Yt,Gt)=>{$[Yt]=Yt,et[Yt]=Yt,vt[Yt]=Gt})}),m.forEach(Et=>{let Yt=-1;Et.forEach(Gt=>{let he=R(Gt);if(he&&he.length){let _e=he.sort((qe,Er)=>{let Tr=vt[qe],Vr=vt[Er];return(Tr!==void 0?Tr:0)-(Vr!==void 0?Vr:0)}),He=(_e.length-1)/2;for(let qe=Math.floor(He),Er=Math.ceil(He);qe<=Er;++qe){let Tr=_e[qe];if(Tr===void 0)continue;let Vr=vt[Tr];if(Vr!==void 0&&et[Gt]===Gt&&Yt<Vr&&!De(k,Gt,Tr)){let Zr=$[Tr];Zr!==void 0&&(et[Tr]=Gt,et[Gt]=$[Gt]=Zr,Yt=Vr)}}}})}),{root:$,align:et}}function Pe(i,m,k,R,$=!1){let et={},vt=de(i,m,k,$),Et=$?"borderLeft":"borderRight";function Yt(qe,Er){let Tr=vt.nodes().slice(),Vr={},Zr=Tr.pop();for(;Zr;){if(Vr[Zr])qe(Zr);else{Vr[Zr]=!0,Tr.push(Zr);for(let ua of Er(Zr))Tr.push(ua)}Zr=Tr.pop()}}function Gt(qe){let Er=vt.inEdges(qe);Er?et[qe]=Er.reduce((Tr,Vr)=>{var Zr;let ua=(Zr=et[Vr.v])!=null?Zr:0,Aa=vt.edge(Vr);return Math.max(Tr,ua+(Aa!==void 0?Aa:0))},0):et[qe]=0}function he(qe){let Er=vt.outEdges(qe),Tr=Number.POSITIVE_INFINITY;Er&&(Tr=Er.reduce((Zr,ua)=>{let Aa=et[ua.w],La=vt.edge(ua);return Math.min(Zr,(Aa!==void 0?Aa:0)-(La!==void 0?La:0))},Number.POSITIVE_INFINITY));let Vr=i.node(qe);Tr!==Number.POSITIVE_INFINITY&&Vr.borderType!==Et&&(et[qe]=Math.max(et[qe]!==void 0?et[qe]:0,Tr))}function _e(qe){return vt.predecessors(qe)||[]}function He(qe){return vt.successors(qe)||[]}return Yt(Gt,_e),Yt(he,He),Object.keys(R).forEach(qe=>{var Er;let Tr=k[qe];Tr!==void 0&&(et[qe]=(Er=et[Tr])!=null?Er:0)}),et}function de(i,m,k,R){let $=new h,et=i.graph(),vt=Ie(et.nodesep,et.edgesep,R);return m.forEach(Et=>{let Yt;Et.forEach(Gt=>{let he=k[Gt];if(he!==void 0){if($.setNode(he),Yt!==void 0){let _e=k[Yt];if(_e!==void 0){let He=$.edge(_e,he);$.setEdge(_e,he,Math.max(vt(i,Gt,Yt),He||0))}}Yt=Gt}})}),$}function Ve(i,m){return Object.values(m).reduce((k,R)=>{let $=Number.NEGATIVE_INFINITY,et=Number.POSITIVE_INFINITY;Object.entries(R).forEach(([Et,Yt])=>{let Gt=Ce(i,Et)/2;$=Math.max(Yt+Gt,$),et=Math.min(Yt-Gt,et)});let vt=$-et;return vt<k[0]&&(k=[vt,R]),k},[Number.POSITIVE_INFINITY,null])[1]}function Ne(i,m){let k=Object.values(m),R=Ur(Math.min,k),$=Ur(Math.max,k);["u","d"].forEach(et=>{["l","r"].forEach(vt=>{let Et=et+vt,Yt=i[Et];if(!Yt||Yt===m)return;let Gt=Object.values(Yt),he=R-Ur(Math.min,Gt);vt!=="l"&&(he=$-Ur(Math.max,Gt)),he&&(i[Et]=cr(Yt,_e=>_e+he))})})}function nr(i,m=void 0){let k=i.ul;return k?cr(k,(R,$)=>{var et,vt;if(m){let Yt=m.toLowerCase(),Gt=i[Yt];if(Gt&&Gt[$]!==void 0)return Gt[$]}let Et=Object.values(i).map(Yt=>{let Gt=Yt[$];return Gt!==void 0?Gt:0}).sort((Yt,Gt)=>Yt-Gt);return(((et=Et[1])!=null?et:0)+((vt=Et[2])!=null?vt:0))/2}):{}}function Ge(i){let m=Sr(i),k=Object.assign(be(i,m),Me(i,m)),R={},$;["u","d"].forEach(vt=>{$=vt==="u"?m:Object.values(m).reverse(),["l","r"].forEach(Et=>{Et==="r"&&($=$.map(he=>Object.values(he).reverse()));let Yt=Ye(i,$,k,he=>(vt==="u"?i.predecessors(he):i.successors(he))||[]),Gt=Pe(i,$,Yt.root,Yt.align,Et==="r");Et==="r"&&(Gt=cr(Gt,he=>-he)),R[vt+Et]=Gt})});let et=Ve(i,R);return Ne(R,et),nr(R,i.graph().align)}function Ie(i,m,k){return(R,$,et)=>{let vt=R.node($),Et=R.node(et),Yt=0,Gt;if(Yt+=vt.width/2,Object.hasOwn(vt,"labelpos"))switch(vt.labelpos.toLowerCase()){case"l":Gt=-vt.width/2;break;case"r":Gt=vt.width/2;break}if(Gt&&(Yt+=k?Gt:-Gt),Gt=void 0,Yt+=(vt.dummy?m:i)/2,Yt+=(Et.dummy?m:i)/2,Yt+=Et.width/2,Object.hasOwn(Et,"labelpos"))switch(Et.labelpos.toLowerCase()){case"l":Gt=Et.width/2;break;case"r":Gt=-Et.width/2;break}return Gt&&(Yt+=k?Gt:-Gt),Yt}}function Ce(i,m){return i.node(m).width}function Ke(i){i=Wr(i),We(i),Object.entries(Ge(i)).forEach(([m,k])=>i.node(m).x=k)}function We(i){let m=Sr(i),k=i.graph(),R=k.ranksep,$=k.rankalign,et=0;m.forEach(vt=>{let Et=vt.reduce((Yt,Gt)=>{var he;let _e=(he=i.node(Gt).height)!=null?he:0;return Yt>_e?Yt:_e},0);vt.forEach(Yt=>{let Gt=i.node(Yt);$==="top"?Gt.y=et+Gt.height/2:$==="bottom"?Gt.y=et+Et-Gt.height/2:Gt.y=et+Et/2}),et+=Et+R})}function le(i,m={}){let k=m.debugTiming?ke:ze;return k("layout",()=>{let R=k(" buildLayoutGraph",()=>dr(i));return k(" runLayout",()=>Ae(R,k,m)),k(" updateInputGraph",()=>Le(i,R)),R})}function Ae(i,m,k){m(" makeSpaceForEdgeLabels",()=>Xe(i)),m(" removeSelfEdges",()=>Ir(i)),m(" acyclic",()=>Dr(i)),m(" nestingGraph.run",()=>fe(i)),m(" rank",()=>ft(Wr(i))),m(" injectEdgeLabelProxies",()=>br(i)),m(" removeEmptyRanks",()=>Mr(i)),m(" nestingGraph.cleanup",()=>$t(i)),m(" normalizeRanks",()=>Rr(i)),m(" assignRankMinMax",()=>vr(i)),m(" removeEdgeLabelProxies",()=>gr(i)),m(" normalize.run",()=>ma(i)),m(" parentDummyChains",()=>G(i)),m(" addBorderSegments",()=>Jt(i)),m(" order",()=>Ut(i,k)),m(" insertSelfEdges",()=>Cr(i)),m(" adjustCoordinateSystem",()=>C(i)),m(" position",()=>Ke(i)),m(" positionSelfEdges",()=>Ea(i)),m(" removeBorderNodes",()=>$r(i)),m(" normalize.undo",()=>sn(i)),m(" fixupEdgeLabelCoords",()=>$e(i)),m(" undoCoordinateSystem",()=>S(i)),m(" translateGraph",()=>fa(i)),m(" assignNodeIntersects",()=>Je(i)),m(" reversePoints",()=>Qr(i)),m(" acyclic.undo",()=>qr(i))}function Le(i,m){i.nodes().forEach(k=>{let R=i.node(k),$=m.node(k);R&&(R.x=$.x,R.y=$.y,R.order=$.order,R.rank=$.rank,m.children(k).length&&(R.width=$.width,R.height=$.height))}),i.edges().forEach(k=>{let R=i.edge(k),$=m.edge(k);R.points=$.points,Object.hasOwn($,"x")&&(R.x=$.x,R.y=$.y)}),i.graph().width=m.graph().width,i.graph().height=m.graph().height}var Re=["nodesep","edgesep","ranksep","marginx","marginy"],Be={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},je=["acyclicer","ranker","rankdir","align","rankalign"],ie=["width","height","rank"],fr={width:0,height:0},Ar=["minlen","weight","width","height","labeloffset"],Lr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ze=["labelpos"];function dr(i){let m=new h({multigraph:!0,compound:!0}),k=aa(i.graph());return m.setGraph(Object.assign({},Be,xa(k,Re),zr(k,je))),i.nodes().forEach(R=>{let $=aa(i.node(R)),et=xa($,ie);Object.keys(fr).forEach(Et=>{et[Et]===void 0&&(et[Et]=fr[Et])}),m.setNode(R,et);let vt=i.parent(R);vt!==void 0&&m.setParent(R,vt)}),i.edges().forEach(R=>{let $=aa(i.edge(R));m.setEdge(R,Object.assign({},Lr,xa($,Ar),zr($,Ze)))}),m}function Xe(i){let m=i.graph();m.ranksep/=2,i.edges().forEach(k=>{let R=i.edge(k);R.minlen*=2,R.labelpos.toLowerCase()!=="c"&&(m.rankdir==="TB"||m.rankdir==="BT"?R.width+=R.labeloffset:R.height+=R.labeloffset)})}function br(i){i.edges().forEach(m=>{let k=i.edge(m);if(k.width&&k.height){let R=i.node(m.v),$={rank:(i.node(m.w).rank-R.rank)/2+R.rank,e:m};Qe(i,"edge-proxy",$,"_ep")}})}function vr(i){let m=0;i.nodes().forEach(k=>{let R=i.node(k);R.borderTop&&(R.minRank=i.node(R.borderTop).rank,R.maxRank=i.node(R.borderBottom).rank,m=Math.max(m,R.maxRank))}),i.graph().maxRank=m}function gr(i){i.nodes().forEach(m=>{let k=i.node(m);if(k.dummy==="edge-proxy"){let R=k;i.edge(R.e).labelRank=k.rank,i.removeNode(m)}})}function fa(i){let m=Number.POSITIVE_INFINITY,k=0,R=Number.POSITIVE_INFINITY,$=0,et=i.graph(),vt=et.marginx||0,Et=et.marginy||0;function Yt(Gt){let he=Gt.x,_e=Gt.y,He=Gt.width,qe=Gt.height;m=Math.min(m,he-He/2),k=Math.max(k,he+He/2),R=Math.min(R,_e-qe/2),$=Math.max($,_e+qe/2)}i.nodes().forEach(Gt=>Yt(i.node(Gt))),i.edges().forEach(Gt=>{let he=i.edge(Gt);Object.hasOwn(he,"x")&&Yt(he)}),m-=vt,R-=Et,i.nodes().forEach(Gt=>{let he=i.node(Gt);he.x-=m,he.y-=R}),i.edges().forEach(Gt=>{let he=i.edge(Gt);he.points.forEach(_e=>{_e.x-=m,_e.y-=R}),Object.hasOwn(he,"x")&&(he.x-=m),Object.hasOwn(he,"y")&&(he.y-=R)}),et.width=k-m+vt,et.height=$-R+Et}function Je(i){i.edges().forEach(m=>{let k=i.edge(m),R=i.node(m.v),$=i.node(m.w),et,vt;k.points?(et=k.points[0],vt=k.points[k.points.length-1]):(k.points=[],et=$,vt=R),k.points.unshift(oa(R,et)),k.points.push(oa($,vt))})}function $e(i){i.edges().forEach(m=>{let k=i.edge(m);if(Object.hasOwn(k,"x"))switch((k.labelpos==="l"||k.labelpos==="r")&&(k.width-=k.labeloffset),k.labelpos){case"l":k.x-=k.width/2+k.labeloffset;break;case"r":k.x+=k.width/2+k.labeloffset;break}})}function Qr(i){i.edges().forEach(m=>{let k=i.edge(m);k.reversed&&k.points.reverse()})}function $r(i){i.nodes().forEach(m=>{if(i.children(m).length){let k=i.node(m),R=i.node(k.borderTop),$=i.node(k.borderBottom),et=i.node(k.borderLeft[k.borderLeft.length-1]),vt=i.node(k.borderRight[k.borderRight.length-1]);k.width=Math.abs(vt.x-et.x),k.height=Math.abs($.y-R.y),k.x=et.x+k.width/2,k.y=R.y+k.height/2}}),i.nodes().forEach(m=>{i.node(m).dummy==="border"&&i.removeNode(m)})}function Ir(i){i.edges().forEach(m=>{if(m.v===m.w){let k=i.node(m.v);k.selfEdges||(k.selfEdges=[]),k.selfEdges.push({e:m,label:i.edge(m)}),i.removeEdge(m)}})}function Cr(i){Sr(i).forEach(m=>{let k=0;m.forEach((R,$)=>{let et=i.node(R);et.order=$+k,(et.selfEdges||[]).forEach(vt=>{Qe(i,"selfedge",{width:vt.label.width,height:vt.label.height,rank:et.rank,order:$+ ++k,e:vt.e,label:vt.label},"_se")}),delete et.selfEdges})})}function Ea(i){i.nodes().forEach(m=>{let k=i.node(m);if(k.dummy==="selfedge"){let R=k,$=i.node(R.e.v),et=$.x+$.width/2,vt=$.y,Et=k.x-et,Yt=$.height/2;i.setEdge(R.e,R.label),i.removeNode(m),R.label.points=[{x:et+2*Et/3,y:vt-Yt},{x:et+5*Et/6,y:vt-Yt},{x:et+Et,y:vt},{x:et+5*Et/6,y:vt+Yt},{x:et+2*Et/3,y:vt+Yt}],R.label.x=k.x,R.label.y=k.y}})}function xa(i,m){return cr(zr(i,m),Number)}function aa(i){let m={};return i&&Object.entries(i).forEach(([k,R])=>{typeof k=="string"&&(k=k.toLowerCase()),m[k]=R}),m}function Gr(i){let m=Sr(i),k=new h({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(R=>{k.setNode(R,{label:R}),k.setParent(R,"layer"+i.node(R).rank)}),i.edges().forEach(R=>k.setEdge(R.v,R.w,{},R.name)),m.forEach((R,$)=>{let et="layer"+$;k.setNode(et,{rank:"same"}),R.reduce((vt,Et)=>(k.setEdge(vt,Et,{style:"invis"}),Et))}),k}var ya={time:ke,notime:ze},Br={graphlib:f,version:sa,layout:le,debug:Gr,util:{time:ke,notime:ze}},pa=Br;return o(M)})();var li=Lg;var Fg=(()=>{var L=Object.defineProperty,j=Object.getOwnPropertyDescriptor,P=Object.getOwnPropertyNames,E=Object.prototype.hasOwnProperty,w=(t,a)=>{for(var c in a)L(t,c,{get:a[c],enumerable:!0})},p=(t,a,c,A)=>{if(a&&typeof a=="object"||typeof a=="function")for(let V of P(a))!E.call(t,V)&&V!==c&&L(t,V,{get:()=>a[V],enumerable:!(A=j(a,V))||A.enumerable});return t},s=t=>p(L({},"__esModule",{value:!0}),t),o={};w(o,{graphlib:()=>d,layout:()=>eg});var d={};w(d,{Graph:()=>Nn,version:()=>Dv});var M=typeof global=="object"&&global&&global.Object===Object&&global,f=M,u=typeof self=="object"&&self&&self.Object===Object&&self,r=f||u||Function("return this")(),h=r,v=h.Symbol,n=v,y=Object.prototype,b=y.hasOwnProperty,T=y.toString,I=n?n.toStringTag:void 0;function F(t){var a=b.call(t,I),c=t[I];try{t[I]=void 0;var A=!0}catch(J){}var V=T.call(t);return A&&(a?t[I]=c:delete t[I]),V}var X=F,K=Object.prototype,ot=K.toString;function pt(t){return ot.call(t)}var xt=pt,ee="[object Null]",N="[object Undefined]",Q=n?n.toStringTag:void 0;function at(t){return t==null?t===void 0?N:ee:Q&&Q in Object(t)?X(t):xt(t)}var _=at;function l(t){return t!=null&&typeof t=="object"}var O=l,z="[object Symbol]";function lt(t){return typeof t=="symbol"||O(t)&&_(t)==z}var W=lt;function gt(t,a){for(var c=-1,A=t==null?0:t.length,V=Array(A);++c<A;)V[c]=a(t[c],c,t);return V}var mt=gt,Tt=Array.isArray,Rt=Tt,It=1/0,te=n?n.prototype:void 0,Qt=te?te.toString:void 0;function pe(t){if(typeof t=="string")return t;if(Rt(t))return mt(t,pe)+"";if(W(t))return Qt?Qt.call(t):"";var a=t+"";return a=="0"&&1/t==-It?"-0":a}var ue=pe,me=/\s/;function Ee(t){for(var a=t.length;a--&&me.test(t.charAt(a)););return a}var xe=Ee,ar=/^\s+/;function xr(t){return t&&t.slice(0,xe(t)+1).replace(ar,"")}var sr=xr;function Qe(t){var a=typeof t;return t!=null&&(a=="object"||a=="function")}var or=Qe,Wr=NaN,oa=/^[-+]0x[0-9a-f]+$/i,Sr=/^0b[01]+$/i,Rr=/^0o[0-7]+$/i,Mr=parseInt;function er(t){if(typeof t=="number")return t;if(W(t))return Wr;if(or(t)){var a=typeof t.valueOf=="function"?t.valueOf():t;t=or(a)?a+"":a}if(typeof t!="string")return t===0?t:+t;t=sr(t);var c=Sr.test(t);return c||Rr.test(t)?Mr(t.slice(2),c?2:8):oa.test(t)?Wr:+t}var Xr=er,Kr=1/0,Ur=17976931348623157e292;function Jr(t){if(!t)return t===0?t:0;if(t=Xr(t),t===Kr||t===-Kr){var a=t<0?-1:1;return a*Ur}return t===t?t:0}var Yr=Jr;function ke(t){var a=Yr(t),c=a%1;return a===a?c?a-c:a:0}var ze=ke;function lr(t){return t}var ir=lr,ur="[object AsyncFunction]",zr="[object Function]",cr="[object GeneratorFunction]",Nr="[object Proxy]";function Fr(t){if(!or(t))return!1;var a=_(t);return a==zr||a==cr||a==ur||a==Nr}var sa=Fr,yr=h["__core-js_shared__"],kr=yr,pr=(function(){var t=/[^.]+$/.exec(kr&&kr.keys&&kr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function rr(t){return!!pr&&pr in t}var Pr=rr,ta=Function.prototype,wr=ta.toString;function Sa(t){if(t!=null){try{return wr.call(t)}catch(a){}try{return t+""}catch(a){}}return""}var ca=Sa,ba=/[\\^$.*+?()[\]{}|]/g,ra=/^\[object .+?Constructor\]$/,Dr=Function.prototype,la=Object.prototype,qr=Dr.toString,ma=la.hasOwnProperty,Ja=RegExp("^"+qr.call(ma).replace(ba,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sn(t){if(!or(t)||Pr(t))return!1;var a=sa(t)?Ja:ra;return a.test(ca(t))}var fn=sn;function Na(t,a){return t==null?void 0:t[a]}var Cn=Na;function Mn(t,a){var c=Cn(t,a);return fn(c)?c:void 0}var nn=Mn,An=nn(h,"WeakMap"),dn=An,Ln=Object.create,Fn=(function(){function t(){}return function(a){if(!or(a))return{};if(Ln)return Ln(a);t.prototype=a;var c=new t;return t.prototype=void 0,c}})(),g=Fn;function tt(t,a,c){switch(c.length){case 0:return t.call(a);case 1:return t.call(a,c[0]);case 2:return t.call(a,c[0],c[1]);case 3:return t.call(a,c[0],c[1],c[2])}return t.apply(a,c)}var B=tt;function Z(){}var H=Z;function yt(t,a){var c=-1,A=t.length;for(a||(a=Array(A));++c<A;)a[c]=t[c];return a}var ut=yt,ht=800,bt=16,Nt=Date.now;function Dt(t){var a=0,c=0;return function(){var A=Nt(),V=bt-(A-c);if(c=A,V>0){if(++a>=ht)return arguments[0]}else a=0;return t.apply(void 0,arguments)}}var st=Dt;function Lt(t){return function(){return t}}var ft=Lt,Ct=(function(){try{var t=nn(Object,"defineProperty");return t({},"",{}),t}catch(a){}})(),Xt=Ct,St=Xt?function(t,a){return Xt(t,"toString",{configurable:!0,enumerable:!1,value:ft(a),writable:!0})}:ir,Zt=St,G=st(Zt),dt=G;function oe(t,a){for(var c=-1,A=t==null?0:t.length;++c<A&&a(t[c],c,t)!==!1;);return t}var ae=oe;function fe(t,a,c,A){for(var V=t.length,J=c+(A?1:-1);A?J--:++J<V;)if(a(t[J],J,t))return J;return-1}var ne=fe;function ye(t){return t!==t}var Mt=ye;function $t(t,a,c){for(var A=c-1,V=t.length;++A<V;)if(t[A]===a)return A;return-1}var Jt=$t;function e(t,a,c){return a===a?Jt(t,a,c):ne(t,Mt,c)}var x=e;function C(t,a){var c=t==null?0:t.length;return!!c&&x(t,a,0)>-1}var S=C,Y=9007199254740991,D=/^(?:0|[1-9]\d*)$/;function At(t,a){var c=typeof t;return a=a!=null?a:Y,!!a&&(c=="number"||c!="symbol"&&D.test(t))&&t>-1&&t%1==0&&t<a}var U=At;function q(t,a,c){a=="__proto__"&&Xt?Xt(t,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):t[a]=c}var rt=q;function ct(t,a){return t===a||t!==t&&a!==a}var nt=ct,zt=Object.prototype,Ot=zt.hasOwnProperty;function Ft(t,a,c){var A=t[a];(!(Ot.call(t,a)&&nt(A,c))||c===void 0&&!(a in t))&&rt(t,a,c)}var Pt=Ft;function Wt(t,a,c,A){var V=!c;c||(c={});for(var J=-1,it=a.length;++J<it;){var _t=a[J],Vt=A?A(c[_t],t[_t],_t,c,t):void 0;Vt===void 0&&(Vt=t[_t]),V?rt(c,_t,Vt):Pt(c,_t,Vt)}return c}var Kt=Wt,Bt=Math.max;function ce(t,a,c){return a=Bt(a===void 0?t.length-1:a,0),function(){for(var A=arguments,V=-1,J=Bt(A.length-a,0),it=Array(J);++V<J;)it[V]=A[a+V];V=-1;for(var _t=Array(a+1);++V<a;)_t[V]=A[V];return _t[a]=c(it),B(t,this,_t)}}var kt=ce;function wt(t,a){return dt(kt(t,a,ir),t+"")}var jt=wt,Ht=9007199254740991;function qt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ht}var re=qt;function Ut(t){return t!=null&&re(t.length)&&!sa(t)}var ve=Ut;function we(t,a,c){if(!or(c))return!1;var A=typeof a;return(A=="number"?ve(c)&&U(a,c.length):A=="string"&&a in c)?nt(c[a],t):!1}var Se=we;function be(t){return jt(function(a,c){var A=-1,V=c.length,J=V>1?c[V-1]:void 0,it=V>2?c[2]:void 0;for(J=t.length>3&&typeof J=="function"?(V--,J):void 0,it&&Se(c[0],c[1],it)&&(J=V<3?void 0:J,V=1),a=Object(a);++A<V;){var _t=c[A];_t&&t(a,_t,A,J)}return a})}var Me=be,Fe=Object.prototype;function Ue(t){var a=t&&t.constructor,c=typeof a=="function"&&a.prototype||Fe;return t===c}var De=Ue;function Ye(t,a){for(var c=-1,A=Array(t);++c<t;)A[c]=a(c);return A}var Pe=Ye,de="[object Arguments]";function Ve(t){return O(t)&&_(t)==de}var Ne=Ve,nr=Object.prototype,Ge=nr.hasOwnProperty,Ie=nr.propertyIsEnumerable,Ce=Ne((function(){return arguments})())?Ne:function(t){return O(t)&&Ge.call(t,"callee")&&!Ie.call(t,"callee")},Ke=Ce;function We(){return!1}var le=We,Ae=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Le=Ae&&typeof module=="object"&&module&&!module.nodeType&&module,Re=Le&&Le.exports===Ae,Be=Re?h.Buffer:void 0,je=Be?Be.isBuffer:void 0,ie=je||le,fr=ie,Ar="[object Arguments]",Lr="[object Array]",Ze="[object Boolean]",dr="[object Date]",Xe="[object Error]",br="[object Function]",vr="[object Map]",gr="[object Number]",fa="[object Object]",Je="[object RegExp]",$e="[object Set]",Qr="[object String]",$r="[object WeakMap]",Ir="[object ArrayBuffer]",Cr="[object DataView]",Ea="[object Float32Array]",xa="[object Float64Array]",aa="[object Int8Array]",Gr="[object Int16Array]",ya="[object Int32Array]",Br="[object Uint8Array]",pa="[object Uint8ClampedArray]",i="[object Uint16Array]",m="[object Uint32Array]",k={};k[Ea]=k[xa]=k[aa]=k[Gr]=k[ya]=k[Br]=k[pa]=k[i]=k[m]=!0,k[Ar]=k[Lr]=k[Ir]=k[Ze]=k[Cr]=k[dr]=k[Xe]=k[br]=k[vr]=k[gr]=k[fa]=k[Je]=k[$e]=k[Qr]=k[$r]=!1;function R(t){return O(t)&&re(t.length)&&!!k[_(t)]}var $=R;function et(t){return function(a){return t(a)}}var vt=et,Et=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yt=Et&&typeof module=="object"&&module&&!module.nodeType&&module,Gt=Yt&&Yt.exports===Et,he=Gt&&f.process,_e=(function(){try{var t=Yt&&Yt.require&&Yt.require("util").types;return t||he&&he.binding&&he.binding("util")}catch(a){}})(),He=_e,qe=He&&He.isTypedArray,Er=qe?vt(qe):$,Tr=Er,Vr=Object.prototype,Zr=Vr.hasOwnProperty;function ua(t,a){var c=Rt(t),A=!c&&Ke(t),V=!c&&!A&&fr(t),J=!c&&!A&&!V&&Tr(t),it=c||A||V||J,_t=it?Pe(t.length,String):[],Vt=_t.length;for(var se in t)(a||Zr.call(t,se))&&!(it&&(se=="length"||V&&(se=="offset"||se=="parent")||J&&(se=="buffer"||se=="byteLength"||se=="byteOffset")||U(se,Vt)))&&_t.push(se);return _t}var Aa=ua;function La(t,a){return function(c){return t(a(c))}}var Fa=La,$a=Fa(Object.keys,Object),_r=$a,wa=Object.prototype,mr=wa.hasOwnProperty;function tr(t){if(!De(t))return _r(t);var a=[];for(var c in Object(t))mr.call(t,c)&&c!="constructor"&&a.push(c);return a}var jr=tr;function va(t){return ve(t)?Aa(t):jr(t)}var na=va;function da(t){var a=[];if(t!=null)for(var c in Object(t))a.push(c);return a}var Ia=da,Ma=Object.prototype,ln=Ma.hasOwnProperty;function hn(t){if(!or(t))return Ia(t);var a=De(t),c=[];for(var A in t)A=="constructor"&&(a||!ln.call(t,A))||c.push(A);return c}var Ra=hn;function wn(t){return ve(t)?Aa(t,!0):Ra(t)}var tn=wn,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gn=/^\w*$/;function un(t,a){if(Rt(t))return!1;var c=typeof t;return c=="number"||c=="symbol"||c=="boolean"||t==null||W(t)?!0:gn.test(t)||!yn.test(t)||a!=null&&t in Object(a)}var za=un,bn=nn(Object,"create"),ja=bn;function vn(){this.__data__=ja?ja(null):{},this.size=0}var Pa=vn;function Ba(t){var a=this.has(t)&&delete this.__data__[t];return this.size-=a?1:0,a}var en=Ba,Da="__lodash_hash_undefined__",xn=Object.prototype,Va=xn.hasOwnProperty;function ea(t){var a=this.__data__;if(ja){var c=a[t];return c===Da?void 0:c}return Va.call(a,t)?a[t]:void 0}var ka=ea,_a=Object.prototype,ga=_a.hasOwnProperty;function Xa(t){var a=this.__data__;return ja?a[t]!==void 0:ga.call(a,t)}var rn=Xa,cn="__lodash_hash_undefined__";function ia(t,a){var c=this.__data__;return this.size+=this.has(t)?0:1,c[t]=ja&&a===void 0?cn:a,this}var Ga=ia;function ha(t){var a=-1,c=t==null?0:t.length;for(this.clear();++a<c;){var A=t[a];this.set(A[0],A[1])}}ha.prototype.clear=Pa,ha.prototype.delete=en,ha.prototype.get=ka,ha.prototype.has=rn,ha.prototype.set=Ga;var on=ha;function Ta(){this.__data__=[],this.size=0}var Ha=Ta;function qa(t,a){for(var c=t.length;c--;)if(nt(t[c][0],a))return c;return-1}var Za=qa,_n=Array.prototype,an=_n.splice;function Ka(t){var a=this.__data__,c=Za(a,t);if(c<0)return!1;var A=a.length-1;return c==A?a.pop():an.call(a,c,1),--this.size,!0}var En=Ka;function Dn(t){var a=this.__data__,c=Za(a,t);return c<0?void 0:a[c][1]}var Tn=Dn;function On(t){return Za(this.__data__,t)>-1}var Ji=On;function ci(t,a){var c=this.__data__,A=Za(c,t);return A<0?(++this.size,c.push([t,a])):c[A][1]=a,this}var Ci=ci;function Rn(t){var a=-1,c=t==null?0:t.length;for(this.clear();++a<c;){var A=t[a];this.set(A[0],A[1])}}Rn.prototype.clear=Ha,Rn.prototype.delete=En,Rn.prototype.get=Tn,Rn.prototype.has=Ji,Rn.prototype.set=Ci;var Qn=Rn,to=nn(h,"Map"),jn=to;function Ei(){this.size=0,this.__data__={hash:new on,map:new(jn||Qn),string:new on}}var fi=Ei;function Mi(t){var a=typeof t;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?t!=="__proto__":t===null}var eo=Mi;function Jn(t,a){var c=t.__data__;return eo(a)?c[typeof a=="string"?"string":"hash"]:c.map}var Pn=Jn;function ui(t){var a=Pn(this,t).delete(t);return this.size-=a?1:0,a}var _i=ui;function ro(t){return Pn(this,t).get(t)}var ao=ro;function Ti(t){return Pn(this,t).has(t)}var no=Ti;function io(t,a){var c=Pn(this,t),A=c.size;return c.set(t,a),this.size+=c.size==A?0:1,this}var Si=io;function zn(t){var a=-1,c=t==null?0:t.length;for(this.clear();++a<c;){var A=t[a];this.set(A[0],A[1])}}zn.prototype.clear=fi,zn.prototype.delete=_i,zn.prototype.get=ao,zn.prototype.has=no,zn.prototype.set=Si;var Yn=zn,vi="Expected a function";function ti(t,a){if(typeof t!="function"||a!=null&&typeof a!="function")throw new TypeError(vi);var c=function(){var A=arguments,V=a?a.apply(this,A):A[0],J=c.cache;if(J.has(V))return J.get(V);var it=t.apply(this,A);return c.cache=J.set(V,it)||J,it};return c.cache=new(ti.Cache||Yn),c}ti.Cache=Yn;var Ai=ti,Li=500;function Fi(t){var a=Ai(t,function(A){return c.size===Li&&c.clear(),A}),c=a.cache;return a}var Ni=Fi,Ii=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,di=/\\(\\)?/g,gh=Ni(function(t){var a=[];return t.charCodeAt(0)===46&&a.push(""),t.replace(Ii,function(c,A,V,J){a.push(V?J.replace(di,"$1"):A||c)}),a}),ph=gh;function mh(t){return t==null?"":ue(t)}var Es=mh;function yh(t,a){return Rt(t)?t:za(t,a)?[t]:ph(Es(t))}var Pi=yh,wh=1/0;function bh(t){if(typeof t=="string"||W(t))return t;var a=t+"";return a=="0"&&1/t==-wh?"-0":a}var gi=bh;function xh(t,a){a=Pi(a,t);for(var c=0,A=a.length;t!=null&&c<A;)t=t[gi(a[c++])];return c&&c==A?t:void 0}var Di=xh;function kh(t,a,c){var A=t==null?void 0:Di(t,a);return A===void 0?c:A}var Ch=kh;function Eh(t,a){for(var c=-1,A=a.length,V=t.length;++c<A;)t[V+c]=a[c];return t}var oo=Eh,Ms=n?n.isConcatSpreadable:void 0;function Mh(t){return Rt(t)||Ke(t)||!!(Ms&&t&&t[Ms])}var _h=Mh;function _s(t,a,c,A,V){var J=-1,it=t.length;for(c||(c=_h),V||(V=[]);++J<it;){var _t=t[J];a>0&&c(_t)?a>1?_s(_t,a-1,c,A,V):oo(V,_t):A||(V[V.length]=_t)}return V}var so=_s;function Th(t){var a=t==null?0:t.length;return a?so(t,1):[]}var ei=Th;function Sh(t){return dt(kt(t,void 0,ei),t+"")}var Ah=Sh,Lh=Fa(Object.getPrototypeOf,Object),lo=Lh,Fh="[object Object]",Nh=Function.prototype,Ih=Object.prototype,Ts=Nh.toString,Ph=Ih.hasOwnProperty,Dh=Ts.call(Object);function Oh(t){if(!O(t)||_(t)!=Fh)return!1;var a=lo(t);if(a===null)return!0;var c=Ph.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&Ts.call(c)==Dh}var Rh=Oh,zh="\\ud800-\\udfff",Bh="\\u0300-\\u036f",Hh="\\ufe20-\\ufe2f",Wh="\\u20d0-\\u20ff",Uh=Bh+Hh+Wh,Yh="\\ufe0e\\ufe0f",Vh="\\u200d",jh=RegExp("["+Vh+zh+Uh+Yh+"]");function Xh(t){return jh.test(t)}var qh=Xh;function $h(t,a,c,A){var V=-1,J=t==null?0:t.length;for(A&&J&&(c=t[++V]);++V<J;)c=a(c,t[V],V,t);return c}var Gh=$h;function Zh(){this.__data__=new Qn,this.size=0}var Kh=Zh;function Qh(t){var a=this.__data__,c=a.delete(t);return this.size=a.size,c}var Jh=Qh;function tc(t){return this.__data__.get(t)}var ec=tc;function rc(t){return this.__data__.has(t)}var ac=rc,nc=200;function ic(t,a){var c=this.__data__;if(c instanceof Qn){var A=c.__data__;if(!jn||A.length<nc-1)return A.push([t,a]),this.size=++c.size,this;c=this.__data__=new Yn(A)}return c.set(t,a),this.size=c.size,this}var oc=ic;function ri(t){var a=this.__data__=new Qn(t);this.size=a.size}ri.prototype.clear=Kh,ri.prototype.delete=Jh,ri.prototype.get=ec,ri.prototype.has=ac,ri.prototype.set=oc;var ai=ri;function sc(t,a){return t&&Kt(a,na(a),t)}var lc=sc;function hc(t,a){return t&&Kt(a,tn(a),t)}var cc=hc,Ss=typeof exports=="object"&&exports&&!exports.nodeType&&exports,As=Ss&&typeof module=="object"&&module&&!module.nodeType&&module,fc=As&&As.exports===Ss,Ls=fc?h.Buffer:void 0,Fs=Ls?Ls.allocUnsafe:void 0;function uc(t,a){if(a)return t.slice();var c=t.length,A=Fs?Fs(c):new t.constructor(c);return t.copy(A),A}var Ns=uc;function vc(t,a){for(var c=-1,A=t==null?0:t.length,V=0,J=[];++c<A;){var it=t[c];a(it,c,t)&&(J[V++]=it)}return J}var Is=vc;function dc(){return[]}var Ps=dc,gc=Object.prototype,pc=gc.propertyIsEnumerable,Ds=Object.getOwnPropertySymbols,mc=Ds?function(t){return t==null?[]:(t=Object(t),Is(Ds(t),function(a){return pc.call(t,a)}))}:Ps,ho=mc;function yc(t,a){return Kt(t,ho(t),a)}var wc=yc,bc=Object.getOwnPropertySymbols,xc=bc?function(t){for(var a=[];t;)oo(a,ho(t)),t=lo(t);return a}:Ps,Os=xc;function kc(t,a){return Kt(t,Os(t),a)}var Cc=kc;function Ec(t,a,c){var A=a(t);return Rt(t)?A:oo(A,c(t))}var Rs=Ec;function Mc(t){return Rs(t,na,ho)}var co=Mc;function _c(t){return Rs(t,tn,Os)}var Tc=_c,Sc=nn(h,"DataView"),fo=Sc,Ac=nn(h,"Promise"),uo=Ac,Lc=nn(h,"Set"),ni=Lc,zs="[object Map]",Fc="[object Object]",Bs="[object Promise]",Hs="[object Set]",Ws="[object WeakMap]",Us="[object DataView]",Nc=ca(fo),Ic=ca(jn),Pc=ca(uo),Dc=ca(ni),Oc=ca(dn),Xn=_;(fo&&Xn(new fo(new ArrayBuffer(1)))!=Us||jn&&Xn(new jn)!=zs||uo&&Xn(uo.resolve())!=Bs||ni&&Xn(new ni)!=Hs||dn&&Xn(new dn)!=Ws)&&(Xn=function(t){var a=_(t),c=a==Fc?t.constructor:void 0,A=c?ca(c):"";if(A)switch(A){case Nc:return Us;case Ic:return zs;case Pc:return Bs;case Dc:return Hs;case Oc:return Ws}return a});var qn=Xn,Rc=Object.prototype,zc=Rc.hasOwnProperty;function Bc(t){var a=t.length,c=new t.constructor(a);return a&&typeof t[0]=="string"&&zc.call(t,"index")&&(c.index=t.index,c.input=t.input),c}var Hc=Bc,Wc=h.Uint8Array,Oi=Wc;function Uc(t){var a=new t.constructor(t.byteLength);return new Oi(a).set(new Oi(t)),a}var vo=Uc;function Yc(t,a){var c=a?vo(t.buffer):t.buffer;return new t.constructor(c,t.byteOffset,t.byteLength)}var Vc=Yc,jc=/\w*$/;function Xc(t){var a=new t.constructor(t.source,jc.exec(t));return a.lastIndex=t.lastIndex,a}var qc=Xc,Ys=n?n.prototype:void 0,Vs=Ys?Ys.valueOf:void 0;function $c(t){return Vs?Object(Vs.call(t)):{}}var Gc=$c;function Zc(t,a){var c=a?vo(t.buffer):t.buffer;return new t.constructor(c,t.byteOffset,t.length)}var js=Zc,Kc="[object Boolean]",Qc="[object Date]",Jc="[object Map]",t0="[object Number]",e0="[object RegExp]",r0="[object Set]",a0="[object String]",n0="[object Symbol]",i0="[object ArrayBuffer]",o0="[object DataView]",s0="[object Float32Array]",l0="[object Float64Array]",h0="[object Int8Array]",c0="[object Int16Array]",f0="[object Int32Array]",u0="[object Uint8Array]",v0="[object Uint8ClampedArray]",d0="[object Uint16Array]",g0="[object Uint32Array]";function p0(t,a,c){var A=t.constructor;switch(a){case i0:return vo(t);case Kc:case Qc:return new A(+t);case o0:return Vc(t,c);case s0:case l0:case h0:case c0:case f0:case u0:case v0:case d0:case g0:return js(t,c);case Jc:return new A;case t0:case a0:return new A(t);case e0:return qc(t);case r0:return new A;case n0:return Gc(t)}}var m0=p0;function y0(t){return typeof t.constructor=="function"&&!De(t)?g(lo(t)):{}}var Xs=y0,w0="[object Map]";function b0(t){return O(t)&&qn(t)==w0}var x0=b0,qs=He&&He.isMap,k0=qs?vt(qs):x0,C0=k0,E0="[object Set]";function M0(t){return O(t)&&qn(t)==E0}var _0=M0,$s=He&&He.isSet,T0=$s?vt($s):_0,S0=T0,A0=1,L0=2,F0=4,Gs="[object Arguments]",N0="[object Array]",I0="[object Boolean]",P0="[object Date]",D0="[object Error]",Zs="[object Function]",O0="[object GeneratorFunction]",R0="[object Map]",z0="[object Number]",Ks="[object Object]",B0="[object RegExp]",H0="[object Set]",W0="[object String]",U0="[object Symbol]",Y0="[object WeakMap]",V0="[object ArrayBuffer]",j0="[object DataView]",X0="[object Float32Array]",q0="[object Float64Array]",$0="[object Int8Array]",G0="[object Int16Array]",Z0="[object Int32Array]",K0="[object Uint8Array]",Q0="[object Uint8ClampedArray]",J0="[object Uint16Array]",tf="[object Uint32Array]",Wa={};Wa[Gs]=Wa[N0]=Wa[V0]=Wa[j0]=Wa[I0]=Wa[P0]=Wa[X0]=Wa[q0]=Wa[$0]=Wa[G0]=Wa[Z0]=Wa[R0]=Wa[z0]=Wa[Ks]=Wa[B0]=Wa[H0]=Wa[W0]=Wa[U0]=Wa[K0]=Wa[Q0]=Wa[J0]=Wa[tf]=!0,Wa[D0]=Wa[Zs]=Wa[Y0]=!1;function Ri(t,a,c,A,V,J){var it,_t=a&A0,Vt=a&L0,se=a&F0;if(c&&(it=V?c(t,A,V,J):c(t)),it!==void 0)return it;if(!or(t))return t;var ge=Rt(t);if(ge){if(it=Hc(t),!_t)return ut(t,it)}else{var Oe=qn(t),hr=Oe==Zs||Oe==O0;if(fr(t))return Ns(t,_t);if(Oe==Ks||Oe==Gs||hr&&!V){if(it=Vt||hr?{}:Xs(t),!_t)return Vt?Cc(t,cc(it,t)):wc(t,lc(it,t))}else{if(!Wa[Oe])return V?t:{};it=m0(t,Oe,_t)}}J||(J=new ai);var Hr=J.get(t);if(Hr)return Hr;J.set(t,it),S0(t)?t.forEach(function(Qa){it.add(Ri(Qa,a,c,Qa,t,J))}):C0(t)&&t.forEach(function(Qa,mn){it.set(mn,Ri(Qa,a,c,mn,t,J))});var Or=se?Vt?Tc:co:Vt?tn:na,Ca=ge?void 0:Or(t);return ae(Ca||t,function(Qa,mn){Ca&&(mn=Qa,Qa=t[mn]),Pt(it,mn,Ri(Qa,a,c,mn,t,J))}),it}var ef=Ri,rf=1,af=4;function nf(t){return ef(t,rf|af)}var of=nf,sf="__lodash_hash_undefined__";function lf(t){return this.__data__.set(t,sf),this}var hf=lf;function cf(t){return this.__data__.has(t)}var ff=cf;function zi(t){var a=-1,c=t==null?0:t.length;for(this.__data__=new Yn;++a<c;)this.add(t[a])}zi.prototype.add=zi.prototype.push=hf,zi.prototype.has=ff;var Qs=zi;function uf(t,a){for(var c=-1,A=t==null?0:t.length;++c<A;)if(a(t[c],c,t))return!0;return!1}var vf=uf;function df(t,a){return t.has(a)}var Js=df,gf=1,pf=2;function mf(t,a,c,A,V,J){var it=c&gf,_t=t.length,Vt=a.length;if(_t!=Vt&&!(it&&Vt>_t))return!1;var se=J.get(t),ge=J.get(a);if(se&&ge)return se==a&&ge==t;var Oe=-1,hr=!0,Hr=c&pf?new Qs:void 0;for(J.set(t,a),J.set(a,t);++Oe<_t;){var Or=t[Oe],Ca=a[Oe];if(A)var Qa=it?A(Ca,Or,Oe,a,t,J):A(Or,Ca,Oe,t,a,J);if(Qa!==void 0){if(Qa)continue;hr=!1;break}if(Hr){if(!vf(a,function(mn,Kn){if(!Js(Hr,Kn)&&(Or===mn||V(Or,mn,c,A,J)))return Hr.push(Kn)})){hr=!1;break}}else if(!(Or===Ca||V(Or,Ca,c,A,J))){hr=!1;break}}return J.delete(t),J.delete(a),hr}var tl=mf;function yf(t){var a=-1,c=Array(t.size);return t.forEach(function(A,V){c[++a]=[V,A]}),c}var wf=yf;function bf(t){var a=-1,c=Array(t.size);return t.forEach(function(A){c[++a]=A}),c}var go=bf,xf=1,kf=2,Cf="[object Boolean]",Ef="[object Date]",Mf="[object Error]",_f="[object Map]",Tf="[object Number]",Sf="[object RegExp]",Af="[object Set]",Lf="[object String]",Ff="[object Symbol]",Nf="[object ArrayBuffer]",If="[object DataView]",el=n?n.prototype:void 0,po=el?el.valueOf:void 0;function Pf(t,a,c,A,V,J,it){switch(c){case If:if(t.byteLength!=a.byteLength||t.byteOffset!=a.byteOffset)return!1;t=t.buffer,a=a.buffer;case Nf:return!(t.byteLength!=a.byteLength||!J(new Oi(t),new Oi(a)));case Cf:case Ef:case Tf:return nt(+t,+a);case Mf:return t.name==a.name&&t.message==a.message;case Sf:case Lf:return t==a+"";case _f:var _t=wf;case Af:var Vt=A&xf;if(_t||(_t=go),t.size!=a.size&&!Vt)return!1;var se=it.get(t);if(se)return se==a;A|=kf,it.set(t,a);var ge=tl(_t(t),_t(a),A,V,J,it);return it.delete(t),ge;case Ff:if(po)return po.call(t)==po.call(a)}return!1}var Df=Pf,Of=1,Rf=Object.prototype,zf=Rf.hasOwnProperty;function Bf(t,a,c,A,V,J){var it=c&Of,_t=co(t),Vt=_t.length,se=co(a),ge=se.length;if(Vt!=ge&&!it)return!1;for(var Oe=Vt;Oe--;){var hr=_t[Oe];if(!(it?hr in a:zf.call(a,hr)))return!1}var Hr=J.get(t),Or=J.get(a);if(Hr&&Or)return Hr==a&&Or==t;var Ca=!0;J.set(t,a),J.set(a,t);for(var Qa=it;++Oe<Vt;){hr=_t[Oe];var mn=t[hr],Kn=a[hr];if(A)var th=it?A(Kn,mn,hr,a,t,J):A(mn,Kn,hr,t,a,J);if(!(th===void 0?mn===Kn||V(mn,Kn,c,A,J):th)){Ca=!1;break}Qa||(Qa=hr=="constructor")}if(Ca&&!Qa){var Xi=t.constructor,qi=a.constructor;Xi!=qi&&"constructor"in t&&"constructor"in a&&!(typeof Xi=="function"&&Xi instanceof Xi&&typeof qi=="function"&&qi instanceof qi)&&(Ca=!1)}return J.delete(t),J.delete(a),Ca}var Hf=Bf,Wf=1,rl="[object Arguments]",al="[object Array]",Bi="[object Object]",Uf=Object.prototype,nl=Uf.hasOwnProperty;function Yf(t,a,c,A,V,J){var it=Rt(t),_t=Rt(a),Vt=it?al:qn(t),se=_t?al:qn(a);Vt=Vt==rl?Bi:Vt,se=se==rl?Bi:se;var ge=Vt==Bi,Oe=se==Bi,hr=Vt==se;if(hr&&fr(t)){if(!fr(a))return!1;it=!0,ge=!1}if(hr&&!ge)return J||(J=new ai),it||Tr(t)?tl(t,a,c,A,V,J):Df(t,a,Vt,c,A,V,J);if(!(c&Wf)){var Hr=ge&&nl.call(t,"__wrapped__"),Or=Oe&&nl.call(a,"__wrapped__");if(Hr||Or){var Ca=Hr?t.value():t,Qa=Or?a.value():a;return J||(J=new ai),V(Ca,Qa,c,A,J)}}return hr?(J||(J=new ai),Hf(t,a,c,A,V,J)):!1}var Vf=Yf;function il(t,a,c,A,V){return t===a?!0:t==null||a==null||!O(t)&&!O(a)?t!==t&&a!==a:Vf(t,a,c,A,il,V)}var ol=il,jf=1,Xf=2;function qf(t,a,c,A){var V=c.length,J=V,it=!A;if(t==null)return!J;for(t=Object(t);V--;){var _t=c[V];if(it&&_t[2]?_t[1]!==t[_t[0]]:!(_t[0]in t))return!1}for(;++V<J;){_t=c[V];var Vt=_t[0],se=t[Vt],ge=_t[1];if(it&&_t[2]){if(se===void 0&&!(Vt in t))return!1}else{var Oe=new ai;if(A)var hr=A(se,ge,Vt,t,a,Oe);if(!(hr===void 0?ol(ge,se,jf|Xf,A,Oe):hr))return!1}}return!0}var $f=qf;function Gf(t){return t===t&&!or(t)}var sl=Gf;function Zf(t){for(var a=na(t),c=a.length;c--;){var A=a[c],V=t[A];a[c]=[A,V,sl(V)]}return a}var Kf=Zf;function Qf(t,a){return function(c){return c==null?!1:c[t]===a&&(a!==void 0||t in Object(c))}}var ll=Qf;function Jf(t){var a=Kf(t);return a.length==1&&a[0][2]?ll(a[0][0],a[0][1]):function(c){return c===t||$f(c,t,a)}}var t1=Jf;function e1(t,a){return t!=null&&a in Object(t)}var r1=e1;function a1(t,a,c){a=Pi(a,t);for(var A=-1,V=a.length,J=!1;++A<V;){var it=gi(a[A]);if(!(J=t!=null&&c(t,it)))break;t=t[it]}return J||++A!=V?J:(V=t==null?0:t.length,!!V&&re(V)&&U(it,V)&&(Rt(t)||Ke(t)))}var hl=a1;function n1(t,a){return t!=null&&hl(t,a,r1)}var cl=n1,i1=1,o1=2;function s1(t,a){return za(t)&&sl(a)?ll(gi(t),a):function(c){var A=Ch(c,t);return A===void 0&&A===a?cl(c,t):ol(a,A,i1|o1)}}var l1=s1;function h1(t){return function(a){return a==null?void 0:a[t]}}var fl=h1;function c1(t){return function(a){return Di(a,t)}}var f1=c1;function u1(t){return za(t)?fl(gi(t)):f1(t)}var v1=u1;function d1(t){return typeof t=="function"?t:t==null?ir:typeof t=="object"?Rt(t)?l1(t[0],t[1]):t1(t):v1(t)}var Vn=d1;function g1(t){return function(a,c,A){for(var V=-1,J=Object(a),it=A(a),_t=it.length;_t--;){var Vt=it[t?_t:++V];if(c(J[Vt],Vt,J)===!1)break}return a}}var p1=g1,m1=p1(),mo=m1;function y1(t,a){return t&&mo(t,a,na)}var yo=y1;function w1(t,a){return function(c,A){if(c==null)return c;if(!ve(c))return t(c,A);for(var V=c.length,J=a?V:-1,it=Object(c);(a?J--:++J<V)&&A(it[J],J,it)!==!1;);return c}}var b1=w1,x1=b1(yo),Hi=x1,k1=function(){return h.Date.now()},ul=k1,vl=Object.prototype,C1=vl.hasOwnProperty,E1=jt(function(t,a){t=Object(t);var c=-1,A=a.length,V=A>2?a[2]:void 0;for(V&&Se(a[0],a[1],V)&&(A=1);++c<A;)for(var J=a[c],it=tn(J),_t=-1,Vt=it.length;++_t<Vt;){var se=it[_t],ge=t[se];(ge===void 0||nt(ge,vl[se])&&!C1.call(t,se))&&(t[se]=J[se])}return t}),M1=E1;function _1(t,a,c){(c!==void 0&&!nt(t[a],c)||c===void 0&&!(a in t))&&rt(t,a,c)}var wo=_1;function T1(t){return O(t)&&ve(t)}var dl=T1;function S1(t,a){if(!(a==="constructor"&&typeof t[a]=="function")&&a!="__proto__")return t[a]}var bo=S1;function A1(t){return Kt(t,tn(t))}var L1=A1;function F1(t,a,c,A,V,J,it){var _t=bo(t,c),Vt=bo(a,c),se=it.get(Vt);if(se){wo(t,c,se);return}var ge=J?J(_t,Vt,c+"",t,a,it):void 0,Oe=ge===void 0;if(Oe){var hr=Rt(Vt),Hr=!hr&&fr(Vt),Or=!hr&&!Hr&&Tr(Vt);ge=Vt,hr||Hr||Or?Rt(_t)?ge=_t:dl(_t)?ge=ut(_t):Hr?(Oe=!1,ge=Ns(Vt,!0)):Or?(Oe=!1,ge=js(Vt,!0)):ge=[]:Rh(Vt)||Ke(Vt)?(ge=_t,Ke(_t)?ge=L1(_t):(!or(_t)||sa(_t))&&(ge=Xs(Vt))):Oe=!1}Oe&&(it.set(Vt,ge),V(ge,Vt,A,J,it),it.delete(Vt)),wo(t,c,ge)}var N1=F1;function gl(t,a,c,A,V){t!==a&&mo(a,function(J,it){if(V||(V=new ai),or(J))N1(t,a,it,c,gl,A,V);else{var _t=A?A(bo(t,it),J,it+"",t,a,V):void 0;_t===void 0&&(_t=J),wo(t,it,_t)}},tn)}var I1=gl;function P1(t,a,c){for(var A=-1,V=t==null?0:t.length;++A<V;)if(c(a,t[A]))return!0;return!1}var D1=P1;function O1(t){var a=t==null?0:t.length;return a?t[a-1]:void 0}var Wi=O1;function R1(t){return typeof t=="function"?t:ir}var xo=R1;function z1(t,a){var c=Rt(t)?ae:Hi;return c(t,xo(a))}var Te=z1;function B1(t,a){var c=[];return Hi(t,function(A,V,J){a(A,V,J)&&c.push(A)}),c}var H1=B1;function W1(t,a){var c=Rt(t)?Is:H1;return c(t,Vn(a,3))}var Bn=W1;function U1(t){return function(a,c,A){var V=Object(a);if(!ve(a)){var J=Vn(c,3);a=na(a),c=function(_t){return J(V[_t],_t,V)}}var it=t(a,c,A);return it>-1?V[J?a[it]:it]:void 0}}var Y1=U1,V1=Math.max;function j1(t,a,c){var A=t==null?0:t.length;if(!A)return-1;var V=c==null?0:ze(c);return V<0&&(V=V1(A+V,0)),ne(t,Vn(a,3),V)}var X1=j1,q1=Y1(X1),ko=q1;function $1(t,a){var c=-1,A=ve(t)?Array(t.length):[];return Hi(t,function(V,J,it){A[++c]=a(V,J,it)}),A}var pl=$1;function G1(t,a){var c=Rt(t)?mt:pl;return c(t,Vn(a,3))}var pn=G1;function Z1(t,a){return t==null?t:mo(t,xo(a),tn)}var K1=Z1;function Q1(t,a){return t&&yo(t,xo(a))}var J1=Q1;function tu(t,a){return t>a}var eu=tu,ru=Object.prototype,au=ru.hasOwnProperty;function nu(t,a){return t!=null&&au.call(t,a)}var iu=nu;function ou(t,a){return t!=null&&hl(t,a,iu)}var ml=ou,su="[object String]";function lu(t){return typeof t=="string"||!Rt(t)&&O(t)&&_(t)==su}var hu=lu;function cu(t,a){return mt(a,function(c){return t[c]})}var fu=cu;function uu(t){return t==null?[]:fu(t,na(t))}var Hn=uu,vu="[object Map]",du="[object Set]",gu=Object.prototype,pu=gu.hasOwnProperty;function mu(t){if(t==null)return!0;if(ve(t)&&(Rt(t)||typeof t=="string"||typeof t.splice=="function"||fr(t)||Tr(t)||Ke(t)))return!t.length;var a=qn(t);if(a==vu||a==du)return!t.size;if(De(t))return!jr(t).length;for(var c in t)if(pu.call(t,c))return!1;return!0}var yl=mu;function yu(t){return t===void 0}var kn=yu;function wu(t,a){return t<a}var wl=wu;function bu(t,a){var c={};return a=Vn(a,3),yo(t,function(A,V,J){rt(c,V,a(A,V,J))}),c}var Ui=bu;function xu(t,a,c){for(var A=-1,V=t.length;++A<V;){var J=t[A],it=a(J);if(it!=null&&(_t===void 0?it===it&&!W(it):c(it,_t)))var _t=it,Vt=J}return Vt}var Co=xu;function ku(t){return t&&t.length?Co(t,ir,eu):void 0}var $n=ku,Cu=Me(function(t,a,c){I1(t,a,c)}),Eo=Cu;function Eu(t){return t&&t.length?Co(t,ir,wl):void 0}var pi=Eu;function Mu(t,a){return t&&t.length?Co(t,Vn(a,2),wl):void 0}var Mo=Mu;function _u(t,a,c,A){if(!or(t))return t;a=Pi(a,t);for(var V=-1,J=a.length,it=J-1,_t=t;_t!=null&&++V<J;){var Vt=gi(a[V]),se=c;if(Vt==="__proto__"||Vt==="constructor"||Vt==="prototype")return t;if(V!=it){var ge=_t[Vt];se=A?A(ge,Vt,_t):void 0,se===void 0&&(se=or(ge)?ge:U(a[V+1])?[]:{})}Pt(_t,Vt,se),_t=_t[Vt]}return t}var Tu=_u;function Su(t,a,c){for(var A=-1,V=a.length,J={};++A<V;){var it=a[A],_t=Di(t,it);c(_t,it)&&Tu(J,Pi(it,t),_t)}return J}var Au=Su;function Lu(t,a){var c=t.length;for(t.sort(a);c--;)t[c]=t[c].value;return t}var Fu=Lu;function Nu(t,a){if(t!==a){var c=t!==void 0,A=t===null,V=t===t,J=W(t),it=a!==void 0,_t=a===null,Vt=a===a,se=W(a);if(!_t&&!se&&!J&&t>a||J&&it&&Vt&&!_t&&!se||A&&it&&Vt||!c&&Vt||!V)return 1;if(!A&&!J&&!se&&t<a||se&&c&&V&&!A&&!J||_t&&c&&V||!it&&V||!Vt)return-1}return 0}var Iu=Nu;function Pu(t,a,c){for(var A=-1,V=t.criteria,J=a.criteria,it=V.length,_t=c.length;++A<it;){var Vt=Iu(V[A],J[A]);if(Vt){if(A>=_t)return Vt;var se=c[A];return Vt*(se=="desc"?-1:1)}}return t.index-a.index}var Du=Pu;function Ou(t,a,c){a.length?a=mt(a,function(J){return Rt(J)?function(it){return Di(it,J.length===1?J[0]:J)}:J}):a=[ir];var A=-1;a=mt(a,vt(Vn));var V=pl(t,function(J,it,_t){var Vt=mt(a,function(se){return se(J)});return{criteria:Vt,index:++A,value:J}});return Fu(V,function(J,it){return Du(J,it,c)})}var Ru=Ou,zu=fl("length"),Bu=zu,bl="\\ud800-\\udfff",Hu="\\u0300-\\u036f",Wu="\\ufe20-\\ufe2f",Uu="\\u20d0-\\u20ff",Yu=Hu+Wu+Uu,Vu="\\ufe0e\\ufe0f",ju="["+bl+"]",_o="["+Yu+"]",To="\\ud83c[\\udffb-\\udfff]",Xu="(?:"+_o+"|"+To+")",xl="[^"+bl+"]",kl="(?:\\ud83c[\\udde6-\\uddff]){2}",Cl="[\\ud800-\\udbff][\\udc00-\\udfff]",qu="\\u200d",El=Xu+"?",Ml="["+Vu+"]?",$u="(?:"+qu+"(?:"+[xl,kl,Cl].join("|")+")"+Ml+El+")*",Gu=Ml+El+$u,Zu="(?:"+[xl+_o+"?",_o,kl,Cl,ju].join("|")+")",_l=RegExp(To+"(?="+To+")|"+Zu+Gu,"g");function Ku(t){for(var a=_l.lastIndex=0;_l.test(t);)++a;return a}var Qu=Ku;function Ju(t){return qh(t)?Qu(t):Bu(t)}var tv=Ju;function ev(t,a){return Au(t,a,function(c,A){return cl(t,A)})}var rv=ev,av=Ah(function(t,a){return t==null?{}:rv(t,a)}),Yi=av,nv=Math.ceil,iv=Math.max;function ov(t,a,c,A){for(var V=-1,J=iv(nv((a-t)/(c||1)),0),it=Array(J);J--;)it[A?J:++V]=t,t+=c;return it}var sv=ov;function lv(t){return function(a,c,A){return A&&typeof A!="number"&&Se(a,c,A)&&(c=A=void 0),a=Yr(a),c===void 0?(c=a,a=0):c=Yr(c),A=A===void 0?a<c?1:-1:Yr(A),sv(a,c,A,t)}}var hv=lv,cv=hv(),ii=cv;function fv(t,a,c,A,V){return V(t,function(J,it,_t){c=A?(A=!1,J):a(c,J,it,_t)}),c}var uv=fv;function vv(t,a,c){var A=Rt(t)?Gh:uv,V=arguments.length<3;return A(t,Vn(a,4),c,V,Hi)}var mi=vv,dv="[object Map]",gv="[object Set]";function pv(t){if(t==null)return 0;if(ve(t))return hu(t)?tv(t):t.length;var a=qn(t);return a==dv||a==gv?t.size:jr(t).length}var mv=pv,yv=jt(function(t,a){if(t==null)return[];var c=a.length;return c>1&&Se(t,a[0],a[1])?a=[]:c>2&&Se(a[0],a[1],a[2])&&(a=[a[0]]),Ru(t,so(a,1),[])}),yi=yv,wv=1/0,bv=ni&&1/go(new ni([,-0]))[1]==wv?function(t){return new ni(t)}:H,xv=bv,kv=200;function Cv(t,a,c){var A=-1,V=S,J=t.length,it=!0,_t=[],Vt=_t;if(c)it=!1,V=D1;else if(J>=kv){var se=a?null:xv(t);if(se)return go(se);it=!1,V=Js,Vt=new Qs}else Vt=a?[]:_t;t:for(;++A<J;){var ge=t[A],Oe=a?a(ge):ge;if(ge=c||ge!==0?ge:0,it&&Oe===Oe){for(var hr=Vt.length;hr--;)if(Vt[hr]===Oe)continue t;a&&Vt.push(Oe),_t.push(ge)}else V(Vt,Oe,c)||(Vt!==_t&&Vt.push(Oe),_t.push(ge))}return _t}var Ev=Cv,Mv=jt(function(t){return Ev(so(t,1,dl,!0))}),_v=Mv,Tv=0;function Sv(t){var a=++Tv;return Es(t)+a}var So=Sv;function Av(t,a,c){for(var A=-1,V=t.length,J=a.length,it={};++A<V;){var _t=A<J?a[A]:void 0;c(it,t[A],_t)}return it}var Lv=Av;function Fv(t,a){return Lv(t||[],a||[],Pt)}var Nv=Fv,Iv="\0",Gn="\0",Tl="",Nn=class{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=ft(void 0),this._defaultEdgeLabelFn=ft(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Gn]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return sa(t)||(t=ft(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return na(this._nodes)}sources(){var t=this;return Bn(this.nodes(),function(a){return yl(t._in[a])})}sinks(){var t=this;return Bn(this.nodes(),function(a){return yl(t._out[a])})}setNodes(t,a){var c=arguments,A=this;return Te(t,function(V){c.length>1?A.setNode(V,a):A.setNode(V)}),this}setNode(t,a){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=a),this):(this._nodes[t]=arguments.length>1?a:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Gn,this._children[t]={},this._children[Gn][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var a=c=>this.removeEdge(this._edgeObjs[c]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],Te(this.children(t),c=>{this.setParent(c)}),delete this._children[t]),Te(na(this._in[t]),a),delete this._in[t],delete this._preds[t],Te(na(this._out[t]),a),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,a){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(kn(a))a=Gn;else{a+="";for(var c=a;!kn(c);c=this.parent(c))if(c===t)throw new Error("Setting "+a+" as parent of "+t+" would create a cycle");this.setNode(a)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=a,this._children[a][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var a=this._parent[t];if(a!==Gn)return a}}children(t){if(kn(t)&&(t=Gn),this._isCompound){var a=this._children[t];if(a)return na(a)}else{if(t===Gn)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var a=this._preds[t];if(a)return na(a)}successors(t){var a=this._sucs[t];if(a)return na(a)}neighbors(t){var a=this.predecessors(t);if(a)return _v(a,this.successors(t))}isLeaf(t){var a;return this.isDirected()?a=this.successors(t):a=this.neighbors(t),a.length===0}filterNodes(t){var a=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});a.setGraph(this.graph());var c=this;Te(this._nodes,function(J,it){t(it)&&a.setNode(it,J)}),Te(this._edgeObjs,function(J){a.hasNode(J.v)&&a.hasNode(J.w)&&a.setEdge(J,c.edge(J))});var A={};function V(J){var it=c.parent(J);return it===void 0||a.hasNode(it)?(A[J]=it,it):it in A?A[it]:V(it)}return this._isCompound&&Te(a.nodes(),function(J){a.setParent(J,V(J))}),a}setDefaultEdgeLabel(t){return sa(t)||(t=ft(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Hn(this._edgeObjs)}setPath(t,a){var c=this,A=arguments;return mi(t,function(V,J){return A.length>1?c.setEdge(V,J,a):c.setEdge(V,J),J}),this}setEdge(){var t,a,c,A,V=!1,J=arguments[0];typeof J=="object"&&J!==null&&"v"in J?(t=J.v,a=J.w,c=J.name,arguments.length===2&&(A=arguments[1],V=!0)):(t=J,a=arguments[1],c=arguments[3],arguments.length>2&&(A=arguments[2],V=!0)),t=""+t,a=""+a,kn(c)||(c=""+c);var it=wi(this._isDirected,t,a,c);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,it))return V&&(this._edgeLabels[it]=A),this;if(!kn(c)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(a),this._edgeLabels[it]=V?A:this._defaultEdgeLabelFn(t,a,c);var _t=Pv(this._isDirected,t,a,c);return t=_t.v,a=_t.w,Object.freeze(_t),this._edgeObjs[it]=_t,Sl(this._preds[a],t),Sl(this._sucs[t],a),this._in[a][it]=_t,this._out[t][it]=_t,this._edgeCount++,this}edge(t,a,c){var A=arguments.length===1?Ao(this._isDirected,arguments[0]):wi(this._isDirected,t,a,c);return this._edgeLabels[A]}hasEdge(t,a,c){var A=arguments.length===1?Ao(this._isDirected,arguments[0]):wi(this._isDirected,t,a,c);return Object.prototype.hasOwnProperty.call(this._edgeLabels,A)}removeEdge(t,a,c){var A=arguments.length===1?Ao(this._isDirected,arguments[0]):wi(this._isDirected,t,a,c),V=this._edgeObjs[A];return V&&(t=V.v,a=V.w,delete this._edgeLabels[A],delete this._edgeObjs[A],Al(this._preds[a],t),Al(this._sucs[t],a),delete this._in[a][A],delete this._out[t][A],this._edgeCount--),this}inEdges(t,a){var c=this._in[t];if(c){var A=Hn(c);return a?Bn(A,function(V){return V.v===a}):A}}outEdges(t,a){var c=this._out[t];if(c){var A=Hn(c);return a?Bn(A,function(V){return V.w===a}):A}}nodeEdges(t,a){var c=this.inEdges(t,a);if(c)return c.concat(this.outEdges(t,a))}};Nn.prototype._nodeCount=0,Nn.prototype._edgeCount=0;function Sl(t,a){t[a]?t[a]++:t[a]=1}function Al(t,a){--t[a]||delete t[a]}function wi(t,a,c,A){var V=""+a,J=""+c;if(!t&&V>J){var it=V;V=J,J=it}return V+Tl+J+Tl+(kn(A)?Iv:A)}function Pv(t,a,c,A){var V=""+a,J=""+c;if(!t&&V>J){var it=V;V=J,J=it}var _t={v:V,w:J};return A&&(_t.name=A),_t}function Ao(t,a){return wi(t,a.v,a.w,a.name)}var Dv="2.1.9-pre";function oi(t,a,c,A){var V;do V=So(A);while(t.hasNode(V));return c.dummy=a,t.setNode(V,c),V}function Ov(t){var a=new Nn().setGraph(t.graph());return Te(t.nodes(),function(c){a.setNode(c,t.node(c))}),Te(t.edges(),function(c){var A=a.edge(c.v,c.w)||{weight:0,minlen:1},V=t.edge(c);a.setEdge(c.v,c.w,{weight:A.weight+V.weight,minlen:Math.max(A.minlen,V.minlen)})}),a}function Ll(t){var a=new Nn({multigraph:t.isMultigraph()}).setGraph(t.graph());return Te(t.nodes(),function(c){t.children(c).length||a.setNode(c,t.node(c))}),Te(t.edges(),function(c){a.setEdge(c,t.edge(c))}),a}function Fl(t,a){var c=t.x,A=t.y,V=a.x-c,J=a.y-A,it=t.width/2,_t=t.height/2;if(!V&&!J)throw new Error("Not possible to find intersection inside of the rectangle");var Vt,se;return Math.abs(J)*it>Math.abs(V)*_t?(J<0&&(_t=-_t),Vt=_t*V/J,se=_t):(V<0&&(it=-it),Vt=it,se=it*J/V),{x:c+Vt,y:A+se}}function Vi(t){var a=pn(ii(Il(t)+1),function(){return[]});return Te(t.nodes(),function(c){var A=t.node(c),V=A.rank;kn(V)||(a[V][A.order]=c)}),a}function Rv(t){var a=pi(pn(t.nodes(),function(c){return t.node(c).rank}));Te(t.nodes(),function(c){var A=t.node(c);ml(A,"rank")&&(A.rank-=a)})}function zv(t){var a=pi(pn(t.nodes(),function(J){return t.node(J).rank})),c=[];Te(t.nodes(),function(J){var it=t.node(J).rank-a;c[it]||(c[it]=[]),c[it].push(J)});var A=0,V=t.graph().nodeRankFactor;Te(c,function(J,it){kn(J)&&it%V!==0?--A:A&&Te(J,function(_t){t.node(_t).rank+=A})})}function Nl(t,a,c,A){var V={width:0,height:0};return arguments.length>=4&&(V.rank=c,V.order=A),oi(t,"border",V,a)}function Il(t){return $n(pn(t.nodes(),function(a){var c=t.node(a).rank;if(!kn(c))return c}))}function Bv(t,a){var c={lhs:[],rhs:[]};return Te(t,function(A){a(A)?c.lhs.push(A):c.rhs.push(A)}),c}function Hv(t,a){var c=ul();try{return a()}finally{console.log(t+" time: "+(ul()-c)+"ms")}}function Wv(t,a){return a()}function Uv(t){function a(c){var A=t.children(c),V=t.node(c);if(A.length&&Te(A,a),Object.prototype.hasOwnProperty.call(V,"minRank")){V.borderLeft=[],V.borderRight=[];for(var J=V.minRank,it=V.maxRank+1;J<it;++J)Pl(t,"borderLeft","_bl",c,V,J),Pl(t,"borderRight","_br",c,V,J)}}Te(t.children(),a)}function Pl(t,a,c,A,V,J){var it={width:0,height:0,rank:J,borderType:a},_t=V[a][J-1],Vt=oi(t,"border",it,c);V[a][J]=Vt,t.setParent(Vt,A),_t&&t.setEdge(_t,Vt,{weight:1})}function Yv(t){var a=t.graph().rankdir.toLowerCase();(a==="lr"||a==="rl")&&Dl(t)}function Vv(t){var a=t.graph().rankdir.toLowerCase();(a==="bt"||a==="rl")&&jv(t),(a==="lr"||a==="rl")&&(Xv(t),Dl(t))}function Dl(t){Te(t.nodes(),function(a){Ol(t.node(a))}),Te(t.edges(),function(a){Ol(t.edge(a))})}function Ol(t){var a=t.width;t.width=t.height,t.height=a}function jv(t){Te(t.nodes(),function(a){Lo(t.node(a))}),Te(t.edges(),function(a){var c=t.edge(a);Te(c.points,Lo),Object.prototype.hasOwnProperty.call(c,"y")&&Lo(c)})}function Lo(t){t.y=-t.y}function Xv(t){Te(t.nodes(),function(a){Fo(t.node(a))}),Te(t.edges(),function(a){var c=t.edge(a);Te(c.points,Fo),Object.prototype.hasOwnProperty.call(c,"x")&&Fo(c)})}function Fo(t){var a=t.x;t.x=t.y,t.y=a}var qv=class{constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,a=t._prev;if(a!==t)return Rl(a),a}enqueue(t){var a=this._sentinel;t._prev&&t._next&&Rl(t),t._next=a._next,a._next._prev=t,a._next=t,t._prev=a}toString(){for(var t=[],a=this._sentinel,c=a._prev;c!==a;)t.push(JSON.stringify(c,$v)),c=c._prev;return"["+t.join(", ")+"]"}};function Rl(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function $v(t,a){if(t!=="_next"&&t!=="_prev")return a}var Gv=ft(1);function Zv(t,a){if(t.nodeCount()<=1)return[];var c=Qv(t,a||Gv),A=Kv(c.graph,c.buckets,c.zeroIdx);return ei(pn(A,function(V){return t.outEdges(V.v,V.w)}))}function Kv(t,a,c){for(var A=[],V=a[a.length-1],J=a[0],it;t.nodeCount();){for(;it=J.dequeue();)No(t,a,c,it);for(;it=V.dequeue();)No(t,a,c,it);if(t.nodeCount()){for(var _t=a.length-2;_t>0;--_t)if(it=a[_t].dequeue(),it){A=A.concat(No(t,a,c,it,!0));break}}}return A}function No(t,a,c,A,V){var J=V?[]:void 0;return Te(t.inEdges(A.v),function(it){var _t=t.edge(it),Vt=t.node(it.v);V&&J.push({v:it.v,w:it.w}),Vt.out-=_t,Io(a,c,Vt)}),Te(t.outEdges(A.v),function(it){var _t=t.edge(it),Vt=it.w,se=t.node(Vt);se.in-=_t,Io(a,c,se)}),t.removeNode(A.v),J}function Qv(t,a){var c=new Nn,A=0,V=0;Te(t.nodes(),function(_t){c.setNode(_t,{v:_t,in:0,out:0})}),Te(t.edges(),function(_t){var Vt=c.edge(_t.v,_t.w)||0,se=a(_t),ge=Vt+se;c.setEdge(_t.v,_t.w,ge),V=Math.max(V,c.node(_t.v).out+=se),A=Math.max(A,c.node(_t.w).in+=se)});var J=ii(V+A+3).map(function(){return new qv}),it=A+1;return Te(c.nodes(),function(_t){Io(J,it,c.node(_t))}),{graph:c,buckets:J,zeroIdx:it}}function Io(t,a,c){c.out?c.in?t[c.out-c.in+a].enqueue(c):t[t.length-1].enqueue(c):t[0].enqueue(c)}function Jv(t){var a=t.graph().acyclicer==="greedy"?Zv(t,c(t)):td(t);Te(a,function(A){var V=t.edge(A);t.removeEdge(A),V.forwardName=A.name,V.reversed=!0,t.setEdge(A.w,A.v,V,So("rev"))});function c(A){return function(V){return A.edge(V).weight}}}function td(t){var a=[],c={},A={};function V(J){Object.prototype.hasOwnProperty.call(A,J)||(A[J]=!0,c[J]=!0,Te(t.outEdges(J),function(it){Object.prototype.hasOwnProperty.call(c,it.w)?a.push(it):V(it.w)}),delete c[J])}return Te(t.nodes(),V),a}function ed(t){Te(t.edges(),function(a){var c=t.edge(a);if(c.reversed){t.removeEdge(a);var A=c.forwardName;delete c.reversed,delete c.forwardName,t.setEdge(a.w,a.v,c,A)}})}function rd(t){t.graph().dummyChains=[],Te(t.edges(),function(a){ad(t,a)})}function ad(t,a){var c=a.v,A=t.node(c).rank,V=a.w,J=t.node(V).rank,it=a.name,_t=t.edge(a),Vt=_t.labelRank;if(J!==A+1){t.removeEdge(a);var se=void 0,ge,Oe;for(Oe=0,++A;A<J;++Oe,++A)_t.points=[],se={width:0,height:0,edgeLabel:_t,edgeObj:a,rank:A},ge=oi(t,"edge",se,"_d"),A===Vt&&(se.width=_t.width,se.height=_t.height,se.dummy="edge-label",se.labelpos=_t.labelpos),t.setEdge(c,ge,{weight:_t.weight},it),Oe===0&&t.graph().dummyChains.push(ge),c=ge;t.setEdge(c,V,{weight:_t.weight},it)}}function nd(t){Te(t.graph().dummyChains,function(a){var c=t.node(a),A=c.edgeLabel,V;for(t.setEdge(c.edgeObj,A);c.dummy;)V=t.successors(a)[0],t.removeNode(a),A.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(A.x=c.x,A.y=c.y,A.width=c.width,A.height=c.height),a=V,c=t.node(a)})}function Po(t){var a={};function c(A){var V=t.node(A);if(Object.prototype.hasOwnProperty.call(a,A))return V.rank;a[A]=!0;var J=pi(pn(t.outEdges(A),function(it){return c(it.w)-t.edge(it).minlen}));return(J===Number.POSITIVE_INFINITY||J===void 0||J===null)&&(J=0),V.rank=J}Te(t.sources(),c)}function bi(t,a){return t.node(a.w).rank-t.node(a.v).rank-t.edge(a).minlen}function zl(t){var a=new Nn({directed:!1}),c=t.nodes()[0],A=t.nodeCount();a.setNode(c,{});for(var V,J;id(a,t)<A;)V=od(a,t),J=a.hasNode(V.v)?bi(t,V):-bi(t,V),sd(a,t,J);return a}function id(t,a){function c(A){Te(a.nodeEdges(A),function(V){var J=V.v,it=A===J?V.w:J;!t.hasNode(it)&&!bi(a,V)&&(t.setNode(it,{}),t.setEdge(A,it,{}),c(it))})}return Te(t.nodes(),c),t.nodeCount()}function od(t,a){return Mo(a.edges(),function(c){if(t.hasNode(c.v)!==t.hasNode(c.w))return bi(a,c)})}function sd(t,a,c){Te(t.nodes(),function(A){a.node(A).rank+=c})}var l2=ft(1),h2=ft(1);ld.CycleException=ji;function ld(t){var a={},c={},A=[];function V(J){if(Object.prototype.hasOwnProperty.call(c,J))throw new ji;Object.prototype.hasOwnProperty.call(a,J)||(c[J]=!0,a[J]=!0,Te(t.predecessors(J),V),delete c[J],A.push(J))}if(Te(t.sinks(),V),mv(a)!==t.nodeCount())throw new ji;return A}function ji(){}ji.prototype=new Error;function Bl(t,a,c){Rt(a)||(a=[a]);var A=(t.isDirected()?t.successors:t.neighbors).bind(t),V=[],J={};return Te(a,function(it){if(!t.hasNode(it))throw new Error("Graph does not have node: "+it);Hl(t,it,c==="post",J,A,V)}),V}function Hl(t,a,c,A,V,J){Object.prototype.hasOwnProperty.call(A,a)||(A[a]=!0,c||J.push(a),Te(V(a),function(it){Hl(t,it,c,A,V,J)}),c&&J.push(a))}function hd(t,a){return Bl(t,a,"post")}function cd(t,a){return Bl(t,a,"pre")}Zn.initLowLimValues=Oo,Zn.initCutValues=Do,Zn.calcCutValue=Wl,Zn.leaveEdge=Yl,Zn.enterEdge=Vl,Zn.exchangeEdges=jl;function Zn(t){t=Ov(t),Po(t);var a=zl(t);Oo(a),Do(a,t);for(var c,A;c=Yl(a);)A=Vl(a,t,c),jl(a,t,c,A)}function Do(t,a){var c=hd(t,t.nodes());c=c.slice(0,c.length-1),Te(c,function(A){fd(t,a,A)})}function fd(t,a,c){var A=t.node(c),V=A.parent;t.edge(c,V).cutvalue=Wl(t,a,c)}function Wl(t,a,c){var A=t.node(c),V=A.parent,J=!0,it=a.edge(c,V),_t=0;return it||(J=!1,it=a.edge(V,c)),_t=it.weight,Te(a.nodeEdges(c),function(Vt){var se=Vt.v===c,ge=se?Vt.w:Vt.v;if(ge!==V){var Oe=se===J,hr=a.edge(Vt).weight;if(_t+=Oe?hr:-hr,vd(t,c,ge)){var Hr=t.edge(c,ge).cutvalue;_t+=Oe?-Hr:Hr}}}),_t}function Oo(t,a){arguments.length<2&&(a=t.nodes()[0]),Ul(t,{},1,a)}function Ul(t,a,c,A,V){var J=c,it=t.node(A);return a[A]=!0,Te(t.neighbors(A),function(_t){Object.prototype.hasOwnProperty.call(a,_t)||(c=Ul(t,a,c,_t,A))}),it.low=J,it.lim=c++,V?it.parent=V:delete it.parent,c}function Yl(t){return ko(t.edges(),function(a){return t.edge(a).cutvalue<0})}function Vl(t,a,c){var A=c.v,V=c.w;a.hasEdge(A,V)||(A=c.w,V=c.v);var J=t.node(A),it=t.node(V),_t=J,Vt=!1;J.lim>it.lim&&(_t=it,Vt=!0);var se=Bn(a.edges(),function(ge){return Vt===Xl(t,t.node(ge.v),_t)&&Vt!==Xl(t,t.node(ge.w),_t)});return Mo(se,function(ge){return bi(a,ge)})}function jl(t,a,c,A){var V=c.v,J=c.w;t.removeEdge(V,J),t.setEdge(A.v,A.w,{}),Oo(t),Do(t,a),ud(t,a)}function ud(t,a){var c=ko(t.nodes(),function(V){return!a.node(V).parent}),A=cd(t,c);A=A.slice(1),Te(A,function(V){var J=t.node(V).parent,it=a.edge(V,J),_t=!1;it||(it=a.edge(J,V),_t=!0),a.node(V).rank=a.node(J).rank+(_t?it.minlen:-it.minlen)})}function vd(t,a,c){return t.hasEdge(a,c)}function Xl(t,a,c){return c.low<=a.lim&&a.lim<=c.lim}function dd(t){switch(t.graph().ranker){case"network-simplex":ql(t);break;case"tight-tree":pd(t);break;case"longest-path":gd(t);break;default:ql(t)}}var gd=Po;function pd(t){Po(t),zl(t)}function ql(t){Zn(t)}function md(t){var a=oi(t,"root",{},"_root"),c=yd(t),A=$n(Hn(c))-1,V=2*A+1;t.graph().nestingRoot=a,Te(t.edges(),function(it){t.edge(it).minlen*=V});var J=wd(t)+1;Te(t.children(),function(it){$l(t,a,V,J,A,c,it)}),t.graph().nodeRankFactor=V}function $l(t,a,c,A,V,J,it){var _t=t.children(it);if(!_t.length){it!==a&&t.setEdge(a,it,{weight:0,minlen:c});return}var Vt=Nl(t,"_bt"),se=Nl(t,"_bb"),ge=t.node(it);t.setParent(Vt,it),ge.borderTop=Vt,t.setParent(se,it),ge.borderBottom=se,Te(_t,function(Oe){$l(t,a,c,A,V,J,Oe);var hr=t.node(Oe),Hr=hr.borderTop?hr.borderTop:Oe,Or=hr.borderBottom?hr.borderBottom:Oe,Ca=hr.borderTop?A:2*A,Qa=Hr!==Or?1:V-J[it]+1;t.setEdge(Vt,Hr,{weight:Ca,minlen:Qa,nestingEdge:!0}),t.setEdge(Or,se,{weight:Ca,minlen:Qa,nestingEdge:!0})}),t.parent(it)||t.setEdge(a,Vt,{weight:0,minlen:V+J[it]})}function yd(t){var a={};function c(A,V){var J=t.children(A);J&&J.length&&Te(J,function(it){c(it,V+1)}),a[A]=V}return Te(t.children(),function(A){c(A,1)}),a}function wd(t){return mi(t.edges(),function(a,c){return a+t.edge(c).weight},0)}function bd(t){var a=t.graph();t.removeNode(a.nestingRoot),delete a.nestingRoot,Te(t.edges(),function(c){var A=t.edge(c);A.nestingEdge&&t.removeEdge(c)})}function xd(t,a,c){var A={},V;Te(c,function(J){for(var it=t.parent(J),_t,Vt;it;){if(_t=t.parent(it),_t?(Vt=A[_t],A[_t]=it):(Vt=V,V=it),Vt&&Vt!==it){a.setEdge(Vt,it);return}it=_t}})}function kd(t,a,c){var A=Cd(t),V=new Nn({compound:!0}).setGraph({root:A}).setDefaultNodeLabel(function(J){return t.node(J)});return Te(t.nodes(),function(J){var it=t.node(J),_t=t.parent(J);(it.rank===a||it.minRank<=a&&a<=it.maxRank)&&(V.setNode(J),V.setParent(J,_t||A),Te(t[c](J),function(Vt){var se=Vt.v===J?Vt.w:Vt.v,ge=V.edge(se,J),Oe=kn(ge)?0:ge.weight;V.setEdge(se,J,{weight:t.edge(Vt).weight+Oe})}),Object.prototype.hasOwnProperty.call(it,"minRank")&&V.setNode(J,{borderLeft:it.borderLeft[a],borderRight:it.borderRight[a]}))}),V}function Cd(t){for(var a;t.hasNode(a=So("_root")););return a}function Ed(t,a){for(var c=0,A=1;A<a.length;++A)c+=Md(t,a[A-1],a[A]);return c}function Md(t,a,c){for(var A=Nv(c,pn(c,function(se,ge){return ge})),V=ei(pn(a,function(se){return yi(pn(t.outEdges(se),function(ge){return{pos:A[ge.w],weight:t.edge(ge).weight}}),"pos")})),J=1;J<c.length;)J<<=1;var it=2*J-1;J-=1;var _t=pn(new Array(it),function(){return 0}),Vt=0;return Te(V.forEach(function(se){var ge=se.pos+J;_t[ge]+=se.weight;for(var Oe=0;ge>0;)ge%2&&(Oe+=_t[ge+1]),ge=ge-1>>1,_t[ge]+=se.weight;Vt+=se.weight*Oe})),Vt}function _d(t){var a={},c=Bn(t.nodes(),function(_t){return!t.children(_t).length}),A=$n(pn(c,function(_t){return t.node(_t).rank})),V=pn(ii(A+1),function(){return[]});function J(_t){if(!ml(a,_t)){a[_t]=!0;var Vt=t.node(_t);V[Vt.rank].push(_t),Te(t.successors(_t),J)}}var it=yi(c,function(_t){return t.node(_t).rank});return Te(it,J),V}function Td(t,a){return pn(a,function(c){var A=t.inEdges(c);if(A.length){var V=mi(A,function(J,it){var _t=t.edge(it),Vt=t.node(it.v);return{sum:J.sum+_t.weight*Vt.order,weight:J.weight+_t.weight}},{sum:0,weight:0});return{v:c,barycenter:V.sum/V.weight,weight:V.weight}}else return{v:c}})}function Sd(t,a){var c={};Te(t,function(V,J){var it=c[V.v]={indegree:0,in:[],out:[],vs:[V.v],i:J};kn(V.barycenter)||(it.barycenter=V.barycenter,it.weight=V.weight)}),Te(a.edges(),function(V){var J=c[V.v],it=c[V.w];!kn(J)&&!kn(it)&&(it.indegree++,J.out.push(c[V.w]))});var A=Bn(c,function(V){return!V.indegree});return Ad(A)}function Ad(t){var a=[];function c(J){return function(it){it.merged||(kn(it.barycenter)||kn(J.barycenter)||it.barycenter>=J.barycenter)&&Ld(J,it)}}function A(J){return function(it){it.in.push(J),--it.indegree===0&&t.push(it)}}for(;t.length;){var V=t.pop();a.push(V),Te(V.in.reverse(),c(V)),Te(V.out,A(V))}return pn(Bn(a,function(J){return!J.merged}),function(J){return Yi(J,["vs","i","barycenter","weight"])})}function Ld(t,a){var c=0,A=0;t.weight&&(c+=t.barycenter*t.weight,A+=t.weight),a.weight&&(c+=a.barycenter*a.weight,A+=a.weight),t.vs=a.vs.concat(t.vs),t.barycenter=c/A,t.weight=A,t.i=Math.min(a.i,t.i),a.merged=!0}function Fd(t,a){var c=Bv(t,function(ge){return Object.prototype.hasOwnProperty.call(ge,"barycenter")}),A=c.lhs,V=yi(c.rhs,function(ge){return-ge.i}),J=[],it=0,_t=0,Vt=0;A.sort(Nd(!!a)),Vt=Gl(J,V,Vt),Te(A,function(ge){Vt+=ge.vs.length,J.push(ge.vs),it+=ge.barycenter*ge.weight,_t+=ge.weight,Vt=Gl(J,V,Vt)});var se={vs:ei(J)};return _t&&(se.barycenter=it/_t,se.weight=_t),se}function Gl(t,a,c){for(var A;a.length&&(A=Wi(a)).i<=c;)a.pop(),t.push(A.vs),c++;return c}function Nd(t){return function(a,c){return a.barycenter<c.barycenter?-1:a.barycenter>c.barycenter?1:t?c.i-a.i:a.i-c.i}}function Zl(t,a,c,A){var V=t.children(a),J=t.node(a),it=J?J.borderLeft:void 0,_t=J?J.borderRight:void 0,Vt={};it&&(V=Bn(V,function(Or){return Or!==it&&Or!==_t}));var se=Td(t,V);Te(se,function(Or){if(t.children(Or.v).length){var Ca=Zl(t,Or.v,c,A);Vt[Or.v]=Ca,Object.prototype.hasOwnProperty.call(Ca,"barycenter")&&Pd(Or,Ca)}});var ge=Sd(se,c);Id(ge,Vt);var Oe=Fd(ge,A);if(it&&(Oe.vs=ei([it,Oe.vs,_t]),t.predecessors(it).length)){var hr=t.node(t.predecessors(it)[0]),Hr=t.node(t.predecessors(_t)[0]);Object.prototype.hasOwnProperty.call(Oe,"barycenter")||(Oe.barycenter=0,Oe.weight=0),Oe.barycenter=(Oe.barycenter*Oe.weight+hr.order+Hr.order)/(Oe.weight+2),Oe.weight+=2}return Oe}function Id(t,a){Te(t,function(c){c.vs=ei(c.vs.map(function(A){return a[A]?a[A].vs:A}))})}function Pd(t,a){kn(t.barycenter)?(t.barycenter=a.barycenter,t.weight=a.weight):(t.barycenter=(t.barycenter*t.weight+a.barycenter*a.weight)/(t.weight+a.weight),t.weight+=a.weight)}function Dd(t){var a=Il(t),c=Kl(t,ii(1,a+1),"inEdges"),A=Kl(t,ii(a-1,-1,-1),"outEdges"),V=_d(t);Ql(t,V);for(var J=Number.POSITIVE_INFINITY,it,_t=0,Vt=0;Vt<4;++_t,++Vt){Od(_t%2?c:A,_t%4>=2),V=Vi(t);var se=Ed(t,V);se<J&&(Vt=0,it=of(V),J=se)}Ql(t,it)}function Kl(t,a,c){return pn(a,function(A){return kd(t,A,c)})}function Od(t,a){var c=new Nn;Te(t,function(A){var V=A.graph().root,J=Zl(A,V,c,a);Te(J.vs,function(it,_t){A.node(it).order=_t}),xd(A,c,J.vs)})}function Ql(t,a){Te(a,function(c){Te(c,function(A,V){t.node(A).order=V})})}function Rd(t){var a=Bd(t);Te(t.graph().dummyChains,function(c){for(var A=t.node(c),V=A.edgeObj,J=zd(t,a,V.v,V.w),it=J.path,_t=J.lca,Vt=0,se=it[Vt],ge=!0;c!==V.w;){if(A=t.node(c),ge){for(;(se=it[Vt])!==_t&&t.node(se).maxRank<A.rank;)Vt++;se===_t&&(ge=!1)}if(!ge){for(;Vt<it.length-1&&t.node(se=it[Vt+1]).minRank<=A.rank;)Vt++;se=it[Vt]}t.setParent(c,se),c=t.successors(c)[0]}})}function zd(t,a,c,A){var V=[],J=[],it=Math.min(a[c].low,a[A].low),_t=Math.max(a[c].lim,a[A].lim),Vt,se;Vt=c;do Vt=t.parent(Vt),V.push(Vt);while(Vt&&(a[Vt].low>it||_t>a[Vt].lim));for(se=Vt,Vt=A;(Vt=t.parent(Vt))!==se;)J.push(Vt);return{path:V.concat(J.reverse()),lca:se}}function Bd(t){var a={},c=0;function A(V){var J=c;Te(t.children(V),A),a[V]={low:J,lim:c++}}return Te(t.children(),A),a}function Hd(t,a){var c={};function A(V,J){var it=0,_t=0,Vt=V.length,se=Wi(J);return Te(J,function(ge,Oe){var hr=Ud(t,ge),Hr=hr?t.node(hr).order:Vt;(hr||ge===se)&&(Te(J.slice(_t,Oe+1),function(Or){Te(t.predecessors(Or),function(Ca){var Qa=t.node(Ca),mn=Qa.order;(mn<it||Hr<mn)&&!(Qa.dummy&&t.node(Or).dummy)&&Jl(c,Ca,Or)})}),_t=Oe+1,it=Hr)}),J}return mi(a,A),c}function Wd(t,a){var c={};function A(J,it,_t,Vt,se){var ge;Te(ii(it,_t),function(Oe){ge=J[Oe],t.node(ge).dummy&&Te(t.predecessors(ge),function(hr){var Hr=t.node(hr);Hr.dummy&&(Hr.order<Vt||Hr.order>se)&&Jl(c,hr,ge)})})}function V(J,it){var _t=-1,Vt,se=0;return Te(it,function(ge,Oe){if(t.node(ge).dummy==="border"){var hr=t.predecessors(ge);hr.length&&(Vt=t.node(hr[0]).order,A(it,se,Oe,_t,Vt),se=Oe,_t=Vt)}A(it,se,it.length,Vt,J.length)}),it}return mi(a,V),c}function Ud(t,a){if(t.node(a).dummy)return ko(t.predecessors(a),function(c){return t.node(c).dummy})}function Jl(t,a,c){if(a>c){var A=a;a=c,c=A}Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{enumerable:!0,configurable:!0,value:{},writable:!0});var V=t[a];Object.defineProperty(V,c,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Yd(t,a,c){if(a>c){var A=a;a=c,c=A}return!!t[a]&&Object.prototype.hasOwnProperty.call(t[a],c)}function Vd(t,a,c,A){var V={},J={},it={};return Te(a,function(_t){Te(_t,function(Vt,se){V[Vt]=Vt,J[Vt]=Vt,it[Vt]=se})}),Te(a,function(_t){var Vt=-1;Te(_t,function(se){var ge=A(se);if(ge.length){ge=yi(ge,function(Ca){return it[Ca]});for(var Oe=(ge.length-1)/2,hr=Math.floor(Oe),Hr=Math.ceil(Oe);hr<=Hr;++hr){var Or=ge[hr];J[se]===se&&Vt<it[Or]&&!Yd(c,se,Or)&&(J[Or]=se,J[se]=V[se]=V[Or],Vt=it[Or])}}})}),{root:V,align:J}}function jd(t,a,c,A,V){var J={},it=Xd(t,a,c,V),_t=V?"borderLeft":"borderRight";function Vt(Oe,hr){for(var Hr=it.nodes(),Or=Hr.pop(),Ca={};Or;)Ca[Or]?Oe(Or):(Ca[Or]=!0,Hr.push(Or),Hr=Hr.concat(hr(Or))),Or=Hr.pop()}function se(Oe){J[Oe]=it.inEdges(Oe).reduce(function(hr,Hr){return Math.max(hr,J[Hr.v]+it.edge(Hr))},0)}function ge(Oe){var hr=it.outEdges(Oe).reduce(function(Or,Ca){return Math.min(Or,J[Ca.w]-it.edge(Ca))},Number.POSITIVE_INFINITY),Hr=t.node(Oe);hr!==Number.POSITIVE_INFINITY&&Hr.borderType!==_t&&(J[Oe]=Math.max(J[Oe],hr))}return Vt(se,it.predecessors.bind(it)),Vt(ge,it.successors.bind(it)),Te(A,function(Oe){J[Oe]=J[c[Oe]]}),J}function Xd(t,a,c,A){var V=new Nn,J=t.graph(),it=Kd(J.nodesep,J.edgesep,A);return Te(a,function(_t){var Vt;Te(_t,function(se){var ge=c[se];if(V.setNode(ge),Vt){var Oe=c[Vt],hr=V.edge(Oe,ge);V.setEdge(Oe,ge,Math.max(it(t,se,Vt),hr||0))}Vt=se})}),V}function qd(t,a){return Mo(Hn(a),function(c){var A=Number.NEGATIVE_INFINITY,V=Number.POSITIVE_INFINITY;return K1(c,function(J,it){var _t=Qd(t,it)/2;A=Math.max(J+_t,A),V=Math.min(J-_t,V)}),A-V})}function $d(t,a){var c=Hn(a),A=pi(c),V=$n(c);Te(["u","d"],function(J){Te(["l","r"],function(it){var _t=J+it,Vt=t[_t],se;if(Vt!==a){var ge=Hn(Vt);se=it==="l"?A-pi(ge):V-$n(ge),se&&(t[_t]=Ui(Vt,function(Oe){return Oe+se}))}})})}function Gd(t,a){return Ui(t.ul,function(c,A){if(a)return t[a.toLowerCase()][A];var V=yi(pn(t,A));return(V[1]+V[2])/2})}function Zd(t){var a=Vi(t),c=Eo(Hd(t,a),Wd(t,a)),A={},V;Te(["u","d"],function(it){V=it==="u"?a:Hn(a).reverse(),Te(["l","r"],function(_t){_t==="r"&&(V=pn(V,function(Oe){return Hn(Oe).reverse()}));var Vt=(it==="u"?t.predecessors:t.successors).bind(t),se=Vd(t,V,c,Vt),ge=jd(t,V,se.root,se.align,_t==="r");_t==="r"&&(ge=Ui(ge,function(Oe){return-Oe})),A[it+_t]=ge})});var J=qd(t,A);return $d(A,J),Gd(A,t.graph().align)}function Kd(t,a,c){return function(A,V,J){var it=A.node(V),_t=A.node(J),Vt=0,se;if(Vt+=it.width/2,Object.prototype.hasOwnProperty.call(it,"labelpos"))switch(it.labelpos.toLowerCase()){case"l":se=-it.width/2;break;case"r":se=it.width/2;break}if(se&&(Vt+=c?se:-se),se=0,Vt+=(it.dummy?a:t)/2,Vt+=(_t.dummy?a:t)/2,Vt+=_t.width/2,Object.prototype.hasOwnProperty.call(_t,"labelpos"))switch(_t.labelpos.toLowerCase()){case"l":se=_t.width/2;break;case"r":se=-_t.width/2;break}return se&&(Vt+=c?se:-se),se=0,Vt}}function Qd(t,a){return t.node(a).width}function Jd(t){t=Ll(t),tg(t),J1(Zd(t),function(a,c){t.node(c).x=a})}function tg(t){var a=Vi(t),c=t.graph().ranksep,A=0;Te(a,function(V){var J=$n(pn(V,function(it){return t.node(it).height}));Te(V,function(it){t.node(it).y=A+J/2}),A+=J+c})}function eg(t,a){var c=a&&a.debugTiming?Hv:Wv;c("layout",()=>{var A=c(" buildLayoutGraph",()=>ug(t));c(" runLayout",()=>rg(A,c)),c(" updateInputGraph",()=>ag(t,A))})}function rg(t,a){a(" makeSpaceForEdgeLabels",()=>vg(t)),a(" removeSelfEdges",()=>kg(t)),a(" acyclic",()=>Jv(t)),a(" nestingGraph.run",()=>md(t)),a(" rank",()=>dd(Ll(t))),a(" injectEdgeLabelProxies",()=>dg(t)),a(" removeEmptyRanks",()=>zv(t)),a(" nestingGraph.cleanup",()=>bd(t)),a(" normalizeRanks",()=>Rv(t)),a(" assignRankMinMax",()=>gg(t)),a(" removeEdgeLabelProxies",()=>pg(t)),a(" normalize.run",()=>rd(t)),a(" parentDummyChains",()=>Rd(t)),a(" addBorderSegments",()=>Uv(t)),a(" order",()=>Dd(t)),a(" insertSelfEdges",()=>Cg(t)),a(" adjustCoordinateSystem",()=>Yv(t)),a(" position",()=>Jd(t)),a(" positionSelfEdges",()=>Eg(t)),a(" removeBorderNodes",()=>xg(t)),a(" normalize.undo",()=>nd(t)),a(" fixupEdgeLabelCoords",()=>wg(t)),a(" undoCoordinateSystem",()=>Vv(t)),a(" translateGraph",()=>mg(t)),a(" assignNodeIntersects",()=>yg(t)),a(" reversePoints",()=>bg(t)),a(" acyclic.undo",()=>ed(t))}function ag(t,a){Te(t.nodes(),function(c){var A=t.node(c),V=a.node(c);A&&(A.x=V.x,A.y=V.y,a.children(c).length&&(A.width=V.width,A.height=V.height))}),Te(t.edges(),function(c){var A=t.edge(c),V=a.edge(c);A.points=V.points,Object.prototype.hasOwnProperty.call(V,"x")&&(A.x=V.x,A.y=V.y)}),t.graph().width=a.graph().width,t.graph().height=a.graph().height}var ng=["nodesep","edgesep","ranksep","marginx","marginy"],ig={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},og=["acyclicer","ranker","rankdir","align"],sg=["width","height"],lg={width:0,height:0},hg=["minlen","weight","width","height","labeloffset"],cg={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},fg=["labelpos"];function ug(t){var a=new Nn({multigraph:!0,compound:!0}),c=zo(t.graph());return a.setGraph(Eo({},ig,Ro(c,ng),Yi(c,og))),Te(t.nodes(),function(A){var V=zo(t.node(A));a.setNode(A,M1(Ro(V,sg),lg)),a.setParent(A,t.parent(A))}),Te(t.edges(),function(A){var V=zo(t.edge(A));a.setEdge(A,Eo({},cg,Ro(V,hg),Yi(V,fg)))}),a}function vg(t){var a=t.graph();a.ranksep/=2,Te(t.edges(),function(c){var A=t.edge(c);A.minlen*=2,A.labelpos.toLowerCase()!=="c"&&(a.rankdir==="TB"||a.rankdir==="BT"?A.width+=A.labeloffset:A.height+=A.labeloffset)})}function dg(t){Te(t.edges(),function(a){var c=t.edge(a);if(c.width&&c.height){var A=t.node(a.v),V=t.node(a.w),J={rank:(V.rank-A.rank)/2+A.rank,e:a};oi(t,"edge-proxy",J,"_ep")}})}function gg(t){var a=0;Te(t.nodes(),function(c){var A=t.node(c);A.borderTop&&(A.minRank=t.node(A.borderTop).rank,A.maxRank=t.node(A.borderBottom).rank,a=$n(a,A.maxRank))}),t.graph().maxRank=a}function pg(t){Te(t.nodes(),function(a){var c=t.node(a);c.dummy==="edge-proxy"&&(t.edge(c.e).labelRank=c.rank,t.removeNode(a))})}function mg(t){var a=Number.POSITIVE_INFINITY,c=0,A=Number.POSITIVE_INFINITY,V=0,J=t.graph(),it=J.marginx||0,_t=J.marginy||0;function Vt(se){var ge=se.x,Oe=se.y,hr=se.width,Hr=se.height;a=Math.min(a,ge-hr/2),c=Math.max(c,ge+hr/2),A=Math.min(A,Oe-Hr/2),V=Math.max(V,Oe+Hr/2)}Te(t.nodes(),function(se){Vt(t.node(se))}),Te(t.edges(),function(se){var ge=t.edge(se);Object.prototype.hasOwnProperty.call(ge,"x")&&Vt(ge)}),a-=it,A-=_t,Te(t.nodes(),function(se){var ge=t.node(se);ge.x-=a,ge.y-=A}),Te(t.edges(),function(se){var ge=t.edge(se);Te(ge.points,function(Oe){Oe.x-=a,Oe.y-=A}),Object.prototype.hasOwnProperty.call(ge,"x")&&(ge.x-=a),Object.prototype.hasOwnProperty.call(ge,"y")&&(ge.y-=A)}),J.width=c-a+it,J.height=V-A+_t}function yg(t){Te(t.edges(),function(a){var c=t.edge(a),A=t.node(a.v),V=t.node(a.w),J,it;c.points?(J=c.points[0],it=c.points[c.points.length-1]):(c.points=[],J=V,it=A),c.points.unshift(Fl(A,J)),c.points.push(Fl(V,it))})}function wg(t){Te(t.edges(),function(a){var c=t.edge(a);if(Object.prototype.hasOwnProperty.call(c,"x"))switch((c.labelpos==="l"||c.labelpos==="r")&&(c.width-=c.labeloffset),c.labelpos){case"l":c.x-=c.width/2+c.labeloffset;break;case"r":c.x+=c.width/2+c.labeloffset;break}})}function bg(t){Te(t.edges(),function(a){var c=t.edge(a);c.reversed&&c.points.reverse()})}function xg(t){Te(t.nodes(),function(a){if(t.children(a).length){var c=t.node(a),A=t.node(c.borderTop),V=t.node(c.borderBottom),J=t.node(Wi(c.borderLeft)),it=t.node(Wi(c.borderRight));c.width=Math.abs(it.x-J.x),c.height=Math.abs(V.y-A.y),c.x=J.x+c.width/2,c.y=A.y+c.height/2}}),Te(t.nodes(),function(a){t.node(a).dummy==="border"&&t.removeNode(a)})}function kg(t){Te(t.edges(),function(a){if(a.v===a.w){var c=t.node(a.v);c.selfEdges||(c.selfEdges=[]),c.selfEdges.push({e:a,label:t.edge(a)}),t.removeEdge(a)}})}function Cg(t){var a=Vi(t);Te(a,function(c){var A=0;Te(c,function(V,J){var it=t.node(V);it.order=J+A,Te(it.selfEdges,function(_t){oi(t,"selfedge",{width:_t.label.width,height:_t.label.height,rank:it.rank,order:J+ ++A,e:_t.e,label:_t.label},"_se")}),delete it.selfEdges})})}function Eg(t){Te(t.nodes(),function(a){var c=t.node(a);if(c.dummy==="selfedge"){var A=t.node(c.e.v),V=A.x+A.width/2,J=A.y,it=c.x-V,_t=A.height/2;t.setEdge(c.e,c.label),t.removeNode(a),c.label.points=[{x:V+2*it/3,y:J-_t},{x:V+5*it/6,y:J-_t},{x:V+it,y:J},{x:V+5*it/6,y:J+_t},{x:V+2*it/3,y:J+_t}],c.label.x=c.x,c.label.y=c.y}})}function Ro(t,a){return Ui(Yi(t,a),Number)}function zo(t){var a={};return Te(t,function(c,A){a[A.toLowerCase()]=c}),a}return s(o)})(),ih=Fg;var Gi={};(function(L,j){typeof exports=="object"&&typeof module=="object"?module.exports=j():typeof define=="function"&&define.amd?define([],j):typeof exports=="object"?exports.layoutBase=j():L.layoutBase=j()})(Gi,function(){return(function(L){var j={};function P(E){if(j[E])return j[E].exports;var w=j[E]={i:E,l:!1,exports:{}};return L[E].call(w.exports,w,w.exports,P),w.l=!0,w.exports}return P.m=L,P.c=j,P.i=function(E){return E},P.d=function(E,w,p){P.o(E,w)||Object.defineProperty(E,w,{configurable:!1,enumerable:!0,get:p})},P.n=function(E){var w=E&&E.__esModule?function(){return E.default}:function(){return E};return P.d(w,"a",w),w},P.o=function(E,w){return Object.prototype.hasOwnProperty.call(E,w)},P.p="",P(P.s=28)})([function(L,j,P){"use strict";function E(){}E.QUALITY=1,E.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,E.DEFAULT_INCREMENTAL=!1,E.DEFAULT_ANIMATION_ON_LAYOUT=!0,E.DEFAULT_ANIMATION_DURING_LAYOUT=!1,E.DEFAULT_ANIMATION_PERIOD=50,E.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,E.DEFAULT_GRAPH_MARGIN=15,E.NODE_DIMENSIONS_INCLUDE_LABELS=!1,E.SIMPLE_NODE_SIZE=40,E.SIMPLE_NODE_HALF_SIZE=E.SIMPLE_NODE_SIZE/2,E.EMPTY_COMPOUND_NODE_SIZE=40,E.MIN_EDGE_LENGTH=1,E.WORLD_BOUNDARY=1e6,E.INITIAL_WORLD_BOUNDARY=E.WORLD_BOUNDARY/1e3,E.WORLD_CENTER_X=1200,E.WORLD_CENTER_Y=900,L.exports=E},function(L,j,P){"use strict";var E=P(2),w=P(8),p=P(9);function s(d,M,f){E.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=d,this.target=M}for(var o in s.prototype=Object.create(E.prototype),E)s[o]=E[o];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(d){if(this.source===d)return this.target;if(this.target===d)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(d,M){for(var f=this.getOtherEnd(d),u=M.getGraphManager().getRoot();;){if(f.getOwner()==M)return f;if(f.getOwner()==u)break;f=f.getOwner().getParent()}return null},s.prototype.updateLength=function(){var d=new Array(4);this.isOverlapingSourceAndTarget=w.getIntersection(this.target.getRect(),this.source.getRect(),d),this.isOverlapingSourceAndTarget||(this.lengthX=d[0]-d[2],this.lengthY=d[1]-d[3],Math.abs(this.lengthX)<1&&(this.lengthX=p.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=p.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=p.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=p.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},L.exports=s},function(L,j,P){"use strict";L.exports=function(E){this.vGraphObject=E}},function(L,j,P){"use strict";var E=P(2),w=P(10),p=P(13),s=P(0),o=P(16),d=P(5);function M(u,r,h,v){h==null&&v==null&&(v=r),E.call(this,v),u.graphManager!=null&&(u=u.graphManager),this.estimatedSize=w.MIN_VALUE,this.inclusionTreeDepth=w.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=u,this.rect=h!=null&&r!=null?new p(r.x,r.y,h.width,h.height):new p}for(var f in M.prototype=Object.create(E.prototype),E)M[f]=E[f];M.prototype.getEdges=function(){return this.edges},M.prototype.getChild=function(){return this.child},M.prototype.getOwner=function(){return this.owner},M.prototype.getWidth=function(){return this.rect.width},M.prototype.setWidth=function(u){this.rect.width=u},M.prototype.getHeight=function(){return this.rect.height},M.prototype.setHeight=function(u){this.rect.height=u},M.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},M.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},M.prototype.getCenter=function(){return new d(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},M.prototype.getLocation=function(){return new d(this.rect.x,this.rect.y)},M.prototype.getRect=function(){return this.rect},M.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},M.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},M.prototype.setRect=function(u,r){this.rect.x=u.x,this.rect.y=u.y,this.rect.width=r.width,this.rect.height=r.height},M.prototype.setCenter=function(u,r){this.rect.x=u-this.rect.width/2,this.rect.y=r-this.rect.height/2},M.prototype.setLocation=function(u,r){this.rect.x=u,this.rect.y=r},M.prototype.moveBy=function(u,r){this.rect.x+=u,this.rect.y+=r},M.prototype.getEdgeListToNode=function(u){var r=[],h=this;return h.edges.forEach(function(v){if(v.target==u){if(v.source!=h)throw"Incorrect edge source!";r.push(v)}}),r},M.prototype.getEdgesBetween=function(u){var r=[],h=this;return h.edges.forEach(function(v){if(v.source!=h&&v.target!=h)throw"Incorrect edge source and/or target";v.target!=u&&v.source!=u||r.push(v)}),r},M.prototype.getNeighborsList=function(){var u=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)u.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";u.add(h.source)}}),u},M.prototype.withChildren=function(){var u=new Set;if(u.add(this),this.child!=null)for(var r=this.child.getNodes(),h=0;h<r.length;h++)r[h].withChildren().forEach(function(v){u.add(v)});return u},M.prototype.getNoOfChildren=function(){var u=0;if(this.child==null)u=1;else for(var r=this.child.getNodes(),h=0;h<r.length;h++)u+=r[h].getNoOfChildren();return u==0&&(u=1),u},M.prototype.getEstimatedSize=function(){if(this.estimatedSize==w.MIN_VALUE)throw"assert failed";return this.estimatedSize},M.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},M.prototype.scatter=function(){var u,r,h=-s.INITIAL_WORLD_BOUNDARY,v=s.INITIAL_WORLD_BOUNDARY;u=s.WORLD_CENTER_X+o.nextDouble()*(v-h)+h;var n=-s.INITIAL_WORLD_BOUNDARY,y=s.INITIAL_WORLD_BOUNDARY;r=s.WORLD_CENTER_Y+o.nextDouble()*(y-n)+n,this.rect.x=u,this.rect.y=r},M.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var u=this.getChild();if(u.updateBounds(!0),this.rect.x=u.getLeft(),this.rect.y=u.getTop(),this.setWidth(u.getRight()-u.getLeft()),this.setHeight(u.getBottom()-u.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var r=u.getRight()-u.getLeft(),h=u.getBottom()-u.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(r+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>r?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},M.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==w.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},M.prototype.transform=function(u){var r=this.rect.x;r>s.WORLD_BOUNDARY?r=s.WORLD_BOUNDARY:r<-s.WORLD_BOUNDARY&&(r=-s.WORLD_BOUNDARY);var h=this.rect.y;h>s.WORLD_BOUNDARY?h=s.WORLD_BOUNDARY:h<-s.WORLD_BOUNDARY&&(h=-s.WORLD_BOUNDARY);var v=new d(r,h),n=u.inverseTransformPoint(v);this.setLocation(n.x,n.y)},M.prototype.getLeft=function(){return this.rect.x},M.prototype.getRight=function(){return this.rect.x+this.rect.width},M.prototype.getTop=function(){return this.rect.y},M.prototype.getBottom=function(){return this.rect.y+this.rect.height},M.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},L.exports=M},function(L,j,P){"use strict";var E=P(0);function w(){}for(var p in E)w[p]=E[p];w.MAX_ITERATIONS=2500,w.DEFAULT_EDGE_LENGTH=50,w.DEFAULT_SPRING_STRENGTH=.45,w.DEFAULT_REPULSION_STRENGTH=4500,w.DEFAULT_GRAVITY_STRENGTH=.4,w.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,w.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,w.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,w.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,w.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,w.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,w.COOLING_ADAPTATION_FACTOR=.33,w.ADAPTATION_LOWER_NODE_LIMIT=1e3,w.ADAPTATION_UPPER_NODE_LIMIT=5e3,w.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,w.MAX_NODE_DISPLACEMENT=3*w.MAX_NODE_DISPLACEMENT_INCREMENTAL,w.MIN_REPULSION_DIST=w.DEFAULT_EDGE_LENGTH/10,w.CONVERGENCE_CHECK_PERIOD=100,w.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,w.MIN_EDGE_LENGTH=1,w.GRID_CALCULATION_CHECK_PERIOD=10,L.exports=w},function(L,j,P){"use strict";function E(w,p){w==null&&p==null?(this.x=0,this.y=0):(this.x=w,this.y=p)}E.prototype.getX=function(){return this.x},E.prototype.getY=function(){return this.y},E.prototype.setX=function(w){this.x=w},E.prototype.setY=function(w){this.y=w},E.prototype.getDifference=function(w){return new DimensionD(this.x-w.x,this.y-w.y)},E.prototype.getCopy=function(){return new E(this.x,this.y)},E.prototype.translate=function(w){return this.x+=w.width,this.y+=w.height,this},L.exports=E},function(L,j,P){"use strict";var E=P(2),w=P(10),p=P(0),s=P(7),o=P(3),d=P(1),M=P(13),f=P(12),u=P(11);function r(v,n,y){E.call(this,y),this.estimatedSize=w.MIN_VALUE,this.margin=p.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,n!=null&&n instanceof s?this.graphManager=n:n!=null&&n instanceof Layout&&(this.graphManager=n.graphManager)}for(var h in r.prototype=Object.create(E.prototype),E)r[h]=E[h];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(v,n,y){if(n==null&&y==null){var b=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}var T=v;if(!(this.getNodes().indexOf(n)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(n.owner!=y.owner||n.owner!=this)throw"Both owners must be this graph!";return n.owner!=y.owner?null:(T.source=n,T.target=y,T.isInterGraph=!1,this.getEdges().push(T),n.edges.push(T),y!=n&&y.edges.push(T),T)},r.prototype.remove=function(v){var n=v;if(v instanceof o){if(n==null)throw"Node is null!";if(n.owner==null||n.owner!=this)throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=n.edges.slice(),b=y.length,T=0;T<b;T++)(I=y[T]).isInterGraph?this.graphManager.remove(I):I.source.owner.remove(I);if((F=this.nodes.indexOf(n))==-1)throw"Node not in owner node list!";this.nodes.splice(F,1)}else if(v instanceof d){var I;if((I=v)==null)throw"Edge is null!";if(I.source==null||I.target==null)throw"Source and/or target is null!";if(I.source.owner==null||I.target.owner==null||I.source.owner!=this||I.target.owner!=this)throw"Source and/or target owner is invalid!";var F,X=I.source.edges.indexOf(I),K=I.target.edges.indexOf(I);if(!(X>-1&&K>-1))throw"Source and/or target doesn't know this edge!";if(I.source.edges.splice(X,1),I.target!=I.source&&I.target.edges.splice(K,1),(F=I.source.owner.getEdges().indexOf(I))==-1)throw"Not in owner's edge list!";I.source.owner.getEdges().splice(F,1)}},r.prototype.updateLeftTop=function(){for(var v,n,y,b=w.MAX_VALUE,T=w.MAX_VALUE,I=this.getNodes(),F=I.length,X=0;X<F;X++){var K=I[X];b>(v=K.getTop())&&(b=v),T>(n=K.getLeft())&&(T=n)}return b==w.MAX_VALUE?null:(y=I[0].getParent().paddingLeft!=null?I[0].getParent().paddingLeft:this.margin,this.left=T-y,this.top=b-y,new f(this.left,this.top))},r.prototype.updateBounds=function(v){for(var n,y,b,T,I,F=w.MAX_VALUE,X=-w.MAX_VALUE,K=w.MAX_VALUE,ot=-w.MAX_VALUE,pt=this.nodes,xt=pt.length,ee=0;ee<xt;ee++){var N=pt[ee];v&&N.child!=null&&N.updateBounds(),F>(n=N.getLeft())&&(F=n),X<(y=N.getRight())&&(X=y),K>(b=N.getTop())&&(K=b),ot<(T=N.getBottom())&&(ot=T)}var Q=new M(F,K,X-F,ot-K);F==w.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),I=pt[0].getParent().paddingLeft!=null?pt[0].getParent().paddingLeft:this.margin,this.left=Q.x-I,this.right=Q.x+Q.width+I,this.top=Q.y-I,this.bottom=Q.y+Q.height+I},r.calculateBounds=function(v){for(var n,y,b,T,I=w.MAX_VALUE,F=-w.MAX_VALUE,X=w.MAX_VALUE,K=-w.MAX_VALUE,ot=v.length,pt=0;pt<ot;pt++){var xt=v[pt];I>(n=xt.getLeft())&&(I=n),F<(y=xt.getRight())&&(F=y),X>(b=xt.getTop())&&(X=b),K<(T=xt.getBottom())&&(K=T)}return new M(I,X,F-I,K-X)},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==w.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var v=0,n=this.nodes,y=n.length,b=0;b<y;b++)v+=n[b].calcEstimatedSize();return this.estimatedSize=v==0?p.EMPTY_COMPOUND_NODE_SIZE:v/Math.sqrt(this.nodes.length),this.estimatedSize},r.prototype.updateConnected=function(){var v=this;if(this.nodes.length!=0){var n,y,b=new u,T=new Set,I=this.nodes[0];for(I.withChildren().forEach(function(ot){b.push(ot),T.add(ot)});b.length!==0;)for(var F=(n=(I=b.shift()).getEdges()).length,X=0;X<F;X++)(y=n[X].getOtherEndInGraph(I,this))!=null&&!T.has(y)&&y.withChildren().forEach(function(ot){b.push(ot),T.add(ot)});if(this.isConnected=!1,T.size>=this.nodes.length){var K=0;T.forEach(function(ot){ot.owner==v&&K++}),K==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},L.exports=r},function(L,j,P){"use strict";var E,w=P(1);function p(s){E=P(6),this.layout=s,this.graphs=[],this.edges=[]}p.prototype.addRoot=function(){var s=this.layout.newGraph(),o=this.layout.newNode(null),d=this.add(s,o);return this.setRootGraph(d),this.rootGraph},p.prototype.add=function(s,o,d,M,f){if(d==null&&M==null&&f==null){if(s==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return s.parent=o,o.child=s,s}f=d,d=s;var u=(M=o).getOwner(),r=f.getOwner();if(u==null||u.getGraphManager()!=this)throw"Source not in this graph mgr!";if(r==null||r.getGraphManager()!=this)throw"Target not in this graph mgr!";if(u==r)return d.isInterGraph=!1,u.add(d,M,f);if(d.isInterGraph=!0,d.source=M,d.target=f,this.edges.indexOf(d)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(d),d.source==null||d.target==null)throw"Edge source and/or target is null!";if(d.source.edges.indexOf(d)!=-1||d.target.edges.indexOf(d)!=-1)throw"Edge already in source and/or target incidency list!";return d.source.edges.push(d),d.target.edges.push(d),d},p.prototype.remove=function(s){if(s instanceof E){var o=s;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(o!=this.rootGraph&&(o.parent==null||o.parent.graphManager!=this))throw"Invalid parent node!";for(var d,M=[],f=(M=M.concat(o.getEdges())).length,u=0;u<f;u++)d=M[u],o.remove(d);var r,h=[];for(f=(h=h.concat(o.getNodes())).length,u=0;u<f;u++)r=h[u],o.remove(r);o==this.rootGraph&&this.setRootGraph(null);var v=this.graphs.indexOf(o);this.graphs.splice(v,1),o.parent=null}else if(s instanceof w){if((d=s)==null)throw"Edge is null!";if(!d.isInterGraph)throw"Not an inter-graph edge!";if(d.source==null||d.target==null)throw"Source and/or target is null!";if(d.source.edges.indexOf(d)==-1||d.target.edges.indexOf(d)==-1)throw"Source and/or target doesn't know this edge!";if(v=d.source.edges.indexOf(d),d.source.edges.splice(v,1),v=d.target.edges.indexOf(d),d.target.edges.splice(v,1),d.source.owner==null||d.source.owner.getGraphManager()==null)throw"Edge owner graph or owner graph manager is null!";if(d.source.owner.getGraphManager().edges.indexOf(d)==-1)throw"Not in owner graph manager's edge list!";v=d.source.owner.getGraphManager().edges.indexOf(d),d.source.owner.getGraphManager().edges.splice(v,1)}},p.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},p.prototype.getGraphs=function(){return this.graphs},p.prototype.getAllNodes=function(){if(this.allNodes==null){for(var s=[],o=this.getGraphs(),d=o.length,M=0;M<d;M++)s=s.concat(o[M].getNodes());this.allNodes=s}return this.allNodes},p.prototype.resetAllNodes=function(){this.allNodes=null},p.prototype.resetAllEdges=function(){this.allEdges=null},p.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},p.prototype.getAllEdges=function(){if(this.allEdges==null){for(var s=[],o=this.getGraphs(),d=(o.length,0);d<o.length;d++)s=s.concat(o[d].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},p.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},p.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},p.prototype.getRoot=function(){return this.rootGraph},p.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=s,s.parent==null&&(s.parent=this.layout.newNode("Root node"))},p.prototype.getLayout=function(){return this.layout},p.prototype.isOneAncestorOfOther=function(s,o){if(s==null||o==null)throw"assert failed";if(s==o)return!0;for(var d,M=s.getOwner();(d=M.getParent())!=null;){if(d==o)return!0;if((M=d.getOwner())==null)break}for(M=o.getOwner();(d=M.getParent())!=null;){if(d==s)return!0;if((M=d.getOwner())==null)break}return!1},p.prototype.calcLowestCommonAncestors=function(){for(var s,o,d,M,f,u=this.getAllEdges(),r=u.length,h=0;h<r;h++)if(o=(s=u[h]).source,d=s.target,s.lca=null,s.sourceInLca=o,s.targetInLca=d,o!=d){for(M=o.getOwner();s.lca==null;){for(s.targetInLca=d,f=d.getOwner();s.lca==null;){if(f==M){s.lca=f;break}if(f==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=f.getParent(),f=s.targetInLca.getOwner()}if(M==this.rootGraph)break;s.lca==null&&(s.sourceInLca=M.getParent(),M=s.sourceInLca.getOwner())}if(s.lca==null)throw"assert failed"}else s.lca=o.getOwner()},p.prototype.calcLowestCommonAncestor=function(s,o){if(s==o)return s.getOwner();for(var d=s.getOwner();d!=null;){for(var M=o.getOwner();M!=null;){if(M==d)return M;M=M.getParent().getOwner()}d=d.getParent().getOwner()}return d},p.prototype.calcInclusionTreeDepths=function(s,o){var d;s==null&&o==null&&(s=this.rootGraph,o=1);for(var M=s.getNodes(),f=M.length,u=0;u<f;u++)(d=M[u]).inclusionTreeDepth=o,d.child!=null&&this.calcInclusionTreeDepths(d.child,o+1)},p.prototype.includesInvalidEdge=function(){for(var s,o=[],d=this.edges.length,M=0;M<d;M++)s=this.edges[M],this.isOneAncestorOfOther(s.source,s.target)&&o.push(s);for(M=0;M<o.length;M++)this.remove(o[M]);return!1},L.exports=p},function(L,j,P){"use strict";var E=P(12);function w(){}w.calcSeparationAmount=function(p,s,o,d){if(!p.intersects(s))throw"assert failed";var M=new Array(2);this.decideDirectionsForOverlappingNodes(p,s,M),o[0]=Math.min(p.getRight(),s.getRight())-Math.max(p.x,s.x),o[1]=Math.min(p.getBottom(),s.getBottom())-Math.max(p.y,s.y),p.getX()<=s.getX()&&p.getRight()>=s.getRight()?o[0]+=Math.min(s.getX()-p.getX(),p.getRight()-s.getRight()):s.getX()<=p.getX()&&s.getRight()>=p.getRight()&&(o[0]+=Math.min(p.getX()-s.getX(),s.getRight()-p.getRight())),p.getY()<=s.getY()&&p.getBottom()>=s.getBottom()?o[1]+=Math.min(s.getY()-p.getY(),p.getBottom()-s.getBottom()):s.getY()<=p.getY()&&s.getBottom()>=p.getBottom()&&(o[1]+=Math.min(p.getY()-s.getY(),s.getBottom()-p.getBottom()));var f=Math.abs((s.getCenterY()-p.getCenterY())/(s.getCenterX()-p.getCenterX()));s.getCenterY()===p.getCenterY()&&s.getCenterX()===p.getCenterX()&&(f=1);var u=f*o[0],r=o[1]/f;o[0]<r?r=o[0]:u=o[1],o[0]=-1*M[0]*(r/2+d),o[1]=-1*M[1]*(u/2+d)},w.decideDirectionsForOverlappingNodes=function(p,s,o){p.getCenterX()<s.getCenterX()?o[0]=-1:o[0]=1,p.getCenterY()<s.getCenterY()?o[1]=-1:o[1]=1},w.getIntersection2=function(p,s,o){var d=p.getCenterX(),M=p.getCenterY(),f=s.getCenterX(),u=s.getCenterY();if(p.intersects(s))return o[0]=d,o[1]=M,o[2]=f,o[3]=u,!0;var r=p.getX(),h=p.getY(),v=p.getRight(),n=p.getX(),y=p.getBottom(),b=p.getRight(),T=p.getWidthHalf(),I=p.getHeightHalf(),F=s.getX(),X=s.getY(),K=s.getRight(),ot=s.getX(),pt=s.getBottom(),xt=s.getRight(),ee=s.getWidthHalf(),N=s.getHeightHalf(),Q=!1,at=!1;if(d===f){if(M>u)return o[0]=d,o[1]=h,o[2]=f,o[3]=pt,!1;if(M<u)return o[0]=d,o[1]=y,o[2]=f,o[3]=X,!1}else if(M===u){if(d>f)return o[0]=r,o[1]=M,o[2]=K,o[3]=u,!1;if(d<f)return o[0]=v,o[1]=M,o[2]=F,o[3]=u,!1}else{var _=p.height/p.width,l=s.height/s.width,O=(u-M)/(f-d),z=void 0,lt=void 0,W=void 0,gt=void 0,mt=void 0,Tt=void 0;if(-_===O?d>f?(o[0]=n,o[1]=y,Q=!0):(o[0]=v,o[1]=h,Q=!0):_===O&&(d>f?(o[0]=r,o[1]=h,Q=!0):(o[0]=b,o[1]=y,Q=!0)),-l===O?f>d?(o[2]=ot,o[3]=pt,at=!0):(o[2]=K,o[3]=X,at=!0):l===O&&(f>d?(o[2]=F,o[3]=X,at=!0):(o[2]=xt,o[3]=pt,at=!0)),Q&&at)return!1;if(d>f?M>u?(z=this.getCardinalDirection(_,O,4),lt=this.getCardinalDirection(l,O,2)):(z=this.getCardinalDirection(-_,O,3),lt=this.getCardinalDirection(-l,O,1)):M>u?(z=this.getCardinalDirection(-_,O,1),lt=this.getCardinalDirection(-l,O,3)):(z=this.getCardinalDirection(_,O,2),lt=this.getCardinalDirection(l,O,4)),!Q)switch(z){case 1:gt=h,W=d+-I/O,o[0]=W,o[1]=gt;break;case 2:W=b,gt=M+T*O,o[0]=W,o[1]=gt;break;case 3:gt=y,W=d+I/O,o[0]=W,o[1]=gt;break;case 4:W=n,gt=M+-T*O,o[0]=W,o[1]=gt}if(!at)switch(lt){case 1:Tt=X,mt=f+-N/O,o[2]=mt,o[3]=Tt;break;case 2:mt=xt,Tt=u+ee*O,o[2]=mt,o[3]=Tt;break;case 3:Tt=pt,mt=f+N/O,o[2]=mt,o[3]=Tt;break;case 4:mt=ot,Tt=u+-ee*O,o[2]=mt,o[3]=Tt}}return!1},w.getCardinalDirection=function(p,s,o){return p>s?o:1+o%4},w.getIntersection=function(p,s,o,d){if(d==null)return this.getIntersection2(p,s,o);var M,f,u,r,h,v,n,y=p.x,b=p.y,T=s.x,I=s.y,F=o.x,X=o.y,K=d.x,ot=d.y;return(n=(M=I-b)*(r=F-K)-(f=ot-X)*(u=y-T))===0?null:new E((u*(v=K*X-F*ot)-r*(h=T*b-y*I))/n,(f*h-M*v)/n)},w.angleOfVector=function(p,s,o,d){var M=void 0;return p!==o?(M=Math.atan((d-s)/(o-p)),o<p?M+=Math.PI:d<s&&(M+=this.TWO_PI)):M=d<s?this.ONE_AND_HALF_PI:this.HALF_PI,M},w.doIntersect=function(p,s,o,d){var M=p.x,f=p.y,u=s.x,r=s.y,h=o.x,v=o.y,n=d.x,y=d.y,b=(u-M)*(y-v)-(n-h)*(r-f);if(b===0)return!1;var T=((y-v)*(n-M)+(h-n)*(y-f))/b,I=((f-r)*(n-M)+(u-M)*(y-f))/b;return 0<T&&T<1&&0<I&&I<1},w.findCircleLineIntersections=function(p,s,o,d,M,f,u){var r=(o-p)*(o-p)+(d-s)*(d-s),h=2*((p-M)*(o-p)+(s-f)*(d-s)),v=(p-M)*(p-M)+(s-f)*(s-f)-u*u;if(h*h-4*r*v>=0){var n=(-h+Math.sqrt(h*h-4*r*v))/(2*r),y=(-h-Math.sqrt(h*h-4*r*v))/(2*r);return n>=0&&n<=1?[n]:y>=0&&y<=1?[y]:null}return null},w.HALF_PI=.5*Math.PI,w.ONE_AND_HALF_PI=1.5*Math.PI,w.TWO_PI=2*Math.PI,w.THREE_PI=3*Math.PI,L.exports=w},function(L,j,P){"use strict";function E(){}E.sign=function(w){return w>0?1:w<0?-1:0},E.floor=function(w){return w<0?Math.ceil(w):Math.floor(w)},E.ceil=function(w){return w<0?Math.floor(w):Math.ceil(w)},L.exports=E},function(L,j,P){"use strict";function E(){}E.MAX_VALUE=2147483647,E.MIN_VALUE=-2147483648,L.exports=E},function(L,j,P){"use strict";var E=(function(){function d(M,f){for(var u=0;u<f.length;u++){var r=f[u];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(M,r.key,r)}}return function(M,f,u){return f&&d(M.prototype,f),u&&d(M,u),M}})(),w=function(d){return{value:d,next:null,prev:null}},p=function(d,M,f,u){return d!==null?d.next=M:u.head=M,f!==null?f.prev=M:u.tail=M,M.prev=d,M.next=f,u.length++,M},s=function(d,M){var f=d.prev,u=d.next;return f!==null?f.next=u:M.head=u,u!==null?u.prev=f:M.tail=f,d.prev=d.next=null,M.length--,d},o=(function(){function d(M){var f=this;(function(u,r){if(!(u instanceof r))throw new TypeError("Cannot call a class as a function")})(this,d),this.length=0,this.head=null,this.tail=null,M!=null&&M.forEach(function(u){return f.push(u)})}return E(d,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(M,f){return p(f.prev,w(M),f,this)}},{key:"insertAfter",value:function(M,f){return p(f,w(M),f.next,this)}},{key:"insertNodeBefore",value:function(M,f){return p(f.prev,M,f,this)}},{key:"insertNodeAfter",value:function(M,f){return p(f,M,f.next,this)}},{key:"push",value:function(M){return p(this.tail,w(M),null,this)}},{key:"unshift",value:function(M){return p(null,w(M),this.head,this)}},{key:"remove",value:function(M){return s(M,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(M){if(M<=this.length()){for(var f=1,u=this.head;f<M;)u=u.next,f++;return u.value}}},{key:"set_object_at",value:function(M,f){if(M<=this.length()){for(var u=1,r=this.head;u<M;)r=r.next,u++;r.value=f}}}]),d})();L.exports=o},function(L,j,P){"use strict";function E(w,p,s){this.x=null,this.y=null,w==null&&p==null&&s==null?(this.x=0,this.y=0):typeof w=="number"&&typeof p=="number"&&s==null?(this.x=w,this.y=p):w.constructor.name=="Point"&&p==null&&s==null&&(s=w,this.x=s.x,this.y=s.y)}E.prototype.getX=function(){return this.x},E.prototype.getY=function(){return this.y},E.prototype.getLocation=function(){return new E(this.x,this.y)},E.prototype.setLocation=function(w,p,s){w.constructor.name=="Point"&&p==null&&s==null?(s=w,this.setLocation(s.x,s.y)):typeof w=="number"&&typeof p=="number"&&s==null&&(parseInt(w)==w&&parseInt(p)==p?this.move(w,p):(this.x=Math.floor(w+.5),this.y=Math.floor(p+.5)))},E.prototype.move=function(w,p){this.x=w,this.y=p},E.prototype.translate=function(w,p){this.x+=w,this.y+=p},E.prototype.equals=function(w){if(w.constructor.name=="Point"){var p=w;return this.x==p.x&&this.y==p.y}return this==w},E.prototype.toString=function(){return new E().constructor.name+"[x="+this.x+",y="+this.y+"]"},L.exports=E},function(L,j,P){"use strict";function E(w,p,s,o){this.x=0,this.y=0,this.width=0,this.height=0,w!=null&&p!=null&&s!=null&&o!=null&&(this.x=w,this.y=p,this.width=s,this.height=o)}E.prototype.getX=function(){return this.x},E.prototype.setX=function(w){this.x=w},E.prototype.getY=function(){return this.y},E.prototype.setY=function(w){this.y=w},E.prototype.getWidth=function(){return this.width},E.prototype.setWidth=function(w){this.width=w},E.prototype.getHeight=function(){return this.height},E.prototype.setHeight=function(w){this.height=w},E.prototype.getRight=function(){return this.x+this.width},E.prototype.getBottom=function(){return this.y+this.height},E.prototype.intersects=function(w){return!(this.getRight()<w.x)&&!(this.getBottom()<w.y)&&!(w.getRight()<this.x)&&!(w.getBottom()<this.y)},E.prototype.getCenterX=function(){return this.x+this.width/2},E.prototype.getMinX=function(){return this.getX()},E.prototype.getMaxX=function(){return this.getX()+this.width},E.prototype.getCenterY=function(){return this.y+this.height/2},E.prototype.getMinY=function(){return this.getY()},E.prototype.getMaxY=function(){return this.getY()+this.height},E.prototype.getWidthHalf=function(){return this.width/2},E.prototype.getHeightHalf=function(){return this.height/2},L.exports=E},function(L,j,P){"use strict";var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p};function w(){}w.lastID=0,w.createID=function(p){return w.isPrimitive(p)?p:(p.uniqueID!=null||(p.uniqueID=w.getString(),w.lastID++),p.uniqueID)},w.getString=function(p){return p==null&&(p=w.lastID),"Object#"+p},w.isPrimitive=function(p){var s=p===void 0?"undefined":E(p);return p==null||s!="object"&&s!="function"},L.exports=w},function(L,j,P){"use strict";function E(h){if(Array.isArray(h)){for(var v=0,n=Array(h.length);v<h.length;v++)n[v]=h[v];return n}return Array.from(h)}var w=P(0),p=P(7),s=P(3),o=P(1),d=P(6),M=P(5),f=P(17),u=P(29);function r(h){u.call(this),this.layoutQuality=w.QUALITY,this.createBendsAsNeeded=w.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=w.DEFAULT_INCREMENTAL,this.animationOnLayout=w.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=w.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=w.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=w.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new p(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,h!=null&&(this.isRemoteUse=h)}r.RANDOM_SEED=1,r.prototype=Object.create(u.prototype),r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},r.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},r.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},r.prototype.newGraphManager=function(){var h=new p(this);return this.graphManager=h,h},r.prototype.newGraph=function(h){return new d(null,this.graphManager,h)},r.prototype.newNode=function(h){return new s(this.graphManager,h)},r.prototype.newEdge=function(h){return new o(null,null,h)},r.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},r.prototype.runLayout=function(){var h;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),h=!this.checkLayoutSuccess()&&this.layout(),w.ANIMATE!=="during"&&(h&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,h)},r.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},r.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var h=this.graphManager.getAllEdges(),v=0;v<h.length;v++)h[v];var n=this.graphManager.getRoot().getNodes();for(v=0;v<n.length;v++)n[v];this.update(this.graphManager.getRoot())}},r.prototype.update=function(h){if(h==null)this.update2();else if(h instanceof s){var v=h;if(v.getChild()!=null)for(var n=v.getChild().getNodes(),y=0;y<n.length;y++)update(n[y]);v.vGraphObject!=null&&v.vGraphObject.update(v)}else if(h instanceof o){var b=h;b.vGraphObject!=null&&b.vGraphObject.update(b)}else if(h instanceof d){var T=h;T.vGraphObject!=null&&T.vGraphObject.update(T)}},r.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=w.QUALITY,this.animationDuringLayout=w.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=w.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=w.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=w.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=w.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=w.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},r.prototype.transform=function(h){if(h==null)this.transform(new M(0,0));else{var v=new f,n=this.graphManager.getRoot().updateLeftTop();if(n!=null){v.setWorldOrgX(h.x),v.setWorldOrgY(h.y),v.setDeviceOrgX(n.x),v.setDeviceOrgY(n.y);for(var y=this.getAllNodes(),b=0;b<y.length;b++)y[b].transform(v)}}},r.prototype.positionNodesRandomly=function(h){if(h==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var v,n,y=h.getNodes(),b=0;b<y.length;b++)(n=(v=y[b]).getChild())==null||n.getNodes().length==0?v.scatter():(this.positionNodesRandomly(n),v.updateBounds())},r.prototype.getFlatForest=function(){for(var h=[],v=!0,n=this.graphManager.getRoot().getNodes(),y=!0,b=0;b<n.length;b++)n[b].getChild()!=null&&(y=!1);if(!y)return h;var T=new Set,I=[],F=new Map,X=[];for(X=X.concat(n);X.length>0&&v;){for(I.push(X[0]);I.length>0&&v;){var K=I[0];I.splice(0,1),T.add(K);var ot=K.getEdges();for(b=0;b<ot.length;b++){var pt=ot[b].getOtherEnd(K);if(F.get(K)!=pt){if(T.has(pt)){v=!1;break}I.push(pt),F.set(pt,K)}}}if(v){var xt=[].concat(E(T));for(h.push(xt),b=0;b<xt.length;b++){var ee=xt[b],N=X.indexOf(ee);N>-1&&X.splice(N,1)}T=new Set,F=new Map}else h=[]}return h},r.prototype.createDummyNodesForBendpoints=function(h){for(var v=[],n=h.source,y=this.graphManager.calcLowestCommonAncestor(h.source,h.target),b=0;b<h.bendpoints.length;b++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),y.add(T);var I=this.newEdge(null);this.graphManager.add(I,n,T),v.add(T),n=T}return I=this.newEdge(null),this.graphManager.add(I,n,h.target),this.edgeToDummyNodes.set(h,v),h.isInterGraph()?this.graphManager.remove(h):y.remove(h),v},r.prototype.createBendpointsFromDummyNodes=function(){var h=[];h=h.concat(this.graphManager.getAllEdges()),h=[].concat(E(this.edgeToDummyNodes.keys())).concat(h);for(var v=0;v<h.length;v++){var n=h[v];if(n.bendpoints.length>0){for(var y=this.edgeToDummyNodes.get(n),b=0;b<y.length;b++){var T=y[b],I=new M(T.getCenterX(),T.getCenterY()),F=n.bendpoints.get(b);F.x=I.x,F.y=I.y,T.getOwner().remove(T)}this.graphManager.add(n,n.source,n.target)}}},r.transform=function(h,v,n,y){if(n!=null&&y!=null){var b=v;return h<=50?b-=(v-v/n)/50*(50-h):b+=(v*y-v)/50*(h-50),b}var T,I;return h<=50?(T=9*v/500,I=v/10):(T=9*v/50,I=-8*v),T*h+I},r.findCenterOfTree=function(h){var v=[];v=v.concat(h);var n=[],y=new Map,b=!1,T=null;v.length!=1&&v.length!=2||(b=!0,T=v[0]);for(var I=0;I<v.length;I++){var F=(ot=v[I]).getNeighborsList().size;y.set(ot,ot.getNeighborsList().size),F==1&&n.push(ot)}var X=[];for(X=X.concat(n);!b;){var K=[];for(K=K.concat(X),X=[],I=0;I<v.length;I++){var ot=v[I],pt=v.indexOf(ot);pt>=0&&v.splice(pt,1),ot.getNeighborsList().forEach(function(xt){if(n.indexOf(xt)<0){var ee=y.get(xt)-1;ee==1&&X.push(xt),y.set(xt,ee)}})}n=n.concat(X),v.length!=1&&v.length!=2||(b=!0,T=v[0])}return T},r.prototype.setGraphManager=function(h){this.graphManager=h},L.exports=r},function(L,j,P){"use strict";function E(){}E.seed=1,E.x=0,E.nextDouble=function(){return E.x=1e4*Math.sin(E.seed++),E.x-Math.floor(E.x)},L.exports=E},function(L,j,P){"use strict";var E=P(5);function w(p,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}w.prototype.getWorldOrgX=function(){return this.lworldOrgX},w.prototype.setWorldOrgX=function(p){this.lworldOrgX=p},w.prototype.getWorldOrgY=function(){return this.lworldOrgY},w.prototype.setWorldOrgY=function(p){this.lworldOrgY=p},w.prototype.getWorldExtX=function(){return this.lworldExtX},w.prototype.setWorldExtX=function(p){this.lworldExtX=p},w.prototype.getWorldExtY=function(){return this.lworldExtY},w.prototype.setWorldExtY=function(p){this.lworldExtY=p},w.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},w.prototype.setDeviceOrgX=function(p){this.ldeviceOrgX=p},w.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},w.prototype.setDeviceOrgY=function(p){this.ldeviceOrgY=p},w.prototype.getDeviceExtX=function(){return this.ldeviceExtX},w.prototype.setDeviceExtX=function(p){this.ldeviceExtX=p},w.prototype.getDeviceExtY=function(){return this.ldeviceExtY},w.prototype.setDeviceExtY=function(p){this.ldeviceExtY=p},w.prototype.transformX=function(p){var s=0,o=this.lworldExtX;return o!=0&&(s=this.ldeviceOrgX+(p-this.lworldOrgX)*this.ldeviceExtX/o),s},w.prototype.transformY=function(p){var s=0,o=this.lworldExtY;return o!=0&&(s=this.ldeviceOrgY+(p-this.lworldOrgY)*this.ldeviceExtY/o),s},w.prototype.inverseTransformX=function(p){var s=0,o=this.ldeviceExtX;return o!=0&&(s=this.lworldOrgX+(p-this.ldeviceOrgX)*this.lworldExtX/o),s},w.prototype.inverseTransformY=function(p){var s=0,o=this.ldeviceExtY;return o!=0&&(s=this.lworldOrgY+(p-this.ldeviceOrgY)*this.lworldExtY/o),s},w.prototype.inverseTransformPoint=function(p){return new E(this.inverseTransformX(p.x),this.inverseTransformY(p.y))},L.exports=w},function(L,j,P){"use strict";var E=P(15),w=P(4),p=P(0),s=P(8),o=P(9);function d(){E.call(this),this.useSmartIdealEdgeLengthCalculation=w.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=w.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=w.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=w.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=w.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*w.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=w.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=w.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=w.MAX_ITERATIONS}for(var M in d.prototype=Object.create(E.prototype),E)d[M]=E[M];d.prototype.initParameters=function(){E.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=w.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},d.prototype.calcIdealEdgeLengths=function(){for(var f,u,r,h,v,n,y,b=this.getGraphManager().getAllEdges(),T=0;T<b.length;T++)u=(f=b[T]).idealLength,f.isInterGraph&&(h=f.getSource(),v=f.getTarget(),n=f.getSourceInLca().getEstimatedSize(),y=f.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(f.idealLength+=n+y-2*p.SIMPLE_NODE_SIZE),r=f.getLca().getInclusionTreeDepth(),f.idealLength+=u*w.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(h.getInclusionTreeDepth()+v.getInclusionTreeDepth()-2*r))},d.prototype.initSpringEmbedder=function(){var f=this.getAllNodes().length;this.incremental?(f>w.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*w.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(f-w.ADAPTATION_LOWER_NODE_LIMIT)/(w.ADAPTATION_UPPER_NODE_LIMIT-w.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-w.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=w.MAX_NODE_DISPLACEMENT_INCREMENTAL):(f>w.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(w.COOLING_ADAPTATION_FACTOR,1-(f-w.ADAPTATION_LOWER_NODE_LIMIT)/(w.ADAPTATION_UPPER_NODE_LIMIT-w.ADAPTATION_LOWER_NODE_LIMIT)*(1-w.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=w.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*w.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var f,u=this.getAllEdges(),r=0;r<u.length;r++)f=u[r],this.calcSpringForce(f,f.idealLength)},d.prototype.calcRepulsionForces=function(){var f,u,r,h,v,n=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],y=arguments.length>1&&arguments[1]!==void 0&&arguments[1],b=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%w.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),v=new Set,f=0;f<b.length;f++)r=b[f],this.calculateRepulsionForceOfANode(r,v,n,y),v.add(r);else for(f=0;f<b.length;f++)for(r=b[f],u=f+1;u<b.length;u++)h=b[u],r.getOwner()==h.getOwner()&&this.calcRepulsionForce(r,h)},d.prototype.calcGravitationalForces=function(){for(var f,u=this.getAllNodesToApplyGravitation(),r=0;r<u.length;r++)f=u[r],this.calcGravitationalForce(f)},d.prototype.moveNodes=function(){for(var f=this.getAllNodes(),u=0;u<f.length;u++)f[u].move()},d.prototype.calcSpringForce=function(f,u){var r,h,v,n,y=f.getSource(),b=f.getTarget();if(this.uniformLeafNodeSizes&&y.getChild()==null&&b.getChild()==null)f.updateLengthSimple();else if(f.updateLength(),f.isOverlapingSourceAndTarget)return;(r=f.getLength())!=0&&(v=(h=f.edgeElasticity*(r-u))*(f.lengthX/r),n=h*(f.lengthY/r),y.springForceX+=v,y.springForceY+=n,b.springForceX-=v,b.springForceY-=n)},d.prototype.calcRepulsionForce=function(f,u){var r,h,v,n,y,b,T,I=f.getRect(),F=u.getRect(),X=new Array(2),K=new Array(4);if(I.intersects(F)){s.calcSeparationAmount(I,F,X,w.DEFAULT_EDGE_LENGTH/2),b=2*X[0],T=2*X[1];var ot=f.noOfChildren*u.noOfChildren/(f.noOfChildren+u.noOfChildren);f.repulsionForceX-=ot*b,f.repulsionForceY-=ot*T,u.repulsionForceX+=ot*b,u.repulsionForceY+=ot*T}else this.uniformLeafNodeSizes&&f.getChild()==null&&u.getChild()==null?(r=F.getCenterX()-I.getCenterX(),h=F.getCenterY()-I.getCenterY()):(s.getIntersection(I,F,K),r=K[2]-K[0],h=K[3]-K[1]),Math.abs(r)<w.MIN_REPULSION_DIST&&(r=o.sign(r)*w.MIN_REPULSION_DIST),Math.abs(h)<w.MIN_REPULSION_DIST&&(h=o.sign(h)*w.MIN_REPULSION_DIST),v=r*r+h*h,n=Math.sqrt(v),b=(y=(f.nodeRepulsion/2+u.nodeRepulsion/2)*f.noOfChildren*u.noOfChildren/v)*r/n,T=y*h/n,f.repulsionForceX-=b,f.repulsionForceY-=T,u.repulsionForceX+=b,u.repulsionForceY+=T},d.prototype.calcGravitationalForce=function(f){var u,r,h,v,n,y,b,T;r=((u=f.getOwner()).getRight()+u.getLeft())/2,h=(u.getTop()+u.getBottom())/2,v=f.getCenterX()-r,n=f.getCenterY()-h,y=Math.abs(v)+f.getWidth()/2,b=Math.abs(n)+f.getHeight()/2,f.getOwner()==this.graphManager.getRoot()?(y>(T=u.getEstimatedSize()*this.gravityRangeFactor)||b>T)&&(f.gravitationForceX=-this.gravityConstant*v,f.gravitationForceY=-this.gravityConstant*n):(y>(T=u.getEstimatedSize()*this.compoundGravityRangeFactor)||b>T)&&(f.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,f.gravitationForceY=-this.gravityConstant*n*this.compoundGravityConstant)},d.prototype.isConverged=function(){var f,u=!1;return this.totalIterations>this.maxIterations/3&&(u=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),f=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,f||u},d.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},d.prototype.calcNoOfChildrenForAllNodes=function(){for(var f,u=this.graphManager.getAllNodes(),r=0;r<u.length;r++)(f=u[r]).noOfChildren=f.getNoOfChildren()},d.prototype.calcGrid=function(f){var u,r;u=parseInt(Math.ceil((f.getRight()-f.getLeft())/this.repulsionRange)),r=parseInt(Math.ceil((f.getBottom()-f.getTop())/this.repulsionRange));for(var h=new Array(u),v=0;v<u;v++)h[v]=new Array(r);for(v=0;v<u;v++)for(var n=0;n<r;n++)h[v][n]=new Array;return h},d.prototype.addNodeToGrid=function(f,u,r){var h,v,n,y;h=parseInt(Math.floor((f.getRect().x-u)/this.repulsionRange)),v=parseInt(Math.floor((f.getRect().width+f.getRect().x-u)/this.repulsionRange)),n=parseInt(Math.floor((f.getRect().y-r)/this.repulsionRange)),y=parseInt(Math.floor((f.getRect().height+f.getRect().y-r)/this.repulsionRange));for(var b=h;b<=v;b++)for(var T=n;T<=y;T++)this.grid[b][T].push(f),f.setGridCoordinates(h,v,n,y)},d.prototype.updateGrid=function(){var f,u,r=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),f=0;f<r.length;f++)u=r[f],this.addNodeToGrid(u,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},d.prototype.calculateRepulsionForceOfANode=function(f,u,r,h){if(this.totalIterations%w.GRID_CALCULATION_CHECK_PERIOD==1&&r||h){var v,n=new Set;f.surrounding=new Array;for(var y=this.grid,b=f.startX-1;b<f.finishX+2;b++)for(var T=f.startY-1;T<f.finishY+2;T++)if(!(b<0||T<0||b>=y.length||T>=y[0].length)){for(var I=0;I<y[b][T].length;I++)if(v=y[b][T][I],f.getOwner()==v.getOwner()&&f!=v&&!u.has(v)&&!n.has(v)){var F=Math.abs(f.getCenterX()-v.getCenterX())-(f.getWidth()/2+v.getWidth()/2),X=Math.abs(f.getCenterY()-v.getCenterY())-(f.getHeight()/2+v.getHeight()/2);F<=this.repulsionRange&&X<=this.repulsionRange&&n.add(v)}}f.surrounding=[].concat((function(K){if(Array.isArray(K)){for(var ot=0,pt=Array(K.length);ot<K.length;ot++)pt[ot]=K[ot];return pt}return Array.from(K)})(n))}for(b=0;b<f.surrounding.length;b++)this.calcRepulsionForce(f,f.surrounding[b])},d.prototype.calcRepulsionRange=function(){return 0},L.exports=d},function(L,j,P){"use strict";var E=P(1),w=P(4);function p(o,d,M){E.call(this,o,d,M),this.idealLength=w.DEFAULT_EDGE_LENGTH,this.edgeElasticity=w.DEFAULT_SPRING_STRENGTH}for(var s in p.prototype=Object.create(E.prototype),E)p[s]=E[s];L.exports=p},function(L,j,P){"use strict";var E=P(3),w=P(4);function p(o,d,M,f){E.call(this,o,d,M,f),this.nodeRepulsion=w.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var s in p.prototype=Object.create(E.prototype),E)p[s]=E[s];p.prototype.setGridCoordinates=function(o,d,M,f){this.startX=o,this.finishX=d,this.startY=M,this.finishY=f},L.exports=p},function(L,j,P){"use strict";function E(w,p){this.width=0,this.height=0,w!==null&&p!==null&&(this.height=p,this.width=w)}E.prototype.getWidth=function(){return this.width},E.prototype.setWidth=function(w){this.width=w},E.prototype.getHeight=function(){return this.height},E.prototype.setHeight=function(w){this.height=w},L.exports=E},function(L,j,P){"use strict";var E=P(14);function w(){this.map={},this.keys=[]}w.prototype.put=function(p,s){var o=E.createID(p);this.contains(o)||(this.map[o]=s,this.keys.push(p))},w.prototype.contains=function(p){return E.createID(p),this.map[p]!=null},w.prototype.get=function(p){var s=E.createID(p);return this.map[s]},w.prototype.keySet=function(){return this.keys},L.exports=w},function(L,j,P){"use strict";var E=P(14);function w(){this.set={}}w.prototype.add=function(p){var s=E.createID(p);this.contains(s)||(this.set[s]=p)},w.prototype.remove=function(p){delete this.set[E.createID(p)]},w.prototype.clear=function(){this.set={}},w.prototype.contains=function(p){return this.set[E.createID(p)]==p},w.prototype.isEmpty=function(){return this.size()===0},w.prototype.size=function(){return Object.keys(this.set).length},w.prototype.addAllTo=function(p){for(var s=Object.keys(this.set),o=s.length,d=0;d<o;d++)p.push(this.set[s[d]])},w.prototype.size=function(){return Object.keys(this.set).length},w.prototype.addAll=function(p){for(var s=p.length,o=0;o<s;o++){var d=p[o];this.add(d)}},L.exports=w},function(L,j,P){"use strict";function E(){}E.multMat=function(w,p){for(var s=[],o=0;o<w.length;o++){s[o]=[];for(var d=0;d<p[0].length;d++){s[o][d]=0;for(var M=0;M<w[0].length;M++)s[o][d]+=w[o][M]*p[M][d]}}return s},E.transpose=function(w){for(var p=[],s=0;s<w[0].length;s++){p[s]=[];for(var o=0;o<w.length;o++)p[s][o]=w[o][s]}return p},E.multCons=function(w,p){for(var s=[],o=0;o<w.length;o++)s[o]=w[o]*p;return s},E.minusOp=function(w,p){for(var s=[],o=0;o<w.length;o++)s[o]=w[o]-p[o];return s},E.dotProduct=function(w,p){for(var s=0,o=0;o<w.length;o++)s+=w[o]*p[o];return s},E.mag=function(w){return Math.sqrt(this.dotProduct(w,w))},E.normalize=function(w){for(var p=[],s=this.mag(w),o=0;o<w.length;o++)p[o]=w[o]/s;return p},E.multGamma=function(w){for(var p=[],s=0,o=0;o<w.length;o++)s+=w[o];s*=-1/w.length;for(var d=0;d<w.length;d++)p[d]=s+w[d];return p},E.multL=function(w,p,s){for(var o=[],d=[],M=[],f=0;f<p[0].length;f++){for(var u=0,r=0;r<p.length;r++)u+=-.5*p[r][f]*w[r];d[f]=u}for(var h=0;h<s.length;h++){for(var v=0,n=0;n<s.length;n++)v+=s[h][n]*d[n];M[h]=v}for(var y=0;y<p.length;y++){for(var b=0,T=0;T<p[0].length;T++)b+=p[y][T]*M[T];o[y]=b}return o},L.exports=E},function(L,j,P){"use strict";var E=(function(){function s(o,d){for(var M=0;M<d.length;M++){var f=d[M];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(o,f.key,f)}}return function(o,d,M){return d&&s(o.prototype,d),M&&s(o,M),o}})(),w=P(11),p=(function(){function s(o,d){(function(f,u){if(!(f instanceof u))throw new TypeError("Cannot call a class as a function")})(this,s),d===null&&d===void 0||(this.compareFunction=this._defaultCompareFunction);var M=void 0;M=o instanceof w?o.size():o.length,this._quicksort(o,0,M-1)}return E(s,[{key:"_quicksort",value:function(o,d,M){if(d<M){var f=this._partition(o,d,M);this._quicksort(o,d,f),this._quicksort(o,f+1,M)}}},{key:"_partition",value:function(o,d,M){for(var f=this._get(o,d),u=d,r=M;;){for(;this.compareFunction(f,this._get(o,r));)r--;for(;this.compareFunction(this._get(o,u),f);)u++;if(!(u<r))return r;this._swap(o,u,r),u++,r--}}},{key:"_get",value:function(o,d){return o instanceof w?o.get_object_at(d):o[d]}},{key:"_set",value:function(o,d,M){o instanceof w?o.set_object_at(d,M):o[d]=M}},{key:"_swap",value:function(o,d,M){var f=this._get(o,d);this._set(o,d,this._get(o,M)),this._set(o,M,f)}},{key:"_defaultCompareFunction",value:function(o,d){return d>o}}]),s})();L.exports=p},function(L,j,P){"use strict";function E(){}E.svd=function(w){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=w.length,this.n=w[0].length;var p=Math.min(this.m,this.n);this.s=(function(ra){for(var Dr=[];ra-- >0;)Dr.push(0);return Dr})(Math.min(this.m+1,this.n)),this.U=(function ra(Dr){if(Dr.length==0)return 0;for(var la=[],qr=0;qr<Dr[0];qr++)la.push(ra(Dr.slice(1)));return la})([this.m,p]),this.V=(function(ra){return(function Dr(la){if(la.length==0)return 0;for(var qr=[],ma=0;ma<la[0];ma++)qr.push(Dr(la.slice(1)));return qr})(ra)})([this.n,this.n]);for(var s=(function(ra){for(var Dr=[];ra-- >0;)Dr.push(0);return Dr})(this.n),o=(function(ra){for(var Dr=[];ra-- >0;)Dr.push(0);return Dr})(this.m),d=Math.min(this.m-1,this.n),M=Math.max(0,Math.min(this.n-2,this.m)),f=0;f<Math.max(d,M);f++){if(f<d){this.s[f]=0;for(var u=f;u<this.m;u++)this.s[f]=E.hypot(this.s[f],w[u][f]);if(this.s[f]!==0){w[f][f]<0&&(this.s[f]=-this.s[f]);for(var r=f;r<this.m;r++)w[r][f]/=this.s[f];w[f][f]+=1}this.s[f]=-this.s[f]}for(var h=f+1;h<this.n;h++){if((function(ra,Dr){return ra&&Dr})(f<d,this.s[f]!==0)){for(var v=0,n=f;n<this.m;n++)v+=w[n][f]*w[n][h];v=-v/w[f][f];for(var y=f;y<this.m;y++)w[y][h]+=v*w[y][f]}s[h]=w[f][h]}if((function(ra,Dr){return Dr})(0,f<d))for(var b=f;b<this.m;b++)this.U[b][f]=w[b][f];if(f<M){s[f]=0;for(var T=f+1;T<this.n;T++)s[f]=E.hypot(s[f],s[T]);if(s[f]!==0){s[f+1]<0&&(s[f]=-s[f]);for(var I=f+1;I<this.n;I++)s[I]/=s[f];s[f+1]+=1}if(s[f]=-s[f],(function(ra,Dr){return ra&&Dr})(f+1<this.m,s[f]!==0)){for(var F=f+1;F<this.m;F++)o[F]=0;for(var X=f+1;X<this.n;X++)for(var K=f+1;K<this.m;K++)o[K]+=s[X]*w[K][X];for(var ot=f+1;ot<this.n;ot++)for(var pt=-s[ot]/s[f+1],xt=f+1;xt<this.m;xt++)w[xt][ot]+=pt*o[xt]}for(var ee=f+1;ee<this.n;ee++)this.V[ee][f]=s[ee]}}var N=Math.min(this.n,this.m+1);d<this.n&&(this.s[d]=w[d][d]),this.m<N&&(this.s[N-1]=0),M+1<N&&(s[M]=w[M][N-1]),s[N-1]=0;for(var Q=d;Q<p;Q++){for(var at=0;at<this.m;at++)this.U[at][Q]=0;this.U[Q][Q]=1}for(var _=d-1;_>=0;_--)if(this.s[_]!==0){for(var l=_+1;l<p;l++){for(var O=0,z=_;z<this.m;z++)O+=this.U[z][_]*this.U[z][l];O=-O/this.U[_][_];for(var lt=_;lt<this.m;lt++)this.U[lt][l]+=O*this.U[lt][_]}for(var W=_;W<this.m;W++)this.U[W][_]=-this.U[W][_];this.U[_][_]=1+this.U[_][_];for(var gt=0;gt<_-1;gt++)this.U[gt][_]=0}else{for(var mt=0;mt<this.m;mt++)this.U[mt][_]=0;this.U[_][_]=1}for(var Tt=this.n-1;Tt>=0;Tt--){if((function(ra,Dr){return ra&&Dr})(Tt<M,s[Tt]!==0))for(var Rt=Tt+1;Rt<p;Rt++){for(var It=0,te=Tt+1;te<this.n;te++)It+=this.V[te][Tt]*this.V[te][Rt];It=-It/this.V[Tt+1][Tt];for(var Qt=Tt+1;Qt<this.n;Qt++)this.V[Qt][Rt]+=It*this.V[Qt][Tt]}for(var pe=0;pe<this.n;pe++)this.V[pe][Tt]=0;this.V[Tt][Tt]=1}for(var ue=N-1,me=Math.pow(2,-52),Ee=Math.pow(2,-966);N>0;){var xe=void 0,ar=void 0;for(xe=N-2;xe>=-1&&xe!==-1;xe--)if(Math.abs(s[xe])<=Ee+me*(Math.abs(this.s[xe])+Math.abs(this.s[xe+1]))){s[xe]=0;break}if(xe===N-2)ar=4;else{var xr=void 0;for(xr=N-1;xr>=xe&&xr!==xe;xr--){var sr=(xr!==N?Math.abs(s[xr]):0)+(xr!==xe+1?Math.abs(s[xr-1]):0);if(Math.abs(this.s[xr])<=Ee+me*sr){this.s[xr]=0;break}}xr===xe?ar=3:xr===N-1?ar=1:(ar=2,xe=xr)}switch(xe++,ar){case 1:var Qe=s[N-2];s[N-2]=0;for(var or=N-2;or>=xe;or--){var Wr=E.hypot(this.s[or],Qe),oa=this.s[or]/Wr,Sr=Qe/Wr;this.s[or]=Wr,or!==xe&&(Qe=-Sr*s[or-1],s[or-1]=oa*s[or-1]);for(var Rr=0;Rr<this.n;Rr++)Wr=oa*this.V[Rr][or]+Sr*this.V[Rr][N-1],this.V[Rr][N-1]=-Sr*this.V[Rr][or]+oa*this.V[Rr][N-1],this.V[Rr][or]=Wr}break;case 2:var Mr=s[xe-1];s[xe-1]=0;for(var er=xe;er<N;er++){var Xr=E.hypot(this.s[er],Mr),Kr=this.s[er]/Xr,Ur=Mr/Xr;this.s[er]=Xr,Mr=-Ur*s[er],s[er]=Kr*s[er];for(var Jr=0;Jr<this.m;Jr++)Xr=Kr*this.U[Jr][er]+Ur*this.U[Jr][xe-1],this.U[Jr][xe-1]=-Ur*this.U[Jr][er]+Kr*this.U[Jr][xe-1],this.U[Jr][er]=Xr}break;case 3:var Yr=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[N-1]),Math.abs(this.s[N-2])),Math.abs(s[N-2])),Math.abs(this.s[xe])),Math.abs(s[xe])),ke=this.s[N-1]/Yr,ze=this.s[N-2]/Yr,lr=s[N-2]/Yr,ir=this.s[xe]/Yr,ur=s[xe]/Yr,zr=((ze+ke)*(ze-ke)+lr*lr)/2,cr=ke*lr*(ke*lr),Nr=0;(function(ra,Dr){return ra||Dr})(zr!==0,cr!==0)&&(Nr=Math.sqrt(zr*zr+cr),zr<0&&(Nr=-Nr),Nr=cr/(zr+Nr));for(var Fr=(ir+ke)*(ir-ke)+Nr,sa=ir*ur,yr=xe;yr<N-1;yr++){var kr=E.hypot(Fr,sa),pr=Fr/kr,rr=sa/kr;yr!==xe&&(s[yr-1]=kr),Fr=pr*this.s[yr]+rr*s[yr],s[yr]=pr*s[yr]-rr*this.s[yr],sa=rr*this.s[yr+1],this.s[yr+1]=pr*this.s[yr+1];for(var Pr=0;Pr<this.n;Pr++)kr=pr*this.V[Pr][yr]+rr*this.V[Pr][yr+1],this.V[Pr][yr+1]=-rr*this.V[Pr][yr]+pr*this.V[Pr][yr+1],this.V[Pr][yr]=kr;if(pr=Fr/(kr=E.hypot(Fr,sa)),rr=sa/kr,this.s[yr]=kr,Fr=pr*s[yr]+rr*this.s[yr+1],this.s[yr+1]=-rr*s[yr]+pr*this.s[yr+1],sa=rr*s[yr+1],s[yr+1]=pr*s[yr+1],yr<this.m-1)for(var ta=0;ta<this.m;ta++)kr=pr*this.U[ta][yr]+rr*this.U[ta][yr+1],this.U[ta][yr+1]=-rr*this.U[ta][yr]+pr*this.U[ta][yr+1],this.U[ta][yr]=kr}s[N-2]=Fr;break;case 4:if(this.s[xe]<=0){this.s[xe]=this.s[xe]<0?-this.s[xe]:0;for(var wr=0;wr<=ue;wr++)this.V[wr][xe]=-this.V[wr][xe]}for(;xe<ue&&!(this.s[xe]>=this.s[xe+1]);){var Sa=this.s[xe];if(this.s[xe]=this.s[xe+1],this.s[xe+1]=Sa,xe<this.n-1)for(var ca=0;ca<this.n;ca++)Sa=this.V[ca][xe+1],this.V[ca][xe+1]=this.V[ca][xe],this.V[ca][xe]=Sa;if(xe<this.m-1)for(var ba=0;ba<this.m;ba++)Sa=this.U[ba][xe+1],this.U[ba][xe+1]=this.U[ba][xe],this.U[ba][xe]=Sa;xe++}N--}}return{U:this.U,V:this.V,S:this.s}},E.hypot=function(w,p){var s=void 0;return Math.abs(w)>Math.abs(p)?(s=p/w,s=Math.abs(w)*Math.sqrt(1+s*s)):p!=0?(s=w/p,s=Math.abs(p)*Math.sqrt(1+s*s)):s=0,s},L.exports=E},function(L,j,P){"use strict";var E=(function(){function p(s,o){for(var d=0;d<o.length;d++){var M=o[d];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(s,M.key,M)}}return function(s,o,d){return o&&p(s.prototype,o),d&&p(s,d),s}})(),w=(function(){function p(s,o){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;(function(n,y){if(!(n instanceof y))throw new TypeError("Cannot call a class as a function")})(this,p),this.sequence1=s,this.sequence2=o,this.match_score=d,this.mismatch_penalty=M,this.gap_penalty=f,this.iMax=s.length+1,this.jMax=o.length+1,this.grid=new Array(this.iMax);for(var u=0;u<this.iMax;u++){this.grid[u]=new Array(this.jMax);for(var r=0;r<this.jMax;r++)this.grid[u][r]=0}this.tracebackGrid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=new Array(this.jMax);for(var v=0;v<this.jMax;v++)this.tracebackGrid[h][v]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return E(p,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var s=1;s<this.jMax;s++)this.grid[0][s]=this.grid[0][s-1]+this.gap_penalty,this.tracebackGrid[0][s]=[!1,!1,!0];for(var o=1;o<this.iMax;o++)this.grid[o][0]=this.grid[o-1][0]+this.gap_penalty,this.tracebackGrid[o][0]=[!1,!0,!1];for(var d=1;d<this.iMax;d++)for(var M=1;M<this.jMax;M++){var f=[this.sequence1[d-1]===this.sequence2[M-1]?this.grid[d-1][M-1]+this.match_score:this.grid[d-1][M-1]+this.mismatch_penalty,this.grid[d-1][M]+this.gap_penalty,this.grid[d][M-1]+this.gap_penalty],u=this.arrayAllMaxIndexes(f);this.grid[d][M]=f[u[0]],this.tracebackGrid[d][M]=[u.includes(0),u.includes(1),u.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var s=[];for(s.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});s[0];){var o=s[0],d=this.tracebackGrid[o.pos[0]][o.pos[1]];d[0]&&s.push({pos:[o.pos[0]-1,o.pos[1]-1],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2}),d[1]&&s.push({pos:[o.pos[0]-1,o.pos[1]],seq1:this.sequence1[o.pos[0]-1]+o.seq1,seq2:"-"+o.seq2}),d[2]&&s.push({pos:[o.pos[0],o.pos[1]-1],seq1:"-"+o.seq1,seq2:this.sequence2[o.pos[1]-1]+o.seq2}),o.pos[0]===0&&o.pos[1]===0&&this.alignments.push({sequence1:o.seq1,sequence2:o.seq2}),s.shift()}return this.alignments}},{key:"getAllIndexes",value:function(s,o){for(var d=[],M=-1;(M=s.indexOf(o,M+1))!==-1;)d.push(M);return d}},{key:"arrayAllMaxIndexes",value:function(s){return this.getAllIndexes(s,Math.max.apply(null,s))}}]),p})();L.exports=w},function(L,j,P){"use strict";var E=function(){};E.FDLayout=P(18),E.FDLayoutConstants=P(4),E.FDLayoutEdge=P(19),E.FDLayoutNode=P(20),E.DimensionD=P(21),E.HashMap=P(22),E.HashSet=P(23),E.IGeometry=P(8),E.IMath=P(9),E.Integer=P(10),E.Point=P(12),E.PointD=P(5),E.RandomSeed=P(16),E.RectangleD=P(13),E.Transform=P(17),E.UniqueIDGeneretor=P(14),E.Quicksort=P(25),E.LinkedList=P(11),E.LGraphObject=P(2),E.LGraph=P(6),E.LEdge=P(1),E.LGraphManager=P(7),E.LNode=P(3),E.Layout=P(15),E.LayoutConstants=P(0),E.NeedlemanWunsch=P(27),E.Matrix=P(24),E.SVD=P(26),L.exports=E},function(L,j,P){"use strict";function E(){this.listeners=[]}var w=E.prototype;w.addListener=function(p,s){this.listeners.push({event:p,callback:s})},w.removeListener=function(p,s){for(var o=this.listeners.length;o>=0;o--){var d=this.listeners[o];d.event===p&&d.callback===s&&this.listeners.splice(o,1)}},w.emit=function(p,s){for(var o=0;o<this.listeners.length;o++){var d=this.listeners[o];p===d.event&&d.callback(s)}},L.exports=E}])});(function(L,j){typeof exports=="object"&&typeof module=="object"?module.exports=j("layout-base"):typeof define=="function"&&define.amd?define(["layout-base"],j):typeof exports=="object"?exports.coseBase=j("layout-base"):L.coseBase=j(L.layoutBase)})(Gi,function(L){return(()=>{"use strict";var j={45:(w,p,s)=>{var o={};o.layoutBase=s(551),o.CoSEConstants=s(806),o.CoSEEdge=s(767),o.CoSEGraph=s(880),o.CoSEGraphManager=s(578),o.CoSELayout=s(765),o.CoSENode=s(991),o.ConstraintHandler=s(902),w.exports=o},806:(w,p,s)=>{var o=s(551).FDLayoutConstants;function d(){}for(var M in o)d[M]=o[M];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=o.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,w.exports=d},767:(w,p,s)=>{var o=s(551).FDLayoutEdge;function d(f,u,r){o.call(this,f,u,r)}for(var M in d.prototype=Object.create(o.prototype),o)d[M]=o[M];w.exports=d},880:(w,p,s)=>{var o=s(551).LGraph;function d(f,u,r){o.call(this,f,u,r)}for(var M in d.prototype=Object.create(o.prototype),o)d[M]=o[M];w.exports=d},578:(w,p,s)=>{var o=s(551).LGraphManager;function d(f){o.call(this,f)}for(var M in d.prototype=Object.create(o.prototype),o)d[M]=o[M];w.exports=d},765:(w,p,s)=>{var o=s(551).FDLayout,d=s(578),M=s(880),f=s(991),u=s(767),r=s(806),h=s(902),v=s(551).FDLayoutConstants,n=s(551).LayoutConstants,y=s(551).Point,b=s(551).PointD,T=s(551).DimensionD,I=s(551).Layout,F=s(551).Integer,X=s(551).IGeometry,K=s(551).LGraph,ot=s(551).Transform,pt=s(551).LinkedList;function xt(){o.call(this),this.toBeTiled={},this.constraints={}}for(var ee in xt.prototype=Object.create(o.prototype),o)xt[ee]=o[ee];xt.prototype.newGraphManager=function(){var N=new d(this);return this.graphManager=N,N},xt.prototype.newGraph=function(N){return new M(null,this.graphManager,N)},xt.prototype.newNode=function(N){return new f(this.graphManager,N)},xt.prototype.newEdge=function(N){return new u(null,null,N)},xt.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.isSubLayout||(r.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=r.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},xt.prototype.initSpringEmbedder=function(){o.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},xt.prototype.layout=function(){return n.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},xt.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)r.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),Q=new Set(this.getAllNodes()),at=this.nodesWithGravity.filter(function(_){return Q.has(_)}),this.graphManager.setAllNodesToApplyGravitation(at));else{var N=this.getFlatForest();if(N.length>0)this.positionNodesRadially(N);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var Q=new Set(this.getAllNodes()),at=this.nodesWithGravity.filter(function(_){return Q.has(_)});this.graphManager.setAllNodesToApplyGravitation(at),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(h.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),r.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},xt.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),Q=this.nodesWithGravity.filter(function(l){return N.has(l)});this.graphManager.setAllNodesToApplyGravitation(Q),this.graphManager.updateBounds(),this.updateGrid(),r.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),r.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var at=!this.isTreeGrowing&&!this.isGrowthFinished,_=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(at,_),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},xt.prototype.getPositionsData=function(){for(var N=this.graphManager.getAllNodes(),Q={},at=0;at<N.length;at++){var _=N[at].rect,l=N[at].id;Q[l]={id:l,x:_.getCenterX(),y:_.getCenterY(),w:_.width,h:_.height}}return Q},xt.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var N=!1;if(v.ANIMATE==="during")this.emit("layoutstarted");else{for(;!N;)N=this.tick();this.graphManager.updateBounds()}},xt.prototype.moveNodes=function(){for(var N=this.getAllNodes(),Q=0;Q<N.length;Q++)N[Q].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),Q=0;Q<N.length;Q++)N[Q].move()},xt.prototype.initConstraintVariables=function(){var N=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var Q=this.graphManager.getAllNodes(),at=0;at<Q.length;at++){var _=Q[at];this.idToNodeMap.set(_.id,_)}var l=function Qt(pe){for(var ue,me=pe.getChild().getNodes(),Ee=0,xe=0;xe<me.length;xe++)(ue=me[xe]).getChild()==null?N.fixedNodeSet.has(ue.id)&&(Ee+=100):Ee+=Qt(ue);return Ee};if(this.constraints.fixedNodeConstraint){for(this.constraints.fixedNodeConstraint.forEach(function(Qt){N.fixedNodeSet.add(Qt.nodeId)}),Q=this.graphManager.getAllNodes(),at=0;at<Q.length;at++)if((_=Q[at]).getChild()!=null){var O=l(_);O>0&&(_.fixedNodeWeight=O)}}if(this.constraints.relativePlacementConstraint){var z=new Map,lt=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Qt){N.fixedNodesOnHorizontal.add(Qt),N.fixedNodesOnVertical.add(Qt)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var W=this.constraints.alignmentConstraint.vertical;for(at=0;at<W.length;at++)this.dummyToNodeForVerticalAlignment.set("dummy"+at,[]),W[at].forEach(function(Qt){z.set(Qt,"dummy"+at),N.dummyToNodeForVerticalAlignment.get("dummy"+at).push(Qt),N.fixedNodeSet.has(Qt)&&N.fixedNodesOnHorizontal.add("dummy"+at)})}if(this.constraints.alignmentConstraint.horizontal){var gt=this.constraints.alignmentConstraint.horizontal;for(at=0;at<gt.length;at++)this.dummyToNodeForHorizontalAlignment.set("dummy"+at,[]),gt[at].forEach(function(Qt){lt.set(Qt,"dummy"+at),N.dummyToNodeForHorizontalAlignment.get("dummy"+at).push(Qt),N.fixedNodeSet.has(Qt)&&N.fixedNodesOnVertical.add("dummy"+at)})}}if(r.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(Qt){var pe,ue,me;for(me=Qt.length-1;me>=2*Qt.length/3;me--)pe=Math.floor(Math.random()*(me+1)),ue=Qt[me],Qt[me]=Qt[pe],Qt[pe]=ue;return Qt},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(Qt){if(Qt.left){var pe=z.has(Qt.left)?z.get(Qt.left):Qt.left,ue=z.has(Qt.right)?z.get(Qt.right):Qt.right;N.nodesInRelativeHorizontal.includes(pe)||(N.nodesInRelativeHorizontal.push(pe),N.nodeToRelativeConstraintMapHorizontal.set(pe,[]),N.dummyToNodeForVerticalAlignment.has(pe)?N.nodeToTempPositionMapHorizontal.set(pe,N.idToNodeMap.get(N.dummyToNodeForVerticalAlignment.get(pe)[0]).getCenterX()):N.nodeToTempPositionMapHorizontal.set(pe,N.idToNodeMap.get(pe).getCenterX())),N.nodesInRelativeHorizontal.includes(ue)||(N.nodesInRelativeHorizontal.push(ue),N.nodeToRelativeConstraintMapHorizontal.set(ue,[]),N.dummyToNodeForVerticalAlignment.has(ue)?N.nodeToTempPositionMapHorizontal.set(ue,N.idToNodeMap.get(N.dummyToNodeForVerticalAlignment.get(ue)[0]).getCenterX()):N.nodeToTempPositionMapHorizontal.set(ue,N.idToNodeMap.get(ue).getCenterX())),N.nodeToRelativeConstraintMapHorizontal.get(pe).push({right:ue,gap:Qt.gap}),N.nodeToRelativeConstraintMapHorizontal.get(ue).push({left:pe,gap:Qt.gap})}else{var me=lt.has(Qt.top)?lt.get(Qt.top):Qt.top,Ee=lt.has(Qt.bottom)?lt.get(Qt.bottom):Qt.bottom;N.nodesInRelativeVertical.includes(me)||(N.nodesInRelativeVertical.push(me),N.nodeToRelativeConstraintMapVertical.set(me,[]),N.dummyToNodeForHorizontalAlignment.has(me)?N.nodeToTempPositionMapVertical.set(me,N.idToNodeMap.get(N.dummyToNodeForHorizontalAlignment.get(me)[0]).getCenterY()):N.nodeToTempPositionMapVertical.set(me,N.idToNodeMap.get(me).getCenterY())),N.nodesInRelativeVertical.includes(Ee)||(N.nodesInRelativeVertical.push(Ee),N.nodeToRelativeConstraintMapVertical.set(Ee,[]),N.dummyToNodeForHorizontalAlignment.has(Ee)?N.nodeToTempPositionMapVertical.set(Ee,N.idToNodeMap.get(N.dummyToNodeForHorizontalAlignment.get(Ee)[0]).getCenterY()):N.nodeToTempPositionMapVertical.set(Ee,N.idToNodeMap.get(Ee).getCenterY())),N.nodeToRelativeConstraintMapVertical.get(me).push({bottom:Ee,gap:Qt.gap}),N.nodeToRelativeConstraintMapVertical.get(Ee).push({top:me,gap:Qt.gap})}});else{var mt=new Map,Tt=new Map;this.constraints.relativePlacementConstraint.forEach(function(Qt){if(Qt.left){var pe=z.has(Qt.left)?z.get(Qt.left):Qt.left,ue=z.has(Qt.right)?z.get(Qt.right):Qt.right;mt.has(pe)?mt.get(pe).push(ue):mt.set(pe,[ue]),mt.has(ue)?mt.get(ue).push(pe):mt.set(ue,[pe])}else{var me=lt.has(Qt.top)?lt.get(Qt.top):Qt.top,Ee=lt.has(Qt.bottom)?lt.get(Qt.bottom):Qt.bottom;Tt.has(me)?Tt.get(me).push(Ee):Tt.set(me,[Ee]),Tt.has(Ee)?Tt.get(Ee).push(me):Tt.set(Ee,[me])}});var Rt=function(Qt,pe){var ue=[],me=[],Ee=new pt,xe=new Set,ar=0;return Qt.forEach(function(xr,sr){if(!xe.has(sr)){ue[ar]=[],me[ar]=!1;var Qe=sr;for(Ee.push(Qe),xe.add(Qe),ue[ar].push(Qe);Ee.length!=0;)Qe=Ee.shift(),pe.has(Qe)&&(me[ar]=!0),Qt.get(Qe).forEach(function(or){xe.has(or)||(Ee.push(or),xe.add(or),ue[ar].push(or))});ar++}}),{components:ue,isFixed:me}},It=Rt(mt,N.fixedNodesOnHorizontal);this.componentsOnHorizontal=It.components,this.fixedComponentsOnHorizontal=It.isFixed;var te=Rt(Tt,N.fixedNodesOnVertical);this.componentsOnVertical=te.components,this.fixedComponentsOnVertical=te.isFixed}}},xt.prototype.updateDisplacements=function(){var N=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(te){var Qt=N.idToNodeMap.get(te.nodeId);Qt.displacementX=0,Qt.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var Q=this.constraints.alignmentConstraint.vertical,at=0;at<Q.length;at++){for(var _=0,l=0;l<Q[at].length;l++){if(this.fixedNodeSet.has(Q[at][l])){_=0;break}_+=this.idToNodeMap.get(Q[at][l]).displacementX}var O=_/Q[at].length;for(l=0;l<Q[at].length;l++)this.idToNodeMap.get(Q[at][l]).displacementX=O}if(this.constraints.alignmentConstraint.horizontal){var z=this.constraints.alignmentConstraint.horizontal;for(at=0;at<z.length;at++){var lt=0;for(l=0;l<z[at].length;l++){if(this.fixedNodeSet.has(z[at][l])){lt=0;break}lt+=this.idToNodeMap.get(z[at][l]).displacementY}var W=lt/z[at].length;for(l=0;l<z[at].length;l++)this.idToNodeMap.get(z[at][l]).displacementY=W}}}if(this.constraints.relativePlacementConstraint)if(r.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(te){if(!N.fixedNodesOnHorizontal.has(te)){var Qt=0;Qt=N.dummyToNodeForVerticalAlignment.has(te)?N.idToNodeMap.get(N.dummyToNodeForVerticalAlignment.get(te)[0]).displacementX:N.idToNodeMap.get(te).displacementX,N.nodeToRelativeConstraintMapHorizontal.get(te).forEach(function(pe){var ue;pe.right?(ue=N.nodeToTempPositionMapHorizontal.get(pe.right)-N.nodeToTempPositionMapHorizontal.get(te)-Qt)<pe.gap&&(Qt-=pe.gap-ue):(ue=N.nodeToTempPositionMapHorizontal.get(te)-N.nodeToTempPositionMapHorizontal.get(pe.left)+Qt)<pe.gap&&(Qt+=pe.gap-ue)}),N.nodeToTempPositionMapHorizontal.set(te,N.nodeToTempPositionMapHorizontal.get(te)+Qt),N.dummyToNodeForVerticalAlignment.has(te)?N.dummyToNodeForVerticalAlignment.get(te).forEach(function(pe){N.idToNodeMap.get(pe).displacementX=Qt}):N.idToNodeMap.get(te).displacementX=Qt}}),this.nodesInRelativeVertical.forEach(function(te){if(!N.fixedNodesOnHorizontal.has(te)){var Qt=0;Qt=N.dummyToNodeForHorizontalAlignment.has(te)?N.idToNodeMap.get(N.dummyToNodeForHorizontalAlignment.get(te)[0]).displacementY:N.idToNodeMap.get(te).displacementY,N.nodeToRelativeConstraintMapVertical.get(te).forEach(function(pe){var ue;pe.bottom?(ue=N.nodeToTempPositionMapVertical.get(pe.bottom)-N.nodeToTempPositionMapVertical.get(te)-Qt)<pe.gap&&(Qt-=pe.gap-ue):(ue=N.nodeToTempPositionMapVertical.get(te)-N.nodeToTempPositionMapVertical.get(pe.top)+Qt)<pe.gap&&(Qt+=pe.gap-ue)}),N.nodeToTempPositionMapVertical.set(te,N.nodeToTempPositionMapVertical.get(te)+Qt),N.dummyToNodeForHorizontalAlignment.has(te)?N.dummyToNodeForHorizontalAlignment.get(te).forEach(function(pe){N.idToNodeMap.get(pe).displacementY=Qt}):N.idToNodeMap.get(te).displacementY=Qt}});else{for(at=0;at<this.componentsOnHorizontal.length;at++){var gt=this.componentsOnHorizontal[at];if(this.fixedComponentsOnHorizontal[at])for(l=0;l<gt.length;l++)this.dummyToNodeForVerticalAlignment.has(gt[l])?this.dummyToNodeForVerticalAlignment.get(gt[l]).forEach(function(te){N.idToNodeMap.get(te).displacementX=0}):this.idToNodeMap.get(gt[l]).displacementX=0;else{var mt=0,Tt=0;for(l=0;l<gt.length;l++)this.dummyToNodeForVerticalAlignment.has(gt[l])?(mt+=(It=this.dummyToNodeForVerticalAlignment.get(gt[l])).length*this.idToNodeMap.get(It[0]).displacementX,Tt+=It.length):(mt+=this.idToNodeMap.get(gt[l]).displacementX,Tt++);var Rt=mt/Tt;for(l=0;l<gt.length;l++)this.dummyToNodeForVerticalAlignment.has(gt[l])?this.dummyToNodeForVerticalAlignment.get(gt[l]).forEach(function(te){N.idToNodeMap.get(te).displacementX=Rt}):this.idToNodeMap.get(gt[l]).displacementX=Rt}}for(at=0;at<this.componentsOnVertical.length;at++)if(gt=this.componentsOnVertical[at],this.fixedComponentsOnVertical[at])for(l=0;l<gt.length;l++)this.dummyToNodeForHorizontalAlignment.has(gt[l])?this.dummyToNodeForHorizontalAlignment.get(gt[l]).forEach(function(te){N.idToNodeMap.get(te).displacementY=0}):this.idToNodeMap.get(gt[l]).displacementY=0;else{for(mt=0,Tt=0,l=0;l<gt.length;l++){var It;this.dummyToNodeForHorizontalAlignment.has(gt[l])?(mt+=(It=this.dummyToNodeForHorizontalAlignment.get(gt[l])).length*this.idToNodeMap.get(It[0]).displacementY,Tt+=It.length):(mt+=this.idToNodeMap.get(gt[l]).displacementY,Tt++)}for(Rt=mt/Tt,l=0;l<gt.length;l++)this.dummyToNodeForHorizontalAlignment.has(gt[l])?this.dummyToNodeForHorizontalAlignment.get(gt[l]).forEach(function(te){N.idToNodeMap.get(te).displacementY=Rt}):this.idToNodeMap.get(gt[l]).displacementY=Rt}}},xt.prototype.calculateNodesToApplyGravitationTo=function(){var N,Q,at=[],_=this.graphManager.getGraphs(),l=_.length;for(Q=0;Q<l;Q++)(N=_[Q]).updateConnected(),N.isConnected||(at=at.concat(N.getNodes()));return at},xt.prototype.createBendpoints=function(){var N=[];N=N.concat(this.graphManager.getAllEdges());var Q,at=new Set;for(Q=0;Q<N.length;Q++){var _=N[Q];if(!at.has(_)){var l=_.getSource(),O=_.getTarget();if(l==O)_.getBendpoints().push(new b),_.getBendpoints().push(new b),this.createDummyNodesForBendpoints(_),at.add(_);else{var z=[];if(z=(z=z.concat(l.getEdgeListToNode(O))).concat(O.getEdgeListToNode(l)),!at.has(z[0])){var lt;if(z.length>1)for(lt=0;lt<z.length;lt++){var W=z[lt];W.getBendpoints().push(new b),this.createDummyNodesForBendpoints(W)}z.forEach(function(gt){at.add(gt)})}}}if(at.size==N.length)break}},xt.prototype.positionNodesRadially=function(N){for(var Q=new y(0,0),at=Math.ceil(Math.sqrt(N.length)),_=0,l=0,O=0,z=new b(0,0),lt=0;lt<N.length;lt++){lt%at==0&&(O=0,l=_,lt!=0&&(l+=r.DEFAULT_COMPONENT_SEPERATION),_=0);var W=N[lt],gt=I.findCenterOfTree(W);Q.x=O,Q.y=l,(z=xt.radialLayout(W,gt,Q)).y>_&&(_=Math.floor(z.y)),O=Math.floor(z.x+r.DEFAULT_COMPONENT_SEPERATION)}this.transform(new b(n.WORLD_CENTER_X-z.x/2,n.WORLD_CENTER_Y-z.y/2))},xt.radialLayout=function(N,Q,at){var _=Math.max(this.maxDiagonalInTree(N),r.DEFAULT_RADIAL_SEPARATION);xt.branchRadialLayout(Q,null,0,359,0,_);var l=K.calculateBounds(N),O=new ot;O.setDeviceOrgX(l.getMinX()),O.setDeviceOrgY(l.getMinY()),O.setWorldOrgX(at.x),O.setWorldOrgY(at.y);for(var z=0;z<N.length;z++)N[z].transform(O);var lt=new b(l.getMaxX(),l.getMaxY());return O.inverseTransformPoint(lt)},xt.branchRadialLayout=function(N,Q,at,_,l,O){var z=(_-at+1)/2;z<0&&(z+=180);var lt=(z+at)%360*X.TWO_PI/360,W=(Math.cos(lt),l*Math.cos(lt)),gt=l*Math.sin(lt);N.setCenter(W,gt);var mt=[],Tt=(mt=mt.concat(N.getEdges())).length;Q!=null&&Tt--;for(var Rt,It=0,te=mt.length,Qt=N.getEdgesBetween(Q);Qt.length>1;){var pe=Qt[0];Qt.splice(0,1);var ue=mt.indexOf(pe);ue>=0&&mt.splice(ue,1),te--,Tt--}Rt=Q!=null?(mt.indexOf(Qt[0])+1)%te:0;for(var me=Math.abs(_-at)/Tt,Ee=Rt;It!=Tt;Ee=++Ee%te){var xe=mt[Ee].getOtherEnd(N);if(xe!=Q){var ar=(at+It*me)%360,xr=(ar+me)%360;xt.branchRadialLayout(xe,N,ar,xr,l+O,O),It++}}},xt.maxDiagonalInTree=function(N){for(var Q=F.MIN_VALUE,at=0;at<N.length;at++){var _=N[at].getDiagonal();_>Q&&(Q=_)}return Q},xt.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},xt.prototype.groupZeroDegreeMembers=function(){var N=this,Q={};this.memberGroups={},this.idToDummyNode={};for(var at=[],_=this.graphManager.getAllNodes(),l=0;l<_.length;l++){var O=(z=_[l]).getParent();this.getNodeDegreeWithChildren(z)!==0||O.id!=null&&this.getToBeTiled(O)||at.push(z)}for(l=0;l<at.length;l++){var z,lt=(z=at[l]).getParent().id;Q[lt]===void 0&&(Q[lt]=[]),Q[lt]=Q[lt].concat(z)}Object.keys(Q).forEach(function(W){if(Q[W].length>1){var gt="DummyCompound_"+W;N.memberGroups[gt]=Q[W];var mt=Q[W][0].getParent(),Tt=new f(N.graphManager);Tt.id=gt,Tt.paddingLeft=mt.paddingLeft||0,Tt.paddingRight=mt.paddingRight||0,Tt.paddingBottom=mt.paddingBottom||0,Tt.paddingTop=mt.paddingTop||0,N.idToDummyNode[gt]=Tt;var Rt=N.getGraphManager().add(N.newGraph(),Tt),It=mt.getChild();It.add(Tt);for(var te=0;te<Q[W].length;te++){var Qt=Q[W][te];It.remove(Qt),Rt.add(Qt)}}})},xt.prototype.clearCompounds=function(){var N={},Q={};this.performDFSOnCompounds();for(var at=0;at<this.compoundOrder.length;at++)Q[this.compoundOrder[at].id]=this.compoundOrder[at],N[this.compoundOrder[at].id]=[].concat(this.compoundOrder[at].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[at].getChild()),this.compoundOrder[at].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(N,Q)},xt.prototype.clearZeroDegreeMembers=function(){var N=this,Q=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(at){var _=N.idToDummyNode[at];if(Q[at]=N.tileNodes(N.memberGroups[at],_.paddingLeft+_.paddingRight),_.rect.width=Q[at].width,_.rect.height=Q[at].height,_.setCenter(Q[at].centerX,Q[at].centerY),_.labelMarginLeft=0,_.labelMarginTop=0,r.NODE_DIMENSIONS_INCLUDE_LABELS){var l=_.rect.width,O=_.rect.height;_.labelWidth&&(_.labelPosHorizontal=="left"?(_.rect.x-=_.labelWidth,_.setWidth(l+_.labelWidth),_.labelMarginLeft=_.labelWidth):_.labelPosHorizontal=="center"&&_.labelWidth>l?(_.rect.x-=(_.labelWidth-l)/2,_.setWidth(_.labelWidth),_.labelMarginLeft=(_.labelWidth-l)/2):_.labelPosHorizontal=="right"&&_.setWidth(l+_.labelWidth)),_.labelHeight&&(_.labelPosVertical=="top"?(_.rect.y-=_.labelHeight,_.setHeight(O+_.labelHeight),_.labelMarginTop=_.labelHeight):_.labelPosVertical=="center"&&_.labelHeight>O?(_.rect.y-=(_.labelHeight-O)/2,_.setHeight(_.labelHeight),_.labelMarginTop=(_.labelHeight-O)/2):_.labelPosVertical=="bottom"&&_.setHeight(O+_.labelHeight))}})},xt.prototype.repopulateCompounds=function(){for(var N=this.compoundOrder.length-1;N>=0;N--){var Q=this.compoundOrder[N],at=Q.id,_=Q.paddingLeft,l=Q.paddingTop,O=Q.labelMarginLeft,z=Q.labelMarginTop;this.adjustLocations(this.tiledMemberPack[at],Q.rect.x,Q.rect.y,_,l,O,z)}},xt.prototype.repopulateZeroDegreeMembers=function(){var N=this,Q=this.tiledZeroDegreePack;Object.keys(Q).forEach(function(at){var _=N.idToDummyNode[at],l=_.paddingLeft,O=_.paddingTop,z=_.labelMarginLeft,lt=_.labelMarginTop;N.adjustLocations(Q[at],_.rect.x,_.rect.y,l,O,z,lt)})},xt.prototype.getToBeTiled=function(N){var Q=N.id;if(this.toBeTiled[Q]!=null)return this.toBeTiled[Q];var at=N.getChild();if(at==null)return this.toBeTiled[Q]=!1,!1;for(var _=at.getNodes(),l=0;l<_.length;l++){var O=_[l];if(this.getNodeDegree(O)>0)return this.toBeTiled[Q]=!1,!1;if(O.getChild()!=null){if(!this.getToBeTiled(O))return this.toBeTiled[Q]=!1,!1}else this.toBeTiled[O.id]=!1}return this.toBeTiled[Q]=!0,!0},xt.prototype.getNodeDegree=function(N){N.id;for(var Q=N.getEdges(),at=0,_=0;_<Q.length;_++){var l=Q[_];l.getSource().id!==l.getTarget().id&&(at+=1)}return at},xt.prototype.getNodeDegreeWithChildren=function(N){var Q=this.getNodeDegree(N);if(N.getChild()==null)return Q;for(var at=N.getChild().getNodes(),_=0;_<at.length;_++){var l=at[_];Q+=this.getNodeDegreeWithChildren(l)}return Q},xt.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},xt.prototype.fillCompexOrderByDFS=function(N){for(var Q=0;Q<N.length;Q++){var at=N[Q];at.getChild()!=null&&this.fillCompexOrderByDFS(at.getChild().getNodes()),this.getToBeTiled(at)&&this.compoundOrder.push(at)}},xt.prototype.adjustLocations=function(N,Q,at,_,l,O,z){at+=l+z;for(var lt=Q+=_+O,W=0;W<N.rows.length;W++){var gt=N.rows[W];Q=lt;for(var mt=0,Tt=0;Tt<gt.length;Tt++){var Rt=gt[Tt];Rt.rect.x=Q,Rt.rect.y=at,Q+=Rt.rect.width+N.horizontalPadding,Rt.rect.height>mt&&(mt=Rt.rect.height)}at+=mt+N.verticalPadding}},xt.prototype.tileCompoundMembers=function(N,Q){var at=this;this.tiledMemberPack=[],Object.keys(N).forEach(function(_){var l=Q[_];if(at.tiledMemberPack[_]=at.tileNodes(N[_],l.paddingLeft+l.paddingRight),l.rect.width=at.tiledMemberPack[_].width,l.rect.height=at.tiledMemberPack[_].height,l.setCenter(at.tiledMemberPack[_].centerX,at.tiledMemberPack[_].centerY),l.labelMarginLeft=0,l.labelMarginTop=0,r.NODE_DIMENSIONS_INCLUDE_LABELS){var O=l.rect.width,z=l.rect.height;l.labelWidth&&(l.labelPosHorizontal=="left"?(l.rect.x-=l.labelWidth,l.setWidth(O+l.labelWidth),l.labelMarginLeft=l.labelWidth):l.labelPosHorizontal=="center"&&l.labelWidth>O?(l.rect.x-=(l.labelWidth-O)/2,l.setWidth(l.labelWidth),l.labelMarginLeft=(l.labelWidth-O)/2):l.labelPosHorizontal=="right"&&l.setWidth(O+l.labelWidth)),l.labelHeight&&(l.labelPosVertical=="top"?(l.rect.y-=l.labelHeight,l.setHeight(z+l.labelHeight),l.labelMarginTop=l.labelHeight):l.labelPosVertical=="center"&&l.labelHeight>z?(l.rect.y-=(l.labelHeight-z)/2,l.setHeight(l.labelHeight),l.labelMarginTop=(l.labelHeight-z)/2):l.labelPosVertical=="bottom"&&l.setHeight(z+l.labelHeight))}})},xt.prototype.tileNodes=function(N,Q){var at=this.tileNodesByFavoringDim(N,Q,!0),_=this.tileNodesByFavoringDim(N,Q,!1),l=this.getOrgRatio(at);return this.getOrgRatio(_)<l?_:at},xt.prototype.getOrgRatio=function(N){var Q=N.width/N.height;return Q<1&&(Q=1/Q),Q},xt.prototype.calcIdealRowWidth=function(N,Q){var at=r.TILING_PADDING_VERTICAL,_=r.TILING_PADDING_HORIZONTAL,l=N.length,O=0,z=0,lt=0;N.forEach(function(te){O+=te.getWidth(),z+=te.getHeight(),te.getWidth()>lt&&(lt=te.getWidth())});var W,gt=O/l,mt=z/l,Tt=Math.pow(at-_,2)+4*(gt+_)*(mt+at)*l,Rt=(_-at+Math.sqrt(Tt))/(2*(gt+_));Q?(W=Math.ceil(Rt))==Rt&&W++:W=Math.floor(Rt);var It=W*(gt+_)-_;return lt>It&&(It=lt),It+=2*_},xt.prototype.tileNodesByFavoringDim=function(N,Q,at){var _=r.TILING_PADDING_VERTICAL,l=r.TILING_PADDING_HORIZONTAL,O=r.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:Q,verticalPadding:_,horizontalPadding:l,centerX:0,centerY:0};O&&(z.idealRowWidth=this.calcIdealRowWidth(N,at));var lt=function(te){return te.rect.width*te.rect.height},W=function(te,Qt){return lt(Qt)-lt(te)};N.sort(function(te,Qt){var pe=W;return z.idealRowWidth?(pe=O)(te.id,Qt.id):pe(te,Qt)});for(var gt=0,mt=0,Tt=0;Tt<N.length;Tt++)gt+=(Rt=N[Tt]).getCenterX(),mt+=Rt.getCenterY();for(z.centerX=gt/N.length,z.centerY=mt/N.length,Tt=0;Tt<N.length;Tt++){var Rt=N[Tt];if(z.rows.length==0)this.insertNodeToRow(z,Rt,0,Q);else if(this.canAddHorizontal(z,Rt.rect.width,Rt.rect.height)){var It=z.rows.length-1;z.idealRowWidth||(It=this.getShortestRowIndex(z)),this.insertNodeToRow(z,Rt,It,Q)}else this.insertNodeToRow(z,Rt,z.rows.length,Q);this.shiftToLastRow(z)}return z},xt.prototype.insertNodeToRow=function(N,Q,at,_){var l=_;at==N.rows.length&&(N.rows.push([]),N.rowWidth.push(l),N.rowHeight.push(0));var O=N.rowWidth[at]+Q.rect.width;N.rows[at].length>0&&(O+=N.horizontalPadding),N.rowWidth[at]=O,N.width<O&&(N.width=O);var z=Q.rect.height;at>0&&(z+=N.verticalPadding);var lt=0;z>N.rowHeight[at]&&(lt=N.rowHeight[at],N.rowHeight[at]=z,lt=N.rowHeight[at]-lt),N.height+=lt,N.rows[at].push(Q)},xt.prototype.getShortestRowIndex=function(N){for(var Q=-1,at=Number.MAX_VALUE,_=0;_<N.rows.length;_++)N.rowWidth[_]<at&&(Q=_,at=N.rowWidth[_]);return Q},xt.prototype.getLongestRowIndex=function(N){for(var Q=-1,at=Number.MIN_VALUE,_=0;_<N.rows.length;_++)N.rowWidth[_]>at&&(Q=_,at=N.rowWidth[_]);return Q},xt.prototype.canAddHorizontal=function(N,Q,at){if(N.idealRowWidth){var _=N.rows.length-1;return N.rowWidth[_]+Q+N.horizontalPadding<=N.idealRowWidth}var l=this.getShortestRowIndex(N);if(l<0)return!0;var O=N.rowWidth[l];if(O+N.horizontalPadding+Q<=N.width)return!0;var z,lt,W=0;return N.rowHeight[l]<at&&l>0&&(W=at+N.verticalPadding-N.rowHeight[l]),z=N.width-O>=Q+N.horizontalPadding?(N.height+W)/(O+Q+N.horizontalPadding):(N.height+W)/N.width,W=at+N.verticalPadding,(lt=N.width<Q?(N.height+W)/Q:(N.height+W)/N.width)<1&&(lt=1/lt),z<1&&(z=1/z),z<lt},xt.prototype.shiftToLastRow=function(N){var Q=this.getLongestRowIndex(N),at=N.rowWidth.length-1,_=N.rows[Q],l=_[_.length-1],O=l.width+N.horizontalPadding;if(N.width-N.rowWidth[at]>O&&Q!=at){_.splice(-1,1),N.rows[at].push(l),N.rowWidth[Q]=N.rowWidth[Q]-O,N.rowWidth[at]=N.rowWidth[at]+O,N.width=N.rowWidth[instance.getLongestRowIndex(N)];for(var z=Number.MIN_VALUE,lt=0;lt<_.length;lt++)_[lt].height>z&&(z=_[lt].height);Q>0&&(z+=N.verticalPadding);var W=N.rowHeight[Q]+N.rowHeight[at];N.rowHeight[Q]=z,N.rowHeight[at]<l.height+N.verticalPadding&&(N.rowHeight[at]=l.height+N.verticalPadding);var gt=N.rowHeight[Q]+N.rowHeight[at];N.height+=gt-W,this.shiftToLastRow(N)}},xt.prototype.tilingPreLayout=function(){r.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},xt.prototype.tilingPostLayout=function(){r.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},xt.prototype.reduceTrees=function(){for(var N,Q=[],at=!0;at;){var _=this.graphManager.getAllNodes(),l=[];at=!1;for(var O=0;O<_.length;O++)if((N=_[O]).getEdges().length==1&&!N.getEdges()[0].isInterGraph&&N.getChild()==null){if(r.PURE_INCREMENTAL){var z=N.getEdges()[0].getOtherEnd(N),lt=new T(N.getCenterX()-z.getCenterX(),N.getCenterY()-z.getCenterY());l.push([N,N.getEdges()[0],N.getOwner(),lt])}else l.push([N,N.getEdges()[0],N.getOwner()]);at=!0}if(at==1){for(var W=[],gt=0;gt<l.length;gt++)l[gt][0].getEdges().length==1&&(W.push(l[gt]),l[gt][0].getOwner().remove(l[gt][0]));Q.push(W),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=Q},xt.prototype.growTree=function(N){for(var Q,at=N[N.length-1],_=0;_<at.length;_++)Q=at[_],this.findPlaceforPrunedNode(Q),Q[2].add(Q[0]),Q[2].add(Q[1],Q[1].source,Q[1].target);N.splice(N.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},xt.prototype.findPlaceforPrunedNode=function(N){var Q,at,_=N[0];if(at=_==N[1].source?N[1].target:N[1].source,r.PURE_INCREMENTAL)_.setCenter(at.getCenterX()+N[3].getWidth(),at.getCenterY()+N[3].getHeight());else{var l=at.startX,O=at.finishX,z=at.startY,lt=at.finishY,W=[0,0,0,0];if(z>0)for(var gt=l;gt<=O;gt++)W[0]+=this.grid[gt][z-1].length+this.grid[gt][z].length-1;if(O<this.grid.length-1)for(gt=z;gt<=lt;gt++)W[1]+=this.grid[O+1][gt].length+this.grid[O][gt].length-1;if(lt<this.grid[0].length-1)for(gt=l;gt<=O;gt++)W[2]+=this.grid[gt][lt+1].length+this.grid[gt][lt].length-1;if(l>0)for(gt=z;gt<=lt;gt++)W[3]+=this.grid[l-1][gt].length+this.grid[l][gt].length-1;for(var mt,Tt,Rt=F.MAX_VALUE,It=0;It<W.length;It++)W[It]<Rt?(Rt=W[It],mt=1,Tt=It):W[It]==Rt&&mt++;if(mt==3&&Rt==0)W[0]==0&&W[1]==0&&W[2]==0?Q=1:W[0]==0&&W[1]==0&&W[3]==0?Q=0:W[0]==0&&W[2]==0&&W[3]==0?Q=3:W[1]==0&&W[2]==0&&W[3]==0&&(Q=2);else if(mt==2&&Rt==0){var te=Math.floor(2*Math.random());Q=W[0]==0&&W[1]==0?te==0?0:1:W[0]==0&&W[2]==0?te==0?0:2:W[0]==0&&W[3]==0?te==0?0:3:W[1]==0&&W[2]==0?te==0?1:2:W[1]==0&&W[3]==0?te==0?1:3:te==0?2:3}else mt==4&&Rt==0?Q=te=Math.floor(4*Math.random()):Q=Tt;Q==0?_.setCenter(at.getCenterX(),at.getCenterY()-at.getHeight()/2-v.DEFAULT_EDGE_LENGTH-_.getHeight()/2):Q==1?_.setCenter(at.getCenterX()+at.getWidth()/2+v.DEFAULT_EDGE_LENGTH+_.getWidth()/2,at.getCenterY()):Q==2?_.setCenter(at.getCenterX(),at.getCenterY()+at.getHeight()/2+v.DEFAULT_EDGE_LENGTH+_.getHeight()/2):_.setCenter(at.getCenterX()-at.getWidth()/2-v.DEFAULT_EDGE_LENGTH-_.getWidth()/2,at.getCenterY())}},w.exports=xt},991:(w,p,s)=>{var o=s(551).FDLayoutNode,d=s(551).IMath;function M(u,r,h,v){o.call(this,u,r,h,v)}for(var f in M.prototype=Object.create(o.prototype),o)M[f]=o[f];M.prototype.calculateDisplacement=function(){var u=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=u.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=u.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=u.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=u.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementX=u.coolingFactor*u.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementY=u.coolingFactor*u.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},M.prototype.propogateDisplacementToChildren=function(u,r){for(var h,v=this.getChild().getNodes(),n=0;n<v.length;n++)(h=v[n]).getChild()==null?(h.displacementX+=u,h.displacementY+=r):h.propogateDisplacementToChildren(u,r)},M.prototype.move=function(){var u=this.graphManager.getLayout();this.child!=null&&this.child.getNodes().length!=0||(this.moveBy(this.displacementX,this.displacementY),u.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},M.prototype.setPred1=function(u){this.pred1=u},M.prototype.getPred1=function(){return pred1},M.prototype.getPred2=function(){return pred2},M.prototype.setNext=function(u){this.next=u},M.prototype.getNext=function(){return next},M.prototype.setProcessed=function(u){this.processed=u},M.prototype.isProcessed=function(){return processed},w.exports=M},902:(w,p,s)=>{function o(h){if(Array.isArray(h)){for(var v=0,n=Array(h.length);v<h.length;v++)n[v]=h[v];return n}return Array.from(h)}var d=s(806),M=s(551).LinkedList,f=s(551).Matrix,u=s(551).SVD;function r(){}r.handleConstraints=function(h){var v={};v.fixedNodeConstraint=h.constraints.fixedNodeConstraint,v.alignmentConstraint=h.constraints.alignmentConstraint,v.relativePlacementConstraint=h.constraints.relativePlacementConstraint;for(var n=new Map,y=new Map,b=[],T=[],I=h.getAllNodes(),F=0,X=0;X<I.length;X++){var K=I[X];K.getChild()==null&&(y.set(K.id,F++),b.push(K.getCenterX()),T.push(K.getCenterY()),n.set(K.id,K))}v.relativePlacementConstraint&&v.relativePlacementConstraint.forEach(function(ke){ke.gap||ke.gap==0||(ke.left?ke.gap=d.DEFAULT_EDGE_LENGTH+n.get(ke.left).getWidth()/2+n.get(ke.right).getWidth()/2:ke.gap=d.DEFAULT_EDGE_LENGTH+n.get(ke.top).getHeight()/2+n.get(ke.bottom).getHeight()/2)});var ot=function(ke){var ze=0,lr=0;return ke.forEach(function(ir){ze+=b[y.get(ir)],lr+=T[y.get(ir)]}),{x:ze/ke.size,y:lr/ke.size}},pt=function(ke,ze,lr,ir,ur){var zr=new Map;ke.forEach(function(pr,rr){zr.set(rr,0)}),ke.forEach(function(pr,rr){pr.forEach(function(Pr){zr.set(Pr.id,zr.get(Pr.id)+1)})});var cr=new Map,Nr=new Map,Fr=new M;zr.forEach(function(pr,rr){pr==0?(Fr.push(rr),lr||(ze=="horizontal"?cr.set(rr,y.has(rr)?b[y.get(rr)]:ir.get(rr)):cr.set(rr,y.has(rr)?T[y.get(rr)]:ir.get(rr)))):cr.set(rr,Number.NEGATIVE_INFINITY),lr&&Nr.set(rr,new Set([rr]))}),lr&&ur.forEach(function(pr){var rr=[];if(pr.forEach(function(wr){lr.has(wr)&&rr.push(wr)}),rr.length>0){var Pr=0;rr.forEach(function(wr){ze=="horizontal"?(cr.set(wr,y.has(wr)?b[y.get(wr)]:ir.get(wr)),Pr+=cr.get(wr)):(cr.set(wr,y.has(wr)?T[y.get(wr)]:ir.get(wr)),Pr+=cr.get(wr))}),Pr/=rr.length,pr.forEach(function(wr){lr.has(wr)||cr.set(wr,Pr)})}else{var ta=0;pr.forEach(function(wr){ta+=ze=="horizontal"?y.has(wr)?b[y.get(wr)]:ir.get(wr):y.has(wr)?T[y.get(wr)]:ir.get(wr)}),ta/=pr.length,pr.forEach(function(wr){cr.set(wr,ta)})}});for(var sa=function(){var pr=Fr.shift();ke.get(pr).forEach(function(rr){if(cr.get(rr.id)<cr.get(pr)+rr.gap)if(lr&&lr.has(rr.id)){var Pr=void 0;if(Pr=ze=="horizontal"?y.has(rr.id)?b[y.get(rr.id)]:ir.get(rr.id):y.has(rr.id)?T[y.get(rr.id)]:ir.get(rr.id),cr.set(rr.id,Pr),Pr<cr.get(pr)+rr.gap){var ta=cr.get(pr)+rr.gap-Pr;Nr.get(pr).forEach(function(wr){cr.set(wr,cr.get(wr)-ta)})}}else cr.set(rr.id,cr.get(pr)+rr.gap);zr.set(rr.id,zr.get(rr.id)-1),zr.get(rr.id)==0&&Fr.push(rr.id),lr&&Nr.set(rr.id,(function(wr,Sa){var ca=new Set(wr),ba=!0,ra=!1,Dr=void 0;try{for(var la,qr=Sa[Symbol.iterator]();!(ba=(la=qr.next()).done);ba=!0){var ma=la.value;ca.add(ma)}}catch(Ja){ra=!0,Dr=Ja}finally{try{!ba&&qr.return&&qr.return()}finally{if(ra)throw Dr}}return ca})(Nr.get(pr),Nr.get(rr.id)))})};Fr.length!=0;)sa();if(lr){var yr=new Set;ke.forEach(function(pr,rr){pr.length==0&&yr.add(rr)});var kr=[];Nr.forEach(function(pr,rr){if(yr.has(rr)){var Pr=!1,ta=!0,wr=!1,Sa=void 0;try{for(var ca,ba=pr[Symbol.iterator]();!(ta=(ca=ba.next()).done);ta=!0){var ra=ca.value;lr.has(ra)&&(Pr=!0)}}catch(qr){wr=!0,Sa=qr}finally{try{!ta&&ba.return&&ba.return()}finally{if(wr)throw Sa}}if(!Pr){var Dr=!1,la=void 0;kr.forEach(function(qr,ma){qr.has([].concat(o(pr))[0])&&(Dr=!0,la=ma)}),Dr?pr.forEach(function(qr){kr[la].add(qr)}):kr.push(new Set(pr))}}}),kr.forEach(function(pr,rr){var Pr=Number.POSITIVE_INFINITY,ta=Number.POSITIVE_INFINITY,wr=Number.NEGATIVE_INFINITY,Sa=Number.NEGATIVE_INFINITY,ca=!0,ba=!1,ra=void 0;try{for(var Dr,la=pr[Symbol.iterator]();!(ca=(Dr=la.next()).done);ca=!0){var qr=Dr.value,ma=void 0;ma=ze=="horizontal"?y.has(qr)?b[y.get(qr)]:ir.get(qr):y.has(qr)?T[y.get(qr)]:ir.get(qr);var Ja=cr.get(qr);ma<Pr&&(Pr=ma),ma>wr&&(wr=ma),Ja<ta&&(ta=Ja),Ja>Sa&&(Sa=Ja)}}catch(dn){ba=!0,ra=dn}finally{try{!ca&&la.return&&la.return()}finally{if(ba)throw ra}}var sn=(Pr+wr)/2-(ta+Sa)/2,fn=!0,Na=!1,Cn=void 0;try{for(var Mn,nn=pr[Symbol.iterator]();!(fn=(Mn=nn.next()).done);fn=!0){var An=Mn.value;cr.set(An,cr.get(An)+sn)}}catch(dn){Na=!0,Cn=dn}finally{try{!fn&&nn.return&&nn.return()}finally{if(Na)throw Cn}}})}return cr},xt=function(ke){var ze=0,lr=0,ir=0,ur=0;if(ke.forEach(function(Fr){Fr.left?b[y.get(Fr.left)]-b[y.get(Fr.right)]>=0?ze++:lr++:T[y.get(Fr.top)]-T[y.get(Fr.bottom)]>=0?ir++:ur++}),ze>lr&&ir>ur)for(var zr=0;zr<y.size;zr++)b[zr]=-1*b[zr],T[zr]=-1*T[zr];else if(ze>lr)for(var cr=0;cr<y.size;cr++)b[cr]=-1*b[cr];else if(ir>ur)for(var Nr=0;Nr<y.size;Nr++)T[Nr]=-1*T[Nr]},ee=function(ke){var ze=[],lr=new M,ir=new Set,ur=0;return ke.forEach(function(zr,cr){if(!ir.has(cr)){ze[ur]=[];var Nr=cr;for(lr.push(Nr),ir.add(Nr),ze[ur].push(Nr);lr.length!=0;)Nr=lr.shift(),ke.get(Nr).forEach(function(Fr){ir.has(Fr.id)||(lr.push(Fr.id),ir.add(Fr.id),ze[ur].push(Fr.id))});ur++}}),ze},N=function(ke){var ze=new Map;return ke.forEach(function(lr,ir){ze.set(ir,[])}),ke.forEach(function(lr,ir){lr.forEach(function(ur){ze.get(ir).push(ur),ze.get(ur.id).push({id:ir,gap:ur.gap,direction:ur.direction})})}),ze},Q=function(ke){var ze=new Map;return ke.forEach(function(lr,ir){ze.set(ir,[])}),ke.forEach(function(lr,ir){lr.forEach(function(ur){ze.get(ur.id).push({id:ir,gap:ur.gap,direction:ur.direction})})}),ze},at=[],_=[],l=!1,O=!1,z=new Set,lt=new Map,W=new Map,gt=[];if(v.fixedNodeConstraint&&v.fixedNodeConstraint.forEach(function(ke){z.add(ke.nodeId)}),v.relativePlacementConstraint&&(v.relativePlacementConstraint.forEach(function(ke){ke.left?(lt.has(ke.left)?lt.get(ke.left).push({id:ke.right,gap:ke.gap,direction:"horizontal"}):lt.set(ke.left,[{id:ke.right,gap:ke.gap,direction:"horizontal"}]),lt.has(ke.right)||lt.set(ke.right,[])):(lt.has(ke.top)?lt.get(ke.top).push({id:ke.bottom,gap:ke.gap,direction:"vertical"}):lt.set(ke.top,[{id:ke.bottom,gap:ke.gap,direction:"vertical"}]),lt.has(ke.bottom)||lt.set(ke.bottom,[]))}),W=N(lt),gt=ee(W)),d.TRANSFORM_ON_CONSTRAINT_HANDLING){if(v.fixedNodeConstraint&&v.fixedNodeConstraint.length>1)v.fixedNodeConstraint.forEach(function(ke,ze){at[ze]=[ke.position.x,ke.position.y],_[ze]=[b[y.get(ke.nodeId)],T[y.get(ke.nodeId)]]}),l=!0;else if(v.alignmentConstraint)(function(){var ke=0;if(v.alignmentConstraint.vertical){for(var ze=v.alignmentConstraint.vertical,lr=function(Nr){var Fr=new Set;ze[Nr].forEach(function(kr){Fr.add(kr)});var sa=new Set([].concat(o(Fr)).filter(function(kr){return z.has(kr)})),yr=void 0;yr=sa.size>0?b[y.get(sa.values().next().value)]:ot(Fr).x,ze[Nr].forEach(function(kr){at[ke]=[yr,T[y.get(kr)]],_[ke]=[b[y.get(kr)],T[y.get(kr)]],ke++})},ir=0;ir<ze.length;ir++)lr(ir);l=!0}if(v.alignmentConstraint.horizontal){for(var ur=v.alignmentConstraint.horizontal,zr=function(Nr){var Fr=new Set;ur[Nr].forEach(function(kr){Fr.add(kr)});var sa=new Set([].concat(o(Fr)).filter(function(kr){return z.has(kr)})),yr=void 0;yr=sa.size>0?b[y.get(sa.values().next().value)]:ot(Fr).y,ur[Nr].forEach(function(kr){at[ke]=[b[y.get(kr)],yr],_[ke]=[b[y.get(kr)],T[y.get(kr)]],ke++})},cr=0;cr<ur.length;cr++)zr(cr);l=!0}v.relativePlacementConstraint&&(O=!0)})();else if(v.relativePlacementConstraint){for(var mt=0,Tt=0,Rt=0;Rt<gt.length;Rt++)gt[Rt].length>mt&&(mt=gt[Rt].length,Tt=Rt);if(mt<W.size/2)xt(v.relativePlacementConstraint),l=!1,O=!1;else{var It=new Map,te=new Map,Qt=[];gt[Tt].forEach(function(ke){lt.get(ke).forEach(function(ze){ze.direction=="horizontal"?(It.has(ke)?It.get(ke).push(ze):It.set(ke,[ze]),It.has(ze.id)||It.set(ze.id,[]),Qt.push({left:ke,right:ze.id})):(te.has(ke)?te.get(ke).push(ze):te.set(ke,[ze]),te.has(ze.id)||te.set(ze.id,[]),Qt.push({top:ke,bottom:ze.id}))})}),xt(Qt),O=!1;var pe=pt(It,"horizontal"),ue=pt(te,"vertical");gt[Tt].forEach(function(ke,ze){_[ze]=[b[y.get(ke)],T[y.get(ke)]],at[ze]=[],pe.has(ke)?at[ze][0]=pe.get(ke):at[ze][0]=b[y.get(ke)],ue.has(ke)?at[ze][1]=ue.get(ke):at[ze][1]=T[y.get(ke)]}),l=!0}}if(l){for(var me,Ee=f.transpose(at),xe=f.transpose(_),ar=0;ar<Ee.length;ar++)Ee[ar]=f.multGamma(Ee[ar]),xe[ar]=f.multGamma(xe[ar]);var xr=f.multMat(Ee,f.transpose(xe)),sr=u.svd(xr);me=f.multMat(sr.V,f.transpose(sr.U));for(var Qe=0;Qe<y.size;Qe++){var or=[b[Qe],T[Qe]],Wr=[me[0][0],me[1][0]],oa=[me[0][1],me[1][1]];b[Qe]=f.dotProduct(or,Wr),T[Qe]=f.dotProduct(or,oa)}O&&xt(v.relativePlacementConstraint)}}if(d.ENFORCE_CONSTRAINTS){if(v.fixedNodeConstraint&&v.fixedNodeConstraint.length>0){var Sr={x:0,y:0};v.fixedNodeConstraint.forEach(function(ke,ze){var lr,ir,ur={x:b[y.get(ke.nodeId)],y:T[y.get(ke.nodeId)]},zr=ke.position,cr=(ir=ur,{x:(lr=zr).x-ir.x,y:lr.y-ir.y});Sr.x+=cr.x,Sr.y+=cr.y}),Sr.x/=v.fixedNodeConstraint.length,Sr.y/=v.fixedNodeConstraint.length,b.forEach(function(ke,ze){b[ze]+=Sr.x}),T.forEach(function(ke,ze){T[ze]+=Sr.y}),v.fixedNodeConstraint.forEach(function(ke){b[y.get(ke.nodeId)]=ke.position.x,T[y.get(ke.nodeId)]=ke.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Rr=v.alignmentConstraint.vertical,Mr=function(ke){var ze=new Set;Rr[ke].forEach(function(ur){ze.add(ur)});var lr=new Set([].concat(o(ze)).filter(function(ur){return z.has(ur)})),ir=void 0;ir=lr.size>0?b[y.get(lr.values().next().value)]:ot(ze).x,ze.forEach(function(ur){z.has(ur)||(b[y.get(ur)]=ir)})},er=0;er<Rr.length;er++)Mr(er);if(v.alignmentConstraint.horizontal)for(var Xr=v.alignmentConstraint.horizontal,Kr=function(ke){var ze=new Set;Xr[ke].forEach(function(ur){ze.add(ur)});var lr=new Set([].concat(o(ze)).filter(function(ur){return z.has(ur)})),ir=void 0;ir=lr.size>0?T[y.get(lr.values().next().value)]:ot(ze).y,ze.forEach(function(ur){z.has(ur)||(T[y.get(ur)]=ir)})},Ur=0;Ur<Xr.length;Ur++)Kr(Ur)}v.relativePlacementConstraint&&(function(){var ke=new Map,ze=new Map,lr=new Map,ir=new Map,ur=new Map,zr=new Map,cr=new Set,Nr=new Set;if(z.forEach(function(bt){cr.add(bt),Nr.add(bt)}),v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Fr=v.alignmentConstraint.vertical,sa=function(bt){lr.set("dummy"+bt,[]),Fr[bt].forEach(function(Nt){ke.set(Nt,"dummy"+bt),lr.get("dummy"+bt).push(Nt),z.has(Nt)&&cr.add("dummy"+bt)}),ur.set("dummy"+bt,b[y.get(Fr[bt][0])])},yr=0;yr<Fr.length;yr++)sa(yr);if(v.alignmentConstraint.horizontal)for(var kr=v.alignmentConstraint.horizontal,pr=function(bt){ir.set("dummy"+bt,[]),kr[bt].forEach(function(Nt){ze.set(Nt,"dummy"+bt),ir.get("dummy"+bt).push(Nt),z.has(Nt)&&Nr.add("dummy"+bt)}),zr.set("dummy"+bt,T[y.get(kr[bt][0])])},rr=0;rr<kr.length;rr++)pr(rr)}var Pr=new Map,ta=new Map,wr=function(bt){lt.get(bt).forEach(function(Nt){var Dt=void 0,st=void 0;Nt.direction=="horizontal"?(Dt=ke.get(bt)?ke.get(bt):bt,st=ke.get(Nt.id)?{id:ke.get(Nt.id),gap:Nt.gap,direction:Nt.direction}:Nt,Pr.has(Dt)?Pr.get(Dt).push(st):Pr.set(Dt,[st]),Pr.has(st.id)||Pr.set(st.id,[])):(Dt=ze.get(bt)?ze.get(bt):bt,st=ze.get(Nt.id)?{id:ze.get(Nt.id),gap:Nt.gap,direction:Nt.direction}:Nt,ta.has(Dt)?ta.get(Dt).push(st):ta.set(Dt,[st]),ta.has(st.id)||ta.set(st.id,[]))})},Sa=!0,ca=!1,ba=void 0;try{for(var ra,Dr=lt.keys()[Symbol.iterator]();!(Sa=(ra=Dr.next()).done);Sa=!0)wr(ra.value)}catch(bt){ca=!0,ba=bt}finally{try{!Sa&&Dr.return&&Dr.return()}finally{if(ca)throw ba}}var la=N(Pr),qr=N(ta),ma=ee(la),Ja=ee(qr),sn=Q(Pr),fn=Q(ta),Na=[],Cn=[];ma.forEach(function(bt,Nt){Na[Nt]=[],bt.forEach(function(Dt){sn.get(Dt).length==0&&Na[Nt].push(Dt)})}),Ja.forEach(function(bt,Nt){Cn[Nt]=[],bt.forEach(function(Dt){fn.get(Dt).length==0&&Cn[Nt].push(Dt)})});var Mn=pt(Pr,"horizontal",cr,ur,Na),nn=pt(ta,"vertical",Nr,zr,Cn),An=function(bt){lr.get(bt)?lr.get(bt).forEach(function(Nt){b[y.get(Nt)]=Mn.get(bt)}):b[y.get(bt)]=Mn.get(bt)},dn=!0,Ln=!1,Fn=void 0;try{for(var g,tt=Mn.keys()[Symbol.iterator]();!(dn=(g=tt.next()).done);dn=!0)An(g.value)}catch(bt){Ln=!0,Fn=bt}finally{try{!dn&&tt.return&&tt.return()}finally{if(Ln)throw Fn}}var B=function(bt){ir.get(bt)?ir.get(bt).forEach(function(Nt){T[y.get(Nt)]=nn.get(bt)}):T[y.get(bt)]=nn.get(bt)},Z=!0,H=!1,yt=void 0;try{for(var ut,ht=nn.keys()[Symbol.iterator]();!(Z=(ut=ht.next()).done);Z=!0)B(ut.value)}catch(bt){H=!0,yt=bt}finally{try{!Z&&ht.return&&ht.return()}finally{if(H)throw yt}}})()}for(var Jr=0;Jr<I.length;Jr++){var Yr=I[Jr];Yr.getChild()==null&&Yr.setCenter(b[y.get(Yr.id)],T[y.get(Yr.id)])}},w.exports=r},551:w=>{w.exports=L}},P={},E=(function w(p){var s=P[p];if(s!==void 0)return s.exports;var o=P[p]={exports:{}};return j[p](o,o.exports,w),o.exports})(45);return E})()});var Wn=Gi.coseBase,Dp=Gi.layoutBase;function Zi(L,j){let P=Ig(L),E=P.filter(o=>Ng(o,L)),w=0,p=0,s=[];if(E.length>1){let o=lh(E);for(let M=0;M<E.length;++M){let f=E[M];f.angle=Math.atan2(f.x-o.x,f.y-o.y)}E.sort((M,f)=>f.angle-M.angle);let d=E[E.length-1];for(let M=0;M<E.length;++M){let f=E[M];p+=(d.x+f.x)*(f.y-d.y);let u={x:(f.x+d.x)/2,y:(f.y+d.y)/2},r=null;for(let h=0;h<f.parentIndex.length;++h)if(d.parentIndex.includes(f.parentIndex[h])){let v=L[f.parentIndex[h]],n=Math.atan2(f.x-v.x,f.y-v.y),y=Math.atan2(d.x-v.x,d.y-v.y),b=y-n;b<0&&(b+=2*Math.PI);let T=y-b/2,I=Sn(u,{x:v.x+v.radius*Math.sin(T),y:v.y+v.radius*Math.cos(T)});I>v.radius*2&&(I=v.radius*2),(r==null||r.width>I)&&(r={circle:v,width:I,p1:f,p2:d,large:I>v.radius,sweep:!0})}r!=null&&(s.push(r),w+=gs(r.circle.radius,r.width),d=f)}}else{let o=L[0];for(let M=1;M<L.length;++M)L[M].radius<o.radius&&(o=L[M]);let d=!1;for(let M=0;M<L.length;++M)if(Sn(L[M],o)>Math.abs(o.radius-L[M].radius)){d=!0;break}d?w=p=0:(w=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-1e-10,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return p/=2,j&&(j.area=w+p,j.arcArea=w,j.polygonArea=p,j.arcs=s,j.innerPoints=E,j.intersectionPoints=P),w+p}function Ng(L,j){return j.every(P=>Sn(L,P)<P.radius+1e-10)}function Ig(L){let j=[];for(let P=0;P<L.length;++P)for(let E=P+1;E<L.length;++E){let w=sh(L[P],L[E]);for(let p of w)p.parentIndex=[P,E],j.push(p)}return j}function gs(L,j){return L*L*Math.acos(1-j/L)-(L-j)*Math.sqrt(j*(2*L-j))}function Sn(L,j){return Math.sqrt((L.x-j.x)*(L.x-j.x)+(L.y-j.y)*(L.y-j.y))}function xs(L,j,P){if(P>=L+j)return 0;if(P<=Math.abs(L-j))return Math.PI*Math.min(L,j)*Math.min(L,j);let E=L-(P*P-j*j+L*L)/(2*P),w=j-(P*P-L*L+j*j)/(2*P);return gs(L,E)+gs(j,w)}function sh(L,j){let P=Sn(L,j),E=L.radius,w=j.radius;if(P>=E+w||P<=Math.abs(E-w))return[];let p=(E*E-w*w+P*P)/(2*P),s=Math.sqrt(E*E-p*p),o=L.x+p*(j.x-L.x)/P,d=L.y+p*(j.y-L.y)/P,M=-(j.y-L.y)*(s/P),f=-(j.x-L.x)*(s/P);return[{x:o+M,y:d-f},{x:o-M,y:d+f}]}function lh(L){let j={x:0,y:0};for(let P of L)j.x+=P.x,j.y+=P.y;return j.x/=L.length,j.y/=L.length,j}function Pg(L,j,P,E){E=E||{};let w=E.maxIterations||100,p=E.tolerance||1e-10,s=L(j),o=L(P),d=P-j;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return j;if(o===0)return P;for(let M=0;M<w;++M){d/=2;let f=j+d,u=L(f);if(u*s>=0&&(j=f),Math.abs(d)<p||u===0)return f}return j+d}function ps(L){let j=new Array(L);for(let P=0;P<L;++P)j[P]=0;return j}function oh(L,j){return ps(L).map(()=>ps(j))}function hi(L,j){let P=0;for(let E=0;E<L.length;++E)P+=L[E]*j[E];return P}function ms(L){return Math.sqrt(hi(L,L))}function ys(L,j,P){for(let E=0;E<j.length;++E)L[E]=j[E]*P}function Un(L,j,P,E,w){for(let p=0;p<L.length;++p)L[p]=j*P[p]+E*w[p]}function hh(L,j,P){P=P||{};let E=P.maxIterations||j.length*200,w=P.nonZeroDelta||1.05,p=P.zeroDelta||.001,s=P.minErrorDelta||1e-6,o=P.minErrorDelta||1e-5,d=P.rho!==void 0?P.rho:1,M=P.chi!==void 0?P.chi:2,f=P.psi!==void 0?P.psi:-.5,u=P.sigma!==void 0?P.sigma:.5,r,h=j.length,v=new Array(h+1);v[0]=j,v[0].fx=L(j),v[0].id=0;for(let X=0;X<h;++X){let K=j.slice();K[X]=K[X]?K[X]*w:p,v[X+1]=K,v[X+1].fx=L(K),v[X+1].id=X+1}function n(X){for(let K=0;K<X.length;K++)v[h][K]=X[K];v[h].fx=X.fx}let y=(X,K)=>X.fx-K.fx,b=j.slice(),T=j.slice(),I=j.slice(),F=j.slice();for(let X=0;X<E;++X){if(v.sort(y),P.history){let ot=v.map(pt=>{let xt=pt.slice();return xt.fx=pt.fx,xt.id=pt.id,xt});ot.sort((pt,xt)=>pt.id-xt.id),P.history.push({x:v[0].slice(),fx:v[0].fx,simplex:ot})}r=0;for(let ot=0;ot<h;++ot)r=Math.max(r,Math.abs(v[0][ot]-v[1][ot]));if(Math.abs(v[0].fx-v[h].fx)<s&&r<o)break;for(let ot=0;ot<h;++ot){b[ot]=0;for(let pt=0;pt<h;++pt)b[ot]+=v[pt][ot];b[ot]/=h}let K=v[h];if(Un(T,1+d,b,-d,K),T.fx=L(T),T.fx<v[0].fx)Un(F,1+M,b,-M,K),F.fx=L(F),F.fx<T.fx?n(F):n(T);else if(T.fx>=v[h-1].fx){let ot=!1;if(T.fx>K.fx?(Un(I,1+f,b,-f,K),I.fx=L(I),I.fx<K.fx?n(I):ot=!0):(Un(I,1-f*d,b,f*d,K),I.fx=L(I),I.fx<T.fx?n(I):ot=!0),ot){if(u>=1)break;for(let pt=1;pt<v.length;++pt)Un(v[pt],1-u,v[0],u,v[pt]),v[pt].fx=L(v[pt])}}else n(T)}return v.sort(y),{fx:v[0].fx,x:v[0]}}function Dg(L,j,P,E,w,p,s){let o=P.fx,d=hi(P.fxprime,j),M=o,f=o,u=d,r=0;w=w||1,p=p||1e-6,s=s||.1;function h(v,n,y){for(let b=0;b<16;++b)if(w=(v+n)/2,Un(E.x,1,P.x,w,j),M=E.fx=L(E.x,E.fxprime),u=hi(E.fxprime,j),M>o+p*w*d||M>=y)n=w;else{if(Math.abs(u)<=-s*d)return w;u*(n-v)>=0&&(n=v),v=w,y=M}return 0}for(let v=0;v<10;++v){if(Un(E.x,1,P.x,w,j),M=E.fx=L(E.x,E.fxprime),u=hi(E.fxprime,j),M>o+p*w*d||v&&M>=f)return h(r,w,f);if(Math.abs(u)<=-s*d)return w;if(u>=0)return h(w,r,M);f=M,r=w,w*=2}return w}function Og(L,j,P){let E={x:j.slice(),fx:0,fxprime:j.slice()},w={x:j.slice(),fx:0,fxprime:j.slice()},p=j.slice(),s,o,d=1,M;P=P||{},M=P.maxIterations||j.length*20,E.fx=L(E.x,E.fxprime),s=E.fxprime.slice(),ys(s,E.fxprime,-1);for(let f=0;f<M;++f){if(d=Dg(L,s,E,w,d),P.history&&P.history.push({x:E.x.slice(),fx:E.fx,fxprime:E.fxprime.slice(),alpha:d}),!d)ys(s,E.fxprime,-1);else{Un(p,1,w.fxprime,-1,E.fxprime);let u=hi(E.fxprime,E.fxprime),r=Math.max(0,hi(p,w.fxprime)/u);Un(s,r,s,-1,w.fxprime),o=E,E=w,w=o}if(ms(E.fxprime)<=1e-5)break}return P.history&&P.history.push({x:E.x.slice(),fx:E.fx,fxprime:E.fxprime.slice(),alpha:d}),E}function Rg(L,j={}){j.maxIterations=j.maxIterations||500;let P=j.initialLayout||Wg,E=j.lossFunction||Ki,w=zg(L,j),p=P(w,j),s=Object.keys(p),o=[];for(let f of s)o.push(p[f].x),o.push(p[f].y);let M=hh(f=>{let u={};for(let r=0;r<s.length;++r){let h=s[r];u[h]={x:f[2*r],y:f[2*r+1],radius:p[h].radius}}return E(u,w)},o,j).x;for(let f=0;f<s.length;++f){let u=s[f];p[u].x=M[2*f],p[u].y=M[2*f+1]}return p}var ch=1e-10;function ws(L,j,P){return Math.min(L,j)*Math.min(L,j)*Math.PI<=P+ch?Math.abs(L-j):Pg(E=>xs(L,j,E)-P,0,L+j)}function zg(L,j={}){let P=j.distinct,E=L.map(o=>Object.assign({},o));function w(o){return o.join(";")}if(P){let o=new Map;for(let d of E)for(let M=0;M<d.sets.length;M++){let f=String(d.sets[M]);o.set(f,d.size+(o.get(f)||0));for(let u=M+1;u<d.sets.length;u++){let r=String(d.sets[u]),h=`${f};${r}`,v=`${r};${f}`;o.set(h,d.size+(o.get(h)||0)),o.set(v,d.size+(o.get(v)||0))}}for(let d of E)d.sets.length<3&&(d.size=o.get(w(d.sets)))}let p=[],s=new Set;for(let o of E)if(o.sets.length===1)p.push(o.sets[0]);else if(o.sets.length===2){let d=o.sets[0],M=o.sets[1];s.add(w(o.sets)),s.add(w([M,d]))}p.sort((o,d)=>o===d?0:o<d?-1:1);for(let o=0;o<p.length;++o){let d=p[o];for(let M=o+1;M<p.length;++M){let f=p[M];s.has(w([d,f]))||E.push({sets:[d,f],size:0})}}return E}function Bg(L,j,P){let E=oh(j.length,j.length),w=oh(j.length,j.length);return L.filter(p=>p.sets.length===2).forEach(p=>{let s=P[p.sets[0]],o=P[p.sets[1]],d=Math.sqrt(j[s].size/Math.PI),M=Math.sqrt(j[o].size/Math.PI),f=ws(d,M,p.size);E[s][o]=E[o][s]=f;let u=0;p.size+1e-10>=Math.min(j[s].size,j[o].size)?u=1:p.size<=1e-10&&(u=-1),w[s][o]=w[o][s]=u}),{distances:E,constraints:w}}function Hg(L,j,P,E){for(let p=0;p<j.length;++p)j[p]=0;let w=0;for(let p=0;p<P.length;++p){let s=L[2*p],o=L[2*p+1];for(let d=p+1;d<P.length;++d){let M=L[2*d],f=L[2*d+1],u=P[p][d],r=E[p][d],h=(M-s)*(M-s)+(f-o)*(f-o),v=Math.sqrt(h),n=h-u*u;r>0&&v<=u||r<0&&v>=u||(w+=2*n*n,j[2*p]+=4*n*(s-M),j[2*p+1]+=4*n*(o-f),j[2*d]+=4*n*(M-s),j[2*d+1]+=4*n*(f-o))}}return w}function Wg(L,j={}){let P=Yg(L,j),E=j.lossFunction||Ki;if(L.length>=8){let w=Ug(L,j),p=E(w,L),s=E(P,L);p+1e-8<s&&(P=w)}return P}function Ug(L,j={}){let P=j.restarts||10,E=[],w={};for(let r of L)r.sets.length===1&&(w[r.sets[0]]=E.length,E.push(r));let{distances:p,constraints:s}=Bg(L,E,w),o=ms(p.map(ms))/p.length;p=p.map(r=>r.map(h=>h/o));let d=(r,h)=>Hg(r,h,p,s),M=null;for(let r=0;r<P;++r){let h=ps(p.length*2).map(Math.random),v=Og(d,h,j);(!M||v.fx<M.fx)&&(M=v)}let f=M.x,u={};for(let r=0;r<E.length;++r){let h=E[r];u[h.sets[0]]={x:f[2*r]*o,y:f[2*r+1]*o,radius:Math.sqrt(h.size/Math.PI)}}if(j.history)for(let r of j.history)ys(r.x,o);return u}function Yg(L,j){let P=j&&j.lossFunction?j.lossFunction:Ki,E={},w={};for(let u of L)if(u.sets.length===1){let r=u.sets[0];E[r]={x:1e10,y:1e10,rowid:E.length,size:u.size,radius:Math.sqrt(u.size/Math.PI)},w[r]=[]}L=L.filter(u=>u.sets.length===2);for(let u of L){let r=u.weight!=null?u.weight:1,h=u.sets[0],v=u.sets[1];u.size+ch>=Math.min(E[h].size,E[v].size)&&(r=0),w[h].push({set:v,size:u.size,weight:r}),w[v].push({set:h,size:u.size,weight:r})}let p=[];Object.keys(w).forEach(u=>{let r=0;for(let h=0;h<w[u].length;++h)r+=w[u][h].size*w[u][h].weight;p.push({set:u,size:r})});function s(u,r){return r.size-u.size}p.sort(s);let o={};function d(u){return u.set in o}function M(u,r){E[r].x=u.x,E[r].y=u.y,o[r]=!0}M({x:0,y:0},p[0].set);for(let u=1;u<p.length;++u){let r=p[u].set,h=w[r].filter(d),v=E[r];if(h.sort(s),h.length===0)throw"ERROR: missing pairwise overlap information";let n=[];for(var f=0;f<h.length;++f){let T=E[h[f].set],I=ws(v.radius,T.radius,h[f].size);n.push({x:T.x+I,y:T.y}),n.push({x:T.x-I,y:T.y}),n.push({y:T.y+I,x:T.x}),n.push({y:T.y-I,x:T.x});for(let F=f+1;F<h.length;++F){let X=E[h[F].set],K=ws(v.radius,X.radius,h[F].size),ot=sh({x:T.x,y:T.y,radius:I},{x:X.x,y:X.y,radius:K});n.push(...ot)}}let y=1e50,b=n[0];for(let T of n){E[r].x=T.x,E[r].y=T.y;let I=P(E,L);I<y&&(y=I,b=T)}M(b,r)}return E}function Ki(L,j){let P=0;for(let E of j){if(E.sets.length===1)continue;let w;if(E.sets.length===2){let s=L[E.sets[0]],o=L[E.sets[1]];w=xs(s.radius,o.radius,Sn(s,o))}else w=Zi(E.sets.map(s=>L[s]));let p=E.weight!=null?E.weight:1;P+=p*(w-E.size)*(w-E.size)}return P}function Vg(L,j){let P=0;for(let E of j){if(E.sets.length===1)continue;let w;if(E.sets.length===2){let o=L[E.sets[0]],d=L[E.sets[1]];w=xs(o.radius,d.radius,Sn(o,d))}else w=Zi(E.sets.map(o=>L[o]));let p=E.weight!=null?E.weight:1,s=Math.log((w+1)/(E.size+1));P+=p*s*s}return P}function jg(L,j,P){if(P==null?L.sort((w,p)=>p.radius-w.radius):L.sort(P),L.length>0){let w=L[0].x,p=L[0].y;for(let s of L)s.x-=w,s.y-=p}if(L.length===2&&Sn(L[0],L[1])<Math.abs(L[1].radius-L[0].radius)&&(L[1].x=L[0].x+L[0].radius-L[1].radius-1e-10,L[1].y=L[0].y),L.length>1){let w=Math.atan2(L[1].x,L[1].y)-j,p=Math.cos(w),s=Math.sin(w);for(let o of L){let d=o.x,M=o.y;o.x=p*d-s*M,o.y=s*d+p*M}}if(L.length>2){let w=Math.atan2(L[2].x,L[2].y)-j;for(;w<0;)w+=2*Math.PI;for(;w>2*Math.PI;)w-=2*Math.PI;if(w>Math.PI){let p=L[1].y/(1e-10+L[1].x);for(let s of L){var E=(s.x+p*s.y)/(1+p*p);s.x=2*E-s.x,s.y=2*E*p-s.y}}}}function Xg(L){L.forEach(w=>{w.parent=w});function j(w){return w.parent!==w&&(w.parent=j(w.parent)),w.parent}function P(w,p){let s=j(w),o=j(p);s.parent=o}for(let w=0;w<L.length;++w)for(let p=w+1;p<L.length;++p){let s=L[w].radius+L[p].radius;Sn(L[w],L[p])+1e-10<s&&P(L[p],L[w])}let E=new Map;for(let w=0;w<L.length;++w){let p=j(L[w]).parent.setid;E.has(p)||E.set(p,[]),E.get(p).push(L[w])}return L.forEach(w=>{delete w.parent}),Array.from(E.values())}function bs(L){let j=P=>{let E=L.reduce((p,s)=>Math.max(p,s[P]+s.radius),Number.NEGATIVE_INFINITY),w=L.reduce((p,s)=>Math.min(p,s[P]-s.radius),Number.POSITIVE_INFINITY);return{max:E,min:w}};return{xRange:j("x"),yRange:j("y")}}function qg(L,j,P){j==null&&(j=Math.PI/2);let E=uh(L).map(M=>Object.assign({},M)),w=Xg(E);for(let M of w){jg(M,j,P);let f=bs(M);M.size=(f.xRange.max-f.xRange.min)*(f.yRange.max-f.yRange.min),M.bounds=f}w.sort((M,f)=>f.size-M.size),E=w[0];let p=E.bounds,s=(p.xRange.max-p.xRange.min)/50;function o(M,f,u){if(!M)return;let r=M.bounds,h,v;if(f)h=p.xRange.max-r.xRange.min+s;else{h=p.xRange.max-r.xRange.max;let n=(r.xRange.max-r.xRange.min)/2-(p.xRange.max-p.xRange.min)/2;n<0&&(h+=n)}if(u)v=p.yRange.max-r.yRange.min+s;else{v=p.yRange.max-r.yRange.max;let n=(r.yRange.max-r.yRange.min)/2-(p.yRange.max-p.yRange.min)/2;n<0&&(v+=n)}for(let n of M)n.x+=h,n.y+=v,E.push(n)}let d=1;for(;d<w.length;)o(w[d],!0,!1),o(w[d+1],!1,!0),o(w[d+2],!0,!0),d+=3,p=bs(E);return fh(E)}function $g(L,j,P,E,w){let p=uh(L);j-=2*E,P-=2*E;let{xRange:s,yRange:o}=bs(p);if(s.max===s.min||o.max===o.min)return console.log("not scaling solution: zero size detected"),L;let d,M;if(w){let h=Math.sqrt(w/Math.PI)*2;d=j/h,M=P/h}else d=j/(s.max-s.min),M=P/(o.max-o.min);let f=Math.min(M,d),u=(j-(s.max-s.min)*f)/2,r=(P-(o.max-o.min)*f)/2;return fh(p.map(h=>({radius:f*h.radius,x:E+u+(h.x-s.min)*f,y:E+r+(h.y-o.min)*f,setid:h.setid})))}function fh(L){let j={};for(let P of L)j[P.setid]=P;return j}function uh(L){return Object.keys(L).map(P=>Object.assign(L[P],{setid:P}))}function ds(L,j,P){let E=j[0].radius-Sn(j[0],L);for(let w=1;w<j.length;++w){let p=j[w].radius-Sn(j[w],L);p<=E&&(E=p)}for(let w=0;w<P.length;++w){let p=Sn(P[w],L)-P[w].radius;p<=E&&(E=p)}return E}function vh(L,j,P){let E=[];for(let f of L)E.push({x:f.x,y:f.y}),E.push({x:f.x+f.radius/2,y:f.y}),E.push({x:f.x-f.radius/2,y:f.y}),E.push({x:f.x,y:f.y+f.radius/2}),E.push({x:f.x,y:f.y-f.radius/2});let w=E[0],p=ds(E[0],L,j);for(let f=1;f<E.length;++f){let u=ds(E[f],L,j);u>=p&&(w=E[f],p=u)}let s=hh(f=>-1*ds({x:f[0],y:f[1]},L,j),[w.x,w.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:P?0:s[0],y:s[1]},d=!0;for(let f of L)if(Sn(o,f)>f.radius){d=!1;break}for(let f of j)if(Sn(o,f)<f.radius){d=!1;break}if(d)return o;if(L.length==1)return{x:L[0].x,y:L[0].y};let M={};return Zi(L,M),M.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:M.arcs.length==1?{x:M.arcs[0].circle.x,y:M.arcs[0].circle.y}:j.length?vh(L,[]):lh(M.arcs.map(f=>f.p1))}function Gg(L){let j={},P=Object.keys(L);for(let E of P)j[E]=[];for(let E=0;E<P.length;E++){let w=P[E],p=L[w];for(let s=E+1;s<P.length;++s){let o=P[s],d=L[o],M=Sn(p,d);M+d.radius<=p.radius+1e-10?j[o].push(w):M+p.radius<=d.radius+1e-10&&j[w].push(o)}}return j}function Zg(L,j,P){let E={},w=Gg(L);for(let p=0;p<j.length;++p){let s=j[p].sets,o={},d={};for(let r=0;r<s.length;++r){o[s[r]]=!0;let h=w[s[r]];for(let v=0;v<h.length;++v)d[h[v]]=!0}let M=[],f=[];for(let r in L)r in o?M.push(L[r]):r in d||f.push(L[r]);let u=vh(M,f,P);E[s]=u,u.disjoint&&j[p].size>0&&console.log("WARNING: area "+s+" not represented on screen")}return E}function Kg(L,j,P){let E=[];return E.push(`
M`,L,j),E.push(`
m`,-P,0),E.push(`
a`,P,P,0,1,0,P*2,0),E.push(`
a`,P,P,0,1,0,-P*2,0),E.join(" ")}function Qg(L){if(L.length===0)return[];let j={};return Zi(L,j),j.arcs}function Jg(L,j){if(L.length===0)return"M 0 0";let P=Math.pow(10,j||0),E=j!=null?p=>Math.round(p*P)/P:p=>p;if(L.length==1){let p=L[0].circle;return Kg(E(p.x),E(p.y),E(p.radius))}let w=[`
M`,E(L[0].p2.x),E(L[0].p2.y)];for(let p of L){let s=E(p.circle.radius);w.push(`
-A`,s,s,0,p.large?1:0,p.sweep?1:0,E(p.p1.x),E(p.p1.y))}return w.join(" ")}function dh(L,j={}){let{lossFunction:P,layoutFunction:E=Rg,normalize:w=!0,orientation:p=Math.PI/2,orientationOrder:s,width:o=600,height:v=350,padding:M=15,scaleToFit:f=!1,symmetricalTextCentre:u=!1,distinct:r,round:h=2}=j,d=E(L,{lossFunction:P==="default"||!P?Ki:P==="logRatio"?Vg:P,distinct:r});w&&(d=qg(d,p,s));let n=$g(d,o,v,M,f),y=Zg(n,L,u),b=new Map(Object.keys(n).map(F=>[F,{set:F,x:n[F].x,y:n[F].y,radius:n[F].radius}])),T=L.map(F=>{let X=F.sets.map(dt=>b.get(dt)),Z=Qg(X),ot=Jg(Z,h);return{circles:X,arcs:Z,path:ot,area:F,has:new Set(F.sets)}});function I(F){let X="";for(let Z of T)Z.has.size>F.length&&F.every(ot=>Z.has.has(ot))&&(X+=" "+Z.path);return X}return T.map(({circles:F,arcs:X,path:Z,area:ot})=>({data:ot,text:y[ot.sets],circles:F,arcs:X,path:Z,distinctPath:Z+I(ot.sets)}))}(function(){var L=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:null;L&&typeof L.structuredClone!="function"&&(L.structuredClone=function j(P){if(P===null||typeof P!="object")return P;if(P instanceof Date)return new Date(P.getTime());if(Array.isArray(P)){for(var E=[],w=0;w<P.length;w++)E[w]=j(P[w]);return E}var p={};for(var s in P)Object.prototype.hasOwnProperty.call(P,s)&&(p[s]=j(P[s]));return p})})();function t2(){var L=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{};if(typeof L.ELK!="function")throw new Error("ELK engine not available on globalThis.ELK \u2014 load drawio-elk.min.js before drawio-mermaid.min.js");return L.ELK}var xi=(function(){var L={rect:{h:60,v:35,minW:0,minH:0},rounded:{h:30,v:35,minW:0,minH:0},diamond:{h:0,v:0,minW:50,minH:50,scale:1.6},circle:{h:0,v:0,minW:40,minH:40,isCircle:!0,circleExtra:30},doublecircle:{h:0,v:0,minW:50,minH:50,isCircle:!0,circleExtra:40},stadium:{h:24,v:15,minW:60,minH:39},subroutine:{h:32,v:15,minW:60,minH:39},cylinder:{h:15,v:43,minW:50,minH:67},hexagon:{h:34,v:15,minW:60,minH:39},lean_right:{h:54,v:15,minW:60,minH:39},lean_left:{h:54,v:15,minW:60,minH:39},trapezoid:{h:54,v:15,minW:60,minH:39},inv_trapezoid:{h:84,v:30,minW:60,minH:54},odd:{h:24,v:15,minW:60,minH:39},group:{h:20,v:40,minW:0,minH:0},class_box:{h:20,v:16,minW:100,minH:50},erdEntity:{h:20,v:30,minW:100,minH:50},start:{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},end:{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},stateStart:{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},stateEnd:{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},"sm-circ":{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},choice:{h:0,v:0,minW:28,minH:28,noLabel:!0},bolt:{h:0,v:0,minW:30,minH:50,noLabel:!0},fork:{h:0,v:0,minW:70,minH:10,noLabel:!0},join:{h:0,v:0,minW:70,minH:10,noLabel:!0},stateDivider:{h:0,v:0,minW:200,minH:6,noLabel:!0},text:{h:16,v:12,minW:40,minH:30},note:{h:16,v:8,minW:60,minH:32,maxTextWidth:200},"manual-file":{h:40,v:50,minW:100,minH:120,squareByWidth:!0},"manual-input":{h:30,v:0,minW:60,minH:50,slopedHeight:!0},docs:{h:50,v:78,minW:80,minH:100},procs:{h:40,v:40,minW:70,minH:70},"paper-tape":{h:16,v:40,minW:60,minH:70},"flip-tri":{h:40,v:50,minW:100,minH:120,squareByWidth:!0}},j={h:16,v:8,minW:50,minH:32};function P(g,tt){var B=tt&&tt.fontSize||16,K=tt&&tt.fontFamily||'"trebuchet ms",verdana,arial,sans-serif';E(g.children,B,K)}function E(g,tt,B){if(g)for(var K=0;K<g.length;K++){var H=g[K];if(H.drawio&&H.drawio.isSubgraph){if(H.drawio.labelText){var yt=o(H.drawio.labelText,tt,B);H.layoutOptions=H.layoutOptions||{},H.layoutOptions["elk.padding"]||(H.layoutOptions["elk.padding"]="[top=35,left=10,bottom=10,right=10]")}E(H.children,tt,B);continue}var ut=H.drawio?H.drawio.shape:"rect",ht=L[ut]||j;if(H.drawio&&H.drawio.isStateDiagram&&!ht.noLabel&&!ht.isCircle&&ut!=="fork"&&ut!=="join"&&ut!=="choice"&&ut!=="note"&&(ht={h:16,v:16,minW:30,minH:40}),H.drawio&&H.drawio.mindmap&&!ht.isCircle&&!ht.noLabel){var bt=1.25;ut==="mindmapBang"?ht={h:63,v:50,minW:80,minH:80,maxTextWidth:200,widthScale:1.25,heightScale:1.25*bt}:ut==="cloud"?ht={h:16,v:0,minW:60,minH:70,maxTextWidth:200,widthScale:1.6,heightScale:bt,cloudHeight:!0}:ut==="roundedRect"?H.drawio.mindmapLine?ht={h:40,v:10,minW:39,minH:34,maxTextWidth:200,heightScale:bt}:ht={h:30,v:30,minW:39,minH:34,maxTextWidth:200,heightScale:bt}:ut==="hexagon"?ht={h:42,v:20,minW:39,minH:44,maxTextWidth:200,heightScale:bt}:ut==="rect"?ht={h:40,v:20,minW:39,minH:34,maxTextWidth:200,heightScale:bt}:ht={h:40,v:10,minW:39,minH:34,maxTextWidth:200,heightScale:bt}}else H.drawio&&H.drawio.mindmap&&ht.isCircle&&!ht.noLabel&&(ht={h:0,v:0,minW:40,minH:40,isCircle:!0,circleExtra:20,maxTextWidth:160});if((ut==="icon"||ut==="iconSquare"||ut==="iconCircle"||ut==="iconRounded"||ut==="imageSquare")&&H.drawio){var Nt=H.drawio.assetH||48,Dt=H.drawio.assetW||48,st=ut==="iconSquare"||ut==="iconCircle"||ut==="iconRounded"?8:0,Lt=Math.max(Nt,Dt),ft=Lt+st,yt=H.drawio.labelText?o(H.drawio.labelText,tt,B):{width:0,height:0},Ct=0;H.width=Math.max(ft,yt.width),H.height=ft+yt.height+Ct,H.drawio.iconLayout={iconSize:Lt,boxW:ft,boxH:ft,labelH:yt.height,labelW:yt.width,labelPad:Ct,topLabel:H.drawio.pos==="t"};continue}if(ut==="lollipopInterface"){var Xt=H.drawio.labelText||"",St=.56,Zt=16;H.width=Math.max(24,Math.ceil(Xt.length*Zt*St)+6),H.height=36;continue}if(ut==="class_box"&&H.drawio&&H.drawio.classData){for(var G=H.drawio.classData,gt=G.members||[],oe=G.methods||[],ae=G.annotations||[],fe=24,ne=48+ae.length*fe,ye=G.hideEmptyMembersBox&&gt.length===0&&oe.length===0,Mt=gt.length===0&&oe.length===0,$t=Mt?18:24,Jt=ye?0:gt.length===0?$t:fe*(gt.length+1),e=ye?0:oe.length===0?$t:fe*(oe.length+1),x=H.drawio.labelText||"",C=x?o(x,tt,B).width:0,S=0,Y=0;Y<ae.length;Y++){var D="\xAB"+String(ae[Y])+"\xBB",At=o(D,tt,B).width;At>S&&(S=At)}for(var U=0,Y=0;Y<gt.length;Y++){var q=o(String(gt[Y]),tt,B).width;q>U&&(U=q)}for(var Y=0;Y<oe.length;Y++){var q=o(String(oe[Y]),tt,B).width;q>U&&(U=q)}var rt=Math.max(C,S),ct=-rt/2,nt=Math.max(rt/2,U),zt=nt-ct,Ot=12;H.width=zt+2*Ot,H.height=ne+Jt+e,H.drawio.classLayout={rowH:fe,titleH:ne,membersH:Jt,methodsH:e,hideCompartments:ye};continue}if(ut==="erdEntity"&&H.drawio&&H.drawio.entityData){var Ft=H.drawio.entityData.attributes||[],Pt=43,We=(H.drawio.labelText||"").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/(^|[^\w])_([^_\n]+?)_(?=[^\w]|$)/g,"$1$2").replace(/`(.+?)`/g,"$1");if(Ft.length>0){for(var Wt=25,Kt=0,Bt=0,ce=0,kt=0,wt=!1,jt=!1,Y=0;Y<Ft.length;Y++){var Ht=Ft[Y].attributeType||Ft[Y].type||"",qt=Ft[Y].attributeName||Ft[Y].name||"",ee=Ft[Y].attributeKeyType||"",Ut=Ft[Y].attributeKeyTypeList||Ft[Y].keys||[],ve=Ft[Y].attributeComment||Ft[Y].comment||"",we=Ut&&Ut.length>0?Ut.join():ee;Kt=Math.max(Kt,o(Ht,16,B).width+Wt),Bt=Math.max(Bt,o(qt,16,B).width+Wt),we&&(wt=!0,ce=Math.max(ce,o(we,16,B).width+Wt)),ve&&(jt=!0,kt=Math.max(kt,o(ve,16,B).width+Wt))}wt||(ce=0),jt||(kt=0);var Se=Kt+Bt+ce+kt,be=o(We,16,B).width+Wt*2;H.width=Math.max(Se,be,100)}else{var be=o(We,16,B).width;H.width=Math.max(be+40,100)}H.height=Ft.length>0?(Ft.length+1)*Pt:80;continue}if((ut==="requirement"||ut==="element")&&H.drawio&&H.drawio.data){var Me=H.drawio.data,Fe=ut==="element"?Me.docRef?2:1:4,Ue=.43,De=.5,Ye="<<"+(ut==="element"?"Element":Me.type||"Requirement")+">>",Pe=(Me.name||"").replace(/[*_`]/g,""),de=Math.max(Ye.length,Pe.length)*tt*De;if(ut==="requirement")for(var Ve={low:"Low",medium:"Medium",high:"High"},Ne={analysis:"Analysis",demonstration:"Demonstration",inspection:"Inspection",test:"Test"},nr=Me.risk||"",Ge=Me.verifyMethod||Me.verifymethod||"",Ie=["ID: "+(Me.requirementId||Me.id||""),"Text: "+(Me.text||"").replace(/[*_`]/g,""),"Risk: "+(Ve[nr.toLowerCase()]||nr),"Verification: "+(Ne[Ge.toLowerCase()]||Ge)],Y=0;Y<Ie.length;Y++){var Ce=Ie[Y].length*tt*Ue;Ce>de&&(de=Ce)}else for(var Ke=["Type: "+(Me.type||""),"Doc Ref: "+(Me.docRef||"")],Y=0;Y<Ke.length;Y++){var Ce=Ke[Y].length*tt*Ue;Ce>de&&(de=Ce)}H.width=Math.max(de+20,150),H.height=68+Fe*24+20;continue}if(ht.noLabel||!H.drawio||!H.drawio.labelText){H.width=ht.minW,H.height=ht.minH;continue}var We=H.drawio.labelText||"",le=We.replace(/\s*(?:fa[bslr]?:[\w-]+|mdi:[\w-]+|bi:[\w-]+)\s*/g," ").replace(/[ \t]+/g," ").trim();le=s(le);var Ae=o(le,tt,B,ht.maxTextWidth);if(!le&&We&&(Ae={width:Math.round(tt),height:Math.round(tt*1.2)}),ht.isCircle){var Le=ht.circleExtra!==void 0?ht.circleExtra:20,Re=Math.max(Ae.width,Ae.height)+Le;Re=Math.max(Re,ht.minW),H.width=Re,H.height=Re}else if(ht.scale){var Be=Ae.width+10,je=Ae.height+10,ie=Math.max(Be,je)*ht.scale;ie=Math.max(ie,ht.minW),H.width=ie,H.height=ie}else{var fr=ht.widthScale?Ae.width*ht.widthScale:Ae.width,Ar=ht.heightScale?Ae.height*ht.heightScale:Ae.height;if(H.width=Math.max(fr+ht.h,ht.minW),H.height=Math.max(Ar+ht.v,ht.minH),ht.cloudHeight){var Lr=Ae.height+10+.44*H.width;H.height=Math.max(Lr,ht.minH)}if(ht.slopedHeight){var Ze=(Ae.height+ht.h)*1.5;H.height=Math.max(Ze,ht.minH)}if(ht.squareByWidth){var ie=Math.max(H.width,ht.minH);H.width=ie,H.height=ie}}if(H.drawio&&H.drawio.isStateDiagram&&H.drawio.labelText&&!ht.noLabel&&!ht.isCircle&&!ht.scale&&!ht.maxTextWidth){for(var dr=String(H.drawio.labelText).split(`
-`),Xe=0,br=0;br<dr.length;br++)dr[br].length>Xe&&(Xe=dr[br].length);var vr=ut==="note"?16:4,gr=Math.ceil(Xe*tt*.45)+vr;H.width<gr&&(H.width=gr)}}}function w(g,tt){var B=tt&&tt.fontSize||16,K=tt&&tt.fontFamily||'"trebuchet ms",verdana,arial,sans-serif';p(g,B,K)}function p(g,tt,B){var K=50;if(g.layoutOptions&&g.layoutOptions["elk.layered.spacing.nodeNodeBetweenLayers"]&&(K=parseFloat(g.layoutOptions["elk.layered.spacing.nodeNodeBetweenLayers"])),g.edges)for(var H=0;H<g.edges.length;H++){var yt=g.edges[H];if(yt.labels)for(var ut=0;ut<yt.labels.length;ut++){var ht=yt.labels[ut];if(ht.text&&ht.width==null&&ht.height==null){var bt=o(ht.text,tt,B),Nt=Math.max(0,Math.round(bt.width-K));ht.width=Nt,ht.height=Math.round(bt.height+10)}}}if(g.children)for(var H=0;H<g.children.length;H++)p(g.children[H],tt,B)}function s(g){return g&&(g.length>=2&&g.charAt(0)==="`"&&g.charAt(g.length-1)==="`"&&(g=g.substring(1,g.length-1)),g=g.replace(/\*\*(.+?)\*\*/g,"$1"),g=g.replace(/__(.+?)__/g,"$1"),g=g.replace(/\*(.+?)\*/g,"$1"),g=g.replace(/(^|[^\w])_([^_\n]+?)_(?=[^\w]|$)/g,"$1$2"),g=g.replace(/`(.+?)`/g,"$1"),g)}function o(g,tt,B,K){if(typeof mxUtils!="undefined"&&mxUtils.getSizeForString){var H=mxUtils.getSizeForString(g.replace(/\n/g,"<br>"),tt,B,null,0);if(H.width>0&&H.height>0){if(K==null||H.width<=K)return{width:H.width,height:H.height};var yt=mxUtils.getSizeForString(g.replace(/\n/g,"<br>"),tt,B,K,0);return{width:yt.width,height:yt.height}}if(!/\S/.test(g))return{width:H.width,height:H.height}}for(var ut=g.split(/\n|<br\s*\/?\s*>/i),ht=0,bt=0;bt<ut.length;bt++)ht=Math.max(ht,ut[bt].length);var Nt=tt*.56,Dt=ht*Nt,st=ut.length;if(K!=null&&Dt>K){var Lt=Math.ceil(Dt/K);st*=Lt,Dt=K}return{width:Dt,height:st*tt*1.5}}function v(g,tt){var B=g.layoutOptions?g.layoutOptions["elk.algorithm"]:null;if(tt||f(B))try{return Ee(g)}catch(K){return typeof console!="undefined"&&console.warn&&console.warn("ELK layout failed; falling back to dagre:",K&&K.message),u(g)}return u(g)}var M={mrtree:!0,stress:!0,force:!0,radial:!0,disco:!0,rectpacking:!0,sporeOverlap:!0,sporeCompaction:!0};function f(g){return M[g]===!0}function u(g){var tt=g.layoutOptions||{},B=tt["elk.direction"]||"DOWN",K=parseFloat(tt["elk.spacing.nodeNode"])||50,H=parseFloat(tt["elk.layered.spacing.nodeNodeBetweenLayers"])||50,yt;switch(B){case"RIGHT":yt="LR";break;case"LEFT":yt="RL";break;case"UP":yt="BT";break;default:yt="TB";break}var ut=[],ht={};r(g,ut,ht),n(g,B,K,H,ut,ht);var bt={},Nt={};b(g.children,bt,Nt);var Dt=[],st={};Rt(g,Dt,st);for(var Lt=!1,ft=0;ft<Dt.length;ft++){var Ct=Dt[ft],Xt=Ct.sources?Ct.sources[0]:null,St=Ct.targets?Ct.targets[0]:null;if(Xt&&bt[Xt]||St&&bt[St]){Lt=!0;break}}var Zt=dt(g,yt,K,H,Dt,st,bt,Nt,Lt);return y(g),Zt}function r(g,tt,B){if(g.edges)for(var K=0;K<g.edges.length;K++)tt.push(g.edges[K]),B[g.edges[K].id]=g;if(g.children)for(var K=0;K<g.children.length;K++)r(g.children[K],tt,B)}function h(g){switch(g){case"RIGHT":return"DOWN";case"LEFT":return"UP";case"DOWN":return"RIGHT";case"UP":return"LEFT";default:return"DOWN"}}function d(g,tt){if(!tt||tt.length===0)return!1;var B={};(function Nt(Dt){if(Dt)for(var st=0;st<Dt.length;st++)B[Dt[st].id]=!0,Nt(Dt[st]._frozenChildren||Dt[st].children)})(g._frozenChildren||g.children);for(var K=0;K<tt.length;K++){var H=tt[K],yt=H.sources&&H.sources[0],ut=H.targets&&H.targets[0];if(!(!yt||!ut)){var ht=!!B[yt],bt=!!B[ut];if(ht!==bt)return!0}}return!1}function n(g,tt,B,K,H,yt){if(g.children){var ut=g.layoutOptions?g.layoutOptions["elk.direction"]:null,ht=ut,bt=g.drawio&&g.drawio.isSubgraph,Nt=bt&&g.drawio.autoDirection;if(Nt&&!d(g,H)){var Dt=h(tt);ht=Dt,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.direction"]=Dt}for(var st=ht||tt,Lt=0;Lt<g.children.length;Lt++)n(g.children[Lt],st,B,K,H,yt);var ft=bt&&g.drawio&&g.drawio.isStateDiagram,Ct=!1;if(ft&&g.children.length>=4){Ct=!0;for(var Xt={},St=0;St<g.children.length;St++){var Zt=g.children[St];if(Zt.drawio&&Zt.drawio.isSubgraph){Ct=!1;break}Xt[Zt.id]=!0}if(Ct&&H)for(var G={},gt=0;gt<H.length;gt++){var oe=H[gt],ae=oe.sources&&oe.sources[0],fe=oe.targets&&oe.targets[0];if(!(!ae||!fe||!Xt[ae]||!Xt[fe])){if(G[fe+"\0"+ae]){Ct=!1;break}G[ae+"\0"+fe]=!0}}}if(!(!bt||!Ct&&(!ht||ht===tt))&&!d(g,H)){var ne;switch(st){case"RIGHT":ne="LR";break;case"LEFT":ne="RL";break;case"UP":ne="BT";break;default:ne="TB";break}var ye=Ct?50:ut?130:K,Mt=new li.graphlib.Graph({multigraph:!0});Mt.setGraph({rankdir:ne,nodesep:B,ranksep:ye,marginx:8,marginy:8}),Mt.setDefaultEdgeLabel(function(){return{}});for(var $t={},Jt=0;Jt<g.children.length;Jt++){var e=g.children[Jt];$t[e.id]=!0,Mt.setNode(e.id,{label:e.id,width:e.width||50,height:e.height||30})}var x=[],C=[];if(H)for(var Jt=0;Jt<H.length;Jt++){var S=H[Jt];if(!S._consumedByPrePass){var Y=S.sources&&S.sources[0],D=S.targets&&S.targets[0];if(!(!Y||!D)&&!(!$t[Y]||!$t[D])){var At=S.labels&&S.labels[0]?S.labels[0].text:"",U=At?o(At,16,'"trebuchet ms",verdana,arial,sans-serif'):{width:0,height:0},q=S.drawio&&S.drawio.length||1;Mt.setEdge(Y,D,{label:At,width:U.width,height:U.height,minlen:q,labelpos:"c"},S.id),x.push({id:S.id,edge:S,v:Y,w:D}),C.push(S),S._consumedByPrePass=!0}}}if(Mt.nodeCount()!==0){li.layout(Mt);for(var rt=1/0,ct=1/0,nt=-1/0,zt=-1/0,Jt=0;Jt<g.children.length;Jt++){var e=g.children[Jt],Ot=Mt.node(e.id);if(Ot){e.x=Math.round(Ot.x-Ot.width/2),e.y=Math.round(Ot.y-Ot.height/2),e.x<rt&&(rt=e.x),e.y<ct&&(ct=e.y);var Ft=e.x+(e.width||Ot.width),Pt=e.y+(e.height||Ot.height);Ft>nt&&(nt=Ft),Pt>zt&&(zt=Pt)}}for(var Jt=0;Jt<x.length;Jt++){var Wt=x[Jt],Kt=Mt.edge({v:Wt.v,w:Wt.w,name:Wt.id});if(Kt&&Kt.points&&Kt.points.length>0){var Bt=Kt.points;Wt.edge.sections=[{startPoint:{x:Math.round(Bt[0].x),y:Math.round(Bt[0].y)},endPoint:{x:Math.round(Bt[Bt.length-1].x),y:Math.round(Bt[Bt.length-1].y)},bendPoints:Bt.slice(1,-1).map(function(ve){return{x:Math.round(ve.x),y:Math.round(ve.y)}})}]}}var ce=g.drawio&&g.drawio.isClassNamespace,kt=Ct?40:ce?35:45,wt=Ct?12:35,jt=Ct?12:ce?35:20;rt===1/0&&(rt=0,nt=0,ct=0,zt=0),g._frozenChildren=g.children,g._frozenEdges=(g.edges||[]).slice();for(var Jt=0;Jt<C.length;Jt++){var Ht=C[Jt],qt=yt?yt[Ht.id]:null;if(qt&&qt!==g&&qt.edges){var ee=qt.edges.indexOf(Ht);ee>=0&&qt.edges.splice(ee,1)}g._frozenEdges.indexOf(Ht)<0&&g._frozenEdges.push(Ht)}g._frozenMinX=rt,g._frozenMinY=ct,g._frozenPadSide=wt,g._frozenPadTop=kt,g.children=[],g.edges=[],g.width=nt-rt+2*wt,g.height=zt-ct+kt+jt}}}}function y(g){if(g){if(g._frozenChildren){var tt=g._frozenPadSide-g._frozenMinX,B=g._frozenPadTop-g._frozenMinY;g.children=g._frozenChildren,g.edges=g._frozenEdges;for(var K=0;K<g.children.length;K++){var H=g.children[K];H.x=(H.x||0)+tt,H.y=(H.y||0)+B,y(H)}for(var K=0;K<g.edges.length;K++){var yt=g.edges[K];if(yt.sections)for(var ut=0;ut<yt.sections.length;ut++){var ht=yt.sections[ut];if(ht.startPoint&&(ht.startPoint.x+=tt,ht.startPoint.y+=B),ht.endPoint&&(ht.endPoint.x+=tt,ht.endPoint.y+=B),ht.bendPoints)for(var bt=0;bt<ht.bendPoints.length;bt++)ht.bendPoints[bt].x+=tt,ht.bendPoints[bt].y+=B}}g.drawio=g.drawio||{},g.drawio.flatLayout=!0,delete g._frozenChildren,delete g._frozenEdges,delete g._frozenMinX,delete g._frozenMinY,delete g._frozenPadSide,delete g._frozenPadTop}else if(g.children)for(var K=0;K<g.children.length;K++)y(g.children[K])}}function b(g,tt,B){if(g)for(var K=0;K<g.length;K++){var H=g[K];if(H.children&&H.children.length>0){tt[H.id]=!0,B[H.id]=[];for(var yt=0;yt<H.children.length;yt++)B[H.id].push(H.children[yt].id);b(H.children,tt,B)}}}function T(g,tt,B,K,H,yt,ut,ht){var bt=new li.graphlib.Graph({multigraph:!0});bt.setGraph({rankdir:tt,nodesep:B,ranksep:K,marginx:8,marginy:8}),bt.setDefaultEdgeLabel(function(){return{}}),I(bt,g.children);for(var Nt={},Dt=0;Dt<H.length;Dt++){var st=H[Dt],Lt=st.sources?st.sources[0]:null,ft=st.targets?st.targets[0]:null;if(!(!Lt||!ft)){var Ct=ut[Lt]?It(ht,Lt,"first"):Lt,Xt=ut[ft]?It(ht,ft,"first"):ft;if(Ct&&Xt&&bt.node(Ct)&&bt.node(Xt)&&Ct!==Xt){var St=st.drawio&&st.drawio.length||1,Zt=st.labels&&st.labels[0]?st.labels[0].text:"",G=Zt?o(Zt,16,'"trebuchet ms",verdana,arial,sans-serif'):{width:0,height:0};bt.setEdge(Ct,Xt,{label:Zt,width:G.width,height:G.height,minlen:St,labelpos:"c"},st.id),Nt[st.id]={v:Ct,w:Xt}}}}if(bt.nodeCount()===0)return g;li.layout(bt),pt(bt,tt),F(bt,g.children),X(g.children,ut),Z(g.children,ut);for(var Dt=0;Dt<H.length;Dt++){var gt=H[Dt],oe=Nt[gt.id];if(oe){var ae=bt.edge({v:oe.v,w:oe.w,name:gt.id});if(!(!ae||!ae.points||ae.points.length===0)){var fe=ae.points;gt.sections=[{startPoint:{x:Math.round(fe[0].x),y:Math.round(fe[0].y)},endPoint:{x:Math.round(fe[fe.length-1].x),y:Math.round(fe[fe.length-1].y)},bendPoints:fe.slice(1,-1).map(function(ye){return{x:Math.round(ye.x),y:Math.round(ye.y)}})}]}}}return g}function I(g,tt){if(tt)for(var B=0;B<tt.length;B++){var K=tt[B];K.children&&K.children.length>0?I(g,K.children):g.setNode(K.id,{label:K.id,width:K.width||0,height:K.height||0})}}function F(g,tt){if(tt)for(var B=0;B<tt.length;B++){var K=tt[B];if(K.children&&K.children.length>0)F(g,K.children);else{var H=g.node(K.id);H&&(K.x=Math.round(H.x-H.width/2),K.y=Math.round(H.y-H.height/2))}}}function X(g,tt){if(g)for(var B=0;B<g.length;B++){var K=g[B];if(!(!tt[K.id]||!K.children)){X(K.children,tt);for(var H=1/0,yt=1/0,ut=-1/0,ht=-1/0,bt=0;bt<K.children.length;bt++){var Nt=K.children[bt],Dt=Nt.x||0,st=Nt.y||0;H=Math.min(H,Dt),yt=Math.min(yt,st),ut=Math.max(ut,Dt+(Nt.width||0)),ht=Math.max(ht,st+(Nt.height||0))}if(H!==1/0){var Lt=45,ft=35,Ct=20;K.x=Math.round(H-ft),K.y=Math.round(yt-Lt),K.width=Math.round(ut-H+ft*2),K.height=Math.round(ht-yt+Lt+Ct)}}}}function Z(g,tt){if(g)for(var B=0;B<g.length;B++){var K=g[B];tt[K.id]&&K.children&&(K.drawio=K.drawio||{},K.drawio.flatLayout=!0,Z(K.children,tt))}}function ot(g,tt){if(g)for(var B=0;B<g.length;B++){var K=g[B];if(!(!tt[K.id]||!K.children)){var H=K.drawio&&K.drawio.flatLayout;if(!H)for(var yt=0;yt<K.children.length;yt++){var ut=K.children[yt];ut.x=(ut.x||0)-(K.x||0),ut.y=(ut.y||0)-(K.y||0)}ot(K.children,tt)}}}function dt(g,tt,B,K,H,yt,ut,ht,bt){var Nt=g.drawio&&g.drawio.diagramType,Dt=g.drawio&&g.drawio.isClassDiagram,st=Nt==="er"||Dt||Nt==="flowchart",Lt=st?ih:li,ft=new Lt.graphlib.Graph({multigraph:!0,compound:!0});ft.setGraph({rankdir:tt,nodesep:B,ranksep:K,marginx:8,marginy:8}),ft.setDefaultEdgeLabel(function(){return{}});var Ct={};at(g.children,Ct),N(ft,g.children,null,ut);var Xt=!1,St=!1;if(g.children)for(var Zt=0;Zt<g.children.length;Zt++)g.children[Zt].drawio&&g.children[Zt].drawio.isStateDiagram&&(Xt=!0),g.children[Zt].drawio&&g.children[Zt].drawio.isNoteGroup&&(St=!0);for(var G=Xt?"last":"first",gt={},Zt=0;Zt<H.length;Zt++){var oe=H[Zt],ae=oe.sources?oe.sources[0]:null,fe=oe.targets?oe.targets[0]:null;if(!(!ae||!fe)){var ne=ut[ae]?It(ht,ae,G):ae,ye=ut[fe]?It(ht,fe,"first"):fe;if(ne&&ye&&ft.node(ne)&&ft.node(ye)&&ne!==ye){var Mt=oe.drawio&&oe.drawio.length||1,$t=oe.labels&&oe.labels[0]?oe.labels[0].text:"",Jt=$t?o($t,16,'"trebuchet ms",verdana,arial,sans-serif'):{width:0,height:0},e=Dt&&$t?Math.max(24,Jt.height):Jt.height;ft.setEdge(ne,ye,{label:$t,width:Jt.width,height:e,minlen:Mt,labelpos:"c"},oe.id),gt[oe.id]={v:ne,w:ye}}}}if(ft.nodeCount()===0)return g;Lt.layout(ft);var x=g.drawio&&g.drawio.isClassDiagram,C=Nt==="er",S=Nt==="flowchart"&&st,Y=!1;if(S&&H){var D={};for(var At in ht)for(var U=ht[At],q=0;q<U.length;q++)D[U[q]]||(D[U[q]]=At);for(var rt=0;rt<H.length;rt++){var ct=H[rt],nt=ct.sources&&ct.sources[0],zt=ct.targets&&ct.targets[0];if(!(!nt||!zt)){var Ot=ut[nt]?nt:D[nt],Ft=ut[zt]?zt:D[zt];if(Ot&&Ft&&Ot!==Ft){Y=!0;break}}}}var Pt=S&&(bt||Y),Wt=Xt&&!St;return(Wt||!W(ft)&&!S&&!bt||Pt)&&!x&&!C&&!St&&pt(ft,tt),xt(ft,H,gt,yt,ut,tt,Xt),_(ft,g.children),Q(ft,g.children,ut),l(ft,H,gt,yt),O(g.children,ut,tt),z(ft,H,gt,yt,ut,g.children,Xt),g}function xt(g,tt,B,K,H,yt,ut){for(var ht=yt==="TB"||yt==="BT",bt={},Nt=0;Nt<tt.length;Nt++){var Dt=tt[Nt],st=K[Dt.id];if(!((!st||st==="root")&&!ut)){var Lt=B[Dt.id];if(Lt){var ft=Dt.sources?Dt.sources[0]:null,Ct=Dt.targets?Dt.targets[0]:null;if(!(!ft||!Ct||H[ft]||H[Ct])){var Xt=Lt.v<Lt.w?Lt.v+"|"+Lt.w:Lt.w+"|"+Lt.v,St=Xt+"|"+st;bt[St]||(bt[St]=[]),bt[St].push({elkEdge:Dt,mapping:Lt})}}}}for(var St in bt){var Zt=bt[St];if(!(Zt.length<2)){var G=g.node(Zt[0].mapping.v),gt=g.node(Zt[0].mapping.w);if(!(!G||!gt)){var oe,ae;ht?(oe=G.y<=gt.y?G:gt,ae=G.y<=gt.y?gt:G):(oe=G.x<=gt.x?G:gt,ae=G.x<=gt.x?gt:G);var fe=ht?Math.max(oe.width,ae.width):Math.max(oe.height,ae.height),ne,ye;if(ut){for(var Mt=0,$t=0;$t<Zt.length;$t++){var Jt=Zt[$t].elkEdge.labels;if(Jt&&Jt[0]&&Jt[0].text){var e=o(Jt[0].text,14,'"trebuchet ms",verdana,arial,sans-serif');Mt=Math.max(Mt,e.width)}}Mt>0?(ne=8,ye=Mt/2+18):(ne=4,ye=8)}else ne=fe*.12,ye=fe*.45;for(var x=ht?(oe.x+ae.x)/2:(oe.y+ae.y)/2,C=ht?(oe.y+ae.y)/2:(oe.x+ae.x)/2,$t=0;$t<Zt.length;$t++){var S=Zt[$t],Y=g.edge({v:S.mapping.v,w:S.mapping.w,name:S.elkEdge.id});if(!(!Y||!Y.points||Y.points.length<2)){S.elkEdge.drawio=S.elkEdge.drawio||{},S.elkEdge.drawio.isBidiPair=!0;var D=g.node(S.elkEdge.sources[0]),At=D&&(ht?D.y<=ae.y-1&&D.y>=oe.y-1&&Math.abs(D.y-oe.y)<Math.abs(D.y-ae.y):D.x<=ae.x-1&&D.x>=oe.x-1&&Math.abs(D.x-oe.x)<Math.abs(D.x-ae.x)),U=ut?At?1:-1:At?-1:1,q=Y.points[0],rt=Y.points[Y.points.length-1];ht?Y.points=[{x:x+U*ne,y:q.y},{x:x+U*ye,y:C},{x:x+U*ne,y:rt.y}]:Y.points=[{x:q.x,y:x+U*ne},{x:C,y:x+U*ye},{x:rt.x,y:x+U*ne}]}}}}}}function re(g,tt,B,K,H){if(tt)for(var yt=B||0,ut=0;ut<tt.length;ut++){var ht=tt[ut];if(ht.children&&ht.children.length>0){var bt=H||ht.drawio&&ht.drawio.isStateDiagram&&ht.drawio.isSubgraph;re(g,ht.children,yt+1,K,bt)}else{var Nt=K&&K[ht.id]||null,Dt=0,st=0,Lt=yt>0?35:0,ft=H?35:25,Ct=25;(Nt==="top"||Nt==="both")&&(Dt=ft),(Nt==="bottom"||Nt==="both")&&(st=Ct),g.setNode(ht.id,{label:ht.id,width:(ht.width||0)+Lt*2,height:(ht.height||0)+Dt+st,_padTop:Dt,_padLeft:Lt})}}}function N(g,tt,B,K){if(tt)for(var H=0;H<tt.length;H++){var yt=tt[H];yt.children&&yt.children.length>0&&K[yt.id]?(g.setNode(yt.id,{label:yt.id,clusterLabelPos:"top"}),B&&g.setParent(yt.id,B),N(g,yt.children,yt.id,K)):(g.setNode(yt.id,{label:yt.id,width:yt.width||0,height:yt.height||0}),B&&g.setParent(yt.id,B))}}function Q(g,tt,B){if(tt)for(var K=0;K<tt.length;K++){var H=tt[K];if(B[H.id]&&H.children){var yt=g.node(H.id);yt&&yt.width!=null&&yt.height!=null&&(H.x=Math.round(yt.x-yt.width/2),H.y=Math.round(yt.y-yt.height/2),H.width=Math.round(yt.width),H.height=Math.round(yt.height)),Q(g,H.children,B)}}}function at(g,tt){if(g)for(var B=0;B<g.length;B++){var K=g[B];if(!(!K.children||K.children.length===0)){at(K.children,tt);for(var H=[],yt=0;yt<K.children.length;yt++){var ut=K.children[yt];(!ut.children||ut.children.length===0)&&H.push(ut)}if(H.length!==0){for(var ht={},yt=0;yt<H.length;yt++)ht[H[yt].id]=!0;var bt={},Nt={};if(K.edges)for(var yt=0;yt<K.edges.length;yt++){var Dt=K.edges[yt],st=Dt.sources&&Dt.sources[0],Lt=Dt.targets&&Dt.targets[0];ht[st]&&ht[Lt]&&(Nt[st]=(Nt[st]||0)+1,bt[Lt]=(bt[Lt]||0)+1)}for(var yt=0;yt<H.length;yt++){var ft=H[yt],Ct=!bt[ft.id],Xt=!Nt[ft.id];Ct&&Xt?tt[ft.id]="both":Ct?tt[ft.id]="top":Xt?tt[ft.id]="bottom":tt[ft.id]="side"}}}}}function _(g,tt){if(tt)for(var B=0;B<tt.length;B++){var K=tt[B];if(K.children&&K.children.length>0)_(g,K.children);else{var H=g.node(K.id);if(H){var yt=H._padTop||0,ut=H._padLeft||0;K.x=Math.round(H.x-H.width/2+ut),K.y=Math.round(H.y-H.height/2+yt)}}}}function l(g,tt,B,K){for(var H=0;H<tt.length;H++){var yt=tt[H],ut=B[yt.id];if(ut){var ht=K[yt.id];if(!(!ht||ht==="root")){var bt=g.edge({v:ut.v,w:ut.w,name:yt.id});if(!(!bt||!bt.points||bt.points.length===0)){yt._routePoints=[];for(var Nt=0;Nt<bt.points.length;Nt++)yt._routePoints.push({x:Math.round(bt.points[Nt].x),y:Math.round(bt.points[Nt].y)})}}}}}function O(g,tt,B){if(g)for(var K=0;K<g.length;K++){var H=g[K];if(!(!tt[H.id]||!H.children)){O(H.children,tt,B);for(var yt=1/0,ut=1/0,ht=-1/0,bt=-1/0,Nt=0;Nt<H.children.length;Nt++){var Dt=H.children[Nt];yt=Math.min(yt,Dt.x||0),ut=Math.min(ut,Dt.y||0),ht=Math.max(ht,(Dt.x||0)+(Dt.width||0)),bt=Math.max(bt,(Dt.y||0)+(Dt.height||0))}if(yt!==1/0){var st=H.drawio&&H.drawio.isStateDiagram&&H.drawio.isSubgraph,Lt=H.drawio&&H.drawio.isClassNamespace,ft=H.drawio&&H.drawio.shape==="parallelRegion",Ct=st||Lt?35:45,Xt=ft?85:35,St=B==="LR"||B==="RL",Zt=st&&St?Ct:Lt?35:25,G=yt,gt=ut,oe=ht,ae=bt,fe=H.drawio&&H.drawio.shape==="parallelRegion";if(H.edges)for(var Nt=0;Nt<H.edges.length;Nt++){var ne=H.edges[Nt];if(ne._routePoints)for(var ye=0;ye<ne._routePoints.length;ye++)G=Math.min(G,ne._routePoints[ye].x),oe=Math.max(oe,ne._routePoints[ye].x);if(st&&!fe&&ne._routePoints&&ne._routePoints.length>0&&ne.labels&&ne.labels[0]&&ne.labels[0].text){var Mt=Math.floor(ne._routePoints.length/2),$t=ne._routePoints[Mt],Jt=o(ne.labels[0].text,16,'"trebuchet ms",verdana,arial,sans-serif'),e=Jt.width/2;G=Math.min(G,$t.x-e),oe=Math.max(oe,$t.x+e)}}var x=(yt+ht)/2,C=x-G,S=oe-x,Y=Math.max(C,S);G=x-Y,oe=x+Y,H.x=Math.round(G-Xt),H.y=Math.round(gt-Ct),H.width=Math.round(oe-G+Xt*2),H.height=Math.round(ae-gt+Ct+Zt);for(var Nt=0;Nt<H.children.length;Nt++)H.children[Nt].x-=H.x,H.children[Nt].y-=H.y}}}}function z(g,tt,B,K,H,yt,ut){var ht={};lt(yt,ht,H);for(var bt=0;bt<tt.length;bt++){var Nt=tt[bt],Dt=B[Nt.id];if(Dt){var st=g.edge({v:Dt.v,w:Dt.w,name:Nt.id});if(!(!st||!st.points||st.points.length===0)){var Lt=st.points,ft=0,Ct=0,Xt=K[Nt.id];Xt&&Xt!=="root"&&ht[Xt]&&(ft=ht[Xt].x,Ct=ht[Xt].y);var St=Lt.slice(1,-1).map(function(e){return{x:Math.round(e.x-ft),y:Math.round(e.y-Ct)}}),Zt=ut&&(!Xt||Xt==="root");if(Zt&&St.length===1){var G=Lt[0].x-ft,gt=Lt[Lt.length-1].x-ft,oe=St[0].x,ae=Math.min(G,gt),fe=Math.max(G,gt);(oe<ae-1||oe>fe+1)&&(St=[])}if(ut){var ne=Math.round(Lt[0].x-ft),ye=Math.round(Lt[0].y-Ct),Mt=Math.round(Lt[Lt.length-1].x-ft),$t=Math.round(Lt[Lt.length-1].y-Ct),Jt=St.length===0||St.length===1&&(Math.abs(St[0].x-ne)<2&&Math.abs(St[0].y-ye)<2||Math.abs(St[0].x-Mt)<2&&Math.abs(St[0].y-$t)<2);Jt&&Math.abs(ne-Mt)>25&&Math.abs(ye-$t)>25&&(St=[{x:Mt,y:ye}])}Nt.sections=[{startPoint:{x:Math.round(Lt[0].x-ft),y:Math.round(Lt[0].y-Ct)},endPoint:{x:Math.round(Lt[Lt.length-1].x-ft),y:Math.round(Lt[Lt.length-1].y-Ct)},bendPoints:St}]}}}}function lt(g,tt,B){if(g)for(var K=0;K<g.length;K++){var H=g[K];B[H.id]&&(tt[H.id]={x:H.x||0,y:H.y||0},H.children&&lt(H.children,tt,B))}}function W(g){for(var tt=g.edges(),B=0;B<tt.length;B++){var K=g.node(tt[B].v),H=g.node(tt[B].w);if(K&&H&&typeof K.rank=="number"&&typeof H.rank=="number"&&H.rank<K.rank)return!0}return!1}function pt(g,tt){for(var B=tt==="TB"||tt==="BT",K={},H=[],yt=g.nodes(),ut=0;ut<yt.length;ut++){var ht=yt[ut];if(!K[ht]){for(var bt=[],Nt=[ht];Nt.length>0;){var Dt=Nt.shift();if(!K[Dt]){K[Dt]=!0,bt.push(Dt);for(var st=g.neighbors(Dt)||[],Lt=0;Lt<st.length;Lt++)K[st[Lt]]||Nt.push(st[Lt])}}H.push(bt)}}for(var ft=0;ft<H.length;ft++){var bt=H[ft];if(!(bt.length<2)){for(var Ct=1/0,Xt=-1/0,ut=0;ut<bt.length;ut++){var St=g.node(bt[ut]);St&&(B?(Ct=Math.min(Ct,St.x-St.width/2),Xt=Math.max(Xt,St.x+St.width/2)):(Ct=Math.min(Ct,St.y-St.height/2),Xt=Math.max(Xt,St.y+St.height/2)))}if(Ct!==1/0){for(var Zt=(Ct+Xt)/2,ut=0;ut<bt.length;ut++){var St=g.node(bt[ut]);St&&(B?St.x=2*Zt-St.x:St.y=2*Zt-St.y)}for(var G={},ut=0;ut<bt.length;ut++)G[bt[ut]]=!0;for(var gt=g.edges(),ut=0;ut<gt.length;ut++){var oe=gt[ut];if(!(!G[oe.v]||!G[oe.w])){var ae=g.edge(oe);if(ae&&ae.points)for(var Lt=0;Lt<ae.points.length;Lt++)B?ae.points[Lt].x=2*Zt-ae.points[Lt].x:ae.points[Lt].y=2*Zt-ae.points[Lt].y}}}}}}function mt(g){if(g)for(var tt=0;tt<g.length;tt++)delete g[tt]._absX,delete g[tt]._absY,delete g[tt]._parentAbsXY,g[tt].children&&mt(g[tt].children)}function Tt(g,tt,B,K,H){if(tt)for(var yt=0;yt<tt.length;yt++){var ut=tt[yt],ht=ut.children&&ut.children.length>0;ht?(K[ut.id]=!0,H[ut.id]=[],g.setNode(ut.id,{label:ut.id})):(g.setNode(ut.id,{label:ut.id,width:ut.width||0,height:ut.height||0}),B&&H[B]&&H[B].push(ut.id)),B&&g.setParent(ut.id,B),ht&&Tt(g,ut.children,ut.id,K,H)}}function Rt(g,tt,B){if(g.edges)for(var K=0;K<g.edges.length;K++)tt.push(g.edges[K]),B[g.edges[K].id]=g.id;if(g.children)for(var K=0;K<g.children.length;K++)(g.children[K].edges||g.children[K].children)&&Rt(g.children[K],tt,B)}function It(g,tt,B){var K=g[tt];if(!K||K.length===0)return null;var H=B==="first"?K[0]:K[K.length-1];return g[H]?It(g,H,B):H}function te(g,tt,B,K){if(tt)for(var H=0;H<tt.length;H++){var yt=tt[H],ut=g.node(yt.id);if(ut)if(K[yt.id])Qt(g,yt,K);else{var ht=Math.round(ut.x-ut.width/2),bt=Math.round(ut.y-ut.height/2);if(B&&K[B]){var Nt=yt._parentAbsXY;yt.x=ht-Nt.x,yt.y=bt-Nt.y}else yt.x=ht,yt.y=bt}}}function Qt(g,tt,B){var K=45,H=35,yt=20;if(tt.children)for(var ut=0;ut<tt.children.length;ut++)B[tt.children[ut].id]&&Qt(g,tt.children[ut],B);var ht=1/0,bt=1/0,Nt=-1/0,Dt=-1/0;if(tt.children)for(var ut=0;ut<tt.children.length;ut++){var st=tt.children[ut];if(B[st.id])ht=Math.min(ht,st._absX),bt=Math.min(bt,st._absY),Nt=Math.max(Nt,st._absX+st.width),Dt=Math.max(Dt,st._absY+st.height);else{var Lt=g.node(st.id);if(Lt){var ft=Math.round(Lt.x-Lt.width/2),Ct=Math.round(Lt.y-Lt.height/2);ht=Math.min(ht,ft),bt=Math.min(bt,Ct),Nt=Math.max(Nt,ft+Lt.width),Dt=Math.max(Dt,Ct+Lt.height)}}}if(ht!==1/0){for(var Xt={},ut=0;ut<tt.children.length;ut++)Xt[tt.children[ut].id]=!0;for(var St=g.edges(),ut=0;ut<St.length;ut++){var Zt=St[ut];if(Xt[Zt.v]&&Xt[Zt.w]){var G=g.edge(Zt);if(G&&G.points)for(var gt=0;gt<G.points.length;gt++)ht=Math.min(ht,Math.round(G.points[gt].x)),Nt=Math.max(Nt,Math.round(G.points[gt].x))}}var oe=Math.round(ht-H),ae=Math.round(bt-K),fe=Math.round(Nt-ht+H*2),ne=Math.round(Dt-bt+K+yt);if(tt._absX=oe,tt._absY=ae,tt.width=fe,tt.height=ne,tt.children)for(var ut=0;ut<tt.children.length;ut++){var st=tt.children[ut];if(B[st.id])st.x=st._absX-oe,st.y=st._absY-ae,delete st._absX,delete st._absY;else{var Lt=g.node(st.id);Lt&&(st.x=Math.round(Lt.x-Lt.width/2)-oe,st.y=Math.round(Lt.y-Lt.height/2)-ae),st._parentAbsXY={x:oe,y:ae}}}var ye=g.parent(tt.id);ye&&ye!=="\0"||(tt.x=oe,tt.y=ae)}}function pe(g,tt,B,K,H){var yt={};ue(g,H,yt);for(var ut=0;ut<tt.length;ut++){var ht=tt[ut],bt=B[ht.id];if(bt){var Nt=g.edge({v:bt.v,w:bt.w,name:ht.id});if(!(!Nt||!Nt.points||Nt.points.length===0)){var Dt=Nt.points,st=0,Lt=0,ft=K[ht.id];ft&&ft!=="root"&&yt[ft]&&(st=yt[ft].x,Lt=yt[ft].y),ht.sections=[{startPoint:{x:Math.round(Dt[0].x-st),y:Math.round(Dt[0].y-Lt)},endPoint:{x:Math.round(Dt[Dt.length-1].x-st),y:Math.round(Dt[Dt.length-1].y-Lt)},bendPoints:Dt.slice(1,-1).map(function(Ct){return{x:Math.round(Ct.x-st),y:Math.round(Ct.y-Lt)}})}]}}}}function ue(g,tt,B){var K=45,H=35,yt=20;for(var ut in tt){var ht=g.node(ut);if(ht){var bt=g.children(ut);if(!(!bt||bt.length===0)){for(var Nt=1/0,Dt=1/0,st=0;st<bt.length;st++){var Lt=g.node(bt[st]);Lt&&(tt[bt[st]]&&B[bt[st]]?(Nt=Math.min(Nt,B[bt[st]].x),Dt=Math.min(Dt,B[bt[st]].y)):(Nt=Math.min(Nt,Math.round(Lt.x-Lt.width/2)),Dt=Math.min(Dt,Math.round(Lt.y-Lt.height/2))))}Nt!==1/0&&(B[ut]={x:Math.round(Nt-H),y:Math.round(Dt-K)})}}}}function me(g){var tt=g.layoutOptions||{};tt["elk.layered.considerModelOrder.strategy"]||(tt["elk.layered.considerModelOrder.strategy"]="NODES"),tt["elk.layered.crossingMinimization.forceNodeModelOrder"]||(tt["elk.layered.crossingMinimization.forceNodeModelOrder"]="true"),g.layoutOptions=tt}function Ee(g){me(g);var tt=t2(),B=new tt,K=B.layoutSync(g);return xe(g,K),g}function xe(g,tt){if(!(!g||!tt)){if(tt.x!=null&&(g.x=tt.x),tt.y!=null&&(g.y=tt.y),tt.width!=null&&(g.width=tt.width),tt.height!=null&&(g.height=tt.height),tt.children&&g.children){for(var B={},K=0;K<tt.children.length;K++)B[tt.children[K].id]=tt.children[K];for(var H=0;H<g.children.length;H++){var yt=g.children[H],ut=B[yt.id];ut&&xe(yt,ut)}}if(tt.edges&&g.edges){for(var ht={},bt=0;bt<tt.edges.length;bt++)ht[tt.edges[bt].id]=tt.edges[bt];for(var Nt=0;Nt<g.edges.length;Nt++){var Dt=g.edges[Nt],st=ht[Dt.id];st&&st.sections&&(Dt.sections=st.sections)}}}}function ar(g){var tt=Wn.CoSELayout,B=Wn.CoSENode,K=Wn.CoSEConstants,H=Wn.layoutBase.PointD,yt=Wn.layoutBase.DimensionD,ut=Wn.layoutBase.LayoutConstants,ht=Wn.layoutBase.FDLayoutConstants;ut.QUALITY=2,ut.DEFAULT_INCREMENTAL=!1,ut.ANIMATE=!1,ut.NODE_DIMENSIONS_INCLUDE_LABELS=!1,ht.DEFAULT_EDGE_LENGTH=50,ht.DEFAULT_SPRING_STRENGTH=.45,ht.DEFAULT_REPULSION_STRENGTH=4500,ht.DEFAULT_GRAVITY_STRENGTH=.25,ht.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,ht.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,ht.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,ht.MAX_ITERATIONS=2500,ht.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,ht.DEFAULT_COOLING_FACTOR_INCREMENTAL=.5,K.DEFAULT_EDGE_LENGTH=50,K.DEFAULT_SPRING_STRENGTH=.45,K.DEFAULT_REPULSION_STRENGTH=4500,K.DEFAULT_GRAVITY_STRENGTH=.25,K.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,K.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,K.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,K.MAX_ITERATIONS=2500,K.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,K.DEFAULT_COOLING_FACTOR_INCREMENTAL=.5,K.NODE_DIMENSIONS_INCLUDE_LABELS=!1,K.DEFAULT_INCREMENTAL=!1,K.ANIMATE=!1,K.TILE=!0,K.TILING_PADDING_VERTICAL=10,K.TILING_PADDING_HORIZONTAL=10;for(var bt=new tt,Nt=bt.newGraphManager(),Dt=Nt.addRoot(),st={},Lt=g.children||[],ft=g.edges||[],Ct=0;Ct<Lt.length;Ct++){var Xt=Lt[Ct],St=Xt.width||40,Zt=Xt.height||30,G=Dt.add(new B(bt.graphManager,new H(0,0),new yt(St,Zt)));G.id=Xt.id,st[Xt.id]=G}for(var Ct=0;Ct<ft.length;Ct++){var gt=ft[Ct],oe=gt.sources?gt.sources[0]:null,ae=gt.targets?gt.targets[0]:null;oe&&ae&&st[oe]&&st[ae]&&st[oe]!==st[ae]&&Nt.add(bt.newEdge(),st[oe],st[ae])}bt.runLayout();for(var Ct=0;Ct<Lt.length;Ct++){var Xt=Lt[Ct],fe=st[Xt.id];fe&&(Xt.x=Math.round(fe.getRect().x),Xt.y=Math.round(fe.getRect().y))}for(var ne=1/0,ye=1/0,Ct=0;Ct<Lt.length;Ct++)ne=Math.min(ne,Lt[Ct].x),ye=Math.min(ye,Lt[Ct].y);if(ne!==1/0)for(var Mt=20-ne,$t=20-ye,Ct=0;Ct<Lt.length;Ct++)Lt[Ct].x+=Mt,Lt[Ct].y+=$t;return g}function xr(g){function tt(K){if(K.drawio&&K.drawio.bidiCompound&&K.children&&K.children.length>0){var H=400;if(K.width<H){for(var yt=H-K.width,ut=yt/2,ht=0;ht<K.children.length;ht++)K.children[ht].x=(K.children[ht].x||0)+ut;if(K.edges)for(var bt=0;bt<K.edges.length;bt++){var Nt=K.edges[bt];if(Nt.sections)for(var Dt=0;Dt<Nt.sections.length;Dt++){var st=Nt.sections[Dt];if(st.startPoint&&(st.startPoint.x+=ut),st.endPoint&&(st.endPoint.x+=ut),st.bendPoints)for(var Lt=0;Lt<st.bendPoints.length;Lt++)st.bendPoints[Lt].x+=ut}}K.width=H,K._bidiShift=ut}}if(K.children)for(var ft=0;ft<K.children.length;ft++)tt(K.children[ft])}tt(g);function B(K){if(K.children){for(var H=0,yt=0;yt<K.children.length;yt++){var ut=K.children[yt];ut._bidiShift&&ut._bidiShift>H&&(H=ut._bidiShift)}if(H>0){for(var ht=0;ht<K.children.length;ht++){var bt=K.children[ht];bt._bidiShift||(bt.x=(bt.x||0)+H)}if(K.edges)for(var Nt=0;Nt<K.edges.length;Nt++){var Dt=K.edges[Nt];if(Dt.sections)for(var st=0;st<Dt.sections.length;st++){var Lt=Dt.sections[st];if(Lt.startPoint&&(Lt.startPoint.x+=H),Lt.endPoint&&(Lt.endPoint.x+=H),Lt.bendPoints)for(var ft=0;ft<Lt.bendPoints.length;ft++)Lt.bendPoints[ft].x+=H}}}}}B(g)}function sr(g){if(!(!g.children||!g.edges)){for(var tt={},B=0;B<g.children.length;B++){var K=g.children[B];tt[K.id]=K}for(var H={},yt=0;yt<g.edges.length;yt++){var ut=g.edges[yt],ht=ut.sources&&ut.sources[0];ht&&(H[ht]||(H[ht]=[]),H[ht].push(ut))}for(var bt in H){var Nt=tt[bt];if(!(!Nt||!Nt.drawio||Nt.drawio.shape!=="stateStart")){for(var Dt=H[bt],st=[],Lt=0;Lt<Dt.length;Lt++){var ft=Dt[Lt],Ct=ft.targets&&ft.targets[0];if(Ct){var Xt=tt[Ct];!Xt||!Xt.children||Xt.children.length===0||st.push({edge:ft,node:Xt})}}if(st.length!==0){for(var St=Nt.width||0,Zt=Nt.height||0,G=1/0,gt=-1/0,oe=0;oe<st.length;oe++){var ae=st[oe].node,fe=ae.x||0,ne=ae.width||0;fe<G&&(G=fe),fe+ne>gt&&(gt=fe+ne)}var ye=(G+gt)/2-St/2;Nt.x=ye;for(var Mt=0;Mt<st.length;Mt++){var $t=st[Mt],Jt=$t.edge,e=$t.node;if(!(!Jt.sections||Jt.sections.length===0)){var x=Jt.sections[0],C=ye+St/2,S=(Nt.y||0)+Zt,Y=e.x||0,D=e.y||0,At=e.width||0,U=Y+At/2;x.startPoint={x:C,y:S},x.endPoint={x:U,y:D},x.bendPoints=[]}}}}}}}function Qe(g){g.edges=g.edges||[];function tt(K,H,yt){if(K.sections)for(var ut=0;ut<K.sections.length;ut++){var ht=K.sections[ut];if(ht.startPoint&&(ht.startPoint.x+=H,ht.startPoint.y+=yt),ht.endPoint&&(ht.endPoint.x+=H,ht.endPoint.y+=yt),ht.bendPoints)for(var bt=0;bt<ht.bendPoints.length;bt++)ht.bendPoints[bt].x+=H,ht.bendPoints[bt].y+=yt}}function B(K,H,yt){if(K.children)for(var ut=0;ut<K.children.length;ut++){var ht=K.children[ut],bt=H+(ht.x||0),Nt=yt+(ht.y||0);if(ht.edges&&ht.edges.length>0){for(var Dt=0;Dt<ht.edges.length;Dt++){var st=ht.edges[Dt];tt(st,bt,Nt),g.edges.push(st)}ht.edges=[]}B(ht,bt,Nt)}}B(g,0,0)}function or(g,tt,B){var K=B&&(B.flowchart&&B.flowchart.defaultRenderer==="elk"||B.layout==="elk");switch(g){case"flowchart":case"class":case"state":case"er":case"requirement":return tt.drawio=tt.drawio||{},tt.drawio.diagramType=g,tt.drawio.useElkLayout=K,P(tt,B),(g==="flowchart"||g==="requirement")&&w(tt,B),g==="er"&&K&&(tt.layoutOptions={"elk.algorithm":"layered","elk.direction":tt.layoutOptions&&tt.layoutOptions["elk.direction"]||"DOWN","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.layered.crossingMinimization.forceNodeModelOrder":"true","elk.layered.unnecessaryBendpoints":"true","spacing.baseValue":"35","elk.layered.spacing.nodeNodeBetweenLayers":"45","elk.layered.spacing.edgeNodeBetweenLayers":"22"}),v(tt,K),g==="state"&&(xr(tt),sr(tt),Qe(tt)),tt;case"mindmap":return P(tt,B),typeof Wn!="undefined"?ar(tt):(tt.layoutOptions=tt.layoutOptions||{},tt.layoutOptions["elk.algorithm"]="mrtree",tt.layoutOptions["elk.direction"]="RIGHT",v(tt,!1)),tt;case"sequence":case"zenuml":return Wr(tt,B);case"gitgraph":return oa(tt,B);case"journey":return Sr(tt,B);case"pie":return Mr(tt,B);case"packet":return er(tt,B);case"quadrant":return Xr(tt,B);case"wardley":return Kr(tt,B);case"eventmodeling":return Ur(tt,B);case"timeline":return ir(tt,B);case"kanban":return cr(tt,B);case"xychart":return Fr(tt,B);case"radar":return yr(tt,B);case"block":return rr(tt,B);case"c4":return Pr(tt,B);case"architecture":return ta(tt,B);case"sankey":return ca(tt,B);case"treemap":return ba(tt,B);case"gantt":return ra(tt,B);case"venn":return nn(tt,B);case"ishikawa":return dn(tt,B);case"treeView":return Fn(tt,B);default:return P(tt,B),v(tt),tt}}function Wr(g,tt){for(var B=tt&&tt.fontSize||12,K=tt&&tt.fontFamily||"Helvetica",H=!!g.zenuml,yt=H?120:200,ut=H?100:150,ht=65,bt=H?36:44,Nt=16,Dt=120,st=40,Lt=10,ft=g.actors,Ct=g.messages,Xt=g.notes,St=g.fragments,Zt={actor:1,boundary:1,control:1,entity:1,database:1},G=0;G<ft.length;G++){var gt=H&&Zt[ft[G].type],oe=ft[G].label&&ft[G].label.length>0;if(H&&gt&&!oe)ft[G].labelWidth=80;else if(H){var ae=o(ft[G].label,16,"trebuchet ms,verdana,arial,sans-serif"),fe=gt?28:0;ft[G].labelWidth=ae.width+20+fe}else{var ae=o(ft[G].label,B,K);ft[G].labelWidth=ae.width+20}ft[G].labelHeight=Math.max(ht,65)}for(var ne={},ye=0;ye<ft.length;ye++)ne[ft[ye].name]=ye;for(var Mt=new Array(ft.length),$t=0;$t<ft.length;$t++)Mt[$t]=yt;if(Ct&&Ct.length>0)for(var Jt=16,e="trebuchet ms,verdana,arial,sans-serif",x=0;x<Ct.length;x++){var C=Ct[x],S=ne[C.from],Y=ne[C.to];if(!(S==null||Y==null||S===Y))for(var D=Math.min(S,Y),At=Math.max(S,Y),U=o(C.text||"",Jt,e),q=U.width+50,rt=At-D,ct=Math.max(yt,Math.ceil(q/rt)),nt=D;nt<At;nt++)ct>Mt[nt]&&(Mt[nt]=ct)}if(!H&&g.boxes&&g.boxes.length>0){for(var zt=10,Ot=5,Ft={},Pt=0;Pt<g.boxes.length;Pt++){var Wt=g.boxes[Pt];if(Wt.actors)for(var Kt=0;Kt<Wt.actors.length;Kt++)Ft[Wt.actors[Kt]]=Pt}for(var Bt=0;Bt<ft.length-1;Bt++){var ce=Ft[ft[Bt].name],kt=Ft[ft[Bt+1].name];ce!==kt&&(ce!=null&&(Mt[Bt]+=zt+Ot),kt!=null&&(Mt[Bt]+=Ot))}}for(var wt=0,G=0;G<ft.length;G++){var jt=H?Math.max(ut,ft[G].labelWidth||0):ut;ft[G].width=jt,ft[G].x=wt,ft[G].centerX=wt+jt/2,ft[G].labelHeight=ht;var Ht=Mt[G]||yt;wt+=H?Math.max(Ht,jt+20):Ht}for(var qt={},G=0;G<ft.length;G++)qt[ft[G].name]=G;for(var G=0;G<Xt.length;G++){var ee=Xt[G],Ut=qt[ee.actor];if(Ut!=null){for(var ve=ee.actor2!=null?qt[ee.actor2]:null,we=o(ee.text,B,K),Se=ee.text.split(/\n|<br\s*\/?>/gi),be=0,Me=0;Me<Se.length;Me++)Se[Me].length>be&&(be=Se[Me].length);var Fe=be*B*.6,Ue=Se.length*(B+8),De=0;if(ve!=null){var Ye=Math.min(ft[Ut].centerX,ft[ve].centerX),Pe=Math.max(ft[Ut].centerX,ft[ve].centerX);De=Pe-Ye+40}if(ee.width=Math.max(we.width+20,Fe+20,Dt,De),H)ee.height=Math.max(we.height+16,Ue+10,st);else{var de=17;ee.height=Math.max(Se.length*de+20,st)}if(ee.placement==="right")ee.x=ft[Ut].centerX+16;else if(ee.placement==="left")ee.x=ft[Ut].centerX-ee.width-16;else if(ve!=null){var Ve=(ft[Ut].centerX+ft[ve].centerX)/2;ee.x=Ve-ee.width/2}else ee.x=ft[Ut].centerX-ee.width/2}}for(var Ne=10,nr=10,Ge=10,Ie=17,Ce=H?ht+34:ht,Ke={},G=0;G<Xt.length;G++){var We=Xt[G],le=We.beforeMessageIdx!=null?We.beforeMessageIdx:Ct.length;Ke[le]||(Ke[le]=[]),Ke[le].push(We)}for(var Ae={},Le={},Re={},G=0;G<St.length;G++){var Be=St[G];Be.startIdx>=0&&(Ae[Be.startIdx]=!0);for(var je=Be.endIdx>=0?Be.endIdx:Ct.length,ie=Be.startIdx;ie<je;ie++)ie>=0&&ie<Ct.length&&(Re[ie]=!0);if(Be.sections)for(var fr=0;fr<Be.sections.length;fr++){var Ar=Be.sections[fr];Ar.startIdx>=0&&(Le[Ar.startIdx]=!0)}}for(var Lr=H?48:25,Ze=10,dr=H?64:41,Xe={},br={},G=0;G<St.length;G++)St[G].type==="rect"&&St[G].startIdx>=0&&(Xe[St[G].startIdx]=!0),St[G].type!=="rect"&&St[G].title&&St[G].startIdx>=0&&(br[St[G].startIdx]=!0);var vr=H?40:36,gr=H?0:10,fa={};if(H&&g.activations)for(var Je=0;Je<g.activations.length;Je++){var $e=g.activations[Je];$e.startIdx>=0&&$e.endIdx===$e.startIdx&&(fa[$e.startIdx]=!0)}for(var Qr={},$r={},Ir=[],G=0;G<=Ct.length;G++){for(var Cr=0;Cr<St.length;Cr++)St[Cr].type==="rect"&&St[Cr].startIdx===G&&(!H&&G===0&&(Ce+=Ne),Qr[Cr]=Ce,Ir.push(Cr));if(Ke[G])for(var Ea=0;Ea<Ke[G].length;Ea++){var We=Ke[G][Ea];qt[We.actor]!=null&&(H?(We.y=Ce,Ce+=We.height+10):(Ce+=Ne,We.y=Ce,Ce+=We.height))}for(var Cr=0;Cr<St.length;Cr++)St[Cr].type==="rect"&&St[Cr].endIdx===G&&Qr[Cr]!==void 0&&$r[Cr]===void 0&&($r[Cr]=Ce);if(G>=Ct.length)break;if(Ae[G])if(Xe[G]){var xa=Ir.length>1;xa||(Ce+=Ze)}else Ce+=br[G]?dr:Lr;Le[G]&&(Ce+=vr);var C=Ct[G],aa=qt[C.from],Gr=qt[C.to];if(!(aa==null||Gr==null)){H&&C.comments&&C.comments.length>0&&(Ce+=C.comments.length*16+4);var ya=1;if(!H&&C.text){for(var Br=C.text.split(/<br\s*\/?>|\n/),pa=Br.length,i=0,m=0;m<Br.length;m++){var k=o(Br[m],16,'"trebuchet ms",verdana,arial,sans-serif').width;k>i&&(i=k)}var R=Math.abs(ft[Gr].centerX-ft[aa].centerX),$=R>0?R-16:200,et=i>$?Math.ceil(i/Math.max($,1)):1;ya=pa*et}if(C.fromX=ft[aa].centerX,C.toX=ft[Gr].centerX,!H){let Ka=function(En){var Dn=En.width||150;return En.type==="actor"?25:Dn/2};var vt=ft[aa],Et=ft[Gr],Yt=vt.createMessageIndex===G||vt.destroyMessageIndex===G,Gt=Et.createMessageIndex===G||Et.destroyMessageIndex===G;if(Gt&&aa!==Gr){var he=Ka(Et);vt.centerX<Et.centerX?C.toX=Et.centerX-he:C.toX=Et.centerX+he}if(Yt&&aa!==Gr){var _e=Ka(vt);Et.centerX>vt.centerX?C.fromX=vt.centerX+_e:C.fromX=vt.centerX-_e}}if(H){var ua=ya>1?(ya-1)*18:0;Ce+=ua,C.y=Ce,C.from===C.to?Ce+=bt+20:Ce+=bt}else{for(var He=!1,qe=!1,Er=0;Er<ft.length;Er++){var Tr=ft[Er].destroyMessageIndex!=null&&ft[Er].destroyMessageIndex<Ct.length;ft[Er].destroyMessageIndex===G&&(He=!0),Tr&&G>0&&ft[Er].createMessageIndex===G-1&&(qe=!0)}He&&(Ce+=20),qe&&(Ce+=20),Ce+=Ge,Ce+=Ie;var Vr=Ie*ya,Zr=Vr-Ge+Ne;C.from===C.to&&(Zr+=30),C.y=Ce+Zr,Ce+=Zr,C.from===C.to&&(Ce+=30)}Re[G]&&(Ce+=gr),fa[G]&&(Ce+=20)}}var Aa,La;if(H)Aa=Ce-10,La=Aa+ht+20;else{if(Aa=Ce+Ne*2,Ct.length>0){for(var Fa=Ct.length-1,$a=0,_r=-1/0,wa=0;wa<St.length;wa++){var mr=St[wa];if(mr.type!=="rect"){var tr=mr.endIdx>=0?mr.endIdx:Ct.length;if(tr-1===Fa){$a++;var jr=Ct[Fa],va=jr.from===jr.to?40:10;_r=Math.max(_r,jr.y+va)}}}$a>=2&&_r>-1/0&&(Aa=Math.max(Aa,_r+50))}La=Aa+ht}for(var G=0;G<ft.length;G++)ft[G].height=La;for(var na=ht,G=0;G<ft.length;G++){var da=ft[G];da.createMessageIndex!=null&&da.createMessageIndex<Ct.length&&Ct[da.createMessageIndex].y!=null&&(da.lifelineStartY=Ct[da.createMessageIndex].y-na/2),da.destroyMessageIndex!=null&&da.destroyMessageIndex<Ct.length&&Ct[da.destroyMessageIndex].y!=null&&(da.lifelineEndY=Ct[da.destroyMessageIndex].y-na/2)}for(var Ia=new Array(St.length),Ma=0;Ma<St.length;Ma++){Ia[Ma]=0;for(var ln=St[Ma].startIdx,hn=St[Ma].endIdx>=0?St[Ma].endIdx:Ct.length,Ra=0;Ra<St.length;Ra++)if(Ra!==Ma){var wn=St[Ra].startIdx,tn=St[Ra].endIdx>=0?St[Ra].endIdx:Ct.length;wn<=ln&&tn>=hn&&(wn<ln||tn>hn)&&Ia[Ma]++}}for(var G=0;G<St.length;G++){var Be=St[G],yn=Math.max(0,Math.min(Be.startIdx,Ct.length-1)),gn=Be.endIdx>=0?Math.min(Be.endIdx,Ct.length):Ct.length,un=Be.type==="rect"?Ze:Be.title?H?dr:75:H?Lr:15,za;Be.type==="rect"&&Qr[G]!==void 0?za=Qr[G]:za=yn<Ct.length?Ct[yn].y-un:ht+34;var bn;if(Be.type==="rect"&&$r[G]!==void 0)bn=$r[G];else if(gn>0&&gn-1<Ct.length){var ja=Ct[gn-1],vn=ja.from===ja.to?40:10;bn=ja.y+vn}else bn=La-20;for(var Pa=1/0,Ba=-1/0,en=!1,ie=yn;ie<gn;ie++)if(ie<Ct.length){var Da=Ct[ie].from,xn=Ct[ie].to,Cr=qt[Da],Va=qt[xn],ea=H&&Da==="_STARTER_",ka=H&&xn==="_STARTER_";Cr!=null&&!ea&&(Pa=Math.min(Pa,ft[Cr].centerX),Ba=Math.max(Ba,ft[Cr].centerX)),Va!=null&&!ka&&(Pa=Math.min(Pa,ft[Va].centerX),Ba=Math.max(Ba,ft[Va].centerX)),Da===xn&&(en=!0)}en&&Ba!==-1/0&&(Pa-=70,Ba+=70),Pa===1/0&&(Pa=ft.length>0?ft[0].centerX:0,Ba=ft.length>0?ft[ft.length-1].centerX:yt);var _a=(Ia[G]||0)*10,ga=30;Be.x=Pa-ga+_a,Be.y=za,Be.width=Ba-Pa+ga*2-_a*2;for(var Xa=Be.endIdx>=0?Be.endIdx:Ct.length,rn=0,wa=0;wa<St.length;wa++)if(wa!==G){var cn=St[wa].startIdx,ia=St[wa].endIdx>=0?St[wa].endIdx:Ct.length;if(cn>=Be.startIdx&&ia<=Xa&&(cn>Be.startIdx||ia<Xa)&&ia===Xa){var Ga=(Ia[wa]||0)-(Ia[G]||0);Ga>rn&&(rn=Ga)}}Be.height=Math.max(bn-za+rn*20,bt+20)}if(g.boxes&&g.boxes.length>0){for(var ha=100,on=32,G=0;G<ft.length;G++)ft[G].y=(ft[G].y||0)+on;if(Xt)for(var G=0;G<Xt.length;G++)Xt[G].y=(Xt[G].y||0)+on;if(Ct)for(var G=0;G<Ct.length;G++)Ct[G].y=(Ct[G].y||0)+on;if(St)for(var G=0;G<St.length;G++)St[G].y=(St[G].y||0)+on;for(var G=0;G<g.boxes.length;G++){var Ta=g.boxes[G];if(!(!Ta.actors||Ta.actors.length===0)){for(var Ha=1/0,qa=-1/0,ie=0;ie<Ta.actors.length;ie++){var le=qt[Ta.actors[ie]];if(le!=null){var Za=ft[le];Ha=Math.min(Ha,Za.centerX),qa=Math.max(qa,Za.centerX)}}Ha!==1/0&&(Ta.x=Ha-ha,Ta.y=0,Ta.width=qa-Ha+ha*2,Ta.height=La+on+20)}}}return g}function oa(g,tt){var B=g.commits,K=g.branches,H=g.isVertical,yt=10,ut=40,ht=30,bt=ut+yt,Nt=50+(g.rotateCommitLabel!==!1?40:0),Dt=20,st=[],Lt={};for(var ft in K)Lt[ft]||(Lt[ft]=!0,st.push(ft));for(var Ct=0;Ct<B.length;Ct++){var Xt=B[Ct].branch;Lt[Xt]||(Lt[Xt]=!0,st.push(Xt))}for(var St=[],Ct=0;Ct<st.length;Ct++){var Zt=st[Ct],G=K[Zt]&&K[Zt].order,gt=G!=null?G:parseFloat("0."+Ct);St.push({name:Zt,declIndex:Ct,key:gt})}St.sort(function(wt,jt){return wt.key!==jt.key?wt.key-jt.key:wt.declIndex-jt.declIndex});for(var oe=[],ae={},fe={},ne=g.rotateCommitLabel!==!1,ye=50+(ne?40:0),Mt=0,Ct=0;Ct<St.length;Ct++){var Zt=St[Ct].name;if(ae[Zt]=Ct,oe.push(Zt),fe[Zt]=Mt,H){var $t=Zt.length*9;Mt+=50+(ne?40:0)+$t/2}else Mt+=ye}var Jt=!!g.parallelCommits,e={};if(Jt)for(var x={},C=0;C<B.length;C++){var S=B[C],Y=S.branch;if(x[Y]==null){var D=K[Y]&&K[Y].startCommit,At=0;if(D!=null&&B[g.commitMap[D]]){var U=B[g.commitMap[D]];At=(U.seq!=null?U.seq:0)+1}e[Y]=At,x[Y]=0}S.seq=e[Y]+x[Y],x[Y]++}for(var q=0;q<B.length;q++)B[q].seq==null&&(B[q].seq=q);for(var rt=g.dir||(H?"TB":"LR"),ct=H?ht:0,Ct=0;Ct<B.length;Ct++){var nt=B[Ct],zt=Jt?nt.seq:Ct;rt==="BT"&&!Jt&&(zt=B.length-1-Ct);var Ot=ct+zt*bt+yt,Ft=fe[nt.branch]!=null?fe[nt.branch]:(ae[nt.branch]||0)*Nt;H?(nt.x=Ft-Dt/2,nt.y=Ot-Dt/2):(nt.x=Ot-Dt/2,nt.y=Ft-Dt/2),nt.cx=H?Ft:Ot,nt.cy=H?Ot:Ft,nt.width=Dt,nt.height=Dt}for(var Pt=ct,Ct=0;Ct<B.length;Ct++){var Wt=H?B[Ct].cy:B[Ct].cx,Kt=Wt+ut;Kt>Pt&&(Pt=Kt)}Pt===ct&&(Pt=ct+bt);var Bt=-2;for(var ft in K){var ce=ae[ft]||0,Ft=(fe[ft]!=null?fe[ft]:ce*Nt)+Bt;H?(K[ft].x=Ft,K[ft].y=ht,K[ft].width=1,K[ft].height=Pt-ht):(K[ft].x=0,K[ft].y=Ft,K[ft].width=Pt,K[ft].height=1),K[ft].lane=ce,K[ft].pos=Ft}for(var Ct=0;Ct<B.length;Ct++){var nt=B[Ct];H?(nt.x+=Bt,nt.cx+=Bt):(nt.y+=Bt,nt.cy+=Bt)}if(rt==="RL")for(var kt=Pt/2,Ct=0;Ct<B.length;Ct++){var nt=B[Ct];nt.cx=2*kt-nt.cx,nt.x=nt.cx-Dt/2}return g.dir=rt,g.maxPos=Pt,g.layoutOffset=yt,g.commitStep=ut,g.defaultPos=ht,g}function Sr(g,tt){for(var B=150,K=50,H=50,yt=50,ut=110,ht=50,bt=450,Nt=200,Dt=150,st=g.sections,Lt=Dt,ft=0;ft<st.length;ft++){var Ct=st[ft],Xt=Ct.tasks.length,St=Lt;Ct.x=St,Ct.y=H,Ct.height=yt,Ct.width=Xt*B+(Xt-1)*K,Ct.index=ft;for(var Zt=0;Zt<Xt;Zt++){var G=Ct.tasks[Zt];G.width=B,G.height=ht,G.x=Lt,G.y=ut,G.lineEndY=bt,G.sectionIndex=ft,G.faceCy=300+(5-G.score)*30,Lt+=B+K}}return g.timelineStartX=Dt,g.timelineEndX=Lt-K+50,g.timelineY=Nt,g}var Rr=["#ECECFF","#ffffde","#b5ff20","#b9b9ff","#ffff45","#d7ff86","#c286ff","#ff86ff","#ff8686","#ffc286","#c2ff86","#86ffc2"];function Mr(g,tt){for(var B=g.sections.length,K=g.total,H=225,yt=225,ut=185,ht=186,bt=19,Nt=ut*.75,Dt=216,st=0,Lt=[],ft=0;ft<B;ft++){var Ct=g.sections[ft],Xt=K>0?Ct.value/K:0,St=st+Xt/2,Zt=2*Math.PI*St,G=Nt*Math.sin(Zt),gt=-Nt*Math.cos(Zt);Lt.push({label:Ct.label,value:Ct.value,percent:Math.round(Xt*100),color:Rr[ft%Rr.length],startFrac:st,endFrac:st+Xt,labelX:G,labelY:gt}),st+=Xt}for(var oe=17,ae=oe*.55,fe=0,ft=0;ft<B;ft++){var ne=g.sections[ft].label;g.showData&&(ne+=" ["+g.sections[ft].value+"]");var ye=ne.length*ae;ye>fe&&(fe=ye)}var Mt=H+Dt+18+4+fe+30;Mt=Math.max(Math.ceil(Mt),500);var $t=450;return{type:"pie",title:g.title,showData:g.showData,pieCx:H,pieCy:yt,pieR:ut,outerR:ht,titleY:bt,fontSize:oe,slices:Lt,sections:g.sections,canvasW:Mt,canvasH:$t}}function er(g,tt){for(var B=tt&&tt.packet||{},K=B.bitsPerRow||32,H=B.bitWidth||27,yt=B.paddingX||5,ut=B.rowHeight||32,ht=H+yt,bt=[],Nt=0,Dt=1e5,st=0;st<g.fields.length&&bt.length<Dt;st++)for(var Lt=g.fields[st],ft=Lt.start;ft<=Lt.end&&bt.length<Dt;){var Ct=Math.floor(ft/K),Xt=Ct*K,St=Xt+K-1,Zt=Math.min(Lt.end,St),G=ft-Xt,gt=Zt-ft+1;bt.push({label:Lt.label,startBit:ft,endBit:Zt,x:1+G*ht,y:15+Ct*(ut+15),width:gt*ht-yt,height:ut}),Ct>Nt&&(Nt=Ct),ft=Zt+1}var oe=2+K*ht,ae=15+Nt*(ut+15)+ut,fe=ae+(g.title?47:15);return{type:"packet",title:g.title,blocks:bt,canvasW:oe,canvasH:fe,bitsPerRow:K}}function Xr(g,tt){for(var B=!!g.title,K=g.points.length>0,H=tt&&tt.quadrantChart||{},yt=H.chartWidth||500,ut=H.chartHeight||500,ht=31,bt=5,Nt=31,Dt=K?31:5,st=ht,Lt=yt-bt,ft=Nt+(B?14:0),Ct=ut-Dt,Xt=(st+Lt)/2,St=(ft+Ct)/2,Zt=Xt-st,G=St-ft,gt=Lt-st,oe=Ct-ft,ae="Trebuchet MS,Verdana,Arial,sans-serif",fe=[{key:"q1",label:g.quadrants.q1,fill:"#ECECFF",color:"#111111",x:Xt,y:ft,w:Zt,h:G,labelCx:Xt+Zt/2},{key:"q2",label:g.quadrants.q2,fill:"#f1f1ff",color:"#0C0C0C",x:st,y:ft,w:Zt,h:G,labelCx:st+Zt/2},{key:"q3",label:g.quadrants.q3,fill:"#f6f6ff",color:"#070707",x:st,y:St,w:Zt,h:G,labelCx:st+Zt/2},{key:"q4",label:g.quadrants.q4,fill:"#fbfbff",color:"#020202",x:Xt,y:St,w:Zt,h:G,labelCx:Xt+Zt/2}],ne=0;ne<fe.length;ne++){var ye=fe[ne];K?(ye.labelCy=ye.y+5,ye.labelBaseline="hanging"):(ye.labelCy=ye.y+ye.h/2,ye.labelBaseline="middle")}for(var Mt=[],ne=0;ne<g.points.length;ne++){var $t=g.points[ne],Jt={};if($t.className&&g.classes[$t.className]){var e=g.classes[$t.className];for(var x in e)e.hasOwnProperty(x)&&(Jt[x]=e[x])}for(var x in $t.styles)$t.styles.hasOwnProperty(x)&&(Jt[x]=$t.styles[x]);var C=5;if(Jt.radius!=null){var S=parseFloat(Jt.radius);!isNaN(S)&&S>0&&(C=S)}var Y=0;if(Jt["stroke-width"]!=null){var D=parseFloat(Jt["stroke-width"]);!isNaN(D)&&D>=0&&(Y=D)}var At=Jt.color||"#000000",U=Jt["stroke-color"]||null;Mt.push({name:$t.name,cx:st+$t.x*gt,cy:Ct-$t.y*oe,radius:C,fill:At,stroke:U,strokeWidth:Y})}var q=[];return g.xAxis&&(K?(q.push({text:g.xAxis.left,anchorX:st+Zt/2,anchorY:Ct+10,textAnchor:"middle",baseline:"hanging",rotation:0,fontSize:16}),g.xAxis.right&&q.push({text:g.xAxis.right,anchorX:Xt+Zt/2,anchorY:Ct+10,textAnchor:"middle",baseline:"hanging",rotation:0,fontSize:16})):g.xAxis.right?(q.push({text:g.xAxis.left,anchorX:st+Zt/2,anchorY:5,textAnchor:"middle",baseline:"hanging",rotation:0,fontSize:16}),q.push({text:g.xAxis.right,anchorX:Xt+Zt/2,anchorY:5,textAnchor:"middle",baseline:"hanging",rotation:0,fontSize:16})):q.push({text:g.xAxis.left,anchorX:st,anchorY:5,textAnchor:"start",baseline:"hanging",rotation:0,fontSize:16})),g.yAxis&&(g.yAxis.right?(q.push({text:g.yAxis.left,anchorX:5,anchorY:St+G/2,textAnchor:"middle",baseline:"hanging",rotation:-90,fontSize:16}),q.push({text:g.yAxis.right,anchorX:5,anchorY:ft+G/2,textAnchor:"middle",baseline:"hanging",rotation:-90,fontSize:16})):q.push({text:g.yAxis.left,anchorX:5,anchorY:Ct,textAnchor:"start",baseline:"hanging",rotation:-90,fontSize:16})),{type:"quadrant",canvasW:yt,canvasH:ut,plotLeft:st,plotRight:Lt,plotTop:ft,plotBottom:Ct,midX:Xt,midY:St,hasPoints:K,title:g.title,quadrants:fe,points:Mt,axisLabels:q,borderColor:"#D5D5D5",titleColor:"#111111",textColor:"#111111",fontFamily:ae}}function Kr(g,tt){var B=g.size&&g.size.width||900,K=g.size&&g.size.height||600,H=48,yt=6,ut=yt*1.6,ht=B-H*2,bt=K-H*2;function Nt(Ve){return H+Ve/100*ht}function Dt(Ve){return K-H-Ve/100*bt}var st={axis:"#333333",axisText:"#131300",componentFill:"#ffffff",componentStroke:"#333333",labelColor:"#131300",link:"#333333",evolution:"#dc3545"},Lt=["Genesis","Custom Built","Product","Commodity"],ft=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Lt,Ct=g.axes.stageBoundaries,Xt=[];if(Ct&&Ct.length===ft.length)for(var St=0,Zt=0;Zt<Ct.length;Zt++)Xt.push({start:St,end:Ct[Zt]}),St=Ct[Zt];else for(var G=1/ft.length,gt=0;gt<ft.length;gt++)Xt.push({start:gt*G,end:(gt+1)*G});for(var oe=[],ae=0;ae<ft.length;ae++){var fe=Xt[ae],ne=H+fe.start*ht,ye=H+fe.end*ht;oe.push({label:ft[ae],startX:ne,endX:ye,centerX:(ne+ye)/2,boundaryX:ne,showBoundary:ae>0,labelY:K-H/1.5})}for(var Mt={},$t=[],Jt=0;Jt<g.nodes.length;Jt++){var e=g.nodes[Jt],x=Nt(e.x),C=Dt(e.y),S=e.kind==="anchor",Y=e.labelOffsetX!=null?e.labelOffsetX:S?0:e.strategy?18:yt+2,D=e.labelOffsetY!=null?e.labelOffsetY:S?-3:e.strategy?-18:-(yt+2),At={id:e.id,name:e.name,kind:e.kind,strategy:e.strategy,inertia:e.inertia,isPipelineParent:e.isPipelineParent,inPipeline:e.inPipeline,cx:x,cy:C,radius:e.isPipelineParent?ut/2:yt,labelX:x+Y,labelY:C+D,labelAnchor:S?"middle":"start",labelBaseline:S?"middle":"alphabetic",labelBold:S};$t.push(At),Mt[At.id]=At}for(var U=[],q=0;q<g.pipelines.length;q++){for(var rt=g.pipelines[q],ct=[],nt=0;nt<rt.componentIds.length;nt++){var zt=Mt[rt.componentIds[nt]];zt&&ct.push(zt)}if(ct.length!==0){ct.sort(function(Ve,Ne){return Ve.cx-Ne.cx});for(var Ot=[],Ft=0;Ft<ct.length-1;Ft++)Ot.push({x1:ct[Ft].cx,y1:ct[Ft].cy,x2:ct[Ft+1].cx,y2:ct[Ft+1].cy});for(var Pt=1/0,Wt=-1/0,Kt=0,Bt=0;Bt<ct.length;Bt++)Pt=Math.min(Pt,ct[Bt].cx),Wt=Math.max(Wt,ct[Bt].cx),Kt=ct[Bt].cy;var ce=15,kt=yt*4,wt=Kt-kt/2,jt=Mt[rt.parent];jt&&(jt.cx=(Pt+Wt)/2,jt.cy=wt-ut/6,jt.radius=ut/2,jt.labelX=jt.cx,jt.labelY=jt.cy-(ut/2+4),jt.labelAnchor="middle"),U.push({boxX:Pt-ce,boxY:wt,boxW:Wt-Pt+ce*2,boxH:kt,links:Ot})}}for(var Ht=[],qt=0;qt<g.links.length;qt++){var ee=g.links[qt];!Mt[ee.from]||!Mt[ee.to]||Ht.push({from:ee.from,to:ee.to,dashed:ee.dashed,flow:ee.flow,label:ee.label})}for(var Ut=[],ve=0;ve<g.trends.length;ve++){var we=g.trends[ve],Se=Mt[we.nodeId];Se&&Ut.push({nodeId:we.nodeId,cx:Se.cx,cy:Se.cy,targetX:Nt(we.targetX),targetY:Dt(we.targetY)})}for(var be=[],Me=0;Me<g.notes.length;Me++)be.push({text:g.notes[Me].text,x:Nt(g.notes[Me].x),y:Dt(g.notes[Me].y)});for(var Fe=[],Ue=0;Ue<g.annotations.length;Ue++)Fe.push({number:g.annotations[Ue].number,text:g.annotations[Ue].text,x:Nt(g.annotations[Ue].x),y:Dt(g.annotations[Ue].y)});var De=null;g.annotationsBox&&(De={x:Nt(g.annotationsBox.x),y:Dt(g.annotationsBox.y)});for(var Ye=[],Pe=0;Pe<g.accelerators.length;Pe++)Ye.push({name:g.accelerators[Pe].name,x:Nt(g.accelerators[Pe].x),y:Dt(g.accelerators[Pe].y),decel:!1});for(var de=0;de<g.deaccelerators.length;de++)Ye.push({name:g.deaccelerators[de].name,x:Nt(g.deaccelerators[de].x),y:Dt(g.deaccelerators[de].y),decel:!0});return{type:"wardley",width:B,height:K,padding:H,nodeRadius:yt,title:g.title,xLabel:g.axes.xLabel||"Evolution",yLabel:g.axes.yLabel||"Visibility",axisTop:H,axisBottom:K-H,axisLeft:H,axisRight:B-H,stageBands:oe,nodes:$t,links:Ht,trends:Ut,pipelines:U,notes:be,annotations:Fe,annotationsBox:De,accelerators:Ye,colors:st,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function Ur(g,tt){var B={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextPadding:10},K='"trebuchet ms",verdana,arial,sans-serif';function H(Pe){return String(Pe==null?"":Pe).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var yt=10,ut=50,ht=24;function bt(Pe){for(var de=0,Ve=0;Ve<Pe.length;Ve++)de=Math.max(de,Pe[Ve].length);return{width:Math.min(B.textMaxWidth,de*yt+ut),height:Pe.length*ht}}var Nt={ui:{index:0,label:"UI/Automation",band:[0,100],prefix:"UI/A: "},pcr:{index:0,label:"UI/Automation",band:[0,100],prefix:"UI/A: "},processor:{index:0,label:"UI/Automation",band:[0,100],prefix:"UI/A: "},cmd:{index:100,label:"Command/Read Model",band:[100,200],prefix:"C/RM: "},command:{index:100,label:"Command/Read Model",band:[100,200],prefix:"C/RM: "},rmo:{index:100,label:"Command/Read Model",band:[100,200],prefix:"C/RM: "},readmodel:{index:100,label:"Command/Read Model",band:[100,200],prefix:"C/RM: "},evt:{index:200,label:"Events",band:[200,300],prefix:"Stream: "},event:{index:200,label:"Events",band:[200,300],prefix:"Stream: "}},Dt={ui:{fill:"#ffffff",stroke:"#dbdada"},pcr:{fill:"#edb3f6",stroke:"#b88cbf"},processor:{fill:"#edb3f6",stroke:"#b88cbf"},rmo:{fill:"#d3f1a2",stroke:"#a3b732"},readmodel:{fill:"#d3f1a2",stroke:"#a3b732"},cmd:{fill:"#bcd6fe",stroke:"#679ac3"},command:{fill:"#bcd6fe",stroke:"#679ac3"},evt:{fill:"#ffb778",stroke:"#c19a0f"},event:{fill:"#ffb778",stroke:"#c19a0f"}};function st(Pe){var de=Pe.split(".");return de.length===2?de[1]:Pe}function Lt(Pe){var de=Pe.split(".");return de.length===2?de[0]:null}function ft(Pe,de,Ve){var Ne=de;for(var nr in Pe){var Ge=parseInt(nr,10);Ge>de&&Ge<Ve&&Ge>Ne&&(Ne=Ge)}return Ne+1}function Ct(Pe,de){var Ve=Nt[Pe.entityType]||Nt.evt,Ne=Lt(Pe.entityIdentifier);return Ne?{index:ft(de,Ve.band[0],Ve.band[1]),label:Ve.prefix+Ne}:{index:Ve.index,label:Ve.label}}var Xt={},St=[],Zt=[],G,gt=0;function oe(Pe){var de=st(Pe.entityIdentifier),Ve="<b>"+H(de)+"</b>",Ne=null,nr=[];if(Pe.dataInline)nr=[Pe.dataInline];else if(Pe.dataReference){for(var Ge=0;Ge<g.dataEntities.length;Ge++)if(g.dataEntities[Ge].name===Pe.dataReference){nr=g.dataEntities[Ge].lines.slice();break}}nr.length>0&&(Ne=nr.map(H).join("<br/>")),Ne!=null&&(Ve+='<br/><br/><code style="text-align: left; display: block;max-width:'+B.textMaxWidth+'px">'+Ne+"</code>");var Ie=[de];return nr.length>0&&(Ie=Ie.concat([""]).concat(nr)),{content:Ve,hasData:Ne!=null,lines:Ie}}for(var ae=0;ae<g.frames.length;ae++){var fe=g.frames[ae],ne=oe(fe),ye=bt(ne.lines),Mt=ye.width+2*B.boxTextPadding,$t=ye.height+2*B.boxTextPadding,Jt=Ct(fe,Xt),e=Xt[Jt.index];e||(e={index:Jt.index,label:Jt.label,r:0,y:Jt.index*B.swimlaneMinHeight+B.swimlaneGap,height:B.swimlaneMinHeight,maxHeight:B.swimlaneMinHeight},Xt[Jt.index]=e);var x=St.length>0?St[St.length-1]:void 0,C=G!==void 0?Xt[G]:void 0,S=Math.max(B.boxMinWidth,Math.min(B.boxMaxWidth,Mt))+2*B.boxPadding,Y=Math.max(B.boxMinHeight,Math.min(B.boxMaxHeight,$t))+2*B.boxPadding,D;C===void 0?D=B.contentStartX:C.index===e.index&&e.r?D=e.r+B.boxPadding:x===void 0?D=B.contentStartX:D=x.r-B.boxOverlap+B.boxPadding;var At=D+S+B.boxPadding;gt=Math.max(gt,At),e.r=D+S,e.maxHeight=Math.max(e.maxHeight,Y),e.height=Math.max(B.swimlaneMinHeight,e.maxHeight)+2*B.swimlanePadding;var U=Dt[fe.entityType]||{fill:"red",stroke:"black"};St.push({x:D,r:At,width:S,height:Y,swimlane:e,fill:U.fill,stroke:U.stroke,content:ne.content,frameName:fe.name,index:ae}),G=Jt.index;var q=ae===0&&fe.sourceFrames.length===0;if(!fe.isReset&&!q){var rt=St[St.length-1];if(fe.sourceFrames.length>0)for(var ct=0;ct<fe.sourceFrames.length;ct++){for(var nt=fe.sourceFrames[ct],zt=null,Ot=0;Ot<St.length;Ot++)if(St[Ot].frameName===nt){zt=St[Ot];break}zt&&Zt.push({sourceBox:zt,targetBox:rt})}else{for(var Ft=null,Pt=St.length-2;Pt>=0;Pt--)if(St[Pt].swimlane.index!==rt.swimlane.index){Ft=St[Pt];break}Ft&&Zt.push({sourceBox:Ft,targetBox:rt})}}}var Wt=Object.keys(Xt).map(function(Pe){return Xt[Pe]}).sort(function(Pe,de){return Pe.index-de.index});Wt.length>0&&(Wt[0].y=0);for(var Kt=1;Kt<Wt.length;Kt++)Wt[Kt].y=Wt[Kt-1].y+Wt[Kt-1].height+B.swimlaneGap;for(var Bt=Wt.length>0?Wt[Wt.length-1].y+Wt[Wt.length-1].height:0,ce=gt+B.swimlanePadding,kt=[],wt=0;wt<St.length;wt++){var jt=St[wt];kt.push({x:jt.x,y:jt.swimlane.y+B.swimlanePadding,width:jt.width,height:jt.height,fill:jt.fill,stroke:jt.stroke,content:jt.content,frameName:jt.frameName})}for(var Ht=[],qt=0;qt<Wt.length;qt++){var ee=Wt[qt];Ht.push({x:0,y:ee.y,width:ce,height:ee.height,label:ee.label,labelX:30,labelY:ee.y+30})}for(var Ut=[],ve=0;ve<Zt.length;ve++){var we=Zt[ve],Se=we.sourceBox.swimlane.y+B.swimlanePadding,be=we.targetBox.swimlane.y+B.swimlanePadding,Me=Se>be,Fe=we.sourceBox.x+we.sourceBox.width*2/3,Ue=we.targetBox.x+we.targetBox.width/3,De,Ye;Me?(De=Se,Ye=be+we.targetBox.height):(De=Se+we.sourceBox.height,Ye=be),Ut.push({x1:Fe,y1:De,x2:Ue,y2:Ye})}return{type:"eventmodeling",width:ce,height:Bt,title:g.title,swimlanes:Ht,boxes:kt,relations:Ut,swimlaneBg:"rgb(250,250,250)",swimlaneStroke:"rgb(240,240,240)",relationStroke:"#000000",arrowColor:"#000000",fontFamily:"trebuchet ms,verdana,arial,sans-serif"}}var Jr={a:8.41,b:8.91,c:7.92,d:8.91,e:8.73,f:5.91,g:8.03,h:8.74,i:4.56,j:5.87,k:8.07,l:4.72,m:13.28,n:8.74,o:8.59,p:8.91,q:8.91,r:6.22,s:6.48,t:6.34,u:8.74,v:7.84,w:11.91,x:8.02,y:7.89,z:7.59,A:9.44,B:9.05,C:9.57,D:9.81,E:8.57,F:8.4,G:10.82,H:10.47,I:4.45,J:7.63,K:9.21,L:8.1,M:11.35,N:10.21,O:10.78,P:8.92,Q:10.81,R:9.31,S:7.7,T:9.29,U:10.38,V:9.4,W:13.63,X:8.91,Y:9.13,Z:8.8,0:8.39,1:8.39,2:8.39,3:8.39,4:8.39,5:8.39,6:8.39,7:8.39,8:8.39,9:8.39," ":4.5,".":5.88,",":5.88,"!":5.88,"?":5.88,"'":2.55,"-":5.88,":":5.88,"(":5.88,")":5.88,"/":8.39,"<":8.39,">":8.39,";":5.88,'"':5.88,"`":2.55,_:8.39},Yr=8;function ke(g){for(var tt=0,B=0;B<g.length;B++){var K=g.charAt(B),H=Jr[K];tt+=H==null?Yr:H}return tt}function ze(g,tt){if(g==null||g==="")return 1;for(var B=Jr[" "],K=String(g).split(/<br\s*\/?>/i),H=0,yt=0;yt<K.length;yt++){var ut=K[yt].split(/\s+/).filter(function(Lt){return Lt.length>0});if(ut.length===0){H+=1;continue}for(var ht=1,bt=0,Nt=0;Nt<ut.length;Nt++){var Dt=ke(ut[Nt]),st=(bt>0?B:0)+Dt;bt+st>tt&&bt>0?(ht++,bt=Dt):bt+=st}H+=ht}return Math.max(1,H)}function lr(g,tt){var B=17.6;return 27.8+(g-1)*B+tt}function ir(g,tt){if(g.direction==="TD"||g.direction==="BT")return ur(g,tt);for(var B=200,K=200,H=190,yt=20,ut=20,ht=50,bt=10,Nt=111,Dt=50,st=200,Lt=57,ft=61,Ct=150,Xt=[],St=g.explicitSections,Zt=!!(tt&&tt.timeline&&tt.timeline.disableMulticolor),G=0;G<g.sections.length;G++)for(var gt=g.sections[G],oe=0;oe<gt.periods.length;oe++){var ae=gt.periods[oe],fe;St?fe=G-1:Zt?fe=-1:fe=Xt.length-1,Xt.push({period:ae,sectionIdx:G,colorIdx:fe,events:ae.events})}for(var ne=Xt.length,ye=0,Mt=0;Mt<Xt.length;Mt++)Xt[Mt].events.length>ye&&(ye=Xt[Mt].events.length);for(var $t=Ct,Jt=0,G=0;G<g.sections.length;G++){var gt=g.sections[G],e=ze(gt.name,$t),x=lr(e,yt)+20;x>Jt&&(Jt=x)}for(var C=0,S=[],Mt=0;Mt<ne;Mt++){var Y=ze(Xt[Mt].period.name,Ct),D=lr(Y,yt)+20;S.push(D),D>C&&(C=D)}for(var At=Nt,U=St?At+Jt+Dt:At,q=U+C+50,rt=U+st,ct=C,nt=[],zt=0,Mt=0;Mt<ne;Mt++){for(var Ot=B+Mt*K,ae=Xt[Mt],Ft=[],Pt=[],Wt=rt,Kt=0,Bt=0;Bt<ae.events.length;Bt++){var e=ze(ae.events[Bt],Ct),x=Math.max(ht,lr(e,ut));Ft.push(x),Pt.push(Wt),Wt+=x+bt,Kt+=x+(Bt>0?bt:0)}Kt>zt&&(zt=Kt),nt.push({x:Ot,centerX:Ot+H/2,period:ae.period,sectionIdx:ae.sectionIdx,colorIdx:ae.colorIdx,events:ae.events,eventHeights:Ft,eventYs:Pt})}var ce=rt+zt,kt=ce+Lt,wt=[];if(St)for(var jt=0,G=0;G<g.sections.length;G++){var gt=g.sections[G],Ht=gt.periods.length;if(Ht!==0){var qt=nt[jt],ee=Ht*K-10;wt.push({x:qt.x,y:At,width:ee,height:Jt,name:gt.name,colorIdx:G-1}),jt+=Ht}}var Ut=B+(ne-1)*K+H,ve=Ut+250,we=Math.ceil(kt+50),Se=B-50,be=Ut+250,Me=100*Math.max(1,ne)-155,Fe=20+ft-32;return{type:"timeline",title:g.title,hasSections:St,vertical:!1,canvasW:ve,canvasH:we,columns:nt,sectionRects:wt,cardWidth:H,cardHeight:ct,eventWidth:H,eventHeight:ht,taskRowY:U,sectionRowY:At,firstEventY:rt,arrowY:q,horizArrowX1:Se,horizArrowX2:be,vertArrowBot:kt,titleX:Me,titleY:Fe,maxEvents:ye,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function ur(g,tt){for(var B=200,K=5,H=B+K*2,yt=B+100,ut=yt+K*2,ht=10,bt=20,Nt=20,Dt=30,st=50,Lt=150,ft=61,Ct=50+ft,Xt=g.explicitSections,St=!!(tt&&tt.timeline&&tt.timeline.disableMulticolor),Zt=[],G=0;G<g.sections.length;G++)for(var gt=g.sections[G],oe=0;oe<gt.periods.length;oe++){var ae=gt.periods[oe],fe;Xt?fe=G-1:St?fe=-1:fe=Zt.length-1,Zt.push({period:ae,sectionIdx:G,colorIdx:fe,events:ae.events})}for(var ne=50+Lt,ye=H+Nt,Mt=ut+st,$t=Math.max(50,ye+Mt-K*2),Jt=$t+2*K,e=ne,x=e+ye,C=x-Nt-H,S=x+st,Y=0,D=0,At=[],U=[],q=[],rt=0;rt<g.sections.length;rt++){var gt=g.sections[rt],ct=ze(gt.name,Jt),nt=lr(ct,K);U.push(nt)}for(var rt=0;rt<Zt.length;rt++){var ae=Zt[rt],zt=ze(ae.period.name,B),Ot=lr(zt,K);At.push(Ot),Ot>Y&&(Y=Ot);for(var Ft=0,Pt=[],Wt=0;Wt<ae.events.length;Wt++){var Kt=ze(ae.events[Wt],yt),Bt=lr(Kt,K);Pt.push(Bt),Ft+=Bt,Wt>0&&(Ft+=ht)}q.push(Pt),Ft>D&&(D=Ft)}var ce=Math.max(Y,D),kt=ce+Dt,wt=[],jt=[],Ht=Ct;if(Xt)for(var qt=0,rt=0;rt<g.sections.length;rt++){var gt=g.sections[rt],ee=gt.periods.length;if(ee!==0){var Ut=U[rt],ve=x-ye;jt.push({x:ve,y:Ht,width:Jt,height:Ut,name:gt.name,colorIdx:rt-1});for(var we=Ht+Ut+bt,Se=0;Se<ee;Se++){for(var ae=Zt[qt],Ot=At[qt],be=[],Me=we,Wt=0;Wt<ae.events.length;Wt++){var Bt=q[qt][Wt];be.push({x:S,y:Me,width:yt,height:Bt,lineY:Me+Bt/2,text:ae.events[Wt]}),Me+=Bt+ht}wt.push({taskX:C,taskY:we,taskWidth:B,taskHeight:Ot,taskName:ae.period.name,colorIdx:ae.colorIdx,events:be}),we+=kt,qt++}Ht+=Ut+bt+kt*ee-(ee>0?Dt*2:0)}}else for(var we=Ht,rt=0;rt<Zt.length;rt++){for(var ae=Zt[rt],Ot=At[rt],be=[],Me=we,Wt=0;Wt<ae.events.length;Wt++){var Bt=q[rt][Wt];be.push({x:S,y:Me,width:ut,height:Bt,lineY:Me+Bt/2,text:ae.events[Wt]}),Me+=Bt+ht}wt.push({taskX:C,taskY:we,taskWidth:H,taskHeight:Ot,taskName:ae.period.name,colorIdx:ae.colorIdx,events:be}),we+=kt}var Fe=wt[wt.length-1],Ue=Ct;if(Fe){for(var De=Fe.taskY+Fe.taskHeight,Se=0;Se<Fe.events.length;Se++){var Ye=Fe.events[Se];Ye.y+Ye.height>De&&(De=Ye.y+Ye.height)}Ue=De}var Pe=Ct-32,de=Ue+30,Ve=Math.ceil(S+ut+50),Ne=Math.ceil(de+30),nr=145,Ge=20+ft-32;return{type:"timeline",title:g.title,hasSections:Xt,vertical:!0,canvasW:Ve,canvasH:Ne,rows:wt,sectionRects:jt,timelineX:x,arrowY1:Pe,arrowY2:de,titleX:nr,titleY:Ge,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function zr(g,tt){if(!g)return 1;for(var B=8,K=4,H=String(g).split(`
-`),yt=0,ut=0;ut<H.length;ut++){var ht=H[ut].split(/\s+/).filter(function(ft){return ft.length>0});if(ht.length===0){yt+=1;continue}for(var bt=1,Nt=0,Dt=0;Dt<ht.length;Dt++){var st=ht[Dt].length*B,Lt=(Nt>0?K:0)+st;Nt+Lt>tt&&Nt>0?(bt++,Nt=st):Nt+=Lt}yt+=bt}return Math.max(1,yt)}function cr(g,tt){for(var B=200,K=205,H=10,yt=25,ut=185,ht=175,bt=24,Nt=5,Dt=10,st=35,Lt=[],ft=0;ft<g.columns.length;ft++){for(var Ct=g.columns[ft],Xt=[],St=yt,Zt=0;Zt<Ct.cards.length;Zt++){var G=Ct.cards[Zt],gt=G.metadata||{},oe=!!(gt.ticket||gt.assigned),ae=zr(G.label||"",ht),fe=ae*bt,ne=oe?8+fe+bt:20+fe;Xt.push({id:G.id,label:G.label,metadata:gt,top:St,centerY:St+ne/2,height:ne,titleH:fe,hasMeta:oe,assignedW:gt.assigned?ke(String(gt.assigned)):0}),St+=ne+Nt}var ye;Xt.length>0?ye=St-Nt+Dt:ye=st+Dt,Lt.push({id:Ct.id,label:Ct.label,colorIdx:ft+2,x:H+ft*K,y:H,width:B,height:ye,cards:Xt})}for(var Mt=0,ft=0;ft<Lt.length;ft++)Lt[ft].height>Mt&&(Mt=Lt[ft].height);var $t=Lt.length,Jt=H*2+($t>0?($t-1)*K+B:0),e=H*2+Mt;return{type:"kanban",canvasW:Jt,canvasH:e,columns:Lt,cardWidth:ut,ticketBaseUrl:tt&&tt.kanban&&tt.kanban.ticketBaseUrl||null,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function Nr(g,tt,B){if(g==null||tt==null||g>=tt)return[];var K=tt-g,H=K/B,yt=Math.pow(10,Math.floor(Math.log(H)/Math.LN10)),ut=H/yt,ht;ut<=1?ht=1:ut<=2?ht=2:ut<=5?ht=5:ht=10,ht*=yt;for(var bt=[],Nt=Math.floor(g/ht)*ht,Dt=Nt;Dt<=tt+ht*1e-4;Dt+=ht)Dt>=g-ht*1e-4&&bt.push(Math.round(Dt*1e6)/1e6);return bt}function Fr(g,tt){var B=700,K=500,H=21,yt=42,ut=50,ht=432,bt=459,Nt=441,Dt=467,st=18,Lt=8,ft=.61,Ct=!!(g.xAxis&&g.xAxis.title),Xt=Ct?ht:bt,St=Ct?Nt:Dt,Zt,G;if(g.yAxis&&g.yAxis.min!=null&&!isNaN(g.yAxis.min))Zt=g.yAxis.min,G=g.yAxis.max;else{Zt=1/0,G=-1/0;for(var gt=0;gt<g.series.length;gt++)for(var oe=g.series[gt].values,ae=0;ae<oe.length;ae++)oe[ae]<Zt&&(Zt=oe[ae]),oe[ae]>G&&(G=oe[ae]);isFinite(Zt)||(Zt=0,G=100);var fe=(G-Zt)*.1;Zt-=fe,G+=fe}var ne=Nr(Zt,G,15);ne.length>=2&&(Zt=ne[0],G=ne[ne.length-1]);for(var ye=0,gt=0;gt<ne.length;gt++){var Mt=String(ne[gt]);Mt.length>ye&&(ye=Mt.length)}var $t=35+ye*9;g.yAxis&&g.yAxis.title&&($t+=10);var Jt=B,e=Jt-$t,x=st;if(g.xAxis&&g.xAxis.type==="categorical"&&g.xAxis.categories&&g.xAxis.categories.length>0){var C=g.xAxis.categories.length,S=e/Math.max(1,C),Y=Math.floor(.7*S/2);Y>x&&(x=Y)}var D=[],At=[],U=0;if(g.xAxis.type==="categorical")if(U=g.xAxis.categories.length,U>1)for(var q=(e-2*x)/(U-1),gt=0;gt<U;gt++)D.push($t+x+gt*q),At.push(g.xAxis.categories[gt]);else U===1&&(D.push($t+e/2),At.push(g.xAxis.categories[0]));else{for(var rt=0,gt=0;gt<g.series.length;gt++)g.series[gt].values.length>rt&&(rt=g.series[gt].values.length);if(U=rt,U>1)for(var q=(e-2*Lt)/(U-1),ct=g.xAxis.min!=null?g.xAxis.min:0,nt=g.xAxis.max!=null?g.xAxis.max:U-1,gt=0;gt<U;gt++){D.push($t+Lt+gt*q);var zt=ct+(nt-ct)*gt/(U-1);At.push(sa(zt))}else U===1&&(D.push($t+e/2),At.push(sa(g.xAxis.min||0)))}function Ot(jt){return ut+(G-jt)/(G-Zt)*(Xt-ut)}for(var Ft=[],gt=0;gt<ne.length;gt++)Ft.push({value:ne[gt],y:Ot(ne[gt])});var Pt=U>1?D[1]-D[0]:e-2*st,Wt;if(U>=1){var Kt=(e-2*st)/Math.max(1,U),Bt=Math.floor(.7*Kt/2),ce=(e-2*Bt)/Math.max(1,U);Wt=Math.min(Bt*2,ce)*.95}else Wt=Pt*ft;for(var kt=[],gt=0;gt<g.series.length;gt++){for(var Mt=g.series[gt],wt=[],ae=0;ae<Mt.values.length&&ae<U;ae++)wt.push({x:D[ae],y:Ot(Mt.values[ae]),value:Mt.values[ae]});kt.push({type:Mt.type,points:wt,colorIdx:gt})}return{type:"xychart",canvasW:B,canvasH:K,title:g.title,titleY:H,plotLeft:$t,plotRight:Jt,plotTop:yt,plotBot:St,tickTop:ut,tickBot:Xt,xCenters:D,xLabels:At,xAxisTitle:Ct?g.xAxis.title:"",yAxis:g.yAxis,yTicks:Ft,yMin:Zt,yMax:G,series:kt,barWidth:Wt,nX:U,showDataLabel:g.showDataLabel||!1,showDataLabelOutsideBar:g.showDataLabelOutsideBar||!1,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function sa(g){return Math.abs(g-Math.round(g))<1e-6?String(Math.round(g)):String(Math.round(g*100)/100)}function yr(g,tt){for(var B=700,K=350,H=300,yt=g.ticks!=null&&g.ticks>0?g.ticks:5,ut=tt&&tt.radar||{},ht=tt&&tt.themeVariables||{},bt=ht.radar||{},Nt=typeof ut.axisScaleFactor=="number"?ut.axisScaleFactor:1,Dt=typeof ut.axisLabelFactor=="number"?ut.axisLabelFactor:1.05,st=typeof bt.curveOpacity=="number"?bt.curveOpacity:.5,Lt=typeof ut.curveTension=="number"?ut.curveTension:.17,ft=g.graticule||"circle",Ct=[],Xt=0;Xt<12;Xt++){var St="cScale"+Xt;ht[St]&&(Ct[Xt]=ht[St])}var Zt=g.axes.length;if(Zt<3){for(;g.axes.length<3;)g.axes.push({id:"_pad_"+g.axes.length,label:""});Zt=g.axes.length}for(var G=[],gt=0;gt<Zt;gt++)G.push(-Math.PI/2+gt*2*Math.PI/Zt);for(var oe=[],ae=H*Nt,gt=0;gt<Zt;gt++){var fe=G[gt],ne=Math.cos(fe),ye=Math.sin(fe);oe.push({id:g.axes[gt].id,label:g.axes[gt].label,angle:fe,tipX:ae*ne,tipY:ae*ye,labelX:(H*Dt+4)*ne,labelY:(H*Dt+4)*ye})}for(var Mt=0,gt=0;gt<g.curves.length;gt++){var $t=g.curves[gt].values;if(Array.isArray($t))for(var Jt=0;Jt<$t.length;Jt++)$t[Jt]>Mt&&(Mt=$t[Jt]);else if($t)for(var e in $t)$t.hasOwnProperty(e)&&$t[e]>Mt&&(Mt=$t[e])}g.max!=null&&(Mt=g.max);var x=g.min!=null?g.min:0;Mt<=x&&(Mt=x+1);for(var C=[],gt=0;gt<g.curves.length;gt++){for(var S=g.curves[gt],Y=[],Jt=0;Jt<Zt;Jt++){var D;Array.isArray(S.values)?D=Jt<S.values.length?S.values[Jt]:0:(D=S.values[oe[Jt].id],D==null&&(D=0));var At=Math.min(Math.max(D,x),Mt),U=(At-x)/(Mt-x)*H;Y.push({x:U*Math.cos(G[Jt]),y:U*Math.sin(G[Jt])})}C.push({id:S.id,label:S.label,points:Y,colorIdx:gt})}for(var q=[],gt=1;gt<=yt;gt++)q.push(H*gt/yt);return{type:"radar",canvasW:B,canvasH:B,centerX:K,centerY:K,outerR:H,title:g.title,axes:oe,curves:C,ringRadii:q,graticule:ft,curveOpacity:st,curveTension:Lt,cScaleColors:Ct,n:Zt,angles:G,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}var kr=[.301,.367,.325,.524,.524,.6,.706,.16,.367,.367,.367,.524,.367,.367,.367,.524,.524,.524,.524,.524,.524,.524,.524,.524,.524,.524,.367,.367,.524,.524,.524,.367,.771,.59,.566,.598,.613,.536,.525,.676,.654,.278,.477,.576,.506,.709,.638,.674,.558,.676,.582,.481,.581,.648,.587,.852,.557,.57,.55,.367,.355,.367,.524,.524,.524,.525,.557,.495,.557,.545,.37,.502,.546,.285,.367,.504,.295,.83,.546,.537,.557,.557,.389,.405,.396,.546,.49,.744,.501,.493,.475,.367,.524,.367,.524];function pr(g,tt){for(var B=String(g).split(/\n|<br\s*\/?\s*>/i),K=0,H=0;H<B.length;H++){for(var yt=0,ut=0;ut<B[H].length;ut++){var ht=B[H].charCodeAt(ut);if(ht<32||ht>126)return null;yt+=kr[ht-32]}K=Math.max(K,yt*tt)}return K}function rr(g,tt){var B=8,K=20,H=30,yt=24,ut=16,ht=tt&&tt.fontSize||16,bt=tt&&tt.fontFamily||'"trebuchet ms",verdana,arial,sans-serif',Nt=g.root;function Dt(Mt){if(Mt.type==="space")Mt.size={width:0,height:0,x:0,y:0};else if(!Mt.children||Mt.children.length===0)if(Mt.label){var $t=Mt.shape==="circle"||Mt.shape==="doublecircle",Jt=Mt.shape==="diamond"||Mt.shape==="rhombus"||Mt.shape==="decision",e=Mt.shape==="cylinder",x=Mt.shape==="block-arrow",C=Jt?150:$t?300:null,S=o(Mt.label,ht,bt,C),Y,D,At=String(Mt.label).split(/\n|<br\s*\/?\s*>/i).length,U=At*Math.round(ht*1.5),q=pr(Mt.label,ht),rt=q!=null?Math.ceil(q):Math.ceil(S.width*1.04);if($t){var ct=Mt.shape==="doublecircle",nt=Math.max(rt,Math.ceil(S.height))+(ct?24:10);Y=Math.max(K,nt),D=Math.max(H,nt)}else if(Jt){var zt=Math.ceil(Math.max(S.width,S.height)*1.6);Y=Math.max(K,zt),D=Math.max(H,zt)}else if(x)D=U+2*B,Y=rt+D+B,Y=Math.max(K,Y),D=Math.max(H,D);else if(e){Y=Math.max(K,rt+B);var Ot=Y/2/(2.5+Y/50);D=Math.ceil(U+B+3*Ot)}else if(Mt.shape==="rect"||Mt.shape==="rounded"){var Ft=Mt.shape==="rounded"?2*B:4*B;Y=Math.max(K,rt+Ft),D=Math.max(H,U+2*B)}else if(Mt.shape==="lean_right"||Mt.shape==="lean_left"||Mt.shape==="trapezoid"||Mt.shape==="inv_trapezoid"){var Pt=Mt.shape==="inv_trapezoid";D=U+(Pt?2:1)*B,Y=Math.max(K,rt+(Pt?2:1)*B+D)}else Mt.shape==="subroutine"?(Y=Math.max(K,rt+2*B+B),D=Math.max(H,U+B)):Mt.shape==="stadium"?(D=Math.max(H,U+B),Y=Math.max(K,rt+Math.ceil(D/4)+B)):Mt.shape==="hexagon"?(D=Math.max(H,U+B),Y=Math.max(K,rt+Math.ceil(D/2)+B)):Mt.shape==="odd"?(D=Math.max(H,U+B),Y=Math.max(K,rt+Math.ceil(D/4)+B)):(Y=Math.max(K,rt+yt),D=Math.max(H,Math.ceil(S.height)+ut));Mt.size={width:Y,height:D,x:0,y:0},Mt._naturalWidth=Y,Mt._naturalHeight=D}else Mt.size={width:K,height:H,x:0,y:0};if(Mt.children)for(var Wt=0;Wt<Mt.children.length;Wt++)Dt(Mt.children[Wt])}function st(Mt){for(var $t=0,Jt=0,e=0;e<Mt.children.length;e++){var x=Mt.children[e];if(x.type!=="space"){var C=x.size||{width:0,height:0},S=C.width/(x.widthInColumns||1);S>$t&&($t=S),C.height>Jt&&(Jt=C.height)}}return{width:$t,height:Jt}}function Lt(Mt,$t,Jt){if($t=$t||0,Jt=Jt||0,(!Mt.size||!Mt.size.width)&&(Mt.size={width:$t,height:Jt,x:0,y:0}),!(!Mt.children||Mt.children.length===0)){for(var e=0;e<Mt.children.length;e++)Lt(Mt.children[e],0,0);for(var x=st(Mt),C=x.width,S=x.height,e=0;e<Mt.children.length;e++){var Y=Mt.children[e];if(Y.size){if(Y.type==="space"){Y.size.width=C*(Y.widthInColumns||1)+B*((Y.widthInColumns||1)-1),Y.size.height=S,Y.size.x=0,Y.size.y=0;continue}(Y.shape==="block-arrow"||Y.shape==="circle"||Y.shape==="doublecircle")&&(Y._naturalWidth==null&&(Y._naturalWidth=Y.size.width),Y._naturalHeight==null&&(Y._naturalHeight=Y.size.height)),Y.size.width=C*(Y.widthInColumns||1)+B*((Y.widthInColumns||1)-1),Y.size.height=S,Y.size.x=0,Y.size.y=0}}for(var e=0;e<Mt.children.length;e++)Lt(Mt.children[e],C,S);for(var D=Mt.columns!=null?Mt.columns:-1,At=0,e=0;e<Mt.children.length;e++)At+=Mt.children[e].widthInColumns||1;var U=At;D>0&&D<At&&(U=D);var q=Math.ceil(At/U),rt=U*(C+B)+B,ct=q*(S+B)+B;if(rt<$t){rt=$t,ct=Jt;for(var nt=($t-U*B-B)/U,zt=(Jt-q*B-B)/q,e=0;e<Mt.children.length;e++){var Y=Mt.children[e];Y.size&&(Y.size.width=nt,Y.size.height=zt,Y.size.x=0,Y.size.y=0)}}if(rt<(Mt.size.width||0)){rt=Mt.size.width;var Ot=D>0?Math.min(Mt.children.length,D):Mt.children.length;if(Ot>0)for(var Ft=(rt-Ot*B-B)/Ot,e=0;e<Mt.children.length;e++){var Y=Mt.children[e];Y.size&&(Y.size.width=Ft)}}Mt.size={width:rt,height:ct,x:0,y:0}}}function ft(Mt,$t){return Mt<0?{px:$t,py:0}:Mt===1?{px:0,py:$t}:{px:$t%Mt,py:Math.floor($t/Mt)}}function Ct(Mt){var $t=Mt.columns!=null?Mt.columns:-1;if(!(!Mt.children||Mt.children.length===0)){for(var Jt={},e={},x=0,C=0;C<Mt.children.length;C++){var S=Mt.children[C];if(S.size){var Y=ft($t,x),D=Jt[Y.py]||0;S.size.height>D&&(Jt[Y.py]=S.size.height),e[Y.py]=(e[Y.py]||0)+1;var At=S.widthInColumns||1;$t>0&&(At=Math.min(At,$t-x%$t)),x+=At}}for(var U={},q=0,rt=Object.keys(Jt).map(Number).sort(function(wt,jt){return wt-jt}),ct=0;ct<rt.length;ct++)U[rt[ct]]=q,q+=Jt[rt[ct]]+B;x=0;for(var nt=Mt.size&&Mt.size.x!=null?Mt.size.x-(Mt.size.width/2||0):-B,zt=0,Ot=0,Ft=0;Ft<Mt.children.length;Ft++)Ot+=Mt.children[Ft].widthInColumns||1;for(var Pt=$t>0?$t:Math.max(Ot,1),Wt=Pt>0?(Mt.size.width-(Pt+1)*B)/Pt:0,C=0;C<Mt.children.length;C++){var S=Mt.children[C];if(S.size){var Y=ft($t,x);Y.py!==zt&&(zt=Y.py,nt=Mt.size&&Mt.size.x!=null?Mt.size.x-(Mt.size.width/2||0):-B);var Kt=Math.max(S.size.width,Wt),Bt=Kt/2;S.size.x=nt+B+Bt,nt=S.size.x+Bt;var ce=U[Y.py]||0,kt=Jt[Y.py]||S.size.height;S.size.y=Mt.size.y-Mt.size.height/2+ce+kt/2+B,S.children&&Ct(S);var At=S.widthInColumns||1;$t>0&&(At=Math.min(At,$t-x%$t)),x+=At}}}}function Xt(Mt,$t){if($t=$t||{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},Mt.size&&Mt.id!=="root"){var Jt=Mt.size;Jt.x-Jt.width/2<$t.minX&&($t.minX=Jt.x-Jt.width/2),Jt.y-Jt.height/2<$t.minY&&($t.minY=Jt.y-Jt.height/2),Jt.x+Jt.width/2>$t.maxX&&($t.maxX=Jt.x+Jt.width/2),Jt.y+Jt.height/2>$t.maxY&&($t.maxY=Jt.y+Jt.height/2)}if(Mt.children)for(var e=0;e<Mt.children.length;e++)Xt(Mt.children[e],$t);return $t}Dt(Nt),Lt(Nt,0,0),Ct(Nt);var St=Xt(Nt);St.minX===1/0&&(St.minX=0,St.minY=0,St.maxX=0,St.maxY=0);var Zt=-St.minX,G=-St.minY,gt=[],oe=g.styles||{};function ae(Mt){if(Mt.id!=="root"&&Mt.size&&Mt.type!=="space"){var $t=Mt.size,Jt=$t.x+Zt-$t.width/2,e=$t.y+G-$t.height/2,x=!!(Mt.children&&Mt.children.length>0),C=$t.width,S=$t.height,Y=Jt,D=e,At=Mt.shape==="lean_right"||Mt.shape==="lean_left";!x&&At&&(C=$t.width+B,Y=Jt-B/2);var U=Mt.shape==="circle"||Mt.shape==="doublecircle"||Mt.shape==="block-arrow";!x&&U&&(Mt._naturalWidth&&Mt._naturalWidth<$t.width&&(C=Mt._naturalWidth,Y=Jt+($t.width-C)/2),Mt._naturalHeight&&Mt._naturalHeight<$t.height&&(S=Mt._naturalHeight,D=e+($t.height-S)/2)),gt.push({id:Mt.id,x:Y,y:D,width:C,height:S,drawio:{shape:x?"rect":Mt.shape,labelText:Mt.label||"",cssStyles:oe[Mt.id]||null,isSubgraph:x,type:x?"group":null,directions:Mt.directions||null}})}if(Mt.children)for(var q=0;q<Mt.children.length;q++)ae(Mt.children[q])}ae(Nt);for(var fe=[],ne=0;ne<g.edges.length;ne++){var ye=g.edges[ne];fe.push({id:"e"+ne,sources:[ye.source],targets:[ye.target],drawio:{arrowTypeStart:"none",arrowTypeEnd:ye.arrowEnd||"block",pattern:ye.pattern||"solid",text:ye.text||null,length:1}})}return{id:"root",children:gt,edges:fe,drawio:{direction:"LR",orthEdges:!1,diagramType:"block"}}}function Pr(g,tt){var B=50,K=10,H=50,yt=20,ut=216,ht=60,bt=0,Nt=typeof screen!="undefined"&&screen&&screen.availWidth>0?screen.availWidth:800,Dt=14,st='"Open Sans", sans-serif',Lt=14,ft=10.5,Ct=11.48,Xt=3,St=1.1395,Zt=1.0671;function G(kt,wt,jt){var Ht=String(kt).split(/\s+/).filter(function(we){return we.length>0});if(Ht.length===0)return[];for(var qt=[],ee=Ht[0],Ut=1;Ut<Ht.length;Ut++){var ve=ee+" "+Ht[Ut];o(ve,wt,st).width<=jt?ee=ve:(qt.push(ee),ee=Ht[Ut])}return qt.push(ee),qt}function gt(kt,wt){return kt>0?wt*(St+(kt-1)*Zt):0}var oe=typeof mxUtils!="undefined"&&mxUtils&&mxUtils.getSizeForString;function ae(kt,wt,jt){for(var Ht=0,qt=0;qt<kt.length;qt++){var ee;jt&&oe?ee=o("<b>"+kt[qt]+"</b>",wt,st).width:(ee=o(kt[qt],wt,st).width,jt&&(ee*=1.06)),Ht=Math.max(Ht,ee)}return Ht}var fe={person:"Person",system:"Software System",container:"Container",component:"Component"};function ne(kt){var wt=kt.category==="node"?null:fe[kt.category]||kt.category;return wt==null?kt.technology?"["+kt.technology+"]":null:kt.technology?"["+wt+": "+kt.technology+"]":"["+wt+"]"}function ye(kt){var wt;kt.isDb?wt=ut-yt-2*yt:kt.isQueue?wt=ut-yt/2-2*yt:wt=ut-2*yt;var jt=G(kt.label||"",Lt,wt),Ht=ne(kt),qt=Ht?G(Ht,ft,wt):[],ee=kt.description?G(kt.description,Ct,wt):[],Ut=0,ve=0;jt.length>0&&(ve+=gt(jt.length,Lt),Ut++),qt.length>0&&(ve+=gt(qt.length,ft),Ut++),ee.length>0&&(ve+=gt(ee.length,Ct),Ut++),Ut>1&&(ve+=Xt*(Ut-1));var we=Math.max(ae(jt,Lt,!0),ae(qt,ft,!1),ae(ee,Ct,!1)),Se=yt*2;if(kt.category==="person"){var be=Math.max(we+Se,ut,100),Me=Math.min(Math.max(be*.23,16),56),Fe=ve+Se;kt.width=be,kt.height=Fe+2*Me-Me*.27,kt.personHeadR=Me,kt.personBodyH=Fe,kt.personBodyRadius=Math.min(be*.177,Fe*.45)}else if(kt.isDb){var Ue=Math.max(ut-yt,we)+yt,De=Ue/2/(2.5+Ue/50);kt.width=Ue,kt.height=ve+yt+3*De,kt.cylinderRy=De}else if(kt.isQueue){var Ye=ve+yt/2,Pe=Ye/2,de=Pe/(2.5+Ye/50);kt.width=Math.max(ut-yt/2,we)+de+yt/2,kt.height=Ye,kt.queueRx=de}else kt.width=Math.max(we+Se,ut),kt.height=ve+Se;kt.width=Math.ceil(kt.width),kt.c4Lines={name:jt,type:qt,descr:ee}}function Mt(kt){for(var wt=0;wt<kt.length;wt++){var jt=kt[wt];jt.children&&jt.children.length>0?Mt(jt.children):ye(jt)}}Mt(g.elements);var $t=Math.max(1,g.c4ShapeInRow||4),Jt=Math.max(1,g.c4BoundaryInRow||2),e=B,x=K;function C(){return{name:"",data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},nextData:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0}}}function S(kt,wt,jt,Ht,qt){kt.nextData.startx=kt.data.startx=wt,kt.nextData.stopx=kt.data.stopx=jt,kt.nextData.starty=kt.data.starty=Ht,kt.nextData.stopy=kt.data.stopy=qt}function Y(kt,wt,jt,Ht){kt[wt]===void 0?kt[wt]=jt:kt[wt]=Ht(jt,kt[wt])}function D(kt,wt){kt.nextData.cnt+=1;var jt=kt.nextData.startx===kt.nextData.stopx?kt.nextData.stopx+wt.margin:kt.nextData.stopx+wt.margin*2,Ht=jt+wt.width,qt=kt.nextData.starty+wt.margin*2,ee=qt+wt.height;(jt>=kt.data.widthLimit||Ht>=kt.data.widthLimit||kt.nextData.cnt>$t)&&(jt=kt.nextData.startx+wt.margin+bt,qt=kt.nextData.stopy+wt.margin*2,kt.nextData.stopx=Ht=jt+wt.width,kt.nextData.starty=kt.nextData.stopy,kt.nextData.stopy=ee=qt+wt.height,kt.nextData.cnt=1),wt.x=jt,wt.y=qt,Y(kt.data,"startx",jt,Math.min),Y(kt.data,"starty",qt,Math.min),Y(kt.data,"stopx",Ht,Math.max),Y(kt.data,"stopy",ee,Math.max),Y(kt.nextData,"startx",jt,Math.min),Y(kt.nextData,"starty",qt,Math.min),Y(kt.nextData,"stopx",Ht,Math.max),Y(kt.nextData,"stopy",ee,Math.max)}function At(kt,wt){kt.data.stopx+=wt,kt.data.stopy+=wt}function U(kt,wt){for(var jt=0;jt<wt.length;jt++){var Ht=wt[jt];Ht.width=Math.max(Ht.width||ut,ut),Ht.height=Math.max(Ht.height||ht,ht),Ht.margin=Ht.margin||H,D(kt,Ht)}At(kt,H)}function q(kt){var wt=o(kt.label||"",Dt+2,st).height,jt=8+wt,Ht=kt.boundaryType||kt.technology;if(Ht){var qt=o("["+Ht+"]",Dt,st).height;jt+=5+qt}if(kt.description){var ee=o(kt.description,Dt-2,st).height;jt+=20+ee}return jt}function rt(kt,wt){if(!(!wt||wt.length===0)){var jt=Math.min(Jt,wt.length),Ht=C();Ht.data.widthLimit=kt.data.widthLimit/jt;for(var qt=0;qt<wt.length;qt++){var ee=wt[qt];if(qt===0||qt%Jt===0){var Ut=q(ee),ve=kt.data.startx+B,we=kt.data.stopy+K+Ut;S(Ht,ve,ve,we,we)}else{var Se=Ht.data.stopx!==Ht.data.startx?Ht.data.stopx+B:Ht.data.startx,be=Ht.data.starty;S(Ht,Se,Se,be,be)}Ht.name=ee.id;var Me=[],Fe=[];if(ee.children)for(var Ue=0;Ue<ee.children.length;Ue++){var De=ee.children[Ue];De.children&&De.children.length>0?Fe.push(De):Me.push(De)}Me.length>0&&U(Ht,Me),Fe.length>0&&rt(Ht,Fe),ee.x=Ht.data.startx,ee.y=Ht.data.starty,ee.width=Ht.data.stopx-Ht.data.startx,ee.height=Ht.data.stopy-Ht.data.starty,kt.data.stopy=Math.max(Ht.data.stopy+H,kt.data.stopy),kt.data.stopx=Math.max(Ht.data.stopx+H,kt.data.stopx),e=Math.max(e,kt.data.stopx),x=Math.max(x,kt.data.stopy)}}}var ct=C();S(ct,B,B,K,K),ct.data.widthLimit=Nt;for(var nt=[],zt=[],Ot=0;Ot<g.elements.length;Ot++){var Ft=g.elements[Ot];Ft.children&&Ft.children.length>0?zt.push(Ft):nt.push(Ft)}if(nt.length>0){U(ct,nt);for(var Pt=0;Pt<nt.length;Pt++)nt[Pt].x+=B;ct.data.stopx+=B,e=Math.max(e,ct.data.stopx+H),x=Math.max(x,ct.data.stopy+H)}if(zt.length>0){var Wt=C();S(Wt,ct.data.startx+B,Math.max(ct.data.stopx,ct.data.startx+B),ct.data.starty,ct.data.stopy),Wt.data.widthLimit=ct.data.widthLimit,rt(Wt,zt),ct.data.stopx=Math.max(ct.data.stopx,Wt.data.stopx),ct.data.stopy=Math.max(ct.data.stopy,Wt.data.stopy),e=Math.max(e,Wt.data.stopx+H),x=Math.max(x,Wt.data.stopy+H)}function Kt(kt,wt,jt){for(var Ht=0;Ht<kt.length;Ht++){var qt=kt[Ht],ee=qt.x,Ut=qt.y;qt.x=ee-wt,qt.y=Ut-jt,qt.children&&qt.children.length>0&&Kt(qt.children,ee,Ut)}}Kt(g.elements,0,0);var Bt=e+B,ce=x+K;return{type:"c4",title:g.title,canvasW:Bt,canvasH:ce,elements:g.elements,relations:g.relations,fontFamily:st}}function ta(g,tt){var B=80,K=20,H=200.8,yt=200.8,ut=42.5,ht=39.5,bt=40,Nt=42.5,Dt=40,st="Trebuchet MS,Verdana,Arial,sans-serif";function Lt(Me){return Math.max(Nt,bt+Me)}function ft(Me){if(!Me.label)return 0;var Fe=o(Me.label,16,st).width+6;return Math.max(0,(Fe-B)/2)}for(var Ct={},Xt=[],St=0;St<g.services.length;St++){var Zt=g.services[St],G={id:Zt.id,kind:"service",icon:Zt.icon,label:Zt.label,parent:Zt.parent,gridRow:null,gridCol:null};Ct[Zt.id]=G,Xt.push(G)}for(var St=0;St<g.junctions.length;St++){var gt=g.junctions[St],G={id:gt.id,kind:"junction",icon:null,label:"",parent:gt.parent,gridRow:null,gridCol:null};Ct[gt.id]=G,Xt.push(G)}Xt.length>0&&(Xt[0].gridRow=0,Xt[0].gridCol=0);for(var oe=!0,ae=0;oe&&ae<20;){oe=!1,ae++;for(var St=0;St<g.edges.length;St++){var fe=g.edges[St],ne=Ct[fe.source],ye=Ct[fe.target];if(!(!ne||!ye)&&!(ne.gridRow==null&&ye.gridRow==null)){var Mt=ne.gridRow!=null,$t=ye.gridRow!=null;if(Mt&&!$t){var Jt=wr(ne,fe.sourcePort,fe.targetPort);ye.gridRow=Jt.row,ye.gridCol=Jt.col,oe=!0}else if(!Mt&&$t){var Jt=wr(ye,fe.targetPort,fe.sourcePort);ne.gridRow=Jt.row,ne.gridCol=Jt.col,oe=!0}}}}for(var e=0,St=0;St<Xt.length;St++)Xt[St].gridCol!=null&&Xt[St].gridCol>e&&(e=Xt[St].gridCol);for(var St=0;St<Xt.length;St++)Xt[St].gridRow==null&&(e++,Xt[St].gridRow=0,Xt[St].gridCol=e);for(var x=1/0,C=1/0,St=0;St<Xt.length;St++)Xt[St].gridRow<x&&(x=Xt[St].gridRow),Xt[St].gridCol<C&&(C=Xt[St].gridCol);for(var St=0;St<Xt.length;St++)Xt[St].gridRow-=x,Xt[St].gridCol-=C;for(var S=[],Y={},St=0;St<g.groups.length;St++)S.push(g.groups[St].id),Y[g.groups[St].id]=g.groups[St];for(var D=0,At=S.slice(),U={},q=0,rt=Xt.filter(function(Me){return!Me.parent}),ct=-1,St=0;St<rt.length;St++)rt[St].gridCol>ct&&(ct=rt[St].gridCol);rt.length>0&&(q=ct+2);for(var St=0;St<At.length;St++){var nt=At[St];U[nt]=q;for(var zt=Xt.filter(function(Fe){return Fe.parent===nt}),Ot=-1,Ft=1/0,gt=0;gt<zt.length;gt++)zt[gt].gridCol>Ot&&(Ot=zt[gt].gridCol),zt[gt].gridCol<Ft&&(Ft=zt[gt].gridCol);if(zt.length>0){for(var gt=0;gt<zt.length;gt++)zt[gt].gridCol=zt[gt].gridCol-Ft+q;q+=Ot-Ft+1.35}}for(var St=0;St<Xt.length;St++){var G=Xt[St];G.parent?(G.x=Dt+Nt+G.gridCol*H,G.y=Dt+ut+G.gridRow*yt):(G.x=Dt+G.gridCol*H,G.y=Dt+G.gridRow*yt),G.width=B,G.height=B}for(var Pt=[],St=0;St<g.groups.length;St++){var Wt=g.groups[St],Kt=Xt.filter(function(Fe){return Fe.parent===Wt.id});if(Kt.length!==0){for(var Bt=1/0,ce=1/0,kt=-1/0,wt=-1/0,gt=0;gt<Kt.length;gt++){var G=Kt[gt];G.x<Bt&&(Bt=G.x),G.y<ce&&(ce=G.y),G.x+G.width>kt&&(kt=G.x+G.width),G.y+G.height+K>wt&&(wt=G.y+G.height+K)}for(var jt=0,Ht=0,gt=0;gt<Kt.length;gt++){var G=Kt[gt];G.x===Bt&&(jt=Math.max(jt,ft(G))),G.x+G.width===kt&&(Ht=Math.max(Ht,ft(G)))}var qt=Lt(jt),ee=Lt(Ht);Pt.push({id:Wt.id,icon:Wt.icon,label:Wt.label,x:Bt-qt,y:ce-ut,width:kt-Bt+qt+ee,height:wt-ce+ut+ht})}}for(var Ut=0,ve=0,St=0;St<Xt.length;St++){var we=Xt[St].x+Xt[St].width,Se=Xt[St].y+Xt[St].height+K;we>Ut&&(Ut=we),Se>ve&&(ve=Se)}for(var St=0;St<Pt.length;St++){var be=Pt[St];be.x+be.width>Ut&&(Ut=be.x+be.width),be.y+be.height>ve&&(ve=be.y+be.height)}return Ut+=Dt,ve+=Dt,{type:"architecture",canvasW:Ut,canvasH:ve,nodes:Xt,nodeMap:Ct,groups:Pt,archEdges:g.edges,iconSize:B,labelHeight:K,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function wr(g,tt,B){var K=g.gridRow,H=g.gridCol;return tt==="R"?H++:tt==="L"?H--:tt==="B"?K++:tt==="T"&&K--,{row:K,col:H}}function Sa(g){return g==="R"?"L":g==="L"?"R":g==="T"?"B":g==="B"?"T":g}function ca(g,tt){for(var B=tt&&tt.sankey||{},K=typeof B.width=="number"?B.width:600,H=typeof B.height=="number"?B.height:400,yt=typeof B.nodeWidth=="number"?B.nodeWidth:10,ut=B.showValues!==!1,ht=(typeof B.nodePadding=="number"?B.nodePadding:12)+(ut?15:0),bt=["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Nt={},Dt=[],st=0;st<g.links.length;st++){var Lt=g.links[st];Nt[Lt.source]||(Nt[Lt.source]={id:Lt.source,inLinks:[],outLinks:[],layer:0,totalFlow:0},Dt.push(Nt[Lt.source])),Nt[Lt.target]||(Nt[Lt.target]={id:Lt.target,inLinks:[],outLinks:[],layer:0,totalFlow:0},Dt.push(Nt[Lt.target]));var ft={source:Lt.source,target:Lt.target,value:Lt.value};Nt[Lt.source].outLinks.push(ft),Nt[Lt.target].inLinks.push(ft)}var Ct={};for(var Xt in Nt)Nt.hasOwnProperty(Xt)&&(Ct[Xt]=Nt[Xt].inLinks.length);for(var St=[],st=0;st<Dt.length;st++)Ct[Dt[st].id]===0&&St.push(Dt[st]);for(var Zt=[];St.length>0;){var G=St.shift();Zt.push(G);for(var gt=0;gt<G.outLinks.length;gt++){var oe=Nt[G.outLinks[gt].target];Ct[oe.id]--,Ct[oe.id]===0&&St.push(oe)}}for(var st=0;st<Dt.length;st++)Zt.indexOf(Dt[st])<0&&Zt.push(Dt[st]);for(var st=0;st<Zt.length;st++){for(var G=Zt[st],fe=0,gt=0;gt<G.inLinks.length;gt++){var ae=Nt[G.inLinks[gt].source];ae.layer+1>fe&&(fe=ae.layer+1)}G.layer=fe}for(var fe=0,st=0;st<Zt.length;st++)Zt[st].layer>fe&&(fe=Zt[st].layer);for(var st=0;st<Zt.length;st++)Zt[st].outLinks.length===0&&(Zt[st].layer=fe);for(var ne=fe+1,ye=0,st=0;st<Zt.length;st++){for(var G=Zt[st],Mt=0,$t=0,gt=0;gt<G.inLinks.length;gt++)Mt+=G.inLinks[gt].value;for(var gt=0;gt<G.outLinks.length;gt++)$t+=G.outLinks[gt].value;G.totalFlow=Math.max(Mt,$t),G.totalFlow>ye&&(ye=G.totalFlow)}for(var Jt=[],e=[],Lt=0;Lt<ne;Lt++)Jt.push(0),e.push(0);for(var st=0;st<Zt.length;st++)Jt[Zt[st].layer]+=Zt[st].totalFlow,e[Zt[st].layer]++;for(var x=[],Lt=0;Lt<ne;Lt++)x.push([]);for(var st=0;st<Dt.length;st++)x[Dt[st].layer].push(Dt[st]);for(var C=ne<=1?0:(K-yt)/(ne-1),st=0;st<Zt.length;st++){var G=Zt[st];G.x=ne<=1?(K-yt)/2:G.layer*C,G.width=yt,G.sourceLinks=G.outLinks,G.targetLinks=G.inLinks}for(var S=0,st=0;st<Zt.length;st++)for(var gt=0;gt<Zt[st].outLinks.length;gt++){var Y=Zt[st].outLinks[gt];Y.index=S++,Y.sourceNode=Nt[Y.source],Y.targetNode=Nt[Y.target]}for(var D=0,Lt=0;Lt<x.length;Lt++)x[Lt].length>D&&(D=x[Lt].length);for(var At=Math.min(ht,D>1?H/(D-1):ht),U=1/0,Lt=0;Lt<x.length;Lt++){for(var q=0,st=0;st<x[Lt].length;st++)q+=x[Lt][st].totalFlow;if(q>0){var rt=H-(x[Lt].length-1)*At;rt<1&&(rt=1);var ct=rt/q;ct<U&&(U=ct)}}(!isFinite(U)||U<=0)&&(U=1);for(var st=0;st<Zt.length;st++)for(var gt=0;gt<Zt[st].outLinks.length;gt++)Zt[st].outLinks[gt].width=Zt[st].outLinks[gt].value*U;for(var Lt=0;Lt<x.length;Lt++){for(var nt=x[Lt],zt=0,st=0;st<nt.length;st++)nt[st].y0=zt,nt[st].y1=zt+nt[st].totalFlow*U,zt=nt[st].y1+At;for(var Ot=(H-zt+At)/(nt.length+1),st=0;st<nt.length;st++)nt[st].y0+=Ot*(st+1),nt[st].y1+=Ot*(st+1);Kt(nt)}function Ft(Ie,Ce){return Ie.y0-Ce.y0}function Pt(Ie,Ce){return Ft(Ie.sourceNode,Ce.sourceNode)||Ie.index-Ce.index}function Wt(Ie,Ce){return Ft(Ie.targetNode,Ce.targetNode)||Ie.index-Ce.index}function Kt(Ie){for(var Ce=0;Ce<Ie.length;Ce++)Ie[Ce].sourceLinks.sort(Wt),Ie[Ce].targetLinks.sort(Pt)}function Bt(Ie){for(var Ce=0;Ce<Ie.targetLinks.length;Ce++)Ie.targetLinks[Ce].sourceNode.sourceLinks.sort(Wt);for(var Ce=0;Ce<Ie.sourceLinks.length;Ce++)Ie.sourceLinks[Ce].targetNode.targetLinks.sort(Pt)}function ce(Ie,Ce){for(var Ke=Ie.y0-(Ie.sourceLinks.length-1)*At/2,We=0;We<Ie.sourceLinks.length;We++){var le=Ie.sourceLinks[We];if(le.targetNode===Ce)break;Ke+=le.width+At}for(var We=0;We<Ce.targetLinks.length;We++){var Ae=Ce.targetLinks[We];if(Ae.sourceNode===Ie)break;Ke-=Ae.width}return Ke}function kt(Ie,Ce){for(var Ke=Ce.y0-(Ce.targetLinks.length-1)*At/2,We=0;We<Ce.targetLinks.length;We++){var le=Ce.targetLinks[We];if(le.sourceNode===Ie)break;Ke+=le.width+At}for(var We=0;We<Ie.sourceLinks.length;We++){var Ae=Ie.sourceLinks[We];if(Ae.targetNode===Ce)break;Ke-=Ae.width}return Ke}function wt(Ie,Ce,Ke,We){for(var le=Ke;le<Ie.length;le++){var Ae=(Ce-Ie[le].y0)*We;Ae>1e-6&&(Ie[le].y0+=Ae,Ie[le].y1+=Ae),Ce=Ie[le].y1+At}}function jt(Ie,Ce,Ke,We){for(var le=Ke;le>=0;le--){var Ae=(Ie[le].y1-Ce)*We;Ae>1e-6&&(Ie[le].y0-=Ae,Ie[le].y1-=Ae),Ce=Ie[le].y0-At}}function Ht(Ie,Ce){var Ke=Ie.length>>1,We=Ie[Ke];jt(Ie,We.y0-At,Ke-1,Ce),wt(Ie,We.y1+At,Ke+1,Ce),jt(Ie,H,Ie.length-1,Ce),wt(Ie,0,0,Ce)}for(var qt=6,ee=0;ee<qt;ee++){for(var Ut=Math.pow(.99,ee),ve=Math.max(1-Ut,(ee+1)/qt),Lt=x.length-2;Lt>=0;Lt--){for(var nt=x[Lt],st=0;st<nt.length;st++){for(var G=nt[st],we=0,Se=0,gt=0;gt<G.sourceLinks.length;gt++){var be=G.sourceLinks[gt],Me=be.value*(be.targetNode.layer-G.layer);we+=kt(G,be.targetNode)*Me,Se+=Me}if(Se>0){var Fe=(we/Se-G.y0)*Ut;G.y0+=Fe,G.y1+=Fe,Bt(G)}}nt.sort(Ft),Ht(nt,ve)}for(var Lt=1;Lt<x.length;Lt++){for(var nt=x[Lt],st=0;st<nt.length;st++){for(var G=nt[st],we=0,Se=0,gt=0;gt<G.targetLinks.length;gt++){var Ue=G.targetLinks[gt],Me=Ue.value*(G.layer-Ue.sourceNode.layer);we+=ce(Ue.sourceNode,G)*Me,Se+=Me}if(Se>0){var Fe=(we/Se-G.y0)*Ut;G.y0+=Fe,G.y1+=Fe,Bt(G)}}nt.sort(Ft),Ht(nt,ve)}}for(var st=0;st<Zt.length;st++){for(var G=Zt[st],De=G.y0,gt=0;gt<G.sourceLinks.length;gt++){var be=G.sourceLinks[gt];be.sourceY=De+be.width/2,De+=be.width}for(var Ye=G.y0,gt=0;gt<G.targetLinks.length;gt++){var Ue=G.targetLinks[gt];Ue.targetY=Ye+Ue.width/2,Ye+=Ue.width}}for(var st=0;st<Zt.length;st++){var G=Zt[st];G.y=G.y0,G.height=Math.max(G.y1-G.y0,1)}for(var Pe=U,de=[],st=0;st<Dt.length;st++)for(var ae=Dt[st],gt=0;gt<ae.outLinks.length;gt++){var ft=ae.outLinks[gt],Ve=Nt[ft.target];de.push({x1:ae.x+ae.width,y1:ft.sourceY,x2:Ve.x,y2:ft.targetY,width:ft.value*Pe,sourceColorIdx:st,targetColorIdx:Dt.indexOf(Ve),value:ft.value})}for(var Ne=B.nodeColors||{},nr=0,st=0;st<Dt.length;st++){var Ge=Object.prototype.hasOwnProperty.call(Ne,Dt[st].id)?Ne[Dt[st].id]:null;typeof Ge=="string"&&Ge!==""?Dt[st].color=Ge:(Dt[st].color=bt[nr%bt.length],nr++),Dt[st].colorIdx=st}return{type:"sankey",canvasW:K,canvasH:H,nodes:Dt,sankeyLinks:de,nodeWidth:yt,numLayers:ne,palette:bt,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function ba(g,tt){var B=tt&&tt.treemap||{},K=B.width||1e3,H=B.height||400,yt=B.diagramPadding!=null?B.diagramPadding:0,ut=10,ht=25,bt=10,Nt=(1+Math.sqrt(5))/2;(function G(gt){if(gt.children&&gt.children.length){gt.children.sort(function(ae,fe){return fe.value-ae.value});for(var oe=0;oe<gt.children.length;oe++)G(gt.children[oe])}})(g.root);var Dt=0,st=0;(function G(gt){if(gt.isLeaf)gt.leafIdx=st++;else if(gt.sectionIdx=Dt++,gt.children)for(var oe=0;oe<gt.children.length;oe++)G(gt.children[oe])})(g.root);var Lt=H-ht;g.root.x0=yt,g.root.y0=yt,g.root.x1=K+yt,g.root.y1=Lt+yt,g.root.skipHeader=!0,ft(g.root,0);function ft(G,gt){if(G.x0+=gt,G.y0+=gt,G.x1-=gt,G.y1-=gt,G.x1<G.x0&&(G.x0=G.x1=(G.x0+G.x1)/2),G.y1<G.y0&&(G.y0=G.y1=(G.y0+G.y1)/2),!(!G.children||G.children.length===0)){var oe=G.children.length>1?bt/2:0,ae=G.skipHeader?0:ht,fe=G.x0+ut-oe,ne=G.y0+ae+ut-oe,ye=G.x1-ut+oe,Mt=G.y1-ut+oe;ye<fe&&(fe=ye=(fe+ye)/2),Mt<ne&&(ne=Mt=(ne+Mt)/2),Ct(G.children,fe,ne,ye,Mt,G.value,Nt);for(var $t=0;$t<G.children.length;$t++)ft(G.children[$t],oe)}}function Ct(G,gt,oe,ae,fe,ne,ye){for(var Mt=G.length,$t=ne,Jt=0,e=0;Jt<Mt;){var x=ae-gt,C=fe-oe,S,Y,D;do S=G[e++].value;while(!S&&e<Mt);Y=D=S;for(var At=Math.max(C/x,x/C)/($t*ye),U=S*S*At,q=Math.max(D/U,U/Y);e<Mt;){var rt=G[e].value;S+=rt,rt<Y&&(Y=rt),rt>D&&(D=rt),U=S*S*At;var ct=Math.max(D/U,U/Y);if(ct>q){S-=rt;break}q=ct,e++}var nt=G.slice(Jt,e),zt=x<C;if(zt){var Ot=$t?oe+C*S/$t:fe;Xt(nt,gt,oe,ae,Ot,S),oe=Ot}else{var Ft=$t?gt+x*S/$t:ae;St(nt,gt,oe,Ft,fe,S),gt=Ft}$t-=S,Jt=e}}function Xt(G,gt,oe,ae,fe,ne){for(var ye=ae-gt,Mt=gt,$t=0;$t<G.length;$t++){var Jt=$t===G.length-1?ae:Mt+ye*G[$t].value/ne;G[$t].x0=Mt,G[$t].y0=oe,G[$t].x1=Jt,G[$t].y1=fe,Mt=Jt}}function St(G,gt,oe,ae,fe,ne){for(var ye=fe-oe,Mt=oe,$t=0;$t<G.length;$t++){var Jt=$t===G.length-1?fe:Mt+ye*G[$t].value/ne;G[$t].x0=gt,G[$t].y0=Mt,G[$t].x1=ae,G[$t].y1=Jt,Mt=Jt}}var Zt=[];return(function G(gt){if(Zt.push(gt),gt.children)for(var oe=0;oe<gt.children.length;oe++)G(gt.children[oe])})(g.root),{type:"treemap",title:g.title,canvasW:K+yt*2,canvasH:Lt+yt*2,headerH:ht,root:g.root,placed:Zt,classDefs:g.classDefs||{},fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function ra(g,tt){for(var B=784,K=75,H=75,yt=48,ut=50,ht=35,bt=13,Nt=24,Dt=20,st=B-K-H,Lt=1440*60*1e3,ft=0,Ct=0;Ct<g.tasks.length;Ct++)g.tasks[Ct].flags&&g.tasks[Ct].flags.vert||ft++;var Xt=ft<g.tasks.length,St=bt+ft*Nt+2,Zt=ht+St+ut,G=g.startDate,gt=g.endDate;(!G||!gt)&&(G=new Date,gt=new Date(G.getTime()+Lt));var oe=G.getTime(),ae=gt.getTime(),fe=ae-oe;fe<=0&&(fe=Lt,ae=oe+fe);function ne(Pe){return K+Math.round((Pe.getTime()-oe)/fe*st)}for(var ye=g.displayMode==="compact",Mt=0,$t=0;$t<g.sections.length;$t++){var Jt=g.sections[$t];Jt.firstRow=Mt;for(var e=[],x=0;x<Jt.tasks.length;x++){var C=Jt.tasks[x];if(C.flags.vert){C.rowIdx=Jt.firstRow;continue}e.push(C)}var S;if(ye){for(var Y=e.slice().sort(function(Pe,de){var Ve=Pe.startDate?Pe.startDate.getTime():0,Ne=de.startDate?de.startDate.getTime():0;return Ve-Ne}),D=[],At=0;At<Y.length;At++){for(var U=Y[At],q=U.startDate?U.startDate.getTime():0,rt=U.endDate?U.endDate.getTime():q,ct=!1,nt=0;nt<D.length;nt++)if(D[nt]<=q){U.rowIdx=Jt.firstRow+nt,D[nt]=rt,ct=!0;break}ct||(U.rowIdx=Jt.firstRow+D.length,D.push(rt))}S=D.length}else{for(var zt=0;zt<e.length;zt++)e[zt].rowIdx=Mt+zt;S=e.length}Jt.lastRow=Jt.firstRow+S-1,Mt=Jt.firstRow+S,Jt.y=yt+Jt.firstRow*Nt,Jt.h=S*Nt}if(St=bt+Mt*Nt+2,Zt=ht+St+ut,Xt){var Ot=ht+ft*Nt+60+10;Ot>Zt&&(Zt=Ot)}for(var Ft=11,Pt=0;Pt<g.tasks.length;Pt++){var C=g.tasks[Pt];C.rowY=yt+(C.rowIdx!=null?C.rowIdx:Pt)*Nt;var Wt=ne(C.startDate),Kt=C.renderEndDate||C.endDate,Bt=ne(Kt);if(C.barX=Wt,C.barY=C.rowY+2,C.barW=Math.max(Bt-Wt,0),C.flags.milestone){var ce=ne(C.endDate),kt=(Wt+ce)/2;C.barX=kt-10,C.barW=20;var wt=C.label||"",jt=wt?o(wt,Ft,'"trebuchet ms",verdana,arial,sans-serif'):{width:0};C.labelW=jt.width}else if(C.flags.vert)C.barX=Wt,C.barW=.08*Dt,C.markerX=Wt;else{var Ht=C.label||"",qt=Ht?o(Ht,Ft,'"trebuchet ms",verdana,arial,sans-serif'):{width:0},ee=ne(C.endDate),Ut=Math.max(ee-Wt,0);C.labelW=qt.width,C.labelOutsideRight=qt.width>Ut,C.labelOverflowCenter=!C.labelOutsideRight&&qt.width>C.barW,C.labelOutsideLeft=C.labelOutsideRight&&ee+5+qt.width+5>B}}var ve=[];if(g.tasks.length>0)for(var we=la(G,gt,g.axisFormat,g.tickInterval),Pt=0;Pt<we.length;Pt++)ve.push({date:we[Pt].date,label:we[Pt].label,x:ne(we[Pt].date)});var Se=[];if(g.excludeInfo&&g.tasks.length>0){for(var be=new Date(Date.UTC(G.getUTCFullYear(),G.getUTCMonth(),G.getUTCDate())),Me=new Date(Date.UTC(gt.getUTCFullYear(),gt.getUTCMonth(),gt.getUTCDate())),Fe=null,Ue=1e5,De=0;be.getTime()<=Me.getTime()&&De++<Ue;){var Ye=Dr(be,g.excludeInfo);Ye&&Fe==null&&(Fe=new Date(be)),!Ye&&Fe!=null&&(Se.push({x:ne(Fe),w:ne(be)-ne(Fe)}),Fe=null),be.setUTCDate(be.getUTCDate()+1)}Fe!=null&&Se.push({x:ne(Fe),w:ne(be)-ne(Fe)})}return{type:"gantt",title:g.title,canvasW:B,canvasH:Zt,gridLeft:K,gridRight:B-H,gridTop:ht,gridBottom:Zt-ut,gridWidth:st,rowHeight:Nt,taskHeight:Dt,topMargin:yt,nonVertTaskCount:ft,sections:g.sections,tasks:g.tasks,ticks:ve,excludes:Se,axisFormat:g.axisFormat,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function Dr(g,tt){if(!tt)return!1;if(tt.hasWeekends&&tt.weekendDays[g.getUTCDay()]||tt.weekdays[g.getUTCDay()])return!0;var B=g.getUTCFullYear()+"-"+(g.getUTCMonth()+1)+"-"+g.getUTCDate();return!!tt.dates[B]}function la(g,tt,B,K){var H=1e3,yt=60*H,ut=60*yt,ht=24*ut,bt=7*ht,Nt=30*ht,Dt=365.25*ht,st=tt.getTime()-g.getTime(),Lt=[],ft=1e4;function Ct(At){Lt.push({date:new Date(At),label:Mn(At,B)})}var Xt=qr(K);if(Xt){for(var D=ma(g,Xt);D.getTime()<=tt.getTime()&&Lt.length<ft;)D.getTime()>=g.getTime()&&Ct(D),D=Ja(D,Xt);return Lt}for(var St=10,Zt=[["second",1,H],["second",5,5*H],["second",15,15*H],["second",30,30*H],["minute",1,yt],["minute",5,5*yt],["minute",15,15*yt],["minute",30,30*yt],["hour",1,ut],["hour",3,3*ut],["hour",6,6*ut],["hour",12,12*ut],["day",1,ht],["day",2,2*ht],["week",1,bt],["month",1,Nt],["month",3,3*Nt],["year",1,Dt]],G=st/St,gt=0;gt<Zt.length&&Zt[gt][2]<G;)gt++;if(gt===Zt.length){var oe=Math.sqrt(50),ae=Math.sqrt(10),fe=Math.sqrt(2),ne=st/Dt/St,ye=Math.pow(10,Math.floor(Math.log10(ne))),Mt=ne/ye,$t=ye;Mt>=oe?$t=ye*10:Mt>=ae?$t=ye*5:Mt>=fe&&($t=ye*2),$t=Math.max(1,Math.round($t));for(var Jt=Math.ceil(g.getFullYear()/$t)*$t,D=new Date(Jt,0,1);D.getTime()<=tt.getTime()&&Lt.length<ft;)D.getTime()>=g.getTime()&&Ct(D),D=new Date(D.getFullYear()+$t,0,1);return Lt}if(gt>0){var e=Zt[gt-1][2],x=Zt[gt][2];G/e<x/G&&(gt=gt-1)}for(var C=Zt[gt][0],S=Zt[gt][1],Y={count:S,unit:C},D=ma(g,Y);D.getTime()<=tt.getTime()&&Lt.length<ft;)D.getTime()>=g.getTime()&&Ct(D),D=Ja(D,Y);return Lt}function qr(g){if(!g)return null;var tt=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(g.trim());return tt?{count:parseInt(tt[1],10),unit:tt[2]}:null}function ma(g,tt){var B=new Date(g);switch(tt.unit){case"millisecond":B.setMilliseconds(Math.ceil(B.getMilliseconds()/tt.count)*tt.count);break;case"second":B.setMilliseconds(0),B.setSeconds(Math.ceil(B.getSeconds()/tt.count)*tt.count);break;case"minute":B.setSeconds(0,0),B.setMinutes(Math.ceil(B.getMinutes()/tt.count)*tt.count);break;case"hour":B.setMinutes(0,0,0),B.setHours(Math.ceil(B.getHours()/tt.count)*tt.count);break;case"day":if(B.setHours(0,0,0,0),B.getTime()<g.getTime()&&B.setDate(B.getDate()+1),tt.count>1){var K=(B.getDate()-1)%tt.count;K>0&&B.setDate(B.getDate()+(tt.count-K))}break;case"week":for(B.setHours(0,0,0,0),B.getTime()<g.getTime()&&B.setDate(B.getDate()+1);B.getDay()!==0;)B.setDate(B.getDate()+1);break;case"month":if(B=new Date(B.getFullYear(),B.getMonth(),1),B.getTime()<g.getTime()&&(B=new Date(B.getFullYear(),B.getMonth()+1,1)),tt.count>1){var H=B.getMonth()%tt.count;H>0&&(B=new Date(B.getFullYear(),B.getMonth()+(tt.count-H),1))}break;case"quarter":var yt=Math.floor(B.getMonth()/3)*3;B=new Date(B.getFullYear(),yt,1),B.getTime()<g.getTime()&&(B=new Date(B.getFullYear(),yt+3,1));break;case"year":B=new Date(B.getFullYear(),0,1),B.getTime()<g.getTime()&&(B=new Date(B.getFullYear()+1,0,1));break;case"decade":B=new Date(Math.ceil(B.getFullYear()/10)*10,0,1);break}return B}function Ja(g,tt){var B=new Date(g);switch(tt.unit){case"millisecond":B.setMilliseconds(B.getMilliseconds()+tt.count);break;case"second":B.setSeconds(B.getSeconds()+tt.count);break;case"minute":B.setMinutes(B.getMinutes()+tt.count);break;case"hour":B.setHours(B.getHours()+tt.count);break;case"day":B.setDate(B.getDate()+tt.count);break;case"week":B.setDate(B.getDate()+7*tt.count);break;case"month":B.setMonth(B.getMonth()+tt.count);break;case"quarter":B.setMonth(B.getMonth()+3*tt.count);break;case"year":B.setFullYear(B.getFullYear()+tt.count);break;case"decade":B.setFullYear(B.getFullYear()+10*tt.count);break}return B}var sn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],fn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Na=["January","February","March","April","May","June","July","August","September","October","November","December"],Cn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Mn(g,tt){function B(K){return K<10?"0"+K:""+K}return tt.replace(/%Y/g,g.getFullYear()).replace(/%y/g,B(g.getFullYear()%100)).replace(/%m/g,B(g.getMonth()+1)).replace(/%d/g,B(g.getDate())).replace(/%e/g,(g.getDate()<10?" ":"")+g.getDate()).replace(/%A/g,sn[g.getDay()]).replace(/%a/g,fn[g.getDay()]).replace(/%B/g,Na[g.getMonth()]).replace(/%b/g,Cn[g.getMonth()]).replace(/%H/g,B(g.getHours())).replace(/%I/g,B((g.getHours()+11)%12+1)).replace(/%p/g,g.getHours()>=12?"PM":"AM").replace(/%M/g,B(g.getMinutes())).replace(/%S/g,B(g.getSeconds())).replace(/%L/g,B(g.getMilliseconds())).replace(/%s/g,Math.floor(g.getTime()/1e3))}function nn(g,tt){var B=800,K=450,H=g.sets.length,yt=!!g.title,ut=1600,ht=B/ut,bt=yt?48*ht:0,Nt=B,Dt=K-bt,st=[{fill:"#5353FF",text:"#0000B9"},{fill:"#FFFF45",text:"#ABAB00"},{fill:"#53FF53",text:"#00B800"},{fill:"#FF5353",text:"#B90000"},{fill:"#FF53FF",text:"#B900B9"},{fill:"#53FFFF",text:"#00B9B9"},{fill:"#FFA653",text:"#B96B00"},{fill:"#A653FF",text:"#6B00B9"}];if(H===0)return{type:"venn",title:g.title,canvasW:B,canvasH:K,titleHeight:bt,scale:ht,circles:[],regionLabels:[],textNodes:[],fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"};for(var Lt=[],ft=0;ft<g.sets.length;ft++){var Ct=g.sets[ft],Xt;Ct.sizeExplicit?Xt=Ct.size:Xt=10,Lt.push({sets:[Ct.id],size:Xt,label:Ct.label})}for(var ft=0;ft<(g.unions||[]).length;ft++){var St=g.unions[ft];if(St.ids&&St.ids.length>=2){var Zt;St.sizeExplicit?Zt=St.size:Zt=10/Math.pow(St.ids.length,2),Lt.push({sets:St.ids.slice().sort(),size:Zt,label:St.label||void 0})}}var G;try{G=dh(Lt,{width:Nt,height:Dt,padding:15})}catch(Cr){G=[]}function gt(Cr){return Cr.slice().sort().join("|")}for(var oe={},ae={},ft=0;ft<G.length;ft++){var fe=G[ft];oe[gt(fe.data.sets)]=fe;for(var ne=0;ne<fe.circles.length;ne++){var ye=fe.circles[ne];ye.set!=null&&(ae[ye.set]=ye)}}for(var Mt=bt,$t=[],ft=0;ft<g.sets.length;ft++){var Ct=g.sets[ft],Jt=ae[Ct.id],e=oe[gt([Ct.id])];if(!Jt){$t.push({id:Ct.id,label:Ct.label,cx:B/2,cy:K/2,r:100,fill:st[ft%st.length].fill,text:st[ft%st.length].text,labelAnchor:{x:B/2,y:K/2}});continue}var x=e&&e.text?e.text.x:Jt.x,C=e&&e.text?e.text.y:Jt.y;$t.push({id:Ct.id,label:Ct.label,cx:Jt.x,cy:Jt.y+Mt,r:Jt.radius,fill:st[ft%st.length].fill,text:st[ft%st.length].text,labelAnchor:{x,y:C+Mt}})}for(var S={},ft=0;ft<$t.length;ft++)S[$t[ft].id]=$t[ft];var Y=g.styles||{};for(var D in Y){var At=S[D];if(At)for(var U=Y[D].split(/\s*,\s*/),q=0;q<U.length;q++){var rt=U[q].split(":");if(rt.length>=2){var ct=rt[0].trim(),nt=rt.slice(1).join(":").trim();ct==="fill"?At.fill=nt:ct==="color"?At.text=nt:ct==="stroke"&&(At.stroke=nt)}}}for(var zt=[],Ot=[],Ft={},ft=0;ft<g.labels.length;ft++){var Pt=g.labels[ft];if((Pt.kind||"text")==="union"){var ct=gt(Pt.ids),e=oe[ct],Wt,Kt;if(e&&e.text)Wt=e.text.x,Kt=e.text.y+Mt;else{for(var Bt=0,ce=0,kt=0,ne=0;ne<Pt.ids.length;ne++){var wt=S[Pt.ids[ne]];wt&&(Bt+=wt.cx,ce+=wt.cy,kt++)}Wt=kt>0?Bt/kt:B/2,Kt=kt>0?ce/kt:K/2}var jt={text:Pt.text,x:Wt,y:Kt,kind:"union"};if(Pt.ids.length>0&&Y[Pt.ids[0]])for(var U=Y[Pt.ids[0]].split(/\s*,\s*/),q=0;q<U.length;q++){var rt=U[q].split(":");if(rt.length>=2){var Ht=rt[0].trim(),qt=rt.slice(1).join(":").trim();Ht==="color"&&(jt.fontColor=qt)}}zt.push(jt)}else{for(var ee=[],Ut=Pt.id||Pt.ids[0],ne=0;ne<Pt.ids.length;ne++){var ve=Pt.ids[ne];if(S[ve]){ee.push(ve);continue}var we=null,Se=0;for(var be in S)ve.indexOf(be)===0&&be.length>Se&&(we=be,Se=be.length);we&&ee.push(we)}if(ee.length===0)continue;for(var Me=[],St=0;St<ee.length;St++)Me.indexOf(ee[St])<0&&Me.push(ee[St]);Me.sort();var Fe=Me.join("|");Ft[Fe]||(Ft[Fe]={ids:Me,nodes:[]}),Ft[Fe].nodes.push({id:Ut,label:Pt.text||Ut,rawIds:Pt.ids})}}for(var Fe in Ft){var Ue=Ft[Fe],e=oe[Fe],De,Ye;if(e&&e.text)De={x:e.text.x,y:e.text.y},Ye=e.circles;else{var Pe=ae[Ue.ids[0]];if(!Pe)continue;De={x:Pe.x,y:Pe.y},Ye=[Pe]}for(var de=1/0,Ve=1/0,ne=0;ne<Ye.length;ne++){var Ne=Ye[ne];Ne.radius<de&&(de=Ne.radius);var nr=De.x-Ne.x,Ge=De.y-Ne.y,Ie=Math.sqrt(nr*nr+Ge*Ge),Ce=Ne.radius-Ie;Ce<Ve&&(Ve=Ce)}var Ke=isFinite(Ve)?Math.max(0,Ve):0;Ke===0&&isFinite(de)&&(Ke=de*.6);for(var We=Math.max(80*ht,Ke*2*.95),le=Math.max(60*ht,Ke*2*.95),Ae=e&&e.data&&e.data.label&&e.data.label.length>0,Le=Ae?Math.min(32*ht,Ke*.25):0,Re=Le+(Ue.nodes.length<=2?30*ht:0),Be=De.x-We/2,je=De.y-le/2+Re,kt=Ue.nodes.length,ie=Math.max(1,Math.ceil(Math.sqrt(kt))),fr=Math.max(1,Math.ceil(kt/ie)),Ar=We/ie,Lr=le/fr,Ze=Ar*.9,dr=Lr*.9,ft=0;ft<Ue.nodes.length;ft++){var Xe=Ue.nodes[ft],br=ft%ie,vr=Math.floor(ft/ie),gr=Be+Ar*(br+.5),fa=je+Lr*(vr+.5),Je={text:Xe.label,id:Xe.id,x:gr,y:fa+Mt,boxW:Ze,boxH:dr,kind:"text"};if(Y[Xe.id])for(var $e=Y[Xe.id].split(/\s*,\s*/),q=0;q<$e.length;q++){var Qr=$e[q].split(":");if(Qr.length>=2){var $r=Qr[0].trim(),Ir=Qr.slice(1).join(":").trim();$r==="color"&&(Je.fontColor=Ir)}}Ot.push(Je)}}return{type:"venn",title:g.title,canvasW:B,canvasH:K,titleHeight:bt,scale:ht,circles:$t,regionLabels:zt,textNodes:Ot,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function An(g,tt){var B=[],K=[];function H(yt,ut,ht){for(var bt=tt===-1?yt.slice().reverse():yt,Nt=0;Nt<bt.length;Nt++){var Dt=bt[Nt],st=B.length,Lt=Dt.children||[];B.push({depth:ht,text:Dt.text||Dt.name||"",parentIndex:ut,childCount:Lt.length}),ht%2===0?(K.push(st),Lt.length&&H(Lt,st,ht+1)):(Lt.length&&H(Lt,st,ht+1),K.push(st))}}return H(g,-1,2),{entries:B,yOrder:K}}function dn(g,tt){var B=g.categories.length,K="Trebuchet MS,Verdana,Arial,sans-serif",H=g.effect||"",yt=H.split(/\s+/).filter(function(Ae){return Ae}),ut=0,ht=20,bt=0;if(yt.length===0){var Nt=o(H,14,K);ut=Nt&&Nt.width||0,ht=Nt&&Nt.height||20,bt=ht}else{for(var Dt=0;Dt<yt.length;Dt++){var st=o(yt[Dt],14,K),Lt=st&&st.width||0;Lt>ut&&(ut=Lt),st&&st.height&&st.height>bt&&(bt=st.height)}bt<=0&&(bt=17),ht=yt.length*bt}for(var ft=Math.max(72,Math.ceil(ut+30)),Ct=Math.max(80,Math.ceil(ht+70)),Xt=82*Math.PI/180,St=Math.cos(Xt),Zt=Math.sin(Xt),G=250,gt=16,oe=[],ae=[],fe=0;fe<B;fe++)fe%2===0?oe.push(g.categories[fe]):ae.push(g.categories[fe]);function ne(Ae){for(var Le=Ae.children||[],Re=0,Be=0;Be<Le.length;Be++)Re+=1+ne(Le[Be]);return Re}function ye(Ae){for(var Le=0,Re=0,Be=0;Be<Ae.length;Be++){var je=ne(Ae[Be]);Le+=je,je>Re&&(Re=je)}return{total:Le,max:Re}}var Mt=ye(oe),$t=ye(ae),Jt=Mt.total+$t.total,e=G,x=G;if(Jt>0){var C=G*2,S=G*.3;e=Math.max(S,C*(Mt.total/Jt)),x=Math.max(S,C*($t.total/Jt))}var Y=gt*2;e=Math.max(e,Mt.max*Y),x=Math.max(x,$t.max*Y);for(var D=Math.max(e,G),At=Math.ceil(B/2),U=-20,q=[],rt=U,ct=0;ct<At;ct++){let Ae=function(Le,Re,Be){for(var je=Le.children||[],ie=je.length>0,fr=Be*(ie?1:.2),Ar=-St*fr,Lr=Zt*fr*Re,Ze=nt+Ar,dr=D+Lr,Xe=An(je,Re),br=Xe.entries,vr=Xe.yOrder,gr=br.length,fa=new Array(gr),Je=0;Je<vr.length;Je++){var $e=vr[Je];fa[$e]=D+Lr*((Je+1)/(gr+1))}var Qr={};Qr[-1]={x0:nt,y0:D,x1:Ze,y1:dr,childCount:je.length,childrenDrawn:0};for(var $r=[],Ir=-St,Cr=Zt*Re,Ea=30,xa=60,aa=5,Gr=0;Gr<br.length;Gr++){var ya=br[Gr],Br=fa[Gr],pa=Qr[ya.parentIndex],i,m,k,R,$=ya.depth%2===0;if($){var et=pa.y1-pa.y0;i=pa.x0+(pa.x1-pa.x0)*(et!==0?(Br-pa.y0)/et:.5),m=Br,k=i-(ya.childCount>0?xa+ya.childCount*aa:Ea),R=Br}else{var vt=pa.childrenDrawn++;i=pa.x0+(pa.x1-pa.x0)*((pa.childCount-vt)/(pa.childCount+1)),m=pa.y0,k=i+Ir*((Br-m)/Cr),R=Br}$r.push({text:ya.text,depth:ya.depth,isHorizontal:$,bx0:i,by0:m,bx1:k,by1:R,x:i,y:Br,stubEndX:k,dirY:Re}),ya.childCount>0&&(Qr[Gr]={x0:i,y0:m,x1:k,y1:R,childCount:ya.childCount,childrenDrawn:0})}return{name:Le.name,spineX:nt,spineY:D,boneEndX:Ze,boneEndY:dr,dirY:Re,subs:$r,boneHasChildren:ie}};var nt=U,zt=U,Ot=g.categories[ct*2],Ft=g.categories[ct*2+1];if(Ot){var Pt=Ae(Ot,-1,e);q.push(Pt);for(var Wt=Pt.boneEndX-le(Ot.name,gt,K),Kt=0;Kt<Pt.subs.length;Kt++){var Lt=We(Pt.subs[Kt].text,gt,K),Bt=Pt.subs[Kt].stubEndX-Lt;Bt<Wt&&(Wt=Bt)}Wt<zt&&(zt=Wt)}if(Ft){var ce=Ae(Ft,1,x);q.push(ce);for(var kt=ce.boneEndX-le(Ft.name,gt,K),wt=0;wt<ce.subs.length;wt++){var jt=We(ce.subs[wt].text,gt,K),Ht=ce.subs[wt].stubEndX-jt;Ht<kt&&(kt=Ht)}kt<zt&&(zt=kt)}zt<rt&&(rt=zt),ct<At-1&&(U=zt)}var qt=20,ee=20,Ut=20,ve=20,we=D-e,Se=D+x;we>D-Ct/2&&(we=D-Ct/2),Se<D+Ct/2&&(Se=D+Ct/2);var be=-rt+qt,Me=-we+Ut,Fe=be+ft/2+10;Fe=be+ft/2;for(var Ue=Me+D,De=be+rt,Ye=be,Pe=Me+D,de=[],Ve=0;Ve<q.length;Ve++){for(var Ne=q[Ve],nr=[],Ge=0;Ge<Ne.subs.length;Ge++){var Ie=Ne.subs[Ge];nr.push({text:Ie.text,depth:Ie.depth,isHorizontal:Ie.isHorizontal,bx0:Ie.bx0+be,by0:Ie.by0+Me,bx1:Ie.bx1+be,by1:Ie.by1+Me,x:Ie.x+be,y:Ie.y+Me,stubEndX:Ie.stubEndX+be,dirY:Ie.dirY})}de.push({name:Ne.name,spineX:Ne.spineX+be,spineY:Ne.spineY+Me,boneEndX:Ne.boneEndX+be,boneEndY:Ne.boneEndY+Me,dirY:Ne.dirY,subs:nr,boneHasChildren:Ne.boneHasChildren})}var Ce=Math.max(Fe+ft/2+ee,Ye+ft+ee),Ke=Me+Se+ve;return Ce<300&&(Ce=300),Ke<300&&(Ke=300),{type:"ishikawa",title:g.title,effect:g.effect,canvasW:Ce,canvasH:Ke,spineX0:De,spineX1:Ye,spineY:Pe,effectCx:Fe,effectCy:Ue,effectW:ft,effectH:Ct,categories:de,fontFamily:K};function We(Ae,Le,Re){for(var Be=Ln(Ae||"",15),je=0,ie=0;ie<Be.length;ie++){var fr=typeof o=="function"?o(Be[ie],Le,Re):null,Ar=fr&&fr.width||Be[ie].length*Le*.55;Ar>je&&(je=Ar)}return je}function le(Ae,Le,Re){return We(Ae,Le,Re)/2}}function Ln(g,tt){var B=(g||"").split(/\s+/).filter(function(ht){return ht});if(B.length===0)return[""];for(var K=[],H=B[0],yt=1;yt<B.length;yt++){var ut=B[yt];H.length+1+ut.length<=tt?H+=" "+ut:(K.push(H),H=ut)}return K.push(H),K}function Fn(g,tt){var B=tt&&tt.themeVariables&&tt.themeVariables.treeView||{},K=tt&&tt.treeView||{},H=K.rowIndent!=null?K.rowIndent:10,yt=K.paddingX!=null?K.paddingX:5,ut=K.paddingY!=null?K.paddingY:5,ht=K.lineThickness!=null?K.lineThickness:1,bt=parseInt(B.labelFontSize||"16",10)||16,Nt=B.labelColor||"black",Dt=B.lineColor||"black",st="Trebuchet MS,Verdana,Arial,sans-serif",Lt={label:"/",children:g.roots||[]},ft=[],Ct=[],Xt=0,St=0;function Zt(Jt,e,x){var C=o(x.label||"",bt,st),S=C&&C.width||0,Y=bt+3,D=Y+ut*2,At=S+yt*2;x.BBox={x:Jt,y:e,width:At,height:D},ft.push({label:x.label||"",x:Jt,y:e,width:At,height:D})}function G(Jt,e){var x=e*(H+yt);Zt(x,Xt,Jt);var C=Jt.BBox.height,S=Jt.BBox.width;e>0&&Ct.push({x1:x-H,y1:Xt+C/2,x2:x,y2:Xt+C/2}),x+S>St&&(St=x+S),Xt+=C}function gt(Jt,e){G(Jt,e);for(var x=Jt.children||[],C=0;C<x.length;C++)gt(x[C],e+1);if(x.length){var S=Jt.BBox,Y=x[x.length-1].BBox;Ct.push({x1:S.x+yt,y1:S.y+S.height,x2:S.x+yt,y2:Y.y+Y.height/2+ht/2})}}gt(Lt,0);for(var oe=0,ae=g.title?36:0,fe=ae,ne=0;ne<ft.length;ne++)ft[ne].x+=oe,ft[ne].y+=fe;for(var ye=0;ye<Ct.length;ye++)Ct[ye].x1+=oe,Ct[ye].x2+=oe,Ct[ye].y1+=fe,Ct[ye].y2+=fe;var Mt=St+oe,$t=Xt+fe;return{type:"treeView",title:g.title||"",canvasW:Mt,canvasH:$t,titleBarH:ae,paddingX:yt,lineThickness:ht,labelFontSize:bt,labelColor:Nt,lineColor:Dt,fontFamily:st,rows:ft,lines:Ct}}return{layout:or,measureNodes:P,measureText:o,layoutWithElk:v}})();var In={docker:'<svg width="256" height="185" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 185"><path fill="#2396ed" d="M250.716 70.497c-5.765-4-18.976-5.5-29.304-3.5c-1.2-10-6.725-18.749-16.333-26.499l-5.524-4l-3.844 5.75c-4.803 7.5-7.205 18-6.485 28c.24 3.499 1.441 9.749 5.044 15.249c-3.362 2-10.328 4.5-19.455 4.5H1.155l-.48 2c-1.682 9.999-1.682 41.248 18.014 65.247c14.892 18.249 36.99 27.499 66.053 27.499c62.93 0 109.528-30.25 131.386-84.997c8.647.25 27.142 0 36.51-18.75c.24-.5.72-1.5 2.401-5.249l.961-2zM139.986 0h-26.42v24.999h26.42zm0 29.999h-26.42v24.999h26.42zm-31.225 0h-26.42v24.999h26.42zm-31.225 0H51.115v24.999h26.421zM46.311 59.998H19.89v24.999h26.42zm31.225 0H51.115v24.999h26.421zm31.225 0h-26.42v24.999h26.42zm31.226 0h-26.422v24.999h26.422zm31.225 0H144.79v24.999h26.422z"/></svg>',redis:'<svg width="256" height="220" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 220"><path fill="#912626" d="M245.97 168.943c-13.662 7.121-84.434 36.22-99.501 44.075s-23.437 7.78-35.34 2.09c-11.902-5.69-87.216-36.112-100.783-42.597C3.566 169.271 0 166.535 0 163.951v-25.876s98.05-21.345 113.879-27.024c15.828-5.679 21.32-5.884 34.79-.95c13.472 4.936 94.018 19.468 107.331 24.344l-.006 25.51c.002 2.558-3.07 5.364-10.024 8.988"/><path fill="#c6302b" d="M245.965 143.22c-13.661 7.118-84.431 36.218-99.498 44.072c-15.066 7.857-23.436 7.78-35.338 2.09c-11.903-5.686-87.214-36.113-100.78-42.594c-13.566-6.485-13.85-10.948-.524-16.166c13.326-5.22 88.224-34.605 104.055-40.284c15.828-5.677 21.319-5.884 34.789-.948c13.471 4.934 83.819 32.935 97.13 37.81c13.316 4.881 13.827 8.9.166 16.02"/><path fill="#912626" d="M245.97 127.074c-13.662 7.122-84.434 36.22-99.501 44.078c-15.067 7.853-23.437 7.777-35.34 2.087c-11.903-5.687-87.216-36.112-100.783-42.597C3.566 127.402 0 124.67 0 122.085V96.206s98.05-21.344 113.879-27.023c15.828-5.679 21.32-5.885 34.79-.95C162.142 73.168 242.688 87.697 256 92.574l-.006 25.513c.002 2.557-3.07 5.363-10.024 8.987"/><path fill="#c6302b" d="M245.965 101.351c-13.661 7.12-84.431 36.218-99.498 44.075c-15.066 7.854-23.436 7.777-35.338 2.087c-11.903-5.686-87.214-36.112-100.78-42.594c-13.566-6.483-13.85-10.947-.524-16.167C23.151 83.535 98.05 54.148 113.88 48.47c15.828-5.678 21.319-5.884 34.789-.949c13.471 4.934 83.819 32.933 97.13 37.81c13.316 4.88 13.827 8.9.166 16.02"/><path fill="#912626" d="M245.97 83.653c-13.662 7.12-84.434 36.22-99.501 44.078c-15.067 7.854-23.437 7.777-35.34 2.087c-11.903-5.687-87.216-36.113-100.783-42.595C3.566 83.98 0 81.247 0 78.665v-25.88s98.05-21.343 113.879-27.021c15.828-5.68 21.32-5.884 34.79-.95C162.142 29.749 242.688 44.278 256 49.155l-.006 25.512c.002 2.555-3.07 5.361-10.024 8.986"/><path fill="#c6302b" d="M245.965 57.93c-13.661 7.12-84.431 36.22-99.498 44.074c-15.066 7.854-23.436 7.777-35.338 2.09C99.227 98.404 23.915 67.98 10.35 61.497S-3.5 50.55 9.825 45.331C23.151 40.113 98.05 10.73 113.88 5.05c15.828-5.679 21.319-5.883 34.789-.948s83.819 32.934 97.13 37.811c13.316 4.876 13.827 8.897.166 16.017"/><path fill="#fff" d="m159.283 32.757l-22.01 2.285l-4.927 11.856l-7.958-13.23l-25.415-2.284l18.964-6.839l-5.69-10.498l17.755 6.944l16.738-5.48l-4.524 10.855zm-28.251 57.518L89.955 73.238l58.86-9.035zm-56.95-50.928c17.375 0 31.46 5.46 31.46 12.194c0 6.736-14.085 12.195-31.46 12.195s-31.46-5.46-31.46-12.195c0-6.734 14.085-12.194 31.46-12.194"/><path fill="#621b1c" d="m185.295 35.998l34.836 13.766l-34.806 13.753z"/><path fill="#9a2928" d="m146.755 51.243l38.54-15.245l.03 27.519l-3.779 1.478z"/></svg>',postgresql:'<svg width="256" height="264" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 264"><path d="M255.008 158.086c-1.535-4.649-5.556-7.887-10.756-8.664c-2.452-.366-5.26-.21-8.583.475c-5.792 1.195-10.089 1.65-13.225 1.738c11.837-19.985 21.462-42.775 27.003-64.228c8.96-34.689 4.172-50.492-1.423-57.64C233.217 10.847 211.614.683 185.552.372c-13.903-.17-26.108 2.575-32.475 4.549c-5.928-1.046-12.302-1.63-18.99-1.738c-12.537-.2-23.614 2.533-33.079 8.15c-5.24-1.772-13.65-4.27-23.362-5.864c-22.842-3.75-41.252-.828-54.718 8.685C6.622 25.672-.937 45.684.461 73.634c.444 8.874 5.408 35.874 13.224 61.48c4.492 14.718 9.282 26.94 14.237 36.33c7.027 13.315 14.546 21.156 22.987 23.972c4.731 1.576 13.327 2.68 22.368-4.85c1.146 1.388 2.675 2.767 4.704 4.048c2.577 1.625 5.728 2.953 8.875 3.74c11.341 2.835 21.964 2.126 31.027-1.848c.056 1.612.099 3.152.135 4.482c.06 2.157.12 4.272.199 6.25c.537 13.374 1.447 23.773 4.143 31.049c.148.4.347 1.01.557 1.657c1.345 4.118 3.594 11.012 9.316 16.411c5.925 5.593 13.092 7.308 19.656 7.308c3.292 0 6.433-.432 9.188-1.022c9.82-2.105 20.973-5.311 29.041-16.799c7.628-10.86 11.336-27.217 12.007-52.99q.13-1.094.244-2.088l.16-1.362l1.797.158l.463.031c10.002.456 22.232-1.665 29.743-5.154c5.935-2.754 24.954-12.795 20.476-26.351"/><path fill="#336791" d="M237.906 160.722c-29.74 6.135-31.785-3.934-31.785-3.934c31.4-46.593 44.527-105.736 33.2-120.211c-30.904-39.485-84.399-20.811-85.292-20.327l-.287.052c-5.876-1.22-12.451-1.946-19.842-2.067c-13.456-.22-23.664 3.528-31.41 9.402c0 0-95.43-39.314-90.991 49.444c.944 18.882 27.064 142.873 58.218 105.422c11.387-13.695 22.39-25.274 22.39-25.274c5.464 3.63 12.006 5.482 18.864 4.817l.533-.452c-.166 1.7-.09 3.363.213 5.332c-8.026 8.967-5.667 10.541-21.711 13.844c-16.235 3.346-6.698 9.302-.471 10.86c7.549 1.887 25.013 4.561 36.813-11.958l-.47 1.885c3.144 2.519 5.352 16.383 4.982 28.952c-.37 12.568-.617 21.197 1.86 27.937c2.479 6.74 4.948 21.905 26.04 17.386c17.623-3.777 26.756-13.564 28.027-29.89c.901-11.606 2.942-9.89 3.07-20.267l1.637-4.912c1.887-15.733.3-20.809 11.157-18.448l2.64.232c7.99.363 18.45-1.286 24.589-4.139c13.218-6.134 21.058-16.377 8.024-13.686z"/><path fill="#fff" d="M108.076 81.525c-2.68-.373-5.107-.028-6.335.902c-.69.523-.904 1.129-.962 1.546c-.154 1.105.62 2.327 1.096 2.957c1.346 1.784 3.312 3.01 5.258 3.28q.423.059.842.058c3.245 0 6.196-2.527 6.456-4.392c.325-2.336-3.066-3.893-6.355-4.35m88.784.073c-.256-1.831-3.514-2.353-6.606-1.923c-3.088.43-6.082 1.824-5.832 3.659c.2 1.427 2.777 3.863 5.827 3.863q.387 0 .78-.054c2.036-.282 3.53-1.575 4.24-2.32c1.08-1.136 1.706-2.402 1.591-3.225"/><path fill="#fff" d="M247.802 160.025c-1.134-3.429-4.784-4.532-10.848-3.28c-18.005 3.716-24.453 1.142-26.57-.417c13.995-21.32 25.508-47.092 31.719-71.137c2.942-11.39 4.567-21.968 4.7-30.59c.147-9.463-1.465-16.417-4.789-20.665c-13.402-17.125-33.072-26.311-56.882-26.563c-16.369-.184-30.199 4.005-32.88 5.183c-5.646-1.404-11.801-2.266-18.502-2.376c-12.288-.199-22.91 2.743-31.704 8.74c-3.82-1.422-13.692-4.811-25.765-6.756c-20.872-3.36-37.458-.814-49.294 7.571c-14.123 10.006-20.643 27.892-19.38 53.16c.425 8.501 5.269 34.653 12.913 59.698c10.062 32.964 21 51.625 32.508 55.464c1.347.449 2.9.763 4.613.763c4.198 0 9.345-1.892 14.7-8.33a530 530 0 0 1 20.261-22.926c4.524 2.428 9.494 3.784 14.577 3.92q.016.2.035.398a118 118 0 0 0-2.57 3.175c-3.522 4.471-4.255 5.402-15.592 7.736c-3.225.666-11.79 2.431-11.916 8.435c-.136 6.56 10.125 9.315 11.294 9.607c4.074 1.02 7.999 1.523 11.742 1.523c9.103 0 17.114-2.992 23.516-8.781c-.197 23.386.778 46.43 3.586 53.451c2.3 5.748 7.918 19.795 25.664 19.794c2.604 0 5.47-.303 8.623-.979c18.521-3.97 26.564-12.156 29.675-30.203c1.665-9.645 4.522-32.676 5.866-45.03c2.836.885 6.487 1.29 10.434 1.289c8.232 0 17.731-1.749 23.688-4.514c6.692-3.108 18.768-10.734 16.578-17.36m-44.106-83.48c-.061 3.647-.563 6.958-1.095 10.414c-.573 3.717-1.165 7.56-1.314 12.225c-.147 4.54.42 9.26.968 13.825c1.108 9.22 2.245 18.712-2.156 28.078a37 37 0 0 1-1.95-4.009c-.547-1.326-1.735-3.456-3.38-6.404c-6.399-11.476-21.384-38.35-13.713-49.316c2.285-3.264 8.084-6.62 22.64-4.813m-17.644-61.787c21.334.471 38.21 8.452 50.158 23.72c9.164 11.711-.927 64.998-30.14 110.969a171 171 0 0 0-.886-1.117l-.37-.462c7.549-12.467 6.073-24.802 4.759-35.738c-.54-4.488-1.05-8.727-.92-12.709c.134-4.22.692-7.84 1.232-11.34c.663-4.313 1.338-8.776 1.152-14.037c.139-.552.195-1.204.122-1.978c-.475-5.045-6.235-20.144-17.975-33.81c-6.422-7.475-15.787-15.84-28.574-21.482c5.5-1.14 13.021-2.203 21.442-2.016M66.674 175.778c-5.9 7.094-9.974 5.734-11.314 5.288c-8.73-2.912-18.86-21.364-27.791-50.624c-7.728-25.318-12.244-50.777-12.602-57.916c-1.128-22.578 4.345-38.313 16.268-46.769c19.404-13.76 51.306-5.524 64.125-1.347c-.184.182-.376.352-.558.537c-21.036 21.244-20.537 57.54-20.485 59.759c-.002.856.07 2.068.168 3.735c.362 6.105 1.036 17.467-.764 30.334c-1.672 11.957 2.014 23.66 10.111 32.109a36 36 0 0 0 2.617 2.468c-3.604 3.86-11.437 12.396-19.775 22.426m22.479-29.993c-6.526-6.81-9.49-16.282-8.133-25.99c1.9-13.592 1.199-25.43.822-31.79c-.053-.89-.1-1.67-.127-2.285c3.073-2.725 17.314-10.355 27.47-8.028c4.634 1.061 7.458 4.217 8.632 9.645c6.076 28.103.804 39.816-3.432 49.229c-.873 1.939-1.698 3.772-2.402 5.668l-.546 1.466c-1.382 3.706-2.668 7.152-3.465 10.424c-6.938-.02-13.687-2.984-18.819-8.34m1.065 37.9c-2.026-.506-3.848-1.385-4.917-2.114c.893-.42 2.482-.992 5.238-1.56c13.337-2.745 15.397-4.683 19.895-10.394c1.031-1.31 2.2-2.794 3.819-4.602l.002-.002c2.411-2.7 3.514-2.242 5.514-1.412c1.621.67 3.2 2.702 3.84 4.938c.303 1.056.643 3.06-.47 4.62c-9.396 13.156-23.088 12.987-32.921 10.526m69.799 64.952c-16.316 3.496-22.093-4.829-25.9-14.346c-2.457-6.144-3.665-33.85-2.808-64.447c.011-.407-.047-.8-.159-1.17a15.4 15.4 0 0 0-.456-2.162c-1.274-4.452-4.379-8.176-8.104-9.72c-1.48-.613-4.196-1.738-7.46-.903c.696-2.868 1.903-6.107 3.212-9.614l.549-1.475c.618-1.663 1.394-3.386 2.214-5.21c4.433-9.848 10.504-23.337 3.915-53.81c-2.468-11.414-10.71-16.988-23.204-15.693c-7.49.775-14.343 3.797-17.761 5.53c-.735.372-1.407.732-2.035 1.082c.954-11.5 4.558-32.992 18.04-46.59c8.489-8.56 19.794-12.788 33.568-12.56c27.14.444 44.544 14.372 54.366 25.979c8.464 10.001 13.047 20.076 14.876 25.51c-13.755-1.399-23.11 1.316-27.852 8.096c-10.317 14.748 5.644 43.372 13.315 57.129c1.407 2.521 2.621 4.7 3.003 5.626c2.498 6.054 5.732 10.096 8.093 13.046c.724.904 1.426 1.781 1.96 2.547c-4.166 1.201-11.649 3.976-10.967 17.847c-.55 6.96-4.461 39.546-6.448 51.059c-2.623 15.21-8.22 20.875-23.957 24.25m68.104-77.936c-4.26 1.977-11.389 3.46-18.161 3.779c-7.48.35-11.288-.838-12.184-1.569c-.42-8.644 2.797-9.547 6.202-10.503c.535-.15 1.057-.297 1.561-.473q.469.383 1.032.756c6.012 3.968 16.735 4.396 31.874 1.271l.166-.033c-2.042 1.909-5.536 4.471-10.49 6.772"/></svg>',mysql:'<svg width="256" height="252" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 252"><path fill="#00546b" d="M235.648 194.212c-13.918-.347-24.705 1.045-33.752 4.872c-2.61 1.043-6.786 1.044-7.134 4.35c1.392 1.392 1.566 3.654 2.784 5.567c2.09 3.479 5.741 8.177 9.047 10.614c3.653 2.783 7.308 5.566 11.134 8.002c6.786 4.176 14.442 6.611 21.053 10.787c3.829 2.434 7.654 5.568 11.482 8.177c1.914 1.39 3.131 3.654 5.568 4.523v-.521c-1.219-1.567-1.567-3.828-2.784-5.568c-1.738-1.74-3.48-3.306-5.22-5.046c-5.045-6.784-11.308-12.7-18.093-17.571c-5.567-3.828-17.747-9.047-20.008-15.485c0 0-.175-.173-.348-.347c3.827-.348 8.35-1.74 12.005-2.784c5.915-1.567 11.308-1.218 17.398-2.784c2.783-.696 5.567-1.566 8.35-2.436v-1.565c-3.13-3.132-5.392-7.307-8.698-10.265c-8.873-7.657-18.617-15.137-28.707-21.4c-5.394-3.48-12.354-5.742-18.095-8.699c-2.086-1.045-5.567-1.566-6.784-3.306c-3.133-3.827-4.873-8.872-7.134-13.396c-5.044-9.57-9.917-20.182-14.267-30.272c-3.13-6.786-5.044-13.572-8.872-19.834c-17.92-29.577-37.406-47.497-67.33-65.07c-6.438-3.653-14.093-5.219-22.27-7.132c-4.348-.175-8.699-.522-13.048-.697c-2.784-1.218-5.568-4.523-8.004-6.089C34.006 4.573 8.429-8.996 1.122 8.924c-4.698 11.308 6.96 22.442 10.96 28.185c2.96 4.001 6.786 8.524 8.874 13.048c1.218 2.956 1.565 6.09 2.783 9.221c2.785 7.653 5.393 16.18 9.048 23.314c1.914 3.653 4.001 7.48 6.437 10.786c1.392 1.913 3.827 2.784 4.35 5.915c-2.435 3.48-2.61 8.7-4.003 13.049c-6.263 19.66-3.826 44.017 5.046 58.457c2.783 4.348 9.395 13.92 18.268 10.265c7.83-3.131 6.09-13.048 8.35-21.747c.524-2.09.176-3.48 1.219-4.872v.349c2.436 4.87 4.871 9.569 7.133 14.44c5.394 8.524 14.788 17.398 22.617 23.314c4.177 3.13 7.482 8.524 12.702 10.438v-.523h-.349c-1.044-1.566-2.61-2.261-4.001-3.48c-3.131-3.13-6.612-6.958-9.047-10.438c-7.306-9.744-13.745-20.53-19.486-31.665c-2.783-5.392-5.22-11.308-7.481-16.701c-1.045-2.09-1.045-5.22-2.784-6.263c-2.61 3.827-6.437 7.133-8.351 11.83c-3.304 7.481-3.653 16.702-4.871 26.27c-.696.176-.349 0-.697.35c-5.566-1.394-7.48-7.134-9.569-12.006c-5.22-12.352-6.09-32.186-1.565-46.452c1.218-3.654 6.438-15.136 4.35-18.616c-1.044-3.306-4.525-5.22-6.438-7.829c-2.261-3.306-4.698-7.48-6.263-11.135c-4.176-9.743-6.264-20.53-10.787-30.273c-2.088-4.524-5.74-9.22-8.699-13.396c-3.305-4.697-6.959-8.004-9.569-13.571c-.869-1.913-2.088-5.045-.696-7.133c.348-1.392 1.043-1.913 2.436-2.261c2.262-1.915 8.7.521 10.96 1.565c6.438 2.608 11.831 5.046 17.225 8.699c2.435 1.74 5.045 5.046 8.176 5.916h3.654c5.568 1.217 11.83.348 17.05 1.913c9.222 2.957 17.572 7.307 25.054 12.005c22.792 14.44 41.58 34.97 54.282 59.501c2.088 4 2.957 7.656 4.871 11.83c3.655 8.526 8.178 17.225 11.83 25.576c3.654 8.176 7.133 16.528 12.353 23.314c2.61 3.652 13.048 5.567 17.746 7.481c3.48 1.565 8.874 2.958 12.005 4.871c5.915 3.652 11.83 7.83 17.398 11.83c2.784 2.088 11.482 6.438 12.005 9.917"/><path fill="#00546b" d="M58.186 43.022c-2.957 0-5.044.35-7.132.871v.348h.348c1.393 2.784 3.827 4.698 5.566 7.133c1.393 2.783 2.61 5.568 4.003 8.352c.173-.175.347-.348.347-.348c2.437-1.741 3.654-4.524 3.654-8.7c-1.044-1.217-1.218-2.435-2.088-3.653c-1.043-1.741-3.306-2.61-4.698-4.003"/></svg>',nginx:'<svg width="256" height="291" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 291"><path fill="#009639" d="M2.054 218.187c1.32 2.347 3.227 4.108 5.575 5.428l112.962 65.137c4.695 2.787 10.416 2.787 14.964 0l112.963-65.137c4.695-2.64 7.482-7.629 7.482-13.057V80.284c0-5.428-2.787-10.416-7.482-13.056L135.555 2.09c-4.694-2.788-10.416-2.788-14.964 0L7.63 67.228C2.787 69.868 0 74.856 0 80.284v130.42c0 2.642.587 5.136 2.054 7.483"/><path fill="#fff" d="M91.837 195.154a14.463 14.463 0 0 1-14.524 14.524a14.463 14.463 0 0 1-14.523-14.524V95.542c0-7.776 6.895-14.084 16.43-14.084c6.896 0 14.965 2.787 19.806 8.802l4.4 5.282l60.737 72.618V95.835a14.463 14.463 0 0 1 14.524-14.524a14.463 14.463 0 0 1 14.523 14.524v99.613c0 7.775-6.895 14.083-16.43 14.083c-6.896 0-14.965-2.787-19.806-8.802l-65.137-77.754z"/></svg>',prometheus:'<svg width="256" height="257" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 257"><path fill="#da4e31" d="M128.001.667C57.311.667 0 57.971 0 128.664c0 70.69 57.311 127.998 128.001 127.998S256 199.354 256 128.664C256 57.97 198.689.667 128.001.667m0 239.56c-20.112 0-36.419-13.435-36.419-30.004h72.838c0 16.566-16.306 30.004-36.419 30.004m60.153-39.94H67.842V178.47h120.314v21.816zm-.432-33.045H68.185c-.398-.458-.804-.91-1.188-1.375c-12.315-14.954-15.216-22.76-18.032-30.716c-.048-.262 14.933 3.06 25.556 5.45c0 0 5.466 1.265 13.458 2.722c-7.673-8.994-12.23-20.428-12.23-32.116c0-25.658 19.68-48.079 12.58-66.201c6.91.562 14.3 14.583 14.8 36.505c7.346-10.152 10.42-28.69 10.42-40.056c0-11.769 7.755-25.44 15.512-25.907c-6.915 11.396 1.79 21.165 9.53 45.4c2.902 9.103 2.532 24.423 4.772 34.138c.744-20.178 4.213-49.62 17.014-59.784c-5.647 12.8.836 28.818 5.27 36.518c7.154 12.424 11.49 21.836 11.49 39.638c0 11.936-4.407 23.173-11.84 31.958c8.452-1.586 14.289-3.016 14.289-3.016l27.45-5.355c.002-.002-3.987 16.401-19.314 32.197"/></svg>',grafana:'<svg width="256" height="279" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 279"><defs><linearGradient id="SVGzNMMBeHh" x1="49.995%" x2="49.995%" y1="122.45%" y2="31.139%"><stop offset="0%" stop-color="#fff100"/><stop offset="100%" stop-color="#f05a28"/></linearGradient></defs><path fill="url(#SVGzNMMBeHh)" d="M255.59 122.775c-.46-4.675-1.226-10.04-2.759-16.017a98 98 0 0 0-7.204-19.16a106.7 106.7 0 0 0-13.412-20.54c-2.222-2.681-4.675-5.287-7.28-7.816c3.908-15.558-4.752-29.046-4.752-29.046c-14.945-.92-24.448 4.675-27.973 7.204c-.613-.23-1.15-.537-1.763-.767c-2.529-.996-5.135-1.992-7.894-2.835a130 130 0 0 0-8.277-2.3c-2.835-.69-5.67-1.226-8.583-1.686c-.537-.076-.996-.153-1.533-.23C157.646 8.738 138.946 0 138.946 0c-20.922 13.258-24.831 31.805-24.831 31.805s-.077.383-.23 1.073c-1.15.307-2.299.69-3.449.996c-1.609.46-3.218 1.073-4.751 1.686a123 123 0 0 0-4.752 1.916a117 117 0 0 0-9.35 4.599c-2.989 1.686-5.9 3.525-8.737 5.441l-.766-.307c-28.97-11.036-54.643 2.223-54.643 2.223c-2.376 30.809 11.572 50.198 14.331 53.724c-.69 1.916-1.303 3.832-1.916 5.748c-2.146 6.974-3.755 14.101-4.751 21.535c-.154 1.073-.307 2.146-.384 3.219C7.894 146.916 0 173.97 0 173.97c22.302 25.674 48.359 27.283 48.359 27.283l.077-.076c3.295 5.9 7.127 11.495 11.419 16.783a112 112 0 0 0 5.671 6.362c-8.124 23.298 1.15 42.61 1.15 42.61c24.83.92 41.155-10.882 44.603-13.564a85 85 0 0 0 7.511 2.222a109.7 109.7 0 0 0 23.298 3.449c1.916.076 3.909.153 5.825.076h2.759l1.226-.076v.076c11.726 16.708 32.265 19.084 32.265 19.084c14.638-15.405 15.48-30.733 15.48-34.028v-1.38c3.066-2.145 5.979-4.445 8.738-6.974c5.824-5.288 10.959-11.342 15.25-17.857l1.15-1.839c16.554.92 28.28-10.27 28.28-10.27c-2.759-17.243-12.569-25.673-14.638-27.283c0 0-.077-.076-.23-.153s-.153-.153-.153-.153c-.077-.077-.23-.154-.383-.23c.076-1.073.153-2.07.23-3.142c.153-1.84.153-3.756.153-5.595v-2.913l-.077-1.149l-.076-1.533c0-.536-.077-.996-.154-1.456c-.076-.46-.076-.996-.153-1.456l-.153-1.456l-.23-1.456c-.307-1.916-.613-3.756-1.073-5.672c-1.763-7.433-4.675-14.484-8.43-20.845a70.4 70.4 0 0 0-14.025-16.707c-5.365-4.752-11.42-8.584-17.704-11.42c-6.36-2.835-12.952-4.675-19.543-5.518c-3.295-.46-6.59-.613-9.886-.536h-2.453l-1.226.077c-.46 0-.92.076-1.303.076a52 52 0 0 0-4.981.69c-6.591 1.226-12.799 3.602-18.24 6.897s-10.193 7.358-14.025 11.956a54.7 54.7 0 0 0-8.89 15.021a52.9 52.9 0 0 0-3.525 16.094c-.077 1.303-.077 2.683-.077 3.986v.996l.077 1.073c.076.613.076 1.303.153 1.916c.23 2.682.766 5.288 1.456 7.74c1.456 4.982 3.755 9.503 6.59 13.335s6.285 6.975 9.887 9.504c3.602 2.452 7.51 4.215 11.343 5.364c3.832 1.15 7.664 1.61 11.266 1.61h1.993c.23 0 .46 0 .689-.077c.383 0 .766-.077 1.15-.077c.076 0 .23 0 .306-.076l.383-.077c.23 0 .46-.076.69-.076c.46-.077.843-.154 1.303-.23s.843-.154 1.226-.307c.843-.153 1.61-.46 2.376-.69c1.533-.536 3.066-1.15 4.368-1.839c1.38-.69 2.606-1.533 3.832-2.3c.307-.23.69-.459.997-.766c1.226-.996 1.456-2.835.46-4.061c-.844-1.073-2.376-1.38-3.603-.69l-.92.46a25 25 0 0 1-3.295 1.38c-1.15.382-2.375.689-3.602.919c-.613.076-1.226.153-1.916.23c-.306 0-.613.076-.996.076h-1.84c-.383 0-.766 0-1.149-.076h-.46c-.153 0-.383 0-.536-.077c-.383-.077-.69-.077-1.073-.153c-2.836-.383-5.671-1.226-8.354-2.453a29.3 29.3 0 0 1-7.74-5.058c-2.376-2.146-4.445-4.675-6.055-7.587s-2.759-6.131-3.295-9.503c-.23-1.686-.383-3.449-.307-5.135c0-.46.077-.92.077-1.38v-.613c0-.23.077-.46.077-.69c.076-.919.23-1.839.383-2.758c1.303-7.358 4.981-14.562 10.653-20.003c1.456-1.38 2.988-2.606 4.598-3.755a31.7 31.7 0 0 1 5.211-2.99a36 36 0 0 1 5.672-2.068c1.915-.537 3.908-.844 5.977-1.073c.997-.077 1.993-.154 3.066-.154h2.376l.843.077c2.222.153 4.368.46 6.514.996c4.292.92 8.507 2.53 12.415 4.675c7.818 4.369 14.485 11.113 18.547 19.237c2.07 4.061 3.525 8.43 4.215 12.951c.153 1.15.307 2.3.383 3.45l.077.842l.077.843v3.296c0 .536-.077 1.456-.077 1.992c-.077 1.227-.23 2.53-.383 3.756s-.383 2.452-.613 3.678a50 50 0 0 1-.843 3.602a64 64 0 0 1-2.3 7.128a62.4 62.4 0 0 1-7.204 13.105c-5.9 8.124-13.948 14.715-23.144 18.93c-4.599 2.069-9.427 3.602-14.408 4.368c-2.453.46-4.982.69-7.511.766h-3.832a36 36 0 0 1-4.062-.23c-5.365-.383-10.653-1.379-15.864-2.835c-5.135-1.456-10.116-3.525-14.868-5.978c-9.427-5.058-17.933-11.956-24.524-20.31a79 79 0 0 1-8.584-13.334a79 79 0 0 1-5.671-14.638c-1.38-5.058-2.223-10.193-2.606-15.405l-.077-.996v-6.821c.077-2.529.307-5.211.614-7.817c.306-2.606.766-5.288 1.302-7.894c.537-2.605 1.15-5.211 1.916-7.817a103 103 0 0 1 5.442-14.791c4.368-9.35 10.04-17.704 16.86-24.371c1.686-1.686 3.449-3.22 5.288-4.752a78 78 0 0 1 5.748-4.138c1.916-1.303 3.985-2.453 6.055-3.526a40 40 0 0 1 3.142-1.533l3.219-1.379c2.146-.92 4.368-1.686 6.667-2.376c.537-.153 1.15-.306 1.686-.536c.537-.154 1.15-.307 1.686-.46c1.15-.307 2.3-.613 3.45-.843c.536-.153 1.149-.23 1.762-.383c.613-.154 1.15-.23 1.763-.384c.613-.076 1.15-.23 1.762-.306l.843-.153l.92-.154c.613-.076 1.15-.153 1.763-.23c.69-.076 1.302-.153 1.992-.23c.537-.076 1.456-.153 1.993-.23c.383-.076.843-.076 1.226-.153l.843-.076l.383-.077h.46c.69-.077 1.303-.077 1.993-.153l.996-.077h.767c.536 0 1.149-.076 1.685-.076a99 99 0 0 1 6.745 0c4.445.153 8.813.69 13.028 1.456c8.507 1.61 16.478 4.291 23.758 7.893c7.28 3.526 13.719 7.894 19.39 12.646c.383.306.69.613 1.073.92c.306.306.69.613.996.92c.69.612 1.303 1.225 1.993 1.838c.69.614 1.303 1.227 1.916 1.84a44 44 0 0 1 1.839 1.916c2.376 2.529 4.598 5.058 6.59 7.664a99 99 0 0 1 9.734 15.25l.46.92l.46.92c.306.613.613 1.226.843 1.84c.306.613.536 1.149.843 1.762c.23.613.536 1.15.766 1.763c.92 2.299 1.84 4.521 2.53 6.59c1.149 3.373 1.992 6.362 2.682 8.967a2.043 2.043 0 0 0 2.299 1.61c1.15-.077 1.992-.996 1.992-2.146c.077-2.759 0-6.054-.383-9.81"/></svg>',kubernetes:'<svg width="256" height="249" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 249"><path fill="#326de6" d="M82.085 244.934c-5.946 0-11.561-2.642-15.36-7.432L8.92 165.657c-3.799-4.79-5.285-10.9-3.799-16.847l20.645-89.682c1.321-5.946 5.285-10.736 10.736-13.378l83.571-39.97c2.643-1.32 5.616-1.981 8.589-1.981s5.945.66 8.588 1.982l83.572 39.804c5.45 2.642 9.414 7.432 10.735 13.378l20.645 89.682c1.322 5.946 0 12.057-3.798 16.847l-57.807 71.845c-3.799 4.624-9.414 7.432-15.36 7.432z"/><path fill="#fff" d="M128.495 7.928c2.313 0 4.625.495 6.772 1.486l83.572 39.804c4.294 2.147 7.597 6.111 8.588 10.736l20.645 89.682c1.156 4.79 0 9.745-3.138 13.543l-57.806 71.846c-2.973 3.798-7.598 5.945-12.387 5.945H82.085c-4.79 0-9.414-2.147-12.387-5.945l-57.806-71.846c-2.973-3.798-4.13-8.753-3.138-13.543l20.645-89.682c1.156-4.79 4.294-8.754 8.588-10.736L121.56 9.25c2.147-.826 4.624-1.321 6.936-1.321m0-7.763c-3.468 0-6.936.826-10.24 2.312l-83.571 39.97c-6.607 3.138-11.231 8.918-12.883 16.02L1.156 148.15c-1.651 7.102 0 14.369 4.625 20.15l57.806 71.845c4.46 5.615 11.231 8.753 18.333 8.753h92.655c7.102 0 13.874-3.138 18.333-8.753l57.807-71.846c4.624-5.615 6.276-13.047 4.624-20.15l-20.645-89.682c-1.651-7.102-6.276-12.882-12.882-16.02L138.57 2.476C135.432.991 131.964.165 128.495.165"/><path fill="#fff" d="M212.232 142.534q-.248 0 0 0h-.165c-.165 0-.33 0-.33-.165c-.33 0-.66-.165-.991-.165c-1.156-.165-2.147-.33-3.138-.33c-.496 0-.991 0-1.652-.166h-.165c-3.468-.33-6.276-.66-8.919-1.486c-1.156-.496-1.486-1.156-1.817-1.817c0-.165-.165-.165-.165-.33l-2.147-.66a65.3 65.3 0 0 0-1.156-23.289a68 68 0 0 0-9.249-21.636l1.652-1.486v-.33c0-.826.165-1.652.825-2.478c1.982-1.817 4.46-3.303 7.433-5.12c.495-.33.99-.495 1.486-.826c.991-.495 1.817-.99 2.808-1.651c.165-.165.495-.33.826-.66c.165-.166.33-.166.33-.331c2.312-1.982 2.808-5.285 1.156-7.433c-.826-1.156-2.312-1.816-3.799-1.816c-1.32 0-2.477.495-3.633 1.321l-.33.33c-.33.165-.496.496-.826.661c-.826.826-1.487 1.486-2.147 2.312c-.33.33-.66.826-1.156 1.156c-2.313 2.478-4.46 4.46-6.607 5.946q-.742.495-1.486.496c-.33 0-.661 0-.991-.166h-.33l-1.983 1.322c-2.147-2.312-4.459-4.294-6.771-6.276a65.96 65.96 0 0 0-34.519-13.709l-.165-2.147l-.33-.33c-.496-.496-1.156-.991-1.322-2.147c-.165-2.643.166-5.616.496-8.919v-.165c0-.496.165-1.156.33-1.652c.165-.99.33-1.982.496-3.138v-1.486c0-2.973-2.313-5.45-5.12-5.45c-1.322 0-2.643.66-3.634 1.651c-.99.991-1.486 2.312-1.486 3.799v1.321c0 1.156.165 2.147.495 3.138c.165.496.165.991.33 1.652v.165c.33 3.303.826 6.276.496 8.919c-.165 1.156-.826 1.651-1.321 2.147l-.33.33l-.166 2.147c-2.973.33-5.946.66-8.919 1.321c-12.717 2.808-23.948 9.25-32.701 18.498l-1.652-1.156h-.33c-.33 0-.661.165-.991.165q-.743 0-1.487-.495c-2.147-1.486-4.294-3.634-6.606-6.111c-.33-.33-.66-.826-1.156-1.156c-.661-.826-1.322-1.487-2.148-2.312c-.165-.166-.495-.33-.825-.661c-.165-.165-.33-.165-.33-.33a5.77 5.77 0 0 0-3.634-1.322c-1.487 0-2.973.661-3.799 1.817c-1.652 2.147-1.156 5.45 1.156 7.432c.165 0 .165.166.33.166c.33.165.496.495.826.66c.991.66 1.817 1.156 2.808 1.652c.496.165.991.495 1.487.826c2.972 1.816 5.45 3.303 7.432 5.12c.826.825.826 1.651.826 2.477v.33l1.651 1.487c-.33.495-.66.826-.826 1.321c-8.258 13.048-11.396 28.408-9.249 43.603l-2.147.66c0 .166-.165.166-.165.33c-.33.661-.826 1.322-1.817 1.817c-2.477.826-5.45 1.157-8.918 1.487h-.166c-.495 0-1.156 0-1.651.165c-.991 0-1.982.165-3.138.33c-.33 0-.66.166-.991.166c-.165 0-.33 0-.496.165c-2.973.66-4.79 3.468-4.294 6.11c.496 2.313 2.643 3.8 5.285 3.8c.496 0 .826 0 1.322-.166c.165 0 .33 0 .33-.165c.33 0 .66-.165.99-.165c1.157-.33 1.983-.66 2.974-1.156c.495-.165.99-.496 1.486-.66h.165c3.138-1.157 5.946-2.148 8.589-2.478h.33c.991 0 1.652.495 2.147.826c.165 0 .165.165.33.165l2.313-.33c3.964 12.221 11.561 23.122 21.636 31.05c2.312 1.816 4.624 3.303 7.102 4.79l-.991 2.146c0 .166.165.166.165.33c.33.661.66 1.487.33 2.643c-.99 2.478-2.477 4.955-4.294 7.763v.165c-.33.496-.66.826-.99 1.321c-.661.826-1.157 1.652-1.818 2.643c-.165.165-.33.495-.495.826c0 .165-.165.33-.165.33c-1.321 2.808-.33 5.946 2.147 7.102q.99.496 1.982.496c1.982 0 3.964-1.322 4.955-3.139c0-.165.165-.33.165-.33c.165-.33.33-.66.495-.826c.496-1.156.661-1.982.991-2.973l.496-1.486c1.156-3.303 1.982-5.946 3.468-8.258c.66-.991 1.487-1.156 2.147-1.487c.165 0 .165 0 .33-.165l1.157-2.147c7.267 2.808 15.195 4.294 23.122 4.294c4.79 0 9.745-.495 14.37-1.651a73 73 0 0 0 8.588-2.478l.99 1.817c.166 0 .166 0 .331.165c.826.165 1.486.496 2.147 1.487c1.321 2.312 2.312 5.12 3.468 8.258v.165l.496 1.486c.33.991.495 1.982.99 2.973c.166.33.331.496.496.826c0 .165.166.33.166.33c.99 1.982 2.972 3.139 4.954 3.139q.992 0 1.982-.496c1.156-.66 2.147-1.652 2.478-2.973c.33-1.321.33-2.808-.33-4.129c0-.165-.166-.165-.166-.33c-.165-.33-.33-.66-.495-.826c-.496-.991-1.156-1.817-1.817-2.643c-.33-.495-.66-.825-.99-1.32v-.166c-1.818-2.808-3.47-5.285-4.295-7.763c-.33-1.156 0-1.816.165-2.642c0-.165.165-.165.165-.33l-.826-1.982c8.754-5.12 16.186-12.388 21.802-21.306c2.973-4.625 5.285-9.745 6.936-14.865l1.982.33c.166 0 .166-.165.33-.165c.661-.33 1.157-.825 2.148-.825h.33c2.643.33 5.45 1.32 8.589 2.477h.165c.495.165.99.495 1.486.66c.991.496 1.817.826 2.973 1.157c.33 0 .66.165.991.165c.165 0 .33 0 .495.165c.496.165.826.165 1.322.165c2.477 0 4.624-1.651 5.285-3.798c0-1.982-1.817-4.625-4.79-5.45m-76.47-8.093l-7.267 3.469l-7.267-3.469l-1.816-7.762l4.954-6.276h8.093l4.955 6.276zm43.108-17.176a52.1 52.1 0 0 1 1.156 16.68l-25.27-7.266c-2.312-.66-3.633-2.973-3.138-5.285c.165-.661.496-1.322.991-1.817l19.985-18.003c2.807 4.625 4.954 9.91 6.276 15.69m-14.204-25.6l-21.636 15.36c-1.817 1.156-4.295.825-5.781-.991c-.495-.496-.66-1.157-.826-1.817l-1.486-26.922a50.13 50.13 0 0 1 29.729 14.37M116.769 78.12c1.817-.33 3.468-.66 5.285-.99l-1.486 26.425c-.165 2.312-1.982 4.294-4.46 4.294c-.66 0-1.486-.165-1.982-.495L92.16 91.665c6.772-6.772 15.195-11.397 24.609-13.544m-32.537 23.453l19.654 17.507c1.817 1.487 1.982 4.294.496 6.111c-.496.66-1.156 1.156-1.982 1.322l-25.6 7.432c-.991-11.231 1.486-22.627 7.432-32.372m-4.46 44.759l26.262-4.46c2.147-.165 4.129 1.322 4.624 3.469c.165.99.165 1.817-.165 2.643l-10.075 24.278c-9.249-5.946-16.681-15.03-20.645-25.93m60.285 32.867c-3.799.826-7.598 1.321-11.562 1.321c-5.78 0-11.396-.99-16.68-2.642l13.047-23.618c1.321-1.487 3.468-2.147 5.285-1.156a7 7 0 0 1 1.982 1.816l12.717 22.958c-1.486.495-3.138.826-4.79 1.321m32.206-22.957c-4.129 6.606-9.58 11.891-15.855 16.02l-10.405-24.94c-.496-1.981.33-4.128 2.312-5.12c.66-.33 1.486-.495 2.312-.495l26.426 4.46c-.991 3.633-2.643 6.937-4.79 10.075"/></svg>',python:'<svg width="256" height="255" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 255"><defs><linearGradient id="SVGg39WleeP" x1="12.959%" x2="79.639%" y1="12.039%" y2="78.201%"><stop offset="0%" stop-color="#387eb8"/><stop offset="100%" stop-color="#366994"/></linearGradient><linearGradient id="SVGlXoRkc4T" x1="19.128%" x2="90.742%" y1="20.579%" y2="88.429%"><stop offset="0%" stop-color="#ffe052"/><stop offset="100%" stop-color="#ffc331"/></linearGradient></defs><path fill="url(#SVGg39WleeP)" d="M126.916.072c-64.832 0-60.784 28.115-60.784 28.115l.072 29.128h61.868v8.745H41.631S.145 61.355.145 126.77c0 65.417 36.21 63.097 36.21 63.097h21.61v-30.356s-1.165-36.21 35.632-36.21h61.362s34.475.557 34.475-33.319V33.97S194.67.072 126.916.072M92.802 19.66a11.12 11.12 0 0 1 11.13 11.13a11.12 11.12 0 0 1-11.13 11.13a11.12 11.12 0 0 1-11.13-11.13a11.12 11.12 0 0 1 11.13-11.13"/><path fill="url(#SVGlXoRkc4T)" d="M128.757 254.126c64.832 0 60.784-28.115 60.784-28.115l-.072-29.127H127.6v-8.745h86.441s41.486 4.705 41.486-60.712c0-65.416-36.21-63.096-36.21-63.096h-21.61v30.355s1.165 36.21-35.632 36.21h-61.362s-34.475-.557-34.475 33.32v56.013s-5.235 33.897 62.518 33.897m34.114-19.586a11.12 11.12 0 0 1-11.13-11.13a11.12 11.12 0 0 1 11.13-11.131a11.12 11.12 0 0 1 11.13 11.13a11.12 11.12 0 0 1-11.13 11.13"/></svg>',react:'<svg width="256" height="228" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 228"><path fill="#00d8ff" d="M210.483 73.824a172 172 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171 171 0 0 0-6.375 5.848a156 156 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a171 171 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a146 146 0 0 0 6.921 2.165a168 168 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a146 146 0 0 0 5.342-4.923a168 168 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145 145 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844m-6.365 70.984q-2.102.694-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14m-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a157 157 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345q.785 3.162 1.386 6.193M87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a157 157 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a135 135 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94M50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a135 135 0 0 1-6.318-1.979m12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144 144 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160 160 0 0 1-1.76-7.887m110.427 27.268a348 348 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381 381 0 0 0-7.365-13.322m-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322 322 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18M82.802 87.83a323 323 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a322 322 0 0 0-7.848 12.897m8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321 321 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147m37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486m52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382 382 0 0 0 7.859-13.026a347 347 0 0 0 7.425-13.565m-16.898 8.101a359 359 0 0 1-12.281 19.815a329 329 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310 310 0 0 1-12.513-19.846h.001a307 307 0 0 1-10.923-20.627a310 310 0 0 1 10.89-20.637l-.001.001a307 307 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329 329 0 0 1 12.335 19.695a359 359 0 0 1 11.036 20.54a330 330 0 0 1-11 20.722m22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026q-.518 2.504-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a161 161 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3M128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86"/></svg>',terraform:'<svg width="256" height="291" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 291"><path fill="#4040b2" d="M176.485 188.994L256 143.127V51.249l-79.515 45.963z"/><path fill="#5c4ee5" d="m88.243 51.249l79.515 45.963v91.782L88.243 143.08M0 91.83l79.515 45.916v-91.83L0 0m88.243 244.994l79.515 45.915v-91.83l-79.515-45.915"/></svg>',rabbitmq:'<svg width="256" height="257" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 257"><path fill="#f60" d="M245.734 102.437h-81.911a10.2 10.2 0 0 1-10.263-10.263v-81.91a10.2 10.2 0 0 0-10.263-10.2h-30.66a10.2 10.2 0 0 0-10.264 10.2v81.91a10.2 10.2 0 0 1-10.263 10.263H61.45a10.2 10.2 0 0 1-10.263-10.263v-81.91A10.2 10.2 0 0 0 40.924 0H10.199A10.2 10.2 0 0 0 0 10.263v235.535a10.2 10.2 0 0 0 10.263 10.263h235.47a10.2 10.2 0 0 0 10.264-10.263V112.893a10.2 10.2 0 0 0-10.263-10.456m-41.18 86.979a15.33 15.33 0 0 1-15.33 15.394h-20.526a15.33 15.33 0 0 1-15.33-15.394v-20.462a15.33 15.33 0 0 1 15.33-15.394h20.525a15.33 15.33 0 0 1 15.33 15.394z"/></svg>',elasticsearch:'<svg width="256" height="288" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 288"><path fill="#343741" d="M0 143.82c0 12.44 1.744 24.441 4.71 35.956h175.067c19.856 0 35.955-16.1 35.955-35.956c0-19.865-16.1-35.955-35.955-35.955H4.71C1.744 119.371 0 131.38 0 143.82"/><path fill="#fec514" d="M242.013 68.863c5.025-4.629 9.7-9.6 13.987-14.93C229.636 21.079 189.213 0 143.82 0C87 0 38.101 33.052 14.775 80.9h196.559c11.38 0 22.319-4.324 30.678-12.037"/><path fill="#00bfb3" d="M211.334 206.742H14.774c23.336 47.839 72.226 80.9 129.045 80.9c45.393 0 85.816-21.088 112.18-53.933a136.6 136.6 0 0 0-13.987-14.94c-8.36-7.721-19.299-12.027-30.678-12.027"/></svg>',nodejs:'<svg width="512" height="314" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 314"><defs><linearGradient id="SVG1ChKRdyM" x1="68.188%" x2="27.823%" y1="17.487%" y2="89.755%"><stop offset="0%" stop-color="#41873f"/><stop offset="32.88%" stop-color="#418b3d"/><stop offset="63.52%" stop-color="#419637"/><stop offset="93.19%" stop-color="#3fa92d"/><stop offset="100%" stop-color="#3fae2a"/></linearGradient><linearGradient id="SVGaMJtkcxE" x1="43.277%" x2="159.245%" y1="55.169%" y2="-18.306%"><stop offset="13.76%" stop-color="#41873f"/><stop offset="40.32%" stop-color="#54a044"/><stop offset="71.36%" stop-color="#66b848"/><stop offset="90.81%" stop-color="#6cc04a"/></linearGradient><linearGradient id="SVG6PkGjd1W" x1="-4413.77%" x2="5327.93%" y1="13.43%" y2="13.43%"><stop offset="9.192%" stop-color="#6cc04a"/><stop offset="28.64%" stop-color="#66b848"/><stop offset="59.68%" stop-color="#54a044"/><stop offset="86.24%" stop-color="#41873f"/></linearGradient><linearGradient id="SVGPqbGjbGu" x1="-4.389%" x2="101.499%" y1="49.997%" y2="49.997%"><stop offset="9.192%" stop-color="#6cc04a"/><stop offset="28.64%" stop-color="#66b848"/><stop offset="59.68%" stop-color="#54a044"/><stop offset="86.24%" stop-color="#41873f"/></linearGradient><linearGradient id="SVGhSuPuc0t" x1="-9713.77%" x2="27.93%" y1="36.21%" y2="36.21%"><stop offset="9.192%" stop-color="#6cc04a"/><stop offset="28.64%" stop-color="#66b848"/><stop offset="59.68%" stop-color="#54a044"/><stop offset="86.24%" stop-color="#41873f"/></linearGradient><linearGradient id="SVGFiwIH9Kx" x1="-103.861%" x2="100.797%" y1="50.275%" y2="50.275%"><stop offset="9.192%" stop-color="#6cc04a"/><stop offset="28.64%" stop-color="#66b848"/><stop offset="59.68%" stop-color="#54a044"/><stop offset="86.24%" stop-color="#41873f"/></linearGradient><linearGradient id="SVGozO7odBP" x1="130.613%" x2="4.393%" y1="-211.069%" y2="201.605%"><stop offset="0%" stop-color="#41873f"/><stop offset="32.88%" stop-color="#418b3d"/><stop offset="63.52%" stop-color="#419637"/><stop offset="93.19%" stop-color="#3fa92d"/><stop offset="100%" stop-color="#3fae2a"/></linearGradient><path id="SVGnk2VSdjf" d="M57.903 1.85a5.96 5.96 0 0 0-5.894 0L3.352 29.933c-1.85 1.04-2.89 3.005-2.89 5.085v56.286c0 2.08 1.156 4.045 2.89 5.085l48.657 28.085a5.96 5.96 0 0 0 5.894 0l48.658-28.085c1.849-1.04 2.89-3.005 2.89-5.085V35.019c0-2.08-1.157-4.045-2.89-5.085z"/></defs><g fill="none"><path fill="#539e43" d="M253.11 313.094c-1.733 0-3.351-.462-4.854-1.271l-15.371-9.13c-2.312-1.272-1.156-1.734-.462-1.965c3.12-1.04 3.698-1.272 6.934-3.12c.347-.232.81-.116 1.156.115l11.789 7.05c.462.231 1.04.231 1.386 0l46.115-26.698c.462-.231.694-.694.694-1.271v-53.28c0-.579-.232-1.04-.694-1.272l-46.115-26.582c-.462-.232-1.04-.232-1.386 0l-46.115 26.582c-.462.231-.694.809-.694 1.271v53.28c0 .463.232 1.04.694 1.272l12.598 7.281c6.819 3.467 11.095-.578 11.095-4.623v-52.587c0-.693.578-1.387 1.387-1.387h5.894c.694 0 1.387.578 1.387 1.387v52.587c0 9.13-4.97 14.447-13.638 14.447c-2.658 0-4.738 0-10.633-2.89l-12.135-6.934c-3.005-1.733-4.854-4.97-4.854-8.437v-53.28c0-3.467 1.849-6.704 4.854-8.437l46.114-26.698c2.89-1.618 6.82-1.618 9.709 0l46.114 26.698c3.005 1.733 4.855 4.97 4.855 8.437v53.28c0 3.467-1.85 6.704-4.855 8.437l-46.114 26.698c-1.503.694-3.236 1.04-4.854 1.04m14.216-36.637c-20.225 0-24.386-9.246-24.386-17.105c0-.694.578-1.387 1.387-1.387h6.01c.693 0 1.271.462 1.271 1.156c.925 6.125 3.583 9.13 15.834 9.13c9.708 0 13.87-2.196 13.87-7.397c0-3.005-1.157-5.2-16.297-6.703c-12.598-1.272-20.457-4.045-20.457-14.1c0-9.362 7.86-14.91 21.035-14.91c14.793 0 22.075 5.086 23 16.18q0 .521-.347 1.041c-.232.231-.578.462-.925.462h-6.01c-.578 0-1.156-.462-1.271-1.04c-1.387-6.356-4.97-8.437-14.447-8.437c-10.633 0-11.905 3.699-11.905 6.472c0 3.352 1.503 4.392 15.834 6.241c14.216 1.85 20.92 4.508 20.92 14.447c-.116 10.171-8.437 15.95-23.116 15.95"/><path fill="#333" d="M110.028 104.712c0-2.08-1.156-4.046-3.005-5.086l-49.004-28.2c-.81-.463-1.734-.694-2.658-.81h-.463c-.924 0-1.849.347-2.658.81l-49.004 28.2c-1.85 1.04-3.005 3.005-3.005 5.086l.116 75.817c0 1.04.578 2.08 1.502 2.543c.925.578 2.08.578 2.89 0l29.125-16.643c1.849-1.04 3.005-3.005 3.005-5.085v-35.482c0-2.08 1.155-4.045 3.005-5.085l12.366-7.166c.925-.578 1.965-.81 3.005-.81s2.08.232 2.89.81l12.366 7.166c1.85 1.04 3.005 3.004 3.005 5.085v35.482c0 2.08 1.156 4.045 3.005 5.085l29.125 16.643a2.82 2.82 0 0 0 3.005 0c.925-.463 1.503-1.503 1.503-2.543zM345.571.347c-.924-.463-2.08-.463-2.89 0c-.924.578-1.502 1.502-1.502 2.542v75.125c0 .693-.346 1.386-1.04 1.849q-1.04.519-2.08 0l-12.251-7.05a5.96 5.96 0 0 0-5.895 0l-49.004 28.316c-1.849 1.04-3.005 3.005-3.005 5.085v56.516c0 2.08 1.156 4.046 3.005 5.086l49.004 28.316a5.96 5.96 0 0 0 5.895 0l49.004-28.316c1.849-1.04 3.005-3.005 3.005-5.086V21.844c0-2.196-1.156-4.16-3.005-5.201zm-4.507 143.776c0 .578-.231 1.04-.694 1.271l-16.758 9.708a1.71 1.71 0 0 1-1.503 0l-16.758-9.708c-.463-.231-.694-.809-.694-1.271v-19.417c0-.578.231-1.04.694-1.271l16.758-9.709a1.71 1.71 0 0 1 1.503 0l16.758 9.709c.463.23.694.809.694 1.271zm167.584-19.879c1.85-1.04 2.89-3.005 2.89-5.086v-13.753c0-2.08-1.156-4.045-2.89-5.085l-48.657-28.2a5.96 5.96 0 0 0-5.895 0l-49.004 28.315c-1.85 1.04-3.005 3.005-3.005 5.085v56.517c0 2.08 1.156 4.045 3.005 5.085l48.657 27.738c1.85 1.04 4.046 1.04 5.78 0L489 178.45c.925-.463 1.503-1.503 1.503-2.543s-.578-2.08-1.503-2.543l-49.235-28.316c-.925-.578-1.503-1.502-1.503-2.542v-17.683c0-1.04.578-2.08 1.503-2.543l15.371-8.784a2.82 2.82 0 0 1 3.005 0l15.372 8.784c.925.578 1.502 1.502 1.502 2.543v13.869c0 1.04.578 2.08 1.503 2.542a2.82 2.82 0 0 0 3.005 0z"/><path fill="#539e43" d="M456.292 121.585a1.05 1.05 0 0 1 1.156 0l9.362 5.432c.346.232.577.578.577 1.04v10.865c0 .462-.23.809-.577 1.04l-9.362 5.432a1.05 1.05 0 0 1-1.156 0l-9.361-5.432c-.347-.231-.578-.578-.578-1.04v-10.864c0-.463.23-.81.578-1.04z"/><g transform="translate(134.068 70.501)"><mask id="SVGifRk2cfR" fill="#fff"><use href="#SVGnk2VSdjf"/></mask><use fill="url(#SVG1ChKRdyM)" href="#SVGnk2VSdjf"/><g mask="url(#SVGifRk2cfR)"><path d="M51.893 1.85L3.121 29.933C1.27 30.974 0 32.94 0 35.02v56.286c0 1.387.578 2.658 1.502 3.698L56.285 1.156c-1.387-.231-3.005-.116-4.392.693m4.739 123.204c.462-.116.925-.347 1.387-.578l48.773-28.085c1.85-1.04 3.005-3.005 3.005-5.085V35.019c0-1.502-.694-3.005-1.734-4.045z"/><path fill="url(#SVGaMJtkcxE)" d="M106.676 29.934L57.788 1.85a8 8 0 0 0-1.503-.578L1.502 95.12a6.1 6.1 0 0 0 1.619 1.387l48.888 28.085c1.387.809 3.005 1.04 4.507.577l51.432-94.078c-.347-.462-.81-.81-1.272-1.156"/></g><g mask="url(#SVGifRk2cfR)"><path d="M109.797 91.305V35.019c0-2.08-1.271-4.045-3.12-5.085L57.786 1.85a5.1 5.1 0 0 0-1.848-.693l53.511 91.42c.231-.347.347-.809.347-1.271M3.12 29.934C1.272 30.974 0 32.94 0 35.02v56.286c0 2.08 1.387 4.045 3.12 5.085l48.889 28.085q1.734 1.04 3.814.693L3.467 29.818z"/><path fill="url(#SVG6PkGjd1W)" fill-rule="evenodd" d="m50.391.809l-.693.347h.924z" transform="translate(0 -9.246)"/><path fill="url(#SVGPqbGjbGu)" fill-rule="evenodd" d="M106.792 105.636c1.387-.809 2.427-2.196 2.89-3.698L56.053 10.402c-1.387-.231-2.89-.116-4.16.693L3.351 39.065l52.355 95.465a8 8 0 0 0 2.196-.693z" transform="translate(0 -9.246)"/><path fill="url(#SVGhSuPuc0t)" fill-rule="evenodd" d="m111.3 104.712l-.347-.578v.809z" transform="translate(0 -9.246)"/><path fill="url(#SVGFiwIH9Kx)" fill-rule="evenodd" d="m106.792 105.636l-48.773 28.085a7 7 0 0 1-2.196.693l.925 1.734l54.089-31.32v-.694l-1.387-2.312c-.231 1.618-1.271 3.005-2.658 3.814" transform="translate(0 -9.246)"/><path fill="url(#SVGozO7odBP)" fill-rule="evenodd" d="m106.792 105.636l-48.773 28.085a7 7 0 0 1-2.196.693l.925 1.734l54.089-31.32v-.694l-1.387-2.312c-.231 1.618-1.271 3.005-2.658 3.814" transform="translate(0 -9.246)"/></g></g></g></svg>',nodejsicon:'<svg width="256" height="289" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 289"><path fill="#539e43" d="M128 288.464c-3.975 0-7.685-1.06-11.13-2.915l-35.247-20.936c-5.3-2.915-2.65-3.975-1.06-4.505c7.155-2.385 8.48-2.915 15.9-7.156c.796-.53 1.856-.265 2.65.265l27.032 16.166c1.06.53 2.385.53 3.18 0l105.74-61.217c1.06-.53 1.59-1.59 1.59-2.915V83.08c0-1.325-.53-2.385-1.59-2.915l-105.74-60.953c-1.06-.53-2.385-.53-3.18 0L20.405 80.166c-1.06.53-1.59 1.855-1.59 2.915v122.17c0 1.06.53 2.385 1.59 2.915l28.887 16.695c15.636 7.95 25.44-1.325 25.44-10.6V93.68c0-1.59 1.326-3.18 3.181-3.18h13.516c1.59 0 3.18 1.325 3.18 3.18v120.58c0 20.936-11.396 33.126-31.272 33.126c-6.095 0-10.865 0-24.38-6.625l-27.827-15.9C4.24 220.885 0 213.465 0 205.515V83.346C0 75.396 4.24 67.976 11.13 64L116.87 2.783c6.625-3.71 15.635-3.71 22.26 0L244.87 64C251.76 67.975 256 75.395 256 83.346v122.17c0 7.95-4.24 15.37-11.13 19.345L139.13 286.08c-3.445 1.59-7.42 2.385-11.13 2.385m32.596-84.009c-46.377 0-55.917-21.2-55.917-39.221c0-1.59 1.325-3.18 3.18-3.18h13.78c1.59 0 2.916 1.06 2.916 2.65c2.12 14.045 8.215 20.936 36.306 20.936c22.261 0 31.802-5.035 31.802-16.96c0-6.891-2.65-11.926-37.367-15.372c-28.886-2.915-46.907-9.275-46.907-32.33c0-21.467 18.02-34.187 48.232-34.187c33.921 0 50.617 11.66 52.737 37.101q0 1.193-.795 2.385c-.53.53-1.325 1.06-2.12 1.06h-13.78c-1.326 0-2.65-1.06-2.916-2.385c-3.18-14.575-11.395-19.345-33.126-19.345c-24.38 0-27.296 8.48-27.296 14.84c0 7.686 3.445 10.07 36.306 14.31c32.597 4.24 47.967 10.336 47.967 33.127c-.265 23.321-19.345 36.571-53.002 36.571"/></svg>',awsec2:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGeyciVcvH" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#c8511b"/><stop offset="100%" stop-color="#f90"/></linearGradient></defs><path fill="url(#SVGeyciVcvH)" d="M0 0h256v256H0z"/><path fill="#fff" d="M86.4 169.6h80v-80h-80zm86.4-80h12.8V96h-12.8v12.8h12.8v6.4h-12.8v9.6h12.8v6.4h-12.8V144h12.8v6.4h-12.8v12.8h12.8v6.4h-12.8v.435a5.97 5.97 0 0 1-5.965 5.965h-.435v12.8H160V176h-12.8v12.8h-6.4V176h-9.6v12.8h-6.4V176H112v12.8h-6.4V176H92.8v12.8h-6.4V176h-.435A5.97 5.97 0 0 1 80 170.035v-.435h-9.6v-6.4H80v-12.8h-9.6V144H80v-12.8h-9.6v-6.4H80v-9.6h-9.6v-6.4H80V96h-9.6v-6.4H80v-.435a5.97 5.97 0 0 1 5.965-5.965h.435V70.4h6.4v12.8h12.8V70.4h6.4v12.8h12.8V70.4h6.4v12.8h9.6V70.4h6.4v12.8H160V70.4h6.4v12.8h.435a5.97 5.97 0 0 1 5.965 5.965zm-41.6 121.203a.4.4 0 0 1-.397.397H45.197a.4.4 0 0 1-.397-.397v-85.606a.4.4 0 0 1 .397-.397H64v-6.4H45.197a6.805 6.805 0 0 0-6.797 6.797v85.606a6.805 6.805 0 0 0 6.797 6.797h85.606a6.805 6.805 0 0 0 6.797-6.797V195.2h-6.4zm86.4-165.606v85.606a6.805 6.805 0 0 1-6.797 6.797H192v-6.4h18.803a.4.4 0 0 0 .397-.397V45.197a.4.4 0 0 0-.397-.397h-85.606a.4.4 0 0 0-.397.397V64h-6.4V45.197a6.805 6.805 0 0 1 6.797-6.797h85.606a6.805 6.805 0 0 1 6.797 6.797"/></svg>',awslambda:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGeyciVcvH" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#c8511b"/><stop offset="100%" stop-color="#f90"/></linearGradient></defs><path fill="url(#SVGeyciVcvH)" d="M0 0h256v256H0z"/><path fill="#fff" d="M89.624 211.2H49.89l43.945-91.853l19.912 40.992zm7.079-100.63a3.22 3.22 0 0 0-2.887-1.805h-.01a3.2 3.2 0 0 0-2.886 1.82L41.913 213.022a3.203 3.203 0 0 0 2.893 4.58l46.848-.001a3.21 3.21 0 0 0 2.9-1.83l25.65-54.08a3.18 3.18 0 0 0-.016-2.762zM207.985 211.2h-39.477L105.174 78.624a3.21 3.21 0 0 0-2.897-1.824h-25.83l.03-32h50.626l63.042 132.573a3.21 3.21 0 0 0 2.897 1.827h14.943zm3.208-38.4h-16.121L132.03 40.227a3.21 3.21 0 0 0-2.9-1.827H73.273a3.206 3.206 0 0 0-3.208 3.197l-.035 38.4c0 .851.333 1.664.94 2.265c.6.602 1.414.938 2.267.938h27.017l63.337 132.576a3.2 3.2 0 0 0 2.893 1.824h44.709a3.203 3.203 0 0 0 3.207-3.2V176c0-1.766-1.434-3.2-3.207-3.2"/></svg>',awss3:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVG7R6tZwZW" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1b660f"/><stop offset="100%" stop-color="#6cae3e"/></linearGradient></defs><path fill="url(#SVG7R6tZwZW)" d="M0 0h256v256H0z"/><path fill="#fff" d="m194.675 137.256l1.229-8.652c11.33 6.787 11.478 9.59 11.475 9.667c-.02.016-1.952 1.629-12.704-1.015m-6.218-1.728c-19.584-5.926-46.857-18.438-57.894-23.654c0-.045.013-.086.013-.131c0-4.24-3.45-7.69-7.693-7.69c-4.237 0-7.687 3.45-7.687 7.69s3.45 7.69 7.687 7.69c1.862 0 3.552-.695 4.886-1.8c12.986 6.148 40.048 18.478 59.776 24.302l-7.801 55.059q-.033.225-.032.451c0 4.848-21.463 13.754-56.532 13.754c-35.44 0-57.13-8.906-57.13-13.754q0-.22-.028-.435l-16.3-119.062c14.108 9.712 44.454 14.85 73.478 14.85c28.979 0 59.273-5.12 73.41-14.802zM48 65.528c.23-4.21 24.428-20.73 75.2-20.73c50.764 0 74.966 16.516 75.2 20.73v1.437c-2.784 9.443-34.144 19.434-75.2 19.434c-41.127 0-72.503-10.023-75.2-19.479zm156.8.07c0-11.087-31.79-27.2-81.6-27.2c-49.812 0-81.6 16.113-81.6 27.2l.3 2.414l17.754 129.676c.426 14.503 39.1 19.91 63.526 19.91c30.31 0 62.512-6.969 62.928-19.9l7.668-54.07c4.265 1.02 7.776 1.542 10.595 1.542c3.785 0 6.345-.925 7.897-2.774c1.274-1.517 1.76-3.354 1.396-5.31c-.83-4.428-6.087-9.202-16.794-15.311l7.603-53.639z"/></svg>',awsdynamodb:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGte2wIbLN" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#2e27ad"/><stop offset="100%" stop-color="#527fff"/></linearGradient></defs><path fill="url(#SVGte2wIbLN)" d="M0 0h256v256H0z"/><path fill="#fff" d="M166.675 175.52c-10.682 8.637-33.091 13.2-54.534 13.2c-21.447 0-43.863-4.566-54.541-13.202v17.392h.003c0 8.675 22.397 18.342 54.538 18.342c32.115 0 54.499-9.655 54.534-18.323zm.003-33.049l6.4-.035v.035c0 3.866-1.936 7.475-5.705 10.779c4.57 4.021 5.705 7.966 5.705 10.775c0 .02-.003.035-.003.054v28.831h.003c0 16.035-31.398 24.69-60.937 24.69c-29.469 0-60.781-8.617-60.931-24.578c0-.016-.01-.032-.01-.048v-28.958c0-.007.006-.016.006-.026c.01-2.809 1.15-6.738 5.712-10.75c-4.534-4.005-5.686-7.912-5.715-10.699h.003c0-.013-.006-.022-.006-.035v-28.958c0-.01.006-.02.006-.029c.01-2.809 1.152-6.738 5.716-10.743c-4.538-4.009-5.69-7.92-5.719-10.703h.003c0-.012-.006-.025-.006-.038V63.08c0-.01.006-.019.006-.029C51.261 47.04 82.624 38.4 112.141 38.4c16.675 0 32.694 2.65 43.948 7.271l-2.448 5.866c-10.505-4.314-25.632-6.79-41.5-6.79c-32.141 0-54.538 9.668-54.538 18.349c0 8.677 22.397 18.345 54.538 18.345c.867.01 1.715 0 2.573-.032l.268 6.342c-.947.038-1.894.038-2.841.038c-21.447 0-43.863-4.568-54.541-13.204V91.97h.003v.073c.032 3.329 3.447 6.236 6.307 8.083c8.608 5.488 24.032 9.236 41.232 10.014l-.29 6.341c-17.425-.79-32.682-4.405-42.503-9.946c-2.42 1.809-4.746 4.256-4.746 7.03c0 8.677 22.397 18.345 54.538 18.345c3.152 0 6.281-.105 9.305-.315l.445 6.332c-3.168.22-6.451.33-9.75.33c-21.447 0-43.863-4.567-54.541-13.203v17.383h.003c.032 3.403 3.447 6.307 6.307 8.157c9.844 6.281 28.327 10.192 48.23 10.192h1.409v6.347h-1.408c-20.221 0-38.599-3.754-49.837-10.099c-2.406 1.806-4.7 4.24-4.7 6.992c0 8.677 22.396 18.348 54.537 18.348c32.115 0 54.499-9.655 54.534-18.326v-.035c-.006-2.758-2.31-5.192-4.723-6.998a45 45 0 0 1-5.14 2.523l-2.45-5.865c2.323-.955 4.339-1.987 5.993-3.072c2.886-1.883 6.323-4.825 6.323-8.129m27.411-46.418h-17.932c-1.06 0-2.055-.52-2.647-1.39a3.14 3.14 0 0 1-.33-2.951l10.91-27.27h-41.31l-19.2 38.086h20.423c1.02 0 1.98.486 2.586 1.301c.598.82.774 1.87.464 2.838l-18.228 56.818zm9.821-.974l-79.996 82.648a3.22 3.22 0 0 1-2.31.974a3.2 3.2 0 0 1-1.636-.444a3.16 3.16 0 0 1-1.414-3.692l21.075-65.69h-21.226a3.21 3.21 0 0 1-2.723-1.504a3.15 3.15 0 0 1-.138-3.088l22.4-44.434a3.2 3.2 0 0 1 2.861-1.755h48a3.21 3.21 0 0 1 2.646 1.39a3.15 3.15 0 0 1 .33 2.955L180.87 89.706h20.73c1.28 0 2.441.761 2.944 1.93a3.16 3.16 0 0 1-.634 3.443M62.256 194.158c4.534 2.555 10.243 4.703 16.966 6.38l1.562-6.158c-6.077-1.514-11.389-3.5-15.366-5.742zm16.966-44.403l1.562-6.154c-6.077-1.517-11.389-3.504-15.366-5.745l-3.162 5.52c4.534 2.555 10.24 4.704 16.966 6.38M62.256 92.594l3.162-5.52c3.97 2.241 9.286 4.225 15.366 5.745l-1.562 6.154c-6.732-1.679-12.438-3.827-16.966-6.38"/></svg>',awselb:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGusebDeuy" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#4d27a8"/><stop offset="100%" stop-color="#a166ff"/></linearGradient></defs><path fill="url(#SVGusebDeuy)" d="M0 0h256v256H0z"/><path fill="#fff" d="M96 169.6c-22.938 0-41.6-18.662-41.6-41.6S73.062 86.4 96 86.4s41.6 18.662 41.6 41.6s-18.662 41.6-41.6 41.6m96 19.2c0 7.06-5.74 12.8-12.8 12.8s-12.8-5.74-12.8-12.8s5.74-12.8 12.8-12.8s12.8 5.74 12.8 12.8M179.2 54.4c7.06 0 12.8 5.74 12.8 12.8S186.26 80 179.2 80s-12.8-5.74-12.8-12.8s5.74-12.8 12.8-12.8m9.6 60.8c7.06 0 12.8 5.74 12.8 12.8s-5.74 12.8-12.8 12.8S176 135.06 176 128s5.74-12.8 12.8-12.8m-44.963 16h26.051c1.53 9.066 9.418 16 18.912 16c10.589 0 19.2-8.611 19.2-19.2s-8.611-19.2-19.2-19.2c-9.494 0-17.382 6.934-18.912 16h-26.051a47.5 47.5 0 0 0-4.407-17.107l28.397-25.06c3.187 2.356 7.114 3.767 11.373 3.767c10.589 0 19.2-8.611 19.2-19.2S189.789 48 179.2 48S160 56.611 160 67.2c0 4.02 1.245 7.747 3.363 10.835L136.26 101.95C127.693 88.762 112.867 80 96 80c-26.467 0-48 21.533-48 48s21.533 48 48 48c16.867 0 31.693-8.762 40.26-21.949l27.103 23.914A19.1 19.1 0 0 0 160 188.8c0 10.589 8.611 19.2 19.2 19.2s19.2-8.611 19.2-19.2s-8.611-19.2-19.2-19.2c-4.26 0-8.186 1.411-11.373 3.766l-28.397-25.059a47.5 47.5 0 0 0 4.407-17.107"/></svg>',awsvpc:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGusebDeuy" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#4d27a8"/><stop offset="100%" stop-color="#a166ff"/></linearGradient></defs><path fill="url(#SVGusebDeuy)" d="M0 0h256v256H0z"/><path fill="#fff" d="m195.2 132.39l-17.6-7.04v63.843c5.14-.512 9.283-2.202 12.227-5.19c5.44-5.53 5.376-13.636 5.373-13.716zm-24 56.844V125.35l-17.6 7.04v37.834c.022.662.749 17.142 17.6 19.011m30.4-19.011c.01.362.17 10.71-7.152 18.208c-4.787 4.906-11.536 7.392-20.048 7.392c-21.034 0-26.992-16.698-27.2-25.523v-40.077c0-1.309.797-2.486 2.013-2.973l24-9.6a3.2 3.2 0 0 1 2.374 0l24 9.6a3.2 3.2 0 0 1 2.013 2.973zm9.603-6.291l-.003-42.743l-36.8-14.72l-36.8 14.72v42.634c-.006.291-.432 19.93 11.309 32.013c6.182 6.361 14.758 9.587 25.491 9.587c10.806 0 19.424-3.248 25.613-9.651c11.725-12.135 11.197-31.645 11.19-31.84m-6.589 36.285c-7.44 7.702-17.606 11.606-30.214 11.606c-12.547 0-22.678-3.891-30.112-11.565c-13.629-14.057-13.117-35.625-13.088-36.534v-44.701c0-1.309.797-2.486 2.013-2.973l40-16a3.2 3.2 0 0 1 2.374 0l40 16a3.2 3.2 0 0 1 2.013 2.973v44.8c.029.8.605 22.33-12.986 36.394M73.776 151.023H121.6v6.4H73.776c-19.45 0-34.298-12.966-35.3-30.832c-.07-.73-.076-1.58-.076-2.432c0-21.98 15.37-30.074 24.333-32.922a50 50 0 0 1-.096-3.113c0-17.45 12.448-35.706 28.95-42.464c19.38-7.936 39.811-4.093 54.637 10.262c4.995 4.867 8.803 10.064 11.558 15.789c3.86-3.312 8.519-5.091 13.51-5.091c10.577 0 21.764 8.3 23.687 24.201c6.986 1.76 15.754 5.498 21.943 13.434l-5.044 3.936c-5.702-7.315-14.307-10.362-20.518-11.635a3.19 3.19 0 0 1-2.554-2.944c-.835-14.147-9.664-20.592-17.513-20.592c-4.679 0-8.826 2.208-11.997 6.384a3.16 3.16 0 0 1-3.024 1.232a3.2 3.2 0 0 1-2.528-2.064c-2.454-6.688-6.371-12.595-11.978-18.058c-12.94-12.525-30.803-15.869-47.753-8.931c-14.237 5.83-24.976 21.54-24.976 36.54c0 1.732.099 3.444.3 5.086a3.204 3.204 0 0 1-2.409 3.49c-8.262 2.046-22.128 8.337-22.128 27.46c0 .646-.006 1.296.058 1.946c.812 14.49 12.972 24.918 28.918 24.918"/></svg>',awsaurora:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGte2wIbLN" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#2e27ad"/><stop offset="100%" stop-color="#527fff"/></linearGradient></defs><path fill="url(#SVGte2wIbLN)" d="M0 0h256v256H0z"/><path fill="#fff" d="M144.292 57.744h-9.626v-6.457h9.626V41.6h6.417v9.687h9.625v6.457h-9.625v9.687h-6.417zm38.502 35.518h-9.625v-6.458h9.625v-9.686h6.418v9.686h9.625v6.458h-9.625v9.687h-6.418zm-16.71 102.046c-6.128-15.57-20.272-29.803-35.75-35.973c15.478-6.167 29.622-20.4 35.75-35.973c6.129 15.573 20.272 29.806 35.747 35.973c-15.475 6.17-29.618 20.403-35.747 35.973m51.507-39.202c-22.569 0-48.298-25.893-48.298-48.605a3.22 3.22 0 0 0-3.209-3.228a3.22 3.22 0 0 0-3.208 3.228c0 22.712-25.733 48.605-48.302 48.605c-1.771 0-3.209 1.446-3.209 3.229a3.22 3.22 0 0 0 3.209 3.229c22.569 0 48.302 25.892 48.302 48.607a3.22 3.22 0 0 0 3.208 3.229a3.22 3.22 0 0 0 3.209-3.229c0-22.715 25.73-48.607 48.298-48.607a3.22 3.22 0 0 0 3.209-3.23a3.22 3.22 0 0 0-3.209-3.228M41.617 92.49c9.344 6.84 27.498 10.459 44.92 10.459s35.577-3.62 44.92-10.459v30.927c-4.623 6.186-21.626 12.282-44.278 12.282c-26.076 0-45.562-8.201-45.562-15.534zm44.92-25.059c27.831 0 44.92 8.463 44.92 14.53s-17.089 14.53-44.92 14.53s-44.92-8.463-44.92-14.53s17.089-14.53 44.92-14.53m44.92 121.183c0 7.443-19.216 15.77-44.936 15.77c-25.7 0-44.904-8.327-44.904-15.77v-20.632c9.459 7.22 27.976 11.042 45.745 11.042c12.356 0 24.305-1.756 33.632-4.946l-2.06-6.116c-8.682 2.968-19.896 4.605-31.572 4.605c-26.182 0-45.745-8.202-45.745-15.535v-25.898c9.433 7.206 27.87 11.023 45.562 11.023c18.956 0 35.214-3.93 44.278-10.152v9.69h6.417V81.961c0-13.632-26.448-20.988-51.337-20.988c-23.875 0-49.123 6.787-51.138 19.374H35.2v108.267c0 14.436 26.442 22.228 51.321 22.228c24.895 0 51.353-7.792 51.353-22.228v-11.401h-6.417z"/></svg>',awsglacier:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVG7R6tZwZW" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1b660f"/><stop offset="100%" stop-color="#6cae3e"/></linearGradient></defs><path fill="url(#SVG7R6tZwZW)" d="M0 0h256v256H0z"/><path fill="#fff" d="M48.212 66.919C50.91 76.375 82.075 86.4 123.202 86.4c41.055 0 72.185-9.99 74.972-19.433l.205-1.44C198.145 61.312 173.966 44.8 123.2 44.8c-50.774 0-74.947 16.516-75.18 20.73zm147.69 61.686l-1.226 8.65c10.752 2.646 12.682 1.03 12.701 1.014c.003-.077-.144-2.883-11.475-9.664m-49.731 81.18l.806 6.35c-7.67.973-15.677 1.465-23.795 1.465c-24.426 0-63.1-5.41-63.53-19.913L41.9 68.01q-.215-.936-.263-1.907l-.01-.067h.004c-.006-.148-.029-.288-.029-.436c0-11.09 31.786-27.2 81.6-27.2c49.811 0 81.6 16.11 81.6 27.2c0 .15-.029.298-.035.448h.003l-.006.032a10.7 10.7 0 0 1-.291 2.055l-7.604 53.638c10.71 6.112 15.965 10.887 16.794 15.315c.365 1.956-.118 3.79-1.392 5.31c-1.555 1.849-4.115 2.77-7.898 2.77c-2.819 0-6.332-.521-10.601-1.542l-.41 2.893l-6.336-.896l.522-3.687c-19.728-5.827-46.79-18.156-59.78-24.304c-1.334 1.108-3.02 1.799-4.883 1.799c-4.236 0-7.686-3.45-7.686-7.69s3.45-7.69 7.686-7.69c4.24 0 7.69 3.45 7.69 7.69c0 .045-.013.09-.013.135c11.04 5.212 38.314 17.728 57.895 23.65l8.156-57.532c-14.14 9.683-44.435 14.806-73.41 14.806c-29.028 0-59.37-5.139-73.48-14.85L66.02 197.007q.03.218.03.436c0 4.85 21.692 13.756 57.132 13.756c7.85 0 15.587-.476 22.989-1.414m58.521-24.604l7.588 7.584l-4.528 4.525l-8.49-8.49h-15.21l7.23 12.535l12.198 3.433l-1.735 6.157l-10.157-2.857l-2.774 10.361l-6.182-1.657l3.222-12.036l-7.533-13.065l-7.433 12.854l3.126 12.285l-6.198 1.578l-2.605-10.224l-10.359 2.774l-1.654-6.182l12.029-3.223l7.366-12.733h-15.005l-8.732 8.519l-4.468-4.583l7.556-7.37l-7.584-7.583l4.524-4.525l9.14 9.142h14.947l-7.629-13.193l-12.182-3.427l1.73-6.16l10.16 2.857l2.775-10.358l6.183 1.657l-3.23 12.055l7.543 13.043L185.745 166l-3.123-12.265l6.198-1.578l2.608 10.227l10.356-2.774l1.657 6.18l-12.05 3.228l-7.713 13.382h14.7l9.402-9.17l4.47 4.582z"/></svg>',k8spod:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><path fill="#fff" fill-rule="evenodd" d="m5.397 6.213l3.62-1.05l3.621 1.05l-3.62 1.05Zm0 .402v3.853l3.373 1.869l.017-4.713zm7.241 0v3.853l-3.373 1.869l-.017-4.713z"/></svg>',k8sdeploy:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g fill="#fff" fill-rule="evenodd" stroke-linecap="square" stroke-miterlimit="10" stroke-width=".265"><path d="M8.578 13.192a4.446 4.446 0 1 1 4.227-4.728l-1.757.113a2.685 2.685 0 1 0-2.553 2.856z"/><path d="m9.489 8.469l1.397 3.42l3.226-3.42z"/></g></svg>',k8ssvc:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g fill-rule="evenodd" stroke-miterlimit="10"><path fill="#fff" d="M3.594 10.756h2.908v2.041H3.594zm3.969 0h2.908v2.041H7.563zm3.968 0h2.909v2.041h-2.91zM6.713 4.703h4.608v2.042H6.713z"/><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".529" d="M9.017 6.745V8.75H5.05v2.003m3.967-4.008V8.75h3.967v2.003"/><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".529" d="M9.009 6.746v2.006h.016v2.003"/></g></svg>',k8sing:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><path fill="#fff" d="M11.765 12.823h-2.27L4.572 6.667H3.15V4.652h2.314l4.923 6.156h1.378V9.215l3.12 2.6l-3.12 2.602zM9.289 8.068l1.098-1.376h1.378v1.594l3.12-2.6l-3.12-2.602v1.594h-2.27L8.036 6.502zM5.69 9.433l-1.118 1.4H3.15v2.015h2.314L6.943 11z"/></svg>',k8scm:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-miterlimit="10" stroke-width=".794" d="M7.362 5.575h5.825m-8.339 0h1.458m3.173 2.117h3.708m-6.222 0h1.458m1.056 2.117h3.708m-6.222 0h1.458m-1.061 2.116h5.825m-8.339 0h1.458"/></svg>',k8ssecret:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g stroke-miterlimit="10" transform="translate(-.936 -.399)"><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".794" d="M10.414 8.091h3.709M8.298 5.975h5.825m-8.339 0h1.458"/><path fill="#fff" fill-rule="evenodd" stroke="#326ce5" stroke-linecap="square" stroke-width=".265" d="M7.718 8.432h0c0-1.167 1.011-2.112 2.259-2.112s2.258.945 2.258 2.112h-1.056h0c0-.583-.538-1.056-1.202-1.056s-1.202.473-1.202 1.056z"/><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".794" d="M10.414 10.208h3.709m-5.825 2.117h5.825m-8.339 0h1.458"/><path fill="#fff" fill-rule="evenodd" stroke="#326ce5" stroke-linecap="square" stroke-width=".265" d="M7.162 8.37h5.617v3.657H7.162z"/><circle cx="9.971" cy="10.198" r=".555" fill="#326ce5"/></g></svg>',k8sns:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.957.463a1.136 1.126 0 0 0-.434.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118a1.199 1.19 0 0 0-.582-.117m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424L.722 11.504a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><path fill="none" stroke="#fff" stroke-dasharray=".8 .4" stroke-dashoffset="3.44" stroke-linejoin="round" stroke-miterlimit="10" stroke-width=".4" d="M5.18 5.405h7.674v6.69H5.18z"/></svg>',k8spv:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g fill-rule="evenodd" stroke-miterlimit="10" stroke-width=".265"><path fill="#fff" d="M4.388 7.23c0 .62 2.073 1.124 4.63 1.124s4.628-.503 4.628-1.124v3.042c0 .621-2.072 1.125-4.629 1.125s-4.629-.504-4.629-1.125z"/><path fill="#fff" d="M4.388 7.23c0-.622 2.073-1.125 4.63-1.125s4.628.503 4.628 1.125c0 .62-2.072 1.124-4.629 1.124S4.388 7.851 4.388 7.23"/><path fill="none" stroke="#326ce5" stroke-linejoin="round" d="M13.646 7.23c0 .62-2.072 1.124-4.629 1.124S4.388 7.851 4.388 7.23s2.073-1.125 4.63-1.125s4.628.503 4.628 1.125v3.042c0 .621-2.072 1.125-4.629 1.125s-4.629-.504-4.629-1.125V7.23"/></g></svg>',k8ssts:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.993.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.538 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.544.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.99.001a1.199 1.19 0 0 0-.46.117L2.26 3.114a1.199 1.19 0 0 0-.649.806L.065 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006L16.49 3.92a1.199 1.19 0 0 0-.649-.806L9.572.118A1.199 1.19 0 0 0 8.99 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.558.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g fill-rule="evenodd" stroke-miterlimit="10"><path fill="none" stroke="#fff" stroke-dasharray="1.587 1.587" stroke-dashoffset="3.667" stroke-linecap="square" stroke-linejoin="round" stroke-width=".529" d="M7.329 5.047h6.525V9.63H7.329z"/><path fill="#326ce5" stroke="#fff" stroke-dasharray="1.587 1.587" stroke-dashoffset="3.879" stroke-linecap="square" stroke-linejoin="round" stroke-width=".529" d="M5.79 6.458h6.525v4.584H5.79z"/><path fill="#fff" d="M4.252 7.87h6.525v4.583H4.252z"/><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".529" d="M4.252 7.87h6.525v4.583H4.252z"/><path fill="#fff" d="M4.785 9.144c0-.43 1.222-.777 2.729-.777s2.73.348 2.73.777s-1.223.778-2.73.778s-2.73-.349-2.73-.778"/><path fill="none" d="M10.243 9.144c0 .43-1.222.778-2.73.778c-1.506 0-2.728-.349-2.728-.778s1.222-.777 2.729-.777s2.73.348 2.73.777v2.103c0 .43-1.223.778-2.73.778s-2.73-.348-2.73-.778V9.144"/><path fill="none" stroke="#326ce5" stroke-linejoin="round" stroke-width=".529" d="M10.243 9.144c0 .43-1.222.778-2.73.778c-1.506 0-2.728-.349-2.728-.778s1.222-.777 2.729-.777s2.73.348 2.73.777v2.103c0 .43-1.223.778-2.73.778s-2.73-.348-2.73-.778V9.144"/></g></svg>',gcpcomputeengine:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#aecbfa" d="M9 9h6v6H9z"/><path fill="#669df6" d="M11 2h2v4h-2zM7 2h2v4H7zm8 0h2v4h-2z"/><path fill="#4285f4" d="M11 18h2v4h-2zm-4 0h2v4H7zm8 0h2v4h-2zm3-5v-2h4v2zm0 4v-2h4v2zm0-8V7h4v2z"/><path fill="#669df6" d="M2 13v-2h4v2zm0 4v-2h4v2zm0-8V7h4v2z"/><path fill="#aecbfa" d="M5 5v14h14V5Zm12 12H7V7h10Z"/><path fill="#669df6" d="M9 15h6l-3-3z"/><path fill="#4285f4" d="m12 12l3 3V9z"/></svg>',gcpcloudstorage:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#aecbfa" d="M2 4h20v7H2z"/><path fill="#669df6" d="M20 4h2v7h-2z"/><path fill="#4285f4" d="M22 4h-2v7z"/><path fill="#669df6" d="M2 4h2v7H2z"/><path fill="#fff" d="M6 7h6v1H6z"/><rect width="3" height="3" x="15" y="6" fill="#fff" rx="1.5"/><path fill="#aecbfa" d="M2 13h20v7H2z"/><path fill="#669df6" d="M20 13h2v7h-2z"/><path fill="#4285f4" d="M22 13h-2v7z"/><path fill="#669df6" d="M2 13h2v7H2z"/><path fill="#fff" d="M6 16h6v1H6z"/><rect width="3" height="3" x="15" y="15" fill="#fff" rx="1.5"/></svg>',gcpcloudfunctions:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#669df6" d="M2 15.56L5 18V6L2 8.43z"/><path fill="#4285f4" d="m2 10l3-2V6zm3 8v-2l-3-2z"/><path fill="#aecbfa" d="m8 20l-6-6v4l4 4zM5.99 2.01L2 6l.01 4l5.98-5.99z"/><path fill="#669df6" d="m22 8.45l-3-2.44v12l3-2.42z"/><path fill="#4285f4" d="m22 14.01l-3 2v2zm-3-8v2l3 2z"/><path fill="#aecbfa" d="m16 4.01l6 6v-4l-4-4zM18.01 22L22 18.01l-.01-4L16.01 20z"/><circle cx="8" cy="12" r="1" fill="#aecbfa"/><circle cx="12" cy="12" r="1" fill="#aecbfa"/><circle cx="15.99" cy="12" r="1" fill="#aecbfa"/></svg>',gcpbigquery:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill-rule="evenodd"><path fill="#aecbfa" d="M6.73 10.83v2.63a4.9 4.9 0 0 0 1.71 1.74v-4.37Z"/><path fill="#669df6" d="M9.89 8.41v7.53A8 8 0 0 0 11 16a8 8 0 0 0 1 0V8.41Z"/><path fill="#aecbfa" d="M13.64 11.86v3.29a5 5 0 0 0 1.7-1.82v-1.47Z"/><path fill="#4285f4" d="m17.74 16.32l-1.42 1.42a.42.42 0 0 0 0 .6l3.54 3.54a.42.42 0 0 0 .59 0l1.43-1.43a.42.42 0 0 0 0-.59l-3.54-3.54a.42.42 0 0 0-.6 0"/><path fill="#669df6" d="M11 2a9 9 0 1 0 9 9a9 9 0 0 0-9-9m0 15.69A6.68 6.68 0 1 1 17.69 11A6.68 6.68 0 0 1 11 17.69"/></g></svg>',gcpcloudsql:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill-rule="evenodd"><path fill="#aecbfa" d="M4.67 10.44v3.01l7.33 3.9v-3.01zm0 4.65v3.01L12 22v-3.01z"/><path fill="#669df6" d="m12 17.35l7.33-3.9v-3.01L12 14.34zM12 22l7.33-3.9v-3.01L12 18.99z"/><path fill="#4285f4" d="M19.33 8.91V5.9L12 2v3.01z"/><path fill="#669df6" d="M12 2L4.67 5.9v3.01L12 5.01z"/><path fill="#aecbfa" d="M4.67 5.87v3.02l7.33 3.9V9.77z"/><path fill="#669df6" d="m12 12.79l7.33-3.9V5.87L12 9.77z"/></g></svg>',gcpcloudrun:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill-rule="evenodd"><path fill="#aecbfa" d="M8.9 2.63L12.02 12h9.36z"/><path fill="#4285f4" d="M21.38 12h-9.36L8.9 21.38zM3.44 21.38l3.13-1.57L8.9 12H5.78z"/><path fill="#aecbfa" d="M3.44 2.63L5.78 12H8.9L6.57 4.19z"/></g></svg>',gcpappengine:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill-rule="evenodd"><path fill="#4285f4" d="m14.3 10l-1.22 1.22A1.71 1.71 0 0 1 12 14.23a1.74 1.74 0 0 1-1.33-.64l-1.22 1.22A3.43 3.43 0 1 0 14.3 10"/><path fill="#aecbfa" d="M12 6.26a6.25 6.25 0 1 0 6.25 6.25A6.25 6.25 0 0 0 12 6.26M12 17a4.45 4.45 0 1 1 4.44-4.44A4.44 4.44 0 0 1 12 17"/><path fill="#669df6" d="m21.62 11.9l-2.56-.81a7 7 0 0 1 .17 1.53a8 8 0 0 1-.08 1.08h2.47a.44.44 0 0 0 .38-.42v-1a.44.44 0 0 0-.38-.42M12 5.52a7.5 7.5 0 0 1 1.5.15l-.92-2.55c-.07-.22-.21-.38-.42-.38h-.38a.45.45 0 0 0-.42.38l-.8 2.54A7.6 7.6 0 0 1 12 5.52m-7.23 7.1a7 7 0 0 1 .17-1.53l-2.56.81a.44.44 0 0 0-.38.42v1a.44.44 0 0 0 .38.42h2.47a8 8 0 0 1-.08-1.08"/><path fill="#aecbfa" d="M12 10a2.5 2.5 0 1 0 2.5 2.5A2.5 2.5 0 0 0 12 10m0 3.75a1.25 1.25 0 1 1 1.25-1.25A1.25 1.25 0 0 1 12 13.76Z"/></g></svg>',gcpcloudloadbalancing:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path fill="#669df6" d="M18 12h2v4h-2zm-7 0h2v4h-2zm-7 0h2v4H4z"/><path fill="#4285f4" d="M13 11h-2V7h2z"/><path fill="#669df6" d="M4 11h16v2H4z"/><path fill="#aecbfa" d="M6 2h12v5H6z"/><path fill="#669df6" d="M12 2h6v5h-6z"/><path fill="#aecbfa" d="M16 16h6v6h-6zM2 16h6v6H2z"/><path fill="#669df6" d="M5 16h3v6H5z"/><path fill="#aecbfa" d="M9 16h6v6H9z"/><path fill="#669df6" d="M12 16h3v6h-3zm7 0h3v6h-3z"/></svg>'};var ki=(function(){var L={compute:["#C8511B","#FF9900"],storage:["#1B660F","#6CAE3E"],database:["#2E27AD","#527FFF"],net:["#4D27A8","#A166FF"],integ:["#B0084D","#FF4F8B"],mgmt:["#B0084D","#FF4F8B"],sec:["#BD0816","#FF5252"],analytics:["#4D27A8","#A166FF"],ml:["#055F4E","#56C0A7"]},j={ec2:["ec2",L.compute],lambda:["lambda",L.compute],ecs:["ecs",L.compute],eks:["eks",L.compute],fargate:["fargate",L.compute],s3:["s3",L.storage],glacier:["glacier",L.storage],rds:["rds",L.database],dynamodb:["dynamodb",L.database],aurora:["aurora",L.database],redshift:["redshift",L.analytics],vpc:["virtual_private_cloud",L.net],cloudfront:["cloudfront",L.net],elb:["elastic_load_balancing",L.net],route53:["route_53",L.net],apigateway:["api_gateway",L.integ],sqs:["sqs",L.integ],sns:["sns",L.integ],eventbridge:["eventbridge",L.integ],stepfunctions:["step_functions",L.integ],cloudwatch:["cloudwatch",L.mgmt],iam:["identity_and_access_management",L.sec],secretsmanager:["secrets_manager",L.sec],kinesis:["kinesis",L.analytics],athena:["athena",L.analytics],glue:["glue",L.analytics],sagemaker:["sagemaker",L.ml]},P={computeengine:"compute_engine",compute:"compute_engine",cloudstorage:"cloud_storage",storage:"cloud_storage",cloudfunctions:"cloud_functions",functions:"cloud_functions",bigquery:"bigquery",cloudsql:"cloud_sql",sql:"cloud_sql",cloudrun:"cloud_run",run:"cloud_run",appengine:"app_engine",cloudloadbalancing:"cloud_load_balancing"},E={pod:"pod",deployment:"deploy",deploy:"deploy",service:"svc",svc:"svc",ingress:"ing",ing:"ing",configmap:"cm",cm:"cm",secret:"secret",namespace:"ns",ns:"ns",node:"node",persistentvolume:"pv",pv:"pv",statefulset:"sts",sts:"sts"},w={virtualmachine:"virtual_machine",vm:"virtual_machine",sqldatabase:"sql_database",virtualnetwork:"virtual_network",vnet:"virtual_network"},p={github:"github",mongodb:"mongodb"};function s(f){var u=f.indexOf(":");return u>=0?{pack:f.substring(0,u),icon:f.substring(u+1)}:{pack:"",icon:f}}function o(f){return f.replace(/[-_\s]/g,"")}function v(f){if(!f)return null;var u=s(String(f).toLowerCase().trim()),r=u.pack,h=u.icon;if(r==="aws"||r==="aws-icons"||/^(aws|amazon)[-_]/.test(h)){var d=o(h.replace(/^(aws|amazon)[-_]/,""));if(In["aws"+d])return{kind:"svg",svg:In["aws"+d]};var n=j[d];if(n)return{kind:"stencil",style:"shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4."+n[0]+";fillColor="+n[1][0]+";gradientColor="+n[1][1]+";gradientDirection=north;strokeColor=#FFFFFF;"}}if(r==="gcp"||r==="gcp-icons"||/^(google-cloud|gcp)[-_]/.test(h)){var y=o(h.replace(/^(google-cloud|gcp)[-_]/,"")),b=P[y];if(b&&In["gcp"+o(b)])return{kind:"svg",svg:In["gcp"+o(b)]};if(b)return{kind:"stencil",style:"shape=mxgraph.gcp2."+b+";fillColor=#4285F4;strokeColor=none;"}}if(r==="kubernetes"||r==="k8s"||/^(kubernetes|k8s)[-_]/.test(h)){var T=o(h.replace(/^(kubernetes|k8s)[-_]/,"")),I=E[T];if(I&&In["k8s"+I])return{kind:"svg",svg:In["k8s"+I]};if(I)return{kind:"stencil",style:"shape=mxgraph.kubernetes."+I+";fillColor=#326CE5;strokeColor=none;"}}if(r==="azure"||/^(microsoft-azure|azure)[-_]/.test(h)){var F=o(h.replace(/^(microsoft-azure|azure)[-_]/,"")),X=w[F];if(X)return{kind:"stencil",style:"shape=mxgraph.azure."+X+";fillColor=#0078D4;strokeColor=none;"}}var Z=o(h);if(p[Z])return{kind:"stencil",style:"shape=mxgraph.weblogos."+p[Z]+";"};if(In[Z])return{kind:"svg",svg:In[Z]};var ot=o(h.replace(/-icon$/,""));return In[ot]?{kind:"svg",svg:In[ot]}:null}function M(f){return v(f)!=null}return{resolve:v,isSupported:M}})();var Oa=(function(){var L={default:{node:{fill:"light-dark(#ECECFF,#1f2020)",stroke:"light-dark(#9370DB,#cccccc)",font:"light-dark(#333333,#cccccc)"},subgraph:{fill:"light-dark(#ffffde,#1f2020)",stroke:"light-dark(#aaaa33,#cccccc)",fillOpacity:50,strokeOpacity:20},state:{dark:"light-dark(#333333,#cccccc)",inner:"light-dark(#ffffff,#1f2020)"},edge:"light-dark(#333333,#cccccc)"},neutral:{node:{fill:"#eeeeee",stroke:"#999999",font:"#333333"},subgraph:{fill:"#ffffff",stroke:"#bbbbbb"},state:{dark:"#333333",inner:"#ffffff"},edge:"#333333"},dark:{node:{fill:"#1f2020",stroke:"#81B1DB",font:"#cccccc"},subgraph:{fill:"#3f3f3f",stroke:"#cccccc"},state:{dark:"#cccccc",inner:"#1f2020"},edge:"#cccccc"},forest:{node:{fill:"#cde498",stroke:"#13540c",font:"#333333"},subgraph:{fill:"#cdffb2",stroke:"#6eaa49"},state:{dark:"#333333",inner:"#ffffff"},edge:"#13540c",seq:{actorStroke:"#a6cf47",signal:"#333333",labelBoxFill:"#cde498",labelBoxStroke:"#326932"}}},j={fillColor:L.default.node.fill,strokeColor:L.default.node.stroke,fontColor:L.default.node.font,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif",fontSize:16},P={fillColor:L.default.subgraph.fill,strokeColor:L.default.subgraph.stroke,fillOpacity:L.default.subgraph.fillOpacity,strokeOpacity:L.default.subgraph.strokeOpacity},E={fillColor:L.default.node.fill,strokeColor:L.default.node.stroke,darkColor:L.default.state.dark,innerFillColor:L.default.state.inner},w=L.default.edge,p={actorFill:null,actorStroke:null,actorFont:null,lifelineColor:"light-dark(#9370DB,#cccccc)",activationFill:"light-dark(#f4f4f4,#2a2a2a)",activationStroke:"light-dark(#666666,#cccccc)",noteFill:"light-dark(#fff5ad,#2a2a2a)",noteStroke:"light-dark(#aaaa33,#cccccc)",noteFont:null,signalColor:null,signalTextColor:null,labelBoxFill:"light-dark(#ECECFF,#1f2020)",labelBoxStroke:"light-dark(#9370DB,#cccccc)",loopFont:null};function s(e){var x=e&&e.theme||"default",C=L[x]||L.default,S=e&&e.themeVariables||{},Y=S.primaryColor||C.node.fill,D=S.primaryBorderColor||C.node.stroke,At=S.primaryTextColor||C.node.font,U=S.clusterBkg||S.secondaryColor||C.subgraph.fill,q=S.clusterBorder||S.secondaryBorderColor||C.subgraph.stroke,rt=S.lineColor||C.edge;j.fillColor=Y,j.strokeColor=D,j.fontColor=At,P.fillColor=U,P.strokeColor=q;var ct=S.clusterBkg||S.secondaryColor,nt=S.clusterBorder||S.secondaryBorderColor;P.fillOpacity=ct!=null?null:C.subgraph.fillOpacity,P.strokeOpacity=nt!=null?null:C.subgraph.strokeOpacity,E.fillColor=Y,E.strokeColor=D,E.darkColor=C.state.dark,E.innerFillColor=C.state.inner,wr[x]?qr=wr[x]:qr=wr.default,w=rt;var zt=C.seq||{},Ot=S.actorBkg||S.mainBkg||null,Ft=S.actorBorder||null,Pt=Ot||zt.actorFill||null,Wt=Ft||zt.actorStroke||null,Kt=S.actorTextColor||null,Bt=S.textColor||null;p.actorFill=Pt,p.actorStroke=Wt,p.actorFont=Kt,p.lifelineColor=S.actorLineColor||Wt||"light-dark(#9370DB,#cccccc)",p.activationFill=S.activationBkgColor||"light-dark(#f4f4f4,#2a2a2a)",p.activationStroke=S.activationBorderColor||"light-dark(#666666,#cccccc)",p.noteFill=S.noteBkgColor||"light-dark(#fff5ad,#2a2a2a)",p.noteStroke=S.noteBorderColor||"light-dark(#aaaa33,#cccccc)",p.noteFont=S.noteTextColor||null,p.signalColor=S.signalColor||Bt||zt.signal||null,p.signalTextColor=S.signalTextColor||Bt||zt.signal||null,p.labelBoxFill=S.labelBoxBkgColor||Ot||zt.labelBoxFill||"light-dark(#ECECFF,#1f2020)",p.labelBoxStroke=S.labelBoxBorderColor||Ft||zt.labelBoxStroke||"light-dark(#9370DB,#cccccc)",p.loopFont=S.loopTextColor||Kt||null}function o(){return(p.actorFill?"fillColor="+p.actorFill+";":"")+(p.actorStroke?"strokeColor="+p.actorStroke+";":"")+(p.actorFont?"fontColor="+p.actorFont+";":"")}function v(){var e=new Graph;return e.setExtendParents(!1),e.setExtendParentsOnAdd(!1),e.setConstrainChildren(!1),e.setHtmlLabels(!0),e.getModel().maintainEdgeParent=!1,e}function M(e){if(e==null)return e;var x=String(e).replace(/\s+/g,"").toLowerCase();return/^(javascript|vbscript|data):/.test(x)?"":e}function f(e){if(e==null)return"";var x=String(e).replace(/[;\r\n]+/g,""),C=x.replace(/\s+/g,"").toLowerCase();return/^(javascript|vbscript):/.test(C)?"":x}function u(e,x,C){if(e==null)return"";if(Array.isArray(e)){for(var S=[],Y=0;Y<e.length;Y++)S.push(u(e[Y],null,C));return S.join(`
+A`,s,s,0,p.large?1:0,p.sweep?1:0,E(p.p1.x),E(p.p1.y))}return w.join(" ")}function dh(L,j={}){let{lossFunction:P,layoutFunction:E=Rg,normalize:w=!0,orientation:p=Math.PI/2,orientationOrder:s,width:o=600,height:d=350,padding:M=15,scaleToFit:f=!1,symmetricalTextCentre:u=!1,distinct:r,round:h=2}=j,v=E(L,{lossFunction:P==="default"||!P?Ki:P==="logRatio"?Vg:P,distinct:r});w&&(v=qg(v,p,s));let n=$g(v,o,d,M,f),y=Zg(n,L,u),b=new Map(Object.keys(n).map(F=>[F,{set:F,x:n[F].x,y:n[F].y,radius:n[F].radius}])),T=L.map(F=>{let X=F.sets.map(pt=>b.get(pt)),K=Qg(X),ot=Jg(K,h);return{circles:X,arcs:K,path:ot,area:F,has:new Set(F.sets)}});function I(F){let X="";for(let K of T)K.has.size>F.length&&F.every(ot=>K.has.has(ot))&&(X+=" "+K.path);return X}return T.map(({circles:F,arcs:X,path:K,area:ot})=>({data:ot,text:y[ot.sets],circles:F,arcs:X,path:K,distinctPath:K+I(ot.sets)}))}(function(){var L=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:null;L&&typeof L.structuredClone!="function"&&(L.structuredClone=function j(P){if(P===null||typeof P!="object")return P;if(P instanceof Date)return new Date(P.getTime());if(Array.isArray(P)){for(var E=[],w=0;w<P.length;w++)E[w]=j(P[w]);return E}var p={};for(var s in P)Object.prototype.hasOwnProperty.call(P,s)&&(p[s]=j(P[s]));return p})})();function t2(){var L=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{};if(typeof L.ELK!="function")throw new Error("ELK engine not available on globalThis.ELK \u2014 load drawio-elk.min.js before drawio-mermaid.min.js");return L.ELK}var xi=(function(){var L={rect:{h:60,v:35,minW:0,minH:0},rounded:{h:30,v:35,minW:0,minH:0},diamond:{h:0,v:0,minW:50,minH:50,scale:1.6},circle:{h:0,v:0,minW:40,minH:40,isCircle:!0,circleExtra:30},doublecircle:{h:0,v:0,minW:50,minH:50,isCircle:!0,circleExtra:40},stadium:{h:24,v:15,minW:60,minH:39},subroutine:{h:32,v:15,minW:60,minH:39},cylinder:{h:15,v:43,minW:50,minH:67},hexagon:{h:34,v:15,minW:60,minH:39},lean_right:{h:54,v:15,minW:60,minH:39},lean_left:{h:54,v:15,minW:60,minH:39},trapezoid:{h:54,v:15,minW:60,minH:39},inv_trapezoid:{h:84,v:30,minW:60,minH:54},odd:{h:24,v:15,minW:60,minH:39},group:{h:20,v:40,minW:0,minH:0},class_box:{h:20,v:16,minW:100,minH:50},erdEntity:{h:20,v:30,minW:100,minH:50},start:{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},end:{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},stateStart:{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},stateEnd:{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},"sm-circ":{h:0,v:0,minW:14,minH:14,isCircle:!0,noLabel:!0},choice:{h:0,v:0,minW:28,minH:28,noLabel:!0},bolt:{h:0,v:0,minW:30,minH:50,noLabel:!0},fork:{h:0,v:0,minW:70,minH:10,noLabel:!0},join:{h:0,v:0,minW:70,minH:10,noLabel:!0},stateDivider:{h:0,v:0,minW:200,minH:6,noLabel:!0},text:{h:16,v:12,minW:40,minH:30},note:{h:16,v:8,minW:60,minH:32,maxTextWidth:200},"manual-file":{h:40,v:50,minW:100,minH:120,squareByWidth:!0},"manual-input":{h:30,v:0,minW:60,minH:50,slopedHeight:!0},docs:{h:50,v:78,minW:80,minH:100},procs:{h:40,v:40,minW:70,minH:70},"paper-tape":{h:16,v:40,minW:60,minH:70},"flip-tri":{h:40,v:50,minW:100,minH:120,squareByWidth:!0}},j={h:16,v:8,minW:50,minH:32};function P(g,tt){var B=tt&&tt.fontSize||16,Z=tt&&tt.fontFamily||'"trebuchet ms",verdana,arial,sans-serif';E(g.children,B,Z)}function E(g,tt,B){if(g)for(var Z=0;Z<g.length;Z++){var H=g[Z];if(H.drawio&&H.drawio.isSubgraph){if(H.drawio.labelText){var yt=o(H.drawio.labelText,tt,B);H.layoutOptions=H.layoutOptions||{},H.layoutOptions["elk.padding"]||(H.layoutOptions["elk.padding"]="[top=35,left=10,bottom=10,right=10]")}E(H.children,tt,B);continue}var ut=H.drawio?H.drawio.shape:"rect",ht=L[ut]||j;if(H.drawio&&H.drawio.isStateDiagram&&!ht.noLabel&&!ht.isCircle&&ut!=="fork"&&ut!=="join"&&ut!=="choice"&&ut!=="note"&&(ht={h:16,v:16,minW:30,minH:40}),H.drawio&&H.drawio.mindmap&&!ht.isCircle&&!ht.noLabel){var bt=1.25;ut==="mindmapBang"?ht={h:63,v:50,minW:80,minH:80,maxTextWidth:200,widthScale:1.25,heightScale:1.25*bt}:ut==="cloud"?ht={h:16,v:0,minW:60,minH:70,maxTextWidth:200,widthScale:1.6,heightScale:bt,cloudHeight:!0}:ut==="roundedRect"?H.drawio.mindmapLine?ht={h:40,v:10,minW:39,minH:34,maxTextWidth:200,heightScale:bt}:ht={h:30,v:30,minW:39,minH:34,maxTextWidth:200,heightScale:bt}:ut==="hexagon"?ht={h:42,v:20,minW:39,minH:44,maxTextWidth:200,heightScale:bt}:ut==="rect"?ht={h:40,v:20,minW:39,minH:34,maxTextWidth:200,heightScale:bt}:ht={h:40,v:10,minW:39,minH:34,maxTextWidth:200,heightScale:bt}}else H.drawio&&H.drawio.mindmap&&ht.isCircle&&!ht.noLabel&&(ht={h:0,v:0,minW:40,minH:40,isCircle:!0,circleExtra:20,maxTextWidth:160});if((ut==="icon"||ut==="iconSquare"||ut==="iconCircle"||ut==="iconRounded"||ut==="imageSquare")&&H.drawio){var Nt=H.drawio.assetH||48,Dt=H.drawio.assetW||48,st=ut==="iconSquare"||ut==="iconCircle"||ut==="iconRounded"?8:0,Lt=Math.max(Nt,Dt),ft=Lt+st,yt=H.drawio.labelText?o(H.drawio.labelText,tt,B):{width:0,height:0},Ct=0;H.width=Math.max(ft,yt.width),H.height=ft+yt.height+Ct,H.drawio.iconLayout={iconSize:Lt,boxW:ft,boxH:ft,labelH:yt.height,labelW:yt.width,labelPad:Ct,topLabel:H.drawio.pos==="t"};continue}if(ut==="lollipopInterface"){var Xt=H.drawio.labelText||"",St=.56,Zt=16;H.width=Math.max(24,Math.ceil(Xt.length*Zt*St)+6),H.height=36;continue}if(ut==="class_box"&&H.drawio&&H.drawio.classData){for(var G=H.drawio.classData,dt=G.members||[],oe=G.methods||[],ae=G.annotations||[],fe=24,ne=48+ae.length*fe,ye=G.hideEmptyMembersBox&&dt.length===0&&oe.length===0,Mt=dt.length===0&&oe.length===0,$t=Mt?18:24,Jt=ye?0:dt.length===0?$t:fe*(dt.length+1),e=ye?0:oe.length===0?$t:fe*(oe.length+1),x=H.drawio.labelText||"",C=x?o(x,tt,B).width:0,S=0,Y=0;Y<ae.length;Y++){var D="\xAB"+String(ae[Y])+"\xBB",At=o(D,tt,B).width;At>S&&(S=At)}for(var U=0,Y=0;Y<dt.length;Y++){var q=o(String(dt[Y]),tt,B).width;q>U&&(U=q)}for(var Y=0;Y<oe.length;Y++){var q=o(String(oe[Y]),tt,B).width;q>U&&(U=q)}var rt=Math.max(C,S),ct=-rt/2,nt=Math.max(rt/2,U),zt=nt-ct,Ot=12;H.width=zt+2*Ot,H.height=ne+Jt+e,H.drawio.classLayout={rowH:fe,titleH:ne,membersH:Jt,methodsH:e,hideCompartments:ye};continue}if(ut==="erdEntity"&&H.drawio&&H.drawio.entityData){var Ft=H.drawio.entityData.attributes||[],Pt=43,We=(H.drawio.labelText||"").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/(^|[^\w])_([^_\n]+?)_(?=[^\w]|$)/g,"$1$2").replace(/`(.+?)`/g,"$1");if(Ft.length>0){for(var Wt=25,Kt=0,Bt=0,ce=0,kt=0,wt=!1,jt=!1,Y=0;Y<Ft.length;Y++){var Ht=Ft[Y].attributeType||Ft[Y].type||"",qt=Ft[Y].attributeName||Ft[Y].name||"",re=Ft[Y].attributeKeyType||"",Ut=Ft[Y].attributeKeyTypeList||Ft[Y].keys||[],ve=Ft[Y].attributeComment||Ft[Y].comment||"",we=Ut&&Ut.length>0?Ut.join():re;Kt=Math.max(Kt,o(Ht,16,B).width+Wt),Bt=Math.max(Bt,o(qt,16,B).width+Wt),we&&(wt=!0,ce=Math.max(ce,o(we,16,B).width+Wt)),ve&&(jt=!0,kt=Math.max(kt,o(ve,16,B).width+Wt))}wt||(ce=0),jt||(kt=0);var Se=Kt+Bt+ce+kt,be=o(We,16,B).width+Wt*2;H.width=Math.max(Se,be,100)}else{var be=o(We,16,B).width;H.width=Math.max(be+40,100)}H.height=Ft.length>0?(Ft.length+1)*Pt:80;continue}if((ut==="requirement"||ut==="element")&&H.drawio&&H.drawio.data){var Me=H.drawio.data,Fe=ut==="element"?Me.docRef?2:1:4,Ue=.43,De=.5,Ye="<<"+(ut==="element"?"Element":Me.type||"Requirement")+">>",Pe=(Me.name||"").replace(/[*_`]/g,""),de=Math.max(Ye.length,Pe.length)*tt*De;if(ut==="requirement")for(var Ve={low:"Low",medium:"Medium",high:"High"},Ne={analysis:"Analysis",demonstration:"Demonstration",inspection:"Inspection",test:"Test"},nr=Me.risk||"",Ge=Me.verifyMethod||Me.verifymethod||"",Ie=["ID: "+(Me.requirementId||Me.id||""),"Text: "+(Me.text||"").replace(/[*_`]/g,""),"Risk: "+(Ve[nr.toLowerCase()]||nr),"Verification: "+(Ne[Ge.toLowerCase()]||Ge)],Y=0;Y<Ie.length;Y++){var Ce=Ie[Y].length*tt*Ue;Ce>de&&(de=Ce)}else for(var Ke=["Type: "+(Me.type||""),"Doc Ref: "+(Me.docRef||"")],Y=0;Y<Ke.length;Y++){var Ce=Ke[Y].length*tt*Ue;Ce>de&&(de=Ce)}H.width=Math.max(de+20,150),H.height=68+Fe*24+20;continue}if(ht.noLabel||!H.drawio||!H.drawio.labelText){H.width=ht.minW,H.height=ht.minH;continue}var We=H.drawio.labelText||"",le=We.replace(/\s*(?:fa[bslr]?:[\w-]+|mdi:[\w-]+|bi:[\w-]+)\s*/g," ").replace(/[ \t]+/g," ").trim();le=s(le);var Ae=o(le,tt,B,ht.maxTextWidth);if(!le&&We&&(Ae={width:Math.round(tt),height:Math.round(tt*1.2)}),ht.isCircle){var Le=ht.circleExtra!==void 0?ht.circleExtra:20,Re=Math.max(Ae.width,Ae.height)+Le;Re=Math.max(Re,ht.minW),H.width=Re,H.height=Re}else if(ht.scale){var Be=Ae.width+10,je=Ae.height+10,ie=Math.max(Be,je)*ht.scale;ie=Math.max(ie,ht.minW),H.width=ie,H.height=ie}else{var fr=ht.widthScale?Ae.width*ht.widthScale:Ae.width,Ar=ht.heightScale?Ae.height*ht.heightScale:Ae.height;if(H.width=Math.max(fr+ht.h,ht.minW),H.height=Math.max(Ar+ht.v,ht.minH),ht.cloudHeight){var Lr=Ae.height+10+.44*H.width;H.height=Math.max(Lr,ht.minH)}if(ht.slopedHeight){var Ze=(Ae.height+ht.h)*1.5;H.height=Math.max(Ze,ht.minH)}if(ht.squareByWidth){var ie=Math.max(H.width,ht.minH);H.width=ie,H.height=ie}}if(H.drawio&&H.drawio.isStateDiagram&&H.drawio.labelText&&!ht.noLabel&&!ht.isCircle&&!ht.scale&&!ht.maxTextWidth){for(var dr=String(H.drawio.labelText).split(`
+`),Xe=0,br=0;br<dr.length;br++)dr[br].length>Xe&&(Xe=dr[br].length);var vr=ut==="note"?16:4,gr=Math.ceil(Xe*tt*.45)+vr;H.width<gr&&(H.width=gr)}}}function w(g,tt){var B=tt&&tt.fontSize||16,Z=tt&&tt.fontFamily||'"trebuchet ms",verdana,arial,sans-serif';p(g,B,Z)}function p(g,tt,B){var Z=50;if(g.layoutOptions&&g.layoutOptions["elk.layered.spacing.nodeNodeBetweenLayers"]&&(Z=parseFloat(g.layoutOptions["elk.layered.spacing.nodeNodeBetweenLayers"])),g.edges)for(var H=0;H<g.edges.length;H++){var yt=g.edges[H];if(yt.labels)for(var ut=0;ut<yt.labels.length;ut++){var ht=yt.labels[ut];if(ht.text&&ht.width==null&&ht.height==null){var bt=o(ht.text,tt,B),Nt=Math.max(0,Math.round(bt.width-Z));ht.width=Nt,ht.height=Math.round(bt.height+10)}}}if(g.children)for(var H=0;H<g.children.length;H++)p(g.children[H],tt,B)}function s(g){return g&&(g.length>=2&&g.charAt(0)==="`"&&g.charAt(g.length-1)==="`"&&(g=g.substring(1,g.length-1)),g=g.replace(/\*\*(.+?)\*\*/g,"$1"),g=g.replace(/__(.+?)__/g,"$1"),g=g.replace(/\*(.+?)\*/g,"$1"),g=g.replace(/(^|[^\w])_([^_\n]+?)_(?=[^\w]|$)/g,"$1$2"),g=g.replace(/`(.+?)`/g,"$1"),g)}function o(g,tt,B,Z){if(typeof mxUtils!="undefined"&&mxUtils.getSizeForString){var H=mxUtils.getSizeForString(g.replace(/\n/g,"<br>"),tt,B,null,0);if(H.width>0&&H.height>0){if(Z==null||H.width<=Z)return{width:H.width,height:H.height};var yt=mxUtils.getSizeForString(g.replace(/\n/g,"<br>"),tt,B,Z,0);return{width:yt.width,height:yt.height}}if(!/\S/.test(g))return{width:H.width,height:H.height}}for(var ut=g.split(/\n|<br\s*\/?\s*>/i),ht=0,bt=0;bt<ut.length;bt++)ht=Math.max(ht,ut[bt].length);var Nt=tt*.56,Dt=ht*Nt,st=ut.length;if(Z!=null&&Dt>Z){var Lt=Math.ceil(Dt/Z);st*=Lt,Dt=Z}return{width:Dt,height:st*tt*1.5}}function d(g,tt){var B=g.layoutOptions?g.layoutOptions["elk.algorithm"]:null;if(tt||f(B))try{return Ee(g)}catch(Z){return typeof console!="undefined"&&console.warn&&console.warn("ELK layout failed; falling back to dagre:",Z&&Z.message),u(g)}return u(g)}var M={mrtree:!0,stress:!0,force:!0,radial:!0,disco:!0,rectpacking:!0,sporeOverlap:!0,sporeCompaction:!0};function f(g){return M[g]===!0}function u(g){var tt=g.layoutOptions||{},B=tt["elk.direction"]||"DOWN",Z=parseFloat(tt["elk.spacing.nodeNode"])||50,H=parseFloat(tt["elk.layered.spacing.nodeNodeBetweenLayers"])||50,yt;switch(B){case"RIGHT":yt="LR";break;case"LEFT":yt="RL";break;case"UP":yt="BT";break;default:yt="TB";break}var ut=[],ht={};r(g,ut,ht),n(g,B,Z,H,ut,ht);var bt={},Nt={};b(g.children,bt,Nt);var Dt=[],st={};Rt(g,Dt,st);for(var Lt=!1,ft=0;ft<Dt.length;ft++){var Ct=Dt[ft],Xt=Ct.sources?Ct.sources[0]:null,St=Ct.targets?Ct.targets[0]:null;if(Xt&&bt[Xt]||St&&bt[St]){Lt=!0;break}}var Zt=pt(g,yt,Z,H,Dt,st,bt,Nt,Lt);return y(g),Zt}function r(g,tt,B){if(g.edges)for(var Z=0;Z<g.edges.length;Z++)tt.push(g.edges[Z]),B[g.edges[Z].id]=g;if(g.children)for(var Z=0;Z<g.children.length;Z++)r(g.children[Z],tt,B)}function h(g){switch(g){case"RIGHT":return"DOWN";case"LEFT":return"UP";case"DOWN":return"RIGHT";case"UP":return"LEFT";default:return"DOWN"}}function v(g,tt){if(!tt||tt.length===0)return!1;var B={};(function Nt(Dt){if(Dt)for(var st=0;st<Dt.length;st++)B[Dt[st].id]=!0,Nt(Dt[st]._frozenChildren||Dt[st].children)})(g._frozenChildren||g.children);for(var Z=0;Z<tt.length;Z++){var H=tt[Z],yt=H.sources&&H.sources[0],ut=H.targets&&H.targets[0];if(!(!yt||!ut)){var ht=!!B[yt],bt=!!B[ut];if(ht!==bt)return!0}}return!1}function n(g,tt,B,Z,H,yt){if(g.children){var ut=g.layoutOptions?g.layoutOptions["elk.direction"]:null,ht=ut,bt=g.drawio&&g.drawio.isSubgraph,Nt=bt&&g.drawio.autoDirection;if(Nt&&!v(g,H)){var Dt=h(tt);ht=Dt,g.layoutOptions=g.layoutOptions||{},g.layoutOptions["elk.direction"]=Dt}for(var st=ht||tt,Lt=0;Lt<g.children.length;Lt++)n(g.children[Lt],st,B,Z,H,yt);var ft=bt&&g.drawio&&g.drawio.isStateDiagram,Ct=!1;if(ft&&g.children.length>=4){Ct=!0;for(var Xt={},St=0;St<g.children.length;St++){var Zt=g.children[St];if(Zt.drawio&&Zt.drawio.isSubgraph){Ct=!1;break}Xt[Zt.id]=!0}if(Ct&&H)for(var G={},dt=0;dt<H.length;dt++){var oe=H[dt],ae=oe.sources&&oe.sources[0],fe=oe.targets&&oe.targets[0];if(!(!ae||!fe||!Xt[ae]||!Xt[fe])){if(G[fe+"\0"+ae]){Ct=!1;break}G[ae+"\0"+fe]=!0}}}if(!(!bt||!Ct&&(!ht||ht===tt))&&!v(g,H)){var ne;switch(st){case"RIGHT":ne="LR";break;case"LEFT":ne="RL";break;case"UP":ne="BT";break;default:ne="TB";break}var ye=Ct?50:ut?130:Z,Mt=new li.graphlib.Graph({multigraph:!0});Mt.setGraph({rankdir:ne,nodesep:B,ranksep:ye,marginx:8,marginy:8}),Mt.setDefaultEdgeLabel(function(){return{}});for(var $t={},Jt=0;Jt<g.children.length;Jt++){var e=g.children[Jt];$t[e.id]=!0,Mt.setNode(e.id,{label:e.id,width:e.width||50,height:e.height||30})}var x=[],C=[];if(H)for(var Jt=0;Jt<H.length;Jt++){var S=H[Jt];if(!S._consumedByPrePass){var Y=S.sources&&S.sources[0],D=S.targets&&S.targets[0];if(!(!Y||!D)&&!(!$t[Y]||!$t[D])){var At=S.labels&&S.labels[0]?S.labels[0].text:"",U=At?o(At,16,'"trebuchet ms",verdana,arial,sans-serif'):{width:0,height:0},q=S.drawio&&S.drawio.length||1;Mt.setEdge(Y,D,{label:At,width:U.width,height:U.height,minlen:q,labelpos:"c"},S.id),x.push({id:S.id,edge:S,v:Y,w:D}),C.push(S),S._consumedByPrePass=!0}}}if(Mt.nodeCount()!==0){li.layout(Mt);for(var rt=1/0,ct=1/0,nt=-1/0,zt=-1/0,Jt=0;Jt<g.children.length;Jt++){var e=g.children[Jt],Ot=Mt.node(e.id);if(Ot){e.x=Math.round(Ot.x-Ot.width/2),e.y=Math.round(Ot.y-Ot.height/2),e.x<rt&&(rt=e.x),e.y<ct&&(ct=e.y);var Ft=e.x+(e.width||Ot.width),Pt=e.y+(e.height||Ot.height);Ft>nt&&(nt=Ft),Pt>zt&&(zt=Pt)}}for(var Jt=0;Jt<x.length;Jt++){var Wt=x[Jt],Kt=Mt.edge({v:Wt.v,w:Wt.w,name:Wt.id});if(Kt&&Kt.points&&Kt.points.length>0){var Bt=Kt.points;Wt.edge.sections=[{startPoint:{x:Math.round(Bt[0].x),y:Math.round(Bt[0].y)},endPoint:{x:Math.round(Bt[Bt.length-1].x),y:Math.round(Bt[Bt.length-1].y)},bendPoints:Bt.slice(1,-1).map(function(ve){return{x:Math.round(ve.x),y:Math.round(ve.y)}})}]}}var ce=g.drawio&&g.drawio.isClassNamespace,kt=Ct?40:ce?35:45,wt=Ct?12:35,jt=Ct?12:ce?35:20;rt===1/0&&(rt=0,nt=0,ct=0,zt=0),g._frozenChildren=g.children,g._frozenEdges=(g.edges||[]).slice();for(var Jt=0;Jt<C.length;Jt++){var Ht=C[Jt],qt=yt?yt[Ht.id]:null;if(qt&&qt!==g&&qt.edges){var re=qt.edges.indexOf(Ht);re>=0&&qt.edges.splice(re,1)}g._frozenEdges.indexOf(Ht)<0&&g._frozenEdges.push(Ht)}g._frozenMinX=rt,g._frozenMinY=ct,g._frozenPadSide=wt,g._frozenPadTop=kt,g.children=[],g.edges=[],g.width=nt-rt+2*wt,g.height=zt-ct+kt+jt}}}}function y(g){if(g){if(g._frozenChildren){var tt=g._frozenPadSide-g._frozenMinX,B=g._frozenPadTop-g._frozenMinY;g.children=g._frozenChildren,g.edges=g._frozenEdges;for(var Z=0;Z<g.children.length;Z++){var H=g.children[Z];H.x=(H.x||0)+tt,H.y=(H.y||0)+B,y(H)}for(var Z=0;Z<g.edges.length;Z++){var yt=g.edges[Z];if(yt.sections)for(var ut=0;ut<yt.sections.length;ut++){var ht=yt.sections[ut];if(ht.startPoint&&(ht.startPoint.x+=tt,ht.startPoint.y+=B),ht.endPoint&&(ht.endPoint.x+=tt,ht.endPoint.y+=B),ht.bendPoints)for(var bt=0;bt<ht.bendPoints.length;bt++)ht.bendPoints[bt].x+=tt,ht.bendPoints[bt].y+=B}}g.drawio=g.drawio||{},g.drawio.flatLayout=!0,delete g._frozenChildren,delete g._frozenEdges,delete g._frozenMinX,delete g._frozenMinY,delete g._frozenPadSide,delete g._frozenPadTop}else if(g.children)for(var Z=0;Z<g.children.length;Z++)y(g.children[Z])}}function b(g,tt,B){if(g)for(var Z=0;Z<g.length;Z++){var H=g[Z];if(H.children&&H.children.length>0){tt[H.id]=!0,B[H.id]=[];for(var yt=0;yt<H.children.length;yt++)B[H.id].push(H.children[yt].id);b(H.children,tt,B)}}}function T(g,tt,B,Z,H,yt,ut,ht){var bt=new li.graphlib.Graph({multigraph:!0});bt.setGraph({rankdir:tt,nodesep:B,ranksep:Z,marginx:8,marginy:8}),bt.setDefaultEdgeLabel(function(){return{}}),I(bt,g.children);for(var Nt={},Dt=0;Dt<H.length;Dt++){var st=H[Dt],Lt=st.sources?st.sources[0]:null,ft=st.targets?st.targets[0]:null;if(!(!Lt||!ft)){var Ct=ut[Lt]?It(ht,Lt,"first"):Lt,Xt=ut[ft]?It(ht,ft,"first"):ft;if(Ct&&Xt&&bt.node(Ct)&&bt.node(Xt)&&Ct!==Xt){var St=st.drawio&&st.drawio.length||1,Zt=st.labels&&st.labels[0]?st.labels[0].text:"",G=Zt?o(Zt,16,'"trebuchet ms",verdana,arial,sans-serif'):{width:0,height:0};bt.setEdge(Ct,Xt,{label:Zt,width:G.width,height:G.height,minlen:St,labelpos:"c"},st.id),Nt[st.id]={v:Ct,w:Xt}}}}if(bt.nodeCount()===0)return g;li.layout(bt),gt(bt,tt),F(bt,g.children),X(g.children,ut),K(g.children,ut);for(var Dt=0;Dt<H.length;Dt++){var dt=H[Dt],oe=Nt[dt.id];if(oe){var ae=bt.edge({v:oe.v,w:oe.w,name:dt.id});if(!(!ae||!ae.points||ae.points.length===0)){var fe=ae.points;dt.sections=[{startPoint:{x:Math.round(fe[0].x),y:Math.round(fe[0].y)},endPoint:{x:Math.round(fe[fe.length-1].x),y:Math.round(fe[fe.length-1].y)},bendPoints:fe.slice(1,-1).map(function(ye){return{x:Math.round(ye.x),y:Math.round(ye.y)}})}]}}}return g}function I(g,tt){if(tt)for(var B=0;B<tt.length;B++){var Z=tt[B];Z.children&&Z.children.length>0?I(g,Z.children):g.setNode(Z.id,{label:Z.id,width:Z.width||0,height:Z.height||0})}}function F(g,tt){if(tt)for(var B=0;B<tt.length;B++){var Z=tt[B];if(Z.children&&Z.children.length>0)F(g,Z.children);else{var H=g.node(Z.id);H&&(Z.x=Math.round(H.x-H.width/2),Z.y=Math.round(H.y-H.height/2))}}}function X(g,tt){if(g)for(var B=0;B<g.length;B++){var Z=g[B];if(!(!tt[Z.id]||!Z.children)){X(Z.children,tt);for(var H=1/0,yt=1/0,ut=-1/0,ht=-1/0,bt=0;bt<Z.children.length;bt++){var Nt=Z.children[bt],Dt=Nt.x||0,st=Nt.y||0;H=Math.min(H,Dt),yt=Math.min(yt,st),ut=Math.max(ut,Dt+(Nt.width||0)),ht=Math.max(ht,st+(Nt.height||0))}if(H!==1/0){var Lt=45,ft=35,Ct=20;Z.x=Math.round(H-ft),Z.y=Math.round(yt-Lt),Z.width=Math.round(ut-H+ft*2),Z.height=Math.round(ht-yt+Lt+Ct)}}}}function K(g,tt){if(g)for(var B=0;B<g.length;B++){var Z=g[B];tt[Z.id]&&Z.children&&(Z.drawio=Z.drawio||{},Z.drawio.flatLayout=!0,K(Z.children,tt))}}function ot(g,tt){if(g)for(var B=0;B<g.length;B++){var Z=g[B];if(!(!tt[Z.id]||!Z.children)){var H=Z.drawio&&Z.drawio.flatLayout;if(!H)for(var yt=0;yt<Z.children.length;yt++){var ut=Z.children[yt];ut.x=(ut.x||0)-(Z.x||0),ut.y=(ut.y||0)-(Z.y||0)}ot(Z.children,tt)}}}function pt(g,tt,B,Z,H,yt,ut,ht,bt){var Nt=g.drawio&&g.drawio.diagramType,Dt=g.drawio&&g.drawio.isClassDiagram,st=Nt==="er"||Dt||Nt==="flowchart",Lt=st?ih:li,ft=new Lt.graphlib.Graph({multigraph:!0,compound:!0});ft.setGraph({rankdir:tt,nodesep:B,ranksep:Z,marginx:8,marginy:8}),ft.setDefaultEdgeLabel(function(){return{}});var Ct={};at(g.children,Ct),N(ft,g.children,null,ut);var Xt=!1,St=!1;if(g.children)for(var Zt=0;Zt<g.children.length;Zt++)g.children[Zt].drawio&&g.children[Zt].drawio.isStateDiagram&&(Xt=!0),g.children[Zt].drawio&&g.children[Zt].drawio.isNoteGroup&&(St=!0);for(var G=Xt?"last":"first",dt={},Zt=0;Zt<H.length;Zt++){var oe=H[Zt],ae=oe.sources?oe.sources[0]:null,fe=oe.targets?oe.targets[0]:null;if(!(!ae||!fe)){var ne=ut[ae]?It(ht,ae,G):ae,ye=ut[fe]?It(ht,fe,"first"):fe;if(ne&&ye&&ft.node(ne)&&ft.node(ye)&&ne!==ye){var Mt=oe.drawio&&oe.drawio.length||1,$t=oe.labels&&oe.labels[0]?oe.labels[0].text:"",Jt=$t?o($t,16,'"trebuchet ms",verdana,arial,sans-serif'):{width:0,height:0},e=Dt&&$t?Math.max(24,Jt.height):Jt.height;ft.setEdge(ne,ye,{label:$t,width:Jt.width,height:e,minlen:Mt,labelpos:"c"},oe.id),dt[oe.id]={v:ne,w:ye}}}}if(ft.nodeCount()===0)return g;Lt.layout(ft);var x=g.drawio&&g.drawio.isClassDiagram,C=Nt==="er",S=Nt==="flowchart"&&st,Y=!1;if(S&&H){var D={};for(var At in ht)for(var U=ht[At],q=0;q<U.length;q++)D[U[q]]||(D[U[q]]=At);for(var rt=0;rt<H.length;rt++){var ct=H[rt],nt=ct.sources&&ct.sources[0],zt=ct.targets&&ct.targets[0];if(!(!nt||!zt)){var Ot=ut[nt]?nt:D[nt],Ft=ut[zt]?zt:D[zt];if(Ot&&Ft&&Ot!==Ft){Y=!0;break}}}}var Pt=S&&(bt||Y),Wt=Xt&&!St;return(Wt||!W(ft)&&!S&&!bt||Pt)&&!x&&!C&&!St&&gt(ft,tt),xt(ft,H,dt,yt,ut,tt,Xt),_(ft,g.children),Q(ft,g.children,ut),l(ft,H,dt,yt),O(g.children,ut,tt),z(ft,H,dt,yt,ut,g.children,Xt),g}function xt(g,tt,B,Z,H,yt,ut){for(var ht=yt==="TB"||yt==="BT",bt={},Nt=0;Nt<tt.length;Nt++){var Dt=tt[Nt],st=Z[Dt.id];if(!((!st||st==="root")&&!ut)){var Lt=B[Dt.id];if(Lt){var ft=Dt.sources?Dt.sources[0]:null,Ct=Dt.targets?Dt.targets[0]:null;if(!(!ft||!Ct||H[ft]||H[Ct])){var Xt=Lt.v<Lt.w?Lt.v+"|"+Lt.w:Lt.w+"|"+Lt.v,St=Xt+"|"+st;bt[St]||(bt[St]=[]),bt[St].push({elkEdge:Dt,mapping:Lt})}}}}for(var St in bt){var Zt=bt[St];if(!(Zt.length<2)){var G=g.node(Zt[0].mapping.v),dt=g.node(Zt[0].mapping.w);if(!(!G||!dt)){var oe,ae;ht?(oe=G.y<=dt.y?G:dt,ae=G.y<=dt.y?dt:G):(oe=G.x<=dt.x?G:dt,ae=G.x<=dt.x?dt:G);var fe=ht?Math.max(oe.width,ae.width):Math.max(oe.height,ae.height),ne,ye;if(ut){for(var Mt=0,$t=0;$t<Zt.length;$t++){var Jt=Zt[$t].elkEdge.labels;if(Jt&&Jt[0]&&Jt[0].text){var e=o(Jt[0].text,14,'"trebuchet ms",verdana,arial,sans-serif');Mt=Math.max(Mt,e.width)}}Mt>0?(ne=8,ye=Mt/2+18):(ne=4,ye=8)}else ne=fe*.12,ye=fe*.45;for(var x=ht?(oe.x+ae.x)/2:(oe.y+ae.y)/2,C=ht?(oe.y+ae.y)/2:(oe.x+ae.x)/2,$t=0;$t<Zt.length;$t++){var S=Zt[$t],Y=g.edge({v:S.mapping.v,w:S.mapping.w,name:S.elkEdge.id});if(!(!Y||!Y.points||Y.points.length<2)){S.elkEdge.drawio=S.elkEdge.drawio||{},S.elkEdge.drawio.isBidiPair=!0;var D=g.node(S.elkEdge.sources[0]),At=D&&(ht?D.y<=ae.y-1&&D.y>=oe.y-1&&Math.abs(D.y-oe.y)<Math.abs(D.y-ae.y):D.x<=ae.x-1&&D.x>=oe.x-1&&Math.abs(D.x-oe.x)<Math.abs(D.x-ae.x)),U=ut?At?1:-1:At?-1:1,q=Y.points[0],rt=Y.points[Y.points.length-1];ht?Y.points=[{x:x+U*ne,y:q.y},{x:x+U*ye,y:C},{x:x+U*ne,y:rt.y}]:Y.points=[{x:q.x,y:x+U*ne},{x:C,y:x+U*ye},{x:rt.x,y:x+U*ne}]}}}}}}function ee(g,tt,B,Z,H){if(tt)for(var yt=B||0,ut=0;ut<tt.length;ut++){var ht=tt[ut];if(ht.children&&ht.children.length>0){var bt=H||ht.drawio&&ht.drawio.isStateDiagram&&ht.drawio.isSubgraph;ee(g,ht.children,yt+1,Z,bt)}else{var Nt=Z&&Z[ht.id]||null,Dt=0,st=0,Lt=yt>0?35:0,ft=H?35:25,Ct=25;(Nt==="top"||Nt==="both")&&(Dt=ft),(Nt==="bottom"||Nt==="both")&&(st=Ct),g.setNode(ht.id,{label:ht.id,width:(ht.width||0)+Lt*2,height:(ht.height||0)+Dt+st,_padTop:Dt,_padLeft:Lt})}}}function N(g,tt,B,Z){if(tt)for(var H=0;H<tt.length;H++){var yt=tt[H];yt.children&&yt.children.length>0&&Z[yt.id]?(g.setNode(yt.id,{label:yt.id,clusterLabelPos:"top"}),B&&g.setParent(yt.id,B),N(g,yt.children,yt.id,Z)):(g.setNode(yt.id,{label:yt.id,width:yt.width||0,height:yt.height||0}),B&&g.setParent(yt.id,B))}}function Q(g,tt,B){if(tt)for(var Z=0;Z<tt.length;Z++){var H=tt[Z];if(B[H.id]&&H.children){var yt=g.node(H.id);yt&&yt.width!=null&&yt.height!=null&&(H.x=Math.round(yt.x-yt.width/2),H.y=Math.round(yt.y-yt.height/2),H.width=Math.round(yt.width),H.height=Math.round(yt.height)),Q(g,H.children,B)}}}function at(g,tt){if(g)for(var B=0;B<g.length;B++){var Z=g[B];if(!(!Z.children||Z.children.length===0)){at(Z.children,tt);for(var H=[],yt=0;yt<Z.children.length;yt++){var ut=Z.children[yt];(!ut.children||ut.children.length===0)&&H.push(ut)}if(H.length!==0){for(var ht={},yt=0;yt<H.length;yt++)ht[H[yt].id]=!0;var bt={},Nt={};if(Z.edges)for(var yt=0;yt<Z.edges.length;yt++){var Dt=Z.edges[yt],st=Dt.sources&&Dt.sources[0],Lt=Dt.targets&&Dt.targets[0];ht[st]&&ht[Lt]&&(Nt[st]=(Nt[st]||0)+1,bt[Lt]=(bt[Lt]||0)+1)}for(var yt=0;yt<H.length;yt++){var ft=H[yt],Ct=!bt[ft.id],Xt=!Nt[ft.id];Ct&&Xt?tt[ft.id]="both":Ct?tt[ft.id]="top":Xt?tt[ft.id]="bottom":tt[ft.id]="side"}}}}}function _(g,tt){if(tt)for(var B=0;B<tt.length;B++){var Z=tt[B];if(Z.children&&Z.children.length>0)_(g,Z.children);else{var H=g.node(Z.id);if(H){var yt=H._padTop||0,ut=H._padLeft||0;Z.x=Math.round(H.x-H.width/2+ut),Z.y=Math.round(H.y-H.height/2+yt)}}}}function l(g,tt,B,Z){for(var H=0;H<tt.length;H++){var yt=tt[H],ut=B[yt.id];if(ut){var ht=Z[yt.id];if(!(!ht||ht==="root")){var bt=g.edge({v:ut.v,w:ut.w,name:yt.id});if(!(!bt||!bt.points||bt.points.length===0)){yt._routePoints=[];for(var Nt=0;Nt<bt.points.length;Nt++)yt._routePoints.push({x:Math.round(bt.points[Nt].x),y:Math.round(bt.points[Nt].y)})}}}}}function O(g,tt,B){if(g)for(var Z=0;Z<g.length;Z++){var H=g[Z];if(!(!tt[H.id]||!H.children)){O(H.children,tt,B);for(var yt=1/0,ut=1/0,ht=-1/0,bt=-1/0,Nt=0;Nt<H.children.length;Nt++){var Dt=H.children[Nt];yt=Math.min(yt,Dt.x||0),ut=Math.min(ut,Dt.y||0),ht=Math.max(ht,(Dt.x||0)+(Dt.width||0)),bt=Math.max(bt,(Dt.y||0)+(Dt.height||0))}if(yt!==1/0){var st=H.drawio&&H.drawio.isStateDiagram&&H.drawio.isSubgraph,Lt=H.drawio&&H.drawio.isClassNamespace,ft=H.drawio&&H.drawio.shape==="parallelRegion",Ct=st||Lt?35:45,Xt=ft?85:35,St=B==="LR"||B==="RL",Zt=st&&St?Ct:Lt?35:25,G=yt,dt=ut,oe=ht,ae=bt,fe=H.drawio&&H.drawio.shape==="parallelRegion";if(H.edges)for(var Nt=0;Nt<H.edges.length;Nt++){var ne=H.edges[Nt];if(ne._routePoints)for(var ye=0;ye<ne._routePoints.length;ye++)G=Math.min(G,ne._routePoints[ye].x),oe=Math.max(oe,ne._routePoints[ye].x);if(st&&!fe&&ne._routePoints&&ne._routePoints.length>0&&ne.labels&&ne.labels[0]&&ne.labels[0].text){var Mt=Math.floor(ne._routePoints.length/2),$t=ne._routePoints[Mt],Jt=o(ne.labels[0].text,16,'"trebuchet ms",verdana,arial,sans-serif'),e=Jt.width/2;G=Math.min(G,$t.x-e),oe=Math.max(oe,$t.x+e)}}var x=(yt+ht)/2,C=x-G,S=oe-x,Y=Math.max(C,S);G=x-Y,oe=x+Y,H.x=Math.round(G-Xt),H.y=Math.round(dt-Ct),H.width=Math.round(oe-G+Xt*2),H.height=Math.round(ae-dt+Ct+Zt);for(var Nt=0;Nt<H.children.length;Nt++)H.children[Nt].x-=H.x,H.children[Nt].y-=H.y}}}}function z(g,tt,B,Z,H,yt,ut){var ht={};lt(yt,ht,H);for(var bt=0;bt<tt.length;bt++){var Nt=tt[bt],Dt=B[Nt.id];if(Dt){var st=g.edge({v:Dt.v,w:Dt.w,name:Nt.id});if(!(!st||!st.points||st.points.length===0)){var Lt=st.points,ft=0,Ct=0,Xt=Z[Nt.id];Xt&&Xt!=="root"&&ht[Xt]&&(ft=ht[Xt].x,Ct=ht[Xt].y);var St=Lt.slice(1,-1).map(function(e){return{x:Math.round(e.x-ft),y:Math.round(e.y-Ct)}}),Zt=ut&&(!Xt||Xt==="root");if(Zt&&St.length===1){var G=Lt[0].x-ft,dt=Lt[Lt.length-1].x-ft,oe=St[0].x,ae=Math.min(G,dt),fe=Math.max(G,dt);(oe<ae-1||oe>fe+1)&&(St=[])}if(ut){var ne=Math.round(Lt[0].x-ft),ye=Math.round(Lt[0].y-Ct),Mt=Math.round(Lt[Lt.length-1].x-ft),$t=Math.round(Lt[Lt.length-1].y-Ct),Jt=St.length===0||St.length===1&&(Math.abs(St[0].x-ne)<2&&Math.abs(St[0].y-ye)<2||Math.abs(St[0].x-Mt)<2&&Math.abs(St[0].y-$t)<2);Jt&&Math.abs(ne-Mt)>25&&Math.abs(ye-$t)>25&&(St=[{x:Mt,y:ye}])}Nt.sections=[{startPoint:{x:Math.round(Lt[0].x-ft),y:Math.round(Lt[0].y-Ct)},endPoint:{x:Math.round(Lt[Lt.length-1].x-ft),y:Math.round(Lt[Lt.length-1].y-Ct)},bendPoints:St}]}}}}function lt(g,tt,B){if(g)for(var Z=0;Z<g.length;Z++){var H=g[Z];B[H.id]&&(tt[H.id]={x:H.x||0,y:H.y||0},H.children&&lt(H.children,tt,B))}}function W(g){for(var tt=g.edges(),B=0;B<tt.length;B++){var Z=g.node(tt[B].v),H=g.node(tt[B].w);if(Z&&H&&typeof Z.rank=="number"&&typeof H.rank=="number"&&H.rank<Z.rank)return!0}return!1}function gt(g,tt){for(var B=tt==="TB"||tt==="BT",Z={},H=[],yt=g.nodes(),ut=0;ut<yt.length;ut++){var ht=yt[ut];if(!Z[ht]){for(var bt=[],Nt=[ht];Nt.length>0;){var Dt=Nt.shift();if(!Z[Dt]){Z[Dt]=!0,bt.push(Dt);for(var st=g.neighbors(Dt)||[],Lt=0;Lt<st.length;Lt++)Z[st[Lt]]||Nt.push(st[Lt])}}H.push(bt)}}for(var ft=0;ft<H.length;ft++){var bt=H[ft];if(!(bt.length<2)){for(var Ct=1/0,Xt=-1/0,ut=0;ut<bt.length;ut++){var St=g.node(bt[ut]);St&&(B?(Ct=Math.min(Ct,St.x-St.width/2),Xt=Math.max(Xt,St.x+St.width/2)):(Ct=Math.min(Ct,St.y-St.height/2),Xt=Math.max(Xt,St.y+St.height/2)))}if(Ct!==1/0){for(var Zt=(Ct+Xt)/2,ut=0;ut<bt.length;ut++){var St=g.node(bt[ut]);St&&(B?St.x=2*Zt-St.x:St.y=2*Zt-St.y)}for(var G={},ut=0;ut<bt.length;ut++)G[bt[ut]]=!0;for(var dt=g.edges(),ut=0;ut<dt.length;ut++){var oe=dt[ut];if(!(!G[oe.v]||!G[oe.w])){var ae=g.edge(oe);if(ae&&ae.points)for(var Lt=0;Lt<ae.points.length;Lt++)B?ae.points[Lt].x=2*Zt-ae.points[Lt].x:ae.points[Lt].y=2*Zt-ae.points[Lt].y}}}}}}function mt(g){if(g)for(var tt=0;tt<g.length;tt++)delete g[tt]._absX,delete g[tt]._absY,delete g[tt]._parentAbsXY,g[tt].children&&mt(g[tt].children)}function Tt(g,tt,B,Z,H){if(tt)for(var yt=0;yt<tt.length;yt++){var ut=tt[yt],ht=ut.children&&ut.children.length>0;ht?(Z[ut.id]=!0,H[ut.id]=[],g.setNode(ut.id,{label:ut.id})):(g.setNode(ut.id,{label:ut.id,width:ut.width||0,height:ut.height||0}),B&&H[B]&&H[B].push(ut.id)),B&&g.setParent(ut.id,B),ht&&Tt(g,ut.children,ut.id,Z,H)}}function Rt(g,tt,B){if(g.edges)for(var Z=0;Z<g.edges.length;Z++)tt.push(g.edges[Z]),B[g.edges[Z].id]=g.id;if(g.children)for(var Z=0;Z<g.children.length;Z++)(g.children[Z].edges||g.children[Z].children)&&Rt(g.children[Z],tt,B)}function It(g,tt,B){var Z=g[tt];if(!Z||Z.length===0)return null;var H=B==="first"?Z[0]:Z[Z.length-1];return g[H]?It(g,H,B):H}function te(g,tt,B,Z){if(tt)for(var H=0;H<tt.length;H++){var yt=tt[H],ut=g.node(yt.id);if(ut)if(Z[yt.id])Qt(g,yt,Z);else{var ht=Math.round(ut.x-ut.width/2),bt=Math.round(ut.y-ut.height/2);if(B&&Z[B]){var Nt=yt._parentAbsXY;yt.x=ht-Nt.x,yt.y=bt-Nt.y}else yt.x=ht,yt.y=bt}}}function Qt(g,tt,B){var Z=45,H=35,yt=20;if(tt.children)for(var ut=0;ut<tt.children.length;ut++)B[tt.children[ut].id]&&Qt(g,tt.children[ut],B);var ht=1/0,bt=1/0,Nt=-1/0,Dt=-1/0;if(tt.children)for(var ut=0;ut<tt.children.length;ut++){var st=tt.children[ut];if(B[st.id])ht=Math.min(ht,st._absX),bt=Math.min(bt,st._absY),Nt=Math.max(Nt,st._absX+st.width),Dt=Math.max(Dt,st._absY+st.height);else{var Lt=g.node(st.id);if(Lt){var ft=Math.round(Lt.x-Lt.width/2),Ct=Math.round(Lt.y-Lt.height/2);ht=Math.min(ht,ft),bt=Math.min(bt,Ct),Nt=Math.max(Nt,ft+Lt.width),Dt=Math.max(Dt,Ct+Lt.height)}}}if(ht!==1/0){for(var Xt={},ut=0;ut<tt.children.length;ut++)Xt[tt.children[ut].id]=!0;for(var St=g.edges(),ut=0;ut<St.length;ut++){var Zt=St[ut];if(Xt[Zt.v]&&Xt[Zt.w]){var G=g.edge(Zt);if(G&&G.points)for(var dt=0;dt<G.points.length;dt++)ht=Math.min(ht,Math.round(G.points[dt].x)),Nt=Math.max(Nt,Math.round(G.points[dt].x))}}var oe=Math.round(ht-H),ae=Math.round(bt-Z),fe=Math.round(Nt-ht+H*2),ne=Math.round(Dt-bt+Z+yt);if(tt._absX=oe,tt._absY=ae,tt.width=fe,tt.height=ne,tt.children)for(var ut=0;ut<tt.children.length;ut++){var st=tt.children[ut];if(B[st.id])st.x=st._absX-oe,st.y=st._absY-ae,delete st._absX,delete st._absY;else{var Lt=g.node(st.id);Lt&&(st.x=Math.round(Lt.x-Lt.width/2)-oe,st.y=Math.round(Lt.y-Lt.height/2)-ae),st._parentAbsXY={x:oe,y:ae}}}var ye=g.parent(tt.id);ye&&ye!=="\0"||(tt.x=oe,tt.y=ae)}}function pe(g,tt,B,Z,H){var yt={};ue(g,H,yt);for(var ut=0;ut<tt.length;ut++){var ht=tt[ut],bt=B[ht.id];if(bt){var Nt=g.edge({v:bt.v,w:bt.w,name:ht.id});if(!(!Nt||!Nt.points||Nt.points.length===0)){var Dt=Nt.points,st=0,Lt=0,ft=Z[ht.id];ft&&ft!=="root"&&yt[ft]&&(st=yt[ft].x,Lt=yt[ft].y),ht.sections=[{startPoint:{x:Math.round(Dt[0].x-st),y:Math.round(Dt[0].y-Lt)},endPoint:{x:Math.round(Dt[Dt.length-1].x-st),y:Math.round(Dt[Dt.length-1].y-Lt)},bendPoints:Dt.slice(1,-1).map(function(Ct){return{x:Math.round(Ct.x-st),y:Math.round(Ct.y-Lt)}})}]}}}}function ue(g,tt,B){var Z=45,H=35,yt=20;for(var ut in tt){var ht=g.node(ut);if(ht){var bt=g.children(ut);if(!(!bt||bt.length===0)){for(var Nt=1/0,Dt=1/0,st=0;st<bt.length;st++){var Lt=g.node(bt[st]);Lt&&(tt[bt[st]]&&B[bt[st]]?(Nt=Math.min(Nt,B[bt[st]].x),Dt=Math.min(Dt,B[bt[st]].y)):(Nt=Math.min(Nt,Math.round(Lt.x-Lt.width/2)),Dt=Math.min(Dt,Math.round(Lt.y-Lt.height/2))))}Nt!==1/0&&(B[ut]={x:Math.round(Nt-H),y:Math.round(Dt-Z)})}}}}function me(g){var tt=g.layoutOptions||{};tt["elk.layered.considerModelOrder.strategy"]||(tt["elk.layered.considerModelOrder.strategy"]="NODES"),tt["elk.layered.crossingMinimization.forceNodeModelOrder"]||(tt["elk.layered.crossingMinimization.forceNodeModelOrder"]="true"),g.layoutOptions=tt}function Ee(g){me(g);var tt=t2(),B=new tt,Z=B.layoutSync(g);return xe(g,Z),g}function xe(g,tt){if(!(!g||!tt)){if(tt.x!=null&&(g.x=tt.x),tt.y!=null&&(g.y=tt.y),tt.width!=null&&(g.width=tt.width),tt.height!=null&&(g.height=tt.height),tt.children&&g.children){for(var B={},Z=0;Z<tt.children.length;Z++)B[tt.children[Z].id]=tt.children[Z];for(var H=0;H<g.children.length;H++){var yt=g.children[H],ut=B[yt.id];ut&&xe(yt,ut)}}if(tt.edges&&g.edges){for(var ht={},bt=0;bt<tt.edges.length;bt++)ht[tt.edges[bt].id]=tt.edges[bt];for(var Nt=0;Nt<g.edges.length;Nt++){var Dt=g.edges[Nt],st=ht[Dt.id];st&&st.sections&&(Dt.sections=st.sections)}}}}function ar(g){var tt=Wn.CoSELayout,B=Wn.CoSENode,Z=Wn.CoSEConstants,H=Wn.layoutBase.PointD,yt=Wn.layoutBase.DimensionD,ut=Wn.layoutBase.LayoutConstants,ht=Wn.layoutBase.FDLayoutConstants;ut.QUALITY=2,ut.DEFAULT_INCREMENTAL=!1,ut.ANIMATE=!1,ut.NODE_DIMENSIONS_INCLUDE_LABELS=!1,ht.DEFAULT_EDGE_LENGTH=50,ht.DEFAULT_SPRING_STRENGTH=.45,ht.DEFAULT_REPULSION_STRENGTH=4500,ht.DEFAULT_GRAVITY_STRENGTH=.25,ht.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,ht.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,ht.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,ht.MAX_ITERATIONS=2500,ht.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,ht.DEFAULT_COOLING_FACTOR_INCREMENTAL=.5,Z.DEFAULT_EDGE_LENGTH=50,Z.DEFAULT_SPRING_STRENGTH=.45,Z.DEFAULT_REPULSION_STRENGTH=4500,Z.DEFAULT_GRAVITY_STRENGTH=.25,Z.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,Z.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,Z.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,Z.MAX_ITERATIONS=2500,Z.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,Z.DEFAULT_COOLING_FACTOR_INCREMENTAL=.5,Z.NODE_DIMENSIONS_INCLUDE_LABELS=!1,Z.DEFAULT_INCREMENTAL=!1,Z.ANIMATE=!1,Z.TILE=!0,Z.TILING_PADDING_VERTICAL=10,Z.TILING_PADDING_HORIZONTAL=10;for(var bt=new tt,Nt=bt.newGraphManager(),Dt=Nt.addRoot(),st={},Lt=g.children||[],ft=g.edges||[],Ct=0;Ct<Lt.length;Ct++){var Xt=Lt[Ct],St=Xt.width||40,Zt=Xt.height||30,G=Dt.add(new B(bt.graphManager,new H(0,0),new yt(St,Zt)));G.id=Xt.id,st[Xt.id]=G}for(var Ct=0;Ct<ft.length;Ct++){var dt=ft[Ct],oe=dt.sources?dt.sources[0]:null,ae=dt.targets?dt.targets[0]:null;oe&&ae&&st[oe]&&st[ae]&&st[oe]!==st[ae]&&Nt.add(bt.newEdge(),st[oe],st[ae])}bt.runLayout();for(var Ct=0;Ct<Lt.length;Ct++){var Xt=Lt[Ct],fe=st[Xt.id];fe&&(Xt.x=Math.round(fe.getRect().x),Xt.y=Math.round(fe.getRect().y))}for(var ne=1/0,ye=1/0,Ct=0;Ct<Lt.length;Ct++)ne=Math.min(ne,Lt[Ct].x),ye=Math.min(ye,Lt[Ct].y);if(ne!==1/0)for(var Mt=20-ne,$t=20-ye,Ct=0;Ct<Lt.length;Ct++)Lt[Ct].x+=Mt,Lt[Ct].y+=$t;return g}function xr(g){function tt(Z){if(Z.drawio&&Z.drawio.bidiCompound&&Z.children&&Z.children.length>0){var H=400;if(Z.width<H){for(var yt=H-Z.width,ut=yt/2,ht=0;ht<Z.children.length;ht++)Z.children[ht].x=(Z.children[ht].x||0)+ut;if(Z.edges)for(var bt=0;bt<Z.edges.length;bt++){var Nt=Z.edges[bt];if(Nt.sections)for(var Dt=0;Dt<Nt.sections.length;Dt++){var st=Nt.sections[Dt];if(st.startPoint&&(st.startPoint.x+=ut),st.endPoint&&(st.endPoint.x+=ut),st.bendPoints)for(var Lt=0;Lt<st.bendPoints.length;Lt++)st.bendPoints[Lt].x+=ut}}Z.width=H,Z._bidiShift=ut}}if(Z.children)for(var ft=0;ft<Z.children.length;ft++)tt(Z.children[ft])}tt(g);function B(Z){if(Z.children){for(var H=0,yt=0;yt<Z.children.length;yt++){var ut=Z.children[yt];ut._bidiShift&&ut._bidiShift>H&&(H=ut._bidiShift)}if(H>0){for(var ht=0;ht<Z.children.length;ht++){var bt=Z.children[ht];bt._bidiShift||(bt.x=(bt.x||0)+H)}if(Z.edges)for(var Nt=0;Nt<Z.edges.length;Nt++){var Dt=Z.edges[Nt];if(Dt.sections)for(var st=0;st<Dt.sections.length;st++){var Lt=Dt.sections[st];if(Lt.startPoint&&(Lt.startPoint.x+=H),Lt.endPoint&&(Lt.endPoint.x+=H),Lt.bendPoints)for(var ft=0;ft<Lt.bendPoints.length;ft++)Lt.bendPoints[ft].x+=H}}}}}B(g)}function sr(g){if(!(!g.children||!g.edges)){for(var tt={},B=0;B<g.children.length;B++){var Z=g.children[B];tt[Z.id]=Z}for(var H={},yt=0;yt<g.edges.length;yt++){var ut=g.edges[yt],ht=ut.sources&&ut.sources[0];ht&&(H[ht]||(H[ht]=[]),H[ht].push(ut))}for(var bt in H){var Nt=tt[bt];if(!(!Nt||!Nt.drawio||Nt.drawio.shape!=="stateStart")){for(var Dt=H[bt],st=[],Lt=0;Lt<Dt.length;Lt++){var ft=Dt[Lt],Ct=ft.targets&&ft.targets[0];if(Ct){var Xt=tt[Ct];!Xt||!Xt.children||Xt.children.length===0||st.push({edge:ft,node:Xt})}}if(st.length!==0){for(var St=Nt.width||0,Zt=Nt.height||0,G=1/0,dt=-1/0,oe=0;oe<st.length;oe++){var ae=st[oe].node,fe=ae.x||0,ne=ae.width||0;fe<G&&(G=fe),fe+ne>dt&&(dt=fe+ne)}var ye=(G+dt)/2-St/2;Nt.x=ye;for(var Mt=0;Mt<st.length;Mt++){var $t=st[Mt],Jt=$t.edge,e=$t.node;if(!(!Jt.sections||Jt.sections.length===0)){var x=Jt.sections[0],C=ye+St/2,S=(Nt.y||0)+Zt,Y=e.x||0,D=e.y||0,At=e.width||0,U=Y+At/2;x.startPoint={x:C,y:S},x.endPoint={x:U,y:D},x.bendPoints=[]}}}}}}}function Qe(g){g.edges=g.edges||[];function tt(Z,H,yt){if(Z.sections)for(var ut=0;ut<Z.sections.length;ut++){var ht=Z.sections[ut];if(ht.startPoint&&(ht.startPoint.x+=H,ht.startPoint.y+=yt),ht.endPoint&&(ht.endPoint.x+=H,ht.endPoint.y+=yt),ht.bendPoints)for(var bt=0;bt<ht.bendPoints.length;bt++)ht.bendPoints[bt].x+=H,ht.bendPoints[bt].y+=yt}}function B(Z,H,yt){if(Z.children)for(var ut=0;ut<Z.children.length;ut++){var ht=Z.children[ut],bt=H+(ht.x||0),Nt=yt+(ht.y||0);if(ht.edges&&ht.edges.length>0){for(var Dt=0;Dt<ht.edges.length;Dt++){var st=ht.edges[Dt];tt(st,bt,Nt),g.edges.push(st)}ht.edges=[]}B(ht,bt,Nt)}}B(g,0,0)}function or(g,tt,B){var Z=B&&(B.flowchart&&B.flowchart.defaultRenderer==="elk"||B.layout==="elk");switch(g){case"flowchart":case"class":case"state":case"er":case"requirement":return tt.drawio=tt.drawio||{},tt.drawio.diagramType=g,tt.drawio.useElkLayout=Z,P(tt,B),(g==="flowchart"||g==="requirement")&&w(tt,B),g==="er"&&Z&&(tt.layoutOptions={"elk.algorithm":"layered","elk.direction":tt.layoutOptions&&tt.layoutOptions["elk.direction"]||"DOWN","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.layered.crossingMinimization.forceNodeModelOrder":"true","elk.layered.unnecessaryBendpoints":"true","spacing.baseValue":"35","elk.layered.spacing.nodeNodeBetweenLayers":"45","elk.layered.spacing.edgeNodeBetweenLayers":"22"}),d(tt,Z),g==="state"&&(xr(tt),sr(tt),Qe(tt)),tt;case"mindmap":return P(tt,B),typeof Wn!="undefined"?ar(tt):(tt.layoutOptions=tt.layoutOptions||{},tt.layoutOptions["elk.algorithm"]="mrtree",tt.layoutOptions["elk.direction"]="RIGHT",d(tt,!1)),tt;case"sequence":case"zenuml":return Wr(tt,B);case"gitgraph":return oa(tt,B);case"journey":return Sr(tt,B);case"pie":return Mr(tt,B);case"packet":return er(tt,B);case"quadrant":return Xr(tt,B);case"wardley":return Kr(tt,B);case"eventmodeling":return Ur(tt,B);case"timeline":return ir(tt,B);case"kanban":return cr(tt,B);case"xychart":return Fr(tt,B);case"radar":return yr(tt,B);case"block":return rr(tt,B);case"c4":return Pr(tt,B);case"architecture":return ta(tt,B);case"sankey":return ca(tt,B);case"treemap":return ba(tt,B);case"gantt":return ra(tt,B);case"venn":return nn(tt,B);case"ishikawa":return dn(tt,B);case"treeView":return Fn(tt,B);default:return P(tt,B),d(tt),tt}}function Wr(g,tt){for(var B=tt&&tt.fontSize||12,Z=tt&&tt.fontFamily||"Helvetica",H=!!g.zenuml,yt=H?120:200,ut=H?100:150,ht=65,bt=H?36:44,Nt=16,Dt=120,st=40,Lt=10,ft=g.actors,Ct=g.messages,Xt=g.notes,St=g.fragments,Zt={actor:1,boundary:1,control:1,entity:1,database:1},G=0;G<ft.length;G++){var dt=H&&Zt[ft[G].type],oe=ft[G].label&&ft[G].label.length>0;if(H&&dt&&!oe)ft[G].labelWidth=80;else if(H){var ae=o(ft[G].label,16,"trebuchet ms,verdana,arial,sans-serif"),fe=dt?28:0;ft[G].labelWidth=ae.width+20+fe}else{var ae=o(ft[G].label,B,Z);ft[G].labelWidth=ae.width+20}ft[G].labelHeight=Math.max(ht,65)}for(var ne={},ye=0;ye<ft.length;ye++)ne[ft[ye].name]=ye;for(var Mt=new Array(ft.length),$t=0;$t<ft.length;$t++)Mt[$t]=yt;if(Ct&&Ct.length>0)for(var Jt=16,e="trebuchet ms,verdana,arial,sans-serif",x=0;x<Ct.length;x++){var C=Ct[x],S=ne[C.from],Y=ne[C.to];if(!(S==null||Y==null||S===Y))for(var D=Math.min(S,Y),At=Math.max(S,Y),U=o(C.text||"",Jt,e),q=U.width+50,rt=At-D,ct=Math.max(yt,Math.ceil(q/rt)),nt=D;nt<At;nt++)ct>Mt[nt]&&(Mt[nt]=ct)}if(!H&&g.boxes&&g.boxes.length>0){for(var zt=10,Ot=5,Ft={},Pt=0;Pt<g.boxes.length;Pt++){var Wt=g.boxes[Pt];if(Wt.actors)for(var Kt=0;Kt<Wt.actors.length;Kt++)Ft[Wt.actors[Kt]]=Pt}for(var Bt=0;Bt<ft.length-1;Bt++){var ce=Ft[ft[Bt].name],kt=Ft[ft[Bt+1].name];ce!==kt&&(ce!=null&&(Mt[Bt]+=zt+Ot),kt!=null&&(Mt[Bt]+=Ot))}}for(var wt=0,G=0;G<ft.length;G++){var jt=H?Math.max(ut,ft[G].labelWidth||0):ut;ft[G].width=jt,ft[G].x=wt,ft[G].centerX=wt+jt/2,ft[G].labelHeight=ht;var Ht=Mt[G]||yt;wt+=H?Math.max(Ht,jt+20):Ht}for(var qt={},G=0;G<ft.length;G++)qt[ft[G].name]=G;for(var G=0;G<Xt.length;G++){var re=Xt[G],Ut=qt[re.actor];if(Ut!=null){for(var ve=re.actor2!=null?qt[re.actor2]:null,we=o(re.text,B,Z),Se=re.text.split(/\n|<br\s*\/?>/gi),be=0,Me=0;Me<Se.length;Me++)Se[Me].length>be&&(be=Se[Me].length);var Fe=be*B*.6,Ue=Se.length*(B+8),De=0;if(ve!=null){var Ye=Math.min(ft[Ut].centerX,ft[ve].centerX),Pe=Math.max(ft[Ut].centerX,ft[ve].centerX);De=Pe-Ye+40}if(re.width=Math.max(we.width+20,Fe+20,Dt,De),H)re.height=Math.max(we.height+16,Ue+10,st);else{var de=17;re.height=Math.max(Se.length*de+20,st)}if(re.placement==="right")re.x=ft[Ut].centerX+16;else if(re.placement==="left")re.x=ft[Ut].centerX-re.width-16;else if(ve!=null){var Ve=(ft[Ut].centerX+ft[ve].centerX)/2;re.x=Ve-re.width/2}else re.x=ft[Ut].centerX-re.width/2}}for(var Ne=10,nr=10,Ge=10,Ie=17,Ce=H?ht+34:ht,Ke={},G=0;G<Xt.length;G++){var We=Xt[G],le=We.beforeMessageIdx!=null?We.beforeMessageIdx:Ct.length;Ke[le]||(Ke[le]=[]),Ke[le].push(We)}for(var Ae={},Le={},Re={},G=0;G<St.length;G++){var Be=St[G];Be.startIdx>=0&&(Ae[Be.startIdx]=!0);for(var je=Be.endIdx>=0?Be.endIdx:Ct.length,ie=Be.startIdx;ie<je;ie++)ie>=0&&ie<Ct.length&&(Re[ie]=!0);if(Be.sections)for(var fr=0;fr<Be.sections.length;fr++){var Ar=Be.sections[fr];Ar.startIdx>=0&&(Le[Ar.startIdx]=!0)}}for(var Lr=H?48:25,Ze=10,dr=H?64:41,Xe={},br={},G=0;G<St.length;G++)St[G].type==="rect"&&St[G].startIdx>=0&&(Xe[St[G].startIdx]=!0),St[G].type!=="rect"&&St[G].title&&St[G].startIdx>=0&&(br[St[G].startIdx]=!0);var vr=H?40:36,gr=H?0:10,fa={};if(H&&g.activations)for(var Je=0;Je<g.activations.length;Je++){var $e=g.activations[Je];$e.startIdx>=0&&$e.endIdx===$e.startIdx&&(fa[$e.startIdx]=!0)}for(var Qr={},$r={},Ir=[],G=0;G<=Ct.length;G++){for(var Cr=0;Cr<St.length;Cr++)St[Cr].type==="rect"&&St[Cr].startIdx===G&&(!H&&G===0&&(Ce+=Ne),Qr[Cr]=Ce,Ir.push(Cr));if(Ke[G])for(var Ea=0;Ea<Ke[G].length;Ea++){var We=Ke[G][Ea];qt[We.actor]!=null&&(H?(We.y=Ce,Ce+=We.height+10):(Ce+=Ne,We.y=Ce,Ce+=We.height))}for(var Cr=0;Cr<St.length;Cr++)St[Cr].type==="rect"&&St[Cr].endIdx===G&&Qr[Cr]!==void 0&&$r[Cr]===void 0&&($r[Cr]=Ce);if(G>=Ct.length)break;if(Ae[G])if(Xe[G]){var xa=Ir.length>1;xa||(Ce+=Ze)}else Ce+=br[G]?dr:Lr;Le[G]&&(Ce+=vr);var C=Ct[G],aa=qt[C.from],Gr=qt[C.to];if(!(aa==null||Gr==null)){H&&C.comments&&C.comments.length>0&&(Ce+=C.comments.length*16+4);var ya=1;if(!H&&C.text){for(var Br=C.text.split(/<br\s*\/?>|\n/),pa=Br.length,i=0,m=0;m<Br.length;m++){var k=o(Br[m],16,'"trebuchet ms",verdana,arial,sans-serif').width;k>i&&(i=k)}var R=Math.abs(ft[Gr].centerX-ft[aa].centerX),$=R>0?R-16:200,et=i>$?Math.ceil(i/Math.max($,1)):1;ya=pa*et}if(C.fromX=ft[aa].centerX,C.toX=ft[Gr].centerX,!H){let Ka=function(En){var Dn=En.width||150;return En.type==="actor"?25:Dn/2};var vt=ft[aa],Et=ft[Gr],Yt=vt.createMessageIndex===G||vt.destroyMessageIndex===G,Gt=Et.createMessageIndex===G||Et.destroyMessageIndex===G;if(Gt&&aa!==Gr){var he=Ka(Et);vt.centerX<Et.centerX?C.toX=Et.centerX-he:C.toX=Et.centerX+he}if(Yt&&aa!==Gr){var _e=Ka(vt);Et.centerX>vt.centerX?C.fromX=vt.centerX+_e:C.fromX=vt.centerX-_e}}if(H){var ua=ya>1?(ya-1)*18:0;Ce+=ua,C.y=Ce,C.from===C.to?Ce+=bt+20:Ce+=bt}else{for(var He=!1,qe=!1,Er=0;Er<ft.length;Er++){var Tr=ft[Er].destroyMessageIndex!=null&&ft[Er].destroyMessageIndex<Ct.length;ft[Er].destroyMessageIndex===G&&(He=!0),Tr&&G>0&&ft[Er].createMessageIndex===G-1&&(qe=!0)}He&&(Ce+=20),qe&&(Ce+=20),Ce+=Ge,Ce+=Ie;var Vr=Ie*ya,Zr=Vr-Ge+Ne;C.from===C.to&&(Zr+=30),C.y=Ce+Zr,Ce+=Zr,C.from===C.to&&(Ce+=30)}Re[G]&&(Ce+=gr),fa[G]&&(Ce+=20)}}var Aa,La;if(H)Aa=Ce-10,La=Aa+ht+20;else{if(Aa=Ce+Ne*2,Ct.length>0){for(var Fa=Ct.length-1,$a=0,_r=-1/0,wa=0;wa<St.length;wa++){var mr=St[wa];if(mr.type!=="rect"){var tr=mr.endIdx>=0?mr.endIdx:Ct.length;if(tr-1===Fa){$a++;var jr=Ct[Fa],va=jr.from===jr.to?40:10;_r=Math.max(_r,jr.y+va)}}}$a>=2&&_r>-1/0&&(Aa=Math.max(Aa,_r+50))}La=Aa+ht}for(var G=0;G<ft.length;G++)ft[G].height=La;for(var na=ht,G=0;G<ft.length;G++){var da=ft[G];da.createMessageIndex!=null&&da.createMessageIndex<Ct.length&&Ct[da.createMessageIndex].y!=null&&(da.lifelineStartY=Ct[da.createMessageIndex].y-na/2),da.destroyMessageIndex!=null&&da.destroyMessageIndex<Ct.length&&Ct[da.destroyMessageIndex].y!=null&&(da.lifelineEndY=Ct[da.destroyMessageIndex].y-na/2)}for(var Ia=new Array(St.length),Ma=0;Ma<St.length;Ma++){Ia[Ma]=0;for(var ln=St[Ma].startIdx,hn=St[Ma].endIdx>=0?St[Ma].endIdx:Ct.length,Ra=0;Ra<St.length;Ra++)if(Ra!==Ma){var wn=St[Ra].startIdx,tn=St[Ra].endIdx>=0?St[Ra].endIdx:Ct.length;wn<=ln&&tn>=hn&&(wn<ln||tn>hn)&&Ia[Ma]++}}for(var G=0;G<St.length;G++){var Be=St[G],yn=Math.max(0,Math.min(Be.startIdx,Ct.length-1)),gn=Be.endIdx>=0?Math.min(Be.endIdx,Ct.length):Ct.length,un=Be.type==="rect"?Ze:Be.title?H?dr:75:H?Lr:59,za;Be.type==="rect"&&Qr[G]!==void 0?za=Qr[G]:za=yn<Ct.length?Ct[yn].y-un:ht+34;var bn;if(Be.type==="rect"&&$r[G]!==void 0)bn=$r[G];else if(gn>0&&gn-1<Ct.length){var ja=Ct[gn-1],vn=ja.from===ja.to?40:10;bn=ja.y+vn}else bn=La-20;for(var Pa=1/0,Ba=-1/0,en=!1,ie=yn;ie<gn;ie++)if(ie<Ct.length){var Da=Ct[ie].from,xn=Ct[ie].to,Cr=qt[Da],Va=qt[xn],ea=H&&Da==="_STARTER_",ka=H&&xn==="_STARTER_";Cr!=null&&!ea&&(Pa=Math.min(Pa,ft[Cr].centerX),Ba=Math.max(Ba,ft[Cr].centerX)),Va!=null&&!ka&&(Pa=Math.min(Pa,ft[Va].centerX),Ba=Math.max(Ba,ft[Va].centerX)),Da===xn&&(en=!0)}en&&Ba!==-1/0&&(Pa-=70,Ba+=70),Pa===1/0&&(Pa=ft.length>0?ft[0].centerX:0,Ba=ft.length>0?ft[ft.length-1].centerX:yt);var _a=(Ia[G]||0)*10,ga=30;Be.x=Pa-ga+_a,Be.y=za,Be.width=Ba-Pa+ga*2-_a*2;for(var Xa=Be.endIdx>=0?Be.endIdx:Ct.length,rn=0,wa=0;wa<St.length;wa++)if(wa!==G){var cn=St[wa].startIdx,ia=St[wa].endIdx>=0?St[wa].endIdx:Ct.length;if(cn>=Be.startIdx&&ia<=Xa&&(cn>Be.startIdx||ia<Xa)&&ia===Xa){var Ga=(Ia[wa]||0)-(Ia[G]||0);Ga>rn&&(rn=Ga)}}Be.height=Math.max(bn-za+rn*20,bt+20)}if(g.boxes&&g.boxes.length>0){for(var ha=100,on=32,G=0;G<ft.length;G++)ft[G].y=(ft[G].y||0)+on;if(Xt)for(var G=0;G<Xt.length;G++)Xt[G].y=(Xt[G].y||0)+on;if(Ct)for(var G=0;G<Ct.length;G++)Ct[G].y=(Ct[G].y||0)+on;if(St)for(var G=0;G<St.length;G++)St[G].y=(St[G].y||0)+on;for(var G=0;G<g.boxes.length;G++){var Ta=g.boxes[G];if(!(!Ta.actors||Ta.actors.length===0)){for(var Ha=1/0,qa=-1/0,ie=0;ie<Ta.actors.length;ie++){var le=qt[Ta.actors[ie]];if(le!=null){var Za=ft[le];Ha=Math.min(Ha,Za.centerX),qa=Math.max(qa,Za.centerX)}}Ha!==1/0&&(Ta.x=Ha-ha,Ta.y=0,Ta.width=qa-Ha+ha*2,Ta.height=La+on+20)}}}return g}function oa(g,tt){var B=g.commits,Z=g.branches,H=g.isVertical,yt=10,ut=40,ht=30,bt=ut+yt,Nt=50+(g.rotateCommitLabel!==!1?40:0),Dt=20,st=[],Lt={};for(var ft in Z)Lt[ft]||(Lt[ft]=!0,st.push(ft));for(var Ct=0;Ct<B.length;Ct++){var Xt=B[Ct].branch;Lt[Xt]||(Lt[Xt]=!0,st.push(Xt))}for(var St=[],Ct=0;Ct<st.length;Ct++){var Zt=st[Ct],G=Z[Zt]&&Z[Zt].order,dt=G!=null?G:parseFloat("0."+Ct);St.push({name:Zt,declIndex:Ct,key:dt})}St.sort(function(wt,jt){return wt.key!==jt.key?wt.key-jt.key:wt.declIndex-jt.declIndex});for(var oe=[],ae={},fe={},ne=g.rotateCommitLabel!==!1,ye=50+(ne?40:0),Mt=0,Ct=0;Ct<St.length;Ct++){var Zt=St[Ct].name;if(ae[Zt]=Ct,oe.push(Zt),fe[Zt]=Mt,H){var $t=Zt.length*9;Mt+=50+(ne?40:0)+$t/2}else Mt+=ye}var Jt=!!g.parallelCommits,e={};if(Jt)for(var x={},C=0;C<B.length;C++){var S=B[C],Y=S.branch;if(x[Y]==null){var D=Z[Y]&&Z[Y].startCommit,At=0;if(D!=null&&B[g.commitMap[D]]){var U=B[g.commitMap[D]];At=(U.seq!=null?U.seq:0)+1}e[Y]=At,x[Y]=0}S.seq=e[Y]+x[Y],x[Y]++}for(var q=0;q<B.length;q++)B[q].seq==null&&(B[q].seq=q);for(var rt=g.dir||(H?"TB":"LR"),ct=H?ht:0,Ct=0;Ct<B.length;Ct++){var nt=B[Ct],zt=Jt?nt.seq:Ct;rt==="BT"&&!Jt&&(zt=B.length-1-Ct);var Ot=ct+zt*bt+yt,Ft=fe[nt.branch]!=null?fe[nt.branch]:(ae[nt.branch]||0)*Nt;H?(nt.x=Ft-Dt/2,nt.y=Ot-Dt/2):(nt.x=Ot-Dt/2,nt.y=Ft-Dt/2),nt.cx=H?Ft:Ot,nt.cy=H?Ot:Ft,nt.width=Dt,nt.height=Dt}for(var Pt=ct,Ct=0;Ct<B.length;Ct++){var Wt=H?B[Ct].cy:B[Ct].cx,Kt=Wt+ut;Kt>Pt&&(Pt=Kt)}Pt===ct&&(Pt=ct+bt);var Bt=-2;for(var ft in Z){var ce=ae[ft]||0,Ft=(fe[ft]!=null?fe[ft]:ce*Nt)+Bt;H?(Z[ft].x=Ft,Z[ft].y=ht,Z[ft].width=1,Z[ft].height=Pt-ht):(Z[ft].x=0,Z[ft].y=Ft,Z[ft].width=Pt,Z[ft].height=1),Z[ft].lane=ce,Z[ft].pos=Ft}for(var Ct=0;Ct<B.length;Ct++){var nt=B[Ct];H?(nt.x+=Bt,nt.cx+=Bt):(nt.y+=Bt,nt.cy+=Bt)}if(rt==="RL")for(var kt=Pt/2,Ct=0;Ct<B.length;Ct++){var nt=B[Ct];nt.cx=2*kt-nt.cx,nt.x=nt.cx-Dt/2}return g.dir=rt,g.maxPos=Pt,g.layoutOffset=yt,g.commitStep=ut,g.defaultPos=ht,g}function Sr(g,tt){for(var B=150,Z=50,H=50,yt=50,ut=110,ht=50,bt=450,Nt=200,Dt=150,st=g.sections,Lt=Dt,ft=0;ft<st.length;ft++){var Ct=st[ft],Xt=Ct.tasks.length,St=Lt;Ct.x=St,Ct.y=H,Ct.height=yt,Ct.width=Xt*B+(Xt-1)*Z,Ct.index=ft;for(var Zt=0;Zt<Xt;Zt++){var G=Ct.tasks[Zt];G.width=B,G.height=ht,G.x=Lt,G.y=ut,G.lineEndY=bt,G.sectionIndex=ft,G.faceCy=300+(5-G.score)*30,Lt+=B+Z}}return g.timelineStartX=Dt,g.timelineEndX=Lt-Z+50,g.timelineY=Nt,g}var Rr=["#ECECFF","#ffffde","#b5ff20","#b9b9ff","#ffff45","#d7ff86","#c286ff","#ff86ff","#ff8686","#ffc286","#c2ff86","#86ffc2"];function Mr(g,tt){for(var B=g.sections.length,Z=g.total,H=225,yt=225,ut=185,ht=186,bt=19,Nt=ut*.75,Dt=216,st=0,Lt=[],ft=0;ft<B;ft++){var Ct=g.sections[ft],Xt=Z>0?Ct.value/Z:0,St=st+Xt/2,Zt=2*Math.PI*St,G=Nt*Math.sin(Zt),dt=-Nt*Math.cos(Zt);Lt.push({label:Ct.label,value:Ct.value,percent:Math.round(Xt*100),color:Rr[ft%Rr.length],startFrac:st,endFrac:st+Xt,labelX:G,labelY:dt}),st+=Xt}for(var oe=17,ae=oe*.55,fe=0,ft=0;ft<B;ft++){var ne=g.sections[ft].label;g.showData&&(ne+=" ["+g.sections[ft].value+"]");var ye=ne.length*ae;ye>fe&&(fe=ye)}var Mt=H+Dt+18+4+fe+30;Mt=Math.max(Math.ceil(Mt),500);var $t=450;return{type:"pie",title:g.title,showData:g.showData,pieCx:H,pieCy:yt,pieR:ut,outerR:ht,titleY:bt,fontSize:oe,slices:Lt,sections:g.sections,canvasW:Mt,canvasH:$t}}function er(g,tt){for(var B=tt&&tt.packet||{},Z=B.bitsPerRow||32,H=B.bitWidth||27,yt=B.paddingX||5,ut=B.rowHeight||32,ht=H+yt,bt=[],Nt=0,Dt=1e5,st=0;st<g.fields.length&&bt.length<Dt;st++)for(var Lt=g.fields[st],ft=Lt.start;ft<=Lt.end&&bt.length<Dt;){var Ct=Math.floor(ft/Z),Xt=Ct*Z,St=Xt+Z-1,Zt=Math.min(Lt.end,St),G=ft-Xt,dt=Zt-ft+1;bt.push({label:Lt.label,startBit:ft,endBit:Zt,x:1+G*ht,y:15+Ct*(ut+15),width:dt*ht-yt,height:ut}),Ct>Nt&&(Nt=Ct),ft=Zt+1}var oe=2+Z*ht,ae=15+Nt*(ut+15)+ut,fe=ae+(g.title?47:15);return{type:"packet",title:g.title,blocks:bt,canvasW:oe,canvasH:fe,bitsPerRow:Z}}function Xr(g,tt){for(var B=!!g.title,Z=g.points.length>0,H=tt&&tt.quadrantChart||{},yt=H.chartWidth||500,ut=H.chartHeight||500,ht=31,bt=5,Nt=31,Dt=Z?31:5,st=ht,Lt=yt-bt,ft=Nt+(B?14:0),Ct=ut-Dt,Xt=(st+Lt)/2,St=(ft+Ct)/2,Zt=Xt-st,G=St-ft,dt=Lt-st,oe=Ct-ft,ae="Trebuchet MS,Verdana,Arial,sans-serif",fe=[{key:"q1",label:g.quadrants.q1,fill:"#ECECFF",color:"#111111",x:Xt,y:ft,w:Zt,h:G,labelCx:Xt+Zt/2},{key:"q2",label:g.quadrants.q2,fill:"#f1f1ff",color:"#0C0C0C",x:st,y:ft,w:Zt,h:G,labelCx:st+Zt/2},{key:"q3",label:g.quadrants.q3,fill:"#f6f6ff",color:"#070707",x:st,y:St,w:Zt,h:G,labelCx:st+Zt/2},{key:"q4",label:g.quadrants.q4,fill:"#fbfbff",color:"#020202",x:Xt,y:St,w:Zt,h:G,labelCx:Xt+Zt/2}],ne=0;ne<fe.length;ne++){var ye=fe[ne];Z?(ye.labelCy=ye.y+5,ye.labelBaseline="hanging"):(ye.labelCy=ye.y+ye.h/2,ye.labelBaseline="middle")}for(var Mt=[],ne=0;ne<g.points.length;ne++){var $t=g.points[ne],Jt={};if($t.className&&g.classes[$t.className]){var e=g.classes[$t.className];for(var x in e)e.hasOwnProperty(x)&&(Jt[x]=e[x])}for(var x in $t.styles)$t.styles.hasOwnProperty(x)&&(Jt[x]=$t.styles[x]);var C=5;if(Jt.radius!=null){var S=parseFloat(Jt.radius);!isNaN(S)&&S>0&&(C=S)}var Y=0;if(Jt["stroke-width"]!=null){var D=parseFloat(Jt["stroke-width"]);!isNaN(D)&&D>=0&&(Y=D)}var At=Jt.color||"#000000",U=Jt["stroke-color"]||null;Mt.push({name:$t.name,cx:st+$t.x*dt,cy:Ct-$t.y*oe,radius:C,fill:At,stroke:U,strokeWidth:Y})}var q=[];return g.xAxis&&(Z?(q.push({text:g.xAxis.left,anchorX:st+Zt/2,anchorY:Ct+10,textAnchor:"middle",baseline:"hanging",rotation:0,fontSize:16}),g.xAxis.right&&q.push({text:g.xAxis.right,anchorX:Xt+Zt/2,anchorY:Ct+10,textAnchor:"middle",baseline:"hanging",rotation:0,fontSize:16})):g.xAxis.right?(q.push({text:g.xAxis.left,anchorX:st+Zt/2,anchorY:5,textAnchor:"middle",baseline:"hanging",rotation:0,fontSize:16}),q.push({text:g.xAxis.right,anchorX:Xt+Zt/2,anchorY:5,textAnchor:"middle",baseline:"hanging",rotation:0,fontSize:16})):q.push({text:g.xAxis.left,anchorX:st,anchorY:5,textAnchor:"start",baseline:"hanging",rotation:0,fontSize:16})),g.yAxis&&(g.yAxis.right?(q.push({text:g.yAxis.left,anchorX:5,anchorY:St+G/2,textAnchor:"middle",baseline:"hanging",rotation:-90,fontSize:16}),q.push({text:g.yAxis.right,anchorX:5,anchorY:ft+G/2,textAnchor:"middle",baseline:"hanging",rotation:-90,fontSize:16})):q.push({text:g.yAxis.left,anchorX:5,anchorY:Ct,textAnchor:"start",baseline:"hanging",rotation:-90,fontSize:16})),{type:"quadrant",canvasW:yt,canvasH:ut,plotLeft:st,plotRight:Lt,plotTop:ft,plotBottom:Ct,midX:Xt,midY:St,hasPoints:Z,title:g.title,quadrants:fe,points:Mt,axisLabels:q,borderColor:"#D5D5D5",titleColor:"#111111",textColor:"#111111",fontFamily:ae}}function Kr(g,tt){var B=g.size&&g.size.width||900,Z=g.size&&g.size.height||600,H=48,yt=6,ut=yt*1.6,ht=B-H*2,bt=Z-H*2;function Nt(Ve){return H+Ve/100*ht}function Dt(Ve){return Z-H-Ve/100*bt}var st={axis:"#333333",axisText:"#131300",componentFill:"#ffffff",componentStroke:"#333333",labelColor:"#131300",link:"#333333",evolution:"#dc3545"},Lt=["Genesis","Custom Built","Product","Commodity"],ft=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Lt,Ct=g.axes.stageBoundaries,Xt=[];if(Ct&&Ct.length===ft.length)for(var St=0,Zt=0;Zt<Ct.length;Zt++)Xt.push({start:St,end:Ct[Zt]}),St=Ct[Zt];else for(var G=1/ft.length,dt=0;dt<ft.length;dt++)Xt.push({start:dt*G,end:(dt+1)*G});for(var oe=[],ae=0;ae<ft.length;ae++){var fe=Xt[ae],ne=H+fe.start*ht,ye=H+fe.end*ht;oe.push({label:ft[ae],startX:ne,endX:ye,centerX:(ne+ye)/2,boundaryX:ne,showBoundary:ae>0,labelY:Z-H/1.5})}for(var Mt={},$t=[],Jt=0;Jt<g.nodes.length;Jt++){var e=g.nodes[Jt],x=Nt(e.x),C=Dt(e.y),S=e.kind==="anchor",Y=e.labelOffsetX!=null?e.labelOffsetX:S?0:e.strategy?18:yt+2,D=e.labelOffsetY!=null?e.labelOffsetY:S?-3:e.strategy?-18:-(yt+2),At={id:e.id,name:e.name,kind:e.kind,strategy:e.strategy,inertia:e.inertia,isPipelineParent:e.isPipelineParent,inPipeline:e.inPipeline,cx:x,cy:C,radius:e.isPipelineParent?ut/2:yt,labelX:x+Y,labelY:C+D,labelAnchor:S?"middle":"start",labelBaseline:S?"middle":"alphabetic",labelBold:S};$t.push(At),Mt[At.id]=At}for(var U=[],q=0;q<g.pipelines.length;q++){for(var rt=g.pipelines[q],ct=[],nt=0;nt<rt.componentIds.length;nt++){var zt=Mt[rt.componentIds[nt]];zt&&ct.push(zt)}if(ct.length!==0){ct.sort(function(Ve,Ne){return Ve.cx-Ne.cx});for(var Ot=[],Ft=0;Ft<ct.length-1;Ft++)Ot.push({x1:ct[Ft].cx,y1:ct[Ft].cy,x2:ct[Ft+1].cx,y2:ct[Ft+1].cy});for(var Pt=1/0,Wt=-1/0,Kt=0,Bt=0;Bt<ct.length;Bt++)Pt=Math.min(Pt,ct[Bt].cx),Wt=Math.max(Wt,ct[Bt].cx),Kt=ct[Bt].cy;var ce=15,kt=yt*4,wt=Kt-kt/2,jt=Mt[rt.parent];jt&&(jt.cx=(Pt+Wt)/2,jt.cy=wt-ut/6,jt.radius=ut/2,jt.labelX=jt.cx,jt.labelY=jt.cy-(ut/2+4),jt.labelAnchor="middle"),U.push({boxX:Pt-ce,boxY:wt,boxW:Wt-Pt+ce*2,boxH:kt,links:Ot})}}for(var Ht=[],qt=0;qt<g.links.length;qt++){var re=g.links[qt];!Mt[re.from]||!Mt[re.to]||Ht.push({from:re.from,to:re.to,dashed:re.dashed,flow:re.flow,label:re.label})}for(var Ut=[],ve=0;ve<g.trends.length;ve++){var we=g.trends[ve],Se=Mt[we.nodeId];Se&&Ut.push({nodeId:we.nodeId,cx:Se.cx,cy:Se.cy,targetX:Nt(we.targetX),targetY:Dt(we.targetY)})}for(var be=[],Me=0;Me<g.notes.length;Me++)be.push({text:g.notes[Me].text,x:Nt(g.notes[Me].x),y:Dt(g.notes[Me].y)});for(var Fe=[],Ue=0;Ue<g.annotations.length;Ue++)Fe.push({number:g.annotations[Ue].number,text:g.annotations[Ue].text,x:Nt(g.annotations[Ue].x),y:Dt(g.annotations[Ue].y)});var De=null;g.annotationsBox&&(De={x:Nt(g.annotationsBox.x),y:Dt(g.annotationsBox.y)});for(var Ye=[],Pe=0;Pe<g.accelerators.length;Pe++)Ye.push({name:g.accelerators[Pe].name,x:Nt(g.accelerators[Pe].x),y:Dt(g.accelerators[Pe].y),decel:!1});for(var de=0;de<g.deaccelerators.length;de++)Ye.push({name:g.deaccelerators[de].name,x:Nt(g.deaccelerators[de].x),y:Dt(g.deaccelerators[de].y),decel:!0});return{type:"wardley",width:B,height:Z,padding:H,nodeRadius:yt,title:g.title,xLabel:g.axes.xLabel||"Evolution",yLabel:g.axes.yLabel||"Visibility",axisTop:H,axisBottom:Z-H,axisLeft:H,axisRight:B-H,stageBands:oe,nodes:$t,links:Ht,trends:Ut,pipelines:U,notes:be,annotations:Fe,annotationsBox:De,accelerators:Ye,colors:st,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function Ur(g,tt){var B={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextPadding:10},Z='"trebuchet ms",verdana,arial,sans-serif';function H(Pe){return String(Pe==null?"":Pe).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var yt=10,ut=50,ht=24;function bt(Pe){for(var de=0,Ve=0;Ve<Pe.length;Ve++)de=Math.max(de,Pe[Ve].length);return{width:Math.min(B.textMaxWidth,de*yt+ut),height:Pe.length*ht}}var Nt={ui:{index:0,label:"UI/Automation",band:[0,100],prefix:"UI/A: "},pcr:{index:0,label:"UI/Automation",band:[0,100],prefix:"UI/A: "},processor:{index:0,label:"UI/Automation",band:[0,100],prefix:"UI/A: "},cmd:{index:100,label:"Command/Read Model",band:[100,200],prefix:"C/RM: "},command:{index:100,label:"Command/Read Model",band:[100,200],prefix:"C/RM: "},rmo:{index:100,label:"Command/Read Model",band:[100,200],prefix:"C/RM: "},readmodel:{index:100,label:"Command/Read Model",band:[100,200],prefix:"C/RM: "},evt:{index:200,label:"Events",band:[200,300],prefix:"Stream: "},event:{index:200,label:"Events",band:[200,300],prefix:"Stream: "}},Dt={ui:{fill:"#ffffff",stroke:"#dbdada"},pcr:{fill:"#edb3f6",stroke:"#b88cbf"},processor:{fill:"#edb3f6",stroke:"#b88cbf"},rmo:{fill:"#d3f1a2",stroke:"#a3b732"},readmodel:{fill:"#d3f1a2",stroke:"#a3b732"},cmd:{fill:"#bcd6fe",stroke:"#679ac3"},command:{fill:"#bcd6fe",stroke:"#679ac3"},evt:{fill:"#ffb778",stroke:"#c19a0f"},event:{fill:"#ffb778",stroke:"#c19a0f"}};function st(Pe){var de=Pe.split(".");return de.length===2?de[1]:Pe}function Lt(Pe){var de=Pe.split(".");return de.length===2?de[0]:null}function ft(Pe,de,Ve){var Ne=de;for(var nr in Pe){var Ge=parseInt(nr,10);Ge>de&&Ge<Ve&&Ge>Ne&&(Ne=Ge)}return Ne+1}function Ct(Pe,de){var Ve=Nt[Pe.entityType]||Nt.evt,Ne=Lt(Pe.entityIdentifier);return Ne?{index:ft(de,Ve.band[0],Ve.band[1]),label:Ve.prefix+Ne}:{index:Ve.index,label:Ve.label}}var Xt={},St=[],Zt=[],G,dt=0;function oe(Pe){var de=st(Pe.entityIdentifier),Ve="<b>"+H(de)+"</b>",Ne=null,nr=[];if(Pe.dataInline)nr=[Pe.dataInline];else if(Pe.dataReference){for(var Ge=0;Ge<g.dataEntities.length;Ge++)if(g.dataEntities[Ge].name===Pe.dataReference){nr=g.dataEntities[Ge].lines.slice();break}}nr.length>0&&(Ne=nr.map(H).join("<br/>")),Ne!=null&&(Ve+='<br/><br/><code style="text-align: left; display: block;max-width:'+B.textMaxWidth+'px">'+Ne+"</code>");var Ie=[de];return nr.length>0&&(Ie=Ie.concat([""]).concat(nr)),{content:Ve,hasData:Ne!=null,lines:Ie}}for(var ae=0;ae<g.frames.length;ae++){var fe=g.frames[ae],ne=oe(fe),ye=bt(ne.lines),Mt=ye.width+2*B.boxTextPadding,$t=ye.height+2*B.boxTextPadding,Jt=Ct(fe,Xt),e=Xt[Jt.index];e||(e={index:Jt.index,label:Jt.label,r:0,y:Jt.index*B.swimlaneMinHeight+B.swimlaneGap,height:B.swimlaneMinHeight,maxHeight:B.swimlaneMinHeight},Xt[Jt.index]=e);var x=St.length>0?St[St.length-1]:void 0,C=G!==void 0?Xt[G]:void 0,S=Math.max(B.boxMinWidth,Math.min(B.boxMaxWidth,Mt))+2*B.boxPadding,Y=Math.max(B.boxMinHeight,Math.min(B.boxMaxHeight,$t))+2*B.boxPadding,D;C===void 0?D=B.contentStartX:C.index===e.index&&e.r?D=e.r+B.boxPadding:x===void 0?D=B.contentStartX:D=x.r-B.boxOverlap+B.boxPadding;var At=D+S+B.boxPadding;dt=Math.max(dt,At),e.r=D+S,e.maxHeight=Math.max(e.maxHeight,Y),e.height=Math.max(B.swimlaneMinHeight,e.maxHeight)+2*B.swimlanePadding;var U=Dt[fe.entityType]||{fill:"red",stroke:"black"};St.push({x:D,r:At,width:S,height:Y,swimlane:e,fill:U.fill,stroke:U.stroke,content:ne.content,frameName:fe.name,index:ae}),G=Jt.index;var q=ae===0&&fe.sourceFrames.length===0;if(!fe.isReset&&!q){var rt=St[St.length-1];if(fe.sourceFrames.length>0)for(var ct=0;ct<fe.sourceFrames.length;ct++){for(var nt=fe.sourceFrames[ct],zt=null,Ot=0;Ot<St.length;Ot++)if(St[Ot].frameName===nt){zt=St[Ot];break}zt&&Zt.push({sourceBox:zt,targetBox:rt})}else{for(var Ft=null,Pt=St.length-2;Pt>=0;Pt--)if(St[Pt].swimlane.index!==rt.swimlane.index){Ft=St[Pt];break}Ft&&Zt.push({sourceBox:Ft,targetBox:rt})}}}var Wt=Object.keys(Xt).map(function(Pe){return Xt[Pe]}).sort(function(Pe,de){return Pe.index-de.index});Wt.length>0&&(Wt[0].y=0);for(var Kt=1;Kt<Wt.length;Kt++)Wt[Kt].y=Wt[Kt-1].y+Wt[Kt-1].height+B.swimlaneGap;for(var Bt=Wt.length>0?Wt[Wt.length-1].y+Wt[Wt.length-1].height:0,ce=dt+B.swimlanePadding,kt=[],wt=0;wt<St.length;wt++){var jt=St[wt];kt.push({x:jt.x,y:jt.swimlane.y+B.swimlanePadding,width:jt.width,height:jt.height,fill:jt.fill,stroke:jt.stroke,content:jt.content,frameName:jt.frameName})}for(var Ht=[],qt=0;qt<Wt.length;qt++){var re=Wt[qt];Ht.push({x:0,y:re.y,width:ce,height:re.height,label:re.label,labelX:30,labelY:re.y+30})}for(var Ut=[],ve=0;ve<Zt.length;ve++){var we=Zt[ve],Se=we.sourceBox.swimlane.y+B.swimlanePadding,be=we.targetBox.swimlane.y+B.swimlanePadding,Me=Se>be,Fe=we.sourceBox.x+we.sourceBox.width*2/3,Ue=we.targetBox.x+we.targetBox.width/3,De,Ye;Me?(De=Se,Ye=be+we.targetBox.height):(De=Se+we.sourceBox.height,Ye=be),Ut.push({x1:Fe,y1:De,x2:Ue,y2:Ye})}return{type:"eventmodeling",width:ce,height:Bt,title:g.title,swimlanes:Ht,boxes:kt,relations:Ut,swimlaneBg:"rgb(250,250,250)",swimlaneStroke:"rgb(240,240,240)",relationStroke:"#000000",arrowColor:"#000000",fontFamily:"trebuchet ms,verdana,arial,sans-serif"}}var Jr={a:8.41,b:8.91,c:7.92,d:8.91,e:8.73,f:5.91,g:8.03,h:8.74,i:4.56,j:5.87,k:8.07,l:4.72,m:13.28,n:8.74,o:8.59,p:8.91,q:8.91,r:6.22,s:6.48,t:6.34,u:8.74,v:7.84,w:11.91,x:8.02,y:7.89,z:7.59,A:9.44,B:9.05,C:9.57,D:9.81,E:8.57,F:8.4,G:10.82,H:10.47,I:4.45,J:7.63,K:9.21,L:8.1,M:11.35,N:10.21,O:10.78,P:8.92,Q:10.81,R:9.31,S:7.7,T:9.29,U:10.38,V:9.4,W:13.63,X:8.91,Y:9.13,Z:8.8,0:8.39,1:8.39,2:8.39,3:8.39,4:8.39,5:8.39,6:8.39,7:8.39,8:8.39,9:8.39," ":4.5,".":5.88,",":5.88,"!":5.88,"?":5.88,"'":2.55,"-":5.88,":":5.88,"(":5.88,")":5.88,"/":8.39,"<":8.39,">":8.39,";":5.88,'"':5.88,"`":2.55,_:8.39},Yr=8;function ke(g){for(var tt=0,B=0;B<g.length;B++){var Z=g.charAt(B),H=Jr[Z];tt+=H==null?Yr:H}return tt}function ze(g,tt){if(g==null||g==="")return 1;for(var B=Jr[" "],Z=String(g).split(/<br\s*\/?>/i),H=0,yt=0;yt<Z.length;yt++){var ut=Z[yt].split(/\s+/).filter(function(Lt){return Lt.length>0});if(ut.length===0){H+=1;continue}for(var ht=1,bt=0,Nt=0;Nt<ut.length;Nt++){var Dt=ke(ut[Nt]),st=(bt>0?B:0)+Dt;bt+st>tt&&bt>0?(ht++,bt=Dt):bt+=st}H+=ht}return Math.max(1,H)}function lr(g,tt){var B=17.6;return 27.8+(g-1)*B+tt}function ir(g,tt){if(g.direction==="TD"||g.direction==="BT")return ur(g,tt);for(var B=200,Z=200,H=190,yt=20,ut=20,ht=50,bt=10,Nt=111,Dt=50,st=200,Lt=57,ft=61,Ct=150,Xt=[],St=g.explicitSections,Zt=!!(tt&&tt.timeline&&tt.timeline.disableMulticolor),G=0;G<g.sections.length;G++)for(var dt=g.sections[G],oe=0;oe<dt.periods.length;oe++){var ae=dt.periods[oe],fe;St?fe=G-1:Zt?fe=-1:fe=Xt.length-1,Xt.push({period:ae,sectionIdx:G,colorIdx:fe,events:ae.events})}for(var ne=Xt.length,ye=0,Mt=0;Mt<Xt.length;Mt++)Xt[Mt].events.length>ye&&(ye=Xt[Mt].events.length);for(var $t=Ct,Jt=0,G=0;G<g.sections.length;G++){var dt=g.sections[G],e=ze(dt.name,$t),x=lr(e,yt)+20;x>Jt&&(Jt=x)}for(var C=0,S=[],Mt=0;Mt<ne;Mt++){var Y=ze(Xt[Mt].period.name,Ct),D=lr(Y,yt)+20;S.push(D),D>C&&(C=D)}for(var At=Nt,U=St?At+Jt+Dt:At,q=U+C+50,rt=U+st,ct=C,nt=[],zt=0,Mt=0;Mt<ne;Mt++){for(var Ot=B+Mt*Z,ae=Xt[Mt],Ft=[],Pt=[],Wt=rt,Kt=0,Bt=0;Bt<ae.events.length;Bt++){var e=ze(ae.events[Bt],Ct),x=Math.max(ht,lr(e,ut));Ft.push(x),Pt.push(Wt),Wt+=x+bt,Kt+=x+(Bt>0?bt:0)}Kt>zt&&(zt=Kt),nt.push({x:Ot,centerX:Ot+H/2,period:ae.period,sectionIdx:ae.sectionIdx,colorIdx:ae.colorIdx,events:ae.events,eventHeights:Ft,eventYs:Pt})}var ce=rt+zt,kt=ce+Lt,wt=[];if(St)for(var jt=0,G=0;G<g.sections.length;G++){var dt=g.sections[G],Ht=dt.periods.length;if(Ht!==0){var qt=nt[jt],re=Ht*Z-10;wt.push({x:qt.x,y:At,width:re,height:Jt,name:dt.name,colorIdx:G-1}),jt+=Ht}}var Ut=B+(ne-1)*Z+H,ve=Ut+250,we=Math.ceil(kt+50),Se=B-50,be=Ut+250,Me=100*Math.max(1,ne)-155,Fe=20+ft-32;return{type:"timeline",title:g.title,hasSections:St,vertical:!1,canvasW:ve,canvasH:we,columns:nt,sectionRects:wt,cardWidth:H,cardHeight:ct,eventWidth:H,eventHeight:ht,taskRowY:U,sectionRowY:At,firstEventY:rt,arrowY:q,horizArrowX1:Se,horizArrowX2:be,vertArrowBot:kt,titleX:Me,titleY:Fe,maxEvents:ye,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function ur(g,tt){for(var B=200,Z=5,H=B+Z*2,yt=B+100,ut=yt+Z*2,ht=10,bt=20,Nt=20,Dt=30,st=50,Lt=150,ft=61,Ct=50+ft,Xt=g.explicitSections,St=!!(tt&&tt.timeline&&tt.timeline.disableMulticolor),Zt=[],G=0;G<g.sections.length;G++)for(var dt=g.sections[G],oe=0;oe<dt.periods.length;oe++){var ae=dt.periods[oe],fe;Xt?fe=G-1:St?fe=-1:fe=Zt.length-1,Zt.push({period:ae,sectionIdx:G,colorIdx:fe,events:ae.events})}for(var ne=50+Lt,ye=H+Nt,Mt=ut+st,$t=Math.max(50,ye+Mt-Z*2),Jt=$t+2*Z,e=ne,x=e+ye,C=x-Nt-H,S=x+st,Y=0,D=0,At=[],U=[],q=[],rt=0;rt<g.sections.length;rt++){var dt=g.sections[rt],ct=ze(dt.name,Jt),nt=lr(ct,Z);U.push(nt)}for(var rt=0;rt<Zt.length;rt++){var ae=Zt[rt],zt=ze(ae.period.name,B),Ot=lr(zt,Z);At.push(Ot),Ot>Y&&(Y=Ot);for(var Ft=0,Pt=[],Wt=0;Wt<ae.events.length;Wt++){var Kt=ze(ae.events[Wt],yt),Bt=lr(Kt,Z);Pt.push(Bt),Ft+=Bt,Wt>0&&(Ft+=ht)}q.push(Pt),Ft>D&&(D=Ft)}var ce=Math.max(Y,D),kt=ce+Dt,wt=[],jt=[],Ht=Ct;if(Xt)for(var qt=0,rt=0;rt<g.sections.length;rt++){var dt=g.sections[rt],re=dt.periods.length;if(re!==0){var Ut=U[rt],ve=x-ye;jt.push({x:ve,y:Ht,width:Jt,height:Ut,name:dt.name,colorIdx:rt-1});for(var we=Ht+Ut+bt,Se=0;Se<re;Se++){for(var ae=Zt[qt],Ot=At[qt],be=[],Me=we,Wt=0;Wt<ae.events.length;Wt++){var Bt=q[qt][Wt];be.push({x:S,y:Me,width:yt,height:Bt,lineY:Me+Bt/2,text:ae.events[Wt]}),Me+=Bt+ht}wt.push({taskX:C,taskY:we,taskWidth:B,taskHeight:Ot,taskName:ae.period.name,colorIdx:ae.colorIdx,events:be}),we+=kt,qt++}Ht+=Ut+bt+kt*re-(re>0?Dt*2:0)}}else for(var we=Ht,rt=0;rt<Zt.length;rt++){for(var ae=Zt[rt],Ot=At[rt],be=[],Me=we,Wt=0;Wt<ae.events.length;Wt++){var Bt=q[rt][Wt];be.push({x:S,y:Me,width:ut,height:Bt,lineY:Me+Bt/2,text:ae.events[Wt]}),Me+=Bt+ht}wt.push({taskX:C,taskY:we,taskWidth:H,taskHeight:Ot,taskName:ae.period.name,colorIdx:ae.colorIdx,events:be}),we+=kt}var Fe=wt[wt.length-1],Ue=Ct;if(Fe){for(var De=Fe.taskY+Fe.taskHeight,Se=0;Se<Fe.events.length;Se++){var Ye=Fe.events[Se];Ye.y+Ye.height>De&&(De=Ye.y+Ye.height)}Ue=De}var Pe=Ct-32,de=Ue+30,Ve=Math.ceil(S+ut+50),Ne=Math.ceil(de+30),nr=145,Ge=20+ft-32;return{type:"timeline",title:g.title,hasSections:Xt,vertical:!0,canvasW:Ve,canvasH:Ne,rows:wt,sectionRects:jt,timelineX:x,arrowY1:Pe,arrowY2:de,titleX:nr,titleY:Ge,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function zr(g,tt){if(!g)return 1;for(var B=8,Z=4,H=String(g).split(`
+`),yt=0,ut=0;ut<H.length;ut++){var ht=H[ut].split(/\s+/).filter(function(ft){return ft.length>0});if(ht.length===0){yt+=1;continue}for(var bt=1,Nt=0,Dt=0;Dt<ht.length;Dt++){var st=ht[Dt].length*B,Lt=(Nt>0?Z:0)+st;Nt+Lt>tt&&Nt>0?(bt++,Nt=st):Nt+=Lt}yt+=bt}return Math.max(1,yt)}function cr(g,tt){for(var B=200,Z=205,H=10,yt=25,ut=185,ht=175,bt=24,Nt=5,Dt=10,st=35,Lt=[],ft=0;ft<g.columns.length;ft++){for(var Ct=g.columns[ft],Xt=[],St=yt,Zt=0;Zt<Ct.cards.length;Zt++){var G=Ct.cards[Zt],dt=G.metadata||{},oe=!!(dt.ticket||dt.assigned),ae=zr(G.label||"",ht),fe=ae*bt,ne=oe?8+fe+bt:20+fe;Xt.push({id:G.id,label:G.label,metadata:dt,top:St,centerY:St+ne/2,height:ne,titleH:fe,hasMeta:oe,assignedW:dt.assigned?ke(String(dt.assigned)):0}),St+=ne+Nt}var ye;Xt.length>0?ye=St-Nt+Dt:ye=st+Dt,Lt.push({id:Ct.id,label:Ct.label,colorIdx:ft+2,x:H+ft*Z,y:H,width:B,height:ye,cards:Xt})}for(var Mt=0,ft=0;ft<Lt.length;ft++)Lt[ft].height>Mt&&(Mt=Lt[ft].height);var $t=Lt.length,Jt=H*2+($t>0?($t-1)*Z+B:0),e=H*2+Mt;return{type:"kanban",canvasW:Jt,canvasH:e,columns:Lt,cardWidth:ut,ticketBaseUrl:tt&&tt.kanban&&tt.kanban.ticketBaseUrl||null,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function Nr(g,tt,B){if(g==null||tt==null||g>=tt)return[];var Z=tt-g,H=Z/B,yt=Math.pow(10,Math.floor(Math.log(H)/Math.LN10)),ut=H/yt,ht;ut<=1?ht=1:ut<=2?ht=2:ut<=5?ht=5:ht=10,ht*=yt;for(var bt=[],Nt=Math.floor(g/ht)*ht,Dt=Nt;Dt<=tt+ht*1e-4;Dt+=ht)Dt>=g-ht*1e-4&&bt.push(Math.round(Dt*1e6)/1e6);return bt}function Fr(g,tt){var B=700,Z=500,H=21,yt=42,ut=50,ht=432,bt=459,Nt=441,Dt=467,st=18,Lt=8,ft=.61,Ct=!!(g.xAxis&&g.xAxis.title),Xt=Ct?ht:bt,St=Ct?Nt:Dt,Zt,G;if(g.yAxis&&g.yAxis.min!=null&&!isNaN(g.yAxis.min))Zt=g.yAxis.min,G=g.yAxis.max;else{Zt=1/0,G=-1/0;for(var dt=0;dt<g.series.length;dt++)for(var oe=g.series[dt].values,ae=0;ae<oe.length;ae++)oe[ae]<Zt&&(Zt=oe[ae]),oe[ae]>G&&(G=oe[ae]);isFinite(Zt)||(Zt=0,G=100);var fe=(G-Zt)*.1;Zt-=fe,G+=fe}var ne=Nr(Zt,G,15);ne.length>=2&&(Zt=ne[0],G=ne[ne.length-1]);for(var ye=0,dt=0;dt<ne.length;dt++){var Mt=String(ne[dt]);Mt.length>ye&&(ye=Mt.length)}var $t=35+ye*9;g.yAxis&&g.yAxis.title&&($t+=10);var Jt=B,e=Jt-$t,x=st;if(g.xAxis&&g.xAxis.type==="categorical"&&g.xAxis.categories&&g.xAxis.categories.length>0){var C=g.xAxis.categories.length,S=e/Math.max(1,C),Y=Math.floor(.7*S/2);Y>x&&(x=Y)}var D=[],At=[],U=0;if(g.xAxis.type==="categorical")if(U=g.xAxis.categories.length,U>1)for(var q=(e-2*x)/(U-1),dt=0;dt<U;dt++)D.push($t+x+dt*q),At.push(g.xAxis.categories[dt]);else U===1&&(D.push($t+e/2),At.push(g.xAxis.categories[0]));else{for(var rt=0,dt=0;dt<g.series.length;dt++)g.series[dt].values.length>rt&&(rt=g.series[dt].values.length);if(U=rt,U>1)for(var q=(e-2*Lt)/(U-1),ct=g.xAxis.min!=null?g.xAxis.min:0,nt=g.xAxis.max!=null?g.xAxis.max:U-1,dt=0;dt<U;dt++){D.push($t+Lt+dt*q);var zt=ct+(nt-ct)*dt/(U-1);At.push(sa(zt))}else U===1&&(D.push($t+e/2),At.push(sa(g.xAxis.min||0)))}function Ot(jt){return ut+(G-jt)/(G-Zt)*(Xt-ut)}for(var Ft=[],dt=0;dt<ne.length;dt++)Ft.push({value:ne[dt],y:Ot(ne[dt])});var Pt=U>1?D[1]-D[0]:e-2*st,Wt;if(U>=1){var Kt=(e-2*st)/Math.max(1,U),Bt=Math.floor(.7*Kt/2),ce=(e-2*Bt)/Math.max(1,U);Wt=Math.min(Bt*2,ce)*.95}else Wt=Pt*ft;for(var kt=[],dt=0;dt<g.series.length;dt++){for(var Mt=g.series[dt],wt=[],ae=0;ae<Mt.values.length&&ae<U;ae++)wt.push({x:D[ae],y:Ot(Mt.values[ae]),value:Mt.values[ae]});kt.push({type:Mt.type,points:wt,colorIdx:dt})}return{type:"xychart",canvasW:B,canvasH:Z,title:g.title,titleY:H,plotLeft:$t,plotRight:Jt,plotTop:yt,plotBot:St,tickTop:ut,tickBot:Xt,xCenters:D,xLabels:At,xAxisTitle:Ct?g.xAxis.title:"",yAxis:g.yAxis,yTicks:Ft,yMin:Zt,yMax:G,series:kt,barWidth:Wt,nX:U,showDataLabel:g.showDataLabel||!1,showDataLabelOutsideBar:g.showDataLabelOutsideBar||!1,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function sa(g){return Math.abs(g-Math.round(g))<1e-6?String(Math.round(g)):String(Math.round(g*100)/100)}function yr(g,tt){for(var B=700,Z=350,H=300,yt=g.ticks!=null&&g.ticks>0?g.ticks:5,ut=tt&&tt.radar||{},ht=tt&&tt.themeVariables||{},bt=ht.radar||{},Nt=typeof ut.axisScaleFactor=="number"?ut.axisScaleFactor:1,Dt=typeof ut.axisLabelFactor=="number"?ut.axisLabelFactor:1.05,st=typeof bt.curveOpacity=="number"?bt.curveOpacity:.5,Lt=typeof ut.curveTension=="number"?ut.curveTension:.17,ft=g.graticule||"circle",Ct=[],Xt=0;Xt<12;Xt++){var St="cScale"+Xt;ht[St]&&(Ct[Xt]=ht[St])}var Zt=g.axes.length;if(Zt<3){for(;g.axes.length<3;)g.axes.push({id:"_pad_"+g.axes.length,label:""});Zt=g.axes.length}for(var G=[],dt=0;dt<Zt;dt++)G.push(-Math.PI/2+dt*2*Math.PI/Zt);for(var oe=[],ae=H*Nt,dt=0;dt<Zt;dt++){var fe=G[dt],ne=Math.cos(fe),ye=Math.sin(fe);oe.push({id:g.axes[dt].id,label:g.axes[dt].label,angle:fe,tipX:ae*ne,tipY:ae*ye,labelX:(H*Dt+4)*ne,labelY:(H*Dt+4)*ye})}for(var Mt=0,dt=0;dt<g.curves.length;dt++){var $t=g.curves[dt].values;if(Array.isArray($t))for(var Jt=0;Jt<$t.length;Jt++)$t[Jt]>Mt&&(Mt=$t[Jt]);else if($t)for(var e in $t)$t.hasOwnProperty(e)&&$t[e]>Mt&&(Mt=$t[e])}g.max!=null&&(Mt=g.max);var x=g.min!=null?g.min:0;Mt<=x&&(Mt=x+1);for(var C=[],dt=0;dt<g.curves.length;dt++){for(var S=g.curves[dt],Y=[],Jt=0;Jt<Zt;Jt++){var D;Array.isArray(S.values)?D=Jt<S.values.length?S.values[Jt]:0:(D=S.values[oe[Jt].id],D==null&&(D=0));var At=Math.min(Math.max(D,x),Mt),U=(At-x)/(Mt-x)*H;Y.push({x:U*Math.cos(G[Jt]),y:U*Math.sin(G[Jt])})}C.push({id:S.id,label:S.label,points:Y,colorIdx:dt})}for(var q=[],dt=1;dt<=yt;dt++)q.push(H*dt/yt);return{type:"radar",canvasW:B,canvasH:B,centerX:Z,centerY:Z,outerR:H,title:g.title,axes:oe,curves:C,ringRadii:q,graticule:ft,curveOpacity:st,curveTension:Lt,cScaleColors:Ct,n:Zt,angles:G,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}var kr=[.301,.367,.325,.524,.524,.6,.706,.16,.367,.367,.367,.524,.367,.367,.367,.524,.524,.524,.524,.524,.524,.524,.524,.524,.524,.524,.367,.367,.524,.524,.524,.367,.771,.59,.566,.598,.613,.536,.525,.676,.654,.278,.477,.576,.506,.709,.638,.674,.558,.676,.582,.481,.581,.648,.587,.852,.557,.57,.55,.367,.355,.367,.524,.524,.524,.525,.557,.495,.557,.545,.37,.502,.546,.285,.367,.504,.295,.83,.546,.537,.557,.557,.389,.405,.396,.546,.49,.744,.501,.493,.475,.367,.524,.367,.524];function pr(g,tt){for(var B=String(g).split(/\n|<br\s*\/?\s*>/i),Z=0,H=0;H<B.length;H++){for(var yt=0,ut=0;ut<B[H].length;ut++){var ht=B[H].charCodeAt(ut);if(ht<32||ht>126)return null;yt+=kr[ht-32]}Z=Math.max(Z,yt*tt)}return Z}function rr(g,tt){var B=8,Z=20,H=30,yt=24,ut=16,ht=tt&&tt.fontSize||16,bt=tt&&tt.fontFamily||'"trebuchet ms",verdana,arial,sans-serif',Nt=g.root;function Dt(Mt){if(Mt.type==="space")Mt.size={width:0,height:0,x:0,y:0};else if(!Mt.children||Mt.children.length===0)if(Mt.label){var $t=Mt.shape==="circle"||Mt.shape==="doublecircle",Jt=Mt.shape==="diamond"||Mt.shape==="rhombus"||Mt.shape==="decision",e=Mt.shape==="cylinder",x=Mt.shape==="block-arrow",C=Jt?150:$t?300:null,S=o(Mt.label,ht,bt,C),Y,D,At=String(Mt.label).split(/\n|<br\s*\/?\s*>/i).length,U=At*Math.round(ht*1.5),q=pr(Mt.label,ht),rt=q!=null?Math.ceil(q):Math.ceil(S.width*1.04);if($t){var ct=Mt.shape==="doublecircle",nt=Math.max(rt,Math.ceil(S.height))+(ct?24:10);Y=Math.max(Z,nt),D=Math.max(H,nt)}else if(Jt){var zt=Math.ceil(Math.max(S.width,S.height)*1.6);Y=Math.max(Z,zt),D=Math.max(H,zt)}else if(x)D=U+2*B,Y=rt+D+B,Y=Math.max(Z,Y),D=Math.max(H,D);else if(e){Y=Math.max(Z,rt+B);var Ot=Y/2/(2.5+Y/50);D=Math.ceil(U+B+3*Ot)}else if(Mt.shape==="rect"||Mt.shape==="rounded"){var Ft=Mt.shape==="rounded"?2*B:4*B;Y=Math.max(Z,rt+Ft),D=Math.max(H,U+2*B)}else if(Mt.shape==="lean_right"||Mt.shape==="lean_left"||Mt.shape==="trapezoid"||Mt.shape==="inv_trapezoid"){var Pt=Mt.shape==="inv_trapezoid";D=U+(Pt?2:1)*B,Y=Math.max(Z,rt+(Pt?2:1)*B+D)}else Mt.shape==="subroutine"?(Y=Math.max(Z,rt+2*B+B),D=Math.max(H,U+B)):Mt.shape==="stadium"?(D=Math.max(H,U+B),Y=Math.max(Z,rt+Math.ceil(D/4)+B)):Mt.shape==="hexagon"?(D=Math.max(H,U+B),Y=Math.max(Z,rt+Math.ceil(D/2)+B)):Mt.shape==="odd"?(D=Math.max(H,U+B),Y=Math.max(Z,rt+Math.ceil(D/4)+B)):(Y=Math.max(Z,rt+yt),D=Math.max(H,Math.ceil(S.height)+ut));Mt.size={width:Y,height:D,x:0,y:0},Mt._naturalWidth=Y,Mt._naturalHeight=D}else Mt.size={width:Z,height:H,x:0,y:0};if(Mt.children)for(var Wt=0;Wt<Mt.children.length;Wt++)Dt(Mt.children[Wt])}function st(Mt){for(var $t=0,Jt=0,e=0;e<Mt.children.length;e++){var x=Mt.children[e];if(x.type!=="space"){var C=x.size||{width:0,height:0},S=C.width/(x.widthInColumns||1);S>$t&&($t=S),C.height>Jt&&(Jt=C.height)}}return{width:$t,height:Jt}}function Lt(Mt,$t,Jt){if($t=$t||0,Jt=Jt||0,(!Mt.size||!Mt.size.width)&&(Mt.size={width:$t,height:Jt,x:0,y:0}),!(!Mt.children||Mt.children.length===0)){for(var e=0;e<Mt.children.length;e++)Lt(Mt.children[e],0,0);for(var x=st(Mt),C=x.width,S=x.height,e=0;e<Mt.children.length;e++){var Y=Mt.children[e];if(Y.size){if(Y.type==="space"){Y.size.width=C*(Y.widthInColumns||1)+B*((Y.widthInColumns||1)-1),Y.size.height=S,Y.size.x=0,Y.size.y=0;continue}(Y.shape==="block-arrow"||Y.shape==="circle"||Y.shape==="doublecircle")&&(Y._naturalWidth==null&&(Y._naturalWidth=Y.size.width),Y._naturalHeight==null&&(Y._naturalHeight=Y.size.height)),Y.size.width=C*(Y.widthInColumns||1)+B*((Y.widthInColumns||1)-1),Y.size.height=S,Y.size.x=0,Y.size.y=0}}for(var e=0;e<Mt.children.length;e++)Lt(Mt.children[e],C,S);for(var D=Mt.columns!=null?Mt.columns:-1,At=0,e=0;e<Mt.children.length;e++)At+=Mt.children[e].widthInColumns||1;var U=At;D>0&&D<At&&(U=D);var q=Math.ceil(At/U),rt=U*(C+B)+B,ct=q*(S+B)+B;if(rt<$t){rt=$t,ct=Jt;for(var nt=($t-U*B-B)/U,zt=(Jt-q*B-B)/q,e=0;e<Mt.children.length;e++){var Y=Mt.children[e];Y.size&&(Y.size.width=nt,Y.size.height=zt,Y.size.x=0,Y.size.y=0)}}if(rt<(Mt.size.width||0)){rt=Mt.size.width;var Ot=D>0?Math.min(Mt.children.length,D):Mt.children.length;if(Ot>0)for(var Ft=(rt-Ot*B-B)/Ot,e=0;e<Mt.children.length;e++){var Y=Mt.children[e];Y.size&&(Y.size.width=Ft)}}Mt.size={width:rt,height:ct,x:0,y:0}}}function ft(Mt,$t){return Mt<0?{px:$t,py:0}:Mt===1?{px:0,py:$t}:{px:$t%Mt,py:Math.floor($t/Mt)}}function Ct(Mt){var $t=Mt.columns!=null?Mt.columns:-1;if(!(!Mt.children||Mt.children.length===0)){for(var Jt={},e={},x=0,C=0;C<Mt.children.length;C++){var S=Mt.children[C];if(S.size){var Y=ft($t,x),D=Jt[Y.py]||0;S.size.height>D&&(Jt[Y.py]=S.size.height),e[Y.py]=(e[Y.py]||0)+1;var At=S.widthInColumns||1;$t>0&&(At=Math.min(At,$t-x%$t)),x+=At}}for(var U={},q=0,rt=Object.keys(Jt).map(Number).sort(function(wt,jt){return wt-jt}),ct=0;ct<rt.length;ct++)U[rt[ct]]=q,q+=Jt[rt[ct]]+B;x=0;for(var nt=Mt.size&&Mt.size.x!=null?Mt.size.x-(Mt.size.width/2||0):-B,zt=0,Ot=0,Ft=0;Ft<Mt.children.length;Ft++)Ot+=Mt.children[Ft].widthInColumns||1;for(var Pt=$t>0?$t:Math.max(Ot,1),Wt=Pt>0?(Mt.size.width-(Pt+1)*B)/Pt:0,C=0;C<Mt.children.length;C++){var S=Mt.children[C];if(S.size){var Y=ft($t,x);Y.py!==zt&&(zt=Y.py,nt=Mt.size&&Mt.size.x!=null?Mt.size.x-(Mt.size.width/2||0):-B);var Kt=Math.max(S.size.width,Wt),Bt=Kt/2;S.size.x=nt+B+Bt,nt=S.size.x+Bt;var ce=U[Y.py]||0,kt=Jt[Y.py]||S.size.height;S.size.y=Mt.size.y-Mt.size.height/2+ce+kt/2+B,S.children&&Ct(S);var At=S.widthInColumns||1;$t>0&&(At=Math.min(At,$t-x%$t)),x+=At}}}}function Xt(Mt,$t){if($t=$t||{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},Mt.size&&Mt.id!=="root"){var Jt=Mt.size;Jt.x-Jt.width/2<$t.minX&&($t.minX=Jt.x-Jt.width/2),Jt.y-Jt.height/2<$t.minY&&($t.minY=Jt.y-Jt.height/2),Jt.x+Jt.width/2>$t.maxX&&($t.maxX=Jt.x+Jt.width/2),Jt.y+Jt.height/2>$t.maxY&&($t.maxY=Jt.y+Jt.height/2)}if(Mt.children)for(var e=0;e<Mt.children.length;e++)Xt(Mt.children[e],$t);return $t}Dt(Nt),Lt(Nt,0,0),Ct(Nt);var St=Xt(Nt);St.minX===1/0&&(St.minX=0,St.minY=0,St.maxX=0,St.maxY=0);var Zt=-St.minX,G=-St.minY,dt=[],oe=g.styles||{};function ae(Mt){if(Mt.id!=="root"&&Mt.size&&Mt.type!=="space"){var $t=Mt.size,Jt=$t.x+Zt-$t.width/2,e=$t.y+G-$t.height/2,x=!!(Mt.children&&Mt.children.length>0),C=$t.width,S=$t.height,Y=Jt,D=e,At=Mt.shape==="lean_right"||Mt.shape==="lean_left";!x&&At&&(C=$t.width+B,Y=Jt-B/2);var U=Mt.shape==="circle"||Mt.shape==="doublecircle"||Mt.shape==="block-arrow";!x&&U&&(Mt._naturalWidth&&Mt._naturalWidth<$t.width&&(C=Mt._naturalWidth,Y=Jt+($t.width-C)/2),Mt._naturalHeight&&Mt._naturalHeight<$t.height&&(S=Mt._naturalHeight,D=e+($t.height-S)/2)),dt.push({id:Mt.id,x:Y,y:D,width:C,height:S,drawio:{shape:x?"rect":Mt.shape,labelText:Mt.label||"",cssStyles:oe[Mt.id]||null,isSubgraph:x,type:x?"group":null,directions:Mt.directions||null}})}if(Mt.children)for(var q=0;q<Mt.children.length;q++)ae(Mt.children[q])}ae(Nt);for(var fe=[],ne=0;ne<g.edges.length;ne++){var ye=g.edges[ne];fe.push({id:"e"+ne,sources:[ye.source],targets:[ye.target],drawio:{arrowTypeStart:"none",arrowTypeEnd:ye.arrowEnd||"block",pattern:ye.pattern||"solid",text:ye.text||null,length:1}})}return{id:"root",children:dt,edges:fe,drawio:{direction:"LR",orthEdges:!1,diagramType:"block"}}}function Pr(g,tt){var B=50,Z=10,H=50,yt=20,ut=216,ht=60,bt=0,Nt=typeof screen!="undefined"&&screen&&screen.availWidth>0?screen.availWidth:800,Dt=14,st='"Open Sans", sans-serif',Lt=14,ft=10.5,Ct=11.48,Xt=3,St=1.1395,Zt=1.0671;function G(kt,wt,jt){var Ht=String(kt).split(/\s+/).filter(function(we){return we.length>0});if(Ht.length===0)return[];for(var qt=[],re=Ht[0],Ut=1;Ut<Ht.length;Ut++){var ve=re+" "+Ht[Ut];o(ve,wt,st).width<=jt?re=ve:(qt.push(re),re=Ht[Ut])}return qt.push(re),qt}function dt(kt,wt){return kt>0?wt*(St+(kt-1)*Zt):0}var oe=typeof mxUtils!="undefined"&&mxUtils&&mxUtils.getSizeForString;function ae(kt,wt,jt){for(var Ht=0,qt=0;qt<kt.length;qt++){var re;jt&&oe?re=o("<b>"+kt[qt]+"</b>",wt,st).width:(re=o(kt[qt],wt,st).width,jt&&(re*=1.06)),Ht=Math.max(Ht,re)}return Ht}var fe={person:"Person",system:"Software System",container:"Container",component:"Component"};function ne(kt){var wt=kt.category==="node"?null:fe[kt.category]||kt.category;return wt==null?kt.technology?"["+kt.technology+"]":null:kt.technology?"["+wt+": "+kt.technology+"]":"["+wt+"]"}function ye(kt){var wt;kt.isDb?wt=ut-yt-2*yt:kt.isQueue?wt=ut-yt/2-2*yt:wt=ut-2*yt;var jt=G(kt.label||"",Lt,wt),Ht=ne(kt),qt=Ht?G(Ht,ft,wt):[],re=kt.description?G(kt.description,Ct,wt):[],Ut=0,ve=0;jt.length>0&&(ve+=dt(jt.length,Lt),Ut++),qt.length>0&&(ve+=dt(qt.length,ft),Ut++),re.length>0&&(ve+=dt(re.length,Ct),Ut++),Ut>1&&(ve+=Xt*(Ut-1));var we=Math.max(ae(jt,Lt,!0),ae(qt,ft,!1),ae(re,Ct,!1)),Se=yt*2;if(kt.category==="person"){var be=Math.max(we+Se,ut,100),Me=Math.min(Math.max(be*.23,16),56),Fe=ve+Se;kt.width=be,kt.height=Fe+2*Me-Me*.27,kt.personHeadR=Me,kt.personBodyH=Fe,kt.personBodyRadius=Math.min(be*.177,Fe*.45)}else if(kt.isDb){var Ue=Math.max(ut-yt,we)+yt,De=Ue/2/(2.5+Ue/50);kt.width=Ue,kt.height=ve+yt+3*De,kt.cylinderRy=De}else if(kt.isQueue){var Ye=ve+yt/2,Pe=Ye/2,de=Pe/(2.5+Ye/50);kt.width=Math.max(ut-yt/2,we)+de+yt/2,kt.height=Ye,kt.queueRx=de}else kt.width=Math.max(we+Se,ut),kt.height=ve+Se;kt.width=Math.ceil(kt.width),kt.c4Lines={name:jt,type:qt,descr:re}}function Mt(kt){for(var wt=0;wt<kt.length;wt++){var jt=kt[wt];jt.children&&jt.children.length>0?Mt(jt.children):ye(jt)}}Mt(g.elements);var $t=Math.max(1,g.c4ShapeInRow||4),Jt=Math.max(1,g.c4BoundaryInRow||2),e=B,x=Z;function C(){return{name:"",data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},nextData:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0}}}function S(kt,wt,jt,Ht,qt){kt.nextData.startx=kt.data.startx=wt,kt.nextData.stopx=kt.data.stopx=jt,kt.nextData.starty=kt.data.starty=Ht,kt.nextData.stopy=kt.data.stopy=qt}function Y(kt,wt,jt,Ht){kt[wt]===void 0?kt[wt]=jt:kt[wt]=Ht(jt,kt[wt])}function D(kt,wt){kt.nextData.cnt+=1;var jt=kt.nextData.startx===kt.nextData.stopx?kt.nextData.stopx+wt.margin:kt.nextData.stopx+wt.margin*2,Ht=jt+wt.width,qt=kt.nextData.starty+wt.margin*2,re=qt+wt.height;(jt>=kt.data.widthLimit||Ht>=kt.data.widthLimit||kt.nextData.cnt>$t)&&(jt=kt.nextData.startx+wt.margin+bt,qt=kt.nextData.stopy+wt.margin*2,kt.nextData.stopx=Ht=jt+wt.width,kt.nextData.starty=kt.nextData.stopy,kt.nextData.stopy=re=qt+wt.height,kt.nextData.cnt=1),wt.x=jt,wt.y=qt,Y(kt.data,"startx",jt,Math.min),Y(kt.data,"starty",qt,Math.min),Y(kt.data,"stopx",Ht,Math.max),Y(kt.data,"stopy",re,Math.max),Y(kt.nextData,"startx",jt,Math.min),Y(kt.nextData,"starty",qt,Math.min),Y(kt.nextData,"stopx",Ht,Math.max),Y(kt.nextData,"stopy",re,Math.max)}function At(kt,wt){kt.data.stopx+=wt,kt.data.stopy+=wt}function U(kt,wt){for(var jt=0;jt<wt.length;jt++){var Ht=wt[jt];Ht.width=Math.max(Ht.width||ut,ut),Ht.height=Math.max(Ht.height||ht,ht),Ht.margin=Ht.margin||H,D(kt,Ht)}At(kt,H)}function q(kt){var wt=o(kt.label||"",Dt+2,st).height,jt=8+wt,Ht=kt.boundaryType||kt.technology;if(Ht){var qt=o("["+Ht+"]",Dt,st).height;jt+=5+qt}if(kt.description){var re=o(kt.description,Dt-2,st).height;jt+=20+re}return jt}function rt(kt,wt){if(!(!wt||wt.length===0)){var jt=Math.min(Jt,wt.length),Ht=C();Ht.data.widthLimit=kt.data.widthLimit/jt;for(var qt=0;qt<wt.length;qt++){var re=wt[qt];if(qt===0||qt%Jt===0){var Ut=q(re),ve=kt.data.startx+B,we=kt.data.stopy+Z+Ut;S(Ht,ve,ve,we,we)}else{var Se=Ht.data.stopx!==Ht.data.startx?Ht.data.stopx+B:Ht.data.startx,be=Ht.data.starty;S(Ht,Se,Se,be,be)}Ht.name=re.id;var Me=[],Fe=[];if(re.children)for(var Ue=0;Ue<re.children.length;Ue++){var De=re.children[Ue];De.children&&De.children.length>0?Fe.push(De):Me.push(De)}Me.length>0&&U(Ht,Me),Fe.length>0&&rt(Ht,Fe),re.x=Ht.data.startx,re.y=Ht.data.starty,re.width=Ht.data.stopx-Ht.data.startx,re.height=Ht.data.stopy-Ht.data.starty,kt.data.stopy=Math.max(Ht.data.stopy+H,kt.data.stopy),kt.data.stopx=Math.max(Ht.data.stopx+H,kt.data.stopx),e=Math.max(e,kt.data.stopx),x=Math.max(x,kt.data.stopy)}}}var ct=C();S(ct,B,B,Z,Z),ct.data.widthLimit=Nt;for(var nt=[],zt=[],Ot=0;Ot<g.elements.length;Ot++){var Ft=g.elements[Ot];Ft.children&&Ft.children.length>0?zt.push(Ft):nt.push(Ft)}if(nt.length>0){U(ct,nt);for(var Pt=0;Pt<nt.length;Pt++)nt[Pt].x+=B;ct.data.stopx+=B,e=Math.max(e,ct.data.stopx+H),x=Math.max(x,ct.data.stopy+H)}if(zt.length>0){var Wt=C();S(Wt,ct.data.startx+B,Math.max(ct.data.stopx,ct.data.startx+B),ct.data.starty,ct.data.stopy),Wt.data.widthLimit=ct.data.widthLimit,rt(Wt,zt),ct.data.stopx=Math.max(ct.data.stopx,Wt.data.stopx),ct.data.stopy=Math.max(ct.data.stopy,Wt.data.stopy),e=Math.max(e,Wt.data.stopx+H),x=Math.max(x,Wt.data.stopy+H)}function Kt(kt,wt,jt){for(var Ht=0;Ht<kt.length;Ht++){var qt=kt[Ht],re=qt.x,Ut=qt.y;qt.x=re-wt,qt.y=Ut-jt,qt.children&&qt.children.length>0&&Kt(qt.children,re,Ut)}}Kt(g.elements,0,0);var Bt=e+B,ce=x+Z;return{type:"c4",title:g.title,canvasW:Bt,canvasH:ce,elements:g.elements,relations:g.relations,fontFamily:st}}function ta(g,tt){var B=80,Z=20,H=200.8,yt=200.8,ut=42.5,ht=39.5,bt=40,Nt=42.5,Dt=40,st="Trebuchet MS,Verdana,Arial,sans-serif";function Lt(Me){return Math.max(Nt,bt+Me)}function ft(Me){if(!Me.label)return 0;var Fe=o(Me.label,16,st).width+6;return Math.max(0,(Fe-B)/2)}for(var Ct={},Xt=[],St=0;St<g.services.length;St++){var Zt=g.services[St],G={id:Zt.id,kind:"service",icon:Zt.icon,label:Zt.label,parent:Zt.parent,gridRow:null,gridCol:null};Ct[Zt.id]=G,Xt.push(G)}for(var St=0;St<g.junctions.length;St++){var dt=g.junctions[St],G={id:dt.id,kind:"junction",icon:null,label:"",parent:dt.parent,gridRow:null,gridCol:null};Ct[dt.id]=G,Xt.push(G)}Xt.length>0&&(Xt[0].gridRow=0,Xt[0].gridCol=0);for(var oe=!0,ae=0;oe&&ae<20;){oe=!1,ae++;for(var St=0;St<g.edges.length;St++){var fe=g.edges[St],ne=Ct[fe.source],ye=Ct[fe.target];if(!(!ne||!ye)&&!(ne.gridRow==null&&ye.gridRow==null)){var Mt=ne.gridRow!=null,$t=ye.gridRow!=null;if(Mt&&!$t){var Jt=wr(ne,fe.sourcePort,fe.targetPort);ye.gridRow=Jt.row,ye.gridCol=Jt.col,oe=!0}else if(!Mt&&$t){var Jt=wr(ye,fe.targetPort,fe.sourcePort);ne.gridRow=Jt.row,ne.gridCol=Jt.col,oe=!0}}}}for(var e=0,St=0;St<Xt.length;St++)Xt[St].gridCol!=null&&Xt[St].gridCol>e&&(e=Xt[St].gridCol);for(var St=0;St<Xt.length;St++)Xt[St].gridRow==null&&(e++,Xt[St].gridRow=0,Xt[St].gridCol=e);for(var x=1/0,C=1/0,St=0;St<Xt.length;St++)Xt[St].gridRow<x&&(x=Xt[St].gridRow),Xt[St].gridCol<C&&(C=Xt[St].gridCol);for(var St=0;St<Xt.length;St++)Xt[St].gridRow-=x,Xt[St].gridCol-=C;for(var S=[],Y={},St=0;St<g.groups.length;St++)S.push(g.groups[St].id),Y[g.groups[St].id]=g.groups[St];for(var D=0,At=S.slice(),U={},q=0,rt=Xt.filter(function(Me){return!Me.parent}),ct=-1,St=0;St<rt.length;St++)rt[St].gridCol>ct&&(ct=rt[St].gridCol);rt.length>0&&(q=ct+2);for(var St=0;St<At.length;St++){var nt=At[St];U[nt]=q;for(var zt=Xt.filter(function(Fe){return Fe.parent===nt}),Ot=-1,Ft=1/0,dt=0;dt<zt.length;dt++)zt[dt].gridCol>Ot&&(Ot=zt[dt].gridCol),zt[dt].gridCol<Ft&&(Ft=zt[dt].gridCol);if(zt.length>0){for(var dt=0;dt<zt.length;dt++)zt[dt].gridCol=zt[dt].gridCol-Ft+q;q+=Ot-Ft+1.35}}for(var St=0;St<Xt.length;St++){var G=Xt[St];G.parent?(G.x=Dt+Nt+G.gridCol*H,G.y=Dt+ut+G.gridRow*yt):(G.x=Dt+G.gridCol*H,G.y=Dt+G.gridRow*yt),G.width=B,G.height=B}for(var Pt=[],St=0;St<g.groups.length;St++){var Wt=g.groups[St],Kt=Xt.filter(function(Fe){return Fe.parent===Wt.id});if(Kt.length!==0){for(var Bt=1/0,ce=1/0,kt=-1/0,wt=-1/0,dt=0;dt<Kt.length;dt++){var G=Kt[dt];G.x<Bt&&(Bt=G.x),G.y<ce&&(ce=G.y),G.x+G.width>kt&&(kt=G.x+G.width),G.y+G.height+Z>wt&&(wt=G.y+G.height+Z)}for(var jt=0,Ht=0,dt=0;dt<Kt.length;dt++){var G=Kt[dt];G.x===Bt&&(jt=Math.max(jt,ft(G))),G.x+G.width===kt&&(Ht=Math.max(Ht,ft(G)))}var qt=Lt(jt),re=Lt(Ht);Pt.push({id:Wt.id,icon:Wt.icon,label:Wt.label,x:Bt-qt,y:ce-ut,width:kt-Bt+qt+re,height:wt-ce+ut+ht})}}for(var Ut=0,ve=0,St=0;St<Xt.length;St++){var we=Xt[St].x+Xt[St].width,Se=Xt[St].y+Xt[St].height+Z;we>Ut&&(Ut=we),Se>ve&&(ve=Se)}for(var St=0;St<Pt.length;St++){var be=Pt[St];be.x+be.width>Ut&&(Ut=be.x+be.width),be.y+be.height>ve&&(ve=be.y+be.height)}return Ut+=Dt,ve+=Dt,{type:"architecture",canvasW:Ut,canvasH:ve,nodes:Xt,nodeMap:Ct,groups:Pt,archEdges:g.edges,iconSize:B,labelHeight:Z,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function wr(g,tt,B){var Z=g.gridRow,H=g.gridCol;return tt==="R"?H++:tt==="L"?H--:tt==="B"?Z++:tt==="T"&&Z--,{row:Z,col:H}}function Sa(g){return g==="R"?"L":g==="L"?"R":g==="T"?"B":g==="B"?"T":g}function ca(g,tt){for(var B=tt&&tt.sankey||{},Z=typeof B.width=="number"?B.width:600,H=typeof B.height=="number"?B.height:400,yt=typeof B.nodeWidth=="number"?B.nodeWidth:10,ut=B.showValues!==!1,ht=(typeof B.nodePadding=="number"?B.nodePadding:12)+(ut?15:0),bt=["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Nt={},Dt=[],st=0;st<g.links.length;st++){var Lt=g.links[st];Nt[Lt.source]||(Nt[Lt.source]={id:Lt.source,inLinks:[],outLinks:[],layer:0,totalFlow:0},Dt.push(Nt[Lt.source])),Nt[Lt.target]||(Nt[Lt.target]={id:Lt.target,inLinks:[],outLinks:[],layer:0,totalFlow:0},Dt.push(Nt[Lt.target]));var ft={source:Lt.source,target:Lt.target,value:Lt.value};Nt[Lt.source].outLinks.push(ft),Nt[Lt.target].inLinks.push(ft)}var Ct={};for(var Xt in Nt)Nt.hasOwnProperty(Xt)&&(Ct[Xt]=Nt[Xt].inLinks.length);for(var St=[],st=0;st<Dt.length;st++)Ct[Dt[st].id]===0&&St.push(Dt[st]);for(var Zt=[];St.length>0;){var G=St.shift();Zt.push(G);for(var dt=0;dt<G.outLinks.length;dt++){var oe=Nt[G.outLinks[dt].target];Ct[oe.id]--,Ct[oe.id]===0&&St.push(oe)}}for(var st=0;st<Dt.length;st++)Zt.indexOf(Dt[st])<0&&Zt.push(Dt[st]);for(var st=0;st<Zt.length;st++){for(var G=Zt[st],fe=0,dt=0;dt<G.inLinks.length;dt++){var ae=Nt[G.inLinks[dt].source];ae.layer+1>fe&&(fe=ae.layer+1)}G.layer=fe}for(var fe=0,st=0;st<Zt.length;st++)Zt[st].layer>fe&&(fe=Zt[st].layer);for(var st=0;st<Zt.length;st++)Zt[st].outLinks.length===0&&(Zt[st].layer=fe);for(var ne=fe+1,ye=0,st=0;st<Zt.length;st++){for(var G=Zt[st],Mt=0,$t=0,dt=0;dt<G.inLinks.length;dt++)Mt+=G.inLinks[dt].value;for(var dt=0;dt<G.outLinks.length;dt++)$t+=G.outLinks[dt].value;G.totalFlow=Math.max(Mt,$t),G.totalFlow>ye&&(ye=G.totalFlow)}for(var Jt=[],e=[],Lt=0;Lt<ne;Lt++)Jt.push(0),e.push(0);for(var st=0;st<Zt.length;st++)Jt[Zt[st].layer]+=Zt[st].totalFlow,e[Zt[st].layer]++;for(var x=[],Lt=0;Lt<ne;Lt++)x.push([]);for(var st=0;st<Dt.length;st++)x[Dt[st].layer].push(Dt[st]);for(var C=ne<=1?0:(Z-yt)/(ne-1),st=0;st<Zt.length;st++){var G=Zt[st];G.x=ne<=1?(Z-yt)/2:G.layer*C,G.width=yt,G.sourceLinks=G.outLinks,G.targetLinks=G.inLinks}for(var S=0,st=0;st<Zt.length;st++)for(var dt=0;dt<Zt[st].outLinks.length;dt++){var Y=Zt[st].outLinks[dt];Y.index=S++,Y.sourceNode=Nt[Y.source],Y.targetNode=Nt[Y.target]}for(var D=0,Lt=0;Lt<x.length;Lt++)x[Lt].length>D&&(D=x[Lt].length);for(var At=Math.min(ht,D>1?H/(D-1):ht),U=1/0,Lt=0;Lt<x.length;Lt++){for(var q=0,st=0;st<x[Lt].length;st++)q+=x[Lt][st].totalFlow;if(q>0){var rt=H-(x[Lt].length-1)*At;rt<1&&(rt=1);var ct=rt/q;ct<U&&(U=ct)}}(!isFinite(U)||U<=0)&&(U=1);for(var st=0;st<Zt.length;st++)for(var dt=0;dt<Zt[st].outLinks.length;dt++)Zt[st].outLinks[dt].width=Zt[st].outLinks[dt].value*U;for(var Lt=0;Lt<x.length;Lt++){for(var nt=x[Lt],zt=0,st=0;st<nt.length;st++)nt[st].y0=zt,nt[st].y1=zt+nt[st].totalFlow*U,zt=nt[st].y1+At;for(var Ot=(H-zt+At)/(nt.length+1),st=0;st<nt.length;st++)nt[st].y0+=Ot*(st+1),nt[st].y1+=Ot*(st+1);Kt(nt)}function Ft(Ie,Ce){return Ie.y0-Ce.y0}function Pt(Ie,Ce){return Ft(Ie.sourceNode,Ce.sourceNode)||Ie.index-Ce.index}function Wt(Ie,Ce){return Ft(Ie.targetNode,Ce.targetNode)||Ie.index-Ce.index}function Kt(Ie){for(var Ce=0;Ce<Ie.length;Ce++)Ie[Ce].sourceLinks.sort(Wt),Ie[Ce].targetLinks.sort(Pt)}function Bt(Ie){for(var Ce=0;Ce<Ie.targetLinks.length;Ce++)Ie.targetLinks[Ce].sourceNode.sourceLinks.sort(Wt);for(var Ce=0;Ce<Ie.sourceLinks.length;Ce++)Ie.sourceLinks[Ce].targetNode.targetLinks.sort(Pt)}function ce(Ie,Ce){for(var Ke=Ie.y0-(Ie.sourceLinks.length-1)*At/2,We=0;We<Ie.sourceLinks.length;We++){var le=Ie.sourceLinks[We];if(le.targetNode===Ce)break;Ke+=le.width+At}for(var We=0;We<Ce.targetLinks.length;We++){var Ae=Ce.targetLinks[We];if(Ae.sourceNode===Ie)break;Ke-=Ae.width}return Ke}function kt(Ie,Ce){for(var Ke=Ce.y0-(Ce.targetLinks.length-1)*At/2,We=0;We<Ce.targetLinks.length;We++){var le=Ce.targetLinks[We];if(le.sourceNode===Ie)break;Ke+=le.width+At}for(var We=0;We<Ie.sourceLinks.length;We++){var Ae=Ie.sourceLinks[We];if(Ae.targetNode===Ce)break;Ke-=Ae.width}return Ke}function wt(Ie,Ce,Ke,We){for(var le=Ke;le<Ie.length;le++){var Ae=(Ce-Ie[le].y0)*We;Ae>1e-6&&(Ie[le].y0+=Ae,Ie[le].y1+=Ae),Ce=Ie[le].y1+At}}function jt(Ie,Ce,Ke,We){for(var le=Ke;le>=0;le--){var Ae=(Ie[le].y1-Ce)*We;Ae>1e-6&&(Ie[le].y0-=Ae,Ie[le].y1-=Ae),Ce=Ie[le].y0-At}}function Ht(Ie,Ce){var Ke=Ie.length>>1,We=Ie[Ke];jt(Ie,We.y0-At,Ke-1,Ce),wt(Ie,We.y1+At,Ke+1,Ce),jt(Ie,H,Ie.length-1,Ce),wt(Ie,0,0,Ce)}for(var qt=6,re=0;re<qt;re++){for(var Ut=Math.pow(.99,re),ve=Math.max(1-Ut,(re+1)/qt),Lt=x.length-2;Lt>=0;Lt--){for(var nt=x[Lt],st=0;st<nt.length;st++){for(var G=nt[st],we=0,Se=0,dt=0;dt<G.sourceLinks.length;dt++){var be=G.sourceLinks[dt],Me=be.value*(be.targetNode.layer-G.layer);we+=kt(G,be.targetNode)*Me,Se+=Me}if(Se>0){var Fe=(we/Se-G.y0)*Ut;G.y0+=Fe,G.y1+=Fe,Bt(G)}}nt.sort(Ft),Ht(nt,ve)}for(var Lt=1;Lt<x.length;Lt++){for(var nt=x[Lt],st=0;st<nt.length;st++){for(var G=nt[st],we=0,Se=0,dt=0;dt<G.targetLinks.length;dt++){var Ue=G.targetLinks[dt],Me=Ue.value*(G.layer-Ue.sourceNode.layer);we+=ce(Ue.sourceNode,G)*Me,Se+=Me}if(Se>0){var Fe=(we/Se-G.y0)*Ut;G.y0+=Fe,G.y1+=Fe,Bt(G)}}nt.sort(Ft),Ht(nt,ve)}}for(var st=0;st<Zt.length;st++){for(var G=Zt[st],De=G.y0,dt=0;dt<G.sourceLinks.length;dt++){var be=G.sourceLinks[dt];be.sourceY=De+be.width/2,De+=be.width}for(var Ye=G.y0,dt=0;dt<G.targetLinks.length;dt++){var Ue=G.targetLinks[dt];Ue.targetY=Ye+Ue.width/2,Ye+=Ue.width}}for(var st=0;st<Zt.length;st++){var G=Zt[st];G.y=G.y0,G.height=Math.max(G.y1-G.y0,1)}for(var Pe=U,de=[],st=0;st<Dt.length;st++)for(var ae=Dt[st],dt=0;dt<ae.outLinks.length;dt++){var ft=ae.outLinks[dt],Ve=Nt[ft.target];de.push({x1:ae.x+ae.width,y1:ft.sourceY,x2:Ve.x,y2:ft.targetY,width:ft.value*Pe,sourceColorIdx:st,targetColorIdx:Dt.indexOf(Ve),value:ft.value})}for(var Ne=B.nodeColors||{},nr=0,st=0;st<Dt.length;st++){var Ge=Object.prototype.hasOwnProperty.call(Ne,Dt[st].id)?Ne[Dt[st].id]:null;typeof Ge=="string"&&Ge!==""?Dt[st].color=Ge:(Dt[st].color=bt[nr%bt.length],nr++),Dt[st].colorIdx=st}return{type:"sankey",canvasW:Z,canvasH:H,nodes:Dt,sankeyLinks:de,nodeWidth:yt,numLayers:ne,palette:bt,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function ba(g,tt){var B=tt&&tt.treemap||{},Z=B.width||1e3,H=B.height||400,yt=B.diagramPadding!=null?B.diagramPadding:0,ut=10,ht=25,bt=10,Nt=(1+Math.sqrt(5))/2;(function G(dt){if(dt.children&&dt.children.length){dt.children.sort(function(ae,fe){return fe.value-ae.value});for(var oe=0;oe<dt.children.length;oe++)G(dt.children[oe])}})(g.root);var Dt=0,st=0;(function G(dt){if(dt.isLeaf)dt.leafIdx=st++;else if(dt.sectionIdx=Dt++,dt.children)for(var oe=0;oe<dt.children.length;oe++)G(dt.children[oe])})(g.root);var Lt=H-ht;g.root.x0=yt,g.root.y0=yt,g.root.x1=Z+yt,g.root.y1=Lt+yt,g.root.skipHeader=!0,ft(g.root,0);function ft(G,dt){if(G.x0+=dt,G.y0+=dt,G.x1-=dt,G.y1-=dt,G.x1<G.x0&&(G.x0=G.x1=(G.x0+G.x1)/2),G.y1<G.y0&&(G.y0=G.y1=(G.y0+G.y1)/2),!(!G.children||G.children.length===0)){var oe=G.children.length>1?bt/2:0,ae=G.skipHeader?0:ht,fe=G.x0+ut-oe,ne=G.y0+ae+ut-oe,ye=G.x1-ut+oe,Mt=G.y1-ut+oe;ye<fe&&(fe=ye=(fe+ye)/2),Mt<ne&&(ne=Mt=(ne+Mt)/2),Ct(G.children,fe,ne,ye,Mt,G.value,Nt);for(var $t=0;$t<G.children.length;$t++)ft(G.children[$t],oe)}}function Ct(G,dt,oe,ae,fe,ne,ye){for(var Mt=G.length,$t=ne,Jt=0,e=0;Jt<Mt;){var x=ae-dt,C=fe-oe,S,Y,D;do S=G[e++].value;while(!S&&e<Mt);Y=D=S;for(var At=Math.max(C/x,x/C)/($t*ye),U=S*S*At,q=Math.max(D/U,U/Y);e<Mt;){var rt=G[e].value;S+=rt,rt<Y&&(Y=rt),rt>D&&(D=rt),U=S*S*At;var ct=Math.max(D/U,U/Y);if(ct>q){S-=rt;break}q=ct,e++}var nt=G.slice(Jt,e),zt=x<C;if(zt){var Ot=$t?oe+C*S/$t:fe;Xt(nt,dt,oe,ae,Ot,S),oe=Ot}else{var Ft=$t?dt+x*S/$t:ae;St(nt,dt,oe,Ft,fe,S),dt=Ft}$t-=S,Jt=e}}function Xt(G,dt,oe,ae,fe,ne){for(var ye=ae-dt,Mt=dt,$t=0;$t<G.length;$t++){var Jt=$t===G.length-1?ae:Mt+ye*G[$t].value/ne;G[$t].x0=Mt,G[$t].y0=oe,G[$t].x1=Jt,G[$t].y1=fe,Mt=Jt}}function St(G,dt,oe,ae,fe,ne){for(var ye=fe-oe,Mt=oe,$t=0;$t<G.length;$t++){var Jt=$t===G.length-1?fe:Mt+ye*G[$t].value/ne;G[$t].x0=dt,G[$t].y0=Mt,G[$t].x1=ae,G[$t].y1=Jt,Mt=Jt}}var Zt=[];return(function G(dt){if(Zt.push(dt),dt.children)for(var oe=0;oe<dt.children.length;oe++)G(dt.children[oe])})(g.root),{type:"treemap",title:g.title,canvasW:Z+yt*2,canvasH:Lt+yt*2,headerH:ht,root:g.root,placed:Zt,classDefs:g.classDefs||{},fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function ra(g,tt){for(var B=784,Z=75,H=75,yt=48,ut=50,ht=35,bt=13,Nt=24,Dt=20,st=B-Z-H,Lt=1440*60*1e3,ft=0,Ct=0;Ct<g.tasks.length;Ct++)g.tasks[Ct].flags&&g.tasks[Ct].flags.vert||ft++;var Xt=ft<g.tasks.length,St=bt+ft*Nt+2,Zt=ht+St+ut,G=g.startDate,dt=g.endDate;(!G||!dt)&&(G=new Date,dt=new Date(G.getTime()+Lt));var oe=G.getTime(),ae=dt.getTime(),fe=ae-oe;fe<=0&&(fe=Lt,ae=oe+fe);function ne(Pe){return Z+Math.round((Pe.getTime()-oe)/fe*st)}for(var ye=g.displayMode==="compact",Mt=0,$t=0;$t<g.sections.length;$t++){var Jt=g.sections[$t];Jt.firstRow=Mt;for(var e=[],x=0;x<Jt.tasks.length;x++){var C=Jt.tasks[x];if(C.flags.vert){C.rowIdx=Jt.firstRow;continue}e.push(C)}var S;if(ye){for(var Y=e.slice().sort(function(Pe,de){var Ve=Pe.startDate?Pe.startDate.getTime():0,Ne=de.startDate?de.startDate.getTime():0;return Ve-Ne}),D=[],At=0;At<Y.length;At++){for(var U=Y[At],q=U.startDate?U.startDate.getTime():0,rt=U.endDate?U.endDate.getTime():q,ct=!1,nt=0;nt<D.length;nt++)if(D[nt]<=q){U.rowIdx=Jt.firstRow+nt,D[nt]=rt,ct=!0;break}ct||(U.rowIdx=Jt.firstRow+D.length,D.push(rt))}S=D.length}else{for(var zt=0;zt<e.length;zt++)e[zt].rowIdx=Mt+zt;S=e.length}Jt.lastRow=Jt.firstRow+S-1,Mt=Jt.firstRow+S,Jt.y=yt+Jt.firstRow*Nt,Jt.h=S*Nt}if(St=bt+Mt*Nt+2,Zt=ht+St+ut,Xt){var Ot=ht+ft*Nt+60+10;Ot>Zt&&(Zt=Ot)}for(var Ft=11,Pt=0;Pt<g.tasks.length;Pt++){var C=g.tasks[Pt];C.rowY=yt+(C.rowIdx!=null?C.rowIdx:Pt)*Nt;var Wt=ne(C.startDate),Kt=C.renderEndDate||C.endDate,Bt=ne(Kt);if(C.barX=Wt,C.barY=C.rowY+2,C.barW=Math.max(Bt-Wt,0),C.flags.milestone){var ce=ne(C.endDate),kt=(Wt+ce)/2;C.barX=kt-10,C.barW=20;var wt=C.label||"",jt=wt?o(wt,Ft,'"trebuchet ms",verdana,arial,sans-serif'):{width:0};C.labelW=jt.width}else if(C.flags.vert)C.barX=Wt,C.barW=.08*Dt,C.markerX=Wt;else{var Ht=C.label||"",qt=Ht?o(Ht,Ft,'"trebuchet ms",verdana,arial,sans-serif'):{width:0},re=ne(C.endDate),Ut=Math.max(re-Wt,0);C.labelW=qt.width,C.labelOutsideRight=qt.width>Ut,C.labelOverflowCenter=!C.labelOutsideRight&&qt.width>C.barW,C.labelOutsideLeft=C.labelOutsideRight&&re+5+qt.width+5>B}}var ve=[];if(g.tasks.length>0)for(var we=la(G,dt,g.axisFormat,g.tickInterval),Pt=0;Pt<we.length;Pt++)ve.push({date:we[Pt].date,label:we[Pt].label,x:ne(we[Pt].date)});var Se=[];if(g.excludeInfo&&g.tasks.length>0){for(var be=new Date(Date.UTC(G.getUTCFullYear(),G.getUTCMonth(),G.getUTCDate())),Me=new Date(Date.UTC(dt.getUTCFullYear(),dt.getUTCMonth(),dt.getUTCDate())),Fe=null,Ue=1e5,De=0;be.getTime()<=Me.getTime()&&De++<Ue;){var Ye=Dr(be,g.excludeInfo);Ye&&Fe==null&&(Fe=new Date(be)),!Ye&&Fe!=null&&(Se.push({x:ne(Fe),w:ne(be)-ne(Fe)}),Fe=null),be.setUTCDate(be.getUTCDate()+1)}Fe!=null&&Se.push({x:ne(Fe),w:ne(be)-ne(Fe)})}return{type:"gantt",title:g.title,canvasW:B,canvasH:Zt,gridLeft:Z,gridRight:B-H,gridTop:ht,gridBottom:Zt-ut,gridWidth:st,rowHeight:Nt,taskHeight:Dt,topMargin:yt,nonVertTaskCount:ft,sections:g.sections,tasks:g.tasks,ticks:ve,excludes:Se,axisFormat:g.axisFormat,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function Dr(g,tt){if(!tt)return!1;if(tt.hasWeekends&&tt.weekendDays[g.getUTCDay()]||tt.weekdays[g.getUTCDay()])return!0;var B=g.getUTCFullYear()+"-"+(g.getUTCMonth()+1)+"-"+g.getUTCDate();return!!tt.dates[B]}function la(g,tt,B,Z){var H=1e3,yt=60*H,ut=60*yt,ht=24*ut,bt=7*ht,Nt=30*ht,Dt=365.25*ht,st=tt.getTime()-g.getTime(),Lt=[],ft=1e4;function Ct(At){Lt.push({date:new Date(At),label:Mn(At,B)})}var Xt=qr(Z);if(Xt){for(var D=ma(g,Xt);D.getTime()<=tt.getTime()&&Lt.length<ft;)D.getTime()>=g.getTime()&&Ct(D),D=Ja(D,Xt);return Lt}for(var St=10,Zt=[["second",1,H],["second",5,5*H],["second",15,15*H],["second",30,30*H],["minute",1,yt],["minute",5,5*yt],["minute",15,15*yt],["minute",30,30*yt],["hour",1,ut],["hour",3,3*ut],["hour",6,6*ut],["hour",12,12*ut],["day",1,ht],["day",2,2*ht],["week",1,bt],["month",1,Nt],["month",3,3*Nt],["year",1,Dt]],G=st/St,dt=0;dt<Zt.length&&Zt[dt][2]<G;)dt++;if(dt===Zt.length){var oe=Math.sqrt(50),ae=Math.sqrt(10),fe=Math.sqrt(2),ne=st/Dt/St,ye=Math.pow(10,Math.floor(Math.log10(ne))),Mt=ne/ye,$t=ye;Mt>=oe?$t=ye*10:Mt>=ae?$t=ye*5:Mt>=fe&&($t=ye*2),$t=Math.max(1,Math.round($t));for(var Jt=Math.ceil(g.getFullYear()/$t)*$t,D=new Date(Jt,0,1);D.getTime()<=tt.getTime()&&Lt.length<ft;)D.getTime()>=g.getTime()&&Ct(D),D=new Date(D.getFullYear()+$t,0,1);return Lt}if(dt>0){var e=Zt[dt-1][2],x=Zt[dt][2];G/e<x/G&&(dt=dt-1)}for(var C=Zt[dt][0],S=Zt[dt][1],Y={count:S,unit:C},D=ma(g,Y);D.getTime()<=tt.getTime()&&Lt.length<ft;)D.getTime()>=g.getTime()&&Ct(D),D=Ja(D,Y);return Lt}function qr(g){if(!g)return null;var tt=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(g.trim());return tt?{count:parseInt(tt[1],10),unit:tt[2]}:null}function ma(g,tt){var B=new Date(g);switch(tt.unit){case"millisecond":B.setMilliseconds(Math.ceil(B.getMilliseconds()/tt.count)*tt.count);break;case"second":B.setMilliseconds(0),B.setSeconds(Math.ceil(B.getSeconds()/tt.count)*tt.count);break;case"minute":B.setSeconds(0,0),B.setMinutes(Math.ceil(B.getMinutes()/tt.count)*tt.count);break;case"hour":B.setMinutes(0,0,0),B.setHours(Math.ceil(B.getHours()/tt.count)*tt.count);break;case"day":if(B.setHours(0,0,0,0),B.getTime()<g.getTime()&&B.setDate(B.getDate()+1),tt.count>1){var Z=(B.getDate()-1)%tt.count;Z>0&&B.setDate(B.getDate()+(tt.count-Z))}break;case"week":for(B.setHours(0,0,0,0),B.getTime()<g.getTime()&&B.setDate(B.getDate()+1);B.getDay()!==0;)B.setDate(B.getDate()+1);break;case"month":if(B=new Date(B.getFullYear(),B.getMonth(),1),B.getTime()<g.getTime()&&(B=new Date(B.getFullYear(),B.getMonth()+1,1)),tt.count>1){var H=B.getMonth()%tt.count;H>0&&(B=new Date(B.getFullYear(),B.getMonth()+(tt.count-H),1))}break;case"quarter":var yt=Math.floor(B.getMonth()/3)*3;B=new Date(B.getFullYear(),yt,1),B.getTime()<g.getTime()&&(B=new Date(B.getFullYear(),yt+3,1));break;case"year":B=new Date(B.getFullYear(),0,1),B.getTime()<g.getTime()&&(B=new Date(B.getFullYear()+1,0,1));break;case"decade":B=new Date(Math.ceil(B.getFullYear()/10)*10,0,1);break}return B}function Ja(g,tt){var B=new Date(g);switch(tt.unit){case"millisecond":B.setMilliseconds(B.getMilliseconds()+tt.count);break;case"second":B.setSeconds(B.getSeconds()+tt.count);break;case"minute":B.setMinutes(B.getMinutes()+tt.count);break;case"hour":B.setHours(B.getHours()+tt.count);break;case"day":B.setDate(B.getDate()+tt.count);break;case"week":B.setDate(B.getDate()+7*tt.count);break;case"month":B.setMonth(B.getMonth()+tt.count);break;case"quarter":B.setMonth(B.getMonth()+3*tt.count);break;case"year":B.setFullYear(B.getFullYear()+tt.count);break;case"decade":B.setFullYear(B.getFullYear()+10*tt.count);break}return B}var sn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],fn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Na=["January","February","March","April","May","June","July","August","September","October","November","December"],Cn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Mn(g,tt){function B(Z){return Z<10?"0"+Z:""+Z}return tt.replace(/%Y/g,g.getFullYear()).replace(/%y/g,B(g.getFullYear()%100)).replace(/%m/g,B(g.getMonth()+1)).replace(/%d/g,B(g.getDate())).replace(/%e/g,(g.getDate()<10?" ":"")+g.getDate()).replace(/%A/g,sn[g.getDay()]).replace(/%a/g,fn[g.getDay()]).replace(/%B/g,Na[g.getMonth()]).replace(/%b/g,Cn[g.getMonth()]).replace(/%H/g,B(g.getHours())).replace(/%I/g,B((g.getHours()+11)%12+1)).replace(/%p/g,g.getHours()>=12?"PM":"AM").replace(/%M/g,B(g.getMinutes())).replace(/%S/g,B(g.getSeconds())).replace(/%L/g,B(g.getMilliseconds())).replace(/%s/g,Math.floor(g.getTime()/1e3))}function nn(g,tt){var B=800,Z=450,H=g.sets.length,yt=!!g.title,ut=1600,ht=B/ut,bt=yt?48*ht:0,Nt=B,Dt=Z-bt,st=[{fill:"#5353FF",text:"#0000B9"},{fill:"#FFFF45",text:"#ABAB00"},{fill:"#53FF53",text:"#00B800"},{fill:"#FF5353",text:"#B90000"},{fill:"#FF53FF",text:"#B900B9"},{fill:"#53FFFF",text:"#00B9B9"},{fill:"#FFA653",text:"#B96B00"},{fill:"#A653FF",text:"#6B00B9"}];if(H===0)return{type:"venn",title:g.title,canvasW:B,canvasH:Z,titleHeight:bt,scale:ht,circles:[],regionLabels:[],textNodes:[],fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"};for(var Lt=[],ft=0;ft<g.sets.length;ft++){var Ct=g.sets[ft],Xt;Ct.sizeExplicit?Xt=Ct.size:Xt=10,Lt.push({sets:[Ct.id],size:Xt,label:Ct.label})}for(var ft=0;ft<(g.unions||[]).length;ft++){var St=g.unions[ft];if(St.ids&&St.ids.length>=2){var Zt;St.sizeExplicit?Zt=St.size:Zt=10/Math.pow(St.ids.length,2),Lt.push({sets:St.ids.slice().sort(),size:Zt,label:St.label||void 0})}}var G;try{G=dh(Lt,{width:Nt,height:Dt,padding:15})}catch(Cr){G=[]}function dt(Cr){return Cr.slice().sort().join("|")}for(var oe={},ae={},ft=0;ft<G.length;ft++){var fe=G[ft];oe[dt(fe.data.sets)]=fe;for(var ne=0;ne<fe.circles.length;ne++){var ye=fe.circles[ne];ye.set!=null&&(ae[ye.set]=ye)}}for(var Mt=bt,$t=[],ft=0;ft<g.sets.length;ft++){var Ct=g.sets[ft],Jt=ae[Ct.id],e=oe[dt([Ct.id])];if(!Jt){$t.push({id:Ct.id,label:Ct.label,cx:B/2,cy:Z/2,r:100,fill:st[ft%st.length].fill,text:st[ft%st.length].text,labelAnchor:{x:B/2,y:Z/2}});continue}var x=e&&e.text?e.text.x:Jt.x,C=e&&e.text?e.text.y:Jt.y;$t.push({id:Ct.id,label:Ct.label,cx:Jt.x,cy:Jt.y+Mt,r:Jt.radius,fill:st[ft%st.length].fill,text:st[ft%st.length].text,labelAnchor:{x,y:C+Mt}})}for(var S={},ft=0;ft<$t.length;ft++)S[$t[ft].id]=$t[ft];var Y=g.styles||{};for(var D in Y){var At=S[D];if(At)for(var U=Y[D].split(/\s*,\s*/),q=0;q<U.length;q++){var rt=U[q].split(":");if(rt.length>=2){var ct=rt[0].trim(),nt=rt.slice(1).join(":").trim();ct==="fill"?At.fill=nt:ct==="color"?At.text=nt:ct==="stroke"&&(At.stroke=nt)}}}for(var zt=[],Ot=[],Ft={},ft=0;ft<g.labels.length;ft++){var Pt=g.labels[ft];if((Pt.kind||"text")==="union"){var ct=dt(Pt.ids),e=oe[ct],Wt,Kt;if(e&&e.text)Wt=e.text.x,Kt=e.text.y+Mt;else{for(var Bt=0,ce=0,kt=0,ne=0;ne<Pt.ids.length;ne++){var wt=S[Pt.ids[ne]];wt&&(Bt+=wt.cx,ce+=wt.cy,kt++)}Wt=kt>0?Bt/kt:B/2,Kt=kt>0?ce/kt:Z/2}var jt={text:Pt.text,x:Wt,y:Kt,kind:"union"};if(Pt.ids.length>0&&Y[Pt.ids[0]])for(var U=Y[Pt.ids[0]].split(/\s*,\s*/),q=0;q<U.length;q++){var rt=U[q].split(":");if(rt.length>=2){var Ht=rt[0].trim(),qt=rt.slice(1).join(":").trim();Ht==="color"&&(jt.fontColor=qt)}}zt.push(jt)}else{for(var re=[],Ut=Pt.id||Pt.ids[0],ne=0;ne<Pt.ids.length;ne++){var ve=Pt.ids[ne];if(S[ve]){re.push(ve);continue}var we=null,Se=0;for(var be in S)ve.indexOf(be)===0&&be.length>Se&&(we=be,Se=be.length);we&&re.push(we)}if(re.length===0)continue;for(var Me=[],St=0;St<re.length;St++)Me.indexOf(re[St])<0&&Me.push(re[St]);Me.sort();var Fe=Me.join("|");Ft[Fe]||(Ft[Fe]={ids:Me,nodes:[]}),Ft[Fe].nodes.push({id:Ut,label:Pt.text||Ut,rawIds:Pt.ids})}}for(var Fe in Ft){var Ue=Ft[Fe],e=oe[Fe],De,Ye;if(e&&e.text)De={x:e.text.x,y:e.text.y},Ye=e.circles;else{var Pe=ae[Ue.ids[0]];if(!Pe)continue;De={x:Pe.x,y:Pe.y},Ye=[Pe]}for(var de=1/0,Ve=1/0,ne=0;ne<Ye.length;ne++){var Ne=Ye[ne];Ne.radius<de&&(de=Ne.radius);var nr=De.x-Ne.x,Ge=De.y-Ne.y,Ie=Math.sqrt(nr*nr+Ge*Ge),Ce=Ne.radius-Ie;Ce<Ve&&(Ve=Ce)}var Ke=isFinite(Ve)?Math.max(0,Ve):0;Ke===0&&isFinite(de)&&(Ke=de*.6);for(var We=Math.max(80*ht,Ke*2*.95),le=Math.max(60*ht,Ke*2*.95),Ae=e&&e.data&&e.data.label&&e.data.label.length>0,Le=Ae?Math.min(32*ht,Ke*.25):0,Re=Le+(Ue.nodes.length<=2?30*ht:0),Be=De.x-We/2,je=De.y-le/2+Re,kt=Ue.nodes.length,ie=Math.max(1,Math.ceil(Math.sqrt(kt))),fr=Math.max(1,Math.ceil(kt/ie)),Ar=We/ie,Lr=le/fr,Ze=Ar*.9,dr=Lr*.9,ft=0;ft<Ue.nodes.length;ft++){var Xe=Ue.nodes[ft],br=ft%ie,vr=Math.floor(ft/ie),gr=Be+Ar*(br+.5),fa=je+Lr*(vr+.5),Je={text:Xe.label,id:Xe.id,x:gr,y:fa+Mt,boxW:Ze,boxH:dr,kind:"text"};if(Y[Xe.id])for(var $e=Y[Xe.id].split(/\s*,\s*/),q=0;q<$e.length;q++){var Qr=$e[q].split(":");if(Qr.length>=2){var $r=Qr[0].trim(),Ir=Qr.slice(1).join(":").trim();$r==="color"&&(Je.fontColor=Ir)}}Ot.push(Je)}}return{type:"venn",title:g.title,canvasW:B,canvasH:Z,titleHeight:bt,scale:ht,circles:$t,regionLabels:zt,textNodes:Ot,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif"}}function An(g,tt){var B=[],Z=[];function H(yt,ut,ht){for(var bt=tt===-1?yt.slice().reverse():yt,Nt=0;Nt<bt.length;Nt++){var Dt=bt[Nt],st=B.length,Lt=Dt.children||[];B.push({depth:ht,text:Dt.text||Dt.name||"",parentIndex:ut,childCount:Lt.length}),ht%2===0?(Z.push(st),Lt.length&&H(Lt,st,ht+1)):(Lt.length&&H(Lt,st,ht+1),Z.push(st))}}return H(g,-1,2),{entries:B,yOrder:Z}}function dn(g,tt){var B=g.categories.length,Z="Trebuchet MS,Verdana,Arial,sans-serif",H=g.effect||"",yt=H.split(/\s+/).filter(function(Ae){return Ae}),ut=0,ht=20,bt=0;if(yt.length===0){var Nt=o(H,14,Z);ut=Nt&&Nt.width||0,ht=Nt&&Nt.height||20,bt=ht}else{for(var Dt=0;Dt<yt.length;Dt++){var st=o(yt[Dt],14,Z),Lt=st&&st.width||0;Lt>ut&&(ut=Lt),st&&st.height&&st.height>bt&&(bt=st.height)}bt<=0&&(bt=17),ht=yt.length*bt}for(var ft=Math.max(72,Math.ceil(ut+30)),Ct=Math.max(80,Math.ceil(ht+70)),Xt=82*Math.PI/180,St=Math.cos(Xt),Zt=Math.sin(Xt),G=250,dt=16,oe=[],ae=[],fe=0;fe<B;fe++)fe%2===0?oe.push(g.categories[fe]):ae.push(g.categories[fe]);function ne(Ae){for(var Le=Ae.children||[],Re=0,Be=0;Be<Le.length;Be++)Re+=1+ne(Le[Be]);return Re}function ye(Ae){for(var Le=0,Re=0,Be=0;Be<Ae.length;Be++){var je=ne(Ae[Be]);Le+=je,je>Re&&(Re=je)}return{total:Le,max:Re}}var Mt=ye(oe),$t=ye(ae),Jt=Mt.total+$t.total,e=G,x=G;if(Jt>0){var C=G*2,S=G*.3;e=Math.max(S,C*(Mt.total/Jt)),x=Math.max(S,C*($t.total/Jt))}var Y=dt*2;e=Math.max(e,Mt.max*Y),x=Math.max(x,$t.max*Y);for(var D=Math.max(e,G),At=Math.ceil(B/2),U=-20,q=[],rt=U,ct=0;ct<At;ct++){let Ae=function(Le,Re,Be){for(var je=Le.children||[],ie=je.length>0,fr=Be*(ie?1:.2),Ar=-St*fr,Lr=Zt*fr*Re,Ze=nt+Ar,dr=D+Lr,Xe=An(je,Re),br=Xe.entries,vr=Xe.yOrder,gr=br.length,fa=new Array(gr),Je=0;Je<vr.length;Je++){var $e=vr[Je];fa[$e]=D+Lr*((Je+1)/(gr+1))}var Qr={};Qr[-1]={x0:nt,y0:D,x1:Ze,y1:dr,childCount:je.length,childrenDrawn:0};for(var $r=[],Ir=-St,Cr=Zt*Re,Ea=30,xa=60,aa=5,Gr=0;Gr<br.length;Gr++){var ya=br[Gr],Br=fa[Gr],pa=Qr[ya.parentIndex],i,m,k,R,$=ya.depth%2===0;if($){var et=pa.y1-pa.y0;i=pa.x0+(pa.x1-pa.x0)*(et!==0?(Br-pa.y0)/et:.5),m=Br,k=i-(ya.childCount>0?xa+ya.childCount*aa:Ea),R=Br}else{var vt=pa.childrenDrawn++;i=pa.x0+(pa.x1-pa.x0)*((pa.childCount-vt)/(pa.childCount+1)),m=pa.y0,k=i+Ir*((Br-m)/Cr),R=Br}$r.push({text:ya.text,depth:ya.depth,isHorizontal:$,bx0:i,by0:m,bx1:k,by1:R,x:i,y:Br,stubEndX:k,dirY:Re}),ya.childCount>0&&(Qr[Gr]={x0:i,y0:m,x1:k,y1:R,childCount:ya.childCount,childrenDrawn:0})}return{name:Le.name,spineX:nt,spineY:D,boneEndX:Ze,boneEndY:dr,dirY:Re,subs:$r,boneHasChildren:ie}};var nt=U,zt=U,Ot=g.categories[ct*2],Ft=g.categories[ct*2+1];if(Ot){var Pt=Ae(Ot,-1,e);q.push(Pt);for(var Wt=Pt.boneEndX-le(Ot.name,dt,Z),Kt=0;Kt<Pt.subs.length;Kt++){var Lt=We(Pt.subs[Kt].text,dt,Z),Bt=Pt.subs[Kt].stubEndX-Lt;Bt<Wt&&(Wt=Bt)}Wt<zt&&(zt=Wt)}if(Ft){var ce=Ae(Ft,1,x);q.push(ce);for(var kt=ce.boneEndX-le(Ft.name,dt,Z),wt=0;wt<ce.subs.length;wt++){var jt=We(ce.subs[wt].text,dt,Z),Ht=ce.subs[wt].stubEndX-jt;Ht<kt&&(kt=Ht)}kt<zt&&(zt=kt)}zt<rt&&(rt=zt),ct<At-1&&(U=zt)}var qt=20,re=20,Ut=20,ve=20,we=D-e,Se=D+x;we>D-Ct/2&&(we=D-Ct/2),Se<D+Ct/2&&(Se=D+Ct/2);var be=-rt+qt,Me=-we+Ut,Fe=be+ft/2+10;Fe=be+ft/2;for(var Ue=Me+D,De=be+rt,Ye=be,Pe=Me+D,de=[],Ve=0;Ve<q.length;Ve++){for(var Ne=q[Ve],nr=[],Ge=0;Ge<Ne.subs.length;Ge++){var Ie=Ne.subs[Ge];nr.push({text:Ie.text,depth:Ie.depth,isHorizontal:Ie.isHorizontal,bx0:Ie.bx0+be,by0:Ie.by0+Me,bx1:Ie.bx1+be,by1:Ie.by1+Me,x:Ie.x+be,y:Ie.y+Me,stubEndX:Ie.stubEndX+be,dirY:Ie.dirY})}de.push({name:Ne.name,spineX:Ne.spineX+be,spineY:Ne.spineY+Me,boneEndX:Ne.boneEndX+be,boneEndY:Ne.boneEndY+Me,dirY:Ne.dirY,subs:nr,boneHasChildren:Ne.boneHasChildren})}var Ce=Math.max(Fe+ft/2+re,Ye+ft+re),Ke=Me+Se+ve;return Ce<300&&(Ce=300),Ke<300&&(Ke=300),{type:"ishikawa",title:g.title,effect:g.effect,canvasW:Ce,canvasH:Ke,spineX0:De,spineX1:Ye,spineY:Pe,effectCx:Fe,effectCy:Ue,effectW:ft,effectH:Ct,categories:de,fontFamily:Z};function We(Ae,Le,Re){for(var Be=Ln(Ae||"",15),je=0,ie=0;ie<Be.length;ie++){var fr=typeof o=="function"?o(Be[ie],Le,Re):null,Ar=fr&&fr.width||Be[ie].length*Le*.55;Ar>je&&(je=Ar)}return je}function le(Ae,Le,Re){return We(Ae,Le,Re)/2}}function Ln(g,tt){var B=(g||"").split(/\s+/).filter(function(ht){return ht});if(B.length===0)return[""];for(var Z=[],H=B[0],yt=1;yt<B.length;yt++){var ut=B[yt];H.length+1+ut.length<=tt?H+=" "+ut:(Z.push(H),H=ut)}return Z.push(H),Z}function Fn(g,tt){var B=tt&&tt.themeVariables&&tt.themeVariables.treeView||{},Z=tt&&tt.treeView||{},H=Z.rowIndent!=null?Z.rowIndent:10,yt=Z.paddingX!=null?Z.paddingX:5,ut=Z.paddingY!=null?Z.paddingY:5,ht=Z.lineThickness!=null?Z.lineThickness:1,bt=parseInt(B.labelFontSize||"16",10)||16,Nt=B.labelColor||"black",Dt=B.lineColor||"black",st="Trebuchet MS,Verdana,Arial,sans-serif",Lt={label:"/",children:g.roots||[]},ft=[],Ct=[],Xt=0,St=0;function Zt(Jt,e,x){var C=o(x.label||"",bt,st),S=C&&C.width||0,Y=bt+3,D=Y+ut*2,At=S+yt*2;x.BBox={x:Jt,y:e,width:At,height:D},ft.push({label:x.label||"",x:Jt,y:e,width:At,height:D})}function G(Jt,e){var x=e*(H+yt);Zt(x,Xt,Jt);var C=Jt.BBox.height,S=Jt.BBox.width;e>0&&Ct.push({x1:x-H,y1:Xt+C/2,x2:x,y2:Xt+C/2}),x+S>St&&(St=x+S),Xt+=C}function dt(Jt,e){G(Jt,e);for(var x=Jt.children||[],C=0;C<x.length;C++)dt(x[C],e+1);if(x.length){var S=Jt.BBox,Y=x[x.length-1].BBox;Ct.push({x1:S.x+yt,y1:S.y+S.height,x2:S.x+yt,y2:Y.y+Y.height/2+ht/2})}}dt(Lt,0);for(var oe=0,ae=g.title?36:0,fe=ae,ne=0;ne<ft.length;ne++)ft[ne].x+=oe,ft[ne].y+=fe;for(var ye=0;ye<Ct.length;ye++)Ct[ye].x1+=oe,Ct[ye].x2+=oe,Ct[ye].y1+=fe,Ct[ye].y2+=fe;var Mt=St+oe,$t=Xt+fe;return{type:"treeView",title:g.title||"",canvasW:Mt,canvasH:$t,titleBarH:ae,paddingX:yt,lineThickness:ht,labelFontSize:bt,labelColor:Nt,lineColor:Dt,fontFamily:st,rows:ft,lines:Ct}}return{layout:or,measureNodes:P,measureText:o,layoutWithElk:d}})();var In={docker:'<svg width="256" height="185" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 185"><path fill="#2396ed" d="M250.716 70.497c-5.765-4-18.976-5.5-29.304-3.5c-1.2-10-6.725-18.749-16.333-26.499l-5.524-4l-3.844 5.75c-4.803 7.5-7.205 18-6.485 28c.24 3.499 1.441 9.749 5.044 15.249c-3.362 2-10.328 4.5-19.455 4.5H1.155l-.48 2c-1.682 9.999-1.682 41.248 18.014 65.247c14.892 18.249 36.99 27.499 66.053 27.499c62.93 0 109.528-30.25 131.386-84.997c8.647.25 27.142 0 36.51-18.75c.24-.5.72-1.5 2.401-5.249l.961-2zM139.986 0h-26.42v24.999h26.42zm0 29.999h-26.42v24.999h26.42zm-31.225 0h-26.42v24.999h26.42zm-31.225 0H51.115v24.999h26.421zM46.311 59.998H19.89v24.999h26.42zm31.225 0H51.115v24.999h26.421zm31.225 0h-26.42v24.999h26.42zm31.226 0h-26.422v24.999h26.422zm31.225 0H144.79v24.999h26.422z"/></svg>',redis:'<svg width="256" height="220" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 220"><path fill="#912626" d="M245.97 168.943c-13.662 7.121-84.434 36.22-99.501 44.075s-23.437 7.78-35.34 2.09c-11.902-5.69-87.216-36.112-100.783-42.597C3.566 169.271 0 166.535 0 163.951v-25.876s98.05-21.345 113.879-27.024c15.828-5.679 21.32-5.884 34.79-.95c13.472 4.936 94.018 19.468 107.331 24.344l-.006 25.51c.002 2.558-3.07 5.364-10.024 8.988"/><path fill="#c6302b" d="M245.965 143.22c-13.661 7.118-84.431 36.218-99.498 44.072c-15.066 7.857-23.436 7.78-35.338 2.09c-11.903-5.686-87.214-36.113-100.78-42.594c-13.566-6.485-13.85-10.948-.524-16.166c13.326-5.22 88.224-34.605 104.055-40.284c15.828-5.677 21.319-5.884 34.789-.948c13.471 4.934 83.819 32.935 97.13 37.81c13.316 4.881 13.827 8.9.166 16.02"/><path fill="#912626" d="M245.97 127.074c-13.662 7.122-84.434 36.22-99.501 44.078c-15.067 7.853-23.437 7.777-35.34 2.087c-11.903-5.687-87.216-36.112-100.783-42.597C3.566 127.402 0 124.67 0 122.085V96.206s98.05-21.344 113.879-27.023c15.828-5.679 21.32-5.885 34.79-.95C162.142 73.168 242.688 87.697 256 92.574l-.006 25.513c.002 2.557-3.07 5.363-10.024 8.987"/><path fill="#c6302b" d="M245.965 101.351c-13.661 7.12-84.431 36.218-99.498 44.075c-15.066 7.854-23.436 7.777-35.338 2.087c-11.903-5.686-87.214-36.112-100.78-42.594c-13.566-6.483-13.85-10.947-.524-16.167C23.151 83.535 98.05 54.148 113.88 48.47c15.828-5.678 21.319-5.884 34.789-.949c13.471 4.934 83.819 32.933 97.13 37.81c13.316 4.88 13.827 8.9.166 16.02"/><path fill="#912626" d="M245.97 83.653c-13.662 7.12-84.434 36.22-99.501 44.078c-15.067 7.854-23.437 7.777-35.34 2.087c-11.903-5.687-87.216-36.113-100.783-42.595C3.566 83.98 0 81.247 0 78.665v-25.88s98.05-21.343 113.879-27.021c15.828-5.68 21.32-5.884 34.79-.95C162.142 29.749 242.688 44.278 256 49.155l-.006 25.512c.002 2.555-3.07 5.361-10.024 8.986"/><path fill="#c6302b" d="M245.965 57.93c-13.661 7.12-84.431 36.22-99.498 44.074c-15.066 7.854-23.436 7.777-35.338 2.09C99.227 98.404 23.915 67.98 10.35 61.497S-3.5 50.55 9.825 45.331C23.151 40.113 98.05 10.73 113.88 5.05c15.828-5.679 21.319-5.883 34.789-.948s83.819 32.934 97.13 37.811c13.316 4.876 13.827 8.897.166 16.017"/><path fill="#fff" d="m159.283 32.757l-22.01 2.285l-4.927 11.856l-7.958-13.23l-25.415-2.284l18.964-6.839l-5.69-10.498l17.755 6.944l16.738-5.48l-4.524 10.855zm-28.251 57.518L89.955 73.238l58.86-9.035zm-56.95-50.928c17.375 0 31.46 5.46 31.46 12.194c0 6.736-14.085 12.195-31.46 12.195s-31.46-5.46-31.46-12.195c0-6.734 14.085-12.194 31.46-12.194"/><path fill="#621b1c" d="m185.295 35.998l34.836 13.766l-34.806 13.753z"/><path fill="#9a2928" d="m146.755 51.243l38.54-15.245l.03 27.519l-3.779 1.478z"/></svg>',postgresql:'<svg width="256" height="264" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 264"><path d="M255.008 158.086c-1.535-4.649-5.556-7.887-10.756-8.664c-2.452-.366-5.26-.21-8.583.475c-5.792 1.195-10.089 1.65-13.225 1.738c11.837-19.985 21.462-42.775 27.003-64.228c8.96-34.689 4.172-50.492-1.423-57.64C233.217 10.847 211.614.683 185.552.372c-13.903-.17-26.108 2.575-32.475 4.549c-5.928-1.046-12.302-1.63-18.99-1.738c-12.537-.2-23.614 2.533-33.079 8.15c-5.24-1.772-13.65-4.27-23.362-5.864c-22.842-3.75-41.252-.828-54.718 8.685C6.622 25.672-.937 45.684.461 73.634c.444 8.874 5.408 35.874 13.224 61.48c4.492 14.718 9.282 26.94 14.237 36.33c7.027 13.315 14.546 21.156 22.987 23.972c4.731 1.576 13.327 2.68 22.368-4.85c1.146 1.388 2.675 2.767 4.704 4.048c2.577 1.625 5.728 2.953 8.875 3.74c11.341 2.835 21.964 2.126 31.027-1.848c.056 1.612.099 3.152.135 4.482c.06 2.157.12 4.272.199 6.25c.537 13.374 1.447 23.773 4.143 31.049c.148.4.347 1.01.557 1.657c1.345 4.118 3.594 11.012 9.316 16.411c5.925 5.593 13.092 7.308 19.656 7.308c3.292 0 6.433-.432 9.188-1.022c9.82-2.105 20.973-5.311 29.041-16.799c7.628-10.86 11.336-27.217 12.007-52.99q.13-1.094.244-2.088l.16-1.362l1.797.158l.463.031c10.002.456 22.232-1.665 29.743-5.154c5.935-2.754 24.954-12.795 20.476-26.351"/><path fill="#336791" d="M237.906 160.722c-29.74 6.135-31.785-3.934-31.785-3.934c31.4-46.593 44.527-105.736 33.2-120.211c-30.904-39.485-84.399-20.811-85.292-20.327l-.287.052c-5.876-1.22-12.451-1.946-19.842-2.067c-13.456-.22-23.664 3.528-31.41 9.402c0 0-95.43-39.314-90.991 49.444c.944 18.882 27.064 142.873 58.218 105.422c11.387-13.695 22.39-25.274 22.39-25.274c5.464 3.63 12.006 5.482 18.864 4.817l.533-.452c-.166 1.7-.09 3.363.213 5.332c-8.026 8.967-5.667 10.541-21.711 13.844c-16.235 3.346-6.698 9.302-.471 10.86c7.549 1.887 25.013 4.561 36.813-11.958l-.47 1.885c3.144 2.519 5.352 16.383 4.982 28.952c-.37 12.568-.617 21.197 1.86 27.937c2.479 6.74 4.948 21.905 26.04 17.386c17.623-3.777 26.756-13.564 28.027-29.89c.901-11.606 2.942-9.89 3.07-20.267l1.637-4.912c1.887-15.733.3-20.809 11.157-18.448l2.64.232c7.99.363 18.45-1.286 24.589-4.139c13.218-6.134 21.058-16.377 8.024-13.686z"/><path fill="#fff" d="M108.076 81.525c-2.68-.373-5.107-.028-6.335.902c-.69.523-.904 1.129-.962 1.546c-.154 1.105.62 2.327 1.096 2.957c1.346 1.784 3.312 3.01 5.258 3.28q.423.059.842.058c3.245 0 6.196-2.527 6.456-4.392c.325-2.336-3.066-3.893-6.355-4.35m88.784.073c-.256-1.831-3.514-2.353-6.606-1.923c-3.088.43-6.082 1.824-5.832 3.659c.2 1.427 2.777 3.863 5.827 3.863q.387 0 .78-.054c2.036-.282 3.53-1.575 4.24-2.32c1.08-1.136 1.706-2.402 1.591-3.225"/><path fill="#fff" d="M247.802 160.025c-1.134-3.429-4.784-4.532-10.848-3.28c-18.005 3.716-24.453 1.142-26.57-.417c13.995-21.32 25.508-47.092 31.719-71.137c2.942-11.39 4.567-21.968 4.7-30.59c.147-9.463-1.465-16.417-4.789-20.665c-13.402-17.125-33.072-26.311-56.882-26.563c-16.369-.184-30.199 4.005-32.88 5.183c-5.646-1.404-11.801-2.266-18.502-2.376c-12.288-.199-22.91 2.743-31.704 8.74c-3.82-1.422-13.692-4.811-25.765-6.756c-20.872-3.36-37.458-.814-49.294 7.571c-14.123 10.006-20.643 27.892-19.38 53.16c.425 8.501 5.269 34.653 12.913 59.698c10.062 32.964 21 51.625 32.508 55.464c1.347.449 2.9.763 4.613.763c4.198 0 9.345-1.892 14.7-8.33a530 530 0 0 1 20.261-22.926c4.524 2.428 9.494 3.784 14.577 3.92q.016.2.035.398a118 118 0 0 0-2.57 3.175c-3.522 4.471-4.255 5.402-15.592 7.736c-3.225.666-11.79 2.431-11.916 8.435c-.136 6.56 10.125 9.315 11.294 9.607c4.074 1.02 7.999 1.523 11.742 1.523c9.103 0 17.114-2.992 23.516-8.781c-.197 23.386.778 46.43 3.586 53.451c2.3 5.748 7.918 19.795 25.664 19.794c2.604 0 5.47-.303 8.623-.979c18.521-3.97 26.564-12.156 29.675-30.203c1.665-9.645 4.522-32.676 5.866-45.03c2.836.885 6.487 1.29 10.434 1.289c8.232 0 17.731-1.749 23.688-4.514c6.692-3.108 18.768-10.734 16.578-17.36m-44.106-83.48c-.061 3.647-.563 6.958-1.095 10.414c-.573 3.717-1.165 7.56-1.314 12.225c-.147 4.54.42 9.26.968 13.825c1.108 9.22 2.245 18.712-2.156 28.078a37 37 0 0 1-1.95-4.009c-.547-1.326-1.735-3.456-3.38-6.404c-6.399-11.476-21.384-38.35-13.713-49.316c2.285-3.264 8.084-6.62 22.64-4.813m-17.644-61.787c21.334.471 38.21 8.452 50.158 23.72c9.164 11.711-.927 64.998-30.14 110.969a171 171 0 0 0-.886-1.117l-.37-.462c7.549-12.467 6.073-24.802 4.759-35.738c-.54-4.488-1.05-8.727-.92-12.709c.134-4.22.692-7.84 1.232-11.34c.663-4.313 1.338-8.776 1.152-14.037c.139-.552.195-1.204.122-1.978c-.475-5.045-6.235-20.144-17.975-33.81c-6.422-7.475-15.787-15.84-28.574-21.482c5.5-1.14 13.021-2.203 21.442-2.016M66.674 175.778c-5.9 7.094-9.974 5.734-11.314 5.288c-8.73-2.912-18.86-21.364-27.791-50.624c-7.728-25.318-12.244-50.777-12.602-57.916c-1.128-22.578 4.345-38.313 16.268-46.769c19.404-13.76 51.306-5.524 64.125-1.347c-.184.182-.376.352-.558.537c-21.036 21.244-20.537 57.54-20.485 59.759c-.002.856.07 2.068.168 3.735c.362 6.105 1.036 17.467-.764 30.334c-1.672 11.957 2.014 23.66 10.111 32.109a36 36 0 0 0 2.617 2.468c-3.604 3.86-11.437 12.396-19.775 22.426m22.479-29.993c-6.526-6.81-9.49-16.282-8.133-25.99c1.9-13.592 1.199-25.43.822-31.79c-.053-.89-.1-1.67-.127-2.285c3.073-2.725 17.314-10.355 27.47-8.028c4.634 1.061 7.458 4.217 8.632 9.645c6.076 28.103.804 39.816-3.432 49.229c-.873 1.939-1.698 3.772-2.402 5.668l-.546 1.466c-1.382 3.706-2.668 7.152-3.465 10.424c-6.938-.02-13.687-2.984-18.819-8.34m1.065 37.9c-2.026-.506-3.848-1.385-4.917-2.114c.893-.42 2.482-.992 5.238-1.56c13.337-2.745 15.397-4.683 19.895-10.394c1.031-1.31 2.2-2.794 3.819-4.602l.002-.002c2.411-2.7 3.514-2.242 5.514-1.412c1.621.67 3.2 2.702 3.84 4.938c.303 1.056.643 3.06-.47 4.62c-9.396 13.156-23.088 12.987-32.921 10.526m69.799 64.952c-16.316 3.496-22.093-4.829-25.9-14.346c-2.457-6.144-3.665-33.85-2.808-64.447c.011-.407-.047-.8-.159-1.17a15.4 15.4 0 0 0-.456-2.162c-1.274-4.452-4.379-8.176-8.104-9.72c-1.48-.613-4.196-1.738-7.46-.903c.696-2.868 1.903-6.107 3.212-9.614l.549-1.475c.618-1.663 1.394-3.386 2.214-5.21c4.433-9.848 10.504-23.337 3.915-53.81c-2.468-11.414-10.71-16.988-23.204-15.693c-7.49.775-14.343 3.797-17.761 5.53c-.735.372-1.407.732-2.035 1.082c.954-11.5 4.558-32.992 18.04-46.59c8.489-8.56 19.794-12.788 33.568-12.56c27.14.444 44.544 14.372 54.366 25.979c8.464 10.001 13.047 20.076 14.876 25.51c-13.755-1.399-23.11 1.316-27.852 8.096c-10.317 14.748 5.644 43.372 13.315 57.129c1.407 2.521 2.621 4.7 3.003 5.626c2.498 6.054 5.732 10.096 8.093 13.046c.724.904 1.426 1.781 1.96 2.547c-4.166 1.201-11.649 3.976-10.967 17.847c-.55 6.96-4.461 39.546-6.448 51.059c-2.623 15.21-8.22 20.875-23.957 24.25m68.104-77.936c-4.26 1.977-11.389 3.46-18.161 3.779c-7.48.35-11.288-.838-12.184-1.569c-.42-8.644 2.797-9.547 6.202-10.503c.535-.15 1.057-.297 1.561-.473q.469.383 1.032.756c6.012 3.968 16.735 4.396 31.874 1.271l.166-.033c-2.042 1.909-5.536 4.471-10.49 6.772"/></svg>',mysql:'<svg width="256" height="252" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 252"><path fill="#00546b" d="M235.648 194.212c-13.918-.347-24.705 1.045-33.752 4.872c-2.61 1.043-6.786 1.044-7.134 4.35c1.392 1.392 1.566 3.654 2.784 5.567c2.09 3.479 5.741 8.177 9.047 10.614c3.653 2.783 7.308 5.566 11.134 8.002c6.786 4.176 14.442 6.611 21.053 10.787c3.829 2.434 7.654 5.568 11.482 8.177c1.914 1.39 3.131 3.654 5.568 4.523v-.521c-1.219-1.567-1.567-3.828-2.784-5.568c-1.738-1.74-3.48-3.306-5.22-5.046c-5.045-6.784-11.308-12.7-18.093-17.571c-5.567-3.828-17.747-9.047-20.008-15.485c0 0-.175-.173-.348-.347c3.827-.348 8.35-1.74 12.005-2.784c5.915-1.567 11.308-1.218 17.398-2.784c2.783-.696 5.567-1.566 8.35-2.436v-1.565c-3.13-3.132-5.392-7.307-8.698-10.265c-8.873-7.657-18.617-15.137-28.707-21.4c-5.394-3.48-12.354-5.742-18.095-8.699c-2.086-1.045-5.567-1.566-6.784-3.306c-3.133-3.827-4.873-8.872-7.134-13.396c-5.044-9.57-9.917-20.182-14.267-30.272c-3.13-6.786-5.044-13.572-8.872-19.834c-17.92-29.577-37.406-47.497-67.33-65.07c-6.438-3.653-14.093-5.219-22.27-7.132c-4.348-.175-8.699-.522-13.048-.697c-2.784-1.218-5.568-4.523-8.004-6.089C34.006 4.573 8.429-8.996 1.122 8.924c-4.698 11.308 6.96 22.442 10.96 28.185c2.96 4.001 6.786 8.524 8.874 13.048c1.218 2.956 1.565 6.09 2.783 9.221c2.785 7.653 5.393 16.18 9.048 23.314c1.914 3.653 4.001 7.48 6.437 10.786c1.392 1.913 3.827 2.784 4.35 5.915c-2.435 3.48-2.61 8.7-4.003 13.049c-6.263 19.66-3.826 44.017 5.046 58.457c2.783 4.348 9.395 13.92 18.268 10.265c7.83-3.131 6.09-13.048 8.35-21.747c.524-2.09.176-3.48 1.219-4.872v.349c2.436 4.87 4.871 9.569 7.133 14.44c5.394 8.524 14.788 17.398 22.617 23.314c4.177 3.13 7.482 8.524 12.702 10.438v-.523h-.349c-1.044-1.566-2.61-2.261-4.001-3.48c-3.131-3.13-6.612-6.958-9.047-10.438c-7.306-9.744-13.745-20.53-19.486-31.665c-2.783-5.392-5.22-11.308-7.481-16.701c-1.045-2.09-1.045-5.22-2.784-6.263c-2.61 3.827-6.437 7.133-8.351 11.83c-3.304 7.481-3.653 16.702-4.871 26.27c-.696.176-.349 0-.697.35c-5.566-1.394-7.48-7.134-9.569-12.006c-5.22-12.352-6.09-32.186-1.565-46.452c1.218-3.654 6.438-15.136 4.35-18.616c-1.044-3.306-4.525-5.22-6.438-7.829c-2.261-3.306-4.698-7.48-6.263-11.135c-4.176-9.743-6.264-20.53-10.787-30.273c-2.088-4.524-5.74-9.22-8.699-13.396c-3.305-4.697-6.959-8.004-9.569-13.571c-.869-1.913-2.088-5.045-.696-7.133c.348-1.392 1.043-1.913 2.436-2.261c2.262-1.915 8.7.521 10.96 1.565c6.438 2.608 11.831 5.046 17.225 8.699c2.435 1.74 5.045 5.046 8.176 5.916h3.654c5.568 1.217 11.83.348 17.05 1.913c9.222 2.957 17.572 7.307 25.054 12.005c22.792 14.44 41.58 34.97 54.282 59.501c2.088 4 2.957 7.656 4.871 11.83c3.655 8.526 8.178 17.225 11.83 25.576c3.654 8.176 7.133 16.528 12.353 23.314c2.61 3.652 13.048 5.567 17.746 7.481c3.48 1.565 8.874 2.958 12.005 4.871c5.915 3.652 11.83 7.83 17.398 11.83c2.784 2.088 11.482 6.438 12.005 9.917"/><path fill="#00546b" d="M58.186 43.022c-2.957 0-5.044.35-7.132.871v.348h.348c1.393 2.784 3.827 4.698 5.566 7.133c1.393 2.783 2.61 5.568 4.003 8.352c.173-.175.347-.348.347-.348c2.437-1.741 3.654-4.524 3.654-8.7c-1.044-1.217-1.218-2.435-2.088-3.653c-1.043-1.741-3.306-2.61-4.698-4.003"/></svg>',nginx:'<svg width="256" height="291" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 291"><path fill="#009639" d="M2.054 218.187c1.32 2.347 3.227 4.108 5.575 5.428l112.962 65.137c4.695 2.787 10.416 2.787 14.964 0l112.963-65.137c4.695-2.64 7.482-7.629 7.482-13.057V80.284c0-5.428-2.787-10.416-7.482-13.056L135.555 2.09c-4.694-2.788-10.416-2.788-14.964 0L7.63 67.228C2.787 69.868 0 74.856 0 80.284v130.42c0 2.642.587 5.136 2.054 7.483"/><path fill="#fff" d="M91.837 195.154a14.463 14.463 0 0 1-14.524 14.524a14.463 14.463 0 0 1-14.523-14.524V95.542c0-7.776 6.895-14.084 16.43-14.084c6.896 0 14.965 2.787 19.806 8.802l4.4 5.282l60.737 72.618V95.835a14.463 14.463 0 0 1 14.524-14.524a14.463 14.463 0 0 1 14.523 14.524v99.613c0 7.775-6.895 14.083-16.43 14.083c-6.896 0-14.965-2.787-19.806-8.802l-65.137-77.754z"/></svg>',prometheus:'<svg width="256" height="257" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 257"><path fill="#da4e31" d="M128.001.667C57.311.667 0 57.971 0 128.664c0 70.69 57.311 127.998 128.001 127.998S256 199.354 256 128.664C256 57.97 198.689.667 128.001.667m0 239.56c-20.112 0-36.419-13.435-36.419-30.004h72.838c0 16.566-16.306 30.004-36.419 30.004m60.153-39.94H67.842V178.47h120.314v21.816zm-.432-33.045H68.185c-.398-.458-.804-.91-1.188-1.375c-12.315-14.954-15.216-22.76-18.032-30.716c-.048-.262 14.933 3.06 25.556 5.45c0 0 5.466 1.265 13.458 2.722c-7.673-8.994-12.23-20.428-12.23-32.116c0-25.658 19.68-48.079 12.58-66.201c6.91.562 14.3 14.583 14.8 36.505c7.346-10.152 10.42-28.69 10.42-40.056c0-11.769 7.755-25.44 15.512-25.907c-6.915 11.396 1.79 21.165 9.53 45.4c2.902 9.103 2.532 24.423 4.772 34.138c.744-20.178 4.213-49.62 17.014-59.784c-5.647 12.8.836 28.818 5.27 36.518c7.154 12.424 11.49 21.836 11.49 39.638c0 11.936-4.407 23.173-11.84 31.958c8.452-1.586 14.289-3.016 14.289-3.016l27.45-5.355c.002-.002-3.987 16.401-19.314 32.197"/></svg>',grafana:'<svg width="256" height="279" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 279"><defs><linearGradient id="SVGzNMMBeHh" x1="49.995%" x2="49.995%" y1="122.45%" y2="31.139%"><stop offset="0%" stop-color="#fff100"/><stop offset="100%" stop-color="#f05a28"/></linearGradient></defs><path fill="url(#SVGzNMMBeHh)" d="M255.59 122.775c-.46-4.675-1.226-10.04-2.759-16.017a98 98 0 0 0-7.204-19.16a106.7 106.7 0 0 0-13.412-20.54c-2.222-2.681-4.675-5.287-7.28-7.816c3.908-15.558-4.752-29.046-4.752-29.046c-14.945-.92-24.448 4.675-27.973 7.204c-.613-.23-1.15-.537-1.763-.767c-2.529-.996-5.135-1.992-7.894-2.835a130 130 0 0 0-8.277-2.3c-2.835-.69-5.67-1.226-8.583-1.686c-.537-.076-.996-.153-1.533-.23C157.646 8.738 138.946 0 138.946 0c-20.922 13.258-24.831 31.805-24.831 31.805s-.077.383-.23 1.073c-1.15.307-2.299.69-3.449.996c-1.609.46-3.218 1.073-4.751 1.686a123 123 0 0 0-4.752 1.916a117 117 0 0 0-9.35 4.599c-2.989 1.686-5.9 3.525-8.737 5.441l-.766-.307c-28.97-11.036-54.643 2.223-54.643 2.223c-2.376 30.809 11.572 50.198 14.331 53.724c-.69 1.916-1.303 3.832-1.916 5.748c-2.146 6.974-3.755 14.101-4.751 21.535c-.154 1.073-.307 2.146-.384 3.219C7.894 146.916 0 173.97 0 173.97c22.302 25.674 48.359 27.283 48.359 27.283l.077-.076c3.295 5.9 7.127 11.495 11.419 16.783a112 112 0 0 0 5.671 6.362c-8.124 23.298 1.15 42.61 1.15 42.61c24.83.92 41.155-10.882 44.603-13.564a85 85 0 0 0 7.511 2.222a109.7 109.7 0 0 0 23.298 3.449c1.916.076 3.909.153 5.825.076h2.759l1.226-.076v.076c11.726 16.708 32.265 19.084 32.265 19.084c14.638-15.405 15.48-30.733 15.48-34.028v-1.38c3.066-2.145 5.979-4.445 8.738-6.974c5.824-5.288 10.959-11.342 15.25-17.857l1.15-1.839c16.554.92 28.28-10.27 28.28-10.27c-2.759-17.243-12.569-25.673-14.638-27.283c0 0-.077-.076-.23-.153s-.153-.153-.153-.153c-.077-.077-.23-.154-.383-.23c.076-1.073.153-2.07.23-3.142c.153-1.84.153-3.756.153-5.595v-2.913l-.077-1.149l-.076-1.533c0-.536-.077-.996-.154-1.456c-.076-.46-.076-.996-.153-1.456l-.153-1.456l-.23-1.456c-.307-1.916-.613-3.756-1.073-5.672c-1.763-7.433-4.675-14.484-8.43-20.845a70.4 70.4 0 0 0-14.025-16.707c-5.365-4.752-11.42-8.584-17.704-11.42c-6.36-2.835-12.952-4.675-19.543-5.518c-3.295-.46-6.59-.613-9.886-.536h-2.453l-1.226.077c-.46 0-.92.076-1.303.076a52 52 0 0 0-4.981.69c-6.591 1.226-12.799 3.602-18.24 6.897s-10.193 7.358-14.025 11.956a54.7 54.7 0 0 0-8.89 15.021a52.9 52.9 0 0 0-3.525 16.094c-.077 1.303-.077 2.683-.077 3.986v.996l.077 1.073c.076.613.076 1.303.153 1.916c.23 2.682.766 5.288 1.456 7.74c1.456 4.982 3.755 9.503 6.59 13.335s6.285 6.975 9.887 9.504c3.602 2.452 7.51 4.215 11.343 5.364c3.832 1.15 7.664 1.61 11.266 1.61h1.993c.23 0 .46 0 .689-.077c.383 0 .766-.077 1.15-.077c.076 0 .23 0 .306-.076l.383-.077c.23 0 .46-.076.69-.076c.46-.077.843-.154 1.303-.23s.843-.154 1.226-.307c.843-.153 1.61-.46 2.376-.69c1.533-.536 3.066-1.15 4.368-1.839c1.38-.69 2.606-1.533 3.832-2.3c.307-.23.69-.459.997-.766c1.226-.996 1.456-2.835.46-4.061c-.844-1.073-2.376-1.38-3.603-.69l-.92.46a25 25 0 0 1-3.295 1.38c-1.15.382-2.375.689-3.602.919c-.613.076-1.226.153-1.916.23c-.306 0-.613.076-.996.076h-1.84c-.383 0-.766 0-1.149-.076h-.46c-.153 0-.383 0-.536-.077c-.383-.077-.69-.077-1.073-.153c-2.836-.383-5.671-1.226-8.354-2.453a29.3 29.3 0 0 1-7.74-5.058c-2.376-2.146-4.445-4.675-6.055-7.587s-2.759-6.131-3.295-9.503c-.23-1.686-.383-3.449-.307-5.135c0-.46.077-.92.077-1.38v-.613c0-.23.077-.46.077-.69c.076-.919.23-1.839.383-2.758c1.303-7.358 4.981-14.562 10.653-20.003c1.456-1.38 2.988-2.606 4.598-3.755a31.7 31.7 0 0 1 5.211-2.99a36 36 0 0 1 5.672-2.068c1.915-.537 3.908-.844 5.977-1.073c.997-.077 1.993-.154 3.066-.154h2.376l.843.077c2.222.153 4.368.46 6.514.996c4.292.92 8.507 2.53 12.415 4.675c7.818 4.369 14.485 11.113 18.547 19.237c2.07 4.061 3.525 8.43 4.215 12.951c.153 1.15.307 2.3.383 3.45l.077.842l.077.843v3.296c0 .536-.077 1.456-.077 1.992c-.077 1.227-.23 2.53-.383 3.756s-.383 2.452-.613 3.678a50 50 0 0 1-.843 3.602a64 64 0 0 1-2.3 7.128a62.4 62.4 0 0 1-7.204 13.105c-5.9 8.124-13.948 14.715-23.144 18.93c-4.599 2.069-9.427 3.602-14.408 4.368c-2.453.46-4.982.69-7.511.766h-3.832a36 36 0 0 1-4.062-.23c-5.365-.383-10.653-1.379-15.864-2.835c-5.135-1.456-10.116-3.525-14.868-5.978c-9.427-5.058-17.933-11.956-24.524-20.31a79 79 0 0 1-8.584-13.334a79 79 0 0 1-5.671-14.638c-1.38-5.058-2.223-10.193-2.606-15.405l-.077-.996v-6.821c.077-2.529.307-5.211.614-7.817c.306-2.606.766-5.288 1.302-7.894c.537-2.605 1.15-5.211 1.916-7.817a103 103 0 0 1 5.442-14.791c4.368-9.35 10.04-17.704 16.86-24.371c1.686-1.686 3.449-3.22 5.288-4.752a78 78 0 0 1 5.748-4.138c1.916-1.303 3.985-2.453 6.055-3.526a40 40 0 0 1 3.142-1.533l3.219-1.379c2.146-.92 4.368-1.686 6.667-2.376c.537-.153 1.15-.306 1.686-.536c.537-.154 1.15-.307 1.686-.46c1.15-.307 2.3-.613 3.45-.843c.536-.153 1.149-.23 1.762-.383c.613-.154 1.15-.23 1.763-.384c.613-.076 1.15-.23 1.762-.306l.843-.153l.92-.154c.613-.076 1.15-.153 1.763-.23c.69-.076 1.302-.153 1.992-.23c.537-.076 1.456-.153 1.993-.23c.383-.076.843-.076 1.226-.153l.843-.076l.383-.077h.46c.69-.077 1.303-.077 1.993-.153l.996-.077h.767c.536 0 1.149-.076 1.685-.076a99 99 0 0 1 6.745 0c4.445.153 8.813.69 13.028 1.456c8.507 1.61 16.478 4.291 23.758 7.893c7.28 3.526 13.719 7.894 19.39 12.646c.383.306.69.613 1.073.92c.306.306.69.613.996.92c.69.612 1.303 1.225 1.993 1.838c.69.614 1.303 1.227 1.916 1.84a44 44 0 0 1 1.839 1.916c2.376 2.529 4.598 5.058 6.59 7.664a99 99 0 0 1 9.734 15.25l.46.92l.46.92c.306.613.613 1.226.843 1.84c.306.613.536 1.149.843 1.762c.23.613.536 1.15.766 1.763c.92 2.299 1.84 4.521 2.53 6.59c1.149 3.373 1.992 6.362 2.682 8.967a2.043 2.043 0 0 0 2.299 1.61c1.15-.077 1.992-.996 1.992-2.146c.077-2.759 0-6.054-.383-9.81"/></svg>',kubernetes:'<svg width="256" height="249" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 249"><path fill="#326de6" d="M82.085 244.934c-5.946 0-11.561-2.642-15.36-7.432L8.92 165.657c-3.799-4.79-5.285-10.9-3.799-16.847l20.645-89.682c1.321-5.946 5.285-10.736 10.736-13.378l83.571-39.97c2.643-1.32 5.616-1.981 8.589-1.981s5.945.66 8.588 1.982l83.572 39.804c5.45 2.642 9.414 7.432 10.735 13.378l20.645 89.682c1.322 5.946 0 12.057-3.798 16.847l-57.807 71.845c-3.799 4.624-9.414 7.432-15.36 7.432z"/><path fill="#fff" d="M128.495 7.928c2.313 0 4.625.495 6.772 1.486l83.572 39.804c4.294 2.147 7.597 6.111 8.588 10.736l20.645 89.682c1.156 4.79 0 9.745-3.138 13.543l-57.806 71.846c-2.973 3.798-7.598 5.945-12.387 5.945H82.085c-4.79 0-9.414-2.147-12.387-5.945l-57.806-71.846c-2.973-3.798-4.13-8.753-3.138-13.543l20.645-89.682c1.156-4.79 4.294-8.754 8.588-10.736L121.56 9.25c2.147-.826 4.624-1.321 6.936-1.321m0-7.763c-3.468 0-6.936.826-10.24 2.312l-83.571 39.97c-6.607 3.138-11.231 8.918-12.883 16.02L1.156 148.15c-1.651 7.102 0 14.369 4.625 20.15l57.806 71.845c4.46 5.615 11.231 8.753 18.333 8.753h92.655c7.102 0 13.874-3.138 18.333-8.753l57.807-71.846c4.624-5.615 6.276-13.047 4.624-20.15l-20.645-89.682c-1.651-7.102-6.276-12.882-12.882-16.02L138.57 2.476C135.432.991 131.964.165 128.495.165"/><path fill="#fff" d="M212.232 142.534q-.248 0 0 0h-.165c-.165 0-.33 0-.33-.165c-.33 0-.66-.165-.991-.165c-1.156-.165-2.147-.33-3.138-.33c-.496 0-.991 0-1.652-.166h-.165c-3.468-.33-6.276-.66-8.919-1.486c-1.156-.496-1.486-1.156-1.817-1.817c0-.165-.165-.165-.165-.33l-2.147-.66a65.3 65.3 0 0 0-1.156-23.289a68 68 0 0 0-9.249-21.636l1.652-1.486v-.33c0-.826.165-1.652.825-2.478c1.982-1.817 4.46-3.303 7.433-5.12c.495-.33.99-.495 1.486-.826c.991-.495 1.817-.99 2.808-1.651c.165-.165.495-.33.826-.66c.165-.166.33-.166.33-.331c2.312-1.982 2.808-5.285 1.156-7.433c-.826-1.156-2.312-1.816-3.799-1.816c-1.32 0-2.477.495-3.633 1.321l-.33.33c-.33.165-.496.496-.826.661c-.826.826-1.487 1.486-2.147 2.312c-.33.33-.66.826-1.156 1.156c-2.313 2.478-4.46 4.46-6.607 5.946q-.742.495-1.486.496c-.33 0-.661 0-.991-.166h-.33l-1.983 1.322c-2.147-2.312-4.459-4.294-6.771-6.276a65.96 65.96 0 0 0-34.519-13.709l-.165-2.147l-.33-.33c-.496-.496-1.156-.991-1.322-2.147c-.165-2.643.166-5.616.496-8.919v-.165c0-.496.165-1.156.33-1.652c.165-.99.33-1.982.496-3.138v-1.486c0-2.973-2.313-5.45-5.12-5.45c-1.322 0-2.643.66-3.634 1.651c-.99.991-1.486 2.312-1.486 3.799v1.321c0 1.156.165 2.147.495 3.138c.165.496.165.991.33 1.652v.165c.33 3.303.826 6.276.496 8.919c-.165 1.156-.826 1.651-1.321 2.147l-.33.33l-.166 2.147c-2.973.33-5.946.66-8.919 1.321c-12.717 2.808-23.948 9.25-32.701 18.498l-1.652-1.156h-.33c-.33 0-.661.165-.991.165q-.743 0-1.487-.495c-2.147-1.486-4.294-3.634-6.606-6.111c-.33-.33-.66-.826-1.156-1.156c-.661-.826-1.322-1.487-2.148-2.312c-.165-.166-.495-.33-.825-.661c-.165-.165-.33-.165-.33-.33a5.77 5.77 0 0 0-3.634-1.322c-1.487 0-2.973.661-3.799 1.817c-1.652 2.147-1.156 5.45 1.156 7.432c.165 0 .165.166.33.166c.33.165.496.495.826.66c.991.66 1.817 1.156 2.808 1.652c.496.165.991.495 1.487.826c2.972 1.816 5.45 3.303 7.432 5.12c.826.825.826 1.651.826 2.477v.33l1.651 1.487c-.33.495-.66.826-.826 1.321c-8.258 13.048-11.396 28.408-9.249 43.603l-2.147.66c0 .166-.165.166-.165.33c-.33.661-.826 1.322-1.817 1.817c-2.477.826-5.45 1.157-8.918 1.487h-.166c-.495 0-1.156 0-1.651.165c-.991 0-1.982.165-3.138.33c-.33 0-.66.166-.991.166c-.165 0-.33 0-.496.165c-2.973.66-4.79 3.468-4.294 6.11c.496 2.313 2.643 3.8 5.285 3.8c.496 0 .826 0 1.322-.166c.165 0 .33 0 .33-.165c.33 0 .66-.165.99-.165c1.157-.33 1.983-.66 2.974-1.156c.495-.165.99-.496 1.486-.66h.165c3.138-1.157 5.946-2.148 8.589-2.478h.33c.991 0 1.652.495 2.147.826c.165 0 .165.165.33.165l2.313-.33c3.964 12.221 11.561 23.122 21.636 31.05c2.312 1.816 4.624 3.303 7.102 4.79l-.991 2.146c0 .166.165.166.165.33c.33.661.66 1.487.33 2.643c-.99 2.478-2.477 4.955-4.294 7.763v.165c-.33.496-.66.826-.99 1.321c-.661.826-1.157 1.652-1.818 2.643c-.165.165-.33.495-.495.826c0 .165-.165.33-.165.33c-1.321 2.808-.33 5.946 2.147 7.102q.99.496 1.982.496c1.982 0 3.964-1.322 4.955-3.139c0-.165.165-.33.165-.33c.165-.33.33-.66.495-.826c.496-1.156.661-1.982.991-2.973l.496-1.486c1.156-3.303 1.982-5.946 3.468-8.258c.66-.991 1.487-1.156 2.147-1.487c.165 0 .165 0 .33-.165l1.157-2.147c7.267 2.808 15.195 4.294 23.122 4.294c4.79 0 9.745-.495 14.37-1.651a73 73 0 0 0 8.588-2.478l.99 1.817c.166 0 .166 0 .331.165c.826.165 1.486.496 2.147 1.487c1.321 2.312 2.312 5.12 3.468 8.258v.165l.496 1.486c.33.991.495 1.982.99 2.973c.166.33.331.496.496.826c0 .165.166.33.166.33c.99 1.982 2.972 3.139 4.954 3.139q.992 0 1.982-.496c1.156-.66 2.147-1.652 2.478-2.973c.33-1.321.33-2.808-.33-4.129c0-.165-.166-.165-.166-.33c-.165-.33-.33-.66-.495-.826c-.496-.991-1.156-1.817-1.817-2.643c-.33-.495-.66-.825-.99-1.32v-.166c-1.818-2.808-3.47-5.285-4.295-7.763c-.33-1.156 0-1.816.165-2.642c0-.165.165-.165.165-.33l-.826-1.982c8.754-5.12 16.186-12.388 21.802-21.306c2.973-4.625 5.285-9.745 6.936-14.865l1.982.33c.166 0 .166-.165.33-.165c.661-.33 1.157-.825 2.148-.825h.33c2.643.33 5.45 1.32 8.589 2.477h.165c.495.165.99.495 1.486.66c.991.496 1.817.826 2.973 1.157c.33 0 .66.165.991.165c.165 0 .33 0 .495.165c.496.165.826.165 1.322.165c2.477 0 4.624-1.651 5.285-3.798c0-1.982-1.817-4.625-4.79-5.45m-76.47-8.093l-7.267 3.469l-7.267-3.469l-1.816-7.762l4.954-6.276h8.093l4.955 6.276zm43.108-17.176a52.1 52.1 0 0 1 1.156 16.68l-25.27-7.266c-2.312-.66-3.633-2.973-3.138-5.285c.165-.661.496-1.322.991-1.817l19.985-18.003c2.807 4.625 4.954 9.91 6.276 15.69m-14.204-25.6l-21.636 15.36c-1.817 1.156-4.295.825-5.781-.991c-.495-.496-.66-1.157-.826-1.817l-1.486-26.922a50.13 50.13 0 0 1 29.729 14.37M116.769 78.12c1.817-.33 3.468-.66 5.285-.99l-1.486 26.425c-.165 2.312-1.982 4.294-4.46 4.294c-.66 0-1.486-.165-1.982-.495L92.16 91.665c6.772-6.772 15.195-11.397 24.609-13.544m-32.537 23.453l19.654 17.507c1.817 1.487 1.982 4.294.496 6.111c-.496.66-1.156 1.156-1.982 1.322l-25.6 7.432c-.991-11.231 1.486-22.627 7.432-32.372m-4.46 44.759l26.262-4.46c2.147-.165 4.129 1.322 4.624 3.469c.165.99.165 1.817-.165 2.643l-10.075 24.278c-9.249-5.946-16.681-15.03-20.645-25.93m60.285 32.867c-3.799.826-7.598 1.321-11.562 1.321c-5.78 0-11.396-.99-16.68-2.642l13.047-23.618c1.321-1.487 3.468-2.147 5.285-1.156a7 7 0 0 1 1.982 1.816l12.717 22.958c-1.486.495-3.138.826-4.79 1.321m32.206-22.957c-4.129 6.606-9.58 11.891-15.855 16.02l-10.405-24.94c-.496-1.981.33-4.128 2.312-5.12c.66-.33 1.486-.495 2.312-.495l26.426 4.46c-.991 3.633-2.643 6.937-4.79 10.075"/></svg>',python:'<svg width="256" height="255" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 255"><defs><linearGradient id="SVGg39WleeP" x1="12.959%" x2="79.639%" y1="12.039%" y2="78.201%"><stop offset="0%" stop-color="#387eb8"/><stop offset="100%" stop-color="#366994"/></linearGradient><linearGradient id="SVGlXoRkc4T" x1="19.128%" x2="90.742%" y1="20.579%" y2="88.429%"><stop offset="0%" stop-color="#ffe052"/><stop offset="100%" stop-color="#ffc331"/></linearGradient></defs><path fill="url(#SVGg39WleeP)" d="M126.916.072c-64.832 0-60.784 28.115-60.784 28.115l.072 29.128h61.868v8.745H41.631S.145 61.355.145 126.77c0 65.417 36.21 63.097 36.21 63.097h21.61v-30.356s-1.165-36.21 35.632-36.21h61.362s34.475.557 34.475-33.319V33.97S194.67.072 126.916.072M92.802 19.66a11.12 11.12 0 0 1 11.13 11.13a11.12 11.12 0 0 1-11.13 11.13a11.12 11.12 0 0 1-11.13-11.13a11.12 11.12 0 0 1 11.13-11.13"/><path fill="url(#SVGlXoRkc4T)" d="M128.757 254.126c64.832 0 60.784-28.115 60.784-28.115l-.072-29.127H127.6v-8.745h86.441s41.486 4.705 41.486-60.712c0-65.416-36.21-63.096-36.21-63.096h-21.61v30.355s1.165 36.21-35.632 36.21h-61.362s-34.475-.557-34.475 33.32v56.013s-5.235 33.897 62.518 33.897m34.114-19.586a11.12 11.12 0 0 1-11.13-11.13a11.12 11.12 0 0 1 11.13-11.131a11.12 11.12 0 0 1 11.13 11.13a11.12 11.12 0 0 1-11.13 11.13"/></svg>',react:'<svg width="256" height="228" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 228"><path fill="#00d8ff" d="M210.483 73.824a172 172 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171 171 0 0 0-6.375 5.848a156 156 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a171 171 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a146 146 0 0 0 6.921 2.165a168 168 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a146 146 0 0 0 5.342-4.923a168 168 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145 145 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844m-6.365 70.984q-2.102.694-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14m-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a157 157 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345q.785 3.162 1.386 6.193M87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a157 157 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a135 135 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94M50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a135 135 0 0 1-6.318-1.979m12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144 144 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160 160 0 0 1-1.76-7.887m110.427 27.268a348 348 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381 381 0 0 0-7.365-13.322m-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322 322 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18M82.802 87.83a323 323 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a322 322 0 0 0-7.848 12.897m8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321 321 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147m37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486m52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382 382 0 0 0 7.859-13.026a347 347 0 0 0 7.425-13.565m-16.898 8.101a359 359 0 0 1-12.281 19.815a329 329 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310 310 0 0 1-12.513-19.846h.001a307 307 0 0 1-10.923-20.627a310 310 0 0 1 10.89-20.637l-.001.001a307 307 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329 329 0 0 1 12.335 19.695a359 359 0 0 1 11.036 20.54a330 330 0 0 1-11 20.722m22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026q-.518 2.504-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a161 161 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3M128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86"/></svg>',terraform:'<svg width="256" height="291" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 291"><path fill="#4040b2" d="M176.485 188.994L256 143.127V51.249l-79.515 45.963z"/><path fill="#5c4ee5" d="m88.243 51.249l79.515 45.963v91.782L88.243 143.08M0 91.83l79.515 45.916v-91.83L0 0m88.243 244.994l79.515 45.915v-91.83l-79.515-45.915"/></svg>',rabbitmq:'<svg width="256" height="257" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 257"><path fill="#f60" d="M245.734 102.437h-81.911a10.2 10.2 0 0 1-10.263-10.263v-81.91a10.2 10.2 0 0 0-10.263-10.2h-30.66a10.2 10.2 0 0 0-10.264 10.2v81.91a10.2 10.2 0 0 1-10.263 10.263H61.45a10.2 10.2 0 0 1-10.263-10.263v-81.91A10.2 10.2 0 0 0 40.924 0H10.199A10.2 10.2 0 0 0 0 10.263v235.535a10.2 10.2 0 0 0 10.263 10.263h235.47a10.2 10.2 0 0 0 10.264-10.263V112.893a10.2 10.2 0 0 0-10.263-10.456m-41.18 86.979a15.33 15.33 0 0 1-15.33 15.394h-20.526a15.33 15.33 0 0 1-15.33-15.394v-20.462a15.33 15.33 0 0 1 15.33-15.394h20.525a15.33 15.33 0 0 1 15.33 15.394z"/></svg>',elasticsearch:'<svg width="256" height="288" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 288"><path fill="#343741" d="M0 143.82c0 12.44 1.744 24.441 4.71 35.956h175.067c19.856 0 35.955-16.1 35.955-35.956c0-19.865-16.1-35.955-35.955-35.955H4.71C1.744 119.371 0 131.38 0 143.82"/><path fill="#fec514" d="M242.013 68.863c5.025-4.629 9.7-9.6 13.987-14.93C229.636 21.079 189.213 0 143.82 0C87 0 38.101 33.052 14.775 80.9h196.559c11.38 0 22.319-4.324 30.678-12.037"/><path fill="#00bfb3" d="M211.334 206.742H14.774c23.336 47.839 72.226 80.9 129.045 80.9c45.393 0 85.816-21.088 112.18-53.933a136.6 136.6 0 0 0-13.987-14.94c-8.36-7.721-19.299-12.027-30.678-12.027"/></svg>',nodejs:'<svg width="512" height="314" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 314"><defs><linearGradient id="SVG1ChKRdyM" x1="68.188%" x2="27.823%" y1="17.487%" y2="89.755%"><stop offset="0%" stop-color="#41873f"/><stop offset="32.88%" stop-color="#418b3d"/><stop offset="63.52%" stop-color="#419637"/><stop offset="93.19%" stop-color="#3fa92d"/><stop offset="100%" stop-color="#3fae2a"/></linearGradient><linearGradient id="SVGaMJtkcxE" x1="43.277%" x2="159.245%" y1="55.169%" y2="-18.306%"><stop offset="13.76%" stop-color="#41873f"/><stop offset="40.32%" stop-color="#54a044"/><stop offset="71.36%" stop-color="#66b848"/><stop offset="90.81%" stop-color="#6cc04a"/></linearGradient><linearGradient id="SVG6PkGjd1W" x1="-4413.77%" x2="5327.93%" y1="13.43%" y2="13.43%"><stop offset="9.192%" stop-color="#6cc04a"/><stop offset="28.64%" stop-color="#66b848"/><stop offset="59.68%" stop-color="#54a044"/><stop offset="86.24%" stop-color="#41873f"/></linearGradient><linearGradient id="SVGPqbGjbGu" x1="-4.389%" x2="101.499%" y1="49.997%" y2="49.997%"><stop offset="9.192%" stop-color="#6cc04a"/><stop offset="28.64%" stop-color="#66b848"/><stop offset="59.68%" stop-color="#54a044"/><stop offset="86.24%" stop-color="#41873f"/></linearGradient><linearGradient id="SVGhSuPuc0t" x1="-9713.77%" x2="27.93%" y1="36.21%" y2="36.21%"><stop offset="9.192%" stop-color="#6cc04a"/><stop offset="28.64%" stop-color="#66b848"/><stop offset="59.68%" stop-color="#54a044"/><stop offset="86.24%" stop-color="#41873f"/></linearGradient><linearGradient id="SVGFiwIH9Kx" x1="-103.861%" x2="100.797%" y1="50.275%" y2="50.275%"><stop offset="9.192%" stop-color="#6cc04a"/><stop offset="28.64%" stop-color="#66b848"/><stop offset="59.68%" stop-color="#54a044"/><stop offset="86.24%" stop-color="#41873f"/></linearGradient><linearGradient id="SVGozO7odBP" x1="130.613%" x2="4.393%" y1="-211.069%" y2="201.605%"><stop offset="0%" stop-color="#41873f"/><stop offset="32.88%" stop-color="#418b3d"/><stop offset="63.52%" stop-color="#419637"/><stop offset="93.19%" stop-color="#3fa92d"/><stop offset="100%" stop-color="#3fae2a"/></linearGradient><path id="SVGnk2VSdjf" d="M57.903 1.85a5.96 5.96 0 0 0-5.894 0L3.352 29.933c-1.85 1.04-2.89 3.005-2.89 5.085v56.286c0 2.08 1.156 4.045 2.89 5.085l48.657 28.085a5.96 5.96 0 0 0 5.894 0l48.658-28.085c1.849-1.04 2.89-3.005 2.89-5.085V35.019c0-2.08-1.157-4.045-2.89-5.085z"/></defs><g fill="none"><path fill="#539e43" d="M253.11 313.094c-1.733 0-3.351-.462-4.854-1.271l-15.371-9.13c-2.312-1.272-1.156-1.734-.462-1.965c3.12-1.04 3.698-1.272 6.934-3.12c.347-.232.81-.116 1.156.115l11.789 7.05c.462.231 1.04.231 1.386 0l46.115-26.698c.462-.231.694-.694.694-1.271v-53.28c0-.579-.232-1.04-.694-1.272l-46.115-26.582c-.462-.232-1.04-.232-1.386 0l-46.115 26.582c-.462.231-.694.809-.694 1.271v53.28c0 .463.232 1.04.694 1.272l12.598 7.281c6.819 3.467 11.095-.578 11.095-4.623v-52.587c0-.693.578-1.387 1.387-1.387h5.894c.694 0 1.387.578 1.387 1.387v52.587c0 9.13-4.97 14.447-13.638 14.447c-2.658 0-4.738 0-10.633-2.89l-12.135-6.934c-3.005-1.733-4.854-4.97-4.854-8.437v-53.28c0-3.467 1.849-6.704 4.854-8.437l46.114-26.698c2.89-1.618 6.82-1.618 9.709 0l46.114 26.698c3.005 1.733 4.855 4.97 4.855 8.437v53.28c0 3.467-1.85 6.704-4.855 8.437l-46.114 26.698c-1.503.694-3.236 1.04-4.854 1.04m14.216-36.637c-20.225 0-24.386-9.246-24.386-17.105c0-.694.578-1.387 1.387-1.387h6.01c.693 0 1.271.462 1.271 1.156c.925 6.125 3.583 9.13 15.834 9.13c9.708 0 13.87-2.196 13.87-7.397c0-3.005-1.157-5.2-16.297-6.703c-12.598-1.272-20.457-4.045-20.457-14.1c0-9.362 7.86-14.91 21.035-14.91c14.793 0 22.075 5.086 23 16.18q0 .521-.347 1.041c-.232.231-.578.462-.925.462h-6.01c-.578 0-1.156-.462-1.271-1.04c-1.387-6.356-4.97-8.437-14.447-8.437c-10.633 0-11.905 3.699-11.905 6.472c0 3.352 1.503 4.392 15.834 6.241c14.216 1.85 20.92 4.508 20.92 14.447c-.116 10.171-8.437 15.95-23.116 15.95"/><path fill="#333" d="M110.028 104.712c0-2.08-1.156-4.046-3.005-5.086l-49.004-28.2c-.81-.463-1.734-.694-2.658-.81h-.463c-.924 0-1.849.347-2.658.81l-49.004 28.2c-1.85 1.04-3.005 3.005-3.005 5.086l.116 75.817c0 1.04.578 2.08 1.502 2.543c.925.578 2.08.578 2.89 0l29.125-16.643c1.849-1.04 3.005-3.005 3.005-5.085v-35.482c0-2.08 1.155-4.045 3.005-5.085l12.366-7.166c.925-.578 1.965-.81 3.005-.81s2.08.232 2.89.81l12.366 7.166c1.85 1.04 3.005 3.004 3.005 5.085v35.482c0 2.08 1.156 4.045 3.005 5.085l29.125 16.643a2.82 2.82 0 0 0 3.005 0c.925-.463 1.503-1.503 1.503-2.543zM345.571.347c-.924-.463-2.08-.463-2.89 0c-.924.578-1.502 1.502-1.502 2.542v75.125c0 .693-.346 1.386-1.04 1.849q-1.04.519-2.08 0l-12.251-7.05a5.96 5.96 0 0 0-5.895 0l-49.004 28.316c-1.849 1.04-3.005 3.005-3.005 5.085v56.516c0 2.08 1.156 4.046 3.005 5.086l49.004 28.316a5.96 5.96 0 0 0 5.895 0l49.004-28.316c1.849-1.04 3.005-3.005 3.005-5.086V21.844c0-2.196-1.156-4.16-3.005-5.201zm-4.507 143.776c0 .578-.231 1.04-.694 1.271l-16.758 9.708a1.71 1.71 0 0 1-1.503 0l-16.758-9.708c-.463-.231-.694-.809-.694-1.271v-19.417c0-.578.231-1.04.694-1.271l16.758-9.709a1.71 1.71 0 0 1 1.503 0l16.758 9.709c.463.23.694.809.694 1.271zm167.584-19.879c1.85-1.04 2.89-3.005 2.89-5.086v-13.753c0-2.08-1.156-4.045-2.89-5.085l-48.657-28.2a5.96 5.96 0 0 0-5.895 0l-49.004 28.315c-1.85 1.04-3.005 3.005-3.005 5.085v56.517c0 2.08 1.156 4.045 3.005 5.085l48.657 27.738c1.85 1.04 4.046 1.04 5.78 0L489 178.45c.925-.463 1.503-1.503 1.503-2.543s-.578-2.08-1.503-2.543l-49.235-28.316c-.925-.578-1.503-1.502-1.503-2.542v-17.683c0-1.04.578-2.08 1.503-2.543l15.371-8.784a2.82 2.82 0 0 1 3.005 0l15.372 8.784c.925.578 1.502 1.502 1.502 2.543v13.869c0 1.04.578 2.08 1.503 2.542a2.82 2.82 0 0 0 3.005 0z"/><path fill="#539e43" d="M456.292 121.585a1.05 1.05 0 0 1 1.156 0l9.362 5.432c.346.232.577.578.577 1.04v10.865c0 .462-.23.809-.577 1.04l-9.362 5.432a1.05 1.05 0 0 1-1.156 0l-9.361-5.432c-.347-.231-.578-.578-.578-1.04v-10.864c0-.463.23-.81.578-1.04z"/><g transform="translate(134.068 70.501)"><mask id="SVGifRk2cfR" fill="#fff"><use href="#SVGnk2VSdjf"/></mask><use fill="url(#SVG1ChKRdyM)" href="#SVGnk2VSdjf"/><g mask="url(#SVGifRk2cfR)"><path d="M51.893 1.85L3.121 29.933C1.27 30.974 0 32.94 0 35.02v56.286c0 1.387.578 2.658 1.502 3.698L56.285 1.156c-1.387-.231-3.005-.116-4.392.693m4.739 123.204c.462-.116.925-.347 1.387-.578l48.773-28.085c1.85-1.04 3.005-3.005 3.005-5.085V35.019c0-1.502-.694-3.005-1.734-4.045z"/><path fill="url(#SVGaMJtkcxE)" d="M106.676 29.934L57.788 1.85a8 8 0 0 0-1.503-.578L1.502 95.12a6.1 6.1 0 0 0 1.619 1.387l48.888 28.085c1.387.809 3.005 1.04 4.507.577l51.432-94.078c-.347-.462-.81-.81-1.272-1.156"/></g><g mask="url(#SVGifRk2cfR)"><path d="M109.797 91.305V35.019c0-2.08-1.271-4.045-3.12-5.085L57.786 1.85a5.1 5.1 0 0 0-1.848-.693l53.511 91.42c.231-.347.347-.809.347-1.271M3.12 29.934C1.272 30.974 0 32.94 0 35.02v56.286c0 2.08 1.387 4.045 3.12 5.085l48.889 28.085q1.734 1.04 3.814.693L3.467 29.818z"/><path fill="url(#SVG6PkGjd1W)" fill-rule="evenodd" d="m50.391.809l-.693.347h.924z" transform="translate(0 -9.246)"/><path fill="url(#SVGPqbGjbGu)" fill-rule="evenodd" d="M106.792 105.636c1.387-.809 2.427-2.196 2.89-3.698L56.053 10.402c-1.387-.231-2.89-.116-4.16.693L3.351 39.065l52.355 95.465a8 8 0 0 0 2.196-.693z" transform="translate(0 -9.246)"/><path fill="url(#SVGhSuPuc0t)" fill-rule="evenodd" d="m111.3 104.712l-.347-.578v.809z" transform="translate(0 -9.246)"/><path fill="url(#SVGFiwIH9Kx)" fill-rule="evenodd" d="m106.792 105.636l-48.773 28.085a7 7 0 0 1-2.196.693l.925 1.734l54.089-31.32v-.694l-1.387-2.312c-.231 1.618-1.271 3.005-2.658 3.814" transform="translate(0 -9.246)"/><path fill="url(#SVGozO7odBP)" fill-rule="evenodd" d="m106.792 105.636l-48.773 28.085a7 7 0 0 1-2.196.693l.925 1.734l54.089-31.32v-.694l-1.387-2.312c-.231 1.618-1.271 3.005-2.658 3.814" transform="translate(0 -9.246)"/></g></g></g></svg>',nodejsicon:'<svg width="256" height="289" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 289"><path fill="#539e43" d="M128 288.464c-3.975 0-7.685-1.06-11.13-2.915l-35.247-20.936c-5.3-2.915-2.65-3.975-1.06-4.505c7.155-2.385 8.48-2.915 15.9-7.156c.796-.53 1.856-.265 2.65.265l27.032 16.166c1.06.53 2.385.53 3.18 0l105.74-61.217c1.06-.53 1.59-1.59 1.59-2.915V83.08c0-1.325-.53-2.385-1.59-2.915l-105.74-60.953c-1.06-.53-2.385-.53-3.18 0L20.405 80.166c-1.06.53-1.59 1.855-1.59 2.915v122.17c0 1.06.53 2.385 1.59 2.915l28.887 16.695c15.636 7.95 25.44-1.325 25.44-10.6V93.68c0-1.59 1.326-3.18 3.181-3.18h13.516c1.59 0 3.18 1.325 3.18 3.18v120.58c0 20.936-11.396 33.126-31.272 33.126c-6.095 0-10.865 0-24.38-6.625l-27.827-15.9C4.24 220.885 0 213.465 0 205.515V83.346C0 75.396 4.24 67.976 11.13 64L116.87 2.783c6.625-3.71 15.635-3.71 22.26 0L244.87 64C251.76 67.975 256 75.395 256 83.346v122.17c0 7.95-4.24 15.37-11.13 19.345L139.13 286.08c-3.445 1.59-7.42 2.385-11.13 2.385m32.596-84.009c-46.377 0-55.917-21.2-55.917-39.221c0-1.59 1.325-3.18 3.18-3.18h13.78c1.59 0 2.916 1.06 2.916 2.65c2.12 14.045 8.215 20.936 36.306 20.936c22.261 0 31.802-5.035 31.802-16.96c0-6.891-2.65-11.926-37.367-15.372c-28.886-2.915-46.907-9.275-46.907-32.33c0-21.467 18.02-34.187 48.232-34.187c33.921 0 50.617 11.66 52.737 37.101q0 1.193-.795 2.385c-.53.53-1.325 1.06-2.12 1.06h-13.78c-1.326 0-2.65-1.06-2.916-2.385c-3.18-14.575-11.395-19.345-33.126-19.345c-24.38 0-27.296 8.48-27.296 14.84c0 7.686 3.445 10.07 36.306 14.31c32.597 4.24 47.967 10.336 47.967 33.127c-.265 23.321-19.345 36.571-53.002 36.571"/></svg>',awsec2:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGeyciVcvH" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#c8511b"/><stop offset="100%" stop-color="#f90"/></linearGradient></defs><path fill="url(#SVGeyciVcvH)" d="M0 0h256v256H0z"/><path fill="#fff" d="M86.4 169.6h80v-80h-80zm86.4-80h12.8V96h-12.8v12.8h12.8v6.4h-12.8v9.6h12.8v6.4h-12.8V144h12.8v6.4h-12.8v12.8h12.8v6.4h-12.8v.435a5.97 5.97 0 0 1-5.965 5.965h-.435v12.8H160V176h-12.8v12.8h-6.4V176h-9.6v12.8h-6.4V176H112v12.8h-6.4V176H92.8v12.8h-6.4V176h-.435A5.97 5.97 0 0 1 80 170.035v-.435h-9.6v-6.4H80v-12.8h-9.6V144H80v-12.8h-9.6v-6.4H80v-9.6h-9.6v-6.4H80V96h-9.6v-6.4H80v-.435a5.97 5.97 0 0 1 5.965-5.965h.435V70.4h6.4v12.8h12.8V70.4h6.4v12.8h12.8V70.4h6.4v12.8h9.6V70.4h6.4v12.8H160V70.4h6.4v12.8h.435a5.97 5.97 0 0 1 5.965 5.965zm-41.6 121.203a.4.4 0 0 1-.397.397H45.197a.4.4 0 0 1-.397-.397v-85.606a.4.4 0 0 1 .397-.397H64v-6.4H45.197a6.805 6.805 0 0 0-6.797 6.797v85.606a6.805 6.805 0 0 0 6.797 6.797h85.606a6.805 6.805 0 0 0 6.797-6.797V195.2h-6.4zm86.4-165.606v85.606a6.805 6.805 0 0 1-6.797 6.797H192v-6.4h18.803a.4.4 0 0 0 .397-.397V45.197a.4.4 0 0 0-.397-.397h-85.606a.4.4 0 0 0-.397.397V64h-6.4V45.197a6.805 6.805 0 0 1 6.797-6.797h85.606a6.805 6.805 0 0 1 6.797 6.797"/></svg>',awslambda:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGeyciVcvH" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#c8511b"/><stop offset="100%" stop-color="#f90"/></linearGradient></defs><path fill="url(#SVGeyciVcvH)" d="M0 0h256v256H0z"/><path fill="#fff" d="M89.624 211.2H49.89l43.945-91.853l19.912 40.992zm7.079-100.63a3.22 3.22 0 0 0-2.887-1.805h-.01a3.2 3.2 0 0 0-2.886 1.82L41.913 213.022a3.203 3.203 0 0 0 2.893 4.58l46.848-.001a3.21 3.21 0 0 0 2.9-1.83l25.65-54.08a3.18 3.18 0 0 0-.016-2.762zM207.985 211.2h-39.477L105.174 78.624a3.21 3.21 0 0 0-2.897-1.824h-25.83l.03-32h50.626l63.042 132.573a3.21 3.21 0 0 0 2.897 1.827h14.943zm3.208-38.4h-16.121L132.03 40.227a3.21 3.21 0 0 0-2.9-1.827H73.273a3.206 3.206 0 0 0-3.208 3.197l-.035 38.4c0 .851.333 1.664.94 2.265c.6.602 1.414.938 2.267.938h27.017l63.337 132.576a3.2 3.2 0 0 0 2.893 1.824h44.709a3.203 3.203 0 0 0 3.207-3.2V176c0-1.766-1.434-3.2-3.207-3.2"/></svg>',awss3:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVG7R6tZwZW" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1b660f"/><stop offset="100%" stop-color="#6cae3e"/></linearGradient></defs><path fill="url(#SVG7R6tZwZW)" d="M0 0h256v256H0z"/><path fill="#fff" d="m194.675 137.256l1.229-8.652c11.33 6.787 11.478 9.59 11.475 9.667c-.02.016-1.952 1.629-12.704-1.015m-6.218-1.728c-19.584-5.926-46.857-18.438-57.894-23.654c0-.045.013-.086.013-.131c0-4.24-3.45-7.69-7.693-7.69c-4.237 0-7.687 3.45-7.687 7.69s3.45 7.69 7.687 7.69c1.862 0 3.552-.695 4.886-1.8c12.986 6.148 40.048 18.478 59.776 24.302l-7.801 55.059q-.033.225-.032.451c0 4.848-21.463 13.754-56.532 13.754c-35.44 0-57.13-8.906-57.13-13.754q0-.22-.028-.435l-16.3-119.062c14.108 9.712 44.454 14.85 73.478 14.85c28.979 0 59.273-5.12 73.41-14.802zM48 65.528c.23-4.21 24.428-20.73 75.2-20.73c50.764 0 74.966 16.516 75.2 20.73v1.437c-2.784 9.443-34.144 19.434-75.2 19.434c-41.127 0-72.503-10.023-75.2-19.479zm156.8.07c0-11.087-31.79-27.2-81.6-27.2c-49.812 0-81.6 16.113-81.6 27.2l.3 2.414l17.754 129.676c.426 14.503 39.1 19.91 63.526 19.91c30.31 0 62.512-6.969 62.928-19.9l7.668-54.07c4.265 1.02 7.776 1.542 10.595 1.542c3.785 0 6.345-.925 7.897-2.774c1.274-1.517 1.76-3.354 1.396-5.31c-.83-4.428-6.087-9.202-16.794-15.311l7.603-53.639z"/></svg>',awsdynamodb:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGte2wIbLN" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#2e27ad"/><stop offset="100%" stop-color="#527fff"/></linearGradient></defs><path fill="url(#SVGte2wIbLN)" d="M0 0h256v256H0z"/><path fill="#fff" d="M166.675 175.52c-10.682 8.637-33.091 13.2-54.534 13.2c-21.447 0-43.863-4.566-54.541-13.202v17.392h.003c0 8.675 22.397 18.342 54.538 18.342c32.115 0 54.499-9.655 54.534-18.323zm.003-33.049l6.4-.035v.035c0 3.866-1.936 7.475-5.705 10.779c4.57 4.021 5.705 7.966 5.705 10.775c0 .02-.003.035-.003.054v28.831h.003c0 16.035-31.398 24.69-60.937 24.69c-29.469 0-60.781-8.617-60.931-24.578c0-.016-.01-.032-.01-.048v-28.958c0-.007.006-.016.006-.026c.01-2.809 1.15-6.738 5.712-10.75c-4.534-4.005-5.686-7.912-5.715-10.699h.003c0-.013-.006-.022-.006-.035v-28.958c0-.01.006-.02.006-.029c.01-2.809 1.152-6.738 5.716-10.743c-4.538-4.009-5.69-7.92-5.719-10.703h.003c0-.012-.006-.025-.006-.038V63.08c0-.01.006-.019.006-.029C51.261 47.04 82.624 38.4 112.141 38.4c16.675 0 32.694 2.65 43.948 7.271l-2.448 5.866c-10.505-4.314-25.632-6.79-41.5-6.79c-32.141 0-54.538 9.668-54.538 18.349c0 8.677 22.397 18.345 54.538 18.345c.867.01 1.715 0 2.573-.032l.268 6.342c-.947.038-1.894.038-2.841.038c-21.447 0-43.863-4.568-54.541-13.204V91.97h.003v.073c.032 3.329 3.447 6.236 6.307 8.083c8.608 5.488 24.032 9.236 41.232 10.014l-.29 6.341c-17.425-.79-32.682-4.405-42.503-9.946c-2.42 1.809-4.746 4.256-4.746 7.03c0 8.677 22.397 18.345 54.538 18.345c3.152 0 6.281-.105 9.305-.315l.445 6.332c-3.168.22-6.451.33-9.75.33c-21.447 0-43.863-4.567-54.541-13.203v17.383h.003c.032 3.403 3.447 6.307 6.307 8.157c9.844 6.281 28.327 10.192 48.23 10.192h1.409v6.347h-1.408c-20.221 0-38.599-3.754-49.837-10.099c-2.406 1.806-4.7 4.24-4.7 6.992c0 8.677 22.396 18.348 54.537 18.348c32.115 0 54.499-9.655 54.534-18.326v-.035c-.006-2.758-2.31-5.192-4.723-6.998a45 45 0 0 1-5.14 2.523l-2.45-5.865c2.323-.955 4.339-1.987 5.993-3.072c2.886-1.883 6.323-4.825 6.323-8.129m27.411-46.418h-17.932c-1.06 0-2.055-.52-2.647-1.39a3.14 3.14 0 0 1-.33-2.951l10.91-27.27h-41.31l-19.2 38.086h20.423c1.02 0 1.98.486 2.586 1.301c.598.82.774 1.87.464 2.838l-18.228 56.818zm9.821-.974l-79.996 82.648a3.22 3.22 0 0 1-2.31.974a3.2 3.2 0 0 1-1.636-.444a3.16 3.16 0 0 1-1.414-3.692l21.075-65.69h-21.226a3.21 3.21 0 0 1-2.723-1.504a3.15 3.15 0 0 1-.138-3.088l22.4-44.434a3.2 3.2 0 0 1 2.861-1.755h48a3.21 3.21 0 0 1 2.646 1.39a3.15 3.15 0 0 1 .33 2.955L180.87 89.706h20.73c1.28 0 2.441.761 2.944 1.93a3.16 3.16 0 0 1-.634 3.443M62.256 194.158c4.534 2.555 10.243 4.703 16.966 6.38l1.562-6.158c-6.077-1.514-11.389-3.5-15.366-5.742zm16.966-44.403l1.562-6.154c-6.077-1.517-11.389-3.504-15.366-5.745l-3.162 5.52c4.534 2.555 10.24 4.704 16.966 6.38M62.256 92.594l3.162-5.52c3.97 2.241 9.286 4.225 15.366 5.745l-1.562 6.154c-6.732-1.679-12.438-3.827-16.966-6.38"/></svg>',awselb:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGusebDeuy" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#4d27a8"/><stop offset="100%" stop-color="#a166ff"/></linearGradient></defs><path fill="url(#SVGusebDeuy)" d="M0 0h256v256H0z"/><path fill="#fff" d="M96 169.6c-22.938 0-41.6-18.662-41.6-41.6S73.062 86.4 96 86.4s41.6 18.662 41.6 41.6s-18.662 41.6-41.6 41.6m96 19.2c0 7.06-5.74 12.8-12.8 12.8s-12.8-5.74-12.8-12.8s5.74-12.8 12.8-12.8s12.8 5.74 12.8 12.8M179.2 54.4c7.06 0 12.8 5.74 12.8 12.8S186.26 80 179.2 80s-12.8-5.74-12.8-12.8s5.74-12.8 12.8-12.8m9.6 60.8c7.06 0 12.8 5.74 12.8 12.8s-5.74 12.8-12.8 12.8S176 135.06 176 128s5.74-12.8 12.8-12.8m-44.963 16h26.051c1.53 9.066 9.418 16 18.912 16c10.589 0 19.2-8.611 19.2-19.2s-8.611-19.2-19.2-19.2c-9.494 0-17.382 6.934-18.912 16h-26.051a47.5 47.5 0 0 0-4.407-17.107l28.397-25.06c3.187 2.356 7.114 3.767 11.373 3.767c10.589 0 19.2-8.611 19.2-19.2S189.789 48 179.2 48S160 56.611 160 67.2c0 4.02 1.245 7.747 3.363 10.835L136.26 101.95C127.693 88.762 112.867 80 96 80c-26.467 0-48 21.533-48 48s21.533 48 48 48c16.867 0 31.693-8.762 40.26-21.949l27.103 23.914A19.1 19.1 0 0 0 160 188.8c0 10.589 8.611 19.2 19.2 19.2s19.2-8.611 19.2-19.2s-8.611-19.2-19.2-19.2c-4.26 0-8.186 1.411-11.373 3.766l-28.397-25.059a47.5 47.5 0 0 0 4.407-17.107"/></svg>',awsvpc:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGusebDeuy" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#4d27a8"/><stop offset="100%" stop-color="#a166ff"/></linearGradient></defs><path fill="url(#SVGusebDeuy)" d="M0 0h256v256H0z"/><path fill="#fff" d="m195.2 132.39l-17.6-7.04v63.843c5.14-.512 9.283-2.202 12.227-5.19c5.44-5.53 5.376-13.636 5.373-13.716zm-24 56.844V125.35l-17.6 7.04v37.834c.022.662.749 17.142 17.6 19.011m30.4-19.011c.01.362.17 10.71-7.152 18.208c-4.787 4.906-11.536 7.392-20.048 7.392c-21.034 0-26.992-16.698-27.2-25.523v-40.077c0-1.309.797-2.486 2.013-2.973l24-9.6a3.2 3.2 0 0 1 2.374 0l24 9.6a3.2 3.2 0 0 1 2.013 2.973zm9.603-6.291l-.003-42.743l-36.8-14.72l-36.8 14.72v42.634c-.006.291-.432 19.93 11.309 32.013c6.182 6.361 14.758 9.587 25.491 9.587c10.806 0 19.424-3.248 25.613-9.651c11.725-12.135 11.197-31.645 11.19-31.84m-6.589 36.285c-7.44 7.702-17.606 11.606-30.214 11.606c-12.547 0-22.678-3.891-30.112-11.565c-13.629-14.057-13.117-35.625-13.088-36.534v-44.701c0-1.309.797-2.486 2.013-2.973l40-16a3.2 3.2 0 0 1 2.374 0l40 16a3.2 3.2 0 0 1 2.013 2.973v44.8c.029.8.605 22.33-12.986 36.394M73.776 151.023H121.6v6.4H73.776c-19.45 0-34.298-12.966-35.3-30.832c-.07-.73-.076-1.58-.076-2.432c0-21.98 15.37-30.074 24.333-32.922a50 50 0 0 1-.096-3.113c0-17.45 12.448-35.706 28.95-42.464c19.38-7.936 39.811-4.093 54.637 10.262c4.995 4.867 8.803 10.064 11.558 15.789c3.86-3.312 8.519-5.091 13.51-5.091c10.577 0 21.764 8.3 23.687 24.201c6.986 1.76 15.754 5.498 21.943 13.434l-5.044 3.936c-5.702-7.315-14.307-10.362-20.518-11.635a3.19 3.19 0 0 1-2.554-2.944c-.835-14.147-9.664-20.592-17.513-20.592c-4.679 0-8.826 2.208-11.997 6.384a3.16 3.16 0 0 1-3.024 1.232a3.2 3.2 0 0 1-2.528-2.064c-2.454-6.688-6.371-12.595-11.978-18.058c-12.94-12.525-30.803-15.869-47.753-8.931c-14.237 5.83-24.976 21.54-24.976 36.54c0 1.732.099 3.444.3 5.086a3.204 3.204 0 0 1-2.409 3.49c-8.262 2.046-22.128 8.337-22.128 27.46c0 .646-.006 1.296.058 1.946c.812 14.49 12.972 24.918 28.918 24.918"/></svg>',awsaurora:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVGte2wIbLN" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#2e27ad"/><stop offset="100%" stop-color="#527fff"/></linearGradient></defs><path fill="url(#SVGte2wIbLN)" d="M0 0h256v256H0z"/><path fill="#fff" d="M144.292 57.744h-9.626v-6.457h9.626V41.6h6.417v9.687h9.625v6.457h-9.625v9.687h-6.417zm38.502 35.518h-9.625v-6.458h9.625v-9.686h6.418v9.686h9.625v6.458h-9.625v9.687h-6.418zm-16.71 102.046c-6.128-15.57-20.272-29.803-35.75-35.973c15.478-6.167 29.622-20.4 35.75-35.973c6.129 15.573 20.272 29.806 35.747 35.973c-15.475 6.17-29.618 20.403-35.747 35.973m51.507-39.202c-22.569 0-48.298-25.893-48.298-48.605a3.22 3.22 0 0 0-3.209-3.228a3.22 3.22 0 0 0-3.208 3.228c0 22.712-25.733 48.605-48.302 48.605c-1.771 0-3.209 1.446-3.209 3.229a3.22 3.22 0 0 0 3.209 3.229c22.569 0 48.302 25.892 48.302 48.607a3.22 3.22 0 0 0 3.208 3.229a3.22 3.22 0 0 0 3.209-3.229c0-22.715 25.73-48.607 48.298-48.607a3.22 3.22 0 0 0 3.209-3.23a3.22 3.22 0 0 0-3.209-3.228M41.617 92.49c9.344 6.84 27.498 10.459 44.92 10.459s35.577-3.62 44.92-10.459v30.927c-4.623 6.186-21.626 12.282-44.278 12.282c-26.076 0-45.562-8.201-45.562-15.534zm44.92-25.059c27.831 0 44.92 8.463 44.92 14.53s-17.089 14.53-44.92 14.53s-44.92-8.463-44.92-14.53s17.089-14.53 44.92-14.53m44.92 121.183c0 7.443-19.216 15.77-44.936 15.77c-25.7 0-44.904-8.327-44.904-15.77v-20.632c9.459 7.22 27.976 11.042 45.745 11.042c12.356 0 24.305-1.756 33.632-4.946l-2.06-6.116c-8.682 2.968-19.896 4.605-31.572 4.605c-26.182 0-45.745-8.202-45.745-15.535v-25.898c9.433 7.206 27.87 11.023 45.562 11.023c18.956 0 35.214-3.93 44.278-10.152v9.69h6.417V81.961c0-13.632-26.448-20.988-51.337-20.988c-23.875 0-49.123 6.787-51.138 19.374H35.2v108.267c0 14.436 26.442 22.228 51.321 22.228c24.895 0 51.353-7.792 51.353-22.228v-11.401h-6.417z"/></svg>',awsglacier:'<svg width="256" height="256" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="SVG7R6tZwZW" x1="0%" x2="100%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1b660f"/><stop offset="100%" stop-color="#6cae3e"/></linearGradient></defs><path fill="url(#SVG7R6tZwZW)" d="M0 0h256v256H0z"/><path fill="#fff" d="M48.212 66.919C50.91 76.375 82.075 86.4 123.202 86.4c41.055 0 72.185-9.99 74.972-19.433l.205-1.44C198.145 61.312 173.966 44.8 123.2 44.8c-50.774 0-74.947 16.516-75.18 20.73zm147.69 61.686l-1.226 8.65c10.752 2.646 12.682 1.03 12.701 1.014c.003-.077-.144-2.883-11.475-9.664m-49.731 81.18l.806 6.35c-7.67.973-15.677 1.465-23.795 1.465c-24.426 0-63.1-5.41-63.53-19.913L41.9 68.01q-.215-.936-.263-1.907l-.01-.067h.004c-.006-.148-.029-.288-.029-.436c0-11.09 31.786-27.2 81.6-27.2c49.811 0 81.6 16.11 81.6 27.2c0 .15-.029.298-.035.448h.003l-.006.032a10.7 10.7 0 0 1-.291 2.055l-7.604 53.638c10.71 6.112 15.965 10.887 16.794 15.315c.365 1.956-.118 3.79-1.392 5.31c-1.555 1.849-4.115 2.77-7.898 2.77c-2.819 0-6.332-.521-10.601-1.542l-.41 2.893l-6.336-.896l.522-3.687c-19.728-5.827-46.79-18.156-59.78-24.304c-1.334 1.108-3.02 1.799-4.883 1.799c-4.236 0-7.686-3.45-7.686-7.69s3.45-7.69 7.686-7.69c4.24 0 7.69 3.45 7.69 7.69c0 .045-.013.09-.013.135c11.04 5.212 38.314 17.728 57.895 23.65l8.156-57.532c-14.14 9.683-44.435 14.806-73.41 14.806c-29.028 0-59.37-5.139-73.48-14.85L66.02 197.007q.03.218.03.436c0 4.85 21.692 13.756 57.132 13.756c7.85 0 15.587-.476 22.989-1.414m58.521-24.604l7.588 7.584l-4.528 4.525l-8.49-8.49h-15.21l7.23 12.535l12.198 3.433l-1.735 6.157l-10.157-2.857l-2.774 10.361l-6.182-1.657l3.222-12.036l-7.533-13.065l-7.433 12.854l3.126 12.285l-6.198 1.578l-2.605-10.224l-10.359 2.774l-1.654-6.182l12.029-3.223l7.366-12.733h-15.005l-8.732 8.519l-4.468-4.583l7.556-7.37l-7.584-7.583l4.524-4.525l9.14 9.142h14.947l-7.629-13.193l-12.182-3.427l1.73-6.16l10.16 2.857l2.775-10.358l6.183 1.657l-3.23 12.055l7.543 13.043L185.745 166l-3.123-12.265l6.198-1.578l2.608 10.227l10.356-2.774l1.657 6.18l-12.05 3.228l-7.713 13.382h14.7l9.402-9.17l4.47 4.582z"/></svg>',k8spod:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><path fill="#fff" fill-rule="evenodd" d="m5.397 6.213l3.62-1.05l3.621 1.05l-3.62 1.05Zm0 .402v3.853l3.373 1.869l.017-4.713zm7.241 0v3.853l-3.373 1.869l-.017-4.713z"/></svg>',k8sdeploy:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g fill="#fff" fill-rule="evenodd" stroke-linecap="square" stroke-miterlimit="10" stroke-width=".265"><path d="M8.578 13.192a4.446 4.446 0 1 1 4.227-4.728l-1.757.113a2.685 2.685 0 1 0-2.553 2.856z"/><path d="m9.489 8.469l1.397 3.42l3.226-3.42z"/></g></svg>',k8ssvc:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g fill-rule="evenodd" stroke-miterlimit="10"><path fill="#fff" d="M3.594 10.756h2.908v2.041H3.594zm3.969 0h2.908v2.041H7.563zm3.968 0h2.909v2.041h-2.91zM6.713 4.703h4.608v2.042H6.713z"/><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".529" d="M9.017 6.745V8.75H5.05v2.003m3.967-4.008V8.75h3.967v2.003"/><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".529" d="M9.009 6.746v2.006h.016v2.003"/></g></svg>',k8sing:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><path fill="#fff" d="M11.765 12.823h-2.27L4.572 6.667H3.15V4.652h2.314l4.923 6.156h1.378V9.215l3.12 2.6l-3.12 2.602zM9.289 8.068l1.098-1.376h1.378v1.594l3.12-2.6l-3.12-2.602v1.594h-2.27L8.036 6.502zM5.69 9.433l-1.118 1.4H3.15v2.015h2.314L6.943 11z"/></svg>',k8scm:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-miterlimit="10" stroke-width=".794" d="M7.362 5.575h5.825m-8.339 0h1.458m3.173 2.117h3.708m-6.222 0h1.458m1.056 2.117h3.708m-6.222 0h1.458m-1.061 2.116h5.825m-8.339 0h1.458"/></svg>',k8ssecret:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g stroke-miterlimit="10" transform="translate(-.936 -.399)"><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".794" d="M10.414 8.091h3.709M8.298 5.975h5.825m-8.339 0h1.458"/><path fill="#fff" fill-rule="evenodd" stroke="#326ce5" stroke-linecap="square" stroke-width=".265" d="M7.718 8.432h0c0-1.167 1.011-2.112 2.259-2.112s2.258.945 2.258 2.112h-1.056h0c0-.583-.538-1.056-1.202-1.056s-1.202.473-1.202 1.056z"/><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".794" d="M10.414 10.208h3.709m-5.825 2.117h5.825m-8.339 0h1.458"/><path fill="#fff" fill-rule="evenodd" stroke="#326ce5" stroke-linecap="square" stroke-width=".265" d="M7.162 8.37h5.617v3.657H7.162z"/><circle cx="9.971" cy="10.198" r=".555" fill="#326ce5"/></g></svg>',k8sns:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.957.463a1.136 1.126 0 0 0-.434.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118a1.199 1.19 0 0 0-.582-.117m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424L.722 11.504a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><path fill="none" stroke="#fff" stroke-dasharray=".8 .4" stroke-dashoffset="3.44" stroke-linejoin="round" stroke-miterlimit="10" stroke-width=".4" d="M5.18 5.405h7.674v6.69H5.18z"/></svg>',k8spv:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.958.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.503 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.509.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.955.001a1.199 1.19 0 0 0-.46.117l-6.27 2.996a1.199 1.19 0 0 0-.649.806L.03 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006l-1.549-6.73a1.199 1.19 0 0 0-.649-.806L9.537.118A1.199 1.19 0 0 0 8.955 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.523.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g fill-rule="evenodd" stroke-miterlimit="10" stroke-width=".265"><path fill="#fff" d="M4.388 7.23c0 .62 2.073 1.124 4.63 1.124s4.628-.503 4.628-1.124v3.042c0 .621-2.072 1.125-4.629 1.125s-4.629-.504-4.629-1.125z"/><path fill="#fff" d="M4.388 7.23c0-.622 2.073-1.125 4.63-1.125s4.628.503 4.628 1.125c0 .62-2.072 1.124-4.629 1.124S4.388 7.851 4.388 7.23"/><path fill="none" stroke="#326ce5" stroke-linejoin="round" d="M13.646 7.23c0 .62-2.072 1.124-4.629 1.124S4.388 7.851 4.388 7.23s2.073-1.125 4.63-1.125s4.628.503 4.628 1.125v3.042c0 .621-2.072 1.125-4.629 1.125s-4.629-.504-4.629-1.125V7.23"/></g></svg>',k8ssts:'<svg width="18.035" height="17.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.035 17.5"><g stroke-width="0"><path fill="#326ce5" d="M8.993.463a1.136 1.126 0 0 0-.435.11l-5.94 2.838a1.136 1.126 0 0 0-.615.764L.538 10.55a1.136 1.126 0 0 0 .154.864a1.136 1.126 0 0 0 .065.09l4.111 5.111a1.136 1.126 0 0 0 .888.424l6.593-.002a1.136 1.126 0 0 0 .888-.423l4.11-5.112a1.136 1.126 0 0 0 .219-.953l-1.468-6.375a1.136 1.126 0 0 0-.614-.764L9.544.573a1.136 1.126 0 0 0-.551-.11"/><path fill="#fff" d="M8.99.001a1.199 1.19 0 0 0-.46.117L2.26 3.114a1.199 1.19 0 0 0-.649.806L.065 10.65a1.199 1.19 0 0 0 .162.912a1.199 1.19 0 0 0 .069.094l4.34 5.397a1.199 1.19 0 0 0 .937.447l6.96-.001a1.199 1.19 0 0 0 .937-.447l4.338-5.397a1.199 1.19 0 0 0 .232-1.006L16.49 3.92a1.199 1.19 0 0 0-.649-.806L9.572.118A1.199 1.19 0 0 0 8.99 0m.003.462a1.136 1.126 0 0 1 .55.11l5.94 2.837a1.136 1.126 0 0 1 .615.764l1.468 6.375a1.136 1.126 0 0 1-.22.953l-4.11 5.113a1.136 1.126 0 0 1-.887.423l-6.593.001a1.136 1.126 0 0 1-.888-.424l-4.111-5.11a1.136 1.126 0 0 1-.065-.09a1.136 1.126 0 0 1-.154-.864l1.465-6.374a1.136 1.126 0 0 1 .615-.765L8.558.573a1.136 1.126 0 0 1 .435-.11" color="#000"/></g><g fill-rule="evenodd" stroke-miterlimit="10"><path fill="none" stroke="#fff" stroke-dasharray="1.587 1.587" stroke-dashoffset="3.667" stroke-linecap="square" stroke-linejoin="round" stroke-width=".529" d="M7.329 5.047h6.525V9.63H7.329z"/><path fill="#326ce5" stroke="#fff" stroke-dasharray="1.587 1.587" stroke-dashoffset="3.879" stroke-linecap="square" stroke-linejoin="round" stroke-width=".529" d="M5.79 6.458h6.525v4.584H5.79z"/><path fill="#fff" d="M4.252 7.87h6.525v4.583H4.252z"/><path fill="none" stroke="#fff" stroke-linejoin="round" stroke-width=".529" d="M4.252 7.87h6.525v4.583H4.252z"/><path fill="#fff" d="M4.785 9.144c0-.43 1.222-.777 2.729-.777s2.73.348 2.73.777s-1.223.778-2.73.778s-2.73-.349-2.73-.778"/><path fill="none" d="M10.243 9.144c0 .43-1.222.778-2.73.778c-1.506 0-2.728-.349-2.728-.778s1.222-.777 2.729-.777s2.73.348 2.73.777v2.103c0 .43-1.223.778-2.73.778s-2.73-.348-2.73-.778V9.144"/><path fill="none" stroke="#326ce5" stroke-linejoin="round" stroke-width=".529" d="M10.243 9.144c0 .43-1.222.778-2.73.778c-1.506 0-2.728-.349-2.728-.778s1.222-.777 2.729-.777s2.73.348 2.73.777v2.103c0 .43-1.223.778-2.73.778s-2.73-.348-2.73-.778V9.144"/></g></svg>',gcpcomputeengine:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#aecbfa" d="M9 9h6v6H9z"/><path fill="#669df6" d="M11 2h2v4h-2zM7 2h2v4H7zm8 0h2v4h-2z"/><path fill="#4285f4" d="M11 18h2v4h-2zm-4 0h2v4H7zm8 0h2v4h-2zm3-5v-2h4v2zm0 4v-2h4v2zm0-8V7h4v2z"/><path fill="#669df6" d="M2 13v-2h4v2zm0 4v-2h4v2zm0-8V7h4v2z"/><path fill="#aecbfa" d="M5 5v14h14V5Zm12 12H7V7h10Z"/><path fill="#669df6" d="M9 15h6l-3-3z"/><path fill="#4285f4" d="m12 12l3 3V9z"/></svg>',gcpcloudstorage:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#aecbfa" d="M2 4h20v7H2z"/><path fill="#669df6" d="M20 4h2v7h-2z"/><path fill="#4285f4" d="M22 4h-2v7z"/><path fill="#669df6" d="M2 4h2v7H2z"/><path fill="#fff" d="M6 7h6v1H6z"/><rect width="3" height="3" x="15" y="6" fill="#fff" rx="1.5"/><path fill="#aecbfa" d="M2 13h20v7H2z"/><path fill="#669df6" d="M20 13h2v7h-2z"/><path fill="#4285f4" d="M22 13h-2v7z"/><path fill="#669df6" d="M2 13h2v7H2z"/><path fill="#fff" d="M6 16h6v1H6z"/><rect width="3" height="3" x="15" y="15" fill="#fff" rx="1.5"/></svg>',gcpcloudfunctions:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#669df6" d="M2 15.56L5 18V6L2 8.43z"/><path fill="#4285f4" d="m2 10l3-2V6zm3 8v-2l-3-2z"/><path fill="#aecbfa" d="m8 20l-6-6v4l4 4zM5.99 2.01L2 6l.01 4l5.98-5.99z"/><path fill="#669df6" d="m22 8.45l-3-2.44v12l3-2.42z"/><path fill="#4285f4" d="m22 14.01l-3 2v2zm-3-8v2l3 2z"/><path fill="#aecbfa" d="m16 4.01l6 6v-4l-4-4zM18.01 22L22 18.01l-.01-4L16.01 20z"/><circle cx="8" cy="12" r="1" fill="#aecbfa"/><circle cx="12" cy="12" r="1" fill="#aecbfa"/><circle cx="15.99" cy="12" r="1" fill="#aecbfa"/></svg>',gcpbigquery:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill-rule="evenodd"><path fill="#aecbfa" d="M6.73 10.83v2.63a4.9 4.9 0 0 0 1.71 1.74v-4.37Z"/><path fill="#669df6" d="M9.89 8.41v7.53A8 8 0 0 0 11 16a8 8 0 0 0 1 0V8.41Z"/><path fill="#aecbfa" d="M13.64 11.86v3.29a5 5 0 0 0 1.7-1.82v-1.47Z"/><path fill="#4285f4" d="m17.74 16.32l-1.42 1.42a.42.42 0 0 0 0 .6l3.54 3.54a.42.42 0 0 0 .59 0l1.43-1.43a.42.42 0 0 0 0-.59l-3.54-3.54a.42.42 0 0 0-.6 0"/><path fill="#669df6" d="M11 2a9 9 0 1 0 9 9a9 9 0 0 0-9-9m0 15.69A6.68 6.68 0 1 1 17.69 11A6.68 6.68 0 0 1 11 17.69"/></g></svg>',gcpcloudsql:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill-rule="evenodd"><path fill="#aecbfa" d="M4.67 10.44v3.01l7.33 3.9v-3.01zm0 4.65v3.01L12 22v-3.01z"/><path fill="#669df6" d="m12 17.35l7.33-3.9v-3.01L12 14.34zM12 22l7.33-3.9v-3.01L12 18.99z"/><path fill="#4285f4" d="M19.33 8.91V5.9L12 2v3.01z"/><path fill="#669df6" d="M12 2L4.67 5.9v3.01L12 5.01z"/><path fill="#aecbfa" d="M4.67 5.87v3.02l7.33 3.9V9.77z"/><path fill="#669df6" d="m12 12.79l7.33-3.9V5.87L12 9.77z"/></g></svg>',gcpcloudrun:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill-rule="evenodd"><path fill="#aecbfa" d="M8.9 2.63L12.02 12h9.36z"/><path fill="#4285f4" d="M21.38 12h-9.36L8.9 21.38zM3.44 21.38l3.13-1.57L8.9 12H5.78z"/><path fill="#aecbfa" d="M3.44 2.63L5.78 12H8.9L6.57 4.19z"/></g></svg>',gcpappengine:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill-rule="evenodd"><path fill="#4285f4" d="m14.3 10l-1.22 1.22A1.71 1.71 0 0 1 12 14.23a1.74 1.74 0 0 1-1.33-.64l-1.22 1.22A3.43 3.43 0 1 0 14.3 10"/><path fill="#aecbfa" d="M12 6.26a6.25 6.25 0 1 0 6.25 6.25A6.25 6.25 0 0 0 12 6.26M12 17a4.45 4.45 0 1 1 4.44-4.44A4.44 4.44 0 0 1 12 17"/><path fill="#669df6" d="m21.62 11.9l-2.56-.81a7 7 0 0 1 .17 1.53a8 8 0 0 1-.08 1.08h2.47a.44.44 0 0 0 .38-.42v-1a.44.44 0 0 0-.38-.42M12 5.52a7.5 7.5 0 0 1 1.5.15l-.92-2.55c-.07-.22-.21-.38-.42-.38h-.38a.45.45 0 0 0-.42.38l-.8 2.54A7.6 7.6 0 0 1 12 5.52m-7.23 7.1a7 7 0 0 1 .17-1.53l-2.56.81a.44.44 0 0 0-.38.42v1a.44.44 0 0 0 .38.42h2.47a8 8 0 0 1-.08-1.08"/><path fill="#aecbfa" d="M12 10a2.5 2.5 0 1 0 2.5 2.5A2.5 2.5 0 0 0 12 10m0 3.75a1.25 1.25 0 1 1 1.25-1.25A1.25 1.25 0 0 1 12 13.76Z"/></g></svg>',gcpcloudloadbalancing:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path fill="#669df6" d="M18 12h2v4h-2zm-7 0h2v4h-2zm-7 0h2v4H4z"/><path fill="#4285f4" d="M13 11h-2V7h2z"/><path fill="#669df6" d="M4 11h16v2H4z"/><path fill="#aecbfa" d="M6 2h12v5H6z"/><path fill="#669df6" d="M12 2h6v5h-6z"/><path fill="#aecbfa" d="M16 16h6v6h-6zM2 16h6v6H2z"/><path fill="#669df6" d="M5 16h3v6H5z"/><path fill="#aecbfa" d="M9 16h6v6H9z"/><path fill="#669df6" d="M12 16h3v6h-3zm7 0h3v6h-3z"/></svg>'};var ki=(function(){var L={compute:["#C8511B","#FF9900"],storage:["#1B660F","#6CAE3E"],database:["#2E27AD","#527FFF"],net:["#4D27A8","#A166FF"],integ:["#B0084D","#FF4F8B"],mgmt:["#B0084D","#FF4F8B"],sec:["#BD0816","#FF5252"],analytics:["#4D27A8","#A166FF"],ml:["#055F4E","#56C0A7"]},j={ec2:["ec2",L.compute],lambda:["lambda",L.compute],ecs:["ecs",L.compute],eks:["eks",L.compute],fargate:["fargate",L.compute],s3:["s3",L.storage],glacier:["glacier",L.storage],rds:["rds",L.database],dynamodb:["dynamodb",L.database],aurora:["aurora",L.database],redshift:["redshift",L.analytics],vpc:["virtual_private_cloud",L.net],cloudfront:["cloudfront",L.net],elb:["elastic_load_balancing",L.net],route53:["route_53",L.net],apigateway:["api_gateway",L.integ],sqs:["sqs",L.integ],sns:["sns",L.integ],eventbridge:["eventbridge",L.integ],stepfunctions:["step_functions",L.integ],cloudwatch:["cloudwatch",L.mgmt],iam:["identity_and_access_management",L.sec],secretsmanager:["secrets_manager",L.sec],kinesis:["kinesis",L.analytics],athena:["athena",L.analytics],glue:["glue",L.analytics],sagemaker:["sagemaker",L.ml]},P={computeengine:"compute_engine",compute:"compute_engine",cloudstorage:"cloud_storage",storage:"cloud_storage",cloudfunctions:"cloud_functions",functions:"cloud_functions",bigquery:"bigquery",cloudsql:"cloud_sql",sql:"cloud_sql",cloudrun:"cloud_run",run:"cloud_run",appengine:"app_engine",cloudloadbalancing:"cloud_load_balancing"},E={pod:"pod",deployment:"deploy",deploy:"deploy",service:"svc",svc:"svc",ingress:"ing",ing:"ing",configmap:"cm",cm:"cm",secret:"secret",namespace:"ns",ns:"ns",node:"node",persistentvolume:"pv",pv:"pv",statefulset:"sts",sts:"sts"},w={virtualmachine:"virtual_machine",vm:"virtual_machine",sqldatabase:"sql_database",virtualnetwork:"virtual_network",vnet:"virtual_network"},p={github:"github",mongodb:"mongodb"};function s(f){var u=f.indexOf(":");return u>=0?{pack:f.substring(0,u),icon:f.substring(u+1)}:{pack:"",icon:f}}function o(f){return f.replace(/[-_\s]/g,"")}function d(f){if(!f)return null;var u=s(String(f).toLowerCase().trim()),r=u.pack,h=u.icon;if(r==="aws"||r==="aws-icons"||/^(aws|amazon)[-_]/.test(h)){var v=o(h.replace(/^(aws|amazon)[-_]/,""));if(In["aws"+v])return{kind:"svg",svg:In["aws"+v]};var n=j[v];if(n)return{kind:"stencil",style:"shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4."+n[0]+";fillColor="+n[1][0]+";gradientColor="+n[1][1]+";gradientDirection=north;strokeColor=#FFFFFF;"}}if(r==="gcp"||r==="gcp-icons"||/^(google-cloud|gcp)[-_]/.test(h)){var y=o(h.replace(/^(google-cloud|gcp)[-_]/,"")),b=P[y];if(b&&In["gcp"+o(b)])return{kind:"svg",svg:In["gcp"+o(b)]};if(b)return{kind:"stencil",style:"shape=mxgraph.gcp2."+b+";fillColor=#4285F4;strokeColor=none;"}}if(r==="kubernetes"||r==="k8s"||/^(kubernetes|k8s)[-_]/.test(h)){var T=o(h.replace(/^(kubernetes|k8s)[-_]/,"")),I=E[T];if(I&&In["k8s"+I])return{kind:"svg",svg:In["k8s"+I]};if(I)return{kind:"stencil",style:"shape=mxgraph.kubernetes."+I+";fillColor=#326CE5;strokeColor=none;"}}if(r==="azure"||/^(microsoft-azure|azure)[-_]/.test(h)){var F=o(h.replace(/^(microsoft-azure|azure)[-_]/,"")),X=w[F];if(X)return{kind:"stencil",style:"shape=mxgraph.azure."+X+";fillColor=#0078D4;strokeColor=none;"}}var K=o(h);if(p[K])return{kind:"stencil",style:"shape=mxgraph.weblogos."+p[K]+";"};if(In[K])return{kind:"svg",svg:In[K]};var ot=o(h.replace(/-icon$/,""));return In[ot]?{kind:"svg",svg:In[ot]}:null}function M(f){return d(f)!=null}return{resolve:d,isSupported:M}})();var Oa=(function(){var L={default:{node:{fill:"light-dark(#ECECFF,#1f2020)",stroke:"light-dark(#9370DB,#cccccc)",font:"light-dark(#333333,#cccccc)"},subgraph:{fill:"light-dark(#ffffde,#1f2020)",stroke:"light-dark(#aaaa33,#cccccc)",fillOpacity:50,strokeOpacity:20},state:{dark:"light-dark(#333333,#cccccc)",inner:"light-dark(#ffffff,#1f2020)"},edge:"light-dark(#333333,#cccccc)"},neutral:{node:{fill:"#eeeeee",stroke:"#999999",font:"#333333"},subgraph:{fill:"#ffffff",stroke:"#bbbbbb"},state:{dark:"#333333",inner:"#ffffff"},edge:"#333333"},dark:{node:{fill:"#1f2020",stroke:"#81B1DB",font:"#cccccc"},subgraph:{fill:"#3f3f3f",stroke:"#cccccc"},state:{dark:"#cccccc",inner:"#1f2020"},edge:"#cccccc"},forest:{node:{fill:"#cde498",stroke:"#13540c",font:"#333333"},subgraph:{fill:"#cdffb2",stroke:"#6eaa49"},state:{dark:"#333333",inner:"#ffffff"},edge:"#13540c",seq:{actorStroke:"#a6cf47",signal:"#333333",labelBoxFill:"#cde498",labelBoxStroke:"#326932"}}},j={fillColor:L.default.node.fill,strokeColor:L.default.node.stroke,fontColor:L.default.node.font,fontFamily:"Trebuchet MS,Verdana,Arial,sans-serif",fontSize:16},P={fillColor:L.default.subgraph.fill,strokeColor:L.default.subgraph.stroke,fillOpacity:L.default.subgraph.fillOpacity,strokeOpacity:L.default.subgraph.strokeOpacity},E={fillColor:L.default.node.fill,strokeColor:L.default.node.stroke,darkColor:L.default.state.dark,innerFillColor:L.default.state.inner},w=L.default.edge,p={actorFill:null,actorStroke:null,actorFont:null,lifelineColor:"light-dark(#9370DB,#cccccc)",activationFill:"light-dark(#f4f4f4,#2a2a2a)",activationStroke:"light-dark(#666666,#cccccc)",noteFill:"light-dark(#fff5ad,#2a2a2a)",noteStroke:"light-dark(#aaaa33,#cccccc)",noteFont:null,signalColor:null,signalTextColor:null,labelBoxFill:"light-dark(#ECECFF,#1f2020)",labelBoxStroke:"light-dark(#9370DB,#cccccc)",loopFont:null};function s(e){var x=e&&e.theme||"default",C=L[x]||L.default,S=e&&e.themeVariables||{},Y=S.primaryColor||C.node.fill,D=S.primaryBorderColor||C.node.stroke,At=S.primaryTextColor||C.node.font,U=S.clusterBkg||S.secondaryColor||C.subgraph.fill,q=S.clusterBorder||S.secondaryBorderColor||C.subgraph.stroke,rt=S.lineColor||C.edge;j.fillColor=Y,j.strokeColor=D,j.fontColor=At,P.fillColor=U,P.strokeColor=q;var ct=S.clusterBkg||S.secondaryColor,nt=S.clusterBorder||S.secondaryBorderColor;P.fillOpacity=ct!=null?null:C.subgraph.fillOpacity,P.strokeOpacity=nt!=null?null:C.subgraph.strokeOpacity,E.fillColor=Y,E.strokeColor=D,E.darkColor=C.state.dark,E.innerFillColor=C.state.inner,wr[x]?qr=wr[x]:qr=wr.default,w=rt;var zt=C.seq||{},Ot=S.actorBkg||S.mainBkg||null,Ft=S.actorBorder||null,Pt=Ot||zt.actorFill||null,Wt=Ft||zt.actorStroke||null,Kt=S.actorTextColor||null,Bt=S.textColor||null;p.actorFill=Pt,p.actorStroke=Wt,p.actorFont=Kt,p.lifelineColor=S.actorLineColor||Wt||"light-dark(#9370DB,#cccccc)",p.activationFill=S.activationBkgColor||"light-dark(#f4f4f4,#2a2a2a)",p.activationStroke=S.activationBorderColor||"light-dark(#666666,#cccccc)",p.noteFill=S.noteBkgColor||"light-dark(#fff5ad,#2a2a2a)",p.noteStroke=S.noteBorderColor||"light-dark(#aaaa33,#cccccc)",p.noteFont=S.noteTextColor||null,p.signalColor=S.signalColor||Bt||zt.signal||null,p.signalTextColor=S.signalTextColor||Bt||zt.signal||null,p.labelBoxFill=S.labelBoxBkgColor||Ot||zt.labelBoxFill||"light-dark(#ECECFF,#1f2020)",p.labelBoxStroke=S.labelBoxBorderColor||Ft||zt.labelBoxStroke||"light-dark(#9370DB,#cccccc)",p.loopFont=S.loopTextColor||Kt||null}function o(){return(p.actorFill?"fillColor="+p.actorFill+";":"")+(p.actorStroke?"strokeColor="+p.actorStroke+";":"")+(p.actorFont?"fontColor="+p.actorFont+";":"")}function d(){var e=new Graph;return e.setExtendParents(!1),e.setExtendParentsOnAdd(!1),e.setConstrainChildren(!1),e.setHtmlLabels(!0),e.getModel().maintainEdgeParent=!1,e}function M(e){if(e==null)return e;var x=String(e).replace(/\s+/g,"").toLowerCase();return/^(javascript|vbscript|data):/.test(x)?"":e}function f(e){if(e==null)return"";var x=String(e).replace(/[;\r\n]+/g,""),C=x.replace(/\s+/g,"").toLowerCase();return/^(javascript|vbscript):/.test(C)?"":x}function u(e,x,C){if(e==null)return"";if(Array.isArray(e)){for(var S=[],Y=0;Y<e.length;Y++)S.push(u(e[Y],null,C));return S.join(`
`)}if(typeof e=="object"&&(e=(e.visibility||"")+e.id+(e.parameters!=null?"("+e.parameters+")":"")+(e.returnType?" : "+e.returnType:"")),e=(e?e.replace(/\\n/g,`
`).replace(/<br\s*\/?>/gi,`
`):"")+(x?"<"+x+">":""),e&&e.indexOf("#")>=0){var D={infin:"\u221E",nbsp:"\xA0",lt:"<",gt:">",amp:"&",quot:'"',apos:"'",copy:"\xA9",reg:"\xAE",trade:"\u2122",hearts:"\u2665",spades:"\u2660",diams:"\u2666",clubs:"\u2663",rarr:"\u2192",larr:"\u2190",uarr:"\u2191",darr:"\u2193",harr:"\u2194",times:"\xD7",divide:"\xF7",plusmn:"\xB1",deg:"\xB0",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",bull:"\u2022",middot:"\xB7"};e=e.replace(/#(\d+);/g,function(q,rt){var ct=parseInt(rt,10);return ct>=0&&ct<=1114111?String.fromCodePoint(ct):q}).replace(/#([a-zA-Z][a-zA-Z0-9]+);/g,function(q,rt){return D.hasOwnProperty(rt)?D[rt]:q})}var At;e&&(At=e.match(/~/g))&&At.length>1&&(e=e.replace(/~([^~]+)~/g,"<$1>"));var U=!!(C&&C.markdown);return e.length>=2&&e[0]==="`"&&e[e.length-1]==="`"&&(e=e.substring(1,e.length-1),U=!0),U?(e=e.replace(/\*\*(.+?)\*\*/g,"<b>$1</b>"),e=e.replace(/__(.+?)__/g,"<b>$1</b>"),e=e.replace(/\*(.+?)\*/g,"<i>$1</i>"),e=e.replace(/(^|[^\w])_([^_\n]+?)_(?=[^\w]|$)/g,"$1<i>$2</i>"),e=e.replace(/`(.+?)`/g,"<code>$1</code>")):(e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/\*(.+?)\*/g,"$1"),e=e.replace(/(^|[^\w])_([^_\n]+?)_(?=[^\w]|$)/g,"$1$2"),e=e.replace(/`(.+?)`/g,"$1")),e=e.replace(/[ \t]*(?:fa[bslr]?:[\w-]+|mdi:[\w-]+|bi:[\w-]+)[ \t]*/g," ").replace(/[ \t]+/g," ").replace(/[ \t]*\n[ \t]*/g,`
-`).replace(/^\n+|\n+$/g,"").trim(),e}function r(e,x,C,S,Y,D,At,U,q,rt){return e.insertVertex(x,C,S,Math.round(Y),Math.round(D),Math.round(At),Math.round(U),q,rt)}function h(e,x,C){if(!(x==null||C==null||C==="")){var S;x.value!=null&&typeof x.value=="object"&&x.value.getAttribute?S=x.value.getAttribute("label")||"":S=x.value!=null?String(x.value):"",e.setAttributeForCell(x,"mermaidId",String(C)),e.setAttributeForCell(x,"mermaidBaseStyle",x.style||""),e.setAttributeForCell(x,"mermaidBaseValue",S)}}function d(e,x){for(var C=0,S=0,Y=e?e.parent:null;Y&&Y.geometry;)C+=Y.geometry.x||0,S+=Y.geometry.y||0,Y=Y.parent;return{x:C,y:S,width:x?x.width:0,height:x?x.height:0}}function n(e,x,C,S){e.indexOf("html=1")<0&&e.indexOf("html=0")<0&&(e="html=1;"+e);var Y=u(x.labelText);return x.mindmap&&Y&&(Y='<div style="line-height:1.5;">'+Y+"</div>"),r(S,C,null,Y,x.x,x.y,x.width,x.height,e)}function y(e){var x=e.toLowerCase().replace(/\s/g,"");return x==="#000"||x==="#000000"||x==="black"||x==="rgb(0,0,0)"}function b(e){var x=e.toLowerCase().replace(/\s/g,"");return x==="#fff"||x==="#ffffff"||x==="white"||x==="rgb(255,255,255)"}function T(e){var x=e.toLowerCase().replace(/\s/g,"");return x==="transparent"||x==="rgba(0,0,0,0)"||x==="#00000000"||x==="none"}function I(e,x){if(!e)return"";var C=!!(x&&x.joinDashArray),S=Array.isArray(e)?e.join(";"):e;S=S.replace(/,\s*(?=[a-z])/gi,";");for(var Y=[],D=0,At=S.split(";"),U=0;U<At.length;U++){var q=At[U].split(":");if(!(q.length<2)){var rt=q[0].trim(),ct=q.slice(1).join(":").trim();if(!(!rt||!ct))switch(rt){case"fill":case"background-color":case"background":Y.push("fillColor="+(T(ct)?"none":b(ct)?"default":ct));break;case"stroke":Y.push("strokeColor="+(T(ct)?"none":y(ct)?"default":ct));break;case"stroke-width":Y.push("strokeWidth="+parseFloat(ct));break;case"color":Y.push("fontColor="+(y(ct)?"default":ct));break;case"stroke-dasharray":Y.push("dashed=1");var nt=ct.trim();if(C&&nt.indexOf(",")<0&&/^\d+(\s+\d+)+$/.test(nt)){var zt=nt.replace(/\s+/g,"");Y.push("dashPattern="+zt+" "+zt),Y.push("fixDash=1")}else{var Ot=nt.split(/[\s,]+/);Ot.length>=2&&(Y.push("dashPattern="+Ot.join(" ")),Y.push("fixDash=1"))}break;case"font-weight":var Ft=parseInt(ct,10);(ct==="bold"||ct==="bolder"||!isNaN(Ft)&&Ft>=600)&&(D|=1);break;case"font-style":(ct==="italic"||ct==="oblique")&&(D|=2);break}}}return D!==0&&Y.push("fontStyle="+D),Y.length>0?Y.join(";")+";":""}function F(e){for(var x=e.split(";"),C=null,S={},Y=[],D=0;D<x.length;D++){var At=x[D].trim();if(At){var U=At.indexOf("=");if(U>0){var q=At.substring(0,U);S.hasOwnProperty(q)||Y.push(q),S[q]=At.substring(U+1)}else C=At}}for(var rt=C!=null?[C]:[],D=0;D<Y.length;D++)rt.push(Y[D]+"="+S[Y[D]]);return rt.join(";")+";"}function X(e){for(var x=e.getModel(),C=e.getDefaultParent(),S=x.getChildCount(C),Y=1/0,D=1/0,At=0;At<S;At++){var U=x.getChildAt(C,At),q=x.getGeometry(U);if(q!=null){if(x.isVertex(U)&&(q.x<Y&&(Y=q.x),q.y<D&&(D=q.y)),q.points)for(var rt=0;rt<q.points.length;rt++){var ct=q.points[rt];ct.x<Y&&(Y=ct.x),ct.y<D&&(D=ct.y)}q.sourcePoint&&(q.sourcePoint.x<Y&&(Y=q.sourcePoint.x),q.sourcePoint.y<D&&(D=q.sourcePoint.y)),q.targetPoint&&(q.targetPoint.x<Y&&(Y=q.targetPoint.x),q.targetPoint.y<D&&(D=q.targetPoint.y))}}if(!(!isFinite(Y)||!isFinite(D))){var nt=Y<0?-Y:0,zt=D<0?-D:0;if(!(nt===0&&zt===0))for(var At=0;At<S;At++){var U=x.getChildAt(C,At),q=x.getGeometry(U);if(q!=null){var Ot=q.clone();if(x.isVertex(U)&&(Ot.x+=nt,Ot.y+=zt),Ot.points)for(var rt=0;rt<Ot.points.length;rt++)Ot.points[rt]=new mxPoint(Ot.points[rt].x+nt,Ot.points[rt].y+zt);Ot.sourcePoint&&(Ot.sourcePoint=new mxPoint(Ot.sourcePoint.x+nt,Ot.sourcePoint.y+zt)),Ot.targetPoint&&(Ot.targetPoint=new mxPoint(Ot.targetPoint.x+nt,Ot.targetPoint.y+zt)),x.setGeometry(U,Ot)}}}}function Z(e){if(!e)return e;var x=F(e);return/(^|;)dashed=1(;|$)/.test(x)&&!/(^|;)fixDash=/.test(x)&&(x+="fixDash=1;"),x}function ot(e){var x=e.getModel();function C(S){var Y=x.getStyle(S);if(Y){var D=Z(Y);D!==Y&&x.setStyle(S,D)}for(var At=x.getChildCount(S),U=0;U<At;U++)C(x.getChildAt(S,U))}C(x.getRoot())}function dt(e){X(e),ot(e);var x=new mxCodec,C=x.encode(e.getModel());return mxUtils.getXml(C)}function xt(e){return Math.round(e*100)/100}function re(e,x,C){return Math.abs((x.x-e.x)*(C.y-e.y)-(C.x-e.x)*(x.y-e.y))<1}function N(e,x,C,S){if(e<=0||x<=0)return{x:.5,y:.5};if(C===0&&S===0)return{x:.5,y:.5};var Y=e/2,D=x/2,At=C!==0?Y/Math.abs(C):1/0,U=S!==0?D/Math.abs(S):1/0,q=Math.min(At,U),rt=C*q,ct=S*q;return{x:xt((rt+Y)/e),y:xt((ct+D)/x)}}function Q(e,x){return Math.abs(x.x-e.cx)>=e.hw||Math.abs(x.y-e.cy)>=e.hh}function at(e,x,C){var S=e.hw,Y=e.hh,D=Math.abs(x.y-C.y),At=Math.abs(x.x-C.x);if(Math.abs(e.cy-x.y)*S>Math.abs(e.cx-x.x)*Y){var U=C.y<x.y?x.y-Y-e.cy:e.cy-Y-x.y,q=D===0?0:At*U/D;return{x:C.x<x.x?C.x+q:C.x-At+q,y:C.y<x.y?C.y+D-U:C.y-D+U}}else{var rt=C.x<x.x?x.x-S-e.cx:e.cx-S-x.x,ct=At===0?0:D*rt/At;return{x:C.x<x.x?C.x+At-rt:C.x-At+rt,y:C.y<x.y?C.y+ct:C.y-ct}}}function _(e,x){for(var C=[],S=e[0],Y=!1,D=0;D<e.length;D++){var At=e[D];if(!Q(x,At)&&!Y){for(var U=at(x,S,At),q=!1,rt=0;rt<C.length;rt++)if(C[rt].x===U.x&&C[rt].y===U.y){q=!0;break}q||C.push(U),Y=!0}else S=At,Y||C.push(At)}return C}function l(e,x,C,S,Y){var D;switch(e.shape){case"lollipopInterface":D=r(C,x,null,u(e.labelText),e.x,e.y,e.width,e.height,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+j.fontColor+";");break;case"class_box":case"classBox":var At=e.members||(e.classData?e.classData.members:[])||[],U=e.methods||(e.classData?e.classData.methods:[])||[],q=e.annotations||(e.classData?e.classData.annotations:[])||[],rt="<b>"+mxUtils.htmlEntities(u(e.labelText,e.type))+"</b>",ct=q.length>0?"spacingTop="+q.length*24+";":"",nt=e.drawio&&e.drawio.classLayout,Xe=nt?nt.rowH:24,zt=nt?nt.titleH:48+q.length*24,Ot=At.length===0&&U.length===0,Ft=nt?nt.membersH:At.length===0?Ot?18:24:Xe*(At.length+1),Pt=I(e.cssStyles),Wt=j.fillColor,Kt=Pt.match(/fillColor=([^;]+);?/);Kt&&(Wt=Kt[1]);var Bt=j.fontColor,ce=Pt.match(/fontColor=([^;]+);?/);ce&&(Bt=ce[1]);var kt="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=16;movable=0;resizable=0;rotatable=0;points=[];fontFamily="+j.fontFamily+";fontColor="+Bt+";",wt=function(an){for(var Ka=0;Ka<q.length;Ka++)r(C,an,null,"\xAB"+mxUtils.htmlEntities(u(q[Ka]))+"\xBB",0,12+Ka*24,e.width,24,kt)},jt=nt&&nt.hideCompartments;if(jt){D=r(C,x,null,rt,e.x,e.y,e.width,e.height,"rounded=0;whiteSpace=wrap;html=1;fontStyle=1;fontSize=16;align=center;verticalAlign=middle;"+ct+Pt),wt(D);break}var Ht=Ot?6:12;D=r(C,x,null,rt,e.x,e.y,e.width,e.height,"swimlane;html=1;fontStyle=1;fontSize=16;align=center;verticalAlign=middle;horizontal=1;childLayout=stackLayout;startSize="+zt+";horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginTop="+Ht+";marginBottom="+Ht+";stackSpacing=0;swimlaneFillColor="+Wt+";whiteSpace=wrap;"+ct+Pt),wt(D);for(var qt="text;fontSize=16;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=10;spacingRight=12;spacingBottom=2;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontFamily="+j.fontFamily+";fontColor="+j.fontColor+";",ee=function(an,Ka){if(typeof an!="string")return{label:an,style:Ka};var En=an.replace(/\s+$/,""),Dn=En.charAt(En.length-1);return Dn==="$"?{label:En.slice(0,-1).replace(/\s+$/,""),style:Ka+"fontStyle=4;"}:Dn==="*"?{label:En.slice(0,-1).replace(/\s+$/,""),style:Ka+"fontStyle=2;"}:{label:an,style:Ka}},Ut=0;Ut<At.length;Ut++){var ve=ee(At[Ut],qt);r(C,D,null,u(ve.label),0,zt+12+Ut*Xe,e.width,Xe,ve.style)}var we="line;strokeWidth=1;fillColor=none;spacingLeft=3;spacingRight=3;rotatable=0;points=[];strokeColor=inherit;",Se=Pt.match(/strokeWidth=([^;]+)/);Se&&(we+="strokeWidth="+Se[1]+";"),/(^|;)dashed=1/.test(Pt)&&(we+="dashed=1;");var be=Pt.match(/dashPattern=([^;]+)/);be&&(we+="dashPattern="+be[1]+";"),/(^|;)fixDash=1/.test(Pt)&&(we+="fixDash=1;"),r(C,D,null,null,0,zt+Ft-12,e.width,24,we);for(var Ut=0;Ut<U.length;Ut++){var Me=ee(U[Ut],qt);r(C,D,null,u(Me.label),0,zt+Ft+12+Ut*Xe,e.width,Xe,Me.style)}break;case"note":var Fe=String(e.labelText||"").split(/\r?\n/).map(function(an){return an.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}).join("<br>");D=r(C,x,null,Fe,e.x,e.y,e.width+16,e.height,"rounded=0;whiteSpace=wrap;html=1;align=left;spacingLeft=8;spacingRight=8;fillColor="+p.noteFill+";strokeColor="+p.noteStroke+";strokeWidth=1.3;"+(p.noteFont?"fontColor="+p.noteFont+";":""));break;case"squareRect":if(e.cssStyles&&e.cssStyles.indexOf("opacity: 0;")>=0){D=n("fillColor=none;strokeColor=none;",e,x,C),D.overrideArrowHead="circle";break}case"rect":case"square":case"round":case"rounded":case"group":case"event":case"process":case"rectangle":case"proc":var Ue="";e.isStateDiagram?Ue="rounded=1;absoluteArcSize=1;arcSize=10;":(e.shape=="rounded"||e.type=="round")&&(Ue="rounded=1;absoluteArcSize=1;arcSize="+(e.mindmap?"7;":"10;")),D=n(Ue+"html=1;whiteSpace=wrap;strokeWidth=1;"+(e.type=="group"?"verticalAlign=top;":"")+(e.mindmap&&!e.mindmapRoot&&e.mindmapLine?"footerSize=2;footerColor=light-dark("+e.mindmapLine+",#cccccc);":""),e,x,C);break;case"question":case"choice":case"diamond":case"diam":case"decision":e.shape=="choice"&&(e.labelText=""),D=n("rhombus;strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"stadium":case"pill":case"terminal":D=n("rounded=1;whiteSpace=wrap;arcSize=50;strokeWidth=1;",e,x,C);break;case"subroutine":case"subproc":case"fr-rect":case"framed-rectangle":case"subprocess":D=n("strokeWidth=1;shape=process;whiteSpace=wrap;size=0.04;",e,x,C);break;case"cylinder":case"cyl":case"database":case"db":var De=Y==="block"?0:1,Ye="shape=cylinder3;boundedLbl="+De+";backgroundOutline=1;size=10;strokeWidth=1;whiteSpace=wrap;";if(Y==="block"&&e.width){var Pe=e.width/2/(2.5+e.width/50);Ye="shape=cylinder3;boundedLbl=0;backgroundOutline=1;size="+Math.round(Pe*10)/10+";spacingTop="+Math.round(Pe)+";strokeWidth=1;whiteSpace=wrap;"}D=n(Ye,e,x,C);break;case"circle":case"circ":D=n("ellipse;aspect=fixed;strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"odd":case"odd_right":case"rect_left_inv_arrow":Y==="block"&&e.height?D=n("shape=mermaidOdd;strokeWidth=1;html=1;",e,x,C):D=n("shape=mermaidOdd;strokeWidth=1;whiteSpace=wrap;html=1;",e,x,C);break;case"block-arrow":var de=(e.directions||["right"]).join(",");D=n("shape=mermaidBlockArrow;dirs="+de+";nodePadding=8;strokeWidth=1;whiteSpace=wrap;html=1;",e,x,C);break;case"trapezoid":case"trap-b":case"priority":case"trapezoid-bottom":D=n("shape=trapezoid;perimeter=trapezoidPerimeter;fixedSize=1;size="+e.height/2+";strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"inv_trapezoid":case"manual":case"trap-t":case"trapezoid-top":D=n("shape=trapezoid;perimeter=trapezoidPerimeter;fixedSize=1;size="+e.height/2+";strokeWidth=1;whiteSpace=wrap;flipV=1;",e,x,C);break;case"lean_right":case"lean-right":case"lean-r":case"in-out":D=n("shape=parallelogram;perimeter=parallelogramPerimeter;fixedSize=1;size="+e.height/2+";strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"lean_left":case"lean-left":case"lean-l":case"out-in":D=n("shape=parallelogram;perimeter=parallelogramPerimeter;fixedSize=1;size="+e.height/2+";strokeWidth=1;whiteSpace=wrap;flipH=1;",e,x,C);break;case"doublecircle":case"double-circle":case"dbl-circ":case"framed-circle":case"fr-circ":case"stop":(e.shape=="framed-circle"||e.shape=="fr-circ"||e.shape=="stop")&&(e.labelText=""),D=n("ellipse;shape=doubleEllipse;aspect=fixed;strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"hexagon":case"hex":case"prepare":D=n("shape=hexagon;perimeter=hexagonPerimeter2;fixedSize=1;size="+e.height/4+";strokeWidth=1;whiteSpace=wrap;",e,x,C),e.mindmap&&!e.mindmapRoot&&e.mindmapLine&&r(C,D,null,"",0,e.height-2,e.width,1,"line;strokeWidth=3;strokeColor=light-dark("+e.mindmapLine+",#cccccc);");break;case"start":case"f-circ":case"filled-circle":case"junction":e.labelText="",D=n("ellipse;fillColor=strokeColor;",e,x,C);break;case"stateStart":e.labelText="",D=n("ellipse;fillColor="+E.darkColor+";strokeColor="+E.darkColor+";",e,x,C);break;case"end":e.labelText="",D=n("ellipse;shape=endState;fillColor=strokeColor;",e,x,C);break;case"stateEnd":e.labelText="",D=n("ellipse;fillColor="+E.fillColor+";strokeColor="+E.darkColor+";strokeWidth=2;centerRadius=4;centerColor="+E.strokeColor+";",e,x,C);break;case"roundedWithTitle":var Ve=e.compoundDepth&&e.compoundDepth%2===1?"light-dark(#f0f0f0,#2a2a2a)":E.innerFillColor;D=n("swimlane;html=1;fontStyle=0;align=center;verticalAlign=middle;startSize=30;container=0;collapsible=0;rounded=1;absoluteArcSize=1;arcSize=16;footerSize=4;dropTarget=0;pointerEvents=0;swimlaneFillColor="+Ve+";fillColor="+E.fillColor+";strokeColor="+E.strokeColor+";fontColor="+j.fontColor+";fontFamily="+j.fontFamily+";fontSize=16;",e,x,C);break;case"parallelRegion":e.labelText="",D=n("rounded=0;whiteSpace=wrap;html=1;dashed=1;dashPattern=10 10;fillColor=light-dark(#f0f0f0,#2a2a2a);strokeColor="+E.strokeColor+";strokeWidth=1;",e,x,C);break;case"noteGroup":e.labelText="",D=n("rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;",e,x,C);break;case"stateDivider":D=n("line;strokeColor=light-dark(#9370DB,#cccccc);strokeWidth=1;dashed=1;dashPattern=5 5;fillColor=none;",e,x,C);break;case"fork":case"join":e.labelText="",e.isStateDiagram?D=n("rounded=1;absoluteArcSize=1;arcSize=2;fillColor="+E.darkColor+";strokeColor="+E.darkColor+";strokeWidth=1;perimeterSpacing=2;",e,x,C):D=n("shape=line;strokeWidth="+(e.height-5)+";",e,x,C);break;case"divider":e.labelText="",D=n("fillColor=light-dark(#F0F0F0,#2a2a2a);dashed=1;dashPattern=10 10;",e,x,C);break;case"lifeline":var Ne="participant=";switch(e.type){case"actor":Ne+="seqActorStick;";break;case"boundary":Ne+="seqBoundary;";break;case"control":Ne+="seqControl;";break;case"entity":Ne+="seqEntity;";break;case"database":Ne+="seqDatabase;";break;case"queue":Ne+="seqQueue;";break;case"collections":Ne+="seqCollections;";break;default:Ne=""}switch(e.type){case"actor":case"database":case"boundary":case"control":case"entity":Ne+="verticalAlign=bottom;align=center;spacingBottom=4;";break;case"queue":case"collections":Ne+="verticalAlign=middle;align=center;";break}var nr;switch(e.type){case"database":nr=80;break;case"boundary":case"control":case"entity":nr=80;break;case"queue":case"collections":nr=65;break;case"actor":nr=90;break;default:nr=e.size||50}Ne+="size="+nr+";",e.mirror&&(e.height=Math.round(e.y+e.height)-Math.round(e.y)+nr,Ne+="lifelineMirror=1;"),e.labelText=e.description||e.labelText,D=n('shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","elbow":"vertical","curved":0,"rounded":0};lifelineDashed=0;strokeWidth=2;rounded=1;absoluteArcSize=1;arcSize=6;lifelineColor='+p.lifelineColor+";"+o()+Ne,e,x,C);break;case"seqActor":var Ge="",Ie=0;switch(e.type){case"actor":Ge="participant=seqActorStick;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=90;break;case"boundary":Ge="participant=seqBoundary;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=80;break;case"control":Ge="participant=seqControl;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=80;break;case"entity":Ge="participant=seqEntity;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=80;break;case"database":Ge="participant=seqDatabase;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=80;break;case"queue":Ge="participant=seqQueue;verticalAlign=middle;align=center;",Ie=65;break;case"collections":Ge="participant=seqCollections;verticalAlign=middle;align=center;",Ie=65;break;default:D=n("rounded=1;absoluteArcSize=1;arcSize=6;verticalAlign=middle;align=center;strokeWidth=2;whiteSpace=wrap;"+o(),e,x,C)}D==null&&(e.height=Ie,D=n("shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;lifelineDashed=0;strokeWidth=2;rounded=1;absoluteArcSize=1;arcSize=6;lifelineColor="+p.lifelineColor+";"+o()+"size="+Ie+";"+Ge,e,x,C));break;case"activation":D=n('points=[];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","elbow":"vertical","curved":0,"rounded":0};fillColor='+p.activationFill+";strokeColor="+p.activationStroke+";",e,x,C);break;case"seqNote":e.labelText=e.message||e.labelText,D=n("fillColor="+p.noteFill+";strokeColor="+p.noteStroke+";"+(p.noteFont?"fontColor="+p.noteFont+";":""),e,x,C);break;case"seqRect":var Ce=e.bgColor||"#ECECFF",Ke=e.bgAlpha!=null?Math.round(e.bgAlpha*100):100;D=n("rounded=0;strokeColor=none;fillColor="+Ce+";fillOpacity="+Ke+";pointerEvents=0;",e,x,C);break;case"loop":e.labelText=e.type||"";var We=50,le=20,Ae=p.loopFont||j.fontColor;if(D=n("shape=umlFrame;dashed=1;fixDash=1;dashPattern=2 2;strokeWidth=2;pointerEvents=0;dropTarget=0;fillColor="+p.labelBoxFill+";strokeColor="+p.labelBoxStroke+";fontSize=16;align=center;verticalAlign=middle;fontFamily="+j.fontFamily+";fontColor="+Ae+";height="+le+";width="+We+";",e,x,C),e.title){var Le="["+e.title+"]",Re=typeof mxUtils!="undefined"&&mxUtils.getSizeForString?mxUtils.getSizeForString(Le,16,j.fontFamily,null,0):{width:Le.length*9},Be=e.width-We-4,je=Math.max(1,Math.ceil((Re.width+8)/Math.max(Be,1))),zt=16*je;r(C,D,null,u(Le),We+4,2,Be,zt,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+Ae+";")}if(e.sections!=null)for(var ie=0;ie<e.sections.length;ie++){var fr=e.sections[ie],Ar=e.sectionTitles?e.sectionTitles[ie]:null,Lr=Ar&&Ar.message?"["+Ar.message+"]":"";if(r(C,D,null,null,0,fr.y-e.y,e.width,1,"shape=line;dashed=1;fixDash=1;dashPattern=2 2;strokeColor="+p.labelBoxStroke+";"),Lr){var tn=16;r(C,D,null,u(Lr),0,fr.y-e.y+2,e.width,tn,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+Ae+";")}}break;case"erdEntity":let _n=function(an){return an?typeof mxUtils!="undefined"&&mxUtils.getSizeForString?mxUtils.getSizeForString(an,16,$r,null,0).width:an.length*9:0};var Ze=e.entityData?e.entityData.attributes:[],dr=Ze.length,Xe=dr>0?e.height/(dr+1):e.height,br=Xe,vr=br,gr=0,fa=0,Je=0,$e=0,Qr=25,$r="Trebuchet MS,Verdana,Arial,sans-serif",Ir="1",Cr=j.strokeColor,Ea=I(e.cssStyles,{joinDashArray:!0}),xa=Ea.match(/(?:^|;)fillColor=([^;]+)/),aa=xa?xa[1]==="default"?null:xa[1]:null,Gr=Ea.match(/(?:^|;)strokeColor=([^;]+)/);Gr&&Gr[1]!=="default"&&(Cr=Gr[1]);var ya=Ea.match(/(?:^|;)strokeWidth=([^;]+)/);ya&&(Ir=ya[1]);for(var Ut=0;Ut<Ze.length;Ut++){Ze[Ut].attributeType=Ze[Ut].attributeType||Ze[Ut].type,Ze[Ut].attributeName=Ze[Ut].attributeName||Ze[Ut].name,Ze[Ut].attributeKeyTypeList=Ze[Ut].attributeKeyTypeList||Ze[Ut].keys,Ze[Ut].attributeComment=Ze[Ut].attributeComment||Ze[Ut].comment;var Br=Ze[Ut].attributeKeyTypeList,pa=Br&&Br.length>0?Br.join():Ze[Ut].attributeKeyType;Ze[Ut]._keysText=pa||"",gr=Math.max(gr,_n(Ze[Ut].attributeType)+Qr),fa=Math.max(fa,_n(Ze[Ut].attributeName)+Qr),pa&&(Je=Math.max(Je,_n(pa)+Qr)),Ze[Ut].attributeComment&&($e=Math.max($e,_n(Ze[Ut].attributeComment)+Qr))}var i=Math.max(fa+gr+Je+$e,e.width);D=r(C,x,null,u(e.entityData&&e.entityData.alias?e.entityData.alias:e.labelText,null,{markdown:!0}),e.x,e.y,i,e.height,"shape=table;startSize="+(Ze.length==0?e.height:br)+";container=1;collapsible=0;childLayout=tableLayout;fixedRows=1;rowLines=1;fontSize=16;fontFamily="+$r+";strokeWidth="+Ir+";align=center;resizeLast=1;html=1;");for(var m=Math.max(fa,i-gr-Je-$e),Ut=0;Ut<Ze.length;Ut++){var k=Ut%2===0?"light-dark(#ffffff,#1f2020)":aa||"light-dark(#F1F1FF,#1f2020)",R=r(C,D,null,null,0,vr,i,Xe,"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=1;fillColor="+k+";strokeColor=inherit;strokeWidth="+Ir+";collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;"),$="shape=partialRectangle;connectable=0;fillColor=none;strokeColor="+Cr+";strokeWidth="+Ir+";fontColor="+j.fontColor+";fontFamily="+$r+";top=1;left=1;bottom=1;right=1;align=left;spacingLeft=8;overflow=hidden;fontSize=16;",et=[{value:Ze[Ut].attributeType,w:gr},{value:Ze[Ut].attributeName,w:m}];Je>0&&et.push({value:Ze[Ut]._keysText,w:Je}),$e>0&&et.push({value:Ze[Ut].attributeComment,w:$e});for(var vt=0,Et=0;Et<et.length;Et++)r(C,R,null,u(et[Et].value),vt,0,et[Et].w,Xe,$),vt+=et[Et].w;vr+=Xe}break;case"element":case"requirement":var Yt=e.shape=="element",Gt="<<"+(Yt?"Element":e.data?e.data.type:"")+`>>
-`,he=I(e.cssStyles),_e=j.fontColor,He="",qe=he.match(/(?:^|;)fontColor=([^;]+)/);qe&&qe[1]!=="default"&&(_e=qe[1]);var Er=he.match(/(?:^|;)fontStyle=([^;]+)/);Er&&(He="fontStyle="+Er[1]+";");var Tr=he.match(/(?:^|;)fillColor=([^;]+)/),Vr=Tr&&Tr[1]!=="default"?Tr[1]:"#ECECFF",Zr=68;D=r(C,x,null,"",e.x,e.y,e.width,e.height,"rounded=0;whiteSpace=wrap;html=1;"+he);var ua=he.match(/(?:^|;)strokeColor=([^;]+)/),Aa=ua?ua[1]:"#9370DB";r(C,D,null,"",0,Zr,e.width,1,"shape=line;strokeColor="+Aa+";strokeWidth=1;");var La="&lt;&lt;"+(Yt?"Element":e.data?e.data.type:"")+"&gt;&gt;",Fa=u(e.data?e.data.name:e.labelText,null,{markdown:!0}),$a="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rotatable=0;connectable=0;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+_e+";"+He;r(C,D,null,La,0,8,e.width,24,$a),r(C,D,null,"<b>"+Fa+"</b>",0,32,e.width,24,$a);var _r=[];if(Yt)_r.push("Type: "+(e.data?e.data.type:"")),e.data&&e.data.docRef&&_r.push("Doc Ref: "+e.data.docRef);else{var wa={low:"Low",medium:"Medium",high:"High"},mr={analysis:"Analysis",demonstration:"Demonstration",inspection:"Inspection",test:"Test"},tr=e.data?e.data.risk:"",jr=e.data?e.data.verifyMethod:"";_r.push("ID: "+(e.data?e.data.requirementId||e.data.id:"")),_r.push("Text: "+(e.data?e.data.text:"")),_r.push("Risk: "+(wa[tr.toLowerCase()]||tr)),_r.push("Verification: "+(mr[jr.toLowerCase()]||jr))}for(var va=24,na="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=6;spacingRight=6;overflow=hidden;rotatable=0;connectable=0;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+_e+";"+He,da=0;da<_r.length;da++)r(C,D,null,u(_r[da],null,{markdown:!0}),0,Zr+8+da*va,e.width,va,na);break;case"rectCloud":D=n("shape=mxgraph.basic.cloud_rect;strokeWidth=1;",e,x,C);break;case"cloud":D=n("ellipse;shape=cloud;whiteSpace=wrap;strokeWidth=1;",e,x,C);break;case"mindmapBang":D=n("shape=mindmapBang;whiteSpace=wrap;strokeWidth=1;",e,x,C);break;case"roundedRect":e.mindmap?D=n("rounded=1;arcSize=5;absoluteArcSize=1;whiteSpace=wrap;strokeWidth=1;"+(e.mindmapLine?"footerSize=2;footerColor=light-dark("+e.mindmapLine+",#cccccc);":""),e,x,C):D=n("rounded=1;arcSize=20;strokeWidth=1",e,x,C);break;case"manual-file":D=n("shape=offPageConnector;whiteSpace=wrap;size=1;verticalAlign=top;strokeWidth=1",e,x,C);break;case"manual-input":case"sl-rect":case"sloped-rectangle":D=n("shape=manualInput;whiteSpace=wrap;boundedLbl=1;strokeWidth=1",e,x,C);break;case"docs":case"documents":case"st-doc":case"stacked-document":D=n("shape=mxgraph.flowchart.multi-document;whiteSpace=wrap;boundedLbl=1;strokeWidth=1",e,x,C);break;case"procs":case"processes":case"st-rect":case"stacked-rectangle":D=n("shape=mxgraph.basic.layered_rect;dx=10;flipV=1;whiteSpace=wrap;boundedLbl=1;strokeWidth=1",e,x,C);break;case"paper-tape":case"flag":D=n("shape=tape;size=0.3;whiteSpace=wrap;boundedLbl=1;strokeWidth=1",e,x,C);break;case"text":D=n("text;verticalAlign=middle;align=center;whiteSpace=wrap",e,x,C);break;case"notch-rect":case"card":case"notched-rectangle":D=n("shape=card;whiteSpace=wrap;size=20;arcSize=12;strokeWidth=1",e,x,C);break;case"lin-rect":case"lin-proc":case"lined-process":case"lined-rectangle":case"shaded-process":D=n("shape=internalStorage;whiteSpace=wrap;dx=8;dy=0;strokeWidth=1",e,x,C);break;case"sm-circ":case"small-circle":e.labelText="",D=n("ellipse;strokeWidth=1",e,x,C);break;case"hourglass":case"collate":D=n("shape=collate;whiteSpace=wrap;strokeWidth=1",e,x,C);break;case"comment":case"brace-l":case"brace":e.width=20,D=n("shape=curlyBracket;whiteSpace=wrap;rounded=1;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;strokeWidth=1",e,x,C);break;case"brace-r":e.x+=e.width-20,e.width=20,D=n("shape=curlyBracket;whiteSpace=wrap;rounded=1;flipH=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;strokeWidth=1",e,x,C);break;case"braces":D=n("group;verticalAlign=middle;",e,x,C),r(C,D,null,"",0,0,20,e.height,"shape=curlyBracket;rounded=1;strokeWidth=1"),r(C,D,null,"",e.width-20,0,20,e.height,"shape=curlyBracket;flipH=1;rounded=1;strokeWidth=1");break;case"bolt":case"com-link":case"lightning-bolt":e.labelText="",D=n("shape=mxgraph.basic.flash;strokeWidth=1",e,x,C);break;case"doc":case"document":D=n("strokeWidth=1;shape=document;whiteSpace=wrap;boundedLbl=1",e,x,C);break;case"delay":case"half-rounded-rectangle":D=n("strokeWidth=1;shape=mxgraph.flowchart.delay;whiteSpace=wrap",e,x,C);break;case"das":case"h-cyl":case"horizontal-cylinder":D=n("shape=cylinder3;whiteSpace=wrap;boundedLbl=1;backgroundOutline=1;size=4;rotation=90;horizontal=0;strokeWidth=1",e,x,C);break;case"lin-cyl":case"disk":case"lined-cylinder":D=n("shape=datastore;whiteSpace=wrap;strokeWidth=1",e,x,C);break;case"curv-trap":case"curved-trapezoid":case"display":D=n("shape=display;whiteSpace=wrap;strokeWidth=1",e,x,C);break;case"div-rect":case"div-proc":case"divided-process":case"divided-rectangle":D=n("shape=internalStorage;whiteSpace=wrap;backgroundOutline=1;dx=0;dy=8;strokeWidth=1",e,x,C);break;case"tri":case"triangle":case"extract":D=n("verticalLabelPosition=middle;verticalAlign=bottom;shape=mxgraph.basic.acute_triangle;dx=0.5;labelPosition=center;align=center;strokeWidth=1",e,x,C);break;case"win-pane":case"window-pane":case"internal-storage":D=n("shape=internalStorage;whiteSpace=wrap;backgroundOutline=1;dx=8;dy=8;strokeWidth=1",e,x,C);break;case"lin-doc":case"lined-document":D=n("strokeWidth=1;shape=document;whiteSpace=wrap;boundedLbl=1",e,x,C),r(C,D,null,"",8,0,1,Math.round(e.height*88.75)/100,"line;strokeWidth=1;direction=south");break;case"notch-pent":case"notched-pentagon":case"loop-limit":D=n("shape=loopLimit;whiteSpace=wrap;strokeWidth=1",e,x,C);break;case"flip-tri":case"flipped-triangle":D=n("verticalLabelPosition=middle;verticalAlign=top;shape=mxgraph.basic.acute_triangle;dx=0.5;labelPosition=center;align=center;strokeWidth=1;flipV=1",e,x,C);break;case"bow-rect":case"bow-tie-rectangle":case"stored-data":D=n("shape=dataStorage;whiteSpace=wrap;fixedSize=1;size=5;strokeWidth=1",e,x,C);break;case"cross-circ":case"crossed-circle":case"summary":D=n("shape=sumEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;backgroundOutline=1;strokeWidth=1",e,x,C);break;case"tag-doc":case"tagged-document":D=n("strokeWidth=1;shape=document;whiteSpace=wrap",e,x,C),r(C,D,null,"",Math.round(e.width*95.91)/100,Math.round(e.height*58.02)/100,1,Math.round(e.height*23.46)/100,"line;strokeWidth=1;direction=south;rotation=45");break;case"tag-rect":case"tagged-rectangle":case"tag-proc":case"tagged-process":D=n("rect;strokeWidth=1;whiteSpace=wrap",e,x,C),r(C,D,null,"",Math.round(e.width*95.27)/100,Math.round(e.height*70.37)/100,1,Math.round(e.height*35.2)/100,"line;strokeWidth=1;direction=south;rotation=45");break;case"imageSquare":var Ia=e.constraint=="on",ln=e.pos=="t";D=n("shape=image;imageAspect="+(Ia?"1;":"0;")+(ln?"verticalLabelPosition=top;verticalAlign=bottom;":"verticalLabelPosition=bottom;verticalAlign=top;")+"image="+f(e.img),e,x,C);break;case"icon":case"iconSquare":case"iconCircle":case"iconRounded":var Ma=e.iconLayout||{},ln=e.pos==="t",hn=Ma.boxW||48,Ra=Ma.boxH||48,wn=Ma.iconSize||48,tn=Ma.labelH||0,yn=Ma.labelPad||0,gn=Ra+tn+yn,un=Math.max(hn,Ma.labelW||0),za=u(e.labelText||""),bn=za?'<span style="background:#e8e8e8;padding:4px 8px;">'+za+"</span>":"";D=r(C,x,null,bn,e.x,e.y,un,gn,"rounded=0;strokeColor=none;fillColor=none;verticalLabelPosition="+(ln?"top":"bottom")+";verticalAlign="+(ln?"bottom":"top")+";labelPosition=center;align=center;html=1;whiteSpace=nowrap;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+j.fontColor+";");var ja=(un-hn)/2,vn=ln?tn+yn:0,Pa=null;e.shape==="iconSquare"?Pa="rounded=0;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=#9370DB;strokeWidth=1.3;":e.shape==="iconRounded"?Pa="rounded=1;arcSize=15;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=#9370DB;strokeWidth=1.3;":e.shape==="iconCircle"&&(Pa="ellipse;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=#9370DB;strokeWidth=1.3;"),Pa&&r(C,D,null,"",ja,vn,hn,Ra,Pa);var Ba='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><rect width="80" height="80" style="fill:#087ebf;stroke-width:0px;"/><text transform="translate(21.16 64.67)" style="fill:#fff;font-family:ArialMT,Arial;font-size:67.75px;"><tspan x="0" y="0">?</tspan></text></svg>',en=typeof btoa=="function"?btoa(unescape(encodeURIComponent(Ba))):typeof mxUtils!="undefined"&&mxUtils.toBase64?mxUtils.toBase64(Ba):"",Da=ja+(hn-wn)/2,xn=vn+(Ra-wn)/2;r(C,D,null,"",Da,xn,wn,wn,"shape=image;imageAspect=0;html=1;image=data:image/svg+xml,"+en+";");break;case"gitBranch":D=n("line;dashed=1;dashPattern=2 2;strokeWidth=1;backgroundOutline=0;html=1;"+(e.height>e.width?"direction=south;":"")+"strokeColor=light-dark(#333333,#cccccc);",e,x,C);break;case"gitCommit":var Va="points=[];perimeter=none;";switch(e.type){case 0:D=n("ellipse;strokeWidth=1;"+Va+"strokeColor="+e.color[1]+";fillColor="+e.color[1]+";",e,x,C);break;case 1:D=n("ellipse;strokeWidth=1;"+Va+"strokeColor="+e.color[1]+";fillColor="+e.color[1]+";",e,x,C),r(C,D,null,"",5,5,e.width-10,e.height-10,"shape=umlDestroy;strokeWidth=3;strokeColor="+(e.tagFill||"#ECECFF")+";");break;case 2:{var ea=e.highlightColor||e.color[1],ka=e.tagFill||"#ECECFF";D=n("rounded=0;"+Va+"strokeColor="+ea+";fillColor="+ea+";strokeWidth=1;",e,x,C);var _a=4;r(C,D,null,"",_a,_a,e.width-2*_a,e.height-2*_a,"rounded=0;strokeColor="+ka+";fillColor="+ka+";strokeWidth=1;")}break;case 3:D=n("shape=gitMergeCommit;strokeWidth=1;"+Va+"strokeColor="+e.color[1]+";fillColor="+e.color[1]+";innerColor="+(e.tagFill||"#ECECFF")+";",e,x,C);break;case 4:e.labelText="",D=n("shape=gitCherryPick;strokeWidth=1;"+Va+"strokeColor=light-dark(#333333,#cccccc);fillColor=light-dark(#333333,#cccccc);featureColor=light-dark(#fff,#333333);",e,x,C);break;default:D=n("ellipse;strokeWidth=1;"+Va+"strokeColor="+e.color[1]+";fillColor="+e.color[1]+";",e,x,C);break}if(e.tag||e.tags&&e.tags.length>0){e.tags&&e.tags.length>0&&(e.tag=e.tags.join(", "));var ga=8,Xa=e.tag.length*5+4+ga,rn=15,cn=e.tagFill||"#ECECFF",ia=e.tagStroke||"#C7C7F1";r(C,D,null,u(e.tag),(e.width-Xa)/2,-rn-3,Xa,rn,"shape=gitTag;tabSize="+ga+";tabInset=4;holeSize=1;fillColor="+cn+";strokeColor="+ia+";fontColor="+(e.tagFont||"#131300")+";fontSize="+(e.tagFontSize||10)+";fontFamily=trebuchet ms,verdana,arial,sans-serif;verticalAlign=middle;align=center;spacing=0;")}break;default:D=n("whiteSpace=wrap;strokeWidth=1;",e,x,C)}if(e.link){var Ga=M(e.link);Ga&&C.setAttributeForCell(D,"link",Ga)}if(e.linkTarget&&C.setAttributeForCell(D,"linkTarget",e.linkTarget),e.tooltip&&C.setAttributeForCell(D,"tooltip",e.tooltip),S&&(D.style+="html=1;"),D!=null){var ha="",on=e.type=="group",Ta=on?P.fillColor:j.fillColor,Ha=on?P.strokeColor:j.strokeColor,qa=j.fontColor;e.mindmap&&e.mindmapFill&&(Ta="light-dark("+e.mindmapFill+",#1f2020)",Ha="light-dark("+(e.mindmapStroke||e.mindmapFill)+",#cccccc)",qa="light-dark("+(e.mindmapFont||"#333333")+",#cccccc)"),e.mindmap&&(ha+="treeMoving=1;"),D.style.indexOf("fillColor")<0&&(ha+="fillColor="+Ta+";",on&&Y==="block"&&P.fillOpacity!=null&&D.style.indexOf("fillOpacity")<0&&(ha+="fillOpacity="+P.fillOpacity+";")),D.style.indexOf("strokeColor")<0&&(ha+="strokeColor="+Ha+";",on&&Y==="block"&&P.strokeOpacity!=null&&D.style.indexOf("strokeOpacity")<0&&(ha+="strokeOpacity="+P.strokeOpacity+";")),D.style.indexOf("fontColor")<0&&(ha+="fontColor="+qa+";"),D.style.indexOf("fontFamily")<0&&(ha+="fontFamily="+j.fontFamily+";"),D.style.indexOf("fontSize")<0&&(ha+="fontSize="+j.fontSize+";");var Za=I(e.cssStyles,{joinDashArray:e.shape==="erdEntity"||e.shape==="erEntity"});D.style=F(D.style+";"+ha+Za)}return e.mermaidId&&h(C,D,e.mermaidId),D}function O(e,x){switch(e){case"extension":return x+"Arrow=mermaidExtension;"+x+"Size=17;"+x+"Fill=0";case"composition":return x+"Arrow=mermaidDiamond;"+x+"Size=17;"+x+"Fill=1";case"aggregation":return x+"Arrow=mermaidDiamond;"+x+"Size=17;"+x+"Fill=0";case"requirement_arrow":case"dependency":return x+"Arrow=open;"+x+"Size=16";case"arrow_point":return x+"Arrow=block;"+x+"Size=7";case"block":return x+"Arrow=block;"+x+"Size=8;"+x+"Fill=1";case"arrow_barb":return x+"Arrow=classic;"+x+"Size=9";case"arrow_open":case"none":case void 0:return x+"Arrow=none";case"arrow_circle":return x+"Arrow=oval;"+x+"Size=12;"+x+"Fill=1";case"arrow_cross":return x+"Arrow=cross";case"zero_or_more":case"ZERO_OR_MORE":return x+"Arrow=ERzeroToMany;"+x+"Size=14";case"only_one":case"ONLY_ONE":return x+"Arrow=ERmandOne;"+x+"Size=14";case"one_or_more":case"ONE_OR_MORE":return x+"Arrow=ERoneToMany;"+x+"Size=14";case"zero_or_one":case"ZERO_OR_ONE":return x+"Arrow=ERzeroToOne;"+x+"Size=14";case"circlePlus":case"requirement_contains":return x+"Arrow=circlePlus;"+x+"Size=10;"+x+"Fill=0";case"circle":return x+"Arrow=circle;"+x+"Fill=0";case"lollipop":return x+"Arrow=oval;"+x+"Size=12;"+x+"Fill=0"}return x+"Arrow=none"}function z(e){var x;if(e.relationship&&e.relationship.relSpec?x=[e.useElkLayout?"edgeStyle=orthogonalEdgeStyle;rounded=1;curved=0":"curved=1"]:e.useElkLayout&&e.diagramType==="flowchart"?x=["edgeStyle=orthogonalEdgeStyle;rounded=1;curved=0"]:x=[e.isOrth?"edgeStyle=orthogonalEdgeStyle":"curved=1"],e.relationship){if(e.relationship.relSpec){var C=e.relationship.relSpec;e.arrowTypeStart=C.cardB,e.arrowTypeEnd=C.cardA,e.pattern=C.relType=="NON_IDENTIFYING"?"erDashed":"solid"}else if(e.relationship.type=="contains"||e.relationship.type=="traces"||e.relationship.type=="derives"||e.relationship.type=="satisfies"||e.relationship.type=="verifies"||e.relationship.type=="refines"||e.relationship.type=="copies"){var S=e.relationship.type=="contains";e.pattern=S?"solid":"bigDashed",e.arrowTypeStart=S?"circlePlus":"none",e.arrowTypeEnd=S?"none":"dependency",x.push("labelBackgroundColor=#E8E8E8")}}switch(e.pattern){case"dotted":x.push("dashed=1;dashPattern=2 3;fixDash=1");break;case"dashed":x.push("dashed=1");break;case"erDashed":x.push("dashed=1;dashPattern=8 8");break;case"bigDashed":x.push("dashed=1;dashPattern=10 7;fixDash=1");break}e.classes&&e.classes.indexOf("note-edge")!=-1&&x.push("dashed=1"),x.push(O(e.arrowTypeStart,"start")),x.push(O(e.arrowTypeEnd,"end")),e.strokeWidth?x.push("strokeWidth="+e.strokeWidth):e.thickness=="thick"&&(x.push("strokeWidth=3.5"),x.push("endSize=3"),x.push("startSize=3"));var Y=I(e.style);return Y&&x.push(Y),e.extraStyle&&x.push(e.extraStyle),(x.join(";")+";").replace(/;{2,}/g,";")}function lt(e,x,C,S,Y){if(e.invisible)return null;var D=e.text||e.label||null;D&&e.relationship&&e.relationship.wrapAngleBrackets&&(D="&lt;&lt;"+D+"&gt;&gt;");var At=z(e);e.clusterEntry&&(At+="entryX="+e.clusterEntry.entryX+";entryY="+e.clusterEntry.entryY+";"),e.clusterExit&&(At+="exitX="+e.clusterExit.exitX+";exitY="+e.clusterExit.exitY+";"),e.curved&&(At+="curved=1;");var U=Y.insertEdge(S,null,u(D),x,C,At);if(e.curved&&(e.clusterEntry||e.clusterExit)&&x.geometry&&C.geometry){var q=d(x,x.geometry),rt=d(C,C.geometry),ct=q.x+x.geometry.x+x.geometry.width/2,nt=q.y+x.geometry.y+x.geometry.height/2,zt=rt.x+C.geometry.x+C.geometry.width/2,Ot=rt.y+C.geometry.y+C.geometry.height/2,Ft=zt-ct,Pt=Ot-nt,Wt=Math.sqrt(Ft*Ft+Pt*Pt),Kt=e.clusterEntry||e.clusterExit,Bt=Kt&&(Kt.entryX===0||Kt.entryX===1||Kt.exitX===0||Kt.exitX===1),ce=Math.abs(Bt?Pt:Ft);if(Wt>1&&ce>20){var kt=e.clusterEntry||e.clusterExit,wt=!!e.clusterEntry,jt=wt?C:x,Ht=wt?rt:q,qt=jt.geometry,ee=Ht.x+qt.x+(kt.entryX!=null?kt.entryX:kt.exitX!=null?kt.exitX:.5)*qt.width,Ut=Ht.y+qt.y+(kt.entryY!=null?kt.entryY:kt.exitY!=null?kt.exitY:.5)*qt.height,ve,we;Bt?(ve=(ct+zt)/2,we=Ut):(ve=ee,we=(nt+Ot)/2),U.geometry.points=[new mxPoint(Math.round(ve),Math.round(we))]}}var Se=e.relationship&&e.relationship.relSpec;if(Se&&(U.style+="strokeColor=light-dark(#333333,#cccccc);strokeWidth=1;"),Se&&e.useElkLayout&&e.points&&e.points.length>=2&&x.geometry&&C.geometry&&U.geometry){var be=d(x,x.geometry),Me=d(C,C.geometry),nt=be.y+x.geometry.y+x.geometry.height/2,Ot=Me.y+C.geometry.y+C.geometry.height/2;if(Ot>nt){for(var Fe=be.y+x.geometry.y+x.geometry.height,Ue=Me.y+C.geometry.y,we=(Fe+Ue)/2,De=e.points,Ye=[],Pe=0,de=1;de<De.length;de++){var Ve=De[de].x-De[de-1].x,Ne=De[de].y-De[de-1].y,nr=Math.sqrt(Ve*Ve+Ne*Ne);Ye.push(nr),Pe+=nr}for(var Ge=0,Ie=-1,de=1;de<De.length;de++){var Ce=De[de-1],Ke=De[de];if(Ce.y!==Ke.y&&(Ce.y-we)*(Ke.y-we)<=0){var We=(we-Ce.y)/(Ke.y-Ce.y);Ie=Ge+We*Ye[de-1];break}Ge+=Ye[de-1]}Ie>=0&&Pe>0&&(U.geometry.x=2*Ie/Pe-1,U.geometry.y=0)}}else e.mindmapEdge&&e.strokeColor?U.style+="strokeColor=light-dark("+e.strokeColor+",#cccccc);":U.style.indexOf("strokeColor")<0&&(U.style+="strokeColor="+w+";");if(e.mindmapEdge&&(U.style+="linecap=square;"),D){var le,Ae,Le={extension:1,composition:1,aggregation:1,dependency:1,lollipop:1,association:1,arrow_point:1,arrow_barb:1},Re=e.relationship&&!e.relationship.relSpec&&Le[e.relationship.type];Se?(le="light-dark(#F8FFEC4D,#2a2a2a4D)",Ae=14):e.isStateDiagram?(le="#E8E8E88D",Ae=16):Re?(le="light-dark(#ECECFF,#1f2020)",Ae=16):(le="light-dark(#E8E8E88D,#2a2a2a8D)",Ae=16),U.style+="html=1;fontSize="+Ae+";labelBackgroundColor="+le+";fontFamily="+j.fontFamily+";fontColor="+j.fontColor+";"}if(e.relationship&&e.relationship.relSpec&&!e.useElkLayout){e.points=null;var Be=x.geometry,je=C.geometry;if(Be&&je){var ie=Be.x+Be.width/2,fr=Be.y+Be.height/2,Ar=je.x+je.width/2,Lr=je.y+je.height/2,Ze=Ar-ie,dr=Lr-fr,Xe,br,vr,gr,fa=e.erSpreadExit&&Math.abs(Ze)>10&&Math.abs(dr)>10,Je=e.erSpreadEntry&&Math.abs(Ze)>10&&Math.abs(dr)>10,$e=.16;Math.abs(dr)>=Math.abs(Ze)?(Xe=fa?Ze>0?1-$e:$e:.5,br=dr>0?1:0,vr=Je?Ze>0?$e:1-$e:.5,gr=dr>0?0:1):(Xe=Ze>0?1:0,br=fa?dr>0?1-$e:$e:.5,vr=Ze>0?0:1,gr=Je?dr>0?$e:1-$e:.5),U.style+="exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";";var Qr=d(x,Be),$r=d(C,je),Ir=Qr.x+Be.x+Xe*Be.width,Cr=Qr.y+Be.y+br*Be.height,Ea=$r.x+je.x+vr*je.width,xa=$r.y+je.y+gr*je.height,aa=Ea-Ir,Gr=xa-Cr;if(Math.abs(aa)>5&&Math.abs(Gr)>5){var ya,Br,pa=e.erSpreadEntry&&!e.erSpreadExit,i=(Ir+Ea)/2,m=(Cr+xa)/2,k=br===0||br===1;k?(ya=pa?Ir:Ea,Br=m):(Br=pa?Cr:xa,ya=i),U.geometry.points||(U.geometry.points=[]),U.geometry.points.push(new mxPoint(Math.round(ya),Math.round(Br)))}}}if(e.bidiSide&&x.geometry&&C.geometry){var R=x.geometry,$=C.geometry,et=d(x,R),vt=d(C,$),Et=et.x+R.x+R.width/2,Yt=et.y+R.y+R.height/2,Gt=vt.x+$.x+$.width/2,he=vt.y+$.y+$.height/2,_e=Gt-Et,He=he-Yt,qe=e.bidiSide==="right"?1:-1,Er=typeof mxUtils!="undefined"&&mxUtils.getSizeForString&&D?mxUtils.getSizeForString(String(D),16,"Trebuchet MS,Verdana,Arial,sans-serif",null,0).width:D?String(D).length*9:0,Tr=Er>0?Math.max(45,Er/2+12):12,Vr=Er>0?13:6;if(Math.abs(He)>=Math.abs(_e)){var Zr=.5+qe*Vr/R.width,ua=.5+qe*Vr/$.width;U.style+="exitX="+Zr+";exitY="+(He>0?1:0)+";entryX="+ua+";entryY="+(He>0?0:1)+";curved=1;",U.geometry.relative=!0,U.geometry.x=0,U.geometry.y=0,U.geometry.offset=new mxPoint(0,0);var Aa=Yt+(He>0?R.height/2:-R.height/2),La=he+(He>0?-$.height/2:$.height/2);e.points=[{x:Et+qe*Vr,y:Aa},{x:(Et+Gt)/2+qe*Tr,y:(Aa+La)/2},{x:Gt+qe*Vr,y:La}]}else{var Fa=.5+qe*Vr/R.height,$a=.5+qe*Vr/$.height;U.style+="exitX="+(_e>0?1:0)+";exitY="+Fa+";entryX="+(_e>0?0:1)+";entryY="+$a+";curved=1;",U.geometry.relative=!0,U.geometry.x=0,U.geometry.y=0,U.geometry.offset=new mxPoint(0,0);var _r=Et+(_e>0?R.width/2:-R.width/2),wa=Gt+(_e>0?-$.width/2:$.width/2);e.points=[{x:_r,y:Yt+qe*Vr},{x:(_r+wa)/2,y:(Yt+he)/2+qe*Tr},{x:wa,y:he+qe*Vr}]}}if(e.points&&e.points.length>=2){U.geometry.points=[];var mr=x.geometry,tr=C.geometry,jr,va,na=0,da=0;if(e.isStateDiagram){jr=d(x,mr),va=d(C,tr);for(var Ia=S;Ia&&Ia.geometry;)na+=Ia.geometry.x||0,da+=Ia.geometry.y||0,Ia=Ia.parent}else jr=x.parent!==S&&x.parent&&x.parent.geometry?x.parent.geometry:{x:0,y:0,width:0,height:0},va=C.parent!==S&&C.parent&&C.parent.geometry?C.parent.geometry:{x:0,y:0,width:0,height:0};var Ma=e.points[0],ln=e.points[e.points.length-1],Xe=Math.max(0,Math.min(1,xt((Ma.x-mr.x-jr.x)/mr.width))),br=Math.max(0,Math.min(1,xt((Ma.y-mr.y-jr.y)/mr.height))),vr=Math.max(0,Math.min(1,xt((ln.x-tr.x-va.x)/tr.width))),gr=Math.max(0,Math.min(1,xt((ln.y-tr.y-va.y)/tr.height))),hn=x.children!=null&&x.children.length>0,Ra=C.children!=null&&C.children.length>0,wn=x.style&&x.style.indexOf("swimlane")>=0,tn=C.style&&C.style.indexOf("swimlane")>=0,ie=mr.x+jr.x+mr.width/2,fr=mr.y+jr.y+mr.height/2,Ar=tr.x+va.x+tr.width/2,Lr=tr.y+va.y+tr.height/2,yn=hn&&!wn&&!e.clusterClipped,gn=Ra&&!tn&&!e.clusterClipped,un=Math.abs(Ar-ie),za=e.isStateDiagram&&yn&&un>mr.width*.2,bn=e.isStateDiagram&&gn&&un>tr.width*.2;if(yn)if(za)Xe=Ar<ie?0:1,br=Lr<fr?.13:.87;else{var ja=N(mr.width,mr.height,Ar-ie,Lr-fr);Xe=ja.x,br=ja.y}if(gn)if(za)vr=.5,gr=Lr<fr?1:0;else{var ja=N(tr.width,tr.height,ie-Ar,fr-Lr);vr=ja.x,gr=ja.y}if(e.isStateDiagram&&!yn&&!gn&&!e.bidiSide){var vn=Lr-fr,Pa=Ar-ie,Ba=Math.abs(vn)>=Math.abs(Pa),en=Ba?vn>0?gr>.95:gr<.05:Pa>0?vr>.95:vr<.05,Da=Ba?vn>0?br<.05:br>.95:Pa>0?Xe<.05:Xe>.95;if(en||Da){var xn=N(mr.width,mr.height,Pa,vn);Xe=xn.x,br=xn.y;var Va=N(tr.width,tr.height,-Pa,-vn);vr=Va.x,gr=Va.y}}if(U.style+="exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";",za){var ea=mr.x+jr.x+Xe*mr.width,ka=mr.y+jr.y+br*mr.height,_a=tr.x+va.x+vr*tr.width,ga=tr.y+va.y+gr*tr.height,Xa=(ea+_a)/2,rn=(ka+ga)/2,cn=Xe===0?-1:1,ve=Xa+cn*10;U.geometry.points.push(new mxPoint(Math.round(ve-na),Math.round(rn-da)))}if(!yn&&!gn)for(var ia=1;ia<e.points.length-1;ia++){var Ga=e.points[ia],ha=Math.round(Ga.x),on=Math.round(Ga.y);re(Ma,Ga,ln)||U.geometry.points.push(new mxPoint(ha-na,on-da))}var Ta={extension:1,composition:1,aggregation:1,dependency:1,lollipop:1,association:1},Ha={contains:1,traces:1,derives:1,satisfies:1,verifies:1,refines:1,copies:1},qa=e.relationship&&!e.relationship.relSpec?e.relationship.type:null,Za=qa&&Ta[qa],_n=qa&&Ha[qa];if(e.isStateDiagram&&!e.isBidiPair&&!Za&&!_n){var an=mr.x+jr.x+mr.width/2,Ka=mr.y+jr.y+mr.height/2,En=tr.x+va.x+tr.width/2,Dn=tr.y+va.y+tr.height/2,Tn=En-an,On=Dn-Ka,Ji=!hn&&x.style&&x.style.indexOf("ellipse")>=0&&mr.width<=20&&mr.height<=20,ci=hn&&x.style&&x.style.indexOf("swimlane")>=0,Ci=Ra&&C.style&&C.style.indexOf("swimlane")>=0;if((ci?!Ci:Ci)&&Math.abs(Tn)>Math.abs(On)&&Math.abs(Tn)>25){if(ci){Xe=Tn>0?1:0;var Rn=(Dn-mr.y-jr.y)/mr.height;br=Math.max(.12,Math.min(.88,xt(Rn+(Rn<.5?.08:-.08)))),vr=Tn>0?0:1,gr=.5}else Xe=Tn>0?1:0,br=.5,vr=Tn>0?0:1,gr=Math.max(.12,Math.min(.88,xt((Ka-tr.y-va.y)/tr.height)));if(U.style=U.style.replace(/exitX=[^;]*;exitY=[^;]*;entryX=[^;]*;entryY=[^;]*;/,"exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";"),ci){var Qn=mr.x+jr.x+Xe*mr.width,to=tr.x+va.x+vr*tr.width,jn=tr.y+va.y+gr*tr.height;U.geometry.points=[new mxPoint(Math.round((Qn+to)/2-na),Math.round(jn-da))]}else U.geometry.points=[]}else Ji&&Xe>.05&&Xe<.95&&Math.abs(Tn)>20&&Math.abs(On)>20?(Xe=Tn>0?1:0,br=.5,vr=.5,gr=On>0?0:1,U.style=U.style.replace(/exitX=[^;]*;exitY=[^;]*;entryX=[^;]*;entryY=[^;]*;/,"exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";"),U.geometry.points=[]):Math.abs(Tn)<8&&Math.abs(On)>25?(Xe=.5,br=On>0?1:0,vr=.5,gr=On>0?0:1,U.style=U.style.replace(/exitX=[^;]*;exitY=[^;]*;entryX=[^;]*;entryY=[^;]*;/,"exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";"),U.geometry.points=[]):Math.abs(On)<8&&Math.abs(Tn)>25&&(Xe=Tn>0?1:0,br=.5,vr=Tn>0?0:1,gr=.5,U.style=U.style.replace(/exitX=[^;]*;exitY=[^;]*;entryX=[^;]*;entryY=[^;]*;/,"exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";"),U.geometry.points=[]);for(var Ei=mr.x+jr.x+Xe*mr.width,fi=mr.y+jr.y+br*mr.height,Mi=tr.x+va.x+vr*tr.width,eo=tr.y+va.y+gr*tr.height,Jn=Mi-Ei,Pn=eo-fi,De=U.geometry.points,ui=De.length>0,de=0;de<De.length;de++){var _i=De[de],ro=_i.x+na,ao=_i.y+da,Ti=Math.sqrt(Jn*Jn+Pn*Pn);if(Ti<1){ui=!1;break}var no=Math.abs(Jn*(ao-fi)-Pn*(ro-Ei))/Ti;if(no>3){ui=!1;break}}if((De.length===0||ui)&&Math.abs(Jn)>25&&Math.abs(Pn)>25){var io=fi+Pn*.3;U.geometry.points=[new mxPoint(Math.round(Mi-na),Math.round(io-da))]}}if((Za||_n)&&U.geometry.points.length===0){var ea=mr.x+jr.x+Xe*mr.width,ka=mr.y+jr.y+br*mr.height,_a=tr.x+va.x+vr*tr.width,ga=tr.y+va.y+gr*tr.height,Si=_a-ea,zn=ga-ka;if(Math.abs(Si)>5&&Math.abs(zn)>5){var Yn,vi,ti=Za;Math.abs(zn)>=Math.abs(Si)?(Yn=ti?_a:ea,vi=(ka+ga)/2):(Yn=(ea+_a)/2,vi=ti?ga:ka),U.geometry.points.push(new mxPoint(Math.round(Yn-na),Math.round(vi-da)))}}}if(e.pattern=="invisible"&&(U.visible=!1),e.startLabelRight||e.endLabelLeft){var Ai="edgeLabel;resizable=0;labelBackgroundColor=none;fontSize=11;spacing=8;",Li="middle",Fi="center",Ni="middle",Ii="center";if(x&&x.geometry&&C&&C.geometry&&(Li=x.geometry.y+x.geometry.height<C.geometry.y?"top":"bottom",Ni=x.geometry.y+x.geometry.height<C.geometry.y?"bottom":"top",Fi=x.geometry.x+x.geometry.width<C.geometry.x?"left":"right",Ii=x.geometry.x+x.geometry.width<C.geometry.x?"right":"left"),e.startLabelRight){var di=r(Y,U,null,u(e.startLabelRight),-1,0,0,0,Ai+"align="+Fi+";verticalAlign="+Li+";");di.geometry.relative=!0}if(e.endLabelLeft){var di=r(Y,U,null,u(e.endLabelLeft),.5,0,0,0,Ai+"align="+Ii+";verticalAlign="+Ni+";");di.geometry.relative=!0}}return e.sourceId&&e.targetId&&h(Y,U,"e:"+e.sourceId+"->"+e.targetId+"#"+(e.parallelIndex||0)),U}function W(e,x){var C=v(),S={},Y=x&&x.htmlLabels,D=e.drawio&&e.drawio.orthEdges,At=e.drawio&&e.drawio.useElkLayout,U=e.drawio?e.drawio.diagramType:null;if(mt(e,null,C,S,Y,U),Tt(e,S,null,C,D,At,U),e.drawio&&e.drawio.isMindmap&&pt(C),x&&x.title){var q=0,rt=1/0;if(e.children)for(var ct=0;ct<e.children.length;ct++){var nt=e.children[ct],zt=(nt.x||0)+(nt.width||0);zt>q&&(q=zt),(nt.x||0)<rt&&(rt=nt.x||0)}rt===1/0&&(rt=0),q=Math.max(q,(x.title.length||0)*10+20);var Ot=e.drawio&&e.drawio.isClassDiagram,Ft=Ot?-45:-30,Pt=Ot?rt:0,Wt=Ot?q-rt:q;r(C,null,null,mxUtils.htmlEntities(x.title),Pt,Ft,Wt,25,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=18;fontColor=light-dark(#333333,#cccccc);fontFamily=trebuchet ms,verdana,arial,sans-serif;")}return dt(C)}function pt(e){for(var x=e.getModel(),C=e.getDefaultParent(),S=x.getChildCount(C),Y=[],D=0;D<S;D++){var At=x.getChildAt(C,D);At!=null&&At.edge&&Y.push(At)}Y.length>0&&e.orderCells(!0,Y)}function mt(e,x,C,S,Y,D){if(e.children)for(var At=0;At<e.children.length;At++){var U=e.children[At],q=U.drawio||{},rt={shape:q.shape||"rect",labelText:q.labelText||(U.labels&&U.labels[0]?U.labels[0].text:""),x:U.x||0,y:U.y||0,width:U.width||40,height:U.height||30,cssStyles:q.cssStyles||null,link:q.link||null,linkTarget:q.linkTarget||null,tooltip:q.tooltip||null,type:q.type||null,directions:q.directions||null,img:q.img||null,icon:q.icon||null,form:q.form||null,pos:q.pos||null,assetH:q.assetH||null,assetW:q.assetW||null,iconLayout:q.iconLayout||null,isStateDiagram:q.isStateDiagram||!1,compoundDepth:q.compoundDepth||0,regionIdx:q.regionIdx,mindmap:q.mindmap||!1,mindmapRoot:q.mindmapRoot||!1,mindmapSection:q.mindmapSection,mindmapFill:q.mindmapFill||null,mindmapStroke:q.mindmapStroke||null,mindmapFont:q.mindmapFont||null,mindmapLine:q.mindmapLine||null,classData:q.classData||null,entityData:q.entityData||null,data:q.data||null,members:q.members||null,methods:q.methods||null,annotations:q.annotations||null,mermaidId:U.id?"n:"+U.id:null,drawio:q};q.isSubgraph&&(!q.shape||q.shape==="group")&&(rt.shape="rect",rt.type="group");var ct=l(rt,x,C,Y,D);S[U.id]=ct,U.children&&U.children.length>0&&mt(U,ct,C,S,Y,D)}}function Tt(e,x,C,S,Y,D,At){if(e.edges){for(var U={},q=0;q<e.edges.length;q++){var rt=e.edges[q],ct=rt.sources?rt.sources[0]:null,nt=rt.targets?rt.targets[0]:null;if(!(!ct||!nt)){var zt=ct+""+nt,Ot=nt+""+ct;U[Ot]!==void 0&&(e.edges[U[Ot]].drawio=Object.assign({},e.edges[U[Ot]].drawio||{},{bidiSide:"right"}),rt.drawio=Object.assign({},rt.drawio||{},{bidiSide:"left"})),U[zt]=q}}for(var Ft=[],Pt={},q=0;q<e.edges.length;q++){var rt=e.edges[q],ct=rt.sources?rt.sources[0]:null,nt=rt.targets?rt.targets[0]:null;if(!(!ct||!nt)){var Wt=ct+""+nt;Ft[q]=Pt[Wt]||0,Pt[Wt]=Ft[q]+1}}for(var Kt={},Bt={},q=0;q<e.edges.length;q++){var rt=e.edges[q],ce=rt.drawio&&rt.drawio.relationship&&rt.drawio.relationship.relSpec;if(ce){var ct=rt.sources?rt.sources[0]:null,nt=rt.targets?rt.targets[0]:null;ct&&(Kt[ct]=(Kt[ct]||0)+1),nt&&(Bt[nt]=(Bt[nt]||0)+1)}}for(var q=0;q<e.edges.length;q++){var rt=e.edges[q],ce=rt.drawio&&rt.drawio.relationship&&rt.drawio.relationship.relSpec;if(ce){var ct=rt.sources?rt.sources[0]:null,nt=rt.targets?rt.targets[0]:null,kt=ct&&Kt[ct]>1,wt=nt&&Bt[nt]>1;(kt||wt)&&(rt.drawio=Object.assign({},rt.drawio||{},{erSpreadExit:kt,erSpreadEntry:wt}))}}for(var jt=0;jt<e.edges.length;jt++){var Ht=e.edges[jt],qt=Ht.sources?Ht.sources[0]:null,ee=Ht.targets?Ht.targets[0]:null;if(!(!qt||!ee||!x[qt]||!x[ee])){var Ut=Ht.drawio||{},ve={arrowTypeStart:Ut.arrowTypeStart||"none",arrowTypeEnd:Ut.arrowTypeEnd||"arrow_point",pattern:Ut.pattern||"solid",text:Ut.text||(Ht.labels&&Ht.labels[0]?Ht.labels[0].text:null),isOrth:Y||!1,useElkLayout:D||!1,diagramType:At||null,relationship:Ut.relationship||null,classes:Ut.classes||null,thickness:Ut.thickness||null,strokeWidth:Ut.strokeWidth||null,strokeColor:Ut.strokeColor||null,mindmapEdge:Ut.mindmapEdge||!1,style:Ut.style||null,extraStyle:Ut.extraStyle||null,startLabelRight:Ut.startLabelRight||null,endLabelLeft:Ut.endLabelLeft||null,isStateDiagram:Ut.isStateDiagram||!1,isBidiPair:Ut.isBidiPair||!1,bidiSide:Ut.bidiSide||null,erSpreadExit:Ut.erSpreadExit||!1,erSpreadEntry:Ut.erSpreadEntry||!1,invisible:Ut.invisible||!1,sourceId:qt,targetId:ee,parallelIndex:Ft[jt]||0};if(Ht.sections&&Ht.sections.length>0){for(var we=[],Se=0;Se<Ht.sections.length;Se++){var be=Ht.sections[Se];if(be.startPoint&&we.push({x:be.startPoint.x,y:be.startPoint.y}),be.bendPoints)for(var Me=0;Me<be.bendPoints.length;Me++)we.push({x:be.bendPoints[Me].x,y:be.bendPoints[Me].y});be.endPoint&&we.push({x:be.endPoint.x,y:be.endPoint.y})}ve.points=we}var Fe=x[qt],Ue=x[ee],De=Fe.children!=null&&Fe.children.length>0,Ye=Ue.children!=null&&Ue.children.length>0;if((!Ht.sections||Ht.sections.length===0)&&(De||Ye)&&(ve.points=null),(De||Ye)&&!ve.relationship&&!ve.bidiSide&&ve.points&&ve.points.length>=2){for(var Pe=Fe.geometry,de=Ue.geometry,Ve=d(Fe,Pe),Ne=d(Ue,de),nr={cx:Ve.x+Pe.x+Pe.width/2,cy:Ve.y+Pe.y+Pe.height/2,hw:Pe.width/2,hh:Pe.height/2},Ge={cx:Ne.x+de.x+de.width/2,cy:Ne.y+de.y+de.height/2,hw:de.width/2,hh:de.height/2},Ie=Fe.parent===Ue.parent?Fe.parent:C,Ce=0,Ke=0,We=Ie;We&&We.geometry;)Ce+=We.geometry.x||0,Ke+=We.geometry.y||0,We=We.parent;var le=ve.points.map(function(Re){return{x:Re.x+Ce,y:Re.y+Ke}}),Ae=le;Ye&&(Ae=_(Ae,Ge)),De&&Ae.length>=2&&(Ae=_(Ae.slice().reverse(),nr).reverse()),Ae.length>=2&&(ve.points=Ae.map(function(Re){return{x:Re.x-Ce,y:Re.y-Ke}}),ve.clusterClipped=!0),ve.useElkLayout&&ve.diagramType==="flowchart"||(ve.curved=!0)}var Le=Fe.parent===Ue.parent?Fe.parent:C;lt(ve,Fe,Ue,Le,S)}}}if(e.children)for(var jt=0;jt<e.children.length;jt++)e.children[jt].edges&&Tt(e.children[jt],x,x[e.children[jt].id]||C,S,Y,D,At)}function Rt(e,x){for(var C=v(),S=e.actors,Y=e.messages,D=e.notes,At=e.fragments,U={},q=0;q<At.length;q++){var rt=At[q];rt.type==="rect"&&l({shape:"seqRect",labelText:"",bgColor:rt.bgColor,bgAlpha:rt.bgAlpha,x:rt.x||0,y:rt.y||0,width:rt.width||200,height:rt.height||60},null,C,!0)}if(e.boxes)for(var q=0;q<e.boxes.length;q++){var ct=e.boxes[q];if(!(!ct.width||ct.width<=0)){var nt=ct.color||"transparent",zt=nt==="transparent"?0:100,Ot=r(C,C.getDefaultParent(),null,ct.name||"",ct.x,ct.y,ct.width,ct.height,"rounded=0;fillColor="+nt+";fillOpacity="+zt+";strokeColor=light-dark(#000000,#cccccc);strokeOpacity=50;strokeWidth=0.5;verticalAlign=top;align=center;fontSize=16;spacingTop=2;fontColor="+w+";fontFamily="+j.fontFamily+";pointerEvents=0;");ct.name&&h(C,Ot,"n:box:"+ct.name)}}for(var Ft=x==null||x.singleLifelines!==!1,Pt=S.length>0&&S[0].labelHeight||65,Wt={},q=0;q<S.length;q++){var Kt=S[q],Bt=Kt.height||300,ce=Math.max(Bt-Pt,Kt.labelHeight||65),kt=Kt.y||0,wt=kt,jt=kt+ce;Kt.lifelineStartY!=null&&(wt=Math.max(kt,Kt.lifelineStartY)),Kt.lifelineEndY!=null&&(jt=Math.min(jt,Kt.lifelineEndY));var Ht=Kt.labelHeight||65,qt=Math.max(jt-wt,Ht),ee=Kt.iconName?Dt(st(Kt.iconName)):null,Ut={shape:"lifeline",labelText:ee?"":Kt.label,description:Kt.label,x:Kt.x,y:wt,width:Kt.width||150,height:qt,size:Ht,mirror:Ft,type:ee||Kt.type==="participant"?null:Kt.type,mermaidId:Kt.name?"n:"+Kt.name:null},ve=l(Ut,null,C,!1);if(U[Kt.name]=ve,Wt[Kt.name]={top:wt+Ht,bottom:wt+qt},ee&&Lt(C,Kt,wt,Ht,ee),!Ft){var we={shape:"seqActor",labelText:ee?"":Kt.label,x:Kt.x,y:wt+qt,width:Kt.width||150,height:Pt,type:ee||Kt.type==="participant"?null:Kt.type};l(we,null,C,!0)}if(ee&&Lt(C,Kt,wt+qt,Ft?Ht:Pt,ee),Kt.links&&Kt.links.length>0){C.setAttributeForCell(ve,"links",JSON.stringify(Kt.links));var Se=M(Kt.links[0].url);Se&&C.setAttributeForCell(ve,"link",Se)}}for(var q=0;q<At.length;q++){var rt=At[q];if(rt.type!=="rect"){var be=null,Me=null;if(rt.sections&&rt.sections.length>0){be=[],Me=[];for(var Fe=0;Fe<rt.sections.length;Fe++){var Ue=rt.sections[Fe],De=Math.min(Ue.startIdx,Y.length-1),Ye=De>=0&&De<Y.length?Y[De].y-44:rt.y+rt.height/2;be.push({y:Ye,height:44}),Me.push({message:Ue.title||""})}}var Ut={shape:"loop",labelText:rt.type,type:rt.type,title:rt.title,x:rt.x||0,y:rt.y||0,width:rt.width||200,height:rt.height||60,sections:be,sectionTitles:Me,mermaidId:"n:f"+q};l(Ut,null,C,!0)}}var Pe=[],de=10,Ve={},Ne=[],nr=new Array(Y.length),Ge=new Array(Y.length);function Ie(Fa,$a){Ve[Fa]||(Ve[Fa]=[]);var _r=Ve[Fa].length;return Ve[Fa].push({startY:$a,depth:_r}),_r}function Ce(Fa,$a){var _r=Ve[Fa];if(!_r||_r.length===0)return null;var wa=_r.pop();return Ne.push({actor:Fa,startY:wa.startY,endY:$a||wa.startY+40,depth:wa.depth}),wa}for(var Ke={},We=e.activationEvents||[],q=0;q<We.length;q++){var le=We[q].afterMsgIdx;Ke[le]||(Ke[le]=[]),Ke[le].push(We[q])}for(var Ae=Ke[-1]||[],q=0;q<Ae.length;q++){var Le=Ae[q],Re=Wt[Le.actor];Re&&(Le.type==="activate"?Ie(Le.actor,Re.top):Ce(Le.actor,Re.top+20))}for(var Be=new Array(Y.length),je={},q=0;q<Y.length;q++){var ie=Y[q],fr=Ve[ie.from],Ar=Ve[ie.to];if(nr[q]=fr?fr.length:0,Ge[q]=Ar?Ar.length:0,ie.from&&ie.to){var Lr=ie.from+""+ie.to;Be[q]=je[Lr]||0,je[Lr]=Be[q]+1}if(ie.activate&&ie.to&&(Ge[q]=Ie(ie.to,ie.y||0)+1),ie.deactivate&&ie.from){var Ze=Ce(ie.from,ie.y||0);Ze&&(nr[q]=Ze.depth+1)}for(var dr=Ke[q]||[],Xe=0;Xe<dr.length;Xe++){var Le=dr[Xe];if(Le.type==="activate"){var br=Ie(Le.actor,ie.y||0);ie.to===Le.actor&&(Ge[q]=br+1)}else{var Ze=Ce(Le.actor,ie.y||0);Ze&&ie.from===Le.actor&&(nr[q]=Ze.depth+1)}}}Ne.sort(function(Fa,$a){return Fa.depth-$a.depth});for(var q=0;q<Ne.length;q++){var Ze=Ne[q],vr=U[Ze.actor];if(vr){var gr=vr.geometry,fa=Ze.depth*(de/2),Je={shape:"activation",labelText:"",x:(gr.width-de)/2+fa,y:Ze.startY-gr.y,width:de,height:Math.max(Ze.endY-Ze.startY,20)};Ze.cell=l(Je,vr,C,!0)}}function $e(Fa,$a,_r){if($a>0){for(var wa=0;wa<Ne.length;wa++){var mr=Ne[wa];if(mr.actor===Fa&&mr.depth===$a-1&&mr.cell!=null&&_r>=mr.startY&&_r<=mr.endY)return mr.cell}return null}var tr=Wt[Fa];return tr&&_r>=tr.top&&_r<=tr.bottom?U[Fa]:null}for(var q=0;q<Y.length;q++){let _r=function(mr,tr){if(mr<=0)return 0;var jr=(mr-1)*(de/2);return tr?jr+de/2:jr-de/2};var ie=Y[q],Qr=U[ie.from],$r=U[ie.to];if(!(!Qr||!$r)){var Ir="verticalAlign=bottom;edgeStyle=elbowEdgeStyle;elbow=vertical;curved=0;rounded=0;fontSize=16;labelBackgroundColor=none;strokeWidth=1.5;strokeColor="+(p.signalColor||w)+";fontColor="+(p.signalTextColor||w)+";fontFamily="+j.fontFamily+";",Cr="dashed=1;fixDash=1;dashPattern=3 3;",Ea="endArrow=open;endFill=0;endSize=12;",xa="endArrow=block;endSize=9;",aa=xa+Ir;switch(ie.type){case 1:aa=Cr+xa+Ir;break;case 3:aa="endArrow=cross;"+Ir;break;case 4:aa="endArrow=cross;"+Cr+Ir;break;case 5:aa="endArrow=none;"+Ir;break;case 6:aa="endArrow=none;"+Cr+Ir;break;case 24:aa=Ea+Ir;break;case 25:aa=Cr+Ea+Ir;break}var Gr=ie.from===ie.to,ya=35,Br=24;if(Gr){var pa=ie.type===0||ie.type===1?xa:ie.type===24||ie.type===25?Ea:ie.type===3||ie.type===4?"endArrow=cross;":"endArrow=none;";aa="edgeStyle=none;curved=1;"+pa+"verticalAlign=bottom;align=center;fontSize=16;labelBackgroundColor=none;strokeWidth=1.5;strokeColor="+(p.signalColor||w)+";fontColor="+(p.signalTextColor||w)+";fontFamily="+j.fontFamily+";",(ie.type===1||ie.type===4||ie.type===6||ie.type===25)&&(aa=Cr+aa)}var i=nr[q]||0,m=Ge[q]||0,k=ie.fromX,R=ie.toX;if(!Gr){var $=ie.toX>ie.fromX;k=ie.fromX+_r(i,$),R=ie.toX+_r(m,!$)}var et=null,vt=null;ie.y!=null&&(Gr?(et=$e(ie.from,i,ie.y),(et==null||et!==$e(ie.from,i,ie.y+Br))&&(et=null),vt=et):(et=$e(ie.from,i,ie.y),vt=$e(ie.to,m,ie.y)));var Et=Gr?"":u(ie.text),Xe=C.insertEdge(null,null,Et,et,vt,aa);if(ie.from&&ie.to&&h(C,Xe,"e:"+ie.from+"->"+ie.to+"#"+(Be[q]||0)),ie.y!=null)if(Gr){var Yt=i>0?_r(i,!0):0,Gt=ie.fromX+Yt,he=Gt+ya,_e=ie.y+Br/2;Xe.geometry.sourcePoint=new mxPoint(Math.round(Gt),Math.round(ie.y)),Xe.geometry.targetPoint=new mxPoint(Math.round(Gt),Math.round(ie.y+Br)),Xe.geometry.points=[new mxPoint(Math.round(he),Math.round(ie.y)),new mxPoint(Math.round(he+4),Math.round(_e)),new mxPoint(Math.round(he),Math.round(ie.y+Br))],ie.text&&r(C,C.getDefaultParent(),null,u(ie.text),Math.round(Gt-100),Math.round(ie.y-24),200,18,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontFamily="+j.fontFamily+";fontSize=16;fontColor="+(p.signalTextColor||w)+";")}else Xe.geometry.sourcePoint=new mxPoint(Math.round(k),Math.round(ie.y)),Xe.geometry.targetPoint=new mxPoint(Math.round(R),Math.round(ie.y)),Xe.geometry.points=[new mxPoint(Math.round(Math.min(k,R)+Math.abs(R-k)/2),Math.round(ie.y))];if(ie.centralConnection&&ie.y!=null){var He=5,qe=He*2,Er=p.signalColor||w,Tr="ellipse;aspect=fixed;fillColor="+Er+";strokeColor="+Er+";",Vr=function(mr){C.insertVertex(C.getDefaultParent(),null,"",Math.round(mr-He),Math.round(ie.y-He),qe,qe,Tr)};(ie.centralConnection===59||ie.centralConnection===61)&&Vr(ie.toX),(ie.centralConnection===60||ie.centralConnection===61)&&Vr(ie.fromX)}if(e.autonumber&&ie.y!=null){var Zr=q+1,ua=20,Aa=C.insertVertex(C.getDefaultParent(),null,Zr,Math.round(ie.fromX-ua/2),Math.round(ie.y-ua/2),ua,ua,"ellipse;aspect=fixed;fillColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;fontColor=light-dark(#FFFFFF,#333333);fontSize=12;");Pe.push(Aa)}}}for(var q=0;q<D.length;q++){var La=D[q];if(La.x!=null){var Ut={shape:"seqNote",labelText:La.text,message:La.text,x:La.x,y:La.y,width:La.width||120,height:La.height||40,mermaidId:"n:note"+q};l(Ut,null,C,!0)}}return dt(C)}var It={actor:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none"><g><path d="M15.5489 4.19771C15.5489 5.18773 15.1485 6.13721 14.4358 6.83726C13.7231 7.53731 12.7565 7.93058 11.7486 7.93058C10.7407 7.93058 9.77403 7.53731 9.06133 6.83726C8.34863 6.13721 7.94824 5.18773 7.94824 4.19771C7.94824 3.20768 8.34863 2.25822 9.06133 1.55818C9.77403 0.858126 10.7407 0.464844 11.7486 0.464844C12.7565 0.464844 13.7231 0.858126 14.4358 1.55818C15.1485 2.25822 15.5489 3.20768 15.5489 4.19771Z" stroke="currentColor"/><path d="M6.54883 11.2152L17.2025 11.2073M11.7471 8.06641V19.5806V8.06641ZM11.7471 19.4385L6.79789 23.5738L11.7471 19.4385ZM11.7551 19.4385L17.1864 23.3055L11.7551 19.4385Z" stroke="currentColor"/></g></svg>',boundary:'<svg width="22" height="17" viewBox="0 0 101 78" fill="none"><path d="M96.36 39.45A34.94 34.94 0 0 1 61.42 73.54A34.94 34.94 0 0 1 26.48 39.45A35.07 35.07 0 0 1 61.42 4.38A35.07 35.07 0 0 1 96.36 39.45Z" stroke="currentColor" stroke-width="4" fill="none"/><path d="M27.36 39.45H3.94" stroke="currentColor" stroke-width="4"/><path d="M4.92 4.38V74.52" stroke="currentColor" stroke-width="4"/></svg>',control:'<svg width="18" height="20" viewBox="0 0 77 86" fill="none"><g><path d="M74.01 46.89A35.69 35.69 0 0 1 38.33 82.58A35.69 35.69 0 0 1 2.64 46.89A35.69 35.69 0 0 1 38.33 11.20A35.69 35.69 0 0 1 74.01 46.89Z" stroke="currentColor" stroke-width="5" fill="none"/><path d="M47.54 2.30L37.54 11.50L47.54 20.70" stroke="currentColor" stroke-width="6" fill="none"/></g></svg>',entity:'<svg width="20" height="22" viewBox="0 0 80 88" fill="none"><circle cx="40" cy="40" r="36" stroke="currentColor" stroke-width="4" fill="none"/><path d="M2 84L78 84" stroke="currentColor" stroke-width="4"/></svg>',database:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none"><ellipse cx="12" cy="4.5" rx="8" ry="2.2" stroke="currentColor" stroke-width="1.4" fill="none"/><path d="M4 4.5V19.5C4 21 7.6 22 12 22C16.4 22 20 21 20 19.5V4.5" stroke="currentColor" stroke-width="1.4" fill="none"/><path d="M4 10C4 11.4 7.6 12.4 12 12.4C16.4 12.4 20 11.4 20 10" stroke="currentColor" stroke-width="1.4" fill="none"/><path d="M4 15C4 16.4 7.6 17.4 12 17.4C16.4 17.4 20 16.4 20 15" stroke="currentColor" stroke-width="1.4" fill="none"/></svg>'};function te(e){if(e==null)return"";var x=mxUtils.htmlEntities(String(e));return x=x.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),x=x.replace(/(^|[^*])\*([^*]+)\*(?!\*)/g,"$1<em>$2</em>"),x}function Qt(e){var x=typeof btoa=="function"?btoa(unescape(encodeURIComponent(e))):typeof mxUtils!="undefined"&&mxUtils.toBase64?mxUtils.toBase64(e):"";return"data:image/svg+xml,"+x}var pe="<style>:root{color-scheme:light dark}.i-s{stroke:light-dark(#333,#ccc);fill:none}.i-f{fill:light-dark(#333,#ccc)}</style>",ue={alt:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">'+pe+'<path class="i-s" d="M12 8L20 12L12 16L4 12L12 8Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>'),opt:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">'+pe+'<circle class="i-s" cx="12" cy="12" r="7" stroke-width="1.5" stroke-dasharray="3 2" stroke-linecap="round"/></svg>'),par:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">'+pe+'<path class="i-s" d="M5 10H19" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path class="i-s" d="M5 14H19" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>'),critical:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="16 22 47 38">'+pe+'<path class="i-f" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 26,22.0001L 27,21.9998L 27,27L 26.0001,27.0003C 23.2386,27.0003 21.0001,29.2389 21.0001,32.0003L 21,46.0002C 21,48.7616 23.2386,51.0002 25.9999,51.0002L 27,51.0002L 27,47L 33.75,53.5L 27,60L 27,56L 26,56C 20.4771,56 16,51.5229 16,46L 16,32.0001C 16,26.4773 20.4771,22.0001 26,22.0001 Z M 33,27L 59,27L 59,32L 33,32L 33,27 Z M 36,35L 59,35L 59,40L 36,40L 36,35 Z M 33,43L 59,43L 59,48L 33,48L 33,43 Z"/></svg>'),loop:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">'+pe+'<path class="i-f" d="M960 101.84l-896.002.002c-35.344 0-64 28.656-64 64v576c0 35.36 28.656 64 64 64h160c20.496 0 32-26.32 32-31.984 0-5.824-10.88-32.416-32-32.416h-120.96c-21.376 0-38.72-17.344-38.72-38.72V206.002c0-21.391 17.328-38.72 38.72-38.72l818.272-1.007c21.376 0 38.72 17.328 38.72 38.72V702.69c0 21.376-17.344 38.72-38.72 38.72H518.142l75.984-68.912c9.344-8.944 12.369-23.408 3.025-32.336l-5.472-8.064c-9.376-8.945-24.496-8.945-33.84 0L428.111 750.53l-8.48 8.096c-4.672 4.431-7.008 10.335-6.976 16.223 0 5.904 2.288 11.777 6.977 16.288l8.48 8.096L555.84 915.44c9.344 8.944 24.464 8.944 33.84 0l5.472-8.065c9.344-8.944 6.32-23.44-3.025-32.368l-77.135-69.168H960c35.343 0 64-28.64 64-64v-576c0-35.344-28.657-64-64-64z"/></svg>')},me=Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 214.27 214.27">'+pe+'<path class="i-f" d="M196.926 55.171c-.11-5.785-.215-11.25-.215-16.537a7.5 7.5 0 0 0-7.5-7.5c-32.075 0-56.496-9.218-76.852-29.01a7.498 7.498 0 0 0-10.457 0c-20.354 19.792-44.771 29.01-76.844 29.01a7.5 7.5 0 0 0-7.5 7.5c0 5.288-.104 10.755-.215 16.541-1.028 53.836-2.436 127.567 87.331 158.682a7.495 7.495 0 0 0 4.912 0c89.774-31.116 88.368-104.849 87.34-158.686zm-89.795 143.641c-76.987-27.967-75.823-89.232-74.79-143.351.062-3.248.122-6.396.164-9.482 30.04-1.268 54.062-10.371 74.626-28.285 20.566 17.914 44.592 27.018 74.634 28.285.042 3.085.102 6.231.164 9.477 1.032 54.121 2.195 115.388-74.798 143.356z"/><path class="i-f" d="m132.958 81.082-36.199 36.197-15.447-15.447a7.501 7.501 0 0 0-10.606 10.607l20.75 20.75a7.477 7.477 0 0 0 5.303 2.196 7.477 7.477 0 0 0 5.303-2.196l41.501-41.5a7.498 7.498 0 0 0 .001-10.606 7.5 7.5 0 0 0-10.606-.001z"/></svg>');function Ee(e){var x=e&&It[e.type]||null,C;return e&&e.label===""?C="":C=mxUtils.htmlEntities(e&&(e.label||e.name)||""),x?C?'<div style="display:flex;align-items:center;justify-content:center;gap:4px;">'+x+"<span>"+C+"</span></div>":'<div style="display:flex;align-items:center;justify-content:center;">'+x+"</div>":C}function xe(e,x){for(var C=v(),S=e.actors||[],Y=e.messages||[],D=e.fragments||[],At=e.notes||[],U=e.activations||[],q=e.title||x&&x.title||"",rt=j.fontFamily,ct=j.fontColor,nt="light-dark(#000000,#cccccc)",zt="light-dark(#ffffff,#1f2020)",Ot="light-dark(#ffffff,#1f2020)",Ft="light-dark(#6b7280,#9ca3af)",Pt=40,Wt=32,Kt=24,Bt=1/0,ce=-1/0,kt=0;kt<S.length;kt++){var wt=S[kt],jt=wt.width||150;wt.x<Bt&&(Bt=wt.x),wt.x+jt>ce&&(ce=wt.x+jt)}for(var Ht=0;Ht<D.length;Ht++){var qt=D[Ht];qt.type!=="rect"&&(qt.x!=null&&qt.x<Bt&&(Bt=qt.x),qt.x!=null&&qt.width!=null&&qt.x+qt.width>ce&&(ce=qt.x+qt.width))}isFinite(Bt)||(Bt=0,ce=200);for(var ee=32,Ut=Math.round(Bt-ee),ve=Math.round(ce-Bt+ee*2),we=0,Se=0;Se<Y.length;Se++)Y[Se].y!=null&&Y[Se].y>we&&(we=Y[Se].y);for(var be=0;be<At.length;be++){var Me=(At[be].y||0)+(At[be].height||40);Me>we&&(we=Me)}for(var Fe=0;Fe<D.length;Fe++){var qt=D[Fe];if(qt.type!=="rect"){var Ue=(qt.y||0)+(qt.height||0);Ue>we&&(we=Ue)}}for(var De=Wt+24,Ye=Y.length>0&&Y[0]&&Y[0].comments?Y[0].comments.length:0,Pe=0,de=0;de<D.length;de++){var Ve=D[de];if(Ve.type!=="rect"&&Ve.startIdx===0){var Ne=Ve.title&&Ve.type!=="critical",nr=Ne?64:48;nr>Pe&&(Pe=nr)}}var Ge=De+Pt+24+Ye*16+Pe,Ie=Y.length>0&&Y[0].y!=null?Y[0].y:99,Ce=Ge-Ie,Ke=Math.round(we+Ce)+16;Ke<Ge+60&&(Ke=Ge+60);var We=0,le=Ke+Kt,Ae=r(C,C.getDefaultParent(),null,'<span style="font-weight:600">'+mxUtils.htmlEntities(q)+"</span>",Ut,We,ve,le,"shape=swimlane;horizontal=1;startSize="+Wt+";rounded=1;absoluteArcSize=1;arcSize=6;html=1;whiteSpace=wrap;fillColor="+Ot+";strokeColor="+nt+";swimlaneFillColor="+zt+";fontFamily="+rt+";fontSize=16;fontColor="+ct+";align=left;verticalAlign=middle;spacingLeft=4;collapsible=0;marginBottom=0;pointerEvents=0;"),Le=22,Re=6;r(C,C.getDefaultParent(),null,"",Ut+ve-Le-Re,We+Math.round((Wt-Le)/2),Le,Le,"shape=image;imageAspect=0;html=1;image="+me+";pointerEvents=0;");for(var Be="rounded=1;absoluteArcSize=1;arcSize=8;html=1;whiteSpace=wrap;fillColor="+zt+";strokeColor="+nt+";strokeWidth=2;fontFamily="+rt+";fontSize=16;fontColor="+ct+";align=center;verticalAlign=middle;shadow=0;",je=0;je<S.length;je++){var ie=S[je],jt=ie.width||150,fr=ie.iconName?Dt(st(ie.iconName)):null,Ar=fr?"":Ee(ie),Lr=r(C,C.getDefaultParent(),null,Ar,Math.round(ie.x),De,jt,Pt,Be);if(ie.name&&h(C,Lr,"n:"+ie.name),fr){var Ze=20;r(C,C.getDefaultParent(),null,"",Math.round(ie.x+(jt-Ze)/2),De+2,Ze,Ze,fr),r(C,C.getDefaultParent(),null,mxUtils.htmlEntities(ie.label),Math.round(ie.x),De+Ze+1,jt,Pt-Ze-3,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize=12;fontColor="+ct+";align=center;verticalAlign=middle;")}}for(var dr=De+Pt,Xe=Ke+12,je=0;je<S.length;je++){var ie=S[je],br=ie.centerX!=null?ie.centerX:ie.x+(ie.width||150)/2;r(C,C.getDefaultParent(),null,"",br,dr,1,Xe-dr,"shape=line;direction=south;strokeColor="+nt+";dashed=1;fixDash=1;dashPattern=5 5;strokeWidth=1.5;pointerEvents=0;html=1;")}var vr=new Array(Y.length),gr=new Array(D.length);(function(){var ea=[0],ka=[];function _a(Za){return Za.join(".")}for(var ga={},Xa=0;Xa<U.length;Xa++){var rn=U[Xa];rn.startIdx>=0&&(ga[rn.startIdx]=rn)}for(var cn={},ia=0;ia<D.length;ia++){var Ga=D[ia];Ga.type!=="rect"&&Ga.startIdx>=0&&(cn[Ga.startIdx]||(cn[Ga.startIdx]=[]),cn[Ga.startIdx].push(ia))}for(var ha=0;ha<Y.length;ha++){for(;ka.length>0&&ka[ka.length-1].endIdx<ha;)ka.pop(),ea.pop();if(cn[ha])for(var on=0;on<cn[ha].length;on++){var Ta=cn[ha][on],Ha=D[Ta];ea[ea.length-1]++,gr[Ta]=_a(ea),ka.push({endIdx:Ha.endIdx>=0?Ha.endIdx-1:Y.length-1}),ea.push(0)}if(ea[ea.length-1]++,vr[ha]=_a(ea),ga[ha]){var qa=ga[ha];ka.push({endIdx:qa.endIdx>=0?qa.endIdx:Y.length-1}),ea.push(0)}}})();for(var fa=10,Je=fa/2,$e={},kt=0;kt<S.length;kt++)$e[S[kt].name]=S[kt];for(var Qr=0;Qr<U.length;Qr++){var $r=U[Qr],Ir=$e[$r.actor];if(Ir&&!($r.startIdx<0||$r.startIdx>=Y.length)){var Cr=Y[$r.startIdx],Ea=$r.endIdx>=0&&$r.endIdx<Y.length?$r.endIdx:Y.length-1,xa=Y[Ea];if(!(Cr.y==null||xa.y==null)){var aa=Ir.centerX!=null?Ir.centerX:Ir.x+(Ir.width||150)/2,Gr=Math.round(Cr.y+Ce),ya=Math.round(xa.y+Ce),Br=Math.max(20,ya-Gr+8),pa=($r.depth||0)*Je;r(C,C.getDefaultParent(),null,"",Math.round(aa-Je+pa),Gr,fa,Br,"rounded=0;html=1;fillColor="+zt+";strokeColor="+nt+";strokeWidth=1.5;pointerEvents=0;")}}}for(var i=26,m="light-dark(#999999,#666666)",je=0;je<D.length;je++){var k=D[je];if(k.type!=="rect"){var R=Math.round(k.x),$=Math.round((k.y||0)+Ce),et=Math.round(k.width||200),vt=Math.round(k.height||60),Et=(k.type||"").toLowerCase(),Yt=Et==="critical"?"Try":Et.charAt(0).toUpperCase()+Et.slice(1),Gt=ue[Et]||"",he=Gt?24:6,_e=r(C,C.getDefaultParent(),null,'<span style="font-weight:600">'+mxUtils.htmlEntities(Yt)+"</span>",R,$,et,vt,"shape=swimlane;horizontal=1;startSize="+i+";rounded=1;absoluteArcSize=1;arcSize=6;html=1;whiteSpace=wrap;fillColor="+Ot+";strokeColor="+nt+";strokeWidth=1.2;swimlaneFillColor=none;fontFamily="+rt+";fontSize=14;fontColor="+ct+";align=left;verticalAlign=middle;spacingLeft="+he+";collapsible=0;marginBottom=0;pointerEvents=0;");if(h(C,_e,"n:f"+je),gr[je]){var He=gr[je],qe=Math.max(20,He.length*6+4);r(C,C.getDefaultParent(),null,He,R-qe-2,$,qe,16,"text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;fontFamily="+rt+";fontSize=11;fontColor="+m+";")}if(Gt){var Er=14;r(C,C.getDefaultParent(),null,"",R+5,$+Math.round((i-Er)/2),Er,Er,"shape=image;imageAspect=0;html=1;image="+Gt+";pointerEvents=0;")}k.title&&Et!=="critical"&&r(C,C.getDefaultParent(),null,"["+mxUtils.htmlEntities(k.title)+"]",R+6,$+i+2,et-12,16,"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontStyle=2;fontFamily="+rt+";fontSize=13;fontColor="+Ft+";");var Tr=Et==="critical",Vr=Tr?"light-dark(#cccccc,#555555)":nt;if(k.sections&&k.sections.length>0)for(var Zr=0;Zr<k.sections.length;Zr++){var ua=k.sections[Zr],Aa=Math.min(ua.startIdx||0,Y.length-1),La=Aa>=0&&Aa<Y.length?Math.round(Y[Aa].y+Ce-36):$+Math.round(vt/2);if(r(C,C.getDefaultParent(),null,"",R,La,et,1,"shape=line;strokeColor="+Vr+";strokeWidth=1;html=1;"),ua.title){var Fa=Tr?mxUtils.htmlEntities(ua.title):"["+mxUtils.htmlEntities(ua.title)+"]";r(C,C.getDefaultParent(),null,Fa,R+6,La+1,et-12,16,"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontStyle=2;fontFamily="+rt+";fontSize=13;fontColor="+Ft+";")}}}}var $a="edgeStyle=none;curved=0;rounded=0;html=1;endArrow=open;endFill=0;endSize=5;startSize=0;strokeWidth=1.5;strokeColor="+ct+";fontColor="+ct+";fontFamily="+rt+";fontSize=14;verticalAlign=bottom;align=center;",_r="edgeStyle=none;curved=0;rounded=0;html=1;endArrow=block;endFill=1;endSize=7;startSize=0;strokeWidth=1.5;strokeColor="+ct+";fontColor="+ct+";fontFamily="+rt+";fontSize=14;verticalAlign=bottom;align=center;";function wa(Va,ea){for(var ka=-1,_a=0;_a<U.length;_a++){var ga=U[_a];if(ga.actor===Va&&!(ga.startIdx>ea)&&!(ga.endIdx>=0&&ga.endIdx<ea)){var Xa=ga.depth||0;Xa>ka&&(ka=Xa)}}return ka}function mr(Va,ea,ka){return ea>0?Va+Je*(ka+1):Va+Je*(ka-1)}for(var je=0;je<Y.length;je++){var tr=Y[je];if(!(tr.fromX==null&&tr.toX==null)){var jr=tr.fromX,va=tr.toX,na=tr.y!=null?Math.round(tr.y+Ce):Ge+je*44;if(tr.from!==tr.to){var da=va>jr?1:-1,Ia=wa(tr.from,je),Ma=wa(tr.to,je);Ia>=0&&(jr=mr(jr,da,Ia)),Ma>=0&&(va=mr(va,-da,Ma))}var ln=tr.sync?_r:$a;tr.type===1&&(ln="dashed=1;fixDash=1;dashPattern=6 4;"+ln);var hn=tr.from===tr.to,Ra=C.insertEdge(null,null,u(tr.text),null,null,ln);if(tr.from&&tr.to&&h(C,Ra,"e:"+tr.from+"->"+tr.to+"#"+je),hn){var wn=30,tn=22;Ra.geometry.sourcePoint=new mxPoint(Math.round(jr),na),Ra.geometry.targetPoint=new mxPoint(Math.round(jr),na+tn),Ra.geometry.points=[new mxPoint(Math.round(jr+wn),na),new mxPoint(Math.round(jr+wn),na+tn)]}else Ra.geometry.sourcePoint=new mxPoint(Math.round(jr),na),Ra.geometry.targetPoint=new mxPoint(Math.round(va),na);var yn=hn?jr:Math.min(jr,va),gn=vr[je]!=null?vr[je]:String(je+1),un=Math.max(20,gn.length*6+4);if(r(C,C.getDefaultParent(),null,gn,Math.round(yn-un-4),na-16,un,16,"text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=bottom;fontFamily="+rt+";fontSize=11;fontColor="+m+";"),tr.comments&&tr.comments.length>0)for(var za=16,bn=20,ja=Math.abs(va-jr),vn=Math.max(ja,240),Pa=Math.round((jr+va)/2-vn/2),Ba=0;Ba<tr.comments.length;Ba++){var en=na-bn-(tr.comments.length-Ba)*za;r(C,C.getDefaultParent(),null,te(tr.comments[Ba]),Pa,en,vn,za,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=nowrap;fontFamily="+rt+";fontSize=12;fontColor="+Ft+";fontStyle=2;")}}}for(var je=0;je<At.length;je++){var Da=At[je];if(Da.x!=null){var xn=r(C,C.getDefaultParent(),null,u(Da.text),Da.x,Math.round((Da.y||0)+Ce),Da.width||120,Da.height||40,"rounded=0;html=1;whiteSpace=wrap;fillColor=light-dark(#fff5ad,#2a2a2a);strokeColor=light-dark(#aaaa33,#cccccc);fontFamily="+rt+";fontSize=14;fontColor="+ct+";align=center;verticalAlign=middle;");h(C,xn,"n:note"+je)}}return(function(){for(var ea=C.getModel(),ka=C.getDefaultParent(),_a=[],ga=0;ga<ea.getChildCount(ka);ga++){var Xa=ea.getChildAt(ka,ga);Xa!==Ae&&_a.push(Xa)}if(_a.length!==0){ea.beginUpdate();try{for(var ga=0;ga<_a.length;ga++){var rn=_a[ga],cn=ea.getGeometry(rn);if(cn!=null){var ia=cn.clone();if(ea.isEdge(rn)||(ia.x!=null&&(ia.x-=Ut),ia.y!=null&&(ia.y-=We)),ia.sourcePoint!=null&&(ia.sourcePoint=new mxPoint(ia.sourcePoint.x-Ut,ia.sourcePoint.y-We)),ia.targetPoint!=null&&(ia.targetPoint=new mxPoint(ia.targetPoint.x-Ut,ia.targetPoint.y-We)),ia.points!=null&&ia.points.length>0){for(var Ga=[],ha=0;ha<ia.points.length;ha++)Ga.push(new mxPoint(ia.points[ha].x-Ut,ia.points[ha].y-We));ia.points=Ga}ea.setGeometry(rn,ia)}ea.add(Ae,rn)}}finally{ea.endUpdate()}}})(),dt(C)}function ar(e,x,C){e=(e%360+360)%360,x=x/100,C=C/100;var S=(1-Math.abs(2*C-1))*x,Y=S*(1-Math.abs(e/60%2-1)),D=C-S/2,At=0,U=0,q=0;e<60?(At=S,U=Y):e<120?(At=Y,U=S):e<180?(U=S,q=Y):e<240?(U=Y,q=S):e<300?(At=Y,q=S):(At=S,q=Y);function rt(ct){var nt=Math.max(0,Math.min(255,Math.round((ct+D)*255))),zt=nt.toString(16);return zt.length===1?"0"+zt:zt}return"#"+rt(At)+rt(U)+rt(q)}var xr=8,sr=[["#ffffff","#0000ec"],["#000000","#dede00"],["#000000","#9dec00"],["#ffffff","#0076ec"],["#000000","#00ecec"],["#000000","#00ec76"],["#000000","#ec00ec"],["#000000","#ec0000"]],Qe=[["#000000","#ffcb5e"],["#000000","#cf5eff"],["#000000","#779eff"],["#000000","#ff8a5e"],["#000000","#ff5e93"],["#000000","#ff5ecf"],["#000000","#a3ff5e"],["#000000","#5effc3"]],or=[["#2c2c2c",ar(180,1.59,48.35)],["#d3d3d3",ar(321.6,65.6,38.2)],["#d3d3d3",ar(194.4,16.6,49.6)],["#2c2c2c",ar(23.1,49.1,40.8)],["#d3d3d3",ar(0,83.3,43.5)],["#d3d3d3",ar(289.2,100,24.1)],["#d3d3d3",ar(35.1,98.7,40.2)],["#d3d3d3",ar(106.2,84.4,35.1)]],Wr=[["#333333","#b4b4b4"],["#ffffff","#555555"],["#333333","#bbbbbb"],["#ffffff","#777777"],["#333333","#999999"],["#333333","#dddddd"],["#333333","#ffffff"],["#333333","#dddddd"]],oa=["#131300","#0000a0","#310093","#934900","#930000","#930049","#009300","#009393"],Sr=["#003ca1","#34a100","#885c00","#0085a1","#00a16d","#00a11c","#6d00a1","#a10034"],Rr=[["#000000","#9bc834"],["#000000","#7aff32"],["#000000","#b0d45b"],["#000000","#c8ab34"],["#000000","#c86134"],["#000000","#c83452"],["#000000","#34c861"],["#000000","#349bc8"]],Mr=["#6437cb","#8500cd","#4f2ba4","#3754cb","#379ecb","#37cbad","#cb379e","#cb6437"],er=["#868282","#5edd8c","#95766c","#64a3ca","#34eded","#9aff84","#3387fe","#ce5af1"],Xr=["#4b4b4b","#aaaaaa","#444444","#888888","#666666","#222222","#000000","#222222"];function Kr(e,x,C){return C&&e>0?(e-1)%(x-1)+1:e%x}function Ur(e){var x=e.customType!=null?e.customType:e.type;switch(x){case 1:return"commit-reverse";case 2:return"commit-highlight";case 3:return"commit-merge";case 4:return"commit-cherry-pick";default:return"commit-normal"}}function Jr(e,x){var C=v(),S=e.commits,Y=e.branches,D=e.isVertical,At=e.showBranches,U=e.showCommitLabel,q=e.rotateCommitLabel!==!1,rt="trebuchet ms,verdana,arial,sans-serif",ct=x&&x.theme||"default",nt,zt;ct==="base"?(nt=Qe,zt=Sr):ct==="dark"?(nt=or,zt=er):ct==="forest"?(nt=Rr,zt=Mr):ct==="neutral"?(nt=Wr,zt=Xr):(nt=sr,zt=oa);var Ot,Ft,Pt,Wt;ct==="base"?(Ot="#fff4dd",Ft="#eddbbb",Pt="#131300",Wt="#f4dbff"):ct==="dark"?(Ot="#1f2020",Ft="#cccccc",Pt="#e0dfdf",Wt="#484848"):ct==="forest"?(Ot="#cde498",Ft="#abb594",Pt="#131300",Wt="#cdffb2"):ct==="neutral"?(Ot="#eeeeee",Ft="#d4d4d4",Pt="#111111",Wt="#fcfcfc"):(Ot="#ECECFF",Ft="#C7C7F1",Pt="#131300",Wt="#ffffde");var Kt=x&&x.themeVariables||{};nt=nt.slice();for(var Bt=0;Bt<10;Bt++){var ce=Kt["git"+Bt]||Kt["'git"+Bt+"'"],kt=Kt["gitBranchLabel"+Bt]||Kt["'gitBranchLabel"+Bt+"'"];if(ce||kt){var wt=nt[Bt]?nt[Bt][0]:"#000000",jt=nt[Bt]?nt[Bt][1]:"#000000";nt[Bt]=[kt||wt,ce||jt]}}zt=zt.slice();for(var Ht=0;Ht<10;Ht++){var qt=Kt["gitInv"+Ht]||Kt["'gitInv"+Ht+"'"];qt&&(zt[Ht]=qt)}var ee=Kt.tagLabelBackground||Kt["'tagLabelBackground'"],Ut=Kt.tagLabelBorder||Kt["'tagLabelBorder'"],ve=Kt.tagLabelColor||Kt["'tagLabelColor'"],we=Kt.tagLabelFontSize||Kt["'tagLabelFontSize'"];ee&&(Ot=ee),Ut&&(Ft=Ut),ve&&(Pt=ve);var Se=we&&parseInt(we.toString().replace(/[^\d]/g,""),10)||10,be={default:"#000021",base:"#0b2200",forest:"#32004d",dark:"#b8b6b6",neutral:"#030303"},Me=Kt.commitLabelColor||Kt["'commitLabelColor'"]||be[ct]||"#000021",Fe=Kt.commitLabelBackground||Wt,Ue=parseInt((Kt.commitLabelFontSize||"10").toString().replace(/[^\d]/g,""),10)||10,De={},Ye={},Pe=[];for(var de in Y)Pe.push({name:de,lane:Y[de].lane||0});Pe.sort(function(Ta,Ha){return Ta.lane-Ha.lane});for(var Ve=0;Ve<Pe.length;Ve++){var de=Pe[Ve].name,Ne=Y[de],nr=Kr(Ve,xr,!1),Ge=nt[nr];if(Ne.color=Ge,Ne.colorIndex=nr,!!At){var Ie={shape:"gitBranch",labelText:de,x:Ne.x||0,y:Ne.y||0,width:Ne.width||1,height:Ne.height||1,color:Ge,mermaidId:"n:branch:"+de},Ce=l(Ie,null,C,!0);Ce.value="",De[de]=Ce;{for(var Ke=mxUtils.htmlEntities(de),We=0,le=0;le<de.length;le++){var Ae=de.charCodeAt(le);Ae<=32||Ae===95?We+=5:Ae>=65&&Ae<=90?We+=10:We+=8}var Le=We+16,Re=23,Be=q?35:5,je=Ne.x||0,ie=Ne.y||0,fr=Ne.width||1,Ar=Ne.height||1,Lr=e.dir||(D?"TB":"LR"),Ze,dr;Lr==="TB"?(Ze=je-Le/2,dr=ie-Re-3):Lr==="BT"?(Ze=je-Le/2,dr=ie+Ar+3):Lr==="RL"?(Ze=je+fr+Be,dr=ie-Re/2):(Ze=je-Le-Be,dr=ie-Re/2);var Xe=r(C,null,null,Ke,Ze,dr,Le,Re,"rounded=1;absoluteArcSize=1;arcSize=8;html=1;verticalAlign=middle;align=center;whiteSpace=nowrap;fontSize=16;fontFamily="+rt+";strokeColor=none;fillColor="+Ge[1]+";fontColor="+Ge[0]+";");Ye[de]=Xe}}}for(var br={},vr=[],gr=16,fa=Math.cos(Math.PI/4),Je=0;Je<S.length;Je++){var $e=S[Je],Qr=Y[$e.branch],Ge=Qr?Qr.color:nt[0],$r=$e.width||20,Ir=$e.cx!=null?$e.cx:$e.x+$r/2,Cr=$e.cy!=null?$e.cy:$e.y+$r/2,Ea=Y[$e.branch]&&Y[$e.branch].colorIndex!=null?Y[$e.branch].colorIndex:0,xa=zt[Ea%zt.length],Ie={shape:"gitCommit",labelText:"",x:Ir-$r/2,y:Cr-$r/2,width:$r,height:$r,color:Ge,type:$e.customType!=null?$e.customType:$e.type,tag:$e.tag,tags:$e.tags,tagFill:Ot,tagStroke:Ft,tagFont:Pt,tagFontSize:Se,highlightColor:xa,mermaidId:$e.id?"n:commit:"+$e.id:null},Ce=l(Ie,null,C,!1);br[$e.id]=Ce;var aa=$e.id&&!/^\d+(-[\da-f]+)?$/.test($e.id),Gr=$e.type===4||$e.type===3&&!aa;if(U&&$e.id&&!Gr){for(var Ke=$e.id,We=0,ya=0;ya<Ke.length;ya++){var Br=Ke.charCodeAt(ya);Br<=32||Br===46||Br===58||Br===59||Br===44||Br===33||Br===124||Br===39||Br===40||Br===41?We+=3:Br>=65&&Br<=90?We+=6:We+=5}var pa=Ue/10,Le=Math.round(We*pa+4),Re=Math.round(11*pa+4),i="rounded=0;html=1;whiteSpace=nowrap;fillColor="+Fe+";fillOpacity=50;strokeColor=none;fontColor="+Me+";fontSize="+Ue+";fontFamily="+rt+";",m,k;if(D){var R=Ir-Le-17,$=Cr-12,et=R+Le/2,vt=$+Re/2,Et=et-Ir,Yt=vt-Cr,Gt=Ir+Et*fa+Yt*fa,he=Cr-Et*fa+Yt*fa;m=Gt-Le/2,k=he-Re/2,i+="align=left;verticalAlign=middle;rotation=315;";var Xe=r(C,null,null,Ke,m,k,Le,Re,i);vr.push(Xe)}else if(q){var _e=Le/2*fa;m=Ir-Le/2-_e,k=Cr+gr-Re/2+_e,i+="align=right;verticalAlign=middle;rotation=315;";var Xe=r(C,null,null,Ke,m,k,Le,Re,i);vr.push(Xe)}else{m=Ir-Le/2,k=Cr+13.5,i+="align=center;verticalAlign=middle;";var Xe=r(C,null,null,Ke,m,k,Le,Re,i);vr.push(Xe)}}}for(var He={},qe={},Je=0;Je<S.length;Je++){var Ne=Y[S[Je].branch];He[S[Je].id]=Ne?Ne.lane:0,qe[S[Je].id]=S[Je]}function Er(Ta,Ha){for(var qa={x:Ta.cx,y:Ta.cy},Za={x:Ha.cx,y:Ha.cy},_n=D?qa.x<Za.x:qa.y<Za.y,an=_n?Ha.branch:Ta.branch,Ka=0;Ka<S.length;Ka++){var En=S[Ka];if(En.branch===an&&En.seq>Ta.seq&&En.seq<Ha.seq)return!0}return!1}var Tr=[];function Vr(Ta,Ha,qa){qa=qa||0;var Za=Ta+Math.abs(Ta-Ha)/2;if(qa>5)return Za;for(var _n=!0,an=0;an<Tr.length;an++)if(Math.abs(Tr[an]-Za)<10){_n=!1;break}if(_n)return Tr.push(Za),Za;var Ka=Math.abs(Ta-Ha);return Vr(Ta,Ha-Ka/5,qa+1)}for(var Je=0;Je<S.length;Je++)for(var $e=S[Je],Zr=0;Zr<$e.parents.length;Zr++){var ua=$e.parents[Zr],Aa=br[ua],La=br[$e.id];if(Aa&&La){var Fa=He[ua],$a=He[$e.id],_r=qe[ua],wa=$e.type===3&&Zr>0&&$e.parents.length>1&&$e.parents[0]!==ua,mr=$e.branch;wa&&_r&&(mr=_r.branch);var Qr=Y[mr],Ge=Qr?Qr.color:nt[0],tr=C.insertEdge(null,null,null,Aa,La,"edgeStyle=orthogonalEdgeStyle;rounded=1;arcSize=50;endArrow=none;endFill=0;strokeWidth=8;startSize=0;endSize=0;strokeColor="+Ge[1]+";");if(Fa!=null&&$a!=null&&Fa!==$a&&_r){var $r=$e.width||20,jr=Er(_r,$e);if(jr){if(D){var va=_r.cx,na=$e.cx,da=_r.cy,Ia=$e.cy,Ma=da<Ia?Vr(da,Ia):Vr(Ia,da);tr.geometry.points=[new mxPoint(Math.round(va),Math.round(Ma)),new mxPoint(Math.round(na),Math.round(Ma))]}else{var va=_r.cx,na=$e.cx,da=_r.cy,Ia=$e.cy,Ma=da<Ia?Vr(da,Ia):Vr(Ia,da);tr.geometry.points=[new mxPoint(Math.round(va),Math.round(Ma)),new mxPoint(Math.round(na),Math.round(Ma))]}if(_r){var ln=Y[_r.branch]?Y[_r.branch].color:nt[0];tr.style=tr.style.replace(/strokeColor=[^;]+/,"strokeColor="+ln[1])}}else if(D){var hn=Y[_r.branch]?Y[_r.branch].x:0,Ra=Y[$e.branch]?Y[$e.branch].x:0,wn=_r.cy,tn=$e.cy;wa?tr.geometry.points=[new mxPoint(Math.round(hn),Math.round(tn))]:tr.geometry.points=[new mxPoint(Math.round(Ra),Math.round(wn))]}else{var yn=Y[_r.branch]?Y[_r.branch].y:0,gn=Y[$e.branch]?Y[$e.branch].y:0,hn=_r.cx,Ra=$e.cx;wa?tr.geometry.points=[new mxPoint(Math.round(Ra),Math.round(yn))]:tr.geometry.points=[new mxPoint(Math.round(hn),Math.round(gn))]}}}}var un=C.getDefaultParent(),za=C.getModel(),bn=[];for(var de in Y)De[de]&&bn.push(De[de]),Ye[de]&&bn.push(Ye[de]);for(var ja=[],Je=0;Je<S.length;Je++)br[S[Je].id]&&ja.push(br[S[Je].id]);for(var vn=[],Pa=za.getChildCount(un),Je=0;Je<Pa;Je++){var Br=za.getChildAt(un,Je);za.isEdge(Br)&&vn.push(Br)}for(var Ba=0,Je=0;Je<bn.length;Je++)za.add(un,bn[Je],Ba++);for(var Je=0;Je<vn.length;Je++)za.add(un,vn[Je],Ba++);for(var Je=0;Je<ja.length;Je++)za.add(un,ja[Je],Ba++);for(var Je=0;Je<vr.length;Je++)za.add(un,vr[Je],Ba++);if(x&&x.title){var en=1/0,Da=-1/0;for(var de in Y){var Ne=Y[de],xn=Ne.x||0,Va=xn+(Ne.width||0);xn<en&&(en=xn),Va>Da&&(Da=Va)}for(var de in Ye){var ea=Ye[de];if(ea&&ea.geometry){var ka=ea.geometry.x||0,_a=ka+(ea.geometry.width||0);ka<en&&(en=ka),_a>Da&&(Da=_a)}}for(var ga=0;ga<S.length;ga++){var Xa=S[ga].x||0,rn=Xa+(S[ga].width||0);Xa<en&&(en=Xa),rn>Da&&(Da=rn)}isFinite(en)||(en=0),isFinite(Da)||(Da=200);var cn=30,ia=20,Ga=Math.max(Da-en,(x.title.length||0)*10+20),ha=en+(Da-en-Ga)/2,on=-cn-ia/2;r(C,null,null,mxUtils.htmlEntities(x.title),ha,on,Ga,ia,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=18;fontColor=light-dark(#333333,#cccccc);fontFamily=trebuchet ms,verdana,arial,sans-serif;")}return dt(C)}var Yr=["#ECECFF","#FFFFDE","#FFECFE","#DEFFE0","#ECFFFE","#FFDEE0","#FFEFEC","#DEFBFF"],ke="#666666",ze="#666666",lr="#333333",ir="#FFF8DC",ur="#999999",zr="#000000",cr="Open Sans,sans-serif",Nr="'trebuchet ms',verdana,arial,sans-serif";function Fr(e){return Yr[e%Yr.length]}function sa(e,x){var C=v(),S=e.sections,Y=e.actors;e.title&&r(C,null,null,u(e.title),e.timelineStartX||150,0,Math.max(e.title.length*16,200),40,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=32;fontStyle=1;fontFamily="+Nr+";fontColor=light-dark(#333333,#cccccc);");for(var D=Object.keys(Y).sort(),At=0;At<D.length;At++){var U=Y[D[At]],q=60+At*20,rt=r(C,null,null,D[At],13,q-7,14,14,"ellipse;aspect=fixed;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;spacingLeft=10;strokeColor="+zr+";fillColor="+U.color+";fontFamily="+cr+";fontSize=16;");h(C,rt,"n:actor:"+D[At])}for(var ct=0;ct<S.length;ct++){var nt=S[ct],zt=nt.index!=null?nt.index:ct,Ot=Fr(zt);if(nt.name){var Ft=r(C,null,null,u(nt.name),nt.x,nt.y,nt.width,nt.height,"rounded=1;arcSize=6;whiteSpace=wrap;html=1;fillColor="+Ot+";strokeColor="+ke+";fontColor="+lr+";fontFamily="+cr+";fontSize=14;");h(C,Ft,"n:section:"+zt)}for(var Pt=0;Pt<nt.tasks.length;Pt++){var Wt=nt.tasks[Pt],Kt=Wt.x+Wt.width/2,Bt=C.insertEdge(null,null,null,null,null,"endArrow=none;html=1;strokeWidth=1;dashed=1;dashPattern=4 2;strokeColor="+ze+";");Bt.geometry.setTerminalPoint(new mxPoint(Math.round(Kt),Math.round(Wt.y)),!0),Bt.geometry.setTerminalPoint(new mxPoint(Math.round(Kt),Math.round(Wt.lineEndY)),!1),Bt.geometry.relative=!0;var ce=r(C,null,null,u(Wt.task),Wt.x,Wt.y,Wt.width,Wt.height,"rounded=1;arcSize=6;whiteSpace=wrap;html=1;fillColor="+Ot+";strokeColor="+ke+";fontColor="+lr+";fontFamily="+cr+";fontSize=14;");h(C,ce,"n:task:"+zt+":"+Pt);var kt=Wt.score>=4?"happy":Wt.score<=2?"sad":"neutral";r(C,null,null,"",Kt-15,Wt.faceCy-15,30,30,"shape=smileyFace;aspect=fixed;smileyType="+kt+";fillColor="+ir+";strokeColor="+ur+";strokeWidth=2;");var wt=0;for(var jt in Wt.actors)r(C,null,null,null,Wt.x+7+wt*10,Wt.y-7,14,14,"ellipse;aspect=fixed;strokeColor="+zr+";fillColor="+Wt.actors[jt].color+";"),wt++}}if(e.timelineStartX!=null&&e.timelineEndX!=null){var Ht=C.insertEdge(null,null,null,null,null,"endArrow=block;html=1;strokeWidth=4;endFill=1;strokeColor=light-dark(#000000,#cccccc);");Ht.geometry.setTerminalPoint(new mxPoint(Math.round(e.timelineStartX),Math.round(e.timelineY)),!0),Ht.geometry.setTerminalPoint(new mxPoint(Math.round(e.timelineEndX),Math.round(e.timelineY)),!1),Ht.geometry.relative=!0}return dt(C)}function yr(e,x,C){for(var S=v(),Y=S.getDefaultParent(),D=S.getDefaultParent(),At="rounded=0;whiteSpace=wrap;html=1;fillColor=light-dark(#EFEFEF,#2a2a2a);strokeColor=light-dark(#000000,#cccccc);strokeWidth=1;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontSize=12;fontColor=light-dark(#000000,#cccccc);align=center;verticalAlign=middle;",U="text;html=1;strokeColor=none;fillColor=none;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontSize=10;fontColor=light-dark(#000000,#cccccc);verticalAlign=middle;",q="text;html=1;strokeColor=none;fillColor=none;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontSize=14;fontColor=light-dark(#000000,#cccccc);align=center;verticalAlign=middle;",rt=11,ct=0;ct<e.blocks.length;ct++){var nt=e.blocks[ct],zt=r(S,D,null,mxUtils.htmlEntities(nt.label||""),nt.x,nt.y,nt.width,nt.height,At);h(S,zt,"n:bits:"+nt.startBit+"-"+nt.endBit);var Ot=nt.y-rt;if(nt.startBit===nt.endBit)r(S,D,null,String(nt.startBit),nt.x,Ot,nt.width,rt,U+"align=center;");else{var Ft=40;r(S,D,null,String(nt.startBit),nt.x,Ot,Ft,rt,U+"align=left;"),r(S,D,null,String(nt.endBit),nt.x+nt.width-Ft,Ot,Ft,rt,U+"align=right;")}}if(e.title){var Pt=32,Wt=e.canvasH-23-Pt/2;r(S,D,null,mxUtils.htmlEntities(e.title),0,Wt,e.canvasW,Pt,q)}return dt(S)}function kr(e,x,C,S,Y,D,At){var U=S+4,q=S*1.2,rt=(U-q)/2+S*.25,ct=e;Y==="middle"?ct=e-C/2:Y==="end"&&(ct=e-C);var nt;if(D==="hanging"?nt=x-rt:D==="middle"?nt=x-U/2:D==="alphabetic"?nt=x-U:nt=x,!At)return{x:ct,y:nt,width:C,height:U,rotation:0};var zt=At*Math.PI/180,Ot=Math.cos(zt),Ft=Math.sin(zt);function Pt(qt,ee){var Ut=qt-e,ve=ee-x;return{x:e+Ut*Ot-ve*Ft,y:x+Ut*Ft+ve*Ot}}var Wt=Pt(ct,nt),Kt=Pt(ct+C,nt),Bt=Pt(ct+C,nt+U),ce=Pt(ct,nt+U),kt=Math.min(Wt.x,Kt.x,Bt.x,ce.x),wt=Math.max(Wt.x,Kt.x,Bt.x,ce.x),jt=Math.min(Wt.y,Kt.y,Bt.y,ce.y),Ht=Math.max(Wt.y,Kt.y,Bt.y,ce.y);return{x:(kt+wt)/2-C/2,y:(jt+Ht)/2-U/2,width:C,height:U,rotation:At}}function pr(e,x,C,S,Y,D,At){var U=e;Y==="middle"?U=e-C/2:Y==="end"&&(U=e-C);var q=x;if(D==="middle"?q=x-S/2:D==="alphabetic"?q=x-S:D==="hanging"&&(q=x-7),!At)return{x:U,y:q,width:C,height:S,rotation:0};var rt=At*Math.PI/180,ct=Math.cos(rt),nt=Math.sin(rt);function zt(wt,jt){var Ht=wt-e,qt=jt-x;return{x:e+Ht*ct-qt*nt,y:x+Ht*nt+qt*ct}}var Ot=zt(U,q),Ft=zt(U+C,q),Pt=zt(U+C,q+S),Wt=zt(U,q+S),Kt=Math.min(Ot.x,Ft.x,Pt.x,Wt.x),Bt=Math.max(Ot.x,Ft.x,Pt.x,Wt.x),ce=Math.min(Ot.y,Ft.y,Pt.y,Wt.y),kt=Math.max(Ot.y,Ft.y,Pt.y,Wt.y);return{x:(Kt+Bt)/2-C/2,y:(ce+kt)/2-S/2,width:C,height:S,rotation:At}}function rr(e,x,C){for(var S=v(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily,rt=e.textColor,ct=e.borderColor,nt=0;nt<e.quadrants.length;nt++){var zt=e.quadrants[nt],Ot=r(S,U,null,"",zt.x,zt.y,zt.w,zt.h,"rounded=0;whiteSpace=wrap;html=1;fillColor="+zt.fill+";strokeColor=none;");h(S,Ot,"n:quadrant:"+nt)}var Ft=e.plotLeft,Pt=e.plotTop,Wt=e.plotRight,Kt=e.plotBottom,Bt=e.midX,ce=e.midY;r(S,U,null,"",Ft,Pt,Wt-Ft,Kt-Pt,"rounded=0;fillColor=none;strokeColor="+ct+";strokeWidth=2;html=1;"),r(S,U,null,"",Bt,Pt+1,1,Kt-Pt-2,"rounded=0;fillColor="+ct+";strokeColor=none;html=1;"),r(S,U,null,"",Ft+1,ce,Wt-Ft-2,1,"rounded=0;fillColor="+ct+";strokeColor=none;html=1;");for(var nt=0;nt<e.quadrants.length;nt++){var zt=e.quadrants[nt];if(zt.label){var kt=Math.max(zt.label.length*10+20,120),wt=kr(zt.labelCx,zt.labelCy,kt,16,"middle",zt.labelBaseline,0);r(S,U,null,mxUtils.htmlEntities(zt.label),wt.x,wt.y,wt.width,wt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+zt.color+";align=center;verticalAlign=middle;")}}for(var nt=0;nt<e.points.length;nt++){var jt=e.points[nt],Ht=jt.radius,qt="ellipse;fillColor="+jt.fill;jt.strokeWidth>0&&jt.stroke?qt+=";strokeColor="+jt.stroke+";strokeWidth="+jt.strokeWidth:qt+=";strokeColor=none;strokeWidth=0",qt+=";html=1;";var ee=r(S,U,null,"",jt.cx-Ht,jt.cy-Ht,2*Ht,2*Ht,qt);jt.name&&h(S,ee,"n:point:"+jt.name);var kt=Math.max(jt.name.length*8+20,60),wt=kr(jt.cx,jt.cy+5,kt,12,"middle","hanging",0);r(S,U,null,mxUtils.htmlEntities(jt.name),wt.x,wt.y,wt.width,wt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=12;fontColor="+rt+";align=center;verticalAlign=middle;")}for(var nt=0;nt<e.axisLabels.length;nt++){var Ut=e.axisLabels[nt];if(Ut.text){var kt=Math.max(Ut.text.length*10+20,120),wt=kr(Ut.anchorX,Ut.anchorY,kt,Ut.fontSize,Ut.textAnchor,Ut.baseline,Ut.rotation),ve=Ut.textAnchor==="middle"?"center":Ut.textAnchor==="end"?"right":"left",we="text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+Ut.fontSize+";fontColor="+rt+";align="+ve+";verticalAlign=middle;";wt.rotation&&(we+="rotation="+wt.rotation+";"),r(S,U,null,mxUtils.htmlEntities(Ut.text),wt.x,wt.y,wt.width,wt.height,we)}}if(e.title){var kt=400,wt=kr(Bt,10,kt,20,"middle","hanging",0);r(S,U,null,mxUtils.htmlEntities(e.title),wt.x,wt.y,wt.width,wt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=20;fontColor="+e.titleColor+";align=center;verticalAlign=middle;")}return dt(S)}function Pr(e,x,C){var S=v(),Y=S.getDefaultParent(),D=e.colors,At=e.fontFamily,U=e.nodeRadius;function q(Ir,Cr,Ea,xa,aa){var Gr=S.insertEdge(null,null,null,null,null,aa);return Gr.geometry.setTerminalPoint(new mxPoint(Math.round(Ir),Math.round(Cr)),!0),Gr.geometry.setTerminalPoint(new mxPoint(Math.round(Ea),Math.round(xa)),!1),Gr.geometry.relative=!0,Gr}function rt(Ir,Cr,Ea,xa,aa,Gr,ya,Br,pa,i){if(Ir==null||Ir==="")return null;var m=kr(Cr,Ea,xa,aa,Gr,ya,Br||0),k=Gr==="middle"?"center":Gr==="end"?"right":"left",R="text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize="+aa+";fontColor="+pa+";align="+k+";verticalAlign=middle;";return i&&(R+="fontStyle=1;"),m.rotation&&(R+="rotation="+m.rotation+";"),r(S,Y,null,mxUtils.htmlEntities(Ir),m.x,m.y,m.width,m.height,R)}var ct="endArrow=none;startArrow=none;html=1;rounded=0;strokeWidth=1;strokeColor="+D.axis+";";q(e.axisLeft,e.axisBottom,e.axisRight,e.axisBottom,ct),q(e.axisLeft,e.axisTop,e.axisLeft,e.axisBottom,ct);var nt=e.axisRight-e.axisLeft,zt=e.axisBottom-e.axisTop;rt(e.xLabel,e.axisLeft+nt/2,e.height-e.padding/4,200,12,"middle","alphabetic",0,D.axisText,!0),rt(e.yLabel,e.padding/3,e.axisTop+zt/2,200,12,"middle","alphabetic",-90,D.axisText,!0);for(var Ot=0;Ot<e.stageBands.length;Ot++){var Ft=e.stageBands[Ot];Ft.showBoundary&&q(Ft.boundaryX,e.axisTop,Ft.boundaryX,e.axisBottom,"endArrow=none;startArrow=none;html=1;rounded=0;strokeWidth=1;dashed=1;dashPattern=5 5;opacity=80;strokeColor="+D.axis+";"),rt(Ft.label,Ft.centerX,Ft.labelY,160,10,"middle","alphabetic",0,D.axisText,!1)}for(var Pt=0;Pt<e.pipelines.length;Pt++){var Wt=e.pipelines[Pt];r(S,Y,null,"",Wt.boxX,Wt.boxY,Wt.boxW,Wt.boxH,"rounded=1;arcSize=8;html=1;fillColor=none;strokeColor="+D.axis+";strokeWidth=1.5;");for(var Kt=0;Kt<Wt.links.length;Kt++){var Bt=Wt.links[Kt];q(Bt.x1,Bt.y1,Bt.x2,Bt.y2,"endArrow=none;startArrow=none;html=1;rounded=0;strokeWidth=1;dashed=1;dashPattern=4 4;strokeColor="+D.link+";")}}for(var ce={},kt=0;kt<e.nodes.length;kt++){var wt=e.nodes[kt],jt;if(wt.kind==="anchor")jt=r(S,Y,null,"",wt.cx-U,wt.cy-U,2*U,2*U,"ellipse;html=1;fillColor=none;strokeColor=none;");else if(wt.isPipelineParent){var Ht=wt.radius*2;jt=r(S,Y,null,"",wt.cx-wt.radius,wt.cy-wt.radius,Ht,Ht,"rounded=0;html=1;fillColor="+D.componentFill+";strokeColor="+D.componentStroke+";strokeWidth=1;")}else if(wt.strategy){var qt=U*2,ee=qt*2;if(wt.strategy==="market"){jt=r(S,Y,null,"",wt.cx-qt,wt.cy-qt,ee,ee,"ellipse;html=1;fillColor=#ffffff;strokeColor="+D.componentStroke+";strokeWidth=1;");var Ut=U*1.2,ve=Math.cos(Math.PI/6),we=Math.sin(Math.PI/6),Se={x:wt.cx,y:wt.cy-Ut},be={x:wt.cx-Ut*ve,y:wt.cy+Ut*we},Me={x:wt.cx+Ut*ve,y:wt.cy+Ut*we},Fe="endArrow=none;startArrow=none;html=1;rounded=0;strokeWidth=1;strokeColor="+D.componentStroke+";";q(Se.x,Se.y,be.x,be.y,Fe),q(be.x,be.y,Me.x,Me.y,Fe),q(Me.x,Me.y,Se.x,Se.y,Fe);for(var Ue=U*.7,De=[Se,be,Me],Ye=0;Ye<De.length;Ye++)r(S,Y,null,"",De[Ye].x-Ue,De[Ye].y-Ue,Ue*2,Ue*2,"ellipse;html=1;fillColor=#ffffff;strokeColor="+D.componentStroke+";strokeWidth=2;")}else{var Pe=wt.strategy==="build"?"#eeeeee":wt.strategy==="buy"?"#cccccc":"#666666",de=wt.strategy==="build"?"#000000":D.componentStroke;jt=r(S,Y,null,"",wt.cx-qt,wt.cy-qt,ee,ee,"ellipse;html=1;fillColor="+Pe+";strokeColor="+de+";strokeWidth=1;centerRadius="+U+";centerColor=#ffffff;centerStroke=1;")}}else jt=r(S,Y,null,"",wt.cx-U,wt.cy-U,2*U,2*U,"ellipse;html=1;fillColor="+D.componentFill+";strokeColor="+D.componentStroke+";strokeWidth=1;");if(h(S,jt,"n:"+wt.kind+":"+wt.id),ce[wt.id]=jt,wt.inertia){var Ve=wt.cx+wt.radius+15;r(S,Y,null,"",Ve-3,wt.cy-wt.radius,6,2*wt.radius,"rounded=0;html=1;fillColor="+D.componentStroke+";strokeColor=none;")}}for(var Ne=0;Ne<e.links.length;Ne++){var nr=e.links[Ne],Ge=ce[nr.from],Ie=ce[nr.to];if(!(!Ge||!Ie)){var Ce=nr.flow==="backward"||nr.flow==="bidirectional"?"block":"none",Ke=nr.flow==="forward"||nr.flow==="bidirectional"?"block":"none",We="edgeStyle=none;html=1;rounded=0;strokeWidth=1;strokeColor="+D.link+";startArrow="+Ce+";endArrow="+Ke+";startFill=1;endFill=1;";nr.dashed&&(We+="dashed=1;dashPattern=6 6;"),nr.flow&&(We+="fontSize=10;fontColor="+D.axisText+";"),S.insertEdge(Y,null,nr.label?mxUtils.htmlEntities(nr.label):null,Ge,Ie,We)}}for(var le=0;le<e.trends.length;le++){var Ut=e.trends[le],Ae=Ut.targetX-Ut.cx,Le=Ut.targetY-Ut.cy,Re=Math.sqrt(Ae*Ae+Le*Le)||1,Be=Ut.cx+Ae/Re*(U+1),je=Ut.cy+Le/Re*(U+1),ie=Ut.targetX-Ae/Re*(U+2),fr=Ut.targetY-Le/Re*(U+2);q(Be,je,ie,fr,"endArrow=block;startArrow=none;endFill=1;html=1;rounded=0;strokeWidth=1;dashed=1;dashPattern=4 4;strokeColor="+D.evolution+";")}for(var Ar=0;Ar<e.nodes.length;Ar++){var Lr=e.nodes[Ar],Ze=Math.max(Lr.name.length*6+10,40);rt(Lr.name,Lr.labelX,Lr.labelY,Ze,10,Lr.labelAnchor,Lr.labelBaseline,0,D.labelColor,Lr.labelBold)}for(var dr=0;dr<e.notes.length;dr++){var Xe=e.notes[dr],br=Math.max(Xe.text.length*7+10,40);rt(Xe.text,Xe.x+br/2,Xe.y,br,11,"middle","middle",0,D.axisText,!0)}for(var vr=0;vr<e.annotations.length;vr++){var gr=e.annotations[vr];r(S,Y,null,"",gr.x-10,gr.y-10,20,20,"ellipse;html=1;fillColor=#ffffff;strokeColor="+D.axis+";strokeWidth=1.5;"),rt(String(gr.number),gr.x,gr.y,20,10,"middle","middle",0,D.axisText,!0)}for(var fa=0;fa<e.accelerators.length;fa++){var Je=e.accelerators[fa],$e=60,Qr=30,$r="shape=singleArrow;html=1;arrowWidth=0.5;arrowSize=0.33;fillColor=#ffffff;strokeColor="+D.componentStroke+";strokeWidth=1;"+(Je.decel?"direction=west;":"direction=east;");r(S,Y,null,"",Je.x-$e/2,Je.y-Qr/2,$e,Qr,$r),rt(Je.name,Je.x,Je.y+Qr/2+8,Math.max(Je.name.length*7+10,60),10,"middle","middle",0,D.axisText,!0)}return e.title&&rt(e.title,e.width/2,e.padding/2,400,13,"middle","middle",0,D.axisText,!0),dt(S)}function ta(e,x,C){for(var S=v(),Y=S.getDefaultParent(),D=e.fontFamily,At=0;At<e.swimlanes.length;At++){var U=e.swimlanes[At];r(S,Y,null,"",U.x,U.y,U.width,U.height,"rounded=1;arcSize=2;html=1;fillColor="+e.swimlaneBg+";strokeColor="+e.swimlaneStroke+";");var q=kr(U.labelX,U.labelY,240,16,"start","alphabetic",0);r(S,Y,null,mxUtils.htmlEntities(U.label),q.x,q.y,q.width,q.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+D+";fontSize=16;fontStyle=1;fontColor=#333333;align=left;verticalAlign=middle;")}for(var rt=0;rt<e.boxes.length;rt++){var ct=e.boxes[rt],nt=r(S,Y,null,ct.content,ct.x,ct.y,ct.width,ct.height,"rounded=1;arcSize=4;html=1;whiteSpace=wrap;fillColor="+ct.fill+";strokeColor="+ct.stroke+";fontFamily="+D+";fontSize=16;fontColor=#333333;align=center;verticalAlign=middle;");h(S,nt,"n:frame:"+ct.frameName)}for(var zt=0;zt<e.relations.length;zt++){var Ot=e.relations[zt],Ft=S.insertEdge(Y,null,null,null,null,"edgeStyle=none;html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;strokeWidth=1;strokeColor="+e.relationStroke+";");Ft.geometry.setTerminalPoint(new mxPoint(Math.round(Ot.x1),Math.round(Ot.y1)),!0),Ft.geometry.setTerminalPoint(new mxPoint(Math.round(Ot.x2),Math.round(Ot.y2)),!1),Ft.geometry.relative=!0}return dt(S)}var wr={default:[{fill:"#8686ff",text:"#ffffff",line:"#ffffb9"},{fill:"#ffff78",text:"#333333",line:"#ababff"},{fill:"#d7ff86",text:"#333333",line:"#d0b9ff"},{fill:"#c286ff",text:"#ffffff",line:"#dcffb9"},{fill:"#ff86ff",text:"#333333",line:"#b9ffb9"},{fill:"#ff86c2",text:"#333333",line:"#b9ffdc"},{fill:"#ff8686",text:"#333333",line:"#b9ffff"},{fill:"#ffc286",text:"#333333",line:"#b9dcff"},{fill:"#c2ff86",text:"#333333",line:"#dcb9ff"},{fill:"#86ffc2",text:"#333333",line:"#ffb9dc"},{fill:"#86ffff",text:"#333333",line:"#ffb9b9"},{fill:"#86c2ff",text:"#333333",line:"#ffdcb9"}],base:[{fill:"#ffcb5d",text:"#333333",line:"#0034a2"},{fill:"#cb5dff",text:"#333333",line:"#34a200"},{fill:"#77a3ff",text:"#333333",line:"#885c00"},{fill:"#e3ff5d",text:"#333333",line:"#1c00a2"},{fill:"#92ff5d",text:"#333333",line:"#6d00a2"},{fill:"#5dff7a",text:"#333333",line:"#a20085"},{fill:"#5dffcb",text:"#333333",line:"#a20034"},{fill:"#5de3ff",text:"#333333",line:"#a21c00"},{fill:"#9680ff",text:"#333333",line:"#697f00"},{fill:"#ff5de3",text:"#333333",line:"#00a21c"},{fill:"#ff5d92",text:"#333333",line:"#00a26d"},{fill:"#ff7a5d",text:"#333333",line:"#0085a2"}],neutral:[{fill:"#555555",text:"#F4F4F4",line:"#aaaaaa"},{fill:"#F4F4F4",text:"#333333",line:"#0b0b0b"},{fill:"#555555",text:"#F4F4F4",line:"#aaaaaa"},{fill:"#BBBBBB",text:"#333333",line:"#444444"},{fill:"#777777",text:"#333333",line:"#888888"},{fill:"#999999",text:"#333333",line:"#666666"},{fill:"#DDDDDD",text:"#333333",line:"#222222"},{fill:"#FFFFFF",text:"#333333",line:"#000000"},{fill:"#DDDDDD",text:"#333333",line:"#222222"},{fill:"#BBBBBB",text:"#333333",line:"#444444"},{fill:"#999999",text:"#333333",line:"#666666"},{fill:"#777777",text:"#333333",line:"#888888"}],dark:[{fill:"#1f2020",text:"#d3d3d3",line:"#e0dfdf"},{fill:"#0b0000",text:"#d3d3d3",line:"#f4ffff"},{fill:"#4d1037",text:"#d3d3d3",line:"#b2efc8"},{fill:"#3f5258",text:"#d3d3d3",line:"#c0ada7"},{fill:"#4f2f1b",text:"#d3d3d3",line:"#b0d0e4"},{fill:"#6e0a0a",text:"#d3d3d3",line:"#91f5f5"},{fill:"#3b0048",text:"#d3d3d3",line:"#c4ffb7"},{fill:"#995a01",text:"#d3d3d3",line:"#66a5fe"},{fill:"#154706",text:"#d3d3d3",line:"#eab8f9"},{fill:"#161722",text:"#d3d3d3",line:"#e9e8dd"},{fill:"#00296f",text:"#d3d3d3",line:"#ffd690"},{fill:"#01629c",text:"#d3d3d3",line:"#fe9d63"}],forest:[{fill:"#b9d970",text:"#333333",line:"#9070d9"},{fill:"#acff7f",text:"#333333",line:"#d27fff"},{fill:"#cde498",text:"#333333",line:"#af98e4"},{fill:"#84d970",text:"#333333",line:"#c570d9"},{fill:"#70d990",text:"#333333",line:"#d970b9"},{fill:"#70d9c5",text:"#333333",line:"#d97084"},{fill:"#70b9d9",text:"#333333",line:"#d99070"},{fill:"#7084d9",text:"#333333",line:"#d9c570"},{fill:"#c570d9",text:"#333333",line:"#84d970"},{fill:"#d97084",text:"#333333",line:"#70d9c5"},{fill:"#d99070",text:"#333333",line:"#70b9d9"},{fill:"#d9c570",text:"#333333",line:"#7084d9"}]},Sa={default:"#333333",base:"#333333",neutral:"#000000",dark:"#cccccc",forest:"#000000"},ca={default:"#000000",base:"#333333",neutral:"#333333",dark:"#d3d3d3",forest:"#000000"};function ba(e){var x=e&&e.theme||"default",C=e&&e.themeVariables||{};return C.lineColor||ca[x]||"#000000"}function ra(e){for(var x=e&&e.theme||"default",C=wr[x]||wr.default,S=e&&e.themeVariables||{},Y=[],D=0;D<C.length;D++)Y.push({fill:S["cScale"+D]||C[D].fill,text:S["cScaleLabel"+D]||C[D].text,line:S["cScaleInv"+D]||C[D].line});return Y}function Dr(e){var x=e&&e.theme||"default",C=e&&e.themeVariables||{};return C.titleColor||C.textColor||Sa[x]||"#333333"}function la(e,x){var C=x||wr.default,S=((e+1)%C.length+C.length)%C.length;return C[S]}var qr=wr.default;function ma(e,x){if(!e||e.charAt(0)!=="#"||e.length!==7)return e;var C=parseInt(e.substring(1,3),16),S=parseInt(e.substring(3,5),16),Y=parseInt(e.substring(5,7),16),D=Math.min(255,Math.round(C*x)),At=Math.min(255,Math.round(S*x)),U=Math.min(255,Math.round(Y*x));return"#"+("0"+D.toString(16)).slice(-2)+("0"+At.toString(16)).slice(-2)+("0"+U.toString(16)).slice(-2)}function Ja(e,x,C){if(e.vertical)return fn(e,x,C);for(var S=v(),Y=e.canvasW,D=e.canvasH,At=e.palette||ra(x),U=S.getDefaultParent(),q=e.fontFamily,rt=Dr(x),ct=ba(x),nt=0;nt<e.columns.length;nt++){var zt=e.columns[nt],Ot=la(zt.colorIdx,At),Ft=r(S,U,null,"",zt.x,e.taskRowY,e.cardWidth,e.cardHeight,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+Ot.fill+";strokeColor=none;");h(S,Ft,"n:task:"+nt),r(S,U,null,"",zt.x,e.taskRowY+e.cardHeight,e.cardWidth,3,"rounded=0;fillColor="+Ot.line+";strokeColor=none;html=1;"),r(S,U,null,sn(zt.period.name),zt.x,e.taskRowY,e.cardWidth,e.cardHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+Ot.text+";align=center;verticalAlign=top;whiteSpace=wrap;spacingLeft=20;spacingRight=20;spacingTop=10;")}for(var nt=0;nt<e.columns.length;nt++){var zt=e.columns[nt],Pt=e.taskRowY+e.cardHeight,Wt=S.insertEdge(U,null,"",null,null,"endArrow=blockThin;html=1;strokeColor="+ct+";strokeWidth=2;dashed=1;dashPattern=5 5;fixDash=1;fontSize=12;");Wt.geometry.setTerminalPoint(new mxPoint(zt.centerX,Pt),!0),Wt.geometry.setTerminalPoint(new mxPoint(zt.centerX,e.vertArrowBot),!1)}for(var nt=0;nt<e.columns.length;nt++)for(var zt=e.columns[nt],Ot=la(zt.colorIdx,At),Kt=ma(Ot.fill,1.2),Bt=ma(Ot.line,1.2),ce=0;ce<zt.events.length;ce++){var kt=zt.eventYs&&zt.eventYs[ce]!=null?zt.eventYs[ce]:e.firstEventY+ce*e.eventPitch,wt=zt.eventHeights&&zt.eventHeights[ce]!=null?zt.eventHeights[ce]:e.eventHeight,jt=r(S,U,null,"",zt.x,kt,e.eventWidth,wt,"rounded=1;arcSize=10;whiteSpace=wrap;html=1;fillColor="+Kt+";strokeColor=none;");h(S,jt,"n:event:"+nt+":"+ce),r(S,U,null,"",zt.x,kt+wt,e.eventWidth,3,"rounded=0;fillColor="+Bt+";strokeColor=none;html=1;"),r(S,U,null,sn(zt.events[ce]),zt.x,kt,e.eventWidth,wt,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+Ot.text+";align=center;verticalAlign=middle;whiteSpace=wrap;spacingLeft=20;spacingRight=20;")}for(var nt=0;nt<e.sectionRects.length;nt++){var Ht=e.sectionRects[nt],Ot=la(Ht.colorIdx,At),qt=r(S,U,null,"",Ht.x,Ht.y,Ht.width,Ht.height,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+Ot.fill+";strokeColor=none;");h(S,qt,"n:section:"+nt),r(S,U,null,"",Ht.x,Ht.y+Ht.height,Ht.width,3,"rounded=0;fillColor="+Ot.line+";strokeColor=none;html=1;"),r(S,U,null,sn(Ht.name),Ht.x,Ht.y,Ht.width,Ht.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+Ot.text+";align=center;verticalAlign=top;whiteSpace=wrap;spacingLeft=20;spacingRight=20;spacingTop=10;")}var ee=S.insertEdge(U,null,"",null,null,"endArrow=blockThin;html=1;strokeColor="+ct+";strokeWidth=4;exitX=0;exitY=0;entryX=1;entryY=1;fontSize=12;");if(ee.geometry.setTerminalPoint(new mxPoint(e.horizArrowX1,e.arrowY),!0),ee.geometry.setTerminalPoint(new mxPoint(e.horizArrowX2,e.arrowY),!1),e.title){var Ut=Math.max(e.title.length*18+40,400);r(S,U,null,mxUtils.htmlEntities(e.title),e.titleX,e.titleY,Ut,40,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=34;fontStyle=1;fontColor="+rt+";align=left;verticalAlign=middle;spacingLeft=0;")}return dt(S)}function sn(e){return e==null?"":mxUtils.htmlEntities(String(e).replace(/<br\s*\/?>/gi,"\0BR\0")).replace(/\x00BR\x00/g,"<br>")}function fn(e,x,C){var S=v(),Y=e.canvasW,D=e.canvasH,At=e.palette||ra(x),U=S.getDefaultParent(),q=e.fontFamily,rt=Dr(x),ct=ba(x),nt=4,zt=24,Ot=16,Ft=e.timelineX-nt/2,Pt=e.arrowY1,Wt=e.arrowY2-Ot+1;r(S,U,null,"",Ft,Pt,nt,Wt-Pt,"rounded=0;fillColor="+ct+";strokeColor=none;html=1;"),r(S,U,null,"",e.timelineX-zt/2,e.arrowY2-Ot,zt,Ot,"shape=triangle;direction=south;fillColor="+ct+";strokeColor="+ct+";html=1;");for(var Kt=0;Kt<e.rows.length;Kt++){var Bt=e.rows[Kt],ce=la(Bt.colorIdx,At),kt=ma(ce.fill,1.2),wt=ma(ce.line,1.2),jt=r(S,U,null,"",Bt.taskX,Bt.taskY,Bt.taskWidth,Bt.taskHeight,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+ce.fill+";strokeColor=none;");h(S,jt,"n:task:"+Kt),r(S,U,null,"",Bt.taskX,Bt.taskY+Bt.taskHeight,Bt.taskWidth,3,"rounded=0;fillColor="+ce.line+";strokeColor=none;html=1;"),r(S,U,null,sn(Bt.taskName),Bt.taskX,Bt.taskY,Bt.taskWidth,Bt.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ce.text+";align=center;verticalAlign=top;whiteSpace=wrap;spacingLeft=5;spacingRight=5;spacingTop=2;");for(var Ht=0;Ht<Bt.events.length;Ht++){var qt=Bt.events[Ht],ee=S.insertEdge(U,null,"",null,null,"endArrow=none;startArrow=none;html=1;strokeColor="+ct+";strokeWidth=2;dashed=1;dashPattern=5 5;fixDash=1;fontSize=12;");ee.geometry.setTerminalPoint(new mxPoint(e.timelineX,qt.lineY),!0),ee.geometry.setTerminalPoint(new mxPoint(qt.x,qt.lineY),!1);var Ut=r(S,U,null,"",qt.x,qt.y,qt.width,qt.height,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+kt+";strokeColor=none;");h(S,Ut,"n:event:"+Kt+":"+Ht),r(S,U,null,"",qt.x,qt.y+qt.height,qt.width,3,"rounded=0;fillColor="+wt+";strokeColor=none;html=1;"),r(S,U,null,sn(qt.text),qt.x,qt.y,qt.width,qt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ce.text+";align=center;verticalAlign=top;whiteSpace=wrap;spacingLeft=5;spacingRight=5;spacingTop=2;")}}for(var Kt=0;Kt<e.sectionRects.length;Kt++){var ve=e.sectionRects[Kt],ce=la(ve.colorIdx,At),we=r(S,U,null,"",ve.x,ve.y,ve.width,ve.height,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+ce.fill+";strokeColor=none;");h(S,we,"n:section:"+Kt),r(S,U,null,"",ve.x,ve.y+ve.height,ve.width,3,"rounded=0;fillColor="+ce.line+";strokeColor=none;html=1;"),r(S,U,null,sn(ve.name),ve.x,ve.y,ve.width,ve.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ce.text+";align=center;verticalAlign=middle;whiteSpace=wrap;spacingLeft=5;spacingRight=5;")}if(e.title){var Se=Math.max(e.title.length*18+40,400);r(S,U,null,mxUtils.htmlEntities(e.title),e.titleX,e.titleY,Se,40,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=34;fontStyle=1;fontColor="+rt+";align=left;verticalAlign=middle;spacingLeft=0;")}return dt(S)}var Na=[null,{fill:"#ffffab",text:"#333333"},{fill:"#e8ffb9",text:"#333333"},{fill:"#dcb9ff",text:"#ffffff"},{fill:"#ffb9ff",text:"#333333"},{fill:"#ffb9dc",text:"#333333"},{fill:"#ffb9b9",text:"#333333"},{fill:"#ffdcb9",text:"#333333"},{fill:"#dcffb9",text:"#333333"},{fill:"#b9ffdc",text:"#333333"},{fill:"#b9ffff",text:"#333333"}],Cn={"very high":"#ff0000",high:"#ffa500",low:"#0000ff","very low":"#add8e6"};function Mn(e){var x=((e-1)%(Na.length-1)+(Na.length-1))%(Na.length-1)+1;return Na[x]}function nn(e,x,C){for(var S=v(),Y=S.getDefaultParent(),D=e.fontFamily,At=25,U=10,q=5,rt=0;rt<e.columns.length;rt++){var ct=e.columns[rt],nt=Mn(ct.colorIdx),zt=r(S,Y,null,mxUtils.htmlEntities(ct.label),ct.x,ct.y,ct.width,ct.height,"swimlane;startSize="+At+";swimlaneLine=0;rounded=1;absoluteArcSize=1;arcSize=10;html=1;fillColor="+nt.fill+";swimlaneFillColor="+nt.fill+";strokeColor="+nt.fill+";strokeWidth=1;fontFamily="+D+";fontSize=16;fontStyle=0;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;container=1;collapsible=0;childLayout=stackLayout;horizontalStack=0;resizeParent=0;resizeParentMax=0;resizeLast=0;marginTop=0;marginBottom="+U+";marginLeft=7.5;marginRight=7.5;stackSpacing="+q+";");h(S,zt,"n:column:"+(ct.id||"idx"+rt));for(var Ot=0;Ot<ct.cards.length;Ot++){var Ft=ct.cards[Ot],Pt=Ft.metadata||{},Wt=(ct.width-e.cardWidth)/2,Kt=Ft.top,Bt=r(S,zt,null,"",Wt,Kt,e.cardWidth,Ft.height,"rounded=1;absoluteArcSize=1;arcSize=10;whiteSpace=wrap;html=1;fillColor=light-dark(#FFFFFF,#1f2020);strokeColor=#9370DB;strokeWidth=1;container=1;collapsible=0;");if(h(S,Bt,"n:card:"+(Ft.id||(ct.id||"idx"+rt)+":"+Ot)),Pt.priority){var ce=Cn[Pt.priority.toLowerCase()];ce&&r(S,Bt,null,"",0,2,4,Ft.height-4,"rounded=0;fillColor="+ce+";strokeColor="+ce+";")}var kt=Ft.titleH||24,wt=Ft.hasMeta?4:10,jt='<div style="line-height:1.5;">'+mxUtils.htmlEntities(Ft.label)+"</div>";if(r(S,Bt,null,jt,10,wt,175,kt,"text;html=1;strokeColor=none;fillColor=none;whiteSpace=wrap;fontFamily="+D+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;spacing=0;"),Pt.ticket){var Ht=e.ticketBaseUrl?e.ticketBaseUrl.replace("#TICKET#",Pt.ticket):null,qt=r(S,Bt,null,mxUtils.htmlEntities(Pt.ticket),10,Ft.height-28,(e.cardWidth-20)/2,24,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+D+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;spacing=0;"+(Ht?"fontStyle=4;":""));if(Ht){var ee=M(Ht);ee&&S.setAttributeForCell(qt,"link",ee)}}if(Pt.assigned){var Ut=Ft.assignedW||40;r(S,Bt,null,mxUtils.htmlEntities(Pt.assigned),e.cardWidth-10-Ut,Ft.height-28,Ut+2,24,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+D+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;spacing=0;")}}}return dt(S)}var An=["#ECECFF","#8493A6","#FF8A65","#81C784","#BA68C8","#FFD54F"];function dn(e,x){var C=An,S=x&&x.themeVariables&&x.themeVariables.xyChart&&x.themeVariables.xyChart.plotColorPalette;return typeof S=="string"&&S.length>0&&(C=S.split(",").map(function(Y){return Y.trim()}).filter(function(Y){return Y.length>0})),C[e%C.length]}function Ln(e,x,C){var S=v(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily,rt="light-dark(#131300,#e0dfdf)",ct="light-dark(#131300,#e0dfdf)",nt=x&&x.themeVariables&&x.themeVariables.xyChart||{},zt=nt.titleColor||ct;if(r(S,U,null,"",0,0,D,At,"rounded=0;fillColor=light-dark(#FFFFFF,#333333);strokeColor=none;"),e.title){var Ot=600,Ft=pr(D/2,e.titleY,Ot,28,"middle","middle",0);r(S,U,null,mxUtils.htmlEntities(e.title),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=20;fontColor="+zt+";align=center;verticalAlign=middle;")}for(var Pt=0;Pt<e.series.length;Pt++){var Wt=e.series[Pt];if(Wt.type==="bar")for(var Kt=dn(Wt.colorIdx,x),Bt=0;Bt<Wt.points.length;Bt++){var ce=Wt.points[Bt],kt=e.tickBot-ce.y;if(!(kt<=0)){var wt=r(S,U,null,"",ce.x-e.barWidth/2,ce.y,e.barWidth,kt,"rounded=0;fillColor="+Kt+";strokeColor=none;");h(S,wt,"n:bar:"+Pt+":"+Bt)}}else if(Wt.type==="line"&&Wt.points.length>=2){var jt=dn(Wt.colorIdx,x),Ht=Wt.points,qt=S.insertEdge(U,null,"",null,null,"endArrow=none;html=1;rounded=0;strokeColor="+jt+";strokeWidth=2;");h(S,qt,"n:line:"+Pt),qt.geometry.setTerminalPoint(new mxPoint(Ht[0].x,Ht[0].y),!0),qt.geometry.setTerminalPoint(new mxPoint(Ht[Ht.length-1].x,Ht[Ht.length-1].y),!1),qt.geometry.points=[];for(var Bt=1;Bt<Ht.length-1;Bt++)qt.geometry.points.push(new mxPoint(Ht[Bt].x,Ht[Bt].y))}}r(S,U,null,"",e.plotLeft-1,e.plotTop,2,e.tickBot-e.plotTop,"rounded=0;fillColor="+rt+";strokeColor=none;"),r(S,U,null,"",e.plotLeft-1,e.tickBot-1,D-e.plotLeft,2,"rounded=0;fillColor="+rt+";strokeColor=none;");for(var Pt=0;Pt<e.yTicks.length;Pt++){var ee=e.yTicks[Pt];r(S,U,null,"",e.plotLeft-6,ee.y-1,5,2,"rounded=0;fillColor="+rt+";strokeColor=none;");var Ft=pr(e.plotLeft-11,ee.y,60,18,"end","middle",0);r(S,U,null,mxUtils.htmlEntities(Fn(ee.value)),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=14;fontColor="+ct+";align=right;verticalAlign=middle;")}if(e.yAxis&&e.yAxis.title){var Ft=pr(5,(e.plotTop+e.plotBot)/2,200,20,"middle","hanging",-90);r(S,U,null,mxUtils.htmlEntities(e.yAxis.title),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ct+";align=center;verticalAlign=top;rotation=-90;")}var Ut=60;e.xCenters.length>1&&(Ut=Math.max(60,Math.min(120,Math.floor(e.xCenters[1]-e.xCenters[0])-4)));for(var Pt=0;Pt<e.xCenters.length;Pt++){var ve=e.xCenters[Pt],we=e.xLabels[Pt];r(S,U,null,"",ve-1,e.tickBot+1,2,5,"rounded=0;fillColor="+rt+";strokeColor=none;");var Ft=pr(ve,e.tickBot+11,Ut,18,"middle","hanging",0);r(S,U,null,mxUtils.htmlEntities(we),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=14;fontColor="+ct+";align=center;verticalAlign=top;")}if(e.xAxisTitle){var Se=(e.plotLeft+e.plotRight)/2,Ft=pr(Se,e.plotBot+37,300,20,"middle","hanging",0);r(S,U,null,mxUtils.htmlEntities(e.xAxisTitle),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ct+";align=center;verticalAlign=top;")}if(e.showDataLabel)for(var Pt=0;Pt<e.series.length;Pt++){var Wt=e.series[Pt];if(Wt.type==="bar")for(var Bt=0;Bt<Wt.points.length;Bt++){var be=Wt.points[Bt],Me=Fn(be.value),Fe=Math.max(1,Me.length),Ue=e.barWidth||50,De=Math.max(8,Math.min(25,Math.floor(Ue*.85/Fe))),Ye=ct,Pe=50,de=be.y+1,Ve="top",kt=e.tickBot-be.y;(e.showDataLabelOutsideBar||kt<De+4)&&(de=be.y-De-6,Ve="middle"),r(S,U,null,Me,be.x-Pe/2,de,Pe,De+4,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+De+";fontColor="+Ye+";align=center;verticalAlign="+Ve+";")}}return dt(S)}function Fn(e){return Math.abs(e-Math.round(e))<1e-6?String(Math.round(e)):String(Math.round(e*100)/100)}var g=["#8686ff","#ffff78","#d7ff86","#c286ff","#ff86ff","#ff86c2","#ff8686","#ffc286"];function tt(e){return g[e%g.length]}function B(e,x){var C=e.length;if(C<2)return"";for(var S=typeof x=="number"?x:.17,Y="M"+e[0].x.toFixed(3)+","+e[0].y.toFixed(3),D=0;D<C;D++){var At=e[(D-1+C)%C],U=e[D],q=e[(D+1)%C],rt=e[(D+2)%C],ct=U.x+(q.x-At.x)*S,nt=U.y+(q.y-At.y)*S,zt=q.x-(rt.x-U.x)*S,Ot=q.y-(rt.y-U.y)*S;Y+=" C"+ct.toFixed(3)+","+nt.toFixed(3)+" "+zt.toFixed(3)+","+Ot.toFixed(3)+" "+q.x.toFixed(3)+","+q.y.toFixed(3)}return Y+" Z"}function K(e,x,C){for(var S=v(),Y=S.getDefaultParent(),D=S.getDefaultParent(),At=e.fontFamily,U=e.centerX,q=e.centerY,rt=e.graticule==="polygon",ct=e.ringRadii.length-1;ct>=0;ct--){var nt=e.ringRadii[ct];if(rt){for(var zt=[],Ot=0;Ot<e.n;Ot++){var Ft=e.angles[Ot];zt.push({x:nt+nt*Math.cos(Ft),y:nt+nt*Math.sin(Ft)})}var Pt=zt.map(function(le){return le.x+","+le.y}).join(" "),Wt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+2*nt+" "+2*nt+'"><polygon points="'+Pt+'" fill="#DEDEDE" fill-opacity="0.3" stroke="#DEDEDE" stroke-width="1"/></svg>',Kt=typeof btoa=="function"?btoa(unescape(encodeURIComponent(Wt))):mxUtils.toBase64(Wt);r(S,D,null,"",U-nt,q-nt,2*nt,2*nt,"shape=image;html=1;imageAspect=0;image=data:image/svg+xml,"+Kt+";")}else r(S,D,null,"",U-nt,q-nt,2*nt,2*nt,"ellipse;fillColor=#DEDEDE;opacity=30;strokeColor=#DEDEDE;strokeWidth=1;")}for(var ct=0;ct<e.axes.length;ct++){var Bt=e.axes[ct],ce=S.insertEdge(D,null,"",null,null,"endArrow=none;html=1;strokeColor=light-dark(#333333,#cccccc);strokeWidth=2;");ce.geometry.setTerminalPoint(new mxPoint(U,q),!0),ce.geometry.setTerminalPoint(new mxPoint(U+Bt.tipX,q+Bt.tipY),!1)}for(var ct=0;ct<e.axes.length;ct++){var Bt=e.axes[ct];if(Bt.label){var kt=80,wt=18,jt=Math.cos(Bt.angle),Ht=Math.sin(Bt.angle),qt=U+Bt.labelX,ee=q+Bt.labelY,Ut,ve;jt>.01?(ve="left",Ut=qt):jt<-.01?(ve="right",Ut=qt-kt):(ve="center",Ut=qt-kt/2);var we;Ht<-.01?we=ee-4:Ht>.01?we=ee+5:we=ee,r(S,D,null,mxUtils.htmlEntities(Bt.label),Ut,we-wt/2-7,kt,wt,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=12;fontColor=light-dark(#333333,#cccccc);align="+ve+";verticalAlign=middle;")}}for(var Se=10,be=2*e.outerR+2*Se,Me=U-e.outerR-Se,Fe=q-e.outerR-Se,Ue=e.graticule==="polygon",De=e.curveOpacity!=null?e.curveOpacity:.5,ct=0;ct<e.curves.length;ct++){var Ye=e.curves[ct];if(!(Ye.points.length<2)){for(var Pe=e.cScaleColors&&e.cScaleColors[Ye.colorIdx]||tt(Ye.colorIdx),de=[],Ot=0;Ot<Ye.points.length;Ot++)de.push({x:Ye.points[Ot].x+e.outerR+Se,y:Ye.points[Ot].y+e.outerR+Se});var Ve;Ue?Ve="M"+de.map(function(Le){return Le.x+","+Le.y}).join("L")+"Z":Ve=B(de,e.curveTension);var Wt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+be+" "+be+'"><path d="'+Ve+'" fill="'+Pe+'" fill-opacity="'+De+'" stroke="'+Pe+'" stroke-width="2"/></svg>',Ne=typeof btoa=="function"?btoa(unescape(encodeURIComponent(Wt))):mxUtils.toBase64(Wt),nr=r(S,D,null,"",Me,Fe,be,be,"shape=image;html=1;imageAspect=0;image=data:image/svg+xml,"+Ne+";");h(S,nr,"n:curve:"+(Ye.label||"idx"+ct))}}for(var Ge=U+263,Ie=q-263,ct=0;ct<e.curves.length;ct++){var Ye=e.curves[ct],Pe=e.cScaleColors&&e.cScaleColors[Ye.colorIdx]||tt(Ye.colorIdx),Ce=Ie+ct*20,Ke=Math.round(De*100);r(S,D,null,"",Ge,Ce,12,12,"rounded=0;fillColor="+Pe+";strokeColor="+Pe+";fillOpacity="+Ke+";"),r(S,D,null,mxUtils.htmlEntities(Ye.label),Ge+16,Ce-2,80,16,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=12;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}if(e.title){var We='<div style="position:relative;top:-12px;">'+mxUtils.htmlEntities(e.title)+"</div>";r(S,D,null,We,U-200,0,400,20,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=top;")}return dt(S)}var H={person:{fill:"#08427B",stroke:"#073B6F",text:"#FFFFFF"},person_ext:{fill:"#686868",stroke:"#8A8A8A",text:"#FFFFFF"},system:{fill:"#1168BD",stroke:"#3C7FC0",text:"#FFFFFF"},system_ext:{fill:"#999999",stroke:"#8A8A8A",text:"#FFFFFF"},container:{fill:"#438DD5",stroke:"#3C7FC0",text:"#FFFFFF"},container_ext:{fill:"#B3B3B3",stroke:"#8A8A8A",text:"#FFFFFF"},component:{fill:"#85BBF0",stroke:"#78A8D8",text:"#FFFFFF"},component_ext:{fill:"#CCCCCC",stroke:"#ACACAC",text:"#FFFFFF"},node:{fill:"light-dark(#FFFFFF,#1f2020)",stroke:"light-dark(#444444,#cccccc)",text:"light-dark(#444444,#cccccc)"},boundary:{fill:"none",stroke:"light-dark(#444444,#cccccc)",text:"light-dark(#444444,#cccccc)"}};function yt(e,x){var C=e+(x?"_ext":"");return H[C]||H[e]||H.system}function ut(e){var x=e.c4Lines;if(!x)return'<div style="font-size:14px;font-weight:bold;">'+mxUtils.htmlEntities(e.label||"")+"</div>";function C(Y,D){for(var At=[],U=0;U<Y.length;U++)At.push(mxUtils.htmlEntities(Y[U]));return'<div style="'+D+'line-height:1.07;white-space:nowrap;">'+At.join("<br>")+"</div>"}var S=[];return x.name.length>0&&S.push(C(x.name,"font-size:14px;font-weight:bold;")),x.type.length>0&&S.push(C(x.type,"font-size:10.5px;"+(S.length>0?"margin-top:3px;":""))),x.descr.length>0&&S.push(C(x.descr,"font-size:11.48px;"+(S.length>0?"margin-top:3px;":""))),S.join("")}function ht(e,x,C){var S=v(),Y=S.getDefaultParent(),D=e.fontFamily,At=62,U=e.title?At:0;if(e.title){var q=50,rt=Math.max(20,(e.canvasW-2*q)/2-4*q);r(S,Y,null,mxUtils.htmlEntities(e.title),20,10,e.canvasW-40,24,"text;html=1;strokeColor=none;fillColor=none;fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=top;spacingLeft="+(rt-20)+";")}var ct={};function nt(le,Ae){var Le=yt(le.category,le.isExternal);if(le.children&&le.children.length>0){var Re,Be;if(le.category==="boundary"){Re="rounded=1;absoluteArcSize=1;arcSize=5;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#444444;strokeWidth=1;dashed=1;dashPattern=5 5;verticalAlign=top;align=center;spacingTop=2;fontSize=16;fontStyle=1;fontColor=#444444;fontFamily=Open Sans,sans-serif;";var je=mxUtils.htmlEntities(le.label||"");if(Be='<div style="font-size:16px;font-weight:bold;">'+je+"</div>",le.boundaryType){var ie=le.boundaryTypeExplicit?mxUtils.htmlEntities(le.boundaryType):mxUtils.htmlEntities(le.boundaryType).toUpperCase();Be+='<div style="font-size:14px;font-weight:normal;margin-top:4px;">['+ie+"]</div>"}}else{Re="rounded=1;absoluteArcSize=1;arcSize=5;whiteSpace=wrap;html=1;fillColor="+Le.fill+";strokeColor="+Le.stroke+";strokeWidth=1;verticalAlign=top;align=center;spacingTop=8;fontSize=16;fontStyle=1;fontColor="+Le.text+";fontFamily=Open Sans,sans-serif;";var fr=[];fr.push('<div style="font-size:16px;font-weight:bold;">'+mxUtils.htmlEntities(le.label||"")+"</div>"),le.technology&&fr.push('<div style="font-size:14px;font-weight:normal;margin-top:2px;">['+mxUtils.htmlEntities(le.technology)+"]</div>"),Be=fr.join("")}var Ar=r(S,Ae,null,Be,le.x,le.y,le.width,le.height,Re);le.id&&h(S,Ar,"n:"+le.id),ct[le.id]=Ar;for(var Lr=0;Lr<le.children.length;Lr++)nt(le.children[Lr],Ar);return}var Ze=ut(le),dr;if(le.isDb){var Xe=Math.round((le.cylinderRy||10)*100)/100;dr="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size="+Xe+";spacingTop=13;fillColor="+Le.fill+";strokeColor="+Le.stroke+";strokeWidth=1;fontColor="+Le.text+";"}else if(le.isQueue){var br=Math.round((le.queueRx||10)*100)/100;dr="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size="+br+";direction=east;fillColor="+Le.fill+";strokeColor="+Le.stroke+";strokeWidth=1;fontColor="+Le.text+";"}else le.category==="person"?dr=null:dr="rounded=1;absoluteArcSize=1;arcSize=24;whiteSpace=wrap;html=1;fillColor="+Le.fill+";strokeColor="+Le.stroke+";strokeWidth=1;fontColor="+Le.text+";";if(le.category==="person"){var vr=le.personHeadR||Math.min(le.width*.23,56),gr=le.personBodyH||le.height-2*vr+vr*.27,fa=Math.round(le.personBodyRadius||Math.min(le.width*.177,gr*.45)),Je=le.styleOverrides&&le.styleOverrides.bgColor||Le.fill,$e=le.styleOverrides&&le.styleOverrides.borderColor||Le.stroke,Qr=le.styleOverrides&&le.styleOverrides.fontColor||Le.text,$r="rounded=1;absoluteArcSize=1;arcSize="+2*fa+";whiteSpace=wrap;html=1;fillColor="+Je+";strokeColor="+$e+";strokeWidth=1;fontColor="+Qr+";align=center;verticalAlign=middle;fontFamily=Open Sans,sans-serif;",Ir="ellipse;html=1;fillColor="+Je+";strokeColor="+$e+";strokeWidth=1;",Cr=r(S,Ae,null,Ze,le.x,le.y+(le.height-gr),le.width,gr,$r);r(S,Ae,null,"",le.x+le.width/2-vr,le.y,vr*2,vr*2,Ir),le.id&&h(S,Cr,"n:"+le.id),ct[le.id]=Cr;return}le.styleOverrides&&(le.styleOverrides.bgColor&&(dr=dr.replace(/fillColor=[^;]*/,"fillColor="+le.styleOverrides.bgColor)),le.styleOverrides.borderColor&&(dr=dr.replace(/strokeColor=[^;]*/,"strokeColor="+le.styleOverrides.borderColor)),le.styleOverrides.fontColor&&(dr=dr.replace(/fontColor=[^;]*/,"fontColor="+le.styleOverrides.fontColor)));var Ea=dr+"align=center;verticalAlign=middle;fontFamily=Open Sans,sans-serif;",xa=r(S,Ae,null,Ze,le.x,le.y,le.width,le.height,Ea);le.id&&h(S,xa,"n:"+le.id),ct[le.id]=xa}for(var zt=0;zt<e.elements.length;zt++)e.elements[zt].y+=U,nt(e.elements[zt],Y);for(var zt=0;zt<e.relations.length;zt++){var Ot=e.relations[zt],Ft=ct[Ot.from],Pt=ct[Ot.to];if(!(!Ft||!Pt)){var Wt=[];Ot.label&&Wt.push(mxUtils.htmlEntities(Ot.label)),Ot.technology&&Wt.push("<i>["+mxUtils.htmlEntities(Ot.technology)+"]</i>");var Kt=Wt.length>0?'<div style="text-align:left;">'+Wt.join("<br>")+"</div>":"",Bt=Ce(Ft),ce=Ce(Pt),kt=Bt.x+Bt.w/2,wt=Bt.y+Bt.h/2,jt=ce.x+ce.w/2,Ht=ce.y+ce.h/2,qt=Ke(Bt,jt,Ht),ee=Ke(ce,kt,wt),Ut=We(qt,Bt),ve=We(ee,ce),we=zt===0,Se=Ot.styleOverrides&&Ot.styleOverrides.lineColor||"#444444",be=Ot.styleOverrides&&Ot.styleOverrides.textColor||"#444444",Me="endArrow=block;html=1;strokeColor="+Se+";strokeWidth=1;"+(we?"":"curved=1;")+"fontSize=12;fontColor="+be+";fontFamily=Open Sans,sans-serif;labelBackgroundColor=none;exitX="+Ut.x+";exitY="+Ut.y+";entryX="+ve.x+";entryY="+ve.y+";align=center;verticalAlign=middle;";(Ot.direction==="bi"||Ot.direction==="back")&&(Me+="startArrow=block;");var Fe=S.insertEdge(Y,null,Kt,Ft,Pt,Me);if(Kt){let Ae=function(Le){if(typeof mxUtils!="undefined"&&mxUtils.getSizeForString){var Re=mxUtils.getSizeForString(Le,Ue,De,null,0);if(Re.width>0||!/\S/.test(Le))return Re}return{width:Le.length*Ue*.56,height:Ue*1.5}};var Ue=12,De="Open Sans,sans-serif",Ye=Ot.label?Ae(Ot.label):{width:0,height:0},Pe=Ot.technology?Ae("["+Ot.technology+"]"):{width:0,height:0},de=Math.max(Ye.width,Pe.width),Ve=Ot.styleOverrides&&Ot.styleOverrides.offsetX?parseInt(Ot.styleOverrides.offsetX,10):0,Ne=Ot.styleOverrides&&Ot.styleOverrides.offsetY?parseInt(Ot.styleOverrides.offsetY,10):0;if(Fe.geometry!=null){var nr=we?0:(ee.x-qt.x)/4;Fe.geometry.relative=!0,Fe.geometry.x=0,Fe.geometry.y=0,Fe.geometry.offset=new mxPoint(nr+Ve+de/2,Ne+(Ot.technology?(Ue+5)/2:0))}}if(Ot.from&&Ot.to&&h(S,Fe,"e:"+Ot.from+"->"+Ot.to+"#"+zt),!we){var Ge=qt.x+(ee.x-qt.x)/4,Ie=qt.y+(ee.y-qt.y)/2;Fe.geometry.points=[new mxPoint(Math.round(Ge),Math.round(Ie))]}}}function Ce(le){for(var Ae=le.geometry.x,Le=le.geometry.y,Re=le.parent;Re&&Re.geometry;)Ae+=Re.geometry.x,Le+=Re.geometry.y,Re=Re.parent;return{x:Ae,y:Le,w:le.geometry.width,h:le.geometry.height}}function Ke(le,Ae,Le){var Re=le.x,Be=le.y,je=le.w,ie=le.h,fr=Re+je/2,Ar=Be+ie/2,Lr=Math.abs(Re-Ae),Ze=Math.abs(Be-Le);if(Be===Le&&Re<Ae)return{x:Re+je,y:Ar};if(Be===Le&&Re>Ae)return{x:Re,y:Ar};if(Re===Ae&&Be<Le)return{x:fr,y:Be+ie};if(Re===Ae&&Be>Le)return{x:fr,y:Be};var dr=Ze/Lr,Xe=ie/je;return Re>Ae&&Be<Le?Xe>=dr?{x:Re,y:Ar+dr*je/2}:{x:fr-Lr/Ze*ie/2,y:Be+ie}:Re<Ae&&Be<Le?Xe>=dr?{x:Re+je,y:Ar+dr*je/2}:{x:fr+Lr/Ze*ie/2,y:Be+ie}:Re<Ae&&Be>Le?Xe>=dr?{x:Re+je,y:Ar-dr*je/2}:{x:fr+Lr/Ze*ie/2,y:Be}:Xe>=dr?{x:Re,y:Ar-dr*je/2}:{x:fr-Lr/Ze*ie/2,y:Be}}function We(le,Ae){var Le=(le.x-Ae.x)/Ae.w,Re=(le.y-Ae.y)/Ae.h;return Le=Math.max(0,Math.min(1,Le)),Re=Math.max(0,Math.min(1,Re)),{x:Le,y:Re}}return dt(S)}var bt="#087EBF";function Nt(e){var x='<rect width="80" height="80" style="fill: '+bt+'; stroke-width: 0px;"/>',C="";switch(e){case"server":C='<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>';break;case"database":C='<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>';break;case"disk":C='<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>';break;case"cloud":C='<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>';break;case"internet":C='<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>';break;case"blank":C="";break;default:C='<text x="21.16" y="64.67" fill="white" font-family="Arial,sans-serif" font-size="67.75">?</text>';break}return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80">'+x+C+"</svg>"}function Dt(e){if(!e)return null;if(e.kind==="stencil")return e.style+"html=1;";if(e.kind==="svg"){var x=typeof btoa=="function"?btoa(unescape(encodeURIComponent(e.svg))):mxUtils.toBase64(e.svg);return"shape=image;html=1;imageAspect=0;image=data:image/svg+xml,"+x+";"}return null}function st(e){return e?ki.resolve("aws:"+e)||ki.resolve(e)||ki.resolve("logos:"+e):null}function Lt(e,x,C,S,Y){var D=x.width||150,At=Math.max(16,Math.min(30,S-20,D-8)),U=x.x+(D-At)/2;r(e,null,null,"",U,C+3,At,At,Y),r(e,null,null,mxUtils.htmlEntities(x.label),x.x,C+At+3,D,Math.max(12,S-At-5),"text;html=1;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontSize=16;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;")}function ft(e){var x=Dt(ki.resolve(e));if(x)return x;var C=Nt(e),S=typeof btoa=="function"?btoa(unescape(encodeURIComponent(C))):mxUtils.toBase64(C);return"shape=image;html=1;imageAspect=0;image=data:image/svg+xml,"+S+";"}function Ct(e,x,C){for(var S=v(),Y=S.getDefaultParent(),D=S.getDefaultParent(),At=e.fontFamily,U=0;U<e.groups.length;U++){var q=e.groups[U],rt=r(S,D,null,"",q.x,q.y,q.width,q.height,"rounded=0;fillColor=none;strokeColor=#C0C0ED;dashed=1;dashPattern=8 8;strokeWidth=2;");q.id&&h(S,rt,"n:group:"+q.id);var ct=30,nt=q.x+1,zt=q.y+1,Ot=ft(q.icon,ct);r(S,D,null,"",nt,zt,ct,ct,Ot),r(S,D,null,mxUtils.htmlEntities(q.label),nt+ct+6,zt,200,ct,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}for(var Ft={},U=0;U<e.nodes.length;U++){var Pt=e.nodes[U];if(Pt.kind==="junction"){var Wt=r(S,D,null,"",Pt.x+e.iconSize/2-5,Pt.y+e.iconSize/2-5,10,10,"shape=waypoint;perimeter=centerPerimeter;fillColor=none;strokeColor=none;");Ft[Pt.id]=Wt;continue}var Kt=r(S,D,null,"",Pt.x,Pt.y,Pt.width,Pt.height,ft(Pt.icon,Pt.width));Pt.id&&h(S,Kt,"n:"+Pt.id),Ft[Pt.id]=Kt,Pt.label&&r(S,D,null,mxUtils.htmlEntities(Pt.label),Pt.x-20,Pt.y+Pt.height-2,Pt.width+40,e.labelHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=top;")}for(var U=0;U<e.archEdges.length;U++){var Bt=e.archEdges[U],ce=Ft[Bt.source],kt=Ft[Bt.target];if(!(!ce||!kt)){var wt=Xt(Bt.sourcePort),jt=Xt(Bt.targetPort),Ht="html=1;strokeColor=light-dark(#333333,#cccccc);strokeWidth=3;exitX="+wt.x+";exitY="+wt.y+";entryX="+jt.x+";entryY="+jt.y+";edgeStyle=orthogonalEdgeStyle;rounded=0;";Bt.arrowEnd?Ht+="endArrow=block;endFill=1;endSize=8;":Ht+="endArrow=none;",Bt.arrowStart&&(Ht+="startArrow=block;startFill=1;startSize=8;");var qt=S.insertEdge(D,null,"",ce,kt,Ht);Bt.source&&Bt.target&&h(S,qt,"e:"+Bt.source+"->"+Bt.target+"#"+U)}}return dt(S)}function Xt(e){switch(e){case"T":return{x:.5,y:0};case"B":return{x:.5,y:1};case"L":return{x:0,y:.5};case"R":return{x:1,y:.5};default:return{x:.5,y:.5}}}function St(e,x,C){for(var S=v(),Y=S.getDefaultParent(),D=S.getDefaultParent(),At=e.fontFamily,U=[],q=0;q<e.nodes.length;q++){var rt=e.nodes[q],ct=S.insertVertex(D,null,"",rt.x,rt.y,rt.width,rt.height,"rounded=0;fillColor="+rt.color+";strokeColor="+rt.color+";");U.push(ct),rt.id&&h(S,ct,"n:"+rt.id)}for(var nt=x&&x.sankey&&x.sankey.linkColor||"gradient",zt=S.getModel(),Ot={},q=0;q<e.sankeyLinks.length;q++){var Ft=e.sankeyLinks[q],Pt=U[Ft.sourceColorIdx],Wt=U[Ft.targetColorIdx],Kt=e.nodes[Ft.sourceColorIdx].color,Bt=e.nodes[Ft.targetColorIdx].color,ce;nt==="source"?ce="fillColor="+Kt+";":nt==="target"?ce="fillColor="+Bt+";":nt==="gradient"?ce="fillColor="+Kt+";gradientColor="+Bt+";gradientDirection=east;":ce="fillColor="+nt+";";var kt=Pt.geometry,wt=Wt.geometry,jt=kt.height>0?(Ft.y1-kt.y)/kt.height:.5,Ht=wt.height>0?(Ft.y2-wt.y)/wt.height:.5,qt=S.insertEdge(D,null,"",Pt,Wt,"shape=mermaidSankeyLink;width="+Ft.width.toFixed(2)+";"+ce+"opacity=50;strokeColor=none;html=1;exitX=1;exitY="+jt.toFixed(6)+";exitPerimeter=0;entryX=0;entryY="+Ht.toFixed(6)+";entryPerimeter=0;");zt.add(D,qt,q);var ee=e.nodes[Ft.sourceColorIdx].id,Ut=e.nodes[Ft.targetColorIdx].id,ve=ee+"->"+Ut,we=Ot[ve]||0;Ot[ve]=we+1,h(S,qt,"e:"+ve+"#"+we)}for(var Se=x&&x.sankey||{},be=Se.showValues!==!1,Me=typeof Se.prefix=="string"?Se.prefix:"",Fe=typeof Se.suffix=="string"?Se.suffix:"",Ue=Se.labelStyle==="outlined"?"outlined":"legacy",De=0,Ye=0,q=0;q<e.nodes.length;q++){var Pe=e.nodes[q].totalFlow||0;Pe>Ye&&(Ye=Pe,De=e.nodes[q].layer||0)}for(var q=0;q<e.nodes.length;q++){var rt=e.nodes[q],de;Ue==="outlined"?de=(rt.layer||0)<De:de=!(rt.x<e.canvasW/2);var Ve=rt.id;if(be){var Ne=Math.round(rt.totalFlow*100)/100;Ve=rt.id+`
-`+Me+Ne+Fe}var nr=rt.y+.5+rt.height/2,Ge=nr-(be?21:16);de?S.insertVertex(D,null,mxUtils.htmlEntities(Ve),rt.x-157.5,Ge,154,32,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=14;fontColor=light-dark(#333333,#cccccc);align=right;verticalAlign=middle;"):S.insertVertex(D,null,mxUtils.htmlEntities(Ve),rt.x+rt.width+4.5,Ge,154,32,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=14;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}return dt(S)}function Zt(e,x){var C=v(),S=C.getDefaultParent(),Y=C.getDefaultParent(),D=e.pieCx,At=e.pieCy,U=e.pieR,q=e.outerR;if(e.slices.length===1){var rt=e.slices[0],ct=r(C,Y,null,"",D-U,At-U,2*U,2*U,"ellipse;fillColor="+rt.color+";strokeColor=light-dark(#000000,#cccccc);strokeWidth=2;opacity=70;html=1;");h(C,ct,"n:slice:"+(rt.label||"idx0"))}else for(var nt=0;nt<e.slices.length;nt++){var rt=e.slices[nt],zt="shape=mxgraph.basic.pie;startAngle="+rt.startFrac.toFixed(4)+";endAngle="+rt.endFrac.toFixed(4)+";fillColor="+rt.color+";strokeColor=light-dark(#000000,#cccccc);strokeWidth=2;opacity=70;html=1;",Ot=r(C,Y,null,"",D-U,At-U,2*U,2*U,zt);h(C,Ot,"n:slice:"+(rt.label||"idx"+nt))}r(C,Y,null,"",D-q,At-q,2*q,2*q,"ellipse;fillColor=none;strokeColor=light-dark(#000000,#cccccc);strokeWidth=2;html=1;");for(var nt=0;nt<e.slices.length;nt++){var rt=e.slices[nt],Ft=40,Pt=20;r(C,Y,null,rt.percent+"%",D+rt.labelX-Ft/2,At+rt.labelY-Pt/2,Ft,Pt,"text;html=1;fontSize=17;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;")}if(e.title){var Wt=400,Kt=32;r(C,Y,null,mxUtils.htmlEntities(e.title),D-Wt/2,e.titleY-Kt/2,Wt,Kt,"text;html=1;fontSize=25;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontColor=light-dark(#000000,#cccccc);align=center;verticalAlign=middle;")}for(var Bt=216,ce=18,kt=18,wt=e.slices.length,nt=0;nt<wt;nt++){var rt=e.slices[nt],jt=22*nt-11*wt,Ht=D+Bt,qt=At+jt;r(C,Y,null,"",Ht,qt,ce,kt,"rounded=0;fillColor="+rt.color+";strokeColor="+rt.color+";html=1;");var ee=rt.label;e.showData&&(ee+=" ["+rt.value+"]");var Ut=Math.max(ee.length*10+20,60);r(C,Y,null,mxUtils.htmlEntities(ee),Ht+ce+4,qt,Ut,kt,"text;html=1;fontSize=17;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontColor=light-dark(#000000,#cccccc);align=left;verticalAlign=middle;")}return dt(C)}function G(e){if(e==null||e<=0)return null;var x=((e-1)%qr.length+qr.length)%qr.length;return qr[x]}function gt(e){if(e.depth===0)return{fill:"none",text:"#333333",stroke:"none",transparent:!1};if(!e.isLeaf){var x=G(e.sectionIdx);return x?{fill:x.fill,text:"#333333",stroke:x.fill,transparent:!1}:{fill:"none",text:"#333333",stroke:"none",transparent:!1}}for(var C=e.parent;C&&C.depth>0&&C.sectionIdx==null;)C=C.parent;if(C&&C.depth>0&&C.sectionIdx!=null){var x=G(C.sectionIdx);if(x)return{fill:x.fill,text:"#333333",stroke:x.fill,transparent:!1}}return{fill:"none",text:"#333333",stroke:"none",transparent:!0}}function oe(e,x){if(e==null)return"";if(!x)return e===Math.floor(e)?String(e):String(Math.round(e*100)/100);var C=x.indexOf("%")>=0,S="";x.charAt(0)==="$"&&(S=C?"":"$",x=x.substring(1));var Y=C?e*100:e,D=x.indexOf(",")>=0,At=x.match(/\.(\d+)/),U=At?parseInt(At[1],10):D?0:null,q;if(U!=null?q=Y.toFixed(U):Y===Math.floor(Y)?q=String(Y):q=String(Math.round(Y*100)/100),D){var rt=q.split(".");rt[0]=rt[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),q=rt.join(".")}return S+q+(C?"%":"")}function ae(e,x,C){var S=v(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=x&&x.treemap&&x.treemap.valueFormat||"",q=S.getDefaultParent(),rt=e.fontFamily,ct=e.headerH||25,nt=e.classDefs||{};function zt(le){if(!le.className||!nt[le.className])return null;for(var Ae=nt[le.className].replace(/,\s*(?=[a-z-])/gi,";"),Le={},Re=Ae.split(";"),Be=0;Be<Re.length;Be++){var je=Re[Be].split(":");if(!(je.length<2)){var ie=je[0].trim(),fr=je.slice(1).join(":").trim();!ie||!fr||(ie==="fill"?Le.fill=fr:ie==="stroke"?Le.stroke=fr:ie==="color"?Le.text=fr:ie==="stroke-width"&&(Le.strokeWidth=parseFloat(fr)))}}return Le}for(var Ot=["#ffffff","#333333","#333333","#ffffff","#333333","#333333","#333333","#333333","#333333","#333333","#333333","#333333"],Ft={},Pt=0,Wt=0;Wt<e.placed.length;Wt++){var Kt=e.placed[Wt];Kt.depth===0||Kt.isLeaf||Kt.label==null||Object.prototype.hasOwnProperty.call(Ft,Kt.label)||(Ft[Kt.label]=Pt++)}function Bt(le){return le==null?"#333333":(Object.prototype.hasOwnProperty.call(Ft,le)||(Ft[le]=Pt++),Ot[Ft[le]%Ot.length])}for(var ce=0;ce<e.placed.length;ce++){var kt=e.placed[ce];if(kt.depth!==0){var wt=kt.x0,jt=kt.y0,Ht=kt.x1-kt.x0,qt=kt.y1-kt.y0;if(!(Ht<=0||qt<=0)){var ee=gt(kt);ee.text=Bt(kt.label);var Ut=zt(kt);if(Ut&&(Ut.fill&&(ee.fill=Ut.fill,ee.transparent=!1),Ut.stroke&&(ee.stroke=Ut.stroke),Ut.text&&(ee.text=Ut.text)),kt.isLeaf){var be=ee.transparent?"none":ee.fill,Me=ee.transparent?"none":Ut&&Ut.stroke?ee.stroke:ee.fill,Fe="rounded=0;whiteSpace=wrap;html=1;fillColor="+be+(ee.transparent?";":";fillOpacity=30;")+"strokeColor="+Me+(ee.transparent?";":";strokeWidth=3;"),Ue=r(S,q,null,"",wt,jt,Ht,qt,Fe);kt.label&&h(S,Ue,"n:leaf:"+kt.label);var De=kt.label||"",Ye=kt.rawValue!=null?oe(kt.rawValue,U):"",Pe=Math.max(De.length,Ye.length,2),de=Math.max(8,Math.min(38,Math.round(Ht/(Pe*.55)),Math.round(qt*.5)));if(de>=8){var Ve=Math.max(6,Math.min(28,Math.round(de*.6))),Ne=Math.ceil(de*1.3),nr=Math.ceil(Ve*1.3),Ge=jt+qt/2,Ie=Ge-Ne/2,Ce=Ge+de*.55;r(S,q,null,mxUtils.htmlEntities(De),wt,Ie,Ht,Ne,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize="+de+";fontColor="+ee.text+";align=center;verticalAlign=middle;");var Ke=Ye.length*Ve*.6<=Ht-8,We=Ce+nr<=jt+qt-1;Ye&&Ke&&We&&r(S,q,null,Ye,wt,Ce,Ht,nr,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize="+Ve+";fontColor="+ee.text+";align=center;verticalAlign=top;")}}else{var ve="rounded=0;whiteSpace=wrap;html=1;fillColor="+ee.fill+";fillOpacity=60;strokeColor="+ee.stroke+";strokeWidth=2;strokeOpacity=40;",we=r(S,q,null,"",wt,jt,Ht,qt,ve);kt.label&&h(S,we,"n:section:"+kt.label);var Se=r(S,q,null,mxUtils.htmlEntities(kt.label||""),wt+6,jt,Math.max(Ht-12,0),ct,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize=12;fontStyle=1;fontColor="+ee.text+";align=left;verticalAlign=middle;");r(S,q,null,oe(kt.value,U),wt+6,jt,Math.max(Ht-16,0),ct,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize=10;fontStyle=2;fontColor="+ee.text+";align=right;verticalAlign=middle;")}}}}return e.title&&r(S,q,null,mxUtils.htmlEntities(e.title),0,0,D,ct,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize=14;fontStyle=1;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;"),dt(S)}function fe(e){var x=e.flags,C,S,Y;return x.done&&x.crit?(C="#d3d3d3",S="#ff8888",Y="#000000"):x.active&&x.crit?(C="#bfc7ff",S="#ff8888",Y="#000000"):x.crit?(C="#ff0000",S="#ff8888",Y="#ffffff"):x.done?(C="#d3d3d3",S="#808080",Y="#000000"):x.active?(C="#bfc7ff",S="#534fbc",Y="#000000"):(C="#8a90dd",S="#534fbc",Y="#ffffff"),{fill:C,stroke:S,text:Y}}function ne(e,x,C){var S=v(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily;e.title&&r(S,U,null,mxUtils.htmlEntities(e.title),0,10,D,30,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=18;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");var rt=[{fill:"#6666FF",opacity:"10"},{fill:"#FFFFFF",opacity:"20"},{fill:"#FFF400",opacity:"20"},{fill:"#FFFFFF",opacity:"20"}],ct=D-37.5;if(e.excludes)for(var nt=0;nt<e.excludes.length;nt++){var zt=e.excludes[nt];r(S,U,null,"",zt.x,e.gridTop,zt.w,e.gridBottom-e.gridTop,"rounded=0;fillColor=light-dark(#eeeeee,#2a2a2a);strokeColor=none;")}for(var nt=0;nt<e.ticks.length;nt++){var Ot=e.ticks[nt];r(S,U,null,"",Ot.x-.5,e.gridTop,1,e.gridBottom-e.gridTop,"rounded=0;fillColor=light-dark(#B0B0B0,#555555);strokeColor=none;")}for(var nt=0;nt<e.sections.length;nt++)for(var Ft=e.sections[nt],Pt=typeof Ft.idx=="number"?Ft.idx:nt,Wt=rt[(Pt%4+4)%4],Kt=Ft.lastRow!=null&&Ft.firstRow!=null?Ft.lastRow-Ft.firstRow+1:Ft.tasks.length,Bt=0;Bt<Kt;Bt++){var ce=e.topMargin+(Ft.firstRow+Bt)*e.rowHeight;r(S,U,null,"",0,ce,ct,e.rowHeight,"rounded=0;fillColor="+Wt.fill+";fillOpacity="+Wt.opacity+";strokeColor=none;")}for(var nt=0;nt<e.ticks.length;nt++){var Ot=e.ticks[nt];r(S,U,null,Ot.label,Ot.x-45,e.gridBottom+4,90,14,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=10;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=top;")}for(var nt=0;nt<e.sections.length;nt++){var Ft=e.sections[nt];Ft.name&&r(S,U,null,mxUtils.htmlEntities(Ft.name),5,Ft.y,e.gridLeft-5,Ft.h,"text;html=1;strokeColor=none;fillColor=none;overflow=visible;fontFamily="+q+";fontSize=11;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}for(var kt=[],nt=0;nt<e.tasks.length;nt++){var wt=e.tasks[nt],jt=fe(wt);if(wt.flags.vert){kt.push(wt);continue}if(wt.flags.milestone){var Ht=wt.barX,qt=wt.barX+wt.barW,ee=Ht+(qt-Ht)/2,Ut=wt.barY+e.taskHeight/2,ve=22.6,we=r(S,U,null,"",ee-ve/2,Ut-ve/2,ve,ve,"shape=rhombus;html=1;fillColor="+jt.fill+";strokeColor="+jt.stroke+";strokeWidth=2;");h(S,we,"n:task:"+(wt.id||"idx"+nt));var Se=11,be=wt.labelW!=null&&wt.labelW>0?wt.labelW:Math.max(wt.label.length*Se*.55,20),Me=5,Fe=5,Ue,De,Ye;qt+Me+be+Fe>D?(Ye=Math.max(be+10,60),Ue=Ht-Me-Ye,De="right"):(Ye=Math.max(be+10,120),Ue=qt+Me,De="left"),r(S,U,null,mxUtils.htmlEntities(wt.label),Ue,Ut-8,Ye,16,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+Se+";fontColor=light-dark(#333333,#cccccc);fontStyle=2;align="+De+";verticalAlign=middle;")}else{var Pe="rounded=1;absoluteArcSize=1;arcSize=3;html=1;fillColor="+jt.fill+";strokeColor="+jt.stroke+";strokeWidth=2;",de=r(S,U,null,"",wt.barX,wt.barY,wt.barW,e.taskHeight,Pe);if(h(S,de,"n:task:"+(wt.id||"idx"+nt)),wt.labelOutsideLeft){var Ve=(wt.labelW||0)+12,Ne=wt.barX-5-Ve;r(S,U,null,mxUtils.htmlEntities(wt.label),Ne,wt.barY,Ve,e.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=11;fontColor=light-dark(#333333,#cccccc);align=right;verticalAlign=middle;")}else if(wt.labelOutsideRight){var nr=(wt.labelW||0)+12,Ge=wt.barX+wt.barW+5;r(S,U,null,mxUtils.htmlEntities(wt.label),Ge,wt.barY,nr,e.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=11;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}else if(wt.labelOverflowCenter){var Ie=wt.labelW||0,Ce=wt.barX+wt.barW+5-Ie,Ke=Ie*2;r(S,U,null,mxUtils.htmlEntities(wt.label),Ce,wt.barY,Ke,e.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=11;fontColor="+jt.text+";align=center;verticalAlign=middle;")}else r(S,U,null,mxUtils.htmlEntities(wt.label),wt.barX,wt.barY,wt.barW,e.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=11;fontColor="+jt.text+";align=center;verticalAlign=middle;")}}for(var We=typeof e.nonVertTaskCount=="number"?e.nonVertTaskCount:e.tasks.length,le=0;le<kt.length;le++){var Ae=kt[le],Le=Ae.barX,Re=We*e.rowHeight+e.taskHeight*2,Be=Ae.barW&&Ae.barW>0?Ae.barW:1.6,je="light-dark(#000080,#00BFFF)",ie=r(S,U,null,"",Le,e.gridTop,Be,Re,"rounded=1;absoluteArcSize=1;arcSize=3;html=1;fillColor="+je+";strokeColor="+je+";strokeWidth=1;");h(S,ie,"n:task:"+(Ae.id||"vert"+le));var fr=160,Ar=e.gridTop+We*e.rowHeight+60;r(S,U,null,mxUtils.htmlEntities(Ae.label),Le-fr/2,Ar-10,fr,20,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=15;fontColor="+je+";align=center;verticalAlign=middle;")}return dt(S)}function ye(e,x,C){var S=v(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily;e.title&&r(S,U,null,mxUtils.htmlEntities(e.title),0,0,D,48,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=32;fontStyle=0;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");for(var rt=0;rt<e.circles.length;rt++){var ct=e.circles[rt],nt=2*ct.r,zt=ct.stroke||ct.fill,Ot=r(S,U,null,"",ct.cx-ct.r,ct.cy-ct.r,nt,nt,"ellipse;whiteSpace=wrap;html=1;fillColor="+ct.fill+";fillOpacity=10;strokeColor="+zt+";strokeWidth=2.5;strokeOpacity=95;");h(S,Ot,"n:set:"+(ct.label||"idx"+rt))}for(var rt=0;rt<e.circles.length;rt++){var ct=e.circles[rt];if(ct.label){var Ft=180,Pt=22,Wt=ct.text||ct.fill;r(S,U,null,mxUtils.htmlEntities(ct.label),ct.labelAnchor.x-Ft/2,ct.labelAnchor.y-Pt/2,Ft,Pt,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=24;fontStyle=0;fontColor="+Wt+";align=center;verticalAlign=middle;")}}for(var Kt=e.regionLabels||[],rt=0;rt<Kt.length;rt++){var Bt=Kt[rt];if(Bt.text){var ce=24,Ft=180,Pt=22,kt=Bt.fontColor||"#333333";r(S,U,null,mxUtils.htmlEntities(Bt.text),Bt.x-Ft/2,Bt.y-Pt/2,Ft,Pt,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+ce+";fontColor="+kt+";align=center;verticalAlign=middle;")}}for(var wt=e.textNodes||[],rt=0;rt<wt.length;rt++){var jt=wt[rt];if(jt.text){var Ht=20,qt=jt.fontColor||"#333333",ee=jt.boxW||160,Ut=jt.boxH||20;r(S,U,null,mxUtils.htmlEntities(jt.text),jt.x-ee/2,jt.y-Ut/2,ee,Ut,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+Ht+";fontColor="+qt+";align=center;verticalAlign=middle;whiteSpace=wrap;")}}return dt(S)}function Mt(e,x){var C=(e||"").split(/\s+/).filter(function(U){return U});if(C.length===0)return[""];for(var S=[],Y=C[0],D=1;D<C.length;D++){var At=C[D];Y.length+1+At.length<=x?Y+=" "+At:(S.push(Y),Y=At)}return S.push(Y),S}function $t(e,x,C){var S=v(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily;e.title&&r(S,U,null,mxUtils.htmlEntities(e.title),0,8,D,26,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=18;fontStyle=1;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");var rt=e.spineY,ct=3;r(S,U,null,"",e.spineX0,rt-ct/2,e.spineX1-e.spineX0,ct,"rounded=0;fillColor=light-dark(#333333,#cccccc);strokeColor=none;");var nt=e.effectCx,zt=e.effectCy,Ot=e.effectW,Ft=e.effectH,Pt=(e.effect||"").split(/\s+/).filter(function(Ge){return Ge}),Wt=Pt.map(function(Ge){return mxUtils.htmlEntities(Ge)}).join("<br>"),Kt=r(S,U,null,Wt,nt-Ot/2,zt-Ft/2,Ot,Ft,"shape=ishikawaHead;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=light-dark(#333333,#cccccc);strokeWidth=2;fontFamily="+q+";fontSize=14;fontStyle=1;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");h(S,Kt,"n:effect");for(var Bt=0;Bt<e.categories.length;Bt++){var ce=e.categories[Bt],kt=S.insertEdge(U,null,"",null,null,"endArrow=none;startArrow=block;startFill=1;startSize=8;html=1;rounded=0;strokeColor=light-dark(#333333,#cccccc);strokeWidth=2;");kt.geometry.setTerminalPoint(new mxPoint(ce.spineX,ce.spineY),!0),kt.geometry.setTerminalPoint(new mxPoint(ce.boneEndX,ce.boneEndY),!1);var wt=typeof mxUtils!="undefined"&&mxUtils.getSizeForString?mxUtils.getSizeForString(ce.name,16,q,null,0):{width:ce.name.length*9,height:19},jt=Math.max(60,wt.width+40),Ht=Math.max(25,wt.height+4),qt=ce.boneEndX,ee=ce.boneEndY+ce.dirY*(Ht/2+2),Ut=r(S,U,null,mxUtils.htmlEntities(ce.name),qt-jt/2,ee-Ht/2,jt,Ht,"rounded=0;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=light-dark(#333333,#cccccc);strokeWidth=2;fontFamily="+q+";fontSize=16;fontStyle=0;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");h(S,Ut,"n:category:"+(ce.name||"idx"+Bt));for(var ve=0;ve<ce.subs.length;ve++){for(var we=ce.subs[ve],Se=16,be=Mt(we.text,15),Me="",Fe=0;Fe<be.length;Fe++)be[Fe].length>Me.length&&(Me=be[Fe]);var Ue=Math.max(60,Math.ceil(Me.length*Se/2)+8),De=be.length*(Se+2),Ye=be.map(function(Ge){return mxUtils.htmlEntities(Ge)}).join("<br>"),Pe=we.bx0!=null?we.bx0:we.x,de=we.by0!=null?we.by0:we.y,Ve=we.bx1!=null?we.bx1:we.stubEndX!=null?we.stubEndX:we.x-30,Ne=we.by1!=null?we.by1:we.y,nr=S.insertEdge(U,null,"",null,null,"endArrow=block;endFill=1;endSize=6;startArrow=none;html=1;rounded=0;strokeColor=light-dark(#333333,#cccccc);strokeWidth=1;");nr.geometry.setTerminalPoint(new mxPoint(Ve,Ne),!0),nr.geometry.setTerminalPoint(new mxPoint(Pe,de),!1),r(S,U,null,Ye,Ve-Ue,Ne-De/2,Ue,De,"text;html=1;strokeColor=none;fillColor=none;whiteSpace=wrap;fontFamily="+q+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=right;verticalAlign=middle;")}}return dt(S)}function Jt(e,x,C){var S=v(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily,rt=e.labelFontSize,ct=e.labelColor,nt=e.lineColor,zt=e.lineThickness,Ot=e.paddingX;e.title&&r(S,U,null,mxUtils.htmlEntities(e.title),0,6,D,26,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=18;fontStyle=1;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");for(var Ft=0;Ft<e.lines.length;Ft++){var Pt=e.lines[Ft],Wt=S.insertEdge(U,null,"",null,null,"endArrow=none;html=1;rounded=0;strokeColor="+nt+";strokeWidth="+zt+";");Wt.geometry.setTerminalPoint(new mxPoint(Pt.x1,Pt.y1),!0),Wt.geometry.setTerminalPoint(new mxPoint(Pt.x2,Pt.y2),!1)}for(var Kt=0;Kt<e.rows.length;Kt++){var Bt=e.rows[Kt],ce=r(S,U,null,mxUtils.htmlEntities(Bt.label||""),Bt.x,Bt.y,Bt.width,Bt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+rt+";fontColor="+ct+";align=left;verticalAlign=middle;spacingLeft="+Ot+";");h(S,ce,"n:node:"+(Bt.id||"idx"+Kt))}return dt(S)}return{createFromElkGraph:W,createSequenceDiagram:Rt,createZenumlDiagram:xe,createGitGraph:Jr,createJourneyDiagram:sa,createPieDiagram:Zt,createPacketDiagram:yr,createQuadrantDiagram:rr,createWardleyDiagram:Pr,createEventModelingDiagram:ta,createTimelineDiagram:Ja,createKanbanDiagram:nn,createXychartDiagram:Ln,createRadarDiagram:K,createC4Diagram:ht,createArchitectureDiagram:Ct,createSankeyDiagram:St,createTreemapDiagram:ae,createGanttDiagram:ne,createVennDiagram:ye,createIshikawaDiagram:$t,createTreeviewDiagram:Jt,applyTheme:s,createMxGraph:v,addNode:l,addEdge:lt,formatLabel:u,insertVertex:r,getEdgeStyle:z,getEdgeHead:O,parseCssToDrawioStyle:I,deduplicateStyle:F,twoDec:xt}})();function Qi(L){return L==="__proto__"||L==="constructor"||L==="prototype"}function e2(L,j){if(L==null&&j==null)return{};if(L==null)return j;if(j==null)return L;var P={},E;for(E in L)Qi(E)||(P[E]=L[E]);for(E in j)Qi(E)||(P[E]=j[E]);if(L.themeVariables!=null||j.themeVariables!=null){var w={};if(L.themeVariables)for(E in L.themeVariables)Qi(E)||(w[E]=L.themeVariables[E]);if(j.themeVariables)for(E in j.themeVariables)Qi(E)||(w[E]=j.themeVariables[E]);P.themeVariables=w}return P}var Ya=function(L,j,P){if(j=="requirement"){Ya.reqData=L;return}if(Ya.listeners.length==0)return;function E(l,O){try{if(l instanceof Map&&Object.fromEntries&&(l=Object.fromEntries(l)),!O)for(var z in l)l[z]=E(l[z],!0)}catch(lt){}return l}L=E(L),P=E(P);var w=[["#000000","#b4b4b4"],["#ffffff","#555555"],["#000000","#bbbbbb"],["#ffffff","#777777"],["#000000","#999999"],["#000000","#dddddd"],["#000000","#ffffff"],["#000000","#dddddd"]],p={fillColor:"light-dark(#eeeeee,#1f2020)",strokeColor:"light-dark(#999999,#cccccc)",fontColor:"light-dark(#333333,#cccccc)"},s=j=="statediagram"||j=="stateDiagram",o=EditorUi.prototype.emptyDiagramXml;try{o=_(L)}catch(l){console.log("mermaidToDrawio",l)}for(var v=0;v<Ya.listeners.length;v++)Ya.listeners[v](o),clearTimeout(Ya.timeouts[v]);Ya.htmlLabels=!1,urlParams.mermaidToDrawioTest!="1"&&Ya.resetListeners();return;function M(){var l=new Graph;return l.setExtendParents(!1),l.setExtendParentsOnAdd(!1),l.setConstrainChildren(!1),l.setHtmlLabels(!0),l.getModel().maintainEdgeParent=!1,l}function f(l,O){if(l==null)return"";if(Array.isArray(l)){for(var z=[],lt=0;lt<l.length;lt++)z.push(f(l[lt]));return z.join(`
+`).replace(/^\n+|\n+$/g,"").trim(),e}function r(e,x,C,S,Y,D,At,U,q,rt){return e.insertVertex(x,C,S,Math.round(Y),Math.round(D),Math.round(At),Math.round(U),q,rt)}function h(e,x,C){if(!(x==null||C==null||C==="")){var S;x.value!=null&&typeof x.value=="object"&&x.value.getAttribute?S=x.value.getAttribute("label")||"":S=x.value!=null?String(x.value):"",e.setAttributeForCell(x,"mermaidId",String(C)),e.setAttributeForCell(x,"mermaidBaseStyle",x.style||""),e.setAttributeForCell(x,"mermaidBaseValue",S)}}function v(e,x){for(var C=0,S=0,Y=e?e.parent:null;Y&&Y.geometry;)C+=Y.geometry.x||0,S+=Y.geometry.y||0,Y=Y.parent;return{x:C,y:S,width:x?x.width:0,height:x?x.height:0}}function n(e,x,C,S){e.indexOf("html=1")<0&&e.indexOf("html=0")<0&&(e="html=1;"+e);var Y=u(x.labelText);return x.mindmap&&Y&&(Y='<div style="line-height:1.5;">'+Y+"</div>"),r(S,C,null,Y,x.x,x.y,x.width,x.height,e)}function y(e){var x=e.toLowerCase().replace(/\s/g,"");return x==="#000"||x==="#000000"||x==="black"||x==="rgb(0,0,0)"}function b(e){var x=e.toLowerCase().replace(/\s/g,"");return x==="#fff"||x==="#ffffff"||x==="white"||x==="rgb(255,255,255)"}function T(e){var x=e.toLowerCase().replace(/\s/g,"");return x==="transparent"||x==="rgba(0,0,0,0)"||x==="#00000000"||x==="none"}function I(e,x){if(!e)return"";var C=!!(x&&x.joinDashArray),S=Array.isArray(e)?e.join(";"):e;S=S.replace(/,\s*(?=[a-z])/gi,";");for(var Y=[],D=0,At=S.split(";"),U=0;U<At.length;U++){var q=At[U].split(":");if(!(q.length<2)){var rt=q[0].trim(),ct=q.slice(1).join(":").trim();if(!(!rt||!ct))switch(rt){case"fill":case"background-color":case"background":Y.push("fillColor="+(T(ct)?"none":b(ct)?"default":ct));break;case"stroke":Y.push("strokeColor="+(T(ct)?"none":y(ct)?"default":ct));break;case"stroke-width":Y.push("strokeWidth="+parseFloat(ct));break;case"color":Y.push("fontColor="+(y(ct)?"default":ct));break;case"stroke-dasharray":Y.push("dashed=1");var nt=ct.trim();if(C&&nt.indexOf(",")<0&&/^\d+(\s+\d+)+$/.test(nt)){var zt=nt.replace(/\s+/g,"");Y.push("dashPattern="+zt+" "+zt),Y.push("fixDash=1")}else{var Ot=nt.split(/[\s,]+/);Ot.length>=2&&(Y.push("dashPattern="+Ot.join(" ")),Y.push("fixDash=1"))}break;case"font-weight":var Ft=parseInt(ct,10);(ct==="bold"||ct==="bolder"||!isNaN(Ft)&&Ft>=600)&&(D|=1);break;case"font-style":(ct==="italic"||ct==="oblique")&&(D|=2);break}}}return D!==0&&Y.push("fontStyle="+D),Y.length>0?Y.join(";")+";":""}function F(e){for(var x=e.split(";"),C=null,S={},Y=[],D=0;D<x.length;D++){var At=x[D].trim();if(At){var U=At.indexOf("=");if(U>0){var q=At.substring(0,U);S.hasOwnProperty(q)||Y.push(q),S[q]=At.substring(U+1)}else C=At}}for(var rt=C!=null?[C]:[],D=0;D<Y.length;D++)rt.push(Y[D]+"="+S[Y[D]]);return rt.join(";")+";"}function X(e){for(var x=e.getModel(),C=e.getDefaultParent(),S=x.getChildCount(C),Y=1/0,D=1/0,At=0;At<S;At++){var U=x.getChildAt(C,At),q=x.getGeometry(U);if(q!=null){if(x.isVertex(U)&&(q.x<Y&&(Y=q.x),q.y<D&&(D=q.y)),q.points)for(var rt=0;rt<q.points.length;rt++){var ct=q.points[rt];ct.x<Y&&(Y=ct.x),ct.y<D&&(D=ct.y)}q.sourcePoint&&(q.sourcePoint.x<Y&&(Y=q.sourcePoint.x),q.sourcePoint.y<D&&(D=q.sourcePoint.y)),q.targetPoint&&(q.targetPoint.x<Y&&(Y=q.targetPoint.x),q.targetPoint.y<D&&(D=q.targetPoint.y))}}if(!(!isFinite(Y)||!isFinite(D))){var nt=Y<0?-Y:0,zt=D<0?-D:0;if(!(nt===0&&zt===0))for(var At=0;At<S;At++){var U=x.getChildAt(C,At),q=x.getGeometry(U);if(q!=null){var Ot=q.clone();if(x.isVertex(U)&&(Ot.x+=nt,Ot.y+=zt),Ot.points)for(var rt=0;rt<Ot.points.length;rt++)Ot.points[rt]=new mxPoint(Ot.points[rt].x+nt,Ot.points[rt].y+zt);Ot.sourcePoint&&(Ot.sourcePoint=new mxPoint(Ot.sourcePoint.x+nt,Ot.sourcePoint.y+zt)),Ot.targetPoint&&(Ot.targetPoint=new mxPoint(Ot.targetPoint.x+nt,Ot.targetPoint.y+zt)),x.setGeometry(U,Ot)}}}}function K(e){if(!e)return e;var x=F(e);return/(^|;)dashed=1(;|$)/.test(x)&&!/(^|;)fixDash=/.test(x)&&(x+="fixDash=1;"),x}function ot(e){var x=e.getModel();function C(S){var Y=x.getStyle(S);if(Y){var D=K(Y);D!==Y&&x.setStyle(S,D)}for(var At=x.getChildCount(S),U=0;U<At;U++)C(x.getChildAt(S,U))}C(x.getRoot())}function pt(e){X(e),ot(e);var x=new mxCodec,C=x.encode(e.getModel());return mxUtils.getXml(C)}function xt(e){return Math.round(e*100)/100}function ee(e,x,C){return Math.abs((x.x-e.x)*(C.y-e.y)-(C.x-e.x)*(x.y-e.y))<1}function N(e,x,C,S){if(e<=0||x<=0)return{x:.5,y:.5};if(C===0&&S===0)return{x:.5,y:.5};var Y=e/2,D=x/2,At=C!==0?Y/Math.abs(C):1/0,U=S!==0?D/Math.abs(S):1/0,q=Math.min(At,U),rt=C*q,ct=S*q;return{x:xt((rt+Y)/e),y:xt((ct+D)/x)}}function Q(e,x){return Math.abs(x.x-e.cx)>=e.hw||Math.abs(x.y-e.cy)>=e.hh}function at(e,x,C){var S=e.hw,Y=e.hh,D=Math.abs(x.y-C.y),At=Math.abs(x.x-C.x);if(Math.abs(e.cy-x.y)*S>Math.abs(e.cx-x.x)*Y){var U=C.y<x.y?x.y-Y-e.cy:e.cy-Y-x.y,q=D===0?0:At*U/D;return{x:C.x<x.x?C.x+q:C.x-At+q,y:C.y<x.y?C.y+D-U:C.y-D+U}}else{var rt=C.x<x.x?x.x-S-e.cx:e.cx-S-x.x,ct=At===0?0:D*rt/At;return{x:C.x<x.x?C.x+At-rt:C.x-At+rt,y:C.y<x.y?C.y+ct:C.y-ct}}}function _(e,x){for(var C=[],S=e[0],Y=!1,D=0;D<e.length;D++){var At=e[D];if(!Q(x,At)&&!Y){for(var U=at(x,S,At),q=!1,rt=0;rt<C.length;rt++)if(C[rt].x===U.x&&C[rt].y===U.y){q=!0;break}q||C.push(U),Y=!0}else S=At,Y||C.push(At)}return C}function l(e,x,C,S,Y){var D;switch(e.shape){case"lollipopInterface":D=r(C,x,null,u(e.labelText),e.x,e.y,e.width,e.height,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+j.fontColor+";");break;case"class_box":case"classBox":var At=e.members||(e.classData?e.classData.members:[])||[],U=e.methods||(e.classData?e.classData.methods:[])||[],q=e.annotations||(e.classData?e.classData.annotations:[])||[],rt="<b>"+mxUtils.htmlEntities(u(e.labelText,e.type))+"</b>",ct=q.length>0?"spacingTop="+q.length*24+";":"",nt=e.drawio&&e.drawio.classLayout,Xe=nt?nt.rowH:24,zt=nt?nt.titleH:48+q.length*24,Ot=At.length===0&&U.length===0,Ft=nt?nt.membersH:At.length===0?Ot?18:24:Xe*(At.length+1),Pt=I(e.cssStyles),Wt=j.fillColor,Kt=Pt.match(/fillColor=([^;]+);?/);Kt&&(Wt=Kt[1]);var Bt=j.fontColor,ce=Pt.match(/fontColor=([^;]+);?/);ce&&(Bt=ce[1]);var kt="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=16;movable=0;resizable=0;rotatable=0;points=[];fontFamily="+j.fontFamily+";fontColor="+Bt+";",wt=function(an){for(var Ka=0;Ka<q.length;Ka++)r(C,an,null,"\xAB"+mxUtils.htmlEntities(u(q[Ka]))+"\xBB",0,12+Ka*24,e.width,24,kt)},jt=nt&&nt.hideCompartments;if(jt){D=r(C,x,null,rt,e.x,e.y,e.width,e.height,"rounded=0;whiteSpace=wrap;html=1;fontStyle=1;fontSize=16;align=center;verticalAlign=middle;"+ct+Pt),wt(D);break}var Ht=Ot?6:12;D=r(C,x,null,rt,e.x,e.y,e.width,e.height,"swimlane;html=1;fontStyle=1;fontSize=16;align=center;verticalAlign=middle;horizontal=1;childLayout=stackLayout;startSize="+zt+";horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginTop="+Ht+";marginBottom="+Ht+";stackSpacing=0;swimlaneFillColor="+Wt+";whiteSpace=wrap;"+ct+Pt),wt(D);for(var qt="text;fontSize=16;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=10;spacingRight=12;spacingBottom=2;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontFamily="+j.fontFamily+";fontColor="+j.fontColor+";",re=function(an,Ka){if(typeof an!="string")return{label:an,style:Ka};var En=an.replace(/\s+$/,""),Dn=En.charAt(En.length-1);return Dn==="$"?{label:En.slice(0,-1).replace(/\s+$/,""),style:Ka+"fontStyle=4;"}:Dn==="*"?{label:En.slice(0,-1).replace(/\s+$/,""),style:Ka+"fontStyle=2;"}:{label:an,style:Ka}},Ut=0;Ut<At.length;Ut++){var ve=re(At[Ut],qt);r(C,D,null,u(ve.label),0,zt+12+Ut*Xe,e.width,Xe,ve.style)}var we="line;strokeWidth=1;fillColor=none;spacingLeft=3;spacingRight=3;rotatable=0;points=[];strokeColor=inherit;",Se=Pt.match(/strokeWidth=([^;]+)/);Se&&(we+="strokeWidth="+Se[1]+";"),/(^|;)dashed=1/.test(Pt)&&(we+="dashed=1;");var be=Pt.match(/dashPattern=([^;]+)/);be&&(we+="dashPattern="+be[1]+";"),/(^|;)fixDash=1/.test(Pt)&&(we+="fixDash=1;"),r(C,D,null,null,0,zt+Ft-12,e.width,24,we);for(var Ut=0;Ut<U.length;Ut++){var Me=re(U[Ut],qt);r(C,D,null,u(Me.label),0,zt+Ft+12+Ut*Xe,e.width,Xe,Me.style)}break;case"note":var Fe=String(e.labelText||"").split(/\r?\n/).map(function(an){return an.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}).join("<br>");D=r(C,x,null,Fe,e.x,e.y,e.width+16,e.height,"rounded=0;whiteSpace=wrap;html=1;align=left;spacingLeft=8;spacingRight=8;fillColor="+p.noteFill+";strokeColor="+p.noteStroke+";strokeWidth=1.3;"+(p.noteFont?"fontColor="+p.noteFont+";":""));break;case"squareRect":if(e.cssStyles&&e.cssStyles.indexOf("opacity: 0;")>=0){D=n("fillColor=none;strokeColor=none;",e,x,C),D.overrideArrowHead="circle";break}case"rect":case"square":case"round":case"rounded":case"group":case"event":case"process":case"rectangle":case"proc":var Ue="";e.isStateDiagram?Ue="rounded=1;absoluteArcSize=1;arcSize=10;":(e.shape=="rounded"||e.type=="round")&&(Ue="rounded=1;absoluteArcSize=1;arcSize="+(e.mindmap?"7;":"10;")),D=n(Ue+"html=1;whiteSpace=wrap;strokeWidth=1;"+(e.type=="group"?"verticalAlign=top;":"")+(e.mindmap&&!e.mindmapRoot&&e.mindmapLine?"footerSize=2;footerColor=light-dark("+e.mindmapLine+",#cccccc);":""),e,x,C);break;case"question":case"choice":case"diamond":case"diam":case"decision":e.shape=="choice"&&(e.labelText=""),D=n("rhombus;strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"stadium":case"pill":case"terminal":D=n("rounded=1;whiteSpace=wrap;arcSize=50;strokeWidth=1;",e,x,C);break;case"subroutine":case"subproc":case"fr-rect":case"framed-rectangle":case"subprocess":D=n("strokeWidth=1;shape=process;whiteSpace=wrap;size=0.04;",e,x,C);break;case"cylinder":case"cyl":case"database":case"db":var De=Y==="block"?0:1,Ye="shape=cylinder3;boundedLbl="+De+";backgroundOutline=1;size=10;strokeWidth=1;whiteSpace=wrap;";if(Y==="block"&&e.width){var Pe=e.width/2/(2.5+e.width/50);Ye="shape=cylinder3;boundedLbl=0;backgroundOutline=1;size="+Math.round(Pe*10)/10+";spacingTop="+Math.round(Pe)+";strokeWidth=1;whiteSpace=wrap;"}D=n(Ye,e,x,C);break;case"circle":case"circ":D=n("ellipse;aspect=fixed;strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"odd":case"odd_right":case"rect_left_inv_arrow":Y==="block"&&e.height?D=n("shape=mermaidOdd;strokeWidth=1;html=1;",e,x,C):D=n("shape=mermaidOdd;strokeWidth=1;whiteSpace=wrap;html=1;",e,x,C);break;case"block-arrow":var de=(e.directions||["right"]).join(",");D=n("shape=mermaidBlockArrow;dirs="+de+";nodePadding=8;strokeWidth=1;whiteSpace=wrap;html=1;",e,x,C);break;case"trapezoid":case"trap-b":case"priority":case"trapezoid-bottom":D=n("shape=trapezoid;perimeter=trapezoidPerimeter;fixedSize=1;size="+e.height/2+";strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"inv_trapezoid":case"manual":case"trap-t":case"trapezoid-top":D=n("shape=trapezoid;perimeter=trapezoidPerimeter;fixedSize=1;size="+e.height/2+";strokeWidth=1;whiteSpace=wrap;flipV=1;",e,x,C);break;case"lean_right":case"lean-right":case"lean-r":case"in-out":D=n("shape=parallelogram;perimeter=parallelogramPerimeter;fixedSize=1;size="+e.height/2+";strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"lean_left":case"lean-left":case"lean-l":case"out-in":D=n("shape=parallelogram;perimeter=parallelogramPerimeter;fixedSize=1;size="+e.height/2+";strokeWidth=1;whiteSpace=wrap;flipH=1;",e,x,C);break;case"doublecircle":case"double-circle":case"dbl-circ":case"framed-circle":case"fr-circ":case"stop":(e.shape=="framed-circle"||e.shape=="fr-circ"||e.shape=="stop")&&(e.labelText=""),D=n("ellipse;shape=doubleEllipse;aspect=fixed;strokeWidth=1;whiteSpace=wrap;",e,x,C);break;case"hexagon":case"hex":case"prepare":D=n("shape=hexagon;perimeter=hexagonPerimeter2;fixedSize=1;size="+e.height/4+";strokeWidth=1;whiteSpace=wrap;",e,x,C),e.mindmap&&!e.mindmapRoot&&e.mindmapLine&&r(C,D,null,"",0,e.height-2,e.width,1,"line;strokeWidth=3;strokeColor=light-dark("+e.mindmapLine+",#cccccc);");break;case"start":case"f-circ":case"filled-circle":case"junction":e.labelText="",D=n("ellipse;fillColor=strokeColor;",e,x,C);break;case"stateStart":e.labelText="",D=n("ellipse;fillColor="+E.darkColor+";strokeColor="+E.darkColor+";",e,x,C);break;case"end":e.labelText="",D=n("ellipse;shape=endState;fillColor=strokeColor;",e,x,C);break;case"stateEnd":e.labelText="",D=n("ellipse;fillColor="+E.fillColor+";strokeColor="+E.darkColor+";strokeWidth=2;centerRadius=4;centerColor="+E.strokeColor+";",e,x,C);break;case"roundedWithTitle":var Ve=e.compoundDepth&&e.compoundDepth%2===1?"light-dark(#f0f0f0,#2a2a2a)":E.innerFillColor;D=n("swimlane;html=1;fontStyle=0;align=center;verticalAlign=middle;startSize=30;container=0;collapsible=0;rounded=1;absoluteArcSize=1;arcSize=16;footerSize=4;dropTarget=0;pointerEvents=0;swimlaneFillColor="+Ve+";fillColor="+E.fillColor+";strokeColor="+E.strokeColor+";fontColor="+j.fontColor+";fontFamily="+j.fontFamily+";fontSize=16;",e,x,C);break;case"parallelRegion":e.labelText="",D=n("rounded=0;whiteSpace=wrap;html=1;dashed=1;dashPattern=10 10;fillColor=light-dark(#f0f0f0,#2a2a2a);strokeColor="+E.strokeColor+";strokeWidth=1;",e,x,C);break;case"noteGroup":e.labelText="",D=n("rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;",e,x,C);break;case"stateDivider":D=n("line;strokeColor=light-dark(#9370DB,#cccccc);strokeWidth=1;dashed=1;dashPattern=5 5;fillColor=none;",e,x,C);break;case"fork":case"join":e.labelText="",e.isStateDiagram?D=n("rounded=1;absoluteArcSize=1;arcSize=2;fillColor="+E.darkColor+";strokeColor="+E.darkColor+";strokeWidth=1;perimeterSpacing=2;",e,x,C):D=n("shape=line;strokeWidth="+(e.height-5)+";",e,x,C);break;case"divider":e.labelText="",D=n("fillColor=light-dark(#F0F0F0,#2a2a2a);dashed=1;dashPattern=10 10;",e,x,C);break;case"lifeline":var Ne="participant=";switch(e.type){case"actor":Ne+="seqActorStick;";break;case"boundary":Ne+="seqBoundary;";break;case"control":Ne+="seqControl;";break;case"entity":Ne+="seqEntity;";break;case"database":Ne+="seqDatabase;";break;case"queue":Ne+="seqQueue;";break;case"collections":Ne+="seqCollections;";break;default:Ne=""}switch(e.type){case"actor":case"database":case"boundary":case"control":case"entity":Ne+="verticalAlign=bottom;align=center;spacingBottom=4;";break;case"queue":case"collections":Ne+="verticalAlign=middle;align=center;";break}var nr;switch(e.type){case"database":nr=80;break;case"boundary":case"control":case"entity":nr=80;break;case"queue":case"collections":nr=65;break;case"actor":nr=90;break;default:nr=e.size||50}Ne+="size="+nr+";",e.mirror&&(e.height=Math.round(e.y+e.height)-Math.round(e.y)+nr,Ne+="lifelineMirror=1;"),e.labelText=e.description||e.labelText,D=n('shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","elbow":"vertical","curved":0,"rounded":0};lifelineDashed=0;strokeWidth=2;rounded=1;absoluteArcSize=1;arcSize=6;lifelineColor='+p.lifelineColor+";"+o()+Ne,e,x,C);break;case"seqActor":var Ge="",Ie=0;switch(e.type){case"actor":Ge="participant=seqActorStick;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=90;break;case"boundary":Ge="participant=seqBoundary;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=80;break;case"control":Ge="participant=seqControl;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=80;break;case"entity":Ge="participant=seqEntity;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=80;break;case"database":Ge="participant=seqDatabase;verticalAlign=bottom;align=center;spacingBottom=4;",Ie=80;break;case"queue":Ge="participant=seqQueue;verticalAlign=middle;align=center;",Ie=65;break;case"collections":Ge="participant=seqCollections;verticalAlign=middle;align=center;",Ie=65;break;default:D=n("rounded=1;absoluteArcSize=1;arcSize=6;verticalAlign=middle;align=center;strokeWidth=2;whiteSpace=wrap;"+o(),e,x,C)}D==null&&(e.height=Ie,D=n("shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;lifelineDashed=0;strokeWidth=2;rounded=1;absoluteArcSize=1;arcSize=6;lifelineColor="+p.lifelineColor+";"+o()+"size="+Ie+";"+Ge,e,x,C));break;case"activation":D=n('points=[];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","elbow":"vertical","curved":0,"rounded":0};fillColor='+p.activationFill+";strokeColor="+p.activationStroke+";",e,x,C);break;case"seqNote":e.labelText=e.message||e.labelText,D=n("fillColor="+p.noteFill+";strokeColor="+p.noteStroke+";"+(p.noteFont?"fontColor="+p.noteFont+";":""),e,x,C);break;case"seqRect":var Ce=e.bgColor||"#ECECFF",Ke=e.bgAlpha!=null?Math.round(e.bgAlpha*100):100;D=n("rounded=0;strokeColor=none;fillColor="+Ce+";fillOpacity="+Ke+";pointerEvents=0;",e,x,C);break;case"loop":e.labelText=e.type||"";var We=50,le=20,Ae=p.loopFont||j.fontColor;if(D=n("shape=umlFrame;dashed=1;fixDash=1;dashPattern=2 2;strokeWidth=2;pointerEvents=0;dropTarget=0;fillColor="+p.labelBoxFill+";strokeColor="+p.labelBoxStroke+";fontSize=16;align=center;verticalAlign=middle;fontFamily="+j.fontFamily+";fontColor="+Ae+";height="+le+";width="+We+";",e,x,C),e.title){var Le="["+e.title+"]",Re=typeof mxUtils!="undefined"&&mxUtils.getSizeForString?mxUtils.getSizeForString(Le,16,j.fontFamily,null,0):{width:Le.length*9},Be=e.width-We-4,je=Math.max(1,Math.ceil((Re.width+8)/Math.max(Be,1))),zt=16*je;r(C,D,null,u(Le),We+4,2,Be,zt,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+Ae+";")}if(e.sections!=null)for(var ie=0;ie<e.sections.length;ie++){var fr=e.sections[ie],Ar=e.sectionTitles?e.sectionTitles[ie]:null,Lr=Ar&&Ar.message?"["+Ar.message+"]":"";if(r(C,D,null,null,0,fr.y-e.y,e.width,1,"shape=line;dashed=1;fixDash=1;dashPattern=2 2;strokeColor="+p.labelBoxStroke+";"),Lr){var tn=16;r(C,D,null,u(Lr),0,fr.y-e.y+2,e.width,tn,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+Ae+";")}}break;case"erdEntity":let _n=function(an){return an?typeof mxUtils!="undefined"&&mxUtils.getSizeForString?mxUtils.getSizeForString(an,16,$r,null,0).width:an.length*9:0};var Ze=e.entityData?e.entityData.attributes:[],dr=Ze.length,Xe=dr>0?e.height/(dr+1):e.height,br=Xe,vr=br,gr=0,fa=0,Je=0,$e=0,Qr=25,$r="Trebuchet MS,Verdana,Arial,sans-serif",Ir="1",Cr=j.strokeColor,Ea=I(e.cssStyles,{joinDashArray:!0}),xa=Ea.match(/(?:^|;)fillColor=([^;]+)/),aa=xa?xa[1]==="default"?null:xa[1]:null,Gr=Ea.match(/(?:^|;)strokeColor=([^;]+)/);Gr&&Gr[1]!=="default"&&(Cr=Gr[1]);var ya=Ea.match(/(?:^|;)strokeWidth=([^;]+)/);ya&&(Ir=ya[1]);for(var Ut=0;Ut<Ze.length;Ut++){Ze[Ut].attributeType=Ze[Ut].attributeType||Ze[Ut].type,Ze[Ut].attributeName=Ze[Ut].attributeName||Ze[Ut].name,Ze[Ut].attributeKeyTypeList=Ze[Ut].attributeKeyTypeList||Ze[Ut].keys,Ze[Ut].attributeComment=Ze[Ut].attributeComment||Ze[Ut].comment;var Br=Ze[Ut].attributeKeyTypeList,pa=Br&&Br.length>0?Br.join():Ze[Ut].attributeKeyType;Ze[Ut]._keysText=pa||"",gr=Math.max(gr,_n(Ze[Ut].attributeType)+Qr),fa=Math.max(fa,_n(Ze[Ut].attributeName)+Qr),pa&&(Je=Math.max(Je,_n(pa)+Qr)),Ze[Ut].attributeComment&&($e=Math.max($e,_n(Ze[Ut].attributeComment)+Qr))}var i=Math.max(fa+gr+Je+$e,e.width);D=r(C,x,null,u(e.entityData&&e.entityData.alias?e.entityData.alias:e.labelText,null,{markdown:!0}),e.x,e.y,i,e.height,"shape=table;startSize="+(Ze.length==0?e.height:br)+";container=1;collapsible=0;childLayout=tableLayout;fixedRows=1;rowLines=1;fontSize=16;fontFamily="+$r+";strokeWidth="+Ir+";align=center;resizeLast=1;html=1;");for(var m=Math.max(fa,i-gr-Je-$e),Ut=0;Ut<Ze.length;Ut++){var k=Ut%2===0?"light-dark(#ffffff,#1f2020)":aa||"light-dark(#F1F1FF,#1f2020)",R=r(C,D,null,null,0,vr,i,Xe,"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=1;fillColor="+k+";strokeColor=inherit;strokeWidth="+Ir+";collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;"),$="shape=partialRectangle;connectable=0;fillColor=none;strokeColor="+Cr+";strokeWidth="+Ir+";fontColor="+j.fontColor+";fontFamily="+$r+";top=1;left=1;bottom=1;right=1;align=left;spacingLeft=8;overflow=hidden;fontSize=16;",et=[{value:Ze[Ut].attributeType,w:gr},{value:Ze[Ut].attributeName,w:m}];Je>0&&et.push({value:Ze[Ut]._keysText,w:Je}),$e>0&&et.push({value:Ze[Ut].attributeComment,w:$e});for(var vt=0,Et=0;Et<et.length;Et++)r(C,R,null,u(et[Et].value),vt,0,et[Et].w,Xe,$),vt+=et[Et].w;vr+=Xe}break;case"element":case"requirement":var Yt=e.shape=="element",Gt="<<"+(Yt?"Element":e.data?e.data.type:"")+`>>
+`,he=I(e.cssStyles),_e=j.fontColor,He="",qe=he.match(/(?:^|;)fontColor=([^;]+)/);qe&&qe[1]!=="default"&&(_e=qe[1]);var Er=he.match(/(?:^|;)fontStyle=([^;]+)/);Er&&(He="fontStyle="+Er[1]+";");var Tr=he.match(/(?:^|;)fillColor=([^;]+)/),Vr=Tr&&Tr[1]!=="default"?Tr[1]:"#ECECFF",Zr=68;D=r(C,x,null,"",e.x,e.y,e.width,e.height,"rounded=0;whiteSpace=wrap;html=1;"+he);var ua=he.match(/(?:^|;)strokeColor=([^;]+)/),Aa=ua?ua[1]:"#9370DB";r(C,D,null,"",0,Zr,e.width,1,"shape=line;strokeColor="+Aa+";strokeWidth=1;");var La="&lt;&lt;"+(Yt?"Element":e.data?e.data.type:"")+"&gt;&gt;",Fa=u(e.data?e.data.name:e.labelText,null,{markdown:!0}),$a="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rotatable=0;connectable=0;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+_e+";"+He;r(C,D,null,La,0,8,e.width,24,$a),r(C,D,null,"<b>"+Fa+"</b>",0,32,e.width,24,$a);var _r=[];if(Yt)_r.push("Type: "+(e.data?e.data.type:"")),e.data&&e.data.docRef&&_r.push("Doc Ref: "+e.data.docRef);else{var wa={low:"Low",medium:"Medium",high:"High"},mr={analysis:"Analysis",demonstration:"Demonstration",inspection:"Inspection",test:"Test"},tr=e.data?e.data.risk:"",jr=e.data?e.data.verifyMethod:"";_r.push("ID: "+(e.data?e.data.requirementId||e.data.id:"")),_r.push("Text: "+(e.data?e.data.text:"")),_r.push("Risk: "+(wa[tr.toLowerCase()]||tr)),_r.push("Verification: "+(mr[jr.toLowerCase()]||jr))}for(var va=24,na="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=6;spacingRight=6;overflow=hidden;rotatable=0;connectable=0;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+_e+";"+He,da=0;da<_r.length;da++)r(C,D,null,u(_r[da],null,{markdown:!0}),0,Zr+8+da*va,e.width,va,na);break;case"rectCloud":D=n("shape=mxgraph.basic.cloud_rect;strokeWidth=1;",e,x,C);break;case"cloud":D=n("ellipse;shape=cloud;whiteSpace=wrap;strokeWidth=1;",e,x,C);break;case"mindmapBang":D=n("shape=mindmapBang;whiteSpace=wrap;strokeWidth=1;",e,x,C);break;case"roundedRect":e.mindmap?D=n("rounded=1;arcSize=5;absoluteArcSize=1;whiteSpace=wrap;strokeWidth=1;"+(e.mindmapLine?"footerSize=2;footerColor=light-dark("+e.mindmapLine+",#cccccc);":""),e,x,C):D=n("rounded=1;arcSize=20;strokeWidth=1",e,x,C);break;case"manual-file":D=n("shape=offPageConnector;whiteSpace=wrap;size=1;verticalAlign=top;strokeWidth=1",e,x,C);break;case"manual-input":case"sl-rect":case"sloped-rectangle":D=n("shape=manualInput;whiteSpace=wrap;boundedLbl=1;strokeWidth=1",e,x,C);break;case"docs":case"documents":case"st-doc":case"stacked-document":D=n("shape=mxgraph.flowchart.multi-document;whiteSpace=wrap;boundedLbl=1;strokeWidth=1",e,x,C);break;case"procs":case"processes":case"st-rect":case"stacked-rectangle":D=n("shape=mxgraph.basic.layered_rect;dx=10;flipV=1;whiteSpace=wrap;boundedLbl=1;strokeWidth=1",e,x,C);break;case"paper-tape":case"flag":D=n("shape=tape;size=0.3;whiteSpace=wrap;boundedLbl=1;strokeWidth=1",e,x,C);break;case"text":D=n("text;verticalAlign=middle;align=center;whiteSpace=wrap",e,x,C);break;case"notch-rect":case"card":case"notched-rectangle":D=n("shape=card;whiteSpace=wrap;size=20;arcSize=12;strokeWidth=1",e,x,C);break;case"lin-rect":case"lin-proc":case"lined-process":case"lined-rectangle":case"shaded-process":D=n("shape=internalStorage;whiteSpace=wrap;dx=8;dy=0;strokeWidth=1",e,x,C);break;case"sm-circ":case"small-circle":e.labelText="",D=n("ellipse;strokeWidth=1",e,x,C);break;case"hourglass":case"collate":D=n("shape=collate;whiteSpace=wrap;strokeWidth=1",e,x,C);break;case"comment":case"brace-l":case"brace":e.width=20,D=n("shape=curlyBracket;whiteSpace=wrap;rounded=1;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;strokeWidth=1",e,x,C);break;case"brace-r":e.x+=e.width-20,e.width=20,D=n("shape=curlyBracket;whiteSpace=wrap;rounded=1;flipH=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;strokeWidth=1",e,x,C);break;case"braces":D=n("group;verticalAlign=middle;",e,x,C),r(C,D,null,"",0,0,20,e.height,"shape=curlyBracket;rounded=1;strokeWidth=1"),r(C,D,null,"",e.width-20,0,20,e.height,"shape=curlyBracket;flipH=1;rounded=1;strokeWidth=1");break;case"bolt":case"com-link":case"lightning-bolt":e.labelText="",D=n("shape=mxgraph.basic.flash;strokeWidth=1",e,x,C);break;case"doc":case"document":D=n("strokeWidth=1;shape=document;whiteSpace=wrap;boundedLbl=1",e,x,C);break;case"delay":case"half-rounded-rectangle":D=n("strokeWidth=1;shape=mxgraph.flowchart.delay;whiteSpace=wrap",e,x,C);break;case"das":case"h-cyl":case"horizontal-cylinder":D=n("shape=cylinder3;whiteSpace=wrap;boundedLbl=1;backgroundOutline=1;size=4;rotation=90;horizontal=0;strokeWidth=1",e,x,C);break;case"lin-cyl":case"disk":case"lined-cylinder":D=n("shape=datastore;whiteSpace=wrap;strokeWidth=1",e,x,C);break;case"curv-trap":case"curved-trapezoid":case"display":D=n("shape=display;whiteSpace=wrap;strokeWidth=1",e,x,C);break;case"div-rect":case"div-proc":case"divided-process":case"divided-rectangle":D=n("shape=internalStorage;whiteSpace=wrap;backgroundOutline=1;dx=0;dy=8;strokeWidth=1",e,x,C);break;case"tri":case"triangle":case"extract":D=n("verticalLabelPosition=middle;verticalAlign=bottom;shape=mxgraph.basic.acute_triangle;dx=0.5;labelPosition=center;align=center;strokeWidth=1",e,x,C);break;case"win-pane":case"window-pane":case"internal-storage":D=n("shape=internalStorage;whiteSpace=wrap;backgroundOutline=1;dx=8;dy=8;strokeWidth=1",e,x,C);break;case"lin-doc":case"lined-document":D=n("strokeWidth=1;shape=document;whiteSpace=wrap;boundedLbl=1",e,x,C),r(C,D,null,"",8,0,1,Math.round(e.height*88.75)/100,"line;strokeWidth=1;direction=south");break;case"notch-pent":case"notched-pentagon":case"loop-limit":D=n("shape=loopLimit;whiteSpace=wrap;strokeWidth=1",e,x,C);break;case"flip-tri":case"flipped-triangle":D=n("verticalLabelPosition=middle;verticalAlign=top;shape=mxgraph.basic.acute_triangle;dx=0.5;labelPosition=center;align=center;strokeWidth=1;flipV=1",e,x,C);break;case"bow-rect":case"bow-tie-rectangle":case"stored-data":D=n("shape=dataStorage;whiteSpace=wrap;fixedSize=1;size=5;strokeWidth=1",e,x,C);break;case"cross-circ":case"crossed-circle":case"summary":D=n("shape=sumEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;backgroundOutline=1;strokeWidth=1",e,x,C);break;case"tag-doc":case"tagged-document":D=n("strokeWidth=1;shape=document;whiteSpace=wrap",e,x,C),r(C,D,null,"",Math.round(e.width*95.91)/100,Math.round(e.height*58.02)/100,1,Math.round(e.height*23.46)/100,"line;strokeWidth=1;direction=south;rotation=45");break;case"tag-rect":case"tagged-rectangle":case"tag-proc":case"tagged-process":D=n("rect;strokeWidth=1;whiteSpace=wrap",e,x,C),r(C,D,null,"",Math.round(e.width*95.27)/100,Math.round(e.height*70.37)/100,1,Math.round(e.height*35.2)/100,"line;strokeWidth=1;direction=south;rotation=45");break;case"imageSquare":var Ia=e.constraint=="on",ln=e.pos=="t";D=n("shape=image;imageAspect="+(Ia?"1;":"0;")+(ln?"verticalLabelPosition=top;verticalAlign=bottom;":"verticalLabelPosition=bottom;verticalAlign=top;")+"image="+f(e.img),e,x,C);break;case"icon":case"iconSquare":case"iconCircle":case"iconRounded":var Ma=e.iconLayout||{},ln=e.pos==="t",hn=Ma.boxW||48,Ra=Ma.boxH||48,wn=Ma.iconSize||48,tn=Ma.labelH||0,yn=Ma.labelPad||0,gn=Ra+tn+yn,un=Math.max(hn,Ma.labelW||0),za=u(e.labelText||""),bn=za?'<span style="background:#e8e8e8;padding:4px 8px;">'+za+"</span>":"";D=r(C,x,null,bn,e.x,e.y,un,gn,"rounded=0;strokeColor=none;fillColor=none;verticalLabelPosition="+(ln?"top":"bottom")+";verticalAlign="+(ln?"bottom":"top")+";labelPosition=center;align=center;html=1;whiteSpace=nowrap;fontSize=16;fontFamily="+j.fontFamily+";fontColor="+j.fontColor+";");var ja=(un-hn)/2,vn=ln?tn+yn:0,Pa=null;e.shape==="iconSquare"?Pa="rounded=0;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=#9370DB;strokeWidth=1.3;":e.shape==="iconRounded"?Pa="rounded=1;arcSize=15;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=#9370DB;strokeWidth=1.3;":e.shape==="iconCircle"&&(Pa="ellipse;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=#9370DB;strokeWidth=1.3;"),Pa&&r(C,D,null,"",ja,vn,hn,Ra,Pa);var Ba='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><rect width="80" height="80" style="fill:#087ebf;stroke-width:0px;"/><text transform="translate(21.16 64.67)" style="fill:#fff;font-family:ArialMT,Arial;font-size:67.75px;"><tspan x="0" y="0">?</tspan></text></svg>',en=typeof btoa=="function"?btoa(unescape(encodeURIComponent(Ba))):typeof mxUtils!="undefined"&&mxUtils.toBase64?mxUtils.toBase64(Ba):"",Da=ja+(hn-wn)/2,xn=vn+(Ra-wn)/2;r(C,D,null,"",Da,xn,wn,wn,"shape=image;imageAspect=0;html=1;image=data:image/svg+xml,"+en+";");break;case"gitBranch":D=n("line;dashed=1;dashPattern=2 2;strokeWidth=1;backgroundOutline=0;html=1;"+(e.height>e.width?"direction=south;":"")+"strokeColor=light-dark(#333333,#cccccc);",e,x,C);break;case"gitCommit":var Va="points=[];perimeter=none;";switch(e.type){case 0:D=n("ellipse;strokeWidth=1;"+Va+"strokeColor="+e.color[1]+";fillColor="+e.color[1]+";",e,x,C);break;case 1:D=n("ellipse;strokeWidth=1;"+Va+"strokeColor="+e.color[1]+";fillColor="+e.color[1]+";",e,x,C),r(C,D,null,"",5,5,e.width-10,e.height-10,"shape=umlDestroy;strokeWidth=3;strokeColor="+(e.tagFill||"#ECECFF")+";");break;case 2:{var ea=e.highlightColor||e.color[1],ka=e.tagFill||"#ECECFF";D=n("rounded=0;"+Va+"strokeColor="+ea+";fillColor="+ea+";strokeWidth=1;",e,x,C);var _a=4;r(C,D,null,"",_a,_a,e.width-2*_a,e.height-2*_a,"rounded=0;strokeColor="+ka+";fillColor="+ka+";strokeWidth=1;")}break;case 3:D=n("shape=gitMergeCommit;strokeWidth=1;"+Va+"strokeColor="+e.color[1]+";fillColor="+e.color[1]+";innerColor="+(e.tagFill||"#ECECFF")+";",e,x,C);break;case 4:e.labelText="",D=n("shape=gitCherryPick;strokeWidth=1;"+Va+"strokeColor=light-dark(#333333,#cccccc);fillColor=light-dark(#333333,#cccccc);featureColor=light-dark(#fff,#333333);",e,x,C);break;default:D=n("ellipse;strokeWidth=1;"+Va+"strokeColor="+e.color[1]+";fillColor="+e.color[1]+";",e,x,C);break}if(e.tag||e.tags&&e.tags.length>0){e.tags&&e.tags.length>0&&(e.tag=e.tags.join(", "));var ga=8,Xa=e.tag.length*5+4+ga,rn=15,cn=e.tagFill||"#ECECFF",ia=e.tagStroke||"#C7C7F1";r(C,D,null,u(e.tag),(e.width-Xa)/2,-rn-3,Xa,rn,"shape=gitTag;tabSize="+ga+";tabInset=4;holeSize=1;fillColor="+cn+";strokeColor="+ia+";fontColor="+(e.tagFont||"#131300")+";fontSize="+(e.tagFontSize||10)+";fontFamily=trebuchet ms,verdana,arial,sans-serif;verticalAlign=middle;align=center;spacing=0;")}break;default:D=n("whiteSpace=wrap;strokeWidth=1;",e,x,C)}if(e.link){var Ga=M(e.link);Ga&&C.setAttributeForCell(D,"link",Ga)}if(e.linkTarget&&C.setAttributeForCell(D,"linkTarget",e.linkTarget),e.tooltip&&C.setAttributeForCell(D,"tooltip",e.tooltip),S&&(D.style+="html=1;"),D!=null){var ha="",on=e.type=="group",Ta=on?P.fillColor:j.fillColor,Ha=on?P.strokeColor:j.strokeColor,qa=j.fontColor;e.mindmap&&e.mindmapFill&&(Ta="light-dark("+e.mindmapFill+",#1f2020)",Ha="light-dark("+(e.mindmapStroke||e.mindmapFill)+",#cccccc)",qa="light-dark("+(e.mindmapFont||"#333333")+",#cccccc)"),e.mindmap&&(ha+="treeMoving=1;"),D.style.indexOf("fillColor")<0&&(ha+="fillColor="+Ta+";",on&&Y==="block"&&P.fillOpacity!=null&&D.style.indexOf("fillOpacity")<0&&(ha+="fillOpacity="+P.fillOpacity+";")),D.style.indexOf("strokeColor")<0&&(ha+="strokeColor="+Ha+";",on&&Y==="block"&&P.strokeOpacity!=null&&D.style.indexOf("strokeOpacity")<0&&(ha+="strokeOpacity="+P.strokeOpacity+";")),D.style.indexOf("fontColor")<0&&(ha+="fontColor="+qa+";"),D.style.indexOf("fontFamily")<0&&(ha+="fontFamily="+j.fontFamily+";"),D.style.indexOf("fontSize")<0&&(ha+="fontSize="+j.fontSize+";");var Za=I(e.cssStyles,{joinDashArray:e.shape==="erdEntity"||e.shape==="erEntity"});D.style=F(D.style+";"+ha+Za)}return e.mermaidId&&h(C,D,e.mermaidId),D}function O(e,x){switch(e){case"extension":return x+"Arrow=mermaidExtension;"+x+"Size=17;"+x+"Fill=0";case"composition":return x+"Arrow=mermaidDiamond;"+x+"Size=17;"+x+"Fill=1";case"aggregation":return x+"Arrow=mermaidDiamond;"+x+"Size=17;"+x+"Fill=0";case"requirement_arrow":case"dependency":return x+"Arrow=open;"+x+"Size=16";case"arrow_point":return x+"Arrow=block;"+x+"Size=7";case"block":return x+"Arrow=block;"+x+"Size=8;"+x+"Fill=1";case"arrow_barb":return x+"Arrow=classic;"+x+"Size=9";case"arrow_open":case"none":case void 0:return x+"Arrow=none";case"arrow_circle":return x+"Arrow=oval;"+x+"Size=12;"+x+"Fill=1";case"arrow_cross":return x+"Arrow=cross";case"zero_or_more":case"ZERO_OR_MORE":return x+"Arrow=ERzeroToMany;"+x+"Size=14";case"only_one":case"ONLY_ONE":return x+"Arrow=ERmandOne;"+x+"Size=14";case"one_or_more":case"ONE_OR_MORE":return x+"Arrow=ERoneToMany;"+x+"Size=14";case"zero_or_one":case"ZERO_OR_ONE":return x+"Arrow=ERzeroToOne;"+x+"Size=14";case"circlePlus":case"requirement_contains":return x+"Arrow=circlePlus;"+x+"Size=10;"+x+"Fill=0";case"circle":return x+"Arrow=circle;"+x+"Fill=0";case"lollipop":return x+"Arrow=oval;"+x+"Size=12;"+x+"Fill=0"}return x+"Arrow=none"}function z(e){var x;if(e.relationship&&e.relationship.relSpec?x=[e.useElkLayout?"edgeStyle=orthogonalEdgeStyle;rounded=1;curved=0":"curved=1"]:e.useElkLayout&&e.diagramType==="flowchart"?x=["edgeStyle=orthogonalEdgeStyle;rounded=1;curved=0"]:x=[e.isOrth?"edgeStyle=orthogonalEdgeStyle":"curved=1"],e.relationship){if(e.relationship.relSpec){var C=e.relationship.relSpec;e.arrowTypeStart=C.cardB,e.arrowTypeEnd=C.cardA,e.pattern=C.relType=="NON_IDENTIFYING"?"erDashed":"solid"}else if(e.relationship.type=="contains"||e.relationship.type=="traces"||e.relationship.type=="derives"||e.relationship.type=="satisfies"||e.relationship.type=="verifies"||e.relationship.type=="refines"||e.relationship.type=="copies"){var S=e.relationship.type=="contains";e.pattern=S?"solid":"bigDashed",e.arrowTypeStart=S?"circlePlus":"none",e.arrowTypeEnd=S?"none":"dependency",x.push("labelBackgroundColor=#E8E8E8")}}switch(e.pattern){case"dotted":x.push("dashed=1;dashPattern=2 3;fixDash=1");break;case"dashed":x.push("dashed=1");break;case"erDashed":x.push("dashed=1;dashPattern=8 8");break;case"bigDashed":x.push("dashed=1;dashPattern=10 7;fixDash=1");break}e.classes&&e.classes.indexOf("note-edge")!=-1&&x.push("dashed=1"),x.push(O(e.arrowTypeStart,"start")),x.push(O(e.arrowTypeEnd,"end")),e.strokeWidth?x.push("strokeWidth="+e.strokeWidth):e.thickness=="thick"&&(x.push("strokeWidth=3.5"),x.push("endSize=3"),x.push("startSize=3"));var Y=I(e.style);return Y&&x.push(Y),e.extraStyle&&x.push(e.extraStyle),(x.join(";")+";").replace(/;{2,}/g,";")}function lt(e,x,C,S,Y){if(e.invisible)return null;var D=e.text||e.label||null;D&&e.relationship&&e.relationship.wrapAngleBrackets&&(D="&lt;&lt;"+D+"&gt;&gt;");var At=z(e);e.clusterEntry&&(At+="entryX="+e.clusterEntry.entryX+";entryY="+e.clusterEntry.entryY+";"),e.clusterExit&&(At+="exitX="+e.clusterExit.exitX+";exitY="+e.clusterExit.exitY+";"),e.curved&&(At+="curved=1;");var U=Y.insertEdge(S,null,u(D),x,C,At);if(e.curved&&(e.clusterEntry||e.clusterExit)&&x.geometry&&C.geometry){var q=v(x,x.geometry),rt=v(C,C.geometry),ct=q.x+x.geometry.x+x.geometry.width/2,nt=q.y+x.geometry.y+x.geometry.height/2,zt=rt.x+C.geometry.x+C.geometry.width/2,Ot=rt.y+C.geometry.y+C.geometry.height/2,Ft=zt-ct,Pt=Ot-nt,Wt=Math.sqrt(Ft*Ft+Pt*Pt),Kt=e.clusterEntry||e.clusterExit,Bt=Kt&&(Kt.entryX===0||Kt.entryX===1||Kt.exitX===0||Kt.exitX===1),ce=Math.abs(Bt?Pt:Ft);if(Wt>1&&ce>20){var kt=e.clusterEntry||e.clusterExit,wt=!!e.clusterEntry,jt=wt?C:x,Ht=wt?rt:q,qt=jt.geometry,re=Ht.x+qt.x+(kt.entryX!=null?kt.entryX:kt.exitX!=null?kt.exitX:.5)*qt.width,Ut=Ht.y+qt.y+(kt.entryY!=null?kt.entryY:kt.exitY!=null?kt.exitY:.5)*qt.height,ve,we;Bt?(ve=(ct+zt)/2,we=Ut):(ve=re,we=(nt+Ot)/2),U.geometry.points=[new mxPoint(Math.round(ve),Math.round(we))]}}var Se=e.relationship&&e.relationship.relSpec;if(Se&&(U.style+="strokeColor=light-dark(#333333,#cccccc);strokeWidth=1;"),Se&&e.useElkLayout&&e.points&&e.points.length>=2&&x.geometry&&C.geometry&&U.geometry){var be=v(x,x.geometry),Me=v(C,C.geometry),nt=be.y+x.geometry.y+x.geometry.height/2,Ot=Me.y+C.geometry.y+C.geometry.height/2;if(Ot>nt){for(var Fe=be.y+x.geometry.y+x.geometry.height,Ue=Me.y+C.geometry.y,we=(Fe+Ue)/2,De=e.points,Ye=[],Pe=0,de=1;de<De.length;de++){var Ve=De[de].x-De[de-1].x,Ne=De[de].y-De[de-1].y,nr=Math.sqrt(Ve*Ve+Ne*Ne);Ye.push(nr),Pe+=nr}for(var Ge=0,Ie=-1,de=1;de<De.length;de++){var Ce=De[de-1],Ke=De[de];if(Ce.y!==Ke.y&&(Ce.y-we)*(Ke.y-we)<=0){var We=(we-Ce.y)/(Ke.y-Ce.y);Ie=Ge+We*Ye[de-1];break}Ge+=Ye[de-1]}Ie>=0&&Pe>0&&(U.geometry.x=2*Ie/Pe-1,U.geometry.y=0)}}else e.mindmapEdge&&e.strokeColor?U.style+="strokeColor=light-dark("+e.strokeColor+",#cccccc);":U.style.indexOf("strokeColor")<0&&(U.style+="strokeColor="+w+";");if(e.mindmapEdge&&(U.style+="linecap=square;"),D){var le,Ae,Le={extension:1,composition:1,aggregation:1,dependency:1,lollipop:1,association:1,arrow_point:1,arrow_barb:1},Re=e.relationship&&!e.relationship.relSpec&&Le[e.relationship.type];Se?(le="light-dark(#F8FFEC4D,#2a2a2a4D)",Ae=14):e.isStateDiagram?(le="#E8E8E88D",Ae=16):Re?(le="light-dark(#ECECFF,#1f2020)",Ae=16):(le="light-dark(#E8E8E88D,#2a2a2a8D)",Ae=16),U.style+="html=1;fontSize="+Ae+";labelBackgroundColor="+le+";fontFamily="+j.fontFamily+";fontColor="+j.fontColor+";"}if(e.relationship&&e.relationship.relSpec&&!e.useElkLayout){e.points=null;var Be=x.geometry,je=C.geometry;if(Be&&je){var ie=Be.x+Be.width/2,fr=Be.y+Be.height/2,Ar=je.x+je.width/2,Lr=je.y+je.height/2,Ze=Ar-ie,dr=Lr-fr,Xe,br,vr,gr,fa=e.erSpreadExit&&Math.abs(Ze)>10&&Math.abs(dr)>10,Je=e.erSpreadEntry&&Math.abs(Ze)>10&&Math.abs(dr)>10,$e=.16;Math.abs(dr)>=Math.abs(Ze)?(Xe=fa?Ze>0?1-$e:$e:.5,br=dr>0?1:0,vr=Je?Ze>0?$e:1-$e:.5,gr=dr>0?0:1):(Xe=Ze>0?1:0,br=fa?dr>0?1-$e:$e:.5,vr=Ze>0?0:1,gr=Je?dr>0?$e:1-$e:.5),U.style+="exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";";var Qr=v(x,Be),$r=v(C,je),Ir=Qr.x+Be.x+Xe*Be.width,Cr=Qr.y+Be.y+br*Be.height,Ea=$r.x+je.x+vr*je.width,xa=$r.y+je.y+gr*je.height,aa=Ea-Ir,Gr=xa-Cr;if(Math.abs(aa)>5&&Math.abs(Gr)>5){var ya,Br,pa=e.erSpreadEntry&&!e.erSpreadExit,i=(Ir+Ea)/2,m=(Cr+xa)/2,k=br===0||br===1;k?(ya=pa?Ir:Ea,Br=m):(Br=pa?Cr:xa,ya=i),U.geometry.points||(U.geometry.points=[]),U.geometry.points.push(new mxPoint(Math.round(ya),Math.round(Br)))}}}if(e.bidiSide&&x.geometry&&C.geometry){var R=x.geometry,$=C.geometry,et=v(x,R),vt=v(C,$),Et=et.x+R.x+R.width/2,Yt=et.y+R.y+R.height/2,Gt=vt.x+$.x+$.width/2,he=vt.y+$.y+$.height/2,_e=Gt-Et,He=he-Yt,qe=e.bidiSide==="right"?1:-1,Er=typeof mxUtils!="undefined"&&mxUtils.getSizeForString&&D?mxUtils.getSizeForString(String(D),16,"Trebuchet MS,Verdana,Arial,sans-serif",null,0).width:D?String(D).length*9:0,Tr=Er>0?Math.max(45,Er/2+12):12,Vr=Er>0?13:6;if(Math.abs(He)>=Math.abs(_e)){var Zr=.5+qe*Vr/R.width,ua=.5+qe*Vr/$.width;U.style+="exitX="+Zr+";exitY="+(He>0?1:0)+";entryX="+ua+";entryY="+(He>0?0:1)+";curved=1;",U.geometry.relative=!0,U.geometry.x=0,U.geometry.y=0,U.geometry.offset=new mxPoint(0,0);var Aa=Yt+(He>0?R.height/2:-R.height/2),La=he+(He>0?-$.height/2:$.height/2);e.points=[{x:Et+qe*Vr,y:Aa},{x:(Et+Gt)/2+qe*Tr,y:(Aa+La)/2},{x:Gt+qe*Vr,y:La}]}else{var Fa=.5+qe*Vr/R.height,$a=.5+qe*Vr/$.height;U.style+="exitX="+(_e>0?1:0)+";exitY="+Fa+";entryX="+(_e>0?0:1)+";entryY="+$a+";curved=1;",U.geometry.relative=!0,U.geometry.x=0,U.geometry.y=0,U.geometry.offset=new mxPoint(0,0);var _r=Et+(_e>0?R.width/2:-R.width/2),wa=Gt+(_e>0?-$.width/2:$.width/2);e.points=[{x:_r,y:Yt+qe*Vr},{x:(_r+wa)/2,y:(Yt+he)/2+qe*Tr},{x:wa,y:he+qe*Vr}]}}if(e.points&&e.points.length>=2){U.geometry.points=[];var mr=x.geometry,tr=C.geometry,jr,va,na=0,da=0;if(e.isStateDiagram){jr=v(x,mr),va=v(C,tr);for(var Ia=S;Ia&&Ia.geometry;)na+=Ia.geometry.x||0,da+=Ia.geometry.y||0,Ia=Ia.parent}else jr=x.parent!==S&&x.parent&&x.parent.geometry?x.parent.geometry:{x:0,y:0,width:0,height:0},va=C.parent!==S&&C.parent&&C.parent.geometry?C.parent.geometry:{x:0,y:0,width:0,height:0};var Ma=e.points[0],ln=e.points[e.points.length-1],Xe=Math.max(0,Math.min(1,xt((Ma.x-mr.x-jr.x)/mr.width))),br=Math.max(0,Math.min(1,xt((Ma.y-mr.y-jr.y)/mr.height))),vr=Math.max(0,Math.min(1,xt((ln.x-tr.x-va.x)/tr.width))),gr=Math.max(0,Math.min(1,xt((ln.y-tr.y-va.y)/tr.height))),hn=x.children!=null&&x.children.length>0,Ra=C.children!=null&&C.children.length>0,wn=x.style&&x.style.indexOf("swimlane")>=0,tn=C.style&&C.style.indexOf("swimlane")>=0,ie=mr.x+jr.x+mr.width/2,fr=mr.y+jr.y+mr.height/2,Ar=tr.x+va.x+tr.width/2,Lr=tr.y+va.y+tr.height/2,yn=hn&&!wn&&!e.clusterClipped,gn=Ra&&!tn&&!e.clusterClipped,un=Math.abs(Ar-ie),za=e.isStateDiagram&&yn&&un>mr.width*.2,bn=e.isStateDiagram&&gn&&un>tr.width*.2;if(yn)if(za)Xe=Ar<ie?0:1,br=Lr<fr?.13:.87;else{var ja=N(mr.width,mr.height,Ar-ie,Lr-fr);Xe=ja.x,br=ja.y}if(gn)if(za)vr=.5,gr=Lr<fr?1:0;else{var ja=N(tr.width,tr.height,ie-Ar,fr-Lr);vr=ja.x,gr=ja.y}if(e.isStateDiagram&&!yn&&!gn&&!e.bidiSide){var vn=Lr-fr,Pa=Ar-ie,Ba=Math.abs(vn)>=Math.abs(Pa),en=Ba?vn>0?gr>.95:gr<.05:Pa>0?vr>.95:vr<.05,Da=Ba?vn>0?br<.05:br>.95:Pa>0?Xe<.05:Xe>.95;if(en||Da){var xn=N(mr.width,mr.height,Pa,vn);Xe=xn.x,br=xn.y;var Va=N(tr.width,tr.height,-Pa,-vn);vr=Va.x,gr=Va.y}}if(U.style+="exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";",za){var ea=mr.x+jr.x+Xe*mr.width,ka=mr.y+jr.y+br*mr.height,_a=tr.x+va.x+vr*tr.width,ga=tr.y+va.y+gr*tr.height,Xa=(ea+_a)/2,rn=(ka+ga)/2,cn=Xe===0?-1:1,ve=Xa+cn*10;U.geometry.points.push(new mxPoint(Math.round(ve-na),Math.round(rn-da)))}if(!yn&&!gn)for(var ia=1;ia<e.points.length-1;ia++){var Ga=e.points[ia],ha=Math.round(Ga.x),on=Math.round(Ga.y);ee(Ma,Ga,ln)||U.geometry.points.push(new mxPoint(ha-na,on-da))}var Ta={extension:1,composition:1,aggregation:1,dependency:1,lollipop:1,association:1},Ha={contains:1,traces:1,derives:1,satisfies:1,verifies:1,refines:1,copies:1},qa=e.relationship&&!e.relationship.relSpec?e.relationship.type:null,Za=qa&&Ta[qa],_n=qa&&Ha[qa];if(e.isStateDiagram&&!e.isBidiPair&&!Za&&!_n){var an=mr.x+jr.x+mr.width/2,Ka=mr.y+jr.y+mr.height/2,En=tr.x+va.x+tr.width/2,Dn=tr.y+va.y+tr.height/2,Tn=En-an,On=Dn-Ka,Ji=!hn&&x.style&&x.style.indexOf("ellipse")>=0&&mr.width<=20&&mr.height<=20,ci=hn&&x.style&&x.style.indexOf("swimlane")>=0,Ci=Ra&&C.style&&C.style.indexOf("swimlane")>=0;if((ci?!Ci:Ci)&&Math.abs(Tn)>Math.abs(On)&&Math.abs(Tn)>25){if(ci){Xe=Tn>0?1:0;var Rn=(Dn-mr.y-jr.y)/mr.height;br=Math.max(.12,Math.min(.88,xt(Rn+(Rn<.5?.08:-.08)))),vr=Tn>0?0:1,gr=.5}else Xe=Tn>0?1:0,br=.5,vr=Tn>0?0:1,gr=Math.max(.12,Math.min(.88,xt((Ka-tr.y-va.y)/tr.height)));if(U.style=U.style.replace(/exitX=[^;]*;exitY=[^;]*;entryX=[^;]*;entryY=[^;]*;/,"exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";"),ci){var Qn=mr.x+jr.x+Xe*mr.width,to=tr.x+va.x+vr*tr.width,jn=tr.y+va.y+gr*tr.height;U.geometry.points=[new mxPoint(Math.round((Qn+to)/2-na),Math.round(jn-da))]}else U.geometry.points=[]}else Ji&&Xe>.05&&Xe<.95&&Math.abs(Tn)>20&&Math.abs(On)>20?(Xe=Tn>0?1:0,br=.5,vr=.5,gr=On>0?0:1,U.style=U.style.replace(/exitX=[^;]*;exitY=[^;]*;entryX=[^;]*;entryY=[^;]*;/,"exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";"),U.geometry.points=[]):Math.abs(Tn)<8&&Math.abs(On)>25?(Xe=.5,br=On>0?1:0,vr=.5,gr=On>0?0:1,U.style=U.style.replace(/exitX=[^;]*;exitY=[^;]*;entryX=[^;]*;entryY=[^;]*;/,"exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";"),U.geometry.points=[]):Math.abs(On)<8&&Math.abs(Tn)>25&&(Xe=Tn>0?1:0,br=.5,vr=Tn>0?0:1,gr=.5,U.style=U.style.replace(/exitX=[^;]*;exitY=[^;]*;entryX=[^;]*;entryY=[^;]*;/,"exitX="+Xe+";exitY="+br+";entryX="+vr+";entryY="+gr+";"),U.geometry.points=[]);for(var Ei=mr.x+jr.x+Xe*mr.width,fi=mr.y+jr.y+br*mr.height,Mi=tr.x+va.x+vr*tr.width,eo=tr.y+va.y+gr*tr.height,Jn=Mi-Ei,Pn=eo-fi,De=U.geometry.points,ui=De.length>0,de=0;de<De.length;de++){var _i=De[de],ro=_i.x+na,ao=_i.y+da,Ti=Math.sqrt(Jn*Jn+Pn*Pn);if(Ti<1){ui=!1;break}var no=Math.abs(Jn*(ao-fi)-Pn*(ro-Ei))/Ti;if(no>3){ui=!1;break}}if((De.length===0||ui)&&Math.abs(Jn)>25&&Math.abs(Pn)>25){var io=fi+Pn*.3;U.geometry.points=[new mxPoint(Math.round(Mi-na),Math.round(io-da))]}}if((Za||_n)&&U.geometry.points.length===0){var ea=mr.x+jr.x+Xe*mr.width,ka=mr.y+jr.y+br*mr.height,_a=tr.x+va.x+vr*tr.width,ga=tr.y+va.y+gr*tr.height,Si=_a-ea,zn=ga-ka;if(Math.abs(Si)>5&&Math.abs(zn)>5){var Yn,vi,ti=Za;Math.abs(zn)>=Math.abs(Si)?(Yn=ti?_a:ea,vi=(ka+ga)/2):(Yn=(ea+_a)/2,vi=ti?ga:ka),U.geometry.points.push(new mxPoint(Math.round(Yn-na),Math.round(vi-da)))}}}if(e.pattern=="invisible"&&(U.visible=!1),e.startLabelRight||e.endLabelLeft){var Ai="edgeLabel;resizable=0;labelBackgroundColor=none;fontSize=11;spacing=8;",Li="middle",Fi="center",Ni="middle",Ii="center";if(x&&x.geometry&&C&&C.geometry&&(Li=x.geometry.y+x.geometry.height<C.geometry.y?"top":"bottom",Ni=x.geometry.y+x.geometry.height<C.geometry.y?"bottom":"top",Fi=x.geometry.x+x.geometry.width<C.geometry.x?"left":"right",Ii=x.geometry.x+x.geometry.width<C.geometry.x?"right":"left"),e.startLabelRight){var di=r(Y,U,null,u(e.startLabelRight),-1,0,0,0,Ai+"align="+Fi+";verticalAlign="+Li+";");di.geometry.relative=!0}if(e.endLabelLeft){var di=r(Y,U,null,u(e.endLabelLeft),.5,0,0,0,Ai+"align="+Ii+";verticalAlign="+Ni+";");di.geometry.relative=!0}}return e.sourceId&&e.targetId&&h(Y,U,"e:"+e.sourceId+"->"+e.targetId+"#"+(e.parallelIndex||0)),U}function W(e,x){var C=d(),S={},Y=x&&x.htmlLabels,D=e.drawio&&e.drawio.orthEdges,At=e.drawio&&e.drawio.useElkLayout,U=e.drawio?e.drawio.diagramType:null;if(mt(e,null,C,S,Y,U),Tt(e,S,null,C,D,At,U),e.drawio&&e.drawio.isMindmap&&gt(C),x&&x.title){var q=0,rt=1/0;if(e.children)for(var ct=0;ct<e.children.length;ct++){var nt=e.children[ct],zt=(nt.x||0)+(nt.width||0);zt>q&&(q=zt),(nt.x||0)<rt&&(rt=nt.x||0)}rt===1/0&&(rt=0),q=Math.max(q,(x.title.length||0)*10+20);var Ot=e.drawio&&e.drawio.isClassDiagram,Ft=Ot?-45:-30,Pt=Ot?rt:0,Wt=Ot?q-rt:q;r(C,null,null,mxUtils.htmlEntities(x.title),Pt,Ft,Wt,25,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=18;fontColor=light-dark(#333333,#cccccc);fontFamily=trebuchet ms,verdana,arial,sans-serif;")}return pt(C)}function gt(e){for(var x=e.getModel(),C=e.getDefaultParent(),S=x.getChildCount(C),Y=[],D=0;D<S;D++){var At=x.getChildAt(C,D);At!=null&&At.edge&&Y.push(At)}Y.length>0&&e.orderCells(!0,Y)}function mt(e,x,C,S,Y,D){if(e.children)for(var At=0;At<e.children.length;At++){var U=e.children[At],q=U.drawio||{},rt={shape:q.shape||"rect",labelText:q.labelText||(U.labels&&U.labels[0]?U.labels[0].text:""),x:U.x||0,y:U.y||0,width:U.width||40,height:U.height||30,cssStyles:q.cssStyles||null,link:q.link||null,linkTarget:q.linkTarget||null,tooltip:q.tooltip||null,type:q.type||null,directions:q.directions||null,img:q.img||null,icon:q.icon||null,form:q.form||null,pos:q.pos||null,assetH:q.assetH||null,assetW:q.assetW||null,iconLayout:q.iconLayout||null,isStateDiagram:q.isStateDiagram||!1,compoundDepth:q.compoundDepth||0,regionIdx:q.regionIdx,mindmap:q.mindmap||!1,mindmapRoot:q.mindmapRoot||!1,mindmapSection:q.mindmapSection,mindmapFill:q.mindmapFill||null,mindmapStroke:q.mindmapStroke||null,mindmapFont:q.mindmapFont||null,mindmapLine:q.mindmapLine||null,classData:q.classData||null,entityData:q.entityData||null,data:q.data||null,members:q.members||null,methods:q.methods||null,annotations:q.annotations||null,mermaidId:U.id?"n:"+U.id:null,drawio:q};q.isSubgraph&&(!q.shape||q.shape==="group")&&(rt.shape="rect",rt.type="group");var ct=l(rt,x,C,Y,D);S[U.id]=ct,U.children&&U.children.length>0&&mt(U,ct,C,S,Y,D)}}function Tt(e,x,C,S,Y,D,At){if(e.edges){for(var U={},q=0;q<e.edges.length;q++){var rt=e.edges[q],ct=rt.sources?rt.sources[0]:null,nt=rt.targets?rt.targets[0]:null;if(!(!ct||!nt)){var zt=ct+""+nt,Ot=nt+""+ct;U[Ot]!==void 0&&(e.edges[U[Ot]].drawio=Object.assign({},e.edges[U[Ot]].drawio||{},{bidiSide:"right"}),rt.drawio=Object.assign({},rt.drawio||{},{bidiSide:"left"})),U[zt]=q}}for(var Ft=[],Pt={},q=0;q<e.edges.length;q++){var rt=e.edges[q],ct=rt.sources?rt.sources[0]:null,nt=rt.targets?rt.targets[0]:null;if(!(!ct||!nt)){var Wt=ct+""+nt;Ft[q]=Pt[Wt]||0,Pt[Wt]=Ft[q]+1}}for(var Kt={},Bt={},q=0;q<e.edges.length;q++){var rt=e.edges[q],ce=rt.drawio&&rt.drawio.relationship&&rt.drawio.relationship.relSpec;if(ce){var ct=rt.sources?rt.sources[0]:null,nt=rt.targets?rt.targets[0]:null;ct&&(Kt[ct]=(Kt[ct]||0)+1),nt&&(Bt[nt]=(Bt[nt]||0)+1)}}for(var q=0;q<e.edges.length;q++){var rt=e.edges[q],ce=rt.drawio&&rt.drawio.relationship&&rt.drawio.relationship.relSpec;if(ce){var ct=rt.sources?rt.sources[0]:null,nt=rt.targets?rt.targets[0]:null,kt=ct&&Kt[ct]>1,wt=nt&&Bt[nt]>1;(kt||wt)&&(rt.drawio=Object.assign({},rt.drawio||{},{erSpreadExit:kt,erSpreadEntry:wt}))}}for(var jt=0;jt<e.edges.length;jt++){var Ht=e.edges[jt],qt=Ht.sources?Ht.sources[0]:null,re=Ht.targets?Ht.targets[0]:null;if(!(!qt||!re||!x[qt]||!x[re])){var Ut=Ht.drawio||{},ve={arrowTypeStart:Ut.arrowTypeStart||"none",arrowTypeEnd:Ut.arrowTypeEnd||"arrow_point",pattern:Ut.pattern||"solid",text:Ut.text||(Ht.labels&&Ht.labels[0]?Ht.labels[0].text:null),isOrth:Y||!1,useElkLayout:D||!1,diagramType:At||null,relationship:Ut.relationship||null,classes:Ut.classes||null,thickness:Ut.thickness||null,strokeWidth:Ut.strokeWidth||null,strokeColor:Ut.strokeColor||null,mindmapEdge:Ut.mindmapEdge||!1,style:Ut.style||null,extraStyle:Ut.extraStyle||null,startLabelRight:Ut.startLabelRight||null,endLabelLeft:Ut.endLabelLeft||null,isStateDiagram:Ut.isStateDiagram||!1,isBidiPair:Ut.isBidiPair||!1,bidiSide:Ut.bidiSide||null,erSpreadExit:Ut.erSpreadExit||!1,erSpreadEntry:Ut.erSpreadEntry||!1,invisible:Ut.invisible||!1,sourceId:qt,targetId:re,parallelIndex:Ft[jt]||0};if(Ht.sections&&Ht.sections.length>0){for(var we=[],Se=0;Se<Ht.sections.length;Se++){var be=Ht.sections[Se];if(be.startPoint&&we.push({x:be.startPoint.x,y:be.startPoint.y}),be.bendPoints)for(var Me=0;Me<be.bendPoints.length;Me++)we.push({x:be.bendPoints[Me].x,y:be.bendPoints[Me].y});be.endPoint&&we.push({x:be.endPoint.x,y:be.endPoint.y})}ve.points=we}var Fe=x[qt],Ue=x[re],De=Fe.children!=null&&Fe.children.length>0,Ye=Ue.children!=null&&Ue.children.length>0;if((!Ht.sections||Ht.sections.length===0)&&(De||Ye)&&(ve.points=null),(De||Ye)&&!ve.relationship&&!ve.bidiSide&&ve.points&&ve.points.length>=2){for(var Pe=Fe.geometry,de=Ue.geometry,Ve=v(Fe,Pe),Ne=v(Ue,de),nr={cx:Ve.x+Pe.x+Pe.width/2,cy:Ve.y+Pe.y+Pe.height/2,hw:Pe.width/2,hh:Pe.height/2},Ge={cx:Ne.x+de.x+de.width/2,cy:Ne.y+de.y+de.height/2,hw:de.width/2,hh:de.height/2},Ie=Fe.parent===Ue.parent?Fe.parent:C,Ce=0,Ke=0,We=Ie;We&&We.geometry;)Ce+=We.geometry.x||0,Ke+=We.geometry.y||0,We=We.parent;var le=ve.points.map(function(Re){return{x:Re.x+Ce,y:Re.y+Ke}}),Ae=le;Ye&&(Ae=_(Ae,Ge)),De&&Ae.length>=2&&(Ae=_(Ae.slice().reverse(),nr).reverse()),Ae.length>=2&&(ve.points=Ae.map(function(Re){return{x:Re.x-Ce,y:Re.y-Ke}}),ve.clusterClipped=!0),ve.useElkLayout&&ve.diagramType==="flowchart"||(ve.curved=!0)}var Le=Fe.parent===Ue.parent?Fe.parent:C;lt(ve,Fe,Ue,Le,S)}}}if(e.children)for(var jt=0;jt<e.children.length;jt++)e.children[jt].edges&&Tt(e.children[jt],x,x[e.children[jt].id]||C,S,Y,D,At)}function Rt(e,x){for(var C=d(),S=e.actors,Y=e.messages,D=e.notes,At=e.fragments,U={},q=0;q<At.length;q++){var rt=At[q];rt.type==="rect"&&l({shape:"seqRect",labelText:"",bgColor:rt.bgColor,bgAlpha:rt.bgAlpha,x:rt.x||0,y:rt.y||0,width:rt.width||200,height:rt.height||60},null,C,!0)}if(e.boxes)for(var q=0;q<e.boxes.length;q++){var ct=e.boxes[q];if(!(!ct.width||ct.width<=0)){var nt=ct.color||"transparent",zt=nt==="transparent"?0:100,Ot=r(C,C.getDefaultParent(),null,ct.name||"",ct.x,ct.y,ct.width,ct.height,"rounded=0;fillColor="+nt+";fillOpacity="+zt+";strokeColor=light-dark(#000000,#cccccc);strokeOpacity=50;strokeWidth=0.5;verticalAlign=top;align=center;fontSize=16;spacingTop=2;fontColor="+w+";fontFamily="+j.fontFamily+";pointerEvents=0;");ct.name&&h(C,Ot,"n:box:"+ct.name)}}for(var Ft=x==null||x.singleLifelines!==!1,Pt=S.length>0&&S[0].labelHeight||65,Wt={},q=0;q<S.length;q++){var Kt=S[q],Bt=Kt.height||300,ce=Math.max(Bt-Pt,Kt.labelHeight||65),kt=Kt.y||0,wt=kt,jt=kt+ce;Kt.lifelineStartY!=null&&(wt=Math.max(kt,Kt.lifelineStartY)),Kt.lifelineEndY!=null&&(jt=Math.min(jt,Kt.lifelineEndY));var Ht=Kt.labelHeight||65,qt=Math.max(jt-wt,Ht),re=Kt.iconName?Dt(st(Kt.iconName)):null,Ut={shape:"lifeline",labelText:re?"":Kt.label,description:Kt.label,x:Kt.x,y:wt,width:Kt.width||150,height:qt,size:Ht,mirror:Ft,type:re||Kt.type==="participant"?null:Kt.type,mermaidId:Kt.name?"n:"+Kt.name:null},ve=l(Ut,null,C,!1);if(U[Kt.name]=ve,Wt[Kt.name]={top:wt+Ht,bottom:wt+qt},re&&Lt(C,Kt,wt,Ht,re),!Ft){var we={shape:"seqActor",labelText:re?"":Kt.label,x:Kt.x,y:wt+qt,width:Kt.width||150,height:Pt,type:re||Kt.type==="participant"?null:Kt.type};l(we,null,C,!0)}if(re&&Lt(C,Kt,wt+qt,Ft?Ht:Pt,re),Kt.links&&Kt.links.length>0){C.setAttributeForCell(ve,"links",JSON.stringify(Kt.links));var Se=M(Kt.links[0].url);Se&&C.setAttributeForCell(ve,"link",Se)}}for(var q=0;q<At.length;q++){var rt=At[q];if(rt.type!=="rect"){var be=null,Me=null;if(rt.sections&&rt.sections.length>0){be=[],Me=[];for(var Fe=0;Fe<rt.sections.length;Fe++){var Ue=rt.sections[Fe],De=Math.min(Ue.startIdx,Y.length-1),Ye=De>=0&&De<Y.length?Y[De].y-44:rt.y+rt.height/2;be.push({y:Ye,height:44}),Me.push({message:Ue.title||""})}}var Ut={shape:"loop",labelText:rt.type,type:rt.type,title:rt.title,x:rt.x||0,y:rt.y||0,width:rt.width||200,height:rt.height||60,sections:be,sectionTitles:Me,mermaidId:"n:f"+q};l(Ut,null,C,!0)}}var Pe=[],de=10,Ve={},Ne=[],nr=new Array(Y.length),Ge=new Array(Y.length);function Ie(Fa,$a){Ve[Fa]||(Ve[Fa]=[]);var _r=Ve[Fa].length;return Ve[Fa].push({startY:$a,depth:_r}),_r}function Ce(Fa,$a){var _r=Ve[Fa];if(!_r||_r.length===0)return null;var wa=_r.pop();return Ne.push({actor:Fa,startY:wa.startY,endY:$a||wa.startY+40,depth:wa.depth}),wa}for(var Ke={},We=e.activationEvents||[],q=0;q<We.length;q++){var le=We[q].afterMsgIdx;Ke[le]||(Ke[le]=[]),Ke[le].push(We[q])}for(var Ae=Ke[-1]||[],q=0;q<Ae.length;q++){var Le=Ae[q],Re=Wt[Le.actor];Re&&(Le.type==="activate"?Ie(Le.actor,Re.top):Ce(Le.actor,Re.top+20))}for(var Be=new Array(Y.length),je={},q=0;q<Y.length;q++){var ie=Y[q],fr=Ve[ie.from],Ar=Ve[ie.to];if(nr[q]=fr?fr.length:0,Ge[q]=Ar?Ar.length:0,ie.from&&ie.to){var Lr=ie.from+""+ie.to;Be[q]=je[Lr]||0,je[Lr]=Be[q]+1}if(ie.activate&&ie.to&&(Ge[q]=Ie(ie.to,ie.y||0)+1),ie.deactivate&&ie.from){var Ze=Ce(ie.from,ie.y||0);Ze&&(nr[q]=Ze.depth+1)}for(var dr=Ke[q]||[],Xe=0;Xe<dr.length;Xe++){var Le=dr[Xe];if(Le.type==="activate"){var br=Ie(Le.actor,ie.y||0);ie.to===Le.actor&&(Ge[q]=br+1)}else{var Ze=Ce(Le.actor,ie.y||0);Ze&&ie.from===Le.actor&&(nr[q]=Ze.depth+1)}}}Ne.sort(function(Fa,$a){return Fa.depth-$a.depth});for(var q=0;q<Ne.length;q++){var Ze=Ne[q],vr=U[Ze.actor];if(vr){var gr=vr.geometry,fa=Ze.depth*(de/2),Je={shape:"activation",labelText:"",x:(gr.width-de)/2+fa,y:Ze.startY-gr.y,width:de,height:Math.max(Ze.endY-Ze.startY,20)};Ze.cell=l(Je,vr,C,!0)}}function $e(Fa,$a,_r){if($a>0){for(var wa=0;wa<Ne.length;wa++){var mr=Ne[wa];if(mr.actor===Fa&&mr.depth===$a-1&&mr.cell!=null&&_r>=mr.startY&&_r<=mr.endY)return mr.cell}return null}var tr=Wt[Fa];return tr&&_r>=tr.top&&_r<=tr.bottom?U[Fa]:null}for(var q=0;q<Y.length;q++){let _r=function(mr,tr){if(mr<=0)return 0;var jr=(mr-1)*(de/2);return tr?jr+de/2:jr-de/2};var ie=Y[q],Qr=U[ie.from],$r=U[ie.to];if(!(!Qr||!$r)){var Ir="verticalAlign=bottom;edgeStyle=elbowEdgeStyle;elbow=vertical;curved=0;rounded=0;fontSize=16;labelBackgroundColor=none;strokeWidth=1.5;strokeColor="+(p.signalColor||w)+";fontColor="+(p.signalTextColor||w)+";fontFamily="+j.fontFamily+";",Cr="dashed=1;fixDash=1;dashPattern=3 3;",Ea="endArrow=open;endFill=0;endSize=12;",xa="endArrow=block;endSize=9;",aa=xa+Ir;switch(ie.type){case 1:aa=Cr+xa+Ir;break;case 3:aa="endArrow=cross;"+Ir;break;case 4:aa="endArrow=cross;"+Cr+Ir;break;case 5:aa="endArrow=none;"+Ir;break;case 6:aa="endArrow=none;"+Cr+Ir;break;case 24:aa=Ea+Ir;break;case 25:aa=Cr+Ea+Ir;break}var Gr=ie.from===ie.to,ya=35,Br=24;if(Gr){var pa=ie.type===0||ie.type===1?xa:ie.type===24||ie.type===25?Ea:ie.type===3||ie.type===4?"endArrow=cross;":"endArrow=none;";aa="edgeStyle=none;curved=1;"+pa+"verticalAlign=bottom;align=center;fontSize=16;labelBackgroundColor=none;strokeWidth=1.5;strokeColor="+(p.signalColor||w)+";fontColor="+(p.signalTextColor||w)+";fontFamily="+j.fontFamily+";",(ie.type===1||ie.type===4||ie.type===6||ie.type===25)&&(aa=Cr+aa)}var i=nr[q]||0,m=Ge[q]||0,k=ie.fromX,R=ie.toX;if(!Gr){var $=ie.toX>ie.fromX;k=ie.fromX+_r(i,$),R=ie.toX+_r(m,!$)}var et=null,vt=null;ie.y!=null&&(Gr?(et=$e(ie.from,i,ie.y),(et==null||et!==$e(ie.from,i,ie.y+Br))&&(et=null),vt=et):(et=$e(ie.from,i,ie.y),vt=$e(ie.to,m,ie.y)));var Et=Gr?"":u(ie.text),Xe=C.insertEdge(null,null,Et,et,vt,aa);if(ie.from&&ie.to&&h(C,Xe,"e:"+ie.from+"->"+ie.to+"#"+(Be[q]||0)),ie.y!=null)if(Gr){var Yt=i>0?_r(i,!0):0,Gt=ie.fromX+Yt,he=Gt+ya,_e=ie.y+Br/2;Xe.geometry.sourcePoint=new mxPoint(Math.round(Gt),Math.round(ie.y)),Xe.geometry.targetPoint=new mxPoint(Math.round(Gt),Math.round(ie.y+Br)),Xe.geometry.points=[new mxPoint(Math.round(he),Math.round(ie.y)),new mxPoint(Math.round(he+4),Math.round(_e)),new mxPoint(Math.round(he),Math.round(ie.y+Br))],ie.text&&r(C,C.getDefaultParent(),null,u(ie.text),Math.round(Gt-100),Math.round(ie.y-24),200,18,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontFamily="+j.fontFamily+";fontSize=16;fontColor="+(p.signalTextColor||w)+";")}else Xe.geometry.sourcePoint=new mxPoint(Math.round(k),Math.round(ie.y)),Xe.geometry.targetPoint=new mxPoint(Math.round(R),Math.round(ie.y)),Xe.geometry.points=[new mxPoint(Math.round(Math.min(k,R)+Math.abs(R-k)/2),Math.round(ie.y))];if(ie.centralConnection&&ie.y!=null){var He=5,qe=He*2,Er=p.signalColor||w,Tr="ellipse;aspect=fixed;fillColor="+Er+";strokeColor="+Er+";",Vr=function(mr){C.insertVertex(C.getDefaultParent(),null,"",Math.round(mr-He),Math.round(ie.y-He),qe,qe,Tr)};(ie.centralConnection===59||ie.centralConnection===61)&&Vr(ie.toX),(ie.centralConnection===60||ie.centralConnection===61)&&Vr(ie.fromX)}if(e.autonumber&&ie.y!=null){var Zr=q+1,ua=20,Aa=C.insertVertex(C.getDefaultParent(),null,Zr,Math.round(ie.fromX-ua/2),Math.round(ie.y-ua/2),ua,ua,"ellipse;aspect=fixed;fillColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;fontColor=light-dark(#FFFFFF,#333333);fontSize=12;");Pe.push(Aa)}}}for(var q=0;q<D.length;q++){var La=D[q];if(La.x!=null){var Ut={shape:"seqNote",labelText:La.text,message:La.text,x:La.x,y:La.y,width:La.width||120,height:La.height||40,mermaidId:"n:note"+q};l(Ut,null,C,!0)}}return pt(C)}var It={actor:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none"><g><path d="M15.5489 4.19771C15.5489 5.18773 15.1485 6.13721 14.4358 6.83726C13.7231 7.53731 12.7565 7.93058 11.7486 7.93058C10.7407 7.93058 9.77403 7.53731 9.06133 6.83726C8.34863 6.13721 7.94824 5.18773 7.94824 4.19771C7.94824 3.20768 8.34863 2.25822 9.06133 1.55818C9.77403 0.858126 10.7407 0.464844 11.7486 0.464844C12.7565 0.464844 13.7231 0.858126 14.4358 1.55818C15.1485 2.25822 15.5489 3.20768 15.5489 4.19771Z" stroke="currentColor"/><path d="M6.54883 11.2152L17.2025 11.2073M11.7471 8.06641V19.5806V8.06641ZM11.7471 19.4385L6.79789 23.5738L11.7471 19.4385ZM11.7551 19.4385L17.1864 23.3055L11.7551 19.4385Z" stroke="currentColor"/></g></svg>',boundary:'<svg width="22" height="17" viewBox="0 0 101 78" fill="none"><path d="M96.36 39.45A34.94 34.94 0 0 1 61.42 73.54A34.94 34.94 0 0 1 26.48 39.45A35.07 35.07 0 0 1 61.42 4.38A35.07 35.07 0 0 1 96.36 39.45Z" stroke="currentColor" stroke-width="4" fill="none"/><path d="M27.36 39.45H3.94" stroke="currentColor" stroke-width="4"/><path d="M4.92 4.38V74.52" stroke="currentColor" stroke-width="4"/></svg>',control:'<svg width="18" height="20" viewBox="0 0 77 86" fill="none"><g><path d="M74.01 46.89A35.69 35.69 0 0 1 38.33 82.58A35.69 35.69 0 0 1 2.64 46.89A35.69 35.69 0 0 1 38.33 11.20A35.69 35.69 0 0 1 74.01 46.89Z" stroke="currentColor" stroke-width="5" fill="none"/><path d="M47.54 2.30L37.54 11.50L47.54 20.70" stroke="currentColor" stroke-width="6" fill="none"/></g></svg>',entity:'<svg width="20" height="22" viewBox="0 0 80 88" fill="none"><circle cx="40" cy="40" r="36" stroke="currentColor" stroke-width="4" fill="none"/><path d="M2 84L78 84" stroke="currentColor" stroke-width="4"/></svg>',database:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none"><ellipse cx="12" cy="4.5" rx="8" ry="2.2" stroke="currentColor" stroke-width="1.4" fill="none"/><path d="M4 4.5V19.5C4 21 7.6 22 12 22C16.4 22 20 21 20 19.5V4.5" stroke="currentColor" stroke-width="1.4" fill="none"/><path d="M4 10C4 11.4 7.6 12.4 12 12.4C16.4 12.4 20 11.4 20 10" stroke="currentColor" stroke-width="1.4" fill="none"/><path d="M4 15C4 16.4 7.6 17.4 12 17.4C16.4 17.4 20 16.4 20 15" stroke="currentColor" stroke-width="1.4" fill="none"/></svg>'};function te(e){if(e==null)return"";var x=mxUtils.htmlEntities(String(e));return x=x.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),x=x.replace(/(^|[^*])\*([^*]+)\*(?!\*)/g,"$1<em>$2</em>"),x}function Qt(e){var x=typeof btoa=="function"?btoa(unescape(encodeURIComponent(e))):typeof mxUtils!="undefined"&&mxUtils.toBase64?mxUtils.toBase64(e):"";return"data:image/svg+xml,"+x}var pe="<style>:root{color-scheme:light dark}.i-s{stroke:light-dark(#333,#ccc);fill:none}.i-f{fill:light-dark(#333,#ccc)}</style>",ue={alt:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">'+pe+'<path class="i-s" d="M12 8L20 12L12 16L4 12L12 8Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>'),opt:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">'+pe+'<circle class="i-s" cx="12" cy="12" r="7" stroke-width="1.5" stroke-dasharray="3 2" stroke-linecap="round"/></svg>'),par:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">'+pe+'<path class="i-s" d="M5 10H19" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path class="i-s" d="M5 14H19" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>'),critical:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="16 22 47 38">'+pe+'<path class="i-f" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 26,22.0001L 27,21.9998L 27,27L 26.0001,27.0003C 23.2386,27.0003 21.0001,29.2389 21.0001,32.0003L 21,46.0002C 21,48.7616 23.2386,51.0002 25.9999,51.0002L 27,51.0002L 27,47L 33.75,53.5L 27,60L 27,56L 26,56C 20.4771,56 16,51.5229 16,46L 16,32.0001C 16,26.4773 20.4771,22.0001 26,22.0001 Z M 33,27L 59,27L 59,32L 33,32L 33,27 Z M 36,35L 59,35L 59,40L 36,40L 36,35 Z M 33,43L 59,43L 59,48L 33,48L 33,43 Z"/></svg>'),loop:Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">'+pe+'<path class="i-f" d="M960 101.84l-896.002.002c-35.344 0-64 28.656-64 64v576c0 35.36 28.656 64 64 64h160c20.496 0 32-26.32 32-31.984 0-5.824-10.88-32.416-32-32.416h-120.96c-21.376 0-38.72-17.344-38.72-38.72V206.002c0-21.391 17.328-38.72 38.72-38.72l818.272-1.007c21.376 0 38.72 17.328 38.72 38.72V702.69c0 21.376-17.344 38.72-38.72 38.72H518.142l75.984-68.912c9.344-8.944 12.369-23.408 3.025-32.336l-5.472-8.064c-9.376-8.945-24.496-8.945-33.84 0L428.111 750.53l-8.48 8.096c-4.672 4.431-7.008 10.335-6.976 16.223 0 5.904 2.288 11.777 6.977 16.288l8.48 8.096L555.84 915.44c9.344 8.944 24.464 8.944 33.84 0l5.472-8.065c9.344-8.944 6.32-23.44-3.025-32.368l-77.135-69.168H960c35.343 0 64-28.64 64-64v-576c0-35.344-28.657-64-64-64z"/></svg>')},me=Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 214.27 214.27">'+pe+'<path class="i-f" d="M196.926 55.171c-.11-5.785-.215-11.25-.215-16.537a7.5 7.5 0 0 0-7.5-7.5c-32.075 0-56.496-9.218-76.852-29.01a7.498 7.498 0 0 0-10.457 0c-20.354 19.792-44.771 29.01-76.844 29.01a7.5 7.5 0 0 0-7.5 7.5c0 5.288-.104 10.755-.215 16.541-1.028 53.836-2.436 127.567 87.331 158.682a7.495 7.495 0 0 0 4.912 0c89.774-31.116 88.368-104.849 87.34-158.686zm-89.795 143.641c-76.987-27.967-75.823-89.232-74.79-143.351.062-3.248.122-6.396.164-9.482 30.04-1.268 54.062-10.371 74.626-28.285 20.566 17.914 44.592 27.018 74.634 28.285.042 3.085.102 6.231.164 9.477 1.032 54.121 2.195 115.388-74.798 143.356z"/><path class="i-f" d="m132.958 81.082-36.199 36.197-15.447-15.447a7.501 7.501 0 0 0-10.606 10.607l20.75 20.75a7.477 7.477 0 0 0 5.303 2.196 7.477 7.477 0 0 0 5.303-2.196l41.501-41.5a7.498 7.498 0 0 0 .001-10.606 7.5 7.5 0 0 0-10.606-.001z"/></svg>');function Ee(e){var x=e&&It[e.type]||null,C;return e&&e.label===""?C="":C=mxUtils.htmlEntities(e&&(e.label||e.name)||""),x?C?'<div style="display:flex;align-items:center;justify-content:center;gap:4px;">'+x+"<span>"+C+"</span></div>":'<div style="display:flex;align-items:center;justify-content:center;">'+x+"</div>":C}function xe(e,x){for(var C=d(),S=e.actors||[],Y=e.messages||[],D=e.fragments||[],At=e.notes||[],U=e.activations||[],q=e.title||x&&x.title||"",rt=j.fontFamily,ct=j.fontColor,nt="light-dark(#000000,#cccccc)",zt="light-dark(#ffffff,#1f2020)",Ot="light-dark(#ffffff,#1f2020)",Ft="light-dark(#6b7280,#9ca3af)",Pt=40,Wt=32,Kt=24,Bt=1/0,ce=-1/0,kt=0;kt<S.length;kt++){var wt=S[kt],jt=wt.width||150;wt.x<Bt&&(Bt=wt.x),wt.x+jt>ce&&(ce=wt.x+jt)}for(var Ht=0;Ht<D.length;Ht++){var qt=D[Ht];qt.type!=="rect"&&(qt.x!=null&&qt.x<Bt&&(Bt=qt.x),qt.x!=null&&qt.width!=null&&qt.x+qt.width>ce&&(ce=qt.x+qt.width))}isFinite(Bt)||(Bt=0,ce=200);for(var re=32,Ut=Math.round(Bt-re),ve=Math.round(ce-Bt+re*2),we=0,Se=0;Se<Y.length;Se++)Y[Se].y!=null&&Y[Se].y>we&&(we=Y[Se].y);for(var be=0;be<At.length;be++){var Me=(At[be].y||0)+(At[be].height||40);Me>we&&(we=Me)}for(var Fe=0;Fe<D.length;Fe++){var qt=D[Fe];if(qt.type!=="rect"){var Ue=(qt.y||0)+(qt.height||0);Ue>we&&(we=Ue)}}for(var De=Wt+24,Ye=Y.length>0&&Y[0]&&Y[0].comments?Y[0].comments.length:0,Pe=0,de=0;de<D.length;de++){var Ve=D[de];if(Ve.type!=="rect"&&Ve.startIdx===0){var Ne=Ve.title&&Ve.type!=="critical",nr=Ne?64:48;nr>Pe&&(Pe=nr)}}var Ge=De+Pt+24+Ye*16+Pe,Ie=Y.length>0&&Y[0].y!=null?Y[0].y:99,Ce=Ge-Ie,Ke=Math.round(we+Ce)+16;Ke<Ge+60&&(Ke=Ge+60);var We=0,le=Ke+Kt,Ae=r(C,C.getDefaultParent(),null,'<span style="font-weight:600">'+mxUtils.htmlEntities(q)+"</span>",Ut,We,ve,le,"shape=swimlane;horizontal=1;startSize="+Wt+";rounded=1;absoluteArcSize=1;arcSize=6;html=1;whiteSpace=wrap;fillColor="+Ot+";strokeColor="+nt+";swimlaneFillColor="+zt+";fontFamily="+rt+";fontSize=16;fontColor="+ct+";align=left;verticalAlign=middle;spacingLeft=4;collapsible=0;marginBottom=0;pointerEvents=0;"),Le=22,Re=6;r(C,C.getDefaultParent(),null,"",Ut+ve-Le-Re,We+Math.round((Wt-Le)/2),Le,Le,"shape=image;imageAspect=0;html=1;image="+me+";pointerEvents=0;");for(var Be="rounded=1;absoluteArcSize=1;arcSize=8;html=1;whiteSpace=wrap;fillColor="+zt+";strokeColor="+nt+";strokeWidth=2;fontFamily="+rt+";fontSize=16;fontColor="+ct+";align=center;verticalAlign=middle;shadow=0;",je=0;je<S.length;je++){var ie=S[je],jt=ie.width||150,fr=ie.iconName?Dt(st(ie.iconName)):null,Ar=fr?"":Ee(ie),Lr=r(C,C.getDefaultParent(),null,Ar,Math.round(ie.x),De,jt,Pt,Be);if(ie.name&&h(C,Lr,"n:"+ie.name),fr){var Ze=20;r(C,C.getDefaultParent(),null,"",Math.round(ie.x+(jt-Ze)/2),De+2,Ze,Ze,fr),r(C,C.getDefaultParent(),null,mxUtils.htmlEntities(ie.label),Math.round(ie.x),De+Ze+1,jt,Pt-Ze-3,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize=12;fontColor="+ct+";align=center;verticalAlign=middle;")}}for(var dr=De+Pt,Xe=Ke+12,je=0;je<S.length;je++){var ie=S[je],br=ie.centerX!=null?ie.centerX:ie.x+(ie.width||150)/2;r(C,C.getDefaultParent(),null,"",br,dr,1,Xe-dr,"shape=line;direction=south;strokeColor="+nt+";dashed=1;fixDash=1;dashPattern=5 5;strokeWidth=1.5;pointerEvents=0;html=1;")}var vr=new Array(Y.length),gr=new Array(D.length);(function(){var ea=[0],ka=[];function _a(Za){return Za.join(".")}for(var ga={},Xa=0;Xa<U.length;Xa++){var rn=U[Xa];rn.startIdx>=0&&(ga[rn.startIdx]=rn)}for(var cn={},ia=0;ia<D.length;ia++){var Ga=D[ia];Ga.type!=="rect"&&Ga.startIdx>=0&&(cn[Ga.startIdx]||(cn[Ga.startIdx]=[]),cn[Ga.startIdx].push(ia))}for(var ha=0;ha<Y.length;ha++){for(;ka.length>0&&ka[ka.length-1].endIdx<ha;)ka.pop(),ea.pop();if(cn[ha])for(var on=0;on<cn[ha].length;on++){var Ta=cn[ha][on],Ha=D[Ta];ea[ea.length-1]++,gr[Ta]=_a(ea),ka.push({endIdx:Ha.endIdx>=0?Ha.endIdx-1:Y.length-1}),ea.push(0)}if(ea[ea.length-1]++,vr[ha]=_a(ea),ga[ha]){var qa=ga[ha];ka.push({endIdx:qa.endIdx>=0?qa.endIdx:Y.length-1}),ea.push(0)}}})();for(var fa=10,Je=fa/2,$e={},kt=0;kt<S.length;kt++)$e[S[kt].name]=S[kt];for(var Qr=0;Qr<U.length;Qr++){var $r=U[Qr],Ir=$e[$r.actor];if(Ir&&!($r.startIdx<0||$r.startIdx>=Y.length)){var Cr=Y[$r.startIdx],Ea=$r.endIdx>=0&&$r.endIdx<Y.length?$r.endIdx:Y.length-1,xa=Y[Ea];if(!(Cr.y==null||xa.y==null)){var aa=Ir.centerX!=null?Ir.centerX:Ir.x+(Ir.width||150)/2,Gr=Math.round(Cr.y+Ce),ya=Math.round(xa.y+Ce),Br=Math.max(20,ya-Gr+8),pa=($r.depth||0)*Je;r(C,C.getDefaultParent(),null,"",Math.round(aa-Je+pa),Gr,fa,Br,"rounded=0;html=1;fillColor="+zt+";strokeColor="+nt+";strokeWidth=1.5;pointerEvents=0;")}}}for(var i=26,m="light-dark(#999999,#666666)",je=0;je<D.length;je++){var k=D[je];if(k.type!=="rect"){var R=Math.round(k.x),$=Math.round((k.y||0)+Ce),et=Math.round(k.width||200),vt=Math.round(k.height||60),Et=(k.type||"").toLowerCase(),Yt=Et==="critical"?"Try":Et.charAt(0).toUpperCase()+Et.slice(1),Gt=ue[Et]||"",he=Gt?24:6,_e=r(C,C.getDefaultParent(),null,'<span style="font-weight:600">'+mxUtils.htmlEntities(Yt)+"</span>",R,$,et,vt,"shape=swimlane;horizontal=1;startSize="+i+";rounded=1;absoluteArcSize=1;arcSize=6;html=1;whiteSpace=wrap;fillColor="+Ot+";strokeColor="+nt+";strokeWidth=1.2;swimlaneFillColor=none;fontFamily="+rt+";fontSize=14;fontColor="+ct+";align=left;verticalAlign=middle;spacingLeft="+he+";collapsible=0;marginBottom=0;pointerEvents=0;");if(h(C,_e,"n:f"+je),gr[je]){var He=gr[je],qe=Math.max(20,He.length*6+4);r(C,C.getDefaultParent(),null,He,R-qe-2,$,qe,16,"text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;fontFamily="+rt+";fontSize=11;fontColor="+m+";")}if(Gt){var Er=14;r(C,C.getDefaultParent(),null,"",R+5,$+Math.round((i-Er)/2),Er,Er,"shape=image;imageAspect=0;html=1;image="+Gt+";pointerEvents=0;")}k.title&&Et!=="critical"&&r(C,C.getDefaultParent(),null,"["+mxUtils.htmlEntities(k.title)+"]",R+6,$+i+2,et-12,16,"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontStyle=2;fontFamily="+rt+";fontSize=13;fontColor="+Ft+";");var Tr=Et==="critical",Vr=Tr?"light-dark(#cccccc,#555555)":nt;if(k.sections&&k.sections.length>0)for(var Zr=0;Zr<k.sections.length;Zr++){var ua=k.sections[Zr],Aa=Math.min(ua.startIdx||0,Y.length-1),La=Aa>=0&&Aa<Y.length?Math.round(Y[Aa].y+Ce-36):$+Math.round(vt/2);if(r(C,C.getDefaultParent(),null,"",R,La,et,1,"shape=line;strokeColor="+Vr+";strokeWidth=1;html=1;"),ua.title){var Fa=Tr?mxUtils.htmlEntities(ua.title):"["+mxUtils.htmlEntities(ua.title)+"]";r(C,C.getDefaultParent(),null,Fa,R+6,La+1,et-12,16,"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontStyle=2;fontFamily="+rt+";fontSize=13;fontColor="+Ft+";")}}}}var $a="edgeStyle=none;curved=0;rounded=0;html=1;endArrow=open;endFill=0;endSize=5;startSize=0;strokeWidth=1.5;strokeColor="+ct+";fontColor="+ct+";fontFamily="+rt+";fontSize=14;verticalAlign=bottom;align=center;",_r="edgeStyle=none;curved=0;rounded=0;html=1;endArrow=block;endFill=1;endSize=7;startSize=0;strokeWidth=1.5;strokeColor="+ct+";fontColor="+ct+";fontFamily="+rt+";fontSize=14;verticalAlign=bottom;align=center;";function wa(Va,ea){for(var ka=-1,_a=0;_a<U.length;_a++){var ga=U[_a];if(ga.actor===Va&&!(ga.startIdx>ea)&&!(ga.endIdx>=0&&ga.endIdx<ea)){var Xa=ga.depth||0;Xa>ka&&(ka=Xa)}}return ka}function mr(Va,ea,ka){return ea>0?Va+Je*(ka+1):Va+Je*(ka-1)}for(var je=0;je<Y.length;je++){var tr=Y[je];if(!(tr.fromX==null&&tr.toX==null)){var jr=tr.fromX,va=tr.toX,na=tr.y!=null?Math.round(tr.y+Ce):Ge+je*44;if(tr.from!==tr.to){var da=va>jr?1:-1,Ia=wa(tr.from,je),Ma=wa(tr.to,je);Ia>=0&&(jr=mr(jr,da,Ia)),Ma>=0&&(va=mr(va,-da,Ma))}var ln=tr.sync?_r:$a;tr.type===1&&(ln="dashed=1;fixDash=1;dashPattern=6 4;"+ln);var hn=tr.from===tr.to,Ra=C.insertEdge(null,null,u(tr.text),null,null,ln);if(tr.from&&tr.to&&h(C,Ra,"e:"+tr.from+"->"+tr.to+"#"+je),hn){var wn=30,tn=22;Ra.geometry.sourcePoint=new mxPoint(Math.round(jr),na),Ra.geometry.targetPoint=new mxPoint(Math.round(jr),na+tn),Ra.geometry.points=[new mxPoint(Math.round(jr+wn),na),new mxPoint(Math.round(jr+wn),na+tn)]}else Ra.geometry.sourcePoint=new mxPoint(Math.round(jr),na),Ra.geometry.targetPoint=new mxPoint(Math.round(va),na);var yn=hn?jr:Math.min(jr,va),gn=vr[je]!=null?vr[je]:String(je+1),un=Math.max(20,gn.length*6+4);if(r(C,C.getDefaultParent(),null,gn,Math.round(yn-un-4),na-16,un,16,"text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=bottom;fontFamily="+rt+";fontSize=11;fontColor="+m+";"),tr.comments&&tr.comments.length>0)for(var za=16,bn=20,ja=Math.abs(va-jr),vn=Math.max(ja,240),Pa=Math.round((jr+va)/2-vn/2),Ba=0;Ba<tr.comments.length;Ba++){var en=na-bn-(tr.comments.length-Ba)*za;r(C,C.getDefaultParent(),null,te(tr.comments[Ba]),Pa,en,vn,za,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=nowrap;fontFamily="+rt+";fontSize=12;fontColor="+Ft+";fontStyle=2;")}}}for(var je=0;je<At.length;je++){var Da=At[je];if(Da.x!=null){var xn=r(C,C.getDefaultParent(),null,u(Da.text),Da.x,Math.round((Da.y||0)+Ce),Da.width||120,Da.height||40,"rounded=0;html=1;whiteSpace=wrap;fillColor=light-dark(#fff5ad,#2a2a2a);strokeColor=light-dark(#aaaa33,#cccccc);fontFamily="+rt+";fontSize=14;fontColor="+ct+";align=center;verticalAlign=middle;");h(C,xn,"n:note"+je)}}return(function(){for(var ea=C.getModel(),ka=C.getDefaultParent(),_a=[],ga=0;ga<ea.getChildCount(ka);ga++){var Xa=ea.getChildAt(ka,ga);Xa!==Ae&&_a.push(Xa)}if(_a.length!==0){ea.beginUpdate();try{for(var ga=0;ga<_a.length;ga++){var rn=_a[ga],cn=ea.getGeometry(rn);if(cn!=null){var ia=cn.clone();if(ea.isEdge(rn)||(ia.x!=null&&(ia.x-=Ut),ia.y!=null&&(ia.y-=We)),ia.sourcePoint!=null&&(ia.sourcePoint=new mxPoint(ia.sourcePoint.x-Ut,ia.sourcePoint.y-We)),ia.targetPoint!=null&&(ia.targetPoint=new mxPoint(ia.targetPoint.x-Ut,ia.targetPoint.y-We)),ia.points!=null&&ia.points.length>0){for(var Ga=[],ha=0;ha<ia.points.length;ha++)Ga.push(new mxPoint(ia.points[ha].x-Ut,ia.points[ha].y-We));ia.points=Ga}ea.setGeometry(rn,ia)}ea.add(Ae,rn)}}finally{ea.endUpdate()}}})(),pt(C)}function ar(e,x,C){e=(e%360+360)%360,x=x/100,C=C/100;var S=(1-Math.abs(2*C-1))*x,Y=S*(1-Math.abs(e/60%2-1)),D=C-S/2,At=0,U=0,q=0;e<60?(At=S,U=Y):e<120?(At=Y,U=S):e<180?(U=S,q=Y):e<240?(U=Y,q=S):e<300?(At=Y,q=S):(At=S,q=Y);function rt(ct){var nt=Math.max(0,Math.min(255,Math.round((ct+D)*255))),zt=nt.toString(16);return zt.length===1?"0"+zt:zt}return"#"+rt(At)+rt(U)+rt(q)}var xr=8,sr=[["#ffffff","#0000ec"],["#000000","#dede00"],["#000000","#9dec00"],["#ffffff","#0076ec"],["#000000","#00ecec"],["#000000","#00ec76"],["#000000","#ec00ec"],["#000000","#ec0000"]],Qe=[["#000000","#ffcb5e"],["#000000","#cf5eff"],["#000000","#779eff"],["#000000","#ff8a5e"],["#000000","#ff5e93"],["#000000","#ff5ecf"],["#000000","#a3ff5e"],["#000000","#5effc3"]],or=[["#2c2c2c",ar(180,1.59,48.35)],["#d3d3d3",ar(321.6,65.6,38.2)],["#d3d3d3",ar(194.4,16.6,49.6)],["#2c2c2c",ar(23.1,49.1,40.8)],["#d3d3d3",ar(0,83.3,43.5)],["#d3d3d3",ar(289.2,100,24.1)],["#d3d3d3",ar(35.1,98.7,40.2)],["#d3d3d3",ar(106.2,84.4,35.1)]],Wr=[["#333333","#b4b4b4"],["#ffffff","#555555"],["#333333","#bbbbbb"],["#ffffff","#777777"],["#333333","#999999"],["#333333","#dddddd"],["#333333","#ffffff"],["#333333","#dddddd"]],oa=["#131300","#0000a0","#310093","#934900","#930000","#930049","#009300","#009393"],Sr=["#003ca1","#34a100","#885c00","#0085a1","#00a16d","#00a11c","#6d00a1","#a10034"],Rr=[["#000000","#9bc834"],["#000000","#7aff32"],["#000000","#b0d45b"],["#000000","#c8ab34"],["#000000","#c86134"],["#000000","#c83452"],["#000000","#34c861"],["#000000","#349bc8"]],Mr=["#6437cb","#8500cd","#4f2ba4","#3754cb","#379ecb","#37cbad","#cb379e","#cb6437"],er=["#868282","#5edd8c","#95766c","#64a3ca","#34eded","#9aff84","#3387fe","#ce5af1"],Xr=["#4b4b4b","#aaaaaa","#444444","#888888","#666666","#222222","#000000","#222222"];function Kr(e,x,C){return C&&e>0?(e-1)%(x-1)+1:e%x}function Ur(e){var x=e.customType!=null?e.customType:e.type;switch(x){case 1:return"commit-reverse";case 2:return"commit-highlight";case 3:return"commit-merge";case 4:return"commit-cherry-pick";default:return"commit-normal"}}function Jr(e,x){var C=d(),S=e.commits,Y=e.branches,D=e.isVertical,At=e.showBranches,U=e.showCommitLabel,q=e.rotateCommitLabel!==!1,rt="trebuchet ms,verdana,arial,sans-serif",ct=x&&x.theme||"default",nt,zt;ct==="base"?(nt=Qe,zt=Sr):ct==="dark"?(nt=or,zt=er):ct==="forest"?(nt=Rr,zt=Mr):ct==="neutral"?(nt=Wr,zt=Xr):(nt=sr,zt=oa);var Ot,Ft,Pt,Wt;ct==="base"?(Ot="#fff4dd",Ft="#eddbbb",Pt="#131300",Wt="#f4dbff"):ct==="dark"?(Ot="#1f2020",Ft="#cccccc",Pt="#e0dfdf",Wt="#484848"):ct==="forest"?(Ot="#cde498",Ft="#abb594",Pt="#131300",Wt="#cdffb2"):ct==="neutral"?(Ot="#eeeeee",Ft="#d4d4d4",Pt="#111111",Wt="#fcfcfc"):(Ot="#ECECFF",Ft="#C7C7F1",Pt="#131300",Wt="#ffffde");var Kt=x&&x.themeVariables||{};nt=nt.slice();for(var Bt=0;Bt<10;Bt++){var ce=Kt["git"+Bt]||Kt["'git"+Bt+"'"],kt=Kt["gitBranchLabel"+Bt]||Kt["'gitBranchLabel"+Bt+"'"];if(ce||kt){var wt=nt[Bt]?nt[Bt][0]:"#000000",jt=nt[Bt]?nt[Bt][1]:"#000000";nt[Bt]=[kt||wt,ce||jt]}}zt=zt.slice();for(var Ht=0;Ht<10;Ht++){var qt=Kt["gitInv"+Ht]||Kt["'gitInv"+Ht+"'"];qt&&(zt[Ht]=qt)}var re=Kt.tagLabelBackground||Kt["'tagLabelBackground'"],Ut=Kt.tagLabelBorder||Kt["'tagLabelBorder'"],ve=Kt.tagLabelColor||Kt["'tagLabelColor'"],we=Kt.tagLabelFontSize||Kt["'tagLabelFontSize'"];re&&(Ot=re),Ut&&(Ft=Ut),ve&&(Pt=ve);var Se=we&&parseInt(we.toString().replace(/[^\d]/g,""),10)||10,be={default:"#000021",base:"#0b2200",forest:"#32004d",dark:"#b8b6b6",neutral:"#030303"},Me=Kt.commitLabelColor||Kt["'commitLabelColor'"]||be[ct]||"#000021",Fe=Kt.commitLabelBackground||Wt,Ue=parseInt((Kt.commitLabelFontSize||"10").toString().replace(/[^\d]/g,""),10)||10,De={},Ye={},Pe=[];for(var de in Y)Pe.push({name:de,lane:Y[de].lane||0});Pe.sort(function(Ta,Ha){return Ta.lane-Ha.lane});for(var Ve=0;Ve<Pe.length;Ve++){var de=Pe[Ve].name,Ne=Y[de],nr=Kr(Ve,xr,!1),Ge=nt[nr];if(Ne.color=Ge,Ne.colorIndex=nr,!!At){var Ie={shape:"gitBranch",labelText:de,x:Ne.x||0,y:Ne.y||0,width:Ne.width||1,height:Ne.height||1,color:Ge,mermaidId:"n:branch:"+de},Ce=l(Ie,null,C,!0);Ce.value="",De[de]=Ce;{for(var Ke=mxUtils.htmlEntities(de),We=0,le=0;le<de.length;le++){var Ae=de.charCodeAt(le);Ae<=32||Ae===95?We+=5:Ae>=65&&Ae<=90?We+=10:We+=8}var Le=We+16,Re=23,Be=q?35:5,je=Ne.x||0,ie=Ne.y||0,fr=Ne.width||1,Ar=Ne.height||1,Lr=e.dir||(D?"TB":"LR"),Ze,dr;Lr==="TB"?(Ze=je-Le/2,dr=ie-Re-3):Lr==="BT"?(Ze=je-Le/2,dr=ie+Ar+3):Lr==="RL"?(Ze=je+fr+Be,dr=ie-Re/2):(Ze=je-Le-Be,dr=ie-Re/2);var Xe=r(C,null,null,Ke,Ze,dr,Le,Re,"rounded=1;absoluteArcSize=1;arcSize=8;html=1;verticalAlign=middle;align=center;whiteSpace=nowrap;fontSize=16;fontFamily="+rt+";strokeColor=none;fillColor="+Ge[1]+";fontColor="+Ge[0]+";");Ye[de]=Xe}}}for(var br={},vr=[],gr=16,fa=Math.cos(Math.PI/4),Je=0;Je<S.length;Je++){var $e=S[Je],Qr=Y[$e.branch],Ge=Qr?Qr.color:nt[0],$r=$e.width||20,Ir=$e.cx!=null?$e.cx:$e.x+$r/2,Cr=$e.cy!=null?$e.cy:$e.y+$r/2,Ea=Y[$e.branch]&&Y[$e.branch].colorIndex!=null?Y[$e.branch].colorIndex:0,xa=zt[Ea%zt.length],Ie={shape:"gitCommit",labelText:"",x:Ir-$r/2,y:Cr-$r/2,width:$r,height:$r,color:Ge,type:$e.customType!=null?$e.customType:$e.type,tag:$e.tag,tags:$e.tags,tagFill:Ot,tagStroke:Ft,tagFont:Pt,tagFontSize:Se,highlightColor:xa,mermaidId:$e.id?"n:commit:"+$e.id:null},Ce=l(Ie,null,C,!1);br[$e.id]=Ce;var aa=$e.id&&!/^\d+(-[\da-f]+)?$/.test($e.id),Gr=$e.type===4||$e.type===3&&!aa;if(U&&$e.id&&!Gr){for(var Ke=$e.id,We=0,ya=0;ya<Ke.length;ya++){var Br=Ke.charCodeAt(ya);Br<=32||Br===46||Br===58||Br===59||Br===44||Br===33||Br===124||Br===39||Br===40||Br===41?We+=3:Br>=65&&Br<=90?We+=6:We+=5}var pa=Ue/10,Le=Math.round(We*pa+4),Re=Math.round(11*pa+4),i="rounded=0;html=1;whiteSpace=nowrap;fillColor="+Fe+";fillOpacity=50;strokeColor=none;fontColor="+Me+";fontSize="+Ue+";fontFamily="+rt+";",m,k;if(D){var R=Ir-Le-17,$=Cr-12,et=R+Le/2,vt=$+Re/2,Et=et-Ir,Yt=vt-Cr,Gt=Ir+Et*fa+Yt*fa,he=Cr-Et*fa+Yt*fa;m=Gt-Le/2,k=he-Re/2,i+="align=left;verticalAlign=middle;rotation=315;";var Xe=r(C,null,null,Ke,m,k,Le,Re,i);vr.push(Xe)}else if(q){var _e=Le/2*fa;m=Ir-Le/2-_e,k=Cr+gr-Re/2+_e,i+="align=right;verticalAlign=middle;rotation=315;";var Xe=r(C,null,null,Ke,m,k,Le,Re,i);vr.push(Xe)}else{m=Ir-Le/2,k=Cr+13.5,i+="align=center;verticalAlign=middle;";var Xe=r(C,null,null,Ke,m,k,Le,Re,i);vr.push(Xe)}}}for(var He={},qe={},Je=0;Je<S.length;Je++){var Ne=Y[S[Je].branch];He[S[Je].id]=Ne?Ne.lane:0,qe[S[Je].id]=S[Je]}function Er(Ta,Ha){for(var qa={x:Ta.cx,y:Ta.cy},Za={x:Ha.cx,y:Ha.cy},_n=D?qa.x<Za.x:qa.y<Za.y,an=_n?Ha.branch:Ta.branch,Ka=0;Ka<S.length;Ka++){var En=S[Ka];if(En.branch===an&&En.seq>Ta.seq&&En.seq<Ha.seq)return!0}return!1}var Tr=[];function Vr(Ta,Ha,qa){qa=qa||0;var Za=Ta+Math.abs(Ta-Ha)/2;if(qa>5)return Za;for(var _n=!0,an=0;an<Tr.length;an++)if(Math.abs(Tr[an]-Za)<10){_n=!1;break}if(_n)return Tr.push(Za),Za;var Ka=Math.abs(Ta-Ha);return Vr(Ta,Ha-Ka/5,qa+1)}for(var Je=0;Je<S.length;Je++)for(var $e=S[Je],Zr=0;Zr<$e.parents.length;Zr++){var ua=$e.parents[Zr],Aa=br[ua],La=br[$e.id];if(Aa&&La){var Fa=He[ua],$a=He[$e.id],_r=qe[ua],wa=$e.type===3&&Zr>0&&$e.parents.length>1&&$e.parents[0]!==ua,mr=$e.branch;wa&&_r&&(mr=_r.branch);var Qr=Y[mr],Ge=Qr?Qr.color:nt[0],tr=C.insertEdge(null,null,null,Aa,La,"edgeStyle=orthogonalEdgeStyle;rounded=1;arcSize=50;endArrow=none;endFill=0;strokeWidth=8;startSize=0;endSize=0;strokeColor="+Ge[1]+";");if(Fa!=null&&$a!=null&&Fa!==$a&&_r){var $r=$e.width||20,jr=Er(_r,$e);if(jr){if(D){var va=_r.cx,na=$e.cx,da=_r.cy,Ia=$e.cy,Ma=da<Ia?Vr(da,Ia):Vr(Ia,da);tr.geometry.points=[new mxPoint(Math.round(va),Math.round(Ma)),new mxPoint(Math.round(na),Math.round(Ma))]}else{var va=_r.cx,na=$e.cx,da=_r.cy,Ia=$e.cy,Ma=da<Ia?Vr(da,Ia):Vr(Ia,da);tr.geometry.points=[new mxPoint(Math.round(va),Math.round(Ma)),new mxPoint(Math.round(na),Math.round(Ma))]}if(_r){var ln=Y[_r.branch]?Y[_r.branch].color:nt[0];tr.style=tr.style.replace(/strokeColor=[^;]+/,"strokeColor="+ln[1])}}else if(D){var hn=Y[_r.branch]?Y[_r.branch].x:0,Ra=Y[$e.branch]?Y[$e.branch].x:0,wn=_r.cy,tn=$e.cy;wa?tr.geometry.points=[new mxPoint(Math.round(hn),Math.round(tn))]:tr.geometry.points=[new mxPoint(Math.round(Ra),Math.round(wn))]}else{var yn=Y[_r.branch]?Y[_r.branch].y:0,gn=Y[$e.branch]?Y[$e.branch].y:0,hn=_r.cx,Ra=$e.cx;wa?tr.geometry.points=[new mxPoint(Math.round(Ra),Math.round(yn))]:tr.geometry.points=[new mxPoint(Math.round(hn),Math.round(gn))]}}}}var un=C.getDefaultParent(),za=C.getModel(),bn=[];for(var de in Y)De[de]&&bn.push(De[de]),Ye[de]&&bn.push(Ye[de]);for(var ja=[],Je=0;Je<S.length;Je++)br[S[Je].id]&&ja.push(br[S[Je].id]);for(var vn=[],Pa=za.getChildCount(un),Je=0;Je<Pa;Je++){var Br=za.getChildAt(un,Je);za.isEdge(Br)&&vn.push(Br)}for(var Ba=0,Je=0;Je<bn.length;Je++)za.add(un,bn[Je],Ba++);for(var Je=0;Je<vn.length;Je++)za.add(un,vn[Je],Ba++);for(var Je=0;Je<ja.length;Je++)za.add(un,ja[Je],Ba++);for(var Je=0;Je<vr.length;Je++)za.add(un,vr[Je],Ba++);if(x&&x.title){var en=1/0,Da=-1/0;for(var de in Y){var Ne=Y[de],xn=Ne.x||0,Va=xn+(Ne.width||0);xn<en&&(en=xn),Va>Da&&(Da=Va)}for(var de in Ye){var ea=Ye[de];if(ea&&ea.geometry){var ka=ea.geometry.x||0,_a=ka+(ea.geometry.width||0);ka<en&&(en=ka),_a>Da&&(Da=_a)}}for(var ga=0;ga<S.length;ga++){var Xa=S[ga].x||0,rn=Xa+(S[ga].width||0);Xa<en&&(en=Xa),rn>Da&&(Da=rn)}isFinite(en)||(en=0),isFinite(Da)||(Da=200);var cn=30,ia=20,Ga=Math.max(Da-en,(x.title.length||0)*10+20),ha=en+(Da-en-Ga)/2,on=-cn-ia/2;r(C,null,null,mxUtils.htmlEntities(x.title),ha,on,Ga,ia,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=18;fontColor=light-dark(#333333,#cccccc);fontFamily=trebuchet ms,verdana,arial,sans-serif;")}return pt(C)}var Yr=["#ECECFF","#FFFFDE","#FFECFE","#DEFFE0","#ECFFFE","#FFDEE0","#FFEFEC","#DEFBFF"],ke="#666666",ze="#666666",lr="#333333",ir="#FFF8DC",ur="#999999",zr="#000000",cr="Open Sans,sans-serif",Nr="'trebuchet ms',verdana,arial,sans-serif";function Fr(e){return Yr[e%Yr.length]}function sa(e,x){var C=d(),S=e.sections,Y=e.actors;e.title&&r(C,null,null,u(e.title),e.timelineStartX||150,0,Math.max(e.title.length*16,200),40,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=32;fontStyle=1;fontFamily="+Nr+";fontColor=light-dark(#333333,#cccccc);");for(var D=Object.keys(Y).sort(),At=0;At<D.length;At++){var U=Y[D[At]],q=60+At*20,rt=r(C,null,null,D[At],13,q-7,14,14,"ellipse;aspect=fixed;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;spacingLeft=10;strokeColor="+zr+";fillColor="+U.color+";fontFamily="+cr+";fontSize=16;");h(C,rt,"n:actor:"+D[At])}for(var ct=0;ct<S.length;ct++){var nt=S[ct],zt=nt.index!=null?nt.index:ct,Ot=Fr(zt);if(nt.name){var Ft=r(C,null,null,u(nt.name),nt.x,nt.y,nt.width,nt.height,"rounded=1;arcSize=6;whiteSpace=wrap;html=1;fillColor="+Ot+";strokeColor="+ke+";fontColor="+lr+";fontFamily="+cr+";fontSize=14;");h(C,Ft,"n:section:"+zt)}for(var Pt=0;Pt<nt.tasks.length;Pt++){var Wt=nt.tasks[Pt],Kt=Wt.x+Wt.width/2,Bt=C.insertEdge(null,null,null,null,null,"endArrow=none;html=1;strokeWidth=1;dashed=1;dashPattern=4 2;strokeColor="+ze+";");Bt.geometry.setTerminalPoint(new mxPoint(Math.round(Kt),Math.round(Wt.y)),!0),Bt.geometry.setTerminalPoint(new mxPoint(Math.round(Kt),Math.round(Wt.lineEndY)),!1),Bt.geometry.relative=!0;var ce=r(C,null,null,u(Wt.task),Wt.x,Wt.y,Wt.width,Wt.height,"rounded=1;arcSize=6;whiteSpace=wrap;html=1;fillColor="+Ot+";strokeColor="+ke+";fontColor="+lr+";fontFamily="+cr+";fontSize=14;");h(C,ce,"n:task:"+zt+":"+Pt);var kt=Wt.score>=4?"happy":Wt.score<=2?"sad":"neutral";r(C,null,null,"",Kt-15,Wt.faceCy-15,30,30,"shape=smileyFace;aspect=fixed;smileyType="+kt+";fillColor="+ir+";strokeColor="+ur+";strokeWidth=2;");var wt=0;for(var jt in Wt.actors)r(C,null,null,null,Wt.x+7+wt*10,Wt.y-7,14,14,"ellipse;aspect=fixed;strokeColor="+zr+";fillColor="+Wt.actors[jt].color+";"),wt++}}if(e.timelineStartX!=null&&e.timelineEndX!=null){var Ht=C.insertEdge(null,null,null,null,null,"endArrow=block;html=1;strokeWidth=4;endFill=1;strokeColor=light-dark(#000000,#cccccc);");Ht.geometry.setTerminalPoint(new mxPoint(Math.round(e.timelineStartX),Math.round(e.timelineY)),!0),Ht.geometry.setTerminalPoint(new mxPoint(Math.round(e.timelineEndX),Math.round(e.timelineY)),!1),Ht.geometry.relative=!0}return pt(C)}function yr(e,x,C){for(var S=d(),Y=S.getDefaultParent(),D=S.getDefaultParent(),At="rounded=0;whiteSpace=wrap;html=1;fillColor=light-dark(#EFEFEF,#2a2a2a);strokeColor=light-dark(#000000,#cccccc);strokeWidth=1;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontSize=12;fontColor=light-dark(#000000,#cccccc);align=center;verticalAlign=middle;",U="text;html=1;strokeColor=none;fillColor=none;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontSize=10;fontColor=light-dark(#000000,#cccccc);verticalAlign=middle;",q="text;html=1;strokeColor=none;fillColor=none;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontSize=14;fontColor=light-dark(#000000,#cccccc);align=center;verticalAlign=middle;",rt=11,ct=0;ct<e.blocks.length;ct++){var nt=e.blocks[ct],zt=r(S,D,null,mxUtils.htmlEntities(nt.label||""),nt.x,nt.y,nt.width,nt.height,At);h(S,zt,"n:bits:"+nt.startBit+"-"+nt.endBit);var Ot=nt.y-rt;if(nt.startBit===nt.endBit)r(S,D,null,String(nt.startBit),nt.x,Ot,nt.width,rt,U+"align=center;");else{var Ft=40;r(S,D,null,String(nt.startBit),nt.x,Ot,Ft,rt,U+"align=left;"),r(S,D,null,String(nt.endBit),nt.x+nt.width-Ft,Ot,Ft,rt,U+"align=right;")}}if(e.title){var Pt=32,Wt=e.canvasH-23-Pt/2;r(S,D,null,mxUtils.htmlEntities(e.title),0,Wt,e.canvasW,Pt,q)}return pt(S)}function kr(e,x,C,S,Y,D,At){var U=S+4,q=S*1.2,rt=(U-q)/2+S*.25,ct=e;Y==="middle"?ct=e-C/2:Y==="end"&&(ct=e-C);var nt;if(D==="hanging"?nt=x-rt:D==="middle"?nt=x-U/2:D==="alphabetic"?nt=x-U:nt=x,!At)return{x:ct,y:nt,width:C,height:U,rotation:0};var zt=At*Math.PI/180,Ot=Math.cos(zt),Ft=Math.sin(zt);function Pt(qt,re){var Ut=qt-e,ve=re-x;return{x:e+Ut*Ot-ve*Ft,y:x+Ut*Ft+ve*Ot}}var Wt=Pt(ct,nt),Kt=Pt(ct+C,nt),Bt=Pt(ct+C,nt+U),ce=Pt(ct,nt+U),kt=Math.min(Wt.x,Kt.x,Bt.x,ce.x),wt=Math.max(Wt.x,Kt.x,Bt.x,ce.x),jt=Math.min(Wt.y,Kt.y,Bt.y,ce.y),Ht=Math.max(Wt.y,Kt.y,Bt.y,ce.y);return{x:(kt+wt)/2-C/2,y:(jt+Ht)/2-U/2,width:C,height:U,rotation:At}}function pr(e,x,C,S,Y,D,At){var U=e;Y==="middle"?U=e-C/2:Y==="end"&&(U=e-C);var q=x;if(D==="middle"?q=x-S/2:D==="alphabetic"?q=x-S:D==="hanging"&&(q=x-7),!At)return{x:U,y:q,width:C,height:S,rotation:0};var rt=At*Math.PI/180,ct=Math.cos(rt),nt=Math.sin(rt);function zt(wt,jt){var Ht=wt-e,qt=jt-x;return{x:e+Ht*ct-qt*nt,y:x+Ht*nt+qt*ct}}var Ot=zt(U,q),Ft=zt(U+C,q),Pt=zt(U+C,q+S),Wt=zt(U,q+S),Kt=Math.min(Ot.x,Ft.x,Pt.x,Wt.x),Bt=Math.max(Ot.x,Ft.x,Pt.x,Wt.x),ce=Math.min(Ot.y,Ft.y,Pt.y,Wt.y),kt=Math.max(Ot.y,Ft.y,Pt.y,Wt.y);return{x:(Kt+Bt)/2-C/2,y:(ce+kt)/2-S/2,width:C,height:S,rotation:At}}function rr(e,x,C){for(var S=d(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily,rt=e.textColor,ct=e.borderColor,nt=0;nt<e.quadrants.length;nt++){var zt=e.quadrants[nt],Ot=r(S,U,null,"",zt.x,zt.y,zt.w,zt.h,"rounded=0;whiteSpace=wrap;html=1;fillColor="+zt.fill+";strokeColor=none;");h(S,Ot,"n:quadrant:"+nt)}var Ft=e.plotLeft,Pt=e.plotTop,Wt=e.plotRight,Kt=e.plotBottom,Bt=e.midX,ce=e.midY;r(S,U,null,"",Ft,Pt,Wt-Ft,Kt-Pt,"rounded=0;fillColor=none;strokeColor="+ct+";strokeWidth=2;html=1;"),r(S,U,null,"",Bt,Pt+1,1,Kt-Pt-2,"rounded=0;fillColor="+ct+";strokeColor=none;html=1;"),r(S,U,null,"",Ft+1,ce,Wt-Ft-2,1,"rounded=0;fillColor="+ct+";strokeColor=none;html=1;");for(var nt=0;nt<e.quadrants.length;nt++){var zt=e.quadrants[nt];if(zt.label){var kt=Math.max(zt.label.length*10+20,120),wt=kr(zt.labelCx,zt.labelCy,kt,16,"middle",zt.labelBaseline,0);r(S,U,null,mxUtils.htmlEntities(zt.label),wt.x,wt.y,wt.width,wt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+zt.color+";align=center;verticalAlign=middle;")}}for(var nt=0;nt<e.points.length;nt++){var jt=e.points[nt],Ht=jt.radius,qt="ellipse;fillColor="+jt.fill;jt.strokeWidth>0&&jt.stroke?qt+=";strokeColor="+jt.stroke+";strokeWidth="+jt.strokeWidth:qt+=";strokeColor=none;strokeWidth=0",qt+=";html=1;";var re=r(S,U,null,"",jt.cx-Ht,jt.cy-Ht,2*Ht,2*Ht,qt);jt.name&&h(S,re,"n:point:"+jt.name);var kt=Math.max(jt.name.length*8+20,60),wt=kr(jt.cx,jt.cy+5,kt,12,"middle","hanging",0);r(S,U,null,mxUtils.htmlEntities(jt.name),wt.x,wt.y,wt.width,wt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=12;fontColor="+rt+";align=center;verticalAlign=middle;")}for(var nt=0;nt<e.axisLabels.length;nt++){var Ut=e.axisLabels[nt];if(Ut.text){var kt=Math.max(Ut.text.length*10+20,120),wt=kr(Ut.anchorX,Ut.anchorY,kt,Ut.fontSize,Ut.textAnchor,Ut.baseline,Ut.rotation),ve=Ut.textAnchor==="middle"?"center":Ut.textAnchor==="end"?"right":"left",we="text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+Ut.fontSize+";fontColor="+rt+";align="+ve+";verticalAlign=middle;";wt.rotation&&(we+="rotation="+wt.rotation+";"),r(S,U,null,mxUtils.htmlEntities(Ut.text),wt.x,wt.y,wt.width,wt.height,we)}}if(e.title){var kt=400,wt=kr(Bt,10,kt,20,"middle","hanging",0);r(S,U,null,mxUtils.htmlEntities(e.title),wt.x,wt.y,wt.width,wt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=20;fontColor="+e.titleColor+";align=center;verticalAlign=middle;")}return pt(S)}function Pr(e,x,C){var S=d(),Y=S.getDefaultParent(),D=e.colors,At=e.fontFamily,U=e.nodeRadius;function q(Ir,Cr,Ea,xa,aa){var Gr=S.insertEdge(null,null,null,null,null,aa);return Gr.geometry.setTerminalPoint(new mxPoint(Math.round(Ir),Math.round(Cr)),!0),Gr.geometry.setTerminalPoint(new mxPoint(Math.round(Ea),Math.round(xa)),!1),Gr.geometry.relative=!0,Gr}function rt(Ir,Cr,Ea,xa,aa,Gr,ya,Br,pa,i){if(Ir==null||Ir==="")return null;var m=kr(Cr,Ea,xa,aa,Gr,ya,Br||0),k=Gr==="middle"?"center":Gr==="end"?"right":"left",R="text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize="+aa+";fontColor="+pa+";align="+k+";verticalAlign=middle;";return i&&(R+="fontStyle=1;"),m.rotation&&(R+="rotation="+m.rotation+";"),r(S,Y,null,mxUtils.htmlEntities(Ir),m.x,m.y,m.width,m.height,R)}var ct="endArrow=none;startArrow=none;html=1;rounded=0;strokeWidth=1;strokeColor="+D.axis+";";q(e.axisLeft,e.axisBottom,e.axisRight,e.axisBottom,ct),q(e.axisLeft,e.axisTop,e.axisLeft,e.axisBottom,ct);var nt=e.axisRight-e.axisLeft,zt=e.axisBottom-e.axisTop;rt(e.xLabel,e.axisLeft+nt/2,e.height-e.padding/4,200,12,"middle","alphabetic",0,D.axisText,!0),rt(e.yLabel,e.padding/3,e.axisTop+zt/2,200,12,"middle","alphabetic",-90,D.axisText,!0);for(var Ot=0;Ot<e.stageBands.length;Ot++){var Ft=e.stageBands[Ot];Ft.showBoundary&&q(Ft.boundaryX,e.axisTop,Ft.boundaryX,e.axisBottom,"endArrow=none;startArrow=none;html=1;rounded=0;strokeWidth=1;dashed=1;dashPattern=5 5;opacity=80;strokeColor="+D.axis+";"),rt(Ft.label,Ft.centerX,Ft.labelY,160,10,"middle","alphabetic",0,D.axisText,!1)}for(var Pt=0;Pt<e.pipelines.length;Pt++){var Wt=e.pipelines[Pt];r(S,Y,null,"",Wt.boxX,Wt.boxY,Wt.boxW,Wt.boxH,"rounded=1;arcSize=8;html=1;fillColor=none;strokeColor="+D.axis+";strokeWidth=1.5;");for(var Kt=0;Kt<Wt.links.length;Kt++){var Bt=Wt.links[Kt];q(Bt.x1,Bt.y1,Bt.x2,Bt.y2,"endArrow=none;startArrow=none;html=1;rounded=0;strokeWidth=1;dashed=1;dashPattern=4 4;strokeColor="+D.link+";")}}for(var ce={},kt=0;kt<e.nodes.length;kt++){var wt=e.nodes[kt],jt;if(wt.kind==="anchor")jt=r(S,Y,null,"",wt.cx-U,wt.cy-U,2*U,2*U,"ellipse;html=1;fillColor=none;strokeColor=none;");else if(wt.isPipelineParent){var Ht=wt.radius*2;jt=r(S,Y,null,"",wt.cx-wt.radius,wt.cy-wt.radius,Ht,Ht,"rounded=0;html=1;fillColor="+D.componentFill+";strokeColor="+D.componentStroke+";strokeWidth=1;")}else if(wt.strategy){var qt=U*2,re=qt*2;if(wt.strategy==="market"){jt=r(S,Y,null,"",wt.cx-qt,wt.cy-qt,re,re,"ellipse;html=1;fillColor=#ffffff;strokeColor="+D.componentStroke+";strokeWidth=1;");var Ut=U*1.2,ve=Math.cos(Math.PI/6),we=Math.sin(Math.PI/6),Se={x:wt.cx,y:wt.cy-Ut},be={x:wt.cx-Ut*ve,y:wt.cy+Ut*we},Me={x:wt.cx+Ut*ve,y:wt.cy+Ut*we},Fe="endArrow=none;startArrow=none;html=1;rounded=0;strokeWidth=1;strokeColor="+D.componentStroke+";";q(Se.x,Se.y,be.x,be.y,Fe),q(be.x,be.y,Me.x,Me.y,Fe),q(Me.x,Me.y,Se.x,Se.y,Fe);for(var Ue=U*.7,De=[Se,be,Me],Ye=0;Ye<De.length;Ye++)r(S,Y,null,"",De[Ye].x-Ue,De[Ye].y-Ue,Ue*2,Ue*2,"ellipse;html=1;fillColor=#ffffff;strokeColor="+D.componentStroke+";strokeWidth=2;")}else{var Pe=wt.strategy==="build"?"#eeeeee":wt.strategy==="buy"?"#cccccc":"#666666",de=wt.strategy==="build"?"#000000":D.componentStroke;jt=r(S,Y,null,"",wt.cx-qt,wt.cy-qt,re,re,"ellipse;html=1;fillColor="+Pe+";strokeColor="+de+";strokeWidth=1;centerRadius="+U+";centerColor=#ffffff;centerStroke=1;")}}else jt=r(S,Y,null,"",wt.cx-U,wt.cy-U,2*U,2*U,"ellipse;html=1;fillColor="+D.componentFill+";strokeColor="+D.componentStroke+";strokeWidth=1;");if(h(S,jt,"n:"+wt.kind+":"+wt.id),ce[wt.id]=jt,wt.inertia){var Ve=wt.cx+wt.radius+15;r(S,Y,null,"",Ve-3,wt.cy-wt.radius,6,2*wt.radius,"rounded=0;html=1;fillColor="+D.componentStroke+";strokeColor=none;")}}for(var Ne=0;Ne<e.links.length;Ne++){var nr=e.links[Ne],Ge=ce[nr.from],Ie=ce[nr.to];if(!(!Ge||!Ie)){var Ce=nr.flow==="backward"||nr.flow==="bidirectional"?"block":"none",Ke=nr.flow==="forward"||nr.flow==="bidirectional"?"block":"none",We="edgeStyle=none;html=1;rounded=0;strokeWidth=1;strokeColor="+D.link+";startArrow="+Ce+";endArrow="+Ke+";startFill=1;endFill=1;";nr.dashed&&(We+="dashed=1;dashPattern=6 6;"),nr.flow&&(We+="fontSize=10;fontColor="+D.axisText+";"),S.insertEdge(Y,null,nr.label?mxUtils.htmlEntities(nr.label):null,Ge,Ie,We)}}for(var le=0;le<e.trends.length;le++){var Ut=e.trends[le],Ae=Ut.targetX-Ut.cx,Le=Ut.targetY-Ut.cy,Re=Math.sqrt(Ae*Ae+Le*Le)||1,Be=Ut.cx+Ae/Re*(U+1),je=Ut.cy+Le/Re*(U+1),ie=Ut.targetX-Ae/Re*(U+2),fr=Ut.targetY-Le/Re*(U+2);q(Be,je,ie,fr,"endArrow=block;startArrow=none;endFill=1;html=1;rounded=0;strokeWidth=1;dashed=1;dashPattern=4 4;strokeColor="+D.evolution+";")}for(var Ar=0;Ar<e.nodes.length;Ar++){var Lr=e.nodes[Ar],Ze=Math.max(Lr.name.length*6+10,40);rt(Lr.name,Lr.labelX,Lr.labelY,Ze,10,Lr.labelAnchor,Lr.labelBaseline,0,D.labelColor,Lr.labelBold)}for(var dr=0;dr<e.notes.length;dr++){var Xe=e.notes[dr],br=Math.max(Xe.text.length*7+10,40);rt(Xe.text,Xe.x+br/2,Xe.y,br,11,"middle","middle",0,D.axisText,!0)}for(var vr=0;vr<e.annotations.length;vr++){var gr=e.annotations[vr];r(S,Y,null,"",gr.x-10,gr.y-10,20,20,"ellipse;html=1;fillColor=#ffffff;strokeColor="+D.axis+";strokeWidth=1.5;"),rt(String(gr.number),gr.x,gr.y,20,10,"middle","middle",0,D.axisText,!0)}for(var fa=0;fa<e.accelerators.length;fa++){var Je=e.accelerators[fa],$e=60,Qr=30,$r="shape=singleArrow;html=1;arrowWidth=0.5;arrowSize=0.33;fillColor=#ffffff;strokeColor="+D.componentStroke+";strokeWidth=1;"+(Je.decel?"direction=west;":"direction=east;");r(S,Y,null,"",Je.x-$e/2,Je.y-Qr/2,$e,Qr,$r),rt(Je.name,Je.x,Je.y+Qr/2+8,Math.max(Je.name.length*7+10,60),10,"middle","middle",0,D.axisText,!0)}return e.title&&rt(e.title,e.width/2,e.padding/2,400,13,"middle","middle",0,D.axisText,!0),pt(S)}function ta(e,x,C){for(var S=d(),Y=S.getDefaultParent(),D=e.fontFamily,At=0;At<e.swimlanes.length;At++){var U=e.swimlanes[At];r(S,Y,null,"",U.x,U.y,U.width,U.height,"rounded=1;arcSize=2;html=1;fillColor="+e.swimlaneBg+";strokeColor="+e.swimlaneStroke+";");var q=kr(U.labelX,U.labelY,240,16,"start","alphabetic",0);r(S,Y,null,mxUtils.htmlEntities(U.label),q.x,q.y,q.width,q.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+D+";fontSize=16;fontStyle=1;fontColor=#333333;align=left;verticalAlign=middle;")}for(var rt=0;rt<e.boxes.length;rt++){var ct=e.boxes[rt],nt=r(S,Y,null,ct.content,ct.x,ct.y,ct.width,ct.height,"rounded=1;arcSize=4;html=1;whiteSpace=wrap;fillColor="+ct.fill+";strokeColor="+ct.stroke+";fontFamily="+D+";fontSize=16;fontColor=#333333;align=center;verticalAlign=middle;");h(S,nt,"n:frame:"+ct.frameName)}for(var zt=0;zt<e.relations.length;zt++){var Ot=e.relations[zt],Ft=S.insertEdge(Y,null,null,null,null,"edgeStyle=none;html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;strokeWidth=1;strokeColor="+e.relationStroke+";");Ft.geometry.setTerminalPoint(new mxPoint(Math.round(Ot.x1),Math.round(Ot.y1)),!0),Ft.geometry.setTerminalPoint(new mxPoint(Math.round(Ot.x2),Math.round(Ot.y2)),!1),Ft.geometry.relative=!0}return pt(S)}var wr={default:[{fill:"#8686ff",text:"#ffffff",line:"#ffffb9"},{fill:"#ffff78",text:"#333333",line:"#ababff"},{fill:"#d7ff86",text:"#333333",line:"#d0b9ff"},{fill:"#c286ff",text:"#ffffff",line:"#dcffb9"},{fill:"#ff86ff",text:"#333333",line:"#b9ffb9"},{fill:"#ff86c2",text:"#333333",line:"#b9ffdc"},{fill:"#ff8686",text:"#333333",line:"#b9ffff"},{fill:"#ffc286",text:"#333333",line:"#b9dcff"},{fill:"#c2ff86",text:"#333333",line:"#dcb9ff"},{fill:"#86ffc2",text:"#333333",line:"#ffb9dc"},{fill:"#86ffff",text:"#333333",line:"#ffb9b9"},{fill:"#86c2ff",text:"#333333",line:"#ffdcb9"}],base:[{fill:"#ffcb5d",text:"#333333",line:"#0034a2"},{fill:"#cb5dff",text:"#333333",line:"#34a200"},{fill:"#77a3ff",text:"#333333",line:"#885c00"},{fill:"#e3ff5d",text:"#333333",line:"#1c00a2"},{fill:"#92ff5d",text:"#333333",line:"#6d00a2"},{fill:"#5dff7a",text:"#333333",line:"#a20085"},{fill:"#5dffcb",text:"#333333",line:"#a20034"},{fill:"#5de3ff",text:"#333333",line:"#a21c00"},{fill:"#9680ff",text:"#333333",line:"#697f00"},{fill:"#ff5de3",text:"#333333",line:"#00a21c"},{fill:"#ff5d92",text:"#333333",line:"#00a26d"},{fill:"#ff7a5d",text:"#333333",line:"#0085a2"}],neutral:[{fill:"#555555",text:"#F4F4F4",line:"#aaaaaa"},{fill:"#F4F4F4",text:"#333333",line:"#0b0b0b"},{fill:"#555555",text:"#F4F4F4",line:"#aaaaaa"},{fill:"#BBBBBB",text:"#333333",line:"#444444"},{fill:"#777777",text:"#333333",line:"#888888"},{fill:"#999999",text:"#333333",line:"#666666"},{fill:"#DDDDDD",text:"#333333",line:"#222222"},{fill:"#FFFFFF",text:"#333333",line:"#000000"},{fill:"#DDDDDD",text:"#333333",line:"#222222"},{fill:"#BBBBBB",text:"#333333",line:"#444444"},{fill:"#999999",text:"#333333",line:"#666666"},{fill:"#777777",text:"#333333",line:"#888888"}],dark:[{fill:"#1f2020",text:"#d3d3d3",line:"#e0dfdf"},{fill:"#0b0000",text:"#d3d3d3",line:"#f4ffff"},{fill:"#4d1037",text:"#d3d3d3",line:"#b2efc8"},{fill:"#3f5258",text:"#d3d3d3",line:"#c0ada7"},{fill:"#4f2f1b",text:"#d3d3d3",line:"#b0d0e4"},{fill:"#6e0a0a",text:"#d3d3d3",line:"#91f5f5"},{fill:"#3b0048",text:"#d3d3d3",line:"#c4ffb7"},{fill:"#995a01",text:"#d3d3d3",line:"#66a5fe"},{fill:"#154706",text:"#d3d3d3",line:"#eab8f9"},{fill:"#161722",text:"#d3d3d3",line:"#e9e8dd"},{fill:"#00296f",text:"#d3d3d3",line:"#ffd690"},{fill:"#01629c",text:"#d3d3d3",line:"#fe9d63"}],forest:[{fill:"#b9d970",text:"#333333",line:"#9070d9"},{fill:"#acff7f",text:"#333333",line:"#d27fff"},{fill:"#cde498",text:"#333333",line:"#af98e4"},{fill:"#84d970",text:"#333333",line:"#c570d9"},{fill:"#70d990",text:"#333333",line:"#d970b9"},{fill:"#70d9c5",text:"#333333",line:"#d97084"},{fill:"#70b9d9",text:"#333333",line:"#d99070"},{fill:"#7084d9",text:"#333333",line:"#d9c570"},{fill:"#c570d9",text:"#333333",line:"#84d970"},{fill:"#d97084",text:"#333333",line:"#70d9c5"},{fill:"#d99070",text:"#333333",line:"#70b9d9"},{fill:"#d9c570",text:"#333333",line:"#7084d9"}]},Sa={default:"#333333",base:"#333333",neutral:"#000000",dark:"#cccccc",forest:"#000000"},ca={default:"#000000",base:"#333333",neutral:"#333333",dark:"#d3d3d3",forest:"#000000"};function ba(e){var x=e&&e.theme||"default",C=e&&e.themeVariables||{};return C.lineColor||ca[x]||"#000000"}function ra(e){for(var x=e&&e.theme||"default",C=wr[x]||wr.default,S=e&&e.themeVariables||{},Y=[],D=0;D<C.length;D++)Y.push({fill:S["cScale"+D]||C[D].fill,text:S["cScaleLabel"+D]||C[D].text,line:S["cScaleInv"+D]||C[D].line});return Y}function Dr(e){var x=e&&e.theme||"default",C=e&&e.themeVariables||{};return C.titleColor||C.textColor||Sa[x]||"#333333"}function la(e,x){var C=x||wr.default,S=((e+1)%C.length+C.length)%C.length;return C[S]}var qr=wr.default;function ma(e,x){if(!e||e.charAt(0)!=="#"||e.length!==7)return e;var C=parseInt(e.substring(1,3),16),S=parseInt(e.substring(3,5),16),Y=parseInt(e.substring(5,7),16),D=Math.min(255,Math.round(C*x)),At=Math.min(255,Math.round(S*x)),U=Math.min(255,Math.round(Y*x));return"#"+("0"+D.toString(16)).slice(-2)+("0"+At.toString(16)).slice(-2)+("0"+U.toString(16)).slice(-2)}function Ja(e,x,C){if(e.vertical)return fn(e,x,C);for(var S=d(),Y=e.canvasW,D=e.canvasH,At=e.palette||ra(x),U=S.getDefaultParent(),q=e.fontFamily,rt=Dr(x),ct=ba(x),nt=0;nt<e.columns.length;nt++){var zt=e.columns[nt],Ot=la(zt.colorIdx,At),Ft=r(S,U,null,"",zt.x,e.taskRowY,e.cardWidth,e.cardHeight,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+Ot.fill+";strokeColor=none;");h(S,Ft,"n:task:"+nt),r(S,U,null,"",zt.x,e.taskRowY+e.cardHeight,e.cardWidth,3,"rounded=0;fillColor="+Ot.line+";strokeColor=none;html=1;"),r(S,U,null,sn(zt.period.name),zt.x,e.taskRowY,e.cardWidth,e.cardHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+Ot.text+";align=center;verticalAlign=top;whiteSpace=wrap;spacingLeft=20;spacingRight=20;spacingTop=10;")}for(var nt=0;nt<e.columns.length;nt++){var zt=e.columns[nt],Pt=e.taskRowY+e.cardHeight,Wt=S.insertEdge(U,null,"",null,null,"endArrow=blockThin;html=1;strokeColor="+ct+";strokeWidth=2;dashed=1;dashPattern=5 5;fixDash=1;fontSize=12;");Wt.geometry.setTerminalPoint(new mxPoint(zt.centerX,Pt),!0),Wt.geometry.setTerminalPoint(new mxPoint(zt.centerX,e.vertArrowBot),!1)}for(var nt=0;nt<e.columns.length;nt++)for(var zt=e.columns[nt],Ot=la(zt.colorIdx,At),Kt=ma(Ot.fill,1.2),Bt=ma(Ot.line,1.2),ce=0;ce<zt.events.length;ce++){var kt=zt.eventYs&&zt.eventYs[ce]!=null?zt.eventYs[ce]:e.firstEventY+ce*e.eventPitch,wt=zt.eventHeights&&zt.eventHeights[ce]!=null?zt.eventHeights[ce]:e.eventHeight,jt=r(S,U,null,"",zt.x,kt,e.eventWidth,wt,"rounded=1;arcSize=10;whiteSpace=wrap;html=1;fillColor="+Kt+";strokeColor=none;");h(S,jt,"n:event:"+nt+":"+ce),r(S,U,null,"",zt.x,kt+wt,e.eventWidth,3,"rounded=0;fillColor="+Bt+";strokeColor=none;html=1;"),r(S,U,null,sn(zt.events[ce]),zt.x,kt,e.eventWidth,wt,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+Ot.text+";align=center;verticalAlign=middle;whiteSpace=wrap;spacingLeft=20;spacingRight=20;")}for(var nt=0;nt<e.sectionRects.length;nt++){var Ht=e.sectionRects[nt],Ot=la(Ht.colorIdx,At),qt=r(S,U,null,"",Ht.x,Ht.y,Ht.width,Ht.height,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+Ot.fill+";strokeColor=none;");h(S,qt,"n:section:"+nt),r(S,U,null,"",Ht.x,Ht.y+Ht.height,Ht.width,3,"rounded=0;fillColor="+Ot.line+";strokeColor=none;html=1;"),r(S,U,null,sn(Ht.name),Ht.x,Ht.y,Ht.width,Ht.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+Ot.text+";align=center;verticalAlign=top;whiteSpace=wrap;spacingLeft=20;spacingRight=20;spacingTop=10;")}var re=S.insertEdge(U,null,"",null,null,"endArrow=blockThin;html=1;strokeColor="+ct+";strokeWidth=4;exitX=0;exitY=0;entryX=1;entryY=1;fontSize=12;");if(re.geometry.setTerminalPoint(new mxPoint(e.horizArrowX1,e.arrowY),!0),re.geometry.setTerminalPoint(new mxPoint(e.horizArrowX2,e.arrowY),!1),e.title){var Ut=Math.max(e.title.length*18+40,400);r(S,U,null,mxUtils.htmlEntities(e.title),e.titleX,e.titleY,Ut,40,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=34;fontStyle=1;fontColor="+rt+";align=left;verticalAlign=middle;spacingLeft=0;")}return pt(S)}function sn(e){return e==null?"":mxUtils.htmlEntities(String(e).replace(/<br\s*\/?>/gi,"\0BR\0")).replace(/\x00BR\x00/g,"<br>")}function fn(e,x,C){var S=d(),Y=e.canvasW,D=e.canvasH,At=e.palette||ra(x),U=S.getDefaultParent(),q=e.fontFamily,rt=Dr(x),ct=ba(x),nt=4,zt=24,Ot=16,Ft=e.timelineX-nt/2,Pt=e.arrowY1,Wt=e.arrowY2-Ot+1;r(S,U,null,"",Ft,Pt,nt,Wt-Pt,"rounded=0;fillColor="+ct+";strokeColor=none;html=1;"),r(S,U,null,"",e.timelineX-zt/2,e.arrowY2-Ot,zt,Ot,"shape=triangle;direction=south;fillColor="+ct+";strokeColor="+ct+";html=1;");for(var Kt=0;Kt<e.rows.length;Kt++){var Bt=e.rows[Kt],ce=la(Bt.colorIdx,At),kt=ma(ce.fill,1.2),wt=ma(ce.line,1.2),jt=r(S,U,null,"",Bt.taskX,Bt.taskY,Bt.taskWidth,Bt.taskHeight,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+ce.fill+";strokeColor=none;");h(S,jt,"n:task:"+Kt),r(S,U,null,"",Bt.taskX,Bt.taskY+Bt.taskHeight,Bt.taskWidth,3,"rounded=0;fillColor="+ce.line+";strokeColor=none;html=1;"),r(S,U,null,sn(Bt.taskName),Bt.taskX,Bt.taskY,Bt.taskWidth,Bt.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ce.text+";align=center;verticalAlign=top;whiteSpace=wrap;spacingLeft=5;spacingRight=5;spacingTop=2;");for(var Ht=0;Ht<Bt.events.length;Ht++){var qt=Bt.events[Ht],re=S.insertEdge(U,null,"",null,null,"endArrow=none;startArrow=none;html=1;strokeColor="+ct+";strokeWidth=2;dashed=1;dashPattern=5 5;fixDash=1;fontSize=12;");re.geometry.setTerminalPoint(new mxPoint(e.timelineX,qt.lineY),!0),re.geometry.setTerminalPoint(new mxPoint(qt.x,qt.lineY),!1);var Ut=r(S,U,null,"",qt.x,qt.y,qt.width,qt.height,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+kt+";strokeColor=none;");h(S,Ut,"n:event:"+Kt+":"+Ht),r(S,U,null,"",qt.x,qt.y+qt.height,qt.width,3,"rounded=0;fillColor="+wt+";strokeColor=none;html=1;"),r(S,U,null,sn(qt.text),qt.x,qt.y,qt.width,qt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ce.text+";align=center;verticalAlign=top;whiteSpace=wrap;spacingLeft=5;spacingRight=5;spacingTop=2;")}}for(var Kt=0;Kt<e.sectionRects.length;Kt++){var ve=e.sectionRects[Kt],ce=la(ve.colorIdx,At),we=r(S,U,null,"",ve.x,ve.y,ve.width,ve.height,"rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor="+ce.fill+";strokeColor=none;");h(S,we,"n:section:"+Kt),r(S,U,null,"",ve.x,ve.y+ve.height,ve.width,3,"rounded=0;fillColor="+ce.line+";strokeColor=none;html=1;"),r(S,U,null,sn(ve.name),ve.x,ve.y,ve.width,ve.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ce.text+";align=center;verticalAlign=middle;whiteSpace=wrap;spacingLeft=5;spacingRight=5;")}if(e.title){var Se=Math.max(e.title.length*18+40,400);r(S,U,null,mxUtils.htmlEntities(e.title),e.titleX,e.titleY,Se,40,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=34;fontStyle=1;fontColor="+rt+";align=left;verticalAlign=middle;spacingLeft=0;")}return pt(S)}var Na=[null,{fill:"#ffffab",text:"#333333"},{fill:"#e8ffb9",text:"#333333"},{fill:"#dcb9ff",text:"#ffffff"},{fill:"#ffb9ff",text:"#333333"},{fill:"#ffb9dc",text:"#333333"},{fill:"#ffb9b9",text:"#333333"},{fill:"#ffdcb9",text:"#333333"},{fill:"#dcffb9",text:"#333333"},{fill:"#b9ffdc",text:"#333333"},{fill:"#b9ffff",text:"#333333"}],Cn={"very high":"#ff0000",high:"#ffa500",low:"#0000ff","very low":"#add8e6"};function Mn(e){var x=((e-1)%(Na.length-1)+(Na.length-1))%(Na.length-1)+1;return Na[x]}function nn(e,x,C){for(var S=d(),Y=S.getDefaultParent(),D=e.fontFamily,At=25,U=10,q=5,rt=0;rt<e.columns.length;rt++){var ct=e.columns[rt],nt=Mn(ct.colorIdx),zt=r(S,Y,null,mxUtils.htmlEntities(ct.label),ct.x,ct.y,ct.width,ct.height,"swimlane;startSize="+At+";swimlaneLine=0;rounded=1;absoluteArcSize=1;arcSize=10;html=1;fillColor="+nt.fill+";swimlaneFillColor="+nt.fill+";strokeColor="+nt.fill+";strokeWidth=1;fontFamily="+D+";fontSize=16;fontStyle=0;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;container=1;collapsible=0;childLayout=stackLayout;horizontalStack=0;resizeParent=0;resizeParentMax=0;resizeLast=0;marginTop=0;marginBottom="+U+";marginLeft=7.5;marginRight=7.5;stackSpacing="+q+";");h(S,zt,"n:column:"+(ct.id||"idx"+rt));for(var Ot=0;Ot<ct.cards.length;Ot++){var Ft=ct.cards[Ot],Pt=Ft.metadata||{},Wt=(ct.width-e.cardWidth)/2,Kt=Ft.top,Bt=r(S,zt,null,"",Wt,Kt,e.cardWidth,Ft.height,"rounded=1;absoluteArcSize=1;arcSize=10;whiteSpace=wrap;html=1;fillColor=light-dark(#FFFFFF,#1f2020);strokeColor=#9370DB;strokeWidth=1;container=1;collapsible=0;");if(h(S,Bt,"n:card:"+(Ft.id||(ct.id||"idx"+rt)+":"+Ot)),Pt.priority){var ce=Cn[Pt.priority.toLowerCase()];ce&&r(S,Bt,null,"",0,2,4,Ft.height-4,"rounded=0;fillColor="+ce+";strokeColor="+ce+";")}var kt=Ft.titleH||24,wt=Ft.hasMeta?4:10,jt='<div style="line-height:1.5;">'+mxUtils.htmlEntities(Ft.label)+"</div>";if(r(S,Bt,null,jt,10,wt,175,kt,"text;html=1;strokeColor=none;fillColor=none;whiteSpace=wrap;fontFamily="+D+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;spacing=0;"),Pt.ticket){var Ht=e.ticketBaseUrl?e.ticketBaseUrl.replace("#TICKET#",Pt.ticket):null,qt=r(S,Bt,null,mxUtils.htmlEntities(Pt.ticket),10,Ft.height-28,(e.cardWidth-20)/2,24,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+D+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;spacing=0;"+(Ht?"fontStyle=4;":""));if(Ht){var re=M(Ht);re&&S.setAttributeForCell(qt,"link",re)}}if(Pt.assigned){var Ut=Ft.assignedW||40;r(S,Bt,null,mxUtils.htmlEntities(Pt.assigned),e.cardWidth-10-Ut,Ft.height-28,Ut+2,24,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+D+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;spacing=0;")}}}return pt(S)}var An=["#ECECFF","#8493A6","#FF8A65","#81C784","#BA68C8","#FFD54F"];function dn(e,x){var C=An,S=x&&x.themeVariables&&x.themeVariables.xyChart&&x.themeVariables.xyChart.plotColorPalette;return typeof S=="string"&&S.length>0&&(C=S.split(",").map(function(Y){return Y.trim()}).filter(function(Y){return Y.length>0})),C[e%C.length]}function Ln(e,x,C){var S=d(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily,rt="light-dark(#131300,#e0dfdf)",ct="light-dark(#131300,#e0dfdf)",nt=x&&x.themeVariables&&x.themeVariables.xyChart||{},zt=nt.titleColor||ct;if(r(S,U,null,"",0,0,D,At,"rounded=0;fillColor=light-dark(#FFFFFF,#333333);strokeColor=none;"),e.title){var Ot=600,Ft=pr(D/2,e.titleY,Ot,28,"middle","middle",0);r(S,U,null,mxUtils.htmlEntities(e.title),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=20;fontColor="+zt+";align=center;verticalAlign=middle;")}for(var Pt=0;Pt<e.series.length;Pt++){var Wt=e.series[Pt];if(Wt.type==="bar")for(var Kt=dn(Wt.colorIdx,x),Bt=0;Bt<Wt.points.length;Bt++){var ce=Wt.points[Bt],kt=e.tickBot-ce.y;if(!(kt<=0)){var wt=r(S,U,null,"",ce.x-e.barWidth/2,ce.y,e.barWidth,kt,"rounded=0;fillColor="+Kt+";strokeColor=none;");h(S,wt,"n:bar:"+Pt+":"+Bt)}}else if(Wt.type==="line"&&Wt.points.length>=2){var jt=dn(Wt.colorIdx,x),Ht=Wt.points,qt=S.insertEdge(U,null,"",null,null,"endArrow=none;html=1;rounded=0;strokeColor="+jt+";strokeWidth=2;");h(S,qt,"n:line:"+Pt),qt.geometry.setTerminalPoint(new mxPoint(Ht[0].x,Ht[0].y),!0),qt.geometry.setTerminalPoint(new mxPoint(Ht[Ht.length-1].x,Ht[Ht.length-1].y),!1),qt.geometry.points=[];for(var Bt=1;Bt<Ht.length-1;Bt++)qt.geometry.points.push(new mxPoint(Ht[Bt].x,Ht[Bt].y))}}r(S,U,null,"",e.plotLeft-1,e.plotTop,2,e.tickBot-e.plotTop,"rounded=0;fillColor="+rt+";strokeColor=none;"),r(S,U,null,"",e.plotLeft-1,e.tickBot-1,D-e.plotLeft,2,"rounded=0;fillColor="+rt+";strokeColor=none;");for(var Pt=0;Pt<e.yTicks.length;Pt++){var re=e.yTicks[Pt];r(S,U,null,"",e.plotLeft-6,re.y-1,5,2,"rounded=0;fillColor="+rt+";strokeColor=none;");var Ft=pr(e.plotLeft-11,re.y,60,18,"end","middle",0);r(S,U,null,mxUtils.htmlEntities(Fn(re.value)),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=14;fontColor="+ct+";align=right;verticalAlign=middle;")}if(e.yAxis&&e.yAxis.title){var Ft=pr(5,(e.plotTop+e.plotBot)/2,200,20,"middle","hanging",-90);r(S,U,null,mxUtils.htmlEntities(e.yAxis.title),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ct+";align=center;verticalAlign=top;rotation=-90;")}var Ut=60;e.xCenters.length>1&&(Ut=Math.max(60,Math.min(120,Math.floor(e.xCenters[1]-e.xCenters[0])-4)));for(var Pt=0;Pt<e.xCenters.length;Pt++){var ve=e.xCenters[Pt],we=e.xLabels[Pt];r(S,U,null,"",ve-1,e.tickBot+1,2,5,"rounded=0;fillColor="+rt+";strokeColor=none;");var Ft=pr(ve,e.tickBot+11,Ut,18,"middle","hanging",0);r(S,U,null,mxUtils.htmlEntities(we),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=14;fontColor="+ct+";align=center;verticalAlign=top;")}if(e.xAxisTitle){var Se=(e.plotLeft+e.plotRight)/2,Ft=pr(Se,e.plotBot+37,300,20,"middle","hanging",0);r(S,U,null,mxUtils.htmlEntities(e.xAxisTitle),Ft.x,Ft.y,Ft.width,Ft.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=16;fontColor="+ct+";align=center;verticalAlign=top;")}if(e.showDataLabel)for(var Pt=0;Pt<e.series.length;Pt++){var Wt=e.series[Pt];if(Wt.type==="bar")for(var Bt=0;Bt<Wt.points.length;Bt++){var be=Wt.points[Bt],Me=Fn(be.value),Fe=Math.max(1,Me.length),Ue=e.barWidth||50,De=Math.max(8,Math.min(25,Math.floor(Ue*.85/Fe))),Ye=ct,Pe=50,de=be.y+1,Ve="top",kt=e.tickBot-be.y;(e.showDataLabelOutsideBar||kt<De+4)&&(de=be.y-De-6,Ve="middle"),r(S,U,null,Me,be.x-Pe/2,de,Pe,De+4,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+De+";fontColor="+Ye+";align=center;verticalAlign="+Ve+";")}}return pt(S)}function Fn(e){return Math.abs(e-Math.round(e))<1e-6?String(Math.round(e)):String(Math.round(e*100)/100)}var g=["#8686ff","#ffff78","#d7ff86","#c286ff","#ff86ff","#ff86c2","#ff8686","#ffc286"];function tt(e){return g[e%g.length]}function B(e,x){var C=e.length;if(C<2)return"";for(var S=typeof x=="number"?x:.17,Y="M"+e[0].x.toFixed(3)+","+e[0].y.toFixed(3),D=0;D<C;D++){var At=e[(D-1+C)%C],U=e[D],q=e[(D+1)%C],rt=e[(D+2)%C],ct=U.x+(q.x-At.x)*S,nt=U.y+(q.y-At.y)*S,zt=q.x-(rt.x-U.x)*S,Ot=q.y-(rt.y-U.y)*S;Y+=" C"+ct.toFixed(3)+","+nt.toFixed(3)+" "+zt.toFixed(3)+","+Ot.toFixed(3)+" "+q.x.toFixed(3)+","+q.y.toFixed(3)}return Y+" Z"}function Z(e,x,C){for(var S=d(),Y=S.getDefaultParent(),D=S.getDefaultParent(),At=e.fontFamily,U=e.centerX,q=e.centerY,rt=e.graticule==="polygon",ct=e.ringRadii.length-1;ct>=0;ct--){var nt=e.ringRadii[ct];if(rt){for(var zt=[],Ot=0;Ot<e.n;Ot++){var Ft=e.angles[Ot];zt.push({x:nt+nt*Math.cos(Ft),y:nt+nt*Math.sin(Ft)})}var Pt=zt.map(function(le){return le.x+","+le.y}).join(" "),Wt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+2*nt+" "+2*nt+'"><polygon points="'+Pt+'" fill="#DEDEDE" fill-opacity="0.3" stroke="#DEDEDE" stroke-width="1"/></svg>',Kt=typeof btoa=="function"?btoa(unescape(encodeURIComponent(Wt))):mxUtils.toBase64(Wt);r(S,D,null,"",U-nt,q-nt,2*nt,2*nt,"shape=image;html=1;imageAspect=0;image=data:image/svg+xml,"+Kt+";")}else r(S,D,null,"",U-nt,q-nt,2*nt,2*nt,"ellipse;fillColor=#DEDEDE;opacity=30;strokeColor=#DEDEDE;strokeWidth=1;")}for(var ct=0;ct<e.axes.length;ct++){var Bt=e.axes[ct],ce=S.insertEdge(D,null,"",null,null,"endArrow=none;html=1;strokeColor=light-dark(#333333,#cccccc);strokeWidth=2;");ce.geometry.setTerminalPoint(new mxPoint(U,q),!0),ce.geometry.setTerminalPoint(new mxPoint(U+Bt.tipX,q+Bt.tipY),!1)}for(var ct=0;ct<e.axes.length;ct++){var Bt=e.axes[ct];if(Bt.label){var kt=80,wt=18,jt=Math.cos(Bt.angle),Ht=Math.sin(Bt.angle),qt=U+Bt.labelX,re=q+Bt.labelY,Ut,ve;jt>.01?(ve="left",Ut=qt):jt<-.01?(ve="right",Ut=qt-kt):(ve="center",Ut=qt-kt/2);var we;Ht<-.01?we=re-4:Ht>.01?we=re+5:we=re,r(S,D,null,mxUtils.htmlEntities(Bt.label),Ut,we-wt/2-7,kt,wt,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=12;fontColor=light-dark(#333333,#cccccc);align="+ve+";verticalAlign=middle;")}}for(var Se=10,be=2*e.outerR+2*Se,Me=U-e.outerR-Se,Fe=q-e.outerR-Se,Ue=e.graticule==="polygon",De=e.curveOpacity!=null?e.curveOpacity:.5,ct=0;ct<e.curves.length;ct++){var Ye=e.curves[ct];if(!(Ye.points.length<2)){for(var Pe=e.cScaleColors&&e.cScaleColors[Ye.colorIdx]||tt(Ye.colorIdx),de=[],Ot=0;Ot<Ye.points.length;Ot++)de.push({x:Ye.points[Ot].x+e.outerR+Se,y:Ye.points[Ot].y+e.outerR+Se});var Ve;Ue?Ve="M"+de.map(function(Le){return Le.x+","+Le.y}).join("L")+"Z":Ve=B(de,e.curveTension);var Wt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+be+" "+be+'"><path d="'+Ve+'" fill="'+Pe+'" fill-opacity="'+De+'" stroke="'+Pe+'" stroke-width="2"/></svg>',Ne=typeof btoa=="function"?btoa(unescape(encodeURIComponent(Wt))):mxUtils.toBase64(Wt),nr=r(S,D,null,"",Me,Fe,be,be,"shape=image;html=1;imageAspect=0;image=data:image/svg+xml,"+Ne+";");h(S,nr,"n:curve:"+(Ye.label||"idx"+ct))}}for(var Ge=U+263,Ie=q-263,ct=0;ct<e.curves.length;ct++){var Ye=e.curves[ct],Pe=e.cScaleColors&&e.cScaleColors[Ye.colorIdx]||tt(Ye.colorIdx),Ce=Ie+ct*20,Ke=Math.round(De*100);r(S,D,null,"",Ge,Ce,12,12,"rounded=0;fillColor="+Pe+";strokeColor="+Pe+";fillOpacity="+Ke+";"),r(S,D,null,mxUtils.htmlEntities(Ye.label),Ge+16,Ce-2,80,16,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=12;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}if(e.title){var We='<div style="position:relative;top:-12px;">'+mxUtils.htmlEntities(e.title)+"</div>";r(S,D,null,We,U-200,0,400,20,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=top;")}return pt(S)}var H={person:{fill:"#08427B",stroke:"#073B6F",text:"#FFFFFF"},person_ext:{fill:"#686868",stroke:"#8A8A8A",text:"#FFFFFF"},system:{fill:"#1168BD",stroke:"#3C7FC0",text:"#FFFFFF"},system_ext:{fill:"#999999",stroke:"#8A8A8A",text:"#FFFFFF"},container:{fill:"#438DD5",stroke:"#3C7FC0",text:"#FFFFFF"},container_ext:{fill:"#B3B3B3",stroke:"#8A8A8A",text:"#FFFFFF"},component:{fill:"#85BBF0",stroke:"#78A8D8",text:"#FFFFFF"},component_ext:{fill:"#CCCCCC",stroke:"#ACACAC",text:"#FFFFFF"},node:{fill:"light-dark(#FFFFFF,#1f2020)",stroke:"light-dark(#444444,#cccccc)",text:"light-dark(#444444,#cccccc)"},boundary:{fill:"none",stroke:"light-dark(#444444,#cccccc)",text:"light-dark(#444444,#cccccc)"}};function yt(e,x){var C=e+(x?"_ext":"");return H[C]||H[e]||H.system}function ut(e){var x=e.c4Lines;if(!x)return'<div style="font-size:14px;font-weight:bold;">'+mxUtils.htmlEntities(e.label||"")+"</div>";function C(Y,D){for(var At=[],U=0;U<Y.length;U++)At.push(mxUtils.htmlEntities(Y[U]));return'<div style="'+D+'line-height:1.07;white-space:nowrap;">'+At.join("<br>")+"</div>"}var S=[];return x.name.length>0&&S.push(C(x.name,"font-size:14px;font-weight:bold;")),x.type.length>0&&S.push(C(x.type,"font-size:10.5px;"+(S.length>0?"margin-top:3px;":""))),x.descr.length>0&&S.push(C(x.descr,"font-size:11.48px;"+(S.length>0?"margin-top:3px;":""))),S.join("")}function ht(e,x,C){var S=d(),Y=S.getDefaultParent(),D=e.fontFamily,At=62,U=e.title?At:0;if(e.title){var q=50,rt=Math.max(20,(e.canvasW-2*q)/2-4*q);r(S,Y,null,mxUtils.htmlEntities(e.title),20,10,e.canvasW-40,24,"text;html=1;strokeColor=none;fillColor=none;fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=top;spacingLeft="+(rt-20)+";")}var ct={};function nt(le,Ae){var Le=yt(le.category,le.isExternal);if(le.children&&le.children.length>0){var Re,Be;if(le.category==="boundary"){Re="rounded=1;absoluteArcSize=1;arcSize=5;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#444444;strokeWidth=1;dashed=1;dashPattern=5 5;verticalAlign=top;align=center;spacingTop=2;fontSize=16;fontStyle=1;fontColor=#444444;fontFamily=Open Sans,sans-serif;";var je=mxUtils.htmlEntities(le.label||"");if(Be='<div style="font-size:16px;font-weight:bold;">'+je+"</div>",le.boundaryType){var ie=le.boundaryTypeExplicit?mxUtils.htmlEntities(le.boundaryType):mxUtils.htmlEntities(le.boundaryType).toUpperCase();Be+='<div style="font-size:14px;font-weight:normal;margin-top:4px;">['+ie+"]</div>"}}else{Re="rounded=1;absoluteArcSize=1;arcSize=5;whiteSpace=wrap;html=1;fillColor="+Le.fill+";strokeColor="+Le.stroke+";strokeWidth=1;verticalAlign=top;align=center;spacingTop=8;fontSize=16;fontStyle=1;fontColor="+Le.text+";fontFamily=Open Sans,sans-serif;";var fr=[];fr.push('<div style="font-size:16px;font-weight:bold;">'+mxUtils.htmlEntities(le.label||"")+"</div>"),le.technology&&fr.push('<div style="font-size:14px;font-weight:normal;margin-top:2px;">['+mxUtils.htmlEntities(le.technology)+"]</div>"),Be=fr.join("")}var Ar=r(S,Ae,null,Be,le.x,le.y,le.width,le.height,Re);le.id&&h(S,Ar,"n:"+le.id),ct[le.id]=Ar;for(var Lr=0;Lr<le.children.length;Lr++)nt(le.children[Lr],Ar);return}var Ze=ut(le),dr;if(le.isDb){var Xe=Math.round((le.cylinderRy||10)*100)/100;dr="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size="+Xe+";spacingTop=13;fillColor="+Le.fill+";strokeColor="+Le.stroke+";strokeWidth=1;fontColor="+Le.text+";"}else if(le.isQueue){var br=Math.round((le.queueRx||10)*100)/100;dr="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size="+br+";direction=east;fillColor="+Le.fill+";strokeColor="+Le.stroke+";strokeWidth=1;fontColor="+Le.text+";"}else le.category==="person"?dr=null:dr="rounded=1;absoluteArcSize=1;arcSize=24;whiteSpace=wrap;html=1;fillColor="+Le.fill+";strokeColor="+Le.stroke+";strokeWidth=1;fontColor="+Le.text+";";if(le.category==="person"){var vr=le.personHeadR||Math.min(le.width*.23,56),gr=le.personBodyH||le.height-2*vr+vr*.27,fa=Math.round(le.personBodyRadius||Math.min(le.width*.177,gr*.45)),Je=le.styleOverrides&&le.styleOverrides.bgColor||Le.fill,$e=le.styleOverrides&&le.styleOverrides.borderColor||Le.stroke,Qr=le.styleOverrides&&le.styleOverrides.fontColor||Le.text,$r="rounded=1;absoluteArcSize=1;arcSize="+2*fa+";whiteSpace=wrap;html=1;fillColor="+Je+";strokeColor="+$e+";strokeWidth=1;fontColor="+Qr+";align=center;verticalAlign=middle;fontFamily=Open Sans,sans-serif;",Ir="ellipse;html=1;fillColor="+Je+";strokeColor="+$e+";strokeWidth=1;",Cr=r(S,Ae,null,Ze,le.x,le.y+(le.height-gr),le.width,gr,$r);r(S,Ae,null,"",le.x+le.width/2-vr,le.y,vr*2,vr*2,Ir),le.id&&h(S,Cr,"n:"+le.id),ct[le.id]=Cr;return}le.styleOverrides&&(le.styleOverrides.bgColor&&(dr=dr.replace(/fillColor=[^;]*/,"fillColor="+le.styleOverrides.bgColor)),le.styleOverrides.borderColor&&(dr=dr.replace(/strokeColor=[^;]*/,"strokeColor="+le.styleOverrides.borderColor)),le.styleOverrides.fontColor&&(dr=dr.replace(/fontColor=[^;]*/,"fontColor="+le.styleOverrides.fontColor)));var Ea=dr+"align=center;verticalAlign=middle;fontFamily=Open Sans,sans-serif;",xa=r(S,Ae,null,Ze,le.x,le.y,le.width,le.height,Ea);le.id&&h(S,xa,"n:"+le.id),ct[le.id]=xa}for(var zt=0;zt<e.elements.length;zt++)e.elements[zt].y+=U,nt(e.elements[zt],Y);for(var zt=0;zt<e.relations.length;zt++){var Ot=e.relations[zt],Ft=ct[Ot.from],Pt=ct[Ot.to];if(!(!Ft||!Pt)){var Wt=[];Ot.label&&Wt.push(mxUtils.htmlEntities(Ot.label)),Ot.technology&&Wt.push("<i>["+mxUtils.htmlEntities(Ot.technology)+"]</i>");var Kt=Wt.length>0?'<div style="text-align:left;">'+Wt.join("<br>")+"</div>":"",Bt=Ce(Ft),ce=Ce(Pt),kt=Bt.x+Bt.w/2,wt=Bt.y+Bt.h/2,jt=ce.x+ce.w/2,Ht=ce.y+ce.h/2,qt=Ke(Bt,jt,Ht),re=Ke(ce,kt,wt),Ut=We(qt,Bt),ve=We(re,ce),we=zt===0,Se=Ot.styleOverrides&&Ot.styleOverrides.lineColor||"#444444",be=Ot.styleOverrides&&Ot.styleOverrides.textColor||"#444444",Me="endArrow=block;html=1;strokeColor="+Se+";strokeWidth=1;"+(we?"":"curved=1;")+"fontSize=12;fontColor="+be+";fontFamily=Open Sans,sans-serif;labelBackgroundColor=none;exitX="+Ut.x+";exitY="+Ut.y+";entryX="+ve.x+";entryY="+ve.y+";align=center;verticalAlign=middle;";(Ot.direction==="bi"||Ot.direction==="back")&&(Me+="startArrow=block;");var Fe=S.insertEdge(Y,null,Kt,Ft,Pt,Me);if(Kt){let Ae=function(Le){if(typeof mxUtils!="undefined"&&mxUtils.getSizeForString){var Re=mxUtils.getSizeForString(Le,Ue,De,null,0);if(Re.width>0||!/\S/.test(Le))return Re}return{width:Le.length*Ue*.56,height:Ue*1.5}};var Ue=12,De="Open Sans,sans-serif",Ye=Ot.label?Ae(Ot.label):{width:0,height:0},Pe=Ot.technology?Ae("["+Ot.technology+"]"):{width:0,height:0},de=Math.max(Ye.width,Pe.width),Ve=Ot.styleOverrides&&Ot.styleOverrides.offsetX?parseInt(Ot.styleOverrides.offsetX,10):0,Ne=Ot.styleOverrides&&Ot.styleOverrides.offsetY?parseInt(Ot.styleOverrides.offsetY,10):0;if(Fe.geometry!=null){var nr=we?0:(re.x-qt.x)/4;Fe.geometry.relative=!0,Fe.geometry.x=0,Fe.geometry.y=0,Fe.geometry.offset=new mxPoint(nr+Ve+de/2,Ne+(Ot.technology?(Ue+5)/2:0))}}if(Ot.from&&Ot.to&&h(S,Fe,"e:"+Ot.from+"->"+Ot.to+"#"+zt),!we){var Ge=qt.x+(re.x-qt.x)/4,Ie=qt.y+(re.y-qt.y)/2;Fe.geometry.points=[new mxPoint(Math.round(Ge),Math.round(Ie))]}}}function Ce(le){for(var Ae=le.geometry.x,Le=le.geometry.y,Re=le.parent;Re&&Re.geometry;)Ae+=Re.geometry.x,Le+=Re.geometry.y,Re=Re.parent;return{x:Ae,y:Le,w:le.geometry.width,h:le.geometry.height}}function Ke(le,Ae,Le){var Re=le.x,Be=le.y,je=le.w,ie=le.h,fr=Re+je/2,Ar=Be+ie/2,Lr=Math.abs(Re-Ae),Ze=Math.abs(Be-Le);if(Be===Le&&Re<Ae)return{x:Re+je,y:Ar};if(Be===Le&&Re>Ae)return{x:Re,y:Ar};if(Re===Ae&&Be<Le)return{x:fr,y:Be+ie};if(Re===Ae&&Be>Le)return{x:fr,y:Be};var dr=Ze/Lr,Xe=ie/je;return Re>Ae&&Be<Le?Xe>=dr?{x:Re,y:Ar+dr*je/2}:{x:fr-Lr/Ze*ie/2,y:Be+ie}:Re<Ae&&Be<Le?Xe>=dr?{x:Re+je,y:Ar+dr*je/2}:{x:fr+Lr/Ze*ie/2,y:Be+ie}:Re<Ae&&Be>Le?Xe>=dr?{x:Re+je,y:Ar-dr*je/2}:{x:fr+Lr/Ze*ie/2,y:Be}:Xe>=dr?{x:Re,y:Ar-dr*je/2}:{x:fr-Lr/Ze*ie/2,y:Be}}function We(le,Ae){var Le=(le.x-Ae.x)/Ae.w,Re=(le.y-Ae.y)/Ae.h;return Le=Math.max(0,Math.min(1,Le)),Re=Math.max(0,Math.min(1,Re)),{x:Le,y:Re}}return pt(S)}var bt="#087EBF";function Nt(e){var x='<rect width="80" height="80" style="fill: '+bt+'; stroke-width: 0px;"/>',C="";switch(e){case"server":C='<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>';break;case"database":C='<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>';break;case"disk":C='<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>';break;case"cloud":C='<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>';break;case"internet":C='<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>';break;case"blank":C="";break;default:C='<text x="21.16" y="64.67" fill="white" font-family="Arial,sans-serif" font-size="67.75">?</text>';break}return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80">'+x+C+"</svg>"}function Dt(e){if(!e)return null;if(e.kind==="stencil")return e.style+"html=1;";if(e.kind==="svg"){var x=typeof btoa=="function"?btoa(unescape(encodeURIComponent(e.svg))):mxUtils.toBase64(e.svg);return"shape=image;html=1;imageAspect=0;image=data:image/svg+xml,"+x+";"}return null}function st(e){return e?ki.resolve("aws:"+e)||ki.resolve(e)||ki.resolve("logos:"+e):null}function Lt(e,x,C,S,Y){var D=x.width||150,At=Math.max(16,Math.min(30,S-20,D-8)),U=x.x+(D-At)/2;r(e,null,null,"",U,C+3,At,At,Y),r(e,null,null,mxUtils.htmlEntities(x.label),x.x,C+At+3,D,Math.max(12,S-At-5),"text;html=1;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontSize=16;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;")}function ft(e){var x=Dt(ki.resolve(e));if(x)return x;var C=Nt(e),S=typeof btoa=="function"?btoa(unescape(encodeURIComponent(C))):mxUtils.toBase64(C);return"shape=image;html=1;imageAspect=0;image=data:image/svg+xml,"+S+";"}function Ct(e,x,C){for(var S=d(),Y=S.getDefaultParent(),D=S.getDefaultParent(),At=e.fontFamily,U=0;U<e.groups.length;U++){var q=e.groups[U],rt=r(S,D,null,"",q.x,q.y,q.width,q.height,"rounded=0;fillColor=none;strokeColor=#C0C0ED;dashed=1;dashPattern=8 8;strokeWidth=2;");q.id&&h(S,rt,"n:group:"+q.id);var ct=30,nt=q.x+1,zt=q.y+1,Ot=ft(q.icon,ct);r(S,D,null,"",nt,zt,ct,ct,Ot),r(S,D,null,mxUtils.htmlEntities(q.label),nt+ct+6,zt,200,ct,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}for(var Ft={},U=0;U<e.nodes.length;U++){var Pt=e.nodes[U];if(Pt.kind==="junction"){var Wt=r(S,D,null,"",Pt.x+e.iconSize/2-5,Pt.y+e.iconSize/2-5,10,10,"shape=waypoint;perimeter=centerPerimeter;fillColor=none;strokeColor=none;");Ft[Pt.id]=Wt;continue}var Kt=r(S,D,null,"",Pt.x,Pt.y,Pt.width,Pt.height,ft(Pt.icon,Pt.width));Pt.id&&h(S,Kt,"n:"+Pt.id),Ft[Pt.id]=Kt,Pt.label&&r(S,D,null,mxUtils.htmlEntities(Pt.label),Pt.x-20,Pt.y+Pt.height-2,Pt.width+40,e.labelHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=top;")}for(var U=0;U<e.archEdges.length;U++){var Bt=e.archEdges[U],ce=Ft[Bt.source],kt=Ft[Bt.target];if(!(!ce||!kt)){var wt=Xt(Bt.sourcePort),jt=Xt(Bt.targetPort),Ht="html=1;strokeColor=light-dark(#333333,#cccccc);strokeWidth=3;exitX="+wt.x+";exitY="+wt.y+";entryX="+jt.x+";entryY="+jt.y+";edgeStyle=orthogonalEdgeStyle;rounded=0;";Bt.arrowEnd?Ht+="endArrow=block;endFill=1;endSize=8;":Ht+="endArrow=none;",Bt.arrowStart&&(Ht+="startArrow=block;startFill=1;startSize=8;");var qt=S.insertEdge(D,null,"",ce,kt,Ht);Bt.source&&Bt.target&&h(S,qt,"e:"+Bt.source+"->"+Bt.target+"#"+U)}}return pt(S)}function Xt(e){switch(e){case"T":return{x:.5,y:0};case"B":return{x:.5,y:1};case"L":return{x:0,y:.5};case"R":return{x:1,y:.5};default:return{x:.5,y:.5}}}function St(e,x,C){for(var S=d(),Y=S.getDefaultParent(),D=S.getDefaultParent(),At=e.fontFamily,U=[],q=0;q<e.nodes.length;q++){var rt=e.nodes[q],ct=S.insertVertex(D,null,"",rt.x,rt.y,rt.width,rt.height,"rounded=0;fillColor="+rt.color+";strokeColor="+rt.color+";");U.push(ct),rt.id&&h(S,ct,"n:"+rt.id)}for(var nt=x&&x.sankey&&x.sankey.linkColor||"gradient",zt=S.getModel(),Ot={},q=0;q<e.sankeyLinks.length;q++){var Ft=e.sankeyLinks[q],Pt=U[Ft.sourceColorIdx],Wt=U[Ft.targetColorIdx],Kt=e.nodes[Ft.sourceColorIdx].color,Bt=e.nodes[Ft.targetColorIdx].color,ce;nt==="source"?ce="fillColor="+Kt+";":nt==="target"?ce="fillColor="+Bt+";":nt==="gradient"?ce="fillColor="+Kt+";gradientColor="+Bt+";gradientDirection=east;":ce="fillColor="+nt+";";var kt=Pt.geometry,wt=Wt.geometry,jt=kt.height>0?(Ft.y1-kt.y)/kt.height:.5,Ht=wt.height>0?(Ft.y2-wt.y)/wt.height:.5,qt=S.insertEdge(D,null,"",Pt,Wt,"shape=mermaidSankeyLink;width="+Ft.width.toFixed(2)+";"+ce+"opacity=50;strokeColor=none;html=1;exitX=1;exitY="+jt.toFixed(6)+";exitPerimeter=0;entryX=0;entryY="+Ht.toFixed(6)+";entryPerimeter=0;");zt.add(D,qt,q);var re=e.nodes[Ft.sourceColorIdx].id,Ut=e.nodes[Ft.targetColorIdx].id,ve=re+"->"+Ut,we=Ot[ve]||0;Ot[ve]=we+1,h(S,qt,"e:"+ve+"#"+we)}for(var Se=x&&x.sankey||{},be=Se.showValues!==!1,Me=typeof Se.prefix=="string"?Se.prefix:"",Fe=typeof Se.suffix=="string"?Se.suffix:"",Ue=Se.labelStyle==="outlined"?"outlined":"legacy",De=0,Ye=0,q=0;q<e.nodes.length;q++){var Pe=e.nodes[q].totalFlow||0;Pe>Ye&&(Ye=Pe,De=e.nodes[q].layer||0)}for(var q=0;q<e.nodes.length;q++){var rt=e.nodes[q],de;Ue==="outlined"?de=(rt.layer||0)<De:de=!(rt.x<e.canvasW/2);var Ve=rt.id;if(be){var Ne=Math.round(rt.totalFlow*100)/100;Ve=rt.id+`
+`+Me+Ne+Fe}var nr=rt.y+.5+rt.height/2,Ge=nr-(be?21:16);de?S.insertVertex(D,null,mxUtils.htmlEntities(Ve),rt.x-157.5,Ge,154,32,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=14;fontColor=light-dark(#333333,#cccccc);align=right;verticalAlign=middle;"):S.insertVertex(D,null,mxUtils.htmlEntities(Ve),rt.x+rt.width+4.5,Ge,154,32,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+At+";fontSize=14;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}return pt(S)}function Zt(e,x){var C=d(),S=C.getDefaultParent(),Y=C.getDefaultParent(),D=e.pieCx,At=e.pieCy,U=e.pieR,q=e.outerR;if(e.slices.length===1){var rt=e.slices[0],ct=r(C,Y,null,"",D-U,At-U,2*U,2*U,"ellipse;fillColor="+rt.color+";strokeColor=light-dark(#000000,#cccccc);strokeWidth=2;opacity=70;html=1;");h(C,ct,"n:slice:"+(rt.label||"idx0"))}else for(var nt=0;nt<e.slices.length;nt++){var rt=e.slices[nt],zt="shape=mxgraph.basic.pie;startAngle="+rt.startFrac.toFixed(4)+";endAngle="+rt.endFrac.toFixed(4)+";fillColor="+rt.color+";strokeColor=light-dark(#000000,#cccccc);strokeWidth=2;opacity=70;html=1;",Ot=r(C,Y,null,"",D-U,At-U,2*U,2*U,zt);h(C,Ot,"n:slice:"+(rt.label||"idx"+nt))}r(C,Y,null,"",D-q,At-q,2*q,2*q,"ellipse;fillColor=none;strokeColor=light-dark(#000000,#cccccc);strokeWidth=2;html=1;");for(var nt=0;nt<e.slices.length;nt++){var rt=e.slices[nt],Ft=40,Pt=20;r(C,Y,null,rt.percent+"%",D+rt.labelX-Ft/2,At+rt.labelY-Pt/2,Ft,Pt,"text;html=1;fontSize=17;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;")}if(e.title){var Wt=400,Kt=32;r(C,Y,null,mxUtils.htmlEntities(e.title),D-Wt/2,e.titleY-Kt/2,Wt,Kt,"text;html=1;fontSize=25;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontColor=light-dark(#000000,#cccccc);align=center;verticalAlign=middle;")}for(var Bt=216,ce=18,kt=18,wt=e.slices.length,nt=0;nt<wt;nt++){var rt=e.slices[nt],jt=22*nt-11*wt,Ht=D+Bt,qt=At+jt;r(C,Y,null,"",Ht,qt,ce,kt,"rounded=0;fillColor="+rt.color+";strokeColor="+rt.color+";html=1;");var re=rt.label;e.showData&&(re+=" ["+rt.value+"]");var Ut=Math.max(re.length*10+20,60);r(C,Y,null,mxUtils.htmlEntities(re),Ht+ce+4,qt,Ut,kt,"text;html=1;fontSize=17;fontFamily=Trebuchet MS,Verdana,Arial,sans-serif;fontColor=light-dark(#000000,#cccccc);align=left;verticalAlign=middle;")}return pt(C)}function G(e){if(e==null||e<=0)return null;var x=((e-1)%qr.length+qr.length)%qr.length;return qr[x]}function dt(e){if(e.depth===0)return{fill:"none",text:"#333333",stroke:"none",transparent:!1};if(!e.isLeaf){var x=G(e.sectionIdx);return x?{fill:x.fill,text:"#333333",stroke:x.fill,transparent:!1}:{fill:"none",text:"#333333",stroke:"none",transparent:!1}}for(var C=e.parent;C&&C.depth>0&&C.sectionIdx==null;)C=C.parent;if(C&&C.depth>0&&C.sectionIdx!=null){var x=G(C.sectionIdx);if(x)return{fill:x.fill,text:"#333333",stroke:x.fill,transparent:!1}}return{fill:"none",text:"#333333",stroke:"none",transparent:!0}}function oe(e,x){if(e==null)return"";if(!x)return e===Math.floor(e)?String(e):String(Math.round(e*100)/100);var C=x.indexOf("%")>=0,S="";x.charAt(0)==="$"&&(S=C?"":"$",x=x.substring(1));var Y=C?e*100:e,D=x.indexOf(",")>=0,At=x.match(/\.(\d+)/),U=At?parseInt(At[1],10):D?0:null,q;if(U!=null?q=Y.toFixed(U):Y===Math.floor(Y)?q=String(Y):q=String(Math.round(Y*100)/100),D){var rt=q.split(".");rt[0]=rt[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),q=rt.join(".")}return S+q+(C?"%":"")}function ae(e,x,C){var S=d(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=x&&x.treemap&&x.treemap.valueFormat||"",q=S.getDefaultParent(),rt=e.fontFamily,ct=e.headerH||25,nt=e.classDefs||{};function zt(le){if(!le.className||!nt[le.className])return null;for(var Ae=nt[le.className].replace(/,\s*(?=[a-z-])/gi,";"),Le={},Re=Ae.split(";"),Be=0;Be<Re.length;Be++){var je=Re[Be].split(":");if(!(je.length<2)){var ie=je[0].trim(),fr=je.slice(1).join(":").trim();!ie||!fr||(ie==="fill"?Le.fill=fr:ie==="stroke"?Le.stroke=fr:ie==="color"?Le.text=fr:ie==="stroke-width"&&(Le.strokeWidth=parseFloat(fr)))}}return Le}for(var Ot=["#ffffff","#333333","#333333","#ffffff","#333333","#333333","#333333","#333333","#333333","#333333","#333333","#333333"],Ft={},Pt=0,Wt=0;Wt<e.placed.length;Wt++){var Kt=e.placed[Wt];Kt.depth===0||Kt.isLeaf||Kt.label==null||Object.prototype.hasOwnProperty.call(Ft,Kt.label)||(Ft[Kt.label]=Pt++)}function Bt(le){return le==null?"#333333":(Object.prototype.hasOwnProperty.call(Ft,le)||(Ft[le]=Pt++),Ot[Ft[le]%Ot.length])}for(var ce=0;ce<e.placed.length;ce++){var kt=e.placed[ce];if(kt.depth!==0){var wt=kt.x0,jt=kt.y0,Ht=kt.x1-kt.x0,qt=kt.y1-kt.y0;if(!(Ht<=0||qt<=0)){var re=dt(kt);re.text=Bt(kt.label);var Ut=zt(kt);if(Ut&&(Ut.fill&&(re.fill=Ut.fill,re.transparent=!1),Ut.stroke&&(re.stroke=Ut.stroke),Ut.text&&(re.text=Ut.text)),kt.isLeaf){var be=re.transparent?"none":re.fill,Me=re.transparent?"none":Ut&&Ut.stroke?re.stroke:re.fill,Fe="rounded=0;whiteSpace=wrap;html=1;fillColor="+be+(re.transparent?";":";fillOpacity=30;")+"strokeColor="+Me+(re.transparent?";":";strokeWidth=3;"),Ue=r(S,q,null,"",wt,jt,Ht,qt,Fe);kt.label&&h(S,Ue,"n:leaf:"+kt.label);var De=kt.label||"",Ye=kt.rawValue!=null?oe(kt.rawValue,U):"",Pe=Math.max(De.length,Ye.length,2),de=Math.max(8,Math.min(38,Math.round(Ht/(Pe*.55)),Math.round(qt*.5)));if(de>=8){var Ve=Math.max(6,Math.min(28,Math.round(de*.6))),Ne=Math.ceil(de*1.3),nr=Math.ceil(Ve*1.3),Ge=jt+qt/2,Ie=Ge-Ne/2,Ce=Ge+de*.55;r(S,q,null,mxUtils.htmlEntities(De),wt,Ie,Ht,Ne,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize="+de+";fontColor="+re.text+";align=center;verticalAlign=middle;");var Ke=Ye.length*Ve*.6<=Ht-8,We=Ce+nr<=jt+qt-1;Ye&&Ke&&We&&r(S,q,null,Ye,wt,Ce,Ht,nr,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize="+Ve+";fontColor="+re.text+";align=center;verticalAlign=top;")}}else{var ve="rounded=0;whiteSpace=wrap;html=1;fillColor="+re.fill+";fillOpacity=60;strokeColor="+re.stroke+";strokeWidth=2;strokeOpacity=40;",we=r(S,q,null,"",wt,jt,Ht,qt,ve);kt.label&&h(S,we,"n:section:"+kt.label);var Se=r(S,q,null,mxUtils.htmlEntities(kt.label||""),wt+6,jt,Math.max(Ht-12,0),ct,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize=12;fontStyle=1;fontColor="+re.text+";align=left;verticalAlign=middle;");r(S,q,null,oe(kt.value,U),wt+6,jt,Math.max(Ht-16,0),ct,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize=10;fontStyle=2;fontColor="+re.text+";align=right;verticalAlign=middle;")}}}}return e.title&&r(S,q,null,mxUtils.htmlEntities(e.title),0,0,D,ct,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+rt+";fontSize=14;fontStyle=1;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;"),pt(S)}function fe(e){var x=e.flags,C,S,Y;return x.done&&x.crit?(C="#d3d3d3",S="#ff8888",Y="#000000"):x.active&&x.crit?(C="#bfc7ff",S="#ff8888",Y="#000000"):x.crit?(C="#ff0000",S="#ff8888",Y="#ffffff"):x.done?(C="#d3d3d3",S="#808080",Y="#000000"):x.active?(C="#bfc7ff",S="#534fbc",Y="#000000"):(C="#8a90dd",S="#534fbc",Y="#ffffff"),{fill:C,stroke:S,text:Y}}function ne(e,x,C){var S=d(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily;e.title&&r(S,U,null,mxUtils.htmlEntities(e.title),0,10,D,30,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=18;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");var rt=[{fill:"#6666FF",opacity:"10"},{fill:"#FFFFFF",opacity:"20"},{fill:"#FFF400",opacity:"20"},{fill:"#FFFFFF",opacity:"20"}],ct=D-37.5;if(e.excludes)for(var nt=0;nt<e.excludes.length;nt++){var zt=e.excludes[nt];r(S,U,null,"",zt.x,e.gridTop,zt.w,e.gridBottom-e.gridTop,"rounded=0;fillColor=light-dark(#eeeeee,#2a2a2a);strokeColor=none;")}for(var nt=0;nt<e.ticks.length;nt++){var Ot=e.ticks[nt];r(S,U,null,"",Ot.x-.5,e.gridTop,1,e.gridBottom-e.gridTop,"rounded=0;fillColor=light-dark(#B0B0B0,#555555);strokeColor=none;")}for(var nt=0;nt<e.sections.length;nt++)for(var Ft=e.sections[nt],Pt=typeof Ft.idx=="number"?Ft.idx:nt,Wt=rt[(Pt%4+4)%4],Kt=Ft.lastRow!=null&&Ft.firstRow!=null?Ft.lastRow-Ft.firstRow+1:Ft.tasks.length,Bt=0;Bt<Kt;Bt++){var ce=e.topMargin+(Ft.firstRow+Bt)*e.rowHeight;r(S,U,null,"",0,ce,ct,e.rowHeight,"rounded=0;fillColor="+Wt.fill+";fillOpacity="+Wt.opacity+";strokeColor=none;")}for(var nt=0;nt<e.ticks.length;nt++){var Ot=e.ticks[nt];r(S,U,null,Ot.label,Ot.x-45,e.gridBottom+4,90,14,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=10;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=top;")}for(var nt=0;nt<e.sections.length;nt++){var Ft=e.sections[nt];Ft.name&&r(S,U,null,mxUtils.htmlEntities(Ft.name),5,Ft.y,e.gridLeft-5,Ft.h,"text;html=1;strokeColor=none;fillColor=none;overflow=visible;fontFamily="+q+";fontSize=11;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}for(var kt=[],nt=0;nt<e.tasks.length;nt++){var wt=e.tasks[nt],jt=fe(wt);if(wt.flags.vert){kt.push(wt);continue}if(wt.flags.milestone){var Ht=wt.barX,qt=wt.barX+wt.barW,re=Ht+(qt-Ht)/2,Ut=wt.barY+e.taskHeight/2,ve=22.6,we=r(S,U,null,"",re-ve/2,Ut-ve/2,ve,ve,"shape=rhombus;html=1;fillColor="+jt.fill+";strokeColor="+jt.stroke+";strokeWidth=2;");h(S,we,"n:task:"+(wt.id||"idx"+nt));var Se=11,be=wt.labelW!=null&&wt.labelW>0?wt.labelW:Math.max(wt.label.length*Se*.55,20),Me=5,Fe=5,Ue,De,Ye;qt+Me+be+Fe>D?(Ye=Math.max(be+10,60),Ue=Ht-Me-Ye,De="right"):(Ye=Math.max(be+10,120),Ue=qt+Me,De="left"),r(S,U,null,mxUtils.htmlEntities(wt.label),Ue,Ut-8,Ye,16,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+Se+";fontColor=light-dark(#333333,#cccccc);fontStyle=2;align="+De+";verticalAlign=middle;")}else{var Pe="rounded=1;absoluteArcSize=1;arcSize=3;html=1;fillColor="+jt.fill+";strokeColor="+jt.stroke+";strokeWidth=2;",de=r(S,U,null,"",wt.barX,wt.barY,wt.barW,e.taskHeight,Pe);if(h(S,de,"n:task:"+(wt.id||"idx"+nt)),wt.labelOutsideLeft){var Ve=(wt.labelW||0)+12,Ne=wt.barX-5-Ve;r(S,U,null,mxUtils.htmlEntities(wt.label),Ne,wt.barY,Ve,e.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=11;fontColor=light-dark(#333333,#cccccc);align=right;verticalAlign=middle;")}else if(wt.labelOutsideRight){var nr=(wt.labelW||0)+12,Ge=wt.barX+wt.barW+5;r(S,U,null,mxUtils.htmlEntities(wt.label),Ge,wt.barY,nr,e.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=11;fontColor=light-dark(#333333,#cccccc);align=left;verticalAlign=middle;")}else if(wt.labelOverflowCenter){var Ie=wt.labelW||0,Ce=wt.barX+wt.barW+5-Ie,Ke=Ie*2;r(S,U,null,mxUtils.htmlEntities(wt.label),Ce,wt.barY,Ke,e.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=11;fontColor="+jt.text+";align=center;verticalAlign=middle;")}else r(S,U,null,mxUtils.htmlEntities(wt.label),wt.barX,wt.barY,wt.barW,e.taskHeight,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=11;fontColor="+jt.text+";align=center;verticalAlign=middle;")}}for(var We=typeof e.nonVertTaskCount=="number"?e.nonVertTaskCount:e.tasks.length,le=0;le<kt.length;le++){var Ae=kt[le],Le=Ae.barX,Re=We*e.rowHeight+e.taskHeight*2,Be=Ae.barW&&Ae.barW>0?Ae.barW:1.6,je="light-dark(#000080,#00BFFF)",ie=r(S,U,null,"",Le,e.gridTop,Be,Re,"rounded=1;absoluteArcSize=1;arcSize=3;html=1;fillColor="+je+";strokeColor="+je+";strokeWidth=1;");h(S,ie,"n:task:"+(Ae.id||"vert"+le));var fr=160,Ar=e.gridTop+We*e.rowHeight+60;r(S,U,null,mxUtils.htmlEntities(Ae.label),Le-fr/2,Ar-10,fr,20,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=15;fontColor="+je+";align=center;verticalAlign=middle;")}return pt(S)}function ye(e,x,C){var S=d(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily;e.title&&r(S,U,null,mxUtils.htmlEntities(e.title),0,0,D,48,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=32;fontStyle=0;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");for(var rt=0;rt<e.circles.length;rt++){var ct=e.circles[rt],nt=2*ct.r,zt=ct.stroke||ct.fill,Ot=r(S,U,null,"",ct.cx-ct.r,ct.cy-ct.r,nt,nt,"ellipse;whiteSpace=wrap;html=1;fillColor="+ct.fill+";fillOpacity=10;strokeColor="+zt+";strokeWidth=2.5;strokeOpacity=95;");h(S,Ot,"n:set:"+(ct.label||"idx"+rt))}for(var rt=0;rt<e.circles.length;rt++){var ct=e.circles[rt];if(ct.label){var Ft=180,Pt=22,Wt=ct.text||ct.fill;r(S,U,null,mxUtils.htmlEntities(ct.label),ct.labelAnchor.x-Ft/2,ct.labelAnchor.y-Pt/2,Ft,Pt,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=24;fontStyle=0;fontColor="+Wt+";align=center;verticalAlign=middle;")}}for(var Kt=e.regionLabels||[],rt=0;rt<Kt.length;rt++){var Bt=Kt[rt];if(Bt.text){var ce=24,Ft=180,Pt=22,kt=Bt.fontColor||"#333333";r(S,U,null,mxUtils.htmlEntities(Bt.text),Bt.x-Ft/2,Bt.y-Pt/2,Ft,Pt,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+ce+";fontColor="+kt+";align=center;verticalAlign=middle;")}}for(var wt=e.textNodes||[],rt=0;rt<wt.length;rt++){var jt=wt[rt];if(jt.text){var Ht=20,qt=jt.fontColor||"#333333",re=jt.boxW||160,Ut=jt.boxH||20;r(S,U,null,mxUtils.htmlEntities(jt.text),jt.x-re/2,jt.y-Ut/2,re,Ut,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+Ht+";fontColor="+qt+";align=center;verticalAlign=middle;whiteSpace=wrap;")}}return pt(S)}function Mt(e,x){var C=(e||"").split(/\s+/).filter(function(U){return U});if(C.length===0)return[""];for(var S=[],Y=C[0],D=1;D<C.length;D++){var At=C[D];Y.length+1+At.length<=x?Y+=" "+At:(S.push(Y),Y=At)}return S.push(Y),S}function $t(e,x,C){var S=d(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily;e.title&&r(S,U,null,mxUtils.htmlEntities(e.title),0,8,D,26,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=18;fontStyle=1;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");var rt=e.spineY,ct=3;r(S,U,null,"",e.spineX0,rt-ct/2,e.spineX1-e.spineX0,ct,"rounded=0;fillColor=light-dark(#333333,#cccccc);strokeColor=none;");var nt=e.effectCx,zt=e.effectCy,Ot=e.effectW,Ft=e.effectH,Pt=(e.effect||"").split(/\s+/).filter(function(Ge){return Ge}),Wt=Pt.map(function(Ge){return mxUtils.htmlEntities(Ge)}).join("<br>"),Kt=r(S,U,null,Wt,nt-Ot/2,zt-Ft/2,Ot,Ft,"shape=ishikawaHead;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=light-dark(#333333,#cccccc);strokeWidth=2;fontFamily="+q+";fontSize=14;fontStyle=1;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");h(S,Kt,"n:effect");for(var Bt=0;Bt<e.categories.length;Bt++){var ce=e.categories[Bt],kt=S.insertEdge(U,null,"",null,null,"endArrow=none;startArrow=block;startFill=1;startSize=8;html=1;rounded=0;strokeColor=light-dark(#333333,#cccccc);strokeWidth=2;");kt.geometry.setTerminalPoint(new mxPoint(ce.spineX,ce.spineY),!0),kt.geometry.setTerminalPoint(new mxPoint(ce.boneEndX,ce.boneEndY),!1);var wt=typeof mxUtils!="undefined"&&mxUtils.getSizeForString?mxUtils.getSizeForString(ce.name,16,q,null,0):{width:ce.name.length*9,height:19},jt=Math.max(60,wt.width+40),Ht=Math.max(25,wt.height+4),qt=ce.boneEndX,re=ce.boneEndY+ce.dirY*(Ht/2+2),Ut=r(S,U,null,mxUtils.htmlEntities(ce.name),qt-jt/2,re-Ht/2,jt,Ht,"rounded=0;whiteSpace=wrap;html=1;fillColor=light-dark(#ECECFF,#1f2020);strokeColor=light-dark(#333333,#cccccc);strokeWidth=2;fontFamily="+q+";fontSize=16;fontStyle=0;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");h(S,Ut,"n:category:"+(ce.name||"idx"+Bt));for(var ve=0;ve<ce.subs.length;ve++){for(var we=ce.subs[ve],Se=16,be=Mt(we.text,15),Me="",Fe=0;Fe<be.length;Fe++)be[Fe].length>Me.length&&(Me=be[Fe]);var Ue=Math.max(60,Math.ceil(Me.length*Se/2)+8),De=be.length*(Se+2),Ye=be.map(function(Ge){return mxUtils.htmlEntities(Ge)}).join("<br>"),Pe=we.bx0!=null?we.bx0:we.x,de=we.by0!=null?we.by0:we.y,Ve=we.bx1!=null?we.bx1:we.stubEndX!=null?we.stubEndX:we.x-30,Ne=we.by1!=null?we.by1:we.y,nr=S.insertEdge(U,null,"",null,null,"endArrow=block;endFill=1;endSize=6;startArrow=none;html=1;rounded=0;strokeColor=light-dark(#333333,#cccccc);strokeWidth=1;");nr.geometry.setTerminalPoint(new mxPoint(Ve,Ne),!0),nr.geometry.setTerminalPoint(new mxPoint(Pe,de),!1),r(S,U,null,Ye,Ve-Ue,Ne-De/2,Ue,De,"text;html=1;strokeColor=none;fillColor=none;whiteSpace=wrap;fontFamily="+q+";fontSize=16;fontColor=light-dark(#333333,#cccccc);align=right;verticalAlign=middle;")}}return pt(S)}function Jt(e,x,C){var S=d(),Y=S.getDefaultParent(),D=e.canvasW,At=e.canvasH,U=S.getDefaultParent(),q=e.fontFamily,rt=e.labelFontSize,ct=e.labelColor,nt=e.lineColor,zt=e.lineThickness,Ot=e.paddingX;e.title&&r(S,U,null,mxUtils.htmlEntities(e.title),0,6,D,26,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize=18;fontStyle=1;fontColor=light-dark(#333333,#cccccc);align=center;verticalAlign=middle;");for(var Ft=0;Ft<e.lines.length;Ft++){var Pt=e.lines[Ft],Wt=S.insertEdge(U,null,"",null,null,"endArrow=none;html=1;rounded=0;strokeColor="+nt+";strokeWidth="+zt+";");Wt.geometry.setTerminalPoint(new mxPoint(Pt.x1,Pt.y1),!0),Wt.geometry.setTerminalPoint(new mxPoint(Pt.x2,Pt.y2),!1)}for(var Kt=0;Kt<e.rows.length;Kt++){var Bt=e.rows[Kt],ce=r(S,U,null,mxUtils.htmlEntities(Bt.label||""),Bt.x,Bt.y,Bt.width,Bt.height,"text;html=1;strokeColor=none;fillColor=none;fontFamily="+q+";fontSize="+rt+";fontColor="+ct+";align=left;verticalAlign=middle;spacingLeft="+Ot+";");h(S,ce,"n:node:"+(Bt.id||"idx"+Kt))}return pt(S)}return{createFromElkGraph:W,createSequenceDiagram:Rt,createZenumlDiagram:xe,createGitGraph:Jr,createJourneyDiagram:sa,createPieDiagram:Zt,createPacketDiagram:yr,createQuadrantDiagram:rr,createWardleyDiagram:Pr,createEventModelingDiagram:ta,createTimelineDiagram:Ja,createKanbanDiagram:nn,createXychartDiagram:Ln,createRadarDiagram:Z,createC4Diagram:ht,createArchitectureDiagram:Ct,createSankeyDiagram:St,createTreemapDiagram:ae,createGanttDiagram:ne,createVennDiagram:ye,createIshikawaDiagram:$t,createTreeviewDiagram:Jt,applyTheme:s,createMxGraph:d,addNode:l,addEdge:lt,formatLabel:u,insertVertex:r,getEdgeStyle:z,getEdgeHead:O,parseCssToDrawioStyle:I,deduplicateStyle:F,twoDec:xt}})();function Qi(L){return L==="__proto__"||L==="constructor"||L==="prototype"}function e2(L,j){if(L==null&&j==null)return{};if(L==null)return j;if(j==null)return L;var P={},E;for(E in L)Qi(E)||(P[E]=L[E]);for(E in j)Qi(E)||(P[E]=j[E]);if(L.themeVariables!=null||j.themeVariables!=null){var w={};if(L.themeVariables)for(E in L.themeVariables)Qi(E)||(w[E]=L.themeVariables[E]);if(j.themeVariables)for(E in j.themeVariables)Qi(E)||(w[E]=j.themeVariables[E]);P.themeVariables=w}return P}var Ya=function(L,j,P){if(j=="requirement"){Ya.reqData=L;return}if(Ya.listeners.length==0)return;function E(l,O){try{if(l instanceof Map&&Object.fromEntries&&(l=Object.fromEntries(l)),!O)for(var z in l)l[z]=E(l[z],!0)}catch(lt){}return l}L=E(L),P=E(P);var w=[["#000000","#b4b4b4"],["#ffffff","#555555"],["#000000","#bbbbbb"],["#ffffff","#777777"],["#000000","#999999"],["#000000","#dddddd"],["#000000","#ffffff"],["#000000","#dddddd"]],p={fillColor:"light-dark(#eeeeee,#1f2020)",strokeColor:"light-dark(#999999,#cccccc)",fontColor:"light-dark(#333333,#cccccc)"},s=j=="statediagram"||j=="stateDiagram",o=EditorUi.prototype.emptyDiagramXml;try{o=_(L)}catch(l){console.log("mermaidToDrawio",l)}for(var d=0;d<Ya.listeners.length;d++)Ya.listeners[d](o),clearTimeout(Ya.timeouts[d]);Ya.htmlLabels=!1,urlParams.mermaidToDrawioTest!="1"&&Ya.resetListeners();return;function M(){var l=new Graph;return l.setExtendParents(!1),l.setExtendParentsOnAdd(!1),l.setConstrainChildren(!1),l.setHtmlLabels(!0),l.getModel().maintainEdgeParent=!1,l}function f(l,O){if(l==null)return"";if(Array.isArray(l)){for(var z=[],lt=0;lt<l.length;lt++)z.push(f(l[lt]));return z.join(`
`)}typeof l=="object"&&(l=(l.visibility||"")+l.id+(l.parameters!=null?"("+l.parameters+")":"")+(l.returnType?" : "+l.returnType:"")),l=(l?l.replace(/\\n/g,`
`).replace(/<br\s*\/?>/gi,`
-`):"")+(O?"<"+O+">":"");var W;return l&&(W=l.match(/~/g))&&W.length>1&&(l=l.replace(/~([^~]+)~/g,"<$1>")),l}function u(l,O,z,lt,W,pt,mt,Tt,Rt,It){return l.insertVertex(O,z,lt,Math.round(W),Math.round(pt),Math.round(mt),Math.round(Tt),Rt,It)}function r(l,O,z,lt){return u(lt,z,null,f(O.labelText),O.x,O.y,O.width,O.height,l)}function h(l){if(!l)return"";for(var O=Array.isArray(l)?l.join(";"):l,z=[],lt=O.split(";"),W=0;W<lt.length;W++){var pt=lt[W].split(":");if(!(pt.length<2)){var mt=pt[0].trim(),Tt=pt.slice(1).join(":").trim();if(!(!mt||!Tt))switch(mt){case"fill":case"background-color":case"background":z.push("fillColor="+Tt);break;case"stroke":z.push("strokeColor="+Tt);break;case"stroke-width":z.push("strokeWidth="+parseFloat(Tt));break;case"color":z.push("fontColor="+Tt);break;case"stroke-dasharray":z.push("dashed=1");var Rt=Tt.trim().split(/[\s,]+/);Rt.length>=2&&z.push("dashPattern="+Rt.join(" "));break}}}return z.length>0?z.join(";")+";":""}function d(l){for(var O=l.split(";"),z=null,lt={},W=[],pt=0;pt<O.length;pt++){var mt=O[pt].trim();if(mt){var Tt=mt.indexOf("=");if(Tt>0){var Rt=mt.substring(0,Tt);lt.hasOwnProperty(Rt)||W.push(Rt),lt[Rt]=mt.substring(Tt+1)}else z=mt}}for(var It=z!=null?[z]:[],pt=0;pt<W.length;pt++)It.push(W[pt]+"="+lt[W[pt]]);return It.join(";")+";"}function n(l){l.x-=l.width/2,l.y-=l.height/2}function y(l){var O=l.height;l.height=l.width,l.width=O;var z=(O-l.height)/2;l.x=l.x-z,l.y=l.y+z}function b(l,O,z,lt){var W;switch(lt||n(l),l.clusterNode&&(l.shape=l.clusterData.shape,l.labelText=l.clusterData.labelText||l.clusterData.label,l.type=l.clusterData.type,l.cssStyles=l.cssStyles||l.clusterData.cssStyles),l.shape){case"class_box":case"classBox":for(var pt=l.members||l.classData.members,mt=l.methods||l.classData.methods,Tt=l.annotations||l.classData.annotations||[],Rt="",It=0;It<Tt.length;It++)Rt+="<<"+f(Tt[It])+`>>
-`;var me=1+Tt.length/2+Math.max(pt.length,.5)+Math.max(mt.length,.5),Ee=(l.height-8)/me;W=u(z,O,null,Rt+f(l.labelText,l.type),l.x,l.y,l.width,l.height,"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize="+Ee*(1+Tt.length/2)+";horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;");for(var xe=Ee+(pt.length==0?Ee/2:0),It=0;It<pt.length;It++)u(z,W,null,f(pt[It]),0,xe,l.width,Ee,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),xe+=Ee;u(z,W,null,null,0,xe,l.width,mt.length==0?Ee/2:8,"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;"),xe+=8;for(var It=0;It<mt.length;It++)u(z,W,null,f(mt[It]),0,xe,l.width,Ee,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),xe+=Ee;break;case"note":W=r("align=left;spacingLeft=4;",l,O,z);break;case"squareRect":if(l.cssStyles&&l.cssStyles.indexOf("opacity: 0;")>=0){W=r("fillColor=none;strokeColor=none;",l,O,z),W.overrideArrowHead="circle";break}case"rect":case"square":case"round":case"rounded":case"group":case"event":case"process":case"rectangle":case"proc":W=r((l.shape=="rounded"||l.type=="round"||s?"rounded=1;absoluteArcSize=1;arcSize="+(l.mindmap?"7;":"14;"):"")+"whiteSpace=wrap;strokeWidth=2;"+(l.type=="group"?"verticalAlign=top;":""),l,O,z);break;case"question":case"choice":case"diamond":case"diam":case"decision":l.shape=="choice"&&(l.labelText=""),W=r("rhombus;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"stadium":case"pill":case"terminal":W=r("rounded=1;whiteSpace=wrap;arcSize=50;strokeWidth=2;",l,O,z);break;case"subroutine":case"subproc":case"fr-rect":case"framed-rectangle":case"subprocess":W=r("strokeWidth=2;shape=process;whiteSpace=wrap;size=0.04;",l,O,z);break;case"cylinder":case"cyl":case"database":case"db":W=r("shape=cylinder3;boundedLbl=1;backgroundOutline=1;size=10;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"circle":case"circ":W=r("ellipse;aspect=fixed;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"odd":case"odd_right":case"rect_left_inv_arrow":W=r("shape=mxgraph.arrows2.arrow;dy=0;dx=0;notch=20;strokeWidth=2;whiteSpace=wrap;spacingLeft=10",l,O,z);break;case"trapezoid":case"trap-b":case"priority":case"trapezoid-bottom":W=r("shape=trapezoid;perimeter=trapezoidPerimeter;fixedSize=1;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"inv_trapezoid":case"manual":case"trap-t":case"trapezoid-top":W=r("shape=trapezoid;perimeter=trapezoidPerimeter;fixedSize=1;strokeWidth=2;whiteSpace=wrap;flipV=1;",l,O,z);break;case"lean_right":case"lean-right":case"lean-r":case"in-out":W=r("shape=parallelogram;perimeter=parallelogramPerimeter;fixedSize=1;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"lean_left":case"lean-left":case"lean-l":case"out-in":W=r("shape=parallelogram;perimeter=parallelogramPerimeter;fixedSize=1;strokeWidth=2;whiteSpace=wrap;flipH=1;",l,O,z);break;case"doublecircle":case"double-circle":case"dbl-circ":case"framed-circle":case"fr-circ":case"stop":(l.shape=="framed-circle"||l.shape=="fr-circ"||l.shape=="stop")&&(l.labelText=""),W=r("ellipse;shape=doubleEllipse;aspect=fixed;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"hexagon":case"hex":case"prepare":W=r("shape=hexagon;perimeter=hexagonPerimeter2;fixedSize=1;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"start":case"stateStart":case"f-circ":case"filled-circle":case"junction":l.labelText="",W=r("ellipse;fillColor=strokeColor;",l,O,z);break;case"end":case"stateEnd":l.labelText="",W=r("ellipse;shape=endState;fillColor=strokeColor;",l,O,z);break;case"roundedWithTitle":W=r("swimlane;fontStyle=1;align=center;verticalAlign=middle;startSize=25;container=0;collapsible=0;rounded=1;arcSize=14;dropTarget=0;",l,O,z);break;case"fork":case"join":l.rx||y(l),l.labelText="",W=r("shape=line;strokeWidth="+(l.height-5)+";",l,O,z);break;case"divider":l.labelText="",W=r("fillColor=#F7F7F7;dashed=1;dashPattern=12 12;",l,O,z);break;case"lifeline":var Mr="participant=";switch(l.type){case"actor":Mr+="umlActor;";break;case"boundary":Mr+="umlBoundary;";break;case"control":Mr+="umlControl;";break;case"entity":Mr+="umlEntity;";break;case"database":Mr+="cylinder3;";break;default:Mr=""}switch(l.type){case"actor":case"boundary":case"control":case"entity":case"database":Mr+="verticalAlign=bottom;labelPosition=center;verticalLabelPosition=top;align=center;";break}switch(l.type){case"boundary":case"control":case"entity":case"database":break;default:Mr+="size="+l.size+";"}l.labelText=l.description,W=r('shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","elbow":"vertical","curved":0,"rounded":0};'+Mr,l,O,z);break;case"activation":W=r('points=[];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","elbow":"vertical","curved":0,"rounded":0}',l,O,z);break;case"seqNote":l.labelText=l.message,W=r("fillColor=#ffff88;strokeColor=#9E916F;",l,O,z);break;case"loop":l.labelText=l.type||"";var te=l.type?l.type.length*10:0;W=r("shape=umlFrame;dashed=1;pointerEvents=0;dropTarget=0;strokeColor=#B3B3B3;height=20;width="+te,l,O,z),u(z,W,null,f(l.title),te,0,l.width-te,20,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;");for(var It=0;l.sections!=null&&It<l.sections.length;It++){var Qt=l.sections[It],pe=l.sectionTitles[It];u(z,W,null,f(pe.message),0,Qt.y-l.y,l.width,Qt.height,"shape=line;dashed=1;whiteSpace=wrap;verticalAlign=top;labelPosition=center;verticalLabelPosition=middle;align=center;strokeColor=#B3B3B3;")}break;case"erdEntity":for(var ue=l.entityData.attributes,me=ue.length,Ee=(l.height-25)/me,xe=Ee,ar=0,xr=0,sr=0,Qe=0,or=0,It=0;It<ue.length;It++)ue[It].attributeType=ue[It].attributeType||ue[It].type,ue[It].attributeName=ue[It].attributeName||ue[It].name,ue[It].attributeKeyTypeList=ue[It].attributeKeyTypeList||ue[It].keys,ue[It].attributeComment=ue[It].attributeComment||ue[It].comment,ar=Math.max(ar,ue[It].attributeType.length*6),xr=Math.max(xr,ue[It].attributeName.length*6),sr=Math.max(sr,ue[It].attributeKeyType?ue[It].attributeKeyType.length*10:0),Qe=Math.max(Qe,ue[It].attributeKeyTypeList?ue[It].attributeKeyTypeList.length*22:0),or=Math.max(or,ue[It].attributeComment?ue[It].attributeComment.length*6:0);W=u(z,O,null,f(l.entityData.alias?l.entityData.alias:l.labelText),l.x,l.y,Math.max(xr+ar+sr+Qe+or,l.width),l.height,"shape=table;startSize="+(ue.length==0?l.height:25)+";container=1;collapsible=0;childLayout=tableLayout;fixedRows=1;rowLines=1;fontStyle=1;align=center;resizeLast=1;");for(var It=0;It<ue.length;It++){var Wr=u(z,W,null,null,0,xe,l.width,Ee,"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;"),oa="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=2;overflow=hidden;fontSize=11;";u(z,Wr,null,f(ue[It].attributeType),0,0,ar,Ee,oa),u(z,Wr,null,f(ue[It].attributeName),0,0,Math.max(xr,l.width-ar-sr-Qe-or),Ee,oa),sr>0&&u(z,Wr,null,f(ue[It].attributeKeyType),0,0,sr,Ee,oa),Qe>0&&u(z,Wr,null,ue[It].attributeKeyTypeList?f(ue[It].attributeKeyTypeList.join(", ")):"",0,0,Qe,Ee,oa),or>0&&u(z,Wr,null,f(ue[It].attributeComment),0,0,or,Ee,oa),xe+=Ee}break;case"element":case"requirement":var Sr=l.shape=="element";Rt="<<"+(Sr?"Element":l.data.type)+`>>
+`):"")+(O?"<"+O+">":"");var W;return l&&(W=l.match(/~/g))&&W.length>1&&(l=l.replace(/~([^~]+)~/g,"<$1>")),l}function u(l,O,z,lt,W,gt,mt,Tt,Rt,It){return l.insertVertex(O,z,lt,Math.round(W),Math.round(gt),Math.round(mt),Math.round(Tt),Rt,It)}function r(l,O,z,lt){return u(lt,z,null,f(O.labelText),O.x,O.y,O.width,O.height,l)}function h(l){if(!l)return"";for(var O=Array.isArray(l)?l.join(";"):l,z=[],lt=O.split(";"),W=0;W<lt.length;W++){var gt=lt[W].split(":");if(!(gt.length<2)){var mt=gt[0].trim(),Tt=gt.slice(1).join(":").trim();if(!(!mt||!Tt))switch(mt){case"fill":case"background-color":case"background":z.push("fillColor="+Tt);break;case"stroke":z.push("strokeColor="+Tt);break;case"stroke-width":z.push("strokeWidth="+parseFloat(Tt));break;case"color":z.push("fontColor="+Tt);break;case"stroke-dasharray":z.push("dashed=1");var Rt=Tt.trim().split(/[\s,]+/);Rt.length>=2&&z.push("dashPattern="+Rt.join(" "));break}}}return z.length>0?z.join(";")+";":""}function v(l){for(var O=l.split(";"),z=null,lt={},W=[],gt=0;gt<O.length;gt++){var mt=O[gt].trim();if(mt){var Tt=mt.indexOf("=");if(Tt>0){var Rt=mt.substring(0,Tt);lt.hasOwnProperty(Rt)||W.push(Rt),lt[Rt]=mt.substring(Tt+1)}else z=mt}}for(var It=z!=null?[z]:[],gt=0;gt<W.length;gt++)It.push(W[gt]+"="+lt[W[gt]]);return It.join(";")+";"}function n(l){l.x-=l.width/2,l.y-=l.height/2}function y(l){var O=l.height;l.height=l.width,l.width=O;var z=(O-l.height)/2;l.x=l.x-z,l.y=l.y+z}function b(l,O,z,lt){var W;switch(lt||n(l),l.clusterNode&&(l.shape=l.clusterData.shape,l.labelText=l.clusterData.labelText||l.clusterData.label,l.type=l.clusterData.type,l.cssStyles=l.cssStyles||l.clusterData.cssStyles),l.shape){case"class_box":case"classBox":for(var gt=l.members||l.classData.members,mt=l.methods||l.classData.methods,Tt=l.annotations||l.classData.annotations||[],Rt="",It=0;It<Tt.length;It++)Rt+="<<"+f(Tt[It])+`>>
+`;var me=1+Tt.length/2+Math.max(gt.length,.5)+Math.max(mt.length,.5),Ee=(l.height-8)/me;W=u(z,O,null,Rt+f(l.labelText,l.type),l.x,l.y,l.width,l.height,"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize="+Ee*(1+Tt.length/2)+";horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;");for(var xe=Ee+(gt.length==0?Ee/2:0),It=0;It<gt.length;It++)u(z,W,null,f(gt[It]),0,xe,l.width,Ee,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),xe+=Ee;u(z,W,null,null,0,xe,l.width,mt.length==0?Ee/2:8,"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;"),xe+=8;for(var It=0;It<mt.length;It++)u(z,W,null,f(mt[It]),0,xe,l.width,Ee,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),xe+=Ee;break;case"note":W=r("align=left;spacingLeft=4;",l,O,z);break;case"squareRect":if(l.cssStyles&&l.cssStyles.indexOf("opacity: 0;")>=0){W=r("fillColor=none;strokeColor=none;",l,O,z),W.overrideArrowHead="circle";break}case"rect":case"square":case"round":case"rounded":case"group":case"event":case"process":case"rectangle":case"proc":W=r((l.shape=="rounded"||l.type=="round"||s?"rounded=1;absoluteArcSize=1;arcSize="+(l.mindmap?"7;":"14;"):"")+"whiteSpace=wrap;strokeWidth=2;"+(l.type=="group"?"verticalAlign=top;":""),l,O,z);break;case"question":case"choice":case"diamond":case"diam":case"decision":l.shape=="choice"&&(l.labelText=""),W=r("rhombus;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"stadium":case"pill":case"terminal":W=r("rounded=1;whiteSpace=wrap;arcSize=50;strokeWidth=2;",l,O,z);break;case"subroutine":case"subproc":case"fr-rect":case"framed-rectangle":case"subprocess":W=r("strokeWidth=2;shape=process;whiteSpace=wrap;size=0.04;",l,O,z);break;case"cylinder":case"cyl":case"database":case"db":W=r("shape=cylinder3;boundedLbl=1;backgroundOutline=1;size=10;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"circle":case"circ":W=r("ellipse;aspect=fixed;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"odd":case"odd_right":case"rect_left_inv_arrow":W=r("shape=mxgraph.arrows2.arrow;dy=0;dx=0;notch=20;strokeWidth=2;whiteSpace=wrap;spacingLeft=10",l,O,z);break;case"trapezoid":case"trap-b":case"priority":case"trapezoid-bottom":W=r("shape=trapezoid;perimeter=trapezoidPerimeter;fixedSize=1;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"inv_trapezoid":case"manual":case"trap-t":case"trapezoid-top":W=r("shape=trapezoid;perimeter=trapezoidPerimeter;fixedSize=1;strokeWidth=2;whiteSpace=wrap;flipV=1;",l,O,z);break;case"lean_right":case"lean-right":case"lean-r":case"in-out":W=r("shape=parallelogram;perimeter=parallelogramPerimeter;fixedSize=1;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"lean_left":case"lean-left":case"lean-l":case"out-in":W=r("shape=parallelogram;perimeter=parallelogramPerimeter;fixedSize=1;strokeWidth=2;whiteSpace=wrap;flipH=1;",l,O,z);break;case"doublecircle":case"double-circle":case"dbl-circ":case"framed-circle":case"fr-circ":case"stop":(l.shape=="framed-circle"||l.shape=="fr-circ"||l.shape=="stop")&&(l.labelText=""),W=r("ellipse;shape=doubleEllipse;aspect=fixed;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"hexagon":case"hex":case"prepare":W=r("shape=hexagon;perimeter=hexagonPerimeter2;fixedSize=1;strokeWidth=2;whiteSpace=wrap;",l,O,z);break;case"start":case"stateStart":case"f-circ":case"filled-circle":case"junction":l.labelText="",W=r("ellipse;fillColor=strokeColor;",l,O,z);break;case"end":case"stateEnd":l.labelText="",W=r("ellipse;shape=endState;fillColor=strokeColor;",l,O,z);break;case"roundedWithTitle":W=r("swimlane;fontStyle=1;align=center;verticalAlign=middle;startSize=25;container=0;collapsible=0;rounded=1;arcSize=14;dropTarget=0;",l,O,z);break;case"fork":case"join":l.rx||y(l),l.labelText="",W=r("shape=line;strokeWidth="+(l.height-5)+";",l,O,z);break;case"divider":l.labelText="",W=r("fillColor=#F7F7F7;dashed=1;dashPattern=12 12;",l,O,z);break;case"lifeline":var Mr="participant=";switch(l.type){case"actor":Mr+="umlActor;";break;case"boundary":Mr+="umlBoundary;";break;case"control":Mr+="umlControl;";break;case"entity":Mr+="umlEntity;";break;case"database":Mr+="cylinder3;";break;default:Mr=""}switch(l.type){case"actor":case"boundary":case"control":case"entity":case"database":Mr+="verticalAlign=bottom;labelPosition=center;verticalLabelPosition=top;align=center;";break}switch(l.type){case"boundary":case"control":case"entity":case"database":break;default:Mr+="size="+l.size+";"}l.labelText=l.description,W=r('shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","elbow":"vertical","curved":0,"rounded":0};'+Mr,l,O,z);break;case"activation":W=r('points=[];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","elbow":"vertical","curved":0,"rounded":0}',l,O,z);break;case"seqNote":l.labelText=l.message,W=r("fillColor=#ffff88;strokeColor=#9E916F;",l,O,z);break;case"loop":l.labelText=l.type||"";var te=l.type?l.type.length*10:0;W=r("shape=umlFrame;dashed=1;pointerEvents=0;dropTarget=0;strokeColor=#B3B3B3;height=20;width="+te,l,O,z),u(z,W,null,f(l.title),te,0,l.width-te,20,"text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;");for(var It=0;l.sections!=null&&It<l.sections.length;It++){var Qt=l.sections[It],pe=l.sectionTitles[It];u(z,W,null,f(pe.message),0,Qt.y-l.y,l.width,Qt.height,"shape=line;dashed=1;whiteSpace=wrap;verticalAlign=top;labelPosition=center;verticalLabelPosition=middle;align=center;strokeColor=#B3B3B3;")}break;case"erdEntity":for(var ue=l.entityData.attributes,me=ue.length,Ee=(l.height-25)/me,xe=Ee,ar=0,xr=0,sr=0,Qe=0,or=0,It=0;It<ue.length;It++)ue[It].attributeType=ue[It].attributeType||ue[It].type,ue[It].attributeName=ue[It].attributeName||ue[It].name,ue[It].attributeKeyTypeList=ue[It].attributeKeyTypeList||ue[It].keys,ue[It].attributeComment=ue[It].attributeComment||ue[It].comment,ar=Math.max(ar,ue[It].attributeType.length*6),xr=Math.max(xr,ue[It].attributeName.length*6),sr=Math.max(sr,ue[It].attributeKeyType?ue[It].attributeKeyType.length*10:0),Qe=Math.max(Qe,ue[It].attributeKeyTypeList?ue[It].attributeKeyTypeList.length*22:0),or=Math.max(or,ue[It].attributeComment?ue[It].attributeComment.length*6:0);W=u(z,O,null,f(l.entityData.alias?l.entityData.alias:l.labelText),l.x,l.y,Math.max(xr+ar+sr+Qe+or,l.width),l.height,"shape=table;startSize="+(ue.length==0?l.height:25)+";container=1;collapsible=0;childLayout=tableLayout;fixedRows=1;rowLines=1;fontStyle=1;align=center;resizeLast=1;");for(var It=0;It<ue.length;It++){var Wr=u(z,W,null,null,0,xe,l.width,Ee,"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;"),oa="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=2;overflow=hidden;fontSize=11;";u(z,Wr,null,f(ue[It].attributeType),0,0,ar,Ee,oa),u(z,Wr,null,f(ue[It].attributeName),0,0,Math.max(xr,l.width-ar-sr-Qe-or),Ee,oa),sr>0&&u(z,Wr,null,f(ue[It].attributeKeyType),0,0,sr,Ee,oa),Qe>0&&u(z,Wr,null,ue[It].attributeKeyTypeList?f(ue[It].attributeKeyTypeList.join(", ")):"",0,0,Qe,Ee,oa),or>0&&u(z,Wr,null,f(ue[It].attributeComment),0,0,or,Ee,oa),xe+=Ee}break;case"element":case"requirement":var Sr=l.shape=="element";Rt="<<"+(Sr?"Element":l.data.type)+`>>
`,W=u(z,O,null,Rt+f(l.data.name),l.x,l.y,l.width,l.height,"swimlane;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=1;collapsible=0;marginBottom=0;");var Rr="";Sr?Rr="Type: "+l.data.type+`
Doc Ref: `+(l.data.docRef||"None"):Rr="Id: "+(l.data.requirementId||l.data.id)+`
Text: `+l.data.text+`
Risk: `+l.data.risk+`
-Verification: `+l.data.verifyMethod,u(z,W,null,f(Rr),0,40,l.width,l.height-40,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacing=6;overflow=hidden;rotatable=0;connectable=0;");break;case"rectCloud":W=r("shape=mxgraph.basic.cloud_rect;strokeWidth=2;",l,O,z);break;case"cloud":W=r("ellipse;shape=cloud;strokeWidth=2;",l,O,z);break;case"roundedRect":W=r("rounded=1;arcSize=20;strokeWidth=2",l,O,z);break;case"smilingFace":W=r("shape=image;imageAspect=0;aspect=fixed;image=https://cdn1.iconfinder.com/data/icons/hawcons/32/699734-icon-6-smiling-face-128.png;imageBackground=default;",l,O,z);break;case"sadFace":W=r("shape=image;imageAspect=0;aspect=fixed;image=https://cdn1.iconfinder.com/data/icons/hawcons/32/699741-icon-7-sad-face-128.png;imageBackground=default;",l,O,z);break;case"neutralFace":W=r("shape=image;imageAspect=0;aspect=fixed;image=https://cdn1.iconfinder.com/data/icons/hawcons/32/699721-icon-5-neutral-face-128.png;imageBackground=default;",l,O,z);break;case"gitBranch":W=r("line;dashed=1;strokeWidth=1;backgroundOutline=0;html=1;"+(l.height>l.width?"direction=south;labelPosition=center;verticalLabelPosition=top;align=center;verticalAlign=bottom;spacingBottom=10;spacing=0;":"labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;spacingRight=35;spacingTop=0;spacing=0;")+(l.isHidden?"strokeColor=none;":"labelBackgroundColor="+l.color[1]+";fontColor="+l.color[0]+";"),l,O,z);break;case"gitCommit":var Mr="";switch(l.type){case 0:case 1:Mr="strokeColor="+l.color[1]+";fillColor="+l.color[1];break;case 2:Mr="strokeColor=none;fillColor=none";break;case 3:l.labelText="",Mr="strokeColor="+l.color[1]+";fillColor=#efefef";break;case 4:l.labelText="",Mr="strokeColor=#efefef;fillColor=#efefef";break}switch(W=r("ellipse;verticalAlign=middle;labelPosition=left;verticalLabelPosition=middle;align=right;rotation=300;spacingRight=4;labelBackgroundColor=default;strokeWidth=5;"+Mr+";",l,O,z),l.type){case 1:u(z,W,null,"",5,5,l.width-10,l.height-10,"shape=umlDestroy;strokeWidth=3;strokeColor=#efefef;");break;case 2:u(z,W,null,"",0,0,l.width,l.height,"strokeWidth=5;strokeColor=#1c1c1c;fillColor=#efefef;");break;case 4:u(z,W,null,"",2,2,l.width-5,l.height-5,"shape=image;imageAspect=0;aspect=fixed;image=https://cdn3.iconfinder.com/data/icons/essential-pack/32/68-Cherry-128.png");break}if(l.tag||l.tags&&l.tags.length>0){l.tags&&(l.tag=l.tags.join(", "));var er=l.tag.length*6+20,Xr=u(z,W,null,f(l.tag),0,-er/2-l.width/2-5,l.height,er,"shape=loopLimit;size=8;rotation=90;horizontal=0;flipV=1;fillColor=#efefef;strokeColor=#DEDEDE;")}break;case"manual-file":W=r("shape=offPageConnector;whiteSpace=wrap;size=1;verticalAlign=top;strokeWidth=2",l,O,z);break;case"manual-input":case"sl-rect":case"sloped-rectangle":W=r("shape=manualInput;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"docs":case"documents":case"st-doc":case"stacked-document":W=r("shape=mxgraph.flowchart.multi-document;whiteSpace=wrap;boundedLbl=1;strokeWidth=2",l,O,z);break;case"procs":case"processes":case"st-rect":case"stacked-rectangle":W=r("shape=mxgraph.basic.layered_rect;dx=10;flipV=1;whiteSpace=wrap;boundedLbl=1;strokeWidth=2",l,O,z);break;case"paper-tape":case"flag":W=r("shape=tape;size=0.3;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"text":W=r("text;verticalAlign=middle;align=center;whiteSpace=wrap",l,O,z);break;case"notch-rect":case"card":case"notched-rectangle":W=r("shape=card;whiteSpace=wrap;size=20;arcSize=12;strokeWidth=2",l,O,z);break;case"lin-rect":case"lin-proc":case"lined-process":case"lined-rectangle":case"shaded-process":W=r("shape=internalStorage;whiteSpace=wrap;dx=8;dy=0;strokeWidth=2",l,O,z);break;case"sm-circ":case"small-circle":l.labelText="",W=r("ellipse;strokeWidth=2",l,O,z);break;case"hourglass":case"collate":W=r("shape=collate;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"comment":case"brace-l":case"brace":l.width=20,W=r("shape=curlyBracket;whiteSpace=wrap;rounded=1;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;strokeWidth=2",l,O,z);break;case"brace-r":l.x+=l.width-20,l.width=20,W=r("shape=curlyBracket;whiteSpace=wrap;rounded=1;flipH=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;strokeWidth=2",l,O,z);break;case"braces":W=r("group;verticalAlign=middle;",l,O,z),u(z,W,null,"",0,0,20,l.height,"shape=curlyBracket;rounded=1;strokeWidth=2"),u(z,W,null,"",l.width-20,0,20,l.height,"shape=curlyBracket;flipH=1;rounded=1;strokeWidth=2");break;case"bolt":case"com-link":case"lightning-bolt":l.labelText="",W=r("shape=mxgraph.basic.flash;strokeWidth=2",l,O,z);break;case"doc":case"document":W=r("strokeWidth=2;shape=document;whiteSpace=wrap",l,O,z);break;case"delay":case"half-rounded-rectangle":W=r("strokeWidth=2;shape=mxgraph.flowchart.delay;whiteSpace=wrap",l,O,z);break;case"das":case"h-cyl":case"horizontal-cylinder":y(l),W=r("shape=cylinder3;whiteSpace=wrap;boundedLbl=1;backgroundOutline=1;size=4;rotation=90;horizontal=0;strokeWidth=2",l,O,z);break;case"lin-cyl":case"disk":case"lined-cylinder":W=r("shape=datastore;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"curv-trap":case"curved-trapezoid":case"display":W=r("shape=display;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"div-rect":case"div-proc":case"divided-process":case"divided-rectangle":W=r("shape=internalStorage;whiteSpace=wrap;backgroundOutline=1;dx=0;dy=8;strokeWidth=2",l,O,z);break;case"tri":case"triangle":case"extract":W=r("verticalLabelPosition=middle;verticalAlign=bottom;shape=mxgraph.basic.acute_triangle;dx=0.5;labelPosition=center;align=center;strokeWidth=2",l,O,z);break;case"win-pane":case"window-pane":case"internal-storage":W=r("shape=internalStorage;whiteSpace=wrap;backgroundOutline=1;dx=8;dy=8;strokeWidth=2",l,O,z);break;case"lin-doc":case"lined-document":W=r("strokeWidth=2;shape=document;whiteSpace=wrap",l,O,z),u(z,W,null,"",8,0,1,Math.round(l.height*88.75)/100,"line;strokeWidth=2;direction=south");break;case"notch-pent":case"notched-pentagon":case"loop-limit":W=r("shape=loopLimit;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"flip-tri":case"flipped-triangle":W=r("verticalLabelPosition=middle;verticalAlign=top;shape=mxgraph.basic.acute_triangle;dx=0.5;labelPosition=center;align=center;strokeWidth=2;flipV=1",l,O,z);break;case"bow-rect":case"bow-tie-rectangle":case"stored-data":W=r("shape=dataStorage;whiteSpace=wrap;fixedSize=1;size=5;strokeWidth=2",l,O,z);break;case"cross-circ":case"crossed-circle":case"summary":W=r("shape=sumEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;backgroundOutline=1;strokeWidth=2",l,O,z);break;case"tag-doc":case"tagged-document":W=r("strokeWidth=2;shape=document;whiteSpace=wrap",l,O,z),u(z,W,null,"",Math.round(l.width*95.91)/100,Math.round(l.height*58.02)/100,1,Math.round(l.height*23.46)/100,"line;strokeWidth=2;direction=south;rotation=45");break;case"tag-rect":case"tagged-rectangle":case"tag-proc":case"tagged-process":W=r("rect;strokeWidth=2;whiteSpace=wrap",l,O,z),u(z,W,null,"",Math.round(l.width*95.27)/100,Math.round(l.height*70.37)/100,1,Math.round(l.height*35.2)/100,"line;strokeWidth=2;direction=south;rotation=45");break;case"imageSquare":var Kr=l.constraint=="on",Ur=l.pos=="t";l.height=Kr?l.width/l.imageAspectRatio:l.assetHeight||l.height,W=r("shape=image;imageAspect="+(Kr?"1;":"0;")+(Ur?"verticalLabelPosition=top;verticalAlign=bottom;":"verticalLabelPosition=bottom;verticalAlign=top;")+"image="+l.img,l,O,z);break;default:W=r("whiteSpace=wrap;strokeWidth=2;",l,O,z)}if(l.link&&z.setAttributeForCell(W,"link",l.link),l.linkTarget&&z.setAttributeForCell(W,"linkTarget",l.linkTarget),l.tooltip&&z.setAttributeForCell(W,"tooltip",l.tooltip),Ya.htmlLabels&&(W.style+="html=1;"),l.clusterNode&&(W.style+="verticalAlign=top;"),W!=null){var Jr="";W.style.indexOf("fillColor")<0&&(Jr+="fillColor="+p.fillColor+";"),W.style.indexOf("strokeColor")<0&&(Jr+="strokeColor="+p.strokeColor+";"),W.style.indexOf("fontColor")<0&&(Jr+="fontColor="+p.fontColor+";");var Yr=h(l.cssStyles);W.style=d(W.style+";"+Jr+Yr)}return W}function T(l,O){switch(l){case"extension":return O+"Arrow=block;"+O+"Size=16;"+O+"Fill=0";case"composition":return O+"Arrow=diamondThin;"+O+"Size=14;"+O+"Fill=1";case"aggregation":return O+"Arrow=diamondThin;"+O+"Size=14;"+O+"Fill=0";case"requirement_arrow":case"dependency":return O+"Arrow=open;"+O+"Size=12";case"arrow_point":return O+"Arrow=block";case"arrow_open":case"none":case void 0:return O+"Arrow=none";case"arrow_circle":return O+"Arrow=oval;"+O+"Size=10;"+O+"Fill=1";case"arrow_cross":return O+"Arrow=cross";case"zero_or_more":case"ZERO_OR_MORE":return O+"Arrow=ERzeroToMany;"+O+"Size=10;";case"only_one":case"ONLY_ONE":return O+"Arrow=ERmandOne;"+O+"Size=10;";case"one_or_more":case"ONE_OR_MORE":return O+"Arrow=ERoneToMany;"+O+"Size=10;";case"zero_or_one":case"ZERO_OR_ONE":return O+"Arrow=ERzeroToOne;"+O+"Size=10;";case"circlePlus":case"requirement_contains":return O+"Arrow=circlePlus;"+O+"Size=10;"+O+"Fill=0";case"circle":return O+"Arrow=circle;"+O+"Fill=0"}}function I(l){var O=[l.isOrth?"edgeStyle=orthogonalEdgeStyle":"curved=1"];if(l.relationship){var z=l.relationship.type;if(l.relationship.relSpec){var lt=l.relationship.relSpec;l.arrowTypeStart=lt.cardB,l.arrowTypeEnd=lt.cardA,l.pattern=lt.relType=="NON_IDENTIFYING"?"dashed":"solid"}else if(z){var W=z=="contains";l.pattern=W?"solid":"bigDashed",l.arrowTypeStart=W?"circlePlus":"none",l.arrowTypeEnd=W?"none":"dependency"}}switch(l.pattern){case"dotted":O.push("dashed=1;dashPattern=2 3");break;case"dashed":O.push("dashed=1");break;case"bigDashed":O.push("dashed=1;dashPattern=8 8");break}l.classes&&l.classes.indexOf("note-edge")!=-1&&O.push("dashed=1"),O.push(T(l.arrowTypeStart,"start")),O.push(T(l.arrowTypeEnd,"end")),l.thickness=="thick"&&O.push("strokeWidth=3"),Ya.htmlLabels&&O.push("html=1");var pt=h(l.style);return pt&&O.push(pt),O.join(";")+";"}function F(l){return Math.round(l*100)/100}function X(l,O,z,lt,W,pt){var mt=z[O.fromCluster||l.v],Tt=z[O.toCluster||l.w],Rt=pt&&mt.parent==Tt.parent;Rt&&(lt=mt.parent);var It=O.label;O.relationship&&(It=O.relationship.type?"<<"+O.relationship.type+">>":O.relationship.roleA),O.classes=="relationshipLine"&&It&&(It=It.replace(/&gt;/g,">").replace(/&lt;/g,"<")),mt.overrideArrowHead&&(O.arrowTypeStart=mt.overrideArrowHead,delete mt.overrideArrowHead),Tt.overrideArrowHead&&(O.arrowTypeEnd=Tt.overrideArrowHead,delete Tt.overrideArrowHead);var te=W.insertEdge(lt,null,f(It),mt,Tt,I(O)),Qt="middle",pe="center",ue="middle",me="center",Ee="edgeLabel;resizable=0;labelBackgroundColor=none;fontSize=12;";if(mt!=null&&mt.geometry!=null&&Tt!=null&&Tt.geometry!=null&&(Qt=mt.geometry.y+mt.geometry.height<Tt.geometry.y?"top":"bottom",ue=mt.geometry.y+mt.geometry.height<Tt.geometry.y?"bottom":"top",pe=mt.geometry.x+mt.geometry.width<Tt.geometry.x?"left":"right",me=mt.geometry.x+mt.geometry.width<Tt.geometry.x?"right":"left"),O.startLabelRight){var xe=u(W,te,null,f(O.startLabelRight),-1,0,0,0,Ee+"align="+pe+";verticalAlign="+Qt+";");xe.geometry.relative=!0}if(O.endLabelLeft){var xe=u(W,te,null,f(O.endLabelLeft),.5,0,0,0,Ee+"align="+me+";verticalAlign="+ue+";");xe.geometry.relative=!0}if(te.geometry.points=[],(O.fromCluster||O.toCluster)&&(O.points=null),O.points&&O.points.length>=2){var ar=O.points.shift(),xr=O.points.pop(),sr=mt.geometry,Qe=Tt.geometry,or=pt&&!Rt&&mt.parent&&mt.parent.geometry?mt.parent.geometry:{x:0,y:0,width:0,height:0},Wr=pt&&!Rt&&Tt.parent&&Tt.parent.geometry?Tt.parent.geometry:{x:0,y:0,width:0,height:0},oa=F((ar.x-sr.x-or.x)/sr.width),Sr=F((ar.y-sr.y-or.y)/sr.height),Rr=F((xr.x-Qe.x-Wr.x)/Qe.width),Mr=F((xr.y-Qe.y-Wr.y)/Qe.height);te.style+="exitX="+oa+";exitY="+Sr+";entryX="+Rr+";entryY="+Mr+";";for(var er=ar,Xr=0;Xr<O.points.length;Xr++){var Kr=O.points[Xr],Ur=O.points[Xr+1]||xr;!pt&&(er.x==Kr.x||er.y==Kr.y)&&Ur!=null&&(Ur.x==Kr.x||Ur.y==Kr.y)||(er=Kr,te.geometry.points.push(new mxPoint(Math.round(Kr.x),Math.round(Kr.y))))}}return O.pattern=="invisible"&&(te.visible=!1),te}function Z(l,O,z){var lt=l[z];for(var W in O)if(W.indexOf("a")!=-1){var pt=parseInt(W.substring(0,W.length-1));if(!(Math.abs(pt-lt)>20))for(var mt=O[W],Tt=0;Tt<mt.length;Tt++){var Rt=mt[Tt].geometry;if(Rt.y<=l.stopy&&Rt.y+Rt.height>=l.stopy)return mt[Tt]}}for(var W in O)if(!(W.indexOf("a")>-1)){var pt=parseInt(W);if(Math.abs(pt-lt)<=20)return O[W]}for(var W in O)if(!(W.indexOf("a")>-1)){var pt=parseInt(W);if(Math.abs(pt-lt)<=90)return O[W]}return null}function ot(l,O,z){var lt="endArrow=block;";switch(l.type){case 0:break;case 1:lt="dashed=1;dashPattern=2 3;endArrow=block;";break;case 3:lt="endArrow=cross;";break;case 4:lt="endArrow=cross;dashed=1;dashPattern=2 3;";break;case 5:lt="endArrow=none;";break;case 6:lt="endArrow=none;dashed=1;dashPattern=2 3;";break;case 24:lt="endArrow=classic;endSize=10;";break;case 25:lt="endArrow=classic;dashed=1;dashPattern=2 3;endSize=10;";break}Ya.htmlLabels&&(lt+="html=1;");var W=Z(l,O,"startx"),pt=Z(l,O,"stopx"),mt=W==pt,Tt=z.insertEdge(null,null,f(l.message),W,pt,(mt?"curved=1;":"verticalAlign=bottom;edgeStyle=elbowEdgeStyle;elbow=vertical;curved=0;rounded=0;")+lt);if(mt?Tt.geometry.points=[new mxPoint(Math.round(l.startx+50),Math.round(l.stopy-30)),new mxPoint(Math.round(l.startx+50),Math.round(l.stopy))]:Tt.geometry.points=[new mxPoint(Math.round(Math.min(l.startx,l.stopx)+l.width/2),Math.round(l.stopy))],l.sequenceVisible){var Rt=z.insertVertex(Tt,Tt.id+"seq",l.sequenceIndex,0,0,14,14,"ellipse;aspect=fixed;fillColor=#000000;align=center;fontColor=#FFFFFF;",!0),It=l.startx>l.stopx;Rt.geometry.offset=mt?new mxPoint(-57,-22):new mxPoint((It?1:-1)*l.width/2-(It?14:0),-7)}return Tt}function dt(l,O){for(var z={},lt=0,W=0;W<l.boxes.length;W++){var pt=l.boxes[W];pt.shape="group",pt.type="group",pt.labelText=pt.name,pt.y-=25,pt.height+=35,b(pt,null,O,!0)}for(var W=0;W<l.actors.length;W++){var mt=l.actors[W];if(!z[mt.name]){mt.shape="lifeline",mt.size=mt.height,mt.height=l.verticalPos,mt.y=0;var Tt=b(mt,null,O,!0);z[mt.x+mt.width/2]=Tt,lt=Math.max(lt,mt.width),z[mt.name]=Tt}}for(var Rt=[],W=0;W<l.messages.length;W++)Rt.push(l.messages[W].stopy);Rt.sort(function(me,Ee){return me-Ee}),l.activations.sort(function(me,Ee){return me.starty-Ee.starty});for(var It=0,W=0;W<l.activations.length;W++){let ar=function(xr,sr){z[xr]==null&&(z[xr]=[]),z[xr].push(sr)};for(var te=l.activations[W],mt=z[te.actor],Qt=mt.geometry;It<Rt.length&&Rt[It]<te.starty;)It++;te.x=te.startx-Qt.x,te.y=Rt[It-1],te.width=te.stopx-te.startx,te.height=te.stopy-Rt[It-1],te.shape="activation";var Tt=b(te,mt,O,!0);ar(te.startx+"a",Tt),ar(te.stopx+"a",Tt)}for(var W=0;W<l.loops.length;W++){var pe=l.loops[W];pe.x=pe.startx,pe.y=pe.starty,pe.width=pe.stopx-pe.startx,pe.height=pe.stopy-pe.starty,pe.shape="loop",b(pe,null,O,!0)}for(var W=0;W<l.messages.length;W++)ot(l.messages[W],z,O);for(var W=0;W<l.notes.length;W++){var ue=l.notes[W];ue.shape="seqNote",ue.x=ue.startx,ue.y=ue.starty,b(ue,null,O,!0)}for(var W=0;W<l.actors.length;W++){var mt=l.actors[W];if(mt.type=="actor"&&!mt.secondPass){for(var Tt=z[mt.name],It=0;Tt.children&&It<Tt.children.length;It++)Tt.children[It].geometry.x-=(Tt.geometry.width-35)/2;Tt.geometry.width=35,mt.secondPass=!0}}}function xt(l,O,z){var lt=l._nodes,W={},pt=l._edgeObjs,mt=l._edgeLabels;for(var Tt in lt){var Rt=lt[Tt];Rt.labelText=Rt.labelText||Rt.label,W[Tt]=b(Rt,O,z),Rt.clusterNode&&(delete Rt.graph._nodes[Tt],xt(Rt.graph,W[Tt],z))}for(var Tt in pt)X(pt[Tt],mt[Tt],W,O,z)}function re(l,O){var z={},lt=0,W=0,pt=0,mt=!1;for(var Tt in l.commitPos)lt=Math.max(lt,l.commitPos[Tt].x),W=Math.max(W,l.commitPos[Tt].y),mt=mt||l.commitPos[Tt].x==0;for(var Rt in l.branchPos){var It=l.branchPos[Rt];It.shape="gitBranch",It.labelText=Rt,It.y=mt?0:It.pos,It.x=mt?It.pos:0,It.width=mt?1:lt+50,It.height=mt?W+50:1,It.isHidden=!l.gitGraphConfig.showBranches;var te=w[pt++%w.length];It.color=te;var Qt=b(It,null,O,!0);Qt.value=l.gitGraphConfig.showBranches?'<p style="line-height: 50%;">&nbsp;&nbsp;'+mxUtils.htmlEntities(Qt.value)+"&nbsp;&nbsp;</p>":"",Qt.pos=It.pos,z[It.pos]={node:Qt,color:te}}var pe={},ue=[];for(var Rt in l.commitPos){var Tt=l.commitPos[Rt];Object.assign(Tt,l.commits[Rt]);var It=z[mt?Tt.x:Tt.y];Tt.shape="gitCommit",mt?(Tt.pos=Tt.x,Tt.x=0):(Tt.pos=Tt.y,Tt.y=0),Tt.width=20,Tt.height=20,Tt.labelText=l.gitGraphConfig.showCommitLabel?Rt:"",Tt.color=It.color,Tt.type=Tt.customType||Tt.type,pe[Rt]=b(Tt,It.node,O),It.commitList=It.commitList||[],It.commitList.push(Tt.x);for(var me=0;me<Tt.parents.length;me++){var Ee=Tt.parents[me],xe=l.commitPos[Ee],ar=xe.pos!=null?xe.pos:mt?xe.x:xe.y;ue.push({source:Ee,target:Rt,color:Tt.pos>=ar?It.color:z[ar].color,clr2:It.color})}}for(var me=0;me<ue.length;me++){var xr=ue[me],sr=pe[xr.source],Qe=pe[xr.target],or=O.insertEdge(null,null,null,sr,Qe,"rounded=1;endArrow=none;endFill=0;strokeWidth=8;"),Wr=!1;if(mt){var oa=sr.parent.geometry.x,Sr=Qe.parent.geometry.x,Rr=Qe.parent.pos;if(oa!=Sr){for(var Mr=z[Rr],er=0,Xr=0;Xr<Mr.commitList.length;Xr++){var Kr=Mr.commitList[Xr];Kr>sr.geometry.y&&Kr<Qe.geometry.y&&er++}if(er>0){var Ur=(oa+Sr)/2;or.geometry.points=[new mxPoint(Math.round(Ur),Math.round(sr.geometry.y+sr.geometry.height/2)),new mxPoint(Math.round(Ur),Math.round(Qe.geometry.y+Qe.geometry.height/2))],Wr=!0}else{var lt=Math.max(oa,Sr);or.geometry.points=[new mxPoint(Math.round(lt),oa==lt?Math.round(Qe.geometry.y+Qe.geometry.height/2):Math.round(sr.geometry.y+sr.geometry.height/2))]}}}else{var Jr=sr.parent.geometry.y,Yr=Qe.parent.geometry.y,Rr=Qe.parent.pos;if(Jr!=Yr){for(var Mr=z[Rr],er=0,Xr=0;Xr<Mr.commitList.length;Xr++){var ke=Mr.commitList[Xr];ke>sr.geometry.x&&ke<Qe.geometry.x&&er++}if(er>0){var ze=(Jr+Yr)/2;or.geometry.points=[new mxPoint(Math.round(sr.geometry.x+sr.geometry.width/2),Math.round(ze)),new mxPoint(Math.round(Qe.geometry.x+Qe.geometry.width/2),Math.round(ze))],Wr=!0}else{var W=Math.max(Jr,Yr);or.geometry.points=[new mxPoint(Jr==W?Math.round(Qe.geometry.x+Qe.geometry.width/2):Math.round(sr.geometry.x+sr.geometry.width/2),Math.round(W))]}}}Wr?or.style+="strokeColor="+xr.clr2[1]+";":or.style+="strokeColor="+xr.color[1]+";"}}function N(l,O){for(var z=l.tasks,lt=null,W=Number.MAX_SAFE_INTEGER,pt=0,mt=Number.MAX_SAFE_INTEGER,Tt=0;Tt<z.length;Tt++){var Rt=z[Tt];Rt.shape="lifeline",Rt.description=Rt.task,Rt.size=Rt.height*3,Rt.width*=3,Rt.height=300,W=Math.min(W,Rt.x),pt=Math.max(pt,Rt.x+Rt.width),mt=Math.min(mt,Rt.y+Rt.size);var It=b(Rt,null,O,!0),te={shape:Rt.score<3?"sadFace":Rt.score>3?"smilingFace":"neutralFace",x:Rt.width/2-15,y:270-Rt.score*25,width:30,height:30};b(te,It,O,!0);var Qt=0;for(var pe in Rt.actors)u(O,It,null,null,5+Qt++*8,-6,12,12,"ellipse;aspect=fixed;fillColor="+Rt.actors[pe].color);lt!=Rt.section&&(lt=Rt.section,Rt.labelText=Rt.section,Rt.shape="rect",Rt.height=Rt.size,Rt.y-=Rt.height+10,It=b(Rt,null,O,!0))}var ue=O.insertEdge(null,null,null,null,null,"endArrow=block;strokeWidth=3;endFill=1;");ue.geometry.setTerminalPoint(new mxPoint(Math.round(W),Math.round(mt+50)),!0),ue.geometry.setTerminalPoint(new mxPoint(Math.round(pt+50),Math.round(mt+50)),!1),ue.geometry.relative=!0,l.title&&u(O,null,null,f(l.title),W,0,l.title.length*12,40,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=20;fontStyle=1");for(var pe in l.actors){var me=l.actors[pe];u(O,null,null,pe,10,70+me.position*20,12,12,"ellipse;aspect=fixed;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;spacingLeft=10;fillColor="+me.color)}}function Q(l,O){if(l._private){for(var z=l._private.elements,lt={},W={},pt=0;pt<z.length;pt++){var mt=z[pt]._private.data;switch(mt.type){case 1:mt.shape="roundedRect";break;case 2:mt.shape="rect";break;case 3:mt.shape="circle",mt.width=Math.max(mt.height,mt.width),mt.height=mt.width;break;case 4:mt.shape="cloud";break;case 5:mt.shape="rectCloud";break;case 6:mt.shape="hexagon";break;default:mt.shape="rect",mt.type="round"}!isNaN(mt.x)&&!isNaN(mt.y)&&(lt[mt.id]=b(mt,null,O));for(var Tt=z[pt]._private.edges,Rt=0;Rt<Tt.length;Rt++){var It=Tt[Rt]._private.data;W[It.id]=It}}for(var te in W){var Qt=W[te];O.insertEdge(null,null,null,lt[Qt.source],lt[Qt.target],"endArrow=none")}}else{for(var lt={},W={},pt=0;pt<l.nodes.length;pt++){var mt=l.nodes[pt];switch(mt.labelText=mt.label,mt.type){case 1:mt.shape="roundedRect";break;case 2:mt.shape="rect";break;case 3:mt.shape="circle",mt.width=Math.max(mt.height,mt.width),mt.height=mt.width;break;case 4:mt.shape="cloud";break;case 5:mt.shape="rectCloud";break;case 6:mt.shape="hexagon";break;default:mt.shape="rect",mt.type="round",mt.mindmap=!0}!isNaN(mt.x)&&!isNaN(mt.y)&&(lt[mt.id]=b(mt,null,O))}for(var Rt=0;Rt<l.edges.length;Rt++)try{var pe=l.edges[Rt].classes.match(/edge-depth-(\d+)/);l.edges[Rt].depth=pe&&pe[1]?parseInt(pe[1]):1}catch(xe){l.edges[Rt].depth=1}for(var Rt=0;Rt<l.edges.length;Rt++)O.insertEdge(null,null,null,lt[l.edges[Rt].start],lt[l.edges[Rt].end],"endArrow=none;strokeWidth="+Math.max(8-l.edges[Rt].depth,1))}}function at(l,O,z,lt){for(var W=l.children,pt=l.edges,mt=0;mt<W.length;mt++){var Tt=W[mt],Rt=Tt.id;Tt.shape=Tt.type;var It=b(Tt,z,lt,!0);O[Rt]=It,Tt.children&&Tt.children.length>0&&at(Tt,O,It,lt)}for(var mt=0;pt!=null&&mt<pt.length;mt++){var te=pt[mt];te.v=te.sourceId,te.w=te.targetId;var Qt=te.edgeData||{};te.labels&&te.labels[0]&&(Qt.label=te.labels[0].text,Qt.lblInfo=te.labels[0]),Qt.isOrth=!0,te.sections&&te.sections[0]&&(Qt.points=te.sections[0].bendPoints?te.sections[0].bendPoints:[],te.sections[0].startPoint&&Qt.points.unshift(te.sections[0].startPoint),te.sections[0].endPoint&&Qt.points.push(te.sections[0].endPoint)),X(te,Qt,O,z,lt,!0)}}function _(l){var O=M();if(j=="gitgraph")re(l,O);else if(j=="journey")N(l,O);else if(j=="Mindmap")Q(l,O);else if(j=="sequenceDiagram")dt(l,O);else if(j=="flowchart-elk")l._nodes?xt(l,null,O):at(l,{},null,O);else{if(j=="er")for(var z in l._nodes){var pt=l._nodes[z];pt.shape="erdEntity",pt.entityData=pt}else if(j=="ERD"){for(var z in P)P[z].title=z,P[z.replace(/-|_/g,"")]=P[z];for(var z in l._nodes){var lt=P[z.split("-")[1]],pt=l._nodes[z];pt.shape="erdEntity",pt.labelText=lt.title,pt.entityData=lt}}else if(j=="requirements"){l=Ya.reqData,delete Ya.reqData;for(var z in l._nodes){var pt=l._nodes[z];pt.shape=P.elements[z]?"element":"requirement",pt.data=P.elements[z]||P.requirements[z]}}xt(l,null,O)}var W=new mxCodec,pt=W.encode(O.getModel());return mxUtils.getXml(pt)}};Ya.listeners=[];Ya.timeouts=[];Ya.addListener=function(L){Ya.listeners.push(L),Ya.timeouts.push(setTimeout(function(){L(EditorUi.prototype.emptyDiagramXml)},5e3))};Ya.resetListeners=function(){Ya.listeners=[],Ya.timeouts=[]};Ya.parseText=function(L,j){if(typeof si=="undefined"||typeof xi=="undefined"||typeof Oa=="undefined"||!si.isSupported(L))return null;try{var P=si.parse(L),E=e2(j,P.config);Oa.applyTheme(E);var w=xi.layout(P.type,P.ir,E);switch(P.type){case"sequence":return Oa.createSequenceDiagram(w,E);case"zenuml":return Oa.createZenumlDiagram(w,E);case"gitgraph":return Oa.createGitGraph(w,E);case"journey":return Oa.createJourneyDiagram(w,E);case"pie":return Oa.createPieDiagram(w,E);case"packet":return Oa.createPacketDiagram(w,E,L);case"quadrant":return Oa.createQuadrantDiagram(w,E,L);case"wardley":return Oa.createWardleyDiagram(w,E,L);case"eventmodeling":return Oa.createEventModelingDiagram(w,E,L);case"timeline":return Oa.createTimelineDiagram(w,E,L);case"kanban":return Oa.createKanbanDiagram(w,E,L);case"xychart":return Oa.createXychartDiagram(w,E,L);case"radar":return Oa.createRadarDiagram(w,E,L);case"c4":return Oa.createC4Diagram(w,E,L);case"architecture":return Oa.createArchitectureDiagram(w,E,L);case"sankey":return Oa.createSankeyDiagram(w,E,L);case"treemap":return Oa.createTreemapDiagram(w,E,L);case"gantt":return Oa.createGanttDiagram(w,E,L);case"venn":return Oa.createVennDiagram(w,E,L);case"ishikawa":return Oa.createIshikawaDiagram(w,E,L);case"treeView":return Oa.createTreeviewDiagram(w,E,L);default:return Oa.createFromElkGraph(w,E)}}catch(s){var p=new Error("Mermaid conversion failed: "+(s&&s.message?s.message:String(s)));throw p.name="MermaidConversionError",p.cause=s,p}};Ya.groupStyle="group;transparentBounds=1;editIcon=1;lockedGroup=0;groupPadding=10;";Ya.wrapGroup=function(L,j,P,E){if(L==null)return L;var w=mxUtils.parseXml(L),p=new mxCodec(w),s=new mxGraphModel;s.maintainEdgeParent=!1,p.decode(w.documentElement,s),s.maintainEdgeParent=!1;var o=s.getRoot();if(o==null)return L;var v=JSON.stringify({data:j,config:P||null},null,2);function M(T,I,F){var X;T.value!=null&&typeof T.value=="object"&&T.value.cloneNode!=null?X=T.value.cloneNode(!0):(X=w.createElement("UserObject"),X.setAttribute("label",T.value!=null?T.value:"")),F!=null?X.setAttribute(I,F):X.removeAttribute(I),s.setValue(T,X)}for(var f=[],u=0;u<s.getChildCount(o);u++)for(var r=s.getChildAt(o,u),h=0;h<s.getChildCount(r);h++)f.push(s.getChildAt(r,h));if(f.length==0)return L;var d=s.getParent(f[0]),n=f;if(f.length>1){var y=r2(s,f);y!=null&&(a2(s,y,f),n=[y])}var b=new mxCell("",new mxGeometry(0,0,0,0),Ya.groupStyle);b.setVertex(!0),b.setConnectable(!1),s.add(d,b);for(var u=0;u<n.length;u++)s.add(b,n[u]);return M(b,"mermaidData",v),E!=null&&E.normalize&&i2(s,b),mxUtils.getXml(new mxCodec().encode(s))};function ks(L,j){var P=L.getGeometry(j);if(P==null)return null;if(L.isEdge(j)){var E=1/0,w=1/0,p=-1/0,s=-1/0;if(P.sourcePoint!=null&&(P.sourcePoint.x<E&&(E=P.sourcePoint.x),P.sourcePoint.y<w&&(w=P.sourcePoint.y),P.sourcePoint.x>p&&(p=P.sourcePoint.x),P.sourcePoint.y>s&&(s=P.sourcePoint.y)),P.targetPoint!=null&&(P.targetPoint.x<E&&(E=P.targetPoint.x),P.targetPoint.y<w&&(w=P.targetPoint.y),P.targetPoint.x>p&&(p=P.targetPoint.x),P.targetPoint.y>s&&(s=P.targetPoint.y)),P.points!=null)for(var o=0;o<P.points.length;o++){var v=P.points[o];v.x<E&&(E=v.x),v.y<w&&(w=v.y),v.x>p&&(p=v.x),v.y>s&&(s=v.y)}return isFinite(E)?{x:E,y:w,w:p-E,h:s-w}:null}return P.width==null||P.height==null?null:{x:P.x||0,y:P.y||0,w:P.width,h:P.height}}function r2(L,j){for(var P=null,E=.5,w=0;w<j.length;w++){var p=j[w];if(L.isVertex(p)){var s=p.style||"",o=s.indexOf("shape=swimlane")>=0||s.indexOf("group;")===0||s==="group";if(o){var v=ks(L,p);if(!(v==null||v.w<=0||v.h<=0)){for(var M=!0,f=0;f<j.length;f++)if(f!==w){var u=ks(L,j[f]);if(u!=null&&(u.x<v.x-E||u.y<v.y-E||u.x+u.w>v.x+v.w+E||u.y+u.h>v.y+v.h+E)){M=!1;break}}if(M)if(P==null)P=p;else{var r=ks(L,P),h=v.w*v.h,d=r.w*r.h;if(h<d)P=p;else if(h===d)return null}}}}}return P}function a2(L,j,P){var E=L.getGeometry(j);if(E!=null)for(var w=E.x||0,p=E.y||0,s=0;s<P.length;s++){var o=P[s];if(o!==j){var v=L.getGeometry(o);if(v!=null){var M=v.clone();if(L.isEdge(o)||(M.x!=null&&(M.x-=w),M.y!=null&&(M.y-=p)),M.sourcePoint!=null&&(M.sourcePoint=new mxPoint(M.sourcePoint.x-w,M.sourcePoint.y-p)),M.targetPoint!=null&&(M.targetPoint=new mxPoint(M.targetPoint.x-w,M.targetPoint.y-p)),M.points!=null&&M.points.length>0){for(var f=[],u=0;u<M.points.length;u++)f.push(new mxPoint(M.points[u].x-w,M.points[u].y-p));M.points=f}L.setGeometry(o,M)}L.add(j,o)}}}function n2(L){var j=/(?:^|;)groupPadding=([^;]*)/.exec(L||"");if(j==null)return{n:0,w:0};for(var P=j[1].trim().split(/\s+/),E=0;E<P.length;E++){var w=parseFloat(P[E]);P[E]=isNaN(w)?0:w}return{n:P[0],w:P.length===1?P[0]:P.length===4?P[3]:P[1]}}function i2(L,j){for(var P=1/0,E=1/0,w=0;w<L.getChildCount(j);w++){var p=L.getChildAt(j,w),s=L.getGeometry(p);if(s!=null){if(L.isVertex(p)&&!s.relative)(s.x||0)<P&&(P=s.x||0),(s.y||0)<E&&(E=s.y||0);else if(L.isEdge(p)){var o=[];L.getTerminal(p,!0)==null&&s.sourcePoint!=null&&o.push(s.sourcePoint),L.getTerminal(p,!1)==null&&s.targetPoint!=null&&o.push(s.targetPoint),s.points!=null&&(o=o.concat(s.points));for(var v=0;v<o.length;v++)o[v]!=null&&(o[v].x<P&&(P=o[v].x),o[v].y<E&&(E=o[v].y))}}}if(!(!isFinite(P)||!isFinite(E))){var M=n2(j.style),f=M.w-P,u=M.n-E;if(!(f===0&&u===0))for(var w=0;w<L.getChildCount(j);w++){var p=L.getChildAt(j,w),s=L.getGeometry(p);if(s!=null){var r=s.clone();if(!L.isEdge(p)&&!r.relative&&(r.x=(r.x||0)+f,r.y=(r.y||0)+u),r.sourcePoint!=null&&(r.sourcePoint=new mxPoint(r.sourcePoint.x+f,r.sourcePoint.y+u)),r.targetPoint!=null&&(r.targetPoint=new mxPoint(r.targetPoint.x+f,r.targetPoint.y+u)),r.points!=null&&r.points.length>0){for(var o=[],v=0;v<r.points.length;v++)o.push(new mxPoint(r.points[v].x+f,r.points[v].y+u));r.points=o}L.setGeometry(p,r)}}}}var o2=Cs;return Ag(s2);})();
+Verification: `+l.data.verifyMethod,u(z,W,null,f(Rr),0,40,l.width,l.height-40,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacing=6;overflow=hidden;rotatable=0;connectable=0;");break;case"rectCloud":W=r("shape=mxgraph.basic.cloud_rect;strokeWidth=2;",l,O,z);break;case"cloud":W=r("ellipse;shape=cloud;strokeWidth=2;",l,O,z);break;case"roundedRect":W=r("rounded=1;arcSize=20;strokeWidth=2",l,O,z);break;case"smilingFace":W=r("shape=image;imageAspect=0;aspect=fixed;image=https://cdn1.iconfinder.com/data/icons/hawcons/32/699734-icon-6-smiling-face-128.png;imageBackground=default;",l,O,z);break;case"sadFace":W=r("shape=image;imageAspect=0;aspect=fixed;image=https://cdn1.iconfinder.com/data/icons/hawcons/32/699741-icon-7-sad-face-128.png;imageBackground=default;",l,O,z);break;case"neutralFace":W=r("shape=image;imageAspect=0;aspect=fixed;image=https://cdn1.iconfinder.com/data/icons/hawcons/32/699721-icon-5-neutral-face-128.png;imageBackground=default;",l,O,z);break;case"gitBranch":W=r("line;dashed=1;strokeWidth=1;backgroundOutline=0;html=1;"+(l.height>l.width?"direction=south;labelPosition=center;verticalLabelPosition=top;align=center;verticalAlign=bottom;spacingBottom=10;spacing=0;":"labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;spacingRight=35;spacingTop=0;spacing=0;")+(l.isHidden?"strokeColor=none;":"labelBackgroundColor="+l.color[1]+";fontColor="+l.color[0]+";"),l,O,z);break;case"gitCommit":var Mr="";switch(l.type){case 0:case 1:Mr="strokeColor="+l.color[1]+";fillColor="+l.color[1];break;case 2:Mr="strokeColor=none;fillColor=none";break;case 3:l.labelText="",Mr="strokeColor="+l.color[1]+";fillColor=#efefef";break;case 4:l.labelText="",Mr="strokeColor=#efefef;fillColor=#efefef";break}switch(W=r("ellipse;verticalAlign=middle;labelPosition=left;verticalLabelPosition=middle;align=right;rotation=300;spacingRight=4;labelBackgroundColor=default;strokeWidth=5;"+Mr+";",l,O,z),l.type){case 1:u(z,W,null,"",5,5,l.width-10,l.height-10,"shape=umlDestroy;strokeWidth=3;strokeColor=#efefef;");break;case 2:u(z,W,null,"",0,0,l.width,l.height,"strokeWidth=5;strokeColor=#1c1c1c;fillColor=#efefef;");break;case 4:u(z,W,null,"",2,2,l.width-5,l.height-5,"shape=image;imageAspect=0;aspect=fixed;image=https://cdn3.iconfinder.com/data/icons/essential-pack/32/68-Cherry-128.png");break}if(l.tag||l.tags&&l.tags.length>0){l.tags&&(l.tag=l.tags.join(", "));var er=l.tag.length*6+20,Xr=u(z,W,null,f(l.tag),0,-er/2-l.width/2-5,l.height,er,"shape=loopLimit;size=8;rotation=90;horizontal=0;flipV=1;fillColor=#efefef;strokeColor=#DEDEDE;")}break;case"manual-file":W=r("shape=offPageConnector;whiteSpace=wrap;size=1;verticalAlign=top;strokeWidth=2",l,O,z);break;case"manual-input":case"sl-rect":case"sloped-rectangle":W=r("shape=manualInput;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"docs":case"documents":case"st-doc":case"stacked-document":W=r("shape=mxgraph.flowchart.multi-document;whiteSpace=wrap;boundedLbl=1;strokeWidth=2",l,O,z);break;case"procs":case"processes":case"st-rect":case"stacked-rectangle":W=r("shape=mxgraph.basic.layered_rect;dx=10;flipV=1;whiteSpace=wrap;boundedLbl=1;strokeWidth=2",l,O,z);break;case"paper-tape":case"flag":W=r("shape=tape;size=0.3;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"text":W=r("text;verticalAlign=middle;align=center;whiteSpace=wrap",l,O,z);break;case"notch-rect":case"card":case"notched-rectangle":W=r("shape=card;whiteSpace=wrap;size=20;arcSize=12;strokeWidth=2",l,O,z);break;case"lin-rect":case"lin-proc":case"lined-process":case"lined-rectangle":case"shaded-process":W=r("shape=internalStorage;whiteSpace=wrap;dx=8;dy=0;strokeWidth=2",l,O,z);break;case"sm-circ":case"small-circle":l.labelText="",W=r("ellipse;strokeWidth=2",l,O,z);break;case"hourglass":case"collate":W=r("shape=collate;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"comment":case"brace-l":case"brace":l.width=20,W=r("shape=curlyBracket;whiteSpace=wrap;rounded=1;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;strokeWidth=2",l,O,z);break;case"brace-r":l.x+=l.width-20,l.width=20,W=r("shape=curlyBracket;whiteSpace=wrap;rounded=1;flipH=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;strokeWidth=2",l,O,z);break;case"braces":W=r("group;verticalAlign=middle;",l,O,z),u(z,W,null,"",0,0,20,l.height,"shape=curlyBracket;rounded=1;strokeWidth=2"),u(z,W,null,"",l.width-20,0,20,l.height,"shape=curlyBracket;flipH=1;rounded=1;strokeWidth=2");break;case"bolt":case"com-link":case"lightning-bolt":l.labelText="",W=r("shape=mxgraph.basic.flash;strokeWidth=2",l,O,z);break;case"doc":case"document":W=r("strokeWidth=2;shape=document;whiteSpace=wrap",l,O,z);break;case"delay":case"half-rounded-rectangle":W=r("strokeWidth=2;shape=mxgraph.flowchart.delay;whiteSpace=wrap",l,O,z);break;case"das":case"h-cyl":case"horizontal-cylinder":y(l),W=r("shape=cylinder3;whiteSpace=wrap;boundedLbl=1;backgroundOutline=1;size=4;rotation=90;horizontal=0;strokeWidth=2",l,O,z);break;case"lin-cyl":case"disk":case"lined-cylinder":W=r("shape=datastore;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"curv-trap":case"curved-trapezoid":case"display":W=r("shape=display;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"div-rect":case"div-proc":case"divided-process":case"divided-rectangle":W=r("shape=internalStorage;whiteSpace=wrap;backgroundOutline=1;dx=0;dy=8;strokeWidth=2",l,O,z);break;case"tri":case"triangle":case"extract":W=r("verticalLabelPosition=middle;verticalAlign=bottom;shape=mxgraph.basic.acute_triangle;dx=0.5;labelPosition=center;align=center;strokeWidth=2",l,O,z);break;case"win-pane":case"window-pane":case"internal-storage":W=r("shape=internalStorage;whiteSpace=wrap;backgroundOutline=1;dx=8;dy=8;strokeWidth=2",l,O,z);break;case"lin-doc":case"lined-document":W=r("strokeWidth=2;shape=document;whiteSpace=wrap",l,O,z),u(z,W,null,"",8,0,1,Math.round(l.height*88.75)/100,"line;strokeWidth=2;direction=south");break;case"notch-pent":case"notched-pentagon":case"loop-limit":W=r("shape=loopLimit;whiteSpace=wrap;strokeWidth=2",l,O,z);break;case"flip-tri":case"flipped-triangle":W=r("verticalLabelPosition=middle;verticalAlign=top;shape=mxgraph.basic.acute_triangle;dx=0.5;labelPosition=center;align=center;strokeWidth=2;flipV=1",l,O,z);break;case"bow-rect":case"bow-tie-rectangle":case"stored-data":W=r("shape=dataStorage;whiteSpace=wrap;fixedSize=1;size=5;strokeWidth=2",l,O,z);break;case"cross-circ":case"crossed-circle":case"summary":W=r("shape=sumEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;backgroundOutline=1;strokeWidth=2",l,O,z);break;case"tag-doc":case"tagged-document":W=r("strokeWidth=2;shape=document;whiteSpace=wrap",l,O,z),u(z,W,null,"",Math.round(l.width*95.91)/100,Math.round(l.height*58.02)/100,1,Math.round(l.height*23.46)/100,"line;strokeWidth=2;direction=south;rotation=45");break;case"tag-rect":case"tagged-rectangle":case"tag-proc":case"tagged-process":W=r("rect;strokeWidth=2;whiteSpace=wrap",l,O,z),u(z,W,null,"",Math.round(l.width*95.27)/100,Math.round(l.height*70.37)/100,1,Math.round(l.height*35.2)/100,"line;strokeWidth=2;direction=south;rotation=45");break;case"imageSquare":var Kr=l.constraint=="on",Ur=l.pos=="t";l.height=Kr?l.width/l.imageAspectRatio:l.assetHeight||l.height,W=r("shape=image;imageAspect="+(Kr?"1;":"0;")+(Ur?"verticalLabelPosition=top;verticalAlign=bottom;":"verticalLabelPosition=bottom;verticalAlign=top;")+"image="+l.img,l,O,z);break;default:W=r("whiteSpace=wrap;strokeWidth=2;",l,O,z)}if(l.link&&z.setAttributeForCell(W,"link",l.link),l.linkTarget&&z.setAttributeForCell(W,"linkTarget",l.linkTarget),l.tooltip&&z.setAttributeForCell(W,"tooltip",l.tooltip),Ya.htmlLabels&&(W.style+="html=1;"),l.clusterNode&&(W.style+="verticalAlign=top;"),W!=null){var Jr="";W.style.indexOf("fillColor")<0&&(Jr+="fillColor="+p.fillColor+";"),W.style.indexOf("strokeColor")<0&&(Jr+="strokeColor="+p.strokeColor+";"),W.style.indexOf("fontColor")<0&&(Jr+="fontColor="+p.fontColor+";");var Yr=h(l.cssStyles);W.style=v(W.style+";"+Jr+Yr)}return W}function T(l,O){switch(l){case"extension":return O+"Arrow=block;"+O+"Size=16;"+O+"Fill=0";case"composition":return O+"Arrow=diamondThin;"+O+"Size=14;"+O+"Fill=1";case"aggregation":return O+"Arrow=diamondThin;"+O+"Size=14;"+O+"Fill=0";case"requirement_arrow":case"dependency":return O+"Arrow=open;"+O+"Size=12";case"arrow_point":return O+"Arrow=block";case"arrow_open":case"none":case void 0:return O+"Arrow=none";case"arrow_circle":return O+"Arrow=oval;"+O+"Size=10;"+O+"Fill=1";case"arrow_cross":return O+"Arrow=cross";case"zero_or_more":case"ZERO_OR_MORE":return O+"Arrow=ERzeroToMany;"+O+"Size=10;";case"only_one":case"ONLY_ONE":return O+"Arrow=ERmandOne;"+O+"Size=10;";case"one_or_more":case"ONE_OR_MORE":return O+"Arrow=ERoneToMany;"+O+"Size=10;";case"zero_or_one":case"ZERO_OR_ONE":return O+"Arrow=ERzeroToOne;"+O+"Size=10;";case"circlePlus":case"requirement_contains":return O+"Arrow=circlePlus;"+O+"Size=10;"+O+"Fill=0";case"circle":return O+"Arrow=circle;"+O+"Fill=0"}}function I(l){var O=[l.isOrth?"edgeStyle=orthogonalEdgeStyle":"curved=1"];if(l.relationship){var z=l.relationship.type;if(l.relationship.relSpec){var lt=l.relationship.relSpec;l.arrowTypeStart=lt.cardB,l.arrowTypeEnd=lt.cardA,l.pattern=lt.relType=="NON_IDENTIFYING"?"dashed":"solid"}else if(z){var W=z=="contains";l.pattern=W?"solid":"bigDashed",l.arrowTypeStart=W?"circlePlus":"none",l.arrowTypeEnd=W?"none":"dependency"}}switch(l.pattern){case"dotted":O.push("dashed=1;dashPattern=2 3");break;case"dashed":O.push("dashed=1");break;case"bigDashed":O.push("dashed=1;dashPattern=8 8");break}l.classes&&l.classes.indexOf("note-edge")!=-1&&O.push("dashed=1"),O.push(T(l.arrowTypeStart,"start")),O.push(T(l.arrowTypeEnd,"end")),l.thickness=="thick"&&O.push("strokeWidth=3"),Ya.htmlLabels&&O.push("html=1");var gt=h(l.style);return gt&&O.push(gt),O.join(";")+";"}function F(l){return Math.round(l*100)/100}function X(l,O,z,lt,W,gt){var mt=z[O.fromCluster||l.v],Tt=z[O.toCluster||l.w],Rt=gt&&mt.parent==Tt.parent;Rt&&(lt=mt.parent);var It=O.label;O.relationship&&(It=O.relationship.type?"<<"+O.relationship.type+">>":O.relationship.roleA),O.classes=="relationshipLine"&&It&&(It=It.replace(/&gt;/g,">").replace(/&lt;/g,"<")),mt.overrideArrowHead&&(O.arrowTypeStart=mt.overrideArrowHead,delete mt.overrideArrowHead),Tt.overrideArrowHead&&(O.arrowTypeEnd=Tt.overrideArrowHead,delete Tt.overrideArrowHead);var te=W.insertEdge(lt,null,f(It),mt,Tt,I(O)),Qt="middle",pe="center",ue="middle",me="center",Ee="edgeLabel;resizable=0;labelBackgroundColor=none;fontSize=12;";if(mt!=null&&mt.geometry!=null&&Tt!=null&&Tt.geometry!=null&&(Qt=mt.geometry.y+mt.geometry.height<Tt.geometry.y?"top":"bottom",ue=mt.geometry.y+mt.geometry.height<Tt.geometry.y?"bottom":"top",pe=mt.geometry.x+mt.geometry.width<Tt.geometry.x?"left":"right",me=mt.geometry.x+mt.geometry.width<Tt.geometry.x?"right":"left"),O.startLabelRight){var xe=u(W,te,null,f(O.startLabelRight),-1,0,0,0,Ee+"align="+pe+";verticalAlign="+Qt+";");xe.geometry.relative=!0}if(O.endLabelLeft){var xe=u(W,te,null,f(O.endLabelLeft),.5,0,0,0,Ee+"align="+me+";verticalAlign="+ue+";");xe.geometry.relative=!0}if(te.geometry.points=[],(O.fromCluster||O.toCluster)&&(O.points=null),O.points&&O.points.length>=2){var ar=O.points.shift(),xr=O.points.pop(),sr=mt.geometry,Qe=Tt.geometry,or=gt&&!Rt&&mt.parent&&mt.parent.geometry?mt.parent.geometry:{x:0,y:0,width:0,height:0},Wr=gt&&!Rt&&Tt.parent&&Tt.parent.geometry?Tt.parent.geometry:{x:0,y:0,width:0,height:0},oa=F((ar.x-sr.x-or.x)/sr.width),Sr=F((ar.y-sr.y-or.y)/sr.height),Rr=F((xr.x-Qe.x-Wr.x)/Qe.width),Mr=F((xr.y-Qe.y-Wr.y)/Qe.height);te.style+="exitX="+oa+";exitY="+Sr+";entryX="+Rr+";entryY="+Mr+";";for(var er=ar,Xr=0;Xr<O.points.length;Xr++){var Kr=O.points[Xr],Ur=O.points[Xr+1]||xr;!gt&&(er.x==Kr.x||er.y==Kr.y)&&Ur!=null&&(Ur.x==Kr.x||Ur.y==Kr.y)||(er=Kr,te.geometry.points.push(new mxPoint(Math.round(Kr.x),Math.round(Kr.y))))}}return O.pattern=="invisible"&&(te.visible=!1),te}function K(l,O,z){var lt=l[z];for(var W in O)if(W.indexOf("a")!=-1){var gt=parseInt(W.substring(0,W.length-1));if(!(Math.abs(gt-lt)>20))for(var mt=O[W],Tt=0;Tt<mt.length;Tt++){var Rt=mt[Tt].geometry;if(Rt.y<=l.stopy&&Rt.y+Rt.height>=l.stopy)return mt[Tt]}}for(var W in O)if(!(W.indexOf("a")>-1)){var gt=parseInt(W);if(Math.abs(gt-lt)<=20)return O[W]}for(var W in O)if(!(W.indexOf("a")>-1)){var gt=parseInt(W);if(Math.abs(gt-lt)<=90)return O[W]}return null}function ot(l,O,z){var lt="endArrow=block;";switch(l.type){case 0:break;case 1:lt="dashed=1;dashPattern=2 3;endArrow=block;";break;case 3:lt="endArrow=cross;";break;case 4:lt="endArrow=cross;dashed=1;dashPattern=2 3;";break;case 5:lt="endArrow=none;";break;case 6:lt="endArrow=none;dashed=1;dashPattern=2 3;";break;case 24:lt="endArrow=classic;endSize=10;";break;case 25:lt="endArrow=classic;dashed=1;dashPattern=2 3;endSize=10;";break}Ya.htmlLabels&&(lt+="html=1;");var W=K(l,O,"startx"),gt=K(l,O,"stopx"),mt=W==gt,Tt=z.insertEdge(null,null,f(l.message),W,gt,(mt?"curved=1;":"verticalAlign=bottom;edgeStyle=elbowEdgeStyle;elbow=vertical;curved=0;rounded=0;")+lt);if(mt?Tt.geometry.points=[new mxPoint(Math.round(l.startx+50),Math.round(l.stopy-30)),new mxPoint(Math.round(l.startx+50),Math.round(l.stopy))]:Tt.geometry.points=[new mxPoint(Math.round(Math.min(l.startx,l.stopx)+l.width/2),Math.round(l.stopy))],l.sequenceVisible){var Rt=z.insertVertex(Tt,Tt.id+"seq",l.sequenceIndex,0,0,14,14,"ellipse;aspect=fixed;fillColor=#000000;align=center;fontColor=#FFFFFF;",!0),It=l.startx>l.stopx;Rt.geometry.offset=mt?new mxPoint(-57,-22):new mxPoint((It?1:-1)*l.width/2-(It?14:0),-7)}return Tt}function pt(l,O){for(var z={},lt=0,W=0;W<l.boxes.length;W++){var gt=l.boxes[W];gt.shape="group",gt.type="group",gt.labelText=gt.name,gt.y-=25,gt.height+=35,b(gt,null,O,!0)}for(var W=0;W<l.actors.length;W++){var mt=l.actors[W];if(!z[mt.name]){mt.shape="lifeline",mt.size=mt.height,mt.height=l.verticalPos,mt.y=0;var Tt=b(mt,null,O,!0);z[mt.x+mt.width/2]=Tt,lt=Math.max(lt,mt.width),z[mt.name]=Tt}}for(var Rt=[],W=0;W<l.messages.length;W++)Rt.push(l.messages[W].stopy);Rt.sort(function(me,Ee){return me-Ee}),l.activations.sort(function(me,Ee){return me.starty-Ee.starty});for(var It=0,W=0;W<l.activations.length;W++){let ar=function(xr,sr){z[xr]==null&&(z[xr]=[]),z[xr].push(sr)};for(var te=l.activations[W],mt=z[te.actor],Qt=mt.geometry;It<Rt.length&&Rt[It]<te.starty;)It++;te.x=te.startx-Qt.x,te.y=Rt[It-1],te.width=te.stopx-te.startx,te.height=te.stopy-Rt[It-1],te.shape="activation";var Tt=b(te,mt,O,!0);ar(te.startx+"a",Tt),ar(te.stopx+"a",Tt)}for(var W=0;W<l.loops.length;W++){var pe=l.loops[W];pe.x=pe.startx,pe.y=pe.starty,pe.width=pe.stopx-pe.startx,pe.height=pe.stopy-pe.starty,pe.shape="loop",b(pe,null,O,!0)}for(var W=0;W<l.messages.length;W++)ot(l.messages[W],z,O);for(var W=0;W<l.notes.length;W++){var ue=l.notes[W];ue.shape="seqNote",ue.x=ue.startx,ue.y=ue.starty,b(ue,null,O,!0)}for(var W=0;W<l.actors.length;W++){var mt=l.actors[W];if(mt.type=="actor"&&!mt.secondPass){for(var Tt=z[mt.name],It=0;Tt.children&&It<Tt.children.length;It++)Tt.children[It].geometry.x-=(Tt.geometry.width-35)/2;Tt.geometry.width=35,mt.secondPass=!0}}}function xt(l,O,z){var lt=l._nodes,W={},gt=l._edgeObjs,mt=l._edgeLabels;for(var Tt in lt){var Rt=lt[Tt];Rt.labelText=Rt.labelText||Rt.label,W[Tt]=b(Rt,O,z),Rt.clusterNode&&(delete Rt.graph._nodes[Tt],xt(Rt.graph,W[Tt],z))}for(var Tt in gt)X(gt[Tt],mt[Tt],W,O,z)}function ee(l,O){var z={},lt=0,W=0,gt=0,mt=!1;for(var Tt in l.commitPos)lt=Math.max(lt,l.commitPos[Tt].x),W=Math.max(W,l.commitPos[Tt].y),mt=mt||l.commitPos[Tt].x==0;for(var Rt in l.branchPos){var It=l.branchPos[Rt];It.shape="gitBranch",It.labelText=Rt,It.y=mt?0:It.pos,It.x=mt?It.pos:0,It.width=mt?1:lt+50,It.height=mt?W+50:1,It.isHidden=!l.gitGraphConfig.showBranches;var te=w[gt++%w.length];It.color=te;var Qt=b(It,null,O,!0);Qt.value=l.gitGraphConfig.showBranches?'<p style="line-height: 50%;">&nbsp;&nbsp;'+mxUtils.htmlEntities(Qt.value)+"&nbsp;&nbsp;</p>":"",Qt.pos=It.pos,z[It.pos]={node:Qt,color:te}}var pe={},ue=[];for(var Rt in l.commitPos){var Tt=l.commitPos[Rt];Object.assign(Tt,l.commits[Rt]);var It=z[mt?Tt.x:Tt.y];Tt.shape="gitCommit",mt?(Tt.pos=Tt.x,Tt.x=0):(Tt.pos=Tt.y,Tt.y=0),Tt.width=20,Tt.height=20,Tt.labelText=l.gitGraphConfig.showCommitLabel?Rt:"",Tt.color=It.color,Tt.type=Tt.customType||Tt.type,pe[Rt]=b(Tt,It.node,O),It.commitList=It.commitList||[],It.commitList.push(Tt.x);for(var me=0;me<Tt.parents.length;me++){var Ee=Tt.parents[me],xe=l.commitPos[Ee],ar=xe.pos!=null?xe.pos:mt?xe.x:xe.y;ue.push({source:Ee,target:Rt,color:Tt.pos>=ar?It.color:z[ar].color,clr2:It.color})}}for(var me=0;me<ue.length;me++){var xr=ue[me],sr=pe[xr.source],Qe=pe[xr.target],or=O.insertEdge(null,null,null,sr,Qe,"rounded=1;endArrow=none;endFill=0;strokeWidth=8;"),Wr=!1;if(mt){var oa=sr.parent.geometry.x,Sr=Qe.parent.geometry.x,Rr=Qe.parent.pos;if(oa!=Sr){for(var Mr=z[Rr],er=0,Xr=0;Xr<Mr.commitList.length;Xr++){var Kr=Mr.commitList[Xr];Kr>sr.geometry.y&&Kr<Qe.geometry.y&&er++}if(er>0){var Ur=(oa+Sr)/2;or.geometry.points=[new mxPoint(Math.round(Ur),Math.round(sr.geometry.y+sr.geometry.height/2)),new mxPoint(Math.round(Ur),Math.round(Qe.geometry.y+Qe.geometry.height/2))],Wr=!0}else{var lt=Math.max(oa,Sr);or.geometry.points=[new mxPoint(Math.round(lt),oa==lt?Math.round(Qe.geometry.y+Qe.geometry.height/2):Math.round(sr.geometry.y+sr.geometry.height/2))]}}}else{var Jr=sr.parent.geometry.y,Yr=Qe.parent.geometry.y,Rr=Qe.parent.pos;if(Jr!=Yr){for(var Mr=z[Rr],er=0,Xr=0;Xr<Mr.commitList.length;Xr++){var ke=Mr.commitList[Xr];ke>sr.geometry.x&&ke<Qe.geometry.x&&er++}if(er>0){var ze=(Jr+Yr)/2;or.geometry.points=[new mxPoint(Math.round(sr.geometry.x+sr.geometry.width/2),Math.round(ze)),new mxPoint(Math.round(Qe.geometry.x+Qe.geometry.width/2),Math.round(ze))],Wr=!0}else{var W=Math.max(Jr,Yr);or.geometry.points=[new mxPoint(Jr==W?Math.round(Qe.geometry.x+Qe.geometry.width/2):Math.round(sr.geometry.x+sr.geometry.width/2),Math.round(W))]}}}Wr?or.style+="strokeColor="+xr.clr2[1]+";":or.style+="strokeColor="+xr.color[1]+";"}}function N(l,O){for(var z=l.tasks,lt=null,W=Number.MAX_SAFE_INTEGER,gt=0,mt=Number.MAX_SAFE_INTEGER,Tt=0;Tt<z.length;Tt++){var Rt=z[Tt];Rt.shape="lifeline",Rt.description=Rt.task,Rt.size=Rt.height*3,Rt.width*=3,Rt.height=300,W=Math.min(W,Rt.x),gt=Math.max(gt,Rt.x+Rt.width),mt=Math.min(mt,Rt.y+Rt.size);var It=b(Rt,null,O,!0),te={shape:Rt.score<3?"sadFace":Rt.score>3?"smilingFace":"neutralFace",x:Rt.width/2-15,y:270-Rt.score*25,width:30,height:30};b(te,It,O,!0);var Qt=0;for(var pe in Rt.actors)u(O,It,null,null,5+Qt++*8,-6,12,12,"ellipse;aspect=fixed;fillColor="+Rt.actors[pe].color);lt!=Rt.section&&(lt=Rt.section,Rt.labelText=Rt.section,Rt.shape="rect",Rt.height=Rt.size,Rt.y-=Rt.height+10,It=b(Rt,null,O,!0))}var ue=O.insertEdge(null,null,null,null,null,"endArrow=block;strokeWidth=3;endFill=1;");ue.geometry.setTerminalPoint(new mxPoint(Math.round(W),Math.round(mt+50)),!0),ue.geometry.setTerminalPoint(new mxPoint(Math.round(gt+50),Math.round(mt+50)),!1),ue.geometry.relative=!0,l.title&&u(O,null,null,f(l.title),W,0,l.title.length*12,40,"text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=20;fontStyle=1");for(var pe in l.actors){var me=l.actors[pe];u(O,null,null,pe,10,70+me.position*20,12,12,"ellipse;aspect=fixed;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;spacingLeft=10;fillColor="+me.color)}}function Q(l,O){if(l._private){for(var z=l._private.elements,lt={},W={},gt=0;gt<z.length;gt++){var mt=z[gt]._private.data;switch(mt.type){case 1:mt.shape="roundedRect";break;case 2:mt.shape="rect";break;case 3:mt.shape="circle",mt.width=Math.max(mt.height,mt.width),mt.height=mt.width;break;case 4:mt.shape="cloud";break;case 5:mt.shape="rectCloud";break;case 6:mt.shape="hexagon";break;default:mt.shape="rect",mt.type="round"}!isNaN(mt.x)&&!isNaN(mt.y)&&(lt[mt.id]=b(mt,null,O));for(var Tt=z[gt]._private.edges,Rt=0;Rt<Tt.length;Rt++){var It=Tt[Rt]._private.data;W[It.id]=It}}for(var te in W){var Qt=W[te];O.insertEdge(null,null,null,lt[Qt.source],lt[Qt.target],"endArrow=none")}}else{for(var lt={},W={},gt=0;gt<l.nodes.length;gt++){var mt=l.nodes[gt];switch(mt.labelText=mt.label,mt.type){case 1:mt.shape="roundedRect";break;case 2:mt.shape="rect";break;case 3:mt.shape="circle",mt.width=Math.max(mt.height,mt.width),mt.height=mt.width;break;case 4:mt.shape="cloud";break;case 5:mt.shape="rectCloud";break;case 6:mt.shape="hexagon";break;default:mt.shape="rect",mt.type="round",mt.mindmap=!0}!isNaN(mt.x)&&!isNaN(mt.y)&&(lt[mt.id]=b(mt,null,O))}for(var Rt=0;Rt<l.edges.length;Rt++)try{var pe=l.edges[Rt].classes.match(/edge-depth-(\d+)/);l.edges[Rt].depth=pe&&pe[1]?parseInt(pe[1]):1}catch(xe){l.edges[Rt].depth=1}for(var Rt=0;Rt<l.edges.length;Rt++)O.insertEdge(null,null,null,lt[l.edges[Rt].start],lt[l.edges[Rt].end],"endArrow=none;strokeWidth="+Math.max(8-l.edges[Rt].depth,1))}}function at(l,O,z,lt){for(var W=l.children,gt=l.edges,mt=0;mt<W.length;mt++){var Tt=W[mt],Rt=Tt.id;Tt.shape=Tt.type;var It=b(Tt,z,lt,!0);O[Rt]=It,Tt.children&&Tt.children.length>0&&at(Tt,O,It,lt)}for(var mt=0;gt!=null&&mt<gt.length;mt++){var te=gt[mt];te.v=te.sourceId,te.w=te.targetId;var Qt=te.edgeData||{};te.labels&&te.labels[0]&&(Qt.label=te.labels[0].text,Qt.lblInfo=te.labels[0]),Qt.isOrth=!0,te.sections&&te.sections[0]&&(Qt.points=te.sections[0].bendPoints?te.sections[0].bendPoints:[],te.sections[0].startPoint&&Qt.points.unshift(te.sections[0].startPoint),te.sections[0].endPoint&&Qt.points.push(te.sections[0].endPoint)),X(te,Qt,O,z,lt,!0)}}function _(l){var O=M();if(j=="gitgraph")ee(l,O);else if(j=="journey")N(l,O);else if(j=="Mindmap")Q(l,O);else if(j=="sequenceDiagram")pt(l,O);else if(j=="flowchart-elk")l._nodes?xt(l,null,O):at(l,{},null,O);else{if(j=="er")for(var z in l._nodes){var gt=l._nodes[z];gt.shape="erdEntity",gt.entityData=gt}else if(j=="ERD"){for(var z in P)P[z].title=z,P[z.replace(/-|_/g,"")]=P[z];for(var z in l._nodes){var lt=P[z.split("-")[1]],gt=l._nodes[z];gt.shape="erdEntity",gt.labelText=lt.title,gt.entityData=lt}}else if(j=="requirements"){l=Ya.reqData,delete Ya.reqData;for(var z in l._nodes){var gt=l._nodes[z];gt.shape=P.elements[z]?"element":"requirement",gt.data=P.elements[z]||P.requirements[z]}}xt(l,null,O)}var W=new mxCodec,gt=W.encode(O.getModel());return mxUtils.getXml(gt)}};Ya.listeners=[];Ya.timeouts=[];Ya.addListener=function(L){Ya.listeners.push(L),Ya.timeouts.push(setTimeout(function(){L(EditorUi.prototype.emptyDiagramXml)},5e3))};Ya.resetListeners=function(){Ya.listeners=[],Ya.timeouts=[]};Ya.parseText=function(L,j){if(typeof si=="undefined"||typeof xi=="undefined"||typeof Oa=="undefined"||!si.isSupported(L))return null;try{var P=si.parse(L),E=e2(j,P.config);Oa.applyTheme(E);var w=xi.layout(P.type,P.ir,E);switch(P.type){case"sequence":return Oa.createSequenceDiagram(w,E);case"zenuml":return Oa.createZenumlDiagram(w,E);case"gitgraph":return Oa.createGitGraph(w,E);case"journey":return Oa.createJourneyDiagram(w,E);case"pie":return Oa.createPieDiagram(w,E);case"packet":return Oa.createPacketDiagram(w,E,L);case"quadrant":return Oa.createQuadrantDiagram(w,E,L);case"wardley":return Oa.createWardleyDiagram(w,E,L);case"eventmodeling":return Oa.createEventModelingDiagram(w,E,L);case"timeline":return Oa.createTimelineDiagram(w,E,L);case"kanban":return Oa.createKanbanDiagram(w,E,L);case"xychart":return Oa.createXychartDiagram(w,E,L);case"radar":return Oa.createRadarDiagram(w,E,L);case"c4":return Oa.createC4Diagram(w,E,L);case"architecture":return Oa.createArchitectureDiagram(w,E,L);case"sankey":return Oa.createSankeyDiagram(w,E,L);case"treemap":return Oa.createTreemapDiagram(w,E,L);case"gantt":return Oa.createGanttDiagram(w,E,L);case"venn":return Oa.createVennDiagram(w,E,L);case"ishikawa":return Oa.createIshikawaDiagram(w,E,L);case"treeView":return Oa.createTreeviewDiagram(w,E,L);default:return Oa.createFromElkGraph(w,E)}}catch(s){var p=new Error("Mermaid conversion failed: "+(s&&s.message?s.message:String(s)));throw p.name="MermaidConversionError",p.cause=s,p}};Ya.groupStyle="group;transparentBounds=1;editIcon=1;lockedGroup=0;groupPadding=10;";Ya.wrapGroup=function(L,j,P,E){if(L==null)return L;var w=mxUtils.parseXml(L),p=new mxCodec(w),s=new mxGraphModel;s.maintainEdgeParent=!1,p.decode(w.documentElement,s),s.maintainEdgeParent=!1;var o=s.getRoot();if(o==null)return L;var d=JSON.stringify({data:j,config:P||null},null,2);function M(T,I,F){var X;T.value!=null&&typeof T.value=="object"&&T.value.cloneNode!=null?X=T.value.cloneNode(!0):(X=w.createElement("UserObject"),X.setAttribute("label",T.value!=null?T.value:"")),F!=null?X.setAttribute(I,F):X.removeAttribute(I),s.setValue(T,X)}for(var f=[],u=0;u<s.getChildCount(o);u++)for(var r=s.getChildAt(o,u),h=0;h<s.getChildCount(r);h++)f.push(s.getChildAt(r,h));if(f.length==0)return L;var v=s.getParent(f[0]),n=f;if(f.length>1){var y=r2(s,f);y!=null&&(a2(s,y,f),n=[y])}var b=new mxCell("",new mxGeometry(0,0,0,0),Ya.groupStyle);b.setVertex(!0),b.setConnectable(!1),s.add(v,b);for(var u=0;u<n.length;u++)s.add(b,n[u]);return M(b,"mermaidData",d),E!=null&&E.normalize&&i2(s,b),mxUtils.getXml(new mxCodec().encode(s))};function ks(L,j){var P=L.getGeometry(j);if(P==null)return null;if(L.isEdge(j)){var E=1/0,w=1/0,p=-1/0,s=-1/0;if(P.sourcePoint!=null&&(P.sourcePoint.x<E&&(E=P.sourcePoint.x),P.sourcePoint.y<w&&(w=P.sourcePoint.y),P.sourcePoint.x>p&&(p=P.sourcePoint.x),P.sourcePoint.y>s&&(s=P.sourcePoint.y)),P.targetPoint!=null&&(P.targetPoint.x<E&&(E=P.targetPoint.x),P.targetPoint.y<w&&(w=P.targetPoint.y),P.targetPoint.x>p&&(p=P.targetPoint.x),P.targetPoint.y>s&&(s=P.targetPoint.y)),P.points!=null)for(var o=0;o<P.points.length;o++){var d=P.points[o];d.x<E&&(E=d.x),d.y<w&&(w=d.y),d.x>p&&(p=d.x),d.y>s&&(s=d.y)}return isFinite(E)?{x:E,y:w,w:p-E,h:s-w}:null}return P.width==null||P.height==null?null:{x:P.x||0,y:P.y||0,w:P.width,h:P.height}}function r2(L,j){for(var P=null,E=.5,w=0;w<j.length;w++){var p=j[w];if(L.isVertex(p)){var s=p.style||"",o=s.indexOf("shape=swimlane")>=0||s.indexOf("group;")===0||s==="group";if(o){var d=ks(L,p);if(!(d==null||d.w<=0||d.h<=0)){for(var M=!0,f=0;f<j.length;f++)if(f!==w){var u=ks(L,j[f]);if(u!=null&&(u.x<d.x-E||u.y<d.y-E||u.x+u.w>d.x+d.w+E||u.y+u.h>d.y+d.h+E)){M=!1;break}}if(M)if(P==null)P=p;else{var r=ks(L,P),h=d.w*d.h,v=r.w*r.h;if(h<v)P=p;else if(h===v)return null}}}}}return P}function a2(L,j,P){var E=L.getGeometry(j);if(E!=null)for(var w=E.x||0,p=E.y||0,s=0;s<P.length;s++){var o=P[s];if(o!==j){var d=L.getGeometry(o);if(d!=null){var M=d.clone();if(L.isEdge(o)||(M.x!=null&&(M.x-=w),M.y!=null&&(M.y-=p)),M.sourcePoint!=null&&(M.sourcePoint=new mxPoint(M.sourcePoint.x-w,M.sourcePoint.y-p)),M.targetPoint!=null&&(M.targetPoint=new mxPoint(M.targetPoint.x-w,M.targetPoint.y-p)),M.points!=null&&M.points.length>0){for(var f=[],u=0;u<M.points.length;u++)f.push(new mxPoint(M.points[u].x-w,M.points[u].y-p));M.points=f}L.setGeometry(o,M)}L.add(j,o)}}}function n2(L){var j=/(?:^|;)groupPadding=([^;]*)/.exec(L||"");if(j==null)return{n:0,w:0};for(var P=j[1].trim().split(/\s+/),E=0;E<P.length;E++){var w=parseFloat(P[E]);P[E]=isNaN(w)?0:w}return{n:P[0],w:P.length===1?P[0]:P.length===4?P[3]:P[1]}}function i2(L,j){for(var P=1/0,E=1/0,w=0;w<L.getChildCount(j);w++){var p=L.getChildAt(j,w),s=L.getGeometry(p);if(s!=null){if(L.isVertex(p)&&!s.relative)(s.x||0)<P&&(P=s.x||0),(s.y||0)<E&&(E=s.y||0);else if(L.isEdge(p)){var o=[];L.getTerminal(p,!0)==null&&s.sourcePoint!=null&&o.push(s.sourcePoint),L.getTerminal(p,!1)==null&&s.targetPoint!=null&&o.push(s.targetPoint),s.points!=null&&(o=o.concat(s.points));for(var d=0;d<o.length;d++)o[d]!=null&&(o[d].x<P&&(P=o[d].x),o[d].y<E&&(E=o[d].y))}}}if(!(!isFinite(P)||!isFinite(E))){var M=n2(j.style),f=M.w-P,u=M.n-E;if(!(f===0&&u===0))for(var w=0;w<L.getChildCount(j);w++){var p=L.getChildAt(j,w),s=L.getGeometry(p);if(s!=null){var r=s.clone();if(!L.isEdge(p)&&!r.relative&&(r.x=(r.x||0)+f,r.y=(r.y||0)+u),r.sourcePoint!=null&&(r.sourcePoint=new mxPoint(r.sourcePoint.x+f,r.sourcePoint.y+u)),r.targetPoint!=null&&(r.targetPoint=new mxPoint(r.targetPoint.x+f,r.targetPoint.y+u)),r.points!=null&&r.points.length>0){for(var o=[],d=0;d<r.points.length;d++)o.push(new mxPoint(r.points[d].x+f,r.points[d].y+u));r.points=o}L.setGeometry(p,r)}}}}var o2=Cs;return Ag(s2);})();
/*! For license information please see dagre.min.js.LEGAL.txt */
Mermaid=Mermaid.default;globalThis.MermaidLexer=Mermaid.MermaidLexer;globalThis.MermaidParser=Mermaid.MermaidParser;globalThis.MermaidLayout=Mermaid.MermaidLayout;globalThis.MermaidCellFactory=Mermaid.MermaidCellFactory;globalThis.mxMermaidToDrawio=Mermaid.mxMermaidToDrawio;
/**
@@ -18526,9 +18537,9 @@ g=N;r(s);var Ja=e([null,Ve,_g,vd,Vg,Ug,Sg,Rg,vc,uc,fd,Fg,Cg,vc,Lb,Lb,uc,ug,qg,vc
globalThis.AvoidRouting = AvoidRouting;
})();
var LibavoidRouting={shapeBufferDistance:16,idealNudgingDistance:14,independentRouting:!1,STYLE:"libavoidRouting",LAYOUT_NAME:"orthogonalEdge",SHORTHAND:"libavoid",run:function(a,b,c){var f=function(g){"function"===typeof c&&c(g)},d="undefined"!==typeof window?window.__libavoidReady:null;if(null==d)a.handleError(Error(mxResources.get("libavoidUnavailable"))),f(!1);else{var e=a.spinner;null!=e&&null!=e.spin&&e.spin(document.body,mxResources.get("loading"));d.then(function(g){null!=e&&null!=e.stop&&
-e.stop();if(null==g)a.handleError(Error(mxResources.get("libavoidUnavailable"))),f(!1);else try{var l=a.editor.graph,h={layout:LibavoidRouting.LAYOUT_NAME};null!=b&&(h.config=b);a.lastLayoutSpec=[h];var k=a.getSelectedLayoutContainer();if(null!=k)a.setContainerChildLayout(k,a.lastLayoutSpec),f(!0);else{var p=LibavoidRouting.getTargetEdges(l);a.executeLayout(function(){LibavoidRouting.routeCells(l,g,p,b,!0)},!1,function(){f(!0)})}}catch(m){a.handleError(m),f(!1)}})}},createLayout:function(a,b){var c=
-null!=b?b:null,f=function(e,g){var l=a.getModel();if(null!=d.cellFilter){var h=[];for(var k in l.cells)g=l.cells[k],l.isEdge(g)&&d.cellFilter(g)&&h.push(g)}else if(null!=g&&l.isVertex(g)&&null!=a.getCellStyle(g).childLayout){h=[];var p=function(m){for(var n=0;n<l.getChildCount(m);n++){var q=l.getChildAt(m,n);l.isEdge(q)?h.push(q):p(q)}};p(g)}else h=LibavoidRouting.getTargetEdges(a);LibavoidRouting.routeCells(a,e,h,c,!0)},d={cellFilter:null,moveCell:function(){},resizeCell:function(){},canExecuteSync:function(){return"undefined"!==
-typeof window&&null!=window.Avoid},executeSync:function(e){f(window.Avoid,e)},prepare:function(e,g){var l=function(h){null==h?g(Error(mxResources.get("libavoidUnavailable"))):g(null,function(){f(h,e)})};"undefined"!==typeof window&&null!=window.Avoid?l(window.Avoid):"undefined"!==typeof window&&null!=window.__libavoidReady?window.__libavoidReady.then(l):l(null)}};return d},installAutoRouting:function(a){var b=a.editor.graph,c=b.getModel();"undefined"!==typeof urlParams&&null!=urlParams&&null!=urlParams["libavoid-independent"]&&
+e.stop();if(null==g)a.handleError(Error(mxResources.get("libavoidUnavailable"))),f(!1);else try{var l=a.editor.graph,h={layout:LibavoidRouting.LAYOUT_NAME};null!=b&&(h.config=b);a.lastLayoutSpec=[h];if(a.applyLayoutToSelectedContainers(a.lastLayoutSpec))f(!0);else{var k=LibavoidRouting.getTargetEdges(l);a.executeLayout(function(){LibavoidRouting.routeCells(l,g,k,b,!0)},!1,function(){f(!0)})}}catch(p){a.handleError(p),f(!1)}})}},createLayout:function(a,b){var c=null!=b?b:null,f=function(e,g){var l=
+a.getModel();if(null!=d.cellFilter){var h=[];for(var k in l.cells)g=l.cells[k],l.isEdge(g)&&d.cellFilter(g)&&h.push(g)}else if(null!=g&&l.isVertex(g)&&null!=a.getCellStyle(g).childLayout){h=[];var p=function(m){for(var n=0;n<l.getChildCount(m);n++){var q=l.getChildAt(m,n);l.isEdge(q)?h.push(q):p(q)}};p(g)}else h=LibavoidRouting.getTargetEdges(a);LibavoidRouting.routeCells(a,e,h,c,!0)},d={cellFilter:null,moveCell:function(){},resizeCell:function(){},canExecuteSync:function(){return"undefined"!==typeof window&&
+null!=window.Avoid},executeSync:function(e){f(window.Avoid,e)},prepare:function(e,g){var l=function(h){null==h?g(Error(mxResources.get("libavoidUnavailable"))):g(null,function(){f(h,e)})};"undefined"!==typeof window&&null!=window.Avoid?l(window.Avoid):"undefined"!==typeof window&&null!=window.__libavoidReady?window.__libavoidReady.then(l):l(null)}};return d},installAutoRouting:function(a){var b=a.editor.graph,c=b.getModel();"undefined"!==typeof urlParams&&null!=urlParams&&null!=urlParams["libavoid-independent"]&&
(LibavoidRouting.independentRouting="0"!=urlParams["libavoid-independent"]);var f=function(d){var e=[],g;for(g in d)e.push(d[g]);return e};b.addListener(mxEvent.CELLS_ADDED,function(d,e){d=e.getProperty("cells");if(null!=d){e=Object.create(null);for(var g=[],l=[],h=0;h<d.length;h++)if(LibavoidRouting.isAutoEdge(b,d[h]))e[d[h].getId()]=d[h];else if(c.isVertex(d[h])){l.push(d[h]);var k=LibavoidRouting.getAbsoluteModelBounds(b,d[h]);null!=k&&g.push({x:k.x,y:k.y,width:k.w,height:k.h})}LibavoidRouting.collectOverlappingEdges(b,
g,e);LibavoidRouting.autoReroute(b,f(e),l)}});b.addListener(mxEvent.CELL_CONNECTED,function(d,e){d=e.getProperty("edge");LibavoidRouting.isAutoEdge(b,d)&&LibavoidRouting.autoReroute(b,[d])});null!=b.connectionHandler&&b.connectionHandler.addListener(mxEvent.CONNECT,function(d,e){d=e.getProperty("cell");LibavoidRouting.isAutoEdge(b,d)&&LibavoidRouting.autoReroute(b,[d])});a.addListener("styleChanged",function(d,e){var g=e.getProperty("keys");e=e.getProperty("cells");if(null!=g&&null!=e){var l={portConstraint:!0,
portConstraintRotation:!0,sourcePortConstraint:!0,targetPortConstraint:!0},h=!1;d=!0;var k;for(k=0;k<g.length;k++)l[g[k]]?(h=!0,d=!1):"rotation"==g[k]&&(h=!0);if(h){g=Object.create(null);for(k=0;k<e.length;k++)if(l=e[k],!d&&LibavoidRouting.isAutoEdge(b,l))g[l.getId()]=l;else if(c.isVertex(l)&&(!d||1==mxUtils.getValue(b.getCellStyle(l),"portConstraintRotation",null)))for(h=c.getEdges(l),l=0;l<h.length;l++)LibavoidRouting.isAutoEdge(b,h[l])&&(g[h[l].getId()]=h[l]);LibavoidRouting.autoReroute(b,f(g))}}});
diff --git a/src/main/webapp/js/math-print.js b/src/main/webapp/js/math-print.js
index be365750e..f4485e100 100644
--- a/src/main/webapp/js/math-print.js
+++ b/src/main/webapp/js/math-print.js
@@ -44,7 +44,27 @@
{
if (window.IMMEDIATE_PRINT)
{
- window.print();
+ // Waits for the stylesheets, images and fonts of this
+ // window as in the non-math path (PrintDialog.printPreview)
+ try
+ {
+ if (window.opener != null && window.opener.PrintDialog != null &&
+ window.opener.PrintDialog.waitForResources != null)
+ {
+ window.opener.PrintDialog.waitForResources(window, function()
+ {
+ window.print();
+ }, window.opener.PrintDialog.printTimeout);
+ }
+ else
+ {
+ window.print();
+ }
+ }
+ catch (e)
+ {
+ window.print();
+ }
}
});
}
diff --git a/src/main/webapp/js/plantuml/drawio-plantuml.min.js b/src/main/webapp/js/plantuml/drawio-plantuml.min.js
index 6ee28bcb6..ac355f40f 100644
--- a/src/main/webapp/js/plantuml/drawio-plantuml.min.js
+++ b/src/main/webapp/js/plantuml/drawio-plantuml.min.js
@@ -1,353 +1,373 @@
-var PlantUml=(()=>{var yc=Object.defineProperty;var vv=Object.getOwnPropertyDescriptor;var pv=Object.getOwnPropertyNames;var $v=Object.prototype.hasOwnProperty;var xh=(pr,q)=>{for(var Xr in q)yc(pr,Xr,{get:q[Xr],enumerable:!0})},gv=(pr,q,Xr,Tr)=>{if(q&&typeof q=="object"||typeof q=="function")for(let se of pv(q))!$v.call(pr,se)&&se!==Xr&&yc(pr,se,{get:()=>q[se],enumerable:!(Tr=vv(q,se))||Tr.enumerable});return pr};var Rv=pr=>gv(yc({},"__esModule",{value:!0}),pr);var mv={};xh(mv,{default:()=>Av});var Ec={};xh(Ec,{ActivityLegacyParser:()=>vd,ActivityParser:()=>Cd,ArchimateParser:()=>yd,C4Parser:()=>Ed,ClassParser:()=>pd,ComponentParser:()=>$d,GanttParser:()=>kd,JsonParser:()=>tf,MindmapParser:()=>Ad,NetworkParser:()=>bd,ObjectParser:()=>gd,PlantUml2Drawio:()=>dd,PlantUml2Png:()=>zh,PlantUml2Svg:()=>Gf,PlantUmlCellFactory:()=>of,PlantUmlFurniture:()=>Ba,PlantUmlLexer:()=>Hh,PlantUmlParser:()=>zl,PlantUmlPreprocessor:()=>Lf,PlantUmlSkinParam:()=>fd,PlantUmlStyleSheet:()=>kt,PlantUmlThemes:()=>ef,PlantUmlUnsupported:()=>Eu,PlantUmlWarnings:()=>vo,SaltParser:()=>Fd,SequenceParser:()=>cd,StateParser:()=>hd,TimingParser:()=>_d,UseCaseParser:()=>Rd,WbsParser:()=>md,YamlParser:()=>Od,mxPlantUmlToDrawio:()=>Kh});var Hh=(function(){function pr(q){this.input=q,this.pos=0,this.line=1,this.col=1,this.len=q.length}return pr.prototype.peek=function(q){return this.input[this.pos+(q||0)]||""},pr.prototype.peekStr=function(q){return this.input.substring(this.pos,this.pos+q)},pr.prototype.isEof=function(){return this.pos>=this.len},pr.prototype.advance=function(q){q=q||1;for(var Xr=0;Xr<q&&this.pos<this.len;Xr++)this.input[this.pos]===`
-`?(this.line++,this.col=1):this.col++,this.pos++},pr.prototype.skipInlineWhitespace=function(){for(;this.pos<this.len;){var q=this.input[this.pos];if(q===" "||q===" ")this.pos++,this.col++;else break}},pr.prototype.skipWhitespace=function(){for(;this.pos<this.len;){var q=this.input[this.pos];if(q===" "||q===" "||q==="\r"||q===`
-`)this.advance(1);else break}},pr.prototype.skipLineComment=function(){for(;this.pos<this.len&&this.input[this.pos]!==`
-`;)this.pos++,this.col++},pr.prototype.skipBlockComment=function(){for(this.advance(2);this.pos<this.len-1;){if(this.input[this.pos]==="'"&&this.input[this.pos+1]==="/"){this.advance(2);return}this.advance(1)}this.pos=this.len},pr.prototype.skipWhitespaceAndComments=function(){for(;this.pos<this.len;){var q=this.input[this.pos];if(q===" "||q===" "||q==="\r"||q===`
-`)this.advance(1);else if(q==="'")this.skipLineComment();else if(q==="/"&&this.input[this.pos+1]==="'")this.skipBlockComment();else break}},pr.prototype.readQuotedString=function(){var q=this.input[this.pos];if(q!=='"'&&q!=="'"&&q!=="`")return null;var Xr=this.pos+1,Tr="";for(this.advance(1);this.pos<this.len;){var se=this.input[this.pos];if(se==="\\"&&this.pos+1<this.len)Tr+=this.input[this.pos+1],this.advance(2);else{if(se===q)return this.advance(1),Tr;Tr+=se,this.advance(1)}}return Tr},pr.prototype.readLine=function(){for(var q=this.pos;this.pos<this.len&&this.input[this.pos]!==`
-`;)this.pos++,this.col++;var Xr=this.input.substring(q,this.pos);return this.pos<this.len&&this.advance(1),Xr},pr.prototype.readIdentifier=function(){var q=this.input[this.pos];if(!(q>="a"&&q<="z"||q>="A"&&q<="Z"||q==="_"))return null;for(var Xr=this.pos;this.pos<this.len;){var Tr=this.input[this.pos];if(Tr>="a"&&Tr<="z"||Tr>="A"&&Tr<="Z"||Tr>="0"&&Tr<="9"||Tr==="_")this.pos++,this.col++;else break}return this.input.substring(Xr,this.pos)},{create:function(q){return new pr(q)}}})();var ef=(function(){var pr={},q={};q._none_={author:"The-Lum",license:"PlantUML (Apache-2.0 asl edition)",source:""},pr._none_=[].join(`
-`),q.amiga={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},pr.amiga=['!$THEME = "amiga"',"",'!$BLACK = "#000121"','!$BLUE = "#0B58A8"','!$ORANGE = "#FDA325"','!$RED = "#DB252B"','!$WHITE = "#FFFFFF"',"","!$BGCOLOR = $BLUE","!$FGCOLOR = $WHITE","","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $ORANGE","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","groupHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","node {","MaximumWidth 300","}","referenceHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy nosolid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $BGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $ORANGE","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
-`),q["aws-orange"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr["aws-orange"]=['!$PUML_THEME = "aws-orange"','!$THEME = "aws-orange"','!if %not(%variable_exists("$PUML_BGCOLOR"))','!$PUML_BGCOLOR = "transparent"',"!endif",'!if %not(%variable_exists("$PUML_GRADIENT"))',"!$PUML_GRADIENT = 20","!endif",'!if %not(%variable_exists("$PUML_MODE"))','!$PUML_MODE = "light"',"!endif",'!if %not(%variable_exists("$PUML_OUTLINE"))','!$PUML_OUTLINE = "false"',"!endif","skinparam BackgroundColor $PUML_BGCOLOR","skinparam useBetaStyle false",'!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#868e96"','!$PRIMARY = "#EC7211"','!$WARNING = "#EC7211"','!$LIGHT = "#abb6c2"','!$DARK = "#4E5D6C"','!if ($PUML_MODE == "light")','!$SECONDARY = "#eeeeee"','!$SECONDARY_LIGHT = "ffffff"','!$SUCCESS = "#1D8102"','!$INFO = "#0073bb"','!$DANGER = "#d13212"',"!$SECONDARY_TEXT = $DARK","!$FGCOLOR = $DARK","!$DIAMOND_BD = %darken($SECONDARY, $PUML_GRADIENT)","!assume transparent light","!else",'!$SECONDARY = "#2a2e33"',"!$SECONDARY_LIGHT = %lighten($SECONDARY, $PUML_GRADIENT)",'!$SUCCESS = "#6aaf35"','!$INFO = "#44b9d6"','!$DANGER = "#ff5d64"',"!$SECONDARY_TEXT = $WHITE","!$FGCOLOR = $WHITE","!$DIAMOND_BD = %lighten($SECONDARY, $PUML_GRADIENT)","!assume transparent dark","!endif","!$PRIMARY_DARK = %darken($PRIMARY, $PUML_GRADIENT)","!$PRIMARY_LIGHT = %lighten($PRIMARY, $PUML_GRADIENT)","!$SECONDARY_DARK = %darken($SECONDARY, $PUML_GRADIENT)","!$SUCCESS_DARK = %darken($SUCCESS, $PUML_GRADIENT)","!$SUCCESS_LIGHT = %lighten($SUCCESS, $PUML_GRADIENT)","!$INFO_DARK = %darken($INFO, $PUML_GRADIENT)","!$INFO_LIGHT = %lighten($INFO, $PUML_GRADIENT)","!$DANGER_DARK = %darken($DANGER, $PUML_GRADIENT)","!$DANGER_LIGHT = %lighten($DANGER, $PUML_GRADIENT)","!$WARNING_DARK = %darken($WARNING, $PUML_GRADIENT)","!$WARNING_LIGHT = %lighten($WARNING, $PUML_GRADIENT)","!$DARK_DARK = %darken($DARK, $PUML_GRADIENT)","!$DARK_LIGHT = %lighten($DARK, $PUML_GRADIENT)","!$LIGHT_DARK = %darken($LIGHT, $PUML_GRADIENT)","!$LIGHT_LIGHT = %lighten($LIGHT, $PUML_GRADIENT)","!$INFO_TEXT = $WHITE","!$SUCCESS_TEXT = $WHITE","!$WARNING_TEXT = $WHITE","!$DANGER_TEXT = $WHITE","!$PRIMARY_TEXT = $WHITE","!$HEADER_TEXT = $WHITE",'!if ($PUML_OUTLINE == "true")',"!$HEADER_TEXT = $PRIMARY_TEXT","!$PRIMARY_TEXT = $PRIMARY_LIGHT","!$INFO_TEXT = $INFO_LIGHT","!$WARNING_TEXT = $WARNING_LIGHT","!$DARK_BG = $PUML_BGCOLOR","!$INFO_BG = $PUML_BGCOLOR","!$DANGER_BG = $PUML_BGCOLOR","!$WARNING_BG = $PUML_BGCOLOR","!$SECONDARY_BG = $PUML_BGCOLOR","!else","!$DARK_BG = $DARK","!$INFO_BG = $INFO","!$DANGER_BG = $DANGER","!$WARNING_BG = $WARNING","!$SECONDARY_BG = $SECONDARY","!endif","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","!procedure $primary_scheme()",'!if ($PUML_OUTLINE == "true")',"FontColor $PRIMARY","BorderColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","!else","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endif","!endprocedure","!procedure $secondary_scheme()",'!if ($PUML_OUTLINE == "true")',"FontColor $SECONDARY_DARK","BorderColor $SECONDARY_DARK","BackgroundColor $PUML_BGCOLOR","!else","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","!endif","!endprocedure",'!_POST = "<color #007a3e>POST</color>"','!_PUT = "<color #ea7400>PUT</color>"','!_DELETE = "<color #cf2a2a>DELETE</color>"','!_GET = "<color #009fdb>GET</color>"','!_PATCH = "<color #b5bd00>PATCH</color>"','!_HEAD = "<color #9012fe>HEAD</color>"','skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","","skinparam legend {","$secondary_scheme()","BackgroundColor transparent","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","' <style> ","' mindmapDiagram {","' Padding 15","' Margin 10","' FontSize 12","' FontName Verdana","' Shadowing 0.0","' LineThickness 1.5","' FontColor $PRIMARY_TEXT","' LineColor $PRIMARY_DARK","' node {","' LineColor $PRIMARY","' BackGroundColor $PRIMARY_LIGHT-$PRIMARY","' }","' }","' </style>","","!startsub activity","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_BG","DiamondBorderColor $DIAMOND_BD","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","skinparam actor {","$primary_scheme()","FontColor $FGCOLOR","}","!endsub","","!startsub arrow","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","skinparam sequence {","ArrowThickness 3","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $PUML_BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $LIGHT","LifeLineBorderThickness 2","LifeLineBackgroundColor $LIGHT_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupBodyBackgroundColor $PUML_BGCOLOR","GroupHeaderBackgroundColor $PUML_BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $PUML_BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","StereotypeFontSize 12","}","!endsub","","!startsub partition","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","}","!endsub","","!startsub collections","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","skinparam note {","BorderThickness 1","BackgroundColor $INFO_BG","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub artifact","skinparam artifact {","BackgroundColor $DARK_BG","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","skinparam storage {","BackgroundColor $WARNING_BG","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","skinparam node {","BackgroundColor $PUML_BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","skinparam cloud {","BackgroundColor transparent","BorderColor $DARK","FontColor $FGCOLOR","}","!endsub","","!startsub database","skinparam database {","$primary_scheme()","FontColor $FGCOLOR","StereotypeFontColor $FGCOLOR","}","!endsub","","!startsub class","skinparam class {","$primary_scheme()","FontColor $HEADER_TEXT","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub object","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","skinparam rectangle {","BackgroundColor $PUML_BGCOLOR","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_TEXT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","skinparam package {","BackgroundColor $PUML_BGCOLOR","BorderColor $SECONDARY_TEXT","FontColor $SECONDARY_TEXT","BorderThickness 2","}","!endsub","","!startsub folder","skinparam folder {","BackgroundColor $SECONDARY_BG","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","skinparam frame {","BackgroundColor $SECONDARY_BG","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","skinparam card {","BackgroundColor $INFO_BG","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","skinparam file {","BackgroundColor $SECONDARY_BG","BorderColor $LIGHT","FontColor $FGCOLOR","}","!endsub","","!startsub stack","skinparam stack {","$primary_scheme()","}","!endsub","","!startsub map","skinparam map {","$primary_scheme()","}","!endsub","","<style>","participant {","Margin 5 40","Padding 15 20","}","wbsDiagram, mindmapDiagram {","root {","BackgroundColor $PUML_BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $INFO_BG","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","$primary_scheme()","Padding 15","RoundCorner 20","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY_BG","FontColor $INFO_BG","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $PUML_BGCOLOR","FontColor $DARK_BG","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $PUML_BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_BG","FontColor $PRIMARY_TEXT","BorderColor $SECONDARY_BG","}","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY_BG","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT_BG","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY_BG","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO_BG","}","separator {","LineColor $SECONDARY_BG","BackGroundColor $secondary_scheme()","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO_BG","FontSize 16","FontStyle italic","BackGroundColor $DIAMOND_BG","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY_BG","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>"].join(`
-`),q["black-knight"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr["black-knight"]=['!$THEME = "black-knight"',"!assume transparent dark",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif",'!if %not(%variable_exists("$GRADIENT"))',"!$GRADIENT = 20","!endif","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false",'!$PRIMARY = "#303030"',"!$PRIMARY_DARK = %darken($PRIMARY, $GRADIENT)","!$PRIMARY_LIGHT = %lighten($PRIMARY, $GRADIENT)",'!$PRIMARY_TEXT = "#fff200"','!$SECONDARY = "#484848"',"!$SECONDARY_DARK = %darken($SECONDARY, $GRADIENT)","!$SECONDARY_LIGHT = %lighten($SECONDARY, $GRADIENT)",'!$SECONDARY_TEXT = "#fefefe"','!$SUCCESS = "#00FF00"',"!$SUCCESS_DARK = %darken($SUCCESS, $GRADIENT)","!$SUCCESS_LIGHT = %lighten($SUCCESS, $GRADIENT)",'!$SUCCESS_TEXT = "ffffff"','!$INFO = "#0060a8"',"!$INFO_DARK = %darken($INFO, $GRADIENT)","!$INFO_LIGHT = %lighten($INFO, $GRADIENT)",'!$INFO_TEXT = "ffffff"','!$WARNING = "#ff8000"',"!$WARNING_DARK = %darken($WARNING, $GRADIENT)","!$WARNING_LIGHT = %lighten($WARNING, $GRADIENT)",'!$WARNING_TEXT = "#222222"','!$DANGER = "#ff0000"',"!$DANGER_DARK = %darken($DANGER, $GRADIENT)","!$DANGER_LIGHT = %lighten($DANGER, $GRADIENT)",'!$DANGER_TEXT = "ffffff"','!$LIGHT = "#fff200"','!$DARK = "#484848"',"!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","!procedure $info($msg)","<font color=$INFO><b>$msg","!endprocedure","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","!endprocedure","!procedure $secondary_scheme()","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","!endprocedure","","skinparam {",'defaultFontName "Verdana"',"defaultFontSize 12","defaultTextAlignment center","shadowing false","RoundCorner 10","TitleFontSize 18","' TitleFontColor $PRIMARY_TEXT","}","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","","skinparam title {","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $PRIMARY","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupBodyBackgroundColor $BGCOLOR","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $SECONDARY_TEXT","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_LIGHT","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub artifact","skinparam artifact {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub component","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING_DARK","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY_LIGHT","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub cloud","skinparam cloud {","BackgroundColor transparent","BorderColor $PRIMARY_LIGHT","FontColor $LIGHT","}","!endsub","","!startsub database","skinparam database {","$primary_scheme()","BackgroundColor $BGCOLOR","}","!endsub","","!startsub class","skinparam class {","$primary_scheme()","HeaderBackgroundColor $SECONDARY_DARK-$SECONDARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","skinparam rectangle {","$primary_scheme()","BackgroundColor $BGCOLOR","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","skinparam package {","$primary_scheme()","BackgroundColor $BGCOLOR","BorderThickness 2","}","!endsub","","!startsub folder","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $INFO","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub stack","skinparam stack {","$primary_scheme()","}","!endsub","",'!if %variable_exists("NEWSTYLE")',"<>","wbsDiagram {","LineColor $PRIMARY","BorderThickness 3","BackgroundColor $LIGHT","FontColor $PRIMARY_TEXT",":depth(0) {","fontSize 16","fontStyle bold","fontColor $SECONDARY","}",":depth(1) {","fontSize 14","padding 5","fontStyle bold","}",":depth(2) {","fontSize 12","padding 4","}",":depth(3) {","fontSize 11","padding 3","fontColor $INFO","}","","}","</>","!endif"].join(`
-`),q.bluegray={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.bluegray=['!$THEME = "bluegray"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$WHITE = "#fff"','!$GRAY_DARK = "#5a5a5a"','!$GRAY = "#959595"','!$PRIMARY = "#009fdb"','!$SECONDARY = "#f2f2f2"','!$SUCCESS = "#b5bd00"','!$INFO = "#0568ae"','!$WARNING = "#ea7400"','!$DANGER = "#cf2a2a"','!$LIGHT = "#d2d2d2"','!$DARK = "#5a5a5a"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#33b2e2"','!$PRIMARY_DARK = "#007faf"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_LIGHT = "#f5f5f5"','!$SECONDARY_DARK = "#c2c2c2"',"!$SECONDARY_TEXT = $DARK",'!$INFO_LIGHT = "#3786be"','!$INFO_DARK = "#04538b"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_LIGHT = "#c4ca33"','!$SUCCESS_DARK = "#919700"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_LIGHT = "#ee9033"','!$WARNING_DARK = "#bb5d00"',"!$WARNING_TEXT = $WHITE",'!$DANGER_LIGHT = "#d95555"','!$DANGER_DARK = "#a62222"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_LIGHT","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","","!endprocedure","","!procedure $secondary_scheme()","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","BackgroundColor $WHITE-#fefefe","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 30","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 20","skinparam BoxPadding 40","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $WHITE-$LIGHT","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY_DARK","FontColor $PRIMARY","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $PRIMARY","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","' FontColor $PRIMARY","BorderColor $PRIMARY_DARK","' BackgroundColor $BGCOLOR","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$secondary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","FontColor $PRIMARY","BorderColor $PRIMARY_LIGHT","BackgroundColor $BGCOLOR","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $INFO","FontColor $SECONDARY_TEXT","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.blueprint={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},pr.blueprint=['!$THEME = "blueprint"',"",'!$BGCOLOR = "#003153"','!$FGCOLOR = "#D9D3D0"',"","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $FGCOLOR","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","node {","MaximumWidth 300","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy nosolid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $FGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $FGCOLOR","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
-`),q["carbon-gray"]={author:"Bharat Rajagopalan",license:"PlantUML (Apache-2.0 asl edition)",source:""},pr["carbon-gray"]=['!$THEME = "carbon-gray"',"",`'!$BGCOLOR = "#f5f5f5"`,"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","","!$RED_80 = '#750e13'","!$RED_70 = '#a2191f'","!$RED_60 = '#da1e28'","!$RED_50 = '#fa4d56'","!$RED_40 = '#ff8389'","!$RED_30 = '#ffb3b8'","!$RED_20 = '#ffd7d9'","!$RED_10 = '#fff1f1'","","!$CYAN_10 = '#e5f6ff'","!$CYAN_20 = '#bae6ff'","!$CYAN_30 = '#82cfff'","!$CYAN_40 = '#33b1ff'","!$CYAN_50 = '#1192e8'","!$CYAN_60 = '#0072c3'","!$CYAN_70 = '#00539a'","!$CYAN_80 = '#003a6d'","","!$PURPLE_80 ='#491d8b'","!$PURPLE_70 = '#6929c4'","!$PURPLE_60 = '#8a3ffc'","!$PURPLE_50 = '#a56eff'","!$PURPLE_40 = '#be95ff'","!$PURPLE_30 = '#d4bbff'","!$PURPLE_20 = '#e8daff'","!$PURPLE_10 = '#f6f2ff'","","!$TEAL_10 = '#d9fbfb'","!$TEAL_20 = '#9ef0f0'","!$TEAL_30 = '#3ddbd9'","!$TEAL_40 = '#08bdba'","!$TEAL_50 = '#009d9a'","!$TEAL_60 = '#007d79'","!$TEAL_70 = '#005d5d'","!$TEAL_80 = '#004144'","","!$GRAY_10 = '#f4f4f4'","!$GRAY_20 = '#e0e0e0'","!$GRAY_30 = '#c6c6c6'","!$GRAY_40 = '#a8a8a8'","!$GRAY_50 = '#8d8d8d'","!$GRAY_60 = '#6f6f6f'","!$GRAY_70 = '#525252'","!$GRAY_80 = '#393939'","!$GRAY_90 = '#262626'","!$GRAY_100 = '#161616'","!$WHITE = '#FFFFF'","","!$GRAY_DARK = $GRAY_100","!$GRAY = $GRAY_30","!$LIGHT = $GRAY_70","!$DARK = $GRAY_90","","!$FGCOLOR = $DARK","!$PRIMARY = $GRAY_10","!$PRIMARY_LIGHT = $GRAY_10 ","!$PRIMARY_DARK = $GRAY_30","!$PRIMARY_TEXT = $DARK","!$SECONDARY = $GRAY_10 ","!$SECONDARY_LIGHT = $GRAY_10","!$SECONDARY_DARK = $GRAY_30","!$SECONDARY_TEXT = $DARK","!$INFO = $WHITE","!$INFO_LIGHT = $GRAY_20","!$INFO_DARK = $GRAY_30","!$INFO_TEXT = $DARK","!$SUCCESS = $DARK","!$SUCCESS_LIGHT = $DARK","!$SUCCESS_DARK = $DARK","!$SUCCESS_TEXT = $WHITE","!$WARNING = $WHITE","!$WARNING_LIGHT = $WHITE","!$WARNING_DARK = $WHITE","!$WARNING_TEXT = $DARK","!$DANGER = $WHITE","!$DANGER_LIGHT = $WHITE","!$DANGER_DARK = $WHITE","!$DANGER_TEXT = $DARK","","!$OTHER_BG = $WHITE","!$DB_BG = $GRAY","!$LINE_THICKNESS = 1","!$BORDER_THICKNESS = 1","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","RoundCorner 0","!endprocedure","",'skinparam defaultFontName "IBM Plex Sans, Noto Sans, Verdana"',"skinparam defaultFontSize 12","'skinparam dpi 125","skinparam shadowing false","skinparam roundcorner 0","skinparam BoxPadding 30","skinparam ArrowColor $GRAY","<style>","participant {","Margin 5 30","Padding 15 20","}","</style>","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY","FontSize 20","BorderRoundCorner 8","BorderThickness 0","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $OTHER_BG","BorderColor $DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $PRIMARY","BorderThickness $LINE_THICKNESS","TitleBackgroundColor $PRIMARY_LIGHT-$PRIMARY","TitleFontColor $PRIMARY_TEXT","BackgroundColor $BG_COLOR","TitleFontStyle bold","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $DARK","StartColor $LIGHT-$DARK","EndColor $LIGHT-$DARK","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY","DiamondBorderColor $SECONDARY","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness $BORDER_THICKNESS","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness $LINE_THICKNESS","Color $GRAY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY_DARK","' For some reason sequence title font color does not pick up from global","TitleFontColor $SECONDARY_TEXT","BackgroundColor $OTHER_BG","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $OTHER_BG","BoxBorderColor $PRIMARY_DARK","BoxFontColor $PRIMARY_TEXT","DelayFontColor $PRIMARY_TEXT","LifeLineBorderColor $PRIMARY_DARK","LifeLineBorderThickness $LINE_THICKNESS","LifeLineBackgroundColor $PRIMARY","GroupBorderColor $PRIMARY_DARK","GroupFontColor $PRIMARY_TEXT","GroupFontStyle bold","GroupHeaderFontColor $INFO_TEXT","GroupBackgroundColor $PRIMARY","GroupBodyBackgroundColor $OTHER_BG","GroupHeaderBackgroundColor $PRIMARY","DividerBackgroundColor $PRIMARY","DividerBorderColor $PRIMARY_DARK","DividerBorderThickness $LINE_THICKNESS","DividerFontColor $PRIMARY_TEXT","ReferenceBackgroundColor $BGCOLOR","ReferenceHeaderBorderColor $PRIMARY_DARK","ReferenceHeaderBackgroundColor $PRIMARY","ReferenceBorderColor $PRIMARY_DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO_TEXT","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_TEXT","BackgroundColor $OTHER_BG","fontStyle bold","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $PRIMARY_LIGHT","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","RoundCorner 0","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $DARK","FontColor $INFO_TEXT","RoundCorner 0","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $PRIMARY","BorderColor $PRIMARY_DARK","FontColor $DARK","RoundCorner 0","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","BackgroundColor $PRIMARY","BorderColor $PRIMARY_DARK","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $PRIMARY_DARK","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $OTHER_BG","BorderColor $DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","Roundcorner 0","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","Roundcorner 0","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","BorderColor $PRIMARY_DARK","BackgroundColor $OTHER_BG","Roundcorner 0","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $PRIMARY_TEXT","StereotypeFontSize 9","BorderThickness $LINE_THICKNESS","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $PRIMARY_TEXT","BorderThickness $BORDER_THICKNESS","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness $BORDER_THICKNESS","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $OTHER_BG","BorderThickness $BORDER_THICKNESS","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BackgroundColor $OTHER_BG","BorderThickness $BORDER_THICKNESS","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $WARNING_TEXT","BorderThickness $BORDER_THICKNESS","Roundcorner 0","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $DARK","BorderThickness $BORDER_THICKNESS","Roundcorner 0","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $INFO_TEXT","RoundCorner 0","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","RoundCorner 0","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub","","!startsub person","","skinparam person {","$primary_scheme()","}","!endsub","",'!if (%variable_exists("LEGACY"))','!$LEGACY = "true"',"!endif","",'!if (%getenv("LEGACY") == "true")','!$LEGACY = "true"',"!endif","",`'!if (not %variable_exists("$LEGACY"))`,"","skinparam useBetaStyle true","","!startsub mindmap","","<style>","","boardDiagram {","node {","$primary_scheme()","BackGroundColor $PRIMARY","LineColor $PRIMARY_DARK",'FontName "IBM Plex Sans, Noto Sans, Verdana"',"'FontColor ","FontSize 12","'FontStyle bold","RoundCorner 0","'LineThickness 2","'LineStyle 10-5","separator {","LineThickness $LINE_THICKNESS","LineColor $PRIMARY_DARK","'LineStyle 1-5","}","}","}","","ganttDiagram {","","task {","BackGroundColor $PRIMARY","LineColor $PRIMARY_DARK","FontStyle Bold","FontSize 12","unstarted {","BackGroundColor $PRIMARY_LIGHT","LineColor $PRIMARY_DARK","'FontColor $RED_80","}","Padding 3","Margin 3","","}","timeline {","LineColor $PRIMARY","FontColor $WHITE","BackgroundColor $DARK","FontName Helvetica","'FontSize 12","FontStyle bold","YearFontColor $WHITE","QuarterFontColor $WHITE","MonthFontColor $WHITE","WeekFontColor $WHITE","WeekdayFontColor $WHITE","DayFontColor $WHITE","}","arrow {","'FontName Helvetica","'FontColor red","FontSize 12","FontStyle bold","'BackGroundColor GreenYellow","LineColor $PRIMARY_DARK","'LineStyle 8.0-13.0","'LineThickness 3.0","}","","milestone {","FontColor $PRIMARY_TEXT","FontSize 12","FontStyle bold","BackGroundColor $DARK","LineColor $DARK","}","separator {","BackgroundColor $PRIMARY","'LineStyle 8.0-3.0","LineColor $PRIMARY","LineThickness 1.0","FontSize 12","FontStyle bold","FontColor $PRIMARY_TEXT","Margin 3","'Padding 20","}","closed {","BackgroundColor $RED_20","FontColor $RED_20","}","}","","jsonDiagram {","node {","$primary_scheme()","BackGroundColor $PRIMARY","LineColor $PRIMARY_DARK",'FontName "IBM Plex Sans, Noto Sans, Verdana"',"'FontColor ","FontSize 12","'FontStyle bold","RoundCorner 0","'LineThickness 2","'LineStyle 10-5","separator {","LineThickness $LINE_THICKNESS","LineColor $PRIMARY_DARK","'LineStyle 1-5","}","}","arrow {","BackGroundColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","LineThickness $LINE_THICKNESS","LineStyle 3-6","}","highlight {","BackGroundColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","FontStyle italic","}","}","","mindmapDiagram {","'Padding 8","'Margin 8","LineThickness $LINE_THICKNESS","FontColor $PRIMARY_TEXT","LineColor $PRIMARY_DARK","'BackgroundColor $PRIMARY_LIGHT-$PRIMARY","Roundcorner 0","node {","'Padding 12","'Margin 3","'HorizontalAlignment center","LineColor $PRIMARY_DARK","LineThickness $BORDER_THICKNESS","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","RoundCorner 0","MaximumWidth 100","FontColor $DARK","'FontStyle bold","}","}","","'Salt Diagram only has limited skinning","saltDiagram {","BackGroundColor $BG_COLOR","'Fontname Monospaced","'FontSize 10","'FontStyle italic","'LineThickness 0.5","'LineColor PRIMARY_DARK","}","","timingDiagram {","document {","BackGroundColor $BG_COLOR","LineColor $PRIMARY","BorderColor $PRIMARY","FontColor $PRIMARY_TEXT","","}","highlight {","BackGroundColor $PRIMARY","}","","constraintArrow {","'LineStyle 2-1","LineThickness 2","LineColor $RED_80","FontColor $RED_80","FontStyle bold","}","}","","wbsDiagram {","'Padding 8","node {","'Padding 12","'Margin 3","'HorizontalAlignment center","LineColor $PRIMARY_DARK","LineThickness $BORDER_THICKNESS","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","RoundCorner 0","MaximumWidth 100","FontColor $PRIMARY_TEXT","'FontStyle bold","}","'Margin 8","'LineThickness $LINE_THICKNESS","'FontColor $PRIMARY_TEXT","'LineColor $PRIMARY","'BorderColor $PRIMARY","'BackgroundColor $PRIMARY_LIGHT-$PRIMARY","'RoundCorner 0","","arrow {",`' note that Connectors are actually "Arrows"; this may change in the future`,"' so this means all Connectors and Arrows are now going to be green","","lineColor $PRIMARY_DARK","fontColor $PRIMARY_TEXT","thickness $LINE_THICKNESS","}","","noteBorderColor $DARK","}","","'Placeholder for adding wirediagram skins","wireDiagram {","}","","yamlDiagram {","node {","$primary_scheme()","BackGroundColor $PRIMARY","LineColor $PRIMARY_DARK",'FontName "IBM Plex Sans, Noto Sans, Verdana"',"'FontColor ","FontSize 12","'FontStyle bold","RoundCorner 0","'LineThickness 2","'LineStyle 10-5","separator {","LineThickness $LINE_THICKNESS","LineColor $PRIMARY_DARK","'LineStyle 1-5","}","}","arrow {","BackGroundColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","LineThickness $LINE_THICKNESS","LineStyle 3-6","}","highlight {","BackGroundColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","FontStyle italic","}","}","</style>","!endsub","'!endif"].join(`
-`),q.cerulean={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.cerulean=['!$THEME = "cerulean"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#033C73"','!$INDIGO = "#6610F2"','!$PURPLE = "#6F42C1"','!$PINK = "#E83E8C"','!$RED = "#C71C22"','!$ORANGE = "#FD7E14"','!$YELLOW = "#DD5600"','!$GREEN = "#73A839"','!$TEAL = "#20C997"','!$CYAN = "#2FA4E7"','!$WHITE = "#FFF"','!$GRAY_DARK = "#343A40"','!$GRAY = "#868E96"','!$PRIMARY = "#2FA4E7"','!$SECONDARY = "#E9ECEF"','!$SUCCESS = "#73A839"','!$INFO = "#033C73"','!$WARNING = "#DD5600"','!$DANGER = "#C71C22"','!$LIGHT = "#F8F9FA"','!$DARK = "#343A40"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#59B6EC"','!$PRIMARY_DARK = "#2683B9"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_LIGHT = "#EDF0F2"','!$SECONDARY_DARK = "#BABDBF"',"!$SECONDARY_TEXT = $DARK",'!$INFO_LIGHT = "#35638F"','!$INFO_DARK = "#02305C"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_LIGHT = "#8FB961"','!$SUCCESS_DARK = "#5C862E"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_LIGHT = "#E47833"','!$WARNING_DARK = "#B14500"',"!$WARNING_TEXT = $WHITE",'!$DANGER_LIGHT = "#D2494E"','!$DANGER_DARK = "#9F161B"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $WHITE-$SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $WHITE-$LIGHT","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $PRIMARY","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","FontColor $PRIMARY","BorderColor $PRIMARY_LIGHT","BackgroundColor $BGCOLOR","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","FontColor $PRIMARY","BorderColor $PRIMARY_LIGHT","BackgroundColor $BGCOLOR","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $INFO","FontColor $GRAY","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q["cerulean-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr["cerulean-outline"]=['!$THEME = "cerulean-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#033C73"','!$INDIGO = "#6610F2"','!$PURPLE = "#6F42C1"','!$PINK = "#E83E8C"','!$RED = "#C71C22"','!$ORANGE = "#FD7E14"','!$YELLOW = "#DD5600"','!$GREEN = "#73A839"','!$TEAL = "#20C997"','!$CYAN = "#2FA4E7"','!$WHITE = "#FFF"','!$GRAY_DARK = "#343A40"','!$GRAY = "#868E96"','!$PRIMARY = "#2FA4E7"','!$SECONDARY = "#E9ECEF"','!$SUCCESS = "#73A839"','!$INFO = "#033C73"','!$WARNING = "#DD5600"','!$DANGER = "#C71C22"','!$LIGHT = "#F8F9FA"','!$DARK = "#343A40"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#59B6EC"','!$PRIMARY_DARK = "#2683B9"',"!$PRIMARY_TEXT = $PRIMARY",'!$SECONDARY_LIGHT = "#EDF0F2"','!$SECONDARY_DARK = "#BABDBF"',"!$SECONDARY_TEXT = $SECONDARY_DARK",'!$INFO_LIGHT = "#35638F"',"!$INFO_TEXT = $INFO",'!$SUCCESS_LIGHT = "#8FB961"',"!$SUCCESS_TEXT = $SUCCESS",'!$WARNING_LIGHT = "#E47833"',"!$WARNING_TEXT = $WARNING",'!$DANGER_LIGHT = "#D2494E"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $BGCOLOR","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO_TEXT","DividerBackgroundColor $LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO_TEXT","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $BGCOLOR","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $SUCCESS","' FontColor $SUCCESS_TEXT","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $LIGHT","HeaderBackgroundColor $PRIMARY-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub","",'!if (%variable_exists("LEGACY"))','!$LEGACY = "true"',"!endif","",'!if (%getenv("LEGACY") == "true")','!$LEGACY = "true"',"!endif","",'!if (%variable_exists("$LEGACY"))',"","skinparam useBetaStyle true","","!startsub mindmap","","<style>","style mindmapDiagram {","'Padding 8","Margin 8","LineThickness 2.0","FontColor $PRIMARY_TEXT","LineColor $SECONDARY","BackGroundColor $PRIMARY_LIGHT-$PRIMARY","}","wbsDiagram {","'Padding 8","Margin 8","LineThickness 2.0","FontColor $PRIMARY_TEXT","LineColor $PRIMARY","BackGroundColor $PRIMARY_LIGHT-$PRIMARY","}","</style>","!endsub","!endif"].join(`
-`),q["cloudscape-design"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr["cloudscape-design"]=[`'!$PUML_OUTLINE = "true"`,`'!$PUML_BGCOLOR = "#0f1b2a"`,`'!$PUML_MODE = "dark"`,'!$PUML_THEME = "cloudscape-design"','!$THEME = "cloudscape-design"','!if %not(%variable_exists("$PUML_BGCOLOR"))','!$PUML_BGCOLOR = "transparent"',"!endif",'!if %not(%variable_exists("$PUML_GRADIENT"))',"!$PUML_GRADIENT = 20","!endif",'!if %not(%variable_exists("$PUML_MODE"))','!$PUML_MODE = "light"',"!endif",'!if %not(%variable_exists("$PUML_OUTLINE"))','!$PUML_OUTLINE = "false"',"!endif","skinparam BackgroundColor $PUML_BGCOLOR","skinparam useBetaStyle false",'!$ALPHA = "80"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#868e96"','!$PRIMARY = "#0972d3"','!$WARNING = "#ecdd00"','!$LIGHT = "#d1d5db"','!$DARK = "#000716"','!$SECONDARY_TEXT = "#539fe5"','!if ($PUML_MODE == "light")',"!$PRIMARY_TEXT = $LIGHT",'!$SECONDARY = "#eeeeee"',"!$SECONDARY_LIGHT = %lighten($SECONDARY, $PUML_GRADIENT)",'!$SUCCESS = "#037f0c"','!$INFO = "#0972d3"','!$DANGER = "#d91515"',"!$SECONDARY_TEXT = $DARK","!$FGCOLOR = $DARK","!$DIAMOND_BD = %darken($SECONDARY, $PUML_GRADIENT)","!$GRAY_LIGHT = %lighten($GRAY, $PUML_GRADIENT)","!$GRAY_DARK = %darken($GRAY, $PUML_GRADIENT)","!$MAIN_BG = $WHITE","!assume transparent light","!else","!$TMP = $LIGHT","!$LIGHT = $DARK","!$DARK = $TMP",'!$PRIMARY = "#539fe5"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY = "#2a2e33"',"!$SECONDARY_LIGHT = %lighten($SECONDARY, $PUML_GRADIENT)",'!$SUCCESS = "#037f0c"','!$INFO = "#0972d3"','!$DANGER = "#ff5d64"','!$WARNING = "#fbf8cc"',"!$SECONDARY_TEXT = $WHITE","!$FGCOLOR = $WHITE","!$DIAMOND_BD = %lighten($SECONDARY, $PUML_GRADIENT)","!$GRAY_LIGHT = %darken($GRAY, $PUML_GRADIENT)","!$GRAY_DARK = %lighten($GRAY, $PUML_GRADIENT)",'!$MAIN_BG = "#0f1b2a"',"!assume transparent dark","!endif","!$PRIMARY_DARK = %darken($PRIMARY, $PUML_GRADIENT)","!$PRIMARY_LIGHT = %lighten($PRIMARY, $PUML_GRADIENT)","!$SECONDARY_DARK = %darken($SECONDARY, $PUML_GRADIENT)","!$SUCCESS_DARK = %darken($SUCCESS, $PUML_GRADIENT)","!$SUCCESS_LIGHT = %lighten($SUCCESS, $PUML_GRADIENT)","!$INFO_DARK = %darken($INFO, $PUML_GRADIENT)","!$INFO_LIGHT = %lighten($INFO, $PUML_GRADIENT)","!$DANGER_DARK = %darken($DANGER, $PUML_GRADIENT)","!$DANGER_LIGHT = %lighten($DANGER, $PUML_GRADIENT)","!$WARNING_DARK = %darken($WARNING, $PUML_GRADIENT)","!$WARNING_LIGHT = %lighten($WARNING, $PUML_GRADIENT)","!$DARK_DARK = %darken($DARK, $PUML_GRADIENT)","!$DARK_LIGHT = %lighten($DARK, $PUML_GRADIENT)","!$LIGHT_DARK = %darken($LIGHT, $PUML_GRADIENT)","!$LIGHT_LIGHT = %lighten($LIGHT, $PUML_GRADIENT)","!$INFO_TEXT = $WHITE","!$SUCCESS_TEXT = $WHITE","!$WARNING_TEXT = $WHITE","!$DANGER_TEXT = $WHITE","!$HEADER_TEXT = $WHITE",'!if ($PUML_OUTLINE == "true")',"!$HEADER_TEXT = $PRIMARY_TEXT","!$PRIMARY_TEXT = $PRIMARY_LIGHT","!$INFO_TEXT = $INFO","!$WARNING_TEXT = $WARNING_LIGHT","!$DARK_BG = $PUML_BGCOLOR","!$INFO_BG = $PUML_BGCOLOR","!$DANGER_BG = $PUML_BGCOLOR","!$WARNING_BG = $PUML_BGCOLOR","!$SECONDARY_BG = $PUML_BGCOLOR","!else","!$DARK_BG = $DARK","!$INFO_BG = $INFO","!$DANGER_BG = $DANGER","!$WARNING_BG = $WARNING","!$SECONDARY_BG = $SECONDARY","!endif","!unquoted function $alpha($color, $alpha) !return $color + $alpha","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","!procedure $primary_scheme()",'!if ($PUML_OUTLINE == "true")',"FontColor $PRIMARY","BorderColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","!else","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endif","!endprocedure","!procedure $secondary_scheme()",'!if ($PUML_OUTLINE == "true")',"FontColor $SECONDARY_DARK","BorderColor $SECONDARY_DARK","BackgroundColor $PUML_BGCOLOR","!else","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","!endif","!endprocedure",'!_POST = "<color #007a3e>POST</color>"','!_PUT = "<color #ea7400>PUT</color>"','!_DELETE = "<color #cf2a2a>DELETE</color>"','!_GET = "<color #009fdb>GET</color>"','!_PATCH = "<color #b5bd00>PATCH</color>"','!_HEAD = "<color #9012fe>HEAD</color>"','skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","","skinparam legend {","$secondary_scheme()","BackgroundColor transparent","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_BG","DiamondBorderColor $DIAMOND_BD","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","skinparam actor {","$primary_scheme()","FontColor $FGCOLOR","}","!endsub","","!startsub arrow","skinparam arrow {","Thickness 2","Color $GRAY_LIGHT","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","skinparam sequence {","ArrowThickness 2","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $alpha($PUML_BGCOLOR, $ALPHA)","BoxBorderColor $GRAY_DARK","BoxFontColor $GRAY_DARK","DelayFontColor $LIGHT","LifeLineBorderColor $PRIMARY","LifeLineBorderThickness 0","LifeLineBackgroundColor $SECONDARY","GroupBorderColor $DARK","GroupBorderThickness 1","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $alpha($SECONDARY, $ALPHA)","GroupBodyBackgroundColor $alpha($PUML_BGCOLOR, $ALPHA)","GroupHeaderBackgroundColor $PUML_BGCOLOR","DividerBackgroundColor $SECONDARY","DividerBorderColor $SECONDARY_LIGHT","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceAlignment left","ReferenceBackgroundColor $alpha($PUML_BGCOLOR, $ALPHA)","ReferenceBorderColor $SECONDARY","ReferenceBorderThickness 2","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $alpha($SECONDARY, $ALPHA)","StereotypeFontColor $PRIMARY_TEXT","StereotypeFontSize 12","}","!endsub","","!startsub partition","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","}","!endsub","","!startsub collections","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $GRAY","}","!endsub","","!startsub note","skinparam note {","BorderThickness 1","BackgroundColor $INFO_BG","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub artifact","skinparam artifact {","BackgroundColor $DARK_BG","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","skinparam storage {","BackgroundColor $WARNING_BG","BorderColor $WARNING_DARK","FontColor $GRAY","}","!endsub","","!startsub node","skinparam node {","BackgroundColor $PUML_BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","skinparam cloud {","BackgroundColor transparent","BorderColor $DARK","FontColor $FGCOLOR","}","!endsub","","!startsub database","skinparam database {","$primary_scheme()","FontColor $FGCOLOR","StereotypeFontColor $FGCOLOR","}","!endsub","","!startsub class","skinparam class {","$primary_scheme()","FontColor $HEADER_TEXT","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub object","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","skinparam rectangle {","BackgroundColor $PUML_BGCOLOR","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_TEXT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","skinparam package {","BackgroundColor $PUML_BGCOLOR","BorderColor $SECONDARY_TEXT","FontColor $SECONDARY_TEXT","BorderThickness 2","}","!endsub","","!startsub folder","skinparam folder {","BackgroundColor $SECONDARY_BG","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","skinparam frame {","BackgroundColor $SECONDARY_BG","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","skinparam card {","BackgroundColor $INFO_BG","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","skinparam file {","BackgroundColor $SECONDARY_BG","BorderColor $LIGHT","FontColor $FGCOLOR","}","!endsub","","!startsub stack","skinparam stack {","$primary_scheme()","}","!endsub","","!startsub map","skinparam map {","$primary_scheme()","}","!endsub","","<style>","participant {","Margin 5 40","Padding 15 20","}","wbsDiagram, mindmapDiagram {","root {","BackgroundColor $PUML_BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $INFO_BG","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","$primary_scheme()","Padding 15","RoundCorner 20","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY_BG","FontColor $INFO_BG","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $PUML_BGCOLOR","FontColor $DARK_BG","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $PUML_BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_BG","FontColor $PRIMARY_TEXT","BorderColor $SECONDARY_BG","}","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY_BG","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT_BG","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY_BG","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO_BG","}","separator {","LineColor $SECONDARY_BG","BackGroundColor $secondary_scheme()","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO_BG","FontSize 16","FontStyle italic","BackGroundColor $DIAMOND_BG","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY_BG","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>"].join(`
-`),q["crt-amber"]={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},pr["crt-amber"]=['!$THEME = "crt-amber"',"",'!$DARK_AMBER = "#FFB000"','!$LIGHT_AMBER = "#FFCC00"',"",'!$BGCOLOR = "#282828"',"!$FGCOLOR = $DARK_AMBER","","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $LIGHT_AMBER","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","box {","LineStyle 12-18","LineThickness 3","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","groupHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","node {","MaximumWidth 300","}","referenceHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy solid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $BGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $LIGHT_AMBER","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
-`),q["crt-green"]={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},pr["crt-green"]=['!$THEME = "crt-green"',"",'!$BGCOLOR = "#282828"','!$FGCOLOR = "#33FF33"',"","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $FGCOLOR","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","box {","LineStyle 12-18","LineThickness 3","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","groupHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","node {","MaximumWidth 300","}","referenceHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy solid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $BGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $FGCOLOR","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
-`),q.cyborg={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.cyborg=['!$THEME = "cyborg"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#2A9FD6"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#CC0000"','!$ORANGE = "#fd7e14"','!$YELLOW = "#FF8800"','!$GREEN = "#77B300"','!$TEAL = "#20c997"','!$CYAN = "#9933CC"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#555"','!$PRIMARY = "#2A9FD6"','!$SECONDARY = "#555"','!$SUCCESS = "#77B300"','!$INFO = "#9933CC"','!$WARNING = "#FF8800"','!$DANGER = "#CC0000"','!$LIGHT = "#222"','!$DARK = "#ADAFAE"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#55B2DE"','!$PRIMARY_LIGHT = "#227FAB"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#777777"','!$SECONDARY_LIGHT = "#444444"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#AD5CD6"','!$INFO_LIGHT = "#9F161B"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#92C233"','!$SUCCESS_LIGHT = "#5F8F00"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#FFA033"','!$WARNING_LIGHT = "#CC6D00"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#D63333"','!$DANGER_LIGHT = "#A30000"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#BDBFBE"','!$DARK_LIGHT = "#8A8C8B"','!$LIGHT_DARK = "#4E4E4E"','!$LIGHT_LIGHT = "#1B1B1B"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $SECONDARY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $SECONDARY","ReferenceFontColor $SECONDARY_TEXT","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $LIGHT-black","BorderColor $LIGHT","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub actor","","skinparam actor {","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q["cyborg-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr["cyborg-outline"]=['!$THEME = "cyborg-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#2A9FD6"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#CC0000"','!$ORANGE = "#fd7e14"','!$YELLOW = "#FF8800"','!$GREEN = "#77B300"','!$TEAL = "#20c997"','!$CYAN = "#9933CC"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#555"','!$PRIMARY = "#2A9FD6"','!$SECONDARY = "#555"','!$SUCCESS = "#77B300"','!$INFO = "#9933CC"','!$WARNING = "#FF8800"','!$DANGER = "#CC0000"','!$LIGHT = "#222"','!$DARK = "#ADAFAE"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#55B2DE"','!$PRIMARY_LIGHT = "#227FAB"',"!$PRIMARY_TEXT = $PRIMARY",'!$SECONDARY_DARK = "#777777"','!$SECONDARY_LIGHT = "#444444"',"!$SECONDARY_TEXT = $SECONDARY_DARK",'!$INFO_DARK = "#AD5CD6"','!$INFO_LIGHT = "#7a29a3"',"!$INFO_TEXT = $INFO",'!$SUCCESS_DARK = "#92C233"','!$SUCCESS_LIGHT = "#5F8F00"',"!$SUCCESS_TEXT = $SUCCESS",'!$WARNING_DARK = "#FFA033"','!$WARNING_LIGHT = "#cc6d00"',"!$WARNING_TEXT = $WARNING",'!$DANGER_DARK = "#D63333"','!$DANGER_LIGHT = "#a30000"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#BDBFBE"','!$DARK_LIGHT = "#8A8C8B"','!$LIGHT_DARK = "#4E4E4E"','!$LIGHT_LIGHT = "#1B1B1B"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $BGCOLOR","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO_TEXT","GroupBackgroundColor $BGCOLOR","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $BGCOLOR","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO_TEXT","ReferenceHeaderBackgroundColor $BGCOLOR","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $BGCOLOR","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $BGCOLOR","BorderColor $INFO_DARK","FontColor $INFO_DARK","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $DARK_DARK","FontColor $DARK_DARK","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $BGCOLOR","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $LIGHT","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.hacker={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.hacker=['!$THEME = "hacker"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam BackgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$PRIMARY = "#b5e853"','!$PRIMARY_LIGHT = "#d3f198"','!$PRIMARY_DARK = "#6d8b32"','!$PRIMARY_TEXT = "#151515"','!$SECONDARY = "#6a9fb5"','!$SECONDARY_LIGHT = "#88b2c4"','!$SECONDARY_DARK = "#557f91"','!$SECONDARY_TEXT = "#fefefe"','!$SUCCESS = "#90a959"','!$SUCCESS_LIGHT = "#a6ba7a"','!$INFO = "#aa759f"','!$INFO_LIGHT = "#bb91b2"','!$INFO_DARK = "#885E7F"','!$WARNING = "#f4bf75"','!$WARNING_LIGHT = "#f6cc91"','!$WARNING_TEXT = "#151515"','!$DANGER = "#ac4142"','!$DANGER_LIGHT = "#bd6768"','!$LIGHT = "#151515"','!$DARK = "#eaeaea"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_LIGHT","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endprocedure","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 40","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $PRIMARY","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $LIGHT-black","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY","DiamondBorderColor $SECONDARY_LIGHT","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","BorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBackgroundColor $LIGHT","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderBackgroundColor $LIGHT","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $LIGHT-black","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor white","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT-$DANGER","BorderColor $DANGER_LIGHT","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING_LIGHT","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $LIGHT-black","BorderColor $PRIMARY_LIGHT","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $BGCOLOR","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","BackgroundColor $LIGHT-black","BorderColor $PRIMARY_LIGHT","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","BorderThickness 2","FontColor $PRIMARY_DARK","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $LIGHT","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $LIGHT-black","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $LIGHT-black","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO_LIGHT","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY_LIGHT","FontColor $DARK","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub","","<style>","mindmapDiagram, wbsDiagram {","element {","$primary_scheme()","}",":depth(0) {","fontSize 16","fontStyle bold","fontColor $SECONDARY","}",":depth(1) {","fontSize 14","padding 5","fontStyle bold","}",":depth(2) {","fontSize 12","padding 4","}",":depth(3) {","fontSize 11","padding 3","fontColor $INFO","}","","}","</style>"].join(`
-`),q.lightgray={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.lightgray=['!$THEME = "lightgray"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$WHITE = "#FFF"','!$GRAY_DARK = "#4d4d4d"','!$GRAY = "#737373"','!$LIGHT = "#fcfcfc"','!$DARK = "#303030"',"","!$FGCOLOR = $DARK",'!$PRIMARY = "#e2e2e2"','!$PRIMARY_LIGHT = "#f3f3f3"','!$PRIMARY_DARK = "#888888"','!$PRIMARY_TEXT = "#336699"','!$SECONDARY = "#d2d2d2"','!$SECONDARY_LIGHT = "#dbdbdb"','!$SECONDARY_DARK = "#a8a8a8"','!$SECONDARY_TEXT = "white"','!$INFO = "#336699"','!$INFO_LIGHT = "#5c85ad"','!$INFO_DARK = "#29527a"',"!$INFO_TEXT = $WHITE",'!$SUCCESS = "#339933"','!$SUCCESS_LIGHT = "#5cad5c"','!$SUCCESS_DARK = "#297a29"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING = "#ffae42"','!$WARNING_LIGHT = "#ffbe68"','!$WARNING_DARK = "#cc8b35"',"!$WARNING_TEXT = $WHITE",'!$DANGER = "#ff3333"','!$DANGER_LIGHT = "#ff5c5c"','!$DANGER_DARK = "#cc2929"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_LIGHT","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 30","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 15","skinparam BoxPadding 30","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $PRIMARY","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $SECONDARY_TEXT","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor white-$LIGHT","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_DARK","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY_LIGHT","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor $F2FCFE","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","BackgroundColor $BGCOLOR","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","StereotypeFontColor $DARK","StereotypeFontSize 9","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $BGCOLOR","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BackgroundColor $BGCOLOR","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $PRIMARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $PRIMARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.mars={author:"future-architect",license:"Apache-2.0",source:"https://github.com/future-architect/puml-themes/tree/master/themes"},pr.mars=["skinparam BackgroundColor F9F9F9","skinparam shadowing false","skinparam RoundCorner 7","skinparam ArrowColor 191919","skinparam FontColor 191919","skinparam SequenceLifeLineBorderColor 393939","skinparam SequenceGroupHeaderFontColor 191919","skinparam SequenceGroupFontColor 393939","skinparam SequenceGroupBorderColor 393939","skinparam SequenceGroupBorderThickness 1","","skinparam sequenceDivider {","BorderColor 191919","BorderThickness 1","FontColor 191919","}","","skinparam participant {","BackgroundColor E55756","BorderColor 191919","FontColor F9F9F9","BorderThickness 1.5","}","","skinparam database {","BackgroundColor A4DBD8","BorderColor 191919","FontColor 191919","}","","skinparam entity {","BackgroundColor EFBABC","BorderColor 191919","FontColor 191919","}","","skinparam note {","BackgroundColor e5e5e5","BorderColor 191919","FontColor 191919","BorderThickness 1.5","}","","skinparam actor {","BackgroundColor 191919","BorderColor 191919","FontColor 191919","}","","skinparam boundary {","BackgroundColor EFBABC","BorderColor 191919","FontColor 191919","}","","skinparam control {","BackgroundColor EFBABC","BorderColor 191919","FontColor 191919","}","","skinparam collections {","BackgroundColor E55756","BorderColor 191919","FontColor 191919","BorderThickness 1.5","}","","skinparam queue {","BackgroundColor E55756","BorderColor 191919","FontColor FFF","BorderThickness 1.5","}"].join(`
-`),q.materia={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.materia=['!$THEME = "materia"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#2196F3"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#e51c23"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ff9800"','!$GREEN = "#4CAF50"','!$TEAL = "#20c997"','!$CYAN = "#9C27B0"','!$WHITE = "#FFF"','!$GRAY_DARK = "#222"','!$GRAY = "#666"','!$PRIMARY = "#2196F3"','!$SECONDARY = "#fff"','!$SUCCESS = "#4CAF50"','!$INFO = "#9C27B0"','!$WARNING = "#ff9800"','!$DANGER = "#e51c23"','!$LIGHT = "#fff"','!$DARK = "#222"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#4dabf5"','!$PRIMARY_DARK = "#1a78c2"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_LIGHT = "#fff"','!$SECONDARY_DARK = "#cccccc"',"!$SECONDARY_TEXT = $DARK",'!$INFO_LIGHT = "#b052c0"','!$INFO_DARK = "#7D1F8D"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_LIGHT = "#70bf73"','!$SUCCESS_DARK = "#3D8C40"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_LIGHT = "#ffad33"','!$WARNING_DARK = "#CC7A00"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#b7161c"','!$DANGER_LIGHT = "#B7161C"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing true","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $WHITE-$SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor transparent","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor transparent","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $WHITE-$LIGHT","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","FontColor $PRIMARY","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $GRAY","FontColor $GRAY","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q["materia-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr["materia-outline"]=['!$THEME = "materia-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#2196F3"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#e51c23"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ff9800"','!$GREEN = "#4CAF50"','!$TEAL = "#20c997"','!$CYAN = "#9C27B0"','!$WHITE = "#FFF"','!$GRAY_DARK = "#222"','!$GRAY = "#666"','!$PRIMARY = "#2196F3"','!$SECONDARY = "#fff"','!$SUCCESS = "#4CAF50"','!$INFO = "#9C27B0"','!$WARNING = "#ff9800"','!$DANGER = "#e51c23"','!$LIGHT = "#fff"','!$DARK = "#222"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#4dabf5"','!$PRIMARY_DARK = "#1a78c2"',"!$PRIMARY_TEXT = $PRIMARY",'!$SECONDARY_LIGHT = "#fff"','!$SECONDARY_DARK = "#cccccc"',"!$SECONDARY_TEXT = $SECONDARY_DARK",'!$INFO_LIGHT = "#b052c0"','!$INFO_DARK = "#7D1F8D"',"!$INFO_TEXT = $INFO",'!$SUCCESS_LIGHT = "#70bf73"','!$SUCCESS_DARK = "#3D8C40"',"!$SUCCESS_TEXT = $SUCCESS",'!$WARNING_LIGHT = "#ffad33"','!$WARNING_DARK = "#CC7A00"',"!$WARNING_TEXT = $WARNING",'!$DANGER_LIGHT = "#B7161C"',"!$DANGER_TEXT = $DANGER","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing true","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam TitleFontColor $DARK","skinparam TitleFontSize 20","skinparam TitleBorderThickness 0","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","' FontColor $PRIMARY_TEXT","' BorderColor $PRIMARY","' BackgroundColor $BGCOLOR","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","' FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $BGCOLOR","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $BGCOLOR","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","' FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","' FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","' FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $BGCOLOR","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $SUCCESS","' FontColor $SUCCESS_TEXT","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","' FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $LIGHT","HeaderBackgroundColor $PRIMARY-$PRIMARY_DARK","' FontColor $PRIMARY_TEXT","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","' FontColor $SUCCESS","' BackgroundColor $BGCOLOR","' BorderColor $SECONDARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $SECONDARY_DARK","BorderThickness 2","' FontColor $SECONDARY_TEXT","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","BorderThickness 2","' FontColor $PRIMARY","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","' BackgroundColor $BGCOLOR","' BorderColor $SECONDARY_DARK","' FontColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $WARNING_DARK","' FontColor $WARNING_TEXT","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY","' FontColor $PRIMARY_TEXT","}","!endsub"].join(`
-`),q.metal={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.metal=['!$THEME = "metal"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$WHITE = "#fdfdfd"','!$GRAY_DARK = "#4d4d4d"','!$GRAY = "#737373"','!$LIGHT = "#f2f2f2"','!$DARK = "#4d4d4d"',"",'!$SILVER = "#c0c0c0"','!$COPPER = "#B87333c"','!$STEELBLUE = "#4682b4"','!$LIGHTSTEELBLUE = "#B0C4DE" ','!$LIGHTSTEELBLUE_DARK = "#8d9db2" ','!$LIGHTSTEELBLUE_LIGHT = "#c0d0e5" ','!$ALUMINUM = "#c9ced0"','!$ALUMINUM_DARK = "#a1a5a6"','!$ALUMINUM_LIGHT = "#d4d8d9"','!$BRONZE = "#CD7F32" ','!$BRONZE_DARK = "#a46628" ','!$BRONZE_LIGHT = "#d7995b" ','!$GOLD = "#FFD700"','!$PLATINUM = "#E5E4E2"','!$RUST = "#B7410E"',"","!$FGCOLOR = $DARK","!$PRIMARY = $PLATINUM",'!$PRIMARY_LIGHT = "#eae9e8"','!$PRIMARY_DARK = "#b7b6b5"',"!$PRIMARY_TEXT = $STEELBLUE","!$SECONDARY = $SILVER",'!$SECONDARY_LIGHT = "#cdcdcd"','!$SECONDARY_DARK = "#9a9a9a"',"!$SECONDARY_TEXT = $WHITE","!$INFO = $STEELBLUE",'!$INFO_LIGHT = "#5c85ad"','!$INFO_DARK = "#29527a"',"!$INFO_TEXT = $WHITE",'!$SUCCESS = "#339933"','!$SUCCESS_LIGHT = "#5cad5c"','!$SUCCESS_DARK = "#297a29"',"!$SUCCESS_TEXT = $WHITE","!$WARNING = $GOLD",'!$WARNING_LIGHT = "#ffdf33"','!$WARNING_DARK = "#ccac00"',"!$WARNING_TEXT = $WHITE","!$DANGER = $RUST",'!$DANGER_LIGHT = "#c5673e"','!$DANGER_DARK = "#92340b"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY-$PRIMARY_DARK","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 30","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 15","skinparam BoxPadding 30","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $WHITE","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","}","","skinparam legend {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderColor $SECONDARY_DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $BRONZE","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $WHITE","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 3","LifeLineBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $LIGHTSTEELBLUE_LIGHT-$LIGHTSTEELBLUE_DARK","BorderColor $LIGHTSTEELBLUE_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING_DARK","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderColor $PRIMARY","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $WHITE","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $WHITE-$LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderColor $RUST","FontColor $RUST","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $GRAY","FontColor $LIGHT","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.mimeograph={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},pr.mimeograph=['!$THEME = "mimeograph"',"",'!$BGCOLOR = "#D9D3D0"','!$FGCOLOR = "#9275B6"',"","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $FGCOLOR","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","node {","MaximumWidth 300","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy nosolid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $FGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $FGCOLOR","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
-`),q.minty={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.minty=['!$THEME = "minty"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#007bff"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#ff7851"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ffce67"','!$GREEN = "#56cc9d"','!$TEAL = "#20c997"','!$CYAN = "#6cc3d5"','!$WHITE = "#fff"','!$GRAY = "#888"','!$GRAYDARK = "#343a40"','!$PRIMARY = "#78c2ad"','!$SECONDARY = "#f3969a"','!$SUCCESS = "#56cc9d"','!$INFO = "#6cc3d5"','!$WARNING = "#ffce67"','!$DANGER = "#ff7851"','!$LIGHT = "#f8f9fa"','!$DARK = "#343a40"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#6caf9c"','!$PRIMARY_LIGHT = "#86c8b5"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#db878b"','!$SECONDARY_LIGHT = "#f4a1a4"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#61b0c0"','!$INFO_LIGHT = "#7bc9d9"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#4db88d"','!$SUCCESS_LIGHT = "#67d1a7"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#e6b95d"','!$WARNING_LIGHT = "#ffd376"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#e66c49"','!$DANGER_LIGHT = "#ff8662"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#2f343a"','!$DARK_LIGHT = "#484e53"','!$LIGHT_DARK = "#dfe0e1"','!$LIGHT_LIGHT = "#f9fafb"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY_DARK","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.mono={author:"Denis Bondarenko feat Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},pr.mono=['!$THEME = "mono"',"","' Theme colors","",'!if %not(%variable_exists("$CLR_BG"))','!$CLR_BG = "white"',"!endif","","' For icons bg in legend. usage: <THM_BG>","!ifndef THM_BG","!define THM_BG #$CLR_BG","!endif","","' Highlighted background",'!if %not(%variable_exists("$CLR_BG_EMPH"))','!$CLR_BG_EMPH = "#eee"',"!endif","","' Main foreground color",'!if %not(%variable_exists("$CLR_FG"))','!$CLR_FG = "black"',"!endif","","' Less hued, 3 levels","",'!if %not(%variable_exists("$CLR_FG_DIMMED"))','!$CLR_FG_DIMMED = "#666"',"!endif","",'!if %not(%variable_exists("$CLR_FG_DIMMED_2"))','!$CLR_FG_DIMMED_2 = "#999"',"!endif","",'!if %not(%variable_exists("$CLR_FG_DIMMED_3"))','!$CLR_FG_DIMMED_3 = "#ccc"',"!endif","","' Hyperlinks color",'!if %not(%variable_exists("$CLR_HYPERLINK"))','!$CLR_HYPERLINK = "#333"',"!endif","","' Theme fonts","","' Basic font","!ifndef $FNT","","' Multiple fallback fonts defined",'!$FNT_MONO = "Courier"','!$FNT_MONO = "Courier New"','!$FNT = "DejaVu Sans Mono"','!$FNT = "monospace"','!$FNT = "Rec Mono Linear"',"","' The preferred theme font",'!$FNT = "Hack"',"","!endif","","' Monospaced font","!ifndef $FNT_MONO","","' A different font can be used",`' !$FNT_MONO = "Rec Mono Semicasual"`,"!$FNT_MONO = $FNT","!endif","","' Theme body","","<style>","root {","BackgroundColor $CLR_BG","FontColor $CLR_FG","FontName $FNT","HyperLinkColor $CLR_HYPERLINK","LineColor $CLR_FG","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","node {","' MaximumWidth 300","}","ganttDiagram {","closed {","BackGroundColor $CLR_BG_EMPH","}","task {","BackGroundColor $CLR_FG_DIMMED_2","LineColor $CLR_FG","unstarted {","BackGroundColor $CLR_FG_DIMMED_3","LineColor $CLR_FG","}","}","note {","LineThickness .5","}","timeline {","LineThickness .5","LineColor $CLR_FG_DIMMED_3","}","separator {","}","}","</style>","","' skinparam is flattened to support YAML, JSON diagram types","skinparam {","","shadowing false","useBetaStyle true","arrowLollipopColor $CLR_FG","backgroundColor $CLR_BG","lifelineStrategy nosolid","","defaultFontName $FNT","defaultMonospacedFontName $FNT_MONO","","hyperlinkColor $CLR_HYPERLINK","","headerFontColor $CLR_FG_DIMMED_2","headerFontName $FNT","","footerFontColor $CLR_FG_DIMMED_2","footerFontName $FNT","","legendBorderThickness 0","legendBorderColor transparent","","noteFontColor $CLR_FG","noteFontName $FNT","","packageBorderColor $CLR_FG","packageFontColor $CLR_FG","packageFontName $FNT","","nodeStereotypeFontColor $CLR_FG_DIMMED","nodeStereotypeFontName $FNT","nodeStereotypeFontSize 10","","componentStereotypeFontColor $CLR_FG_DIMMED","componentStereotypeFontName $FNT","componentStereotypeFontSize 10","","participantPadding 10","","actorStereotypeFontColor $CLR_FG_DIMMED","actorStereotypeFontName $FNT","actorStereotypeFontSize 10","","useCaseStereoTypeFontColor $CLR_FG","useCaseStereoTypeFontName $FNT","","classBackgroundColor $CLR_BG","classBorderColor $CLR_FG","classFontColor $CLR_FG","classFontName $FNT","classAttributeFontColor $CLR_FG","classAttributeFontName $FNT","classStereotypeFontColor $CLR_FG_DIMMED","classStereotypeFontName $FNT","classStereotypeFontSize 10","","objectBorderColor $CLR_FG","","activityBackgroundColor $CLR_BG","activityBarColor $CLR_FG","activityBorderColor $CLR_FG","activityFontColor $CLR_FG","activityFontName $FNT","","sequenceLifeLineBorderColor $CLR_FG","","stateBackgroundColor $CLR_BG","stateBorderColor $CLR_FG","","boundaryFontColor $CLR_FG","","boxPadding 5","","circledCharacterFontColor $CLR_FG","circledCharacterFontName $FNT_MONO","circledCharacterFontSize 10","circledCharacterRadius 8","","stereotypeFontColor $CLR_FG_DIMMED","stereotypeFontName $FNT","stereotypeFontSize 10","stereotypeABackgroundColor $CLR_BG","stereotypeABorderColor $CLR_FG","stereotypeCBackgroundColor $CLR_BG","stereotypeCBorderColor $CLR_FG","stereotypeEBackgroundColor $CLR_BG","stereotypeEBorderColor $CLR_FG","stereotypeIBackgroundColor $CLR_BG","stereotypeIBorderColor $CLR_FG","stereotypeNBackgroundColor $CLR_BG","stereotypeNBorderColor $CLR_FG","","iconPackageColor $CLR_FG","iconPackageBackgroundColor $CLR_BG","iconPrivateColor $CLR_FG","iconPrivateBackgroundColor $CLR_BG","iconProtectedColor $CLR_FG","iconProtectedBackgroundColor $CLR_BG","iconPublicColor $CLR_FG","iconPublicBackgroundColor $CLR_BG","","}"].join(`
-`),q.plain={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},pr.plain=['!$THEME = "plain"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "white"',"!endif","",'!if %not(%variable_exists("$FGCOLOR"))','!$FGCOLOR = "black"',"!endif","",'!if %not(%variable_exists("$HYPERLINK_COLOR"))','!$HYPERLINK_COLOR = "blue"',"!endif","","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $HYPERLINK_COLOR","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","node {","MaximumWidth 300","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy nosolid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $FGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $HYPERLINK_COLOR","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
-`),q["reddress-darkblue"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},pr["reddress-darkblue"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","","skinparam backgroundColor 777",'!$ACCENT = "1a66c2"','!$ACCENTDARK = "002642"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "fff"','!$SECONDARY = "aaa"','!$ARROWCOLOR = "fff"','!$ARROWFONTCOLOR = "bbb"','!$BORDERCOLOR = "1b1b1b"','!$BOXBG = "2e2e2e"','!$LIGHTBORDERCOLOR = "767676"','!$LIGHTBG = "575757"',"skinparam backgroundColor 777","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
-`),q["reddress-darkgreen"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},pr["reddress-darkgreen"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "228811"','!$ACCENTDARK = "113300"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "fff"','!$SECONDARY = "aaa"','!$ARROWCOLOR = "fff"','!$ARROWFONTCOLOR = "bbb"','!$BORDERCOLOR = "1b1b1b"','!$BOXBG = "2e2e2e"','!$LIGHTBORDERCOLOR = "767676"','!$LIGHTBG = "575757"',"skinparam backgroundColor 777","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
-`),q["reddress-darkorange"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},pr["reddress-darkorange"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "BB6600"','!$ACCENTDARK = "662200"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "fff"','!$SECONDARY = "aaa"','!$ARROWCOLOR = "fff"','!$ARROWFONTCOLOR = "bbb"','!$BORDERCOLOR = "1b1b1b"','!$BOXBG = "2e2e2e"','!$LIGHTBORDERCOLOR = "767676"','!$LIGHTBG = "575757"',"skinparam backgroundColor 777","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
-`),q["reddress-darkred"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},pr["reddress-darkred"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "880000"','!$ACCENTDARK = "330000"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "fff"','!$SECONDARY = "aaa"','!$ARROWCOLOR = "fff"','!$ARROWFONTCOLOR = "bbb"','!$BORDERCOLOR = "1b1b1b"','!$BOXBG = "2e2e2e"','!$LIGHTBORDERCOLOR = "767676"','!$LIGHTBG = "575757"',"skinparam backgroundColor 777","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
-`),q["reddress-lightblue"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},pr["reddress-lightblue"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "2a86e2"','!$ACCENTDARK = "1a66c2"',"skinparam stereotypeCBackgroundColor $ACCENTDARK",'!$PRIMARYFONTCOLOR = "000"','!$SECONDARY = "333"','!$ARROWCOLOR = "000"','!$ARROWFONTCOLOR = "333"','!$BORDERCOLOR = "aaa"','!$BOXBG = "ccc"','!$LIGHTBORDERCOLOR = "cccccc"','!$LIGHTBG = "e0e0e0"',"skinparam backgroundColor fff","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
-`),q["reddress-lightgreen"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},pr["reddress-lightgreen"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "55BB33"','!$ACCENTDARK = "338822"',"skinparam stereotypeCBackgroundColor $ACCENTDARK",'!$PRIMARYFONTCOLOR = "000"','!$SECONDARY = "333"','!$ARROWCOLOR = "000"','!$ARROWFONTCOLOR = "333"','!$BORDERCOLOR = "aaa"','!$BOXBG = "ccc"','!$LIGHTBORDERCOLOR = "cccccc"','!$LIGHTBG = "e0e0e0"',"skinparam backgroundColor fff","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
-`),q["reddress-lightorange"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},pr["reddress-lightorange"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "FF8800"','!$ACCENTDARK = "BB6600"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "000"','!$SECONDARY = "333"','!$ARROWCOLOR = "000"','!$ARROWFONTCOLOR = "333"','!$BORDERCOLOR = "aaa"','!$BOXBG = "ccc"','!$LIGHTBORDERCOLOR = "cccccc"','!$LIGHTBG = "e0e0e0"',"skinparam backgroundColor fff","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
-`),q["reddress-lightred"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},pr["reddress-lightred"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "CC0033"','!$ACCENTDARK = "AA0033"',"skinparam stereotypeCBackgroundColor $ACCENTDARK",'!$PRIMARYFONTCOLOR = "000"','!$SECONDARY = "333"','!$ARROWCOLOR = "000"','!$ARROWFONTCOLOR = "333"','!$BORDERCOLOR = "aaa"','!$BOXBG = "ccc"','!$LIGHTBORDERCOLOR = "cccccc"','!$LIGHTBG = "e0e0e0"',"skinparam backgroundColor fff","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
-`),q.sandstone={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.sandstone=['!$THEME = "sandstone"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#325d88"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#d9534f"','!$ORANGE = "#f47c3c"','!$YELLOW = "#ffc107"','!$GREEN = "#93c54b"','!$TEAL = "#20c997"','!$CYAN = "#29abe0"','!$WHITE = "#fff"','!$GRAY = "#8e8c84"','!$GRAYDARK = "#3e3f3a"','!$PRIMARY = "#325d88"','!$SECONDARY = "#8e8c84"','!$SUCCESS = "#93c54b"','!$INFO = "#29abe0"','!$WARNING = "#f47c3c"','!$DANGER = "#d9534f"','!$LIGHT = "#f8f5f0"','!$DARK = "#3e3f3a"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#2d547a"','!$PRIMARY_LIGHT = "#476d94"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#807e77"','!$SECONDARY_LIGHT = "#999890"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#259aca"','!$INFO_LIGHT = "#3eb3e3"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#84b144"','!$SUCCESS_LIGHT = "#9ecb5d"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#dc7036"','!$WARNING_LIGHT = "#f58950"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#c34b47"','!$DANGER_LIGHT = "#AE423F"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#383934"','!$DARK_LIGHT = "#51524e"','!$LIGHT_DARK = "#dfddd8"','!$LIGHT_LIGHT = "#f9f6f2"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BackgroundColor $PRIMARY_LIGHT","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.silver={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.silver=['!$THEME = "silver"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$WHITE = "#FFF"','!$GRAY_DARK = "#4d4d4d"','!$GRAY = "#737373"','!$LIGHT = "#ffffff"','!$DARK = "#303030"',"","!$FGCOLOR = $DARK",'!$PRIMARY = "#eeeeee"','!$PRIMARY_LIGHT = "#f1f1f1"','!$PRIMARY_DARK = "#bebebe"','!$PRIMARY_TEXT = "#336699"','!$SECONDARY = "#d6d6d6"','!$SECONDARY_LIGHT = "#dedede"','!$SECONDARY_DARK = "#ababab"',"!$SECONDARY_TEXT = $LIGHT",'!$INFO = "#336699"','!$INFO_LIGHT = "#5c85ad"','!$INFO_DARK = "#29527a"',"!$INFO_TEXT = $WHITE",'!$SUCCESS = "#339933"','!$SUCCESS_LIGHT = "#5cad5c"','!$SUCCESS_DARK = "#297a29"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING = "#ffae42"','!$WARNING_LIGHT = "#ffbe68"','!$WARNING_DARK = "#cc8b35"',"!$WARNING_TEXT = $WHITE",'!$DANGER = "#ff3333"','!$DANGER_LIGHT = "#ff5c5c"','!$DANGER_DARK = "#cc2929"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_LIGHT","BackgroundColor $PRIMARY-$PRIMARY_DARK","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 30","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 15","skinparam BoxPadding 30","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","}","","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","","!endsub","","!startsub node","","skinparam node {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","BorderColor $PRIMARY_LIGHT","FontColor $PRIMARY_TEXT","}","","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 9","}","","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $PRIMARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BorderThickness 2","}","","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $PRIMARY-$PRIMARY_DARK","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $PRIMARY-$PRIMARY_DARK","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","","}","","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","","!endsub"].join(`
-`),q.sketchy={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.sketchy=['!$THEME = "sketchy"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","!option handwritten true","skinparam shadowing false","",'!$BLUE = "#007bff"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#dc3545"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ffc107"','!$GREEN = "#28a745"','!$TEAL = "#20c997"','!$CYAN = "#17a2b8"','!$WHITE = "#ffffff"','!$GRAY = "#868e96"','!$GRAYDARK = "#333333"','!$PRIMARY = "#333333"','!$SECONDARY = "#555555"','!$SUCCESS = "#28a745"','!$INFO = "#17a2b8"','!$WARNING = "#ffc107"','!$DANGER = "#dc3545"','!$LIGHT = "#ffffff"','!$DARK = "#555555"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#2e2e2e"','!$PRIMARY_LIGHT = "#474747"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#4d4d4d"','!$SECONDARY_LIGHT = "#666666"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#1592a6"','!$INFO_LIGHT = "#2eabbf"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#24963e"','!$SUCCESS_LIGHT = "#3eb058"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#e6ae06"','!$WARNING_LIGHT = "#ffc720"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#c6303e"','!$DANGER_LIGHT = "#e04958"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#4d4d4d"','!$DARK_LIGHT = "#666666"','!$LIGHT_DARK = "#e6e6e6"','!$LIGHT_LIGHT = "#ffffff"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Segoe Print"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $FGCOLOR","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $FGCOLOR","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $FGCOLOR","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q["sketchy-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr["sketchy-outline"]=['!$THEME = "sketchy-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","!option handwritten true","skinparam shadowing false","",'!$BLUE = "#007bff"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#dc3545"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ffc107"','!$GREEN = "#28a745"','!$TEAL = "#20c997"','!$CYAN = "#17a2b8"','!$WHITE = "#ffffff"','!$GRAY = "#868e96"','!$GRAYDARK = "#333333"','!$PRIMARY = "#333333"','!$SECONDARY = "#555555"','!$SUCCESS = "#28a745"','!$INFO = "#17a2b8"','!$WARNING = "#ffc107"','!$DANGER = "#dc3545"','!$LIGHT = "#ffffff"','!$DARK = "#555555"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#2e2e2e"','!$PRIMARY_LIGHT = "#474747"','!$PRIMARY_TEXT = "#2e2e2e"','!$SECONDARY_DARK = "#4d4d4d"','!$SECONDARY_LIGHT = "#666666"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#1592a6"','!$INFO_LIGHT = "#2eabbf"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#24963e"','!$SUCCESS_LIGHT = "#3eb058"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#e6ae06"','!$WARNING_LIGHT = "#ffc720"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#c6303e"','!$DANGER_LIGHT = "#e04958"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#4d4d4d"','!$DARK_LIGHT = "#666666"','!$LIGHT_DARK = "#e6e6e6"','!$LIGHT_LIGHT = "#ffffff"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Segoe Print"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $BGCOLOR","CBorderColor $SECONDARY_DARK","ABackgroundColor $BGCOLOR","ABorderColor $SUCCESS_DARK","IBackgroundColor $BGCOLOR","IBorderColor $DANGER_DARK","EBackgroundColor $BGCOLOR","EBorderColor $WARNING_DARK","NBackgroundColor $BGCOLOR","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY_TEXT","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $BGCOLOR","TitleFontColor $PRIMARY_TEXT","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $PRIMARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY_TEXT","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $DARK_DARK","FontColor $DARK_DARK","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING_DARK","FontColor $WARNING_DARK","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $BGCOLOR","BorderColor #F2FCFE","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $BGCOLOR","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $PRIMARY_TEXT","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO_DARK","FontColor $INFO_DARK","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.spacelab={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.spacelab=['!$THEME = "spacelab"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#446e9b"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#cd0200"','!$ORANGE = "#fd7e14"','!$YELLOW = "#d47500"','!$GREEN = "#3cb521"','!$TEAL = "#20c997"','!$CYAN = "#3399f3"','!$WHITE = "#ffffff"','!$GRAY = "#777777"','!$GRAYDARK = "#333333"','!$PRIMARY = "#446e9b"','!$SECONDARY = "#999999"','!$SUCCESS = "#3cb521"','!$INFO = "#3399f3"','!$WARNING = "#d47500"','!$DANGER = "#cd0200"','!$LIGHT = "#eeeeee"','!$DARK = "#333333"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#304d6d"','!$PRIMARY_LIGHT = "#7c9ab9"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#6b6b6b"','!$SECONDARY_LIGHT = "#b8b8b8"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#246baa"','!$INFO_LIGHT = "#70b8f7"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#32a243"','!$SUCCESS_LIGHT = "#4cbc5c"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#945200"','!$WARNING_LIGHT = "#e19e4d"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#900100"','!$DANGER_LIGHT = "#dc4e4d"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#242424"','!$DARK_LIGHT = "#707070"','!$LIGHT_DARK = "#a7a7a7"','!$LIGHT_LIGHT = "#f3f3f3"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY_DARK","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY_DARK","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK_LIGHT-$DARK_DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $WHITE","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q["spacelab-white"]={author:"KingPlus-lang",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr["spacelab-white"]=['!$THEME = "spacelab-white"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "white"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#446e9b"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#cd0200"','!$ORANGE = "#fd7e14"','!$YELLOW = "#d47500"','!$GREEN = "#3cb521"','!$TEAL = "#20c997"','!$CYAN = "#3399f3"','!$WHITE = "#ffffff"','!$GRAY = "#777777"','!$GRAYDARK = "#333333"','!$PRIMARY = "#446e9b"','!$SECONDARY = "#999999"','!$SUCCESS = "#3cb521"','!$INFO = "#3399f3"','!$WARNING = "#d47500"','!$DANGER = "#cd0200"','!$LIGHT = "#eeeeee"','!$DARK = "#333333"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#304d6d"','!$PRIMARY_LIGHT = "#7c9ab9"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#6b6b6b"','!$SECONDARY_LIGHT = "#b8b8b8"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#246baa"','!$INFO_LIGHT = "#70b8f7"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#32a243"','!$SUCCESS_LIGHT = "#4cbc5c"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#945200"','!$WARNING_LIGHT = "#e19e4d"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#900100"','!$DANGER_LIGHT = "#dc4e4d"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#242424"','!$DARK_LIGHT = "#707070"','!$LIGHT_DARK = "#a7a7a7"','!$LIGHT_LIGHT = "#f3f3f3"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY_DARK","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY_DARK","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK_LIGHT-$DARK_DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $WHITE","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.superhero={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.superhero=['!$THEME = "superhero"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#DF691A"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#d9534f"','!$ORANGE = "#f0ad4e"','!$YELLOW = "#f0ad4e"','!$GREEN = "#5cb85c"','!$TEAL = "#20c997"','!$CYAN = "#5bc0de"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#868e96"','!$PRIMARY = "#DF691A"','!$SECONDARY = "#4E5D6C"','!$SUCCESS = "#5cb85c"','!$INFO = "#5bc0de"','!$WARNING = "#f0ad4e"','!$DANGER = "#d9534f"','!$LIGHT = "#abb6c2"','!$DARK = "#4E5D6C"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#e58748"','!$PRIMARY_LIGHT = "#b25415"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#717d89"','!$SECONDARY_LIGHT = "#3e4a56"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#7ccde5"','!$INFO_LIGHT = "#499AB2"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#4a934a"','!$SUCCESS_LIGHT = "#5F8F00"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#f3bd71"','!$WARNING_LIGHT = "#C08A3E"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#e17572"','!$DANGER_LIGHT = "#AE423F"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#717d89"','!$DARK_LIGHT = "#3e4a56"','!$LIGHT_DARK = "#bcc5ce"','!$LIGHT_LIGHT = "#89929b"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","BorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBackgroundColor $SECONDARY","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $LIGHT-black","BorderColor $LIGHT","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q["superhero-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr["superhero-outline"]=['!$THEME = "superhero-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#DF691A"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#d9534f"','!$ORANGE = "#f0ad4e"','!$YELLOW = "#f0ad4e"','!$GREEN = "#5cb85c"','!$TEAL = "#20c997"','!$CYAN = "#5bc0de"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#868e96"','!$PRIMARY = "#DF691A"','!$SECONDARY = "#4E5D6C"','!$SUCCESS = "#5cb85c"','!$INFO = "#5bc0de"','!$WARNING = "#f0ad4e"','!$DANGER = "#d9534f"','!$LIGHT = "#abb6c2"','!$DARK = "#4E5D6C"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#e58748"','!$PRIMARY_LIGHT = "#b25415"',"!$PRIMARY_TEXT = $PRIMARY",'!$SECONDARY_DARK = "#717d89"','!$SECONDARY_LIGHT = "#3e4a56"',"!$SECONDARY_TEXT = $SECONDARY_DARK ",'!$INFO_DARK = "#7ccde5"','!$INFO_LIGHT = "#499AB2"',"!$INFO_TEXT = $INFO",'!$SUCCESS_DARK = "#4a934a"','!$SUCCESS_LIGHT = "#5F8F00"',"!$SUCCESS_TEXT = $SUCCESS",'!$WARNING_DARK = "#f3bd71"','!$WARNING_LIGHT = "#C08A3E"',"!$WARNING_TEXT = $WARNING",'!$DANGER_DARK = "#e17572"','!$DANGER_LIGHT = "#AE423F"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#717d89"','!$DARK_LIGHT = "#3e4a56"','!$LIGHT_DARK = "#bcc5ce"','!$LIGHT_LIGHT = "#89929b"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam TitleFontColor $DARK","skinparam TitleFontSize 20","skinparam TitleBorderThickness 0","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $BGCOLOR","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $BGCOLOR","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $BGCOLOR","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $LIGHT","ReferenceFontColor $LIGHT","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $BGCOLOR","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $BGCOLOR","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $BGCOLOR","BorderColor $INFO_DARK","FontColor $INFO_DARK","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $BGCOLOR","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $LIGHT","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.toy={author:"future-architect",license:"Apache-2.0",source:"https://github.com/future-architect/puml-themes/tree/master/themes"},pr.toy=["skinparam BackgroundColor DDDDDD","skinparam shadowing false","skinparam RoundCorner 7","skinparam ArrowColor 454645","skinparam FontColor 454645","skinparam SequenceLifeLineBorderColor 454645","skinparam SequenceGroupHeaderFontColor 454645","skinparam SequenceGroupFontColor 454645","skinparam SequenceGroupBorderColor 454645","skinparam SequenceGroupBorderThickness 1","","skinparam sequenceDivider {","BorderColor 454645","BorderThickness 1","FontColor 454645","}","","skinparam participant {","BackgroundColor FF6F61","BorderColor 454645","FontColor White","BorderThickness 1.5","}","","skinparam database {","BackgroundColor 98DDDE","BorderColor 454645","FontColor 454645","}","","skinparam entity {","BackgroundColor FFDA29","BorderColor 454645","FontColor 454645","}","","skinparam note {","BackgroundColor LightGreen","BorderColor 454645","FontColor 454645","BorderThickness 1","}","","skinparam actor {","BackgroundColor 454645","BorderColor 454645","FontColor 454645","}","","skinparam boundary {","BackgroundColor FFDA29","BorderColor 454645","FontColor 454645","}","","skinparam control {","BackgroundColor FFDA29","BorderColor 454645","FontColor 454645","}","","skinparam collections {","BackgroundColor FF6F61","BorderColor 454645","FontColor 454645","BorderThickness 1.5","}","","skinparam queue {","BackgroundColor FF6F61","BorderColor 454645","FontColor FFF","BorderThickness 1.5","}"].join(`
-`),q.united={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},pr.united=['!$THEME = "united"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#007bff"','!$INDIGO = "#6610f2"','!$PURPLE = "#772953"','!$PINK = "#e83e8c"','!$RED = "#df382c"','!$ORANGE = "#e95420"','!$YELLOW = "#efb73e"','!$GREEN = "#38b44a"','!$TEAL = "#20c997"','!$CYAN = "#17a2b8"','!$WHITE = "#fff"','!$GRAY = "#868e96"','!$GRAYDARK = "#333"','!$PRIMARY = "#e95420"','!$SECONDARY = "#aea79f"','!$SUCCESS = "#38b44a"','!$INFO = "#17a2b8"','!$WARNING = "#efb73e"','!$DANGER = "#df382c"','!$LIGHT = "#e9ecef"','!$DARK = "#772953"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#d24c1d"','!$PRIMARY_LIGHT = "#eb6536"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#9d968f"','!$SECONDARY_LIGHT = "#b6b0a9"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#1592a6"','!$INFO_LIGHT = "#2eabbf"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#32a243"','!$SUCCESS_LIGHT = "#4cbc5c"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#d7a538"','!$WARNING_LIGHT = "#f1be51"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#c93228"','!$DANGER_LIGHT = "#e24c41"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#6b254b"','!$DARK_LIGHT = "#853e64"','!$LIGHT_DARK = "#d2d4d7"','!$LIGHT_LIGHT = "#ebeef1"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BackgroundColor $PRIMARY_LIGHT","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
-`),q.vibrant={author:"future-architect",license:"Apache-2.0",source:"https://github.com/future-architect/puml-themes/tree/master/themes"},pr.vibrant=["skinparam BackgroundColor FFFFFF","skinparam shadowing false","skinparam RoundCorner 7","skinparam ArrowColor 454645","skinparam FontColor 454645","skinparam SequenceLifeLineBorderColor 696969","skinparam SequenceGroupHeaderFontColor 454645","skinparam SequenceGroupFontColor 696969","skinparam SequenceGroupBorderColor 696969","skinparam SequenceGroupBorderThickness 1","","skinparam sequenceDivider {","BorderColor 454645","BorderThickness 1","FontColor 454645","}","","skinparam participant {","BackgroundColor FF6347","BorderColor 454645","FontColor FFFFFF","BorderThickness 1.5","}","","skinparam database {","BackgroundColor 00FFFF","BorderColor 454645","FontColor 454645","}","","skinparam entity {","BackgroundColor FFE552","BorderColor 454645","FontColor 454645","}","","skinparam note {","BackgroundColor 7FFFD4","BorderColor 454645","FontColor 454645","BorderThickness 1.5","}","","skinparam actor {","BackgroundColor 454645","BorderColor 454645","FontColor 454645","}","","skinparam boundary {","BackgroundColor FFE552","BorderColor 454645","FontColor 454645","}","","skinparam control {","BackgroundColor FFE552","BorderColor 454645","FontColor 454645","}","","skinparam collections {","BackgroundColor FF5F42","BorderColor 454645","FontColor 454645","}","","skinparam queue {","BackgroundColor FF6347","BorderColor 454645","FontColor FFF","BorderThickness 1.5","}"].join(`
-`);function Xr(Dr){var ar=String(Dr??"").replace(/^\s+|\s+$/g,"").toLowerCase();return pr.hasOwnProperty(ar)?pr[ar]:null}function Tr(Dr){return Xr(Dr)!=null}function se(Dr){var ar=String(Dr??"").replace(/^\s+|\s+$/g,"").toLowerCase();return q.hasOwnProperty(ar)?q[ar]:null}function Kr(){var Dr=[];for(var ar in pr)pr.hasOwnProperty(ar)&&Dr.push(ar);return Dr}return{get:Xr,has:Tr,meta:se,names:Kr}})();var Lf=(function(){function pr(i){return i.replace(/\r\n|\r/g,`
-`)}function q(i,c){for(;c>0;){var F=i.charAt(c-1);if(F===`
-`)return!0;if(F!==" "&&F!==" ")return!1;c--}return!0}function Xr(i){if(i==null||typeof i!="string")return i;i=pr(i);for(var c=i.length,F=[],y=0,sr=0;y<c;){var kr=i.charAt(y);sr===0?kr==='"'?(F.push(kr),sr=1,y++):kr==="/"&&y+1<c&&i.charAt(y+1)==="'"?(sr=3,y+=2):kr==="'"&&q(i,y)?(sr=2,y++):(F.push(kr),y++):sr===1?kr==="\\"&&y+1<c?(F.push(kr),F.push(i.charAt(y+1)),y+=2):kr==='"'||kr===`
-`?(F.push(kr),sr=0,y++):(F.push(kr),y++):sr===2?(kr===`
-`&&(F.push(kr),sr=0),y++):kr==="'"&&y+1<c&&i.charAt(y+1)==="/"?(sr=0,y+=2):(kr===`
-`&&F.push(kr),y++)}return F.join("")}function Tr(i){if(i=i.replace(/^\s+|\s+$/g,""),i.length===0)return"";if(i.charAt(0)==='"'){for(var c=i.length-1;c>0&&i.charAt(c)!=='"';)c--;if(c>0){var F=i.substring(1,c);return F.replace(/\\"/g,'"').replace(/\\\\/g,"\\")}return i}return/^-?\d+$/.test(i)?parseInt(i,10):/^-?\d*\.\d+$/.test(i)?parseFloat(i):i}function se(i,c){for(var F=!1,y=!1,sr=0;sr<i.length;sr++){var kr=i.charAt(sr);y?y=!1:F?kr==="\\"?y=!0:kr==='"'&&(F=!1):kr==='"'?F=!0:kr==="{"||kr==="["?c++:(kr==="}"||kr==="]")&&c--}return c}function Kr(i){return Object.prototype.toString.call(i)==="[object Array]"}function Dr(i){return i!==null&&typeof i=="object"}function ar(i){return i==null?"":typeof i=="object"?JSON.stringify(i):typeof i=="boolean"?i?"1":"0":String(i)}function Y(i){return i===void 0?"":i===null?"null":String(i)}function $r(i,c){var F=i.charAt(c);if(!(F>="A"&&F<="Z"||F>="a"&&F<="z"||F==="_"))return c;for(c++;c<i.length&&(F=i.charAt(c),F>="A"&&F<="Z"||F>="a"&&F<="z"||F>="0"&&F<="9"||F==="_");)c++;return c}function rr(i,c){if(!(!Dr(i)||Kr(i)))return Object.prototype.hasOwnProperty.call(i,c)?i[c]:void 0}function H(i,c){if(c=c.replace(/^\s+|\s+$/g,""),Kr(i)){var F=parseInt(c,10);return String(F)===c&&F>=0&&F<i.length?i[F]:void 0}return rr(i,c)}function M(i,c,F,y){if(!Dr(i))return{value:i,pos:F};for(var sr=i;F<c.length&&Dr(sr);){var kr=c.charAt(F);if(kr==="."){for(var be=F+1;be<c.length;){var dr=c.charAt(be);if(dr>="A"&&dr<="Z"||dr>="a"&&dr<="z"||dr>="0"&&dr<="9"||dr==="_")be++;else break}if(be===F+1)break;sr=rr(sr,c.substring(F+1,be)),F=be}else if(kr==="["){for(var Mo=0,io=F+1;io<c.length;){var go=c.charAt(io);if(go==="[")Mo++;else if(go==="]"){if(Mo===0)break;Mo--}io++}if(io>=c.length)break;sr=H(sr,y(c.substring(F+1,io))),F=io+1}else break}return{value:Dr(sr)?sr:Y(sr),pos:F}}function j(i){var c=[];if(!Dr(i))return c;if(Kr(i)){for(var F=0;F<i.length;F++)c.push(Dr(i[F])?i[F]:Y(i[F]));return c}for(var y in i)Object.prototype.hasOwnProperty.call(i,y)&&c.push(y);return c}function gr(i){try{return JSON.parse(i)}catch{return}}function W(i,c){var F=i.replace(/^\s+|\s+$/g,"");if(F.length===0)return"";var y=F.charAt(0);if(y==="{"||y==="["){var sr=gr(F);return sr!==void 0?sr:Tr(i)}var kr=y==="$"||y==="%"||y==="("||y==='"'||y==="'"||y==="-"||y==="!"||y==="."||y>="0"&&y<="9"||/^(?:true|false)\b/.test(F),be=F.match(/^([A-Za-z_][\w]*)/);if(!kr&&be!=null&&c!=null&&c.defines!=null&&Object.prototype.hasOwnProperty.call(c.defines,be[1])&&(kr=!0),!kr&&be!=null&&c!=null&&c.functions!=null&&Object.prototype.hasOwnProperty.call(c.functions,be[1])&&(kr=!0),kr){var dr=nr(F,c||{});if(dr.complete)return dr.value}return Tr(i)}function d(i,c){return i.replace(/%([A-Za-z_][\w]*)%/g,function(F,y){return Object.prototype.hasOwnProperty.call(c,y)?ar(c[y]):F})}function _(i,c){if(i==null||typeof i!="string")return i;c=c||{};var F={};if(c.variables!=null)for(var y in c.variables)c.variables.hasOwnProperty(y)&&(F[y]=c.variables[y]);for(var sr=i.split(`
-`),kr=[],be=/^(\s*)!\$([A-Za-z_][\w]*)\s*=\s*(.*)$/,dr=0;dr<sr.length;dr++){var Mo=d(sr[dr],F),io=Mo.match(be);if(io!=null){F[io[2]]=W(io[3],{defines:c.defines||{},paramDefines:c.paramDefines||{},variables:F}),kr.push("");continue}kr.push(Mo)}c.variables==null&&(c.variables={});for(var go in F)F.hasOwnProperty(go)&&(c.variables[go]=F[go]);return kr.join(`
-`)}function p(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(i){if(i.length===0)return null;for(var c=i.slice().sort(function(sr,kr){return kr.length-sr.length}),F=[],y=0;y<c.length;y++)F.push(p(c[y]));return new RegExp("\\b("+F.join("|")+")\\b","g")}function L(i,c,F){return F==null?i:i.replace(F,function(y){return c[y]})}function N(i){i=i.replace(/^\s+|\s+$/g,"");var c=[];if(c.defaults=[],i.length===0)return c;for(var F=u(i),y=0;y<F.length;y++){var sr=F[y].replace(/^\s+|\s+$/g,""),kr=sr.indexOf("=");if(kr>0){var be=sr.substring(kr+1).replace(/^\s+|\s+$/g,"");c.push(sr.substring(0,kr).replace(/\s+$/,"")),c.defaults.push(be.replace(/^(["'])(.*)\1$/,"$2"))}else c.push(sr),c.defaults.push(null)}return c}function m(i,c){for(var F=0,y=null,sr=i.length,kr=c;kr<sr;kr++){var be=i.charAt(kr);if(y!=null){be==="\\"&&kr+1<sr?kr++:be===y&&(y=null);continue}if(be==='"'||be==="'")y=be;else if(be==="(")F++;else if(be===")"&&(F--,F===0))return kr}return-1}function u(i){var c=[],F=i.length;if(F===0)return c;for(var y="",sr=0,kr=null,be=0;be<F;be++){var dr=i.charAt(be);if(kr!=null){y+=dr,dr==="\\"&&be+1<F?(y+=i.charAt(be+1),be++):dr===kr&&(kr=null);continue}dr==='"'||dr==="'"?(kr=dr,y+=dr):dr==="("?(sr++,y+=dr):dr===")"?(sr--,y+=dr):dr===","&&sr===0?(c.push(y.replace(/^\s+|\s+$/g,"")),y=""):y+=dr}return c.push(y.replace(/^\s+|\s+$/g,"")),c}function R(i){for(var c=u(i.replace(/^\s+|\s+$/g,"")),F=[],y=0;y<c.length;y++){var sr=c[y].match(/^\s*\$?([A-Za-z_][\w]*)(?:\s*=\s*(.*))?$/);sr!=null&&F.push({name:sr[1],defaultExpression:sr[2]!=null?sr[2]:null})}return F}function o(i){var c=i.match(/^\s*!(?:(unquoted)\s+)?function\s+(\$?[A-Za-z_][\w]*)\s*\(/i);if(c==null)return null;var F=i.indexOf("(",c.index),y=m(i,F);if(y<0)return null;var sr=i.substring(y+1).replace(/^\s+|\s+$/g,""),kr=null;if(sr.length>0){var be=sr.match(/^!?return\b(.*)$/i);if(be==null)return null;kr=be[1].replace(/^\s+|\s+$/g,"")}return{name:c[2].replace(/^\$/,""),params:R(i.substring(F+1,y)),unquoted:c[1]!=null,inlineReturn:kr}}function t(i,c){if(i==null)return[];if(i=i.replace(/^\s+|\s+$/g,""),i.length===0)return[];var F=i.charAt(0),y=i.charAt(i.length-1);if(F==="{"||F==="["&&y==="]"){var sr=gr(i);if(Dr(sr))return j(sr)}if(F==="$"||F==="%")return j(W(i,c));if((F==="["&&y==="]"||F==="("&&y===")")&&(i=i.substring(1,i.length-1).replace(/^\s+|\s+$/g,"")),i.length===0)return[];for(var kr=u(i),be=[],dr=0;dr<kr.length;dr++)be.push(Tr(kr[dr]));return be}function n(i,c,F){if(c.length===0)return i;for(var y={},sr=c.defaults||[],kr=0;kr<c.length;kr++){var be=kr<F.length?F[kr]:sr[kr]!=null?sr[kr]:"";be.length>=2&&be.charAt(0)==='"'&&be.charAt(be.length-1)==='"'&&(be=be.substring(1,be.length-1)),y[c[kr]]=be}for(var dr=c.slice().sort(function(Gn,lo){return lo.length-Gn.length}),Mo=[],io=0;io<dr.length;io++){var go=dr[io];go.charAt(0)==="$"?Mo.push("\\$"+p(go.substring(1))+"(?![\\w])"):Mo.push("\\b"+p(go)+"\\b")}for(var gn=new RegExp("("+Mo.join("|")+")","g"),On=0;On<dr.length;On++){var co=p(dr[On]);i=i.replace(new RegExp(co+"##","g"),dr[On]+"").replace(new RegExp("##"+co,"g"),""+dr[On])}return i.replace(gn,function(Gn,lo){return y[lo]}).replace(/\u0001/g,"")}function f(i,c){for(var F="",y=0,sr=i.length,kr=/[A-Za-z_]/,be=/[A-Za-z0-9_]/;y<sr;){var dr=i.charAt(y);if(dr==="$"&&y+1<sr&&kr.test(i.charAt(y+1))){var Mo=y;for(y++;y<sr&&be.test(i.charAt(y));)y++;var io=i.substring(Mo,y);if(c.hasOwnProperty(io)&&y<sr&&i.charAt(y)==="("){var go=m(i,y);if(go<0){F+=io;continue}var gn=i.substring(y+1,go),On=u(gn),co=c[io];F+=n(co.body,co.params,On),y=go+1}else F+=io;continue}if(kr.test(dr)){for(var Gn=y;y<sr&&be.test(i.charAt(y));)y++;var lo=i.substring(Gn,y);if(c.hasOwnProperty(lo)&&y<sr&&i.charAt(y)==="("){var It=m(i,y);if(It<0){F+=lo;continue}var Un=i.substring(y+1,It),wa=u(Un),Ta=c[lo];F+=n(Ta.body,Ta.params,wa),y=It+1}else F+=lo}else F+=dr,y++}return F}function O(i,c,F){for(var y="",sr=0,kr=i.length,be=/[A-Za-z_]/,dr=/[A-Za-z0-9_]/;sr<kr;){var Mo=sr,io=!1;if(i.charAt(sr)==="$"&&sr+1<kr&&be.test(i.charAt(sr+1)))io=!0,sr++;else if(!be.test(i.charAt(sr))){y+=i.charAt(sr),sr++;continue}for(var go=sr;sr<kr&&dr.test(i.charAt(sr));)sr++;var gn=i.substring(go,sr);if(Object.prototype.hasOwnProperty.call(c,gn)&&sr<kr&&i.charAt(sr)==="("){var On=m(i,sr);if(On>=0){var co=i.substring(Mo,On+1),Gn=w(co,F);y+=ar(Gn),sr=On+1;continue}}y+=(io?"$":"")+gn}return y}function g(i,c){if(i.indexOf("%")<0)return i;for(var F="",y=0,sr=i.length,kr=/[A-Za-z_]/,be=/[A-Za-z0-9_]/;y<sr;){if(i.charAt(y)!=="%"||y+1>=sr||!kr.test(i.charAt(y+1))){F+=i.charAt(y),y++;continue}for(var dr=y+1,Mo=dr;Mo<sr&&be.test(i.charAt(Mo));)Mo++;var io=i.substring(dr,Mo);if(Mo<sr&&i.charAt(Mo)==="("&&P(io)){var go=m(i,Mo);if(go>=0){var gn=w(i.substring(y,go+1),c);F+=ar(gn),y=go+1;continue}}F+=i.substring(y,Mo),y=Mo}return F}function Q(i,c){var F="",y=0;function sr(io){return Q(d(io,c),c)}for(;y<i.length;){if(i.charAt(y)!=="$"){F+=i.charAt(y),y++;continue}var kr=$r(i,y+1);if(kr===y+1){F+="$",y++;continue}var be=i.substring(y+1,kr);if(i.charAt(kr)==="("||!Object.prototype.hasOwnProperty.call(c,be)){F+=i.substring(y,kr),y=kr;continue}var dr=c[be];if(typeof dr=="string"&&/^\$?[A-Za-z_][\w]*\s*\(/.test(dr)){F+=i.substring(y,kr),y=kr;continue}F.substring(F.length-2)==="##"&&(F=F.substring(0,F.length-2));var Mo=M(dr,i,kr,sr);F+=ar(Mo.value),y=Mo.pos,y+1<i.length&&i.charAt(y)==="#"&&i.charAt(y+1)==="#"&&(y+=2)}return F}function x(i,c){if(i==null||typeof i!="string")return i;c=c||{};var F={},y={};if(c.defines!=null)for(var sr in c.defines)c.defines.hasOwnProperty(sr)&&(F[sr]=c.defines[sr]);if(c.paramDefines!=null)for(var kr in c.paramDefines)c.paramDefines.hasOwnProperty(kr)&&(y[kr]=c.paramDefines[kr]);var be=i.split(`
-`),dr=[],Mo=/^\s*!define\s+([A-Za-z_][\w]*)\(([^)]*)\)(?:[ \t]+(.*))?$/,io=/^\s*!define\s+([A-Za-z_][\w]*)(?:[ \t]+(.*))?$/,go=/^\s*!undef\s+([A-Za-z_][\w]*)\s*$/,gn=/^\s*!definelong\s+([A-Za-z_][\w]*)(?:\(([^)]*)\))?\s*$/,On=/^\s*!end\s*(?:definelong|function|procedure)\b/i,co=/^\s*!(?:(?:unquoted|final)\s+)*procedure\s+\$?([A-Za-z_][\w]*)(?:\(([^)]*)\))?\s*$/i,Gn=On,lo=E(I(F)),It=!1,Un=null,wa=null,Ta=null;function Ea(){var sl=Ta.join(`
-`);wa!=null?(y[Un]={params:wa,body:sl},F.hasOwnProperty(Un)&&(delete F[Un],lo=E(I(F)))):(F[Un]=sl,lo=E(I(F)),y.hasOwnProperty(Un)&&delete y[Un]),It=!1,Un=null,wa=null,Ta=null}for(var Ua=0;Ua<be.length;Ua++){var oa=be[Ua],vn;if(It){if(On.test(oa)||Gn.test(oa)){Ea(),dr.push("");continue}Ta.push(oa),dr.push("");continue}if((vn=oa.match(gn))!=null){It=!0,Un=vn[1],wa=vn[2]!=null?N(vn[2]):null,Ta=[],dr.push("");continue}if((vn=oa.match(co))!=null){It=!0,Un="$"+vn[1],wa=N(vn[2]||""),Ta=[],dr.push("");continue}if((vn=oa.match(Mo))!=null){var Jl=vn[1],Ul=vn[3]!=null?vn[3].replace(/\s+$/,""):"";y[Jl]={params:N(vn[2]),body:Ul},F.hasOwnProperty(Jl)&&(delete F[Jl],lo=E(I(F))),dr.push("");continue}if((vn=oa.match(io))!=null){var _l=vn[2]!=null?vn[2].replace(/\s+$/,""):"";F[vn[1]]=_l,lo=E(I(F)),y.hasOwnProperty(vn[1])&&delete y[vn[1]],dr.push("");continue}if((vn=oa.match(go))!=null){F.hasOwnProperty(vn[1])&&(delete F[vn[1]],lo=E(I(F))),y.hasOwnProperty(vn[1])&&delete y[vn[1]],dr.push("");continue}var Ma=L(oa,F,lo);dr.push(f(Ma,y))}It&&Ea(),c.defines==null&&(c.defines={});for(var gl in c.defines)c.defines.hasOwnProperty(gl)&&!F.hasOwnProperty(gl)&&delete c.defines[gl];for(var Ia in F)F.hasOwnProperty(Ia)&&(c.defines[Ia]=F[Ia]);c.paramDefines==null&&(c.paramDefines={});for(var tt in c.paramDefines)c.paramDefines.hasOwnProperty(tt)&&!y.hasOwnProperty(tt)&&delete c.paramDefines[tt];for(var Vn in y)y.hasOwnProperty(Vn)&&(c.paramDefines[Vn]=y[Vn]);return dr.join(`
-`)}function I(i){var c=[];for(var F in i)i.hasOwnProperty(F)&&c.push(F);return c}function w(i,c){return i==null?"":nr(i,c||{}).value}function nr(i,c){if(i==null)return{value:"",complete:!0};var F={text:String(i),pos:0,config:c||{},supported:!0};lr(F);var y=Zr(F);return lr(F),{value:y,complete:F.supported&&F.pos===F.text.length}}function lr(i){for(;i.pos<i.text.length;){var c=i.text.charAt(i.pos);if(c===" "||c===" ")i.pos++;else break}}function ir(i,c){return i.text.substr(i.pos,c.length)===c}function mr(i,c){return ir(i,c)?(i.pos+=c.length,!0):!1}function Or(i){if(typeof i=="number")return i;if(typeof i=="boolean")return i?1:0;if(i==null||i==="")return 0;var c=parseFloat(i);return isNaN(c)?0:c}function Qr(i){return typeof i=="boolean"?i:typeof i=="number"?i!==0:i==null?!1:typeof i=="string"?!(i===""||i==="false"||i==="0"):!!i}function ee(i){return typeof i=="string"||Dr(i)}function re(i){return typeof i=="number"?!0:typeof i=="string"?/^-?\d+(?:\.\d+)?$/.test(i):!1}function Yr(i,c,F){var y,sr;switch(re(i)&&re(c)?(y=Or(i),sr=Or(c)):(y=ar(i),sr=ar(c)),F){case"==":return y===sr;case"!=":return y!==sr;case"<":return y<sr;case">":return y>sr;case"<=":return y<=sr;case">=":return y>=sr}return!1}function Zr(i){for(var c=Ee(i);lr(i),!!mr(i,"||");){var F=Ee(i);c=Qr(c)||Qr(F)}return c}function Ee(i){for(var c=Ze(i);lr(i),!!mr(i,"&&");){var F=Ze(i);c=Qr(c)&&Qr(F)}return c}function Ze(i){var c=eo(i);lr(i);for(var F=["==","!=","<=",">=","<",">"],y=0;y<F.length;y++)if(mr(i,F[y])){var sr=eo(i);return Yr(c,sr,F[y])}return c}function eo(i){for(var c=Gr(i);;){lr(i);var F=i.text.charAt(i.pos);if(F!=="+"&&F!=="-")break;i.pos++;var y=Gr(i);F==="+"?ee(c)||ee(y)?c=ar(c)+ar(y):c=Or(c)+Or(y):c=Or(c)-Or(y)}return c}function Gr(i){for(var c=$e(i);;){lr(i);var F=i.text.charAt(i.pos);if(F!=="*"&&F!=="/")break;i.pos++;var y=$e(i);if(F==="*")c=Or(c)*Or(y);else{var sr=Or(y);c=sr===0?0:Or(c)/sr}}return c}function $e(i){lr(i);var c=i.text.charAt(i.pos);return c==="-"?(i.pos++,-Or($e(i))):c==="!"&&i.text.charAt(i.pos+1)!=="="?(i.pos++,!Qr($e(i))):Ye(i)}function Ye(i){if(lr(i),i.pos>=i.text.length)return"";var c=i.text.charAt(i.pos);if(c==="("){i.pos++;var F=Zr(i);return lr(i),i.text.charAt(i.pos)===")"&&i.pos++,F}if(c==='"'||c==="'")return k(i);if(c==="$"){i.pos++;var y=Hr(i);if(y==="")return"";var sr=T(D(y,i.config),i);return sr.consumed?sr.value:(lr(i),i.text.charAt(i.pos)==="("?fn(y,i,!1):sr.value)}if(c==="%"){var kr=i.pos;i.pos++;var be=Hr(i);return be!==""&&i.text.charAt(i.pos)==="%"?(i.pos++,D(be,i.config)):be!==""&&i.text.charAt(i.pos)==="("?fn(be,i,!0):(i.pos=kr,"")}if(c>="0"&&c<="9"||c===".")return Fo(i);if(c>="A"&&c<="Z"||c>="a"&&c<="z"||c==="_"){var dr=Hr(i);return dr==="true"||dr==="false"?dr:(lr(i),i.text.charAt(i.pos)==="("?fn(dr,i,!1):i.config.variables!=null&&Object.prototype.hasOwnProperty.call(i.config.variables,dr)?i.config.variables[dr]:i.config.defines!=null&&Object.prototype.hasOwnProperty.call(i.config.defines,dr)?i.config.defines[dr]:dr)}return""}function Hr(i){var c=i.pos,F=i.text.charAt(i.pos);if(!(F>="A"&&F<="Z"||F>="a"&&F<="z"||F==="_"))return"";for(i.pos++;i.pos<i.text.length&&(F=i.text.charAt(i.pos),F>="A"&&F<="Z"||F>="a"&&F<="z"||F>="0"&&F<="9"||F==="_");)i.pos++;return i.text.substring(c,i.pos)}function Fo(i){for(var c=i.pos,F=!1;i.pos<i.text.length;){var y=i.text.charAt(i.pos);if(y>="0"&&y<="9")i.pos++;else if(y==="."&&!F)F=!0,i.pos++;else break}var sr=i.text.substring(c,i.pos),kr=parseFloat(sr);return isNaN(kr)?0:kr}function k(i){var c=i.text.charAt(i.pos);i.pos++;for(var F="";i.pos<i.text.length;){var y=i.text.charAt(i.pos);if(y===c)return i.pos++,F;F+=y,i.pos++}return F}function T(i,c){var F=c.config!=null&&c.config.variables!=null?c.config.variables:{},y=M(i,c.text,c.pos,function(kr){return Q(d(kr,F),F)}),sr=y.pos>c.pos;return c.pos=y.pos,{value:y.value,consumed:sr}}function D(i,c){return c.variables!=null&&Object.prototype.hasOwnProperty.call(c.variables,i)?c.variables[i]:""}function S(i,c){return c.defines!=null&&Object.prototype.hasOwnProperty.call(c.defines,i)?c.defines[i]:""}function U(i,c){return!!(c.defines!=null&&Object.prototype.hasOwnProperty.call(c.defines,i)||c.paramDefines!=null&&Object.prototype.hasOwnProperty.call(c.paramDefines,i))}function P(i){return/^(?:newline|n|breakline|true|false|not|boolval|intval|string|strlen|size|upper|lower|substr|strpos|mod|function_exists|variable_exists|get_variable_value|set_variable_value|call_user_func|lighten|darken|splitstr|splitstr_regex|get_json_keys|get_json_type|json_key_exists|str2json|json_add|json_set|json_remove|json_merge|chr|ord|dec2hex|hex2dec|date|now|random|eval|feature|version|percent|dollar|backslash|tab|and|or|xor|nand|nor|nxor|is_dark|is_light|reverse_color|hsl_color|left_align|right_align|getenv|filename|filename_no_extension|dirpath|filedate|file_exists|xargs|load_json|get_current_theme|get_all_theme|get_all_stdlib|get_stdlib|invoke_procedure|retrieve_procedure)$/.test(i)}var s="1.2026.6";function $(i){var c=String(i??"").replace(/^\s+|\s+$/g,""),F=/^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.exec(c);if(F==null)return null;var y=F[1].length===3?F[1].charAt(0)+F[1].charAt(0)+F[1].charAt(1)+F[1].charAt(1)+F[1].charAt(2)+F[1].charAt(2):F[1];return{r:parseInt(y.substring(0,2),16),g:parseInt(y.substring(2,4),16),b:parseInt(y.substring(4,6),16)}}function G(i){var c=Math.round(Math.max(0,Math.min(255,i))),F=c.toString(16).toUpperCase();return F.length<2?"0"+F:F}function B(i){var c=$(i);return c==null?!1:Math.floor((c.r*299+c.g*587+c.b*114)/1e3)<128}function or(i){var c=$(i);return c==null?String(i??""):"#"+G(255-c.r)+G(255-c.g)+G(255-c.b)}function K(i,c,F,y){var sr=(i%360+360)%360/360,kr=Math.max(0,Math.min(100,c))/100,be=Math.max(0,Math.min(100,F))/100,dr=be<.5?be*(1+kr):be+kr-kr*be,Mo=2*be-dr;function io(gn,On,co){return co<0&&(co+=1),co>1&&(co-=1),6*co<1?gn+(On-gn)*6*co:2*co<1?On:3*co<2?gn+(On-gn)*6*(2/3-co):gn}var go=G(io(Mo,dr,sr+1/3)*255)+G(io(Mo,dr,sr)*255)+G(io(Mo,dr,sr-1/3)*255);return y==null?"#"+go:("#"+G(Math.round(y*255))+go).toLowerCase()}var hr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],vr=["January","February","March","April","May","June","July","August","September","October","November","December"];function Jr(i,c){var F=null;if(c!=null&&typeof Intl=="object"&&typeof Intl.DateTimeFormat=="function")try{for(var y=new Intl.DateTimeFormat("en-US",{timeZone:c,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}).formatToParts(i),sr={},kr=0;kr<y.length;kr++)sr[y[kr].type]=y[kr].value;F={year:parseInt(sr.year,10),month:parseInt(sr.month,10),day:parseInt(sr.day,10),hours:parseInt(sr.hour,10)%24,minutes:parseInt(sr.minute,10),seconds:parseInt(sr.second,10),millis:i.getMilliseconds(),weekday:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(sr.weekday)};var be=Date.UTC(F.year,F.month-1,F.day,F.hours,F.minutes,F.seconds);F.offsetMinutes=Math.round((be-Math.floor(i.getTime()/1e3)*1e3)/6e4)}catch{F=null}return F==null&&(F={year:i.getFullYear(),month:i.getMonth()+1,day:i.getDate(),hours:i.getHours(),minutes:i.getMinutes(),seconds:i.getSeconds(),millis:i.getMilliseconds(),weekday:i.getDay(),offsetMinutes:-i.getTimezoneOffset()}),F}function Ge(i,c){for(var F=String(i);F.length<c;)F="0"+F;return F}function no(i,c,F){var y=Jr(c,F),sr="",kr=0;function be(gn){var On=y.offsetMinutes<0?"-":"+",co=Math.abs(y.offsetMinutes),Gn=Ge(Math.floor(co/60),2),lo=Ge(co%60,2);return gn==="z"?F!=null&&/^(?:UTC|GMT|Etc\/UTC|Etc\/GMT)$/i.test(F)?"UTC":"GMT"+On+Gn+":"+lo:gn==="X"?y.offsetMinutes===0?"Z":On+Gn+(lo==="00"?"":lo):On+Gn+lo}for(;kr<i.length;){var dr=i.charAt(kr);if(dr==="'"){if(i.charAt(kr+1)==="'"){sr+="'",kr+=2;continue}var Mo=i.indexOf("'",kr+1);if(Mo<0){sr+=i.substring(kr+1);break}sr+=i.substring(kr+1,Mo),kr=Mo+1;continue}if(!/[A-Za-z]/.test(dr)){sr+=dr,kr++;continue}for(var io=kr;io<i.length&&i.charAt(io)===dr;)io++;var go=io-kr;switch(kr=io,dr){case"y":sr+=go===2?Ge(y.year%100,2):Ge(y.year,go);break;case"M":sr+=go>=4?vr[y.month-1]:go===3?vr[y.month-1].substring(0,3):Ge(y.month,go);break;case"d":sr+=Ge(y.day,go);break;case"H":sr+=Ge(y.hours,go);break;case"k":sr+=Ge(y.hours===0?24:y.hours,go);break;case"K":sr+=Ge(y.hours%12,go);break;case"h":sr+=Ge(y.hours%12===0?12:y.hours%12,go);break;case"m":sr+=Ge(y.minutes,go);break;case"s":sr+=Ge(y.seconds,go);break;case"S":sr+=Ge(y.millis,go);break;case"E":sr+=go>=4?hr[y.weekday]:hr[y.weekday].substring(0,3);break;case"a":sr+=y.hours<12?"AM":"PM";break;case"z":case"Z":case"X":sr+=be(dr);break;default:sr+=i.substring(io-go,io)}}return sr}function bo(i,c){for(var F=[],y="",sr=0;sr<i.length;sr++){var kr=i.charAt(sr);c.indexOf(kr)>=0?y.length>0&&(F.push(y),y=""):y+=kr}return y.length>0&&F.push(y),F}function Oo(i){return Dr(i)?JSON.parse(JSON.stringify(i)):i}function We(i){if(i==null)return"string";if(Kr(i))return"array";if(Dr(i))return"object";if(typeof i=="number"||typeof i=="boolean")return"number";var c=gr(String(i));return c===void 0?"string":Kr(c)?"array":Dr(c)?"object":c===null?"json":typeof c=="boolean"?"boolean":typeof c=="number"?"number":"string"}function Tt(i){var c=[],F;if(Kr(i)){for(var y=0;y<i.length;y++)if(Dr(i[y])&&!Kr(i[y]))for(F in i[y])Object.prototype.hasOwnProperty.call(i[y],F)&&c.push(F);return c}if(Dr(i))for(F in i)Object.prototype.hasOwnProperty.call(i,F)&&c.push(F);return c}function Cn(i,c,F){for(var y in c)Object.prototype.hasOwnProperty.call(c,y)&&(F&&Dr(i[y])&&!Kr(i[y])&&Dr(c[y])&&!Kr(c[y])&&Object.prototype.hasOwnProperty.call(i,y)?Cn(i[y],c[y],!0):i[y]=Oo(c[y]));return i}function un(i){return typeof i=="number"?i===Math.floor(i)&&i>=0?i:-1:typeof i=="string"&&/^\d+$/.test(i)?parseInt(i,10):-1}function Kt(i,c){var F;try{F=i.split(new RegExp(c))}catch{return[i]}for(;F.length>0&&F[F.length-1]==="";)F.pop();return F}function ut(i,c){var F=String(i??"").replace(/^\s+|\s+$/g,""),y=/^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.exec(F);if(y==null)return F;var sr=y[1].length===3?y[1].charAt(0)+y[1].charAt(0)+y[1].charAt(1)+y[1].charAt(1)+y[1].charAt(2)+y[1].charAt(2):y[1],kr=parseInt(sr.substring(0,2),16)/255,be=parseInt(sr.substring(2,4),16)/255,dr=parseInt(sr.substring(4,6),16)/255,Mo=Math.min(kr,Math.min(be,dr)),io=Math.max(kr,Math.max(be,dr)),go=0;io===Mo?go=0:io===kr?go=(60*(be-dr)/(io-Mo)+360)%360:io===be?go=60*(dr-kr)/(io-Mo)+120:go=60*(kr-be)/(io-Mo)+240;var gn=(io+Mo)/2,On=0;io===Mo?On=0:gn<=.5?On=(io-Mo)/(io+Mo):On=(io-Mo)/(2-io-Mo);var co=gn*100;co+=co*(c/100),co<0&&(co=0),co>100&&(co=100);var Gn=go%360/360,lo=On,It=co/100,Un=It<.5?It*(1+lo):It+lo-lo*It,wa=2*It-Un;function Ta(Ua,oa,vn){return vn<0&&(vn+=1),vn>1&&(vn-=1),6*vn<1?Ua+(oa-Ua)*6*vn:2*vn<1?oa:3*vn<2?Ua+(oa-Ua)*6*(2/3-vn):Ua}function Ea(Ua){var oa=Math.round(Math.max(0,Math.min(1,Ua))*255),vn=oa.toString(16).toUpperCase();return vn.length<2?"0"+vn:vn}return"#"+Ea(Ta(wa,Un,Gn+1/3))+Ea(Ta(wa,Un,Gn))+Ea(Ta(wa,Un,Gn-1/3))}function fn(i,c,F){if(c.pos++,F&&(i==="newline"||i==="n"||i==="breakline"||i==="left_align"||i==="right_align")&&(lr(c),c.text.charAt(c.pos)===")"))return c.pos++,i==="breakline"?`
-`:"\\n";if(F&&(i==="true"||i==="false")&&(lr(c),c.text.charAt(c.pos)===")"))return c.pos++,i==="true";if(F&&P(i)){var y=c.pos-1,sr=m(c.text,y);if(sr<0)return c.supported=!1,c.pos=c.text.length,"";for(var kr=c.text.substring(y+1,sr),be=u(kr),dr=[],Mo=0;Mo<be.length;Mo++)dr.push(W(be[Mo],c.config));switch(c.pos=sr+1,i){case"not":return!Qr(dr[0]);case"boolval":return Qr(dr[0]);case"intval":return parseInt(dr[0],10)||0;case"string":return ar(dr[0]);case"strlen":return ar(dr[0]).length;case"size":{var io=dr[0];return typeof io=="number"?0:Kr(io)?io.length:Dr(io)?I(io).length:ar(io).length}case"chr":{var go=Or(dr[0]);try{return String.fromCodePoint(go)}catch{return""}}case"ord":{var gn=ar(dr[0]),On=gn.length>0?gn.codePointAt(0):0;return On??0}case"dec2hex":{var co=Or(dr[0]);return(co<0?co>>>0:Math.floor(co)).toString(16)}case"hex2dec":{var Gn=ar(dr[0]).replace(/^\s+|\s+$/g,"");return/^[+-]?[0-9A-Fa-f]{1,8}$/.test(Gn)?parseInt(Gn,16):0}case"now":return Math.floor(Date.now()/1e3);case"date":{var lo=dr.length>1?new Date(Or(dr[1])*1e3):new Date,It=dr.length>2?ar(dr[2]):null;return dr.length===0?no("EEE MMM dd HH:mm:ss zzz yyyy",lo,null):no(ar(dr[0]),lo,It)}case"random":{if(dr.length===0)return Math.floor(Math.random()*2);var Un=dr.length>1?Or(dr[0]):0,wa=Or(dr[dr.length>1?1:0]);return wa>Un?Un+Math.floor(Math.random()*(wa-Un)):Un}case"eval":{var Ta=w(ar(dr[0]),c.config),Ea=Or(Ta);return Ea<0?Math.ceil(Ea):Math.floor(Ea)}case"feature":{var Ua=ar(dr[0]).toLowerCase();return Ua==="style"||Ua==="theme"?1:0}case"version":return s;case"percent":return"%";case"dollar":return"$";case"backslash":return"\\";case"tab":return" ";case"and":case"nand":{for(var oa=!0,vn=0;vn<dr.length;vn++)Qr(dr[vn])||(oa=!1);return i==="and"?oa:!oa}case"or":case"nor":{for(var Jl=!1,Ul=0;Ul<dr.length;Ul++)Qr(dr[Ul])&&(Jl=!0);return i==="or"?Jl:!Jl}case"xor":case"nxor":{for(var _l=0,Ma=0;Ma<dr.length;Ma++)Qr(dr[Ma])&&_l++;return i==="xor"?_l===1:_l!==1}case"is_dark":return B(dr[0]);case"is_light":return!B(dr[0]);case"reverse_color":return or(dr[0]);case"hsl_color":return K(Or(dr[0]),Or(dr[1]),Or(dr[2]),dr.length>3?Or(dr[3])/100:null);case"getenv":case"filename":case"filename_no_extension":case"dirpath":case"filedate":case"xargs":return"";case"file_exists":return!1;case"load_json":return dr.length>1?dr[1]:{};case"get_current_theme":return c.config.themeName!=null?{name:c.config.themeName}:{};case"get_all_theme":return typeof ef.names=="function"?ef.names():[];case"get_all_stdlib":return dr.length>0?{}:[];case"get_stdlib":return dr.length>1?"":{};case"invoke_procedure":case"retrieve_procedure":{var gl=String(dr.shift()||"").replace(/^\$/,"");return c.config.functions==null||!Object.prototype.hasOwnProperty.call(c.config.functions,gl)||typeof c.config.callUserFunction!="function"?"":c.config.callUserFunction(gl,dr,{})}case"upper":return ar(dr[0]).toUpperCase();case"lower":return ar(dr[0]).toLowerCase();case"substr":{var Ia=ar(dr[0]),tt=Or(dr[1]);return dr.length>2?Ia.substr(tt,Or(dr[2])):Ia.substr(tt)}case"strpos":return ar(dr[0]).indexOf(ar(dr[1]));case"mod":{var Vn=Or(dr[1]);return Vn===0?0:Or(dr[0])%Vn}case"function_exists":{var sl=String(dr[0]||"").replace(/^[\$%]/,"");return P(sl)||c.config.functions!=null&&Object.prototype.hasOwnProperty.call(c.config.functions,sl)}case"variable_exists":{var El=String(dr[0]||"").replace(/^\$/,"");return c.config.variables!=null&&Object.prototype.hasOwnProperty.call(c.config.variables,El)||c.config.defines!=null&&Object.prototype.hasOwnProperty.call(c.config.defines,El)||c.config.paramDefines!=null&&Object.prototype.hasOwnProperty.call(c.config.paramDefines,El)}case"get_variable_value":{var ui=String(dr[0]||"").replace(/^\$/,"");return D(ui,c.config)}case"set_variable_value":{var rl=String(dr[0]||"").replace(/^\$/,"");return typeof c.config.setGlobalVariable=="function"&&c.config.setGlobalVariable(rl,dr.length>1?dr[1]:""),""}case"call_user_func":{var Rl=String(dr.shift()||"").replace(/^\$/,"");return typeof c.config.callUserFunction=="function"?c.config.callUserFunction(Rl,dr,{}):""}case"lighten":return ut(dr[0],Or(dr[1]));case"darken":return ut(dr[0],-Or(dr[1]));case"splitstr":return bo(ar(dr[0]),ar(dr[1]));case"splitstr_regex":return Kt(ar(dr[0]),ar(dr[1]));case"get_json_keys":return Tt(dr[0]);case"get_json_type":return We(dr[0]);case"json_key_exists":{var pl=dr[0];return!Dr(pl)||Kr(pl)||typeof dr[1]!="string"?!1:Object.prototype.hasOwnProperty.call(pl,dr[1])}case"str2json":{var Al=gr(ar(dr[0]));return Al===void 0?"":Al}case"json_add":case"json_set":{var Wa=Oo(dr[0]);if(!Dr(Wa))return dr[0];if(Kr(Wa)){if(i==="json_add")Wa.push(dr[1]);else{var ai=un(dr[1]);ai>=0&&ai<Wa.length&&(Wa[ai]=dr[2])}return Wa}return i==="json_set"&&dr.length<3?Dr(dr[1])?Cn(Wa,dr[1],!0):Wa:(Wa[ar(dr[1])]=dr[2],Wa)}case"json_remove":{var tt=Oo(dr[0]);if(!Dr(tt))return dr[0];if(Kr(tt)){var Nl=un(dr[1]);return Nl>=0&&Nl<tt.length&&tt.splice(Nl,1),tt}return delete tt[ar(dr[1])],tt}case"json_merge":{var xa=dr[0],fi=dr[1];return!Dr(xa)||!Dr(fi)||Kr(xa)!==Kr(fi)?xa:Kr(xa)?Oo(xa).concat(Oo(fi)):Cn(Oo(xa),fi,!1)}}}if(!F&&i==="defined"){lr(c);var Ni=Hr(c);return lr(c),c.text.charAt(c.pos)===")"&&c.pos++,U(Ni,c.config)}if(!F&&c.config.functions!=null&&Object.prototype.hasOwnProperty.call(c.config.functions,i)&&typeof c.config.callUserFunction=="function"){var Oi=c.pos-1,Vl=m(c.text,Oi);if(Vl<0)return c.supported=!1,c.pos=c.text.length,"";for(var gi=c.text.substring(Oi+1,Vl),el=c.config.functions[i],$a=u(gi),li=[],wl={},Xa=0;Xa<$a.length;Xa++){var Ql=$a[Xa].match(/^\s*\$?([A-Za-z_][\w]*)\s*=(?!=)\s*(.*)$/);Ql!=null?wl[Ql[1]]=W(Ql[2],c.config):li.push(W($a[Xa],c.config))}return c.pos=Vl+1,c.config.callUserFunction(i,li,wl,el)}for(c.supported=!1,lr(c);c.pos<c.text.length&&c.text.charAt(c.pos)!==")";)Zr(c),lr(c),c.text.charAt(c.pos)===","&&(c.pos++,lr(c));return c.text.charAt(c.pos)===")"&&c.pos++,""}function vt(i,c){if(i==null||typeof i!="string")return i;c=c||{};var F={},y={},sr={},kr={};if(c.defines!=null)for(var be in c.defines)c.defines.hasOwnProperty(be)&&(F[be]=c.defines[be]);if(c.paramDefines!=null)for(var dr in c.paramDefines)c.paramDefines.hasOwnProperty(dr)&&(y[dr]=c.paramDefines[dr]);if(c.functions!=null)for(var Mo in c.functions)c.functions.hasOwnProperty(Mo)&&(sr[Mo]=c.functions[Mo]);if(c.variables!=null)for(var io in c.variables)c.variables.hasOwnProperty(io)&&(kr[io]=c.variables[io]);var go=c._functionScope||null,gn=go!=null?go.globals:kr,On=go!=null?go.localNames:null,co=c._preprocessorRuntime;co==null&&(co={steps:0,outputChars:0,callDepth:0,maxSteps:c.maxPreprocessorSteps!=null?c.maxPreprocessorSteps:zt,maxOutputChars:c.maxPreprocessorOutputChars!=null?c.maxPreprocessorOutputChars:Ga,maxCallDepth:c.maxFunctionCallDepth!=null?c.maxFunctionCallDepth:jt,exhausted:!1,included:{},subs:{},warningKeys:{},warnings:c.preprocessorWarnings||[]}),c._preprocessorRuntime=co,(c.preprocessorWarnings!=null||go!=null)&&(c.preprocessorWarnings=co.warnings);for(var Gn=i.split(`
-`),lo=[],It=[],Un=0;Un<Gn.length;Un++)It.push(Un);var wa=[];function Ta(lt,na,Rn){for(var ja=[],Qn=0;Qn<na.length;Qn++)ja.push(Rn);Array.prototype.splice.apply(Gn,[lt,0].concat(na)),Array.prototype.splice.apply(It,[lt,0].concat(ja))}function Ea(lt){for(var na=-1,Rn=0;Rn<lt.length;Rn++)if(/^\s*@start[A-Za-z]*\b/i.test(lt[Rn])){na=Rn;break}if(na<0)return lt;for(var ja=[],Qn=na+1;Qn<lt.length&&!/^\s*@end[A-Za-z]*\b/i.test(lt[Qn]);Qn++)ja.push(lt[Qn]);return ja}function Ua(lt){return Q(lt,kr).replace(/^\s+|\s+$/g,"").replace(/^(["'])(.*)\1$/,"$2")}var oa=/C4_(?:Container|Context|Component|Code|Dynamic|Deployment)\.puml$/i;function vn(lt){var na=c.stdlib;if(na==null)return null;for(var Rn=lt.replace(/^<|>$/g,""),ja=[lt,Rn,Rn.replace(/\.puml$/i,""),Rn+".puml"],Qn=0;Qn<ja.length;Qn++)if(Object.prototype.hasOwnProperty.call(na,ja[Qn])&&typeof na[ja[Qn]]=="string")return{name:"<"+Rn+">",lines:Ea(pr(na[ja[Qn]]).split(`
-`))};return null}function Jl(lt,na){for(var Rn=null,ja=!1,Qn=0;Qn<lt.length;Qn++){var Ri=lt[Qn].match(nf);if(Ri!=null){Ri[1]===na&&(ja=!1,Rn==null&&(Rn=[]));continue}af.test(lt[Qn])&&Rn!=null&&(ja=!0),Rn!=null&&!ja&&Rn.push(lt[Qn])}return Rn}function Ul(lt){var na=c.includes;if(na==null)return null;var Rn=Q(lt,kr).replace(/^\s+|\s+$/g,"").replace(/^(["'])(.*)\1$/,"$2"),ja=null;return Object.prototype.hasOwnProperty.call(na,Rn)?ja=na[Rn]:Rn.lastIndexOf("!")>0&&(Rn=Rn.substring(0,Rn.lastIndexOf("!")),Object.prototype.hasOwnProperty.call(na,Rn)&&(ja=na[Rn])),typeof ja!="string"?null:{name:Rn,lines:Ea(pr(ja).split(`
-`))}}function _l(lt,na){var Rn={code:"preprocessor",message:lt,line:null};na!=null&&na>=0&&(Rn.bodyIndex=na),co.warnings.push(Rn),c.preprocessorWarnings=co.warnings}function Ma(lt,na,Rn){co.warningKeys.hasOwnProperty(lt)||(co.warningKeys[lt]=!0,_l(na,Rn))}function gl(lt){return go==null&&lt!=null&&lt<It.length?It[lt]:null}lo.push=function(lt,na){var Rn=lt==null?"":String(lt);if(co.outputChars+=Rn.length+1,co.outputChars>co.maxOutputChars)return co.exhausted=!0,Ma("output-budget","preprocessor output exceeded "+co.maxOutputChars+" characters"),lo.length;var ja=na??(Za<It.length?It[Za]:-1),Qn=-1;do wa.push(ja),Qn=Rn.indexOf(`
-`,Qn+1);while(Qn>=0);return Array.prototype.push.call(lo,lt)};var Ia=[],tt=!0,Vn=[],sl=!1,El=c.maxLoopIterations!=null?c.maxLoopIterations:Zo,ui=!1,rl=null,Rl=null,pl=null,Al=!1,Wa=null,ai=null,Nl=!1,xa=/^(\s*)!\$([A-Za-z_][\w]*)\s*(\??)=\s*(.*)$/,fi=/^\s*!local\s+\$([A-Za-z_][\w]*)\s*(\??)=\s*(.*)$/i,Ni=/^\s*!global\s+\$([A-Za-z_][\w]*)\s*(\??)=\s*(.*)$/i,Oi=/^\s*@(?:start|end)[A-Za-z]*\b/i,Vl=/^\s*!define\s+([A-Za-z_][\w]*)\(([^)]*)\)(?:[ \t]+(.*))?$/,gi=/^\s*!define\s+([A-Za-z_][\w]*)(?:[ \t]+(.*))?$/,el=/^\s*!undef\s+([A-Za-z_][\w]*)\s*$/,$a=/^\s*!definelong\s+([A-Za-z_][\w]*)(?:\(([^)]*)\))?\s*$/,li=/^\s*!end\s*(?:definelong|function|procedure)\b/i,wl=/^\s*!((?:(?:unquoted|final)\s+)*)procedure\s+\$?([A-Za-z_][\w]*)(?:\(([^)]*)\))?\s*$/i,Xa=li,Ql=li,Ll=/^\s*!return\b(.*)$/i,Dl=/^\s*!if\b(.*)$/,qa=/^\s*!elseif\b(.*)$/,pi=/^\s*!else\s*$/,Fi=/^\s*!endif\s*$/,bi=/^\s*!ifdef\s+([A-Za-z_][\w]*)\s*$/,Ki=/^\s*!ifndef\s+([A-Za-z_][\w]*)\s*$/,ts=/^\s*!while\b(.*)$/,di=/^\s*!endwhile\s*$/,ns=/^\s*!foreach\s+\$([A-Za-z_][\w]*)\s+(?:in|from)\s+(.*)$/,Vi=/^\s*!end(?:for|foreach)\s*$/,cu=/^\s*!exit\b(.*)$/,Ns=/^\s*!log\b(.*)$/,ds=/^\s*!assert\b(.*)$/,gs=/^\s*!theme\s+(\S+)(?:\s+from\s+(.*?))?\s*$/i,Ws=/^\s*!include(_once|_many|url)?\s+(.+?)\s*$/i,Dd=/^\s*!includesub\s+(.+?)\s*$/i,nf=/^\s*!startsub\s+(\S+)\s*$/i,af=/^\s*!endsub\b/i,Ls=null,lf=-1,ou=E(I(F));function bs(){var lt=pl.join(`
-`);Rl!=null?(y[rl]={params:Rl,body:lt},F.hasOwnProperty(rl)&&(delete F[rl],ou=E(I(F)))):(F[rl]=lt,ou=E(I(F)),y.hasOwnProperty(rl)&&delete y[rl]),ui=!1,rl=null,Rl=null,pl=null}function tu(lt,na,Rn){sr[lt.name]={params:lt.params,body:na.slice(),unquoted:lt.unquoted,procedure:lt.procedure===!0,declarationLine:Rn}}function sf(){if(go!=null)for(var lt in gn)gn.hasOwnProperty(lt)&&!On.hasOwnProperty(lt)&&(kr[lt]=gn[lt])}function Du(lt,na,Rn){if(go==null){kr[lt]=na;return}if(Rn==="global"){gn[lt]=na,On.hasOwnProperty(lt)||(kr[lt]=na);return}if(Rn==="local"||On.hasOwnProperty(lt)){On[lt]=!0,kr[lt]=na;return}if(gn.hasOwnProperty(lt)){gn[lt]=na,kr[lt]=na;return}On[lt]=!0,kr[lt]=na}function wf(lt,na,Rn){if(!sr.hasOwnProperty(lt))return"";if(co.callDepth>=co.maxCallDepth)return Ma("call-depth","return-function call depth exceeded "+co.maxCallDepth+" while calling "+lt+"()"),"";var ja=sr[lt],Qn={},Ri={};for(var Ps in gn)gn.hasOwnProperty(Ps)&&(Qn[Ps]=gn[Ps]);for(var Es=0;Es<ja.params.length;Es++){var Zs=ja.params[Es],js;Rn.hasOwnProperty(Zs.name)?js=Rn[Zs.name]:Es<na.length?js=na[Es]:Zs.defaultExpression!=null?js=W(Zs.defaultExpression,{defines:F,paramDefines:y,variables:Qn,functions:sr,callUserFunction:wf,setGlobalVariable:function(Mu,Kf){gn[Mu]=Kf}}):js="",Ri[Zs.name]=!0,Qn[Zs.name]=js}var lu={defines:F,paramDefines:y,functions:sr,variables:Qn,maxLoopIterations:El,_preprocessorRuntime:co,_functionScope:{globals:gn,localNames:Ri},includes:c.includes,preprocessorWarnings:co.warnings,preprocessorLogs:c.preprocessorLogs||[]};co.callDepth++;var Af;try{Af=vt(ja.body.join(`
-`),lu)}finally{co.callDepth--}return c.preprocessorLogs=lu.preprocessorLogs,co.warnings.length>0&&(c.preprocessorWarnings=co.warnings),sf(),ja.procedure?Af.split(`
-`).filter(function(Mu){return Mu.length>0}).join(`
-`):lu.functionReturned?lu.functionReturn:""}function as(){return{defines:F,paramDefines:y,variables:kr,functions:sr,callUserFunction:wf,setGlobalVariable:function(lt,na){Du(lt,na,"global")}}}function uf(lt,na){if(!/^\s*[{[]/.test(lt))return null;var Rn=se(lt,0);if(Rn<=0)return null;for(var ja=lt,Qn=na+1;Qn<Gn.length;Qn++){if(Oi.test(Gn[Qn]))return null;var Ri=d(Gn[Qn],kr);if(ja+=Ri,Rn=se(Ri,Rn),Rn<=0)return{text:ja,endIdx:Qn}}return null}function Su(lt,na,Rn,ja,Qn){var Ri=uf(na,ja),Ps=Ri!=null?Ri.text:na;if((!Qn||!kr.hasOwnProperty(lt))&&Du(lt,W(Ps,as()),Rn),lo.push(""),Ri==null)return ja;for(var Es=ja+1;Es<=Ri.endIdx;Es++)lo.push("",It[Es]);return Ri.endIdx}for(var Za=0;Za<Gn.length&&!co.exhausted;Za++){if(co.steps++,co.steps>co.maxSteps){co.exhausted=!0,Ma("step-budget","preprocessor execution exceeded "+co.maxSteps+" steps");break}var Gs=Gn[Za],hl=d(Gs,kr),Qo;if((Qo=Gs.match(nf))!=null){Ls!=null&&Ma("startsub-nested:"+Qo[1],"!startsub "+Qo[1]+" opens inside !startsub "+Ls+' (plantuml.jar answers "Cannot nest sub"); the outer block ends here'),Ls=Qo[1],co.subs[Ls]=[],lf=Za,lo.push("");continue}if(af.test(Gs)){Ls=null,lo.push("");continue}if(Ls!=null&&Za>lf&&(co.subs[Ls].push(Gs),lf=Za),Al){if(Ql.test(Gs)){Nl&&tu(Wa,ai,Wa.declarationLine),Al=!1,Wa=null,ai=null,Nl=!1,lo.push("");continue}ai.push(Gs),lo.push("");continue}if(ui){if(li.test(hl)||Xa.test(hl)){bs(),lo.push("");continue}pl.push(hl),lo.push("");continue}var hu=o(Gs);if(hu!=null){hu.declarationLine=Za+1,hu.inlineReturn!=null?tt&&tu(hu,["!return "+hu.inlineReturn],Za+1):(Al=!0,Wa=hu,ai=[],Nl=tt),lo.push("");continue}if((Qo=hl.match(Dl))!=null){var Xs=tt?Qr(w(Qo[1],as())):!1;Ia.push({parentOutputting:tt,hasMatched:Xs}),tt=Xs,lo.push("");continue}if((Qo=hl.match(bi))!=null){var Sd=tt&&(F.hasOwnProperty(Qo[1])||y.hasOwnProperty(Qo[1]));Ia.push({parentOutputting:tt,hasMatched:Sd}),tt=Sd,lo.push("");continue}if((Qo=hl.match(Ki))!=null){var ff=tt&&!(F.hasOwnProperty(Qo[1])||y.hasOwnProperty(Qo[1]));Ia.push({parentOutputting:tt,hasMatched:ff}),tt=ff,lo.push("");continue}if((Qo=hl.match(qa))!=null){if(Ia.length>0){var nu=Ia[Ia.length-1];if(nu.hasMatched)tt=!1;else{var Bu=nu.parentOutputting?Qr(w(Qo[1],as())):!1;Bu?(nu.hasMatched=!0,tt=!0):tt=!1}}lo.push("");continue}if(pi.test(hl)){if(Ia.length>0){var df=Ia[Ia.length-1];df.hasMatched?tt=!1:(df.hasMatched=!0,tt=df.parentOutputting)}lo.push("");continue}if(Fi.test(hl)){if(Ia.length>0){var zi=Ia.pop();tt=zi.parentOutputting}lo.push("");continue}if((Qo=hl.match(ts))!=null){var Tu=tt,cf={type:"while",startIdx:Za,cond:Qo[1],iters:0,outerOutputting:Tu,active:!1};if(Tu){var hf=Qr(w(Qo[1],as()));cf.active=hf,tt=hf}Vn.push(cf),lo.push("");continue}if(di.test(hl)){var Rs=Vn.length>0&&Vn[Vn.length-1].type==="while"?Vn[Vn.length-1]:null;if(Rs==null){lo.push("");continue}if(!Rs.active){tt=Rs.outerOutputting,Vn.pop(),lo.push("");continue}if(Rs.iters++,Rs.iters>=El){_l("!while exceeded "+El+" iterations",gl(Rs.startIdx)),tt=Rs.outerOutputting,Vn.pop(),lo.push("");continue}var Bd=Gn[Rs.startIdx],Cf=d(Bd,kr).match(ts),Td=Cf!=null?Cf[1]:"",Pf=Qr(w(Td,as()));if(Pf){lo.push(""),Za=Rs.startIdx;continue}tt=Rs.outerOutputting,Vn.pop(),lo.push("");continue}if((Qo=hl.match(ns))!=null){var vf=tt,pf=Qo[1],Iu=t(Qo[2],as()),Cu={type:"foreach",startIdx:Za,varName:pf,list:Iu,index:0,iters:0,outerOutputting:vf,active:!1};vf&&Iu.length>0?(Du(pf,Iu[0],null),Cu.active=!0,tt=!0):tt=!1,Vn.push(Cu),lo.push("");continue}if(Vi.test(hl)){var Li=Vn.length>0&&Vn[Vn.length-1].type==="foreach"?Vn[Vn.length-1]:null;if(Li==null){lo.push("");continue}if(!Li.active){tt=Li.outerOutputting,Vn.pop(),lo.push("");continue}if(Li.iters++,Li.index++,Li.iters>=El){_l("!foreach exceeded "+El+" iterations",gl(Li.startIdx)),tt=Li.outerOutputting,Vn.pop(),lo.push("");continue}if(Li.index<Li.list.length){Du(Li.varName,Li.list[Li.index],null),lo.push(""),Za=Li.startIdx;continue}tt=Li.outerOutputting,Vn.pop(),lo.push("");continue}if(!tt){lo.push("");continue}if((Qo=hl.match(Ws))!=null){var Nu=Qo[1]==null?"":Qo[1].toLowerCase(),Gi=Ua(Qo[2]),ls=null,vu=gl(Za);if(Nu==="url"||/^https?:\/\//i.test(Gi)){if(!c.allowUrlIncludes){Ma("include-url:"+Gi,'!include of URL "'+Gi+'" is not loaded: remote includes are disabled (config.allowUrlIncludes) and the browser cannot fetch them; nothing is included here',vu),lo.push("");continue}if(ls=Ul(Gi),ls==null){Ma("include-url-missing:"+Gi,'!include of URL "'+Gi+'" was not provided in config.includes; nothing is included here',vu),lo.push("");continue}}else if(/^<.*>$/.test(Gi)){if(ls=vn(Gi),ls==null){var ci=Gi.substring(1).split("/")[0].replace(/>$/,"");/^(?:c4|archimate)$/i.test(ci)||Ma("stdlib:"+ci.toLowerCase(),"stdlib module "+Gi+" is not bundled in this converter (only C4 and ArchiMate are implemented, natively); its macros are left unexpanded \u2014 a host can provide the module text in config.stdlib",vu)}}else ls=Ul(Gi),ls==null&&!oa.test(Gi)&&Ma("include:"+Gi,'"'+Gi+'" could not be included: this converter has no access to files, so its content is missing (plantuml.jar answers "cannot include '+Gi+'")',vu);if(ls!=null){if(Nu!=="_many"&&co.included.hasOwnProperty(ls.name)){Nu==="_once"&&Ma("include-once:"+ls.name,'"'+ls.name+'" has already been included; this !include_once is ignored (plantuml.jar answers "This file has already been included")',vu),lo.push("");continue}co.included[ls.name]=!0,Ta(Za+1,ls.lines,It[Za]),lo.push("");continue}}if((Qo=hl.match(Dd))!=null){var ys=Ua(Qo[1]),pu=null,au=ys.indexOf("!");if(au>0&&c.includes!=null){var Yf=ys.substring(0,au),Lu=Object.prototype.hasOwnProperty.call(c.includes,Yf)?c.includes[Yf]:null;typeof Lu=="string"&&(pu=Jl(pr(Lu).split(`
-`),ys.substring(au+1)))}if(pu==null&&au<0&&co.subs.hasOwnProperty(ys)&&(pu=co.subs[ys]),pu==null){Ma("includesub:"+ys,"!includesub "+ys+": no such block"+(au>0&&(c.includes==null||!Object.prototype.hasOwnProperty.call(c.includes,ys.substring(0,au)))?" (the file is not in config.includes)":"")+' (plantuml.jar answers "cannot include '+ys+'"); nothing is included here',gl(Za)),lo.push("");continue}Ta(Za+1,pu,It[Za]),lo.push("");continue}if((Qo=hl.match(gs))!=null){var $u=Q(Qo[1],kr).replace(/^["']|["']$/g,""),Mf=Qo[2]==null?ef.get($u):null;if(Mf==null){Ma("theme:"+$u.toLowerCase(),'theme "'+$u+'" is not bundled'+(Qo[2]!=null?" (external themes are not loaded)":"")+"; the default look is used"),lo.push("");continue}var Id=Mf.split(`
-`);c.themesApplied=c.themesApplied||[],c.themesApplied.indexOf($u)<0&&c.themesApplied.push($u),Ta(Za+1,Id,It[Za]),lo.push("");continue}if(go!=null&&(Qo=hl.match(Ll))!=null){var $f=Qo[1].replace(/^\s+|\s+$/g,"");c.functionReturn=$f.length>0?w($f,as()):"",c.functionReturned=!0,lo.push("");break}if(cu.test(hl)){sl=!0,lo.push("");break}if((Qo=hl.match(Ns))!=null){var xf=Qo[1].replace(/^\s+|\s+$/g,""),Gu=xf.length>0?w(xf,as()):"";c.preprocessorLogs=c.preprocessorLogs||[],c.preprocessorLogs.push(ar(Gu)),lo.push("");continue}if((Qo=hl.match(ds))!=null){var gf=Qo[1].replace(/^\s+|\s+$/g,""),Nd=gf.length>0?w(gf,as()):!1;Qr(Nd)||_l("!assert failed: "+gf,gl(Za)),lo.push("");continue}if((Qo=hl.match(fi))!=null){Za=Su(Qo[1],Qo[3],"local",Za,Qo[2]==="?");continue}if((Qo=hl.match(Ni))!=null){Za=Su(Qo[1],Qo[3],"global",Za,Qo[2]==="?");continue}if((Qo=hl.match(xa))!=null){Za=Su(Qo[2],Qo[4],null,Za,Qo[3]==="?");continue}if((Qo=hl.match($a))!=null){ui=!0,rl=Qo[1],Rl=Qo[2]!=null?N(Qo[2]):null,pl=[],lo.push("");continue}if((Qo=Gs.match(wl))!=null){Al=!0,Wa={name:Qo[2],params:R(Qo[3]||""),unquoted:/unquoted/i.test(Qo[1]||""),inlineReturn:null,procedure:!0,declarationLine:Za+1},ai=[],Nl=tt,lo.push("");continue}if((Qo=hl.match(Vl))!=null){var wu=Qo[1],Ld=Qo[3]!=null?Qo[3].replace(/\s+$/,""):"";y[wu]={params:N(Qo[2]),body:Ld},F.hasOwnProperty(wu)&&(delete F[wu],ou=E(I(F))),lo.push("");continue}if((Qo=hl.match(gi))!=null){var Gd=Qo[2]!=null?Qo[2].replace(/\s+$/,""):"";F[Qo[1]]=Gd,ou=E(I(F)),y.hasOwnProperty(Qo[1])&&delete y[Qo[1]],lo.push("");continue}if((Qo=hl.match(el))!=null){F.hasOwnProperty(Qo[1])&&(delete F[Qo[1]],ou=E(I(F))),y.hasOwnProperty(Qo[1])&&delete y[Qo[1]],lo.push("");continue}var Ui=O(hl,sr,as());Ui=g(Ui,as()),Ui=f(Ui,y),Ui=L(Ui,F,ou),lo.push(Q(Ui,kr))}Al&&Nl&&tu(Wa,ai,Wa.declarationLine),ui&&bs(),sl&&(c.exited=!0),c.defines==null&&(c.defines={});for(var ws in c.defines)c.defines.hasOwnProperty(ws)&&!F.hasOwnProperty(ws)&&delete c.defines[ws];for(var Pu in F)F.hasOwnProperty(Pu)&&(c.defines[Pu]=F[Pu]);c.paramDefines==null&&(c.paramDefines={});for(var Hf in c.paramDefines)c.paramDefines.hasOwnProperty(Hf)&&!y.hasOwnProperty(Hf)&&delete c.paramDefines[Hf];for(var Rf in y)y.hasOwnProperty(Rf)&&(c.paramDefines[Rf]=y[Rf]);c.functions==null&&(c.functions={});for(var qs in sr)sr.hasOwnProperty(qs)&&(c.functions[qs]=sr[qs]);c.variables==null&&(c.variables={});for(var $i in kr)kr.hasOwnProperty($i)&&(c.variables[$i]=kr[$i]);var Yu=lo.join(`
-`);return wa.length===0&&wa.push(-1),c.preprocessorLineMap=wa,go==null&&!c._preserveRuntime&&delete c._preprocessorRuntime,Yu}var _o=16,Zo=1024,jt=64,zt=5e5,Ga=32*1024*1024;function $n(i,c){if(c==null)return i;if(i==null)return c.slice();for(var F=[],y=0;y<c.length;y++){var sr=c[y];F.push(sr>=0&&sr<i.length?i[sr]:-1)}return F}function zn(i){var c=i.defines;if(c!=null)for(var F in c)c.hasOwnProperty(F)&&new RegExp("(?:^|[^\\w$])"+p(F)+"(?![\\w])").test(c[F])&&delete c[F]}function Dn(i,c,F){if(!(i==null||F==null))for(var y=c;y<i.length;y++){var sr=i[y];sr!=null&&typeof sr=="object"&&sr.bodyIndex!=null&&(sr.bodyIndex=sr.bodyIndex>=0&&sr.bodyIndex<F.length?F[sr.bodyIndex]:-1)}}function xe(i,c){if(i==null||typeof i!="string")return i;c=c||{},delete c._preprocessorRuntime,c._preserveRuntime=!0;for(var F=i,y=null,sr=0,kr=null,be=c.preprocessorWarnings!=null?c.preprocessorWarnings.length:0;F!==y&&sr<_o;)y=F,F=Xr(F),F=vt(F,c),Dn(c.preprocessorWarnings,be,kr),be=c.preprocessorWarnings!=null?c.preprocessorWarnings.length:0,kr=$n(kr,c.preprocessorLineMap),zn(c),sr++;if(delete c._preprocessorRuntime,delete c._preserveRuntime,c.preprocessorLineMap=kr,F!==y)throw new Error("PlantUmlPreprocessor: expansion did not converge after "+_o+" iterations (possible cycle in defines / variables)");return F}return{run:xe,stripComments:Xr,expandVariables:_,expandDefines:x,expandDirectives:vt,evaluateExpression:w,parseScalarValue:Tr,normaliseLineEndings:pr}})();var Eu=(function(){var pr={ditaa:{wrapper:"@startditaa",grounds:["licence","out-of-domain"],summary:"ditaa is a separate LGPL-licensed project, not PlantUML diagram syntax",detail:`ditaa ("DIagrams Through Ascii Art") is an independent tool by Efstathios Sideris that converts ASCII-art drawings into bitmaps. Its sources are present in the plantuml-asl jar under org/stathissideris/ascii2image/, but each file carries an intact LGPL-3.0-or-later notice from its author underneath the Apache-2.0 header that upstream's build prepends \u2014 conflicting notices this port will not rely on. Upstream's own Apache build refuses @startditaa for the same reason. Nothing about it is PlantUML diagram language.`},dot:{wrapper:"@startdot",grounds:["out-of-domain"],summary:"DOT is GraphViz's own language, rendered by a layout engine this port does not ship",detail:"A @startdot block is raw GraphViz DOT passed straight through to GraphViz \u2014 a different language with its own grammar and its own layout engine. PlantUML delegates it either to a native dot binary or to Smetana, its Java translation of GraphViz. This port is browser JavaScript with no GraphViz available and no intention of carrying a layout engine, so there is nothing to render DOT with. Supporting it would mean porting GraphViz, not PlantUML."},jcckit:{wrapper:"@startjcckit",grounds:["licence","out-of-domain"],summary:"JCCKit is a separate charting library, and upstream has removed it",detail:'JCCKit is an independent Java charting toolkit that PlantUML once bundled to draw plots. It is gone from the 1.2026.6 artifacts entirely \u2014 neither edition contains it, and upstream answers @startjcckit with "Diagram not supported by this release of PlantUML". Its licensing has the same third-party-relabelling problem as ditaa, and charting is not the PlantUML diagram language, so there is nothing here worth reviving.'},sudoku:{wrapper:"@startsudoku",grounds:["out-of-domain"],summary:"a Sudoku generator is not a diagram language feature, and upstream has removed it",detail:'PlantUML could once generate Sudoku grids. It is gone from the 1.2026.6 artifacts \u2014 upstream answers @startsudoku with "Diagram not supported by this release of PlantUML" \u2014 so its licensing could not be re-verified from the artifacts, and it does not matter: a puzzle generator has nothing to do with drawing diagrams from a modelling language.'}},q={};for(var Xr in pr)Object.prototype.hasOwnProperty.call(pr,Xr)&&(q[pr[Xr].wrapper]=Xr);function Tr(Y){return Y!=null&&Object.prototype.hasOwnProperty.call(pr,Y)}function se(Y){if(!Tr(Y))return null;var $r=pr[Y];return{type:Y,wrapper:$r.wrapper,grounds:$r.grounds.slice(),summary:$r.summary,detail:$r.detail}}function Kr(Y){return Y!=null&&Object.prototype.hasOwnProperty.call(q,Y)?q[Y]:null}function Dr(){var Y=[];for(var $r in pr)Object.prototype.hasOwnProperty.call(pr,$r)&&Y.push($r);return Y.sort()}function ar(Y){var $r=se(Y);if($r==null)return new Error('PlantUML: no parser registered for type "'+Y+'"');var rr=new Error("PlantUML: "+$r.wrapper+" is not supported");return rr.plantUmlUnsupported=!0,rr.diagramType=Y,rr.grounds=$r.grounds,rr}return{FAMILIES:pr,isUnsupported:Tr,describe:se,typeForWrapper:Kr,list:Dr,unsupportedError:ar}})();var fd=(function(){var pr={};function q(H,M){var j=Array.prototype.slice.call(arguments,2),gr=H.toLowerCase();pr.hasOwnProperty(gr)||(pr[gr]=[]),pr[gr].push({names:j,prop:M})}function Xr(H){var M=Array.prototype.slice.call(arguments,1);q.apply(null,[H+"FontSize","FontSize"].concat(M)),q.apply(null,[H+"FontStyle","FontStyle"].concat(M)),q.apply(null,[H+"FontColor","FontColor"].concat(M)),q.apply(null,[H+"FontName","FontName"].concat(M))}function Tr(H){var M=H.replace(/_/g,"");q(M+"BackgroundColor","BackGroundColor",H),q(M+"BorderColor","LineColor",H),q(M+"BorderThickness","LineThickness",H),q(M+"RoundCorner","RoundCorner",H),q(M+"DiagonalCorner","DiagonalCorner",H),q(M+"BorderStyle","LineStyle",H),Xr(M,H),q(M+"Shadowing","Shadowing",H),q(M+"StereotypeFontSize","FontSize","stereotype",H),q(M+"StereotypeFontStyle","FontStyle","stereotype",H),q(M+"StereotypeFontColor","FontColor","stereotype",H),q(M+"StereotypeFontName","FontName","stereotype",H)}q("participantClickableBackgroundColor","BackGroundColor","participant","clickable"),q("participantClickableBorderColor","LineColor","participant","clickable"),Tr("participant"),Tr("boundary"),Tr("control"),Tr("collections"),Tr("actor"),Tr("database"),Tr("entity"),Xr("header","document","header"),Xr("footer","document","footer"),Xr("caption","document","caption"),q("defaultFontSize","FontSize","element"),q("sequenceStereotypeFontSize","FontSize","stereotype"),q("sequenceStereotypeFontStyle","FontStyle","stereotype"),q("sequenceStereotypeFontColor","FontColor","stereotype"),q("sequenceStereotypeFontName","FontName","stereotype"),q("SequenceReferenceBorderColor","LineColor","reference"),q("SequenceReferenceBorderColor","LineColor","referenceHeader"),q("SequenceReferenceBackgroundColor","BackGroundColor","reference"),q("sequenceReferenceHeaderBackgroundColor","BackGroundColor","referenceHeader"),Xr("sequenceReference","reference"),Xr("sequenceReference","referenceHeader"),q("sequenceGroupBorderThickness","LineThickness","group"),q("SequenceGroupBorderColor","LineColor","group"),q("SequenceGroupBorderColor","LineColor","groupHeader"),q("SequenceGroupBackgroundColor","BackGroundColor","groupHeader"),Xr("SequenceGroup","group"),Xr("SequenceGroupHeader","groupHeader"),q("SequenceBoxBorderColor","LineColor","box"),q("SequenceBoxBackgroundColor","BackGroundColor","box"),q("SequenceBoxFontColor","FontColor","box"),q("SequenceLifeLineBorderColor","LineColor","lifeLine"),q("SequenceLifeLineBackgroundColor","BackGroundColor","activationBox"),Xr("sequenceDelay","delay"),q("sequenceDelayBorderColor","LineColor","delay"),q("sequenceDividerBackgroundColor","BackGroundColor","separator"),q("sequenceDividerBorderColor","LineColor","separator"),Xr("sequenceDivider","separator"),q("sequenceDividerBorderThickness","LineThickness","separator"),q("SequenceMessageAlignment","HorizontalAlignment","arrow"),Xr("note","note"),q("noteBorderThickness","LineThickness","note"),q("noteBorderColor","LineColor","note"),q("noteBackgroundColor","BackGroundColor","note"),q("packageBackgroundColor","BackGroundColor","group"),q("packageBorderColor","LineColor","group"),Tr("package"),q("PartitionBorderColor","LineColor","composite"),q("PartitionBackgroundColor","BackGroundColor","composite"),Xr("Partition","composite"),q("hyperlinkColor","HyperLinkColor","root"),q("activityStartColor","BackGroundColor","circle","start"),q("activityEndColor","LineColor","circle","end"),q("activityStopColor","LineColor","circle","stop"),q("activityBarColor","BackGroundColor","activityBar"),q("activityBorderColor","LineColor","activity"),q("activityBorderThickness","LineThickness","activity"),q("activityBackgroundColor","BackGroundColor","activity"),Xr("activity","activity"),q("activityDiamondBackgroundColor","BackGroundColor","diamond"),q("activityDiamondBorderColor","LineColor","diamond"),Xr("activityDiamond","diamond"),Xr("arrow","arrow"),q("arrowThickness","LineThickness","arrow"),q("arrowColor","LineColor","arrow"),q("arrowStyle","LineStyle","arrow"),q("arrowHeadColor","HeadColor","arrow"),q("defaulttextalignment","HorizontalAlignment","root"),q("defaultFontName","FontName","root"),q("defaultFontColor","FontColor","root"),Xr("SwimlaneTitle","swimlane"),q("SwimlaneTitleBackgroundColor","BackGroundColor","swimlane"),q("SwimlaneBorderColor","LineColor","swimlane"),q("SwimlaneBorderThickness","LineThickness","swimlane"),q("roundCorner","RoundCorner","root"),q("titleBorderThickness","LineThickness","title"),q("titleBorderColor","LineColor","title"),q("titleBackgroundColor","BackGroundColor","title"),q("titleBorderRoundCorner","RoundCorner","title"),Xr("title","document","title"),q("legendBorderThickness","LineThickness","legend"),q("legendBorderColor","LineColor","legend"),q("legendBackgroundColor","BackGroundColor","legend"),q("legendBorderRoundCorner","RoundCorner","legend"),Xr("legend","legend"),q("noteTextAlignment","HorizontalAlignment","note"),q("BackgroundColor","BackGroundColor","document"),q("classBackgroundColor","BackGroundColor","element","class"),q("classBorderColor","LineColor","element","class"),q("classFontSize","FontSize","element","class","header"),q("classFontStyle","FontStyle","element","class","header"),q("classFontColor","FontColor","element","class","header"),q("classFontName","FontName","element","class","header"),q("classAttributeFontSize","FontSize","element","class"),q("classAttributeFontStyle","FontStyle","element","class"),q("classAttributeFontColor","FontColor","element","class"),q("classAttributeFontName","FontName","element","class"),q("classBorderThickness","LineThickness","element","class"),q("classHeaderBackgroundColor","BackGroundColor","element","class","header"),q("objectBackgroundColor","BackGroundColor","object"),q("objectBorderColor","LineColor","object"),Xr("object","object"),Xr("objectAttribute","object"),q("objectBorderThickness","LineThickness","object"),q("stateBackgroundColor","BackGroundColor","state"),q("stateBorderColor","LineColor","state"),Xr("state","state"),Xr("stateAttribute","state"),q("stateBorderThickness","LineThickness","state"),Tr("agent"),Tr("artifact"),Tr("card"),Tr("interface"),Tr("cloud"),Tr("component"),Tr("file"),Tr("folder"),Tr("frame"),Tr("hexagon"),Tr("node"),Tr("person"),Tr("queue"),Tr("rectangle"),Tr("stack"),Tr("storage"),Tr("usecase"),Tr("map"),Tr("archimate"),Tr("hnote"),Tr("rnote"),q("IconPrivateColor","LineColor","visibilityIcon","private"),q("IconPrivateBackgroundColor","BackGroundColor","visibilityIcon","private"),q("IconPackageColor","LineColor","visibilityIcon","package"),q("IconPackageBackgroundColor","BackGroundColor","visibilityIcon","package"),q("IconProtectedColor","LineColor","visibilityIcon","protected"),q("IconProtectedBackgroundColor","BackGroundColor","visibilityIcon","protected"),q("IconPublicColor","LineColor","visibilityIcon","public"),q("IconPublicBackgroundColor","BackGroundColor","visibilityIcon","public"),q("MinClassWidth","MinimumWidth"),q("wrapWidth","MaximumWidth","element"),q("HyperlinkUnderline","HyperlinkUnderlineThickness","element"),q("StereotypeAlignment","HorizontalAlignment","stereotype"),q("stereotypeABackgroundColor","BackGroundColor","spotAbstractClass"),q("stereotypeABorderColor","LineColor","spotAbstractClass"),q("stereotypeCBackgroundColor","BackGroundColor","spotClass"),q("stereotypeCBorderColor","LineColor","spotClass"),q("stereotypeEBackgroundColor","BackGroundColor","spotEnum"),q("stereotypeEBorderColor","LineColor","spotEnum"),q("stereotypeIBackgroundColor","BackGroundColor","spotInterface"),q("stereotypeIBorderColor","LineColor","spotInterface"),q("stereotypeNBackgroundColor","BackGroundColor","spotAnnotation"),q("stereotypeNBorderColor","LineColor","spotAnnotation"),q("stereotypeRBackgroundColor","BackGroundColor","spotRecord"),q("stereotypeRBorderColor","LineColor","spotRecord"),q("stereotypeDBackgroundColor","BackGroundColor","spotDataClass"),q("stereotypeDBorderColor","LineColor","spotDataClass");var se=/<<(.*?)>>/g;function Kr(H){H=String(H).replace(/^\s+|\s+$/g,"").toLowerCase(),H=H.replace(/_|\./g,""),H=H.replace(/sequence(participant|actor)/g,"$1"),H=H.replace(/(activity|class|component|object|sequence|state|usecase)arrow/g,"arrow"),H=H.replace(/align$/,"alignment");var M=[],j;for(se.lastIndex=0;(j=se.exec(H))!=null;)M.push(H.replace(/<<(.*?)>>/g,"")+"<<"+j[1]+">>");return M.length===0&&M.push(H),M}function Dr(H){var M=H.toLowerCase();return M==="false"||M==="no"?"0":M==="true"||M==="yes"?"3":H}function ar(H){return H.indexOf(";")>=0||H.indexOf("text:")===0}function Y(H,M,j){var gr=null;if(H.indexOf("<<")>=0){var W=H.split(/[<>]+/);H=W[0],gr=W.length>1&&W[1]!=null?W[1].replace(/^\s+|\s+$/g,""):null}var d=gr?gr.split("&"):[];function _(o,t,n){var f={};f[o]=t,j.addRule(n,d,f)}M=String(M),/shadowing$/.test(H)?M.toLowerCase()==="false"?M="0":M.toLowerCase()==="true"&&(M="3"):H==="hyperlinkunderline"&&(M.toLowerCase()==="false"&&(M="0"),M.toLowerCase()==="true"&&(M="1")),M.toLowerCase()==="right:right"&&(M="right"),M.toLowerCase()==="dotted"&&(M="1;3"),M.toLowerCase()==="dashed"&&(M="7;7");var p=pr[H.toLowerCase()];if(p==null){H==="shadowing"?_("Shadowing",Dr(M),["root"]):H==="noteshadowing"&&_("Shadowing",Dr(M),["root","note"]);return}function E(o){var t;if(o.indexOf("text:")===0){var n=o.split(":")[1];for(t=0;t<p.length;t++)_("FontColor",n,p[t].names)}else if(o.indexOf("line.dotted")===0)for(t=0;t<p.length;t++)_("LineStyle","1;3",p[t].names);else if(o.indexOf("line.dashed")===0)for(t=0;t<p.length;t++)_("LineStyle","7;7",p[t].names);else if(o.toLowerCase().indexOf("bold")>=0)for(t=0;t<p.length;t++)_("LineThickness","2",p[t].names)}if(ar(M))if(M.indexOf(";")>=0){M.charAt(0)===";"&&(M=" "+M);for(var L=M.split(";"),N=[],m=0;m<L.length;m++)L[m].length>0&&N.push(L[m]);M=N.length>0?N[0]:" ";for(var u=1;u<N.length;u++)E(N[u])}else{E(M);return}if(M!==" ")for(var R=0;R<p.length;R++)_(p[R].prop,M,p[R].names)}function $r(H,M,j){for(var gr=Kr(H),W=String(M??"").replace(/^\s+|\s+$/g,""),d=0;d<gr.length;d++)j.skinparams[gr[d]]=W,Y(gr[d],W,j)}function rr(H){return pr.hasOwnProperty(String(H).toLowerCase().replace(/<<.*$/,""))}return{cleanKeys:Kr,apply:$r,isKnown:rr}})();var kt=(function(){for(var pr=["Shadowing","FontName","FontColor","FontSize","FontStyle","FontWeight","BackGroundColor","RoundCorner","LineThickness","DiagonalCorner","HyperLinkColor","HyperlinkUnderlineStyle","HyperlinkUnderlineThickness","HeadColor","LineColor","LineStyle","Padding","Margin","MaximumWidth","MinimumWidth","ExportedName","Image","HorizontalAlignment","ShowStereotype","ImagePosition","MarkerShape","MarkerSize","MarkerColor","BarWidth","Width"],q={},Xr=0;Xr<pr.length;Xr++)q[pr[Xr].toLowerCase()]=pr[Xr];for(var Tr="action activationBox activity activityBar activityDiagram actor agent analog archimate arrow artifact binary body boundary box boxless business caption card cardinality circle classDiagram class clickable cloud closed collection collections component composite robust chenAttribute chenEerDiagram chenEntity chenRelationship concise clock componentDiagram constraintArrow control database day delay description destroy diamond document ebnf element entity end start stop file filesDiagram folder footer frame ganttDiagram generic goto group groupHeader header hexagon highlight hnote interface json jsonDiagram gitDiagram label leafNode legend lifeLine mainframe map milestone mindmapDiagram month name network newpage node note nwdiagDiagram packetdiagDiagram objectDiagram object package participant partition person port process qualified queue rectangle reference referenceHeader regex requirement rnote root rootNode saltDiagram separator sequenceDiagram server stack stateDiagram state stateBody stereotype storage swimlane task timegrid timeline timingDiagram title undone unstarted usecase verticalSeparator year visibilityIcon private protected public IEMandatory spot spotAnnotation spotInterface spotEnum spotProtocol spotStruct spotEntity spotException spotClass spotAbstractClass spotMetaClass spotStereotype spotDataClass spotRecord wbsDiagram yamlDiagram chartDiagram bar line area scatter axis hAxis vAxis grid annotation".split(" "),se={},Kr=0;Kr<Tr.length;Kr++)se[Tr[Kr].toLowerCase()]=!0;function Dr(s){var $=String(s).replace(/_/g,"").toLowerCase();return se.hasOwnProperty($)?$:null}function ar(s){return String(s).replace(/[_.]/g,"").toLowerCase()}function Y(){return{names:{},level:-1,starred:!1,stereotypes:{},withDot:!1}}function $r(s){var $={},G={},B;for(B in s.names)s.names.hasOwnProperty(B)&&($[B]=!0);for(B in s.stereotypes)s.stereotypes.hasOwnProperty(B)&&(G[B]=!0);return{names:$,level:s.level,starred:s.starred,stereotypes:G,withDot:s.withDot}}function rr(s,$,G,B){var or=Y(),K;for(K=0;K<s.length;K++){var hr=Dr(s[K]);hr!=null&&(or.names[hr]=!0)}if(or.level=$??-1,G!=null)for(K=0;K<G.length;K++)or.stereotypes[ar(G[K])]=!0;return or.starred=!!B,or}function H(s,$){var G;if(s.level!==-1){if(s.starred){if($.level===-1||$.level<s.level)return!1}else if($.level===-1||$.level!==s.level)return!1}if($.starred&&!s.starred)return!1;for(G in s.names)if(s.names.hasOwnProperty(G)&&!$.names[G])return!1;for(G in s.stereotypes)if(s.stereotypes.hasOwnProperty(G)&&!$.stereotypes[G])return!1;return!0}var M=1,j=2,gr=3,W=4,d=5,_=6,p=7,E=8,L=9;function N(s){var $=String(s),G=$.length,B=0,or=[];function K(Tt){for(;B<G;){if($.charAt(B)===Tt){B++;return}B++}}function hr(Tt,Cn){for(;B<G;){if($.charAt(B)===Tt&&$.charAt(B+1)===Cn){B+=2;return}B++}}for(;B<G;){var vr=$.charAt(B),Jr=$.charAt(B+1);if(vr===" "||vr===" ")B++;else if(vr==="/"&&Jr==="/")K(`
-`);else if(vr==="/"&&Jr==="'")hr("'","/");else if(vr==="/"&&Jr==="*")hr("*","/");else if(vr===",")or.push({type:j,data:","}),B++;else if(vr===";")or.push({type:gr,data:";"}),B++;else if(vr===`
-`||vr==="\r")or.push({type:W,data:"NEWLINE"}),B++;else if(vr==="*")or.push({type:d,data:"*"}),B++;else if(vr===":")or.push({type:_,data:":"}),B++;else if(vr==="{")or.push({type:p,data:"{"}),B++;else if(vr==="}")or.push({type:E,data:"}"}),B++;else if(vr==="@"){B++;for(var Ge="";B<G;){var no=$.charAt(B);if(B++,no==="{"||no==="}"||no===";")break;Ge+=no}or.push({type:L,data:Ge})}else if(vr==='"'){B++;for(var bo="";B<G&&$.charAt(B)!=='"';)bo+=$.charAt(B),B++;$.charAt(B)==='"'&&B++,or.push({type:M,data:bo})}else{for(var Oo="";B<G;){var We=$.charAt(B);if(We===`
-`||We==="\r"||We===" "&&Oo.charAt(0)!=="."||We==="{"||We==="}"||We===";"||We===","||We===":"||We===" ")break;Oo+=We,B++}Oo.charAt(0)==="."&&(Oo=Oo.replace(/^\s+|\s+$/g,"")),or.push({type:M,data:Oo})}}return or}function m(s,$){this.parent=s,this.signatures=$,this.map={}}function u(s,$){$.charAt(0)===":"&&($=$.substring(1));var G=!1;$.charAt($.length-1)==="*"&&($=$.substring(0,$.length-1).replace(/^\s+|\s+$/g,""),G=!0);for(var B=$.split(","),or=new m(s,[]),K=0;K<B.length;K++)for(var hr=B[K],vr=0;vr<s.signatures.length;vr++){var Jr=$r(s.signatures[vr]);if(hr.charAt(0)===".")Jr.stereotypes[ar(hr)]=!0,Jr.withDot=!0;else if(hr.indexOf("depth(")===0)Jr.level=parseInt(hr.replace(/\D/g,""),10);else{var Ge=Dr(hr);Ge==null?(Jr.stereotypes[ar(hr)]=!0,Jr.withDot=!0):Jr.names[Ge]=!0}G&&(Jr.starred=!0),or.signatures.push(Jr)}return or}function R(s){var $=s.signatures[0],G;for(G in $.names)if($.names.hasOwnProperty(G))return!1;for(G in $.stereotypes)if($.stereotypes.hasOwnProperty(G))return!1;return $.level===-1&&!$.starred}var o=1e3;function t(s){var $=[],G=!1,B;for(B in s.map)if(s.map.hasOwnProperty(B)){G=!0;break}if(!G)return $;for(var or=0;or<s.signatures.length;or++){var K=s.signatures[or],hr={};for(B in s.map)s.map.hasOwnProperty(B)&&(hr[B]={value:s.map[B].value,priority:s.map[B].priority+(K.withDot?o:0)});$.push({sig:K,props:hr})}return $}function n(s){return new Error("PlantUML: Error in style definition: "+s)}function f(s,$){var G=N(s),B=$.variables,or=!1,K=new m(null,[Y()]),hr=0;function vr(_o){return G[hr+_o]||null}function Jr(){for(;vr(0)!=null&&vr(0).type===W;)hr++}function Ge(){for(;vr(0)!=null&&vr(0).type===_;)hr++}function no(){for(var _o="";vr(0)!=null;){var Zo=vr(0);if(Zo.type!==M&&Zo.type!==j)return _o;_o+=Zo.data,hr++}return _o}function bo(){for(var _o="";vr(0)!=null;){var Zo=vr(0);if(Zo.type===W||Zo.type===gr||Zo.type===E)return _o;if(Zo.type===M)_o.length>0&&(_o+=" "),_o+=Zo.data,hr++;else if(Zo.type===j)_o+=Zo.data,hr++;else if(Zo.type===_)if(_o+=Zo.data,hr++,vr(0)!=null&&vr(0).type===M)_o+=vr(0).data,hr++;else throw n("bad definition");else throw n("bad definition")}return _o}function Oo(_o){if(_o.indexOf("var(")===0){var Zo=/^var\(-*([_\w][-_\w]+)\)$/.exec(_o);if(Zo!=null&&B.hasOwnProperty(Zo[1]))return B[Zo[1]]}return _o}for(;vr(0)!=null;){var We=vr(0);if(hr++,!(We.type===W||We.type===gr)&&!(We.type===M&&(We.data.toLowerCase()==="<style>"||We.data.toLowerCase()==="</style>"))){if(vr(0)!=null&&vr(0).type===j){var Tt=We.data+no();if(Jr(),vr(0)!=null&&vr(0).type===p){K=u(K,Tt),hr++;continue}throw n('unexpected token after "'+Tt+'"')}if(We.type===M){var Cn=We.data;if(vr(0)!=null&&vr(0).type===d&&(hr++,Cn+="*"),Jr(),vr(0)!=null&&vr(0).type===p){K=u(K,Cn),hr++;continue}if(Ge(),We.data.indexOf("--")===0)B[We.data.substring(2)]=bo();else if(vr(0)!=null&&vr(0).type===M){var un=Oo(bo()),Kt=q[We.data.toLowerCase()],ut=++$.counter;Kt!=null&&!or&&(K.map[Kt]={value:un,priority:ut})}else throw n("parsing")}else if(We.type===E){for(var fn=t(K),vt=0;vt<fn.length;vt++)$.rules.push(fn[vt]);R(K)||(K=K.parent)}else if(We.type===L)or=!0;else if(We.type===_&&vr(0)!=null&&vr(0).type===M&&vr(1)!=null&&vr(1).type===p)K=u(K,":"+vr(0).data),hr+=2;else if(We.type===_&&vr(0)!=null&&vr(0).type===M&&vr(1)!=null&&vr(1).type===d&&vr(2)!=null&&vr(2).type===p)K=u(K,":"+vr(0).data+"*"),hr+=3;else throw We.type===p?n("Invalid open bracket"):n("unexpected token "+We.data)}}}var O=["root {"," FontName SansSerif"," HyperLinkColor blue"," HyperLinkUnderlineThickness 1"," FontColor black"," FontSize 14"," FontStyle plain"," HorizontalAlignment left"," RoundCorner 0"," DiagonalCorner 0"," LineThickness 1.0"," LineColor #181818"," BackGroundColor #f1f1f1"," Shadowing 0.0","}","element {"," Shadowing 0.0"," LineThickness 0.5","}","arrow {"," FontSize 13"," LineThickness 1.0"," BackGroundColor black","}","mindmapDiagram {"," node {"," Padding 10"," Margin 10"," RoundCorner 25"," LineThickness 1.5"," }"," arrow {"," LineThickness 1.0"," }","}","wbsDiagram {"," Padding 10"," Margin 15"," RoundCorner 0"," LineThickness 1.5"," FontSize 12","}"].join(`
-`),g=null;function Q(){var s={rules:[],counter:0,variables:{},blocks:0,skinparams:{}};return g==null?(f(O,s),g={rules:s.rules.slice(),counter:s.counter}):(s.rules=g.rules.slice(),s.counter=g.counter),s.userStart=s.rules.length,s.addBlock=function($){f($,s),s.blocks++},s.addRule=function($,G,B){var or=rr($,-1,G,!1),K=G!=null&&G.length>0?o:0,hr={sig:or,props:{}},vr=!1;for(var Jr in B)if(B.hasOwnProperty(Jr)){var Ge=q[String(Jr).toLowerCase()];Ge!=null&&(hr.props[Ge]={value:B[Jr],priority:++s.counter+K},vr=!0)}vr&&s.rules.push(hr)},s.addSkinParam=function($,G){fd.apply($,G,s)},s}function x(s){return s!=null&&s.rules.length>s.userStart}var I=/^<style>\s*$/i,w=/^<style>(.*)<\/style>\s*$/i,nr=/^<\/?style>\s*$/i,lr=/^<style\s+(?:src|file|import)\b/i,ir=/^skinparam(?:locked)?\s+([\w.]*(?:<<[^<>]*>>)?[\w.]*)\s+([^{}]*)$/i,mr=/^skinparam(?:locked)?\s*(?:\s+([\w.]*(?:<<.*>>)?[\w.]*))?\s*\{$/i,Or=/^([\w.]*(?:<<.*>>)?[\w.]*)\s+(?:(\{)|(.*))$/;function Qr(s,$){$=$||Q();var G=String(s??"").split(/\r\n|\r|\n/),B=[],or=0;function K(Cn){$.addBlock(Cn)}for(or=0;or<G.length;or++){var hr=G[or],vr=hr.replace(/^\s+|\s+$/g,""),Jr;if(vr.charAt(0)==="'"){B.push(hr);continue}if(I.test(vr)){var Ge=[];for(B.push("");or+1<G.length;){or++;var no=G[or].replace(/^\s+|\s+$/g,"");if(B.push(""),nr.test(no))break;no.charAt(0)!=="'"&&Ge.push(G[or])}K(Ge.join(`
-`));continue}if((Jr=w.exec(vr))!=null){K(Jr[1]),B.push("");continue}if(lr.test(vr)){B.push("");continue}if((Jr=mr.exec(vr))!=null){var bo=Jr[1]?[Jr[1]]:[],Oo=1;for(B.push(hr);or+1<G.length;){or++;var We=G[or].replace(/^\s+|\s+$/g,"");if(B.push(G[or]),!(We===""||We.charAt(0)==="'")){if(We==="}"){if(Oo--,Oo===0)break;bo.pop();continue}var Tt=Or.exec(We);Tt!=null&&(Tt[2]!=null?(bo.push(Tt[1]),Oo++):$.addSkinParam(bo.join("")+Tt[1],Tt[3]))}}continue}if((Jr=ir.exec(vr))!=null){$.addSkinParam(Jr[1],Jr[2]),B.push(hr);continue}if((Jr=/^!option\s+handwritten\s+(\S+)/i.exec(vr))!=null){$.skinparams.handwritten=Jr[1].toLowerCase(),B.push("");continue}B.push(hr)}return{sheet:$,body:B.join(`
-`)}}function ee(s,$,G,B){for(var or=null,K=B||0;K<s.rules.length;K++){var hr=s.rules[K];if(H(hr.sig,$)){var vr=hr.sig.starred&&G||0;or==null&&(or={});for(var Jr in hr.props)if(hr.props.hasOwnProperty(Jr)){var Ge={value:hr.props[Jr].value,priority:hr.props[Jr].priority+vr},no=or[Jr];(no==null||Ge.priority>no.priority)&&(or[Jr]=Ge)}}}return or}function re(s,$){if($==null)return s;s==null&&(s={});for(var G in $)if($.hasOwnProperty(G)){var B=s[G];(B==null||$[G].priority>B.priority)&&(s[G]=$[G])}return s}var Yr=10001e3;function Zr(s,$){for(var G=Yr*1e3,B=ee(s,$[0],G),or=1;or<$.length;or++)G-=Yr,B=re(B,ee(s,$[or],G));return B||{}}function Ee(s,$){return ee(s,$,0)||{}}function Ze(s,$,G){if(!x(s))return{};var B=$!=null&&$.names!=null?$:rr($||[],-1,G||[],!1);return ee(s,B,0,s.userStart)||{}}function eo(s){return P(Ze(s,["root","document"]),"BackGroundColor")}function Gr(s,$){var G=s!=null?s[$]:null;return G==null?null:G.value}function $e(s){return String(s??"").replace(/[^0-9.]/g,"")}function Ye(s,$,G){var B=Gr(s,$);if(B==null)return G;var or=parseFloat($e(B));return isNaN(or)?0:or}function Hr(s,$,G){var B=Gr(s,$);if(B==null)return G;var or=String(B).replace(/[^0-9]/g,"");return or.length===0?-1:parseInt(or,10)}function Fo(s,$){var G=Gr(s,$),B={top:0,right:0,bottom:0,left:0};if(G==null||!/^[0-9 ]+$/.test(G))return B;var or=G.replace(/^\s+|\s+$/g,"").split(/ +/),K=parseInt(or[0],10),hr,vr,Jr;switch(or.length){case 1:return{top:K,right:K,bottom:K,left:K};case 2:return hr=parseInt(or[1],10),{top:K,right:hr,bottom:K,left:hr};case 3:return hr=parseInt(or[1],10),vr=parseInt(or[2],10),{top:K,right:hr,bottom:vr,left:hr};case 4:return hr=parseInt(or[1],10),vr=parseInt(or[2],10),Jr=parseInt(or[3],10),{top:K,right:hr,bottom:vr,left:Jr};default:return B}}function k(s){var $=Ye(s,"LineThickness",1),G=Gr(s,"LineStyle"),B={thickness:$,dashVisible:0,dashSpace:0};if(G==null||G.length===0)return B;var or=String(G).split(/[-;,]/),K=parseFloat(String(or[0]).replace(/^\s+|\s+$/g,""));if(isNaN(K))return B;var hr=K;return or.length>1&&(hr=parseFloat(String(or[1]).replace(/^\s+|\s+$/g,"")),isNaN(hr))||(B.dashVisible=K,B.dashSpace=hr),B}function T(s){var $=Gr(s,"Shadowing");if($==null)return 0;var G=$e($);if(G.length>0){var B=parseFloat(G);if(!isNaN(B))return B}return 1.5}function D(s){var $=Gr(s,"MaximumWidth");return $==null||!/^-?\d+$/.test(String($).replace(/^\s+|\s+$/g,""))?0:Math.abs(parseInt($,10))}function S(s){var $=String(Gr(s,"FontStyle")||"").replace(/^\s+|\s+$/g,"").toLowerCase(),G=!1,B=!1;$==="bold"?G=!0:$==="italic"?B=!0:/^[1-9]00$/.test($)&&(G=parseInt($,10)>=600);var or=String(Gr(s,"FontWeight")||"").replace(/^\s+|\s+$/g,"").toLowerCase();return or==="bold"||or==="bolder"?G=!0:/^[1-9]00$/.test(or)?G=parseInt(or,10)>=600:(or==="normal"||or==="lighter")&&or.length&&(G=!1),{bold:G,italic:B}}function U(s){var $=String(Gr(s,"HorizontalAlignment")||"").replace(/^\s+|\s+$/g,"").toLowerCase();return $==="center"||$==="centre"?"center":$==="right"?"right":"left"}function P(s,$){var G=Gr(s,$);if(G==null)return null;var B=String(G).replace(/^\s+|\s+$/g,""),or=B.replace(/^#/,"").toLowerCase();return or==="none"||or==="transparent"||or==="background"?"none":B}return{createSheet:Q,collect:Qr,hasUserRules:x,userStyle:Ze,pageBackground:eo,signature:rr,matchAll:H,nodeStyle:Zr,plainStyle:Ee,cleanStereotype:ar,raw:Gr,asDouble:Ye,asInt:Hr,clockwise:Fo,stroke:k,shadowing:T,maxWidth:D,fontFace:S,horizontalAlignment:U,color:P,STEP_BY_PARENT:Yr}})();var vo=(function(){var pr=20,q=60,Xr={sequence:["sequence diagram","sequence diagrams"],class:["class diagram","class diagrams"],object:["object diagram","object diagrams"],useCase:["use case diagram","use case diagrams"],activity:["activity diagram","activity diagrams"],activityLegacy:["legacy-syntax activity diagram","legacy-syntax activity diagrams"],state:["state diagram","state diagrams"],component:["component / deployment diagram","component / deployment diagrams"],mindmap:["mind map","mind maps"],wbs:["work breakdown structure","work breakdown structures"],gantt:["Gantt chart","Gantt charts"],timing:["timing diagram","timing diagrams"],json:["JSON diagram","JSON diagrams"],yaml:["YAML diagram","YAML diagrams"],salt:["Salt wireframe","Salt wireframes"],network:["nwdiag network diagram","nwdiag network diagrams"],archimate:["ArchiMate diagram","ArchiMate diagrams"],c4:["C4 diagram","C4 diagrams"],titleOnly:["furniture-only diagram","furniture-only diagrams"]};function Tr(o){return String(o??"").replace(/^\s+|\s+$/g,"")}function se(o,t){var n=Object.prototype.hasOwnProperty.call(Xr,o)?Xr[o]:[o+" diagram",o+" diagrams"];return n[t?1:0]}function Kr(o){var t=Tr(o);return t.length>q&&(t=t.substring(0,q-1)+"\u2026"),'"'+t+'"'}function Dr(o,t,n,f){if(o!=null){o.warnings=o.warnings||[];var O=String(t??"").split(/\r\n|\r|\n/);O.length>0&&O[0].charCodeAt(0)===65279&&(O[0]=O[0].substring(1));var g=String(f??""),Q=g.split(`
-`).length,x=o.preprocessorLineMap;o._source={wrapper:n!=null&&n.wrapper!=null?n.wrapper:null,lines:O,startLine:n!=null&&n.startLine!=null?n.startLine:0,endLine:n!=null&&n.endLine!=null?n.endLine:O.length+1,bodyLines:n!=null?String(n.body).split(`
-`).length:0,preLines:Q,lineMap:Array.isArray(x)&&x.length===Q?x:null,body:g}}}function ar(o,t,n){var f=o!=null?o._source:null;if(f==null)return null;if(t!=null&&t>=0){var O=-1;if(f.lineMap!=null?O=t<f.lineMap.length?f.lineMap[t]:-1:f.preLines===f.bodyLines&&(O=t),O>=0)return Y(o,O)}var g=Tr(n);if(g==="")return null;for(var Q=f.startLine;Q<f.endLine-1&&Q<f.lines.length;Q++)if(Tr(f.lines[Q])===g)return Q+1;return null}function Y(o,t){var n=o!=null?o._source:null;if(n==null||t==null||t<0)return null;var f=n.startLine+1+t;return f<n.endLine?f:null}function $r(o,t,n,f,O){if(o==null)return null;for(var g=o.warnings=o.warnings||[],Q=ar(o,f,O),x=0;x<g.length;x++)if(g[x].code===t&&g[x].message===n&&g[x].line===Q)return g[x];var I={code:t,message:n,line:Q};return g.push(I),I}var rr=/^(?:[\[\]{}(),;|]+|[-=._]{2,}|end(?:\s*[A-Za-z]+)?)$/i;function H(o,t,n,f,O){if(o==null||Tr(f)===""||O==null&&rr.test(Tr(f)))return null;if(o._droppedLines=(o._droppedLines||0)+1,o._droppedLines>pr){var g=o._droppedLines-pr;return o._droppedMore==null&&(o._droppedMore=$r(o,"dropped-line-more","",null,null)),o._droppedMore.message=g+" more line"+(g===1?"":"s")+" matched no "+se(t)+" statement and "+(g===1?"was":"were")+" dropped",o._droppedMore}return $r(o,"dropped-line","this line "+(O!=null?Tr(O):"matched no "+se(t)+" statement")+" and was dropped: "+Kr(f),n,f)}function M(o,t,n,f,O,g){return o==null?null:$r(o,"unknown-reference","no "+se(t)+" "+n+' is named "'+Tr(f)+'"; this line was dropped: '+Kr(g),O,g)}function j(o,t,n,f,O){return $r(o,"dropped-note","this "+n+" is not rendered in "+se(t,!0)+" yet and was dropped: "+Kr(O),f,O)}function gr(o,t,n,f){return $r(o,"dropped-sprite",'sprite "'+t+'" is defined here but sprites are not rendered by this converter',n,f)}function W(o,t,n,f){return $r(o,"ignored-directive",Kr(f)+" is not applied to "+se(t,!0)+" by this converter",n,f)}function d(o,t,n){var f="<style> and skinparam rules";return n!=null&&n.length>0&&(f='the theme "'+n.join('", "')+'" and any <style> / skinparam rules'),$r(o,"ignored-style",f+" are not applied to "+se(t,!0)+" by this converter yet",null,null)}function _(o,t,n){for(var f=t+1;f<o.length;f++)if(n.test(o[f]))return f;return-1}function p(o){var t=o!=null?o._source:null;return t!=null&&t.wrapper!=null?t.wrapper:null}var E={json:"JSON",yaml:"YAML"};function L(o,t,n,f,O){var g=ar(o,n,f),Q=Object.prototype.hasOwnProperty.call(E,t)?E[t]:se(t),x=new Error("PlantUML: "+(g!=null?"line "+g+": ":"")+"invalid "+Q+" \u2014 "+Tr(O)+' (plantuml.jar answers "Your data does not sound like '+Q+' data")');return x.plantUmlSyntaxError=!0,x.diagramType=t,g!=null&&(x.line=g),x}function N(o,t){var n=new Error("PlantUML: the diagram is empty \u2014 "+(t?"only skinparam / preprocessor lines and no diagram statement":"nothing")+" between "+o+" and its @end line");return n.plantUmlEmpty=!0,n}function m(o){return o==null?"":typeof o=="string"?o:(o.line!=null?"line "+o.line+": ":"")+o.message}function u(o){var t=[];if(o==null)return t;for(var n=o.preprocessorWarnings||[],f=0;f<n.length;f++){var O=n[f];typeof O=="string"?t.push({code:"preprocessor",message:O,line:null}):O!=null&&O.bodyIndex!=null&&O.line==null?t.push({code:O.code||"preprocessor",message:O.message,line:Y(o,O.bodyIndex)}):t.push(O)}for(var g=o.warnings||[],Q=0;Q<g.length;Q++)t.push(g[Q]);return t}function R(o){var t=o!=null?o._source:null;if(t==null)return 0;for(var n=t.body.split(`
-`),f=0,O=0;O<n.length;O++){var g=Tr(n[O]);g!==""&&g.charAt(0)!=="'"&&f++}return f}return{MAX_DROPPED:pr,typeLabel:se,excerpt:Kr,bindSource:Dr,sourceWrapper:p,syntaxError:L,emptyError:N,lineNumber:ar,bodyLineNumber:Y,warn:$r,droppedLine:H,unknownReference:M,droppedNote:j,droppedSprite:gr,ignoredDirective:W,ignoredStyle:d,blockEnd:_,format:m,collect:u,statementCount:R}})();var zl=(function(){var pr={"@startuml":null,"@startmindmap":"mindmap","@startwbs":"wbs","@startgantt":"gantt","@startproject":"gantt","@startsalt":"salt","@startjson":"json","@startyaml":"yaml","@startebnf":"ebnf","@startregex":"regex","@startditaa":"ditaa","@startdot":"dot","@startchronology":"chronology","@startchen":"chen","@startnwdiag":"network","@startboard":"board","@startwire":"wire","@startbpm":"bpm","@startflow":"flow","@startcreole":"creole","@startmath":"math","@startlatex":"latex","@startdef":"def","@startgit":"git","@starthcl":"hcl","@startfiles":"files","@startchart":"chart","@startpacketdiag":"packet","@startsprites":"sprites"},q={chen:{name:"Chen entity-relationship diagram",tracking:"PROGRESS.md Phase 19"},ebnf:{name:"EBNF grammar railroad diagram",tracking:"PROGRESS.md Phase 20"},regex:{name:"regular-expression railroad diagram",tracking:"PROGRESS.md Phase 21"},board:{name:"board diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},chronology:{name:"chronology diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},wire:{name:"wire block-wiring diagram",tracking:'docs/OUT-OF-SCOPE.md "Triaged"'},bpm:{name:"BPM diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},flow:{name:"flow diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},creole:{name:"Creole text block",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},math:{name:"AsciiMath formula",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},latex:{name:"LaTeX formula",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},def:{name:"definition block",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},git:{name:"git graph",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},hcl:{name:"HCL / Terraform diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},files:{name:"files tree diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},chart:{name:"chart",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},packet:{name:"packet diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},sprites:{name:"sprite listing",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'}},Xr="@startmindmap, @startwbs, @startgantt, @startjson, @startyaml, @startsalt or @startnwdiag";function Tr(m){for(var u in pr)if(Object.prototype.hasOwnProperty.call(pr,u)&&pr[u]===m)return u;return null}function se(m,u){var R=Object.prototype.hasOwnProperty.call(q,m)?q[m]:null,o=u||Tr(m)||"@start"+m,t=new Error("PlantUML: "+o+" ("+(R!=null?R.name:m+" diagram")+") is not yet supported by this converter");return t.plantUmlUnimplemented=!0,t.diagramType=m,t.wrapper=o,t}function Kr(m){var u=new Error("PlantUML: "+m+" is not a PlantUML diagram type. Use @startuml for UML diagrams, or "+Xr+" for the other families");return u.plantUmlUnknownWrapper=!0,u.wrapper=m,u}function Dr(m){var u=m!=null?" from its first statement"+(m.line!=null?" (line "+m.line+")":"")+': "'+m.text+'"':"",R=new Error("PlantUML: could not tell what kind of diagram this is"+u+'. Inside @startuml the first statement decides the type ("Alice -> Bob" starts a sequence diagram, "class Foo" a class diagram, "state Foo" a state diagram, ":action;" an activity diagram); mind maps, WBS, Gantt, JSON, YAML, Salt and nwdiag need their own wrapper ('+Xr+")");return R.plantUmlUndetected=!0,m!=null&&m.line!=null&&(R.line=m.line),R}function ar(m,u){return vo.emptyError(m,u)}function Y(){var m=new Error("PlantUML: no @startuml \u2026 @enduml block found. Wrap the diagram in @startuml and @enduml (or in the @start\u2026 wrapper of its type: "+Xr+")");return m.plantUmlNoWrapper=!0,m}function $r(m,u){if(!/^[ \t]*sprite\b/im.test(m))return m;for(var R=m.split(`
-`),o=/^[ \t]*sprite\s+(\$?[\w.-]+)\s*(.*)$/i,t=0;t<R.length;t++){var n=o.exec(R[t]);if(n!=null){var f=n[2],O=t;if(/\{\s*$/.test(f))for(O=t+1;O<R.length&&!/^\s*\}\s*$/.test(R[O]);O++);else if(/<svg\b/i.test(f)&&!/<\/svg\s*>/i.test(f))for(O=t+1;O<R.length&&!/<\/svg\s*>/i.test(R[O]);O++);O>=R.length&&(O=R.length-1),vo.droppedSprite(u,n[1],t,R[t]);for(var g=t;g<=O;g++)R[g]="";t=O}}return R.join(`
-`)}var rr={activityLegacy:!0,c4:!0},H={};for(var M in pr)H["@end"+M.substring(6)]=M;var j={};function gr(m,u){j[m]=u}function W(){var m=[];for(var u in j)j.hasOwnProperty(u)&&m.push(u);return m}function d(m){if(m==null||typeof m!="string")return null;m.charCodeAt(0)===65279&&(m=m.substring(1));for(var u=m.split(/\r\n|\r|\n/),R=-1,o=null,t="",n=/^[ \t]*[@\\]start([A-Za-z][A-Za-z0-9_]*)\b[ \t]*(.*?)[ \t]*$/i,f=/^[ \t]*[@\\]end/i,O=0;O<u.length;O++){var g=u[O].match(n);if(g!=null){R=O,o="@start"+g[1].toLowerCase(),t=g[2]||"";continue}if(R>=0&&f.test(u[O]))return{wrapper:o,body:u.slice(R+1,O).join(`
-`),header:t,startLine:R+1,endLine:O+1}}return null}function _(m){var u=m.split(/\r\n|\r|\n/),R=[],o=!1,t=!1,n=null,f=0,O=0,g=!1;function Q(Qr){for(var ee=0,re=0;re<Qr.length;re++){var Yr=Qr.charAt(re);Yr==="{"||Yr==="["?ee++:(Yr==="}"||Yr==="]")&&ee--}return ee}for(var x=0;x<u.length;x++){var I=u[x],w=I.replace(/^\s+|\s+$/g,"");if(o){I.indexOf("'/")>=0&&(o=!1);continue}if(w!==""){if(w.substring(0,2)==="/'"){w.indexOf("'/",2)<0&&(o=!0);continue}if(w.charAt(0)!=="'"){if(t){/<\/style\s*>/i.test(w)&&(t=!1);continue}if(/^<style\b/i.test(w)){!/<\/style\s*>/i.test(w)&&!/^<style\s+(?:src|file)\s*=/i.test(w)&&(t=!0);continue}if(f>0){w.indexOf("{")>=0&&f++,w.indexOf("}")>=0&&f--;continue}if(n!==null){var nr=n==="note"?/^end\s*(?:h?note|rnote)\b/i:new RegExp("^end\\s*"+n+"\\b","i");nr.test(w)&&(n=null);continue}if(!(w.charAt(0)==="!"&&!/^!include\s*<(?:C4|archimate)[\/>]/i.test(w))){if(O>0){O+=Q(I);continue}if(g){/^\}\}\s*$/.test(w)&&(g=!1);continue}if(/^\{\{/.test(w)){/\}\}\s*$/.test(w)||(g=!0);continue}var lr=w.match(/^json\s+(?:"[^"]+"|\S+)\s+(\S.*)$/i);if(lr!=null){/^[\[{]/.test(lr[1])&&(O=Math.max(0,Q(lr[1])));continue}if(/^skinparam\b/i.test(w)){/\{\s*$/.test(w)&&f++;continue}if(!/^(caption|scale|mainframe|hide|show)\b/i.test(w)&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(w)){var ir=w.match(/^(?:(?:center|left|right)\s+)?(title|header|footer|legend)\b(.*)$/i);if(ir!=null){var mr=ir[2].replace(/^\s+|\s+$/g,"");mr===""&&(n=ir[1].toLowerCase());continue}var Or=w.match(/^(?:h?note|rnote|ref\s+over)\b/i);if(Or!=null&&w.indexOf(":")<0&&!/^(?:h?note|rnote)\s+"/i.test(w)){n=/^ref/i.test(w)?"ref":"note",R.push(w);continue}R.push(w)}}}}}return R}function p(m){if(m==null||typeof m!="string")return null;var u=_(m);if(u.length===0)return null;var R,o;for(R=0;R<u.length;R++){if(o=u[R],/^salt\s*$/i.test(o))return"salt";if(/^listopeniconic\s*$/i.test(o)||/^listsprites?\s*$/i.test(o))return"openiconicList";if(/^@(?:[+\-]?\d[\d.:\/]*|:[\w.]+)(?:\s+as\s+:\S+)?\s*$/.test(o)||/^(robust|concise|clock|binary)\b(?!\s*[-<.])/i.test(o))return"timing";if(/^archimate\b/i.test(o)||/^!include\s*<archimate[\/>]/i.test(o)||/^(Motivation|Strategy|Business|Application|Technology|Physical|Implementation)_[A-Za-z][A-Za-z0-9]*\s*\(/.test(o))return"archimate";if(/^!include\s*<C4[\/>]/i.test(o)||/^!include\s*.*C4_(Container|Context|Component|Code|Dynamic|Deployment)\.puml\b/i.test(o)||/^(Person|Person_Ext|System(?:Db|Queue)?(?:_Ext)?|Container(?:Db|Queue)?(?:_Ext)?|Component(?:Db|Queue)?(?:_Ext)?)\s*\(/.test(o)||/^(System_Boundary|Container_Boundary|Enterprise_Boundary)\s*\(/.test(o))return"c4";if(/^nwdiag\s*\{/i.test(o))return"network";if(/\[\s*\*\s*\]/.test(o))return"state";if(/^entity\s+\S+.*\{/i.test(o)||/[}|][|o][-.]|[-.][|o][{|]/.test(o))return"class";if(/^(node|artifact|cloud|storage|stack|folder|frame|file|hexagon|card|agent)\b(?!\s*[-<.])/i.test(o)||/^\[(?!\[)[^\]]+\]/.test(o))return"component"}for(R=0;R<u.length;R++){if(o=u[R],/^state\b(?!\s*[-<.])/i.test(o))return"state";if(/^(class|interface|enum|abstract(?:\s+class)?|annotation|struct|protocol|exception|namespace|record|dataclass)\b(?!\s*[-<.])/i.test(o))return"class";if(/^(object|map)\b(?!\s*[-<.])/i.test(o))return"object";if(/^usecase\b(?!\s*[-<.])/i.test(o))return"useCase";if(/^component\b(?!\s*[-<.])/i.test(o))return"component";if(/^(participant|boundary|control|entity|collections|queue|create)\b(?!\s*[-<.])/i.test(o)||/^ref(?:#\w+)?\s+over\b/i.test(o)||/^[hr]?note(?:\s*<<[^>]*>>)?\s+over\b/i.test(o)||/^(activate|deactivate|destroy|autonumber|autoactivate)\b(?!\s*[-<.])/i.test(o)||/^box\b(?!\s*[-<.])/i.test(o)||/^&\s*\S/.test(o)&&/[-.]+>|<[-.]+/.test(o))return"sequence"}var t=!1;for(R=0;R<u.length;R++){if(o=u[R],/^(start|stop)\s*$/i.test(o)||/^(?:#\w+)?:.*?;\s*(?:<<[^>]*>>\s*)*$/.test(o)||/^if\s*\(/i.test(o)||/^while\s*\(/i.test(o)||/^repeat\b(?!\s*[-<.])/i.test(o)||/^(fork|split|swimlane)\b(?!\s*[-<.])/i.test(o)||/^detach\b(?!\s*[-<.])/i.test(o))return"activity";/^partition\b(?!\s*[-<.])/i.test(o)&&(t=!0)}if(t){var n=/^(?:\(\*(?:top)?\)|"[^"]*"(?:\s+as\s+\S+)?|===+\s*[\w.]+\s*===+|[\w\u00A0-\uFFFF][\w.\u00A0-\uFFFF]*)?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*[-.]+(?:\[[^\]]*\])?(?:left|right|up|down|le?|ri?|up?|do?)?(?:\[[^\]]*\])?[-.]*>\s*(?:\[[^\]*][^\]]*\]\s*)?(?:\(\*|"|===|[\w\u00A0-\uFFFF])/i;for(R=0;R<u.length;R++)if(/\(\s*\*\s*(?:top|bottom)?\s*\)/.test(u[R])||n.test(u[R]))return"activityLegacy";return"activity"}for(R=0;R<u.length;R++)if(/\(\s*\*\s*(?:top|bottom)?\s*\)/.test(u[R]))return"activityLegacy";for(R=0;R<u.length;R++)if(/-\[hidden\]-/i.test(u[R]))return"component";for(R=0;R<u.length;R++)if(o=u[R],/^:[^:;]+:\/?\s*(?:as\s+\S+)?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*$/i.test(o)||/^\([^)]+\)\/?\s*(?:as\s+\S+)?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*$/i.test(o)||/:[^:;]+:\/?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*[-.<>|]+(?:\[[^\]]*\][-.<>|]*)?\s*\([^)]+\)/.test(o)||/\([^)]+\)\/?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*[-.<>|]+(?:\[[^\]]*\][-.<>|]*)?\s*:[^:;]+:/.test(o)||/\([^)]+\)\s*[-.<>|]+\s*\([^)]+\)/.test(o)||/^\w[\w.]*\s*[-.<>|]+\s*\([^)]+\)/.test(o)||/^\([^)]+\)\s*[-.<>|]+\s*\w/.test(o))return"useCase";var f=/(?:^|\s)(?:<\|[-.]+|[*o+#][-.]+)|(?:[-.]+\|>|[-.]+[*o+#])(?=\s|$)/;for(R=0;R<u.length;R++)if(o=u[R],!/(?:^|\s)\[o?[<-]|[->]o?\]\s*(?::|$)/.test(o)&&f.test(o))return"class";for(R=0;R<u.length;R++)if(/^rectangle\s+(?:"[^"]*"|\S+)\s+as\s+\S+\s*$/i.test(u[R]))return"component";for(R=0;R<u.length;R++)if(/^together\s*\{\s*$/i.test(u[R]))return"component";var O='(?:[^\\s"<>\\[\\]\\-.][^\\s"<>\\[\\]]*|"[^"]*")',g="(?:[xo]?<<?[xo]?|\\\\\\\\?|\\/\\/?)",Q="(?:[xo]?>>?[xo]?|\\\\\\\\?|\\/\\/?)",x="(?:-+(?:\\[[^\\]]*\\]-*)?|\\[[^\\]]*\\]-+)",I="(?:"+g+x+Q+"?|[xo]?"+x+Q+")",w=new RegExp("^(?:"+O+"|[\\[\\]])\\s*"+I+"\\s*(?:"+O+"|[\\[\\]])"),nr=/^\[[^\[\]]+\]|[-.>]\s*\[[^\[\]]+\]\s*(?::|$)/,lr=new RegExp("^"+I+"\\s*(?:"+O+"|\\])"),ir=new RegExp("^"+O+"\\s+-{2,}>?\\s*$");for(R=0;R<u.length;R++){o=u[R];var mr=o.search(/\s:\s|:\s|\s:/),Or=mr>0?o.substring(0,mr):o;if(!nr.test(Or)){if(/^(?:"[^"]*"|[\w.]+)\s+(?:<\.{2,}|\.{2,}>)\s+(?:"[^"]*"|[\w.]+)/.test(Or))return"class";if(w.test(o)||lr.test(o)||ir.test(o))return"sequence"}}for(R=0;R<u.length;R++){if(o=u[R],/^actor\b/i.test(o)||/^[hr]?note(?:\s*<<[^>]*>>)?\s+(?:left|right)\s+of\b/i.test(o))return"sequence";if(/^note\s+(?:top|bottom)\s+of\b/i.test(o))return"class"}if(/^\*+(?:\[#\w+\])?_?\s+\S/.test(u[0]))return"mindmap";for(R=0;R<u.length;R++)if(o=u[R],/^(node|folder|frame|cloud|artifact|storage|database|rectangle|hexagon|card|package|circle)\b/i.test(o)||/^\(\)\s+\S/.test(o))return"component";for(R=0;R<u.length;R++)if(/(?:^|[^\[])\[[\w][^\[\]]*\]/.test(u[R]))return"component";var Qr=/^(?:[\w.]+|"[^"]*")\s+(?:"[^"]*"\s+)?(?:-+|\.+|[-.]+(?:up|down|left|right|u|d|l|r)[-.]+>?)\s+(?:"[^"]*"\s+)?(?:[\w.]+|"[^"]*")\s*(?::.*)?$/i;for(R=0;R<u.length;R++)if(Qr.test(u[R]))return"class";var ee=/^[\w.]+\s*:\s*\S/;for(R=0;R<u.length;R++)if(ee.test(u[R]))return"state";if(u.length>0){var re=!0;for(R=0;R<u.length;R++)if(!/^"[^"]*"(?:\s+as\s+\S+)?\s*$/.test(u[R])){re=!1;break}if(re)return"component"}if(u.length>0){for(R=0;R<u.length;R++)if(!/^-[ \t]?(?![-.>\[])\S/.test(u[R]))return null;return"activity"}return null}function E(m){var u=m.split(/\r\n|\r|\n/),R={},o=0,t;for(t=0;t<u.length;t++){var n=u[t].replace(/^\s+|\s+$/g,""),f=n.match(/^json\s+(?:"([^"]+)"|(\S+))\s+(\S.*)$/i);if(f!=null){var O=f[1]!=null?f[1]:f[2],g=f[3];if(/^[\[{]/.test(g)){for(var Q=0,x=t,I=[];x<u.length;){var w=x===t?g:u[x];I.push(w);for(var nr=0;nr<w.length;nr++)w.charAt(nr)==="{"||w.charAt(nr)==="["?Q++:(w.charAt(nr)==="}"||w.charAt(nr)==="]")&&Q--;if(Q<=0)break;x++}g=I.join(`
-`),t=x}try{R[O]=JSON.parse(g),o++}catch{return null}}}return o>0?R:null}function L(m){var u=m.split(/\r\n|\r|\n/),R={title:null,header:null,footer:null,caption:null,legend:null,notes:[]},o=!1,t=!1,n=0,f;function O(Qr){for(var ee=[];f+1<u.length;){f++;var re=u[f].replace(/^\s+|\s+$/g,"");if(Qr.test(re))break;ee.push(re)}return ee}for(f=0;f<u.length;f++){var g=u[f].replace(/^\s+|\s+$/g,"");if(!(g===""||g.charAt(0)==="'")){if(t){/<\/style\s*>/i.test(g)&&(t=!1);continue}if(/^<style\b/i.test(g)){!/<\/style\s*>/i.test(g)&&!/^<style\s+(?:src|file)\s*=/i.test(g)&&(t=!0);continue}if(n>0){g.indexOf("{")>=0&&n++,g.indexOf("}")>=0&&n--;continue}if(/^skinparam\b/i.test(g)){/\{\s*$/.test(g)&&n++;continue}var Q=g.match(/^(?:(?:center|left|right)\s+)?(title|header|footer|caption|legend)\b(.*)$/i);if(Q!=null){var x=Q[1].toLowerCase(),I=Q[2].replace(/^\s+|\s+$/g,"");if(x==="legend")if(/^(?:(?:left|right|center|top|bottom)\s*)*$/i.test(I)){for(var w=I.toLowerCase().split(/\s+/),nr="center",lr=0;lr<w.length;lr++)(w[lr]==="left"||w[lr]==="right")&&(nr=w[lr]);R.legend={position:nr,lines:O(/^end\s*legend\b/i)}}else R.legend={position:"center",lines:[I.replace(/^:\s*/,"")]};else I===""?R[x]=O(new RegExp("^end\\s*"+x+"\\b","i")).join(`
-`):R[x]=I.replace(/^:\s*/,"");o=!0;continue}var ir=g.match(/^note\s+"([^"]*)"\s+as\s+\S+(?:\s+(#\w+))?\s*$/i);if(ir!=null){R.notes.push({lines:[ir[1]],color:ir[2]||null}),o=!0;continue}var mr=g.match(/^note\s+as\s+\S+(?:\s+(#\w+))?\s*$/i);if(mr!=null){R.notes.push({lines:O(/^end\s*note\b/i),color:mr[1]||null}),o=!0;continue}var Or=g.match(/^note\s+(?:left|right|top|bottom)(?:\s+(#\w+))?\s*(?::\s*(.*))?$/i);if(Or!=null){R.notes.push({lines:Or[2]!=null?[Or[2]]:O(/^end\s*note\b/i),color:Or[1]||null}),o=!0;continue}}}return o?R:null}function N(m,u){u=u||{};var R=d(m);if(R==null)throw Y();var o=typeof Lf<"u"?Lf.run(R.body,u):R.body;/^\s*@(?:pause|a|append)\b/m.test(o)&&(o=o.replace(/^([ \t]*)@(?:a|append)[ \t]+/gm,"$1").replace(/^[ \t]*@pause[ \t]*$/gm,""));var t=kt.collect(o);o=t.body,u.styleSheet=t.sheet,vo.bindSource(u,m,R,o),o=$r(o,u);var n=Object.prototype.hasOwnProperty.call(pr,R.wrapper)?pr[R.wrapper]:void 0,f=Eu.typeForWrapper(R.wrapper);if(f!=null)throw Eu.unsupportedError(f);if(n===void 0)throw Kr(R.wrapper);if(n!=null&&Object.prototype.hasOwnProperty.call(q,n))throw se(n,R.wrapper);if(n==null&&(n=p(o)),Eu.isUnsupported(n))throw Eu.unsupportedError(n);if(n==="openiconicList")return{type:"openiconicList",ir:{},config:u,header:R.header};if(n==null&&/(^|\n)\s*stdlib\s*(\n|$)/i.test(o))return{type:"stdlib",ir:{},config:u,header:R.header};if(n==null){var O=E(o);if(O!=null)return{type:"json",ir:{data:O,rootPresent:!0,highlights:[]},config:u,header:R.header};var g=L(o);if(g!=null)return{type:"titleOnly",ir:g,config:u,header:R.header};var Q=_(o);if(Q.length===0)throw ar(R.wrapper,/\S/.test(o));for(var x=o.split(`
-`),I=null,w=0;w<x.length;w++)if(x[w].replace(/^\s+|\s+$/g,"")===Q[0]){I=w;break}throw Dr({line:vo.lineNumber(u,I,Q[0]),text:Q[0].length>60?Q[0].substring(0,59)+"\u2026":Q[0]})}var nr=j[n];if(nr==null||typeof nr.parse!="function")throw se(n,R.wrapper);var lr=nr.parse(o,u);return lr!=null&&typeof lr=="object"&&lr.styleSheet==null&&(lr.styleSheet=t.sheet),rr[n]===!0&&kt.hasUserRules(t.sheet)&&vo.ignoredStyle(u,n,u.themesApplied||null),{type:n,ir:lr,config:u,header:R.header}}return{START_WRAPPERS:pr,END_WRAPPERS:H,UNIMPLEMENTED_FAMILIES:q,registerParser:gr,listParsers:W,stripWrapper:d,detectGenericUmlType:p,parse:N}})();var Ba=(function(){var pr={header:"right",footer:"center"},q=/^(?:(left|right|center|centre)\s+)?(title|header|footer|caption)\b\s*(.*)$/i,Xr=/^legend\b\s*(.*)$/i,Tr=/^(?:(?:left|right|center|centre|top|bottom)\s*)*$/i,se=/^note\s+"([^"]*)"\s+as\s+(\S+)(?:\s+(#[\w:;.]+))?\s*$/i,Kr=/^note\s+as\s+(\S+)(?:\s+(#[\w:;.]+))?\s*$/i;function Dr(M,j,gr){for(var W=new RegExp("^\\s*end\\s*"+gr+"\\s*$","i"),d=j+1;d<M.length;d++)if(W.test(String(M[d])))return d;return-1}function ar(M,j,gr){var W="center",d="bottom";if(Tr.test(gr)){for(var _=gr.toLowerCase().split(/\s+/),p=0;p<_.length;p++)_[p]==="left"||_[p]==="right"?W=_[p]:(_[p]==="top"||_[p]==="bottom")&&(d=_[p]);var E=Dr(M,j,"legend");if(E<0)return null;for(var L=[],N=j+1;N<E;N++)L.push(String(M[N]).replace(/\s+$/,""));return{kind:"legend",lines:L,position:W,vertical:d,next:E}}var m=gr.replace(/^:\s*/,"");return/^"[\s\S]*"$/.test(m)&&(m=m.slice(1,-1)),{kind:"legend",lines:[m],position:"center",vertical:"bottom",next:j}}function Y(M,j){var gr=String(M[j]==null?"":M[j]),W=gr.replace(/^\s+|\s+$/g,""),d=se.exec(W);if(d!=null)return{kind:"note",lines:[d[1]],id:d[2],color:d[3]||null,next:j};var _=Kr.exec(W);if(_!=null){var p=Dr(M,j,"note");if(p>=0){for(var E=[],L=j+1;L<p;L++)E.push(String(M[L]).replace(/^\s+|\s+$/g,""));return{kind:"note",lines:E,id:_[1],color:_[2]||null,next:p}}}var N=Xr.exec(W);if(N!=null)return ar(M,j,N[1].replace(/^\s+|\s+$/g,""));var m=q.exec(W);if(m==null)return null;var u=m[2].toLowerCase(),R=m[1]?m[1].toLowerCase().replace("centre","center"):null,o=m[3].replace(/^\s+|\s+$/g,"");if(R!=null&&!pr.hasOwnProperty(u))return null;if(o===""){var t=Dr(M,j,u);if(t<0)return null;for(var n=[],f=j+1;f<t;f++)n.push(String(M[f]).replace(/\s+$/,""));return{kind:u,text:n.join(`
-`),align:R||pr[u]||null,next:t}}return{kind:u,text:o.replace(/^:\s*/,""),align:R||pr[u]||null,next:j}}function $r(M,j){if(j!=null){if(j.kind==="note"){M.floatingNotes==null&&(M.floatingNotes=[]),M.floatingNotes.push({id:j.id,lines:j.lines,color:j.color});return}j.kind==="legend"?M.legend={position:j.position,vertical:j.vertical,lines:j.lines}:j.kind==="header"||j.kind==="footer"?M[j.kind]={text:j.text,align:j.align}:M[j.kind]=j.text}}function rr(M,j,gr){var W=Y(j,gr);return W==null?-1:($r(M,W),W.next)}function H(M,j){for(var gr=["title","header","footer","caption","legend","floatingNotes"],W=0;W<gr.length;W++)j!=null&&j[gr[W]]!=null&&(M[gr[W]]=j[gr[W]]);return M}return{match:Y,assign:$r,take:rr,merge:H}})();var of=(function(){var pr={fillColor:"light-dark(#FEFECE,#1f2020)",strokeColor:"light-dark(#A80036,#cccccc)",fontColor:"light-dark(#000000,#cccccc)",fontFamily:"Verdana"},q={};function Xr(r,a,e){q[r]||(q[r]={}),q[r][a]=e}function Tr(){var r=new Graph;return r.setExtendParents(!1),r.setExtendParentsOnAdd(!1),r.setConstrainChildren(!1),r.setHtmlLabels(!0),r.getModel().maintainEdgeParent=!1,r}function se(r,a){return a=a||Tr(),{graph:a,root:a.getDefaultParent()}}var Kr={lightblue:"#ADD8E6",pink:"#FFC0CB",red:"#FF0000",green:"#008000",blue:"#0000FF",yellow:"#FFFF00",orange:"#FFA500",gold:"#FFD700",lavender:"#E6E6FA",lightgreen:"#90EE90",salmon:"#FA8072",coral:"#FF7F50",gray:"#808080",grey:"#808080",black:"#000000",white:"#FFFFFF",cyan:"#00FFFF",magenta:"#FF00FF",lime:"#00FF00",aqua:"#00FFFF",navy:"#000080",maroon:"#800000",olive:"#808000",purple:"#800080",teal:"#008080",silver:"#C0C0C0",lightyellow:"#FFFFE0",lightcoral:"#F08080",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",darkgreen:"#006400",darkblue:"#00008B",darkred:"#8B0000",wheat:"#F5DEB3",tomato:"#FF6347",skyblue:"#87CEEB",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",turquoise:"#40E0D0",violet:"#EE82EE",plum:"#DDA0DD",linen:"#FAF0E6",khaki:"#F0E68C",ivory:"#FFFFF0",honeydew:"#F0FFF0",gainsboro:"#DCDCDC",beige:"#F5F5DC",hotpink:"#FF69B4",palegreen:"#98FB98",antiquewhite:"#FAEBD7",powderblue:"#B0E0E6",peachpuff:"#FFDAB9",mistyrose:"#FFE4E1",mintcream:"#F5FFFA",aliceblue:"#F0F8FF",firebrick:"#B22222",indianred:"#CD5C5C",deeppink:"#FF1493",mediumblue:"#0000CD",limegreen:"#32CD32",darkorange:"#FF8C00",dodgerblue:"#1E90FF",cadetblue:"#5F9EA0",chocolate:"#D2691E",crimson:"#DC143C",orchid:"#DA70D6",seagreen:"#2E8B57",springgreen:"#00FF7F",royalblue:"#4169E1",darksalmon:"#E9967A",lightsalmon:"#FFA07A",lightpink:"#FFB6C1",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",dimgray:"#696969",dimgrey:"#696969",slategray:"#708090",slategrey:"#708090",orangered:"#FF4500",forestgreen:"#228B22",midnightblue:"#191970",slateblue:"#6A5ACD",darkviolet:"#9400D3",darkorchid:"#9932CC",goldenrod:"#DAA520",darkgoldenrod:"#B8860B",rosybrown:"#BC8F8F",sienna:"#A0522D",peru:"#CD853F",sandybrown:"#F4A460",burlywood:"#DEB887",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",blanchedalmond:"#FFEBCD",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",palegoldenrod:"#EEE8AA",darkkhaki:"#BDB76B",yellowgreen:"#9ACD32",olivedrab:"#6B8E23",darkolivegreen:"#556B2F",greenyellow:"#ADFF2F",chartreuse:"#7FFF00",lawngreen:"#7CFC00",mediumseagreen:"#3CB371",darkseagreen:"#8FBC8F",mediumspringgreen:"#00FA9A",lightseagreen:"#20B2AA",darkcyan:"#008B8B",darkturquoise:"#00CED1",mediumturquoise:"#48D1CC",paleturquoise:"#AFEEEE",lightcyan:"#E0FFFF",azure:"#F0FFFF",lightsteelblue:"#B0C4DE",cornflowerblue:"#6495ED",deepskyblue:"#00BFFF",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",mediumpurple:"#9370DB",blueviolet:"#8A2BE2",indigo:"#4B0082",darkmagenta:"#8B008B",mediumorchid:"#BA55D3",mediumvioletred:"#C71585",palevioletred:"#DB7093",fuchsia:"#FF00FF",lightgoldenrodyellow:"#FAFAD2",floralwhite:"#FFFAF0",ghostwhite:"#F8F8FF",lavenderblush:"#FFF0F5",oldlace:"#FDF5E6",papayawhip:"#FFEFD5",seashell:"#FFF5EE",snow:"#FFFAFA",whitesmoke:"#F5F5F5",brown:"#A52A2A",rebeccapurple:"#663399",saddlebrown:"#8B4513",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",lightblue1:"#BFEFFF",aquamarine:"#7FFFD4",mediumaquamarine:"#66CDAA",honeydew2:"#E0EEE0"},Dr=/[;=<>"'`(){}\r\n\t ]/,ar=/^[0-9A-Za-z|\/\\.\-]+$/;function Y(r){if(!r)return r;var a=String(r).replace(/^\s+|\s+$/g,"");if(!a||Dr.test(a))return null;if(/^#?(?:transparent|none)$/i.test(a))return"none";if(a.charAt(0)==="#"){var e=a.substring(1),h=e.toLowerCase();return Kr.hasOwnProperty(h)?Kr[h]:/^[0-9A-Fa-f]{3,8}$/.test(e)||ar.test(e)?a:null}return Kr.hasOwnProperty(a.toLowerCase())?Kr[a.toLowerCase()]:ar.test(a)?a:null}function $r(r){var a=String(r).replace(/^\s+|\s+$/g,""),e=/^(#?[A-Za-z0-9]+)[\/|\\\-](#?[A-Za-z0-9]+)$/.exec(a);if(e!=null){var h=Y(e[1]),l=Y(e[2]);if(h&&l&&h!=="none"&&l!=="none")return{fill:h,gradient:l}}var C=Y(a);return C?{fill:C,gradient:null}:null}function rr(r){return String(Math.round(r*100)/100)}function H(r,a,e,h){var l={};if(r==null||!kt.hasUserRules(r))return l;var C=kt.userStyle(r,a,e),b;if(h!=="edge"&&h!=="text"){if(b=kt.color(C,"BackGroundColor"),b!=null)if(b==="none")l.fillColor="none";else{var Z=$r(b);Z!=null&&(l.fillColor=Z.fill,Z.gradient!=null&&(l.gradientColor=Z.gradient))}if(kt.raw(C,"RoundCorner")!=null){var v=kt.asDouble(C,"RoundCorner",0);v>0?(l.rounded="1",l.arcSize=rr(v),l.absoluteArcSize="1"):l.rounded="0"}kt.raw(C,"Shadowing")!=null&&(l.shadow=kt.shadowing(C)>0?"1":"0")}if(h!=="text"){if(b=kt.color(C,"LineColor"),b!=null){var er=b==="none"?"none":Y(b);er&&(l.strokeColor=er)}if(kt.raw(C,"LineThickness")!=null&&(l.strokeWidth=rr(kt.asDouble(C,"LineThickness",1))),kt.raw(C,"LineStyle")!=null){var X=kt.stroke(C);X.dashVisible>0?(l.dashed="1",l.fixDash="1",l.dashPattern=rr(X.dashVisible)+" "+rr(X.dashSpace)):l.dashed="0"}}if(b=kt.color(C,"FontColor"),b!=null&&b!=="none"){var V=Y(b);V&&(l.fontColor=V)}if(kt.raw(C,"FontSize")!=null){var tr=kt.asInt(C,"FontSize",-1);tr>0&&(l.fontSize=String(tr))}if(kt.raw(C,"FontName")!=null){var wr=Lc(kt.raw(C,"FontName"));wr&&(l.fontFamily=wr)}if(kt.raw(C,"FontStyle")!=null||kt.raw(C,"FontWeight")!=null){var yr=kt.fontFace(C);l.fontStyleBits=(yr.bold?1:0)|(yr.italic?2:0)}return kt.raw(C,"HorizontalAlignment")!=null&&(l.align=kt.horizontalAlignment(C)),l}function M(r,a){var e,h=!1;for(e in a)if(a.hasOwnProperty(e)){h=!0;break}if(!h)return r;var l=String(r||"");l.length>0&&l.charAt(l.length-1)!==";"&&(l+=";");for(e in a)if(a.hasOwnProperty(e)){var C=e,b=a[e];if(e==="fontStyleBits"){var Z=/(?:^|;)fontStyle=(\d+);/.exec(l),v=Z!=null?parseInt(Z[1],10):0;if(C="fontStyle",b=String(b|v&4),b==="0"&&Z==null)continue}var er=new RegExp("(^|;)"+C+"=[^;]*;");er.test(l)?l=l.replace(er,"$1"+C+"="+b+";"):l+=C+"="+b+";"}return l}function j(r,a){return a!=null&&a.skinparams!=null&&/^ortho$/i.test(String(a.skinparams.linetype||""))?M(r,{edgeStyle:"orthogonalEdgeStyle"}):r}function gr(r,a){return r.replace(/(<mxCell id="(?:cl)?(title|header|footer|caption|legend|legendtext)_\d+"[^>]*? style=")([^"]*)"/g,function(e,h,l,C){var b=l==="legend"||l==="legendtext"?["root","element","legend"]:["root","document",l],Z=l==="legend"?"vertex":"text";return h+M(C,H(a,b,[],Z))+'"'})}function W(r,a,e,h,l,C){var b=H(a,e,h,l);if(C!=null)for(var Z=0;Z<C.length;Z++)delete b[C[Z]];return M(r,b)}function d(r){return r==null?"":String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\r\n?/g,`
-`).replace(/\n/g,"&#10;")}var _={heart:"\u2665",star:"\u2605",star_o:"\u2606",check:"\u2714",check_circle:"\u2714",circle_check:"\u2714",ban:"\u2718",x:"\u2717",cloud:"\u2601",sun:"\u2600",gear:"\u2699",cog:"\u2699",cogs:"\u2699",exchange:"\u21C4",envelope:"\u2709",mail:"\u2709",home:"\u2302",house:"\u2302",info:"\u2139",warning:"\u26A0",bolt:"\u26A1",flag:"\u2691",key:"\u26BF",person:"\u263B",people:"\u263B",user:"\u263B",users:"\u263B",phone:"\u260E",clock:"\u23F1",cubes:"\u29C9",cube:"\u25A2",arrow_right:"\u2192",arrow_left:"\u2190",share_alt_square:"\u21AA",plus:"+",minus:"\u2212"};function p(r){var a=_[r]||_[r.replace(/-/g,"_")];return a||""}var E=/--([^\n]+?)--/g,L=/^\s*-+\s*$/;function N(r,a){for(var e=String(r).split(`
-`),h=0;h<e.length;h++)L.test(e[h])||(e[h]=a(e[h]));return e.join(`
-`)}function m(r){var a=String(r??"");if(/<(?:s|strike|del)(?::[^>]*)?>[\s\S]+?<\/(?:s|strike|del)\s*>/i.test(a))return!0;for(var e=a.split(`
-`),h=0;h<e.length;h++)if(!L.test(e[h])&&/--[^\n]+?--/.test(e[h]))return!0;return!1}function u(r){return r==null?"":(r=String(r),r=r.replace(/<U\+([0-9A-Fa-f]{2,6})>/g,function(a,e){try{return String.fromCodePoint(parseInt(e,16))}catch{return""}}),r=r.replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," "),r=r.replace(/<\/?(?:size|color|colour|back|b|i|u|s|strike|del|sub|sup|font|w|plain)(?:[:\s][^>]*)?\s*>/gi,""),r=r.replace(/<&([a-zA-Z0-9_-]+)>/g,function(a,e){return p(e)}).replace(/<\$([a-zA-Z0-9_-]+)(?:\*[\d.]+)?>/g,function(a,e){return p(e)}),r=r.replace(/\*\*([\s\S]+?)\*\*/g,"$1").replace(/\/\/([\s\S]+?)\/\//g,"$1").replace(/__([\s\S]+?)__/g,"$1").replace(/~~([\s\S]+?)~~/g,"$1").replace(/""([\s\S]+?)""/g,"$1"),r=N(r,function(a){return a.replace(E,"$1")}),r)}function R(r){return d(u(r))}function o(r,a){var e=u(r);return a&&String(a).indexOf("html=1")>=0&&(e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),d(e)}function t(r){return String(r).replace(/\*\*([^\n]+?)\*\*/g,"<b>$1</b>").replace(/\/\/([^\n]+?)\/\//g,"<i>$1</i>").replace(/__([^\n]+?)__/g,"<u>$1</u>").replace(/~~([^\n]+?)~~/g,"<u>$1</u>").replace(E,"<strike>$1</strike>")}function n(r){if(r==null)return"";r=String(r),r=r.replace(/<U\+([0-9A-Fa-f]{2,6})>/g,function(Z,v){try{return String.fromCodePoint(parseInt(v,16))}catch{return""}}),r=r.replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," "),r=r.replace(/<(?:s|strike|del)(?::[^>]*)?>/gi,"").replace(/<\/(?:s|strike|del)\s*>/gi,""),r=r.replace(/<\/?(?:size|color|colour|back|b|i|u|s|strike|del|sub|sup|font|w|plain)(?:[:\s][^>]*)?\s*>/gi,""),r=r.replace(/""([\s\S]+?)""/g,"$1"),r=r.replace(/<&([a-zA-Z0-9_-]+)>/g,function(Z,v){return p(v)}).replace(/<\$([a-zA-Z0-9_-]+)(?:\*[\d.]+)?>/g,function(Z,v){return p(v)}),r=r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");for(var a=r.split(`
-`),e="",h=!0,l=0;l<a.length;l++){var C=/^\s*(-{3,}|={3,}|\.{3,})\s*$/.exec(a[l]);if(C){var b=C[1].charAt(0);e+='<hr style="border:none;border-top:'+(b==="="?"3px double":b==="."?"1px dotted":"1px solid")+' #181818;margin:4px 0 5px;">',h=!0;continue}h||(e+="<br>"),e+=L.test(a[l])?a[l]:t(a[l]),h=!1}return e.replace(/\u0001/g,'<font face="monospace">').replace(/\u0002/g,"</font>").replace(/\u0004/g,"<strike>").replace(/\u0005/g,"</strike>")}function f(r){var a=String(r??"");return/\*\*[\s\S]+?\*\*|\/\/[\s\S]+?\/\/|""[\s\S]+?""|__[\s\S]+?__|~~[\s\S]+?~~|(?:^|\n)\s*[*#]+\s+\S/.test(a)?!0:m(a)}function O(r){if(r=String(r??""),!/(?:^|\n)\s*[*#]+\s+\S/.test(r))return n(r);for(var a=r.split(`
-`),e="",h=[],l="",C=0;C<a.length;C++){var b=a[C].match(/^\s*([*#]+)\s+(.*)$/);if(!b){for(;h.length>0;)e+="</li></"+h.pop()+">";e+=l+n(a[C]),l="<br>";continue}for(var Z=b[1].length,v=b[1].charAt(0)==="#"?"ol":"ul";h.length>Z;)e+="</li></"+h.pop()+">";for(h.length===Z&&(e+="</li>");h.length<Z;)e+="<"+v+' style="margin:0;padding-left:14px">',h.push(v);e+="<li>"+n(b[2]),l=""}for(;h.length>0;)e+="</li></"+h.pop()+">";return e}function g(r){for(var a=String(r??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&lt;(\/?)([biu])&gt;/gi,"<$1$2>"),e=a.match(/<\/?[biu]>/gi)||[],h=[],l=0;l<e.length;l++){var C=e[l].toLowerCase(),b=C.charAt(1)==="/",Z=b?C.charAt(2):C.charAt(1);if(b){var v=h.lastIndexOf(Z);v>=0&&h.splice(v,1)}else h.push(Z)}for(;h.length;)a+="</"+h.pop()+">";return a}function Q(r){return n(r)}var x=5,I=33,w=14,nr=24,lr=10,ir=25,mr=17.7,Or=15,Qr=17,ee=22,re=4;function Yr(r){return/^-{3,}$/.test(r)?"solid":/^\.{3,}$/.test(r)?"dotted":/^={3,}$/.test(r)?"double":null}function Zr(r){return r<=1?18:r===2?16:r===3?15:14}var Ee=10,Ze=8.43;function eo(r){for(var a="",e=!0,h=0;h<r.length;h++){var l=r[h],C=Yr(l);if(C){a+='<hr style="border:none;border-top:'+(C==="double"?"3px double":C==="dotted"?"1px dotted":"1px solid")+' #181818;margin:4px 0 5px;">',e=!0;continue}e||(a+="<br>"),e=!1;var b=/^(=+)\s*/.exec(l),Z=/^"{2}.*"{2}$/.test(l),v=l.replace(/^=+\s*/,"").replace(/^"{2}|"{2}$/g,"");b?a+='<b><font style="font-size:'+Zr(b[1].length)+'px">'+n(v)+"</font></b>":Z?a+='<font face="monospace">'+R(v)+"</font>":a+=n(v)}return a}function Gr(r,a,e){return is(r,a,e)}function $e(r){return r?String(r).split(`
-`).length:0}function Ye(r,a){var e=a==="box"?8:a==="hexagon"?23:20;return Gr(r||"",13,!1)+e}function Hr(r,a,e){var h=Y(r.color)||(a?"#E3E3E3":"#E2E2F0"),l=Y(r.borderColor)||"#181818",C=Y(r.fontColor)||"#000000",b="rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+h+";strokeColor="+l+";strokeWidth=0.5;fontColor="+C+";fontSize=14;whiteSpace=wrap;html=1;",Z=e?"verticalLabelPosition=top;verticalAlign=bottom;":"verticalLabelPosition=bottom;verticalAlign=top;",v=Z+"fillColor="+h+";strokeColor="+l+";fontColor="+C+";fontSize=14;html=1;";switch(r.kind){case"actor":return"shape=umlActor;"+v;case"boundary":return"shape=umlBoundary;"+v;case"control":return"ellipse;shape=umlControl;"+v;case"entity":return"ellipse;shape=umlEntity;"+v;case"database":return"shape=cylinder3;size=6;"+v;case"queue":return"shape=cylinder3;direction=east;size=8;"+v;default:return"shape=rectangle;"+b}}var Fo=4.5,k=9,T=7;function D(r){switch(r){case"open":return"endArrow=open;endFill=0;endSize=9;";case"lost":return"endArrow=cross;endSize=12;";case"circle":return"endArrow=classic;endFill=1;endSize=9;";case"halfTop":return"endArrow=open;endFill=0;endSize=9;endHalf=top;";case"halfBottom":return"endArrow=open;endFill=0;endSize=9;endHalf=bottom;";case"bidirectional":return"endArrow=classic;endFill=1;endSize=9;startArrow=classic;startFill=1;startSize=9;";default:return"endArrow=classic;endFill=1;endSize=9;"}}function S(r){var a=String(r??"");return/\*\*[^\n]+?\*\*|\/\/[^\n]+?\/\/|""[^\n]+?""|__[^\n]+?__|~~[^\n]+?~~/.test(a)||m(a)}function U(r){var a=String(r??"").replace(/^\s+|\s+$/g,"");return/^\*\*[\s\S]+\*\*$/.test(a)&&a.indexOf("**",2)===a.length-2?1:/^\/\/[\s\S]+\/\/$/.test(a)&&a.indexOf("//",2)===a.length-2?2:/^__[\s\S]+__$/.test(a)&&a.indexOf("__",2)===a.length-2?4:0}function P(r,a){var e=String(a??"");return!S(r)||U(r)!==0&&/(?:^|;)fontStyle=[1-9]/.test(e)?{value:o(r,e),style:e}:(/(?:^|;)html=1/.test(e)||(e.length>0&&e.charAt(e.length-1)!==";"&&(e+=";"),e+="html=1;"),{value:d(n(r)),style:e})}function s(r,a,e,h,l,C,b,Z){var v=P(a,e);return' <mxCell id="'+d(r)+'" value="'+v.value+'" style="'+d(v.style)+'" vertex="1" parent="'+d(Z||"1")+`">
- <mxGeometry x="`+h+'" y="'+l+'" width="'+C+'" height="'+b+`" as="geometry"/>
+var PlantUml=(()=>{var lh=Object.defineProperty;var BC=Object.getOwnPropertyDescriptor;var IC=Object.getOwnPropertyNames;var NC=Object.prototype.hasOwnProperty;var hv=(Ar,Z)=>{for(var Mr in Z)lh(Ar,Mr,{get:Z[Mr],enumerable:!0})},LC=(Ar,Z,Mr,Yr)=>{if(Z&&typeof Z=="object"||typeof Z=="function")for(let fe of IC(Z))!NC.call(Ar,fe)&&fe!==Mr&&lh(Ar,fe,{get:()=>Z[fe],enumerable:!(Yr=BC(Z,fe))||Yr.enumerable});return Ar};var GC=Ar=>LC(lh({},"__esModule",{value:!0}),Ar);var PC={};hv(PC,{default:()=>wC});var ih={};hv(ih,{ActivityLegacyParser:()=>fc,ActivityParser:()=>uc,ArchimateParser:()=>kc,C4Parser:()=>_c,ClassParser:()=>dc,ComponentParser:()=>cc,GanttParser:()=>$c,JsonParser:()=>ed,MindmapParser:()=>Cc,NetworkParser:()=>mc,ObjectParser:()=>hc,PlantUml2Drawio:()=>lc,PlantUml2Png:()=>pv,PlantUml2Svg:()=>bd,PlantUmlCellFactory:()=>rd,PlantUmlDotLayout:()=>Qf,PlantUmlFurniture:()=>Ua,PlantUmlLexer:()=>vv,PlantUmlParser:()=>Ai,PlantUmlPreprocessor:()=>yd,PlantUmlSkinParam:()=>ac,PlantUmlStyleSheet:()=>Ft,PlantUmlThemes:()=>Vf,PlantUmlUnsupported:()=>Sf,PlantUmlWarnings:()=>Eo,SaltParser:()=>Ac,SequenceParser:()=>ic,StateParser:()=>sc,TimingParser:()=>gc,UseCaseParser:()=>vc,WbsParser:()=>pc,YamlParser:()=>Rc,mxPlantUmlToDrawio:()=>Cv});var vv=(function(){function Ar(Z){this.input=Z,this.pos=0,this.line=1,this.col=1,this.len=Z.length}return Ar.prototype.peek=function(Z){return this.input[this.pos+(Z||0)]||""},Ar.prototype.peekStr=function(Z){return this.input.substring(this.pos,this.pos+Z)},Ar.prototype.isEof=function(){return this.pos>=this.len},Ar.prototype.advance=function(Z){Z=Z||1;for(var Mr=0;Mr<Z&&this.pos<this.len;Mr++)this.input[this.pos]===`
+`?(this.line++,this.col=1):this.col++,this.pos++},Ar.prototype.skipInlineWhitespace=function(){for(;this.pos<this.len;){var Z=this.input[this.pos];if(Z===" "||Z===" ")this.pos++,this.col++;else break}},Ar.prototype.skipWhitespace=function(){for(;this.pos<this.len;){var Z=this.input[this.pos];if(Z===" "||Z===" "||Z==="\r"||Z===`
+`)this.advance(1);else break}},Ar.prototype.skipLineComment=function(){for(;this.pos<this.len&&this.input[this.pos]!==`
+`;)this.pos++,this.col++},Ar.prototype.skipBlockComment=function(){for(this.advance(2);this.pos<this.len-1;){if(this.input[this.pos]==="'"&&this.input[this.pos+1]==="/"){this.advance(2);return}this.advance(1)}this.pos=this.len},Ar.prototype.skipWhitespaceAndComments=function(){for(;this.pos<this.len;){var Z=this.input[this.pos];if(Z===" "||Z===" "||Z==="\r"||Z===`
+`)this.advance(1);else if(Z==="'")this.skipLineComment();else if(Z==="/"&&this.input[this.pos+1]==="'")this.skipBlockComment();else break}},Ar.prototype.readQuotedString=function(){var Z=this.input[this.pos];if(Z!=='"'&&Z!=="'"&&Z!=="`")return null;var Mr=this.pos+1,Yr="";for(this.advance(1);this.pos<this.len;){var fe=this.input[this.pos];if(fe==="\\"&&this.pos+1<this.len)Yr+=this.input[this.pos+1],this.advance(2);else{if(fe===Z)return this.advance(1),Yr;Yr+=fe,this.advance(1)}}return Yr},Ar.prototype.readLine=function(){for(var Z=this.pos;this.pos<this.len&&this.input[this.pos]!==`
+`;)this.pos++,this.col++;var Mr=this.input.substring(Z,this.pos);return this.pos<this.len&&this.advance(1),Mr},Ar.prototype.readIdentifier=function(){var Z=this.input[this.pos];if(!(Z>="a"&&Z<="z"||Z>="A"&&Z<="Z"||Z==="_"))return null;for(var Mr=this.pos;this.pos<this.len;){var Yr=this.input[this.pos];if(Yr>="a"&&Yr<="z"||Yr>="A"&&Yr<="Z"||Yr>="0"&&Yr<="9"||Yr==="_")this.pos++,this.col++;else break}return this.input.substring(Mr,this.pos)},{create:function(Z){return new Ar(Z)}}})();var Vf=(function(){var Ar={},Z={};Z._none_={author:"The-Lum",license:"PlantUML (Apache-2.0 asl edition)",source:""},Ar._none_=[].join(`
+`),Z.amiga={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},Ar.amiga=['!$THEME = "amiga"',"",'!$BLACK = "#000121"','!$BLUE = "#0B58A8"','!$ORANGE = "#FDA325"','!$RED = "#DB252B"','!$WHITE = "#FFFFFF"',"","!$BGCOLOR = $BLUE","!$FGCOLOR = $WHITE","","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $ORANGE","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","groupHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","node {","MaximumWidth 300","}","referenceHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy nosolid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $BGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $ORANGE","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
+`),Z["aws-orange"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar["aws-orange"]=['!$PUML_THEME = "aws-orange"','!$THEME = "aws-orange"','!if %not(%variable_exists("$PUML_BGCOLOR"))','!$PUML_BGCOLOR = "transparent"',"!endif",'!if %not(%variable_exists("$PUML_GRADIENT"))',"!$PUML_GRADIENT = 20","!endif",'!if %not(%variable_exists("$PUML_MODE"))','!$PUML_MODE = "light"',"!endif",'!if %not(%variable_exists("$PUML_OUTLINE"))','!$PUML_OUTLINE = "false"',"!endif","skinparam BackgroundColor $PUML_BGCOLOR","skinparam useBetaStyle false",'!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#868e96"','!$PRIMARY = "#EC7211"','!$WARNING = "#EC7211"','!$LIGHT = "#abb6c2"','!$DARK = "#4E5D6C"','!if ($PUML_MODE == "light")','!$SECONDARY = "#eeeeee"','!$SECONDARY_LIGHT = "ffffff"','!$SUCCESS = "#1D8102"','!$INFO = "#0073bb"','!$DANGER = "#d13212"',"!$SECONDARY_TEXT = $DARK","!$FGCOLOR = $DARK","!$DIAMOND_BD = %darken($SECONDARY, $PUML_GRADIENT)","!assume transparent light","!else",'!$SECONDARY = "#2a2e33"',"!$SECONDARY_LIGHT = %lighten($SECONDARY, $PUML_GRADIENT)",'!$SUCCESS = "#6aaf35"','!$INFO = "#44b9d6"','!$DANGER = "#ff5d64"',"!$SECONDARY_TEXT = $WHITE","!$FGCOLOR = $WHITE","!$DIAMOND_BD = %lighten($SECONDARY, $PUML_GRADIENT)","!assume transparent dark","!endif","!$PRIMARY_DARK = %darken($PRIMARY, $PUML_GRADIENT)","!$PRIMARY_LIGHT = %lighten($PRIMARY, $PUML_GRADIENT)","!$SECONDARY_DARK = %darken($SECONDARY, $PUML_GRADIENT)","!$SUCCESS_DARK = %darken($SUCCESS, $PUML_GRADIENT)","!$SUCCESS_LIGHT = %lighten($SUCCESS, $PUML_GRADIENT)","!$INFO_DARK = %darken($INFO, $PUML_GRADIENT)","!$INFO_LIGHT = %lighten($INFO, $PUML_GRADIENT)","!$DANGER_DARK = %darken($DANGER, $PUML_GRADIENT)","!$DANGER_LIGHT = %lighten($DANGER, $PUML_GRADIENT)","!$WARNING_DARK = %darken($WARNING, $PUML_GRADIENT)","!$WARNING_LIGHT = %lighten($WARNING, $PUML_GRADIENT)","!$DARK_DARK = %darken($DARK, $PUML_GRADIENT)","!$DARK_LIGHT = %lighten($DARK, $PUML_GRADIENT)","!$LIGHT_DARK = %darken($LIGHT, $PUML_GRADIENT)","!$LIGHT_LIGHT = %lighten($LIGHT, $PUML_GRADIENT)","!$INFO_TEXT = $WHITE","!$SUCCESS_TEXT = $WHITE","!$WARNING_TEXT = $WHITE","!$DANGER_TEXT = $WHITE","!$PRIMARY_TEXT = $WHITE","!$HEADER_TEXT = $WHITE",'!if ($PUML_OUTLINE == "true")',"!$HEADER_TEXT = $PRIMARY_TEXT","!$PRIMARY_TEXT = $PRIMARY_LIGHT","!$INFO_TEXT = $INFO_LIGHT","!$WARNING_TEXT = $WARNING_LIGHT","!$DARK_BG = $PUML_BGCOLOR","!$INFO_BG = $PUML_BGCOLOR","!$DANGER_BG = $PUML_BGCOLOR","!$WARNING_BG = $PUML_BGCOLOR","!$SECONDARY_BG = $PUML_BGCOLOR","!else","!$DARK_BG = $DARK","!$INFO_BG = $INFO","!$DANGER_BG = $DANGER","!$WARNING_BG = $WARNING","!$SECONDARY_BG = $SECONDARY","!endif","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","!procedure $primary_scheme()",'!if ($PUML_OUTLINE == "true")',"FontColor $PRIMARY","BorderColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","!else","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endif","!endprocedure","!procedure $secondary_scheme()",'!if ($PUML_OUTLINE == "true")',"FontColor $SECONDARY_DARK","BorderColor $SECONDARY_DARK","BackgroundColor $PUML_BGCOLOR","!else","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","!endif","!endprocedure",'!_POST = "<color #007a3e>POST</color>"','!_PUT = "<color #ea7400>PUT</color>"','!_DELETE = "<color #cf2a2a>DELETE</color>"','!_GET = "<color #009fdb>GET</color>"','!_PATCH = "<color #b5bd00>PATCH</color>"','!_HEAD = "<color #9012fe>HEAD</color>"','skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","","skinparam legend {","$secondary_scheme()","BackgroundColor transparent","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","' <style> ","' mindmapDiagram {","' Padding 15","' Margin 10","' FontSize 12","' FontName Verdana","' Shadowing 0.0","' LineThickness 1.5","' FontColor $PRIMARY_TEXT","' LineColor $PRIMARY_DARK","' node {","' LineColor $PRIMARY","' BackGroundColor $PRIMARY_LIGHT-$PRIMARY","' }","' }","' </style>","","!startsub activity","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_BG","DiamondBorderColor $DIAMOND_BD","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","skinparam actor {","$primary_scheme()","FontColor $FGCOLOR","}","!endsub","","!startsub arrow","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","skinparam sequence {","ArrowThickness 3","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $PUML_BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $LIGHT","LifeLineBorderThickness 2","LifeLineBackgroundColor $LIGHT_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupBodyBackgroundColor $PUML_BGCOLOR","GroupHeaderBackgroundColor $PUML_BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $PUML_BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","StereotypeFontSize 12","}","!endsub","","!startsub partition","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","}","!endsub","","!startsub collections","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","skinparam note {","BorderThickness 1","BackgroundColor $INFO_BG","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub artifact","skinparam artifact {","BackgroundColor $DARK_BG","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","skinparam storage {","BackgroundColor $WARNING_BG","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","skinparam node {","BackgroundColor $PUML_BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","skinparam cloud {","BackgroundColor transparent","BorderColor $DARK","FontColor $FGCOLOR","}","!endsub","","!startsub database","skinparam database {","$primary_scheme()","FontColor $FGCOLOR","StereotypeFontColor $FGCOLOR","}","!endsub","","!startsub class","skinparam class {","$primary_scheme()","FontColor $HEADER_TEXT","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub object","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","skinparam rectangle {","BackgroundColor $PUML_BGCOLOR","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_TEXT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","skinparam package {","BackgroundColor $PUML_BGCOLOR","BorderColor $SECONDARY_TEXT","FontColor $SECONDARY_TEXT","BorderThickness 2","}","!endsub","","!startsub folder","skinparam folder {","BackgroundColor $SECONDARY_BG","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","skinparam frame {","BackgroundColor $SECONDARY_BG","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","skinparam card {","BackgroundColor $INFO_BG","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","skinparam file {","BackgroundColor $SECONDARY_BG","BorderColor $LIGHT","FontColor $FGCOLOR","}","!endsub","","!startsub stack","skinparam stack {","$primary_scheme()","}","!endsub","","!startsub map","skinparam map {","$primary_scheme()","}","!endsub","","<style>","participant {","Margin 5 40","Padding 15 20","}","wbsDiagram, mindmapDiagram {","root {","BackgroundColor $PUML_BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $INFO_BG","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","$primary_scheme()","Padding 15","RoundCorner 20","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY_BG","FontColor $INFO_BG","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $PUML_BGCOLOR","FontColor $DARK_BG","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $PUML_BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_BG","FontColor $PRIMARY_TEXT","BorderColor $SECONDARY_BG","}","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY_BG","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT_BG","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY_BG","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO_BG","}","separator {","LineColor $SECONDARY_BG","BackGroundColor $secondary_scheme()","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO_BG","FontSize 16","FontStyle italic","BackGroundColor $DIAMOND_BG","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY_BG","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>"].join(`
+`),Z["black-knight"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar["black-knight"]=['!$THEME = "black-knight"',"!assume transparent dark",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif",'!if %not(%variable_exists("$GRADIENT"))',"!$GRADIENT = 20","!endif","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false",'!$PRIMARY = "#303030"',"!$PRIMARY_DARK = %darken($PRIMARY, $GRADIENT)","!$PRIMARY_LIGHT = %lighten($PRIMARY, $GRADIENT)",'!$PRIMARY_TEXT = "#fff200"','!$SECONDARY = "#484848"',"!$SECONDARY_DARK = %darken($SECONDARY, $GRADIENT)","!$SECONDARY_LIGHT = %lighten($SECONDARY, $GRADIENT)",'!$SECONDARY_TEXT = "#fefefe"','!$SUCCESS = "#00FF00"',"!$SUCCESS_DARK = %darken($SUCCESS, $GRADIENT)","!$SUCCESS_LIGHT = %lighten($SUCCESS, $GRADIENT)",'!$SUCCESS_TEXT = "ffffff"','!$INFO = "#0060a8"',"!$INFO_DARK = %darken($INFO, $GRADIENT)","!$INFO_LIGHT = %lighten($INFO, $GRADIENT)",'!$INFO_TEXT = "ffffff"','!$WARNING = "#ff8000"',"!$WARNING_DARK = %darken($WARNING, $GRADIENT)","!$WARNING_LIGHT = %lighten($WARNING, $GRADIENT)",'!$WARNING_TEXT = "#222222"','!$DANGER = "#ff0000"',"!$DANGER_DARK = %darken($DANGER, $GRADIENT)","!$DANGER_LIGHT = %lighten($DANGER, $GRADIENT)",'!$DANGER_TEXT = "ffffff"','!$LIGHT = "#fff200"','!$DARK = "#484848"',"!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","!procedure $info($msg)","<font color=$INFO><b>$msg","!endprocedure","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","!endprocedure","!procedure $secondary_scheme()","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","!endprocedure","","skinparam {",'defaultFontName "Verdana"',"defaultFontSize 12","defaultTextAlignment center","shadowing false","RoundCorner 10","TitleFontSize 18","' TitleFontColor $PRIMARY_TEXT","}","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","","skinparam title {","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $PRIMARY","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupBodyBackgroundColor $BGCOLOR","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $SECONDARY_TEXT","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_LIGHT","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub artifact","skinparam artifact {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub component","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING_DARK","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY_LIGHT","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub cloud","skinparam cloud {","BackgroundColor transparent","BorderColor $PRIMARY_LIGHT","FontColor $LIGHT","}","!endsub","","!startsub database","skinparam database {","$primary_scheme()","BackgroundColor $BGCOLOR","}","!endsub","","!startsub class","skinparam class {","$primary_scheme()","HeaderBackgroundColor $SECONDARY_DARK-$SECONDARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","skinparam rectangle {","$primary_scheme()","BackgroundColor $BGCOLOR","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","skinparam package {","$primary_scheme()","BackgroundColor $BGCOLOR","BorderThickness 2","}","!endsub","","!startsub folder","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $INFO","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub stack","skinparam stack {","$primary_scheme()","}","!endsub","",'!if %variable_exists("NEWSTYLE")',"<>","wbsDiagram {","LineColor $PRIMARY","BorderThickness 3","BackgroundColor $LIGHT","FontColor $PRIMARY_TEXT",":depth(0) {","fontSize 16","fontStyle bold","fontColor $SECONDARY","}",":depth(1) {","fontSize 14","padding 5","fontStyle bold","}",":depth(2) {","fontSize 12","padding 4","}",":depth(3) {","fontSize 11","padding 3","fontColor $INFO","}","","}","</>","!endif"].join(`
+`),Z.bluegray={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.bluegray=['!$THEME = "bluegray"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$WHITE = "#fff"','!$GRAY_DARK = "#5a5a5a"','!$GRAY = "#959595"','!$PRIMARY = "#009fdb"','!$SECONDARY = "#f2f2f2"','!$SUCCESS = "#b5bd00"','!$INFO = "#0568ae"','!$WARNING = "#ea7400"','!$DANGER = "#cf2a2a"','!$LIGHT = "#d2d2d2"','!$DARK = "#5a5a5a"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#33b2e2"','!$PRIMARY_DARK = "#007faf"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_LIGHT = "#f5f5f5"','!$SECONDARY_DARK = "#c2c2c2"',"!$SECONDARY_TEXT = $DARK",'!$INFO_LIGHT = "#3786be"','!$INFO_DARK = "#04538b"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_LIGHT = "#c4ca33"','!$SUCCESS_DARK = "#919700"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_LIGHT = "#ee9033"','!$WARNING_DARK = "#bb5d00"',"!$WARNING_TEXT = $WHITE",'!$DANGER_LIGHT = "#d95555"','!$DANGER_DARK = "#a62222"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_LIGHT","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","","!endprocedure","","!procedure $secondary_scheme()","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","BackgroundColor $WHITE-#fefefe","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 30","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 20","skinparam BoxPadding 40","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $WHITE-$LIGHT","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY_DARK","FontColor $PRIMARY","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $PRIMARY","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","' FontColor $PRIMARY","BorderColor $PRIMARY_DARK","' BackgroundColor $BGCOLOR","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$secondary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","FontColor $PRIMARY","BorderColor $PRIMARY_LIGHT","BackgroundColor $BGCOLOR","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $INFO","FontColor $SECONDARY_TEXT","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.blueprint={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},Ar.blueprint=['!$THEME = "blueprint"',"",'!$BGCOLOR = "#003153"','!$FGCOLOR = "#D9D3D0"',"","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $FGCOLOR","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","node {","MaximumWidth 300","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy nosolid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $FGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $FGCOLOR","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
+`),Z["carbon-gray"]={author:"Bharat Rajagopalan",license:"PlantUML (Apache-2.0 asl edition)",source:""},Ar["carbon-gray"]=['!$THEME = "carbon-gray"',"",`'!$BGCOLOR = "#f5f5f5"`,"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","","!$RED_80 = '#750e13'","!$RED_70 = '#a2191f'","!$RED_60 = '#da1e28'","!$RED_50 = '#fa4d56'","!$RED_40 = '#ff8389'","!$RED_30 = '#ffb3b8'","!$RED_20 = '#ffd7d9'","!$RED_10 = '#fff1f1'","","!$CYAN_10 = '#e5f6ff'","!$CYAN_20 = '#bae6ff'","!$CYAN_30 = '#82cfff'","!$CYAN_40 = '#33b1ff'","!$CYAN_50 = '#1192e8'","!$CYAN_60 = '#0072c3'","!$CYAN_70 = '#00539a'","!$CYAN_80 = '#003a6d'","","!$PURPLE_80 ='#491d8b'","!$PURPLE_70 = '#6929c4'","!$PURPLE_60 = '#8a3ffc'","!$PURPLE_50 = '#a56eff'","!$PURPLE_40 = '#be95ff'","!$PURPLE_30 = '#d4bbff'","!$PURPLE_20 = '#e8daff'","!$PURPLE_10 = '#f6f2ff'","","!$TEAL_10 = '#d9fbfb'","!$TEAL_20 = '#9ef0f0'","!$TEAL_30 = '#3ddbd9'","!$TEAL_40 = '#08bdba'","!$TEAL_50 = '#009d9a'","!$TEAL_60 = '#007d79'","!$TEAL_70 = '#005d5d'","!$TEAL_80 = '#004144'","","!$GRAY_10 = '#f4f4f4'","!$GRAY_20 = '#e0e0e0'","!$GRAY_30 = '#c6c6c6'","!$GRAY_40 = '#a8a8a8'","!$GRAY_50 = '#8d8d8d'","!$GRAY_60 = '#6f6f6f'","!$GRAY_70 = '#525252'","!$GRAY_80 = '#393939'","!$GRAY_90 = '#262626'","!$GRAY_100 = '#161616'","!$WHITE = '#FFFFF'","","!$GRAY_DARK = $GRAY_100","!$GRAY = $GRAY_30","!$LIGHT = $GRAY_70","!$DARK = $GRAY_90","","!$FGCOLOR = $DARK","!$PRIMARY = $GRAY_10","!$PRIMARY_LIGHT = $GRAY_10 ","!$PRIMARY_DARK = $GRAY_30","!$PRIMARY_TEXT = $DARK","!$SECONDARY = $GRAY_10 ","!$SECONDARY_LIGHT = $GRAY_10","!$SECONDARY_DARK = $GRAY_30","!$SECONDARY_TEXT = $DARK","!$INFO = $WHITE","!$INFO_LIGHT = $GRAY_20","!$INFO_DARK = $GRAY_30","!$INFO_TEXT = $DARK","!$SUCCESS = $DARK","!$SUCCESS_LIGHT = $DARK","!$SUCCESS_DARK = $DARK","!$SUCCESS_TEXT = $WHITE","!$WARNING = $WHITE","!$WARNING_LIGHT = $WHITE","!$WARNING_DARK = $WHITE","!$WARNING_TEXT = $DARK","!$DANGER = $WHITE","!$DANGER_LIGHT = $WHITE","!$DANGER_DARK = $WHITE","!$DANGER_TEXT = $DARK","","!$OTHER_BG = $WHITE","!$DB_BG = $GRAY","!$LINE_THICKNESS = 1","!$BORDER_THICKNESS = 1","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","RoundCorner 0","!endprocedure","",'skinparam defaultFontName "IBM Plex Sans, Noto Sans, Verdana"',"skinparam defaultFontSize 12","'skinparam dpi 125","skinparam shadowing false","skinparam roundcorner 0","skinparam BoxPadding 30","skinparam ArrowColor $GRAY","<style>","participant {","Margin 5 30","Padding 15 20","}","</style>","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY","FontSize 20","BorderRoundCorner 8","BorderThickness 0","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $OTHER_BG","BorderColor $DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $PRIMARY","BorderThickness $LINE_THICKNESS","TitleBackgroundColor $PRIMARY_LIGHT-$PRIMARY","TitleFontColor $PRIMARY_TEXT","BackgroundColor $BG_COLOR","TitleFontStyle bold","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $DARK","StartColor $LIGHT-$DARK","EndColor $LIGHT-$DARK","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY","DiamondBorderColor $SECONDARY","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness $BORDER_THICKNESS","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness $LINE_THICKNESS","Color $GRAY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY_DARK","' For some reason sequence title font color does not pick up from global","TitleFontColor $SECONDARY_TEXT","BackgroundColor $OTHER_BG","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $OTHER_BG","BoxBorderColor $PRIMARY_DARK","BoxFontColor $PRIMARY_TEXT","DelayFontColor $PRIMARY_TEXT","LifeLineBorderColor $PRIMARY_DARK","LifeLineBorderThickness $LINE_THICKNESS","LifeLineBackgroundColor $PRIMARY","GroupBorderColor $PRIMARY_DARK","GroupFontColor $PRIMARY_TEXT","GroupFontStyle bold","GroupHeaderFontColor $INFO_TEXT","GroupBackgroundColor $PRIMARY","GroupBodyBackgroundColor $OTHER_BG","GroupHeaderBackgroundColor $PRIMARY","DividerBackgroundColor $PRIMARY","DividerBorderColor $PRIMARY_DARK","DividerBorderThickness $LINE_THICKNESS","DividerFontColor $PRIMARY_TEXT","ReferenceBackgroundColor $BGCOLOR","ReferenceHeaderBorderColor $PRIMARY_DARK","ReferenceHeaderBackgroundColor $PRIMARY","ReferenceBorderColor $PRIMARY_DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO_TEXT","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_TEXT","BackgroundColor $OTHER_BG","fontStyle bold","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $PRIMARY_LIGHT","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","RoundCorner 0","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $DARK","FontColor $INFO_TEXT","RoundCorner 0","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $PRIMARY","BorderColor $PRIMARY_DARK","FontColor $DARK","RoundCorner 0","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","BackgroundColor $PRIMARY","BorderColor $PRIMARY_DARK","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $PRIMARY_DARK","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $OTHER_BG","BorderColor $DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","Roundcorner 0","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","Roundcorner 0","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","BorderColor $PRIMARY_DARK","BackgroundColor $OTHER_BG","Roundcorner 0","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $PRIMARY_TEXT","StereotypeFontSize 9","BorderThickness $LINE_THICKNESS","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $PRIMARY_TEXT","BorderThickness $BORDER_THICKNESS","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness $BORDER_THICKNESS","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $OTHER_BG","BorderThickness $BORDER_THICKNESS","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BackgroundColor $OTHER_BG","BorderThickness $BORDER_THICKNESS","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $WARNING_TEXT","BorderThickness $BORDER_THICKNESS","Roundcorner 0","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $DARK","BorderThickness $BORDER_THICKNESS","Roundcorner 0","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $OTHER_BG","BorderColor $PRIMARY_DARK","FontColor $INFO_TEXT","RoundCorner 0","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","RoundCorner 0","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub","","!startsub person","","skinparam person {","$primary_scheme()","}","!endsub","",'!if (%variable_exists("LEGACY"))','!$LEGACY = "true"',"!endif","",'!if (%getenv("LEGACY") == "true")','!$LEGACY = "true"',"!endif","",`'!if (not %variable_exists("$LEGACY"))`,"","skinparam useBetaStyle true","","!startsub mindmap","","<style>","","boardDiagram {","node {","$primary_scheme()","BackGroundColor $PRIMARY","LineColor $PRIMARY_DARK",'FontName "IBM Plex Sans, Noto Sans, Verdana"',"'FontColor ","FontSize 12","'FontStyle bold","RoundCorner 0","'LineThickness 2","'LineStyle 10-5","separator {","LineThickness $LINE_THICKNESS","LineColor $PRIMARY_DARK","'LineStyle 1-5","}","}","}","","ganttDiagram {","","task {","BackGroundColor $PRIMARY","LineColor $PRIMARY_DARK","FontStyle Bold","FontSize 12","unstarted {","BackGroundColor $PRIMARY_LIGHT","LineColor $PRIMARY_DARK","'FontColor $RED_80","}","Padding 3","Margin 3","","}","timeline {","LineColor $PRIMARY","FontColor $WHITE","BackgroundColor $DARK","FontName Helvetica","'FontSize 12","FontStyle bold","YearFontColor $WHITE","QuarterFontColor $WHITE","MonthFontColor $WHITE","WeekFontColor $WHITE","WeekdayFontColor $WHITE","DayFontColor $WHITE","}","arrow {","'FontName Helvetica","'FontColor red","FontSize 12","FontStyle bold","'BackGroundColor GreenYellow","LineColor $PRIMARY_DARK","'LineStyle 8.0-13.0","'LineThickness 3.0","}","","milestone {","FontColor $PRIMARY_TEXT","FontSize 12","FontStyle bold","BackGroundColor $DARK","LineColor $DARK","}","separator {","BackgroundColor $PRIMARY","'LineStyle 8.0-3.0","LineColor $PRIMARY","LineThickness 1.0","FontSize 12","FontStyle bold","FontColor $PRIMARY_TEXT","Margin 3","'Padding 20","}","closed {","BackgroundColor $RED_20","FontColor $RED_20","}","}","","jsonDiagram {","node {","$primary_scheme()","BackGroundColor $PRIMARY","LineColor $PRIMARY_DARK",'FontName "IBM Plex Sans, Noto Sans, Verdana"',"'FontColor ","FontSize 12","'FontStyle bold","RoundCorner 0","'LineThickness 2","'LineStyle 10-5","separator {","LineThickness $LINE_THICKNESS","LineColor $PRIMARY_DARK","'LineStyle 1-5","}","}","arrow {","BackGroundColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","LineThickness $LINE_THICKNESS","LineStyle 3-6","}","highlight {","BackGroundColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","FontStyle italic","}","}","","mindmapDiagram {","'Padding 8","'Margin 8","LineThickness $LINE_THICKNESS","FontColor $PRIMARY_TEXT","LineColor $PRIMARY_DARK","'BackgroundColor $PRIMARY_LIGHT-$PRIMARY","Roundcorner 0","node {","'Padding 12","'Margin 3","'HorizontalAlignment center","LineColor $PRIMARY_DARK","LineThickness $BORDER_THICKNESS","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","RoundCorner 0","MaximumWidth 100","FontColor $DARK","'FontStyle bold","}","}","","'Salt Diagram only has limited skinning","saltDiagram {","BackGroundColor $BG_COLOR","'Fontname Monospaced","'FontSize 10","'FontStyle italic","'LineThickness 0.5","'LineColor PRIMARY_DARK","}","","timingDiagram {","document {","BackGroundColor $BG_COLOR","LineColor $PRIMARY","BorderColor $PRIMARY","FontColor $PRIMARY_TEXT","","}","highlight {","BackGroundColor $PRIMARY","}","","constraintArrow {","'LineStyle 2-1","LineThickness 2","LineColor $RED_80","FontColor $RED_80","FontStyle bold","}","}","","wbsDiagram {","'Padding 8","node {","'Padding 12","'Margin 3","'HorizontalAlignment center","LineColor $PRIMARY_DARK","LineThickness $BORDER_THICKNESS","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","RoundCorner 0","MaximumWidth 100","FontColor $PRIMARY_TEXT","'FontStyle bold","}","'Margin 8","'LineThickness $LINE_THICKNESS","'FontColor $PRIMARY_TEXT","'LineColor $PRIMARY","'BorderColor $PRIMARY","'BackgroundColor $PRIMARY_LIGHT-$PRIMARY","'RoundCorner 0","","arrow {",`' note that Connectors are actually "Arrows"; this may change in the future`,"' so this means all Connectors and Arrows are now going to be green","","lineColor $PRIMARY_DARK","fontColor $PRIMARY_TEXT","thickness $LINE_THICKNESS","}","","noteBorderColor $DARK","}","","'Placeholder for adding wirediagram skins","wireDiagram {","}","","yamlDiagram {","node {","$primary_scheme()","BackGroundColor $PRIMARY","LineColor $PRIMARY_DARK",'FontName "IBM Plex Sans, Noto Sans, Verdana"',"'FontColor ","FontSize 12","'FontStyle bold","RoundCorner 0","'LineThickness 2","'LineStyle 10-5","separator {","LineThickness $LINE_THICKNESS","LineColor $PRIMARY_DARK","'LineStyle 1-5","}","}","arrow {","BackGroundColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","LineThickness $LINE_THICKNESS","LineStyle 3-6","}","highlight {","BackGroundColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","FontStyle italic","}","}","</style>","!endsub","'!endif"].join(`
+`),Z.cerulean={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.cerulean=['!$THEME = "cerulean"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#033C73"','!$INDIGO = "#6610F2"','!$PURPLE = "#6F42C1"','!$PINK = "#E83E8C"','!$RED = "#C71C22"','!$ORANGE = "#FD7E14"','!$YELLOW = "#DD5600"','!$GREEN = "#73A839"','!$TEAL = "#20C997"','!$CYAN = "#2FA4E7"','!$WHITE = "#FFF"','!$GRAY_DARK = "#343A40"','!$GRAY = "#868E96"','!$PRIMARY = "#2FA4E7"','!$SECONDARY = "#E9ECEF"','!$SUCCESS = "#73A839"','!$INFO = "#033C73"','!$WARNING = "#DD5600"','!$DANGER = "#C71C22"','!$LIGHT = "#F8F9FA"','!$DARK = "#343A40"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#59B6EC"','!$PRIMARY_DARK = "#2683B9"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_LIGHT = "#EDF0F2"','!$SECONDARY_DARK = "#BABDBF"',"!$SECONDARY_TEXT = $DARK",'!$INFO_LIGHT = "#35638F"','!$INFO_DARK = "#02305C"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_LIGHT = "#8FB961"','!$SUCCESS_DARK = "#5C862E"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_LIGHT = "#E47833"','!$WARNING_DARK = "#B14500"',"!$WARNING_TEXT = $WHITE",'!$DANGER_LIGHT = "#D2494E"','!$DANGER_DARK = "#9F161B"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $WHITE-$SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $WHITE-$LIGHT","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $PRIMARY","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","FontColor $PRIMARY","BorderColor $PRIMARY_LIGHT","BackgroundColor $BGCOLOR","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","FontColor $PRIMARY","BorderColor $PRIMARY_LIGHT","BackgroundColor $BGCOLOR","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $INFO","FontColor $GRAY","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z["cerulean-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar["cerulean-outline"]=['!$THEME = "cerulean-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#033C73"','!$INDIGO = "#6610F2"','!$PURPLE = "#6F42C1"','!$PINK = "#E83E8C"','!$RED = "#C71C22"','!$ORANGE = "#FD7E14"','!$YELLOW = "#DD5600"','!$GREEN = "#73A839"','!$TEAL = "#20C997"','!$CYAN = "#2FA4E7"','!$WHITE = "#FFF"','!$GRAY_DARK = "#343A40"','!$GRAY = "#868E96"','!$PRIMARY = "#2FA4E7"','!$SECONDARY = "#E9ECEF"','!$SUCCESS = "#73A839"','!$INFO = "#033C73"','!$WARNING = "#DD5600"','!$DANGER = "#C71C22"','!$LIGHT = "#F8F9FA"','!$DARK = "#343A40"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#59B6EC"','!$PRIMARY_DARK = "#2683B9"',"!$PRIMARY_TEXT = $PRIMARY",'!$SECONDARY_LIGHT = "#EDF0F2"','!$SECONDARY_DARK = "#BABDBF"',"!$SECONDARY_TEXT = $SECONDARY_DARK",'!$INFO_LIGHT = "#35638F"',"!$INFO_TEXT = $INFO",'!$SUCCESS_LIGHT = "#8FB961"',"!$SUCCESS_TEXT = $SUCCESS",'!$WARNING_LIGHT = "#E47833"',"!$WARNING_TEXT = $WARNING",'!$DANGER_LIGHT = "#D2494E"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $BGCOLOR","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO_TEXT","DividerBackgroundColor $LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO_TEXT","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $BGCOLOR","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $SUCCESS","' FontColor $SUCCESS_TEXT","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $LIGHT","HeaderBackgroundColor $PRIMARY-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub","",'!if (%variable_exists("LEGACY"))','!$LEGACY = "true"',"!endif","",'!if (%getenv("LEGACY") == "true")','!$LEGACY = "true"',"!endif","",'!if (%variable_exists("$LEGACY"))',"","skinparam useBetaStyle true","","!startsub mindmap","","<style>","style mindmapDiagram {","'Padding 8","Margin 8","LineThickness 2.0","FontColor $PRIMARY_TEXT","LineColor $SECONDARY","BackGroundColor $PRIMARY_LIGHT-$PRIMARY","}","wbsDiagram {","'Padding 8","Margin 8","LineThickness 2.0","FontColor $PRIMARY_TEXT","LineColor $PRIMARY","BackGroundColor $PRIMARY_LIGHT-$PRIMARY","}","</style>","!endsub","!endif"].join(`
+`),Z["cloudscape-design"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar["cloudscape-design"]=[`'!$PUML_OUTLINE = "true"`,`'!$PUML_BGCOLOR = "#0f1b2a"`,`'!$PUML_MODE = "dark"`,'!$PUML_THEME = "cloudscape-design"','!$THEME = "cloudscape-design"','!if %not(%variable_exists("$PUML_BGCOLOR"))','!$PUML_BGCOLOR = "transparent"',"!endif",'!if %not(%variable_exists("$PUML_GRADIENT"))',"!$PUML_GRADIENT = 20","!endif",'!if %not(%variable_exists("$PUML_MODE"))','!$PUML_MODE = "light"',"!endif",'!if %not(%variable_exists("$PUML_OUTLINE"))','!$PUML_OUTLINE = "false"',"!endif","skinparam BackgroundColor $PUML_BGCOLOR","skinparam useBetaStyle false",'!$ALPHA = "80"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#868e96"','!$PRIMARY = "#0972d3"','!$WARNING = "#ecdd00"','!$LIGHT = "#d1d5db"','!$DARK = "#000716"','!$SECONDARY_TEXT = "#539fe5"','!if ($PUML_MODE == "light")',"!$PRIMARY_TEXT = $LIGHT",'!$SECONDARY = "#eeeeee"',"!$SECONDARY_LIGHT = %lighten($SECONDARY, $PUML_GRADIENT)",'!$SUCCESS = "#037f0c"','!$INFO = "#0972d3"','!$DANGER = "#d91515"',"!$SECONDARY_TEXT = $DARK","!$FGCOLOR = $DARK","!$DIAMOND_BD = %darken($SECONDARY, $PUML_GRADIENT)","!$GRAY_LIGHT = %lighten($GRAY, $PUML_GRADIENT)","!$GRAY_DARK = %darken($GRAY, $PUML_GRADIENT)","!$MAIN_BG = $WHITE","!assume transparent light","!else","!$TMP = $LIGHT","!$LIGHT = $DARK","!$DARK = $TMP",'!$PRIMARY = "#539fe5"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY = "#2a2e33"',"!$SECONDARY_LIGHT = %lighten($SECONDARY, $PUML_GRADIENT)",'!$SUCCESS = "#037f0c"','!$INFO = "#0972d3"','!$DANGER = "#ff5d64"','!$WARNING = "#fbf8cc"',"!$SECONDARY_TEXT = $WHITE","!$FGCOLOR = $WHITE","!$DIAMOND_BD = %lighten($SECONDARY, $PUML_GRADIENT)","!$GRAY_LIGHT = %darken($GRAY, $PUML_GRADIENT)","!$GRAY_DARK = %lighten($GRAY, $PUML_GRADIENT)",'!$MAIN_BG = "#0f1b2a"',"!assume transparent dark","!endif","!$PRIMARY_DARK = %darken($PRIMARY, $PUML_GRADIENT)","!$PRIMARY_LIGHT = %lighten($PRIMARY, $PUML_GRADIENT)","!$SECONDARY_DARK = %darken($SECONDARY, $PUML_GRADIENT)","!$SUCCESS_DARK = %darken($SUCCESS, $PUML_GRADIENT)","!$SUCCESS_LIGHT = %lighten($SUCCESS, $PUML_GRADIENT)","!$INFO_DARK = %darken($INFO, $PUML_GRADIENT)","!$INFO_LIGHT = %lighten($INFO, $PUML_GRADIENT)","!$DANGER_DARK = %darken($DANGER, $PUML_GRADIENT)","!$DANGER_LIGHT = %lighten($DANGER, $PUML_GRADIENT)","!$WARNING_DARK = %darken($WARNING, $PUML_GRADIENT)","!$WARNING_LIGHT = %lighten($WARNING, $PUML_GRADIENT)","!$DARK_DARK = %darken($DARK, $PUML_GRADIENT)","!$DARK_LIGHT = %lighten($DARK, $PUML_GRADIENT)","!$LIGHT_DARK = %darken($LIGHT, $PUML_GRADIENT)","!$LIGHT_LIGHT = %lighten($LIGHT, $PUML_GRADIENT)","!$INFO_TEXT = $WHITE","!$SUCCESS_TEXT = $WHITE","!$WARNING_TEXT = $WHITE","!$DANGER_TEXT = $WHITE","!$HEADER_TEXT = $WHITE",'!if ($PUML_OUTLINE == "true")',"!$HEADER_TEXT = $PRIMARY_TEXT","!$PRIMARY_TEXT = $PRIMARY_LIGHT","!$INFO_TEXT = $INFO","!$WARNING_TEXT = $WARNING_LIGHT","!$DARK_BG = $PUML_BGCOLOR","!$INFO_BG = $PUML_BGCOLOR","!$DANGER_BG = $PUML_BGCOLOR","!$WARNING_BG = $PUML_BGCOLOR","!$SECONDARY_BG = $PUML_BGCOLOR","!else","!$DARK_BG = $DARK","!$INFO_BG = $INFO","!$DANGER_BG = $DANGER","!$WARNING_BG = $WARNING","!$SECONDARY_BG = $SECONDARY","!endif","!unquoted function $alpha($color, $alpha) !return $color + $alpha","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","!procedure $primary_scheme()",'!if ($PUML_OUTLINE == "true")',"FontColor $PRIMARY","BorderColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","!else","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endif","!endprocedure","!procedure $secondary_scheme()",'!if ($PUML_OUTLINE == "true")',"FontColor $SECONDARY_DARK","BorderColor $SECONDARY_DARK","BackgroundColor $PUML_BGCOLOR","!else","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_DARK","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","!endif","!endprocedure",'!_POST = "<color #007a3e>POST</color>"','!_PUT = "<color #ea7400>PUT</color>"','!_DELETE = "<color #cf2a2a>DELETE</color>"','!_GET = "<color #009fdb>GET</color>"','!_PATCH = "<color #b5bd00>PATCH</color>"','!_HEAD = "<color #9012fe>HEAD</color>"','skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","","skinparam legend {","$secondary_scheme()","BackgroundColor transparent","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_BG","DiamondBorderColor $DIAMOND_BD","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","skinparam actor {","$primary_scheme()","FontColor $FGCOLOR","}","!endsub","","!startsub arrow","skinparam arrow {","Thickness 2","Color $GRAY_LIGHT","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","skinparam sequence {","ArrowThickness 2","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $alpha($PUML_BGCOLOR, $ALPHA)","BoxBorderColor $GRAY_DARK","BoxFontColor $GRAY_DARK","DelayFontColor $LIGHT","LifeLineBorderColor $PRIMARY","LifeLineBorderThickness 0","LifeLineBackgroundColor $SECONDARY","GroupBorderColor $DARK","GroupBorderThickness 1","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $alpha($SECONDARY, $ALPHA)","GroupBodyBackgroundColor $alpha($PUML_BGCOLOR, $ALPHA)","GroupHeaderBackgroundColor $PUML_BGCOLOR","DividerBackgroundColor $SECONDARY","DividerBorderColor $SECONDARY_LIGHT","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceAlignment left","ReferenceBackgroundColor $alpha($PUML_BGCOLOR, $ALPHA)","ReferenceBorderColor $SECONDARY","ReferenceBorderThickness 2","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $alpha($SECONDARY, $ALPHA)","StereotypeFontColor $PRIMARY_TEXT","StereotypeFontSize 12","}","!endsub","","!startsub partition","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $PUML_BGCOLOR","}","!endsub","","!startsub collections","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $GRAY","}","!endsub","","!startsub note","skinparam note {","BorderThickness 1","BackgroundColor $INFO_BG","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub artifact","skinparam artifact {","BackgroundColor $DARK_BG","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","skinparam storage {","BackgroundColor $WARNING_BG","BorderColor $WARNING_DARK","FontColor $GRAY","}","!endsub","","!startsub node","skinparam node {","BackgroundColor $PUML_BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","skinparam cloud {","BackgroundColor transparent","BorderColor $DARK","FontColor $FGCOLOR","}","!endsub","","!startsub database","skinparam database {","$primary_scheme()","FontColor $FGCOLOR","StereotypeFontColor $FGCOLOR","}","!endsub","","!startsub class","skinparam class {","$primary_scheme()","FontColor $HEADER_TEXT","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub object","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","skinparam rectangle {","BackgroundColor $PUML_BGCOLOR","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY_TEXT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","skinparam package {","BackgroundColor $PUML_BGCOLOR","BorderColor $SECONDARY_TEXT","FontColor $SECONDARY_TEXT","BorderThickness 2","}","!endsub","","!startsub folder","skinparam folder {","BackgroundColor $SECONDARY_BG","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","skinparam frame {","BackgroundColor $SECONDARY_BG","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","skinparam card {","BackgroundColor $INFO_BG","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","skinparam file {","BackgroundColor $SECONDARY_BG","BorderColor $LIGHT","FontColor $FGCOLOR","}","!endsub","","!startsub stack","skinparam stack {","$primary_scheme()","}","!endsub","","!startsub map","skinparam map {","$primary_scheme()","}","!endsub","","<style>","participant {","Margin 5 40","Padding 15 20","}","wbsDiagram, mindmapDiagram {","root {","BackgroundColor $PUML_BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $INFO_BG","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","$primary_scheme()","Padding 15","RoundCorner 20","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY_BG","FontColor $INFO_BG","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $PUML_BGCOLOR","FontColor $DARK_BG","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $PUML_BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_BG","FontColor $PRIMARY_TEXT","BorderColor $SECONDARY_BG","}","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY_BG","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT_BG","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY_BG","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO_BG","}","separator {","LineColor $SECONDARY_BG","BackGroundColor $secondary_scheme()","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO_BG","FontSize 16","FontStyle italic","BackGroundColor $DIAMOND_BG","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY_BG","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>"].join(`
+`),Z["crt-amber"]={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},Ar["crt-amber"]=['!$THEME = "crt-amber"',"",'!$DARK_AMBER = "#FFB000"','!$LIGHT_AMBER = "#FFCC00"',"",'!$BGCOLOR = "#282828"',"!$FGCOLOR = $DARK_AMBER","","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $LIGHT_AMBER","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","box {","LineStyle 12-18","LineThickness 3","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","groupHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","node {","MaximumWidth 300","}","referenceHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy solid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $BGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $LIGHT_AMBER","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
+`),Z["crt-green"]={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},Ar["crt-green"]=['!$THEME = "crt-green"',"",'!$BGCOLOR = "#282828"','!$FGCOLOR = "#33FF33"',"","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $FGCOLOR","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","box {","LineStyle 12-18","LineThickness 3","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","groupHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","node {","MaximumWidth 300","}","referenceHeader {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy solid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $BGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $FGCOLOR","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $FGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
+`),Z.cyborg={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.cyborg=['!$THEME = "cyborg"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#2A9FD6"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#CC0000"','!$ORANGE = "#fd7e14"','!$YELLOW = "#FF8800"','!$GREEN = "#77B300"','!$TEAL = "#20c997"','!$CYAN = "#9933CC"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#555"','!$PRIMARY = "#2A9FD6"','!$SECONDARY = "#555"','!$SUCCESS = "#77B300"','!$INFO = "#9933CC"','!$WARNING = "#FF8800"','!$DANGER = "#CC0000"','!$LIGHT = "#222"','!$DARK = "#ADAFAE"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#55B2DE"','!$PRIMARY_LIGHT = "#227FAB"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#777777"','!$SECONDARY_LIGHT = "#444444"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#AD5CD6"','!$INFO_LIGHT = "#9F161B"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#92C233"','!$SUCCESS_LIGHT = "#5F8F00"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#FFA033"','!$WARNING_LIGHT = "#CC6D00"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#D63333"','!$DANGER_LIGHT = "#A30000"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#BDBFBE"','!$DARK_LIGHT = "#8A8C8B"','!$LIGHT_DARK = "#4E4E4E"','!$LIGHT_LIGHT = "#1B1B1B"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $SECONDARY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $SECONDARY","ReferenceFontColor $SECONDARY_TEXT","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $LIGHT-black","BorderColor $LIGHT","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub actor","","skinparam actor {","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z["cyborg-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar["cyborg-outline"]=['!$THEME = "cyborg-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#2A9FD6"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#CC0000"','!$ORANGE = "#fd7e14"','!$YELLOW = "#FF8800"','!$GREEN = "#77B300"','!$TEAL = "#20c997"','!$CYAN = "#9933CC"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#555"','!$PRIMARY = "#2A9FD6"','!$SECONDARY = "#555"','!$SUCCESS = "#77B300"','!$INFO = "#9933CC"','!$WARNING = "#FF8800"','!$DANGER = "#CC0000"','!$LIGHT = "#222"','!$DARK = "#ADAFAE"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#55B2DE"','!$PRIMARY_LIGHT = "#227FAB"',"!$PRIMARY_TEXT = $PRIMARY",'!$SECONDARY_DARK = "#777777"','!$SECONDARY_LIGHT = "#444444"',"!$SECONDARY_TEXT = $SECONDARY_DARK",'!$INFO_DARK = "#AD5CD6"','!$INFO_LIGHT = "#7a29a3"',"!$INFO_TEXT = $INFO",'!$SUCCESS_DARK = "#92C233"','!$SUCCESS_LIGHT = "#5F8F00"',"!$SUCCESS_TEXT = $SUCCESS",'!$WARNING_DARK = "#FFA033"','!$WARNING_LIGHT = "#cc6d00"',"!$WARNING_TEXT = $WARNING",'!$DANGER_DARK = "#D63333"','!$DANGER_LIGHT = "#a30000"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#BDBFBE"','!$DARK_LIGHT = "#8A8C8B"','!$LIGHT_DARK = "#4E4E4E"','!$LIGHT_LIGHT = "#1B1B1B"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $BGCOLOR","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO_TEXT","GroupBackgroundColor $BGCOLOR","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $BGCOLOR","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO_TEXT","ReferenceHeaderBackgroundColor $BGCOLOR","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $BGCOLOR","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $BGCOLOR","BorderColor $INFO_DARK","FontColor $INFO_DARK","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $DARK_DARK","FontColor $DARK_DARK","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $BGCOLOR","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $LIGHT","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.hacker={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.hacker=['!$THEME = "hacker"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam BackgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$PRIMARY = "#b5e853"','!$PRIMARY_LIGHT = "#d3f198"','!$PRIMARY_DARK = "#6d8b32"','!$PRIMARY_TEXT = "#151515"','!$SECONDARY = "#6a9fb5"','!$SECONDARY_LIGHT = "#88b2c4"','!$SECONDARY_DARK = "#557f91"','!$SECONDARY_TEXT = "#fefefe"','!$SUCCESS = "#90a959"','!$SUCCESS_LIGHT = "#a6ba7a"','!$INFO = "#aa759f"','!$INFO_LIGHT = "#bb91b2"','!$INFO_DARK = "#885E7F"','!$WARNING = "#f4bf75"','!$WARNING_LIGHT = "#f6cc91"','!$WARNING_TEXT = "#151515"','!$DANGER = "#ac4142"','!$DANGER_LIGHT = "#bd6768"','!$LIGHT = "#151515"','!$DARK = "#eaeaea"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_LIGHT","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endprocedure","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 40","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $PRIMARY","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $LIGHT-black","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY","DiamondBorderColor $SECONDARY_LIGHT","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","BorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBackgroundColor $LIGHT","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderBackgroundColor $LIGHT","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $LIGHT-black","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor white","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT-$DANGER","BorderColor $DANGER_LIGHT","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING_LIGHT","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $LIGHT-black","BorderColor $PRIMARY_LIGHT","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $BGCOLOR","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","BackgroundColor $LIGHT-black","BorderColor $PRIMARY_LIGHT","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","BorderThickness 2","FontColor $PRIMARY_DARK","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $LIGHT","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $LIGHT-black","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $LIGHT-black","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO_LIGHT","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY_LIGHT","FontColor $DARK","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub","","<style>","mindmapDiagram, wbsDiagram {","element {","$primary_scheme()","}",":depth(0) {","fontSize 16","fontStyle bold","fontColor $SECONDARY","}",":depth(1) {","fontSize 14","padding 5","fontStyle bold","}",":depth(2) {","fontSize 12","padding 4","}",":depth(3) {","fontSize 11","padding 3","fontColor $INFO","}","","}","</style>"].join(`
+`),Z.lightgray={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.lightgray=['!$THEME = "lightgray"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$WHITE = "#FFF"','!$GRAY_DARK = "#4d4d4d"','!$GRAY = "#737373"','!$LIGHT = "#fcfcfc"','!$DARK = "#303030"',"","!$FGCOLOR = $DARK",'!$PRIMARY = "#e2e2e2"','!$PRIMARY_LIGHT = "#f3f3f3"','!$PRIMARY_DARK = "#888888"','!$PRIMARY_TEXT = "#336699"','!$SECONDARY = "#d2d2d2"','!$SECONDARY_LIGHT = "#dbdbdb"','!$SECONDARY_DARK = "#a8a8a8"','!$SECONDARY_TEXT = "white"','!$INFO = "#336699"','!$INFO_LIGHT = "#5c85ad"','!$INFO_DARK = "#29527a"',"!$INFO_TEXT = $WHITE",'!$SUCCESS = "#339933"','!$SUCCESS_LIGHT = "#5cad5c"','!$SUCCESS_DARK = "#297a29"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING = "#ffae42"','!$WARNING_LIGHT = "#ffbe68"','!$WARNING_DARK = "#cc8b35"',"!$WARNING_TEXT = $WHITE",'!$DANGER = "#ff3333"','!$DANGER_LIGHT = "#ff5c5c"','!$DANGER_DARK = "#cc2929"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_LIGHT","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 30","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 15","skinparam BoxPadding 30","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $SECONDARY_TEXT","BorderColor $SECONDARY","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $PRIMARY","BorderColor $PRIMARY_DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $SECONDARY_TEXT","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor white-$LIGHT","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_DARK","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY_LIGHT","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor $F2FCFE","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","BackgroundColor $BGCOLOR","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","StereotypeFontColor $DARK","StereotypeFontSize 9","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $BGCOLOR","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BackgroundColor $BGCOLOR","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $PRIMARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $PRIMARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.mars={author:"future-architect",license:"Apache-2.0",source:"https://github.com/future-architect/puml-themes/tree/master/themes"},Ar.mars=["skinparam BackgroundColor F9F9F9","skinparam shadowing false","skinparam RoundCorner 7","skinparam ArrowColor 191919","skinparam FontColor 191919","skinparam SequenceLifeLineBorderColor 393939","skinparam SequenceGroupHeaderFontColor 191919","skinparam SequenceGroupFontColor 393939","skinparam SequenceGroupBorderColor 393939","skinparam SequenceGroupBorderThickness 1","","skinparam sequenceDivider {","BorderColor 191919","BorderThickness 1","FontColor 191919","}","","skinparam participant {","BackgroundColor E55756","BorderColor 191919","FontColor F9F9F9","BorderThickness 1.5","}","","skinparam database {","BackgroundColor A4DBD8","BorderColor 191919","FontColor 191919","}","","skinparam entity {","BackgroundColor EFBABC","BorderColor 191919","FontColor 191919","}","","skinparam note {","BackgroundColor e5e5e5","BorderColor 191919","FontColor 191919","BorderThickness 1.5","}","","skinparam actor {","BackgroundColor 191919","BorderColor 191919","FontColor 191919","}","","skinparam boundary {","BackgroundColor EFBABC","BorderColor 191919","FontColor 191919","}","","skinparam control {","BackgroundColor EFBABC","BorderColor 191919","FontColor 191919","}","","skinparam collections {","BackgroundColor E55756","BorderColor 191919","FontColor 191919","BorderThickness 1.5","}","","skinparam queue {","BackgroundColor E55756","BorderColor 191919","FontColor FFF","BorderThickness 1.5","}"].join(`
+`),Z.materia={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.materia=['!$THEME = "materia"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#2196F3"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#e51c23"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ff9800"','!$GREEN = "#4CAF50"','!$TEAL = "#20c997"','!$CYAN = "#9C27B0"','!$WHITE = "#FFF"','!$GRAY_DARK = "#222"','!$GRAY = "#666"','!$PRIMARY = "#2196F3"','!$SECONDARY = "#fff"','!$SUCCESS = "#4CAF50"','!$INFO = "#9C27B0"','!$WARNING = "#ff9800"','!$DANGER = "#e51c23"','!$LIGHT = "#fff"','!$DARK = "#222"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#4dabf5"','!$PRIMARY_DARK = "#1a78c2"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_LIGHT = "#fff"','!$SECONDARY_DARK = "#cccccc"',"!$SECONDARY_TEXT = $DARK",'!$INFO_LIGHT = "#b052c0"','!$INFO_DARK = "#7D1F8D"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_LIGHT = "#70bf73"','!$SUCCESS_DARK = "#3D8C40"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_LIGHT = "#ffad33"','!$WARNING_DARK = "#CC7A00"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#b7161c"','!$DANGER_LIGHT = "#B7161C"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing true","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $WHITE-$SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor transparent","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor transparent","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $WHITE-$LIGHT","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","FontColor $PRIMARY","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $WHITE-$SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BorderColor $PRIMARY_DARK","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $GRAY","FontColor $GRAY","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z["materia-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar["materia-outline"]=['!$THEME = "materia-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#2196F3"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#e51c23"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ff9800"','!$GREEN = "#4CAF50"','!$TEAL = "#20c997"','!$CYAN = "#9C27B0"','!$WHITE = "#FFF"','!$GRAY_DARK = "#222"','!$GRAY = "#666"','!$PRIMARY = "#2196F3"','!$SECONDARY = "#fff"','!$SUCCESS = "#4CAF50"','!$INFO = "#9C27B0"','!$WARNING = "#ff9800"','!$DANGER = "#e51c23"','!$LIGHT = "#fff"','!$DARK = "#222"',"","!$FGCOLOR = $DARK",'!$PRIMARY_LIGHT = "#4dabf5"','!$PRIMARY_DARK = "#1a78c2"',"!$PRIMARY_TEXT = $PRIMARY",'!$SECONDARY_LIGHT = "#fff"','!$SECONDARY_DARK = "#cccccc"',"!$SECONDARY_TEXT = $SECONDARY_DARK",'!$INFO_LIGHT = "#b052c0"','!$INFO_DARK = "#7D1F8D"',"!$INFO_TEXT = $INFO",'!$SUCCESS_LIGHT = "#70bf73"','!$SUCCESS_DARK = "#3D8C40"',"!$SUCCESS_TEXT = $SUCCESS",'!$WARNING_LIGHT = "#ffad33"','!$WARNING_DARK = "#CC7A00"',"!$WARNING_TEXT = $WARNING",'!$DANGER_LIGHT = "#B7161C"',"!$DANGER_TEXT = $DANGER","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing true","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam TitleFontColor $DARK","skinparam TitleFontSize 20","skinparam TitleBorderThickness 0","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $DARK","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","' FontColor $PRIMARY_TEXT","' BorderColor $PRIMARY","' BackgroundColor $BGCOLOR","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","' FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $BGCOLOR","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $BGCOLOR","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","' FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","' FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","' FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $BGCOLOR","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $SUCCESS","' FontColor $SUCCESS_TEXT","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $DARK","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","' FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $LIGHT","HeaderBackgroundColor $PRIMARY-$PRIMARY_DARK","' FontColor $PRIMARY_TEXT","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","' FontColor $SUCCESS","' BackgroundColor $BGCOLOR","' BorderColor $SECONDARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $SECONDARY_DARK","BorderThickness 2","' FontColor $SECONDARY_TEXT","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY_DARK","BorderThickness 2","' FontColor $PRIMARY","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","' BackgroundColor $BGCOLOR","' BorderColor $SECONDARY_DARK","' FontColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $WARNING_DARK","' FontColor $WARNING_TEXT","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $GRAY","FontColor $GRAY","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","' BackgroundColor $BGCOLOR","' BorderColor $PRIMARY","' FontColor $PRIMARY_TEXT","}","!endsub"].join(`
+`),Z.metal={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.metal=['!$THEME = "metal"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$WHITE = "#fdfdfd"','!$GRAY_DARK = "#4d4d4d"','!$GRAY = "#737373"','!$LIGHT = "#f2f2f2"','!$DARK = "#4d4d4d"',"",'!$SILVER = "#c0c0c0"','!$COPPER = "#B87333c"','!$STEELBLUE = "#4682b4"','!$LIGHTSTEELBLUE = "#B0C4DE" ','!$LIGHTSTEELBLUE_DARK = "#8d9db2" ','!$LIGHTSTEELBLUE_LIGHT = "#c0d0e5" ','!$ALUMINUM = "#c9ced0"','!$ALUMINUM_DARK = "#a1a5a6"','!$ALUMINUM_LIGHT = "#d4d8d9"','!$BRONZE = "#CD7F32" ','!$BRONZE_DARK = "#a46628" ','!$BRONZE_LIGHT = "#d7995b" ','!$GOLD = "#FFD700"','!$PLATINUM = "#E5E4E2"','!$RUST = "#B7410E"',"","!$FGCOLOR = $DARK","!$PRIMARY = $PLATINUM",'!$PRIMARY_LIGHT = "#eae9e8"','!$PRIMARY_DARK = "#b7b6b5"',"!$PRIMARY_TEXT = $STEELBLUE","!$SECONDARY = $SILVER",'!$SECONDARY_LIGHT = "#cdcdcd"','!$SECONDARY_DARK = "#9a9a9a"',"!$SECONDARY_TEXT = $WHITE","!$INFO = $STEELBLUE",'!$INFO_LIGHT = "#5c85ad"','!$INFO_DARK = "#29527a"',"!$INFO_TEXT = $WHITE",'!$SUCCESS = "#339933"','!$SUCCESS_LIGHT = "#5cad5c"','!$SUCCESS_DARK = "#297a29"',"!$SUCCESS_TEXT = $WHITE","!$WARNING = $GOLD",'!$WARNING_LIGHT = "#ffdf33"','!$WARNING_DARK = "#ccac00"',"!$WARNING_TEXT = $WHITE","!$DANGER = $RUST",'!$DANGER_LIGHT = "#c5673e"','!$DANGER_DARK = "#92340b"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY-$PRIMARY_DARK","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 30","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 15","skinparam BoxPadding 30","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $WHITE","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","}","","skinparam legend {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderColor $SECONDARY_DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $BRONZE","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $WHITE","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 3","LifeLineBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $LIGHTSTEELBLUE_LIGHT-$LIGHTSTEELBLUE_DARK","BorderColor $LIGHTSTEELBLUE_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING_DARK","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderColor $PRIMARY","FontColor $DARK","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $WHITE","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $WHITE-$LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderColor $RUST","FontColor $RUST","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $GRAY","FontColor $LIGHT","","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.mimeograph={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},Ar.mimeograph=['!$THEME = "mimeograph"',"",'!$BGCOLOR = "#D9D3D0"','!$FGCOLOR = "#9275B6"',"","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $FGCOLOR","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","node {","MaximumWidth 300","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy nosolid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $FGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $FGCOLOR","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
+`),Z.minty={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.minty=['!$THEME = "minty"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#007bff"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#ff7851"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ffce67"','!$GREEN = "#56cc9d"','!$TEAL = "#20c997"','!$CYAN = "#6cc3d5"','!$WHITE = "#fff"','!$GRAY = "#888"','!$GRAYDARK = "#343a40"','!$PRIMARY = "#78c2ad"','!$SECONDARY = "#f3969a"','!$SUCCESS = "#56cc9d"','!$INFO = "#6cc3d5"','!$WARNING = "#ffce67"','!$DANGER = "#ff7851"','!$LIGHT = "#f8f9fa"','!$DARK = "#343a40"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#6caf9c"','!$PRIMARY_LIGHT = "#86c8b5"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#db878b"','!$SECONDARY_LIGHT = "#f4a1a4"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#61b0c0"','!$INFO_LIGHT = "#7bc9d9"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#4db88d"','!$SUCCESS_LIGHT = "#67d1a7"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#e6b95d"','!$WARNING_LIGHT = "#ffd376"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#e66c49"','!$DANGER_LIGHT = "#ff8662"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#2f343a"','!$DARK_LIGHT = "#484e53"','!$LIGHT_DARK = "#dfe0e1"','!$LIGHT_LIGHT = "#f9fafb"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY_DARK","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.mono={author:"Denis Bondarenko feat Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},Ar.mono=['!$THEME = "mono"',"","' Theme colors","",'!if %not(%variable_exists("$CLR_BG"))','!$CLR_BG = "white"',"!endif","","' For icons bg in legend. usage: <THM_BG>","!ifndef THM_BG","!define THM_BG #$CLR_BG","!endif","","' Highlighted background",'!if %not(%variable_exists("$CLR_BG_EMPH"))','!$CLR_BG_EMPH = "#eee"',"!endif","","' Main foreground color",'!if %not(%variable_exists("$CLR_FG"))','!$CLR_FG = "black"',"!endif","","' Less hued, 3 levels","",'!if %not(%variable_exists("$CLR_FG_DIMMED"))','!$CLR_FG_DIMMED = "#666"',"!endif","",'!if %not(%variable_exists("$CLR_FG_DIMMED_2"))','!$CLR_FG_DIMMED_2 = "#999"',"!endif","",'!if %not(%variable_exists("$CLR_FG_DIMMED_3"))','!$CLR_FG_DIMMED_3 = "#ccc"',"!endif","","' Hyperlinks color",'!if %not(%variable_exists("$CLR_HYPERLINK"))','!$CLR_HYPERLINK = "#333"',"!endif","","' Theme fonts","","' Basic font","!ifndef $FNT","","' Multiple fallback fonts defined",'!$FNT_MONO = "Courier"','!$FNT_MONO = "Courier New"','!$FNT = "DejaVu Sans Mono"','!$FNT = "monospace"','!$FNT = "Rec Mono Linear"',"","' The preferred theme font",'!$FNT = "Hack"',"","!endif","","' Monospaced font","!ifndef $FNT_MONO","","' A different font can be used",`' !$FNT_MONO = "Rec Mono Semicasual"`,"!$FNT_MONO = $FNT","!endif","","' Theme body","","<style>","root {","BackgroundColor $CLR_BG","FontColor $CLR_FG","FontName $FNT","HyperLinkColor $CLR_HYPERLINK","LineColor $CLR_FG","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","node {","' MaximumWidth 300","}","ganttDiagram {","closed {","BackGroundColor $CLR_BG_EMPH","}","task {","BackGroundColor $CLR_FG_DIMMED_2","LineColor $CLR_FG","unstarted {","BackGroundColor $CLR_FG_DIMMED_3","LineColor $CLR_FG","}","}","note {","LineThickness .5","}","timeline {","LineThickness .5","LineColor $CLR_FG_DIMMED_3","}","separator {","}","}","</style>","","' skinparam is flattened to support YAML, JSON diagram types","skinparam {","","shadowing false","useBetaStyle true","arrowLollipopColor $CLR_FG","backgroundColor $CLR_BG","lifelineStrategy nosolid","","defaultFontName $FNT","defaultMonospacedFontName $FNT_MONO","","hyperlinkColor $CLR_HYPERLINK","","headerFontColor $CLR_FG_DIMMED_2","headerFontName $FNT","","footerFontColor $CLR_FG_DIMMED_2","footerFontName $FNT","","legendBorderThickness 0","legendBorderColor transparent","","noteFontColor $CLR_FG","noteFontName $FNT","","packageBorderColor $CLR_FG","packageFontColor $CLR_FG","packageFontName $FNT","","nodeStereotypeFontColor $CLR_FG_DIMMED","nodeStereotypeFontName $FNT","nodeStereotypeFontSize 10","","componentStereotypeFontColor $CLR_FG_DIMMED","componentStereotypeFontName $FNT","componentStereotypeFontSize 10","","participantPadding 10","","actorStereotypeFontColor $CLR_FG_DIMMED","actorStereotypeFontName $FNT","actorStereotypeFontSize 10","","useCaseStereoTypeFontColor $CLR_FG","useCaseStereoTypeFontName $FNT","","classBackgroundColor $CLR_BG","classBorderColor $CLR_FG","classFontColor $CLR_FG","classFontName $FNT","classAttributeFontColor $CLR_FG","classAttributeFontName $FNT","classStereotypeFontColor $CLR_FG_DIMMED","classStereotypeFontName $FNT","classStereotypeFontSize 10","","objectBorderColor $CLR_FG","","activityBackgroundColor $CLR_BG","activityBarColor $CLR_FG","activityBorderColor $CLR_FG","activityFontColor $CLR_FG","activityFontName $FNT","","sequenceLifeLineBorderColor $CLR_FG","","stateBackgroundColor $CLR_BG","stateBorderColor $CLR_FG","","boundaryFontColor $CLR_FG","","boxPadding 5","","circledCharacterFontColor $CLR_FG","circledCharacterFontName $FNT_MONO","circledCharacterFontSize 10","circledCharacterRadius 8","","stereotypeFontColor $CLR_FG_DIMMED","stereotypeFontName $FNT","stereotypeFontSize 10","stereotypeABackgroundColor $CLR_BG","stereotypeABorderColor $CLR_FG","stereotypeCBackgroundColor $CLR_BG","stereotypeCBorderColor $CLR_FG","stereotypeEBackgroundColor $CLR_BG","stereotypeEBorderColor $CLR_FG","stereotypeIBackgroundColor $CLR_BG","stereotypeIBorderColor $CLR_FG","stereotypeNBackgroundColor $CLR_BG","stereotypeNBorderColor $CLR_FG","","iconPackageColor $CLR_FG","iconPackageBackgroundColor $CLR_BG","iconPrivateColor $CLR_FG","iconPrivateBackgroundColor $CLR_BG","iconProtectedColor $CLR_FG","iconProtectedBackgroundColor $CLR_BG","iconPublicColor $CLR_FG","iconPublicBackgroundColor $CLR_BG","","}"].join(`
+`),Z.plain={author:"Matthew Leather",license:"PlantUML (Apache-2.0 asl edition)",source:""},Ar.plain=['!$THEME = "plain"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "white"',"!endif","",'!if %not(%variable_exists("$FGCOLOR"))','!$FGCOLOR = "black"',"!endif","",'!if %not(%variable_exists("$HYPERLINK_COLOR"))','!$HYPERLINK_COLOR = "blue"',"!endif","","!ifndef $FONT_NAME",'!$FONT_NAME = "Verdana"',"!endif","","!ifndef $FONT_NAME_MONOSPACED",'!$FONT_NAME_MONOSPACED = "Courier"',"!endif","","<style>","root {","BackgroundColor $BGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","HyperLinkColor $HYPERLINK_COLOR","LineColor $FGCOLOR","LineThickness 1","Margin 5","}","document {","caption {","LineThickness 0","}","footer {","LineThickness 0","}","header {","LineThickness 0","}","title {","FontSize 22","LineThickness 0","}","}","node {","MaximumWidth 300","}","participant {","Margin 5 10","Padding 5 5","}","</style>","","skinparam ArrowLollipopColor $FGCOLOR","skinparam BackgroundColor $BGCOLOR","skinparam DefaultFontName $FONT_NAME","skinparam DefaultMonospacedFontName $FONT_NAME_MONOSPACED","skinparam LifelineStrategy nosolid","skinparam SequenceLifeLineBorderColor $FGCOLOR","skinparam Shadowing false","skinparam UseBetaStyle true","","skinparam Activity {","BackgroundColor $BGCOLOR","BarColor $FGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Boundary {","FontColor $FGCOLOR","}","skinparam Box {","Padding 5","}","skinparam CircledCharacter {","FontColor $FGCOLOR","FontName $FONT_NAME_MONOSPACED","Radius 9","}","skinparam Class {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassAttribute {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam ClassStereotype {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Footer {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Header {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Hyperlink {","Color $HYPERLINK_COLOR","}","skinparam IconPackage {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPrivate {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconProtected {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam IconPublic {","Color $FGCOLOR","BackgroundColor $BGCOLOR","}","skinparam Note {","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam Object {","BorderColor $FGCOLOR","}","skinparam Package {","BorderColor $FGCOLOR","FontColor $FGCOLOR","FontName $FONT_NAME","}","skinparam State {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeA {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeC {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeE {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeI {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam StereotypeN {","BackgroundColor $BGCOLOR","BorderColor $FGCOLOR","}","skinparam UseCaseStereoType {","FontColor $FGCOLOR","FontName $FONT_NAME","}"].join(`
+`),Z["reddress-darkblue"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},Ar["reddress-darkblue"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","","skinparam backgroundColor 777",'!$ACCENT = "1a66c2"','!$ACCENTDARK = "002642"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "fff"','!$SECONDARY = "aaa"','!$ARROWCOLOR = "fff"','!$ARROWFONTCOLOR = "bbb"','!$BORDERCOLOR = "1b1b1b"','!$BOXBG = "2e2e2e"','!$LIGHTBORDERCOLOR = "767676"','!$LIGHTBG = "575757"',"skinparam backgroundColor 777","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
+`),Z["reddress-darkgreen"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},Ar["reddress-darkgreen"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "228811"','!$ACCENTDARK = "113300"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "fff"','!$SECONDARY = "aaa"','!$ARROWCOLOR = "fff"','!$ARROWFONTCOLOR = "bbb"','!$BORDERCOLOR = "1b1b1b"','!$BOXBG = "2e2e2e"','!$LIGHTBORDERCOLOR = "767676"','!$LIGHTBG = "575757"',"skinparam backgroundColor 777","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
+`),Z["reddress-darkorange"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},Ar["reddress-darkorange"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "BB6600"','!$ACCENTDARK = "662200"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "fff"','!$SECONDARY = "aaa"','!$ARROWCOLOR = "fff"','!$ARROWFONTCOLOR = "bbb"','!$BORDERCOLOR = "1b1b1b"','!$BOXBG = "2e2e2e"','!$LIGHTBORDERCOLOR = "767676"','!$LIGHTBG = "575757"',"skinparam backgroundColor 777","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
+`),Z["reddress-darkred"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},Ar["reddress-darkred"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "880000"','!$ACCENTDARK = "330000"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "fff"','!$SECONDARY = "aaa"','!$ARROWCOLOR = "fff"','!$ARROWFONTCOLOR = "bbb"','!$BORDERCOLOR = "1b1b1b"','!$BOXBG = "2e2e2e"','!$LIGHTBORDERCOLOR = "767676"','!$LIGHTBG = "575757"',"skinparam backgroundColor 777","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
+`),Z["reddress-lightblue"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},Ar["reddress-lightblue"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "2a86e2"','!$ACCENTDARK = "1a66c2"',"skinparam stereotypeCBackgroundColor $ACCENTDARK",'!$PRIMARYFONTCOLOR = "000"','!$SECONDARY = "333"','!$ARROWCOLOR = "000"','!$ARROWFONTCOLOR = "333"','!$BORDERCOLOR = "aaa"','!$BOXBG = "ccc"','!$LIGHTBORDERCOLOR = "cccccc"','!$LIGHTBG = "e0e0e0"',"skinparam backgroundColor fff","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
+`),Z["reddress-lightgreen"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},Ar["reddress-lightgreen"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "55BB33"','!$ACCENTDARK = "338822"',"skinparam stereotypeCBackgroundColor $ACCENTDARK",'!$PRIMARYFONTCOLOR = "000"','!$SECONDARY = "333"','!$ARROWCOLOR = "000"','!$ARROWFONTCOLOR = "333"','!$BORDERCOLOR = "aaa"','!$BOXBG = "ccc"','!$LIGHTBORDERCOLOR = "cccccc"','!$LIGHTBG = "e0e0e0"',"skinparam backgroundColor fff","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
+`),Z["reddress-lightorange"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},Ar["reddress-lightorange"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "FF8800"','!$ACCENTDARK = "BB6600"',"skinparam stereotypeCBackgroundColor $ACCENT",'!$PRIMARYFONTCOLOR = "000"','!$SECONDARY = "333"','!$ARROWCOLOR = "000"','!$ARROWFONTCOLOR = "333"','!$BORDERCOLOR = "aaa"','!$BOXBG = "ccc"','!$LIGHTBORDERCOLOR = "cccccc"','!$LIGHTBG = "e0e0e0"',"skinparam backgroundColor fff","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
+`),Z["reddress-lightred"]={author:"Drakemor",license:"MIT",source:"https://github.com/Drakemor/RedDress-PlantUML"},Ar["reddress-lightred"]=['!if (%not(%variable_exists("$FONTNAME")))','!$FONTNAME = "Verdana"',"!endif","",'!if (%not(%variable_exists("$FONTSIZE")))',"!$FONTSIZE = 11","!endif","",'!$ACCENT = "CC0033"','!$ACCENTDARK = "AA0033"',"skinparam stereotypeCBackgroundColor $ACCENTDARK",'!$PRIMARYFONTCOLOR = "000"','!$SECONDARY = "333"','!$ARROWCOLOR = "000"','!$ARROWFONTCOLOR = "333"','!$BORDERCOLOR = "aaa"','!$BOXBG = "ccc"','!$LIGHTBORDERCOLOR = "cccccc"','!$LIGHTBG = "e0e0e0"',"skinparam backgroundColor fff","","!procedure font_style()","fontColor $PRIMARYFONTCOLOR","fontName $FONTNAME","fontSize $FONTSIZE","stereotypeFontColor $SECONDARY","stereotypeFontSize $FONTSIZE","!endprocedure","","!procedure basic_style()","backgroundColor $BOXBG","borderColor $BORDERCOLOR","!endprocedure","","!procedure light_style()","backgroundColor $LIGHTBG","borderColor $LIGHTBORDERCOLOR","!endprocedure","","!procedure accent_style()","backgroundColor $ACCENT","borderColor $ACCENTDARK","!endprocedure","","!procedure arrow_style()","arrowColor $ARROWCOLOR","arrowFontName $FONTNAME","arrowFontColor $ARROWFONTCOLOR","arrowFontSize $FONTSIZE","!endprocedure","","' Class diagrams","","skinparam circledCharacter {","radius 8","fontSize $FONTSIZE","fontName $FONTNAME","}","","skinparam class {","basic_style()","font_style()","arrow_style()","","attributeFontColor $SECONDARY","attributeFontSize $FONTSIZE","attributeIconSize $FONTSIZE","}","","' Sequence diagrams","","skinparam actor {","accent_style()","font_style()","}","","skinparam participant {","basic_style()","font_style()","}","","skinparam collections {","basic_style()","font_style()","}","","skinparam SequenceBox{","light_style()","font_style()","}","","' Component diagrams","","skinparam interface {","accent_style()","font_style()","}","","skinparam component {","basic_style()","font_style()","}","","skinparam node {","basic_style()","font_style()","}","","skinparam database {","basic_style()","font_style()","}","","skinparam queue {","basic_style()","font_style()","}","","' Use Case diagrams","","skinparam usecase {","basic_style()","font_style()","arrow_style()","}","","skinparam activity {","basic_style()","font_style()","arrow_style()","}","","skinparam sequence {","font_style()","arrow_style()","","lifeLineBorderColor $ACCENT","lifeLineBackgroundColor $LIGHTBG","}","","skinparam boundary {","accent_style()","font_style()","}","","skinparam control {","accent_style()","font_style()","}","","skinparam entity {","accent_style()","font_style()","}","","' State diagrams","","skinparam state {","basic_style()","font_style()","arrow_style()","startColor $ACCENT","endColor $ACCENTDARK","}","","' Object diagrams","","skinparam object {","basic_style()","font_style()","arrow_style()","}","","' Common","","skinparam note {","accent_style()","font_style()","}","","skinparam cloud {","basic_style()","font_style()","arrow_style()","}","","skinparam rectangle {","basic_style()","font_style()","}","","skinparam storage {","basic_style()","font_style()","}"].join(`
+`),Z.sandstone={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.sandstone=['!$THEME = "sandstone"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#325d88"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#d9534f"','!$ORANGE = "#f47c3c"','!$YELLOW = "#ffc107"','!$GREEN = "#93c54b"','!$TEAL = "#20c997"','!$CYAN = "#29abe0"','!$WHITE = "#fff"','!$GRAY = "#8e8c84"','!$GRAYDARK = "#3e3f3a"','!$PRIMARY = "#325d88"','!$SECONDARY = "#8e8c84"','!$SUCCESS = "#93c54b"','!$INFO = "#29abe0"','!$WARNING = "#f47c3c"','!$DANGER = "#d9534f"','!$LIGHT = "#f8f5f0"','!$DARK = "#3e3f3a"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#2d547a"','!$PRIMARY_LIGHT = "#476d94"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#807e77"','!$SECONDARY_LIGHT = "#999890"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#259aca"','!$INFO_LIGHT = "#3eb3e3"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#84b144"','!$SUCCESS_LIGHT = "#9ecb5d"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#dc7036"','!$WARNING_LIGHT = "#f58950"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#c34b47"','!$DANGER_LIGHT = "#AE423F"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#383934"','!$DARK_LIGHT = "#51524e"','!$LIGHT_DARK = "#dfddd8"','!$LIGHT_LIGHT = "#f9f6f2"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BackgroundColor $PRIMARY_LIGHT","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.silver={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.silver=['!$THEME = "silver"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$WHITE = "#FFF"','!$GRAY_DARK = "#4d4d4d"','!$GRAY = "#737373"','!$LIGHT = "#ffffff"','!$DARK = "#303030"',"","!$FGCOLOR = $DARK",'!$PRIMARY = "#eeeeee"','!$PRIMARY_LIGHT = "#f1f1f1"','!$PRIMARY_DARK = "#bebebe"','!$PRIMARY_TEXT = "#336699"','!$SECONDARY = "#d6d6d6"','!$SECONDARY_LIGHT = "#dedede"','!$SECONDARY_DARK = "#ababab"',"!$SECONDARY_TEXT = $LIGHT",'!$INFO = "#336699"','!$INFO_LIGHT = "#5c85ad"','!$INFO_DARK = "#29527a"',"!$INFO_TEXT = $WHITE",'!$SUCCESS = "#339933"','!$SUCCESS_LIGHT = "#5cad5c"','!$SUCCESS_DARK = "#297a29"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING = "#ffae42"','!$WARNING_LIGHT = "#ffbe68"','!$WARNING_DARK = "#cc8b35"',"!$WARNING_TEXT = $WHITE",'!$DANGER = "#ff3333"','!$DANGER_LIGHT = "#ff5c5c"','!$DANGER_DARK = "#cc2929"',"!$DANGER_TEXT = $WHITE","","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_LIGHT","BackgroundColor $PRIMARY-$PRIMARY_DARK","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 30","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 15","skinparam BoxPadding 30","skinparam ArrowColor $GRAY","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $DARK","}","","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $LIGHT","BoxBorderColor $GRAY","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY_DARK","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_LIGHT","GroupBorderColor $GRAY","GroupFontColor $DARK","GroupHeaderFontColor $INFO","DividerBackgroundColor $WHITE-$LIGHT","DividerBorderColor $GRAY","DividerBorderThickness 2","DividerFontColor $DARK","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $GRAY","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","StereotypeFontColor $PRIMARY_TEXT","}","","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","}","","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor #orange","BorderColor #999999","FontColor #333333","}","","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $WHITE","}","","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_LIGHT","BorderColor $DANGER","FontColor $DARK","}","","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING_LIGHT-$WARNING","BorderColor $WARNING","FontColor $WARNING_TEXT","}","","!endsub","","!startsub node","","skinparam node {","BackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","BorderColor $PRIMARY_LIGHT","FontColor $PRIMARY_TEXT","}","","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $DARK","}","","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 9","}","","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $PRIMARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","","!endsub","","!startsub package","","skinparam package {","$primary_scheme()","BorderThickness 2","}","","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $PRIMARY-$PRIMARY_DARK","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $PRIMARY-$PRIMARY_DARK","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO","BorderColor $INFO","FontColor $INFO_TEXT","}","","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","","}","","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","","!endsub"].join(`
+`),Z.sketchy={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.sketchy=['!$THEME = "sketchy"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","!option handwritten true","skinparam shadowing false","",'!$BLUE = "#007bff"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#dc3545"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ffc107"','!$GREEN = "#28a745"','!$TEAL = "#20c997"','!$CYAN = "#17a2b8"','!$WHITE = "#ffffff"','!$GRAY = "#868e96"','!$GRAYDARK = "#333333"','!$PRIMARY = "#333333"','!$SECONDARY = "#555555"','!$SUCCESS = "#28a745"','!$INFO = "#17a2b8"','!$WARNING = "#ffc107"','!$DANGER = "#dc3545"','!$LIGHT = "#ffffff"','!$DARK = "#555555"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#2e2e2e"','!$PRIMARY_LIGHT = "#474747"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#4d4d4d"','!$SECONDARY_LIGHT = "#666666"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#1592a6"','!$INFO_LIGHT = "#2eabbf"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#24963e"','!$SUCCESS_LIGHT = "#3eb058"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#e6ae06"','!$WARNING_LIGHT = "#ffc720"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#c6303e"','!$DANGER_LIGHT = "#e04958"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#4d4d4d"','!$DARK_LIGHT = "#666666"','!$LIGHT_DARK = "#e6e6e6"','!$LIGHT_LIGHT = "#ffffff"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $PRIMARY_LIGHT","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Segoe Print"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $FGCOLOR","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $FGCOLOR","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $FGCOLOR","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z["sketchy-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar["sketchy-outline"]=['!$THEME = "sketchy-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","!option handwritten true","skinparam shadowing false","",'!$BLUE = "#007bff"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#dc3545"','!$ORANGE = "#fd7e14"','!$YELLOW = "#ffc107"','!$GREEN = "#28a745"','!$TEAL = "#20c997"','!$CYAN = "#17a2b8"','!$WHITE = "#ffffff"','!$GRAY = "#868e96"','!$GRAYDARK = "#333333"','!$PRIMARY = "#333333"','!$SECONDARY = "#555555"','!$SUCCESS = "#28a745"','!$INFO = "#17a2b8"','!$WARNING = "#ffc107"','!$DANGER = "#dc3545"','!$LIGHT = "#ffffff"','!$DARK = "#555555"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#2e2e2e"','!$PRIMARY_LIGHT = "#474747"','!$PRIMARY_TEXT = "#2e2e2e"','!$SECONDARY_DARK = "#4d4d4d"','!$SECONDARY_LIGHT = "#666666"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#1592a6"','!$INFO_LIGHT = "#2eabbf"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#24963e"','!$SUCCESS_LIGHT = "#3eb058"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#e6ae06"','!$WARNING_LIGHT = "#ffc720"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#c6303e"','!$DANGER_LIGHT = "#e04958"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#4d4d4d"','!$DARK_LIGHT = "#666666"','!$LIGHT_DARK = "#e6e6e6"','!$LIGHT_LIGHT = "#ffffff"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Segoe Print"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $BGCOLOR","CBorderColor $SECONDARY_DARK","ABackgroundColor $BGCOLOR","ABorderColor $SUCCESS_DARK","IBackgroundColor $BGCOLOR","IBorderColor $DANGER_DARK","EBackgroundColor $BGCOLOR","EBorderColor $WARNING_DARK","NBackgroundColor $BGCOLOR","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY_TEXT","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $PRIMARY_TEXT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $BGCOLOR","TitleFontColor $PRIMARY_TEXT","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $PRIMARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY_TEXT","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $DARK_DARK","FontColor $DARK_DARK","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING_DARK","FontColor $WARNING_DARK","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $BGCOLOR","BorderColor #F2FCFE","FontColor $PRIMARY_TEXT","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $BGCOLOR","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $PRIMARY_TEXT","BorderThickness 1","AttributeFontColor $PRIMARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO_DARK","FontColor $INFO_DARK","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.spacelab={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.spacelab=['!$THEME = "spacelab"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#446e9b"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#cd0200"','!$ORANGE = "#fd7e14"','!$YELLOW = "#d47500"','!$GREEN = "#3cb521"','!$TEAL = "#20c997"','!$CYAN = "#3399f3"','!$WHITE = "#ffffff"','!$GRAY = "#777777"','!$GRAYDARK = "#333333"','!$PRIMARY = "#446e9b"','!$SECONDARY = "#999999"','!$SUCCESS = "#3cb521"','!$INFO = "#3399f3"','!$WARNING = "#d47500"','!$DANGER = "#cd0200"','!$LIGHT = "#eeeeee"','!$DARK = "#333333"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#304d6d"','!$PRIMARY_LIGHT = "#7c9ab9"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#6b6b6b"','!$SECONDARY_LIGHT = "#b8b8b8"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#246baa"','!$INFO_LIGHT = "#70b8f7"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#32a243"','!$SUCCESS_LIGHT = "#4cbc5c"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#945200"','!$WARNING_LIGHT = "#e19e4d"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#900100"','!$DANGER_LIGHT = "#dc4e4d"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#242424"','!$DARK_LIGHT = "#707070"','!$LIGHT_DARK = "#a7a7a7"','!$LIGHT_LIGHT = "#f3f3f3"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY_DARK","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY_DARK","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK_LIGHT-$DARK_DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $WHITE","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z["spacelab-white"]={author:"KingPlus-lang",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar["spacelab-white"]=['!$THEME = "spacelab-white"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "white"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#446e9b"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#cd0200"','!$ORANGE = "#fd7e14"','!$YELLOW = "#d47500"','!$GREEN = "#3cb521"','!$TEAL = "#20c997"','!$CYAN = "#3399f3"','!$WHITE = "#ffffff"','!$GRAY = "#777777"','!$GRAYDARK = "#333333"','!$PRIMARY = "#446e9b"','!$SECONDARY = "#999999"','!$SUCCESS = "#3cb521"','!$INFO = "#3399f3"','!$WARNING = "#d47500"','!$DANGER = "#cd0200"','!$LIGHT = "#eeeeee"','!$DARK = "#333333"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#304d6d"','!$PRIMARY_LIGHT = "#7c9ab9"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#6b6b6b"','!$SECONDARY_LIGHT = "#b8b8b8"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#246baa"','!$INFO_LIGHT = "#70b8f7"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#32a243"','!$SUCCESS_LIGHT = "#4cbc5c"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#945200"','!$WARNING_LIGHT = "#e19e4d"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#900100"','!$DANGER_LIGHT = "#dc4e4d"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#242424"','!$DARK_LIGHT = "#707070"','!$LIGHT_DARK = "#a7a7a7"','!$LIGHT_LIGHT = "#f3f3f3"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY_LIGHT-$PRIMARY_DARK","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY_DARK","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY_DARK","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK_LIGHT-$DARK_DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $WHITE","HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY","StereotypeFontColor $LIGHT","BorderThickness 1","AttributeFontColor $LIGHT","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT-$SECONDARY_DARK","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO_LIGHT-$INFO_DARK","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK-$SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.superhero={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.superhero=['!$THEME = "superhero"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#DF691A"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#d9534f"','!$ORANGE = "#f0ad4e"','!$YELLOW = "#f0ad4e"','!$GREEN = "#5cb85c"','!$TEAL = "#20c997"','!$CYAN = "#5bc0de"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#868e96"','!$PRIMARY = "#DF691A"','!$SECONDARY = "#4E5D6C"','!$SUCCESS = "#5cb85c"','!$INFO = "#5bc0de"','!$WARNING = "#f0ad4e"','!$DANGER = "#d9534f"','!$LIGHT = "#abb6c2"','!$DARK = "#4E5D6C"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#e58748"','!$PRIMARY_LIGHT = "#b25415"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#717d89"','!$SECONDARY_LIGHT = "#3e4a56"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#7ccde5"','!$INFO_LIGHT = "#499AB2"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#4a934a"','!$SUCCESS_LIGHT = "#5F8F00"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#f3bd71"','!$WARNING_LIGHT = "#C08A3E"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#e17572"','!$DANGER_LIGHT = "#AE423F"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#717d89"','!$DARK_LIGHT = "#3e4a56"','!$LIGHT_DARK = "#bcc5ce"','!$LIGHT_LIGHT = "#89929b"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","BorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBackgroundColor $SECONDARY","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $LIGHT-black","BorderColor $LIGHT","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z["superhero-outline"]={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar["superhero-outline"]=['!$THEME = "superhero-outline"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#DF691A"','!$INDIGO = "#6610f2"','!$PURPLE = "#6f42c1"','!$PINK = "#e83e8c"','!$RED = "#d9534f"','!$ORANGE = "#f0ad4e"','!$YELLOW = "#f0ad4e"','!$GREEN = "#5cb85c"','!$TEAL = "#20c997"','!$CYAN = "#5bc0de"','!$WHITE = "#FFF"','!$GRAY_LIGHT = "#222"','!$GRAY = "#868e96"','!$PRIMARY = "#DF691A"','!$SECONDARY = "#4E5D6C"','!$SUCCESS = "#5cb85c"','!$INFO = "#5bc0de"','!$WARNING = "#f0ad4e"','!$DANGER = "#d9534f"','!$LIGHT = "#abb6c2"','!$DARK = "#4E5D6C"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#e58748"','!$PRIMARY_LIGHT = "#b25415"',"!$PRIMARY_TEXT = $PRIMARY",'!$SECONDARY_DARK = "#717d89"','!$SECONDARY_LIGHT = "#3e4a56"',"!$SECONDARY_TEXT = $SECONDARY_DARK ",'!$INFO_DARK = "#7ccde5"','!$INFO_LIGHT = "#499AB2"',"!$INFO_TEXT = $INFO",'!$SUCCESS_DARK = "#4a934a"','!$SUCCESS_LIGHT = "#5F8F00"',"!$SUCCESS_TEXT = $SUCCESS",'!$WARNING_DARK = "#f3bd71"','!$WARNING_LIGHT = "#C08A3E"',"!$WARNING_TEXT = $WARNING",'!$DANGER_DARK = "#e17572"','!$DANGER_LIGHT = "#AE423F"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#717d89"','!$DARK_LIGHT = "#3e4a56"','!$LIGHT_DARK = "#bcc5ce"','!$LIGHT_LIGHT = "#89929b"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $BGCOLOR","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $BGCOLOR","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_LIGHT","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_LIGHT","LineColor $PRIMARY_LIGHT","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $BGCOLOR","}","separator {","LineColor $SECONDARY_DARK","BackGroundColor $BGCOLOR","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam TitleFontColor $DARK","skinparam TitleFontSize 20","skinparam TitleBorderThickness 0","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_DARK","CBorderColor $SECONDARY_LIGHT","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $BGCOLOR","}","","skinparam legend {","BackgroundColor $BGCOLOR","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $BGCOLOR","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $BGCOLOR","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $BGCOLOR","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $BGCOLOR","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $LIGHT","ReferenceFontColor $LIGHT","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $BGCOLOR","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $BGCOLOR","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $BGCOLOR","BorderColor $INFO_DARK","FontColor $INFO_DARK","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $BGCOLOR","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $BGCOLOR","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $BGCOLOR","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor $BGCOLOR","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","FontColor $PRIMARY","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","FontColor $LIGHT","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_DARK","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $BGCOLOR","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $BGCOLOR","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $BGCOLOR","BorderColor $INFO","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $BGCOLOR","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.toy={author:"future-architect",license:"Apache-2.0",source:"https://github.com/future-architect/puml-themes/tree/master/themes"},Ar.toy=["skinparam BackgroundColor DDDDDD","skinparam shadowing false","skinparam RoundCorner 7","skinparam ArrowColor 454645","skinparam FontColor 454645","skinparam SequenceLifeLineBorderColor 454645","skinparam SequenceGroupHeaderFontColor 454645","skinparam SequenceGroupFontColor 454645","skinparam SequenceGroupBorderColor 454645","skinparam SequenceGroupBorderThickness 1","","skinparam sequenceDivider {","BorderColor 454645","BorderThickness 1","FontColor 454645","}","","skinparam participant {","BackgroundColor FF6F61","BorderColor 454645","FontColor White","BorderThickness 1.5","}","","skinparam database {","BackgroundColor 98DDDE","BorderColor 454645","FontColor 454645","}","","skinparam entity {","BackgroundColor FFDA29","BorderColor 454645","FontColor 454645","}","","skinparam note {","BackgroundColor LightGreen","BorderColor 454645","FontColor 454645","BorderThickness 1","}","","skinparam actor {","BackgroundColor 454645","BorderColor 454645","FontColor 454645","}","","skinparam boundary {","BackgroundColor FFDA29","BorderColor 454645","FontColor 454645","}","","skinparam control {","BackgroundColor FFDA29","BorderColor 454645","FontColor 454645","}","","skinparam collections {","BackgroundColor FF6F61","BorderColor 454645","FontColor 454645","BorderThickness 1.5","}","","skinparam queue {","BackgroundColor FF6F61","BorderColor 454645","FontColor FFF","BorderThickness 1.5","}"].join(`
+`),Z.united={author:"Brett Schwarz",license:"MIT",source:"https://github.com/bschwarz/puml-themes"},Ar.united=['!$THEME = "united"',"",'!if %not(%variable_exists("$BGCOLOR"))','!$BGCOLOR = "transparent"',"!endif","","skinparam backgroundColor $BGCOLOR","skinparam useBetaStyle false","",'!$BLUE = "#007bff"','!$INDIGO = "#6610f2"','!$PURPLE = "#772953"','!$PINK = "#e83e8c"','!$RED = "#df382c"','!$ORANGE = "#e95420"','!$YELLOW = "#efb73e"','!$GREEN = "#38b44a"','!$TEAL = "#20c997"','!$CYAN = "#17a2b8"','!$WHITE = "#fff"','!$GRAY = "#868e96"','!$GRAYDARK = "#333"','!$PRIMARY = "#e95420"','!$SECONDARY = "#aea79f"','!$SUCCESS = "#38b44a"','!$INFO = "#17a2b8"','!$WARNING = "#efb73e"','!$DANGER = "#df382c"','!$LIGHT = "#e9ecef"','!$DARK = "#772953"',"","!$FGCOLOR = $WHITE",'!$PRIMARY_DARK = "#d24c1d"','!$PRIMARY_LIGHT = "#eb6536"',"!$PRIMARY_TEXT = $WHITE",'!$SECONDARY_DARK = "#9d968f"','!$SECONDARY_LIGHT = "#b6b0a9"',"!$SECONDARY_TEXT = $WHITE",'!$INFO_DARK = "#1592a6"','!$INFO_LIGHT = "#2eabbf"',"!$INFO_TEXT = $WHITE",'!$SUCCESS_DARK = "#32a243"','!$SUCCESS_LIGHT = "#4cbc5c"',"!$SUCCESS_TEXT = $WHITE",'!$WARNING_DARK = "#d7a538"','!$WARNING_LIGHT = "#f1be51"',"!$WARNING_TEXT = $WHITE",'!$DANGER_DARK = "#c93228"','!$DANGER_LIGHT = "#e24c41"',"!$DANGER_TEXT = $WHITE",'!$DARK_DARK = "#6b254b"','!$DARK_LIGHT = "#853e64"','!$LIGHT_DARK = "#d2d4d7"','!$LIGHT_LIGHT = "#ebeef1"',"","!procedure $success($msg)","<font color=$SUCCESS><b>$msg","!endprocedure","","!procedure $failure($msg)","<font color=$DANGER><b>$msg","!endprocedure","","!procedure $warning($msg)","<font color=$WARNING><b>$msg","!endprocedure","","!procedure $primary_scheme()","FontColor $PRIMARY_TEXT","BorderColor $PRIMARY_DARK","BackgroundColor $PRIMARY","!endprocedure","<style>","root {","BackgroundColor $BGCOLOR","FontColor $PRIMARY_TEXT","HyperLinkColor $ORANGE","LineColor $PRIMARY_DARK","LineThickness 1","Margin 10","Padding 6","Shadowing 0.0","}","node {","Padding 15","roundcorner 20","BackgroundColor $PRIMARY-$PRIMARY_DARK","}","caption {","LineThickness 0","}","footer {","LineThickness 0","}","groupHeader {","BackgroundColor $SECONDARY","FontColor $INFO","FontStyle bold","}","header {","LineThickness 0","}","referenceHeader {","BackgroundColor $BGCOLOR","FontColor $DARK","FontStyle bold","}","separator {","BackgroundColor $FGCOLOR","FontColor $BGCOLOR","FontStyle bold","}","title {","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","FontColor $PRIMARY","BorderColor $SECONDARY","}","nwdiagDiagram {","network {","$primary_scheme() ","LineColor $PRIMARY","LineThickness 1.0","FontColor $PRIMARY_DARK","}","server {","$primary_scheme()","}","arrow {","FontColor $PRIMARY_DARK","LineColor $PRIMARY_DARK","}","group {","BackGroundColor $LIGHT","LineColor $LIGHT_DARK","LineThickness 2.0","Margin 5","Padding 5","}","}","participant {","Margin 5 40","Padding 15 20","}","ganttDiagram {","task {","$primary_scheme()","LineColor $PRIMARY","Margin 10 2 2 2","Padding 6","}","note {","FontColor $INFO_TEXT","LineColor $INFO_DARK","BackGroundColor $INFO","}","separator {","LineColor $SECONDARY","BackGroundColor $SECONDARY-$SECONDARY_DARK","FontColor $SECONDARY_TEXT","}","milestone {","FontColor $INFO","FontSize 16","FontStyle italic","BackGroundColor $SECONDARY","LineColor $SECONDARY_DARK","}","timeline {","BackgroundColor $SECONDARY","FontColor $SECONDARY_TEXT","}","closed {","BackgroundColor $WARNING_DARK","FontColor $WARNING_TEXT","}","}","</style>",'skinparam defaultFontName "Verdana"',"skinparam defaultFontSize 12","skinparam dpi 100","skinparam shadowing false","skinparam roundcorner 8","skinparam BoxPadding 40","skinparam ArrowColor $DARK","skinparam stereotype {","CBackgroundColor $SECONDARY_LIGHT","CBorderColor $SECONDARY_DARK","ABackgroundColor $SUCCESS_LIGHT","ABorderColor $SUCCESS_DARK","IBackgroundColor $DANGER_LIGHT","IBorderColor $DANGER_DARK","EBackgroundColor $WARNING_LIGHT","EBorderColor $WARNING_DARK","NBackgroundColor $INFO_LIGHT","NBorderColor $INFO_DARK","}","skinparam title {","FontColor $PRIMARY","BorderColor $SECONDARY_DARK","FontSize 20","BorderRoundCorner 8","BorderThickness 1","BackgroundColor $SECONDARY_LIGHT-$SECONDARY","}","","skinparam legend {","BackgroundColor $SECONDARY","BorderColor $SECONDARY_DARK","FontColor $LIGHT","}","","!startsub swimlane","skinparam swimlane {","BorderColor $INFO","BorderThickness 2","TitleBackgroundColor $SECONDARY_LIGHT-$SECONDARY","TitleFontColor $PRIMARY","}","!endsub","","!startsub activity","","skinparam activity {","$primary_scheme()","BarColor $SUCCESS","StartColor $INFO","EndColor $INFO","DiamondBackgroundColor $SECONDARY_LIGHT","DiamondBorderColor $SECONDARY_DARK","DiamondFontColor $SECONDARY_TEXT","}","!endsub","","!startsub participant","","skinparam participant {","$primary_scheme()","ParticipantBorderThickness 2","}","!endsub","","!startsub actor","","skinparam actor {","$primary_scheme()","}","!endsub","","!startsub arrow","","skinparam arrow {","Thickness 3","Color $PRIMARY","FontColor $FGCOLOR","}","!endsub","","!startsub sequence","","skinparam sequence {","BorderColor $PRIMARY","' For some reason sequence title font color does not pick up from global","TitleFontColor $PRIMARY","BackgroundColor $BGCOLOR","StartColor $PRIMARY","EndColor $PRIMARY","BoxBackgroundColor $BGCOLOR","BoxBorderColor $DARK","BoxFontColor $DARK","DelayFontColor $DARK","LifeLineBorderColor $SECONDARY","LifeLineBorderThickness 2","LifeLineBackgroundColor $SECONDARY_DARK","GroupBorderColor $DARK","GroupFontColor $DARK","GroupHeaderFontColor $INFO","GroupBackgroundColor $SECONDARY","GroupHeaderBackgroundColor $BGCOLOR","DividerBackgroundColor $DARK","DividerBorderColor $DARK","DividerBorderThickness 2","DividerFontColor $LIGHT","ReferenceBackgroundColor $BGCOLOR","ReferenceBorderColor $DARK","ReferenceFontColor $DARK","ReferenceHeaderFontColor $INFO","ReferenceHeaderBackgroundColor $SECONDARY","StereotypeFontColor $PRIMARY_TEXT","}","!endsub","","!startsub partition","","skinparam partition {","BorderColor $PRIMARY","FontColor $PRIMARY","BackgroundColor $BGCOLOR","}","!endsub","","!startsub collections","","skinparam collections {","$primary_scheme()","}","!endsub","","!startsub control","","skinparam control {","$primary_scheme()","}","!endsub","","!startsub entity","","skinparam entity {","$primary_scheme()","}","!endsub","","!startsub boundary","","skinparam boundary {","$primary_scheme()","}","!endsub","","!startsub agent","","skinparam agent {","BackgroundColor $WARNING","BorderColor $WARNING_LIGHT","FontColor $DARK","}","!endsub","","!startsub note","","skinparam note {","BorderThickness 1","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $WHITE","}","!endsub","","!startsub artifact","","skinparam artifact {","BackgroundColor $DARK","BorderColor $DARK_DARK","FontColor $LIGHT","}","!endsub","","!startsub component","","skinparam component {","$primary_scheme()","}","!endsub","","!startsub interface","","skinparam interface {","BackgroundColor $DANGER_DARK","BorderColor $DANGER","FontColor $DARK","}","!endsub","","!startsub storage","","skinparam storage {","BackgroundColor $WARNING","BorderColor $WARNING_DARK","FontColor $WARNING_TEXT","}","!endsub","","!startsub node","","skinparam node {","BackgroundColor $SECONDARY","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub cloud","","skinparam cloud {","BackgroundColor #F2FCFE-#eeeeee","BorderColor #F2FCFE","FontColor $DARK","}","!endsub","","!startsub database","","skinparam database {","$primary_scheme()","}","!endsub","","!startsub class","","skinparam class {","$primary_scheme()","HeaderBackgroundColor $PRIMARY_LIGHT","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $DARK","AttributeFontSize 11","}","!endsub","","!startsub object","","skinparam object {","$primary_scheme()","StereotypeFontColor $DARK","BorderThickness 1","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub usecase","","skinparam usecase {","$primary_scheme()","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub rectangle","","skinparam rectangle {","$primary_scheme()","BackgroundColor $SECONDARY_LIGHT","BorderThickness 2","StereotypeFontColor $PRIMARY","}","!endsub","","!startsub package","","skinparam package {","BackgroundColor $SECONDARY","BorderColor $PRIMARY","FontColor $PRIMARY","BorderThickness 2","}","!endsub","","!startsub folder","","skinparam folder {","BackgroundColor $SECONDARY_LIGHT","BorderColor $WARNING","FontColor $WARNING","BorderThickness 2","}","!endsub","","!startsub frame","","skinparam frame {","BackgroundColor $SECONDARY_LIGHT","BorderColor $INFO","FontColor $INFO","BorderThickness 2","}","!endsub","","!startsub state","","skinparam state {","$primary_scheme()","BackgroundColor $PRIMARY_LIGHT","StartColor $INFO","EndColor $INFO","AttributeFontColor $SECONDARY_TEXT","AttributeFontSize 11","}","!endsub","","!startsub queue","","skinparam queue {","$primary_scheme()","}","!endsub","","!startsub card","","skinparam card {","BackgroundColor $INFO","BorderColor $INFO_DARK","FontColor $INFO_TEXT","}","!endsub","","!startsub file","","skinparam file {","BackgroundColor $SECONDARY_DARK","BorderColor $LIGHT","FontColor $LIGHT","}","!endsub","","!startsub stack","","skinparam stack {","$primary_scheme()","}","!endsub"].join(`
+`),Z.vibrant={author:"future-architect",license:"Apache-2.0",source:"https://github.com/future-architect/puml-themes/tree/master/themes"},Ar.vibrant=["skinparam BackgroundColor FFFFFF","skinparam shadowing false","skinparam RoundCorner 7","skinparam ArrowColor 454645","skinparam FontColor 454645","skinparam SequenceLifeLineBorderColor 696969","skinparam SequenceGroupHeaderFontColor 454645","skinparam SequenceGroupFontColor 696969","skinparam SequenceGroupBorderColor 696969","skinparam SequenceGroupBorderThickness 1","","skinparam sequenceDivider {","BorderColor 454645","BorderThickness 1","FontColor 454645","}","","skinparam participant {","BackgroundColor FF6347","BorderColor 454645","FontColor FFFFFF","BorderThickness 1.5","}","","skinparam database {","BackgroundColor 00FFFF","BorderColor 454645","FontColor 454645","}","","skinparam entity {","BackgroundColor FFE552","BorderColor 454645","FontColor 454645","}","","skinparam note {","BackgroundColor 7FFFD4","BorderColor 454645","FontColor 454645","BorderThickness 1.5","}","","skinparam actor {","BackgroundColor 454645","BorderColor 454645","FontColor 454645","}","","skinparam boundary {","BackgroundColor FFE552","BorderColor 454645","FontColor 454645","}","","skinparam control {","BackgroundColor FFE552","BorderColor 454645","FontColor 454645","}","","skinparam collections {","BackgroundColor FF5F42","BorderColor 454645","FontColor 454645","}","","skinparam queue {","BackgroundColor FF6347","BorderColor 454645","FontColor FFF","BorderThickness 1.5","}"].join(`
+`);function Mr(Nr){var lr=String(Nr??"").replace(/^\s+|\s+$/g,"").toLowerCase();return Ar.hasOwnProperty(lr)?Ar[lr]:null}function Yr(Nr){return Mr(Nr)!=null}function fe(Nr){var lr=String(Nr??"").replace(/^\s+|\s+$/g,"").toLowerCase();return Z.hasOwnProperty(lr)?Z[lr]:null}function Wr(){var Nr=[];for(var lr in Ar)Ar.hasOwnProperty(lr)&&Nr.push(lr);return Nr}return{get:Mr,has:Yr,meta:fe,names:Wr}})();var yd=(function(){function Ar(f){return f.replace(/\r\n|\r/g,`
+`)}function Z(f,d){for(;d>0;){var b=f.charAt(d-1);if(b===`
+`)return!0;if(b!==" "&&b!==" ")return!1;d--}return!0}function Mr(f){if(f==null||typeof f!="string")return f;f=Ar(f);for(var d=f.length,b=[],E=0,ur=0;E<d;){var Er=f.charAt(E);ur===0?Er==='"'?(b.push(Er),ur=1,E++):Er==="/"&&E+1<d&&f.charAt(E+1)==="'"?(ur=3,E+=2):Er==="'"&&Z(f,E)?(ur=2,E++):(b.push(Er),E++):ur===1?Er==="\\"&&E+1<d?(b.push(Er),b.push(f.charAt(E+1)),E+=2):Er==='"'||Er===`
+`?(b.push(Er),ur=0,E++):(b.push(Er),E++):ur===2?(Er===`
+`&&(b.push(Er),ur=0),E++):Er==="'"&&E+1<d&&f.charAt(E+1)==="/"?(ur=0,E+=2):(Er===`
+`&&b.push(Er),E++)}return b.join("")}function Yr(f){if(f=f.replace(/^\s+|\s+$/g,""),f.length===0)return"";if(f.charAt(0)==='"'){for(var d=f.length-1;d>0&&f.charAt(d)!=='"';)d--;if(d>0){var b=f.substring(1,d);return b.replace(/\\"/g,'"').replace(/\\\\/g,"\\")}return f}return/^-?\d+$/.test(f)?parseInt(f,10):/^-?\d*\.\d+$/.test(f)?parseFloat(f):f}function fe(f,d){for(var b=!1,E=!1,ur=0;ur<f.length;ur++){var Er=f.charAt(ur);E?E=!1:b?Er==="\\"?E=!0:Er==='"'&&(b=!1):Er==='"'?b=!0:Er==="{"||Er==="["?d++:(Er==="}"||Er==="]")&&d--}return d}function Wr(f){return Object.prototype.toString.call(f)==="[object Array]"}function Nr(f){return f!==null&&typeof f=="object"}function lr(f){return f==null?"":typeof f=="object"?JSON.stringify(f):typeof f=="boolean"?f?"1":"0":String(f)}function Y(f){return f===void 0?"":f===null?"null":String(f)}function Cr(f,d){var b=f.charAt(d);if(!(b>="A"&&b<="Z"||b>="a"&&b<="z"||b==="_"))return d;for(d++;d<f.length&&(b=f.charAt(d),b>="A"&&b<="Z"||b>="a"&&b<="z"||b>="0"&&b<="9"||b==="_");)d++;return d}function V(f,d){if(!(!Nr(f)||Wr(f)))return Object.prototype.hasOwnProperty.call(f,d)?f[d]:void 0}function U(f,d){if(d=d.replace(/^\s+|\s+$/g,""),Wr(f)){var b=parseInt(d,10);return String(b)===d&&b>=0&&b<f.length?f[b]:void 0}return V(f,d)}function H(f,d,b,E){if(!Nr(f))return{value:f,pos:b};for(var ur=f;b<d.length&&Nr(ur);){var Er=d.charAt(b);if(Er==="."){for(var ke=b+1;ke<d.length;){var dr=d.charAt(ke);if(dr>="A"&&dr<="Z"||dr>="a"&&dr<="z"||dr>="0"&&dr<="9"||dr==="_")ke++;else break}if(ke===b+1)break;ur=V(ur,d.substring(b+1,ke)),b=ke}else if(Er==="["){for(var Go=0,lo=b+1;lo<d.length;){var vo=d.charAt(lo);if(vo==="[")Go++;else if(vo==="]"){if(Go===0)break;Go--}lo++}if(lo>=d.length)break;ur=U(ur,E(d.substring(b+1,lo))),b=lo+1}else break}return{value:Nr(ur)?ur:Y(ur),pos:b}}function J(f){var d=[];if(!Nr(f))return d;if(Wr(f)){for(var b=0;b<f.length;b++)d.push(Nr(f[b])?f[b]:Y(f[b]));return d}for(var E in f)Object.prototype.hasOwnProperty.call(f,E)&&d.push(E);return d}function gr(f){try{return JSON.parse(f)}catch{return}}function X(f,d){var b=f.replace(/^\s+|\s+$/g,"");if(b.length===0)return"";var E=b.charAt(0);if(E==="{"||E==="["){var ur=gr(b);return ur!==void 0?ur:Yr(f)}var Er=E==="$"||E==="%"||E==="("||E==='"'||E==="'"||E==="-"||E==="!"||E==="."||E>="0"&&E<="9"||/^(?:true|false)\b/.test(b),ke=b.match(/^([A-Za-z_][\w]*)/);if(!Er&&ke!=null&&d!=null&&d.defines!=null&&Object.prototype.hasOwnProperty.call(d.defines,ke[1])&&(Er=!0),!Er&&ke!=null&&d!=null&&d.functions!=null&&Object.prototype.hasOwnProperty.call(d.functions,ke[1])&&(Er=!0),Er){var dr=ar(b,d||{});if(dr.complete)return dr.value}return Yr(f)}function g(f,d){return f.replace(/%([A-Za-z_][\w]*)%/g,function(b,E){return Object.prototype.hasOwnProperty.call(d,E)?lr(d[E]):b})}function M(f,d){if(f==null||typeof f!="string")return f;d=d||{};var b={};if(d.variables!=null)for(var E in d.variables)d.variables.hasOwnProperty(E)&&(b[E]=d.variables[E]);for(var ur=f.split(`
+`),Er=[],ke=/^(\s*)!\$([A-Za-z_][\w]*)\s*=\s*(.*)$/,dr=0;dr<ur.length;dr++){var Go=g(ur[dr],b),lo=Go.match(ke);if(lo!=null){b[lo[2]]=X(lo[3],{defines:d.defines||{},paramDefines:d.paramDefines||{},variables:b}),Er.push("");continue}Er.push(Go)}d.variables==null&&(d.variables={});for(var vo in b)b.hasOwnProperty(vo)&&(d.variables[vo]=b[vo]);return Er.join(`
+`)}function _(f){return f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(f){if(f.length===0)return null;for(var d=f.slice().sort(function(ur,Er){return Er.length-ur.length}),b=[],E=0;E<d.length;E++)b.push(_(d[E]));return new RegExp("\\b("+b.join("|")+")\\b","g")}function $(f,d,b){return b==null?f:f.replace(b,function(E){return d[E]})}function y(f){f=f.replace(/^\s+|\s+$/g,"");var d=[];if(d.defaults=[],f.length===0)return d;for(var b=s(f),E=0;E<b.length;E++){var ur=b[E].replace(/^\s+|\s+$/g,""),Er=ur.indexOf("=");if(Er>0){var ke=ur.substring(Er+1).replace(/^\s+|\s+$/g,"");d.push(ur.substring(0,Er).replace(/\s+$/,"")),d.defaults.push(ke.replace(/^(["'])(.*)\1$/,"$2"))}else d.push(ur),d.defaults.push(null)}return d}function A(f,d){for(var b=0,E=null,ur=f.length,Er=d;Er<ur;Er++){var ke=f.charAt(Er);if(E!=null){ke==="\\"&&Er+1<ur?Er++:ke===E&&(E=null);continue}if(ke==='"'||ke==="'")E=ke;else if(ke==="(")b++;else if(ke===")"&&(b--,b===0))return Er}return-1}function s(f){var d=[],b=f.length;if(b===0)return d;for(var E="",ur=0,Er=null,ke=0;ke<b;ke++){var dr=f.charAt(ke);if(Er!=null){E+=dr,dr==="\\"&&ke+1<b?(E+=f.charAt(ke+1),ke++):dr===Er&&(Er=null);continue}dr==='"'||dr==="'"?(Er=dr,E+=dr):dr==="("?(ur++,E+=dr):dr===")"?(ur--,E+=dr):dr===","&&ur===0?(d.push(E.replace(/^\s+|\s+$/g,"")),E=""):E+=dr}return d.push(E.replace(/^\s+|\s+$/g,"")),d}function k(f){for(var d=s(f.replace(/^\s+|\s+$/g,"")),b=[],E=0;E<d.length;E++){var ur=d[E].match(/^\s*\$?([A-Za-z_][\w]*)(?:\s*=\s*(.*))?$/);ur!=null&&b.push({name:ur[1],defaultExpression:ur[2]!=null?ur[2]:null})}return b}function o(f){var d=f.match(/^\s*!(?:(unquoted)\s+)?function\s+(\$?[A-Za-z_][\w]*)\s*\(/i);if(d==null)return null;var b=f.indexOf("(",d.index),E=A(f,b);if(E<0)return null;var ur=f.substring(E+1).replace(/^\s+|\s+$/g,""),Er=null;if(ur.length>0){var ke=ur.match(/^!?return\b(.*)$/i);if(ke==null)return null;Er=ke[1].replace(/^\s+|\s+$/g,"")}return{name:d[2].replace(/^\$/,""),params:k(f.substring(b+1,E)),unquoted:d[1]!=null,inlineReturn:Er}}function a(f,d){if(f==null)return[];if(f=f.replace(/^\s+|\s+$/g,""),f.length===0)return[];var b=f.charAt(0),E=f.charAt(f.length-1);if(b==="{"||b==="["&&E==="]"){var ur=gr(f);if(Nr(ur))return J(ur)}if(b==="$"||b==="%")return J(X(f,d));if((b==="["&&E==="]"||b==="("&&E===")")&&(f=f.substring(1,f.length-1).replace(/^\s+|\s+$/g,"")),f.length===0)return[];for(var Er=s(f),ke=[],dr=0;dr<Er.length;dr++)ke.push(Yr(Er[dr]));return ke}function t(f,d,b){if(d.length===0)return f;for(var E={},ur=d.defaults||[],Er=0;Er<d.length;Er++){var ke=Er<b.length?b[Er]:ur[Er]!=null?ur[Er]:"";ke.length>=2&&ke.charAt(0)==='"'&&ke.charAt(ke.length-1)==='"'&&(ke=ke.substring(1,ke.length-1)),E[d[Er]]=ke}for(var dr=d.slice().sort(function(Dn,Ve){return Ve.length-Dn.length}),Go=[],lo=0;lo<dr.length;lo++){var vo=dr[lo];vo.charAt(0)==="$"?Go.push("\\$"+_(vo.substring(1))+"(?![\\w])"):Go.push("\\b"+_(vo)+"\\b")}for(var Rn=new RegExp("("+Go.join("|")+")","g"),rn=0;rn<dr.length;rn++){var Co=_(dr[rn]);f=f.replace(new RegExp(Co+"##","g"),dr[rn]+"").replace(new RegExp("##"+Co,"g"),""+dr[rn])}return f.replace(Rn,function(Dn,Ve){return E[Ve]}).replace(/\u0001/g,"")}function n(f,d){for(var b="",E=0,ur=f.length,Er=/[A-Za-z_]/,ke=/[A-Za-z0-9_]/;E<ur;){var dr=f.charAt(E);if(dr==="$"&&E+1<ur&&Er.test(f.charAt(E+1))){var Go=E;for(E++;E<ur&&ke.test(f.charAt(E));)E++;var lo=f.substring(Go,E);if(d.hasOwnProperty(lo)&&E<ur&&f.charAt(E)==="("){var vo=A(f,E);if(vo<0){b+=lo;continue}var Rn=f.substring(E+1,vo),rn=s(Rn),Co=d[lo];b+=t(Co.body,Co.params,rn),E=vo+1}else b+=lo;continue}if(Er.test(dr)){for(var Dn=E;E<ur&&ke.test(f.charAt(E));)E++;var Ve=f.substring(Dn,E);if(d.hasOwnProperty(Ve)&&E<ur&&f.charAt(E)==="("){var dt=A(f,E);if(dt<0){b+=Ve;continue}var $t=f.substring(E+1,dt),Sa=s($t),ba=d[Ve];b+=t(ba.body,ba.params,Sa),E=dt+1}else b+=Ve}else b+=dr,E++}return b}function v(f,d,b){for(var E="",ur=0,Er=f.length,ke=/[A-Za-z_]/,dr=/[A-Za-z0-9_]/;ur<Er;){var Go=ur,lo=!1;if(f.charAt(ur)==="$"&&ur+1<Er&&ke.test(f.charAt(ur+1)))lo=!0,ur++;else if(!ke.test(f.charAt(ur))){E+=f.charAt(ur),ur++;continue}for(var vo=ur;ur<Er&&dr.test(f.charAt(ur));)ur++;var Rn=f.substring(vo,ur);if(Object.prototype.hasOwnProperty.call(d,Rn)&&ur<Er&&f.charAt(ur)==="("){var rn=A(f,ur);if(rn>=0){var Co=f.substring(Go,rn+1),Dn=w(Co,b);E+=lr(Dn),ur=rn+1;continue}}E+=(lo?"$":"")+Rn}return E}function R(f,d){if(f.indexOf("%")<0)return f;for(var b="",E=0,ur=f.length,Er=/[A-Za-z_]/,ke=/[A-Za-z0-9_]/;E<ur;){if(f.charAt(E)!=="%"||E+1>=ur||!Er.test(f.charAt(E+1))){b+=f.charAt(E),E++;continue}for(var dr=E+1,Go=dr;Go<ur&&ke.test(f.charAt(Go));)Go++;var lo=f.substring(dr,Go);if(Go<ur&&f.charAt(Go)==="("&&P(lo)){var vo=A(f,Go);if(vo>=0){var Rn=w(f.substring(E,vo+1),d);b+=lr(Rn),E=vo+1;continue}}b+=f.substring(E,Go),E=Go}return b}function Q(f,d){var b="",E=0;function ur(lo){return Q(g(lo,d),d)}for(;E<f.length;){if(f.charAt(E)!=="$"){b+=f.charAt(E),E++;continue}var Er=Cr(f,E+1);if(Er===E+1){b+="$",E++;continue}var ke=f.substring(E+1,Er);if(f.charAt(Er)==="("||!Object.prototype.hasOwnProperty.call(d,ke)){b+=f.substring(E,Er),E=Er;continue}var dr=d[ke];if(typeof dr=="string"&&/^\$?[A-Za-z_][\w]*\s*\(/.test(dr)){b+=f.substring(E,Er),E=Er;continue}b.substring(b.length-2)==="##"&&(b=b.substring(0,b.length-2));var Go=H(dr,f,Er,ur);b+=lr(Go.value),E=Go.pos,E+1<f.length&&f.charAt(E)==="#"&&f.charAt(E+1)==="#"&&(E+=2)}return b}function L(f,d){if(f==null||typeof f!="string")return f;d=d||{};var b={},E={};if(d.defines!=null)for(var ur in d.defines)d.defines.hasOwnProperty(ur)&&(b[ur]=d.defines[ur]);if(d.paramDefines!=null)for(var Er in d.paramDefines)d.paramDefines.hasOwnProperty(Er)&&(E[Er]=d.paramDefines[Er]);var ke=f.split(`
+`),dr=[],Go=/^\s*!define\s+([A-Za-z_][\w]*)\(([^)]*)\)(?:[ \t]+(.*))?$/,lo=/^\s*!define\s+([A-Za-z_][\w]*)(?:[ \t]+(.*))?$/,vo=/^\s*!undef\s+([A-Za-z_][\w]*)\s*$/,Rn=/^\s*!definelong\s+([A-Za-z_][\w]*)(?:\(([^)]*)\))?\s*$/,rn=/^\s*!end\s*(?:definelong|function|procedure)\b/i,Co=/^\s*!(?:(?:unquoted|final)\s+)*procedure\s+\$?([A-Za-z_][\w]*)(?:\(([^)]*)\))?\s*$/i,Dn=rn,Ve=C(B(b)),dt=!1,$t=null,Sa=null,ba=null;function sl(){var pl=ba.join(`
+`);Sa!=null?(E[$t]={params:Sa,body:pl},b.hasOwnProperty($t)&&(delete b[$t],Ve=C(B(b)))):(b[$t]=pl,Ve=C(B(b)),E.hasOwnProperty($t)&&delete E[$t]),dt=!1,$t=null,Sa=null,ba=null}for(var ua=0;ua<ke.length;ua++){var ea=ke[ua],fn;if(dt){if(rn.test(ea)||Dn.test(ea)){sl(),dr.push("");continue}ba.push(ea),dr.push("");continue}if((fn=ea.match(Rn))!=null){dt=!0,$t=fn[1],Sa=fn[2]!=null?y(fn[2]):null,ba=[],dr.push("");continue}if((fn=ea.match(Co))!=null){dt=!0,$t="$"+fn[1],Sa=y(fn[2]||""),ba=[],dr.push("");continue}if((fn=ea.match(Go))!=null){var ui=fn[1],oi=fn[3]!=null?fn[3].replace(/\s+$/,""):"";E[ui]={params:y(fn[2]),body:oi},b.hasOwnProperty(ui)&&(delete b[ui],Ve=C(B(b))),dr.push("");continue}if((fn=ea.match(lo))!=null){var Zl=fn[2]!=null?fn[2].replace(/\s+$/,""):"";b[fn[1]]=Zl,Ve=C(B(b)),E.hasOwnProperty(fn[1])&&delete E[fn[1]],dr.push("");continue}if((fn=ea.match(vo))!=null){b.hasOwnProperty(fn[1])&&(delete b[fn[1]],Ve=C(B(b))),E.hasOwnProperty(fn[1])&&delete E[fn[1]],dr.push("");continue}var Ca=$(ea,b,Ve);dr.push(n(Ca,E))}dt&&sl(),d.defines==null&&(d.defines={});for(var Cl in d.defines)d.defines.hasOwnProperty(Cl)&&!b.hasOwnProperty(Cl)&&delete d.defines[Cl];for(var Aa in b)b.hasOwnProperty(Aa)&&(d.defines[Aa]=b[Aa]);d.paramDefines==null&&(d.paramDefines={});for(var en in d.paramDefines)d.paramDefines.hasOwnProperty(en)&&!E.hasOwnProperty(en)&&delete d.paramDefines[en];for(var xt in E)E.hasOwnProperty(xt)&&(d.paramDefines[xt]=E[xt]);return dr.join(`
+`)}function B(f){var d=[];for(var b in f)f.hasOwnProperty(b)&&d.push(b);return d}function w(f,d){return f==null?"":ar(f,d||{}).value}function ar(f,d){if(f==null)return{value:"",complete:!0};var b={text:String(f),pos:0,config:d||{},supported:!0};sr(b);var E=oe(b);return sr(b),{value:E,complete:b.supported&&b.pos===b.text.length}}function sr(f){for(;f.pos<f.text.length;){var d=f.text.charAt(f.pos);if(d===" "||d===" ")f.pos++;else break}}function ir(f,d){return f.text.substr(f.pos,d.length)===d}function _r(f,d){return ir(f,d)?(f.pos+=d.length,!0):!1}function Sr(f){if(typeof f=="number")return f;if(typeof f=="boolean")return f?1:0;if(f==null||f==="")return 0;var d=parseFloat(f);return isNaN(d)?0:d}function ae(f){return typeof f=="boolean"?f:typeof f=="number"?f!==0:f==null?!1:typeof f=="string"?!(f===""||f==="false"||f==="0"):!!f}function se(f){return typeof f=="string"||Nr(f)}function re(f){return typeof f=="number"?!0:typeof f=="string"?/^-?\d+(?:\.\d+)?$/.test(f):!1}function Ur(f,d,b){var E,ur;switch(re(f)&&re(d)?(E=Sr(f),ur=Sr(d)):(E=lr(f),ur=lr(d)),b){case"==":return E===ur;case"!=":return E!==ur;case"<":return E<ur;case">":return E>ur;case"<=":return E<=ur;case">=":return E>=ur}return!1}function oe(f){for(var d=Ce(f);sr(f),!!_r(f,"||");){var b=Ce(f);d=ae(d)||ae(b)}return d}function Ce(f){for(var d=Me(f);sr(f),!!_r(f,"&&");){var b=Me(f);d=ae(d)&&ae(b)}return d}function Me(f){var d=eo(f);sr(f);for(var b=["==","!=","<=",">=","<",">"],E=0;E<b.length;E++)if(_r(f,b[E])){var ur=eo(f);return Ur(d,ur,b[E])}return d}function eo(f){for(var d=Hr(f);;){sr(f);var b=f.text.charAt(f.pos);if(b!=="+"&&b!=="-")break;f.pos++;var E=Hr(f);b==="+"?se(d)||se(E)?d=lr(d)+lr(E):d=Sr(d)+Sr(E):d=Sr(d)-Sr(E)}return d}function Hr(f){for(var d=Ne(f);;){sr(f);var b=f.text.charAt(f.pos);if(b!=="*"&&b!=="/")break;f.pos++;var E=Ne(f);if(b==="*")d=Sr(d)*Sr(E);else{var ur=Sr(E);d=ur===0?0:Sr(d)/ur}}return d}function Ne(f){sr(f);var d=f.text.charAt(f.pos);return d==="-"?(f.pos++,-Sr(Ne(f))):d==="!"&&f.text.charAt(f.pos+1)!=="="?(f.pos++,!ae(Ne(f))):He(f)}function He(f){if(sr(f),f.pos>=f.text.length)return"";var d=f.text.charAt(f.pos);if(d==="("){f.pos++;var b=oe(f);return sr(f),f.text.charAt(f.pos)===")"&&f.pos++,b}if(d==='"'||d==="'")return O(f);if(d==="$"){f.pos++;var E=Kr(f);if(E==="")return"";var ur=T(N(E,f.config),f);return ur.consumed?ur.value:(sr(f),f.text.charAt(f.pos)==="("?Qt(E,f,!1):ur.value)}if(d==="%"){var Er=f.pos;f.pos++;var ke=Kr(f);return ke!==""&&f.text.charAt(f.pos)==="%"?(f.pos++,N(ke,f.config)):ke!==""&&f.text.charAt(f.pos)==="("?Qt(ke,f,!0):(f.pos=Er,"")}if(d>="0"&&d<="9"||d===".")return Ue(f);if(d>="A"&&d<="Z"||d>="a"&&d<="z"||d==="_"){var dr=Kr(f);return dr==="true"||dr==="false"?dr:(sr(f),f.text.charAt(f.pos)==="("?Qt(dr,f,!1):f.config.variables!=null&&Object.prototype.hasOwnProperty.call(f.config.variables,dr)?f.config.variables[dr]:f.config.defines!=null&&Object.prototype.hasOwnProperty.call(f.config.defines,dr)?f.config.defines[dr]:dr)}return""}function Kr(f){var d=f.pos,b=f.text.charAt(f.pos);if(!(b>="A"&&b<="Z"||b>="a"&&b<="z"||b==="_"))return"";for(f.pos++;f.pos<f.text.length&&(b=f.text.charAt(f.pos),b>="A"&&b<="Z"||b>="a"&&b<="z"||b>="0"&&b<="9"||b==="_");)f.pos++;return f.text.substring(d,f.pos)}function Ue(f){for(var d=f.pos,b=!1;f.pos<f.text.length;){var E=f.text.charAt(f.pos);if(E>="0"&&E<="9")f.pos++;else if(E==="."&&!b)b=!0,f.pos++;else break}var ur=f.text.substring(d,f.pos),Er=parseFloat(ur);return isNaN(Er)?0:Er}function O(f){var d=f.text.charAt(f.pos);f.pos++;for(var b="";f.pos<f.text.length;){var E=f.text.charAt(f.pos);if(E===d)return f.pos++,b;b+=E,f.pos++}return b}function T(f,d){var b=d.config!=null&&d.config.variables!=null?d.config.variables:{},E=H(f,d.text,d.pos,function(Er){return Q(g(Er,b),b)}),ur=E.pos>d.pos;return d.pos=E.pos,{value:E.value,consumed:ur}}function N(f,d){return d.variables!=null&&Object.prototype.hasOwnProperty.call(d.variables,f)?d.variables[f]:""}function D(f,d){return d.defines!=null&&Object.prototype.hasOwnProperty.call(d.defines,f)?d.defines[f]:""}function K(f,d){return!!(d.defines!=null&&Object.prototype.hasOwnProperty.call(d.defines,f)||d.paramDefines!=null&&Object.prototype.hasOwnProperty.call(d.paramDefines,f))}function P(f){return/^(?:newline|n|breakline|true|false|not|boolval|intval|string|strlen|size|upper|lower|substr|strpos|mod|function_exists|variable_exists|get_variable_value|set_variable_value|call_user_func|lighten|darken|splitstr|splitstr_regex|get_json_keys|get_json_type|json_key_exists|str2json|json_add|json_set|json_remove|json_merge|chr|ord|dec2hex|hex2dec|date|now|random|eval|feature|version|percent|dollar|backslash|tab|and|or|xor|nand|nor|nxor|is_dark|is_light|reverse_color|hsl_color|left_align|right_align|getenv|filename|filename_no_extension|dirpath|filedate|file_exists|xargs|load_json|get_current_theme|get_all_theme|get_all_stdlib|get_stdlib|invoke_procedure|retrieve_procedure)$/.test(f)}var u="1.2026.6";function m(f){var d=String(f??"").replace(/^\s+|\s+$/g,""),b=/^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.exec(d);if(b==null)return null;var E=b[1].length===3?b[1].charAt(0)+b[1].charAt(0)+b[1].charAt(1)+b[1].charAt(1)+b[1].charAt(2)+b[1].charAt(2):b[1];return{r:parseInt(E.substring(0,2),16),g:parseInt(E.substring(2,4),16),b:parseInt(E.substring(4,6),16)}}function G(f){var d=Math.round(Math.max(0,Math.min(255,f))),b=d.toString(16).toUpperCase();return b.length<2?"0"+b:b}function I(f){var d=m(f);return d==null?!1:Math.floor((d.r*299+d.g*587+d.b*114)/1e3)<128}function er(f){var d=m(f);return d==null?String(f??""):"#"+G(255-d.r)+G(255-d.g)+G(255-d.b)}function z(f,d,b,E){var ur=(f%360+360)%360/360,Er=Math.max(0,Math.min(100,d))/100,ke=Math.max(0,Math.min(100,b))/100,dr=ke<.5?ke*(1+Er):ke+Er-Er*ke,Go=2*ke-dr;function lo(Rn,rn,Co){return Co<0&&(Co+=1),Co>1&&(Co-=1),6*Co<1?Rn+(rn-Rn)*6*Co:2*Co<1?rn:3*Co<2?Rn+(rn-Rn)*6*(2/3-Co):Rn}var vo=G(lo(Go,dr,ur+1/3)*255)+G(lo(Go,dr,ur)*255)+G(lo(Go,dr,ur-1/3)*255);return E==null?"#"+vo:("#"+G(Math.round(E*255))+vo).toLowerCase()}var hr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],mr=["January","February","March","April","May","June","July","August","September","October","November","December"];function ne(f,d){var b=null;if(d!=null&&typeof Intl=="object"&&typeof Intl.DateTimeFormat=="function")try{for(var E=new Intl.DateTimeFormat("en-US",{timeZone:d,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}).formatToParts(f),ur={},Er=0;Er<E.length;Er++)ur[E[Er].type]=E[Er].value;b={year:parseInt(ur.year,10),month:parseInt(ur.month,10),day:parseInt(ur.day,10),hours:parseInt(ur.hour,10)%24,minutes:parseInt(ur.minute,10),seconds:parseInt(ur.second,10),millis:f.getMilliseconds(),weekday:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(ur.weekday)};var ke=Date.UTC(b.year,b.month-1,b.day,b.hours,b.minutes,b.seconds);b.offsetMinutes=Math.round((ke-Math.floor(f.getTime()/1e3)*1e3)/6e4)}catch{b=null}return b==null&&(b={year:f.getFullYear(),month:f.getMonth()+1,day:f.getDate(),hours:f.getHours(),minutes:f.getMinutes(),seconds:f.getSeconds(),millis:f.getMilliseconds(),weekday:f.getDay(),offsetMinutes:-f.getTimezoneOffset()}),b}function ye(f,d){for(var b=String(f);b.length<d;)b="0"+b;return b}function Je(f,d,b){var E=ne(d,b),ur="",Er=0;function ke(Rn){var rn=E.offsetMinutes<0?"-":"+",Co=Math.abs(E.offsetMinutes),Dn=ye(Math.floor(Co/60),2),Ve=ye(Co%60,2);return Rn==="z"?b!=null&&/^(?:UTC|GMT|Etc\/UTC|Etc\/GMT)$/i.test(b)?"UTC":"GMT"+rn+Dn+":"+Ve:Rn==="X"?E.offsetMinutes===0?"Z":rn+Dn+(Ve==="00"?"":Ve):rn+Dn+Ve}for(;Er<f.length;){var dr=f.charAt(Er);if(dr==="'"){if(f.charAt(Er+1)==="'"){ur+="'",Er+=2;continue}var Go=f.indexOf("'",Er+1);if(Go<0){ur+=f.substring(Er+1);break}ur+=f.substring(Er+1,Go),Er=Go+1;continue}if(!/[A-Za-z]/.test(dr)){ur+=dr,Er++;continue}for(var lo=Er;lo<f.length&&f.charAt(lo)===dr;)lo++;var vo=lo-Er;switch(Er=lo,dr){case"y":ur+=vo===2?ye(E.year%100,2):ye(E.year,vo);break;case"M":ur+=vo>=4?mr[E.month-1]:vo===3?mr[E.month-1].substring(0,3):ye(E.month,vo);break;case"d":ur+=ye(E.day,vo);break;case"H":ur+=ye(E.hours,vo);break;case"k":ur+=ye(E.hours===0?24:E.hours,vo);break;case"K":ur+=ye(E.hours%12,vo);break;case"h":ur+=ye(E.hours%12===0?12:E.hours%12,vo);break;case"m":ur+=ye(E.minutes,vo);break;case"s":ur+=ye(E.seconds,vo);break;case"S":ur+=ye(E.millis,vo);break;case"E":ur+=vo>=4?hr[E.weekday]:hr[E.weekday].substring(0,3);break;case"a":ur+=E.hours<12?"AM":"PM";break;case"z":case"Z":case"X":ur+=ke(dr);break;default:ur+=f.substring(lo-vo,lo)}}return ur}function _o(f,d){for(var b=[],E="",ur=0;ur<f.length;ur++){var Er=f.charAt(ur);d.indexOf(Er)>=0?E.length>0&&(b.push(E),E=""):E+=Er}return E.length>0&&b.push(E),b}function Oo(f){return Nr(f)?JSON.parse(JSON.stringify(f)):f}function qe(f){if(f==null)return"string";if(Wr(f))return"array";if(Nr(f))return"object";if(typeof f=="number"||typeof f=="boolean")return"number";var d=gr(String(f));return d===void 0?"string":Wr(d)?"array":Nr(d)?"object":d===null?"json":typeof d=="boolean"?"boolean":typeof d=="number"?"number":"string"}function St(f){var d=[],b;if(Wr(f)){for(var E=0;E<f.length;E++)if(Nr(f[E])&&!Wr(f[E]))for(b in f[E])Object.prototype.hasOwnProperty.call(f[E],b)&&d.push(b);return d}if(Nr(f))for(b in f)Object.prototype.hasOwnProperty.call(f,b)&&d.push(b);return d}function ht(f,d,b){for(var E in d)Object.prototype.hasOwnProperty.call(d,E)&&(b&&Nr(f[E])&&!Wr(f[E])&&Nr(d[E])&&!Wr(d[E])&&Object.prototype.hasOwnProperty.call(f,E)?ht(f[E],d[E],!0):f[E]=Oo(d[E]));return f}function nn(f){return typeof f=="number"?f===Math.floor(f)&&f>=0?f:-1:typeof f=="string"&&/^\d+$/.test(f)?parseInt(f,10):-1}function Tt(f,d){var b;try{b=f.split(new RegExp(d))}catch{return[f]}for(;b.length>0&&b[b.length-1]==="";)b.pop();return b}function Lo(f,d){var b=String(f??"").replace(/^\s+|\s+$/g,""),E=/^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.exec(b);if(E==null)return b;var ur=E[1].length===3?E[1].charAt(0)+E[1].charAt(0)+E[1].charAt(1)+E[1].charAt(1)+E[1].charAt(2)+E[1].charAt(2):E[1],Er=parseInt(ur.substring(0,2),16)/255,ke=parseInt(ur.substring(2,4),16)/255,dr=parseInt(ur.substring(4,6),16)/255,Go=Math.min(Er,Math.min(ke,dr)),lo=Math.max(Er,Math.max(ke,dr)),vo=0;lo===Go?vo=0:lo===Er?vo=(60*(ke-dr)/(lo-Go)+360)%360:lo===ke?vo=60*(dr-Er)/(lo-Go)+120:vo=60*(Er-ke)/(lo-Go)+240;var Rn=(lo+Go)/2,rn=0;lo===Go?rn=0:Rn<=.5?rn=(lo-Go)/(lo+Go):rn=(lo-Go)/(2-lo-Go);var Co=Rn*100;Co+=Co*(d/100),Co<0&&(Co=0),Co>100&&(Co=100);var Dn=vo%360/360,Ve=rn,dt=Co/100,$t=dt<.5?dt*(1+Ve):dt+Ve-Ve*dt,Sa=2*dt-$t;function ba(ua,ea,fn){return fn<0&&(fn+=1),fn>1&&(fn-=1),6*fn<1?ua+(ea-ua)*6*fn:2*fn<1?ea:3*fn<2?ua+(ea-ua)*6*(2/3-fn):ua}function sl(ua){var ea=Math.round(Math.max(0,Math.min(1,ua))*255),fn=ea.toString(16).toUpperCase();return fn.length<2?"0"+fn:fn}return"#"+sl(ba(Sa,$t,Dn+1/3))+sl(ba(Sa,$t,Dn))+sl(ba(Sa,$t,Dn-1/3))}function Qt(f,d,b){if(d.pos++,b&&(f==="newline"||f==="n"||f==="breakline"||f==="left_align"||f==="right_align")&&(sr(d),d.text.charAt(d.pos)===")"))return d.pos++,f==="breakline"?`
+`:"\\n";if(b&&(f==="true"||f==="false")&&(sr(d),d.text.charAt(d.pos)===")"))return d.pos++,f==="true";if(b&&P(f)){var E=d.pos-1,ur=A(d.text,E);if(ur<0)return d.supported=!1,d.pos=d.text.length,"";for(var Er=d.text.substring(E+1,ur),ke=s(Er),dr=[],Go=0;Go<ke.length;Go++)dr.push(X(ke[Go],d.config));switch(d.pos=ur+1,f){case"not":return!ae(dr[0]);case"boolval":return ae(dr[0]);case"intval":return parseInt(dr[0],10)||0;case"string":return lr(dr[0]);case"strlen":return lr(dr[0]).length;case"size":{var lo=dr[0];return typeof lo=="number"?0:Wr(lo)?lo.length:Nr(lo)?B(lo).length:lr(lo).length}case"chr":{var vo=Sr(dr[0]);try{return String.fromCodePoint(vo)}catch{return""}}case"ord":{var Rn=lr(dr[0]),rn=Rn.length>0?Rn.codePointAt(0):0;return rn??0}case"dec2hex":{var Co=Sr(dr[0]);return(Co<0?Co>>>0:Math.floor(Co)).toString(16)}case"hex2dec":{var Dn=lr(dr[0]).replace(/^\s+|\s+$/g,"");return/^[+-]?[0-9A-Fa-f]{1,8}$/.test(Dn)?parseInt(Dn,16):0}case"now":return Math.floor(Date.now()/1e3);case"date":{var Ve=dr.length>1?new Date(Sr(dr[1])*1e3):new Date,dt=dr.length>2?lr(dr[2]):null;return dr.length===0?Je("EEE MMM dd HH:mm:ss zzz yyyy",Ve,null):Je(lr(dr[0]),Ve,dt)}case"random":{if(dr.length===0)return Math.floor(Math.random()*2);var $t=dr.length>1?Sr(dr[0]):0,Sa=Sr(dr[dr.length>1?1:0]);return Sa>$t?$t+Math.floor(Math.random()*(Sa-$t)):$t}case"eval":{var ba=w(lr(dr[0]),d.config),sl=Sr(ba);return sl<0?Math.ceil(sl):Math.floor(sl)}case"feature":{var ua=lr(dr[0]).toLowerCase();return ua==="style"||ua==="theme"?1:0}case"version":return u;case"percent":return"%";case"dollar":return"$";case"backslash":return"\\";case"tab":return" ";case"and":case"nand":{for(var ea=!0,fn=0;fn<dr.length;fn++)ae(dr[fn])||(ea=!1);return f==="and"?ea:!ea}case"or":case"nor":{for(var ui=!1,oi=0;oi<dr.length;oi++)ae(dr[oi])&&(ui=!0);return f==="or"?ui:!ui}case"xor":case"nxor":{for(var Zl=0,Ca=0;Ca<dr.length;Ca++)ae(dr[Ca])&&Zl++;return f==="xor"?Zl===1:Zl!==1}case"is_dark":return I(dr[0]);case"is_light":return!I(dr[0]);case"reverse_color":return er(dr[0]);case"hsl_color":return z(Sr(dr[0]),Sr(dr[1]),Sr(dr[2]),dr.length>3?Sr(dr[3])/100:null);case"getenv":case"filename":case"filename_no_extension":case"dirpath":case"filedate":case"xargs":return"";case"file_exists":return!1;case"load_json":return dr.length>1?dr[1]:{};case"get_current_theme":return d.config.themeName!=null?{name:d.config.themeName}:{};case"get_all_theme":return typeof Vf.names=="function"?Vf.names():[];case"get_all_stdlib":return dr.length>0?{}:[];case"get_stdlib":return dr.length>1?"":{};case"invoke_procedure":case"retrieve_procedure":{var Cl=String(dr.shift()||"").replace(/^\$/,"");return d.config.functions==null||!Object.prototype.hasOwnProperty.call(d.config.functions,Cl)||typeof d.config.callUserFunction!="function"?"":d.config.callUserFunction(Cl,dr,{})}case"upper":return lr(dr[0]).toUpperCase();case"lower":return lr(dr[0]).toLowerCase();case"substr":{var Aa=lr(dr[0]),en=Sr(dr[1]);return dr.length>2?Aa.substr(en,Sr(dr[2])):Aa.substr(en)}case"strpos":return lr(dr[0]).indexOf(lr(dr[1]));case"mod":{var xt=Sr(dr[1]);return xt===0?0:Sr(dr[0])%xt}case"function_exists":{var pl=String(dr[0]||"").replace(/^[\$%]/,"");return P(pl)||d.config.functions!=null&&Object.prototype.hasOwnProperty.call(d.config.functions,pl)}case"variable_exists":{var Pl=String(dr[0]||"").replace(/^\$/,"");return d.config.variables!=null&&Object.prototype.hasOwnProperty.call(d.config.variables,Pl)||d.config.defines!=null&&Object.prototype.hasOwnProperty.call(d.config.defines,Pl)||d.config.paramDefines!=null&&Object.prototype.hasOwnProperty.call(d.config.paramDefines,Pl)}case"get_variable_value":{var Oi=String(dr[0]||"").replace(/^\$/,"");return N(Oi,d.config)}case"set_variable_value":{var el=String(dr[0]||"").replace(/^\$/,"");return typeof d.config.setGlobalVariable=="function"&&d.config.setGlobalVariable(el,dr.length>1?dr[1]:""),""}case"call_user_func":{var Rl=String(dr.shift()||"").replace(/^\$/,"");return typeof d.config.callUserFunction=="function"?d.config.callUserFunction(Rl,dr,{}):""}case"lighten":return Lo(dr[0],Sr(dr[1]));case"darken":return Lo(dr[0],-Sr(dr[1]));case"splitstr":return _o(lr(dr[0]),lr(dr[1]));case"splitstr_regex":return Tt(lr(dr[0]),lr(dr[1]));case"get_json_keys":return St(dr[0]);case"get_json_type":return qe(dr[0]);case"json_key_exists":{var $l=dr[0];return!Nr($l)||Wr($l)||typeof dr[1]!="string"?!1:Object.prototype.hasOwnProperty.call($l,dr[1])}case"str2json":{var fa=gr(lr(dr[0]));return fa===void 0?"":fa}case"json_add":case"json_set":{var xa=Oo(dr[0]);if(!Nr(xa))return dr[0];if(Wr(xa)){if(f==="json_add")xa.push(dr[1]);else{var fi=nn(dr[1]);fi>=0&&fi<xa.length&&(xa[fi]=dr[2])}return xa}return f==="json_set"&&dr.length<3?Nr(dr[1])?ht(xa,dr[1],!0):xa:(xa[lr(dr[1])]=dr[2],xa)}case"json_remove":{var en=Oo(dr[0]);if(!Nr(en))return dr[0];if(Wr(en)){var Nl=nn(dr[1]);return Nl>=0&&Nl<en.length&&en.splice(Nl,1),en}return delete en[lr(dr[1])],en}case"json_merge":{var jl=dr[0],ha=dr[1];return!Nr(jl)||!Nr(ha)||Wr(jl)!==Wr(ha)?jl:Wr(jl)?Oo(jl).concat(Oo(ha)):ht(Oo(jl),ha,!1)}}}if(!b&&f==="defined"){sr(d);var Bi=Kr(d);return sr(d),d.text.charAt(d.pos)===")"&&d.pos++,K(Bi,d.config)}if(!b&&d.config.functions!=null&&Object.prototype.hasOwnProperty.call(d.config.functions,f)&&typeof d.config.callUserFunction=="function"){var Ii=d.pos-1,mi=A(d.text,Ii);if(mi<0)return d.supported=!1,d.pos=d.text.length,"";for(var Mi=d.text.substring(Ii+1,mi),qa=d.config.functions[f],Ni=s(Mi),on=[],yi={},xl=0;xl<Ni.length;xl++){var ul=Ni[xl].match(/^\s*\$?([A-Za-z_][\w]*)\s*=(?!=)\s*(.*)$/);ul!=null?yi[ul[1]]=X(ul[2],d.config):on.push(X(Ni[xl],d.config))}return d.pos=mi+1,d.config.callUserFunction(f,on,yi,qa)}for(d.supported=!1,sr(d);d.pos<d.text.length&&d.text.charAt(d.pos)!==")";)oe(d),sr(d),d.text.charAt(d.pos)===","&&(d.pos++,sr(d));return d.text.charAt(d.pos)===")"&&d.pos++,""}function pt(f,d){if(f==null||typeof f!="string")return f;d=d||{};var b={},E={},ur={},Er={};if(d.defines!=null)for(var ke in d.defines)d.defines.hasOwnProperty(ke)&&(b[ke]=d.defines[ke]);if(d.paramDefines!=null)for(var dr in d.paramDefines)d.paramDefines.hasOwnProperty(dr)&&(E[dr]=d.paramDefines[dr]);if(d.functions!=null)for(var Go in d.functions)d.functions.hasOwnProperty(Go)&&(ur[Go]=d.functions[Go]);if(d.variables!=null)for(var lo in d.variables)d.variables.hasOwnProperty(lo)&&(Er[lo]=d.variables[lo]);var vo=d._functionScope||null,Rn=vo!=null?vo.globals:Er,rn=vo!=null?vo.localNames:null,Co=d._preprocessorRuntime;Co==null&&(Co={steps:0,outputChars:0,callDepth:0,maxSteps:d.maxPreprocessorSteps!=null?d.maxPreprocessorSteps:Pt,maxOutputChars:d.maxPreprocessorOutputChars!=null?d.maxPreprocessorOutputChars:We,maxCallDepth:d.maxFunctionCallDepth!=null?d.maxFunctionCallDepth:qt,exhausted:!1,included:{},subs:{},warningKeys:{},warnings:d.preprocessorWarnings||[]}),d._preprocessorRuntime=Co,(d.preprocessorWarnings!=null||vo!=null)&&(d.preprocessorWarnings=Co.warnings);for(var Dn=f.split(`
+`),Ve=[],dt=[],$t=0;$t<Dn.length;$t++)dt.push($t);var Sa=[];function ba(ct,va,aa){for(var Wa=[],tl=0;tl<va.length;tl++)Wa.push(aa);Array.prototype.splice.apply(Dn,[ct,0].concat(va)),Array.prototype.splice.apply(dt,[ct,0].concat(Wa))}function sl(ct){for(var va=-1,aa=0;aa<ct.length;aa++)if(/^\s*@start[A-Za-z]*\b/i.test(ct[aa])){va=aa;break}if(va<0)return ct;for(var Wa=[],tl=va+1;tl<ct.length&&!/^\s*@end[A-Za-z]*\b/i.test(ct[tl]);tl++)Wa.push(ct[tl]);return Wa}function ua(ct){return Q(ct,Er).replace(/^\s+|\s+$/g,"").replace(/^(["'])(.*)\1$/,"$2")}var ea=/C4_(?:Container|Context|Component|Code|Dynamic|Deployment)\.puml$/i;function fn(ct){var va=d.stdlib;if(va==null)return null;for(var aa=ct.replace(/^<|>$/g,""),Wa=[ct,aa,aa.replace(/\.puml$/i,""),aa+".puml"],tl=0;tl<Wa.length;tl++)if(Object.prototype.hasOwnProperty.call(va,Wa[tl])&&typeof va[Wa[tl]]=="string")return{name:"<"+aa+">",lines:sl(Ar(va[Wa[tl]]).split(`
+`))};return null}function ui(ct,va){for(var aa=null,Wa=!1,tl=0;tl<ct.length;tl++){var Ul=ct[tl].match(Gu);if(Ul!=null){Ul[1]===va&&(Wa=!1,aa==null&&(aa=[]));continue}_s.test(ct[tl])&&aa!=null&&(Wa=!0),aa!=null&&!Wa&&aa.push(ct[tl])}return aa}function oi(ct){var va=d.includes;if(va==null)return null;var aa=Q(ct,Er).replace(/^\s+|\s+$/g,"").replace(/^(["'])(.*)\1$/,"$2"),Wa=null;return Object.prototype.hasOwnProperty.call(va,aa)?Wa=va[aa]:aa.lastIndexOf("!")>0&&(aa=aa.substring(0,aa.lastIndexOf("!")),Object.prototype.hasOwnProperty.call(va,aa)&&(Wa=va[aa])),typeof Wa!="string"?null:{name:aa,lines:sl(Ar(Wa).split(`
+`))}}function Zl(ct,va){var aa={code:"preprocessor",message:ct,line:null};va!=null&&va>=0&&(aa.bodyIndex=va),Co.warnings.push(aa),d.preprocessorWarnings=Co.warnings}function Ca(ct,va,aa){Co.warningKeys.hasOwnProperty(ct)||(Co.warningKeys[ct]=!0,Zl(va,aa))}function Cl(ct){return vo==null&&ct!=null&&ct<dt.length?dt[ct]:null}Ve.push=function(ct,va){var aa=ct==null?"":String(ct);if(Co.outputChars+=aa.length+1,Co.outputChars>Co.maxOutputChars)return Co.exhausted=!0,Ca("output-budget","preprocessor output exceeded "+Co.maxOutputChars+" characters"),Ve.length;var Wa=va??(dl<dt.length?dt[dl]:-1),tl=-1;do Sa.push(Wa),tl=aa.indexOf(`
+`,tl+1);while(tl>=0);return Array.prototype.push.call(Ve,ct)};var Aa=[],en=!0,xt=[],pl=!1,Pl=d.maxLoopIterations!=null?d.maxLoopIterations:it,Oi=!1,el=null,Rl=null,$l=null,fa=!1,xa=null,fi=null,Nl=!1,jl=/^(\s*)!\$([A-Za-z_][\w]*)\s*(\??)=\s*(.*)$/,ha=/^\s*!local\s+\$([A-Za-z_][\w]*)\s*(\??)=\s*(.*)$/i,Bi=/^\s*!global\s+\$([A-Za-z_][\w]*)\s*(\??)=\s*(.*)$/i,Ii=/^\s*@(?:start|end)[A-Za-z]*\b/i,mi=/^\s*!define\s+([A-Za-z_][\w]*)\(([^)]*)\)(?:[ \t]+(.*))?$/,Mi=/^\s*!define\s+([A-Za-z_][\w]*)(?:[ \t]+(.*))?$/,qa=/^\s*!undef\s+([A-Za-z_][\w]*)\s*$/,Ni=/^\s*!definelong\s+([A-Za-z_][\w]*)(?:\(([^)]*)\))?\s*$/,on=/^\s*!end\s*(?:definelong|function|procedure)\b/i,yi=/^\s*!((?:(?:unquoted|final)\s+)*)procedure\s+\$?([A-Za-z_][\w]*)(?:\(([^)]*)\))?\s*$/i,xl=on,ul=on,Fl=/^\s*!return\b(.*)$/i,di=/^\s*!if\b(.*)$/,fl=/^\s*!elseif\b(.*)$/,ol=/^\s*!else\s*$/,Al=/^\s*!endif\s*$/,Jl=/^\s*!ifdef\s+([A-Za-z_][\w]*)\s*$/,ki=/^\s*!ifndef\s+([A-Za-z_][\w]*)\s*$/,Di=/^\s*!while\b(.*)$/,bi=/^\s*!endwhile\s*$/,ti=/^\s*!foreach\s+\$([A-Za-z_][\w]*)\s+(?:in|from)\s+(.*)$/,Hi=/^\s*!end(?:for|foreach)\s*$/,Lu=/^\s*!exit\b(.*)$/,Qs=/^\s*!log\b(.*)$/,Li=/^\s*!assert\b(.*)$/,ks=/^\s*!theme\s+(\S+)(?:\s+from\s+(.*?))?\s*$/i,ru=/^\s*!include(_once|_many|url)?\s+(.+?)\s*$/i,Zu=/^\s*!includesub\s+(.+?)\s*$/i,Gu=/^\s*!startsub\s+(\S+)\s*$/i,_s=/^\s*!endsub\b/i,Os=null,hu=-1,Is=C(B(b));function ku(){var ct=$l.join(`
+`);Rl!=null?(E[el]={params:Rl,body:ct},b.hasOwnProperty(el)&&(delete b[el],Is=C(B(b)))):(b[el]=ct,Is=C(B(b)),E.hasOwnProperty(el)&&delete E[el]),Oi=!1,el=null,Rl=null,$l=null}function Gi(ct,va,aa){ur[ct.name]={params:ct.params,body:va.slice(),unquoted:ct.unquoted,procedure:ct.procedure===!0,declarationLine:aa}}function eu(){if(vo!=null)for(var ct in Rn)Rn.hasOwnProperty(ct)&&!rn.hasOwnProperty(ct)&&(Er[ct]=Rn[ct])}function ys(ct,va,aa){if(vo==null){Er[ct]=va;return}if(aa==="global"){Rn[ct]=va,rn.hasOwnProperty(ct)||(Er[ct]=va);return}if(aa==="local"||rn.hasOwnProperty(ct)){rn[ct]=!0,Er[ct]=va;return}if(Rn.hasOwnProperty(ct)){Rn[ct]=va,Er[ct]=va;return}rn[ct]=!0,Er[ct]=va}function cf(ct,va,aa){if(!ur.hasOwnProperty(ct))return"";if(Co.callDepth>=Co.maxCallDepth)return Ca("call-depth","return-function call depth exceeded "+Co.maxCallDepth+" while calling "+ct+"()"),"";var Wa=ur[ct],tl={},Ul={};for(var bu in Rn)Rn.hasOwnProperty(bu)&&(tl[bu]=Rn[bu]);for(var Ns=0;Ns<Wa.params.length;Ns++){var Qu=Wa.params[Ns],rf;aa.hasOwnProperty(Qu.name)?rf=aa[Qu.name]:Ns<va.length?rf=va[Ns]:Qu.defaultExpression!=null?rf=X(Qu.defaultExpression,{defines:b,paramDefines:E,variables:tl,functions:ur,callUserFunction:cf,setGlobalVariable:function(Bf,Id){Rn[Bf]=Id}}):rf="",Ul[Qu.name]=!0,tl[Qu.name]=rf}var ef={defines:b,paramDefines:E,functions:ur,variables:tl,maxLoopIterations:Pl,_preprocessorRuntime:Co,_functionScope:{globals:Rn,localNames:Ul},includes:d.includes,preprocessorWarnings:Co.warnings,preprocessorLogs:d.preprocessorLogs||[]};Co.callDepth++;var Tf;try{Tf=pt(Wa.body.join(`
+`),ef)}finally{Co.callDepth--}return d.preprocessorLogs=ef.preprocessorLogs,Co.warnings.length>0&&(d.preprocessorWarnings=Co.warnings),eu(),Wa.procedure?Tf.split(`
+`).filter(function(Bf){return Bf.length>0}).join(`
+`):ef.functionReturned?ef.functionReturn:""}function $s(){return{defines:b,paramDefines:E,variables:Er,functions:ur,callUserFunction:cf,setGlobalVariable:function(ct,va){ys(ct,va,"global")}}}function hf(ct,va){if(!/^\s*[{[]/.test(ct))return null;var aa=fe(ct,0);if(aa<=0)return null;for(var Wa=ct,tl=va+1;tl<Dn.length;tl++){if(Ii.test(Dn[tl]))return null;var Ul=g(Dn[tl],Er);if(Wa+=Ul,aa=fe(Ul,aa),aa<=0)return{text:Wa,endIdx:tl}}return null}function _u(ct,va,aa,Wa,tl){var Ul=hf(va,Wa),bu=Ul!=null?Ul.text:va;if((!tl||!Er.hasOwnProperty(ct))&&ys(ct,X(bu,$s()),aa),Ve.push(""),Ul==null)return Wa;for(var Ns=Wa+1;Ns<=Ul.endIdx;Ns++)Ve.push("",dt[Ns]);return Ul.endIdx}for(var dl=0;dl<Dn.length&&!Co.exhausted;dl++){if(Co.steps++,Co.steps>Co.maxSteps){Co.exhausted=!0,Ca("step-budget","preprocessor execution exceeded "+Co.maxSteps+" steps");break}var ci=Dn[dl],El=g(ci,Er),at;if((at=ci.match(Gu))!=null){Os!=null&&Ca("startsub-nested:"+at[1],"!startsub "+at[1]+" opens inside !startsub "+Os+' (plantuml.jar answers "Cannot nest sub"); the outer block ends here'),Os=at[1],Co.subs[Os]=[],hu=dl,Ve.push("");continue}if(_s.test(ci)){Os=null,Ve.push("");continue}if(Os!=null&&dl>hu&&(Co.subs[Os].push(ci),hu=dl),fa){if(ul.test(ci)){Nl&&Gi(xa,fi,xa.declarationLine),fa=!1,xa=null,fi=null,Nl=!1,Ve.push("");continue}fi.push(ci),Ve.push("");continue}if(Oi){if(on.test(El)||xl.test(El)){ku(),Ve.push("");continue}$l.push(El),Ve.push("");continue}var us=o(ci);if(us!=null){us.declarationLine=dl+1,us.inlineReturn!=null?en&&Gi(us,["!return "+us.inlineReturn],dl+1):(fa=!0,xa=us,fi=[],Nl=en),Ve.push("");continue}if((at=El.match(di))!=null){var Us=en?ae(w(at[1],$s())):!1;Aa.push({parentOutputting:en,hasMatched:Us}),en=Us,Ve.push("");continue}if((at=El.match(Jl))!=null){var vu=en&&(b.hasOwnProperty(at[1])||E.hasOwnProperty(at[1]));Aa.push({parentOutputting:en,hasMatched:vu}),en=vu,Ve.push("");continue}if((at=El.match(ki))!=null){var Cu=en&&!(b.hasOwnProperty(at[1])||E.hasOwnProperty(at[1]));Aa.push({parentOutputting:en,hasMatched:Cu}),en=Cu,Ve.push("");continue}if((at=El.match(fl))!=null){if(Aa.length>0){var pu=Aa[Aa.length-1];if(pu.hasMatched)en=!1;else{var ju=pu.parentOutputting?ae(w(at[1],$s())):!1;ju?(pu.hasMatched=!0,en=!0):en=!1}}Ve.push("");continue}if(ol.test(El)){if(Aa.length>0){var bs=Aa[Aa.length-1];bs.hasMatched?en=!1:(bs.hasMatched=!0,en=bs.parentOutputting)}Ve.push("");continue}if(Al.test(El)){if(Aa.length>0){var Fs=Aa.pop();en=Fs.parentOutputting}Ve.push("");continue}if((at=El.match(Di))!=null){var Ki=en,wu={type:"while",startIdx:dl,cond:at[1],iters:0,outerOutputting:Ki,active:!1};if(Ki){var ou=ae(w(at[1],$s()));wu.active=ou,en=ou}xt.push(wu),Ve.push("");continue}if(bi.test(El)){var rs=xt.length>0&&xt[xt.length-1].type==="while"?xt[xt.length-1]:null;if(rs==null){Ve.push("");continue}if(!rs.active){en=rs.outerOutputting,xt.pop(),Ve.push("");continue}if(rs.iters++,rs.iters>=Pl){Zl("!while exceeded "+Pl+" iterations",Cl(rs.startIdx)),en=rs.outerOutputting,xt.pop(),Ve.push("");continue}var Le=Dn[rs.startIdx],Kt=g(Le,Er).match(Di),zt=Kt!=null?Kt[1]:"",Fa=ae(w(zt,$s()));if(Fa){Ve.push(""),dl=rs.startIdx;continue}en=rs.outerOutputting,xt.pop(),Ve.push("");continue}if((at=El.match(ti))!=null){var wn=en,Pn=at[1],Kl=a(at[2],$s()),Ya={type:"foreach",startIdx:dl,varName:Pn,list:Kl,index:0,iters:0,outerOutputting:wn,active:!1};wn&&Kl.length>0?(ys(Pn,Kl[0],null),Ya.active=!0,en=!0):en=!1,xt.push(Ya),Ve.push("");continue}if(Hi.test(El)){var _l=xt.length>0&&xt[xt.length-1].type==="foreach"?xt[xt.length-1]:null;if(_l==null){Ve.push("");continue}if(!_l.active){en=_l.outerOutputting,xt.pop(),Ve.push("");continue}if(_l.iters++,_l.index++,_l.iters>=Pl){Zl("!foreach exceeded "+Pl+" iterations",Cl(_l.startIdx)),en=_l.outerOutputting,xt.pop(),Ve.push("");continue}if(_l.index<_l.list.length){ys(_l.varName,_l.list[_l.index],null),Ve.push(""),dl=_l.startIdx;continue}en=_l.outerOutputting,xt.pop(),Ve.push("");continue}if(!en){Ve.push("");continue}if((at=El.match(ru))!=null){var Ui=at[1]==null?"":at[1].toLowerCase(),ni=ua(at[2]),fs=null,Ou=Cl(dl);if(Ui==="url"||/^https?:\/\//i.test(ni)){if(!d.allowUrlIncludes){Ca("include-url:"+ni,'!include of URL "'+ni+'" is not loaded: remote includes are disabled (config.allowUrlIncludes) and the browser cannot fetch them; nothing is included here',Ou),Ve.push("");continue}if(fs=oi(ni),fs==null){Ca("include-url-missing:"+ni,'!include of URL "'+ni+'" was not provided in config.includes; nothing is included here',Ou),Ve.push("");continue}}else if(/^<.*>$/.test(ni)){if(fs=fn(ni),fs==null){var vf=ni.substring(1).split("/")[0].replace(/>$/,"");/^(?:c4|archimate)$/i.test(vf)||Ca("stdlib:"+vf.toLowerCase(),"stdlib module "+ni+" is not bundled in this converter (only C4 and ArchiMate are implemented, natively); its macros are left unexpanded \u2014 a host can provide the module text in config.stdlib",Ou)}}else fs=oi(ni),fs==null&&!ea.test(ni)&&Ca("include:"+ni,'"'+ni+'" could not be included: this converter has no access to files, so its content is missing (plantuml.jar answers "cannot include '+ni+'")',Ou);if(fs!=null){if(Ui!=="_many"&&Co.included.hasOwnProperty(fs.name)){Ui==="_once"&&Ca("include-once:"+fs.name,'"'+fs.name+'" has already been included; this !include_once is ignored (plantuml.jar answers "This file has already been included")',Ou),Ve.push("");continue}Co.included[fs.name]=!0,ba(dl+1,fs.lines,dt[dl]),Ve.push("");continue}}if((at=El.match(Zu))!=null){var cl=ua(at[1]),Es=null,Ju=cl.indexOf("!");if(Ju>0&&d.includes!=null){var Fd=cl.substring(0,Ju),Ed=Object.prototype.hasOwnProperty.call(d.includes,Fd)?d.includes[Fd]:null;typeof Ed=="string"&&(Es=ui(Ar(Ed).split(`
+`),cl.substring(Ju+1)))}if(Es==null&&Ju<0&&Co.subs.hasOwnProperty(cl)&&(Es=Co.subs[cl]),Es==null){Ca("includesub:"+cl,"!includesub "+cl+": no such block"+(Ju>0&&(d.includes==null||!Object.prototype.hasOwnProperty.call(d.includes,cl.substring(0,Ju)))?" (the file is not in config.includes)":"")+' (plantuml.jar answers "cannot include '+cl+'"); nothing is included here',Cl(dl)),Ve.push("");continue}ba(dl+1,Es,dt[dl]),Ve.push("");continue}if((at=El.match(ks))!=null){var Pu=Q(at[1],Er).replace(/^["']|["']$/g,""),Sd=at[2]==null?Vf.get(Pu):null;if(Sd==null){Ca("theme:"+Pu.toLowerCase(),'theme "'+Pu+'" is not bundled'+(at[2]!=null?" (external themes are not loaded)":"")+"; the default look is used"),Ve.push("");continue}var Oc=Sd.split(`
+`);d.themesApplied=d.themesApplied||[],d.themesApplied.indexOf(Pu)<0&&d.themesApplied.push(Pu),ba(dl+1,Oc,dt[dl]),Ve.push("");continue}if(vo!=null&&(at=El.match(Fl))!=null){var Dd=at[1].replace(/^\s+|\s+$/g,"");d.functionReturn=Dd.length>0?w(Dd,$s()):"",d.functionReturned=!0,Ve.push("");break}if(Lu.test(El)){pl=!0,Ve.push("");break}if((at=El.match(Qs))!=null){var od=at[1].replace(/^\s+|\s+$/g,""),yc=od.length>0?w(od,$s()):"";d.preprocessorLogs=d.preprocessorLogs||[],d.preprocessorLogs.push(lr(yc)),Ve.push("");continue}if((at=El.match(Li))!=null){var Vu=at[1].replace(/^\s+|\s+$/g,""),bc=Vu.length>0?w(Vu,$s()):!1;ae(bc)||Zl("!assert failed: "+Vu,Cl(dl)),Ve.push("");continue}if((at=El.match(ha))!=null){dl=_u(at[1],at[3],"local",dl,at[2]==="?");continue}if((at=El.match(Bi))!=null){dl=_u(at[1],at[3],"global",dl,at[2]==="?");continue}if((at=El.match(jl))!=null){dl=_u(at[2],at[4],null,dl,at[3]==="?");continue}if((at=El.match(Ni))!=null){Oi=!0,el=at[1],Rl=at[2]!=null?y(at[2]):null,$l=[],Ve.push("");continue}if((at=ci.match(yi))!=null){fa=!0,xa={name:at[2],params:k(at[3]||""),unquoted:/unquoted/i.test(at[1]||""),inlineReturn:null,procedure:!0,declarationLine:dl+1},fi=[],Nl=en,Ve.push("");continue}if((at=El.match(mi))!=null){var td=at[1],Td=at[3]!=null?at[3].replace(/\s+$/,""):"";E[td]={params:y(at[2]),body:Td},b.hasOwnProperty(td)&&(delete b[td],Is=C(B(b))),Ve.push("");continue}if((at=El.match(Mi))!=null){var Fc=at[2]!=null?at[2].replace(/\s+$/,""):"";b[at[1]]=Fc,Is=C(B(b)),E.hasOwnProperty(at[1])&&delete E[at[1]],Ve.push("");continue}if((at=El.match(qa))!=null){b.hasOwnProperty(at[1])&&(delete b[at[1]],Is=C(B(b))),E.hasOwnProperty(at[1])&&delete E[at[1]],Ve.push("");continue}var xu=v(El,ur,$s());xu=R(xu,$s()),xu=n(xu,E),xu=$(xu,b,Is),Ve.push(Q(xu,Er))}fa&&Nl&&Gi(xa,fi,xa.declarationLine),Oi&&ku(),pl&&(d.exited=!0),d.defines==null&&(d.defines={});for(var tu in d.defines)d.defines.hasOwnProperty(tu)&&!b.hasOwnProperty(tu)&&delete d.defines[tu];for(var yu in b)b.hasOwnProperty(yu)&&(d.defines[yu]=b[yu]);d.paramDefines==null&&(d.paramDefines={});for(var Df in d.paramDefines)d.paramDefines.hasOwnProperty(Df)&&!E.hasOwnProperty(Df)&&delete d.paramDefines[Df];for(var Bd in E)E.hasOwnProperty(Bd)&&(d.paramDefines[Bd]=E[Bd]);d.functions==null&&(d.functions={});for(var nd in ur)ur.hasOwnProperty(nd)&&(d.functions[nd]=ur[nd]);d.variables==null&&(d.variables={});for(var Yu in Er)Er.hasOwnProperty(Yu)&&(d.variables[Yu]=Er[Yu]);var es=Ve.join(`
+`);return Sa.length===0&&Sa.push(-1),d.preprocessorLineMap=Sa,vo==null&&!d._preserveRuntime&&delete d._preprocessorRuntime,es}var So=16,it=1024,qt=64,Pt=5e5,We=32*1024*1024;function pn(f,d){if(d==null)return f;if(f==null)return d.slice();for(var b=[],E=0;E<d.length;E++){var ur=d[E];b.push(ur>=0&&ur<f.length?f[ur]:-1)}return b}function ra(f){var d=f.defines;if(d!=null)for(var b in d)d.hasOwnProperty(b)&&new RegExp("(?:^|[^\\w$])"+_(b)+"(?![\\w])").test(d[b])&&delete d[b]}function Gn(f,d,b){if(!(f==null||b==null))for(var E=d;E<f.length;E++){var ur=f[E];ur!=null&&typeof ur=="object"&&ur.bodyIndex!=null&&(ur.bodyIndex=ur.bodyIndex>=0&&ur.bodyIndex<b.length?b[ur.bodyIndex]:-1)}}function Xe(f,d){if(f==null||typeof f!="string")return f;d=d||{},delete d._preprocessorRuntime,d._preserveRuntime=!0;for(var b=f,E=null,ur=0,Er=null,ke=d.preprocessorWarnings!=null?d.preprocessorWarnings.length:0;b!==E&&ur<So;)E=b,b=Mr(b),b=pt(b,d),Gn(d.preprocessorWarnings,ke,Er),ke=d.preprocessorWarnings!=null?d.preprocessorWarnings.length:0,Er=pn(Er,d.preprocessorLineMap),ra(d),ur++;if(delete d._preprocessorRuntime,delete d._preserveRuntime,d.preprocessorLineMap=Er,b!==E)throw new Error("PlantUmlPreprocessor: expansion did not converge after "+So+" iterations (possible cycle in defines / variables)");return b}return{run:Xe,stripComments:Mr,expandVariables:M,expandDefines:L,expandDirectives:pt,evaluateExpression:w,parseScalarValue:Yr,normaliseLineEndings:Ar}})();var Sf=(function(){var Ar={ditaa:{wrapper:"@startditaa",grounds:["licence","out-of-domain"],summary:"ditaa is a separate LGPL-licensed project, not PlantUML diagram syntax",detail:`ditaa ("DIagrams Through Ascii Art") is an independent tool by Efstathios Sideris that converts ASCII-art drawings into bitmaps. Its sources are present in the plantuml-asl jar under org/stathissideris/ascii2image/, but each file carries an intact LGPL-3.0-or-later notice from its author underneath the Apache-2.0 header that upstream's build prepends \u2014 conflicting notices this port will not rely on. Upstream's own Apache build refuses @startditaa for the same reason. Nothing about it is PlantUML diagram language.`},dot:{wrapper:"@startdot",grounds:["out-of-domain"],summary:"DOT is GraphViz's own language, rendered by a layout engine this port does not ship",detail:"A @startdot block is raw GraphViz DOT passed straight through to GraphViz \u2014 a different language with its own grammar and its own layout engine. PlantUML delegates it either to a native dot binary or to Smetana, its Java translation of GraphViz. This port is browser JavaScript with no GraphViz available and no intention of carrying a layout engine, so there is nothing to render DOT with. Supporting it would mean porting GraphViz, not PlantUML."},jcckit:{wrapper:"@startjcckit",grounds:["licence","out-of-domain"],summary:"JCCKit is a separate charting library, and upstream has removed it",detail:'JCCKit is an independent Java charting toolkit that PlantUML once bundled to draw plots. It is gone from the 1.2026.6 artifacts entirely \u2014 neither edition contains it, and upstream answers @startjcckit with "Diagram not supported by this release of PlantUML". Its licensing has the same third-party-relabelling problem as ditaa, and charting is not the PlantUML diagram language, so there is nothing here worth reviving.'},sudoku:{wrapper:"@startsudoku",grounds:["out-of-domain"],summary:"a Sudoku generator is not a diagram language feature, and upstream has removed it",detail:'PlantUML could once generate Sudoku grids. It is gone from the 1.2026.6 artifacts \u2014 upstream answers @startsudoku with "Diagram not supported by this release of PlantUML" \u2014 so its licensing could not be re-verified from the artifacts, and it does not matter: a puzzle generator has nothing to do with drawing diagrams from a modelling language.'}},Z={};for(var Mr in Ar)Object.prototype.hasOwnProperty.call(Ar,Mr)&&(Z[Ar[Mr].wrapper]=Mr);function Yr(Y){return Y!=null&&Object.prototype.hasOwnProperty.call(Ar,Y)}function fe(Y){if(!Yr(Y))return null;var Cr=Ar[Y];return{type:Y,wrapper:Cr.wrapper,grounds:Cr.grounds.slice(),summary:Cr.summary,detail:Cr.detail}}function Wr(Y){return Y!=null&&Object.prototype.hasOwnProperty.call(Z,Y)?Z[Y]:null}function Nr(){var Y=[];for(var Cr in Ar)Object.prototype.hasOwnProperty.call(Ar,Cr)&&Y.push(Cr);return Y.sort()}function lr(Y){var Cr=fe(Y);if(Cr==null)return new Error('PlantUML: no parser registered for type "'+Y+'"');var V=new Error("PlantUML: "+Cr.wrapper+" is not supported");return V.plantUmlUnsupported=!0,V.diagramType=Y,V.grounds=Cr.grounds,V}return{FAMILIES:Ar,isUnsupported:Yr,describe:fe,typeForWrapper:Wr,list:Nr,unsupportedError:lr}})();var ac=(function(){var Ar={};function Z(U,H){var J=Array.prototype.slice.call(arguments,2),gr=U.toLowerCase();Ar.hasOwnProperty(gr)||(Ar[gr]=[]),Ar[gr].push({names:J,prop:H})}function Mr(U){var H=Array.prototype.slice.call(arguments,1);Z.apply(null,[U+"FontSize","FontSize"].concat(H)),Z.apply(null,[U+"FontStyle","FontStyle"].concat(H)),Z.apply(null,[U+"FontColor","FontColor"].concat(H)),Z.apply(null,[U+"FontName","FontName"].concat(H))}function Yr(U){var H=U.replace(/_/g,"");Z(H+"BackgroundColor","BackGroundColor",U),Z(H+"BorderColor","LineColor",U),Z(H+"BorderThickness","LineThickness",U),Z(H+"RoundCorner","RoundCorner",U),Z(H+"DiagonalCorner","DiagonalCorner",U),Z(H+"BorderStyle","LineStyle",U),Mr(H,U),Z(H+"Shadowing","Shadowing",U),Z(H+"StereotypeFontSize","FontSize","stereotype",U),Z(H+"StereotypeFontStyle","FontStyle","stereotype",U),Z(H+"StereotypeFontColor","FontColor","stereotype",U),Z(H+"StereotypeFontName","FontName","stereotype",U)}Z("participantClickableBackgroundColor","BackGroundColor","participant","clickable"),Z("participantClickableBorderColor","LineColor","participant","clickable"),Yr("participant"),Yr("boundary"),Yr("control"),Yr("collections"),Yr("actor"),Yr("database"),Yr("entity"),Mr("header","document","header"),Mr("footer","document","footer"),Mr("caption","document","caption"),Z("defaultFontSize","FontSize","element"),Z("sequenceStereotypeFontSize","FontSize","stereotype"),Z("sequenceStereotypeFontStyle","FontStyle","stereotype"),Z("sequenceStereotypeFontColor","FontColor","stereotype"),Z("sequenceStereotypeFontName","FontName","stereotype"),Z("SequenceReferenceBorderColor","LineColor","reference"),Z("SequenceReferenceBorderColor","LineColor","referenceHeader"),Z("SequenceReferenceBackgroundColor","BackGroundColor","reference"),Z("sequenceReferenceHeaderBackgroundColor","BackGroundColor","referenceHeader"),Mr("sequenceReference","reference"),Mr("sequenceReference","referenceHeader"),Z("sequenceGroupBorderThickness","LineThickness","group"),Z("SequenceGroupBorderColor","LineColor","group"),Z("SequenceGroupBorderColor","LineColor","groupHeader"),Z("SequenceGroupBackgroundColor","BackGroundColor","groupHeader"),Mr("SequenceGroup","group"),Mr("SequenceGroupHeader","groupHeader"),Z("SequenceBoxBorderColor","LineColor","box"),Z("SequenceBoxBackgroundColor","BackGroundColor","box"),Z("SequenceBoxFontColor","FontColor","box"),Z("SequenceLifeLineBorderColor","LineColor","lifeLine"),Z("SequenceLifeLineBackgroundColor","BackGroundColor","activationBox"),Mr("sequenceDelay","delay"),Z("sequenceDelayBorderColor","LineColor","delay"),Z("sequenceDividerBackgroundColor","BackGroundColor","separator"),Z("sequenceDividerBorderColor","LineColor","separator"),Mr("sequenceDivider","separator"),Z("sequenceDividerBorderThickness","LineThickness","separator"),Z("SequenceMessageAlignment","HorizontalAlignment","arrow"),Mr("note","note"),Z("noteBorderThickness","LineThickness","note"),Z("noteBorderColor","LineColor","note"),Z("noteBackgroundColor","BackGroundColor","note"),Z("packageBackgroundColor","BackGroundColor","group"),Z("packageBorderColor","LineColor","group"),Yr("package"),Z("PartitionBorderColor","LineColor","composite"),Z("PartitionBackgroundColor","BackGroundColor","composite"),Mr("Partition","composite"),Z("hyperlinkColor","HyperLinkColor","root"),Z("activityStartColor","BackGroundColor","circle","start"),Z("activityEndColor","LineColor","circle","end"),Z("activityStopColor","LineColor","circle","stop"),Z("activityBarColor","BackGroundColor","activityBar"),Z("activityBorderColor","LineColor","activity"),Z("activityBorderThickness","LineThickness","activity"),Z("activityBackgroundColor","BackGroundColor","activity"),Mr("activity","activity"),Z("activityDiamondBackgroundColor","BackGroundColor","diamond"),Z("activityDiamondBorderColor","LineColor","diamond"),Mr("activityDiamond","diamond"),Mr("arrow","arrow"),Z("arrowThickness","LineThickness","arrow"),Z("arrowColor","LineColor","arrow"),Z("arrowStyle","LineStyle","arrow"),Z("arrowHeadColor","HeadColor","arrow"),Z("defaulttextalignment","HorizontalAlignment","root"),Z("defaultFontName","FontName","root"),Z("defaultFontColor","FontColor","root"),Mr("SwimlaneTitle","swimlane"),Z("SwimlaneTitleBackgroundColor","BackGroundColor","swimlane"),Z("SwimlaneBorderColor","LineColor","swimlane"),Z("SwimlaneBorderThickness","LineThickness","swimlane"),Z("roundCorner","RoundCorner","root"),Z("titleBorderThickness","LineThickness","title"),Z("titleBorderColor","LineColor","title"),Z("titleBackgroundColor","BackGroundColor","title"),Z("titleBorderRoundCorner","RoundCorner","title"),Mr("title","document","title"),Z("legendBorderThickness","LineThickness","legend"),Z("legendBorderColor","LineColor","legend"),Z("legendBackgroundColor","BackGroundColor","legend"),Z("legendBorderRoundCorner","RoundCorner","legend"),Mr("legend","legend"),Z("noteTextAlignment","HorizontalAlignment","note"),Z("BackgroundColor","BackGroundColor","document"),Z("classBackgroundColor","BackGroundColor","element","class"),Z("classBorderColor","LineColor","element","class"),Z("classFontSize","FontSize","element","class","header"),Z("classFontStyle","FontStyle","element","class","header"),Z("classFontColor","FontColor","element","class","header"),Z("classFontName","FontName","element","class","header"),Z("classAttributeFontSize","FontSize","element","class"),Z("classAttributeFontStyle","FontStyle","element","class"),Z("classAttributeFontColor","FontColor","element","class"),Z("classAttributeFontName","FontName","element","class"),Z("classBorderThickness","LineThickness","element","class"),Z("classHeaderBackgroundColor","BackGroundColor","element","class","header"),Z("objectBackgroundColor","BackGroundColor","object"),Z("objectBorderColor","LineColor","object"),Mr("object","object"),Mr("objectAttribute","object"),Z("objectBorderThickness","LineThickness","object"),Z("stateBackgroundColor","BackGroundColor","state"),Z("stateBorderColor","LineColor","state"),Mr("state","state"),Mr("stateAttribute","state"),Z("stateBorderThickness","LineThickness","state"),Yr("agent"),Yr("artifact"),Yr("card"),Yr("interface"),Yr("cloud"),Yr("component"),Yr("file"),Yr("folder"),Yr("frame"),Yr("hexagon"),Yr("node"),Yr("person"),Yr("queue"),Yr("rectangle"),Yr("stack"),Yr("storage"),Yr("usecase"),Yr("map"),Yr("archimate"),Yr("hnote"),Yr("rnote"),Z("IconPrivateColor","LineColor","visibilityIcon","private"),Z("IconPrivateBackgroundColor","BackGroundColor","visibilityIcon","private"),Z("IconPackageColor","LineColor","visibilityIcon","package"),Z("IconPackageBackgroundColor","BackGroundColor","visibilityIcon","package"),Z("IconProtectedColor","LineColor","visibilityIcon","protected"),Z("IconProtectedBackgroundColor","BackGroundColor","visibilityIcon","protected"),Z("IconPublicColor","LineColor","visibilityIcon","public"),Z("IconPublicBackgroundColor","BackGroundColor","visibilityIcon","public"),Z("MinClassWidth","MinimumWidth"),Z("wrapWidth","MaximumWidth","element"),Z("HyperlinkUnderline","HyperlinkUnderlineThickness","element"),Z("StereotypeAlignment","HorizontalAlignment","stereotype"),Z("stereotypeABackgroundColor","BackGroundColor","spotAbstractClass"),Z("stereotypeABorderColor","LineColor","spotAbstractClass"),Z("stereotypeCBackgroundColor","BackGroundColor","spotClass"),Z("stereotypeCBorderColor","LineColor","spotClass"),Z("stereotypeEBackgroundColor","BackGroundColor","spotEnum"),Z("stereotypeEBorderColor","LineColor","spotEnum"),Z("stereotypeIBackgroundColor","BackGroundColor","spotInterface"),Z("stereotypeIBorderColor","LineColor","spotInterface"),Z("stereotypeNBackgroundColor","BackGroundColor","spotAnnotation"),Z("stereotypeNBorderColor","LineColor","spotAnnotation"),Z("stereotypeRBackgroundColor","BackGroundColor","spotRecord"),Z("stereotypeRBorderColor","LineColor","spotRecord"),Z("stereotypeDBackgroundColor","BackGroundColor","spotDataClass"),Z("stereotypeDBorderColor","LineColor","spotDataClass");var fe=/<<(.*?)>>/g;function Wr(U){U=String(U).replace(/^\s+|\s+$/g,"").toLowerCase(),U=U.replace(/_|\./g,""),U=U.replace(/sequence(participant|actor)/g,"$1"),U=U.replace(/(activity|class|component|object|sequence|state|usecase)arrow/g,"arrow"),U=U.replace(/align$/,"alignment");var H=[],J;for(fe.lastIndex=0;(J=fe.exec(U))!=null;)H.push(U.replace(/<<(.*?)>>/g,"")+"<<"+J[1]+">>");return H.length===0&&H.push(U),H}function Nr(U){var H=U.toLowerCase();return H==="false"||H==="no"?"0":H==="true"||H==="yes"?"3":U}function lr(U){return U.indexOf(";")>=0||U.indexOf("text:")===0}function Y(U,H,J){var gr=null;if(U.indexOf("<<")>=0){var X=U.split(/[<>]+/);U=X[0],gr=X.length>1&&X[1]!=null?X[1].replace(/^\s+|\s+$/g,""):null}var g=gr?gr.split("&"):[];function M(o,a,t){var n={};n[o]=a,J.addRule(t,g,n)}H=String(H),/shadowing$/.test(U)?H.toLowerCase()==="false"?H="0":H.toLowerCase()==="true"&&(H="3"):U==="hyperlinkunderline"&&(H.toLowerCase()==="false"&&(H="0"),H.toLowerCase()==="true"&&(H="1")),H.toLowerCase()==="right:right"&&(H="right"),H.toLowerCase()==="dotted"&&(H="1;3"),H.toLowerCase()==="dashed"&&(H="7;7");var _=Ar[U.toLowerCase()];if(_==null){U==="shadowing"?M("Shadowing",Nr(H),["root"]):U==="noteshadowing"&&M("Shadowing",Nr(H),["root","note"]);return}function C(o){var a;if(o.indexOf("text:")===0){var t=o.split(":")[1];for(a=0;a<_.length;a++)M("FontColor",t,_[a].names)}else if(o.indexOf("line.dotted")===0)for(a=0;a<_.length;a++)M("LineStyle","1;3",_[a].names);else if(o.indexOf("line.dashed")===0)for(a=0;a<_.length;a++)M("LineStyle","7;7",_[a].names);else if(o.toLowerCase().indexOf("bold")>=0)for(a=0;a<_.length;a++)M("LineThickness","2",_[a].names)}if(lr(H))if(H.indexOf(";")>=0){H.charAt(0)===";"&&(H=" "+H);for(var $=H.split(";"),y=[],A=0;A<$.length;A++)$[A].length>0&&y.push($[A]);H=y.length>0?y[0]:" ";for(var s=1;s<y.length;s++)C(y[s])}else{C(H);return}if(H!==" ")for(var k=0;k<_.length;k++)M(_[k].prop,H,_[k].names)}function Cr(U,H,J){for(var gr=Wr(U),X=String(H??"").replace(/^\s+|\s+$/g,""),g=0;g<gr.length;g++)J.skinparams[gr[g]]=X,Y(gr[g],X,J)}function V(U){return Ar.hasOwnProperty(String(U).toLowerCase().replace(/<<.*$/,""))}return{cleanKeys:Wr,apply:Cr,isKnown:V}})();var Ft=(function(){for(var Ar=["Shadowing","FontName","FontColor","FontSize","FontStyle","FontWeight","BackGroundColor","RoundCorner","LineThickness","DiagonalCorner","HyperLinkColor","HyperlinkUnderlineStyle","HyperlinkUnderlineThickness","HeadColor","LineColor","LineStyle","Padding","Margin","MaximumWidth","MinimumWidth","ExportedName","Image","HorizontalAlignment","ShowStereotype","ImagePosition","MarkerShape","MarkerSize","MarkerColor","BarWidth","Width"],Z={},Mr=0;Mr<Ar.length;Mr++)Z[Ar[Mr].toLowerCase()]=Ar[Mr];for(var Yr="action activationBox activity activityBar activityDiagram actor agent analog archimate arrow artifact binary body boundary box boxless business caption card cardinality circle classDiagram class clickable cloud closed collection collections component composite robust chenAttribute chenEerDiagram chenEntity chenRelationship concise clock componentDiagram constraintArrow control database day delay description destroy diamond document ebnf element entity end start stop file filesDiagram folder footer frame ganttDiagram generic goto group groupHeader header hexagon highlight hnote interface json jsonDiagram gitDiagram label leafNode legend lifeLine mainframe map milestone mindmapDiagram month name network newpage node note nwdiagDiagram packetdiagDiagram objectDiagram object package participant partition person port process qualified queue rectangle reference referenceHeader regex requirement rnote root rootNode saltDiagram separator sequenceDiagram server stack stateDiagram state stateBody stereotype storage swimlane task timegrid timeline timingDiagram title undone unstarted usecase verticalSeparator year visibilityIcon private protected public IEMandatory spot spotAnnotation spotInterface spotEnum spotProtocol spotStruct spotEntity spotException spotClass spotAbstractClass spotMetaClass spotStereotype spotDataClass spotRecord wbsDiagram yamlDiagram chartDiagram bar line area scatter axis hAxis vAxis grid annotation".split(" "),fe={},Wr=0;Wr<Yr.length;Wr++)fe[Yr[Wr].toLowerCase()]=!0;function Nr(u){var m=String(u).replace(/_/g,"").toLowerCase();return fe.hasOwnProperty(m)?m:null}function lr(u){return String(u).replace(/[_.]/g,"").toLowerCase()}function Y(){return{names:{},level:-1,starred:!1,stereotypes:{},withDot:!1}}function Cr(u){var m={},G={},I;for(I in u.names)u.names.hasOwnProperty(I)&&(m[I]=!0);for(I in u.stereotypes)u.stereotypes.hasOwnProperty(I)&&(G[I]=!0);return{names:m,level:u.level,starred:u.starred,stereotypes:G,withDot:u.withDot}}function V(u,m,G,I){var er=Y(),z;for(z=0;z<u.length;z++){var hr=Nr(u[z]);hr!=null&&(er.names[hr]=!0)}if(er.level=m??-1,G!=null)for(z=0;z<G.length;z++)er.stereotypes[lr(G[z])]=!0;return er.starred=!!I,er}function U(u,m){var G;if(u.level!==-1){if(u.starred){if(m.level===-1||m.level<u.level)return!1}else if(m.level===-1||m.level!==u.level)return!1}if(m.starred&&!u.starred)return!1;for(G in u.names)if(u.names.hasOwnProperty(G)&&!m.names[G])return!1;for(G in u.stereotypes)if(u.stereotypes.hasOwnProperty(G)&&!m.stereotypes[G])return!1;return!0}var H=1,J=2,gr=3,X=4,g=5,M=6,_=7,C=8,$=9;function y(u){var m=String(u),G=m.length,I=0,er=[];function z(St){for(;I<G;){if(m.charAt(I)===St){I++;return}I++}}function hr(St,ht){for(;I<G;){if(m.charAt(I)===St&&m.charAt(I+1)===ht){I+=2;return}I++}}for(;I<G;){var mr=m.charAt(I),ne=m.charAt(I+1);if(mr===" "||mr===" ")I++;else if(mr==="/"&&ne==="/")z(`
+`);else if(mr==="/"&&ne==="'")hr("'","/");else if(mr==="/"&&ne==="*")hr("*","/");else if(mr===",")er.push({type:J,data:","}),I++;else if(mr===";")er.push({type:gr,data:";"}),I++;else if(mr===`
+`||mr==="\r")er.push({type:X,data:"NEWLINE"}),I++;else if(mr==="*")er.push({type:g,data:"*"}),I++;else if(mr===":")er.push({type:M,data:":"}),I++;else if(mr==="{")er.push({type:_,data:"{"}),I++;else if(mr==="}")er.push({type:C,data:"}"}),I++;else if(mr==="@"){I++;for(var ye="";I<G;){var Je=m.charAt(I);if(I++,Je==="{"||Je==="}"||Je===";")break;ye+=Je}er.push({type:$,data:ye})}else if(mr==='"'){I++;for(var _o="";I<G&&m.charAt(I)!=='"';)_o+=m.charAt(I),I++;m.charAt(I)==='"'&&I++,er.push({type:H,data:_o})}else{for(var Oo="";I<G;){var qe=m.charAt(I);if(qe===`
+`||qe==="\r"||qe===" "&&Oo.charAt(0)!=="."||qe==="{"||qe==="}"||qe===";"||qe===","||qe===":"||qe===" ")break;Oo+=qe,I++}Oo.charAt(0)==="."&&(Oo=Oo.replace(/^\s+|\s+$/g,"")),er.push({type:H,data:Oo})}}return er}function A(u,m){this.parent=u,this.signatures=m,this.map={}}function s(u,m){m.charAt(0)===":"&&(m=m.substring(1));var G=!1;m.charAt(m.length-1)==="*"&&(m=m.substring(0,m.length-1).replace(/^\s+|\s+$/g,""),G=!0);for(var I=m.split(","),er=new A(u,[]),z=0;z<I.length;z++)for(var hr=I[z],mr=0;mr<u.signatures.length;mr++){var ne=Cr(u.signatures[mr]);if(hr.charAt(0)===".")ne.stereotypes[lr(hr)]=!0,ne.withDot=!0;else if(hr.indexOf("depth(")===0)ne.level=parseInt(hr.replace(/\D/g,""),10);else{var ye=Nr(hr);ye==null?(ne.stereotypes[lr(hr)]=!0,ne.withDot=!0):ne.names[ye]=!0}G&&(ne.starred=!0),er.signatures.push(ne)}return er}function k(u){var m=u.signatures[0],G;for(G in m.names)if(m.names.hasOwnProperty(G))return!1;for(G in m.stereotypes)if(m.stereotypes.hasOwnProperty(G))return!1;return m.level===-1&&!m.starred}var o=1e3;function a(u){var m=[],G=!1,I;for(I in u.map)if(u.map.hasOwnProperty(I)){G=!0;break}if(!G)return m;for(var er=0;er<u.signatures.length;er++){var z=u.signatures[er],hr={};for(I in u.map)u.map.hasOwnProperty(I)&&(hr[I]={value:u.map[I].value,priority:u.map[I].priority+(z.withDot?o:0)});m.push({sig:z,props:hr})}return m}function t(u){return new Error("PlantUML: Error in style definition: "+u)}function n(u,m){var G=y(u),I=m.variables,er=!1,z=new A(null,[Y()]),hr=0;function mr(So){return G[hr+So]||null}function ne(){for(;mr(0)!=null&&mr(0).type===X;)hr++}function ye(){for(;mr(0)!=null&&mr(0).type===M;)hr++}function Je(){for(var So="";mr(0)!=null;){var it=mr(0);if(it.type!==H&&it.type!==J)return So;So+=it.data,hr++}return So}function _o(){for(var So="";mr(0)!=null;){var it=mr(0);if(it.type===X||it.type===gr||it.type===C)return So;if(it.type===H)So.length>0&&(So+=" "),So+=it.data,hr++;else if(it.type===J)So+=it.data,hr++;else if(it.type===M)if(So+=it.data,hr++,mr(0)!=null&&mr(0).type===H)So+=mr(0).data,hr++;else throw t("bad definition");else throw t("bad definition")}return So}function Oo(So){if(So.indexOf("var(")===0){var it=/^var\(-*([_\w][-_\w]+)\)$/.exec(So);if(it!=null&&I.hasOwnProperty(it[1]))return I[it[1]]}return So}for(;mr(0)!=null;){var qe=mr(0);if(hr++,!(qe.type===X||qe.type===gr)&&!(qe.type===H&&(qe.data.toLowerCase()==="<style>"||qe.data.toLowerCase()==="</style>"))){if(mr(0)!=null&&mr(0).type===J){var St=qe.data+Je();if(ne(),mr(0)!=null&&mr(0).type===_){z=s(z,St),hr++;continue}throw t('unexpected token after "'+St+'"')}if(qe.type===H){var ht=qe.data;if(mr(0)!=null&&mr(0).type===g&&(hr++,ht+="*"),ne(),mr(0)!=null&&mr(0).type===_){z=s(z,ht),hr++;continue}if(ye(),qe.data.indexOf("--")===0)I[qe.data.substring(2)]=_o();else if(mr(0)!=null&&mr(0).type===H){var nn=Oo(_o()),Tt=Z[qe.data.toLowerCase()],Lo=++m.counter;Tt!=null&&!er&&(z.map[Tt]={value:nn,priority:Lo})}else throw t("parsing")}else if(qe.type===C){for(var Qt=a(z),pt=0;pt<Qt.length;pt++)m.rules.push(Qt[pt]);k(z)||(z=z.parent)}else if(qe.type===$)er=!0;else if(qe.type===M&&mr(0)!=null&&mr(0).type===H&&mr(1)!=null&&mr(1).type===_)z=s(z,":"+mr(0).data),hr+=2;else if(qe.type===M&&mr(0)!=null&&mr(0).type===H&&mr(1)!=null&&mr(1).type===g&&mr(2)!=null&&mr(2).type===_)z=s(z,":"+mr(0).data+"*"),hr+=3;else throw qe.type===_?t("Invalid open bracket"):t("unexpected token "+qe.data)}}}var v=["root {"," FontName SansSerif"," HyperLinkColor blue"," HyperLinkUnderlineThickness 1"," FontColor black"," FontSize 14"," FontStyle plain"," HorizontalAlignment left"," RoundCorner 0"," DiagonalCorner 0"," LineThickness 1.0"," LineColor #181818"," BackGroundColor #f1f1f1"," Shadowing 0.0","}","element {"," Shadowing 0.0"," LineThickness 0.5","}","arrow {"," FontSize 13"," LineThickness 1.0"," BackGroundColor black","}","mindmapDiagram {"," node {"," Padding 10"," Margin 10"," RoundCorner 25"," LineThickness 1.5"," }"," arrow {"," LineThickness 1.0"," }","}","wbsDiagram {"," Padding 10"," Margin 15"," RoundCorner 0"," LineThickness 1.5"," FontSize 12","}"].join(`
+`),R=null;function Q(){var u={rules:[],counter:0,variables:{},blocks:0,skinparams:{}};return R==null?(n(v,u),R={rules:u.rules.slice(),counter:u.counter}):(u.rules=R.rules.slice(),u.counter=R.counter),u.userStart=u.rules.length,u.addBlock=function(m){n(m,u),u.blocks++},u.addRule=function(m,G,I){var er=V(m,-1,G,!1),z=G!=null&&G.length>0?o:0,hr={sig:er,props:{}},mr=!1;for(var ne in I)if(I.hasOwnProperty(ne)){var ye=Z[String(ne).toLowerCase()];ye!=null&&(hr.props[ye]={value:I[ne],priority:++u.counter+z},mr=!0)}mr&&u.rules.push(hr)},u.addSkinParam=function(m,G){ac.apply(m,G,u)},u}function L(u){return u!=null&&u.rules.length>u.userStart}var B=/^<style>\s*$/i,w=/^<style>(.*)<\/style>\s*$/i,ar=/^<\/?style>\s*$/i,sr=/^<style\s+(?:src|file|import)\b/i,ir=/^skinparam(?:locked)?\s+([\w.]*(?:<<[^<>]*>>)?[\w.]*)\s+([^{}]*)$/i,_r=/^skinparam(?:locked)?\s*(?:\s+([\w.]*(?:<<.*>>)?[\w.]*))?\s*\{$/i,Sr=/^([\w.]*(?:<<.*>>)?[\w.]*)\s+(?:(\{)|(.*))$/;function ae(u,m){m=m||Q();var G=String(u??"").split(/\r\n|\r|\n/),I=[],er=0;function z(ht){m.addBlock(ht)}for(er=0;er<G.length;er++){var hr=G[er],mr=hr.replace(/^\s+|\s+$/g,""),ne;if(mr.charAt(0)==="'"){I.push(hr);continue}if(B.test(mr)){var ye=[];for(I.push("");er+1<G.length;){er++;var Je=G[er].replace(/^\s+|\s+$/g,"");if(I.push(""),ar.test(Je))break;Je.charAt(0)!=="'"&&ye.push(G[er])}z(ye.join(`
+`));continue}if((ne=w.exec(mr))!=null){z(ne[1]),I.push("");continue}if(sr.test(mr)){I.push("");continue}if((ne=_r.exec(mr))!=null){var _o=ne[1]?[ne[1]]:[],Oo=1;for(I.push(hr);er+1<G.length;){er++;var qe=G[er].replace(/^\s+|\s+$/g,"");if(I.push(G[er]),!(qe===""||qe.charAt(0)==="'")){if(qe==="}"){if(Oo--,Oo===0)break;_o.pop();continue}var St=Sr.exec(qe);St!=null&&(St[2]!=null?(_o.push(St[1]),Oo++):m.addSkinParam(_o.join("")+St[1],St[3]))}}continue}if((ne=ir.exec(mr))!=null){m.addSkinParam(ne[1],ne[2]),I.push(hr);continue}if((ne=/^!option\s+handwritten\s+(\S+)/i.exec(mr))!=null){m.skinparams.handwritten=ne[1].toLowerCase(),I.push("");continue}I.push(hr)}return{sheet:m,body:I.join(`
+`)}}function se(u,m,G,I){for(var er=null,z=I||0;z<u.rules.length;z++){var hr=u.rules[z];if(U(hr.sig,m)){var mr=hr.sig.starred&&G||0;er==null&&(er={});for(var ne in hr.props)if(hr.props.hasOwnProperty(ne)){var ye={value:hr.props[ne].value,priority:hr.props[ne].priority+mr},Je=er[ne];(Je==null||ye.priority>Je.priority)&&(er[ne]=ye)}}}return er}function re(u,m){if(m==null)return u;u==null&&(u={});for(var G in m)if(m.hasOwnProperty(G)){var I=u[G];(I==null||m[G].priority>I.priority)&&(u[G]=m[G])}return u}var Ur=10001e3;function oe(u,m){for(var G=Ur*1e3,I=se(u,m[0],G),er=1;er<m.length;er++)G-=Ur,I=re(I,se(u,m[er],G));return I||{}}function Ce(u,m){return se(u,m,0)||{}}function Me(u,m,G){if(!L(u))return{};var I=m!=null&&m.names!=null?m:V(m||[],-1,G||[],!1);return se(u,I,0,u.userStart)||{}}function eo(u){return P(Me(u,["root","document"]),"BackGroundColor")}function Hr(u,m){var G=u!=null?u[m]:null;return G==null?null:G.value}function Ne(u){return String(u??"").replace(/[^0-9.]/g,"")}function He(u,m,G){var I=Hr(u,m);if(I==null)return G;var er=parseFloat(Ne(I));return isNaN(er)?0:er}function Kr(u,m,G){var I=Hr(u,m);if(I==null)return G;var er=String(I).replace(/[^0-9]/g,"");return er.length===0?-1:parseInt(er,10)}function Ue(u,m){var G=Hr(u,m),I={top:0,right:0,bottom:0,left:0};if(G==null||!/^[0-9 ]+$/.test(G))return I;var er=G.replace(/^\s+|\s+$/g,"").split(/ +/),z=parseInt(er[0],10),hr,mr,ne;switch(er.length){case 1:return{top:z,right:z,bottom:z,left:z};case 2:return hr=parseInt(er[1],10),{top:z,right:hr,bottom:z,left:hr};case 3:return hr=parseInt(er[1],10),mr=parseInt(er[2],10),{top:z,right:hr,bottom:mr,left:hr};case 4:return hr=parseInt(er[1],10),mr=parseInt(er[2],10),ne=parseInt(er[3],10),{top:z,right:hr,bottom:mr,left:ne};default:return I}}function O(u){var m=He(u,"LineThickness",1),G=Hr(u,"LineStyle"),I={thickness:m,dashVisible:0,dashSpace:0};if(G==null||G.length===0)return I;var er=String(G).split(/[-;,]/),z=parseFloat(String(er[0]).replace(/^\s+|\s+$/g,""));if(isNaN(z))return I;var hr=z;return er.length>1&&(hr=parseFloat(String(er[1]).replace(/^\s+|\s+$/g,"")),isNaN(hr))||(I.dashVisible=z,I.dashSpace=hr),I}function T(u){var m=Hr(u,"Shadowing");if(m==null)return 0;var G=Ne(m);if(G.length>0){var I=parseFloat(G);if(!isNaN(I))return I}return 1.5}function N(u){var m=Hr(u,"MaximumWidth");return m==null||!/^-?\d+$/.test(String(m).replace(/^\s+|\s+$/g,""))?0:Math.abs(parseInt(m,10))}function D(u){var m=String(Hr(u,"FontStyle")||"").replace(/^\s+|\s+$/g,"").toLowerCase(),G=!1,I=!1;m==="bold"?G=!0:m==="italic"?I=!0:/^[1-9]00$/.test(m)&&(G=parseInt(m,10)>=600);var er=String(Hr(u,"FontWeight")||"").replace(/^\s+|\s+$/g,"").toLowerCase();return er==="bold"||er==="bolder"?G=!0:/^[1-9]00$/.test(er)?G=parseInt(er,10)>=600:(er==="normal"||er==="lighter")&&er.length&&(G=!1),{bold:G,italic:I}}function K(u){var m=String(Hr(u,"HorizontalAlignment")||"").replace(/^\s+|\s+$/g,"").toLowerCase();return m==="center"||m==="centre"?"center":m==="right"?"right":"left"}function P(u,m){var G=Hr(u,m);if(G==null)return null;var I=String(G).replace(/^\s+|\s+$/g,""),er=I.replace(/^#/,"").toLowerCase();return er==="none"||er==="transparent"||er==="background"?"none":I}return{createSheet:Q,collect:ae,hasUserRules:L,userStyle:Me,pageBackground:eo,signature:V,matchAll:U,nodeStyle:oe,plainStyle:Ce,cleanStereotype:lr,raw:Hr,asDouble:He,asInt:Kr,clockwise:Ue,stroke:O,shadowing:T,maxWidth:N,fontFace:D,horizontalAlignment:K,color:P,STEP_BY_PARENT:Ur}})();var Eo=(function(){var Ar=20,Z=60,Mr={sequence:["sequence diagram","sequence diagrams"],class:["class diagram","class diagrams"],object:["object diagram","object diagrams"],useCase:["use case diagram","use case diagrams"],activity:["activity diagram","activity diagrams"],activityLegacy:["legacy-syntax activity diagram","legacy-syntax activity diagrams"],state:["state diagram","state diagrams"],component:["component / deployment diagram","component / deployment diagrams"],mindmap:["mind map","mind maps"],wbs:["work breakdown structure","work breakdown structures"],gantt:["Gantt chart","Gantt charts"],timing:["timing diagram","timing diagrams"],json:["JSON diagram","JSON diagrams"],yaml:["YAML diagram","YAML diagrams"],salt:["Salt wireframe","Salt wireframes"],network:["nwdiag network diagram","nwdiag network diagrams"],archimate:["ArchiMate diagram","ArchiMate diagrams"],c4:["C4 diagram","C4 diagrams"],titleOnly:["furniture-only diagram","furniture-only diagrams"]};function Yr(o){return String(o??"").replace(/^\s+|\s+$/g,"")}function fe(o,a){var t=Object.prototype.hasOwnProperty.call(Mr,o)?Mr[o]:[o+" diagram",o+" diagrams"];return t[a?1:0]}function Wr(o){var a=Yr(o);return a.length>Z&&(a=a.substring(0,Z-1)+"\u2026"),'"'+a+'"'}function Nr(o,a,t,n){if(o!=null){o.warnings=o.warnings||[];var v=String(a??"").split(/\r\n|\r|\n/);v.length>0&&v[0].charCodeAt(0)===65279&&(v[0]=v[0].substring(1));var R=String(n??""),Q=R.split(`
+`).length,L=o.preprocessorLineMap;o._source={wrapper:t!=null&&t.wrapper!=null?t.wrapper:null,lines:v,startLine:t!=null&&t.startLine!=null?t.startLine:0,endLine:t!=null&&t.endLine!=null?t.endLine:v.length+1,bodyLines:t!=null?String(t.body).split(`
+`).length:0,preLines:Q,lineMap:Array.isArray(L)&&L.length===Q?L:null,body:R}}}function lr(o,a,t){var n=o!=null?o._source:null;if(n==null)return null;if(a!=null&&a>=0){var v=-1;if(n.lineMap!=null?v=a<n.lineMap.length?n.lineMap[a]:-1:n.preLines===n.bodyLines&&(v=a),v>=0)return Y(o,v)}var R=Yr(t);if(R==="")return null;for(var Q=n.startLine;Q<n.endLine-1&&Q<n.lines.length;Q++)if(Yr(n.lines[Q])===R)return Q+1;return null}function Y(o,a){var t=o!=null?o._source:null;if(t==null||a==null||a<0)return null;var n=t.startLine+1+a;return n<t.endLine?n:null}function Cr(o,a,t,n,v){if(o==null)return null;for(var R=o.warnings=o.warnings||[],Q=lr(o,n,v),L=0;L<R.length;L++)if(R[L].code===a&&R[L].message===t&&R[L].line===Q)return R[L];var B={code:a,message:t,line:Q};return R.push(B),B}var V=/^(?:[\[\]{}(),;|]+|[-=._]{2,}|end(?:\s*[A-Za-z]+)?)$/i;function U(o,a,t,n,v){if(o==null||Yr(n)===""||v==null&&V.test(Yr(n)))return null;if(o._droppedLines=(o._droppedLines||0)+1,o._droppedLines>Ar){var R=o._droppedLines-Ar;return o._droppedMore==null&&(o._droppedMore=Cr(o,"dropped-line-more","",null,null)),o._droppedMore.message=R+" more line"+(R===1?"":"s")+" matched no "+fe(a)+" statement and "+(R===1?"was":"were")+" dropped",o._droppedMore}return Cr(o,"dropped-line","this line "+(v!=null?Yr(v):"matched no "+fe(a)+" statement")+" and was dropped: "+Wr(n),t,n)}function H(o,a,t,n,v,R){return o==null?null:Cr(o,"unknown-reference","no "+fe(a)+" "+t+' is named "'+Yr(n)+'"; this line was dropped: '+Wr(R),v,R)}function J(o,a,t,n,v){return Cr(o,"dropped-note","this "+t+" is not rendered in "+fe(a,!0)+" yet and was dropped: "+Wr(v),n,v)}function gr(o,a,t,n){return Cr(o,"dropped-sprite",'sprite "'+a+'" is defined here but sprites are not rendered by this converter',t,n)}function X(o,a,t,n){return Cr(o,"ignored-directive",Wr(n)+" is not applied to "+fe(a,!0)+" by this converter",t,n)}function g(o,a,t){var n="<style> and skinparam rules";return t!=null&&t.length>0&&(n='the theme "'+t.join('", "')+'" and any <style> / skinparam rules'),Cr(o,"ignored-style",n+" are not applied to "+fe(a,!0)+" by this converter yet",null,null)}function M(o,a,t){for(var n=a+1;n<o.length;n++)if(t.test(o[n]))return n;return-1}function _(o){var a=o!=null?o._source:null;return a!=null&&a.wrapper!=null?a.wrapper:null}var C={json:"JSON",yaml:"YAML"};function $(o,a,t,n,v){var R=lr(o,t,n),Q=Object.prototype.hasOwnProperty.call(C,a)?C[a]:fe(a),L=new Error("PlantUML: "+(R!=null?"line "+R+": ":"")+"invalid "+Q+" \u2014 "+Yr(v)+' (plantuml.jar answers "Your data does not sound like '+Q+' data")');return L.plantUmlSyntaxError=!0,L.diagramType=a,R!=null&&(L.line=R),L}function y(o,a){var t=new Error("PlantUML: the diagram is empty \u2014 "+(a?"only skinparam / preprocessor lines and no diagram statement":"nothing")+" between "+o+" and its @end line");return t.plantUmlEmpty=!0,t}function A(o){return o==null?"":typeof o=="string"?o:(o.line!=null?"line "+o.line+": ":"")+o.message}function s(o){var a=[];if(o==null)return a;for(var t=o.preprocessorWarnings||[],n=0;n<t.length;n++){var v=t[n];typeof v=="string"?a.push({code:"preprocessor",message:v,line:null}):v!=null&&v.bodyIndex!=null&&v.line==null?a.push({code:v.code||"preprocessor",message:v.message,line:Y(o,v.bodyIndex)}):a.push(v)}for(var R=o.warnings||[],Q=0;Q<R.length;Q++)a.push(R[Q]);return a}function k(o){var a=o!=null?o._source:null;if(a==null)return 0;for(var t=a.body.split(`
+`),n=0,v=0;v<t.length;v++){var R=Yr(t[v]);R!==""&&R.charAt(0)!=="'"&&n++}return n}return{MAX_DROPPED:Ar,typeLabel:fe,excerpt:Wr,bindSource:Nr,sourceWrapper:_,syntaxError:$,emptyError:y,lineNumber:lr,bodyLineNumber:Y,warn:Cr,droppedLine:U,unknownReference:H,droppedNote:J,droppedSprite:gr,ignoredDirective:X,ignoredStyle:g,blockEnd:M,format:A,collect:s,statementCount:k}})();var Ai=(function(){var Ar={"@startuml":null,"@startmindmap":"mindmap","@startwbs":"wbs","@startgantt":"gantt","@startproject":"gantt","@startsalt":"salt","@startjson":"json","@startyaml":"yaml","@startebnf":"ebnf","@startregex":"regex","@startditaa":"ditaa","@startdot":"dot","@startchronology":"chronology","@startchen":"chen","@startnwdiag":"network","@startboard":"board","@startwire":"wire","@startbpm":"bpm","@startflow":"flow","@startcreole":"creole","@startmath":"math","@startlatex":"latex","@startdef":"def","@startgit":"git","@starthcl":"hcl","@startfiles":"files","@startchart":"chart","@startpacketdiag":"packet","@startsprites":"sprites"},Z={chen:{name:"Chen entity-relationship diagram",tracking:"PROGRESS.md Phase 19"},ebnf:{name:"EBNF grammar railroad diagram",tracking:"PROGRESS.md Phase 20"},regex:{name:"regular-expression railroad diagram",tracking:"PROGRESS.md Phase 21"},board:{name:"board diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},chronology:{name:"chronology diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},wire:{name:"wire block-wiring diagram",tracking:'docs/OUT-OF-SCOPE.md "Triaged"'},bpm:{name:"BPM diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},flow:{name:"flow diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},creole:{name:"Creole text block",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},math:{name:"AsciiMath formula",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},latex:{name:"LaTeX formula",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},def:{name:"definition block",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},git:{name:"git graph",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},hcl:{name:"HCL / Terraform diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},files:{name:"files tree diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},chart:{name:"chart",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},packet:{name:"packet diagram",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'},sprites:{name:"sprite listing",tracking:'docs/OUT-OF-SCOPE.md "Still to triage"'}},Mr="@startmindmap, @startwbs, @startgantt, @startjson, @startyaml, @startsalt or @startnwdiag";function Yr(A){for(var s in Ar)if(Object.prototype.hasOwnProperty.call(Ar,s)&&Ar[s]===A)return s;return null}function fe(A,s){var k=Object.prototype.hasOwnProperty.call(Z,A)?Z[A]:null,o=s||Yr(A)||"@start"+A,a=new Error("PlantUML: "+o+" ("+(k!=null?k.name:A+" diagram")+") is not yet supported by this converter");return a.plantUmlUnimplemented=!0,a.diagramType=A,a.wrapper=o,a}function Wr(A){var s=new Error("PlantUML: "+A+" is not a PlantUML diagram type. Use @startuml for UML diagrams, or "+Mr+" for the other families");return s.plantUmlUnknownWrapper=!0,s.wrapper=A,s}function Nr(A){var s=A!=null?" from its first statement"+(A.line!=null?" (line "+A.line+")":"")+': "'+A.text+'"':"",k=new Error("PlantUML: could not tell what kind of diagram this is"+s+'. Inside @startuml the first statement decides the type ("Alice -> Bob" starts a sequence diagram, "class Foo" a class diagram, "state Foo" a state diagram, ":action;" an activity diagram); mind maps, WBS, Gantt, JSON, YAML, Salt and nwdiag need their own wrapper ('+Mr+")");return k.plantUmlUndetected=!0,A!=null&&A.line!=null&&(k.line=A.line),k}function lr(A,s){return Eo.emptyError(A,s)}function Y(){var A=new Error("PlantUML: no @startuml \u2026 @enduml block found. Wrap the diagram in @startuml and @enduml (or in the @start\u2026 wrapper of its type: "+Mr+")");return A.plantUmlNoWrapper=!0,A}function Cr(A,s){if(!/^[ \t]*sprite\b/im.test(A))return A;for(var k=A.split(`
+`),o=/^[ \t]*sprite\s+(\$?[\w.-]+)\s*(.*)$/i,a=0;a<k.length;a++){var t=o.exec(k[a]);if(t!=null){var n=t[2],v=a;if(/\{\s*$/.test(n))for(v=a+1;v<k.length&&!/^\s*\}\s*$/.test(k[v]);v++);else if(/<svg\b/i.test(n)&&!/<\/svg\s*>/i.test(n))for(v=a+1;v<k.length&&!/<\/svg\s*>/i.test(k[v]);v++);v>=k.length&&(v=k.length-1),Eo.droppedSprite(s,t[1],a,k[a]);for(var R=a;R<=v;R++)k[R]="";a=v}}return k.join(`
+`)}var V={activityLegacy:!0,c4:!0},U={};for(var H in Ar)U["@end"+H.substring(6)]=H;var J={};function gr(A,s){J[A]=s}function X(){var A=[];for(var s in J)J.hasOwnProperty(s)&&A.push(s);return A}function g(A){if(A==null||typeof A!="string")return null;A.charCodeAt(0)===65279&&(A=A.substring(1));for(var s=A.split(/\r\n|\r|\n/),k=-1,o=null,a="",t=/^[ \t]*[@\\]start([A-Za-z][A-Za-z0-9_]*)\b[ \t]*(.*?)[ \t]*$/i,n=/^[ \t]*[@\\]end/i,v=0;v<s.length;v++){var R=s[v].match(t);if(R!=null){k=v,o="@start"+R[1].toLowerCase(),a=R[2]||"";continue}if(k>=0&&n.test(s[v]))return{wrapper:o,body:s.slice(k+1,v).join(`
+`),header:a,startLine:k+1,endLine:v+1}}return null}function M(A){var s=A.split(/\r\n|\r|\n/),k=[],o=!1,a=!1,t=null,n=0,v=0,R=!1;function Q(ae){for(var se=0,re=0;re<ae.length;re++){var Ur=ae.charAt(re);Ur==="{"||Ur==="["?se++:(Ur==="}"||Ur==="]")&&se--}return se}for(var L=0;L<s.length;L++){var B=s[L],w=B.replace(/^\s+|\s+$/g,"");if(o){B.indexOf("'/")>=0&&(o=!1);continue}if(w!==""){if(w.substring(0,2)==="/'"){w.indexOf("'/",2)<0&&(o=!0);continue}if(w.charAt(0)!=="'"){if(a){/<\/style\s*>/i.test(w)&&(a=!1);continue}if(/^<style\b/i.test(w)){!/<\/style\s*>/i.test(w)&&!/^<style\s+(?:src|file)\s*=/i.test(w)&&(a=!0);continue}if(n>0){w.indexOf("{")>=0&&n++,w.indexOf("}")>=0&&n--;continue}if(t!==null){var ar=t==="note"?/^end\s*(?:h?note|rnote)\b/i:new RegExp("^end\\s*"+t+"\\b","i");ar.test(w)&&(t=null);continue}if(!(w.charAt(0)==="!"&&!/^!include\s*<(?:C4|archimate)[\/>]/i.test(w))){if(v>0){v+=Q(B);continue}if(R){/^\}\}\s*$/.test(w)&&(R=!1);continue}if(/^\{\{/.test(w)){/\}\}\s*$/.test(w)||(R=!0);continue}var sr=w.match(/^json\s+(?:"[^"]+"|\S+)\s+(\S.*)$/i);if(sr!=null){/^[\[{]/.test(sr[1])&&(v=Math.max(0,Q(sr[1])));continue}if(/^skinparam\b/i.test(w)){/\{\s*$/.test(w)&&n++;continue}if(!/^(caption|scale|mainframe|hide|show)\b/i.test(w)&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(w)){var ir=w.match(/^(?:(?:center|left|right)\s+)?(title|header|footer|legend)\b(.*)$/i);if(ir!=null){var _r=ir[2].replace(/^\s+|\s+$/g,"");_r===""&&(t=ir[1].toLowerCase());continue}var Sr=w.match(/^(?:h?note|rnote|ref\s+over)\b/i);if(Sr!=null&&w.indexOf(":")<0&&!/^(?:h?note|rnote)\s+"/i.test(w)){t=/^ref/i.test(w)?"ref":"note",k.push(w);continue}k.push(w)}}}}}return k}function _(A){if(A==null||typeof A!="string")return null;var s=M(A);if(s.length===0)return null;var k,o;for(k=0;k<s.length;k++){if(o=s[k],/^salt\s*$/i.test(o))return"salt";if(/^listopeniconic\s*$/i.test(o)||/^listsprites?\s*$/i.test(o))return"openiconicList";if(/^@(?:[+\-]?\d[\d.:\/]*|:[\w.]+)(?:\s+as\s+:\S+)?\s*$/.test(o)||/^(robust|concise|clock|binary)\b(?!\s*[-<.])/i.test(o))return"timing";if(/^archimate\b/i.test(o)||/^!include\s*<archimate[\/>]/i.test(o)||/^(Motivation|Strategy|Business|Application|Technology|Physical|Implementation)_[A-Za-z][A-Za-z0-9]*\s*\(/.test(o))return"archimate";if(/^!include\s*<C4[\/>]/i.test(o)||/^!include\s*.*C4_(Container|Context|Component|Code|Dynamic|Deployment)\.puml\b/i.test(o)||/^(Person|Person_Ext|System(?:Db|Queue)?(?:_Ext)?|Container(?:Db|Queue)?(?:_Ext)?|Component(?:Db|Queue)?(?:_Ext)?)\s*\(/.test(o)||/^(System_Boundary|Container_Boundary|Enterprise_Boundary)\s*\(/.test(o))return"c4";if(/^nwdiag\s*\{/i.test(o))return"network";if(/\[\s*\*\s*\]/.test(o))return"state";if(/^entity\s+\S+.*\{/i.test(o)||/[}|][|o][-.]|[-.][|o][{|]/.test(o))return"class";if(/^(node|artifact|cloud|storage|stack|folder|frame|file|hexagon|card|agent)\b(?!\s*[-<.])/i.test(o)||/^\[(?!\[)[^\]]+\]/.test(o))return"component"}for(k=0;k<s.length;k++){if(o=s[k],/^state\b(?!\s*[-<.])/i.test(o))return"state";if(/^(class|interface|enum|abstract(?:\s+class)?|annotation|struct|protocol|exception|namespace|record|dataclass)\b(?!\s*[-<.])/i.test(o))return"class";if(/^(object|map)\b(?!\s*[-<.])/i.test(o))return"object";if(/^usecase\b(?!\s*[-<.])/i.test(o))return"useCase";if(/^component\b(?!\s*[-<.])/i.test(o))return"component";if(/^(participant|boundary|control|entity|collections|queue|create)\b(?!\s*[-<.])/i.test(o)||/^ref(?:#\w+)?\s+over\b/i.test(o)||/^[hr]?note(?:\s*<<[^>]*>>)?\s+over\b/i.test(o)||/^(activate|deactivate|destroy|autonumber|autoactivate)\b(?!\s*[-<.])/i.test(o)||/^box\b(?!\s*[-<.])/i.test(o)||/^&\s*\S/.test(o)&&/[-.]+>|<[-.]+/.test(o))return"sequence"}var a=!1;for(k=0;k<s.length;k++){if(o=s[k],/^(start|stop)\s*$/i.test(o)||/^(?:#\w+)?:.*?;\s*(?:<<[^>]*>>\s*)*$/.test(o)||/^if\s*\(/i.test(o)||/^while\s*\(/i.test(o)||/^repeat\b(?!\s*[-<.])/i.test(o)||/^(fork|split|swimlane)\b(?!\s*[-<.])/i.test(o)||/^detach\b(?!\s*[-<.])/i.test(o))return"activity";/^partition\b(?!\s*[-<.])/i.test(o)&&(a=!0)}if(a){var t=/^(?:\(\*(?:top)?\)|"[^"]*"(?:\s+as\s+\S+)?|===+\s*[\w.]+\s*===+|[\w\u00A0-\uFFFF][\w.\u00A0-\uFFFF]*)?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*[-.]+(?:\[[^\]]*\])?(?:left|right|up|down|le?|ri?|up?|do?)?(?:\[[^\]]*\])?[-.]*>\s*(?:\[[^\]*][^\]]*\]\s*)?(?:\(\*|"|===|[\w\u00A0-\uFFFF])/i;for(k=0;k<s.length;k++)if(/\(\s*\*\s*(?:top|bottom)?\s*\)/.test(s[k])||t.test(s[k]))return"activityLegacy";return"activity"}for(k=0;k<s.length;k++)if(/\(\s*\*\s*(?:top|bottom)?\s*\)/.test(s[k]))return"activityLegacy";for(k=0;k<s.length;k++)if(/-\[hidden\]-/i.test(s[k]))return"component";for(k=0;k<s.length;k++)if(o=s[k],/^:[^:;]+:\/?\s*(?:as\s+\S+)?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*$/i.test(o)||/^\([^)]+\)\/?\s*(?:as\s+\S+)?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*$/i.test(o)||/:[^:;]+:\/?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*[-.<>|]+(?:\[[^\]]*\][-.<>|]*)?\s*\([^)]+\)/.test(o)||/\([^)]+\)\/?\s*(?:<<[^>]*>>)?\s*(?:#\w+)?\s*[-.<>|]+(?:\[[^\]]*\][-.<>|]*)?\s*:[^:;]+:/.test(o)||/\([^)]+\)\s*[-.<>|]+\s*\([^)]+\)/.test(o)||/^\w[\w.]*\s*[-.<>|]+\s*\([^)]+\)/.test(o)||/^\([^)]+\)\s*[-.<>|]+\s*\w/.test(o))return"useCase";var n=/(?:^|\s)(?:<\|[-.]+|[*o+#][-.]+)|(?:[-.]+\|>|[-.]+[*o+#])(?=\s|$)/;for(k=0;k<s.length;k++)if(o=s[k],!/(?:^|\s)\[o?[<-]|[->]o?\]\s*(?::|$)/.test(o)&&n.test(o))return"class";for(k=0;k<s.length;k++)if(/^rectangle\s+(?:"[^"]*"|\S+)\s+as\s+\S+\s*$/i.test(s[k]))return"component";for(k=0;k<s.length;k++)if(/^together\s*\{\s*$/i.test(s[k]))return"component";var v='(?:[^\\s"<>\\[\\]\\-.][^\\s"<>\\[\\]]*|"[^"]*")',R="(?:[xo]?<<?[xo]?|\\\\\\\\?|\\/\\/?)",Q="(?:[xo]?>>?[xo]?|\\\\\\\\?|\\/\\/?)",L="(?:-+(?:\\[[^\\]]*\\]-*)?|\\[[^\\]]*\\]-+)",B="(?:"+R+L+Q+"?|[xo]?"+L+Q+")",w=new RegExp("^(?:"+v+"|[\\[\\]])\\s*"+B+"\\s*(?:"+v+"|[\\[\\]])"),ar=/^\[[^\[\]]+\]|[-.>]\s*\[[^\[\]]+\]\s*(?::|$)/,sr=new RegExp("^"+B+"\\s*(?:"+v+"|\\])"),ir=new RegExp("^"+v+"\\s+-{2,}>?\\s*$");for(k=0;k<s.length;k++){o=s[k];var _r=o.search(/\s:\s|:\s|\s:/),Sr=_r>0?o.substring(0,_r):o;if(!ar.test(Sr)){if(/^(?:"[^"]*"|[\w.]+)\s+(?:<\.{2,}|\.{2,}>)\s+(?:"[^"]*"|[\w.]+)/.test(Sr))return"class";if(w.test(o)||sr.test(o)||ir.test(o))return"sequence"}}for(k=0;k<s.length;k++){if(o=s[k],/^actor\b/i.test(o)||/^[hr]?note(?:\s*<<[^>]*>>)?\s+(?:left|right)\s+of\b/i.test(o))return"sequence";if(/^note\s+(?:top|bottom)\s+of\b/i.test(o))return"class"}if(/^\*+(?:\[#\w+\])?_?\s+\S/.test(s[0]))return"mindmap";for(k=0;k<s.length;k++)if(o=s[k],/^(node|folder|frame|cloud|artifact|storage|database|rectangle|hexagon|card|package|circle)\b/i.test(o)||/^\(\)\s+\S/.test(o))return"component";for(k=0;k<s.length;k++)if(/(?:^|[^\[])\[[\w][^\[\]]*\]/.test(s[k]))return"component";var ae=/^(?:[\w.]+|"[^"]*")\s+(?:"[^"]*"\s+)?(?:-+|\.+|[-.]+(?:up|down|left|right|u|d|l|r)[-.]+>?)\s+(?:"[^"]*"\s+)?(?:[\w.]+|"[^"]*")\s*(?::.*)?$/i;for(k=0;k<s.length;k++)if(ae.test(s[k]))return"class";var se=/^[\w.]+\s*:\s*\S/;for(k=0;k<s.length;k++)if(se.test(s[k]))return"state";if(s.length>0){var re=!0;for(k=0;k<s.length;k++)if(!/^"[^"]*"(?:\s+as\s+\S+)?\s*$/.test(s[k])){re=!1;break}if(re)return"component"}if(s.length>0){for(k=0;k<s.length;k++)if(!/^-[ \t]?(?![-.>\[])\S/.test(s[k]))return null;return"activity"}return null}function C(A){var s=A.split(/\r\n|\r|\n/),k={},o=0,a;for(a=0;a<s.length;a++){var t=s[a].replace(/^\s+|\s+$/g,""),n=t.match(/^json\s+(?:"([^"]+)"|(\S+))\s+(\S.*)$/i);if(n!=null){var v=n[1]!=null?n[1]:n[2],R=n[3];if(/^[\[{]/.test(R)){for(var Q=0,L=a,B=[];L<s.length;){var w=L===a?R:s[L];B.push(w);for(var ar=0;ar<w.length;ar++)w.charAt(ar)==="{"||w.charAt(ar)==="["?Q++:(w.charAt(ar)==="}"||w.charAt(ar)==="]")&&Q--;if(Q<=0)break;L++}R=B.join(`
+`),a=L}try{k[v]=JSON.parse(R),o++}catch{return null}}}return o>0?k:null}function $(A){var s=A.split(/\r\n|\r|\n/),k={title:null,header:null,footer:null,caption:null,legend:null,notes:[]},o=!1,a=!1,t=0,n;function v(ae){for(var se=[];n+1<s.length;){n++;var re=s[n].replace(/^\s+|\s+$/g,"");if(ae.test(re))break;se.push(re)}return se}for(n=0;n<s.length;n++){var R=s[n].replace(/^\s+|\s+$/g,"");if(!(R===""||R.charAt(0)==="'")){if(a){/<\/style\s*>/i.test(R)&&(a=!1);continue}if(/^<style\b/i.test(R)){!/<\/style\s*>/i.test(R)&&!/^<style\s+(?:src|file)\s*=/i.test(R)&&(a=!0);continue}if(t>0){R.indexOf("{")>=0&&t++,R.indexOf("}")>=0&&t--;continue}if(/^skinparam\b/i.test(R)){/\{\s*$/.test(R)&&t++;continue}var Q=R.match(/^(?:(?:center|left|right)\s+)?(title|header|footer|caption|legend)\b(.*)$/i);if(Q!=null){var L=Q[1].toLowerCase(),B=Q[2].replace(/^\s+|\s+$/g,"");if(L==="legend")if(/^(?:(?:left|right|center|top|bottom)\s*)*$/i.test(B)){for(var w=B.toLowerCase().split(/\s+/),ar="center",sr=0;sr<w.length;sr++)(w[sr]==="left"||w[sr]==="right")&&(ar=w[sr]);k.legend={position:ar,lines:v(/^end\s*legend\b/i)}}else k.legend={position:"center",lines:[B.replace(/^:\s*/,"")]};else B===""?k[L]=v(new RegExp("^end\\s*"+L+"\\b","i")).join(`
+`):k[L]=B.replace(/^:\s*/,"");o=!0;continue}var ir=R.match(/^note\s+"([^"]*)"\s+as\s+\S+(?:\s+(#\w+))?\s*$/i);if(ir!=null){k.notes.push({lines:[ir[1]],color:ir[2]||null}),o=!0;continue}var _r=R.match(/^note\s+as\s+\S+(?:\s+(#\w+))?\s*$/i);if(_r!=null){k.notes.push({lines:v(/^end\s*note\b/i),color:_r[1]||null}),o=!0;continue}var Sr=R.match(/^note\s+(?:left|right|top|bottom)(?:\s+(#\w+))?\s*(?::\s*(.*))?$/i);if(Sr!=null){k.notes.push({lines:Sr[2]!=null?[Sr[2]]:v(/^end\s*note\b/i),color:Sr[1]||null}),o=!0;continue}}}return o?k:null}function y(A,s){s=s||{};var k=g(A);if(k==null)throw Y();var o=typeof yd<"u"?yd.run(k.body,s):k.body;/^\s*@(?:pause|a|append)\b/m.test(o)&&(o=o.replace(/^([ \t]*)@(?:a|append)[ \t]+/gm,"$1").replace(/^[ \t]*@pause[ \t]*$/gm,""));var a=Ft.collect(o);o=a.body,s.styleSheet=a.sheet,Eo.bindSource(s,A,k,o),o=Cr(o,s);var t=Object.prototype.hasOwnProperty.call(Ar,k.wrapper)?Ar[k.wrapper]:void 0,n=Sf.typeForWrapper(k.wrapper);if(n!=null)throw Sf.unsupportedError(n);if(t===void 0)throw Wr(k.wrapper);if(t!=null&&Object.prototype.hasOwnProperty.call(Z,t))throw fe(t,k.wrapper);if(t==null&&(t=_(o)),Sf.isUnsupported(t))throw Sf.unsupportedError(t);if(t==="openiconicList")return{type:"openiconicList",ir:{},config:s,header:k.header};if(t==null&&/(^|\n)\s*stdlib\s*(\n|$)/i.test(o))return{type:"stdlib",ir:{},config:s,header:k.header};if(t==null){var v=C(o);if(v!=null)return{type:"json",ir:{data:v,rootPresent:!0,highlights:[]},config:s,header:k.header};var R=$(o);if(R!=null)return{type:"titleOnly",ir:R,config:s,header:k.header};var Q=M(o);if(Q.length===0)throw lr(k.wrapper,/\S/.test(o));for(var L=o.split(`
+`),B=null,w=0;w<L.length;w++)if(L[w].replace(/^\s+|\s+$/g,"")===Q[0]){B=w;break}throw Nr({line:Eo.lineNumber(s,B,Q[0]),text:Q[0].length>60?Q[0].substring(0,59)+"\u2026":Q[0]})}var ar=J[t];if(ar==null||typeof ar.parse!="function")throw fe(t,k.wrapper);var sr=ar.parse(o,s);return sr!=null&&typeof sr=="object"&&sr.styleSheet==null&&(sr.styleSheet=a.sheet),V[t]===!0&&Ft.hasUserRules(a.sheet)&&Eo.ignoredStyle(s,t,s.themesApplied||null),{type:t,ir:sr,config:s,header:k.header}}return{START_WRAPPERS:Ar,END_WRAPPERS:U,UNIMPLEMENTED_FAMILIES:Z,registerParser:gr,listParsers:X,stripWrapper:g,detectGenericUmlType:_,parse:y}})();var Ua=(function(){var Ar={header:"right",footer:"center"},Z=/^(?:(left|right|center|centre)\s+)?(title|header|footer|caption)\b\s*(.*)$/i,Mr=/^legend\b\s*(.*)$/i,Yr=/^(?:(?:left|right|center|centre|top|bottom)\s*)*$/i,fe=/^note\s+"([^"]*)"\s+as\s+(\S+)(?:\s+(#[\w:;.]+))?\s*$/i,Wr=/^note\s+as\s+(\S+)(?:\s+(#[\w:;.]+))?\s*$/i;function Nr(H,J,gr){for(var X=new RegExp("^\\s*end\\s*"+gr+"\\s*$","i"),g=J+1;g<H.length;g++)if(X.test(String(H[g])))return g;return-1}function lr(H,J,gr){var X="center",g="bottom";if(Yr.test(gr)){for(var M=gr.toLowerCase().split(/\s+/),_=0;_<M.length;_++)M[_]==="left"||M[_]==="right"?X=M[_]:(M[_]==="top"||M[_]==="bottom")&&(g=M[_]);var C=Nr(H,J,"legend");if(C<0)return null;for(var $=[],y=J+1;y<C;y++)$.push(String(H[y]).replace(/\s+$/,""));return{kind:"legend",lines:$,position:X,vertical:g,next:C}}var A=gr.replace(/^:\s*/,"");return/^"[\s\S]*"$/.test(A)&&(A=A.slice(1,-1)),{kind:"legend",lines:[A],position:"center",vertical:"bottom",next:J}}function Y(H,J){var gr=String(H[J]==null?"":H[J]),X=gr.replace(/^\s+|\s+$/g,""),g=fe.exec(X);if(g!=null)return{kind:"note",lines:[g[1]],id:g[2],color:g[3]||null,next:J};var M=Wr.exec(X);if(M!=null){var _=Nr(H,J,"note");if(_>=0){for(var C=[],$=J+1;$<_;$++)C.push(String(H[$]).replace(/^\s+|\s+$/g,""));return{kind:"note",lines:C,id:M[1],color:M[2]||null,next:_}}}var y=Mr.exec(X);if(y!=null)return lr(H,J,y[1].replace(/^\s+|\s+$/g,""));var A=Z.exec(X);if(A==null)return null;var s=A[2].toLowerCase(),k=A[1]?A[1].toLowerCase().replace("centre","center"):null,o=A[3].replace(/^\s+|\s+$/g,"");if(k!=null&&!Ar.hasOwnProperty(s))return null;if(o===""){var a=Nr(H,J,s);if(a<0)return null;for(var t=[],n=J+1;n<a;n++)t.push(String(H[n]).replace(/\s+$/,""));return{kind:s,text:t.join(`
+`),align:k||Ar[s]||null,next:a}}return{kind:s,text:o.replace(/^:\s*/,""),align:k||Ar[s]||null,next:J}}function Cr(H,J){if(J!=null){if(J.kind==="note"){H.floatingNotes==null&&(H.floatingNotes=[]),H.floatingNotes.push({id:J.id,lines:J.lines,color:J.color});return}J.kind==="legend"?H.legend={position:J.position,vertical:J.vertical,lines:J.lines}:J.kind==="header"||J.kind==="footer"?H[J.kind]={text:J.text,align:J.align}:H[J.kind]=J.text}}function V(H,J,gr){var X=Y(J,gr);return X==null?-1:(Cr(H,X),X.next)}function U(H,J){for(var gr=["title","header","footer","caption","legend","floatingNotes"],X=0;X<gr.length;X++)J!=null&&J[gr[X]]!=null&&(H[gr[X]]=J[gr[X]]);return H}return{match:Y,assign:Cr,take:V,merge:U}})();var Qf=(function(){var Ar=35,Z=60;function Mr(){this.nodes={},this.containers={},this.parts={},this.edges={},this.virtualEdges=[],this.labels={},this.attached={},this.followers={},this.linkNotes={},this.corners={},this.floats=[],this.vetoes=[],this.nodesep=Ar,this.ranksep=Z}Mr.prototype.node=function(C){return C!=null&&(this.nodes[C]=!0),this},Mr.prototype.container=function(C,$,y){return C==null?this:(this.nodes[C]=!0,this.containers[C]={top:$&&$.top||0,left:$&&$.left||0,bottom:$&&$.bottom||0,right:$&&$.right||0,minW:y||0},this)},Mr.prototype.part=function(C){return C!=null&&(this.parts[C]=!0),this},Mr.prototype.edge=function(C,$){return C!=null&&(this.edges[C]=$||{}),this},Mr.prototype.virtualEdge=function(C,$){return C!=null&&$!=null&&this.virtualEdges.push({top:C,bot:$}),this},Mr.prototype.label=function(C,$,y){return C!=null&&$!=null&&(this.labels[C]={edge:$,end:y}),this},Mr.prototype.attach=function(C,$,y){return C!=null&&$!=null&&(this.attached[C]={target:$,side:y||"right"}),this},Mr.prototype.follow=function(C,$,y){return C!=null&&$!=null&&(this.followers[C]={anchor:$,corner:y||"tl"}),this},Mr.prototype.linkNote=function(C,$,y){return C!=null&&$!=null&&(this.linkNotes[C]={edge:$,side:y||"right"}),this},Mr.prototype.corner=function(C,$){return C!=null&&(this.corners[C]=$||"tl"),this},Mr.prototype.floating=function(C,$,y){return C&&C.length&&this.floats.push({ids:C.slice(),where:$||"below",align:y||"center"}),this},Mr.prototype.spacing=function(C,$){return C>0&&(this.nodesep=C),$>0&&(this.ranksep=$),this},Mr.prototype.veto=function(C){return this.vetoes.push(C||"unsupported"),this};function Yr(){return new Mr}var fe=null,Wr=null;function Nr(C){var $=C?.layoutEngine;if($===!1||$==="rows"||$==="none")return null;if($!=null&&typeof $.layoutSync=="function")return $;var y=typeof globalThis<"u"?globalThis:typeof window<"u"?window:null,A=y!=null?y.ELK:null;if(A==null||(typeof A!="function"&&A.default!=null&&(A=A.default),typeof A!="function"))return null;if(Wr==null||fe!==A)try{Wr=new A,fe=A}catch{return Wr=null,fe=null,null}return Wr!=null&&typeof Wr.layoutSync=="function"?Wr:null}var lr=/([\w:.-]+)="([^"]*)"/g;function Y(C){var $={},y;for(lr.lastIndex=0;(y=lr.exec(C))!=null;)$[y[1]]=y[2];return $}function Cr(C){var $=parseFloat(C);return isNaN($)?0:$}function V(C){return String(C??"").replace(/<[^>]*>/g,"").replace(/&lt;[^&]*&gt;/g,"").replace(/&(?:amp|lt|gt|quot|#39|#10);/g,function($){return $==="&amp;"?"&":$==="&lt;"?"<":$==="&gt;"?">":$==="&quot;"?'"':$==="&#39;"?"'":`
+`})}function U(C){for(var $=[],y={},A=/<mxCell\b([^>]*)>([\s\S]*?)<\/mxCell>\n?/g,s;(s=A.exec(C))!=null;){var k=Y(s[1]),o=s[2],a=/<mxGeometry\b([^>]*?)(?:\/>|>([\s\S]*?)<\/mxGeometry>)/.exec(o),t=null;if(a!=null){t={attrs:Y(a[1]),inner:a[2]||"",points:[],source:null,target:null};var n,v=/<mxPoint\b([^>]*?)\/>/g,R=/<Array as="points">([\s\S]*?)<\/Array>/.exec(t.inner);if(R!=null)for(;(n=v.exec(R[1]))!=null;){var Q=Y(n[1]);t.points.push({x:Cr(Q.x),y:Cr(Q.y)})}for(v.lastIndex=0;(n=v.exec(t.inner))!=null;){var L=Y(n[1]);L.as==="sourcePoint"?t.source={x:Cr(L.x),y:Cr(L.y)}:L.as==="targetPoint"?t.target={x:Cr(L.x),y:Cr(L.y)}:L.as==="offset"&&(t.offset={x:Cr(L.x),y:Cr(L.y)})}}var B={raw:s[0],rawAttrs:s[1],attrs:k,id:k.id,vertex:k.vertex==="1",edge:k.edge==="1",parent:k.parent||"1",geom:t};if(B.id==null||y[B.id]!=null)return null;$.push(B),y[B.id]=B}return $.length>0?{cells:$,byId:y}:null}function H(C){return String(Math.round(C*100)/100)}function J(C,$,y,A,s,k){var o=" <mxGeometry",a={x:!0,y:!0,width:!0,height:!0,as:!0};$!=null&&(o+=' x="'+H($)+'"'),y!=null&&(o+=' y="'+H(y)+'"'),A!=null&&(o+=' width="'+H(A)+'"'),s!=null&&(o+=' height="'+H(s)+'"');for(var t in C)C.hasOwnProperty(t)&&!a[t]&&(o+=" "+t+'="'+C[t]+'"');return o+=' as="geometry"',k?o+`>
+`+k+` </mxGeometry>
+`:o+`/>
+`}function gr(C,$){return' <mxPoint x="'+H(C.x)+'" y="'+H(C.y)+'"'+($?' as="'+$+'"':"")+`/>
+`}var X={"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"POLYLINE","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.layered.layering.strategy":"NETWORK_SIMPLEX","elk.layered.nodePlacement.strategy":"LINEAR_SEGMENTS","elk.layered.nodePlacement.favorStraightEdges":"true","elk.layered.cycleBreaking.strategy":"DEPTH_FIRST","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.thoroughness":"10","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES","elk.edgeLabels.inline":"false","elk.spacing.edgeLabel":"2","elk.layered.edgeLabels.sideSelection":"ALWAYS_DOWN","elk.layered.unnecessaryBendpoints":"true","elk.layered.mergeEdges":"false","elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth":"100000","elk.separateConnectedComponents":"false"};function g(C,$,y){var A={};for(var s in X)X.hasOwnProperty(s)&&(A[s]=X[s]);return A["elk.spacing.nodeNode"]=String(C.nodesep),A["elk.spacing.edgeNode"]=String(C.nodesep/2),A["elk.spacing.edgeEdge"]=String(C.nodesep/2),A["elk.layered.spacing.nodeNodeBetweenLayers"]=String(y?C.ranksep/2:C.ranksep),A["elk.layered.spacing.edgeNodeBetweenLayers"]=String(Math.round(C.ranksep/3)),A["elk.layered.spacing.edgeEdgeBetweenLayers"]=String(C.nodesep/2),$&&(A["elk.layered.nodePlacement.strategy"]=$),A}function M(C){var $={};for(var y in C)C.hasOwnProperty(y)&&($[y]=C[y]);return $}function _(C,$,y,A){A=A||{};var s=A.layoutOptions||null;if($==null||y==null||$.vetoes.length>0)return C;var k=U(C);if(k==null)return C;var o=k.cells,a=k.byId,t,n,v,R={};function Q(Le){if(R[Le]!=null)return R[Le];var Kt=a[Le];if(Kt==null||!Kt.vertex||Kt.geom==null)return null;var zt=Kt.geom.attrs,Fa={x:Cr(zt.x),y:Cr(zt.y),w:Cr(zt.width),h:Cr(zt.height)},wn=Kt.parent!=="1"?Q(Kt.parent):null;return wn!=null&&(Fa.x+=wn.x,Fa.y+=wn.y),R[Le]=Fa,Fa}for(t=0;t<o.length;t++)o[t].vertex&&Q(o[t].id);var L={},B={};for(n in $.nodes)$.nodes.hasOwnProperty(n)&&(v=a[n],!(v==null||!v.vertex||v.geom==null)&&(v.parent!=="1"&&!$.containers[v.parent]||$.parts[n]||$.followers[n]||$.labels[n]||$.linkNotes[n]||$.corners[n]||(L[n]=!0,$.containers[n]&&(B[n]=!0))));for(var w=!0;w;){w=!1;for(n in L)if(L.hasOwnProperty(n)){var ar=a[n].parent;ar!=="1"&&!L[ar]&&(delete L[n],delete B[n],w=!0)}}var sr=0;for(n in L)L.hasOwnProperty(n)&&sr++;if(sr<2)return C;function ir(Le){for(var Kt=64;Le!=null&&Le!=="1"&&Kt-- >0;){if(L[Le])return Le;var zt=a[Le];if(zt==null)return null;Le=zt.parent}return null}var _r={};function Sr(Le){for(;_r[Le]!=null&&_r[Le]!==Le;)Le=_r[Le];return Le}function ae(Le,Kt){if(!(!L[Le]||!L[Kt]||B[Le]||B[Kt])&&a[Le].parent===a[Kt].parent){_r[Le]==null&&(_r[Le]=Le),_r[Kt]==null&&(_r[Kt]=Kt);var zt=Sr(Le),Fa=Sr(Kt);zt!==Fa&&(_r[Fa]=zt)}}for(n in $.edges)if(!(!$.edges.hasOwnProperty(n)||!$.edges[n].sameRank)&&(v=a[n],!(v==null||!v.edge))){var se=ir(v.attrs.source),re=ir(v.attrs.target);se!=null&&re!=null&&se!==re&&ae(se,re)}for(n in $.attached)if($.attached.hasOwnProperty(n)){var Ur=$.attached[n];if((Ur.side==="left"||Ur.side==="right")&&L[n]){var oe=ir(Ur.target);oe!=null&&oe!==n&&ae(n,oe)}}var Ce={},Me={};for(n in _r)if(_r.hasOwnProperty(n)){var eo=Sr(n),Hr="g#"+eo;Ce[Hr]==null&&(Ce[Hr]={id:Hr,members:[],parent:a[eo].parent}),Ce[Hr].members.push(n),Me[n]=Hr}for(n in Ce)if(Ce.hasOwnProperty(n)){var Ne=Ce[n];if(Ne.members.length<2){delete Me[Ne.members[0]],delete Ce[n];continue}var He=1/0,Kr=1/0,Ue=-1/0,O=-1/0;for(t=0;t<Ne.members.length;t++){var T=R[Ne.members[t]];T.x<He&&(He=T.x),T.y<Kr&&(Kr=T.y),T.x+T.w>Ue&&(Ue=T.x+T.w),T.y+T.h>O&&(O=T.y+T.h)}Ne.box={x:He,y:Kr,w:Ue-He,h:O-Kr}}var N={};for(n in $.followers)$.followers.hasOwnProperty(n)&&(N[n]=$.followers[n]);for(n in $.attached)if(!(!$.attached.hasOwnProperty(n)||!L[n])){var D=$.attached[n];if(!(D.side!=="left"&&D.side!=="right")){var K=ir(D.target),P=K!=null&&Me[n]!=null&&Me[n]===Me[K];!P&&R[D.target]!=null&&(delete L[n],N[n]={anchor:D.target,corner:D.side==="left"?"l":"r"})}}var u={},m={},G={},I=!1;for(t=0;t<o.length&&!I;t++)if(v=o[t],!(!v.edge||v.attrs.source==null||v.attrs.target==null)){var er=$.edges[v.id];if(!(er!=null&&(er.loop||er.sameRank))&&V(v.attrs.value).length!==0){var z=Je(v.attrs.source),hr=Je(v.attrs.target);z!=null&&hr!=null&&z!==hr&&(I=!0)}}var mr=g($,null,I);if(s!=null)for(n in s)s.hasOwnProperty(n)&&(mr[n]=String(s[n]));function ne(Le,Kt){for(var zt=[],Fa={},wn=0;wn<o.length;wn++){var Pn=o[wn];if(!(!Pn.vertex||Pn.parent!==Le||!L[Pn.id])){var Kl=Me[Pn.id];if(Kl!=null){if(Fa[Kl])continue;Fa[Kl]=!0,u[Kl]=Kt,m[Kl]=!0;for(var Ya=Ce[Kl].box,_l={id:Kl,width:Ya.w,height:Ya.h,ports:[],layoutOptions:{"elk.portConstraints":"FIXED_POS"}},Ui=0;Ui<Ce[Kl].members.length;Ui++){var ni=Ce[Kl].members[Ui],fs=R[ni],Ou=fs.x-Ya.x+fs.w/2;_l.ports.push({id:ni+"#n",x:Ou,y:0,width:1,height:1}),_l.ports.push({id:ni+"#s",x:Ou,y:Ya.h,width:1,height:1}),G[ni+"#n"]=Kl,G[ni+"#s"]=Kl}zt.push(_l);continue}var vf=R[Pn.id],cl={id:Pn.id,width:vf.w,height:vf.h};if(u[Pn.id]=Kt,m[Pn.id]=!0,B[Pn.id]){var Es=$.containers[Pn.id];cl.children=ne(Pn.id,Pn.id),cl.layoutOptions=M(mr),cl.layoutOptions["elk.padding"]="[top="+Es.top+",left="+Es.left+",bottom="+Es.bottom+",right="+Es.right+"]",cl.layoutOptions["elk.nodeSize.constraints"]="MINIMUM_SIZE",cl.layoutOptions["elk.nodeSize.minimum"]="("+Math.max(Es.minW,20)+","+(Es.top+Es.bottom+10)+")",delete cl.width,delete cl.height}zt.push(cl)}}return zt}var ye=ne("1",null);function Je(Le){var Kt=ir(Le);return Kt==null?null:Me[Kt]!=null?Me[Kt]:Kt}function _o(Le,Kt){var zt=ir(Le);return zt==null?null:Me[zt]==null?zt:zt+(Kt==="top"?"#s":"#n")}function Oo(Le){return G[Le]!=null?G[Le]:Le}function qe(Le,Kt,zt,Fa,wn){return{id:Le,text:Kt,width:Math.max(1,zt),height:Math.max(1,Fa),layoutOptions:{"elk.edgeLabels.placement":wn}}}function St(Le){return qe(Le+"#rank","",1,1,"CENTER")}var ht=[],nn={},Tt=0;for(t=0;t<o.length;t++)if(v=o[t],!(!v.edge||v.attrs.source==null||v.attrs.target==null)){var Lo=$.edges[v.id];if(!(Lo!=null&&(Lo.loop||Lo.sameRank))){var Qt=Je(v.attrs.source),pt=Je(v.attrs.target);if(!(Qt==null||pt==null||Qt===pt)){var So=Qt,it=pt,qt=v.attrs.source,Pt=v.attrs.target;if(Lo!=null&&Lo.top!=null&&Lo.bot!=null){var We=Je(Lo.top),pn=Je(Lo.bot);We!=null&&pn!=null&&We!==pn&&(So=We,it=pn,qt=Lo.top,Pt=Lo.bot)}var ra={id:v.id,sources:[_o(qt,"top")],targets:[_o(Pt,"bot")],labels:[]},Gn=V(v.attrs.value);if(Gn.length>0){var Xe=Lo!=null&&Lo.labelW>0?Lo.labelW:Math.max(10,Gn.length*6.5),f=Lo!=null&&Lo.labelH>0?Lo.labelH:16;ra.labels.push(qe(v.id+"#label",Gn,Xe,f,"CENTER"))}else I&&ra.labels.push(St(v.id));ht.push(ra),nn[v.id]={top:So,bot:it,flipped:So!==Qt,partEnd:ir(v.attrs.source)!==v.attrs.source||ir(v.attrs.target)!==v.attrs.target}}}}for(n in $.labels)if($.labels.hasOwnProperty(n)){var d=$.labels[n],b=a[n],E=nn[d.edge];if(!(b==null||!b.vertex||E==null)){var ur=Je(a[d.edge].attrs.source),Er=d.end==="source"==(ur===E.top);for(t=0;t<ht.length;t++)ht[t].id===d.edge&&ht[t].labels.push(qe(n,V(b.attrs.value),R[n].w,R[n].h,Er?"TAIL":"HEAD"))}}for(t=0;t<$.virtualEdges.length;t++){var ke=Je($.virtualEdges[t].top),dr=Je($.virtualEdges[t].bot);ke!=null&&dr!=null&&ke!==dr&&ht.push({id:"v#"+Tt++,sources:[_o($.virtualEdges[t].top,"top")],targets:[_o($.virtualEdges[t].bot,"bot")],labels:I?[St("v#"+Tt)]:[]})}for(n in $.attached)if($.attached.hasOwnProperty(n)){var Go=$.attached[n];if(!(Go.side!=="top"&&Go.side!=="bottom")){var lo=Je(n),vo=Je(Go.target);lo==null||vo==null||lo===vo||ht.push({id:"v#"+Tt++,sources:[_o(Go.side==="top"?n:Go.target,"top")],targets:[_o(Go.side==="top"?Go.target:n,"bot")],labels:I?[St("v#"+Tt)]:[]})}}var Rn={id:"root",layoutOptions:M(mr),children:ye,edges:ht};Rn.layoutOptions["elk.padding"]="[top=0,left=0,bottom=0,right=0]";for(var rn=null,Co=!1,Dn=[{},{dropEndLabels:"cross"},{dropEndLabels:"all"},{dropEndLabels:"all",placer:"BRANDES_KOEPF"}],Ve=null,dt=0;dt<Dn.length&&rn==null;dt++){if(Dn[dt].dropEndLabels&&Co!=="all"){for(t=0;t<ht.length;t++)ht[t].labels!=null&&(Dn[dt].dropEndLabels==="cross"&&u[ht[t].sources[0]]===u[ht[t].targets[0]]||(ht[t].labels=ht[t].labels.filter(function(Le){return Le.layoutOptions["elk.edgeLabels.placement"]==="CENTER"})));Co=Dn[dt].dropEndLabels}Dn[dt].placer&&(Rn.layoutOptions["elk.layered.nodePlacement.strategy"]=Dn[dt].placer,(function Le(Kt){for(var zt=0;zt<Kt.length;zt++)Kt[zt].layoutOptions!=null&&(Kt[zt].layoutOptions["elk.layered.nodePlacement.strategy"]=Dn[dt].placer),Kt[zt].children!=null&&Le(Kt[zt].children)})(Rn.children));try{rn=y.layoutSync(JSON.parse(JSON.stringify(Rn)))}catch(Le){Ve=Le,rn=null}}if(rn==null)return typeof A.warn=="function"&&A.warn("the layout engine failed ("+String(Ve&&Ve.message||Ve).slice(0,80)+"); the diagram keeps the built-in layout"),C;if(rn.children==null)return C;var $t={};function Sa(Le,Kt,zt){for(var Fa=0;Fa<Le.length;Fa++){var wn=Le[Fa],Pn={x:Kt+Cr(wn.x),y:zt+Cr(wn.y),w:Cr(wn.width),h:Cr(wn.height)};if($t[wn.id]=Pn,Ce[wn.id]!=null)for(var Kl=Ce[wn.id],Ya=0;Ya<Kl.members.length;Ya++){var _l=Kl.members[Ya],Ui=R[_l];$t[_l]={x:Pn.x+(Ui.x-Kl.box.x),y:Pn.y+(Ui.y-Kl.box.y),w:Ui.w,h:Ui.h}}wn.children!=null&&Sa(wn.children,Pn.x,Pn.y)}}Sa(rn.children,0,0);function ba(Le){for(var Kt=Me[Le]!=null?Me[Le]:Le,zt=64;u[Kt]!=null&&zt-- >0;)Kt=u[Kt];return Kt}var sl={};function ua(Le){for(;sl[Le]!=null&&sl[Le]!==Le;)Le=sl[Le];return Le}for(t=0;t<ye.length;t++)sl[ye[t].id]=ye[t].id;for(t=0;t<ht.length;t++){var ea=ba(Oo(ht[t].sources[0])),fn=ba(Oo(ht[t].targets[0]));if(!(sl[ea]==null||sl[fn]==null)){var ui=ua(ea),oi=ua(fn);ui!==oi&&(sl[oi]=ui)}}var Zl={},Ca=[];for(t=0;t<ye.length;t++){var Cl=ua(ye[t].id);Zl[Cl]==null&&(Zl[Cl]={roots:[],order:t},Ca.push(Zl[Cl])),Zl[Cl].roots.push(ye[t].id)}var Aa={};if(Ca.length>1){Ca.sort(function(Le,Kt){return Le.order-Kt.order});var en=null;for(t=0;t<Ca.length;t++){var xt=el($t,Ca[t].roots);if(xt!=null){for(var pl=en==null?0:en-xt.x0,Pl=0;Pl<Ca[t].roots.length;Pl++)Aa[Ca[t].roots[Pl]]=pl;en=xt.x1+pl+$.nodesep}}for(n in $t)if($t.hasOwnProperty(n)){var Oi=Aa[ba(n)];Oi&&($t[n].x+=Oi)}}function el(Le,Kt){for(var zt={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0},Fa=0;Fa<Kt.length;Fa++){var wn=Le[Kt[Fa]];wn!=null&&(wn.x<zt.x0&&(zt.x0=wn.x),wn.y<zt.y0&&(zt.y0=wn.y),wn.x+wn.w>zt.x1&&(zt.x1=wn.x+wn.w),wn.y+wn.h>zt.y1&&(zt.y1=wn.y+wn.h))}return zt.x0===1/0?null:zt}var Rl=[];for(n in L)L.hasOwnProperty(n)&&a[n].parent==="1"&&Rl.push(n);var $l=el(R,Rl),fa=el($t,Rl);if($l==null||fa==null)return C;var xa=$l.x0-fa.x0,fi=$l.y0-fa.y0;for(n in $t)$t.hasOwnProperty(n)&&($t[n].x+=xa,$t[n].y+=fi);fa=el($t,Rl);function Nl(Le,Kt){switch(Kt){case"tr":return{x:Le.x+Le.w,y:Le.y};case"bl":return{x:Le.x,y:Le.y+Le.h};case"br":return{x:Le.x+Le.w,y:Le.y+Le.h};case"l":return{x:Le.x,y:Le.y+Le.h/2};case"r":return{x:Le.x+Le.w,y:Le.y+Le.h/2};case"t":return{x:Le.x+Le.w/2,y:Le.y};case"b":return{x:Le.x+Le.w/2,y:Le.y+Le.h};default:return{x:Le.x,y:Le.y}}}var jl={};function ha(Le,Kt){if(jl[Le]!=null)return jl[Le];if($t[Le]!=null)return jl[Le]=$t[Le];var zt=a[Le],Fa=R[Le];if(zt==null||Fa==null||(Kt||0)>64)return Fa;var wn=N[Le];if(wn!=null&&R[wn.anchor]!=null){var Pn=Nl(R[wn.anchor],wn.corner),Kl=Nl(ha(wn.anchor,(Kt||0)+1),wn.corner);return jl[Le]={x:Fa.x+(Kl.x-Pn.x),y:Fa.y+(Kl.y-Pn.y),w:Fa.w,h:Fa.h}}if(zt.parent!=="1"&&a[zt.parent]!=null&&a[zt.parent].vertex){var Ya=R[zt.parent],_l=ha(zt.parent,(Kt||0)+1);return jl[Le]={x:Fa.x+(_l.x-Ya.x),y:Fa.y+(_l.y-Ya.y),w:Fa.w,h:Fa.h}}return jl[Le]=Fa}for(n in $.corners)if(!(!$.corners.hasOwnProperty(n)||R[n]==null)){var Bi=Nl({x:$l.x0,y:$l.y0,w:$l.x1-$l.x0,h:$l.y1-$l.y0},$.corners[n]),Ii=Nl({x:fa.x0,y:fa.y0,w:fa.x1-fa.x0,h:fa.y1-fa.y0},$.corners[n]);$t[n]={x:R[n].x+(Ii.x-Bi.x),y:R[n].y+(Ii.y-Bi.y),w:R[n].w,h:R[n].h}}for(t=0;t<$.floats.length;t++)for(var mi=$.floats[t],Mi=mi.align==="left"?fa.x0-$l.x0:mi.align==="right"?fa.x1-$l.x1:(fa.x0+fa.x1)/2-($l.x0+$l.x1)/2,qa=fa.y1-$l.y1,Ni=0;Ni<mi.ids.length;Ni++){var on=a[mi.ids[Ni]];on==null||on.geom==null||(on.vertex&&R[on.id]!=null&&on.parent==="1"?$t[on.id]={x:R[on.id].x+Mi,y:R[on.id].y+qa,w:R[on.id].w,h:R[on.id].h}:on.edge&&on.attrs.source==null&&(on.shift={x:Mi,y:qa}))}function yi(Le){for(var Kt=[],zt=u[Le];zt!=null;)Kt.push(zt),zt=u[zt];return Kt}function xl(Le,Kt){var zt=yi(Le),Fa=yi(Kt);if(Fa.indexOf(Le)>=0)return Le;if(zt.indexOf(Kt)>=0)return Kt;for(var wn=0;wn<zt.length;wn++)if(Fa.indexOf(zt[wn])>=0)return zt[wn];return null}var ul={},Fl={};for(t=0;t<(rn.edges||[]).length;t++){var di=rn.edges[t],fl=nn[di.id];if(fl!=null){for(var ol=xl(Oo(di.sources[0]),Oo(di.targets[0])),Al=ol!=null&&$t[ol]!=null?$t[ol]:{x:xa+(Aa[ba(Oo(di.sources[0]))]||0),y:fi},Jl=[],ki=null,Di=null,bi=0;bi<(di.sections||[]).length;bi++){var ti=di.sections[bi];ki==null&&ti.startPoint!=null&&(ki={x:ti.startPoint.x+Al.x,y:ti.startPoint.y+Al.y}),ti.endPoint!=null&&(Di={x:ti.endPoint.x+Al.x,y:ti.endPoint.y+Al.y});for(var Hi=0;Hi<(ti.bendPoints||[]).length;Hi++)Jl.push({x:ti.bendPoints[Hi].x+Al.x,y:ti.bendPoints[Hi].y+Al.y})}if(fl.flipped){Jl.reverse();var Lu=ki;ki=Di,Di=Lu}ul[di.id]=fl.partEnd?{points:[],start:null,end:null}:{points:Jl,start:ki,end:Di};for(var Qs=0;Qs<(di.labels||[]).length;Qs++){var Li=di.labels[Qs];Li.id!=null&&a[Li.id]!=null&&Li.x!=null&&(Fl[Li.id]={x:Li.x+Al.x,y:Li.y+Al.y})}}}for(n in Fl)!Fl.hasOwnProperty(n)||R[n]==null||($t[n]={x:Fl[n].x,y:Fl[n].y,w:R[n].w,h:R[n].h});if(Co){for(n in $.labels)if(!(!$.labels.hasOwnProperty(n)||Fl[n]!=null||R[n]==null)){var ks=a[$.labels[n].edge];if(ks!=null){var ru=$.labels[n].end==="source"?ks.attrs.source:ks.attrs.target;ru!=null&&R[ru]!=null&&(N[n]={anchor:ru,corner:"tl"})}}}function Zu(Le){var Kt=a[Le];if(Kt==null)return null;var zt=ul[Le],Fa=ha(Kt.attrs.source),wn=ha(Kt.attrs.target);if(Fa==null||wn==null)return null;var Pn=[{x:Fa.x+Fa.w/2,y:Fa.y+Fa.h/2}];zt!=null&&(Pn=Pn.concat(zt.points)),Pn.push({x:wn.x+wn.w/2,y:wn.y+wn.h/2});var Kl=0,Ya;for(Ya=0;Ya+1<Pn.length;Ya++)Kl+=Math.sqrt(Math.pow(Pn[Ya+1].x-Pn[Ya].x,2)+Math.pow(Pn[Ya+1].y-Pn[Ya].y,2));var _l=0;for(Ya=0;Ya+1<Pn.length;Ya++){var Ui=Math.sqrt(Math.pow(Pn[Ya+1].x-Pn[Ya].x,2)+Math.pow(Pn[Ya+1].y-Pn[Ya].y,2));if(_l+Ui>=Kl/2&&Ui>0){var ni=(Kl/2-_l)/Ui;return{x:Pn[Ya].x+ni*(Pn[Ya+1].x-Pn[Ya].x),y:Pn[Ya].y+ni*(Pn[Ya+1].y-Pn[Ya].y),vertical:Math.abs(Pn[Ya+1].y-Pn[Ya].y)>=Math.abs(Pn[Ya+1].x-Pn[Ya].x)}}_l+=Ui}return{x:(Pn[0].x+Pn[Pn.length-1].x)/2,y:(Pn[0].y+Pn[Pn.length-1].y)/2,vertical:!0}}for(n in $.linkNotes)if(!(!$.linkNotes.hasOwnProperty(n)||R[n]==null)){var Gu=$.linkNotes[n],_s=Zu(Gu.edge);if(_s!=null){var Os=R[n].w,hu=R[n].h,Is,ku;Gu.side==="left"?(Is=_s.x-5-Os,ku=_s.y-hu/2):Gu.side==="top"?(Is=_s.x-Os/2,ku=_s.y-10-hu):Gu.side==="bottom"?(Is=_s.x-Os/2,ku=_s.y+10):(Is=_s.x+5,ku=_s.y-hu/2),$t[n]={x:Math.round(Is),y:Math.round(ku),w:Os,h:hu}}}var Gi="",eu=!1;for(t=0;t<o.length;t++){if(v=o[t],v.geom==null){Gi+=v.raw;continue}if(v.vertex){var ys=ha(v.id),cf=v.parent!=="1"&&a[v.parent]!=null&&a[v.parent].vertex?ha(v.parent):{x:0,y:0},$s=R[v.id],hf=ys.x-cf.x,_u=ys.y-cf.y,dl=v.geom.attrs;if(Math.abs(hf-Cr(dl.x))<.005&&Math.abs(_u-Cr(dl.y))<.005&&Math.abs(ys.w-$s.w)<.005&&Math.abs(ys.h-$s.h)<.005){Gi+=v.raw;continue}eu=!0,Gi+=" <mxCell"+v.rawAttrs+`>
+`+J(dl,hf,_u,ys.w,ys.h,v.geom.inner)+` </mxCell>
+`;continue}var ci=ul[v.id],El=$.edges[v.id];if(El!=null&&El.loop){var at=(v.attrs.style||"").replace(/(?:^|;)(?:exit|entry)(?:X|Y|Dx|Dy|Perimeter)=[^;]*/g,"").replace(/^;+/,"");at.length>0&&at.charAt(at.length-1)!==";"&&(at+=";"),at+="exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;",eu=!0,Gi+=" <mxCell"+v.rawAttrs.replace(/ style="[^"]*"/,' style="'+at.replace(/"/g,"&quot;")+'"')+">"+v.raw.slice(v.raw.indexOf(">")+1);continue}if(ci!=null){var us=v.parent!=="1"&&a[v.parent]!=null&&a[v.parent].vertex?ha(v.parent):{x:0,y:0},Us=v.attrs.style||"",vu=/edgeStyle=orthogonalEdgeStyle/.test(Us);Us=Us.replace(/(?:^|;)(?:exit|entry)(?:X|Y|Dx|Dy|Perimeter)=[^;]*/g,"").replace(/(?:^|;)curved=[^;]*/g,"").replace(/^;+/,""),Us.length>0&&Us.charAt(Us.length-1)!==";"&&(Us+=";");var Cu="";if(!vu&&ci.points.length>0){Us+="curved=1;",Cu+=` <Array as="points">
+`;for(var pu=0;pu<ci.points.length;pu++)Cu+=" "+gr({x:ci.points[pu].x-us.x,y:ci.points[pu].y-us.y});Cu+=` </Array>
+`}ci.start!=null&&ci.end!=null&&(Cu=gr({x:ci.start.x-us.x,y:ci.start.y-us.y},"sourcePoint")+gr({x:ci.end.x-us.x,y:ci.end.y-us.y},"targetPoint")+Cu);var ju=v.rawAttrs.replace(/ style="[^"]*"/,' style="'+Us.replace(/"/g,"&quot;")+'"');eu=!0,Gi+=" <mxCell"+ju+`>
+ <mxGeometry relative="1" as="geometry"`+(Cu?`>
+`+Cu+` </mxGeometry>
+`:`/>
+`)+` </mxCell>
+`;continue}var bs=N[v.id],Fs=null;if(bs!=null&&R[bs.anchor]!=null){var Ki=Nl(R[bs.anchor],bs.corner),wu=Nl(ha(bs.anchor),bs.corner);Fs={x:wu.x-Ki.x,y:wu.y-Ki.y}}else v.shift!=null&&(Fs=v.shift);if(Fs==null||Math.abs(Fs.x)<.005&&Math.abs(Fs.y)<.005||v.attrs.source!=null||v.attrs.target!=null){Gi+=v.raw;continue}var ou="";if(v.geom.source!=null&&(ou+=gr({x:v.geom.source.x+Fs.x,y:v.geom.source.y+Fs.y},"sourcePoint")),v.geom.target!=null&&(ou+=gr({x:v.geom.target.x+Fs.x,y:v.geom.target.y+Fs.y},"targetPoint")),v.geom.points.length>0){ou+=` <Array as="points">
+`;for(var rs=0;rs<v.geom.points.length;rs++)ou+=" "+gr({x:v.geom.points[rs].x+Fs.x,y:v.geom.points[rs].y+Fs.y});ou+=` </Array>
+`}eu=!0,Gi+=" <mxCell"+v.rawAttrs+`>
+ <mxGeometry relative="1" as="geometry">
+`+ou+` </mxGeometry>
+ </mxCell>
+`}return eu?Gi:C}return{NODESEP:Ar,RANKSEP:Z,hints:Yr,engineFor:Nr,apply:_,parseCells:U}})();var rd=(function(){var Ar={fillColor:"light-dark(#FEFECE,#1f2020)",strokeColor:"light-dark(#A80036,#cccccc)",fontColor:"light-dark(#000000,#cccccc)",fontFamily:"Verdana"},Z={};function Mr(r,l,e){Z[r]||(Z[r]={}),Z[r][l]=e}function Yr(){var r=new Graph;return r.setExtendParents(!1),r.setExtendParentsOnAdd(!1),r.setConstrainChildren(!1),r.setHtmlLabels(!0),r.getModel().maintainEdgeParent=!1,r}function fe(r,l){return l=l||Yr(),{graph:l,root:l.getDefaultParent()}}var Wr={lightblue:"#ADD8E6",pink:"#FFC0CB",red:"#FF0000",green:"#008000",blue:"#0000FF",yellow:"#FFFF00",orange:"#FFA500",gold:"#FFD700",lavender:"#E6E6FA",lightgreen:"#90EE90",salmon:"#FA8072",coral:"#FF7F50",gray:"#808080",grey:"#808080",black:"#000000",white:"#FFFFFF",cyan:"#00FFFF",magenta:"#FF00FF",lime:"#00FF00",aqua:"#00FFFF",navy:"#000080",maroon:"#800000",olive:"#808000",purple:"#800080",teal:"#008080",silver:"#C0C0C0",lightyellow:"#FFFFE0",lightcoral:"#F08080",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",darkgreen:"#006400",darkblue:"#00008B",darkred:"#8B0000",wheat:"#F5DEB3",tomato:"#FF6347",skyblue:"#87CEEB",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",turquoise:"#40E0D0",violet:"#EE82EE",plum:"#DDA0DD",linen:"#FAF0E6",khaki:"#F0E68C",ivory:"#FFFFF0",honeydew:"#F0FFF0",gainsboro:"#DCDCDC",beige:"#F5F5DC",hotpink:"#FF69B4",palegreen:"#98FB98",antiquewhite:"#FAEBD7",powderblue:"#B0E0E6",peachpuff:"#FFDAB9",mistyrose:"#FFE4E1",mintcream:"#F5FFFA",aliceblue:"#F0F8FF",firebrick:"#B22222",indianred:"#CD5C5C",deeppink:"#FF1493",mediumblue:"#0000CD",limegreen:"#32CD32",darkorange:"#FF8C00",dodgerblue:"#1E90FF",cadetblue:"#5F9EA0",chocolate:"#D2691E",crimson:"#DC143C",orchid:"#DA70D6",seagreen:"#2E8B57",springgreen:"#00FF7F",royalblue:"#4169E1",darksalmon:"#E9967A",lightsalmon:"#FFA07A",lightpink:"#FFB6C1",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",dimgray:"#696969",dimgrey:"#696969",slategray:"#708090",slategrey:"#708090",orangered:"#FF4500",forestgreen:"#228B22",midnightblue:"#191970",slateblue:"#6A5ACD",darkviolet:"#9400D3",darkorchid:"#9932CC",goldenrod:"#DAA520",darkgoldenrod:"#B8860B",rosybrown:"#BC8F8F",sienna:"#A0522D",peru:"#CD853F",sandybrown:"#F4A460",burlywood:"#DEB887",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",blanchedalmond:"#FFEBCD",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",palegoldenrod:"#EEE8AA",darkkhaki:"#BDB76B",yellowgreen:"#9ACD32",olivedrab:"#6B8E23",darkolivegreen:"#556B2F",greenyellow:"#ADFF2F",chartreuse:"#7FFF00",lawngreen:"#7CFC00",mediumseagreen:"#3CB371",darkseagreen:"#8FBC8F",mediumspringgreen:"#00FA9A",lightseagreen:"#20B2AA",darkcyan:"#008B8B",darkturquoise:"#00CED1",mediumturquoise:"#48D1CC",paleturquoise:"#AFEEEE",lightcyan:"#E0FFFF",azure:"#F0FFFF",lightsteelblue:"#B0C4DE",cornflowerblue:"#6495ED",deepskyblue:"#00BFFF",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",mediumpurple:"#9370DB",blueviolet:"#8A2BE2",indigo:"#4B0082",darkmagenta:"#8B008B",mediumorchid:"#BA55D3",mediumvioletred:"#C71585",palevioletred:"#DB7093",fuchsia:"#FF00FF",lightgoldenrodyellow:"#FAFAD2",floralwhite:"#FFFAF0",ghostwhite:"#F8F8FF",lavenderblush:"#FFF0F5",oldlace:"#FDF5E6",papayawhip:"#FFEFD5",seashell:"#FFF5EE",snow:"#FFFAFA",whitesmoke:"#F5F5F5",brown:"#A52A2A",rebeccapurple:"#663399",saddlebrown:"#8B4513",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",lightblue1:"#BFEFFF",aquamarine:"#7FFFD4",mediumaquamarine:"#66CDAA",honeydew2:"#E0EEE0"},Nr=/[;=<>"'`(){}\r\n\t ]/,lr=/^[0-9A-Za-z|\/\\.\-]+$/;function Y(r){if(!r)return r;var l=String(r).replace(/^\s+|\s+$/g,"");if(!l||Nr.test(l))return null;if(/^#?(?:transparent|none)$/i.test(l))return"none";if(l.charAt(0)==="#"){var e=l.substring(1),c=e.toLowerCase();return Wr.hasOwnProperty(c)?Wr[c]:/^[0-9A-Fa-f]{3,8}$/.test(e)||lr.test(e)?l:null}return Wr.hasOwnProperty(l.toLowerCase())?Wr[l.toLowerCase()]:lr.test(l)?l:null}function Cr(r){var l=String(r).replace(/^\s+|\s+$/g,""),e=/^(#?[A-Za-z0-9]+)[\/|\\\-](#?[A-Za-z0-9]+)$/.exec(l);if(e!=null){var c=Y(e[1]),i=Y(e[2]);if(c&&i&&c!=="none"&&i!=="none")return{fill:c,gradient:i}}var h=Y(l);return h?{fill:h,gradient:null}:null}function V(r){return String(Math.round(r*100)/100)}function U(r,l,e,c){var i={};if(r==null||!Ft.hasUserRules(r))return i;var h=Ft.userStyle(r,l,e),F;if(c!=="edge"&&c!=="text"){if(F=Ft.color(h,"BackGroundColor"),F!=null)if(F==="none")i.fillColor="none";else{var j=Cr(F);j!=null&&(i.fillColor=j.fill,j.gradient!=null&&(i.gradientColor=j.gradient))}if(Ft.raw(h,"RoundCorner")!=null){var p=Ft.asDouble(h,"RoundCorner",0);p>0?(i.rounded="1",i.arcSize=V(p),i.absoluteArcSize="1"):i.rounded="0"}Ft.raw(h,"Shadowing")!=null&&(i.shadow=Ft.shadowing(h)>0?"1":"0")}if(c!=="text"){if(F=Ft.color(h,"LineColor"),F!=null){var or=F==="none"?"none":Y(F);or&&(i.strokeColor=or)}if(Ft.raw(h,"LineThickness")!=null&&(i.strokeWidth=V(Ft.asDouble(h,"LineThickness",1))),Ft.raw(h,"LineStyle")!=null){var q=Ft.stroke(h);q.dashVisible>0?(i.dashed="1",i.fixDash="1",i.dashPattern=V(q.dashVisible)+" "+V(q.dashSpace)):i.dashed="0"}}if(F=Ft.color(h,"FontColor"),F!=null&&F!=="none"){var rr=Y(F);rr&&(i.fontColor=rr)}if(Ft.raw(h,"FontSize")!=null){var nr=Ft.asInt(h,"FontSize",-1);nr>0&&(i.fontSize=String(nr))}if(Ft.raw(h,"FontName")!=null){var Xr=Ch(Ft.raw(h,"FontName"));Xr&&(i.fontFamily=Xr)}if(Ft.raw(h,"FontStyle")!=null||Ft.raw(h,"FontWeight")!=null){var wr=Ft.fontFace(h);i.fontStyleBits=(wr.bold?1:0)|(wr.italic?2:0)}return Ft.raw(h,"HorizontalAlignment")!=null&&(i.align=Ft.horizontalAlignment(h)),i}function H(r,l){var e,c=!1;for(e in l)if(l.hasOwnProperty(e)){c=!0;break}if(!c)return r;var i=String(r||"");i.length>0&&i.charAt(i.length-1)!==";"&&(i+=";");for(e in l)if(l.hasOwnProperty(e)){var h=e,F=l[e];if(e==="fontStyleBits"){var j=/(?:^|;)fontStyle=(\d+);/.exec(i),p=j!=null?parseInt(j[1],10):0;if(h="fontStyle",F=String(F|p&4),F==="0"&&j==null)continue}var or=new RegExp("(^|;)"+h+"=[^;]*;");or.test(i)?i=i.replace(or,"$1"+h+"="+F+";"):i+=h+"="+F+";"}return i}function J(r,l){return l!=null&&l.skinparams!=null&&/^ortho$/i.test(String(l.skinparams.linetype||""))?H(r,{edgeStyle:"orthogonalEdgeStyle"}):r}function gr(r,l){return r.replace(/(<mxCell id="(?:cl)?(title|header|footer|caption|legend|legendtext)_\d+"[^>]*? style=")([^"]*)"/g,function(e,c,i,h){var F=i==="legend"||i==="legendtext"?["root","element","legend"]:["root","document",i],j=i==="legend"?"vertex":"text";return c+H(h,U(l,F,[],j))+'"'})}function X(r,l,e,c,i,h){var F=U(l,e,c,i);if(h!=null)for(var j=0;j<h.length;j++)delete F[h[j]];return H(r,F)}function g(r){return r==null?"":String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\r\n?/g,`
+`).replace(/\n/g,"&#10;")}var M={heart:"\u2665",star:"\u2605",star_o:"\u2606",check:"\u2714",check_circle:"\u2714",circle_check:"\u2714",ban:"\u2718",x:"\u2717",cloud:"\u2601",sun:"\u2600",gear:"\u2699",cog:"\u2699",cogs:"\u2699",exchange:"\u21C4",envelope:"\u2709",mail:"\u2709",home:"\u2302",house:"\u2302",info:"\u2139",warning:"\u26A0",bolt:"\u26A1",flag:"\u2691",key:"\u26BF",person:"\u263B",people:"\u263B",user:"\u263B",users:"\u263B",phone:"\u260E",clock:"\u23F1",cubes:"\u29C9",cube:"\u25A2",arrow_right:"\u2192",arrow_left:"\u2190",share_alt_square:"\u21AA",plus:"+",minus:"\u2212"};function _(r){var l=M[r]||M[r.replace(/-/g,"_")];return l||""}var C=/--([^\n]+?)--/g,$=/^\s*-+\s*$/;function y(r,l){for(var e=String(r).split(`
+`),c=0;c<e.length;c++)$.test(e[c])||(e[c]=l(e[c]));return e.join(`
+`)}function A(r){var l=String(r??"");if(/<(?:s|strike|del)(?::[^>]*)?>[\s\S]+?<\/(?:s|strike|del)\s*>/i.test(l))return!0;for(var e=l.split(`
+`),c=0;c<e.length;c++)if(!$.test(e[c])&&/--[^\n]+?--/.test(e[c]))return!0;return!1}function s(r){return r==null?"":(r=String(r),r=r.replace(/<U\+([0-9A-Fa-f]{2,6})>/g,function(l,e){try{return String.fromCodePoint(parseInt(e,16))}catch{return""}}),r=r.replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," "),r=r.replace(/<\/?(?:size|color|colour|back|b|i|u|s|strike|del|sub|sup|font|w|plain)(?:[:\s][^>]*)?\s*>/gi,""),r=r.replace(/<&([a-zA-Z0-9_-]+)>/g,function(l,e){return _(e)}).replace(/<\$([a-zA-Z0-9_-]+)(?:\*[\d.]+)?>/g,function(l,e){return _(e)}),r=r.replace(/\*\*([\s\S]+?)\*\*/g,"$1").replace(/\/\/([\s\S]+?)\/\//g,"$1").replace(/__([\s\S]+?)__/g,"$1").replace(/~~([\s\S]+?)~~/g,"$1").replace(/""([\s\S]+?)""/g,"$1"),r=y(r,function(l){return l.replace(C,"$1")}),r)}function k(r){return g(s(r))}function o(r,l){var e=s(r);return l&&String(l).indexOf("html=1")>=0&&(e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),g(e)}function a(r){return String(r).replace(/\*\*([^\n]+?)\*\*/g,"<b>$1</b>").replace(/\/\/([^\n]+?)\/\//g,"<i>$1</i>").replace(/__([^\n]+?)__/g,"<u>$1</u>").replace(/~~([^\n]+?)~~/g,"<u>$1</u>").replace(C,"<strike>$1</strike>")}function t(r){if(r==null)return"";r=String(r),r=r.replace(/<U\+([0-9A-Fa-f]{2,6})>/g,function(j,p){try{return String.fromCodePoint(parseInt(p,16))}catch{return""}}),r=r.replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," "),r=r.replace(/<(?:s|strike|del)(?::[^>]*)?>/gi,"").replace(/<\/(?:s|strike|del)\s*>/gi,""),r=r.replace(/<\/?(?:size|color|colour|back|b|i|u|s|strike|del|sub|sup|font|w|plain)(?:[:\s][^>]*)?\s*>/gi,""),r=r.replace(/""([\s\S]+?)""/g,"$1"),r=r.replace(/<&([a-zA-Z0-9_-]+)>/g,function(j,p){return _(p)}).replace(/<\$([a-zA-Z0-9_-]+)(?:\*[\d.]+)?>/g,function(j,p){return _(p)}),r=r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");for(var l=r.split(`
+`),e="",c=!0,i=0;i<l.length;i++){var h=/^\s*(-{3,}|={3,}|\.{3,})\s*$/.exec(l[i]);if(h){var F=h[1].charAt(0);e+='<hr style="border:none;border-top:'+(F==="="?"3px double":F==="."?"1px dotted":"1px solid")+' #181818;margin:4px 0 5px;">',c=!0;continue}c||(e+="<br>"),e+=$.test(l[i])?l[i]:a(l[i]),c=!1}return e.replace(/\u0001/g,'<font face="monospace">').replace(/\u0002/g,"</font>").replace(/\u0004/g,"<strike>").replace(/\u0005/g,"</strike>")}function n(r){var l=String(r??"");return/\*\*[\s\S]+?\*\*|\/\/[\s\S]+?\/\/|""[\s\S]+?""|__[\s\S]+?__|~~[\s\S]+?~~|(?:^|\n)\s*[*#]+\s+\S/.test(l)?!0:A(l)}function v(r){if(r=String(r??""),!/(?:^|\n)\s*[*#]+\s+\S/.test(r))return t(r);for(var l=r.split(`
+`),e="",c=[],i="",h=0;h<l.length;h++){var F=l[h].match(/^\s*([*#]+)\s+(.*)$/);if(!F){for(;c.length>0;)e+="</li></"+c.pop()+">";e+=i+t(l[h]),i="<br>";continue}for(var j=F[1].length,p=F[1].charAt(0)==="#"?"ol":"ul";c.length>j;)e+="</li></"+c.pop()+">";for(c.length===j&&(e+="</li>");c.length<j;)e+="<"+p+' style="margin:0;padding-left:14px">',c.push(p);e+="<li>"+t(F[2]),i=""}for(;c.length>0;)e+="</li></"+c.pop()+">";return e}function R(r){for(var l=String(r??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&lt;(\/?)([biu])&gt;/gi,"<$1$2>"),e=l.match(/<\/?[biu]>/gi)||[],c=[],i=0;i<e.length;i++){var h=e[i].toLowerCase(),F=h.charAt(1)==="/",j=F?h.charAt(2):h.charAt(1);if(F){var p=c.lastIndexOf(j);p>=0&&c.splice(p,1)}else c.push(j)}for(;c.length;)l+="</"+c.pop()+">";return l}function Q(r){return t(r)}var L=5,B=33,w=14,ar=24,sr=10,ir=25,_r=17.7,Sr=15,ae=17,se=22,re=4;function Ur(r){return/^-{3,}$/.test(r)?"solid":/^\.{3,}$/.test(r)?"dotted":/^={3,}$/.test(r)?"double":null}function oe(r){return r<=1?18:r===2?16:r===3?15:14}var Ce=10,Me=8.43;function eo(r){for(var l="",e=!0,c=0;c<r.length;c++){var i=r[c],h=Ur(i);if(h){l+='<hr style="border:none;border-top:'+(h==="double"?"3px double":h==="dotted"?"1px dotted":"1px solid")+' #181818;margin:4px 0 5px;">',e=!0;continue}e||(l+="<br>"),e=!1;var F=/^(=+)\s*/.exec(i),j=/^"{2}.*"{2}$/.test(i),p=i.replace(/^=+\s*/,"").replace(/^"{2}|"{2}$/g,"");F?l+='<b><font style="font-size:'+oe(F[1].length)+'px">'+t(p)+"</font></b>":j?l+='<font face="monospace">'+k(p)+"</font>":l+=t(p)}return l}function Hr(r,l,e){return Ss(r,l,e)}function Ne(r){return r?String(r).split(`
+`).length:0}function He(r,l){var e=l==="box"?8:l==="hexagon"?23:20;return Hr(r||"",13,!1)+e}function Kr(r,l,e){var c=Y(r.color)||(l?"#E3E3E3":"#E2E2F0"),i=Y(r.borderColor)||"#181818",h=Y(r.fontColor)||"#000000",F="rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+c+";strokeColor="+i+";strokeWidth=0.5;fontColor="+h+";fontSize=14;whiteSpace=wrap;html=1;",j=e?"verticalLabelPosition=top;verticalAlign=bottom;":"verticalLabelPosition=bottom;verticalAlign=top;",p=j+"fillColor="+c+";strokeColor="+i+";fontColor="+h+";fontSize=14;html=1;";switch(r.kind){case"actor":return"shape=umlActor;"+p;case"boundary":return"shape=umlBoundary;"+p;case"control":return"ellipse;shape=umlControl;"+p;case"entity":return"ellipse;shape=umlEntity;"+p;case"database":return"shape=cylinder3;size=6;"+p;case"queue":return"shape=cylinder3;direction=east;size=8;"+p;default:return"shape=rectangle;"+F}}var Ue=4.5,O=9,T=7;function N(r){switch(r){case"open":return"endArrow=open;endFill=0;endSize=9;";case"lost":return"endArrow=cross;endSize=12;";case"circle":return"endArrow=classic;endFill=1;endSize=9;";case"halfTop":return"endArrow=open;endFill=0;endSize=9;endHalf=top;";case"halfBottom":return"endArrow=open;endFill=0;endSize=9;endHalf=bottom;";case"bidirectional":return"endArrow=classic;endFill=1;endSize=9;startArrow=classic;startFill=1;startSize=9;";default:return"endArrow=classic;endFill=1;endSize=9;"}}function D(r){var l=String(r??"");return/\*\*[^\n]+?\*\*|\/\/[^\n]+?\/\/|""[^\n]+?""|__[^\n]+?__|~~[^\n]+?~~/.test(l)||A(l)}function K(r){var l=String(r??"").replace(/^\s+|\s+$/g,"");return/^\*\*[\s\S]+\*\*$/.test(l)&&l.indexOf("**",2)===l.length-2?1:/^\/\/[\s\S]+\/\/$/.test(l)&&l.indexOf("//",2)===l.length-2?2:/^__[\s\S]+__$/.test(l)&&l.indexOf("__",2)===l.length-2?4:0}function P(r,l){var e=String(l??"");return!D(r)||K(r)!==0&&/(?:^|;)fontStyle=[1-9]/.test(e)?{value:o(r,e),style:e}:(/(?:^|;)html=1/.test(e)||(e.length>0&&e.charAt(e.length-1)!==";"&&(e+=";"),e+="html=1;"),{value:g(t(r)),style:e})}function u(r,l,e,c,i,h,F,j){var p=P(l,e);return' <mxCell id="'+g(r)+'" value="'+p.value+'" style="'+g(p.style)+'" vertex="1" parent="'+g(j||"1")+`">
+ <mxGeometry x="`+c+'" y="'+i+'" width="'+h+'" height="'+F+`" as="geometry"/>
</mxCell>
-`}var $=s;function G(r,a,e,h,l,C,b,Z){var v=P(a,e);return' <mxCell id="'+d(r)+'" value="'+v.value+'" style="'+d(v.style)+'" edge="1" parent="'+d(Z||"1")+`">
+`}var m=u;function G(r,l,e,c,i,h,F,j){var p=P(l,e);return' <mxCell id="'+g(r)+'" value="'+p.value+'" style="'+g(p.style)+'" edge="1" parent="'+g(j||"1")+`">
<mxGeometry relative="1" as="geometry">
- <mxPoint x="`+h+'" y="'+l+`" as="sourcePoint"/>
- <mxPoint x="`+C+'" y="'+b+`" as="targetPoint"/>
+ <mxPoint x="`+c+'" y="'+i+`" as="sourcePoint"/>
+ <mxPoint x="`+h+'" y="'+F+`" as="targetPoint"/>
</mxGeometry>
</mxCell>
-`}var B=G;function or(r,a,e,h,l,C,b,Z,v,er,X){for(var V="",tr=0;tr<C.length;tr++)V+=' <mxPoint x="'+C[tr].x+'" y="'+C[tr].y+`"/>
-`;var wr=P(a,e);return' <mxCell id="'+d(r)+'" value="'+wr.value+'" style="'+d(wr.style)+'" edge="1"'+(er!=null?' source="'+d(er)+'"':"")+(X!=null?' target="'+d(X)+'"':"")+' parent="'+d(v||"1")+`">
+`}var I=G;function er(r,l,e,c,i,h,F,j,p,or,q){for(var rr="",nr=0;nr<h.length;nr++)rr+=' <mxPoint x="'+h[nr].x+'" y="'+h[nr].y+`"/>
+`;var Xr=P(l,e);return' <mxCell id="'+g(r)+'" value="'+Xr.value+'" style="'+g(Xr.style)+'" edge="1"'+(or!=null?' source="'+g(or)+'"':"")+(q!=null?' target="'+g(q)+'"':"")+' parent="'+g(p||"1")+`">
<mxGeometry relative="1" as="geometry">
- <mxPoint x="`+h+'" y="'+l+`" as="sourcePoint"/>
- <mxPoint x="`+b+'" y="'+Z+`" as="targetPoint"/>
-`+(V!==""?` <Array as="points">
-`+V+` </Array>
+ <mxPoint x="`+c+'" y="'+i+`" as="sourcePoint"/>
+ <mxPoint x="`+F+'" y="'+j+`" as="targetPoint"/>
+`+(rr!==""?` <Array as="points">
+`+rr+` </Array>
`:"")+` </mxGeometry>
</mxCell>
-`}function K(r,a,e,h,l,C,b,Z){return' <mxCell id="'+d(r)+'" value="'+d(a)+'" style="'+d(e)+'" vertex="1" parent="'+d(Z||"1")+`">
- <mxGeometry x="`+h+'" y="'+l+'" width="'+C+'" height="'+b+`" as="geometry"/>
+`}function z(r,l,e,c,i,h,F,j){return' <mxCell id="'+g(r)+'" value="'+g(l)+'" style="'+g(e)+'" vertex="1" parent="'+g(j||"1")+`">
+ <mxGeometry x="`+c+'" y="'+i+'" width="'+h+'" height="'+F+`" as="geometry"/>
</mxCell>
-`}var hr=K;function vr(r,a,e,h,l,C){var b=P(a,e);return' <mxCell id="'+d(r)+'" value="'+b.value+'" style="'+d(b.style)+'" edge="1" source="'+d(h)+'" target="'+d(l)+'" parent="'+d(C||"1")+`">
+`}var hr=z;function mr(r,l,e,c,i,h){var F=P(l,e);return' <mxCell id="'+g(r)+'" value="'+F.value+'" style="'+g(F.style)+'" edge="1" source="'+g(c)+'" target="'+g(i)+'" parent="'+g(h||"1")+`">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
-`}var Jr=17,Ge=18,no=5,bo=9,Oo=7;function We(r){var a=/^(?:<#(\w+)>)?\|(.*)\|$/,e=[],h=null,l,C,b;for(l=0;l<r.length;l++){var Z=a.exec(r[l]);if(Z){var v=Z[2].split("|"),er={fill:Z[1]?Y(Z[1]):null,cells:[]};for(C=0;C<v.length;C++){var X=v[C].replace(/^\s+|\s+$/g,""),V={text:"",bold:!1,fill:null};X.charAt(0)==="="&&(V.bold=!0,X=X.substring(1).replace(/^\s+/,""));var tr=/^<#(\w+)>\s*/.exec(X);tr&&(V.fill=Y(tr[1]),X=X.substring(tr[0].length)),V.text=X.replace(/^<[lrc]>\s*/,""),er.cells.push(V)}(h==null||h.kind!=="table")&&(h={kind:"table",rows:[]},e.push(h)),h.rows.push(er)}else(h==null||h.kind!=="text")&&(h={kind:"text",lines:[]},e.push(h)),h.lines.push(r[l])}var wr=0,yr=0,fr=!1;for(l=0;l<e.length;l++){var Ar=e[l];if(Ar.kind==="table"){for(fr=!0,Ar.colW=[],C=0;C<Ar.rows.length;C++)for(b=0;b<Ar.rows[C].cells.length;b++){var jr=Ar.rows[C].cells[b],ce=Math.round(Gr(u(jr.text),14,jr.bold)+bo);Ar.colW[b]>=ce||(Ar.colW[b]=ce)}for(Ar.w=0,b=0;b<Ar.colW.length;b++)Ar.w+=Ar.colW[b];Ar.h=Ar.rows.length*Ge,yr+=Ar.h+4}else{for(Ar.w=0,C=0;C<Ar.lines.length;C++)Ar.w=Math.max(Ar.w,Math.ceil(Gr(u(Ar.lines[C]),14,!1)));Ar.h=Ar.lines.length*Jr,yr+=Ar.h}wr=Math.max(wr,Ar.w)}return{blocks:e,contentW:wr,hasTable:fr,w:Math.max(40,wr+2*no),h:yr+2*no}}function Tt(r,a,e,h,l,C){var b=h("legend"),Z=C||"1",v="rounded=1;absoluteArcSize=1;arcSize=15;fillColor="+(l||"#DDDDDD")+";strokeColor=#000000;strokeWidth=1;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacing=0;spacingLeft="+no+";spacingTop="+no+";whiteSpace=wrap;html=1;",er,X,V;if(!r.hasTable){var tr=[];for(er=0;er<r.blocks.length;er++)tr=tr.concat(r.blocks[er].lines);return K(b,n(tr.join(`
-`)),v,a,e,r.w,r.h,Z)}var wr=s(b,"",v+"container=1;collapsible=0;",a,e,r.w,r.h,Z),yr=no;for(er=0;er<r.blocks.length;er++){var fr=r.blocks[er];if(fr.kind==="text"){wr+=K(h("legendtext"),n(fr.lines.join(`
-`)),"text;html=1;strokeColor=none;fillColor=none;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacing=0;whiteSpace=wrap;",no,yr,r.contentW,fr.h,b),yr+=fr.h;continue}yr+=2;var Ar=h("legendtable");for(wr+=s(Ar,"","shape=table;childLayout=tableLayout;container=1;collapsible=0;startSize=0;rowLines=1;fixedRows=1;resizeLast=1;fillColor=none;strokeColor=#000000;strokeWidth=1;fontSize=14;whiteSpace=wrap;",no,yr,fr.w,fr.h,b),X=0;X<fr.rows.length;X++){var jr=fr.rows[X],ce=h("legendrow");wr+=s(ce,"","shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;collapsible=0;dropTarget=0;strokeColor=#000000;top=0;left=0;right=0;bottom=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fillColor="+(jr.fill||"none")+";",0,X*Ge,fr.w,Ge,Ar);var Nr=0;for(V=0;V<fr.colW.length;V++){var de=jr.cells[V]||{text:"",bold:!1,fill:null},Fr=V===fr.colW.length-1,Ir=Fr?fr.w-Nr:fr.colW[V];wr+=K(h("legendcell"),n(de.text),"shape=partialRectangle;connectable=0;overflow=hidden;fillColor="+(de.fill||"none")+";top=0;left=0;bottom=0;right="+(Fr?0:1)+";strokeColor=#000000;whiteSpace=wrap;html=1;fontSize=14;fontColor=#000000;align=left;spacing=0;spacingLeft=4;verticalAlign=middle;"+(de.bold?"fontStyle=1;":""),Nr,0,Ir,Ge,ce),Nr+=Ir}}yr+=fr.h+2}return wr}var Cn=11.78,un=16.49,Kt=10,ut=14;function fn(r){if(r==null)return null;var a=typeof r=="object"?r.text:r;return a==null||String(a)===""?null:String(a)}function vt(r,a){var e=r!=null&&typeof r=="object"?r.align:null;return e==="left"||e==="right"||e==="center"?e:a}function _o(r){for(var a=/<mxCell\b([^>]*)>\s*<mxGeometry\b([^>]*)\/?>/g,e=1/0,h=1/0,l=-1/0,C=-1/0,b;(b=a.exec(String(r||"")))!=null;){var Z=b[1],v=b[2];if(!(!/\bvertex="1"/.test(Z)||!/\bparent="1"/.test(Z))){var er=/\bx="(-?[\d.]+)"/.exec(v),X=/\by="(-?[\d.]+)"/.exec(v),V=/\bwidth="(-?[\d.]+)"/.exec(v),tr=/\bheight="(-?[\d.]+)"/.exec(v);if(!(er==null||X==null||V==null||tr==null)){var wr=parseFloat(er[1]),yr=parseFloat(X[1]),fr=parseFloat(V[1]),Ar=parseFloat(tr[1]);wr<e&&(e=wr),yr<h&&(h=yr),wr+fr>l&&(l=wr+fr),yr+Ar>C&&(C=yr+Ar)}}}return e<1/0?{x:e,y:h,w:l-e,h:C-h}:null}function Zo(r){var a=String(r||"");function e(h){return new RegExp('id="(?:cl|c4|lg|t_)?'+h+'[_"]').test(a)}return{title:e("title"),header:e("header"),footer:e("footer"),caption:e("caption"),legend:e("legend")}}function jt(r,a,e){if(r==null)return"";var h=r.floatingNotes!=null&&r.floatingNotes.length>0?r.floatingNotes:null,l=fn(r.title),C=fn(r.header),b=fn(r.footer),Z=fn(r.caption),v=r.legend!=null&&r.legend.lines!=null&&r.legend.lines.length>0?r.legend:null;if(l==null&&C==null&&b==null&&Z==null&&v==null&&h==null)return"";var er=Zo(a),X=_o(a);if(X==null)return"";var V=0;function tr(he){return he+"_"+V++}function wr(he,Te,ae,it){var Gt="text;html=1;fillColor=none;strokeColor=none;fontSize="+Te+";"+(ae?"fontStyle=1;":"")+"fontColor="+(Te===Kt?"#888888":"#000000")+";align="+it+";verticalAlign=middle;whiteSpace=wrap;";return M(Gt,H(e,["document",he],null,"text"))}function yr(he,Te){return Te==="left"?X.x:Te==="right"?X.x+X.w-he:X.x+(X.w-he)/2}var fr="",Ar=X.y;if(h!=null){var jr=[],ce=0,Nr;for(Nr=0;Nr<h.length;Nr++){for(var de=(h[Nr].lines||[]).join(`
+`}var ne=17,ye=18,Je=5,_o=9,Oo=7;function qe(r){var l=/^(?:<#(\w+)>)?\|(.*)\|$/,e=[],c=null,i,h,F;for(i=0;i<r.length;i++){var j=l.exec(r[i]);if(j){var p=j[2].split("|"),or={fill:j[1]?Y(j[1]):null,cells:[]};for(h=0;h<p.length;h++){var q=p[h].replace(/^\s+|\s+$/g,""),rr={text:"",bold:!1,fill:null};q.charAt(0)==="="&&(rr.bold=!0,q=q.substring(1).replace(/^\s+/,""));var nr=/^<#(\w+)>\s*/.exec(q);nr&&(rr.fill=Y(nr[1]),q=q.substring(nr[0].length)),rr.text=q.replace(/^<[lrc]>\s*/,""),or.cells.push(rr)}(c==null||c.kind!=="table")&&(c={kind:"table",rows:[]},e.push(c)),c.rows.push(or)}else(c==null||c.kind!=="text")&&(c={kind:"text",lines:[]},e.push(c)),c.lines.push(r[i])}var Xr=0,wr=0,pr=!1;for(i=0;i<e.length;i++){var Dr=e[i];if(Dr.kind==="table"){for(pr=!0,Dr.colW=[],h=0;h<Dr.rows.length;h++)for(F=0;F<Dr.rows[h].cells.length;F++){var Ze=Dr.rows[h].cells[F],he=Math.round(Hr(s(Ze.text),14,Ze.bold)+_o);Dr.colW[F]>=he||(Dr.colW[F]=he)}for(Dr.w=0,F=0;F<Dr.colW.length;F++)Dr.w+=Dr.colW[F];Dr.h=Dr.rows.length*ye,wr+=Dr.h+4}else{for(Dr.w=0,h=0;h<Dr.lines.length;h++)Dr.w=Math.max(Dr.w,Math.ceil(Hr(s(Dr.lines[h]),14,!1)));Dr.h=Dr.lines.length*ne,wr+=Dr.h}Xr=Math.max(Xr,Dr.w)}return{blocks:e,contentW:Xr,hasTable:pr,w:Math.max(40,Xr+2*Je),h:wr+2*Je}}function St(r,l,e,c,i,h){var F=c("legend"),j=h||"1",p="rounded=1;absoluteArcSize=1;arcSize=15;fillColor="+(i||"#DDDDDD")+";strokeColor=#000000;strokeWidth=1;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacing=0;spacingLeft="+Je+";spacingTop="+Je+";whiteSpace=wrap;html=1;",or,q,rr;if(!r.hasTable){var nr=[];for(or=0;or<r.blocks.length;or++)nr=nr.concat(r.blocks[or].lines);return z(F,t(nr.join(`
+`)),p,l,e,r.w,r.h,j)}var Xr=u(F,"",p+"container=1;collapsible=0;",l,e,r.w,r.h,j),wr=Je;for(or=0;or<r.blocks.length;or++){var pr=r.blocks[or];if(pr.kind==="text"){Xr+=z(c("legendtext"),t(pr.lines.join(`
+`)),"text;html=1;strokeColor=none;fillColor=none;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacing=0;whiteSpace=wrap;",Je,wr,r.contentW,pr.h,F),wr+=pr.h;continue}wr+=2;var Dr=c("legendtable");for(Xr+=u(Dr,"","shape=table;childLayout=tableLayout;container=1;collapsible=0;startSize=0;rowLines=1;fixedRows=1;resizeLast=1;fillColor=none;strokeColor=#000000;strokeWidth=1;fontSize=14;whiteSpace=wrap;",Je,wr,pr.w,pr.h,F),q=0;q<pr.rows.length;q++){var Ze=pr.rows[q],he=c("legendrow");Xr+=u(he,"","shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;collapsible=0;dropTarget=0;strokeColor=#000000;top=0;left=0;right=0;bottom=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fillColor="+(Ze.fill||"none")+";",0,q*ye,pr.w,ye,Dr);var Pr=0;for(rr=0;rr<pr.colW.length;rr++){var ve=Ze.cells[rr]||{text:"",bold:!1,fill:null},xr=rr===pr.colW.length-1,qr=xr?pr.w-Pr:pr.colW[rr];Xr+=z(c("legendcell"),t(ve.text),"shape=partialRectangle;connectable=0;overflow=hidden;fillColor="+(ve.fill||"none")+";top=0;left=0;bottom=0;right="+(xr?0:1)+";strokeColor=#000000;whiteSpace=wrap;html=1;fontSize=14;fontColor=#000000;align=left;spacing=0;spacingLeft=4;verticalAlign=middle;"+(ve.bold?"fontStyle=1;":""),Pr,0,qr,ye,he),Pr+=qr}}wr+=pr.h+2}return Xr}var ht=11.78,nn=16.49,Tt=10,Lo=14;function Qt(r){if(r==null)return null;var l=typeof r=="object"?r.text:r;return l==null||String(l)===""?null:String(l)}function pt(r,l){var e=r!=null&&typeof r=="object"?r.align:null;return e==="left"||e==="right"||e==="center"?e:l}function So(r){for(var l=/<mxCell\b([^>]*)>\s*<mxGeometry\b([^>]*)\/?>/g,e=1/0,c=1/0,i=-1/0,h=-1/0,F;(F=l.exec(String(r||"")))!=null;){var j=F[1],p=F[2];if(!(!/\bvertex="1"/.test(j)||!/\bparent="1"/.test(j))){var or=/\bx="(-?[\d.]+)"/.exec(p),q=/\by="(-?[\d.]+)"/.exec(p),rr=/\bwidth="(-?[\d.]+)"/.exec(p),nr=/\bheight="(-?[\d.]+)"/.exec(p);if(!(or==null||q==null||rr==null||nr==null)){var Xr=parseFloat(or[1]),wr=parseFloat(q[1]),pr=parseFloat(rr[1]),Dr=parseFloat(nr[1]);Xr<e&&(e=Xr),wr<c&&(c=wr),Xr+pr>i&&(i=Xr+pr),wr+Dr>h&&(h=wr+Dr)}}}return e<1/0?{x:e,y:c,w:i-e,h:h-c}:null}function it(r){var l=String(r||"");function e(c){return new RegExp('id="(?:cl|c4|lg|t_)?'+c+'[_"]').test(l)}return{title:e("title"),header:e("header"),footer:e("footer"),caption:e("caption"),legend:e("legend")}}function qt(r,l,e){if(r==null)return"";var c=r.floatingNotes!=null&&r.floatingNotes.length>0?r.floatingNotes:null,i=Qt(r.title),h=Qt(r.header),F=Qt(r.footer),j=Qt(r.caption),p=r.legend!=null&&r.legend.lines!=null&&r.legend.lines.length>0?r.legend:null;if(i==null&&h==null&&F==null&&j==null&&p==null&&c==null)return"";var or=it(l),q=So(l);if(q==null)return"";var rr=0;function nr(yo){return yo+"_"+rr++}function Xr(yo,ie,pe,Mo){var Zt="text;html=1;fillColor=none;strokeColor=none;fontSize="+ie+";"+(pe?"fontStyle=1;":"")+"fontColor="+(ie===Tt?"#888888":"#000000")+";align="+Mo+";verticalAlign=middle;whiteSpace=wrap;";return H(Zt,U(e,["document",yo],null,"text"))}function wr(yo,ie){return ie==="left"?q.x:ie==="right"?q.x+q.w-yo:q.x+(q.w-yo)/2}var pr="",Dr=q.y;if(c!=null){var Ze=[],he=0,Pr;for(Pr=0;Pr<c.length;Pr++){for(var ve=(c[Pr].lines||[]).join(`
`).split(`
-`),Fr=0,Ir=0;Ir<de.length;Ir++)Fr=Math.max(Fr,Math.ceil(is(de[Ir],13,!1)));var qe=Math.round(de.length*17.7+12);jr.push({text:de.join(`
-`),w:Fr+20,h:qe}),qe>ce&&(ce=qe)}Ar-=ce+8;var To=X.x;for(Nr=0;Nr<jr.length;Nr++){var ne=h[Nr].color&&Y(h[Nr].color)||"#FEFFDD";fr+=s(tr("fnote"),jr[Nr].text,"shape=note;size=10;fillColor="+ne+";strokeColor=#181818;fontSize=13;fontColor=#000000;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=4;",Math.round(To),Math.round(Ar),jr[Nr].w,jr[Nr].h,"1"),To+=jr[Nr].w+15}}if(l!=null&&!er.title){var po=String(l).replace(/\\n/g,`
+`),xr=0,qr=0;qr<ve.length;qr++)xr=Math.max(xr,Math.ceil(Ss(ve[qr],13,!1)));var ze=Math.round(ve.length*17.7+12);Ze.push({text:ve.join(`
+`),w:xr+20,h:ze}),ze>he&&(he=ze)}Dr-=he+8;var wo=q.x;for(Pr=0;Pr<Ze.length;Pr++){var me=c[Pr].color&&Y(c[Pr].color)||"#FEFFDD";pr+=u(nr("fnote"),Ze[Pr].text,"shape=note;size=10;fillColor="+me+";strokeColor=#181818;fontSize=13;fontColor=#000000;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=4;",Math.round(wo),Math.round(Dr),Ze[Pr].w,Ze[Pr].h,"1"),wo+=Ze[Pr].w+15}}if(i!=null&&!or.title){var ue=String(i).replace(/\\n/g,`
`).split(`
-`),ao=Math.max(40,Math.ceil(is(l,ut,!0))+10),A=Math.round(un*po.length+8);Ar-=A+10,fr+=K(tr("title"),n(l),wr("title",ut,!0,"center"),yr(ao,"center"),Ar,ao,A,"1")}if(C!=null&&!er.header){var J=vt(r.header,"right"),ur=String(C).replace(/\\n/g,`
+`),po=Math.max(40,Math.ceil(Ss(i,Lo,!0))+10),x=Math.round(nn*ue.length+8);Dr-=x+10,pr+=z(nr("title"),t(i),Xr("title",Lo,!0,"center"),wr(po,"center"),Dr,po,x,"1")}if(h!=null&&!or.header){var S=pt(r.header,"right"),fr=String(h).replace(/\\n/g,`
`).split(`
-`),Sr=Math.max(20,Math.ceil(is(C,Kt,!1))+8),Er=Math.round(Cn*ur.length+1);Ar-=Er+2,fr+=K(tr("header"),n(C),wr("header",Kt,!1,J),yr(Sr,J),Ar,Sr,Er,"1")}var qr=X.y+X.h+4;if(v!=null&&!er.legend){var z=We(v.lines),Mr=v.position==="left"?"left":v.position==="right"?"right":"center";fr+=Tt(z,Math.round(yr(z.w,Mr)),Math.round(qr+2),tr,null,"1"),qr+=z.h+8}if(Z!=null&&!er.caption){var Be=String(Z).replace(/\\n/g,`
+`),zr=Math.max(20,Math.ceil(Ss(h,Tt,!1))+8),Lr=Math.round(ht*fr.length+1);Dr-=Lr+2,pr+=z(nr("header"),t(h),Xr("header",Tt,!1,S),wr(zr,S),Dr,zr,Lr,"1")}var te=q.y+q.h+4;if(p!=null&&!or.legend){var W=qe(p.lines),Zr=p.position==="left"?"left":p.position==="right"?"right":"center";pr+=St(W,Math.round(wr(W.w,Zr)),Math.round(te+2),nr,null,"1"),te+=W.h+8}if(j!=null&&!or.caption){var Re=String(j).replace(/\\n/g,`
`).split(`
-`),ye=Math.max(40,Math.ceil(is(Z,ut,!1))+10),Le=Math.round(un*Be.length+2);fr+=K(tr("caption"),n(Z),wr("caption",ut,!1,"center"),yr(ye,"center"),qr,ye,Le,"1"),qr+=Le+1}if(b!=null&&!er.footer){var _e=vt(r.footer,"center"),Ur=String(b).replace(/\\n/g,`
+`),Ae=Math.max(40,Math.ceil(Ss(j,Lo,!1))+10),Pe=Math.round(nn*Re.length+2);pr+=z(nr("caption"),t(j),Xr("caption",Lo,!1,"center"),wr(Ae,"center"),te,Ae,Pe,"1"),te+=Pe+1}if(F!=null&&!or.footer){var De=pt(r.footer,"center"),Qr=String(F).replace(/\\n/g,`
`).split(`
-`),yo=Math.max(20,Math.ceil(is(b,Kt,!1))+8),fo=Math.round(Cn*Ur.length+1);fr+=K(tr("footer"),n(b),wr("footer",Kt,!1,_e),yr(yo,_e),qr,yo,fo,"1")}return fr}function zt(r,a){var e=r.participants,h=r.elements,l="",C=0,b=r.skin||{},Z="",v="",er=Y(b.sequencedividerbackgroundcolor)||"#EEEEEE",X=Y(b.sequencedividerbordercolor)||"#000000",V=Y(b.sequencedividerfontcolor)||"#000000",tr=Y(b.sequencelifelinebackgroundcolor)||"#FFFFFF",wr=Y(b.sequencearrowcolor||b.arrowcolor)||null,yr=parseFloat(b.sequencearrowthickness||b.arrowthickness)||null,fr=parseFloat(b.sequencelinethickness||b.linethickness)||null,Ar=(b.sequencemessagealign||"").toLowerCase(),jr=r.hideStereotype===!0,ce=r.styleSheet||null,Nr=["fillColor","gradientColor"];function de(Ht){return Ht[0]==="document"?["root"].concat(Ht):["root","element","sequenceDiagram"].concat(Ht)}function Fr(Ht,ya,Oa,St,kl){return W(Ht,ce,de(ya),Oa||[],St||"vertex",kl)}function Ir(Ht){return Ht+"_"+C++}var qe={};function To(Ht,ya,Oa,St,kl,bl,ms,gu,_n,En,Xi){var ss=Math.round((St+bl)/2);if(St!==bl){var Cs=qe[St<bl?_n:En]||null,es=qe[St<bl?En:_n]||null,os=Math.min(St,bl)+4,qi=Math.max(St,bl)-4;Cs&&(os=Math.max(os,Cs.x+Cs.w+8)),es&&(qi=Math.min(qi,es.x-8)),os>qi?ss=Math.round((os+qi)/2):ss<os?ss=Math.round(os):ss>qi&&(ss=Math.round(qi))}var Ms=Xi!=null?{value:d(Xi),style:String(Oa||"")}:P(ya,Oa);return' <mxCell id="'+d(Ht)+'" value="'+Ms.value+'" style="'+d(Ms.style)+'" edge="1"'+(_n?' source="'+d(_n)+'"':"")+(En?' target="'+d(En)+'"':"")+` parent="1">
+`),Po=Math.max(20,Math.ceil(Ss(F,Tt,!1))+8),Qe=Math.round(ht*Qr.length+1);pr+=z(nr("footer"),t(F),Xr("footer",Tt,!1,De),wr(Po,De),te,Po,Qe,"1")}return pr}function Pt(r,l){var e=r.participants,c=r.elements,i="",h=0,F=r.skin||{},j="",p="",or=Y(F.sequencedividerbackgroundcolor)||"#EEEEEE",q=Y(F.sequencedividerbordercolor)||"#000000",rr=Y(F.sequencedividerfontcolor)||"#000000",nr=Y(F.sequencelifelinebackgroundcolor)||"#FFFFFF",Xr=Y(F.sequencearrowcolor||F.arrowcolor)||null,wr=parseFloat(F.sequencearrowthickness||F.arrowthickness)||null,pr=parseFloat(F.sequencelinethickness||F.linethickness)||null,Dr=(F.sequencemessagealign||"").toLowerCase(),Ze=r.hideStereotype===!0,he=r.styleSheet||null,Pr=["fillColor","gradientColor"];function ve(gn){return gn[0]==="document"?["root"].concat(gn):["root","element","sequenceDiagram"].concat(gn)}function xr(gn,Pa,kl,bl,si){return X(gn,he,ve(Pa),kl||[],bl||"vertex",si)}function qr(gn){return gn+"_"+h++}var ze={};function wo(gn,Pa,kl,bl,si,ql,ji,gu,za,as,Gs){var vs=Math.round((bl+ql)/2);if(bl!==ql){var ws=ze[bl<ql?za:as]||null,Ln=ze[bl<ql?as:za]||null,Sn=Math.min(bl,ql)+4,pi=Math.max(bl,ql)-4;ws&&(Sn=Math.max(Sn,ws.x+ws.w+8)),Ln&&(pi=Math.min(pi,Ln.x-8)),Sn>pi?vs=Math.round((Sn+pi)/2):vs<Sn?vs=Math.round(Sn):vs>pi&&(vs=Math.round(pi))}var ls=Gs!=null?{value:g(Gs),style:String(kl||"")}:P(Pa,kl);return' <mxCell id="'+g(gn)+'" value="'+ls.value+'" style="'+g(ls.style)+'" edge="1"'+(za?' source="'+g(za)+'"':"")+(as?' target="'+g(as)+'"':"")+` parent="1">
<mxGeometry x="`+Math.round(gu*1e3)/1e3+`" relative="1" as="geometry">
- <mxPoint x="`+St+'" y="'+kl+`" as="sourcePoint"/>
- <mxPoint x="`+bl+'" y="'+ms+`" as="targetPoint"/>
+ <mxPoint x="`+bl+'" y="'+si+`" as="sourcePoint"/>
+ <mxPoint x="`+ql+'" y="'+ji+`" as="targetPoint"/>
<Array as="points">
- <mxPoint x="`+ss+'" y="'+kl+`"/>
+ <mxPoint x="`+vs+'" y="'+si+`"/>
</Array>
</mxGeometry>
</mxCell>
-`}function ne(Ht,ya,Oa,St,kl){return' <mxCell id="'+d(Ht)+'" value="" style="ellipse;fillColor='+Oa+';strokeColor=none;connectable=0;locked=1;deletable=0;" vertex="1" parent="'+d(ya)+`">
+`}function me(gn,Pa,kl,bl,si){return' <mxCell id="'+g(gn)+'" value="" style="ellipse;fillColor='+kl+';strokeColor=none;connectable=0;locked=1;deletable=0;" vertex="1" parent="'+g(Pa)+`">
<mxGeometry x="1" y="0" width="10" height="10" relative="1" as="geometry">
- <mxPoint x="`+St+'" y="'+kl+`" as="offset"/>
+ <mxPoint x="`+bl+'" y="'+si+`" as="offset"/>
</mxGeometry>
</mxCell>
-`}for(var po={},ao=0;ao<e.length;ao++)po[e[ao].id]=ao;var A=e.length;function J(Ht,ya){return Ht!=null&&po.hasOwnProperty(Ht)?po[Ht]:ya}for(var ur=[],Sr=[],Er=[],qr=[],z=0;z<A;z++){var Mr=e[z],Be=Gr(Mr.name,14,!1),ye=Be+w,Le=I+15*Math.max(0,$e(Mr.name)-1);if(Mr.stereoLetter)ye=Math.max(Be,Gr(Mr.stereotype||"",14,!1))+42,Le=52;else if(Mr.stereotype&&!jr)ye=Math.max(Be,Gr(Mr.stereotype,14,!1)+12)+w,Le=52;else if(Mr.bodyLines&&Mr.bodyLines.length>0){for(var _e=0,Ur=10,yo=0;yo<Mr.bodyLines.length;yo++){var fo=Mr.bodyLines[yo];if(Yr(fo)){Ur+=Ee;continue}var he=/^(=+)\s*/.exec(fo),Te=/^"{2}.*"{2}$/.test(fo),ae=he?Zr(he[1].length):14,it=u(fo.replace(/^=+\s*/,"").replace(/^"{2}|"{2}$/g,""));_e=Math.max(_e,Te?it.length*Ze:Gr(it,ae,!!he)),Ur+=Math.ceil(ae*1.2)}ye=Math.ceil(_e)+w+4,Le=Math.max(I,Ur)}var Gt=0,oo=0;Mr.kind==="actor"?(Gt=24,oo=38):Mr.kind==="boundary"?(Gt=38,oo=28):Mr.kind==="control"||Mr.kind==="entity"?(Gt=28,oo=28):Mr.kind==="database"?(Gt=36,oo=34):Mr.kind==="queue"?(Gt=44,oo=22):Mr.kind==="collections"&&(ye=Be+24),Gt>0&&(ye=Math.max(Be,Gt),Le=oo+19*Math.max(1,$e(Mr.name))),ur.push(Math.max(24,ye)),Sr.push(Le),Er.push(Gt),qr.push(oo)}var pt=I,rt=I;for(z=0;z<A;z++)Sr[z]>pt&&(pt=Sr[z]),Er[z]===0&&!(e[z].bodyLines&&e[z].bodyLines.length>0)&&Sr[z]>rt&&(rt=Sr[z]);for(z=0;z<A;z++)Er[z]===0&&!(e[z].bodyLines&&e[z].bodyLines.length>0)&&Sr[z]<rt&&(Sr[z]=rt);var jo=[],Qt=r.boxes||[];for(z=0;z<A;z++)jo.push(-1);for(var Me=0;Me<Qt.length;Me++)for(var Io=Qt[Me].participants||[],Wo=0;Wo<Io.length;Wo++)po.hasOwnProperty(Io[Wo])&&(jo[po[Io[Wo]]]=Me);var Ro=!1;for(z=0;z<A;z++)jo[z]>=0&&(Ro=!0);var An=[];for(z=0;z+1<A;z++){var dn=lr+(Ro&&jo[z]!==jo[z+1]?14:0);An.push(ur[z]/2+ur[z+1]/2+dn)}var rn=[],Ao=0,_t=0;function ft(Ht,ya,Oa){if(!(Ht===ya||Ht==null||ya==null)){var St=Math.min(Ht,ya),kl=Math.max(Ht,ya);kl-St===1?Oa>An[St]&&(An[St]=Oa):rn.push({lo:St,hi:kl,dist:Oa})}}var Se=0,Go=0,wt={};for(z=0;z<A;z++)wt[e[z].id]=0;function cn(Ht){return Ht!=null&&wt[Ht]>0?5*wt[Ht]:0}for(var No=0;No<h.length;No++){var oe=h[No];if((oe.type==="activate"||oe.type==="deactivate"||oe.type==="destroy")&&wt.hasOwnProperty(oe.participant)){wt[oe.participant]=oe.type==="activate"?wt[oe.participant]+1:oe.type==="deactivate"?Math.max(0,wt[oe.participant]-1):0;continue}if(oe.type==="message"){var Uo=J(oe.from,0),Ot=J(oe.to,0),ho=oe.label||"";oe.number!=null&&(ho=oe.number+" "+ho);var dt=Gr(ho,13,!1),Aa=No+1<h.length?h[No+1]:null,Sn=oe.to!=null&&(oe.activate===oe.to||Aa!=null&&Aa.type==="activate"&&Aa.participant===oe.to),an=cn(oe.from)+cn(oe.to)+(Sn?5:0);if(oe.deactivate&&wt[oe.deactivate]>0&&wt[oe.deactivate]--,oe.activate!=null&&wt.hasOwnProperty(oe.activate)&&wt[oe.activate]++,oe.fromEdge||oe.toEdge){var we=J(oe.fromEdge?oe.to:oe.from,0),Eo=dt+nr+an+(oe.tailDecor==="circle"||oe.headDecor==="circle"?12:0);(oe.fromEdge||oe.toEdge)==="left"?we===0?Ao=Math.max(Ao,Eo-x-ur[0]/2):ft(we-1,we,Eo):A>0&&(we===A-1?_t=Math.max(_t,Eo+5-x-ur[A-1]/2):ft(we,we+1,Eo)),Se=we,Go=we;continue}if(Uo===Ot){var Et=dt+55+cn(oe.from);Uo+1<A?ft(Uo,Uo+1,Et):Et-ur[Uo]/2>_t&&(_t=Et-ur[Uo]/2)}else ft(Uo,Ot,dt+ir+an),Se=Math.min(Uo,Ot),Go=Math.max(Uo,Ot)}else if(oe.type==="note"){var Cr=Ye(oe.text,oe.shape),Lr=oe.over&&oe.over.length>0?J(oe.over[0],null):null;if(oe.position==="left"||oe.position==="top"||oe.position==="bottom"){var He=Lr??Se;He<=0?Cr+4-ur[0]/2>Ao&&(Ao=Cr+4-ur[0]/2):ft(He-1,He,Cr+9+ur[He-1]/2)}else if(oe.position==="right"){var Ie=Lr??Go;Ie>=A-1?A>0&&Cr+4-ur[A-1]/2>_t&&(_t=Cr+4-ur[A-1]/2):ft(Ie,Ie+1,Cr+9+ur[Ie+1]/2)}else oe.over&&oe.over.length>1?ft(J(oe.over[0],0),J(oe.over[oe.over.length-1],0),Cr-40):Lr!=null&&A>0&&(Lr===0&&Cr/2-ur[0]/2>Ao&&(Ao=Cr/2-ur[0]/2),Lr===A-1&&Cr/2-ur[A-1]/2>_t&&(_t=Cr/2-ur[A-1]/2))}}var Oe=[];if(A>0)for(Oe[0]=x+Ao+(jo[0]>=0?re:0)+ur[0]/2,z=1;z<A;z++){for(var so=Oe[z-1]+An[z-1],Xo=0;Xo<rn.length;Xo++)rn[Xo].hi===z&&Oe[rn[Xo].lo]+rn[Xo].dist>so&&(so=Oe[rn[Xo].lo]+rn[Xo].dist);Oe[z]=so}var qo=A>0?Oe[A-1]+ur[A-1]/2+(jo[A-1]>=0?re:0)+_t+x:120;for(No=0;No<h.length;No++)if(h[No].type==="divider"){var Yn=Gr(h[No].label||"",13,!0)+57;Yn>qo&&(qo=Yn)}function Nt(Ht){return Oe[Ht]!=null?Oe[Ht]:x}var Da={},je=x+(Ro?ee+1:0),_r=je+pt,Ho=[];for(z=0;z<A;z++)Ho[z]=null;var Ce=_r+3,ln=[],nt=[],wo=[],xn=null,Lt=null;function Ft(Ht){for(var ya=0;ya<nt.length;ya++)Ht<nt[ya].min&&(nt[ya].min=Ht),Ht>nt[ya].max&&(nt[ya].max=Ht)}for(No=0;No<h.length;No++){var fe=h[No],ge={el:fe};switch(ln.push(ge),fe.type){case"message":{var qt=fe.from!=null?J(fe.from,0):null,et=fe.to!=null?J(fe.to,0):null,en=fe.fromEdge||null,Zt=fe.toEdge||null;if(fe.isReturn&&fe.from==null){var qn=wo.length?wo.pop():null,Ko=null;if(qn!=null)qt=qn.calleeIdx,et=qn.callerIdx,en=qn.calleeEdge,Zt=qn.callerEdge,ge.returnCloses=qn.closes,Ko=qn.el;else if(Lt!=null&&Lt!=="group"&&Lt.fromEdge==null&&Lt.toEdge==null)Lt.kind==="self"?(qt=Lt.idx,et=Lt.idx):(qt=Lt.toIdx,et=Lt.fromIdx),Ko=Lt.el;else{vo.droppedLine(a,"sequence",fe.index,fe.raw!=null?fe.raw:"return",'returns with no call to answer (plantuml.jar answers "Nowhere to return to.")'),ge.kind="dropped";break}if(Ko!=null){var Hn={};for(var aa in fe)Object.prototype.hasOwnProperty.call(fe,aa)&&(Hn[aa]=fe[aa]);Hn.arrowHead=Ko.arrowHead||fe.arrowHead,Hn.headDecor=Ko.headDecor||null,Hn.tailDecor=Ko.tailDecor||null,Hn.color=fe.color||Ko.color||null,ge.el=fe=Hn}}var Je=fe.label||"",sn=null;if(fe.number!=null){var Bn=fe.numberText!=null?fe.numberText:String(fe.number),$t=u(Bn);$t!==Bn&&(sn=g(Bn)+" "+Q(Je)),Je=$t+" "+Je}var mo=$e(Je);if(fe.from!=null&&fe.from===fe.to||fe.isReturn&&qt!=null&&qt===et){ge.kind="self",ge.outY=Ce+(mo?17+Or*mo:14),ge.backY=ge.outY+20,ge.idx=qt,ge.label=Je,ge.labelHtml=sn,Ce=ge.backY,Ft(qt),Lt=ge;break}ge.kind="msg",ge.fromIdx=qt,ge.toIdx=et,ge.fromEdge=en,ge.toEdge=Zt,ge.label=Je,ge.labelHtml=sn;var Pt=No+1<h.length?h[No+1]:null;if(Pt!=null&&Pt.type==="note"&&(!Pt.over||Pt.over.length===0)&&(Pt.position==="left"||Pt.position==="right"||Pt.position==="top"||Pt.position==="bottom")){var ra=$e(Pt.text)*mr+9.3;ge.noteTop=Ce+13,ge.lineY=ge.noteTop+ra/2+8,Ce=Math.max(ge.lineY,ge.noteTop+ra)}else ge.lineY=Ce+(mo?17+Or*mo:14),Ce=ge.lineY;qt!=null&&Ft(qt),et!=null&&Ft(et);var Ut=Da[fe.to]===!0?fe.to:Da[fe.from]===!0?fe.from:null;if(Ut!=null){var Wn=po[Ut];ge.createIdx=Wn,Ho[Wn]=ge.lineY-23.7,Da[Ut]=!1,Ce=Math.max(Ce,Ho[Wn]+Sr[Wn]+3)}xn=ge,Lt=ge,fe.activate&&et!==qt&&wo.push({callerIdx:qt,calleeIdx:et,callerEdge:en,calleeEdge:Zt,closes:fe.activate,el:fe});break}case"note":{var yt=$e(fe.text),Zn=yt*mr+9.3,on=ln.length>1?ln[ln.length-2]:null,va=(!fe.over||fe.over.length===0)&&(fe.position==="left"||fe.position==="right"||fe.position==="top"||fe.position==="bottom")&&on!=null&&on.kind==="msg";if(ge.h=Zn,va)ge.kind="noteAttached",ge.top=on.noteTop!=null?on.noteTop:on.lineY!=null?on.lineY-Zn/2-8:Ce+13,ge.anchorLo=on.fromIdx!=null?Math.min(on.fromIdx,on.toIdx):0,ge.anchorHi=on.fromIdx!=null?Math.max(on.fromIdx,on.toIdx):0;else if(ge.kind="note",ge.top=Ce+13,Ce=ge.top+Zn+2,fe.over&&fe.over.length)for(var ga=0;ga<fe.over.length;ga++)Ft(J(fe.over[ga],0));else fe.position==="across"&&A>0&&(Ft(0),Ft(A-1));break}case"divider":{ge.kind="divider",ge.barY=Ce+31,Ce=ge.barY+13;break}case"delay":{ge.kind="delay",ge.top=Ce+8,ge.lines=fe.label?fe.label.split(`
-`).length:0,ge.h=28+13*ge.lines,Ce=ge.top+ge.h-11;break}case"gap":{Ce+=fe.h!=null?fe.h:25;break}case"groupStart":{ge.kind="group",ge.groupKind=fe.kind,ge.label=fe.label||"",ge.cond=fe.cond||null,ge.color=fe.color||null,ge.headColor=fe.headColor||null,ge.top=Ce+15,ge.min=A,ge.max=-1,ge.elses=[],ge.hidden=fe.kind==="par2",nt.push(ge),Ce=ge.top+11.5,ge.branchStart=Ce,ge.branchMax=Ce;break}case"groupElse":{Lt="group";var jn=nt.length?nt[nt.length-1]:null;if(jn!=null&&jn.hidden){jn.branchMax=Math.max(jn.branchMax,Ce),Ce=jn.branchStart;break}var Fn=Ce+9;jn?.elses.push({y:Fn,label:fe.label||""}),Ce=Fn-7+(fe.label?15.3:0);break}case"groupEnd":{Lt="group";var Mn=nt.pop();Mn!=null&&(Mn.hidden&&(Ce=Math.max(Ce,Mn.branchMax)),Mn.bottom=Ce+8,Ce=Mn.bottom-1);break}case"ref":{if(ge.kind="ref",ge.top=Ce+11,ge.h=44+Math.max(0,$e(fe.label)-1)*Or,Ce=ge.top+ge.h-3,fe.over&&fe.over.length)for(var la=0;la<fe.over.length;la++)Ft(J(fe.over[la],0));break}case"create":{fe.participant!=null&&(Da[fe.participant]=!0);break}case"activate":case"deactivate":case"destroy":{ge.kind=fe.type,ge.y=Ce;var Tn=J(fe.participant,null);if(fe.type==="activate"&&Tn!=null&&xn!=null&&xn.toIdx===Tn&&xn.fromIdx!==Tn)wo.push({callerIdx:xn.fromIdx,calleeIdx:Tn,el:xn.el});else if(fe.type!=="activate"&&Tn!=null){for(var gt=wo.length-1;gt>=0;gt--)if(wo[gt].calleeIdx===Tn){wo.splice(gt,1);break}}break}default:break}}for(;nt.length;){var Rt=nt.pop();Rt.hidden&&(Ce=Math.max(Ce,Rt.branchMax)),Rt.bottom=Ce+8,Ce=Rt.bottom-1}var Jt=Ce+Qr,ct={};for(z=0;z<A;z++)ct[e[z].id]=[];function wn(Ht){for(var ya=ct[Ht],Oa=0,St=0;St<ya.length;St++)ya[St].end==null&&Oa++;return Oa}for(var In=0;In<ln.length;In++){var ko=ln[In];if(ko.kind==="activate"&&ko.el.participant!=null&&ct.hasOwnProperty(ko.el.participant))ct[ko.el.participant].push({start:ko.y,end:null,depth:wn(ko.el.participant),color:ko.el.color,lineColor:ko.el.lineColor});else if(ko.kind==="deactivate"&&ko.el.participant==null){for(var Do=null,Rr=0;Rr<A;Rr++)for(var xr=ct[e[Rr].id],br=0;br<xr.length;br++)xr[br].end==null&&(Do==null||xr[br].start>=Do.start)&&(Do=xr[br]);Do!=null&&(Do.end=ko.y)}else if(ko.kind==="deactivate"&&ko.el.participant!=null&&ct.hasOwnProperty(ko.el.participant)){for(var Br=ct[ko.el.participant],Pr=Br.length-1;Pr>=0;Pr--)if(Br[Pr].end==null){Br[Pr].end=ko.y;break}}else if(ko.kind==="destroy"&&ko.el.participant!=null&&ct.hasOwnProperty(ko.el.participant))for(var Xe=ct[ko.el.participant],zr=0;zr<Xe.length;zr++)Xe[zr].end==null&&(Xe[zr].end=ko.y);else if(ko.kind==="msg"&&ko.returnCloses!=null&&ct.hasOwnProperty(ko.returnCloses)){for(var Ke=ct[ko.returnCloses],De=Ke.length-1;De>=0;De--)if(Ke[De].end==null){Ke[De].end=ko.lineY;break}}else if(ko.kind==="msg"){if(ko.el.deactivate&&ct.hasOwnProperty(ko.el.deactivate)){for(var ze=ct[ko.el.deactivate],So=ze.length-1;So>=0;So--)if(ze[So].end==null){ze[So].end=ko.lineY;break}}ko.el.activate&&ct.hasOwnProperty(ko.el.activate)&&ct[ko.el.activate].push({start:ko.lineY,end:null,depth:wn(ko.el.activate),color:ko.el.activateColor})}}function ot(Ht,ya){if(Ht==null||Ht<0||Ht>=A)return 0;for(var Oa=ct[e[Ht].id]||[],St=0,kl=0;kl<Oa.length;kl++){var bl=Oa[kl].end!=null?Oa[kl].end:Jt;if(Oa[kl].start-1<=ya&&ya<=bl+1){var ms=5+Oa[kl].depth*5;ms>St&&(St=ms)}}return St}for(z=0;z<A;z++)for(var ve=ct[e[z].id]||[],Yt=0;Yt<ve.length;Yt++)ve[Yt].cellId=Ir("act");var At=[],ht=[],Vt=[],Pn=[];function Ae(Ht,ya){if(Ht==null||Ht<0||Ht>=A)return null;for(var Oa=ct[e[Ht].id]||[],St=null,kl=-1,bl=0;bl<Oa.length;bl++){var ms=Oa[bl].end!=null?Oa[bl].end:Jt;Oa[bl].start-1<=ya&&ya<=ms+1&&Oa[bl].depth>kl&&Oa[bl].cellId&&(St=Oa[bl].cellId,kl=Oa[bl].depth)}return St||(At[Ht]&&ya>=Pn[Ht]&&ya<=Jt?At[Ht]:null)}if(Ro)for(Me=0;Me<Qt.length;Me++){var Fe=null,le=null,Ne=Qt[Me].participants||[];for(Wo=0;Wo<Ne.length;Wo++)if(po.hasOwnProperty(Ne[Wo])){var Qe=po[Ne[Wo]];(Fe===null||Qe<Fe)&&(Fe=Qe),(le===null||Qe>le)&&(le=Qe)}if(Fe!==null){var tn=Oe[Fe]-ur[Fe]/2-re,Vo=Oe[le]+ur[le]/2+re,xo=Y(Qt[Me].color)||"#DDDDDD";l+=s(Ir("boxfr"),Qt[Me].label||"",Fr("rounded=0;fillColor="+xo+";strokeColor=#181818;strokeWidth=0.5;fontSize=14;fontColor=#000000;verticalAlign=top;align=center;spacingTop=2;html=1;whiteSpace=wrap;",["box"],null,"vertex",Qt[Me].color?Nr:null),tn,x+1,Vo-tn,Jt+pt+5-(x+1),"1")}}for(z=0;z<A;z++){var Co=e[z],mn=Ho[z]!=null?Ho[z]:_r-Sr[z],pn=Oe[z]-ur[z]/2,hn=Jt+Sr[z]-mn;if(Er[z]===0&&Co.kind!=="collections"){var Dt=Fr(Hr(Co,r.monochrome,!1).replace("shape=rectangle;",""),[Co.kind||"participant"],Co.stereotype?[Co.stereotype]:[],"vertex",Co.colorInline?Nr:null),ca="shape=umlLifeline;perimeter=lifelinePerimeter;size="+Sr[z]+";lifelineMirror=1;dashPattern=5 5;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;"+Dt+(Co.stereoLetter?"spacingLeft=24;":"")+(fr?"strokeWidth="+fr+";":""),ea=Ir("p");At[z]=ea,ht[z]=pn,Vt[z]=mn,qe[ea]={x:pn,w:ur[z]},Pn[z]=mn+Sr[z],Co.stereotype&&!jr?l+=K(ea,"<i>\xAB"+R(Co.stereotype)+"\xBB</i><br>"+R(Co.name),ca,pn,mn,ur[z],hn,"1"):Co.bodyLines&&Co.bodyLines.length>0?l+=K(ea,eo(Co.bodyLines),ca,pn,mn,ur[z],hn,"1"):l+=s(ea,Co.name,ca,pn,mn,ur[z],hn,"1"),Co.stereoLetter&&Co.stereoColor&&(l+=s(Ir("ps"),Co.stereoLetter,"ellipse;fillColor="+Co.stereoColor+";strokeColor=#181818;strokeWidth=1;fontSize=12;fontColor=#000000;align=center;verticalAlign=middle;",pn+7,mn+7,22,22,"1"));continue}var me=Ir("pl");At[z]=me,ht[z]=pn,Vt[z]=mn,qe[me]={x:pn,w:ur[z]},Pn[z]=mn+Sr[z],l+=s(me,"",Fr("shape=umlLifeline;perimeter=lifelinePerimeter;participant=none;size="+Sr[z]+";lifelineMirror=1;dashPattern=5 5;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;fillColor=none;strokeColor=#181818;strokeWidth=0.5;",["lifeLine"],null,"edge"),pn,mn,ur[z],hn,"1")}for(In=0;In<ln.length;In++){var ie=ln[In];if(!(ie.kind!=="group"||ie.hidden)){var pe,ke;ie.min<=ie.max?(pe=Oe[ie.min]-ur[ie.min]/2-10,ke=Oe[ie.max]+ur[ie.max]/2+10):(pe=x+5,ke=qo-x-5),pe<1&&(pe=1);for(var Re=0;Re<ln.length;Re++){var $o=ln[Re];if($o.kind==="self"&&$o.label&&$o.outY>=ie.top&&$o.backY<=ie.bottom){var Jo=Nt($o.idx)+7+Gr($o.label,13,!1)+6+10;Jo>ke&&(ke=Jo)}}var Wt=ie.groupKind==="group"&&(ie.label||ie.cond),at=Wt?ie.label:ie.groupKind||"",Nn=Wt?ie.cond||"":ie.label,ia=Math.max(55,Gr(at,13,!0)+45),sa=Nn?Gr("["+Nn+"]",11,!0):0;ke<pe+ia+sa+30&&(ke=pe+ia+sa+30);var ka=H(ce,de(["group"]),[],"vertex"),Po=ie.color&&Y(ie.color)?Y(ie.color):ka.fillColor&&ka.fillColor!=="none"?ka.fillColor:null;Po&&(v+=s(Ir("grpbg"),"","rounded=0;fillColor="+Po+";strokeColor=none;",pe,ie.top,ke-pe,ie.bottom-ie.top,"1")),l+=s(Ir("grpframe"),"",Fr("rounded=0;fillColor=none;strokeColor=#000000;strokeWidth="+(fr||1.5)+";",["group"],null,"vertex",Nr),pe,ie.top,ke-pe,ie.bottom-ie.top,"1"),l+=s(Ir("grptab"),at,Fr("rounded=0;fillColor="+(ie.headColor&&Y(ie.headColor)?Y(ie.headColor):"#EEEEEE")+";strokeColor=#000000;strokeWidth=1.5;fontColor=#000000;fontSize=13;fontStyle=1;align=left;spacingLeft=10;verticalAlign=middle;html=1;",["groupHeader"],null,"vertex",ie.headColor?Nr:null),pe,ie.top,ia,19.7,"1"),Nn&&(l+=s(Ir("grpcond"),"["+Nn+"]","text;html=1;fontColor=#000000;fontSize=11;fontStyle=1;align=left;verticalAlign=middle;",pe+ia+10,ie.top+3,sa+8,15,"1"));for(var Ct=0;Ct<ie.elses.length;Ct++){var bt=ie.elses[Ct];l+=G(Ir("grpelse"),"",Fr("endArrow=none;html=1;strokeColor=#000000;strokeWidth=1;dashed=1;dashPattern=2 2;",["group"],null,"edge",["strokeWidth","dashed","dashPattern","fixDash"]),pe,bt.y,ke,bt.y,"1"),bt.label&&(l+=s(Ir("grpelselbl"),"["+bt.label+"]","text;html=1;fontColor=#000000;fontSize=11;fontStyle=1;align=left;verticalAlign=middle;",pe+5,bt.y+2,Gr("["+bt.label+"]",11,!0)+8,15,"1"))}}}for(In=0;In<ln.length;In++){var Vr=ln[In],to=Vr.el;switch(Vr.kind){case"msg":{var Xt=to.short?Math.ceil(Gr(Vr.label||"",13,!1))+22:0,ha=to.tailDecor==="circle",Wr=to.headDecor==="circle"||to.arrowHead==="circle",ro=Vr.fromEdge?to.short?Nt(Vr.toIdx)+(Vr.fromEdge==="left"?-1:1)*(Xt+(ha?Fo:0)):Vr.fromEdge==="left"?ha?7.5:0:qo-7:Nt(Vr.fromIdx),te=Vr.toEdge?to.short?Nt(Vr.fromIdx)+(Vr.toEdge==="left"?-1:1)*(Xt+(Wr?T:0)):Vr.toEdge==="left"?Wr?7.5:0:qo-7:Nt(Vr.toIdx),ue=te>=ro?1:-1,zo=ro+(Vr.fromIdx!=null?ue*ot(Vr.fromIdx,Vr.lineY):0),nn=te-(Vr.toIdx!=null?ue*ot(Vr.toIdx,Vr.lineY):0);Vr.createIdx!=null&&Vr.toIdx===Vr.createIdx&&(nn=te-ue*(ur[Vr.toIdx]/2+2));var Fa=zo,Kn=nn;Wr?(nn=te-ue*T,Kn=te):to.arrowHead==="lost"&&(nn=te-ue*6,Kn=te),to.tailDecor==="lost"&&(zo=ro+ue*6,Fa=ro);var bn=D(to.arrowHead)+"html=1;rounded=0;edgeStyle=none;curved=0;strokeColor="+(Y(to.color)||wr||"#181818")+";strokeWidth="+(yr||1)+";fontColor=#000000;fontSize=13;verticalAlign=bottom;labelBackgroundColor=none;";to.lineStyle==="dashed"?bn+="dashed=1;dashPattern=2 2;":to.lineStyle==="dotted"&&(bn+="dashed=1;dashPattern=1 3;"),to.tailDecor==="lost"?bn+="startArrow=cross;startSize=12;":ha&&(bn+="startArrow=oval;startFill=1;startSize="+k+";"),bn=Fr(bn,["arrow"],null,"edge",to.color?["strokeColor"]:null);var Ve=0;if(Vr.label&&nn!==zo&&Ar!=="center"){var Yo=Math.min(Fa,Kn),st=Gr(Vr.label,13,!1),Ca=Ar==="right"?Math.max(Fa,Kn)-7-st/2:Yo+(ue>0?7:17)+st/2;(Ca>Math.max(zo,nn)-4||Ca-st/2<Yo+4)&&(Ca=(zo+nn)/2),Ve=2*(Ca-zo)/(nn-zo)-1}var Mt=Vr.fromEdge?null:Ae(Vr.fromIdx,Vr.lineY),Ra=Vr.toEdge||Vr.createIdx!=null&&Vr.toIdx===Vr.createIdx||Wr||to.arrowHead==="lost"?null:Ae(Vr.toIdx,Vr.lineY),Xn=Ir("msg");l+=To(Xn,Vr.label,bn,zo,Vr.lineY,nn,Vr.lineY,Ve,Mt,Ra,Vr.labelHtml),Wr&&(l+=ne(Ir("tipdot"),Xn,Y(to.color)||wr||"#181818",ue*T-5,-5));break}case"self":{var _a=Nt(Vr.idx)+ot(Vr.idx,Vr.outY),Ka=38,yn=Y(to.color)||wr||"#181818",ua="html=1;strokeColor="+yn+";strokeWidth="+(yr||1)+";";if(to.lineStyle==="dashed"&&(ua+="dashed=1;dashPattern=2 2;"),ua=Fr(ua,["arrow"],null,"edge",to.color?["strokeColor"]:null),l+=G(Ir("msg"),"","endArrow=none;"+ua,_a,Vr.outY,_a+Ka,Vr.outY,"1"),l+=G(Ir("msg"),"","endArrow=none;"+ua,_a+Ka,Vr.outY,_a+Ka,Vr.backY,"1"),l+=G(Ir("msg"),"",D(to.arrowHead)+ua,_a+Ka,Vr.backY,_a+3,Vr.backY,"1"),Vr.label){var Ya=$e(Vr.label),fa=Ya*Or+3,xt="text;html=1;fontColor=#000000;fontSize=13;align=left;verticalAlign=middle;",Ja=Gr(Vr.label,13,!1)+6;l+=Vr.labelHtml!=null?K(Ir("msglbl"),Vr.labelHtml,xt,Nt(Vr.idx)+7,Vr.outY-fa-2,Ja,fa,"1"):s(Ir("msglbl"),Vr.label,xt,Nt(Vr.idx)+7,Vr.outY-fa-2,Ja,fa,"1")}break}case"note":case"noteAttached":{var uo=Ye(to.text,to.shape),Jn,Sa=to.over&&to.over.length>0?J(to.over[0],0):null;if(to.position==="across"&&A>0){var da=Nt(0),ma=Nt(A-1);uo<ma-da+50&&(uo=ma-da+50),Jn=(da+ma)/2-uo/2}else if(to.position==="left"||to.position==="top"||to.position==="bottom"){var Ha=Sa??(Vr.anchorLo!=null?Vr.anchorLo:0);Jn=Nt(Ha)-4-uo}else if(to.position==="right"){var Sl=Sa??(Vr.anchorHi!=null?Vr.anchorHi:0);Jn=Nt(Sl)+5}else if(to.over&&to.over.length>1){var $l=Nt(J(to.over[0],0)),ml=Nt(J(to.over[to.over.length-1],0));if(ml<$l){var Pl=$l;$l=ml,ml=Pl}uo<ml-$l+40&&(uo=ml-$l+40),Jn=($l+ml)/2-uo/2}else Jn=Nt(Sa??0)-uo/2;var Yl=Y(to.color)||(r.monochrome?"#E3E3E3":"#FEFFDD"),ri;to.shape==="box"?ri="rounded=0;fillColor="+Yl+";strokeColor=#181818;strokeWidth=0.5;":to.shape==="hexagon"?ri="shape=hexagon;size=10;fixedSize=1;fillColor="+Yl+";strokeColor=#181818;strokeWidth=0.5;":ri="shape=note;size=10;fillColor="+Yl+";strokeColor=#181818;strokeWidth=0.5;",ri+="fontColor=#000000;fontSize=13;align=left;spacingLeft=4;spacing=2;verticalAlign=middle;whiteSpace=wrap;html=1;",ri=Fr(ri,["note",to.shape==="hexagon"?"hnote":to.shape==="box"?"rnote":"note"],null,"vertex",to.color?Nr:null),Z+=s(Ir("note"),to.text||"",ri,Jn,Vr.top,uo,Vr.h,"1");break}case"divider":{var wi=H(ce,de(["separator"]),[],"vertex"),mi="endArrow=none;html=1;strokeColor="+(wi.fillColor&&wi.fillColor!=="none"?wi.fillColor:X)+";strokeWidth=1;";Z+=G(Ir("divbar"),"",mi,0,Vr.barY,qo,Vr.barY,"1"),Z+=G(Ir("divbar"),"",mi,0,Vr.barY+3,qo,Vr.barY+3,"1");var Cl=to.label||"",ll=Gr(Cl,13,!0)+18.28;Z+=s(Ir("div"),Cl,Fr("rounded=0;fillColor="+er+";strokeColor="+X+";strokeWidth=2;fontColor="+V+";fontSize=13;fontStyle=1;align=center;verticalAlign=middle;html=1;",["separator"]),(qo-ll)/2,Vr.barY-12.9,ll,25.7,"1");break}case"delay":{for(z=0;z<A;z++){var yi=jo[z]>=0?Y(Qt[jo[z]].color)||"#DDDDDD":Y(b.backgroundcolor)||"#FFFFFF";l+=s(Ir("dlmask"),"","rounded=0;strokeColor=none;fillColor="+yi+";",Nt(z)-4,Vr.top,8,Vr.h,"1"),l+=G(Ir("dllife"),"","endArrow=none;html=1;strokeColor=#181818;strokeWidth=0.5;dashed=1;dashPattern=1 4;",Nt(z),Vr.top,Nt(z),Vr.top+Vr.h,"1")}if(to.label){var rs=A>0?(Nt(0)+Nt(A-1))/2:qo/2,Xl=Math.max(40,Math.ceil(Gr(to.label,11,!1))+10),ql=13*Vr.lines+4;l+=s(Ir("delay"),to.label,Fr("text;html=1;fontColor=#000000;fontSize=11;align=center;verticalAlign=middle;",["delay"],null,"text"),Math.round(rs-Xl/2),Math.round(Vr.top+Vr.h/2-ql/2),Xl,ql,"1")}break}case"ref":{var hi=0,ei=A>0?A-1:0;if(to.over&&to.over.length>0&&(hi=J(to.over[0],0),ei=J(to.over[to.over.length-1],hi),ei<hi)){var Pi=hi;hi=ei,ei=Pi}var pa=Nt(hi)-25,kn=Nt(ei)+25-pa,Na=Gr(to.label||"",12,!1);kn<Na+47&&(kn=Na+47),l+=s(Ir("refframe"),"",Fr("rounded=0;fillColor=none;strokeColor=#000000;strokeWidth=1.5;",["reference"]),pa,Vr.top,kn,Vr.h,"1"),l+=s(Ir("reftab"),"ref",Fr("rounded=0;fillColor=#EEEEEE;strokeColor=#000000;strokeWidth=2;fontColor=#000000;fontSize=13;fontStyle=1;align=left;spacingLeft=10;verticalAlign=middle;html=1;",["referenceHeader"]),pa,Vr.top,63,19,"1"),l+=s(Ir("reflbl"),to.label||"",Fr("text;html=1;fontColor=#000000;fontSize=12;align=center;verticalAlign=middle;",["reference"],null,"text"),pa,Vr.top+21,kn,Vr.h-23,"1");break}case"destroy":{var ol=Nt(J(to.participant,0));l+=G(Ir("destx1"),"","endArrow=none;html=1;strokeColor=#A80036;strokeWidth=2;",ol-9,Vr.y-9,ol+9,Vr.y+9,"1"),l+=G(Ir("destx2"),"","endArrow=none;html=1;strokeColor=#A80036;strokeWidth=2;",ol-9,Vr.y+9,ol+9,Vr.y-9,"1");break}default:break}}for(z=0;z<A;z++)for(var il=ct[e[z].id],tl=0;tl<il.length;tl++){var ba=il[tl],dl=ba.end!=null?ba.end:Jt,Ml=Y(ba.color)||tr,Bl=Y(ba.lineColor)||"#181818",Ei=ba.lineColor?Nr.concat(["strokeColor"]):ba.color?Nr:null;l+=s(ba.cellId||Ir("act"),"",Fr("rounded=0;fillColor="+Ml+";strokeColor="+Bl+";strokeWidth=1;points=[];perimeter=orthogonalPerimeter;outlineConnect=0;portConstraint=eastwest;",["activationBox"],null,"vertex",Ei),Nt(z)-5+ba.depth*5,ba.start,10,Math.max(6,dl-ba.start),"1")}for(l+=Z,l=v+l,z=0;z<A;z++){var ta=e[z],ii=Oe[z]-ur[z]/2,Yi=Ho[z]!=null?Ho[z]:_r-Sr[z],Tl=ta.name,oi=null;ta.stereotype&&!jr?oi="<i>\xAB"+R(ta.stereotype)+"\xBB</i><br>"+R(ta.name):ta.bodyLines&&ta.bodyLines.length>0&&(oi=eo(ta.bodyLines));for(var xl=[Yi,Jt],nl=0;nl<xl.length;nl++){if(Er[z]===0&&ta.kind!=="collections"){nl===1&&ta.stereoLetter&&ta.stereoColor&&(l+=s(Ir("psf"),ta.stereoLetter,"ellipse;fillColor="+ta.stereoColor+";strokeColor=#181818;strokeWidth=1;fontSize=12;fontColor=#000000;align=center;verticalAlign=middle;",ii+7,xl[nl]+7,22,22,"1"));continue}var Gl=At[z],Zl=ht[z],Ci=Vt[z],As=Fr(Hr(ta,r.monochrome,nl===1),[ta.kind||"participant"],ta.stereotype?[ta.stereotype]:[],"vertex",ta.colorInline?Nr:null)+"part=1;";if(Er[z]>0){var za=nl===0?xl[nl]:xl[nl]+(Sr[z]-qr[z]);l+=s(Ir(nl===0?"p":"pf"),Tl,As,Oe[z]-Er[z]/2-Zl,za-Ci,Er[z],qr[z],Gl);continue}ta.kind==="collections"&&(l+=s(Ir(nl===0?"pc":"pcf"),"","rounded=0;fillColor="+(Y(ta.color)||(r.monochrome?"#E3E3E3":"#E2E2F0"))+";strokeColor=#181818;strokeWidth=0.5;part=1;",ii+4-Zl,xl[nl]-4-Ci,ur[z],Sr[z],Gl)),oi!=null?l+=K(Ir(nl===0?"p":"pf"),oi,As+(ta.stereoLetter?"spacingLeft=24;":""),ii-Zl,xl[nl]-Ci,ur[z],Sr[z],Gl):l+=s(Ir(nl===0?"p":"pf"),Tl,As,ii-Zl,xl[nl]-Ci,ur[z],Sr[z],Gl),ta.stereoLetter&&ta.stereoColor&&(l+=s(Ir(nl===0?"ps":"psf"),ta.stereoLetter,"ellipse;fillColor="+ta.stereoColor+";strokeColor=#181818;strokeWidth=1;fontSize=12;fontColor=#000000;align=center;verticalAlign=middle;part=1;",ii+7-Zl,xl[nl]+7-Ci,22,22,Gl))}}var vl=Jt;if(r.legend&&r.legend.lines&&r.legend.lines.length){for(var Va=We(r.legend.lines),Ol=0,Fl=0;Fl<A;Fl++)Sr[Fl]>Ol&&(Ol=Sr[Fl]);var cl=Jt+Ol+14,al=x+Oo,ki=r.legend.position==="left"?al:r.legend.position==="right"?Math.max(al,qo-x-Va.w):Math.max(al,(qo-Va.w)/2);l+=Tt(Va,ki,cl,Ir),vl=cl+Va.h}if(r.title){var Ln=Gr(r.title,14,!0)+10;l+=s(Ir("title"),r.title,Fr("text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",["document","title"],null,"text"),(qo-Ln)/2,-34,Ln,24,"1")}if(r.header){var Mi=Gr(r.header,11,!1)+8;l+=s(Ir("header"),r.header,Fr("text;html=1;fillColor=none;strokeColor=none;fontSize=11;fontColor=#888888;align=right;verticalAlign=middle;",["document","header"],null,"text"),qo-x-Mi,r.title?-56:-34,Mi,18,"1")}if(r.caption||r.footer){for(var vi=0,Di=0;Di<A;Di++)Sr[Di]>vi&&(vi=Sr[Di]);var Wi=Math.max(Jt+vi+8,vl+6);if(r.caption){var si=Gr(r.caption,14,!1)+10;l+=s(Ir("caption"),r.caption,Fr("text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontColor=#000000;align=center;verticalAlign=middle;",["document","caption"],null,"text"),(qo-si)/2,Wi,si,22,"1"),Wi+=26}if(r.footer){var Il=Gr(r.footer,11,!1)+8;l+=s(Ir("footer"),r.footer,Fr("text;html=1;fillColor=none;strokeColor=none;fontSize=11;fontColor=#888888;align=center;verticalAlign=middle;",["document","footer"],null,"text"),(qo-Il)/2,Wi,Il,18,"1")}}return l}var Ga=120,$n=40,zn=60,Dn=60,xe=30,i=20,c=24,F=80,y=6,sr=30,kr=28,be=16,dr=20,Mo=26,io=35,go=50,gn=45,On=46;function co(r){switch(r.kind){case"initial":return"ellipse;fillColor=#222222;strokeColor=#222222;";case"final":return"shape=endState;fillColor=#222222;strokeColor=#222222;";case"fork":case"join":return"shape=rectangle;fillColor=#555555;strokeColor=#555555;";case"choice":return"rhombus;fillColor=#F1F1F1;strokeColor=#181818;";case"start":return"ellipse;fillColor=#222222;strokeColor=#222222;";case"end":return"shape=endState;fillColor=#222222;strokeColor=#222222;";case"history_shallow":return"ellipse;fillColor=#F1F1F1;strokeColor=#181818;fontStyle=1;fontSize=14;";case"history_deep":return"ellipse;fillColor=#F1F1F1;strokeColor=#181818;fontStyle=1;fontSize=14;";case"entrypoint":return"ellipse;fillColor=#FFFFFF;strokeColor=#181818;strokeWidth=1.5;verticalLabelPosition=top;verticalAlign=bottom;fontSize=12;";case"exitpoint":return"shape=mxgraph.flowchart.summing_function;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=1;verticalLabelPosition=bottom;verticalAlign=top;fontSize=12;";default:var a=Y(r.color)||"#F1F1F1";return"rounded=1;absoluteArcSize=1;arcSize=25;fillColor="+a+";strokeColor=#181818;whiteSpace=wrap;align=center;"}}function Gn(r){switch(r.kind){case"initial":case"start":return{w:i,h:i};case"final":case"end":return{w:c,h:c};case"fork":case"join":return{w:F,h:y};case"choice":return{w:sr,h:sr};case"history_shallow":case"history_deep":return{w:kr,h:kr};case"entrypoint":return{w:i,h:i};case"exitpoint":return{w:c,h:c};default:{var a=go,e=is(r.name,14,!1);if(r.description&&r.description.length>0){a=Mo+r.description.length*be+14;for(var h=0;h<r.description.length;h++){var l=is(r.description[h],14,!1);l>e&&(e=l)}}var C=Math.max(50,Math.ceil(e+20));if(r.children&&r.children.length>0){var b=lo(r);C=Math.max(C,b.w),a=b.h}return{w:C,h:a}}}}function lo(r){var a=dr,e=Mo,h=r.description?r.description.length:0,l=h>0?h*be+8:0,C=h>0?r.description.join(`
-`):"",b=r.regions&&r.regions.length>0?r.regions:[{states:r.children||[]}],Z=[],v=[],er=Math.ceil(is(r.name,14,!1))+24,X,V,tr;if(r.regionSep==="|"&&b.length>1){var wr=a,yr=e+a+l;for(X=0;X<b.length;X++){var fr=b[X].states||[],Ar=0,jr=e+a+l;for(V=0;V<fr.length;V++){var ce=Gn(fr[V]);ce.w>Ar&&(Ar=ce.w)}for(V=0;V<fr.length;V++)tr=Gn(fr[V]),Z.push({state:fr[V],x:wr+(Ar-tr.w)/2,y:jr,w:tr.w,h:tr.h}),jr+=tr.h,V<fr.length-1&&(jr+=gn);jr>yr&&(yr=jr),wr+=Ar,X<b.length-1&&(v.push(wr+On/2),wr+=On)}return{w:Math.max(wr+a,er),h:yr+a,placements:Z,seps:v,sepDir:"v",descH:l,descText:C}}var Nr=0,de=e+a+l,Fr=[],Ir=[],qe=!1;for(X=0;X<b.length;X++){var To=b[X].states||[],ne=[];for(V=0;V<To.length;V++){var po=To[V].kind;po==="history_shallow"||po==="history_deep"?(Fr.push(To[V]),qe=!0):po==="entrypoint"||po==="exitpoint"?(tr=Gn(To[V]),Z.push({state:To[V],x:0,y:0,w:tr.w,h:tr.h,pinned:!0})):ne.push(To[V])}Ir.push(ne)}if(qe){for(X=0;X<Ir.length;X++)for(V=0;V<Ir[X].length;V++)if(Ir[X][V].kind==="initial"){Fr.unshift(Ir[X].splice(V,1)[0]);break}}var ao=0;if(Fr.length>0){var A=0,J=a;for(V=0;V<Fr.length;V++)tr=Gn(Fr[V]),tr.h>A&&(A=tr.h);for(V=0;V<Fr.length;V++)tr=Gn(Fr[V]),Z.push({state:Fr[V],x:J,y:e+16+l+(A-tr.h)/2,w:tr.w,h:tr.h,pinned:!0}),J+=tr.w+34;ao=J-34,de=e+16+l+A+gn+16}for(X=0;X<Ir.length;X++){var ur=Ir[X];for(V=0;V<ur.length;V++){var Sr=Gn(ur[V]);Sr.w>Nr&&(Nr=Sr.w)}for(V=0;V<ur.length;V++)tr=Gn(ur[V]),Z.push({state:ur[V],x:0,y:de,w:tr.w,h:tr.h}),de+=tr.h,V<ur.length-1&&(de+=gn);X<Ir.length-1&&(v.push(de+On/2),de+=On)}for(var Er=Math.max(Nr+a*2,ao+a*2,er),qr=de+a,z=0;z<Z.length;z++)Z[z].pinned||(Z[z].x=(Er-Z[z].w)/2);return{w:Er,h:qr,placements:Z,seps:v,sepDir:"h",descH:l,descText:C}}function It(r){switch(r.kind){case"initial":case"start":case"final":case"end":case"fork":case"join":return"";case"history_shallow":return"H";case"history_deep":return"H*";case"choice":return"";case"entrypoint":case"exitpoint":return r.name;default:return r.name}}function Un(r,a){var e=r.states,h=r.transitions,l=r.notes,C="",b=0,Z=r.styleSheet||null;function v(Ve,Yo,st,Ca,Mt){return W(Ve,Z,["root","element","stateDiagram"].concat(Yo),st||[],Ca||"vertex",Mt)}function er(Ve){return Ve.stereotype?[Ve.stereotype]:[]}function X(Ve,Yo){if(Ve.kind==="initial"||Ve.kind==="start"||Ve.kind==="final"||Ve.kind==="end")return v(Yo,["circle"],er(Ve));if(Ve.kind!=="state")return Yo;var st=H(Z,["root","element","stateDiagram","state"],er(Ve),"vertex");return Ve.color?(delete st.fillColor,delete st.gradientColor):st.fillColor!=null&&/swimlaneFillColor=/.test(Yo)&&!/swimlaneFillColor=#FFFFFF;/.test(Yo)&&(st.swimlaneFillColor=st.fillColor),M(Yo,st)}function V(Ve){return Ve+"_"+b++}var tr={};function wr(Ve){for(var Yo=Ve?String(Ve).split(`
-`):[""],st=0,Ca=0;Ca<Yo.length;Ca++){var Mt=Vl(Yo[Ca])*.9285714285714286;Mt>st&&(st=Mt)}return{w:Math.max(30,Math.round(st+21)),h:Math.round(Yo.length*15.3+10)}}for(var yr={},fr=0;fr<e.length;fr++)yr[e[fr].id]=!0;for(var Ar={},jr={},fr=0;fr<e.length;fr++)Ar[e[fr].id]=[],jr[e[fr].id]=0;var ce={};(function Ve(Yo,st){for(var Ca=0;Ca<Yo.length;Ca++){var Mt=Yo[Ca],Ra=st||Mt.id;if(st&&(ce[Mt.id]=st),Mt.children&&Ve(Mt.children,Ra),Mt.regions)for(var Xn=0;Xn<Mt.regions.length;Xn++)Ve(Mt.regions[Xn].children||[],Ra)}})(e,null);for(var Nr=0;Nr<h.length;Nr++){var de=h[Nr],Fr=yr[de.from]?de.from:ce[de.from],Ir=yr[de.to]?de.to:ce[de.to];if(!(!Fr||!Ir||!yr[Fr]||!yr[Ir]||Fr===Ir)&&!(de.direction==="left"||de.direction==="right")){if(de.direction==="up"){Ar[Ir].push(Fr),jr[Fr]++;continue}Ar[Fr].push(Ir),jr[Ir]++}}var qe="",To={},ne;for(ne=0;ne<e.length;ne++)for(var po=e[ne].id,ao=Ar[po]||[],A=0;A<ao.length;A++){var J=po+qe+ao[A];To[J]=(To[J]||0)+1}var ur={},Sr={};for(ne=0;ne<e.length;ne++)ur[e[ne].id]=[],Sr[e[ne].id]=0;for(ne=0;ne<e.length;ne++)for(var Er=e[ne].id,qr=Ar[Er]||[],z=0;z<qr.length;z++){var Mr=qr[z],Be=To[Er+qe+Mr]||0,ye=To[Mr+qe+Er]||0;ye>Be||(ur[Er].push(Mr),Sr[Mr]++)}Ar=ur,jr=Sr;for(var Le={},_e={},Ur="",yo=0;yo<e.length;yo++)_e[e[yo].id]=0;function fo(Ve){var Yo=[{node:Ve,idx:0}];for(_e[Ve]=1;Yo.length>0;){var st=Yo[Yo.length-1],Ca=Ar[st.node]||[];if(st.idx<Ca.length){var Mt=Ca[st.idx++];_e[Mt]===1?Le[st.node+Ur+Mt]=!0:_e[Mt]===0&&(_e[Mt]=1,Yo.push({node:Mt,idx:0}))}else _e[st.node]=2,Yo.pop()}}for(var he=0;he<e.length;he++)jr[e[he].id]===0&&_e[e[he].id]===0&&fo(e[he].id);for(var he=0;he<e.length;he++)_e[e[he].id]===0&&fo(e[he].id);for(var Te={},ae=0;ae<e.length;ae++)Te[e[ae].id]=0;for(var it=0;it<e.length;it++)for(var Gt=e[it].id,oo=Ar[Gt]||[],pt=0;pt<oo.length;pt++)Le[Gt+Ur+oo[pt]]||Te[oo[pt]]++;for(var rt={},jo=[],Qt=0;Qt<e.length;Qt++)rt[e[Qt].id]=0,Te[e[Qt].id]===0&&jo.push(e[Qt].id);for(var Me=e.length*e.length+16;jo.length>0&&Me-- >0;)for(var Io=jo.shift(),Wo=Ar[Io]||[],Ro=0;Ro<Wo.length;Ro++){var An=Wo[Ro];Le[Io+Ur+An]||(rt[An]<rt[Io]+1&&(rt[An]=rt[Io]+1),--Te[An]===0&&jo.push(An))}for(var dn={},rn=[],fr=0;fr<e.length;fr++){var Ao=rt[e[fr].id];dn[Ao]||(dn[Ao]=[],rn.push(Ao)),dn[Ao].push(e[fr])}rn.sort(function(Ve,Yo){return Ve-Yo});for(var _t=0;_t<h.length;_t++){var ft=h[_t];if(!(ft.direction!=="left"&&ft.direction!=="right")&&!(rt[ft.from]===void 0||rt[ft.from]!==rt[ft.to])){for(var Se=dn[rt[ft.from]],Go=-1,wt=-1,cn=0;cn<Se.length;cn++)Se[cn].id===ft.from&&(Go=cn),Se[cn].id===ft.to&&(wt=cn);if(!(Go<0||wt<0)){if(ft.direction==="left"&&wt>Go){var No=Se.splice(wt,1)[0];Se.splice(Go,0,No)}else if(ft.direction==="right"&&wt<Go){var oe=Se.splice(wt,1)[0];Se.splice(Go,0,oe)}}}}for(var Uo={},Ot=0;Ot<e.length;Ot++){var ho=e[Ot],dt=Gn(ho),Aa={w:dt.w,h:dt.h};ho.children&&ho.children.length>0&&(Aa.layout=lo(ho)),Uo[ho.id]=Aa}for(var Sn=r.direction==="LR",an=0,we=0;we<l.length;we++)if(l[we].position!=="right"){var Eo=wr(l[we].text);Eo.w+io>an&&(an=Eo.w+io)}for(var Et=[],Cr=[],Lr=0,He=0,Ie=0;Ie<rn.length;Ie++){for(var Oe=dn[rn[Ie]],so=0,Xo=0,qo=0;qo<Oe.length;qo++)so+=Uo[Oe[qo].id].w,Xo+=Uo[Oe[qo].id].h;so+=(Oe.length-1)*zn,Xo+=(Oe.length-1)*Dn,Et[Ie]=so,Cr[Ie]=Xo,so>Lr&&(Lr=so),Xo>He&&(He=Xo)}var Yn=[],Nt=!1;if(Sn)for(var Da=0;Da<e.length;Da++){var je=e[Da].kind;(je==="initial"||je==="start")&&(Nt=!0)}for(var _r=Nt?i+Dn:0,Ho=xe,Ce=xe+an,ln=0;ln<rn.length;ln++){for(var nt=dn[rn[ln]],wo=0,xn=0,Lt=0;Lt<nt.length;Lt++)Uo[nt[Lt].id].h>wo&&(wo=Uo[nt[Lt].id].h),Uo[nt[Lt].id].w>xn&&(xn=Uo[nt[Lt].id].w);if(Sn){for(var Ft=[],Lt=0;Lt<nt.length;Lt++){var fe=nt[Lt].kind;fe==="initial"||fe==="start"||fe==="final"||fe==="end"?Yn.push(nt[Lt]):Ft.push(nt[Lt])}if(Ft.length>0){for(var ge=0,qt=0,et=0;et<Ft.length;et++)Uo[Ft[et].id].w>ge&&(ge=Uo[Ft[et].id].w),qt+=Uo[Ft[et].id].h;qt+=(Ft.length-1)*Dn;for(var en=xe+_r+(He-qt)/2,et=0;et<Ft.length;et++){var Zt=Uo[Ft[et].id];Zt.x=Ce+(ge-Zt.w)/2,Zt.y=en,en+=Zt.h+Dn}Ce+=ge+zn}}else{for(var qn=xe+an+(Lr-Et[ln])/2,Lt=0;Lt<nt.length;Lt++){var Ko=nt[Lt],Zt=Uo[Ko.id];Uo[Ko.id].x=qn,Uo[Ko.id].y=Ho+(wo-Zt.h)/2,qn+=Zt.w+zn}Ho+=wo+Dn}}for(var Hn=0;Hn<Yn.length;Hn++){var aa=Yn[Hn],Je=Uo[aa.id];if(aa.kind==="initial"||aa.kind==="start"){for(var sn=null,Bn=0;Bn<h.length;Bn++)if(h[Bn].from===aa.id&&Uo[h[Bn].to]){sn=Uo[h[Bn].to];break}sn&&sn.x!=null&&(Je.x=sn.x+(sn.w-Je.w)/2,Je.y=sn.y-Dn-Je.h)}else{for(var $t=0,mo=0,Pt=-1e9,Bn=0;Bn<h.length;Bn++)if(h[Bn].to===aa.id&&Uo[h[Bn].from]&&Uo[h[Bn].from].x!=null){var ra=Uo[h[Bn].from];$t+=ra.x+ra.w/2,mo++,ra.y+ra.h>Pt&&(Pt=ra.y+ra.h)}mo>0&&(Je.x=$t/mo-Je.w/2,Je.y=Pt+Dn)}Je.x==null&&(Je.x=xe+an,Je.y=xe)}if(!Sn){for(var Ut={},Wn=0;Wn<e.length;Wn++){var yt=rt[e[Wn].id];Ut[yt]=(Ut[yt]||0)+1}for(var Zn={},on=0;on<h.length;on++){var va=h[on].from,ga=h[on].to;va!==ga&&(Zn[va]||(Zn[va]=[]),Zn[va].indexOf(ga)<0&&Zn[va].push(ga))}for(var jn=0;jn<e.length;jn++){var Fn=e[jn];if(!(Fn.kind!=="choice"&&Fn.kind!=="fork")){var Mn=Zn[Fn.id]||[];if(!(Mn.length<2))for(var la=130,Tn=0;Tn<Mn.length;Tn++){var gt=Mn[Tn];Ut[rt[gt]]===1&&(!Uo[gt]||Uo[gt].x==null||(Uo[gt].x+=((Mn.length-1)/2-Tn)*la))}}}}function Rt(Ve){var Yo={fill:null,line:null,text:null,dashed:!1,bold:!1};if(!Ve)return Yo;for(var st=String(Ve).split(";"),Ca=0;Ca<st.length;Ca++){var Mt=st[Ca].replace(/^\s+|\s+$/g,""),Ra=Mt.match(/^(line|text|back|header)\s*:\s*#?([\w-]+)$/i);if(Ra){var Xn=Y("#"+Ra[2]);if(Xn){var _a=Ra[1].toLowerCase();_a==="line"?Yo.line=Xn:_a==="text"?Yo.text=Xn:Yo.fill=Xn}}else/^line\.(dashed|dotted)$/i.test(Mt)?Yo.dashed=!0:/^line\.bold$/i.test(Mt)?Yo.bold=!0:Mt&&(Yo.fill=Y(Mt.charAt(0)==="#"?Mt:"#"+Mt)||Yo.fill)}return Yo}function Jt(Ve){return"strokeColor="+(Ve.line||"#181818")+";strokeWidth="+(Ve.bold?1.5:.5)+";"+(Ve.text?"fontColor="+Ve.text+";":"")+(Ve.dashed?"dashed=1;":"")}function ct(Ve){var Yo=Rt(Ve.color);return"swimlane;collapsible=0;startSize="+Mo+";whiteSpace=wrap;align=center;html=1;fontSize=14;fontStyle=0;rounded=1;absoluteArcSize=1;arcSize=25;fillColor="+(Yo.fill||"#F1F1F1")+";swimlaneFillColor="+(Yo.fill||"#F1F1F1")+";"+Jt(Yo)}function wn(Ve){var Yo=Rt(Ve.color);return"swimlane;collapsible=0;startSize="+Mo+";fillColor="+(Yo.fill||"#F1F1F1")+";swimlaneFillColor=#FFFFFF;"+Jt(Yo)+"rounded=1;absoluteArcSize=1;arcSize=25;whiteSpace=wrap;align=center;html=1;fontSize=14;fontStyle=0;"}function In(Ve,Yo,st,Ca,Mt,Ra){var Xn=Ve.placements;Ve.descH>0&&(C+=s(V("sdesc"),Ve.descText,"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;fontSize=12;fontColor=#000000;spacingLeft=4;spacingTop=2;",dr/2,Mo+2,Mt-dr,Ve.descH-4,Yo));for(var _a=[],Ka=[],yn=[],ua=0;ua<Xn.length;ua++){var Ya=Xn[ua].state.kind;Ya==="history_shallow"||Ya==="history_deep"?_a.push(Xn[ua]):Ya==="entrypoint"?Ka.push(Xn[ua]):Ya==="exitpoint"&&yn.push(Xn[ua])}for(var fa=0;fa<Ka.length;fa++)Ka[fa].x=Mt*(fa+1)/(Ka.length+1)-Ka[fa].w/2,Ka[fa].y=-Ka[fa].h/2;for(var xt=0;xt<yn.length;xt++)yn[xt].x=Mt*(xt+1)/(yn.length+1)-yn[xt].w/2,yn[xt].y=Ra-yn[xt].h/2;for(var Ja=0;Ja<Xn.length;Ja++){var uo=Xn[Ja],Jn=uo.state,Sa=V("sc"),da=Jn.children&&Jn.children.length>0,ma,Ha;da?(ma=Jn.name,Ha=X(Jn,wn(Jn))):Jn.kind==="state"?(ma=Jn.name,Ha=X(Jn,ct(Jn))):(ma=It(Jn),Ha=X(Jn,co(Jn))),C+=s(Sa,ma,Ha,uo.x,uo.y,uo.w,uo.h,Yo),tr[Jn.id]={x:st+uo.x,y:Ca+uo.y,w:uo.w,h:uo.h,cellId:Sa},da&&In(lo(Jn),Sa,st+uo.x,Ca+uo.y,uo.w,uo.h)}for(var Sl=Ve.seps||[],$l=0;$l<Sl.length;$l++){var ml="strokeColor=#181818;strokeWidth=1;dashed=1;dashPattern=6 6;endArrow=none;";Ve.sepDir==="v"?C+=G(V("sconc"),"",ml,st+Sl[$l],Ca+Mo,st+Sl[$l],Ca+Ra-2,"1"):C+=G(V("sconc"),"",ml,st+2,Ca+Sl[$l],st+Mt-2,Ca+Sl[$l],"1")}}for(var Ot=0;Ot<e.length;Ot++){var ho=e[Ot],ko=Uo[ho.id],Do=ko.x+Ot*.1,Rr=ko.y,dt={w:ko.w,h:ko.h},xr=V("s"),br=ho.children&&ho.children.length>0,Br=ho.kind==="state"&&!br&&ho.description&&ho.description.length>0;br?C+=s(xr,ho.name,X(ho,wn(ho)),Do,Rr,dt.w,dt.h,"1"):Br?(C+=s(xr,ho.name,X(ho,ct(ho)),Do,Rr,dt.w,dt.h,"1"),C+=s(V("sdesc"),ho.description.join(`
-`),v("text;align=left;verticalAlign=top;spacingLeft=6;spacingTop=2;whiteSpace=wrap;fillColor=none;strokeColor=none;html=1;fontSize=14;",["state"],er(ho),"text"),0,Mo,dt.w,dt.h-Mo,xr)):ho.kind==="state"?C+=s(xr,ho.name,X(ho,ct(ho)),Do,Rr,dt.w,dt.h,"1"):C+=s(xr,It(ho),X(ho,co(ho)),Do,Rr,dt.w,dt.h,"1"),tr[ho.id]={x:Do,y:Rr,w:dt.w,h:dt.h,cellId:xr},br&&ko.layout&&In(ko.layout,xr,Do,Rr,dt.w,dt.h)}function Pr(Ve,Yo,st,Ca,Mt,Ra,Xn,_a){var Ka=' <mxGeometry relative="1"'+(Ra!=null?' x="'+Ra+'"':"")+' as="geometry"',yn;if(Xn&&Xn.length||_a){if(yn=Ka+`>
-`,Xn&&Xn.length){yn+=` <Array as="points">
-`;for(var ua=0;ua<Xn.length;ua++)yn+=' <mxPoint x="'+Math.round(Xn[ua].x)+'" y="'+Math.round(Xn[ua].y)+`"/>
-`;yn+=` </Array>
-`}_a&&(yn+=' <mxPoint x="'+Math.round(_a.x)+'" y="'+Math.round(_a.y)+`" as="offset"/>
-`),yn+=` </mxGeometry>
-`}else yn=Ka+`/>
-`;return' <mxCell id="'+d(Ve)+'" value="'+R(Yo)+'" style="'+d(st)+'" edge="1" source="'+d(Ca)+'" target="'+d(Mt)+`" parent="1">
-`+yn+` </mxCell>
-`}var Xe="",zr={},Ke=[],De={},ze={};(function Ve(Yo){for(var st=0;st<Yo.length;st++)ze[Yo[st].id]=Yo[st].kind,Yo[st].children&&Ve(Yo[st].children)})(e);for(var So=0;So<h.length;So++)zr[h[So].from+Xe+h[So].to]=!0,De[h[So].from]=(De[h[So].from]||0)+1;for(var ot=0;ot<h.length;ot++){var ve=h[ot],Yt=tr[ve.from],At=tr[ve.to];if(!(!Yt||!At)){var ht="endArrow=block;endFill=1;strokeColor="+(Y(ve.color)||"#181818")+";fontColor=#000000;fontSize=12;html=1;rounded=0;";ve.lineStyle==="dashed"?ht+="dashed=1;":ve.lineStyle==="dotted"&&(ht+="dashed=1;dashPattern=1 3;"),ve.bold&&(ht+="strokeWidth=2;");var Vt=[];ve.color&&Vt.push("strokeColor"),ve.bold&&Vt.push("strokeWidth"),ve.lineStyle&&Vt.push("dashed","dashPattern","fixDash"),ht=j(v(ht,["arrow"],null,"edge",Vt),Z);var Pn=ve.label||"",Ae=null,Fe=null,le=Yt.x+Yt.w/2,Ne=Yt.y+Yt.h/2,Qe=At.x+At.w/2,tn=At.y+At.h/2;Ke[ot]={x:(le+Qe)/2,y:(Ne+tn)/2};var Vo=ve.from!==ve.to&&zr[ve.to+Xe+ve.from];if(ve.from===ve.to)ht+="exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;";else if(Vo){var xo=ve.from<ve.to,Co=xo?.18:.82,mn=Vl(Pn)*12/14;if(Math.abs(tn-Ne)>=Math.abs(Qe-le)){var pn=tn>Ne;ht+="exitX="+Co+";exitY="+(pn?1:0)+";exitDx=0;exitDy=0;entryX="+Co+";entryY="+(pn?0:1)+";entryDx=0;entryDy=0;",Pn&&(Fe={x:(xo?-1:1)*(mn/2+6),y:0})}else{var hn=Qe>le;ht+="exitX="+(hn?1:0)+";exitY="+Co+";exitDx=0;exitDy=0;entryX="+(hn?0:1)+";entryY="+Co+";entryDx=0;entryDy=0;",Pn&&(Fe={x:0,y:(xo?-1:1)*12})}}else De[ve.from]>1&&ze[ve.from]==="choice"?Ae=.35:De[ve.from]>1&&Pn&&Math.abs(Qe-le)>10&&(Fe={x:(Qe>le?1:-1)*(Vl(Pn)*12/14/2+4),y:0});var Dt=null;if(ve.from!==ve.to&&ht.indexOf("edgeStyle=")<0){var ca=Yt.y+Yt.h<=At.y,ea=At.y+At.h<=Yt.y;if(ca||ea){for(var me=ca?Yt.y+Yt.h:Yt.y,ie=ca?At.y:At.y+At.h,pe=[],ke=0;ke<e.length;ke++){var Re=e[ke].id;if(!(Re===ve.from||Re===ve.to||ce[ve.from]===Re||ce[ve.to]===Re)){var $o=tr[Re];$o&&fi(le,me,Qe,ie,$o.x-3,$o.y-3,$o.w+6,$o.h+6)&&pe.push($o)}}if(pe.length>0){for(var Jo=1/0,Wt=-1/0,at=1/0,Nn=-1/0,ia=0,sa=0;sa<pe.length;sa++)pe[sa].y<Jo&&(Jo=pe[sa].y),pe[sa].y+pe[sa].h>Wt&&(Wt=pe[sa].y+pe[sa].h),pe[sa].x<at&&(at=pe[sa].x),pe[sa].x+pe[sa].w>Nn&&(Nn=pe[sa].x+pe[sa].w),ia+=pe[sa].x+pe[sa].w/2;var ka=ia/pe.length>(le+Qe)/2+1,Po=ka?at-14:Nn+14,Ct=Jo-10,bt=Wt+10;if(ea){var Vr=Ct;Ct=bt,bt=Vr}Dt=[{x:Po,y:Ct},{x:Po,y:bt}],ht=ht.replace(/(exit|entry)(X|Y|Dx|Dy)=[-0-9.]+;/g,"")+"curved=1;",Ae=null,Fe=null}}}C+=Pr(V("t"),Pn,ht,Yt.cellId,At.cellId,Ae,Dt,Fe)}}for(var to=v("shape=note;size=10;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;fontSize=13;fontColor=#000000;whiteSpace=wrap;align=left;verticalAlign=middle;spacingLeft=4;",["note"]),Xt=v("fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;",["note"]),ha=0;ha<l.length;ha++){var Wr=l[ha],ro=wr(Wr.text),te=ro.w,ue=ro.h,zo=xe,nn=xe,Fa="";if(Wr.position==="link"){var Kn=Ke[Wr.linkIndex];Kn&&(nn=Math.round(Kn.y),Wr.side==="left"?zo=Math.round(Kn.x-5-te):Wr.side==="top"||Wr.side==="bottom"?(zo=Math.round(Kn.x-te/2),nn=Math.round(Wr.side==="top"?Kn.y-10-ue:Kn.y+10)):zo=Math.round(Kn.x+5))}else{var bn=tr[Wr.target];bn&&(nn=bn.y+(bn.h-ue)/2,Wr.position==="right"?(zo=bn.x+bn.w+io,Fa=s(V("noteptr"),"","triangle;direction=west;"+Xt,bn.x+bn.w,Math.round(nn+ue/2-4),io+1,8,"1")):(zo=bn.x-te-io,Fa=s(V("noteptr"),"","triangle;direction=east;"+Xt,zo+te-1,Math.round(nn+ue/2-4),io+1,8,"1")))}C+=Fa+s(V("note"),Wr.text||"",to,zo,nn,te,ue,"1")}return C}var wa=180,Ta=40,Ea=19,Ua=8,oa=32,vn=26,Jl=21,Ul=16,_l=24,Ma=35,gl=60,Ia=78,tt=10,Vn=4,sl=160,El=40,ui=20,rl=24,Rl=45,pl=14,Al=15,Wa=14,ai=34,Nl=17;function xa(r){return is(r,pl,!1)}function fi(r,a,e,h,l,C,b,Z){for(var v=0,er=1,X=e-r,V=h-a,tr=[-X,X,-V,V],wr=[r-l,l+b-r,a-C,C+Z-a],yr=0;yr<4;yr++)if(tr[yr]===0){if(wr[yr]<0)return!1}else{var fr=wr[yr]/tr[yr];if(tr[yr]<0){if(fr>er)return!1;fr>v&&(v=fr)}else{if(fr<v)return!1;fr<er&&(er=fr)}}return v<=er}function Ni(r,a){for(var e=r.classes,h=r.relationships,l=r.packages,C=r.notes,b="",Z=0,v=r.hideRules||[],er=r.hideEntities||[],X=0;X<C.length;X++)C[X].position==="link"&&C[X].linkIndex!=null&&(C[X]._rel=h[C[X].linkIndex]||null);var V=r.styleSheet||null,tr=[],wr={pkg:"vertex",pkgl:"text"};function yr(cr,Ue,Bo,Lo,Pe){return W(cr,V,["root","element","classDiagram"].concat(Ue),Bo||[],Lo||"vertex",Pe)}function fr(cr,Ue){var Bo=wr[String(cr).split("_")[0]];return Bo==null||V==null?Ue:yr(Ue,["package"],tr,Bo)}var Ar=function(cr,Ue,Bo,Lo,Pe,mt,Bt,La){return $(cr,Ue,fr(cr,Bo),Lo,Pe,mt,Bt,La)},jr=function(cr,Ue,Bo,Lo,Pe,mt,Bt,La){return B(cr,Ue,fr(cr,Bo),Lo,Pe,mt,Bt,La)};function ce(cr){if(!cr.stereotype)return[];var Ue=cr.stereotype.replace(/\(\s*[A-Za-z@]\s*,\s*(?:#[0-9A-Fa-f]{3,8}|[A-Za-z]+)\s*\)/,"");return Ue.split(/>>\s*<<|\s+/).map(function(Bo){return Bo.replace(/^\s+|\s+$/g,"")}).filter(function(Bo){return Bo.length>0})}function Nr(cr,Ue){return cr.type==="all"?!0:cr.type==="kind"?(Ue.kind||"class")===cr.value:cr.type==="name"?Ue.id===cr.value||Ue.name===cr.value||(Ue.id||"").split(/::|\./).pop()===cr.value:cr.type==="stereotype"?To(cr.value,ce(Ue)):!1}function de(cr,Ue){for(var Bo=cr.members||[],Lo=0;Lo<Bo.length;Lo++){var Pe=Bo[Lo].kind;if(Pe!=="separator"&&Ue==="method"==(Pe==="method"))return!1}return!0}function Fr(cr,Ue){if(Ue==="circle"&&cr.kind==="object")return!1;for(var Bo=Ue==="circle"?!r.hideCircle&&!r.strictUml:!0,Lo=0;Lo<v.length;Lo++){var Pe=v[Lo];Pe.portion===Ue&&Nr(Pe.gender,cr)&&(Pe.empty&&!de(cr,Ue)||(Bo=Pe.show))}return Bo}function Ir(cr){return String(cr??"").split(/::|\./).pop()}function qe(cr,Ue){return cr.indexOf("*")>=0?new RegExp("^"+cr.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")+"$").test(Ue):Ue===cr}function To(cr,Ue){for(var Bo=0;Bo<Ue.length;Bo++)if(qe(cr,Ue[Bo]))return!0;return!1}function ne(cr,Ue){return qe(cr,Ir(Ue))}function po(cr){for(var Ue=!1,Bo=0;Bo<er.length;Bo++){var Lo=er[Bo].what,Pe;if(Lo==="@unlinked"){Pe=!cr.isGroup;for(var mt=0;mt<h.length&&Pe;mt++)(h[mt].from===cr.id||h[mt].to===cr.id)&&(Pe=!1)}else Lo.charAt(0)==="<"?Pe=To(Lo.replace(/^<<|>>$/g,"").replace(/^\s+|\s+$/g,""),ce(cr)):Lo.charAt(0)==="$"?Pe=To(Lo.substring(1),cr.tags||[]):Pe=ne(Lo,cr.id)||cr.name!=null&&cr.name!==cr.id&&ne(Lo,cr.name);Pe&&(Ue=!er[Bo].show)}return Ue}if(er.length>0){var ao={},A={},J;for(J=0;J<l.length;J++){var ur=l[J].parentIndex;if(ur!=null&&A[ur]||po({id:l[J].name,name:l[J].name,isGroup:!0,tags:[]})){A[J]=!0;for(var Sr=0;Sr<(l[J].classes||[]).length;Sr++)ao[l[J].classes[Sr]]=!0}}for(var Er=[],qr=0;qr<e.length;qr++)ao[e[qr].id]||po(e[qr])?ao[e[qr].id]=!0:Er.push(e[qr]);e=Er,h=h.filter(function(cr){return!ao[cr.from]&&!ao[cr.to]}),C=C.filter(function(cr){return cr.targets&&cr.targets.length?(cr.targets=cr.targets.filter(function(Ue){return!ao[Ue]}),cr.targets.length===0?!1:(ao[cr.target]&&(cr.target=cr.targets[0]),!0)):cr.target?!ao[cr.target]:cr.id?!po({id:cr.id,name:cr.id,tags:cr.tags||[]}):!0});var z={},Mr=[];for(J=0;J<l.length;J++)A[J]||(z[J]=Mr.length,Mr.push(l[J]));l=Mr.map(function(cr){var Ue={};for(var Bo in cr)cr.hasOwnProperty(Bo)&&(Ue[Bo]=cr[Bo]);return Ue.parentIndex=cr.parentIndex!=null&&z[cr.parentIndex]!=null?z[cr.parentIndex]:null,Ue});for(var Be=[],ye=0;ye<C.length;ye++){var Le=C[ye];if(Le.pkgIndex!=null){if(A[Le.pkgIndex])continue;var _e={};for(var Ur in Le)Le.hasOwnProperty(Ur)&&(_e[Ur]=Le[Ur]);_e.pkgIndex=z[Le.pkgIndex]!=null?z[Le.pkgIndex]:null,Le=_e}Be.push(Le)}C=Be}function yo(cr){for(var Ue=cr.text?cr.text.split(`
-`):[""],Bo=0,Lo=0;Lo<Ue.length;Lo++){var Pe=xa(Ue[Lo])*13/pl;Pe>Bo&&(Bo=Pe)}return{w:Math.round(Bo+20),h:Math.round(Ue.length*17.7+12)}}var fo={};function he(cr){return cr+"_"+Z++}var Te=r.title?String(r.title).replace(/\\n/g,`
+`}for(var ue={},po=0;po<e.length;po++)ue[e[po].id]=po;var x=e.length;function S(gn,Pa){return gn!=null&&ue.hasOwnProperty(gn)?ue[gn]:Pa}for(var fr=[],zr=[],Lr=[],te=[],W=0;W<x;W++){var Zr=e[W],Re=Hr(Zr.name,14,!1),Ae=Re+w,Pe=B+15*Math.max(0,Ne(Zr.name)-1);if(Zr.stereoLetter)Ae=Math.max(Re,Hr(Zr.stereotype||"",14,!1))+42,Pe=52;else if(Zr.stereotype&&!Ze)Ae=Math.max(Re,Hr(Zr.stereotype,14,!1)+12)+w,Pe=52;else if(Zr.bodyLines&&Zr.bodyLines.length>0){for(var De=0,Qr=10,Po=0;Po<Zr.bodyLines.length;Po++){var Qe=Zr.bodyLines[Po];if(Ur(Qe)){Qr+=Ce;continue}var yo=/^(=+)\s*/.exec(Qe),ie=/^"{2}.*"{2}$/.test(Qe),pe=yo?oe(yo[1].length):14,Mo=s(Qe.replace(/^=+\s*/,"").replace(/^"{2}|"{2}$/g,""));De=Math.max(De,ie?Mo.length*Me:Hr(Mo,pe,!!yo)),Qr+=Math.ceil(pe*1.2)}Ae=Math.ceil(De)+w+4,Pe=Math.max(B,Qr)}var Zt=0,Uo=0;Zr.kind==="actor"?(Zt=24,Uo=38):Zr.kind==="boundary"?(Zt=38,Uo=28):Zr.kind==="control"||Zr.kind==="entity"?(Zt=28,Uo=28):Zr.kind==="database"?(Zt=36,Uo=34):Zr.kind==="queue"?(Zt=44,Uo=22):Zr.kind==="collections"&&(Ae=Re+24),Zt>0&&(Ae=Math.max(Re,Zt),Pe=Uo+19*Math.max(1,Ne(Zr.name))),fr.push(Math.max(24,Ae)),zr.push(Pe),Lr.push(Zt),te.push(Uo)}var xn=B,gt=B;for(W=0;W<x;W++)zr[W]>xn&&(xn=zr[W]),Lr[W]===0&&!(e[W].bodyLines&&e[W].bodyLines.length>0)&&zr[W]>gt&&(gt=zr[W]);for(W=0;W<x;W++)Lr[W]===0&&!(e[W].bodyLines&&e[W].bodyLines.length>0)&&zr[W]<gt&&(zr[W]=gt);var To=[],Rt=r.boxes||[];for(W=0;W<x;W++)To.push(-1);for(var Be=0;Be<Rt.length;Be++)for(var Ao=Rt[Be].participants||[],et=0;et<Ao.length;et++)ue.hasOwnProperty(Ao[et])&&(To[ue[Ao[et]]]=Be);var jo=!1;for(W=0;W<x;W++)To[W]>=0&&(jo=!0);var Tn=[];for(W=0;W+1<x;W++){var dn=sr+(jo&&To[W]!==To[W+1]?14:0);Tn.push(fr[W]/2+fr[W+1]/2+dn)}var An=[],Bo=0,kt=0;function Yn(gn,Pa,kl){if(!(gn===Pa||gn==null||Pa==null)){var bl=Math.min(gn,Pa),si=Math.max(gn,Pa);si-bl===1?kl>Tn[bl]&&(Tn[bl]=kl):An.push({lo:bl,hi:si,dist:kl})}}var go=0,Ho=0,Ro=0,At={};for(W=0;W<x;W++)At[e[W].id]=0;function ot(gn){return gn!=null&&At[gn]>0?5*At[gn]:0}for(var oo=0;oo<c.length;oo++){var to=c[oo];if((to.type==="activate"||to.type==="deactivate"||to.type==="destroy")&&At.hasOwnProperty(to.participant)){At[to.participant]=to.type==="activate"?At[to.participant]+1:to.type==="deactivate"?Math.max(0,At[to.participant]-1):0;continue}if(to.type==="message"){var cn=S(to.from,0),Yt=S(to.to,0),so=to.label||"";to.number!=null&&(so=to.number+" "+so);var Bn=Hr(so,13,!1),tt=oo+1<c.length?c[oo+1]:null,an=to.to!=null&&(to.activate===to.to||tt!=null&&tt.type==="activate"&&tt.participant===to.to),Ga=ot(to.from)+ot(to.to)+(an?5:0);if(to.deactivate&&At[to.deactivate]>0&&At[to.deactivate]--,to.activate!=null&&At.hasOwnProperty(to.activate)&&At[to.activate]++,to.fromEdge||to.toEdge){var hn=S(to.fromEdge?to.to:to.from,0),Da=Bn+ar+Ga+(to.tailDecor==="circle"||to.headDecor==="circle"?12:0);(to.fromEdge||to.toEdge)==="left"?hn===0?Bo=Math.max(Bo,Da-L-fr[0]/2):Yn(hn-1,hn,Da):x>0&&(hn===x-1?kt=Math.max(kt,Da+5-L-fr[x-1]/2):Yn(hn,hn+1,Da)),go=hn,Ho=hn,Ro=0;continue}if(cn===Yt){var jt=Bn+55+ot(to.from);cn+1<x?Yn(cn,cn+1,jt):jt-fr[cn]/2>kt&&(kt=jt-fr[cn]/2),go=cn,Ho=cn+1<x?cn+1:cn,Ro=cn+1<x?0:Math.max(38,13+Bn)}else Yn(cn,Yt,Bn+ir+Ga),go=Math.min(cn,Yt),Ho=Math.max(cn,Yt),Ro=0}else if(to.type==="note"){var _n=He(to.text,to.shape),da=to.over&&to.over.length>0?S(to.over[0],null):null;if(to.position==="left"||to.position==="top"||to.position==="bottom"){var Jt=da??go;Jt<=0?_n+4-fr[0]/2>Bo&&(Bo=_n+4-fr[0]/2):Yn(Jt-1,Jt,_n+9+fr[Jt-1]/2)}else if(to.position==="right"){var Ut=da??Ho,ga=da==null?Ro:0;Ut>=x-1?x>0&&ga+_n+4-fr[x-1]/2>kt&&(kt=ga+_n+4-fr[x-1]/2):Yn(Ut,Ut+1,_n+9+fr[Ut+1]/2)}else to.over&&to.over.length>1?Yn(S(to.over[0],0),S(to.over[to.over.length-1],0),_n-40):da!=null&&x>0&&(da===0&&_n/2-fr[0]/2>Bo&&(Bo=_n/2-fr[0]/2),da===x-1&&_n/2-fr[x-1]/2>kt&&(kt=_n/2-fr[x-1]/2))}}var mn=[];if(x>0)for(mn[0]=L+Bo+(To[0]>=0?re:0)+fr[0]/2,W=1;W<x;W++){for(var ma=mn[W-1]+Tn[W-1],oa=0;oa<An.length;oa++)An[oa].hi===W&&mn[An[oa].lo]+An[oa].dist>ma&&(ma=mn[An[oa].lo]+An[oa].dist);mn[W]=ma}var On=x>0?mn[x-1]+fr[x-1]/2+(To[x-1]>=0?re:0)+kt+L:120;for(oo=0;oo<c.length;oo++)if(c[oo].type==="divider"){var Za=Hr(c[oo].label||"",13,!0)+57;Za>On&&(On=Za)}function be(gn){return mn[gn]!=null?mn[gn]:L}var $n={},Wn=L+(jo?se+1:0),$r=Wn+xn,ee=[];for(W=0;W<x;W++)ee[W]=null;var Rr=$r+3,tr=[],vr=[],Te=[],jr=null,_e=null;function Br(gn){for(var Pa=0;Pa<vr.length;Pa++)gn<vr[Pa].min&&(vr[Pa].min=gn),gn>vr[Pa].max&&(vr[Pa].max=gn)}for(oo=0;oo<c.length;oo++){var br=c[oo],Or={el:br};switch(tr.push(Or),br.type){case"message":{var xe=br.from!=null?S(br.from,0):null,bo=br.to!=null?S(br.to,0):null,_t=br.fromEdge||null,Wo=br.toEdge||null;if(br.isReturn&&br.from==null){var Fo=Te.length?Te.pop():null,ut=null;if(Fo!=null)xe=Fo.calleeIdx,bo=Fo.callerIdx,_t=Fo.calleeEdge,Wo=Fo.callerEdge,Or.returnCloses=Fo.closes,ut=Fo.el;else if(_e!=null&&_e!=="group"&&_e.fromEdge==null&&_e.toEdge==null)_e.kind==="self"?(xe=_e.idx,bo=_e.idx):(xe=_e.toIdx,bo=_e.fromIdx),ut=_e.el;else{Eo.droppedLine(l,"sequence",br.index,br.raw!=null?br.raw:"return",'returns with no call to answer (plantuml.jar answers "Nowhere to return to.")'),Or.kind="dropped";break}if(ut!=null){var Do={};for(var Fr in br)Object.prototype.hasOwnProperty.call(br,Fr)&&(Do[Fr]=br[Fr]);Do.arrowHead=ut.arrowHead||br.arrowHead,Do.headDecor=ut.headDecor||null,Do.tailDecor=ut.tailDecor||null,Do.color=br.color||ut.color||null,Or.el=br=Do}}var Gt=br.label||"",st=null;if(br.number!=null){var Mn=br.numberText!=null?br.numberText:String(br.number),jn=s(Mn);jn!==Mn&&(st=R(Mn)+" "+Q(Gt)),Gt=jn+" "+Gt}var Hn=Ne(Gt);if(br.from!=null&&br.from===br.to||br.isReturn&&xe!=null&&xe===bo){Or.kind="self",Or.outY=Rr+(Hn?17+Sr*Hn:14),Or.backY=Or.outY+20,Or.idx=xe,Or.label=Gt,Or.labelHtml=st,Or.selfRight=Math.max(38,Gt?13+Hr(Gt,13,!1):0),Rr=Or.backY,Br(xe),_e=Or;break}Or.kind="msg",Or.fromIdx=xe,Or.toIdx=bo,Or.fromEdge=_t,Or.toEdge=Wo,Or.label=Gt,Or.labelHtml=st;var Xo=oo+1<c.length?c[oo+1]:null;if(Xo!=null&&Xo.type==="note"&&(!Xo.over||Xo.over.length===0)&&(Xo.position==="left"||Xo.position==="right"||Xo.position==="top"||Xo.position==="bottom")){var Xn=Ne(Xo.text)*_r+9.3;Or.noteTop=Rr+13,Or.lineY=Or.noteTop+Xn/2+8,Rr=Math.max(Or.lineY,Or.noteTop+Xn)}else Or.lineY=Rr+(Hn?17+Sr*Hn:14),Rr=Or.lineY;xe!=null&&Br(xe),bo!=null&&Br(bo);var Ta=$n[br.to]===!0?br.to:$n[br.from]===!0?br.from:null;if(Ta!=null){var Kn=ue[Ta];Or.createIdx=Kn,ee[Kn]=Or.lineY-23.7,$n[Ta]=!1,Rr=Math.max(Rr,ee[Kn]+zr[Kn]+3)}jr=Or,_e=Or,br.activate&&bo!==xe&&Te.push({callerIdx:xe,calleeIdx:bo,callerEdge:_t,calleeEdge:Wo,closes:br.activate,el:br});break}case"note":{for(var Qo=Ne(br.text),pa=Qo*_r+9.3,Mt=null,la=tr.length-2;la>=0;la--)if(tr[la].kind!=="activate"&&tr[la].kind!=="deactivate"){Mt=tr[la];break}var vn=(!br.over||br.over.length===0)&&(br.position==="left"||br.position==="right"||br.position==="top"||br.position==="bottom")&&Mt!=null&&(Mt.kind==="msg"||Mt.kind==="self");if(Or.h=pa,vn&&Mt.kind==="self")Or.kind="noteAttached",Or.top=Mt.outY-pa/2,Or.anchorLo=Mt.idx,Or.anchorHi=Mt.idx+1<x?Mt.idx+1:Mt.idx,Or.anchorSelfRight=Mt.idx+1>=x?Mt.selfRight:0,Rr=Math.max(Rr,Or.top+pa+2);else if(vn)Or.kind="noteAttached",Or.top=Mt.noteTop!=null?Mt.noteTop:Mt.lineY!=null?Mt.lineY-pa/2-8:Rr+13,Or.anchorLo=Mt.fromIdx!=null?Math.min(Mt.fromIdx,Mt.toIdx):0,Or.anchorHi=Mt.fromIdx!=null?Math.max(Mt.fromIdx,Mt.toIdx):0,Mt.noteTop==null&&(Rr=Math.max(Rr,Or.top+pa+2));else if(Or.kind="note",Or.top=Rr+13,Rr=Or.top+pa+2,br.over&&br.over.length)for(var Jn=0;Jn<br.over.length;Jn++)Br(S(br.over[Jn],0));else br.position==="across"&&x>0&&(Br(0),Br(x-1));break}case"divider":{Or.kind="divider",Or.barY=Rr+31,Rr=Or.barY+13;break}case"delay":{Or.kind="delay",Or.top=Rr+8,Or.lines=br.label?br.label.split(`
+`).length:0,Or.h=28+13*Or.lines,Rr=Or.top+Or.h-11;break}case"gap":{Rr+=br.h!=null?br.h:25;break}case"groupStart":{Or.kind="group",Or.groupKind=br.kind,Or.label=br.label||"",Or.cond=br.cond||null,Or.color=br.color||null,Or.headColor=br.headColor||null,Or.top=Rr+15,Or.min=x,Or.max=-1,Or.elses=[],Or.hidden=br.kind==="par2",vr.push(Or),Rr=Or.top+11.5,Or.branchStart=Rr,Or.branchMax=Rr;break}case"groupElse":{_e="group";var qn=vr.length?vr[vr.length-1]:null;if(qn!=null&&qn.hidden){qn.branchMax=Math.max(qn.branchMax,Rr),Rr=qn.branchStart;break}var ia=Rr+9;qn?.elses.push({y:ia,label:br.label||""}),Rr=ia-7+(br.label?15.3:0);break}case"groupEnd":{_e="group";var zn=vr.pop();zn!=null&&(zn.hidden&&(Rr=Math.max(Rr,zn.branchMax)),zn.bottom=Rr+8,Rr=zn.bottom-1);break}case"ref":{if(Or.kind="ref",Or.top=Rr+11,Or.h=44+Math.max(0,Ne(br.label)-1)*Sr,Rr=Or.top+Or.h-3,br.over&&br.over.length)for(var Ko=0;Ko<br.over.length;Ko++)Br(S(br.over[Ko],0));break}case"create":{br.participant!=null&&($n[br.participant]=!0);break}case"activate":case"deactivate":case"destroy":{Or.kind=br.type,Or.y=Rr;var Bt=S(br.participant,null);if(br.type==="activate"&&Bt!=null&&jr!=null&&jr.toIdx===Bt&&jr.fromIdx!==Bt)Te.push({callerIdx:jr.fromIdx,calleeIdx:Bt,el:jr.el});else if(br.type!=="activate"&&Bt!=null){for(var ta=Te.length-1;ta>=0;ta--)if(Te[ta].calleeIdx===Bt){Te.splice(ta,1);break}}break}default:break}}for(;vr.length;){var ln=vr.pop();ln.hidden&&(Rr=Math.max(Rr,ln.branchMax)),ln.bottom=Rr+8,Rr=ln.bottom-1}var mo=Rr+ae,Vt={};for(W=0;W<x;W++)Vt[e[W].id]=[];function nt(gn){for(var Pa=Vt[gn],kl=0,bl=0;bl<Pa.length;bl++)Pa[bl].end==null&&kl++;return kl}for(var kr=0;kr<tr.length;kr++){var Ir=tr[kr];if(Ir.kind==="activate"&&Ir.el.participant!=null&&Vt.hasOwnProperty(Ir.el.participant))Vt[Ir.el.participant].push({start:Ir.y,end:null,depth:nt(Ir.el.participant),color:Ir.el.color,lineColor:Ir.el.lineColor});else if(Ir.kind==="deactivate"&&Ir.el.participant==null){for(var Tr=null,Gr=0;Gr<x;Gr++)for(var Vr=Vt[e[Gr].id],Ge=0;Ge<Vr.length;Ge++)Vr[Ge].end==null&&(Tr==null||Vr[Ge].start>=Tr.start)&&(Tr=Vr[Ge]);Tr!=null&&(Tr.end=Ir.y)}else if(Ir.kind==="deactivate"&&Ir.el.participant!=null&&Vt.hasOwnProperty(Ir.el.participant)){for(var Jr=Vt[Ir.el.participant],co=Jr.length-1;co>=0;co--)if(Jr[co].end==null){Jr[co].end=Ir.y;break}}else if(Ir.kind==="destroy"&&Ir.el.participant!=null&&Vt.hasOwnProperty(Ir.el.participant))for(var Ie=Vt[Ir.el.participant],Ee=0;Ee<Ie.length;Ee++)Ie[Ee].end==null&&(Ie[Ee].end=Ir.y);else if(Ir.kind==="msg"&&Ir.returnCloses!=null&&Vt.hasOwnProperty(Ir.returnCloses)){for(var qo=Vt[Ir.returnCloses],Ot=qo.length-1;Ot>=0;Ot--)if(qo[Ot].end==null){qo[Ot].end=Ir.lineY;break}}else if(Ir.kind==="msg"){if(Ir.el.deactivate&&Vt.hasOwnProperty(Ir.el.deactivate)){for(var no=Vt[Ir.el.deactivate],Fn=no.length-1;Fn>=0;Fn--)if(no[Fn].end==null){no[Fn].end=Ir.lineY;break}}Ir.el.activate&&Vt.hasOwnProperty(Ir.el.activate)&&Vt[Ir.el.activate].push({start:Ir.lineY,end:null,depth:nt(Ir.el.activate),color:Ir.el.activateColor})}}function Cn(gn,Pa){if(gn==null||gn<0||gn>=x)return 0;for(var kl=Vt[e[gn].id]||[],bl=0,si=0;si<kl.length;si++){var ql=kl[si].end!=null?kl[si].end:mo;if(kl[si].start-1<=Pa&&Pa<=ql+1){var ji=5+kl[si].depth*5;ji>bl&&(bl=ji)}}return bl}for(W=0;W<x;W++)for(var yt=Vt[e[W].id]||[],wt=0;wt<yt.length;wt++)yt[wt].cellId=qr("act");var rt=[],le=[],Fe=[],$e=[];function Se(gn,Pa){if(gn==null||gn<0||gn>=x)return null;for(var kl=Vt[e[gn].id]||[],bl=null,si=-1,ql=0;ql<kl.length;ql++){var ji=kl[ql].end!=null?kl[ql].end:mo;kl[ql].start-1<=Pa&&Pa<=ji+1&&kl[ql].depth>si&&kl[ql].cellId&&(bl=kl[ql].cellId,si=kl[ql].depth)}return bl||(rt[gn]&&Pa>=$e[gn]&&Pa<=mo?rt[gn]:null)}if(jo)for(Be=0;Be<Rt.length;Be++){var ro=null,It=null,Jo=Rt[Be].participants||[];for(et=0;et<Jo.length;et++)if(ue.hasOwnProperty(Jo[et])){var xo=ue[Jo[et]];(ro===null||xo<ro)&&(ro=xo),(It===null||xo>It)&&(It=xo)}if(ro!==null){var Et=mn[ro]-fr[ro]/2-re,Vn=mn[It]+fr[It]/2+re,Un=Y(Rt[Be].color)||"#DDDDDD";i+=u(qr("boxfr"),Rt[Be].label||"",xr("rounded=0;fillColor="+Un+";strokeColor=#181818;strokeWidth=0.5;fontSize=14;fontColor=#000000;verticalAlign=top;align=center;spacingTop=2;html=1;whiteSpace=wrap;",["box"],null,"vertex",Rt[Be].color?Pr:null),Et,L+1,Vn-Et,mo+xn+5-(L+1),"1")}}for(W=0;W<x;W++){var bt=e[W],mt=ee[W]!=null?ee[W]:$r-zr[W],In=mn[W]-fr[W]/2,Zn=mo+zr[W]-mt;if(Lr[W]===0&&bt.kind!=="collections"){var Oe=xr(Kr(bt,r.monochrome,!1).replace("shape=rectangle;",""),[bt.kind||"participant"],bt.stereotype?[bt.stereotype]:[],"vertex",bt.colorInline?Pr:null),uo="shape=umlLifeline;perimeter=lifelinePerimeter;size="+zr[W]+";lifelineMirror=1;dashPattern=5 5;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;"+Oe+(bt.stereoLetter?"spacingLeft=24;":"")+(pr?"strokeWidth="+pr+";":""),io=qr("p");rt[W]=io,le[W]=In,Fe[W]=mt,ze[io]={x:In,w:fr[W]},$e[W]=mt+zr[W],bt.stereotype&&!Ze?i+=z(io,"<i>\xAB"+k(bt.stereotype)+"\xBB</i><br>"+k(bt.name),uo,In,mt,fr[W],Zn,"1"):bt.bodyLines&&bt.bodyLines.length>0?i+=z(io,eo(bt.bodyLines),uo,In,mt,fr[W],Zn,"1"):i+=u(io,bt.name,uo,In,mt,fr[W],Zn,"1"),bt.stereoLetter&&bt.stereoColor&&(i+=u(qr("ps"),bt.stereoLetter,"ellipse;fillColor="+bt.stereoColor+";strokeColor=#181818;strokeWidth=1;fontSize=12;fontColor=#000000;align=center;verticalAlign=middle;",In+7,mt+7,22,22,"1"));continue}var we=qr("pl");rt[W]=we,le[W]=In,Fe[W]=mt,ze[we]={x:In,w:fr[W]},$e[W]=mt+zr[W],i+=u(we,"",xr("shape=umlLifeline;perimeter=lifelinePerimeter;participant=none;size="+zr[W]+";lifelineMirror=1;dashPattern=5 5;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;fillColor=none;strokeColor=#181818;strokeWidth=0.5;",["lifeLine"],null,"edge"),In,mt,fr[W],Zn,"1")}for(kr=0;kr<tr.length;kr++){var de=tr[kr];if(!(de.kind!=="group"||de.hidden)){var $o,ft;de.min<=de.max?($o=mn[de.min]-fr[de.min]/2-10,ft=mn[de.max]+fr[de.max]/2+10):($o=L+5,ft=On-L-5),$o<1&&($o=1);for(var Vo=0;Vo<tr.length;Vo++){var zo=tr[Vo];if(zo.kind==="self"&&zo.label&&zo.outY>=de.top&&zo.backY<=de.bottom){var ka=be(zo.idx)+7+Hr(zo.label,13,!1)+6+10;ka>ft&&(ft=ka)}}var sa=de.groupKind==="group"&&(de.label||de.cond),_a=sa?de.label:de.groupKind||"",Ba=sa?de.cond||"":de.label,No=Math.max(55,Hr(_a,13,!0)+45),vt=Ba?Hr("["+Ba+"]",11,!0):0;ft<$o+No+vt+30&&(ft=$o+No+vt+30);var Wt=U(he,ve(["group"]),[],"vertex"),Nt=de.color&&Y(de.color)?Y(de.color):Wt.fillColor&&Wt.fillColor!=="none"?Wt.fillColor:null;Nt&&(p+=u(qr("grpbg"),"","rounded=0;fillColor="+Nt+";strokeColor=none;",$o,de.top,ft-$o,de.bottom-de.top,"1")),i+=u(qr("grpframe"),"",xr("rounded=0;fillColor=none;strokeColor=#000000;strokeWidth="+(pr||1.5)+";",["group"],null,"vertex",Pr),$o,de.top,ft-$o,de.bottom-de.top,"1"),i+=u(qr("grptab"),_a,xr("rounded=0;fillColor="+(de.headColor&&Y(de.headColor)?Y(de.headColor):"#EEEEEE")+";strokeColor=#000000;strokeWidth=1.5;fontColor=#000000;fontSize=13;fontStyle=1;align=left;spacingLeft=10;verticalAlign=middle;html=1;",["groupHeader"],null,"vertex",de.headColor?Pr:null),$o,de.top,No,19.7,"1"),Ba&&(i+=u(qr("grpcond"),"["+Ba+"]","text;html=1;fontColor=#000000;fontSize=11;fontStyle=1;align=left;verticalAlign=middle;",$o+No+10,de.top+3,vt+8,15,"1"));for(var $a=0;$a<de.elses.length;$a++){var sn=de.elses[$a];i+=G(qr("grpelse"),"",xr("endArrow=none;html=1;strokeColor=#000000;strokeWidth=1;dashed=1;dashPattern=2 2;",["group"],null,"edge",["strokeWidth","dashed","dashPattern","fixDash"]),$o,sn.y,ft,sn.y,"1"),sn.label&&(i+=u(qr("grpelselbl"),"["+sn.label+"]","text;html=1;fontColor=#000000;fontSize=11;fontStyle=1;align=left;verticalAlign=middle;",$o+5,sn.y+2,Hr("["+sn.label+"]",11,!0)+8,15,"1"))}}}for(kr=0;kr<tr.length;kr++){var ce=tr[kr],yr=ce.el;switch(ce.kind){case"msg":{var Io=yr.short?Math.ceil(Hr(ce.label||"",13,!1))+22:0,ge=yr.tailDecor==="circle",Ct=yr.headDecor==="circle"||yr.arrowHead==="circle",Nn=ce.fromEdge?yr.short?be(ce.toIdx)+(ce.fromEdge==="left"?-1:1)*(Io+(ge?Ue:0)):ce.fromEdge==="left"?ge?7.5:0:On-7:be(ce.fromIdx),Qn=ce.toEdge?yr.short?be(ce.fromIdx)+(ce.toEdge==="left"?-1:1)*(Io+(Ct?T:0)):ce.toEdge==="left"?Ct?7.5:0:On-7:be(ce.toIdx),kn=Qn>=Nn?1:-1,Ke=Nn+(ce.fromIdx!=null?kn*Cn(ce.fromIdx,ce.lineY):0),yn=Qn-(ce.toIdx!=null?kn*Cn(ce.toIdx,ce.lineY):0);ce.createIdx!=null&&ce.toIdx===ce.createIdx&&(yn=Qn-kn*(fr[ce.toIdx]/2+2));var tn=Ke,Ia=yn;Ct?(yn=Qn-kn*T,Ia=Qn):yr.arrowHead==="lost"&&(yn=Qn-kn*6,Ia=Qn),yr.tailDecor==="lost"&&(Ke=Nn+kn*6,tn=Nn);var Ma=N(yr.arrowHead)+"html=1;rounded=0;edgeStyle=none;curved=0;strokeColor="+(Y(yr.color)||Xr||"#181818")+";strokeWidth="+(wr||1)+";fontColor=#000000;fontSize=13;verticalAlign=bottom;labelBackgroundColor=none;";yr.lineStyle==="dashed"?Ma+="dashed=1;dashPattern=2 2;":yr.lineStyle==="dotted"&&(Ma+="dashed=1;dashPattern=1 3;"),yr.tailDecor==="lost"?Ma+="startArrow=cross;startSize=12;":ge&&(Ma+="startArrow=oval;startFill=1;startSize="+O+";"),Ma=xr(Ma,["arrow"],null,"edge",yr.color?["strokeColor"]:null);var Sl=0;if(ce.label&&yn!==Ke&&Dr!=="center"){var Ll=Math.min(tn,Ia),ja=Hr(ce.label,13,!1),Ja=Dr==="right"?Math.max(tn,Ia)-7-ja/2:Ll+(kn>0?7:17)+ja/2;(Ja>Math.max(Ke,yn)-4||Ja-ja/2<Ll+4)&&(Ja=(Ke+yn)/2),Sl=2*(Ja-Ke)/(yn-Ke)-1}var Ol=ce.fromEdge?null:Se(ce.fromIdx,ce.lineY),Yl=ce.toEdge||ce.createIdx!=null&&ce.toIdx===ce.createIdx||Ct||yr.arrowHead==="lost"?null:Se(ce.toIdx,ce.lineY),ko=qr("msg");i+=wo(ko,ce.label,Ma,Ke,ce.lineY,yn,ce.lineY,Sl,Ol,Yl,ce.labelHtml),Ct&&(i+=me(qr("tipdot"),ko,Y(yr.color)||Xr||"#181818",kn*T-5,-5));break}case"self":{var fo=be(ce.idx)+Cn(ce.idx,ce.outY),lt=38,Lt=Y(yr.color)||Xr||"#181818",ao="html=1;strokeColor="+Lt+";strokeWidth="+(wr||1)+";";if(yr.lineStyle==="dashed"&&(ao+="dashed=1;dashPattern=2 2;"),ao=xr(ao,["arrow"],null,"edge",yr.color?["strokeColor"]:null),i+=G(qr("msg"),"","endArrow=none;"+ao,fo,ce.outY,fo+lt,ce.outY,"1"),i+=G(qr("msg"),"","endArrow=none;"+ao,fo+lt,ce.outY,fo+lt,ce.backY,"1"),i+=G(qr("msg"),"",N(yr.arrowHead)+ao,fo+lt,ce.backY,fo+3,ce.backY,"1"),ce.label){var wa=Ne(ce.label),ho=wa*Sr+3,Ra="text;html=1;fontColor=#000000;fontSize=13;align=left;verticalAlign=middle;",Va=Hr(ce.label,13,!1)+6;i+=ce.labelHtml!=null?z(qr("msglbl"),ce.labelHtml,Ra,be(ce.idx)+7,ce.outY-ho-2,Va,ho,"1"):u(qr("msglbl"),ce.label,Ra,be(ce.idx)+7,ce.outY-ho-2,Va,ho,"1")}break}case"note":case"noteAttached":{var un=He(yr.text,yr.shape),En,Oa=yr.over&&yr.over.length>0?S(yr.over[0],0):null;if(yr.position==="across"&&x>0){var Vl=be(0),Wl=be(x-1);un<Wl-Vl+50&&(un=Wl-Vl+50),En=(Vl+Wl)/2-un/2}else if(yr.position==="left"||yr.position==="top"||yr.position==="bottom"){var hi=Oa??(ce.anchorLo!=null?ce.anchorLo:0);En=be(hi)-4-un}else if(yr.position==="right"){var Ci=Oa??(ce.anchorHi!=null?ce.anchorHi:0);En=be(Ci)+5,Oa==null&&ce.anchorSelfRight&&(En+=ce.anchorSelfRight)}else if(yr.over&&yr.over.length>1){var Qa=be(S(yr.over[0],0)),na=be(S(yr.over[yr.over.length-1],0));if(na<Qa){var ai=Qa;Qa=na,na=ai}un<na-Qa+40&&(un=na-Qa+40),En=(Qa+na)/2-un/2}else En=be(Oa??0)-un/2;var Ql=Y(yr.color)||(r.monochrome?"#E3E3E3":"#FEFFDD"),Dl;yr.shape==="box"?Dl="rounded=0;fillColor="+Ql+";strokeColor=#181818;strokeWidth=0.5;":yr.shape==="hexagon"?Dl="shape=hexagon;size=10;fixedSize=1;fillColor="+Ql+";strokeColor=#181818;strokeWidth=0.5;":Dl="shape=note;size=10;fillColor="+Ql+";strokeColor=#181818;strokeWidth=0.5;",Dl+="fontColor=#000000;fontSize=13;align=left;spacingLeft=4;spacing=2;verticalAlign=middle;whiteSpace=wrap;html=1;",Dl=xr(Dl,["note",yr.shape==="hexagon"?"hnote":yr.shape==="box"?"rnote":"note"],null,"vertex",yr.color?Pr:null),j+=u(qr("note"),yr.text||"",Dl,En,ce.top,un,ce.h,"1");break}case"divider":{var ri=U(he,ve(["separator"]),[],"vertex"),wi="endArrow=none;html=1;strokeColor="+(ri.fillColor&&ri.fillColor!=="none"?ri.fillColor:q)+";strokeWidth=1;";j+=G(qr("divbar"),"",wi,0,ce.barY,On,ce.barY,"1"),j+=G(qr("divbar"),"",wi,0,ce.barY+3,On,ce.barY+3,"1");var Pi=yr.label||"",Ha=Hr(Pi,13,!0)+18.28;j+=u(qr("div"),Pi,xr("rounded=0;fillColor="+or+";strokeColor="+q+";strokeWidth=2;fontColor="+rr+";fontSize=13;fontStyle=1;align=center;verticalAlign=middle;html=1;",["separator"]),(On-Ha)/2,ce.barY-12.9,Ha,25.7,"1");break}case"delay":{for(W=0;W<x;W++){var Ml=To[W]>=0?Y(Rt[To[W]].color)||"#DDDDDD":Y(F.backgroundcolor)||"#FFFFFF";i+=u(qr("dlmask"),"","rounded=0;strokeColor=none;fillColor="+Ml+";",be(W)-4,ce.top,8,ce.h,"1"),i+=G(qr("dllife"),"","endArrow=none;html=1;strokeColor=#181818;strokeWidth=0.5;dashed=1;dashPattern=1 4;",be(W),ce.top,be(W),ce.top+ce.h,"1")}if(yr.label){var os=x>0?(be(0)+be(x-1))/2:On/2,ts=Math.max(40,Math.ceil(Hr(yr.label,11,!1))+10),Fi=13*ce.lines+4;i+=u(qr("delay"),yr.label,xr("text;html=1;fontColor=#000000;fontSize=11;align=center;verticalAlign=middle;",["delay"],null,"text"),Math.round(os-ts/2),Math.round(ce.top+ce.h/2-Fi/2),ts,Fi,"1")}break}case"ref":{var ca=0,bn=x>0?x-1:0;if(yr.over&&yr.over.length>0&&(ca=S(yr.over[0],0),bn=S(yr.over[yr.over.length-1],ca),bn<ca)){var ll=ca;ca=bn,bn=ll}var ml=be(ca)-25,Gl=be(bn)+25-ml,rl=Hr(yr.label||"",12,!1);Gl<rl+47&&(Gl=rl+47),i+=u(qr("refframe"),"",xr("rounded=0;fillColor=none;strokeColor=#000000;strokeWidth=1.5;",["reference"]),ml,ce.top,Gl,ce.h,"1"),i+=u(qr("reftab"),"ref",xr("rounded=0;fillColor=#EEEEEE;strokeColor=#000000;strokeWidth=2;fontColor=#000000;fontSize=13;fontStyle=1;align=left;spacingLeft=10;verticalAlign=middle;html=1;",["referenceHeader"]),ml,ce.top,63,19,"1"),i+=u(qr("reflbl"),yr.label||"",xr("text;html=1;fontColor=#000000;fontSize=12;align=center;verticalAlign=middle;",["reference"],null,"text"),ml,ce.top+21,Gl,ce.h-23,"1");break}case"destroy":{var nl=be(S(yr.participant,0));i+=G(qr("destx1"),"","endArrow=none;html=1;strokeColor=#A80036;strokeWidth=2;",nl-9,ce.y-9,nl+9,ce.y+9,"1"),i+=G(qr("destx2"),"","endArrow=none;html=1;strokeColor=#A80036;strokeWidth=2;",nl-9,ce.y+9,nl+9,ce.y-9,"1");break}default:break}}for(W=0;W<x;W++)for(var yl=Vt[e[W].id],vi=0;vi<yl.length;vi++){var hl=yl[vi],gs=hl.end!=null?hl.end:mo,ns=Y(hl.color)||nr,ds=Y(hl.lineColor)||"#181818",Rs=hl.lineColor?Pr.concat(["strokeColor"]):hl.color?Pr:null;i+=u(hl.cellId||qr("act"),"",xr("rounded=0;fillColor="+ns+";strokeColor="+ds+";strokeWidth=1;points=[];perimeter=orthogonalPerimeter;outlineConnect=0;portConstraint=eastwest;",["activationBox"],null,"vertex",Rs),be(W)-5+hl.depth*5,hl.start,10,Math.max(6,gs-hl.start),"1")}for(i+=j,i=p+i,W=0;W<x;W++){var al=e[W],Ti=mn[W]-fr[W]/2,cs=ee[W]!=null?ee[W]:$r-zr[W],hs=al.name,Tl=null;al.stereotype&&!Ze?Tl="<i>\xAB"+k(al.stereotype)+"\xBB</i><br>"+k(al.name):al.bodyLines&&al.bodyLines.length>0&&(Tl=eo(al.bodyLines));for(var ei=[cs,mo],Ka=0;Ka<ei.length;Ka++){if(Lr[W]===0&&al.kind!=="collections"){Ka===1&&al.stereoLetter&&al.stereoColor&&(i+=u(qr("psf"),al.stereoLetter,"ellipse;fillColor="+al.stereoColor+";strokeColor=#181818;strokeWidth=1;fontSize=12;fontColor=#000000;align=center;verticalAlign=middle;",Ti+7,ei[Ka]+7,22,22,"1"));continue}var Xi=rt[W],Na=le[W],Bl=Fe[W],wl=xr(Kr(al,r.monochrome,Ka===1),[al.kind||"participant"],al.stereotype?[al.stereotype]:[],"vertex",al.colorInline?Pr:null)+"part=1;";if(Lr[W]>0){var li=Ka===0?ei[Ka]:ei[Ka]+(zr[W]-te[W]);i+=u(qr(Ka===0?"p":"pf"),hs,wl,mn[W]-Lr[W]/2-Na,li-Bl,Lr[W],te[W],Xi);continue}al.kind==="collections"&&(i+=u(qr(Ka===0?"pc":"pcf"),"","rounded=0;fillColor="+(Y(al.color)||(r.monochrome?"#E3E3E3":"#E2E2F0"))+";strokeColor=#181818;strokeWidth=0.5;part=1;",Ti+4-Na,ei[Ka]-4-Bl,fr[W],zr[W],Xi)),Tl!=null?i+=z(qr(Ka===0?"p":"pf"),Tl,wl+(al.stereoLetter?"spacingLeft=24;":""),Ti-Na,ei[Ka]-Bl,fr[W],zr[W],Xi):i+=u(qr(Ka===0?"p":"pf"),hs,wl,Ti-Na,ei[Ka]-Bl,fr[W],zr[W],Xi),al.stereoLetter&&al.stereoColor&&(i+=u(qr(Ka===0?"ps":"psf"),al.stereoLetter,"ellipse;fillColor="+al.stereoColor+";strokeColor=#181818;strokeWidth=1;fontSize=12;fontColor=#000000;align=center;verticalAlign=middle;part=1;",Ti+7-Na,ei[Ka]+7-Bl,22,22,Xi))}}var La=mo;if(r.legend&&r.legend.lines&&r.legend.lines.length){for(var il=qe(r.legend.lines),ya=0,Xl=0;Xl<x;Xl++)zr[Xl]>ya&&(ya=zr[Xl]);var nu=mo+ya+14,zi=L+Oo,Il=r.legend.position==="left"?zi:r.legend.position==="right"?Math.max(zi,On-L-il.w):Math.max(zi,(On-il.w)/2);i+=St(il,Il,nu,qr),La=nu+il.h}if(r.title){var qs=Hr(r.title,14,!0)+10;i+=u(qr("title"),r.title,xr("text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",["document","title"],null,"text"),(On-qs)/2,-34,qs,24,"1")}if(r.header){var Xt=Hr(r.header,11,!1)+8;i+=u(qr("header"),r.header,xr("text;html=1;fillColor=none;strokeColor=none;fontSize=11;fontColor=#888888;align=right;verticalAlign=middle;",["document","header"],null,"text"),On-L-Xt,r.title?-56:-34,Xt,18,"1")}if(r.caption||r.footer){for(var Zs=0,ii=0;ii<x;ii++)zr[ii]>Zs&&(Zs=zr[ii]);var qi=Math.max(mo+Zs+8,La+6);if(r.caption){var Ls=Hr(r.caption,14,!1)+10;i+=u(qr("caption"),r.caption,xr("text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontColor=#000000;align=center;verticalAlign=middle;",["document","caption"],null,"text"),(On-Ls)/2,qi,Ls,22,"1"),qi+=26}if(r.footer){var Zi=Hr(r.footer,11,!1)+8;i+=u(qr("footer"),r.footer,xr("text;html=1;fillColor=none;strokeColor=none;fontSize=11;fontColor=#888888;align=center;verticalAlign=middle;",["document","footer"],null,"text"),(On-Zi)/2,qi,Zi,18,"1")}}return i}var We=null,pn=120,ra=40,Gn=60,Xe=60,f=30,d=20,b=24,E=80,ur=6,Er=30,ke=28,dr=16,Go=20,lo=26,vo=35,Rn=50,rn=45,Co=46;function Dn(r){switch(r.kind){case"initial":return"ellipse;fillColor=#222222;strokeColor=#222222;";case"final":return"shape=endState;fillColor=#222222;strokeColor=#222222;";case"fork":case"join":return"shape=rectangle;fillColor=#555555;strokeColor=#555555;";case"choice":return"rhombus;fillColor=#F1F1F1;strokeColor=#181818;";case"start":return"ellipse;fillColor=#222222;strokeColor=#222222;";case"end":return"shape=endState;fillColor=#222222;strokeColor=#222222;";case"history_shallow":return"ellipse;fillColor=#F1F1F1;strokeColor=#181818;fontStyle=1;fontSize=14;";case"history_deep":return"ellipse;fillColor=#F1F1F1;strokeColor=#181818;fontStyle=1;fontSize=14;";case"entrypoint":return"ellipse;fillColor=#FFFFFF;strokeColor=#181818;strokeWidth=1.5;verticalLabelPosition=top;verticalAlign=bottom;fontSize=12;";case"exitpoint":return"shape=mxgraph.flowchart.summing_function;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=1;verticalLabelPosition=bottom;verticalAlign=top;fontSize=12;";default:var l=Y(r.color)||"#F1F1F1";return"rounded=1;absoluteArcSize=1;arcSize=25;fillColor="+l+";strokeColor=#181818;whiteSpace=wrap;align=center;"}}function Ve(r){switch(r.kind){case"initial":case"start":return{w:d,h:d};case"final":case"end":return{w:b,h:b};case"fork":case"join":return{w:E,h:ur};case"choice":return{w:Er,h:Er};case"history_shallow":case"history_deep":return{w:ke,h:ke};case"entrypoint":return{w:d,h:d};case"exitpoint":return{w:b,h:b};default:{var l=Rn,e=Ss(r.name,14,!1);if(r.description&&r.description.length>0){l=lo+r.description.length*dr+14;for(var c=0;c<r.description.length;c++){var i=Ss(r.description[c],14,!1);i>e&&(e=i)}}var h=Math.max(50,Math.ceil(e+20));if(r.children&&r.children.length>0){var F=dt(r);h=Math.max(h,F.w),l=F.h}return{w:h,h:l}}}}function dt(r){var l=Go,e=lo,c=r.description?r.description.length:0,i=c>0?c*dr+8:0,h=c>0?r.description.join(`
+`):"",F=r.regions&&r.regions.length>0?r.regions:[{states:r.children||[]}],j=[],p=[],or=Math.ceil(Ss(r.name,14,!1))+24,q,rr,nr;if(r.regionSep==="|"&&F.length>1){var Xr=l,wr=e+l+i;for(q=0;q<F.length;q++){var pr=F[q].states||[],Dr=0,Ze=e+l+i;for(rr=0;rr<pr.length;rr++){var he=Ve(pr[rr]);he.w>Dr&&(Dr=he.w)}for(rr=0;rr<pr.length;rr++)nr=Ve(pr[rr]),j.push({state:pr[rr],x:Xr+(Dr-nr.w)/2,y:Ze,w:nr.w,h:nr.h}),Ze+=nr.h,rr<pr.length-1&&(Ze+=rn);Ze>wr&&(wr=Ze),Xr+=Dr,q<F.length-1&&(p.push(Xr+Co/2),Xr+=Co)}return{w:Math.max(Xr+l,or),h:wr+l,placements:j,seps:p,sepDir:"v",descH:i,descText:h}}var Pr=0,ve=e+l+i,xr=[],qr=[],ze=!1;for(q=0;q<F.length;q++){var wo=F[q].states||[],me=[];for(rr=0;rr<wo.length;rr++){var ue=wo[rr].kind;ue==="history_shallow"||ue==="history_deep"?(xr.push(wo[rr]),ze=!0):ue==="entrypoint"||ue==="exitpoint"?(nr=Ve(wo[rr]),j.push({state:wo[rr],x:0,y:0,w:nr.w,h:nr.h,pinned:!0})):me.push(wo[rr])}qr.push(me)}if(ze){for(q=0;q<qr.length;q++)for(rr=0;rr<qr[q].length;rr++)if(qr[q][rr].kind==="initial"){xr.unshift(qr[q].splice(rr,1)[0]);break}}var po=0;if(xr.length>0){var x=0,S=l;for(rr=0;rr<xr.length;rr++)nr=Ve(xr[rr]),nr.h>x&&(x=nr.h);for(rr=0;rr<xr.length;rr++)nr=Ve(xr[rr]),j.push({state:xr[rr],x:S,y:e+16+i+(x-nr.h)/2,w:nr.w,h:nr.h,pinned:!0}),S+=nr.w+34;po=S-34,ve=e+16+i+x+rn+16}for(q=0;q<qr.length;q++){var fr=qr[q];for(rr=0;rr<fr.length;rr++){var zr=Ve(fr[rr]);zr.w>Pr&&(Pr=zr.w)}for(rr=0;rr<fr.length;rr++)nr=Ve(fr[rr]),j.push({state:fr[rr],x:0,y:ve,w:nr.w,h:nr.h}),ve+=nr.h,rr<fr.length-1&&(ve+=rn);q<qr.length-1&&(p.push(ve+Co/2),ve+=Co)}for(var Lr=Math.max(Pr+l*2,po+l*2,or),te=ve+l,W=0;W<j.length;W++)j[W].pinned||(j[W].x=(Lr-j[W].w)/2);return{w:Lr,h:te,placements:j,seps:p,sepDir:"h",descH:i,descText:h}}function $t(r){switch(r.kind){case"initial":case"start":case"final":case"end":case"fork":case"join":return"";case"history_shallow":return"H";case"history_deep":return"H*";case"choice":return"";case"entrypoint":case"exitpoint":return r.name;default:return r.name}}function Sa(r,l){var e=r.states,c=r.transitions,i=r.notes,h="",F=0,j=r.styleSheet||null;function p(ko,fo,lt,Lt,ao){return X(ko,j,["root","element","stateDiagram"].concat(fo),lt||[],Lt||"vertex",ao)}function or(ko){return ko.stereotype?[ko.stereotype]:[]}function q(ko,fo){if(ko.kind==="initial"||ko.kind==="start"||ko.kind==="final"||ko.kind==="end")return p(fo,["circle"],or(ko));if(ko.kind!=="state")return fo;var lt=U(j,["root","element","stateDiagram","state"],or(ko),"vertex");return ko.color?(delete lt.fillColor,delete lt.gradientColor):lt.fillColor!=null&&/swimlaneFillColor=/.test(fo)&&!/swimlaneFillColor=#FFFFFF;/.test(fo)&&(lt.swimlaneFillColor=lt.fillColor),H(fo,lt)}function rr(ko){return ko+"_"+F++}var nr={};function Xr(ko){for(var fo=ko?String(ko).split(`
+`):[""],lt=0,Lt=0;Lt<fo.length;Lt++){var ao=Mi(fo[Lt])*.9285714285714286;ao>lt&&(lt=ao)}return{w:Math.max(30,Math.round(lt+21)),h:Math.round(fo.length*15.3+10)}}function wr(ko,fo){if(fo==null||ko.regions&&ko.regions.length>1)return null;for(var lt=fo.placements||[],Lt=0;Lt<lt.length;Lt++){var ao=lt[Lt].state.kind;if(ao==="entrypoint"||ao==="exitpoint"||ao==="history_shallow"||ao==="history_deep")return null}return{top:lo+Go+(fo.descH||0),left:Go,right:Go,bottom:Go}}function pr(ko,fo,lt){if(We!=null){We.node(ko);var Lt=wr(fo,lt);Lt!=null&&We.container(ko,Lt,Math.ceil(Ss(fo.name,14,!1))+24)}}function Dr(ko,fo){return We?.follow(ko,fo),ko}for(var Ze={},he=0;he<e.length;he++)Ze[e[he].id]=!0;for(var Pr={},ve={},he=0;he<e.length;he++)Pr[e[he].id]=[],ve[e[he].id]=0;var xr={};(function ko(fo,lt){for(var Lt=0;Lt<fo.length;Lt++){var ao=fo[Lt],wa=lt||ao.id;if(lt&&(xr[ao.id]=lt),ao.children&&ko(ao.children,wa),ao.regions)for(var ho=0;ho<ao.regions.length;ho++)ko(ao.regions[ho].children||[],wa)}})(e,null);for(var qr=0;qr<c.length;qr++){var ze=c[qr],wo=Ze[ze.from]?ze.from:xr[ze.from],me=Ze[ze.to]?ze.to:xr[ze.to];if(!(!wo||!me||!Ze[wo]||!Ze[me]||wo===me)&&!(ze.direction==="left"||ze.direction==="right")){if(ze.direction==="up"){Pr[me].push(wo),ve[wo]++;continue}Pr[wo].push(me),ve[me]++}}var ue="",po={},x;for(x=0;x<e.length;x++)for(var S=e[x].id,fr=Pr[S]||[],zr=0;zr<fr.length;zr++){var Lr=S+ue+fr[zr];po[Lr]=(po[Lr]||0)+1}var te={},W={};for(x=0;x<e.length;x++)te[e[x].id]=[],W[e[x].id]=0;for(x=0;x<e.length;x++)for(var Zr=e[x].id,Re=Pr[Zr]||[],Ae=0;Ae<Re.length;Ae++){var Pe=Re[Ae],De=po[Zr+ue+Pe]||0,Qr=po[Pe+ue+Zr]||0;Qr>De||(te[Zr].push(Pe),W[Pe]++)}Pr=te,ve=W;for(var Po={},Qe={},yo="",ie=0;ie<e.length;ie++)Qe[e[ie].id]=0;function pe(ko){var fo=[{node:ko,idx:0}];for(Qe[ko]=1;fo.length>0;){var lt=fo[fo.length-1],Lt=Pr[lt.node]||[];if(lt.idx<Lt.length){var ao=Lt[lt.idx++];Qe[ao]===1?Po[lt.node+yo+ao]=!0:Qe[ao]===0&&(Qe[ao]=1,fo.push({node:ao,idx:0}))}else Qe[lt.node]=2,fo.pop()}}for(var Mo=0;Mo<e.length;Mo++)ve[e[Mo].id]===0&&Qe[e[Mo].id]===0&&pe(e[Mo].id);for(var Mo=0;Mo<e.length;Mo++)Qe[e[Mo].id]===0&&pe(e[Mo].id);for(var Zt={},Uo=0;Uo<e.length;Uo++)Zt[e[Uo].id]=0;for(var xn=0;xn<e.length;xn++)for(var gt=e[xn].id,To=Pr[gt]||[],Rt=0;Rt<To.length;Rt++)Po[gt+yo+To[Rt]]||Zt[To[Rt]]++;for(var Be={},Ao=[],et=0;et<e.length;et++)Be[e[et].id]=0,Zt[e[et].id]===0&&Ao.push(e[et].id);for(var jo=e.length*e.length+16;Ao.length>0&&jo-- >0;)for(var Tn=Ao.shift(),dn=Pr[Tn]||[],An=0;An<dn.length;An++){var Bo=dn[An];Po[Tn+yo+Bo]||(Be[Bo]<Be[Tn]+1&&(Be[Bo]=Be[Tn]+1),--Zt[Bo]===0&&Ao.push(Bo))}for(var kt={},Yn=[],he=0;he<e.length;he++){var go=Be[e[he].id];kt[go]||(kt[go]=[],Yn.push(go)),kt[go].push(e[he])}Yn.sort(function(ko,fo){return ko-fo});for(var Ho=0;Ho<c.length;Ho++){var Ro=c[Ho];if(!(Ro.direction!=="left"&&Ro.direction!=="right")&&!(Be[Ro.from]===void 0||Be[Ro.from]!==Be[Ro.to])){for(var At=kt[Be[Ro.from]],ot=-1,oo=-1,to=0;to<At.length;to++)At[to].id===Ro.from&&(ot=to),At[to].id===Ro.to&&(oo=to);if(!(ot<0||oo<0)){if(Ro.direction==="left"&&oo>ot){var cn=At.splice(oo,1)[0];At.splice(ot,0,cn)}else if(Ro.direction==="right"&&oo<ot){var Yt=At.splice(oo,1)[0];At.splice(ot,0,Yt)}}}}for(var so={},Bn=0;Bn<e.length;Bn++){var tt=e[Bn],an=Ve(tt),Ga={w:an.w,h:an.h};tt.children&&tt.children.length>0&&(Ga.layout=dt(tt)),so[tt.id]=Ga}for(var hn=r.direction==="LR",Da=0,jt=0;jt<i.length;jt++)if(i[jt].position!=="right"){var _n=Xr(i[jt].text);_n.w+vo>Da&&(Da=_n.w+vo)}for(var da=[],Jt=[],Ut=0,ga=0,mn=0;mn<Yn.length;mn++){for(var ma=kt[Yn[mn]],oa=0,On=0,Za=0;Za<ma.length;Za++)oa+=so[ma[Za].id].w,On+=so[ma[Za].id].h;oa+=(ma.length-1)*Gn,On+=(ma.length-1)*Xe,da[mn]=oa,Jt[mn]=On,oa>Ut&&(Ut=oa),On>ga&&(ga=On)}var be=[],$n=!1;if(hn)for(var Wn=0;Wn<e.length;Wn++){var $r=e[Wn].kind;($r==="initial"||$r==="start")&&($n=!0)}for(var ee=$n?d+Xe:0,Rr=f,tr=f+Da,vr=0;vr<Yn.length;vr++){for(var Te=kt[Yn[vr]],jr=0,_e=0,Br=0;Br<Te.length;Br++)so[Te[Br].id].h>jr&&(jr=so[Te[Br].id].h),so[Te[Br].id].w>_e&&(_e=so[Te[Br].id].w);if(hn){for(var br=[],Br=0;Br<Te.length;Br++){var Or=Te[Br].kind;Or==="initial"||Or==="start"||Or==="final"||Or==="end"?be.push(Te[Br]):br.push(Te[Br])}if(br.length>0){for(var xe=0,bo=0,_t=0;_t<br.length;_t++)so[br[_t].id].w>xe&&(xe=so[br[_t].id].w),bo+=so[br[_t].id].h;bo+=(br.length-1)*Xe;for(var Wo=f+ee+(ga-bo)/2,_t=0;_t<br.length;_t++){var Fo=so[br[_t].id];Fo.x=tr+(xe-Fo.w)/2,Fo.y=Wo,Wo+=Fo.h+Xe}tr+=xe+Gn}}else{for(var ut=f+Da+(Ut-da[vr])/2,Br=0;Br<Te.length;Br++){var Do=Te[Br],Fo=so[Do.id];so[Do.id].x=ut,so[Do.id].y=Rr+(jr-Fo.h)/2,ut+=Fo.w+Gn}Rr+=jr+Xe}}for(var Fr=0;Fr<be.length;Fr++){var Gt=be[Fr],st=so[Gt.id];if(Gt.kind==="initial"||Gt.kind==="start"){for(var Mn=null,jn=0;jn<c.length;jn++)if(c[jn].from===Gt.id&&so[c[jn].to]){Mn=so[c[jn].to];break}Mn&&Mn.x!=null&&(st.x=Mn.x+(Mn.w-st.w)/2,st.y=Mn.y-Xe-st.h)}else{for(var Hn=0,Xo=0,Xn=-1e9,jn=0;jn<c.length;jn++)if(c[jn].to===Gt.id&&so[c[jn].from]&&so[c[jn].from].x!=null){var Ta=so[c[jn].from];Hn+=Ta.x+Ta.w/2,Xo++,Ta.y+Ta.h>Xn&&(Xn=Ta.y+Ta.h)}Xo>0&&(st.x=Hn/Xo-st.w/2,st.y=Xn+Xe)}st.x==null&&(st.x=f+Da,st.y=f)}if(!hn){for(var Kn={},Qo=0;Qo<e.length;Qo++){var pa=Be[e[Qo].id];Kn[pa]=(Kn[pa]||0)+1}for(var Mt={},la=0;la<c.length;la++){var vn=c[la].from,Jn=c[la].to;vn!==Jn&&(Mt[vn]||(Mt[vn]=[]),Mt[vn].indexOf(Jn)<0&&Mt[vn].push(Jn))}for(var qn=0;qn<e.length;qn++){var ia=e[qn];if(!(ia.kind!=="choice"&&ia.kind!=="fork")){var zn=Mt[ia.id]||[];if(!(zn.length<2))for(var Ko=130,Bt=0;Bt<zn.length;Bt++){var ta=zn[Bt];Kn[Be[ta]]===1&&(!so[ta]||so[ta].x==null||(so[ta].x+=((zn.length-1)/2-Bt)*Ko))}}}}function ln(ko){var fo={fill:null,line:null,text:null,dashed:!1,bold:!1};if(!ko)return fo;for(var lt=String(ko).split(";"),Lt=0;Lt<lt.length;Lt++){var ao=lt[Lt].replace(/^\s+|\s+$/g,""),wa=ao.match(/^(line|text|back|header)\s*:\s*#?([\w-]+)$/i);if(wa){var ho=Y("#"+wa[2]);if(ho){var Ra=wa[1].toLowerCase();Ra==="line"?fo.line=ho:Ra==="text"?fo.text=ho:fo.fill=ho}}else/^line\.(dashed|dotted)$/i.test(ao)?fo.dashed=!0:/^line\.bold$/i.test(ao)?fo.bold=!0:ao&&(fo.fill=Y(ao.charAt(0)==="#"?ao:"#"+ao)||fo.fill)}return fo}function mo(ko){return"strokeColor="+(ko.line||"#181818")+";strokeWidth="+(ko.bold?1.5:.5)+";"+(ko.text?"fontColor="+ko.text+";":"")+(ko.dashed?"dashed=1;":"")}function Vt(ko){var fo=ln(ko.color);return"swimlane;collapsible=0;startSize="+lo+";whiteSpace=wrap;align=center;html=1;fontSize=14;fontStyle=0;rounded=1;absoluteArcSize=1;arcSize=25;fillColor="+(fo.fill||"#F1F1F1")+";swimlaneFillColor="+(fo.fill||"#F1F1F1")+";"+mo(fo)}function nt(ko){var fo=ln(ko.color);return"swimlane;collapsible=0;startSize="+lo+";fillColor="+(fo.fill||"#F1F1F1")+";swimlaneFillColor=#FFFFFF;"+mo(fo)+"rounded=1;absoluteArcSize=1;arcSize=25;whiteSpace=wrap;align=center;html=1;fontSize=14;fontStyle=0;"}function kr(ko,fo,lt,Lt){return u(rr("sdesc"),ko.description.join(`
+`),p("text;align=left;verticalAlign=top;spacingLeft=6;spacingTop=2;whiteSpace=wrap;fillColor=none;strokeColor=none;html=1;fontSize=14;",["state"],or(ko),"text"),0,lo,lt,Lt-lo,fo)}function Ir(ko,fo,lt,Lt,ao,wa){var ho=ko.placements;if(ko.descH>0){var Ra=rr("sdesc");We?.part(Ra),h+=u(Ra,ko.descText,"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;fontSize=12;fontColor=#000000;spacingLeft=4;spacingTop=2;",Go/2,lo+2,ao-Go,ko.descH-4,fo)}for(var Va=[],un=[],En=[],Oa=0;Oa<ho.length;Oa++){var Vl=ho[Oa].state.kind;Vl==="history_shallow"||Vl==="history_deep"?Va.push(ho[Oa]):Vl==="entrypoint"?un.push(ho[Oa]):Vl==="exitpoint"&&En.push(ho[Oa])}for(var Wl=0;Wl<un.length;Wl++)un[Wl].x=ao*(Wl+1)/(un.length+1)-un[Wl].w/2,un[Wl].y=-un[Wl].h/2;for(var hi=0;hi<En.length;hi++)En[hi].x=ao*(hi+1)/(En.length+1)-En[hi].w/2,En[hi].y=wa-En[hi].h/2;for(var Ci=0;Ci<ho.length;Ci++){var Qa=ho[Ci],na=Qa.state,ai=rr("sc"),Ql=na.children&&na.children.length>0,Dl,ri;if(Ql?(Dl=na.name,ri=q(na,nt(na))):na.kind==="state"?(Dl=na.name,ri=q(na,Vt(na))):(Dl=$t(na),ri=q(na,Dn(na))),h+=u(ai,Dl,ri,Qa.x,Qa.y,Qa.w,Qa.h,fo),!Ql&&na.kind==="state"&&na.description&&na.description.length>0&&(h+=kr(na,ai,Qa.w,Qa.h)),nr[na.id]={x:lt+Qa.x,y:Lt+Qa.y,w:Qa.w,h:Qa.h,cellId:ai},Ql){var wi=dt(na);pr(ai,na,wi),Ir(wi,ai,lt+Qa.x,Lt+Qa.y,Qa.w,Qa.h)}else We?.node(ai)}for(var Pi=ko.seps||[],Ha=0;Ha<Pi.length;Ha++){var Ml="strokeColor=#181818;strokeWidth=1;dashed=1;dashPattern=6 6;endArrow=none;";ko.sepDir==="v"?h+=G(Dr(rr("sconc"),fo),"",Ml,lt+Pi[Ha],Lt+lo,lt+Pi[Ha],Lt+wa-2,"1"):h+=G(Dr(rr("sconc"),fo),"",Ml,lt+2,Lt+Pi[Ha],lt+ao-2,Lt+Pi[Ha],"1")}}for(var Bn=0;Bn<e.length;Bn++){var tt=e[Bn],Tr=so[tt.id],Gr=Tr.x+Bn*.1,Vr=Tr.y,an={w:Tr.w,h:Tr.h},Ge=rr("s"),Jr=tt.children&&tt.children.length>0,co=tt.kind==="state"&&!Jr&&tt.description&&tt.description.length>0;Jr?h+=u(Ge,tt.name,q(tt,nt(tt)),Gr,Vr,an.w,an.h,"1"):co?(h+=u(Ge,tt.name,q(tt,Vt(tt)),Gr,Vr,an.w,an.h,"1"),h+=kr(tt,Ge,an.w,an.h)):tt.kind==="state"?h+=u(Ge,tt.name,q(tt,Vt(tt)),Gr,Vr,an.w,an.h,"1"):h+=u(Ge,$t(tt),q(tt,Dn(tt)),Gr,Vr,an.w,an.h,"1"),nr[tt.id]={x:Gr,y:Vr,w:an.w,h:an.h,cellId:Ge},Jr?pr(Ge,tt,Tr.layout):We?.node(Ge),Jr&&Tr.layout&&Ir(Tr.layout,Ge,Gr,Vr,an.w,an.h)}function Ie(ko,fo,lt,Lt,ao,wa,ho,Ra){var Va=' <mxGeometry relative="1"'+(wa!=null?' x="'+wa+'"':"")+' as="geometry"',un;if(ho&&ho.length||Ra){if(un=Va+`>
+`,ho&&ho.length){un+=` <Array as="points">
+`;for(var En=0;En<ho.length;En++)un+=' <mxPoint x="'+Math.round(ho[En].x)+'" y="'+Math.round(ho[En].y)+`"/>
+`;un+=` </Array>
+`}Ra&&(un+=' <mxPoint x="'+Math.round(Ra.x)+'" y="'+Math.round(Ra.y)+`" as="offset"/>
+`),un+=` </mxGeometry>
+`}else un=Va+`/>
+`;return' <mxCell id="'+g(ko)+'" value="'+k(fo)+'" style="'+g(lt)+'" edge="1" source="'+g(Lt)+'" target="'+g(ao)+`" parent="1">
+`+un+` </mxCell>
+`}var Ee="",qo={},Ot=[],no=[],Fn={},Cn={};(function ko(fo){for(var lt=0;lt<fo.length;lt++)Cn[fo[lt].id]=fo[lt].kind,fo[lt].children&&ko(fo[lt].children)})(e);for(var yt=0;yt<c.length;yt++)qo[c[yt].from+Ee+c[yt].to]=!0,Fn[c[yt].from]=(Fn[c[yt].from]||0)+1;for(var wt=0;wt<c.length;wt++){var rt=c[wt],le=nr[rt.from],Fe=nr[rt.to];if(!(!le||!Fe)){var $e="endArrow=block;endFill=1;strokeColor="+(Y(rt.color)||"#181818")+";fontColor=#000000;fontSize=12;html=1;rounded=0;";rt.lineStyle==="dashed"?$e+="dashed=1;":rt.lineStyle==="dotted"&&($e+="dashed=1;dashPattern=1 3;"),rt.bold&&($e+="strokeWidth=2;");var Se=[];rt.color&&Se.push("strokeColor"),rt.bold&&Se.push("strokeWidth"),rt.lineStyle&&Se.push("dashed","dashPattern","fixDash"),$e=J(p($e,["arrow"],null,"edge",Se),j);var ro=rt.label||"",It=null,Jo=null,xo=le.x+le.w/2,Et=le.y+le.h/2,Vn=Fe.x+Fe.w/2,Un=Fe.y+Fe.h/2;Ot[wt]={x:(xo+Vn)/2,y:(Et+Un)/2};var bt=rt.from!==rt.to&&qo[rt.to+Ee+rt.from];if(rt.from===rt.to)$e+="exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;";else if(bt){var mt=rt.from<rt.to,In=mt?.18:.82,Zn=Mi(ro)*12/14;if(Math.abs(Un-Et)>=Math.abs(Vn-xo)){var Oe=Un>Et;$e+="exitX="+In+";exitY="+(Oe?1:0)+";exitDx=0;exitDy=0;entryX="+In+";entryY="+(Oe?0:1)+";entryDx=0;entryDy=0;",ro&&(Jo={x:(mt?-1:1)*(Zn/2+6),y:0})}else{var uo=Vn>xo;$e+="exitX="+(uo?1:0)+";exitY="+In+";exitDx=0;exitDy=0;entryX="+(uo?0:1)+";entryY="+In+";entryDx=0;entryDy=0;",ro&&(Jo={x:0,y:(mt?-1:1)*12})}}else Fn[rt.from]>1&&Cn[rt.from]==="choice"?It=.35:Fn[rt.from]>1&&ro&&Math.abs(Vn-xo)>10&&(Jo={x:(Vn>xo?1:-1)*(Mi(ro)*12/14/2+4),y:0});var io=null;if(rt.from!==rt.to&&$e.indexOf("edgeStyle=")<0){var we=le.y+le.h<=Fe.y,de=Fe.y+Fe.h<=le.y;if(we||de){for(var $o=we?le.y+le.h:le.y,ft=we?Fe.y:Fe.y+Fe.h,Vo=[],zo=0;zo<e.length;zo++){var ka=e[zo].id;if(!(ka===rt.from||ka===rt.to||xr[rt.from]===ka||xr[rt.to]===ka)){var sa=nr[ka];sa&&Bi(xo,$o,Vn,ft,sa.x-3,sa.y-3,sa.w+6,sa.h+6)&&Vo.push(sa)}}if(Vo.length>0){for(var _a=1/0,Ba=-1/0,No=1/0,vt=-1/0,Wt=0,Nt=0;Nt<Vo.length;Nt++)Vo[Nt].y<_a&&(_a=Vo[Nt].y),Vo[Nt].y+Vo[Nt].h>Ba&&(Ba=Vo[Nt].y+Vo[Nt].h),Vo[Nt].x<No&&(No=Vo[Nt].x),Vo[Nt].x+Vo[Nt].w>vt&&(vt=Vo[Nt].x+Vo[Nt].w),Wt+=Vo[Nt].x+Vo[Nt].w/2;var $a=Wt/Vo.length>(xo+Vn)/2+1,sn=$a?No-14:vt+14,ce=_a-10,yr=Ba+10;if(de){var Io=ce;ce=yr,yr=Io}io=[{x:sn,y:ce},{x:sn,y:yr}],$e=$e.replace(/(exit|entry)(X|Y|Dx|Dy)=[-0-9.]+;/g,"")+"curved=1;",It=null,Jo=null}}}var ge=rr("t");if(no[wt]=ge,We!=null)if(rt.from===rt.to)We.edge(ge,{loop:!0});else if(rt.dashCount===1||rt.direction==="left"||rt.direction==="right")We.edge(ge,{sameRank:!0});else{var Ct=rt.direction==="up";We.edge(ge,{top:Ct?Fe.cellId:le.cellId,bot:Ct?le.cellId:Fe.cellId,labelW:ro?Mi(ro)*12/14:0,labelH:16})}h+=Ie(ge,ro,$e,le.cellId,Fe.cellId,It,io,Jo)}}for(var Nn=p("shape=note;size=10;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;fontSize=13;fontColor=#000000;whiteSpace=wrap;align=left;verticalAlign=middle;spacingLeft=4;",["note"]),Qn=p("fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;",["note"]),kn=0;kn<i.length;kn++){var Ke=i[kn],yn=Xr(Ke.text),tn=yn.w,Ia=yn.h,Ma=f,Sl=f,Ll="",ja=null;if(Ke.position==="link"){var Ja=Ot[Ke.linkIndex];Ja&&(Sl=Math.round(Ja.y),Ke.side==="left"?Ma=Math.round(Ja.x-5-tn):Ke.side==="top"||Ke.side==="bottom"?(Ma=Math.round(Ja.x-tn/2),Sl=Math.round(Ke.side==="top"?Ja.y-10-Ia:Ja.y+10)):Ma=Math.round(Ja.x+5))}else{var Ol=nr[Ke.target];Ol&&(Sl=Ol.y+(Ol.h-Ia)/2,Ke.position==="right"?(Ma=Ol.x+Ol.w+vo,ja=rr("noteptr"),Ll=u(ja,"","triangle;direction=west;"+Qn,Ol.x+Ol.w,Math.round(Sl+Ia/2-4),vo+1,8,"1")):(Ma=Ol.x-tn-vo,ja=rr("noteptr"),Ll=u(ja,"","triangle;direction=east;"+Qn,Ma+tn-1,Math.round(Sl+Ia/2-4),vo+1,8,"1")))}var Yl=rr("note");h+=Ll+u(Yl,Ke.text||"",Nn,Ma,Sl,tn,Ia,"1"),We!=null&&(Ke.position==="link"?no[Ke.linkIndex]!=null&&We.linkNote(Yl,no[Ke.linkIndex],Ke.side||"right"):(We.node(Yl),nr[Ke.target]!=null&&We.attach(Yl,nr[Ke.target].cellId,Ke.position==="left"?"left":"right"),ja!=null&&We.follow(ja,Yl)))}return h}var ba=180,sl=40,ua=19,ea=8,fn=32,ui=26,oi=21,Zl=16,Ca=24,Cl=35,Aa=60,en=78,xt=10,pl=4,Pl=160,Oi=40,el=20,Rl=24,$l=45,fa=14,xa=15,fi=14,Nl=34,jl=17;function ha(r){return Ss(r,fa,!1)}function Bi(r,l,e,c,i,h,F,j){for(var p=0,or=1,q=e-r,rr=c-l,nr=[-q,q,-rr,rr],Xr=[r-i,i+F-r,l-h,h+j-l],wr=0;wr<4;wr++)if(nr[wr]===0){if(Xr[wr]<0)return!1}else{var pr=Xr[wr]/nr[wr];if(nr[wr]<0){if(pr>or)return!1;pr>p&&(p=pr)}else{if(pr<p)return!1;pr<or&&(or=pr)}}return p<=or}function Ii(r,l){for(var e=r.classes,c=r.relationships,i=r.packages,h=r.notes,F="",j=0,p=r.hideRules||[],or=r.hideEntities||[],q=0;q<h.length;q++)h[q].position==="link"&&h[q].linkIndex!=null&&(h[q]._rel=c[h[q].linkIndex]||null);var rr=r.styleSheet||null,nr=[],Xr={pkg:"vertex",pkgl:"text"};function wr(cr,je,Yo,Zo,Ye){return X(cr,rr,["root","element","classDiagram"].concat(je),Yo||[],Zo||"vertex",Ye)}function pr(cr,je){var Yo=Xr[String(cr).split("_")[0]];return Yo==null||rr==null?je:wr(je,["package"],nr,Yo)}var Dr=function(cr,je,Yo,Zo,Ye,Dt,Ht,Ea){return m(cr,je,pr(cr,Yo),Zo,Ye,Dt,Ht,Ea)},Ze=function(cr,je,Yo,Zo,Ye,Dt,Ht,Ea){return I(cr,je,pr(cr,Yo),Zo,Ye,Dt,Ht,Ea)};function he(cr){if(!cr.stereotype)return[];var je=cr.stereotype.replace(/\(\s*[A-Za-z@]\s*,\s*(?:#[0-9A-Fa-f]{3,8}|[A-Za-z]+)\s*\)/,"");return je.split(/>>\s*<<|\s+/).map(function(Yo){return Yo.replace(/^\s+|\s+$/g,"")}).filter(function(Yo){return Yo.length>0})}function Pr(cr,je){return cr.type==="all"?!0:cr.type==="kind"?(je.kind||"class")===cr.value:cr.type==="name"?je.id===cr.value||je.name===cr.value||(je.id||"").split(/::|\./).pop()===cr.value:cr.type==="stereotype"?wo(cr.value,he(je)):!1}function ve(cr,je){for(var Yo=cr.members||[],Zo=0;Zo<Yo.length;Zo++){var Ye=Yo[Zo].kind;if(Ye!=="separator"&&je==="method"==(Ye==="method"))return!1}return!0}function xr(cr,je){if(je==="circle"&&cr.kind==="object")return!1;for(var Yo=je==="circle"?!r.hideCircle&&!r.strictUml:!0,Zo=0;Zo<p.length;Zo++){var Ye=p[Zo];Ye.portion===je&&Pr(Ye.gender,cr)&&(Ye.empty&&!ve(cr,je)||(Yo=Ye.show))}return Yo}function qr(cr){return String(cr??"").split(/::|\./).pop()}function ze(cr,je){return cr.indexOf("*")>=0?new RegExp("^"+cr.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")+"$").test(je):je===cr}function wo(cr,je){for(var Yo=0;Yo<je.length;Yo++)if(ze(cr,je[Yo]))return!0;return!1}function me(cr,je){return ze(cr,qr(je))}function ue(cr){for(var je=!1,Yo=0;Yo<or.length;Yo++){var Zo=or[Yo].what,Ye;if(Zo==="@unlinked"){Ye=!cr.isGroup;for(var Dt=0;Dt<c.length&&Ye;Dt++)(c[Dt].from===cr.id||c[Dt].to===cr.id)&&(Ye=!1)}else Zo.charAt(0)==="<"?Ye=wo(Zo.replace(/^<<|>>$/g,"").replace(/^\s+|\s+$/g,""),he(cr)):Zo.charAt(0)==="$"?Ye=wo(Zo.substring(1),cr.tags||[]):Ye=me(Zo,cr.id)||cr.name!=null&&cr.name!==cr.id&&me(Zo,cr.name);Ye&&(je=!or[Yo].show)}return je}if(or.length>0){var po={},x={},S;for(S=0;S<i.length;S++){var fr=i[S].parentIndex;if(fr!=null&&x[fr]||ue({id:i[S].name,name:i[S].name,isGroup:!0,tags:[]})){x[S]=!0;for(var zr=0;zr<(i[S].classes||[]).length;zr++)po[i[S].classes[zr]]=!0}}for(var Lr=[],te=0;te<e.length;te++)po[e[te].id]||ue(e[te])?po[e[te].id]=!0:Lr.push(e[te]);e=Lr,c=c.filter(function(cr){return!po[cr.from]&&!po[cr.to]}),h=h.filter(function(cr){return cr.targets&&cr.targets.length?(cr.targets=cr.targets.filter(function(je){return!po[je]}),cr.targets.length===0?!1:(po[cr.target]&&(cr.target=cr.targets[0]),!0)):cr.target?!po[cr.target]:cr.id?!ue({id:cr.id,name:cr.id,tags:cr.tags||[]}):!0});var W={},Zr=[];for(S=0;S<i.length;S++)x[S]||(W[S]=Zr.length,Zr.push(i[S]));i=Zr.map(function(cr){var je={};for(var Yo in cr)cr.hasOwnProperty(Yo)&&(je[Yo]=cr[Yo]);return je.parentIndex=cr.parentIndex!=null&&W[cr.parentIndex]!=null?W[cr.parentIndex]:null,je});for(var Re=[],Ae=0;Ae<h.length;Ae++){var Pe=h[Ae];if(Pe.pkgIndex!=null){if(x[Pe.pkgIndex])continue;var De={};for(var Qr in Pe)Pe.hasOwnProperty(Qr)&&(De[Qr]=Pe[Qr]);De.pkgIndex=W[Pe.pkgIndex]!=null?W[Pe.pkgIndex]:null,Pe=De}Re.push(Pe)}h=Re}function Po(cr){for(var je=cr.text?cr.text.split(`
+`):[""],Yo=0,Zo=0;Zo<je.length;Zo++){var Ye=ha(je[Zo])*13/fa;Ye>Yo&&(Yo=Ye)}return{w:Math.round(Yo+20),h:Math.round(je.length*17.7+12)}}var Qe={},yo=null;function ie(cr){var je=cr+"_"+j++;return yo?.push(je),je}function pe(cr){return We?.part(cr),cr}var Mo=r.title?String(r.title).replace(/\\n/g,`
`).split(`
-`):[],ae=r.title?ai+(Te.length-1)*Nl:0,it=r.legend&&r.legend.vertical==="top"&&r.legend.lines&&r.legend.lines.length?We(r.legend.lines):null,Gt=ae+(it?it.h+20:0),oo={},pt={};function rt(cr){for(var Ue=[],Bo=[],Lo=cr.members||[],Pe=0;Pe<Lo.length;Pe++)Lo[Pe].kind!=="separator"&&(Lo[Pe].kind==="method"?Bo.push(Lo[Pe]):Ue.push(Lo[Pe]));return{fields:Ue,methods:Bo}}function jo(cr){for(var Ue=cr.members||[],Bo=[{style:null,title:"",rows:[]}],Lo=cr.kind==="object",Pe=0;Pe<Ue.length;Pe++)Ue[Pe].kind==="separator"?(Lo=!0,Bo.push({style:Ue[Pe].style,title:Ue[Pe].title||"",rows:[]})):Bo[Bo.length-1].rows.push(Ue[Pe]);return Lo?Bo:null}function Qt(cr,Ue){return Ue===0&&cr.rows.length===0?0:cr.rows.length*Ea+Ua+(cr.title?Wa:0)}function Me(cr){return cr>0?cr*Ea+Ua:Ua}function Io(cr){return!cr.stereotype||!Fr(cr,"stereotype")?"":cr.stereotype.replace(/\(\s*[A-Za-z@]\s*,\s*(?:#[0-9A-Fa-f]{3,8}|[A-Za-z]+)\s*\)/,"").replace(/^\s+|\s+$/g,"")}function Wo(cr){var Ue=cr.kind==="object"?Jl:Fr(cr,"circle")?oa:vn,Bo=(cr.name||"").split(`
-`).length-1;return Ue+(Io(cr)?15:0)+Bo*16}function Ro(cr){if(cr.kind==="circle")return 20;if(cr.kind==="diamond")return _l;var Ue=Fr(cr,"field"),Bo=Fr(cr,"method"),Lo=Ue||Bo?jo(cr):null;if(Lo){for(var Pe=Wo(cr),mt=0;mt<Lo.length;mt++)Pe+=Qt(Lo[mt],mt);return cr.kind==="object"&&Lo.length===1&&Lo[0].rows.length===0&&(Pe+=Ul),Pe}var Bt=rt(cr);return Wo(cr)+(Ue?Me(Bt.fields.length):0)+(Bo?Me(Bt.methods.length):0)}function An(cr){return Oi(cr,!0)}function dn(cr){if(cr.kind==="circle")return Math.max(24,Math.round(xa(cr.name)*.6));if(cr.kind==="diamond")return _l;var Ue=rt(cr),Bo=(Fr(cr,"field")?Ue.fields:[]).concat(Fr(cr,"method")?Ue.methods:[]),Lo=Ta,Pe,mt=cr.members||[];for(Pe=0;Pe<mt.length;Pe++)if(mt[Pe].kind==="separator"&&mt[Pe].title){var Bt=xa(mt[Pe].title)+26;Bt>Lo&&(Lo=Bt)}for(Pe=0;Pe<Bo.length;Pe++){var La=Bo[Pe].visibility?20:6,Qa=La+xa(An(Bo[Pe]))+6;Qa>Lo&&(Lo=Qa)}for(var Hl=(cr.name||"").split(`
-`),Kl=0,ni=0;ni<Hl.length;ni++)xa(Hl[ni])>Kl&&(Kl=xa(Hl[ni]));var xi=Fr(cr,"circle")?Kl+32:Kl+12;if(xi>Lo&&(Lo=xi),cr.stereotype){var Hi=cr.stereotype.replace(/\(\s*[A-Za-z@]\s*,\s*(?:#[0-9A-Fa-f]{3,8}|[A-Za-z]+)\s*\)/,"").replace(/^\s+|\s+$/g,"");if(Hi){var Fs=xa("\xAB"+Hi+"\xBB")+16;Fs>Lo&&(Lo=Fs)}}return Math.round(Lo*100)/100}function rn(cr){return cr.fromArrow==="triangle"?cr.from:cr.toArrow==="triangle"?cr.to:cr.fromArrow==="diamond_filled"||cr.fromArrow==="diamond_open"?cr.from:cr.toArrow==="diamond_filled"||cr.toArrow==="diamond_open"||cr.type==="extends"||cr.type==="implements"||cr.fromArrow==="open"&&!cr.toArrow?cr.to:cr.from}function Ao(cr,Ue){return Ue===cr.from?cr.to:cr.from}function _t(cr){if(cr._sameRank)return null;if(cr._topId!=null&&cr._botId!=null)return{top:cr._topId,bot:cr._botId};var Ue=rn(cr);return Ue==null?null:{top:Ue,bot:Ao(cr,Ue)}}for(var ft={},Se=0;Se<e.length;Se++)ft[e[Se].id]=!0;for(var Go={},wt={},Se=0;Se<e.length;Se++)Go[e[Se].id]=[],wt[e[Se].id]=0;for(var cn=0;cn<h.length;cn++){var No=_t(h[cn]);if(No!=null){var oe=No.top,Uo=No.bot;!ft[oe]||!ft[Uo]||oe===Uo||(Go[oe].push(Uo),wt[Uo]++)}}var Ot={},ho={},dt={};function Aa(cr){if(ho[cr]!==void 0)return ho[cr];if(dt[cr])return 0;dt[cr]=!0;for(var Ue=0,Bo=Go[cr]||[],Lo=0;Lo<Bo.length;Lo++){var Pe=1+Aa(Bo[Lo]);Pe>Ue&&(Ue=Pe)}return dt[cr]=!1,ho[cr]=Ue,Ue}var Sn={};for(var an in Go)if(Go.hasOwnProperty(an)){Sn[an]||(Sn[an]=[]);for(var we=0;we<Go[an].length;we++){var Eo=Go[an][we];Sn[Eo]||(Sn[Eo]=[]),Sn[an].push(Eo),Sn[Eo].push(an)}}for(var Et={},Cr=[],Se=0;Se<e.length;Se++){var Lr=e[Se].id;if(Et[Lr]===void 0){var He=Cr.length,Ie=[Lr],Oe=0;for(Et[Lr]=He;Ie.length>0;){var so=Ie.pop(),Xo=Aa(so);Xo>Oe&&(Oe=Xo);for(var qo=Sn[so]||[],Yn=0;Yn<qo.length;Yn++)Et[qo[Yn]]===void 0&&(Et[qo[Yn]]=He,Ie.push(qo[Yn]))}Cr.push(Oe)}}for(var Se=0;Se<e.length;Se++){var Nt=e[Se].id;Ot[Nt]=Cr[Et[Nt]]-Aa(Nt)}for(var Da=!0,je=0;Da&&je++<10;){Da=!1;for(var _r=0;_r<h.length;_r++){var Ho=h[_r];if(Ho._sameRank&&!(Ot[Ho.from]===void 0||Ot[Ho.to]===void 0)){var Ce=Math.max(Ot[Ho.from],Ot[Ho.to]);(Ot[Ho.from]!==Ce||Ot[Ho.to]!==Ce)&&(Ot[Ho.from]=Ce,Ot[Ho.to]=Ce,Da=!0)}}}for(var Se=0;Se<e.length;Se++)e[Se]._w=dn(e[Se]);if(h.length===0&&e.length>5)for(var ln=560,nt=0,wo=0,xn=0;xn<e.length;xn++){var Lt=e[xn]._w+40;wo>0&&wo+Lt>ln&&(nt++,wo=0),Ot[e[xn].id]=nt,wo+=Lt}for(var Ft={},fe=[],Se=0;Se<e.length;Se++){var ge=Ot[e[Se].id];Ft[ge]||(Ft[ge]=[],fe.push(ge)),Ft[ge].push(e[Se])}fe.sort(function(cr,Ue){return cr-Ue});for(var qt=0;qt<h.length;qt++){var et=h[qt];if(et._side&&!(Ot[et.from]===void 0||Ot[et.from]!==Ot[et.to])){for(var en=Ft[Ot[et.from]],Zt=-1,qn=-1,Ko=0;Ko<en.length;Ko++)en[Ko].id===et.from&&(Zt=Ko),en[Ko].id===et.to&&(qn=Ko);if(!(Zt<0||qn<0)){if(et._side==="left"&&qn>Zt)en.splice(Zt,0,en.splice(qn,1)[0]);else if(et._side==="right"&&qn<Zt){var Hn=en.splice(qn,1)[0];en.splice(Zt,0,Hn)}}}}for(var aa={},Je=0;Je<h.length;Je++){var sn=h[Je],Bn=_t(sn);if(Bn!=null){var $t=Bn.top,mo=Bn.bot;!ft[$t]||!ft[mo]||Ot[mo]===Ot[$t]+1&&(sn.label||sn.fromCardinality||sn.toCardinality)&&(aa[Ot[$t]]=!0)}}var Pt={},ra={};function Ut(cr,Ue,Bo,Lo){var Pe={},mt;for(mt=0;mt<cr.length;mt++)Pe[cr[mt].id]=cr[mt];var Bt={},La={};for(mt=0;mt<cr.length;mt++)Bt[cr[mt].id]=[],La[cr[mt].id]=0;for(var Qa=0;Qa<Ue.length;Qa++){var Hl=Ue[Qa];Pe[Hl.top]&&Pe[Hl.bot]&&Hl.top!==Hl.bot&&(Bt[Hl.top].push(Hl.bot),La[Hl.bot]++)}var Kl={},ni=[];for(mt=0;mt<cr.length;mt++)La[cr[mt].id]===0&&(Kl[cr[mt].id]=0,ni.push(cr[mt].id));for(var xi=cr.length*cr.length+16;ni.length>0&&xi-- >0;)for(var Hi=ni.shift(),Fs=Bt[Hi],fs=0;fs<Fs.length;fs++){var If=Kl[Hi]+1;(Kl[Fs[fs]]===void 0||Kl[Fs[fs]]<If)&&(Kl[Fs[fs]]=If,ni.push(Fs[fs]))}var du={},ru=[];for(mt=0;mt<cr.length;mt++){var bu=Kl[cr[mt].id]===void 0?0:Kl[cr[mt].id];du[bu]||(du[bu]=[],ru.push(bu)),du[bu].push(cr[mt])}ru.sort(function(hv,Cv){return hv-Cv});var sd=[],rf=0,eu,Ji;for(eu=0;eu<ru.length;eu++){var Ph=du[ru[eu]],Nf=0;for(Ji=0;Ji<Ph.length;Ji++)Ji>0&&(Nf+=Bo),Nf+=Ph[Ji].w;sd.push(Nf),Nf>rf&&(rf=Nf)}var Yh={},bc=0;for(eu=0;eu<ru.length;eu++){var yu=du[ru[eu]],ud=0;for(Ji=0;Ji<yu.length;Ji++)yu[Ji].h>ud&&(ud=yu[Ji].h);var Mh=(rf-sd[eu])/2;for(Ji=0;Ji<yu.length;Ji++)Yh[yu[Ji].id]={x:Mh,y:bc+(ud-yu[Ji].h)/2},Mh+=yu[Ji].w+Bo;bc+=ud+Lo}return{pos:Yh,width:rf,height:Math.max(0,bc-Lo)}}if(l.length>0){let cr=function(Pe,mt){var Bt=Wn[Pe];if(Bt===void 0)return mt===-1?Pe:null;if(Bt===mt)return Pe;for(var La=l.length+1;Bt!==void 0&&La-- >0;){var Qa=va[Bt];if(Qa===void 0&&mt===-1||Qa===mt)return"pkg#"+Bt;Bt=Qa}return null},Ue=function(Pe){var mt=(Pe.stereotype||"").toLowerCase();return mt==="node"?{side:46,top:40,bottom:16}:mt==="cloud"?{side:18,top:36,bottom:22}:mt==="database"?{side:31,top:50,bottom:16}:{side:ui,top:35,bottom:16}},Bo=function(Pe){var mt=[],Bt;for(Bt=0;Bt<e.length;Bt++)Wn[e[Bt].id]===Pe&&mt.push({id:e[Bt].id,w:e[Bt]._w,h:Ro(e[Bt])});for(Bt=0;Bt<ga[Pe].length;Bt++){var La=ga[Pe][Bt];Bo(La),mt.push({id:"pkg#"+La,w:Mn[La],h:la[La]})}for(Bt=0;Bt<C.length;Bt++)if(C[Bt].pkgIndex===Pe&&!C[Bt].target){var Qa=C[Bt].legend?We(C[Bt].lines||[]):yo(C[Bt]);mt.push({id:"note#"+Bt,w:Qa.w,h:Qa.h})}var Hl=[];for(Bt=0;Bt<h.length;Bt++){var Kl=_t(h[Bt]);if(Kl){var ni=cr(Kl.top,Pe),xi=cr(Kl.bot,Pe);ni&&xi&&ni!==xi&&Hl.push({top:ni,bot:xi})}}var Hi=Ut(mt,Hl,Ma,gl);for(Bt=0;Bt<mt.length;Bt++)Fn[mt[Bt].id]=Hi.pos[mt[Bt].id];var Fs=Math.max(Hi.width,xa(l[Pe].name)+24),fs=Ue(l[Pe]);Mn[Pe]=Fs+fs.side*2,la[Pe]=fs.top+Hi.height+fs.bottom},Lo=function(Pe,mt,Bt){var La=Ue(l[Pe]);Pt[Pe]={x:mt,y:Bt,w:Mn[Pe],h:la[Pe]},ra[Pe]=he("pkg"),!ft[l[Pe].name]&&!oo[l[Pe].name]&&(oo[l[Pe].name]=ra[Pe],pt[l[Pe].name]=Pt[Pe]);for(var Qa=0;Qa<e.length;Qa++)Wn[e[Qa].id]===Pe&&Fn[e[Qa].id]&&(e[Qa]._x=mt+La.side+Fn[e[Qa].id].x,e[Qa]._y=Bt+La.top+Fn[e[Qa].id].y,e[Qa]._h=Ro(e[Qa]));for(var Hl=0;Hl<ga[Pe].length;Hl++){var Kl=ga[Pe][Hl],ni=Fn["pkg#"+Kl];ni&&Lo(Kl,mt+La.side+ni.x,Bt+La.top+ni.y)}for(var xi=0;xi<C.length;xi++){var Hi=Fn["note#"+xi];C[xi].pkgIndex===Pe&&Hi&&(fo[xi]={x:mt+La.side+Hi.x,y:Bt+La.top+Hi.y})}};var Wn={},yt,Zn;for(yt=0;yt<l.length;yt++){var on=l[yt].classes||[];for(Zn=0;Zn<on.length;Zn++)ft[on[Zn]]&&(Wn[on[Zn]]=yt)}var va={},ga={};for(yt=0;yt<l.length;yt++)ga[yt]=[];for(yt=0;yt<l.length;yt++){var jn=l[yt].parentIndex;jn!=null&&jn>=0&&jn<l.length&&jn!==yt&&(va[yt]=jn,ga[jn].push(yt))}var Fn={},Mn={},la={};for(yt=0;yt<l.length;yt++)va[yt]===void 0&&Bo(yt);var Tn=[],gt;for(yt=0;yt<l.length;yt++)va[yt]===void 0&&Tn.push({id:"pkg#"+yt,w:Mn[yt],h:la[yt]});for(gt=0;gt<e.length;gt++)Wn[e[gt].id]===void 0&&Tn.push({id:e[gt].id,w:e[gt]._w,h:Ro(e[gt])});var Rt=[];for(gt=0;gt<h.length;gt++){var Jt=_t(h[gt]);if(!(!Jt||!ft[Jt.top]||!ft[Jt.bot])){var ct=cr(Jt.top,-1),wn=cr(Jt.bot,-1);ct&&wn&&ct!==wn&&Rt.push({top:ct,bot:wn})}}var In=Ut(Tn,Rt,Ma,Rl),ko=tt,Do=tt+Gt;for(yt=0;yt<l.length;yt++){var Rr=In.pos["pkg#"+yt];Rr&&Lo(yt,ko+Rr.x,Do+Rr.y)}for(gt=0;gt<e.length;gt++)if(Wn[e[gt].id]===void 0){var xr=In.pos[e[gt].id];if(!xr)continue;e[gt]._x=ko+xr.x,e[gt]._y=Do+xr.y,e[gt]._h=Ro(e[gt])}}else{for(var br=[],Br=0,Pr=0;Pr<fe.length;Pr++){for(var Xe=Ft[fe[Pr]],zr=0,Ke=0;Ke<Xe.length;Ke++)Ke>0&&(zr+=Ma),zr+=Xe[Ke]._w;br.push(zr),zr>Br&&(Br=zr)}for(var De=tt+Gt,Pr=0;Pr<fe.length;Pr++){for(var ze=Ft[fe[Pr]],So=0,Ke=0;Ke<ze.length;Ke++){var ot=Ro(ze[Ke]);ot>So&&(So=ot)}for(var ve=tt+(Br-br[Pr])/2,Ke=0;Ke<ze.length;Ke++){var Yt=ze[Ke],At=Ro(Yt);Yt._x=ve,Yt._y=De+(So-At)/2,Yt._h=At,ve+=Yt._w+Ma}var ht=aa[fe[Pr]]?Ia:gl;De+=So+ht}}for(var Vt=r.associationClasses||[],Pn=0;Pn<Vt.length;Pn++){for(var Ae=Vt[Pn],Fe=null,le=null,Ne=null,Qe=0;Qe<e.length;Qe++)e[Qe].id===Ae.a&&(Fe=e[Qe]),e[Qe].id===Ae.b&&(le=e[Qe]),e[Qe].id===Ae.cls&&(Ne=e[Qe]);if(!(!Fe||!le||!Ne)){for(var tn=0,Vo=0;Vo<h.length;Vo++)(h[Vo].from===Ae.cls||h[Vo].to===Ae.cls)&&tn++;if(!(tn>0)){if(le._y!==Fe._y){for(var xo=!0,Co=0;Co<e.length;Co++)if(e[Co]!==le&&e[Co]!==Ne&&e[Co]._y===le._y){xo=!1;break}xo&&(le._x=Fe._x+Fe._w/2-le._w/2)}var mn=(Fe._x+Fe._w/2+le._x+le._w/2)/2,pn=(Fe._y+Fe._h/2+le._y+le._h/2)/2;Ne._x=mn+70,Ne._y=pn-Ne._h/2,Ae._midX=mn,Ae._midY=pn}}}for(var hn=0;hn<e.length;hn++){var Dt=e[hn];if(Dt.kind==="circle"){for(var ca=null,ea=0,me=0;me<h.length;me++)h[me].type!=="lollipop"&&(h[me].from===Dt.id||h[me].to===Dt.id)&&(ea++,ca=h[me]);if(ea===1){for(var ie=ca.from===Dt.id?ca.to:ca.from,pe=null,ke=0;ke<e.length;ke++)if(e[ke].id===ie){pe=e[ke];break}!pe||pe._y===Dt._y||(Dt._x=pe._x+pe._w/2-Dt._w/2)}}}if(e.length>0){for(var Re=1/0,$o=1/0,Jo=-1/0,Wt=-1/0,at=0;at<e.length;at++){var Nn=e[at];Nn._x<Re&&(Re=Nn._x),Nn._y<$o&&($o=Nn._y),Nn._x+Nn._w>Jo&&(Jo=Nn._x+Nn._w),Nn._y+Nn._h>Wt&&(Wt=Nn._y+Nn._h)}var ia=e.length===1?9:3;if(b+=Ar(he("mtl"),"","text;fillColor=none;strokeColor=none;",Re-3,$o-3,0,0,"1"),b+=Ar(he("mbr"),"","text;fillColor=none;strokeColor=none;",Jo+ia,Wt+ia,0,0,"1"),r.title){for(var sa=0,ka=0;ka<Te.length;ka++)sa=Math.max(sa,xa(Te[ka]));var Po=Math.max(120,sa+20),Ct=(Re+Jo)/2-Po/2;b+=Ar(he("cltitle"),Te.join(`
-`),"text;html=1;fillColor=none;strokeColor=none;fontSize="+pl+";fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",Ct,tt-3,Po,24+(Te.length-1)*Nl,"1")}}var bt=Wn||{},Vr=va||{};function to(cr){var Ue=[],Bo=bt[cr];if(Bo===void 0&&!ft[cr]){for(var Lo=0;Lo<l.length;Lo++)if(l[Lo].name===cr&&Pt[Lo]){Bo=Vr[Lo];break}}for(var Pe=l.length+1;Bo!==void 0&&Pe-- >0;)Ue.push(Bo),Bo=Vr[Bo];return Ue}function Xt(cr){var Ue=cr!=null&&cr>=0?Pt[cr]:null;return!Ue||!ra[cr]?{id:"1",x:0,y:0,pkg:-1}:{id:ra[cr],x:Ue.x,y:Ue.y,pkg:cr}}function ha(cr){return Xt(bt[cr])}function Wr(cr,Ue){for(var Bo=to(cr),Lo=to(Ue),Pe=0;Pe<Bo.length;Pe++)if(Lo.indexOf(Bo[Pe])>=0&&Pt[Bo[Pe]])return Xt(Bo[Pe]);return Xt(-1)}function ro(cr,Ue,Bo,Lo){for(var Pe=-1,mt=1/0,Bt=0;Bt<l.length;Bt++){var La=Pt[Bt];!La||!ra[Bt]||cr<La.x||Ue<La.y||cr+Bo>La.x+La.w||Ue+Lo>La.y+La.h||La.w*La.h<mt&&(Pe=Bt,mt=La.w*La.h)}return Xt(Pe)}for(var te=0;te<e.length;te++){let Ue=function(Lo,Pe,mt){for(var Bt=Pe+Al+mt*Ea,La=Bt-Ea/2,Qa=Lo.visibility,Hl=Qa&&Ml[Qa],Kl=Lo.kind==="method",ni=0,xi=Lo.modifiers||[],Hi=0;Hi<xi.length;Hi++)xi[Hi]==="static"&&(ni|=4);var Fs=Hl?20:6,fs="text;html=1;align=left;verticalAlign=middle;spacingLeft="+Fs+";spacingRight=4;overflow=hidden;rotatable=0;fillColor=none;strokeColor=none;fontSize="+pl+";fontColor=#000000;fontStyle="+ni+";points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;",If=he("mb");if(fs=yr(fs,["class"],$l,"text"),b+=Ar(If,An(Lo),fs,0,La,ue._w,Ea,zo),Hl){var du=Ei[Qa]||[6,6],ru=du[0],bu=du[1],sd=Kl||Qa==="*"?dl[Qa]:"none",rf=(Bl[Qa]||"ellipse")+";fillColor="+sd+";strokeColor="+Ml[Qa]+";strokeWidth=1;movable=0;connectable=0;";b+=Ar(he("vis"),"",rf,11-ru/2,Ea/2-bu/2,ru,bu,If)}},Bo=function(Lo,Pe,mt){var Bt="line;strokeColor=#181818;fillColor=none;align=left;verticalAlign=middle;rotatable=0;points=[];portConstraint=eastwest;connectable=0;",La=Lo.style;Bt+="strokeWidth="+(La==="_"?"0.5":"1")+";"+(La==="."?"dashed=1;dashPattern=1 2;":""),Lo.title&&(Pe+=2);var Qa=Lo.title?xa(Lo.title)+8:0,Hl=Lo.title?Math.max(2,(ue._w-Qa)/2):ue._w;Bt=yr(Bt,["class"],$l,"edge",["dashed","dashPattern","fixDash"]);function Kl(ni){b+=Ar(he("clssep"),"",Bt,0,ni,Hl,mt,zo),Lo.title&&(b+=Ar(he("clssep"),"",Bt,ue._w-Hl,ni,Hl,mt,zo))}La==="="?(Kl(Pe-1),Kl(Pe+1)):Kl(Pe),Lo.title&&(b+=Ar(he("septitle"),Lo.title,"text;html=1;align=center;verticalAlign=middle;fillColor=none;strokeColor=none;fontSize="+pl+";fontColor=#000000;movable=0;connectable=0;",(ue._w-Qa)/2,Pe+mt/2-Ea/2,Qa,Ea,zo))};var ue=e[te],Xo=ue._h,zo=he("cls");oo[ue.id]=zo;var nn=ha(ue.id),Fa=ue._x,Kn=ue._y;if(pt[ue.id]={x:Fa,y:Kn,w:ue._w,h:Xo},ue.kind==="circle"){var bn=16,Ve=Fa+(ue._w-bn)/2,Yo=Kn+(Xo-bn)/2;b+=Ar(zo,ue.name,"ellipse;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=1;verticalLabelPosition=bottom;verticalAlign=top;fontSize="+pl+";fontColor=#000000;",Ve-nn.x,Yo-nn.y,bn,bn,nn.id),pt[ue.id]={x:Ve,y:Yo,w:bn,h:bn};continue}if(ue.kind==="diamond"){b+=Ar(zo,"","rhombus;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;",Fa-nn.x,Kn-nn.y,_l,_l,nn.id),pt[ue.id]={x:Fa,y:Kn,w:_l,h:_l};continue}var st="",Ca=Io(ue);Ca&&(st+="\xAB"+Ca+`\xBB
-`);var Mt=Wo(ue);st+=ue.name;var Ra="0",Xn=Fr(ue,"circle"),_a=Xn?25:0,Ka="#F1F1F1",yn="#181818",ua="#000000",Ya="";if(ue.color){var fa=ue.color.match(/##(?:\[(\w+)\])?(\S+)/);if(fa){var xt=Y(fa[2]);xt&&(yn=xt),fa[1]&&/bold/i.test(fa[1])&&(Ya="strokeWidth=2;")}var Ja=ue.color.replace(/^#/,"").split(";"),uo=Ja[0].replace(/\s*##.*$/,"");if(uo){var Jn=Y("#"+uo);Jn&&(Ka=Jn)}for(var Sa=1;Sa<Ja.length;Sa++){var da=Ja[Sa].match(/^(line|text)\s*:\s*(\S+)/i);if(da&&da[1].toLowerCase()==="line"){var ma=Y(da[2]);ma&&(yn=ma)}else if(da){var Ha=Y(da[2]);Ha&&(ua=Ha)}}}var Sl="swimlane;collapsible=0;fontStyle="+Ra+";align=center;fontSize="+pl+";fontColor="+ua+";startSize="+Mt+";spacingLeft="+_a+";fillColor="+Ka+";strokeColor="+yn+";"+Ya+"childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;marginBottom=0;stackSpacing=0;marginTop="+(Al-Ea/2)+";",$l=ue.stereotype?[ue.stereotype]:[],ml=H(V,["root","element","classDiagram","class"],$l,"vertex"),Pl=H(V,["root","element","classDiagram","class","header"],$l,"vertex");ue.color?(delete ml.fillColor,delete ml.gradientColor,delete Pl.fillColor,delete Pl.gradientColor):ml.fillColor!=null&&(ml.swimlaneFillColor=ml.fillColor);for(var Yl in Pl)Pl.hasOwnProperty(Yl)&&!/^(strokeColor|strokeWidth|dashed|dashPattern|fixDash|rounded|arcSize|absoluteArcSize|shadow)$/.test(Yl)&&(ml[Yl]=Pl[Yl]);if(Sl=M(Sl,ml),b+=Ar(zo,st,Sl,Fa-nn.x,Kn-nn.y,ue._w,Xo,nn.id),ue.generics){var ri=ue.generics,wi=Math.max(20,ue.generics.length*7+8),mi=18;b+=Ar(he("gen"),ri,"rounded=0;fillColor=#FFFFFF;strokeColor=#181818;dashed=1;dashPattern=2 2;fontSize=10;align=center;verticalAlign=middle;movable=0;connectable=0;",ue._w-wi-6,-3,wi,mi,zo)}var Cl=r.monochrome?"#C2C2C2":"#ADD1B2",ll="C";if(ue.kind==="interface"?(r.monochrome||(Cl="#B4A7E5"),ll="I"):ue.kind==="enum"?(r.monochrome||(Cl="#EB937F"),ll="E"):ue.kind==="abstract"?(r.monochrome||(Cl="#A9DCDF"),ll="A"):ue.kind==="annotation"?(r.monochrome||(Cl="#E3C6AA"),ll="@"):ue.kind==="struct"?(r.monochrome||(Cl="#FFFFFF"),ll="S"):ue.kind==="protocol"?(r.monochrome||(Cl="#FFFFFF"),ll="P"):ue.kind==="exception"?(r.monochrome||(Cl="#E5574F"),ll="X"):ue.kind==="metaclass"?(r.monochrome||(Cl="#B3B3B3"),ll="M"):ue.kind==="stereotype"?(r.monochrome||(Cl="#EE7EEE"),ll="S"):ue.kind==="entity"&&(r.monochrome||(Cl="#ADD1B2"),ll="E"),ue.stereotype){var yi=ue.stereotype.match(/\(\s*([A-Za-z@])\s*,\s*(#[0-9A-Fa-f]{3,8}|[A-Za-z]+)\s*\)/);yi&&(ll=yi[1],Cl=Y(yi[2])||Cl)}if(Xn){for(var rs=(ue.name||"").split(`
-`),Xl=0,ql=0;ql<rs.length;ql++)xa(rs[ql])>Xl&&(Xl=xa(rs[ql]));var hi=Io(ue);hi&&xa("\xAB"+hi+"\xBB")>Xl&&(Xl=xa("\xAB"+hi+"\xBB"));var ei=25+Xl,Pi=(ue._w-ei)/2;b+=Ar(he("ico"),ll,"ellipse;fillColor="+Cl+";strokeColor=#181818;fontSize=13;fontStyle=1;fontColor=#000000;movable=0;connectable=0;",Pi,Math.round((Mt-22)/2),22,22,zo)}var pa=rt(ue),kn=Fr(ue,"field"),Na=Fr(ue,"method"),ol=kn?pa.fields:[],il=Na?pa.methods:[],tl=kn?Me(ol.length):0,ba=Mt+tl,dl={"+":"#84BE84","-":"#F24D5C","#":"#FFFF44","~":"#4177AF","*":"#000000"},Ml={"+":"#038048","-":"#C82930","#":"#B38D22","~":"#1963A0","*":"#000000"},Bl={"+":"ellipse","-":"rounded=0","#":"rhombus","~":"triangle;direction=north","*":"ellipse"},Ei={"+":[6,6],"-":[6,6],"#":[8,8],"~":[8,6],"*":[6,6]},ta=kn||Na?jo(ue):null;if(ta)for(var ii=Mt,Yi=Al-Ea/2,Tl=Mt+Yi,oi=0;oi<ta.length;oi++){var xl=ta[oi],nl=ii+Yi+(xl.title?Wa:0);oi>0&&Bo(xl,Tl,Math.max(2,nl-Tl));for(var Gl=0;Gl<xl.rows.length;Gl++)Ue(xl.rows[Gl],nl-Yi,Gl);Tl=nl+xl.rows.length*Ea,ii+=Qt(xl,oi)}else if(kn||Na){for(var Zl=0;Zl<ol.length;Zl++)Ue(ol[Zl],Mt,Zl);var Ci=Al-Ea/2,As=Mt+Ci+ol.length*Ea,za=Math.max(2,ba+Ci-As);kn&&Na&&(b+=Ar(he("clssep"),"",yr("line;strokeWidth=0.5;strokeColor=#181818;fillColor=none;align=left;verticalAlign=middle;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;connectable=0;",["class"],$l,"edge",["dashed","dashPattern","fixDash"]),0,As,ue._w,za,zo));for(var vl=0;vl<il.length;vl++)Ue(il[vl],ba,vl)}}var Va={},Ol={};function Fl(cr){return cr.from<cr.to?cr.from+"\0"+cr.to:cr.to+"\0"+cr.from}for(var cl=0;cl<h.length;cl++){var al=Fl(h[cl]);Va[al]=(Va[al]||0)+1}for(var ki={},Gl=0;Gl<h.length;Gl++){let Ue=function(Bo){return Bo==="cross"||Bo==="circlePlus"||Bo&&Bo.indexOf("ER")===0?Bo:null};var Ln=h[Gl],Mi=oo[Ln.from],vi=oo[Ln.to];if(Ln.type==="lollipop"){var Di=pt[Ln.to];if(Di){var Wi=ki[Ln.to]=(ki[Ln.to]||0)+1,si=Di.y+Di.h/2-8+(Wi-1)*32,Il=Di.x-52,Ht=ro(Il,si,16,16);b+=Ar(he("lolli"),"","ellipse;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=1;",Il-Ht.x,si-Ht.y,16,16,Ht.id);var ya=xa(Ln.from)+8;b+=Ar(he("lollilbl"),Ln.from,"text;html=1;fillColor=none;strokeColor=none;fontSize="+pl+";fontColor=#000000;align=center;verticalAlign=middle;",Il+8-ya/2-Ht.x,si+18-Ht.y,ya,18,Ht.id),b+=jr(he("lolliln"),"","endArrow=none;strokeColor=#181818;html=1;",Il+16,si+8,Di.x,si+8,"1")}continue}if(!(!Mi||!vi)){var Oa=Wr(Ln.from,Ln.to);if(!Ln.hidden){var St="endArrow=open;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";switch(Ln.type){case"extends":St="endArrow=block;endFill=0;endSize=12;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"implements":St="endArrow=block;endFill=0;endSize=12;dashed=1;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"composition":St="startArrow=diamond;startFill=1;startSize=12;endArrow=none;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"aggregation":St="startArrow=diamond;startFill=0;startSize=12;endArrow=none;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"association":St="endArrow=open;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"dependency":St="dashed=1;endArrow=open;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"link":St="endArrow=none;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break}if((Ln.lineStyle==="dotted"||Ln.lineStyle==="dashed")&&St.indexOf("dashed=1")<0&&(St+="dashed=1;"),Ln.color){var kl=Y(Ln.color);kl&&(St=St.replace(/strokeColor=[^;]*;/,""),St+="strokeColor="+kl+";")}Ln.bold&&(St+="strokeWidth=2;");var bl=[];Ln.color&&bl.push("strokeColor"),Ln.bold&&bl.push("strokeWidth"),Ln.lineStyle&&bl.push("dashed","dashPattern","fixDash"),St=yr(St,["arrow"],null,"edge",bl);var ms=Ue(Ln.fromArrow),gu=Ue(Ln.toArrow);ms&&(St=St.replace(/startArrow=[^;]*;/,""),St+="startArrow="+ms+";"),gu&&(St=St.replace(/endArrow=[^;]*/,"endArrow="+gu)),St.indexOf("startArrow=")<0&&(Ln.fromArrow==="diamond_filled"?St+="startArrow=diamond;startFill=1;":Ln.fromArrow==="diamond_open"&&(St+="startArrow=diamond;startFill=0;"));var _n=pt[Ln.from],En=pt[Ln.to],Xi=_n&&En&&Math.abs(_n.y-En.y)>=Math.abs(_n.x-En.x),ss=Ln.label||"";if(_n&&En){var Cs=_n.x+_n.w/2,es=_n.y+_n.h/2,os=En.x+En.w/2,qi=En.y+En.h/2,Ms=(Cs+os)/2,Ru=(es+qi)/2;if(Xi&&es!==qi){var Ef=es<qi?_n:En,vs=Ef===_n?En:_n,Js=(Ef.y+Ef.h+vs.y)/2,Au=(Js-es)/(qi-es);Au>=0&&Au<=1&&(Ru=Js,Ms=Cs+Au*(os-Cs))}else if(!Xi&&Cs!==os){var mu=Cs<os?_n:En,Df=mu===_n?En:_n,Sf=(mu.x+mu.w+Df.x)/2,Xu=(Sf-Cs)/(os-Cs);Xu>=0&&Xu<=1&&(Ms=Sf,Ru=es+Xu*(qi-es))}Ln._midX=Ms,Ln._midY=Ru,Ln._midVertical=!!Xi}if((Ln.fromCardinality||Ln.toCardinality)&&!Xi){var Ss=[];Ln.fromCardinality&&Ss.push(Ln.fromCardinality),ss&&Ss.push(ss),Ln.toCardinality&&Ss.push(Ln.toCardinality),ss=Ss.join(" ")}var ul=Fl(Ln);if(Va[ul]>1&&Xi&&_n&&En&&r.linetype!=="ortho"){var ti=Ol[ul]=(Ol[ul]||0)+1,fl=(ti-(Va[ul]+1)/2)*.22,jl=_n.y>En.y,Si=(_n.x+_n.w/2-(En.x+En.w/2))/En.w*.55;Si>.3&&(Si=.3),Si<-.3&&(Si=-.3);var Zi=(En.x+En.w/2-(_n.x+_n.w/2))/_n.w*.4;Zi>.28&&(Zi=.28),Zi<-.28&&(Zi=-.28),St+="exitX="+Math.round((.5+Zi+fl)*100)/100+";exitY="+(jl?0:1)+";exitDx=0;exitDy=0;entryX="+Math.round((.5+Si+fl*.6)*100)/100+";entryY="+(jl?1:0)+";entryDx=0;entryDy=0;"}else if(Va[ul]>1&&!Xi&&_n&&En&&r.linetype!=="ortho"){var ku=Ol[ul]=(Ol[ul]||0)+1,iu=(ku-(Va[ul]+1)/2)*.3,Bs=_n.x+_n.w/2>En.x+En.w/2;St+="exitX="+(Bs?0:1)+";exitY="+Math.round((.5+iu)*100)/100+";exitDx=0;exitDy=0;entryX="+(Bs?1:0)+";entryY="+Math.round((.5+iu)*100)/100+";entryDx=0;entryDy=0;"}if(Va[ul]===1&&Xi&&_n&&En&&r.linetype!=="ortho"&&St.indexOf("exitX=")<0){var uh=_n.y>En.y,fh=_n.x+_n.w/2,dh=En.x+En.w/2,rv=.5+Math.max(-.25,Math.min(.25,(dh-fh)/_n.w*.35)),ev=.5+Math.max(-.25,Math.min(.25,(fh-dh)/En.w*.35));St+="exitX="+Math.round(rv*100)/100+";exitY="+(uh?0:1)+";exitDx=0;exitDy=0;entryX="+Math.round(ev*100)/100+";entryY="+(uh?1:0)+";entryDx=0;entryDy=0;"}if(r.linetype==="ortho"&&Xi&&_n&&En){var ch=_n.y<En.y,ov=En.x+En.w/2,su=(ov-_n.x)/_n.w;su<.05&&(su=.05),su>.95&&(su=.95);var tv=_n.x+su*_n.w,_u=(tv-En.x)/En.w;_u<.05&&(_u=.05),_u>.95&&(_u=.95),su=Math.round(su*1e3)/1e3,_u=Math.round(_u*1e3)/1e3,St+="exitX="+su+";exitY="+(ch?1:0)+";exitDx=0;exitDy=0;entryX="+_u+";entryY="+(ch?0:1)+";entryDx=0;entryDy=0;"}var Vd="";if(_n&&En&&Ln.from!==Ln.to&&Ln.type!=="lollipop"&&St.indexOf("edgeStyle=")<0){var jf=_n.y+_n.h<=En.y,nv=En.y+En.h<=_n.y;if(jf||nv){for(var hh=_n.x+_n.w/2,av=jf?_n.y+_n.h:_n.y,Ch=En.x+En.w/2,lv=jf?En.y:En.y+En.h,Bi=[],Qd=0;Qd<e.length;Qd++){var rc=e[Qd].id;if(!(rc===Ln.from||rc===Ln.to)){var qu=pt[rc];qu&&fi(hh,av,Ch,lv,qu.x-3,qu.y-3,qu.w+6,qu.h+6)&&Bi.push(qu)}}if(Bi.length>0){for(var ec=1/0,oc=-1/0,tc=1/0,nc=-1/0,vh=0,ji=0;ji<Bi.length;ji++)Bi[ji].y<ec&&(ec=Bi[ji].y),Bi[ji].y+Bi[ji].h>oc&&(oc=Bi[ji].y+Bi[ji].h),Bi[ji].x<tc&&(tc=Bi[ji].x),Bi[ji].x+Bi[ji].w>nc&&(nc=Bi[ji].x+Bi[ji].w),vh+=Bi[ji].x+Bi[ji].w/2;var iv=vh/Bi.length>=(hh+Ch)/2,ph=iv?tc-14:nc+14,ac=ec-10,lc=oc+10;if(!jf){var sv=ac;ac=lc,lc=sv}Vd=` <Array as="points">
- <mxPoint x="`+(Math.round(ph)-Oa.x)+'" y="'+(Math.round(ac)-Oa.y)+`"/>
- <mxPoint x="`+(Math.round(ph)-Oa.x)+'" y="'+(Math.round(lc)-Oa.y)+`"/>
+`):[],Zt=r.title?Nl+(Mo.length-1)*jl:0,Uo=r.legend&&r.legend.vertical==="top"&&r.legend.lines&&r.legend.lines.length?qe(r.legend.lines):null,xn=Zt+(Uo?Uo.h+20:0),gt={},To={};function Rt(cr){for(var je=[],Yo=[],Zo=cr.members||[],Ye=0;Ye<Zo.length;Ye++)Zo[Ye].kind!=="separator"&&(Zo[Ye].kind==="method"?Yo.push(Zo[Ye]):je.push(Zo[Ye]));return{fields:je,methods:Yo}}function Be(cr){for(var je=cr.members||[],Yo=[{style:null,title:"",rows:[]}],Zo=cr.kind==="object",Ye=0;Ye<je.length;Ye++)je[Ye].kind==="separator"?(Zo=!0,Yo.push({style:je[Ye].style,title:je[Ye].title||"",rows:[]})):Yo[Yo.length-1].rows.push(je[Ye]);return Zo?Yo:null}function Ao(cr,je){return je===0&&cr.rows.length===0?0:cr.rows.length*ua+ea+(cr.title?fi:0)}function et(cr){return cr>0?cr*ua+ea:ea}function jo(cr){return!cr.stereotype||!xr(cr,"stereotype")?"":cr.stereotype.replace(/\(\s*[A-Za-z@]\s*,\s*(?:#[0-9A-Fa-f]{3,8}|[A-Za-z]+)\s*\)/,"").replace(/^\s+|\s+$/g,"")}function Tn(cr){var je=cr.kind==="object"?oi:xr(cr,"circle")?fn:ui,Yo=(cr.name||"").split(`
+`).length-1;return je+(jo(cr)?15:0)+Yo*16}function dn(cr){if(cr.kind==="circle")return 20;if(cr.kind==="diamond")return Ca;var je=xr(cr,"field"),Yo=xr(cr,"method"),Zo=je||Yo?Be(cr):null;if(Zo){for(var Ye=Tn(cr),Dt=0;Dt<Zo.length;Dt++)Ye+=Ao(Zo[Dt],Dt);return cr.kind==="object"&&Zo.length===1&&Zo[0].rows.length===0&&(Ye+=Zl),Ye}var Ht=Rt(cr);return Tn(cr)+(je?et(Ht.fields.length):0)+(Yo?et(Ht.methods.length):0)}function An(cr){return mi(cr,!0)}function Bo(cr){if(cr.kind==="circle")return Math.max(24,Math.round(ha(cr.name)*.6));if(cr.kind==="diamond")return Ca;var je=Rt(cr),Yo=(xr(cr,"field")?je.fields:[]).concat(xr(cr,"method")?je.methods:[]),Zo=sl,Ye,Dt=cr.members||[];for(Ye=0;Ye<Dt.length;Ye++)if(Dt[Ye].kind==="separator"&&Dt[Ye].title){var Ht=ha(Dt[Ye].title)+26;Ht>Zo&&(Zo=Ht)}for(Ye=0;Ye<Yo.length;Ye++){var Ea=Yo[Ye].visibility?20:6,gl=Ea+ha(An(Yo[Ye]))+6;gl>Zo&&(Zo=gl)}for(var gi=(cr.name||"").split(`
+`),Ri=0,Si=0;Si<gi.length;Si++)ha(gi[Si])>Ri&&(Ri=ha(gi[Si]));var Cs=xr(cr,"circle")?Ri+32:Ri+12;if(Cs>Zo&&(Zo=Cs),cr.stereotype){var ps=cr.stereotype.replace(/\(\s*[A-Za-z@]\s*,\s*(?:#[0-9A-Fa-f]{3,8}|[A-Za-z]+)\s*\)/,"").replace(/^\s+|\s+$/g,"");if(ps){var cu=ha("\xAB"+ps+"\xBB")+16;cu>Zo&&(Zo=cu)}}return Math.round(Zo*100)/100}function kt(cr){return cr.fromArrow==="triangle"?cr.from:cr.toArrow==="triangle"?cr.to:cr.fromArrow==="diamond_filled"||cr.fromArrow==="diamond_open"?cr.from:cr.toArrow==="diamond_filled"||cr.toArrow==="diamond_open"||cr.type==="extends"||cr.type==="implements"||cr.fromArrow==="open"&&!cr.toArrow?cr.to:cr.from}function Yn(cr,je){return je===cr.from?cr.to:cr.from}function go(cr){if(cr._sameRank)return null;if(cr._topId!=null&&cr._botId!=null)return{top:cr._topId,bot:cr._botId};var je=kt(cr);return je==null?null:{top:je,bot:Yn(cr,je)}}for(var Ho={},Ro=0;Ro<e.length;Ro++)Ho[e[Ro].id]=!0;for(var At={},ot={},Ro=0;Ro<e.length;Ro++)At[e[Ro].id]=[],ot[e[Ro].id]=0;for(var oo=0;oo<c.length;oo++){var to=go(c[oo]);if(to!=null){var cn=to.top,Yt=to.bot;!Ho[cn]||!Ho[Yt]||cn===Yt||(At[cn].push(Yt),ot[Yt]++)}}var so={},Bn={},tt={};function an(cr){if(Bn[cr]!==void 0)return Bn[cr];if(tt[cr])return 0;tt[cr]=!0;for(var je=0,Yo=At[cr]||[],Zo=0;Zo<Yo.length;Zo++){var Ye=1+an(Yo[Zo]);Ye>je&&(je=Ye)}return tt[cr]=!1,Bn[cr]=je,je}var Ga={};for(var hn in At)if(At.hasOwnProperty(hn)){Ga[hn]||(Ga[hn]=[]);for(var Da=0;Da<At[hn].length;Da++){var jt=At[hn][Da];Ga[jt]||(Ga[jt]=[]),Ga[hn].push(jt),Ga[jt].push(hn)}}for(var _n={},da=[],Ro=0;Ro<e.length;Ro++){var Jt=e[Ro].id;if(_n[Jt]===void 0){var Ut=da.length,ga=[Jt],mn=0;for(_n[Jt]=Ut;ga.length>0;){var ma=ga.pop(),oa=an(ma);oa>mn&&(mn=oa);for(var On=Ga[ma]||[],Za=0;Za<On.length;Za++)_n[On[Za]]===void 0&&(_n[On[Za]]=Ut,ga.push(On[Za]))}da.push(mn)}}for(var Ro=0;Ro<e.length;Ro++){var be=e[Ro].id;so[be]=da[_n[be]]-an(be)}for(var $n=!0,Wn=0;$n&&Wn++<10;){$n=!1;for(var $r=0;$r<c.length;$r++){var ee=c[$r];if(ee._sameRank&&!(so[ee.from]===void 0||so[ee.to]===void 0)){var Rr=Math.max(so[ee.from],so[ee.to]);(so[ee.from]!==Rr||so[ee.to]!==Rr)&&(so[ee.from]=Rr,so[ee.to]=Rr,$n=!0)}}}for(var Ro=0;Ro<e.length;Ro++)e[Ro]._w=Bo(e[Ro]);if(We!=null&&(c.length===0||e.length<2)&&We.veto("no links"),We!=null&&r.linetype==="ortho"&&We.veto("linetype ortho"),c.length===0&&e.length>5)for(var tr=560,vr=0,Te=0,jr=0;jr<e.length;jr++){var _e=e[jr]._w+40;Te>0&&Te+_e>tr&&(vr++,Te=0),so[e[jr].id]=vr,Te+=_e}for(var Br={},br=[],Ro=0;Ro<e.length;Ro++){var Or=so[e[Ro].id];Br[Or]||(Br[Or]=[],br.push(Or)),Br[Or].push(e[Ro])}br.sort(function(cr,je){return cr-je});for(var xe=0;xe<c.length;xe++){var bo=c[xe];if(bo._side&&!(so[bo.from]===void 0||so[bo.from]!==so[bo.to])){for(var _t=Br[so[bo.from]],Wo=-1,Fo=-1,ut=0;ut<_t.length;ut++)_t[ut].id===bo.from&&(Wo=ut),_t[ut].id===bo.to&&(Fo=ut);if(!(Wo<0||Fo<0)){if(bo._side==="left"&&Fo>Wo)_t.splice(Wo,0,_t.splice(Fo,1)[0]);else if(bo._side==="right"&&Fo<Wo){var Do=_t.splice(Fo,1)[0];_t.splice(Wo,0,Do)}}}}for(var Fr={},Gt=0;Gt<c.length;Gt++){var st=c[Gt],Mn=go(st);if(Mn!=null){var jn=Mn.top,Hn=Mn.bot;!Ho[jn]||!Ho[Hn]||so[Hn]===so[jn]+1&&(st.label||st.fromCardinality||st.toCardinality)&&(Fr[so[jn]]=!0)}}var Xo={},Xn={};function Ta(cr,je,Yo,Zo){var Ye={},Dt;for(Dt=0;Dt<cr.length;Dt++)Ye[cr[Dt].id]=cr[Dt];var Ht={},Ea={};for(Dt=0;Dt<cr.length;Dt++)Ht[cr[Dt].id]=[],Ea[cr[Dt].id]=0;for(var gl=0;gl<je.length;gl++){var gi=je[gl];Ye[gi.top]&&Ye[gi.bot]&&gi.top!==gi.bot&&(Ht[gi.top].push(gi.bot),Ea[gi.bot]++)}var Ri={},Si=[];for(Dt=0;Dt<cr.length;Dt++)Ea[cr[Dt].id]===0&&(Ri[cr[Dt].id]=0,Si.push(cr[Dt].id));for(var Cs=cr.length*cr.length+16;Si.length>0&&Cs-- >0;)for(var ps=Si.shift(),cu=Ht[ps],zs=0;zs<cu.length;zs++){var _d=Ri[ps]+1;(Ri[cu[zs]]===void 0||Ri[cu[zs]]<_d)&&(Ri[cu[zs]]=_d,Si.push(cu[zs]))}var df={},Xu=[];for(Dt=0;Dt<cr.length;Dt++){var Ff=Ri[cr[Dt].id]===void 0?0:Ri[cr[Dt].id];df[Ff]||(df[Ff]=[],Xu.push(Ff)),df[Ff].push(cr[Dt])}Xu.sort(function(DC,TC){return DC-TC});var tc=[],Jf=0,qu,ms;for(qu=0;qu<Xu.length;qu++){var fv=df[Xu[qu]],Od=0;for(ms=0;ms<fv.length;ms++)ms>0&&(Od+=Yo),Od+=fv[ms].w;tc.push(Od),Od>Jf&&(Jf=Od)}var dv={},ah=0;for(qu=0;qu<Xu.length;qu++){var Ef=df[Xu[qu]],nc=0;for(ms=0;ms<Ef.length;ms++)Ef[ms].h>nc&&(nc=Ef[ms].h);var cv=(Jf-tc[qu])/2;for(ms=0;ms<Ef.length;ms++)dv[Ef[ms].id]={x:cv,y:ah+(nc-Ef[ms].h)/2},cv+=Ef[ms].w+Yo;ah+=nc+Zo}return{pos:dv,width:Jf,height:Math.max(0,ah-Zo)}}if(i.length>0){let cr=function(Ye,Dt){var Ht=Kn[Ye];if(Ht===void 0)return Dt===-1?Ye:null;if(Ht===Dt)return Ye;for(var Ea=i.length+1;Ht!==void 0&&Ea-- >0;){var gl=la[Ht];if(gl===void 0&&Dt===-1||gl===Dt)return"pkg#"+Ht;Ht=gl}return null},je=function(Ye){var Dt=(Ye.stereotype||"").toLowerCase();return Dt==="node"?{side:46,top:40,bottom:16}:Dt==="cloud"?{side:18,top:36,bottom:22}:Dt==="database"?{side:31,top:50,bottom:16}:{side:el,top:35,bottom:16}},Yo=function(Ye){var Dt=[],Ht;for(Ht=0;Ht<e.length;Ht++)Kn[e[Ht].id]===Ye&&Dt.push({id:e[Ht].id,w:e[Ht]._w,h:dn(e[Ht])});for(Ht=0;Ht<vn[Ye].length;Ht++){var Ea=vn[Ye][Ht];Yo(Ea),Dt.push({id:"pkg#"+Ea,w:ia[Ea],h:zn[Ea]})}for(Ht=0;Ht<h.length;Ht++)if(h[Ht].pkgIndex===Ye&&!h[Ht].target){var gl=h[Ht].legend?qe(h[Ht].lines||[]):Po(h[Ht]);Dt.push({id:"note#"+Ht,w:gl.w,h:gl.h})}var gi=[];for(Ht=0;Ht<c.length;Ht++){var Ri=go(c[Ht]);if(Ri){var Si=cr(Ri.top,Ye),Cs=cr(Ri.bot,Ye);Si&&Cs&&Si!==Cs&&gi.push({top:Si,bot:Cs})}}var ps=Ta(Dt,gi,Cl,Aa);for(Ht=0;Ht<Dt.length;Ht++)qn[Dt[Ht].id]=ps.pos[Dt[Ht].id];var cu=Math.max(ps.width,ha(i[Ye].name)+24),zs=je(i[Ye]);ia[Ye]=cu+zs.side*2,zn[Ye]=zs.top+ps.height+zs.bottom},Zo=function(Ye,Dt,Ht){var Ea=je(i[Ye]);Xo[Ye]={x:Dt,y:Ht,w:ia[Ye],h:zn[Ye]},Xn[Ye]=ie("pkg"),We?.container(Xn[Ye],{top:Ea.top,left:Ea.side,bottom:Ea.bottom,right:Ea.side},ha(i[Ye].name)+24),!Ho[i[Ye].name]&&!gt[i[Ye].name]&&(gt[i[Ye].name]=Xn[Ye],To[i[Ye].name]=Xo[Ye]);for(var gl=0;gl<e.length;gl++)Kn[e[gl].id]===Ye&&qn[e[gl].id]&&(e[gl]._x=Dt+Ea.side+qn[e[gl].id].x,e[gl]._y=Ht+Ea.top+qn[e[gl].id].y,e[gl]._h=dn(e[gl]));for(var gi=0;gi<vn[Ye].length;gi++){var Ri=vn[Ye][gi],Si=qn["pkg#"+Ri];Si&&Zo(Ri,Dt+Ea.side+Si.x,Ht+Ea.top+Si.y)}for(var Cs=0;Cs<h.length;Cs++){var ps=qn["note#"+Cs];h[Cs].pkgIndex===Ye&&ps&&(Qe[Cs]={x:Dt+Ea.side+ps.x,y:Ht+Ea.top+ps.y})}};var Kn={},Qo,pa;for(Qo=0;Qo<i.length;Qo++){var Mt=i[Qo].classes||[];for(pa=0;pa<Mt.length;pa++)Ho[Mt[pa]]&&(Kn[Mt[pa]]=Qo)}var la={},vn={};for(Qo=0;Qo<i.length;Qo++)vn[Qo]=[];for(Qo=0;Qo<i.length;Qo++){var Jn=i[Qo].parentIndex;Jn!=null&&Jn>=0&&Jn<i.length&&Jn!==Qo&&(la[Qo]=Jn,vn[Jn].push(Qo))}var qn={},ia={},zn={};for(Qo=0;Qo<i.length;Qo++)la[Qo]===void 0&&Yo(Qo);var Ko=[],Bt;for(Qo=0;Qo<i.length;Qo++)la[Qo]===void 0&&Ko.push({id:"pkg#"+Qo,w:ia[Qo],h:zn[Qo]});for(Bt=0;Bt<e.length;Bt++)Kn[e[Bt].id]===void 0&&Ko.push({id:e[Bt].id,w:e[Bt]._w,h:dn(e[Bt])});var ta=[];for(Bt=0;Bt<c.length;Bt++){var ln=go(c[Bt]);if(!(!ln||!Ho[ln.top]||!Ho[ln.bot])){var mo=cr(ln.top,-1),Vt=cr(ln.bot,-1);mo&&Vt&&mo!==Vt&&ta.push({top:mo,bot:Vt})}}var nt=Ta(Ko,ta,Cl,$l),kr=xt,Ir=xt+xn;for(Qo=0;Qo<i.length;Qo++){var Tr=nt.pos["pkg#"+Qo];Tr&&Zo(Qo,kr+Tr.x,Ir+Tr.y)}for(Bt=0;Bt<e.length;Bt++)if(Kn[e[Bt].id]===void 0){var Gr=nt.pos[e[Bt].id];if(!Gr)continue;e[Bt]._x=kr+Gr.x,e[Bt]._y=Ir+Gr.y,e[Bt]._h=dn(e[Bt])}}else{for(var Vr=[],Ge=0,Jr=0;Jr<br.length;Jr++){for(var co=Br[br[Jr]],Ie=0,Ee=0;Ee<co.length;Ee++)Ee>0&&(Ie+=Cl),Ie+=co[Ee]._w;Vr.push(Ie),Ie>Ge&&(Ge=Ie)}for(var qo=xt+xn,Jr=0;Jr<br.length;Jr++){for(var Ot=Br[br[Jr]],no=0,Ee=0;Ee<Ot.length;Ee++){var Fn=dn(Ot[Ee]);Fn>no&&(no=Fn)}for(var Cn=xt+(Ge-Vr[Jr])/2,Ee=0;Ee<Ot.length;Ee++){var yt=Ot[Ee],wt=dn(yt);yt._x=Cn,yt._y=qo+(no-wt)/2,yt._h=wt,Cn+=yt._w+Cl}var rt=Fr[br[Jr]]?en:Aa;qo+=no+rt}}var le=r.associationClasses||[];We!=null&&le.length>0&&We.veto("association classes");for(var Fe=0;Fe<le.length;Fe++){for(var $e=le[Fe],Se=null,ro=null,It=null,Jo=0;Jo<e.length;Jo++)e[Jo].id===$e.a&&(Se=e[Jo]),e[Jo].id===$e.b&&(ro=e[Jo]),e[Jo].id===$e.cls&&(It=e[Jo]);if(!(!Se||!ro||!It)){for(var xo=0,Et=0;Et<c.length;Et++)(c[Et].from===$e.cls||c[Et].to===$e.cls)&&xo++;if(!(xo>0)){if(ro._y!==Se._y){for(var Vn=!0,Un=0;Un<e.length;Un++)if(e[Un]!==ro&&e[Un]!==It&&e[Un]._y===ro._y){Vn=!1;break}Vn&&(ro._x=Se._x+Se._w/2-ro._w/2)}var bt=(Se._x+Se._w/2+ro._x+ro._w/2)/2,mt=(Se._y+Se._h/2+ro._y+ro._h/2)/2;It._x=bt+70,It._y=mt-It._h/2,$e._midX=bt,$e._midY=mt}}}for(var In=0;In<e.length;In++){var Zn=e[In];if(Zn.kind==="circle"){for(var Oe=null,uo=0,io=0;io<c.length;io++)c[io].type!=="lollipop"&&(c[io].from===Zn.id||c[io].to===Zn.id)&&(uo++,Oe=c[io]);if(uo===1){for(var we=Oe.from===Zn.id?Oe.to:Oe.from,de=null,$o=0;$o<e.length;$o++)if(e[$o].id===we){de=e[$o];break}!de||de._y===Zn._y||(Zn._x=de._x+de._w/2-Zn._w/2)}}}if(e.length>0){for(var ft=1/0,Vo=1/0,zo=-1/0,ka=-1/0,sa=0;sa<e.length;sa++){var _a=e[sa];_a._x<ft&&(ft=_a._x),_a._y<Vo&&(Vo=_a._y),_a._x+_a._w>zo&&(zo=_a._x+_a._w),_a._y+_a._h>ka&&(ka=_a._y+_a._h)}var Ba=e.length===1?9:3,No=ie("mtl"),vt=ie("mbr");if(We!=null&&(We.corner(No,"tl"),We.corner(vt,"br")),F+=Dr(No,"","text;fillColor=none;strokeColor=none;",ft-3,Vo-3,0,0,"1"),F+=Dr(vt,"","text;fillColor=none;strokeColor=none;",zo+Ba,ka+Ba,0,0,"1"),r.title){for(var Wt=0,Nt=0;Nt<Mo.length;Nt++)Wt=Math.max(Wt,ha(Mo[Nt]));var $a=Math.max(120,Wt+20),sn=(ft+zo)/2-$a/2;F+=Dr(ie("cltitle"),Mo.join(`
+`),"text;html=1;fillColor=none;strokeColor=none;fontSize="+fa+";fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",sn,xt-3,$a,24+(Mo.length-1)*jl,"1")}}var ce=Kn||{},yr=la||{};function Io(cr){var je=[],Yo=ce[cr];if(Yo===void 0&&!Ho[cr]){for(var Zo=0;Zo<i.length;Zo++)if(i[Zo].name===cr&&Xo[Zo]){Yo=yr[Zo];break}}for(var Ye=i.length+1;Yo!==void 0&&Ye-- >0;)je.push(Yo),Yo=yr[Yo];return je}function ge(cr){var je=cr!=null&&cr>=0?Xo[cr]:null;return!je||!Xn[cr]?{id:"1",x:0,y:0,pkg:-1}:{id:Xn[cr],x:je.x,y:je.y,pkg:cr}}function Ct(cr){return ge(ce[cr])}function Nn(cr,je){for(var Yo=Io(cr),Zo=Io(je),Ye=0;Ye<Yo.length;Ye++)if(Zo.indexOf(Yo[Ye])>=0&&Xo[Yo[Ye]])return ge(Yo[Ye]);return ge(-1)}function Qn(cr,je,Yo,Zo){for(var Ye=-1,Dt=1/0,Ht=0;Ht<i.length;Ht++){var Ea=Xo[Ht];!Ea||!Xn[Ht]||cr<Ea.x||je<Ea.y||cr+Yo>Ea.x+Ea.w||je+Zo>Ea.y+Ea.h||Ea.w*Ea.h<Dt&&(Ye=Ht,Dt=Ea.w*Ea.h)}return ge(Ye)}for(var kn=0;kn<e.length;kn++){let je=function(Zo,Ye,Dt){for(var Ht=Ye+xa+Dt*ua,Ea=Ht-ua/2,gl=Zo.visibility,gi=gl&&ds[gl],Ri=Zo.kind==="method",Si=0,Cs=Zo.modifiers||[],ps=0;ps<Cs.length;ps++)Cs[ps]==="static"&&(Si|=4);var cu=gi?20:6,zs="text;html=1;align=left;verticalAlign=middle;spacingLeft="+cu+";spacingRight=4;overflow=hidden;rotatable=0;fillColor=none;strokeColor=none;fontSize="+fa+";fontColor=#000000;fontStyle="+Si+";points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;",_d=ie("mb");if(zs=wr(zs,["class"],na,"text"),F+=Dr(_d,An(Zo),zs,0,Ea,Ke._w,ua,yn),gi){var df=al[gl]||[6,6],Xu=df[0],Ff=df[1],tc=Ri||gl==="*"?ns[gl]:"none",Jf=(Rs[gl]||"ellipse")+";fillColor="+tc+";strokeColor="+ds[gl]+";strokeWidth=1;movable=0;connectable=0;";F+=Dr(ie("vis"),"",Jf,11-Xu/2,ua/2-Ff/2,Xu,Ff,_d)}},Yo=function(Zo,Ye,Dt){var Ht="line;strokeColor=#181818;fillColor=none;align=left;verticalAlign=middle;rotatable=0;points=[];portConstraint=eastwest;connectable=0;",Ea=Zo.style;Ht+="strokeWidth="+(Ea==="_"?"0.5":"1")+";"+(Ea==="."?"dashed=1;dashPattern=1 2;":""),Zo.title&&(Ye+=2);var gl=Zo.title?ha(Zo.title)+8:0,gi=Zo.title?Math.max(2,(Ke._w-gl)/2):Ke._w;Ht=wr(Ht,["class"],na,"edge",["dashed","dashPattern","fixDash"]);function Ri(Si){F+=Dr(ie("clssep"),"",Ht,0,Si,gi,Dt,yn),Zo.title&&(F+=Dr(ie("clssep"),"",Ht,Ke._w-gi,Si,gi,Dt,yn))}Ea==="="?(Ri(Ye-1),Ri(Ye+1)):Ri(Ye),Zo.title&&(F+=Dr(ie("septitle"),Zo.title,"text;html=1;align=center;verticalAlign=middle;fillColor=none;strokeColor=none;fontSize="+fa+";fontColor=#000000;movable=0;connectable=0;",(Ke._w-gl)/2,Ye+Dt/2-ua/2,gl,ua,yn))};var Ke=e[kn],oa=Ke._h,yn=ie("cls");gt[Ke.id]=yn,We?.node(yn);var tn=Ct(Ke.id),Ia=Ke._x,Ma=Ke._y;if(To[Ke.id]={x:Ia,y:Ma,w:Ke._w,h:oa},Ke.kind==="circle"){var Sl=16,Ll=Ia+(Ke._w-Sl)/2,ja=Ma+(oa-Sl)/2;F+=Dr(yn,Ke.name,"ellipse;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=1;verticalLabelPosition=bottom;verticalAlign=top;fontSize="+fa+";fontColor=#000000;",Ll-tn.x,ja-tn.y,Sl,Sl,tn.id),To[Ke.id]={x:Ll,y:ja,w:Sl,h:Sl};continue}if(Ke.kind==="diamond"){F+=Dr(yn,"","rhombus;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;",Ia-tn.x,Ma-tn.y,Ca,Ca,tn.id),To[Ke.id]={x:Ia,y:Ma,w:Ca,h:Ca};continue}var Ja="",Ol=jo(Ke);Ol&&(Ja+="\xAB"+Ol+`\xBB
+`);var Yl=Tn(Ke);Ja+=Ke.name;var ko="0",fo=xr(Ke,"circle"),lt=fo?25:0,Lt="#F1F1F1",ao="#181818",wa="#000000",ho="";if(Ke.color){var Ra=Ke.color.match(/##(?:\[(\w+)\])?(\S+)/);if(Ra){var Va=Y(Ra[2]);Va&&(ao=Va),Ra[1]&&/bold/i.test(Ra[1])&&(ho="strokeWidth=2;")}var un=Ke.color.replace(/^#/,"").split(";"),En=un[0].replace(/\s*##.*$/,"");if(En){var Oa=Y("#"+En);Oa&&(Lt=Oa)}for(var Vl=1;Vl<un.length;Vl++){var Wl=un[Vl].match(/^(line|text)\s*:\s*(\S+)/i);if(Wl&&Wl[1].toLowerCase()==="line"){var hi=Y(Wl[2]);hi&&(ao=hi)}else if(Wl){var Ci=Y(Wl[2]);Ci&&(wa=Ci)}}}var Qa="swimlane;collapsible=0;fontStyle="+ko+";align=center;fontSize="+fa+";fontColor="+wa+";startSize="+Yl+";spacingLeft="+lt+";fillColor="+Lt+";strokeColor="+ao+";"+ho+"childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;marginBottom=0;stackSpacing=0;marginTop="+(xa-ua/2)+";",na=Ke.stereotype?[Ke.stereotype]:[],ai=U(rr,["root","element","classDiagram","class"],na,"vertex"),Ql=U(rr,["root","element","classDiagram","class","header"],na,"vertex");Ke.color?(delete ai.fillColor,delete ai.gradientColor,delete Ql.fillColor,delete Ql.gradientColor):ai.fillColor!=null&&(ai.swimlaneFillColor=ai.fillColor);for(var Dl in Ql)Ql.hasOwnProperty(Dl)&&!/^(strokeColor|strokeWidth|dashed|dashPattern|fixDash|rounded|arcSize|absoluteArcSize|shadow)$/.test(Dl)&&(ai[Dl]=Ql[Dl]);if(Qa=H(Qa,ai),F+=Dr(yn,Ja,Qa,Ia-tn.x,Ma-tn.y,Ke._w,oa,tn.id),Ke.generics){var ri=Ke.generics,wi=Math.max(20,Ke.generics.length*7+8),Pi=18;F+=Dr(ie("gen"),ri,"rounded=0;fillColor=#FFFFFF;strokeColor=#181818;dashed=1;dashPattern=2 2;fontSize=10;align=center;verticalAlign=middle;movable=0;connectable=0;",Ke._w-wi-6,-3,wi,Pi,yn)}var Ha=r.monochrome?"#C2C2C2":"#ADD1B2",Ml="C";if(Ke.kind==="interface"?(r.monochrome||(Ha="#B4A7E5"),Ml="I"):Ke.kind==="enum"?(r.monochrome||(Ha="#EB937F"),Ml="E"):Ke.kind==="abstract"?(r.monochrome||(Ha="#A9DCDF"),Ml="A"):Ke.kind==="annotation"?(r.monochrome||(Ha="#E3C6AA"),Ml="@"):Ke.kind==="struct"?(r.monochrome||(Ha="#FFFFFF"),Ml="S"):Ke.kind==="protocol"?(r.monochrome||(Ha="#FFFFFF"),Ml="P"):Ke.kind==="exception"?(r.monochrome||(Ha="#E5574F"),Ml="X"):Ke.kind==="metaclass"?(r.monochrome||(Ha="#B3B3B3"),Ml="M"):Ke.kind==="stereotype"?(r.monochrome||(Ha="#EE7EEE"),Ml="S"):Ke.kind==="entity"&&(r.monochrome||(Ha="#ADD1B2"),Ml="E"),Ke.stereotype){var os=Ke.stereotype.match(/\(\s*([A-Za-z@])\s*,\s*(#[0-9A-Fa-f]{3,8}|[A-Za-z]+)\s*\)/);os&&(Ml=os[1],Ha=Y(os[2])||Ha)}if(fo){for(var ts=(Ke.name||"").split(`
+`),Fi=0,ca=0;ca<ts.length;ca++)ha(ts[ca])>Fi&&(Fi=ha(ts[ca]));var bn=jo(Ke);bn&&ha("\xAB"+bn+"\xBB")>Fi&&(Fi=ha("\xAB"+bn+"\xBB"));var ll=25+Fi,ml=(Ke._w-ll)/2;F+=Dr(ie("ico"),Ml,"ellipse;fillColor="+Ha+";strokeColor=#181818;fontSize=13;fontStyle=1;fontColor=#000000;movable=0;connectable=0;",ml,Math.round((Yl-22)/2),22,22,yn)}var Gl=Rt(Ke),rl=xr(Ke,"field"),nl=xr(Ke,"method"),yl=rl?Gl.fields:[],vi=nl?Gl.methods:[],hl=rl?et(yl.length):0,gs=Yl+hl,ns={"+":"#84BE84","-":"#F24D5C","#":"#FFFF44","~":"#4177AF","*":"#000000"},ds={"+":"#038048","-":"#C82930","#":"#B38D22","~":"#1963A0","*":"#000000"},Rs={"+":"ellipse","-":"rounded=0","#":"rhombus","~":"triangle;direction=north","*":"ellipse"},al={"+":[6,6],"-":[6,6],"#":[8,8],"~":[8,6],"*":[6,6]},Ti=rl||nl?Be(Ke):null;if(Ti)for(var cs=Yl,hs=xa-ua/2,Tl=Yl+hs,ei=0;ei<Ti.length;ei++){var Ka=Ti[ei],Xi=cs+hs+(Ka.title?fi:0);ei>0&&Yo(Ka,Tl,Math.max(2,Xi-Tl));for(var Na=0;Na<Ka.rows.length;Na++)je(Ka.rows[Na],Xi-hs,Na);Tl=Xi+Ka.rows.length*ua,cs+=Ao(Ka,ei)}else if(rl||nl){for(var Bl=0;Bl<yl.length;Bl++)je(yl[Bl],Yl,Bl);var wl=xa-ua/2,li=Yl+wl+yl.length*ua,La=Math.max(2,gs+wl-li);rl&&nl&&(F+=Dr(ie("clssep"),"",wr("line;strokeWidth=0.5;strokeColor=#181818;fillColor=none;align=left;verticalAlign=middle;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;connectable=0;",["class"],na,"edge",["dashed","dashPattern","fixDash"]),0,li,Ke._w,La,yn));for(var il=0;il<vi.length;il++)je(vi[il],gs,il)}}var ya={},Xl={};function nu(cr){return cr.from<cr.to?cr.from+"\0"+cr.to:cr.to+"\0"+cr.from}for(var zi=0;zi<c.length;zi++){var Il=nu(c[zi]);ya[Il]=(ya[Il]||0)+1}for(var qs={},Na=0;Na<c.length;Na++){let je=function(Yo){return Yo==="cross"||Yo==="circlePlus"||Yo&&Yo.indexOf("ER")===0?Yo:null};var Xt=c[Na],Zs=gt[Xt.from],ii=gt[Xt.to];if(Xt.type==="lollipop"){var qi=To[Xt.to];if(qi){var Ls=qs[Xt.to]=(qs[Xt.to]||0)+1,Zi=qi.y+qi.h/2-8+(Ls-1)*32,gn=qi.x-52,Pa=Qn(gn,Zi,16,16),kl=ie("lolli");We?.follow(kl,ii,"l"),F+=Dr(kl,"","ellipse;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=1;",gn-Pa.x,Zi-Pa.y,16,16,Pa.id);var bl=ha(Xt.from)+8,si=ie("lollilbl");We?.follow(si,ii,"l"),F+=Dr(si,Xt.from,"text;html=1;fillColor=none;strokeColor=none;fontSize="+fa+";fontColor=#000000;align=center;verticalAlign=middle;",gn+8-bl/2-Pa.x,Zi+18-Pa.y,bl,18,Pa.id);var ql=ie("lolliln");We?.follow(ql,ii,"l"),F+=Ze(ql,"","endArrow=none;strokeColor=#181818;html=1;",gn+16,Zi+8,qi.x,Zi+8,"1")}continue}if(!(!Zs||!ii)){var ji=Nn(Xt.from,Xt.to);if(Xt.hidden){var gu=We!=null?go(Xt):null;gu!=null&&We.virtualEdge(gt[gu.top],gt[gu.bot]);continue}var za="endArrow=open;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";switch(Xt.type){case"extends":za="endArrow=block;endFill=0;endSize=12;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"implements":za="endArrow=block;endFill=0;endSize=12;dashed=1;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"composition":za="startArrow=diamond;startFill=1;startSize=12;endArrow=none;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"aggregation":za="startArrow=diamond;startFill=0;startSize=12;endArrow=none;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"association":za="endArrow=open;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"dependency":za="dashed=1;endArrow=open;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break;case"link":za="endArrow=none;html=1;strokeColor=#181818;fontColor=#000000;fontSize=11;";break}if((Xt.lineStyle==="dotted"||Xt.lineStyle==="dashed")&&za.indexOf("dashed=1")<0&&(za+="dashed=1;"),Xt.color){var as=Y(Xt.color);as&&(za=za.replace(/strokeColor=[^;]*;/,""),za+="strokeColor="+as+";")}Xt.bold&&(za+="strokeWidth=2;");var Gs=[];Xt.color&&Gs.push("strokeColor"),Xt.bold&&Gs.push("strokeWidth"),Xt.lineStyle&&Gs.push("dashed","dashPattern","fixDash"),za=wr(za,["arrow"],null,"edge",Gs);var vs=je(Xt.fromArrow),ws=je(Xt.toArrow);vs&&(za=za.replace(/startArrow=[^;]*;/,""),za+="startArrow="+vs+";"),ws&&(za=za.replace(/endArrow=[^;]*/,"endArrow="+ws)),za.indexOf("startArrow=")<0&&(Xt.fromArrow==="diamond_filled"?za+="startArrow=diamond;startFill=1;":Xt.fromArrow==="diamond_open"&&(za+="startArrow=diamond;startFill=0;"));var Ln=To[Xt.from],Sn=To[Xt.to],pi=Ln&&Sn&&Math.abs(Ln.y-Sn.y)>=Math.abs(Ln.x-Sn.x),ls=Xt.label||"";if(Ln&&Sn){var Ps=Ln.x+Ln.w/2,Ji=Ln.y+Ln.h/2,As=Sn.x+Sn.w/2,au=Sn.y+Sn.h/2,Eu=(Ps+As)/2,xf=(Ji+au)/2;if(pi&&Ji!==au){var Hl=Ji<au?Ln:Sn,Kc=Hl===Ln?Sn:Ln,Cf=(Hl.y+Hl.h+Kc.y)/2,pf=(Cf-Ji)/(au-Ji);pf>=0&&pf<=1&&(xf=Cf,Eu=Ps+pf*(As-Ps))}else if(!pi&&Ps!==As){var cd=Ps<As?Ln:Sn,of=cd===Ln?Sn:Ln,Yd=(cd.x+cd.w+of.x)/2,Yf=(Yd-Ps)/(As-Ps);Yf>=0&&Yf<=1&&(Eu=Yd,xf=Ji+Yf*(au-Ji))}Xt._midX=Eu,Xt._midY=xf,Xt._midVertical=!!pi}if((Xt.fromCardinality||Xt.toCardinality)&&!pi){var lu=[];Xt.fromCardinality&&lu.push(Xt.fromCardinality),ls&&lu.push(ls),Xt.toCardinality&&lu.push(Xt.toCardinality),ls=lu.join(" ")}var Ts=nu(Xt);if(ya[Ts]>1&&pi&&Ln&&Sn&&r.linetype!=="ortho"){var hd=Xl[Ts]=(Xl[Ts]||0)+1,$f=(hd-(ya[Ts]+1)/2)*.22,iu=Ln.y>Sn.y,tf=(Ln.x+Ln.w/2-(Sn.x+Sn.w/2))/Sn.w*.55;tf>.3&&(tf=.3),tf<-.3&&(tf=-.3);var nf=(Sn.x+Sn.w/2-(Ln.x+Ln.w/2))/Ln.w*.4;nf>.28&&(nf=.28),nf<-.28&&(nf=-.28),za+="exitX="+Math.round((.5+nf+$f)*100)/100+";exitY="+(iu?0:1)+";exitDx=0;exitDy=0;entryX="+Math.round((.5+tf+$f*.6)*100)/100+";entryY="+(iu?1:0)+";entryDx=0;entryDy=0;"}else if(ya[Ts]>1&&!pi&&Ln&&Sn&&r.linetype!=="ortho"){var zc=Xl[Ts]=(Xl[Ts]||0)+1,vd=(zc-(ya[Ts]+1)/2)*.3,Md=Ln.x+Ln.w/2>Sn.x+Sn.w/2;za+="exitX="+(Md?0:1)+";exitY="+Math.round((.5+vd)*100)/100+";exitDx=0;exitDy=0;entryX="+(Md?1:0)+";entryY="+Math.round((.5+vd)*100)/100+";entryDx=0;entryDy=0;"}if(ya[Ts]===1&&pi&&Ln&&Sn&&r.linetype!=="ortho"&&za.indexOf("exitX=")<0){var Ru=Ln.y>Sn.y,xs=Ln.x+Ln.w/2,Ys=Sn.x+Sn.w/2,af=.5+Math.max(-.25,Math.min(.25,(Ys-xs)/Ln.w*.35)),Hd=.5+Math.max(-.25,Math.min(.25,(xs-Ys)/Sn.w*.35));za+="exitX="+Math.round(af*100)/100+";exitY="+(Ru?0:1)+";exitDx=0;exitDy=0;entryX="+Math.round(Hd*100)/100+";entryY="+(Ru?1:0)+";entryDx=0;entryDy=0;"}if(r.linetype==="ortho"&&pi&&Ln&&Sn){var Mf=Ln.y<Sn.y,Hf=Sn.x+Sn.w/2,Su=(Hf-Ln.x)/Ln.w;Su<.05&&(Su=.05),Su>.95&&(Su=.95);var gf=Ln.x+Su*Ln.w,Ms=(gf-Sn.x)/Sn.w;Ms<.05&&(Ms=.05),Ms>.95&&(Ms=.95),Su=Math.round(Su*1e3)/1e3,Ms=Math.round(Ms*1e3)/1e3,za+="exitX="+Su+";exitY="+(Mf?1:0)+";exitDx=0;exitDy=0;entryX="+Ms+";entryY="+(Mf?0:1)+";entryDx=0;entryDy=0;"}var Rf="";if(Ln&&Sn&&Xt.from!==Xt.to&&Xt.type!=="lollipop"&&za.indexOf("edgeStyle=")<0){var Af=Ln.y+Ln.h<=Sn.y,Kd=Sn.y+Sn.h<=Ln.y;if(Af||Kd){for(var Cd=Ln.x+Ln.w/2,pd=Af?Ln.y+Ln.h:Ln.y,Kf=Sn.x+Sn.w/2,zd=Af?Sn.y:Sn.y+Sn.h,xi=[],$d=0;$d<e.length;$d++){var lf=e[$d].id;if(!(lf===Xt.from||lf===Xt.to)){var Mu=To[lf];Mu&&Bi(Cd,pd,Kf,zd,Mu.x-3,Mu.y-3,Mu.w+6,Mu.h+6)&&xi.push(Mu)}}if(xi.length>0){for(var mf=1/0,kf=-1/0,_f=1/0,gd=-1/0,Hs=0,Ei=0;Ei<xi.length;Ei++)xi[Ei].y<mf&&(mf=xi[Ei].y),xi[Ei].y+xi[Ei].h>kf&&(kf=xi[Ei].y+xi[Ei].h),xi[Ei].x<_f&&(_f=xi[Ei].x),xi[Ei].x+xi[Ei].w>gd&&(gd=xi[Ei].x+xi[Ei].w),Hs+=xi[Ei].x+xi[Ei].w/2;var Rd=Hs/xi.length>=(Cd+Kf)/2,zf=Rd?_f-14:gd+14,Of=mf-10,Uf=kf+10;if(!Af){var Ud=Of;Of=Uf,Uf=Ud}Rf=` <Array as="points">
+ <mxPoint x="`+(Math.round(zf)-ji.x)+'" y="'+(Math.round(Of)-ji.y)+`"/>
+ <mxPoint x="`+(Math.round(zf)-ji.x)+'" y="'+(Math.round(Uf)-ji.y)+`"/>
</Array>
-`,St=St.replace(/(exit|entry)(X|Y|Dx|Dy)=[-0-9.]+;/g,"")}}}var $h=P(ss,St);if(b+=' <mxCell id="'+d(he("rel"))+'" value="'+$h.value+'" style="'+d($h.style)+'" edge="1" parent="'+d(Oa.id)+'" source="'+d(Mi)+'" target="'+d(vi)+`">
-`+(Vd?` <mxGeometry relative="1" as="geometry">
-`+Vd+` </mxGeometry>
+`,za=za.replace(/(exit|entry)(X|Y|Dx|Dy)=[-0-9.]+;/g,"")}}}var Hu=P(ls,za),zl=ie("rel");if(Xt._cellId=zl,We!=null){var Yi=go(Xt);Xt.from===Xt.to?We.edge(zl,{loop:!0}):Xt._sameRank?We.edge(zl,{sameRank:!0}):Yi!=null&&gt[Yi.top]&&gt[Yi.bot]&&We.edge(zl,{top:gt[Yi.top],bot:gt[Yi.bot],labelW:ls?ha(ls)*11/fa:0,labelH:16})}if(F+=' <mxCell id="'+g(zl)+'" value="'+Hu.value+'" style="'+g(Hu.style)+'" edge="1" parent="'+g(ji.id)+'" source="'+g(Zs)+'" target="'+g(ii)+`">
+`+(Rf?` <mxGeometry relative="1" as="geometry">
+`+Rf+` </mxGeometry>
`:` <mxGeometry relative="1" as="geometry"/>
`)+` </mxCell>
-`,Xi&&(Ln.fromCardinality||Ln.toCardinality)){var gh="text;html=1;align=left;verticalAlign=middle;fillColor=none;strokeColor=none;fontSize=13;fontColor=#000000;";if(Ln.fromCardinality){var ic=xa(Ln.fromCardinality)*13/pl,Rh=_n.x+_n.w/2-ic-4,Ah=_n.y<En.y?_n.y+_n.h+4:_n.y-20,sc=ro(Rh,Ah,ic+4,16);b+=Ar(he("card"),Ln.fromCardinality,gh,Rh-sc.x,Ah-sc.y,ic+4,16,sc.id)}if(Ln.toCardinality){var uc=xa(Ln.toCardinality)*13/pl,mh=En.x+En.w/2-uc-4,kh=En.y>_n.y?En.y-20:En.y+En.h+4,fc=ro(mh,kh,uc+4,16);b+=Ar(he("card"),Ln.toCardinality,gh,mh-fc.x,kh-fc.y,uc+4,16,fc.id)}}}}}for(var dc=0;dc<Vt.length;dc++){var Vs=Vt[dc];if(Vs._midX!=null){var _h=pt[Vs.cls];if(_h){var cc=ro(Vs._midX-4,Vs._midY-4,8,8);b+=Ar(he("acdot"),"","ellipse;fillColor=#181818;strokeColor=#181818;",Vs._midX-4-cc.x,Vs._midY-4-cc.y,8,8,cc.id),b+=jr(he("aclink"),"","endArrow=none;dashed=1;dashPattern=5 5;strokeColor=#181818;html=1;",Vs._midX+4,Vs._midY,_h.x,Vs._midY,"1")}}}for(var Jf={},Vf=0;Vf<e.length;Vf++)Jf[e[Vf].id]=e[Vf];var Zu=tt,Qf=tt,ks;for(ks in pt)pt.hasOwnProperty(ks)&&pt[ks].y+pt[ks].h>Zu&&(Zu=pt[ks].y+pt[ks].h);for(ks in Pt)Pt.hasOwnProperty(ks)&&Pt[ks].y+Pt[ks].h>Zu&&(Zu=Pt[ks].y+Pt[ks].h);for(var ps=[],Ts=0;Ts<C.length;Ts++){var yl=C[Ts],Pa=yl.target?pt[yl.target]:null;if(yl.method&&Jf[yl.target]){for(var Oh=Jf[yl.target],rd=Oh.members||[],Fh=!1,Bf=0;Bf<rd.length;Bf++)if(rd[Bf].kind!=="separator"&&rd[Bf].name===yl.method){Fh=!Fr(Oh,rd[Bf].kind==="method"?"method":"field");break}if(Fh)continue}if(yl.legend){var ju=We(yl.lines||[]),hc=fo[Ts]?fo[Ts].x:Qf,Cc=fo[Ts]?fo[Ts].y:Zu+40;fo[Ts]||(Qf+=ju.w+30);var vc=ro(hc,Cc,ju.w,ju.h);b+=Tt(ju,hc-vc.x,Cc-vc.y,he,null,vc.id),ps.push({x:hc,y:Cc,w:ju.w,h:ju.h});continue}var bh=yo(yl),_s=bh.w,$s=bh.h,Ti=tt,Ii=tt,yh=yl.color?Y(yl.color.split(";")[0].split(/[\/\\|]/)[0]):null,Eh=function(cr){return yh?cr.replace(/fillColor=[^;]*;?/g,"")+"fillColor="+yh+";":cr},Dh=yl.stereotypes||[];if(yl.position==="link"){var Ou=yl._rel;if(!Ou||Ou._midX==null)continue;Ou._midVertical?(Ti=Math.round(Ou._midX+5),Ii=Math.round(Ou._midY-$s/2)):(Ti=Math.round(Ou._midX-_s/2),Ii=Math.round(Ou._midY-8-$s))}else Pa||(fo[Ts]?(Ti=fo[Ts].x,Ii=fo[Ts].y):(Ti=Qf,Ii=Zu+40,Qf+=_s+30));if(Pa&&yl.method){for(var Sh=Jf[yl.target],pc=Sh?rt(Sh):{fields:[],methods:[]},Bh=0,ed=0;ed<pc.methods.length;ed++)if(pc.methods[ed].name===yl.method){Bh=ed;break}var uv=oa+Me(pc.fields.length),fv=Pa.y+uv+Al+Bh*Ea;Ti=Pa.x+Pa.w+36,Ii=fv-$s/2}else if(Pa)switch(yl.position){case"left":Ti=Pa.x-_s-36,Ii=Pa.y+Pa.h/2-$s/2;break;case"right":Ti=Pa.x+Pa.w+36,Ii=Pa.y+Pa.h/2-$s/2;break;case"top":Ti=Pa.x+Pa.w/2-_s/2,Ii=Pa.y-$s-40;break;case"bottom":Ti=Pa.x+Pa.w/2-_s/2,Ii=Pa.y+Pa.h+40;break}var $c=he("note"),gc=ro(Ti,Ii,_s,$s),Th=P(yl.text||"",Eh(yr("shape=note;size=10;fillColor=#FEFFDD;strokeColor=#181818;fontSize=13;fontColor=#000000;whiteSpace=wrap;align=left;verticalAlign=middle;spacingLeft=4;",["note"],Dh)));b+=' <mxCell id="'+$c+'" value="'+Th.value+'" style="'+d(Th.style)+'" vertex="1" parent="'+d(gc.id)+`">
- <mxGeometry x="`+(Ti-gc.x)+'" y="'+(Ii-gc.y)+'" width="'+_s+'" height="'+$s+`" as="geometry"/>
+`,pi&&(Xt.fromCardinality||Xt.toCardinality)){var $i="text;html=1;align=left;verticalAlign=middle;fillColor=none;strokeColor=none;fontSize=13;fontColor=#000000;";if(Xt.fromCardinality){var Vi=ha(Xt.fromCardinality)*13/fa,Bs=Ln.x+Ln.w/2-Vi-4,js=Ln.y<Sn.y?Ln.y+Ln.h+4:Ln.y-20,Ku=Qn(Bs,js,Vi+4,16),sf=ie("card");We?.label(sf,zl,"source"),F+=Dr(sf,Xt.fromCardinality,$i,Bs-Ku.x,js-Ku.y,Vi+4,16,Ku.id)}if(Xt.toCardinality){var su=ha(Xt.toCardinality)*13/fa,Kh=Sn.x+Sn.w/2-su-4,zh=Sn.y>Ln.y?Sn.y-20:Sn.y+Sn.h+4,Uc=Qn(Kh,zh,su+4,16),Uh=ie("card");We?.label(Uh,zl,"target"),F+=Dr(Uh,Xt.toCardinality,$i,Kh-Uc.x,zh-Uc.y,su+4,16,Uc.id)}}}}for(var Wc=0;Wc<le.length;Wc++){var zu=le[Wc];if(zu._midX!=null){var Wh=To[zu.cls];if(Wh){var Xc=Qn(zu._midX-4,zu._midY-4,8,8);F+=Dr(ie("acdot"),"","ellipse;fillColor=#181818;strokeColor=#181818;",zu._midX-4-Xc.x,zu._midY-4-Xc.y,8,8,Xc.id),F+=Ze(ie("aclink"),"","endArrow=none;dashed=1;dashPattern=5 5;strokeColor=#181818;html=1;",zu._midX+4,zu._midY,Wh.x,zu._midY,"1")}}}for(var Wd={},Xd=0;Xd<e.length;Xd++)Wd[e[Xd].id]=e[Xd];var Wf=xt,qd=xt,uu;for(uu in To)To.hasOwnProperty(uu)&&To[uu].y+To[uu].h>Wf&&(Wf=To[uu].y+To[uu].h);for(uu in Xo)Xo.hasOwnProperty(uu)&&Xo[uu].y+Xo[uu].h>Wf&&(Wf=Xo[uu].y+Xo[uu].h);for(var Js=[],Au=0;Au<h.length;Au++){var vl=h[Au],Xa=vl.target?To[vl.target]:null;if(vl.method&&Wd[vl.target]){for(var Xh=Wd[vl.target],Zd=Xh.members||[],qh=!1,Ad=0;Ad<Zd.length;Ad++)if(Zd[Ad].kind!=="separator"&&Zd[Ad].name===vl.method){qh=!xr(Xh,Zd[Ad].kind==="method"?"method":"field");break}if(qh)continue}if(vl.legend){var Xf=qe(vl.lines||[]),qc=Qe[Au]?Qe[Au].x:qd,Zc=Qe[Au]?Qe[Au].y:Wf+40;Qe[Au]||(qd+=Xf.w+30);var jc=Qn(qc,Zc,Xf.w,Xf.h);F+=St(Xf,qc-jc.x,Zc-jc.y,ie,null,jc.id),Js.push({x:qc,y:Zc,w:Xf.w,h:Xf.h});continue}var Zh=Po(vl),fu=Zh.w,Vs=Zh.h,is=xt,ss=xt,jh=vl.color?Y(vl.color.split(";")[0].split(/[\/\\|]/)[0]):null,Jh=function(cr){return jh?cr.replace(/fillColor=[^;]*;?/g,"")+"fillColor="+jh+";":cr},Vh=vl.stereotypes||[];if(vl.position==="link"){var yf=vl._rel;if(!yf||yf._midX==null)continue;yf._midVertical?(is=Math.round(yf._midX+5),ss=Math.round(yf._midY-Vs/2)):(is=Math.round(yf._midX-fu/2),ss=Math.round(yf._midY-8-Vs))}else Xa||(Qe[Au]?(is=Qe[Au].x,ss=Qe[Au].y):(is=qd,ss=Wf+40,qd+=fu+30));if(Xa&&vl.method){for(var Qh=Wd[vl.target],Jc=Qh?Rt(Qh):{fields:[],methods:[]},rv=0,jd=0;jd<Jc.methods.length;jd++)if(Jc.methods[jd].name===vl.method){rv=jd;break}var bC=fn+et(Jc.fields.length),FC=Xa.y+bC+xa+rv*ua;is=Xa.x+Xa.w+36,ss=FC-Vs/2}else if(Xa)switch(vl.position){case"left":is=Xa.x-fu-36,ss=Xa.y+Xa.h/2-Vs/2;break;case"right":is=Xa.x+Xa.w+36,ss=Xa.y+Xa.h/2-Vs/2;break;case"top":is=Xa.x+Xa.w/2-fu/2,ss=Xa.y-Vs-40;break;case"bottom":is=Xa.x+Xa.w/2-fu/2,ss=Xa.y+Xa.h+40;break}var Uu=ie("note"),Vc=Qn(is,ss,fu,Vs),ev=P(vl.text||"",Jh(wr("shape=note;size=10;fillColor=#FEFFDD;strokeColor=#181818;fontSize=13;fontColor=#000000;whiteSpace=wrap;align=left;verticalAlign=middle;spacingLeft=4;",["note"],Vh)));F+=' <mxCell id="'+Uu+'" value="'+ev.value+'" style="'+g(ev.style)+'" vertex="1" parent="'+g(Vc.id)+`">
+ <mxGeometry x="`+(is-Vc.x)+'" y="'+(ss-Vc.y)+'" width="'+fu+'" height="'+Vs+`" as="geometry"/>
</mxCell>
-`,ps.push({x:Ti,y:Ii,w:_s,h:$s});var Rc=yl.targets&&yl.targets.length?yl.targets:[yl.target];if(yl.id)for(var od=0;od<Rc.length;od++)oo[Rc[od]]&&(b+=vr(he("noteln"),"","endArrow=none;dashed=1;html=1;strokeColor=#181818;",$c,oo[Rc[od]],"1"));else if(Pa&&oo[yl.target]){var td=Eh(yr("shape=triangle;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;",["note"],Dh)),Ih=Math.round(Ii+$s/2),Nh=Math.round(Math.min(Math.max(Ti+_s/2,Pa.x+8),Pa.x+Pa.w-8)),Ac=yl.method?"right":yl.position,us=null;if(Ac==="left"&&Ti+_s<=Pa.x?us=[td+"direction=east;",Ti+_s-1,Ih-4,Math.max(6,Pa.x-(Ti+_s)+1),8]:Ac==="top"&&Ii+$s<=Pa.y?us=[td+"direction=south;",Nh-4,Ii+$s-1,8,Math.max(6,Pa.y-(Ii+$s)+1)]:Ac==="bottom"&&Ii>=Pa.y+Pa.h?us=[td+"direction=north;",Nh-4,Pa.y+Pa.h,8,Math.max(6,Ii-(Pa.y+Pa.h)+1)]:Ti>=Pa.x+Pa.w&&(us=[td+"direction=west;",Pa.x+Pa.w,Ih-4,Math.max(6,Ti-(Pa.x+Pa.w)+1),8]),us){var mc=ro(Math.round(us[1]),Math.round(us[2]),Math.round(us[3]),Math.round(us[4]));b+=Ar(he("noteptr"),"",us[0],Math.round(us[1])-mc.x,Math.round(us[2])-mc.y,Math.round(us[3]),Math.round(us[4]),mc.id)}else b+=vr(he("noteln"),"","endArrow=none;dashed=1;html=1;strokeColor=#181818;",$c,oo[yl.target],"1")}}if(r.legend&&r.legend.lines&&r.legend.lines.length){var nd=it||We(r.legend.lines),xs=1/0,Qs=-1/0,uu=-1/0,Fu;for(Fu in pt)if(pt.hasOwnProperty(Fu)){var Hs=pt[Fu];Hs.x<xs&&(xs=Hs.x),Hs.x+Hs.w>Qs&&(Qs=Hs.x+Hs.w),Hs.y+Hs.h>uu&&(uu=Hs.y+Hs.h)}for(Fu in Pt)if(!(!Pt.hasOwnProperty(Fu)||!Pt[Fu])){var Ks=Pt[Fu];Ks.x<xs&&(xs=Ks.x),Ks.x+Ks.w>Qs&&(Qs=Ks.x+Ks.w),Ks.y+Ks.h>uu&&(uu=Ks.y+Ks.h)}for(var Os=0;Os<ps.length;Os++)ps[Os].x<xs&&(xs=ps[Os].x),ps[Os].x+ps[Os].w>Qs&&(Qs=ps[Os].x+ps[Os].w),ps[Os].y+ps[Os].h>uu&&(uu=ps[Os].y+ps[Os].h);xs===1/0&&(xs=tt,Qs=tt+nd.w,uu=tt+Gt);var dv=r.legend.position==="left"?xs+5:r.legend.position==="right"?Qs-4-nd.w:(xs+Qs)/2-nd.w/2,cv=it?tt+ae+2:uu+21;b+=Tt(nd,Math.round(Math.max(tt,dv)),Math.round(cv),he)}var zs="",ad=[];function Lh(cr){for(var Ue=0,Bo=Vr[cr],Lo=l.length+1;Bo!==void 0&&Lo-- >0;)Ue++,Bo=Vr[Bo];return Ue}for(var ld=0;ld<l.length;ld++)Pt[ld]&&ad.push(ld);ad.sort(function(cr,Ue){return Lh(cr)-Lh(Ue)||cr-Ue});for(var kc=0;kc<ad.length;kc++){var id=ad[kc],Is=l[id],_i=Pt[id],Us=ra[id]||he("pkg"),fu=Xt(Vr[id]),Ju=_i.x-fu.x,Vu=_i.y-fu.y,Tf=(Is.stereotype||"").toLowerCase(),Qu="container=1;collapsible=0;";tr=Is.stereotype?[Is.stereotype]:[];var _c="text;html=1;fillColor=none;strokeColor=none;fontColor=#000000;fontSize=14;align=center;verticalAlign=middle;";if(Tf==="node"){zs+=Ar(Us,"","shape=cube;size=10;fillColor=none;strokeColor=#000000;"+Qu,Ju,Vu,_i.w,_i.h,fu.id),zs+=Ar(he("pkgl"),Is.name,_c,0,15,_i.w-10,20,Us);continue}if(Tf==="rectangle"){zs+=Ar(Us,Is.name,"rounded=0;fillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacingLeft=6;spacingTop=2;"+Qu,Ju,Vu,_i.w,_i.h,fu.id);continue}if(Tf==="cloud"){zs+=Ar(Us,"","shape=mxgraph.basic.cloud_rect;fillColor=none;strokeColor=#000000;"+Qu,Ju,Vu,_i.w,_i.h,fu.id),zs+=Ar(he("pkgl"),Is.name,_c,0,12,_i.w,20,Us);continue}if(Tf==="database"){zs+=Ar(Us,"","shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;fillColor=none;strokeColor=#000000;"+Qu,Ju,Vu,_i.w,_i.h,fu.id),zs+=Ar(he("pkgl"),Is.name,_c,0,24,_i.w,20,Us);continue}if(Tf==="frame"){var Oc=Math.round(Math.min(_i.w,xa(Is.name)+22));Oc<30&&(Oc=30);var Gh=fr(Us,"shape=umlFrame;width="+Oc+";height="+rl+";html=1;fillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=middle;spacingLeft=4;"+Qu),wh=/(?:^|;)fillColor=([^;]+);/.exec(Gh);zs+=$(Us,Is.name,Gh+"swimlaneFillColor="+(wh?wh[1]:"none")+";",Ju,Vu,_i.w,_i.h,fu.id);continue}var Fc=Math.round(Math.min(_i.w,xa(Is.name)+20));Fc<30&&(Fc=30),zs+=Ar(Us,Is.name,"shape=folder;tabWidth="+Fc+";tabHeight="+rl+";tabPosition=left;html=1;fillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacingLeft=6;spacingTop=1;"+Qu,Ju,Vu,_i.w,_i.h,fu.id)}return zs+b}function Oi(r,a){var e="";return r.visibility&&!a&&(e+=r.visibility+" "),r.text!=null?e+=r.text:(e+=r.name,r.kind==="method"?(r.params!==null&&r.params!==void 0&&(e+="("+r.params+")"),r.returnType&&(e+=": "+r.returnType)):r.type&&(e+=": "+r.type)),e.replace(/<<\s*([^<>]*?)\s*>>/g,"\xAB$1\xBB")}function Vl(r){return is(r,14,!1)}var gi=140,el=36,$a=20,li=40,wl=30,Xa=20,Ql=24,Ll=40,Dl=28,qa=24,pi=10,Fi=12,bi=80,Ki=6,ts=8,di=15,ns=18,Vi=10;function cu(r,a){var e=0;function h(we){return(we||"act")+"_"+e++}function l(we,Eo,Et){var Cr=H(ce,de(we),Eo||[],"text"),Lr=Cr.fontSize?parseInt(Cr.fontSize,10):0;return Lr>0?Lr:Et}function C(we,Eo){for(var Et=l(["activity"],Eo,12),Cr={size:Et,bold:!1,italic:!1,family:"sans",name:"SansSerif"},Lr=String(we??"").replace(/\\r\\n|\\n|\\r/g,`
+`,Js.push({x:is,y:ss,w:fu,h:Vs}),We!=null&&(vl.position==="link"?vl._rel!=null&&vl._rel._cellId!=null&&We.linkNote(Uu,vl._rel._cellId,"right"):(We.node(Uu),Xa&&gt[vl.target]&&We.attach(Uu,gt[vl.target],vl.method?"right":vl.position)));var Jd=vl.targets&&vl.targets.length?vl.targets:[vl.target];if(vl.id){for(var md=0;md<Jd.length;md++)if(gt[Jd[md]]){var ov=ie("noteln");We?.edge(ov,{top:Uu,bot:gt[Jd[md]]}),F+=mr(ov,"","endArrow=none;dashed=1;html=1;strokeColor=#181818;",Uu,gt[Jd[md]],"1")}}else if(Xa&&gt[vl.target]){var Vd=Jh(wr("shape=triangle;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;",["note"],Vh)),tv=Math.round(ss+Vs/2),nv=Math.round(Math.min(Math.max(is+fu/2,Xa.x+8),Xa.x+Xa.w-8)),Qc=vl.method?"right":vl.position,Ks=null;if(Qc==="left"&&is+fu<=Xa.x?Ks=[Vd+"direction=east;",is+fu-1,tv-4,Math.max(6,Xa.x-(is+fu)+1),8]:Qc==="top"&&ss+Vs<=Xa.y?Ks=[Vd+"direction=south;",nv-4,ss+Vs-1,8,Math.max(6,Xa.y-(ss+Vs)+1)]:Qc==="bottom"&&ss>=Xa.y+Xa.h?Ks=[Vd+"direction=north;",nv-4,Xa.y+Xa.h,8,Math.max(6,ss-(Xa.y+Xa.h)+1)]:is>=Xa.x+Xa.w&&(Ks=[Vd+"direction=west;",Xa.x+Xa.w,tv-4,Math.max(6,is-(Xa.x+Xa.w)+1),8]),Ks){var rh=Qn(Math.round(Ks[1]),Math.round(Ks[2]),Math.round(Ks[3]),Math.round(Ks[4])),av=ie("noteptr");We?.follow(av,Uu),F+=Dr(av,"",Ks[0],Math.round(Ks[1])-rh.x,Math.round(Ks[2])-rh.y,Math.round(Ks[3]),Math.round(Ks[4]),rh.id)}else{var lv=ie("noteln");We?.edge(lv,{top:Uu,bot:gt[vl.target]}),F+=mr(lv,"","endArrow=none;dashed=1;html=1;strokeColor=#181818;",Uu,gt[vl.target],"1")}}}if(r.legend&&r.legend.lines&&r.legend.lines.length){var Qd=Uo||qe(r.legend.lines),Du=1/0,Wu=-1/0,uf=-1/0,bf;for(bf in To)if(To.hasOwnProperty(bf)){var Tu=To[bf];Tu.x<Du&&(Du=Tu.x),Tu.x+Tu.w>Wu&&(Wu=Tu.x+Tu.w),Tu.y+Tu.h>uf&&(uf=Tu.y+Tu.h)}for(bf in Xo)if(!(!Xo.hasOwnProperty(bf)||!Xo[bf])){var Bu=Xo[bf];Bu.x<Du&&(Du=Bu.x),Bu.x+Bu.w>Wu&&(Wu=Bu.x+Bu.w),Bu.y+Bu.h>uf&&(uf=Bu.y+Bu.h)}for(var du=0;du<Js.length;du++)Js[du].x<Du&&(Du=Js[du].x),Js[du].x+Js[du].w>Wu&&(Wu=Js[du].x+Js[du].w),Js[du].y+Js[du].h>uf&&(uf=Js[du].y+Js[du].h);Du===1/0&&(Du=xt,Wu=xt+Qd.w,uf=xt+xn);var EC=r.legend.position==="left"?Du+5:r.legend.position==="right"?Wu-4-Qd.w:(Du+Wu)/2-Qd.w/2,SC=Uo?xt+Zt+2:uf+21;yo=[],F+=St(Qd,Math.round(Math.max(xt,EC)),Math.round(SC),ie),We!=null&&!Uo&&We.floating(yo,"below",r.legend.position==="left"?"left":r.legend.position==="right"?"right":"center"),yo=null}var Iu="",rc=[];function iv(cr){for(var je=0,Yo=yr[cr],Zo=i.length+1;Yo!==void 0&&Zo-- >0;)je++,Yo=yr[Yo];return je}for(var ec=0;ec<i.length;ec++)Xo[ec]&&rc.push(ec);rc.sort(function(cr,je){return iv(cr)-iv(je)||cr-je});for(var eh=0;eh<rc.length;eh++){var oc=rc[eh],mu=i[oc],Qi=Xo[oc],Nu=Xn[oc]||ie("pkg"),ff=ge(yr[oc]),qf=Qi.x-ff.x,Zf=Qi.y-ff.y,kd=(mu.stereotype||"").toLowerCase(),jf="container=1;collapsible=0;";nr=mu.stereotype?[mu.stereotype]:[];var oh="text;html=1;fillColor=none;strokeColor=none;fontColor=#000000;fontSize=14;align=center;verticalAlign=middle;";if(kd==="node"){Iu+=Dr(Nu,"","shape=cube;size=10;fillColor=none;strokeColor=#000000;"+jf,qf,Zf,Qi.w,Qi.h,ff.id),Iu+=Dr(pe(ie("pkgl")),mu.name,oh,0,15,Qi.w-10,20,Nu);continue}if(kd==="rectangle"){Iu+=Dr(Nu,mu.name,"rounded=0;fillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacingLeft=6;spacingTop=2;"+jf,qf,Zf,Qi.w,Qi.h,ff.id);continue}if(kd==="cloud"){Iu+=Dr(Nu,"","shape=mxgraph.basic.cloud_rect;fillColor=none;strokeColor=#000000;"+jf,qf,Zf,Qi.w,Qi.h,ff.id),Iu+=Dr(pe(ie("pkgl")),mu.name,oh,0,12,Qi.w,20,Nu);continue}if(kd==="database"){Iu+=Dr(Nu,"","shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;fillColor=none;strokeColor=#000000;"+jf,qf,Zf,Qi.w,Qi.h,ff.id),Iu+=Dr(pe(ie("pkgl")),mu.name,oh,0,24,Qi.w,20,Nu);continue}if(kd==="frame"){var th=Math.round(Math.min(Qi.w,ha(mu.name)+22));th<30&&(th=30);var sv=pr(Nu,"shape=umlFrame;width="+th+";height="+Rl+";html=1;fillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=middle;spacingLeft=4;"+jf),uv=/(?:^|;)fillColor=([^;]+);/.exec(sv);Iu+=m(Nu,mu.name,sv+"swimlaneFillColor="+(uv?uv[1]:"none")+";",qf,Zf,Qi.w,Qi.h,ff.id);continue}var nh=Math.round(Math.min(Qi.w,ha(mu.name)+20));nh<30&&(nh=30),Iu+=Dr(Nu,mu.name,"shape=folder;tabWidth="+nh+";tabHeight="+Rl+";tabPosition=left;html=1;fillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacingLeft=6;spacingTop=1;"+jf,qf,Zf,Qi.w,Qi.h,ff.id)}return Iu+F}function mi(r,l){var e="";return r.visibility&&!l&&(e+=r.visibility+" "),r.text!=null?e+=r.text:(e+=r.name,r.kind==="method"?(r.params!==null&&r.params!==void 0&&(e+="("+r.params+")"),r.returnType&&(e+=": "+r.returnType)):r.type&&(e+=": "+r.type)),e.replace(/<<\s*([^<>]*?)\s*>>/g,"\xAB$1\xBB")}function Mi(r){return Ss(r,14,!1)}var qa=140,Ni=36,on=20,yi=40,xl=30,ul=20,Fl=24,di=40,fl=28,ol=24,Al=10,Jl=12,ki=80,Di=6,bi=8,ti=15,Hi=18,Lu=10;function Qs(r,l){var e=0;function c($r){return($r||"act")+"_"+e++}function i($r,ee,Rr){var tr=U(Ze,Pr($r),ee||[],"text"),vr=tr.fontSize?parseInt(tr.fontSize,10):0;return vr>0?vr:Rr}function h($r,ee){for(var Rr=i(["activity"],ee,12),tr={size:Rr,bold:!1,italic:!1,family:"sans",name:"SansSerif"},vr=String($r??"").replace(/\\r\\n|\\n|\\r/g,`
`).replace(/(^|\n)\s*[*#]+\s+/g,"$1\u2022 ").split(`
-`),He=0,Ie=0;Ie<Lr.length;Ie++){var Oe=Uf(Lr[Ie],Cr);Oe>He&&(He=Oe)}return Math.max(30,Math.round(He+20))}function b(we){var Eo=l(["activity","diamond"],[],11);return Math.max(Ll,Math.round(is(we||"",Eo,!1)+24))}var Z=13,v=15.3,er=20,X=10,V="stencil(jVHRDoIwDPyavZqNhvgBiE/+RHVVFmEj2wT9e7eUoJCQ8HZ3vbXXTkAVGuxJFNJiRwJOoiiCbi8OdUJJbliDkunIVCnJHENPt8jigN7gtSWuhOjdk0aj49TC2Ia8ibkKtYDq7jw9vHtZzbzH7Myoc0NO9OZ30+QPM557ZmNr7J9RLozqeCi3vcumsHAm8MvCa8y1rZBK7o45325X0HXj/VETWJ84SfzdUH8B)";function tr(we){for(var Eo=(we.text||"").split(`
-`),Et=0,Cr=0;Cr<Eo.length;Cr++){var Lr=Vl(Eo[Cr])*(Z/14);Lr>Et&&(Et=Lr)}return{w:Math.max(30,Math.round(Et+21)),h:Math.round(Eo.length*v+10)}}function wr(we,Eo,Et){var Cr=we.length===1,Lr={left:[],right:[]},He=["left","right"],Ie={left:0,right:0},Oe={left:0,right:0},so,Xo;for(so=0;so<we.length;so++){var qo=tr(we[so]);Xo=we[so].position==="right"?"right":"left",Lr[Xo].push({node:we[so],w:qo.w,h:qo.h}),Ie[Xo]+=qo.h+(Cr?0:2*X),qo.w>Oe[Xo]&&(Oe[Xo]=qo.w)}var Yn=Math.max(Et,Ie.left,Ie.right),Nt=[];for(so=0;so<2;so++){Xo=He[so];for(var Da=(Yn-Ie[Xo])/2,je=Cr?0:X,_r=Cr?er:X,Ho=0;Ho<Lr[Xo].length;Ho++){var Ce=Lr[Xo][Ho],ln=Xo==="left"?-_r-Ce.w-(Oe.left-Ce.w)/2:Eo+_r+(Oe.right-Ce.w)/2;Nt.push({node:Ce.node,side:Xo,w:Ce.w,h:Ce.h,dx:Math.round(ln),dy:Math.round(Da+je),pointer:Cr&&!Ce.node.floating}),Da+=Ce.h+2*je}}return{totalH:Yn,actDy:Math.round((Yn-Et)/2),notes:Nt}}function yr(we){return Fr("shape=note;size=10;fillColor="+(Y(we.color)||"#FEFFDD")+";strokeColor=#181818;strokeWidth=0.5;fontSize="+Z+";fontColor=#000000;whiteSpace=wrap;align=left;verticalAlign=middle;spacingLeft=4;",["note"],Ir(we),"vertex",we.color?Nr:null)}function fr(we){if(!we||!we.length)return Ll;for(var Eo=Ll,Et=0;Et<we.length;Et++){var Cr=we[Et],Lr=Ll;if(Cr.type==="action")Lr=C(Cr.label||"",Ir(Cr))+(Cr.shape==="input"||Cr.shape==="output"?10:0);else if(Cr.type==="if"){var He=fr(Cr.elseBranch);if(Cr.elseIfBranches)for(var Ie=0;Ie<Cr.elseIfBranches.length;Ie++){var Oe=fr(Cr.elseIfBranches[Ie].body);Oe>He&&(He=Oe)}Lr=fr(Cr.thenBranch)+32+He}else if(Cr.type==="while"||Cr.type==="repeat"){if(Lr=fr(Cr.body)+gi/2,Cr.type==="repeat"){if(Cr.label){var so=C(Cr.label)+gi/2;so>Lr&&(Lr=so)}Cr.backward&&(Lr+=C(Cr.backward.label||""))}}else Cr.type==="switch"?Lr=(Cr.cases?Cr.cases.length:1)*(gi+li):(Cr.type==="fork"||Cr.type==="split")&&(Lr=(Cr.branches?Cr.branches.length:1)*(gi+li));Lr>Eo&&(Eo=Lr)}return Eo}var Ar="#F1F1F1",jr=r.arrowHeadColor==="none"||r.arrowHeadColor==="transparent"?"endArrow=none;":"endArrow=classic;endSize=8;",ce=r.styleSheet||null,Nr=["fillColor","gradientColor"];function de(we){return["root","element","activityDiagram"].concat(we)}function Fr(we,Eo,Et,Cr,Lr){return W(we,ce,de(Eo),Et||[],Cr||"vertex",Lr)}function Ir(we){return we.stereotypes||(we.stereotype?[we.stereotype]:[])}function qe(){var we=H(ce,de(["activityBar"]),[],"vertex");return we.fillColor!=null&&we.strokeColor==null&&(we.strokeColor=we.fillColor),M("shape=rectangle;fillColor=#555555;strokeColor=#555555;",we)}var To=H(ce,de(["arrow"]),[],"edge"),ne=function(we,Eo,Et,Cr,Lr,He,Ie,Oe){return B(we,Eo,M(Et,To),Cr,Lr,He,Ie,Oe)},po="endArrow=none;startArrow=none;strokeColor=none;",ao=function(we,Eo,Et,Cr,Lr,He,Ie,Oe){return B(we,Eo,M(Et,To)+po,Cr,Lr,He,Ie,Oe)},A="",J=wl+gi/2,ur=wl,Sr=[];function Er(){return Sr.push([]),Sr[Sr.length-1]}function qr(){return Sr.pop()}function z(we,Eo,Et,Cr){for(var Lr="",He=0;He<we.length;He++){var Ie=Math.min(we[He].y+10,Et),Oe="endArrow=none;strokeColor=#181818;";Lr+=ne(h("e"),"",Oe,we[He].x,we[He].y,we[He].x,Ie,Cr),Lr+=ne(h("e"),"",Oe,we[He].x,Ie,Eo,Ie,Cr)}return Lr}function Mr(we){if(we==null)return"";var Eo="",Et=we.color?Y(we.color):null;return Et&&(Eo+="strokeColor="+Et+";"),we.dashed?Eo+="dashed=1;dashPattern=7 7;strokeWidth=1.5;":we.dotted&&(Eo+="dashed=1;dashPattern=1 3;strokeWidth=1.5;"),we.bold?Eo+="strokeWidth=2;":we.thickness>0&&(Eo+="strokeWidth="+we.thickness+";"),Eo}function Be(we,Eo,Et){var Cr=Eo,Lr=Et,He=null,Ie=Lr,Oe=Cr,so=Cr+gi/2,Xo=null;function qo(ul,ti,fl,jl,Si){var Zi="endArrow=none;strokeColor=#181818;",ku=!1;if(ul===null){var iu=Mr(Xo);ku=!!(Xo&&Xo.hidden),ul=Xo?Xo.label:"",ti+=iu,Zi+=iu,Xo=null}if(ku)return ul?ao(h("e"),ul,ti,Oe,Ie,fl,jl,Si):"";if(Oe===fl)return ne(h("e"),ul,ti,fl,Ie,fl,jl,Si);var Bs=jl-di>=Ie+5?jl-di:Math.round((Ie+jl)/2);return ne(h("e"),"",Zi,Oe,Ie,Oe,Bs,Si)+ne(h("e"),"",Zi,Oe,Bs,fl,Bs,Si)+ne(h("e"),ul,ti,fl,Bs,fl,jl,Si)}function Yn(ul,ti,fl,jl,Si,Zi,ku,iu){var Bs=ul&&ul.length>0?ul[0]:null;return Bs&&Bs.type==="arrowLabel"&&Bs.hidden?ti?ao(h("e"),ti,fl,jl,Si,Zi,ku,iu):"":ne(h("e"),ti,fl,jl,Si,Zi,ku,iu)}function Nt(ul,ti,fl){var jl=h("rail");return A+=s(jl,"",M("shape=line;strokeColor=#181818;strokeWidth=1;fillColor=none;",To),ul,fl-ts/2,ti-ul,ts,"1"),jl}function Da(ul,ti,fl,jl){var Si=qa/2,Zi=jl+Si;return Math.abs(ul-fl)<=1?ne(h("e"),"",jr+"strokeColor=#181818;",ul,ti,fl,jl,"1"):ne(h("e"),"","endArrow=none;strokeColor=#181818;",ul,ti,ul,Zi,"1")+ne(h("e"),"",jr+"strokeColor=#181818;",ul,Zi,ul<fl?fl-Si:fl+Si,Zi,"1")}for(var je=0;je<we.length;je++){var _r=we[je],Ho=h(_r.type);switch(_r.type){case"start":{var Ce=Y(_r.color)||"#222222",ln=Y(_r.lineColor)||Ce;A+=s(Ho,"",Fr("ellipse;fillColor="+Ce+";strokeColor="+ln+";",["circle","start"],null,"vertex",_r.color?Nr:null),Cr-Xa/2,Lr,Xa,Xa,"1"),He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Lr,"1")),He=Ho,Oe=Cr,Ie=Lr+Xa,Lr+=Xa+$a;break}case"stop":{A+=s(Ho,"",Fr("ellipse;shape=endState;fillColor=#222222;strokeColor=#222222;",["circle","stop"]),Cr-Ql/2,Lr,Ql,Ql,"1"),He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Lr,"1")),He=Ho,Oe=Cr,Ie=Lr+Ql,Lr+=Ql+$a;break}case"end":{A+=s(Ho,"",Fr("ellipse;fillColor=#222222;strokeColor=#222222;",["circle","end"]),Cr-Xa/2,Lr,Xa,Xa,"1"),He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Lr,"1")),He=Ho,Oe=Cr,Ie=Lr+Xa,Lr+=Xa+$a;break}case"action":{for(var nt=Y(_r.color)||"#F1F1F1",wo=_r.label||"",xn=wo.split(`
-`),Lt=C(wo,Ir(_r)),Ft=Math.max(el,Math.round(20+xn.length*16.3)),fe=_r.shape||null,ge=Lt+(fe==="input"||fe==="output"?10:0),qt=[];je+1<we.length&&we[je+1].type==="note";)qt.push(we[++je]);var et=qt.length?wr(qt,ge,Ft):null,en=Lr+(et?et.actDy:0),Zt=Cr-Lt/2,qn="fillColor="+nt+";strokeColor=#181818;strokeWidth=0.5;whiteSpace=wrap;fontSize=12;align=left;spacingLeft=6;",Ko;if(fe==="input"||fe==="output"){var Hn=Math.round(1e4*(1-10/ge))/1e4;Ko="shape=mxgraph.basic.polygon;polyline=0;polyCoords="+(fe==="input"?"[[0,0],[1,0],["+Hn+",0.5],[1,1],[0,1]]":"[[0,0],["+Hn+",0],[1,0.5],["+Hn+",1],[0,1]]")+";"+qn}else fe==="procedure"?Ko="shape=process;size=5;fixedSize=1;"+qn:fe==="save"?Ko="shape=parallelogram;size=10;fixedSize=1;"+qn:fe==="load"?Ko="shape=parallelogram;size=10;fixedSize=1;flipH=1;"+qn:fe==="task"?Ko="rounded=0;"+qn:fe==="continuous"?Ko="shape="+V+";"+qn:Ko="rounded=1;absoluteArcSize=1;arcSize=25;"+qn;if(Ko=Fr(Ko,["activity"],Ir(_r),"vertex",_r.color?Nr:null),f(wo)?A+=K(Ho,O(wo),Ko+"html=1;",Zt,en,ge,Ft,"1"):A+=s(Ho,wo,Ko,Zt,en,ge,Ft,"1"),He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,en,"1")),et)for(var aa=0;aa<et.notes.length;aa++){var Je=et.notes[aa],sn=h("note");if(Je.pointer){var Bn=Je.side==="left"?Zt+Je.dx+Je.w-1:Zt+ge;A+=s(h("noteptr"),"",Fr("triangle;direction="+(Je.side==="left"?"east":"west")+";fillColor="+(Y(Je.node.color)||"#FEFFDD")+";strokeColor=#181818;strokeWidth=0.5;",["note"],Ir(Je.node),"vertex",Je.node.color?Nr:null),Bn,Math.round(Lr+Je.dy+Je.h/2-4),er+1,8,"1")}A+=s(sn,Je.node.text||"",yr(Je.node),Zt+Je.dx,Lr+Je.dy,Je.w,Je.h,"1"),Zt+Je.dx+Je.w>so&&(so=Zt+Je.dx+Je.w)}He=Ho,Oe=Cr,Ie=en+Ft,Lr+=(et?et.totalH:Ft)+$a;break}case"if":{let ul=function(ti){if(!ti||ti.length===0)return!1;var fl=ti[ti.length-1];return fl.type==="break"?Sr.length>0:fl.type==="stop"||fl.type==="end"||fl.type==="kill"||fl.type==="detach"||fl.type==="goto"};if(_r.elseIfBranches&&_r.elseIfBranches.length>0){let ti=function(fl){if(!fl||fl.length===0)return!1;var jl=fl[fl.length-1];return jl.type==="stop"||jl.type==="end"||jl.type==="kill"||jl.type==="detach"||jl.type==="goto"};for(var $t=[{condition:_r.condition,thenLabel:_r.thenLabel,body:_r.thenBranch||[]}],mo=0;mo<_r.elseIfBranches.length;mo++)$t.push(_r.elseIfBranches[mo]);var Pt=Lr,ra=Pt+Dl/2,Ut=Pt+Dl+$a,Wn=42,yt=[],Zn=[];for(mo=0;mo<$t.length;mo++){var on=b($t[mo].condition);yt.push(on),Zn.push(Math.max(on,fr($t[mo].body)))}var va=[],ga=Cr;for(mo=0;mo<$t.length;mo++)mo>0&&(ga+=Zn[mo-1]/2+Wn+Zn[mo]/2),va.push(ga);var jn=_r.elseBranch&&_r.elseBranch.length>0,Fn=jn?Math.max(fr(_r.elseBranch),60):0,Mn=ga+Zn[$t.length-1]/2+Wn+Fn/2;He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Pt,"1"));var la=[],Tn=[],gt=[],Rt=[],Jt=Ut;for(mo=0;mo<$t.length;mo++){var ct=$t[mo],wn=va[mo];A+=s(h("diamond"),ct.condition||"",Fr("shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+Ar+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"]),wn-yt[mo]/2,Pt,yt[mo],Dl,"1"),mo>0&&(A+=ne(h("e"),"",jr+"strokeColor=#181818;",va[mo-1]+yt[mo-1]/2,ra,wn-yt[mo]/2,ra,"1")),A+=ne(h("e"),ct.thenLabel||"",jr+"strokeColor=#181818;fontSize=11;",wn,Pt+Dl,wn,Ut,"1");var In=Ut,ko=null;ct.body&&ct.body.length>0&&(ko=Be(ct.body,wn,Ut),In=ko.prevY||ko.y,ko.maxX>so&&(so=ko.maxX)),la.push(ko!=null?ko.prevX:wn),Tn.push(In),gt.push(ko!=null?ko.lastId:null),Rt.push(!ti(ct.body)),In>Jt&&(Jt=In),wn+Zn[mo]/2>so&&(so=wn+Zn[mo]/2)}if(jn){A+=ne(h("e"),_r.elseLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",va[$t.length-1]+yt[$t.length-1]/2,ra,Mn,ra,"1"),A+=ne(h("e"),"",jr+"strokeColor=#181818;",Mn,ra,Mn,Ut,"1");var Do=Be(_r.elseBranch,Mn,Ut),Rr=Do.prevY||Do.y;Do.maxX>so&&(so=Do.maxX),Mn+Fn/2>so&&(so=Mn+Fn/2),la.push(Do.prevX),Tn.push(Rr),gt.push(Do.lastId),Rt.push(!ti(_r.elseBranch)),Rr>Jt&&(Jt=Rr)}var xr=Jt+$a,br=1/0,Br=-1/0,Pr=0,Xe=-1;for(mo=0;mo<la.length;mo++)Rt[mo]&&(Pr++,Xe=mo,la[mo]<br&&(br=la[mo]),la[mo]>Br&&(Br=la[mo]));if(Pr>1){var zr=Nt(br,Br,xr);for(mo=0;mo<la.length;mo++)Rt[mo]&&(A+=ne(h("e"),"",jr+"strokeColor=#181818;",la[mo],Tn[mo],la[mo],xr,"1"));Cr=Math.round((br+Br)/2),He=zr,Oe=Cr,Ie=xr,Lr=xr+$a}else Pr===1?(Cr=la[Xe],He=gt[Xe]||He,Oe=la[Xe],Ie=Tn[Xe],Lr=Jt+$a):(He=null,Lr=Jt+$a);break}var Ke=h("diamond"),De=b(_r.condition);A+=s(Ke,_r.condition||"",Fr("shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+Ar+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"]),Cr-De/2,Lr,De,Dl,"1"),He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Lr,"1"));var ze=Lr+Dl/2,So=Lr+Dl+$a,ot=[];if(_r.elseIfBranches&&_r.elseIfBranches.length>0)for(var ve=0;ve<_r.elseIfBranches.length;ve++)for(var Yt=0;Yt<_r.elseIfBranches[ve].body.length;Yt++)ot.push(_r.elseIfBranches[ve].body[Yt]);if(_r.elseBranch)for(var At=0;At<_r.elseBranch.length;At++)ot.push(_r.elseBranch[At]);var ht=ot.length>0,Vt=fr(_r.thenBranch),Pn=fr(ot),Ae=32,Fe=ht?Math.round(Cr-(Ae/2+Vt/2)):Cr,le=Math.round(Cr+(Ae/2+Pn/2)),Ne=So,Qe=So,tn=Fe,Vo=!1;if(A+=Yn(_r.thenBranch,_r.thenLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",Cr-De/2,ze,Fe,ze,"1"),A+=Yn(_r.thenBranch,"",jr+"strokeColor=#181818;",Fe,ze,Fe,So,"1"),_r.thenBranch&&_r.thenBranch.length>0){var xo=Be(_r.thenBranch,Fe,So);Ne=xo.prevY||xo.y,tn=xo.prevX,Qe=Math.max(Ne,xo.y-$a),Vo=!0,xo.maxX>so&&(so=xo.maxX)}var Co=So,mn=So,pn=le,hn=!1;if(ht){A+=Yn(ot,_r.elseLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",Cr+De/2,ze,le,ze,"1"),A+=Yn(ot,"",jr+"strokeColor=#181818;",le,ze,le,So,"1");var Dt=Be(ot,le,So);Co=Dt.prevY||Dt.y,pn=Dt.prevX,mn=Math.max(Co,Dt.y-$a),hn=!0,Dt.maxX>so&&(so=Dt.maxX),le+Pn/2>so&&(so=le+Pn/2)}var ca=!Vo||!ul(_r.thenBranch),ea=!hn||!ul(ot),me=(ca?1:0)+(ea?1:0);if(me===1&&(Vo||hn)){He=(ca?Vo?xo.lastId:null:hn?Dt.lastId:null)||Ke,Oe=ca?tn:pn,Ie=ca?Ne:Co,Lr=Math.max(Qe,mn)+$a;break}Lr=Math.max(Qe,mn)+$a;var ie=h("merge"),pe=qa/2;A+=s(ie,"",Fr("rhombus;fillColor="+Ar+";strokeColor=#181818;",["activity","diamond"]),Cr-pe,Lr,qa,qa,"1"),Vo&&ca&&(A+=Da(tn,Ne,Cr,Lr)),hn&&ea&&(A+=Da(pn,Co,Cr,Lr)),He=ie,Oe=Cr,Ie=Lr+qa,Lr+=qa+$a;break}case"while":{var ke=h("wdiamond"),Re=b(_r.condition),$o=Lr,Jo=Lr+Dl/2;A+=s(ke,_r.condition||"",Fr("shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+Ar+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"]),Cr-Re/2,Lr,Re,Dl,"1"),He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Lr,"1"));var Wt=Lr+Dl+$a+14;A+=Yn(_r.body,_r.isLabel||"",jr+"strokeColor=#181818;fontSize=11;",Cr,Lr+Dl,Cr,Wt,"1");var at=Wt,Nn=Wt,ia=Cr,sa=Er();if(_r.body&&_r.body.length>0){var ka=Be(_r.body,Cr,Wt);at=ka.y,Nn=ka.prevY||at,ia=ka.prevX,ka.maxX>so&&(so=ka.maxX)}qr();var Po=Cr+(_r.body&&_r.body.length>0?fr(_r.body)/2:0),Ct=Math.round(Math.max(Cr+Re/2,Po)+15),bt=Nn+10;A+=ne(h("e"),"","endArrow=none;strokeColor=#181818;",ia,Nn,ia,bt,"1"),A+=ne(h("e"),"","endArrow=none;strokeColor=#181818;",ia,bt,Ct,bt,"1"),A+=ne(h("e"),"","endArrow=none;strokeColor=#181818;",Ct,bt,Ct,Jo,"1"),A+=ne(h("e"),"",jr+"strokeColor=#181818;",Ct,Jo,Cr+Re/2,Jo,"1");var Vr=_r.body&&_r.body.length>0?fr(_r.body)/2:0,to=Math.round(Cr-Math.max(Re/2+18,Vr+24)),Xt=Nn+26;A+=ne(h("e"),_r.endLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",Cr-Re/2,Jo,to,Jo,"1"),A+=ne(h("e"),"","endArrow=none;strokeColor=#181818;",to,Jo,to,Xt,"1"),A+=ne(h("e"),"","endArrow=none;strokeColor=#181818;",to,Xt,Cr,Xt,"1"),A+=z(sa,to,Xt,"1"),He=ke,Oe=Cr,Ie=Xt,Lr=Xt+$a;break}case"repeat":{He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Lr,"1"));var ha=h("rstart"),Wr=Lr,ro=24,te=24;if(_r.label){var ue=Y(_r.color)||"#F1F1F1";ro=C(_r.label),te=Math.max(el,Math.round(20+_r.label.split(`
-`).length*16.3)),A+=s(ha,_r.label,Fr("rounded=1;absoluteArcSize=1;arcSize=25;fillColor="+ue+";strokeColor=#181818;strokeWidth=0.5;whiteSpace=wrap;fontSize=12;align=left;spacingLeft=6;",["activity"],null,"vertex",_r.color?Nr:null),Cr-ro/2,Lr,ro,te,"1")}else A+=s(ha,"",Fr("rhombus;fillColor="+Ar+";strokeColor=#181818;",["activity","diamond"]),Cr-12,Lr,24,24,"1");var zo=Math.round(Wr+te/2),nn=Cr+ro/2,Fa=Wr+te+$a;A+=ne(h("e"),"",jr+"strokeColor=#181818;",Cr,Wr+te,Cr,Fa,"1"),Lr=Fa;var Kn=Lr,bn=Lr,Ve=Cr+Ll/2,Yo=Er();if(_r.body&&_r.body.length>0){var st=Be(_r.body,Cr,Lr);Kn=st.prevY||st.y,st.maxX>so&&(so=st.maxX),st.maxX>Ve&&(Ve=st.maxX),bn=Kn+$a,He=st.lastId,Oe=st.prevX,Ie=Kn,He&&(A+=qo("",jr+"strokeColor=#181818;",Cr,bn,"1"))}qr();var Ca=h("rdiamond"),Mt=!_r.condition,Re=Mt?qa:b(_r.condition),Ra=Mt?qa:Dl,Xn=bn+Ra/2;A+=s(Ca,_r.condition||"",Fr(Mt?"rhombus;fillColor="+Ar+";strokeColor=#181818;":"shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+Ar+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"]),Cr-Re/2,bn,Re,Ra,"1");var _a=0,Ka=0;_r.backward&&(_a=C(_r.backward.label||""),Ka=Math.max(el,Math.round(20+(_r.backward.label||"").split(`
-`).length*16.3)));var yn=Math.round(Math.max(Cr+Re/2,Ve,nn)+12+_a/2);if(A+=ne(h("e"),_r.isLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",Cr+Re/2,Xn,yn,Xn,"1"),_r.backward){var ua=Math.round((Wr+te+Xn)/2-Ka/2);A+=ne(h("e"),_r.backward.incomingLabel||"",jr+"strokeColor=#181818;fontSize=11;",yn,Xn,yn,ua+Ka,"1"),A+=s(h("backward"),_r.backward.label||"",Fr("rounded=1;absoluteArcSize=1;arcSize=25;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;whiteSpace=wrap;fontSize=12;align=left;spacingLeft=6;",["activity"]),yn-_a/2,ua,_a,Ka,"1"),A+=ne(h("e"),_r.backward.outgoingLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",yn,ua,yn,zo,"1")}else A+=ne(h("e"),"","endArrow=none;strokeColor=#181818;",yn,Xn,yn,zo,"1");if(A+=ne(h("e"),"",jr+"strokeColor=#181818;",yn,zo,nn,zo,"1"),yn+_a/2>so&&(so=yn+_a/2),He=Ca,Oe=Cr,Ie=bn+Ra,Yo.length>0){var Ya=bn+Ra+$a,fa=Ya+qa/2,xt=Math.round(Cr-Math.max(Re/2+18,Ve-Cr+24)),Ja=h("rmerge");A+=ne(h("e"),"",jr+"strokeColor=#181818;",Cr,Ie,Cr,Ya,"1"),A+=s(Ja,"",Fr("rhombus;fillColor="+Ar+";strokeColor=#181818;",["activity","diamond"]),Cr-qa/2,Ya,qa,qa,"1"),A+=z(Yo,xt,fa,"1"),A+=ne(h("e"),"","endArrow=none;strokeColor=#181818;",xt,Math.min(Yo[0].y+10,fa),xt,fa,"1"),A+=ne(h("e"),"",jr+"strokeColor=#181818;",xt,fa,Cr-qa/2,fa,"1"),He=Ja,Ie=Ya+qa}Xo=_r.exitArrow||(_r.notLabel?{label:_r.notLabel}:null),Xo&&!Xo.label&&(Xo.label=_r.notLabel||""),Lr=Ie+$a+14;break}case"fork":{for(var uo=_r.branches?_r.branches.length:0,Jn=[],Sa=0,da=0;da<uo;da++){var ma=fr(_r.branches[da]);Jn.push(ma),Sa+=ma}uo>1&&(Sa+=pi*(uo-1));for(var Ha=Cr-Sa/2,Sl=[],$l=0,ml=0;ml<uo;ml++)Sl.push(Math.round(Ha+$l+Jn[ml]/2)),$l+=Jn[ml]+pi;var Pl=Math.round(Ha-Fi),Yl=Math.round(Sa+2*Fi);Yl<bi&&(Pl=Math.round(Cr-bi/2),Yl=bi);var ri=h("forkbar");A+=s(ri,"",qe(),Pl,Lr,Yl,Ki,"1"),He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Lr,"1"));for(var wi=Lr+Ki,mi=wi+$a,Cl=mi,ll=[],yi=0;yi<uo;yi++){var rs=Sl[yi];A+=Yn(_r.branches[yi],"",jr+"strokeColor=#181818;",rs,wi,rs,mi,"1");var Xl=Be(_r.branches[yi],rs,mi);ll.push({bx:Xl.prevX,by:Xl.prevY||Xl.y,alive:Xl.lastId!=null||!(_r.branches[yi]||[]).length}),Xl.y>Cl&&(Cl=Xl.y),Xl.maxX>so&&(so=Xl.maxX)}Lr=Cl;for(var ql=0;ql<ll.length;ql++)ll[ql].alive&&(A+=ne(h("e"),"",jr+"strokeColor=#181818;",ll[ql].bx,ll[ql].by,ll[ql].bx,Lr,"1"));var hi=h("joinbar");A+=s(hi,"",qe(),Pl,Lr,Yl,Ki,"1"),Pl+Yl>so&&(so=Pl+Yl),He=hi,Oe=Cr,Ie=Lr+Ki,Lr+=Ki+$a;break}case"split":{for(var ei=_r.branches?_r.branches.length:0,Pi=[],pa=0,kn=0;kn<ei;kn++){var Na=fr(_r.branches[kn]);Pi.push(Na),pa+=Na}ei>1&&(pa+=pi*(ei-1));for(var ol=Cr-pa/2,il=[],tl=0,ba=0;ba<ei;ba++)il.push(Math.round(ol+tl+Pi[ba]/2)),tl+=Pi[ba]+pi;var dl=Lr,Ml=ei>1,Bl=dl+$a;Ml&&(He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,dl,"1")),Nt(il[0],il[ei-1],dl));for(var Ei=Bl,ta=[],ii=0;ii<ei;ii++){var Yi=il[ii];Ml?A+=Yn(_r.branches[ii],"",jr+"strokeColor=#181818;",Yi,dl,Yi,Bl,"1"):He&&(A+=qo(null,jr+"strokeColor=#181818;",Yi,Bl,"1"));var Tl=Be(_r.branches[ii],Yi,Bl);ta.push({bx:Tl.prevX,by:Tl.prevY||Tl.y,id:Tl.lastId,alive:Tl.lastId!=null||!(_r.branches[ii]||[]).length}),Tl.y>Ei&&(Ei=Tl.y),Tl.maxX>so&&(so=Tl.maxX)}var oi=Ei;if(Ml){for(var xl=Nt(il[0],il[ei-1],oi),nl=0;nl<ta.length;nl++)ta[nl].alive&&(A+=ne(h("e"),"",jr+"strokeColor=#181818;",ta[nl].bx,ta[nl].by,ta[nl].bx,oi,"1"));He=xl,Oe=Cr,Ie=oi,Lr=oi+$a}else ei===1&&(He=ta[0].alive?ta[0].id||He:null,Oe=ta[0].bx,Ie=ta[0].by,Lr=Ei);break}case"switch":{var Gl=h("swdiamond"),Re=b(_r.condition),Zl=Lr+Dl/2,Ci=Lr+Dl,As=Y(_r.color)||Ar;A+=s(Gl,_r.condition||"",Fr("shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+As+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"],null,"vertex",_r.color?Nr:null),Cr-Re/2,Lr,Re,Dl,"1"),He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Lr,"1"));for(var za=Lr+Dl+$a+14,vl=za,Va=_r.cases?_r.cases.length:0,Ol=[],Fl=0,cl=0;cl<Va;cl++){var al=(_r.cases[cl].label||"").length*5.5+20,ki=Math.max(fr(_r.cases[cl].body),al);Ol.push(ki),Fl+=ki}Va>1&&(Fl+=li*(Va-1));for(var Ln=Cr-Fl/2,Mi=[],vi=0,Di=0;Di<Va;Di++)Mi.push(Math.round(Ln+vi+Ol[Di]/2)),vi+=Ol[Di]+li;for(var Wi=[],si=0;si<Va;si++){var Il=Mi[si];if(Il<Cr-1?(A+=ne(h("e"),"","endArrow=none;strokeColor=#181818;",Cr-Re/2,Zl,Il,Zl,"1"),A+=ne(h("e"),_r.cases[si].label||"",jr+"strokeColor=#181818;fontSize=11;",Il,Zl,Il,za,"1")):Il>Cr+1?(A+=ne(h("e"),"","endArrow=none;strokeColor=#181818;",Cr+Re/2,Zl,Il,Zl,"1"),A+=ne(h("e"),_r.cases[si].label||"",jr+"strokeColor=#181818;fontSize=11;",Il,Zl,Il,za,"1")):A+=ne(h("e"),_r.cases[si].label||"",jr+"strokeColor=#181818;fontSize=11;",Cr,Ci,Il,za,"1"),_r.cases[si].body&&_r.cases[si].body.length>0){var Ht=Be(_r.cases[si].body,Il,za);Ht.y>vl&&(vl=Ht.y),Ht.maxX>so&&(so=Ht.maxX),Wi.push({x:Ht.prevX,y:Ht.prevY||za})}else Wi.push({x:Il,y:za})}var ya=vl+$a,Oa=qa/2,ie=h("swmerge");A+=s(ie,"",Fr("rhombus;fillColor="+As+";strokeColor=#181818;",["activity","diamond"],null,"vertex",_r.color?Nr:null),Cr-Oa,ya,qa,qa,"1");for(var St=0;St<Wi.length;St++)A+=Da(Wi[St].x,Wi[St].y,Cr,ya);He=ie,Oe=Cr,Ie=ya+qa,Lr=ya+qa+$a;break}case"note":{var kl=tr(_r),bl=_r.position==="left"?Cr-gi/2-kl.w-X:Cr+gi/2+X;A+=s(Ho,_r.text||"",yr(_r),bl,Math.round(Ie-el/2-kl.h/2),kl.w,kl.h,"1"),He&&(A+=vr(h("noteln"),"","endArrow=none;dashed=1;html=1;strokeColor=#181818;",Ho,He,"1")),bl+kl.w>so&&(so=bl+kl.w);break}case"partition":{if(!_r.body||_r.body.length===0)break;var ms=_r.name||_r.label||"",gu=Math.round(Vl(ms))+10,_n=20,En=Lr,Xi=En+_n+16,ss="";He&&(ss=qo(null,jr+"strokeColor=#181818;",Cr,Xi,"1"));var Cs=A;A="";for(var es=Be(_r.body,Cr,Xi),os=A,qi=Cr,Ms=Cr,Ru=Xi,Ef=/<mxGeometry x="([-\d.]+)" y="([-\d.]+)" width="([-\d.]+)" height="([-\d.]+)"/g,vs;(vs=Ef.exec(os))!=null;)+vs[1]<qi&&(qi=+vs[1]),+vs[1]+ +vs[3]>Ms&&(Ms=+vs[1]+ +vs[3]),+vs[2]+ +vs[4]>Ru&&(Ru=+vs[2]+ +vs[4]);var Js=qi-10,Au=Ms+10,mu=gu+10-(Au-Js);mu>0&&(Js-=mu/2,Au+=mu/2);var Df=Au-Js,Sf=Ru+12,Xu=Y(_r.color)||"none",Ss=H(ce,de(["partition"]),[],"vertex");_r.color?(delete Ss.fillColor,delete Ss.gradientColor):Ss.fillColor!=null&&(Ss.swimlaneFillColor=Ss.fillColor),A=Cs+s(Ho,ms,M("shape=umlFrame;width="+gu+";height="+_n+";fillColor="+Xu+";swimlaneFillColor="+Xu+";strokeColor=#181818;strokeWidth=1;fontSize=14;fontColor=#000000;align=left;verticalAlign=middle;spacingLeft=1;whiteSpace=wrap;",Ss),Js,En,Df,Sf-En,"1")+ss+os,Js+Df>so&&(so=Js+Df),He=es.lastId,Oe=es.prevX,Ie=es.prevY||es.y,Lr=Sf+$a/2;break}case"detach":{He=null,Lr-=$a/2;break}case"break":{Sr.length>0&&(Sr[Sr.length-1].push({x:Oe,y:Ie}),He=null);break}case"goto":{He=null;break}case"label":break;case"spot":{A+=s(Ho,_r.letter||"","ellipse;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;verticalAlign=middle;",Cr-Xa/2,Lr,Xa,Xa,"1"),He&&(A+=qo(null,jr+"strokeColor=#181818;",Cr,Lr,"1")),He=Ho,Oe=Cr,Ie=Lr+Xa,Lr+=Xa+$a;break}case"swimlane":break;case"arrowLabel":{Xo=_r,_r.label&&(Lr+=16);break}default:break}}return{y:Lr,maxX:so,lastId:He,prevY:Ie,prevX:Oe}}var ye=r.swimlanes||[];if(ye.length>0){let we=function(Eo){var Et=_e[Eo]!=null?_e[Eo]:0;return wl+Et*(ae+it)+ae/2};for(var Le=r.nodes||[],_e={},Ur=0;Ur<ye.length;Ur++)_e[ye[Ur].name]=Ur;for(var yo=30,fo=40,he=0;he<Le.length;he++)if(Le[he].type==="action"){var Te=C(Le[he].label||"",Ir(Le[he]));Te>fo&&(fo=Te)}for(var ae=Math.max(90,fo+56),it=0,Gt=ye[0].name,oo=wl+yo,pt=null,rt=null,jo=null,Qt=null,Me=null,Io=0;Io<Le.length;Io++){var Wo=Le[Io];if(Wo.type==="swimlane"){Gt=Wo.name;continue}if(Wo.type==="arrowLabel"){Me=Wo,Wo.label&&(oo+=ns+(String(Wo.label).split(/\\n|\n/).length-1)*Vi);continue}var Ro=we(Gt);if(Wo.type==="note"){Be([Wo],Ro,oo);continue}if(pt!=null){var An=Me&&Me.label||"",dn=Mr(Me),rn=!!(Me&&Me.hidden),Ao=jr+"strokeColor=#181818;"+dn,_t="endArrow=none;strokeColor=#181818;"+dn,ft=jo??oo-$a;if(Me=null,rn)An&&(A+=ao(h("e"),An,Ao,rt,ft,Ro,oo,"1"));else if(Qt===Gt&&rt===Ro)A+=ne(h("e"),An,Ao,rt,ft,Ro,oo,"1");else{var Se=oo-di>=ft+5?oo-di:Math.round((ft+oo)/2);A+=ne(h("e"),An,_t,rt,ft,rt,Se,"1"),A+=ne(h("e"),"",_t,rt,Se,Ro,Se,"1"),A+=ne(h("e"),"",Ao,Ro,Se,Ro,oo,"1")}}var Go=oo,wt=Be([Wo],Ro,oo);pt="tracker",rt=wt.prevX,jo=wt.prevY>Go?wt.prevY:null,Qt=Gt,oo=wt.y}for(var cn=A,No="",oe=oo,Uo=oe-$a-wl+6,Ot=wl,ho=0;ho<ye.length;ho++){var dt=ye[ho],Aa=Y(dt.color)||"none",Sn=h("lane"),an=H(ce,de(["swimlane"]),[],"vertex");dt.color?(delete an.fillColor,delete an.gradientColor):an.fillColor!=null&&(an.swimlaneFillColor=an.fillColor),No+=s(Sn,dt.name,M("swimlane;collapsible=0;startSize="+yo+";fillColor="+Aa+";swimlaneFillColor="+Aa+";strokeColor=#181818;strokeWidth=1.5;fontColor=#000000;fontSize=18;fontStyle=0;html=1;",an),Ot,wl,ae,Uo,"1"),Ot+=ae+it}return No+cn}return Be(r.nodes,J,ur),A}var Ns=41,ds=13,gs=20,Ws=7,Dd=14.13,nf=20,af=22,Ls=24,lf=80,ou=8,bs=16,tu=22,sf=12;function Du(r,a){var e=r.nodes||[],h=r.edges||[],l=r.partitions||[],C=r.skin||{},b="",Z=0,v,er,X,V,tr;if(e.length===0)return"";function wr(me){return"lg"+me+"_"+Z++}function yr(me,ie){if(ie){var pe=C[(me+"<<"+ie+">>").toLowerCase()];if(pe!=null)return pe}return C[me.toLowerCase()]}function fr(me,ie,pe){return Y(yr(me,ie))||pe}function Ar(me){return u(me||"").split(`
-`)}function jr(me,ie){for(var pe=0,ke=0;ke<me.length;ke++){var Re=Gr(me[ke],ie);Re>pe&&(pe=Re)}return pe}var ce={},Nr={};for(v=0;v<e.length;v++){V=e[v],ce[V.id]=V;var de={w:0,h:0,cellId:wr(V.type),x:0,y:0};if(V.type==="start")de.w=nf,de.h=nf;else if(V.type==="end")de.w=af,de.h=af;else if(V.type==="branch")de.w=Ls,de.h=Ls;else if(V.type==="bar")de.w=lf,de.h=ou;else if(V.type==="note"){var Fr=Ar(V.label);de.w=Math.max(40,Math.round(jr(Fr,13)+22)),de.h=Math.max(24,Math.round(Fr.length*15.3+10))}else{var Ir=Ar(V.label),qe=parseFloat(yr("activityFontSize",V.stereotype))||12;de.w=Math.max(30,Math.round(jr(Ir,qe)+20)),de.h=Math.round(20+Ir.length*Dd*qe/12)}Nr[V.id]=de}var To={};function ne(me){for(;To[me]!==me;)To[me]=To[To[me]],me=To[me];return me}function po(me,ie){me=ne(me),ie=ne(ie),me!==ie&&(To[ie]=me)}for(v=0;v<e.length;v++)To[e[v].id]=e[v].id;var ao=[],A=[];for(v=0;v<h.length;v++)tr=h[v],!(!ce[tr.from]||!ce[tr.to]||tr.from===tr.to||tr.constraint===!1)&&(tr.direction==="left"?(po(tr.from,tr.to),A.push({before:tr.to,after:tr.from})):tr.direction==="right"||tr.direction==null&&tr.length<=1?(po(tr.from,tr.to),A.push({before:tr.from,after:tr.to})):tr.direction==="up"?ao.push({from:tr.to,to:tr.from,minlen:Math.max(1,tr.length-1)}):ao.push({from:tr.from,to:tr.to,minlen:Math.max(1,tr.length-1)}));for(v=0;v<e.length;v++)V=e[v],!(V.type!=="note"||V.target==null||!ce[V.target])&&(V.position==="top"?ao.push({from:V.id,to:V.target,minlen:1}):V.position==="bottom"?ao.push({from:V.target,to:V.id,minlen:1}):(po(V.id,V.target),V.position==="left"?A.push({before:V.id,after:V.target}):A.push({before:V.target,after:V.id})));var J=[],ur={};for(v=0;v<e.length;v++){var Sr=ne(e[v].id);ur[Sr]==null&&(ur[Sr]=[],J.push(Sr))}var Er=[];for(v=0;v<ao.length;v++){var qr=ne(ao[v].from),z=ne(ao[v].to);qr!==z&&(Er.push({from:qr,to:z,minlen:ao[v].minlen,back:!1}),ur[qr].push(Er.length-1))}var Mr={};for(v=0;v<J.length;v++)Mr[J[v]]=0;function Be(me){var ie=[{node:me,idx:0}];for(Mr[me]=1;ie.length>0;){var pe=ie[ie.length-1],ke=ur[pe.node];if(pe.idx<ke.length){var Re=Er[ke[pe.idx++]];Mr[Re.to]===1?Re.back=!0:Mr[Re.to]===0&&(Mr[Re.to]=1,ie.push({node:Re.to,idx:0}))}else Mr[pe.node]=2,ie.pop()}}for(v=0;v<J.length;v++)Mr[J[v]]===0&&Be(J[v]);var ye={},Le={};for(v=0;v<J.length;v++)ye[J[v]]=0,Le[J[v]]=0;for(v=0;v<Er.length;v++)Er[v].back||ye[Er[v].to]++;var _e=[];for(v=0;v<J.length;v++)ye[J[v]]===0&&_e.push(J[v]);for(var Ur=J.length*J.length+16;_e.length>0&&Ur-- >0;){var yo=_e.shift(),fo=ur[yo];for(er=0;er<fo.length;er++){var he=Er[fo[er]];he.back||(Le[he.to]<Le[yo]+he.minlen&&(Le[he.to]=Le[yo]+he.minlen),--ye[he.to]===0&&_e.push(he.to))}}var Te={},ae=[];for(v=0;v<e.length;v++){var it=Le[ne(e[v].id)]||0;for(Te[e[v].id]=it;ae.length<=it;)ae.push([]);ae[it].push(e[v].id)}var Gt=0,oo=[];for(v=0;v<h.length;v++)if(tr=h[v],oo[v]=null,!(!ce[tr.from]||!ce[tr.to]||tr.from===tr.to)){var pt=Math.min(Te[tr.from],Te[tr.to]),rt=Math.max(Te[tr.from],Te[tr.to]);if(!(rt-pt<=1)){var jo=[];for(X=pt+1;X<rt;X++){var Qt="dummy#"+ ++Gt;ce[Qt]={id:Qt,type:"dummy",label:"",partition:null},Nr[Qt]={w:8,h:0,cellId:null,x:0,y:0},Te[Qt]=X,ae[X].push(Qt),jo.push(Qt)}oo[v]=jo}}var Me={},Io={},Wo=[];for(X=0;X<ae.length;X++)for(er=0;er<ae[X].length;er++)Me[ae[X][er]]=[],Io[ae[X][er]]=[],Wo.push(ae[X][er]);function Ro(me,ie){!ce[me]||!ce[ie]||me===ie||Te[me]===Te[ie]||(Te[me]<Te[ie]?(Io[me].push(ie),Me[ie].push(me)):(Io[ie].push(me),Me[me].push(ie)))}for(v=0;v<h.length;v++){if(tr=h[v],oo[v]==null){Ro(tr.from,tr.to);continue}var An=Te[tr.from]<Te[tr.to]?tr.from:tr.to,dn=An===tr.from?tr.to:tr.from,rn=An;for(er=0;er<oo[v].length;er++)Ro(rn,oo[v][er]),rn=oo[v][er];Ro(rn,dn)}for(v=0;v<e.length;v++)e[v].type==="note"&&e[v].target!=null&&Ro(e[v].id,e[v].target);var Ao={};function _t(me){for(var ie=0;ie<me.length;ie++)Ao[me[ie]]=ie}for(X=0;X<ae.length;X++)_t(ae[X]);function ft(me,ie){for(var pe=[],ke=0;ke<me.length;ke++){var Re=ie[me[ke]],$o=ke;if(Re.length>0){for(var Jo=0,Wt=0;Wt<Re.length;Wt++)Jo+=Ao[Re[Wt]];$o=Jo/Re.length}pe.push({id:me[ke],bary:$o,idx:ke})}for(pe.sort(function(at,Nn){return at.bary!==Nn.bary?at.bary-Nn.bary:at.idx-Nn.idx}),ke=0;ke<pe.length;ke++)me[ke]=pe[ke].id;_t(me)}for(var Se=0;Se<4;Se++){for(X=1;X<ae.length;X++)ft(ae[X],Me);for(X=ae.length-2;X>=0;X--)ft(ae[X],Io)}for(v=0;v<A.length;v++){var Go=A[v].before,wt=A[v].after;if(!(Te[Go]==null||Te[Go]!==Te[wt]||Ao[Go]<Ao[wt])){var cn=ae[Te[Go]];cn.splice(Ao[Go],1),cn.splice(Ao[wt],0,Go),_t(cn)}}if(l.length>0)for(X=0;X<ae.length;X++){for(var No=ae[X],oe={},Uo=0;Uo<No.length;){var Ot=ce[No[Uo]].partition||"",ho=oe[Ot];if(ho!=null&&ho<Uo-1){var dt=No.splice(Uo,1)[0];No.splice(ho+1,0,dt);for(var Aa in oe)oe.hasOwnProperty(Aa)&&oe[Aa]>ho&&oe[Aa]++;oe[Ot]=ho+1}else oe[Ot]=Uo;Uo++}_t(No)}function Sn(me){return ce[me].partition||null}function an(me,ie){if(ce[me].type==="dummy"||ce[ie].type==="dummy")return gs;var pe=Sn(me),ke=Sn(ie);return pe===ke?gs:gs+(pe?bs:0)+(ke?bs:0)+4}var we=[],Eo=0;for(X=0;X<ae.length;X++){var Et=0;for(er=0;er<ae[X].length;er++)Et+=Nr[ae[X][er]].w,er>0&&(Et+=an(ae[X][er-1],ae[X][er]));we[X]=Et,Et>Eo&&(Eo=Et)}var Cr={};for(X=0;X<ae.length;X++){var Lr=(Eo-we[X])/2;for(er=0;er<ae[X].length;er++){var He=ae[X][er];er>0&&(Lr+=an(ae[X][er-1],He)),Cr[He]=Lr+Nr[He].w/2,Lr+=Nr[He].w}}function Ie(me,ie){for(var pe=[0],ke=1;ke<me.length;ke++)pe[ke]=pe[ke-1]+Nr[me[ke-1]].w/2+an(me[ke-1],me[ke])+Nr[me[ke]].w/2;var Re=[];for(ke=0;ke<me.length;ke++){for(var $o={sum:ie[ke]-pe[ke],count:1,end:ke};Re.length>0&&Re[Re.length-1].sum/Re[Re.length-1].count>$o.sum/$o.count;){var Jo=Re.pop();$o.sum+=Jo.sum,$o.count+=Jo.count}Re.push($o)}for(var Wt=0,at=0;at<Re.length;at++)for(var Nn=Re[at].sum/Re[at].count,ia=0;ia<Re[at].count;ia++,Wt++)Cr[me[Wt]]=Nn+pe[Wt]}function Oe(me){var ie=me?1:ae.length-2,pe=me?ae.length:-1,ke=me?1:-1;for(X=ie;X!==pe;X+=ke){var Re=ae[X],$o=[];for(er=0;er<Re.length;er++){var Jo=me?Me[Re[er]]:Io[Re[er]];if(Jo.length===0){$o.push(Cr[Re[er]]);continue}for(var Wt=0,at=0;at<Jo.length;at++)Wt+=Cr[Jo[at]];$o.push(Wt/Jo.length)}Ie(Re,$o)}}for(Oe(!0),Oe(!1),Oe(!0),Oe(!1),Oe(!0),v=0;v<h.length;v++)if(!(oo[v]==null||oo[v].length<2)){var so=0;for(er=0;er<oo[v].length;er++)so+=Cr[oo[v][er]];for(er=0;er<oo[v].length;er++)Cr[oo[v][er]]=so/oo[v].length}function Xo(){for(var me=0;me<ae.length;me++)for(var ie=1;ie<ae[me].length;ie++){var pe=ae[me][ie-1],ke=ae[me][ie],Re=Cr[pe]+Nr[pe].w/2+an(pe,ke)+Nr[ke].w/2;Cr[ke]<Re&&(Cr[ke]=Re)}}if(Xo(),l.length>1){let me=function(ke,Re){for(var $o=0;Re!=null&&$o++<32;){if(qo[Re]===ke)return!0;Re=qo[Re]}return!1},ie=function(ke){for(var Re=[],$o=0;$o<e.length;$o++)for(var Jo=e[$o].partition,Wt=0;Jo!=null&&Wt++<32;){if(Jo===ke){Re.push(e[$o].id);break}Jo=qo[Jo]}return Re},pe=function(ke){for(var Re={x0:1/0,x1:-1/0,r0:1/0,r1:-1/0,sum:0},$o=0;$o<ke.length;$o++){var Jo=Nr[ke[$o]],Wt=Cr[ke[$o]];Wt-Jo.w/2<Re.x0&&(Re.x0=Wt-Jo.w/2),Wt+Jo.w/2>Re.x1&&(Re.x1=Wt+Jo.w/2),Te[ke[$o]]<Re.r0&&(Re.r0=Te[ke[$o]]),Te[ke[$o]]>Re.r1&&(Re.r1=Te[ke[$o]]),Re.sum+=Wt}return Re.mean=Re.sum/ke.length,Re};var qo={};for(v=0;v<l.length;v++)qo[l[v].id]=l[v].parent;for(var Yn=0;Yn<8;Yn++){var Nt=!1;for(v=0;v<l.length;v++)for(er=0;er<l.length;er++)if(!(v===er||me(l[v].id,l[er].id)||me(l[er].id,l[v].id))){var Da=ie(l[v].id),je=ie(l[er].id);if(!(Da.length===0||je.length===0)){var _r=pe(Da),Ho=pe(je);if(!(_r.r1<Ho.r0||Ho.r1<_r.r0)){var Ce=2*bs+4;if(!(_r.x1+Ce<=Ho.x0||Ho.x1+Ce<=_r.x0)){for(var ln=_r.mean<=Ho.mean?je:Da,nt=_r.mean<=Ho.mean?_r.x1+Ce-Ho.x0:Ho.x1+Ce-_r.x0,wo=0;wo<ln.length;wo++)Cr[ln[wo]]+=nt;Nt=!0}}}}if(!Nt)break}Xo()}var xn=[],Lt=[];for(X=0;X<ae.length;X++){var Ft=0;for(er=0;er<ae[X].length;er++)Nr[ae[X][er]].h>Ft&&(Ft=Nr[ae[X][er]].h);xn[X]=Ft,Lt[X]=Ns}for(v=0;v<h.length;v++)if(tr=h[v],!(!ce[tr.from]||!ce[tr.to]||!tr.label)){var fe=Math.min(Te[tr.from],Te[tr.to]);Math.abs(Te[tr.from]-Te[tr.to])===1&&Lt[fe]<Ns+ds&&(Lt[fe]=Ns+ds)}var ge={},qt={},et={};for(v=0;v<l.length;v++){et[l[v].id]=v;for(var en=0,Zt=l[v].parent;Zt!=null&&en<32;)en++,Zt=l[et[Zt]]?l[et[Zt]].parent:null;qt[l[v].id]=en}function qn(me,ie){var pe=ge[me];pe==null?ge[me]={min:ie,max:ie}:(ie<pe.min&&(pe.min=ie),ie>pe.max&&(pe.max=ie))}for(v=0;v<e.length;v++)for(var Ko=e[v].partition,Hn=0;Ko!=null&&et[Ko]!=null&&Hn++<32;)qn(Ko,Te[e[v].id]),Ko=l[et[Ko]].parent;var aa=[],Je=[];for(X=0;X<ae.length;X++)aa[X]=0,Je[X]=0;for(var sn in ge)if(ge.hasOwnProperty(sn)){var Bn=qt[sn]+1,$t=ge[sn],mo=Bn*(tu+sf),Pt=Bn*bs;mo>aa[$t.min]&&(aa[$t.min]=mo),Pt>Je[$t.max]&&(Je[$t.max]=Pt)}var ra=[],Ut=Ws;for(X=0;X<ae.length;X++)Ut+=aa[X],ra[X]=Ut,Ut+=xn[X]+Je[X]+Lt[X];var Wn=1/0;for(v=0;v<e.length;v++){var yt=Nr[e[v].id],Zn=e[v].partition?(qt[e[v].partition]+1)*bs:0;e[v].type==="branch"&&e[v].condition&&(Zn+=Gr(u(e[v].condition),11)+4),Cr[e[v].id]-yt.w/2-Zn<Wn&&(Wn=Cr[e[v].id]-yt.w/2-Zn)}var on=Ws-Wn;for(v=0;v<Wo.length;v++){var va=Nr[Wo[v]],ga=Te[Wo[v]];va.x=Math.round(Cr[Wo[v]]+on-va.w/2),va.y=Math.round(ra[ga]+(xn[ga]-va.h)/2)}for(v=0;v<e.length;v++)if(V=e[v],!(V.type!=="note"||V.edge==null||!h[V.edge])){var jn=h[V.edge];if(!(!ce[jn.from]||!ce[jn.to])){var Fn=Nr[jn.from],Mn=Nr[jn.to],la=(Fn.x+Fn.w/2+Mn.x+Mn.w/2)/2,Tn=(Fn.y+Fn.h/2+Mn.y+Mn.h/2)/2,gt=Nr[V.id];gt.x=Math.round(la+14),gt.y=Math.round(Tn-gt.h/2)}}var Rt={};for(v=l.length-1;v>=0;v--){var Jt=l[v],ct=1/0,wn=1/0,In=-1/0,ko=-1/0;for(er=0;er<e.length;er++)if(e[er].partition===Jt.id){var Do=Nr[e[er].id];Do.x<ct&&(ct=Do.x),Do.y<wn&&(wn=Do.y),Do.x+Do.w>In&&(In=Do.x+Do.w),Do.y+Do.h>ko&&(ko=Do.y+Do.h)}for(er=v+1;er<l.length;er++){var Rr=Rt[l[er].id];l[er].parent!==Jt.id||Rr==null||(Rr.x<ct&&(ct=Rr.x),Rr.y<wn&&(wn=Rr.y),Rr.x+Rr.w>In&&(In=Rr.x+Rr.w),Rr.y+Rr.h>ko&&(ko=Rr.y+Rr.h))}if(isFinite(ct)){if(Jt.inner){Rt[Jt.id]={x:ct-7,y:wn-7,w:In-ct+14,h:ko-wn+14,titleW:0};continue}var xr=Math.round(Gr(Jt.name,14,!0)+14);Rt[Jt.id]={x:ct-bs,y:wn-tu-sf,w:Math.max(In-ct+2*bs,xr+20),h:ko-wn+tu+sf+bs,titleW:xr}}}for(v=0;v<l.length;v++){var br=Rt[l[v].id];if(br!=null){if(l[v].inner){b+=s(wr("inner"),"","rounded=1;absoluteArcSize=1;arcSize=25;fillColor=#FFFFFF;strokeColor=#A80036;strokeWidth=1.5;",br.x,br.y,br.w,br.h,"1");continue}var Br=Y(l[v].color)||fr("partitionBackgroundColor",l[v].stereotype,"none"),Pr=fr("partitionBorderColor",l[v].stereotype,"#000000");b+=s(wr("part"),"","rounded=0;fillColor="+Br+";strokeColor="+Pr+";strokeWidth=1.5;",br.x,br.y,br.w,br.h,"1"),b+=s(wr("ptab"),l[v].name,"rounded=0;fillColor="+Br+";strokeColor="+Pr+";strokeWidth=1.5;fontStyle=1;fontSize=14;fontColor=#000000;align=left;verticalAlign=middle;spacingLeft=2;whiteSpace=wrap;",br.x,br.y,br.titleW,tu,"1")}}var Xe=fr("activityArrowColor",null,null)||fr("arrowColor",null,"#181818");for(v=0;v<e.length;v++){V=e[v];var zr=Nr[V.id],Ke,De="";if(V.type==="start"){var ze=fr("activityStartColor",null,"#222222");Ke="ellipse;fillColor="+ze+";strokeColor="+ze+";"}else if(V.type==="end"){var So=fr("activityEndColor",null,"#222222");Ke="ellipse;shape=endState;fillColor="+So+";strokeColor="+So+";"}else if(V.type==="branch"){De=V.condition||"";var ot=ae[Te[V.id]],ve=Ao[V.id]>0&&Ao[V.id]===ot.length-1;Ke="rhombus;fillColor="+fr("activityDiamondBackgroundColor",null,"#F1F1F1")+";strokeColor="+fr("activityDiamondBorderColor",null,"#181818")+";strokeWidth=0.5;fontSize=11;verticalLabelPosition=top;verticalAlign=bottom;"+(ve?"labelPosition=right;align=left;":"labelPosition=left;align=right;")}else if(V.type==="bar"){var Yt=fr("activityBarColor",null,"#555555");Ke="shape=rectangle;fillColor="+Yt+";strokeColor="+Yt+";"}else if(V.type==="note")De=V.label||"",Ke="shape=note;size=14;fillColor="+(Y(V.color)||fr("noteBackgroundColor",null,"#FEFFDD"))+";strokeColor="+fr("noteBorderColor",null,"#181818")+";strokeWidth=0.5;fontSize=13;whiteSpace=wrap;align=left;verticalAlign=middle;spacingLeft=2;";else{De=V.label||"";var At=Y(V.color)||fr("activityBackgroundColor",V.stereotype,"#F1F1F1"),ht=parseFloat(yr("activityFontSize",V.stereotype))||12;Ke="rounded=1;absoluteArcSize=1;arcSize=25;fillColor="+At+";strokeColor="+fr("activityBorderColor",V.stereotype,"#181818")+";strokeWidth=0.5;whiteSpace=wrap;fontSize="+ht+";fontColor="+fr("activityFontColor",V.stereotype,"#000000")+";align=left;spacingLeft=6;"}b+=s(zr.cellId,De,Ke,zr.x,zr.y,zr.w,zr.h,"1")}var Vt=0;for(v=0;v<e.length;v++)Nr[e[v].id].x+Nr[e[v].id].w>Vt&&(Vt=Nr[e[v].id].x+Nr[e[v].id].w);function Pn(me,ie,pe,ke,Re,$o){var Jo=' <mxGeometry relative="1" as="geometry"'+($o?`>
+`),Te=0,jr=0;jr<vr.length;jr++){var _e=Ld(vr[jr],tr);_e>Te&&(Te=_e)}return Math.max(30,Math.round(Te+20))}function F($r){var ee=i(["activity","diamond"],[],11);return Math.max(di,Math.round(Ss($r||"",ee,!1)+24))}var j=13,p=15.3,or=20,q=10,rr="stencil(jVHRDoIwDPyavZqNhvgBiE/+RHVVFmEj2wT9e7eUoJCQ8HZ3vbXXTkAVGuxJFNJiRwJOoiiCbi8OdUJJbliDkunIVCnJHENPt8jigN7gtSWuhOjdk0aj49TC2Ia8ibkKtYDq7jw9vHtZzbzH7Myoc0NO9OZ30+QPM557ZmNr7J9RLozqeCi3vcumsHAm8MvCa8y1rZBK7o45325X0HXj/VETWJ84SfzdUH8B)";function nr($r){for(var ee=($r.text||"").split(`
+`),Rr=0,tr=0;tr<ee.length;tr++){var vr=Mi(ee[tr])*(j/14);vr>Rr&&(Rr=vr)}return{w:Math.max(30,Math.round(Rr+21)),h:Math.round(ee.length*p+10)}}function Xr($r,ee,Rr){var tr=$r.length===1,vr={left:[],right:[]},Te=["left","right"],jr={left:0,right:0},_e={left:0,right:0},Br,br;for(Br=0;Br<$r.length;Br++){var Or=nr($r[Br]);br=$r[Br].position==="right"?"right":"left",vr[br].push({node:$r[Br],w:Or.w,h:Or.h}),jr[br]+=Or.h+(tr?0:2*q),Or.w>_e[br]&&(_e[br]=Or.w)}var xe=Math.max(Rr,jr.left,jr.right),bo=[];for(Br=0;Br<2;Br++){br=Te[Br];for(var _t=(xe-jr[br])/2,Wo=tr?0:q,Fo=tr?or:q,ut=0;ut<vr[br].length;ut++){var Do=vr[br][ut],Fr=br==="left"?-Fo-Do.w-(_e.left-Do.w)/2:ee+Fo+(_e.right-Do.w)/2;bo.push({node:Do.node,side:br,w:Do.w,h:Do.h,dx:Math.round(Fr),dy:Math.round(_t+Wo),pointer:tr&&!Do.node.floating}),_t+=Do.h+2*Wo}}return{totalH:xe,actDy:Math.round((xe-Rr)/2),notes:bo}}function wr($r){return ve("shape=note;size=10;fillColor="+(Y($r.color)||"#FEFFDD")+";strokeColor=#181818;strokeWidth=0.5;fontSize="+j+";fontColor=#000000;whiteSpace=wrap;align=left;verticalAlign=middle;spacingLeft=4;",["note"],xr($r),"vertex",$r.color?he:null)}function pr($r,ee,Rr){if(!$r||!$r.length)return di;for(var tr=di,vr=ee,Te=0;Te<$r.length;Te++){var jr=$r[Te],_e=di,Br,br,Or,xe,bo;if(jr.type==="swimlane"){vr=jr.name;continue}else if(Rr!=null&&vr!==Rr){vr=Qe([jr],vr);continue}else if(jr.type==="action")_e=h(jr.label||"",xr(jr))+(jr.shape==="input"||jr.shape==="output"?10:0);else if(jr.type==="if"){for(Br=[jr.thenBranch||[]],Or=0;jr.elseIfBranches!=null&&Or<jr.elseIfBranches.length;Or++)Br.push(jr.elseIfBranches[Or].body||[]);Br.push(jr.elseBranch||[]),br=yo(Br,vr);var _t=Qr(br[0],vr)?pr(Br[0],br[0]):0,Wo=0;for(Or=1;Or<Br.length;Or++)Qr(br[Or],vr)&&(xe=pr(Br[Or],br[Or]),xe>Wo&&(Wo=xe));_e=_t+32+Wo}else if(jr.type==="while"||jr.type==="repeat"){if(_e=pr(jr.body,vr)+qa/2,jr.type==="repeat"){if(jr.label){var Fo=h(jr.label)+qa/2;Fo>_e&&(_e=Fo)}jr.backward&&(_e+=h(jr.backward.label||""))}}else if(jr.type==="switch"){for(Br=[],Or=0;jr.cases!=null&&Or<jr.cases.length;Or++)Br.push(jr.cases[Or].body||[]);for(br=yo(Br,vr),_e=0,bo=0,Or=0;Or<Br.length;Or++)Qr(br[Or],vr)&&(_e+=Math.max(pr(Br[Or],br[Or]),(jr.cases[Or].label||"").length*5.5+20),bo++);bo>1&&(_e+=yi*(bo-1))}else if(jr.type==="fork"||jr.type==="split"){for(Br=jr.branches||[],br=yo(Br,vr),_e=0,bo=0,Or=0;Or<Br.length;Or++)Qr(br[Or],vr)&&(_e+=pr(Br[Or],br[Or]),bo++);bo>1&&(_e+=Al*(bo-1)),jr.type==="fork"&&(_e=Math.max(_e+2*Jl,ki))}_e>tr&&(tr=_e),vr=Qe([jr],vr)}return tr}var Dr="#F1F1F1",Ze=r.styleSheet||null,he=["fillColor","gradientColor"];function Pr($r){return["root","element","activityDiagram"].concat($r)}function ve($r,ee,Rr,tr,vr){return X($r,Ze,Pr(ee),Rr||[],tr||"vertex",vr)}function xr($r){return $r.stereotypes||($r.stereotype?[$r.stereotype]:[])}function qr(){var $r=U(Ze,Pr(["activityBar"]),[],"vertex");return $r.fillColor!=null&&$r.strokeColor==null&&($r.strokeColor=$r.fillColor),H("shape=rectangle;fillColor=#555555;strokeColor=#555555;",$r)}var ze=U(Ze,Pr(["arrow"]),[],"edge"),wo=Ft.color(Ft.userStyle(Ze,Pr(["arrow"]),[]),"HeadColor");wo==null&&(r.arrowHeadColor==="none"||r.arrowHeadColor==="transparent")&&(wo="none");var me="endArrow=classic;endSize=8;";wo==="none"&&(me="endArrow=none;",ze.endArrow="none");var ue=function($r,ee,Rr,tr,vr,Te,jr,_e){return I($r,ee,H(Rr,ze),tr,vr,Te,jr,_e)},po="endArrow=none;startArrow=none;strokeColor=none;",x=function($r,ee,Rr,tr,vr,Te,jr,_e){return I($r,ee,H(Rr,ze)+po,tr,vr,Te,jr,_e)},S="",fr=xl+qa/2,zr=xl,Lr=[];function te(){return Lr.push([]),Lr[Lr.length-1]}function W(){return Lr.pop()}function Zr($r,ee,Rr,tr){for(var vr="",Te=0;Te<$r.length;Te++){var jr=Math.min($r[Te].y+10,Rr),_e="endArrow=none;strokeColor=#181818;";vr+=ue(c("e"),"",_e,$r[Te].x,$r[Te].y,$r[Te].x,jr,tr),vr+=ue(c("e"),"",_e,$r[Te].x,jr,ee,jr,tr)}return vr}var Re=null,Ae=null,Pe=null,De=null;function Qr($r,ee){return Ae==null||$r==null||$r===ee}function Po($r,ee){for(var Rr=ee,tr=0;$r!=null&&tr<$r.length&&$r[tr].type==="swimlane";tr++)Rr=$r[tr].name;return Rr}function Qe($r,ee){for(var Rr=ee,tr=0;$r!=null&&tr<$r.length;tr++){var vr=$r[tr],Te;if(vr.type==="swimlane")Rr=vr.name;else if(vr.type==="if"){for(Rr=Qe(vr.thenBranch,Rr),Te=0;vr.elseIfBranches!=null&&Te<vr.elseIfBranches.length;Te++)Rr=Qe(vr.elseIfBranches[Te].body,Rr);Rr=Qe(vr.elseBranch,Rr)}else if(vr.type==="switch")for(Te=0;vr.cases!=null&&Te<vr.cases.length;Te++)Rr=Qe(vr.cases[Te].body,Rr);else if(vr.type==="fork"||vr.type==="split")for(Te=0;vr.branches!=null&&Te<vr.branches.length;Te++)Rr=Qe(vr.branches[Te],Rr);else vr.body!=null&&(Rr=Qe(vr.body,Rr))}return Rr}function yo($r,ee){for(var Rr=[],tr=ee,vr=0;vr<$r.length;vr++)Rr.push(Po($r[vr],tr)),tr=Qe($r[vr],tr);return Rr}function ie($r,ee,Rr){if(Ae==null)return $r;for(var tr=$r.slice(),vr={},Te=0;Te<$r.length;Te++)if(!(Qr(ee[Te],Rr)||vr[ee[Te]])){vr[ee[Te]]=!0;var jr=1/0,_e=-1/0,Br;for(Br=0;Br<$r.length;Br++)ee[Br]===ee[Te]&&($r[Br]<jr&&(jr=$r[Br]),$r[Br]>_e&&(_e=$r[Br]));var br=Math.round(Ae(ee[Te])-(jr+_e)/2);for(Br=0;Br<$r.length;Br++)ee[Br]===ee[Te]&&(tr[Br]=$r[Br]+br)}return tr}function pe($r,ee){var Rr=[Po($r,ee)];return Mo($r,Rr[0],Rr),Rr}function Mo($r,ee,Rr){for(var tr=ee,vr=null,Te=0;$r!=null&&Te<$r.length;Te++){var jr=$r[Te],_e;if(jr.type==="swimlane"){tr=jr.name,vr=tr;continue}if(!(jr.type==="arrowLabel"||jr.type==="label"))if(vr!=null&&(Rr.indexOf(vr)<0&&Rr.push(vr),vr=null),jr.type==="if"){for(tr=Mo(jr.thenBranch,tr,Rr),_e=0;jr.elseIfBranches!=null&&_e<jr.elseIfBranches.length;_e++)tr=Mo(jr.elseIfBranches[_e].body,tr,Rr);tr=Mo(jr.elseBranch,tr,Rr)}else if(jr.type==="switch")for(_e=0;jr.cases!=null&&_e<jr.cases.length;_e++)tr=Mo(jr.cases[_e].body,tr,Rr);else if(jr.type==="fork"||jr.type==="split")for(_e=0;jr.branches!=null&&_e<jr.branches.length;_e++)tr=Mo(jr.branches[_e],tr,Rr);else jr.body!=null&&(tr=Mo(jr.body,tr,Rr))}return tr}function Zt($r,ee,Rr,tr,vr,Te){var jr=ee.length,_e=new Array(jr),Br=[],br=[],Or=[],xe=[],bo,_t,Wo,Fo,ut;for(Fo=0;Fo<jr;Fo++)Br.push({});if(Ae==null){for(bo=0,Fo=0;Fo<jr;Fo++)bo+=Rr[Fo];for(bo+=Te*(jr-1),_t=$r-bo/2,Wo=0,Fo=0;Fo<jr;Fo++)_e[Fo]=Math.round(_t+Wo+Rr[Fo]/2),Wo+=Rr[Fo]+Te,br.push(_e[Fo]),Or.push(Rr[Fo]/2);return{centres:_e,laneX:Br,own:br,ownHalfW:Or,other:xe}}var Do={},Fr=[];for(Fo=0;Fo<jr;Fo++){var Gt=pe(ee[Fo],tr[Fo]);for(ut=0;ut<Gt.length;ut++){var st=Gt[ut];Do[st]==null&&(Do[st]=[],Fr.push(st)),Do[st].push({i:Fo,w:ut===0?Rr[Fo]:pr(ee[Fo],tr[Fo],st),opening:ut===0})}}for(var Mn=0;Mn<Fr.length;Mn++){var jn=Fr[Mn],Hn=Do[jn],Xo=Qr(jn,vr);for(bo=0,ut=0;ut<Hn.length;ut++)bo+=Hn[ut].w;for(bo+=Te*(Hn.length-1),_t=(Xo?$r:Ae(jn))-bo/2,Wo=0,ut=0;ut<Hn.length;ut++){var Xn=Math.round(_t+Wo+Hn[ut].w/2);Wo+=Hn[ut].w+Te,Br[Hn[ut].i][jn]=Xn,Hn[ut].opening&&(_e[Hn[ut].i]=Xn),Xo?(br.push(Xn),Or.push(Hn[ut].w/2)):Hn[ut].opening&&xe.push(Xn)}}return{centres:_e,laneX:Br,own:br,ownHalfW:Or,other:xe}}function Uo($r,ee,Rr,tr,vr,Te){if(Ae==null)return{lo:vr,hi:Te};var jr=$r,_e=$r,Br;for(Br=0;Br<ee.length;Br++)ee[Br]-Rr[Br]<jr&&(jr=ee[Br]-Rr[Br]),ee[Br]+Rr[Br]>_e&&(_e=ee[Br]+Rr[Br]);for(Br=0;Br<tr.length;Br++)tr[Br]<$r?jr=Math.min(jr,$r-Al):_e=Math.max(_e,$r+Al);return{lo:jr,hi:_e}}function xn($r,ee,Rr,tr,vr,Te,jr){var _e="endArrow=none;strokeColor=#181818;",Br=Te-5>tr+5?tr+5:Math.round((tr+Te)/2);return ue(c("e"),"",_e,Rr,tr,Rr,Br,jr)+ue(c("e"),"",_e,Rr,Br,vr,Br,jr)+ue(c("e"),$r,ee,vr,Br,vr,Te,jr)}function gt($r){for(var ee=0;$r!=null&&ee<$r.length;ee++){var Rr=$r[ee].type;if(Rr!=="note"&&Rr!=="arrowLabel"&&Rr!=="swimlane"&&Rr!=="label")return!0}return!1}function To($r){for(var ee=null,Rr=0;$r!=null&&Rr<$r.length;Rr++){var tr=$r[Rr].type;if(tr==="arrowLabel")ee==null&&(ee=$r[Rr]);else if(tr!=="swimlane"&&tr!=="label")return!1}return ee}function Rt($r){if($r==null)return!1;for(var ee=$r.length-1;ee>=0&&($r[ee].type==="swimlane"||$r[ee].type==="label"||$r[ee].type==="arrowLabel"||$r[ee].type==="note");)ee--;if(ee<0)return!1;var Rr=$r[ee],tr;switch(Rr.type){case"stop":case"end":case"kill":case"detach":case"goto":return!0;case"break":return Lr.length>0;case"split":if(Rr.branches==null||Rr.branches.length===0)return!1;for(tr=0;tr<Rr.branches.length;tr++)if(!Rt(Rr.branches[tr]))return!1;return!0;case"switch":if(Rr.cases==null||Rr.cases.length===0)return!1;for(tr=0;tr<Rr.cases.length;tr++)if(!Rt(Rr.cases[tr].body))return!1;return!0;case"if":if(Rr.elseBranch==null||Rr.elseBranch.length===0||!Rt(Rr.thenBranch))return!1;for(tr=0;Rr.elseIfBranches!=null&&tr<Rr.elseIfBranches.length;tr++)if(!Rt(Rr.elseIfBranches[tr].body))return!1;return Rt(Rr.elseBranch);case"partition":return!1;default:return!1}}function Be($r){if($r==null)return"";var ee="",Rr=$r.color?Y($r.color):null;return Rr&&(ee+="strokeColor="+Rr+";"),$r.dashed?ee+="dashed=1;dashPattern=7 7;strokeWidth=1.5;":$r.dotted&&(ee+="dashed=1;dashPattern=1 3;strokeWidth=1.5;"),$r.bold?ee+="strokeWidth=2;":$r.thickness>0&&(ee+="strokeWidth="+$r.thickness+";"),ee}function Ao($r,ee,Rr){var tr=ee,vr=Rr,Te=Po($r,Re),jr=ee,_e=De;De=null;var Br=null,br=vr,Or=tr,xe=tr+qa/2,bo=null;function _t(zl,Yi,$i,Vi,Bs){var js="endArrow=none;strokeColor=#181818;",Ku=!1;if(zl===null){var sf=Be(bo);Ku=!!(bo&&bo.hidden),zl=bo?bo.label:"",Yi+=sf,js+=sf,bo=null}if(Ku)return zl?x(c("e"),zl,Yi,Or,br,$i,Vi,Bs):"";if(Or===$i)return ue(c("e"),zl,Yi,$i,br,$i,Vi,Bs);var su=Vi-ti>=br+5?Vi-ti:Math.round((br+Vi)/2);return ue(c("e"),"",js,Or,br,Or,su,Bs)+ue(c("e"),"",js,Or,su,$i,su,Bs)+ue(c("e"),zl,Yi,$i,su,$i,Vi,Bs)}function Wo(zl,Yi,$i,Vi,Bs,js,Ku,sf){var su=zl&&zl.length>0?zl[0]:null;return su&&su.type==="arrowLabel"&&su.hidden?Yi?x(c("e"),Yi,$i,Vi,Bs,js,Ku,sf):"":ue(c("e"),Yi,$i,Vi,Bs,js,Ku,sf)}function Fo(zl,Yi,$i){var Vi=c("rail");return S+=u(Vi,"",H("shape=line;strokeColor=#181818;strokeWidth=1;fillColor=none;",ze),zl,$i-bi/2,Yi-zl,bi,"1"),Vi}function ut(zl,Yi,$i,Vi){var Bs=ol/2,js=Vi+Bs;return Math.abs(zl-$i)<=1?ue(c("e"),"",me+"strokeColor=#181818;",zl,Yi,$i,Vi,"1"):ue(c("e"),"","endArrow=none;strokeColor=#181818;",zl,Yi,zl,js,"1")+ue(c("e"),"",me+"strokeColor=#181818;",zl,js,zl<$i?$i-Bs:$i+Bs,js,"1")}for(var Do=0;Do<$r.length;Do++){var Fr=$r[Do],Gt=c(Fr.type);switch(Fr.type){case"start":{var st=Y(Fr.color)||"#222222",Mn=Y(Fr.lineColor)||st;S+=u(Gt,"",ve("ellipse;fillColor="+st+";strokeColor="+Mn+";",["circle","start"],null,"vertex",Fr.color?he:null),tr-ul/2,vr,ul,ul,"1"),Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,vr,"1")),Br=Gt,Or=tr,br=vr+ul,vr+=ul+on;break}case"stop":{S+=u(Gt,"",ve("ellipse;shape=endState;fillColor=#222222;strokeColor=#222222;",["circle","stop"]),tr-Fl/2,vr,Fl,Fl,"1"),Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,vr,"1")),Br=null,Or=tr,br=vr+Fl,vr+=Fl+on;break}case"end":{S+=u(Gt,"",ve("ellipse;fillColor=#222222;strokeColor=#222222;",["circle","end"]),tr-ul/2,vr,ul,ul,"1"),Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,vr,"1")),Br=null,Or=tr,br=vr+ul,vr+=ul+on;break}case"action":{for(var jn=Y(Fr.color)||"#F1F1F1",Hn=Fr.label||"",Xo=Hn.split(`
+`),Xn=h(Hn,xr(Fr)),Ta=Math.max(Ni,Math.round(20+Xo.length*16.3)),Kn=Fr.shape||null,Qo=Xn+(Kn==="input"||Kn==="output"?10:0),pa=[];Do+1<$r.length&&$r[Do+1].type==="note";)pa.push($r[++Do]);var Mt=pa.length?Xr(pa,Qo,Ta):null,la=vr+(Mt?Mt.actDy:0),vn=tr-Xn/2,Jn="fillColor="+jn+";strokeColor=#181818;strokeWidth=0.5;whiteSpace=wrap;fontSize=12;align=left;spacingLeft=6;",qn;if(Kn==="input"||Kn==="output"){var ia=Math.round(1e4*(1-10/Qo))/1e4;qn="shape=mxgraph.basic.polygon;polyline=0;polyCoords="+(Kn==="input"?"[[0,0],[1,0],["+ia+",0.5],[1,1],[0,1]]":"[[0,0],["+ia+",0],[1,0.5],["+ia+",1],[0,1]]")+";"+Jn}else Kn==="procedure"?qn="shape=process;size=5;fixedSize=1;"+Jn:Kn==="save"?qn="shape=parallelogram;size=10;fixedSize=1;"+Jn:Kn==="load"?qn="shape=parallelogram;size=10;fixedSize=1;flipH=1;"+Jn:Kn==="task"?qn="rounded=0;"+Jn:Kn==="continuous"?qn="shape="+rr+";"+Jn:qn="rounded=1;absoluteArcSize=1;arcSize=25;"+Jn;if(qn=ve(qn,["activity"],xr(Fr),"vertex",Fr.color?he:null),n(Hn)?S+=z(Gt,v(Hn),qn+"html=1;",vn,la,Qo,Ta,"1"):S+=u(Gt,Hn,qn,vn,la,Qo,Ta,"1"),Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,la,"1")),Mt)for(var zn=0;zn<Mt.notes.length;zn++){var Ko=Mt.notes[zn],Bt=c("note");if(Ko.pointer){var ta=Ko.side==="left"?vn+Ko.dx+Ko.w-1:vn+Qo;S+=u(c("noteptr"),"",ve("triangle;direction="+(Ko.side==="left"?"east":"west")+";fillColor="+(Y(Ko.node.color)||"#FEFFDD")+";strokeColor=#181818;strokeWidth=0.5;",["note"],xr(Ko.node),"vertex",Ko.node.color?he:null),ta,Math.round(vr+Ko.dy+Ko.h/2-4),or+1,8,"1")}S+=u(Bt,Ko.node.text||"",wr(Ko.node),vn+Ko.dx,vr+Ko.dy,Ko.w,Ko.h,"1"),vn+Ko.dx+Ko.w>xe&&(xe=vn+Ko.dx+Ko.w)}Br=Gt,Or=tr,br=la+Ta,vr+=(Mt?Mt.totalH:Ta)+on;break}case"if":{if(Fr.elseIfBranches&&Fr.elseIfBranches.length>0){for(var ln=[{condition:Fr.condition,thenLabel:Fr.thenLabel,body:Fr.thenBranch||[]}],mo=0;mo<Fr.elseIfBranches.length;mo++)ln.push(Fr.elseIfBranches[mo]);var Vt=vr,nt=Vt+fl/2,kr=Vt+fl+on,Ir=42,Tr=[],Gr=[];for(mo=0;mo<ln.length;mo++){var Vr=F(ln[mo].condition);Tr.push(Vr),Gr.push(Math.max(Vr,pr(ln[mo].body,Re)))}var Ge=[],Jr=tr;for(mo=0;mo<ln.length;mo++)mo>0&&(Jr+=Gr[mo-1]/2+Ir+Gr[mo]/2),Ge.push(Jr);var co=Fr.elseBranch&&Fr.elseBranch.length>0,Ie=co?Math.max(pr(Fr.elseBranch,Re),60):0,Ee=Jr+Gr[ln.length-1]/2+Ir+Ie/2;Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,Vt,"1"));var qo=[],Ot=[],no=[],Fn=[],Cn=kr;for(mo=0;mo<ln.length;mo++){var yt=ln[mo],wt=Ge[mo];S+=u(c("diamond"),yt.condition||"",ve("shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+Dr+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"]),wt-Tr[mo]/2,Vt,Tr[mo],fl,"1"),mo>0&&(S+=ue(c("e"),"",me+"strokeColor=#181818;",Ge[mo-1]+Tr[mo-1]/2,nt,wt-Tr[mo]/2,nt,"1")),S+=ue(c("e"),yt.thenLabel||"",me+"strokeColor=#181818;fontSize=11;",wt,Vt+fl,wt,kr,"1");var rt=kr,le=null;yt.body&&yt.body.length>0&&(le=Ao(yt.body,wt,kr),rt=le.prevY||le.y,le.maxX>xe&&(xe=le.maxX)),qo.push(le!=null?le.prevX:wt),Ot.push(rt),no.push(le!=null?le.lastId:null),Fn.push(!Rt(yt.body)),rt>Cn&&(Cn=rt),wt+Gr[mo]/2>xe&&(xe=wt+Gr[mo]/2)}if(co){S+=ue(c("e"),Fr.elseLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",Ge[ln.length-1]+Tr[ln.length-1]/2,nt,Ee,nt,"1"),S+=ue(c("e"),"",me+"strokeColor=#181818;",Ee,nt,Ee,kr,"1");var Fe=Ao(Fr.elseBranch,Ee,kr),$e=Fe.prevY||Fe.y;Fe.maxX>xe&&(xe=Fe.maxX),Ee+Ie/2>xe&&(xe=Ee+Ie/2),qo.push(Fe.prevX),Ot.push($e),no.push(Fe.lastId),Fn.push(!Rt(Fr.elseBranch)),$e>Cn&&(Cn=$e)}else S+=ue(c("e"),Fr.elseLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",Ge[ln.length-1]+Tr[ln.length-1]/2,nt,Ee,nt,"1"),qo.push(Ee),Ot.push(nt),no.push(null),Fn.push(!0),Ee>xe&&(xe=Ee);var Se=Cn+on,ro=1/0,It=-1/0,Jo=0,xo=-1;for(mo=0;mo<qo.length;mo++)Fn[mo]&&(Jo++,xo=mo,qo[mo]<ro&&(ro=qo[mo]),qo[mo]>It&&(It=qo[mo]));if(Jo>1){var Et=Fo(ro,It,Se);for(mo=0;mo<qo.length;mo++)Fn[mo]&&(S+=ue(c("e"),"",me+"strokeColor=#181818;",qo[mo],Ot[mo],qo[mo],Se,"1"));tr=Math.round((ro+It)/2),Br=Et,Or=tr,br=Se,vr=Se+on}else Jo===1?((co||xo<ln.length)&&(tr=qo[xo]),Br=no[xo]||Br,Or=qo[xo],br=Ot[xo],vr=Cn+on):(Br=null,vr=Cn+on);break}var Vn=c("diamond"),Un=F(Fr.condition);S+=u(Vn,Fr.condition||"",ve("shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+Dr+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"]),tr-Un/2,vr,Un,fl,"1"),Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,vr,"1"));var bt=vr+fl/2,mt=vr+fl+on,In=[];if(Fr.elseIfBranches&&Fr.elseIfBranches.length>0)for(var Zn=0;Zn<Fr.elseIfBranches.length;Zn++)for(var Oe=0;Oe<Fr.elseIfBranches[Zn].body.length;Oe++)In.push(Fr.elseIfBranches[Zn].body[Oe]);if(Fr.elseBranch)for(var uo=0;uo<Fr.elseBranch.length;uo++)In.push(Fr.elseBranch[uo]);var io=In.length>0,we=yo([Fr.thenBranch||[],In],Re),de=pr(Fr.thenBranch,we[0]),$o=pr(In,we[1]),ft=32,Vo=io?Math.round(tr-(ft/2+de/2)):tr,zo=Math.round(tr+(ft/2+$o/2)),ka=ie([Vo,zo],we,Re);Vo=ka[0],zo=ka[1];var sa=mt,_a=mt,Ba=Vo,No=!1;if(S+=Wo(Fr.thenBranch,Fr.thenLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",tr-Un/2,bt,Vo,bt,"1"),S+=Wo(Fr.thenBranch,"",me+"strokeColor=#181818;",Vo,bt,Vo,mt,"1"),Fr.thenBranch&&Fr.thenBranch.length>0){var vt=Ao(Fr.thenBranch,Vo,mt);sa=vt.prevY||vt.y,Ba=vt.prevX,_a=Math.max(sa,vt.y-on),No=!0,vt.maxX>xe&&(xe=vt.maxX)}var Wt=mt,Nt=mt,$a=zo,sn=!1;if(io){S+=Wo(In,Fr.elseLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",tr+Un/2,bt,zo,bt,"1"),S+=Wo(In,"",me+"strokeColor=#181818;",zo,bt,zo,mt,"1");var ce=Ao(In,zo,mt);Wt=ce.prevY||ce.y,$a=ce.prevX,Nt=Math.max(Wt,ce.y-on),sn=!0,ce.maxX>xe&&(xe=ce.maxX),zo+$o/2>xe&&(xe=zo+$o/2)}var yr=!No||!Rt(Fr.thenBranch),Io=!sn||!Rt(In),ge=(yr?1:0)+(Io?1:0);if(ge===1&&(No||sn)){Br=(yr?No?vt.lastId:null:sn?ce.lastId:null)||Vn,Or=yr?Ba:$a,br=yr?sa:Wt,vr=Math.max(_a,Nt)+on;break}vr=Math.max(_a,Nt)+on;var Ct=c("merge"),Nn=ol/2;S+=u(Ct,"",ve("rhombus;fillColor="+Dr+";strokeColor=#181818;",["activity","diamond"]),tr-Nn,vr,ol,ol,"1"),No&&yr&&(S+=ut(Ba,sa,tr,vr)),sn&&Io&&(S+=ut($a,Wt,tr,vr)),Br=Ct,Or=tr,br=vr+ol,vr+=ol+on;break}case"while":{var Qn=c("wdiamond"),kn=F(Fr.condition),Ke=vr,yn=vr+fl/2;S+=u(Qn,Fr.condition||"",ve("shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+Dr+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"]),tr-kn/2,vr,kn,fl,"1"),Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,vr,"1"));var tn=vr+fl+on+14;S+=Wo(Fr.body,Fr.isLabel||"",me+"strokeColor=#181818;fontSize=11;",tr,vr+fl,tr,tn,"1");var Ia=tn,Ma=tn,Sl=tr,Ll=tr,ja=te();if(Fr.body&&Fr.body.length>0){var Ja=Ao(Fr.body,tr,tn);Ia=Ja.y,Ma=Ja.prevY||Ia,Sl=Ja.prevX,Ll=Ja.maxX,Ja.maxX>xe&&(xe=Ja.maxX)}var Ol=Math.max(Ma,Ia-on);W();var Yl=tr+(Fr.body&&Fr.body.length>0?pr(Fr.body,Re)/2:0),ko=Math.round(Math.max(tr+kn/2,Yl,Ll)+15),fo=Ma+10;S+=ue(c("e"),"","endArrow=none;strokeColor=#181818;",Sl,Ma,Sl,fo,"1"),S+=ue(c("e"),"","endArrow=none;strokeColor=#181818;",Sl,fo,ko,fo,"1"),S+=ue(c("e"),"","endArrow=none;strokeColor=#181818;",ko,fo,ko,yn,"1"),S+=ue(c("e"),"",me+"strokeColor=#181818;",ko,yn,tr+kn/2,yn,"1");var lt=Fr.body&&Fr.body.length>0?pr(Fr.body,Re)/2:0,Lt=Math.round(tr-Math.max(kn/2+18,lt+24)),ao=Ol+26;S+=ue(c("e"),Fr.endLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",tr-kn/2,yn,Lt,yn,"1"),S+=ue(c("e"),"","endArrow=none;strokeColor=#181818;",Lt,yn,Lt,ao,"1"),S+=ue(c("e"),"","endArrow=none;strokeColor=#181818;",Lt,ao,tr,ao,"1"),S+=Zr(ja,Lt,ao,"1"),Br=Qn,Or=tr,br=ao,vr=ao+on;break}case"repeat":{Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,vr,"1"));var wa=c("rstart"),ho=vr,Ra=24,Va=24;if(Fr.label){var un=Y(Fr.color)||"#F1F1F1";Ra=h(Fr.label),Va=Math.max(Ni,Math.round(20+Fr.label.split(`
+`).length*16.3)),S+=u(wa,Fr.label,ve("rounded=1;absoluteArcSize=1;arcSize=25;fillColor="+un+";strokeColor=#181818;strokeWidth=0.5;whiteSpace=wrap;fontSize=12;align=left;spacingLeft=6;",["activity"],null,"vertex",Fr.color?he:null),tr-Ra/2,vr,Ra,Va,"1")}else S+=u(wa,"",ve("rhombus;fillColor="+Dr+";strokeColor=#181818;",["activity","diamond"]),tr-12,vr,24,24,"1");var En=Math.round(ho+Va/2),Oa=tr+Ra/2,Vl=ho+Va+on;S+=ue(c("e"),"",me+"strokeColor=#181818;",tr,ho+Va,tr,Vl,"1"),vr=Vl;var Wl=vr,hi=vr,Ci=tr+di/2,Qa=te();if(Fr.body&&Fr.body.length>0){var na=Ao(Fr.body,tr,vr);Wl=na.prevY||na.y,na.maxX>xe&&(xe=na.maxX),na.maxX>Ci&&(Ci=na.maxX),hi=Wl+on,Br=na.lastId,Or=na.prevX,br=Wl,Br&&(S+=_t("",me+"strokeColor=#181818;",tr,hi,"1"))}W();var ai=c("rdiamond"),Ql=!Fr.condition,kn=Ql?ol:F(Fr.condition),Dl=Ql?ol:fl,ri=hi+Dl/2;S+=u(ai,Fr.condition||"",ve(Ql?"rhombus;fillColor="+Dr+";strokeColor=#181818;":"shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+Dr+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"]),tr-kn/2,hi,kn,Dl,"1");var wi=0,Pi=0;Fr.backward&&(wi=h(Fr.backward.label||""),Pi=Math.max(Ni,Math.round(20+(Fr.backward.label||"").split(`
+`).length*16.3)));var Ha=Math.round(Math.max(tr+kn/2,Ci,Oa)+12+wi/2);if(S+=ue(c("e"),Fr.isLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",tr+kn/2,ri,Ha,ri,"1"),Fr.backward){var Ml=Math.round((ho+Va+ri)/2-Pi/2);S+=ue(c("e"),Fr.backward.incomingLabel||"",me+"strokeColor=#181818;fontSize=11;",Ha,ri,Ha,Ml+Pi,"1"),S+=u(c("backward"),Fr.backward.label||"",ve("rounded=1;absoluteArcSize=1;arcSize=25;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;whiteSpace=wrap;fontSize=12;align=left;spacingLeft=6;",["activity"]),Ha-wi/2,Ml,wi,Pi,"1"),S+=ue(c("e"),Fr.backward.outgoingLabel||"","endArrow=none;strokeColor=#181818;fontSize=11;",Ha,Ml,Ha,En,"1")}else S+=ue(c("e"),"","endArrow=none;strokeColor=#181818;",Ha,ri,Ha,En,"1");if(S+=ue(c("e"),"",me+"strokeColor=#181818;",Ha,En,Oa,En,"1"),Ha+wi/2>xe&&(xe=Ha+wi/2),Br=ai,Or=tr,br=hi+Dl,Qa.length>0){var os=hi+Dl+on,ts=os+ol/2,Fi=Math.round(tr-Math.max(kn/2+18,Ci-tr+24)),ca=c("rmerge");S+=ue(c("e"),"",me+"strokeColor=#181818;",tr,br,tr,os,"1"),S+=u(ca,"",ve("rhombus;fillColor="+Dr+";strokeColor=#181818;",["activity","diamond"]),tr-ol/2,os,ol,ol,"1"),S+=Zr(Qa,Fi,ts,"1"),S+=ue(c("e"),"","endArrow=none;strokeColor=#181818;",Fi,Math.min(Qa[0].y+10,ts),Fi,ts,"1"),S+=ue(c("e"),"",me+"strokeColor=#181818;",Fi,ts,tr-ol/2,ts,"1"),Br=ca,br=os+ol}bo=Fr.exitArrow||(Fr.notLabel?{label:Fr.notLabel}:null),bo&&!bo.label&&(bo.label=Fr.notLabel||""),vr=br+on+14;break}case"fork":{let zl=function($i){return $i<tr?ds+Jl/2:ds+Rs-Jl/2},Yi=function($i){return $i<il?ya+Jl/2:ya+Xl-Jl/2};for(var bn=Fr.branches?Fr.branches.length:0,ll=yo(Fr.branches||[],Re),ml=Re,Gl=[],rl=0,nl=0;nl<bn;nl++){var yl=pr(Fr.branches[nl],ll[nl]);Gl.push(yl),rl+=yl}bn>1&&(rl+=Al*(bn-1));var vi=tr-rl/2,hl=Zt(tr,Fr.branches||[],Gl,ll,ml,Al),gs=hl.centres,ns=Uo(tr,hl.own,hl.ownHalfW,hl.other,vi,vi+rl),ds=Math.round(ns.lo-Jl),Rs=Math.round(ns.hi-ns.lo+2*Jl);Rs<ki&&(ds=Math.round(tr-ki/2),Rs=ki);var al=c("forkbar");S+=u(al,"",qr(),ds,vr,Rs,Di,"1"),Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,vr,"1"));for(var Ti=vr+Di,cs=Ti+on,hs=cs,Tl=[],ei=0;ei<bn;ei++){var Ka=gs[ei],Xi=Fr.branches[ei]||[],Na=Qr(ll[ei],ml),Bl=To(Xi);if(Bl!==!1){Tl.push({bx:Ka,by:Ti,alive:!0,own:Na,deco:Bl});continue}Na?S+=Wo(Xi,"",me+"strokeColor=#181818;",Ka,Ti,Ka,cs,"1"):Xi[0].type==="arrowLabel"&&Xi[0].hidden||(S+=xn("",me+"strokeColor=#181818;",zl(Ka),Ti,Ka,cs,"1")),De=hl.laneX[ei];var wl=Ao(Xi,Ka,cs);Tl.push({bx:wl.prevX,by:wl.prevY||wl.y,alive:!Rt(Xi),own:Na}),wl.y>hs&&(hs=wl.y),wl.maxX>xe&&(xe=wl.maxX)}vr=hs;var li=ml,La;for(La=0;La<bn;La++)li=Qe(Fr.branches[La]||[],li);var il=tr,ya=ds,Xl=Rs;for(La=0;La<Tl.length;La++)Tl[La].exitOwn=Pe==null||Pe(Tl[La].bx)===li;if(!Qr(li,ml)){il=li===Te?jr:Ae(li);var nu=il,zi=il;for(La=0;La<Tl.length;La++)!Tl[La].alive||!Tl[La].exitOwn||(Tl[La].bx<nu&&(nu=Tl[La].bx),Tl[La].bx>zi&&(zi=Tl[La].bx));ya=Math.round(nu-Jl),Xl=Math.round(zi-nu+2*Jl),Xl<ki&&(ya=Math.round(il-ki/2),Xl=ki)}for(La=0;La<Tl.length;La++){var Il=Tl[La];if(Il.alive){var qs=Il.deco&&Il.deco.label||"",Xt=me+"strokeColor=#181818;"+Be(Il.deco||null);Il.deco&&Il.deco.hidden?qs&&(S+=x(c("e"),qs,Xt,Il.bx,Il.by,Il.bx,vr,"1")):Il.exitOwn?S+=ue(c("e"),qs,Xt,Il.bx,Il.by,Il.bx,vr,"1"):S+=xn(qs,Xt,Il.bx,Il.by,Yi(Il.bx),vr,"1")}}var Zs=c("joinbar");S+=u(Zs,"",qr(),ya,vr,Xl,Di,"1"),ya+Xl>xe&&(xe=ya+Xl),Br=Zs,Or=il,tr=il,br=vr+Di,vr+=Di+on;break}case"split":{for(var ii=Fr.branches?Fr.branches.length:0,qi=yo(Fr.branches||[],Re),Ls=Re,Zi=[],gn=0;gn<ii;gn++)Zi.push(pr(Fr.branches[gn],qi[gn]));var Pa=Zt(tr,Fr.branches||[],Zi,qi,Ls,Al),kl=Pa.centres,bl=[];for(gn=0;gn<Pa.own.length;gn++)bl.push(0);var si=Uo(tr,Pa.own,bl,Pa.other,ii>0?kl[0]:tr,ii>0?kl[ii-1]:tr),ql=vr,ji=ii>1,gu=ql+on;ji&&(Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,ql,"1")),Fo(si.lo,si.hi,ql));for(var za=gu,as=[],Gs=0;Gs<ii;Gs++){var vs=kl[Gs],ws=Fr.branches[Gs]||[],Ln=Qr(qi[Gs],Ls),Sn=ji?To(ws):!1;if(Sn!==!1){as.push({bx:vs,by:ql,id:null,alive:!0,own:Ln,deco:Sn});continue}ji&&Ln?S+=Wo(ws,"",me+"strokeColor=#181818;",vs,ql,vs,gu,"1"):ji?ws.length>0&&ws[0].type==="arrowLabel"&&ws[0].hidden||(S+=xn("",me+"strokeColor=#181818;",vs<tr?si.lo:si.hi,ql,vs,gu,"1")):Br&&(S+=_t(null,me+"strokeColor=#181818;",vs,gu,"1")),De=Pa.laneX[Gs];var pi=Ao(ws,vs,gu);as.push({bx:pi.prevX,by:pi.prevY||pi.y,id:pi.lastId,alive:!Rt(ws),own:Ln}),pi.y>za&&(za=pi.y),pi.maxX>xe&&(xe=pi.maxX)}for(var ls=za,Ps=Ls,Ji=0;Ji<ii;Ji++)Ps=Qe(Fr.branches[Ji],Ps);var As=Qr(Ps,Ls)?tr:Ps===Te?jr:Ae(Ps),au=As,Eu=As,xf=0,Hl;for(Ji=0;Ji<as.length;Ji++)Hl=as[Ji],Hl.alive&&(xf++,Hl.exitOwn=Pe==null||Pe(Hl.bx)===Ps,Hl.exitOwn?(Hl.bx<au&&(au=Hl.bx),Hl.bx>Eu&&(Eu=Hl.bx)):Hl.bx<As?As-Al<au&&(au=As-Al):As+Al>Eu&&(Eu=As+Al));if(ji&&xf>0){var Kc=Fo(au,Eu,ls);for(Ji=0;Ji<as.length;Ji++)if(Hl=as[Ji],!!Hl.alive){var Cf=Hl.deco&&Hl.deco.label||"",pf=me+"strokeColor=#181818;"+Be(Hl.deco||null);Hl.deco&&Hl.deco.hidden?Cf&&(S+=x(c("e"),Cf,pf,Hl.bx,Hl.by,Hl.bx,ls,"1")):Hl.exitOwn?S+=ue(c("e"),Cf,pf,Hl.bx,Hl.by,Hl.bx,ls,"1"):S+=xn(Cf,pf,Hl.bx,Hl.by,Hl.bx<As?au:Eu,ls,"1")}Br=Kc,Or=As,tr=As,br=ls,vr=ls+on}else ji?(Br=null,Or=tr,br=ls,vr=ls):ii===1&&(Br=as[0].alive?as[0].id||Br:null,Or=as[0].bx,br=as[0].by,vr=za);break}case"switch":{var cd=c("swdiamond"),kn=F(Fr.condition),of=vr+fl/2,Yd=vr+fl,Yf=Y(Fr.color)||Dr;S+=u(cd,Fr.condition||"",ve("shape=hexagon;perimeter=hexagonPerimeter2;fillColor="+Yf+";strokeColor=#181818;whiteSpace=wrap;fontSize=11;",["activity","diamond"],null,"vertex",Fr.color?he:null),tr-kn/2,vr,kn,fl,"1"),Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,vr,"1"));for(var lu=vr+fl+on+14,Ts=lu,hd=Fr.cases?Fr.cases.length:0,$f=[],iu=0;iu<hd;iu++)$f.push(Fr.cases[iu].body||[]);var tf=yo($f,Re),nf=[];for(iu=0;iu<hd;iu++){var zc=(Fr.cases[iu].label||"").length*5.5+20;nf.push(Math.max(pr($f[iu],tf[iu]),zc))}for(var vd=Zt(tr,$f,nf,tf,Re,yi),Md=vd.centres,Ru=[],xs=0;xs<hd;xs++){var Ys=Md[xs];if(Ys<tr-1?(S+=ue(c("e"),"","endArrow=none;strokeColor=#181818;",tr-kn/2,of,Ys,of,"1"),S+=ue(c("e"),Fr.cases[xs].label||"",me+"strokeColor=#181818;fontSize=11;",Ys,of,Ys,lu,"1")):Ys>tr+1?(S+=ue(c("e"),"","endArrow=none;strokeColor=#181818;",tr+kn/2,of,Ys,of,"1"),S+=ue(c("e"),Fr.cases[xs].label||"",me+"strokeColor=#181818;fontSize=11;",Ys,of,Ys,lu,"1")):S+=ue(c("e"),Fr.cases[xs].label||"",me+"strokeColor=#181818;fontSize=11;",tr,Yd,Ys,lu,"1"),Fr.cases[xs].body&&Fr.cases[xs].body.length>0){De=vd.laneX[xs];var af=Ao(Fr.cases[xs].body,Ys,lu);af.y>Ts&&(Ts=af.y),af.maxX>xe&&(xe=af.maxX),Ru.push({x:af.prevX,y:af.prevY||lu,live:!Rt(Fr.cases[xs].body)})}else Ru.push({x:Ys,y:lu,live:!0})}for(var Hd=0,Mf=0;Mf<Ru.length;Mf++)Ru[Mf].live&&Hd++;if(Hd===0){Br=null,Or=tr,br=Ts,vr=Ts;break}var Hf=Ts+on,Su=ol/2,Ct=c("swmerge");S+=u(Ct,"",ve("rhombus;fillColor="+Yf+";strokeColor=#181818;",["activity","diamond"],null,"vertex",Fr.color?he:null),tr-Su,Hf,ol,ol,"1");for(var gf=0;gf<Ru.length;gf++)Ru[gf].live&&(S+=ut(Ru[gf].x,Ru[gf].y,tr,Hf));Br=Ct,Or=tr,br=Hf+ol,vr=Hf+ol+on;break}case"note":{var Ms=nr(Fr),Rf=Fr.position==="left"?tr-qa/2-Ms.w-q:tr+qa/2+q;S+=u(Gt,Fr.text||"",wr(Fr),Rf,Math.round(br-Ni/2-Ms.h/2),Ms.w,Ms.h,"1"),Br&&(S+=mr(c("noteln"),"","endArrow=none;dashed=1;html=1;strokeColor=#181818;",Gt,Br,"1")),Rf+Ms.w>xe&&(xe=Rf+Ms.w);break}case"partition":{if(!Fr.body||Fr.body.length===0)break;var Af=Fr.name||Fr.label||"",Kd=Math.round(Mi(Af))+10,Cd=20,pd=vr,Kf=pd+Cd+16,zd="",xi=gt(Fr.body);Br&&xi&&(zd=_t(null,me+"strokeColor=#181818;",tr,Kf,"1"));var $d=S;S="";for(var lf=Ao(Fr.body,tr,Kf),Mu=S,mf=tr,kf=tr,_f=Kf,gd=/<mxGeometry x="([-\d.]+)" y="([-\d.]+)" width="([-\d.]+)" height="([-\d.]+)"/g,Hs;(Hs=gd.exec(Mu))!=null;)+Hs[1]<mf&&(mf=+Hs[1]),+Hs[1]+ +Hs[3]>kf&&(kf=+Hs[1]+ +Hs[3]),+Hs[2]+ +Hs[4]>_f&&(_f=+Hs[2]+ +Hs[4]);var Ei=mf-10,Rd=kf+10,zf=Kd+10-(Rd-Ei);zf>0&&(Ei-=zf/2,Rd+=zf/2);var Of=Rd-Ei,Uf=_f+12,Ud=Y(Fr.color)||"none",Hu=U(Ze,Pr(["partition"]),[],"vertex");Fr.color?(delete Hu.fillColor,delete Hu.gradientColor):Hu.fillColor!=null&&(Hu.swimlaneFillColor=Hu.fillColor),S=$d+u(Gt,Af,H("shape=umlFrame;width="+Kd+";height="+Cd+";fillColor="+Ud+";swimlaneFillColor="+Ud+";strokeColor=#181818;strokeWidth=1;fontSize=14;fontColor=#000000;align=left;verticalAlign=middle;spacingLeft=1;whiteSpace=wrap;",Hu),Ei,pd,Of,Uf-pd,"1")+zd+Mu,Ei+Of>xe&&(xe=Ei+Of),xi&&(Br=lf.lastId||Gt,Or=lf.prevX,br=lf.prevY||lf.y),vr=Uf+on/2;break}case"detach":{Br=null,vr-=on/2;break}case"break":{Lr.length>0&&(Lr[Lr.length-1].push({x:Or,y:br}),Br=null);break}case"goto":{Br=null;break}case"label":break;case"spot":{S+=u(Gt,Fr.letter||"","ellipse;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;verticalAlign=middle;",tr-ul/2,vr,ul,ul,"1"),Br&&(S+=_t(null,me+"strokeColor=#181818;",tr,vr,"1")),Br=Gt,Or=tr,br=vr+ul,vr+=ul+on;break}case"swimlane":{Re=Fr.name,Ae!=null&&(tr=_e!=null&&_e[Re]!=null?_e[Re]:Re===Te?jr:Ae(Re));break}case"arrowLabel":{bo=Fr,Fr.label&&(vr+=16);break}default:break}}return{y:vr,maxX:xe,lastId:Br,prevY:br,prevX:Or}}var et=r.swimlanes||[];if(et.length>0){let $r=function(ee){var Rr=Tn[ee]!=null?Tn[ee]:0;return xl+Rr*(go+Ho)+go/2};for(var jo=r.nodes||[],Tn={},dn=0;dn<et.length;dn++)Tn[et[dn].name]=dn;for(var An=30,Bo=40,kt=0;kt<jo.length;kt++)if(jo[kt].type==="action"){var Yn=h(jo[kt].label||"",xr(jo[kt]));Yn>Bo&&(Bo=Yn)}var go=Math.max(90,Bo+56),Ho=0;Re=et[0].name;var Ro=xl+An,At=null,ot=null,oo=null,to=null,cn=null;Ae=$r,Pe=function(ee){var Rr=Math.floor((ee-xl)/(go+Ho));return Rr<0&&(Rr=0),Rr>=et.length&&(Rr=et.length-1),et[Rr].name};for(var Yt=0;Yt<jo.length;Yt++){var so=jo[Yt];if(so.type==="swimlane"){Re=so.name;continue}if(so.type==="arrowLabel"){cn=so,so.label&&(Ro+=Hi+(String(so.label).split(/\\n|\n/).length-1)*Lu);continue}var Bn=$r(Re);if(so.type==="note"){Ao([so],Bn,Ro);continue}if(At!=null){var tt=cn&&cn.label||"",an=Be(cn),Ga=!!(cn&&cn.hidden),hn=me+"strokeColor=#181818;"+an,Da="endArrow=none;strokeColor=#181818;"+an,jt=oo??Ro-on;if(cn=null,Ga)tt&&(S+=x(c("e"),tt,hn,ot,jt,Bn,Ro,"1"));else if(to===Re&&ot===Bn)S+=ue(c("e"),tt,hn,ot,jt,Bn,Ro,"1");else{var _n=Ro-ti>=jt+5?Ro-ti:Math.round((jt+Ro)/2);S+=ue(c("e"),tt,Da,ot,jt,ot,_n,"1"),S+=ue(c("e"),"",Da,ot,_n,Bn,_n,"1"),S+=ue(c("e"),"",hn,Bn,_n,Bn,Ro,"1")}}var da=Ro,Jt=Ao([so],Bn,Ro);At=Rt([so])?null:"tracker",ot=Jt.prevX,oo=Jt.prevY>da?Jt.prevY:null,to=Re,Ro=Jt.y}for(var Ut=S,ga="",mn=Ro,ma=mn-on-xl+6,oa=xl,On=0;On<et.length;On++){var Za=et[On],be=Y(Za.color)||"none",$n=c("lane"),Wn=U(Ze,Pr(["swimlane"]),[],"vertex");Za.color?(delete Wn.fillColor,delete Wn.gradientColor):Wn.fillColor!=null&&(Wn.swimlaneFillColor=Wn.fillColor),ga+=u($n,Za.name,H("swimlane;collapsible=0;startSize="+An+";fillColor="+be+";swimlaneFillColor="+be+";strokeColor=#181818;strokeWidth=1.5;fontColor=#000000;fontSize=18;fontStyle=0;html=1;",Wn),oa,xl,go,ma,"1"),oa+=go+Ho}return ga+Ut}return Ao(r.nodes,fr,zr),S}var Li=41,ks=13,ru=20,Zu=7,Gu=14.13,_s=20,Os=22,hu=24,Is=80,ku=8,Gi=16,eu=22,ys=12;function cf(r,l){var e=r.nodes||[],c=r.edges||[],i=r.partitions||[],h=r.skin||{},F="",j=0,p,or,q,rr,nr;if(e.length===0)return"";function Xr(Oe){return"lg"+Oe+"_"+j++}function wr(Oe,uo){if(uo){var io=h[(Oe+"<<"+uo+">>").toLowerCase()];if(io!=null)return io}return h[Oe.toLowerCase()]}function pr(Oe,uo,io){return Y(wr(Oe,uo))||io}function Dr(Oe){return s(Oe||"").split(`
+`)}function Ze(Oe,uo){for(var io=0,we=0;we<Oe.length;we++){var de=Hr(Oe[we],uo);de>io&&(io=de)}return io}var he={},Pr={};for(p=0;p<e.length;p++){rr=e[p],he[rr.id]=rr;var ve={w:0,h:0,cellId:Xr(rr.type),x:0,y:0};if(rr.type==="start")ve.w=_s,ve.h=_s;else if(rr.type==="end")ve.w=Os,ve.h=Os;else if(rr.type==="branch")ve.w=hu,ve.h=hu;else if(rr.type==="bar")ve.w=Is,ve.h=ku;else if(rr.type==="note"){var xr=Dr(rr.label);ve.w=Math.max(40,Math.round(Ze(xr,13)+22)),ve.h=Math.max(24,Math.round(xr.length*15.3+10))}else{var qr=Dr(rr.label),ze=parseFloat(wr("activityFontSize",rr.stereotype))||12;ve.w=Math.max(30,Math.round(Ze(qr,ze)+20)),ve.h=Math.round(20+qr.length*Gu*ze/12)}Pr[rr.id]=ve}var wo={};function me(Oe){for(;wo[Oe]!==Oe;)wo[Oe]=wo[wo[Oe]],Oe=wo[Oe];return Oe}function ue(Oe,uo){Oe=me(Oe),uo=me(uo),Oe!==uo&&(wo[uo]=Oe)}for(p=0;p<e.length;p++)wo[e[p].id]=e[p].id;var po=[],x=[];for(p=0;p<c.length;p++)nr=c[p],!(!he[nr.from]||!he[nr.to]||nr.from===nr.to||nr.constraint===!1)&&(nr.direction==="left"?(ue(nr.from,nr.to),x.push({before:nr.to,after:nr.from})):nr.direction==="right"||nr.direction==null&&nr.length<=1?(ue(nr.from,nr.to),x.push({before:nr.from,after:nr.to})):nr.direction==="up"?po.push({from:nr.to,to:nr.from,minlen:Math.max(1,nr.length-1)}):po.push({from:nr.from,to:nr.to,minlen:Math.max(1,nr.length-1)}));for(p=0;p<e.length;p++)rr=e[p],!(rr.type!=="note"||rr.target==null||!he[rr.target])&&(rr.position==="top"?po.push({from:rr.id,to:rr.target,minlen:1}):rr.position==="bottom"?po.push({from:rr.target,to:rr.id,minlen:1}):(ue(rr.id,rr.target),rr.position==="left"?x.push({before:rr.id,after:rr.target}):x.push({before:rr.target,after:rr.id})));var S=[],fr={};for(p=0;p<e.length;p++){var zr=me(e[p].id);fr[zr]==null&&(fr[zr]=[],S.push(zr))}var Lr=[];for(p=0;p<po.length;p++){var te=me(po[p].from),W=me(po[p].to);te!==W&&(Lr.push({from:te,to:W,minlen:po[p].minlen,back:!1}),fr[te].push(Lr.length-1))}var Zr={};for(p=0;p<S.length;p++)Zr[S[p]]=0;function Re(Oe){var uo=[{node:Oe,idx:0}];for(Zr[Oe]=1;uo.length>0;){var io=uo[uo.length-1],we=fr[io.node];if(io.idx<we.length){var de=Lr[we[io.idx++]];Zr[de.to]===1?de.back=!0:Zr[de.to]===0&&(Zr[de.to]=1,uo.push({node:de.to,idx:0}))}else Zr[io.node]=2,uo.pop()}}for(p=0;p<S.length;p++)Zr[S[p]]===0&&Re(S[p]);var Ae={},Pe={};for(p=0;p<S.length;p++)Ae[S[p]]=0,Pe[S[p]]=0;for(p=0;p<Lr.length;p++)Lr[p].back||Ae[Lr[p].to]++;var De=[];for(p=0;p<S.length;p++)Ae[S[p]]===0&&De.push(S[p]);for(var Qr=S.length*S.length+16;De.length>0&&Qr-- >0;){var Po=De.shift(),Qe=fr[Po];for(or=0;or<Qe.length;or++){var yo=Lr[Qe[or]];yo.back||(Pe[yo.to]<Pe[Po]+yo.minlen&&(Pe[yo.to]=Pe[Po]+yo.minlen),--Ae[yo.to]===0&&De.push(yo.to))}}var ie={},pe=[];for(p=0;p<e.length;p++){var Mo=Pe[me(e[p].id)]||0;for(ie[e[p].id]=Mo;pe.length<=Mo;)pe.push([]);pe[Mo].push(e[p].id)}var Zt=0,Uo=[];for(p=0;p<c.length;p++)if(nr=c[p],Uo[p]=null,!(!he[nr.from]||!he[nr.to]||nr.from===nr.to)){var xn=Math.min(ie[nr.from],ie[nr.to]),gt=Math.max(ie[nr.from],ie[nr.to]);if(!(gt-xn<=1)){var To=[];for(q=xn+1;q<gt;q++){var Rt="dummy#"+ ++Zt;he[Rt]={id:Rt,type:"dummy",label:"",partition:null},Pr[Rt]={w:8,h:0,cellId:null,x:0,y:0},ie[Rt]=q,pe[q].push(Rt),To.push(Rt)}Uo[p]=To}}var Be={},Ao={},et=[];for(q=0;q<pe.length;q++)for(or=0;or<pe[q].length;or++)Be[pe[q][or]]=[],Ao[pe[q][or]]=[],et.push(pe[q][or]);function jo(Oe,uo){!he[Oe]||!he[uo]||Oe===uo||ie[Oe]===ie[uo]||(ie[Oe]<ie[uo]?(Ao[Oe].push(uo),Be[uo].push(Oe)):(Ao[uo].push(Oe),Be[Oe].push(uo)))}for(p=0;p<c.length;p++){if(nr=c[p],Uo[p]==null){jo(nr.from,nr.to);continue}var Tn=ie[nr.from]<ie[nr.to]?nr.from:nr.to,dn=Tn===nr.from?nr.to:nr.from,An=Tn;for(or=0;or<Uo[p].length;or++)jo(An,Uo[p][or]),An=Uo[p][or];jo(An,dn)}for(p=0;p<e.length;p++)e[p].type==="note"&&e[p].target!=null&&jo(e[p].id,e[p].target);var Bo={};function kt(Oe){for(var uo=0;uo<Oe.length;uo++)Bo[Oe[uo]]=uo}for(q=0;q<pe.length;q++)kt(pe[q]);function Yn(Oe,uo){for(var io=[],we=0;we<Oe.length;we++){var de=uo[Oe[we]],$o=we;if(de.length>0){for(var ft=0,Vo=0;Vo<de.length;Vo++)ft+=Bo[de[Vo]];$o=ft/de.length}io.push({id:Oe[we],bary:$o,idx:we})}for(io.sort(function(zo,ka){return zo.bary!==ka.bary?zo.bary-ka.bary:zo.idx-ka.idx}),we=0;we<io.length;we++)Oe[we]=io[we].id;kt(Oe)}for(var go=0;go<4;go++){for(q=1;q<pe.length;q++)Yn(pe[q],Be);for(q=pe.length-2;q>=0;q--)Yn(pe[q],Ao)}for(p=0;p<x.length;p++){var Ho=x[p].before,Ro=x[p].after;if(!(ie[Ho]==null||ie[Ho]!==ie[Ro]||Bo[Ho]<Bo[Ro])){var At=pe[ie[Ho]];At.splice(Bo[Ho],1),At.splice(Bo[Ro],0,Ho),kt(At)}}if(i.length>0)for(q=0;q<pe.length;q++){for(var ot=pe[q],oo={},to=0;to<ot.length;){var cn=he[ot[to]].partition||"",Yt=oo[cn];if(Yt!=null&&Yt<to-1){var so=ot.splice(to,1)[0];ot.splice(Yt+1,0,so);for(var Bn in oo)oo.hasOwnProperty(Bn)&&oo[Bn]>Yt&&oo[Bn]++;oo[cn]=Yt+1}else oo[cn]=to;to++}kt(ot)}function tt(Oe){return he[Oe].partition||null}function an(Oe,uo){if(he[Oe].type==="dummy"||he[uo].type==="dummy")return ru;var io=tt(Oe),we=tt(uo);return io===we?ru:ru+(io?Gi:0)+(we?Gi:0)+4}var Ga=[],hn=0;for(q=0;q<pe.length;q++){var Da=0;for(or=0;or<pe[q].length;or++)Da+=Pr[pe[q][or]].w,or>0&&(Da+=an(pe[q][or-1],pe[q][or]));Ga[q]=Da,Da>hn&&(hn=Da)}var jt={};for(q=0;q<pe.length;q++){var _n=(hn-Ga[q])/2;for(or=0;or<pe[q].length;or++){var da=pe[q][or];or>0&&(_n+=an(pe[q][or-1],da)),jt[da]=_n+Pr[da].w/2,_n+=Pr[da].w}}function Jt(Oe,uo){for(var io=[0],we=1;we<Oe.length;we++)io[we]=io[we-1]+Pr[Oe[we-1]].w/2+an(Oe[we-1],Oe[we])+Pr[Oe[we]].w/2;var de=[];for(we=0;we<Oe.length;we++){for(var $o={sum:uo[we]-io[we],count:1,end:we};de.length>0&&de[de.length-1].sum/de[de.length-1].count>$o.sum/$o.count;){var ft=de.pop();$o.sum+=ft.sum,$o.count+=ft.count}de.push($o)}for(var Vo=0,zo=0;zo<de.length;zo++)for(var ka=de[zo].sum/de[zo].count,sa=0;sa<de[zo].count;sa++,Vo++)jt[Oe[Vo]]=ka+io[Vo]}function Ut(Oe){var uo=Oe?1:pe.length-2,io=Oe?pe.length:-1,we=Oe?1:-1;for(q=uo;q!==io;q+=we){var de=pe[q],$o=[];for(or=0;or<de.length;or++){var ft=Oe?Be[de[or]]:Ao[de[or]];if(ft.length===0){$o.push(jt[de[or]]);continue}for(var Vo=0,zo=0;zo<ft.length;zo++)Vo+=jt[ft[zo]];$o.push(Vo/ft.length)}Jt(de,$o)}}for(Ut(!0),Ut(!1),Ut(!0),Ut(!1),Ut(!0),p=0;p<c.length;p++)if(!(Uo[p]==null||Uo[p].length<2)){var ga=0;for(or=0;or<Uo[p].length;or++)ga+=jt[Uo[p][or]];for(or=0;or<Uo[p].length;or++)jt[Uo[p][or]]=ga/Uo[p].length}function mn(){for(var Oe=0;Oe<pe.length;Oe++)for(var uo=1;uo<pe[Oe].length;uo++){var io=pe[Oe][uo-1],we=pe[Oe][uo],de=jt[io]+Pr[io].w/2+an(io,we)+Pr[we].w/2;jt[we]<de&&(jt[we]=de)}}if(mn(),i.length>1){let Oe=function(we,de){for(var $o=0;de!=null&&$o++<32;){if(ma[de]===we)return!0;de=ma[de]}return!1},uo=function(we){for(var de=[],$o=0;$o<e.length;$o++)for(var ft=e[$o].partition,Vo=0;ft!=null&&Vo++<32;){if(ft===we){de.push(e[$o].id);break}ft=ma[ft]}return de},io=function(we){for(var de={x0:1/0,x1:-1/0,r0:1/0,r1:-1/0,sum:0},$o=0;$o<we.length;$o++){var ft=Pr[we[$o]],Vo=jt[we[$o]];Vo-ft.w/2<de.x0&&(de.x0=Vo-ft.w/2),Vo+ft.w/2>de.x1&&(de.x1=Vo+ft.w/2),ie[we[$o]]<de.r0&&(de.r0=ie[we[$o]]),ie[we[$o]]>de.r1&&(de.r1=ie[we[$o]]),de.sum+=Vo}return de.mean=de.sum/we.length,de};var ma={};for(p=0;p<i.length;p++)ma[i[p].id]=i[p].parent;for(var oa=0;oa<8;oa++){var On=!1;for(p=0;p<i.length;p++)for(or=0;or<i.length;or++)if(!(p===or||Oe(i[p].id,i[or].id)||Oe(i[or].id,i[p].id))){var Za=uo(i[p].id),be=uo(i[or].id);if(!(Za.length===0||be.length===0)){var $n=io(Za),Wn=io(be);if(!($n.r1<Wn.r0||Wn.r1<$n.r0)){var $r=2*Gi+4;if(!($n.x1+$r<=Wn.x0||Wn.x1+$r<=$n.x0)){for(var ee=$n.mean<=Wn.mean?be:Za,Rr=$n.mean<=Wn.mean?$n.x1+$r-Wn.x0:Wn.x1+$r-$n.x0,tr=0;tr<ee.length;tr++)jt[ee[tr]]+=Rr;On=!0}}}}if(!On)break}mn()}var vr=[],Te=[];for(q=0;q<pe.length;q++){var jr=0;for(or=0;or<pe[q].length;or++)Pr[pe[q][or]].h>jr&&(jr=Pr[pe[q][or]].h);vr[q]=jr,Te[q]=Li}for(p=0;p<c.length;p++)if(nr=c[p],!(!he[nr.from]||!he[nr.to]||!nr.label)){var _e=Math.min(ie[nr.from],ie[nr.to]);Math.abs(ie[nr.from]-ie[nr.to])===1&&Te[_e]<Li+ks&&(Te[_e]=Li+ks)}var Br={},br={},Or={};for(p=0;p<i.length;p++){Or[i[p].id]=p;for(var xe=0,bo=i[p].parent;bo!=null&&xe<32;)xe++,bo=i[Or[bo]]?i[Or[bo]].parent:null;br[i[p].id]=xe}function _t(Oe,uo){var io=Br[Oe];io==null?Br[Oe]={min:uo,max:uo}:(uo<io.min&&(io.min=uo),uo>io.max&&(io.max=uo))}for(p=0;p<e.length;p++)for(var Wo=e[p].partition,Fo=0;Wo!=null&&Or[Wo]!=null&&Fo++<32;)_t(Wo,ie[e[p].id]),Wo=i[Or[Wo]].parent;var ut=[],Do=[];for(q=0;q<pe.length;q++)ut[q]=0,Do[q]=0;for(var Fr in Br)if(Br.hasOwnProperty(Fr)){var Gt=br[Fr]+1,st=Br[Fr],Mn=Gt*(eu+ys),jn=Gt*Gi;Mn>ut[st.min]&&(ut[st.min]=Mn),jn>Do[st.max]&&(Do[st.max]=jn)}var Hn=[],Xo=Zu;for(q=0;q<pe.length;q++)Xo+=ut[q],Hn[q]=Xo,Xo+=vr[q]+Do[q]+Te[q];var Xn=1/0;for(p=0;p<e.length;p++){var Ta=Pr[e[p].id],Kn=e[p].partition?(br[e[p].partition]+1)*Gi:0;e[p].type==="branch"&&e[p].condition&&(Kn+=Hr(s(e[p].condition),11)+4),jt[e[p].id]-Ta.w/2-Kn<Xn&&(Xn=jt[e[p].id]-Ta.w/2-Kn)}var Qo=Zu-Xn;for(p=0;p<et.length;p++){var pa=Pr[et[p]],Mt=ie[et[p]];pa.x=Math.round(jt[et[p]]+Qo-pa.w/2),pa.y=Math.round(Hn[Mt]+(vr[Mt]-pa.h)/2)}for(p=0;p<e.length;p++)if(rr=e[p],!(rr.type!=="note"||rr.edge==null||!c[rr.edge])){var la=c[rr.edge];if(!(!he[la.from]||!he[la.to])){var vn=Pr[la.from],Jn=Pr[la.to],qn=(vn.x+vn.w/2+Jn.x+Jn.w/2)/2,ia=(vn.y+vn.h/2+Jn.y+Jn.h/2)/2,zn=Pr[rr.id];zn.x=Math.round(qn+14),zn.y=Math.round(ia-zn.h/2)}}var Ko={};for(p=i.length-1;p>=0;p--){var Bt=i[p],ta=1/0,ln=1/0,mo=-1/0,Vt=-1/0;for(or=0;or<e.length;or++)if(e[or].partition===Bt.id){var nt=Pr[e[or].id];nt.x<ta&&(ta=nt.x),nt.y<ln&&(ln=nt.y),nt.x+nt.w>mo&&(mo=nt.x+nt.w),nt.y+nt.h>Vt&&(Vt=nt.y+nt.h)}for(or=p+1;or<i.length;or++){var kr=Ko[i[or].id];i[or].parent!==Bt.id||kr==null||(kr.x<ta&&(ta=kr.x),kr.y<ln&&(ln=kr.y),kr.x+kr.w>mo&&(mo=kr.x+kr.w),kr.y+kr.h>Vt&&(Vt=kr.y+kr.h))}if(isFinite(ta)){if(Bt.inner){Ko[Bt.id]={x:ta-7,y:ln-7,w:mo-ta+14,h:Vt-ln+14,titleW:0};continue}var Ir=Math.round(Hr(Bt.name,14,!0)+14);Ko[Bt.id]={x:ta-Gi,y:ln-eu-ys,w:Math.max(mo-ta+2*Gi,Ir+20),h:Vt-ln+eu+ys+Gi,titleW:Ir}}}for(p=0;p<i.length;p++){var Tr=Ko[i[p].id];if(Tr!=null){if(i[p].inner){F+=u(Xr("inner"),"","rounded=1;absoluteArcSize=1;arcSize=25;fillColor=#FFFFFF;strokeColor=#A80036;strokeWidth=1.5;",Tr.x,Tr.y,Tr.w,Tr.h,"1");continue}var Gr=Y(i[p].color)||pr("partitionBackgroundColor",i[p].stereotype,"none"),Vr=pr("partitionBorderColor",i[p].stereotype,"#000000");F+=u(Xr("part"),"","rounded=0;fillColor="+Gr+";strokeColor="+Vr+";strokeWidth=1.5;",Tr.x,Tr.y,Tr.w,Tr.h,"1"),F+=u(Xr("ptab"),i[p].name,"rounded=0;fillColor="+Gr+";strokeColor="+Vr+";strokeWidth=1.5;fontStyle=1;fontSize=14;fontColor=#000000;align=left;verticalAlign=middle;spacingLeft=2;whiteSpace=wrap;",Tr.x,Tr.y,Tr.titleW,eu,"1")}}var Ge=pr("activityArrowColor",null,null)||pr("arrowColor",null,"#181818");for(p=0;p<e.length;p++){rr=e[p];var Jr=Pr[rr.id],co,Ie="";if(rr.type==="start"){var Ee=pr("activityStartColor",null,"#222222");co="ellipse;fillColor="+Ee+";strokeColor="+Ee+";"}else if(rr.type==="end"){var qo=pr("activityEndColor",null,"#222222");co="ellipse;shape=endState;fillColor="+qo+";strokeColor="+qo+";"}else if(rr.type==="branch"){Ie=rr.condition||"";var Ot=pe[ie[rr.id]],no=Bo[rr.id]>0&&Bo[rr.id]===Ot.length-1;co="rhombus;fillColor="+pr("activityDiamondBackgroundColor",null,"#F1F1F1")+";strokeColor="+pr("activityDiamondBorderColor",null,"#181818")+";strokeWidth=0.5;fontSize=11;verticalLabelPosition=top;verticalAlign=bottom;"+(no?"labelPosition=right;align=left;":"labelPosition=left;align=right;")}else if(rr.type==="bar"){var Fn=pr("activityBarColor",null,"#555555");co="shape=rectangle;fillColor="+Fn+";strokeColor="+Fn+";"}else if(rr.type==="note")Ie=rr.label||"",co="shape=note;size=14;fillColor="+(Y(rr.color)||pr("noteBackgroundColor",null,"#FEFFDD"))+";strokeColor="+pr("noteBorderColor",null,"#181818")+";strokeWidth=0.5;fontSize=13;whiteSpace=wrap;align=left;verticalAlign=middle;spacingLeft=2;";else{Ie=rr.label||"";var Cn=Y(rr.color)||pr("activityBackgroundColor",rr.stereotype,"#F1F1F1"),yt=parseFloat(wr("activityFontSize",rr.stereotype))||12;co="rounded=1;absoluteArcSize=1;arcSize=25;fillColor="+Cn+";strokeColor="+pr("activityBorderColor",rr.stereotype,"#181818")+";strokeWidth=0.5;whiteSpace=wrap;fontSize="+yt+";fontColor="+pr("activityFontColor",rr.stereotype,"#000000")+";align=left;spacingLeft=6;"}F+=u(Jr.cellId,Ie,co,Jr.x,Jr.y,Jr.w,Jr.h,"1")}var wt=0;for(p=0;p<e.length;p++)Pr[e[p].id].x+Pr[e[p].id].w>wt&&(wt=Pr[e[p].id].x+Pr[e[p].id].w);function rt(Oe,uo,io,we,de,$o){var ft=' <mxGeometry relative="1" as="geometry"'+($o?`>
`:`/>
-`);if($o){Jo+=` <Array as="points">
-`;for(var Wt=0;Wt<$o.length;Wt++)Jo+=' <mxPoint x="'+$o[Wt].x+'" y="'+$o[Wt].y+`"/>
-`;Jo+=` </Array>
+`);if($o){ft+=` <Array as="points">
+`;for(var Vo=0;Vo<$o.length;Vo++)ft+=' <mxPoint x="'+$o[Vo].x+'" y="'+$o[Vo].y+`"/>
+`;ft+=` </Array>
</mxGeometry>
-`}var at=P(ie,pe);return' <mxCell id="'+d(me)+'" value="'+at.value+'" style="'+d(at.style)+'" edge="1" source="'+d(ke)+'" target="'+d(Re)+`" parent="1">
-`+Jo+` </mxCell>
-`}var Ae={};for(v=0;v<h.length;v++)ce[h[v].from]&&ce[h[v].to]&&(Ae[h[v].from+""+h[v].to]=!0);for(v=0;v<h.length;v++)if(tr=h[v],!(!ce[tr.from]||!ce[tr.to]||tr.hidden)){var Fe=Nr[tr.from],le=Nr[tr.to],Ne="endArrow=classic;endSize=8;strokeColor="+(Y(tr.color)||Xe)+";fontSize=11;fontColor=#000000;";(tr.dashed||tr.dotted)&&(Ne+="dashed=1;"),tr.bold&&(Ne+="strokeWidth=2;");var Qe=null;if(tr.from===tr.to)Ne+="edgeStyle=orthogonalEdgeStyle;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;";else if(oo[v]!=null&&oo[v].length>0){Qe=[];var tn=oo[v],Vo=Te[tr.from]<Te[tr.to];for(er=0;er<tn.length;er++){var xo=Nr[tn[Vo?er:tn.length-1-er]];Qe.push({x:Math.round(xo.x+xo.w/2),y:Math.round(xo.y+xo.h/2)})}}else if(Ae[tr.to+""+tr.from]&&Te[tr.from]!==Te[tr.to]){var Co=tr.from<tr.to?.3:.7,mn=Te[tr.from]<Te[tr.to];Ne+="exitX="+Co+";exitY="+(mn?1:0)+";exitDx=0;exitDy=0;entryX="+Co+";entryY="+(mn?0:1)+";entryDx=0;entryDy=0;"}b+=Pn(wr("e"),tr.label||"",Ne,Fe.cellId,le.cellId,Qe)}for(v=0;v<e.length;v++)if(V=e[v],V.type==="note"){var pn=Nr[V.id];if(V.target!=null&&ce[V.target]){var hn=Nr[V.target],Co=V.position||"right",Dt="endArrow=none;strokeColor=#181818;";Co==="left"?Dt+="exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;":Co==="right"?Dt+="exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;":Co==="top"?Dt+="exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;":Dt+="exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;",b+=vr(wr("noteln"),"",Dt,pn.cellId,hn.cellId,"1")}}if(r.title){var ca=Math.max(60,Math.round(Gr(r.title,14,!0)+20)),ea=String(r.title).split(`
-`).length*20+4;b+=s(wr("title"),r.title,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",Math.round((Ws+Vt)/2-ca/2),Ws-ea-12,ca,ea,"1")}return b}var wf=160,as=49,uf=35,Su=24,Za=60,Gs=24,hl=16,Qo=6,hu=20,Xs=26,Sd=20,ff=16,nu=10,Bu=15,df=33;function zi(r,a){for(var e=String(r??""),h=0,l=0,C=0;C<e.length;C++){var b=e.charAt(C);b===`
-`?(h>l&&(l=h),h=0):`iIljtf.,:;!|'"()[]{} `.indexOf(b)>=0?h+=4.2:"mwMW".indexOf(b)>=0?h+=11.7:h+=7.8}return h>l&&(l=h),l*(a?1.05:1)}function Tu(r){return typeof r=="string"&&/^\s*<[$&][A-Za-z0-9_-]+>\s*$/.test(r)}function cf(r){return typeof r=="string"&&/<size:\d|<[$&][A-Za-z0-9_-]+>/i.test(r)}function hf(r){var a=String(r??"");a=a.replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," "),a=a.replace(/<U\+([0-9A-Fa-f]{2,6})>/g,function(tr,wr){try{return String.fromCodePoint(parseInt(wr,16))}catch{return""}}),a=a.replace(/<[&$][A-Za-z0-9_-]+>/g,function(tr){return u(tr)}),a=a.replace(/\*\*([\s\S]+?)\*\*/g,"$1").replace(/\/\/([\s\S]+?)\/\//g,"$1").replace(/__([\s\S]+?)__/g,"$1").replace(/~~([\s\S]+?)~~/g,"$1").replace(/""([\s\S]+?)""/g,"$1");for(var e=a.split(`
-`),h=0,l=0,C=[],b=0;b<e.length;b++){var Z=e[b],v=14,er=Z.match(/<size:(\d+(?:\.\d+)?)>/i);er&&(v=parseFloat(er[1]));var X=Z.replace(/<[^>]+>/g,"");X===""&&(X=" "),!er&&X.replace(/\s+/g,"").length===1&&X.charCodeAt(0)>8192&&(v=28);var V=zi(X,!1)*(v/14);V>h&&(h=V),l+=v>20&&X.replace(/\s+/g,"").length<=1?v*.95:v*1.33,v!==14?C.push('<font style="font-size:'+v+'px">'+X+"</font>"):C.push(X)}return{w:Math.ceil(h),h:Math.ceil(l),html:C.join("<br>")}}function Rs(r){var a=Y(r.color)||"#F1F1F1",e=Tu(r.name);switch(r.kind){case"actor":case"person":return"shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;fillColor="+a+";strokeColor=#181818;";case"interface":return"ellipse;fillColor="+a+";strokeColor=#181818;fontSize=12;";case"port":case"portin":case"portout":return"shape=mxgraph.sysml.port1;fillColor="+a+";strokeColor=#181818;fontSize=10;";case"database":return"shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;fillColor="+a+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"queue":return"shape=queue;fillColor="+a+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"cloud":return"shape=cloud;fillColor="+a+";strokeColor=#181818;whiteSpace=wrap;";case"node":return"shape=cube;size=10;fillColor="+a+";strokeColor=#181818;whiteSpace=wrap;";case"folder":return"shape=folder;tabWidth=40;tabHeight=14;tabPosition=left;fillColor="+a+";strokeColor=#181818;whiteSpace=wrap;";case"frame":return"shape=mxgraph.uml25.frame;fillColor="+a+";strokeColor=#181818;whiteSpace=wrap;";case"file":return"shape=note;size=10;fillColor="+a+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"card":case"agent":return"rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+a+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"storage":return"rounded=1;arcSize=50;fillColor="+a+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"usecase":return"ellipse;fillColor="+a+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"hexagon":return"shape=hexagon;fillColor="+a+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"circle":case"control":case"entity":return"ellipse;fillColor="+a+";strokeColor=#181818;whiteSpace=wrap;";case"label":return"text;html=1;fillColor=none;strokeColor=none;whiteSpace=wrap;";case"rectangle":var h="rounded=1;absoluteArcSize=1;arcSize=3;strokeWidth=1;fillColor="+a+";strokeColor=#181818;whiteSpace=wrap;";return e&&(h+="fontSize=48;fontColor=#000000;align=center;verticalAlign=middle;"),h;case"collections":case"stack":case"boundary":return"rounded=0;fillColor="+a+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"component":default:return"rounded=1;absoluteArcSize=1;arcSize=6;fillColor="+a+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;"}}function Bd(r){return Math.max(24,Math.round(zi(r.name||"",!1))+12)}function Cf(r){return String(r.name||"").split(`
-`).length}function Td(r){var a=Y(r.color)||"none";switch(r.kind){case"package":case"folder":return"shape=folder;tabWidth="+Bd(r)+";tabHeight="+(23+16*(Cf(r)-1))+";tabPosition=left;html=1;whiteSpace=wrap;fillColor="+a+";strokeColor=#000000;strokeWidth=1.5;fontSize=14;fontStyle=0;fontColor=#000000;align=left;verticalAlign=top;spacingLeft=4;spacingTop=-2;";case"frame":return"shape=umlFrame;width="+(Math.round(zi(r.name||"",!1))+10)+";height="+(20+16*(Cf(r)-1))+";html=1;whiteSpace=wrap;fillColor="+a+";swimlaneFillColor="+a+";strokeColor=#181818;strokeWidth=1;fontSize=14;fontStyle=0;fontColor=#000000;align=left;verticalAlign=middle;spacingLeft=1;";case"node":return"shape=cube;size="+nu+";fillColor="+a+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=12;fontSize=14;fontStyle=1;whiteSpace=wrap;";case"database":return"shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;fillColor="+a+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=0;fontSize=14;fontStyle=1;whiteSpace=wrap;";case"cloud":return"shape=mxgraph.basic.cloud_rect;html=1;fillColor="+a+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=8;fontSize=14;fontStyle=1;whiteSpace=wrap;";case"artifact":return"swimlane;collapsible=0;startSize="+Xs+";fillColor="+a+";strokeColor=#181818;fontStyle=1;";case"card":return"swimlane;collapsible=0;startSize="+Xs+";shape=card;fillColor="+a+";strokeColor=#181818;fontStyle=1;";case"storage":return"swimlane;collapsible=0;startSize="+Xs+";fillColor="+a+";strokeColor=#181818;fontStyle=1;";case"rectangle":return"rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+a+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=2;fontSize=14;fontStyle=1;whiteSpace=wrap;";case"component":return"rounded=1;absoluteArcSize=1;arcSize=12;fillColor="+a+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=10;fontSize=14;whiteSpace=wrap;";default:return"swimlane;collapsible=0;startSize="+Xs+";fillColor="+a+";strokeColor=#181818;fontStyle=1;"}}var Pf=18,vf=4,pf={interface:!0,circle:!0,control:!0,entity:!0,boundary:!0,actor:!0};function Iu(r){switch(r.kind){case"interface":return{w:18,h:18};case"circle":return{w:34,h:34};case"control":return{w:34,h:34};case"entity":return{w:34,h:40};case"boundary":return{w:56,h:34};case"actor":return{w:40,h:54};default:return null}}var Cu=16.5;function Li(r){var a=r.substring(0,2);return r.length>=2&&r!=="..."&&(a==="--"||a==="=="||a===".."||a==="__")&&r.substring(r.length-2)===a}function Nu(r){var a=r.body||[],e={size:14,bold:!1},h={size:14,bold:!1,family:"mono"},l="",C=0,b=0,Z=!1,v=!1,er=!1;function X(Nr){return"border:none;border-top:"+(Nr==="="?"3px double":Nr==="."?"1px dotted":"1px solid")+" #181818;"}function V(Nr){return n(Nr.replace(/\\/g,"")).replace(/\u0003/g,"\\")}function tr(Nr){return String(Nr).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}if(r.stereotype){var wr="\xAB"+r.stereotype+"\xBB";l+='<div style="text-align:center;"><i>'+n(wr)+"</i></div>",C=Math.max(C,Ds(wr,e)),b+=Cu}for(var yr=0;yr<a.length;yr++){var fr=a[yr];if(/^<code>$/i.test(fr)){v=!0;continue}if(/^<\/code>$/i.test(fr)){v=!1;continue}if(!v&&Li(fr)){var Ar=fr.charAt(0),jr=fr.substring(2,fr.length-2).replace(/^\s+|\s+$/g,"");Z=!0,er=!1,jr===""?(l+='<hr style="'+X(Ar)+(Ar==="="?"margin:4px 0 1px;":"margin:0 0 4px;")+'">',b+=Ar==="="?8:4):(l+='<div style="display:flex;align-items:center;margin:2px 0;"><span style="flex:1;'+X(Ar)+'"></span><span style="border:1px solid #181818;padding:0 1px;">'+n(jr)+'</span><span style="flex:1;'+X(Ar)+'"></span></div>',b+=20.5,C=Math.max(C,Ds(u(jr),e)+4));continue}if(er&&(l+="<br>"),v)l+='<span style="font-family:monospace;white-space:pre;">'+tr(fr)+"</span>",C=Math.max(C,Ds(fr,h));else{var ce=/^<<\s*([^>]*?)\s*>>$/.exec(fr);ce&&(fr="\xAB"+ce[1]+"\xBB"),l+=V(fr),C=Math.max(C,Uf(fr,e))}b+=Cu,er=!0}return Z&&(b+=4),{html:l,w:C,h:Math.max(b,Cu)}}function Gi(r){switch(r){case"component":case"node":case"frame":return 15;case"queue":return 5;case"collections":return 8;default:return 10}}function ls(r){if(!r)return{w:wf,h:as};if(r.kind==="port"||r.kind==="portin"||r.kind==="portout")return{w:ff,h:ff};if(r.kind==="note"){for(var a=u(r.name),e=a.split(`
-`),h=0,l=0;l<e.length;l++)e[l].length>h&&(h=e[l].length);return{w:Math.max(50,Math.ceil(h*6)+21),h:Math.max(24,Math.round(e.length*17.7+10))}}var C=r.body?Nu(r):null,b=u(r.name),Z=b.split(`
-`).length,v=Z>1&&!C?Z*16+14:0,er=Iu(r);if(er&&pf[r.kind]){var X=Math.round(zi(b,!1))+6;return{w:Math.max(er.w,X),h:er.h+vf+Pf}}if(!C&&Tu(r.name))return{w:68,h:68};if(!C&&cf(r.name)){var V=hf(r.name);switch(r.kind){case"usecase":var tr=Math.round(V.w*1.35)+30,wr=V.h+26;return tr<wr*1.3&&(tr=Math.round(wr*1.3)),{w:tr,h:wr};case"cloud":return{w:V.w+84,h:V.h+72};case"database":return{w:V.w+44,h:V.h+58};case"queue":return{w:V.w+56,h:V.h+20};case"stack":return{w:V.w+30,h:V.h+18};default:return{w:V.w+20,h:V.h+8}}}var yr=C?Math.ceil(C.w):Math.round(zi(b,!1)),fr=Math.max(60,yr+40),Ar=as;if(r.kind==="artifact"?(fr=Math.max(50,yr+30),Ar=40):r.kind==="file"||r.kind==="agent"||r.kind==="storage"?(fr=Math.max(50,yr+20),Ar=37):r.kind==="card"?(fr=Math.max(40,yr+20),Ar=23):r.kind==="hexagon"?(fr=Math.max(60,2*yr),Ar=27):r.kind==="database"?(fr=Math.max(50,yr+20),Ar=46):r.kind==="usecase"?(fr=Math.max(40,Math.round(Math.SQRT2*(yr+4.3))),Ar=29):r.kind==="person"?(fr=Math.max(70,yr+24),Ar=66):r.kind==="label"?(fr=Math.max(20,yr+8),Ar=20):r.kind==="collections"?(fr=Math.max(60,yr+20),Ar=37):r.kind==="stack"?(fr=Math.max(60,yr+50),Ar=37):r.kind==="queue"?(fr=Math.max(50,yr+20),Ar=27):r.kind==="folder"?(fr=Math.max(60,yr+30),Ar=54):r.kind==="package"?(fr=Math.max(70,yr+42),Ar=40):r.kind==="frame"&&(fr=Math.max(70,yr+40),Ar=47),C){var jr=C.h-Cu;Ar+=Math.round(r.kind==="usecase"?jr*1.4:jr)}else v>Ar&&(Ar=v);return{w:fr,h:Ar}}function vu(r,a){var e=r.nodes,h=r.containers,l=r.connections,C="",b=0,Z=r.styleSheet||null,v=null,er=["fillColor","gradientColor"],X=Z!=null?String(Z.skinparams.componentstyle||"").toLowerCase():"";function V(Rr){return Rr==="portin"||Rr==="portout"?"port":Rr==="bracket"||Rr==="bare"||!Rr?"component":Rr}function tr(Rr,xr,br,Br,Pr){return W(Rr,Z,["root","element","componentDiagram"].concat(xr),br||[],Br||"vertex",Pr)}function wr(Rr,xr){if(v==null||Z==null)return Rr;var br=xr?"edge":Rr.indexOf("text;")===0?"text":"vertex",Br=H(Z,["root","element","componentDiagram",v.name],v.stereotypes,br);if(v.skip!=null)for(var Pr=0;Pr<v.skip.length;Pr++)delete Br[v.skip[Pr]];return Br.fillColor!=null&&/swimlaneFillColor=/.test(Rr)&&(Br.swimlaneFillColor=Br.fillColor),M(Rr,Br)}function yr(Rr,xr,br){v=Z==null?null:{name:V(Rr),stereotypes:xr?[xr]:[],skip:br?er:null}}for(var fr=function(Rr,xr,br,Br,Pr,Xe,zr,Ke){var De=wr(br,!1);return String(Rr).indexOf("ci_")===0&&De!==br&&(De=De.replace(/(^|;)(?:rounded|arcSize|absoluteArcSize)=[^;]*(?=;|$)/g,"$1").replace(/;;+/g,";").replace(/^;/,""),/^rounded=1;/.test(br)&&!/rounded=/.test(De)&&(De="rounded=1;"+De)),$(Rr,xr,De,Br,Pr,Xe,zr,Ke)},Ar=function(Rr,xr,br,Br,Pr,Xe,zr,Ke){return B(Rr,xr,wr(br,!0),Br,Pr,Xe,zr,Ke)},jr=0;jr<e.length;jr++)e[jr].stereotype&&!e[jr]._stereoFolded&&!e[jr].body&&(e[jr].name="\xAB"+e[jr].stereotype+`\xBB
-`+(e[jr].name||""),e[jr]._stereoFolded=!0);for(var ce=0;ce<h.length;ce++)h[ce].stereotype&&!h[ce]._stereoFolded&&(h[ce].name="\xAB"+h[ce].stereotype+`\xBB
-`+(h[ce].name||""),h[ce]._stereoFolded=!0);var Nr={rectangle:1,node:1,cloud:1,database:1,frame:1,card:1};if(r.packageStyle&&Nr[r.packageStyle])for(var de=0;de<h.length;de++)h[de].kind==="package"&&(h[de].kind=r.packageStyle);function Fr(Rr){return Rr+"_"+b++}for(var Ir={},qe={},To={},ne={},po={},ao={},A=0;A<h.length;A++){var J=h[A];To[J.id]=J,po[J.id]=J.parent==null?null:J.parent,ao[J.id]=!0}for(var ur=0;ur<e.length;ur++){var Sr=e[ur];ne[Sr.id]=Sr,po[Sr.id]=Sr.parent==null?null:Sr.parent}function Er(Rr,xr){for(var br=Rr,Br=0;br!=null&&Br++<4096;){var Pr=po.hasOwnProperty(br)?po[br]:null;if(xr==null){if(Pr==null)return br}else if(Pr===xr)return br;if(Pr==null)return null;br=Pr}return null}function qr(Rr,xr){return Rr&&xr?Su:uf}function z(Rr,xr){return Rr&&xr?Gs:Za}for(var Mr={},Be=r.togethers||[],ye=0;ye<Be.length;ye++)for(var Le=0;Le<Be[ye].length;Le++)Mr[Be[ye][Le]]=ye;function _e(Rr,xr,br){for(var Br=[],Pr=[],Xe={},zr=0;zr<Rr.length;zr++){var Ke=Mr[Rr[zr]];if(Ke===void 0){Br.push(Rr[zr]);continue}Xe.hasOwnProperty(Ke)||(Xe[Ke]=Pr.length,Pr.push({members:[],slot:Br.length}),xr||Br.push(null)),Pr[Xe[Ke]].members.push(Rr[zr])}if(Pr.length===0)return Rr;for(var De=0;De<Pr.length;De++){var ze=Be[Mr[Pr[De].members[0]]];Pr[De].members.sort(function(At,ht){return ze.indexOf(At)-ze.indexOf(ht)}),br&&Pr[De].members.reverse()}if(xr){for(var So=0;So<Pr.length;So++)Br=Br.concat(Pr[So].members);return Br}for(var ot=[],ve=0;ve<Br.length;ve++){if(Br[ve]!=null){ot.push(Br[ve]);continue}for(var Yt=0;Yt<Pr.length;Yt++)Pr[Yt].slot===ve&&(ot=ot.concat(Pr[Yt].members))}return ot}var Ur={},yo={};function fo(Rr){Rr=_e(Rr,!1,!1);for(var xr=Rr.length,br={},Br=Math.max(1,Math.ceil(Math.sqrt(xr))),Pr=Math.ceil(xr/Br),Xe=0,zr=0,Ke=0;Ke<xr;Ke++){var De=Ur[Rr[Ke]];De.w>Xe&&(Xe=De.w),De.h>zr&&(zr=De.h)}for(var ze=0;ze<xr;ze++){var So=Math.floor(ze/Br),ot=ze%Br,ve=Ur[Rr[ze]],Yt=ot*(Xe+uf),At=So*(zr+Za);br[Rr[ze]]={x:Yt+(Xe-ve.w)/2,y:At+(zr-ve.h)/2}}return{pos:br,w:Br*Xe+(Br-1)*uf,h:Pr*zr+(Pr-1)*Za}}function he(Rr,xr){var br=Rr.length,Br={};if(br===0)return{pos:Br,w:0,h:0};for(var Pr={},Xe=0;Xe<br;Xe++)Pr[Rr[Xe]]=!0;for(var zr={},Ke={},De=[],ze=!1,So=!1,ot=!1,ve=0;ve<br;ve++)zr[Rr[ve]]=[],Ke[Rr[ve]]=0;function Yt(za,vl){for(var Va=[za],Ol={};Va.length>0;){var Fl=Va.pop();if(Fl===vl)return!0;if(!Ol[Fl]){Ol[Fl]=!0;for(var cl=zr[Fl]||[],al=0;al<cl.length;al++)Va.push(cl[al].to)}}return!1}for(var At=0;At<l.length;At++){var ht=Er(l[At].from,xr),Vt=Er(l[At].to,xr);if(!(ht==null||Vt==null||ht===Vt)&&!(!Pr[ht]||!Pr[Vt])){De.push({a:ht,b:Vt,src:l[At].from,dst:l[At].to}),ze=!0;var Pn=l[At].span!=null?l[At].span:1;(l[At].dir==="l"||l[At].dir==="r")&&(Pn=0),Pn===0?So=!0:ot=!0;var Ae=Pn,Fe=ht!==l[At].from||Vt!==l[At].to,le=l[At].dir==="l"||l[At].dir==="r";Fe&&Ae===0&&!le&&(Ae=1);var Ne=ht,Qe=Vt;l[At].dir==="u"&&(Ne=Vt,Qe=ht),!Yt(Qe,Ne)&&(zr[Ne].push({to:Qe,span:Ae}),Ke[Qe]++)}}function tn(za,vl){for(var Va=0,Ol=0;Ol<l.length;Ol++){var Fl=l[Ol];if(!(Fl.hidden||!Fl.label)){var cl=Er(Fl.from,xr),al=Er(Fl.to,xr);if(cl===za&&al===vl||cl===vl&&al===za){var ki=Math.round(zi(Fl.label,!1))+16;ki>Va&&(Va=ki)}}}return Va}if(!ze)return fo(Rr);for(var Vo={},xo=[],Co=0;Co<br;Co++)Vo[Rr[Co]]=0,xo.push(Rr[Co]);for(var mn=br*br+16;xo.length>0&&mn-- >0;)for(var pn=xo.shift(),hn=zr[pn],Dt=0;Dt<hn.length;Dt++){var ca=hn[Dt].to,ea=Vo[pn]+hn[Dt].span;(Vo[ca]===void 0||Vo[ca]<ea)&&(Vo[ca]=ea,xo.push(ca))}for(var me={},ie=0;ie<br;ie++){var pe=Mr[Rr[ie]];pe!==void 0&&(!me.hasOwnProperty(pe)||Vo[Rr[ie]]>me[pe])&&(me[pe]=Vo[Rr[ie]])}for(var ke=0;ke<br;ke++)Mr[Rr[ke]]!==void 0&&(Vo[Rr[ke]]=me[Mr[Rr[ke]]]);for(var Re={},$o=[],Jo=0;Jo<br;Jo++){var Wt=Vo[Rr[Jo]];Re.hasOwnProperty(Wt)||(Re[Wt]=[],$o.push(Wt)),Re[Wt].push(Rr[Jo])}$o.sort(function(za,vl){return za-vl});for(var at=[],Nn=0,ia=0;ia<$o.length;ia++){for(var sa=_e(Re[$o[ia]],!0,r.direction==="LR"),ka=0,Po=0,Ct=!0,bt=0;bt<sa.length;bt++){var Vr=Ur[sa[bt]];bt>0&&(ka+=Math.max(qr(Ur[sa[bt-1]].isContainer,Vr.isContainer),tn(sa[bt-1],sa[bt]))),ka+=Vr.w,Vr.h>Po&&(Po=Vr.h),Vr.isContainer||(Ct=!1)}at.push({ids:sa,w:ka,h:Po,allCont:Ct}),ka>Nn&&(Nn=ka)}for(var to=xr==null&&at.length>=2&&So&&!ot,Xt=0;to&&Xt<at.length;Xt++)(at[Xt].ids.length!==1||!Ur[at[Xt].ids[0]].isContainer)&&(to=!1);if(to){for(var ha=0,Wr=0,ro=0,te=0,ue=0;ue<at.length;ue++){var zo=at[ue].ids[0],nn=Ur[zo];Br[zo]={x:ha,y:Wr},ha+nn.w>ro&&(ro=ha+nn.w),Wr+nn.h>te&&(te=Wr+nn.h),ha+=nn.w+Su,Wr+=Math.round(nn.h*.6)}return{pos:Br,w:ro,h:te}}function Fa(za,vl){for(var Va=0,Ol=za,Fl=0;Ol!==vl&&Fl++<4096;){var cl=po.hasOwnProperty(Ol)?po[Ol]:null;if(cl==null)break;var al=Ur[cl]?Ur[cl].children:null;if(al){for(var ki=0;ki<al.length;ki++)if(al[ki].id===Ol){Va+=al[ki].x;break}}Ol=cl}return Va}if(r.direction==="LR"){for(var Kn=[],bn=0,Ve=0;Ve<at.length;Ve++){for(var Yo=0,st=0;st<at[Ve].ids.length;st++)st>0&&(Yo+=Za),Yo+=Ur[at[Ve].ids[st]].h;Kn.push(Yo),Yo>bn&&(bn=Yo)}for(var Ca=0,Mt=0,Ra=0;Ra<at.length;Ra++){for(var Xn=0,_a=0;_a<at[Ra].ids.length;_a++)Ur[at[Ra].ids[_a]].w>Xn&&(Xn=Ur[at[Ra].ids[_a]].w);for(var Ka=(bn-Kn[Ra])/2,yn=0;yn<at[Ra].ids.length;yn++){var ua=Ur[at[Ra].ids[yn]];Br[at[Ra].ids[yn]]={x:Ca+(Xn-ua.w)/2,y:Ka},Ka+=ua.h+Za}Ca+=Xn+qr(!1,!1),Mt=Ca-qr(!1,!1)}return{pos:Br,w:Mt,h:bn}}for(var Ya={},fa=0,xt=0;xt<at.length;xt++){var Ja=at[xt];if(xt>0){for(var uo=[],Jn=0;Jn<Ja.ids.length;Jn++){for(var Sa=Ja.ids[Jn],da=0,ma=0,Ha=0;Ha<De.length;Ha++){var Sl=De[Ha];Sl.b===Sa&&Ya.hasOwnProperty(Sl.a)&&(da+=Ya[Sl.a]-Ur[Sl.a].w/2+Fa(Sl.src,Sl.a),ma++)}uo.push({id:Sa,order:Jn,key:ma?da/ma:1/0})}uo.sort(function(za,vl){return za.key-vl.key||za.order-vl.order});for(var $l=[],ml=0;ml<uo.length;ml++)$l.push(uo[ml].id);Ja.ids=_e($l,!0,!1)}for(var Pl=(Nn-Ja.w)/2,Yl=0;Yl<Ja.ids.length;Yl++){var ri=Ja.ids[Yl],wi=Ur[ri];Yl>0&&(Pl+=Math.max(qr(Ur[Ja.ids[Yl-1]].isContainer,wi.isContainer),tn(Ja.ids[Yl-1],ri))),Br[ri]={x:Pl,y:fa+(Ja.h-wi.h)/2},Ya[ri]=Pl+wi.w/2,Pl+=wi.w}xt+1<at.length?fa+=Ja.h+z(Ja.allCont,at[xt+1].allCont):fa+=Ja.h}for(var mi={},Cl=0;Cl<at.length;Cl++)for(var ll=0;ll<at[Cl].ids.length;ll++)mi[at[Cl].ids[ll]]=Cl;function yi(za,vl){return Math.max(qr(Ur[za[vl-1]].isContainer,Ur[za[vl]].isContainer),tn(za[vl-1],za[vl]))}function rs(za,vl,Va){for(var Ol=!1,Fl=0;Fl<Va.length;Fl++)if(Va[Fl]>0){Ol=!0;break}if(Ol){for(var cl=[],al=0;al<za.length;al++){var ki=Ur[za[al]],Ln=al>0?yi(za,al):0;for(cl.push({first:al,last:al,w:ki.w,gapBefore:Ln,wSum:Va[al],prefSum:Va[al]>0?Va[al]*(vl[al]-ki.w/2):0,x:Va[al]>0?vl[al]-ki.w/2:Br[za[al]].x});cl.length>1;){var Mi=cl[cl.length-1],vi=cl[cl.length-2];if(vi.x+vi.w+Mi.gapBefore<=Mi.x)break;var Di=vi.w+Mi.gapBefore;vi.prefSum+=Mi.prefSum-Mi.wSum*Di,vi.wSum+=Mi.wSum,vi.w=Di+Mi.w,vi.last=Mi.last,vi.wSum>0&&(vi.x=vi.prefSum/vi.wSum),cl.pop()}}for(var Wi=null,si=0;si<cl.length;si++){var Il=cl[si],Ht=Il.x;Wi!=null&&Ht<Wi+Il.gapBefore&&(Ht=Wi+Il.gapBefore);for(var ya=0,Oa=Il.first;Oa<=Il.last;Oa++){var St=Ur[za[Oa]];Oa>Il.first&&(ya+=yi(za,Oa)),Br[za[Oa]].x=Ht+ya,Ya[za[Oa]]=Ht+ya+St.w/2,ya+=St.w}Wi=Ht+Il.w}}}for(var Xl=1;Xl<at.length;Xl++){for(var ql=at[Xl].ids,hi=[],ei=[],Pi=0;Pi<ql.length;Pi++){for(var pa=0,kn=0,Na=0;Na<De.length;Na++){var ol=De[Na],il=ol.a===ql[Pi]?ol.b:ol.b===ql[Pi]?ol.a:null;il!=null&&mi[il]<Xl&&(pa+=Ya[il],kn++)}hi.push(kn?pa/kn:Br[ql[Pi]].x+Ur[ql[Pi]].w/2),ei.push(kn)}rs(ql,hi,ei)}if(at.length>1){for(var tl=at[0].ids,ba=[],dl=[],Ml=0;Ml<tl.length;Ml++){for(var Bl=0,Ei=0,ta=!0,ii=0;ii<De.length;ii++){var Yi=De[ii],Tl=Yi.a===tl[Ml]?Yi.b:Yi.b===tl[Ml]?Yi.a:null;if(!(Tl==null||mi[Tl]===0)){for(var oi=0;oi<De.length&&ta;oi++){var xl=De[oi],nl=xl.a===Tl?xl.b:xl.b===Tl?xl.a:null;nl!=null&&nl!==tl[Ml]&&mi[nl]<mi[Tl]&&(ta=!1)}ta&&(Bl+=Ya[Tl],Ei++)}}ba.push(ta&&Ei?Bl/Ei:Br[tl[Ml]].x+Ur[tl[Ml]].w/2),dl.push(ta&&Ei?1:0)}rs(tl,ba,dl)}var Gl=1/0,Zl=-1/0;for(var Ci in Br)Br.hasOwnProperty(Ci)&&(Br[Ci].x<Gl&&(Gl=Br[Ci].x),Br[Ci].x+Ur[Ci].w>Zl&&(Zl=Br[Ci].x+Ur[Ci].w));if(Gl!==1/0&&Gl!==0)for(var As in Br)Br.hasOwnProperty(As)&&(Br[As].x-=Gl);return{pos:Br,w:Gl===1/0?Nn:Zl-Gl,h:fa}}function Te(Rr){return Rr&&Rr.name?String(Rr.name).split(`
-`).length:1}function ae(Rr,xr,br,Br){var Pr=Rr.kind,Xe=15*(Te(Rr)-1);if(Pr==="node"){var zr=Math.max(xr+2*Bu,Br+2*df,80);return{w:zr+nu,h:nu+30+Xe+br+16,childX:(zr-xr)/2,childY:nu+30+Xe}}if(Pr==="database"){var Ke=Math.max(xr,Br)+33;return{w:Ke,h:50+Xe+br+16,childX:(Ke-xr)/2,childY:50+Xe}}if(Pr==="cloud"){var De=Math.max(xr,Br)+40;return{w:De,h:35+Xe+br+18,childX:(De-xr)/2,childY:35+Xe}}var ze=Math.max(xr+2*Bu,Br+2*Bu,80);return{w:ze,h:Xs+8+Xe+br+12,childX:(ze-xr)/2,childY:Xs+8+Xe}}function it(Rr){if(Ur[Rr])return Ur[Rr];if(ao[Rr]){var xr=To[Rr];if(yo[Rr]){var br=ae(xr,0,0,zi(xr.name,!0));return Ur[Rr]={w:br.w,h:br.h,isContainer:!0,kind:xr.kind,children:[]},Ur[Rr]}yo[Rr]=!0;for(var Br=(xr.children||[]).slice(),Pr=[],Xe=0;Xe<Br.length;Xe++)yo[Br[Xe]]&&!Ur[Br[Xe]]||(it(Br[Xe]),Pr.push(Br[Xe]));for(var zr=[],Ke=[],De=0;De<Pr.length;De++){var ze=Ur[Pr[De]],So=ze?ze.kind:null;So==="port"||So==="portin"||So==="portout"?zr.push(Pr[De]):Ke.push(Pr[De])}if(zr.length>0){for(var ot=he(Ke,xr.id),ve=zi(xr.name,!0),Yt=46,At=24,ht=Math.max(ot.w,ve,150),Vt=ht+2*Bu,Pn=Yt+ot.h+At,Ae=[],Fe=(Vt-ot.w)/2,le=0;le<Ke.length;le++){var Ne=ot.pos[Ke[le]];Ne&&Ae.push({id:Ke[le],x:Fe+Ne.x,y:Yt+Ne.y})}for(var Qe=0;Qe<zr.length;Qe++){var tn=Ur[zr[Qe]],Vo=(Qe+1)/(zr.length+1);Ae.push({id:zr[Qe],x:Math.round(Vt*Vo-tn.w/2),y:-Math.round(tn.h/2)})}return Ur[Rr]={w:Vt,h:Pn,isContainer:!0,kind:xr.kind,children:Ae},Ur[Rr]}for(var xo=he(Pr,xr.id),Co=ae(xr,xo.w,xo.h,zi(xr.name,!0)),mn=[],pn=0;pn<Pr.length;pn++){var hn=xo.pos[Pr[pn]];hn&&mn.push({id:Pr[pn],x:Co.childX+hn.x,y:Co.childY+hn.y})}return Ur[Rr]={w:Co.w,h:Co.h,isContainer:!0,kind:xr.kind,children:mn},Ur[Rr]}var Dt=ne[Rr],ca=ls(Dt);return Ur[Rr]={w:ca.w,h:ca.h,isContainer:!1,kind:Dt?Dt.kind:null,children:[]},Ur[Rr]}function Gt(Rr,xr,br,Br,Pr,Xe,zr){var Ke=Y(Rr.color)||"#F1F1F1",De="#181818",ze=Rr.kind,So=Rr.body?Nu(Rr):null;yr(ze,Rr.stereotype,Rr.color);function ot(Po,Ct,bt,Vr,to,Xt){if(So==null)return fr(Po,Rr.name,Ct,bt,Vr,to,Xt,zr);for(var ha=Gi(ze)-2,Wr=[["html","1"],["whiteSpace","wrap"],["fontSize","14"],["align",r&&r.textAlign||"left"],["verticalAlign","middle"],["spacingLeft",String(ha)],["spacingRight",String(ha)]],ro=Ct,te=0;te<Wr.length;te++)new RegExp("(?:^|;)"+Wr[te][0]+"=").test(ro)||(ro+=Wr[te][0]+"="+Wr[te][1]+";");return hr(Po,So.html,wr(ro,!1),bt,Vr,to,Xt,zr)}function ve(Po,Ct,bt,Vr){C+=fr(Fr("ci"),"","rounded=0;fillColor="+De+";strokeColor="+De+";",Po,Ct,bt,Vr,zr)}function Yt(Po,Ct,bt){C+=fr(Fr("cap"),Rr.name,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=14;whiteSpace=wrap;",Po,Ct,bt,Pf+4,zr)}if(ze==="note"){var At=Fr("note");C+=fr(At,Rr.name,"shape=note;size=14;fillColor="+(Y(Rr.color)||"#FEFFDD")+";strokeColor=#181818;fontSize=12;whiteSpace=wrap;align=left;",br,Br,Pr,Xe,zr),Ir[xr]=At;return}if(ze==="port"||ze==="portin"||ze==="portout"){var ht=Fr("n");C+=fr(ht,"","rounded=0;fillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr),Ir[xr]=ht,C+=fr(Fr("cap"),Rr.name,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=bottom;fontSize=14;",br-12,Br-20,Pr+24,18,zr);return}if(So==null&&cf(Rr.name)&&!Tu(Rr.name)){var Vt=hf(Rr.name),Pn=r&&r.textAlign||"left",Ae=Fr("n");ze==="usecase"?C+=fr(Ae,"","ellipse;fillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr):ze==="cloud"?C+=fr(Ae,"","shape=cloud;fillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr):ze==="database"?C+=fr(Ae,"","shape=cylinder;fillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr):ze==="queue"?C+=fr(Ae,"","shape=cylinder3;direction=east;size=12;fillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr):ze==="stack"?(C+=fr(Ae,"","rounded=0;fillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr),C+=Ar(Fr("st"),"","endArrow=none;strokeColor="+De+";",br+Math.round(Pr*.22),Br,br+Math.round(Pr*.22),Br+5,"1"),C+=Ar(Fr("st"),"","endArrow=none;strokeColor="+De+";",br+Math.round(Pr*.78),Br,br+Math.round(Pr*.78),Br+5,"1")):ze==="hexagon"?C+=fr(Ae,"","shape=hexagon;fillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr):ze==="storage"?C+=fr(Ae,"","rounded=1;arcSize=40;fillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr):C+=fr(Ae,"","rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr),Ir[xr]=Ae,C+=K(Fr("lbl"),Vt.html,"text;html=1;fontSize=14;strokeColor=none;fillColor=none;align="+Pn+";verticalAlign=middle;",br+6,Br,Pr-12,Xe,zr);return}if(pf[ze]){var Fe=Iu(Rr),le=Fe.w,Ne=Fe.h,Qe=br+(Pr-le)/2,tn=Fr("n");if(ze==="actor")C+=fr(tn,"","shape=umlActor;html=1;fillColor="+Ke+";strokeColor="+De+";",Qe,Br,le,Ne,zr);else if(ze==="boundary"){var Vo=Ne,xo=Qe+le-Vo,Co=Br+Vo/2;ve(Qe,Br+Vo*.2,2,Vo*.6),ve(Qe,Co-1,xo-Qe,2),C+=fr(tn,"","ellipse;fillColor="+Ke+";strokeColor="+De+";",xo,Br,Vo,Vo,zr)}else{var mn=Math.min(le,Ne-(ze==="entity"?6:0)),pn=br+(Pr-mn)/2;C+=fr(tn,"","ellipse;fillColor="+Ke+";strokeColor="+De+";",pn,Br,mn,mn,zr),ze==="entity"?C+=fr(Fr("ci"),"","line;strokeWidth=1;strokeColor="+De+";fillColor=none;",pn,Br+mn+1,mn,2,zr):ze==="control"&&(ve(pn+mn*.34,Br-1,8,2),ve(pn+mn*.34,Br-1,2,7))}Ir[xr]=tn,Yt(br,Br+Ne+vf-4,Pr);return}if(ze==="person"){var hn=22;C+=fr(Fr("ci"),"","ellipse;fillColor="+Ke+";strokeColor="+De+";",br+(Pr-hn)/2,Br,hn,hn,zr);var Dt=Br+Math.round(hn*.7),ca=Fr("n");C+=ot(ca,"rounded=1;arcSize=40;fillColor="+Ke+";strokeColor="+De+";fontSize=14;verticalAlign=middle;whiteSpace=wrap;",br,Dt,Pr,Br+Xe-Dt),Ir[xr]=ca;return}if(ze==="collections"){var ea=4;C+=fr(Fr("ci"),"","rounded=0;fillColor="+Ke+";strokeColor="+De+";",br+ea,Br,Pr-ea,Xe-ea,zr);var me=Fr("n");C+=ot(me,"rounded=0;fillColor="+Ke+";strokeColor="+De+";fontSize=14;whiteSpace=wrap;",br,Br+ea,Pr-ea,Xe-ea),Ir[xr]=me;return}if(ze==="queue"){var ie=Fr("n");C+=ot(ie,"shape=cylinder3;direction=east;size=5;fillColor="+Ke+";strokeColor="+De+";fontSize=14;whiteSpace=wrap;",br,Br,Pr,Xe),Ir[xr]=ie;return}if(ze==="stack"){var pe=Fr("n");C+=ot(pe,"shape=partialRectangle;top=0;left=1;right=1;bottom=1;fillColor="+Ke+";strokeColor="+De+";fontSize=14;whiteSpace=wrap;align=center;verticalAlign=middle;",br+15,Br,Pr-30,Xe),C+=fr(Fr("ci"),"","line;strokeWidth=1;strokeColor="+De+";fillColor=none;",br,Br-1,15,2,zr),C+=fr(Fr("ci"),"","line;strokeWidth=1;strokeColor="+De+";fillColor=none;",br+Pr-15,Br-1,15,2,zr),Ir[xr]=pe;return}if(ze==="folder"||ze==="package"){var ke=Fr("n"),Re=ze==="package",$o=Math.round(zi(So?Re?Rr.id:"":Rr.name,!1)),Jo="shape=folder;tabWidth="+(Re?$o+25:Math.max(24,Math.min(Pr-8,$o+4)))+";tabHeight="+(Re?23:21)+";tabPosition=left;html=1;whiteSpace=wrap;fillColor="+Ke+";strokeColor="+De+";fontSize=14;"+(Re?"align=left;verticalAlign=top;spacingLeft=6;spacingTop=1;":"align=center;verticalAlign=middle;spacingTop=21;");So&&Re?(C+=fr(ke,Rr.id,Jo,br,Br,Pr,Xe,zr),C+=ot(Fr("lbl"),"text;fillColor=none;strokeColor=none;fontSize=14;",br,Br+23,Pr,Xe-23)):C+=ot(ke,Jo,br,Br,Pr,Xe),Ir[xr]=ke;return}if(ze==="frame"){var Wt=Fr("n");C+=fr(Wt,"","shape=umlFrame;width=29;height=12;fillColor="+Ke+";swimlaneFillColor="+Ke+";strokeColor="+De+";",br,Br,Pr,Xe,zr),Ir[xr]=Wt,C+=ot(Fr("lbl"),"text;html=1;fillColor=none;strokeColor=none;fontSize=14;align=center;verticalAlign=middle;whiteSpace=wrap;",br,Br+12,Pr,Xe-12);return}if(ze==="artifact"){var at=Fr("n");C+=ot(at,"rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+Ke+";strokeColor="+De+";fontSize=14;whiteSpace=wrap;",br,Br,Pr,Xe),Ir[xr]=at,C+=fr(Fr("ci"),"","shape=note;size=6;fillColor="+Ke+";strokeColor="+De+";strokeWidth=0.5;",br+Pr-17,Br+5,12,14,zr);return}var Nn=Fr("n"),ia=Rs(Rr),sa=ze==="component"||ze==="bracket"||ze==="bare"||!ze&&Rr.name;if(sa&&X==="uml1"&&(ia="shape=component;jettyWidth=10;jettyHeight=5;"+ia.replace(/^rounded=1;absoluteArcSize=1;arcSize=6;/,"")),C+=ot(Nn,ia,br,Br,Pr,Xe),Ir[xr]=Nn,sa&&X!=="rectangle"&&X!=="uml1"){var ka="fillColor="+Ke+";strokeColor="+De+";";C+=fr(Fr("ci"),"","rounded=0;"+ka,br+Pr-20,Br+5,15,10,zr),C+=fr(Fr("ci"),"",ka,br+Pr-22,Br+7,4,2,zr),C+=fr(Fr("ci"),"",ka,br+Pr-22,Br+11,4,2,zr)}}function oo(Rr,xr,br,Br,Pr,Xe){var zr=Ur[Rr];if(zr){if(Pr===void 0&&(Pr=xr,Xe=br),qe[Rr]={x:Pr,y:Xe,w:zr.w,h:zr.h},zr.isContainer){var Ke=To[Rr],De=Fr("c");yr(Ke.kind,Ke.stereotype,Ke.color),C+=fr(De,Ke.name,Td(Ke),xr,br,zr.w,zr.h,Br),Ir[Rr]=De,Ke.kind==="component"&&(C+=fr(Fr("ci"),"","rounded=0;fillColor=none;strokeColor=#181818;",xr+zr.w-20,br+5,15,10,Br),C+=fr(Fr("ci"),"","fillColor=none;strokeColor=#181818;",xr+zr.w-22,br+7,4,2,Br),C+=fr(Fr("ci"),"","fillColor=none;strokeColor=#181818;",xr+zr.w-22,br+11,4,2,Br));for(var ze=0;ze<zr.children.length;ze++){var So=zr.children[ze];oo(So.id,So.x,So.y,De,Pr+So.x,Xe+So.y)}return}Gt(ne[Rr],Rr,xr,br,zr.w,zr.h,Br)}}function pt(){if(h.length>0)return!1;for(var Rr=0;Rr<l.length;Rr++)if(l[Rr].dir)return!0;return!1}function rt(){for(var Rr=26,xr=42,br=[],Br=0;Br<e.length;Br++)it(e[Br].id),br.push(e[Br].id);if(br.length===0)return{pos:{},w:0,h:0};for(var Pr={},Xe=0;Xe<br.length;Xe++)Pr[br[Xe]]=!0;for(var zr=[],Ke=0;Ke<l.length;Ke++){var De=l[Ke].from,ze=l[Ke].to;if(!(!Pr[De]||!Pr[ze]||De===ze)){var So=l[Ke].dir,ot=So==="d"?1:So==="u"?-1:0;zr.push({a:De,b:ze,delta:ot,dir:So})}}var ve={};ve[br[0]]=0;for(var Yt=!0,At=0;Yt&&At++<br.length*br.length+64;){Yt=!1;for(var ht=0;ht<zr.length;ht++){var Vt=zr[ht];ve[Vt.a]!==void 0&&ve[Vt.b]===void 0?(ve[Vt.b]=ve[Vt.a]+Vt.delta,Yt=!0):ve[Vt.b]!==void 0&&ve[Vt.a]===void 0&&(ve[Vt.a]=ve[Vt.b]-Vt.delta,Yt=!0)}}for(var Pn=0;Pn<br.length;Pn++)ve[br[Pn]]===void 0&&(ve[br[Pn]]=0);for(var Ae=null,Fe=0;Fe<zr.length;Fe++)if(zr[Fe].dir==="r"||zr[Fe].dir==="l"){Ae=ve[zr[Fe].a];break}for(var le={},Ne=0;Ne<br.length;Ne++){var Qe=ve[br[Ne]];le[Qe]=(le[Qe]||0)+1}if(Ae===null){var tn=-1;for(var Vo in le)le[Vo]>tn&&(tn=le[Vo],Ae=parseInt(Vo,10))}for(var xo={},Co=[],mn=0;mn<br.length;mn++){var pn=ve[br[mn]];xo.hasOwnProperty(pn)||(xo[pn]=[],Co.push(pn)),xo[pn].push(br[mn])}Co.sort(function(yn,ua){return yn-ua});for(var hn={},Dt={},ca=0,ea=0;ea<Co.length;ea++){for(var me=0,ie=xo[Co[ea]],pe=0;pe<ie.length;pe++)Ur[ie[pe]].h>me&&(me=Ur[ie[pe]].h);Dt[Co[ea]]=me,hn[Co[ea]]=ca,ca+=me+xr}for(var ke={},Re={},$o=(xo[Ae]||[]).slice(),Jo={},Wt={},at=0;at<$o.length;at++)Jo[$o[at]]=[],Wt[$o[at]]=0;for(var Nn=0;Nn<zr.length;Nn++){var ia=zr[Nn];if(!(ve[ia.a]!==Ae||ve[ia.b]!==Ae)){var sa=ia.a,ka=ia.b;ia.dir==="l"&&(sa=ia.b,ka=ia.a),Jo[sa]&&Wt.hasOwnProperty(ka)&&(Jo[sa].push(ka),Wt[ka]++)}}for(var Po=[],Ct=[],bt=0;bt<$o.length;bt++)Wt[$o[bt]]===0&&Ct.push($o[bt]);for(var Vr=$o.length*$o.length+16;Ct.length&&Vr-- >0;){var to=Ct.shift();Po.push(to);for(var Xt=0;Xt<Jo[to].length;Xt++)--Wt[Jo[to][Xt]]===0&&Ct.push(Jo[to][Xt])}for(var ha=0;ha<$o.length;ha++)Po.indexOf($o[ha])<0&&Po.push($o[ha]);function Wr(yn,ua){var Ya=0;if(yn==null||ua==null)return Ya;for(var fa=0;fa<l.length;fa++){var xt=l[fa];if(!(xt.hidden||!xt.label)&&(xt.from===yn&&xt.to===ua||xt.from===ua&&xt.to===yn)){var Ja=Math.round(zi(xt.label,!1))+16;Ja>Ya&&(Ya=Ja)}}return Ya}for(var ro=0,te=0;te<Po.length;te++){var ue=Po[te],zo=Ur[ue];ke[ue]={x:ro,y:hn[Ae]+(Dt[Ae]-zo.h)/2},Re[ue]=ro+zo.w/2,ro+=zo.w+Math.max(Rr,Wr(ue,te+1<Po.length?Po[te+1]:null))}function nn(yn){for(var ua=ve[yn]<Ae?ve[yn]+1:ve[yn]-1,Ya=[],fa=0;fa<zr.length;fa++)zr[fa].a===yn&&ve[zr[fa].b]===ua?Ya.push(zr[fa].b):zr[fa].b===yn&&ve[zr[fa].a]===ua&&Ya.push(zr[fa].a);return Ya}function Fa(yn){for(var ua=xo[yn].slice(),Ya=0;Ya<ua.length;Ya++){for(var fa=nn(ua[Ya]),xt=0,Ja=0,uo=0;uo<fa.length;uo++)Re.hasOwnProperty(fa[uo])&&(xt+=Re[fa[uo]],Ja++);ua[Ya]={id:ua[Ya],want:Ja?xt/Ja:0}}ua.sort(function(Sl,$l){return Sl.want-$l.want});for(var Jn=-1e9,Sa=0;Sa<ua.length;Sa++){var da=ua[Sa].id,ma=Ur[da],Ha=ua[Sa].want-ma.w/2;Ha<Jn&&(Ha=Jn),ke[da]={x:Ha,y:hn[yn]+(Dt[yn]-ma.h)/2},Re[da]=Ha+ma.w/2,Jn=Ha+ma.w+Rr}}for(var Kn=0,bn=0;bn<Co.length;bn++){var Ve=Math.abs(Co[bn]-Ae);Ve>Kn&&(Kn=Ve)}for(var Yo=1;Yo<=Kn;Yo++)xo.hasOwnProperty(Ae-Yo)&&Fa(Ae-Yo),xo.hasOwnProperty(Ae+Yo)&&Fa(Ae+Yo);for(var st=1e9,Ca=-1e9,Mt=-1e9,Ra=0;Ra<br.length;Ra++){var Xn=ke[br[Ra]];if(Xn){var _a=Ur[br[Ra]];Xn.x<st&&(st=Xn.x),Xn.x+_a.w>Ca&&(Ca=Xn.x+_a.w),Xn.y+_a.h>Mt&&(Mt=Xn.y+_a.h)}}for(var Ka=0;Ka<br.length;Ka++)ke[br[Ka]]&&(ke[br[Ka]].x-=st);return{pos:ke,w:Ca-st,h:Mt}}var jo=[];if(pt())for(var Qt=rt(),Me=0;Me<e.length;Me++){var Io=Qt.pos[e[Me].id];Io&&oo(e[Me].id,hl+Io.x,Qo+Io.y,"1")}else{for(var Wo=0;Wo<h.length;Wo++)h[Wo].parent==null&&(it(h[Wo].id),jo.push(h[Wo].id));for(var Ro=0;Ro<e.length;Ro++)e[Ro].parent==null&&!Ur[e[Ro].id]&&(it(e[Ro].id),jo.push(e[Ro].id));for(var An=he(jo,null),dn=0;dn<jo.length;dn++){var rn=An.pos[jo[dn]];rn&&oo(jo[dn],hl+rn.x,Qo+rn.y,"1")}}var Ao={},_t={};function ft(Rr){return Rr.from<Rr.to?Rr.from+"|"+Rr.to:Rr.to+"|"+Rr.from}for(var Se=0;Se<l.length;Se++)if(!l[Se].hidden){var Go=ft(l[Se]);Ao[Go]=(Ao[Go]||0)+1}var wt=C.length,cn="";v=null;for(var No=0;No<l.length;No++){var oe=l[No];if(!oe.hidden){var Uo=Ir[oe.from],Ot=Ir[oe.to];if(!(!Uo||!Ot||Uo===Ot)){var ho=Y(oe.color)||"#181818",dt="strokeColor="+ho+";fontColor=#000000;fontSize=12;html=1;"+(oe.bold?"strokeWidth=2;":"")+(oe.label?"labelBackgroundColor=#FFFFFF;":"");oe.arrowHead==="none"?dt+="endArrow=none;":oe.arrowHead==="bidirectional"?dt+="endArrow=classicThin;endFill=1;startArrow=classicThin;startFill=1;":oe.arrowHead==="socket"?dt+="endArrow=halfCircle;endSize=7;endFill=0;":dt+="endArrow=classicThin;endFill=1;",oe.lineStyle==="dotted"?dt+="dashed=1;dashPattern=1 3;":oe.lineStyle==="dashed"&&(dt+="dashed=1;dashPattern=7 7;");var Aa=qe[oe.from],Sn=qe[oe.to];if(Aa&&Sn&&Aa.y>Sn.y+Sn.h+60){for(var an=!1,we=Aa.x+Aa.w/2,Eo=Aa.y+Aa.h/2,Et=Sn.x+Sn.w/2,Cr=Sn.y+Sn.h/2,Lr={},He=oe.from;He!=null;He=po[He])Lr[He]=!0;for(var Ie=oe.to;Ie!=null;Ie=po[Ie])Lr[Ie]=!0;for(var Oe in qe)if(!(!qe.hasOwnProperty(Oe)||Lr[Oe])){var so=qe[Oe],Xo=so.y+so.h/2;if(!(Xo<=Cr||Xo>=Eo)){var qo=(Xo-Eo)/(Cr-Eo),Yn=we+qo*(Et-we);if(Yn>=so.x-4&&Yn<=so.x+so.w+4){an=!0;break}}}if(an){var Nt=0;for(var Da in qe)if(qe.hasOwnProperty(Da)){var je=qe[Da];je.x+je.w>Nt&&(Nt=je.x+je.w)}Nt+=28;var _r=dt+"exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;";C+=' <mxCell id="'+d(Fr("e"))+'" value="'+o(oe.label||"",_r)+'" style="'+d(_r)+'" edge="1" source="'+d(Ir[oe.from])+'" target="'+d(Ir[oe.to])+`" parent="1">
+`}var zo=P(uo,io);return' <mxCell id="'+g(Oe)+'" value="'+zo.value+'" style="'+g(zo.style)+'" edge="1" source="'+g(we)+'" target="'+g(de)+`" parent="1">
+`+ft+` </mxCell>
+`}var le={};for(p=0;p<c.length;p++)he[c[p].from]&&he[c[p].to]&&(le[c[p].from+""+c[p].to]=!0);for(p=0;p<c.length;p++)if(nr=c[p],!(!he[nr.from]||!he[nr.to]||nr.hidden)){var Fe=Pr[nr.from],$e=Pr[nr.to],Se="endArrow=classic;endSize=8;strokeColor="+(Y(nr.color)||Ge)+";fontSize=11;fontColor=#000000;";(nr.dashed||nr.dotted)&&(Se+="dashed=1;"),nr.bold&&(Se+="strokeWidth=2;");var ro=null;if(nr.from===nr.to)Se+="edgeStyle=orthogonalEdgeStyle;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;";else if(Uo[p]!=null&&Uo[p].length>0){ro=[];var It=Uo[p],Jo=ie[nr.from]<ie[nr.to];for(or=0;or<It.length;or++){var xo=Pr[It[Jo?or:It.length-1-or]];ro.push({x:Math.round(xo.x+xo.w/2),y:Math.round(xo.y+xo.h/2)})}}else if(le[nr.to+""+nr.from]&&ie[nr.from]!==ie[nr.to]){var Et=nr.from<nr.to?.3:.7,Vn=ie[nr.from]<ie[nr.to];Se+="exitX="+Et+";exitY="+(Vn?1:0)+";exitDx=0;exitDy=0;entryX="+Et+";entryY="+(Vn?0:1)+";entryDx=0;entryDy=0;"}F+=rt(Xr("e"),nr.label||"",Se,Fe.cellId,$e.cellId,ro)}for(p=0;p<e.length;p++)if(rr=e[p],rr.type==="note"){var Un=Pr[rr.id];if(rr.target!=null&&he[rr.target]){var bt=Pr[rr.target],Et=rr.position||"right",mt="endArrow=none;strokeColor=#181818;";Et==="left"?mt+="exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;":Et==="right"?mt+="exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;":Et==="top"?mt+="exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;":mt+="exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;",F+=mr(Xr("noteln"),"",mt,Un.cellId,bt.cellId,"1")}}if(r.title){var In=Math.max(60,Math.round(Hr(r.title,14,!0)+20)),Zn=String(r.title).split(`
+`).length*20+4;F+=u(Xr("title"),r.title,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",Math.round((Zu+wt)/2-In/2),Zu-Zn-12,In,Zn,"1")}return F}var $s=160,hf=49,_u=35,dl=24,ci=60,El=24,at=16,us=6,Us=20,vu=26,Cu=20,pu=16,ju=10,bs=15,Fs=33;function Ki(r,l){for(var e=String(r??""),c=0,i=0,h=0;h<e.length;h++){var F=e.charAt(h);F===`
+`?(c>i&&(i=c),c=0):`iIljtf.,:;!|'"()[]{} `.indexOf(F)>=0?c+=4.2:"mwMW".indexOf(F)>=0?c+=11.7:c+=7.8}return c>i&&(i=c),i*(l?1.05:1)}function wu(r){return typeof r=="string"&&/^\s*<[$&][A-Za-z0-9_-]+>\s*$/.test(r)}function ou(r){return typeof r=="string"&&/<size:\d|<[$&][A-Za-z0-9_-]+>/i.test(r)}function rs(r){var l=String(r??"");l=l.replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," "),l=l.replace(/<U\+([0-9A-Fa-f]{2,6})>/g,function(nr,Xr){try{return String.fromCodePoint(parseInt(Xr,16))}catch{return""}}),l=l.replace(/<[&$][A-Za-z0-9_-]+>/g,function(nr){return s(nr)}),l=l.replace(/\*\*([\s\S]+?)\*\*/g,"$1").replace(/\/\/([\s\S]+?)\/\//g,"$1").replace(/__([\s\S]+?)__/g,"$1").replace(/~~([\s\S]+?)~~/g,"$1").replace(/""([\s\S]+?)""/g,"$1");for(var e=l.split(`
+`),c=0,i=0,h=[],F=0;F<e.length;F++){var j=e[F],p=14,or=j.match(/<size:(\d+(?:\.\d+)?)>/i);or&&(p=parseFloat(or[1]));var q=j.replace(/<[^>]+>/g,"");q===""&&(q=" "),!or&&q.replace(/\s+/g,"").length===1&&q.charCodeAt(0)>8192&&(p=28);var rr=Ki(q,!1)*(p/14);rr>c&&(c=rr),i+=p>20&&q.replace(/\s+/g,"").length<=1?p*.95:p*1.33,p!==14?h.push('<font style="font-size:'+p+'px">'+q+"</font>"):h.push(q)}return{w:Math.ceil(c),h:Math.ceil(i),html:h.join("<br>")}}function Le(r){var l=Y(r.color)||"#F1F1F1",e=wu(r.name);switch(r.kind){case"actor":case"person":return"shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;fillColor="+l+";strokeColor=#181818;";case"interface":return"ellipse;fillColor="+l+";strokeColor=#181818;fontSize=12;";case"port":case"portin":case"portout":return"shape=mxgraph.sysml.port1;fillColor="+l+";strokeColor=#181818;fontSize=10;";case"database":return"shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;fillColor="+l+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"queue":return"shape=queue;fillColor="+l+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"cloud":return"shape=cloud;fillColor="+l+";strokeColor=#181818;whiteSpace=wrap;";case"node":return"shape=cube;size=10;fillColor="+l+";strokeColor=#181818;whiteSpace=wrap;";case"folder":return"shape=folder;tabWidth=40;tabHeight=14;tabPosition=left;fillColor="+l+";strokeColor=#181818;whiteSpace=wrap;";case"frame":return"shape=mxgraph.uml25.frame;fillColor="+l+";strokeColor=#181818;whiteSpace=wrap;";case"file":return"shape=note;size=10;fillColor="+l+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"card":case"agent":return"rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+l+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"storage":return"rounded=1;arcSize=50;fillColor="+l+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"usecase":return"ellipse;fillColor="+l+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"hexagon":return"shape=hexagon;fillColor="+l+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"circle":case"control":case"entity":return"ellipse;fillColor="+l+";strokeColor=#181818;whiteSpace=wrap;";case"label":return"text;html=1;fillColor=none;strokeColor=none;whiteSpace=wrap;";case"rectangle":var c="rounded=1;absoluteArcSize=1;arcSize=3;strokeWidth=1;fillColor="+l+";strokeColor=#181818;whiteSpace=wrap;";return e&&(c+="fontSize=48;fontColor=#000000;align=center;verticalAlign=middle;"),c;case"collections":case"stack":case"boundary":return"rounded=0;fillColor="+l+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;";case"component":default:return"rounded=1;absoluteArcSize=1;arcSize=6;fillColor="+l+";strokeColor=#181818;fontSize=14;whiteSpace=wrap;"}}function Kt(r){return Math.max(24,Math.round(Ki(r.name||"",!1))+12)}function zt(r){return String(r.name||"").split(`
+`).length}function Fa(r){var l=Y(r.color)||"none";switch(r.kind){case"package":case"folder":return"shape=folder;tabWidth="+Kt(r)+";tabHeight="+(23+16*(zt(r)-1))+";tabPosition=left;html=1;whiteSpace=wrap;fillColor="+l+";strokeColor=#000000;strokeWidth=1.5;fontSize=14;fontStyle=0;fontColor=#000000;align=left;verticalAlign=top;spacingLeft=4;spacingTop=-2;";case"frame":return"shape=umlFrame;width="+(Math.round(Ki(r.name||"",!1))+10)+";height="+(20+16*(zt(r)-1))+";html=1;whiteSpace=wrap;fillColor="+l+";swimlaneFillColor="+l+";strokeColor=#181818;strokeWidth=1;fontSize=14;fontStyle=0;fontColor=#000000;align=left;verticalAlign=middle;spacingLeft=1;";case"node":return"shape=cube;size="+ju+";fillColor="+l+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=12;fontSize=14;fontStyle=1;whiteSpace=wrap;";case"database":return"shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;fillColor="+l+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=0;fontSize=14;fontStyle=1;whiteSpace=wrap;";case"cloud":return"shape=mxgraph.basic.cloud_rect;html=1;fillColor="+l+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=8;fontSize=14;fontStyle=1;whiteSpace=wrap;";case"artifact":return"swimlane;collapsible=0;startSize="+vu+";fillColor="+l+";strokeColor=#181818;fontStyle=1;";case"card":return"swimlane;collapsible=0;startSize="+vu+";shape=card;fillColor="+l+";strokeColor=#181818;fontStyle=1;";case"storage":return"swimlane;collapsible=0;startSize="+vu+";fillColor="+l+";strokeColor=#181818;fontStyle=1;";case"rectangle":return"rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+l+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=2;fontSize=14;fontStyle=1;whiteSpace=wrap;";case"component":return"rounded=1;absoluteArcSize=1;arcSize=12;fillColor="+l+";strokeColor=#181818;verticalAlign=top;align=center;spacingTop=10;fontSize=14;whiteSpace=wrap;";default:return"swimlane;collapsible=0;startSize="+vu+";fillColor="+l+";strokeColor=#181818;fontStyle=1;"}}var wn=18,Pn=4,Kl={interface:!0,circle:!0,control:!0,entity:!0,boundary:!0,actor:!0};function Ya(r){switch(r.kind){case"interface":return{w:18,h:18};case"circle":return{w:34,h:34};case"control":return{w:34,h:34};case"entity":return{w:34,h:40};case"boundary":return{w:56,h:34};case"actor":return{w:40,h:54};default:return null}}var _l=16.5;function Ui(r){var l=r.substring(0,2);return r.length>=2&&r!=="..."&&(l==="--"||l==="=="||l===".."||l==="__")&&r.substring(r.length-2)===l}function ni(r){var l=r.body||[],e={size:14,bold:!1},c={size:14,bold:!1,family:"mono"},i="",h=0,F=0,j=!1,p=!1,or=!1;function q(Pr){return"border:none;border-top:"+(Pr==="="?"3px double":Pr==="."?"1px dotted":"1px solid")+" #181818;"}function rr(Pr){return t(Pr.replace(/\\/g,"")).replace(/\u0003/g,"\\")}function nr(Pr){return String(Pr).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}if(r.stereotype){var Xr="\xAB"+r.stereotype+"\xBB";i+='<div style="text-align:center;"><i>'+t(Xr)+"</i></div>",h=Math.max(h,$u(Xr,e)),F+=_l}for(var wr=0;wr<l.length;wr++){var pr=l[wr];if(/^<code>$/i.test(pr)){p=!0;continue}if(/^<\/code>$/i.test(pr)){p=!1;continue}if(!p&&Ui(pr)){var Dr=pr.charAt(0),Ze=pr.substring(2,pr.length-2).replace(/^\s+|\s+$/g,"");j=!0,or=!1,Ze===""?(i+='<hr style="'+q(Dr)+(Dr==="="?"margin:4px 0 1px;":"margin:0 0 4px;")+'">',F+=Dr==="="?8:4):(i+='<div style="display:flex;align-items:center;margin:2px 0;"><span style="flex:1;'+q(Dr)+'"></span><span style="border:1px solid #181818;padding:0 1px;">'+t(Ze)+'</span><span style="flex:1;'+q(Dr)+'"></span></div>',F+=20.5,h=Math.max(h,$u(s(Ze),e)+4));continue}if(or&&(i+="<br>"),p)i+='<span style="font-family:monospace;white-space:pre;">'+nr(pr)+"</span>",h=Math.max(h,$u(pr,c));else{var he=/^<<\s*([^>]*?)\s*>>$/.exec(pr);he&&(pr="\xAB"+he[1]+"\xBB"),i+=rr(pr),h=Math.max(h,Ld(pr,e))}F+=_l,or=!0}return j&&(F+=4),{html:i,w:h,h:Math.max(F,_l)}}function fs(r){switch(r){case"component":case"node":case"frame":return 15;case"queue":return 5;case"collections":return 8;default:return 10}}function Ou(r){if(!r)return{w:$s,h:hf};if(r.kind==="port"||r.kind==="portin"||r.kind==="portout")return{w:pu,h:pu};if(r.kind==="note"){for(var l=s(r.name),e=l.split(`
+`),c=0,i=0;i<e.length;i++)e[i].length>c&&(c=e[i].length);return{w:Math.max(50,Math.ceil(c*6)+21),h:Math.max(24,Math.round(e.length*17.7+10))}}var h=r.body?ni(r):null,F=s(r.name),j=F.split(`
+`).length,p=j>1&&!h?j*16+14:0,or=Ya(r);if(or&&Kl[r.kind]){var q=Math.round(Ki(F,!1))+6;return{w:Math.max(or.w,q),h:or.h+Pn+wn}}if(!h&&wu(r.name))return{w:68,h:68};if(!h&&ou(r.name)){var rr=rs(r.name);switch(r.kind){case"usecase":var nr=Math.round(rr.w*1.35)+30,Xr=rr.h+26;return nr<Xr*1.3&&(nr=Math.round(Xr*1.3)),{w:nr,h:Xr};case"cloud":return{w:rr.w+84,h:rr.h+72};case"database":return{w:rr.w+44,h:rr.h+58};case"queue":return{w:rr.w+56,h:rr.h+20};case"stack":return{w:rr.w+30,h:rr.h+18};default:return{w:rr.w+20,h:rr.h+8}}}var wr=h?Math.ceil(h.w):Math.round(Ki(F,!1)),pr=Math.max(60,wr+40),Dr=hf;if(r.kind==="artifact"?(pr=Math.max(50,wr+30),Dr=40):r.kind==="file"||r.kind==="agent"||r.kind==="storage"?(pr=Math.max(50,wr+20),Dr=37):r.kind==="card"?(pr=Math.max(40,wr+20),Dr=23):r.kind==="hexagon"?(pr=Math.max(60,2*wr),Dr=27):r.kind==="database"?(pr=Math.max(50,wr+20),Dr=46):r.kind==="usecase"?(pr=Math.max(40,Math.round(Math.SQRT2*(wr+4.3))),Dr=29):r.kind==="person"?(pr=Math.max(70,wr+24),Dr=66):r.kind==="label"?(pr=Math.max(20,wr+8),Dr=20):r.kind==="collections"?(pr=Math.max(60,wr+20),Dr=37):r.kind==="stack"?(pr=Math.max(60,wr+50),Dr=37):r.kind==="queue"?(pr=Math.max(50,wr+20),Dr=27):r.kind==="folder"?(pr=Math.max(60,wr+30),Dr=54):r.kind==="package"?(pr=Math.max(70,wr+42),Dr=40):r.kind==="frame"&&(pr=Math.max(70,wr+40),Dr=47),h){var Ze=h.h-_l;Dr+=Math.round(r.kind==="usecase"?Ze*1.4:Ze)}else p>Dr&&(Dr=p);return{w:pr,h:Dr}}function vf(r,l){var e=r.nodes,c=r.containers,i=r.connections,h="",F=0,j=r.styleSheet||null,p=null,or=["fillColor","gradientColor"],q=j!=null?String(j.skinparams.componentstyle||"").toLowerCase():"";function rr(kr){return kr==="portin"||kr==="portout"?"port":kr==="bracket"||kr==="bare"||!kr?"component":kr}function nr(kr,Ir,Tr,Gr,Vr){return X(kr,j,["root","element","componentDiagram"].concat(Ir),Tr||[],Gr||"vertex",Vr)}function Xr(kr,Ir){if(p==null||j==null)return kr;var Tr=Ir?"edge":kr.indexOf("text;")===0?"text":"vertex",Gr=U(j,["root","element","componentDiagram",p.name],p.stereotypes,Tr);if(p.skip!=null)for(var Vr=0;Vr<p.skip.length;Vr++)delete Gr[p.skip[Vr]];return Gr.fillColor!=null&&/swimlaneFillColor=/.test(kr)&&(Gr.swimlaneFillColor=Gr.fillColor),H(kr,Gr)}function wr(kr,Ir,Tr){p=j==null?null:{name:rr(kr),stereotypes:Ir?[Ir]:[],skip:Tr?or:null}}for(var pr=function(kr,Ir,Tr,Gr,Vr,Ge,Jr,co){var Ie=Xr(Tr,!1);return String(kr).indexOf("ci_")===0&&Ie!==Tr&&(Ie=Ie.replace(/(^|;)(?:rounded|arcSize|absoluteArcSize)=[^;]*(?=;|$)/g,"$1").replace(/;;+/g,";").replace(/^;/,""),/^rounded=1;/.test(Tr)&&!/rounded=/.test(Ie)&&(Ie="rounded=1;"+Ie)),m(kr,Ir,Ie,Gr,Vr,Ge,Jr,co)},Dr=function(kr,Ir,Tr,Gr,Vr,Ge,Jr,co){return I(kr,Ir,Xr(Tr,!0),Gr,Vr,Ge,Jr,co)},Ze=0;Ze<e.length;Ze++)e[Ze].stereotype&&!e[Ze]._stereoFolded&&!e[Ze].body&&(e[Ze].name="\xAB"+e[Ze].stereotype+`\xBB
+`+(e[Ze].name||""),e[Ze]._stereoFolded=!0);for(var he=0;he<c.length;he++)c[he].stereotype&&!c[he]._stereoFolded&&(c[he].name="\xAB"+c[he].stereotype+`\xBB
+`+(c[he].name||""),c[he]._stereoFolded=!0);var Pr={rectangle:1,node:1,cloud:1,database:1,frame:1,card:1};if(r.packageStyle&&Pr[r.packageStyle])for(var ve=0;ve<c.length;ve++)c[ve].kind==="package"&&(c[ve].kind=r.packageStyle);function xr(kr){return kr+"_"+F++}for(var qr={},ze={},wo={},me={},ue={},po={},x=0;x<c.length;x++){var S=c[x];wo[S.id]=S,ue[S.id]=S.parent==null?null:S.parent,po[S.id]=!0}for(var fr=0;fr<e.length;fr++){var zr=e[fr];me[zr.id]=zr,ue[zr.id]=zr.parent==null?null:zr.parent}function Lr(kr,Ir){for(var Tr=kr,Gr=0;Tr!=null&&Gr++<4096;){var Vr=ue.hasOwnProperty(Tr)?ue[Tr]:null;if(Ir==null){if(Vr==null)return Tr}else if(Vr===Ir)return Tr;if(Vr==null)return null;Tr=Vr}return null}function te(kr,Ir){return kr&&Ir?dl:_u}function W(kr,Ir){return kr&&Ir?El:ci}for(var Zr={},Re=r.togethers||[],Ae=0;Ae<Re.length;Ae++)for(var Pe=0;Pe<Re[Ae].length;Pe++)Zr[Re[Ae][Pe]]=Ae;function De(kr,Ir,Tr){for(var Gr=[],Vr=[],Ge={},Jr=0;Jr<kr.length;Jr++){var co=Zr[kr[Jr]];if(co===void 0){Gr.push(kr[Jr]);continue}Ge.hasOwnProperty(co)||(Ge[co]=Vr.length,Vr.push({members:[],slot:Gr.length}),Ir||Gr.push(null)),Vr[Ge[co]].members.push(kr[Jr])}if(Vr.length===0)return kr;for(var Ie=0;Ie<Vr.length;Ie++){var Ee=Re[Zr[Vr[Ie].members[0]]];Vr[Ie].members.sort(function(Cn,yt){return Ee.indexOf(Cn)-Ee.indexOf(yt)}),Tr&&Vr[Ie].members.reverse()}if(Ir){for(var qo=0;qo<Vr.length;qo++)Gr=Gr.concat(Vr[qo].members);return Gr}for(var Ot=[],no=0;no<Gr.length;no++){if(Gr[no]!=null){Ot.push(Gr[no]);continue}for(var Fn=0;Fn<Vr.length;Fn++)Vr[Fn].slot===no&&(Ot=Ot.concat(Vr[Fn].members))}return Ot}var Qr={},Po={};function Qe(kr){kr=De(kr,!1,!1);for(var Ir=kr.length,Tr={},Gr=Math.max(1,Math.ceil(Math.sqrt(Ir))),Vr=Math.ceil(Ir/Gr),Ge=0,Jr=0,co=0;co<Ir;co++){var Ie=Qr[kr[co]];Ie.w>Ge&&(Ge=Ie.w),Ie.h>Jr&&(Jr=Ie.h)}for(var Ee=0;Ee<Ir;Ee++){var qo=Math.floor(Ee/Gr),Ot=Ee%Gr,no=Qr[kr[Ee]],Fn=Ot*(Ge+_u),Cn=qo*(Jr+ci);Tr[kr[Ee]]={x:Fn+(Ge-no.w)/2,y:Cn+(Jr-no.h)/2}}return{pos:Tr,w:Gr*Ge+(Gr-1)*_u,h:Vr*Jr+(Vr-1)*ci}}function yo(kr,Ir){var Tr=kr.length,Gr={};if(Tr===0)return{pos:Gr,w:0,h:0};for(var Vr={},Ge=0;Ge<Tr;Ge++)Vr[kr[Ge]]=!0;for(var Jr={},co={},Ie=[],Ee=!1,qo=!1,Ot=!1,no=0;no<Tr;no++)Jr[kr[no]]=[],co[kr[no]]=0;function Fn(Na,Bl){for(var wl=[Na],li={};wl.length>0;){var La=wl.pop();if(La===Bl)return!0;if(!li[La]){li[La]=!0;for(var il=Jr[La]||[],ya=0;ya<il.length;ya++)wl.push(il[ya].to)}}return!1}for(var Cn=0;Cn<i.length;Cn++){var yt=Lr(i[Cn].from,Ir),wt=Lr(i[Cn].to,Ir);if(!(yt==null||wt==null||yt===wt)&&!(!Vr[yt]||!Vr[wt])){Ie.push({a:yt,b:wt,src:i[Cn].from,dst:i[Cn].to}),Ee=!0;var rt=i[Cn].span!=null?i[Cn].span:1;(i[Cn].dir==="l"||i[Cn].dir==="r")&&(rt=0),rt===0?qo=!0:Ot=!0;var le=rt,Fe=yt!==i[Cn].from||wt!==i[Cn].to,$e=i[Cn].dir==="l"||i[Cn].dir==="r";Fe&&le===0&&!$e&&(le=1);var Se=yt,ro=wt;i[Cn].dir==="u"&&(Se=wt,ro=yt),!Fn(ro,Se)&&(Jr[Se].push({to:ro,span:le}),co[ro]++)}}function It(Na,Bl){for(var wl=0,li=0;li<i.length;li++){var La=i[li];if(!(La.hidden||!La.label)){var il=Lr(La.from,Ir),ya=Lr(La.to,Ir);if(il===Na&&ya===Bl||il===Bl&&ya===Na){var Xl=Math.round(Ki(La.label,!1))+16;Xl>wl&&(wl=Xl)}}}return wl}if(!Ee)return Qe(kr);for(var Jo={},xo=[],Et=0;Et<Tr;Et++)Jo[kr[Et]]=0,xo.push(kr[Et]);for(var Vn=Tr*Tr+16;xo.length>0&&Vn-- >0;)for(var Un=xo.shift(),bt=Jr[Un],mt=0;mt<bt.length;mt++){var In=bt[mt].to,Zn=Jo[Un]+bt[mt].span;(Jo[In]===void 0||Jo[In]<Zn)&&(Jo[In]=Zn,xo.push(In))}for(var Oe={},uo=0;uo<Tr;uo++){var io=Zr[kr[uo]];io!==void 0&&(!Oe.hasOwnProperty(io)||Jo[kr[uo]]>Oe[io])&&(Oe[io]=Jo[kr[uo]])}for(var we=0;we<Tr;we++)Zr[kr[we]]!==void 0&&(Jo[kr[we]]=Oe[Zr[kr[we]]]);for(var de={},$o=[],ft=0;ft<Tr;ft++){var Vo=Jo[kr[ft]];de.hasOwnProperty(Vo)||(de[Vo]=[],$o.push(Vo)),de[Vo].push(kr[ft])}$o.sort(function(Na,Bl){return Na-Bl});for(var zo=[],ka=0,sa=0;sa<$o.length;sa++){for(var _a=De(de[$o[sa]],!0,r.direction==="LR"),Ba=0,No=0,vt=!0,Wt=0;Wt<_a.length;Wt++){var Nt=Qr[_a[Wt]];Wt>0&&(Ba+=Math.max(te(Qr[_a[Wt-1]].isContainer,Nt.isContainer),It(_a[Wt-1],_a[Wt]))),Ba+=Nt.w,Nt.h>No&&(No=Nt.h),Nt.isContainer||(vt=!1)}zo.push({ids:_a,w:Ba,h:No,allCont:vt}),Ba>ka&&(ka=Ba)}for(var $a=Ir==null&&zo.length>=2&&qo&&!Ot,sn=0;$a&&sn<zo.length;sn++)(zo[sn].ids.length!==1||!Qr[zo[sn].ids[0]].isContainer)&&($a=!1);if($a){for(var ce=0,yr=0,Io=0,ge=0,Ct=0;Ct<zo.length;Ct++){var Nn=zo[Ct].ids[0],Qn=Qr[Nn];Gr[Nn]={x:ce,y:yr},ce+Qn.w>Io&&(Io=ce+Qn.w),yr+Qn.h>ge&&(ge=yr+Qn.h),ce+=Qn.w+dl,yr+=Math.round(Qn.h*.6)}return{pos:Gr,w:Io,h:ge}}function kn(Na,Bl){for(var wl=0,li=Na,La=0;li!==Bl&&La++<4096;){var il=ue.hasOwnProperty(li)?ue[li]:null;if(il==null)break;var ya=Qr[il]?Qr[il].children:null;if(ya){for(var Xl=0;Xl<ya.length;Xl++)if(ya[Xl].id===li){wl+=ya[Xl].x;break}}li=il}return wl}if(r.direction==="LR"){for(var Ke=[],yn=0,tn=0;tn<zo.length;tn++){for(var Ia=0,Ma=0;Ma<zo[tn].ids.length;Ma++)Ma>0&&(Ia+=ci),Ia+=Qr[zo[tn].ids[Ma]].h;Ke.push(Ia),Ia>yn&&(yn=Ia)}for(var Sl=0,Ll=0,ja=0;ja<zo.length;ja++){for(var Ja=0,Ol=0;Ol<zo[ja].ids.length;Ol++)Qr[zo[ja].ids[Ol]].w>Ja&&(Ja=Qr[zo[ja].ids[Ol]].w);for(var Yl=(yn-Ke[ja])/2,ko=0;ko<zo[ja].ids.length;ko++){var fo=Qr[zo[ja].ids[ko]];Gr[zo[ja].ids[ko]]={x:Sl+(Ja-fo.w)/2,y:Yl},Yl+=fo.h+ci}Sl+=Ja+te(!1,!1),Ll=Sl-te(!1,!1)}return{pos:Gr,w:Ll,h:yn}}for(var lt={},Lt=0,ao=0;ao<zo.length;ao++){var wa=zo[ao];if(ao>0){for(var ho=[],Ra=0;Ra<wa.ids.length;Ra++){for(var Va=wa.ids[Ra],un=0,En=0,Oa=0;Oa<Ie.length;Oa++){var Vl=Ie[Oa];Vl.b===Va&&lt.hasOwnProperty(Vl.a)&&(un+=lt[Vl.a]-Qr[Vl.a].w/2+kn(Vl.src,Vl.a),En++)}ho.push({id:Va,order:Ra,key:En?un/En:1/0})}ho.sort(function(Na,Bl){return Na.key-Bl.key||Na.order-Bl.order});for(var Wl=[],hi=0;hi<ho.length;hi++)Wl.push(ho[hi].id);wa.ids=De(Wl,!0,!1)}for(var Ci=(ka-wa.w)/2,Qa=0;Qa<wa.ids.length;Qa++){var na=wa.ids[Qa],ai=Qr[na];Qa>0&&(Ci+=Math.max(te(Qr[wa.ids[Qa-1]].isContainer,ai.isContainer),It(wa.ids[Qa-1],na))),Gr[na]={x:Ci,y:Lt+(wa.h-ai.h)/2},lt[na]=Ci+ai.w/2,Ci+=ai.w}ao+1<zo.length?Lt+=wa.h+W(wa.allCont,zo[ao+1].allCont):Lt+=wa.h}for(var Ql={},Dl=0;Dl<zo.length;Dl++)for(var ri=0;ri<zo[Dl].ids.length;ri++)Ql[zo[Dl].ids[ri]]=Dl;function wi(Na,Bl){return Math.max(te(Qr[Na[Bl-1]].isContainer,Qr[Na[Bl]].isContainer),It(Na[Bl-1],Na[Bl]))}function Pi(Na,Bl,wl){for(var li=!1,La=0;La<wl.length;La++)if(wl[La]>0){li=!0;break}if(li){for(var il=[],ya=0;ya<Na.length;ya++){var Xl=Qr[Na[ya]],nu=ya>0?wi(Na,ya):0;for(il.push({first:ya,last:ya,w:Xl.w,gapBefore:nu,wSum:wl[ya],prefSum:wl[ya]>0?wl[ya]*(Bl[ya]-Xl.w/2):0,x:wl[ya]>0?Bl[ya]-Xl.w/2:Gr[Na[ya]].x});il.length>1;){var zi=il[il.length-1],Il=il[il.length-2];if(Il.x+Il.w+zi.gapBefore<=zi.x)break;var qs=Il.w+zi.gapBefore;Il.prefSum+=zi.prefSum-zi.wSum*qs,Il.wSum+=zi.wSum,Il.w=qs+zi.w,Il.last=zi.last,Il.wSum>0&&(Il.x=Il.prefSum/Il.wSum),il.pop()}}for(var Xt=null,Zs=0;Zs<il.length;Zs++){var ii=il[Zs],qi=ii.x;Xt!=null&&qi<Xt+ii.gapBefore&&(qi=Xt+ii.gapBefore);for(var Ls=0,Zi=ii.first;Zi<=ii.last;Zi++){var gn=Qr[Na[Zi]];Zi>ii.first&&(Ls+=wi(Na,Zi)),Gr[Na[Zi]].x=qi+Ls,lt[Na[Zi]]=qi+Ls+gn.w/2,Ls+=gn.w}Xt=qi+ii.w}}}for(var Ha=1;Ha<zo.length;Ha++){for(var Ml=zo[Ha].ids,os=[],ts=[],Fi=0;Fi<Ml.length;Fi++){for(var ca=0,bn=0,ll=0;ll<Ie.length;ll++){var ml=Ie[ll],Gl=ml.a===Ml[Fi]?ml.b:ml.b===Ml[Fi]?ml.a:null;Gl!=null&&Ql[Gl]<Ha&&(ca+=lt[Gl],bn++)}os.push(bn?ca/bn:Gr[Ml[Fi]].x+Qr[Ml[Fi]].w/2),ts.push(bn)}Pi(Ml,os,ts)}if(zo.length>1){for(var rl=zo[0].ids,nl=[],yl=[],vi=0;vi<rl.length;vi++){for(var hl=0,gs=0,ns=!0,ds=0;ds<Ie.length;ds++){var Rs=Ie[ds],al=Rs.a===rl[vi]?Rs.b:Rs.b===rl[vi]?Rs.a:null;if(!(al==null||Ql[al]===0)){for(var Ti=0;Ti<Ie.length&&ns;Ti++){var cs=Ie[Ti],hs=cs.a===al?cs.b:cs.b===al?cs.a:null;hs!=null&&hs!==rl[vi]&&Ql[hs]<Ql[al]&&(ns=!1)}ns&&(hl+=lt[al],gs++)}}nl.push(ns&&gs?hl/gs:Gr[rl[vi]].x+Qr[rl[vi]].w/2),yl.push(ns&&gs?1:0)}Pi(rl,nl,yl)}var Tl=1/0,ei=-1/0;for(var Ka in Gr)Gr.hasOwnProperty(Ka)&&(Gr[Ka].x<Tl&&(Tl=Gr[Ka].x),Gr[Ka].x+Qr[Ka].w>ei&&(ei=Gr[Ka].x+Qr[Ka].w));if(Tl!==1/0&&Tl!==0)for(var Xi in Gr)Gr.hasOwnProperty(Xi)&&(Gr[Xi].x-=Tl);return{pos:Gr,w:Tl===1/0?ka:ei-Tl,h:Lt}}function ie(kr){return kr&&kr.name?String(kr.name).split(`
+`).length:1}function pe(kr,Ir,Tr,Gr){var Vr=kr.kind,Ge=15*(ie(kr)-1);if(Vr==="node"){var Jr=Math.max(Ir+2*bs,Gr+2*Fs,80);return{w:Jr+ju,h:ju+30+Ge+Tr+16,childX:(Jr-Ir)/2,childY:ju+30+Ge}}if(Vr==="database"){var co=Math.max(Ir,Gr)+33;return{w:co,h:50+Ge+Tr+16,childX:(co-Ir)/2,childY:50+Ge}}if(Vr==="cloud"){var Ie=Math.max(Ir,Gr)+40;return{w:Ie,h:35+Ge+Tr+18,childX:(Ie-Ir)/2,childY:35+Ge}}var Ee=Math.max(Ir+2*bs,Gr+2*bs,80);return{w:Ee,h:vu+8+Ge+Tr+12,childX:(Ee-Ir)/2,childY:vu+8+Ge}}function Mo(kr){if(Qr[kr])return Qr[kr];if(po[kr]){var Ir=wo[kr];if(Po[kr]){var Tr=pe(Ir,0,0,Ki(Ir.name,!0));return Qr[kr]={w:Tr.w,h:Tr.h,isContainer:!0,kind:Ir.kind,children:[]},Qr[kr]}Po[kr]=!0;for(var Gr=(Ir.children||[]).slice(),Vr=[],Ge=0;Ge<Gr.length;Ge++)Po[Gr[Ge]]&&!Qr[Gr[Ge]]||(Mo(Gr[Ge]),Vr.push(Gr[Ge]));for(var Jr=[],co=[],Ie=0;Ie<Vr.length;Ie++){var Ee=Qr[Vr[Ie]],qo=Ee?Ee.kind:null;qo==="port"||qo==="portin"||qo==="portout"?Jr.push(Vr[Ie]):co.push(Vr[Ie])}if(Jr.length>0){for(var Ot=yo(co,Ir.id),no=Ki(Ir.name,!0),Fn=46,Cn=24,yt=Math.max(Ot.w,no,150),wt=yt+2*bs,rt=Fn+Ot.h+Cn,le=[],Fe=(wt-Ot.w)/2,$e=0;$e<co.length;$e++){var Se=Ot.pos[co[$e]];Se&&le.push({id:co[$e],x:Fe+Se.x,y:Fn+Se.y})}for(var ro=0;ro<Jr.length;ro++){var It=Qr[Jr[ro]],Jo=(ro+1)/(Jr.length+1);le.push({id:Jr[ro],x:Math.round(wt*Jo-It.w/2),y:-Math.round(It.h/2)})}return Qr[kr]={w:wt,h:rt,isContainer:!0,kind:Ir.kind,children:le},Qr[kr]}for(var xo=yo(Vr,Ir.id),Et=pe(Ir,xo.w,xo.h,Ki(Ir.name,!0)),Vn=[],Un=0;Un<Vr.length;Un++){var bt=xo.pos[Vr[Un]];bt&&Vn.push({id:Vr[Un],x:Et.childX+bt.x,y:Et.childY+bt.y})}return Qr[kr]={w:Et.w,h:Et.h,isContainer:!0,kind:Ir.kind,children:Vn},Qr[kr]}var mt=me[kr],In=Ou(mt);return Qr[kr]={w:In.w,h:In.h,isContainer:!1,kind:mt?mt.kind:null,children:[]},Qr[kr]}function Zt(kr,Ir,Tr,Gr,Vr,Ge,Jr){var co=Y(kr.color)||"#F1F1F1",Ie="#181818",Ee=kr.kind,qo=kr.body?ni(kr):null;wr(Ee,kr.stereotype,kr.color);function Ot(No,vt,Wt,Nt,$a,sn){if(qo==null)return pr(No,kr.name,vt,Wt,Nt,$a,sn,Jr);for(var ce=fs(Ee)-2,yr=[["html","1"],["whiteSpace","wrap"],["fontSize","14"],["align",r&&r.textAlign||"left"],["verticalAlign","middle"],["spacingLeft",String(ce)],["spacingRight",String(ce)]],Io=vt,ge=0;ge<yr.length;ge++)new RegExp("(?:^|;)"+yr[ge][0]+"=").test(Io)||(Io+=yr[ge][0]+"="+yr[ge][1]+";");return hr(No,qo.html,Xr(Io,!1),Wt,Nt,$a,sn,Jr)}function no(No,vt,Wt,Nt){h+=pr(xr("ci"),"","rounded=0;fillColor="+Ie+";strokeColor="+Ie+";",No,vt,Wt,Nt,Jr)}function Fn(No,vt,Wt){h+=pr(xr("cap"),kr.name,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=14;whiteSpace=wrap;",No,vt,Wt,wn+4,Jr)}if(Ee==="note"){var Cn=xr("note");h+=pr(Cn,kr.name,"shape=note;size=14;fillColor="+(Y(kr.color)||"#FEFFDD")+";strokeColor=#181818;fontSize=12;whiteSpace=wrap;align=left;",Tr,Gr,Vr,Ge,Jr),qr[Ir]=Cn;return}if(Ee==="port"||Ee==="portin"||Ee==="portout"){var yt=xr("n");h+=pr(yt,"","rounded=0;fillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr),qr[Ir]=yt,h+=pr(xr("cap"),kr.name,"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=bottom;fontSize=14;",Tr-12,Gr-20,Vr+24,18,Jr);return}if(qo==null&&ou(kr.name)&&!wu(kr.name)){var wt=rs(kr.name),rt=r&&r.textAlign||"left",le=xr("n");Ee==="usecase"?h+=pr(le,"","ellipse;fillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr):Ee==="cloud"?h+=pr(le,"","shape=cloud;fillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr):Ee==="database"?h+=pr(le,"","shape=cylinder;fillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr):Ee==="queue"?h+=pr(le,"","shape=cylinder3;direction=east;size=12;fillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr):Ee==="stack"?(h+=pr(le,"","rounded=0;fillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr),h+=Dr(xr("st"),"","endArrow=none;strokeColor="+Ie+";",Tr+Math.round(Vr*.22),Gr,Tr+Math.round(Vr*.22),Gr+5,"1"),h+=Dr(xr("st"),"","endArrow=none;strokeColor="+Ie+";",Tr+Math.round(Vr*.78),Gr,Tr+Math.round(Vr*.78),Gr+5,"1")):Ee==="hexagon"?h+=pr(le,"","shape=hexagon;fillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr):Ee==="storage"?h+=pr(le,"","rounded=1;arcSize=40;fillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr):h+=pr(le,"","rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr),qr[Ir]=le,h+=z(xr("lbl"),wt.html,"text;html=1;fontSize=14;strokeColor=none;fillColor=none;align="+rt+";verticalAlign=middle;",Tr+6,Gr,Vr-12,Ge,Jr);return}if(Kl[Ee]){var Fe=Ya(kr),$e=Fe.w,Se=Fe.h,ro=Tr+(Vr-$e)/2,It=xr("n");if(Ee==="actor")h+=pr(It,"","shape=umlActor;html=1;fillColor="+co+";strokeColor="+Ie+";",ro,Gr,$e,Se,Jr);else if(Ee==="boundary"){var Jo=Se,xo=ro+$e-Jo,Et=Gr+Jo/2;no(ro,Gr+Jo*.2,2,Jo*.6),no(ro,Et-1,xo-ro,2),h+=pr(It,"","ellipse;fillColor="+co+";strokeColor="+Ie+";",xo,Gr,Jo,Jo,Jr)}else{var Vn=Math.min($e,Se-(Ee==="entity"?6:0)),Un=Tr+(Vr-Vn)/2;h+=pr(It,"","ellipse;fillColor="+co+";strokeColor="+Ie+";",Un,Gr,Vn,Vn,Jr),Ee==="entity"?h+=pr(xr("ci"),"","line;strokeWidth=1;strokeColor="+Ie+";fillColor=none;",Un,Gr+Vn+1,Vn,2,Jr):Ee==="control"&&(no(Un+Vn*.34,Gr-1,8,2),no(Un+Vn*.34,Gr-1,2,7))}qr[Ir]=It,Fn(Tr,Gr+Se+Pn-4,Vr);return}if(Ee==="person"){var bt=22;h+=pr(xr("ci"),"","ellipse;fillColor="+co+";strokeColor="+Ie+";",Tr+(Vr-bt)/2,Gr,bt,bt,Jr);var mt=Gr+Math.round(bt*.7),In=xr("n");h+=Ot(In,"rounded=1;arcSize=40;fillColor="+co+";strokeColor="+Ie+";fontSize=14;verticalAlign=middle;whiteSpace=wrap;",Tr,mt,Vr,Gr+Ge-mt),qr[Ir]=In;return}if(Ee==="collections"){var Zn=4;h+=pr(xr("ci"),"","rounded=0;fillColor="+co+";strokeColor="+Ie+";",Tr+Zn,Gr,Vr-Zn,Ge-Zn,Jr);var Oe=xr("n");h+=Ot(Oe,"rounded=0;fillColor="+co+";strokeColor="+Ie+";fontSize=14;whiteSpace=wrap;",Tr,Gr+Zn,Vr-Zn,Ge-Zn),qr[Ir]=Oe;return}if(Ee==="queue"){var uo=xr("n");h+=Ot(uo,"shape=cylinder3;direction=east;size=5;fillColor="+co+";strokeColor="+Ie+";fontSize=14;whiteSpace=wrap;",Tr,Gr,Vr,Ge),qr[Ir]=uo;return}if(Ee==="stack"){var io=xr("n");h+=Ot(io,"shape=partialRectangle;top=0;left=1;right=1;bottom=1;fillColor="+co+";strokeColor="+Ie+";fontSize=14;whiteSpace=wrap;align=center;verticalAlign=middle;",Tr+15,Gr,Vr-30,Ge),h+=pr(xr("ci"),"","line;strokeWidth=1;strokeColor="+Ie+";fillColor=none;",Tr,Gr-1,15,2,Jr),h+=pr(xr("ci"),"","line;strokeWidth=1;strokeColor="+Ie+";fillColor=none;",Tr+Vr-15,Gr-1,15,2,Jr),qr[Ir]=io;return}if(Ee==="folder"||Ee==="package"){var we=xr("n"),de=Ee==="package",$o=Math.round(Ki(qo?de?kr.id:"":kr.name,!1)),ft="shape=folder;tabWidth="+(de?$o+25:Math.max(24,Math.min(Vr-8,$o+4)))+";tabHeight="+(de?23:21)+";tabPosition=left;html=1;whiteSpace=wrap;fillColor="+co+";strokeColor="+Ie+";fontSize=14;"+(de?"align=left;verticalAlign=top;spacingLeft=6;spacingTop=1;":"align=center;verticalAlign=middle;spacingTop=21;");qo&&de?(h+=pr(we,kr.id,ft,Tr,Gr,Vr,Ge,Jr),h+=Ot(xr("lbl"),"text;fillColor=none;strokeColor=none;fontSize=14;",Tr,Gr+23,Vr,Ge-23)):h+=Ot(we,ft,Tr,Gr,Vr,Ge),qr[Ir]=we;return}if(Ee==="frame"){var Vo=xr("n");h+=pr(Vo,"","shape=umlFrame;width=29;height=12;fillColor="+co+";swimlaneFillColor="+co+";strokeColor="+Ie+";",Tr,Gr,Vr,Ge,Jr),qr[Ir]=Vo,h+=Ot(xr("lbl"),"text;html=1;fillColor=none;strokeColor=none;fontSize=14;align=center;verticalAlign=middle;whiteSpace=wrap;",Tr,Gr+12,Vr,Ge-12);return}if(Ee==="artifact"){var zo=xr("n");h+=Ot(zo,"rounded=1;absoluteArcSize=1;arcSize=5;fillColor="+co+";strokeColor="+Ie+";fontSize=14;whiteSpace=wrap;",Tr,Gr,Vr,Ge),qr[Ir]=zo,h+=pr(xr("ci"),"","shape=note;size=6;fillColor="+co+";strokeColor="+Ie+";strokeWidth=0.5;",Tr+Vr-17,Gr+5,12,14,Jr);return}var ka=xr("n"),sa=Le(kr),_a=Ee==="component"||Ee==="bracket"||Ee==="bare"||!Ee&&kr.name;if(_a&&q==="uml1"&&(sa="shape=component;jettyWidth=10;jettyHeight=5;"+sa.replace(/^rounded=1;absoluteArcSize=1;arcSize=6;/,"")),h+=Ot(ka,sa,Tr,Gr,Vr,Ge),qr[Ir]=ka,_a&&q!=="rectangle"&&q!=="uml1"){var Ba="fillColor="+co+";strokeColor="+Ie+";";h+=pr(xr("ci"),"","rounded=0;"+Ba,Tr+Vr-20,Gr+5,15,10,Jr),h+=pr(xr("ci"),"",Ba,Tr+Vr-22,Gr+7,4,2,Jr),h+=pr(xr("ci"),"",Ba,Tr+Vr-22,Gr+11,4,2,Jr)}}function Uo(kr,Ir,Tr,Gr,Vr,Ge){var Jr=Qr[kr];if(Jr){if(Vr===void 0&&(Vr=Ir,Ge=Tr),ze[kr]={x:Vr,y:Ge,w:Jr.w,h:Jr.h},Jr.isContainer){var co=wo[kr],Ie=xr("c");wr(co.kind,co.stereotype,co.color),h+=pr(Ie,co.name,Fa(co),Ir,Tr,Jr.w,Jr.h,Gr),qr[kr]=Ie,co.kind==="component"&&(h+=pr(xr("ci"),"","rounded=0;fillColor=none;strokeColor=#181818;",Ir+Jr.w-20,Tr+5,15,10,Gr),h+=pr(xr("ci"),"","fillColor=none;strokeColor=#181818;",Ir+Jr.w-22,Tr+7,4,2,Gr),h+=pr(xr("ci"),"","fillColor=none;strokeColor=#181818;",Ir+Jr.w-22,Tr+11,4,2,Gr));for(var Ee=0;Ee<Jr.children.length;Ee++){var qo=Jr.children[Ee];Uo(qo.id,qo.x,qo.y,Ie,Vr+qo.x,Ge+qo.y)}return}Zt(me[kr],kr,Ir,Tr,Jr.w,Jr.h,Gr)}}function xn(){if(c.length>0)return!1;for(var kr=0;kr<i.length;kr++)if(i[kr].dir)return!0;return!1}function gt(){for(var kr=26,Ir=42,Tr=[],Gr=0;Gr<e.length;Gr++)Mo(e[Gr].id),Tr.push(e[Gr].id);if(Tr.length===0)return{pos:{},w:0,h:0};for(var Vr={},Ge=0;Ge<Tr.length;Ge++)Vr[Tr[Ge]]=!0;for(var Jr=[],co=0;co<i.length;co++){var Ie=i[co].from,Ee=i[co].to;if(!(!Vr[Ie]||!Vr[Ee]||Ie===Ee)){var qo=i[co].dir,Ot=qo==="d"?1:qo==="u"?-1:0;Jr.push({a:Ie,b:Ee,delta:Ot,dir:qo})}}var no={};no[Tr[0]]=0;for(var Fn=!0,Cn=0;Fn&&Cn++<Tr.length*Tr.length+64;){Fn=!1;for(var yt=0;yt<Jr.length;yt++){var wt=Jr[yt];no[wt.a]!==void 0&&no[wt.b]===void 0?(no[wt.b]=no[wt.a]+wt.delta,Fn=!0):no[wt.b]!==void 0&&no[wt.a]===void 0&&(no[wt.a]=no[wt.b]-wt.delta,Fn=!0)}}for(var rt=0;rt<Tr.length;rt++)no[Tr[rt]]===void 0&&(no[Tr[rt]]=0);for(var le=null,Fe=0;Fe<Jr.length;Fe++)if(Jr[Fe].dir==="r"||Jr[Fe].dir==="l"){le=no[Jr[Fe].a];break}for(var $e={},Se=0;Se<Tr.length;Se++){var ro=no[Tr[Se]];$e[ro]=($e[ro]||0)+1}if(le===null){var It=-1;for(var Jo in $e)$e[Jo]>It&&(It=$e[Jo],le=parseInt(Jo,10))}for(var xo={},Et=[],Vn=0;Vn<Tr.length;Vn++){var Un=no[Tr[Vn]];xo.hasOwnProperty(Un)||(xo[Un]=[],Et.push(Un)),xo[Un].push(Tr[Vn])}Et.sort(function(ko,fo){return ko-fo});for(var bt={},mt={},In=0,Zn=0;Zn<Et.length;Zn++){for(var Oe=0,uo=xo[Et[Zn]],io=0;io<uo.length;io++)Qr[uo[io]].h>Oe&&(Oe=Qr[uo[io]].h);mt[Et[Zn]]=Oe,bt[Et[Zn]]=In,In+=Oe+Ir}for(var we={},de={},$o=(xo[le]||[]).slice(),ft={},Vo={},zo=0;zo<$o.length;zo++)ft[$o[zo]]=[],Vo[$o[zo]]=0;for(var ka=0;ka<Jr.length;ka++){var sa=Jr[ka];if(!(no[sa.a]!==le||no[sa.b]!==le)){var _a=sa.a,Ba=sa.b;sa.dir==="l"&&(_a=sa.b,Ba=sa.a),ft[_a]&&Vo.hasOwnProperty(Ba)&&(ft[_a].push(Ba),Vo[Ba]++)}}for(var No=[],vt=[],Wt=0;Wt<$o.length;Wt++)Vo[$o[Wt]]===0&&vt.push($o[Wt]);for(var Nt=$o.length*$o.length+16;vt.length&&Nt-- >0;){var $a=vt.shift();No.push($a);for(var sn=0;sn<ft[$a].length;sn++)--Vo[ft[$a][sn]]===0&&vt.push(ft[$a][sn])}for(var ce=0;ce<$o.length;ce++)No.indexOf($o[ce])<0&&No.push($o[ce]);function yr(ko,fo){var lt=0;if(ko==null||fo==null)return lt;for(var Lt=0;Lt<i.length;Lt++){var ao=i[Lt];if(!(ao.hidden||!ao.label)&&(ao.from===ko&&ao.to===fo||ao.from===fo&&ao.to===ko)){var wa=Math.round(Ki(ao.label,!1))+16;wa>lt&&(lt=wa)}}return lt}for(var Io=0,ge=0;ge<No.length;ge++){var Ct=No[ge],Nn=Qr[Ct];we[Ct]={x:Io,y:bt[le]+(mt[le]-Nn.h)/2},de[Ct]=Io+Nn.w/2,Io+=Nn.w+Math.max(kr,yr(Ct,ge+1<No.length?No[ge+1]:null))}function Qn(ko){for(var fo=no[ko]<le?no[ko]+1:no[ko]-1,lt=[],Lt=0;Lt<Jr.length;Lt++)Jr[Lt].a===ko&&no[Jr[Lt].b]===fo?lt.push(Jr[Lt].b):Jr[Lt].b===ko&&no[Jr[Lt].a]===fo&&lt.push(Jr[Lt].a);return lt}function kn(ko){for(var fo=xo[ko].slice(),lt=0;lt<fo.length;lt++){for(var Lt=Qn(fo[lt]),ao=0,wa=0,ho=0;ho<Lt.length;ho++)de.hasOwnProperty(Lt[ho])&&(ao+=de[Lt[ho]],wa++);fo[lt]={id:fo[lt],want:wa?ao/wa:0}}fo.sort(function(Vl,Wl){return Vl.want-Wl.want});for(var Ra=-1e9,Va=0;Va<fo.length;Va++){var un=fo[Va].id,En=Qr[un],Oa=fo[Va].want-En.w/2;Oa<Ra&&(Oa=Ra),we[un]={x:Oa,y:bt[ko]+(mt[ko]-En.h)/2},de[un]=Oa+En.w/2,Ra=Oa+En.w+kr}}for(var Ke=0,yn=0;yn<Et.length;yn++){var tn=Math.abs(Et[yn]-le);tn>Ke&&(Ke=tn)}for(var Ia=1;Ia<=Ke;Ia++)xo.hasOwnProperty(le-Ia)&&kn(le-Ia),xo.hasOwnProperty(le+Ia)&&kn(le+Ia);for(var Ma=1e9,Sl=-1e9,Ll=-1e9,ja=0;ja<Tr.length;ja++){var Ja=we[Tr[ja]];if(Ja){var Ol=Qr[Tr[ja]];Ja.x<Ma&&(Ma=Ja.x),Ja.x+Ol.w>Sl&&(Sl=Ja.x+Ol.w),Ja.y+Ol.h>Ll&&(Ll=Ja.y+Ol.h)}}for(var Yl=0;Yl<Tr.length;Yl++)we[Tr[Yl]]&&(we[Tr[Yl]].x-=Ma);return{pos:we,w:Sl-Ma,h:Ll}}var To=[];if(xn())for(var Rt=gt(),Be=0;Be<e.length;Be++){var Ao=Rt.pos[e[Be].id];Ao&&Uo(e[Be].id,at+Ao.x,us+Ao.y,"1")}else{for(var et=0;et<c.length;et++)c[et].parent==null&&(Mo(c[et].id),To.push(c[et].id));for(var jo=0;jo<e.length;jo++)e[jo].parent==null&&!Qr[e[jo].id]&&(Mo(e[jo].id),To.push(e[jo].id));for(var Tn=yo(To,null),dn=0;dn<To.length;dn++){var An=Tn.pos[To[dn]];An&&Uo(To[dn],at+An.x,us+An.y,"1")}}var Bo={},kt={};function Yn(kr){return kr.from<kr.to?kr.from+"|"+kr.to:kr.to+"|"+kr.from}for(var go=0;go<i.length;go++)if(!i[go].hidden){var Ho=Yn(i[go]);Bo[Ho]=(Bo[Ho]||0)+1}var Ro=h.length,At="";p=null;for(var ot=0;ot<i.length;ot++){var oo=i[ot];if(!oo.hidden){var to=qr[oo.from],cn=qr[oo.to];if(!(!to||!cn||to===cn)){var Yt=Y(oo.color)||"#181818",so="strokeColor="+Yt+";fontColor=#000000;fontSize=12;html=1;"+(oo.bold?"strokeWidth=2;":"")+(oo.label?"labelBackgroundColor=#FFFFFF;":"");oo.arrowHead==="none"?so+="endArrow=none;":oo.arrowHead==="bidirectional"?so+="endArrow=classicThin;endFill=1;startArrow=classicThin;startFill=1;":oo.arrowHead==="socket"?so+="endArrow=halfCircle;endSize=7;endFill=0;":so+="endArrow=classicThin;endFill=1;",oo.lineStyle==="dotted"?so+="dashed=1;dashPattern=1 3;":oo.lineStyle==="dashed"&&(so+="dashed=1;dashPattern=7 7;");var Bn=ze[oo.from],tt=ze[oo.to];if(Bn&&tt&&Bn.y>tt.y+tt.h+60){for(var an=!1,Ga=Bn.x+Bn.w/2,hn=Bn.y+Bn.h/2,Da=tt.x+tt.w/2,jt=tt.y+tt.h/2,_n={},da=oo.from;da!=null;da=ue[da])_n[da]=!0;for(var Jt=oo.to;Jt!=null;Jt=ue[Jt])_n[Jt]=!0;for(var Ut in ze)if(!(!ze.hasOwnProperty(Ut)||_n[Ut])){var ga=ze[Ut],mn=ga.y+ga.h/2;if(!(mn<=jt||mn>=hn)){var ma=(mn-hn)/(jt-hn),oa=Ga+ma*(Da-Ga);if(oa>=ga.x-4&&oa<=ga.x+ga.w+4){an=!0;break}}}if(an){var On=0;for(var Za in ze)if(ze.hasOwnProperty(Za)){var be=ze[Za];be.x+be.w>On&&(On=be.x+be.w)}On+=28;var $n=so+"exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;";h+=' <mxCell id="'+g(xr("e"))+'" value="'+o(oo.label||"",$n)+'" style="'+g($n)+'" edge="1" source="'+g(qr[oo.from])+'" target="'+g(qr[oo.to])+`" parent="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
- <mxPoint x="`+Nt+'" y="'+Math.round(Eo)+`"/>
- <mxPoint x="`+Nt+'" y="'+Math.round(Cr)+`"/>
+ <mxPoint x="`+On+'" y="'+Math.round(hn)+`"/>
+ <mxPoint x="`+On+'" y="'+Math.round(jt)+`"/>
</Array>
</mxGeometry>
</mxCell>
-`;continue}}var Ho=ft(oe);if(Ao[Ho]>1){var Ce=_t[Ho]=(_t[Ho]||0)+1,ln=Math.round((.5+(Ce-(Ao[Ho]+1)/2)*.36)*100)/100,nt=qe[oe.from],wo=qe[oe.to];if(nt&&wo){var xn=nt.x+nt.w/2,Lt=nt.y+nt.h/2,Ft=wo.x+wo.w/2,fe=wo.y+wo.h/2;if(Math.abs(fe-Lt)>=Math.abs(Ft-xn)){var ge=fe>Lt;dt+="exitX="+ln+";exitY="+(ge?1:0)+";exitDx=0;exitDy=0;entryX="+ln+";entryY="+(ge?0:1)+";entryDx=0;entryDy=0;"}else{var qt=Ft>xn;dt+="exitX="+(qt?1:0)+";exitY="+ln+";exitDx=0;exitDy=0;entryX="+(qt?0:1)+";entryY="+ln+";entryDx=0;entryDy=0;"}}else dt+="exitX="+ln+";exitY="+ln+";exitDx=0;exitDy=0;entryX="+ln+";entryY="+ln+";entryDx=0;entryDy=0;"}dt=j(tr(dt,["arrow"],null,"edge",oe.color?["strokeColor"]:null),Z),C+=vr(Fr("e"),oe.label||"",dt,Uo,Ot,"1")}}}var et=r.notes||[];function en(Rr){for(var xr=Rr?String(Rr).split(`
-`):[""],br=0,Br=0;Br<xr.length;Br++)br=Math.max(br,zi(xr[Br],!1)*.93);return{w:Math.max(50,Math.ceil(br)+21),h:Math.max(24,Math.round(xr.length*15.3+10))}}var Zt=35;function qn(Rr){if(qe[Rr])return Rr;for(var xr=0;xr<e.length;xr++)if(e[xr].name===Rr&&qe[e[xr].id])return e[xr].id;return null}for(var Ko=0;Ko<et.length;Ko++){let Rr=function(xr){return xr==="left"?{x:Je.x-sn.w-Zt,y:Je.y+(Je.h-sn.h)/2}:xr==="top"?{x:Je.x+(Je.w-sn.w)/2,y:Je.y-sn.h-Zt}:xr==="bottom"?{x:Je.x+(Je.w-sn.w)/2,y:Je.y+Je.h+Zt}:{x:Je.x+Je.w+Zt,y:Je.y+(Je.h-sn.h)/2}};var Hn=et[Ko],aa=qn(Hn.target),Je=aa?qe[aa]:null,sn=en(Hn.text),Bn=10,$t=10,mo=Hn.position||"right";if(Je){var Pt=Rr(mo);Bn=Pt.x,$t=Pt.y}for(var ra=[],Ut=0;Ut<Ko;Ut++)et[Ut]._placed&&ra.push(et[Ut]._placed);var Wn=function(xr,br){var Br=ra.slice();for(var Pr in qe)qe.hasOwnProperty(Pr)&&Pr!==aa&&(ao[Pr]||Br.push(qe[Pr]));for(var Xe=0;Xe<Br.length;Xe++){var zr=Br[Xe];if(xr<zr.x+zr.w&&xr+sn.w>zr.x&&br<zr.y+zr.h&&br+sn.h>zr.y)return zr}return null};if(Je&&Wn(Bn,$t))for(var yt={left:"right",right:"left",top:"bottom",bottom:"top"},Zn=[yt[mo],"bottom","top","right","left"],on=0;on<Zn.length;on++){var va=Zn[on];if(va!==mo){var ga=Rr(va);if(ga.x>=0&&ga.y>=0&&!Wn(ga.x,ga.y)){mo=va,Bn=ga.x,$t=ga.y;break}}}for(var jn=0;jn<8;jn++){var Fn=Wn(Bn,$t);if(!Fn)break;mo==="left"?Bn=Fn.x-sn.w-12:mo==="top"?$t=Fn.y-sn.h-12:mo==="bottom"?$t=Fn.y+Fn.h+12:Bn=Fn.x+Fn.w+12}Hn._placed={x:Bn,y:$t,w:sn.w,h:sn.h};var Mn=Fr("note");if(Bn=Math.round(Bn),$t=Math.round($t),C+=fr(Mn,Hn.text||"",tr("shape=note;size=10;fillColor=#FEFFDD;strokeColor=#181818;fontSize=13;whiteSpace=wrap;align=left;spacingLeft=4;",["note"]),Bn,$t,sn.w,sn.h,"1"),Je){var la=tr("shape=triangle;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;",["note"]),Tn=Math.round(Je.x+Je.w/2),gt=Math.round(Je.y+Je.h/2);mo==="left"?C+=fr(Fr("noteptr"),"",la+"direction=east;",Bn+sn.w-1,gt-4,Math.max(6,Je.x-(Bn+sn.w)+1),8,"1"):mo==="top"?C+=fr(Fr("noteptr"),"",la+"direction=south;",Tn-4,$t+sn.h-1,8,Math.max(6,Je.y-($t+sn.h)+1),"1"):mo==="bottom"?C+=fr(Fr("noteptr"),"",la+"direction=north;",Tn-4,Je.y+Je.h,8,Math.max(6,$t-(Je.y+Je.h)+1),"1"):C+=fr(Fr("noteptr"),"",la+"direction=west;",Je.x+Je.w,gt-4,Math.max(6,Bn-(Je.x+Je.w)+1),8,"1")}}if(cn&&(C=C.slice(0,wt)+cn+C.slice(wt)),r.title){var Rt=null,Jt=null,ct=null;for(var wn in qe)if(qe.hasOwnProperty(wn)){var wo=qe[wn];(Rt===null||wo.x<Rt)&&(Rt=wo.x),(Jt===null||wo.x+wo.w>Jt)&&(Jt=wo.x+wo.w),(ct===null||wo.y<ct)&&(ct=wo.y)}Rt===null&&(Rt=0,Jt=200,ct=Qo);var In=String(r.title).split(`
-`),ko=Math.max(120,Math.round(zi(r.title,!0))+20),Do=In.length*20+4;C+=fr(Fr("title"),r.title,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",Math.round((Rt+Jt)/2-ko/2),Math.round(ct-Do-12),ko,Do,"1")}return C}var ci=23,ys=19,pu=8,au=8,Yf=21;function Lu(r){return r.text!=null?r.text:r.value?r.name+" = "+r.value:r.name}function $u(r){for(var a=[],e=0;e<r.length;e++)r[e].separator||a.push(Lu(r[e]));return a.join(`
-`)}function Mf(r){var a=r.style==="."?"1px dotted":r.style==="="?"3px double":(r.style==="_","1px solid"),e='<hr style="border:none;border-top:'+a+' #181818;margin:3px 0 3px;">';return r.title?e+'<div style="text-align:center;">'+n(r.title)+"</div>":e}var Id=16,$f=35,xf=60,Gu=7,gf=30,Nd=12,wu=34,Ld=16;function Gd(r,a){var e=r.objects,h=r.maps,l=r.links,C="",b=0,Z=r.styleSheet||null,v=null;function er(Po,Ct,bt,Vr,to,Xt){return W(Po,Z,["root","element",Ct].concat(bt),Vr||[],to||"vertex",Xt)}var X=function(Po,Ct,bt,Vr,to,Xt,ha,Wr){return v!=null&&bt.indexOf("text;")===0&&(bt=er(bt,"objectDiagram",[v.name],v.stereotypes,"text")),$(Po,Ct,bt,Vr,to,Xt,ha,Wr)};function V(Po){return Po+"_"+b++}for(var tr={},wr=0;wr<h.length;wr++)tr[h[wr].id]=h[wr];var yr={};function fr(Po,Ct){return is(Po,Ct||14,!1)}function Ar(Po){for(var Ct=Po&&Po.entries?Po.entries:[],bt=0,Vr=0,to=0;to<Ct.length;to++)bt=Math.max(bt,fr(Ct[to].key)),Vr=Math.max(Vr,fr(Ct[to].value));return{keyColW:bt+10,valColW:Vr+10}}function jr(Po){var Ct=Po.kind==="map"&&tr.hasOwnProperty(Po.id),bt=fr(Po.name)+14;if(Po.stereotype&&(bt=Math.max(bt,fr("\xAB"+Po.stereotype+"\xBB",12)+10)),Ct){var Vr=tr[Po.id],to=Vr.entries?Vr.entries.length:0,Xt=Ar(Vr);return{w:Math.max(bt,Xt.keyColW+Xt.valColW),h:ci*(to+1)}}for(var ha=Po.attributes||[],Wr=bt,ro=0,te=0;te<ha.length;te++){var ue=ha[te];if(ue.separator){ro+=ue.title?Yf:au,ue.title&&(Wr=Math.max(Wr,fr(ue.title)+12));continue}Wr=Math.max(Wr,fr(Lu(ue))+12),ro+=ys}return{w:Wr,h:ci+(Po.stereotype?16:0)+(ha.length===0?Id:ro+pu)}}for(var ce={},Nr=r.packages||[],de=0;de<Nr.length;de++)for(var Fr=Nr[de].objects||[],Ir=0;Ir<Fr.length;Ir++)ce[Fr[Ir]]=Nr[de];function qe(Po){return Po==="node"?{side:46,top:40,bottom:16}:Po==="cloud"?{side:18,top:36,bottom:22}:Po==="database"?{side:31,top:50,bottom:16}:Po==="folder"||Po==="frame"?{side:20,top:35,bottom:16}:{side:32,top:35,bottom:16}}function To(Po){var Ct=ce[Po.id];if(!Ct)return null;var bt=jr(Po),Vr=(Ct.stereotype||"").toLowerCase(),to=fr(Ct.name),Xt=qe(Vr),ha=Math.max(bt.w+Xt.side*2,to+Nd*2),Wr=Xt.top+bt.h+Xt.bottom;return{w:ha,h:Wr,top:Xt.top,stereotype:Vr,name:Ct.name}}function ne(Po){var Ct=To(Po);return Ct?{w:Ct.w,h:Ct.h}:jr(Po)}for(var po=Nr.length>0,ao={},A=0;A<e.length;A++)ao[e[A].id]=!0;for(var J={},ur={},A=0;A<e.length;A++)J[e[A].id]=[],ur[e[A].id]=0;for(var Sr=0;Sr<l.length;Sr++){var Er=l[Sr];if(!(!ao[Er.from]||!ao[Er.to]||Er.from===Er.to)){var qr,z;Er.type==="generalization"?(qr=Er.to,z=Er.from):(qr=Er.from,z=Er.to),J[qr].push(z),ur[z]++}}var Mr={},Be=[];for(var ye in ur)ur.hasOwnProperty(ye)&&ur[ye]===0&&(Mr[ye]=0,Be.push(ye));for(var Le=e.length*e.length+16;Be.length>0&&Le-- >0;)for(var _e=Be.shift(),Ur=J[_e]||[],yo=0;yo<Ur.length;yo++){var fo=Ur[yo],he=Mr[_e]+1;(Mr[fo]===void 0||Mr[fo]<he)&&(Mr[fo]=he,Be.push(fo))}for(var A=0;A<e.length;A++)Mr[e[A].id]===void 0&&(Mr[e[A].id]=0);for(var Te={},ae=[],A=0;A<e.length;A++){var it=Mr[e[A].id];Te[it]||(Te[it]=[],ae.push(it)),Te[it].push(e[A])}ae.sort(function(Po,Ct){return Po-Ct});for(var Gt={},oo={},pt=0,rt=0;rt<ae.length;rt++){for(var jo=Te[ae[rt]],Qt=0,Me=0,Io=0;Io<jo.length;Io++){var Wo=ne(jo[Io]);Io>0&&(Qt+=$f),Qt+=Wo.w,Wo.h>Me&&(Me=Wo.h)}Gt[ae[rt]]=Qt,oo[ae[rt]]=Me,Qt>pt&&(pt=Qt)}for(var Ro={},An=0;An<l.length;An++){var dn=l[An];if(dn.label){var rn=dn.type==="generalization"?dn.to:dn.from;Mr[rn]!==void 0&&(Ro[Mr[rn]]=!0)}}for(var Ao={},_t=0;_t<e.length;_t++){var ft=e[_t];ft.kind==="map"&&tr.hasOwnProperty(ft.id)&&(Ao[Mr[ft.id]]=!0)}for(var Se=0,Go=0;Go<Nr.length;Go++){var wt=qe((Nr[Go].stereotype||"").toLowerCase()).top;wt>Se&&(Se=wt)}for(var cn=Gu+(po?Se:0),No={},rt=0;rt<ae.length;rt++){for(var oe=ae[rt],Uo=Te[oe],Ot=oo[oe],ho=Gu+(pt-Gt[oe])/2,Io=0;Io<Uo.length;Io++){var dt=Uo[Io],Aa=jr(dt),Sn=ne(dt);No[dt.id]={x:ho+(Sn.w-Aa.w)/2,y:cn+(Ot-Aa.h)/2,w:Aa.w,h:Aa.h},ho+=Sn.w+$f}cn+=Ot+xf+(Ao[oe]?8:0)+(Ro[oe]?18:0)}for(var an={},we=0;we<l.length;we++){var Eo=l[we];if(!(Eo.fromRow==null||!tr[Eo.from])){for(var Et=0,Cr=0;Cr<l.length;Cr++)Cr!==we&&(l[Cr].from===Eo.to||l[Cr].to===Eo.to)&&Et++;Et>0||!No[Eo.to]||!No[Eo.from]||(an[Eo.from]||(an[Eo.from]=[]),an[Eo.from].push(Eo))}}for(var Lr in an)if(an.hasOwnProperty(Lr))for(var He=an[Lr],Ie=No[Lr],Oe=tr[Lr].entries||[],so=Ie.x+Ie.w+50,Xo=He.length-1;Xo>=0;Xo--){for(var qo=No[He[Xo].to],Yn=0,Nt=0;Nt<Oe.length;Nt++)if(Oe[Nt].key===He[Xo].fromRow){Yn=Nt;break}He[Xo]._rowIdx=Yn,qo.x=so,qo.y=Ie.y+ci*(Yn+1)+ci/2-qo.h/2,qo.y<Gu&&(qo.y=Gu),so+=qo.w+40}for(var Da=r.packages||[],je={},_r=0;_r<Da.length;_r++){var Ho=Da[_r],Ce=Ho.objects||[];if(Ce.length!==0){var ln=null,nt;for(nt=0;nt<e.length;nt++)if(Ce.indexOf(e[nt].id)>=0){ln=e[nt];break}for(var wo=1/0,xn=1/0,Lt=-1/0,Ft=-1/0,fe=!1,ge=0;ge<Ce.length;ge++){var qt=No[Ce[ge]];qt&&(fe=!0,qt.x<wo&&(wo=qt.x),qt.y<xn&&(xn=qt.y),qt.x+qt.w>Lt&&(Lt=qt.x+qt.w),qt.y+qt.h>Ft&&(Ft=qt.y+qt.h))}if(!(!fe||!ln)){var et=To(ln),en=et?et.w:Lt-wo+gf*2,Zt=et?et.h:Ft-xn+wu+Ld,qn=(wo+Lt)/2,Ko=qn-en/2,Hn=xn-(et?et.top:wu),aa=et?et.stereotype:"",Je=V("opkg"),sn="container=1;collapsible=0;";for(ge=0;ge<Ce.length;ge++)No[Ce[ge]]&&(je[Ce[ge]]={id:Je,x:Ko,y:Hn});var Bn="text;html=1;fillColor=none;strokeColor=none;fontColor=#000000;fontSize=14;align=left;verticalAlign=middle;spacingLeft=3;",$t="text;html=1;fillColor=none;strokeColor=none;fontColor=#000000;fontSize=14;align=center;verticalAlign=middle;";if(aa==="folder"){var mo=Math.round(Math.min(en-8,fr(Ho.name)+20));C+=X(Je,Ho.name,"shape=folder;tabWidth="+mo+";tabHeight=22;tabPosition=left;html=1;fillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacingLeft=3;spacingTop=1;"+sn,Ko,Hn,en,Zt,"1");continue}if(aa==="frame"){C+=X(Je,Ho.name,"shape=umlFrame;width="+en+";height=20;html=1;fillColor=none;swimlaneFillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=middle;spacingLeft=3;"+sn,Ko,Hn,en,Zt,"1");continue}var Pt,ra,Ut,Wn,yt;aa==="node"?(Pt="shape=cube;size=10;fillColor=none;strokeColor=#000000;",ra=0,Ut=en-10,Wn=15,yt=$t):aa==="cloud"?(Pt="shape=mxgraph.basic.cloud_rect;fillColor=none;strokeColor=#000000;",ra=0,Ut=en,Wn=12,yt=$t):aa==="database"?(Pt="shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;fillColor=none;strokeColor=#000000;",ra=0,Ut=en,Wn=24,yt=$t):(Pt="rounded=0;fillColor=none;strokeColor=#000000;",ra=4,Ut=en-8,Wn=4,yt=Bn),C+=X(Je,"",Pt+sn,Ko,Hn,en,Zt,"1"),C+=X(V("opkgl"),Ho.name,yt,ra,Wn,Ut,20,Je)}}}for(var Zn=0;Zn<e.length;Zn++){var on=e[Zn],va=No[on.id],ga=va.x,jn=va.y,Fn=va.w,Mn=va.h,la=on.kind==="map"&&tr.hasOwnProperty(on.id),Tn=la?tr[on.id]:null,gt=la&&Tn.entries?Tn.entries:[],Rt=!la&&on.attributes?on.attributes:[],Jt=V("obj"),ct=Y(on.color)||"#F1F1F1",wn=ci+(!la&&on.stereotype?16:0),In="swimlane;collapsible=0;startSize="+wn+";rounded=0;whiteSpace=wrap;fontStyle=0;fontSize=14;align=center;fillColor="+ct+";swimlaneFillColor="+ct+";strokeColor=#181818;",ko=on.stereotype?"\xAB"+on.stereotype+`\xBB
-`+on.name:on.name,Do=on.stereotype?[on.stereotype]:[],Rr=la?"map":"object",xr=H(Z,["root","element","objectDiagram",Rr],Do,"vertex"),br=H(Z,["root","element","objectDiagram",Rr,"header"],Do,"vertex");on.color?(delete xr.fillColor,delete xr.gradientColor,delete br.fillColor,delete br.gradientColor):xr.fillColor!=null&&(xr.swimlaneFillColor=xr.fillColor);for(var Br in br)br.hasOwnProperty(Br)&&!/^(strokeColor|strokeWidth|dashed|dashPattern|fixDash|rounded|arcSize|absoluteArcSize|shadow)$/.test(Br)&&(xr[Br]=br[Br]);v=Z==null?null:{name:Rr,stereotypes:Do};var Pr=je[on.id]||{id:"1",x:0,y:0};if(C+=X(Jt,ko,M(In,xr),ga-Pr.x,jn-Pr.y,Fn,Mn,Pr.id),la){for(var Xe=Ar(Tn),zr=Xe.keyColW,Ke=Fn-zr,De=0;De<gt.length;De++){var ze=gt[De],So=ci+De*ci;C+=X(V("mk"),ze.key,"text;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=14;fillColor=none;strokeColor=none;",0,So,zr,ci,Jt),C+=X(V("mv"),ze.value,"text;align=left;spacingLeft=5;verticalAlign=middle;whiteSpace=wrap;fontSize=14;fillColor=none;strokeColor=none;",zr,So,Ke,ci,Jt)}C+=G(V("mgl"),"","endArrow=none;strokeColor=#181818;strokeWidth=1;",ga+zr,jn+ci,ga+zr,jn+Mn,"1");for(var ot=1;ot<gt.length;ot++){var ve=jn+ci+ot*ci;C+=G(V("mgl"),"","endArrow=none;strokeColor=#181818;strokeWidth=1;",ga,ve,ga+Fn,ve,"1")}}else{for(var Yt="",At=!1,ht=!0,Vt=!1,Pn=0;Pn<Rt.length;Pn++){var Ae=Rt[Pn];if(Vt=!0,Ae.separator){At=!0,Yt+=Mf(Ae),ht=!0;continue}ht||(Yt+="<br>"),Yt+=n(Lu(Ae)),ht=!1}if(Vt){var Fe="text;align=left;verticalAlign=top;spacingLeft=6;spacingTop=2;whiteSpace=wrap;fontSize=14;fillColor=none;strokeColor=none;";C+=At?K(V("oattr"),Yt,Fe+"html=1;",0,ci,Fn,Mn-ci,Jt):X(V("oattr"),$u(Rt),Fe,0,ci,Fn,Mn-ci,Jt)}}yr[on.id]={x:ga,y:jn,w:Fn,h:Mn,cellId:Jt}}for(var le=0;le<l.length;le++){var Ne=l[le],Qe=yr[Ne.from],tn=yr[Ne.to];if(!(!Qe||!tn)){var Vo;if(Ne.type==="generalization"?Vo="endArrow=block;endFill=0;":Ne.type==="composition"?Vo="startArrow=diamond;startFill=1;endArrow=none;":Ne.type==="aggregation"?Vo="startArrow=diamond;startFill=0;endArrow=none;":Ne.type==="link"?Vo="endArrow=none;":Vo="endArrow=classicThin;endFill=1;endSize=8;",Ne._rowIdx!=null&&Qe.h>0){var xo=(ci*(Ne._rowIdx+1)+ci/2)/Qe.h;Vo+="exitX=1;exitY="+Math.round(xo*1e3)/1e3+";exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;"}Vo+="strokeColor=#181818;fontColor=#000000;fontSize=12;html=1;rounded=0;",Ne.lineStyle==="dotted"?Vo+="dashed=1;dashPattern=2 2;":Ne.lineStyle==="dashed"&&(Vo+="dashed=1;dashPattern=5 5;"),Vo=j(er(Vo,"classDiagram",["arrow"],null,"edge",Ne.color?["strokeColor"]:null),Z);var Co;if(Ne.label){var mn=Math.round(fr(Ne.label)/2)+1;Co=` <mxGeometry relative="1" as="geometry">
- <mxPoint x="`+mn+`" y="0" as="offset"/>
+`;continue}}var Wn=Yn(oo);if(Bo[Wn]>1){var $r=kt[Wn]=(kt[Wn]||0)+1,ee=Math.round((.5+($r-(Bo[Wn]+1)/2)*.36)*100)/100,Rr=ze[oo.from],tr=ze[oo.to];if(Rr&&tr){var vr=Rr.x+Rr.w/2,Te=Rr.y+Rr.h/2,jr=tr.x+tr.w/2,_e=tr.y+tr.h/2;if(Math.abs(_e-Te)>=Math.abs(jr-vr)){var Br=_e>Te;so+="exitX="+ee+";exitY="+(Br?1:0)+";exitDx=0;exitDy=0;entryX="+ee+";entryY="+(Br?0:1)+";entryDx=0;entryDy=0;"}else{var br=jr>vr;so+="exitX="+(br?1:0)+";exitY="+ee+";exitDx=0;exitDy=0;entryX="+(br?0:1)+";entryY="+ee+";entryDx=0;entryDy=0;"}}else so+="exitX="+ee+";exitY="+ee+";exitDx=0;exitDy=0;entryX="+ee+";entryY="+ee+";entryDx=0;entryDy=0;"}so=J(nr(so,["arrow"],null,"edge",oo.color?["strokeColor"]:null),j),h+=mr(xr("e"),oo.label||"",so,to,cn,"1")}}}var Or=r.notes||[];function xe(kr){for(var Ir=kr?String(kr).split(`
+`):[""],Tr=0,Gr=0;Gr<Ir.length;Gr++)Tr=Math.max(Tr,Ki(Ir[Gr],!1)*.93);return{w:Math.max(50,Math.ceil(Tr)+21),h:Math.max(24,Math.round(Ir.length*15.3+10))}}var bo=35;function _t(kr){if(ze[kr])return kr;for(var Ir=0;Ir<e.length;Ir++)if(e[Ir].name===kr&&ze[e[Ir].id])return e[Ir].id;return null}for(var Wo=0;Wo<Or.length;Wo++){let kr=function(Ir){return Ir==="left"?{x:Do.x-Fr.w-bo,y:Do.y+(Do.h-Fr.h)/2}:Ir==="top"?{x:Do.x+(Do.w-Fr.w)/2,y:Do.y-Fr.h-bo}:Ir==="bottom"?{x:Do.x+(Do.w-Fr.w)/2,y:Do.y+Do.h+bo}:{x:Do.x+Do.w+bo,y:Do.y+(Do.h-Fr.h)/2}};var Fo=Or[Wo],ut=_t(Fo.target),Do=ut?ze[ut]:null,Fr=xe(Fo.text),Gt=10,st=10,Mn=Fo.position||"right";if(Do){var jn=kr(Mn);Gt=jn.x,st=jn.y}for(var Hn=[],Xo=0;Xo<Wo;Xo++)Or[Xo]._placed&&Hn.push(Or[Xo]._placed);var Xn=function(Ir,Tr){var Gr=Hn.slice();for(var Vr in ze)ze.hasOwnProperty(Vr)&&Vr!==ut&&(po[Vr]||Gr.push(ze[Vr]));for(var Ge=0;Ge<Gr.length;Ge++){var Jr=Gr[Ge];if(Ir<Jr.x+Jr.w&&Ir+Fr.w>Jr.x&&Tr<Jr.y+Jr.h&&Tr+Fr.h>Jr.y)return Jr}return null};if(Do&&Xn(Gt,st))for(var Ta={left:"right",right:"left",top:"bottom",bottom:"top"},Kn=[Ta[Mn],"bottom","top","right","left"],Qo=0;Qo<Kn.length;Qo++){var pa=Kn[Qo];if(pa!==Mn){var Mt=kr(pa);if(Mt.x>=0&&Mt.y>=0&&!Xn(Mt.x,Mt.y)){Mn=pa,Gt=Mt.x,st=Mt.y;break}}}for(var la=0;la<8;la++){var vn=Xn(Gt,st);if(!vn)break;Mn==="left"?Gt=vn.x-Fr.w-12:Mn==="top"?st=vn.y-Fr.h-12:Mn==="bottom"?st=vn.y+vn.h+12:Gt=vn.x+vn.w+12}Fo._placed={x:Gt,y:st,w:Fr.w,h:Fr.h};var Jn=xr("note");if(Gt=Math.round(Gt),st=Math.round(st),h+=pr(Jn,Fo.text||"",nr("shape=note;size=10;fillColor=#FEFFDD;strokeColor=#181818;fontSize=13;whiteSpace=wrap;align=left;spacingLeft=4;",["note"]),Gt,st,Fr.w,Fr.h,"1"),Do){var qn=nr("shape=triangle;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;",["note"]),ia=Math.round(Do.x+Do.w/2),zn=Math.round(Do.y+Do.h/2);Mn==="left"?h+=pr(xr("noteptr"),"",qn+"direction=east;",Gt+Fr.w-1,zn-4,Math.max(6,Do.x-(Gt+Fr.w)+1),8,"1"):Mn==="top"?h+=pr(xr("noteptr"),"",qn+"direction=south;",ia-4,st+Fr.h-1,8,Math.max(6,Do.y-(st+Fr.h)+1),"1"):Mn==="bottom"?h+=pr(xr("noteptr"),"",qn+"direction=north;",ia-4,Do.y+Do.h,8,Math.max(6,st-(Do.y+Do.h)+1),"1"):h+=pr(xr("noteptr"),"",qn+"direction=west;",Do.x+Do.w,zn-4,Math.max(6,Gt-(Do.x+Do.w)+1),8,"1")}}if(At&&(h=h.slice(0,Ro)+At+h.slice(Ro)),r.title){var Ko=null,Bt=null,ta=null;for(var ln in ze)if(ze.hasOwnProperty(ln)){var tr=ze[ln];(Ko===null||tr.x<Ko)&&(Ko=tr.x),(Bt===null||tr.x+tr.w>Bt)&&(Bt=tr.x+tr.w),(ta===null||tr.y<ta)&&(ta=tr.y)}Ko===null&&(Ko=0,Bt=200,ta=us);var mo=String(r.title).split(`
+`),Vt=Math.max(120,Math.round(Ki(r.title,!0))+20),nt=mo.length*20+4;h+=pr(xr("title"),r.title,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",Math.round((Ko+Bt)/2-Vt/2),Math.round(ta-nt-12),Vt,nt,"1")}return h}var cl=23,Es=19,Ju=8,Fd=8,Ed=21;function Pu(r){return r.text!=null?r.text:r.value?r.name+" = "+r.value:r.name}function Sd(r){for(var l=[],e=0;e<r.length;e++)r[e].separator||l.push(Pu(r[e]));return l.join(`
+`)}function Oc(r){var l=r.style==="."?"1px dotted":r.style==="="?"3px double":(r.style==="_","1px solid"),e='<hr style="border:none;border-top:'+l+' #181818;margin:3px 0 3px;">';return r.title?e+'<div style="text-align:center;">'+t(r.title)+"</div>":e}var Dd=16,od=35,yc=60,Vu=7,bc=30,td=12,Td=34,Fc=16;function xu(r,l){var e=r.objects,c=r.maps,i=r.links,h="",F=0,j=r.styleSheet||null,p=null;function or(No,vt,Wt,Nt,$a,sn){return X(No,j,["root","element",vt].concat(Wt),Nt||[],$a||"vertex",sn)}var q=function(No,vt,Wt,Nt,$a,sn,ce,yr){return p!=null&&Wt.indexOf("text;")===0&&(Wt=or(Wt,"objectDiagram",[p.name],p.stereotypes,"text")),m(No,vt,Wt,Nt,$a,sn,ce,yr)};function rr(No){return No+"_"+F++}for(var nr={},Xr=0;Xr<c.length;Xr++)nr[c[Xr].id]=c[Xr];var wr={};function pr(No,vt){return Ss(No,vt||14,!1)}function Dr(No){for(var vt=No&&No.entries?No.entries:[],Wt=0,Nt=0,$a=0;$a<vt.length;$a++)Wt=Math.max(Wt,pr(vt[$a].key)),Nt=Math.max(Nt,pr(vt[$a].value));return{keyColW:Wt+10,valColW:Nt+10}}function Ze(No){var vt=No.kind==="map"&&nr.hasOwnProperty(No.id),Wt=pr(No.name)+14;if(No.stereotype&&(Wt=Math.max(Wt,pr("\xAB"+No.stereotype+"\xBB",12)+10)),vt){var Nt=nr[No.id],$a=Nt.entries?Nt.entries.length:0,sn=Dr(Nt);return{w:Math.max(Wt,sn.keyColW+sn.valColW),h:cl*($a+1)}}for(var ce=No.attributes||[],yr=Wt,Io=0,ge=0;ge<ce.length;ge++){var Ct=ce[ge];if(Ct.separator){Io+=Ct.title?Ed:Fd,Ct.title&&(yr=Math.max(yr,pr(Ct.title)+12));continue}yr=Math.max(yr,pr(Pu(Ct))+12),Io+=Es}return{w:yr,h:cl+(No.stereotype?16:0)+(ce.length===0?Dd:Io+Ju)}}for(var he={},Pr=r.packages||[],ve=0;ve<Pr.length;ve++)for(var xr=Pr[ve].objects||[],qr=0;qr<xr.length;qr++)he[xr[qr]]=Pr[ve];function ze(No){return No==="node"?{side:46,top:40,bottom:16}:No==="cloud"?{side:18,top:36,bottom:22}:No==="database"?{side:31,top:50,bottom:16}:No==="folder"||No==="frame"?{side:20,top:35,bottom:16}:{side:32,top:35,bottom:16}}function wo(No){var vt=he[No.id];if(!vt)return null;var Wt=Ze(No),Nt=(vt.stereotype||"").toLowerCase(),$a=pr(vt.name),sn=ze(Nt),ce=Math.max(Wt.w+sn.side*2,$a+td*2),yr=sn.top+Wt.h+sn.bottom;return{w:ce,h:yr,top:sn.top,stereotype:Nt,name:vt.name}}function me(No){var vt=wo(No);return vt?{w:vt.w,h:vt.h}:Ze(No)}for(var ue=Pr.length>0,po={},x=0;x<e.length;x++)po[e[x].id]=!0;for(var S={},fr={},x=0;x<e.length;x++)S[e[x].id]=[],fr[e[x].id]=0;for(var zr=0;zr<i.length;zr++){var Lr=i[zr];if(!(!po[Lr.from]||!po[Lr.to]||Lr.from===Lr.to)){var te,W;Lr.type==="generalization"?(te=Lr.to,W=Lr.from):(te=Lr.from,W=Lr.to),S[te].push(W),fr[W]++}}var Zr={},Re=[];for(var Ae in fr)fr.hasOwnProperty(Ae)&&fr[Ae]===0&&(Zr[Ae]=0,Re.push(Ae));for(var Pe=e.length*e.length+16;Re.length>0&&Pe-- >0;)for(var De=Re.shift(),Qr=S[De]||[],Po=0;Po<Qr.length;Po++){var Qe=Qr[Po],yo=Zr[De]+1;(Zr[Qe]===void 0||Zr[Qe]<yo)&&(Zr[Qe]=yo,Re.push(Qe))}for(var x=0;x<e.length;x++)Zr[e[x].id]===void 0&&(Zr[e[x].id]=0);for(var ie={},pe=[],x=0;x<e.length;x++){var Mo=Zr[e[x].id];ie[Mo]||(ie[Mo]=[],pe.push(Mo)),ie[Mo].push(e[x])}pe.sort(function(No,vt){return No-vt});for(var Zt={},Uo={},xn=0,gt=0;gt<pe.length;gt++){for(var To=ie[pe[gt]],Rt=0,Be=0,Ao=0;Ao<To.length;Ao++){var et=me(To[Ao]);Ao>0&&(Rt+=od),Rt+=et.w,et.h>Be&&(Be=et.h)}Zt[pe[gt]]=Rt,Uo[pe[gt]]=Be,Rt>xn&&(xn=Rt)}for(var jo={},Tn=0;Tn<i.length;Tn++){var dn=i[Tn];if(dn.label){var An=dn.type==="generalization"?dn.to:dn.from;Zr[An]!==void 0&&(jo[Zr[An]]=!0)}}for(var Bo={},kt=0;kt<e.length;kt++){var Yn=e[kt];Yn.kind==="map"&&nr.hasOwnProperty(Yn.id)&&(Bo[Zr[Yn.id]]=!0)}for(var go=0,Ho=0;Ho<Pr.length;Ho++){var Ro=ze((Pr[Ho].stereotype||"").toLowerCase()).top;Ro>go&&(go=Ro)}for(var At=Vu+(ue?go:0),ot={},gt=0;gt<pe.length;gt++){for(var oo=pe[gt],to=ie[oo],cn=Uo[oo],Yt=Vu+(xn-Zt[oo])/2,Ao=0;Ao<to.length;Ao++){var so=to[Ao],Bn=Ze(so),tt=me(so);ot[so.id]={x:Yt+(tt.w-Bn.w)/2,y:At+(cn-Bn.h)/2,w:Bn.w,h:Bn.h},Yt+=tt.w+od}At+=cn+yc+(Bo[oo]?8:0)+(jo[oo]?18:0)}for(var an={},Ga=0;Ga<i.length;Ga++){var hn=i[Ga];if(!(hn.fromRow==null||!nr[hn.from])){for(var Da=0,jt=0;jt<i.length;jt++)jt!==Ga&&(i[jt].from===hn.to||i[jt].to===hn.to)&&Da++;Da>0||!ot[hn.to]||!ot[hn.from]||(an[hn.from]||(an[hn.from]=[]),an[hn.from].push(hn))}}for(var _n in an)if(an.hasOwnProperty(_n))for(var da=an[_n],Jt=ot[_n],Ut=nr[_n].entries||[],ga=Jt.x+Jt.w+50,mn=da.length-1;mn>=0;mn--){for(var ma=ot[da[mn].to],oa=0,On=0;On<Ut.length;On++)if(Ut[On].key===da[mn].fromRow){oa=On;break}da[mn]._rowIdx=oa,ma.x=ga,ma.y=Jt.y+cl*(oa+1)+cl/2-ma.h/2,ma.y<Vu&&(ma.y=Vu),ga+=ma.w+40}for(var Za=r.packages||[],be={},$n=0;$n<Za.length;$n++){var Wn=Za[$n],$r=Wn.objects||[];if($r.length!==0){var ee=null,Rr;for(Rr=0;Rr<e.length;Rr++)if($r.indexOf(e[Rr].id)>=0){ee=e[Rr];break}for(var tr=1/0,vr=1/0,Te=-1/0,jr=-1/0,_e=!1,Br=0;Br<$r.length;Br++){var br=ot[$r[Br]];br&&(_e=!0,br.x<tr&&(tr=br.x),br.y<vr&&(vr=br.y),br.x+br.w>Te&&(Te=br.x+br.w),br.y+br.h>jr&&(jr=br.y+br.h))}if(!(!_e||!ee)){var Or=wo(ee),xe=Or?Or.w:Te-tr+bc*2,bo=Or?Or.h:jr-vr+Td+Fc,_t=(tr+Te)/2,Wo=_t-xe/2,Fo=vr-(Or?Or.top:Td),ut=Or?Or.stereotype:"",Do=rr("opkg"),Fr="container=1;collapsible=0;";for(Br=0;Br<$r.length;Br++)ot[$r[Br]]&&(be[$r[Br]]={id:Do,x:Wo,y:Fo});var Gt="text;html=1;fillColor=none;strokeColor=none;fontColor=#000000;fontSize=14;align=left;verticalAlign=middle;spacingLeft=3;",st="text;html=1;fillColor=none;strokeColor=none;fontColor=#000000;fontSize=14;align=center;verticalAlign=middle;";if(ut==="folder"){var Mn=Math.round(Math.min(xe-8,pr(Wn.name)+20));h+=q(Do,Wn.name,"shape=folder;tabWidth="+Mn+";tabHeight=22;tabPosition=left;html=1;fillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=top;spacingLeft=3;spacingTop=1;"+Fr,Wo,Fo,xe,bo,"1");continue}if(ut==="frame"){h+=q(Do,Wn.name,"shape=umlFrame;width="+xe+";height=20;html=1;fillColor=none;swimlaneFillColor=none;strokeColor=#000000;fontColor=#000000;fontSize=14;align=left;verticalAlign=middle;spacingLeft=3;"+Fr,Wo,Fo,xe,bo,"1");continue}var jn,Hn,Xo,Xn,Ta;ut==="node"?(jn="shape=cube;size=10;fillColor=none;strokeColor=#000000;",Hn=0,Xo=xe-10,Xn=15,Ta=st):ut==="cloud"?(jn="shape=mxgraph.basic.cloud_rect;fillColor=none;strokeColor=#000000;",Hn=0,Xo=xe,Xn=12,Ta=st):ut==="database"?(jn="shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;fillColor=none;strokeColor=#000000;",Hn=0,Xo=xe,Xn=24,Ta=st):(jn="rounded=0;fillColor=none;strokeColor=#000000;",Hn=4,Xo=xe-8,Xn=4,Ta=Gt),h+=q(Do,"",jn+Fr,Wo,Fo,xe,bo,"1"),h+=q(rr("opkgl"),Wn.name,Ta,Hn,Xn,Xo,20,Do)}}}for(var Kn=0;Kn<e.length;Kn++){var Qo=e[Kn],pa=ot[Qo.id],Mt=pa.x,la=pa.y,vn=pa.w,Jn=pa.h,qn=Qo.kind==="map"&&nr.hasOwnProperty(Qo.id),ia=qn?nr[Qo.id]:null,zn=qn&&ia.entries?ia.entries:[],Ko=!qn&&Qo.attributes?Qo.attributes:[],Bt=rr("obj"),ta=Y(Qo.color)||"#F1F1F1",ln=cl+(!qn&&Qo.stereotype?16:0),mo="swimlane;collapsible=0;startSize="+ln+";rounded=0;whiteSpace=wrap;fontStyle=0;fontSize=14;align=center;fillColor="+ta+";swimlaneFillColor="+ta+";strokeColor=#181818;",Vt=Qo.stereotype?"\xAB"+Qo.stereotype+`\xBB
+`+Qo.name:Qo.name,nt=Qo.stereotype?[Qo.stereotype]:[],kr=qn?"map":"object",Ir=U(j,["root","element","objectDiagram",kr],nt,"vertex"),Tr=U(j,["root","element","objectDiagram",kr,"header"],nt,"vertex");Qo.color?(delete Ir.fillColor,delete Ir.gradientColor,delete Tr.fillColor,delete Tr.gradientColor):Ir.fillColor!=null&&(Ir.swimlaneFillColor=Ir.fillColor);for(var Gr in Tr)Tr.hasOwnProperty(Gr)&&!/^(strokeColor|strokeWidth|dashed|dashPattern|fixDash|rounded|arcSize|absoluteArcSize|shadow)$/.test(Gr)&&(Ir[Gr]=Tr[Gr]);p=j==null?null:{name:kr,stereotypes:nt};var Vr=be[Qo.id]||{id:"1",x:0,y:0};if(h+=q(Bt,Vt,H(mo,Ir),Mt-Vr.x,la-Vr.y,vn,Jn,Vr.id),qn){for(var Ge=Dr(ia),Jr=Ge.keyColW,co=vn-Jr,Ie=0;Ie<zn.length;Ie++){var Ee=zn[Ie],qo=cl+Ie*cl;h+=q(rr("mk"),Ee.key,"text;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=14;fillColor=none;strokeColor=none;",0,qo,Jr,cl,Bt),h+=q(rr("mv"),Ee.value,"text;align=left;spacingLeft=5;verticalAlign=middle;whiteSpace=wrap;fontSize=14;fillColor=none;strokeColor=none;",Jr,qo,co,cl,Bt)}h+=G(rr("mgl"),"","endArrow=none;strokeColor=#181818;strokeWidth=1;",Mt+Jr,la+cl,Mt+Jr,la+Jn,"1");for(var Ot=1;Ot<zn.length;Ot++){var no=la+cl+Ot*cl;h+=G(rr("mgl"),"","endArrow=none;strokeColor=#181818;strokeWidth=1;",Mt,no,Mt+vn,no,"1")}}else{for(var Fn="",Cn=!1,yt=!0,wt=!1,rt=0;rt<Ko.length;rt++){var le=Ko[rt];if(wt=!0,le.separator){Cn=!0,Fn+=Oc(le),yt=!0;continue}yt||(Fn+="<br>"),Fn+=t(Pu(le)),yt=!1}if(wt){var Fe="text;align=left;verticalAlign=top;spacingLeft=6;spacingTop=2;whiteSpace=wrap;fontSize=14;fillColor=none;strokeColor=none;";h+=Cn?z(rr("oattr"),Fn,Fe+"html=1;",0,cl,vn,Jn-cl,Bt):q(rr("oattr"),Sd(Ko),Fe,0,cl,vn,Jn-cl,Bt)}}wr[Qo.id]={x:Mt,y:la,w:vn,h:Jn,cellId:Bt}}for(var $e=0;$e<i.length;$e++){var Se=i[$e],ro=wr[Se.from],It=wr[Se.to];if(!(!ro||!It)){var Jo;if(Se.type==="generalization"?Jo="endArrow=block;endFill=0;":Se.type==="composition"?Jo="startArrow=diamond;startFill=1;endArrow=none;":Se.type==="aggregation"?Jo="startArrow=diamond;startFill=0;endArrow=none;":Se.type==="link"?Jo="endArrow=none;":Jo="endArrow=classicThin;endFill=1;endSize=8;",Se._rowIdx!=null&&ro.h>0){var xo=(cl*(Se._rowIdx+1)+cl/2)/ro.h;Jo+="exitX=1;exitY="+Math.round(xo*1e3)/1e3+";exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;"}Jo+="strokeColor=#181818;fontColor=#000000;fontSize=12;html=1;rounded=0;",Se.lineStyle==="dotted"?Jo+="dashed=1;dashPattern=2 2;":Se.lineStyle==="dashed"&&(Jo+="dashed=1;dashPattern=5 5;"),Jo=J(or(Jo,"classDiagram",["arrow"],null,"edge",Se.color?["strokeColor"]:null),j);var Et;if(Se.label){var Vn=Math.round(pr(Se.label)/2)+1;Et=` <mxGeometry relative="1" as="geometry">
+ <mxPoint x="`+Vn+`" y="0" as="offset"/>
</mxGeometry>
-`}else Co=` <mxGeometry relative="1" as="geometry"/>
-`;var pn=P(Ne.label||"",Vo);C+=' <mxCell id="'+d(V("l"))+'" value="'+pn.value+'" style="'+d(pn.style)+'" edge="1" parent="1" source="'+d(Qe.cellId)+'" target="'+d(tn.cellId)+`">
-`+Co+` </mxCell>
-`}}var hn=r.notes||[];function Dt(Po){for(var Ct=Po?String(Po).split(`
-`):[""],bt=0,Vr=0;Vr<Ct.length;Vr++)Ct[Vr].length>bt&&(bt=Ct[Vr].length);return{w:Math.max(50,Math.ceil(bt*6)+21),h:Math.max(24,Math.round(Ct.length*17.7+10))}}function ca(Po){if(yr[Po])return Po;for(var Ct=0;Ct<e.length;Ct++)if(e[Ct].name===Po&&yr[e[Ct].id])return e[Ct].id;return null}for(var ea=0;ea<hn.length;ea++){var me=hn[ea],ie=ca(me.target),pe=ie?yr[ie]:null,ke=Dt(me.text),Re=10,$o=10;pe&&(me.position==="left"?(Re=pe.x-ke.w-18,$o=pe.y+(pe.h-ke.h)/2):me.position==="top"?(Re=pe.x+(pe.w-ke.w)/2,$o=pe.y-ke.h-18):me.position==="bottom"?(Re=pe.x+(pe.w-ke.w)/2,$o=pe.y+pe.h+18):(Re=pe.x+pe.w+18,$o=pe.y+(pe.h-ke.h)/2));for(var Jo=[],Wt=0;Wt<ea;Wt++)hn[Wt]._placed&&Jo.push(hn[Wt]._placed);for(var at=function(Po,Ct){var bt=Jo.slice();for(var Vr in yr)yr.hasOwnProperty(Vr)&&Vr!==ie&&bt.push(yr[Vr]);for(var to=0;to<bt.length;to++){var Xt=bt[to];if(Po<Xt.x+Xt.w&&Po+ke.w>Xt.x&&Ct<Xt.y+Xt.h&&Ct+ke.h>Xt.y)return Xt}return null},Nn=0;Nn<8;Nn++){var ia=at(Re,$o);if(!ia)break;me.position==="left"?Re=ia.x-ke.w-12:me.position==="top"?$o=ia.y-ke.h-12:me.position==="bottom"?$o=ia.y+ia.h+12:Re=ia.x+ia.w+12}me._placed={x:Re,y:$o,w:ke.w,h:ke.h};var sa=V("note");if(v=null,C+=X(sa,me.text||"",er("shape=note;size=14;fillColor=#FEFFDD;strokeColor=#181818;fontSize=12;whiteSpace=wrap;align=left;spacingLeft=4;","classDiagram",["note"],null,"vertex",me.color?["fillColor","gradientColor"]:null),Math.round(Re),Math.round($o),ke.w,ke.h,"1"),pe){var ka;me.position==="left"?ka="exitX=1;exitY=0.5;entryX=0;entryY=0.5;":me.position==="top"?ka="exitX=0.5;exitY=1;entryX=0.5;entryY=0;":me.position==="bottom"?ka="exitX=0.5;exitY=0;entryX=0.5;entryY=1;":ka="exitX=0;exitY=0.5;entryX=1;entryY=0.5;",C+=vr(V("noteln"),"","endArrow=none;dashed=1;html=1;strokeColor=#181818;"+ka+"exitDx=0;exitDy=0;entryDx=0;entryDy=0;",sa,pe.cellId,"1")}}return C}var Ui=40,ws=60,Pu=140,Hf=50,Rf=26,qs=40,$i=30,Yu=20,lt=140,na=30,Rn=35,ja=78,Qn=35;function Ri(r){for(var a=String(r??""),e=0,h=0,l=0;l<a.length;l++){var C=a.charAt(l);C===`
-`?(e>h&&(h=e),e=0):`iljI!.,:;'"|`.indexOf(C)>=0?e+=4.48:"tfrs ".indexOf(C)>=0?e+=5.44:"mw".indexOf(C)>=0?e+=12.57:"MW".indexOf(C)>=0?e+=14.98:C>="A"&&C<="Z"?e+=9.49:C>="a"&&C<="z"?e+=8.14:e+=7.64}return e>h&&(h=e),h}function Ps(r){return r?String(r).split(`
-`).length:1}function Es(r){for(var a=String(r??"").split(/\\n|\r?\n/),e=[],h=[],l=0,C=0;C<a.length;C++)/^\s*(--|\.\.|==|__)\s*$/.test(a[C])?(h.push(e.length),e.push("")):(e.push(a[C]),l=Math.max(l,Ri(a[C])));return{lines:e,seps:h,textW:l}}var Zs=16.4,js=8.4;function lu(r){var a=Es(r),e=Math.max(a.textW,8),h=a.lines.length-a.seps.length,l=Math.max(1,h)*Zs+a.seps.length*js,C=l/e;C<.2?C=.2:C>.8&&(C=.8);var b=Math.sqrt(e/2*(e/2)+l/(2*C)*(l/(2*C))),Z=C*b;return{w:Math.round(2*b+6),h:Math.round(2*Z+6),textH:l,parts:a}}function Af(r){return r?lu(r).w:Pu}function Mu(r){return lu(r).h}function Kf(r){return String(r??"").replace(/\\r\\n|\\n|\\r/g,`
+`}else Et=` <mxGeometry relative="1" as="geometry"/>
+`;var Un=P(Se.label||"",Jo);h+=' <mxCell id="'+g(rr("l"))+'" value="'+Un.value+'" style="'+g(Un.style)+'" edge="1" parent="1" source="'+g(ro.cellId)+'" target="'+g(It.cellId)+`">
+`+Et+` </mxCell>
+`}}var bt=r.notes||[];function mt(No){for(var vt=No?String(No).split(`
+`):[""],Wt=0,Nt=0;Nt<vt.length;Nt++)vt[Nt].length>Wt&&(Wt=vt[Nt].length);return{w:Math.max(50,Math.ceil(Wt*6)+21),h:Math.max(24,Math.round(vt.length*17.7+10))}}function In(No){if(wr[No])return No;for(var vt=0;vt<e.length;vt++)if(e[vt].name===No&&wr[e[vt].id])return e[vt].id;return null}for(var Zn=0;Zn<bt.length;Zn++){var Oe=bt[Zn],uo=In(Oe.target),io=uo?wr[uo]:null,we=mt(Oe.text),de=10,$o=10;io&&(Oe.position==="left"?(de=io.x-we.w-18,$o=io.y+(io.h-we.h)/2):Oe.position==="top"?(de=io.x+(io.w-we.w)/2,$o=io.y-we.h-18):Oe.position==="bottom"?(de=io.x+(io.w-we.w)/2,$o=io.y+io.h+18):(de=io.x+io.w+18,$o=io.y+(io.h-we.h)/2));for(var ft=[],Vo=0;Vo<Zn;Vo++)bt[Vo]._placed&&ft.push(bt[Vo]._placed);for(var zo=function(No,vt){var Wt=ft.slice();for(var Nt in wr)wr.hasOwnProperty(Nt)&&Nt!==uo&&Wt.push(wr[Nt]);for(var $a=0;$a<Wt.length;$a++){var sn=Wt[$a];if(No<sn.x+sn.w&&No+we.w>sn.x&&vt<sn.y+sn.h&&vt+we.h>sn.y)return sn}return null},ka=0;ka<8;ka++){var sa=zo(de,$o);if(!sa)break;Oe.position==="left"?de=sa.x-we.w-12:Oe.position==="top"?$o=sa.y-we.h-12:Oe.position==="bottom"?$o=sa.y+sa.h+12:de=sa.x+sa.w+12}Oe._placed={x:de,y:$o,w:we.w,h:we.h};var _a=rr("note");if(p=null,h+=q(_a,Oe.text||"",or("shape=note;size=14;fillColor=#FEFFDD;strokeColor=#181818;fontSize=12;whiteSpace=wrap;align=left;spacingLeft=4;","classDiagram",["note"],null,"vertex",Oe.color?["fillColor","gradientColor"]:null),Math.round(de),Math.round($o),we.w,we.h,"1"),io){var Ba;Oe.position==="left"?Ba="exitX=1;exitY=0.5;entryX=0;entryY=0.5;":Oe.position==="top"?Ba="exitX=0.5;exitY=1;entryX=0.5;entryY=0;":Oe.position==="bottom"?Ba="exitX=0.5;exitY=0;entryX=0.5;entryY=1;":Ba="exitX=0;exitY=0.5;entryX=1;entryY=0.5;",h+=mr(rr("noteln"),"","endArrow=none;dashed=1;html=1;strokeColor=#181818;"+Ba+"exitDx=0;exitDy=0;entryDx=0;entryDy=0;",_a,io.cellId,"1")}}return h}var tu=40,yu=60,Df=140,Bd=50,nd=26,Yu=40,es=30,ct=20,va=140,aa=30,Wa=35,tl=78,Ul=35;function bu(r){for(var l=String(r??""),e=0,c=0,i=0;i<l.length;i++){var h=l.charAt(i);h===`
+`?(e>c&&(c=e),e=0):`iljI!.,:;'"|`.indexOf(h)>=0?e+=4.48:"tfrs ".indexOf(h)>=0?e+=5.44:"mw".indexOf(h)>=0?e+=12.57:"MW".indexOf(h)>=0?e+=14.98:h>="A"&&h<="Z"?e+=9.49:h>="a"&&h<="z"?e+=8.14:e+=7.64}return e>c&&(c=e),c}function Ns(r){return r?String(r).split(`
+`).length:1}function Qu(r){for(var l=String(r??"").split(/\\n|\r?\n/),e=[],c=[],i=0,h=0;h<l.length;h++)/^\s*(--|\.\.|==|__)\s*$/.test(l[h])?(c.push(e.length),e.push("")):(e.push(l[h]),i=Math.max(i,bu(l[h])));return{lines:e,seps:c,textW:i}}var rf=16.4,ef=8.4;function Tf(r){var l=Qu(r),e=Math.max(l.textW,8),c=l.lines.length-l.seps.length,i=Math.max(1,c)*rf+l.seps.length*ef,h=i/e;h<.2?h=.2:h>.8&&(h=.8);var F=Math.sqrt(e/2*(e/2)+i/(2*h)*(i/(2*h))),j=h*F;return{w:Math.round(2*F+6),h:Math.round(2*j+6),textH:i,parts:l}}function Bf(r){return r?Tf(r).w:Df}function Id(r){return Tf(r).h}function sh(r){return String(r??"").replace(/\\r\\n|\\n|\\r/g,`
`).replace(/<br\s*\/?>/gi,`
`).replace(/&#10;/g,`
`).split(`
-`)}function zf(r){for(var a=Kf(r),e=0,h=0;h<a.length;h++){var l=Ri(a[h]);l>e&&(e=l)}return Math.max(50,Math.round(e*13/14+21))}function Dc(r){var a=Kf(r).length;return Math.round(a*15.3+10)}function wd(r,a,e){var h={fill:a,stroke:e};if(!r)return h;var l=String(r).replace(/^#/,"").split(";");l[0]&&(h.fill=Y("#"+l[0])||a);for(var C=1;C<l.length;C++){var b=l[C].match(/^line\s*:\s*(\S+)/i);if(b){var Z=Y(b[1]);Z&&(h.stroke=Z)}}return h}function Uh(r,a){var e=r.actors,h=r.usecases,l=r.containers,C=r.relationships,b=r.notes,Z=0;if(r.containers)for(var v=0;v<r.containers.length;v++)r.containers[v].parent==null&&Z++;var er=!1;if(r.actors&&r.containers)for(var X=0;X<r.actors.length;X++){for(var V=!1,tr=0;tr<r.containers.length;tr++)if(r.containers[tr].children&&r.containers[tr].children.indexOf(r.actors[X].id)>=0){V=!0;break}if(!V){er=!0;break}}var wr;r.direction==="LR"?wr="LR":r.direction==="TB"?wr="TB":wr=Z>=2&&!er?"LR":"TB";var yr="",fr=0;function Ar(pa){return pa+"_"+fr++}var jr=r.styleSheet||null,ce=null,Nr=["fillColor","gradientColor"];function de(pa,kn,Na,ol,il){return W(pa,jr,["root","element","componentDiagram"].concat(kn),Na||[],ol||"vertex",il)}function Fr(pa,kn,Na){ce=jr==null?null:{name:pa,stereotypes:kn?[kn]:[],skip:Na?Nr:null}}function Ir(pa,kn){if(ce==null)return pa;var Na=kn?"edge":pa.indexOf("text;")===0?"text":"vertex";return de(pa,[ce.name],ce.stereotypes,Na,ce.skip)}var qe=function(pa,kn,Na,ol,il,tl,ba,dl){return $(pa,kn,Ir(Na,!1),ol,il,tl,ba,dl)},To=function(pa,kn,Na,ol,il,tl,ba,dl){return hr(pa,kn,Ir(Na,!1),ol,il,tl,ba,dl)},ne=function(pa,kn,Na,ol,il,tl,ba,dl){return B(pa,kn,Ir(Na,!0),ol,il,tl,ba,dl)};function po(pa,kn,Na,ol,il){var tl=Ar("actor"),ba=wd(il,"#F1F1F1","#181818"),dl=qe(tl,"","shape=umlActor;html=1;fillColor="+ba.fill+";strokeColor="+ba.stroke+";fontColor=#000000;fontSize=14;",kn,Na,Ui,ws,ol);if(pa){var Ml=Ps(pa),Bl=Math.max(Ui,Math.round(Ri(pa)+8)),Ei=Ar("actorlbl");dl+=qe(Ei,pa,"text;html=1;align=center;verticalAlign=top;fontColor=#000000;fontSize=14;",kn+(Ui-Bl)/2,Na+ws+2,Bl,Ml*17,ol)}return{id:tl,cells:dl}}function ao(pa,kn,Na,ol,il,tl,ba,dl){for(var Ml=lu(kn),Bl=Ml.parts,Ei=[],ta=0;ta<Bl.lines.length;ta++)Ei.push(Bl.seps.indexOf(ta)>=0?'<font style="font-size:6px;">&#160;</font>':n(Bl.lines[ta]));for(var ii=To(pa,Ei.join("<br>"),"ellipse;html=1;fillColor="+Na.fill+";strokeColor="+Na.stroke+";whiteSpace=wrap;fontColor=#000000;fontSize=14;",ol,il,tl,ba,dl),Yi=(ba-Ml.textH)/2,Tl=0,oi=0;oi<Bl.lines.length;oi++)if(Bl.seps.indexOf(oi)>=0){var xl=Yi+Tl+js/2,nl=xl-ba/2,Gl=tl/2,Zl=ba/2,Ci=Gl*Math.sqrt(Math.max(0,1-nl*nl/(Zl*Zl)));ii+=qe(Ar("ucsep"),"","line;strokeWidth=1;strokeColor="+Na.stroke+";fillColor=none;",Math.round(ol+tl/2-Ci),Math.round(il+xl-1),Math.round(2*Ci),2,dl),Tl+=js}else Tl+=Zs;return ii}for(var A={},J={},ur=0;ur<l.length;ur++)for(var Sr=0;Sr<l[ur].children.length;Sr++)J[l[ur].children[Sr]]=!0;var Er=[],qr={},z,Mr;for(z=0;z<e.length;z++)Mr=e[z],J[Mr.id]||(Er.push({id:Mr.id,kind:"actor",data:Mr,w:Ui,h:ws}),qr[Mr.id]=!0);for(z=0;z<h.length;z++)if(Mr=h[z],!J[Mr.id]){var Be=Mr.stereotype?"\xAB"+Mr.stereotype+`\xBB
-`+Mr.name:Mr.name;Er.push({id:Mr.id,kind:"usecase",data:Mr,w:Af(Be),h:Mu(Be)}),qr[Mr.id]=!0}var ye={},Le={};for(z=0;z<Er.length;z++)ye[Er[z].id]=[],Le[Er[z].id]=0;for(z=0;z<C.length;z++){var _e=C[z];qr[_e.from]&&qr[_e.to]&&(ye[_e.from].push({to:_e.to,span:_e.span!=null?_e.span:1}),Le[_e.to]++)}var Ur={},yo=[],fo;for(fo in Le)Le.hasOwnProperty(fo)&&Le[fo]===0&&(Ur[fo]=0,yo.push(fo));for(var he=Er.length*Er.length+16;yo.length>0&&he-- >0;){var Te=yo.shift(),ae=ye[Te]||[];for(z=0;z<ae.length;z++){var it=ae[z].to,Gt=Ur[Te]+ae[z].span;(Ur[it]===void 0||Ur[it]<Gt)&&(Ur[it]=Gt,yo.push(it))}}for(z=0;z<Er.length;z++)Ur[Er[z].id]===void 0&&(Ur[Er[z].id]=0);var oo={},pt=[];for(z=0;z<Er.length;z++){var rt=Ur[Er[z].id];oo[rt]||(oo[rt]=[],pt.push(rt)),oo[rt].push(Er[z])}pt.sort(function(pa,kn){return pa-kn});for(var jo=$i,Qt=$i,Me,Io,Wo,Ro,An=wr!=="LR",dn=An?"w":"h",rn=An?ja:60,Ao={},_t={},ft=0;ft<b.length;ft++){var Se=b[ft];qr[Se.target]&&(Se.position==="right"?Ao[Se.target]=zf(Se.text)+Qn:Se.position==="left"&&(_t[Se.target]=zf(Se.text)+Qn))}var Go={},wt=An?_t:{},cn=An?Ao:{};for(Me=pt.length-1;Me>=0;Me--){Wo=oo[pt[Me]];var No=0;for(Io=0;Io<Wo.length;Io++){Ro=Wo[Io];for(var oe=Ro[dn]/2,Uo=wt[Ro.id]||0,Ot=cn[Ro.id]||0,ho=ye[Ro.id]||[],dt=0,Aa=0,Sn=0;Sn<ho.length;Sn++)Go[ho[Sn].to]!==void 0&&(dt+=Go[ho[Sn].to],Aa++);var an=No+Uo+oe,we=Aa?dt/Aa:an,Eo=we>an?we:an;Go[Ro.id]=Eo,No=Eo+oe+Ot+Rn}}var Et=1/0;for(z=0;z<Er.length;z++){Ro=Er[z];var Cr=Go[Ro.id]-Ro[dn]/2-(wt[Ro.id]||0);Cr<Et&&(Et=Cr)}var Lr=$i-Et,He=$i;for(Me=0;Me<pt.length;Me++){Wo=oo[pt[Me]];var Ie=0;for(Io=0;Io<Wo.length;Io++){var Oe=An?Wo[Io].h:Wo[Io].w;Oe>Ie&&(Ie=Oe)}for(Io=0;Io<Wo.length;Io++){Ro=Wo[Io];var so=Go[Ro.id]+Lr;An?(Ro.x=so-Ro.w/2,Ro.y=He+(Ie-Ro.h)/2):(Ro.y=so-Ro.h/2,Ro.x=He+(Ie-Ro.w)/2);var Xo=Ro.x+Ro.w+(An&&Ao[Ro.id]||0);Xo>jo&&(jo=Xo),Ro.y+Ro.h>Qt&&(Qt=Ro.y+Ro.h)}He+=Ie+rn}var qo={};for(z=0;z<Er.length;z++)qo[Er[z].id]=!0;var Yn={};for(z=0;z<Er.length;z++){var Nt=Er[z];if(!(Nt.kind!=="actor"||l.length===0)){for(var Da=0,je=!0,_r=0;_r<C.length;_r++){var Ho=C[_r].from===Nt.id?C[_r].to:C[_r].to===Nt.id?C[_r].from:null;Ho!=null&&(Da++,qo[Ho]&&(je=!1))}Da>0&&je&&(Yn[Nt.id]=!0)}}for(z=0;z<Er.length;z++){var Ce=Er[z];if(!Yn[Ce.id]){var ln,nt=Ce.data.name,wo=Ce.x+z*.1;if(Ce.data.stereotype&&(nt="\xAB"+Ce.data.stereotype+`\xBB
-`+nt),Ce.kind==="actor"){Fr("actor",Ce.data&&Ce.data.stereotype,Ce.data&&Ce.data.color);var xn=po(nt,wo,Ce.y,"1",Ce.data&&Ce.data.color);ln=xn.id,yr+=xn.cells}else{Fr("usecase",Ce.data&&Ce.data.stereotype,Ce.data&&Ce.data.color),ln=Ar("uc");var Lt=wd(Ce.data&&Ce.data.color,"#F1F1F1","#181818");yr+=ao(ln,nt,Lt,wo,Ce.y,Ce.w,Ce.h,"1")}A[Ce.id]={x:wo,y:Ce.y,w:Ce.w,h:Ce.h,cellId:ln,kind:Ce.kind,lblH:2+17*Ps(nt)}}}for(var Ft,fe,ge=!1,qt=0;qt<Er.length;qt++)Yn[Er[qt].id]&&(ge=!0);var et=80;wr==="LR"?(Ft=Math.max($i,jo),ge&&(Ft=Math.max(Ft,$i+Ui+12+et)),fe=$i):(Ft=$i,fe=Math.max($i,Qt+qs));for(var en=19,Zt={},qn={},Ko={},Hn=[],aa=[],Je=[],sn=0,Bn=0,$t=0,mo=0;mo<l.length;mo++){for(var Pt=0;Pt<l[mo].children.length;Pt++)Zt[l[mo].children[Pt]]=mo;Hn.push(0),aa.push(0)}for(var ra=0;ra<b.length;ra++){var Ut=b[ra];if(!(Ut.position==="floating"||Zt[Ut.target]===void 0)){var Wn=Zt[Ut.target],yt=zf(Ut.text),Zn=Dc(Ut.text);if(Ut.container===Wn)Ut.position==="left"?qn[Ut.target]=(qn[Ut.target]||0)+yt+Qn:Ut.position==="top"?Hn[Wn]=Math.max(Hn[Wn],Zn+Qn):Ut.position==="bottom"?aa[Wn]=Math.max(aa[Wn],Zn+Qn):Ko[Ut.target]=(Ko[Ut.target]||0)+yt+Qn;else{Ut._outside=Wn;var on=l[Wn].children,va=on.indexOf(Ut.target);Ut.position==="left"?(sn=Math.max(sn,yt+en),Ut._arc=va>0):Ut.position==="top"?Bn=Math.max(Bn,Zn+Qn):Ut.position!=="bottom"&&(Ut._arc=va>=0&&va<on.length-1),Ut._arc&&($t=qs)}}}Ft+=sn,fe+=Bn+$t;for(var ga=Ft,jn=0;jn<l.length;jn++){let pa=function(kn,Na,ol){Fr("usecase",kn.stereotype,kn.color);var il=Ar("uc"),tl=wd(kn.color,"#F1F1F1","#181818"),ba=kn.name;kn.stereotype&&(ba="\xAB"+kn.stereotype+`\xBB
-`+ba),yr+=ao(il,ba,tl,Na,ol+Jo,kn._w,kn._h,Mn),A[kn.id]={x:Ft+Na,y:fe+ol,w:kn._w,h:kn._h,cellId:il}};for(var Fn=l[jn],Mn=Ar("rect"),la=Fn.children,Tn=[],gt=[],Rt=0;Rt<la.length;Rt++){for(var Jt=la[Rt],ct=!1,wn=0;wn<h.length&&!ct;wn++)h[wn].id===Jt&&(Tn.push(h[wn]),ct=!0);for(var In=0;In<e.length&&!ct;In++)e[In].id===Jt&&(gt.push(e[In]),ct=!0)}var ko=r.direction==="LR",Do,Rr,xr=0;for(Do=0;Do<Tn.length;Do++){var br=Tn[Do],Br=br.stereotype?"\xAB"+br.stereotype+`\xBB
-`+br.name:br.name;br._w=Af(Br),br._h=Mu(Br),xr+=br._w+(qn[br.id]||0)+(Ko[br.id]||0),Do>0&&(xr+=Rn)}var Pr=[];if(ko&&Tn.length>0){var Xe={},zr={};for(Do=0;Do<Tn.length;Do++)Xe[Tn[Do].id]=0,zr[Tn[Do].id]=!0;for(var Ke=0;Ke<Tn.length+2;Ke++)for(var De=0;De<C.length;De++){var ze=C[De];if(!(!zr[ze.from]||!zr[ze.to])){var So=ze.span!=null?ze.span:1,ot=Xe[ze.from]+So;Xe[ze.to]<ot&&(Xe[ze.to]=ot)}}for(Do=0;Do<Tn.length;Do++){for(var ve=Xe[Tn[Do].id];Pr.length<=ve;)Pr.push([]);Pr[ve].push(Tn[Do])}for(var Yt={},At=0;At<e.length;At++)Yt[e[At].id]=At;for(var ht=0;ht<Pr.length;ht++){for(var Vt=[],Pn=0;Pn<Pr[ht].length;Pn++){for(var Ae=0,Fe=0,le=0;le<C.length;le++)C[le].to===Pr[ht][Pn].id&&Yt[C[le].from]!==void 0&&(Ae+=Yt[C[le].from],Fe++);Vt.push({m:Pr[ht][Pn],i:Pn,k:Fe?Ae/Fe:Pn})}Vt.sort(function(kn,Na){return kn.k-Na.k||kn.i-Na.i}),Pr[ht]=[];for(var Ne=0;Ne<Vt.length;Ne++)Pr[ht].push(Vt[Ne].m)}}var Qe=gt.length*Ui;gt.length>1&&(Qe+=(gt.length-1)*Rn);for(var tn=gt.length>0,Vo=Tn.length>0,xo=[],Co=[],mn=0,pn=0,hn=0;hn<Pr.length;hn++){for(var Dt=0,ca=0,ea=0;ea<Pr[hn].length;ea++)Pr[hn][ea]._w>Dt&&(Dt=Pr[hn][ea]._w),ea>0&&(ca+=qs),ca+=Pr[hn][ea]._h;xo.push(Dt),Co.push(ca),hn>0&&(mn+=Rn),mn+=Dt,ca>pn&&(pn=ca)}var me=Math.max(ko?mn:xr,Qe,Pu),ie=me+Yu*2,pe=26,ke=pe+Yu,Re=(tn?ke+ws+18+53:ke)+Hn[jn],$o;Vo?$o=(ko?Re+pn:Re+34)+aa[jn]+Yu:$o=ke+ws+18+Yu,Je[jn]={x:Ft,y:fe,w:ie,h:$o},Fr(Fn.kind==="package"?"package":Fn.kind||"rectangle",Fn.stereotype,Fn.color);var Jo=Fn.kind==="package"?22:0;if(Fn.kind==="package"){var Wt=Math.round(Math.min(ie,Ri(Fn.name)*1.15+24));Wt<30&&(Wt=30),yr+=qe(Mn,Fn.name,"shape=folder;tabWidth="+Wt+";tabHeight=22;tabPosition=left;html=1;fillColor=none;strokeColor=#181818;fontColor=#000000;fontSize=13;fontStyle=1;align=left;verticalAlign=top;spacingLeft=6;spacingTop=1;container=1;collapsible=0;",Ft,fe-Jo,ie,$o+Jo,"1")}else yr+=qe(Mn,Fn.name,"swimlane;collapsible=0;startSize=26;fillColor=none;strokeColor=#181818;fontColor=#000000;fontSize=13;fontStyle=1;whiteSpace=wrap;",Ft,fe,ie,$o,"1");var at=(ie-Qe)/2;for(Rr=0;Rr<gt.length;Rr++){var Nn=gt[Rr],ia=Nn.name;Nn.stereotype&&(ia="\xAB"+Nn.stereotype+`\xBB
-`+ia),Fr("actor",Nn.stereotype,Nn.color);var sa=po(ia,at,ke+Jo,Mn,Nn.color);yr+=sa.cells,A[Nn.id]={x:Ft+at,y:fe+ke,w:Ui,h:ws,cellId:sa.id,kind:"actor",lblH:2+17*Ps(ia)},at+=Ui+Rn}if(ko)for(var ka=(ie-mn)/2,Po=0;Po<Pr.length;Po++){for(var Ct=Re+(pn-Co[Po])/2,bt=0;bt<Pr[Po].length;bt++){var Vr=Pr[Po][bt];pa(Vr,ka+(xo[Po]-Vr._w)/2,Ct),Ct+=Vr._h+qs}ka+=xo[Po]+Rn}else{var to=(ie-xr)/2;for(Do=0;Do<Tn.length;Do++)to+=qn[Tn[Do].id]||0,pa(Tn[Do],to,Re),to+=Tn[Do]._w+(Ko[Tn[Do].id]||0)+Rn}Ft+=ie+Rf}var Xt=[];for(z=0;z<Er.length;z++){var ha=Er[z];if(Yn[ha.id]){for(var Wr=0,ro=0,te=0,ue=0;ue<C.length;ue++){var zo=C[ue].from===ha.id?C[ue].to:C[ue].to===ha.id?C[ue].from:null;zo==null||!A[zo]||(Wr+=A[zo].x+A[zo].w/2,ro+=A[zo].y+A[zo].h/2,te++)}var nn=2+17*Ps(ha.data.name),Fa,Kn;wr==="LR"?(Fa=ga-et-ha.w,Kn=te>0?Math.round(ro/te-(ha.h+nn)/2):ha.y,Kn<$i&&(Kn=$i)):(Fa=te>0?Wr/te-ha.w/2:ha.x,Kn=ha.y),Xt.push({fe:ha,x:Fa,y:Kn,lblH:nn})}}if(wr==="LR")for(Xt.sort(function(pa,kn){return pa.y-kn.y}),z=1;z<Xt.length;z++){var bn=Xt[z-1].y+Xt[z-1].fe.h+Xt[z-1].lblH+12;Xt[z].y<bn&&(Xt[z].y=bn)}for(z=0;z<Xt.length;z++){var Ve=Xt[z];Fr("actor",Ve.fe.data&&Ve.fe.data.stereotype,Ve.fe.data&&Ve.fe.data.color);var Yo=Ve.fe.data.name;Ve.fe.data&&Ve.fe.data.stereotype&&(Yo="\xAB"+Ve.fe.data.stereotype+`\xBB
-`+Yo);var st=po(Yo,Ve.x,Ve.y,"1",Ve.fe.data&&Ve.fe.data.color);yr+=st.cells,A[Ve.fe.id]={x:Ve.x,y:Ve.y,w:Ve.fe.w,h:Ve.fe.h,cellId:st.id,kind:"actor",lblH:Ve.lblH}}for(var Ca=0;Ca<C.length;Ca++){var Mt=C[Ca],Ra=A[Mt.from],Xn=A[Mt.to];if(!(!Ra||!Xn)){var _a;Mt.type==="generalization"?_a="endArrow=block;endFill=0;":Mt.type==="dependency"?_a=Mt.directed?"endArrow=open;dashed=1;dashPattern=5 5;":"endArrow=none;dashed=1;":_a=Mt.directed?"endArrow=block;endFill=1;":"endArrow=none;",_a+="strokeColor=#181818;fontColor=#000000;fontSize=11;edgeStyle=none;rounded=0;html=1;",Ra.kind==="actor"&&Ra.lblH&&Xn.y>Ra.y+Ra.h&&(_a+="exitX=0.5;exitY="+Math.round(100*(Ra.h+Ra.lblH+3)/Ra.h)/100+";exitPerimeter=0;");var Ka="";Mt.stereotype&&(Ka="\xAB"+Mt.stereotype+"\xBB"),Mt.label&&(Ka=Ka?Ka+`
-`+Mt.label:Mt.label),_a=j(de(_a,["arrow"],null,"edge",Mt.color?["strokeColor"]:null),jr),yr+=vr(Ar("rel"),Ka,_a,Ra.cellId,Xn.cellId,"1")}}var yn=Qt+ja,ua=[];function Ya(pa,kn,Na,ol,il){var tl=ua.slice();for(var ba in A)if(!(!A.hasOwnProperty(ba)||ba===il)){var dl=A[ba];tl.push(dl.kind==="actor"&&dl.lblH?{x:dl.x,y:dl.y,w:dl.w,h:dl.h+dl.lblH}:dl)}for(var Ml=0;Ml<tl.length;Ml++){var Bl=tl[Ml];if(pa<Bl.x+Bl.w+6&&pa+Na+6>Bl.x&&kn<Bl.y+Bl.h+6&&kn+ol+6>Bl.y)return!0}return!1}for(var fa=0;fa<b.length;fa++){var xt=b[fa],Ja=xt.position==="floating"?xt.anchor:xt.target,uo=Ja?A[Ja]:null,Jn=zf(xt.text),Sa=Dc(xt.text),da=$i,ma=$i,Ha=[];if(xt.position==="floating"){for(var Sl=xt.links||(xt.anchor?[xt.anchor]:[]),Me=0;Me<Sl.length;Me++)A[Sl[Me]]&&Ha.push(A[Sl[Me]]);if(Ha.length>1){for(var $l=0,ml=0,Pl=0;Pl<Ha.length;Pl++)$l+=Ha[Pl].x+Ha[Pl].w/2,ml+=Ha[Pl].y+Ha[Pl].h/2;da=Math.round($l/Ha.length+3),ma=Math.round(ml/Ha.length-Sa/2)}else uo?(da=uo.x+(uo.w-Jn)/2,ma=uo.y+uo.h+(uo.kind==="actor"&&uo.lblH?uo.lblH:0)+Qn):(da=$i,ma=yn,yn+=Sa+qs);for(var Yl=0;Yl<12&&Ya(da,ma,Jn,Sa,null);Yl++)da+=24}else if(uo&&xt._outside!=null&&Je[xt._outside]){var ri=Je[xt._outside];if(xt.position==="left")da=ri.x-Jn-en,ma=uo.y+(uo.h-Sa)/2;else if(xt.position==="top")da=uo.x+(uo.w-Jn)/2,ma=ri.y-Sa-Qn;else if(xt.position==="bottom")da=uo.x+(uo.w-Jn)/2,ma=ri.y+ri.h+Qn;else{da=ri.x+ri.w+en,ma=uo.y+(uo.h-Sa)/2;for(var wi=0;wi<12&&Ya(da,ma,Jn,Sa,null);wi++)da+=24}}else uo&&(xt.position==="left"?(da=uo.x-Jn-Qn,da<$i&&(da=$i),ma=uo.y+(uo.h-Sa)/2):xt.position==="top"?(da=uo.x+(uo.w-Jn)/2,ma=uo.y-Sa-Qn):xt.position==="bottom"?(da=uo.x+(uo.w-Jn)/2,ma=uo.y+uo.h+Qn):(da=uo.x+uo.w+Qn,ma=uo.y+(uo.h-Sa)/2));da=Math.round(da),ma=Math.round(ma),Fr("note",null,xt.color);var mi=Ar("note");if(yr+=qe(mi,xt.text||"","shape=note;size=10;fillColor=#FEFFDD;strokeColor=#181818;fontSize=13;whiteSpace=wrap;align=left;",da,ma,Jn,Sa,"1"),ua.push({x:da,y:ma,w:Jn,h:Sa}),xt.position==="floating"&&Ha.length>1)for(var Cl=0;Cl<Ha.length;Cl++)Ha[Cl].cellId&&(yr+=vr(Ar("noteln"),"","endArrow=none;dashed=1;html=1;strokeColor=#181818;",mi,Ha[Cl].cellId,"1"));else if(xt.position==="floating"&&Ha.length===1){var ll=Ha[0],yi=ll.y+ll.h+(ll.kind==="actor"&&ll.lblH?ll.lblH:0);yr+=qe(Ar("noteptr"),"","shape=triangle;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;direction=north;",Math.round(ll.x+ll.w/2)-4,yi,8,Math.max(6,ma-yi+1),"1")}else if(uo&&xt._outside!=null&&uo.cellId&&xt.position!=="top"&&xt.position!=="bottom"){var rs=de("endArrow=none;dashed=1;html=1;strokeColor=#181818;",["arrow"],null,"edge",["strokeWidth"]),Xl=Je[xt._outside];if(xt._arc){var ql=Math.round(Xl.y-22);yr+=' <mxCell id="'+d(Ar("noteln"))+'" value="" style="'+d(rs+"curved=1;")+'" edge="1" source="'+d(uo.cellId)+'" target="'+d(mi)+`" parent="1">
+`)}function Nd(r){for(var l=sh(r),e=0,c=0;c<l.length;c++){var i=bu(l[c]);i>e&&(e=i)}return Math.max(50,Math.round(e*13/14+21))}function uh(r){var l=sh(r).length;return Math.round(l*15.3+10)}function Ec(r,l,e){var c={fill:l,stroke:e};if(!r)return c;var i=String(r).replace(/^#/,"").split(";");i[0]&&(c.fill=Y("#"+i[0])||l);for(var h=1;h<i.length;h++){var F=i[h].match(/^line\s*:\s*(\S+)/i);if(F){var j=Y(F[1]);j&&(c.stroke=j)}}return c}function $v(r,l){var e=r.actors,c=r.usecases,i=r.containers,h=r.relationships,F=r.notes,j=0;if(r.containers)for(var p=0;p<r.containers.length;p++)r.containers[p].parent==null&&j++;var or=!1;if(r.actors&&r.containers)for(var q=0;q<r.actors.length;q++){for(var rr=!1,nr=0;nr<r.containers.length;nr++)if(r.containers[nr].children&&r.containers[nr].children.indexOf(r.actors[q].id)>=0){rr=!0;break}if(!rr){or=!0;break}}var Xr;r.direction==="LR"?Xr="LR":r.direction==="TB"?Xr="TB":Xr=j>=2&&!or?"LR":"TB";var wr="",pr=0;function Dr(ca){return ca+"_"+pr++}var Ze=r.styleSheet||null,he=null,Pr=["fillColor","gradientColor"];function ve(ca,bn,ll,ml,Gl){return X(ca,Ze,["root","element","componentDiagram"].concat(bn),ll||[],ml||"vertex",Gl)}function xr(ca,bn,ll){he=Ze==null?null:{name:ca,stereotypes:bn?[bn]:[],skip:ll?Pr:null}}function qr(ca,bn){if(he==null)return ca;var ll=bn?"edge":ca.indexOf("text;")===0?"text":"vertex";return ve(ca,[he.name],he.stereotypes,ll,he.skip)}var ze=function(ca,bn,ll,ml,Gl,rl,nl,yl){return m(ca,bn,qr(ll,!1),ml,Gl,rl,nl,yl)},wo=function(ca,bn,ll,ml,Gl,rl,nl,yl){return hr(ca,bn,qr(ll,!1),ml,Gl,rl,nl,yl)},me=function(ca,bn,ll,ml,Gl,rl,nl,yl){return I(ca,bn,qr(ll,!0),ml,Gl,rl,nl,yl)};function ue(ca,bn,ll,ml,Gl){var rl=Dr("actor"),nl=Ec(Gl,"#F1F1F1","#181818"),yl=ze(rl,"","shape=umlActor;html=1;fillColor="+nl.fill+";strokeColor="+nl.stroke+";fontColor=#000000;fontSize=14;",bn,ll,tu,yu,ml);if(ca){var vi=Ns(ca),hl=Math.max(tu,Math.round(bu(ca)+8)),gs=Dr("actorlbl");yl+=ze(gs,ca,"text;html=1;align=center;verticalAlign=top;fontColor=#000000;fontSize=14;",bn+(tu-hl)/2,ll+yu+2,hl,vi*17,ml)}return{id:rl,cells:yl}}function po(ca,bn,ll,ml,Gl,rl,nl,yl){for(var vi=Tf(bn),hl=vi.parts,gs=[],ns=0;ns<hl.lines.length;ns++)gs.push(hl.seps.indexOf(ns)>=0?'<font style="font-size:6px;">&#160;</font>':t(hl.lines[ns]));for(var ds=wo(ca,gs.join("<br>"),"ellipse;html=1;fillColor="+ll.fill+";strokeColor="+ll.stroke+";whiteSpace=wrap;fontColor=#000000;fontSize=14;",ml,Gl,rl,nl,yl),Rs=(nl-vi.textH)/2,al=0,Ti=0;Ti<hl.lines.length;Ti++)if(hl.seps.indexOf(Ti)>=0){var cs=Rs+al+ef/2,hs=cs-nl/2,Tl=rl/2,ei=nl/2,Ka=Tl*Math.sqrt(Math.max(0,1-hs*hs/(ei*ei)));ds+=ze(Dr("ucsep"),"","line;strokeWidth=1;strokeColor="+ll.stroke+";fillColor=none;",Math.round(ml+rl/2-Ka),Math.round(Gl+cs-1),Math.round(2*Ka),2,yl),al+=ef}else al+=rf;return ds}for(var x={},S={},fr=0;fr<i.length;fr++)for(var zr=0;zr<i[fr].children.length;zr++)S[i[fr].children[zr]]=!0;var Lr=[],te={},W,Zr;for(W=0;W<e.length;W++)Zr=e[W],S[Zr.id]||(Lr.push({id:Zr.id,kind:"actor",data:Zr,w:tu,h:yu}),te[Zr.id]=!0);for(W=0;W<c.length;W++)if(Zr=c[W],!S[Zr.id]){var Re=Zr.stereotype?"\xAB"+Zr.stereotype+`\xBB
+`+Zr.name:Zr.name;Lr.push({id:Zr.id,kind:"usecase",data:Zr,w:Bf(Re),h:Id(Re)}),te[Zr.id]=!0}var Ae={},Pe={};for(W=0;W<Lr.length;W++)Ae[Lr[W].id]=[],Pe[Lr[W].id]=0;for(W=0;W<h.length;W++){var De=h[W];te[De.from]&&te[De.to]&&(Ae[De.from].push({to:De.to,span:De.span!=null?De.span:1}),Pe[De.to]++)}var Qr={},Po=[],Qe;for(Qe in Pe)Pe.hasOwnProperty(Qe)&&Pe[Qe]===0&&(Qr[Qe]=0,Po.push(Qe));for(var yo=Lr.length*Lr.length+16;Po.length>0&&yo-- >0;){var ie=Po.shift(),pe=Ae[ie]||[];for(W=0;W<pe.length;W++){var Mo=pe[W].to,Zt=Qr[ie]+pe[W].span;(Qr[Mo]===void 0||Qr[Mo]<Zt)&&(Qr[Mo]=Zt,Po.push(Mo))}}for(W=0;W<Lr.length;W++)Qr[Lr[W].id]===void 0&&(Qr[Lr[W].id]=0);var Uo={},xn=[];for(W=0;W<Lr.length;W++){var gt=Qr[Lr[W].id];Uo[gt]||(Uo[gt]=[],xn.push(gt)),Uo[gt].push(Lr[W])}xn.sort(function(ca,bn){return ca-bn});for(var To=es,Rt=es,Be,Ao,et,jo,Tn=Xr!=="LR",dn=Tn?"w":"h",An=Tn?tl:60,Bo={},kt={},Yn=0;Yn<F.length;Yn++){var go=F[Yn];te[go.target]&&(go.position==="right"?Bo[go.target]=Nd(go.text)+Ul:go.position==="left"&&(kt[go.target]=Nd(go.text)+Ul))}var Ho={},Ro=Tn?kt:{},At=Tn?Bo:{};for(Be=xn.length-1;Be>=0;Be--){et=Uo[xn[Be]];var ot=0;for(Ao=0;Ao<et.length;Ao++){jo=et[Ao];for(var oo=jo[dn]/2,to=Ro[jo.id]||0,cn=At[jo.id]||0,Yt=Ae[jo.id]||[],so=0,Bn=0,tt=0;tt<Yt.length;tt++)Ho[Yt[tt].to]!==void 0&&(so+=Ho[Yt[tt].to],Bn++);var an=ot+to+oo,Ga=Bn?so/Bn:an,hn=Ga>an?Ga:an;Ho[jo.id]=hn,ot=hn+oo+cn+Wa}}var Da=1/0;for(W=0;W<Lr.length;W++){jo=Lr[W];var jt=Ho[jo.id]-jo[dn]/2-(Ro[jo.id]||0);jt<Da&&(Da=jt)}var _n=es-Da,da=es;for(Be=0;Be<xn.length;Be++){et=Uo[xn[Be]];var Jt=0;for(Ao=0;Ao<et.length;Ao++){var Ut=Tn?et[Ao].h:et[Ao].w;Ut>Jt&&(Jt=Ut)}for(Ao=0;Ao<et.length;Ao++){jo=et[Ao];var ga=Ho[jo.id]+_n;Tn?(jo.x=ga-jo.w/2,jo.y=da+(Jt-jo.h)/2):(jo.y=ga-jo.h/2,jo.x=da+(Jt-jo.w)/2);var mn=jo.x+jo.w+(Tn&&Bo[jo.id]||0);mn>To&&(To=mn),jo.y+jo.h>Rt&&(Rt=jo.y+jo.h)}da+=Jt+An}var ma={};for(W=0;W<Lr.length;W++)ma[Lr[W].id]=!0;var oa={};for(W=0;W<Lr.length;W++){var On=Lr[W];if(!(On.kind!=="actor"||i.length===0)){for(var Za=0,be=!0,$n=0;$n<h.length;$n++){var Wn=h[$n].from===On.id?h[$n].to:h[$n].to===On.id?h[$n].from:null;Wn!=null&&(Za++,ma[Wn]&&(be=!1))}Za>0&&be&&(oa[On.id]=!0)}}for(W=0;W<Lr.length;W++){var $r=Lr[W];if(!oa[$r.id]){var ee,Rr=$r.data.name,tr=$r.x+W*.1;if($r.data.stereotype&&(Rr="\xAB"+$r.data.stereotype+`\xBB
+`+Rr),$r.kind==="actor"){xr("actor",$r.data&&$r.data.stereotype,$r.data&&$r.data.color);var vr=ue(Rr,tr,$r.y,"1",$r.data&&$r.data.color);ee=vr.id,wr+=vr.cells}else{xr("usecase",$r.data&&$r.data.stereotype,$r.data&&$r.data.color),ee=Dr("uc");var Te=Ec($r.data&&$r.data.color,"#F1F1F1","#181818");wr+=po(ee,Rr,Te,tr,$r.y,$r.w,$r.h,"1")}x[$r.id]={x:tr,y:$r.y,w:$r.w,h:$r.h,cellId:ee,kind:$r.kind,lblH:2+17*Ns(Rr)}}}for(var jr,_e,Br=!1,br=0;br<Lr.length;br++)oa[Lr[br].id]&&(Br=!0);var Or=80;Xr==="LR"?(jr=Math.max(es,To),Br&&(jr=Math.max(jr,es+tu+12+Or)),_e=es):(jr=es,_e=Math.max(es,Rt+Yu));for(var xe=19,bo={},_t={},Wo={},Fo=[],ut=[],Do=[],Fr=0,Gt=0,st=0,Mn=0;Mn<i.length;Mn++){for(var jn=0;jn<i[Mn].children.length;jn++)bo[i[Mn].children[jn]]=Mn;Fo.push(0),ut.push(0)}for(var Hn=0;Hn<F.length;Hn++){var Xo=F[Hn];if(!(Xo.position==="floating"||bo[Xo.target]===void 0)){var Xn=bo[Xo.target],Ta=Nd(Xo.text),Kn=uh(Xo.text);if(Xo.container===Xn)Xo.position==="left"?_t[Xo.target]=(_t[Xo.target]||0)+Ta+Ul:Xo.position==="top"?Fo[Xn]=Math.max(Fo[Xn],Kn+Ul):Xo.position==="bottom"?ut[Xn]=Math.max(ut[Xn],Kn+Ul):Wo[Xo.target]=(Wo[Xo.target]||0)+Ta+Ul;else{Xo._outside=Xn;var Qo=i[Xn].children,pa=Qo.indexOf(Xo.target);Xo.position==="left"?(Fr=Math.max(Fr,Ta+xe),Xo._arc=pa>0):Xo.position==="top"?Gt=Math.max(Gt,Kn+Ul):Xo.position!=="bottom"&&(Xo._arc=pa>=0&&pa<Qo.length-1),Xo._arc&&(st=Yu)}}}jr+=Fr,_e+=Gt+st;for(var Mt=jr,la=0;la<i.length;la++){let ca=function(bn,ll,ml){xr("usecase",bn.stereotype,bn.color);var Gl=Dr("uc"),rl=Ec(bn.color,"#F1F1F1","#181818"),nl=bn.name;bn.stereotype&&(nl="\xAB"+bn.stereotype+`\xBB
+`+nl),wr+=po(Gl,nl,rl,ll,ml+ft,bn._w,bn._h,Jn),x[bn.id]={x:jr+ll,y:_e+ml,w:bn._w,h:bn._h,cellId:Gl}};for(var vn=i[la],Jn=Dr("rect"),qn=vn.children,ia=[],zn=[],Ko=0;Ko<qn.length;Ko++){for(var Bt=qn[Ko],ta=!1,ln=0;ln<c.length&&!ta;ln++)c[ln].id===Bt&&(ia.push(c[ln]),ta=!0);for(var mo=0;mo<e.length&&!ta;mo++)e[mo].id===Bt&&(zn.push(e[mo]),ta=!0)}var Vt=r.direction==="LR",nt,kr,Ir=0;for(nt=0;nt<ia.length;nt++){var Tr=ia[nt],Gr=Tr.stereotype?"\xAB"+Tr.stereotype+`\xBB
+`+Tr.name:Tr.name;Tr._w=Bf(Gr),Tr._h=Id(Gr),Ir+=Tr._w+(_t[Tr.id]||0)+(Wo[Tr.id]||0),nt>0&&(Ir+=Wa)}var Vr=[];if(Vt&&ia.length>0){var Ge={},Jr={};for(nt=0;nt<ia.length;nt++)Ge[ia[nt].id]=0,Jr[ia[nt].id]=!0;for(var co=0;co<ia.length+2;co++)for(var Ie=0;Ie<h.length;Ie++){var Ee=h[Ie];if(!(!Jr[Ee.from]||!Jr[Ee.to])){var qo=Ee.span!=null?Ee.span:1,Ot=Ge[Ee.from]+qo;Ge[Ee.to]<Ot&&(Ge[Ee.to]=Ot)}}for(nt=0;nt<ia.length;nt++){for(var no=Ge[ia[nt].id];Vr.length<=no;)Vr.push([]);Vr[no].push(ia[nt])}for(var Fn={},Cn=0;Cn<e.length;Cn++)Fn[e[Cn].id]=Cn;for(var yt=0;yt<Vr.length;yt++){for(var wt=[],rt=0;rt<Vr[yt].length;rt++){for(var le=0,Fe=0,$e=0;$e<h.length;$e++)h[$e].to===Vr[yt][rt].id&&Fn[h[$e].from]!==void 0&&(le+=Fn[h[$e].from],Fe++);wt.push({m:Vr[yt][rt],i:rt,k:Fe?le/Fe:rt})}wt.sort(function(bn,ll){return bn.k-ll.k||bn.i-ll.i}),Vr[yt]=[];for(var Se=0;Se<wt.length;Se++)Vr[yt].push(wt[Se].m)}}var ro=zn.length*tu;zn.length>1&&(ro+=(zn.length-1)*Wa);for(var It=zn.length>0,Jo=ia.length>0,xo=[],Et=[],Vn=0,Un=0,bt=0;bt<Vr.length;bt++){for(var mt=0,In=0,Zn=0;Zn<Vr[bt].length;Zn++)Vr[bt][Zn]._w>mt&&(mt=Vr[bt][Zn]._w),Zn>0&&(In+=Yu),In+=Vr[bt][Zn]._h;xo.push(mt),Et.push(In),bt>0&&(Vn+=Wa),Vn+=mt,In>Un&&(Un=In)}var Oe=Math.max(Vt?Vn:Ir,ro,Df),uo=Oe+ct*2,io=26,we=io+ct,de=(It?we+yu+18+53:we)+Fo[la],$o;Jo?$o=(Vt?de+Un:de+34)+ut[la]+ct:$o=we+yu+18+ct,Do[la]={x:jr,y:_e,w:uo,h:$o},xr(vn.kind==="package"?"package":vn.kind||"rectangle",vn.stereotype,vn.color);var ft=vn.kind==="package"?22:0;if(vn.kind==="package"){var Vo=Math.round(Math.min(uo,bu(vn.name)*1.15+24));Vo<30&&(Vo=30),wr+=ze(Jn,vn.name,"shape=folder;tabWidth="+Vo+";tabHeight=22;tabPosition=left;html=1;fillColor=none;strokeColor=#181818;fontColor=#000000;fontSize=13;fontStyle=1;align=left;verticalAlign=top;spacingLeft=6;spacingTop=1;container=1;collapsible=0;",jr,_e-ft,uo,$o+ft,"1")}else wr+=ze(Jn,vn.name,"swimlane;collapsible=0;startSize=26;fillColor=none;strokeColor=#181818;fontColor=#000000;fontSize=13;fontStyle=1;whiteSpace=wrap;",jr,_e,uo,$o,"1");var zo=(uo-ro)/2;for(kr=0;kr<zn.length;kr++){var ka=zn[kr],sa=ka.name;ka.stereotype&&(sa="\xAB"+ka.stereotype+`\xBB
+`+sa),xr("actor",ka.stereotype,ka.color);var _a=ue(sa,zo,we+ft,Jn,ka.color);wr+=_a.cells,x[ka.id]={x:jr+zo,y:_e+we,w:tu,h:yu,cellId:_a.id,kind:"actor",lblH:2+17*Ns(sa)},zo+=tu+Wa}if(Vt)for(var Ba=(uo-Vn)/2,No=0;No<Vr.length;No++){for(var vt=de+(Un-Et[No])/2,Wt=0;Wt<Vr[No].length;Wt++){var Nt=Vr[No][Wt];ca(Nt,Ba+(xo[No]-Nt._w)/2,vt),vt+=Nt._h+Yu}Ba+=xo[No]+Wa}else{var $a=(uo-Ir)/2;for(nt=0;nt<ia.length;nt++)$a+=_t[ia[nt].id]||0,ca(ia[nt],$a,de),$a+=ia[nt]._w+(Wo[ia[nt].id]||0)+Wa}jr+=uo+nd}var sn=[];for(W=0;W<Lr.length;W++){var ce=Lr[W];if(oa[ce.id]){for(var yr=0,Io=0,ge=0,Ct=0;Ct<h.length;Ct++){var Nn=h[Ct].from===ce.id?h[Ct].to:h[Ct].to===ce.id?h[Ct].from:null;Nn==null||!x[Nn]||(yr+=x[Nn].x+x[Nn].w/2,Io+=x[Nn].y+x[Nn].h/2,ge++)}var Qn=2+17*Ns(ce.data.name),kn,Ke;Xr==="LR"?(kn=Mt-Or-ce.w,Ke=ge>0?Math.round(Io/ge-(ce.h+Qn)/2):ce.y,Ke<es&&(Ke=es)):(kn=ge>0?yr/ge-ce.w/2:ce.x,Ke=ce.y),sn.push({fe:ce,x:kn,y:Ke,lblH:Qn})}}if(Xr==="LR")for(sn.sort(function(ca,bn){return ca.y-bn.y}),W=1;W<sn.length;W++){var yn=sn[W-1].y+sn[W-1].fe.h+sn[W-1].lblH+12;sn[W].y<yn&&(sn[W].y=yn)}for(W=0;W<sn.length;W++){var tn=sn[W];xr("actor",tn.fe.data&&tn.fe.data.stereotype,tn.fe.data&&tn.fe.data.color);var Ia=tn.fe.data.name;tn.fe.data&&tn.fe.data.stereotype&&(Ia="\xAB"+tn.fe.data.stereotype+`\xBB
+`+Ia);var Ma=ue(Ia,tn.x,tn.y,"1",tn.fe.data&&tn.fe.data.color);wr+=Ma.cells,x[tn.fe.id]={x:tn.x,y:tn.y,w:tn.fe.w,h:tn.fe.h,cellId:Ma.id,kind:"actor",lblH:tn.lblH}}for(var Sl=0;Sl<h.length;Sl++){var Ll=h[Sl],ja=x[Ll.from],Ja=x[Ll.to];if(!(!ja||!Ja)){var Ol;Ll.type==="generalization"?Ol="endArrow=block;endFill=0;":Ll.type==="dependency"?Ol=Ll.directed?"endArrow=open;dashed=1;dashPattern=5 5;":"endArrow=none;dashed=1;":Ol=Ll.directed?"endArrow=block;endFill=1;":"endArrow=none;",Ol+="strokeColor=#181818;fontColor=#000000;fontSize=11;edgeStyle=none;rounded=0;html=1;",ja.kind==="actor"&&ja.lblH&&Ja.y>ja.y+ja.h&&(Ol+="exitX=0.5;exitY="+Math.round(100*(ja.h+ja.lblH+3)/ja.h)/100+";exitPerimeter=0;");var Yl="";Ll.stereotype&&(Yl="\xAB"+Ll.stereotype+"\xBB"),Ll.label&&(Yl=Yl?Yl+`
+`+Ll.label:Ll.label),Ol=J(ve(Ol,["arrow"],null,"edge",Ll.color?["strokeColor"]:null),Ze),wr+=mr(Dr("rel"),Yl,Ol,ja.cellId,Ja.cellId,"1")}}var ko=Rt+tl,fo=[];function lt(ca,bn,ll,ml,Gl){var rl=fo.slice();for(var nl in x)if(!(!x.hasOwnProperty(nl)||nl===Gl)){var yl=x[nl];rl.push(yl.kind==="actor"&&yl.lblH?{x:yl.x,y:yl.y,w:yl.w,h:yl.h+yl.lblH}:yl)}for(var vi=0;vi<rl.length;vi++){var hl=rl[vi];if(ca<hl.x+hl.w+6&&ca+ll+6>hl.x&&bn<hl.y+hl.h+6&&bn+ml+6>hl.y)return!0}return!1}for(var Lt=0;Lt<F.length;Lt++){var ao=F[Lt],wa=ao.position==="floating"?ao.anchor:ao.target,ho=wa?x[wa]:null,Ra=Nd(ao.text),Va=uh(ao.text),un=es,En=es,Oa=[];if(ao.position==="floating"){for(var Vl=ao.links||(ao.anchor?[ao.anchor]:[]),Be=0;Be<Vl.length;Be++)x[Vl[Be]]&&Oa.push(x[Vl[Be]]);if(Oa.length>1){for(var Wl=0,hi=0,Ci=0;Ci<Oa.length;Ci++)Wl+=Oa[Ci].x+Oa[Ci].w/2,hi+=Oa[Ci].y+Oa[Ci].h/2;un=Math.round(Wl/Oa.length+3),En=Math.round(hi/Oa.length-Va/2)}else ho?(un=ho.x+(ho.w-Ra)/2,En=ho.y+ho.h+(ho.kind==="actor"&&ho.lblH?ho.lblH:0)+Ul):(un=es,En=ko,ko+=Va+Yu);for(var Qa=0;Qa<12&&lt(un,En,Ra,Va,null);Qa++)un+=24}else if(ho&&ao._outside!=null&&Do[ao._outside]){var na=Do[ao._outside];if(ao.position==="left")un=na.x-Ra-xe,En=ho.y+(ho.h-Va)/2;else if(ao.position==="top")un=ho.x+(ho.w-Ra)/2,En=na.y-Va-Ul;else if(ao.position==="bottom")un=ho.x+(ho.w-Ra)/2,En=na.y+na.h+Ul;else{un=na.x+na.w+xe,En=ho.y+(ho.h-Va)/2;for(var ai=0;ai<12&&lt(un,En,Ra,Va,null);ai++)un+=24}}else ho&&(ao.position==="left"?(un=ho.x-Ra-Ul,un<es&&(un=es),En=ho.y+(ho.h-Va)/2):ao.position==="top"?(un=ho.x+(ho.w-Ra)/2,En=ho.y-Va-Ul):ao.position==="bottom"?(un=ho.x+(ho.w-Ra)/2,En=ho.y+ho.h+Ul):(un=ho.x+ho.w+Ul,En=ho.y+(ho.h-Va)/2));un=Math.round(un),En=Math.round(En),xr("note",null,ao.color);var Ql=Dr("note");if(wr+=ze(Ql,ao.text||"","shape=note;size=10;fillColor=#FEFFDD;strokeColor=#181818;fontSize=13;whiteSpace=wrap;align=left;",un,En,Ra,Va,"1"),fo.push({x:un,y:En,w:Ra,h:Va}),ao.position==="floating"&&Oa.length>1)for(var Dl=0;Dl<Oa.length;Dl++)Oa[Dl].cellId&&(wr+=mr(Dr("noteln"),"","endArrow=none;dashed=1;html=1;strokeColor=#181818;",Ql,Oa[Dl].cellId,"1"));else if(ao.position==="floating"&&Oa.length===1){var ri=Oa[0],wi=ri.y+ri.h+(ri.kind==="actor"&&ri.lblH?ri.lblH:0);wr+=ze(Dr("noteptr"),"","shape=triangle;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;direction=north;",Math.round(ri.x+ri.w/2)-4,wi,8,Math.max(6,En-wi+1),"1")}else if(ho&&ao._outside!=null&&ho.cellId&&ao.position!=="top"&&ao.position!=="bottom"){var Pi=ve("endArrow=none;dashed=1;html=1;strokeColor=#181818;",["arrow"],null,"edge",["strokeWidth"]),Ha=Do[ao._outside];if(ao._arc){var Ml=Math.round(Ha.y-22);wr+=' <mxCell id="'+g(Dr("noteln"))+'" value="" style="'+g(Pi+"curved=1;")+'" edge="1" source="'+g(ho.cellId)+'" target="'+g(Ql)+`" parent="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
- <mxPoint x="`+Math.round(uo.x+uo.w/2)+'" y="'+ql+`"/>
- <mxPoint x="`+Math.round(da+Jn/2)+'" y="'+ql+`"/>
+ <mxPoint x="`+Math.round(ho.x+ho.w/2)+'" y="'+Ml+`"/>
+ <mxPoint x="`+Math.round(un+Ra/2)+'" y="'+Ml+`"/>
</Array>
</mxGeometry>
</mxCell>
-`}else yr+=vr(Ar("noteln"),"",rs,uo.cellId,mi,"1")}else if(uo){var hi="shape=triangle;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;",ei=Math.round(uo.x+uo.w/2),Pi=Math.round(uo.y+uo.h/2);xt.position==="left"?yr+=qe(Ar("noteptr"),"",hi+"direction=east;",da+Jn-1,Pi-4,Math.max(6,uo.x-(da+Jn)+1),8,"1"):xt.position==="top"?yr+=qe(Ar("noteptr"),"",hi+"direction=south;",ei-4,ma+Sa-1,8,Math.max(6,uo.y-(ma+Sa)+1),"1"):xt.position==="bottom"?yr+=qe(Ar("noteptr"),"",hi+"direction=north;",ei-4,uo.y+uo.h,8,Math.max(6,ma-(uo.y+uo.h)+1),"1"):yr+=qe(Ar("noteptr"),"",hi+"direction=west;",uo.x+uo.w,Pi-4,Math.max(6,da-(uo.x+uo.w)+1),8,"1")}}return yr}var Wh={" ":4.4297,"!":4.4297,'"':5.2295,"#":8.8525,"&":9.7617,"'":3.206,"(":4.5527,")":4.5527,"*":6.7471,"+":11.1289,",":4.4297,"-":8.1006,".":4.4297,"/":7.3418,0:8.8525,1:8.8525,2:8.8525,3:8.8525,4:8.8525,5:8.8525,6:8.8525,7:8.8525,8:8.8525,9:8.8525,":":4.4297,";":4.4297,"=":11.1289,"?":5.9063,"@":12.0176,A:9.6592,B:8.0527,C:9.6865,D:10.4863,E:7.5879,F:7.5059,G:10.1172,H:10.2881,I:4.0332,J:4.3545,K:9.1396,L:7.4648,M:12.0586,N:10.3428,O:10.876,P:7.7383,Q:10.876,R:8.8525,S:7.54,T:8.8525,U:9.7002,V:9.1533,W:11.9766,X:8.7637,Y:8.7226,Z:8.4629,"[":4.5527,"]":4.5527,"^":8.8525,_:7,"`":8.5996,a:7.7314,b:8.8115,c:7.1709,d:8.8115,e:7.7998,f:5.1475,g:8.7295,h:8.6885,i:4.0469,j:4.2588,k:8.1826,l:4.0469,m:13.0703,n:8.6885,o:8.5996,p:8.8115,q:8.8115,r:5.7285,s:7.1367,t:5.2363,u:8.6885,v:7.2461,w:10.7871,x:8.5859,y:7.3144,z:8.0254,"{":4.5527,"|":5.2295,"}":4.5527},Xh={" ":4.6143,"!":4.3887,'"':6.3233,"#":9.2354,"&":10.4248,"'":3.459,"(":5.1885,")":5.1885,"*":6.5284,"+":11.1357,",":3.459,"-":8.9415,".":3.459,"/":7.9161,0:9.2354,1:9.2354,2:9.2354,3:9.2354,4:9.2354,5:9.2354,6:9.2354,7:9.2354,8:9.2354,9:9.2354,":":3.459,";":3.459,"=":11.1357,"?":6.959,"@":12.0176,A:10.3086,B:8.8184,C:9.9736,D:11.1016,E:8.4082,F:8.0391,G:10.4385,H:10.9238,I:4.6416,J:5.8584,K:9.9394,L:8.1416,M:12.708,N:10.7598,O:11.5254,P:8.5859,Q:11.5322,R:9.6592,S:7.998,T:9.6592,U:10.3086,V:9.7822,W:12.6533,X:9.3379,Y:9.6113,Z:9.0234,"[":5.1885,"]":5.1885,"^":9.2354,_:7,"`":8.9414,a:8.2305,b:9.2764,c:7.4512,d:9.2764,e:8.2031,f:5.8037,g:9.2354,h:9.1943,i:4.5527,j:4.6621,k:8.8594,l:4.5527,m:13.5762,n:9.1943,o:8.9414,p:9.2764,q:9.2764,r:6.3643,s:7.916,t:5.6738,u:9.1943,v:8.3057,w:12.0791,x:8.2715,y:8.1621,z:8.2715,"{":5.1885,"|":5.4004,"}":5.1885},Pd=14,qh=1.17773,Zh=1.1499,jh=.848,Jh=.60205;function Vh(r,a){var e=a?Xh:Wh;if(e.hasOwnProperty(r))return e[r];var h=r.charCodeAt(0);return h>=48&&h<=57?e[0]:h>=65&&h<=90?a?9.9:9:h>=11904?Pd:a?8.4:7.9}function Qh(r){var a=kt.asInt(r,"FontSize",14);(a===-1||!(a>0))&&(a=14);var e=kt.fontFace(r),h=kt.raw(r,"FontName")||"SansSerif",l="sans";return/mono|courier/i.test(h)?l="mono":/serif/i.test(h)&&!/sans/i.test(h)&&(l="serif"),{size:a,bold:!!e.bold,italic:!!e.italic,family:l,name:h}}var rC={size:14,bold:!1,italic:!1,family:"sans",name:"SansSerif"};function Ds(r,a){var e=String(r??"");if(a.family==="mono")return e.length*a.size*Jh;for(var h=0,l=0;l<e.length;l++)h+=Vh(e.charAt(l),a.bold);return h*=a.size/Pd,a.family==="serif"&&(h*=jh),h}function eC(r){return r.size*(r.family==="serif"?Zh:qh)}function is(r,a,e){for(var h=String(r??"").split(/\\n|\n/),l={size:a>0?a:Pd,bold:!!e},C=0,b=0;b<h.length;b++){var Z=Ds(h[b],l);Z>C&&(C=Z)}return C}function Uf(r,a){var e=Ds(u(r),a);if(!a.bold){var h={size:a.size,bold:!0,italic:a.italic,family:a.family,name:a.name};String(r).replace(/\*\*([\s\S]+?)\*\*/g,function(C,b){var Z=u(b);return e+=Ds(Z,h)-Ds(Z,a),""})}if(a.family!=="mono"){var l={size:a.size,bold:!1,italic:!1,family:"mono",name:a.name};String(r).replace(/""([\s\S]+?)""/g,function(C,b){return e+=Ds(b,l)-Ds(b,a),""})}return e}function oC(r,a,e){if(!(e>0))return[r];for(var h=String(r).split(" "),l=Ds(" ",a),C=[],b=[],Z=0,v=0;v<h.length;v++){var er=Uf(h[v],a),X=b.length>0?Z+l+er:er;X>e&&b.length>0?(C.push(b.join(" ")),b=[h[v]],Z=er):(b.push(h[v]),Z=X)}return C.push(b.join(" ")),C}function tC(r,a,e){for(var h=String(r??"").replace(/\\n/g,`
-`),l=h.split(`
-`),C=[],b=0,Z=0;Z<l.length;Z++)C=C.concat(oC(l[Z],a,e));for(var v=0;v<C.length;v++){var er=Uf(C[v]===""?" ":C[v],a);er>b&&(b=er)}return{lines:C,text:C.join(`
-`),textW:b,textH:C.length*eC(a)}}function Wf(r){for(var a=String(r??"").split(`
-`),e=0,h=0;h<a.length;h++){var l=Ds(a[h],rC);l>e&&(e=l)}return e}function Sc(r){return U(r)}function nC(r){return/\*\*[\s\S]+?\*\*|\/\/[\s\S]+?\/\/|__[\s\S]+?__|~~[\s\S]+?~~/.test(String(r??""))||m(r)}function Qi(r){return String(Math.round(r*1e4)/1e4)}function xu(r,a){if(r==null)return a;if(r==="none")return"none";var e=String(r).replace(/^\s+|\s+$/g,""),h=/^(#?[0-9A-Za-z]+)[|\/\\-][#]?[0-9A-Za-z]+$/.exec(e);h!=null&&(e=h[1]);var l=Y(e);if(l==null)return"#FFFFFF";if(/^#[0-9A-Fa-f]{6}$/.test(l))return l.toUpperCase();if(/^#[0-9A-Fa-f]{3}$/.test(l))return("#"+l.charAt(1)+l.charAt(1)+l.charAt(2)+l.charAt(2)+l.charAt(3)+l.charAt(3)).toUpperCase();if(/^#[0-9A-Fa-f]$/.test(l)){var C=l.charAt(1);return("#"+C+C+C+C+C+C).toUpperCase()}return/^#[0-9A-Fa-f]{8}$/.test(l)?("#"+l.substring(1,7)).toUpperCase():"#FFFFFF"}function Bc(r,a,e,h){var l=["root","element",r,"node"],C=a.style==="leaf",b=!a.children||a.children.length===0;return e===0?(l.push("rootNode"),C&&l.push("boxless")):C&&b?l.push("leafNode","boxless"):C?l.push("boxless"):b&&l.push("leafNode"),kt.signature(l,e,a.stereotypes||[],h)}function Tc(r,a,e,h,l){for(var C=[Bc(a,e,h,!1)],b=0;b<l.length;b++)C.push(Bc(a,l[b],h,!0));var Z=kt.nodeStyle(r,C);if(e.color){var v={};for(var er in Z)Z.hasOwnProperty(er)&&(v[er]=Z[er]);v.BackGroundColor={value:e.color,priority:1/0},Z=v}return Z}function Yd(r,a,e,h){return kt.plainStyle(r,kt.signature(["root","element",a,"arrow"],h,e.stereotypes||[],!1))}function Ic(r,a,e,h){var l=Qh(a),C=tC(r.label,l,kt.maxWidth(a)),b,Z,v;return e?(b=h,Z=C.textW+b.left+b.right,v=C.textH+b.top+b.bottom):(b=kt.clockwise(a,"Padding"),Z=Math.max(kt.asDouble(a,"MinimumWidth",0),C.textW+b.top+b.bottom),v=C.textH+b.top+b.bottom),{font:l,tb:C,pad:b,w:Z,h:v}}function Nc(r){return r.dashVisible>0?"dashed=1;fixDash=1;dashPattern="+Qi(r.dashVisible)+" "+Qi(r.dashSpace)+";":""}function Lc(r){return String(r).replace(/[;=<>"'`{}\r\n\t]/g,"")}function Gc(r,a,e,h){var l=a.font,C=kt.horizontalAlignment(r),b=xu(kt.color(r,"FontColor"),"#000000"),Z;if(e)Z="text;html=1;strokeColor=none;fillColor=none;align="+C+";verticalAlign=middle;whiteSpace=wrap;fontColor="+b+";fontSize="+l.size+";spacing=0;"+(a.pad.left>0?"spacingLeft="+Qi(a.pad.left)+";":"")+(a.pad.right>0?"spacingRight="+Qi(a.pad.right)+";":"");else{var v=kt.asDouble(r,"RoundCorner",0),er=kt.stroke(r),X=xu(kt.color(r,"BackGroundColor"),"#F1F1F1"),V=xu(kt.color(r,"LineColor"),"#181818");Z=(v>0?"rounded=1;arcSize="+Qi(v)+";absoluteArcSize=1;":"rounded=0;")+"fillColor="+X+";strokeColor="+V+";strokeWidth="+Qi(er.thickness)+";"+Nc(er)+(kt.shadowing(r)>0?"shadow=1;":"")+"whiteSpace=wrap;fontColor="+b+";fontSize="+l.size+";align="+C+";verticalAlign=middle;spacing=0;spacingTop="+Qi(a.pad.top)+";spacingBottom="+Qi(a.pad.bottom)+";"+(C==="left"?"spacingLeft="+Qi(a.pad.left)+";":C==="right"?"spacingRight="+Qi(Math.max(0,a.pad.top+a.pad.bottom-a.pad.left))+";":"")}var tr=Sc(h)|(l.bold?1:0)|(l.italic?2:0);return tr!==0&&(Z+="fontStyle="+tr+";"),/^sans-?serif$/i.test(l.name)||(Z+="fontFamily="+Lc(l.name)+";"),Z}function wc(r){var a=xu(kt.color(r,"LineColor"),"#181818");if(a==="none")return null;var e=kt.stroke(r);return"strokeColor="+a+";"+(e.thickness!==1?"strokeWidth="+Qi(e.thickness)+";":"")+Nc(e)}function Pc(r,a,e,h,l,C,b,Z){var v=e.tb.text;return Sc(a.label)===0&&nC(a.label)?(h.indexOf("html=1;")<0&&(h+="html=1;"),K(r,n(v),h,l,C,b,Z,"1")):s(r,v,h,l,C,b,Z,"1")}var Hu=10,aC=10,Yc=0,lC=30,iC={top:1,right:0,bottom:1,left:3},sC={top:1,right:3,bottom:1,left:0};function Md(r,a,e,h,l,C){for(var b=a.style==="leaf",Z=Tc(r,"mindmapDiagram",a,e,h),v=Ic(a,Z,b,l===1?iC:sC),er=kt.clockwise(Z,"Margin"),X=b?0:er.top+er.bottom,V={node:a,level:e,props:Z,m:v,boxless:b,direction:l,w:v.w,h:v.h,marginTop:b?0:er.top,thickness:v.h+X,pw:v.w,pt:v.h+X,x1:er.left,x2:er.right+lC,link:wc(Yd(r,"mindmapDiagram",a,e)),children:[],tetris:null,cellId:null},tr=C||a.children||[],wr=[a].concat(h),yr=0;yr<tr.length;yr++)V.children.push(Md(r,tr[yr],e+1,wr,l,null));return V}function uC(r){if(r.children.length===0)return{t1:r.pt,e1:r.pw,t2:0,e2:0};var a=Xf(r);return{t1:r.pt,e1:r.pw+r.x1,t2:a.height,e2:r.x2+a.width}}function Xf(r){if(r.tetris!=null)return r.tetris;var a=[{x1:-1/0,x2:1/0,v:-1/0}],e=[];function h(Nr,de){for(var Fr=[],Ir=0;Ir<a.length;Ir++){var qe=a[Ir];if(!(Nr>=qe.x2)&&(Fr.push(qe),de<=qe.x2))return Fr}return Fr}function l(Nr,de){for(var Fr=h(Nr,de),Ir=-1/0,qe=0;qe<Fr.length;qe++)Fr[qe].v>Ir&&(Ir=Fr[qe].v);return Ir}function C(Nr,de,Fr){if(!(de<=Nr)){var Ir=h(Nr,de);if(Ir.length>1){for(var qe=Nr,To=1;To<Ir.length;To++)C(qe,Ir[To].x1,Fr),qe=Ir[To].x1;C(qe,de,Fr)}else if(Ir.length===1){var ne=Ir[0];if(Fr<=ne.v)return;a.splice(a.indexOf(ne),1),ne.x1!==Nr&&a.push({x1:ne.x1,x2:Nr,v:ne.v}),a.push({x1:Nr,x2:de,v:Fr}),de!==ne.x2&&a.push({x1:de,x2:ne.x2,v:ne.v}),a.sort(function(po,ao){return po.x1-ao.x1})}}}for(var b=0,Z=0;Z<r.children.length;Z++){var v=r.children[Z],er=uC(v),X;if(a.length===1)X=0;else{var V=l(0,er.e1),tr=l(er.e1,er.e1+er.e2);X=Math.max(V+er.t1/2,tr+er.t2/2)}e.push({finger:v,tee:er,y:X}),C(0,er.e1,X+er.t1/2),er.e2>0&&C(er.e1,er.e1+er.e2,X+er.t2/2),er.e1+er.e2>b&&(b=er.e1+er.e2)}for(var wr=1/0,yr=-1/0,fr=0;fr<e.length;fr++){var Ar=Math.max(e[fr].tee.t1,e[fr].tee.t2)/2;e[fr].y-Ar<wr&&(wr=e[fr].y-Ar),e[fr].y+Ar>yr&&(yr=e[fr].y+Ar)}if(e.length>0)for(var jr=(wr+yr)/2,ce=0;ce<e.length;ce++)e[ce].y-=jr;return r.tetris={elements:e,height:e.length>0?yr-wr:0,width:b},r.tetris}function Mc(r){return Math.max(r.pt,r.children.length>0?Xf(r).height:0)}function fC(r){return r.children.length>0?Xf(r).width:0}function xd(r,a,e,h){var l=r.direction,C=r.cellId;if(r.pt>0||r.pw>0){var b=l===1?a:a-r.w,Z=e-r.pt/2+r.marginTop;C=h.nextId(r.level===0?"root":"mm"),h.cells+=Pc(C,r.node,r.m,Gc(r.props,r.m,r.boxless,r.node.label),b,Z,r.w,r.h),h.track(b,Z,r.w,r.h)}if(r.children.length>0)for(var v=Xf(r),er=l===1?"exitX=1;exitY=0.5;entryX=0;entryY=0.5;":"exitX=0;exitY=0.5;entryX=1;entryY=0.5;",X=0;X<v.elements.length;X++){var V=v.elements[X],tr=xd(V.finger,a+l*(r.pw+r.x1+r.x2),e+V.y,h);C!=null&&tr!=null&&r.link!=null&&(h.cells+=vr(h.nextId("mmedge"),"","edgeStyle=orthogonalEdgeStyle;curved=1;endArrow=none;startArrow=none;html=1;"+r.link+er,C,tr,"1"))}return C}function dC(r,a,e,h){for(var l=[],C=[],b=0;b<r.children.length;b++)(r.children[b].side==="left"?C:l).push(r.children[b]);var Z=null,v=null;C.length>0&&(v=Md(e,r,0,[],-1,C)),(v==null||l.length>0)&&(Z=Md(e,r,0,[],1,l)),Z!=null&&v!=null&&(v.pw=0,v.pt=0);var er=Math.max(Z!=null?Mc(Z)/2:0,v!=null?Mc(v)/2:0),X=v!=null?v.pw+fC(v)+v.x1+v.x2:0,V=Hu+X,tr=a+er;if(Z!=null){var wr=xd(Z,V,tr,h);v!=null&&(v.cellId=wr)}return v!=null&&xd(v,V,tr,h),2*er}function cC(r,a){for(var e=0,h=r.styleSheet||kt.createSheet(),l={cells:"",maxX:0,nextId:function(de){return de+"_"+e++},track:function(de,Fr,Ir,qe){de+Ir>l.maxX&&(l.maxX=de+Ir)}},C=[],b=r.roots||(r.root?[r.root]:[]),Z=0;Z<b.length;Z++)b[Z]&&b[Z].label!=null&&!b[Z].synthetic&&C.push(b[Z]);if(C.length===0)return"";for(var v=aC,er=0;er<C.length;er++)v+=dC(C[er],v,h,l)+Yc;var X=l.cells,V=v-Yc,tr=l.maxX+Hu;if(r.title){var wr=Wf(u(r.title))+10;X+=s(l.nextId("title"),r.title,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",(tr-wr)/2,-34,wr,24,"1")}if(r.header&&r.header.text){var yr=Wf(u(r.header.text))*.7142857142857143+8,fr=r.header.align==="left"?Hu:r.header.align==="center"?(tr-yr)/2:tr-Hu-yr;X+=s(l.nextId("header"),r.header.text,"text;html=1;fillColor=none;strokeColor=none;fontSize=10;fontColor=#888888;align="+(r.header.align||"right")+";verticalAlign=middle;",fr,r.title?-56:-34,yr,16,"1")}var Ar=V+13;if(r.caption){var jr=Wf(u(r.caption))+10;X+=s(l.nextId("caption"),r.caption,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontColor=#000000;align=center;verticalAlign=middle;",(tr-jr)/2,Ar,jr,22,"1"),Ar+=18}if(r.footer&&r.footer.text){var ce=Wf(u(r.footer.text))*.7142857142857143+8,Nr=r.footer.align==="left"?Hu:r.footer.align==="right"?tr-Hu-ce:(tr-ce)/2;X+=s(l.nextId("footer"),r.footer.text,"text;html=1;fillColor=none;strokeColor=none;fontSize=10;fontColor=#888888;align="+(r.footer.align||"center")+";verticalAlign=middle;",Nr,Ar,ce,16,"1")}return X}var xc=20,Hc=20,Kc=40,mf=10,hC={top:1,right:3,bottom:1,left:0};function zc(r,a,e,h){for(var l=a.style==="leaf",C=Tc(r,"wbsDiagram",a,e,h),b=Ic(a,C,l,hC),Z={node:a,level:e,props:C,m:b,boxless:l,w:b.w,h:b.h,marginBottom:kt.clockwise(C,"Margin").bottom,auto:/^auto$/i.test(String(kt.raw(C,"Width")||"").replace(/^\s+|\s+$/g,"")),link:wc(Yd(r,"wbsDiagram",a,e)),children:[],left:[],forced:0,textDx:0,dimW:0,dimH:0,w1:0},v=[a].concat(h),er=0;er<a.children.length;er++){var X=zc(r,a.children[er],e+1,v);a.children[er].side==="left"?e===0?Z.children.unshift(X):Z.left.push(X):Z.children.push(X)}var V=Z.left.concat(Z.children);if(Z.auto&&V.length>0){for(var tr=0,wr=0;wr<V.length;wr++)V[wr].w>tr&&(tr=V[wr].w);for(var yr=0;yr<V.length;yr++){var fr=V[yr];fr.forced=tr,fr.boxless||(fr.w=Math.max(fr.w,tr))}}return Z}function kf(r){return r.children.length===0&&r.left.length===0}function Hd(r){if(kf(r)){r.dimW=r.boxless?Math.max(r.w,r.forced):r.w,r.dimH=r.h,r.w1=r.dimW/2,r.textDx=r.boxless&&r.forced>r.w?(r.forced-r.w)/2:0;return}var a=0,e=0,h=0,l=0,C;for(C=0;C<r.left.length;C++)Hd(r.left[C]),r.left[C].dimW>a&&(a=r.left[C].dimW),e+=r.marginBottom+r.left[C].dimH;for(C=0;C<r.children.length;C++)Hd(r.children[C]),r.children[C].dimW>h&&(h=r.children[C].dimW),l+=r.marginBottom+r.children[C].dimH;r.w1=Math.max(r.w/2,mf+a),r.dimW=r.w1+Math.max(r.w/2,mf+h),r.dimH=r.h+Math.max(e,l)}function CC(r){return kf(r)?{x:0,y:r.h/2}:{x:r.w1-r.w/2,y:r.h/2}}function vC(r){return kf(r)?{x:r.dimW,y:r.h/2}:{x:r.w1+r.w/2,y:r.h/2}}function Uc(r){return kf(r)?r.dimW/2:r.w1}function Kd(r,a,e,h){if(kf(r)){h.boxes.push({el:r,x:a+r.textDx,y:e});return}h.boxes.push({el:r,x:a+r.w1-r.w/2,y:e});var l=a+r.w1,C=e+r.h,b=C,Z,v;for(Z=0;Z<r.left.length;Z++){v=r.left[Z],b+=r.marginBottom;var er=vC(v),X=l-v.dimW-mf;h.links.push({from:r,to:v,link:r.link,route:[{x:l,y:C},{x:l,y:b+er.y},{x:X+er.x,y:b+er.y}]}),Kd(v,X,b,h),b+=v.dimH}for(b=C,Z=0;Z<r.children.length;Z++){v=r.children[Z],b+=r.marginBottom;var V=CC(v);h.links.push({from:r,to:v,link:r.link,route:[{x:l,y:C},{x:l,y:b+V.y},{x:l+mf+V.x,y:b+V.y}]}),Kd(v,l+mf,b,h),b+=v.dimH}}function pC(r,a){var e=r.root;if(!e||e.label==null)return"";var h=0;function l(he){return he+"_"+h++}var C=r.styleSheet||kt.createSheet(),b=zc(C,e,0,[]),Z={boxes:[],links:[],lines:[]},v,er,X,V,tr;for(v=0;v<b.children.length;v++)Hd(b.children[v]);var wr=b.h,yr=wr+Kc/2,fr=wr+Kc;if(b.children.length===0)Z.boxes.push({el:b,x:0,y:0}),Z.lines.push({x1:b.w/2,y1:wr,x2:b.w/2,y2:yr,link:b.link});else{var Ar=0,jr=Uc(b.children[0]),ce=jr,Nr=0,de=[];for(v=0;v<b.children.length;v++){var Fr=b.children[v];ce=Ar+Uc(Fr),de.push(ce),Kd(Fr,Ar,fr,Z),Ar+=Fr.dimW+Hc,Nr+=Fr.dimW+(v>0?Hc:0)}var Ir=ce>jr?jr+(ce-jr-b.w)/2:(Math.max(Nr,b.w)-b.w)/2,qe=Ir+b.w/2;for(v=0;v<b.children.length;v++)Z.links.push({from:b,to:b.children[v],link:b.link,route:[{x:qe,y:wr},{x:qe,y:yr},{x:de[v],y:yr},{x:de[v],y:fr}]});Z.boxes.push({el:b,x:Ir,y:0})}var To=0,ne=0;for(v=0;v<Z.boxes.length;v++)X=Z.boxes[v],X.x<To&&(To=X.x),X.y<ne&&(ne=X.y);for(v=0;v<Z.links.length;v++)for(er=0;er<Z.links[v].route.length;er++)Z.links[v].route[er].x<To&&(To=Z.links[v].route[er].x),Z.links[v].route[er].y<ne&&(ne=Z.links[v].route[er].y);for(v=0;v<Z.lines.length;v++)tr=Z.lines[v],Math.min(tr.x1,tr.x2)<To&&(To=Math.min(tr.x1,tr.x2)),Math.min(tr.y1,tr.y2)<ne&&(ne=Math.min(tr.y1,tr.y2));var po=xc-To,ao=xc-ne,A="";for(v=0;v<Z.boxes.length;v++)Z.boxes[v].el.id=l("wbs");for(v=0;v<Z.links.length;v++)if(V=Z.links[v],V.link!=null){var J=[];for(er=0;er<V.route.length;er++){var ur=V.route[er];(J.length===0||Math.abs(ur.x-V.route[er-1].x)>1e-9||Math.abs(ur.y-V.route[er-1].y)>1e-9)&&J.push({x:ur.x+po,y:ur.y+ao})}J.length<2||(A+=or(l("wbse"),"","endArrow=none;startArrow=none;rounded=0;curved=0;"+V.link,J[0].x,J[0].y,J.slice(1,-1),J[J.length-1].x,J[J.length-1].y,"1",V.from.id,V.to.id))}for(v=0;v<Z.lines.length;v++)tr=Z.lines[v],!(tr.link==null||tr.x1===tr.x2&&tr.y1===tr.y2)&&(A+=G(l("wbse"),"","endArrow=none;startArrow=none;rounded=0;curved=0;"+tr.link,tr.x1+po,tr.y1+ao,tr.x2+po,tr.y2+ao,"1"));for(v=0;v<Z.boxes.length;v++)X=Z.boxes[v],A+=Pc(X.el.id,X.el.node,X.el.m,Gc(X.el.props,X.el.m,X.el.boxless,X.el.node.label),X.x+po,X.y+ao,X.el.w,X.el.h);var Sr={};for(v=0;v<Z.boxes.length;v++)Z.boxes[v].el.node.code!=null&&(Sr[Z.boxes[v].el.node.code]=Z.boxes[v]);var Er=r.links||[];for(v=0;v<Er.length;v++){var qr=Er[v],z=Sr[qr.from],Mr=Sr[qr.to];if(!(z==null||Mr==null)){var Be={x:z.x+po+z.el.w/2,y:z.y+ao+z.el.h/2},ye={x:Mr.x+po+Mr.el.w/2,y:Mr.y+ao+Mr.el.h/2},Le=ye.x-Be.x,_e=ye.y-Be.y;if(!(Le===0&&_e===0)){var Ur=Wc(Be,z.el.w/2,z.el.h/2,Le,_e),yo=Wc(ye,Mr.el.w/2,Mr.el.h/2,-Le,-_e),fo=qr.color!=null?xu(qr.color,"#181818"):xu(kt.color(Yd(C,"wbsDiagram",{stereotypes:qr.stereotypes||[]},null),"LineColor"),"#181818");fo!=="none"&&(A+=or(l("wbsl"),"","endArrow=classic;endFill=1;endSize=8;startArrow=none;rounded=0;curved=0;strokeColor="+fo+";strokeWidth=1;",Qi(Ur.x),Qi(Ur.y),[],Qi(yo.x),Qi(yo.y),"1",z.el.id,Mr.el.id))}}}return A}function Wc(r,a,e,h,l){var C=Math.min(h!==0?a/Math.abs(h):1/0,l!==0?e/Math.abs(l):1/0);return{x:r.x+h*C,y:r.y+l*C}}var Ai=23,qf=14,Xc=37,cs=18,qc=20,zd=15,Ku=null;function Ys(r,a){return Ku==null||Ku.sheet==null?{}:H(Ku.sheet,["root","element",Ku.diagram].concat(r),[],a||"vertex")}function Ud(r,a){for(var e={},h=0;h<a.length;h++)r[a[h]]!=null&&(e[a[h]]=r[a[h]]);return e}function Zc(){var r=Ud(Ys(["node"],"edge"),["strokeColor"]),a=Ys(["separator"],"edge");return a.strokeColor!=null&&(r.strokeColor=a.strokeColor),a.strokeWidth!=null&&(r.strokeWidth=a.strokeWidth),r}function jc(r){var a=Ys(["node"],"vertex");if(delete a.fontStyleBits,r){var e=Ys(["highlight"],"vertex");e.fillColor!=null?a.fillColor=e.fillColor:delete a.fillColor}return a}function $C(r,a){return M("rounded=1;absoluteArcSize=1;arcSize=10;whiteSpace=wrap;fillColor="+r+";strokeColor=#000000;strokeWidth=1.5;",jc(a))}function Jc(){var r=Ys(["separator"],"edge");return r.strokeColor!=null||r.strokeWidth!=null}function Vc(r,a){var e=jc(a);return Jc()&&(e.rowLines="0"),M("shape=table;childLayout=tableLayout;container=1;collapsible=0;startSize=0;rowLines=1;fixedRows=1;resizeLast=1;rounded=1;absoluteArcSize=1;arcSize=10;whiteSpace=wrap;fillColor="+r+";strokeColor=#000000;strokeWidth=1.5;",e)}function Qc(r){var a=Zc();if(Jc()&&(a.bottom="1"),r){var e=Ys(["highlight"],"vertex");e.fillColor!=null&&(a.fillColor=e.fillColor)}return M("shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;collapsible=0;dropTarget=0;strokeColor=#000000;top=0;left=0;right=0;bottom=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fillColor="+(r||"none")+";",a)}function Wd(r,a,e){var h=Ud(Ys(["node"],"text"),["fontColor","fontSize","fontFamily"]),l=Zc();if(l.strokeColor!=null&&(h.strokeColor=l.strokeColor),e){var C=Ys(["highlight"],"text");C.fontColor!=null&&(h.fontColor=C.fontColor)}return M("shape=partialRectangle;connectable=0;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right="+(a?1:0)+";strokeColor=#000000;whiteSpace=wrap;fontSize="+qf+";align=left;spacingLeft=5;verticalAlign=middle;"+(r?"fontStyle=1;":""),h)}var gC="endArrow=classic;dashed=1;dashPattern=3 3;curved=1;html=1;strokeColor=#000000;";function rh(){return M(gC,Ys(["arrow"],"edge"))}function _f(r,a){return Math.ceil(is(r,qf,a))+10}function Of(r){if(r==null||typeof r!="object"){var a=Math.max(40,_f(String(r),!1));return{keyW:0,valW:a,w:a}}if(Array.isArray(r)){for(var e=zd,h=0;h<r.length;h++)(r[h]==null||typeof r[h]!="object")&&(e=Math.max(e,_f(String(r[h]),!1)));return{keyW:0,valW:e,w:e}}var l=zd,C=zd;for(var b in r)if(r.hasOwnProperty(b)){l=Math.max(l,_f(b,!0));var Z=r[b];(Z==null||typeof Z!="object")&&(C=Math.max(C,_f(String(Z),!1)))}return{keyW:l,valW:C,w:l+C}}function zu(r){if(r==null||typeof r!="object")return Ai;var a=0,e=0;if(Array.isArray(r)){a=r.length;for(var h=0;h<r.length;h++)r[h]!=null&&typeof r[h]=="object"&&(e+=zu(r[h])+cs)}else for(var l in r)r.hasOwnProperty(l)&&(a++,r[l]!=null&&typeof r[l]=="object"&&(e+=zu(r[l])+cs));return Math.max(Math.max(1,a)*Ai,e>0?e-cs:0)}function Xd(r,a,e,h,l,C,b){var Z="",v=C!==""?C:r;r===""&&C===""&&(v="");for(var er=!1,X=0;X<l.length;X++)if(l[X]===v){er=!0;break}var V=er?"#CCFF02":"#F1F1F1",tr="text;whiteSpace=wrap;fontSize="+qf+";align=left;spacingLeft=5;verticalAlign=middle;",wr=Of(a);if(a==null||typeof a!="object"){var yr=r!==""?r+": "+String(a):String(a),fr=Math.max(40,_f(yr,!1)),Ar=b("jn");return Z+=s(Ar,yr,M($C(V,er)+"fontSize="+qf+";align=left;spacingLeft=5;",Ud(Ys([er?"highlight":"node"],"text"),["fontColor","fontSize","fontFamily"])),e,h,fr,Ai,"1"),{cells:Z,height:Ai,width:fr,rootId:Ar}}if(Array.isArray(a)){var jr=Math.max(1,a.length),ce=wr.w,Nr=Ai*jr,de=b("ja");Z+=s(de,"",Vc(V,er),e,h,ce,Nr,"1");for(var Fr=[],Ir=0;Ir<a.length;Ir++){var qe=a[Ir]!=null&&typeof a[Ir]=="object",To=qe?"":String(a[Ir]),ne=b("jw");Z+=s(ne,"",Qc(null),0,Ir*Ai,ce,Ai,de);var po=b("jr");if(Z+=s(po,To,Wd(!1,!1),0,0,ce,Ai,ne),qe){var ao=b("jb");Fr[Ir]=ao,Z+=s(ao,"","ellipse;fillColor=#000000;strokeColor=#000000;",ce-16,Ai/2-3,6,6,po)}}for(var A=e+ce+Xc,J=Nr,ur=0,Sr=0,Er=0,qr=-1,z=0;z<a.length;z++)a[z]!=null&&typeof a[z]=="object"&&(ur=Math.max(ur,Of(a[z]).w),Sr+=zu(a[z])+cs,Er++,qr=z);var Mr=h;Er===1?Mr=h+Math.max(0,qr*Ai+Ai/2-zu(a[qr])/2):Er>1&&(Mr=h+Math.max(0,(Nr-(Sr-cs))/2));for(var Be=0;Be<a.length;Be++)if(a[Be]!=null&&typeof a[Be]=="object"){var ye=v!==""?v+"/"+Be:String(Be),Le=Of(a[Be]).w,_e=Xd(String(Be),a[Be],A+(ur-Le)/2,Mr,l,ye,b);Z+=_e.cells,Z+=vr(b("je"),"",rh(),Fr[Be],_e.rootId,"1"),Mr+=_e.height+cs}return Mr-cs>h+Nr&&(J=Mr-cs-h),{cells:Z,height:J,width:ce,rootId:de}}var Ur=[];for(var yo in a)a.hasOwnProperty(yo)&&Ur.push(yo);var fo=Math.max(1,Ur.length),he=wr.keyW,Te=wr.w,ae=Ai*fo,it=b("jo");Z+=s(it,"",Vc(V,er),e,h,Te,ae,"1");for(var Gt=[],oo=0;oo<Ur.length;oo++){for(var pt=a[Ur[oo]],rt=pt!=null&&typeof pt=="object",jo=rt?"":String(pt),Qt=v!==""?v+"/"+Ur[oo]:Ur[oo],Me=!1,Io=0;Io<l.length;Io++)if(l[Io]===Qt){Me=!0;break}var Wo=oo*Ai,Ro=b("jw");Z+=s(Ro,"",Qc(Me?"#CCFF02":null),0,Wo,Te,Ai,it),Z+=s(b("jr"),Ur[oo],Wd(!0,!0,Me),0,0,he,Ai,Ro);var An=b("jr");if(Z+=s(An,jo,Wd(!1,!1,Me),he,0,Te-he,Ai,Ro),rt){var dn=b("jb");Gt[oo]=dn,Z+=s(dn,"","ellipse;fillColor=#000000;strokeColor=#000000;",Te-he-16,Ai/2-3,6,6,An)}}for(var rn=e+Te+Xc,Ao=ae,_t=0,ft=0,Se=0,Go=-1,wt=0;wt<Ur.length;wt++){var cn=a[Ur[wt]];cn!=null&&typeof cn=="object"&&(_t=Math.max(_t,Of(cn).w),ft+=zu(cn)+cs,Se++,Go=wt)}var No=h;Se===1?No=h+Math.max(0,Go*Ai+Ai/2-zu(a[Ur[Go]])/2):Se>1&&(No=h+Math.max(0,(ae-(ft-cs))/2));for(var oe=0;oe<Ur.length;oe++){var Uo=a[Ur[oe]];if(Uo!=null&&typeof Uo=="object"){var Ot=v!==""?v+"/"+Ur[oe]:Ur[oe],ho=Of(Uo).w,dt=Xd(Ur[oe],Uo,rn+(_t-ho)/2,No,l,Ot,b);Z+=dt.cells,Z+=vr(b("je"),"",rh(),Gt[oe],dt.rootId,"1"),No+=dt.height+cs}}return No-cs>h+ae&&(Ao=No-cs-h),{cells:Z,height:Ao,width:Te,rootId:it}}function eh(r,a){var e=0;function h(l){return l+"_"+e++}if(r.data==null&&!r.rootPresent)return"";Ku={sheet:r.styleSheet||null,diagram:typeof a=="string"?a:"jsonDiagram"};try{return Xd("",r.data,qc,qc,r.highlights||[],"",h).cells}finally{Ku=null}}function RC(r){return eh(r,"yamlDiagram")}function Ff(r){var a=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(r||"");return a?("#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]).toUpperCase():Y(r)}function AC(r){if(!r)return 1;var a=String(r).split(/\\n|\r\n|\r|\n|<br\s*\/?>/i);return a.length<1?1:a.length}function Uu(r,a){if(!r)return 0;for(var e=String(r).split(/\\n|\r\n|\r|\n|<br\s*\/?>/i),h=0,l=0;l<e.length;l++)e[l].length>h&&(h=e[l].length);return h*a*.5}function mC(r){var a=r.tasks,e="",h=0;function l(Wr){return Wr+"_"+h++}var C=r.styleSheet||null,b={gb:"task",gl:"task",gbj:"task",gsp:"separator",gsl:"separator",gd:"milestone",ga:"arrow",gm:"timeline",gt:"timeline",gnd:"timeline"},Z=null,v="";function er(Wr,ro){return H(C,["root","element","ganttDiagram",Wr],[],ro)}function X(Wr,ro,te){var ue=b[String(Wr).split("_")[0]];if(ue==null||C==null)return ro;var zo=te?"edge":ro.indexOf("text;")===0?"text":"vertex",nn=er(ue,zo);if(Z!=null)for(var Fa=0;Fa<Z.length;Fa++)delete nn[Z[Fa]];return M(ro,nn)}var V=function(Wr,ro,te,ue,zo,nn,Fa,Kn){if(String(Wr).indexOf("gsh_")===0){if(/fillColor=#F1E5E5;/.test(te)){var bn=er("closed","vertex");bn.fillColor&&(te=M(te,{fillColor:bn.fillColor}))}return $(Wr,ro,te,ue,zo,nn,Fa,Kn)}return $(Wr,ro,X(Wr,te,!1),ue,zo,nn,Fa,Kn)},tr=function(Wr,ro,te,ue,zo,nn,Fa,Kn){return B(Wr,ro,X(Wr,te,!0),ue,zo,nn,Fa,Kn)};if(a.length===0&&!r.projectStart)return"";var wr=!!r.projectStart,yr=wr&&r.printScale||"daily",fr={daily:1,weekly:4,monthly:15,quarterly:40,yearly:60},Ar=16/(fr[yr]||1)*(r.zoom||1),jr={},ce={},Nr=0,de=[!1,!1,!1,!1,!1,!1,!1],Fr=!1;if(r.projectStart&&r.closedWeekdays&&r.closedWeekdays.length){for(var Ir={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6},qe=0;qe<r.closedWeekdays.length;qe++){var To=Ir[r.closedWeekdays[qe]];To!==void 0&&(de[To]=!0,Fr=!0)}de.join()==="true,true,true,true,true,true,true"&&(Fr=!1)}var ne=r.projectStart?new Date(r.projectStart+"T00:00:00Z").getUTCDay():1,po={},ao={},A=Fr;function J(Wr){var ro=Math.floor(Wr);return ao[ro]?!1:po[ro]?!0:Fr&&de[(ne+ro%7+7)%7]}function ur(Wr){for(;J(Wr);)Wr++;return Wr}function Sr(Wr,ro){var te=ur(Wr);if(!A||ro<=0)return{s:te,e:te+ro};for(var ue=ro,zo=te;ue>0;)if(J(zo))zo++;else{var nn=Math.min(1,ue);ue-=nn,zo+=nn}return{s:te,e:zo}}function Er(Wr){if(!Wr||!r.projectStart)return null;var ro=Date.parse(Wr+"T00:00:00Z")-Date.parse(r.projectStart+"T00:00:00Z");return isNaN(ro)?null:Math.round(ro/864e5)}var qr={},z={},Mr={},Be=0,ye=null;r.today&&(ye=r.today.date?Er(r.today.date):r.today.offset);function Le(Wr){return Wr?Wr.date?Er(Wr.date):Wr.anchor==="D"?Wr.offset:Wr.anchor==="T"?ye==null?null:ye+Wr.offset:null:null}for(var _e=null,Ur=0;r.periods&&Ur<r.periods.length;Ur++){var yo=r.periods[Ur],fo=yo.from.afterPrev?_e==null?null:_e+1:Le(yo.from),he=yo.to.days!=null?fo==null?null:fo+yo.to.days-1:Le(yo.to);if(!(fo==null||he==null)){if(he<fo){var Te=fo;fo=he,he=Te}_e=he;for(var ae=fo;ae<=he;ae++)yo.color&&(qr[ae]=yo.color),yo.name&&(z[ae]=yo.name),yo.closed===!0?(po[ae]=!0,A=!0):yo.closed===!1&&(ao[ae]=!0);yo.name&&(Mr[yo.name]={s:fo,e:he+1,d:he-fo+1}),(yo.color||yo.name)&&(Be=Math.max(Be,he+1))}}ye!=null&&r.todayColor&&(qr[ye]=r.todayColor);for(var it in Mr)Mr.hasOwnProperty(it)&&(jr[it]=Mr[it]);var Gt=[],oo=[];function pt(Wr,ro){var te;for(te=ro-1;te>=0;te--)if(!a[te].isSeparator&&(a[te].name===Wr||a[te].alias===Wr))return te;for(te=ro+1;te<a.length;te++)if(!a[te].isSeparator&&(a[te].name===Wr||a[te].alias===Wr))return te;return null}function rt(Wr,ro){if(Wr==null)return null;var te=pt(Wr,ro);return te!=null?(jo(te),Gt[te]||null):Mr.hasOwnProperty(Wr)?Mr[Wr]:null}function jo(Wr){if(!oo[Wr]){oo[Wr]=1;var ro=0,te=a[Wr],ue;if(te.after&&(ue=rt(te.after,Wr))!=null)ro=ue.e,te.afterOffset&&(ro=te.afterWorking?Sr(ro,te.afterOffset).e:ro+te.afterOffset);else if(te.alignStart&&(ue=rt(te.alignStart,Wr))!=null)ro=ue.s;else if(te.startOffset!=null)ro=te.startOffset;else if(te.start&&r.projectStart){var zo=Er(te.start);zo!=null&&zo>0&&(ro=zo)}for(var nn=0;nn<te.predecessors.length;nn++){var Fa=rt(te.predecessors[nn].ref,Wr);Fa!=null&&Fa.e>ro&&(ro=Fa.e)}var Kn=te.duration;if(!Kn){var bn=null;te.endAlign&&(ue=rt(te.endAlign,Wr))!=null?bn=ue.e-1:te.endOffset!=null?bn=te.endOffset:te.end&&(bn=Er(te.end)),bn!=null&&bn>=ro&&(Kn=bn-ro+1)}if(!Kn&&!te.isMilestone&&(Kn=1),Kn&&te.resources&&te.resources.length>1){for(var Ve=0,Yo=0;Yo<te.resources.length;Yo++)Ve+=te.resources[Yo].pct>0?te.resources[Yo].pct:100;Ve>0&&(Kn=Kn*100/Ve)}var st=Sr(ro,Kn);Gt[Wr]={s:st.s,d:Kn,e:st.e},oo[Wr]=2}}for(var Qt=0;Qt<a.length;Qt++)a[Qt].isSeparator||jo(Qt);for(var Me=0;Me<a.length;Me++){var Io=Gt[Me];a[Me].isSeparator||Io==null||(jr[a[Me].name]=Io,ce[a[Me].name]=Me,a[Me].alias&&(jr[a[Me].alias]=Io,ce[a[Me].alias]=Me),Io.e>Nr&&(Nr=Io.e))}Nr=Math.ceil(Math.max(Nr,Be)),Nr<1&&(Nr=a.length===0?1:10);for(var Wo=!1,Ro=0;Ro<Nr;Ro++)z[Ro]&&(Wo=!0);var An=12.955,dn=4,rn=36.955;function Ao(Wr){return Wr*Ar}var _t;wr?yr==="weekly"?_t=27:yr==="monthly"||yr==="quarterly"?_t=28:yr==="yearly"?_t=17:_t=39:_t=6;var ft=_t;Wo&&wr&&yr!=="quarterly"&&yr!=="yearly"&&(_t+=16);for(var Se=wr?_t+2:18,Go=[],wt=[],cn=Se,No=!1,Me=0;Me<a.length;Me++){if(a[Me].isSeparator){Go[Me]=cn-(No?dn:0),wt[Me]=rn,cn=Go[Me]+rn,No=!1;continue}var oe=a[Me].isMilestone?1:AC(a[Me].name),Uo=oe*An;Go[Me]=cn,wt[Me]=Uo,cn+=Uo+dn,No=!0}for(var Ot=a.length?Go[a.length-1]+wt[a.length-1]:_t-(wr?2:10),ho=[],dt={},Aa=32,Sn=0;Sn<a.length;Sn++){var an=a[Sn],we=an.resources&&an.resources.length>0?an.resources:an.resource?[{name:an.resource,pct:100}]:[];if(!(an.isMilestone||an.isSeparator||we.length===0))for(var Eo=jr[an.name],Et=0;Et<we.length;Et++){var Cr=we[Et].name;dt[Cr]||(dt[Cr]={},ho.push(Cr));for(var Lr=Eo.s;Lr+1<=Eo.e+1e-9;Lr++)J(Lr)||(dt[Cr][Lr]=!0)}}var He=ho.length*Aa,Ie=Ot+He+(wr?2:10),Oe=Ao(Nr),so=null,Xo=[],qo=wr?new Date(r.projectStart+"T00:00:00Z"):null;function Yn(Wr){return new Date(qo.getTime()+Wr*864e5)}if(wr){var Nt=["Mo","Tu","We","Th","Fr","Sa","Su"],Da=(qo.getUTCDay()+6)%7;so=[];for(var je=0;je<Nr;je++)so[je]=Nt[(Da+je)%7],Xo[je]=String(Yn(je).getUTCDate())}else for(var _r=0;_r<Nr;_r++)Xo[_r]=String(_r+1);var Ho=["January","February","March","April","May","June","July","August","September","October","November","December"],Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ln(Wr){var ro=Yn(Wr),te=(ro.getUTCDay()+6)%7;ro=new Date(ro.getTime()+(3-te)*864e5);var ue=new Date(Date.UTC(ro.getUTCFullYear(),0,4)),zo=(ue.getUTCDay()+6)%7;return ue=new Date(ue.getTime()+(3-zo)*864e5),1+Math.round((ro.getTime()-ue.getTime())/(7*864e5))}var nt="endArrow=none;startArrow=none;strokeColor=#C0C0C0;strokeWidth=1;";function wo(Wr,ro,te){e+=tr(l("gg"),"",nt,ro,Wr,te,Wr,"1")}function xn(Wr,ro,te){e+=tr(l("gg"),"",nt,Wr,ro,Wr,te,"1")}function Lt(Wr,ro,te,ue,zo,nn,Fa,Kn,bn){for(var Ve=ro.length-1;Ve>=0;Ve--){var Yo=Uu(ro[Ve],Fa);if(Ve===0&&!bn||Yo<=ue-te){e+=V(l(Wr),ro[Ve],"text;html=1;align=center;verticalAlign=middle;fontSize="+Fa+";"+(Kn?"fontStyle=1;":"")+"fontColor=#000000;",te,zo,ue-te,nn,"1");return}}}function Ft(Wr){for(var ro=[],te=0,ue=null,zo=0;zo<=Nr;zo++){var nn=zo<Nr?Wr(Yn(zo)):null;(zo===Nr||ue!==null&&nn!==ue)&&(ro.push({s:te,e:zo,date:Yn(te)}),te=zo),ue=nn}return ro}function fe(Wr){return Wr.getUTCFullYear()*12+Wr.getUTCMonth()}function ge(Wr){return Wr.getUTCFullYear()}function qt(Wr){return Wr.getUTCFullYear()*4+Math.floor(Wr.getUTCMonth()/3)}function et(Wr,ro){for(var te=[],ue=0;ue<ro.length;ue++){var zo=ro[ue];te.push(zo==="myl"?Ho[Wr.getUTCMonth()]+" "+Wr.getUTCFullYear():zo==="mys"?Ce[Wr.getUTCMonth()]+" "+Wr.getUTCFullYear():zo==="ml"?Ho[Wr.getUTCMonth()]:Ce[Wr.getUTCMonth()])}return te}function en(Wr,ro,te,ue,zo,nn,Fa,Kn){for(var bn=0;bn<ro.length;bn++){var Ve=ro[bn];xn(Ao(Ve.s),te,te+ue),Lt(Wr,Fa(Ve.date),Ao(Ve.s),Ao(Ve.e),te,ue,zo,nn,Kn)}xn(Oe,te,te+ue)}for(var Zt=-1,qn=null,Ko=0;Ko<=Nr;Ko++){var Hn=null;Ko<Nr&&(qr[Ko]&&(Hn=Ff(qr[Ko])||null),!Hn&&J(Ko)&&(Hn="#F1E5E5")),Zt>=0&&Hn!==qn&&(e+=V(l("gsh"),"","rounded=0;fillColor="+qn+";strokeColor=none;",Ao(Zt),_t,Ao(Ko)-Ao(Zt),Ie-_t,"1"),Zt=-1),Hn&&Zt<0&&(Zt=Ko,qn=Hn)}if(Wo&&_t>ft)for(var aa=null,Je=0;Je<Nr;Je++){var sn=z[Je]||null;sn&&sn!==aa&&(e+=V(l("gnd"),sn,"text;html=1;align=left;verticalAlign=middle;fontSize=12;fontColor=#000000;",Ao(Je)-4,ft,Math.max(Uu(sn,12)+8,20),16,"1")),aa=sn}var Bn=yr==="weekly",$t;if(wr)if(yr==="daily"){for(var Pt=Ft(fe),ra=0;ra<Pt.length;ra++){var Ut=Pt[ra];Lt("gm",et(Ut.date,["ms","ml","myl"]),Ao(Ut.s),Ao(Ut.e),0,14,12,!0,!1),Lt("gm",et(Ut.date,["ms","ml","myl"]),Ao(Ut.s),Ao(Ut.e),Ie+29,14,12,!0,!1)}for(var Wn=0;Wn<=Nr;Wn++)xn(Ao(Wn),_t,Ie);for(wo(_t,0,Oe),wo(Ie,0,Oe),$t=0;$t<Nr;$t++)e+=V(l("gt"),so[$t],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Ao($t),14,Ar,12,"1"),e+=V(l("gt"),Xo[$t],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Ao($t),26,Ar,12,"1"),e+=V(l("gt"),so[$t],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Ao($t),Ie+1,Ar,12,"1"),e+=V(l("gt"),Xo[$t],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Ao($t),Ie+15,Ar,12,"1")}else if(Bn){var yt=Ft(fe);en("gm",yt,0,16,12,!0,function(Wr){return et(Wr,["ms","mys"])},!1),wo(0,0,Oe),wo(16,0,Oe),wo(27,0,Oe);for(var Zn=0;Zn<Nr;Zn++)if((ne+Zn)%7===1&&(xn(Ao(Zn),16,Ie),Zn<Nr-1)){var on=String(ln(Zn));e+=V(l("gt"),on,"text;html=1;align=left;verticalAlign=middle;fontSize=10;fontColor=#000000;",Ao(Zn)+5,16,Math.max(Uu(on,10)+4,12),11,"1")}xn(Oe,16,Ie),wo(Ie,0,Oe),en("gm",yt,Ie,16,12,!0,function(Wr){return et(Wr,["ms","mys"])},!1),wo(Ie+16,0,Oe)}else if(yr==="monthly"||yr==="quarterly"){var va=Ft(ge),ga=Ft(yr==="monthly"?fe:qt),jn=yr==="monthly"?function(Wr){return et(Wr,["ms","ml"])}:function(Wr){return["Q"+(Math.floor(Wr.getUTCMonth()/3)+1)]},Fn=function(Wr){return[String(Wr.getUTCFullYear())]};en("gm",va,0,16,12,!0,Fn,!1),en("gt",ga,16,12,10,!1,jn,!1),wo(0,0,Oe),wo(16,0,Oe),wo(28,0,Oe),wo(Ie,0,Oe),en("gt",ga,Ie,12,10,!1,jn,!1),en("gm",va,Ie+12,16,12,!0,Fn,!1),wo(Ie+12,0,Oe),wo(Ie+28,0,Oe)}else{var Mn=Ft(ge),la=function(Wr){return[String(Wr.getUTCFullYear())]};en("gm",Mn,0,17,14,!0,la,!0),wo(0,0,Oe),wo(17,0,Oe),wo(Ie,0,Oe),en("gm",Mn,Ie,17,14,!0,la,!0),wo(Ie+17,0,Oe)}else{for(var mo=0;mo<=Nr;mo++)xn(Ao(mo),_t,Ie);for($t=0;$t<Nr;$t++)e+=V(l("gt"),Xo[$t],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Ao($t),0,Ar,12,"1"),e+=V(l("gt"),Xo[$t],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Ao($t),Ie-4,Ar,12,"1")}for(var Tn="endArrow=none;startArrow=none;strokeColor=#181818;strokeWidth=1;",gt=0;gt<a.length;gt++){var Rt=a[gt];if(Rt.isSeparator){var Jt=Go[gt]+12+An/2,ct=er("separator","vertex");if(ct.fillColor&&ct.fillColor!=="none"&&(v+=$(l("gsb"),"","rounded=0;fillColor="+ct.fillColor+";strokeColor=none;",0,Go[gt],Oe,wt[gt],"1")),Rt.name){var wn=Uu(Rt.name,11);e+=tr(l("gsp"),"",Tn,0,Jt,5,Jt,"1"),e+=tr(l("gsp"),"",Tn,10+wn+5,Jt,Oe-1,Jt,"1"),e+=V(l("gsl"),Rt.name,"text;html=1;align=left;verticalAlign=middle;fontSize=11;fontColor=#000000;",10,Go[gt]+12,wn+4,An,"1")}else e+=tr(l("gsp"),"",Tn,0,Jt,Oe,Jt,"1");continue}if(!Rt.isMilestone){var In=jr[Rt.name],ko=Ao(In.s)+2,Do=Math.max(Ao(In.e)-2,ko+1),Rr=Go[gt],xr=wt[gt],br="#181818";Rt.color&&Rt.color.indexOf("/")>=0?br=Ff(Rt.color.split("/")[1])||"#181818":Rt.color&&(br=Ff(Rt.color)||"#181818");var Br=r.monochrome?"#E3E3E3":"#E2E2F0";Rt.color&&(Br=Ff(Rt.color.split("/")[0])||Br),Rt.progress===0&&!Rt.color&&(Br="#FFFFFF");for(var Pr=Rt.progress!=null&&Rt.progress>0&&Rt.progress<100&&!Rt.color,Xe=Rt.resources&&Rt.resources.length>0?Rt.resources:Rt.resource?[{name:Rt.resource,pct:100}]:[],zr=Rt.name,Ke=0;Ke<Xe.length;Ke++)zr+=" {"+Xe[Ke].name+(Xe[Ke].pct!==100?":"+Xe[Ke].pct+"%":"")+"}";for(var De=Uu(zr,11),ze=Ao(In.e)-6-(Ao(In.s)+6)>De,So=[],ot=ko,ve=Math.floor(In.s);ve<In.e;ve++)if(J(ve)){var Yt=Ao(ve),At=Ao(ve+1);Yt>ot&&So.push({x1:ot,x2:Math.min(Yt,Do)}),ot=Math.max(ot,At)}ot<Do&&So.push({x1:ot,x2:Do}),So.length===0&&So.push({x1:ko,x2:Do});var ht=ze&&So.length===1?zr:"";if(Z=Rt.color?["fillColor","gradientColor","strokeColor"]:null,So.length===1){var Vt=So[0].x1,Pn=So[0].x2-So[0].x1;if(Pr){var Ae=Math.round(Pn*Rt.progress/100),Fe=Pn-Ae;e+=V(l("gb"),"","fillColor="+Br+";strokeColor=none;",Vt,Rr,Ae,xr,"1"),e+=V(l("gb"),"","fillColor=#FFFFFF;strokeColor=none;",Vt+Ae,Rr,Fe,xr,"1"),e+=V(l("gb"),ht,"fillColor=none;strokeColor="+br+";strokeWidth=1;fontSize=11;fontColor=#000000;align=left;spacingLeft=4;verticalAlign=middle;",Vt,Rr,Pn,xr,"1")}else e+=V(l("gb"),ht,"fillColor="+Br+";strokeColor="+br+";strokeWidth=1;fontSize=11;fontColor=#000000;align=left;spacingLeft=4;verticalAlign=middle;",Vt,Rr,Pn,xr,"1")}else{for(var le=0;le<So.length;le++){var Ne=So[le],Qe=le===0?"right=0;":le===So.length-1?"left=0;":"left=0;right=0;";if(e+=V(l("gb"),"","shape=partialRectangle;"+Qe+"fillColor="+Br+";strokeColor="+br+";strokeWidth=1;",Ne.x1,Rr,Ne.x2-Ne.x1,xr,"1"),le<So.length-1){var tn=Ne.x2+3,Vo=So[le+1].x1-3;Vo>tn&&(e+=tr(l("gbj"),"","endArrow=none;startArrow=none;strokeColor="+br+";strokeWidth=1;dashed=1;dashPattern=2 3;",tn,Rr,Vo,Rr,"1"),e+=tr(l("gbj"),"","endArrow=none;startArrow=none;strokeColor="+br+";strokeWidth=1;dashed=1;dashPattern=2 3;",tn,Rr+xr,Vo,Rr+xr,"1"))}}ze&&(e+=V(l("gl"),zr,"text;html=1;align=left;verticalAlign=middle;fontSize=11;fontColor=#000000;",Ao(In.s)+6-4,Rr,De+8,xr,"1"))}Z=null,ze||(e+=V(l("gl"),zr,"text;html=1;align=left;verticalAlign=middle;fontSize=11;fontColor=#000000;",Ao(In.e)-6+8-4,Rr,Math.max(De+8,18),xr,"1"))}}for(var xo=0;xo<a.length;xo++){var Co=a[xo];if(Co.isMilestone){var mn=Co.after?jr[Co.after]:null,pn;if(mn)pn=Ao(mn.e);else{var hn=jr[Co.alias]||jr[Co.name];if(!hn)continue;pn=Ao(hn.s)}e+=V(l("gd"),"","rhombus;fillColor=#000000;strokeColor=#000000;",pn-13,Go[xo],10,10,"1"),e+=V(l("gd"),Co.name,"text;html=1;align=left;verticalAlign=middle;fontSize=11;fontColor=#000000;",pn,Go[xo],Math.max(Uu(Co.name,11)+4,18),wt[xo],"1")}}for(var Dt=0;Dt<ho.length;Dt++){var ca=Ot+Dt*Aa,ea=ca+20;e+=V(l("gr"),ho[Dt],"text;html=1;align=left;verticalAlign=middle;fontSize=13;fontFamily=Serif;fontColor=#000000;",0,ca+5,80,14,"1"),e+=tr(l("gr"),"","endArrow=none;startArrow=none;strokeColor=#000000;strokeWidth=1;",0,ea,Oe,ea,"1");for(var me=dt[ho[Dt]],ie=0;ie<Nr;ie++)me[ie]&&(e+=V(l("gr"),"100","text;html=1;align=center;verticalAlign=middle;fontSize=9;fontFamily=Serif;fontColor=#000000;",Ao(ie),ea,Ar,10,"1"))}for(var pe=0;pe<a.length;pe++){var ke=a[pe];if(!(ke.isMilestone||ke.isSeparator||Gt[pe]==null)){var Re=ke.predecessors.slice();ke.after&&Re.unshift({ref:ke.after});for(var $o=0;$o<Re.length;$o++){var Jo=Re[$o];if(!(Jo.hidden||!jr[Jo.ref]||ce[Jo.ref]==null)){var Wt=ce[Jo.ref],at=jr[Jo.ref],Nn=Gt[pe],ia=Ao(at.e),sa=Go[Wt]+wt[Wt],ka=Go[pe]+wt[pe]/2,Po=ka<sa?Go[Wt]:sa,Ct=ia-8,bt=Ao(Nn.s)-1,Vr=Jo.color?Ff(Jo.color):null,to="strokeColor="+(Vr||"#181818")+";strokeWidth="+(Jo.bold?"2.5":"1.5")+";"+(Jo.dotted?"dashed=1;fixDash=1;dashPattern=1 3;":Jo.dashed?"dashed=1;fixDash=1;dashPattern=7 7;":"");Z=Vr?["strokeColor"]:null,e+=tr(l("ga"),"","endArrow=none;startArrow=none;"+to,Ct,Po,Ct,ka,"1"),e+=tr(l("ga"),"","endArrow=block;endFill=1;endSize=2.5;startArrow=none;"+to,Ct,ka,bt,ka,"1"),Z=null}}}}var Xt=er("timeline","vertex");if(Xt.fillColor&&Xt.fillColor!=="none"){var ha="rounded=0;fillColor="+Xt.fillColor+";strokeColor=none;";v=$(l("gtb"),"",ha,0,0,Oe,_t,"1")+$(l("gtb"),"",ha,0,Ie,Oe,ft,"1")+v}return v+e}function kC(r){var a=[],e="",h=0,l=r.timeMarks||[],C=r.styleSheet||null,b=null,Z={tg:"timegrid",tm:"arrow",tml:"arrow",tcn:"constraintArrow",tcl:"constraintArrow",tax:"timeline",tk:"timeline",tal:"timeline",thl:"highlight",thll:"highlight"};function v(Ae,Fe,le){if(C==null)return Fe;var Ne=String(Ae).split("_")[0],Qe=b!=null&&(le?Ne==="tw"||Ne==="tv":Ne!=="tt"),tn=Z[Ne]!=null?[Z[Ne]]:Qe?[b]:[],Vo=le?"edge":Fe.indexOf("text;")===0?"text":"vertex",xo=H(C,["root","element","timingDiagram"].concat(tn),[],Vo);return Vo==="vertex"&&Ne!=="tc"&&Ne!=="thl"&&(delete xo.fillColor,delete xo.gradientColor),Ne==="thl"&&(delete xo.strokeColor,delete xo.strokeWidth),Ne==="thll"&&(delete xo.fontColor,delete xo.fontSize,delete xo.fontFamily,delete xo.fontStyleBits),M(Fe,xo)}for(var er=function(Ae,Fe,le,Ne,Qe,tn,Vo,xo){return $(Ae,Fe,v(Ae,le,!1),Ne,Qe,tn,Vo,xo)},X=function(Ae,Fe,le,Ne,Qe,tn,Vo,xo){return B(Ae,Fe,v(Ae,le,!0),Ne,Qe,tn,Vo,xo)},V=0;V<r.signals.length;V++){var tr=r.signals[V];a.push({name:tr.name,alias:tr.alias,kind:tr.kind,period:tr.period,transitions:tr.transitions.slice()})}function wr(Ae){return Ae+"_"+h++}if(a.length===0&&l.length===0)return"";var yr=10,fr=14,Ar=12,jr=11,ce=26,Nr="#333333",de=r.monochrome?"#292929":"#006400",Fr=r.monochrome?"#3A3A3A":"#006400",Ir=r.monochrome?"#E3E3E3":"#E2E2F0",qe=r.monochrome?"#292929":"#333333";function To(Ae,Fe){return"endArrow=none;startArrow=none;strokeColor="+Nr+";strokeWidth="+Ae+";"+(Fe?"dashed=1;dashPattern=3 5;":"")}function ne(Ae,Fe){return String(Ae).length*Fe*.55}function po(Ae,Fe,le,Ne,Qe,tn,Vo,xo){var Co=Qe+6,mn=Ne-Co/2-Qe*.335,pn=Math.max(ne(Fe,Qe)+8,8),hn="text;html=1;strokeColor=none;fillColor=none;fontSize="+Qe+";fontColor="+Vo+";align="+(xo||"left")+";verticalAlign=middle;"+(tn?"fontStyle=1;":"");return er(wr(Ae),Fe,hn,le,mn,pn,Co,"1")}var ao=[],A,J;function ur(Ae){ao.indexOf(Ae)<0&&ao.push(Ae)}for(A=0;A<a.length;A++){for(J=0;J<a[A].transitions.length;J++)ur(a[A].transitions[J].time);a[A].kind==="clock"&&a[A].period>0&&ur(a[A].period)}for(J=0;J<l.length;J++)ur(l[J]);ao.length===0&&ao.push(0),ao.sort(function(Ae,Fe){return Ae-Fe});var Sr=ao[0],Er=ao[ao.length-1];Er>0&&Sr<0&&ao.indexOf(0)<0&&(ao.push(0),ao.sort(function(Ae,Fe){return Ae-Fe}));var qr=Er-Sr,z=50,Mr;function Be(Ae,Fe){for(;Fe!==0;){var le=Ae%Fe;Ae=Fe,Fe=le}return Math.abs(Ae)}function ye(Ae){return Ae<0?Math.ceil(Ae):Math.floor(Ae)}function Le(Ae){return(Ae<10?"0":"")+Ae}var _e=["January","February","March","April","May","June","July","August","September","October","November","December"],Ur=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function yo(Ae,Fe){var le=new Date(Fe*1e3);return Ae.replace(/'([^']*)'|y{1,4}|M{1,4}|d{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|E{1,4}/g,function(Ne,Qe){if(Qe!=null)return Qe;var tn=le.getUTCHours()%12||12;switch(Ne){case"yyyy":case"yyy":case"y":return String(le.getUTCFullYear());case"yy":return Le(le.getUTCFullYear()%100);case"MMMM":return _e[le.getUTCMonth()];case"MMM":return _e[le.getUTCMonth()].substring(0,3);case"MM":return Le(le.getUTCMonth()+1);case"M":return String(le.getUTCMonth()+1);case"dd":return Le(le.getUTCDate());case"d":return String(le.getUTCDate());case"HH":return Le(le.getUTCHours());case"H":return String(le.getUTCHours());case"hh":return Le(tn);case"h":return String(tn);case"mm":return Le(le.getUTCMinutes());case"m":return String(le.getUTCMinutes());case"ss":return Le(le.getUTCSeconds());case"s":return String(le.getUTCSeconds());case"EEEE":return Ur[le.getUTCDay()];default:return Ur[le.getUTCDay()].substring(0,3)}})}function fo(Ae){var Fe=ye(Ae);if(r.dateFormat)return yo(r.dateFormat,Fe);if(r.timeFormat==="hour")return Math.floor(Fe/3600)+":"+Le(Math.floor(Fe/60)%60)+":"+Le(Fe%60);if(r.timeFormat==="date"){var le=new Date(Fe*1e3);return Le(le.getUTCMonth()+1)+"/"+Le(le.getUTCDate())}return String(Fe)}if(r.scale&&r.scale.tick>0&&r.scale.pixel>0)Mr=r.scale.tick,z=r.scale.pixel;else{var he=0;for(J=0;J<ao.length;J++){var Te=Math.abs(ye(ao[J]));Te>0&&(he=he===0?Te:Be(he,Te))}Mr=he>0?he:1,Mr===1&&(qr+1)*z>4e3&&(Mr=Math.round(1+z*qr/4e3))}var ae=Math.min(1e3,1+Math.floor(qr/Mr)),it=(qr/Mr+1)*z,Gt=Er+Mr,oo=0;for(A=0;A<a.length;A++){var pt=a[A];if(pt.kind==="robust")for(J=0;J<pt.transitions.length;J++)oo=Math.max(oo,ne(pt.transitions[J].state,Ar));else pt.kind==="binary"&&(oo=Math.max(oo,ne(pt.name,fr)+5))}var rt=yr+5+oo;function jo(Ae){return rt+(Ae-Sr)/Mr*z}for(var Qt=rt+it,Me=yr,Io=yr,Wo=Qt+5,Ro=r.constraints&&r.constraints.length>0,An=[],dn="",rn=Io,Ao=0,_t=Io,ft=0;ft<a.length;ft++){var Se=a[ft],Go=_t;b=Se.kind||null;var wt=Ro&&ft===0?ce:Se.kind==="robust"?10:5,cn,No={kind:Se.kind,transitions:Se.transitions,rows:{}};if(An.push(No),Se.kind!=="binary"){dn+=po("tt",Se.name,yr+1,Go+15,fr,!0,"#333333","left");var oe=Go+20,Uo=yr+5+ne(Se.name,fr)+1;dn+=X(wr("tu"),"",To(.5),Me,oe,Uo,oe,"1"),dn+=X(wr("td"),"",To(.5),Uo,oe,Uo+10,Go,"1")}if(Se.kind==="robust"){var Ot=[],ho;for(ho=0;ho<Se.transitions.length;ho++)!Se.transitions[ho].hidden&&Ot.indexOf(Se.transitions[ho].state)<0&&Ot.push(Se.transitions[ho].state);var dt=Math.max(Ot.length,1),Aa=Go+20+wt,Sn=No.rows;for(ho=0;ho<Ot.length;ho++){var an=Aa+(Ot.length-1-ho)*20;Sn[Ot[ho]]=an,dn+=po("tl",Ot[ho],yr+1,an+5,Ar,!1,"#333333","left")}for(ho=0;ho<Se.transitions.length;ho++){var we=Se.transitions[ho];if(!we.hidden){var Eo=ho+1<Se.transitions.length?Se.transitions[ho+1]:null,Et=jo(we.time),Cr=Eo?jo(Eo.time):Qt,Lr=Sn[we.state];dn+=X(wr("tw"),"","endArrow=none;startArrow=none;strokeColor="+de+";strokeWidth=2;",Et,Lr,Cr,Lr,"1"),Eo&&!Eo.hidden&&Sn[Eo.state]!==Lr&&(dn+=X(wr("tv"),"","endArrow=none;startArrow=none;strokeColor="+de+";strokeWidth=2;",Cr,Lr,Cr,Sn[Eo.state],"1"))}}cn=Aa+(dt-1)*20+15}else if(Se.kind==="concise"||Se.kind==="rectangle"){var He=Go+20+wt,Ie=24,Oe=Se.kind==="rectangle"?"rounded=0;fillColor=#F1F1F1;strokeColor=#F1F1F1;strokeWidth=0.5;fontSize=12;fontStyle=1;fontColor=#333333;align=center;":"shape=hexagon;perimeter=hexagonPerimeter2;fixedSize=1;size=12;fillColor="+Ir+";strokeColor="+Fr+";strokeWidth=1.5;fontSize=12;fontStyle=1;fontColor=#333333;align=center;";No.bandTop=He,No.bandH=Ie,ft===0&&Ro&&(Ao=He);for(var so=0;so<Se.transitions.length;so++){var Xo=Se.transitions[so];if(!Xo.hidden){var qo=so+1<Se.transitions.length?Se.transitions[so+1]:null,Yn=jo(Xo.time),Nt=qo?jo(qo.time):Qt;Nt>Yn&&(dn+=er(wr("tc"),Xo.state,Oe,Yn,He,Nt-Yn,Ie,"1"))}}cn=He+Ie+10}else if(Se.kind==="clock"){var Da=Se.period||100,je=Da/2,_r=Go+27,Ho=Go+41;dn+=X(wr("tw"),"","endArrow=none;startArrow=none;strokeColor="+de+";strokeWidth=1.5;",jo(0),_r,jo(0),Ho,"1");for(var Ce=!0,ln=0,nt=0;nt<Gt&&ln<2e3;nt+=je,ln++){var wo=jo(nt),xn=jo(Math.min(nt+je,Gt)),Lt=Ce?_r:Ho;if(xn>wo&&(dn+=X(wr("tw"),"","endArrow=none;startArrow=none;strokeColor="+de+";strokeWidth=1.5;",wo,Lt,xn,Lt,"1")),nt+je<=Gt){var Ft=Ce?Ho:_r;dn+=X(wr("tv"),"","endArrow=none;startArrow=none;strokeColor="+de+";strokeWidth=1.5;",xn,Lt,xn,Ft,"1")}Ce=!Ce}cn=Ho+8}else if(Se.kind==="binary"){var fe=Go+8,ge=Go+22;No.rows.high=fe,No.rows.low=ge,dn+=po("tl",Se.name,yr+1,(fe+ge)/2+5,fr,!0,"#333333","left");for(var qt=0;qt<Se.transitions.length;qt++){var et=Se.transitions[qt];if(!et.hidden){var en=qt+1<Se.transitions.length?Se.transitions[qt+1]:null,Zt=jo(et.time),qn=en?jo(en.time):Qt,Ko=et.state==="high"||et.state==="1",Hn=Ko?fe:ge;if(dn+=X(wr("tw"),"","endArrow=none;startArrow=none;strokeColor="+de+";strokeWidth=2;",Zt,Hn,qn,Hn,"1"),en&&!en.hidden){var aa=en.state==="high"||en.state==="1",Je=aa?fe:ge;Je!==Hn&&(dn+=X(wr("tv"),"","endArrow=none;startArrow=none;strokeColor="+de+";strokeWidth=2;",qn,Hn,qn,Je,"1"))}}}cn=ge+8}else cn=Go+30;ft<a.length-1?(dn+=X(wr("ts"),"",To(.5),Me,cn,Wo,cn,"1"),_t=cn):rn=cn}b=null,e+=X(wr("tb"),"",To(.5),Me,Io,Wo,Io,"1"),e+=X(wr("tb"),"",To(.5),Me,Io,Me,rn,"1"),e+=X(wr("tb"),"",To(.5),Wo,Io,Wo,rn,"1");for(var sn=0;sn<=ae;sn++){var Bn=rt+sn*z;e+=X(wr("tg"),"",To(.5,!0),Bn,Io,Bn,rn,"1")}if(r.highlights&&r.highlights.length>0)for(var $t=0;$t<r.highlights.length;$t++){var mo=r.highlights[$t],Pt=jo(mo.from),ra=jo(mo.to),Ut=Y(mo.color)||"#FFD700";e+=er(wr("thl"),"","shape=rectangle;fillColor="+Ut+";strokeColor=none;opacity=45;",Pt,Io,ra-Pt,rn-Io,"1"),mo.label&&(e+=po("thll",mo.label,(Pt+ra)/2-(ne(mo.label,Ar)+8)/2,Io+14,Ar,!1,"#000000","center"))}if(e+=dn,Ro&&Ao>0)for(var Wn=0;Wn<r.constraints.length;Wn++){var yt=r.constraints[Wn],Zn=jo(yt.from)+1,on=jo(yt.to)-1,va=Ao-11;e+=X(wr("tcn"),"","startArrow=block;endArrow=block;startFill=1;endFill=1;strokeColor="+qe+";strokeWidth=1.5;",Zn,va,on,va,"1"),e+=po("tcl",yt.label,(Zn+on)/2-ne(yt.label,Ar)/2-4,va-8.5,Ar,!1,qe,"center")}function ga(Ae,Fe){var le=Ae.transitions,Ne=[],Qe;function tn(xo){return Ae.kind==="binary"?xo.state==="high"||xo.state==="1"?Ae.rows.high:Ae.rows.low:xo.hidden?null:Ae.rows[xo.state]}if(Ae.kind==="robust"||Ae.kind==="binary"){if(le.length===0)return null;for(Qe=0;Qe<le.length;Qe++){if(le[Qe].time===Fe){Qe>0&&Ne.push(tn(le[Qe-1])),Ne.push(tn(le[Qe]));break}if(le[Qe].time>Fe){Ne.push(tn(le[Qe===0?0:Qe-1]));break}}Ne.length===0&&Ne.push(tn(le[le.length-1]))}else if(Ae.kind==="concise"||Ae.kind==="rectangle"){for(Qe=0;Qe<le.length;Qe++)le[Qe].time===Fe&&Ne.push(Ae.bandTop+Ae.bandH/2);Ne.length===0&&Ne.push(Ae.bandTop,Ae.bandTop+Ae.bandH)}else return null;var Vo=[];for(Qe=0;Qe<Ne.length;Qe++)Ne[Qe]!=null&&Vo.indexOf(Ne[Qe])<0&&Vo.push(Ne[Qe]);return Vo.length>0?Vo:null}for(var jn=r.monochrome?"#292929":"#00008B",Fn=0;r.messages&&Fn<r.messages.length;Fn++){var Mn=r.messages[Fn],la=An[Mn.from],Tn=An[Mn.to],gt=la?ga(la,Mn.fromTime):null,Rt=Tn?ga(Tn,Mn.toTime):null;if(!(!gt||!Rt)){for(var Jt=jo(Mn.fromTime),ct=jo(Mn.toTime),wn=null,In=0;In<gt.length;In++)for(var ko=0;ko<Rt.length;ko++){var Do=Math.sqrt((ct-Jt)*(ct-Jt)+(Rt[ko]-gt[In])*(Rt[ko]-gt[In]));(wn===null||Do<wn.len)&&(wn={y1:gt[In],y2:Rt[ko],len:Do})}if(e+=X(wr("tm"),"","endArrow=block;endFill=1;endSize=8;startArrow=none;strokeColor="+jn+";strokeWidth=1.5;",Jt,wn.y1,ct,wn.y2,"1"),Mn.label){var Rr=Math.atan2(ct-Jt,wn.y2-wn.y1),xr=20*Math.PI/180,br=(ct-Math.sin(Rr+xr)*8+ct-Math.sin(Rr-xr)*8)/2,Br=(wn.y2-Math.cos(Rr+xr)*8+wn.y2-Math.cos(Rr-xr)*8)/2,Pr=fr+2.6,Xe=wn.y1<wn.y2?Br-Pr:Br;e+=po("tml",Mn.label,br-2,Xe+13.6,fr,!1,jn,"left").replace("text;html=1;","text;html=1;fontFamily=Serif;")}}}var zr=r.timeAxis!=="hidden";if(zr){var Ke=Er;for(J=0;J<ao.length;J++)if(ao[J]>=0){Ke=ao[J];break}for(var De=jo(Ke),ze=0;ze<=1e3&&De+ze*z<=Qt+1e-6;)ze++;e+=X(wr("tax"),"",To(2),De,rn,De+Math.max(ze-1,0)*z,rn,"1");var So=[],ot=[],ve;if(r.timeAxis==="manual")for(J=0;J<ao.length;J++){var Yt=null;for(var At in r.codes||{})r.codes.hasOwnProperty(At)&&r.codes[At]===ao[J]&&(Yt=At);ot.push(jo(ao[J])),So.push({x:jo(ao[J]),text:Yt??fo(ao[J])})}else{for(ve=0;ve<ze;ve++)ot.push(De+ve*z);var ht=[];if(r.scale)for(ve=0;ve<=ae;ve++)ht.push(Mr*ve+ye(Sr));else for(J=0;J<ao.length;J++){var Vt=ye(ao[J]);ht.indexOf(Vt)<0&&ht.push(Vt)}for(ht.sort(function(Ae,Fe){return Ae-Fe}),ht[0]<0&&ht[ht.length-1]>0&&ht.indexOf(0)<0&&ht.push(0),ve=0;ve<ht.length;ve++)So.push({x:jo(ht[ve]),text:fo(ht[ve])})}for(ve=0;ve<ot.length;ve++)e+=X(wr("tk"),"",To(2),ot[ve],rn,ot[ve],rn+5,"1");for(ve=0;ve<So.length;ve++)e+=po("tal",So[ve].text,So[ve].x-(ne(So[ve].text,jr)+8)/2,rn+17.5,jr,!1,"#333333","center")}var Pn=zr?rn+21:rn+5;return e=er(wr("tanchor"),"","shape=text;strokeColor=none;fillColor=none;",Me-6,Io-6,Wo-Me+19,Pn-Io+12,"1")+e,e}var Wl=14.1328,_C=11.6,oh="endArrow=none;startArrow=none;strokeColor=#000000;strokeWidth=1;",th="endArrow=none;startArrow=none;strokeColor=#000000;strokeWidth=1.5;",OC="text;html=1;align=left;verticalAlign=middle;fontSize=12;fontColor=#000000;",FC={" ":278,"!":278,'"':355,"#":556,$:556,"%":889,"&":667,"'":191,"(":333,")":333,"*":389,"+":584,",":278,"-":333,".":278,"/":278,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,":":278,";":278,"<":584,"=":584,">":584,"?":556,"@":1015,A:667,B:667,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:500,K:667,L:556,M:833,N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611,"[":278,"\\":278,"]":278,"^":469,_:556,"`":333,a:556,b:556,c:500,d:556,e:556,f:278,g:556,h:556,i:222,j:222,k:500,l:222,m:833,n:556,o:556,p:556,q:556,r:333,s:500,t:278,u:556,v:500,w:722,x:500,y:500,z:500,"{":334,"|":260,"}":334,"~":584};function hs(r,a){if(!r)return 0;for(var e=0,h=0;h<r.length;h++){var l=FC[r.charAt(h)];l==null&&(l=556),e+=l}return e=e*.013,a&&(e*=1.05),e}function bC(r){var a="",e="",h=0;function l(A){return A+"_"+h++}if(!r.root)return"";function C(A,J,ur,Sr,Er){return s(l("sl"),A,OC+(Er?"fontStyle=1;":""),J-4,ur+_C-12.83,Sr+4,17.6,"1")}function b(A,J,ur,Sr){return G(l("sh"),"",Sr||oh,A,J,A+ur,J,"1")}function Z(A,J,ur,Sr){return G(l("sv"),"",Sr||oh,A,J,A,J+ur,"1")}function v(A,J){return{w:hs(A,J),h:Wl}}function er(A){return Math.max(hs(A.text,A.bold),(A.charLength||0)*8)}function X(A){if(!A)return{w:0,h:0};if(A.dim)return A.dim;var J,ur;switch(A.type){case"text":J=v(A.display,A.bold);break;case"empty":J={w:1,h:1};break;case"button":J={w:er(A)+9,h:Wl+9};break;case"textfield":J={w:er(A)+6,h:Wl+2};break;case"check":J={w:hs(A.text,A.bold)+20,h:Wl};break;case"droplist":J={w:er(A)+16,h:Wl+4};break;case"line":J={w:10,h:6};break;case"image":J={w:A.rows.length>0?A.rows[0].length:0,h:A.rows.length};break;case"tabbar":for(J={w:0,h:0},ur=0;ur<A.tabs.length;ur++){var Sr=hs(A.tabs[ur].text,A.tabs[ur].bold);A.vertical?(J.h+=Wl+15,J.w=Math.max(J.w,Sr)):(J.w+=Sr+15,J.h=Math.max(J.h,Wl))}break;case"menubar":for(J={w:0,h:0},ur=0;ur<A.entries.length;ur++){var Er=V(A.entries[ur]);J.w+=Er.w+10,J.h=Math.max(J.h,Er.h)}break;case"tree":J=yr(A);break;case"border":J=fr(A);break;case"pyramid":J=jr(A);break;default:J={w:0,h:0}}return A.dim=J,J}function V(A){return A==="-"?{w:10,h:5}:v(A,!1)}function tr(A){for(var J={w:0,h:0},ur=0;ur<A.length;ur++){var Sr=V(A[ur]);J.w=Math.max(J.w,Sr.w),J.h+=Sr.h}return J}function wr(A){for(var J=0,ur=[],Sr=0;Sr<A.entries.length;Sr++){var Er=A.entries[Sr];J=Math.max(J,hs(Er.text,Er.bold)+Er.level*10);for(var qr=0;qr<Er.cells.length;qr++){var z=hs(Er.cells[qr].text,Er.cells[qr].bold);ur[qr]=Math.max(ur[qr]||0,z)}}return{w1:J,other:ur}}function yr(A){for(var J=wr(A),ur=0,Sr=0;Sr<J.other.length;Sr++)ur>0&&(ur+=10),ur+=J.other[Sr];return ur>0&&(ur+=10),{w:J.w1+ur+2,h:A.entries.length*Wl}}function fr(A){var J=X(A.north),ur=X(A.south),Sr=X(A.east),Er=X(A.west),qr=X(A.center);return{w:Math.max(J.w,ur.w,Er.w+qr.w+Sr.w),h:J.h+Math.max(Er.h,qr.h,Sr.h)+ur.h}}function Ar(A){if(A.grid)return A.grid;var J=A.title?Wl:0,ur=[],Sr=[],Er;for(Er=0;Er<=A.rows;Er++)ur.push(J/2);for(Er=0;Er<=A.cols;Er++)Sr.push(0);var qr=A.cells.slice().sort(function(Te,ae){var it=Te.maxCol-Te.minCol-(ae.maxCol-ae.minCol);return it!==0?it:Te.minCol-ae.minCol});for(Er=0;Er<qr.length;Er++){var z=qr[Er],Mr=X(z.el).w+2,Be=Mr-(Sr[z.maxCol+1]-Sr[z.minCol]);if(Be>0)for(var ye=z.maxCol+1;ye<Sr.length;ye++)Sr[ye]+=Be}var Le=A.cells.slice().sort(function(Te,ae){var it=Te.maxRow-Te.minRow-(ae.maxRow-ae.minRow);return it!==0?it:Te.minRow-ae.minRow});for(Er=0;Er<Le.length;Er++){var _e=Le[Er],Ur=_e.minRow===0?J/2:0,yo=X(_e.el).h+Ur+2,fo=yo-(ur[_e.maxRow+1]-ur[_e.minRow]);if(fo>0)for(var he=_e.maxRow+1;he<ur.length;he++)ur[he]+=fo}return A.grid={rowsStart:ur,colsStart:Sr,titleH:J},A.grid}function jr(A){var J=Ar(A),ur={w:J.colsStart[J.colsStart.length-1],h:J.rowsStart[J.rowsStart.length-1]+J.titleH};return A.scroll==="h"?ur.h+=30:A.scroll==="v"?ur.w+=30:A.scroll==="both"&&(ur.w+=30,ur.h+=30),ur}function ce(A,J,ur,Sr,Er){if(A){var qr=X(A),z;switch(A.type){case"text":A.show&&A.display&&(a+=C(A.display,J,ur,qr.w,A.bold));break;case"button":a+=s(l("sb"),A.text||"","rounded=1;absoluteArcSize=1;arcSize=10;fillColor=#EEEEEE;strokeColor=#000000;strokeWidth=2.5;fontSize=12;fontColor=#000000;align=center;"+(A.bold?"fontStyle=1;":""),J+2.5,ur+2.5,qr.w-5,qr.h-5,"1");break;case"textfield":var Mr=hs(A.text,A.bold);A.text&&(a+=C(A.text,J+3,ur,Mr,A.bold)),a+=b(J+1,ur+Wl,qr.w-3),a+=Z(J+1,ur+Wl-3,2),a+=Z(J+3+Mr+1,ur+Wl-3,2);break;case"check":A.text&&(a+=C(A.text,J+20,ur,qr.w-20,A.bold)),A.radio?(a+=s(l("sro"),"","ellipse;fillColor=none;strokeColor=#000000;strokeWidth=1.5;",J+2,ur+(qr.h-10)/2,10,10,"1"),A.checked&&(a+=s(l("sri"),"","ellipse;fillColor=#000000;strokeColor=#000000;strokeWidth=1.5;",J+5,ur+(qr.h-4)/2,4,4,"1"))):(a+=s(l("sco"),"","rounded=0;fillColor=none;strokeColor=#000000;strokeWidth=1.5;",J+2,ur+(qr.h-10)/2,10,10,"1"),A.checked&&(a+=G(l("sck"),"",th,J+3,ur+6,J+6,ur+9,"1"),a+=G(l("sck"),"",th,J+6,ur+9,J+13,ur,"1")));break;case"droplist":if(a+=s(l("sd"),A.text||"","rounded=0;fillColor=#EEEEEE;strokeColor=#000000;strokeWidth=1;fontSize=12;fontColor=#000000;align=left;verticalAlign=middle;spacingLeft=-2;"+(A.bold?"fontStyle=1;":""),J,ur,qr.w-1,qr.h-1,"1"),a+=Z(J+qr.w-12,ur,qr.h-1),a+=s(l("sdt"),"","triangle;direction=south;fillColor=#000000;strokeColor=#000000;strokeWidth=1;",J+qr.w-9,ur+6,6,Wl-8,"1"),A.open&&A.open.length>0){var Be={w:qr.w-1,h:0},ye;for(ye=0;ye<A.open.length;ye++)Be.w=Math.max(Be.w,hs(A.open[ye],!1)),Be.h+=Wl;for(a+=s(l("sdo"),"","rounded=0;fillColor=#EEEEEE;strokeColor=#000000;strokeWidth=1;",J,ur+qr.h-1,Be.w-1,Be.h-1,"1"),ye=0;ye<A.open.length;ye++)a+=C(A.open[ye],J,ur+qr.h-1+ye*Wl,hs(A.open[ye],!1),!1)}break;case"line":var Le=ur+Er/2,_e="endArrow=none;startArrow=none;strokeColor=#AAAAAA;strokeWidth=1;";A.ch==="="?(a+=b(J,Le-1,Sr,_e),a+=b(J,Le+1,Sr,_e)):A.ch==="."?a+=b(J,Le,Sr,_e+"dashed=1;dashPattern=1 2;"):A.ch==="-"?a+=b(J,Le,Sr,_e):a+=b(J,Le,Sr,"endArrow=none;startArrow=none;strokeColor=#AAAAAA;strokeWidth=1.5;");break;case"image":for(z=0;z<A.rows.length;z++)for(var Ur=A.rows[z],yo=-1,fo=0;fo<=Ur.length;fo++){var he=fo<Ur.length&&Ur.charAt(fo)==="X";he&&yo<0?yo=fo:!he&&yo>=0&&(a+=G(l("sim"),"","endArrow=none;startArrow=none;strokeColor=#000000;strokeWidth=1;",J+yo,ur+z+.5,J+fo,ur+z+.5,"1"),yo=-1)}break;case"tabbar":Nr(A,J,ur);break;case"menubar":de(A,J,ur,Sr,Er);break;case"tree":Fr(A,J,ur);break;case"border":var Te=X(A.north),ae=X(A.south),it=X(A.east),Gt=X(A.west);ce(A.north,J,ur,Sr,Er),ce(A.south,J,ur+Er-ae.h,Sr,Er),ce(A.west,J,ur+Te.h,Sr,Er),ce(A.east,J+Sr-it.w,ur+Te.h,Sr,Er),ce(A.center,J+Gt.w,ur+Te.h,Sr,Er);break;case"pyramid":qe(A,J,ur);break}}}function Nr(A,J,ur){for(var Sr=X(A),Er=J,qr=ur,z=0;z<A.tabs.length;z++){var Mr=A.tabs[z],Be=hs(Mr.text,Mr.bold);A.vertical?(a+=C(Mr.text,J,qr+2,Be,Mr.bold),a+=b(J,qr,Sr.w),a+=Z(J,qr,Wl+5),a+=b(J,qr+Wl+5,Sr.w),a+=Z(J+Sr.w,qr+Wl+5,10),qr+=Wl+15):(a+=C(Mr.text,Er+2,ur,Be,Mr.bold),a+=Z(Er,ur,Wl),a+=b(Er,ur,Be+5),a+=Z(Er+Be+5,ur,Wl),a+=b(Er+Be+5,ur+Wl,10),Er+=Be+15)}}function de(A,J,ur,Sr,Er){var qr=X(A),z=J;a+=s(l("smb"),"","rounded=0;fillColor=#DDDDDD;strokeColor=#000000;strokeWidth=1;",J,ur,Sr,Er,"1");for(var Mr=0;Mr<A.entries.length;Mr++){var Be=A.entries[Mr],ye=V(Be);if(A.popups.hasOwnProperty(Be)){e+=s(l("smh"),"","rounded=0;fillColor=#BBBBBB;strokeColor=none;",z,ur,ye.w,ye.h,"1");var Le=A.popups[Be],_e=tr(Le),Ur=ur+qr.h;e+=s(l("smp"),"","rounded=0;fillColor=#DDDDDD;strokeColor=#000000;strokeWidth=1;",z,Ur,_e.w,_e.h,"1");for(var yo=0;yo<Le.length;yo++){var fo=V(Le[yo]);Le[yo]==="-"?e+=b(z,Ur+fo.h/2,_e.w):e+=C(Le[yo],z,Ur,fo.w,!1),Ur+=fo.h}}Be!=="-"&&(a+=C(Be,z,ur,ye.w,!1)),z+=ye.w+10}}function Fr(A,J,ur){var Sr=wr(A),Er=X(A),qr=0,z=[0],Mr=[0,Sr.w1+5],Be=[],ye,Le=Sr.w1+5;for(ye=0;ye<Sr.other.length;ye++)Le+=Sr.other[ye]+10,Mr.push(Le);for(ye=0;ye<A.entries.length;ye++){var _e=A.entries[ye],Ur=_e.level*10;_e.text&&(a+=C(_e.text,J+Ur,ur+qr,hs(_e.text,_e.bold),_e.bold));for(var yo=Sr.w1+10,fo=0;fo<_e.cells.length;fo++)_e.cells[fo].text&&(a+=C(_e.cells[fo].text,J+yo,ur+qr,hs(_e.cells[fo].text,_e.cells[fo].bold),_e.cells[fo].bold)),yo+=(Sr.other[fo]||0)+10;Be.push({x:Ur-7,y:qr+Wl/2-1}),qr+=Wl,z.push(qr)}var he="endArrow=none;startArrow=none;strokeColor=#888888;strokeWidth=1;";for(ye=0;ye<Be.length;ye++){var Te=Be[ye];ye+1<Be.length&&Be[ye+1].x>Te.x&&(a+=s(l("stq"),"","rounded=0;fillColor=none;strokeColor=#888888;strokeWidth=1;",J+Te.x,ur+Te.y,2,2,"1"));for(var ae=null,it=0;it<ye;it++)Be[it].x<Te.x&&(ae=Be[it]);ae&&(a+=Z(J+ae.x+1,ur+ae.y+3,Te.y-ae.y-2,he),a+=b(J+ae.x+1,ur+Te.y+1,Te.x-ae.x-2,he))}A.strategy!==" "&&Ir(z,Mr,A.strategy,J,ur)}function Ir(A,J,ur,Sr,Er){var qr=J[0],z=J[J.length-1],Mr=A[0],Be=A[A.length-1],ye;if((ur==="+"||ur==="^")&&(a+=b(Sr+qr,Er+Mr,z-qr),a+=b(Sr+qr,Er+Be,z-qr),a+=Z(Sr+qr,Er+Mr,Be-Mr),a+=Z(Sr+z,Er+Mr,Be-Mr)),ur==="-"||ur==="#")for(ye=0;ye<A.length;ye++)a+=b(Sr+qr,Er+A[ye],z-qr);if(ur==="!"||ur==="#")for(ye=0;ye<J.length;ye++)a+=Z(Sr+J[ye],Er+Mr,Be-Mr)}function qe(A,J,ur){var Sr=Ar(A),Er=Sr.rowsStart,qr=Sr.colsStart,z=A.strategy,Mr={},Be={},ye,Le,_e;for(ye=0;ye<A.cells.length;ye++){var Ur=A.cells[ye],yo=Ur.minRow===0?Sr.titleH/2:0,fo=qr[Ur.maxCol+1]-qr[Ur.minCol]-1,he=Er[Ur.maxRow+1]-Er[Ur.minRow]-1;if(ce(Ur.el,J+qr[Ur.minCol]+1,ur+Er[Ur.minRow]+yo+1,fo,he),z==="-"||z==="#")for(Le=Ur.minCol;Le<=Ur.maxCol;Le++)Mr[Ur.minRow+","+Le]=!0,Mr[Ur.maxRow+1+","+Le]=!0;if(z==="!"||z==="#")for(_e=Ur.minRow;_e<=Ur.maxRow;_e++)Be[_e+","+Ur.minCol]=!0,Be[_e+","+(Ur.maxCol+1)]=!0}if(z==="+"||z==="^"||z==="#"){for(Le=0;Le<qr.length-1;Le++)Mr["0,"+Le]=!0,Mr[Er.length-1+","+Le]=!0;for(_e=0;_e<Er.length-1;_e++)Be[_e+",0"]=!0,Be[_e+","+(qr.length-1)]=!0}var Te;for(Te in Mr)if(Mr.hasOwnProperty(Te)){var ae=Te.split(",");_e=parseInt(ae[0],10),Le=parseInt(ae[1],10),a+=b(J+qr[Le],ur+Er[_e],qr[Le+1]-qr[Le])}for(Te in Be)if(Be.hasOwnProperty(Te)){var it=Te.split(",");_e=parseInt(it[0],10),Le=parseInt(it[1],10),a+=Z(J+qr[Le],ur+Er[_e],Er[_e+1]-Er[_e])}if(A.title){var Gt=hs(A.title,!1);a+=s(l("sgt"),"","rounded=0;fillColor=#FFFFFF;strokeColor=none;",J+6,ur,Gt,Sr.titleH,"1"),a+=C(A.title,J+6,ur,Gt,!1)}if(A.scroll){var oo={w:qr[qr.length-1],h:Er[Er.length-1]+Sr.titleH};(A.scroll==="both"||A.scroll==="v")&&To(J+oo.w+4,ur,15,oo.h,!0),(A.scroll==="both"||A.scroll==="h")&&To(J,ur+oo.h+4,oo.w,15,!1)}}function To(A,J,ur,Sr,Er){a+=s(l("ssb"),"","rounded=0;fillColor=none;strokeColor=#000000;strokeWidth=1;",A,J,ur,Sr,"1"),Er?(a+=b(A,J+12,ur),a+=b(A,J+Sr-12,ur),a+=s(l("sst"),"","triangle;direction=north;fillColor=#000000;strokeColor=#000000;",A+4,J+4,6,5,"1"),a+=s(l("sst"),"","triangle;direction=south;fillColor=#000000;strokeColor=#000000;",A+4,J+Sr-12+4,6,5,"1")):(a+=Z(A+12,J,Sr),a+=Z(A+ur-12,J,Sr),a+=s(l("sst"),"","triangle;direction=west;fillColor=#000000;strokeColor=#000000;",A+4,J+4,5,6,"1"),a+=s(l("sst"),"","triangle;direction=east;fillColor=#000000;strokeColor=#000000;",A+ur-12+4,J+4,5,6,"1"))}var ne=r.root,po=X(ne);ce(ne,5,5,po.w,po.h);var ao=s(l("sanchor"),"","shape=text;strokeColor=none;fillColor=none;",0,0,po.w+10,po.h+10,"1");return ao+a+e}var qd=78,Zf=5,bf=36,yC=30,nh=44,EC=37.5,DC=45,SC=50,Zd=20;function BC(r,a){for(var e=String(r??""),h=0,l=0;l<e.length;l++){var C=e.charAt(l);`iIljtfr.,:;!|'"()[]{} `.indexOf(C)>=0?h+=4.2:"mwMW".indexOf(C)>=0?h+=11.7:h+=7.8}return h*(a/14)}function jd(r){return Math.max(nh,BC(r,12)+20)}function TC(r){var a=r.networks,e="",h=0,l,C,b=r.styleSheet||null;function Z(oe,Uo,Ot,ho){return W(oe,b,["root","element","nwdiagDiagram",Uo],[],Ot||"vertex",ho)}function v(oe){return oe+"_"+h++}if(a.length===0)return"";var er=nh;for(l=0;l<a.length;l++){var X=a[l].nodes;for(C=0;C<X.length;C++){var V=jd(X[C].name);V>er&&(er=V)}}var tr=er+yC;function wr(oe){return qd+oe*tr+tr/2}var yr={};for(l=0;l<a.length;l++){var fr=a[l].nodes;for(C=0;C<fr.length;C++)yr[fr[C].name]===void 0&&(yr[fr[C].name]=l)}var Ar=[];for(l=0;l<a.length;l++)Ar[l]=!1;for(l=0;l<a.length;l++){var jr=a[l].nodes;for(C=0;C<jr.length;C++){var ce=yr[jr[C].name];ce!==void 0&&ce<l&&(Ar[ce]=!0)}}var Nr={},de=Zd,Fr=r.topNodes||[],Ir=r.links||[],qe=Zd;Fr.length>0&&(de=Zd+bf+26);var To=de;for(l=0;l<a.length;l++){var ne=a[l],po=ne.nodes;if(r.groups&&r.groups.length>0){for(var ao={},A=0;A<r.groups.length;A++)for(var J=0;J<r.groups[A].nodes.length;J++)ao[r.groups[A].nodes[J]]=A;for(var ur=[],Sr=0;Sr<po.length;Sr++)ur.push({n:po[Sr],g:ao[po[Sr].name]!==void 0?ao[po[Sr].name]:-1,i:Sr});ur.sort(function(oe,Uo){return oe.g-Uo.g||oe.i-Uo.i}),po=[];for(var Er=0;Er<ur.length;Er++)po.push(ur[Er].n)}var qr=de,z=[],Mr=0,Be=1/0,ye=-1/0;for(C=0;C<po.length;C++){var Le=Nr[po[C].name]?Nr[po[C].name].col:Mr++;z[C]=Le,Le<Be&&(Be=Le),Le>ye&&(ye=Le)}Be===1/0&&(Be=0,ye=0);var _e=qd+Be*tr,Ur=(ye-Be+1)*tr;e+=s(v("nwbar"),"",Z("fillColor=#E2E2F0;strokeColor=#181818;strokeWidth=1;","network","vertex",["strokeWidth"]),_e,qr,Ur,Zf,"1");var yo=ne.name+(ne.address?`
-`+ne.address:"");e+=s(v("nwlbl"),yo,Z("shape=text;strokeColor=none;fillColor=none;fontSize=12;fontColor=#000000;align=right;verticalAlign=middle;","network","text"),0,qr-15,qd-3,34,"1");var fo=Ar[l]?DC:EC,he=qr+Zf+fo,Te=qr+Zf;for(C=0;C<po.length;C++){var ae=po[C],it=wr(z[C]),Gt=ae.address||"";if(Nr[ae.name]){var oo=Nr[ae.name];e+=G(v("nwsh"),Gt,"endArrow=none;strokeColor=#181818;fontSize=11;fontColor=#000000;",oo.cx,oo.bottomY,oo.cx,qr,"1");continue}var pt=jd(ae.name),rt=it-pt/2,jo=bf,Qt="shape=rectangle;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;";ae.shape==="cloud"?(Qt="shape=cloud;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;",jo=bf+12):ae.shape==="database"&&(Qt="shape=cylinder;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;verticalAlign=bottom;spacingBottom=4;",jo=bf+16),e+=s(v("nwnode"),ae.name,Z(Qt,"server"),rt,he,pt,jo,"1"),e+=G(v("nwe"),Gt,Z("endArrow=none;strokeColor=#181818;fontSize=11;fontColor=#000000;","arrow","edge"),it,qr+Zf,it,he,"1"),Nr[ae.name]={col:z[C],cx:it,bottomY:he+jo,x:rt,topY:he,w:pt,h:jo};var Me=he+jo;Me>Te&&(Te=Me)}de=Te+SC}for(l=0;l<Fr.length;l++){var Io=Fr[l],Wo=null;for(C=0;C<Ir.length;C++){if(Ir[C].from===Io.name&&Nr[Ir[C].to]){Wo=Nr[Ir[C].to];break}if(Ir[C].to===Io.name&&Nr[Ir[C].from]){Wo=Nr[Ir[C].from];break}}var Ro=Wo?Wo.cx:wr(l),An=jd(Io.name)+(Io.shape==="cloud"?24:0),dn=bf+(Io.shape==="cloud"?12:0),rn=Io.shape==="cloud"?"shape=cloud;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;":"shape=rectangle;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;";e+=s(v("nwtop"),Io.name,Z(rn,"server"),Ro-An/2,qe,An,dn,"1"),e+=G(v("nwte"),"",Z("endArrow=none;strokeColor=#181818;","arrow","edge"),Ro,qe+dn,Ro,To,"1")}var Ao="",_t=r.groups||[];for(l=0;l<_t.length;l++){var ft=_t[l],Se=1/0,Go=1/0,wt=-1/0,cn=-1/0;for(C=0;C<ft.nodes.length;C++){var No=Nr[ft.nodes[C]];No&&(No.x<Se&&(Se=No.x),No.topY<Go&&(Go=No.topY),No.x+No.w>wt&&(wt=No.x+No.w),No.topY+No.h>cn&&(cn=No.topY+No.h))}Se!==1/0&&(Ao+=s(v("nwgrp"),"",Z("rounded=0;fillColor="+(Y(ft.color)||"#FFEFDF")+";strokeColor=none;","group","vertex",ft.color?["fillColor","gradientColor"]:null),Se-10,Go-8,wt-Se+20,cn-Go+16,"1"))}return Ao+e}var IC={Motivation:"#CCCCFF",Strategy:"#F8E7C0",Business:"#FFFFCC",Application:"#C2F0FF",Technology:"#C9FFC9",Physical:"#97FF97",Implementation:"#FFE0E0",Other:"#D3D3D3",Junction:"#D3D3D3"};function NC(r){if(r.category==="Junction"){if(r.kind==="And")return"#000000";if(r.kind==="Or")return"#F5F5F5"}if(r.category==="Other"&&r.kind==="Location")return"#EFD1E4";if(r.color){var a=Y(r.color);if(a)return a}return IC[r.category]||"#EEEEEE"}var LC={Process:1,Function:1,Interaction:1,Service:1,Event:1,Capability:1,CourseOfAction:1,ValueStream:1},GC={Stakeholder:["role","oct"],Driver:["driver","oct"],Assessment:["assess","oct"],Goal:["goal","oct"],Outcome:["outcome","oct"],Principle:["principle","oct"],Requirement:["requirement","oct"],Constraint:["constraint","oct"],Meaning:["meaning","oct"],Value:["amValue","oct"],Resource:["resource","square"],Capability:["capability","rounded"],CourseOfAction:["course","rounded"],ValueStream:["valueStream","rounded"],Actor:["actor","square"],Role:["role","square"],Collaboration:["collab","square"],Interface:["interface","square"],Process:["proc","rounded"],Function:["func","rounded"],Interaction:["interaction","rounded"],Event:["event","rounded"],Service:["serv","rounded"],Object:["passive","square"],DataObject:["passive","square"],Contract:["contract","square"],Representation:["representation","square"],Product:["product","square"],Location:["location","square"],Component:["comp","square"],Node:["node","square"],Device:["device","square"],SystemSoftware:["sysSw","square"],Path:["path","square"],CommunicationNetwork:["netw","square"],Artifact:["artifact","square"],Equipment:["equipment","square"],Facility:["facility","square"],DistributionNetwork:["distribution","square"],Material:["material","square"],WorkPackage:["workPackage","rounded"],Deliverable:["deliverable","square"],Plateau:["plateau","square"],Gap:["gap","square"]};function wC(r){var a=GC[r.kind];if(a)return a;var e=r.category==="Motivation"?"oct":LC[r.kind]?"rounded":"square";return["generic",e]}function PC(r,a){var e="",h=0;function l(je){return je+"_"+h++}var C=54,b=35,Z=114,v=134,er=16,X=12,V=40,tr=20,wr=16,yr=22,fr=16,Ar=20,jr=16,ce={},Nr={},de=er;function Fr(je){je>de&&(de=je)}function Ir(je,_r){return Math.round(zi(je||"",_r)*.925)}function qe(je){return Math.max(140,Ir(je)+20)}function To(je){return je.category==="Junction"}function ne(je){return To(je)?jr:qe(je.label||je.id)}function po(je){return To(je)?jr:C+15*(String(je.label||"").split(`
-`).length-1)}var ao=r.styleSheet||null;function A(je,_r){if(ao==null)return je;var Ho=["root","element","componentDiagram","archimate"],Ce=_r.stereotype?[_r.stereotype]:[],ln=H(ao,Ho,Ce,"vertex");delete ln.fillColor,delete ln.gradientColor,delete ln.rounded,delete ln.arcSize;var nt=M(je,ln);if(/archiType=/.test(nt)){var wo=kt.userStyle(ao,Ho,Ce);kt.asDouble(wo,"DiagonalCorner",0)>0?nt=nt.replace(/archiType=\w+;/,"archiType=oct;"):kt.asDouble(wo,"RoundCorner",0)>0&&(nt=nt.replace(/archiType=\w+;/,"archiType=rounded;"))}return nt}function J(je){var _r=NC(je);if(To(je))return A("ellipse;html=1;fillColor="+_r+";strokeColor=#181818;fontColor=#000000;strokeWidth=0.5;verticalLabelPosition=bottom;verticalAlign=top;fontSize="+X+";",je);var Ho="whiteSpace=wrap;html=1;fillColor="+_r+";strokeColor=#181818;fontColor=#000000;strokeWidth=0.5;fontSize="+X+";",Ce=wC(je);return A("shape=mxgraph.archimate3.application;appType="+Ce[0]+";archiType="+Ce[1]+";"+Ho,je)}for(var ur={__root__:[]},Sr=0;Sr<r.shapes.length;Sr++){var Er=r.shapes[Sr],qr=Er.parent||"__root__";ur[qr]||(ur[qr]=[]),ur[qr].push(Er)}var z=er+(r.title?V:0);function Mr(je,_r,Ho){var Ce=ne(je),ln=po(je),nt=l("arc");return ce[je.id]=nt,e+=s(nt,je.label||je.id,J(je),_r,Ho,Ce,ln,"1"),Fr(_r+Ce),{w:Ce,h:ln}}function Be(je,_r,Ho){for(var Ce=ur[je.id]||[],ln=(je.kind||"").toLowerCase()==="group",nt=0,wo=C,xn=0;xn<Ce.length;xn++){nt+=ne(Ce[xn]),xn>0&&(nt+=b);var Lt=po(Ce[xn]);Lt>wo&&(wo=Lt)}Ce.length===0&&(nt=120);var Ft=nt+2*wr,fe=tr+yr+wo+fr,ge=l("grp");Nr[je.id]=ge;var qt=Ir(je.label||je.id,!0)+12;qt>Ft-10&&(qt=Ft-10);var et="shape=folder;tabWidth="+qt+";tabHeight="+tr+";tabPosition=left;html=1;whiteSpace=wrap;fontStyle=1;fontSize="+X+";align=left;verticalAlign=top;spacingLeft=4;spacingTop=-2;strokeWidth=1.5;"+(ln?"fillColor=#D3D3D3;strokeColor=#000000;fontColor=#000000;":"fillColor=#FFFFFF;strokeColor=#444444;dashed=1;fontColor=#444444;");e+=s(ge,je.label||je.id,et,_r,Ho,Ft,fe,"1"),Fr(_r+Ft);for(var en=wr,Zt=tr+yr,qn=0;qn<Ce.length;qn++){var Ko=Ce[qn],Hn=ne(Ko),aa=po(Ko),Je=l("arc");ce[Ko.id]=Je,e+=s(Je,Ko.label||Ko.id,J(Ko),en,Zt+(wo-aa)/2,Hn,aa,ge),en+=Hn+b}return{w:Ft,h:fe}}var ye=r.edges&&r.edges.length>0,Le=r.shapes.length>0&&ur.__root__.length===0&&r.groups.length>0,_e=z;if(ye){for(var Ur={},yo=0;yo<r.shapes.length;yo++)Ur[r.shapes[yo].id]=yo;for(var fo=[],he=0;he<r.shapes.length;he++)fo[he]=0;for(var Te=0;Te<r.shapes.length;Te++)for(var ae=0;ae<r.edges.length;ae++){var it=Ur[r.edges[ae].from],Gt=Ur[r.edges[ae].to];it===void 0||Gt===void 0||fo[Gt]<fo[it]+1&&(fo[Gt]=fo[it]+1)}for(var oo={},pt=0,rt=0;rt<r.shapes.length;rt++){var jo=fo[rt];jo>pt&&(pt=jo),(oo[jo]=oo[jo]||[]).push(r.shapes[rt])}for(var Qt=r.title?Math.round(r.title.length*8):0,Me=Qt,Io=0;Io<=pt;Io++){for(var Wo=oo[Io]||[],Ro=0,An=0;An<Wo.length;An++)Ro+=ne(Wo[An]),An>0&&(Ro+=b);Ro>Me&&(Me=Ro)}for(var dn=0;dn<=pt;dn++){for(var rn=oo[dn]||[],Ao=0,_t=0;_t<rn.length;_t++)Ao+=ne(rn[_t]),_t>0&&(Ao+=b);for(var ft=er+(Me-Ao)/2,Se=z+dn*v,Go=0;Go<rn.length;Go++)Mr(rn[Go],ft,Se),ft+=ne(rn[Go])+b;_e=Se+C}}else if(Le)for(var wt=er,cn=0;cn<r.groups.length;cn++){var No=Be(r.groups[cn],wt,z);wt+=No.w+Ar,z+No.h>_e&&(_e=z+No.h)}else{for(var oe=ur.__root__,Uo=Math.max(1,Math.ceil(Math.sqrt(oe.length))),Ot=er,ho=z,dt=C,Aa=er,Sn=0;Sn<oe.length;Sn++){var an=oe[Sn],we=ne(an);Sn>0&&Sn%Uo===0&&(Ot=er,ho+=Z,dt=C);var Eo=Mr(an,Ot,ho);Ot+=we+b,ho===z&&(Aa=Ot-b),Eo.h>dt&&(dt=Eo.h)}if(_e=ho+dt,r.groups.length>0){for(var Et=Aa+(oe.length>0?21:0),Cr=0,Lr=0;Lr<r.groups.length;Lr++){var He=Be(r.groups[Lr],Et,z);Et+=He.w+Ar,He.h>Cr&&(Cr=He.h)}z+Cr>_e&&(_e=z+Cr)}}for(var Ie=0;Ie<r.edges.length;Ie++){var Oe=r.edges[Ie],so=ce[Oe.from]||Nr[Oe.from],Xo=ce[Oe.to]||Nr[Oe.to];!so||!Xo||(e+=vr(l("rel"),Oe.label||"","endArrow=block;endFill=1;endSize=8;startArrow=oval;startFill=1;startSize=10;html=1;strokeColor=#000000;fontColor=#000000;fontSize=13;labelBackgroundColor=#FFFFFF;",so,Xo,"1"))}if(r.legend&&r.legend.lines&&r.legend.lines.length>0){var qo=We(r.legend.lines),Yn=er,Nt=_e+20;e+=Tt(qo,Yn,Nt,l,"none"),Fr(Yn+qo.w)}if(r.title){var Da=Math.max(120,de-er,Math.round(r.title.length*8));e+=s(l("title"),r.title,"rounded=0;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",er,er,Da,30,"1")}return e}var ah={Person:{fill:"#08427B",stroke:"#073B6F",font:"#FFFFFF",extFill:"#686868",extStroke:"#666666"},System:{fill:"#1168BD",stroke:"#3C7FC0",font:"#FFFFFF",extFill:"#999999",extStroke:"#8A8A8A"},Container:{fill:"#438DD5",stroke:"#3C7FC0",font:"#FFFFFF",extFill:"#B3B3B3",extStroke:"#8A8A8A"},Component:{fill:"#85BBF0",stroke:"#78A8D8",font:"#000000",extFill:"#CCCCCC",extStroke:"#8A8A8A"}},YC=210;function MC(r,a){var e=ah[r]||ah.Component,h=/_ext$|^ext$/.test(a||"")||/ext/.test(a||""),l=h?e.extFill:e.fill,C=h?e.extStroke:e.stroke,b="html=1;whiteSpace=wrap;fillColor="+l+";strokeColor="+C+";fontColor="+e.font+";strokeWidth=0.5;fontSize=14;verticalAlign=top;spacingTop=6;";return/db/.test(a||"")?"shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;"+b:/queue/.test(a||"")?"shape=queue;"+b:(r==="Person"||/person/.test(a||""),"rounded=0;"+b)}function xC(r,a){var e="",h=0;function l(Fe){return Fe+"_"+h++}var C=YC,b=90,Z=r.nodesep||45,v=r.ranksep||55,er=r.nodesep||50,X=30,V=40,tr=16,wr=r.nodesep?Math.round(r.nodesep/2+3):tr,yr=30,fr={},Ar={},jr={},ce=!r.hasLegend,Nr={};function de(Fe){return Nr[Fe.id]||(Nr[Fe.id]=WC(Fe,ce)),Nr[Fe.id]}function Fr(Fe,le,Ne,Qe,tn,Vo,xo,Co){var mn=l("c4");fr[Fe.id]=mn,jr[Fe.id]={x:xo===void 0?le:xo,y:Co===void 0?Ne:Co,w:Qe,h:tn};var pn=MC(Fe.category,Fe.variant),hn=Fe.category==="Person";hn&&!ce&&(pn+="spacingTop=57;");var Dt=K(mn,HC(Fe,ce),pn,le,Ne,Qe,tn,Vo);if(hn){var ca=Qe/2,ea=ce?26:10;Dt+=s(l("c4sp"),"","shape=mxgraph.c4.person2;fillColor=#FFFFFF;strokeColor=none;",ca-24,ea,48,48,mn)}return Dt}for(var Ir={},qe={},To=0;To<r.boundaries.length;To++){var ne=r.boundaries[To];ne.stereotype&&ne.stereotype.toLowerCase()==="layout"&&(Ir[ne.id]=!0)}function po(Fe){for(;Fe&&Ir[Fe];){for(var le=null,Ne=0;Ne<r.boundaries.length;Ne++)if(r.boundaries[Ne].id===Fe){le=r.boundaries[Ne].parent;break}Fe=le}return Fe}for(var ao=[],A=0;A<r.boundaries.length;A++){var J=r.boundaries[A];Ir[J.id]||ao.push({id:J.id,label:J.label,kind:J.kind,stereotype:J.stereotype,children:J.children,parent:po(J.parent)})}for(var ur={__root__:[]},Sr=0;Sr<r.shapes.length;Sr++){var Er=r.shapes[Sr],qr=Er.parent||"__root__",z=qr==="__root__"?"__root__":po(qr)||"__root__";ur[z]||(ur[z]=[]),ur[z].push(Er),qe[Er.id]=z}var Mr=X,Be=Mr,ye=r.title?Wu(r.title).length:0,Le=ye?ye*20+4:0;r.title&&(Mr+=Le+20);for(var _e=[],Ur={},yo=0;yo<ao.length;yo++)Ur[ao[yo].id]=_e.length,_e.push({boundary:ao[yo]});for(var fo=ur.__root__,he=0;he<fo.length;he++)Ur[fo[he].id]=_e.length,_e.push({shape:fo[he]});function Te(Fe){if(Ur[Fe]!==void 0)return Ur[Fe];var le=qe[Fe];return le&&le!=="__root__"&&Ur[le]!==void 0?Ur[le]:-1}for(var ae=[],it=0;it<r.edges.length;it++){var Gt=r.edges[it];ae.push({from:Gt.back?Gt.to:Gt.from,to:Gt.back?Gt.from:Gt.to,label:Gt.label,technology:Gt.technology,direction:Gt.direction})}function oo(Fe,le){for(var Ne=[],Qe=0;Qe<Fe;Qe++)Ne.push(0);for(var tn=0;tn<=Fe;tn++){for(var Vo=!1,xo=0;xo<le.length;xo++){var Co=le[xo];Co.from<0||Co.to<0||Co.from===Co.to||Co.direction==="left"||Co.direction==="right"||Ne[Co.to]<Ne[Co.from]+1&&(Ne[Co.to]=Ne[Co.from]+1,Vo=!0)}if(!Vo)break}for(var mn=0;mn<Fe;mn++){for(var pn=!1,hn=0;hn<le.length;hn++){var Dt=le[hn];Dt.from<0||Dt.to<0||Dt.from===Dt.to||(Dt.direction==="left"||Dt.direction==="right")&&Ne[Dt.to]!==Ne[Dt.from]&&(Ne[Dt.to]=Ne[Dt.from],pn=!0)}if(!pn)break}return Ne}for(var pt=[],rt=0;rt<ae.length;rt++)pt.push({from:Te(ae[rt].from),to:Te(ae[rt].to),direction:ae[rt].direction});for(var jo=oo(_e.length,pt),Qt=0;Qt<_e.length;Qt++){var Me=_e[Qt];if(Me.shape){var Io=de(Me.shape);Me.w=Io.w,Me.h=Io.h;continue}for(var Wo=ur[Me.boundary.id]||[],Ro={},An=0;An<Wo.length;An++)Ro[Wo[An].id]=An;for(var dn=[],rn=0;rn<ae.length;rn++){var Ao=Ro[ae[rn].from],_t=Ro[ae[rn].to];dn.push({from:Ao===void 0?-1:Ao,to:_t===void 0?-1:_t,direction:ae[rn].direction})}for(var ft=oo(Wo.length,dn),Se=[],Go=0;Go<Wo.length;Go++){var wt=ft[Go];Se[wt]||(Se[wt]=[]),Se[wt].push(Wo[Go])}Me.childRows=[],Me.rowHs=[];for(var cn=0,No=0,oe=0;oe<Se.length;oe++)if(!(!Se[oe]||!Se[oe].length)){for(var Uo=Se[oe],Ot=0,ho=0,dt=0;dt<Uo.length;dt++){var Aa=de(Uo[dt]);Ot+=Aa.w+(dt?er:0),ho=Math.max(ho,Aa.h)}Me.childRows.push(Uo),Me.rowHs.push(ho),cn=Math.max(cn,Ot),No+=ho+(Me.childRows.length>1?v:0)}Wo.length===0&&(cn=C-2*tr,No=40),Me.w=cn+2*wr,Me.h=V+tr+No+tr}for(var Sn=[],an=0;an<_e.length;an++){var we=jo[an];Sn[we]||(Sn[we]=[]),Sn[we].push(_e[an])}for(var Eo=[],Et=[],Cr=0,Lr=0;Lr<Sn.length;Lr++)if(!(!Sn[Lr]||!Sn[Lr].length)){for(var He=Sn[Lr],Ie=0,Oe=0;Oe<He.length;Oe++)Ie+=He[Oe].w+(Oe?Z:0);Eo.push(He),Et.push(Ie),Cr=Math.max(Cr,Ie)}r.title&&(e+=K(l("c4title"),R(r.title).replace(/&#10;/g,"<br>"),"text;html=1;rounded=0;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",X,Be,Cr,Le,"1"));for(var so=0;so<Eo.length;so++){for(var Xo=Eo[so],qo=X+(Cr-Et[so])/2,Yn=0,Nt=0;Nt<Xo.length;Nt++)Yn=Math.max(Yn,Xo[Nt].h);for(var Da=0;Da<Xo.length;Da++){var je=Xo[Da];if(je.shape)e+=Fr(je.shape,qo,Mr,je.w,je.h,"1");else{var _r=l("bnd");Ar[je.boundary.id]=_r;var Ho='<font style="font-size:16px;"><b>'+R(je.boundary.label||je.boundary.id)+"</b></font><br>["+XC(je.boundary)+"]",Ce="rounded=0;html=1;whiteSpace=wrap;fillColor=none;strokeColor=#444444;dashed=1;dashPattern=7 7;verticalAlign=top;align=center;fontColor=#444444;fontSize=12;";e+=K(_r,Ho,Ce,qo,Mr,je.w,je.h,"1"),jr[je.boundary.id]={x:qo,y:Mr,w:je.w,h:je.h};for(var ln=qo,nt=Mr,wo=V+tr,xn=0;xn<je.childRows.length;xn++){for(var Lt=je.childRows[xn],Ft=0,fe=0;fe<Lt.length;fe++)Ft+=de(Lt[fe]).w+(fe?er:0);for(var ge=(je.w-Ft)/2,qt=0;qt<Lt.length;qt++){var et=Lt[qt],en=de(et);e+=Fr(et,ge,wo,en.w,en.h,_r,ln+ge,nt+wo),ge+=en.w+er}wo+=je.rowHs[xn]+v}}qo+=je.w+Z}Mr+=Yn+b}for(var Zt=[],qn=0;qn<r.edges.length;qn++){var Ko=r.edges[qn],Hn=fr[Ko.from]||Ar[Ko.from],aa=fr[Ko.to]||Ar[Ko.to];if(!(!Hn||!aa)){if(Ko.back){var Je=Hn;Hn=aa,aa=Je}var sn="endArrow=block;endFill=1;endSize=5;html=1;strokeColor=#666666;fontColor=#666666;fontSize=12;fontStyle=1;";r.linetype==="ortho"?sn+="edgeStyle=orthogonalEdgeStyle;rounded=0;":sn+="curved=1;";var Bn=[];if(Ko.label)for(var $t=Wu(Ko.label),mo=0;mo<$t.length;mo++)Bn.push({t:$t[mo],b:!0});Ko.technology&&Bn.push({t:"["+Ko.technology+"]",i:!0});var Pt=jr[Ko.from],ra=jr[Ko.to];if(Bn.length&&Pt&&ra){for(var Ut=[],Wn=0,yt=Bn.length,Zn=0;Zn<Bn.length;Zn++){var on=Bn[Zn],va=R(on.t);Ut.push(on.b?"<b>"+va+"</b>":on.i?"<i>"+va+"</i>":va),Wn=Math.max(Wn,yf(on.t,12,!!on.b))}var ga=Math.ceil(Wn)+10,jn=yt*16+4,Fn=Pt.x+Pt.w/2,Mn=Pt.y+Pt.h/2,la=ra.x+ra.w/2,Tn=ra.y+ra.h/2,gt=(Fn+la)/2,Rt=(Mn+Tn)/2,Jt=Math.abs(Tn-Mn)>=Math.abs(la-Fn),ct,wn,In;Jt?(ct=gt+4,wn=Rt-jn/2,In="left"):(ct=gt-ga/2,wn=Rt-jn/2,In="center"),Zt.push({html:Ut.join("<br>"),x:ct,y:wn,w:ga,h:jn,align:In})}e+=vr(l("rel"),"",sn,Hn,aa,"1")}}for(var ko=0;ko<Zt.length;ko++)if(!Zt[ko].done){var Do=[Zt[ko]];Zt[ko].done=!0;for(var Rr=ko+1;Rr<Zt.length;Rr++){var xr=Zt[Rr];if(!xr.done)for(var br=0;br<Do.length;br++){var Br=Do[br];if(xr.x<Br.x+Br.w+4&&Br.x<xr.x+xr.w+4&&xr.y<Br.y+Br.h&&Br.y<xr.y+xr.h){Do.push(xr),xr.done=!0;break}}}if(Do.length>1){Do.sort(function(Fe,le){return Fe.x-le.x});for(var Pr=0,Xe=0,zr=0;zr<Do.length;zr++)Pr=Math.max(Pr,Do[zr].w),Xe+=Do[zr].x+Do[zr].w/2;Xe/=Do.length;for(var Ke=Pr+24,De=Xe-Ke*(Do.length-1)/2,ze=0;ze<Do.length;ze++)Do[ze].x=De+ze*Ke-Do[ze].w/2}}for(var So=0;So<Zt.length;So++){var ot=Zt[So];e+=K(l("rellbl"),ot.html,"text;html=1;fillColor=none;strokeColor=none;fontSize=12;fontColor=#666666;align="+ot.align+";verticalAlign=middle;whiteSpace=nowrap;",Math.round(ot.x),Math.round(ot.y),ot.w,ot.h,"1")}if(r.hasLegend){var ve=[{fill:"#08427B",label:"person"},{fill:"#1168BD",label:"system"},{fill:"#438DD5",label:"container"}];r.hasComponent&&ve.push({fill:"#85BBF0",label:"component"}),ve.push({fill:"#686868",label:"external person"},{fill:"#999999",label:"external system"},{fill:"#B3B3B3",label:"external container"}),r.hasComponent&&ve.push({fill:"#CCCCCC",label:"external component"});var Yt=19,At=140,ht=X+Math.max(0,Cr-At),Vt=Mr-b+40;e+=s(l("lg"),"Legend","text;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=left;verticalAlign=middle;",ht,Vt,At,18,"1"),Vt+=18;for(var Pn=0;Pn<ve.length;Pn++){var Ae=ve[Pn];e+=s(l("lg"),Ae.label,"rounded=0;fillColor="+Ae.fill+";strokeColor=none;fontSize=12;fontColor=#FFFFFF;align=left;spacingLeft=6;",ht,Vt+Pn*Yt,At,Yt,"1")}}return e}function Wu(r){return String(r??"").split(/\\n|&#10;|\r?\n/)}function HC(r,a){var e=[];a&&e.push('<font style="font-size:12px;"><i>\xAB'+R(String(r.category||"").toLowerCase())+"\xBB</i></font>"),r.category==="Person"&&a&&e.push('<font style="font-size:36px;">&#160;</font>');for(var h=Wu(r.label||r.id),l=0;l<h.length;l++)e.push('<font style="font-size:16px;"><b>'+R(h[l])+"</b></font>");if(r.technology&&e.push('<font style="font-size:12px;"><i>['+R(r.technology)+"]</i></font>"),r.description){e.push("");for(var C=Wu(r.description),b=0;b<C.length;b++)e.push(R(C[b]))}return e.join("<br>")}function KC(r){return r==="\u23AF"||r==="\u2014"||r==="\u2015"?13.4:`iIljtfr.,:;!|'"()[]{} `.indexOf(r)>=0?4.2:"mwMW".indexOf(r)>=0?11.7:7.8}function yf(r,a,e){for(var h=String(r??""),l=0,C=0;C<h.length;C++)l+=KC(h.charAt(C));return l*(a/14)*(e?1.08:1)}function lh(r,a,e,h){var l=yf(r,a,e);if(!r||l<=h)return{count:1,maxW:l};for(var C=String(r).split(/\s+/),b="",Z=0,v=0,er=0;er<C.length;er++){var X=b?b+" "+C[er]:C[er];b&&yf(X,a,e)>h?(Z++,v=Math.max(v,yf(b,a,e)),b=C[er]):b=X}return b&&(Z++,v=Math.max(v,yf(b,a,e))),{count:Z||1,maxW:v||l}}function zC(r,a){var e=[];a&&e.push({text:"\xAB"+String(r.category||"").toLowerCase()+"\xBB",size:12,bold:!1,kind:"stereo"});for(var h=Wu(r.label||r.id),l=0;l<h.length;l++)e.push({text:h[l],size:16,bold:!0,kind:"name"});if(r.technology&&e.push({text:"["+r.technology+"]",size:12,bold:!1,kind:"tech"}),r.description){e.push({text:"",size:14,bold:!1,kind:"blank"});for(var C=Wu(r.description),b=0;b<C.length;b++)e.push({text:C[b],size:14,bold:!1,kind:"desc"})}return e}var UC=200,Jd=20;function WC(r,a){var e=zC(r,a),h=r.category==="Person",l,C=0;for(l=0;l<e.length;l++)e[l].text&&(C=Math.max(C,lh(e[l].text,e[l].size,e[l].bold,UC).maxW));var b=Math.ceil(C)+Jd,Z=b-8,v=0,er=0,X=0,V=0;for(C=0,l=0;l<e.length;l++){var tr=e[l],wr=tr.text?lh(tr.text,tr.size,tr.bold,Z):{count:1,maxW:0};tr.text&&(C=Math.max(C,wr.maxW)),tr.kind==="name"?v+=wr.count:tr.kind==="desc"?er+=wr.count:tr.kind==="tech"?X+=wr.count:tr.kind==="stereo"&&(V+=wr.count)}b=Math.max(b,Math.ceil(C)+Jd);var yr=!!r.description,fr=Jd+V*16.3+(h?48:0)+v*21.8+X*16.3+(yr?19.04+er*19.04:0);return/db/.test(r.variant||"")&&(fr+=20),{w:b,h:Math.round(Math.max(h?110:66,fr)),sprite:h}}function XC(r){var a=(r.kind||"").toLowerCase();return a.indexOf("container")===0?"container":a.indexOf("system")===0?"system":a.indexOf("enterprise")===0?"enterprise":(r.stereotype||"boundary").toLowerCase()}var ih=[["account-login","account-logout","action-redo","action-undo","align-center","align-left","align-right","aperture","arrow-bottom","arrow-circle-bottom","arrow-circle-left","arrow-circle-right","arrow-circle-top","arrow-left","arrow-right","arrow-thick-bottom","arrow-thick-left","arrow-thick-right","arrow-thick-top","arrow-top","audio-spectrum","audio","badge","ban","bar-chart","basket","battery-empty","battery-full","beaker"],["bell","bluetooth","bold","bolt","book","bookmark","box","briefcase","british-pound","browser","brush","bug","bullhorn","calculator","calendar","camera-slr","caret-bottom","caret-left","caret-right","caret-top","cart","chat","check","chevron-bottom","chevron-left","chevron-right","chevron-top","circle-check","circle-x","clipboard","clock","cloud-download","cloud-upload"],["cloud","cloudy","code","cog","collapse-down","collapse-left","collapse-right","collapse-up","command","comment-square","compass","contrast","copywriting","credit-card","crop","dashboard","data-transfer-download","data-transfer-upload","delete","dial","document","dollar","double-quote-sans-left","double-quote-sans-right","double-quote-serif-left","double-quote-serif-right","droplet","eject","elevator","ellipses","envelope-closed","envelope-open","euro"],["excerpt","expand-down","expand-left","expand-right","expand-up","external-link","eye","eyedropper","file","fire","flag","flash","folder","fork","fullscreen-enter","fullscreen-exit","globe","graph","grid-four-up","grid-three-up","grid-two-up","hard-drive","header","headphones","heart","home","image","inbox","infinity","info","italic","justify-center","justify-left"],["justify-right","key","laptop","layers","lightbulb","link-broken","link-intact","list-rich","list","location","lock-locked","lock-unlocked","loop-circular","loop-square","loop","magnifying-glass","map-marker","map","media-pause","media-play","media-record","media-skip-backward","media-skip-forward","media-step-backward","media-step-forward","media-stop","medical-cross","menu","microphone","minus","monitor","moon","move"],["musical-note","paperclip","pencil","people","person","phone","pie-chart","pin","play-circle","plus","power-standby","print","project","pulse","puzzle-piece","question-mark","rain","random","reload","resize-both","resize-height","resize-width","rss-alt","rss","script","share-boxed","share","shield","signal","signpost","sort-ascending","sort-descending","spreadsheet"],["star","sun","tablet","tag","tags","target","task","terminal","text","thumb-down","thumb-up","timer","transfer","trash","underline","vertical-align-bottom","vertical-align-center","vertical-align-top","video","volume-high","volume-low","volume-off","warning","wifi","wrench","x","yen","zoom-in","zoom-out"]],qC=[14,179,293,453,565,710,825],ZC=[69,4,4,4,4,4,4];function jC(r){r=r||{};var a="",e=8,h=0;function l(de){for(var Fr=0,Ir=0;Ir<de.length;Ir++)Fr=Math.max(Fr,u(de[Ir]).length);return Fr}function C(de){for(var Fr=[],Ir=0;Ir<de.length;Ir++){var qe=de[Ir];/^(?:<#\w+>)?\|.*\|$/.test(qe)&&(qe=qe.replace(/^(?:<#\w+>)?\|\s*|\s*\|$/g,"").split("|").map(function(To){return To.replace(/^\s+|\s+$/g,"").replace(/^=\s*/,"").replace(/^<#\w+>\s*/,"").replace(/^<[lrc]>\s*/,"")}).join(" ")),Fr.push(qe)}return Fr}function b(de,Fr,Ir,qe){var To=de.split(`
-`),ne=Math.max(50,l(To)*Ir*(qe?.62:.56)+24),po=To.length*(Ir+5)+16;a+=s("t_"+h++,de,Fr,5,e,ne,po,"1"),e+=po+6}if(r.header&&b(r.header,"text;html=1;fillColor=none;strokeColor=none;fontSize=10;fontColor=#000000;align=right;verticalAlign=middle;",10,!1),r.title){var Z=r.title.split(`
-`),v=Math.max(50,l(Z)*8+24),er=Z.length>1?Z.length*19+16:39;a+=K("t_title",n(r.title),"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",5,e,v,er,"1"),e+=er+6}for(var X=r.notes||[],V=0;V<X.length;V++){var tr=C(X[V].lines),wr=tr.join(`
-`),yr=Math.max(40,l(tr)*7+26),fr=Math.max(1,tr.length)*17+12,Ar=X[V].color&&Y(X[V].color)||"#FEFFDD";a+=s("t_note"+V,wr,"shape=note;size=10;fillColor="+Ar+";strokeColor=#181818;fontColor=#000000;fontSize=12;align=left;spacingLeft=6;verticalAlign=middle;whiteSpace=wrap;html=1;",5,e,yr,fr,"1"),e+=fr+10}if(r.legend&&r.legend.lines&&r.legend.lines.length){var jr=C(r.legend.lines),ce=Math.max(40,l(jr)*7+26),Nr=jr.length*17+12;a+=s("t_legend",jr.join(`
-`),"rounded=0;fillColor=#DDDDDD;strokeColor=#000000;strokeWidth=1;fontColor=#000000;fontSize=12;align=left;spacingLeft=8;verticalAlign=middle;whiteSpace=wrap;html=1;",5,e,ce,Nr,"1"),e+=Nr+6}return r.caption&&b(r.caption,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontColor=#000000;align=center;verticalAlign=middle;",14,!1),r.footer&&b(r.footer,"text;html=1;fillColor=none;strokeColor=none;fontSize=10;fontColor=#000000;align=right;verticalAlign=middle;",10,!1),a}function JC(){var r="",a=0;function e(Z,v,er,X,V,tr){return' <mxCell id="oi'+a+++'" value="'+Z+'" style="'+v+`" vertex="1" parent="1">
- <mxGeometry x="`+er+'" y="'+X+'" width="'+V+'" height="'+tr+`" as="geometry"/>
+`}else wr+=mr(Dr("noteln"),"",Pi,ho.cellId,Ql,"1")}else if(ho){var os="shape=triangle;fillColor=#FEFFDD;strokeColor=#181818;strokeWidth=0.5;",ts=Math.round(ho.x+ho.w/2),Fi=Math.round(ho.y+ho.h/2);ao.position==="left"?wr+=ze(Dr("noteptr"),"",os+"direction=east;",un+Ra-1,Fi-4,Math.max(6,ho.x-(un+Ra)+1),8,"1"):ao.position==="top"?wr+=ze(Dr("noteptr"),"",os+"direction=south;",ts-4,En+Va-1,8,Math.max(6,ho.y-(En+Va)+1),"1"):ao.position==="bottom"?wr+=ze(Dr("noteptr"),"",os+"direction=north;",ts-4,ho.y+ho.h,8,Math.max(6,En-(ho.y+ho.h)+1),"1"):wr+=ze(Dr("noteptr"),"",os+"direction=west;",ho.x+ho.w,Fi-4,Math.max(6,un-(ho.x+ho.w)+1),8,"1")}}return wr}var gv={" ":4.4297,"!":4.4297,'"':5.2295,"#":8.8525,"&":9.7617,"'":3.206,"(":4.5527,")":4.5527,"*":6.7471,"+":11.1289,",":4.4297,"-":8.1006,".":4.4297,"/":7.3418,0:8.8525,1:8.8525,2:8.8525,3:8.8525,4:8.8525,5:8.8525,6:8.8525,7:8.8525,8:8.8525,9:8.8525,":":4.4297,";":4.4297,"=":11.1289,"?":5.9063,"@":12.0176,A:9.6592,B:8.0527,C:9.6865,D:10.4863,E:7.5879,F:7.5059,G:10.1172,H:10.2881,I:4.0332,J:4.3545,K:9.1396,L:7.4648,M:12.0586,N:10.3428,O:10.876,P:7.7383,Q:10.876,R:8.8525,S:7.54,T:8.8525,U:9.7002,V:9.1533,W:11.9766,X:8.7637,Y:8.7226,Z:8.4629,"[":4.5527,"]":4.5527,"^":8.8525,_:7,"`":8.5996,a:7.7314,b:8.8115,c:7.1709,d:8.8115,e:7.7998,f:5.1475,g:8.7295,h:8.6885,i:4.0469,j:4.2588,k:8.1826,l:4.0469,m:13.0703,n:8.6885,o:8.5996,p:8.8115,q:8.8115,r:5.7285,s:7.1367,t:5.2363,u:8.6885,v:7.2461,w:10.7871,x:8.5859,y:7.3144,z:8.0254,"{":4.5527,"|":5.2295,"}":4.5527},Rv={" ":4.6143,"!":4.3887,'"':6.3233,"#":9.2354,"&":10.4248,"'":3.459,"(":5.1885,")":5.1885,"*":6.5284,"+":11.1357,",":3.459,"-":8.9415,".":3.459,"/":7.9161,0:9.2354,1:9.2354,2:9.2354,3:9.2354,4:9.2354,5:9.2354,6:9.2354,7:9.2354,8:9.2354,9:9.2354,":":3.459,";":3.459,"=":11.1357,"?":6.959,"@":12.0176,A:10.3086,B:8.8184,C:9.9736,D:11.1016,E:8.4082,F:8.0391,G:10.4385,H:10.9238,I:4.6416,J:5.8584,K:9.9394,L:8.1416,M:12.708,N:10.7598,O:11.5254,P:8.5859,Q:11.5322,R:9.6592,S:7.998,T:9.6592,U:10.3086,V:9.7822,W:12.6533,X:9.3379,Y:9.6113,Z:9.0234,"[":5.1885,"]":5.1885,"^":9.2354,_:7,"`":8.9414,a:8.2305,b:9.2764,c:7.4512,d:9.2764,e:8.2031,f:5.8037,g:9.2354,h:9.1943,i:4.5527,j:4.6621,k:8.8594,l:4.5527,m:13.5762,n:9.1943,o:8.9414,p:9.2764,q:9.2764,r:6.3643,s:7.916,t:5.6738,u:9.1943,v:8.3057,w:12.0791,x:8.2715,y:8.1621,z:8.2715,"{":5.1885,"|":5.4004,"}":5.1885},Sc=14,Av=1.17773,mv=1.1499,kv=.848,_v=.60205;function Ov(r,l){var e=l?Rv:gv;if(e.hasOwnProperty(r))return e[r];var c=r.charCodeAt(0);return c>=48&&c<=57?e[0]:c>=65&&c<=90?l?9.9:9:c>=11904?Sc:l?8.4:7.9}function yv(r){var l=Ft.asInt(r,"FontSize",14);(l===-1||!(l>0))&&(l=14);var e=Ft.fontFace(r),c=Ft.raw(r,"FontName")||"SansSerif",i="sans";return/mono|courier/i.test(c)?i="mono":/serif/i.test(c)&&!/sans/i.test(c)&&(i="serif"),{size:l,bold:!!e.bold,italic:!!e.italic,family:i,name:c}}var bv={size:14,bold:!1,italic:!1,family:"sans",name:"SansSerif"};function $u(r,l){var e=String(r??"");if(l.family==="mono")return e.length*l.size*_v;for(var c=0,i=0;i<e.length;i++)c+=Ov(e.charAt(i),l.bold);return c*=l.size/Sc,l.family==="serif"&&(c*=kv),c}function Fv(r){return r.size*(r.family==="serif"?mv:Av)}function Ss(r,l,e){for(var c=String(r??"").split(/\\n|\n/),i={size:l>0?l:Sc,bold:!!e},h=0,F=0;F<c.length;F++){var j=$u(c[F],i);j>h&&(h=j)}return h}function Ld(r,l){var e=$u(s(r),l);if(!l.bold){var c={size:l.size,bold:!0,italic:l.italic,family:l.family,name:l.name};String(r).replace(/\*\*([\s\S]+?)\*\*/g,function(h,F){var j=s(F);return e+=$u(j,c)-$u(j,l),""})}if(l.family!=="mono"){var i={size:l.size,bold:!1,italic:!1,family:"mono",name:l.name};String(r).replace(/""([\s\S]+?)""/g,function(h,F){return e+=$u(F,i)-$u(F,l),""})}return e}function Ev(r,l,e){if(!(e>0))return[r];for(var c=String(r).split(" "),i=$u(" ",l),h=[],F=[],j=0,p=0;p<c.length;p++){var or=Ld(c[p],l),q=F.length>0?j+i+or:or;q>e&&F.length>0?(h.push(F.join(" ")),F=[c[p]],j=or):(F.push(c[p]),j=q)}return h.push(F.join(" ")),h}function Sv(r,l,e){for(var c=String(r??"").replace(/\\n/g,`
+`),i=c.split(`
+`),h=[],F=0,j=0;j<i.length;j++)h=h.concat(Ev(i[j],l,e));for(var p=0;p<h.length;p++){var or=Ld(h[p]===""?" ":h[p],l);or>F&&(F=or)}return{lines:h,text:h.join(`
+`),textW:F,textH:h.length*Fv(l)}}function Gd(r){for(var l=String(r??"").split(`
+`),e=0,c=0;c<l.length;c++){var i=$u(l[c],bv);i>e&&(e=i)}return e}function fh(r){return K(r)}function Dv(r){return/\*\*[\s\S]+?\*\*|\/\/[\s\S]+?\/\/|__[\s\S]+?__|~~[\s\S]+?~~/.test(String(r??""))||A(r)}function Ds(r){return String(Math.round(r*1e4)/1e4)}function If(r,l){if(r==null)return l;if(r==="none")return"none";var e=String(r).replace(/^\s+|\s+$/g,""),c=/^(#?[0-9A-Za-z]+)[|\/\\-][#]?[0-9A-Za-z]+$/.exec(e);c!=null&&(e=c[1]);var i=Y(e);if(i==null)return"#FFFFFF";if(/^#[0-9A-Fa-f]{6}$/.test(i))return i.toUpperCase();if(/^#[0-9A-Fa-f]{3}$/.test(i))return("#"+i.charAt(1)+i.charAt(1)+i.charAt(2)+i.charAt(2)+i.charAt(3)+i.charAt(3)).toUpperCase();if(/^#[0-9A-Fa-f]$/.test(i)){var h=i.charAt(1);return("#"+h+h+h+h+h+h).toUpperCase()}return/^#[0-9A-Fa-f]{8}$/.test(i)?("#"+i.substring(1,7)).toUpperCase():"#FFFFFF"}function dh(r,l,e,c){var i=["root","element",r,"node"],h=l.style==="leaf",F=!l.children||l.children.length===0;return e===0?(i.push("rootNode"),h&&i.push("boxless")):h&&F?i.push("leafNode","boxless"):h?i.push("boxless"):F&&i.push("leafNode"),Ft.signature(i,e,l.stereotypes||[],c)}function ch(r,l,e,c,i){for(var h=[dh(l,e,c,!1)],F=0;F<i.length;F++)h.push(dh(l,i[F],c,!0));var j=Ft.nodeStyle(r,h);if(e.color){var p={};for(var or in j)j.hasOwnProperty(or)&&(p[or]=j[or]);p.BackGroundColor={value:e.color,priority:1/0},j=p}return j}function Dc(r,l,e,c){return Ft.plainStyle(r,Ft.signature(["root","element",l,"arrow"],c,e.stereotypes||[],!1))}function hh(r,l,e,c){var i=yv(l),h=Sv(r.label,i,Ft.maxWidth(l)),F,j,p;return e?(F=c,j=h.textW+F.left+F.right,p=h.textH+F.top+F.bottom):(F=Ft.clockwise(l,"Padding"),j=Math.max(Ft.asDouble(l,"MinimumWidth",0),h.textW+F.top+F.bottom),p=h.textH+F.top+F.bottom),{font:i,tb:h,pad:F,w:j,h:p}}function vh(r){return r.dashVisible>0?"dashed=1;fixDash=1;dashPattern="+Ds(r.dashVisible)+" "+Ds(r.dashSpace)+";":""}function Ch(r){return String(r).replace(/[;=<>"'`{}\r\n\t]/g,"")}function ph(r,l,e,c){var i=l.font,h=Ft.horizontalAlignment(r),F=If(Ft.color(r,"FontColor"),"#000000"),j;if(e)j="text;html=1;strokeColor=none;fillColor=none;align="+h+";verticalAlign=middle;whiteSpace=wrap;fontColor="+F+";fontSize="+i.size+";spacing=0;"+(l.pad.left>0?"spacingLeft="+Ds(l.pad.left)+";":"")+(l.pad.right>0?"spacingRight="+Ds(l.pad.right)+";":"");else{var p=Ft.asDouble(r,"RoundCorner",0),or=Ft.stroke(r),q=If(Ft.color(r,"BackGroundColor"),"#F1F1F1"),rr=If(Ft.color(r,"LineColor"),"#181818");j=(p>0?"rounded=1;arcSize="+Ds(p)+";absoluteArcSize=1;":"rounded=0;")+"fillColor="+q+";strokeColor="+rr+";strokeWidth="+Ds(or.thickness)+";"+vh(or)+(Ft.shadowing(r)>0?"shadow=1;":"")+"whiteSpace=wrap;fontColor="+F+";fontSize="+i.size+";align="+h+";verticalAlign=middle;spacing=0;spacingTop="+Ds(l.pad.top)+";spacingBottom="+Ds(l.pad.bottom)+";"+(h==="left"?"spacingLeft="+Ds(l.pad.left)+";":h==="right"?"spacingRight="+Ds(Math.max(0,l.pad.top+l.pad.bottom-l.pad.left))+";":"")}var nr=fh(c)|(i.bold?1:0)|(i.italic?2:0);return nr!==0&&(j+="fontStyle="+nr+";"),/^sans-?serif$/i.test(i.name)||(j+="fontFamily="+Ch(i.name)+";"),j}function $h(r){var l=If(Ft.color(r,"LineColor"),"#181818");if(l==="none")return null;var e=Ft.stroke(r);return"strokeColor="+l+";"+(e.thickness!==1?"strokeWidth="+Ds(e.thickness)+";":"")+vh(e)}function gh(r,l,e,c,i,h,F,j){var p=e.tb.text;return fh(l.label)===0&&Dv(l.label)?(c.indexOf("html=1;")<0&&(c+="html=1;"),z(r,t(p),c,i,h,F,j,"1")):u(r,p,c,i,h,F,j,"1")}var Nf=10,Tv=10,Rh=0,Bv=30,Iv={top:1,right:0,bottom:1,left:3},Nv={top:1,right:3,bottom:1,left:0};function Tc(r,l,e,c,i,h){for(var F=l.style==="leaf",j=ch(r,"mindmapDiagram",l,e,c),p=hh(l,j,F,i===1?Iv:Nv),or=Ft.clockwise(j,"Margin"),q=F?0:or.top+or.bottom,rr={node:l,level:e,props:j,m:p,boxless:F,direction:i,w:p.w,h:p.h,marginTop:F?0:or.top,thickness:p.h+q,pw:p.w,pt:p.h+q,x1:or.left,x2:or.right+Bv,link:$h(Dc(r,"mindmapDiagram",l,e)),children:[],tetris:null,cellId:null},nr=h||l.children||[],Xr=[l].concat(c),wr=0;wr<nr.length;wr++)rr.children.push(Tc(r,nr[wr],e+1,Xr,i,null));return rr}function Lv(r){if(r.children.length===0)return{t1:r.pt,e1:r.pw,t2:0,e2:0};var l=wd(r);return{t1:r.pt,e1:r.pw+r.x1,t2:l.height,e2:r.x2+l.width}}function wd(r){if(r.tetris!=null)return r.tetris;var l=[{x1:-1/0,x2:1/0,v:-1/0}],e=[];function c(Pr,ve){for(var xr=[],qr=0;qr<l.length;qr++){var ze=l[qr];if(!(Pr>=ze.x2)&&(xr.push(ze),ve<=ze.x2))return xr}return xr}function i(Pr,ve){for(var xr=c(Pr,ve),qr=-1/0,ze=0;ze<xr.length;ze++)xr[ze].v>qr&&(qr=xr[ze].v);return qr}function h(Pr,ve,xr){if(!(ve<=Pr)){var qr=c(Pr,ve);if(qr.length>1){for(var ze=Pr,wo=1;wo<qr.length;wo++)h(ze,qr[wo].x1,xr),ze=qr[wo].x1;h(ze,ve,xr)}else if(qr.length===1){var me=qr[0];if(xr<=me.v)return;l.splice(l.indexOf(me),1),me.x1!==Pr&&l.push({x1:me.x1,x2:Pr,v:me.v}),l.push({x1:Pr,x2:ve,v:xr}),ve!==me.x2&&l.push({x1:ve,x2:me.x2,v:me.v}),l.sort(function(ue,po){return ue.x1-po.x1})}}}for(var F=0,j=0;j<r.children.length;j++){var p=r.children[j],or=Lv(p),q;if(l.length===1)q=0;else{var rr=i(0,or.e1),nr=i(or.e1,or.e1+or.e2);q=Math.max(rr+or.t1/2,nr+or.t2/2)}e.push({finger:p,tee:or,y:q}),h(0,or.e1,q+or.t1/2),or.e2>0&&h(or.e1,or.e1+or.e2,q+or.t2/2),or.e1+or.e2>F&&(F=or.e1+or.e2)}for(var Xr=1/0,wr=-1/0,pr=0;pr<e.length;pr++){var Dr=Math.max(e[pr].tee.t1,e[pr].tee.t2)/2;e[pr].y-Dr<Xr&&(Xr=e[pr].y-Dr),e[pr].y+Dr>wr&&(wr=e[pr].y+Dr)}if(e.length>0)for(var Ze=(Xr+wr)/2,he=0;he<e.length;he++)e[he].y-=Ze;return r.tetris={elements:e,height:e.length>0?wr-Xr:0,width:F},r.tetris}function Ah(r){return Math.max(r.pt,r.children.length>0?wd(r).height:0)}function Gv(r){return r.children.length>0?wd(r).width:0}function Bc(r,l,e,c){var i=r.direction,h=r.cellId;if(r.pt>0||r.pw>0){var F=i===1?l:l-r.w,j=e-r.pt/2+r.marginTop;h=c.nextId(r.level===0?"root":"mm"),c.cells+=gh(h,r.node,r.m,ph(r.props,r.m,r.boxless,r.node.label),F,j,r.w,r.h),c.track(F,j,r.w,r.h)}if(r.children.length>0)for(var p=wd(r),or=i===1?"exitX=1;exitY=0.5;entryX=0;entryY=0.5;":"exitX=0;exitY=0.5;entryX=1;entryY=0.5;",q=0;q<p.elements.length;q++){var rr=p.elements[q],nr=Bc(rr.finger,l+i*(r.pw+r.x1+r.x2),e+rr.y,c);h!=null&&nr!=null&&r.link!=null&&(c.cells+=mr(c.nextId("mmedge"),"","edgeStyle=orthogonalEdgeStyle;curved=1;endArrow=none;startArrow=none;html=1;"+r.link+or,h,nr,"1"))}return h}function wv(r,l,e,c){for(var i=[],h=[],F=0;F<r.children.length;F++)(r.children[F].side==="left"?h:i).push(r.children[F]);var j=null,p=null;h.length>0&&(p=Tc(e,r,0,[],-1,h)),(p==null||i.length>0)&&(j=Tc(e,r,0,[],1,i)),j!=null&&p!=null&&(p.pw=0,p.pt=0);var or=Math.max(j!=null?Ah(j)/2:0,p!=null?Ah(p)/2:0),q=p!=null?p.pw+Gv(p)+p.x1+p.x2:0,rr=Nf+q,nr=l+or;if(j!=null){var Xr=Bc(j,rr,nr,c);p!=null&&(p.cellId=Xr)}return p!=null&&Bc(p,rr,nr,c),2*or}function Pv(r,l){for(var e=0,c=r.styleSheet||Ft.createSheet(),i={cells:"",maxX:0,nextId:function(ve){return ve+"_"+e++},track:function(ve,xr,qr,ze){ve+qr>i.maxX&&(i.maxX=ve+qr)}},h=[],F=r.roots||(r.root?[r.root]:[]),j=0;j<F.length;j++)F[j]&&F[j].label!=null&&!F[j].synthetic&&h.push(F[j]);if(h.length===0)return"";for(var p=Tv,or=0;or<h.length;or++)p+=wv(h[or],p,c,i)+Rh;var q=i.cells,rr=p-Rh,nr=i.maxX+Nf;if(r.title){var Xr=Gd(s(r.title))+10;q+=u(i.nextId("title"),r.title,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",(nr-Xr)/2,-34,Xr,24,"1")}if(r.header&&r.header.text){var wr=Gd(s(r.header.text))*.7142857142857143+8,pr=r.header.align==="left"?Nf:r.header.align==="center"?(nr-wr)/2:nr-Nf-wr;q+=u(i.nextId("header"),r.header.text,"text;html=1;fillColor=none;strokeColor=none;fontSize=10;fontColor=#888888;align="+(r.header.align||"right")+";verticalAlign=middle;",pr,r.title?-56:-34,wr,16,"1")}var Dr=rr+13;if(r.caption){var Ze=Gd(s(r.caption))+10;q+=u(i.nextId("caption"),r.caption,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontColor=#000000;align=center;verticalAlign=middle;",(nr-Ze)/2,Dr,Ze,22,"1"),Dr+=18}if(r.footer&&r.footer.text){var he=Gd(s(r.footer.text))*.7142857142857143+8,Pr=r.footer.align==="left"?Nf:r.footer.align==="right"?nr-Nf-he:(nr-he)/2;q+=u(i.nextId("footer"),r.footer.text,"text;html=1;fillColor=none;strokeColor=none;fontSize=10;fontColor=#888888;align="+(r.footer.align||"center")+";verticalAlign=middle;",Pr,Dr,he,16,"1")}return q}var mh=20,kh=20,_h=40,ad=10,xv={top:1,right:3,bottom:1,left:0};function Oh(r,l,e,c){for(var i=l.style==="leaf",h=ch(r,"wbsDiagram",l,e,c),F=hh(l,h,i,xv),j={node:l,level:e,props:h,m:F,boxless:i,w:F.w,h:F.h,marginBottom:Ft.clockwise(h,"Margin").bottom,auto:/^auto$/i.test(String(Ft.raw(h,"Width")||"").replace(/^\s+|\s+$/g,"")),link:$h(Dc(r,"wbsDiagram",l,e)),children:[],left:[],forced:0,textDx:0,dimW:0,dimH:0,w1:0},p=[l].concat(c),or=0;or<l.children.length;or++){var q=Oh(r,l.children[or],e+1,p);l.children[or].side==="left"?e===0?j.children.unshift(q):j.left.push(q):j.children.push(q)}var rr=j.left.concat(j.children);if(j.auto&&rr.length>0){for(var nr=0,Xr=0;Xr<rr.length;Xr++)rr[Xr].w>nr&&(nr=rr[Xr].w);for(var wr=0;wr<rr.length;wr++){var pr=rr[wr];pr.forced=nr,pr.boxless||(pr.w=Math.max(pr.w,nr))}}return j}function ld(r){return r.children.length===0&&r.left.length===0}function Ic(r){if(ld(r)){r.dimW=r.boxless?Math.max(r.w,r.forced):r.w,r.dimH=r.h,r.w1=r.dimW/2,r.textDx=r.boxless&&r.forced>r.w?(r.forced-r.w)/2:0;return}var l=0,e=0,c=0,i=0,h;for(h=0;h<r.left.length;h++)Ic(r.left[h]),r.left[h].dimW>l&&(l=r.left[h].dimW),e+=r.marginBottom+r.left[h].dimH;for(h=0;h<r.children.length;h++)Ic(r.children[h]),r.children[h].dimW>c&&(c=r.children[h].dimW),i+=r.marginBottom+r.children[h].dimH;r.w1=Math.max(r.w/2,ad+l),r.dimW=r.w1+Math.max(r.w/2,ad+c),r.dimH=r.h+Math.max(e,i)}function Yv(r){return ld(r)?{x:0,y:r.h/2}:{x:r.w1-r.w/2,y:r.h/2}}function Mv(r){return ld(r)?{x:r.dimW,y:r.h/2}:{x:r.w1+r.w/2,y:r.h/2}}function yh(r){return ld(r)?r.dimW/2:r.w1}function Nc(r,l,e,c){if(ld(r)){c.boxes.push({el:r,x:l+r.textDx,y:e});return}c.boxes.push({el:r,x:l+r.w1-r.w/2,y:e});var i=l+r.w1,h=e+r.h,F=h,j,p;for(j=0;j<r.left.length;j++){p=r.left[j],F+=r.marginBottom;var or=Mv(p),q=i-p.dimW-ad;c.links.push({from:r,to:p,link:r.link,route:[{x:i,y:h},{x:i,y:F+or.y},{x:q+or.x,y:F+or.y}]}),Nc(p,q,F,c),F+=p.dimH}for(F=h,j=0;j<r.children.length;j++){p=r.children[j],F+=r.marginBottom;var rr=Yv(p);c.links.push({from:r,to:p,link:r.link,route:[{x:i,y:h},{x:i,y:F+rr.y},{x:i+ad+rr.x,y:F+rr.y}]}),Nc(p,i+ad,F,c),F+=p.dimH}}function Hv(r,l){var e=r.root;if(!e||e.label==null)return"";var c=0;function i(yo){return yo+"_"+c++}var h=r.styleSheet||Ft.createSheet(),F=Oh(h,e,0,[]),j={boxes:[],links:[],lines:[]},p,or,q,rr,nr;for(p=0;p<F.children.length;p++)Ic(F.children[p]);var Xr=F.h,wr=Xr+_h/2,pr=Xr+_h;if(F.children.length===0)j.boxes.push({el:F,x:0,y:0}),j.lines.push({x1:F.w/2,y1:Xr,x2:F.w/2,y2:wr,link:F.link});else{var Dr=0,Ze=yh(F.children[0]),he=Ze,Pr=0,ve=[];for(p=0;p<F.children.length;p++){var xr=F.children[p];he=Dr+yh(xr),ve.push(he),Nc(xr,Dr,pr,j),Dr+=xr.dimW+kh,Pr+=xr.dimW+(p>0?kh:0)}var qr=he>Ze?Ze+(he-Ze-F.w)/2:(Math.max(Pr,F.w)-F.w)/2,ze=qr+F.w/2;for(p=0;p<F.children.length;p++)j.links.push({from:F,to:F.children[p],link:F.link,route:[{x:ze,y:Xr},{x:ze,y:wr},{x:ve[p],y:wr},{x:ve[p],y:pr}]});j.boxes.push({el:F,x:qr,y:0})}var wo=0,me=0;for(p=0;p<j.boxes.length;p++)q=j.boxes[p],q.x<wo&&(wo=q.x),q.y<me&&(me=q.y);for(p=0;p<j.links.length;p++)for(or=0;or<j.links[p].route.length;or++)j.links[p].route[or].x<wo&&(wo=j.links[p].route[or].x),j.links[p].route[or].y<me&&(me=j.links[p].route[or].y);for(p=0;p<j.lines.length;p++)nr=j.lines[p],Math.min(nr.x1,nr.x2)<wo&&(wo=Math.min(nr.x1,nr.x2)),Math.min(nr.y1,nr.y2)<me&&(me=Math.min(nr.y1,nr.y2));var ue=mh-wo,po=mh-me,x="";for(p=0;p<j.boxes.length;p++)j.boxes[p].el.id=i("wbs");for(p=0;p<j.links.length;p++)if(rr=j.links[p],rr.link!=null){var S=[];for(or=0;or<rr.route.length;or++){var fr=rr.route[or];(S.length===0||Math.abs(fr.x-rr.route[or-1].x)>1e-9||Math.abs(fr.y-rr.route[or-1].y)>1e-9)&&S.push({x:fr.x+ue,y:fr.y+po})}S.length<2||(x+=er(i("wbse"),"","endArrow=none;startArrow=none;rounded=0;curved=0;"+rr.link,S[0].x,S[0].y,S.slice(1,-1),S[S.length-1].x,S[S.length-1].y,"1",rr.from.id,rr.to.id))}for(p=0;p<j.lines.length;p++)nr=j.lines[p],!(nr.link==null||nr.x1===nr.x2&&nr.y1===nr.y2)&&(x+=G(i("wbse"),"","endArrow=none;startArrow=none;rounded=0;curved=0;"+nr.link,nr.x1+ue,nr.y1+po,nr.x2+ue,nr.y2+po,"1"));for(p=0;p<j.boxes.length;p++)q=j.boxes[p],x+=gh(q.el.id,q.el.node,q.el.m,ph(q.el.props,q.el.m,q.el.boxless,q.el.node.label),q.x+ue,q.y+po,q.el.w,q.el.h);var zr={};for(p=0;p<j.boxes.length;p++)j.boxes[p].el.node.code!=null&&(zr[j.boxes[p].el.node.code]=j.boxes[p]);var Lr=r.links||[];for(p=0;p<Lr.length;p++){var te=Lr[p],W=zr[te.from],Zr=zr[te.to];if(!(W==null||Zr==null)){var Re={x:W.x+ue+W.el.w/2,y:W.y+po+W.el.h/2},Ae={x:Zr.x+ue+Zr.el.w/2,y:Zr.y+po+Zr.el.h/2},Pe=Ae.x-Re.x,De=Ae.y-Re.y;if(!(Pe===0&&De===0)){var Qr=bh(Re,W.el.w/2,W.el.h/2,Pe,De),Po=bh(Ae,Zr.el.w/2,Zr.el.h/2,-Pe,-De),Qe=te.color!=null?If(te.color,"#181818"):If(Ft.color(Dc(h,"wbsDiagram",{stereotypes:te.stereotypes||[]},null),"LineColor"),"#181818");Qe!=="none"&&(x+=er(i("wbsl"),"","endArrow=classic;endFill=1;endSize=8;startArrow=none;rounded=0;curved=0;strokeColor="+Qe+";strokeWidth=1;",Ds(Qr.x),Ds(Qr.y),[],Ds(Po.x),Ds(Po.y),"1",W.el.id,Zr.el.id))}}}return x}function bh(r,l,e,c,i){var h=Math.min(c!==0?l/Math.abs(c):1/0,i!==0?e/Math.abs(i):1/0);return{x:r.x+c*h,y:r.y+i*h}}var Wi=23,Pd=14,Fh=37,Ws=18,Eh=20,Lc=15,Lf=null;function Fu(r,l){return Lf==null||Lf.sheet==null?{}:U(Lf.sheet,["root","element",Lf.diagram].concat(r),[],l||"vertex")}function Gc(r,l){for(var e={},c=0;c<l.length;c++)r[l[c]]!=null&&(e[l[c]]=r[l[c]]);return e}function Sh(){var r=Gc(Fu(["node"],"edge"),["strokeColor"]),l=Fu(["separator"],"edge");return l.strokeColor!=null&&(r.strokeColor=l.strokeColor),l.strokeWidth!=null&&(r.strokeWidth=l.strokeWidth),r}function Dh(r){var l=Fu(["node"],"vertex");if(delete l.fontStyleBits,r){var e=Fu(["highlight"],"vertex");e.fillColor!=null?l.fillColor=e.fillColor:delete l.fillColor}return l}function Kv(r,l){return H("rounded=1;absoluteArcSize=1;arcSize=10;whiteSpace=wrap;fillColor="+r+";strokeColor=#000000;strokeWidth=1.5;",Dh(l))}function Th(){var r=Fu(["separator"],"edge");return r.strokeColor!=null||r.strokeWidth!=null}function Bh(r,l){var e=Dh(l);return Th()&&(e.rowLines="0"),H("shape=table;childLayout=tableLayout;container=1;collapsible=0;startSize=0;rowLines=1;fixedRows=1;resizeLast=1;rounded=1;absoluteArcSize=1;arcSize=10;whiteSpace=wrap;fillColor="+r+";strokeColor=#000000;strokeWidth=1.5;",e)}function Ih(r){var l=Sh();if(Th()&&(l.bottom="1"),r){var e=Fu(["highlight"],"vertex");e.fillColor!=null&&(l.fillColor=e.fillColor)}return H("shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;collapsible=0;dropTarget=0;strokeColor=#000000;top=0;left=0;right=0;bottom=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fillColor="+(r||"none")+";",l)}function wc(r,l,e){var c=Gc(Fu(["node"],"text"),["fontColor","fontSize","fontFamily"]),i=Sh();if(i.strokeColor!=null&&(c.strokeColor=i.strokeColor),e){var h=Fu(["highlight"],"text");h.fontColor!=null&&(c.fontColor=h.fontColor)}return H("shape=partialRectangle;connectable=0;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right="+(l?1:0)+";strokeColor=#000000;whiteSpace=wrap;fontSize="+Pd+";align=left;spacingLeft=5;verticalAlign=middle;"+(r?"fontStyle=1;":""),c)}var zv="endArrow=classic;dashed=1;dashPattern=3 3;curved=1;html=1;strokeColor=#000000;";function Nh(){return H(zv,Fu(["arrow"],"edge"))}function id(r,l){return Math.ceil(Ss(r,Pd,l))+10}function sd(r){if(r==null||typeof r!="object"){var l=Math.max(40,id(String(r),!1));return{keyW:0,valW:l,w:l}}if(Array.isArray(r)){for(var e=Lc,c=0;c<r.length;c++)(r[c]==null||typeof r[c]!="object")&&(e=Math.max(e,id(String(r[c]),!1)));return{keyW:0,valW:e,w:e}}var i=Lc,h=Lc;for(var F in r)if(r.hasOwnProperty(F)){i=Math.max(i,id(F,!0));var j=r[F];(j==null||typeof j!="object")&&(h=Math.max(h,id(String(j),!1)))}return{keyW:i,valW:h,w:i+h}}function Gf(r){if(r==null||typeof r!="object")return Wi;var l=0,e=0;if(Array.isArray(r)){l=r.length;for(var c=0;c<r.length;c++)r[c]!=null&&typeof r[c]=="object"&&(e+=Gf(r[c])+Ws)}else for(var i in r)r.hasOwnProperty(i)&&(l++,r[i]!=null&&typeof r[i]=="object"&&(e+=Gf(r[i])+Ws));return Math.max(Math.max(1,l)*Wi,e>0?e-Ws:0)}function Pc(r,l,e,c,i,h,F){var j="",p=h!==""?h:r;r===""&&h===""&&(p="");for(var or=!1,q=0;q<i.length;q++)if(i[q]===p){or=!0;break}var rr=or?"#CCFF02":"#F1F1F1",nr="text;whiteSpace=wrap;fontSize="+Pd+";align=left;spacingLeft=5;verticalAlign=middle;",Xr=sd(l);if(l==null||typeof l!="object"){var wr=r!==""?r+": "+String(l):String(l),pr=Math.max(40,id(wr,!1)),Dr=F("jn");return j+=u(Dr,wr,H(Kv(rr,or)+"fontSize="+Pd+";align=left;spacingLeft=5;",Gc(Fu([or?"highlight":"node"],"text"),["fontColor","fontSize","fontFamily"])),e,c,pr,Wi,"1"),{cells:j,height:Wi,width:pr,rootId:Dr}}if(Array.isArray(l)){var Ze=Math.max(1,l.length),he=Xr.w,Pr=Wi*Ze,ve=F("ja");j+=u(ve,"",Bh(rr,or),e,c,he,Pr,"1");for(var xr=[],qr=0;qr<l.length;qr++){var ze=l[qr]!=null&&typeof l[qr]=="object",wo=ze?"":String(l[qr]),me=F("jw");j+=u(me,"",Ih(null),0,qr*Wi,he,Wi,ve);var ue=F("jr");if(j+=u(ue,wo,wc(!1,!1),0,0,he,Wi,me),ze){var po=F("jb");xr[qr]=po,j+=u(po,"","ellipse;fillColor=#000000;strokeColor=#000000;",he-16,Wi/2-3,6,6,ue)}}for(var x=e+he+Fh,S=Pr,fr=0,zr=0,Lr=0,te=-1,W=0;W<l.length;W++)l[W]!=null&&typeof l[W]=="object"&&(fr=Math.max(fr,sd(l[W]).w),zr+=Gf(l[W])+Ws,Lr++,te=W);var Zr=c;Lr===1?Zr=c+Math.max(0,te*Wi+Wi/2-Gf(l[te])/2):Lr>1&&(Zr=c+Math.max(0,(Pr-(zr-Ws))/2));for(var Re=0;Re<l.length;Re++)if(l[Re]!=null&&typeof l[Re]=="object"){var Ae=p!==""?p+"/"+Re:String(Re),Pe=sd(l[Re]).w,De=Pc(String(Re),l[Re],x+(fr-Pe)/2,Zr,i,Ae,F);j+=De.cells,j+=mr(F("je"),"",Nh(),xr[Re],De.rootId,"1"),Zr+=De.height+Ws}return Zr-Ws>c+Pr&&(S=Zr-Ws-c),{cells:j,height:S,width:he,rootId:ve}}var Qr=[];for(var Po in l)l.hasOwnProperty(Po)&&Qr.push(Po);var Qe=Math.max(1,Qr.length),yo=Xr.keyW,ie=Xr.w,pe=Wi*Qe,Mo=F("jo");j+=u(Mo,"",Bh(rr,or),e,c,ie,pe,"1");for(var Zt=[],Uo=0;Uo<Qr.length;Uo++){for(var xn=l[Qr[Uo]],gt=xn!=null&&typeof xn=="object",To=gt?"":String(xn),Rt=p!==""?p+"/"+Qr[Uo]:Qr[Uo],Be=!1,Ao=0;Ao<i.length;Ao++)if(i[Ao]===Rt){Be=!0;break}var et=Uo*Wi,jo=F("jw");j+=u(jo,"",Ih(Be?"#CCFF02":null),0,et,ie,Wi,Mo),j+=u(F("jr"),Qr[Uo],wc(!0,!0,Be),0,0,yo,Wi,jo);var Tn=F("jr");if(j+=u(Tn,To,wc(!1,!1,Be),yo,0,ie-yo,Wi,jo),gt){var dn=F("jb");Zt[Uo]=dn,j+=u(dn,"","ellipse;fillColor=#000000;strokeColor=#000000;",ie-yo-16,Wi/2-3,6,6,Tn)}}for(var An=e+ie+Fh,Bo=pe,kt=0,Yn=0,go=0,Ho=-1,Ro=0;Ro<Qr.length;Ro++){var At=l[Qr[Ro]];At!=null&&typeof At=="object"&&(kt=Math.max(kt,sd(At).w),Yn+=Gf(At)+Ws,go++,Ho=Ro)}var ot=c;go===1?ot=c+Math.max(0,Ho*Wi+Wi/2-Gf(l[Qr[Ho]])/2):go>1&&(ot=c+Math.max(0,(pe-(Yn-Ws))/2));for(var oo=0;oo<Qr.length;oo++){var to=l[Qr[oo]];if(to!=null&&typeof to=="object"){var cn=p!==""?p+"/"+Qr[oo]:Qr[oo],Yt=sd(to).w,so=Pc(Qr[oo],to,An+(kt-Yt)/2,ot,i,cn,F);j+=so.cells,j+=mr(F("je"),"",Nh(),Zt[oo],so.rootId,"1"),ot+=so.height+Ws}}return ot-Ws>c+pe&&(Bo=ot-Ws-c),{cells:j,height:Bo,width:ie,rootId:Mo}}function Lh(r,l){var e=0;function c(i){return i+"_"+e++}if(r.data==null&&!r.rootPresent)return"";Lf={sheet:r.styleSheet||null,diagram:typeof l=="string"?l:"jsonDiagram"};try{return Pc("",r.data,Eh,Eh,r.highlights||[],"",c).cells}finally{Lf=null}}function Uv(r){return Lh(r,"yamlDiagram")}function ud(r){var l=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(r||"");return l?("#"+l[1]+l[1]+l[2]+l[2]+l[3]+l[3]).toUpperCase():Y(r)}function Wv(r){if(!r)return 1;var l=String(r).split(/\\n|\r\n|\r|\n|<br\s*\/?>/i);return l.length<1?1:l.length}function wf(r,l){if(!r)return 0;for(var e=String(r).split(/\\n|\r\n|\r|\n|<br\s*\/?>/i),c=0,i=0;i<e.length;i++)e[i].length>c&&(c=e[i].length);return c*l*.5}function Xv(r){var l=r.tasks,e="",c=0;function i(yr){return yr+"_"+c++}var h=r.styleSheet||null,F={gb:"task",gl:"task",gbj:"task",gsp:"separator",gsl:"separator",gd:"milestone",ga:"arrow",gm:"timeline",gt:"timeline",gnd:"timeline"},j=null,p="";function or(yr,Io){return U(h,["root","element","ganttDiagram",yr],[],Io)}function q(yr,Io,ge){var Ct=F[String(yr).split("_")[0]];if(Ct==null||h==null)return Io;var Nn=ge?"edge":Io.indexOf("text;")===0?"text":"vertex",Qn=or(Ct,Nn);if(j!=null)for(var kn=0;kn<j.length;kn++)delete Qn[j[kn]];return H(Io,Qn)}var rr=function(yr,Io,ge,Ct,Nn,Qn,kn,Ke){if(String(yr).indexOf("gsh_")===0){if(/fillColor=#F1E5E5;/.test(ge)){var yn=or("closed","vertex");yn.fillColor&&(ge=H(ge,{fillColor:yn.fillColor}))}return m(yr,Io,ge,Ct,Nn,Qn,kn,Ke)}return m(yr,Io,q(yr,ge,!1),Ct,Nn,Qn,kn,Ke)},nr=function(yr,Io,ge,Ct,Nn,Qn,kn,Ke){return I(yr,Io,q(yr,ge,!0),Ct,Nn,Qn,kn,Ke)};if(l.length===0&&!r.projectStart)return"";var Xr=!!r.projectStart,wr=Xr&&r.printScale||"daily",pr={daily:1,weekly:4,monthly:15,quarterly:40,yearly:60},Dr=16/(pr[wr]||1)*(r.zoom||1),Ze={},he={},Pr=0,ve=[!1,!1,!1,!1,!1,!1,!1],xr=!1;if(r.projectStart&&r.closedWeekdays&&r.closedWeekdays.length){for(var qr={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6},ze=0;ze<r.closedWeekdays.length;ze++){var wo=qr[r.closedWeekdays[ze]];wo!==void 0&&(ve[wo]=!0,xr=!0)}ve.join()==="true,true,true,true,true,true,true"&&(xr=!1)}var me=r.projectStart?new Date(r.projectStart+"T00:00:00Z").getUTCDay():1,ue={},po={},x=xr;function S(yr){var Io=Math.floor(yr);return po[Io]?!1:ue[Io]?!0:xr&&ve[(me+Io%7+7)%7]}function fr(yr){for(;S(yr);)yr++;return yr}function zr(yr,Io){var ge=fr(yr);if(!x||Io<=0)return{s:ge,e:ge+Io};for(var Ct=Io,Nn=ge;Ct>0;)if(S(Nn))Nn++;else{var Qn=Math.min(1,Ct);Ct-=Qn,Nn+=Qn}return{s:ge,e:Nn}}function Lr(yr){if(!yr||!r.projectStart)return null;var Io=Date.parse(yr+"T00:00:00Z")-Date.parse(r.projectStart+"T00:00:00Z");return isNaN(Io)?null:Math.round(Io/864e5)}var te={},W={},Zr={},Re=0,Ae=null;r.today&&(Ae=r.today.date?Lr(r.today.date):r.today.offset);function Pe(yr){return yr?yr.date?Lr(yr.date):yr.anchor==="D"?yr.offset:yr.anchor==="T"?Ae==null?null:Ae+yr.offset:null:null}for(var De=null,Qr=0;r.periods&&Qr<r.periods.length;Qr++){var Po=r.periods[Qr],Qe=Po.from.afterPrev?De==null?null:De+1:Pe(Po.from),yo=Po.to.days!=null?Qe==null?null:Qe+Po.to.days-1:Pe(Po.to);if(!(Qe==null||yo==null)){if(yo<Qe){var ie=Qe;Qe=yo,yo=ie}De=yo;for(var pe=Qe;pe<=yo;pe++)Po.color&&(te[pe]=Po.color),Po.name&&(W[pe]=Po.name),Po.closed===!0?(ue[pe]=!0,x=!0):Po.closed===!1&&(po[pe]=!0);Po.name&&(Zr[Po.name]={s:Qe,e:yo+1,d:yo-Qe+1}),(Po.color||Po.name)&&(Re=Math.max(Re,yo+1))}}Ae!=null&&r.todayColor&&(te[Ae]=r.todayColor);for(var Mo in Zr)Zr.hasOwnProperty(Mo)&&(Ze[Mo]=Zr[Mo]);var Zt=[],Uo=[];function xn(yr,Io){var ge;for(ge=Io-1;ge>=0;ge--)if(!l[ge].isSeparator&&(l[ge].name===yr||l[ge].alias===yr))return ge;for(ge=Io+1;ge<l.length;ge++)if(!l[ge].isSeparator&&(l[ge].name===yr||l[ge].alias===yr))return ge;return null}function gt(yr,Io){if(yr==null)return null;var ge=xn(yr,Io);return ge!=null?(To(ge),Zt[ge]||null):Zr.hasOwnProperty(yr)?Zr[yr]:null}function To(yr){if(!Uo[yr]){Uo[yr]=1;var Io=0,ge=l[yr],Ct;if(ge.after&&(Ct=gt(ge.after,yr))!=null)Io=Ct.e,ge.afterOffset&&(Io=ge.afterWorking?zr(Io,ge.afterOffset).e:Io+ge.afterOffset);else if(ge.alignStart&&(Ct=gt(ge.alignStart,yr))!=null)Io=Ct.s;else if(ge.startOffset!=null)Io=ge.startOffset;else if(ge.start&&r.projectStart){var Nn=Lr(ge.start);Nn!=null&&Nn>0&&(Io=Nn)}for(var Qn=0;Qn<ge.predecessors.length;Qn++){var kn=gt(ge.predecessors[Qn].ref,yr);kn!=null&&kn.e>Io&&(Io=kn.e)}var Ke=ge.duration;if(!Ke){var yn=null;ge.endAlign&&(Ct=gt(ge.endAlign,yr))!=null?yn=Ct.e-1:ge.endOffset!=null?yn=ge.endOffset:ge.end&&(yn=Lr(ge.end)),yn!=null&&yn>=Io&&(Ke=yn-Io+1)}if(!Ke&&!ge.isMilestone&&(Ke=1),Ke&&ge.resources&&ge.resources.length>1){for(var tn=0,Ia=0;Ia<ge.resources.length;Ia++)tn+=ge.resources[Ia].pct>0?ge.resources[Ia].pct:100;tn>0&&(Ke=Ke*100/tn)}var Ma=zr(Io,Ke);Zt[yr]={s:Ma.s,d:Ke,e:Ma.e},Uo[yr]=2}}for(var Rt=0;Rt<l.length;Rt++)l[Rt].isSeparator||To(Rt);for(var Be=0;Be<l.length;Be++){var Ao=Zt[Be];l[Be].isSeparator||Ao==null||(Ze[l[Be].name]=Ao,he[l[Be].name]=Be,l[Be].alias&&(Ze[l[Be].alias]=Ao,he[l[Be].alias]=Be),Ao.e>Pr&&(Pr=Ao.e))}Pr=Math.ceil(Math.max(Pr,Re)),Pr<1&&(Pr=l.length===0?1:10);for(var et=!1,jo=0;jo<Pr;jo++)W[jo]&&(et=!0);var Tn=12.955,dn=4,An=36.955;function Bo(yr){return yr*Dr}var kt;Xr?wr==="weekly"?kt=27:wr==="monthly"||wr==="quarterly"?kt=28:wr==="yearly"?kt=17:kt=39:kt=6;var Yn=kt;et&&Xr&&wr!=="quarterly"&&wr!=="yearly"&&(kt+=16);for(var go=Xr?kt+2:18,Ho=[],Ro=[],At=go,ot=!1,Be=0;Be<l.length;Be++){if(l[Be].isSeparator){Ho[Be]=At-(ot?dn:0),Ro[Be]=An,At=Ho[Be]+An,ot=!1;continue}var oo=l[Be].isMilestone?1:Wv(l[Be].name),to=oo*Tn;Ho[Be]=At,Ro[Be]=to,At+=to+dn,ot=!0}for(var cn=l.length?Ho[l.length-1]+Ro[l.length-1]:kt-(Xr?2:10),Yt=[],so={},Bn=32,tt=0;tt<l.length;tt++){var an=l[tt],Ga=an.resources&&an.resources.length>0?an.resources:an.resource?[{name:an.resource,pct:100}]:[];if(!(an.isMilestone||an.isSeparator||Ga.length===0))for(var hn=Ze[an.name],Da=0;Da<Ga.length;Da++){var jt=Ga[Da].name;so[jt]||(so[jt]={},Yt.push(jt));for(var _n=hn.s;_n+1<=hn.e+1e-9;_n++)S(_n)||(so[jt][_n]=!0)}}var da=Yt.length*Bn,Jt=cn+da+(Xr?2:10),Ut=Bo(Pr),ga=null,mn=[],ma=Xr?new Date(r.projectStart+"T00:00:00Z"):null;function oa(yr){return new Date(ma.getTime()+yr*864e5)}if(Xr){var On=["Mo","Tu","We","Th","Fr","Sa","Su"],Za=(ma.getUTCDay()+6)%7;ga=[];for(var be=0;be<Pr;be++)ga[be]=On[(Za+be)%7],mn[be]=String(oa(be).getUTCDate())}else for(var $n=0;$n<Pr;$n++)mn[$n]=String($n+1);var Wn=["January","February","March","April","May","June","July","August","September","October","November","December"],$r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ee(yr){var Io=oa(yr),ge=(Io.getUTCDay()+6)%7;Io=new Date(Io.getTime()+(3-ge)*864e5);var Ct=new Date(Date.UTC(Io.getUTCFullYear(),0,4)),Nn=(Ct.getUTCDay()+6)%7;return Ct=new Date(Ct.getTime()+(3-Nn)*864e5),1+Math.round((Io.getTime()-Ct.getTime())/(7*864e5))}var Rr="endArrow=none;startArrow=none;strokeColor=#C0C0C0;strokeWidth=1;";function tr(yr,Io,ge){e+=nr(i("gg"),"",Rr,Io,yr,ge,yr,"1")}function vr(yr,Io,ge){e+=nr(i("gg"),"",Rr,yr,Io,yr,ge,"1")}function Te(yr,Io,ge,Ct,Nn,Qn,kn,Ke,yn){for(var tn=Io.length-1;tn>=0;tn--){var Ia=wf(Io[tn],kn);if(tn===0&&!yn||Ia<=Ct-ge){e+=rr(i(yr),Io[tn],"text;html=1;align=center;verticalAlign=middle;fontSize="+kn+";"+(Ke?"fontStyle=1;":"")+"fontColor=#000000;",ge,Nn,Ct-ge,Qn,"1");return}}}function jr(yr){for(var Io=[],ge=0,Ct=null,Nn=0;Nn<=Pr;Nn++){var Qn=Nn<Pr?yr(oa(Nn)):null;(Nn===Pr||Ct!==null&&Qn!==Ct)&&(Io.push({s:ge,e:Nn,date:oa(ge)}),ge=Nn),Ct=Qn}return Io}function _e(yr){return yr.getUTCFullYear()*12+yr.getUTCMonth()}function Br(yr){return yr.getUTCFullYear()}function br(yr){return yr.getUTCFullYear()*4+Math.floor(yr.getUTCMonth()/3)}function Or(yr,Io){for(var ge=[],Ct=0;Ct<Io.length;Ct++){var Nn=Io[Ct];ge.push(Nn==="myl"?Wn[yr.getUTCMonth()]+" "+yr.getUTCFullYear():Nn==="mys"?$r[yr.getUTCMonth()]+" "+yr.getUTCFullYear():Nn==="ml"?Wn[yr.getUTCMonth()]:$r[yr.getUTCMonth()])}return ge}function xe(yr,Io,ge,Ct,Nn,Qn,kn,Ke){for(var yn=0;yn<Io.length;yn++){var tn=Io[yn];vr(Bo(tn.s),ge,ge+Ct),Te(yr,kn(tn.date),Bo(tn.s),Bo(tn.e),ge,Ct,Nn,Qn,Ke)}vr(Ut,ge,ge+Ct)}for(var bo=-1,_t=null,Wo=0;Wo<=Pr;Wo++){var Fo=null;Wo<Pr&&(te[Wo]&&(Fo=ud(te[Wo])||null),!Fo&&S(Wo)&&(Fo="#F1E5E5")),bo>=0&&Fo!==_t&&(e+=rr(i("gsh"),"","rounded=0;fillColor="+_t+";strokeColor=none;",Bo(bo),kt,Bo(Wo)-Bo(bo),Jt-kt,"1"),bo=-1),Fo&&bo<0&&(bo=Wo,_t=Fo)}if(et&&kt>Yn)for(var ut=null,Do=0;Do<Pr;Do++){var Fr=W[Do]||null;Fr&&Fr!==ut&&(e+=rr(i("gnd"),Fr,"text;html=1;align=left;verticalAlign=middle;fontSize=12;fontColor=#000000;",Bo(Do)-4,Yn,Math.max(wf(Fr,12)+8,20),16,"1")),ut=Fr}var Gt=wr==="weekly",st;if(Xr)if(wr==="daily"){for(var jn=jr(_e),Hn=0;Hn<jn.length;Hn++){var Xo=jn[Hn];Te("gm",Or(Xo.date,["ms","ml","myl"]),Bo(Xo.s),Bo(Xo.e),0,14,12,!0,!1),Te("gm",Or(Xo.date,["ms","ml","myl"]),Bo(Xo.s),Bo(Xo.e),Jt+29,14,12,!0,!1)}for(var Xn=0;Xn<=Pr;Xn++)vr(Bo(Xn),kt,Jt);for(tr(kt,0,Ut),tr(Jt,0,Ut),st=0;st<Pr;st++)e+=rr(i("gt"),ga[st],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Bo(st),14,Dr,12,"1"),e+=rr(i("gt"),mn[st],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Bo(st),26,Dr,12,"1"),e+=rr(i("gt"),ga[st],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Bo(st),Jt+1,Dr,12,"1"),e+=rr(i("gt"),mn[st],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Bo(st),Jt+15,Dr,12,"1")}else if(Gt){var Ta=jr(_e);xe("gm",Ta,0,16,12,!0,function(yr){return Or(yr,["ms","mys"])},!1),tr(0,0,Ut),tr(16,0,Ut),tr(27,0,Ut);for(var Kn=0;Kn<Pr;Kn++)if((me+Kn)%7===1&&(vr(Bo(Kn),16,Jt),Kn<Pr-1)){var Qo=String(ee(Kn));e+=rr(i("gt"),Qo,"text;html=1;align=left;verticalAlign=middle;fontSize=10;fontColor=#000000;",Bo(Kn)+5,16,Math.max(wf(Qo,10)+4,12),11,"1")}vr(Ut,16,Jt),tr(Jt,0,Ut),xe("gm",Ta,Jt,16,12,!0,function(yr){return Or(yr,["ms","mys"])},!1),tr(Jt+16,0,Ut)}else if(wr==="monthly"||wr==="quarterly"){var pa=jr(Br),Mt=jr(wr==="monthly"?_e:br),la=wr==="monthly"?function(yr){return Or(yr,["ms","ml"])}:function(yr){return["Q"+(Math.floor(yr.getUTCMonth()/3)+1)]},vn=function(yr){return[String(yr.getUTCFullYear())]};xe("gm",pa,0,16,12,!0,vn,!1),xe("gt",Mt,16,12,10,!1,la,!1),tr(0,0,Ut),tr(16,0,Ut),tr(28,0,Ut),tr(Jt,0,Ut),xe("gt",Mt,Jt,12,10,!1,la,!1),xe("gm",pa,Jt+12,16,12,!0,vn,!1),tr(Jt+12,0,Ut),tr(Jt+28,0,Ut)}else{var Jn=jr(Br),qn=function(yr){return[String(yr.getUTCFullYear())]};xe("gm",Jn,0,17,14,!0,qn,!0),tr(0,0,Ut),tr(17,0,Ut),tr(Jt,0,Ut),xe("gm",Jn,Jt,17,14,!0,qn,!0),tr(Jt+17,0,Ut)}else{for(var Mn=0;Mn<=Pr;Mn++)vr(Bo(Mn),kt,Jt);for(st=0;st<Pr;st++)e+=rr(i("gt"),mn[st],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Bo(st),0,Dr,12,"1"),e+=rr(i("gt"),mn[st],"text;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#000000;",Bo(st),Jt-4,Dr,12,"1")}for(var ia="endArrow=none;startArrow=none;strokeColor=#181818;strokeWidth=1;",zn=0;zn<l.length;zn++){var Ko=l[zn];if(Ko.isSeparator){var Bt=Ho[zn]+12+Tn/2,ta=or("separator","vertex");if(ta.fillColor&&ta.fillColor!=="none"&&(p+=m(i("gsb"),"","rounded=0;fillColor="+ta.fillColor+";strokeColor=none;",0,Ho[zn],Ut,Ro[zn],"1")),Ko.name){var ln=wf(Ko.name,11);e+=nr(i("gsp"),"",ia,0,Bt,5,Bt,"1"),e+=nr(i("gsp"),"",ia,10+ln+5,Bt,Ut-1,Bt,"1"),e+=rr(i("gsl"),Ko.name,"text;html=1;align=left;verticalAlign=middle;fontSize=11;fontColor=#000000;",10,Ho[zn]+12,ln+4,Tn,"1")}else e+=nr(i("gsp"),"",ia,0,Bt,Ut,Bt,"1");continue}if(!Ko.isMilestone){var mo=Ze[Ko.name],Vt=Bo(mo.s)+2,nt=Math.max(Bo(mo.e)-2,Vt+1),kr=Ho[zn],Ir=Ro[zn],Tr="#181818";Ko.color&&Ko.color.indexOf("/")>=0?Tr=ud(Ko.color.split("/")[1])||"#181818":Ko.color&&(Tr=ud(Ko.color)||"#181818");var Gr=r.monochrome?"#E3E3E3":"#E2E2F0";Ko.color&&(Gr=ud(Ko.color.split("/")[0])||Gr),Ko.progress===0&&!Ko.color&&(Gr="#FFFFFF");for(var Vr=Ko.progress!=null&&Ko.progress>0&&Ko.progress<100&&!Ko.color,Ge=Ko.resources&&Ko.resources.length>0?Ko.resources:Ko.resource?[{name:Ko.resource,pct:100}]:[],Jr=Ko.name,co=0;co<Ge.length;co++)Jr+=" {"+Ge[co].name+(Ge[co].pct!==100?":"+Ge[co].pct+"%":"")+"}";for(var Ie=wf(Jr,11),Ee=Bo(mo.e)-6-(Bo(mo.s)+6)>Ie,qo=[],Ot=Vt,no=Math.floor(mo.s);no<mo.e;no++)if(S(no)){var Fn=Bo(no),Cn=Bo(no+1);Fn>Ot&&qo.push({x1:Ot,x2:Math.min(Fn,nt)}),Ot=Math.max(Ot,Cn)}Ot<nt&&qo.push({x1:Ot,x2:nt}),qo.length===0&&qo.push({x1:Vt,x2:nt});var yt=Ee&&qo.length===1?Jr:"";if(j=Ko.color?["fillColor","gradientColor","strokeColor"]:null,qo.length===1){var wt=qo[0].x1,rt=qo[0].x2-qo[0].x1;if(Vr){var le=Math.round(rt*Ko.progress/100),Fe=rt-le;e+=rr(i("gb"),"","fillColor="+Gr+";strokeColor=none;",wt,kr,le,Ir,"1"),e+=rr(i("gb"),"","fillColor=#FFFFFF;strokeColor=none;",wt+le,kr,Fe,Ir,"1"),e+=rr(i("gb"),yt,"fillColor=none;strokeColor="+Tr+";strokeWidth=1;fontSize=11;fontColor=#000000;align=left;spacingLeft=4;verticalAlign=middle;",wt,kr,rt,Ir,"1")}else e+=rr(i("gb"),yt,"fillColor="+Gr+";strokeColor="+Tr+";strokeWidth=1;fontSize=11;fontColor=#000000;align=left;spacingLeft=4;verticalAlign=middle;",wt,kr,rt,Ir,"1")}else{for(var $e=0;$e<qo.length;$e++){var Se=qo[$e],ro=$e===0?"right=0;":$e===qo.length-1?"left=0;":"left=0;right=0;";if(e+=rr(i("gb"),"","shape=partialRectangle;"+ro+"fillColor="+Gr+";strokeColor="+Tr+";strokeWidth=1;",Se.x1,kr,Se.x2-Se.x1,Ir,"1"),$e<qo.length-1){var It=Se.x2+3,Jo=qo[$e+1].x1-3;Jo>It&&(e+=nr(i("gbj"),"","endArrow=none;startArrow=none;strokeColor="+Tr+";strokeWidth=1;dashed=1;dashPattern=2 3;",It,kr,Jo,kr,"1"),e+=nr(i("gbj"),"","endArrow=none;startArrow=none;strokeColor="+Tr+";strokeWidth=1;dashed=1;dashPattern=2 3;",It,kr+Ir,Jo,kr+Ir,"1"))}}Ee&&(e+=rr(i("gl"),Jr,"text;html=1;align=left;verticalAlign=middle;fontSize=11;fontColor=#000000;",Bo(mo.s)+6-4,kr,Ie+8,Ir,"1"))}j=null,Ee||(e+=rr(i("gl"),Jr,"text;html=1;align=left;verticalAlign=middle;fontSize=11;fontColor=#000000;",Bo(mo.e)-6+8-4,kr,Math.max(Ie+8,18),Ir,"1"))}}for(var xo=0;xo<l.length;xo++){var Et=l[xo];if(Et.isMilestone){var Vn=Et.after?Ze[Et.after]:null,Un;if(Vn)Un=Bo(Vn.e);else{var bt=Ze[Et.alias]||Ze[Et.name];if(!bt)continue;Un=Bo(bt.s)}e+=rr(i("gd"),"","rhombus;fillColor=#000000;strokeColor=#000000;",Un-13,Ho[xo],10,10,"1"),e+=rr(i("gd"),Et.name,"text;html=1;align=left;verticalAlign=middle;fontSize=11;fontColor=#000000;",Un,Ho[xo],Math.max(wf(Et.name,11)+4,18),Ro[xo],"1")}}for(var mt=0;mt<Yt.length;mt++){var In=cn+mt*Bn,Zn=In+20;e+=rr(i("gr"),Yt[mt],"text;html=1;align=left;verticalAlign=middle;fontSize=13;fontFamily=Serif;fontColor=#000000;",0,In+5,80,14,"1"),e+=nr(i("gr"),"","endArrow=none;startArrow=none;strokeColor=#000000;strokeWidth=1;",0,Zn,Ut,Zn,"1");for(var Oe=so[Yt[mt]],uo=0;uo<Pr;uo++)Oe[uo]&&(e+=rr(i("gr"),"100","text;html=1;align=center;verticalAlign=middle;fontSize=9;fontFamily=Serif;fontColor=#000000;",Bo(uo),Zn,Dr,10,"1"))}for(var io=0;io<l.length;io++){var we=l[io];if(!(we.isMilestone||we.isSeparator||Zt[io]==null)){var de=we.predecessors.slice();we.after&&de.unshift({ref:we.after});for(var $o=0;$o<de.length;$o++){var ft=de[$o];if(!(ft.hidden||!Ze[ft.ref]||he[ft.ref]==null)){var Vo=he[ft.ref],zo=Ze[ft.ref],ka=Zt[io],sa=Bo(zo.e),_a=Ho[Vo]+Ro[Vo],Ba=Ho[io]+Ro[io]/2,No=Ba<_a?Ho[Vo]:_a,vt=sa-8,Wt=Bo(ka.s)-1,Nt=ft.color?ud(ft.color):null,$a="strokeColor="+(Nt||"#181818")+";strokeWidth="+(ft.bold?"2.5":"1.5")+";"+(ft.dotted?"dashed=1;fixDash=1;dashPattern=1 3;":ft.dashed?"dashed=1;fixDash=1;dashPattern=7 7;":"");j=Nt?["strokeColor"]:null,e+=nr(i("ga"),"","endArrow=none;startArrow=none;"+$a,vt,No,vt,Ba,"1"),e+=nr(i("ga"),"","endArrow=block;endFill=1;endSize=2.5;startArrow=none;"+$a,vt,Ba,Wt,Ba,"1"),j=null}}}}var sn=or("timeline","vertex");if(sn.fillColor&&sn.fillColor!=="none"){var ce="rounded=0;fillColor="+sn.fillColor+";strokeColor=none;";p=m(i("gtb"),"",ce,0,0,Ut,kt,"1")+m(i("gtb"),"",ce,0,Jt,Ut,Yn,"1")+p}return p+e}function qv(r){var l=[],e="",c=0,i=r.timeMarks||[],h=r.styleSheet||null,F=null,j={tg:"timegrid",tm:"arrow",tml:"arrow",tcn:"constraintArrow",tcl:"constraintArrow",tax:"timeline",tk:"timeline",tal:"timeline",thl:"highlight",thll:"highlight"};function p(le,Fe,$e){if(h==null)return Fe;var Se=String(le).split("_")[0],ro=F!=null&&($e?Se==="tw"||Se==="tv":Se!=="tt"),It=j[Se]!=null?[j[Se]]:ro?[F]:[],Jo=$e?"edge":Fe.indexOf("text;")===0?"text":"vertex",xo=U(h,["root","element","timingDiagram"].concat(It),[],Jo);return Jo==="vertex"&&Se!=="tc"&&Se!=="thl"&&(delete xo.fillColor,delete xo.gradientColor),Se==="thl"&&(delete xo.strokeColor,delete xo.strokeWidth),Se==="thll"&&(delete xo.fontColor,delete xo.fontSize,delete xo.fontFamily,delete xo.fontStyleBits),H(Fe,xo)}for(var or=function(le,Fe,$e,Se,ro,It,Jo,xo){return m(le,Fe,p(le,$e,!1),Se,ro,It,Jo,xo)},q=function(le,Fe,$e,Se,ro,It,Jo,xo){return I(le,Fe,p(le,$e,!0),Se,ro,It,Jo,xo)},rr=0;rr<r.signals.length;rr++){var nr=r.signals[rr];l.push({name:nr.name,alias:nr.alias,kind:nr.kind,period:nr.period,transitions:nr.transitions.slice()})}function Xr(le){return le+"_"+c++}if(l.length===0&&i.length===0)return"";var wr=10,pr=14,Dr=12,Ze=11,he=26,Pr="#333333",ve=r.monochrome?"#292929":"#006400",xr=r.monochrome?"#3A3A3A":"#006400",qr=r.monochrome?"#E3E3E3":"#E2E2F0",ze=r.monochrome?"#292929":"#333333";function wo(le,Fe){return"endArrow=none;startArrow=none;strokeColor="+Pr+";strokeWidth="+le+";"+(Fe?"dashed=1;dashPattern=3 5;":"")}function me(le,Fe){return String(le).length*Fe*.55}function ue(le,Fe,$e,Se,ro,It,Jo,xo){var Et=ro+6,Vn=Se-Et/2-ro*.335,Un=Math.max(me(Fe,ro)+8,8),bt="text;html=1;strokeColor=none;fillColor=none;fontSize="+ro+";fontColor="+Jo+";align="+(xo||"left")+";verticalAlign=middle;"+(It?"fontStyle=1;":"");return or(Xr(le),Fe,bt,$e,Vn,Un,Et,"1")}var po=[],x,S;function fr(le){po.indexOf(le)<0&&po.push(le)}for(x=0;x<l.length;x++){for(S=0;S<l[x].transitions.length;S++)fr(l[x].transitions[S].time);l[x].kind==="clock"&&l[x].period>0&&fr(l[x].period)}for(S=0;S<i.length;S++)fr(i[S]);po.length===0&&po.push(0),po.sort(function(le,Fe){return le-Fe});var zr=po[0],Lr=po[po.length-1];Lr>0&&zr<0&&po.indexOf(0)<0&&(po.push(0),po.sort(function(le,Fe){return le-Fe}));var te=Lr-zr,W=50,Zr;function Re(le,Fe){for(;Fe!==0;){var $e=le%Fe;le=Fe,Fe=$e}return Math.abs(le)}function Ae(le){return le<0?Math.ceil(le):Math.floor(le)}function Pe(le){return(le<10?"0":"")+le}var De=["January","February","March","April","May","June","July","August","September","October","November","December"],Qr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Po(le,Fe){var $e=new Date(Fe*1e3);return le.replace(/'([^']*)'|y{1,4}|M{1,4}|d{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|E{1,4}/g,function(Se,ro){if(ro!=null)return ro;var It=$e.getUTCHours()%12||12;switch(Se){case"yyyy":case"yyy":case"y":return String($e.getUTCFullYear());case"yy":return Pe($e.getUTCFullYear()%100);case"MMMM":return De[$e.getUTCMonth()];case"MMM":return De[$e.getUTCMonth()].substring(0,3);case"MM":return Pe($e.getUTCMonth()+1);case"M":return String($e.getUTCMonth()+1);case"dd":return Pe($e.getUTCDate());case"d":return String($e.getUTCDate());case"HH":return Pe($e.getUTCHours());case"H":return String($e.getUTCHours());case"hh":return Pe(It);case"h":return String(It);case"mm":return Pe($e.getUTCMinutes());case"m":return String($e.getUTCMinutes());case"ss":return Pe($e.getUTCSeconds());case"s":return String($e.getUTCSeconds());case"EEEE":return Qr[$e.getUTCDay()];default:return Qr[$e.getUTCDay()].substring(0,3)}})}function Qe(le){var Fe=Ae(le);if(r.dateFormat)return Po(r.dateFormat,Fe);if(r.timeFormat==="hour")return Math.floor(Fe/3600)+":"+Pe(Math.floor(Fe/60)%60)+":"+Pe(Fe%60);if(r.timeFormat==="date"){var $e=new Date(Fe*1e3);return Pe($e.getUTCMonth()+1)+"/"+Pe($e.getUTCDate())}return String(Fe)}if(r.scale&&r.scale.tick>0&&r.scale.pixel>0)Zr=r.scale.tick,W=r.scale.pixel;else{var yo=0;for(S=0;S<po.length;S++){var ie=Math.abs(Ae(po[S]));ie>0&&(yo=yo===0?ie:Re(yo,ie))}Zr=yo>0?yo:1,Zr===1&&(te+1)*W>4e3&&(Zr=Math.round(1+W*te/4e3))}var pe=Math.min(1e3,1+Math.floor(te/Zr)),Mo=(te/Zr+1)*W,Zt=Lr+Zr,Uo=0;for(x=0;x<l.length;x++){var xn=l[x];if(xn.kind==="robust")for(S=0;S<xn.transitions.length;S++)Uo=Math.max(Uo,me(xn.transitions[S].state,Dr));else xn.kind==="binary"&&(Uo=Math.max(Uo,me(xn.name,pr)+5))}var gt=wr+5+Uo;function To(le){return gt+(le-zr)/Zr*W}for(var Rt=gt+Mo,Be=wr,Ao=wr,et=Rt+5,jo=r.constraints&&r.constraints.length>0,Tn=[],dn="",An=Ao,Bo=0,kt=Ao,Yn=0;Yn<l.length;Yn++){var go=l[Yn],Ho=kt;F=go.kind||null;var Ro=jo&&Yn===0?he:go.kind==="robust"?10:5,At,ot={kind:go.kind,transitions:go.transitions,rows:{}};if(Tn.push(ot),go.kind!=="binary"){dn+=ue("tt",go.name,wr+1,Ho+15,pr,!0,"#333333","left");var oo=Ho+20,to=wr+5+me(go.name,pr)+1;dn+=q(Xr("tu"),"",wo(.5),Be,oo,to,oo,"1"),dn+=q(Xr("td"),"",wo(.5),to,oo,to+10,Ho,"1")}if(go.kind==="robust"){var cn=[],Yt;for(Yt=0;Yt<go.transitions.length;Yt++)!go.transitions[Yt].hidden&&cn.indexOf(go.transitions[Yt].state)<0&&cn.push(go.transitions[Yt].state);var so=Math.max(cn.length,1),Bn=Ho+20+Ro,tt=ot.rows;for(Yt=0;Yt<cn.length;Yt++){var an=Bn+(cn.length-1-Yt)*20;tt[cn[Yt]]=an,dn+=ue("tl",cn[Yt],wr+1,an+5,Dr,!1,"#333333","left")}for(Yt=0;Yt<go.transitions.length;Yt++){var Ga=go.transitions[Yt];if(!Ga.hidden){var hn=Yt+1<go.transitions.length?go.transitions[Yt+1]:null,Da=To(Ga.time),jt=hn?To(hn.time):Rt,_n=tt[Ga.state];dn+=q(Xr("tw"),"","endArrow=none;startArrow=none;strokeColor="+ve+";strokeWidth=2;",Da,_n,jt,_n,"1"),hn&&!hn.hidden&&tt[hn.state]!==_n&&(dn+=q(Xr("tv"),"","endArrow=none;startArrow=none;strokeColor="+ve+";strokeWidth=2;",jt,_n,jt,tt[hn.state],"1"))}}At=Bn+(so-1)*20+15}else if(go.kind==="concise"||go.kind==="rectangle"){var da=Ho+20+Ro,Jt=24,Ut=go.kind==="rectangle"?"rounded=0;fillColor=#F1F1F1;strokeColor=#F1F1F1;strokeWidth=0.5;fontSize=12;fontStyle=1;fontColor=#333333;align=center;":"shape=hexagon;perimeter=hexagonPerimeter2;fixedSize=1;size=12;fillColor="+qr+";strokeColor="+xr+";strokeWidth=1.5;fontSize=12;fontStyle=1;fontColor=#333333;align=center;";ot.bandTop=da,ot.bandH=Jt,Yn===0&&jo&&(Bo=da);for(var ga=0;ga<go.transitions.length;ga++){var mn=go.transitions[ga];if(!mn.hidden){var ma=ga+1<go.transitions.length?go.transitions[ga+1]:null,oa=To(mn.time),On=ma?To(ma.time):Rt;On>oa&&(dn+=or(Xr("tc"),mn.state,Ut,oa,da,On-oa,Jt,"1"))}}At=da+Jt+10}else if(go.kind==="clock"){var Za=go.period||100,be=Za/2,$n=Ho+27,Wn=Ho+41;dn+=q(Xr("tw"),"","endArrow=none;startArrow=none;strokeColor="+ve+";strokeWidth=1.5;",To(0),$n,To(0),Wn,"1");for(var $r=!0,ee=0,Rr=0;Rr<Zt&&ee<2e3;Rr+=be,ee++){var tr=To(Rr),vr=To(Math.min(Rr+be,Zt)),Te=$r?$n:Wn;if(vr>tr&&(dn+=q(Xr("tw"),"","endArrow=none;startArrow=none;strokeColor="+ve+";strokeWidth=1.5;",tr,Te,vr,Te,"1")),Rr+be<=Zt){var jr=$r?Wn:$n;dn+=q(Xr("tv"),"","endArrow=none;startArrow=none;strokeColor="+ve+";strokeWidth=1.5;",vr,Te,vr,jr,"1")}$r=!$r}At=Wn+8}else if(go.kind==="binary"){var _e=Ho+8,Br=Ho+22;ot.rows.high=_e,ot.rows.low=Br,dn+=ue("tl",go.name,wr+1,(_e+Br)/2+5,pr,!0,"#333333","left");for(var br=0;br<go.transitions.length;br++){var Or=go.transitions[br];if(!Or.hidden){var xe=br+1<go.transitions.length?go.transitions[br+1]:null,bo=To(Or.time),_t=xe?To(xe.time):Rt,Wo=Or.state==="high"||Or.state==="1",Fo=Wo?_e:Br;if(dn+=q(Xr("tw"),"","endArrow=none;startArrow=none;strokeColor="+ve+";strokeWidth=2;",bo,Fo,_t,Fo,"1"),xe&&!xe.hidden){var ut=xe.state==="high"||xe.state==="1",Do=ut?_e:Br;Do!==Fo&&(dn+=q(Xr("tv"),"","endArrow=none;startArrow=none;strokeColor="+ve+";strokeWidth=2;",_t,Fo,_t,Do,"1"))}}}At=Br+8}else At=Ho+30;Yn<l.length-1?(dn+=q(Xr("ts"),"",wo(.5),Be,At,et,At,"1"),kt=At):An=At}F=null,e+=q(Xr("tb"),"",wo(.5),Be,Ao,et,Ao,"1"),e+=q(Xr("tb"),"",wo(.5),Be,Ao,Be,An,"1"),e+=q(Xr("tb"),"",wo(.5),et,Ao,et,An,"1");for(var Fr=0;Fr<=pe;Fr++){var Gt=gt+Fr*W;e+=q(Xr("tg"),"",wo(.5,!0),Gt,Ao,Gt,An,"1")}if(r.highlights&&r.highlights.length>0)for(var st=0;st<r.highlights.length;st++){var Mn=r.highlights[st],jn=To(Mn.from),Hn=To(Mn.to),Xo=Y(Mn.color)||"#FFD700";e+=or(Xr("thl"),"","shape=rectangle;fillColor="+Xo+";strokeColor=none;opacity=45;",jn,Ao,Hn-jn,An-Ao,"1"),Mn.label&&(e+=ue("thll",Mn.label,(jn+Hn)/2-(me(Mn.label,Dr)+8)/2,Ao+14,Dr,!1,"#000000","center"))}if(e+=dn,jo&&Bo>0)for(var Xn=0;Xn<r.constraints.length;Xn++){var Ta=r.constraints[Xn],Kn=To(Ta.from)+1,Qo=To(Ta.to)-1,pa=Bo-11;e+=q(Xr("tcn"),"","startArrow=block;endArrow=block;startFill=1;endFill=1;strokeColor="+ze+";strokeWidth=1.5;",Kn,pa,Qo,pa,"1"),e+=ue("tcl",Ta.label,(Kn+Qo)/2-me(Ta.label,Dr)/2-4,pa-8.5,Dr,!1,ze,"center")}function Mt(le,Fe){var $e=le.transitions,Se=[],ro;function It(xo){return le.kind==="binary"?xo.state==="high"||xo.state==="1"?le.rows.high:le.rows.low:xo.hidden?null:le.rows[xo.state]}if(le.kind==="robust"||le.kind==="binary"){if($e.length===0)return null;for(ro=0;ro<$e.length;ro++){if($e[ro].time===Fe){ro>0&&Se.push(It($e[ro-1])),Se.push(It($e[ro]));break}if($e[ro].time>Fe){Se.push(It($e[ro===0?0:ro-1]));break}}Se.length===0&&Se.push(It($e[$e.length-1]))}else if(le.kind==="concise"||le.kind==="rectangle"){for(ro=0;ro<$e.length;ro++)$e[ro].time===Fe&&Se.push(le.bandTop+le.bandH/2);Se.length===0&&Se.push(le.bandTop,le.bandTop+le.bandH)}else return null;var Jo=[];for(ro=0;ro<Se.length;ro++)Se[ro]!=null&&Jo.indexOf(Se[ro])<0&&Jo.push(Se[ro]);return Jo.length>0?Jo:null}for(var la=r.monochrome?"#292929":"#00008B",vn=0;r.messages&&vn<r.messages.length;vn++){var Jn=r.messages[vn],qn=Tn[Jn.from],ia=Tn[Jn.to],zn=qn?Mt(qn,Jn.fromTime):null,Ko=ia?Mt(ia,Jn.toTime):null;if(!(!zn||!Ko)){for(var Bt=To(Jn.fromTime),ta=To(Jn.toTime),ln=null,mo=0;mo<zn.length;mo++)for(var Vt=0;Vt<Ko.length;Vt++){var nt=Math.sqrt((ta-Bt)*(ta-Bt)+(Ko[Vt]-zn[mo])*(Ko[Vt]-zn[mo]));(ln===null||nt<ln.len)&&(ln={y1:zn[mo],y2:Ko[Vt],len:nt})}if(e+=q(Xr("tm"),"","endArrow=block;endFill=1;endSize=8;startArrow=none;strokeColor="+la+";strokeWidth=1.5;",Bt,ln.y1,ta,ln.y2,"1"),Jn.label){var kr=Math.atan2(ta-Bt,ln.y2-ln.y1),Ir=20*Math.PI/180,Tr=(ta-Math.sin(kr+Ir)*8+ta-Math.sin(kr-Ir)*8)/2,Gr=(ln.y2-Math.cos(kr+Ir)*8+ln.y2-Math.cos(kr-Ir)*8)/2,Vr=pr+2.6,Ge=ln.y1<ln.y2?Gr-Vr:Gr;e+=ue("tml",Jn.label,Tr-2,Ge+13.6,pr,!1,la,"left").replace("text;html=1;","text;html=1;fontFamily=Serif;")}}}var Jr=r.timeAxis!=="hidden";if(Jr){var co=Lr;for(S=0;S<po.length;S++)if(po[S]>=0){co=po[S];break}for(var Ie=To(co),Ee=0;Ee<=1e3&&Ie+Ee*W<=Rt+1e-6;)Ee++;e+=q(Xr("tax"),"",wo(2),Ie,An,Ie+Math.max(Ee-1,0)*W,An,"1");var qo=[],Ot=[],no;if(r.timeAxis==="manual")for(S=0;S<po.length;S++){var Fn=null;for(var Cn in r.codes||{})r.codes.hasOwnProperty(Cn)&&r.codes[Cn]===po[S]&&(Fn=Cn);Ot.push(To(po[S])),qo.push({x:To(po[S]),text:Fn??Qe(po[S])})}else{for(no=0;no<Ee;no++)Ot.push(Ie+no*W);var yt=[];if(r.scale)for(no=0;no<=pe;no++)yt.push(Zr*no+Ae(zr));else for(S=0;S<po.length;S++){var wt=Ae(po[S]);yt.indexOf(wt)<0&&yt.push(wt)}for(yt.sort(function(le,Fe){return le-Fe}),yt[0]<0&&yt[yt.length-1]>0&&yt.indexOf(0)<0&&yt.push(0),no=0;no<yt.length;no++)qo.push({x:To(yt[no]),text:Qe(yt[no])})}for(no=0;no<Ot.length;no++)e+=q(Xr("tk"),"",wo(2),Ot[no],An,Ot[no],An+5,"1");for(no=0;no<qo.length;no++)e+=ue("tal",qo[no].text,qo[no].x-(me(qo[no].text,Ze)+8)/2,An+17.5,Ze,!1,"#333333","center")}var rt=Jr?An+21:An+5;return e=or(Xr("tanchor"),"","shape=text;strokeColor=none;fillColor=none;",Be-6,Ao-6,et-Be+19,rt-Ao+12,"1")+e,e}var _i=14.1328,Zv=11.6,Gh="endArrow=none;startArrow=none;strokeColor=#000000;strokeWidth=1;",wh="endArrow=none;startArrow=none;strokeColor=#000000;strokeWidth=1.5;",jv="text;html=1;align=left;verticalAlign=middle;fontSize=12;fontColor=#000000;",Jv={" ":278,"!":278,'"':355,"#":556,$:556,"%":889,"&":667,"'":191,"(":333,")":333,"*":389,"+":584,",":278,"-":333,".":278,"/":278,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,":":278,";":278,"<":584,"=":584,">":584,"?":556,"@":1015,A:667,B:667,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:500,K:667,L:556,M:833,N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611,"[":278,"\\":278,"]":278,"^":469,_:556,"`":333,a:556,b:556,c:500,d:556,e:556,f:278,g:556,h:556,i:222,j:222,k:500,l:222,m:833,n:556,o:556,p:556,q:556,r:333,s:500,t:278,u:556,v:500,w:722,x:500,y:500,z:500,"{":334,"|":260,"}":334,"~":584};function Xs(r,l){if(!r)return 0;for(var e=0,c=0;c<r.length;c++){var i=Jv[r.charAt(c)];i==null&&(i=556),e+=i}return e=e*.013,l&&(e*=1.05),e}function Vv(r){var l="",e="",c=0;function i(x){return x+"_"+c++}if(!r.root)return"";function h(x,S,fr,zr,Lr){return u(i("sl"),x,jv+(Lr?"fontStyle=1;":""),S-4,fr+Zv-12.83,zr+4,17.6,"1")}function F(x,S,fr,zr){return G(i("sh"),"",zr||Gh,x,S,x+fr,S,"1")}function j(x,S,fr,zr){return G(i("sv"),"",zr||Gh,x,S,x,S+fr,"1")}function p(x,S){return{w:Xs(x,S),h:_i}}function or(x){return Math.max(Xs(x.text,x.bold),(x.charLength||0)*8)}function q(x){if(!x)return{w:0,h:0};if(x.dim)return x.dim;var S,fr;switch(x.type){case"text":S=p(x.display,x.bold);break;case"empty":S={w:1,h:1};break;case"button":S={w:or(x)+9,h:_i+9};break;case"textfield":S={w:or(x)+6,h:_i+2};break;case"check":S={w:Xs(x.text,x.bold)+20,h:_i};break;case"droplist":S={w:or(x)+16,h:_i+4};break;case"line":S={w:10,h:6};break;case"image":S={w:x.rows.length>0?x.rows[0].length:0,h:x.rows.length};break;case"tabbar":for(S={w:0,h:0},fr=0;fr<x.tabs.length;fr++){var zr=Xs(x.tabs[fr].text,x.tabs[fr].bold);x.vertical?(S.h+=_i+15,S.w=Math.max(S.w,zr)):(S.w+=zr+15,S.h=Math.max(S.h,_i))}break;case"menubar":for(S={w:0,h:0},fr=0;fr<x.entries.length;fr++){var Lr=rr(x.entries[fr]);S.w+=Lr.w+10,S.h=Math.max(S.h,Lr.h)}break;case"tree":S=wr(x);break;case"border":S=pr(x);break;case"pyramid":S=Ze(x);break;default:S={w:0,h:0}}return x.dim=S,S}function rr(x){return x==="-"?{w:10,h:5}:p(x,!1)}function nr(x){for(var S={w:0,h:0},fr=0;fr<x.length;fr++){var zr=rr(x[fr]);S.w=Math.max(S.w,zr.w),S.h+=zr.h}return S}function Xr(x){for(var S=0,fr=[],zr=0;zr<x.entries.length;zr++){var Lr=x.entries[zr];S=Math.max(S,Xs(Lr.text,Lr.bold)+Lr.level*10);for(var te=0;te<Lr.cells.length;te++){var W=Xs(Lr.cells[te].text,Lr.cells[te].bold);fr[te]=Math.max(fr[te]||0,W)}}return{w1:S,other:fr}}function wr(x){for(var S=Xr(x),fr=0,zr=0;zr<S.other.length;zr++)fr>0&&(fr+=10),fr+=S.other[zr];return fr>0&&(fr+=10),{w:S.w1+fr+2,h:x.entries.length*_i}}function pr(x){var S=q(x.north),fr=q(x.south),zr=q(x.east),Lr=q(x.west),te=q(x.center);return{w:Math.max(S.w,fr.w,Lr.w+te.w+zr.w),h:S.h+Math.max(Lr.h,te.h,zr.h)+fr.h}}function Dr(x){if(x.grid)return x.grid;var S=x.title?_i:0,fr=[],zr=[],Lr;for(Lr=0;Lr<=x.rows;Lr++)fr.push(S/2);for(Lr=0;Lr<=x.cols;Lr++)zr.push(0);var te=x.cells.slice().sort(function(ie,pe){var Mo=ie.maxCol-ie.minCol-(pe.maxCol-pe.minCol);return Mo!==0?Mo:ie.minCol-pe.minCol});for(Lr=0;Lr<te.length;Lr++){var W=te[Lr],Zr=q(W.el).w+2,Re=Zr-(zr[W.maxCol+1]-zr[W.minCol]);if(Re>0)for(var Ae=W.maxCol+1;Ae<zr.length;Ae++)zr[Ae]+=Re}var Pe=x.cells.slice().sort(function(ie,pe){var Mo=ie.maxRow-ie.minRow-(pe.maxRow-pe.minRow);return Mo!==0?Mo:ie.minRow-pe.minRow});for(Lr=0;Lr<Pe.length;Lr++){var De=Pe[Lr],Qr=De.minRow===0?S/2:0,Po=q(De.el).h+Qr+2,Qe=Po-(fr[De.maxRow+1]-fr[De.minRow]);if(Qe>0)for(var yo=De.maxRow+1;yo<fr.length;yo++)fr[yo]+=Qe}return x.grid={rowsStart:fr,colsStart:zr,titleH:S},x.grid}function Ze(x){var S=Dr(x),fr={w:S.colsStart[S.colsStart.length-1],h:S.rowsStart[S.rowsStart.length-1]+S.titleH};return x.scroll==="h"?fr.h+=30:x.scroll==="v"?fr.w+=30:x.scroll==="both"&&(fr.w+=30,fr.h+=30),fr}function he(x,S,fr,zr,Lr){if(x){var te=q(x),W;switch(x.type){case"text":x.show&&x.display&&(l+=h(x.display,S,fr,te.w,x.bold));break;case"button":l+=u(i("sb"),x.text||"","rounded=1;absoluteArcSize=1;arcSize=10;fillColor=#EEEEEE;strokeColor=#000000;strokeWidth=2.5;fontSize=12;fontColor=#000000;align=center;"+(x.bold?"fontStyle=1;":""),S+2.5,fr+2.5,te.w-5,te.h-5,"1");break;case"textfield":var Zr=Xs(x.text,x.bold);x.text&&(l+=h(x.text,S+3,fr,Zr,x.bold)),l+=F(S+1,fr+_i,te.w-3),l+=j(S+1,fr+_i-3,2),l+=j(S+3+Zr+1,fr+_i-3,2);break;case"check":x.text&&(l+=h(x.text,S+20,fr,te.w-20,x.bold)),x.radio?(l+=u(i("sro"),"","ellipse;fillColor=none;strokeColor=#000000;strokeWidth=1.5;",S+2,fr+(te.h-10)/2,10,10,"1"),x.checked&&(l+=u(i("sri"),"","ellipse;fillColor=#000000;strokeColor=#000000;strokeWidth=1.5;",S+5,fr+(te.h-4)/2,4,4,"1"))):(l+=u(i("sco"),"","rounded=0;fillColor=none;strokeColor=#000000;strokeWidth=1.5;",S+2,fr+(te.h-10)/2,10,10,"1"),x.checked&&(l+=G(i("sck"),"",wh,S+3,fr+6,S+6,fr+9,"1"),l+=G(i("sck"),"",wh,S+6,fr+9,S+13,fr,"1")));break;case"droplist":if(l+=u(i("sd"),x.text||"","rounded=0;fillColor=#EEEEEE;strokeColor=#000000;strokeWidth=1;fontSize=12;fontColor=#000000;align=left;verticalAlign=middle;spacingLeft=-2;"+(x.bold?"fontStyle=1;":""),S,fr,te.w-1,te.h-1,"1"),l+=j(S+te.w-12,fr,te.h-1),l+=u(i("sdt"),"","triangle;direction=south;fillColor=#000000;strokeColor=#000000;strokeWidth=1;",S+te.w-9,fr+6,6,_i-8,"1"),x.open&&x.open.length>0){var Re={w:te.w-1,h:0},Ae;for(Ae=0;Ae<x.open.length;Ae++)Re.w=Math.max(Re.w,Xs(x.open[Ae],!1)),Re.h+=_i;for(l+=u(i("sdo"),"","rounded=0;fillColor=#EEEEEE;strokeColor=#000000;strokeWidth=1;",S,fr+te.h-1,Re.w-1,Re.h-1,"1"),Ae=0;Ae<x.open.length;Ae++)l+=h(x.open[Ae],S,fr+te.h-1+Ae*_i,Xs(x.open[Ae],!1),!1)}break;case"line":var Pe=fr+Lr/2,De="endArrow=none;startArrow=none;strokeColor=#AAAAAA;strokeWidth=1;";x.ch==="="?(l+=F(S,Pe-1,zr,De),l+=F(S,Pe+1,zr,De)):x.ch==="."?l+=F(S,Pe,zr,De+"dashed=1;dashPattern=1 2;"):x.ch==="-"?l+=F(S,Pe,zr,De):l+=F(S,Pe,zr,"endArrow=none;startArrow=none;strokeColor=#AAAAAA;strokeWidth=1.5;");break;case"image":for(W=0;W<x.rows.length;W++)for(var Qr=x.rows[W],Po=-1,Qe=0;Qe<=Qr.length;Qe++){var yo=Qe<Qr.length&&Qr.charAt(Qe)==="X";yo&&Po<0?Po=Qe:!yo&&Po>=0&&(l+=G(i("sim"),"","endArrow=none;startArrow=none;strokeColor=#000000;strokeWidth=1;",S+Po,fr+W+.5,S+Qe,fr+W+.5,"1"),Po=-1)}break;case"tabbar":Pr(x,S,fr);break;case"menubar":ve(x,S,fr,zr,Lr);break;case"tree":xr(x,S,fr);break;case"border":var ie=q(x.north),pe=q(x.south),Mo=q(x.east),Zt=q(x.west);he(x.north,S,fr,zr,Lr),he(x.south,S,fr+Lr-pe.h,zr,Lr),he(x.west,S,fr+ie.h,zr,Lr),he(x.east,S+zr-Mo.w,fr+ie.h,zr,Lr),he(x.center,S+Zt.w,fr+ie.h,zr,Lr);break;case"pyramid":ze(x,S,fr);break}}}function Pr(x,S,fr){for(var zr=q(x),Lr=S,te=fr,W=0;W<x.tabs.length;W++){var Zr=x.tabs[W],Re=Xs(Zr.text,Zr.bold);x.vertical?(l+=h(Zr.text,S,te+2,Re,Zr.bold),l+=F(S,te,zr.w),l+=j(S,te,_i+5),l+=F(S,te+_i+5,zr.w),l+=j(S+zr.w,te+_i+5,10),te+=_i+15):(l+=h(Zr.text,Lr+2,fr,Re,Zr.bold),l+=j(Lr,fr,_i),l+=F(Lr,fr,Re+5),l+=j(Lr+Re+5,fr,_i),l+=F(Lr+Re+5,fr+_i,10),Lr+=Re+15)}}function ve(x,S,fr,zr,Lr){var te=q(x),W=S;l+=u(i("smb"),"","rounded=0;fillColor=#DDDDDD;strokeColor=#000000;strokeWidth=1;",S,fr,zr,Lr,"1");for(var Zr=0;Zr<x.entries.length;Zr++){var Re=x.entries[Zr],Ae=rr(Re);if(x.popups.hasOwnProperty(Re)){e+=u(i("smh"),"","rounded=0;fillColor=#BBBBBB;strokeColor=none;",W,fr,Ae.w,Ae.h,"1");var Pe=x.popups[Re],De=nr(Pe),Qr=fr+te.h;e+=u(i("smp"),"","rounded=0;fillColor=#DDDDDD;strokeColor=#000000;strokeWidth=1;",W,Qr,De.w,De.h,"1");for(var Po=0;Po<Pe.length;Po++){var Qe=rr(Pe[Po]);Pe[Po]==="-"?e+=F(W,Qr+Qe.h/2,De.w):e+=h(Pe[Po],W,Qr,Qe.w,!1),Qr+=Qe.h}}Re!=="-"&&(l+=h(Re,W,fr,Ae.w,!1)),W+=Ae.w+10}}function xr(x,S,fr){var zr=Xr(x),Lr=q(x),te=0,W=[0],Zr=[0,zr.w1+5],Re=[],Ae,Pe=zr.w1+5;for(Ae=0;Ae<zr.other.length;Ae++)Pe+=zr.other[Ae]+10,Zr.push(Pe);for(Ae=0;Ae<x.entries.length;Ae++){var De=x.entries[Ae],Qr=De.level*10;De.text&&(l+=h(De.text,S+Qr,fr+te,Xs(De.text,De.bold),De.bold));for(var Po=zr.w1+10,Qe=0;Qe<De.cells.length;Qe++)De.cells[Qe].text&&(l+=h(De.cells[Qe].text,S+Po,fr+te,Xs(De.cells[Qe].text,De.cells[Qe].bold),De.cells[Qe].bold)),Po+=(zr.other[Qe]||0)+10;Re.push({x:Qr-7,y:te+_i/2-1}),te+=_i,W.push(te)}var yo="endArrow=none;startArrow=none;strokeColor=#888888;strokeWidth=1;";for(Ae=0;Ae<Re.length;Ae++){var ie=Re[Ae];Ae+1<Re.length&&Re[Ae+1].x>ie.x&&(l+=u(i("stq"),"","rounded=0;fillColor=none;strokeColor=#888888;strokeWidth=1;",S+ie.x,fr+ie.y,2,2,"1"));for(var pe=null,Mo=0;Mo<Ae;Mo++)Re[Mo].x<ie.x&&(pe=Re[Mo]);pe&&(l+=j(S+pe.x+1,fr+pe.y+3,ie.y-pe.y-2,yo),l+=F(S+pe.x+1,fr+ie.y+1,ie.x-pe.x-2,yo))}x.strategy!==" "&&qr(W,Zr,x.strategy,S,fr)}function qr(x,S,fr,zr,Lr){var te=S[0],W=S[S.length-1],Zr=x[0],Re=x[x.length-1],Ae;if((fr==="+"||fr==="^")&&(l+=F(zr+te,Lr+Zr,W-te),l+=F(zr+te,Lr+Re,W-te),l+=j(zr+te,Lr+Zr,Re-Zr),l+=j(zr+W,Lr+Zr,Re-Zr)),fr==="-"||fr==="#")for(Ae=0;Ae<x.length;Ae++)l+=F(zr+te,Lr+x[Ae],W-te);if(fr==="!"||fr==="#")for(Ae=0;Ae<S.length;Ae++)l+=j(zr+S[Ae],Lr+Zr,Re-Zr)}function ze(x,S,fr){var zr=Dr(x),Lr=zr.rowsStart,te=zr.colsStart,W=x.strategy,Zr={},Re={},Ae,Pe,De;for(Ae=0;Ae<x.cells.length;Ae++){var Qr=x.cells[Ae],Po=Qr.minRow===0?zr.titleH/2:0,Qe=te[Qr.maxCol+1]-te[Qr.minCol]-1,yo=Lr[Qr.maxRow+1]-Lr[Qr.minRow]-1;if(he(Qr.el,S+te[Qr.minCol]+1,fr+Lr[Qr.minRow]+Po+1,Qe,yo),W==="-"||W==="#")for(Pe=Qr.minCol;Pe<=Qr.maxCol;Pe++)Zr[Qr.minRow+","+Pe]=!0,Zr[Qr.maxRow+1+","+Pe]=!0;if(W==="!"||W==="#")for(De=Qr.minRow;De<=Qr.maxRow;De++)Re[De+","+Qr.minCol]=!0,Re[De+","+(Qr.maxCol+1)]=!0}if(W==="+"||W==="^"||W==="#"){for(Pe=0;Pe<te.length-1;Pe++)Zr["0,"+Pe]=!0,Zr[Lr.length-1+","+Pe]=!0;for(De=0;De<Lr.length-1;De++)Re[De+",0"]=!0,Re[De+","+(te.length-1)]=!0}var ie;for(ie in Zr)if(Zr.hasOwnProperty(ie)){var pe=ie.split(",");De=parseInt(pe[0],10),Pe=parseInt(pe[1],10),l+=F(S+te[Pe],fr+Lr[De],te[Pe+1]-te[Pe])}for(ie in Re)if(Re.hasOwnProperty(ie)){var Mo=ie.split(",");De=parseInt(Mo[0],10),Pe=parseInt(Mo[1],10),l+=j(S+te[Pe],fr+Lr[De],Lr[De+1]-Lr[De])}if(x.title){var Zt=Xs(x.title,!1);l+=u(i("sgt"),"","rounded=0;fillColor=#FFFFFF;strokeColor=none;",S+6,fr,Zt,zr.titleH,"1"),l+=h(x.title,S+6,fr,Zt,!1)}if(x.scroll){var Uo={w:te[te.length-1],h:Lr[Lr.length-1]+zr.titleH};(x.scroll==="both"||x.scroll==="v")&&wo(S+Uo.w+4,fr,15,Uo.h,!0),(x.scroll==="both"||x.scroll==="h")&&wo(S,fr+Uo.h+4,Uo.w,15,!1)}}function wo(x,S,fr,zr,Lr){l+=u(i("ssb"),"","rounded=0;fillColor=none;strokeColor=#000000;strokeWidth=1;",x,S,fr,zr,"1"),Lr?(l+=F(x,S+12,fr),l+=F(x,S+zr-12,fr),l+=u(i("sst"),"","triangle;direction=north;fillColor=#000000;strokeColor=#000000;",x+4,S+4,6,5,"1"),l+=u(i("sst"),"","triangle;direction=south;fillColor=#000000;strokeColor=#000000;",x+4,S+zr-12+4,6,5,"1")):(l+=j(x+12,S,zr),l+=j(x+fr-12,S,zr),l+=u(i("sst"),"","triangle;direction=west;fillColor=#000000;strokeColor=#000000;",x+4,S+4,5,6,"1"),l+=u(i("sst"),"","triangle;direction=east;fillColor=#000000;strokeColor=#000000;",x+fr-12+4,S+4,5,6,"1"))}var me=r.root,ue=q(me);he(me,5,5,ue.w,ue.h);var po=u(i("sanchor"),"","shape=text;strokeColor=none;fillColor=none;",0,0,ue.w+10,ue.h+10,"1");return po+l+e}var xc=78,xd=5,fd=36,Qv=30,Ph=44,rC=37.5,eC=45,oC=50,Yc=20;function tC(r,l){for(var e=String(r??""),c=0,i=0;i<e.length;i++){var h=e.charAt(i);`iIljtfr.,:;!|'"()[]{} `.indexOf(h)>=0?c+=4.2:"mwMW".indexOf(h)>=0?c+=11.7:c+=7.8}return c*(l/14)}function Mc(r){return Math.max(Ph,tC(r,12)+20)}function nC(r){var l=r.networks,e="",c=0,i,h,F=r.styleSheet||null;function j(oo,to,cn,Yt){return X(oo,F,["root","element","nwdiagDiagram",to],[],cn||"vertex",Yt)}function p(oo){return oo+"_"+c++}if(l.length===0)return"";var or=Ph;for(i=0;i<l.length;i++){var q=l[i].nodes;for(h=0;h<q.length;h++){var rr=Mc(q[h].name);rr>or&&(or=rr)}}var nr=or+Qv;function Xr(oo){return xc+oo*nr+nr/2}var wr={};for(i=0;i<l.length;i++){var pr=l[i].nodes;for(h=0;h<pr.length;h++)wr[pr[h].name]===void 0&&(wr[pr[h].name]=i)}var Dr=[];for(i=0;i<l.length;i++)Dr[i]=!1;for(i=0;i<l.length;i++){var Ze=l[i].nodes;for(h=0;h<Ze.length;h++){var he=wr[Ze[h].name];he!==void 0&&he<i&&(Dr[he]=!0)}}var Pr={},ve=Yc,xr=r.topNodes||[],qr=r.links||[],ze=Yc;xr.length>0&&(ve=Yc+fd+26);var wo=ve;for(i=0;i<l.length;i++){var me=l[i],ue=me.nodes;if(r.groups&&r.groups.length>0){for(var po={},x=0;x<r.groups.length;x++)for(var S=0;S<r.groups[x].nodes.length;S++)po[r.groups[x].nodes[S]]=x;for(var fr=[],zr=0;zr<ue.length;zr++)fr.push({n:ue[zr],g:po[ue[zr].name]!==void 0?po[ue[zr].name]:-1,i:zr});fr.sort(function(oo,to){return oo.g-to.g||oo.i-to.i}),ue=[];for(var Lr=0;Lr<fr.length;Lr++)ue.push(fr[Lr].n)}var te=ve,W=[],Zr=0,Re=1/0,Ae=-1/0;for(h=0;h<ue.length;h++){var Pe=Pr[ue[h].name]?Pr[ue[h].name].col:Zr++;W[h]=Pe,Pe<Re&&(Re=Pe),Pe>Ae&&(Ae=Pe)}Re===1/0&&(Re=0,Ae=0);var De=xc+Re*nr,Qr=(Ae-Re+1)*nr;e+=u(p("nwbar"),"",j("fillColor=#E2E2F0;strokeColor=#181818;strokeWidth=1;","network","vertex",["strokeWidth"]),De,te,Qr,xd,"1");var Po=me.name+(me.address?`
+`+me.address:"");e+=u(p("nwlbl"),Po,j("shape=text;strokeColor=none;fillColor=none;fontSize=12;fontColor=#000000;align=right;verticalAlign=middle;","network","text"),0,te-15,xc-3,34,"1");var Qe=Dr[i]?eC:rC,yo=te+xd+Qe,ie=te+xd;for(h=0;h<ue.length;h++){var pe=ue[h],Mo=Xr(W[h]),Zt=pe.address||"";if(Pr[pe.name]){var Uo=Pr[pe.name];e+=G(p("nwsh"),Zt,"endArrow=none;strokeColor=#181818;fontSize=11;fontColor=#000000;",Uo.cx,Uo.bottomY,Uo.cx,te,"1");continue}var xn=Mc(pe.name),gt=Mo-xn/2,To=fd,Rt="shape=rectangle;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;";pe.shape==="cloud"?(Rt="shape=cloud;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;",To=fd+12):pe.shape==="database"&&(Rt="shape=cylinder;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;verticalAlign=bottom;spacingBottom=4;",To=fd+16),e+=u(p("nwnode"),pe.name,j(Rt,"server"),gt,yo,xn,To,"1"),e+=G(p("nwe"),Zt,j("endArrow=none;strokeColor=#181818;fontSize=11;fontColor=#000000;","arrow","edge"),Mo,te+xd,Mo,yo,"1"),Pr[pe.name]={col:W[h],cx:Mo,bottomY:yo+To,x:gt,topY:yo,w:xn,h:To};var Be=yo+To;Be>ie&&(ie=Be)}ve=ie+oC}for(i=0;i<xr.length;i++){var Ao=xr[i],et=null;for(h=0;h<qr.length;h++){if(qr[h].from===Ao.name&&Pr[qr[h].to]){et=Pr[qr[h].to];break}if(qr[h].to===Ao.name&&Pr[qr[h].from]){et=Pr[qr[h].from];break}}var jo=et?et.cx:Xr(i),Tn=Mc(Ao.name)+(Ao.shape==="cloud"?24:0),dn=fd+(Ao.shape==="cloud"?12:0),An=Ao.shape==="cloud"?"shape=cloud;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;":"shape=rectangle;fillColor=#F1F1F1;strokeColor=#181818;strokeWidth=0.5;fontSize=12;fontColor=#000000;align=center;";e+=u(p("nwtop"),Ao.name,j(An,"server"),jo-Tn/2,ze,Tn,dn,"1"),e+=G(p("nwte"),"",j("endArrow=none;strokeColor=#181818;","arrow","edge"),jo,ze+dn,jo,wo,"1")}var Bo="",kt=r.groups||[];for(i=0;i<kt.length;i++){var Yn=kt[i],go=1/0,Ho=1/0,Ro=-1/0,At=-1/0;for(h=0;h<Yn.nodes.length;h++){var ot=Pr[Yn.nodes[h]];ot&&(ot.x<go&&(go=ot.x),ot.topY<Ho&&(Ho=ot.topY),ot.x+ot.w>Ro&&(Ro=ot.x+ot.w),ot.topY+ot.h>At&&(At=ot.topY+ot.h))}go!==1/0&&(Bo+=u(p("nwgrp"),"",j("rounded=0;fillColor="+(Y(Yn.color)||"#FFEFDF")+";strokeColor=none;","group","vertex",Yn.color?["fillColor","gradientColor"]:null),go-10,Ho-8,Ro-go+20,At-Ho+16,"1"))}return Bo+e}var aC={Motivation:"#CCCCFF",Strategy:"#F8E7C0",Business:"#FFFFCC",Application:"#C2F0FF",Technology:"#C9FFC9",Physical:"#97FF97",Implementation:"#FFE0E0",Other:"#D3D3D3",Junction:"#D3D3D3"};function lC(r){if(r.category==="Junction"){if(r.kind==="And")return"#000000";if(r.kind==="Or")return"#F5F5F5"}if(r.category==="Other"&&r.kind==="Location")return"#EFD1E4";if(r.color){var l=Y(r.color);if(l)return l}return aC[r.category]||"#EEEEEE"}var iC={Process:1,Function:1,Interaction:1,Service:1,Event:1,Capability:1,CourseOfAction:1,ValueStream:1},sC={Stakeholder:["role","oct"],Driver:["driver","oct"],Assessment:["assess","oct"],Goal:["goal","oct"],Outcome:["outcome","oct"],Principle:["principle","oct"],Requirement:["requirement","oct"],Constraint:["constraint","oct"],Meaning:["meaning","oct"],Value:["amValue","oct"],Resource:["resource","square"],Capability:["capability","rounded"],CourseOfAction:["course","rounded"],ValueStream:["valueStream","rounded"],Actor:["actor","square"],Role:["role","square"],Collaboration:["collab","square"],Interface:["interface","square"],Process:["proc","rounded"],Function:["func","rounded"],Interaction:["interaction","rounded"],Event:["event","rounded"],Service:["serv","rounded"],Object:["passive","square"],DataObject:["passive","square"],Contract:["contract","square"],Representation:["representation","square"],Product:["product","square"],Location:["location","square"],Component:["comp","square"],Node:["node","square"],Device:["device","square"],SystemSoftware:["sysSw","square"],Path:["path","square"],CommunicationNetwork:["netw","square"],Artifact:["artifact","square"],Equipment:["equipment","square"],Facility:["facility","square"],DistributionNetwork:["distribution","square"],Material:["material","square"],WorkPackage:["workPackage","rounded"],Deliverable:["deliverable","square"],Plateau:["plateau","square"],Gap:["gap","square"]};function uC(r){var l=sC[r.kind];if(l)return l;var e=r.category==="Motivation"?"oct":iC[r.kind]?"rounded":"square";return["generic",e]}function fC(r,l){var e="",c=0;function i(be){return be+"_"+c++}var h=54,F=35,j=114,p=134,or=16,q=12,rr=40,nr=20,Xr=16,wr=22,pr=16,Dr=20,Ze=16,he={},Pr={},ve=or;function xr(be){be>ve&&(ve=be)}function qr(be,$n){return Math.round(Ki(be||"",$n)*.925)}function ze(be){return Math.max(140,qr(be)+20)}function wo(be){return be.category==="Junction"}function me(be){return wo(be)?Ze:ze(be.label||be.id)}function ue(be){return wo(be)?Ze:h+15*(String(be.label||"").split(`
+`).length-1)}var po=r.styleSheet||null;function x(be,$n){if(po==null)return be;var Wn=["root","element","componentDiagram","archimate"],$r=$n.stereotype?[$n.stereotype]:[],ee=U(po,Wn,$r,"vertex");delete ee.fillColor,delete ee.gradientColor,delete ee.rounded,delete ee.arcSize;var Rr=H(be,ee);if(/archiType=/.test(Rr)){var tr=Ft.userStyle(po,Wn,$r);Ft.asDouble(tr,"DiagonalCorner",0)>0?Rr=Rr.replace(/archiType=\w+;/,"archiType=oct;"):Ft.asDouble(tr,"RoundCorner",0)>0&&(Rr=Rr.replace(/archiType=\w+;/,"archiType=rounded;"))}return Rr}function S(be){var $n=lC(be);if(wo(be))return x("ellipse;html=1;fillColor="+$n+";strokeColor=#181818;fontColor=#000000;strokeWidth=0.5;verticalLabelPosition=bottom;verticalAlign=top;fontSize="+q+";",be);var Wn="whiteSpace=wrap;html=1;fillColor="+$n+";strokeColor=#181818;fontColor=#000000;strokeWidth=0.5;fontSize="+q+";",$r=uC(be);return x("shape=mxgraph.archimate3.application;appType="+$r[0]+";archiType="+$r[1]+";"+Wn,be)}for(var fr={__root__:[]},zr=0;zr<r.shapes.length;zr++){var Lr=r.shapes[zr],te=Lr.parent||"__root__";fr[te]||(fr[te]=[]),fr[te].push(Lr)}var W=or+(r.title?rr:0);function Zr(be,$n,Wn){var $r=me(be),ee=ue(be),Rr=i("arc");return he[be.id]=Rr,e+=u(Rr,be.label||be.id,S(be),$n,Wn,$r,ee,"1"),xr($n+$r),{w:$r,h:ee}}function Re(be,$n,Wn){for(var $r=fr[be.id]||[],ee=(be.kind||"").toLowerCase()==="group",Rr=0,tr=h,vr=0;vr<$r.length;vr++){Rr+=me($r[vr]),vr>0&&(Rr+=F);var Te=ue($r[vr]);Te>tr&&(tr=Te)}$r.length===0&&(Rr=120);var jr=Rr+2*Xr,_e=nr+wr+tr+pr,Br=i("grp");Pr[be.id]=Br;var br=qr(be.label||be.id,!0)+12;br>jr-10&&(br=jr-10);var Or="shape=folder;tabWidth="+br+";tabHeight="+nr+";tabPosition=left;html=1;whiteSpace=wrap;fontStyle=1;fontSize="+q+";align=left;verticalAlign=top;spacingLeft=4;spacingTop=-2;strokeWidth=1.5;"+(ee?"fillColor=#D3D3D3;strokeColor=#000000;fontColor=#000000;":"fillColor=#FFFFFF;strokeColor=#444444;dashed=1;fontColor=#444444;");e+=u(Br,be.label||be.id,Or,$n,Wn,jr,_e,"1"),xr($n+jr);for(var xe=Xr,bo=nr+wr,_t=0;_t<$r.length;_t++){var Wo=$r[_t],Fo=me(Wo),ut=ue(Wo),Do=i("arc");he[Wo.id]=Do,e+=u(Do,Wo.label||Wo.id,S(Wo),xe,bo+(tr-ut)/2,Fo,ut,Br),xe+=Fo+F}return{w:jr,h:_e}}var Ae=r.edges&&r.edges.length>0,Pe=r.shapes.length>0&&fr.__root__.length===0&&r.groups.length>0,De=W;if(Ae){for(var Qr={},Po=0;Po<r.shapes.length;Po++)Qr[r.shapes[Po].id]=Po;for(var Qe=[],yo=0;yo<r.shapes.length;yo++)Qe[yo]=0;for(var ie=0;ie<r.shapes.length;ie++)for(var pe=0;pe<r.edges.length;pe++){var Mo=Qr[r.edges[pe].from],Zt=Qr[r.edges[pe].to];Mo===void 0||Zt===void 0||Qe[Zt]<Qe[Mo]+1&&(Qe[Zt]=Qe[Mo]+1)}for(var Uo={},xn=0,gt=0;gt<r.shapes.length;gt++){var To=Qe[gt];To>xn&&(xn=To),(Uo[To]=Uo[To]||[]).push(r.shapes[gt])}for(var Rt=r.title?Math.round(r.title.length*8):0,Be=Rt,Ao=0;Ao<=xn;Ao++){for(var et=Uo[Ao]||[],jo=0,Tn=0;Tn<et.length;Tn++)jo+=me(et[Tn]),Tn>0&&(jo+=F);jo>Be&&(Be=jo)}for(var dn=0;dn<=xn;dn++){for(var An=Uo[dn]||[],Bo=0,kt=0;kt<An.length;kt++)Bo+=me(An[kt]),kt>0&&(Bo+=F);for(var Yn=or+(Be-Bo)/2,go=W+dn*p,Ho=0;Ho<An.length;Ho++)Zr(An[Ho],Yn,go),Yn+=me(An[Ho])+F;De=go+h}}else if(Pe)for(var Ro=or,At=0;At<r.groups.length;At++){var ot=Re(r.groups[At],Ro,W);Ro+=ot.w+Dr,W+ot.h>De&&(De=W+ot.h)}else{for(var oo=fr.__root__,to=Math.max(1,Math.ceil(Math.sqrt(oo.length))),cn=or,Yt=W,so=h,Bn=or,tt=0;tt<oo.length;tt++){var an=oo[tt],Ga=me(an);tt>0&&tt%to===0&&(cn=or,Yt+=j,so=h);var hn=Zr(an,cn,Yt);cn+=Ga+F,Yt===W&&(Bn=cn-F),hn.h>so&&(so=hn.h)}if(De=Yt+so,r.groups.length>0){for(var Da=Bn+(oo.length>0?21:0),jt=0,_n=0;_n<r.groups.length;_n++){var da=Re(r.groups[_n],Da,W);Da+=da.w+Dr,da.h>jt&&(jt=da.h)}W+jt>De&&(De=W+jt)}}for(var Jt=0;Jt<r.edges.length;Jt++){var Ut=r.edges[Jt],ga=he[Ut.from]||Pr[Ut.from],mn=he[Ut.to]||Pr[Ut.to];!ga||!mn||(e+=mr(i("rel"),Ut.label||"","endArrow=block;endFill=1;endSize=8;startArrow=oval;startFill=1;startSize=10;html=1;strokeColor=#000000;fontColor=#000000;fontSize=13;labelBackgroundColor=#FFFFFF;",ga,mn,"1"))}if(r.legend&&r.legend.lines&&r.legend.lines.length>0){var ma=qe(r.legend.lines),oa=or,On=De+20;e+=St(ma,oa,On,i,"none"),xr(oa+ma.w)}if(r.title){var Za=Math.max(120,ve-or,Math.round(r.title.length*8));e+=u(i("title"),r.title,"rounded=0;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",or,or,Za,30,"1")}return e}var xh={Person:{fill:"#08427B",stroke:"#073B6F",font:"#FFFFFF",extFill:"#686868",extStroke:"#666666"},System:{fill:"#1168BD",stroke:"#3C7FC0",font:"#FFFFFF",extFill:"#999999",extStroke:"#8A8A8A"},Container:{fill:"#438DD5",stroke:"#3C7FC0",font:"#FFFFFF",extFill:"#B3B3B3",extStroke:"#8A8A8A"},Component:{fill:"#85BBF0",stroke:"#78A8D8",font:"#000000",extFill:"#CCCCCC",extStroke:"#8A8A8A"}},dC=210;function cC(r,l){var e=xh[r]||xh.Component,c=/_ext$|^ext$/.test(l||"")||/ext/.test(l||""),i=c?e.extFill:e.fill,h=c?e.extStroke:e.stroke,F="html=1;whiteSpace=wrap;fillColor="+i+";strokeColor="+h+";fontColor="+e.font+";strokeWidth=0.5;fontSize=14;verticalAlign=top;spacingTop=6;";return/db/.test(l||"")?"shape=cylinder3;size=10;boundedLbl=1;backgroundOutline=1;"+F:/queue/.test(l||"")?"shape=queue;"+F:(r==="Person"||/person/.test(l||""),"rounded=0;"+F)}function hC(r,l){var e="",c=0;function i(Fe){return Fe+"_"+c++}var h=dC,F=90,j=r.nodesep||45,p=r.ranksep||55,or=r.nodesep||50,q=30,rr=40,nr=16,Xr=r.nodesep?Math.round(r.nodesep/2+3):nr,wr=30,pr={},Dr={},Ze={},he=!r.hasLegend,Pr={};function ve(Fe){return Pr[Fe.id]||(Pr[Fe.id]=gC(Fe,he)),Pr[Fe.id]}function xr(Fe,$e,Se,ro,It,Jo,xo,Et){var Vn=i("c4");pr[Fe.id]=Vn,Ze[Fe.id]={x:xo===void 0?$e:xo,y:Et===void 0?Se:Et,w:ro,h:It};var Un=cC(Fe.category,Fe.variant),bt=Fe.category==="Person";bt&&!he&&(Un+="spacingTop=57;");var mt=z(Vn,vC(Fe,he),Un,$e,Se,ro,It,Jo);if(bt){var In=ro/2,Zn=he?26:10;mt+=u(i("c4sp"),"","shape=mxgraph.c4.person2;fillColor=#FFFFFF;strokeColor=none;",In-24,Zn,48,48,Vn)}return mt}for(var qr={},ze={},wo=0;wo<r.boundaries.length;wo++){var me=r.boundaries[wo];me.stereotype&&me.stereotype.toLowerCase()==="layout"&&(qr[me.id]=!0)}function ue(Fe){for(;Fe&&qr[Fe];){for(var $e=null,Se=0;Se<r.boundaries.length;Se++)if(r.boundaries[Se].id===Fe){$e=r.boundaries[Se].parent;break}Fe=$e}return Fe}for(var po=[],x=0;x<r.boundaries.length;x++){var S=r.boundaries[x];qr[S.id]||po.push({id:S.id,label:S.label,kind:S.kind,stereotype:S.stereotype,children:S.children,parent:ue(S.parent)})}for(var fr={__root__:[]},zr=0;zr<r.shapes.length;zr++){var Lr=r.shapes[zr],te=Lr.parent||"__root__",W=te==="__root__"?"__root__":ue(te)||"__root__";fr[W]||(fr[W]=[]),fr[W].push(Lr),ze[Lr.id]=W}var Zr=q,Re=Zr,Ae=r.title?Pf(r.title).length:0,Pe=Ae?Ae*20+4:0;r.title&&(Zr+=Pe+20);for(var De=[],Qr={},Po=0;Po<po.length;Po++)Qr[po[Po].id]=De.length,De.push({boundary:po[Po]});for(var Qe=fr.__root__,yo=0;yo<Qe.length;yo++)Qr[Qe[yo].id]=De.length,De.push({shape:Qe[yo]});function ie(Fe){if(Qr[Fe]!==void 0)return Qr[Fe];var $e=ze[Fe];return $e&&$e!=="__root__"&&Qr[$e]!==void 0?Qr[$e]:-1}for(var pe=[],Mo=0;Mo<r.edges.length;Mo++){var Zt=r.edges[Mo];pe.push({from:Zt.back?Zt.to:Zt.from,to:Zt.back?Zt.from:Zt.to,label:Zt.label,technology:Zt.technology,direction:Zt.direction})}function Uo(Fe,$e){for(var Se=[],ro=0;ro<Fe;ro++)Se.push(0);for(var It=0;It<=Fe;It++){for(var Jo=!1,xo=0;xo<$e.length;xo++){var Et=$e[xo];Et.from<0||Et.to<0||Et.from===Et.to||Et.direction==="left"||Et.direction==="right"||Se[Et.to]<Se[Et.from]+1&&(Se[Et.to]=Se[Et.from]+1,Jo=!0)}if(!Jo)break}for(var Vn=0;Vn<Fe;Vn++){for(var Un=!1,bt=0;bt<$e.length;bt++){var mt=$e[bt];mt.from<0||mt.to<0||mt.from===mt.to||(mt.direction==="left"||mt.direction==="right")&&Se[mt.to]!==Se[mt.from]&&(Se[mt.to]=Se[mt.from],Un=!0)}if(!Un)break}return Se}for(var xn=[],gt=0;gt<pe.length;gt++)xn.push({from:ie(pe[gt].from),to:ie(pe[gt].to),direction:pe[gt].direction});for(var To=Uo(De.length,xn),Rt=0;Rt<De.length;Rt++){var Be=De[Rt];if(Be.shape){var Ao=ve(Be.shape);Be.w=Ao.w,Be.h=Ao.h;continue}for(var et=fr[Be.boundary.id]||[],jo={},Tn=0;Tn<et.length;Tn++)jo[et[Tn].id]=Tn;for(var dn=[],An=0;An<pe.length;An++){var Bo=jo[pe[An].from],kt=jo[pe[An].to];dn.push({from:Bo===void 0?-1:Bo,to:kt===void 0?-1:kt,direction:pe[An].direction})}for(var Yn=Uo(et.length,dn),go=[],Ho=0;Ho<et.length;Ho++){var Ro=Yn[Ho];go[Ro]||(go[Ro]=[]),go[Ro].push(et[Ho])}Be.childRows=[],Be.rowHs=[];for(var At=0,ot=0,oo=0;oo<go.length;oo++)if(!(!go[oo]||!go[oo].length)){for(var to=go[oo],cn=0,Yt=0,so=0;so<to.length;so++){var Bn=ve(to[so]);cn+=Bn.w+(so?or:0),Yt=Math.max(Yt,Bn.h)}Be.childRows.push(to),Be.rowHs.push(Yt),At=Math.max(At,cn),ot+=Yt+(Be.childRows.length>1?p:0)}et.length===0&&(At=h-2*nr,ot=40),Be.w=At+2*Xr,Be.h=rr+nr+ot+nr}for(var tt=[],an=0;an<De.length;an++){var Ga=To[an];tt[Ga]||(tt[Ga]=[]),tt[Ga].push(De[an])}for(var hn=[],Da=[],jt=0,_n=0;_n<tt.length;_n++)if(!(!tt[_n]||!tt[_n].length)){for(var da=tt[_n],Jt=0,Ut=0;Ut<da.length;Ut++)Jt+=da[Ut].w+(Ut?j:0);hn.push(da),Da.push(Jt),jt=Math.max(jt,Jt)}r.title&&(e+=z(i("c4title"),k(r.title).replace(/&#10;/g,"<br>"),"text;html=1;rounded=0;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",q,Re,jt,Pe,"1"));for(var ga=0;ga<hn.length;ga++){for(var mn=hn[ga],ma=q+(jt-Da[ga])/2,oa=0,On=0;On<mn.length;On++)oa=Math.max(oa,mn[On].h);for(var Za=0;Za<mn.length;Za++){var be=mn[Za];if(be.shape)e+=xr(be.shape,ma,Zr,be.w,be.h,"1");else{var $n=i("bnd");Dr[be.boundary.id]=$n;var Wn='<font style="font-size:16px;"><b>'+k(be.boundary.label||be.boundary.id)+"</b></font><br>["+RC(be.boundary)+"]",$r="rounded=0;html=1;whiteSpace=wrap;fillColor=none;strokeColor=#444444;dashed=1;dashPattern=7 7;verticalAlign=top;align=center;fontColor=#444444;fontSize=12;";e+=z($n,Wn,$r,ma,Zr,be.w,be.h,"1"),Ze[be.boundary.id]={x:ma,y:Zr,w:be.w,h:be.h};for(var ee=ma,Rr=Zr,tr=rr+nr,vr=0;vr<be.childRows.length;vr++){for(var Te=be.childRows[vr],jr=0,_e=0;_e<Te.length;_e++)jr+=ve(Te[_e]).w+(_e?or:0);for(var Br=(be.w-jr)/2,br=0;br<Te.length;br++){var Or=Te[br],xe=ve(Or);e+=xr(Or,Br,tr,xe.w,xe.h,$n,ee+Br,Rr+tr),Br+=xe.w+or}tr+=be.rowHs[vr]+p}}ma+=be.w+j}Zr+=oa+F}for(var bo=[],_t=0;_t<r.edges.length;_t++){var Wo=r.edges[_t],Fo=pr[Wo.from]||Dr[Wo.from],ut=pr[Wo.to]||Dr[Wo.to];if(!(!Fo||!ut)){if(Wo.back){var Do=Fo;Fo=ut,ut=Do}var Fr="endArrow=block;endFill=1;endSize=5;html=1;strokeColor=#666666;fontColor=#666666;fontSize=12;fontStyle=1;";r.linetype==="ortho"?Fr+="edgeStyle=orthogonalEdgeStyle;rounded=0;":Fr+="curved=1;";var Gt=[];if(Wo.label)for(var st=Pf(Wo.label),Mn=0;Mn<st.length;Mn++)Gt.push({t:st[Mn],b:!0});Wo.technology&&Gt.push({t:"["+Wo.technology+"]",i:!0});var jn=Ze[Wo.from],Hn=Ze[Wo.to];if(Gt.length&&jn&&Hn){for(var Xo=[],Xn=0,Ta=Gt.length,Kn=0;Kn<Gt.length;Kn++){var Qo=Gt[Kn],pa=k(Qo.t);Xo.push(Qo.b?"<b>"+pa+"</b>":Qo.i?"<i>"+pa+"</i>":pa),Xn=Math.max(Xn,dd(Qo.t,12,!!Qo.b))}var Mt=Math.ceil(Xn)+10,la=Ta*16+4,vn=jn.x+jn.w/2,Jn=jn.y+jn.h/2,qn=Hn.x+Hn.w/2,ia=Hn.y+Hn.h/2,zn=(vn+qn)/2,Ko=(Jn+ia)/2,Bt=Math.abs(ia-Jn)>=Math.abs(qn-vn),ta,ln,mo;Bt?(ta=zn+4,ln=Ko-la/2,mo="left"):(ta=zn-Mt/2,ln=Ko-la/2,mo="center"),bo.push({html:Xo.join("<br>"),x:ta,y:ln,w:Mt,h:la,align:mo})}e+=mr(i("rel"),"",Fr,Fo,ut,"1")}}for(var Vt=0;Vt<bo.length;Vt++)if(!bo[Vt].done){var nt=[bo[Vt]];bo[Vt].done=!0;for(var kr=Vt+1;kr<bo.length;kr++){var Ir=bo[kr];if(!Ir.done)for(var Tr=0;Tr<nt.length;Tr++){var Gr=nt[Tr];if(Ir.x<Gr.x+Gr.w+4&&Gr.x<Ir.x+Ir.w+4&&Ir.y<Gr.y+Gr.h&&Gr.y<Ir.y+Ir.h){nt.push(Ir),Ir.done=!0;break}}}if(nt.length>1){nt.sort(function(Fe,$e){return Fe.x-$e.x});for(var Vr=0,Ge=0,Jr=0;Jr<nt.length;Jr++)Vr=Math.max(Vr,nt[Jr].w),Ge+=nt[Jr].x+nt[Jr].w/2;Ge/=nt.length;for(var co=Vr+24,Ie=Ge-co*(nt.length-1)/2,Ee=0;Ee<nt.length;Ee++)nt[Ee].x=Ie+Ee*co-nt[Ee].w/2}}for(var qo=0;qo<bo.length;qo++){var Ot=bo[qo];e+=z(i("rellbl"),Ot.html,"text;html=1;fillColor=none;strokeColor=none;fontSize=12;fontColor=#666666;align="+Ot.align+";verticalAlign=middle;whiteSpace=nowrap;",Math.round(Ot.x),Math.round(Ot.y),Ot.w,Ot.h,"1")}if(r.hasLegend){var no=[{fill:"#08427B",label:"person"},{fill:"#1168BD",label:"system"},{fill:"#438DD5",label:"container"}];r.hasComponent&&no.push({fill:"#85BBF0",label:"component"}),no.push({fill:"#686868",label:"external person"},{fill:"#999999",label:"external system"},{fill:"#B3B3B3",label:"external container"}),r.hasComponent&&no.push({fill:"#CCCCCC",label:"external component"});var Fn=19,Cn=140,yt=q+Math.max(0,jt-Cn),wt=Zr-F+40;e+=u(i("lg"),"Legend","text;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=left;verticalAlign=middle;",yt,wt,Cn,18,"1"),wt+=18;for(var rt=0;rt<no.length;rt++){var le=no[rt];e+=u(i("lg"),le.label,"rounded=0;fillColor="+le.fill+";strokeColor=none;fontSize=12;fontColor=#FFFFFF;align=left;spacingLeft=6;",yt,wt+rt*Fn,Cn,Fn,"1")}}return e}function Pf(r){return String(r??"").split(/\\n|&#10;|\r?\n/)}function vC(r,l){var e=[];l&&e.push('<font style="font-size:12px;"><i>\xAB'+k(String(r.category||"").toLowerCase())+"\xBB</i></font>"),r.category==="Person"&&l&&e.push('<font style="font-size:36px;">&#160;</font>');for(var c=Pf(r.label||r.id),i=0;i<c.length;i++)e.push('<font style="font-size:16px;"><b>'+k(c[i])+"</b></font>");if(r.technology&&e.push('<font style="font-size:12px;"><i>['+k(r.technology)+"]</i></font>"),r.description){e.push("");for(var h=Pf(r.description),F=0;F<h.length;F++)e.push(k(h[F]))}return e.join("<br>")}function CC(r){return r==="\u23AF"||r==="\u2014"||r==="\u2015"?13.4:`iIljtfr.,:;!|'"()[]{} `.indexOf(r)>=0?4.2:"mwMW".indexOf(r)>=0?11.7:7.8}function dd(r,l,e){for(var c=String(r??""),i=0,h=0;h<c.length;h++)i+=CC(c.charAt(h));return i*(l/14)*(e?1.08:1)}function Yh(r,l,e,c){var i=dd(r,l,e);if(!r||i<=c)return{count:1,maxW:i};for(var h=String(r).split(/\s+/),F="",j=0,p=0,or=0;or<h.length;or++){var q=F?F+" "+h[or]:h[or];F&&dd(q,l,e)>c?(j++,p=Math.max(p,dd(F,l,e)),F=h[or]):F=q}return F&&(j++,p=Math.max(p,dd(F,l,e))),{count:j||1,maxW:p||i}}function pC(r,l){var e=[];l&&e.push({text:"\xAB"+String(r.category||"").toLowerCase()+"\xBB",size:12,bold:!1,kind:"stereo"});for(var c=Pf(r.label||r.id),i=0;i<c.length;i++)e.push({text:c[i],size:16,bold:!0,kind:"name"});if(r.technology&&e.push({text:"["+r.technology+"]",size:12,bold:!1,kind:"tech"}),r.description){e.push({text:"",size:14,bold:!1,kind:"blank"});for(var h=Pf(r.description),F=0;F<h.length;F++)e.push({text:h[F],size:14,bold:!1,kind:"desc"})}return e}var $C=200,Hc=20;function gC(r,l){var e=pC(r,l),c=r.category==="Person",i,h=0;for(i=0;i<e.length;i++)e[i].text&&(h=Math.max(h,Yh(e[i].text,e[i].size,e[i].bold,$C).maxW));var F=Math.ceil(h)+Hc,j=F-8,p=0,or=0,q=0,rr=0;for(h=0,i=0;i<e.length;i++){var nr=e[i],Xr=nr.text?Yh(nr.text,nr.size,nr.bold,j):{count:1,maxW:0};nr.text&&(h=Math.max(h,Xr.maxW)),nr.kind==="name"?p+=Xr.count:nr.kind==="desc"?or+=Xr.count:nr.kind==="tech"?q+=Xr.count:nr.kind==="stereo"&&(rr+=Xr.count)}F=Math.max(F,Math.ceil(h)+Hc);var wr=!!r.description,pr=Hc+rr*16.3+(c?48:0)+p*21.8+q*16.3+(wr?19.04+or*19.04:0);return/db/.test(r.variant||"")&&(pr+=20),{w:F,h:Math.round(Math.max(c?110:66,pr)),sprite:c}}function RC(r){var l=(r.kind||"").toLowerCase();return l.indexOf("container")===0?"container":l.indexOf("system")===0?"system":l.indexOf("enterprise")===0?"enterprise":(r.stereotype||"boundary").toLowerCase()}var Mh=[["account-login","account-logout","action-redo","action-undo","align-center","align-left","align-right","aperture","arrow-bottom","arrow-circle-bottom","arrow-circle-left","arrow-circle-right","arrow-circle-top","arrow-left","arrow-right","arrow-thick-bottom","arrow-thick-left","arrow-thick-right","arrow-thick-top","arrow-top","audio-spectrum","audio","badge","ban","bar-chart","basket","battery-empty","battery-full","beaker"],["bell","bluetooth","bold","bolt","book","bookmark","box","briefcase","british-pound","browser","brush","bug","bullhorn","calculator","calendar","camera-slr","caret-bottom","caret-left","caret-right","caret-top","cart","chat","check","chevron-bottom","chevron-left","chevron-right","chevron-top","circle-check","circle-x","clipboard","clock","cloud-download","cloud-upload"],["cloud","cloudy","code","cog","collapse-down","collapse-left","collapse-right","collapse-up","command","comment-square","compass","contrast","copywriting","credit-card","crop","dashboard","data-transfer-download","data-transfer-upload","delete","dial","document","dollar","double-quote-sans-left","double-quote-sans-right","double-quote-serif-left","double-quote-serif-right","droplet","eject","elevator","ellipses","envelope-closed","envelope-open","euro"],["excerpt","expand-down","expand-left","expand-right","expand-up","external-link","eye","eyedropper","file","fire","flag","flash","folder","fork","fullscreen-enter","fullscreen-exit","globe","graph","grid-four-up","grid-three-up","grid-two-up","hard-drive","header","headphones","heart","home","image","inbox","infinity","info","italic","justify-center","justify-left"],["justify-right","key","laptop","layers","lightbulb","link-broken","link-intact","list-rich","list","location","lock-locked","lock-unlocked","loop-circular","loop-square","loop","magnifying-glass","map-marker","map","media-pause","media-play","media-record","media-skip-backward","media-skip-forward","media-step-backward","media-step-forward","media-stop","medical-cross","menu","microphone","minus","monitor","moon","move"],["musical-note","paperclip","pencil","people","person","phone","pie-chart","pin","play-circle","plus","power-standby","print","project","pulse","puzzle-piece","question-mark","rain","random","reload","resize-both","resize-height","resize-width","rss-alt","rss","script","share-boxed","share","shield","signal","signpost","sort-ascending","sort-descending","spreadsheet"],["star","sun","tablet","tag","tags","target","task","terminal","text","thumb-down","thumb-up","timer","transfer","trash","underline","vertical-align-bottom","vertical-align-center","vertical-align-top","video","volume-high","volume-low","volume-off","warning","wifi","wrench","x","yen","zoom-in","zoom-out"]],AC=[14,179,293,453,565,710,825],mC=[69,4,4,4,4,4,4];function kC(r){r=r||{};var l="",e=8,c=0;function i(ve){for(var xr=0,qr=0;qr<ve.length;qr++)xr=Math.max(xr,s(ve[qr]).length);return xr}function h(ve){for(var xr=[],qr=0;qr<ve.length;qr++){var ze=ve[qr];/^(?:<#\w+>)?\|.*\|$/.test(ze)&&(ze=ze.replace(/^(?:<#\w+>)?\|\s*|\s*\|$/g,"").split("|").map(function(wo){return wo.replace(/^\s+|\s+$/g,"").replace(/^=\s*/,"").replace(/^<#\w+>\s*/,"").replace(/^<[lrc]>\s*/,"")}).join(" ")),xr.push(ze)}return xr}function F(ve,xr,qr,ze){var wo=ve.split(`
+`),me=Math.max(50,i(wo)*qr*(ze?.62:.56)+24),ue=wo.length*(qr+5)+16;l+=u("t_"+c++,ve,xr,5,e,me,ue,"1"),e+=ue+6}if(r.header&&F(r.header,"text;html=1;fillColor=none;strokeColor=none;fontSize=10;fontColor=#000000;align=right;verticalAlign=middle;",10,!1),r.title){var j=r.title.split(`
+`),p=Math.max(50,i(j)*8+24),or=j.length>1?j.length*19+16:39;l+=z("t_title",t(r.title),"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontStyle=1;fontColor=#000000;align=center;verticalAlign=middle;",5,e,p,or,"1"),e+=or+6}for(var q=r.notes||[],rr=0;rr<q.length;rr++){var nr=h(q[rr].lines),Xr=nr.join(`
+`),wr=Math.max(40,i(nr)*7+26),pr=Math.max(1,nr.length)*17+12,Dr=q[rr].color&&Y(q[rr].color)||"#FEFFDD";l+=u("t_note"+rr,Xr,"shape=note;size=10;fillColor="+Dr+";strokeColor=#181818;fontColor=#000000;fontSize=12;align=left;spacingLeft=6;verticalAlign=middle;whiteSpace=wrap;html=1;",5,e,wr,pr,"1"),e+=pr+10}if(r.legend&&r.legend.lines&&r.legend.lines.length){var Ze=h(r.legend.lines),he=Math.max(40,i(Ze)*7+26),Pr=Ze.length*17+12;l+=u("t_legend",Ze.join(`
+`),"rounded=0;fillColor=#DDDDDD;strokeColor=#000000;strokeWidth=1;fontColor=#000000;fontSize=12;align=left;spacingLeft=8;verticalAlign=middle;whiteSpace=wrap;html=1;",5,e,he,Pr,"1"),e+=Pr+6}return r.caption&&F(r.caption,"text;html=1;fillColor=none;strokeColor=none;fontSize=14;fontColor=#000000;align=center;verticalAlign=middle;",14,!1),r.footer&&F(r.footer,"text;html=1;fillColor=none;strokeColor=none;fontSize=10;fontColor=#000000;align=right;verticalAlign=middle;",10,!1),l}function _C(){var r="",l=0;function e(j,p,or,q,rr,nr){return' <mxCell id="oi'+l+++'" value="'+j+'" style="'+p+`" vertex="1" parent="1">
+ <mxGeometry x="`+or+'" y="'+q+'" width="'+rr+'" height="'+nr+`" as="geometry"/>
</mxCell>
-`}var h="text;html=1;fontSize=12;fontColor=#000000;align=left;verticalAlign=top;spacingTop=0;";r+=e(d("List Open Iconic"),h+"fontStyle=1;",1,4,150,18),r+=e(d("Credit to"),h+"fontStyle=2;",1,20,150,18),r+=e(d("https://useiconic.com/open"),h,1,36,180,18);for(var l=0;l<ih.length;l++){var C=ih[l],b=C.length*16+6;r+=e(d(C.join(`
-`)),h,qC[l],ZC[l],115,b)}return r}var sh=[["archimate","Version 1.1.0","Delivered by https://github.com/plantuml-stdlib/Archimate-PlantUML"],["aws","Version 18.02.22","Delivered by https://github.com/milo-minderbinder/AWS-PlantUML"],["awslib","Version 14.0.0","Delivered by https://github.com/awslabs/aws-icons-for-plantuml"],["azure","Version 2.2.0","Delivered by https://github.com/plantuml-stdlib/Azure-PlantUML"],["c4","Version 2.10.0","Delivered by https://github.com/plantuml-stdlib/C4-PlantUML"],["classy","Version 1.0.2","Delivered by https://github.com/james-gadrow-kr/classy-plantuml"],["classy-c4","Version 1.0.3","Delivered by https://github.com/james-gadrow-kr/classy-c4"],["cloudinsight","Version 1.0.0","Delivered by https://github.com/plantuml-stdlib/cicon-plantuml-sprites"],["cloudogu","Version 1.0.2","Delivered by https://github.com/cloudogu/plantuml-cloudogu-sprites"],["domainstory","Version 0.3","Delivered by https://github.com/johthor/DomainStory-PlantUML"],["edgy","Version 0.8.0","Delivered by https://github.com/boessu/plantuml-stdlib"],["eip","Version 1.0.0","Delivered by https://github.com/plantuml-stdlib/EIP-PlantUML"],["elastic","Version 0.0.1","Delivered by https://github.com/Crashedmind/PlantUML-Elastic-icons"],["gcp","Version 6.0.0","Delivered by https://github.com/Crashedmind/PlantUML-icons-GCP"],["k8s","Version 1.0.0","Delivered by https://github.com/dcasati/kubernetes-PlantUML"],["kubernetes","Version 5.3.45","Delivered by https://github.com/plantuml-stdlib/plantuml-kubernetes-sprites"],["logos","Version 1.1.0","Delivered by https://github.com/plantuml-stdlib/gilbarbara-plantuml-sprites"],["material","Version 0.0.1","Delivered by https://github.com/Templarian/MaterialDesign"],["office","Version 1.0.0","Delivered by https://github.com/Roemer/plantuml-office"],["osa","Version 0.0.1","Delivered by https://github.com/Crashedmind/PlantUML-opensecurityarchitecture-icons"],["osa2","Version 0.0.1","Delivered by https://github.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons"],["tupadr3","Version 3.0.0","Delivered by https://github.com/tupadr3/plantuml-icon-font-sprites"]];function VC(){for(var r="",a=4,e=0;e<sh.length;e++){var h=sh[e];r+=s("sl_"+e+"_n",h[0],"text;html=1;fontSize=12;fontStyle=1;fontFamily=monospace;fontColor=#000000;align=left;verticalAlign=middle;",5,a,600,14,"1"),r+=s("sl_"+e+"_v",h[1],"text;html=1;fontSize=12;fontFamily=monospace;fontColor=#000000;align=left;verticalAlign=middle;",5,a+14.5,600,14,"1"),r+=s("sl_"+e+"_d",h[2],"text;html=1;fontSize=12;fontFamily=monospace;fontColor=#000000;align=left;verticalAlign=middle;",5,a+29,609,14,"1"),a+=65.7}return r}function QC(r,a){a=a||{};var e="";r.type==="sequence"&&r.ir?e=zt(r.ir,a):r.type==="state"&&r.ir?e=Un(r.ir,a):r.type==="class"&&r.ir?e=Ni(r.ir,a):r.type==="activity"&&r.ir?e=cu(r.ir,a):r.type==="activityLegacy"&&r.ir?e=Du(r.ir,a):r.type==="component"&&r.ir?e=vu(r.ir,a):r.type==="object"&&r.ir?e=Gd(r.ir,a):r.type==="useCase"&&r.ir?e=Uh(r.ir,a):r.type==="mindmap"&&r.ir?e=cC(r.ir,a):r.type==="wbs"&&r.ir?e=pC(r.ir,a):r.type==="json"&&r.ir?e=eh(r.ir):r.type==="yaml"&&r.ir?e=RC(r.ir,a):r.type==="gantt"&&r.ir?e=mC(r.ir,a):r.type==="timing"&&r.ir?e=kC(r.ir,a):r.type==="salt"&&r.ir?e=bC(r.ir,a):r.type==="network"&&r.ir?e=TC(r.ir,a):r.type==="archimate"&&r.ir?e=PC(r.ir,a):r.type==="c4"&&r.ir?e=xC(r.ir,a):r.type==="titleOnly"?e=jC(r.ir):r.type==="openiconicList"?e=JC():r.type==="stdlib"&&(e=VC()),r.ir&&r.type!=="openiconicList"&&r.type!=="stdlib"&&(e+=jt(r.ir,e,r.ir.styleSheet)),r.ir&&r.ir.styleSheet&&(kt.hasUserRules(r.ir.styleSheet)&&(e=gr(e,r.ir.styleSheet)),/^(?:true|on|yes)$/i.test(String(r.ir.styleSheet.skinparams.handwritten||""))&&(e=e.replace(/ style="([^"]*)"/g,function(Z,v){return/(?:^|;)sketch=/.test(v)?Z:' style="'+v+(v.length>0&&v.charAt(v.length-1)!==";"?";":"")+'sketch=1;"'})));var h=null;if(r.ir&&r.ir.styleSheet){var l=kt.pageBackground(r.ir.styleSheet);if(l==null&&(r.type==="timing"||r.type==="salt")&&(l=kt.color(kt.userStyle(r.ir.styleSheet,["root","element",r.type+"Diagram"]),"BackGroundColor")),l!=null&&l!=="none"){var C=$r(l);h=C!=null&&C.fill!=="none"?C.fill:null}}var b="<mxGraphModel"+(h!=null?' background="'+d(h)+'"':"")+`>
+`}var c="text;html=1;fontSize=12;fontColor=#000000;align=left;verticalAlign=top;spacingTop=0;";r+=e(g("List Open Iconic"),c+"fontStyle=1;",1,4,150,18),r+=e(g("Credit to"),c+"fontStyle=2;",1,20,150,18),r+=e(g("https://useiconic.com/open"),c,1,36,180,18);for(var i=0;i<Mh.length;i++){var h=Mh[i],F=h.length*16+6;r+=e(g(h.join(`
+`)),c,AC[i],mC[i],115,F)}return r}var Hh=[["archimate","Version 1.1.0","Delivered by https://github.com/plantuml-stdlib/Archimate-PlantUML"],["aws","Version 18.02.22","Delivered by https://github.com/milo-minderbinder/AWS-PlantUML"],["awslib","Version 14.0.0","Delivered by https://github.com/awslabs/aws-icons-for-plantuml"],["azure","Version 2.2.0","Delivered by https://github.com/plantuml-stdlib/Azure-PlantUML"],["c4","Version 2.10.0","Delivered by https://github.com/plantuml-stdlib/C4-PlantUML"],["classy","Version 1.0.2","Delivered by https://github.com/james-gadrow-kr/classy-plantuml"],["classy-c4","Version 1.0.3","Delivered by https://github.com/james-gadrow-kr/classy-c4"],["cloudinsight","Version 1.0.0","Delivered by https://github.com/plantuml-stdlib/cicon-plantuml-sprites"],["cloudogu","Version 1.0.2","Delivered by https://github.com/cloudogu/plantuml-cloudogu-sprites"],["domainstory","Version 0.3","Delivered by https://github.com/johthor/DomainStory-PlantUML"],["edgy","Version 0.8.0","Delivered by https://github.com/boessu/plantuml-stdlib"],["eip","Version 1.0.0","Delivered by https://github.com/plantuml-stdlib/EIP-PlantUML"],["elastic","Version 0.0.1","Delivered by https://github.com/Crashedmind/PlantUML-Elastic-icons"],["gcp","Version 6.0.0","Delivered by https://github.com/Crashedmind/PlantUML-icons-GCP"],["k8s","Version 1.0.0","Delivered by https://github.com/dcasati/kubernetes-PlantUML"],["kubernetes","Version 5.3.45","Delivered by https://github.com/plantuml-stdlib/plantuml-kubernetes-sprites"],["logos","Version 1.1.0","Delivered by https://github.com/plantuml-stdlib/gilbarbara-plantuml-sprites"],["material","Version 0.0.1","Delivered by https://github.com/Templarian/MaterialDesign"],["office","Version 1.0.0","Delivered by https://github.com/Roemer/plantuml-office"],["osa","Version 0.0.1","Delivered by https://github.com/Crashedmind/PlantUML-opensecurityarchitecture-icons"],["osa2","Version 0.0.1","Delivered by https://github.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons"],["tupadr3","Version 3.0.0","Delivered by https://github.com/tupadr3/plantuml-icon-font-sprites"]];function OC(){for(var r="",l=4,e=0;e<Hh.length;e++){var c=Hh[e];r+=u("sl_"+e+"_n",c[0],"text;html=1;fontSize=12;fontStyle=1;fontFamily=monospace;fontColor=#000000;align=left;verticalAlign=middle;",5,l,600,14,"1"),r+=u("sl_"+e+"_v",c[1],"text;html=1;fontSize=12;fontFamily=monospace;fontColor=#000000;align=left;verticalAlign=middle;",5,l+14.5,600,14,"1"),r+=u("sl_"+e+"_d",c[2],"text;html=1;fontSize=12;fontFamily=monospace;fontColor=#000000;align=left;verticalAlign=middle;",5,l+29,609,14,"1"),l+=65.7}return r}function yC(r,l){l=l||{};var e="";if(We=(r.type==="class"||r.type==="state")&&r.ir?Qf.hints():null,r.type==="sequence"&&r.ir?e=Pt(r.ir,l):r.type==="state"&&r.ir?e=Sa(r.ir,l):r.type==="class"&&r.ir?e=Ii(r.ir,l):r.type==="activity"&&r.ir?e=Qs(r.ir,l):r.type==="activityLegacy"&&r.ir?e=cf(r.ir,l):r.type==="component"&&r.ir?e=vf(r.ir,l):r.type==="object"&&r.ir?e=xu(r.ir,l):r.type==="useCase"&&r.ir?e=$v(r.ir,l):r.type==="mindmap"&&r.ir?e=Pv(r.ir,l):r.type==="wbs"&&r.ir?e=Hv(r.ir,l):r.type==="json"&&r.ir?e=Lh(r.ir):r.type==="yaml"&&r.ir?e=Uv(r.ir,l):r.type==="gantt"&&r.ir?e=Xv(r.ir,l):r.type==="timing"&&r.ir?e=qv(r.ir,l):r.type==="salt"&&r.ir?e=Vv(r.ir,l):r.type==="network"&&r.ir?e=nC(r.ir,l):r.type==="archimate"&&r.ir?e=fC(r.ir,l):r.type==="c4"&&r.ir?e=hC(r.ir,l):r.type==="titleOnly"?e=kC(r.ir):r.type==="openiconicList"?e=_C():r.type==="stdlib"&&(e=OC()),We!=null){var c=Qf.engineFor(l);if(l._layout="rows",c!=null){var i=Qf.apply(e,We,c,{layoutOptions:l.dotLayoutOptions||null,warn:function(or){Eo.warn(r.config||l,"layout",or,null,null)}});i!==e&&(e=i,l._layout="elk")}We=null}r.ir&&r.type!=="openiconicList"&&r.type!=="stdlib"&&(e+=qt(r.ir,e,r.ir.styleSheet)),r.ir&&r.ir.styleSheet&&(Ft.hasUserRules(r.ir.styleSheet)&&(e=gr(e,r.ir.styleSheet)),/^(?:true|on|yes)$/i.test(String(r.ir.styleSheet.skinparams.handwritten||""))&&(e=e.replace(/ style="([^"]*)"/g,function(or,q){return/(?:^|;)sketch=/.test(q)?or:' style="'+q+(q.length>0&&q.charAt(q.length-1)!==";"?";":"")+'sketch=1;"'})));var h=null;if(r.ir&&r.ir.styleSheet){var F=Ft.pageBackground(r.ir.styleSheet);if(F==null&&(r.type==="timing"||r.type==="salt")&&(F=Ft.color(Ft.userStyle(r.ir.styleSheet,["root","element",r.type+"Diagram"]),"BackGroundColor")),F!=null&&F!=="none"){var j=Cr(F);h=j!=null&&j.fill!=="none"?j.fill:null}}var p="<mxGraphModel"+(h!=null?' background="'+g(h)+'"':"")+`>
<root>
<mxCell id="0"></mxCell>
<mxCell id="1" parent="0"></mxCell>
`+e+` </root>
-</mxGraphModel>`;return b}return{themeDefaults:pr,registerShape:Xr,createMxGraph:Tr,build:se,buildXml:QC}})();var dd=(function(){function pr(){return typeof mxCodec<"u"&&typeof mxUtils<"u"&&typeof Graph<"u"}function q(Tr,se){var Kr=Xr(Tr,se);return Kr.xml}function Xr(Tr,se){se=se||{};var Kr=zl.parse(Tr,se),Dr=of.buildXml(Kr,se),ar=Kr.config||se,Y=vo.collect(ar),$r=(Dr.match(/<mxCell\b/g)||[]).length;if($r<=2){var rr=vo.typeLabel(Kr.type),H=vo.statementCount(ar),M=ar._droppedLines||0,j="the "+rr+" produced no shapes";H===0?j+=": the body has no statements":M>0?j+=": "+(M>=H?"none of":H-M+" of")+" its "+H+" statement line"+(H===1?"":"s")+(M>=H||H-M===1?" was":" were")+" understood (see the dropped-line warnings)":j+=" from its "+H+" statement line"+(H===1?"":"s")+"; nothing in them is drawn by this converter yet",Y.unshift({code:"empty-result",message:j,line:null})}for(var gr=[],W=0;W<Y.length;W++)gr.push(vo.format(Y[W]));return{xml:Dr,type:Kr.type,warnings:gr,diagnostics:Y}}return{convert:q,convertWithMeta:Xr}})();var Kh=(function(){var pr="group;transparentBounds=1;editIcon=1;lockedGroup=0;groupPadding=10;";function q(rr,H){$r.lastWarnings=[],$r.lastDiagnostics=[];var M=dd.convertWithMeta(rr,H||{});return $r.lastWarnings=M.warnings,$r.lastDiagnostics=M.diagnostics,M}function Xr(rr,H){return q(rr,H).xml}function Tr(rr){return String(rr).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\r/g,"&#13;").replace(/\n/g,"&#10;").replace(/\t/g,"&#9;")}var se=0;function Kr(rr){for(var H=/<mxCell id="([^"]*)"( value="([^"]*)")?( style="([^"]*)")([^>]*edge="1"[^>]*)>\s*<mxGeometry relative="1" as="geometry">\s*<mxPoint x="([-0-9.]+)" y="([-0-9.]+)" as="sourcePoint"\/>\s*<mxPoint x="([-0-9.]+)" y="([-0-9.]+)" as="targetPoint"\/>\s*<\/mxGeometry>\s*<\/mxCell>\n?/g,M=[],j;(j=H.exec(rr))!=null;){var gr=j[6];gr.indexOf(' source="')>=0||gr.indexOf(' target="')>=0||gr.indexOf('parent="1"')<0||M.push({all:j[0],id:j[1],value:j[3]||"",style:j[5]||"",rest:gr,sx:j[7],sy:j[8],tx:j[9],ty:j[10]})}if(M.length<2)return rr;function W(Yr,Zr){var Ee=new RegExp(Zr+"=([^;]*)").exec(Yr);return Ee!=null?Ee[1]:""}function d(Yr,Zr){return W(Yr.style,"strokeColor")===W(Zr.style,"strokeColor")&&W(Yr.style,"dashed")===W(Zr.style,"dashed")&&W(Yr.style,"dashPattern")===W(Zr.style,"dashPattern")}for(var _={},p=0;p<M.length;p++){var E=M[p].sx+","+M[p].sy;_[E]=_[E]===void 0?p:-1}for(var L={},N={},p=0;p<M.length;p++)if(!L[p]){for(var m=M[p],u=[m],R=m;W(R.style,"endArrow")==="none";){var o=_[R.tx+","+R.ty];if(o===void 0||o===-1||L[o]||o===p)break;var t=M[o];if(!d(R,t)||t.value!==""&&u.some(function(Zr){return Zr.value!==""}))break;u.push(t),L[o]=!0,R=t}if(!(u.length<2)){for(var n=null,f=0;f<u.length;f++)if(u[f].value!==""){n=u[f];break}var O=u[u.length-1].style;if(n!=null&&n!==u[u.length-1])for(var g=["fontSize","fontColor","labelBackgroundColor","verticalAlign"],Q=0;Q<g.length;Q++){var x=W(n.style,g[Q]);x!==""&&W(O,g[Q])===""&&(O+=g[Q]+"="+x+";")}for(var I="",f=0;f<u.length-1;f++)I+='<mxPoint x="'+u[f].tx+'" y="'+u[f].ty+'"/>';var w="";if(n!=null){for(var nr=0,lr=0,ir=0,f=0;f<u.length;f++){var mr=u[f],Or=Math.sqrt(Math.pow(mr.tx-mr.sx,2)+Math.pow(mr.ty-mr.sy,2));mr===n?ir=Or:ir===0&&(lr+=Or),nr+=Or}if(nr>0){var Qr=Math.round((2*(lr+ir/2)/nr-1)*1e3)/1e3;Qr!==0&&(w=' x="'+Qr+'"')}}var ee=u[u.length-1],re='<mxCell id="'+m.id+'" value="'+(n!=null?n.value:"")+'" style="'+O+`" edge="1" parent="1">
+</mxGraphModel>`;return p}return{themeDefaults:Ar,registerShape:Mr,createMxGraph:Yr,build:fe,buildXml:yC}})();var lc=(function(){function Ar(){return typeof mxCodec<"u"&&typeof mxUtils<"u"&&typeof Graph<"u"}function Z(Yr,fe){var Wr=Mr(Yr,fe);return Wr.xml}function Mr(Yr,fe){fe=fe||{};var Wr=Ai.parse(Yr,fe),Nr=rd.buildXml(Wr,fe),lr=Wr.config||fe,Y=Eo.collect(lr),Cr=(Nr.match(/<mxCell\b/g)||[]).length;if(Cr<=2){var V=Eo.typeLabel(Wr.type),U=Eo.statementCount(lr),H=lr._droppedLines||0,J="the "+V+" produced no shapes";U===0?J+=": the body has no statements":H>0?J+=": "+(H>=U?"none of":U-H+" of")+" its "+U+" statement line"+(U===1?"":"s")+(H>=U||U-H===1?" was":" were")+" understood (see the dropped-line warnings)":J+=" from its "+U+" statement line"+(U===1?"":"s")+"; nothing in them is drawn by this converter yet",Y.unshift({code:"empty-result",message:J,line:null})}for(var gr=[],X=0;X<Y.length;X++)gr.push(Eo.format(Y[X]));return{xml:Nr,type:Wr.type,layout:fe._layout||null,warnings:gr,diagnostics:Y}}return{convert:Z,convertWithMeta:Mr}})();var Cv=(function(){var Ar="group;transparentBounds=1;editIcon=1;lockedGroup=0;groupPadding=10;";function Z(V,U){Cr.lastWarnings=[],Cr.lastDiagnostics=[];var H=lc.convertWithMeta(V,U||{});return Cr.lastWarnings=H.warnings,Cr.lastDiagnostics=H.diagnostics,H}function Mr(V,U){return Z(V,U).xml}function Yr(V){return String(V).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\r/g,"&#13;").replace(/\n/g,"&#10;").replace(/\t/g,"&#9;")}var fe=0;function Wr(V){for(var U=/<mxCell id="([^"]*)"( value="([^"]*)")?( style="([^"]*)")([^>]*edge="1"[^>]*)>\s*<mxGeometry relative="1" as="geometry">\s*<mxPoint x="([-0-9.]+)" y="([-0-9.]+)" as="sourcePoint"\/>\s*<mxPoint x="([-0-9.]+)" y="([-0-9.]+)" as="targetPoint"\/>\s*<\/mxGeometry>\s*<\/mxCell>\n?/g,H=[],J;(J=U.exec(V))!=null;){var gr=J[6];gr.indexOf(' source="')>=0||gr.indexOf(' target="')>=0||gr.indexOf('parent="1"')<0||H.push({all:J[0],id:J[1],value:J[3]||"",style:J[5]||"",rest:gr,sx:J[7],sy:J[8],tx:J[9],ty:J[10]})}if(H.length<2)return V;function X(Ur,oe){var Ce=new RegExp(oe+"=([^;]*)").exec(Ur);return Ce!=null?Ce[1]:""}function g(Ur,oe){return X(Ur.style,"strokeColor")===X(oe.style,"strokeColor")&&X(Ur.style,"dashed")===X(oe.style,"dashed")&&X(Ur.style,"dashPattern")===X(oe.style,"dashPattern")}for(var M={},_=0;_<H.length;_++){var C=H[_].sx+","+H[_].sy;M[C]=M[C]===void 0?_:-1}for(var $={},y={},_=0;_<H.length;_++)if(!$[_]){for(var A=H[_],s=[A],k=A;X(k.style,"endArrow")==="none";){var o=M[k.tx+","+k.ty];if(o===void 0||o===-1||$[o]||o===_)break;var a=H[o];if(!g(k,a)||a.value!==""&&s.some(function(oe){return oe.value!==""}))break;s.push(a),$[o]=!0,k=a}if(!(s.length<2)){for(var t=null,n=0;n<s.length;n++)if(s[n].value!==""){t=s[n];break}var v=s[s.length-1].style;if(t!=null&&t!==s[s.length-1])for(var R=["fontSize","fontColor","labelBackgroundColor","verticalAlign"],Q=0;Q<R.length;Q++){var L=X(t.style,R[Q]);L!==""&&X(v,R[Q])===""&&(v+=R[Q]+"="+L+";")}for(var B="",n=0;n<s.length-1;n++)B+='<mxPoint x="'+s[n].tx+'" y="'+s[n].ty+'"/>';var w="";if(t!=null){for(var ar=0,sr=0,ir=0,n=0;n<s.length;n++){var _r=s[n],Sr=Math.sqrt(Math.pow(_r.tx-_r.sx,2)+Math.pow(_r.ty-_r.sy,2));_r===t?ir=Sr:ir===0&&(sr+=Sr),ar+=Sr}if(ar>0){var ae=Math.round((2*(sr+ir/2)/ar-1)*1e3)/1e3;ae!==0&&(w=' x="'+ae+'"')}}var se=s[s.length-1],re='<mxCell id="'+A.id+'" value="'+(t!=null?t.value:"")+'" style="'+v+`" edge="1" parent="1">
<mxGeometry relative="1"`+w+` as="geometry">
- <mxPoint x="`+m.sx+'" y="'+m.sy+`" as="sourcePoint"/>
- <mxPoint x="`+ee.tx+'" y="'+ee.ty+`" as="targetPoint"/>
- <Array as="points">`+I+`</Array>
+ <mxPoint x="`+A.sx+'" y="'+A.sy+`" as="sourcePoint"/>
+ <mxPoint x="`+se.tx+'" y="'+se.ty+`" as="targetPoint"/>
+ <Array as="points">`+B+`</Array>
</mxGeometry>
</mxCell>
-`;N[p]=re}}for(var p=0;p<M.length;p++)N[p]!=null?rr=rr.replace(M[p].all,N[p]):L[p]&&(rr=rr.replace(M[p].all,""));return rr}function Dr(rr){var H={},M=[],j=/<mxCell id="([^"]*)"(?: value="[^"]*")?(?: style="([^"]*)")?([^>]*)>\s*(?:<mxGeometry ([^>]*?)\/>|<mxGeometry ([^>]*?)>)/g,gr;function W(g,Q){var x=new RegExp(Q+'="([^"]*)"').exec(g);return x!=null?x[1]:null}for(;(gr=j.exec(rr))!=null;){var d=gr[3]||"",_=gr[4]!=null?gr[4]:gr[5]||"",p={id:gr[1],style:gr[2]||"",vertex:d.indexOf('vertex="1"')>=0,parent:W(d,"parent"),x:parseFloat(W(_,"x"))||0,y:parseFloat(W(_,"y"))||0,w:parseFloat(W(_,"width"))||0,h:parseFloat(W(_,"height"))||0};H[p.id]=p,M.push(p)}function E(g){for(var Q=g.x,x=g.y,I=H[g.parent],w=0;I!=null&&I.id!=="0"&&I.id!=="1"&&w++<20;)Q+=I.x,x+=I.y,I=H[I.parent];return{x:Q,y:x}}for(var L=[],N=0;N<M.length;N++){var m=M[N];if(!(!m.vertex||m.w<=0||m.h<=0||m.style.indexOf("text;")===0||m.style.indexOf("connectable=0")>=0||m.style.indexOf("line;")===0)){var u=E(m),R=m.style.indexOf("shape=umlLifeline")>=0,o=/(?:^|;)size=([0-9.]+)/.exec(m.style);L.push({id:m.id,x:u.x,y:u.y,w:m.w,h:m.h,style:m.style,lifeline:R,headSize:R&&o!=null?parseFloat(o[1]):m.h})}}var t=5;function n(g,Q){for(var x=null,I=t+1,w=1/0,nr=0;nr<L.length;nr++){var lr=L[nr];if(!(g<lr.x-t||g>lr.x+lr.w+t||Q<lr.y-t||Q>lr.y+lr.h+t)){if(lr.lifeline&&Q>lr.y+lr.headSize+t){var ir=Math.abs(g-(lr.x+lr.w/2));ir<=t&&(ir<I||ir===I&&lr.w*lr.h<w)&&(x=lr,I=ir,w=lr.w*lr.h);continue}var mr=lr.lifeline?lr.headSize:lr.h,Or=Math.max(lr.x-g,0,g-(lr.x+lr.w)),Qr=Math.max(lr.y-Q,0,Q-(lr.y+mr)),ee=Math.abs(g-lr.x),re=Math.abs(g-(lr.x+lr.w)),Yr=Math.abs(Q-lr.y),Zr=Math.abs(Q-(lr.y+mr)),Ee=g>=lr.x-t&&g<=lr.x+lr.w+t,Ze=Q>=lr.y-t&&Q<=lr.y+mr+t,eo=Math.min(Ze?ee:1/0,Ze?re:1/0,Ee?Yr:1/0,Ee?Zr:1/0);eo=Math.max(eo,Math.sqrt(Or*Or+Qr*Qr));var Gr=lr.w*lr.h;eo<=t&&(eo<I||eo===I&&Gr<w)&&(x=lr,I=eo,w=Gr)}}return x}function f(g){return Math.round(Math.max(0,Math.min(1,g))*1e3)/1e3}function O(g,Q,x,I){if(I==null)return!1;var w=g.style||"",nr=w.indexOf("ellipse")===0||w.indexOf("shape=endState")>=0;if(!nr&&(w.indexOf("shape=")>=0||w.indexOf("rhombus")===0))return!1;var lr=g.x+g.w/2,ir=g.y+g.h/2,mr=I.x-lr,Or=I.y-ir;if(mr===0&&Or===0)return!1;var Qr,ee;if(nr){var re=1/Math.sqrt(Math.pow(2*mr/g.w,2)+Math.pow(2*Or/g.h,2));Qr=lr+mr*re,ee=ir+Or*re}else{var Yr=mr!==0?g.w/2/Math.abs(mr):1/0,Zr=Or!==0?g.h/2/Math.abs(Or):1/0,Ee=Math.min(Yr,Zr);Qr=lr+mr*Ee,ee=ir+Or*Ee}return Math.abs(Qr-Q)<=2&&Math.abs(ee-x)<=2}return rr.replace(/<mxCell id="([^"]*)"( value="[^"]*")?( style="([^"]*)")([^>]*edge="1"[^>]*)>([\s\S]*?)<\/mxCell>/g,function(g,Q,x,I,w,nr,lr){if(nr.indexOf(' source="')>=0||nr.indexOf(' target="')>=0)return g;var ir=/<mxPoint x="([-0-9.]+)" y="([-0-9.]+)" as="sourcePoint"\/>/.exec(lr),mr=/<mxPoint x="([-0-9.]+)" y="([-0-9.]+)" as="targetPoint"\/>/.exec(lr);if(ir==null||mr==null)return g;for(var Or=/ parent="([^"]*)"/.exec(nr),Qr=Or!=null&&H[Or[1]]!=null?E({x:0,y:0,parent:Or[1]}):{x:0,y:0},ee=[],re=/<mxPoint x="([-0-9.]+)" y="([-0-9.]+)"\/>/g,Yr;(Yr=re.exec(lr))!=null;)ee.push({x:parseFloat(Yr[1])+Qr.x,y:parseFloat(Yr[2])+Qr.y});var Zr=parseFloat(ir[1])+Qr.x,Ee=parseFloat(ir[2])+Qr.y,Ze=parseFloat(mr[1])+Qr.x,eo=parseFloat(mr[2])+Qr.y,Gr=n(Zr,Ee),$e=n(Ze,eo);if(Gr==null&&$e==null)return g;var Ye="",Hr="";if(Gr!=null){Hr+=' source="'+Gr.id+'"';var Fo=ee.length>0?ee[0]:$e!=null?{x:$e.x+$e.w/2,y:$e.y+$e.h/2}:{x:Ze,y:eo};O(Gr,Zr,Ee,Fo)||(Ye+="exitX="+f((Zr-Gr.x)/Gr.w)+";exitY="+f((Ee-Gr.y)/Gr.h)+";exitDx=0;exitDy=0;")}if($e!=null&&!(Gr!=null&&$e.id===Gr.id)){Hr+=' target="'+$e.id+'"';var k=ee.length>0?ee[ee.length-1]:Gr!=null?{x:Gr.x+Gr.w/2,y:Gr.y+Gr.h/2}:{x:Zr,y:Ee};O($e,Ze,eo,k)||(Ye+="entryX="+f((Ze-$e.x)/$e.w)+";entryY="+f((eo-$e.y)/$e.h)+";entryDx=0;entryDy=0;")}return Hr===""?g:'<mxCell id="'+Q+'"'+(x||"")+' style="'+w+Ye+'"'+Hr+nr+">"+lr+"</mxCell>"})}function ar(rr){return rr.replace(/<mxCell id="([^"]*)"( value="([^"]*)")?( style="([^"]*)")([^>]*edge="1"[^>]*)>/g,function(H,M,j,gr,W,d,_){function p(R){return new RegExp("(?:^|;)"+R+"=").test(d)}function E(R){var o=new RegExp("(?:^|;)"+R+"=([^;]*)").exec(d);return o!=null?o[1]:null}var L="",N=E("endArrow"),m=E("startArrow");N==null&&(L+="endArrow=classic;",N="classic"),p("curved")||(L+="curved=0;"),p("rounded")||(L+="rounded=0;");var u=p("endSize")||p("startSize");return N!=="none"&&!p("endSize")&&(L+="endSize=6;",u=!0),m!=null&&m!=="none"&&!p("startSize")&&(L+="startSize=6;",u=!0),u||(L+="endSize=6;"),p("fontSize")||(L+="fontSize=11;"),!p("sourcePerimeterSpacing")&&!p("targetPerimeterSpacing")&&(L+="sourcePerimeterSpacing=0;targetPerimeterSpacing=0;"),L===""?H:(d!==""&&d.charAt(d.length-1)!==";"&&(d+=";"),'<mxCell id="'+M+'"'+(j||"")+' style="'+d+L+'"'+_+">")})}function Y(rr,H,M){if(rr==null||rr.indexOf("<mxCell")<0)return rr;rr=rr.replace(/<mxCell id="[^"]*" value="" style="text;fillColor=none;strokeColor=none;"[^>]*vertex="1"[^>]*>\s*<mxGeometry [^>]*width="0" height="0"[^>]*\/>\s*<\/mxCell>\n?/g,""),rr=Kr(rr),rr=Dr(rr),rr=ar(rr);var j="plantuml-"+ ++se,gr=!1,W=rr.replace(/<mxCell id="([^"]*)" value="([^"]*)" style="([^"]*)"([^>]*)>([\s\S]*?)<\/mxCell>/g,function(L,N,m,u,R,o){gr=!0;var t=R.replace(' parent="1"',' parent="'+j+'"');return'<UserObject label="'+m+'" plantUmlId="'+N+'" plantUmlBaseStyle="'+u+'" plantUmlBaseValue="'+m+'" id="'+N+'"><mxCell style="'+u+'"'+t+">"+o+"</mxCell></UserObject>"});if(!gr)return rr;var d=JSON.stringify({data:H,config:M||null},null,2),_='<UserObject label="" plantUmlData="'+Tr(d)+'" id="'+j+'"><mxCell style="'+pr+`" vertex="1" connectable="0" parent="1"><mxGeometry x="0" y="0" width="0" height="0" as="geometry"/></mxCell></UserObject>
-`,p='<mxCell id="1" parent="0"></mxCell>',E=W.indexOf(p);return E<0?rr:W.slice(0,E+p.length)+`
- `+_+W.slice(E+p.length)}var $r={groupStyle:pr,parseText:Xr,parseTextWithMeta:q,lastWarnings:[],lastDiagnostics:[],wrapGroup:Y};return $r})();var Gf=(function(){function pr(k,T){T=T||{};var D=zl.parse(k,T),S=of.buildXml(D,T);return q(S,T)}function q(k,T){T=T||{};var D=Xr(k);return Y(D),$r(D,T)}function Xr(k){for(var T=[],D=/<mxCell\b([^>]*?)(?:\/>|>([\s\S]*?)<\/mxCell>)/g,S;(S=D.exec(k))!==null;){var U=se(S[1]),P=S[2]||"",s=Tr(P);T.push({id:U.id||"",parent:U.parent||"",value:Dr(U.value||""),style:U.style||"",vertex:U.vertex==="1",edge:U.edge==="1",source:U.source||"",target:U.target||"",geometry:s,absX:0,absY:0})}return T}function Tr(k){var T=k.match(/<mxGeometry\b([^>]*)\/>/),D="";if(!T){if(T=k.match(/<mxGeometry\b([^>]*)>([\s\S]*?)<\/mxGeometry>/),!T)return null;D=T[2]}var S=se(T[1]),U={x:parseFloat(S.x)||0,y:parseFloat(S.y)||0,width:parseFloat(S.width)||0,height:parseFloat(S.height)||0,relative:S.relative==="1",offset:null,sourcePoint:null,targetPoint:null,points:null};if(D)for(var P=/<mxPoint\b([^>]*)\/>/g,s,$=/<Array\s+as="points">([\s\S]*?)<\/Array>/.exec(D),G=$?$[1]:"";(s=P.exec(D))!==null;){var B=se(s[1]),or={x:parseFloat(B.x)||0,y:parseFloat(B.y)||0};B.as==="sourcePoint"?U.sourcePoint=or:B.as==="targetPoint"?U.targetPoint=or:B.as==="offset"?U.offset=or:!B.as&&G.indexOf(s[0])>=0&&(U.points==null&&(U.points=[]),U.points.push(or))}return U}function se(k){for(var T={},D=/(\w[\w-]*)="([^"]*)"/g,S;(S=D.exec(k))!==null;)T[S[1]]=S[2];return T}function Kr(k){var T={};if(!k)return T;for(var D=k.split(";"),S=0;S<D.length;S++){var U=D[S].trim();if(U){var P=U.indexOf("=");P>0?T[U.slice(0,P).trim().toLowerCase()]=U.slice(P+1).trim():T.shape=U.toLowerCase()}}return T}function Dr(k){return String(k).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&apos;/g,"'").replace(/&#(\d+);/g,function(T,D){return String.fromCharCode(parseInt(D,10))}).replace(/&#x([0-9a-fA-F]+);/g,function(T,D){return String.fromCharCode(parseInt(D,16))}).replace(/&amp;/g,"&")}function ar(k){return String(k).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Y(k){var T={};k.forEach(function(U){T[U.id]=U});function D(U){if(!U.geometry)return{x:0,y:0};var P=U.geometry.x,s=U.geometry.y,$=T[U.parent],G=0;if(U.geometry.relative&&$&&$.edge){var B=S($,U.geometry.x,U.geometry.y),or=U.geometry.offset||{x:0,y:0};return{x:B.x+or.x,y:B.y+or.y}}for(;$&&$.geometry&&$.id!=="0"&&$.id!=="1"&&G<20;)P+=$.geometry.x,s+=$.geometry.y,$=T[$.parent],G++;return{x:P,y:s}}function S(U,P,s){var $=U.geometry,G=D({geometry:{x:0,y:0},parent:U.parent}),B=[];if($&&$.sourcePoint&&$.targetPoint)B.push($.sourcePoint),$.points&&(B=B.concat($.points)),B.push($.targetPoint);else{var or=T[U.source],K=T[U.target];if(!or||!K||!or.geometry||!K.geometry)return{x:G.x,y:G.y};var hr=D(or),vr=D(K);B.push({x:hr.x+or.geometry.width/2-G.x,y:hr.y+or.geometry.height/2-G.y}),B.push({x:vr.x+K.geometry.width/2-G.x,y:vr.y+K.geometry.height/2-G.y})}for(var Jr=[],Ge=0,no=1;no<B.length;no++){var bo=B[no].x-B[no-1].x,Oo=B[no].y-B[no-1].y,We=Math.sqrt(bo*bo+Oo*Oo);Jr.push(We),Ge+=We}for(var Tt=(P/2+.5)*Ge,Cn=0,un=0;Cn<Jr.length-1&&Tt>=un+Jr[Cn];)un+=Jr[Cn],Cn++;var Kt=Jr[Cn]||0,ut=Kt===0?0:(Tt-un)/Kt,fn=B[Cn],vt=B[Cn+1]||fn,_o=vt.x-fn.x,Zo=vt.y-fn.y,jt=Kt===0?0:Zo/Kt,zt=Kt===0?0:_o/Kt;return{x:G.x+fn.x+_o*ut+jt*(s||0),y:G.y+fn.y+Zo*ut-zt*(s||0)}}k.forEach(function(U){if(U.geometry){var P=D(U);U.absX=P.x,U.absY=P.y}})}function $r(k,T){var D=rr(k),S=7,U=S-D.x,P=S-D.y,s=Math.max(1,Math.ceil(D.w+S*2)),$=Math.max(1,Math.ceil(D.h+S*2)),G=[];G.push('<?xml version="1.0" encoding="UTF-8" standalone="no"?>'),G.push('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s+'" height="'+$+'" viewBox="0 0 '+s+" "+$+'" font-family="Helvetica, Arial, sans-serif">'),M={};var B=H(k),or=[];return B.forEach(function(K){if(K.edge){var hr=Ye(K,k,U,P);hr&&or.push(hr)}else K.geometry&&(K.vertex||K.value)&&or.push(gr(K,U,P))}),G.push(j()),G=G.concat(or),G.push("</svg>"),G.join(`
-`)}function rr(k){var T=1/0,D=1/0,S=-1/0,U=-1/0;return k.forEach(function(P){if(P.geometry){if(P.vertex){if(P.absX<T&&(T=P.absX),P.absY<D&&(D=P.absY),P.absX+P.geometry.width>S&&(S=P.absX+P.geometry.width),P.absY+P.geometry.height>U&&(U=P.absY+P.geometry.height),P.value){var s=Kr(P.style),$=(s.labelposition||"").toLowerCase();if($==="left"||$==="right"){var G=parseInt(s.fontsize||"12",10),B=0;String(P.value).replace(/<br\s*\/?>/gi,`
+`;y[_]=re}}for(var _=0;_<H.length;_++)y[_]!=null?V=V.replace(H[_].all,y[_]):$[_]&&(V=V.replace(H[_].all,""));return V}function Nr(V){var U={},H=[],J=/<mxCell id="([^"]*)"(?: value="[^"]*")?(?: style="([^"]*)")?([^>]*)>\s*(?:<mxGeometry ([^>]*?)\/>|<mxGeometry ([^>]*?)>)/g,gr;function X(R,Q){var L=new RegExp(Q+'="([^"]*)"').exec(R);return L!=null?L[1]:null}for(;(gr=J.exec(V))!=null;){var g=gr[3]||"",M=gr[4]!=null?gr[4]:gr[5]||"",_={id:gr[1],style:gr[2]||"",vertex:g.indexOf('vertex="1"')>=0,parent:X(g,"parent"),x:parseFloat(X(M,"x"))||0,y:parseFloat(X(M,"y"))||0,w:parseFloat(X(M,"width"))||0,h:parseFloat(X(M,"height"))||0};U[_.id]=_,H.push(_)}function C(R){for(var Q=R.x,L=R.y,B=U[R.parent],w=0;B!=null&&B.id!=="0"&&B.id!=="1"&&w++<20;)Q+=B.x,L+=B.y,B=U[B.parent];return{x:Q,y:L}}for(var $=[],y=0;y<H.length;y++){var A=H[y];if(!(!A.vertex||A.w<=0||A.h<=0||A.style.indexOf("text;")===0||A.style.indexOf("connectable=0")>=0||A.style.indexOf("line;")===0)){var s=C(A),k=A.style.indexOf("shape=umlLifeline")>=0,o=/(?:^|;)size=([0-9.]+)/.exec(A.style);$.push({id:A.id,x:s.x,y:s.y,w:A.w,h:A.h,style:A.style,lifeline:k,headSize:k&&o!=null?parseFloat(o[1]):A.h})}}var a=5;function t(R,Q){for(var L=null,B=a+1,w=1/0,ar=0;ar<$.length;ar++){var sr=$[ar];if(!(R<sr.x-a||R>sr.x+sr.w+a||Q<sr.y-a||Q>sr.y+sr.h+a)){if(sr.lifeline&&Q>sr.y+sr.headSize+a){var ir=Math.abs(R-(sr.x+sr.w/2));ir<=a&&(ir<B||ir===B&&sr.w*sr.h<w)&&(L=sr,B=ir,w=sr.w*sr.h);continue}var _r=sr.lifeline?sr.headSize:sr.h,Sr=Math.max(sr.x-R,0,R-(sr.x+sr.w)),ae=Math.max(sr.y-Q,0,Q-(sr.y+_r)),se=Math.abs(R-sr.x),re=Math.abs(R-(sr.x+sr.w)),Ur=Math.abs(Q-sr.y),oe=Math.abs(Q-(sr.y+_r)),Ce=R>=sr.x-a&&R<=sr.x+sr.w+a,Me=Q>=sr.y-a&&Q<=sr.y+_r+a,eo=Math.min(Me?se:1/0,Me?re:1/0,Ce?Ur:1/0,Ce?oe:1/0);eo=Math.max(eo,Math.sqrt(Sr*Sr+ae*ae));var Hr=sr.w*sr.h;eo<=a&&(eo<B||eo===B&&Hr<w)&&(L=sr,B=eo,w=Hr)}}return L}function n(R){return Math.round(Math.max(0,Math.min(1,R))*1e3)/1e3}function v(R,Q,L,B){if(B==null)return!1;var w=R.style||"",ar=w.indexOf("ellipse")===0||w.indexOf("shape=endState")>=0;if(!ar&&(w.indexOf("shape=")>=0||w.indexOf("rhombus")===0))return!1;var sr=R.x+R.w/2,ir=R.y+R.h/2,_r=B.x-sr,Sr=B.y-ir;if(_r===0&&Sr===0)return!1;var ae,se;if(ar){var re=1/Math.sqrt(Math.pow(2*_r/R.w,2)+Math.pow(2*Sr/R.h,2));ae=sr+_r*re,se=ir+Sr*re}else{var Ur=_r!==0?R.w/2/Math.abs(_r):1/0,oe=Sr!==0?R.h/2/Math.abs(Sr):1/0,Ce=Math.min(Ur,oe);ae=sr+_r*Ce,se=ir+Sr*Ce}return Math.abs(ae-Q)<=2&&Math.abs(se-L)<=2}return V.replace(/<mxCell id="([^"]*)"( value="[^"]*")?( style="([^"]*)")([^>]*edge="1"[^>]*)>([\s\S]*?)<\/mxCell>/g,function(R,Q,L,B,w,ar,sr){if(ar.indexOf(' source="')>=0||ar.indexOf(' target="')>=0)return R;var ir=/<mxPoint x="([-0-9.]+)" y="([-0-9.]+)" as="sourcePoint"\/>/.exec(sr),_r=/<mxPoint x="([-0-9.]+)" y="([-0-9.]+)" as="targetPoint"\/>/.exec(sr);if(ir==null||_r==null)return R;for(var Sr=/ parent="([^"]*)"/.exec(ar),ae=Sr!=null&&U[Sr[1]]!=null?C({x:0,y:0,parent:Sr[1]}):{x:0,y:0},se=[],re=/<mxPoint x="([-0-9.]+)" y="([-0-9.]+)"\/>/g,Ur;(Ur=re.exec(sr))!=null;)se.push({x:parseFloat(Ur[1])+ae.x,y:parseFloat(Ur[2])+ae.y});var oe=parseFloat(ir[1])+ae.x,Ce=parseFloat(ir[2])+ae.y,Me=parseFloat(_r[1])+ae.x,eo=parseFloat(_r[2])+ae.y,Hr=t(oe,Ce),Ne=t(Me,eo);if(Hr==null&&Ne==null)return R;var He="",Kr="";if(Hr!=null){Kr+=' source="'+Hr.id+'"';var Ue=se.length>0?se[0]:Ne!=null?{x:Ne.x+Ne.w/2,y:Ne.y+Ne.h/2}:{x:Me,y:eo};v(Hr,oe,Ce,Ue)||(He+="exitX="+n((oe-Hr.x)/Hr.w)+";exitY="+n((Ce-Hr.y)/Hr.h)+";exitDx=0;exitDy=0;")}if(Ne!=null&&!(Hr!=null&&Ne.id===Hr.id)){Kr+=' target="'+Ne.id+'"';var O=se.length>0?se[se.length-1]:Hr!=null?{x:Hr.x+Hr.w/2,y:Hr.y+Hr.h/2}:{x:oe,y:Ce};v(Ne,Me,eo,O)||(He+="entryX="+n((Me-Ne.x)/Ne.w)+";entryY="+n((eo-Ne.y)/Ne.h)+";entryDx=0;entryDy=0;")}return Kr===""?R:'<mxCell id="'+Q+'"'+(L||"")+' style="'+w+He+'"'+Kr+ar+">"+sr+"</mxCell>"})}function lr(V){return V.replace(/<mxCell id="([^"]*)"( value="([^"]*)")?( style="([^"]*)")([^>]*edge="1"[^>]*)>/g,function(U,H,J,gr,X,g,M){function _(k){return new RegExp("(?:^|;)"+k+"=").test(g)}function C(k){var o=new RegExp("(?:^|;)"+k+"=([^;]*)").exec(g);return o!=null?o[1]:null}var $="",y=C("endArrow"),A=C("startArrow");y==null&&($+="endArrow=classic;",y="classic"),_("curved")||($+="curved=0;"),_("rounded")||($+="rounded=0;");var s=_("endSize")||_("startSize");return y!=="none"&&!_("endSize")&&($+="endSize=6;",s=!0),A!=null&&A!=="none"&&!_("startSize")&&($+="startSize=6;",s=!0),s||($+="endSize=6;"),_("fontSize")||($+="fontSize=11;"),!_("sourcePerimeterSpacing")&&!_("targetPerimeterSpacing")&&($+="sourcePerimeterSpacing=0;targetPerimeterSpacing=0;"),$===""?U:(g!==""&&g.charAt(g.length-1)!==";"&&(g+=";"),'<mxCell id="'+H+'"'+(J||"")+' style="'+g+$+'"'+M+">")})}function Y(V,U,H){if(V==null||V.indexOf("<mxCell")<0)return V;V=V.replace(/<mxCell id="[^"]*" value="" style="text;fillColor=none;strokeColor=none;"[^>]*vertex="1"[^>]*>\s*<mxGeometry [^>]*width="0" height="0"[^>]*\/>\s*<\/mxCell>\n?/g,""),V=Wr(V),V=Nr(V),V=lr(V);var J="plantuml-"+ ++fe,gr=!1,X=V.replace(/<mxCell id="([^"]*)" value="([^"]*)" style="([^"]*)"([^>]*)>([\s\S]*?)<\/mxCell>/g,function($,y,A,s,k,o){gr=!0;var a=k.replace(' parent="1"',' parent="'+J+'"');return'<UserObject label="'+A+'" plantUmlId="'+y+'" plantUmlBaseStyle="'+s+'" plantUmlBaseValue="'+A+'" id="'+y+'"><mxCell style="'+s+'"'+a+">"+o+"</mxCell></UserObject>"});if(!gr)return V;var g=JSON.stringify({data:U,config:H||null},null,2),M='<UserObject label="" plantUmlData="'+Yr(g)+'" id="'+J+'"><mxCell style="'+Ar+`" vertex="1" connectable="0" parent="1"><mxGeometry x="0" y="0" width="0" height="0" as="geometry"/></mxCell></UserObject>
+`,_='<mxCell id="1" parent="0"></mxCell>',C=X.indexOf(_);return C<0?V:X.slice(0,C+_.length)+`
+ `+M+X.slice(C+_.length)}var Cr={groupStyle:Ar,parseText:Mr,parseTextWithMeta:Z,lastWarnings:[],lastDiagnostics:[],wrapGroup:Y};return Cr})();var bd=(function(){function Ar(O,T){T=T||{};var N=Ai.parse(O,T),D=rd.buildXml(N,T);return Z(D,T)}function Z(O,T){T=T||{};var N=Mr(O);return Y(N),Cr(N,T)}function Mr(O){for(var T=[],N=/<mxCell\b([^>]*?)(?:\/>|>([\s\S]*?)<\/mxCell>)/g,D;(D=N.exec(O))!==null;){var K=fe(D[1]),P=D[2]||"",u=Yr(P);T.push({id:K.id||"",parent:K.parent||"",value:Nr(K.value||""),style:K.style||"",vertex:K.vertex==="1",edge:K.edge==="1",source:K.source||"",target:K.target||"",geometry:u,absX:0,absY:0})}return T}function Yr(O){var T=O.match(/<mxGeometry\b([^>]*)\/>/),N="";if(!T){if(T=O.match(/<mxGeometry\b([^>]*)>([\s\S]*?)<\/mxGeometry>/),!T)return null;N=T[2]}var D=fe(T[1]),K={x:parseFloat(D.x)||0,y:parseFloat(D.y)||0,width:parseFloat(D.width)||0,height:parseFloat(D.height)||0,relative:D.relative==="1",offset:null,sourcePoint:null,targetPoint:null,points:null};if(N)for(var P=/<mxPoint\b([^>]*)\/>/g,u,m=/<Array\s+as="points">([\s\S]*?)<\/Array>/.exec(N),G=m?m[1]:"";(u=P.exec(N))!==null;){var I=fe(u[1]),er={x:parseFloat(I.x)||0,y:parseFloat(I.y)||0};I.as==="sourcePoint"?K.sourcePoint=er:I.as==="targetPoint"?K.targetPoint=er:I.as==="offset"?K.offset=er:!I.as&&G.indexOf(u[0])>=0&&(K.points==null&&(K.points=[]),K.points.push(er))}return K}function fe(O){for(var T={},N=/(\w[\w-]*)="([^"]*)"/g,D;(D=N.exec(O))!==null;)T[D[1]]=D[2];return T}function Wr(O){var T={};if(!O)return T;for(var N=O.split(";"),D=0;D<N.length;D++){var K=N[D].trim();if(K){var P=K.indexOf("=");P>0?T[K.slice(0,P).trim().toLowerCase()]=K.slice(P+1).trim():T.shape=K.toLowerCase()}}return T}function Nr(O){return String(O).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&apos;/g,"'").replace(/&#(\d+);/g,function(T,N){return String.fromCharCode(parseInt(N,10))}).replace(/&#x([0-9a-fA-F]+);/g,function(T,N){return String.fromCharCode(parseInt(N,16))}).replace(/&amp;/g,"&")}function lr(O){return String(O).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Y(O){var T={};O.forEach(function(K){T[K.id]=K});function N(K){if(!K.geometry)return{x:0,y:0};var P=K.geometry.x,u=K.geometry.y,m=T[K.parent],G=0;if(K.geometry.relative&&m&&m.edge){var I=D(m,K.geometry.x,K.geometry.y),er=K.geometry.offset||{x:0,y:0};return{x:I.x+er.x,y:I.y+er.y}}for(;m&&m.geometry&&m.id!=="0"&&m.id!=="1"&&G<20;)P+=m.geometry.x,u+=m.geometry.y,m=T[m.parent],G++;return{x:P,y:u}}function D(K,P,u){var m=K.geometry,G=N({geometry:{x:0,y:0},parent:K.parent}),I=[];if(m&&m.sourcePoint&&m.targetPoint)I.push(m.sourcePoint),m.points&&(I=I.concat(m.points)),I.push(m.targetPoint);else{var er=T[K.source],z=T[K.target];if(!er||!z||!er.geometry||!z.geometry)return{x:G.x,y:G.y};var hr=N(er),mr=N(z);I.push({x:hr.x+er.geometry.width/2-G.x,y:hr.y+er.geometry.height/2-G.y}),I.push({x:mr.x+z.geometry.width/2-G.x,y:mr.y+z.geometry.height/2-G.y})}for(var ne=[],ye=0,Je=1;Je<I.length;Je++){var _o=I[Je].x-I[Je-1].x,Oo=I[Je].y-I[Je-1].y,qe=Math.sqrt(_o*_o+Oo*Oo);ne.push(qe),ye+=qe}for(var St=(P/2+.5)*ye,ht=0,nn=0;ht<ne.length-1&&St>=nn+ne[ht];)nn+=ne[ht],ht++;var Tt=ne[ht]||0,Lo=Tt===0?0:(St-nn)/Tt,Qt=I[ht],pt=I[ht+1]||Qt,So=pt.x-Qt.x,it=pt.y-Qt.y,qt=Tt===0?0:it/Tt,Pt=Tt===0?0:So/Tt;return{x:G.x+Qt.x+So*Lo+qt*(u||0),y:G.y+Qt.y+it*Lo-Pt*(u||0)}}O.forEach(function(K){if(K.geometry){var P=N(K);K.absX=P.x,K.absY=P.y}})}function Cr(O,T){var N=V(O),D=7,K=D-N.x,P=D-N.y,u=Math.max(1,Math.ceil(N.w+D*2)),m=Math.max(1,Math.ceil(N.h+D*2)),G=[];G.push('<?xml version="1.0" encoding="UTF-8" standalone="no"?>'),G.push('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+u+'" height="'+m+'" viewBox="0 0 '+u+" "+m+'" font-family="Helvetica, Arial, sans-serif">'),H={};var I=U(O),er=[];return I.forEach(function(z){if(z.edge){var hr=He(z,O,K,P);hr&&er.push(hr)}else z.geometry&&(z.vertex||z.value)&&er.push(gr(z,K,P))}),G.push(J()),G=G.concat(er),G.push("</svg>"),G.join(`
+`)}function V(O){var T=1/0,N=1/0,D=-1/0,K=-1/0;return O.forEach(function(P){if(P.geometry){if(P.vertex){if(P.absX<T&&(T=P.absX),P.absY<N&&(N=P.absY),P.absX+P.geometry.width>D&&(D=P.absX+P.geometry.width),P.absY+P.geometry.height>K&&(K=P.absY+P.geometry.height),P.value){var u=Wr(P.style),m=(u.labelposition||"").toLowerCase();if(m==="left"||m==="right"){var G=parseInt(u.fontsize||"12",10),I=0;String(P.value).replace(/<br\s*\/?>/gi,`
`).replace(/<[^>]+>/g,"").split(`
-`).forEach(function(Oo){var We=Zr(Oo,G,!1);We>B&&(B=We)}),$==="left"&&P.absX-B-8<T&&(T=P.absX-B-8),$==="right"&&P.absX+P.geometry.width+B+8>S&&(S=P.absX+P.geometry.width+B+8)}}}else if(P.edge){var or=P.geometry.sourcePoint,K=P.geometry.targetPoint,hr=[or,K];if(P.geometry.points&&(hr=hr.concat(P.geometry.points)),hr.forEach(function(Oo){Oo&&(Oo.x<T&&(T=Oo.x),Oo.y<D&&(D=Oo.y),Oo.x>S&&(S=Oo.x),Oo.y>U&&(U=Oo.y))}),P.value&&or&&K){var vr=Kr(P.style),Jr=parseInt(vr.fontsize||"12",10),Ge=P.geometry.x?(P.geometry.x+1)/2:.5,no=or.x+(K.x-or.x)*Ge,bo=0;String(P.value).replace(/<br\s*\/?>/gi,`
+`).forEach(function(Oo){var qe=oe(Oo,G,!1);qe>I&&(I=qe)}),m==="left"&&P.absX-I-8<T&&(T=P.absX-I-8),m==="right"&&P.absX+P.geometry.width+I+8>D&&(D=P.absX+P.geometry.width+I+8)}}}else if(P.edge){var er=P.geometry.sourcePoint,z=P.geometry.targetPoint,hr=[er,z];if(P.geometry.points&&(hr=hr.concat(P.geometry.points)),hr.forEach(function(Oo){Oo&&(Oo.x<T&&(T=Oo.x),Oo.y<N&&(N=Oo.y),Oo.x>D&&(D=Oo.x),Oo.y>K&&(K=Oo.y))}),P.value&&er&&z){var mr=Wr(P.style),ne=parseInt(mr.fontsize||"12",10),ye=P.geometry.x?(P.geometry.x+1)/2:.5,Je=er.x+(z.x-er.x)*ye,_o=0;String(P.value).replace(/<br\s*\/?>/gi,`
`).replace(/<[^>]+>/g,"").split(`
-`).forEach(function(Oo){var We=Zr(Oo,Jr,!1);We>bo&&(bo=We)}),no-bo/2<T&&(T=no-bo/2),no+bo/2>S&&(S=no+bo/2)}}}}),T===1/0?{x:0,y:0,w:100,h:60}:{x:T,y:D,w:S-T,h:U-D}}function H(k){var T={},D={},S=[],U=[];k.forEach(function($){T[$.id]=$}),k.forEach(function($){$.parent!=null&&T[$.parent]?(D[$.parent]=D[$.parent]||[]).push($):S.push($)});function P($,G){if(!(G>20)){U.push($);for(var B=D[$.id]||[],or=0;or<B.length;or++)P(B[or],G+1)}}for(var s=0;s<S.length;s++)P(S[s],0);return U}var M={};function j(){var k=["<defs>"];for(var T in M)if(M.hasOwnProperty(T)){var D=M[T],S=D.color,U,P=11,s=10,$=9,G=4;switch(D.shape){case"halfcircle":s=16,G=8,U='<path d="M9,0 A8,8 0 0 0 9,16" fill="none" stroke="'+S+'"/>';break;case"classic":U='<path d="M0,0 L10,4 L0,8 L4,4 z" fill="'+S+'"/>';break;case"open":U='<path d="M0,0 L10,4 L0,8" fill="none" stroke="'+S+'"/>';break;case"blockfilled":U='<path d="M0,0 L10,4 L0,8 z" fill="'+S+'"/>';break;case"blockhollow":U='<path d="M0.5,0.5 L9.5,4 L0.5,7.5 z" fill="#FFFFFF" stroke="'+S+'"/>';break;case"diamondfilled":P=14,$=12,U='<path d="M0,4 L6,0 L12,4 L6,8 z" fill="'+S+'"/>';break;case"diamondhollow":P=14,$=12,U='<path d="M0.5,4 L6,0.5 L11.5,4 L6,7.5 z" fill="#FFFFFF" stroke="'+S+'"/>';break;case"oval":P=10,$=5,G=5,U='<circle cx="5" cy="5" r="4.5" fill="'+S+'"/>';break;case"cross":P=10,$=8,U='<path d="M1,0.5 L8,7.5 M1,7.5 L8,0.5" fill="none" stroke="'+S+'" stroke-width="1.5"/>';break;case"halftop":U='<path d="M0,0 L10,4 L0,4 z" fill="'+S+'"/>';break;case"halfbottom":U='<path d="M0,4 L10,4 L0,8 z" fill="'+S+'"/>';break;case"erone":P=12,$=10,U='<path d="M5,0 L5,8" fill="none" stroke="'+S+'"/>';break;case"ermandone":P=12,$=10,U='<path d="M3,0 L3,8 M7,0 L7,8" fill="none" stroke="'+S+'"/>';break;case"ermany":P=12,$=10,U='<path d="M0,4 L10,0 M0,4 L10,8 M0,4 L10,4" fill="none" stroke="'+S+'"/>';break;case"eronetomany":P=16,$=14,U='<path d="M2,0 L2,8 M4,4 L14,0 M4,4 L14,8 M4,4 L14,4" fill="none" stroke="'+S+'"/>';break;case"erzerotoone":P=16,$=14,U='<circle cx="4" cy="4" r="3" fill="#FFFFFF" stroke="'+S+'"/><path d="M10,0 L10,8" fill="none" stroke="'+S+'"/>';break;case"erzerotomany":P=18,$=16,U='<circle cx="4" cy="4" r="3" fill="#FFFFFF" stroke="'+S+'"/><path d="M8,4 L17,0 M8,4 L17,8 M8,4 L17,4" fill="none" stroke="'+S+'"/>';break;default:U='<path d="M0,0 L10,4 L0,8 L4,4 z" fill="'+S+'"/>'}D.scale&&D.scale!==1&&(U='<g transform="scale('+D.scale+')">'+U+"</g>",P=P*D.scale,$=$*D.scale,G=G*D.scale),D.start&&(U='<g transform="translate('+P+',0) scale(-1,1)">'+U+"</g>",$=P-$),k.push('<marker id="'+D.id+'" markerWidth="'+P+'" markerHeight="'+s*(D.scale||1)+'" refX="'+$+'" refY="'+G+'" orient="auto" markerUnits="userSpaceOnUse">'+U+"</marker>")}return k.push("</defs>"),k.join("")}function gr(k,T,D){var S=Kr(k.style),U=(S.shape||"rectangle").toLowerCase(),P=k.absX+T,s=k.absY+D,$=k.geometry.width,G=k.geometry.height,B=W(S),or=S.strokecolor||"#000000",K=S.strokewidth||"1",hr=S.dashed==="1",vr="";switch(U){case"ellipse":vr=E(P,s,$,G,B,or,K,hr);break;case"umlactor":vr=L(P,s,$,G,B,or);break;case"swimlane":vr=N(P,s,$,G,B,or,S);break;case"umlframe":vr=m(P,s,$,G,B,or,K,S);break;case"note":vr=u(P,s,$,G,B,or);break;case"hexagon":vr=t(R(P,s,$,G),B,or,K,hr);break;case"triangle":{var Jr=(S.direction||"east").toLowerCase(),Ge;Jr==="north"?Ge=[[P+$/2,s],[P+$,s+G],[P,s+G]]:Jr==="south"?Ge=[[P,s],[P+$,s],[P+$/2,s+G]]:Jr==="west"?Ge=[[P+$,s],[P+$,s+G],[P,s+G/2]]:Ge=[[P,s],[P+$,s+G/2],[P,s+G]],vr=t(Ge,B,or,K,hr);break}case"umllifeline":{var no=Math.max(0,Math.min(G,parseFloat(S.size)||40)),bo=S.lifelinemirror==="1",Oo=S.participant!=null,We=bo?s+G-no:s+G,Tt=Oo?"":p(P,s,$,no,B,or,K,S);s+no<We&&(Tt+='<line x1="'+(P+$/2)+'" y1="'+(s+no)+'" x2="'+(P+$/2)+'" y2="'+We+'" stroke="'+or+'" stroke-width="'+K+'" stroke-dasharray="5 5"/>'),bo&&!Oo&&(Tt+=p(P,s+G-no,$,no,B,or,K,S)),vr=Tt;break}case"table":vr=p(P,s,$,G,B,or,K,S);break;case"tablerow":{var Cn="";B!=="none"&&(Cn+='<rect x="'+P+'" y="'+s+'" width="'+$+'" height="'+G+'" fill="'+B+'" stroke="none"/>'),k.geometry.y>0&&(Cn+='<line x1="'+P+'" y1="'+s+'" x2="'+(P+$)+'" y2="'+s+'" stroke="'+or+'" stroke-width="1"/>'),vr=Cn;break}case"partialrectangle":{for(var un=B!=="none"?'<rect x="'+P+'" y="'+s+'" width="'+$+'" height="'+G+'" fill="'+B+'" stroke="none"/>':"",Kt=[["top",P,s,P+$,s],["bottom",P,s+G,P+$,s+G],["left",P,s,P,s+G],["right",P+$,s,P+$,s+G]],ut=0;ut<Kt.length;ut++)S[Kt[ut][0]]!=="0"&&S[Kt[ut][0]]!=null&&(un+='<line x1="'+Kt[ut][1]+'" y1="'+Kt[ut][2]+'" x2="'+Kt[ut][3]+'" y2="'+Kt[ut][4]+'" stroke="'+or+'" stroke-width="'+K+'"/>');vr=un;break}case"rhombus":vr=t([[P+$/2,s],[P+$,s+G/2],[P+$/2,s+G],[P,s+G/2]],B,or,K,hr);break;case"cylinder":vr=n(P,s,$,G,B,or,Math.min(40,G/5));break;case"cloud":case"mxgraph.basic.cloud_rect":vr=I(P,s,$,G,B,or);break;case"cube":vr=f(P,s,$,G,B,or,K);break;case"umlboundary":vr=O(P,s,$,G,B,or);break;case"umlcontrol":vr=g(P,s,$,G,B,or);break;case"umlentity":vr=Q(P,s,$,G,B,or);break;case"cylinder3":vr=S.direction==="east"?x(P,s,$,G,B,or,Math.min($/2,parseFloat(S.size)||15)):n(P,s,$,G,B,or,Math.min(G/2,parseFloat(S.size)||15));break;case"endstate":vr=w(P,s,$,G,or);break;case"doublecircle":vr=nr(P,s,$,G,B,or);break;case"component":vr=lr(P,s,$,G,B,or);break;case"card":vr=Or(P,s,$,G,B,or);break;case"mxgraph.archimate3.application":vr=ir(P,s,$,G,B,or,K,S);break;case"folder":vr=mr(P,s,$,G,B,or,K,S);break;case"process":vr=t(o(P,s,$,G),B,or,K,hr);break;case"queue":vr=Qr(P,s,$,G,B,or);break;case"cross":vr=ee(P,s,$,G,or);break;case"line":vr=re(P,s,$,G,or,K);break;case"text":vr=B!=="none"||S.strokecolor&&S.strokecolor!=="none"?p(P,s,$,G,B,S.strokecolor&&S.strokecolor!=="none"?S.strokecolor:"none",K,S):"";break;case"rectangle":default:vr=p(P,s,$,G,B,or,K,S);break}var fn=U==="umllifeline"?Math.max(0,Math.min(G,parseFloat(S.size)||40)):G,vt=Ze(k.value,P,s,$,fn,S,U);return U==="umllifeline"&&S.lifelinemirror==="1"&&(vt+=Ze(k.value,P,s+G-fn,$,fn,S,U)),vr+(vt?`
-`+vt:"")}function W(k){var T=k.fillcolor;return!T||T==="none"?"none":T}function d(k){var T="";for(var D in k)k[D]!==""&&k[D]!==null&&k[D]!==void 0&&(T+=" "+D+'="'+k[D]+'"');return T}function _(k,T){if(!k)return"";var D=T?String(T).replace(/\s+/g,","):"5,5";return' stroke-dasharray="'+D+'"'}function p(k,T,D,S,U,P,s,$){var G=0;$.rounded==="1"&&(G=$.absolutearcsize==="1"&&$.arcsize?parseFloat($.arcsize)/2:$.arcsize?Math.min(D,S)*parseFloat($.arcsize)/100:10);var B=$.dashed==="1";return'<rect x="'+k+'" y="'+T+'" width="'+D+'" height="'+S+'" rx="'+G+'" ry="'+G+'" fill="'+U+'" stroke="'+P+'" stroke-width="'+s+'"'+_(B,$.dashpattern)+"/>"}function E(k,T,D,S,U,P,s,$){var G=k+D/2,B=T+S/2,or=D/2,K=S/2;return'<ellipse cx="'+G+'" cy="'+B+'" rx="'+or+'" ry="'+K+'" fill="'+U+'" stroke="'+P+'" stroke-width="'+s+'"'+_($)+"/>"}function L(k,T,D,S,U,P){var s=k+D/2,$=Math.min(8,Math.min(D,S)*.2),G=T+$+2,B=G+$,or=T+S*.7,K=B+(or-B)*.2,hr=k+D*.15,vr=k+D*.85,Jr=k+D*.28,Ge=k+D*.72,no=T+S-2,bo=U==="none"?"#FFFFFF":U;return'<ellipse cx="'+s+'" cy="'+G+'" rx="'+$+'" ry="'+$+'" fill="'+bo+'" stroke="'+P+'" stroke-width="1"/><path d="M'+s+","+B+" L"+s+","+or+" M"+hr+","+K+" L"+vr+","+K+" M"+s+","+or+" L"+Jr+","+no+" M"+s+","+or+" L"+Ge+","+no+'" fill="none" stroke="'+P+'" stroke-width="1"/>'}function N(k,T,D,S,U,P,s){var $=parseFloat(s.startsize)||20,G=U==="none"?"#FFFFFF":U,B=s.swimlanefillcolor?s.swimlanefillcolor==="none"?"#FFFFFF":s.swimlanefillcolor:G,or=s.rounded==="0"?0:s.absolutearcsize==="1"&&s.arcsize?parseFloat(s.arcsize)/2:2.5,K=_(s.dashed==="1",s.dashpattern),hr="";return B!==G&&$>0&&(hr='<path d="M'+k+","+(T+$)+" L"+k+","+(T+or)+" Q"+k+","+T+" "+(k+or)+","+T+" L"+(k+D-or)+","+T+" Q"+(k+D)+","+T+" "+(k+D)+","+(T+or)+" L"+(k+D)+","+(T+$)+' Z" fill="'+G+'" stroke="none"/>'),'<g><rect x="'+k+'" y="'+T+'" width="'+D+'" height="'+S+'" rx="'+or+'" ry="'+or+'" fill="'+B+'" stroke="none"/>'+hr+'<rect x="'+k+'" y="'+T+'" width="'+D+'" height="'+S+'" rx="'+or+'" ry="'+or+'" fill="none" stroke="'+P+'"'+K+'/><line x1="'+k+'" y1="'+(T+$)+'" x2="'+(k+D)+'" y2="'+(T+$)+'" stroke="'+P+'"'+K+"/></g>"}function m(k,T,D,S,U,P,s,$){var G=10,B=Math.min(D,Math.max(G,parseFloat($.width)||60)),or=Math.min(S,Math.max(G*1.5,parseFloat($.height)||30)),K=$.swimlanefillcolor;return'<rect x="'+k+'" y="'+T+'" width="'+D+'" height="'+S+'" fill="'+(K&&K!=="none"?K:"none")+'" stroke="'+P+'" stroke-width="'+s+'"/><path d="M'+k+","+T+" L"+(k+B)+","+T+" L"+(k+B)+","+(T+Math.max(0,or-G*1.5))+" L"+(k+Math.max(0,B-G))+","+(T+or)+" L"+k+","+(T+or)+' Z" fill="none" stroke="'+P+'" stroke-width="'+s+'"/>'}function u(k,T,D,S,U,P){var s=Math.min(14,Math.min(D,S)*.2),$="M"+k+","+T+" L"+(k+D-s)+","+T+" L"+(k+D)+","+(T+s)+" L"+(k+D)+","+(T+S)+" L"+k+","+(T+S)+" Z",G="M"+(k+D-s)+","+T+" L"+(k+D-s)+","+(T+s)+" L"+(k+D)+","+(T+s);return'<path d="'+$+'" fill="'+U+'" stroke="'+P+'" stroke-width="1"/><g fill="none" stroke="'+P+'" stroke-width="1"><path d="'+G+'"/></g>'}function R(k,T,D,S){var U=Math.min(D*.2,S*.5);return[[k+U,T],[k+D-U,T],[k+D,T+S/2],[k+D-U,T+S],[k+U,T+S],[k,T+S/2]]}function o(k,T,D,S){var U=Math.min(D*.15,20);return[[k,T],[k+D,T],[k+D-U,T+S/2],[k+D,T+S],[k,T+S],[k+U,T+S/2]]}function t(k,T,D,S,U){var P=k.map(function(s){return s[0]+","+s[1]}).join(" ");return'<polygon points="'+P+'" fill="'+T+'" stroke="'+D+'" stroke-width="'+S+'"'+_(U)+"/>"}function n(k,T,D,S,U,P,s){s>0||(s=Math.min(S*.1,12));var $=D/2,G='<path d="M'+k+","+(T+s)+" L"+k+","+(T+S-s)+" A"+$+","+s+" 0 0 0 "+(k+D)+","+(T+S-s)+" L"+(k+D)+","+(T+s)+" A"+$+","+s+" 0 0 0 "+k+","+(T+s)+' Z" fill="'+U+'" stroke="'+P+'"/>',B='<path d="M'+k+","+(T+s)+" A"+$+","+s+" 0 0 0 "+(k+D)+","+(T+s)+'" fill="none" stroke="'+P+'"/>';return"<g>"+G+B+"</g>"}function f(k,T,D,S,U,P,s){var $=Math.min(10,Math.min(D,S)/5),G="M"+k+","+(T+$)+" L"+(k+$)+","+T+" L"+(k+D)+","+T+" L"+(k+D)+","+(T+S-$)+" L"+(k+D-$)+","+(T+S)+" L"+k+","+(T+S)+" Z";function B(or,K,hr,vr){return'<line x1="'+or+'" y1="'+K+'" x2="'+hr+'" y2="'+vr+'" stroke="'+P+'" stroke-width="'+s+'"/>'}return'<path d="'+G+'" fill="'+U+'" stroke="'+P+'" stroke-width="'+s+'"/>'+B(k,T+$,k+D-$,T+$)+B(k+D-$,T+$,k+D,T)+B(k+D-$,T+$,k+D-$,T+S)}function O(k,T,D,S,U,P){var s=S/2,$=k+D-s,G=T+s;return'<g stroke="'+P+'" fill="none"><circle cx="'+$+'" cy="'+G+'" r="'+s+'" fill="'+U+'"/><line x1="'+k+'" y1="'+(T+S*.15)+'" x2="'+k+'" y2="'+(T+S*.85)+'"/><line x1="'+k+'" y1="'+G+'" x2="'+($-s)+'" y2="'+G+'"/></g>'}function g(k,T,D,S,U,P){var s=k+D/2,$=S/2-2,G=T+2+$;return'<g stroke="'+P+'" fill="none"><circle cx="'+s+'" cy="'+G+'" r="'+$+'" fill="'+U+'"/><path d="M'+(s+6)+","+(T-2)+" L"+s+","+(T+2)+" L"+(s+6)+","+(T+6)+'"/></g>'}function Q(k,T,D,S,U,P){var s=k+D/2,$=(S-4)/2;return'<g stroke="'+P+'"><circle cx="'+s+'" cy="'+(T+$)+'" r="'+$+'" fill="'+U+'"/><line x1="'+(s-$)+'" y1="'+(T+S)+'" x2="'+(s+$)+'" y2="'+(T+S)+'"/></g>'}function x(k,T,D,S,U,P,s){s>0||(s=Math.min(D*.15,10));var $=S/2,G='<path d="M'+(k+s)+","+T+" L"+(k+D-s)+","+T+" A"+s+","+$+" 0 0 1 "+(k+D-s)+","+(T+S)+" L"+(k+s)+","+(T+S)+" A"+s+","+$+" 0 0 1 "+(k+s)+","+T+' Z" fill="'+U+'" stroke="'+P+'"/>',B='<path d="M'+(k+D-s)+","+T+" A"+s+","+$+" 0 0 0 "+(k+D-s)+","+(T+S)+'" fill="none" stroke="'+P+'"/>';return"<g>"+G+B+"</g>"}function I(k,T,D,S,U,P){if(D>110||S>95){let We=function(Tt,Cn,un,Kt,ut,fn){for(var vt=un-Tt,_o=Kt-Cn,Zo=Math.sqrt(vt*vt+_o*_o),jt=Math.max(1,Math.round(Zo/$)),zt=0;zt<jt;zt++)s.push({x:Tt+vt*zt/jt,y:Cn+_o*zt/jt,nx:ut,ny:fn})};var s=[],$=26,G=9;We(k,T,k+D,T,0,-1),We(k+D,T,k+D,T+S,1,0),We(k+D,T+S,k,T+S,0,1),We(k,T+S,k,T,-1,0);for(var B=function(Tt){return Math.round(Tt*10)/10},or="M"+B(s[0].x)+","+B(s[0].y),K=1;K<=s.length;K++){var hr=s[K-1],vr=s[K%s.length],Jr=(hr.x+vr.x)/2+hr.nx*G,Ge=(hr.y+vr.y)/2+hr.ny*G;or+=" Q"+B(Jr)+","+B(Ge)+" "+B(vr.x)+","+B(vr.y)}return'<path d="'+or+' Z" fill="'+U+'" stroke="'+P+'"/>'}var no=k+D/2,bo=T+S/2,Oo="M"+(k+D*.2)+","+(T+S*.55)+" C"+(k+D*0)+","+(T+S*.3)+" "+(k+D*.2)+","+(T+S*.1)+" "+(k+D*.35)+","+(T+S*.2)+" C"+(k+D*.4)+","+(T+S*0)+" "+(k+D*.65)+","+(T+S*0)+" "+(k+D*.7)+","+(T+S*.2)+" C"+(k+D*.9)+","+(T+S*.1)+" "+(k+D*1)+","+(T+S*.5)+" "+(k+D*.8)+","+(T+S*.6)+" C"+(k+D*.95)+","+(T+S*.85)+" "+(k+D*.7)+","+(T+S*1)+" "+(k+D*.55)+","+(T+S*.85)+" C"+(k+D*.4)+","+(T+S*1)+" "+(k+D*.1)+","+(T+S*.95)+" "+(k+D*.2)+","+(T+S*.55)+" Z";return'<path d="'+Oo+'" fill="'+U+'" stroke="'+P+'"/>'}function w(k,T,D,S,U){var P=k+D/2,s=T+S/2,$=Math.min(D,S)/2,G=$*.5;return'<g><circle cx="'+P+'" cy="'+s+'" r="'+$+'" fill="#FFFFFF" stroke="'+U+'"/><circle cx="'+P+'" cy="'+s+'" r="'+G+'" fill="'+U+'" stroke="none"/></g>'}function nr(k,T,D,S,U,P){var s=k+D/2,$=T+S/2,G=Math.min(D,S)/2,B=G-4;return'<g><circle cx="'+s+'" cy="'+$+'" r="'+G+'" fill="'+U+'" stroke="'+P+'"/><circle cx="'+s+'" cy="'+$+'" r="'+B+'" fill="none" stroke="'+P+'"/></g>'}function lr(k,T,D,S,U,P){var s=12,$=10,G=T+S*.25-$/2,B=T+S*.75-$/2,or=U==="none"?"#FFFFFF":U;return'<g><rect x="'+k+'" y="'+T+'" width="'+D+'" height="'+S+'" fill="'+or+'" stroke="'+P+'"/><rect x="'+(k-s/2)+'" y="'+G+'" width="'+s+'" height="'+$+'" fill="'+or+'" stroke="'+P+'"/><rect x="'+(k-s/2)+'" y="'+B+'" width="'+s+'" height="'+$+'" fill="'+or+'" stroke="'+P+'"/></g>'}function ir(k,T,D,S,U,P,s,$){var G=$.architype||"square",B=$.dashed==="1",or;if(G==="oct"){var K=Math.min(12,D/4,S/4);or=t([[k+K,T],[k+D-K,T],[k+D,T+K],[k+D,T+S-K],[k+D-K,T+S],[k+K,T+S],[k,T+S-K],[k,T+K]],U,P,s,B)}else{var hr=G==="rounded"?12.5:.5;or='<rect x="'+k+'" y="'+T+'" width="'+D+'" height="'+S+'" rx="'+hr+'" ry="'+hr+'" fill="'+U+'" stroke="'+P+'" stroke-width="'+s+'"'+_(B)+"/>"}var vr="";if($.apptype&&$.apptype!=="generic"){var Jr=k+D-24,Ge=T+7;vr='<path d="M'+Jr+","+Ge+" h14 v10 h-14 Z M"+(Jr+1)+","+(Ge+1)+' h12 v8 h-12 Z" fill="#000000" fill-rule="evenodd" stroke="none"/>'}return or+vr}function mr(k,T,D,S,U,P,s,$){var G=Math.min(D,parseFloat($.tabwidth)||50),B=Math.min(S,parseFloat($.tabheight)||15),or=U,K=_($.dashed==="1",$.dashpattern),hr="M"+k+","+T+" L"+(k+G-7)+","+T+" L"+(k+G)+","+(T+B)+" L"+(k+D)+","+(T+B)+" L"+(k+D)+","+(T+S)+" L"+k+","+(T+S)+" Z";return'<path d="'+hr+'" fill="'+or+'" stroke="'+P+'" stroke-width="'+s+'"'+K+'/><line x1="'+k+'" y1="'+(T+B)+'" x2="'+(k+G)+'" y2="'+(T+B)+'" stroke="'+P+'" stroke-width="'+s+'"'+K+"/>"}function Or(k,T,D,S,U,P){var s=Math.min(D,S)*.15,$="M"+(k+s)+","+T+" L"+(k+D)+","+T+" L"+(k+D)+","+(T+S)+" L"+k+","+(T+S)+" L"+k+","+(T+s)+" Z";return'<path d="'+$+'" fill="'+U+'" stroke="'+P+'"/>'}function Qr(k,T,D,S,U,P){var s=Math.min(D*.1,14);return'<g><rect x="'+k+'" y="'+T+'" width="'+D+'" height="'+S+'" fill="'+U+'" stroke="'+P+'"/><line x1="'+(k+D-s)+'" y1="'+T+'" x2="'+(k+D-s)+'" y2="'+(T+S)+'" stroke="'+P+'"/></g>'}function ee(k,T,D,S,U){var P=k+D/2,s=T+S/2,$=Math.min(D,S)/2;return'<g stroke="'+U+'" stroke-width="2"><line x1="'+(P-$)+'" y1="'+(s-$)+'" x2="'+(P+$)+'" y2="'+(s+$)+'"/><line x1="'+(P-$)+'" y1="'+(s+$)+'" x2="'+(P+$)+'" y2="'+(s-$)+'"/></g>'}function re(k,T,D,S,U,P){var s=T+S/2;return'<line x1="'+k+'" y1="'+s+'" x2="'+(k+D)+'" y2="'+s+'" stroke="'+U+'" stroke-width="'+P+'"/>'}var Yr={" ":278,"!":278,'"':355,"#":556,$:556,"%":889,"&":667,"'":191,"(":333,")":333,"*":389,"+":584,",":278,"-":333,".":278,"/":278,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,":":278,";":278,"<":584,"=":584,">":584,"?":556,"@":1015,A:667,B:667,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:500,K:667,L:556,M:833,N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611,"[":278,"\\":278,"]":278,"^":469,_:556,"`":333,a:556,b:556,c:500,d:556,e:556,f:278,g:556,h:556,i:222,j:222,k:500,l:222,m:833,n:556,o:556,p:556,q:556,r:333,s:500,t:278,u:556,v:500,w:722,x:500,y:500,z:500,"{":334,"|":260,"}":334,"~":584};function Zr(k,T,D){for(var S=String(k??""),U=0,P=0;P<S.length;P++){var s=Yr[S.charAt(P)];U+=s===void 0?556:s}return U/1e3*T*(D?1.06:1)}function Ee(k,T){if(!k.text||Zr(k.text,k.size,k.bold)<=T)return[k];for(var D=k.text.split(/\s+/),S=[],U="",P=0;P<D.length;P++){var s=U?U+" "+D[P]:D[P];U&&Zr(s,k.size,k.bold)>T?(S.push({text:U,size:k.size,bold:k.bold,italic:k.italic}),U=D[P]):U=s}return U&&S.push({text:U,size:k.size,bold:k.bold,italic:k.italic}),S.length?S:[k]}function Ze(k,T,D,S,U,P,s){if(!k)return"";var $=parseInt(P.fontsize||"12",10),G=P.fontcolor||"#000000",B=P.fontstyle||"",or=B&1||B==="1"||B==="3"||B==="5"||B==="7",K=B&2||B==="2"||B==="3"||B==="6"||B==="7",hr=Gr(k,$,or,K);if(hr.length===0)return"";var vr=(P.align||"center").toLowerCase(),Jr=(P.verticalalign||"middle").toLowerCase(),Ge=parseFloat(P.spacingleft)||0,no=parseFloat(P.spacingtop)||0,bo=vr==="left"?"start":vr==="right"?"end":"middle",Oo=vr==="left"?T+4+Ge:vr==="right"?T+S-4:T+S/2+Ge/2,We=(P.labelposition||"").toLowerCase();if(We==="left"?(bo="end",Oo=T-4):We==="right"&&(bo="start",Oo=T+S+4),s==="swimlane"||s==="umlframe"){for(var Tt=s==="umlframe"?parseFloat(P.height)||30:parseFloat(P.startsize)||20,Cn=0,un=0;un<hr.length;un++)Cn+=hr[un].size*1.33;var Kt=D+Tt/2-Cn/2+hr[0].size,ut=[];for(un=0;un<hr.length;un++)hr[un].text&&ut.push(eo(Oo,Kt,hr[un].text,hr[un].size,G,hr[un].bold,hr[un].italic,bo,P.fontfamily)),Kt+=hr[un].size*1.33;return ut.join("")}if(P.whitespace==="wrap"){for(var fn=Math.max(20,S-8-Ge),vt=[],_o=0;_o<hr.length;_o++)for(var Zo=Ee(hr[_o],fn),jt=0;jt<Zo.length;jt++)vt.push(Zo[jt]);hr=vt}for(var zt=hr[0].size*1.33,Ga=1;Ga<hr.length;Ga++)zt+=hr[Ga].size*1.33;var $n,zn=(P.verticallabelposition||"").toLowerCase();zn==="bottom"?$n=D+U+hr[0].size+2:zn==="top"?$n=D-zt+hr[0].size-2:Jr==="top"?$n=D+no+hr[0].size+2:Jr==="bottom"?$n=D+U-zt+hr[0].size:$n=D+no+U/2-zt/2+hr[0].size;for(var Dn=[],xe=0;xe<hr.length;xe++)hr[xe].rule?Dn.push($e(hr[xe],T,S,$n)):hr[xe].text&&Dn.push(eo(Oo,$n,hr[xe].text,hr[xe].size,G,hr[xe].bold,hr[xe].italic,bo,P.fontfamily)),$n+=(xe+1<hr.length?hr[xe+1].size:hr[xe].size)*1.33;return Dn.join(`
-`)}function eo(k,T,D,S,U,P,s,$,G){var B=' x="'+k+'" y="'+T+'" font-size="'+S+'" fill="'+U+'" text-anchor="'+$+'"';return $==="start"&&(B+=' textLength="'+Zr(D,S,P).toFixed(2)+'" lengthAdjust="spacing"'),P&&(B+=' font-weight="bold"'),s&&(B+=' font-style="italic"'),G&&(B+=' font-family="'+ar(G)+'"'),"<text"+B+">"+ar(D)+"</text>"}function Gr(k,T,D,S){if(k==null)return[];var U=String(k);U=U.replace(/<br\s*\/?>/gi,`
-`),U=U.replace(/<li\b[^>]*>/gi,`
+`).forEach(function(Oo){var qe=oe(Oo,ne,!1);qe>_o&&(_o=qe)}),Je-_o/2<T&&(T=Je-_o/2),Je+_o/2>D&&(D=Je+_o/2)}}}}),T===1/0?{x:0,y:0,w:100,h:60}:{x:T,y:N,w:D-T,h:K-N}}function U(O){var T={},N={},D=[],K=[];O.forEach(function(m){T[m.id]=m}),O.forEach(function(m){m.parent!=null&&T[m.parent]?(N[m.parent]=N[m.parent]||[]).push(m):D.push(m)});function P(m,G){if(!(G>20)){K.push(m);for(var I=N[m.id]||[],er=0;er<I.length;er++)P(I[er],G+1)}}for(var u=0;u<D.length;u++)P(D[u],0);return K}var H={};function J(){var O=["<defs>"];for(var T in H)if(H.hasOwnProperty(T)){var N=H[T],D=N.color,K,P=11,u=10,m=9,G=4;switch(N.shape){case"halfcircle":u=16,G=8,K='<path d="M9,0 A8,8 0 0 0 9,16" fill="none" stroke="'+D+'"/>';break;case"classic":K='<path d="M0,0 L10,4 L0,8 L4,4 z" fill="'+D+'"/>';break;case"open":K='<path d="M0,0 L10,4 L0,8" fill="none" stroke="'+D+'"/>';break;case"blockfilled":K='<path d="M0,0 L10,4 L0,8 z" fill="'+D+'"/>';break;case"blockhollow":K='<path d="M0.5,0.5 L9.5,4 L0.5,7.5 z" fill="#FFFFFF" stroke="'+D+'"/>';break;case"diamondfilled":P=14,m=12,K='<path d="M0,4 L6,0 L12,4 L6,8 z" fill="'+D+'"/>';break;case"diamondhollow":P=14,m=12,K='<path d="M0.5,4 L6,0.5 L11.5,4 L6,7.5 z" fill="#FFFFFF" stroke="'+D+'"/>';break;case"oval":P=10,m=5,G=5,K='<circle cx="5" cy="5" r="4.5" fill="'+D+'"/>';break;case"cross":P=10,m=8,K='<path d="M1,0.5 L8,7.5 M1,7.5 L8,0.5" fill="none" stroke="'+D+'" stroke-width="1.5"/>';break;case"halftop":K='<path d="M0,0 L10,4 L0,4 z" fill="'+D+'"/>';break;case"halfbottom":K='<path d="M0,4 L10,4 L0,8 z" fill="'+D+'"/>';break;case"erone":P=12,m=10,K='<path d="M5,0 L5,8" fill="none" stroke="'+D+'"/>';break;case"ermandone":P=12,m=10,K='<path d="M3,0 L3,8 M7,0 L7,8" fill="none" stroke="'+D+'"/>';break;case"ermany":P=12,m=10,K='<path d="M0,4 L10,0 M0,4 L10,8 M0,4 L10,4" fill="none" stroke="'+D+'"/>';break;case"eronetomany":P=16,m=14,K='<path d="M2,0 L2,8 M4,4 L14,0 M4,4 L14,8 M4,4 L14,4" fill="none" stroke="'+D+'"/>';break;case"erzerotoone":P=16,m=14,K='<circle cx="4" cy="4" r="3" fill="#FFFFFF" stroke="'+D+'"/><path d="M10,0 L10,8" fill="none" stroke="'+D+'"/>';break;case"erzerotomany":P=18,m=16,K='<circle cx="4" cy="4" r="3" fill="#FFFFFF" stroke="'+D+'"/><path d="M8,4 L17,0 M8,4 L17,8 M8,4 L17,4" fill="none" stroke="'+D+'"/>';break;default:K='<path d="M0,0 L10,4 L0,8 L4,4 z" fill="'+D+'"/>'}N.scale&&N.scale!==1&&(K='<g transform="scale('+N.scale+')">'+K+"</g>",P=P*N.scale,m=m*N.scale,G=G*N.scale),N.start&&(K='<g transform="translate('+P+',0) scale(-1,1)">'+K+"</g>",m=P-m),O.push('<marker id="'+N.id+'" markerWidth="'+P+'" markerHeight="'+u*(N.scale||1)+'" refX="'+m+'" refY="'+G+'" orient="auto" markerUnits="userSpaceOnUse">'+K+"</marker>")}return O.push("</defs>"),O.join("")}function gr(O,T,N){var D=Wr(O.style),K=(D.shape||"rectangle").toLowerCase(),P=O.absX+T,u=O.absY+N,m=O.geometry.width,G=O.geometry.height,I=X(D),er=D.strokecolor||"#000000",z=D.strokewidth||"1",hr=D.dashed==="1",mr="";switch(K){case"ellipse":mr=C(P,u,m,G,I,er,z,hr);break;case"umlactor":mr=$(P,u,m,G,I,er);break;case"swimlane":mr=y(P,u,m,G,I,er,D);break;case"umlframe":mr=A(P,u,m,G,I,er,z,D);break;case"note":mr=s(P,u,m,G,I,er);break;case"hexagon":mr=a(k(P,u,m,G),I,er,z,hr);break;case"triangle":{var ne=(D.direction||"east").toLowerCase(),ye;ne==="north"?ye=[[P+m/2,u],[P+m,u+G],[P,u+G]]:ne==="south"?ye=[[P,u],[P+m,u],[P+m/2,u+G]]:ne==="west"?ye=[[P+m,u],[P+m,u+G],[P,u+G/2]]:ye=[[P,u],[P+m,u+G/2],[P,u+G]],mr=a(ye,I,er,z,hr);break}case"umllifeline":{var Je=Math.max(0,Math.min(G,parseFloat(D.size)||40)),_o=D.lifelinemirror==="1",Oo=D.participant!=null,qe=_o?u+G-Je:u+G,St=Oo?"":_(P,u,m,Je,I,er,z,D);u+Je<qe&&(St+='<line x1="'+(P+m/2)+'" y1="'+(u+Je)+'" x2="'+(P+m/2)+'" y2="'+qe+'" stroke="'+er+'" stroke-width="'+z+'" stroke-dasharray="5 5"/>'),_o&&!Oo&&(St+=_(P,u+G-Je,m,Je,I,er,z,D)),mr=St;break}case"table":mr=_(P,u,m,G,I,er,z,D);break;case"tablerow":{var ht="";I!=="none"&&(ht+='<rect x="'+P+'" y="'+u+'" width="'+m+'" height="'+G+'" fill="'+I+'" stroke="none"/>'),O.geometry.y>0&&(ht+='<line x1="'+P+'" y1="'+u+'" x2="'+(P+m)+'" y2="'+u+'" stroke="'+er+'" stroke-width="1"/>'),mr=ht;break}case"partialrectangle":{for(var nn=I!=="none"?'<rect x="'+P+'" y="'+u+'" width="'+m+'" height="'+G+'" fill="'+I+'" stroke="none"/>':"",Tt=[["top",P,u,P+m,u],["bottom",P,u+G,P+m,u+G],["left",P,u,P,u+G],["right",P+m,u,P+m,u+G]],Lo=0;Lo<Tt.length;Lo++)D[Tt[Lo][0]]!=="0"&&D[Tt[Lo][0]]!=null&&(nn+='<line x1="'+Tt[Lo][1]+'" y1="'+Tt[Lo][2]+'" x2="'+Tt[Lo][3]+'" y2="'+Tt[Lo][4]+'" stroke="'+er+'" stroke-width="'+z+'"/>');mr=nn;break}case"rhombus":mr=a([[P+m/2,u],[P+m,u+G/2],[P+m/2,u+G],[P,u+G/2]],I,er,z,hr);break;case"cylinder":mr=t(P,u,m,G,I,er,Math.min(40,G/5));break;case"cloud":case"mxgraph.basic.cloud_rect":mr=B(P,u,m,G,I,er);break;case"cube":mr=n(P,u,m,G,I,er,z);break;case"umlboundary":mr=v(P,u,m,G,I,er);break;case"umlcontrol":mr=R(P,u,m,G,I,er);break;case"umlentity":mr=Q(P,u,m,G,I,er);break;case"cylinder3":mr=D.direction==="east"?L(P,u,m,G,I,er,Math.min(m/2,parseFloat(D.size)||15)):t(P,u,m,G,I,er,Math.min(G/2,parseFloat(D.size)||15));break;case"endstate":mr=w(P,u,m,G,er);break;case"doublecircle":mr=ar(P,u,m,G,I,er);break;case"component":mr=sr(P,u,m,G,I,er);break;case"card":mr=Sr(P,u,m,G,I,er);break;case"mxgraph.archimate3.application":mr=ir(P,u,m,G,I,er,z,D);break;case"folder":mr=_r(P,u,m,G,I,er,z,D);break;case"process":mr=a(o(P,u,m,G),I,er,z,hr);break;case"queue":mr=ae(P,u,m,G,I,er);break;case"cross":mr=se(P,u,m,G,er);break;case"line":mr=re(P,u,m,G,er,z);break;case"text":mr=I!=="none"||D.strokecolor&&D.strokecolor!=="none"?_(P,u,m,G,I,D.strokecolor&&D.strokecolor!=="none"?D.strokecolor:"none",z,D):"";break;case"rectangle":default:mr=_(P,u,m,G,I,er,z,D);break}var Qt=K==="umllifeline"?Math.max(0,Math.min(G,parseFloat(D.size)||40)):G,pt=Me(O.value,P,u,m,Qt,D,K);return K==="umllifeline"&&D.lifelinemirror==="1"&&(pt+=Me(O.value,P,u+G-Qt,m,Qt,D,K)),mr+(pt?`
+`+pt:"")}function X(O){var T=O.fillcolor;return!T||T==="none"?"none":T}function g(O){var T="";for(var N in O)O[N]!==""&&O[N]!==null&&O[N]!==void 0&&(T+=" "+N+'="'+O[N]+'"');return T}function M(O,T){if(!O)return"";var N=T?String(T).replace(/\s+/g,","):"5,5";return' stroke-dasharray="'+N+'"'}function _(O,T,N,D,K,P,u,m){var G=0;m.rounded==="1"&&(G=m.absolutearcsize==="1"&&m.arcsize?parseFloat(m.arcsize)/2:m.arcsize?Math.min(N,D)*parseFloat(m.arcsize)/100:10);var I=m.dashed==="1";return'<rect x="'+O+'" y="'+T+'" width="'+N+'" height="'+D+'" rx="'+G+'" ry="'+G+'" fill="'+K+'" stroke="'+P+'" stroke-width="'+u+'"'+M(I,m.dashpattern)+"/>"}function C(O,T,N,D,K,P,u,m){var G=O+N/2,I=T+D/2,er=N/2,z=D/2;return'<ellipse cx="'+G+'" cy="'+I+'" rx="'+er+'" ry="'+z+'" fill="'+K+'" stroke="'+P+'" stroke-width="'+u+'"'+M(m)+"/>"}function $(O,T,N,D,K,P){var u=O+N/2,m=Math.min(8,Math.min(N,D)*.2),G=T+m+2,I=G+m,er=T+D*.7,z=I+(er-I)*.2,hr=O+N*.15,mr=O+N*.85,ne=O+N*.28,ye=O+N*.72,Je=T+D-2,_o=K==="none"?"#FFFFFF":K;return'<ellipse cx="'+u+'" cy="'+G+'" rx="'+m+'" ry="'+m+'" fill="'+_o+'" stroke="'+P+'" stroke-width="1"/><path d="M'+u+","+I+" L"+u+","+er+" M"+hr+","+z+" L"+mr+","+z+" M"+u+","+er+" L"+ne+","+Je+" M"+u+","+er+" L"+ye+","+Je+'" fill="none" stroke="'+P+'" stroke-width="1"/>'}function y(O,T,N,D,K,P,u){var m=parseFloat(u.startsize)||20,G=K==="none"?"#FFFFFF":K,I=u.swimlanefillcolor?u.swimlanefillcolor==="none"?"#FFFFFF":u.swimlanefillcolor:G,er=u.rounded==="0"?0:u.absolutearcsize==="1"&&u.arcsize?parseFloat(u.arcsize)/2:2.5,z=M(u.dashed==="1",u.dashpattern),hr="";return I!==G&&m>0&&(hr='<path d="M'+O+","+(T+m)+" L"+O+","+(T+er)+" Q"+O+","+T+" "+(O+er)+","+T+" L"+(O+N-er)+","+T+" Q"+(O+N)+","+T+" "+(O+N)+","+(T+er)+" L"+(O+N)+","+(T+m)+' Z" fill="'+G+'" stroke="none"/>'),'<g><rect x="'+O+'" y="'+T+'" width="'+N+'" height="'+D+'" rx="'+er+'" ry="'+er+'" fill="'+I+'" stroke="none"/>'+hr+'<rect x="'+O+'" y="'+T+'" width="'+N+'" height="'+D+'" rx="'+er+'" ry="'+er+'" fill="none" stroke="'+P+'"'+z+'/><line x1="'+O+'" y1="'+(T+m)+'" x2="'+(O+N)+'" y2="'+(T+m)+'" stroke="'+P+'"'+z+"/></g>"}function A(O,T,N,D,K,P,u,m){var G=10,I=Math.min(N,Math.max(G,parseFloat(m.width)||60)),er=Math.min(D,Math.max(G*1.5,parseFloat(m.height)||30)),z=m.swimlanefillcolor;return'<rect x="'+O+'" y="'+T+'" width="'+N+'" height="'+D+'" fill="'+(z&&z!=="none"?z:"none")+'" stroke="'+P+'" stroke-width="'+u+'"/><path d="M'+O+","+T+" L"+(O+I)+","+T+" L"+(O+I)+","+(T+Math.max(0,er-G*1.5))+" L"+(O+Math.max(0,I-G))+","+(T+er)+" L"+O+","+(T+er)+' Z" fill="none" stroke="'+P+'" stroke-width="'+u+'"/>'}function s(O,T,N,D,K,P){var u=Math.min(14,Math.min(N,D)*.2),m="M"+O+","+T+" L"+(O+N-u)+","+T+" L"+(O+N)+","+(T+u)+" L"+(O+N)+","+(T+D)+" L"+O+","+(T+D)+" Z",G="M"+(O+N-u)+","+T+" L"+(O+N-u)+","+(T+u)+" L"+(O+N)+","+(T+u);return'<path d="'+m+'" fill="'+K+'" stroke="'+P+'" stroke-width="1"/><g fill="none" stroke="'+P+'" stroke-width="1"><path d="'+G+'"/></g>'}function k(O,T,N,D){var K=Math.min(N*.2,D*.5);return[[O+K,T],[O+N-K,T],[O+N,T+D/2],[O+N-K,T+D],[O+K,T+D],[O,T+D/2]]}function o(O,T,N,D){var K=Math.min(N*.15,20);return[[O,T],[O+N,T],[O+N-K,T+D/2],[O+N,T+D],[O,T+D],[O+K,T+D/2]]}function a(O,T,N,D,K){var P=O.map(function(u){return u[0]+","+u[1]}).join(" ");return'<polygon points="'+P+'" fill="'+T+'" stroke="'+N+'" stroke-width="'+D+'"'+M(K)+"/>"}function t(O,T,N,D,K,P,u){u>0||(u=Math.min(D*.1,12));var m=N/2,G='<path d="M'+O+","+(T+u)+" L"+O+","+(T+D-u)+" A"+m+","+u+" 0 0 0 "+(O+N)+","+(T+D-u)+" L"+(O+N)+","+(T+u)+" A"+m+","+u+" 0 0 0 "+O+","+(T+u)+' Z" fill="'+K+'" stroke="'+P+'"/>',I='<path d="M'+O+","+(T+u)+" A"+m+","+u+" 0 0 0 "+(O+N)+","+(T+u)+'" fill="none" stroke="'+P+'"/>';return"<g>"+G+I+"</g>"}function n(O,T,N,D,K,P,u){var m=Math.min(10,Math.min(N,D)/5),G="M"+O+","+(T+m)+" L"+(O+m)+","+T+" L"+(O+N)+","+T+" L"+(O+N)+","+(T+D-m)+" L"+(O+N-m)+","+(T+D)+" L"+O+","+(T+D)+" Z";function I(er,z,hr,mr){return'<line x1="'+er+'" y1="'+z+'" x2="'+hr+'" y2="'+mr+'" stroke="'+P+'" stroke-width="'+u+'"/>'}return'<path d="'+G+'" fill="'+K+'" stroke="'+P+'" stroke-width="'+u+'"/>'+I(O,T+m,O+N-m,T+m)+I(O+N-m,T+m,O+N,T)+I(O+N-m,T+m,O+N-m,T+D)}function v(O,T,N,D,K,P){var u=D/2,m=O+N-u,G=T+u;return'<g stroke="'+P+'" fill="none"><circle cx="'+m+'" cy="'+G+'" r="'+u+'" fill="'+K+'"/><line x1="'+O+'" y1="'+(T+D*.15)+'" x2="'+O+'" y2="'+(T+D*.85)+'"/><line x1="'+O+'" y1="'+G+'" x2="'+(m-u)+'" y2="'+G+'"/></g>'}function R(O,T,N,D,K,P){var u=O+N/2,m=D/2-2,G=T+2+m;return'<g stroke="'+P+'" fill="none"><circle cx="'+u+'" cy="'+G+'" r="'+m+'" fill="'+K+'"/><path d="M'+(u+6)+","+(T-2)+" L"+u+","+(T+2)+" L"+(u+6)+","+(T+6)+'"/></g>'}function Q(O,T,N,D,K,P){var u=O+N/2,m=(D-4)/2;return'<g stroke="'+P+'"><circle cx="'+u+'" cy="'+(T+m)+'" r="'+m+'" fill="'+K+'"/><line x1="'+(u-m)+'" y1="'+(T+D)+'" x2="'+(u+m)+'" y2="'+(T+D)+'"/></g>'}function L(O,T,N,D,K,P,u){u>0||(u=Math.min(N*.15,10));var m=D/2,G='<path d="M'+(O+u)+","+T+" L"+(O+N-u)+","+T+" A"+u+","+m+" 0 0 1 "+(O+N-u)+","+(T+D)+" L"+(O+u)+","+(T+D)+" A"+u+","+m+" 0 0 1 "+(O+u)+","+T+' Z" fill="'+K+'" stroke="'+P+'"/>',I='<path d="M'+(O+N-u)+","+T+" A"+u+","+m+" 0 0 0 "+(O+N-u)+","+(T+D)+'" fill="none" stroke="'+P+'"/>';return"<g>"+G+I+"</g>"}function B(O,T,N,D,K,P){if(N>110||D>95){let qe=function(St,ht,nn,Tt,Lo,Qt){for(var pt=nn-St,So=Tt-ht,it=Math.sqrt(pt*pt+So*So),qt=Math.max(1,Math.round(it/m)),Pt=0;Pt<qt;Pt++)u.push({x:St+pt*Pt/qt,y:ht+So*Pt/qt,nx:Lo,ny:Qt})};var u=[],m=26,G=9;qe(O,T,O+N,T,0,-1),qe(O+N,T,O+N,T+D,1,0),qe(O+N,T+D,O,T+D,0,1),qe(O,T+D,O,T,-1,0);for(var I=function(St){return Math.round(St*10)/10},er="M"+I(u[0].x)+","+I(u[0].y),z=1;z<=u.length;z++){var hr=u[z-1],mr=u[z%u.length],ne=(hr.x+mr.x)/2+hr.nx*G,ye=(hr.y+mr.y)/2+hr.ny*G;er+=" Q"+I(ne)+","+I(ye)+" "+I(mr.x)+","+I(mr.y)}return'<path d="'+er+' Z" fill="'+K+'" stroke="'+P+'"/>'}var Je=O+N/2,_o=T+D/2,Oo="M"+(O+N*.2)+","+(T+D*.55)+" C"+(O+N*0)+","+(T+D*.3)+" "+(O+N*.2)+","+(T+D*.1)+" "+(O+N*.35)+","+(T+D*.2)+" C"+(O+N*.4)+","+(T+D*0)+" "+(O+N*.65)+","+(T+D*0)+" "+(O+N*.7)+","+(T+D*.2)+" C"+(O+N*.9)+","+(T+D*.1)+" "+(O+N*1)+","+(T+D*.5)+" "+(O+N*.8)+","+(T+D*.6)+" C"+(O+N*.95)+","+(T+D*.85)+" "+(O+N*.7)+","+(T+D*1)+" "+(O+N*.55)+","+(T+D*.85)+" C"+(O+N*.4)+","+(T+D*1)+" "+(O+N*.1)+","+(T+D*.95)+" "+(O+N*.2)+","+(T+D*.55)+" Z";return'<path d="'+Oo+'" fill="'+K+'" stroke="'+P+'"/>'}function w(O,T,N,D,K){var P=O+N/2,u=T+D/2,m=Math.min(N,D)/2,G=m*.5;return'<g><circle cx="'+P+'" cy="'+u+'" r="'+m+'" fill="#FFFFFF" stroke="'+K+'"/><circle cx="'+P+'" cy="'+u+'" r="'+G+'" fill="'+K+'" stroke="none"/></g>'}function ar(O,T,N,D,K,P){var u=O+N/2,m=T+D/2,G=Math.min(N,D)/2,I=G-4;return'<g><circle cx="'+u+'" cy="'+m+'" r="'+G+'" fill="'+K+'" stroke="'+P+'"/><circle cx="'+u+'" cy="'+m+'" r="'+I+'" fill="none" stroke="'+P+'"/></g>'}function sr(O,T,N,D,K,P){var u=12,m=10,G=T+D*.25-m/2,I=T+D*.75-m/2,er=K==="none"?"#FFFFFF":K;return'<g><rect x="'+O+'" y="'+T+'" width="'+N+'" height="'+D+'" fill="'+er+'" stroke="'+P+'"/><rect x="'+(O-u/2)+'" y="'+G+'" width="'+u+'" height="'+m+'" fill="'+er+'" stroke="'+P+'"/><rect x="'+(O-u/2)+'" y="'+I+'" width="'+u+'" height="'+m+'" fill="'+er+'" stroke="'+P+'"/></g>'}function ir(O,T,N,D,K,P,u,m){var G=m.architype||"square",I=m.dashed==="1",er;if(G==="oct"){var z=Math.min(12,N/4,D/4);er=a([[O+z,T],[O+N-z,T],[O+N,T+z],[O+N,T+D-z],[O+N-z,T+D],[O+z,T+D],[O,T+D-z],[O,T+z]],K,P,u,I)}else{var hr=G==="rounded"?12.5:.5;er='<rect x="'+O+'" y="'+T+'" width="'+N+'" height="'+D+'" rx="'+hr+'" ry="'+hr+'" fill="'+K+'" stroke="'+P+'" stroke-width="'+u+'"'+M(I)+"/>"}var mr="";if(m.apptype&&m.apptype!=="generic"){var ne=O+N-24,ye=T+7;mr='<path d="M'+ne+","+ye+" h14 v10 h-14 Z M"+(ne+1)+","+(ye+1)+' h12 v8 h-12 Z" fill="#000000" fill-rule="evenodd" stroke="none"/>'}return er+mr}function _r(O,T,N,D,K,P,u,m){var G=Math.min(N,parseFloat(m.tabwidth)||50),I=Math.min(D,parseFloat(m.tabheight)||15),er=K,z=M(m.dashed==="1",m.dashpattern),hr="M"+O+","+T+" L"+(O+G-7)+","+T+" L"+(O+G)+","+(T+I)+" L"+(O+N)+","+(T+I)+" L"+(O+N)+","+(T+D)+" L"+O+","+(T+D)+" Z";return'<path d="'+hr+'" fill="'+er+'" stroke="'+P+'" stroke-width="'+u+'"'+z+'/><line x1="'+O+'" y1="'+(T+I)+'" x2="'+(O+G)+'" y2="'+(T+I)+'" stroke="'+P+'" stroke-width="'+u+'"'+z+"/>"}function Sr(O,T,N,D,K,P){var u=Math.min(N,D)*.15,m="M"+(O+u)+","+T+" L"+(O+N)+","+T+" L"+(O+N)+","+(T+D)+" L"+O+","+(T+D)+" L"+O+","+(T+u)+" Z";return'<path d="'+m+'" fill="'+K+'" stroke="'+P+'"/>'}function ae(O,T,N,D,K,P){var u=Math.min(N*.1,14);return'<g><rect x="'+O+'" y="'+T+'" width="'+N+'" height="'+D+'" fill="'+K+'" stroke="'+P+'"/><line x1="'+(O+N-u)+'" y1="'+T+'" x2="'+(O+N-u)+'" y2="'+(T+D)+'" stroke="'+P+'"/></g>'}function se(O,T,N,D,K){var P=O+N/2,u=T+D/2,m=Math.min(N,D)/2;return'<g stroke="'+K+'" stroke-width="2"><line x1="'+(P-m)+'" y1="'+(u-m)+'" x2="'+(P+m)+'" y2="'+(u+m)+'"/><line x1="'+(P-m)+'" y1="'+(u+m)+'" x2="'+(P+m)+'" y2="'+(u-m)+'"/></g>'}function re(O,T,N,D,K,P){var u=T+D/2;return'<line x1="'+O+'" y1="'+u+'" x2="'+(O+N)+'" y2="'+u+'" stroke="'+K+'" stroke-width="'+P+'"/>'}var Ur={" ":278,"!":278,'"':355,"#":556,$:556,"%":889,"&":667,"'":191,"(":333,")":333,"*":389,"+":584,",":278,"-":333,".":278,"/":278,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,":":278,";":278,"<":584,"=":584,">":584,"?":556,"@":1015,A:667,B:667,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:500,K:667,L:556,M:833,N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611,"[":278,"\\":278,"]":278,"^":469,_:556,"`":333,a:556,b:556,c:500,d:556,e:556,f:278,g:556,h:556,i:222,j:222,k:500,l:222,m:833,n:556,o:556,p:556,q:556,r:333,s:500,t:278,u:556,v:500,w:722,x:500,y:500,z:500,"{":334,"|":260,"}":334,"~":584};function oe(O,T,N){for(var D=String(O??""),K=0,P=0;P<D.length;P++){var u=Ur[D.charAt(P)];K+=u===void 0?556:u}return K/1e3*T*(N?1.06:1)}function Ce(O,T){if(!O.text||oe(O.text,O.size,O.bold)<=T)return[O];for(var N=O.text.split(/\s+/),D=[],K="",P=0;P<N.length;P++){var u=K?K+" "+N[P]:N[P];K&&oe(u,O.size,O.bold)>T?(D.push({text:K,size:O.size,bold:O.bold,italic:O.italic}),K=N[P]):K=u}return K&&D.push({text:K,size:O.size,bold:O.bold,italic:O.italic}),D.length?D:[O]}function Me(O,T,N,D,K,P,u){if(!O)return"";var m=parseInt(P.fontsize||"12",10),G=P.fontcolor||"#000000",I=P.fontstyle||"",er=I&1||I==="1"||I==="3"||I==="5"||I==="7",z=I&2||I==="2"||I==="3"||I==="6"||I==="7",hr=Hr(O,m,er,z);if(hr.length===0)return"";var mr=(P.align||"center").toLowerCase(),ne=(P.verticalalign||"middle").toLowerCase(),ye=parseFloat(P.spacingleft)||0,Je=parseFloat(P.spacingtop)||0,_o=mr==="left"?"start":mr==="right"?"end":"middle",Oo=mr==="left"?T+4+ye:mr==="right"?T+D-4:T+D/2+ye/2,qe=(P.labelposition||"").toLowerCase();if(qe==="left"?(_o="end",Oo=T-4):qe==="right"&&(_o="start",Oo=T+D+4),u==="swimlane"||u==="umlframe"){for(var St=u==="umlframe"?parseFloat(P.height)||30:parseFloat(P.startsize)||20,ht=0,nn=0;nn<hr.length;nn++)ht+=hr[nn].size*1.33;var Tt=N+St/2-ht/2+hr[0].size,Lo=[];for(nn=0;nn<hr.length;nn++)hr[nn].text&&Lo.push(eo(Oo,Tt,hr[nn].text,hr[nn].size,G,hr[nn].bold,hr[nn].italic,_o,P.fontfamily)),Tt+=hr[nn].size*1.33;return Lo.join("")}if(P.whitespace==="wrap"){for(var Qt=Math.max(20,D-8-ye),pt=[],So=0;So<hr.length;So++)for(var it=Ce(hr[So],Qt),qt=0;qt<it.length;qt++)pt.push(it[qt]);hr=pt}for(var Pt=hr[0].size*1.33,We=1;We<hr.length;We++)Pt+=hr[We].size*1.33;var pn,ra=(P.verticallabelposition||"").toLowerCase();ra==="bottom"?pn=N+K+hr[0].size+2:ra==="top"?pn=N-Pt+hr[0].size-2:ne==="top"?pn=N+Je+hr[0].size+2:ne==="bottom"?pn=N+K-Pt+hr[0].size:pn=N+Je+K/2-Pt/2+hr[0].size;for(var Gn=[],Xe=0;Xe<hr.length;Xe++)hr[Xe].rule?Gn.push(Ne(hr[Xe],T,D,pn)):hr[Xe].text&&Gn.push(eo(Oo,pn,hr[Xe].text,hr[Xe].size,G,hr[Xe].bold,hr[Xe].italic,_o,P.fontfamily)),pn+=(Xe+1<hr.length?hr[Xe+1].size:hr[Xe].size)*1.33;return Gn.join(`
+`)}function eo(O,T,N,D,K,P,u,m,G){var I=' x="'+O+'" y="'+T+'" font-size="'+D+'" fill="'+K+'" text-anchor="'+m+'"';return m==="start"&&(I+=' textLength="'+oe(N,D,P).toFixed(2)+'" lengthAdjust="spacing"'),P&&(I+=' font-weight="bold"'),u&&(I+=' font-style="italic"'),G&&(I+=' font-family="'+lr(G)+'"'),"<text"+I+">"+lr(N)+"</text>"}function Hr(O,T,N,D){if(O==null)return[];var K=String(O);K=K.replace(/<br\s*\/?>/gi,`
+`),K=K.replace(/<li\b[^>]*>/gi,`
\u2022 `).replace(/<\/(?:ul|ol)>/gi,`
-`).replace(/<(?:\/?li|ul|ol)\b[^>]*>/gi,""),U=U.replace(/<hr\b([^>]*)>/gi,function(Ge,no){var bo=/dotted/i.test(no)?"dotted":/double/i.test(no)?"double":"solid";return`
-hr:`+bo+`
-`}),U=U.replace(/<\/?(?:div|p)\b[^>]*>/gi,""),U=U.replace(/\n?\u0002(?:\n|\u0002)*/g,`
-`);for(var P=U.split(/\r?\n/),s=[],$=0;$<P.length;$++){var G=P[$],B=/^hr:(\w+)$/.exec(G);if(B){s.push({text:"",rule:B[1],size:7.5,bold:!1,italic:!1});continue}var or=T||12,K=G.match(/font-size\s*:\s*(\d+(?:\.\d+)?)px/i);K&&(or=parseFloat(K[1]));var hr=!!D||/<b>|font-weight\s*:\s*bold/i.test(G),vr=!!S||/<i>|font-style\s*:\s*italic/i.test(G),Jr=Dr(G.replace(/<[^>]+>/g,"")).replace(/^\s+|\s+$/g,"");s.push({text:Jr,size:or,bold:hr,italic:vr})}for(;s.length&&!s[s.length-1].text&&!s[s.length-1].rule;)s.pop();for(;s.length&&!s[0].text&&!s[0].rule;)s.shift();return s}function $e(k,T,D,S){for(var U=S-2.5,P=k.rule==="dotted"?' stroke-dasharray="1,2"':"",s=k.rule==="double"?[U-1,U+1]:[U],$="",G=0;G<s.length;G++)$+='<line x1="'+(T+2)+'" y1="'+s[G]+'" x2="'+(T+D-2)+'" y2="'+s[G]+'" stroke="#181818" stroke-width="1"'+P+"/>";return $}function Ye(k,T,D,S){var U=Kr(k.style),P={};T.forEach(function(Rl){P[Rl.id]=Rl});var s,$,G=null,B=P[k.source],or=P[k.target],K=P[k.parent],hr=K&&K.absX!=null?K.absX:0,vr=K&&K.absY!=null?K.absY:0;if(k.geometry&&k.geometry.sourcePoint&&k.geometry.targetPoint){s={x:k.geometry.sourcePoint.x+hr,y:k.geometry.sourcePoint.y+vr},$={x:k.geometry.targetPoint.x+hr,y:k.geometry.targetPoint.y+vr};var Jr=k.geometry.points;if(Jr&&Jr.length>0){for(var Ge=$.x-s.x,no=$.y-s.y,bo=Math.sqrt(Ge*Ge+no*no)||1,Oo=!1,We=0;We<Jr.length&&!Oo;We++){var Tt=Jr[We].x+hr-s.x,Cn=Jr[We].y+vr-s.y;Oo=Math.abs(Tt*no-Cn*Ge)/bo>.5}Oo&&(G=Jr.map(function(Rl){return{x:Rl.x+hr,y:Rl.y+vr}}))}}else if(B&&or&&B.geometry&&or.geometry){var un={x:B.absX+B.geometry.width/2,y:B.absY+B.geometry.height/2},Kt={x:or.absX+or.geometry.width/2,y:or.absY+or.geometry.height/2};k.geometry&&k.geometry.points&&k.geometry.points.length>0&&(G=k.geometry.points.map(function(Rl){return{x:Rl.x+hr,y:Rl.y+vr}}));var ut=G?G[0]:Kt,fn=G?G[G.length-1]:un;s=U.exitx!=null&&U.exity!=null?{x:B.absX+B.geometry.width*parseFloat(U.exitx),y:B.absY+B.geometry.height*parseFloat(U.exity)}:Fo(B,un,ut),$=U.entryx!=null&&U.entryy!=null?{x:or.absX+or.geometry.width*parseFloat(U.entryx),y:or.absY+or.geometry.height*parseFloat(U.entryy)}:Fo(or,Kt,fn)}else return"";var vt=s.x+D,_o=s.y+S,Zo=$.x+D,jt=$.y+S,zt=null;if(G){zt=[{x:vt,y:_o}];for(var Ga=0;Ga<G.length;Ga++)zt.push({x:G[Ga].x+D,y:G[Ga].y+S});zt.push({x:Zo,y:jt})}var $n=U.strokecolor||"#000000",zn=U.strokewidth||"1",Dn=U.dashed==="1",xe=(U.endarrow||"classic").toLowerCase();(U.endhalf==="top"||U.endhalf==="bottom")&&(xe="half"+U.endhalf);var i=(U.startarrow||"none").toLowerCase(),c=U.endfill,F=Hr(xe,c,$n,!1,U.endsize,zn),y=Hr(i,U.startfill,$n,!0,U.startsize,zn),sr;if((U.shape||"").toLowerCase()==="arrow"){var kr=(parseFloat(U.width)||12)/2,be=(parseFloat(U.endwidth)||1)/2,dr=Math.sqrt((Zo-vt)*(Zo-vt)+(jt-_o)*(jt-_o))||1,Mo=-(jt-_o)/dr,io=(Zo-vt)/dr,go=U.fillcolor&&U.fillcolor!=="none"?U.fillcolor:$n;sr='<path d="M'+(vt+Mo*kr)+","+(_o+io*kr)+" L"+(Zo+Mo*be)+","+(jt+io*be)+" L"+(Zo-Mo*be)+","+(jt-io*be)+" L"+(vt-Mo*kr)+","+(_o-io*kr)+' Z" fill="'+go+'" stroke="'+$n+'" stroke-width="'+zn+'"/>'}else if(U.curved==="1"&&!zt){var gn=vt+(Zo-vt)/2;sr='<path d="M'+vt+","+_o+" C"+gn+","+_o+" "+gn+","+jt+" "+Zo+","+jt+'" fill="none" stroke="'+$n+'" stroke-width="'+zn+'"'+_(Dn,U.dashpattern)+(F?' marker-end="'+F+'"':"")+(y?' marker-start="'+y+'"':"")+"/>"}else if(zt){for(var On="",co=0;co<zt.length;co++)On+=(co===0?"M":" L")+zt[co].x+","+zt[co].y;sr='<path d="'+On+'" fill="none" stroke="'+$n+'" stroke-width="'+zn+'"'+_(Dn,U.dashpattern)+(F?' marker-end="'+F+'"':"")+(y?' marker-start="'+y+'"':"")+"/>";var Gn=Math.floor((zt.length-1)/2);vt=zt[Gn].x,_o=zt[Gn].y,Zo=zt[Gn+1].x,jt=zt[Gn+1].y}else sr='<line x1="'+vt+'" y1="'+_o+'" x2="'+Zo+'" y2="'+jt+'" stroke="'+$n+'" stroke-width="'+zn+'"'+_(Dn,U.dashpattern)+(F?' marker-end="'+F+'"':"")+(y?' marker-start="'+y+'"':"")+"/>";var lo="";if(k.value){var It=parseInt(U.fontsize||"12",10),Un=U.fontstyle||"",wa=Un==="1"||Un==="3"||Un==="5"||Un==="7",Ta=Gr(k.value,It,wa,!1);if(Ta.length>0){var Ea=k.geometry&&k.geometry.x?(k.geometry.x+1)/2:.5,Ua=vt+(Zo-vt)*Ea,oa=k.geometry&&k.geometry.y||0,vn=0,Jl=0;if(oa){var Ul=Math.sqrt((Zo-vt)*(Zo-vt)+(jt-_o)*(jt-_o))||1;vn=-(jt-_o)/Ul*oa,Jl=(Zo-vt)/Ul*oa}Ua+=vn;var _l=U.fontcolor||"#000000",Ma=U.labelbackgroundcolor,gl=[],Ia=It*1.25,tt=(_o+jt)/2-4-(Ta.length-1)*Ia+Jl;if(Ma&&Ma!=="none"){for(var Vn=0,sl=0;sl<Ta.length;sl++){var El=Zr(Ta[sl].text,Ta[sl].size,Ta[sl].bold);El>Vn&&(Vn=El)}Vn+=4;var ui=Ia*Ta.length;gl.push('<rect x="'+(Ua-Vn/2)+'" y="'+(tt-It)+'" width="'+Vn+'" height="'+ui+'" fill="'+Ma+'" stroke="none"/>')}for(var rl=0;rl<Ta.length;rl++)gl.push(eo(Ua,tt+rl*Ia,Ta[rl].text,Ta[rl].size,_l,Ta[rl].bold,Ta[rl].italic,"middle",U.fontfamily));lo=`
-`+gl.join(`
-`)}}return sr+lo}function Hr(k,T,D,S,U,P){if(!k||k==="none")return"";var s;k==="block"?s=T==="1"?"blockfilled":"blockhollow":k==="open"||k==="openthin"?s="open":k==="halfcircle"?s="halfcircle":k==="diamond"||k==="diamondthin"?s=T==="1"?"diamondfilled":"diamondhollow":k==="oval"||k==="circle"?s="oval":k==="cross"?s="cross":k==="halftop"||k==="halfbottom"||k==="erone"||k==="ermandone"||k==="ermany"||k==="eronetomany"||k==="erzerotoone"||k==="erzerotomany"?s=k:k==="triangle"?s="blockhollow":s="classic";var $=D||"#000000",G=(U?parseFloat(U):6)+(parseFloat(P)||1)+2,B=Math.max(.3,G/10);s==="oval"&&(B=((U?parseFloat(U):6)+(parseFloat(P)||1))/9);var or=s+"-"+$.replace(/[^0-9a-zA-Z]/g,"")+(S?"-s":"")+(B!==1?"-z"+Math.round(B*100):"");return M[or]||(M[or]={id:"ah-"+or,shape:s,color:$,start:!!S,scale:B}),"url(#"+M[or].id+")"}function Fo(k,T,D){var S=k.absX,U=k.absY,P=k.geometry.width,s=k.geometry.height,$=D.x-T.x,G=D.y-T.y;if($===0&&G===0)return{x:T.x,y:T.y};var B=$===0?1/0:$>0?(S+P-T.x)/$:(S-T.x)/$,or=G===0?1/0:G>0?(U+s-T.y)/G:(U-T.y)/G,K=Math.min(B,or);return K<0||!isFinite(K)?{x:T.x,y:T.y}:{x:T.x+$*K,y:T.y+G*K}}return{convert:pr,convertXml:q}})();var zh=(function(){function pr(){if(typeof document<"u"&&typeof Image<"u"&&typeof document.createElement=="function")return se;throw new Error("PlantUml2Png.render requires a browser environment or a canvas polyfill. In pure Node.js, call PlantUml2Svg.convert() and pipe the result through an external SVG\u2192PNG rasteriser (resvg-js, sharp, Inkscape, or plantuml.jar -tpng).")}function q(Dr,ar){try{var Y=Gf.convert(Dr,ar);return Tr(Y,ar)}catch($r){return Promise.reject($r)}}function Xr(Dr,ar){try{var Y=Gf.convertXml(Dr,ar);return Tr(Y,ar)}catch($r){return Promise.reject($r)}}function Tr(Dr,ar){ar=ar||{};var Y;try{Y=pr()}catch($r){return Promise.reject($r)}return Y(Dr,ar)}function se(Dr,ar){var Y=Math.max(.1,parseFloat(ar.scale)||1),$r=ar.backgroundColor||null,rr=ar.mimeType||"image/png";return new Promise(function(H,M){var j=Kr(Dr),gr=typeof Blob<"u"?new Blob([Dr],{type:"image/svg+xml;charset=utf-8"}):null,W=gr&&typeof URL<"u"&&URL.createObjectURL?URL.createObjectURL(gr):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(Dr),d=new Image;d.onload=function(){try{var _=(d.width||j.width)*Y,p=(d.height||j.height)*Y,E=document.createElement("canvas");E.width=Math.max(1,Math.round(_)),E.height=Math.max(1,Math.round(p));var L=E.getContext("2d");$r&&(L.fillStyle=$r,L.fillRect(0,0,E.width,E.height)),L.drawImage(d,0,0,E.width,E.height);var N=E.toDataURL(rr);W.slice(0,5)==="blob:"&&URL.revokeObjectURL&&URL.revokeObjectURL(W),H(N)}catch(m){M(m)}},d.onerror=function(_){W.slice(0,5)==="blob:"&&typeof URL<"u"&&URL.revokeObjectURL&&URL.revokeObjectURL(W),M(new Error("Failed to rasterise SVG (Image load error): "+(_&&_.message?_.message:"unknown")))},d.src=W})}function Kr(Dr){var ar=Dr.match(/\bwidth="(\d+(?:\.\d+)?)"/),Y=Dr.match(/\bheight="(\d+(?:\.\d+)?)"/),$r=Dr.match(/\bviewBox="\s*([\d.\-]+)\s+([\d.\-]+)\s+([\d.\-]+)\s+([\d.\-]+)"/),rr=ar?parseFloat(ar[1]):0,H=Y?parseFloat(Y[1]):0;return(!rr||!H)&&$r&&(rr||(rr=parseFloat($r[3])),H||(H=parseFloat($r[4]))),{width:rr||800,height:H||600}}return{render:q,renderXml:Xr,renderSvg:Tr}})();var cd=(function(){for(var pr=["participant","actor","boundary","control","entity","database","collections","queue"],q={},Xr=0;Xr<pr.length;Xr++)q[pr[Xr]]=!0;function Tr(d,_){var p=d.length,E=_,L="none",N="none",m=null,u=0,R=0,o=se(d,E,"<"),t=o;for(E=o.end;E<p&&d[E]==="-";)u++,E++;for(;E<p&&d[E]===".";)R++,E++;var n=!1;if(E<p&&d[E]==="["){var f=d.indexOf("]",E);if(f>E){for(var O=d.substring(E+1,f).split(","),g=0;g<O.length;g++){var Q=O[g].replace(/^\s+|\s+$/g,""),x=Q.toLowerCase();x==="dashed"||x==="dotted"?n=!0:x==="bold"||x==="hidden"||x===""||(m=Q.charAt(0)==="#"?Q:"#"+Q)}E=f+1}}for(;E<p&&d[E]==="-";)u++,E++;for(;E<p&&d[E]===".";)R++,E++;if(u+R===0)return null;var I=se(d,E,">"),w=I;if(E=I.end,L=Kr(o),N=Kr(I),L==="none"&&N==="none"&&u+R<2)return null;var nr=R>0&&u===0?"dotted":u>2||R>0?"dashed":"solid";return u===2&&R===0&&L==="none"&&N==="none"?null:(R===0&&(nr=u>=2?"dashed":"solid"),n&&nr==="solid"&&(nr="dashed"),{end:E,lineStyle:nr,leftHead:L,rightHead:N,left:t,right:w,color:m})}function se(d,_,p){for(var E={arrow:!1,async:!1,cross:!1,circle:!1,part:null,end:_},L=_;L<d.length;){var N=d[L];if(N===p)E.arrow&&(E.async=!0),E.arrow=!0;else if(N==="x")E.cross=!0;else if(N==="o")E.circle=!0;else if(N==="\\")E.part="halfTop";else if(N==="/")E.part="halfBottom";else break;L++}return E.end=L,E}function Kr(d){return d.cross?"lost":d.circle?"circle":d.part?d.part:d.async?"open":d.arrow?"filled":"none"}function Dr(d){return d.cross?"lost":d.part?d.part:d.async?"open":"filled"}function ar(d,_){return _==="o"||d.circle?"circle":_==="x"||d.cross?"lost":null}function Y(d,_){if(_==null)return"<b>"+d+"</b>";var p=String(_).match(/^([^0#]*)([0#]+)([^0#]*)$/);if(p==null)return String(d);for(var E=p[2].replace(/[^0]/g,"").length,L=String(d);L.length<E;)L="0"+L;return p[1]+L+p[3]}function $r(d,_,p,E){var L=d;if(p.hasOwnProperty(L))return L;for(var N in p)if(p.hasOwnProperty(N)&&_[p[N]].name===d)return N;var m={id:L,name:d,kind:"participant",color:null,stereotype:null,order:E.value++,created:!1,box:null};return p[L]=_.length,_.push(m),L}function rr(d){return d==null?d:String(d).replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," ")}function H(d,_){for(;_<d.length&&(d[_]===" "||d[_]===" ");)_++;if(_>=d.length)return null;if(d[_]==='"'){var p=d.indexOf('"',_+1);return p<0&&(p=d.length),{name:rr(d.substring(_+1,p)),end:p+1}}for(var E=_;E<d.length&&!/[\s:<>\-\[\]"+*!]/.test(d[E]);)E++;return E===_?null:{name:d.substring(_,E),end:E}}function M(d,_,p,E){var L=/^&\s*/.exec(d);L&&(d=d.substring(L[0].length));var N=d.match(/^(?:([\[\]?])\s*([ox]?))?\s*(?=[<\-\/\\])/);if(N){var m=N[1]==="]"?"right":"left",u=Tr(d,N[0].length);if(u!=null){for(var R=u.end;R<d.length&&(d[R]===" "||d[R]===" ");)R++;var o=H(d,R);if(o!=null){var t=/^\s*([+*!-]+)?\s*(#\w+)?\s*(?:\[\[(?:[^\]]|\](?!\]))*\]\])?/.exec(d.substring(o.end)),n=t&&t[1]?t[1]:null,f="",O=d.indexOf(":",o.end+(t?t[0].length:0));O>=0&&(f=d.substring(O+1).replace(/^\s+|\s+$/g,""));var g=$r(o.name,_,p,E),Q=u.right.arrow||!u.left.arrow,x=ar(u.left,N[2]);return{type:"message",from:Q?null:g,to:Q?g:null,fromEdge:Q?m:null,toEdge:Q?null:m,short:N[1]==="?",label:f,lineStyle:u.lineStyle,arrowHead:Q?Dr(u.right):x==="lost"?"lost":Dr(u.left),headDecor:Q?u.right.circle?"circle":null:x==="circle"?"circle":null,tailDecor:Q?x:ar(u.right,""),color:u.color,activate:n&&n.indexOf("+")>=0?g:null,activateColor:t&&t[2]?t[2]:null,deactivate:n&&n.indexOf("-")>=0?g:null,activationSpec:n}}}}var I=null,w=-1,nr=-1,lr=H(d,0);if(lr==null)return null;for(var ir=lr.end;ir<d.length&&(d[ir]===" "||d[ir]===" ");)ir++;if(ir>=d.length)return null;var mr=Tr(d,ir);if(mr==null)return null;for(var Or=mr.end;Or<d.length&&Or<d.length&&(d[Or]===" "||d[Or]===" ");)Or++;var Qr=/^([ox]?)\s*([\[\]?])/.exec(d.substring(Or));if(Qr){var ee=Qr[2]==="["?"left":"right",re=Or+Qr[0].length,Yr=/^\s*([+*!-]+)?\s*(#\w+)?/.exec(d.substring(re)),Zr=Yr&&Yr[1]?Yr[1]:null,Ee="",Ze=d.indexOf(":",re+(Yr?Yr[0].length:0));Ze>=0&&(Ee=d.substring(Ze+1).replace(/^\s+|\s+$/g,""));var eo=$r(lr.name,_,p,E),Gr=mr.right.arrow||!mr.left.arrow,$e=ar(mr.right,Qr[1]);return{type:"message",from:Gr?eo:null,to:Gr?null:eo,fromEdge:Gr?null:ee,toEdge:Gr?ee:null,short:Qr[2]==="?",label:Ee,lineStyle:mr.lineStyle,arrowHead:Gr?$e==="lost"?"lost":Dr(mr.right):Dr(mr.left),headDecor:Gr?$e==="circle"?"circle":null:mr.left.circle?"circle":null,tailDecor:Gr?ar(mr.left,""):$e,color:mr.color,activate:Zr&&Zr.indexOf("+")>=0?eo:null,activateColor:Yr&&Yr[2]?Yr[2]:null,deactivate:Zr&&Zr.indexOf("-")>=0?eo:null,activationSpec:Zr}}var Ye=H(d,Or);if(Ye==null)return null;var Hr=Ye.end,Fo=null,k=null,T=d.substring(Hr),D=T.match(/^\s*(\+\+--|--\+\+|\+\+|--|\*\*|!!)\s*(#\w+)?/),S=null,U=null;D&&(S=D[1],U=D[2]||null,Hr+=D[0].length);var P=/^\s*\[\[(?:[^\]]|\](?!\]))*\]\]/.exec(d.substring(Hr));P&&(Hr+=P[0].length);var s="",$=d.indexOf(":",Hr);$>=0&&(s=d.substring($+1).replace(/^\s+|\s+$/g,""));var G=$r(lr.name,_,p,E),B=$r(Ye.name,_,p,E),or=G,K=B,hr=mr.right,vr=mr.left,Jr;mr.left.arrow&&mr.right.arrow?Jr="bidirectional":(mr.left.arrow&&(or=B,K=G,hr=mr.left,vr=mr.right),Jr=hr.cross?"lost":hr.part?hr.part:hr.async?"open":"filled");var Ge=Jr!=="bidirectional"&&hr.circle?"circle":null,no=vr.circle?"circle":vr.cross?"lost":null;(S==="++"||S==="--++"||S==="++--")&&(Fo=K),(S==="--"||S==="--++"||S==="++--")&&(k=or);var bo=S==="**"?K:null,Oo=S==="!!"?K:null;return{type:"message",from:or,to:K,label:rr(s),lineStyle:mr.lineStyle,arrowHead:Jr,headDecor:Ge,tailDecor:no,color:mr.color,activate:Fo,activateColor:U,deactivate:k,activationSpec:S,createTarget:bo,destroyTarget:Oo,number:null}}function j(d,_,p){for(var E=[],L=0,N=_+1;N<d.length;N++){var m=d[N].replace(/^\s+|\s+$/g,"");if(m==="{{")L++;else if(m==="}}"&&L>0)L--;else if(L===0&&(p instanceof RegExp?p.test(m):m.toLowerCase()===p))return{text:E.join(`
-`),endIdx:N};E.push(m)}return{text:E.join(`
-`),endIdx:d.length-1}}function gr(d){d=d.replace(/^\s+|\s+$/g,"");var _=/^(.*?)(?:^|\s)(#[A-Za-z0-9][A-Za-z0-9\/|:;.\-]*)\s*$/.exec(d);return _?{str:_[1].replace(/^\s+|\s+$/g,""),color:_[2]}:{str:d,color:null}}function W(d,_){_=_||{};for(var p=d.split(/\r\n|\r|\n/),E=[],L={},N=[],m=[],u=null,R=!1,o=null,t={},n=0,f={value:0},O=null,g={},Q=_.styleSheet||kt.createSheet(),x=!1,I=0,w=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(d)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(d),nr=0;nr<p.length;nr++){var lr=p[nr],ir=lr.replace(/^\s+|\s+$/g,"");if(ir!==""&&ir.charAt(0)!=="'"&&ir.charAt(0)!=="!"){var mr=/^(?:&\s*)?(?:\/\s*(?=[hr]?note\b))?/i.exec(ir);if(mr[0].length>0&&(ir=ir.substring(mr[0].length)),/^<style>$/i.test(ir)){for(var Or=[];nr+1<p.length;){nr++;var Qr=p[nr].replace(/^\s+|\s+$/g,"");if(/^<\/?style>$/i.test(Qr))break;Qr.charAt(0)!=="'"&&Or.push(p[nr])}try{Q.addBlock(Or.join(`
-`))}catch{}continue}var ee=/^<style>(.*)<\/style>$/i.exec(ir);if(ee!=null){try{Q.addBlock(ee[1])}catch{}continue}if(!/^<style\b/i.test(ir)){if(/^skinparam\b/i.test(ir)){var re=ir.match(/^skinparam\s+([A-Za-z][A-Za-z0-9]*)?\s*\{\s*$/i);if(re||/\{\s*$/.test(ir))for(var Yr=re&&re[1]?re[1].toLowerCase():"",Zr=1;Zr>0&&nr+1<p.length;){nr++;var Ee=p[nr].replace(/^\s+|\s+$/g,"");if(Ee.indexOf("{")>=0&&Zr++,Ee.indexOf("}")>=0){Zr--;continue}if(Zr===1){var Ze=Ee.match(/^([A-Za-z][A-Za-z0-9]*)\s*(<<[^>]*>>)?\s+(\S.*)$/);Ze&&(g[Yr+Ze[1].toLowerCase()+(Ze[2]?Ze[2].toLowerCase():"")]=Ze[3].replace(/\s+$/,""))}}else{var eo=ir.match(/^skinparam\s+([A-Za-z][A-Za-z0-9]*)\s*(<<[^>]*>>)?\s+(\S.*)$/i);eo&&(g[eo[1].toLowerCase()+(eo[2]?eo[2].toLowerCase():"")]=eo[3].replace(/\s+$/,""))}continue}if(/^hide\s+stereotypes?\s*$/i.test(ir)){x=!0;continue}var Gr=ir.match(/^(?:(?:center|left|right)\s+)?(title|header|footer|caption)\s+(.+)$/i);if(Gr){t[Gr[1].toLowerCase()]=Gr[2].replace(/^\s+|\s+$/g,"");continue}var $e=ir.match(/^(?:(?:center|left|right)\s+)?(title|header|footer|caption)\s*$/i);if($e){for(var Ye=$e[1].toLowerCase(),Hr=new RegExp("^end\\s*"+Ye+"$","i"),Fo=[];nr+1<p.length;){nr++;var k=p[nr].replace(/^\s+|\s+$/g,"");if(Hr.test(k))break;Fo.push(k)}t[Ye]=Fo.join(`
-`);continue}if(/^(hide|show)\b/i.test(ir)){/^show\s+footbox\b/i.test(ir)||vo.ignoredDirective(_,"sequence",nr,lr);continue}if(/^(mainframe|newpage|rotate)\b/i.test(ir)){vo.ignoredDirective(_,"sequence",nr,lr);continue}if(!/^scale\b/i.test(ir)){var T=ir.match(/^legend((?:\s+(?:left|right|center|top|bottom))*)\s*$/i);if(T){for(var D=T[1].toLowerCase().split(/\s+/).filter(function(bi){return bi!==""}),S=null,U=0;U<D.length;U++)(S==null||/^(left|right|center)$/.test(D[U]))&&(S=D[U]);for(var P=[];nr+1<p.length;){nr++;var s=p[nr].replace(/^\s+|\s+$/g,"");if(/^end\s*legend\b/i.test(s))break;P.push(s)}o={position:S||"center",lines:P};continue}if(!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(ir)){var $=ir.toLowerCase(),G=ir.match(/^autoactivate\s+(on|off)$/i);if(G){R=G[1].toLowerCase()==="on";continue}var B=ir.match(/^autonumber(?:\s+(\d+))?(?:\s+(\d+))?(?:\s+"([^"]*)")?$/i);if(B){u={start:B[1]?parseInt(B[1],10):1,increment:B[2]?parseInt(B[2],10):1,format:B[3]||null},n=u.start;continue}if(/^autonumber\s+stop$/i.test(ir)){u=null;continue}if(/^autonumber\s+resume/i.test(ir)){u==null&&(u={start:1,increment:1,format:null});continue}var or=ir.match(/^box(?:\s+"([^"]*)"|\s+(\S+))?(?:\s+(#\S+))?$/i);if(or){O={label:rr(or[1]||or[2]||""),color:or[3]||null,participants:[]},m.push(O);continue}if(/^end\s*box$/i.test(ir)){O=null;continue}var K=ir.match(/^(participant|actor|boundary|control|entity|database|collections|queue)\s+(.+)$/i);if(K&&!/^[<\-]/.test(K[2])){var hr=K[1].toLowerCase(),vr=K[2],Jr=null,Ge=null,no=null,bo=null,Oo=vr.match(/^(\S+)\s*\[\s*$/);if(Oo){for(var We=[];nr+1<p.length;){nr++;var Tt=p[nr].replace(/^\s+|\s+$/g,"");if(Tt==="]")break;We.push(Tt)}var Cn=Oo[1];L.hasOwnProperty(Cn)||(L[Cn]=E.length,E.push({id:Cn,name:Cn,kind:hr,color:null,stereotype:null,stereoLetter:null,stereoColor:null,bodyLines:We,order:f.value++,created:!1,box:O?m.indexOf(O):null}),O&&O.participants.push(Cn));continue}var un=H(vr,0);if(un){Jr=un.name;var Kt=vr.substring(un.end).replace(/^\s+/,""),ut=Kt.match(/^as\s+/i);if(ut){var fn=Kt.substring(ut[0].length),vt=H(fn,0);vt&&(fn.charAt(0)==='"'&&vr.charAt(0)!=='"'?(Ge=Jr,Jr=vt.name):Ge=vt.name,Kt=fn.substring(vt.end).replace(/^\s+/,""))}var _o=Kt.match(/^(#\S+)(.*)/);_o&&(no=_o[1],Kt=_o[2].replace(/^\s+/,""));var Zo=Kt.match(/^<<\s*([^>]*)\s*>>/),jt=null,zt=null;if(Zo){bo=Zo[1].replace(/^\s+|\s+$/g,"");var Ga=bo.match(/^\(\s*([A-Za-z])\s*,\s*(#[0-9A-Fa-f]{3,8})\s*\)\s*(.*)$/);Ga&&(jt=Ga[1],zt=Ga[2],bo=Ga[3].replace(/^\s+|\s+$/g,"")||null)}var $n=Ge||Jr;if(L.hasOwnProperty($n)){var Dn=L[$n],xe=E[Dn];hr!=="participant"&&(xe.kind=hr),no&&(xe.color=no),bo&&(xe.stereotype=bo)}else{var zn={id:$n,name:Jr,kind:hr,color:no,stereotype:bo,stereoLetter:jt,stereoColor:zt,order:f.value++,created:!1,box:O?m.indexOf(O):null};L[$n]=E.length,E.push(zn),O&&O.participants.push($n)}}continue}var i=ir.match(/^create\s+(?:(participant|actor|boundary|control|entity|database|collections|queue)\s+)?(.+)$/i);if(i){var c=i[1]?i[1].toLowerCase():"participant",F=H(i[2],0);if(F){var y=F.name,sr=i[2].substring(F.end).replace(/^\s+/,""),kr=sr.match(/^as\s+(\S+)/i);if(kr&&(y=kr[1]),L.hasOwnProperty(y))E[L[y]].created=!0;else{var be={id:y,name:F.name,kind:c,color:null,stereotype:null,order:f.value++,created:!0,box:O?m.indexOf(O):null};L[y]=E.length,E.push(be),O&&O.participants.push(y)}N.push({type:"create",participant:y})}continue}var dr=ir.match(/^(activate|deactivate|destroy)\s+("[^"]*"|\S+?)\s*(#\w+)?(?:\s+(#\w+))?\s*$/i);if(dr){var Mo=dr[1].toLowerCase(),io=dr[2];io.charAt(0)==='"'&&(io=rr(io.substring(1,io.length-1)));var go={type:Mo,participant:$r(io,E,L,f)};Mo==="activate"&&(go.color=dr[3]||null,go.lineColor=dr[4]||null),N.push(go);continue}if(/^deactivate$/i.test(ir)){N.push({type:"deactivate",participant:null});continue}var gn=ir.match(/^return(?:\s+(#\w+)\s+|\s+|$)(.*)$/i);if(gn){var On={type:"message",from:null,to:null,label:gn[2]?rr(gn[2].replace(/^\s+|\s+$/g,"")):"",lineStyle:"dashed",arrowHead:"filled",color:gn[1]||null,activate:null,deactivate:null,number:null,isReturn:!0,index:nr,raw:lr};u&&(On.number=n,On.numberText=Y(n,u.format),n+=u.increment),N.push(On);continue}var co=ir.match(/^(h?note|rnote)(?:\s*<<[^>]*>>)?\s+(left|right|over|across|top|bottom)\b(?:\s+of\b)?(?:(.+?)\s*)?$/i);if(co){var Gn=co[1].toLowerCase(),lo=co[2].toLowerCase(),It=co[3]||"";It=It.replace(/^((?:[^:\[]|\[(?!\[))*?)\s*\[\[(?:[^\]]|\](?!\]))*\]\]/,"$1");var Un=It.indexOf(":"),wa=Un>=0,Ta=wa?It.substring(0,Un):It,Ea=wa?It.substring(Un+1).replace(/^\s+|\s+$/g,""):"",Ua=gr(Ta.replace(/\s*<<[^>]*>>/g,"")),oa=Ua.color,vn=Ua.str?Ua.str.split(/\s*,\s*/):[];if((lo==="top"||lo==="bottom")&&vn.length>0){vo.droppedLine(_,"sequence",nr,lr,'is not sequence diagram syntax (plantuml.jar answers "Syntax Error?": a note goes left, right or over a participant, or top / bottom of the previous arrow)');var Jl=wa?-1:vo.blockEnd(p,nr,/^\s*end\s*[rh]?note\b/i);Jl>=0&&(nr=Jl);continue}for(var Ul=0;Ul<vn.length;Ul++)vn[Ul]=$r(vn[Ul],E,L,f);if(!wa){var _l=j(p,nr,/^end\s*[hr]?note$/i);nr=_l.endIdx,Ea=_l.text}N.push({type:"note",position:lo,over:vn,text:rr(Ea),color:oa,shape:Gn==="rnote"?"box":Gn==="hnote"?"hexagon":"note"});continue}var Ma=ir.match(/^==\s*(.*?)\s*==$/);if(Ma){N.push({type:"divider",label:rr(Ma[1])});continue}var gl=ir.match(/^(?:\.{3}|…)(?:(.*)(?:\.{3}|…))?$/);if(gl){N.push({type:"delay",label:rr((gl[1]||"").replace(/^\s+|\s+$/g,""))});continue}var Ia=ir.match(/^\|\|(\d+)\|\|$/);if(/^\|\|\|$/.test(ir)||Ia){N.push({type:"gap",h:Ia?parseInt(Ia[1],10):null});continue}var tt=ir.match(/^(group|alt|else|also|opt|loop|par|par2|break|critical|end)\b\s*(.*)$/i);if(tt){var Vn=tt[1].toLowerCase(),sl=tt[2].replace(/^\s+|\s+$/g,"");if((Vn==="end"||Vn==="else"||Vn==="also")&&I===0){vo.droppedLine(_,"sequence",nr,lr,(Vn==="end"?"closes":"continues")+" a group but no group is open here");continue}if(Vn==="end"){I--,N.push({type:"groupEnd"});continue}var El=null,ui=null,rl=sl.match(/^(#[A-Za-z0-9]+)(?:\s+(#[A-Za-z0-9]+))?\s*(.*)$/);if(rl&&(rl[2]?(El=rl[1],ui=rl[2]):ui=rl[1],sl=rl[3]),Vn==="else"||Vn==="also")N.push({type:"groupElse",label:rr(sl),color:ui});else{var Rl=null;if(Vn==="group"&&sl!==""){var pl=/^(.*\[\[.*\]\].*?|.*?)\[(.*)\]$/.exec(sl);pl&&(sl=pl[1].replace(/^\s+|\s+$/g,""),Rl=pl[2])}I++,N.push({type:"groupStart",kind:Vn,label:rr(sl),cond:Rl!=null?rr(Rl):null,color:ui,headColor:El})}continue}var Al=ir.match(/^ref(?:#\w+)?\s+over\s+(.+?)\s*:\s*(.*)$/i);if(Al){for(var Wa=gr(Al[1]),ai=Wa.str.split(/\s*,\s*/),Nl=0;Nl<ai.length;Nl++)ai[Nl]=$r(ai[Nl],E,L,f);N.push({type:"ref",over:ai,color:Wa.color,label:Al[2].replace(/^\s+|\s+$/g,"")});continue}var xa=ir.match(/^ref(?:#\w+)?\s+over\s+(.+)$/i);if(xa){for(var fi=gr(xa[1].replace(/^\s+|\s+$/g,"")),Ni=fi.str.split(/\s*,\s*/),Oi=0;Oi<Ni.length;Oi++)Ni[Oi]=$r(Ni[Oi],E,L,f);var Vl=j(p,nr,/^end\s*(?:ref)?$/i);nr=Vl.endIdx,N.push({type:"ref",over:Ni,color:fi.color,label:Vl.text});continue}var gi=ir.replace(/^(\S+)\s+-{2,}>?\s*$/,"$1 ->]"),el=M(gi,E,L,f);if(el){el.createTarget!=null&&(L.hasOwnProperty(el.createTarget)&&(E[L[el.createTarget]].created=!0),N.push({type:"create",participant:el.createTarget})),R&&el.activationSpec==null&&el.arrowHead!=="lost"&&el.arrowHead!=="none"&&(el.lineStyle!=="solid"?el.deactivate=el.from!=null?el.from:el.to:el.activate=el.to!=null?el.to:el.from),u&&(el.number=n,el.numberText=Y(n,u.format),n+=u.increment),N.push(el),el.destroyTarget!=null&&N.push({type:"destroy",participant:el.destroyTarget});continue}if(/^[rh]?note\b/i.test(ir)){vo.droppedLine(_,"sequence",nr,lr,'is not sequence diagram syntax (plantuml.jar answers "Syntax Error?")');var $a=/:/.test(ir)?-1:vo.blockEnd(p,nr,/^\s*end\s*[rh]?note\b/i);$a>=0&&(nr=$a);continue}vo.droppedLine(_,"sequence",nr,lr)}}}}}if(kt.hasUserRules(Q)){for(var li=kt.createSheet(),wl=function(bi,Ki,ts,di){var ns=kt.plainStyle(bi,kt.signature(["root","element","sequenceDiagram"].concat(Ki),-1,[],!1)),Vi=di?kt.color(ns,ts):kt.raw(ns,ts);return Vi==null||Vi==="none"?null:String(Vi)},Xa=function(bi,Ki,ts,di){var ns=wl(Q,Ki,ts,di);ns!=null&&ns!==wl(li,Ki,ts,di)&&(g[bi]=ns)},Ql=["participant","actor","boundary","control","entity","database","collections","queue"],Ll=0;Ll<Ql.length;Ll++)Xa(Ql[Ll]+"backgroundcolor",[Ql[Ll]],"BackGroundColor",!0),Xa(Ql[Ll]+"bordercolor",[Ql[Ll]],"LineColor",!0),Xa(Ql[Ll]+"fontcolor",[Ql[Ll]],"FontColor",!0);Xa("sequencearrowcolor",["arrow"],"LineColor",!0),Xa("sequencearrowthickness",["arrow"],"LineThickness",!1),Xa("sequencelifelinebackgroundcolor",["lifeLine"],"BackGroundColor",!0),Xa("sequencelinethickness",["lifeLine"],"LineThickness",!1),Xa("sequencedividerbackgroundcolor",["separator"],"BackGroundColor",!0),Xa("sequencedividerbordercolor",["separator"],"LineColor",!0),Xa("sequencedividerfontcolor",["separator"],"FontColor",!0)}for(var Dl=0;Dl<E.length;Dl++){var qa=E[Dl],pi=(qa.kind||"participant").toLowerCase(),Fi=qa.stereotype?"<<"+qa.stereotype.toLowerCase()+">>":null;qa.colorInline=qa.color!=null,qa.color==null&&(qa.color=(Fi?g[pi+"backgroundcolor"+Fi]:null)||g[pi+"backgroundcolor"]||null),qa.borderColor=(Fi?g[pi+"bordercolor"+Fi]:null)||g[pi+"bordercolor"]||null,qa.fontColor=(Fi?g[pi+"fontcolor"+Fi]:null)||g[pi+"fontcolor"]||null}return{participants:E,elements:N,boxes:m,autonumber:u,legend:o,title:t.title||null,header:t.header||null,footer:t.footer||null,caption:t.caption||null,monochrome:w,skin:g,hideStereotype:x}}return{parse:W}})();var hd=(function(){function pr(d){return d.replace(/^\s+|\s+$/g,"")}function q(d){if(d==null)return"state";var _=d.toLowerCase();switch(_){case"fork":case"join":case"choice":case"start":case"end":case"entrypoint":case"exitpoint":return _;default:return"state"}}function Xr(d,_){for(var p=0;p<_.length;p++){var E=_[p];if(E.children){for(var L=0;L<E.children.length;L++)if(E.children[L].id===d)return E.children[L];var N=Xr(d,E.children);if(N!=null)return N}if(E.regions)for(var m=0;m<E.regions.length;m++){var u=E.regions[m].children||[],R=Xr(d,u);if(R!=null)return R;for(var o=0;o<u.length;o++)if(u[o].id===d)return u[o]}}return null}function Tr(d,_,p){if(p.hasOwnProperty(d))return _[p[d]];var E=Xr(d,_);if(E!=null)return E;var L="state";d==="[*]_start"||d==="[*]_end"?L=d==="[*]_start"?"initial":"final":d==="[H]"?L="history_shallow":d==="[H*]"&&(L="history_deep");var N={id:d,name:d,description:[],stereotype:null,color:null,kind:L,children:null,concurrent:!1};return p[d]=_.length,_.push(N),N}function se(d){return d==="[*]_start"||d==="[*]_end"||d==="[H]"||d==="[H*]"}function Kr(d,_){if(d.children)for(var p=d.children.length-1;p>=0;p--){var E=d.children[p];if(!(E.id!==d.id||E.kind!=="state"||E.children&&E.children.length>0)){for(var L=!1,N=0;N<_.length;N++)(_[N].from===E.id||_[N].to===E.id)&&(L=!0);if(!L){for(var m=0;m<E.description.length;m++)d.description.push(E.description[m]);d.children.splice(p,1)}}}}function Dr(d,_,p){for(var E={},L=0;L<_.length;L++){var N=_[L];if(se(N.id)){var m=d+"$"+N.id;E[N.id]=m,N.id=m}}for(var u=0;u<p.length;u++){var R=p[u];E.hasOwnProperty(R.from)&&(R.from=E[R.from]),E.hasOwnProperty(R.to)&&(R.to=E[R.to])}}function ar(d,_){var p=d.length,E=_,L=null,N=0;if(E>=p||d[E]!=="-")return null;E++,N++;var m=d.substring(E).match(/^(left|right|up|down|l|r|u|d)(?=-)/i);if(m){var u=m[1].toLowerCase();switch(u){case"left":case"l":L="left";break;case"right":case"r":L="right";break;case"up":case"u":L="up";break;case"down":case"d":L="down";break}E+=m[1].length}for(;E<p&&d[E]==="-";)N++,E++;return N<1||E>=p||d[E]!==">"?null:(E++,{end:E,direction:L,dashCount:N})}function Y(d,_){for(;_<d.length&&(d[_]===" "||d[_]===" ");)_++;if(_>=d.length)return null;if(d[_]==="["){var p=d.indexOf("]",_);if(p>=0){var E=d.substring(_+1,p);if(E==="*"||E==="H"||E==="H*")return{name:"["+E+"]",end:p+1}}return null}if(d[_]==="="){var L=d.substring(_).match(/^==+\s*([\w.]+)\s*==+/);return L?{name:L[1],end:_+L[0].length,bar:!0}:null}if(d[_]==='"'){var N=d.indexOf('"',_+1);return N<0&&(N=d.length),{name:d.substring(_+1,N),end:N+1}}for(var m=_;m<d.length&&/[\w]/.test(d[m]);)m++;return m===_?null:{name:d.substring(_,m),end:m}}function $r(d,_,p,E){var L=1,N=[],m=pr(pr(d[_]).substring(p+1));if(m!==""&&m!=="}"&&N.push(m),m==="}")return{children:[],transitions:[],notes:[],concurrent:!1,regions:null,endIdx:_};for(var u=_+1;u<d.length;u++){for(var R=d[u],o=pr(R),t=0;t<o.length;t++)if(o[t]==="{")L++;else if(o[t]==="}"&&(L--,L===0)){var n=pr(o.substring(0,t));return n!==""&&N.push(n),rr(N,u,E)}N.push(R)}return rr(N,u-1,E)}function rr(d,_,p){for(var E=p||"composite",L=[[]],N=null,m=0;m<d.length;m++){var u=pr(d[m]).match(/^(--+|\|\|+)$/);u?(N==null&&(N=u[1].charAt(0)),L.push([])):L[L.length-1].push(d[m])}for(var R=[],o=0;o<L.length;o++)L[o].length>0&&R.push(L[o]);if(R.length>1){for(var t=[],n=[],f=[],O=[],g=0;g<R.length;g++){var Q=j(R[g].join(`
-`));Dr(E+"#"+g,Q.states,Q.transitions),t.push({states:Q.states,transitions:Q.transitions,notes:Q.notes});for(var x=0;x<Q.states.length;x++)n.push(Q.states[x]);for(var I=0;I<Q.transitions.length;I++)f.push(Q.transitions[I]);for(var w=0;w<Q.notes.length;w++)O.push(Q.notes[w])}return{children:n,transitions:f,notes:O,concurrent:!0,regions:t,sepChar:N,endIdx:_}}var nr=j(R.length?R[0].join(`
-`):"");return Dr(E,nr.states,nr.transitions),{children:nr.states,transitions:nr.transitions,notes:nr.notes,concurrent:!1,regions:null,sepChar:null,endIdx:_}}var H=null,M=null;function j(d,_){for(var p=d.split(/\r\n|\r|\n/),E=[],L={},N=[],m=[],u=!1,R=0;R<p.length;R++){var o=p[R],t=pr(o);if(t!==""&&t.charAt(0)!=="'"&&t.charAt(0)!=="!"){if(/^<style\b/i.test(t)){for(;!/<\/style>/i.test(pr(p[R]))&&R+1<p.length;)R++;continue}if(/^skinparam\b/i.test(t)){if(/\{\s*$/.test(t))for(var n=1;n>0&&R+1<p.length;){R++;var f=pr(p[R]);f.indexOf("{")>=0&&n++,f.indexOf("}")>=0&&n--}continue}if(/^(hide|show|newpage)\b/i.test(t)){/^hide\s+empty\s+description\s*$/i.test(t)||vo.ignoredDirective(H,"state",_?R:null,o);continue}if(/^note\s+(?:"[^"]*"\s+)?as\s+\S+\s*(?:#[\w:;.]+)?\s*$/i.test(t)){var O=Ba.take(M,p,R);if(O>=0){R=O;continue}}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(t)){var g=Ba.take(M,p,R);if(g>=0){R=g;continue}}if(!(/^(title|header|footer|caption|scale|mainframe)\b/i.test(t)||/^set\s+(?:namespace)?separator\b/i.test(t))&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(t)){if(/^(--+|\|\|+)$/.test(t)){u=!0;continue}var Q=t.match(/^note\s+(left|right)\s+of\s+(\S+)(?:\s+#[\w;:.]+)?\s*:\s*(.*)$/i);if(Q){m.push({position:Q[1].toLowerCase(),target:Q[2],text:pr(Q[3])});continue}var x=t.match(/^note\s+(left|right)\s+of\s+(\S+)(?:\s+#[\w;:.]+)?\s*$/i);if(x){for(var I=x[1].toLowerCase(),w=x[2],nr=[],lr=R+1;lr<p.length;lr++){var ir=pr(p[lr]);if(/^end\s*note$/i.test(ir)){R=lr;break}nr.push(pr(p[lr]))}m.push({position:I,target:w,text:nr.join(`
-`)});continue}var mr=t.match(/^note(?:\s+(left|right|top|bottom))?\s+on\s+link\s*(?::\s*(.*))?$/i);if(mr&&N.length>0){var Or={position:"link",side:(mr[1]||"right").toLowerCase(),target:null,linkIndex:N.length-1,text:""};if(mr[2]!=null)Or.text=pr(mr[2]);else{for(var Qr=[],ee=R+1;ee<p.length;ee++){if(/^end\s*note$/i.test(pr(p[ee]))){R=ee;break}Qr.push(pr(p[ee]))}Or.text=Qr.join(`
-`)}m.push(Or);continue}var re=t.match(/^state\s+(.+)$/i);if(re){var Yr=re[1],Zr=null,Ee=null,Ze=null,eo=null,Gr=Y(Yr,0);if(Gr){Zr=Gr.name;var $e=Yr.substring(Gr.end),Ye=$e.match(/^\s+as\s+(\S+)(.*)/i);Ye&&(Ee=Ye[1],$e=Ye[2]);var Hr=$e.match(/\s*<<\s*([^>]*)\s*>>/);Hr&&(Ze=pr(Hr[1]),$e=$e.substring(0,$e.indexOf("<<"))+$e.substring($e.indexOf(">>")+2));var Fo=$e.match(/\s*(#\S+)/);Fo&&(eo=Fo[1],$e=$e.replace(Fo[0],""));var k=Ee||Zr,T=q(Ze),D;L.hasOwnProperty(k)?(D=E[L[k]],Ze&&(D.stereotype=Ze,D.kind=T),eo&&(D.color=eo),Ee&&Zr!==k&&(D.name=Zr)):(D={id:k,name:Ee?Zr:k,description:[],stereotype:Ze,color:eo,kind:T,children:null,concurrent:!1,regions:null,regionSep:null},L[k]=E.length,E.push(D));var S=$e.match(/^\s*:\s*(.+?)\s*$/);if(S&&D.description.push(S[1]),$e=pr($e),$e.length>0&&$e.charAt($e.length-1)==="{"){var U=t.lastIndexOf("{"),P=$r(p,R,U,k);if(D.children=P.children||[],D.concurrent=P.concurrent,D.regions=P.regions||null,D.regionSep=P.sepChar||null,Kr(D,P.transitions||[]),P.transitions)for(var s=0;s<P.transitions.length;s++)N.push(P.transitions[s]);if(P.notes)for(var $=0;$<P.notes.length;$++)m.push(P.notes[$]);R=P.endIdx}else if($e==="{"){var G=t.lastIndexOf("{"),B=$r(p,R,G,k);if(D.children=B.children||[],D.concurrent=B.concurrent,D.regions=B.regions||null,D.regionSep=B.sepChar||null,B.transitions)for(var or=0;or<B.transitions.length;or++)N.push(B.transitions[or]);if(B.notes)for(var K=0;K<B.notes.length;K++)m.push(B.notes[K]);R=B.endIdx}}continue}var hr=t.match(/^(\S+)\s*:\s*(.*)$/);if(hr){var vr=hr[1];if(vr!=="note"&&vr.indexOf("-")<0){var Jr=Tr(vr,E,L);Jr.description.push(pr(hr[2]));continue}}var Ge=gr(t,E,L);if(Ge){N.push(Ge);continue}if(/^[rh]?note\b/i.test(t)){vo.droppedNote(H,"state","note form",_?R:null,o);var no=/:/.test(t)?-1:vo.blockEnd(p,R,/^\s*end\s*[rh]?note\b/i);no>=0&&(R=no);continue}vo.droppedLine(H,"state",_?R:null,o)}}}return{states:E,transitions:N,notes:m,hasConcurrentSep:u}}function gr(d,_,p){var E=null,L=null,N=!1;d=d.replace(/(-)\[([^\]\[]*)\](?=[-\w>])/,function(Ee,Ze,eo){for(var Gr=eo.split(","),$e=0;$e<Gr.length;$e++){var Ye=Gr[$e].replace(/^\s+|\s+$/g,"");Ye.charAt(0)==="#"?E=Ye:/^(dashed|dotted)$/i.test(Ye)?L=Ye.toLowerCase():(/^bold$/i.test(Ye)||/^thickness\s*=\s*\d+/i.test(Ye))&&(N=!0)}return Ze});var m=Y(d,0);if(m==null)return null;for(var u=m.end;u<d.length&&(d[u]===" "||d[u]===" ");)u++;if(u>=d.length)return null;var R=ar(d,u);if(R==null)return null;for(var o=R.end;o<d.length&&(d[o]===" "||d[o]===" ");)o++;var t=Y(d,o);if(t==null)return null;var n=m.name,f=t.name,O,g;if(n==="[*]")O="[*]_start",Tr(O,_,p);else if(n==="[H]"||n==="[H*]")O=n,Tr(O,_,p);else{O=n;var Q=Tr(O,_,p);m.bar&&Q.kind==="state"&&(Q.kind="fork")}var x=d.substring(t.end).match(/^\[(H\*?)\]/),I=!1;if(x&&f!=="[*]"&&f.charAt(0)!=="["){var w=p.hasOwnProperty(f)?_[p[f]]:Xr(f,_);if(w!=null){var nr=f+"$["+x[1]+"]",lr=null;w.children==null&&(w.children=[]);for(var ir=0;ir<w.children.length;ir++)w.children[ir].id===nr&&(lr=w.children[ir]);lr==null&&w.children.push({id:nr,name:x[1],description:[],stereotype:null,color:null,kind:x[1]==="H*"?"history_deep":"history_shallow",children:null,concurrent:!1,regions:null}),g=nr,I=!0}}if(!I)if(f==="[*]")g="[*]_end",Tr(g,_,p);else if(f==="[H]"||f==="[H*]")g=f,Tr(g,_,p);else{g=f;var mr=Tr(g,_,p);t.bar&&mr.kind==="state"&&(mr.kind="fork")}var Or="",Qr=null,ee=t.end,re=d.indexOf(":",ee);if(re>=0){Or=pr(d.substring(re+1));var Yr=Or.match(/^\[([^\]]*)\]/),Zr=Or.match(/\[([^\]]*)\]\s*$/);Yr?Qr=Yr[1]:Zr&&(Qr=Zr[1])}return{from:O,to:g,label:Or,guard:Qr,dashCount:R.dashCount,direction:R.direction,color:E,lineStyle:L,bold:N}}function W(d,_){_=_||{},H=_,M={title:null,header:null,footer:null,caption:null,legend:null};var p;try{p=j(d,!0)}finally{H=null}var E=null;if(p.transitions&&p.transitions.length>0){for(var L=!0,N=!1,m=0;m<p.transitions.length;m++){var u=p.transitions[m];if(u.from&&u.to&&u.from.indexOf("[*]")<0&&u.to.indexOf("[*]")<0&&u.dashCount!=null&&(N=!0,u.dashCount>1)){L=!1;break}}N&&L&&(E="LR")}return Ba.merge({states:p.states,transitions:p.transitions,notes:p.notes,direction:E},M)}return{parse:W}})();var Cd=(function(){var pr=null;function q(m,u){var R=m.split(/\r\n|\r|\n/),o=[],t=!1;o.lines=[],o.config=u||null;for(var n=0;n<R.length;n++){var f=R[n],O=f.replace(/^\s+|\s+$/g,"");if(t){f.indexOf("'/")>=0&&(t=!1);continue}if(O!==""){if(O.substring(0,2)==="/'"){O.indexOf("'/",2)<0&&(t=!0);continue}if(O.charAt(0)!=="'"&&O.charAt(0)!=="!"){if(/^skinparam\b/i.test(O)){if(/\{\s*$/.test(O))for(var g=1;g>0&&n+1<R.length;){n++;var Q=R[n].replace(/^\s+|\s+$/g,"");Q.indexOf("{")>=0&&g++,Q.indexOf("}")>=0&&g--}continue}if(/^(hide|show|newpage)\b/i.test(O)){vo.ignoredDirective(u,"activity",n,f);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(O)){var x=Ba.take(pr,R,n);if(x>=0){n=x;continue}}if(!/^(title|header|footer|caption|scale|mainframe)\b/i.test(O)){if(/^legend\b/i.test(O)){vo.droppedNote(u,"activity","legend",n,f);continue}/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(O)||(o.push(O),o.lines.push(n))}}}}return o}function Xr(m){return m==null?"":m.replace(/^\s*(?:->)?\s*(?:\[#[^\]]*\]|#[a-zA-Z0-9.]+)?\s*/,"").replace(/^\s+|\s+$/g,"")}function Tr(){for(var m=0;m<arguments.length;m++)if(arguments[m]!=null)return arguments[m].replace(/^\s+|\s+$/g,"");return""}function se(m,u){var R=m.replace(/;\s*$/,"").replace(/\s+$/,""),o=new RegExp("^"+u.split(/\s+/).join("\\s*"),"i").exec(R);if(o==null)return!1;var t=R.substring(o[0].length);return t===""||/^[\s(]/.test(t)}function Kr(m,u){for(var R=0;R<m.length;R++)if(m[R].replace(/\s+/g,"")===u)return R;return-1}function Dr(m){for(var u={color:null,colors:[],dashed:!1,dotted:!1,bold:!1,hidden:!1,thickness:null},R=String(m??"").split(/[;,]/),o=0;o<R.length;o++){var t=R[o].replace(/^\s+|\s+$/g,"").toLowerCase();t!==""&&(t.charAt(0)==="#"?(u.colors.push(t),u.color==null&&(u.color=t)):t==="dashed"?u.dashed=!0:t==="dotted"?u.dotted=!0:t==="bold"?u.bold=!0:t==="hidden"?u.hidden=!0:/^thickness=/.test(t)&&(u.thickness=parseFloat(t.substring(10))))}return u}function ar(m,u,R,o,t){for(;u<m.length;){var n=m[u],f=n.toLowerCase();if(o){for(var O=0;O<o.length;O++)if(se(n,o[O]))return u;if(Kr(o,"elseif")>=0&&rr.test(n))return u}var g=n.match(/^(?:-\[([^\]]*)\]->|-+>)\s*(?:(.*?)\s*;|(.*?))\s*$/);if(g){var Q=Dr(g[1]);Q.type="arrowLabel",Q.label=g[2]!=null?g[2]:g[3]||"",R.push(Q),u++;continue}var x=n.match(/^start\s*;?\s*((?:<<[^>]*>>\s*)*)$/i);if(x){var I=W(x[1]);R.push({type:"start",color:I.color,lineColor:I.lineColor}),u++;continue}var w=n.match(/^stop\s*;?\s*((?:<<[^>]*>>\s*)*)$/i);if(w){var nr=W(w[1]);R.push({type:"stop",color:nr.color,lineColor:nr.lineColor}),u++;continue}var lr=n.match(/^end\s*;?\s*((?:<<[^>]*>>\s*)*)$/i);if(lr){var ir=W(lr[1]);R.push({type:"end",color:ir.color,lineColor:ir.lineColor}),u++;continue}if(/^(?:detach|kill)\s*;?\s*$/i.test(n)){R.push({type:"detach"}),u++;continue}if(/^break\s*;?\s*$/i.test(n)){R.push({type:"break"}),u++;continue}var mr=n.match(/^(label|goto)\s+([\w.]+)\s*;?\s*$/i);if(mr){R.push({type:mr[1].toLowerCase(),name:mr[2]}),u++;continue}var Or=n.match(/^\((\S)\)\s*;?\s*$/);if(Or){R.push({type:"spot",letter:Or[1]}),u++;continue}var Qr=n.match(/^\|(\s*#([^|]*)\s*)?\|?\s*([^|]+?)\s*\|$/);if(Qr||(Qr=n.match(/^\|([^|]*)\|$/)),Qr){var ee=null,re=null,Yr=n.match(/^\|#([^|]+)\|([^|]+)\|$/);if(Yr)re="#"+Yr[1],ee=Yr[2].replace(/^\s+|\s+$/g,"");else{var Zr=n.match(/^\|([^|]+)\|$/);Zr&&(ee=Zr[1].replace(/^\s+|\s+$/g,""))}if(ee){for(var Ee=!1,Ze=0;Ze<t.length;Ze++)if(t[Ze].name===ee){Ee=!0,re&&!t[Ze].color&&(t[Ze].color=re);break}Ee||t.push({name:ee,color:re}),R.push({type:"swimlane",name:ee})}u++;continue}var eo=n.match(/^(floating\s+)?note(?:\s+(left|right))?((?:\s*(?:#[\w\-\\|/]+|<<[^>]*>>))*)\s*(:\s*(.*))?$/i);if(eo&&(eo[4]!=null||/^\s*$/.test(n.substring(eo[0].length)))){var Gr=eo[3]||"",$e=Gr.match(/#[\w\-\\|/]+/),Ye=Gr.match(/<<\s*([^>]*?)\s*>>/),Hr={type:"note",position:(eo[2]||"left").toLowerCase(),text:"",floating:!!eo[1],color:$e?$e[0]:null,stereotype:Ye?Ye[1]:null};if(eo[4]!=null){Hr.text=(eo[5]||"").replace(/^\s+|\s+$/g,""),R.push(Hr),u++;continue}var Fo=[];for(u++;u<m.length;){if(/^end\s*note$/i.test(m[u])){u++;break}Fo.push(m[u]),u++}Hr.text=Fo.join(`
-`),R.push(Hr);continue}var k=_(m,u,/^(?:\[\[[^\]]*\]\]\s*)?if\s*(?:<<[^>]*>>\s*)?\s*\(/i,Y),T=k!=null?k.line.match(Y):null;if(T){var D={type:"if",condition:T[1].replace(/^\s+|\s+$/g,""),thenLabel:Tr(T[2],T[3],T[4]),elseLabel:"",thenBranch:[],elseBranch:[],elseIfBranches:[]};for(u=k.next,u=ar(m,u,D.thenBranch,["else","elseif","endif","end if"],t);u<m.length;){if(M.test(m[u])){u++;break}var S=_(m,u,/^(?:\[\[[^\]]*\]\]\s*)?(?:\([^)]*\)\s*)?else\s*if\s*/i,$r),U=S!=null?S.line.match($r):null;if(U){var P={condition:U[2].replace(/^\s+|\s+$/g,""),incomingLabel:Xr(U[1]),thenLabel:Tr(U[3],U[4],U[5]),body:[]};u=S.next,u=ar(m,u,P.body,["else","elseif","endif","end if"],t),D.elseIfBranches.push(P);continue}var s=m[u].match(H),$=s||m[u].match(/^else\s*(?:\((?:->)?([\s\S]*?)\))?\s*;?\s*$/i);if($){D.elseLabel=$[1]!=null?$[1].replace(/^\s+|\s+$/g,""):"",u++,u=ar(m,u,D.elseBranch,["endif","end if"],t),u<m.length&&M.test(m[u])&&u++;break}u++;break}R.push(D);continue}var G=n.match(/^while\s*\(([^)]*)\)\s*(?:is\s*\(([^)]*)\))?\s*$/i);if(G){var B={type:"while",condition:G[1].replace(/^\s+|\s+$/g,""),isLabel:G[2]!=null?G[2].replace(/^\s+|\s+$/g,""):"",endLabel:"",body:[]};if(u++,u=ar(m,u,B.body,["end while","while end"],t),u<m.length){var or=m[u].match(/^(?:end\s*while|while\s*end)\s*(?:\(([^)]*)\))?\s*;?\s*$/i);or&&(B.endLabel=or[1]!=null?or[1].replace(/^\s+|\s+$/g,""):"",u++)}R.push(B);continue}var K=n.match(/^(?:#([a-zA-Z0-9.]+)\s+)?repeat\s*(?::\s*(.*?)\s*;)?(?:\s*<<[^>]*>>)?\s*$/i);if(K){var hr={type:"repeat",label:K[2]!=null?K[2]:"",color:K[1]?"#"+K[1]:null,backward:null,body:[],condition:"",isLabel:"",notLabel:""};u++,u=ar(m,u,hr.body,["repeat while"],t);for(var vr=[],Jr=0;Jr<hr.body.length;Jr++)hr.body[Jr].type==="backward"?hr.backward==null&&(hr.backward=hr.body[Jr]):vr.push(hr.body[Jr]);if(hr.body=vr,u<m.length){var Ge=m[u].match(gr);Ge&&(hr.condition=Tr(Ge[1]),hr.isLabel=Tr(Ge[2]),hr.notLabel=Tr(Ge[3]),(Ge[4]!=null||Ge[5])&&(hr.exitArrow=Dr(Ge[4]),hr.exitArrow.label=Tr(Ge[5])),hr.testColor=d(Ge[6]),u++)}R.push(hr);continue}var no=n.match(/^(?:\(([^)]*)\)\s*)?backward\s*:\s*(.*?)\s*;(?:\s*\(([^)]*)\))?(?:\s*<<[^>]*>>)?\s*$/i);if(no){R.push({type:"backward",label:no[2],incomingLabel:Xr(no[1]),outgoingLabel:Xr(no[3])}),u++;continue}var bo=n.match(/^backward\s*:\s*(.*)$/i);if(bo&&n.charAt(n.length-1)!==";"){var Oo=[bo[1]];for(u++;u<m.length;){var We=m[u];if(We.charAt(We.length-1)===";"){Oo.push(We.substring(0,We.length-1)),u++;break}Oo.push(We),u++}R.push({type:"backward",label:Oo.join(`
-`).replace(/^\s+|\s+$/g,""),incomingLabel:"",outgoingLabel:""});continue}if(/^fork\s*;?\s*$/i.test(n)){var Tt={type:"fork",branches:[[]]};for(u++,u=ar(m,u,Tt.branches[0],["fork again","end fork","fork end","end merge"],t);u<m.length;){if(j.test(m[u])){u++;break}if(/^fork\s*again\s*;?\s*$/i.test(m[u])){var Cn=[];Tt.branches.push(Cn),u++,u=ar(m,u,Cn,["fork again","end fork","fork end","end merge"],t);continue}u++;break}R.push(Tt);continue}if(/^split\s*;?\s*$/i.test(n)){var un={type:"split",branches:[[]]};for(u++,u=ar(m,u,un.branches[0],["split again","end split","split end"],t);u<m.length;){if(/^(?:end\s*split|split\s*end)\s*;?\s*$/i.test(m[u])){u++;break}if(/^split\s*again\s*;?\s*$/i.test(m[u])){var Kt=[];un.branches.push(Kt),u++,u=ar(m,u,Kt,["split again","end split","split end"],t);continue}u++;break}R.push(un);continue}var ut=n.match(/^switch\s*\(([^)]*)\)\s*((?:<<[^>]*>>\s*)*);?\s*$/i);if(ut){var fn={type:"switch",condition:ut[1].replace(/^\s+|\s+$/g,""),color:d(ut[2]),cases:[]};for(u++;u<m.length;){if(/^end\s*switch\s*;?\s*$/i.test(m[u])){u++;break}var vt=m[u].match(/^case\s*\(([^)]*)\)\s*((?:<<[^>]*>>\s*)*);?\s*$/i);if(vt){var _o={label:vt[1].replace(/^\s+|\s+$/g,""),body:[]};u++,u=ar(m,u,_o.body,["case","end switch"],t),fn.cases.push(_o);continue}vo.droppedLine(m.config,"activity",m.lines!=null?m.lines[u]:null,m[u]),u++}R.push(fn);continue}var Zo=n.match(/^group\s+(?:"([^"]*)"|(.+?))\s*$/i);if(Zo){var jt={type:"partition",name:Zo[1]||Zo[2],body:[]};u++,u=ar(m,u,jt.body,["end group"],t),u<m.length&&/^end\s+group$/i.test(m[u])&&u++,R.push(jt);continue}var zt=n.match(/^partition\s+(?:(#\S+)\s+)?(?:"([^"]*)"|([^#\s{]+))(?:\s+(#\S+))?\s*\{\s*$/i);if(zt){var Ga={type:"partition",name:zt[2]||zt[3],color:zt[1]||zt[4]||null,body:[]};u++,u=ar(m,u,Ga.body,["}"],t),u<m.length&&m[u]==="}"&&u++,R.push(Ga);continue}var $n=n.match(/^(?:\[\[[^\]]*\]\]\s*)?(?:#([a-zA-Z0-9]+))?:(.*?)([;|/<>\]}\\])\s*((?:<<[^>]*>>\s*)*)$/);if($n){R.push(L($n[2],$n[3],$n[4],$n[1]?"#"+$n[1]:null)),u++;continue}var zn=n.match(/^[-*][ \t]?(?![-.>\[])((?:<<[^>]*>>\s*)*)(.*?)\s*((?:<<[^>]*>>\s*)*)$/);if(zn&&zn[2].replace(/^\s+|\s+$/g,"")!==""){R.push(L(zn[2],";",zn[1]+zn[3],null)),u++;continue}var Dn=n.match(/^(?:\[\[[^\]]*\]\]\s*)?(?:#([a-zA-Z0-9]+))?:(.*)$/);if(Dn&&!/[;|/<>\]}\\]\s*$/.test(n)){var xe=Dn[1]?"#"+Dn[1]:null,i=[Dn[2]],c=";",F="";for(u++;u<m.length;){var y=m[u].match(/^(.*?)([;|/<>\]}\\])\s*((?:<<[^>]*>>\s*)*)$/);if(y){i.push(y[1]),c=y[2],F=y[3],u++;break}i.push(m[u]),u++}R.push(L(i.join(`
-`),c,F,xe));continue}if(n==="}"){u++;continue}vo.droppedLine(m.config,"activity",m.lines!=null?m.lines[u]:null,m[u]),u++}return u}var Y=/^(?:\[\[[^\]]*\]\]\s*)?if\s*(?:<<[^>]*>>\s*)?\s*\(([\s\S]*?)\)\s*(?:then\s+when\s+([\s\S]+?)|then\s*(?:\(([\s\S]+?)\))?|(?:is|equals?)\s*\(([\s\S]+?)\)\s*then)?\s*;?\s*(?:<<[^>]*>>\s*)*$/i,$r=/^(?:\[\[[^\]]*\]\]\s*)?(?:\((?:->|-\[[^\]]*\]->)?([\s\S]*?)\)\s*)?else\s*if\s*(?:<<[^>]*>>\s*)?\s*\(([\s\S]*?)\)\s*(?:then\s+when\s+([\s\S]+?)|then\s*(?:\(([\s\S]+?)\))?|(?:is|equals?)\s*\(([\s\S]+?)\)\s*then)?\s*;?\s*(?:<<[^>]*>>\s*)*$/i,rr=/^\((?:->|-\[[^\]]*\]->)?[^)]*\)\s*else\s*if\s*\(/i,H=/^else\s+when\s+(.*?)\s*;?\s*$/i,M=/^end\s*if\s*;?\s*$/i,j=/^(?:end\s*fork|fork\s*end|end\s*merge)\s*;?\s*$/i,gr=new RegExp("^repeat\\s*while\\s*(?:\\(([\\s\\S]*?)\\))?\\s*(?:(?:is|equals?)\\s*\\(([^)]*)\\))?\\s*(?:not\\s*\\(([^)]*)\\))?\\s*(?:(?:-\\[([^\\]]*)\\]->|->)\\s*(.*?))?\\s*;?\\s*((?:<<[^>]*>>\\s*)*)$","i");function W(m){var u={color:null,lineColor:null},R=/<<\s*(#[^>]*?)\s*>>/.exec(m||"");if(R==null)return u;for(var o=R[1].split(";"),t=0;t<o.length;t++){var n=o[t].replace(/^\s+|\s+$/g,""),f=n.match(/^line\s*:\s*(#?[\w-]+)$/i);f?u.lineColor=f[1].charAt(0)==="#"?f[1]:"#"+f[1]:n.charAt(0)==="#"&&u.color==null&&(u.color=n)}return u}function d(m){return W(m).color}function _(m,u,R,o){if(u>=m.length||!R.test(m[u]))return null;for(var t=m[u],n=u+1;!o.test(t)&&n<m.length&&n-u<50;)t+=`
-`+m[n],n++;return o.test(t)?{line:t,next:n}:null}var p={"|":"procedure","<":"input",">":"output","/":"save","\\":"load","]":"task","}":"continuous"},E={input:1,output:1,procedure:1,load:1,save:1,continuous:1,task:1};function L(m,u,R,o){for(var t={type:"action",label:m.replace(/^\s+|\s+$/g,""),color:o,shape:p[u]||null,stereotype:null,stereotypes:[]},n=/<<\s*([^>]*?)\s*>>/g,f;(f=n.exec(R||""))!=null;){var O=f[1];if(/^#/.test(O)){t.color||(t.color=O);continue}O&&t.stereotypes.push(O),E[O.toLowerCase()]?t.shape=O.toLowerCase():O&&!t.stereotype&&(t.stereotype=O)}return t}function N(m,u){u=u||{},pr={title:null,header:null,footer:null,caption:null,legend:null};var R=q(m,u),o=[],t=[],n=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(m)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(m),f=m.match(/^skinparam\s+ArrowHeadColor\s+(\S+)\s*$/im)||m.match(/^skinparam(?:\s+\w+)?\s*\{[^}]*\bArrowHeadColor\s+(\S+)/im);return ar(R,0,o,null,t),Ba.merge({nodes:o,swimlanes:t,monochrome:n,arrowHeadColor:f?f[1].toLowerCase():null},pr)}return{parse:N}})();var vd=(function(){var pr="A-Za-z0-9_\\u00A0-\\uFFFF",q=pr+".",Xr="["+pr+"]["+q+"]*",Tr="["+q+"]+",se="(?:#\\w+[-\\\\|/]\\w+|#\\w+)",Kr="(?:#\\w+|dotted|dashed|plain|bold|hidden|norank|single|node|thickness=\\d+)(?:,(?:#\\w+|dotted|dashed|plain|bold|hidden|norank|single|node|thickness=\\d+))*",Dr="([-.]+)(?:\\[("+Kr+")\\])?(\\*|left|right|up|down|le?|ri?|up?|do?)?(?:\\[("+Kr+")\\])?([-.]*)>",ar="(?:\\[([^\\]*][^\\]]*)\\])?",Y="(?:(\\(\\*(?:top)?\\))|("+Xr+")|(?:==+)\\s*("+Tr+')\\s*(?:==+)|"([^"]+)"(?:\\s+as\\s+('+Tr+"))?)?",$r="\\s*(<<[^>]*>>)?\\s*("+se+")?\\s*(?:\\[\\[[^\\]]*\\]\\])?\\s*",rr="(?:(\\(\\*(?:top|\\d+)?\\))|(\\{)|("+Xr+")|(?:==+)\\s*("+Tr+')\\s*(?:==+)|"([^"]+)"(?:\\s+as\\s+('+Xr+"))?|(["+pr+"].*?))",H='\\s*(<<[^>]*>>)?(?:\\s+in\\s+("[^"]+"|\\S+))?\\s*('+se+")?\\s*$",M=new RegExp("^"+Y+$r+Dr+"\\s*"+ar+"\\s*"+rr+H,"i"),j=new RegExp("^"+Y+$r+Dr+"\\s*"+ar+'\\s*"([^"]*)$',"i"),gr=new RegExp('^\\s*([^"]*)"(?:\\s+as\\s+('+Xr+'))?\\s*(<<.*>>)?\\s*(?:in\\s+("[^"]+"|\\S+))?\\s*('+se+")?\\s*$","i"),W="(?:(\\(\\*(?:top)?\\))|(?:==+)\\s*("+Tr+')\\s*(?:==+)|"([^"]*)"(?:\\s+as\\s+('+Tr+"))?|("+Xr+"))?",d=new RegExp("^"+W+"\\s*(?:"+Dr+")?\\s*"+ar+'\\s*if(?:\\s*"([^"]*)"\\s*(?:as\\s+('+Tr+")\\s+)?|\\s+(.+?)\\s*)(?:then)?\\s*$","i"),_=/^else\s*$/i,p=/^end\s*if\s*$/i,E=new RegExp('^partition\\s+("[^"]+"|\\S+)\\s*('+se+"|\\w+)?\\s*(<<[^>]*>>)?\\s*(\\{)?\\s*$","i"),L=/^(?:end\s*partition|\})\s*$/i,N=new RegExp("^note\\s*(right|left|top|bottom)?\\s*(?:on|of)\\s+link\\s*("+se+")?\\s*:\\s*(.*)$","i"),m=new RegExp("^note\\s*(right|left|top|bottom)?\\s*(?:on|of)\\s+link\\s*("+se+")?\\s*$","i"),u=new RegExp("^note\\s+(right|left|top|bottom)\\s*("+se+")?\\s*:\\s*(.*)$","i"),R=new RegExp("^note\\s+(right|left|top|bottom)\\s*("+se+")?\\s*$","i"),o=/^end\s?note\s*$/i;function t(x){return x==null?"":String(x).replace(/^\s+|\s+$/g,"")}function n(x){return x==null?"":t(String(x).replace(/\[\[([^\]\s{]*)(?:\{[^}]*\})?(?:\s+([^\]]*))?\]\]/g,function(I,w,nr){return nr??""}).replace(/\s{2,}/g," "))}function f(x){return x=t(x),x.length>=2&&x.charAt(0)==='"'&&x.charAt(x.length-1)==='"'?x.substring(1,x.length-1):x}function O(x,I,w,nr,lr){x=x||"",lr=lr||"",w=(w||"").toLowerCase();var ir=null;w.indexOf("l")===0?ir="left":w.indexOf("r")===0?ir="right":w.indexOf("u")===0?ir="up":w.indexOf("d")===0&&(ir="down");var mr=(x+lr).replace(/=/g,"-");(ir==="left"||ir==="right")&&(mr=mr.replace(/-+/g,"-")),mr.length===1&&(ir==="up"||ir==="down")&&(mr=mr.charAt(0)+mr);for(var Or={length:Math.max(1,mr.length),direction:ir,constraint:w!=="*",dotted:(x+lr).indexOf(".")>=0,dashed:!1,bold:!1,hidden:!1,color:null},Qr=((I||"")+","+(nr||"")).split(","),ee=0;ee<Qr.length;ee++){var re=t(Qr[ee]).toLowerCase();re!==""&&(re.charAt(0)==="#"?Or.color=re:re==="dashed"?Or.dashed=!0:re==="dotted"?Or.dotted=!0:re==="bold"?Or.bold=!0:re==="hidden"&&(Or.hidden=!0))}return Or}function g(x,I,w,nr,lr){var ir=x.split(/\r\n|\r|\n/),mr=!1,Or=null,Qr=0;I.lines=[];for(var ee=0;ee<ir.length;ee++){var re=ir[ee],Yr=t(re);if(mr){re.indexOf("'/")>=0&&(mr=!1);continue}if(Or!=null){Or.test(Yr)&&(Or=null);continue}if(Qr>0){if(Yr.indexOf("{")>=0&&Qr++,Yr.indexOf("}")>=0&&Qr--,nr.skinBlock!=null&&Qr>0){var Zr=Yr.match(/^([A-Za-z][\w<>]*)\s+(.+)$/);Zr&&(w[(nr.skinBlock+Zr[1]).toLowerCase()]=t(Zr[2]))}Qr===0&&(nr.skinBlock=null);continue}if(Yr!==""){if(Yr.substring(0,2)==="/'"){Yr.indexOf("'/",2)<0&&(mr=!0);continue}if(Yr.charAt(0)!=="'"&&Yr.charAt(0)!=="!"&&!/^@(start|end)/i.test(Yr)){if(/^<style\b/i.test(Yr)){/<\/style>/i.test(Yr)||(Or=/<\/style>/i);continue}var Ee=Yr.match(/^skinparam\s+(?:(\w+)\s*)?\{\s*$/i);if(Ee){Qr=1,nr.skinBlock=Ee[1]||"";continue}var Ze=Yr.match(/^skinparam\s+([\w<>]+)\s+(.+)$/i);if(Ze){w[Ze[1].toLowerCase()]=t(Ze[2]);continue}if(!/^skinparam\b/i.test(Yr)){if(/^sprite\b/i.test(Yr)){/\{\s*$/.test(Yr)&&(Qr=1);continue}var eo=Yr.match(/^(?:(?:center|left|right)\s+)?title\b\s*:?\s*(.*)$/i);if(eo){eo[1]===""?Or=/^end\s*title\s*$/i:nr.title=eo[1];continue}var Gr=Yr.match(/^(?:(?:center|left|right)\s+)?(header|footer|caption|legend)\b\s*(.*)$/i);if(Gr){(Gr[2]===""||/^(?:center|left|right)\s*$/i.test(Gr[2]))&&(Or=new RegExp("^end\\s*"+Gr[1]+"\\s*$","i"));continue}if(/^(hide|show)\b/i.test(Yr)){vo.ignoredDirective(lr,"activityLegacy",ee,re);continue}/^(scale|mainframe|autonumber|url)\b/i.test(Yr)||/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(Yr)||(I.push(Yr),I.lines.push(ee))}}}}}function Q(x,I){I=I||{};var w=[],nr={},lr={title:null,skinBlock:null};g(x||"",w,nr,lr,I);var ir=[],mr={},Or=[],Qr=[],ee={},re=[],Yr=[],Zr=null,Ee=0,Ze=0,eo=0,Gr=null;function $e(){for(var xe=re.length-1;xe>=0;xe--)if(re[xe]!=null)return re[xe];return null}function Ye(xe,i,c,F){var y={id:xe,type:i,label:c??"",color:null,stereotype:null,partition:F===void 0?$e():F};return ir.push(y),mr[xe]=y,Gr!=null&&Gr.from!=null&&i!=="note"&&y.partition===Gr.group&&(s(Gr.from,xe,Gr.label,Gr.info),Gr=null),i!=="note"&&(Zr=xe),y}function Hr(xe,i,c){var F=f(xe),y=ee[F];y==null?(y={id:F,name:n(F),color:i||null,stereotype:c||null,parent:$e()},Qr.push(y),ee[F]=y):i&&!y.color&&(y.color=i),re.push(F)}function Fo(){re.length>0&&re.pop()}function k(xe){return xe[1]!=null?T():xe[2]!=null?S(xe[2],xe[2],"activity"):xe[3]!=null?S(t(xe[3]),"","bar"):xe[4]!=null?S(xe[5]!=null?xe[5]:xe[4],xe[4],"activity"):Zr}function T(){return mr.start==null?Ye("start","start",""):Zr="start","start"}function D(xe){var i=xe==null||xe===""||/^top$/i.test(xe)?"end":"end$"+xe;return mr[i]==null?Ye(i,"end",""):Zr=i,i}function S(xe,i,c,F){return mr[xe]!=null?(Zr=xe,xe):(Ye(xe,c,n(i),F),xe)}function U(xe,i,c,F,y,sr,kr,be){var dr=void 0;if(be!=null&&(Hr(be,null,null),dr=$e(),Fo()),xe!=null){var Mo=xe.match(/^\(\*(top|\d+)?\)$/i);return D(Mo?Mo[1]:null)}if(i!=null){eo++;var io="inner#"+eo,go={id:io,name:"",color:null,stereotype:null,parent:$e(),inner:!0};return Qr.push(go),ee[io]=go,re.push(io),Gr={group:io,from:null,label:"",info:null},Zr=null,null}if(c!=null)return S(c,c,"activity",dr);if(F!=null)return S(t(F),"","bar",dr);if(y!=null)return S(sr??y,y,"activity",dr);if(kr!=null){var gn=t(kr);return S(gn,gn,"activity",dr)}return null}function P(xe,i,c){var F=xe!=null?mr[xe]:null;F!=null&&(i!=null&&(F.stereotype=t(i).replace(/^<<\s*|\s*>>$/g,"")),c!=null&&(F.color=c))}function s(xe,i,c,F){if(xe==null||i==null)return null;var y={from:xe,to:i,label:n(c),length:F.length,direction:F.direction,constraint:F.constraint,dotted:F.dotted,dashed:F.dashed,bold:F.bold,hidden:F.hidden,color:F.color};return Or.push(y),y}function $(xe,i,c,F,y){if(y!=null)for(var sr=ir.length-1;sr>=0;sr--)ir[sr].type==="note"&&ir[sr].edge===y&&(delete mr[ir[sr].id],ir.splice(sr,1));Ze++;var kr="note#"+Ze,be=Ye(kr,"note",xe);return be.position=i?i.toLowerCase():null,be.color=c||null,be.target=F,be.edge=y??null,be}function G(xe){var i=1/0,c;for(c=0;c<xe.length;c++)if(t(xe[c])!==""){var F=xe[c].match(/^\s*/)[0].length;F<i&&(i=F)}isFinite(i)||(i=0);var y=[];for(c=0;c<xe.length;c++)y.push(xe[c].substring(Math.min(i,xe[c].match(/^\s*/)[0].length)).replace(/\s+$/,""));return y}for(var B=0;B<w.length;){var or=w[B],K;if(K=or.match(d),K){var hr;K[1]!=null?hr=T():K[2]!=null?hr=S(t(K[2]),"","bar"):K[3]!=null?hr=S(K[4]!=null?K[4]:K[3],K[3],"activity"):K[5]!=null?hr=S(K[5],K[5],"activity"):hr=Zr;var vr=K[12]!=null?K[12]:K[14]!=null?K[14]:"",Jr=K[13]!=null?K[13]:null;Jr==null&&(Ee++,Jr="#"+Ee);var Ge=mr[Jr];Ge==null?Ge=Ye(Jr,"branch",""):Zr=Jr,Ge.condition=n(vr),Yr.push(Jr);var no=K[6]!=null?O(K[6],K[7],K[8],K[9],K[10]):{length:2,direction:null,constraint:!0,dotted:!1,dashed:!1,bold:!1,hidden:!1,color:null};hr!=null&&s(hr,Jr,K[11],no),Zr=Jr,B++;continue}if(_.test(or)){Yr.length>0&&(Zr=Yr[Yr.length-1]),B++;continue}if(p.test(or)){Yr.length>0&&Yr.pop(),B++;continue}if(K=or.match(E),K){var bo=K[1];K[4]==null&&bo.charAt(bo.length-1)==="{"&&bo.charAt(0)!=='"'&&(bo=bo.substring(0,bo.length-1));var Oo=K[2]!=null&&K[2].charAt(0)==="#"?K[2]:null;Hr(bo,Oo,K[3]),B++;continue}if(L.test(or)){Fo(),B++;continue}if(K=or.match(N),K){Or.length>0&&$(t(K[3]),K[1]||"right",K[2],null,Or.length-1),B++;continue}if(K=or.match(m),K){var We=[];for(B++;B<w.length&&!o.test(w[B]);)We.push(w[B]),B++;B<w.length&&B++,Or.length>0&&$(We.join(`
-`),K[1]||"right",K[2],null,Or.length-1);continue}if(K=or.match(u),K){var Tt=Zr??T();$(t(K[3]),K[1],K[2],Tt,null),B++;continue}if(K=or.match(R),K){var Cn=[];for(B++;B<w.length&&!o.test(w[B]);)Cn.push(w[B]),B++;B<w.length&&B++;var un=Zr??T();$(G(Cn).join(`
-`),K[1],K[2],un,null);continue}if(K=or.match(j),K&&B+1<w.length){for(var Kt=[],ut=null,fn=B+1;fn<w.length&&(ut=w[fn].match(gr),!ut);)Kt.push(w[fn]),fn++;if(ut){var vt=k(K);P(vt,K[6],K[7]);var _o=[];t(K[14])!==""&&_o.push(t(K[14]));for(var Zo=0;Zo<Kt.length;Zo++)_o.push(Kt[Zo]);t(ut[1])!==""&&_o.push(t(ut[1]));var jt=_o.join(`
-`),zt=ut[2]!=null?ut[2]:jt,Ga=void 0;ut[4]!=null&&(Hr(ut[4],null,null),Ga=$e(),Fo());var $n=S(zt,jt,"activity",Ga);Zr=$n,P($n,ut[3],ut[5]),s(vt,$n,K[13],O(K[8],K[9],K[10],K[11],K[12])),B=fn+1;continue}}if(K=or.match(M),K){var zn=k(K);if(zn!=null){P(zn,K[6],K[7]);var Dn=U(K[14],K[15],K[16],K[17],K[18],K[19],K[20],K[22]);Dn!=null?(Zr=Dn,P(Dn,K[21],K[23]),s(zn,Dn,K[13],O(K[8],K[9],K[10],K[11],K[12]))):Gr!=null&&Gr.from==null&&(Gr.from=zn,Gr.label=K[13],Gr.info=O(K[8],K[9],K[10],K[11],K[12]))}B++;continue}vo.droppedLine(I,"activityLegacy",w.lines!=null?w.lines[B]:null,w[B]),B++}return{nodes:ir,edges:Or,partitions:Qr,skin:nr,title:lr.title}}return{parse:Q}})();var pd=(function(){for(var pr=["class","interface","enum","annotation","struct","protocol","exception","entity","metaclass","stereotype"],q={},Xr=0;Xr<pr.length;Xr++)q[pr[Xr]]=!0;function Tr(o,t){var n=o.length,f=t,O="none",g="none",Q=0,x=0;for(f<n&&o[f]==="<"?(f++,f<n&&o[f]==="|"?(O="triangle",f++):O="arrow"):f<n&&o[f]==="*"?(O="diamond_filled",f++):f<n&&o[f]==="x"?f+1<n&&(o[f+1]==="-"||o[f+1]===".")&&(O="cross",f++):f<n&&o[f]==="o"?f+1<n&&(o[f+1]==="-"||o[f+1]===".")&&(O="diamond_open",f++):f<n&&o[f]==="+"?(O="plus",f++):f<n&&o[f]==="#"?(O="hash",f++):f+1<n&&o[f]==="|"&&o[f+1]==="|"?(O="doublebar",f+=2):f+1<n&&o[f]==="}"&&o[f+1]==="o"?(O="crow_zero_many",f+=2):f+1<n&&o[f]==="}"&&o[f+1]==="|"?(O="crow_one_many",f+=2):f+1<n&&o[f]==="}"&&(o[f+1]==="-"||o[f+1]===".")?(O="crow_many",f++):f+1<n&&o[f]==="|"&&o[f+1]==="o"&&(O="crow_zero_one",f+=2);f<n&&o[f]==="-";)Q++,f++;for(;f<n&&o[f]===".";)x++,f++;for(;f<n&&(o[f]==="-"||o[f]===".");)o[f]==="-"?Q++:x++,f++;if(Q+x===0)return null;f<n&&o[f]==="|"?f+1<n&&o[f+1]===">"?(g="triangle",f+=2):f+1<n&&o[f+1]==="|"?(g="doublebar",f+=2):f+1<n&&o[f+1]==="{"&&(g="crow_one_many",f+=2):f<n&&o[f]===">"?(g="arrow",f++):f<n&&o[f]==="*"?(g="diamond_filled",f++):f+1<n&&o[f]==="o"&&o[f+1]==="{"?(g="crow_zero_many",f+=2):f+1<n&&o[f]==="o"&&o[f+1]==="|"?(g="crow_zero_one",f+=2):f<n&&o[f]==="{"?(g="crow_many",f++):f<n&&o[f]==="o"?(g="diamond_open",f++):f<n&&o[f]==="x"&&(f+1>=n||o[f+1]===" "||o[f+1]===" "||o[f+1]==='"'||o[f+1]===":")?(g="cross",f++):f<n&&o[f]==="+"?(g="plus",f++):f<n&&o[f]==="#"&&(g="hash",f++);var I=x>0&&Q===0?"dotted":"solid";return{end:f,lineStyle:I,leftDeco:O,rightDeco:g,stemLen:Q+x}}function se(o,t,n){return t==="triangle"||o==="triangle"?n==="dotted"?"implements":"extends":o==="diamond_filled"||t==="diamond_filled"?"composition":o==="diamond_open"||t==="diamond_open"?"aggregation":o==="arrow"||t==="arrow"?n==="dotted"?"dependency":"association":"link"}function Kr(o,t){var n=null,f=null;switch(t){case"triangle":f="triangle";break;case"diamond_filled":f="diamond_filled";break;case"diamond_open":f="diamond_open";break;case"arrow":f="open";break;case"crow_zero_many":f="ERzeroToMany";break;case"crow_one_many":f="ERoneToMany";break;case"crow_many":f="ERmany";break;case"crow_zero_one":f="ERzeroToOne";break;case"doublebar":f="ERmandOne";break;case"cross":f="cross";break;case"plus":f="circlePlus";break;default:break}switch(o){case"triangle":n="triangle";break;case"diamond_filled":n="diamond_filled";break;case"diamond_open":n="diamond_open";break;case"arrow":n="open";break;case"crow_zero_many":n="ERzeroToMany";break;case"crow_one_many":n="ERoneToMany";break;case"crow_many":n="ERmany";break;case"crow_zero_one":n="ERzeroToOne";break;case"doublebar":n="ERmandOne";break;case"cross":n="cross";break;case"plus":n="circlePlus";break;default:break}return{fromArrow:n,toArrow:f}}function Dr(o,t){for(;t<o.length&&(o[t]===" "||o[t]===" ");)t++;if(t>=o.length)return null;if(o[t]==='"'){var n=o.indexOf('"',t+1);return n<0&&(n=o.length),{name:o.substring(t+1,n),end:n+1}}for(var f=t,O=0;f<o.length;){var g=o[f];if(g==="<")O++,f++;else if(g===">"&&O>0)O--,f++;else if(O>0)f++;else if(/[\w]/.test(g))f++;else break}return f===t?null:{name:o.substring(t,f),end:f}}function ar(o){var t=o.indexOf("<");if(t<0)return{baseName:o,generics:null};var n=o.lastIndexOf(">");return n<t?{baseName:o,generics:null}:{baseName:o.substring(0,t),generics:o.substring(t+1,n).replace(/^\s+|\s+$/g,"")}}function Y(o,t){var n=o.replace(/^\s+|\s+$/g,"");if(n==="")return null;var f=n.substring(0,2);if(n.length>=2&&n!=="..."&&(f==="--"||f===".."||f==="=="||f==="__")&&n.substring(n.length-2)===f){var O=n.length>4?n.substring(2,n.length-2).replace(/^\s+|\s+$/g,""):"",g=f.charAt(0);return new RegExp("^\\"+g+"*$").test(O)&&(O=""),{kind:"separator",style:g,title:O}}if(t&&!/^[+\-#~{]/.test(n))return{kind:"field",visibility:null,name:n,type:null,returnType:null,params:null,modifiers:[]};for(var Q=[],x=null,I=n;;){var w=I.match(/^\{(static|abstract|classifier|field|method)\}\s*/);if(w){var nr=w[1];nr==="classifier"?(nr="static",Q.push(nr)):nr==="field"||nr==="method"?x=nr:Q.push(nr),I=I.substring(w[0].length)}else break}var lr=null;if(I.length>2&&I[1]!==I[0]){var ir=I[0];(ir==="+"||ir==="-"||ir==="#"||ir==="~"||ir==="*")&&(lr=ir,I=I.substring(1).replace(/^\s*/,""))}for(;;){var mr=I.match(/^\{(static|abstract|classifier|field|method)\}\s*/);if(mr){var Or=mr[1];Or==="classifier"?(Or="static",Q.push(Or)):Or==="field"||Or==="method"?x=Or:Q.push(Or),I=I.substring(mr[0].length)}else break}var Qr=I.replace(/^\s+|\s+$/g,""),ee=I.indexOf("("),re=x==="method"||x!=="field"&&ee>=0;if(re){var Yr,Zr,Ee;if(ee>=0){Yr=I.substring(0,ee).replace(/^\s+|\s+$/g,"");var Ze=I.indexOf(")",ee);Ze<0&&(Ze=I.length),Zr=I.substring(ee+1,Ze).replace(/^\s+|\s+$/g,""),Ee=I.substring(Ze+1).replace(/^\s+|\s+$/g,"")}else Yr=I.replace(/^\s+|\s+$/g,""),Zr=null,Ee="";var eo=null,Gr=Ee.indexOf(":");return Gr>=0?eo=Ee.substring(Gr+1).replace(/^\s+|\s+$/g,""):Ee.length>0&&(eo=Ee),{kind:"method",visibility:lr,name:Yr,type:null,returnType:eo,params:Zr,modifiers:Q,text:Qr}}else{var $e=I.indexOf(":"),Ye,Hr;return $e>=0?(Ye=I.substring(0,$e).replace(/^\s+|\s+$/g,""),Hr=I.substring($e+1).replace(/^\s+|\s+$/g,"")):(Ye=I.replace(/^\s+|\s+$/g,""),Hr=null),{kind:"field",visibility:lr,name:Ye,type:Hr,returnType:null,params:null,modifiers:Q,text:Qr}}}function $r(o,t,n,f){var O=[],g=1,Q=t;for(Q=t+1;Q<o.length;Q++){var x=o[Q],I=x.replace(/^\s+|\s+$/g,"");if(I.indexOf("{")>=0&&g++,I.indexOf("}")>=0&&(g--,g<=0)){var w=I.substring(0,I.indexOf("}"));if(w.replace(/^\s+|\s+$/g,"").length>0){var nr=Y(w,f);nr&&O.push(nr)}return{members:O,endIdx:Q}}if(g===1){var lr=Y(I,f);lr&&O.push(lr)}}return{members:O,endIdx:o.length-1}}function rr(o,t){if(t.hasOwnProperty(o))return o;for(var n in t)if(t.hasOwnProperty(n)&&t[n].alias===o)return n;return o}function H(o,t,n,f){if(f.hasOwnProperty(o))return f[o];var O=ar(t||o),g={id:o,name:O.baseName,kind:"class",stereotype:null,generics:O.generics,color:null,members:[]};return f[o]=g,n.push(g),g}var M=new RegExp('^(hide|show)\\s+(?:(class|object|interface|enum|annotation|dataclass|record|abstract|protocol|struct|exception|metaclass|entity|"[^"]+"|<<.*>>|(?!empty\\s)[^\\s<>"]+)\\s+)?(?:(empty)\\s+)?(members?|attributes?|fields?|methods?|circles?|circled|stereotypes?)\\s*$',"i"),j=/^(hide|show|remove|restore|hide-class|show-class)\s+("[^"]+"|<<.*>>|\S+)\s*$/i,gr=["class","object","interface","enum","annotation","dataclass","record","abstract","protocol","struct","exception","metaclass","entity"];function W(o){var t=o.match(M);if(t){var n=t[1].toLowerCase()==="show",f=t[2],O={type:"all",value:null};if(f){var g=f.toLowerCase();gr.indexOf(g)>=0?O={type:"kind",value:g}:f.charAt(0)==="<"?O={type:"stereotype",value:f.replace(/^<<|>>$/g,"").replace(/^\s+|\s+$/g,"")}:O={type:"name",value:f.replace(/^"|"$/g,"")}}for(var Q=!!t[3],x=t[4].substring(0,3).toLowerCase(),I=x==="met"?["method"]:x==="mem"?["field","method"]:x==="cir"?["circle"]:x==="ste"?["stereotype"]:["field"],w=[],nr=0;nr<I.length;nr++)w.push({show:n,gender:O,empty:Q&&(I[nr]==="field"||I[nr]==="method"),portion:I[nr]});return w}if(t=o.match(j),t){var lr=t[1].toLowerCase();return[{show:lr==="show"||lr==="restore"||lr==="show-class",what:t[2].replace(/^"|"$/g,"")}]}return null}function d(o,t){for(var n=[],f=t+1;f<o.length;f++){var O=o[f].replace(/^\s+|\s+$/g,"");if(/^end\s*note$/i.test(O))return{text:n.join(`
-`),endIdx:f};n.push(o[f])}return{text:n.join(`
-`),endIdx:o.length-1}}function _(o,t){for(var n=[],f=t+1;f<o.length;f++){if(/^\s*\}\s*$/.test(o[f]))return{text:n.join(`
-`),endIdx:f};n.push(o[f])}return{text:n.join(`
-`),endIdx:o.length-1}}function p(o){for(var t=[],n=/<<\s*([^<>]*?)\s*>>/g,f;o&&(f=n.exec(o))!=null;)f[1]!==""&&t.push(f[1]);return t}function E(o,t){t=t||{};var n=o.split(/\r\n|\r|\n/),f=[],O={},g=[],Q=[],x=[],I=[],w=[],nr=[],lr=[],ir={};function mr(Fi,bi,Ki,ts){for(var di=Fi!=null?[Fi]:bi.indexOf(".")>0&&!/^\.|\.$|\.\./.test(bi)?bi.split("."):[bi],ns=null,Vi=0;Vi<di.length;Vi++){for(var cu=null,Ns=w.length-1;Ns>=0;Ns--)if(!w[Ns]._together){cu=x.indexOf(w[Ns]);break}for(var ds=null,gs=0;gs<x.length;gs++)if(x[gs].name===di[Vi]&&(x[gs].parentIndex==null?null:x[gs].parentIndex)===cu){ds=x[gs];break}ds==null?(ds={name:di[Vi],stereotype:Vi===di.length-1?Ki:null,classes:[],parentIndex:cu},x.push(ds)):Vi===di.length-1&&Ki&&!ds.stereotype&&(ds.stereotype=Ki),(ts||Vi<di.length-1)&&w.push(ds),ns=ds}if(di.length>1)if(ts)ns._implicitParents=di.length-1;else for(var Ws=0;Ws<di.length-1;Ws++)w.pop();return ns}for(var Or=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(o)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(o),Qr=/^skinparam\s+style\s+strictuml\s*$/im.test(o)||/^skinparam\s*\{[^}]*\bstyle\s+strictuml/im.test(o),ee=/^\s*hide\s+circle\s*$/im.test(o),re=o.match(/^skinparam\s+linetype\s+(ortho|polyline)\s*$/im),Yr=re?re[1].toLowerCase():null,Zr=o.match(/^\s*set\s+(?:namespace)?separator\s+(\S+)\s*$/im),Ee=Zr?Zr[1]:null,Ze=Ee??".",eo=!/^\s*!pragma\s+useIntermediatePackages\s+false\s*$/im.test(o),Gr=null,$e=null,Ye={header:null,footer:null,caption:null},Hr=0;Hr<n.length;Hr++){var Fo=n[Hr],k=Fo.replace(/^\s+|\s+$/g,"");if(k!==""&&k.charAt(0)!=="'"&&k.charAt(0)!=="!"){if(/^skinparam\b/i.test(k)){if(/\{\s*$/.test(k))for(var T=1;T>0&&Hr+1<n.length;){Hr++;var D=n[Hr].replace(/^\s+|\s+$/g,"");D.indexOf("{")>=0&&T++,D.indexOf("}")>=0&&T--}continue}var S=/^title\s+(.*)$/i.exec(k);if(S){Gr=S[1];continue}if(/^title\s*$/i.test(k)){var U=vo.blockEnd(n,Hr,/^\s*end\s*title\b/i);if(U>=0){Gr=n.slice(Hr+1,U).map(function(Fi){return Fi.replace(/^\s+|\s+$/g,"")}).join(`
-`),Hr=U;continue}}var P=k.match(/^legend((?:\s+(?:left|right|center|top|bottom))*)\s*$/i),s=P?null:k.match(/^legend(?:\s*:\s*|\s+)(?:"(.*)"|(\S.*))$/i);if(P||s){var $=[],G="center",B="bottom";if(s)$.push((s[1]!=null?s[1]:s[2]).replace(/\s+$/,""));else{for(var or=P[1].toLowerCase().split(/\s+/),K=0;K<or.length;K++)/^(left|right|center)$/.test(or[K])&&(G=or[K]),/^(top|bottom)$/.test(or[K])&&(B=or[K]);var hr=vo.blockEnd(n,Hr,/^\s*end\s*legend\b/i);if(hr<0){vo.droppedLine(t,"class",Hr,Fo,"opens a legend that never closes (no `end legend`)");continue}for(var vr=Hr+1;vr<hr;vr++)$.push(n[vr].replace(/^\s+|\s+$/g,""));Hr=hr}for(;$.length>0&&$[$.length-1]==="";)$.pop();for(;$.length>0&&$[0]==="";)$.shift();if($.length===0){vo.droppedLine(t,"class",Hr,Fo,'defines an empty legend (plantuml.jar answers "No legend defined")');continue}for(var Jr=-1,Ge=w.length-1;Ge>=0;Ge--)if(!w[Ge]._together){Jr=x.indexOf(w[Ge]);break}Jr>=0?I.push({position:null,target:null,method:null,text:$.join(`
-`),legend:!0,lines:$,pkgIndex:Jr}):$e={position:G,vertical:B,lines:$};continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:header|footer|caption)\b/i.test(k)){var no=Ba.take(Ye,n,Hr);if(no>=0){Hr=no;continue}}if(!/^(header|footer|caption|scale|mainframe)\b/i.test(k)&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(k)){if(/^<style>$/i.test(k)){for(;Hr+1<n.length&&(Hr++,!/^<\/?style>$/i.test(n[Hr].replace(/^\s+|\s+$/g,""))););continue}if(!/^<style>.*<\/style>$/i.test(k)){if(/^sprite\s+\$?\w+/i.test(k)){if(/\{\s*$/.test(k)){for(;Hr+1<n.length&&!/^\s*\}\s*$/.test(n[Hr+1]);)Hr++;Hr++}continue}if(/^newpage\b/i.test(k))break;if(/^(hide|show|remove|restore)(-class)?\b/i.test(k)){var bo=W(k);if(bo)for(var Oo=0;Oo<bo.length;Oo++)bo[Oo].portion?nr.push(bo[Oo]):lr.push(bo[Oo]);continue}var We=k.match(/^<>\s*([^\s<>"{}]+)\s*$/);if(We){var Tt=H(We[1],We[1],f,O);Tt.kind="diamond",Tt.name="",w.length>0&&w[w.length-1].classes.push(We[1]);continue}var Cn=k.toLowerCase();if(/^together\s*\{/i.test(k)){var un=w.length>0?w[w.length-1]:null;w.push({_together:!0,name:null,stereotype:null,classes:un?un.classes:[]});continue}var Kt=k.match(/^package\s+(?:"([^"]+)"|(\S+))(?:\s+<<\s*([^>]*)\s*>>)?(?:\s+(#\S+))?\s*(\{\s*\}|\{)?\s*$/i);if(Kt){mr(Kt[1],Kt[2],Kt[3]||null,!/\{\s*\}$/.test(Kt[5]||""));continue}var ut=k.match(/^namespace\s+(?:"([^"]+)"|(\S+))(?:\s+(#\S+))?\s*(\{\s*\}|\{)?\s*$/i);if(ut){mr(ut[1],ut[2],null,!/\{\s*\}$/.test(ut[4]||""));continue}if(k==="}"){if(w.length>0)for(var fn=w.pop(),vt=fn._implicitParents||0;vt-- >0&&w.length>0;)w.pop();continue}var _o=k.match(/^note\s+(?:"([^"]*)"\s+)?as\s+([^\s$#]+)((?:\s+\$\w+)*)(?:\s+(#\S+))?\s*$/i);if(_o){var Zo=_o[1];if(Zo==null){var jt=d(n,Hr);Hr=jt.endIdx,Zo=jt.text}else Zo=Zo.replace(/\\n/g,`
-`);for(var zt={position:null,target:null,method:null,text:Zo,id:_o[2],tags:(_o[3]||"").match(/\$\w+/g)?_o[3].match(/\$\w+/g).map(function(Fi){return Fi.substring(1)}):[]},Ga=w.length-1;Ga>=0;Ga--)if(!w[Ga]._together){zt.pkgIndex=x.indexOf(w[Ga]);break}I.push(zt),ir[_o[2]]=zt;continue}var $n=k.match(/^("[^"]+"|[^\s"<>.-][^\s"<>]*?)\s*(<?[-.]{1,4}>?)\s*("[^"]+"|[^\s"<>-][^\s"<>]*)\s*$/);if($n&&(ir.hasOwnProperty($n[1])||ir.hasOwnProperty($n[3]))&&/^<?[-.]+>?$/.test($n[2])){var zn=ir.hasOwnProperty($n[1]),Dn=ir[zn?$n[1]:$n[3]],xe=(zn?$n[3]:$n[1]).replace(/^"|"$/g,"");ir.hasOwnProperty(xe)||(H(xe,xe,f,O),Dn.target==null&&(Dn.target=xe,Dn.position=zn?"top":"bottom"),Dn.targets=Dn.targets||[],Dn.targets.indexOf(xe)<0&&Dn.targets.push(xe));continue}var i=k.match(/^note\s+(left|right|top|bottom)((?:\s*<<[^<>]*>>)*)(?:\s+(#[^\s\[]+))?(?:\s+\[\[([^\]]*)\]\])?\s*(?:(\{)|:\s*(.*))?$/i);if(i&&f.length>0){var c=i[6];if(c==null){var F=i[5]?_(n,Hr):d(n,Hr);Hr=F.endIdx,c=F.text}I.push({position:i[1].toLowerCase(),target:f[f.length-1].id,method:null,stereotypes:p(i[2]),color:i[3]||null,url:i[4]||null,text:c.replace(/^\s+|\s+$/g,"")});continue}var y=k.match(/^note\s+(left|right|top|bottom)\s+of\s+("[^"]+"|[^\s:"<]+)(?:::([^\s<]+))?((?:\s*<<[^<>]*>>)*)(?:\s+(#[^\s\[]+))?(?:\s+\[\[([^\]]*)\]\])?\s*:(?!:)\s*(.*)$/i);if(y){I.push({position:y[1].toLowerCase(),target:y[2].replace(/^"|"$/g,""),method:y[3]||null,stereotypes:p(y[4]),color:y[5]||null,url:y[6]||null,text:y[7].replace(/^\s+|\s+$/g,"")});continue}var sr=k.match(/^note\s+(left|right|top|bottom)\s+of\s+("[^"]+"|[^\s:"<]+)(?:::("[^"]+"|[^\s<]+))?((?:\s*<<[^<>]*>>)*)(?:\s+(#[^\s\[]+))?(?:\s+\[\[([^\]]*)\]\])?\s*(\{)?\s*$/i);if(sr){var kr=sr[7]?_(n,Hr):d(n,Hr);Hr=kr.endIdx,I.push({position:sr[1].toLowerCase(),target:sr[2].replace(/^"|"$/g,""),method:sr[3]?sr[3].replace(/^"|"$/g,""):null,stereotypes:p(sr[4]),color:sr[5]||null,url:sr[6]||null,text:kr.text});continue}var be=k.match(/^note(?:\s+(left|right|top|bottom))?\s+on\s+link(?:\s+(#\S+))?\s*(?::\s*(.*))?$/i);if(be){var dr=be[3];if(dr==null){var Mo=d(n,Hr);Hr=Mo.endIdx,dr=Mo.text}if(g.length===0){vo.droppedLine(t,"class",Hr,Fo,'has no link before it (plantuml.jar answers "No link defined")');continue}for(var io=I.length-1;io>=0;io--)I[io].position==="link"&&I[io].linkIndex===g.length-1&&I.splice(io,1);I.push({position:"link",target:null,method:null,color:be[2]||null,linkIndex:g.length-1,text:dr.replace(/^\s+|\s+$/g,"")});continue}var go=/^abstract\b/i.test(k)?m(k):null;if(go){var gn=go.name,On=go.generics,co=go.stereotype,Gn=go.color,lo=go.id,It=H(lo,gn,f,O);if(It.kind="abstract",It.name=gn,It.generics=On,co&&(It.stereotype=co),Gn&&(It.color=Gn),go.tags.length&&(It.tags=(It.tags||[]).concat(go.tags)),go.quoted&&(It._quoted=!0),w.length>0&&w[w.length-1].classes.push(lo),!go.brace&&Hr+1<n.length&&/^\s*\{\s*$/.test(n[Hr+1])&&(Hr++,go.brace=!0),go.brace){var Un=$r(n,Hr,!0,!1);Hr=Un.endIdx,It.members=It.members.concat(Un.members)}L(k,lo,g,f,O,w);continue}var wa=k.match(/^\(\)\s+(?:"([^"]+)"|(\S+))(?:\s+as\s+(\S+))?\s*$/);if(wa){var Ta=wa[1]||wa[2],Ea=wa[3]||Ta;if(!O.hasOwnProperty(Ea)){var Ua={id:Ea,name:Ta,kind:"circle",members:[],stereotype:null,generics:null,color:null};O[Ea]=f.length,f.push(Ua),w.length>0&&w[w.length-1].classes.push(Ea)}continue}var oa=/^(?:class|interface|enum|annotation|struct|protocol|exception|entity|metaclass|stereotype|record|dataclass|static|object)\b/i.test(k)?m(k):null;if(oa){var vn=oa.kind,Jl=oa.name,Ul=oa.generics,_l=oa.stereotype,Ma=oa.color,gl=oa.id,Ia=H(gl,Jl,f,O);if(Ia.kind=vn,Ia.name=Jl,Ia.generics=Ul,_l&&(Ia.stereotype=_l),Ma&&(Ia.color=Ma),oa.tags.length&&(Ia.tags=(Ia.tags||[]).concat(oa.tags)),oa.quoted&&(Ia._quoted=!0),w.length>0&&w[w.length-1].classes.push(gl),!oa.brace&&Hr+1<n.length&&/^\s*\{\s*$/.test(n[Hr+1])&&(Hr++,oa.brace=!0),oa.brace){var tt=$r(n,Hr,!0,vn==="enum");if(Hr=tt.endIdx,vn==="object")for(var Vn=0;Vn<tt.members.length;Vn++)tt.members[Vn].kind==="method"&&(tt.members[Vn].kind="field");Ia.members=Ia.members.concat(tt.members)}L(k,gl,g,f,O,w);continue}var sl=k.match(/^\(\s*("[^"]+"|\S+?)\s*,\s*("[^"]+"|\S+?)\s*\)\s*([-.]+)\s*("[^"]+"|\S+)\s*$/);if(!sl){var El=k.match(/^("[^"]+"|[^\s("]+)\s*([-.]+)\s*\(\s*("[^"]+"|\S+?)\s*,\s*("[^"]+"|\S+?)\s*\)\s*$/);El&&(sl=[El[0],El[3],El[4],El[2],El[1]])}if(sl){var ui=sl[1].replace(/^"|"$/g,""),rl=sl[2].replace(/^"|"$/g,""),Rl=sl[4].replace(/^"|"$/g,"");H(ui,ui,f,O),H(rl,rl,f,O),H(Rl,Rl,f,O),Q.push({a:ui,b:rl,cls:Rl});continue}var pl=k.match(/^("[^"]+"|[^\s:"<>{}()\-.](?:[^\s:"<>{}()]|::)*)\s*:(?!:)\s*(\S.*)$/);if(pl&&!/^(title|caption|header|footer|legend|skinparam|note|hide|show|remove|restore)$/i.test(pl[1])){var Al=u(pl[1].replace(/^"|"$/g,""),O,{packages:x,nsSep:Ze,stack:w});if(!Al.group){var Wa=H(Al.id,Al.id,f,O),ai=Y(pl[2],Wa.kind==="enum");if(ai&&Wa.members.push(ai),(!O.hasOwnProperty(Al.id)||Wa.members.length===1)&&w.length>0&&Wa.members.length===1){for(var Nl=w[w.length-1],xa=!1,fi=0;fi<x.length&&!xa;fi++)xa=x[fi].classes.indexOf(Al.id)>=0;!xa&&Nl.classes.indexOf(Al.id)<0&&Nl.classes.push(Al.id)}continue}}var Ni=R(k,f,O,w,{packages:x,nsSep:Ze,stack:w});if(Ni){g.push(Ni);continue}if(!/^set\s+(?:namespace)?separator\b/i.test(k)){if(/^[rh]?note\b/i.test(k)){vo.droppedNote(t,"class","note form",Hr,Fo);var Oi=/:/.test(k)?-1:vo.blockEnd(n,Hr,/^\s*end\s*[rh]?note\b/i);Oi>=0&&(Hr=Oi);continue}if(!/^allow_?mixing\s*$/i.test(k)){if(/^newpage\b/i.test(k)){vo.ignoredDirective(t,"class",Hr,Fo);continue}vo.droppedLine(t,"class",Hr,Fo)}}}}}}if(Ze.toLowerCase()!=="none"){for(var Vl={},gi=0;gi<x.length;gi++)for(var el=0;el<x[gi].classes.length;el++)Vl[x[gi].classes[el]]=!0;for(var $a=0;$a<f.length;$a++){var li=f[$a];if(!(Vl[li.id]||li._quoted||li.kind==="circle"||li.kind==="diamond")&&!(li.id.indexOf(Ze)<0)){for(var wl=li.id.split(Ze),Xa=wl.pop(),Ql=Xa===""||wl.length===0,Ll=0;Ll<wl.length&&!Ql;Ll++)wl[Ll]===""&&(Ql=!0);if(!Ql){eo||(wl=[wl.join(Ze)]);var Dl=null;for(Ll=0;Ll<wl.length;Ll++){for(var qa=-1,pi=0;pi<x.length;pi++)if(x[pi].name===wl[Ll]&&(x[pi].parentIndex==null?null:x[pi].parentIndex)===Dl){qa=pi;break}qa<0&&(x.push({name:wl[Ll],stereotype:null,classes:[],parentIndex:Dl}),qa=x.length-1),Dl=qa}x[Dl].classes.push(li.id),li.name=Xa}}}}return{classes:f,relationships:g,associationClasses:Q,packages:x,notes:I,monochrome:Or,hideCircle:ee,strictUml:Qr,hideRules:nr,hideEntities:lr,linetype:Yr,title:Gr,header:Ye.header,footer:Ye.footer,caption:Ye.caption,legend:$e}}function L(o,t,n,f,O,g){var Q=o.indexOf("{");Q>=0&&(o=o.substring(0,Q));var x=o.match(/\bextends\s+(\S+)/i);if(x){var I=x[1].replace(/,\s*$/,""),w=I;if(H(w,I,f,O),g.length>0){var nr=g[g.length-1];nr.classes.indexOf(w)<0&&nr.classes.push(w)}n.push({from:t,to:w,type:"extends",fromCardinality:null,toCardinality:null,label:null,lineStyle:"solid",fromArrow:null,toArrow:"triangle",_topId:w,_botId:t})}var lr=o.match(/\bimplements\s+(.+?)(?:\s*\{|\s*$)/i);if(lr)for(var ir=lr[1].split(/\s*,\s*/),mr=0;mr<ir.length;mr++){var Or=ir[mr].replace(/^\s+|\s+$/g,"");Or!==""&&(H(Or,Or,f,O),n.push({from:t,to:Or,type:"implements",fromCardinality:null,toCardinality:null,label:null,lineStyle:"dotted",fromArrow:null,toArrow:"triangle",_topId:Or,_botId:t}))}}var N=new RegExp('^(abstract(?:\\s+class)?|static\\s+class|class|interface|enum|annotation|struct|protocol|exception|entity|metaclass|stereotype|record|dataclass|object)\\s+(?:"([^"]+)"\\s*(?:<([^<>]*)>)?\\s+as\\s+(\\S+?)|(\\S+?)\\s+as\\s+"([^"]+)"\\s*(?:<([^<>]*)>)?|"([^"]+)"|(\\S+?))\\s*(?:<([^<>]*)>)?((?:\\s*<{2,3}[^>]*>{2,3})*)((?:\\s*\\$[\\w]+)*)\\s*(?:\\[\\[[^\\]]*\\]\\])?\\s*(#\\S+(?:\\s+##\\S+)?|##\\S+)?(?:\\s+extends\\s+[^{]+?)?(?:\\s+implements\\s+[^{]+?)?\\s*(\\{\\s*\\}|\\{)?\\s*$',"i");function m(o){var t=o.match(N);if(t==null)return null;var n=t[1].toLowerCase(),f=/^abstract/.test(n)?"abstract":/^static/.test(n)?"class":n,O=t[2]||t[6]||t[8]||null,g=t[4]||t[5]||t[9]||null,Q=O!=null;Q&&(O=O.replace(/\\n/g,`
-`));for(var x=O??g,I=g??O,w=t[3]||t[7]||t[10]||null,nr=[],lr=t[11]||"",ir,mr=/(<{2,3})\s*([^>]*?)\s*>{2,3}/g;(ir=mr.exec(lr))!=null;)ir[1].length===2&&nr.push(ir[2]);if(!Q){var Or=ar(x);Or.generics&&(x=Or.baseName,w=w||Or.generics)}return{kind:f,id:I,name:x,generics:w,stereotype:nr.length?nr.join("\xBB \xAB"):null,color:t[13]||null,tags:(t[12]||"").match(/\$\w+/g)?t[12].match(/\$\w+/g).map(function(Qr){return Qr.substring(1)}):[],quoted:Q,brace:t[14]==="{"}}function u(o,t,n){if(t.hasOwnProperty(o))return{id:o,group:!1};var f=o.replace(/^\.+/,"");if(t.hasOwnProperty(f))return{id:f,group:!1};var O=n&&n.nsSep?n.nsSep:".";if(n&&n.stack&&O.toLowerCase()!=="none"){for(var g=[],Q=0;Q<n.stack.length;Q++)!n.stack[Q]._together&&n.stack[Q].name&&g.push(n.stack[Q].name);for(var x=0;x<g.length&&f.indexOf(O)>0;x++){var I=g.slice(x).join(O)+O;if(f.indexOf(I)===0&&f.length>I.length){if(f=f.substring(I.length),t.hasOwnProperty(f))return{id:f,group:!1};break}}}if(O!=="::"&&f.indexOf("::")>0){var w=f.substring(0,f.lastIndexOf("::"));if(w)return u(w,t,n)}for(var nr=n&&n.packages?n.packages:[],lr=0;lr<nr.length;lr++)if(nr[lr].name===f&&!nr[lr]._together)return{id:f,group:!0};if(O.toLowerCase()!=="none"&&f.indexOf(O)>0){var ir=f.split(O),mr=[];if(n&&n.stack)for(var Or=n.stack.length-1;Or>=0;Or--)n.stack[Or]._together||mr.push(nr.indexOf(n.stack[Or]));mr.push(null);for(var Qr=0;Qr<mr.length;Qr++){for(var ee=mr[Qr],re=!0,Yr=0;Yr<ir.length&&re;Yr++){re=!1;for(var Zr=0;Zr<nr.length;Zr++)if(nr[Zr].name===ir[Yr]&&!nr[Zr]._together&&(nr[Zr].parentIndex==null?null:nr[Zr].parentIndex)===ee){ee=Zr,re=!0;break}}if(re)return{id:nr[ee].name,group:!0}}}var Ee=n&&n.nsSep&&n.nsSep.toLowerCase()!=="none"?n.nsSep:null,Ze=f.lastIndexOf("::"),eo=2;if(Ee&&Ee!=="::"&&f.lastIndexOf(Ee)>Ze&&(Ze=f.lastIndexOf(Ee),eo=Ee.length),Ze>0){var Gr=f.substring(Ze+eo);if(Gr&&t.hasOwnProperty(Gr))return{id:Gr,group:!1}}return{id:f,group:!1}}function R(o,t,n,f,O){o=o.replace(/^@[\d.]+\s+/,"");var g=o.match(/^(?:"([^"]+)"|(\S+))\s+\(\)([-.]+)\s+(?:"([^"]+)"|(\S+))\s*$/),Q=null,x=null;if(g)Q=g[1]||g[2],x=g[4]||g[5];else{var I=o.match(/^(?:"([^"]+)"|(\S+))\s+([-.]+)\(\)\s+(?:"([^"]+)"|(\S+))\s*$/);I&&(x=I[1]||I[2],Q=I[4]||I[5])}if(Q!=null)return H(x,x,t,n),{from:Q,to:x,type:"lollipop",fromCardinality:null,toCardinality:null,label:null,lineStyle:"solid",fromArrow:null,toArrow:null,_topId:null,_botId:null,_sameRank:!0};var w=null,nr=null,lr=!1,ir=!1;o=o.replace(/([-.])\[([^\]\[]*)\](?=[-.\w>])/,function(un,Kt,ut){for(var fn=ut.split(","),vt=0;vt<fn.length;vt++){var _o=fn[vt].replace(/^\s+|\s+$/g,"");_o.charAt(0)==="#"?w=_o:/^(dashed|dotted)$/i.test(_o)?nr=_o.toLowerCase():/^bold$/i.test(_o)?ir=!0:/^hidden$/i.test(_o)?lr=!0:/^thickness\s*=\s*\d+/i.test(_o)&&(ir=!0)}return Kt});var mr=null,Or=o.match(/([-.])(up|down|left|right|u|d|l|r)\1/i);if(Or){var Qr=Or[2].toLowerCase().charAt(0);mr=Qr==="u"?"up":Qr==="d"?"down":Qr==="l"?"left":"right"}o=o.replace(/([-.])(up|down|left|right|u|d|l|r)\1/gi,"$1$1");for(var ee=-1,re=null,Yr=0;Yr<o.length;Yr++){var Zr=o[Yr];if(Zr==="<"||Zr==="*"||Zr==="o"||Zr==="+"||Zr==="#"||Zr==="-"||Zr==="."||Zr==="|"||Zr==="}"||Zr==="x"){var Ee=Tr(o,Yr),Ze=Ee!=null&&Ee.end-Yr===1&&(Zr==="-"||Zr===".")&&Yr>0&&/^[ \t]$/.test(o[Yr-1])&&Ee.end<o.length&&/^[ \t]$/.test(o[Ee.end])&&o.substring(0,Yr).indexOf(":")<0;if(Ee!=null&&(Ee.end-Yr>=2||Ze)){var eo=Yr>0?o[Yr-1]:" ",Gr=Ee.end<o.length?o[Ee.end]:" ",$e=o.substring(Yr,Ee.end),Ye=(o.substring(0,Yr).split('"').length-1)%2===1,Hr=!Ye&&(Yr===0||eo===" "||eo===" "||eo==='"'||/[A-Za-z0-9_]/.test(eo)&&/^[<*|}#+\-.]/.test($e)&&Ee.end-Yr>=2),Fo=Ee.end>=o.length||Gr===" "||Gr===" "||Gr==='"'||Gr===":"||/[A-Za-z0-9"]/.test(Gr)&&/[-.>|*#+]$/.test($e)&&Ee.end-Yr>=2;if(Hr&&Fo){ee=Yr,re=Ee;break}}}}if(re==null)return null;var k=o.substring(0,ee).replace(/^\s+|\s+$/g,""),T=o.substring(re.end).replace(/^\s+|\s+$/g,"");k=k.replace(/\s*\[[^\]]*\]$/,""),T=T.replace(/^\[[^\]]*\]\s*/,"");var D=null,S="",U=k.match(/^(.+?)\s+"([^"]*)"$/);if(U?(S=U[1].replace(/^\s+|\s+$/g,""),D=U[2]):S=k,S==="")return null;for(var P=null,s="",$=null,G=-1,B=0;B<T.length;B++)if(T[B]===":"){if(T[B+1]===":"){B++;continue}G=B;break}G>=0&&($=T.substring(G+1).replace(/^\s+|\s+$/g,""),T=T.substring(0,G).replace(/^\s+|\s+$/g,""),$.length>=2&&$.charAt(0)==='"'&&$.charAt($.length-1)==='"'&&($=$.substring(1,$.length-1))),T=T.replace(/\s*<<[^<>]*>>\s*$/,"").replace(/^\s+|\s+$/g,"");var or=T.match(/^"([^"]*)"\s+(.+)$/);if(or?(P=or[1],s=or[2].replace(/^\s+|\s+$/g,"")):s=T,s==="")return null;S=S.replace(/^"|"$/g,""),s=s.replace(/^"|"$/g,"");var K=u(S,n,O),hr=u(s,n,O);if(S=K.id,s=hr.id,K.group||H(S,S,t,n),hr.group||H(s,s,t,n),f.length>0){var vr=f[f.length-1];vr.classes.indexOf(S)<0&&vr.classes.push(S),vr.classes.indexOf(s)<0&&vr.classes.push(s)}var Jr=se(re.leftDeco,re.rightDeco,re.lineStyle),Ge=Kr(re.leftDeco,re.rightDeco),no=!1;Jr==="extends"||Jr==="implements"||Jr==="association"||Jr==="dependency"?(re.leftDeco==="triangle"||re.leftDeco==="arrow")&&(no=!0):(Jr==="composition"||Jr==="aggregation")&&(re.rightDeco==="diamond_filled"||re.rightDeco==="diamond_open")&&(no=!0);var bo=null,Oo=null,We=!1,Tt=mr==="left"||mr==="right"?mr:null;mr==="left"||mr==="right"||mr==null&&re.stemLen<=1?We=!0:mr==="up"?(bo=s,Oo=S):(bo=S,Oo=s);var Cn=nr||re.lineStyle;return no?{from:s,to:S,type:Jr,fromCardinality:P,toCardinality:D,label:$,lineStyle:Cn,color:w,bold:ir,hidden:lr,fromArrow:Ge.toArrow,toArrow:Ge.fromArrow,_topId:bo,_botId:Oo,_sameRank:We,_side:Tt}:{from:S,to:s,type:Jr,fromCardinality:D,toCardinality:P,label:$,lineStyle:Cn,color:w,bold:ir,hidden:lr,fromArrow:Ge.fromArrow,toArrow:Ge.toArrow,_topId:bo,_botId:Oo,_sameRank:We,_side:Tt,fromGroup:K.group,toGroup:hr.group}}return{parse:E}})();var $d=(function(){for(var pr=["package","node","folder","frame","cloud","database","storage","artifact","card","rectangle","action","agent","boundary","circle","collections","control","entity","file","hexagon","label","person","queue","stack","usecase"],q={},Xr=0;Xr<pr.length;Xr++)q[pr[Xr]]=!0;for(var Tr=["component","interface","port","portin","portout"],se={},Kr=0;Kr<Tr.length;Kr++)se[Tr[Kr]]=!0;function Dr(p,E){var L=p.length,N=E,m="none",u="none",R=0,o=0;for(N<L&&p[N]==="<"?(m="filled",N++):N<L&&p[N]===")"&&N+1<L&&(p[N+1]==="-"||p[N+1]===".")&&(m="socket",N++);N<L&&p[N]==="-";)R++,N++;for(;N<L&&p[N]===".";)o++,N++;for(;N<L&&p[N]==="-";)R++,N++;for(;N<L&&p[N]===".";)o++,N++;if(R+o===0)return null;N<L&&p[N]===">"?(u="filled",N++):N<L&&p[N]==="("&&(N+1>=L||p[N+1]===" "||p[N+1]===" ")&&(u="socket",N++);var t;o>0?t="dashed":t="solid";var n;return m==="socket"||u==="socket"?n="socket":m!=="none"&&u!=="none"?n="bidirectional":u!=="none"||m!=="none"?n="open":n="none",{end:N,lineStyle:t,leftHead:m,rightHead:u,arrowHead:n,stemLen:R+o}}function ar(p){return p==null?p:String(p).replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," ")}function Y(p,E){for(;E<p.length&&(p[E]===" "||p[E]===" ");)E++;if(E>=p.length)return null;if(p[E]==="["){var L=p.indexOf("]",E+1);return L<0&&(L=p.length),{name:ar(p.substring(E+1,L)),end:L+1,kind:"bracket"}}if(p[E]===":"){var N=p.indexOf(":",E+1);if(N>E+1)return{name:ar(p.substring(E+1,N)),end:N+1,kind:"actor"}}if(p[E]==='"'){var m=p.indexOf('"',E+1);return m<0&&(m=p.length),{name:ar(p.substring(E+1,m)),end:m+1,kind:"bare"}}if(p[E]==="("&&E+1<p.length&&p[E+1]===")")return Y(p,E+2);for(var u=E;u<p.length&&/[\w]/.test(p[u]);)u++;return u===E?null:{name:p.substring(E,u),end:u,kind:"bare"}}function $r(p,E,L,N,m){if(E.hasOwnProperty(p))return p;for(var u in E)if(E.hasOwnProperty(u)&&L[E[u]].name===p)return u;var R={id:p,name:p,kind:N||"component",children:null,color:null,parent:m||null};return E[p]=L.length,L.push(R),p}function rr(p,E,L,N){var m=/-\[[^\]]*hidden[^\]]*\][a-z]*-/i.test(p),u=null,R=p.match(/[-\]](up|u|down|d|left|l|right|r)-/i);R&&(u=R[1].toLowerCase().charAt(0));var o=!1;(/\s~~+\s/.test(p)||/~~+[\s>(]/.test(p))&&(o=!0,p=p.replace(/~~+/g,function(eo){return new Array(eo.length+1).join("-")}));var t=null,n=!1,f=null,O=p.match(/-\[([^\]]*)\][a-z]*-/i);if(O)for(var g=O[1].split(","),Q=0;Q<g.length;Q++){var x=g[Q].replace(/^\s+|\s+$/g,"");x.charAt(0)==="#"?t=x:/^bold$/i.test(x)||/^thickness\s*=/i.test(x)?n=!0:/^(dashed|dotted)$/i.test(x)&&(f=x.toLowerCase())}p=p.replace(/-\[[^\]]*\](?:up|down|left|right|u|d|l|r)?-/gi,"--"),p=p.replace(/-(up|down|left|right|u|d|l|r)-/gi,"--");var I=Y(p,0);if(I==null)return null;for(var w=I.end;w<p.length&&(p[w]===" "||p[w]===" ");)w++;if(w>=p.length)return null;var nr=Dr(p,w);if(nr==null)return null;for(var lr=nr.end;lr<p.length&&(p[lr]===" "||p[lr]===" ");)lr++;var ir=Y(p,lr);if(ir==null)return null;var mr=null,Or=ir.end,Qr=p.indexOf(":",Or);Qr>=0&&(mr=p.substring(Qr+1).replace(/^\s+|\s+$/g,""),mr.length>=2&&mr.charAt(0)==='"'&&mr.charAt(mr.length-1)==='"'&&(mr=mr.substring(1,mr.length-1)),mr=mr.replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," "));var ee=I.kind==="bracket"?"component":I.kind==="actor"?"actor":"interface",re=ir.kind==="bracket"?"component":ir.kind==="actor"?"actor":"interface",Yr=$r(I.name,E,L,ee,N),Zr=$r(ir.name,E,L,re,N),Ee=Yr,Ze=Zr;return nr.leftHead!=="none"&&nr.rightHead==="none"&&(Ee=Zr,Ze=Yr,u==="r"?u="l":u==="l"?u="r":u==="u"?u="d":u==="d"&&(u="u")),{from:Ee,to:Ze,label:mr,lineStyle:f||(o?"dotted":nr.lineStyle),arrowHead:nr.arrowHead,color:t,bold:n,dir:u,hidden:m,span:Math.max(0,nr.stemLen-1)}}function H(p,E){for(var L=1,N=[],m=E+1;m<p.length;m++){for(var u=p[m].replace(/^\s+|\s+$/g,""),R=0;R<u.length;R++)if(u[R]==="{")L++;else if(u[R]==="}"&&(L--,L===0))return{endIdx:m,bodyLines:N};N.push(u)}return{endIdx:p.length-1,bodyLines:N}}function M(p,E){for(var L=E;L<p.length;L++)if(/^[^\[\]]*\]$/.test(p[L].replace(/^\s+|\s+$/g,"")))return L;return-1}function j(p,E){for(var L=E;L<p.length;L++)if(/"$/.test(p[L].replace(/^\s+|\s+$/g,"")))return L;return-1}function gr(p,E,L){for(var N=[],m=!1,u=0;u<E.length;u++){var R=E[u].replace(/^\s+|\s+$/g,"");if(!m&&/^\{\{/.test(R)&&(m=!0,vo.droppedNote(L,"component","embedded {{ }} sub-diagram",null,E[u])),m){/\}\}$/.test(R)&&(m=!1);continue}N.push(R)}p.body=N,p.name=N.join(`
-`)}function W(p,E){for(var L=[],N=E+1;N<p.length;N++){var m=p[N].replace(/^\s+|\s+$/g,"");if(/^end\s*note$/i.test(m))return{text:L.join(`
-`),endIdx:N};L.push(m)}return{text:L.join(`
-`),endIdx:p.length-1}}function d(p,E,L,N,m,u,R){for(var o=0;o<p.length;o++){var t=p[o].replace(/^\s+|\s+$/g,"");if(t!==""){if(t==="}"){if(R.togetherOpen.length>0){for(var n=R.togetherOpen.pop(),f=[],O=n.nodeCount;O<L.length;O++)L[O].parent===n.parent&&f.push(L[O].id);for(var g=n.containerCount;g<N.length;g++)N[g].parent===n.parent&&f.push(N[g].id);f.length>1&&R.togethers.push(f)}continue}if(t.charAt(0)!=="'"){if(/^<style\b/i.test(t)&&!/<\/style\s*>/i.test(t)){for(;o+1<p.length&&!/<\/style\s*>/i.test(p[o]);)o++;continue}if(!/^<\/?style\b/i.test(t)){if(t=t.replace(/<\$([\w.-]+)\{[^}]*\}>/g,"<$$$1>"),/^sprite\s+\S+\s+<svg\b/i.test(t)){for(;o+1<p.length&&!/<\/svg\s*>/i.test(p[o]);)o++;continue}if(/^sprite\s+\S+\s+\[[^\]]*\]\s*\{\s*$/i.test(t)){for(;o+1<p.length&&!/^\s*\}\s*$/.test(p[o]);)o++;continue}if(!/^sprite\b/i.test(t)&&t.charAt(0)!=="!"){if(/^skinparam\b/i.test(t)){if(/\{\s*$/.test(t)){var Q=H(p,o);o=Q.endIdx}continue}var x=/^title\s+(.+)$/i.exec(t);if(x&&R){R.title=ar(x[1]);continue}if(/^title\s*$/i.test(t)){for(var I=[],w=o+1;w<p.length&&!/^end\s*title$/i.test(p[w].replace(/^\s+|\s+$/g,""));w++)I.push(p[w].replace(/^\s+|\s+$/g,""));o=w,R&&(R.title=ar(I.join(`
-`)));continue}if(/^(hide|show|remove|restore|newpage)\b/i.test(t)){vo.ignoredDirective(R.config,"component",u==null?o:null,p[o]);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:header|footer|caption)\b/i.test(t)){var nr=Ba.take(R,p,o);if(nr>=0){o=nr;continue}}if(!(/^(header|footer|caption|scale|mainframe)\b/i.test(t)||/^set\s+(?:namespace)?separator\b/i.test(t))&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(t)){var lr=t.match(/^note\s+(left|right|top|bottom)\s+of\s+(?:"([^"]+)"|(\[[^\]]+\])|(\S+?))\s*:\s*(.*)$/i);if(lr&&R){R.notes.push({position:lr[1].toLowerCase(),target:lr[2]||(lr[3]?lr[3].slice(1,-1):lr[4]),text:lr[5].replace(/^\s+|\s+$/g,"").replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," ")});continue}var ir=t.match(/^note\s+(left|right|top|bottom)\s+of\s+(?:"([^"]+)"|(\[[^\]]+\])|(\S+))\s*$/i);if(ir&&R){var mr=W(p,o);o=mr.endIdx,R.notes.push({position:ir[1].toLowerCase(),target:ir[2]||(ir[3]?ir[3].slice(1,-1):ir[4]),text:mr.text.replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," ")});continue}var Or=t.match(/^note\s+"([^"]+)"\s+as\s+(\S+)\s*$/i);if(Or){var Qr=Or[1].replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," ");E[Or[2]]=L.length,L.push({id:Or[2],name:Qr,kind:"note",children:null,color:null,parent:u||null});continue}var ee=t.match(/^note\s+as\s+(\S+)\s*$/i);if(ee){var re=W(p,o);o=re.endIdx,E[ee[1]]=L.length,L.push({id:ee[1],name:re.text.replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," "),kind:"note",children:null,color:null,parent:u||null});continue}if(/^[rh]?note\b/i.test(t)){if(/^end\s*note$/i.test(t)||vo.droppedNote(R.config,"component","note form",u==null?o:null,p[o]),!/:/.test(t)&&!/^end\s*note$/i.test(t)){var Yr=W(p,o);o=Yr.endIdx}continue}var Zr=t.match(/^legend(?:\s+(left|right|top|bottom|center))?\s*$/i);if(Zr){for(var Ee=[],Ze=o+1;Ze<p.length;Ze++){var eo=p[Ze].replace(/^\s+|\s+$/g,"");if(/^end\s*legend$/i.test(eo))break;Ee.push(eo.replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," "))}o=Ze,R&&!R.legend&&(R.legend={position:Zr[1]?Zr[1].toLowerCase():"center",lines:Ee});continue}var Gr=t.toLowerCase();if(/^together\s*\{\s*$/i.test(t)){R.togetherOpen.push({parent:u||null,nodeCount:L.length,containerCount:N.length});continue}var $e=null,Ye=t.match(/^(package|node|folder|frame|cloud|database|storage|artifact|card|rectangle|action|agent|boundary|circle|collections|control|entity|file|hexagon|label|person|queue|stack|usecase|component|interface|actor)\s+([^\s\[\]"{}<#]+)\s*((?:<<[^>]*>>|\[\[[^\]]*\]\]|#[^\s\[]+|\s)*)(?:\[([^\[\]]*)|as\s*"([^"]*))$/i);if(Ye){var Hr=Ye[4]===void 0,Fo=Hr?j(p,o+1):M(p,o+1);if(Fo>=0){$e=[];var k=(Hr?Ye[5]:Ye[4]).replace(/^\s+|\s+$/g,"");k!==""&&$e.push(k);for(var T=o+1;T<Fo;T++)$e.push(p[T].replace(/^\s+|\s+$/g,""));var D=p[Fo].replace(/^\s+|\s+$/g,"");D=D.substring(0,D.length-1).replace(/^\s+|\s+$/g,""),D!==""&&$e.push(D),o=Fo,t=(Ye[1]+" "+Ye[2]+" "+Ye[3].replace(/\[\[[^\]]*\]\]/g,"")).replace(/\s+$/,""),Gr=t.toLowerCase()}}var S=t.match(/^(package|node|folder|frame|cloud|database|storage|artifact|card|rectangle|action|agent|boundary|circle|collections|control|entity|file|hexagon|label|person|queue|stack|usecase)\s+(.+)$/i);if(S&&!/^(?:[>~=.-]|<(?![$&]))/.test(S[2])){var U=S[1].toLowerCase(),P=S[2],s=null,$=null,G=null,B=0;if(P.charAt(0)==='"'&&P.charAt(1)==='"'){var or=P.indexOf('""',2);or<0&&(or=P.length),s=ar(P.substring(2,or)),B=or+2}else if(P.charAt(0)==='"'){var K=P.indexOf('"',1);K<0&&(K=P.length),s=ar(P.substring(1,K)),B=K+1}else{for(var hr=0;hr<P.length&&P[hr]!==" "&&P[hr]!==" "&&P[hr]!=="{";)hr++;s=P.substring(0,hr),B=hr}for(var vr=P.substring(B).replace(/^\s+/,""),Jr=null,Ge=!0;Ge;){Ge=!1;var no=vr.match(/^<<\s*([^>]*?)\s*>>(.*)/);if(no&&Jr==null){Jr=no[1],vr=no[2].replace(/^\s+/,""),Ge=!0;continue}var bo=vr.match(/^as\s+(?:"([^"]*)"|(\S+))(.*)/i);if(bo&&$==null){bo[1]!==void 0?($=s,s=ar(bo[1])):$=bo[2],vr=bo[3].replace(/^\s+/,""),Ge=!0;continue}var Oo=vr.match(/^(#\S+)(.*)/);Oo&&G==null&&(G=Oo[1],vr=Oo[2].replace(/^\s+/,""),Ge=!0)}var We=$||s,Tt=vr.indexOf("{")>=0||/\{\s*$/.test(t);if(Tt){var Cn=H(p,o);o=Cn.endIdx;var un={id:We,name:s,kind:U,children:[],color:G,stereotype:Jr,parent:u||null};N.push(un);var Kt=L.length,ut=N.length;d(Cn.bodyLines,E,L,N,m,We,R);for(var fn=Kt;fn<L.length;fn++)L[fn].parent===We&&un.children.push(L[fn].id);for(var vt=ut;vt<N.length;vt++)N[vt].parent===We&&un.children.push(N[vt].id)}else{var _o={id:We,name:s,kind:U,children:null,color:G,stereotype:Jr,parent:u||null};$e&&gr(_o,$e,R.config),E[We]=L.length,L.push(_o)}continue}var Zo=t.match(/^component\s+(.+)$/i);if(Zo){var jt=Zo[1],zt=null,Ga=null,$n=null,zn=0;if(jt.charAt(0)==='"'){var Dn=jt.indexOf('"',1);Dn<0&&(Dn=jt.length),zt=ar(jt.substring(1,Dn)),zn=Dn+1}else if(jt.charAt(0)==="["){var xe=jt.indexOf("]",1);xe<0&&(xe=jt.length),zt=ar(jt.substring(1,xe)),zn=xe+1}else{for(var i=0;i<jt.length&&jt[i]!==" "&&jt[i]!==" "&&jt[i]!=="{";)i++;zt=jt.substring(0,i),zn=i}for(var c=jt.substring(zn).replace(/^\s+/,""),F=null,y=!0;y;){y=!1;var sr=c.match(/^<<\s*([^>]*?)\s*>>(.*)/);if(sr&&F==null){F=sr[1],c=sr[2].replace(/^\s+/,""),y=!0;continue}var kr=c.match(/^as\s+(?:"([^"]*)"|(\S+))(.*)/i);if(kr&&Ga==null){kr[1]!==void 0?(Ga=zt,zt=kr[1]):Ga=kr[2],c=kr[3].replace(/^\s+/,""),y=!0;continue}var be=c.match(/^(#\S+)(.*)/);be&&$n==null&&($n=be[1],c=be[2].replace(/^\s+/,""),y=!0)}var dr=Ga||zt,Mo=c.indexOf("{")>=0||/\{\s*$/.test(t);if(Mo){var io=H(p,o);o=io.endIdx;var go={id:dr,name:zt,kind:"component",children:[],color:$n,stereotype:F,parent:u||null};N.push(go);var gn=L.length,On=N.length;d(io.bodyLines,E,L,N,m,dr,R);for(var co=gn;co<L.length;co++)L[co].parent===dr&&go.children.push(L[co].id);for(var Gn=On;Gn<N.length;Gn++)N[Gn].parent===dr&&go.children.push(N[Gn].id)}else{var lo={id:dr,name:zt,kind:"component",children:null,color:$n,stereotype:F,parent:u||null};$e&&gr(lo,$e,R.config),E[dr]=L.length,L.push(lo)}continue}var It=t.match(/^(?:interface|\(\))\s+(.+)$/i);if(It){var Un=It[1],wa=null,Ta=null,Ea=0;if(Un.charAt(0)==='"'){var Ua=Un.indexOf('"',1);Ua<0&&(Ua=Un.length),wa=Un.substring(1,Ua),Ea=Ua+1}else{for(var oa=0;oa<Un.length&&/[\w]/.test(Un[oa]);)oa++;wa=Un.substring(0,oa),Ea=oa}var vn=Un.substring(Ea).replace(/^\s+/,""),Jl=vn.match(/^as\s+(\S+)/i);Jl&&(Ta=Jl[1]);var Ul=Ta||wa;if(!E.hasOwnProperty(Ul)){var _l={id:Ul,name:wa,kind:"interface",children:null,color:null,parent:u||null};$e&&gr(_l,$e,R.config),E[Ul]=L.length,L.push(_l)}continue}var Ma=t.match(/^actor\s+(?:"([^"]+)"|(\S+))(?:\s+as\s+(\S+))?\s*(#\S+)?\s*$/i);if(Ma){var gl=Ma[1]||Ma[2],Ia=Ma[3],tt=Ma[4]||null,Vn=Ia||gl;if(!E.hasOwnProperty(Vn)){var sl={id:Vn,name:gl,kind:"actor",children:null,color:tt,parent:u||null};$e&&gr(sl,$e,R.config),E[Vn]=L.length,L.push(sl)}continue}var El=t.match(/^(port|portin|portout)\s+(\S+)/i);if(El){var ui=El[1].toLowerCase(),rl=El[2],Rl=rl;if(!E.hasOwnProperty(Rl)){var pl={id:Rl,name:rl,kind:ui,children:null,color:null,parent:u||null};E[Rl]=L.length,L.push(pl)}continue}var Al=rr(t,E,L,u);if(Al!=null){m.push(Al);continue}var Wa=Y(t,0);if(Wa!=null){var ai=t.slice(Wa.end),Nl=ai.match(/^\s*(?:<<([^>]*)>>\s*)?(?:as\s+(\S+))?\s*(?:<<([^>]*)>>\s*)?(#\S+)?\s*$/i);if(Nl&&(Wa.kind==="bracket"||/^"/.test(t))){var xa=Wa.kind==="bracket"?"component":"interface",fi=Nl[2]||null,Ni=Nl[4]||null,Oi=(Nl[1]||Nl[3]||"").replace(/^\s+|\s+$/g,"")||null;if(fi)E.hasOwnProperty(fi)||(E[fi]=L.length,L.push({id:fi,name:Wa.name,kind:xa,children:null,color:Ni,stereotype:Oi,parent:u||null}));else{var Vl=$r(Wa.name,E,L,xa,u);Ni&&E.hasOwnProperty(Vl)&&(L[E[Vl]].color=Ni),Oi&&E.hasOwnProperty(Vl)&&!L[E[Vl]].stereotype&&(L[E[Vl]].stereotype=Oi)}continue}}vo.droppedLine(R.config,"component",u==null?o:null,p[o])}}}}}}}function _(p,E){E=E||{};var L=p.split(/\r\n|\r|\n/),N=[],m={},u=[],R=[],o={notes:[],legend:null,title:null,config:E,togethers:[],togetherOpen:[],header:null,footer:null,caption:null};d(L,m,N,u,R,null,o);var t=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(p)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(p),n=p.match(/^\s*(left\s+to\s+right|top\s+to\s+bottom)\s+direction\b/im),f=n?/left/i.test(n[1])?"LR":"TB":null,O=p.match(/skinparam\s+defaultTextAlignment\s+(left|center|centre|right)/i),g="left";if(O){var Q=O[1].toLowerCase();g=Q==="centre"?"center":Q}var x=p.match(/^\s*skinparam\s+packageStyle\s+(\w+)/im),I=x?x[1].toLowerCase():null;return{nodes:N,containers:u,connections:R,notes:o.notes,legend:o.legend,title:o.title,header:o.header,footer:o.footer,caption:o.caption,monochrome:t,direction:f,textAlign:g,packageStyle:I,togethers:o.togethers}}return{parse:_}})();var gd=(function(){function pr(rr,H){var M=rr.length,j=H,gr="none",W="none",d=0,_=0;for(j+1<M&&rr[j]==="<"&&rr[j+1]==="|"?(gr="triangle",j+=2):j<M&&rr[j]==="<"?(gr="filled",j++):j<M&&rr[j]==="*"&&j+1<M&&(rr[j+1]==="-"||rr[j+1]===".")?(gr="diamond_filled",j++):j<M&&rr[j]==="o"&&j+1<M&&(rr[j+1]==="-"||rr[j+1]===".")&&(gr="diamond_open",j++);j<M&&rr[j]==="-";)d++,j++;for(;j<M&&rr[j]===".";)_++,j++;for(;j<M&&rr[j]==="-";)d++,j++;for(;j<M&&rr[j]===".";)_++,j++;if(d+_===0)return null;j+1<M&&rr[j]==="|"&&rr[j+1]===">"?(W="triangle",j+=2):j<M&&rr[j]===">"?(W="filled",j++):j<M&&(rr[j]==="*"||rr[j]==="o")&&(j+1>=M||rr[j+1]===" "||rr[j+1]===" "||rr[j+1]==='"'||rr[j+1]===":")&&(W=rr[j]==="*"?"diamond_filled":"diamond_open",j++);var p;return _>0&&d===0?p="dotted":_>0?p="dashed":p="solid",{end:j,lineStyle:p,leftHead:gr,rightHead:W}}function q(rr,H){for(;H<rr.length&&(rr[H]===" "||rr[H]===" ");)H++;if(H>=rr.length)return null;if(rr[H]==='"'){var M=rr.indexOf('"',H+1);return M<0&&(M=rr.length),{name:rr.substring(H+1,M),end:M+1}}for(var j=H;j<rr.length&&/[\w]/.test(rr[j]);)j++;return j===H?null:{name:rr.substring(H,j),end:j}}function Xr(rr,H,M){if(H.hasOwnProperty(rr))return rr;for(var j in H)if(H.hasOwnProperty(j)&&M[H[j]].name===rr)return j;var gr={id:rr,name:rr,kind:"object",attributes:[]};return H[rr]=M.length,M.push(gr),rr}function Tr(rr,H,M){var j=q(rr,0);if(j==null)return null;for(var gr=j.end;gr<rr.length&&(rr[gr]===" "||rr[gr]===" ");)gr++;if(gr>=rr.length)return null;var W=pr(rr,gr);if(W==null)return null;for(var d=W.end;d<rr.length&&(rr[d]===" "||rr[d]===" ");)d++;var _=q(rr,d);if(_==null)return null;var p=null,E=_.end,L=rr.indexOf(":",E);L>=0&&(p=rr.substring(L+1).replace(/^\s+|\s+$/g,""));var N=Xr(j.name,H,M),m=Xr(_.name,H,M),u=N,R=m;W.leftHead!=="none"&&W.rightHead==="none"&&(u=m,R=N);var o="association";return W.leftHead==="triangle"||W.rightHead==="triangle"?o="generalization":W.leftHead==="diamond_filled"||W.rightHead==="diamond_filled"||W.leftHead==="diamond_open"||W.rightHead==="diamond_open"?(o=W.leftHead==="diamond_filled"||W.rightHead==="diamond_filled"?"composition":"aggregation",W.rightHead==="diamond_filled"||W.rightHead==="diamond_open"?(u=m,R=N):(u=N,R=m)):W.leftHead==="none"&&W.rightHead==="none"&&(o="link"),{from:u,to:R,label:p,lineStyle:W.lineStyle,type:o}}function se(rr,H){for(var M=1,j=[],gr=H+1;gr<rr.length;gr++){for(var W=rr[gr].replace(/^\s+|\s+$/g,""),d=0;d<W.length;d++)if(W[d]==="{")M++;else if(W[d]==="}"&&(M--,M===0))return{endIdx:gr,bodyLines:j};M>0&&j.push(W)}return{endIdx:rr.length-1,bodyLines:j}}function Kr(rr,H){for(var M=[],j=H+1;j<rr.length;j++){var gr=rr[j].replace(/^\s+|\s+$/g,"");if(/^end\s*note$/i.test(gr))return{text:M.join(`
-`),endIdx:j};M.push(gr)}return{text:M.join(`
-`),endIdx:rr.length-1}}function Dr(rr){var H=rr.substring(0,2);if(rr.length<2||rr==="..."||H!=="--"&&H!==".."&&H!=="=="&&H!=="__"||rr.substring(rr.length-2)!==H)return null;var M=rr.length>4?rr.substring(2,rr.length-2).replace(/^\s+|\s+$/g,""):"",j=H.charAt(0);return new RegExp("^\\"+j+"*$").test(M)&&(M=""),{separator:!0,style:j,title:M}}function ar(rr){for(var H=[],M=0;M<rr.length;M++){var j=rr[M].replace(/^\s+|\s+$/g,"");if(j!==""){var gr=Dr(j);if(gr!=null){H.push(gr);continue}var W=j.indexOf("=");if(W>0){H.push({name:j.substring(0,W).replace(/^\s+|\s+$/g,""),value:j.substring(W+1).replace(/^\s+|\s+$/g,""),text:j});continue}var d=j.indexOf(":");if(d>0){H.push({name:j.substring(0,d).replace(/^\s+|\s+$/g,""),value:j.substring(d+1).replace(/^\s+|\s+$/g,""),text:j});continue}H.push({name:j,value:"",text:j})}}return H}function Y(rr){for(var H=[],M=[],j=0;j<rr.length;j++){var gr=rr[j].replace(/^\s+|\s+$/g,"");if(gr!==""){var W=gr.match(/^(.+?)\s*\*?->\s*(\S+)\s*$/);if(W&&gr.indexOf("=>")<0){H.push({key:W[1],value:""}),M.push({key:W[1],target:W[2]});continue}var d=gr.indexOf("=>");if(d>=0){var _=gr.substring(0,d).replace(/^\s+|\s+$/g,""),p=gr.substring(d+2).replace(/^\s+|\s+$/g,"");H.push({key:_,value:p})}else H.push({key:gr,value:""})}}return{entries:H,links:M}}function $r(rr,H){H=H||{};var M=rr.split(/\r\n|\r|\n/),j=[],gr={},W=[],d=[],_=[],p=[],E=[],L={title:null,header:null,footer:null,caption:null,legend:null};function N(zt,Ga){var $n={name:zt,stereotype:Ga||null,objects:[]};p.push($n),E.push($n)}function m(){return E.length>0?E[E.length-1]:null}for(var u=0;u<M.length;u++){var R=M[u],o=R.replace(/^\s+|\s+$/g,"");if(o!==""&&o.charAt(0)!=="'"&&o.charAt(0)!=="!"){var t=o.match(/^(package|namespace)\s+(?:"([^"]+)"|(\S+?))(?:\s*<<([^>]+)>>)?\s*\{\s*$/i);if(t){N(t[2]||t[3],t[4]||null);continue}if(o==="}"&&E.length>0){E.pop();continue}if(/^skinparam\b/i.test(o)){if(/\{\s*$/.test(o)){var n=se(M,u);u=n.endIdx}continue}if(/^(hide|show|remove|restore|newpage)\b/i.test(o)){vo.ignoredDirective(H,"object",u,R);continue}if(/^note\s+(?:"[^"]*"\s+)?as\s+\S+\s*(?:#[\w:;.]+)?\s*$/i.test(o)){var f=Ba.take(L,M,u);if(f>=0){u=f;continue}}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(o)){var O=Ba.take(L,M,u);if(O>=0){u=O;continue}}if(!/^(title|header|footer|caption|scale|mainframe)\b/i.test(o)&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(o)){var g=o.match(/^note\s+(left|right|top|bottom)\s+of\s+(?:"([^"]+)"|(\S+?))\s*:\s*(.*)$/i);if(g){_.push({position:g[1].toLowerCase(),target:g[2]||g[3],text:g[4].replace(/^\s+|\s+$/g,"").replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," ")});continue}var Q=o.match(/^note\s+(left|right|top|bottom)\s+of\s+(?:"([^"]+)"|(\S+))\s*$/i);if(Q){var x=Kr(M,u);u=x.endIdx,_.push({position:Q[1].toLowerCase(),target:Q[2]||Q[3],text:x.text.replace(/\\r\\n|\\n|\\r/g,`
-`).replace(/\\t/g," ")});continue}if(/^[rh]?note\b/i.test(o)){if(/^end\s*note$/i.test(o)||vo.droppedNote(H,"object","note form",u,R),!/:/.test(o)&&!/^end\s*note$/i.test(o)){var I=Kr(M,u);u=I.endIdx}continue}var w=o.match(/^map\s+(.+)$/i);if(w){var nr=w[1],lr=null,ir=null,mr=0;if(nr.charAt(0)==='"'){var Or=nr.indexOf('"',1);Or<0&&(Or=nr.length),lr=nr.substring(1,Or),mr=Or+1}else{for(var Qr=0;Qr<nr.length&&/[\w]/.test(nr[Qr]);)Qr++;lr=nr.substring(0,Qr),mr=Qr}var ee=nr.substring(mr).replace(/^\s+/,""),re=ee.match(/^as\s+(\S+)(.*)/i);re&&(ir=re[1],ee=re[2].replace(/^\s+/,""));var Yr=ir||lr,Zr=ee.indexOf("{")>=0||/\{\s*$/.test(o);if(Zr){var Ee=se(M,u);u=Ee.endIdx;var Ze=Y(Ee.bodyLines),eo={id:Yr,name:lr,entries:Ze.entries};W.push(eo),gr[Yr]=j.length,j.push({id:Yr,name:lr,kind:"map",attributes:[]});for(var Gr=0;Gr<Ze.links.length;Gr++){var $e=Xr(Ze.links[Gr].target,gr,j);d.push({from:Yr,to:$e,label:null,lineStyle:"solid",type:"association",fromRow:Ze.links[Gr].key})}}else{var Ye={id:Yr,name:lr,entries:[]};W.push(Ye),gr[Yr]=j.length,j.push({id:Yr,name:lr,kind:"map",attributes:[]})}continue}var Hr=o.match(/^object\s+(.+)$/i);if(Hr){var Fo=Hr[1],k=null,T=null,D=null,S=0;if(Fo.charAt(0)==='"'){var U=Fo.indexOf('"',1);U<0&&(U=Fo.length),k=Fo.substring(1,U),S=U+1}else{for(var P=0;P<Fo.length&&/[\w]/.test(Fo[P]);)P++;k=Fo.substring(0,P),S=P}var s=Fo.substring(S).replace(/^\s+/,""),$=s.match(/^as\s+(\S+)(.*)/i);$&&(T=$[1],s=$[2].replace(/^\s+/,""));for(var G=null,B=!0;B;){B=!1;var or=s.match(/^<<\s*([^>]*?)\s*>>(.*)/);if(or&&G==null){G=or[1],s=or[2].replace(/^\s+/,""),B=!0;continue}var K=s.match(/^(#\S+)(.*)/);K&&D==null&&(D=K[1],s=K[2].replace(/^\s+/,""),B=!0)}var hr=T||k,vr=s.indexOf("{")>=0||/\{\s*$/.test(o);if(vr){var Jr=se(M,u);u=Jr.endIdx;var Ge=ar(Jr.bodyLines);if(gr.hasOwnProperty(hr)){var bo=j[gr[hr]];bo.attributes=Ge}else{gr[hr]=j.length,j.push({id:hr,name:k,kind:"object",color:D,stereotype:G,attributes:Ge});var no=m();no&&no.objects.push(hr)}}else if(!gr.hasOwnProperty(hr)){gr[hr]=j.length,j.push({id:hr,name:k,kind:"object",color:D,stereotype:G,attributes:[]});var Oo=m();Oo&&Oo.objects.push(hr)}continue}var We=o.match(/^([^\s:"]+)\s+:(?!:)\s*(.*)$/);if(We!=null&&We[2]!==""){var Tt=We[1],Cn=We[2].replace(/\s+$/,""),un=gr.hasOwnProperty(Tt)?gr[Tt]:-1;if(un<0){un=j.length,gr[Tt]=un,j.push({id:Tt,name:Tt,kind:"object",color:null,stereotype:null,attributes:[]});var Kt=m();Kt&&Kt.objects.push(Tt)}var ut=j[un];if(ut.kind==="map"){for(var fn=null,vt=0;vt<W.length;vt++)if(W[vt].id===Tt){fn=W[vt];break}if(fn!=null){var _o=Y([Cn]);fn.entries=fn.entries.concat(_o.entries);for(var Zo=0;Zo<_o.links.length;Zo++)d.push({from:Tt,to:_o.links[Zo].target,type:"association",fromRow:_o.links[Zo].key})}}else ut.attributes=(ut.attributes||[]).concat(ar([Cn]));continue}var jt=Tr(o,gr,j);if(jt!=null){d.push(jt);continue}vo.droppedLine(H,"object",u,R)}}}return Ba.merge({objects:j,maps:W,links:d,notes:_,packages:p},L)}return{parse:$r}})();var Rd=(function(){function pr(W){var d=W.match(/<<\s*([^>]*?)\s*>>/);return d?{stereotype:d[1],rest:W.substring(0,d.index)+W.substring(d.index+d[0].length)}:null}function q(W){var d=W.match(/#([A-Za-z0-9]+)/);return d?{color:"#"+d[1],rest:W.substring(0,d.index)+W.substring(d.index+d[0].length)}:null}function Xr(W){var d=W.match(/\bas\s+(\S+)/i);return d?{alias:d[1],rest:W.substring(0,d.index)+W.substring(d.index+d[0].length)}:null}function Tr(W,d,_,p,E){if(_.hasOwnProperty(W))return{kind:"actor",id:W};if(E.hasOwnProperty(W))return{kind:"usecase",id:W};for(var L in _)if(_.hasOwnProperty(L)&&d[_[L]].name===W)return{kind:"actor",id:L};for(var N in E)if(E.hasOwnProperty(N)&&p[E[N]].name===W)return{kind:"usecase",id:N};return null}function se(W,d,_,p,E,L){return E.hasOwnProperty(W)?L&&(p[E[W]].color=L):(E[W]=p.length,p.push({id:W,name:d,stereotype:_||null,color:L||null})),W}function Kr(W){var d=/(?:^|\s)(#[A-Za-z0-9]+(?:;\S*)?)/.exec(W||"");return d?d[1]:null}function Dr(W,d,_,p,E,L){return E.hasOwnProperty(W)?L&&(p[E[W]].color=L):(E[W]=p.length,p.push({id:W,name:d,stereotype:_||null,color:L||null})),W}function ar(W,d){if(!d)return null;for(var _=W.replace(/^\s+|\s+$/g,""),p=0;p<d.length;p++)if(d[p].position==="floating"&&d[p].target===_)return d[p];return null}function Y(W){var d=null,_=null;return W=W.replace(/\s*<<\s*([^>]*?)\s*>>/,function(p,E){return d=E,""}),W=W.replace(/\s+(#[\w|\\/-]+)\s*$/,function(p,E){return _=E,""}),{token:W.replace(/^\s+|\s+$/g,""),stereotype:d,color:_}}function $r(W,d,_,p,E,L){if(!(W==null||d.stereotype==null&&d.color==null)){var N=p.hasOwnProperty(W)?_[p[W]]:L.hasOwnProperty(W)?E[L[W]]:null;N!=null&&(d.stereotype!=null&&N.stereotype==null&&(N.stereotype=d.stereotype),d.color!=null&&N.color==null&&(N.color=d.color))}}var rr={noteLink:!0};function H(W,d,_,p,E,L){W=W.replace(/([-.])\[[^\]\[]*\](?=[-.\w>|])/,"$1"),W=W.replace(/([-.])(?:up|down|left|right|u|d|l|r)([-.(])/gi,"$1$1"),W=W.replace(/([-.>])\(\d+\)/g,"$1").replace(/\(\d+\)([<.-])/g,"$1"),W=W.replace(/-\(0-/g,"--").replace(/-0\)-/g,"--"),W=W.replace(/([-.])>>/g,"$1>").replace(/<<([-.])/g,"<$1"),W=W.replace(/([\w):"\]])(<\|?[-.]+\|?>?|[-.]+\|?>|[-.]{2,}|<[-.]+)(?=[\w(:"\[])/g,"$1 $2 "),W=W.replace(/([\w):"\]])(<\|?[-.]+\|?>?|[-.]+\|?>|[-.]{2,}|<[-.]+)(?=\s)/g,"$1 $2"),W=W.replace(/(\s)(<\|?[-.]+\|?>?|[-.]+\|?>|[-.]{2,}|<[-.]+)(?=[\w(:"\[])/g,"$1$2 ");for(var N=[{re:/\s+(-+)\|>\s+/,type:"generalization",directed:!0},{re:/\s+<\|(-+)\s+/,type:"generalization",reverse:!0,directed:!0},{re:/\s+(\.+)>\s+/,type:"dependency",directed:!0},{re:/\s+<(\.+)\s+/,type:"dependency",reverse:!0,directed:!0},{re:/\s+(-+)>\s+/,type:"association",directed:!0},{re:/\s+<(-+)\s+/,type:"association",reverse:!0,directed:!0},{re:/\s+(\.{2,})\s+/,type:"dependency",directed:!1},{re:/\s+(-{2,})\s+/,type:"association",directed:!1}],m=0;m<N.length;m++){var u=N[m],R=W.match(u.re);if(R){var o=W.substring(0,R.index).replace(/^\s+|\s+$/g,""),t=W.substring(R.index+R[0].length).replace(/^\s+|\s+$/g,""),n=null,f=null,O=t.indexOf(":");if(O>=0){var g=t.substring(O+1).replace(/^\s+|\s+$/g,"");t=t.substring(0,O).replace(/^\s+|\s+$/g,"");var Q=pr(g);Q?(f=Q.stereotype,n=Q.rest.replace(/^\s+|\s+$/g,"")||null):n=g||null}var x=Y(o),I=Y(t);o=x.token,t=I.token;var w=M(o,d,_,p,E,L),nr=M(t,d,_,p,E,L);$r(w,x,d,_,p,E),$r(nr,I,d,_,p,E);var lr=ar(o,L),ir=ar(t,L);if(lr&&!ir&&nr!=null)return lr.anchor==null&&(lr.anchor=nr),(lr.links=lr.links||[]).push(nr),lr.linkType=u.type==="dependency"?"..":"--",rr;if(ir&&!lr&&w!=null)return ir.anchor==null&&(ir.anchor=w),(ir.links=ir.links||[]).push(w),ir.linkType=u.type==="dependency"?"..":"--",rr;if(w==null||nr==null)continue;var mr=u.reverse?nr:w,Or=u.reverse?w:nr;return{from:mr,to:Or,type:u.type,directed:u.directed!==!1,stereotype:f,label:n,span:Math.max(0,R[1].length-1)}}}return null}function M(W,d,_,p,E,L){if(W=W.replace(/^\s+|\s+$/g,""),W==="")return null;if(L){for(var N=0;N<L.length;N++)if(L[N].position==="floating"&&L[N].target===W)return null}var m=W.match(/^:([^:]+):\/?$/);if(m){var u=m[1].replace(/^\s+|\s+$/g,""),R=u;for(var o in _)if(_.hasOwnProperty(o)&&d[_[o]].name===u)return o;return se(R,u,null,d,_)}var t=W.match(/^\(([^)]+)\)\/?$/);if(t){var n=t[1].replace(/^\s+|\s+$/g,""),f=n;for(var O in E)if(E.hasOwnProperty(O)&&p[E[O]].name===n)return O;return Dr(f,n,null,p,E)}var g=Tr(W,d,_,p,E);return g?g.id:se(W,W,null,d,_)}function j(W,d){for(var _=[],p=d+1;p<W.length;p++){var E=W[p].replace(/^\s+|\s+$/g,"");if(E.toLowerCase()==="end note")return{text:_.join(`
-`),endIdx:p};_.push(E)}return{text:_.join(`
-`),endIdx:W.length-1}}function gr(W,d){d=d||{};for(var _=W.split(/\r\n|\r|\n/),p=[],E={},L=[],N={},m=[],u=[],R=[],o=null,t={title:null,header:null,footer:null,caption:null,legend:null},n=[],f=0;f<_.length;f++){var O=_[f],g=O.replace(/^\s+|\s+$/g,"");if(g!==""){if(/^(usecase|actor)\b/i.test(g)&&g.split('"').length%2===0)for(;f+1<_.length;){f++;var Q=_[f].replace(/^\s+|\s+$/g,"");if(g+="\\n"+Q,Q.indexOf('"')>=0)break}if(g.charAt(0)!=="'"&&g.charAt(0)!=="!"){if(/^skinparam\b/i.test(g)){if(/\{\s*$/.test(g))for(var x=1;x>0&&f+1<_.length;){f++;var I=_[f].replace(/^\s+|\s+$/g,"");I.indexOf("{")>=0&&x++,I.indexOf("}")>=0&&x--}continue}if(/^(hide|show|remove|restore|newpage)\b/i.test(g)){vo.ignoredDirective(d,"useCase",f,O);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(g)){var w=Ba.take(t,_,f);if(w>=0){f=w;continue}}if(!/^(title|header|footer|caption|scale|mainframe)\b/i.test(g)){var nr=g.match(/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i);if(nr){o=/left/i.test(nr[1])?"LR":"TB";continue}var lr=g.toLowerCase(),ir=g.match(/^(rectangle|package)\s+(?:"([^"]+)"|([^"\s{]+))(?:\s+as\s+(\S+))?\s*\{?\s*$/i);if(ir){var mr=ir[2]||ir[3],Or=ir[4]||null,Qr={name:mr,alias:Or,kind:ir[1].toLowerCase(),children:[]};m.push(Qr),n.push(Qr);continue}if(g==="}"){n.length>0&&n.pop();continue}g=g.replace(/^(actor|usecase)\/(?=\s)/i,"$1");var ee=g.match(/^actor\s+"?([^"]+?)"?\s+as\s+(\S+)(.*)$/i);if(ee){var Fo=ee[1],k=ee[2],T=ee[3]||"",D=null,S=pr(T);S&&(D=S.stereotype),se(k,Fo,D,p,E),n.length>0&&n[n.length-1].children.push(k);continue}else{if(ee=g.match(/^actor\s+"([^"]+)"(.*)$/i),ee){var re=ee[1],Yr=ee[2]||"",Zr=null,Ee=pr(Yr);Ee&&(Zr=Ee.stereotype);var Ze=re;se(Ze,re,Zr,p,E),n.length>0&&n[n.length-1].children.push(Ze);continue}if(ee=g.match(/^actor\s+(\S+)(.*)$/i),ee){var eo=ee[1],Gr=ee[2]||"",$e=null,Ye=pr(Gr);Ye&&($e=Ye.stereotype);var Hr=Gr.match(/(#\S+)/);se(eo,eo,$e,p,E,Hr?Hr[1]:null),n.length>0&&n[n.length-1].children.push(eo);continue}}g=g.replace(/^(usecase\s+)\(([^()]+)\)(?=\s)/i,'$1"$2"');var U=g.match(/^usecase\s+"([^"]+)"\s+as\s+(\S+)(.*)$/i);if(U){var We=U[1],Tt=U[2],Cn=U[3]||"",un=null,Kt=pr(Cn);Kt&&(un=Kt.stereotype),Dr(Tt,We,un,L,N,Kr(Cn)),n.length>0&&n[n.length-1].children.push(Tt);continue}else{if(U=g.match(/^usecase\s+"([^"]+)"(.*)$/i),U){var P=U[1],s=U[2]||"",$=null,G=pr(s);G&&($=G.stereotype);var B=P;Dr(B,P,$,L,N,Kr(s)),n.length>0&&n[n.length-1].children.push(B);continue}var or=g.match(/^usecase\s+(\S+)\s+as\s+"([^"]+)"(.*)$/i);if(or){var K=or[1],hr=or[2],vr=null,Jr=pr(or[3]||"");Jr&&(vr=Jr.stereotype),Dr(K,hr,vr,L,N,Kr(or[3])),n.length>0&&n[n.length-1].children.push(K);continue}if(U=g.match(/^usecase\s+(\S+)(.*)$/i),U){var Ge=U[1],no=U[2]||"",bo=null,Oo=pr(no);Oo&&(bo=Oo.stereotype),Dr(Ge,Ge,bo,L,N,Kr(no)),n.length>0&&n[n.length-1].children.push(Ge);continue}}var ut=g.match(/^:([^:]+):\/?\s*(?:as\s+(\S+))?\s*(<<[^>]*>>)?\s*(#\S+)?\s*$/);if(ut){var fn=ut[1].replace(/^\s+|\s+$/g,""),vt=ut[2]||null,_o=null;if(ut[3]){var Zo=ut[3].match(/<<\s*([^>]*?)\s*>>/);Zo&&(_o=Zo[1])}var jt=vt||fn;se(jt,fn,_o,p,E,ut[4]||null),n.length>0&&n[n.length-1].children.push(jt);continue}var zt=g.match(/^\(([^)]+)\)\/?\s*(?:as\s+(\S+))?\s*(<<[^>]*>>)?\s*(#\S+)?\s*$/);if(zt){var Ga=zt[1].replace(/^\s+|\s+$/g,""),$n=zt[2]||null,zn=null;if(zt[3]){var Dn=zt[3].match(/<<\s*([^>]*?)\s*>>/);Dn&&(zn=Dn[1])}var xe=$n||Ga;Dr(xe,Ga,zn,L,N,zt[4]||null),n.length>0&&n[n.length-1].children.push(xe);continue}var i=g.match(/^note\s+(right|left|top|bottom)\s+of\s+(.+?)\s*:\s*(.+)$/i);if(i){var c=i[1].toLowerCase(),F=i[2].replace(/^\s+|\s+$/g,""),y=i[3].replace(/^\s+|\s+$/g,""),sr=F,kr=F.match(/^:([^:]+):$/),be=F.match(/^\(([^)]+)\)$/);kr?sr=kr[1].replace(/^\s+|\s+$/g,""):be&&(sr=be[1].replace(/^\s+|\s+$/g,"")),R.push({position:c,target:sr,text:y,container:n.length>0?m.indexOf(n[n.length-1]):null});continue}var dr=g.match(/^note\s+"([^"]+)"\s+as\s+(\S+)/i);if(dr){var Mo=dr[1],io=dr[2];R.push({position:"floating",target:io,text:Mo});continue}var go=g.match(/^note\s+(right|left|top|bottom)\s+of\s+(.+)$/i);if(go){var gn=go[1].toLowerCase(),On=go[2].replace(/^\s+|\s+$/g,""),co=On.match(/^:([^:]+):$/),Gn=On.match(/^\(([^)]+)\)$/);co?On=co[1].replace(/^\s+|\s+$/g,""):Gn&&(On=Gn[1].replace(/^\s+|\s+$/g,""));var lo=j(_,f);f=lo.endIdx,R.push({position:gn,target:On,text:lo.text,container:n.length>0?m.indexOf(n[n.length-1]):null});continue}var It=H(g,p,E,L,N,R);if(It!==rr){if(It){if(n.length>0){var Un=n[n.length-1];Un.children.indexOf(It.from)<0&&(E.hasOwnProperty(It.from)||N.hasOwnProperty(It.from))&&Un.children.push(It.from),Un.children.indexOf(It.to)<0&&(E.hasOwnProperty(It.to)||N.hasOwnProperty(It.to))&&Un.children.push(It.to)}u.push(It);continue}if(/^[rh]?note\b/i.test(g)){vo.droppedNote(d,"useCase","note form",f,O);var wa=/:/.test(g)?-1:vo.blockEnd(_,f,/^\s*end\s*[rh]?note\b/i);wa>=0&&(f=wa);continue}vo.droppedLine(d,"useCase",f,O)}}}}}return Ba.merge({actors:p,usecases:L,containers:m,relationships:u,notes:R,direction:o},t)}return{parse:gr}})();var Ad=(function(){function pr(Dr,ar,Y,$r){return{label:Dr,color:ar||null,side:Y||"right",style:$r||null,stereotypes:[],children:[]}}function q(Dr){var ar=String(Dr??"").split(`
-`),Y=/^(.*?)(<<\s*(.*)\s*>>)\s*$/.exec(ar[ar.length-1]);if(Y==null)return{label:Dr,stereotypes:[]};ar[ar.length-1]=Y[1].replace(/\s+$/,"");for(var $r=[],rr=Y[2].split(/>>\s*<</),H=0;H<rr.length;H++){var M=rr[H].replace(/^<<\s*|\s*>>$/g,"").replace(/^\s+|\s+$/g,"");M!==""&&$r.push(M)}return{label:ar.join(`
-`),stereotypes:$r}}function Xr(Dr){var ar=q(Dr.label);Dr.label=ar.label,Dr.stereotypes=ar.stereotypes}function Tr(Dr){var ar=Dr.match(/^(\*+)(.*)$/)||Dr.match(/^(#+)(\s.*|_.*|\[.*|$)/);if(!ar)return null;var Y=ar[1].length,$r=ar[2],rr=null,H=null;$r.length>0&&$r.charAt(0)==="_"&&(H="leaf",$r=$r.substring(1));var M=$r.match(/^\[#([A-Za-z0-9]+)\]/);M&&(rr="#"+M[1],$r=$r.substring(M[0].length)),H==null&&$r.length>0&&$r.charAt(0)==="_"&&(H="leaf",$r=$r.substring(1));var j=$r.replace(/^\s+|\s+$/g,"");return{depth:Y,markers:ar[1],label:j,color:rr,style:H}}function se(Dr){var ar=Dr.match(/^([+-]+)(.*)$/);if(!ar)return null;var Y=ar[1],$r=Y.length,rr=Y.charAt(0)==="+"?"right":"left",H=ar[2],M=null,j=null;H.length>0&&H.charAt(0)==="_"&&(j="leaf",H=H.substring(1));var gr=H.match(/^\[#([A-Za-z0-9]+)\]/);gr&&(M="#"+gr[1],H=H.substring(gr[0].length)),j==null&&H.length>0&&H.charAt(0)==="_"&&(j="leaf",H=H.substring(1));var W=H.replace(/^\s+|\s+$/g,"");return{depth:$r,markers:Y,label:W,color:M,side:rr,style:j}}function Kr(Dr,ar){ar=ar||{};var Y=Dr.split(/\r\n|\r|\n/),$r={legend:null},rr=ar.styleSheet||kt.createSheet(),H=[],M=null,j=null,gr=null,W=null,d=null,_=null,p=[],E="right",L=null,N=0;function m(T){return L==null&&(L=T),/\*\*$/.test(T)&&(T=T.replace(/\t/g," ").replace(/^\s+|\s+$/g,"")),T=T.replace(/\t/g," "),T.indexOf(" ")<0?T.length-1:T.length>=L.length&&T.substring(T.length-L.length)===L?T.length-L.length:T.replace(/^\s+|\s+$/g,"").length===1?T.length-1:T.indexOf(L)===0?T.length-L.length:T.length-1}function u(T,D){var S=(T.match(/^[ \t]*/)||[""])[0].replace(/\t/g," "),U=m(S+D);return H.length===0?0:U}function R(T,D){if(D===0){M=T,H.push(T),p=[null,T],N=0;return}N===0&&(N=D),D=D%N===0?D/N:Math.max(1,Math.round(D/N));var S=D+1,U=S-1>=1&&S-1<p.length&&p[S-1]!=null?p[S-1]:M;for(U.children.push(T);p.length<=S;)p.push(null);p[S]=T;for(var P=S+1;P<p.length;P++)p[P]=null}var o=!1,t=null;function n(T,D,S){T==="title"?j=S:T==="caption"?d=S:T==="header"?gr={text:S,align:D||"right"}:T==="footer"&&(W={text:S,align:D||"center"})}for(var f=0;f<Y.length;f++){var O=Y[f],g=O.replace(/^\s+|\s+$/g,"");if(_!=null){new RegExp("^end\\s*"+_.kind+"\\b","i").test(g)?(n(_.kind,_.align,_.lines.join(`
-`)),_=null):_.lines.push(g);continue}if(g!==""){if(/^<style>$/i.test(g)){for(var Q=[];f+1<Y.length;){f++;var x=Y[f].replace(/^\s+|\s+$/g,"");if(/^<\/?style>$/i.test(x))break;x.charAt(0)!=="'"&&Q.push(Y[f])}rr.addBlock(Q.join(`
-`));continue}var I=/^<style>(.*)<\/style>$/i.exec(g);if(I!=null){rr.addBlock(I[1]);continue}if(!/^<style\b/i.test(g)&&g.charAt(0)!=="'"&&g.charAt(0)!=="!"){if(/^skinparam\b/i.test(g)){if(/\{\s*$/.test(g))for(var w=1;w>0&&f+1<Y.length;){f++;var nr=Y[f].replace(/^\s+|\s+$/g,"");nr.indexOf("{")>=0&&w++,nr.indexOf("}")>=0&&w--}continue}if(o){var lr=/^(.*);\s*(<<(.+)>>)?$/.exec(g);lr!=null?(t&&(t.label+=`
-`+lr[1].replace(/\s+$/,""),lr[2]!=null&&(t.label+=" "+lr[2]),Xr(t)),o=!1,t=null):t&&(t.label+=`
-`+g);continue}if(!/^scale\b/i.test(g)){if(/^legend\b/i.test(g)){var ir=Ba.take($r,Y,f);if(ir>=0){f=ir;continue}}var mr=g.match(/^(?:(center|left|right)\s+)?(title|header|footer|caption)\b\s*:?\s*(.*)$/i);if(mr!=null){var Or=mr[1]?mr[1].toLowerCase():null,Qr=mr[2].toLowerCase(),ee=mr[3].replace(/\s+$/,"");ee!==""?n(Qr,Or,ee):Qr!=="caption"&&(_={kind:Qr,align:Or,lines:[]});continue}if(/^left\s+side\b/i.test(g)){E="left";continue}if(/^right\s+side\b/i.test(g)){E="right";continue}var re=Tr(g);if(re){var Yr=E,Zr=u(Y[f],re.markers);Zr===0&&(Yr="right");var Ee=re.label,Ze=!1;Ee.length>0&&Ee.charAt(0)===":"&&(Ee=Ee.substring(1).replace(/^\s+/,""),Ee.length>0&&Ee.charAt(Ee.length-1)===";"?Ee=Ee.substring(0,Ee.length-1).replace(/\s+$/,""):Ze=!0);var eo=pr(Ee,re.color,Yr,re.style);Ze||Xr(eo),R(eo,Zr),Ze&&(o=!0,t=eo);continue}var Gr=se(g);if(Gr){var $e=Gr.side,Ye=Gr.label,Hr=!1;Ye.length>0&&Ye.charAt(0)===":"&&(Ye=Ye.substring(1).replace(/^\s+/,""),Ye.length>0&&Ye.charAt(Ye.length-1)===";"?Ye=Ye.substring(0,Ye.length-1).replace(/\s+$/,""):Hr=!0);var Fo=pr(Ye,Gr.color,$e,Gr.style);Hr||Xr(Fo),R(Fo,u(Y[f],Gr.markers)),Hr&&(o=!0,t=Fo);continue}vo.droppedLine(ar,"mindmap",f,O)}}}}if(_!=null&&n(_.kind,_.align,_.lines.join(`
-`)),t!=null&&Xr(t),H.length===0){var k=pr("",null,"right",null);k.synthetic=!0,H.push(k)}return Ba.merge({roots:H,root:H[0],title:j,header:gr,footer:W,caption:d,styleSheet:rr},$r)}return{parse:Kr}})();var md=(function(){function pr(Y,$r,rr){return{label:Y,style:$r||null,color:rr||null,side:"right",stereotypes:[],code:null,children:[]}}var q="[A-Za-z0-9_\\u00C0-\\uFFFF]+",Xr=new RegExp("^("+q+")\\s*[.-]+>\\s*("+q+")\\s*(#[A-Za-z0-9]+)?\\s*(<<.*?>>)?\\s*(?::\\s*(.*))?$"),Tr=new RegExp('^\\s+"(.*)"\\s+as\\s+('+q+")\\s*$");function se(Y){var $r=String(Y??"").split(`
-`),rr=/^(.*?)(<<\s*(.*)\s*>>)\s*$/.exec($r[$r.length-1]);if(rr==null)return{label:Y,stereotypes:[]};$r[$r.length-1]=rr[1].replace(/\s+$/,"");for(var H=[],M=rr[2].split(/>>\s*<</),j=0;j<M.length;j++){var gr=M[j].replace(/^<<\s*|\s*>>$/g,"").replace(/^\s+|\s+$/g,"");gr!==""&&H.push(gr)}return{label:$r.join(`
-`),stereotypes:H}}function Kr(Y){var $r=se(Y.label);Y.label=$r.label,Y.stereotypes=$r.stereotypes}function Dr(Y){var $r=Y.match(/^([ \t]*)([*+-]+)(.*)$/);if(!$r)return null;for(var rr=$r[1].replace(/\t/g," ")+$r[2],H=$r[3],M=null,j=null,gr=$r[2].indexOf("-")>=0?"left":"right",W=null,d;(d=H.match(/^(?:(_)|([<>])|\[#([A-Za-z0-9]+)\]|\(([A-Za-z0-9_À-￿]+)\))/))!=null;)d[1]?M="leaf":d[2]?gr=d[2]==="<"?"left":"right":d[3]?j="#"+d[3]:d[4]&&(W=d[4]),H=H.substring(d[0].length);var _=H.match(Tr);_!=null&&(W=_[2],H=_[1]);var p=H.replace(/^\s+|\s+$/g,"");return{type:rr,depth:$r[2].length,label:p,style:M,color:j,side:gr,code:W}}function ar(Y,$r){$r=$r||{};var rr=Y.split(/\r\n|\r|\n/),H=null,M={title:null,header:null,footer:null,caption:null,legend:null},j=$r.styleSheet||kt.createSheet(),gr=[],W=!1,d=null,_=null,p={},E=[];function L(Zr,Ee){return Zr.length>=Ee.length&&Zr.substring(Zr.length-Ee.length)===Ee}for(var N=0;N<rr.length;N++){var m=rr[N],u=m.replace(/^\s+|\s+$/g,"");if(u!==""){if(/^<style>$/i.test(u)){for(var R=[];N+1<rr.length;){N++;var o=rr[N].replace(/^\s+|\s+$/g,"");if(/^<\/?style>$/i.test(o))break;o.charAt(0)!=="'"&&R.push(rr[N])}j.addBlock(R.join(`
-`));continue}var t=/^<style>(.*)<\/style>$/i.exec(u);if(t!=null){j.addBlock(t[1]);continue}if(!/^<style\b/i.test(u)&&u.charAt(0)!=="'"&&u.charAt(0)!=="!"){if(/^skinparam\b/i.test(u)){if(/\{\s*$/.test(u))for(var n=1;n>0&&N+1<rr.length;){N++;var f=rr[N].replace(/^\s+|\s+$/g,"");f.indexOf("{")>=0&&n++,f.indexOf("}")>=0&&n--}continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(u)){var O=Ba.take(M,rr,N);if(O>=0){N=O;continue}}if(!/^(title|header|footer|caption|scale)\b/i.test(u)){if(W){var g=/^(.*);\s*(<<(.+)>>)?$/.exec(u);g!=null?(d&&(d.label+=`
-`+g[1].replace(/\s+$/,""),g[2]!=null&&(d.label+=" "+g[2]),Kr(d)),W=!1,d=null):d&&(d.label+=`
-`+u);continue}var Q=u.match(Xr);if(Q!=null){var x=se("x "+(Q[4]||""));E.push({from:Q[1],to:Q[2],color:Q[3]||null,stereotypes:x.stereotypes,lineIndex:N,raw:m});continue}var I=Dr(m);if(I){var w;H==null?(_=I.type,w=0):I.type.indexOf(" ")<0?w=I.type.length-1:L(I.type,_)||I.type.indexOf(_)===0?w=I.type.length-_.length:w=I.type.length-1,I.depth=Math.max(1,w)+1,H==null&&(I.depth=1);var nr=I.label,lr=!1;nr.length>0&&nr.charAt(0)===":"&&(nr=nr.substring(1).replace(/^\s+/,""),nr.length>0&&nr.charAt(nr.length-1)===";"?nr=nr.substring(0,nr.length-1).replace(/\s+$/,""):lr=!0);var ir=pr(nr,I.style,I.color);if(ir.side=I.side,ir.code=I.code,I.code!=null&&(p[I.code]=ir),lr||Kr(ir),I.depth===1)H=ir,gr=[null,H];else if(H!=null){var mr=I.depth-1;for(mr>=1&&mr<gr.length&&gr[mr]!=null?gr[mr].children.push(ir):H.children.push(ir);gr.length<=I.depth;)gr.push(null);gr[I.depth]=ir;for(var Or=I.depth+1;Or<gr.length;Or++)gr[Or]=null}lr&&(W=!0,d=ir);continue}vo.droppedLine($r,"wbs",N,m)}}}}d!=null&&Kr(d),H==null&&(H=pr("",null,null));for(var Qr=[],ee=0;ee<E.length;ee++){var re=E[ee],Yr=p.hasOwnProperty(re.from)?p.hasOwnProperty(re.to)?null:re.to:re.from;if(Yr!=null){vo.unknownReference($r,"wbs","node",Yr,re.lineIndex,re.raw);continue}Qr.push({from:re.from,to:re.to,color:re.color,stereotypes:re.stereotypes})}return Ba.merge({root:H,links:Qr,styleSheet:j},M)}return{parse:ar}})();var kd=(function(){var pr="(\\d{4}[-/]\\d{1,2}[-/]\\d{1,2})";function q(d){var _=d.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/);return _?_[1]+"-"+(_[2].length<2?"0"+_[2]:_[2])+"-"+(_[3].length<2?"0"+_[3]:_[3]):d.replace(/\//g,"-")}function Xr(d,_){return{name:d,alias:_||null,duration:0,start:null,end:null,startOffset:null,endOffset:null,after:null,afterOffset:0,afterWorking:!1,alignStart:null,endAlign:null,color:null,isMilestone:!1,isSeparator:!1,resources:[],resource:null,progress:null,predecessors:[]}}var Tr="[A-Za-z0-9_.\\u00C0-\\uFFFF]+",se=/^\[([^\[\]]+?)\]\s*-+(?:\[([^\]]*)\])?-*>\s*\[([^\[\]]+?)\]\s*$/,Kr=new RegExp("^("+Tr+")\\s*-+(?:\\[([^\\]]*)\\])?-*>\\s*("+Tr+")\\s*$");function Dr(d){var _={color:null,dashed:!1,dotted:!1,bold:!1,hidden:!1};if(d==null)return _;for(var p=d.split(/[,;]/),E=0;E<p.length;E++){var L=p[E].replace(/^\s+|\s+$/g,"");if(L!==""){var N=L.toLowerCase();if(N==="dashed")_.dashed=!0;else if(N==="dotted")_.dotted=!0;else if(N==="bold")_.bold=!0;else if(N==="hidden")_.hidden=!0;else{if(N==="plain"||N==="single"||N==="norank"||N==="node"||N.indexOf("thickness=")===0)continue;_.color=L.charAt(0)==="#"?L:"#"+L}}}return _}function ar(d){d=d.replace(/\.\s*$/,"").replace(/\s*<<[^>]*>>\s*$/,"");var _=d.match(/^(then\s+)?\[([^\]]+)\](?:\s+as\s+\[([^\]]+)\])?(?:\s+<<[^>]*>>)?(?:\s+on\s+((?:\{[^}]+\}\s*)+))?\s+(\S.*)$/i);if(_==null)return null;var p=[];if(_[4])for(var E=/\{([^}:]+)(?::\s*(\d+)%?)?\}/g,L;(L=E.exec(_[4]))!==null;)p.push({name:L[1].replace(/^\s+|\s+$/g,""),pct:L[2]?parseInt(L[2],10):100});for(var N=_[5].split(/\s+and\s+(?=(?:lasts|requires|starts|ends|happens|is|pauses|displays|links)\b)/i),m=[],u=0;u<N.length;u++){var R=j(N[u].replace(/^\s+|\s+$/g,""));R!=null&&m.push(R)}return{then:_[1]!=null,name:_[2],alias:_[3]||null,resource:p.length>0?p[0].name:null,resources:p,clauses:m}}var Y=new RegExp("^"+pr+"$"),$r={january:"01",february:"02",march:"03",april:"04",may:"05",june:"06",july:"07",august:"08",september:"09",october:"10",november:"11",december:"12"};function rr(d){if(d=d.replace(/^(?:at|on|the)\s+/i,"").replace(/\.\s*$/,""),Y.test(d))return q(d);var _=d.match(/^(\d+)(?:st|nd|rd|th)\s+of\s+([A-Za-z]+)\s+(\d{4})$/i);return _!=null&&$r.hasOwnProperty(_[2].toLowerCase())?_[3]+"-"+$r[_[2].toLowerCase()]+"-"+(_[1].length<2?"0"+_[1]:_[1]):null}function H(d){d=d.replace(/^\s+|\s+$/g,"");var _=rr(d);if(_)return{date:_};var p=d.match(/^([dDtTeE])([-+])(\d+)$/);return p?{anchor:p[1].toUpperCase(),offset:parseInt(p[2]+p[3],10)}:null}function M(d){var _;if((_=d.match(/^(.+?)\s+to\s+(.+)$/i))!=null){var p=H(_[1]),E=H(_[2]);if(p&&E)return{from:p,to:E}}if((_=d.match(/^(.+?)\s+and\s+(\d+)\s+days?$/i))!=null){var L=H(_[1]);if(L)return{from:L,to:{days:parseInt(_[2],10)}}}if((_=d.match(/^then\s+(\d+)\s+days?$/i))!=null)return{from:{afterPrev:!0},to:{days:parseInt(_[1],10)}};var N=H(d);return N?{from:N,to:N}:null}function j(d){var _;if((_=d.match(/^(?:lasts|requires)\s+(\d+)\s+(days?|weeks?|hours?)(?:\s+(?:and\s+)?(\d+)\s+(?:hours?|minutes?))?$/i))!=null){var p=parseInt(_[1],10),E=/week/i.test(_[2])?p*7:/hour/i.test(_[2])?Math.ceil(p/24):p;return _[3]!=null&&(E+=Math.ceil(parseInt(_[3],10)/24)),{kind:"duration",days:Math.max(1,E)}}if((_=d.match(/^(starts|ends|happens)\s+(.+)$/i))!=null){var L=_[1].toLowerCase(),N=_[2].replace(/^(?:at|on|the)\s+/i,"").replace(/^(\d{4}[-/]\d{2}[-/]\d{2})\s+\d{1,2}:\d{2}(?::\d{2})?$/,"$1"),m;return Y.test(N)?{kind:L,date:q(N)}:(m=N.match(/^(\d+)(?:st|nd|rd|th)\s+of\s+([A-Za-z]+)\s+(\d{4})$/i))!=null&&$r.hasOwnProperty(m[2].toLowerCase())?{kind:L,date:m[3]+"-"+$r[m[2].toLowerCase()]+"-"+(m[1].length<2?"0"+m[1]:m[1])}:(m=N.match(/^(\d+)\s+days?\s+after\s+start$/i))!=null?{kind:L,offset:parseInt(m[1],10)}:(m=N.match(/^D\+(\d+)$/i))!=null?{kind:L,offset:parseInt(m[1],10)}:(m=N.match(/^\[([^\]]+)\]'s\s+(start|end)$/i))!=null?{kind:L,ref:m[1],refEnd:m[2].toLowerCase()==="end"}:(m=N.match(/^(?:(\d+)\s+(working\s+)?days?\s+)?after\s+\[([^\]]+)\]'s\s+end$/i))!=null?{kind:L,ref:m[3],refEnd:!0,offset:m[1]!=null?parseInt(m[1],10):0,working:m[2]!=null}:null}return(_=d.match(/^is\s+(\d+)%\s+completed?$/i))!=null?{kind:"progress",value:parseInt(_[1],10)}:(_=d.match(/^is\s+colou?red\s+in\s+(\S+(?:\/\S+)?)$/i))!=null?{kind:"color",value:_[1]}:/^(?:pauses\b|displays\s+on\s+same\s+row\b|links\s+to\b|is\s+deleted$)/i.test(d)?{kind:"ignore"}:null}function gr(d,_){switch(_.kind){case"duration":d.duration=_.days;break;case"progress":d.progress=_.value;break;case"color":d.color=_.value;break;case"happens":d.isMilestone=!0,d.duration=0;case"starts":_.date!=null?d.start=_.date:_.ref!=null&&_.refEnd?(d.after=_.ref,d.afterOffset=_.offset||0,d.afterWorking=!!_.working):_.ref!=null?d.alignStart=_.ref:_.offset!=null&&(d.startOffset=_.offset);break;case"ends":_.date!=null?d.end=_.date:_.ref!=null&&_.refEnd?d.endAlign=_.ref:_.ref!=null?d.alignEnd=_.ref:_.offset!=null&&(d.endOffset=_.offset);break;default:break}}function W(d,_){_=_||{};var p=d.split(/\r\n|\r|\n/),E=null,L=null,N=1,m=[],u=[],R=null,o=null,t=[],n={},f=null,O=null;function g(bo){bo=q(bo),(O==null||bo<O)&&(O=bo)}for(var Q={title:null,header:null,footer:null,caption:null,legend:null},x=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(d)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(d),I=0;I<p.length;I++){var w=p[I].replace(/^\s+|\s+$/g,"");if(w!==""&&w.charAt(0)!=="'"&&w.charAt(0)!=="!"){var nr=w.match(/^project\s+starts\s+(.+)$/i);if(nr){var lr=rr(nr[1]);lr!=null&&(E=lr);continue}var ir=w.match(/^it\s+is\s+(\d+)%\s+complete\.?$/i);if(ir&&f!=null&&n.hasOwnProperty(f)){t[n[f]].progress=parseInt(ir[1],10);continue}if(!/^(?:it\s+is\b|\{[^}]+\}\s+is\s+|from\s+\d{1,2}:\d{2}\s+to\s+\d{1,2}:\d{2})/i.test(w)){var mr=w.match(/^(?:printscale|ganttscale|projectscale|project\s+scale)\s+(daily|weekly|monthly|quarterly|yearly)\b(?:\s+zoom\s+(\d+(?:\.\d+)?))?/i);if(mr){L=mr[1].toLowerCase(),mr[2]&&(N=parseFloat(mr[2]));continue}if(!/^(printscale|ganttscale|project\s+scale)\b/i.test(w)){var Or=w.match(/^(monday|tuesday|wednesday|thursday|friday|saturday|sunday)s?\s+(?:are|is)\s+closed?\b/i);if(Or){m.push(Or[1].toLowerCase());continue}if(!/^separator\b/i.test(w)){if(/^note\b/i.test(w)&&!/:/.test(w)){vo.droppedNote(_,"gantt","note",I,p[I]);var Qr=vo.blockEnd(p,I,/^\s*end\s*note\b/i);Qr>=0&&(I=Qr);continue}if(/^<style\b/i.test(w)&&!/<\/style\s*>/i.test(w)){for(;I+1<p.length&&!/<\/style\s*>/i.test(p[I+1]);)I++;I++;continue}if(/^(hide|show)\b/i.test(w)){vo.ignoredDirective(_,"gantt",I,p[I]);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(w)){var ee=Ba.take(Q,p,I);if(ee>=0){I=ee;continue}}if(!/^(language|title|header|footer|caption|legend|end\s*legend|scale|skinparam)\b/i.test(w)){var re=w.match(/^--+\s*(.*?)\s*(?:--+)?\s*$/);if(re){var Yr=Xr(re[1]||"",null);Yr.isSeparator=!0,t.push(Yr);continue}var Zr=w.match(/^today\s+is\s+(.+)$/i);if(Zr){var Ee=Zr[1].split(/\s+and\s+(?:is\s+)?/i),Ze=Ee[0].match(/^(\d+)\s+days?\s+after\s+start$/i),eo=Ze?null:rr(Ee[0]);Ze?R={offset:parseInt(Ze[1],10)}:eo&&(R={date:eo});for(var Gr=1;Gr<Ee.length;Gr++){var $e=Ee[Gr].match(/^colou?red\s+in\s+(#?\w+)/i);$e&&(o=$e[1])}continue}var Ye=w.match(/^(.+?)\s+(?:is|are)\s+((?:colou?red\s+in|named\s+\[|closed?|opene?d?)\b.*)$/i);if(Ye&&w.charAt(0)!=="["){var Hr=M(Ye[1]);if(Hr){for(var Fo={from:Hr.from,to:Hr.to,color:null,name:null,closed:null},k=Ye[2].split(/\s+and\s+(?:is\s+|are\s+)?/i),T=0;T<k.length;T++){var D=k[T],S;(S=D.match(/^colou?red\s+in\s+(#?\w+)(?:\/(#?\w+))?/i))!=null?Fo.color=S[1]:(S=D.match(/^named\s+\[([^\]]+)\]/i))!=null?Fo.name=S[1]:/^closed?\b/i.test(D)?Fo.closed=!0:/^opene?d?\b/i.test(D)&&(Fo.closed=!1)}Fo.from.date&&g(Fo.from.date),Fo.to.date&&g(Fo.to.date),u.push(Fo);continue}}if(!/^(today|close)\b/i.test(w)&&!new RegExp("^"+pr+"\\s+(?:to\\s+"+pr+"\\s+)?(?:is|are)\\s+","i").test(w)){var U=w.match(se),P=U!=null;if(U==null&&(U=w.match(Kr)),U!=null){for(var s=[U[1],U[3]],$=[],G=0;G<2&&$.length===G;G++){var B=s[G];n.hasOwnProperty(B)?$.push(n[B]):P?(n[B]=t.length,t.push(Xr(B,null)),$.push(n[B]),f=B):vo.unknownReference(_,"gantt","task",B,I,p[I])}if($.length===2){var or=Dr(U[2]);or.ref=s[0],t[$[1]].predecessors.push(or)}continue}var K=ar(w);if(K){var hr=K.alias||K.name,vr;n.hasOwnProperty(hr)?vr=n[hr]:(vr=t.length,t.push(Xr(K.name,K.alias))),n[hr]=vr,K.alias&&(n[K.name]=vr);var Jr=t[vr];K.alias&&(Jr.alias=K.alias),K.resource&&(Jr.resource=K.resource),K.resources.length>0&&(Jr.resources=K.resources);for(var Ge=0;Ge<K.clauses.length;Ge++)gr(Jr,K.clauses[Ge]);K.then&&f&&!Jr.after&&!Jr.start&&Jr.startOffset==null&&!Jr.alignStart&&(Jr.after=f),f=hr;continue}vo.droppedLine(_,"gantt",I,p[I])}}}}}}}for(var no=0;no<t.length;no++)t[no].start&&g(t[no].start),t[no].end&&g(t[no].end);return E==null&&O!=null&&(E=O),Ba.merge({projectStart:E,printScale:L,zoom:N,closedWeekdays:m,periods:u,today:R,todayColor:o,tasks:t,monochrome:x},Q)}return{parse:W}})();var _d=(function(){function pr(q,Xr){Xr=Xr||{};var Tr=q.split(/\r\n|\r|\n/),se=[],Kr={title:null,header:null,footer:null,caption:null,legend:null},Dr={},ar=0,Y=-1,$r=[],rr=[],H=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(q)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(q),M=[],j={},gr=[],W=null,d="automatic",_="decimal",p=null;function E($e){M.indexOf($e)<0&&M.push($e)}function L($e){var Ye=$e.match(/^:([^\s+\-]+)([+\-][.\d]+)?$/);if(Ye)return j.hasOwnProperty(Ye[1])?j[Ye[1]]+(Ye[2]?parseFloat(Ye[2]):0):null;var Hr=$e.match(/^(\d+)\/(\d+)\/(\d+)$/);if(Hr)return _==="decimal"&&(_="date"),Date.UTC(parseInt(Hr[1],10),parseInt(Hr[2],10)-1,parseInt(Hr[3],10))/1e3;var Fo=$e.match(/^(\d+):(\d+):(\d+)$/);return Fo?(_==="decimal"&&(_="hour"),parseInt(Fo[1],10)*3600+parseInt(Fo[2],10)*60+parseInt(Fo[3],10)):/^[+\-]?\d+(?:\.\d+)?$/.test($e)?$e.charAt(0)==="+"?ar+parseFloat($e):parseFloat($e):null}function N($e,Ye){var Hr=Ye.replace(/^\s+|\s+$/g,"").replace(/\s*:\s*[^:]*$/,""),Fo=/^\{hidden\}$/i.test(Hr);return(Fo||Hr==='""')&&(Hr=""),{time:$e,state:Hr,hidden:Fo}}for(var m=0;m<Tr.length;m++){var u=Tr[m].replace(/^\s+|\s+$/g,"");if(u!==""&&u.charAt(0)!=="'"&&u.charAt(0)!=="!"){if(/^skinparam\b/i.test(u)){if(/\{\s*$/.test(u))for(var R=1;R>0&&m+1<Tr.length;){m++;var o=Tr[m].replace(/^\s+|\s+$/g,"");o.indexOf("{")>=0&&R++,o.indexOf("}")>=0&&R--}continue}var t=u.match(/^scale\s+(\d+)\s*(?:[smhdDyY])?\s+as\s+(\d+)\s+pixels?\s*$/i);if(t){W={tick:parseInt(t[1],10),pixel:parseInt(t[2],10)};continue}var n=u.match(/^(hide|manual)\s+time.?axis\s*$/i);if(n){d=n[1].toLowerCase()==="hide"?"hidden":"manual";continue}var f=u.match(/^use\s*date\s*format\s*"([^"]+)"\s*$/i);if(f){p=f[1];continue}if(/^(hide|show)\b/i.test(u)){vo.ignoredDirective(Xr,"timing",m,Tr[m]);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(u)){var O=Ba.take(Kr,Tr,m);if(O>=0){m=O;continue}}if(!/^(title|header|footer|caption|scale)\b/i.test(u)){var g=u.match(/^([A-Za-z_][\w.]*)(?:@(\S+))?\s*-+(?:\[[^\]]*\])?>\s*([A-Za-z_][\w.]*)(?:@(\S+))?\s*(?::\s*(.*))?$/);if(g&&Dr.hasOwnProperty(g[1])&&Dr.hasOwnProperty(g[3])){var Q=g[2]!=null?L(g[2]):ar,x=g[4]!=null?L(g[4]):ar;Q!=null&&x!=null&&gr.push({from:Dr[g[1]],fromTime:Q,to:Dr[g[3]],toTime:x,label:g[5]?g[5].replace(/^\s+|\s+$/g,""):""});continue}var I=u.match(/^(?:compact\s+)?(robust|concise|rectangle|analog|binary|clock)\s+(?:"([^"]+)"|([^\s"]+))(?:\s+<<[^>]*>>)?(?:\s+(?:from|between)\s+(\S+)\s+(?:to|and)\s+(\S+))?(?:\s+as\s+(\S+))?(?:\s+<<[^>]*>>)?(?:\s+with\s+period\s+(\d+))?(?:\s+pulse\s+(\d+))?(?:\s+offset\s+(\d+))?\s*$/i);if(I){var w=I[1].toLowerCase(),nr=I[2]!=null?I[2]:I[3],lr=I[6]||nr,ir={name:nr,alias:lr,kind:w==="analog"?"robust":w,transitions:[]};w==="analog"&&(ir.analog=!0),w==="clock"&&(ir.period=I[7]?parseInt(I[7],10):100),Dr[lr]=se.length,Dr[nr]=se.length,se.push(ir);continue}if(!/^\S+\s+has\s+\S/i.test(u)){var mr=u.match(/^highlight\s+([+\-]?\d+)\s+to\s+([+\-]?\d+)(?:\s+(#\S+))?(?:\s*:\s*(.+))?$/i);if(mr){rr.push({from:parseInt(mr[1],10),to:parseInt(mr[2],10),color:mr[3]||null,label:mr[4]?mr[4].replace(/^\s+|\s+$/g,""):null});continue}var Or=u.match(/^@([+\-]?\d+)\s*<->\s*@([+\-]?\d+)\s*:\s*(.+)$/);if(Or){var Qr=parseInt(Or[1],10),ee=Or[2],re;ee.charAt(0)==="+"||ee.charAt(0)==="-"?re=Qr+parseInt(ee,10):re=parseInt(ee,10),$r.push({from:Qr,to:re,label:Or[3].replace(/^\s+|\s+$/g,"")});continue}var Yr=u.match(/^@([A-Za-z_][\w]*)\s*$/);if(Yr&&Dr.hasOwnProperty(Yr[1])){Y=Dr[Yr[1]];continue}var Zr=u.match(/^@(:?[+\-]?[\w.\/:]+(?:[+\-][.\d]+)?)(?:\s+as\s+:(\S+))?\s*$/);if(Zr&&L(Zr[1])!=null){ar=L(Zr[1]),E(ar),Zr[2]&&(j[Zr[2]]=ar);continue}var Ee=u.match(/^([+\-]?\d+(?:\.\d+)?)\s+is\s+(.+)$/i);if(Ee&&Y>=0){var Ze=Ee[1];Ze.charAt(0)==="+"||Ze.charAt(0)==="-"?ar+=parseFloat(Ze):ar=parseFloat(Ze),E(ar),se[Y].transitions.push(N(ar,Ee[2]));continue}var eo=u.match(/^(\S+)\s+is\s+(.+)$/i);if(eo){var Gr=eo[1];Dr.hasOwnProperty(Gr)&&se[Dr[Gr]].transitions.push(N(ar,eo[2]));continue}vo.droppedLine(Xr,"timing",m,Tr[m])}}}}return Ba.merge({signals:se,constraints:$r,highlights:rr,messages:gr,timeMarks:M,codes:j,scale:W,timeAxis:d,timeFormat:_,dateFormat:p,monochrome:H},Kr)}return{parse:pr}})();var tf=(function(){var pr=1e3,q=/^(?:(?:title|scale|hide|skin|skinparam)\s|!)/;function Xr(ar){return String(ar??"").replace(/^\s+|\s+$/g,"")}function Tr(ar,Y,$r){Y==="__proto__"?Object.defineProperty(ar,Y,{value:$r,enumerable:!0,writable:!0,configurable:!0}):ar[Y]=$r}function se(ar){for(var Y=Xr(ar).replace(/\s*<<.*>>\s*$/,""),$r=Y.split(/\s*\/\s*/),rr=[],H=0;H<$r.length;H++){var M=Xr($r[H]);M.length>=2&&M.charAt(0)==='"'&&M.charAt(M.length-1)==='"'&&(M=M.substring(1,M.length-1)),M!==""&&rr.push(M)}return rr.length>0?rr.join("/"):null}function Kr(ar){var Y=0,$r=ar.length,rr=0;function H(t){var n=new Error(t);throw n.jsonSyntax=!0,n.offset=Y,n}function M(){if(Y>=$r)return" but the input ends there";var t=ar.indexOf(`
-`,Y),n=Xr(ar.substring(Y,t<0?$r:t));return n.length>24&&(n=n.substring(0,23)+"\u2026"),' at "'+n+'"'}function j(){for(var t=Y-1;t>=0&&/\s/.test(ar.charAt(t));)t--;return t>=0&&ar.charAt(t)===","}function gr(t){return t>="0"&&t<="9"}function W(){for(;Y<$r;){var t=ar.charAt(Y);if(t!==" "&&t!==" "&&t!==`
-`&&t!=="\r")break;Y++}}function d(){if(ar.charAt(Y)==="/"){for(ar.charAt(Y+1)!=="/"&&(Y++,H('expected "//" (line comments are the only comment form)'+M()));Y<$r&&ar.charAt(Y)!==`
-`&&ar.charAt(Y)!=="\r";)Y++;W()}}function _(){var t=ar.charAt(Y);switch(t){case"{":return u();case"[":return m();case'"':return L();case"t":return p("true",!0);case"f":return p("false",!1);case"n":return p("null",null)}if(t==="-"||gr(t))return E();var n="";t==="/"?n=': a "//" comment is only allowed inside an object, before a key or after a value':t==="'"?n=": strings take double quotes":(t==="]"||t==="}")&&j()?n=": no trailing comma is allowed":/^[A-Za-z]$/.test(t)&&(n=": true, false and null are the only bare words"),H("expected a JSON value"+M()+n)}function p(t,n){return ar.substr(Y,t.length)!==t&&H('expected "'+t+'"'+M()),Y+=t.length,n}function E(){var t=Y;ar.charAt(Y)==="-"&&Y++;var n=ar.charAt(Y);if(gr(n)||H("expected a digit"+M()+(n==="."?': a number cannot start with "."':"")),Y++,n==="0")gr(ar.charAt(Y))&&H("a number cannot have a leading zero"+M());else for(;gr(ar.charAt(Y));)Y++;if(ar.charAt(Y)===".")for(Y++,gr(ar.charAt(Y))||H("expected a digit after the decimal point"+M());gr(ar.charAt(Y));)Y++;var f=ar.charAt(Y);if(f==="e"||f==="E")for(Y++,(ar.charAt(Y)==="+"||ar.charAt(Y)==="-")&&Y++,gr(ar.charAt(Y))||H("expected a digit in the exponent"+M());gr(ar.charAt(Y));)Y++;return Number(ar.substring(t,Y))}function L(){Y++;for(var t="",n=Y;Y<$r;){var f=ar.charAt(Y);if(f==='"')return t+=ar.substring(n,Y),Y++,t;if(f==="\\"){t+=ar.substring(n,Y),t+=N(),n=Y;continue}f.charCodeAt(0)<32&&H(f===`
-`||f==="\r"?"a string is not closed before the end of its line (a string cannot contain a line break)":"a control character (U+00"+(f.charCodeAt(0)<16?"0":"")+f.charCodeAt(0).toString(16).toUpperCase()+") is not allowed inside a string; escape it"),Y++}H("a string is not closed before the end of the input")}function N(){Y++,Y>=$r&&H("a string is not closed before the end of the input");var t=ar.charAt(Y);switch(t){case'"':case"/":case"\\":return Y++,t;case"b":return Y++,"\b";case"f":return Y++,"\f";case"n":return Y++,`
-`;case"r":return Y++,"\r";case"t":return Y++," ";case"u":var n=ar.substr(Y+1,4);if(!/^[0-9A-Fa-f]{4}$/.test(n)){for(Y++;/^[0-9A-Fa-f]$/.test(ar.charAt(Y));)Y++;H('expected four hexadecimal digits after "\\u"'+M())}return Y+=5,String.fromCharCode(parseInt(n,16))}H('"\\'+t+'" is not a valid escape sequence'+M()+' (only \\" \\\\ \\/ \\b \\f \\n \\r \\t and \\uXXXX are)')}function m(){var t=[];if(Y++,++rr>pr&&H("nesting deeper than "+pr+" levels"),W(),ar.charAt(Y)==="]")return Y++,rr--,t;do W(),t.push(_()),W();while(R(","));return ar.charAt(Y)!=="]"&&H('expected "," or "]"'+M()+(ar.charAt(Y)==="/"?': a "//" comment is only allowed inside an object':"")),Y++,rr--,t}function u(){var t={};if(Y++,++rr>pr&&H("nesting deeper than "+pr+" levels"),W(),ar.charAt(Y)==="}")return Y++,rr--,t;do{if(W(),d(),ar.charAt(Y)!=='"'){var n=ar.charAt(Y);H("expected a double-quoted key"+M()+(n==="}"&&j()?": no trailing comma is allowed":n==="'"?": keys take double quotes":n==="/"?': only one "//" comment fits between two members':""))}var f=L();W(),ar.charAt(Y)!==":"&&H('expected ":" after the key "'+f+'"'+M()),Y++,W(),Tr(t,f,_()),W(),d()}while(R(","));return ar.charAt(Y)!=="}"&&H('expected "," or "}"'+M()),Y++,rr--,t}function R(t){return ar.charAt(Y)!==t?!1:(Y++,!0)}W();var o=_();return W(),Y<$r&&H("unexpected text after the JSON value"+M()+(ar.charAt(Y)==="/"?': a "//" comment is only allowed inside an object':"")),o}function Dr(ar,Y){Y=Y||{};for(var $r=ar.split(/\r\n|\r|\n/),rr=[],H=null,M=[],j=[],gr=!1,W=!1,d=0;d<$r.length;d++){var _=$r[d],p=Xr(_);if(p===""){gr&&(M.push(_),j.push(d));continue}if(W=!0,p.charAt(0)!=="'"){if(/^@(end|start)(json|yaml|uml)\b/i.test(p)){if(/^@end/i.test(p))break;continue}if(_.charAt(0)==="#"){var E=_.match(/^#highlight\s+(\S.*)$/);if(E){var L=se(E[1]);L!=null&&rr.push(L)}gr=!0;continue}if(!gr){if(/^title\s/i.test(p)){H=p.replace(/^title\s+/i,"");continue}if(q.test(p)){if(/^skinparam\s/.test(p)&&p.indexOf("{")>=0)for(;d+1<$r.length&&Xr($r[d])!=="}";)d++;continue}gr=!0}M.push(_),j.push(d)}}var N=M.join(`
-`);if(Xr(N)==="")throw vo.emptyError(vo.sourceWrapper(Y)||"@startjson",W);var m;try{m=Kr(N)}catch(R){if(R==null||R.jsonSyntax!==!0)throw R;var u=N.substring(0,Math.min(R.offset,N.length)).split(`
-`).length-1;throw u>=j.length&&(u=j.length-1),vo.syntaxError(Y,"json",j[u],M[u],R.message)}return{data:m,rootPresent:!0,highlights:rr,title:H}}return{parse:Dr,parseStrict:Kr,parseHighlight:se}})();var Od=(function(){var pr="EMPTY_LINE",q="NO_KEY_ONLY_TEXT",Xr="KEY_ONLY",Tr="KEY_AND_VALUE",se="KEY_AND_FLOW_SEQUENCE",Kr="KEY_AND_BLOCK_STYLE",Dr="KEY_AND_FOLDED_STYLE",ar="PLAIN_ELEMENT_LIST",Y="PLAIN_DASH",$r=/^(?:title|scale|hide|skin|skinparam)\s/;function rr(n){return String(n??"").replace(/^\s+|\s+$/g,"")}function H(n,f,O){f==="__proto__"?Object.defineProperty(n,f,{value:O,enumerable:!0,writable:!0,configurable:!0}):n[f]=O}function M(n){if(n==="")return n;if(n.charAt(0)==="#")return"";for(var f="",O=0;O<n.length;O++){var g=n.charAt(O);if((g==="'"||g==='"')&&(f===""?f=g:g===f&&(f="")),f===""&&O<n.length-1&&g===" "&&n.charAt(O+1)==="#")return n.substring(0,O)}return n}function j(n){for(var f="",O=0;O<n.length;O++){var g=n.charAt(O);if(f!=="")g===f&&(f="");else if(g==='"'||g==="'")f=g;else if(g===":")return O}return-1}function gr(n){for(var f=[],O="",g="",Q=!1,x=0;x<n.length;x++){var I=n.charAt(x);g!==""?I==="\\"?x+1<n.length&&(O+=n.charAt(x+1),x++):I===g?g="":O+=I:!Q&&rr(O)===""&&(I==="'"||I==='"')?(g=I,Q=!0,O=""):I===","?(f.push(Q?O:rr(O)),O="",Q=!1):I==="\\"?x+1<n.length&&(O+=n.charAt(x+1),x++):O+=I}return f.push(Q?O:rr(O)),f}function W(n){if(n==null||n.length<2)return n;var f=n.charAt(0),O=n.charAt(n.length-1);return f==='"'&&O==='"'||f==="'"&&O==="'"?n.substring(1,n.length-1):n}function d(n){var f=0;for(n=n.replace(/\t/g," ");f<n.length&&n.charAt(f)===" ";)f++;var O=M(rr(n.substring(f)));if(O==="")return{type:pr,indent:0,listItem:!1};if(O==="-")return{type:Y,indent:f+1,listItem:!0};var g=O.indexOf("- ")===0;g&&(f+=2,O=O.substring(2));var Q=j(O);if(Q===-1)return{type:g?ar:q,indent:f,key:null,value:W(O),listItem:g};var x=rr(O.substring(0,Q)),I=rr(O.substring(Q+1)),w=Tr;if(I==="")w=Xr;else if(I==="|")w=Kr;else if(I===">")w=Dr;else if(I.charAt(0)==="["&&I.charAt(I.length-1)==="]")return{type:se,indent:f,key:W(x),value:null,values:gr(I.substring(1,I.length-1)),listItem:g};return{type:w,indent:f,key:W(x),value:W(I),listItem:g}}var _="undetermined",p="scalar",E="list",L="map";function N(n){return{type:_,value:null,list:null,keys:null,map:null,at:n||null}}function m(n,f){var O=N(f);return O.type=p,O.value=n,O}function u(n,f){var O=N(f);O.type=E,O.list=[];for(var g=0;g<n.length;g++)O.list.push(m(n[g],f));return O}function R(n,f){var O=[],g=[N(null)],Q=null;function x(D,S){throw vo.syntaxError(f,"yaml",D!=null?D.index:null,D!=null?D.raw:null,S)}function I(){return g[g.length-1]}function w(D,S){D.type===_?(D.type=E,D.list=[]):D.type!==E&&x(Q,'a "- item" cannot join a node that already holds '+(D.type===L?'"key: value" pairs':"a plain value")),D.list.push(S)}function nr(D,S,U){D.type===_?(D.type=L,D.keys=[],D.map={}):D.type!==L&&x(Q,'"key: value" cannot join a node that is already a list of "- items"'),Object.prototype.hasOwnProperty.call(D.map,S)||D.keys.push(S),H(D.map,S,U)}function lr(){g.pop(),g.length===0&&x(Q,"this line is indented left of the list the document started with, so there is no node for it to join")}function ir(D){if(O.length===0){O.push(D);return}if(D>O[O.length-1]){O.push(D);return}for(;O.length>0&&D<O[O.length-1];)O.pop(),lr(),I().type===E&&lr()}function mr(){if(g.length<2)return!1;var D=g[g.length-2];return D.type===E&&D.list.length>0&&D.list[D.list.length-1]===g[g.length-1]}function Or(){mr()&&g.pop();var D=N(Q);w(I(),D),g.push(D)}function Qr(D,S){nr(I(),D,m(S,Q))}function ee(D,S){nr(I(),D,u(S,Q))}function re(D){var S=N(Q);nr(I(),D,S),g.push(S)}function Yr(D){mr()&&g.pop();var S=N(Q);w(I(),S),g.push(S);var U=N(Q);nr(I(),D,U),g.push(U)}function Zr(D){mr()&&g.pop(),w(I(),m(D,Q))}function Ee(D,S){mr()&&g.pop();var U=N(Q);w(I(),U),g.push(U),nr(I(),D,m(S,Q))}function Ze(D,S){mr()&&g.pop();var U=N(Q);w(I(),U),g.push(U),nr(I(),D,u(S,Q))}function eo(D){for(var S=D+1;S<n.length;S++){var U=d(n[S].raw);if(U.type!==pr)return U}return null}function Gr(D){for(var S="",U=D+1;U<n.length;U++){var P=d(n[U].raw);if(P.type===pr){D=U;continue}if(P.type!==q)break;S+=(S.length>0?" ":"")+P.value,D=U}return{text:S,index:D}}function $e(D,S){for(var U="",P=D+1;P<n.length;P++){var s=d(n[P].raw);if(s.type!==q&&s.type!==pr&&s.indent<=S)break;U+=rr(n[P].raw)+`
-`,D=P}return{text:U,index:D}}for(var Ye=0;Ye<n.length;Ye++){Q=n[Ye];var Hr=d(Q.raw);if(Hr.type!==pr){if(Hr.type===q&&x(Q,'this line is plain text \u2014 not "key: value", not a "- item", and there is no bare "key:" right above it for it to continue: '+vo.excerpt(Q.raw)),Hr.type===Y){Or();continue}if(ir(Hr.indent),Hr.listItem)Hr.type===Xr?Yr(Hr.key):Hr.type===ar?Zr(Hr.value):Hr.type===Tr?Ee(Hr.key,Hr.value):Hr.type===se?Ze(Hr.key,Hr.values):x(Q,'a "|" or ">" block value on a "- key:" item is not supported by PlantUML');else if(Hr.type===Xr){var Fo=eo(Ye);if(Fo==null||Fo.indent<=Hr.indent)Qr(Hr.key,"");else if(Fo.type===q){var k=Gr(Ye);Qr(Hr.key,k.text),Ye=k.index}else re(Hr.key)}else if(Hr.type===Tr)Qr(Hr.key,Hr.value);else if(Hr.type===Kr){var T=$e(Ye,Hr.indent);Qr(Hr.key,T.text),Ye=T.index}else Hr.type===se?ee(Hr.key,Hr.values):x(Q,'the folded block style ">" is not supported by PlantUML; use "|" or a one-line value')}}return g[0]}function o(n,f){function O(x,I){throw vo.syntaxError(f,"yaml",x!=null?x.index:null,x!=null?x.raw:null,I)}function g(x){for(var I=[],w=0;w<x.list.length;w++){var nr=x.list[w];nr.type===p?I.push(nr.value):nr.type===L?I.push(Q(nr)):nr.type===E?O(nr.at,"a list nested directly inside a list is not supported by PlantUML"):O(nr.at,'this "-" opens a list item that never receives a value')}return I}function Q(x){for(var I={},w=0;w<x.keys.length;w++){var nr=x.keys[w],lr=x.map[nr];lr.type===p?H(I,nr,lr.value):lr.type===L?H(I,nr,Q(lr)):lr.type===E?H(I,nr,g(lr)):O(lr.at,'the key "'+nr+'" never receives a value')}return I}return n.type===p?n.value:n.type===E?g(n):n.type===L?Q(n):null}function t(n,f){f=f||{};for(var O=n.split(/\r\n|\r|\n/),g=[],Q=null,x=[],I=!1,w=!1,nr=0;nr<O.length;nr++){var lr=O[nr],ir=rr(lr);if(ir===""){I&&x.push({raw:lr,index:nr});continue}if(w=!0,!(ir.charAt(0)==="'"||ir.charAt(0)==="!")){if(lr.indexOf("#highlight ")===0){var mr=tf.parseHighlight(lr.substring(11));mr!=null&&g.push(mr);continue}if(!I){if(/^title\s/i.test(ir)){Q=ir.replace(/^title\s+/i,"");continue}if($r.test(ir)){if(/^skinparam\s/.test(ir)&&ir.indexOf("{")>=0)for(;nr+1<O.length&&rr(O[nr])!=="}";)nr++;continue}I=!0}x.push({raw:lr,index:nr})}}var Or=vo.sourceWrapper(f)||"@startyaml";if(x.length===0)throw vo.emptyError(Or,w);var Qr=o(R(x,f),f);if(Qr==null)throw vo.emptyError(Or,!0);return{data:Qr,rootPresent:!0,highlights:g,title:Q}}return{parse:t}})();var Fd=(function(){function pr(o){return o.replace(/^\s+|\s+$/g,"")}function q(o,t){t=t||{};for(var n=o.split(/\r\n|\r|\n/),f=[],O=!1,g=!1,Q=0,x={title:null,header:null,footer:null,caption:null,legend:null},I=0;I<n.length;I++){var w=pr(n[I]);if(O){/^<\/style>/i.test(w)&&(O=!1);continue}if(g){w==="}"&&(g=!1);continue}if(Q>0){w.indexOf("{")>=0&&Q++,w.indexOf("}")>=0&&Q--;continue}if(!(w===""||w.charAt(0)==="'"||w.charAt(0)==="!")){if(/^<style\b/i.test(w)){/<\/style>/i.test(w)||(O=!0);continue}if(/^skinparam\b/i.test(w)){/\{\s*$/.test(w)&&(Q=1);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(w)){var nr=Ba.take(x,n,I);if(nr>=0){I=nr;continue}}if(!/^(title|header|footer|caption|scale|hide\s+stereotype)\b/i.test(w)){if(/^sprite\s+\$/.test(w)){/\}\s*$/.test(w)||(g=!0);continue}f.push(w)}}}var lr={tokens:Tr(f),pos:0},ir=null;return lr.tokens.length>0&&(lr.tokens[0].s.charAt(0)==="{"?ir=gr(lr).el:ir=_(lr," ",null,!0).el),Ba.merge({root:ir},x)}var Xr=/\{(?:[-+^#!*\/]|S-|SI|S)?/g;function Tr(o){var t=[];function n(Or,Qr){Or=pr(Or),Or.length>0&&t.push({s:Or,t:Qr})}for(var f=0;f<o.length;f++){for(var O=o[f].split(/([|}])/),g=[],Q=0;Q<O.length;Q++)O[Q]!==""&&g.push(O[Q]);for(var x=0;x<g.length;x++){var I=g[x];if(I!=="|"){var w=x<g.length-1?"col":"line";Xr.lastIndex=0;var nr=Xr.exec(I);if(!nr){n(I,w);continue}var lr=0,ir=0;do{var mr=nr.index;mr>lr&&n(I.substring(lr,mr),"col"),ir=mr+nr[0].length,n(I.substring(mr,ir),ir===I.length?w:"col"),lr=ir,nr=Xr.exec(I)}while(nr);ir<I.length&&n(I.substring(ir),w)}}}return t}function se(o,t){var n=o.tokens[o.pos+t];return n?n.s:""}function Kr(o){var t=o.tokens[o.pos];return o.pos++,t||{s:"",t:"line"}}function Dr(o){return o.pos>=o.tokens.length}function ar(o){return" +^-!#".indexOf(o)>=0?o:null}function Y(o){return pr(o.replace(/<\/?[^>]*>/g,""))}function $r(o){return o.replace(/<&[-\w]+>/g,"00").replace(/<\/?[^>]*>/g,"").length}function rr(o){return/<b>/i.test(o)}function H(o){return{type:"text",text:o,display:Y(o),bold:rr(o),show:o!=="."}}function M(o){return o.length>=2&&/^(--|==|~~|\.\.)/.test(o)&&o.substring(o.length-2)===o.substring(0,2)}function j(o,t){return{el:t,t:o.t}}function gr(o){var t=se(o,0),n=se(o,1),f=t.charAt(t.length-1);if(t==="{*")return m(o);if(t==="{"&&(n==="T"||n.length===2&&n.charAt(0)==="T"&&ar(n.charAt(1))!=null))return R(o);if(t==="{/")return u(o);if(M(t))return j(Kr(o),{type:"line",ch:t.charAt(0)});if(t.length>=2&&t.charAt(0)==='"'&&f==='"'){var O=t.substring(1,t.length-1);return j(Kr(o),{type:"textfield",text:Y(O),bold:rr(O),charLength:$r(O)})}if(/^\[X\]/.test(t))return j(Kr(o),{type:"check",text:Y(t.substring(3)),bold:rr(t),radio:!1,checked:!0});if(/^\[\]|^\[ \]/.test(t))return j(Kr(o),{type:"check",text:Y(t.substring(t.indexOf("]")+1)),bold:rr(t),radio:!1,checked:!1});if(t.length>=2&&t.charAt(0)==="["&&f==="]"){var g=t.substring(1,t.length-1);return j(Kr(o),{type:"button",text:Y(g),bold:rr(g),charLength:$r(g)})}if(t.length>=2&&t.charAt(0)==="^"&&f==="^"){for(var Q=t.substring(1,t.length-1).split("^"),x=[],I=1;I<Q.length;I++)Q[I]!==""&&x.push(Y(Q[I]));return j(Kr(o),{type:"droplist",text:Y(Q[0]),bold:rr(Q[0]),charLength:$r(Q[0]),open:x})}if(/^\(X\)/.test(t))return j(Kr(o),{type:"check",text:Y(t.substring(3)),bold:rr(t),radio:!0,checked:!0});if(/^\(\)|^\( \)/.test(t))return j(Kr(o),{type:"check",text:Y(t.substring(t.indexOf(")")+1)),bold:rr(t),radio:!0,checked:!1});if(t==="<<"||/^<<\w+$/.test(t))return L(o);if(/^<<\w+>>$/.test(t)){var w=t.substring(2,t.length-2),nr=o.images&&o.images[w];return j(Kr(o),nr?{type:"image",rows:nr.rows}:{type:"empty"})}if(t.charAt(0)!=="{"&&t.charAt(0)!=="}"&&t.length>0)return j(Kr(o),H(t));if(/^\{[+^#!\-]?$/.test(t)&&!/^(?:[NSEW]=|T)$/.test(n))return p(o);if(t==="{S"||t==="{S-"||t==="{SI")return E(o);if(/^\{[+#!\-]?$/.test(t)&&/^[NSEW]=$/.test(n))return N(o);var lr=Kr(o);return{el:H(lr.s),t:lr.t}}function W(){var o={row:0,col:0,maxRow:0,maxCol:0,cells:[],last:null};return o.updateMax=function(){o.row>o.maxRow&&(o.maxRow=o.row),o.col>o.maxCol&&(o.maxCol=o.col)},o.move=function(t){t==="col"?o.col++:(o.row++,o.col=0)},o.add=function(t,n){o.last={el:t,minRow:o.row,maxRow:o.row,minCol:o.col,maxCol:o.col},o.cells.push(o.last),o.updateMax(),o.move(n)},o.mergeLeft=function(t){o.updateMax(),o.move(t),o.last&&o.last.maxCol++},o}function d(o,t,n,f){return{type:"pyramid",strategy:t,title:n,rows:o.maxRow+1,cols:o.maxCol+1,cells:o.cells,scroll:f||null}}function _(o,t,n,f){for(var O=W();!Dr(o)&&se(o,0)!=="}";){var g=gr(o);f&&g.el.type==="text"&&g.el.text==="*"?O.mergeLeft(g.t):O.add(g.el,g.t)}var Q=Kr(o);return{el:d(O,t,n,null),t:Q.t}}function p(o){var t=Kr(o),n=t.s.length===2?t.s.charAt(1):" ",f=null;return n==="^"&&t.t==="col"&&(f=Kr(o).s.replace(/^"([^"]*)"$/,"$1")),_(o,n,f,!0)}function E(o){var t=Kr(o),n=t.s==="{S-"?"h":t.s==="{SI"?"v":"both",f=_(o,"+",null,!1);return f.el.scroll=n,f}function L(o){for(var t=Kr(o),n=t.s.length>2?t.s.substring(2):null,f=[];!Dr(o)&&se(o,0)!==">>";)f.push(Kr(o).s);var O=Kr(o),g={type:"image",rows:f};return n&&(o.images||(o.images={}),o.images[n]=g),{el:g,t:O.t}}function N(o){Kr(o);for(var t={type:"border",north:null,south:null,east:null,west:null,center:null};!Dr(o)&&se(o,0)!=="}";){var n=Kr(o).s.charAt(0);if(Dr(o)||se(o,0)==="}")break;var f=gr(o).el;n==="N"?t.north=f:n==="S"?t.south=f:n==="E"?t.east=f:n==="W"?t.west=f:t.center=f}var O=Kr(o);return{el:t,t:O.t}}function m(o){Kr(o);for(var t=[],n={},f=null;!Dr(o)&&se(o,0)!=="}";){var O=Kr(o);f===null?t.push(O.s):f===""?f=O.s:(n.hasOwnProperty(f)||(n[f]=[]),n[f].push(O.s)),O.t==="line"&&(f="")}var g=Kr(o);return{el:{type:"menubar",entries:t,popups:n},t:g.t}}function u(o){Kr(o);for(var t=[],n=!1;!Dr(o)&&se(o,0)!=="}";){var f=Kr(o);t.push({text:Y(f.s),bold:rr(f.s)}),f.t==="line"&&(n=!0)}var O=Kr(o);return{el:{type:"tabbar",tabs:t,vertical:n},t:O.t}}function R(o){Kr(o);for(var t=Kr(o).s,n=t.length===2?t.charAt(1):" ",f=[],O=!0;!Dr(o)&&se(o,0)!=="}";){var g=Kr(o);if(O){for(var Q=0,x=g.s;x.charAt(0)==="+";)Q++,x=x.substring(1);f.push({level:Q,text:Y(x),bold:rr(x),cells:[]})}else f.length>0&&f[f.length-1].cells.push({text:Y(g.s),bold:rr(g.s)});O=g.t==="line"}var I=Kr(o);return{el:{type:"tree",strategy:n,entries:f},t:I.t}}return{parse:q,tokenize:Tr}})();var bd=(function(){function pr(q,Xr){Xr=Xr||{};var Tr=q.split(/\r\n|\r|\n/),se=[],Kr={title:null,header:null,footer:null,caption:null,legend:null},Dr=[],ar=[],Y=[],$r=null,rr=null,H=!1,M=0;function j(Q){for(var x={address:null,description:null,shape:null,color:null},I=Q.split(/\s*,\s*/),w=0;w<I.length;w++){var nr=I[w].match(/(\w+)\s*=\s*"?([^"\]]*)"?\s*$/);if(nr){var lr=nr[1].toLowerCase(),ir=nr[2].replace(/^\s+|\s+$/g,"");lr==="address"?x.address=ir:lr==="description"?x.description=ir:lr==="shape"?x.shape=ir.toLowerCase():lr==="color"&&(x.color=ir)}}return x}for(var gr=0;gr<Tr.length;gr++){var W=Tr[gr].replace(/^\s+|\s+$/g,"");if(W!==""&&W.charAt(0)!=="'"&&W.charAt(0)!=="!"&&!/^skinparam\b/i.test(W)){if(/^(hide|show)\b/i.test(W)){vo.ignoredDirective(Xr,"network",gr,Tr[gr]);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(W)){var d=Ba.take(Kr,Tr,gr);if(d>=0){gr=d;continue}}if(!/^(title|header|footer|caption|scale)\b/i.test(W)){var _=W.match(/^nwdiag\s*\{/i);if(_){H=!0,M++;continue}var p=W.match(/^network(?:\s+(\S+))?\s*\{/i);if(p){$r={name:p[1]||"",address:null,nodes:[]},se.push($r),M++;continue}var E=W.match(/^group(?:\s+(\S+))?\s*\{/i);if(E&&$r==null){rr={name:E[1]||null,color:null,nodes:[]},Dr.push(rr),M++;continue}if(W==="}"){M--,rr!=null?rr=null:$r!=null&&M<=(H?1:0)&&($r=null),M<=0&&(H=!1,M=0);continue}if(rr!=null){var L=W.match(/^color\s*=\s*"([^"]*)"\s*;?\s*$/i);if(L){rr.color=L[1];continue}var N=W.match(/^description\s*=\s*"([^"]*)"\s*;?\s*$/i);if(N){rr.name=N[1];continue}var m=W.match(/^(\w+)\s*;?\s*$/);if(m){rr.nodes.push(m[1]);continue}}var u=W.match(/^(\w+)\s*--\s*(\w+)\s*;?\s*$/);if(u&&$r==null&&H){Y.push({from:u[1],to:u[2]});continue}var R=W.match(/^(\w+)\s*\[([^\]]*)\]\s*;?\s*$/);if(R&&$r==null&&H){var o=j(R[2]);ar.push({name:R[1],address:o.address,description:o.description,shape:o.shape});continue}var t=W.match(/^(\w+)\s*;?\s*$/);if(t&&$r==null&&rr==null&&H&&!/^(?:address|color|description|shape)$/i.test(t[1])){ar.push({name:t[1],address:null,description:null,shape:null});continue}if($r!=null){var n=W.match(/^address\s*=\s*"([^"]*)"$/i);if(n){$r.address=n[1];continue}var f=W.match(/^(\S+)\s*\[([^\]]*)\]\s*;?\s*$/);if(f){var O=j(f[2]);$r.nodes.push({name:f[1],address:O.address,description:O.description,shape:O.shape});continue}var g=W.match(/^(\w+)\s*;?\s*$/);if(g&&g[1]!=="address"){$r.nodes.push({name:g[1],address:null,description:null,shape:null});continue}}vo.droppedLine(Xr,"network",gr,Tr[gr])}}}return se.length===0&&ar.length>0&&(se.push({name:"",address:null,nodes:ar}),ar=[]),Ba.merge({networks:se,groups:Dr,topNodes:ar,links:Y},Kr)}return{parse:pr}})();var yd=(function(){for(var pr=["Motivation","Strategy","Business","Application","Technology","Physical","Implementation","Other","Junction"],q={},Xr=0;Xr<pr.length;Xr++)q[pr[Xr]]=!0;function Tr(Dr){for(var ar=[],Y="",$r=!1,rr=0;rr<Dr.length;rr++){var H=Dr[rr];H==='"'?($r=!$r,Y+=H):H===","&&!$r?(ar.push(Y.trim()),Y=""):Y+=H}return Y.trim()!==""&&ar.push(Y.trim()),ar}function se(Dr){return Dr&&Dr.length>=2&&Dr.charAt(0)==='"'&&Dr.charAt(Dr.length-1)==='"'?Dr.substring(1,Dr.length-1):Dr||""}function Kr(Dr,ar){ar=ar||{};var Y=[],$r=[],rr=[],H=null,M={},j=null,gr={header:null,footer:null,caption:null},W=[],d=String(Dr||"").split(/\r?\n/),_=/^([A-Z][A-Za-z0-9]*)_([A-Za-z][A-Za-z0-9]*)\s*\(\s*([^)]*)\)\s*(\{)?\s*$/,p=/^Rel(?:_[A-Za-z][A-Za-z0-9]*)?\s*\(\s*([^)]*)\)\s*$/,E=/^(Grouping|Group)\s*\(\s*([^)]*)\)\s*\{\s*$/,L=/^title\s+(.+)$/i,N=/^archimate\s+(?:#(\w+)\s+)?(?:"([^"]+)"|([^\s"<\[]+))(?:\s+<<([^>]*)>>)?(?:\s+as\s+(\S+))?(?:\s+<<([^>]*)>>)?(?:\s+#(\w+))?\s*(\[)?\s*$/i,m=/^circle\s+(?:#(\w+)\s+)?(\S+)(?:\s+#(\w+))?\s*$/i,u=/^(frame|rectangle|package|folder|node|cloud|card)\s+(?:"([^"]+)"|([^\s"<\[]+))(?:\s+as\s+(\S+))?((?:\s+<<[^>]*>>)*)(?:\s+#(\w+))?\s*(\{|\[)?\s*$/i,R=/^(\S+)\s+((?:<\|?|\*|o)?[-.]+(?:\[[^\]]*\])?(?:up|down|left|right|u|d|l|r)?[-.]*(?:\|?>|\*|o)?)\s+(\S+)(?:\s*:\s*(.*))?$/,o={motivation:"Motivation",strategy:"Strategy",business:"Business",application:"Application",technology:"Technology",physical:"Physical",implementation:"Implementation"};function t(zn){return zn.split(/[-_\s]+/).filter(Boolean).map(function(Dn){return Dn.charAt(0).toUpperCase()+Dn.substring(1)}).join("")}function n(zn,Dn){var xe=Dn&&o[Dn.toLowerCase()]||null,i=null;if(zn){var c=zn.toLowerCase().replace(/-filled$/,"").split("-");o[c[0]]&&(xe==null&&(xe=o[c[0]]),c.shift()),c.length&&(i=t(c.join("-")))}return{category:xe||"Other",kind:i||"Element"}}function f(zn){for(var Dn=[],xe=zn+1;xe<d.length&&!/^\s*\]\s*$/.test(d[xe]);)Dn.push(d[xe].replace(/^\s+|\s+$/g,"")),xe++;return{text:Dn.join(`
-`),endIdx:xe}}function O(zn){if(W.length>0){var Dn=W[W.length-1];zn.parent=Dn.id,Dn.children.push(zn.id)}Y.push(zn),M[zn.id]=zn}for(var g=0,Q=!1,x=0;x<d.length;x++){var I=d[x].replace(/^\s+|\s+$/g,"");if(I!==""&&I.charAt(0)!=="'"&&I.charAt(0)!=="!"&&!/^@(start|end)/i.test(I)){if(/^sprite\b/i.test(I)){if(/\{\s*$/.test(I)){for(;x+1<d.length&&!/^\s*\}\s*$/.test(d[x+1]);)x++;x++}continue}if(Q){/<\/style\s*>/i.test(I)&&(Q=!1);continue}if(/^<style\b/i.test(I)){/<\/style\s*>/i.test(I)||(Q=!0);continue}if(g>0){I.indexOf("{")>=0&&g++,I.indexOf("}")>=0&&g--;continue}if(/^skinparam\b/i.test(I)){/\{\s*$/.test(I)&&g++;continue}if(/^(?:hide|show)\b/i.test(I)){vo.ignoredDirective(ar,"archimate",x,d[x]);continue}if(!/^(?:scale|left\s+to\s+right\s+direction|top\s+to\s+bottom\s+direction)\b/i.test(I)){var w=N.exec(I);if(w!=null){var nr=w[1]||w[7]||null,lr=w[2]!=null?w[2]:w[3],ir=w[5]||lr,mr=n(w[4]||w[6]||null,nr),Or={id:ir,label:lr.replace(/\\n/g,`
-`),category:mr.category,kind:mr.kind,stereotype:w[4]||w[6]||null,parent:null};if(nr&&!o[nr.toLowerCase()]&&(Or.color="#"+nr),w[8]==="["){var Qr=f(x);Or.label=Qr.text,x=Qr.endIdx}O(Or);continue}var ee=m.exec(I);if(ee!=null){var re=(ee[1]||ee[3]||"").toLowerCase();O({id:ee[2],label:"",category:"Junction",kind:re==="black"||re==="000000"?"And":"Or",parent:null});continue}var Yr=u.exec(I);if(Yr!=null){var Zr=Yr[2]!=null?Yr[2]:Yr[3],Ee=Yr[4]||Zr;if(Yr[7]==="{"){var Ze={id:Ee,label:Zr,kind:"Group",children:[]};rr.push(Ze),W.push(Ze)}else{var eo=(Yr[5]||"").match(/<<([^>$]*)>>/g)||[],Gr=eo.length?eo[eo.length-1].replace(/^<<|>>$/g,""):null,$e=n(Gr,Yr[6]||null),Ye={id:Ee,label:Zr.replace(/\\n/g,`
-`),category:$e.category,kind:Gr?$e.kind:t(Yr[1]),parent:null};if(Yr[6]&&!o[Yr[6].toLowerCase()]&&(Ye.color="#"+Yr[6]),Yr[7]==="["){var Hr=f(x);Ye.label=Hr.text,x=Hr.endIdx}O(Ye)}continue}var Fo=R.exec(I);if(Fo!=null&&/[-.]/.test(Fo[2])&&!/^(?:Rel|Grouping|Group)\b/.test(I)&&Fo[2].indexOf("hidden")<0){var k=Fo[2],T=Fo[1],D=Fo[3];if(/^<\|?/.test(k)&&!/\|?>$/.test(k)){var S=T;T=D,D=S}$r.push({from:T,to:D,label:Fo[4]?Fo[4].replace(/^\s+|\s+$/g,""):"",kind:"Rel"});continue}var U=I.match(/^legend(?:\s+(left|right|center|top|bottom))?\s*$/i);if(U!=null){for(var P=U[1]||"center",s=[],$=x+1;$<d.length&&!/^endlegend\b/i.test(d[$].replace(/^\s+|\s+$/g,""));){var G=d[$].replace(/^\s+|\s+$/g,"");G!==""&&s.push(G),$++}j={position:P.toLowerCase(),lines:s},x=$;continue}if(!/^endlegend\b/i.test(I)){if(/^note\s+(?:"[^"]*"\s+)?as\s+\S+\s*(?:#[\w:;.]+)?\s*$/i.test(I)){var B=Ba.take(gr,d,x);if(B>=0){x=B;continue}}if(/^(?:(?:left|right|center|centre)\s+)?(?:header|footer|caption)\b/i.test(I)){var or=Ba.take(gr,d,x);if(or>=0){x=or;continue}}var K=L.exec(I);if(K!=null){H=K[1].replace(/^\s+|\s+$/g,"");continue}var hr=E.exec(I);if(hr!=null){var vr=Tr(hr[2]),Jr=se(vr[0]||"").replace(/^\s+|\s+$/g,""),Ge=se(vr[1]||Jr),no={id:Jr,label:Ge,kind:hr[1],children:[]};rr.push(no),W.push(no);continue}if(I==="}"){W.length>0&&W.pop();continue}var bo=p.exec(I);if(bo!=null){var Oo=Tr(bo[1]),We=se(Oo[0]||"").replace(/^\s+|\s+$/g,""),Tt=se(Oo[1]||"").replace(/^\s+|\s+$/g,""),Cn=Oo.length>2?se(Oo[2]):"",un="Rel",Kt=I.match(/^(Rel(?:_[A-Za-z][A-Za-z0-9]*)?)/);Kt&&(un=Kt[1]),We!==""&&Tt!==""&&$r.push({from:We,to:Tt,label:Cn,kind:un});continue}var ut=_.exec(I);if(ut!=null){var fn=ut[1],vt=ut[2];if(!q[fn])continue;var _o=Tr(ut[3]),Zo=se(_o[0]||"").replace(/^\s+|\s+$/g,""),jt=se(_o[1]||Zo),zt={id:Zo,label:jt,category:fn,kind:vt,parent:null};if(W.length>0){var Ga=W[W.length-1];zt.parent=Ga.id,Ga.children.push(Zo)}if(Y.push(zt),M[Zo]=zt,ut[4]==="{"){var $n={id:Zo,label:jt,kind:"ShapeContainer",children:[]};rr.push($n),W.push($n)}continue}vo.droppedLine(ar,"archimate",x,d[x])}}}}return Ba.merge({title:H,shapes:Y,edges:$r,groups:rr,legend:j},gr)}return{parse:Kr}})();var Ed=(function(){var pr={Person:{category:"Person",variant:"person"},Person_Ext:{category:"Person",variant:"person_ext"},System:{category:"System",variant:"normal"},SystemDb:{category:"System",variant:"db"},SystemQueue:{category:"System",variant:"queue"},System_Ext:{category:"System",variant:"ext"},SystemDb_Ext:{category:"System",variant:"db_ext"},SystemQueue_Ext:{category:"System",variant:"queue_ext"},Container:{category:"Container",variant:"normal"},ContainerDb:{category:"Container",variant:"db"},ContainerQueue:{category:"Container",variant:"queue"},Container_Ext:{category:"Container",variant:"ext"},ContainerDb_Ext:{category:"Container",variant:"db_ext"},ContainerQueue_Ext:{category:"Container",variant:"queue_ext"},Component:{category:"Component",variant:"normal"},ComponentDb:{category:"Component",variant:"db"},ComponentQueue:{category:"Component",variant:"queue"},Component_Ext:{category:"Component",variant:"ext"},ComponentDb_Ext:{category:"Component",variant:"db_ext"},ComponentQueue_Ext:{category:"Component",variant:"queue_ext"}},q={System_Boundary:!0,Container_Boundary:!0,Enterprise_Boundary:!0,Boundary:!0};function Xr(Kr){for(var Dr=[],ar="",Y=!1,$r=0;$r<Kr.length;$r++){var rr=Kr[$r];rr==='"'?(Y=!Y,ar+=rr):rr===","&&!Y?(Dr.push(ar.trim()),ar=""):ar+=rr}return ar.trim()!==""&&Dr.push(ar.trim()),Dr}function Tr(Kr){return Kr&&Kr.length>=2&&Kr.charAt(0)==='"'&&Kr.charAt(Kr.length-1)==='"'?Kr.substring(1,Kr.length-1):Kr||""}function se(Kr,Dr){Dr=Dr||{};for(var ar=[],Y=[],$r=[],rr=null,H=!1,M=!1,j=null,gr=null,W=null,d=[],_=String(Kr||"").split(/\r?\n/),p=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(\s*([\s\S]*?)\)\s*(\{)?\s*$/,E=/^title\s+(.+)$/i,L=0;L<_.length;L++){var N=_[L].replace(/^\s+|\s+$/g,"");if(N!==""&&N.charAt(0)!=="'"&&N.charAt(0)!=="!"&&!/^@(start|end)/i.test(N)){if(/^skinparam\b/i.test(N)){var m=/^skinparam\s+(nodesep|ranksep)\s+(\d+)/i.exec(N);m?/nodesep/i.test(m[1])?j=parseInt(m[2],10):gr=parseInt(m[2],10):/^skinparam\s+linetype\s+ortho/i.test(N)&&(W="ortho");continue}if(!/^hide\b/i.test(N)&&!/^show\b/i.test(N)){var u=E.exec(N);if(u!=null){rr=u[1].replace(/^\s+|\s+$/g,"");continue}if(N==="}"){d.length>0&&d.pop();continue}var R=N.match(/^package\s+(?:"([^"]*)"|(\S+))(?:\s*<<([^>]+)>>)?(\s*\{)?\s*$/i);if(R){var o="c4pkg_"+$r.length,t=R[1]||R[2]||"",n=R[3]||"",f=!!R[4],O={id:o,label:t,kind:"package",stereotype:n,children:[],parent:d.length>0?d[d.length-1].id:null};$r.push(O),f&&d.push(O);continue}var g=p.exec(N);if(g!=null){var Q=g[1],x=Xr(g[2]),I=g[3]==="{";if(Q==="LAYOUT_WITH_LEGEND"){H=!0;continue}if(!/^LAYOUT_/.test(Q)){if(q[Q]){var w=Tr(x[0]||"").replace(/^\s+|\s+$/g,""),nr=Tr(x[1]||w),lr={id:w,label:nr,kind:Q,children:[],parent:d.length>0?d[d.length-1].id:null};$r.push(lr),I&&d.push(lr);continue}var ir=pr[Q];if(ir){ir.category==="Component"&&(M=!0);var mr=Tr(x[0]||"").replace(/^\s+|\s+$/g,""),Or=Tr(x[1]||mr),Qr="",ee="";x.length>=4?(Qr=Tr(x[2]),ee=Tr(x[3])):x.length===3&&(ee=Tr(x[2]));var re={id:mr,label:Or,description:ee,technology:Qr,category:ir.category,variant:ir.variant,parent:d.length>0?d[d.length-1].id:null};if(re.parent){var Yr=d[d.length-1];Yr.children.push(mr)}ar.push(re);continue}if(/^Rel(?:_[A-Za-z][A-Za-z0-9_]*)?$/.test(Q)){var Zr=Tr(x[0]||"").replace(/^\s+|\s+$/g,""),Ee=Tr(x[1]||"").replace(/^\s+|\s+$/g,""),Ze=x.length>=3?Tr(x[2]):"",eo=x.length>=4?Tr(x[3]):"",Gr=null,$e=!1,Ye=Q.substring(3);/^_U/.test(Ye)||/^_Up/.test(Ye)?Gr="up":/^_D/.test(Ye)&&!/^_Down_/.test(Ye)||/^_Down/.test(Ye)?Gr="down":/^_L/.test(Ye)||/^_Left/.test(Ye)?Gr="left":(/^_R/.test(Ye)||/^_Right/.test(Ye))&&(Gr="right"),/_Back/.test(Ye)&&($e=!0),Zr!==""&&Ee!==""&&Y.push({from:Zr,to:Ee,label:Ze,technology:eo,direction:Gr,back:$e});continue}vo.droppedLine(Dr,"c4",L,_[L])}}}}}return{title:rr,shapes:ar,edges:Y,boundaries:$r,hasLegend:H,hasComponent:M,nodesep:j,ranksep:gr,linetype:W}}return{parse:se}})();zl.registerParser("sequence",cd);zl.registerParser("state",hd);zl.registerParser("activity",Cd);zl.registerParser("activityLegacy",vd);zl.registerParser("class",pd);zl.registerParser("component",$d);zl.registerParser("object",gd);zl.registerParser("useCase",Rd);zl.registerParser("mindmap",Ad);zl.registerParser("wbs",md);zl.registerParser("gantt",kd);zl.registerParser("timing",_d);zl.registerParser("json",tf);zl.registerParser("yaml",Od);zl.registerParser("salt",Fd);zl.registerParser("network",bd);zl.registerParser("archimate",yd);zl.registerParser("c4",Ed);var Av=Ec;return Rv(mv);})();
+`).replace(/<(?:\/?li|ul|ol)\b[^>]*>/gi,""),K=K.replace(/<hr\b([^>]*)>/gi,function(ye,Je){var _o=/dotted/i.test(Je)?"dotted":/double/i.test(Je)?"double":"solid";return`
+hr:`+_o+`
+`}),K=K.replace(/<\/?(?:div|p)\b[^>]*>/gi,""),K=K.replace(/\n?\u0002(?:\n|\u0002)*/g,`
+`);for(var P=K.split(/\r?\n/),u=[],m=0;m<P.length;m++){var G=P[m],I=/^hr:(\w+)$/.exec(G);if(I){u.push({text:"",rule:I[1],size:7.5,bold:!1,italic:!1});continue}var er=T||12,z=G.match(/font-size\s*:\s*(\d+(?:\.\d+)?)px/i);z&&(er=parseFloat(z[1]));var hr=!!N||/<b>|font-weight\s*:\s*bold/i.test(G),mr=!!D||/<i>|font-style\s*:\s*italic/i.test(G),ne=Nr(G.replace(/<[^>]+>/g,"")).replace(/^\s+|\s+$/g,"");u.push({text:ne,size:er,bold:hr,italic:mr})}for(;u.length&&!u[u.length-1].text&&!u[u.length-1].rule;)u.pop();for(;u.length&&!u[0].text&&!u[0].rule;)u.shift();return u}function Ne(O,T,N,D){for(var K=D-2.5,P=O.rule==="dotted"?' stroke-dasharray="1,2"':"",u=O.rule==="double"?[K-1,K+1]:[K],m="",G=0;G<u.length;G++)m+='<line x1="'+(T+2)+'" y1="'+u[G]+'" x2="'+(T+N-2)+'" y2="'+u[G]+'" stroke="#181818" stroke-width="1"'+P+"/>";return m}function He(O,T,N,D){var K=Wr(O.style),P={};T.forEach(function(Rl){P[Rl.id]=Rl});var u,m,G=null,I=P[O.source],er=P[O.target],z=P[O.parent],hr=z&&z.absX!=null?z.absX:0,mr=z&&z.absY!=null?z.absY:0;if(O.geometry&&O.geometry.sourcePoint&&O.geometry.targetPoint){u={x:O.geometry.sourcePoint.x+hr,y:O.geometry.sourcePoint.y+mr},m={x:O.geometry.targetPoint.x+hr,y:O.geometry.targetPoint.y+mr};var ne=O.geometry.points;if(ne&&ne.length>0){for(var ye=m.x-u.x,Je=m.y-u.y,_o=Math.sqrt(ye*ye+Je*Je)||1,Oo=!1,qe=0;qe<ne.length&&!Oo;qe++){var St=ne[qe].x+hr-u.x,ht=ne[qe].y+mr-u.y;Oo=Math.abs(St*Je-ht*ye)/_o>.5}Oo&&(G=ne.map(function(Rl){return{x:Rl.x+hr,y:Rl.y+mr}}))}}else if(I&&er&&I.geometry&&er.geometry){var nn={x:I.absX+I.geometry.width/2,y:I.absY+I.geometry.height/2},Tt={x:er.absX+er.geometry.width/2,y:er.absY+er.geometry.height/2};O.geometry&&O.geometry.points&&O.geometry.points.length>0&&(G=O.geometry.points.map(function(Rl){return{x:Rl.x+hr,y:Rl.y+mr}}));var Lo=G?G[0]:Tt,Qt=G?G[G.length-1]:nn;u=K.exitx!=null&&K.exity!=null?{x:I.absX+I.geometry.width*parseFloat(K.exitx),y:I.absY+I.geometry.height*parseFloat(K.exity)}:Ue(I,nn,Lo),m=K.entryx!=null&&K.entryy!=null?{x:er.absX+er.geometry.width*parseFloat(K.entryx),y:er.absY+er.geometry.height*parseFloat(K.entryy)}:Ue(er,Tt,Qt)}else return"";var pt=u.x+N,So=u.y+D,it=m.x+N,qt=m.y+D,Pt=null;if(G){Pt=[{x:pt,y:So}];for(var We=0;We<G.length;We++)Pt.push({x:G[We].x+N,y:G[We].y+D});Pt.push({x:it,y:qt})}var pn=K.strokecolor||"#000000",ra=K.strokewidth||"1",Gn=K.dashed==="1",Xe=(K.endarrow||"classic").toLowerCase();(K.endhalf==="top"||K.endhalf==="bottom")&&(Xe="half"+K.endhalf);var f=(K.startarrow||"none").toLowerCase(),d=K.endfill,b=Kr(Xe,d,pn,!1,K.endsize,ra),E=Kr(f,K.startfill,pn,!0,K.startsize,ra),ur;if((K.shape||"").toLowerCase()==="arrow"){var Er=(parseFloat(K.width)||12)/2,ke=(parseFloat(K.endwidth)||1)/2,dr=Math.sqrt((it-pt)*(it-pt)+(qt-So)*(qt-So))||1,Go=-(qt-So)/dr,lo=(it-pt)/dr,vo=K.fillcolor&&K.fillcolor!=="none"?K.fillcolor:pn;ur='<path d="M'+(pt+Go*Er)+","+(So+lo*Er)+" L"+(it+Go*ke)+","+(qt+lo*ke)+" L"+(it-Go*ke)+","+(qt-lo*ke)+" L"+(pt-Go*Er)+","+(So-lo*Er)+' Z" fill="'+vo+'" stroke="'+pn+'" stroke-width="'+ra+'"/>'}else if(K.curved==="1"&&!Pt){var Rn=pt+(it-pt)/2;ur='<path d="M'+pt+","+So+" C"+Rn+","+So+" "+Rn+","+qt+" "+it+","+qt+'" fill="none" stroke="'+pn+'" stroke-width="'+ra+'"'+M(Gn,K.dashpattern)+(b?' marker-end="'+b+'"':"")+(E?' marker-start="'+E+'"':"")+"/>"}else if(Pt){for(var rn="",Co=0;Co<Pt.length;Co++)rn+=(Co===0?"M":" L")+Pt[Co].x+","+Pt[Co].y;ur='<path d="'+rn+'" fill="none" stroke="'+pn+'" stroke-width="'+ra+'"'+M(Gn,K.dashpattern)+(b?' marker-end="'+b+'"':"")+(E?' marker-start="'+E+'"':"")+"/>";var Dn=Math.floor((Pt.length-1)/2);pt=Pt[Dn].x,So=Pt[Dn].y,it=Pt[Dn+1].x,qt=Pt[Dn+1].y}else ur='<line x1="'+pt+'" y1="'+So+'" x2="'+it+'" y2="'+qt+'" stroke="'+pn+'" stroke-width="'+ra+'"'+M(Gn,K.dashpattern)+(b?' marker-end="'+b+'"':"")+(E?' marker-start="'+E+'"':"")+"/>";var Ve="";if(O.value){var dt=parseInt(K.fontsize||"12",10),$t=K.fontstyle||"",Sa=$t==="1"||$t==="3"||$t==="5"||$t==="7",ba=Hr(O.value,dt,Sa,!1);if(ba.length>0){var sl=O.geometry&&O.geometry.x?(O.geometry.x+1)/2:.5,ua=pt+(it-pt)*sl,ea=O.geometry&&O.geometry.y||0,fn=0,ui=0;if(ea){var oi=Math.sqrt((it-pt)*(it-pt)+(qt-So)*(qt-So))||1;fn=-(qt-So)/oi*ea,ui=(it-pt)/oi*ea}ua+=fn;var Zl=K.fontcolor||"#000000",Ca=K.labelbackgroundcolor,Cl=[],Aa=dt*1.25,en=(So+qt)/2-4-(ba.length-1)*Aa+ui;if(Ca&&Ca!=="none"){for(var xt=0,pl=0;pl<ba.length;pl++){var Pl=oe(ba[pl].text,ba[pl].size,ba[pl].bold);Pl>xt&&(xt=Pl)}xt+=4;var Oi=Aa*ba.length;Cl.push('<rect x="'+(ua-xt/2)+'" y="'+(en-dt)+'" width="'+xt+'" height="'+Oi+'" fill="'+Ca+'" stroke="none"/>')}for(var el=0;el<ba.length;el++)Cl.push(eo(ua,en+el*Aa,ba[el].text,ba[el].size,Zl,ba[el].bold,ba[el].italic,"middle",K.fontfamily));Ve=`
+`+Cl.join(`
+`)}}return ur+Ve}function Kr(O,T,N,D,K,P){if(!O||O==="none")return"";var u;O==="block"?u=T==="1"?"blockfilled":"blockhollow":O==="open"||O==="openthin"?u="open":O==="halfcircle"?u="halfcircle":O==="diamond"||O==="diamondthin"?u=T==="1"?"diamondfilled":"diamondhollow":O==="oval"||O==="circle"?u="oval":O==="cross"?u="cross":O==="halftop"||O==="halfbottom"||O==="erone"||O==="ermandone"||O==="ermany"||O==="eronetomany"||O==="erzerotoone"||O==="erzerotomany"?u=O:O==="triangle"?u="blockhollow":u="classic";var m=N||"#000000",G=(K?parseFloat(K):6)+(parseFloat(P)||1)+2,I=Math.max(.3,G/10);u==="oval"&&(I=((K?parseFloat(K):6)+(parseFloat(P)||1))/9);var er=u+"-"+m.replace(/[^0-9a-zA-Z]/g,"")+(D?"-s":"")+(I!==1?"-z"+Math.round(I*100):"");return H[er]||(H[er]={id:"ah-"+er,shape:u,color:m,start:!!D,scale:I}),"url(#"+H[er].id+")"}function Ue(O,T,N){var D=O.absX,K=O.absY,P=O.geometry.width,u=O.geometry.height,m=N.x-T.x,G=N.y-T.y;if(m===0&&G===0)return{x:T.x,y:T.y};var I=m===0?1/0:m>0?(D+P-T.x)/m:(D-T.x)/m,er=G===0?1/0:G>0?(K+u-T.y)/G:(K-T.y)/G,z=Math.min(I,er);return z<0||!isFinite(z)?{x:T.x,y:T.y}:{x:T.x+m*z,y:T.y+G*z}}return{convert:Ar,convertXml:Z}})();var pv=(function(){function Ar(){if(typeof document<"u"&&typeof Image<"u"&&typeof document.createElement=="function")return fe;throw new Error("PlantUml2Png.render requires a browser environment or a canvas polyfill. In pure Node.js, call PlantUml2Svg.convert() and pipe the result through an external SVG\u2192PNG rasteriser (resvg-js, sharp, Inkscape, or plantuml.jar -tpng).")}function Z(Nr,lr){try{var Y=bd.convert(Nr,lr);return Yr(Y,lr)}catch(Cr){return Promise.reject(Cr)}}function Mr(Nr,lr){try{var Y=bd.convertXml(Nr,lr);return Yr(Y,lr)}catch(Cr){return Promise.reject(Cr)}}function Yr(Nr,lr){lr=lr||{};var Y;try{Y=Ar()}catch(Cr){return Promise.reject(Cr)}return Y(Nr,lr)}function fe(Nr,lr){var Y=Math.max(.1,parseFloat(lr.scale)||1),Cr=lr.backgroundColor||null,V=lr.mimeType||"image/png";return new Promise(function(U,H){var J=Wr(Nr),gr=typeof Blob<"u"?new Blob([Nr],{type:"image/svg+xml;charset=utf-8"}):null,X=gr&&typeof URL<"u"&&URL.createObjectURL?URL.createObjectURL(gr):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(Nr),g=new Image;g.onload=function(){try{var M=(g.width||J.width)*Y,_=(g.height||J.height)*Y,C=document.createElement("canvas");C.width=Math.max(1,Math.round(M)),C.height=Math.max(1,Math.round(_));var $=C.getContext("2d");Cr&&($.fillStyle=Cr,$.fillRect(0,0,C.width,C.height)),$.drawImage(g,0,0,C.width,C.height);var y=C.toDataURL(V);X.slice(0,5)==="blob:"&&URL.revokeObjectURL&&URL.revokeObjectURL(X),U(y)}catch(A){H(A)}},g.onerror=function(M){X.slice(0,5)==="blob:"&&typeof URL<"u"&&URL.revokeObjectURL&&URL.revokeObjectURL(X),H(new Error("Failed to rasterise SVG (Image load error): "+(M&&M.message?M.message:"unknown")))},g.src=X})}function Wr(Nr){var lr=Nr.match(/\bwidth="(\d+(?:\.\d+)?)"/),Y=Nr.match(/\bheight="(\d+(?:\.\d+)?)"/),Cr=Nr.match(/\bviewBox="\s*([\d.\-]+)\s+([\d.\-]+)\s+([\d.\-]+)\s+([\d.\-]+)"/),V=lr?parseFloat(lr[1]):0,U=Y?parseFloat(Y[1]):0;return(!V||!U)&&Cr&&(V||(V=parseFloat(Cr[3])),U||(U=parseFloat(Cr[4]))),{width:V||800,height:U||600}}return{render:Z,renderXml:Mr,renderSvg:Yr}})();var ic=(function(){for(var Ar=["participant","actor","boundary","control","entity","database","collections","queue"],Z={},Mr=0;Mr<Ar.length;Mr++)Z[Ar[Mr]]=!0;function Yr(g,M){var _=g.length,C=M,$="none",y="none",A=null,s=0,k=0,o=fe(g,C,"<"),a=o;for(C=o.end;C<_&&g[C]==="-";)s++,C++;for(;C<_&&g[C]===".";)k++,C++;var t=!1;if(C<_&&g[C]==="["){var n=g.indexOf("]",C);if(n>C){for(var v=g.substring(C+1,n).split(","),R=0;R<v.length;R++){var Q=v[R].replace(/^\s+|\s+$/g,""),L=Q.toLowerCase();L==="dashed"||L==="dotted"?t=!0:L==="bold"||L==="hidden"||L===""||(A=Q.charAt(0)==="#"?Q:"#"+Q)}C=n+1}}for(;C<_&&g[C]==="-";)s++,C++;for(;C<_&&g[C]===".";)k++,C++;if(s+k===0)return null;var B=fe(g,C,">"),w=B;if(C=B.end,$=Wr(o),y=Wr(B),$==="none"&&y==="none"&&s+k<2)return null;var ar=k>0&&s===0?"dotted":s>2||k>0?"dashed":"solid";return s===2&&k===0&&$==="none"&&y==="none"?null:(k===0&&(ar=s>=2?"dashed":"solid"),t&&ar==="solid"&&(ar="dashed"),{end:C,lineStyle:ar,leftHead:$,rightHead:y,left:a,right:w,color:A})}function fe(g,M,_){for(var C={arrow:!1,async:!1,cross:!1,circle:!1,part:null,end:M},$=M;$<g.length;){var y=g[$];if(y===_)C.arrow&&(C.async=!0),C.arrow=!0;else if(y==="x")C.cross=!0;else if(y==="o")C.circle=!0;else if(y==="\\")C.part="halfTop";else if(y==="/")C.part="halfBottom";else break;$++}return C.end=$,C}function Wr(g){return g.cross?"lost":g.circle?"circle":g.part?g.part:g.async?"open":g.arrow?"filled":"none"}function Nr(g){return g.cross?"lost":g.part?g.part:g.async?"open":"filled"}function lr(g,M){return M==="o"||g.circle?"circle":M==="x"||g.cross?"lost":null}function Y(g,M){if(M==null)return"<b>"+g+"</b>";var _=String(M).match(/^([^0#]*)([0#]+)([^0#]*)$/);if(_==null)return String(g);for(var C=_[2].replace(/[^0]/g,"").length,$=String(g);$.length<C;)$="0"+$;return _[1]+$+_[3]}function Cr(g,M,_,C){var $=g;if(_.hasOwnProperty($))return $;for(var y in _)if(_.hasOwnProperty(y)&&M[_[y]].name===g)return y;var A={id:$,name:g,kind:"participant",color:null,stereotype:null,order:C.value++,created:!1,box:null};return _[$]=M.length,M.push(A),$}function V(g){return g==null?g:String(g).replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," ")}function U(g,M){for(;M<g.length&&(g[M]===" "||g[M]===" ");)M++;if(M>=g.length)return null;if(g[M]==='"'){var _=g.indexOf('"',M+1);return _<0&&(_=g.length),{name:V(g.substring(M+1,_)),end:_+1}}for(var C=M;C<g.length&&!/[\s:<>\-\[\]"+*!]/.test(g[C]);)C++;return C===M?null:{name:g.substring(M,C),end:C}}function H(g,M,_,C){var $=/^&\s*/.exec(g);$&&(g=g.substring($[0].length));var y=g.match(/^(?:([\[\]?])\s*([ox]?))?\s*(?=[<\-\/\\])/);if(y){var A=y[1]==="]"?"right":"left",s=Yr(g,y[0].length);if(s!=null){for(var k=s.end;k<g.length&&(g[k]===" "||g[k]===" ");)k++;var o=U(g,k);if(o!=null){var a=/^\s*([+*!-]+)?\s*(#\w+)?\s*(?:\[\[(?:[^\]]|\](?!\]))*\]\])?/.exec(g.substring(o.end)),t=a&&a[1]?a[1]:null,n="",v=g.indexOf(":",o.end+(a?a[0].length:0));v>=0&&(n=g.substring(v+1).replace(/^\s+|\s+$/g,""));var R=Cr(o.name,M,_,C),Q=s.right.arrow||!s.left.arrow,L=lr(s.left,y[2]);return{type:"message",from:Q?null:R,to:Q?R:null,fromEdge:Q?A:null,toEdge:Q?null:A,short:y[1]==="?",label:n,lineStyle:s.lineStyle,arrowHead:Q?Nr(s.right):L==="lost"?"lost":Nr(s.left),headDecor:Q?s.right.circle?"circle":null:L==="circle"?"circle":null,tailDecor:Q?L:lr(s.right,""),color:s.color,activate:t&&t.indexOf("+")>=0?R:null,activateColor:a&&a[2]?a[2]:null,deactivate:t&&t.indexOf("-")>=0?R:null,activationSpec:t}}}}var B=null,w=-1,ar=-1,sr=U(g,0);if(sr==null)return null;for(var ir=sr.end;ir<g.length&&(g[ir]===" "||g[ir]===" ");)ir++;if(ir>=g.length)return null;var _r=Yr(g,ir);if(_r==null)return null;for(var Sr=_r.end;Sr<g.length&&Sr<g.length&&(g[Sr]===" "||g[Sr]===" ");)Sr++;var ae=/^([ox]?)\s*([\[\]?])/.exec(g.substring(Sr));if(ae){var se=ae[2]==="["?"left":"right",re=Sr+ae[0].length,Ur=/^\s*([+*!-]+)?\s*(#\w+)?/.exec(g.substring(re)),oe=Ur&&Ur[1]?Ur[1]:null,Ce="",Me=g.indexOf(":",re+(Ur?Ur[0].length:0));Me>=0&&(Ce=g.substring(Me+1).replace(/^\s+|\s+$/g,""));var eo=Cr(sr.name,M,_,C),Hr=_r.right.arrow||!_r.left.arrow,Ne=lr(_r.right,ae[1]);return{type:"message",from:Hr?eo:null,to:Hr?null:eo,fromEdge:Hr?null:se,toEdge:Hr?se:null,short:ae[2]==="?",label:Ce,lineStyle:_r.lineStyle,arrowHead:Hr?Ne==="lost"?"lost":Nr(_r.right):Nr(_r.left),headDecor:Hr?Ne==="circle"?"circle":null:_r.left.circle?"circle":null,tailDecor:Hr?lr(_r.left,""):Ne,color:_r.color,activate:oe&&oe.indexOf("+")>=0?eo:null,activateColor:Ur&&Ur[2]?Ur[2]:null,deactivate:oe&&oe.indexOf("-")>=0?eo:null,activationSpec:oe}}var He=U(g,Sr);if(He==null)return null;var Kr=He.end,Ue=null,O=null,T=g.substring(Kr),N=T.match(/^\s*(\+\+--|--\+\+|\+\+|--|\*\*|!!)\s*(#\w+)?/),D=null,K=null;N&&(D=N[1],K=N[2]||null,Kr+=N[0].length);var P=/^\s*\[\[(?:[^\]]|\](?!\]))*\]\]/.exec(g.substring(Kr));P&&(Kr+=P[0].length);var u="",m=g.indexOf(":",Kr);m>=0&&(u=g.substring(m+1).replace(/^\s+|\s+$/g,""));var G=Cr(sr.name,M,_,C),I=Cr(He.name,M,_,C),er=G,z=I,hr=_r.right,mr=_r.left,ne;_r.left.arrow&&_r.right.arrow?ne="bidirectional":(_r.left.arrow&&(er=I,z=G,hr=_r.left,mr=_r.right),ne=hr.cross?"lost":hr.part?hr.part:hr.async?"open":"filled");var ye=ne!=="bidirectional"&&hr.circle?"circle":null,Je=mr.circle?"circle":mr.cross?"lost":null;(D==="++"||D==="--++"||D==="++--")&&(Ue=z),(D==="--"||D==="--++"||D==="++--")&&(O=er);var _o=D==="**"?z:null,Oo=D==="!!"?z:null;return{type:"message",from:er,to:z,label:V(u),lineStyle:_r.lineStyle,arrowHead:ne,headDecor:ye,tailDecor:Je,color:_r.color,activate:Ue,activateColor:K,deactivate:O,activationSpec:D,createTarget:_o,destroyTarget:Oo,number:null}}function J(g,M,_){for(var C=[],$=0,y=M+1;y<g.length;y++){var A=g[y].replace(/^\s+|\s+$/g,"");if(A==="{{")$++;else if(A==="}}"&&$>0)$--;else if($===0&&(_ instanceof RegExp?_.test(A):A.toLowerCase()===_))return{text:C.join(`
+`),endIdx:y};C.push(A)}return{text:C.join(`
+`),endIdx:g.length-1}}function gr(g){g=g.replace(/^\s+|\s+$/g,"");var M=/^(.*?)(?:^|\s)(#[A-Za-z0-9][A-Za-z0-9\/|:;.\-]*)\s*$/.exec(g);return M?{str:M[1].replace(/^\s+|\s+$/g,""),color:M[2]}:{str:g,color:null}}function X(g,M){M=M||{};for(var _=g.split(/\r\n|\r|\n/),C=[],$={},y=[],A=[],s=null,k=!1,o=null,a={},t=0,n={value:0},v=null,R={},Q=M.styleSheet||Ft.createSheet(),L=!1,B=0,w=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(g)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(g),ar=0;ar<_.length;ar++){var sr=_[ar],ir=sr.replace(/^\s+|\s+$/g,"");if(ir!==""&&ir.charAt(0)!=="'"&&ir.charAt(0)!=="!"){var _r=/^(?:&\s*)?(?:\/\s*(?=[hr]?note\b))?/i.exec(ir);if(_r[0].length>0&&(ir=ir.substring(_r[0].length)),/^<style>$/i.test(ir)){for(var Sr=[];ar+1<_.length;){ar++;var ae=_[ar].replace(/^\s+|\s+$/g,"");if(/^<\/?style>$/i.test(ae))break;ae.charAt(0)!=="'"&&Sr.push(_[ar])}try{Q.addBlock(Sr.join(`
+`))}catch{}continue}var se=/^<style>(.*)<\/style>$/i.exec(ir);if(se!=null){try{Q.addBlock(se[1])}catch{}continue}if(!/^<style\b/i.test(ir)){if(/^skinparam\b/i.test(ir)){var re=ir.match(/^skinparam\s+([A-Za-z][A-Za-z0-9]*)?\s*\{\s*$/i);if(re||/\{\s*$/.test(ir))for(var Ur=re&&re[1]?re[1].toLowerCase():"",oe=1;oe>0&&ar+1<_.length;){ar++;var Ce=_[ar].replace(/^\s+|\s+$/g,"");if(Ce.indexOf("{")>=0&&oe++,Ce.indexOf("}")>=0){oe--;continue}if(oe===1){var Me=Ce.match(/^([A-Za-z][A-Za-z0-9]*)\s*(<<[^>]*>>)?\s+(\S.*)$/);Me&&(R[Ur+Me[1].toLowerCase()+(Me[2]?Me[2].toLowerCase():"")]=Me[3].replace(/\s+$/,""))}}else{var eo=ir.match(/^skinparam\s+([A-Za-z][A-Za-z0-9]*)\s*(<<[^>]*>>)?\s+(\S.*)$/i);eo&&(R[eo[1].toLowerCase()+(eo[2]?eo[2].toLowerCase():"")]=eo[3].replace(/\s+$/,""))}continue}if(/^hide\s+stereotypes?\s*$/i.test(ir)){L=!0;continue}var Hr=ir.match(/^(?:(?:center|left|right)\s+)?(title|header|footer|caption)\s+(.+)$/i);if(Hr){a[Hr[1].toLowerCase()]=Hr[2].replace(/^\s+|\s+$/g,"");continue}var Ne=ir.match(/^(?:(?:center|left|right)\s+)?(title|header|footer|caption)\s*$/i);if(Ne){for(var He=Ne[1].toLowerCase(),Kr=new RegExp("^end\\s*"+He+"$","i"),Ue=[];ar+1<_.length;){ar++;var O=_[ar].replace(/^\s+|\s+$/g,"");if(Kr.test(O))break;Ue.push(O)}a[He]=Ue.join(`
+`);continue}if(/^(hide|show)\b/i.test(ir)){/^show\s+footbox\b/i.test(ir)||Eo.ignoredDirective(M,"sequence",ar,sr);continue}if(/^(mainframe|newpage|rotate)\b/i.test(ir)){Eo.ignoredDirective(M,"sequence",ar,sr);continue}if(!/^scale\b/i.test(ir)){var T=ir.match(/^legend((?:\s+(?:left|right|center|top|bottom))*)\s*$/i);if(T){for(var N=T[1].toLowerCase().split(/\s+/).filter(function(Jl){return Jl!==""}),D=null,K=0;K<N.length;K++)(D==null||/^(left|right|center)$/.test(N[K]))&&(D=N[K]);for(var P=[];ar+1<_.length;){ar++;var u=_[ar].replace(/^\s+|\s+$/g,"");if(/^end\s*legend\b/i.test(u))break;P.push(u)}o={position:D||"center",lines:P};continue}if(!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(ir)){var m=ir.toLowerCase(),G=ir.match(/^autoactivate\s+(on|off)$/i);if(G){k=G[1].toLowerCase()==="on";continue}var I=ir.match(/^autonumber(?:\s+(\d+))?(?:\s+(\d+))?(?:\s+"([^"]*)")?$/i);if(I){s={start:I[1]?parseInt(I[1],10):1,increment:I[2]?parseInt(I[2],10):1,format:I[3]||null},t=s.start;continue}if(/^autonumber\s+stop$/i.test(ir)){s=null;continue}if(/^autonumber\s+resume/i.test(ir)){s==null&&(s={start:1,increment:1,format:null});continue}var er=ir.match(/^box(?:\s+"([^"]*)"|\s+(\S+))?(?:\s+(#\S+))?$/i);if(er){v={label:V(er[1]||er[2]||""),color:er[3]||null,participants:[]},A.push(v);continue}if(/^end\s*box$/i.test(ir)){v=null;continue}var z=ir.match(/^(participant|actor|boundary|control|entity|database|collections|queue)\s+(.+)$/i);if(z&&!/^[<\-]/.test(z[2])){var hr=z[1].toLowerCase(),mr=z[2],ne=null,ye=null,Je=null,_o=null,Oo=mr.match(/^(\S+)\s*\[\s*$/);if(Oo){for(var qe=[];ar+1<_.length;){ar++;var St=_[ar].replace(/^\s+|\s+$/g,"");if(St==="]")break;qe.push(St)}var ht=Oo[1];$.hasOwnProperty(ht)||($[ht]=C.length,C.push({id:ht,name:ht,kind:hr,color:null,stereotype:null,stereoLetter:null,stereoColor:null,bodyLines:qe,order:n.value++,created:!1,box:v?A.indexOf(v):null}),v&&v.participants.push(ht));continue}var nn=U(mr,0);if(nn){ne=nn.name;var Tt=mr.substring(nn.end).replace(/^\s+/,""),Lo=Tt.match(/^as\s+/i);if(Lo){var Qt=Tt.substring(Lo[0].length),pt=U(Qt,0);pt&&(Qt.charAt(0)==='"'&&mr.charAt(0)!=='"'?(ye=ne,ne=pt.name):ye=pt.name,Tt=Qt.substring(pt.end).replace(/^\s+/,""))}var So=Tt.match(/^(#\S+)(.*)/);So&&(Je=So[1],Tt=So[2].replace(/^\s+/,""));var it=Tt.match(/^<<\s*([^>]*)\s*>>/),qt=null,Pt=null;if(it){_o=it[1].replace(/^\s+|\s+$/g,"");var We=_o.match(/^\(\s*([A-Za-z])\s*,\s*(#[0-9A-Fa-f]{3,8})\s*\)\s*(.*)$/);We&&(qt=We[1],Pt=We[2],_o=We[3].replace(/^\s+|\s+$/g,"")||null)}var pn=ye||ne;if($.hasOwnProperty(pn)){var Gn=$[pn],Xe=C[Gn];hr!=="participant"&&(Xe.kind=hr),Je&&(Xe.color=Je),_o&&(Xe.stereotype=_o)}else{var ra={id:pn,name:ne,kind:hr,color:Je,stereotype:_o,stereoLetter:qt,stereoColor:Pt,order:n.value++,created:!1,box:v?A.indexOf(v):null};$[pn]=C.length,C.push(ra),v&&v.participants.push(pn)}}continue}var f=ir.match(/^create\s+(?:(participant|actor|boundary|control|entity|database|collections|queue)\s+)?(.+)$/i);if(f){var d=f[1]?f[1].toLowerCase():"participant",b=U(f[2],0);if(b){var E=b.name,ur=f[2].substring(b.end).replace(/^\s+/,""),Er=ur.match(/^as\s+(\S+)/i);if(Er&&(E=Er[1]),$.hasOwnProperty(E))C[$[E]].created=!0;else{var ke={id:E,name:b.name,kind:d,color:null,stereotype:null,order:n.value++,created:!0,box:v?A.indexOf(v):null};$[E]=C.length,C.push(ke),v&&v.participants.push(E)}y.push({type:"create",participant:E})}continue}var dr=ir.match(/^(activate|deactivate|destroy)\s+("[^"]*"|\S+?)\s*(#\w+)?(?:\s+(#\w+))?\s*$/i);if(dr){var Go=dr[1].toLowerCase(),lo=dr[2];lo.charAt(0)==='"'&&(lo=V(lo.substring(1,lo.length-1)));var vo={type:Go,participant:Cr(lo,C,$,n)};Go==="activate"&&(vo.color=dr[3]||null,vo.lineColor=dr[4]||null),y.push(vo);continue}if(/^deactivate$/i.test(ir)){y.push({type:"deactivate",participant:null});continue}var Rn=ir.match(/^return(?:\s+(#\w+)\s+|\s+|$)(.*)$/i);if(Rn){var rn={type:"message",from:null,to:null,label:Rn[2]?V(Rn[2].replace(/^\s+|\s+$/g,"")):"",lineStyle:"dashed",arrowHead:"filled",color:Rn[1]||null,activate:null,deactivate:null,number:null,isReturn:!0,index:ar,raw:sr};s&&(rn.number=t,rn.numberText=Y(t,s.format),t+=s.increment),y.push(rn);continue}var Co=ir.match(/^(h?note|rnote)(?:\s*<<[^>]*>>)?\s+(left|right|over|across|top|bottom)\b(?:\s+of\b)?(?:(.+?)\s*)?$/i);if(Co){var Dn=Co[1].toLowerCase(),Ve=Co[2].toLowerCase(),dt=Co[3]||"";dt=dt.replace(/^((?:[^:\[]|\[(?!\[))*?)\s*\[\[(?:[^\]]|\](?!\]))*\]\]/,"$1");var $t=dt.indexOf(":"),Sa=$t>=0,ba=Sa?dt.substring(0,$t):dt,sl=Sa?dt.substring($t+1).replace(/^\s+|\s+$/g,""):"",ua=gr(ba.replace(/\s*<<[^>]*>>/g,"")),ea=ua.color,fn=ua.str?ua.str.split(/\s*,\s*/):[];if((Ve==="top"||Ve==="bottom")&&fn.length>0){Eo.droppedLine(M,"sequence",ar,sr,'is not sequence diagram syntax (plantuml.jar answers "Syntax Error?": a note goes left, right or over a participant, or top / bottom of the previous arrow)');var ui=Sa?-1:Eo.blockEnd(_,ar,/^\s*end\s*[rh]?note\b/i);ui>=0&&(ar=ui);continue}for(var oi=0;oi<fn.length;oi++)fn[oi]=Cr(fn[oi],C,$,n);if(!Sa){var Zl=J(_,ar,/^end\s*[hr]?note$/i);ar=Zl.endIdx,sl=Zl.text}y.push({type:"note",position:Ve,over:fn,text:V(sl),color:ea,shape:Dn==="rnote"?"box":Dn==="hnote"?"hexagon":"note"});continue}var Ca=ir.match(/^==\s*(.*?)\s*==$/);if(Ca){y.push({type:"divider",label:V(Ca[1])});continue}var Cl=ir.match(/^(?:\.{3}|…)(?:(.*)(?:\.{3}|…))?$/);if(Cl){y.push({type:"delay",label:V((Cl[1]||"").replace(/^\s+|\s+$/g,""))});continue}var Aa=ir.match(/^\|\|(\d+)\|\|$/);if(/^\|\|\|$/.test(ir)||Aa){y.push({type:"gap",h:Aa?parseInt(Aa[1],10):null});continue}var en=ir.match(/^(group|alt|else|also|opt|loop|par|par2|break|critical|end)\b\s*(.*)$/i);if(en){var xt=en[1].toLowerCase(),pl=en[2].replace(/^\s+|\s+$/g,"");if((xt==="end"||xt==="else"||xt==="also")&&B===0){Eo.droppedLine(M,"sequence",ar,sr,(xt==="end"?"closes":"continues")+" a group but no group is open here");continue}if(xt==="end"){B--,y.push({type:"groupEnd"});continue}var Pl=null,Oi=null,el=pl.match(/^(#[A-Za-z0-9]+)(?:\s+(#[A-Za-z0-9]+))?\s*(.*)$/);if(el&&(el[2]?(Pl=el[1],Oi=el[2]):Oi=el[1],pl=el[3]),xt==="else"||xt==="also")y.push({type:"groupElse",label:V(pl),color:Oi});else{var Rl=null;if(xt==="group"&&pl!==""){var $l=/^(.*\[\[.*\]\].*?|.*?)\[(.*)\]$/.exec(pl);$l&&(pl=$l[1].replace(/^\s+|\s+$/g,""),Rl=$l[2])}B++,y.push({type:"groupStart",kind:xt,label:V(pl),cond:Rl!=null?V(Rl):null,color:Oi,headColor:Pl})}continue}var fa=ir.match(/^ref(?:#\w+)?\s+over\s+(.+?)\s*:\s*(.*)$/i);if(fa){for(var xa=gr(fa[1]),fi=xa.str.split(/\s*,\s*/),Nl=0;Nl<fi.length;Nl++)fi[Nl]=Cr(fi[Nl],C,$,n);y.push({type:"ref",over:fi,color:xa.color,label:fa[2].replace(/^\s+|\s+$/g,"")});continue}var jl=ir.match(/^ref(?:#\w+)?\s+over\s+(.+)$/i);if(jl){for(var ha=gr(jl[1].replace(/^\s+|\s+$/g,"")),Bi=ha.str.split(/\s*,\s*/),Ii=0;Ii<Bi.length;Ii++)Bi[Ii]=Cr(Bi[Ii],C,$,n);var mi=J(_,ar,/^end\s*(?:ref)?$/i);ar=mi.endIdx,y.push({type:"ref",over:Bi,color:ha.color,label:mi.text});continue}var Mi=ir.replace(/^(\S+)\s+-{2,}>?\s*$/,"$1 ->]"),qa=H(Mi,C,$,n);if(qa){qa.createTarget!=null&&($.hasOwnProperty(qa.createTarget)&&(C[$[qa.createTarget]].created=!0),y.push({type:"create",participant:qa.createTarget})),k&&qa.activationSpec==null&&qa.arrowHead!=="lost"&&qa.arrowHead!=="none"&&(qa.lineStyle!=="solid"?qa.deactivate=qa.from!=null?qa.from:qa.to:qa.activate=qa.to!=null?qa.to:qa.from),s&&(qa.number=t,qa.numberText=Y(t,s.format),t+=s.increment),y.push(qa),qa.destroyTarget!=null&&y.push({type:"destroy",participant:qa.destroyTarget});continue}if(/^[rh]?note\b/i.test(ir)){Eo.droppedLine(M,"sequence",ar,sr,'is not sequence diagram syntax (plantuml.jar answers "Syntax Error?")');var Ni=/:/.test(ir)?-1:Eo.blockEnd(_,ar,/^\s*end\s*[rh]?note\b/i);Ni>=0&&(ar=Ni);continue}Eo.droppedLine(M,"sequence",ar,sr)}}}}}if(Ft.hasUserRules(Q)){for(var on=Ft.createSheet(),yi=function(Jl,ki,Di,bi){var ti=Ft.plainStyle(Jl,Ft.signature(["root","element","sequenceDiagram"].concat(ki),-1,[],!1)),Hi=bi?Ft.color(ti,Di):Ft.raw(ti,Di);return Hi==null||Hi==="none"?null:String(Hi)},xl=function(Jl,ki,Di,bi){var ti=yi(Q,ki,Di,bi);ti!=null&&ti!==yi(on,ki,Di,bi)&&(R[Jl]=ti)},ul=["participant","actor","boundary","control","entity","database","collections","queue"],Fl=0;Fl<ul.length;Fl++)xl(ul[Fl]+"backgroundcolor",[ul[Fl]],"BackGroundColor",!0),xl(ul[Fl]+"bordercolor",[ul[Fl]],"LineColor",!0),xl(ul[Fl]+"fontcolor",[ul[Fl]],"FontColor",!0);xl("sequencearrowcolor",["arrow"],"LineColor",!0),xl("sequencearrowthickness",["arrow"],"LineThickness",!1),xl("sequencelifelinebackgroundcolor",["lifeLine"],"BackGroundColor",!0),xl("sequencelinethickness",["lifeLine"],"LineThickness",!1),xl("sequencedividerbackgroundcolor",["separator"],"BackGroundColor",!0),xl("sequencedividerbordercolor",["separator"],"LineColor",!0),xl("sequencedividerfontcolor",["separator"],"FontColor",!0)}for(var di=0;di<C.length;di++){var fl=C[di],ol=(fl.kind||"participant").toLowerCase(),Al=fl.stereotype?"<<"+fl.stereotype.toLowerCase()+">>":null;fl.colorInline=fl.color!=null,fl.color==null&&(fl.color=(Al?R[ol+"backgroundcolor"+Al]:null)||R[ol+"backgroundcolor"]||null),fl.borderColor=(Al?R[ol+"bordercolor"+Al]:null)||R[ol+"bordercolor"]||null,fl.fontColor=(Al?R[ol+"fontcolor"+Al]:null)||R[ol+"fontcolor"]||null}return{participants:C,elements:y,boxes:A,autonumber:s,legend:o,title:a.title||null,header:a.header||null,footer:a.footer||null,caption:a.caption||null,monochrome:w,skin:R,hideStereotype:L}}return{parse:X}})();var sc=(function(){function Ar(C){return C.replace(/^\s+|\s+$/g,"")}function Z(C){if(C==null)return"state";var $=C.toLowerCase();switch($){case"fork":case"join":case"choice":case"start":case"end":case"entrypoint":case"exitpoint":return $;default:return"state"}}var Mr=null;function Yr(C,$){return $.hasOwnProperty(C)?$[C]:!lr(C)&&Mr.hasOwnProperty(C)?Mr[C].state:null}function fe(C,$,y,A){y[C.id]=C,$.push(C),lr(C.id)||(Mr[C.id]={state:C,holders:[$],stateMap:y,declared:A})}function Wr(C,$,y){var A=Mr.hasOwnProperty(C.id)?Mr[C.id]:null;if(!(A==null||A.declared)&&(A.declared=!0,A.stateMap!==y)){for(var s=0;s<A.holders.length;s++){var k=A.holders[s].indexOf(C);k>=0&&A.holders[s].splice(k,1)}delete A.stateMap[C.id],y[C.id]=C,$.push(C),A.holders=[$],A.stateMap=y}}function Nr(C,$,y,A){var s=Yr(C,y);if(s!=null)return A&&Wr(s,$,y),s;var k="state";C==="[*]_start"||C==="[*]_end"?k=C==="[*]_start"?"initial":"final":C==="[H]"?k="history_shallow":C==="[H*]"&&(k="history_deep");var o={id:C,name:C,description:[],stereotype:null,color:null,kind:k,children:null,concurrent:!1};return fe(o,$,y,A===!0),o}function lr(C){return C==="[*]_start"||C==="[*]_end"||C==="[H]"||C==="[H*]"}function Y(C,$,y){for(var A={},s=0;s<$.length;s++){var k=$[s];if(lr(k.id)){var o=C+"$"+k.id;A[k.id]=o,k.id=o}}for(var a=0;a<y.length;a++){var t=y[a];A.hasOwnProperty(t.from)&&(t.from=A[t.from]),A.hasOwnProperty(t.to)&&(t.to=A[t.to])}}function Cr(C,$){var y=C.length,A=$,s=null,k=0;if(A>=y||C[A]!=="-")return null;A++,k++;var o=C.substring(A).match(/^(left|right|up|down|l|r|u|d)(?=-)/i);if(o){var a=o[1].toLowerCase();switch(a){case"left":case"l":s="left";break;case"right":case"r":s="right";break;case"up":case"u":s="up";break;case"down":case"d":s="down";break}A+=o[1].length}for(;A<y&&C[A]==="-";)k++,A++;return k<1||A>=y||C[A]!==">"?null:(A++,{end:A,direction:s,dashCount:k})}function V(C,$){for(;$<C.length&&(C[$]===" "||C[$]===" ");)$++;if($>=C.length)return null;if(C[$]==="["){var y=C.indexOf("]",$);if(y>=0){var A=C.substring($+1,y);if(A==="*"||A==="H"||A==="H*")return{name:"["+A+"]",end:y+1}}return null}if(C[$]==="="){var s=C.substring($).match(/^==+\s*([\w.]+)\s*==+/);return s?{name:s[1],end:$+s[0].length,bar:!0}:null}if(C[$]==='"'){var k=C.indexOf('"',$+1);return k<0&&(k=C.length),{name:C.substring($+1,k),end:k+1}}for(var o=$;o<C.length&&/[\w]/.test(C[o]);)o++;return o===$?null:{name:C.substring($,o),end:o}}function U(C,$,y){for(var A=C.length,s=y.transitions||[],k=y.notes||[],o=0;o<s.length;o++)C.push(s[o]);for(var a=0;a<k.length;a++)k[a].position==="link"&&k[a].linkIndex!=null&&(k[a].linkIndex+=A),$.push(k[a])}function H(C,$,y,A){var s=1,k=[],o=Ar(Ar(C[$]).substring(y+1));if(o!==""&&o!=="}"&&k.push(o),o==="}")return{children:[],transitions:[],notes:[],concurrent:!1,regions:null,endIdx:$};for(var a=$+1;a<C.length;a++){for(var t=C[a],n=Ar(t),v=0;v<n.length;v++)if(n[v]==="{")s++;else if(n[v]==="}"&&(s--,s===0)){var R=Ar(n.substring(0,v));return R!==""&&k.push(R),J(k,a,A)}k.push(t)}return J(k,a-1,A)}function J(C,$,y){for(var A=y||"composite",s=[[]],k=null,o=0;o<C.length;o++){var a=Ar(C[o]).match(/^(--+|\|\|+)$/);a?(k==null&&(k=a[1].charAt(0)),s.push([])):s[s.length-1].push(C[o])}for(var t=[],n=0;n<s.length;n++)s[n].length>0&&t.push(s[n]);if(t.length>1){for(var v=[],R=[],Q=[],L=[],B=0;B<t.length;B++){var w=g(t[B].join(`
+`));Y(A+"#"+B,w.states,w.transitions),v.push({states:w.states,transitions:w.transitions,notes:w.notes});for(var ar=0;ar<w.states.length;ar++){R.push(w.states[ar]);var sr=Mr.hasOwnProperty(w.states[ar].id)?Mr[w.states[ar].id]:null;sr!=null&&sr.state===w.states[ar]&&sr.holders.push(R)}U(Q,L,w)}return{children:R,transitions:Q,notes:L,concurrent:!0,regions:v,sepChar:k,endIdx:$}}var ir=g(t.length?t[0].join(`
+`):"");return Y(A,ir.states,ir.transitions),{children:ir.states,transitions:ir.transitions,notes:ir.notes,concurrent:!1,regions:null,sepChar:null,endIdx:$}}var gr=null,X=null;function g(C,$){for(var y=C.split(/\r\n|\r|\n/),A=[],s={},k=[],o=[],a=!1,t=0;t<y.length;t++){var n=y[t],v=Ar(n);if(v!==""&&v.charAt(0)!=="'"&&v.charAt(0)!=="!"){if(/^<style\b/i.test(v)){for(;!/<\/style>/i.test(Ar(y[t]))&&t+1<y.length;)t++;continue}if(/^skinparam\b/i.test(v)){if(/\{\s*$/.test(v))for(var R=1;R>0&&t+1<y.length;){t++;var Q=Ar(y[t]);Q.indexOf("{")>=0&&R++,Q.indexOf("}")>=0&&R--}continue}if(/^(hide|show|newpage)\b/i.test(v)){/^hide\s+empty\s+description\s*$/i.test(v)||Eo.ignoredDirective(gr,"state",$?t:null,n);continue}if(/^note\s+(?:"[^"]*"\s+)?as\s+\S+\s*(?:#[\w:;.]+)?\s*$/i.test(v)){var L=Ua.take(X,y,t);if(L>=0){t=L;continue}}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(v)){var B=Ua.take(X,y,t);if(B>=0){t=B;continue}}if(!(/^(title|header|footer|caption|scale|mainframe)\b/i.test(v)||/^set\s+(?:namespace)?separator\b/i.test(v))&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(v)){if(/^(--+|\|\|+)$/.test(v)){a=!0;continue}var w=v.match(/^note\s+(left|right)\s+of\s+(\S+)(?:\s+#[\w;:.]+)?\s*:\s*(.*)$/i);if(w){o.push({position:w[1].toLowerCase(),target:w[2],text:Ar(w[3])});continue}var ar=v.match(/^note\s+(left|right)\s+of\s+(\S+)(?:\s+#[\w;:.]+)?\s*$/i);if(ar){for(var sr=ar[1].toLowerCase(),ir=ar[2],_r=[],Sr=t+1;Sr<y.length;Sr++){var ae=Ar(y[Sr]);if(/^end\s*note$/i.test(ae)){t=Sr;break}_r.push(Ar(y[Sr]))}o.push({position:sr,target:ir,text:_r.join(`
+`)});continue}var se=v.match(/^note(?:\s+(left|right|top|bottom))?\s+on\s+link\s*(?::\s*(.*))?$/i);if(se&&k.length>0){var re={position:"link",side:(se[1]||"right").toLowerCase(),target:null,linkIndex:k.length-1,text:""};if(se[2]!=null)re.text=Ar(se[2]);else{for(var Ur=[],oe=t+1;oe<y.length;oe++){if(/^end\s*note$/i.test(Ar(y[oe]))){t=oe;break}Ur.push(Ar(y[oe]))}re.text=Ur.join(`
+`)}o.push(re);continue}var Ce=v.match(/^state\s+(.+)$/i);if(Ce){var Me=Ce[1],eo=null,Hr=null,Ne=null,He=null,Kr=V(Me,0);if(Kr){eo=Kr.name;var Ue=Me.substring(Kr.end),O=Ue.match(/^\s+as\s+(\S+)(.*)/i);O&&(Hr=O[1],Ue=O[2]);var T=Ue.match(/\s*<<\s*([^>]*)\s*>>/);T&&(Ne=Ar(T[1]),Ue=Ue.substring(0,Ue.indexOf("<<"))+Ue.substring(Ue.indexOf(">>")+2));var N=Ue.match(/\s*(#\S+)/);N&&(He=N[1],Ue=Ue.replace(N[0],""));var D=Hr||eo,K=Z(Ne),P;P=Yr(D,s),P!=null?(Wr(P,A,s),Ne&&(P.stereotype=Ne,P.kind=K),He&&(P.color=He),Hr&&eo!==D&&(P.name=eo)):(P={id:D,name:Hr?eo:D,description:[],stereotype:Ne,color:He,kind:K,children:null,concurrent:!1,regions:null,regionSep:null},fe(P,A,s,!0));var u=Ue.match(/^\s*:\s*(.+?)\s*$/);if(u&&P.description.push(u[1]),Ue=Ar(Ue),Ue.length>0&&Ue.charAt(Ue.length-1)==="{"){var m=v.lastIndexOf("{"),G=H(y,t,m,D);P.children=G.children||[],P.concurrent=G.concurrent,P.regions=G.regions||null,P.regionSep=G.sepChar||null,U(k,o,G),t=G.endIdx}else if(Ue==="{"){var I=v.lastIndexOf("{"),er=H(y,t,I,D);P.children=er.children||[],P.concurrent=er.concurrent,P.regions=er.regions||null,P.regionSep=er.sepChar||null,U(k,o,er),t=er.endIdx}}continue}var z=v.match(/^(\S+)\s*:\s*(.*)$/);if(z){var hr=z[1];if(hr!=="note"&&hr.indexOf("-")<0){var mr=Nr(hr,A,s,!0);mr.description.push(Ar(z[2]));continue}}var ne=M(v,A,s);if(ne){k.push(ne);continue}if(/^[rh]?note\b/i.test(v)){Eo.droppedNote(gr,"state","note form",$?t:null,n);var ye=/:/.test(v)?-1:Eo.blockEnd(y,t,/^\s*end\s*[rh]?note\b/i);ye>=0&&(t=ye);continue}Eo.droppedLine(gr,"state",$?t:null,n)}}}return{states:A,transitions:k,notes:o,hasConcurrentSep:a}}function M(C,$,y){var A=null,s=null,k=!1;C=C.replace(/(-)\[([^\]\[]*)\](?=[-\w>])/,function(Hr,Ne,He){for(var Kr=He.split(","),Ue=0;Ue<Kr.length;Ue++){var O=Kr[Ue].replace(/^\s+|\s+$/g,"");O.charAt(0)==="#"?A=O:/^(dashed|dotted)$/i.test(O)?s=O.toLowerCase():(/^bold$/i.test(O)||/^thickness\s*=\s*\d+/i.test(O))&&(k=!0)}return Ne});var o=V(C,0);if(o==null)return null;for(var a=o.end;a<C.length&&(C[a]===" "||C[a]===" ");)a++;if(a>=C.length)return null;var t=Cr(C,a);if(t==null)return null;for(var n=t.end;n<C.length&&(C[n]===" "||C[n]===" ");)n++;var v=V(C,n);if(v==null)return null;var R=o.name,Q=v.name,L,B;if(R==="[*]")L="[*]_start",Nr(L,$,y);else if(R==="[H]"||R==="[H*]")L=R,Nr(L,$,y);else{L=R;var w=Nr(L,$,y);o.bar&&w.kind==="state"&&(w.kind="fork")}var ar=C.substring(v.end).match(/^\[(H\*?)\]/),sr=!1;if(ar&&Q!=="[*]"&&Q.charAt(0)!=="["){var ir=Yr(Q,y);if(ir!=null){var _r=Q+"$["+ar[1]+"]",Sr=null;ir.children==null&&(ir.children=[]);for(var ae=0;ae<ir.children.length;ae++)ir.children[ae].id===_r&&(Sr=ir.children[ae]);Sr==null&&ir.children.push({id:_r,name:ar[1],description:[],stereotype:null,color:null,kind:ar[1]==="H*"?"history_deep":"history_shallow",children:null,concurrent:!1,regions:null}),B=_r,sr=!0}}if(!sr)if(Q==="[*]")B="[*]_end",Nr(B,$,y);else if(Q==="[H]"||Q==="[H*]")B=Q,Nr(B,$,y);else{B=Q;var se=Nr(B,$,y);v.bar&&se.kind==="state"&&(se.kind="fork")}var re="",Ur=null,oe=v.end,Ce=C.indexOf(":",oe);if(Ce>=0){re=Ar(C.substring(Ce+1));var Me=re.match(/^\[([^\]]*)\]/),eo=re.match(/\[([^\]]*)\]\s*$/);Me?Ur=Me[1]:eo&&(Ur=eo[1])}return{from:L,to:B,label:re,guard:Ur,dashCount:t.dashCount,direction:t.direction,color:A,lineStyle:s,bold:k}}function _(C,$){$=$||{},gr=$,Mr={},X={title:null,header:null,footer:null,caption:null,legend:null};var y;try{y=g(C,!0)}finally{gr=null,Mr=null}var A=null;if(y.transitions&&y.transitions.length>0){for(var s=!0,k=!1,o=0;o<y.transitions.length;o++){var a=y.transitions[o];if(a.from&&a.to&&a.from.indexOf("[*]")<0&&a.to.indexOf("[*]")<0&&a.dashCount!=null&&(k=!0,a.dashCount>1)){s=!1;break}}k&&s&&(A="LR")}return Ua.merge({states:y.states,transitions:y.transitions,notes:y.notes,direction:A},X)}return{parse:_}})();var uc=(function(){var Ar=null;function Z(A,s){var k=A.split(/\r\n|\r|\n/),o=[],a=!1;o.lines=[],o.config=s||null;for(var t=0;t<k.length;t++){var n=k[t],v=n.replace(/^\s+|\s+$/g,"");if(a){n.indexOf("'/")>=0&&(a=!1);continue}if(v!==""){if(v.substring(0,2)==="/'"){v.indexOf("'/",2)<0&&(a=!0);continue}if(v.charAt(0)!=="'"&&v.charAt(0)!=="!"){if(/^skinparam\b/i.test(v)){if(/\{\s*$/.test(v))for(var R=1;R>0&&t+1<k.length;){t++;var Q=k[t].replace(/^\s+|\s+$/g,"");Q.indexOf("{")>=0&&R++,Q.indexOf("}")>=0&&R--}continue}if(/^(hide|show|newpage)\b/i.test(v)){Eo.ignoredDirective(s,"activity",t,n);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(v)){var L=Ua.take(Ar,k,t);if(L>=0){t=L;continue}}if(!/^(title|header|footer|caption|scale|mainframe)\b/i.test(v)){if(/^legend\b/i.test(v)){Eo.droppedNote(s,"activity","legend",t,n);continue}/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(v)||(o.push(v),o.lines.push(t))}}}}return o}function Mr(A){return A==null?"":A.replace(/^\s*(?:->)?\s*(?:\[#[^\]]*\]|#[a-zA-Z0-9.]+)?\s*/,"").replace(/^\s+|\s+$/g,"")}function Yr(){for(var A=0;A<arguments.length;A++)if(arguments[A]!=null)return arguments[A].replace(/^\s+|\s+$/g,"");return""}function fe(A,s){var k=A.replace(/;\s*$/,"").replace(/\s+$/,""),o=new RegExp("^"+s.split(/\s+/).join("\\s*"),"i").exec(k);if(o==null)return!1;var a=k.substring(o[0].length);return a===""||/^[\s(]/.test(a)}function Wr(A,s){for(var k=0;k<A.length;k++)if(A[k].replace(/\s+/g,"")===s)return k;return-1}function Nr(A){for(var s={color:null,colors:[],dashed:!1,dotted:!1,bold:!1,hidden:!1,thickness:null},k=String(A??"").split(/[;,]/),o=0;o<k.length;o++){var a=k[o].replace(/^\s+|\s+$/g,"").toLowerCase();a!==""&&(a.charAt(0)==="#"?(s.colors.push(a),s.color==null&&(s.color=a)):a==="dashed"?s.dashed=!0:a==="dotted"?s.dotted=!0:a==="bold"?s.bold=!0:a==="hidden"?s.hidden=!0:/^thickness=/.test(a)&&(s.thickness=parseFloat(a.substring(10))))}return s}function lr(A,s,k,o,a){for(;s<A.length;){var t=A[s],n=t.toLowerCase();if(o){for(var v=0;v<o.length;v++)if(fe(t,o[v]))return s;if(Wr(o,"elseif")>=0&&V.test(t))return s}var R=t.match(/^(?:-\[([^\]]*)\]->|-+>)\s*(?:(.*?)\s*;|(.*?))\s*$/);if(R){var Q=Nr(R[1]);Q.type="arrowLabel",Q.label=R[2]!=null?R[2]:R[3]||"",k.push(Q),s++;continue}var L=t.match(/^start\s*;?\s*((?:<<[^>]*>>\s*)*)$/i);if(L){var B=X(L[1]);k.push({type:"start",color:B.color,lineColor:B.lineColor}),s++;continue}var w=t.match(/^stop\s*;?\s*((?:<<[^>]*>>\s*)*)$/i);if(w){var ar=X(w[1]);k.push({type:"stop",color:ar.color,lineColor:ar.lineColor}),s++;continue}var sr=t.match(/^end\s*;?\s*((?:<<[^>]*>>\s*)*)$/i);if(sr){var ir=X(sr[1]);k.push({type:"end",color:ir.color,lineColor:ir.lineColor}),s++;continue}if(/^(?:detach|kill)\s*;?\s*$/i.test(t)){k.push({type:"detach"}),s++;continue}if(/^break\s*;?\s*$/i.test(t)){k.push({type:"break"}),s++;continue}var _r=t.match(/^(label|goto)\s+([\w.]+)\s*;?\s*$/i);if(_r){k.push({type:_r[1].toLowerCase(),name:_r[2]}),s++;continue}var Sr=t.match(/^\((\S)\)\s*;?\s*$/);if(Sr){k.push({type:"spot",letter:Sr[1]}),s++;continue}var ae=t.match(/^\|(\s*#([^|]*)\s*)?\|?\s*([^|]+?)\s*\|$/);if(ae||(ae=t.match(/^\|([^|]*)\|$/)),ae){var se=null,re=null,Ur=t.match(/^\|#([^|]+)\|([^|]+)\|$/);if(Ur)re="#"+Ur[1],se=Ur[2].replace(/^\s+|\s+$/g,"");else{var oe=t.match(/^\|([^|]+)\|$/);oe&&(se=oe[1].replace(/^\s+|\s+$/g,""))}if(se){for(var Ce=!1,Me=0;Me<a.length;Me++)if(a[Me].name===se){Ce=!0,re&&!a[Me].color&&(a[Me].color=re);break}Ce||a.push({name:se,color:re}),k.push({type:"swimlane",name:se})}s++;continue}var eo=t.match(/^(floating\s+)?note(?:\s+(left|right))?((?:\s*(?:#[\w\-\\|/]+|<<[^>]*>>))*)\s*(:\s*(.*))?$/i);if(eo&&(eo[4]!=null||/^\s*$/.test(t.substring(eo[0].length)))){var Hr=eo[3]||"",Ne=Hr.match(/#[\w\-\\|/]+/),He=Hr.match(/<<\s*([^>]*?)\s*>>/),Kr={type:"note",position:(eo[2]||"left").toLowerCase(),text:"",floating:!!eo[1],color:Ne?Ne[0]:null,stereotype:He?He[1]:null};if(eo[4]!=null){Kr.text=(eo[5]||"").replace(/^\s+|\s+$/g,""),k.push(Kr),s++;continue}var Ue=[];for(s++;s<A.length;){if(/^end\s*note$/i.test(A[s])){s++;break}Ue.push(A[s]),s++}Kr.text=Ue.join(`
+`),k.push(Kr);continue}var O=M(A,s,/^(?:\[\[[^\]]*\]\]\s*)?if\s*(?:<<[^>]*>>\s*)?\s*\(/i,Y),T=O!=null?O.line.match(Y):null;if(T){var N={type:"if",condition:T[1].replace(/^\s+|\s+$/g,""),thenLabel:Yr(T[2],T[3],T[4]),elseLabel:"",thenBranch:[],elseBranch:[],elseIfBranches:[]};for(s=O.next,s=lr(A,s,N.thenBranch,["else","elseif","endif","end if"],a);s<A.length;){if(H.test(A[s])){s++;break}var D=M(A,s,/^(?:\[\[[^\]]*\]\]\s*)?(?:\([^)]*\)\s*)?else\s*if\s*/i,Cr),K=D!=null?D.line.match(Cr):null;if(K){var P={condition:K[2].replace(/^\s+|\s+$/g,""),incomingLabel:Mr(K[1]),thenLabel:Yr(K[3],K[4],K[5]),body:[]};s=D.next,s=lr(A,s,P.body,["else","elseif","endif","end if"],a),N.elseIfBranches.push(P);continue}var u=A[s].match(U),m=u||A[s].match(/^else\s*(?:\((?:->)?([\s\S]*?)\))?\s*;?\s*$/i);if(m){N.elseLabel=m[1]!=null?m[1].replace(/^\s+|\s+$/g,""):"",s++,s=lr(A,s,N.elseBranch,["endif","end if"],a),s<A.length&&H.test(A[s])&&s++;break}s++;break}k.push(N);continue}var G=t.match(/^while\s*\(([^)]*)\)\s*(?:is\s*\(([^)]*)\))?\s*$/i);if(G){var I={type:"while",condition:G[1].replace(/^\s+|\s+$/g,""),isLabel:G[2]!=null?G[2].replace(/^\s+|\s+$/g,""):"",endLabel:"",body:[]};if(s++,s=lr(A,s,I.body,["end while","while end"],a),s<A.length){var er=A[s].match(/^(?:end\s*while|while\s*end)\s*(?:\(([^)]*)\))?\s*;?\s*$/i);er&&(I.endLabel=er[1]!=null?er[1].replace(/^\s+|\s+$/g,""):"",s++)}k.push(I);continue}var z=t.match(/^(?:#([a-zA-Z0-9.]+)\s+)?repeat\s*(?::\s*(.*?)\s*;)?(?:\s*<<[^>]*>>)?\s*$/i);if(z){var hr={type:"repeat",label:z[2]!=null?z[2]:"",color:z[1]?"#"+z[1]:null,backward:null,body:[],condition:"",isLabel:"",notLabel:""};s++,s=lr(A,s,hr.body,["repeat while"],a);for(var mr=[],ne=0;ne<hr.body.length;ne++)hr.body[ne].type==="backward"?hr.backward==null&&(hr.backward=hr.body[ne]):mr.push(hr.body[ne]);if(hr.body=mr,s<A.length){var ye=A[s].match(gr);ye&&(hr.condition=Yr(ye[1]),hr.isLabel=Yr(ye[2]),hr.notLabel=Yr(ye[3]),(ye[4]!=null||ye[5])&&(hr.exitArrow=Nr(ye[4]),hr.exitArrow.label=Yr(ye[5])),hr.testColor=g(ye[6]),s++)}k.push(hr);continue}var Je=t.match(/^(?:\(([^)]*)\)\s*)?backward\s*:\s*(.*?)\s*;(?:\s*\(([^)]*)\))?(?:\s*<<[^>]*>>)?\s*$/i);if(Je){k.push({type:"backward",label:Je[2],incomingLabel:Mr(Je[1]),outgoingLabel:Mr(Je[3])}),s++;continue}var _o=t.match(/^backward\s*:\s*(.*)$/i);if(_o&&t.charAt(t.length-1)!==";"){var Oo=[_o[1]];for(s++;s<A.length;){var qe=A[s];if(qe.charAt(qe.length-1)===";"){Oo.push(qe.substring(0,qe.length-1)),s++;break}Oo.push(qe),s++}k.push({type:"backward",label:Oo.join(`
+`).replace(/^\s+|\s+$/g,""),incomingLabel:"",outgoingLabel:""});continue}if(/^fork\s*;?\s*$/i.test(t)){var St={type:"fork",branches:[[]]};for(s++,s=lr(A,s,St.branches[0],["fork again","end fork","fork end","end merge"],a);s<A.length;){if(J.test(A[s])){s++;break}if(/^fork\s*again\s*;?\s*$/i.test(A[s])){var ht=[];St.branches.push(ht),s++,s=lr(A,s,ht,["fork again","end fork","fork end","end merge"],a);continue}s++;break}k.push(St);continue}if(/^split\s*;?\s*$/i.test(t)){var nn={type:"split",branches:[[]]};for(s++,s=lr(A,s,nn.branches[0],["split again","end split","split end"],a);s<A.length;){if(/^(?:end\s*split|split\s*end)\s*;?\s*$/i.test(A[s])){s++;break}if(/^split\s*again\s*;?\s*$/i.test(A[s])){var Tt=[];nn.branches.push(Tt),s++,s=lr(A,s,Tt,["split again","end split","split end"],a);continue}s++;break}k.push(nn);continue}var Lo=t.match(/^switch\s*\(([^)]*)\)\s*((?:<<[^>]*>>\s*)*);?\s*$/i);if(Lo){var Qt={type:"switch",condition:Lo[1].replace(/^\s+|\s+$/g,""),color:g(Lo[2]),cases:[]};for(s++;s<A.length;){if(/^end\s*switch\s*;?\s*$/i.test(A[s])){s++;break}var pt=A[s].match(/^case\s*\(([^)]*)\)\s*((?:<<[^>]*>>\s*)*);?\s*$/i);if(pt){var So={label:pt[1].replace(/^\s+|\s+$/g,""),body:[]};s++,s=lr(A,s,So.body,["case","end switch"],a),Qt.cases.push(So);continue}Eo.droppedLine(A.config,"activity",A.lines!=null?A.lines[s]:null,A[s]),s++}k.push(Qt);continue}var it=t.match(/^group\s+(?:"([^"]*)"|(.+?))\s*$/i);if(it){var qt={type:"partition",name:it[1]||it[2],body:[]};s++,s=lr(A,s,qt.body,["end group"],a),s<A.length&&/^end\s+group$/i.test(A[s])&&s++,k.push(qt);continue}var Pt=t.match(/^partition\s+(?:(#\S+)\s+)?(?:"([^"]*)"|([^#\s{]+))(?:\s+(#\S+))?\s*\{\s*$/i);if(Pt){var We={type:"partition",name:Pt[2]||Pt[3],color:Pt[1]||Pt[4]||null,body:[]};s++,s=lr(A,s,We.body,["}"],a),s<A.length&&A[s]==="}"&&s++,k.push(We);continue}var pn=t.match(/^(?:\[\[[^\]]*\]\]\s*)?(?:#([a-zA-Z0-9]+))?:(.*?)([;|/<>\]}\\])\s*((?:<<[^>]*>>\s*)*)$/);if(pn){k.push($(pn[2],pn[3],pn[4],pn[1]?"#"+pn[1]:null)),s++;continue}var ra=t.match(/^[-*][ \t]?(?![-.>\[])((?:<<[^>]*>>\s*)*)(.*?)\s*((?:<<[^>]*>>\s*)*)$/);if(ra&&ra[2].replace(/^\s+|\s+$/g,"")!==""){k.push($(ra[2],";",ra[1]+ra[3],null)),s++;continue}var Gn=t.match(/^(?:\[\[[^\]]*\]\]\s*)?(?:#([a-zA-Z0-9]+))?:(.*)$/);if(Gn&&!/[;|/<>\]}\\]\s*$/.test(t)){var Xe=Gn[1]?"#"+Gn[1]:null,f=[Gn[2]],d=";",b="";for(s++;s<A.length;){var E=A[s].match(/^(.*?)([;|/<>\]}\\])\s*((?:<<[^>]*>>\s*)*)$/);if(E){f.push(E[1]),d=E[2],b=E[3],s++;break}f.push(A[s]),s++}k.push($(f.join(`
+`),d,b,Xe));continue}if(t==="}"){s++;continue}Eo.droppedLine(A.config,"activity",A.lines!=null?A.lines[s]:null,A[s]),s++}return s}var Y=/^(?:\[\[[^\]]*\]\]\s*)?if\s*(?:<<[^>]*>>\s*)?\s*\(([\s\S]*?)\)\s*(?:then\s+when\s+([\s\S]+?)|then\s*(?:\(([\s\S]+?)\))?|(?:is|equals?)\s*\(([\s\S]+?)\)\s*then)?\s*;?\s*(?:<<[^>]*>>\s*)*$/i,Cr=/^(?:\[\[[^\]]*\]\]\s*)?(?:\((?:->|-\[[^\]]*\]->)?([\s\S]*?)\)\s*)?else\s*if\s*(?:<<[^>]*>>\s*)?\s*\(([\s\S]*?)\)\s*(?:then\s+when\s+([\s\S]+?)|then\s*(?:\(([\s\S]+?)\))?|(?:is|equals?)\s*\(([\s\S]+?)\)\s*then)?\s*;?\s*(?:<<[^>]*>>\s*)*$/i,V=/^\((?:->|-\[[^\]]*\]->)?[^)]*\)\s*else\s*if\s*\(/i,U=/^else\s+when\s+(.*?)\s*;?\s*$/i,H=/^end\s*if\s*;?\s*$/i,J=/^(?:end\s*fork|fork\s*end|end\s*merge)\s*;?\s*$/i,gr=new RegExp("^repeat\\s*while\\s*(?:\\(([\\s\\S]*?)\\))?\\s*(?:(?:is|equals?)\\s*\\(([^)]*)\\))?\\s*(?:not\\s*\\(([^)]*)\\))?\\s*(?:(?:-\\[([^\\]]*)\\]->|->)\\s*(.*?))?\\s*;?\\s*((?:<<[^>]*>>\\s*)*)$","i");function X(A){var s={color:null,lineColor:null},k=/<<\s*(#[^>]*?)\s*>>/.exec(A||"");if(k==null)return s;for(var o=k[1].split(";"),a=0;a<o.length;a++){var t=o[a].replace(/^\s+|\s+$/g,""),n=t.match(/^line\s*:\s*(#?[\w-]+)$/i);n?s.lineColor=n[1].charAt(0)==="#"?n[1]:"#"+n[1]:t.charAt(0)==="#"&&s.color==null&&(s.color=t)}return s}function g(A){return X(A).color}function M(A,s,k,o){if(s>=A.length||!k.test(A[s]))return null;for(var a=A[s],t=s+1;!o.test(a)&&t<A.length&&t-s<50;)a+=`
+`+A[t],t++;return o.test(a)?{line:a,next:t}:null}var _={"|":"procedure","<":"input",">":"output","/":"save","\\":"load","]":"task","}":"continuous"},C={input:1,output:1,procedure:1,load:1,save:1,continuous:1,task:1};function $(A,s,k,o){for(var a={type:"action",label:A.replace(/^\s+|\s+$/g,""),color:o,shape:_[s]||null,stereotype:null,stereotypes:[]},t=/<<\s*([^>]*?)\s*>>/g,n;(n=t.exec(k||""))!=null;){var v=n[1];if(/^#/.test(v)){a.color||(a.color=v);continue}v&&a.stereotypes.push(v),C[v.toLowerCase()]?a.shape=v.toLowerCase():v&&!a.stereotype&&(a.stereotype=v)}return a}function y(A,s){s=s||{},Ar={title:null,header:null,footer:null,caption:null,legend:null};var k=Z(A,s),o=[],a=[],t=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(A)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(A),n=A.match(/^skinparam\s+ArrowHeadColor\s+(\S+)\s*$/im)||A.match(/^skinparam(?:\s+\w+)?\s*\{[^}]*\bArrowHeadColor\s+(\S+)/im);return lr(k,0,o,null,a),Ua.merge({nodes:o,swimlanes:a,monochrome:t,arrowHeadColor:n?n[1].toLowerCase():null},Ar)}return{parse:y}})();var fc=(function(){var Ar="A-Za-z0-9_\\u00A0-\\uFFFF",Z=Ar+".",Mr="["+Ar+"]["+Z+"]*",Yr="["+Z+"]+",fe="(?:#\\w+[-\\\\|/]\\w+|#\\w+)",Wr="(?:#\\w+|dotted|dashed|plain|bold|hidden|norank|single|node|thickness=\\d+)(?:,(?:#\\w+|dotted|dashed|plain|bold|hidden|norank|single|node|thickness=\\d+))*",Nr="([-.]+)(?:\\[("+Wr+")\\])?(\\*|left|right|up|down|le?|ri?|up?|do?)?(?:\\[("+Wr+")\\])?([-.]*)>",lr="(?:\\[([^\\]*][^\\]]*)\\])?",Y="(?:(\\(\\*(?:top)?\\))|("+Mr+")|(?:==+)\\s*("+Yr+')\\s*(?:==+)|"([^"]+)"(?:\\s+as\\s+('+Yr+"))?)?",Cr="\\s*(<<[^>]*>>)?\\s*("+fe+")?\\s*(?:\\[\\[[^\\]]*\\]\\])?\\s*",V="(?:(\\(\\*(?:top|\\d+)?\\))|(\\{)|("+Mr+")|(?:==+)\\s*("+Yr+')\\s*(?:==+)|"([^"]+)"(?:\\s+as\\s+('+Mr+"))?|(["+Ar+"].*?))",U='\\s*(<<[^>]*>>)?(?:\\s+in\\s+("[^"]+"|\\S+))?\\s*('+fe+")?\\s*$",H=new RegExp("^"+Y+Cr+Nr+"\\s*"+lr+"\\s*"+V+U,"i"),J=new RegExp("^"+Y+Cr+Nr+"\\s*"+lr+'\\s*"([^"]*)$',"i"),gr=new RegExp('^\\s*([^"]*)"(?:\\s+as\\s+('+Mr+'))?\\s*(<<.*>>)?\\s*(?:in\\s+("[^"]+"|\\S+))?\\s*('+fe+")?\\s*$","i"),X="(?:(\\(\\*(?:top)?\\))|(?:==+)\\s*("+Yr+')\\s*(?:==+)|"([^"]*)"(?:\\s+as\\s+('+Yr+"))?|("+Mr+"))?",g=new RegExp("^"+X+"\\s*(?:"+Nr+")?\\s*"+lr+'\\s*if(?:\\s*"([^"]*)"\\s*(?:as\\s+('+Yr+")\\s+)?|\\s+(.+?)\\s*)(?:then)?\\s*$","i"),M=/^else\s*$/i,_=/^end\s*if\s*$/i,C=new RegExp('^partition\\s+("[^"]+"|\\S+)\\s*('+fe+"|\\w+)?\\s*(<<[^>]*>>)?\\s*(\\{)?\\s*$","i"),$=/^(?:end\s*partition|\})\s*$/i,y=new RegExp("^note\\s*(right|left|top|bottom)?\\s*(?:on|of)\\s+link\\s*("+fe+")?\\s*:\\s*(.*)$","i"),A=new RegExp("^note\\s*(right|left|top|bottom)?\\s*(?:on|of)\\s+link\\s*("+fe+")?\\s*$","i"),s=new RegExp("^note\\s+(right|left|top|bottom)\\s*("+fe+")?\\s*:\\s*(.*)$","i"),k=new RegExp("^note\\s+(right|left|top|bottom)\\s*("+fe+")?\\s*$","i"),o=/^end\s?note\s*$/i;function a(L){return L==null?"":String(L).replace(/^\s+|\s+$/g,"")}function t(L){return L==null?"":a(String(L).replace(/\[\[([^\]\s{]*)(?:\{[^}]*\})?(?:\s+([^\]]*))?\]\]/g,function(B,w,ar){return ar??""}).replace(/\s{2,}/g," "))}function n(L){return L=a(L),L.length>=2&&L.charAt(0)==='"'&&L.charAt(L.length-1)==='"'?L.substring(1,L.length-1):L}function v(L,B,w,ar,sr){L=L||"",sr=sr||"",w=(w||"").toLowerCase();var ir=null;w.indexOf("l")===0?ir="left":w.indexOf("r")===0?ir="right":w.indexOf("u")===0?ir="up":w.indexOf("d")===0&&(ir="down");var _r=(L+sr).replace(/=/g,"-");(ir==="left"||ir==="right")&&(_r=_r.replace(/-+/g,"-")),_r.length===1&&(ir==="up"||ir==="down")&&(_r=_r.charAt(0)+_r);for(var Sr={length:Math.max(1,_r.length),direction:ir,constraint:w!=="*",dotted:(L+sr).indexOf(".")>=0,dashed:!1,bold:!1,hidden:!1,color:null},ae=((B||"")+","+(ar||"")).split(","),se=0;se<ae.length;se++){var re=a(ae[se]).toLowerCase();re!==""&&(re.charAt(0)==="#"?Sr.color=re:re==="dashed"?Sr.dashed=!0:re==="dotted"?Sr.dotted=!0:re==="bold"?Sr.bold=!0:re==="hidden"&&(Sr.hidden=!0))}return Sr}function R(L,B,w,ar,sr){var ir=L.split(/\r\n|\r|\n/),_r=!1,Sr=null,ae=0;B.lines=[];for(var se=0;se<ir.length;se++){var re=ir[se],Ur=a(re);if(_r){re.indexOf("'/")>=0&&(_r=!1);continue}if(Sr!=null){Sr.test(Ur)&&(Sr=null);continue}if(ae>0){if(Ur.indexOf("{")>=0&&ae++,Ur.indexOf("}")>=0&&ae--,ar.skinBlock!=null&&ae>0){var oe=Ur.match(/^([A-Za-z][\w<>]*)\s+(.+)$/);oe&&(w[(ar.skinBlock+oe[1]).toLowerCase()]=a(oe[2]))}ae===0&&(ar.skinBlock=null);continue}if(Ur!==""){if(Ur.substring(0,2)==="/'"){Ur.indexOf("'/",2)<0&&(_r=!0);continue}if(Ur.charAt(0)!=="'"&&Ur.charAt(0)!=="!"&&!/^@(start|end)/i.test(Ur)){if(/^<style\b/i.test(Ur)){/<\/style>/i.test(Ur)||(Sr=/<\/style>/i);continue}var Ce=Ur.match(/^skinparam\s+(?:(\w+)\s*)?\{\s*$/i);if(Ce){ae=1,ar.skinBlock=Ce[1]||"";continue}var Me=Ur.match(/^skinparam\s+([\w<>]+)\s+(.+)$/i);if(Me){w[Me[1].toLowerCase()]=a(Me[2]);continue}if(!/^skinparam\b/i.test(Ur)){if(/^sprite\b/i.test(Ur)){/\{\s*$/.test(Ur)&&(ae=1);continue}var eo=Ur.match(/^(?:(?:center|left|right)\s+)?title\b\s*:?\s*(.*)$/i);if(eo){eo[1]===""?Sr=/^end\s*title\s*$/i:ar.title=eo[1];continue}var Hr=Ur.match(/^(?:(?:center|left|right)\s+)?(header|footer|caption|legend)\b\s*(.*)$/i);if(Hr){(Hr[2]===""||/^(?:center|left|right)\s*$/i.test(Hr[2]))&&(Sr=new RegExp("^end\\s*"+Hr[1]+"\\s*$","i"));continue}if(/^(hide|show)\b/i.test(Ur)){Eo.ignoredDirective(sr,"activityLegacy",se,re);continue}/^(scale|mainframe|autonumber|url)\b/i.test(Ur)||/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(Ur)||(B.push(Ur),B.lines.push(se))}}}}}function Q(L,B){B=B||{};var w=[],ar={},sr={title:null,skinBlock:null};R(L||"",w,ar,sr,B);var ir=[],_r={},Sr=[],ae=[],se={},re=[],Ur=[],oe=null,Ce=0,Me=0,eo=0,Hr=null;function Ne(){for(var Xe=re.length-1;Xe>=0;Xe--)if(re[Xe]!=null)return re[Xe];return null}function He(Xe,f,d,b){var E={id:Xe,type:f,label:d??"",color:null,stereotype:null,partition:b===void 0?Ne():b};return ir.push(E),_r[Xe]=E,Hr!=null&&Hr.from!=null&&f!=="note"&&E.partition===Hr.group&&(u(Hr.from,Xe,Hr.label,Hr.info),Hr=null),f!=="note"&&(oe=Xe),E}function Kr(Xe,f,d){var b=n(Xe),E=se[b];E==null?(E={id:b,name:t(b),color:f||null,stereotype:d||null,parent:Ne()},ae.push(E),se[b]=E):f&&!E.color&&(E.color=f),re.push(b)}function Ue(){re.length>0&&re.pop()}function O(Xe){return Xe[1]!=null?T():Xe[2]!=null?D(Xe[2],Xe[2],"activity"):Xe[3]!=null?D(a(Xe[3]),"","bar"):Xe[4]!=null?D(Xe[5]!=null?Xe[5]:Xe[4],Xe[4],"activity"):oe}function T(){return _r.start==null?He("start","start",""):oe="start","start"}function N(Xe){var f=Xe==null||Xe===""||/^top$/i.test(Xe)?"end":"end$"+Xe;return _r[f]==null?He(f,"end",""):oe=f,f}function D(Xe,f,d,b){return _r[Xe]!=null?(oe=Xe,Xe):(He(Xe,d,t(f),b),Xe)}function K(Xe,f,d,b,E,ur,Er,ke){var dr=void 0;if(ke!=null&&(Kr(ke,null,null),dr=Ne(),Ue()),Xe!=null){var Go=Xe.match(/^\(\*(top|\d+)?\)$/i);return N(Go?Go[1]:null)}if(f!=null){eo++;var lo="inner#"+eo,vo={id:lo,name:"",color:null,stereotype:null,parent:Ne(),inner:!0};return ae.push(vo),se[lo]=vo,re.push(lo),Hr={group:lo,from:null,label:"",info:null},oe=null,null}if(d!=null)return D(d,d,"activity",dr);if(b!=null)return D(a(b),"","bar",dr);if(E!=null)return D(ur??E,E,"activity",dr);if(Er!=null){var Rn=a(Er);return D(Rn,Rn,"activity",dr)}return null}function P(Xe,f,d){var b=Xe!=null?_r[Xe]:null;b!=null&&(f!=null&&(b.stereotype=a(f).replace(/^<<\s*|\s*>>$/g,"")),d!=null&&(b.color=d))}function u(Xe,f,d,b){if(Xe==null||f==null)return null;var E={from:Xe,to:f,label:t(d),length:b.length,direction:b.direction,constraint:b.constraint,dotted:b.dotted,dashed:b.dashed,bold:b.bold,hidden:b.hidden,color:b.color};return Sr.push(E),E}function m(Xe,f,d,b,E){if(E!=null)for(var ur=ir.length-1;ur>=0;ur--)ir[ur].type==="note"&&ir[ur].edge===E&&(delete _r[ir[ur].id],ir.splice(ur,1));Me++;var Er="note#"+Me,ke=He(Er,"note",Xe);return ke.position=f?f.toLowerCase():null,ke.color=d||null,ke.target=b,ke.edge=E??null,ke}function G(Xe){var f=1/0,d;for(d=0;d<Xe.length;d++)if(a(Xe[d])!==""){var b=Xe[d].match(/^\s*/)[0].length;b<f&&(f=b)}isFinite(f)||(f=0);var E=[];for(d=0;d<Xe.length;d++)E.push(Xe[d].substring(Math.min(f,Xe[d].match(/^\s*/)[0].length)).replace(/\s+$/,""));return E}for(var I=0;I<w.length;){var er=w[I],z;if(z=er.match(g),z){var hr;z[1]!=null?hr=T():z[2]!=null?hr=D(a(z[2]),"","bar"):z[3]!=null?hr=D(z[4]!=null?z[4]:z[3],z[3],"activity"):z[5]!=null?hr=D(z[5],z[5],"activity"):hr=oe;var mr=z[12]!=null?z[12]:z[14]!=null?z[14]:"",ne=z[13]!=null?z[13]:null;ne==null&&(Ce++,ne="#"+Ce);var ye=_r[ne];ye==null?ye=He(ne,"branch",""):oe=ne,ye.condition=t(mr),Ur.push(ne);var Je=z[6]!=null?v(z[6],z[7],z[8],z[9],z[10]):{length:2,direction:null,constraint:!0,dotted:!1,dashed:!1,bold:!1,hidden:!1,color:null};hr!=null&&u(hr,ne,z[11],Je),oe=ne,I++;continue}if(M.test(er)){Ur.length>0&&(oe=Ur[Ur.length-1]),I++;continue}if(_.test(er)){Ur.length>0&&Ur.pop(),I++;continue}if(z=er.match(C),z){var _o=z[1];z[4]==null&&_o.charAt(_o.length-1)==="{"&&_o.charAt(0)!=='"'&&(_o=_o.substring(0,_o.length-1));var Oo=z[2]!=null&&z[2].charAt(0)==="#"?z[2]:null;Kr(_o,Oo,z[3]),I++;continue}if($.test(er)){Ue(),I++;continue}if(z=er.match(y),z){Sr.length>0&&m(a(z[3]),z[1]||"right",z[2],null,Sr.length-1),I++;continue}if(z=er.match(A),z){var qe=[];for(I++;I<w.length&&!o.test(w[I]);)qe.push(w[I]),I++;I<w.length&&I++,Sr.length>0&&m(qe.join(`
+`),z[1]||"right",z[2],null,Sr.length-1);continue}if(z=er.match(s),z){var St=oe??T();m(a(z[3]),z[1],z[2],St,null),I++;continue}if(z=er.match(k),z){var ht=[];for(I++;I<w.length&&!o.test(w[I]);)ht.push(w[I]),I++;I<w.length&&I++;var nn=oe??T();m(G(ht).join(`
+`),z[1],z[2],nn,null);continue}if(z=er.match(J),z&&I+1<w.length){for(var Tt=[],Lo=null,Qt=I+1;Qt<w.length&&(Lo=w[Qt].match(gr),!Lo);)Tt.push(w[Qt]),Qt++;if(Lo){var pt=O(z);P(pt,z[6],z[7]);var So=[];a(z[14])!==""&&So.push(a(z[14]));for(var it=0;it<Tt.length;it++)So.push(Tt[it]);a(Lo[1])!==""&&So.push(a(Lo[1]));var qt=So.join(`
+`),Pt=Lo[2]!=null?Lo[2]:qt,We=void 0;Lo[4]!=null&&(Kr(Lo[4],null,null),We=Ne(),Ue());var pn=D(Pt,qt,"activity",We);oe=pn,P(pn,Lo[3],Lo[5]),u(pt,pn,z[13],v(z[8],z[9],z[10],z[11],z[12])),I=Qt+1;continue}}if(z=er.match(H),z){var ra=O(z);if(ra!=null){P(ra,z[6],z[7]);var Gn=K(z[14],z[15],z[16],z[17],z[18],z[19],z[20],z[22]);Gn!=null?(oe=Gn,P(Gn,z[21],z[23]),u(ra,Gn,z[13],v(z[8],z[9],z[10],z[11],z[12]))):Hr!=null&&Hr.from==null&&(Hr.from=ra,Hr.label=z[13],Hr.info=v(z[8],z[9],z[10],z[11],z[12]))}I++;continue}Eo.droppedLine(B,"activityLegacy",w.lines!=null?w.lines[I]:null,w[I]),I++}return{nodes:ir,edges:Sr,partitions:ae,skin:ar,title:sr.title}}return{parse:Q}})();var dc=(function(){for(var Ar=["class","interface","enum","annotation","struct","protocol","exception","entity","metaclass","stereotype"],Z={},Mr=0;Mr<Ar.length;Mr++)Z[Ar[Mr]]=!0;function Yr(o,a){var t=o.length,n=a,v="none",R="none",Q=0,L=0;for(n<t&&o[n]==="<"?(n++,n<t&&o[n]==="|"?(v="triangle",n++):v="arrow"):n<t&&o[n]==="*"?(v="diamond_filled",n++):n<t&&o[n]==="x"?n+1<t&&(o[n+1]==="-"||o[n+1]===".")&&(v="cross",n++):n<t&&o[n]==="o"?n+1<t&&(o[n+1]==="-"||o[n+1]===".")&&(v="diamond_open",n++):n<t&&o[n]==="+"?(v="plus",n++):n<t&&o[n]==="#"?(v="hash",n++):n+1<t&&o[n]==="|"&&o[n+1]==="|"?(v="doublebar",n+=2):n+1<t&&o[n]==="}"&&o[n+1]==="o"?(v="crow_zero_many",n+=2):n+1<t&&o[n]==="}"&&o[n+1]==="|"?(v="crow_one_many",n+=2):n+1<t&&o[n]==="}"&&(o[n+1]==="-"||o[n+1]===".")?(v="crow_many",n++):n+1<t&&o[n]==="|"&&o[n+1]==="o"&&(v="crow_zero_one",n+=2);n<t&&o[n]==="-";)Q++,n++;for(;n<t&&o[n]===".";)L++,n++;for(;n<t&&(o[n]==="-"||o[n]===".");)o[n]==="-"?Q++:L++,n++;if(Q+L===0)return null;n<t&&o[n]==="|"?n+1<t&&o[n+1]===">"?(R="triangle",n+=2):n+1<t&&o[n+1]==="|"?(R="doublebar",n+=2):n+1<t&&o[n+1]==="{"&&(R="crow_one_many",n+=2):n<t&&o[n]===">"?(R="arrow",n++):n<t&&o[n]==="*"?(R="diamond_filled",n++):n+1<t&&o[n]==="o"&&o[n+1]==="{"?(R="crow_zero_many",n+=2):n+1<t&&o[n]==="o"&&o[n+1]==="|"?(R="crow_zero_one",n+=2):n<t&&o[n]==="{"?(R="crow_many",n++):n<t&&o[n]==="o"?(R="diamond_open",n++):n<t&&o[n]==="x"&&(n+1>=t||o[n+1]===" "||o[n+1]===" "||o[n+1]==='"'||o[n+1]===":")?(R="cross",n++):n<t&&o[n]==="+"?(R="plus",n++):n<t&&o[n]==="#"&&(R="hash",n++);var B=L>0&&Q===0?"dotted":"solid";return{end:n,lineStyle:B,leftDeco:v,rightDeco:R,stemLen:Q+L}}function fe(o,a,t){return a==="triangle"||o==="triangle"?t==="dotted"?"implements":"extends":o==="diamond_filled"||a==="diamond_filled"?"composition":o==="diamond_open"||a==="diamond_open"?"aggregation":o==="arrow"||a==="arrow"?t==="dotted"?"dependency":"association":"link"}function Wr(o,a){var t=null,n=null;switch(a){case"triangle":n="triangle";break;case"diamond_filled":n="diamond_filled";break;case"diamond_open":n="diamond_open";break;case"arrow":n="open";break;case"crow_zero_many":n="ERzeroToMany";break;case"crow_one_many":n="ERoneToMany";break;case"crow_many":n="ERmany";break;case"crow_zero_one":n="ERzeroToOne";break;case"doublebar":n="ERmandOne";break;case"cross":n="cross";break;case"plus":n="circlePlus";break;default:break}switch(o){case"triangle":t="triangle";break;case"diamond_filled":t="diamond_filled";break;case"diamond_open":t="diamond_open";break;case"arrow":t="open";break;case"crow_zero_many":t="ERzeroToMany";break;case"crow_one_many":t="ERoneToMany";break;case"crow_many":t="ERmany";break;case"crow_zero_one":t="ERzeroToOne";break;case"doublebar":t="ERmandOne";break;case"cross":t="cross";break;case"plus":t="circlePlus";break;default:break}return{fromArrow:t,toArrow:n}}function Nr(o,a){for(;a<o.length&&(o[a]===" "||o[a]===" ");)a++;if(a>=o.length)return null;if(o[a]==='"'){var t=o.indexOf('"',a+1);return t<0&&(t=o.length),{name:o.substring(a+1,t),end:t+1}}for(var n=a,v=0;n<o.length;){var R=o[n];if(R==="<")v++,n++;else if(R===">"&&v>0)v--,n++;else if(v>0)n++;else if(/[\w]/.test(R))n++;else break}return n===a?null:{name:o.substring(a,n),end:n}}function lr(o){var a=o.indexOf("<");if(a<0)return{baseName:o,generics:null};var t=o.lastIndexOf(">");return t<a?{baseName:o,generics:null}:{baseName:o.substring(0,a),generics:o.substring(a+1,t).replace(/^\s+|\s+$/g,"")}}function Y(o,a){var t=o.replace(/^\s+|\s+$/g,"");if(t==="")return null;var n=t.substring(0,2);if(t.length>=2&&t!=="..."&&(n==="--"||n===".."||n==="=="||n==="__")&&t.substring(t.length-2)===n){var v=t.length>4?t.substring(2,t.length-2).replace(/^\s+|\s+$/g,""):"",R=n.charAt(0);return new RegExp("^\\"+R+"*$").test(v)&&(v=""),{kind:"separator",style:R,title:v}}if(a&&!/^[+\-#~{]/.test(t))return{kind:"field",visibility:null,name:t,type:null,returnType:null,params:null,modifiers:[]};for(var Q=[],L=null,B=t;;){var w=B.match(/^\{(static|abstract|classifier|field|method)\}\s*/);if(w){var ar=w[1];ar==="classifier"?(ar="static",Q.push(ar)):ar==="field"||ar==="method"?L=ar:Q.push(ar),B=B.substring(w[0].length)}else break}var sr=null;if(B.length>2&&B[1]!==B[0]){var ir=B[0];(ir==="+"||ir==="-"||ir==="#"||ir==="~"||ir==="*")&&(sr=ir,B=B.substring(1).replace(/^\s*/,""))}for(;;){var _r=B.match(/^\{(static|abstract|classifier|field|method)\}\s*/);if(_r){var Sr=_r[1];Sr==="classifier"?(Sr="static",Q.push(Sr)):Sr==="field"||Sr==="method"?L=Sr:Q.push(Sr),B=B.substring(_r[0].length)}else break}var ae=B.replace(/^\s+|\s+$/g,""),se=B.indexOf("("),re=L==="method"||L!=="field"&&se>=0;if(re){var Ur,oe,Ce;if(se>=0){Ur=B.substring(0,se).replace(/^\s+|\s+$/g,"");var Me=B.indexOf(")",se);Me<0&&(Me=B.length),oe=B.substring(se+1,Me).replace(/^\s+|\s+$/g,""),Ce=B.substring(Me+1).replace(/^\s+|\s+$/g,"")}else Ur=B.replace(/^\s+|\s+$/g,""),oe=null,Ce="";var eo=null,Hr=Ce.indexOf(":");return Hr>=0?eo=Ce.substring(Hr+1).replace(/^\s+|\s+$/g,""):Ce.length>0&&(eo=Ce),{kind:"method",visibility:sr,name:Ur,type:null,returnType:eo,params:oe,modifiers:Q,text:ae}}else{var Ne=B.indexOf(":"),He,Kr;return Ne>=0?(He=B.substring(0,Ne).replace(/^\s+|\s+$/g,""),Kr=B.substring(Ne+1).replace(/^\s+|\s+$/g,"")):(He=B.replace(/^\s+|\s+$/g,""),Kr=null),{kind:"field",visibility:sr,name:He,type:Kr,returnType:null,params:null,modifiers:Q,text:ae}}}function Cr(o,a,t,n){var v=[],R=1,Q=a;for(Q=a+1;Q<o.length;Q++){var L=o[Q],B=L.replace(/^\s+|\s+$/g,"");if(B.indexOf("{")>=0&&R++,B.indexOf("}")>=0&&(R--,R<=0)){var w=B.substring(0,B.indexOf("}"));if(w.replace(/^\s+|\s+$/g,"").length>0){var ar=Y(w,n);ar&&v.push(ar)}return{members:v,endIdx:Q}}if(R===1){var sr=Y(B,n);sr&&v.push(sr)}}return{members:v,endIdx:o.length-1}}function V(o,a){if(a.hasOwnProperty(o))return o;for(var t in a)if(a.hasOwnProperty(t)&&a[t].alias===o)return t;return o}function U(o,a,t,n){if(n.hasOwnProperty(o))return n[o];var v=lr(a||o),R={id:o,name:v.baseName,kind:"class",stereotype:null,generics:v.generics,color:null,members:[]};return n[o]=R,t.push(R),R}var H=new RegExp('^(hide|show)\\s+(?:(class|object|interface|enum|annotation|dataclass|record|abstract|protocol|struct|exception|metaclass|entity|"[^"]+"|<<.*>>|(?!empty\\s)[^\\s<>"]+)\\s+)?(?:(empty)\\s+)?(members?|attributes?|fields?|methods?|circles?|circled|stereotypes?)\\s*$',"i"),J=/^(hide|show|remove|restore|hide-class|show-class)\s+("[^"]+"|<<.*>>|\S+)\s*$/i,gr=["class","object","interface","enum","annotation","dataclass","record","abstract","protocol","struct","exception","metaclass","entity"];function X(o){var a=o.match(H);if(a){var t=a[1].toLowerCase()==="show",n=a[2],v={type:"all",value:null};if(n){var R=n.toLowerCase();gr.indexOf(R)>=0?v={type:"kind",value:R}:n.charAt(0)==="<"?v={type:"stereotype",value:n.replace(/^<<|>>$/g,"").replace(/^\s+|\s+$/g,"")}:v={type:"name",value:n.replace(/^"|"$/g,"")}}for(var Q=!!a[3],L=a[4].substring(0,3).toLowerCase(),B=L==="met"?["method"]:L==="mem"?["field","method"]:L==="cir"?["circle"]:L==="ste"?["stereotype"]:["field"],w=[],ar=0;ar<B.length;ar++)w.push({show:t,gender:v,empty:Q&&(B[ar]==="field"||B[ar]==="method"),portion:B[ar]});return w}if(a=o.match(J),a){var sr=a[1].toLowerCase();return[{show:sr==="show"||sr==="restore"||sr==="show-class",what:a[2].replace(/^"|"$/g,"")}]}return null}function g(o,a){for(var t=[],n=a+1;n<o.length;n++){var v=o[n].replace(/^\s+|\s+$/g,"");if(/^end\s*note$/i.test(v))return{text:t.join(`
+`),endIdx:n};t.push(o[n])}return{text:t.join(`
+`),endIdx:o.length-1}}function M(o,a){for(var t=[],n=a+1;n<o.length;n++){if(/^\s*\}\s*$/.test(o[n]))return{text:t.join(`
+`),endIdx:n};t.push(o[n])}return{text:t.join(`
+`),endIdx:o.length-1}}function _(o){for(var a=[],t=/<<\s*([^<>]*?)\s*>>/g,n;o&&(n=t.exec(o))!=null;)n[1]!==""&&a.push(n[1]);return a}function C(o,a){a=a||{};var t=o.split(/\r\n|\r|\n/),n=[],v={},R=[],Q=[],L=[],B=[],w=[],ar=[],sr=[],ir={};function _r(Al,Jl,ki,Di){for(var bi=Al!=null?[Al]:Jl.indexOf(".")>0&&!/^\.|\.$|\.\./.test(Jl)?Jl.split("."):[Jl],ti=null,Hi=0;Hi<bi.length;Hi++){for(var Lu=null,Qs=w.length-1;Qs>=0;Qs--)if(!w[Qs]._together){Lu=L.indexOf(w[Qs]);break}for(var Li=null,ks=0;ks<L.length;ks++)if(L[ks].name===bi[Hi]&&(L[ks].parentIndex==null?null:L[ks].parentIndex)===Lu){Li=L[ks];break}Li==null?(Li={name:bi[Hi],stereotype:Hi===bi.length-1?ki:null,classes:[],parentIndex:Lu},L.push(Li)):Hi===bi.length-1&&ki&&!Li.stereotype&&(Li.stereotype=ki),(Di||Hi<bi.length-1)&&w.push(Li),ti=Li}if(bi.length>1)if(Di)ti._implicitParents=bi.length-1;else for(var ru=0;ru<bi.length-1;ru++)w.pop();return ti}for(var Sr=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(o)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(o),ae=/^skinparam\s+style\s+strictuml\s*$/im.test(o)||/^skinparam\s*\{[^}]*\bstyle\s+strictuml/im.test(o),se=/^\s*hide\s+circle\s*$/im.test(o),re=o.match(/^skinparam\s+linetype\s+(ortho|polyline)\s*$/im),Ur=re?re[1].toLowerCase():null,oe=o.match(/^\s*set\s+(?:namespace)?separator\s+(\S+)\s*$/im),Ce=oe?oe[1]:null,Me=Ce??".",eo=!/^\s*!pragma\s+useIntermediatePackages\s+false\s*$/im.test(o),Hr=null,Ne=null,He={header:null,footer:null,caption:null},Kr=0;Kr<t.length;Kr++){var Ue=t[Kr],O=Ue.replace(/^\s+|\s+$/g,"");if(O!==""&&O.charAt(0)!=="'"&&O.charAt(0)!=="!"){if(/^skinparam\b/i.test(O)){if(/\{\s*$/.test(O))for(var T=1;T>0&&Kr+1<t.length;){Kr++;var N=t[Kr].replace(/^\s+|\s+$/g,"");N.indexOf("{")>=0&&T++,N.indexOf("}")>=0&&T--}continue}var D=/^title\s+(.*)$/i.exec(O);if(D){Hr=D[1];continue}if(/^title\s*$/i.test(O)){var K=Eo.blockEnd(t,Kr,/^\s*end\s*title\b/i);if(K>=0){Hr=t.slice(Kr+1,K).map(function(Al){return Al.replace(/^\s+|\s+$/g,"")}).join(`
+`),Kr=K;continue}}var P=O.match(/^legend((?:\s+(?:left|right|center|top|bottom))*)\s*$/i),u=P?null:O.match(/^legend(?:\s*:\s*|\s+)(?:"(.*)"|(\S.*))$/i);if(P||u){var m=[],G="center",I="bottom";if(u)m.push((u[1]!=null?u[1]:u[2]).replace(/\s+$/,""));else{for(var er=P[1].toLowerCase().split(/\s+/),z=0;z<er.length;z++)/^(left|right|center)$/.test(er[z])&&(G=er[z]),/^(top|bottom)$/.test(er[z])&&(I=er[z]);var hr=Eo.blockEnd(t,Kr,/^\s*end\s*legend\b/i);if(hr<0){Eo.droppedLine(a,"class",Kr,Ue,"opens a legend that never closes (no `end legend`)");continue}for(var mr=Kr+1;mr<hr;mr++)m.push(t[mr].replace(/^\s+|\s+$/g,""));Kr=hr}for(;m.length>0&&m[m.length-1]==="";)m.pop();for(;m.length>0&&m[0]==="";)m.shift();if(m.length===0){Eo.droppedLine(a,"class",Kr,Ue,'defines an empty legend (plantuml.jar answers "No legend defined")');continue}for(var ne=-1,ye=w.length-1;ye>=0;ye--)if(!w[ye]._together){ne=L.indexOf(w[ye]);break}ne>=0?B.push({position:null,target:null,method:null,text:m.join(`
+`),legend:!0,lines:m,pkgIndex:ne}):Ne={position:G,vertical:I,lines:m};continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:header|footer|caption)\b/i.test(O)){var Je=Ua.take(He,t,Kr);if(Je>=0){Kr=Je;continue}}if(!/^(header|footer|caption|scale|mainframe)\b/i.test(O)&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(O)){if(/^<style>$/i.test(O)){for(;Kr+1<t.length&&(Kr++,!/^<\/?style>$/i.test(t[Kr].replace(/^\s+|\s+$/g,""))););continue}if(!/^<style>.*<\/style>$/i.test(O)){if(/^sprite\s+\$?\w+/i.test(O)){if(/\{\s*$/.test(O)){for(;Kr+1<t.length&&!/^\s*\}\s*$/.test(t[Kr+1]);)Kr++;Kr++}continue}if(/^newpage\b/i.test(O))break;if(/^(hide|show|remove|restore)(-class)?\b/i.test(O)){var _o=X(O);if(_o)for(var Oo=0;Oo<_o.length;Oo++)_o[Oo].portion?ar.push(_o[Oo]):sr.push(_o[Oo]);continue}var qe=O.match(/^<>\s*([^\s<>"{}]+)\s*$/);if(qe){var St=U(qe[1],qe[1],n,v);St.kind="diamond",St.name="",w.length>0&&w[w.length-1].classes.push(qe[1]);continue}var ht=O.toLowerCase();if(/^together\s*\{/i.test(O)){var nn=w.length>0?w[w.length-1]:null;w.push({_together:!0,name:null,stereotype:null,classes:nn?nn.classes:[]});continue}var Tt=O.match(/^package\s+(?:"([^"]+)"|(\S+))(?:\s+<<\s*([^>]*)\s*>>)?(?:\s+(#\S+))?\s*(\{\s*\}|\{)?\s*$/i);if(Tt){_r(Tt[1],Tt[2],Tt[3]||null,!/\{\s*\}$/.test(Tt[5]||""));continue}var Lo=O.match(/^namespace\s+(?:"([^"]+)"|(\S+))(?:\s+(#\S+))?\s*(\{\s*\}|\{)?\s*$/i);if(Lo){_r(Lo[1],Lo[2],null,!/\{\s*\}$/.test(Lo[4]||""));continue}if(O==="}"){if(w.length>0)for(var Qt=w.pop(),pt=Qt._implicitParents||0;pt-- >0&&w.length>0;)w.pop();continue}var So=O.match(/^note\s+(?:"([^"]*)"\s+)?as\s+([^\s$#]+)((?:\s+\$\w+)*)(?:\s+(#\S+))?\s*$/i);if(So){var it=So[1];if(it==null){var qt=g(t,Kr);Kr=qt.endIdx,it=qt.text}else it=it.replace(/\\n/g,`
+`);for(var Pt={position:null,target:null,method:null,text:it,id:So[2],tags:(So[3]||"").match(/\$\w+/g)?So[3].match(/\$\w+/g).map(function(Al){return Al.substring(1)}):[]},We=w.length-1;We>=0;We--)if(!w[We]._together){Pt.pkgIndex=L.indexOf(w[We]);break}B.push(Pt),ir[So[2]]=Pt;continue}var pn=O.match(/^("[^"]+"|[^\s"<>.-][^\s"<>]*?)\s*(<?[-.]{1,4}>?)\s*("[^"]+"|[^\s"<>-][^\s"<>]*)\s*$/);if(pn&&(ir.hasOwnProperty(pn[1])||ir.hasOwnProperty(pn[3]))&&/^<?[-.]+>?$/.test(pn[2])){var ra=ir.hasOwnProperty(pn[1]),Gn=ir[ra?pn[1]:pn[3]],Xe=(ra?pn[3]:pn[1]).replace(/^"|"$/g,"");ir.hasOwnProperty(Xe)||(U(Xe,Xe,n,v),Gn.target==null&&(Gn.target=Xe,Gn.position=ra?"top":"bottom"),Gn.targets=Gn.targets||[],Gn.targets.indexOf(Xe)<0&&Gn.targets.push(Xe));continue}var f=O.match(/^note\s+(left|right|top|bottom)((?:\s*<<[^<>]*>>)*)(?:\s+(#[^\s\[]+))?(?:\s+\[\[([^\]]*)\]\])?\s*(?:(\{)|:\s*(.*))?$/i);if(f&&n.length>0){var d=f[6];if(d==null){var b=f[5]?M(t,Kr):g(t,Kr);Kr=b.endIdx,d=b.text}B.push({position:f[1].toLowerCase(),target:n[n.length-1].id,method:null,stereotypes:_(f[2]),color:f[3]||null,url:f[4]||null,text:d.replace(/^\s+|\s+$/g,"")});continue}var E=O.match(/^note\s+(left|right|top|bottom)\s+of\s+("[^"]+"|[^\s:"<]+)(?:::([^\s<]+))?((?:\s*<<[^<>]*>>)*)(?:\s+(#[^\s\[]+))?(?:\s+\[\[([^\]]*)\]\])?\s*:(?!:)\s*(.*)$/i);if(E){B.push({position:E[1].toLowerCase(),target:E[2].replace(/^"|"$/g,""),method:E[3]||null,stereotypes:_(E[4]),color:E[5]||null,url:E[6]||null,text:E[7].replace(/^\s+|\s+$/g,"")});continue}var ur=O.match(/^note\s+(left|right|top|bottom)\s+of\s+("[^"]+"|[^\s:"<]+)(?:::("[^"]+"|[^\s<]+))?((?:\s*<<[^<>]*>>)*)(?:\s+(#[^\s\[]+))?(?:\s+\[\[([^\]]*)\]\])?\s*(\{)?\s*$/i);if(ur){var Er=ur[7]?M(t,Kr):g(t,Kr);Kr=Er.endIdx,B.push({position:ur[1].toLowerCase(),target:ur[2].replace(/^"|"$/g,""),method:ur[3]?ur[3].replace(/^"|"$/g,""):null,stereotypes:_(ur[4]),color:ur[5]||null,url:ur[6]||null,text:Er.text});continue}var ke=O.match(/^note(?:\s+(left|right|top|bottom))?\s+on\s+link(?:\s+(#\S+))?\s*(?::\s*(.*))?$/i);if(ke){var dr=ke[3];if(dr==null){var Go=g(t,Kr);Kr=Go.endIdx,dr=Go.text}if(R.length===0){Eo.droppedLine(a,"class",Kr,Ue,'has no link before it (plantuml.jar answers "No link defined")');continue}for(var lo=B.length-1;lo>=0;lo--)B[lo].position==="link"&&B[lo].linkIndex===R.length-1&&B.splice(lo,1);B.push({position:"link",target:null,method:null,color:ke[2]||null,linkIndex:R.length-1,text:dr.replace(/^\s+|\s+$/g,"")});continue}var vo=/^abstract\b/i.test(O)?A(O):null;if(vo){var Rn=vo.name,rn=vo.generics,Co=vo.stereotype,Dn=vo.color,Ve=vo.id,dt=U(Ve,Rn,n,v);if(dt.kind="abstract",dt.name=Rn,dt.generics=rn,Co&&(dt.stereotype=Co),Dn&&(dt.color=Dn),vo.tags.length&&(dt.tags=(dt.tags||[]).concat(vo.tags)),vo.quoted&&(dt._quoted=!0),w.length>0&&w[w.length-1].classes.push(Ve),!vo.brace&&Kr+1<t.length&&/^\s*\{\s*$/.test(t[Kr+1])&&(Kr++,vo.brace=!0),vo.brace){var $t=Cr(t,Kr,!0,!1);Kr=$t.endIdx,dt.members=dt.members.concat($t.members)}$(O,Ve,R,n,v,w);continue}var Sa=O.match(/^\(\)\s+(?:"([^"]+)"|(\S+))(?:\s+as\s+(\S+))?\s*$/);if(Sa){var ba=Sa[1]||Sa[2],sl=Sa[3]||ba;if(!v.hasOwnProperty(sl)){var ua={id:sl,name:ba,kind:"circle",members:[],stereotype:null,generics:null,color:null};v[sl]=n.length,n.push(ua),w.length>0&&w[w.length-1].classes.push(sl)}continue}var ea=/^(?:class|interface|enum|annotation|struct|protocol|exception|entity|metaclass|stereotype|record|dataclass|static|object)\b/i.test(O)?A(O):null;if(ea){var fn=ea.kind,ui=ea.name,oi=ea.generics,Zl=ea.stereotype,Ca=ea.color,Cl=ea.id,Aa=U(Cl,ui,n,v);if(Aa.kind=fn,Aa.name=ui,Aa.generics=oi,Zl&&(Aa.stereotype=Zl),Ca&&(Aa.color=Ca),ea.tags.length&&(Aa.tags=(Aa.tags||[]).concat(ea.tags)),ea.quoted&&(Aa._quoted=!0),w.length>0&&w[w.length-1].classes.push(Cl),!ea.brace&&Kr+1<t.length&&/^\s*\{\s*$/.test(t[Kr+1])&&(Kr++,ea.brace=!0),ea.brace){var en=Cr(t,Kr,!0,fn==="enum");if(Kr=en.endIdx,fn==="object")for(var xt=0;xt<en.members.length;xt++)en.members[xt].kind==="method"&&(en.members[xt].kind="field");Aa.members=Aa.members.concat(en.members)}$(O,Cl,R,n,v,w);continue}var pl=O.match(/^\(\s*("[^"]+"|\S+?)\s*,\s*("[^"]+"|\S+?)\s*\)\s*([-.]+)\s*("[^"]+"|\S+)\s*$/);if(!pl){var Pl=O.match(/^("[^"]+"|[^\s("]+)\s*([-.]+)\s*\(\s*("[^"]+"|\S+?)\s*,\s*("[^"]+"|\S+?)\s*\)\s*$/);Pl&&(pl=[Pl[0],Pl[3],Pl[4],Pl[2],Pl[1]])}if(pl){var Oi=pl[1].replace(/^"|"$/g,""),el=pl[2].replace(/^"|"$/g,""),Rl=pl[4].replace(/^"|"$/g,"");U(Oi,Oi,n,v),U(el,el,n,v),U(Rl,Rl,n,v),Q.push({a:Oi,b:el,cls:Rl});continue}var $l=O.match(/^("[^"]+"|[^\s:"<>{}()\-.](?:[^\s:"<>{}()]|::)*)\s*:(?!:)\s*(\S.*)$/);if($l&&!/^(title|caption|header|footer|legend|skinparam|note|hide|show|remove|restore)$/i.test($l[1])){var fa=s($l[1].replace(/^"|"$/g,""),v,{packages:L,nsSep:Me,stack:w});if(!fa.group){var xa=U(fa.id,fa.id,n,v),fi=Y($l[2],xa.kind==="enum");if(fi&&xa.members.push(fi),(!v.hasOwnProperty(fa.id)||xa.members.length===1)&&w.length>0&&xa.members.length===1){for(var Nl=w[w.length-1],jl=!1,ha=0;ha<L.length&&!jl;ha++)jl=L[ha].classes.indexOf(fa.id)>=0;!jl&&Nl.classes.indexOf(fa.id)<0&&Nl.classes.push(fa.id)}continue}}var Bi=k(O,n,v,w,{packages:L,nsSep:Me,stack:w});if(Bi){R.push(Bi);continue}if(!/^set\s+(?:namespace)?separator\b/i.test(O)){if(/^[rh]?note\b/i.test(O)){Eo.droppedNote(a,"class","note form",Kr,Ue);var Ii=/:/.test(O)?-1:Eo.blockEnd(t,Kr,/^\s*end\s*[rh]?note\b/i);Ii>=0&&(Kr=Ii);continue}if(!/^allow_?mixing\s*$/i.test(O)){if(/^newpage\b/i.test(O)){Eo.ignoredDirective(a,"class",Kr,Ue);continue}Eo.droppedLine(a,"class",Kr,Ue)}}}}}}if(Me.toLowerCase()!=="none"){for(var mi={},Mi=0;Mi<L.length;Mi++)for(var qa=0;qa<L[Mi].classes.length;qa++)mi[L[Mi].classes[qa]]=!0;for(var Ni=0;Ni<n.length;Ni++){var on=n[Ni];if(!(mi[on.id]||on._quoted||on.kind==="circle"||on.kind==="diamond")&&!(on.id.indexOf(Me)<0)){for(var yi=on.id.split(Me),xl=yi.pop(),ul=xl===""||yi.length===0,Fl=0;Fl<yi.length&&!ul;Fl++)yi[Fl]===""&&(ul=!0);if(!ul){eo||(yi=[yi.join(Me)]);var di=null;for(Fl=0;Fl<yi.length;Fl++){for(var fl=-1,ol=0;ol<L.length;ol++)if(L[ol].name===yi[Fl]&&(L[ol].parentIndex==null?null:L[ol].parentIndex)===di){fl=ol;break}fl<0&&(L.push({name:yi[Fl],stereotype:null,classes:[],parentIndex:di}),fl=L.length-1),di=fl}L[di].classes.push(on.id),on.name=xl}}}}return{classes:n,relationships:R,associationClasses:Q,packages:L,notes:B,monochrome:Sr,hideCircle:se,strictUml:ae,hideRules:ar,hideEntities:sr,linetype:Ur,title:Hr,header:He.header,footer:He.footer,caption:He.caption,legend:Ne}}function $(o,a,t,n,v,R){var Q=o.indexOf("{");Q>=0&&(o=o.substring(0,Q));var L=o.match(/\bextends\s+(\S+)/i);if(L){var B=L[1].replace(/,\s*$/,""),w=B;if(U(w,B,n,v),R.length>0){var ar=R[R.length-1];ar.classes.indexOf(w)<0&&ar.classes.push(w)}t.push({from:a,to:w,type:"extends",fromCardinality:null,toCardinality:null,label:null,lineStyle:"solid",fromArrow:null,toArrow:"triangle",_topId:w,_botId:a})}var sr=o.match(/\bimplements\s+(.+?)(?:\s*\{|\s*$)/i);if(sr)for(var ir=sr[1].split(/\s*,\s*/),_r=0;_r<ir.length;_r++){var Sr=ir[_r].replace(/^\s+|\s+$/g,"");Sr!==""&&(U(Sr,Sr,n,v),t.push({from:a,to:Sr,type:"implements",fromCardinality:null,toCardinality:null,label:null,lineStyle:"dotted",fromArrow:null,toArrow:"triangle",_topId:Sr,_botId:a}))}}var y=new RegExp('^(abstract(?:\\s+class)?|static\\s+class|class|interface|enum|annotation|struct|protocol|exception|entity|metaclass|stereotype|record|dataclass|object)\\s+(?:"([^"]+)"\\s*(?:<([^<>]*)>)?\\s+as\\s+(\\S+?)|(\\S+?)\\s+as\\s+"([^"]+)"\\s*(?:<([^<>]*)>)?|"([^"]+)"|(\\S+?))\\s*(?:<([^<>]*)>)?((?:\\s*<{2,3}[^>]*>{2,3})*)((?:\\s*\\$[\\w]+)*)\\s*(?:\\[\\[[^\\]]*\\]\\])?\\s*(#\\S+(?:\\s+##\\S+)?|##\\S+)?(?:\\s+extends\\s+[^{]+?)?(?:\\s+implements\\s+[^{]+?)?\\s*(\\{\\s*\\}|\\{)?\\s*$',"i");function A(o){var a=o.match(y);if(a==null)return null;var t=a[1].toLowerCase(),n=/^abstract/.test(t)?"abstract":/^static/.test(t)?"class":t,v=a[2]||a[6]||a[8]||null,R=a[4]||a[5]||a[9]||null,Q=v!=null;Q&&(v=v.replace(/\\n/g,`
+`));for(var L=v??R,B=R??v,w=a[3]||a[7]||a[10]||null,ar=[],sr=a[11]||"",ir,_r=/(<{2,3})\s*([^>]*?)\s*>{2,3}/g;(ir=_r.exec(sr))!=null;)ir[1].length===2&&ar.push(ir[2]);if(!Q){var Sr=lr(L);Sr.generics&&(L=Sr.baseName,w=w||Sr.generics)}return{kind:n,id:B,name:L,generics:w,stereotype:ar.length?ar.join("\xBB \xAB"):null,color:a[13]||null,tags:(a[12]||"").match(/\$\w+/g)?a[12].match(/\$\w+/g).map(function(ae){return ae.substring(1)}):[],quoted:Q,brace:a[14]==="{"}}function s(o,a,t){if(a.hasOwnProperty(o))return{id:o,group:!1};var n=o.replace(/^\.+/,"");if(a.hasOwnProperty(n))return{id:n,group:!1};var v=t&&t.nsSep?t.nsSep:".";if(t&&t.stack&&v.toLowerCase()!=="none"){for(var R=[],Q=0;Q<t.stack.length;Q++)!t.stack[Q]._together&&t.stack[Q].name&&R.push(t.stack[Q].name);for(var L=0;L<R.length&&n.indexOf(v)>0;L++){var B=R.slice(L).join(v)+v;if(n.indexOf(B)===0&&n.length>B.length){if(n=n.substring(B.length),a.hasOwnProperty(n))return{id:n,group:!1};break}}}if(v!=="::"&&n.indexOf("::")>0){var w=n.substring(0,n.lastIndexOf("::"));if(w)return s(w,a,t)}for(var ar=t&&t.packages?t.packages:[],sr=0;sr<ar.length;sr++)if(ar[sr].name===n&&!ar[sr]._together)return{id:n,group:!0};if(v.toLowerCase()!=="none"&&n.indexOf(v)>0){var ir=n.split(v),_r=[];if(t&&t.stack)for(var Sr=t.stack.length-1;Sr>=0;Sr--)t.stack[Sr]._together||_r.push(ar.indexOf(t.stack[Sr]));_r.push(null);for(var ae=0;ae<_r.length;ae++){for(var se=_r[ae],re=!0,Ur=0;Ur<ir.length&&re;Ur++){re=!1;for(var oe=0;oe<ar.length;oe++)if(ar[oe].name===ir[Ur]&&!ar[oe]._together&&(ar[oe].parentIndex==null?null:ar[oe].parentIndex)===se){se=oe,re=!0;break}}if(re)return{id:ar[se].name,group:!0}}}var Ce=t&&t.nsSep&&t.nsSep.toLowerCase()!=="none"?t.nsSep:null,Me=n.lastIndexOf("::"),eo=2;if(Ce&&Ce!=="::"&&n.lastIndexOf(Ce)>Me&&(Me=n.lastIndexOf(Ce),eo=Ce.length),Me>0){var Hr=n.substring(Me+eo);if(Hr&&a.hasOwnProperty(Hr))return{id:Hr,group:!1}}return{id:n,group:!1}}function k(o,a,t,n,v){o=o.replace(/^@[\d.]+\s+/,"");var R=o.match(/^(?:"([^"]+)"|(\S+))\s+\(\)([-.]+)\s+(?:"([^"]+)"|(\S+))\s*$/),Q=null,L=null;if(R)Q=R[1]||R[2],L=R[4]||R[5];else{var B=o.match(/^(?:"([^"]+)"|(\S+))\s+([-.]+)\(\)\s+(?:"([^"]+)"|(\S+))\s*$/);B&&(L=B[1]||B[2],Q=B[4]||B[5])}if(Q!=null)return U(L,L,a,t),{from:Q,to:L,type:"lollipop",fromCardinality:null,toCardinality:null,label:null,lineStyle:"solid",fromArrow:null,toArrow:null,_topId:null,_botId:null,_sameRank:!0};var w=null,ar=null,sr=!1,ir=!1;o=o.replace(/([-.])\[([^\]\[]*)\](?=[-.\w>])/,function(nn,Tt,Lo){for(var Qt=Lo.split(","),pt=0;pt<Qt.length;pt++){var So=Qt[pt].replace(/^\s+|\s+$/g,"");So.charAt(0)==="#"?w=So:/^(dashed|dotted)$/i.test(So)?ar=So.toLowerCase():/^bold$/i.test(So)?ir=!0:/^hidden$/i.test(So)?sr=!0:/^thickness\s*=\s*\d+/i.test(So)&&(ir=!0)}return Tt});var _r=null,Sr=o.match(/([-.])(up|down|left|right|u|d|l|r)\1/i);if(Sr){var ae=Sr[2].toLowerCase().charAt(0);_r=ae==="u"?"up":ae==="d"?"down":ae==="l"?"left":"right"}o=o.replace(/([-.])(up|down|left|right|u|d|l|r)\1/gi,"$1$1");for(var se=-1,re=null,Ur=0;Ur<o.length;Ur++){var oe=o[Ur];if(oe==="<"||oe==="*"||oe==="o"||oe==="+"||oe==="#"||oe==="-"||oe==="."||oe==="|"||oe==="}"||oe==="x"){var Ce=Yr(o,Ur),Me=Ce!=null&&Ce.end-Ur===1&&(oe==="-"||oe===".")&&Ur>0&&/^[ \t]$/.test(o[Ur-1])&&Ce.end<o.length&&/^[ \t]$/.test(o[Ce.end])&&o.substring(0,Ur).indexOf(":")<0;if(Ce!=null&&(Ce.end-Ur>=2||Me)){var eo=Ur>0?o[Ur-1]:" ",Hr=Ce.end<o.length?o[Ce.end]:" ",Ne=o.substring(Ur,Ce.end),He=(o.substring(0,Ur).split('"').length-1)%2===1,Kr=!He&&(Ur===0||eo===" "||eo===" "||eo==='"'||/[A-Za-z0-9_]/.test(eo)&&/^[<*|}#+\-.]/.test(Ne)&&Ce.end-Ur>=2),Ue=Ce.end>=o.length||Hr===" "||Hr===" "||Hr==='"'||Hr===":"||/[A-Za-z0-9"]/.test(Hr)&&/[-.>|*#+]$/.test(Ne)&&Ce.end-Ur>=2;if(Kr&&Ue){se=Ur,re=Ce;break}}}}if(re==null)return null;var O=o.substring(0,se).replace(/^\s+|\s+$/g,""),T=o.substring(re.end).replace(/^\s+|\s+$/g,"");O=O.replace(/\s*\[[^\]]*\]$/,""),T=T.replace(/^\[[^\]]*\]\s*/,"");var N=null,D="",K=O.match(/^(.+?)\s+"([^"]*)"$/);if(K?(D=K[1].replace(/^\s+|\s+$/g,""),N=K[2]):D=O,D==="")return null;for(var P=null,u="",m=null,G=-1,I=0;I<T.length;I++)if(T[I]===":"){if(T[I+1]===":"){I++;continue}G=I;break}G>=0&&(m=T.substring(G+1).replace(/^\s+|\s+$/g,""),T=T.substring(0,G).replace(/^\s+|\s+$/g,""),m.length>=2&&m.charAt(0)==='"'&&m.charAt(m.length-1)==='"'&&(m=m.substring(1,m.length-1))),T=T.replace(/\s*<<[^<>]*>>\s*$/,"").replace(/^\s+|\s+$/g,"");var er=T.match(/^"([^"]*)"\s+(.+)$/);if(er?(P=er[1],u=er[2].replace(/^\s+|\s+$/g,"")):u=T,u==="")return null;D=D.replace(/^"|"$/g,""),u=u.replace(/^"|"$/g,"");var z=s(D,t,v),hr=s(u,t,v);if(D=z.id,u=hr.id,z.group||U(D,D,a,t),hr.group||U(u,u,a,t),n.length>0){var mr=n[n.length-1];mr.classes.indexOf(D)<0&&mr.classes.push(D),mr.classes.indexOf(u)<0&&mr.classes.push(u)}var ne=fe(re.leftDeco,re.rightDeco,re.lineStyle),ye=Wr(re.leftDeco,re.rightDeco),Je=!1;ne==="extends"||ne==="implements"||ne==="association"||ne==="dependency"?(re.leftDeco==="triangle"||re.leftDeco==="arrow")&&(Je=!0):(ne==="composition"||ne==="aggregation")&&(re.rightDeco==="diamond_filled"||re.rightDeco==="diamond_open")&&(Je=!0);var _o=null,Oo=null,qe=!1,St=_r==="left"||_r==="right"?_r:null;_r==="left"||_r==="right"||_r==null&&re.stemLen<=1?qe=!0:_r==="up"?(_o=u,Oo=D):(_o=D,Oo=u);var ht=ar||re.lineStyle;return Je?{from:u,to:D,type:ne,fromCardinality:P,toCardinality:N,label:m,lineStyle:ht,color:w,bold:ir,hidden:sr,fromArrow:ye.toArrow,toArrow:ye.fromArrow,_topId:_o,_botId:Oo,_sameRank:qe,_side:St}:{from:D,to:u,type:ne,fromCardinality:N,toCardinality:P,label:m,lineStyle:ht,color:w,bold:ir,hidden:sr,fromArrow:ye.fromArrow,toArrow:ye.toArrow,_topId:_o,_botId:Oo,_sameRank:qe,_side:St,fromGroup:z.group,toGroup:hr.group}}return{parse:C}})();var cc=(function(){for(var Ar=["package","node","folder","frame","cloud","database","storage","artifact","card","rectangle","action","agent","boundary","circle","collections","control","entity","file","hexagon","label","person","queue","stack","usecase"],Z={},Mr=0;Mr<Ar.length;Mr++)Z[Ar[Mr]]=!0;for(var Yr=["component","interface","port","portin","portout"],fe={},Wr=0;Wr<Yr.length;Wr++)fe[Yr[Wr]]=!0;function Nr(_,C){var $=_.length,y=C,A="none",s="none",k=0,o=0;for(y<$&&_[y]==="<"?(A="filled",y++):y<$&&_[y]===")"&&y+1<$&&(_[y+1]==="-"||_[y+1]===".")&&(A="socket",y++);y<$&&_[y]==="-";)k++,y++;for(;y<$&&_[y]===".";)o++,y++;for(;y<$&&_[y]==="-";)k++,y++;for(;y<$&&_[y]===".";)o++,y++;if(k+o===0)return null;y<$&&_[y]===">"?(s="filled",y++):y<$&&_[y]==="("&&(y+1>=$||_[y+1]===" "||_[y+1]===" ")&&(s="socket",y++);var a;o>0?a="dashed":a="solid";var t;return A==="socket"||s==="socket"?t="socket":A!=="none"&&s!=="none"?t="bidirectional":s!=="none"||A!=="none"?t="open":t="none",{end:y,lineStyle:a,leftHead:A,rightHead:s,arrowHead:t,stemLen:k+o}}function lr(_){return _==null?_:String(_).replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," ")}function Y(_,C){for(;C<_.length&&(_[C]===" "||_[C]===" ");)C++;if(C>=_.length)return null;if(_[C]==="["){var $=_.indexOf("]",C+1);return $<0&&($=_.length),{name:lr(_.substring(C+1,$)),end:$+1,kind:"bracket"}}if(_[C]===":"){var y=_.indexOf(":",C+1);if(y>C+1)return{name:lr(_.substring(C+1,y)),end:y+1,kind:"actor"}}if(_[C]==='"'){var A=_.indexOf('"',C+1);return A<0&&(A=_.length),{name:lr(_.substring(C+1,A)),end:A+1,kind:"bare"}}if(_[C]==="("&&C+1<_.length&&_[C+1]===")")return Y(_,C+2);for(var s=C;s<_.length&&/[\w]/.test(_[s]);)s++;return s===C?null:{name:_.substring(C,s),end:s,kind:"bare"}}function Cr(_,C,$,y,A){if(C.hasOwnProperty(_))return _;for(var s in C)if(C.hasOwnProperty(s)&&$[C[s]].name===_)return s;var k={id:_,name:_,kind:y||"component",children:null,color:null,parent:A||null};return C[_]=$.length,$.push(k),_}function V(_,C,$,y){var A=/-\[[^\]]*hidden[^\]]*\][a-z]*-/i.test(_),s=null,k=_.match(/[-\]](up|u|down|d|left|l|right|r)-/i);k&&(s=k[1].toLowerCase().charAt(0));var o=!1;(/\s~~+\s/.test(_)||/~~+[\s>(]/.test(_))&&(o=!0,_=_.replace(/~~+/g,function(eo){return new Array(eo.length+1).join("-")}));var a=null,t=!1,n=null,v=_.match(/-\[([^\]]*)\][a-z]*-/i);if(v)for(var R=v[1].split(","),Q=0;Q<R.length;Q++){var L=R[Q].replace(/^\s+|\s+$/g,"");L.charAt(0)==="#"?a=L:/^bold$/i.test(L)||/^thickness\s*=/i.test(L)?t=!0:/^(dashed|dotted)$/i.test(L)&&(n=L.toLowerCase())}_=_.replace(/-\[[^\]]*\](?:up|down|left|right|u|d|l|r)?-/gi,"--"),_=_.replace(/-(up|down|left|right|u|d|l|r)-/gi,"--");var B=Y(_,0);if(B==null)return null;for(var w=B.end;w<_.length&&(_[w]===" "||_[w]===" ");)w++;if(w>=_.length)return null;var ar=Nr(_,w);if(ar==null)return null;for(var sr=ar.end;sr<_.length&&(_[sr]===" "||_[sr]===" ");)sr++;var ir=Y(_,sr);if(ir==null)return null;var _r=null,Sr=ir.end,ae=_.indexOf(":",Sr);ae>=0&&(_r=_.substring(ae+1).replace(/^\s+|\s+$/g,""),_r.length>=2&&_r.charAt(0)==='"'&&_r.charAt(_r.length-1)==='"'&&(_r=_r.substring(1,_r.length-1)),_r=_r.replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," "));var se=B.kind==="bracket"?"component":B.kind==="actor"?"actor":"interface",re=ir.kind==="bracket"?"component":ir.kind==="actor"?"actor":"interface",Ur=Cr(B.name,C,$,se,y),oe=Cr(ir.name,C,$,re,y),Ce=Ur,Me=oe;return ar.leftHead!=="none"&&ar.rightHead==="none"&&(Ce=oe,Me=Ur,s==="r"?s="l":s==="l"?s="r":s==="u"?s="d":s==="d"&&(s="u")),{from:Ce,to:Me,label:_r,lineStyle:n||(o?"dotted":ar.lineStyle),arrowHead:ar.arrowHead,color:a,bold:t,dir:s,hidden:A,span:Math.max(0,ar.stemLen-1)}}function U(_,C){for(var $=1,y=[],A=C+1;A<_.length;A++){for(var s=_[A].replace(/^\s+|\s+$/g,""),k=0;k<s.length;k++)if(s[k]==="{")$++;else if(s[k]==="}"&&($--,$===0))return{endIdx:A,bodyLines:y};y.push(s)}return{endIdx:_.length-1,bodyLines:y}}function H(_,C){for(var $=C;$<_.length;$++)if(/^[^\[\]]*\]$/.test(_[$].replace(/^\s+|\s+$/g,"")))return $;return-1}function J(_,C){for(var $=C;$<_.length;$++)if(/"$/.test(_[$].replace(/^\s+|\s+$/g,"")))return $;return-1}function gr(_,C,$){for(var y=[],A=!1,s=0;s<C.length;s++){var k=C[s].replace(/^\s+|\s+$/g,"");if(!A&&/^\{\{/.test(k)&&(A=!0,Eo.droppedNote($,"component","embedded {{ }} sub-diagram",null,C[s])),A){/\}\}$/.test(k)&&(A=!1);continue}y.push(k)}_.body=y,_.name=y.join(`
+`)}function X(_,C){for(var $=[],y=C+1;y<_.length;y++){var A=_[y].replace(/^\s+|\s+$/g,"");if(/^end\s*note$/i.test(A))return{text:$.join(`
+`),endIdx:y};$.push(A)}return{text:$.join(`
+`),endIdx:_.length-1}}function g(_,C,$,y,A,s,k){for(var o=0;o<_.length;o++){var a=_[o].replace(/^\s+|\s+$/g,"");if(a!==""){if(a==="}"){if(k.togetherOpen.length>0){for(var t=k.togetherOpen.pop(),n=[],v=t.nodeCount;v<$.length;v++)$[v].parent===t.parent&&n.push($[v].id);for(var R=t.containerCount;R<y.length;R++)y[R].parent===t.parent&&n.push(y[R].id);n.length>1&&k.togethers.push(n)}continue}if(a.charAt(0)!=="'"){if(/^<style\b/i.test(a)&&!/<\/style\s*>/i.test(a)){for(;o+1<_.length&&!/<\/style\s*>/i.test(_[o]);)o++;continue}if(!/^<\/?style\b/i.test(a)){if(a=a.replace(/<\$([\w.-]+)\{[^}]*\}>/g,"<$$$1>"),/^sprite\s+\S+\s+<svg\b/i.test(a)){for(;o+1<_.length&&!/<\/svg\s*>/i.test(_[o]);)o++;continue}if(/^sprite\s+\S+\s+\[[^\]]*\]\s*\{\s*$/i.test(a)){for(;o+1<_.length&&!/^\s*\}\s*$/.test(_[o]);)o++;continue}if(!/^sprite\b/i.test(a)&&a.charAt(0)!=="!"){if(/^skinparam\b/i.test(a)){if(/\{\s*$/.test(a)){var Q=U(_,o);o=Q.endIdx}continue}var L=/^title\s+(.+)$/i.exec(a);if(L&&k){k.title=lr(L[1]);continue}if(/^title\s*$/i.test(a)){for(var B=[],w=o+1;w<_.length&&!/^end\s*title$/i.test(_[w].replace(/^\s+|\s+$/g,""));w++)B.push(_[w].replace(/^\s+|\s+$/g,""));o=w,k&&(k.title=lr(B.join(`
+`)));continue}if(/^(hide|show|remove|restore|newpage)\b/i.test(a)){Eo.ignoredDirective(k.config,"component",s==null?o:null,_[o]);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:header|footer|caption)\b/i.test(a)){var ar=Ua.take(k,_,o);if(ar>=0){o=ar;continue}}if(!(/^(header|footer|caption|scale|mainframe)\b/i.test(a)||/^set\s+(?:namespace)?separator\b/i.test(a))&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(a)){var sr=a.match(/^note\s+(left|right|top|bottom)\s+of\s+(?:"([^"]+)"|(\[[^\]]+\])|(\S+?))\s*:\s*(.*)$/i);if(sr&&k){k.notes.push({position:sr[1].toLowerCase(),target:sr[2]||(sr[3]?sr[3].slice(1,-1):sr[4]),text:sr[5].replace(/^\s+|\s+$/g,"").replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," ")});continue}var ir=a.match(/^note\s+(left|right|top|bottom)\s+of\s+(?:"([^"]+)"|(\[[^\]]+\])|(\S+))\s*$/i);if(ir&&k){var _r=X(_,o);o=_r.endIdx,k.notes.push({position:ir[1].toLowerCase(),target:ir[2]||(ir[3]?ir[3].slice(1,-1):ir[4]),text:_r.text.replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," ")});continue}var Sr=a.match(/^note\s+"([^"]+)"\s+as\s+(\S+)\s*$/i);if(Sr){var ae=Sr[1].replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," ");C[Sr[2]]=$.length,$.push({id:Sr[2],name:ae,kind:"note",children:null,color:null,parent:s||null});continue}var se=a.match(/^note\s+as\s+(\S+)\s*$/i);if(se){var re=X(_,o);o=re.endIdx,C[se[1]]=$.length,$.push({id:se[1],name:re.text.replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," "),kind:"note",children:null,color:null,parent:s||null});continue}if(/^[rh]?note\b/i.test(a)){if(/^end\s*note$/i.test(a)||Eo.droppedNote(k.config,"component","note form",s==null?o:null,_[o]),!/:/.test(a)&&!/^end\s*note$/i.test(a)){var Ur=X(_,o);o=Ur.endIdx}continue}var oe=a.match(/^legend(?:\s+(left|right|top|bottom|center))?\s*$/i);if(oe){for(var Ce=[],Me=o+1;Me<_.length;Me++){var eo=_[Me].replace(/^\s+|\s+$/g,"");if(/^end\s*legend$/i.test(eo))break;Ce.push(eo.replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," "))}o=Me,k&&!k.legend&&(k.legend={position:oe[1]?oe[1].toLowerCase():"center",lines:Ce});continue}var Hr=a.toLowerCase();if(/^together\s*\{\s*$/i.test(a)){k.togetherOpen.push({parent:s||null,nodeCount:$.length,containerCount:y.length});continue}var Ne=null,He=a.match(/^(package|node|folder|frame|cloud|database|storage|artifact|card|rectangle|action|agent|boundary|circle|collections|control|entity|file|hexagon|label|person|queue|stack|usecase|component|interface|actor)\s+([^\s\[\]"{}<#]+)\s*((?:<<[^>]*>>|\[\[[^\]]*\]\]|#[^\s\[]+|\s)*)(?:\[([^\[\]]*)|as\s*"([^"]*))$/i);if(He){var Kr=He[4]===void 0,Ue=Kr?J(_,o+1):H(_,o+1);if(Ue>=0){Ne=[];var O=(Kr?He[5]:He[4]).replace(/^\s+|\s+$/g,"");O!==""&&Ne.push(O);for(var T=o+1;T<Ue;T++)Ne.push(_[T].replace(/^\s+|\s+$/g,""));var N=_[Ue].replace(/^\s+|\s+$/g,"");N=N.substring(0,N.length-1).replace(/^\s+|\s+$/g,""),N!==""&&Ne.push(N),o=Ue,a=(He[1]+" "+He[2]+" "+He[3].replace(/\[\[[^\]]*\]\]/g,"")).replace(/\s+$/,""),Hr=a.toLowerCase()}}var D=a.match(/^(package|node|folder|frame|cloud|database|storage|artifact|card|rectangle|action|agent|boundary|circle|collections|control|entity|file|hexagon|label|person|queue|stack|usecase)\s+(.+)$/i);if(D&&!/^(?:[>~=.-]|<(?![$&]))/.test(D[2])){var K=D[1].toLowerCase(),P=D[2],u=null,m=null,G=null,I=0;if(P.charAt(0)==='"'&&P.charAt(1)==='"'){var er=P.indexOf('""',2);er<0&&(er=P.length),u=lr(P.substring(2,er)),I=er+2}else if(P.charAt(0)==='"'){var z=P.indexOf('"',1);z<0&&(z=P.length),u=lr(P.substring(1,z)),I=z+1}else{for(var hr=0;hr<P.length&&P[hr]!==" "&&P[hr]!==" "&&P[hr]!=="{";)hr++;u=P.substring(0,hr),I=hr}for(var mr=P.substring(I).replace(/^\s+/,""),ne=null,ye=!0;ye;){ye=!1;var Je=mr.match(/^<<\s*([^>]*?)\s*>>(.*)/);if(Je&&ne==null){ne=Je[1],mr=Je[2].replace(/^\s+/,""),ye=!0;continue}var _o=mr.match(/^as\s+(?:"([^"]*)"|(\S+))(.*)/i);if(_o&&m==null){_o[1]!==void 0?(m=u,u=lr(_o[1])):m=_o[2],mr=_o[3].replace(/^\s+/,""),ye=!0;continue}var Oo=mr.match(/^(#\S+)(.*)/);Oo&&G==null&&(G=Oo[1],mr=Oo[2].replace(/^\s+/,""),ye=!0)}var qe=m||u,St=mr.indexOf("{")>=0||/\{\s*$/.test(a);if(St){var ht=U(_,o);o=ht.endIdx;var nn={id:qe,name:u,kind:K,children:[],color:G,stereotype:ne,parent:s||null};y.push(nn);var Tt=$.length,Lo=y.length;g(ht.bodyLines,C,$,y,A,qe,k);for(var Qt=Tt;Qt<$.length;Qt++)$[Qt].parent===qe&&nn.children.push($[Qt].id);for(var pt=Lo;pt<y.length;pt++)y[pt].parent===qe&&nn.children.push(y[pt].id)}else{var So={id:qe,name:u,kind:K,children:null,color:G,stereotype:ne,parent:s||null};Ne&&gr(So,Ne,k.config),C[qe]=$.length,$.push(So)}continue}var it=a.match(/^component\s+(.+)$/i);if(it){var qt=it[1],Pt=null,We=null,pn=null,ra=0;if(qt.charAt(0)==='"'){var Gn=qt.indexOf('"',1);Gn<0&&(Gn=qt.length),Pt=lr(qt.substring(1,Gn)),ra=Gn+1}else if(qt.charAt(0)==="["){var Xe=qt.indexOf("]",1);Xe<0&&(Xe=qt.length),Pt=lr(qt.substring(1,Xe)),ra=Xe+1}else{for(var f=0;f<qt.length&&qt[f]!==" "&&qt[f]!==" "&&qt[f]!=="{";)f++;Pt=qt.substring(0,f),ra=f}for(var d=qt.substring(ra).replace(/^\s+/,""),b=null,E=!0;E;){E=!1;var ur=d.match(/^<<\s*([^>]*?)\s*>>(.*)/);if(ur&&b==null){b=ur[1],d=ur[2].replace(/^\s+/,""),E=!0;continue}var Er=d.match(/^as\s+(?:"([^"]*)"|(\S+))(.*)/i);if(Er&&We==null){Er[1]!==void 0?(We=Pt,Pt=Er[1]):We=Er[2],d=Er[3].replace(/^\s+/,""),E=!0;continue}var ke=d.match(/^(#\S+)(.*)/);ke&&pn==null&&(pn=ke[1],d=ke[2].replace(/^\s+/,""),E=!0)}var dr=We||Pt,Go=d.indexOf("{")>=0||/\{\s*$/.test(a);if(Go){var lo=U(_,o);o=lo.endIdx;var vo={id:dr,name:Pt,kind:"component",children:[],color:pn,stereotype:b,parent:s||null};y.push(vo);var Rn=$.length,rn=y.length;g(lo.bodyLines,C,$,y,A,dr,k);for(var Co=Rn;Co<$.length;Co++)$[Co].parent===dr&&vo.children.push($[Co].id);for(var Dn=rn;Dn<y.length;Dn++)y[Dn].parent===dr&&vo.children.push(y[Dn].id)}else{var Ve={id:dr,name:Pt,kind:"component",children:null,color:pn,stereotype:b,parent:s||null};Ne&&gr(Ve,Ne,k.config),C[dr]=$.length,$.push(Ve)}continue}var dt=a.match(/^(?:interface|\(\))\s+(.+)$/i);if(dt){var $t=dt[1],Sa=null,ba=null,sl=0;if($t.charAt(0)==='"'){var ua=$t.indexOf('"',1);ua<0&&(ua=$t.length),Sa=$t.substring(1,ua),sl=ua+1}else{for(var ea=0;ea<$t.length&&/[\w]/.test($t[ea]);)ea++;Sa=$t.substring(0,ea),sl=ea}var fn=$t.substring(sl).replace(/^\s+/,""),ui=fn.match(/^as\s+(\S+)/i);ui&&(ba=ui[1]);var oi=ba||Sa;if(!C.hasOwnProperty(oi)){var Zl={id:oi,name:Sa,kind:"interface",children:null,color:null,parent:s||null};Ne&&gr(Zl,Ne,k.config),C[oi]=$.length,$.push(Zl)}continue}var Ca=a.match(/^actor\s+(?:"([^"]+)"|(\S+))(?:\s+as\s+(\S+))?\s*(#\S+)?\s*$/i);if(Ca){var Cl=Ca[1]||Ca[2],Aa=Ca[3],en=Ca[4]||null,xt=Aa||Cl;if(!C.hasOwnProperty(xt)){var pl={id:xt,name:Cl,kind:"actor",children:null,color:en,parent:s||null};Ne&&gr(pl,Ne,k.config),C[xt]=$.length,$.push(pl)}continue}var Pl=a.match(/^(port|portin|portout)\s+(\S+)/i);if(Pl){var Oi=Pl[1].toLowerCase(),el=Pl[2],Rl=el;if(!C.hasOwnProperty(Rl)){var $l={id:Rl,name:el,kind:Oi,children:null,color:null,parent:s||null};C[Rl]=$.length,$.push($l)}continue}var fa=V(a,C,$,s);if(fa!=null){A.push(fa);continue}var xa=Y(a,0);if(xa!=null){var fi=a.slice(xa.end),Nl=fi.match(/^\s*(?:<<([^>]*)>>\s*)?(?:as\s+(\S+))?\s*(?:<<([^>]*)>>\s*)?(#\S+)?\s*$/i);if(Nl&&(xa.kind==="bracket"||/^"/.test(a))){var jl=xa.kind==="bracket"?"component":"interface",ha=Nl[2]||null,Bi=Nl[4]||null,Ii=(Nl[1]||Nl[3]||"").replace(/^\s+|\s+$/g,"")||null;if(ha)C.hasOwnProperty(ha)||(C[ha]=$.length,$.push({id:ha,name:xa.name,kind:jl,children:null,color:Bi,stereotype:Ii,parent:s||null}));else{var mi=Cr(xa.name,C,$,jl,s);Bi&&C.hasOwnProperty(mi)&&($[C[mi]].color=Bi),Ii&&C.hasOwnProperty(mi)&&!$[C[mi]].stereotype&&($[C[mi]].stereotype=Ii)}continue}}Eo.droppedLine(k.config,"component",s==null?o:null,_[o])}}}}}}}function M(_,C){C=C||{};var $=_.split(/\r\n|\r|\n/),y=[],A={},s=[],k=[],o={notes:[],legend:null,title:null,config:C,togethers:[],togetherOpen:[],header:null,footer:null,caption:null};g($,A,y,s,k,null,o);var a=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(_)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(_),t=_.match(/^\s*(left\s+to\s+right|top\s+to\s+bottom)\s+direction\b/im),n=t?/left/i.test(t[1])?"LR":"TB":null,v=_.match(/skinparam\s+defaultTextAlignment\s+(left|center|centre|right)/i),R="left";if(v){var Q=v[1].toLowerCase();R=Q==="centre"?"center":Q}var L=_.match(/^\s*skinparam\s+packageStyle\s+(\w+)/im),B=L?L[1].toLowerCase():null;return{nodes:y,containers:s,connections:k,notes:o.notes,legend:o.legend,title:o.title,header:o.header,footer:o.footer,caption:o.caption,monochrome:a,direction:n,textAlign:R,packageStyle:B,togethers:o.togethers}}return{parse:M}})();var hc=(function(){function Ar(V,U){var H=V.length,J=U,gr="none",X="none",g=0,M=0;for(J+1<H&&V[J]==="<"&&V[J+1]==="|"?(gr="triangle",J+=2):J<H&&V[J]==="<"?(gr="filled",J++):J<H&&V[J]==="*"&&J+1<H&&(V[J+1]==="-"||V[J+1]===".")?(gr="diamond_filled",J++):J<H&&V[J]==="o"&&J+1<H&&(V[J+1]==="-"||V[J+1]===".")&&(gr="diamond_open",J++);J<H&&V[J]==="-";)g++,J++;for(;J<H&&V[J]===".";)M++,J++;for(;J<H&&V[J]==="-";)g++,J++;for(;J<H&&V[J]===".";)M++,J++;if(g+M===0)return null;J+1<H&&V[J]==="|"&&V[J+1]===">"?(X="triangle",J+=2):J<H&&V[J]===">"?(X="filled",J++):J<H&&(V[J]==="*"||V[J]==="o")&&(J+1>=H||V[J+1]===" "||V[J+1]===" "||V[J+1]==='"'||V[J+1]===":")&&(X=V[J]==="*"?"diamond_filled":"diamond_open",J++);var _;return M>0&&g===0?_="dotted":M>0?_="dashed":_="solid",{end:J,lineStyle:_,leftHead:gr,rightHead:X}}function Z(V,U){for(;U<V.length&&(V[U]===" "||V[U]===" ");)U++;if(U>=V.length)return null;if(V[U]==='"'){var H=V.indexOf('"',U+1);return H<0&&(H=V.length),{name:V.substring(U+1,H),end:H+1}}for(var J=U;J<V.length&&/[\w]/.test(V[J]);)J++;return J===U?null:{name:V.substring(U,J),end:J}}function Mr(V,U,H){if(U.hasOwnProperty(V))return V;for(var J in U)if(U.hasOwnProperty(J)&&H[U[J]].name===V)return J;var gr={id:V,name:V,kind:"object",attributes:[]};return U[V]=H.length,H.push(gr),V}function Yr(V,U,H){var J=Z(V,0);if(J==null)return null;for(var gr=J.end;gr<V.length&&(V[gr]===" "||V[gr]===" ");)gr++;if(gr>=V.length)return null;var X=Ar(V,gr);if(X==null)return null;for(var g=X.end;g<V.length&&(V[g]===" "||V[g]===" ");)g++;var M=Z(V,g);if(M==null)return null;var _=null,C=M.end,$=V.indexOf(":",C);$>=0&&(_=V.substring($+1).replace(/^\s+|\s+$/g,""));var y=Mr(J.name,U,H),A=Mr(M.name,U,H),s=y,k=A;X.leftHead!=="none"&&X.rightHead==="none"&&(s=A,k=y);var o="association";return X.leftHead==="triangle"||X.rightHead==="triangle"?o="generalization":X.leftHead==="diamond_filled"||X.rightHead==="diamond_filled"||X.leftHead==="diamond_open"||X.rightHead==="diamond_open"?(o=X.leftHead==="diamond_filled"||X.rightHead==="diamond_filled"?"composition":"aggregation",X.rightHead==="diamond_filled"||X.rightHead==="diamond_open"?(s=A,k=y):(s=y,k=A)):X.leftHead==="none"&&X.rightHead==="none"&&(o="link"),{from:s,to:k,label:_,lineStyle:X.lineStyle,type:o}}function fe(V,U){for(var H=1,J=[],gr=U+1;gr<V.length;gr++){for(var X=V[gr].replace(/^\s+|\s+$/g,""),g=0;g<X.length;g++)if(X[g]==="{")H++;else if(X[g]==="}"&&(H--,H===0))return{endIdx:gr,bodyLines:J};H>0&&J.push(X)}return{endIdx:V.length-1,bodyLines:J}}function Wr(V,U){for(var H=[],J=U+1;J<V.length;J++){var gr=V[J].replace(/^\s+|\s+$/g,"");if(/^end\s*note$/i.test(gr))return{text:H.join(`
+`),endIdx:J};H.push(gr)}return{text:H.join(`
+`),endIdx:V.length-1}}function Nr(V){var U=V.substring(0,2);if(V.length<2||V==="..."||U!=="--"&&U!==".."&&U!=="=="&&U!=="__"||V.substring(V.length-2)!==U)return null;var H=V.length>4?V.substring(2,V.length-2).replace(/^\s+|\s+$/g,""):"",J=U.charAt(0);return new RegExp("^\\"+J+"*$").test(H)&&(H=""),{separator:!0,style:J,title:H}}function lr(V){for(var U=[],H=0;H<V.length;H++){var J=V[H].replace(/^\s+|\s+$/g,"");if(J!==""){var gr=Nr(J);if(gr!=null){U.push(gr);continue}var X=J.indexOf("=");if(X>0){U.push({name:J.substring(0,X).replace(/^\s+|\s+$/g,""),value:J.substring(X+1).replace(/^\s+|\s+$/g,""),text:J});continue}var g=J.indexOf(":");if(g>0){U.push({name:J.substring(0,g).replace(/^\s+|\s+$/g,""),value:J.substring(g+1).replace(/^\s+|\s+$/g,""),text:J});continue}U.push({name:J,value:"",text:J})}}return U}function Y(V){for(var U=[],H=[],J=0;J<V.length;J++){var gr=V[J].replace(/^\s+|\s+$/g,"");if(gr!==""){var X=gr.match(/^(.+?)\s*\*?->\s*(\S+)\s*$/);if(X&&gr.indexOf("=>")<0){U.push({key:X[1],value:""}),H.push({key:X[1],target:X[2]});continue}var g=gr.indexOf("=>");if(g>=0){var M=gr.substring(0,g).replace(/^\s+|\s+$/g,""),_=gr.substring(g+2).replace(/^\s+|\s+$/g,"");U.push({key:M,value:_})}else U.push({key:gr,value:""})}}return{entries:U,links:H}}function Cr(V,U){U=U||{};var H=V.split(/\r\n|\r|\n/),J=[],gr={},X=[],g=[],M=[],_=[],C=[],$={title:null,header:null,footer:null,caption:null,legend:null};function y(Pt,We){var pn={name:Pt,stereotype:We||null,objects:[]};_.push(pn),C.push(pn)}function A(){return C.length>0?C[C.length-1]:null}for(var s=0;s<H.length;s++){var k=H[s],o=k.replace(/^\s+|\s+$/g,"");if(o!==""&&o.charAt(0)!=="'"&&o.charAt(0)!=="!"){var a=o.match(/^(package|namespace)\s+(?:"([^"]+)"|(\S+?))(?:\s*<<([^>]+)>>)?\s*\{\s*$/i);if(a){y(a[2]||a[3],a[4]||null);continue}if(o==="}"&&C.length>0){C.pop();continue}if(/^skinparam\b/i.test(o)){if(/\{\s*$/.test(o)){var t=fe(H,s);s=t.endIdx}continue}if(/^(hide|show|remove|restore|newpage)\b/i.test(o)){Eo.ignoredDirective(U,"object",s,k);continue}if(/^note\s+(?:"[^"]*"\s+)?as\s+\S+\s*(?:#[\w:;.]+)?\s*$/i.test(o)){var n=Ua.take($,H,s);if(n>=0){s=n;continue}}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(o)){var v=Ua.take($,H,s);if(v>=0){s=v;continue}}if(!/^(title|header|footer|caption|scale|mainframe)\b/i.test(o)&&!/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i.test(o)){var R=o.match(/^note\s+(left|right|top|bottom)\s+of\s+(?:"([^"]+)"|(\S+?))\s*:\s*(.*)$/i);if(R){M.push({position:R[1].toLowerCase(),target:R[2]||R[3],text:R[4].replace(/^\s+|\s+$/g,"").replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," ")});continue}var Q=o.match(/^note\s+(left|right|top|bottom)\s+of\s+(?:"([^"]+)"|(\S+))\s*$/i);if(Q){var L=Wr(H,s);s=L.endIdx,M.push({position:Q[1].toLowerCase(),target:Q[2]||Q[3],text:L.text.replace(/\\r\\n|\\n|\\r/g,`
+`).replace(/\\t/g," ")});continue}if(/^[rh]?note\b/i.test(o)){if(/^end\s*note$/i.test(o)||Eo.droppedNote(U,"object","note form",s,k),!/:/.test(o)&&!/^end\s*note$/i.test(o)){var B=Wr(H,s);s=B.endIdx}continue}var w=o.match(/^map\s+(.+)$/i);if(w){var ar=w[1],sr=null,ir=null,_r=0;if(ar.charAt(0)==='"'){var Sr=ar.indexOf('"',1);Sr<0&&(Sr=ar.length),sr=ar.substring(1,Sr),_r=Sr+1}else{for(var ae=0;ae<ar.length&&/[\w]/.test(ar[ae]);)ae++;sr=ar.substring(0,ae),_r=ae}var se=ar.substring(_r).replace(/^\s+/,""),re=se.match(/^as\s+(\S+)(.*)/i);re&&(ir=re[1],se=re[2].replace(/^\s+/,""));var Ur=ir||sr,oe=se.indexOf("{")>=0||/\{\s*$/.test(o);if(oe){var Ce=fe(H,s);s=Ce.endIdx;var Me=Y(Ce.bodyLines),eo={id:Ur,name:sr,entries:Me.entries};X.push(eo),gr[Ur]=J.length,J.push({id:Ur,name:sr,kind:"map",attributes:[]});for(var Hr=0;Hr<Me.links.length;Hr++){var Ne=Mr(Me.links[Hr].target,gr,J);g.push({from:Ur,to:Ne,label:null,lineStyle:"solid",type:"association",fromRow:Me.links[Hr].key})}}else{var He={id:Ur,name:sr,entries:[]};X.push(He),gr[Ur]=J.length,J.push({id:Ur,name:sr,kind:"map",attributes:[]})}continue}var Kr=o.match(/^object\s+(.+)$/i);if(Kr){var Ue=Kr[1],O=null,T=null,N=null,D=0;if(Ue.charAt(0)==='"'){var K=Ue.indexOf('"',1);K<0&&(K=Ue.length),O=Ue.substring(1,K),D=K+1}else{for(var P=0;P<Ue.length&&/[\w]/.test(Ue[P]);)P++;O=Ue.substring(0,P),D=P}var u=Ue.substring(D).replace(/^\s+/,""),m=u.match(/^as\s+(\S+)(.*)/i);m&&(T=m[1],u=m[2].replace(/^\s+/,""));for(var G=null,I=!0;I;){I=!1;var er=u.match(/^<<\s*([^>]*?)\s*>>(.*)/);if(er&&G==null){G=er[1],u=er[2].replace(/^\s+/,""),I=!0;continue}var z=u.match(/^(#\S+)(.*)/);z&&N==null&&(N=z[1],u=z[2].replace(/^\s+/,""),I=!0)}var hr=T||O,mr=u.indexOf("{")>=0||/\{\s*$/.test(o);if(mr){var ne=fe(H,s);s=ne.endIdx;var ye=lr(ne.bodyLines);if(gr.hasOwnProperty(hr)){var _o=J[gr[hr]];_o.attributes=ye}else{gr[hr]=J.length,J.push({id:hr,name:O,kind:"object",color:N,stereotype:G,attributes:ye});var Je=A();Je&&Je.objects.push(hr)}}else if(!gr.hasOwnProperty(hr)){gr[hr]=J.length,J.push({id:hr,name:O,kind:"object",color:N,stereotype:G,attributes:[]});var Oo=A();Oo&&Oo.objects.push(hr)}continue}var qe=o.match(/^([^\s:"]+)\s+:(?!:)\s*(.*)$/);if(qe!=null&&qe[2]!==""){var St=qe[1],ht=qe[2].replace(/\s+$/,""),nn=gr.hasOwnProperty(St)?gr[St]:-1;if(nn<0){nn=J.length,gr[St]=nn,J.push({id:St,name:St,kind:"object",color:null,stereotype:null,attributes:[]});var Tt=A();Tt&&Tt.objects.push(St)}var Lo=J[nn];if(Lo.kind==="map"){for(var Qt=null,pt=0;pt<X.length;pt++)if(X[pt].id===St){Qt=X[pt];break}if(Qt!=null){var So=Y([ht]);Qt.entries=Qt.entries.concat(So.entries);for(var it=0;it<So.links.length;it++)g.push({from:St,to:So.links[it].target,type:"association",fromRow:So.links[it].key})}}else Lo.attributes=(Lo.attributes||[]).concat(lr([ht]));continue}var qt=Yr(o,gr,J);if(qt!=null){g.push(qt);continue}Eo.droppedLine(U,"object",s,k)}}}return Ua.merge({objects:J,maps:X,links:g,notes:M,packages:_},$)}return{parse:Cr}})();var vc=(function(){function Ar(X){var g=X.match(/<<\s*([^>]*?)\s*>>/);return g?{stereotype:g[1],rest:X.substring(0,g.index)+X.substring(g.index+g[0].length)}:null}function Z(X){var g=X.match(/#([A-Za-z0-9]+)/);return g?{color:"#"+g[1],rest:X.substring(0,g.index)+X.substring(g.index+g[0].length)}:null}function Mr(X){var g=X.match(/\bas\s+(\S+)/i);return g?{alias:g[1],rest:X.substring(0,g.index)+X.substring(g.index+g[0].length)}:null}function Yr(X,g,M,_,C){if(M.hasOwnProperty(X))return{kind:"actor",id:X};if(C.hasOwnProperty(X))return{kind:"usecase",id:X};for(var $ in M)if(M.hasOwnProperty($)&&g[M[$]].name===X)return{kind:"actor",id:$};for(var y in C)if(C.hasOwnProperty(y)&&_[C[y]].name===X)return{kind:"usecase",id:y};return null}function fe(X,g,M,_,C,$){return C.hasOwnProperty(X)?$&&(_[C[X]].color=$):(C[X]=_.length,_.push({id:X,name:g,stereotype:M||null,color:$||null})),X}function Wr(X){var g=/(?:^|\s)(#[A-Za-z0-9]+(?:;\S*)?)/.exec(X||"");return g?g[1]:null}function Nr(X,g,M,_,C,$){return C.hasOwnProperty(X)?$&&(_[C[X]].color=$):(C[X]=_.length,_.push({id:X,name:g,stereotype:M||null,color:$||null})),X}function lr(X,g){if(!g)return null;for(var M=X.replace(/^\s+|\s+$/g,""),_=0;_<g.length;_++)if(g[_].position==="floating"&&g[_].target===M)return g[_];return null}function Y(X){var g=null,M=null;return X=X.replace(/\s*<<\s*([^>]*?)\s*>>/,function(_,C){return g=C,""}),X=X.replace(/\s+(#[\w|\\/-]+)\s*$/,function(_,C){return M=C,""}),{token:X.replace(/^\s+|\s+$/g,""),stereotype:g,color:M}}function Cr(X,g,M,_,C,$){if(!(X==null||g.stereotype==null&&g.color==null)){var y=_.hasOwnProperty(X)?M[_[X]]:$.hasOwnProperty(X)?C[$[X]]:null;y!=null&&(g.stereotype!=null&&y.stereotype==null&&(y.stereotype=g.stereotype),g.color!=null&&y.color==null&&(y.color=g.color))}}var V={noteLink:!0};function U(X,g,M,_,C,$){X=X.replace(/([-.])\[[^\]\[]*\](?=[-.\w>|])/,"$1"),X=X.replace(/([-.])(?:up|down|left|right|u|d|l|r)([-.(])/gi,"$1$1"),X=X.replace(/([-.>])\(\d+\)/g,"$1").replace(/\(\d+\)([<.-])/g,"$1"),X=X.replace(/-\(0-/g,"--").replace(/-0\)-/g,"--"),X=X.replace(/([-.])>>/g,"$1>").replace(/<<([-.])/g,"<$1"),X=X.replace(/([\w):"\]])(<\|?[-.]+\|?>?|[-.]+\|?>|[-.]{2,}|<[-.]+)(?=[\w(:"\[])/g,"$1 $2 "),X=X.replace(/([\w):"\]])(<\|?[-.]+\|?>?|[-.]+\|?>|[-.]{2,}|<[-.]+)(?=\s)/g,"$1 $2"),X=X.replace(/(\s)(<\|?[-.]+\|?>?|[-.]+\|?>|[-.]{2,}|<[-.]+)(?=[\w(:"\[])/g,"$1$2 ");for(var y=[{re:/\s+(-+)\|>\s+/,type:"generalization",directed:!0},{re:/\s+<\|(-+)\s+/,type:"generalization",reverse:!0,directed:!0},{re:/\s+(\.+)>\s+/,type:"dependency",directed:!0},{re:/\s+<(\.+)\s+/,type:"dependency",reverse:!0,directed:!0},{re:/\s+(-+)>\s+/,type:"association",directed:!0},{re:/\s+<(-+)\s+/,type:"association",reverse:!0,directed:!0},{re:/\s+(\.{2,})\s+/,type:"dependency",directed:!1},{re:/\s+(-{2,})\s+/,type:"association",directed:!1}],A=0;A<y.length;A++){var s=y[A],k=X.match(s.re);if(k){var o=X.substring(0,k.index).replace(/^\s+|\s+$/g,""),a=X.substring(k.index+k[0].length).replace(/^\s+|\s+$/g,""),t=null,n=null,v=a.indexOf(":");if(v>=0){var R=a.substring(v+1).replace(/^\s+|\s+$/g,"");a=a.substring(0,v).replace(/^\s+|\s+$/g,"");var Q=Ar(R);Q?(n=Q.stereotype,t=Q.rest.replace(/^\s+|\s+$/g,"")||null):t=R||null}var L=Y(o),B=Y(a);o=L.token,a=B.token;var w=H(o,g,M,_,C,$),ar=H(a,g,M,_,C,$);Cr(w,L,g,M,_,C),Cr(ar,B,g,M,_,C);var sr=lr(o,$),ir=lr(a,$);if(sr&&!ir&&ar!=null)return sr.anchor==null&&(sr.anchor=ar),(sr.links=sr.links||[]).push(ar),sr.linkType=s.type==="dependency"?"..":"--",V;if(ir&&!sr&&w!=null)return ir.anchor==null&&(ir.anchor=w),(ir.links=ir.links||[]).push(w),ir.linkType=s.type==="dependency"?"..":"--",V;if(w==null||ar==null)continue;var _r=s.reverse?ar:w,Sr=s.reverse?w:ar;return{from:_r,to:Sr,type:s.type,directed:s.directed!==!1,stereotype:n,label:t,span:Math.max(0,k[1].length-1)}}}return null}function H(X,g,M,_,C,$){if(X=X.replace(/^\s+|\s+$/g,""),X==="")return null;if($){for(var y=0;y<$.length;y++)if($[y].position==="floating"&&$[y].target===X)return null}var A=X.match(/^:([^:]+):\/?$/);if(A){var s=A[1].replace(/^\s+|\s+$/g,""),k=s;for(var o in M)if(M.hasOwnProperty(o)&&g[M[o]].name===s)return o;return fe(k,s,null,g,M)}var a=X.match(/^\(([^)]+)\)\/?$/);if(a){var t=a[1].replace(/^\s+|\s+$/g,""),n=t;for(var v in C)if(C.hasOwnProperty(v)&&_[C[v]].name===t)return v;return Nr(n,t,null,_,C)}var R=Yr(X,g,M,_,C);return R?R.id:fe(X,X,null,g,M)}function J(X,g){for(var M=[],_=g+1;_<X.length;_++){var C=X[_].replace(/^\s+|\s+$/g,"");if(C.toLowerCase()==="end note")return{text:M.join(`
+`),endIdx:_};M.push(C)}return{text:M.join(`
+`),endIdx:X.length-1}}function gr(X,g){g=g||{};for(var M=X.split(/\r\n|\r|\n/),_=[],C={},$=[],y={},A=[],s=[],k=[],o=null,a={title:null,header:null,footer:null,caption:null,legend:null},t=[],n=0;n<M.length;n++){var v=M[n],R=v.replace(/^\s+|\s+$/g,"");if(R!==""){if(/^(usecase|actor)\b/i.test(R)&&R.split('"').length%2===0)for(;n+1<M.length;){n++;var Q=M[n].replace(/^\s+|\s+$/g,"");if(R+="\\n"+Q,Q.indexOf('"')>=0)break}if(R.charAt(0)!=="'"&&R.charAt(0)!=="!"){if(/^skinparam\b/i.test(R)){if(/\{\s*$/.test(R))for(var L=1;L>0&&n+1<M.length;){n++;var B=M[n].replace(/^\s+|\s+$/g,"");B.indexOf("{")>=0&&L++,B.indexOf("}")>=0&&L--}continue}if(/^(hide|show|remove|restore|newpage)\b/i.test(R)){Eo.ignoredDirective(g,"useCase",n,v);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(R)){var w=Ua.take(a,M,n);if(w>=0){n=w;continue}}if(!/^(title|header|footer|caption|scale|mainframe)\b/i.test(R)){var ar=R.match(/^(top\s+to\s+bottom|left\s+to\s+right)\s+direction\b/i);if(ar){o=/left/i.test(ar[1])?"LR":"TB";continue}var sr=R.toLowerCase(),ir=R.match(/^(rectangle|package)\s+(?:"([^"]+)"|([^"\s{]+))(?:\s+as\s+(\S+))?\s*\{?\s*$/i);if(ir){var _r=ir[2]||ir[3],Sr=ir[4]||null,ae={name:_r,alias:Sr,kind:ir[1].toLowerCase(),children:[]};A.push(ae),t.push(ae);continue}if(R==="}"){t.length>0&&t.pop();continue}R=R.replace(/^(actor|usecase)\/(?=\s)/i,"$1");var se=R.match(/^actor\s+"?([^"]+?)"?\s+as\s+(\S+)(.*)$/i);if(se){var Ue=se[1],O=se[2],T=se[3]||"",N=null,D=Ar(T);D&&(N=D.stereotype),fe(O,Ue,N,_,C),t.length>0&&t[t.length-1].children.push(O);continue}else{if(se=R.match(/^actor\s+"([^"]+)"(.*)$/i),se){var re=se[1],Ur=se[2]||"",oe=null,Ce=Ar(Ur);Ce&&(oe=Ce.stereotype);var Me=re;fe(Me,re,oe,_,C),t.length>0&&t[t.length-1].children.push(Me);continue}if(se=R.match(/^actor\s+(\S+)(.*)$/i),se){var eo=se[1],Hr=se[2]||"",Ne=null,He=Ar(Hr);He&&(Ne=He.stereotype);var Kr=Hr.match(/(#\S+)/);fe(eo,eo,Ne,_,C,Kr?Kr[1]:null),t.length>0&&t[t.length-1].children.push(eo);continue}}R=R.replace(/^(usecase\s+)\(([^()]+)\)(?=\s)/i,'$1"$2"');var K=R.match(/^usecase\s+"([^"]+)"\s+as\s+(\S+)(.*)$/i);if(K){var qe=K[1],St=K[2],ht=K[3]||"",nn=null,Tt=Ar(ht);Tt&&(nn=Tt.stereotype),Nr(St,qe,nn,$,y,Wr(ht)),t.length>0&&t[t.length-1].children.push(St);continue}else{if(K=R.match(/^usecase\s+"([^"]+)"(.*)$/i),K){var P=K[1],u=K[2]||"",m=null,G=Ar(u);G&&(m=G.stereotype);var I=P;Nr(I,P,m,$,y,Wr(u)),t.length>0&&t[t.length-1].children.push(I);continue}var er=R.match(/^usecase\s+(\S+)\s+as\s+"([^"]+)"(.*)$/i);if(er){var z=er[1],hr=er[2],mr=null,ne=Ar(er[3]||"");ne&&(mr=ne.stereotype),Nr(z,hr,mr,$,y,Wr(er[3])),t.length>0&&t[t.length-1].children.push(z);continue}if(K=R.match(/^usecase\s+(\S+)(.*)$/i),K){var ye=K[1],Je=K[2]||"",_o=null,Oo=Ar(Je);Oo&&(_o=Oo.stereotype),Nr(ye,ye,_o,$,y,Wr(Je)),t.length>0&&t[t.length-1].children.push(ye);continue}}var Lo=R.match(/^:([^:]+):\/?\s*(?:as\s+(\S+))?\s*(<<[^>]*>>)?\s*(#\S+)?\s*$/);if(Lo){var Qt=Lo[1].replace(/^\s+|\s+$/g,""),pt=Lo[2]||null,So=null;if(Lo[3]){var it=Lo[3].match(/<<\s*([^>]*?)\s*>>/);it&&(So=it[1])}var qt=pt||Qt;fe(qt,Qt,So,_,C,Lo[4]||null),t.length>0&&t[t.length-1].children.push(qt);continue}var Pt=R.match(/^\(([^)]+)\)\/?\s*(?:as\s+(\S+))?\s*(<<[^>]*>>)?\s*(#\S+)?\s*$/);if(Pt){var We=Pt[1].replace(/^\s+|\s+$/g,""),pn=Pt[2]||null,ra=null;if(Pt[3]){var Gn=Pt[3].match(/<<\s*([^>]*?)\s*>>/);Gn&&(ra=Gn[1])}var Xe=pn||We;Nr(Xe,We,ra,$,y,Pt[4]||null),t.length>0&&t[t.length-1].children.push(Xe);continue}var f=R.match(/^note\s+(right|left|top|bottom)\s+of\s+(.+?)\s*:\s*(.+)$/i);if(f){var d=f[1].toLowerCase(),b=f[2].replace(/^\s+|\s+$/g,""),E=f[3].replace(/^\s+|\s+$/g,""),ur=b,Er=b.match(/^:([^:]+):$/),ke=b.match(/^\(([^)]+)\)$/);Er?ur=Er[1].replace(/^\s+|\s+$/g,""):ke&&(ur=ke[1].replace(/^\s+|\s+$/g,"")),k.push({position:d,target:ur,text:E,container:t.length>0?A.indexOf(t[t.length-1]):null});continue}var dr=R.match(/^note\s+"([^"]+)"\s+as\s+(\S+)/i);if(dr){var Go=dr[1],lo=dr[2];k.push({position:"floating",target:lo,text:Go});continue}var vo=R.match(/^note\s+(right|left|top|bottom)\s+of\s+(.+)$/i);if(vo){var Rn=vo[1].toLowerCase(),rn=vo[2].replace(/^\s+|\s+$/g,""),Co=rn.match(/^:([^:]+):$/),Dn=rn.match(/^\(([^)]+)\)$/);Co?rn=Co[1].replace(/^\s+|\s+$/g,""):Dn&&(rn=Dn[1].replace(/^\s+|\s+$/g,""));var Ve=J(M,n);n=Ve.endIdx,k.push({position:Rn,target:rn,text:Ve.text,container:t.length>0?A.indexOf(t[t.length-1]):null});continue}var dt=U(R,_,C,$,y,k);if(dt!==V){if(dt){if(t.length>0){var $t=t[t.length-1];$t.children.indexOf(dt.from)<0&&(C.hasOwnProperty(dt.from)||y.hasOwnProperty(dt.from))&&$t.children.push(dt.from),$t.children.indexOf(dt.to)<0&&(C.hasOwnProperty(dt.to)||y.hasOwnProperty(dt.to))&&$t.children.push(dt.to)}s.push(dt);continue}if(/^[rh]?note\b/i.test(R)){Eo.droppedNote(g,"useCase","note form",n,v);var Sa=/:/.test(R)?-1:Eo.blockEnd(M,n,/^\s*end\s*[rh]?note\b/i);Sa>=0&&(n=Sa);continue}Eo.droppedLine(g,"useCase",n,v)}}}}}return Ua.merge({actors:_,usecases:$,containers:A,relationships:s,notes:k,direction:o},a)}return{parse:gr}})();var Cc=(function(){function Ar(Nr,lr,Y,Cr){return{label:Nr,color:lr||null,side:Y||"right",style:Cr||null,stereotypes:[],children:[]}}function Z(Nr){var lr=String(Nr??"").split(`
+`),Y=/^(.*?)(<<\s*(.*)\s*>>)\s*$/.exec(lr[lr.length-1]);if(Y==null)return{label:Nr,stereotypes:[]};lr[lr.length-1]=Y[1].replace(/\s+$/,"");for(var Cr=[],V=Y[2].split(/>>\s*<</),U=0;U<V.length;U++){var H=V[U].replace(/^<<\s*|\s*>>$/g,"").replace(/^\s+|\s+$/g,"");H!==""&&Cr.push(H)}return{label:lr.join(`
+`),stereotypes:Cr}}function Mr(Nr){var lr=Z(Nr.label);Nr.label=lr.label,Nr.stereotypes=lr.stereotypes}function Yr(Nr){var lr=Nr.match(/^(\*+)(.*)$/)||Nr.match(/^(#+)(\s.*|_.*|\[.*|$)/);if(!lr)return null;var Y=lr[1].length,Cr=lr[2],V=null,U=null;Cr.length>0&&Cr.charAt(0)==="_"&&(U="leaf",Cr=Cr.substring(1));var H=Cr.match(/^\[#([A-Za-z0-9]+)\]/);H&&(V="#"+H[1],Cr=Cr.substring(H[0].length)),U==null&&Cr.length>0&&Cr.charAt(0)==="_"&&(U="leaf",Cr=Cr.substring(1));var J=Cr.replace(/^\s+|\s+$/g,"");return{depth:Y,markers:lr[1],label:J,color:V,style:U}}function fe(Nr){var lr=Nr.match(/^([+-]+)(.*)$/);if(!lr)return null;var Y=lr[1],Cr=Y.length,V=Y.charAt(0)==="+"?"right":"left",U=lr[2],H=null,J=null;U.length>0&&U.charAt(0)==="_"&&(J="leaf",U=U.substring(1));var gr=U.match(/^\[#([A-Za-z0-9]+)\]/);gr&&(H="#"+gr[1],U=U.substring(gr[0].length)),J==null&&U.length>0&&U.charAt(0)==="_"&&(J="leaf",U=U.substring(1));var X=U.replace(/^\s+|\s+$/g,"");return{depth:Cr,markers:Y,label:X,color:H,side:V,style:J}}function Wr(Nr,lr){lr=lr||{};var Y=Nr.split(/\r\n|\r|\n/),Cr={legend:null},V=lr.styleSheet||Ft.createSheet(),U=[],H=null,J=null,gr=null,X=null,g=null,M=null,_=[],C="right",$=null,y=0;function A(T){return $==null&&($=T),/\*\*$/.test(T)&&(T=T.replace(/\t/g," ").replace(/^\s+|\s+$/g,"")),T=T.replace(/\t/g," "),T.indexOf(" ")<0?T.length-1:T.length>=$.length&&T.substring(T.length-$.length)===$?T.length-$.length:T.replace(/^\s+|\s+$/g,"").length===1?T.length-1:T.indexOf($)===0?T.length-$.length:T.length-1}function s(T,N){var D=(T.match(/^[ \t]*/)||[""])[0].replace(/\t/g," "),K=A(D+N);return U.length===0?0:K}function k(T,N){if(N===0){H=T,U.push(T),_=[null,T],y=0;return}y===0&&(y=N),N=N%y===0?N/y:Math.max(1,Math.round(N/y));var D=N+1,K=D-1>=1&&D-1<_.length&&_[D-1]!=null?_[D-1]:H;for(K.children.push(T);_.length<=D;)_.push(null);_[D]=T;for(var P=D+1;P<_.length;P++)_[P]=null}var o=!1,a=null;function t(T,N,D){T==="title"?J=D:T==="caption"?g=D:T==="header"?gr={text:D,align:N||"right"}:T==="footer"&&(X={text:D,align:N||"center"})}for(var n=0;n<Y.length;n++){var v=Y[n],R=v.replace(/^\s+|\s+$/g,"");if(M!=null){new RegExp("^end\\s*"+M.kind+"\\b","i").test(R)?(t(M.kind,M.align,M.lines.join(`
+`)),M=null):M.lines.push(R);continue}if(R!==""){if(/^<style>$/i.test(R)){for(var Q=[];n+1<Y.length;){n++;var L=Y[n].replace(/^\s+|\s+$/g,"");if(/^<\/?style>$/i.test(L))break;L.charAt(0)!=="'"&&Q.push(Y[n])}V.addBlock(Q.join(`
+`));continue}var B=/^<style>(.*)<\/style>$/i.exec(R);if(B!=null){V.addBlock(B[1]);continue}if(!/^<style\b/i.test(R)&&R.charAt(0)!=="'"&&R.charAt(0)!=="!"){if(/^skinparam\b/i.test(R)){if(/\{\s*$/.test(R))for(var w=1;w>0&&n+1<Y.length;){n++;var ar=Y[n].replace(/^\s+|\s+$/g,"");ar.indexOf("{")>=0&&w++,ar.indexOf("}")>=0&&w--}continue}if(o){var sr=/^(.*);\s*(<<(.+)>>)?$/.exec(R);sr!=null?(a&&(a.label+=`
+`+sr[1].replace(/\s+$/,""),sr[2]!=null&&(a.label+=" "+sr[2]),Mr(a)),o=!1,a=null):a&&(a.label+=`
+`+R);continue}if(!/^scale\b/i.test(R)){if(/^legend\b/i.test(R)){var ir=Ua.take(Cr,Y,n);if(ir>=0){n=ir;continue}}var _r=R.match(/^(?:(center|left|right)\s+)?(title|header|footer|caption)\b\s*:?\s*(.*)$/i);if(_r!=null){var Sr=_r[1]?_r[1].toLowerCase():null,ae=_r[2].toLowerCase(),se=_r[3].replace(/\s+$/,"");se!==""?t(ae,Sr,se):ae!=="caption"&&(M={kind:ae,align:Sr,lines:[]});continue}if(/^left\s+side\b/i.test(R)){C="left";continue}if(/^right\s+side\b/i.test(R)){C="right";continue}var re=Yr(R);if(re){var Ur=C,oe=s(Y[n],re.markers);oe===0&&(Ur="right");var Ce=re.label,Me=!1;Ce.length>0&&Ce.charAt(0)===":"&&(Ce=Ce.substring(1).replace(/^\s+/,""),Ce.length>0&&Ce.charAt(Ce.length-1)===";"?Ce=Ce.substring(0,Ce.length-1).replace(/\s+$/,""):Me=!0);var eo=Ar(Ce,re.color,Ur,re.style);Me||Mr(eo),k(eo,oe),Me&&(o=!0,a=eo);continue}var Hr=fe(R);if(Hr){var Ne=Hr.side,He=Hr.label,Kr=!1;He.length>0&&He.charAt(0)===":"&&(He=He.substring(1).replace(/^\s+/,""),He.length>0&&He.charAt(He.length-1)===";"?He=He.substring(0,He.length-1).replace(/\s+$/,""):Kr=!0);var Ue=Ar(He,Hr.color,Ne,Hr.style);Kr||Mr(Ue),k(Ue,s(Y[n],Hr.markers)),Kr&&(o=!0,a=Ue);continue}Eo.droppedLine(lr,"mindmap",n,v)}}}}if(M!=null&&t(M.kind,M.align,M.lines.join(`
+`)),a!=null&&Mr(a),U.length===0){var O=Ar("",null,"right",null);O.synthetic=!0,U.push(O)}return Ua.merge({roots:U,root:U[0],title:J,header:gr,footer:X,caption:g,styleSheet:V},Cr)}return{parse:Wr}})();var pc=(function(){function Ar(Y,Cr,V){return{label:Y,style:Cr||null,color:V||null,side:"right",stereotypes:[],code:null,children:[]}}var Z="[A-Za-z0-9_\\u00C0-\\uFFFF]+",Mr=new RegExp("^("+Z+")\\s*[.-]+>\\s*("+Z+")\\s*(#[A-Za-z0-9]+)?\\s*(<<.*?>>)?\\s*(?::\\s*(.*))?$"),Yr=new RegExp('^\\s+"(.*)"\\s+as\\s+('+Z+")\\s*$");function fe(Y){var Cr=String(Y??"").split(`
+`),V=/^(.*?)(<<\s*(.*)\s*>>)\s*$/.exec(Cr[Cr.length-1]);if(V==null)return{label:Y,stereotypes:[]};Cr[Cr.length-1]=V[1].replace(/\s+$/,"");for(var U=[],H=V[2].split(/>>\s*<</),J=0;J<H.length;J++){var gr=H[J].replace(/^<<\s*|\s*>>$/g,"").replace(/^\s+|\s+$/g,"");gr!==""&&U.push(gr)}return{label:Cr.join(`
+`),stereotypes:U}}function Wr(Y){var Cr=fe(Y.label);Y.label=Cr.label,Y.stereotypes=Cr.stereotypes}function Nr(Y){var Cr=Y.match(/^([ \t]*)([*+-]+)(.*)$/);if(!Cr)return null;for(var V=Cr[1].replace(/\t/g," ")+Cr[2],U=Cr[3],H=null,J=null,gr=Cr[2].indexOf("-")>=0?"left":"right",X=null,g;(g=U.match(/^(?:(_)|([<>])|\[#([A-Za-z0-9]+)\]|\(([A-Za-z0-9_À-￿]+)\))/))!=null;)g[1]?H="leaf":g[2]?gr=g[2]==="<"?"left":"right":g[3]?J="#"+g[3]:g[4]&&(X=g[4]),U=U.substring(g[0].length);var M=U.match(Yr);M!=null&&(X=M[2],U=M[1]);var _=U.replace(/^\s+|\s+$/g,"");return{type:V,depth:Cr[2].length,label:_,style:H,color:J,side:gr,code:X}}function lr(Y,Cr){Cr=Cr||{};var V=Y.split(/\r\n|\r|\n/),U=null,H={title:null,header:null,footer:null,caption:null,legend:null},J=Cr.styleSheet||Ft.createSheet(),gr=[],X=!1,g=null,M=null,_={},C=[];function $(oe,Ce){return oe.length>=Ce.length&&oe.substring(oe.length-Ce.length)===Ce}for(var y=0;y<V.length;y++){var A=V[y],s=A.replace(/^\s+|\s+$/g,"");if(s!==""){if(/^<style>$/i.test(s)){for(var k=[];y+1<V.length;){y++;var o=V[y].replace(/^\s+|\s+$/g,"");if(/^<\/?style>$/i.test(o))break;o.charAt(0)!=="'"&&k.push(V[y])}J.addBlock(k.join(`
+`));continue}var a=/^<style>(.*)<\/style>$/i.exec(s);if(a!=null){J.addBlock(a[1]);continue}if(!/^<style\b/i.test(s)&&s.charAt(0)!=="'"&&s.charAt(0)!=="!"){if(/^skinparam\b/i.test(s)){if(/\{\s*$/.test(s))for(var t=1;t>0&&y+1<V.length;){y++;var n=V[y].replace(/^\s+|\s+$/g,"");n.indexOf("{")>=0&&t++,n.indexOf("}")>=0&&t--}continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(s)){var v=Ua.take(H,V,y);if(v>=0){y=v;continue}}if(!/^(title|header|footer|caption|scale)\b/i.test(s)){if(X){var R=/^(.*);\s*(<<(.+)>>)?$/.exec(s);R!=null?(g&&(g.label+=`
+`+R[1].replace(/\s+$/,""),R[2]!=null&&(g.label+=" "+R[2]),Wr(g)),X=!1,g=null):g&&(g.label+=`
+`+s);continue}var Q=s.match(Mr);if(Q!=null){var L=fe("x "+(Q[4]||""));C.push({from:Q[1],to:Q[2],color:Q[3]||null,stereotypes:L.stereotypes,lineIndex:y,raw:A});continue}var B=Nr(A);if(B){var w;U==null?(M=B.type,w=0):B.type.indexOf(" ")<0?w=B.type.length-1:$(B.type,M)||B.type.indexOf(M)===0?w=B.type.length-M.length:w=B.type.length-1,B.depth=Math.max(1,w)+1,U==null&&(B.depth=1);var ar=B.label,sr=!1;ar.length>0&&ar.charAt(0)===":"&&(ar=ar.substring(1).replace(/^\s+/,""),ar.length>0&&ar.charAt(ar.length-1)===";"?ar=ar.substring(0,ar.length-1).replace(/\s+$/,""):sr=!0);var ir=Ar(ar,B.style,B.color);if(ir.side=B.side,ir.code=B.code,B.code!=null&&(_[B.code]=ir),sr||Wr(ir),B.depth===1)U=ir,gr=[null,U];else if(U!=null){var _r=B.depth-1;for(_r>=1&&_r<gr.length&&gr[_r]!=null?gr[_r].children.push(ir):U.children.push(ir);gr.length<=B.depth;)gr.push(null);gr[B.depth]=ir;for(var Sr=B.depth+1;Sr<gr.length;Sr++)gr[Sr]=null}sr&&(X=!0,g=ir);continue}Eo.droppedLine(Cr,"wbs",y,A)}}}}g!=null&&Wr(g),U==null&&(U=Ar("",null,null));for(var ae=[],se=0;se<C.length;se++){var re=C[se],Ur=_.hasOwnProperty(re.from)?_.hasOwnProperty(re.to)?null:re.to:re.from;if(Ur!=null){Eo.unknownReference(Cr,"wbs","node",Ur,re.lineIndex,re.raw);continue}ae.push({from:re.from,to:re.to,color:re.color,stereotypes:re.stereotypes})}return Ua.merge({root:U,links:ae,styleSheet:J},H)}return{parse:lr}})();var $c=(function(){var Ar="(\\d{4}[-/]\\d{1,2}[-/]\\d{1,2})";function Z(g){var M=g.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/);return M?M[1]+"-"+(M[2].length<2?"0"+M[2]:M[2])+"-"+(M[3].length<2?"0"+M[3]:M[3]):g.replace(/\//g,"-")}function Mr(g,M){return{name:g,alias:M||null,duration:0,start:null,end:null,startOffset:null,endOffset:null,after:null,afterOffset:0,afterWorking:!1,alignStart:null,endAlign:null,color:null,isMilestone:!1,isSeparator:!1,resources:[],resource:null,progress:null,predecessors:[]}}var Yr="[A-Za-z0-9_.\\u00C0-\\uFFFF]+",fe=/^\[([^\[\]]+?)\]\s*-+(?:\[([^\]]*)\])?-*>\s*\[([^\[\]]+?)\]\s*$/,Wr=new RegExp("^("+Yr+")\\s*-+(?:\\[([^\\]]*)\\])?-*>\\s*("+Yr+")\\s*$");function Nr(g){var M={color:null,dashed:!1,dotted:!1,bold:!1,hidden:!1};if(g==null)return M;for(var _=g.split(/[,;]/),C=0;C<_.length;C++){var $=_[C].replace(/^\s+|\s+$/g,"");if($!==""){var y=$.toLowerCase();if(y==="dashed")M.dashed=!0;else if(y==="dotted")M.dotted=!0;else if(y==="bold")M.bold=!0;else if(y==="hidden")M.hidden=!0;else{if(y==="plain"||y==="single"||y==="norank"||y==="node"||y.indexOf("thickness=")===0)continue;M.color=$.charAt(0)==="#"?$:"#"+$}}}return M}function lr(g){g=g.replace(/\.\s*$/,"").replace(/\s*<<[^>]*>>\s*$/,"");var M=g.match(/^(then\s+)?\[([^\]]+)\](?:\s+as\s+\[([^\]]+)\])?(?:\s+<<[^>]*>>)?(?:\s+on\s+((?:\{[^}]+\}\s*)+))?\s+(\S.*)$/i);if(M==null)return null;var _=[];if(M[4])for(var C=/\{([^}:]+)(?::\s*(\d+)%?)?\}/g,$;($=C.exec(M[4]))!==null;)_.push({name:$[1].replace(/^\s+|\s+$/g,""),pct:$[2]?parseInt($[2],10):100});for(var y=M[5].split(/\s+and\s+(?=(?:lasts|requires|starts|ends|happens|is|pauses|displays|links)\b)/i),A=[],s=0;s<y.length;s++){var k=J(y[s].replace(/^\s+|\s+$/g,""));k!=null&&A.push(k)}return{then:M[1]!=null,name:M[2],alias:M[3]||null,resource:_.length>0?_[0].name:null,resources:_,clauses:A}}var Y=new RegExp("^"+Ar+"$"),Cr={january:"01",february:"02",march:"03",april:"04",may:"05",june:"06",july:"07",august:"08",september:"09",october:"10",november:"11",december:"12"};function V(g){if(g=g.replace(/^(?:at|on|the)\s+/i,"").replace(/\.\s*$/,""),Y.test(g))return Z(g);var M=g.match(/^(\d+)(?:st|nd|rd|th)\s+of\s+([A-Za-z]+)\s+(\d{4})$/i);return M!=null&&Cr.hasOwnProperty(M[2].toLowerCase())?M[3]+"-"+Cr[M[2].toLowerCase()]+"-"+(M[1].length<2?"0"+M[1]:M[1]):null}function U(g){g=g.replace(/^\s+|\s+$/g,"");var M=V(g);if(M)return{date:M};var _=g.match(/^([dDtTeE])([-+])(\d+)$/);return _?{anchor:_[1].toUpperCase(),offset:parseInt(_[2]+_[3],10)}:null}function H(g){var M;if((M=g.match(/^(.+?)\s+to\s+(.+)$/i))!=null){var _=U(M[1]),C=U(M[2]);if(_&&C)return{from:_,to:C}}if((M=g.match(/^(.+?)\s+and\s+(\d+)\s+days?$/i))!=null){var $=U(M[1]);if($)return{from:$,to:{days:parseInt(M[2],10)}}}if((M=g.match(/^then\s+(\d+)\s+days?$/i))!=null)return{from:{afterPrev:!0},to:{days:parseInt(M[1],10)}};var y=U(g);return y?{from:y,to:y}:null}function J(g){var M;if((M=g.match(/^(?:lasts|requires)\s+(\d+)\s+(days?|weeks?|hours?)(?:\s+(?:and\s+)?(\d+)\s+(?:hours?|minutes?))?$/i))!=null){var _=parseInt(M[1],10),C=/week/i.test(M[2])?_*7:/hour/i.test(M[2])?Math.ceil(_/24):_;return M[3]!=null&&(C+=Math.ceil(parseInt(M[3],10)/24)),{kind:"duration",days:Math.max(1,C)}}if((M=g.match(/^(starts|ends|happens)\s+(.+)$/i))!=null){var $=M[1].toLowerCase(),y=M[2].replace(/^(?:at|on|the)\s+/i,"").replace(/^(\d{4}[-/]\d{2}[-/]\d{2})\s+\d{1,2}:\d{2}(?::\d{2})?$/,"$1"),A;return Y.test(y)?{kind:$,date:Z(y)}:(A=y.match(/^(\d+)(?:st|nd|rd|th)\s+of\s+([A-Za-z]+)\s+(\d{4})$/i))!=null&&Cr.hasOwnProperty(A[2].toLowerCase())?{kind:$,date:A[3]+"-"+Cr[A[2].toLowerCase()]+"-"+(A[1].length<2?"0"+A[1]:A[1])}:(A=y.match(/^(\d+)\s+days?\s+after\s+start$/i))!=null?{kind:$,offset:parseInt(A[1],10)}:(A=y.match(/^D\+(\d+)$/i))!=null?{kind:$,offset:parseInt(A[1],10)}:(A=y.match(/^\[([^\]]+)\]'s\s+(start|end)$/i))!=null?{kind:$,ref:A[1],refEnd:A[2].toLowerCase()==="end"}:(A=y.match(/^(?:(\d+)\s+(working\s+)?days?\s+)?after\s+\[([^\]]+)\]'s\s+end$/i))!=null?{kind:$,ref:A[3],refEnd:!0,offset:A[1]!=null?parseInt(A[1],10):0,working:A[2]!=null}:null}return(M=g.match(/^is\s+(\d+)%\s+completed?$/i))!=null?{kind:"progress",value:parseInt(M[1],10)}:(M=g.match(/^is\s+colou?red\s+in\s+(\S+(?:\/\S+)?)$/i))!=null?{kind:"color",value:M[1]}:/^(?:pauses\b|displays\s+on\s+same\s+row\b|links\s+to\b|is\s+deleted$)/i.test(g)?{kind:"ignore"}:null}function gr(g,M){switch(M.kind){case"duration":g.duration=M.days;break;case"progress":g.progress=M.value;break;case"color":g.color=M.value;break;case"happens":g.isMilestone=!0,g.duration=0;case"starts":M.date!=null?g.start=M.date:M.ref!=null&&M.refEnd?(g.after=M.ref,g.afterOffset=M.offset||0,g.afterWorking=!!M.working):M.ref!=null?g.alignStart=M.ref:M.offset!=null&&(g.startOffset=M.offset);break;case"ends":M.date!=null?g.end=M.date:M.ref!=null&&M.refEnd?g.endAlign=M.ref:M.ref!=null?g.alignEnd=M.ref:M.offset!=null&&(g.endOffset=M.offset);break;default:break}}function X(g,M){M=M||{};var _=g.split(/\r\n|\r|\n/),C=null,$=null,y=1,A=[],s=[],k=null,o=null,a=[],t={},n=null,v=null;function R(_o){_o=Z(_o),(v==null||_o<v)&&(v=_o)}for(var Q={title:null,header:null,footer:null,caption:null,legend:null},L=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(g)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(g),B=0;B<_.length;B++){var w=_[B].replace(/^\s+|\s+$/g,"");if(w!==""&&w.charAt(0)!=="'"&&w.charAt(0)!=="!"){var ar=w.match(/^project\s+starts\s+(.+)$/i);if(ar){var sr=V(ar[1]);sr!=null&&(C=sr);continue}var ir=w.match(/^it\s+is\s+(\d+)%\s+complete\.?$/i);if(ir&&n!=null&&t.hasOwnProperty(n)){a[t[n]].progress=parseInt(ir[1],10);continue}if(!/^(?:it\s+is\b|\{[^}]+\}\s+is\s+|from\s+\d{1,2}:\d{2}\s+to\s+\d{1,2}:\d{2})/i.test(w)){var _r=w.match(/^(?:printscale|ganttscale|projectscale|project\s+scale)\s+(daily|weekly|monthly|quarterly|yearly)\b(?:\s+zoom\s+(\d+(?:\.\d+)?))?/i);if(_r){$=_r[1].toLowerCase(),_r[2]&&(y=parseFloat(_r[2]));continue}if(!/^(printscale|ganttscale|project\s+scale)\b/i.test(w)){var Sr=w.match(/^(monday|tuesday|wednesday|thursday|friday|saturday|sunday)s?\s+(?:are|is)\s+closed?\b/i);if(Sr){A.push(Sr[1].toLowerCase());continue}if(!/^separator\b/i.test(w)){if(/^note\b/i.test(w)&&!/:/.test(w)){Eo.droppedNote(M,"gantt","note",B,_[B]);var ae=Eo.blockEnd(_,B,/^\s*end\s*note\b/i);ae>=0&&(B=ae);continue}if(/^<style\b/i.test(w)&&!/<\/style\s*>/i.test(w)){for(;B+1<_.length&&!/<\/style\s*>/i.test(_[B+1]);)B++;B++;continue}if(/^(hide|show)\b/i.test(w)){Eo.ignoredDirective(M,"gantt",B,_[B]);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(w)){var se=Ua.take(Q,_,B);if(se>=0){B=se;continue}}if(!/^(language|title|header|footer|caption|legend|end\s*legend|scale|skinparam)\b/i.test(w)){var re=w.match(/^--+\s*(.*?)\s*(?:--+)?\s*$/);if(re){var Ur=Mr(re[1]||"",null);Ur.isSeparator=!0,a.push(Ur);continue}var oe=w.match(/^today\s+is\s+(.+)$/i);if(oe){var Ce=oe[1].split(/\s+and\s+(?:is\s+)?/i),Me=Ce[0].match(/^(\d+)\s+days?\s+after\s+start$/i),eo=Me?null:V(Ce[0]);Me?k={offset:parseInt(Me[1],10)}:eo&&(k={date:eo});for(var Hr=1;Hr<Ce.length;Hr++){var Ne=Ce[Hr].match(/^colou?red\s+in\s+(#?\w+)/i);Ne&&(o=Ne[1])}continue}var He=w.match(/^(.+?)\s+(?:is|are)\s+((?:colou?red\s+in|named\s+\[|closed?|opene?d?)\b.*)$/i);if(He&&w.charAt(0)!=="["){var Kr=H(He[1]);if(Kr){for(var Ue={from:Kr.from,to:Kr.to,color:null,name:null,closed:null},O=He[2].split(/\s+and\s+(?:is\s+|are\s+)?/i),T=0;T<O.length;T++){var N=O[T],D;(D=N.match(/^colou?red\s+in\s+(#?\w+)(?:\/(#?\w+))?/i))!=null?Ue.color=D[1]:(D=N.match(/^named\s+\[([^\]]+)\]/i))!=null?Ue.name=D[1]:/^closed?\b/i.test(N)?Ue.closed=!0:/^opene?d?\b/i.test(N)&&(Ue.closed=!1)}Ue.from.date&&R(Ue.from.date),Ue.to.date&&R(Ue.to.date),s.push(Ue);continue}}if(!/^(today|close)\b/i.test(w)&&!new RegExp("^"+Ar+"\\s+(?:to\\s+"+Ar+"\\s+)?(?:is|are)\\s+","i").test(w)){var K=w.match(fe),P=K!=null;if(K==null&&(K=w.match(Wr)),K!=null){for(var u=[K[1],K[3]],m=[],G=0;G<2&&m.length===G;G++){var I=u[G];t.hasOwnProperty(I)?m.push(t[I]):P?(t[I]=a.length,a.push(Mr(I,null)),m.push(t[I]),n=I):Eo.unknownReference(M,"gantt","task",I,B,_[B])}if(m.length===2){var er=Nr(K[2]);er.ref=u[0],a[m[1]].predecessors.push(er)}continue}var z=lr(w);if(z){var hr=z.alias||z.name,mr;t.hasOwnProperty(hr)?mr=t[hr]:(mr=a.length,a.push(Mr(z.name,z.alias))),t[hr]=mr,z.alias&&(t[z.name]=mr);var ne=a[mr];z.alias&&(ne.alias=z.alias),z.resource&&(ne.resource=z.resource),z.resources.length>0&&(ne.resources=z.resources);for(var ye=0;ye<z.clauses.length;ye++)gr(ne,z.clauses[ye]);z.then&&n&&!ne.after&&!ne.start&&ne.startOffset==null&&!ne.alignStart&&(ne.after=n),n=hr;continue}Eo.droppedLine(M,"gantt",B,_[B])}}}}}}}for(var Je=0;Je<a.length;Je++)a[Je].start&&R(a[Je].start),a[Je].end&&R(a[Je].end);return C==null&&v!=null&&(C=v),Ua.merge({projectStart:C,printScale:$,zoom:y,closedWeekdays:A,periods:s,today:k,todayColor:o,tasks:a,monochrome:L},Q)}return{parse:X}})();var gc=(function(){function Ar(Z,Mr){Mr=Mr||{};var Yr=Z.split(/\r\n|\r|\n/),fe=[],Wr={title:null,header:null,footer:null,caption:null,legend:null},Nr={},lr=0,Y=-1,Cr=[],V=[],U=/^skinparam\s+monochrome\s+(true|on|yes)\s*$/im.test(Z)||/^skinparam\s*\{[^}]*\bmonochrome\s+(true|on|yes)/im.test(Z),H=[],J={},gr=[],X=null,g="automatic",M="decimal",_=null;function C(Ne){H.indexOf(Ne)<0&&H.push(Ne)}function $(Ne){var He=Ne.match(/^:([^\s+\-]+)([+\-][.\d]+)?$/);if(He)return J.hasOwnProperty(He[1])?J[He[1]]+(He[2]?parseFloat(He[2]):0):null;var Kr=Ne.match(/^(\d+)\/(\d+)\/(\d+)$/);if(Kr)return M==="decimal"&&(M="date"),Date.UTC(parseInt(Kr[1],10),parseInt(Kr[2],10)-1,parseInt(Kr[3],10))/1e3;var Ue=Ne.match(/^(\d+):(\d+):(\d+)$/);return Ue?(M==="decimal"&&(M="hour"),parseInt(Ue[1],10)*3600+parseInt(Ue[2],10)*60+parseInt(Ue[3],10)):/^[+\-]?\d+(?:\.\d+)?$/.test(Ne)?Ne.charAt(0)==="+"?lr+parseFloat(Ne):parseFloat(Ne):null}function y(Ne,He){var Kr=He.replace(/^\s+|\s+$/g,"").replace(/\s*:\s*[^:]*$/,""),Ue=/^\{hidden\}$/i.test(Kr);return(Ue||Kr==='""')&&(Kr=""),{time:Ne,state:Kr,hidden:Ue}}for(var A=0;A<Yr.length;A++){var s=Yr[A].replace(/^\s+|\s+$/g,"");if(s!==""&&s.charAt(0)!=="'"&&s.charAt(0)!=="!"){if(/^skinparam\b/i.test(s)){if(/\{\s*$/.test(s))for(var k=1;k>0&&A+1<Yr.length;){A++;var o=Yr[A].replace(/^\s+|\s+$/g,"");o.indexOf("{")>=0&&k++,o.indexOf("}")>=0&&k--}continue}var a=s.match(/^scale\s+(\d+)\s*(?:[smhdDyY])?\s+as\s+(\d+)\s+pixels?\s*$/i);if(a){X={tick:parseInt(a[1],10),pixel:parseInt(a[2],10)};continue}var t=s.match(/^(hide|manual)\s+time.?axis\s*$/i);if(t){g=t[1].toLowerCase()==="hide"?"hidden":"manual";continue}var n=s.match(/^use\s*date\s*format\s*"([^"]+)"\s*$/i);if(n){_=n[1];continue}if(/^(hide|show)\b/i.test(s)){Eo.ignoredDirective(Mr,"timing",A,Yr[A]);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(s)){var v=Ua.take(Wr,Yr,A);if(v>=0){A=v;continue}}if(!/^(title|header|footer|caption|scale)\b/i.test(s)){var R=s.match(/^([A-Za-z_][\w.]*)(?:@(\S+))?\s*-+(?:\[[^\]]*\])?>\s*([A-Za-z_][\w.]*)(?:@(\S+))?\s*(?::\s*(.*))?$/);if(R&&Nr.hasOwnProperty(R[1])&&Nr.hasOwnProperty(R[3])){var Q=R[2]!=null?$(R[2]):lr,L=R[4]!=null?$(R[4]):lr;Q!=null&&L!=null&&gr.push({from:Nr[R[1]],fromTime:Q,to:Nr[R[3]],toTime:L,label:R[5]?R[5].replace(/^\s+|\s+$/g,""):""});continue}var B=s.match(/^(?:compact\s+)?(robust|concise|rectangle|analog|binary|clock)\s+(?:"([^"]+)"|([^\s"]+))(?:\s+<<[^>]*>>)?(?:\s+(?:from|between)\s+(\S+)\s+(?:to|and)\s+(\S+))?(?:\s+as\s+(\S+))?(?:\s+<<[^>]*>>)?(?:\s+with\s+period\s+(\d+))?(?:\s+pulse\s+(\d+))?(?:\s+offset\s+(\d+))?\s*$/i);if(B){var w=B[1].toLowerCase(),ar=B[2]!=null?B[2]:B[3],sr=B[6]||ar,ir={name:ar,alias:sr,kind:w==="analog"?"robust":w,transitions:[]};w==="analog"&&(ir.analog=!0),w==="clock"&&(ir.period=B[7]?parseInt(B[7],10):100),Nr[sr]=fe.length,Nr[ar]=fe.length,fe.push(ir);continue}if(!/^\S+\s+has\s+\S/i.test(s)){var _r=s.match(/^highlight\s+([+\-]?\d+)\s+to\s+([+\-]?\d+)(?:\s+(#\S+))?(?:\s*:\s*(.+))?$/i);if(_r){V.push({from:parseInt(_r[1],10),to:parseInt(_r[2],10),color:_r[3]||null,label:_r[4]?_r[4].replace(/^\s+|\s+$/g,""):null});continue}var Sr=s.match(/^@([+\-]?\d+)\s*<->\s*@([+\-]?\d+)\s*:\s*(.+)$/);if(Sr){var ae=parseInt(Sr[1],10),se=Sr[2],re;se.charAt(0)==="+"||se.charAt(0)==="-"?re=ae+parseInt(se,10):re=parseInt(se,10),Cr.push({from:ae,to:re,label:Sr[3].replace(/^\s+|\s+$/g,"")});continue}var Ur=s.match(/^@([A-Za-z_][\w]*)\s*$/);if(Ur&&Nr.hasOwnProperty(Ur[1])){Y=Nr[Ur[1]];continue}var oe=s.match(/^@(:?[+\-]?[\w.\/:]+(?:[+\-][.\d]+)?)(?:\s+as\s+:(\S+))?\s*$/);if(oe&&$(oe[1])!=null){lr=$(oe[1]),C(lr),oe[2]&&(J[oe[2]]=lr);continue}var Ce=s.match(/^([+\-]?\d+(?:\.\d+)?)\s+is\s+(.+)$/i);if(Ce&&Y>=0){var Me=Ce[1];Me.charAt(0)==="+"||Me.charAt(0)==="-"?lr+=parseFloat(Me):lr=parseFloat(Me),C(lr),fe[Y].transitions.push(y(lr,Ce[2]));continue}var eo=s.match(/^(\S+)\s+is\s+(.+)$/i);if(eo){var Hr=eo[1];Nr.hasOwnProperty(Hr)&&fe[Nr[Hr]].transitions.push(y(lr,eo[2]));continue}Eo.droppedLine(Mr,"timing",A,Yr[A])}}}}return Ua.merge({signals:fe,constraints:Cr,highlights:V,messages:gr,timeMarks:H,codes:J,scale:X,timeAxis:g,timeFormat:M,dateFormat:_,monochrome:U},Wr)}return{parse:Ar}})();var ed=(function(){var Ar=1e3,Z=/^(?:(?:title|scale|hide|skin|skinparam)\s|!)/;function Mr(lr){return String(lr??"").replace(/^\s+|\s+$/g,"")}function Yr(lr,Y,Cr){Y==="__proto__"?Object.defineProperty(lr,Y,{value:Cr,enumerable:!0,writable:!0,configurable:!0}):lr[Y]=Cr}function fe(lr){for(var Y=Mr(lr).replace(/\s*<<.*>>\s*$/,""),Cr=Y.split(/\s*\/\s*/),V=[],U=0;U<Cr.length;U++){var H=Mr(Cr[U]);H.length>=2&&H.charAt(0)==='"'&&H.charAt(H.length-1)==='"'&&(H=H.substring(1,H.length-1)),H!==""&&V.push(H)}return V.length>0?V.join("/"):null}function Wr(lr){var Y=0,Cr=lr.length,V=0;function U(a){var t=new Error(a);throw t.jsonSyntax=!0,t.offset=Y,t}function H(){if(Y>=Cr)return" but the input ends there";var a=lr.indexOf(`
+`,Y),t=Mr(lr.substring(Y,a<0?Cr:a));return t.length>24&&(t=t.substring(0,23)+"\u2026"),' at "'+t+'"'}function J(){for(var a=Y-1;a>=0&&/\s/.test(lr.charAt(a));)a--;return a>=0&&lr.charAt(a)===","}function gr(a){return a>="0"&&a<="9"}function X(){for(;Y<Cr;){var a=lr.charAt(Y);if(a!==" "&&a!==" "&&a!==`
+`&&a!=="\r")break;Y++}}function g(){if(lr.charAt(Y)==="/"){for(lr.charAt(Y+1)!=="/"&&(Y++,U('expected "//" (line comments are the only comment form)'+H()));Y<Cr&&lr.charAt(Y)!==`
+`&&lr.charAt(Y)!=="\r";)Y++;X()}}function M(){var a=lr.charAt(Y);switch(a){case"{":return s();case"[":return A();case'"':return $();case"t":return _("true",!0);case"f":return _("false",!1);case"n":return _("null",null)}if(a==="-"||gr(a))return C();var t="";a==="/"?t=': a "//" comment is only allowed inside an object, before a key or after a value':a==="'"?t=": strings take double quotes":(a==="]"||a==="}")&&J()?t=": no trailing comma is allowed":/^[A-Za-z]$/.test(a)&&(t=": true, false and null are the only bare words"),U("expected a JSON value"+H()+t)}function _(a,t){return lr.substr(Y,a.length)!==a&&U('expected "'+a+'"'+H()),Y+=a.length,t}function C(){var a=Y;lr.charAt(Y)==="-"&&Y++;var t=lr.charAt(Y);if(gr(t)||U("expected a digit"+H()+(t==="."?': a number cannot start with "."':"")),Y++,t==="0")gr(lr.charAt(Y))&&U("a number cannot have a leading zero"+H());else for(;gr(lr.charAt(Y));)Y++;if(lr.charAt(Y)===".")for(Y++,gr(lr.charAt(Y))||U("expected a digit after the decimal point"+H());gr(lr.charAt(Y));)Y++;var n=lr.charAt(Y);if(n==="e"||n==="E")for(Y++,(lr.charAt(Y)==="+"||lr.charAt(Y)==="-")&&Y++,gr(lr.charAt(Y))||U("expected a digit in the exponent"+H());gr(lr.charAt(Y));)Y++;return Number(lr.substring(a,Y))}function $(){Y++;for(var a="",t=Y;Y<Cr;){var n=lr.charAt(Y);if(n==='"')return a+=lr.substring(t,Y),Y++,a;if(n==="\\"){a+=lr.substring(t,Y),a+=y(),t=Y;continue}n.charCodeAt(0)<32&&U(n===`
+`||n==="\r"?"a string is not closed before the end of its line (a string cannot contain a line break)":"a control character (U+00"+(n.charCodeAt(0)<16?"0":"")+n.charCodeAt(0).toString(16).toUpperCase()+") is not allowed inside a string; escape it"),Y++}U("a string is not closed before the end of the input")}function y(){Y++,Y>=Cr&&U("a string is not closed before the end of the input");var a=lr.charAt(Y);switch(a){case'"':case"/":case"\\":return Y++,a;case"b":return Y++,"\b";case"f":return Y++,"\f";case"n":return Y++,`
+`;case"r":return Y++,"\r";case"t":return Y++," ";case"u":var t=lr.substr(Y+1,4);if(!/^[0-9A-Fa-f]{4}$/.test(t)){for(Y++;/^[0-9A-Fa-f]$/.test(lr.charAt(Y));)Y++;U('expected four hexadecimal digits after "\\u"'+H())}return Y+=5,String.fromCharCode(parseInt(t,16))}U('"\\'+a+'" is not a valid escape sequence'+H()+' (only \\" \\\\ \\/ \\b \\f \\n \\r \\t and \\uXXXX are)')}function A(){var a=[];if(Y++,++V>Ar&&U("nesting deeper than "+Ar+" levels"),X(),lr.charAt(Y)==="]")return Y++,V--,a;do X(),a.push(M()),X();while(k(","));return lr.charAt(Y)!=="]"&&U('expected "," or "]"'+H()+(lr.charAt(Y)==="/"?': a "//" comment is only allowed inside an object':"")),Y++,V--,a}function s(){var a={};if(Y++,++V>Ar&&U("nesting deeper than "+Ar+" levels"),X(),lr.charAt(Y)==="}")return Y++,V--,a;do{if(X(),g(),lr.charAt(Y)!=='"'){var t=lr.charAt(Y);U("expected a double-quoted key"+H()+(t==="}"&&J()?": no trailing comma is allowed":t==="'"?": keys take double quotes":t==="/"?': only one "//" comment fits between two members':""))}var n=$();X(),lr.charAt(Y)!==":"&&U('expected ":" after the key "'+n+'"'+H()),Y++,X(),Yr(a,n,M()),X(),g()}while(k(","));return lr.charAt(Y)!=="}"&&U('expected "," or "}"'+H()),Y++,V--,a}function k(a){return lr.charAt(Y)!==a?!1:(Y++,!0)}X();var o=M();return X(),Y<Cr&&U("unexpected text after the JSON value"+H()+(lr.charAt(Y)==="/"?': a "//" comment is only allowed inside an object':"")),o}function Nr(lr,Y){Y=Y||{};for(var Cr=lr.split(/\r\n|\r|\n/),V=[],U=null,H=[],J=[],gr=!1,X=!1,g=0;g<Cr.length;g++){var M=Cr[g],_=Mr(M);if(_===""){gr&&(H.push(M),J.push(g));continue}if(X=!0,_.charAt(0)!=="'"){if(/^@(end|start)(json|yaml|uml)\b/i.test(_)){if(/^@end/i.test(_))break;continue}if(M.charAt(0)==="#"){var C=M.match(/^#highlight\s+(\S.*)$/);if(C){var $=fe(C[1]);$!=null&&V.push($)}gr=!0;continue}if(!gr){if(/^title\s/i.test(_)){U=_.replace(/^title\s+/i,"");continue}if(Z.test(_)){if(/^skinparam\s/.test(_)&&_.indexOf("{")>=0)for(;g+1<Cr.length&&Mr(Cr[g])!=="}";)g++;continue}gr=!0}H.push(M),J.push(g)}}var y=H.join(`
+`);if(Mr(y)==="")throw Eo.emptyError(Eo.sourceWrapper(Y)||"@startjson",X);var A;try{A=Wr(y)}catch(k){if(k==null||k.jsonSyntax!==!0)throw k;var s=y.substring(0,Math.min(k.offset,y.length)).split(`
+`).length-1;throw s>=J.length&&(s=J.length-1),Eo.syntaxError(Y,"json",J[s],H[s],k.message)}return{data:A,rootPresent:!0,highlights:V,title:U}}return{parse:Nr,parseStrict:Wr,parseHighlight:fe}})();var Rc=(function(){var Ar="EMPTY_LINE",Z="NO_KEY_ONLY_TEXT",Mr="KEY_ONLY",Yr="KEY_AND_VALUE",fe="KEY_AND_FLOW_SEQUENCE",Wr="KEY_AND_BLOCK_STYLE",Nr="KEY_AND_FOLDED_STYLE",lr="PLAIN_ELEMENT_LIST",Y="PLAIN_DASH",Cr=/^(?:title|scale|hide|skin|skinparam)\s/;function V(t){return String(t??"").replace(/^\s+|\s+$/g,"")}function U(t,n,v){n==="__proto__"?Object.defineProperty(t,n,{value:v,enumerable:!0,writable:!0,configurable:!0}):t[n]=v}function H(t){if(t==="")return t;if(t.charAt(0)==="#")return"";for(var n="",v=0;v<t.length;v++){var R=t.charAt(v);if((R==="'"||R==='"')&&(n===""?n=R:R===n&&(n="")),n===""&&v<t.length-1&&R===" "&&t.charAt(v+1)==="#")return t.substring(0,v)}return t}function J(t){for(var n="",v=0;v<t.length;v++){var R=t.charAt(v);if(n!=="")R===n&&(n="");else if(R==='"'||R==="'")n=R;else if(R===":")return v}return-1}function gr(t){for(var n=[],v="",R="",Q=!1,L=0;L<t.length;L++){var B=t.charAt(L);R!==""?B==="\\"?L+1<t.length&&(v+=t.charAt(L+1),L++):B===R?R="":v+=B:!Q&&V(v)===""&&(B==="'"||B==='"')?(R=B,Q=!0,v=""):B===","?(n.push(Q?v:V(v)),v="",Q=!1):B==="\\"?L+1<t.length&&(v+=t.charAt(L+1),L++):v+=B}return n.push(Q?v:V(v)),n}function X(t){if(t==null||t.length<2)return t;var n=t.charAt(0),v=t.charAt(t.length-1);return n==='"'&&v==='"'||n==="'"&&v==="'"?t.substring(1,t.length-1):t}function g(t){var n=0;for(t=t.replace(/\t/g," ");n<t.length&&t.charAt(n)===" ";)n++;var v=H(V(t.substring(n)));if(v==="")return{type:Ar,indent:0,listItem:!1};if(v==="-")return{type:Y,indent:n+1,listItem:!0};var R=v.indexOf("- ")===0;R&&(n+=2,v=v.substring(2));var Q=J(v);if(Q===-1)return{type:R?lr:Z,indent:n,key:null,value:X(v),listItem:R};var L=V(v.substring(0,Q)),B=V(v.substring(Q+1)),w=Yr;if(B==="")w=Mr;else if(B==="|")w=Wr;else if(B===">")w=Nr;else if(B.charAt(0)==="["&&B.charAt(B.length-1)==="]")return{type:fe,indent:n,key:X(L),value:null,values:gr(B.substring(1,B.length-1)),listItem:R};return{type:w,indent:n,key:X(L),value:X(B),listItem:R}}var M="undetermined",_="scalar",C="list",$="map";function y(t){return{type:M,value:null,list:null,keys:null,map:null,at:t||null}}function A(t,n){var v=y(n);return v.type=_,v.value=t,v}function s(t,n){var v=y(n);v.type=C,v.list=[];for(var R=0;R<t.length;R++)v.list.push(A(t[R],n));return v}function k(t,n){var v=[],R=[y(null)],Q=null;function L(N,D){throw Eo.syntaxError(n,"yaml",N!=null?N.index:null,N!=null?N.raw:null,D)}function B(){return R[R.length-1]}function w(N,D){N.type===M?(N.type=C,N.list=[]):N.type!==C&&L(Q,'a "- item" cannot join a node that already holds '+(N.type===$?'"key: value" pairs':"a plain value")),N.list.push(D)}function ar(N,D,K){N.type===M?(N.type=$,N.keys=[],N.map={}):N.type!==$&&L(Q,'"key: value" cannot join a node that is already a list of "- items"'),Object.prototype.hasOwnProperty.call(N.map,D)||N.keys.push(D),U(N.map,D,K)}function sr(){R.pop(),R.length===0&&L(Q,"this line is indented left of the list the document started with, so there is no node for it to join")}function ir(N){if(v.length===0){v.push(N);return}if(N>v[v.length-1]){v.push(N);return}for(;v.length>0&&N<v[v.length-1];)v.pop(),sr(),B().type===C&&sr()}function _r(){if(R.length<2)return!1;var N=R[R.length-2];return N.type===C&&N.list.length>0&&N.list[N.list.length-1]===R[R.length-1]}function Sr(){_r()&&R.pop();var N=y(Q);w(B(),N),R.push(N)}function ae(N,D){ar(B(),N,A(D,Q))}function se(N,D){ar(B(),N,s(D,Q))}function re(N){var D=y(Q);ar(B(),N,D),R.push(D)}function Ur(N){_r()&&R.pop();var D=y(Q);w(B(),D),R.push(D);var K=y(Q);ar(B(),N,K),R.push(K)}function oe(N){_r()&&R.pop(),w(B(),A(N,Q))}function Ce(N,D){_r()&&R.pop();var K=y(Q);w(B(),K),R.push(K),ar(B(),N,A(D,Q))}function Me(N,D){_r()&&R.pop();var K=y(Q);w(B(),K),R.push(K),ar(B(),N,s(D,Q))}function eo(N){for(var D=N+1;D<t.length;D++){var K=g(t[D].raw);if(K.type!==Ar)return K}return null}function Hr(N){for(var D="",K=N+1;K<t.length;K++){var P=g(t[K].raw);if(P.type===Ar){N=K;continue}if(P.type!==Z)break;D+=(D.length>0?" ":"")+P.value,N=K}return{text:D,index:N}}function Ne(N,D){for(var K="",P=N+1;P<t.length;P++){var u=g(t[P].raw);if(u.type!==Z&&u.type!==Ar&&u.indent<=D)break;K+=V(t[P].raw)+`
+`,N=P}return{text:K,index:N}}for(var He=0;He<t.length;He++){Q=t[He];var Kr=g(Q.raw);if(Kr.type!==Ar){if(Kr.type===Z&&L(Q,'this line is plain text \u2014 not "key: value", not a "- item", and there is no bare "key:" right above it for it to continue: '+Eo.excerpt(Q.raw)),Kr.type===Y){Sr();continue}if(ir(Kr.indent),Kr.listItem)Kr.type===Mr?Ur(Kr.key):Kr.type===lr?oe(Kr.value):Kr.type===Yr?Ce(Kr.key,Kr.value):Kr.type===fe?Me(Kr.key,Kr.values):L(Q,'a "|" or ">" block value on a "- key:" item is not supported by PlantUML');else if(Kr.type===Mr){var Ue=eo(He);if(Ue==null||Ue.indent<=Kr.indent)ae(Kr.key,"");else if(Ue.type===Z){var O=Hr(He);ae(Kr.key,O.text),He=O.index}else re(Kr.key)}else if(Kr.type===Yr)ae(Kr.key,Kr.value);else if(Kr.type===Wr){var T=Ne(He,Kr.indent);ae(Kr.key,T.text),He=T.index}else Kr.type===fe?se(Kr.key,Kr.values):L(Q,'the folded block style ">" is not supported by PlantUML; use "|" or a one-line value')}}return R[0]}function o(t,n){function v(L,B){throw Eo.syntaxError(n,"yaml",L!=null?L.index:null,L!=null?L.raw:null,B)}function R(L){for(var B=[],w=0;w<L.list.length;w++){var ar=L.list[w];ar.type===_?B.push(ar.value):ar.type===$?B.push(Q(ar)):ar.type===C?v(ar.at,"a list nested directly inside a list is not supported by PlantUML"):v(ar.at,'this "-" opens a list item that never receives a value')}return B}function Q(L){for(var B={},w=0;w<L.keys.length;w++){var ar=L.keys[w],sr=L.map[ar];sr.type===_?U(B,ar,sr.value):sr.type===$?U(B,ar,Q(sr)):sr.type===C?U(B,ar,R(sr)):v(sr.at,'the key "'+ar+'" never receives a value')}return B}return t.type===_?t.value:t.type===C?R(t):t.type===$?Q(t):null}function a(t,n){n=n||{};for(var v=t.split(/\r\n|\r|\n/),R=[],Q=null,L=[],B=!1,w=!1,ar=0;ar<v.length;ar++){var sr=v[ar],ir=V(sr);if(ir===""){B&&L.push({raw:sr,index:ar});continue}if(w=!0,!(ir.charAt(0)==="'"||ir.charAt(0)==="!")){if(sr.indexOf("#highlight ")===0){var _r=ed.parseHighlight(sr.substring(11));_r!=null&&R.push(_r);continue}if(!B){if(/^title\s/i.test(ir)){Q=ir.replace(/^title\s+/i,"");continue}if(Cr.test(ir)){if(/^skinparam\s/.test(ir)&&ir.indexOf("{")>=0)for(;ar+1<v.length&&V(v[ar])!=="}";)ar++;continue}B=!0}L.push({raw:sr,index:ar})}}var Sr=Eo.sourceWrapper(n)||"@startyaml";if(L.length===0)throw Eo.emptyError(Sr,w);var ae=o(k(L,n),n);if(ae==null)throw Eo.emptyError(Sr,!0);return{data:ae,rootPresent:!0,highlights:R,title:Q}}return{parse:a}})();var Ac=(function(){function Ar(o){return o.replace(/^\s+|\s+$/g,"")}function Z(o,a){a=a||{};for(var t=o.split(/\r\n|\r|\n/),n=[],v=!1,R=!1,Q=0,L={title:null,header:null,footer:null,caption:null,legend:null},B=0;B<t.length;B++){var w=Ar(t[B]);if(v){/^<\/style>/i.test(w)&&(v=!1);continue}if(R){w==="}"&&(R=!1);continue}if(Q>0){w.indexOf("{")>=0&&Q++,w.indexOf("}")>=0&&Q--;continue}if(!(w===""||w.charAt(0)==="'"||w.charAt(0)==="!")){if(/^<style\b/i.test(w)){/<\/style>/i.test(w)||(v=!0);continue}if(/^skinparam\b/i.test(w)){/\{\s*$/.test(w)&&(Q=1);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(w)){var ar=Ua.take(L,t,B);if(ar>=0){B=ar;continue}}if(!/^(title|header|footer|caption|scale|hide\s+stereotype)\b/i.test(w)){if(/^sprite\s+\$/.test(w)){/\}\s*$/.test(w)||(R=!0);continue}n.push(w)}}}var sr={tokens:Yr(n),pos:0},ir=null;return sr.tokens.length>0&&(sr.tokens[0].s.charAt(0)==="{"?ir=gr(sr).el:ir=M(sr," ",null,!0).el),Ua.merge({root:ir},L)}var Mr=/\{(?:[-+^#!*\/]|S-|SI|S)?/g;function Yr(o){var a=[];function t(Sr,ae){Sr=Ar(Sr),Sr.length>0&&a.push({s:Sr,t:ae})}for(var n=0;n<o.length;n++){for(var v=o[n].split(/([|}])/),R=[],Q=0;Q<v.length;Q++)v[Q]!==""&&R.push(v[Q]);for(var L=0;L<R.length;L++){var B=R[L];if(B!=="|"){var w=L<R.length-1?"col":"line";Mr.lastIndex=0;var ar=Mr.exec(B);if(!ar){t(B,w);continue}var sr=0,ir=0;do{var _r=ar.index;_r>sr&&t(B.substring(sr,_r),"col"),ir=_r+ar[0].length,t(B.substring(_r,ir),ir===B.length?w:"col"),sr=ir,ar=Mr.exec(B)}while(ar);ir<B.length&&t(B.substring(ir),w)}}}return a}function fe(o,a){var t=o.tokens[o.pos+a];return t?t.s:""}function Wr(o){var a=o.tokens[o.pos];return o.pos++,a||{s:"",t:"line"}}function Nr(o){return o.pos>=o.tokens.length}function lr(o){return" +^-!#".indexOf(o)>=0?o:null}function Y(o){return Ar(o.replace(/<\/?[^>]*>/g,""))}function Cr(o){return o.replace(/<&[-\w]+>/g,"00").replace(/<\/?[^>]*>/g,"").length}function V(o){return/<b>/i.test(o)}function U(o){return{type:"text",text:o,display:Y(o),bold:V(o),show:o!=="."}}function H(o){return o.length>=2&&/^(--|==|~~|\.\.)/.test(o)&&o.substring(o.length-2)===o.substring(0,2)}function J(o,a){return{el:a,t:o.t}}function gr(o){var a=fe(o,0),t=fe(o,1),n=a.charAt(a.length-1);if(a==="{*")return A(o);if(a==="{"&&(t==="T"||t.length===2&&t.charAt(0)==="T"&&lr(t.charAt(1))!=null))return k(o);if(a==="{/")return s(o);if(H(a))return J(Wr(o),{type:"line",ch:a.charAt(0)});if(a.length>=2&&a.charAt(0)==='"'&&n==='"'){var v=a.substring(1,a.length-1);return J(Wr(o),{type:"textfield",text:Y(v),bold:V(v),charLength:Cr(v)})}if(/^\[X\]/.test(a))return J(Wr(o),{type:"check",text:Y(a.substring(3)),bold:V(a),radio:!1,checked:!0});if(/^\[\]|^\[ \]/.test(a))return J(Wr(o),{type:"check",text:Y(a.substring(a.indexOf("]")+1)),bold:V(a),radio:!1,checked:!1});if(a.length>=2&&a.charAt(0)==="["&&n==="]"){var R=a.substring(1,a.length-1);return J(Wr(o),{type:"button",text:Y(R),bold:V(R),charLength:Cr(R)})}if(a.length>=2&&a.charAt(0)==="^"&&n==="^"){for(var Q=a.substring(1,a.length-1).split("^"),L=[],B=1;B<Q.length;B++)Q[B]!==""&&L.push(Y(Q[B]));return J(Wr(o),{type:"droplist",text:Y(Q[0]),bold:V(Q[0]),charLength:Cr(Q[0]),open:L})}if(/^\(X\)/.test(a))return J(Wr(o),{type:"check",text:Y(a.substring(3)),bold:V(a),radio:!0,checked:!0});if(/^\(\)|^\( \)/.test(a))return J(Wr(o),{type:"check",text:Y(a.substring(a.indexOf(")")+1)),bold:V(a),radio:!0,checked:!1});if(a==="<<"||/^<<\w+$/.test(a))return $(o);if(/^<<\w+>>$/.test(a)){var w=a.substring(2,a.length-2),ar=o.images&&o.images[w];return J(Wr(o),ar?{type:"image",rows:ar.rows}:{type:"empty"})}if(a.charAt(0)!=="{"&&a.charAt(0)!=="}"&&a.length>0)return J(Wr(o),U(a));if(/^\{[+^#!\-]?$/.test(a)&&!/^(?:[NSEW]=|T)$/.test(t))return _(o);if(a==="{S"||a==="{S-"||a==="{SI")return C(o);if(/^\{[+#!\-]?$/.test(a)&&/^[NSEW]=$/.test(t))return y(o);var sr=Wr(o);return{el:U(sr.s),t:sr.t}}function X(){var o={row:0,col:0,maxRow:0,maxCol:0,cells:[],last:null};return o.updateMax=function(){o.row>o.maxRow&&(o.maxRow=o.row),o.col>o.maxCol&&(o.maxCol=o.col)},o.move=function(a){a==="col"?o.col++:(o.row++,o.col=0)},o.add=function(a,t){o.last={el:a,minRow:o.row,maxRow:o.row,minCol:o.col,maxCol:o.col},o.cells.push(o.last),o.updateMax(),o.move(t)},o.mergeLeft=function(a){o.updateMax(),o.move(a),o.last&&o.last.maxCol++},o}function g(o,a,t,n){return{type:"pyramid",strategy:a,title:t,rows:o.maxRow+1,cols:o.maxCol+1,cells:o.cells,scroll:n||null}}function M(o,a,t,n){for(var v=X();!Nr(o)&&fe(o,0)!=="}";){var R=gr(o);n&&R.el.type==="text"&&R.el.text==="*"?v.mergeLeft(R.t):v.add(R.el,R.t)}var Q=Wr(o);return{el:g(v,a,t,null),t:Q.t}}function _(o){var a=Wr(o),t=a.s.length===2?a.s.charAt(1):" ",n=null;return t==="^"&&a.t==="col"&&(n=Wr(o).s.replace(/^"([^"]*)"$/,"$1")),M(o,t,n,!0)}function C(o){var a=Wr(o),t=a.s==="{S-"?"h":a.s==="{SI"?"v":"both",n=M(o,"+",null,!1);return n.el.scroll=t,n}function $(o){for(var a=Wr(o),t=a.s.length>2?a.s.substring(2):null,n=[];!Nr(o)&&fe(o,0)!==">>";)n.push(Wr(o).s);var v=Wr(o),R={type:"image",rows:n};return t&&(o.images||(o.images={}),o.images[t]=R),{el:R,t:v.t}}function y(o){Wr(o);for(var a={type:"border",north:null,south:null,east:null,west:null,center:null};!Nr(o)&&fe(o,0)!=="}";){var t=Wr(o).s.charAt(0);if(Nr(o)||fe(o,0)==="}")break;var n=gr(o).el;t==="N"?a.north=n:t==="S"?a.south=n:t==="E"?a.east=n:t==="W"?a.west=n:a.center=n}var v=Wr(o);return{el:a,t:v.t}}function A(o){Wr(o);for(var a=[],t={},n=null;!Nr(o)&&fe(o,0)!=="}";){var v=Wr(o);n===null?a.push(v.s):n===""?n=v.s:(t.hasOwnProperty(n)||(t[n]=[]),t[n].push(v.s)),v.t==="line"&&(n="")}var R=Wr(o);return{el:{type:"menubar",entries:a,popups:t},t:R.t}}function s(o){Wr(o);for(var a=[],t=!1;!Nr(o)&&fe(o,0)!=="}";){var n=Wr(o);a.push({text:Y(n.s),bold:V(n.s)}),n.t==="line"&&(t=!0)}var v=Wr(o);return{el:{type:"tabbar",tabs:a,vertical:t},t:v.t}}function k(o){Wr(o);for(var a=Wr(o).s,t=a.length===2?a.charAt(1):" ",n=[],v=!0;!Nr(o)&&fe(o,0)!=="}";){var R=Wr(o);if(v){for(var Q=0,L=R.s;L.charAt(0)==="+";)Q++,L=L.substring(1);n.push({level:Q,text:Y(L),bold:V(L),cells:[]})}else n.length>0&&n[n.length-1].cells.push({text:Y(R.s),bold:V(R.s)});v=R.t==="line"}var B=Wr(o);return{el:{type:"tree",strategy:t,entries:n},t:B.t}}return{parse:Z,tokenize:Yr}})();var mc=(function(){function Ar(Z,Mr){Mr=Mr||{};var Yr=Z.split(/\r\n|\r|\n/),fe=[],Wr={title:null,header:null,footer:null,caption:null,legend:null},Nr=[],lr=[],Y=[],Cr=null,V=null,U=!1,H=0;function J(Q){for(var L={address:null,description:null,shape:null,color:null},B=Q.split(/\s*,\s*/),w=0;w<B.length;w++){var ar=B[w].match(/(\w+)\s*=\s*"?([^"\]]*)"?\s*$/);if(ar){var sr=ar[1].toLowerCase(),ir=ar[2].replace(/^\s+|\s+$/g,"");sr==="address"?L.address=ir:sr==="description"?L.description=ir:sr==="shape"?L.shape=ir.toLowerCase():sr==="color"&&(L.color=ir)}}return L}for(var gr=0;gr<Yr.length;gr++){var X=Yr[gr].replace(/^\s+|\s+$/g,"");if(X!==""&&X.charAt(0)!=="'"&&X.charAt(0)!=="!"&&!/^skinparam\b/i.test(X)){if(/^(hide|show)\b/i.test(X)){Eo.ignoredDirective(Mr,"network",gr,Yr[gr]);continue}if(/^(?:(?:left|right|center|centre)\s+)?(?:title|header|footer|caption|legend)\b/i.test(X)){var g=Ua.take(Wr,Yr,gr);if(g>=0){gr=g;continue}}if(!/^(title|header|footer|caption|scale)\b/i.test(X)){var M=X.match(/^nwdiag\s*\{/i);if(M){U=!0,H++;continue}var _=X.match(/^network(?:\s+(\S+))?\s*\{/i);if(_){Cr={name:_[1]||"",address:null,nodes:[]},fe.push(Cr),H++;continue}var C=X.match(/^group(?:\s+(\S+))?\s*\{/i);if(C&&Cr==null){V={name:C[1]||null,color:null,nodes:[]},Nr.push(V),H++;continue}if(X==="}"){H--,V!=null?V=null:Cr!=null&&H<=(U?1:0)&&(Cr=null),H<=0&&(U=!1,H=0);continue}if(V!=null){var $=X.match(/^color\s*=\s*"([^"]*)"\s*;?\s*$/i);if($){V.color=$[1];continue}var y=X.match(/^description\s*=\s*"([^"]*)"\s*;?\s*$/i);if(y){V.name=y[1];continue}var A=X.match(/^(\w+)\s*;?\s*$/);if(A){V.nodes.push(A[1]);continue}}var s=X.match(/^(\w+)\s*--\s*(\w+)\s*;?\s*$/);if(s&&Cr==null&&U){Y.push({from:s[1],to:s[2]});continue}var k=X.match(/^(\w+)\s*\[([^\]]*)\]\s*;?\s*$/);if(k&&Cr==null&&U){var o=J(k[2]);lr.push({name:k[1],address:o.address,description:o.description,shape:o.shape});continue}var a=X.match(/^(\w+)\s*;?\s*$/);if(a&&Cr==null&&V==null&&U&&!/^(?:address|color|description|shape)$/i.test(a[1])){lr.push({name:a[1],address:null,description:null,shape:null});continue}if(Cr!=null){var t=X.match(/^address\s*=\s*"([^"]*)"$/i);if(t){Cr.address=t[1];continue}var n=X.match(/^(\S+)\s*\[([^\]]*)\]\s*;?\s*$/);if(n){var v=J(n[2]);Cr.nodes.push({name:n[1],address:v.address,description:v.description,shape:v.shape});continue}var R=X.match(/^(\w+)\s*;?\s*$/);if(R&&R[1]!=="address"){Cr.nodes.push({name:R[1],address:null,description:null,shape:null});continue}}Eo.droppedLine(Mr,"network",gr,Yr[gr])}}}return fe.length===0&&lr.length>0&&(fe.push({name:"",address:null,nodes:lr}),lr=[]),Ua.merge({networks:fe,groups:Nr,topNodes:lr,links:Y},Wr)}return{parse:Ar}})();var kc=(function(){for(var Ar=["Motivation","Strategy","Business","Application","Technology","Physical","Implementation","Other","Junction"],Z={},Mr=0;Mr<Ar.length;Mr++)Z[Ar[Mr]]=!0;function Yr(Nr){for(var lr=[],Y="",Cr=!1,V=0;V<Nr.length;V++){var U=Nr[V];U==='"'?(Cr=!Cr,Y+=U):U===","&&!Cr?(lr.push(Y.trim()),Y=""):Y+=U}return Y.trim()!==""&&lr.push(Y.trim()),lr}function fe(Nr){return Nr&&Nr.length>=2&&Nr.charAt(0)==='"'&&Nr.charAt(Nr.length-1)==='"'?Nr.substring(1,Nr.length-1):Nr||""}function Wr(Nr,lr){lr=lr||{};var Y=[],Cr=[],V=[],U=null,H={},J=null,gr={header:null,footer:null,caption:null},X=[],g=String(Nr||"").split(/\r?\n/),M=/^([A-Z][A-Za-z0-9]*)_([A-Za-z][A-Za-z0-9]*)\s*\(\s*([^)]*)\)\s*(\{)?\s*$/,_=/^Rel(?:_[A-Za-z][A-Za-z0-9]*)?\s*\(\s*([^)]*)\)\s*$/,C=/^(Grouping|Group)\s*\(\s*([^)]*)\)\s*\{\s*$/,$=/^title\s+(.+)$/i,y=/^archimate\s+(?:#(\w+)\s+)?(?:"([^"]+)"|([^\s"<\[]+))(?:\s+<<([^>]*)>>)?(?:\s+as\s+(\S+))?(?:\s+<<([^>]*)>>)?(?:\s+#(\w+))?\s*(\[)?\s*$/i,A=/^circle\s+(?:#(\w+)\s+)?(\S+)(?:\s+#(\w+))?\s*$/i,s=/^(frame|rectangle|package|folder|node|cloud|card)\s+(?:"([^"]+)"|([^\s"<\[]+))(?:\s+as\s+(\S+))?((?:\s+<<[^>]*>>)*)(?:\s+#(\w+))?\s*(\{|\[)?\s*$/i,k=/^(\S+)\s+((?:<\|?|\*|o)?[-.]+(?:\[[^\]]*\])?(?:up|down|left|right|u|d|l|r)?[-.]*(?:\|?>|\*|o)?)\s+(\S+)(?:\s*:\s*(.*))?$/,o={motivation:"Motivation",strategy:"Strategy",business:"Business",application:"Application",technology:"Technology",physical:"Physical",implementation:"Implementation"};function a(ra){return ra.split(/[-_\s]+/).filter(Boolean).map(function(Gn){return Gn.charAt(0).toUpperCase()+Gn.substring(1)}).join("")}function t(ra,Gn){var Xe=Gn&&o[Gn.toLowerCase()]||null,f=null;if(ra){var d=ra.toLowerCase().replace(/-filled$/,"").split("-");o[d[0]]&&(Xe==null&&(Xe=o[d[0]]),d.shift()),d.length&&(f=a(d.join("-")))}return{category:Xe||"Other",kind:f||"Element"}}function n(ra){for(var Gn=[],Xe=ra+1;Xe<g.length&&!/^\s*\]\s*$/.test(g[Xe]);)Gn.push(g[Xe].replace(/^\s+|\s+$/g,"")),Xe++;return{text:Gn.join(`
+`),endIdx:Xe}}function v(ra){if(X.length>0){var Gn=X[X.length-1];ra.parent=Gn.id,Gn.children.push(ra.id)}Y.push(ra),H[ra.id]=ra}for(var R=0,Q=!1,L=0;L<g.length;L++){var B=g[L].replace(/^\s+|\s+$/g,"");if(B!==""&&B.charAt(0)!=="'"&&B.charAt(0)!=="!"&&!/^@(start|end)/i.test(B)){if(/^sprite\b/i.test(B)){if(/\{\s*$/.test(B)){for(;L+1<g.length&&!/^\s*\}\s*$/.test(g[L+1]);)L++;L++}continue}if(Q){/<\/style\s*>/i.test(B)&&(Q=!1);continue}if(/^<style\b/i.test(B)){/<\/style\s*>/i.test(B)||(Q=!0);continue}if(R>0){B.indexOf("{")>=0&&R++,B.indexOf("}")>=0&&R--;continue}if(/^skinparam\b/i.test(B)){/\{\s*$/.test(B)&&R++;continue}if(/^(?:hide|show)\b/i.test(B)){Eo.ignoredDirective(lr,"archimate",L,g[L]);continue}if(!/^(?:scale|left\s+to\s+right\s+direction|top\s+to\s+bottom\s+direction)\b/i.test(B)){var w=y.exec(B);if(w!=null){var ar=w[1]||w[7]||null,sr=w[2]!=null?w[2]:w[3],ir=w[5]||sr,_r=t(w[4]||w[6]||null,ar),Sr={id:ir,label:sr.replace(/\\n/g,`
+`),category:_r.category,kind:_r.kind,stereotype:w[4]||w[6]||null,parent:null};if(ar&&!o[ar.toLowerCase()]&&(Sr.color="#"+ar),w[8]==="["){var ae=n(L);Sr.label=ae.text,L=ae.endIdx}v(Sr);continue}var se=A.exec(B);if(se!=null){var re=(se[1]||se[3]||"").toLowerCase();v({id:se[2],label:"",category:"Junction",kind:re==="black"||re==="000000"?"And":"Or",parent:null});continue}var Ur=s.exec(B);if(Ur!=null){var oe=Ur[2]!=null?Ur[2]:Ur[3],Ce=Ur[4]||oe;if(Ur[7]==="{"){var Me={id:Ce,label:oe,kind:"Group",children:[]};V.push(Me),X.push(Me)}else{var eo=(Ur[5]||"").match(/<<([^>$]*)>>/g)||[],Hr=eo.length?eo[eo.length-1].replace(/^<<|>>$/g,""):null,Ne=t(Hr,Ur[6]||null),He={id:Ce,label:oe.replace(/\\n/g,`
+`),category:Ne.category,kind:Hr?Ne.kind:a(Ur[1]),parent:null};if(Ur[6]&&!o[Ur[6].toLowerCase()]&&(He.color="#"+Ur[6]),Ur[7]==="["){var Kr=n(L);He.label=Kr.text,L=Kr.endIdx}v(He)}continue}var Ue=k.exec(B);if(Ue!=null&&/[-.]/.test(Ue[2])&&!/^(?:Rel|Grouping|Group)\b/.test(B)&&Ue[2].indexOf("hidden")<0){var O=Ue[2],T=Ue[1],N=Ue[3];if(/^<\|?/.test(O)&&!/\|?>$/.test(O)){var D=T;T=N,N=D}Cr.push({from:T,to:N,label:Ue[4]?Ue[4].replace(/^\s+|\s+$/g,""):"",kind:"Rel"});continue}var K=B.match(/^legend(?:\s+(left|right|center|top|bottom))?\s*$/i);if(K!=null){for(var P=K[1]||"center",u=[],m=L+1;m<g.length&&!/^endlegend\b/i.test(g[m].replace(/^\s+|\s+$/g,""));){var G=g[m].replace(/^\s+|\s+$/g,"");G!==""&&u.push(G),m++}J={position:P.toLowerCase(),lines:u},L=m;continue}if(!/^endlegend\b/i.test(B)){if(/^note\s+(?:"[^"]*"\s+)?as\s+\S+\s*(?:#[\w:;.]+)?\s*$/i.test(B)){var I=Ua.take(gr,g,L);if(I>=0){L=I;continue}}if(/^(?:(?:left|right|center|centre)\s+)?(?:header|footer|caption)\b/i.test(B)){var er=Ua.take(gr,g,L);if(er>=0){L=er;continue}}var z=$.exec(B);if(z!=null){U=z[1].replace(/^\s+|\s+$/g,"");continue}var hr=C.exec(B);if(hr!=null){var mr=Yr(hr[2]),ne=fe(mr[0]||"").replace(/^\s+|\s+$/g,""),ye=fe(mr[1]||ne),Je={id:ne,label:ye,kind:hr[1],children:[]};V.push(Je),X.push(Je);continue}if(B==="}"){X.length>0&&X.pop();continue}var _o=_.exec(B);if(_o!=null){var Oo=Yr(_o[1]),qe=fe(Oo[0]||"").replace(/^\s+|\s+$/g,""),St=fe(Oo[1]||"").replace(/^\s+|\s+$/g,""),ht=Oo.length>2?fe(Oo[2]):"",nn="Rel",Tt=B.match(/^(Rel(?:_[A-Za-z][A-Za-z0-9]*)?)/);Tt&&(nn=Tt[1]),qe!==""&&St!==""&&Cr.push({from:qe,to:St,label:ht,kind:nn});continue}var Lo=M.exec(B);if(Lo!=null){var Qt=Lo[1],pt=Lo[2];if(!Z[Qt])continue;var So=Yr(Lo[3]),it=fe(So[0]||"").replace(/^\s+|\s+$/g,""),qt=fe(So[1]||it),Pt={id:it,label:qt,category:Qt,kind:pt,parent:null};if(X.length>0){var We=X[X.length-1];Pt.parent=We.id,We.children.push(it)}if(Y.push(Pt),H[it]=Pt,Lo[4]==="{"){var pn={id:it,label:qt,kind:"ShapeContainer",children:[]};V.push(pn),X.push(pn)}continue}Eo.droppedLine(lr,"archimate",L,g[L])}}}}return Ua.merge({title:U,shapes:Y,edges:Cr,groups:V,legend:J},gr)}return{parse:Wr}})();var _c=(function(){var Ar={Person:{category:"Person",variant:"person"},Person_Ext:{category:"Person",variant:"person_ext"},System:{category:"System",variant:"normal"},SystemDb:{category:"System",variant:"db"},SystemQueue:{category:"System",variant:"queue"},System_Ext:{category:"System",variant:"ext"},SystemDb_Ext:{category:"System",variant:"db_ext"},SystemQueue_Ext:{category:"System",variant:"queue_ext"},Container:{category:"Container",variant:"normal"},ContainerDb:{category:"Container",variant:"db"},ContainerQueue:{category:"Container",variant:"queue"},Container_Ext:{category:"Container",variant:"ext"},ContainerDb_Ext:{category:"Container",variant:"db_ext"},ContainerQueue_Ext:{category:"Container",variant:"queue_ext"},Component:{category:"Component",variant:"normal"},ComponentDb:{category:"Component",variant:"db"},ComponentQueue:{category:"Component",variant:"queue"},Component_Ext:{category:"Component",variant:"ext"},ComponentDb_Ext:{category:"Component",variant:"db_ext"},ComponentQueue_Ext:{category:"Component",variant:"queue_ext"}},Z={System_Boundary:!0,Container_Boundary:!0,Enterprise_Boundary:!0,Boundary:!0};function Mr(Wr){for(var Nr=[],lr="",Y=!1,Cr=0;Cr<Wr.length;Cr++){var V=Wr[Cr];V==='"'?(Y=!Y,lr+=V):V===","&&!Y?(Nr.push(lr.trim()),lr=""):lr+=V}return lr.trim()!==""&&Nr.push(lr.trim()),Nr}function Yr(Wr){return Wr&&Wr.length>=2&&Wr.charAt(0)==='"'&&Wr.charAt(Wr.length-1)==='"'?Wr.substring(1,Wr.length-1):Wr||""}function fe(Wr,Nr){Nr=Nr||{};for(var lr=[],Y=[],Cr=[],V=null,U=!1,H=!1,J=null,gr=null,X=null,g=[],M=String(Wr||"").split(/\r?\n/),_=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(\s*([\s\S]*?)\)\s*(\{)?\s*$/,C=/^title\s+(.+)$/i,$=0;$<M.length;$++){var y=M[$].replace(/^\s+|\s+$/g,"");if(y!==""&&y.charAt(0)!=="'"&&y.charAt(0)!=="!"&&!/^@(start|end)/i.test(y)){if(/^skinparam\b/i.test(y)){var A=/^skinparam\s+(nodesep|ranksep)\s+(\d+)/i.exec(y);A?/nodesep/i.test(A[1])?J=parseInt(A[2],10):gr=parseInt(A[2],10):/^skinparam\s+linetype\s+ortho/i.test(y)&&(X="ortho");continue}if(!/^hide\b/i.test(y)&&!/^show\b/i.test(y)){var s=C.exec(y);if(s!=null){V=s[1].replace(/^\s+|\s+$/g,"");continue}if(y==="}"){g.length>0&&g.pop();continue}var k=y.match(/^package\s+(?:"([^"]*)"|(\S+))(?:\s*<<([^>]+)>>)?(\s*\{)?\s*$/i);if(k){var o="c4pkg_"+Cr.length,a=k[1]||k[2]||"",t=k[3]||"",n=!!k[4],v={id:o,label:a,kind:"package",stereotype:t,children:[],parent:g.length>0?g[g.length-1].id:null};Cr.push(v),n&&g.push(v);continue}var R=_.exec(y);if(R!=null){var Q=R[1],L=Mr(R[2]),B=R[3]==="{";if(Q==="LAYOUT_WITH_LEGEND"){U=!0;continue}if(!/^LAYOUT_/.test(Q)){if(Z[Q]){var w=Yr(L[0]||"").replace(/^\s+|\s+$/g,""),ar=Yr(L[1]||w),sr={id:w,label:ar,kind:Q,children:[],parent:g.length>0?g[g.length-1].id:null};Cr.push(sr),B&&g.push(sr);continue}var ir=Ar[Q];if(ir){ir.category==="Component"&&(H=!0);var _r=Yr(L[0]||"").replace(/^\s+|\s+$/g,""),Sr=Yr(L[1]||_r),ae="",se="";L.length>=4?(ae=Yr(L[2]),se=Yr(L[3])):L.length===3&&(se=Yr(L[2]));var re={id:_r,label:Sr,description:se,technology:ae,category:ir.category,variant:ir.variant,parent:g.length>0?g[g.length-1].id:null};if(re.parent){var Ur=g[g.length-1];Ur.children.push(_r)}lr.push(re);continue}if(/^Rel(?:_[A-Za-z][A-Za-z0-9_]*)?$/.test(Q)){var oe=Yr(L[0]||"").replace(/^\s+|\s+$/g,""),Ce=Yr(L[1]||"").replace(/^\s+|\s+$/g,""),Me=L.length>=3?Yr(L[2]):"",eo=L.length>=4?Yr(L[3]):"",Hr=null,Ne=!1,He=Q.substring(3);/^_U/.test(He)||/^_Up/.test(He)?Hr="up":/^_D/.test(He)&&!/^_Down_/.test(He)||/^_Down/.test(He)?Hr="down":/^_L/.test(He)||/^_Left/.test(He)?Hr="left":(/^_R/.test(He)||/^_Right/.test(He))&&(Hr="right"),/_Back/.test(He)&&(Ne=!0),oe!==""&&Ce!==""&&Y.push({from:oe,to:Ce,label:Me,technology:eo,direction:Hr,back:Ne});continue}Eo.droppedLine(Nr,"c4",$,M[$])}}}}}return{title:V,shapes:lr,edges:Y,boundaries:Cr,hasLegend:U,hasComponent:H,nodesep:J,ranksep:gr,linetype:X}}return{parse:fe}})();Ai.registerParser("sequence",ic);Ai.registerParser("state",sc);Ai.registerParser("activity",uc);Ai.registerParser("activityLegacy",fc);Ai.registerParser("class",dc);Ai.registerParser("component",cc);Ai.registerParser("object",hc);Ai.registerParser("useCase",vc);Ai.registerParser("mindmap",Cc);Ai.registerParser("wbs",pc);Ai.registerParser("gantt",$c);Ai.registerParser("timing",gc);Ai.registerParser("json",ed);Ai.registerParser("yaml",Rc);Ai.registerParser("salt",Ac);Ai.registerParser("network",mc);Ai.registerParser("archimate",kc);Ai.registerParser("c4",_c);var wC=ih;return GC(PC);})();
PlantUml=PlantUml.default;globalThis.mxPlantUmlToDrawio=PlantUml.mxPlantUmlToDrawio;
diff --git a/src/main/webapp/js/viewer-static.min.js b/src/main/webapp/js/viewer-static.min.js
index 1d7b39cb0..31fc44a28 100644
--- a/src/main/webapp/js/viewer-static.min.js
+++ b/src/main/webapp/js/viewer-static.min.js
@@ -25,13 +25,13 @@ if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap
lang.substring(0,dash));0<=window.mxLanguages.indexOf(lang)&&(window.mxLanguage=lang)}}"1"==urlParams.extAuth&&/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent)&&(urlParams.gapi="0",urlParams.noDevice="1","1"!=urlParams.lightbox&&(urlParams.lightbox="1",urlParams.layers="1",urlParams.viewerOnlyMsg="1"));"viewer.diagrams.net"==window.location.hostname&&(urlParams.lightbox="1");"1"==urlParams.lightbox&&(urlParams.chrome="0");
"1"==urlParams.embedInline&&(urlParams.embed="1",urlParams.ui="sketch",urlParams.plugins="0",urlParams.proto="json",urlParams.prefetchFonts="1",null==urlParams.pv&&(urlParams.pv="0"));function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)}
window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;"1"==urlParams.extAuth&&(a="sketch");if(null==a&&isLocalStorage&&"undefined"!==typeof JSON&&"1"!=urlParams.lightbox)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}"dark"==urlParams.ui&&null==urlParams.dark&&(urlParams.dark="1");"sketch"==a&&null==urlParams.sketch&&"ac.draw.io"===window.location.hostname&&(urlParams.sketch="1");return a}();
-(function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams["export"];null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,
-8)&&(a="http://"+a),EXPORT_URL=a);a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,
-b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0";
-"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
+(function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,
+8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");
+if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.ms365="0";
+"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.ms365="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],FORBID_ATTR:["data-icon","data-icon-content"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ALLOW_DATA_ATTR:!1,ADD_ATTR:"target content pointer-events requiredFeatures data-font-src data-action data-title data-message data-link data-effect data-lucid-type data-lucid-content".split(" ")};
window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL="undefined"===typeof window.EXPORT_URL?"/export":window.EXPORT_URL;window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
-window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"31.4.5",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"31.4.6",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),
IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&
0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),
@@ -2175,21 +2175,21 @@ mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+C+'" height="'+C+'" patt
function(y,C){b.apply(this,arguments);if(null!=this.shiftPreview1){var O=this.view.canvas;null!=O.ownerSVGElement&&(O=O.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+y,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+C,F))+"px";O.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(y,C,O){var F=this.view.scale,N=this.view.translate,R=this.pageFormat,c=F*this.pageScale,
f=this.view.getBackgroundPageBounds();C=f.width;O=f.height;var l=new mxRectangle(F*N.x,F*N.y,R.width*c,R.height*c);N=null!=this.view.canvas&&null!=this.view.canvas.getCTM?this.view.canvas.getCTM():null;F=null!=N?N.a:1;c=null!=N?N.e:0;var q=null!=N?N.f:0;N=(y=y&&Math.min(l.width,l.height)*F>this.minPageBreakDist)?Math.ceil(O/l.height)-1:0;R=y?Math.ceil(C/l.width)-1:0;var x=f.x+C,A=f.y+O,E=0,K=N-1,Q=0,V=R-1;this.pageBreakCoverage=null;y&&null!=this.container&&(C=this.container.clientWidth,O=this.container.clientHeight,
c=(this.container.scrollLeft-C-c)/F-f.x,q=(this.container.scrollTop-O-q)/F-f.y,Q=Math.max(0,Math.floor(c/l.width)-1),V=Math.min(R-1,Math.ceil((c+3*C/F)/l.width)),E=Math.max(0,Math.floor(q/l.height)-1),K=Math.min(N-1,Math.ceil((q+3*O/F)/l.height)),0<E||K<N-1||0<Q||V<R-1)&&(this.pageBreakCoverage=new mxRectangle(this.container.scrollLeft-C/2,this.container.scrollTop-O/2,2*C,2*O));null==this.horizontalPageBreaks&&0<N&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<R&&(this.verticalPageBreaks=
-[]);C=mxUtils.bind(this,function(J){if(null!=J){var ia=J==this.horizontalPageBreaks,Y=ia?E:Q,aa=ia?K:V;aa=y&&isFinite(Y)&&isFinite(aa)?Math.max(0,Math.min(this.maxPageBreaks,aa-Y+1)):0;for(var ja=0;ja<aa;ja++){var ka=Y+ja+1;ka=ia?[new mxPoint(Math.round(f.x),Math.round(f.y+ka*l.height)),new mxPoint(Math.round(x),Math.round(f.y+ka*l.height))]:[new mxPoint(Math.round(f.x+ka*l.width),Math.round(f.y)),new mxPoint(Math.round(f.x+ka*l.width),Math.round(A))];null!=J[ja]&&null!=J[ja].node?(J[ja].points=ka,
-J[ja].redraw()):(null!=J[ja]&&J[ja].destroy(),ka=new mxPolyline(ka,this.pageBreakColor),ka.dialect=this.dialect,ka.isDashed=this.pageBreakDashed,ka.pointerEvents=!1,ka.init(this.view.backgroundPane),ka.redraw(),J[ja]=ka)}for(ja=aa;ja<J.length;ja++)null!=J[ja]&&J[ja].destroy();J.splice(aa,J.length-aa)}});C(this.horizontalPageBreaks);C(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(y,C,O){for(var F=0;F<
+[]);C=mxUtils.bind(this,function(J){if(null!=J){var ia=J==this.horizontalPageBreaks,Y=ia?E:Q,aa=ia?K:V;aa=y&&isFinite(Y)&&isFinite(aa)?Math.max(0,Math.min(this.maxPageBreaks,aa-Y+1)):0;for(var ja=0;ja<aa;ja++){var la=Y+ja+1;la=ia?[new mxPoint(Math.round(f.x),Math.round(f.y+la*l.height)),new mxPoint(Math.round(x),Math.round(f.y+la*l.height))]:[new mxPoint(Math.round(f.x+la*l.width),Math.round(f.y)),new mxPoint(Math.round(f.x+la*l.width),Math.round(A))];null!=J[ja]&&null!=J[ja].node?(J[ja].points=la,
+J[ja].redraw()):(null!=J[ja]&&J[ja].destroy(),la=new mxPolyline(la,this.pageBreakColor),la.dialect=this.dialect,la.isDashed=this.pageBreakDashed,la.pointerEvents=!1,la.init(this.view.backgroundPane),la.redraw(),J[ja]=la)}for(ja=aa;ja<J.length;ja++)null!=J[ja]&&J[ja].destroy();J.splice(aa,J.length-aa)}});C(this.horizontalPageBreaks);C(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(y,C,O){for(var F=0;F<
C.length;F++){if(this.graph.isTableCell(C[F])||this.graph.isTableRow(C[F]))return!1;if(this.graph.getModel().isVertex(C[F])){var N=this.graph.getCellGeometry(C[F]);if(null!=N&&N.relative)return!1}}return d.apply(this,arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=m.apply(this,arguments);y.intersects=mxUtils.bind(this,function(C,O){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(y,arguments)});return y};
mxGraphView.prototype.createBackgroundPageShape=function(y){return new mxRectangleShape(y,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var y=this.getGraphBounds(),C=0<y.width?y.x/this.scale-this.translate.x:0,O=0<y.height?y.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,N=this.graph.pageScale,R=F.width*N;F=F.height*N;N=Math.floor(Math.min(0,C)/R);var c=Math.floor(Math.min(0,O)/F);return new mxRectangle(this.scale*(this.translate.x+
N*R),this.scale*(this.translate.y+c*F),this.scale*(Math.ceil(Math.max(1,C+y.width/this.scale)/R)-N)*R,this.scale*(Math.ceil(Math.max(1,O+y.height/this.scale)/F)-c)*F)};var p=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(y,C){p.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=y+"px",this.view.backgroundPageShape.node.style.marginTop=
C+"px")};var t=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(y,C,O,F,N,R){var c=t.apply(this,arguments);null==R||R||mxEvent.addListener(c,"mousedown",function(f){mxEvent.consume(f)});return c};var n=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(y,C,O){var F=this.graph.model.getParent(y);if(C){var N=this.graph.model.isEdge(y)?null:this.graph.getCellGeometry(y);N=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(y)&&
(null!=N&&N.relative||!this.graph.isContainer(F)||this.graph.isPart(y))}else if(N=n.apply(this,arguments),this.graph.isTableCell(y)||this.graph.isTableRow(y))N=F,this.graph.isTable(N)||(N=this.graph.model.getParent(N)),N=!this.graph.selectionCellsHandler.isHandled(N)||this.graph.isCellSelected(N)&&this.graph.isToggleEvent(O.getEvent())||this.graph.isCellSelected(y)&&!this.graph.isToggleEvent(O.getEvent())||this.graph.isTableCell(y)&&this.graph.isCellSelected(F);return N};mxPopupMenuHandler.prototype.getCellForPopupEvent=
-function(y){y=y.getCell();for(var C=this.graph.getModel(),O=C.getParent(y),F=this.graph.view.getState(O),N=this.graph.isCellSelected(y);null!=F&&(C.isVertex(O)||C.isEdge(O));){var R=this.graph.isCellSelected(O);N=N||R;if(R||!N&&(this.graph.isTableCell(y)||this.graph.isTableRow(y)))y=O;O=C.getParent(O)}return y}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var p=this,t=this.editor.graph;t.lightbox=m;var n=t.getGraphBounds;t.getGraphBounds=function(){var H=n.apply(this,arguments),P=this.backgroundImage;if(null!=P&&null!=P.width&&null!=P.height){var T=this.view.translate,W=this.view.scale;H=mxRectangle.fromRectangle(H);H.add(new mxRectangle((T.x+P.x)*W,(T.y+P.y)*W,P.width*W,P.height*W))}return H};t.useCssTransforms&&(this.lazyZoomDelay=
+function(y){y=y.getCell();for(var C=this.graph.getModel(),O=C.getParent(y),F=this.graph.view.getState(O),N=this.graph.isCellSelected(y);null!=F&&(C.isVertex(O)||C.isEdge(O));){var R=this.graph.isCellSelected(O);N=N||R;if(R||!N&&(this.graph.isTableCell(y)||this.graph.isTableRow(y)))y=O;O=C.getParent(O)}return y}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var p=this,t=this.editor.graph;t.lightbox=m;var n=t.getGraphBounds;t.getGraphBounds=function(){var H=n.apply(this,arguments),P=this.backgroundImage;if(null!=P&&null!=P.width&&null!=P.height){var U=this.view.translate,W=this.view.scale;H=mxRectangle.fromRectangle(H);H.add(new mxRectangle((U.x+P.x)*W,(U.y+P.y)*W,P.width*W,P.height*W))}return H};t.useCssTransforms&&(this.lazyZoomDelay=
0);this.selectionStateListener=mxUtils.bind(this,function(H,P){this.clearSelectionState()});t.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);t.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);t.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);t.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);t.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){t.isEnabled=
function(){return!1};t.panningHandler.isForcePanningEvent=function(H){for(var P=H.getSource();null!=P&&P!=t.container;){if("foreignObject"===P.nodeName||"text"===P.nodeName)return!1;P=P.parentNode}return!mxEvent.isPopupTrigger(H.getEvent())};var y=t.panningHandler.start;t.panningHandler.start=function(){y.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!t.standalone){var C=!1,O=!1;this.setDefaultStyle=function(H){try{var P=t.getModel(),
-T=P.isVertex(H)&&P.isEdge(P.getParent(H));P.isEdge(H)||T?(O=!1,P.isEdge(H)&&(t.pasteEdgeStyle=!1)):(C=!1,t.pasteStylesToText=!1);var W=t.getCellStyle(H,!1),fa=[],X=[],ea;for(ea in W)fa.push(W[ea]),X.push(ea);P.isEdge(H)?t.currentEdgeStyle={}:T||(t.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",X,"values",fa,"cells",[H],"force",!0,"edgeLabel",T));if(P.isEdge(H)||T)O=!0,P.isEdge(H)&&(t.pasteEdgeStyle=!0);else{C=!0;var oa=P.getStyle(H);t.pasteStylesToText="string"===typeof oa&&
-0<=mxUtils.indexOf(oa.split(";"),"text")}}catch(la){this.handleError(la)}};this.clearDefaultStyle=function(){t.currentEdgeStyle=mxUtils.clone(t.defaultEdgeStyle);t.currentVertexStyle=mxUtils.clone(t.defaultVertexStyle);t.pasteEdgeStyle=!1;C=O=t.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};t.addListener("cellsInserted",function(H,P){t.pasteCellStyles(t.includeDescendants(P.getProperty("cells")))});t.addListener("textInserted",function(H,P){t.pasteCellStyles(P.getProperty("cells"))});
+U=P.isVertex(H)&&P.isEdge(P.getParent(H));P.isEdge(H)||U?(O=!1,P.isEdge(H)&&(t.pasteEdgeStyle=!1)):(C=!1,t.pasteStylesToText=!1);var W=t.getCellStyle(H,!1),fa=[],X=[],ea;for(ea in W)fa.push(W[ea]),X.push(ea);P.isEdge(H)?t.currentEdgeStyle={}:U||(t.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",X,"values",fa,"cells",[H],"force",!0,"edgeLabel",U));if(P.isEdge(H)||U)O=!0,P.isEdge(H)&&(t.pasteEdgeStyle=!0);else{C=!0;var oa=P.getStyle(H);t.pasteStylesToText="string"===typeof oa&&
+0<=mxUtils.indexOf(oa.split(";"),"text")}}catch(ka){this.handleError(ka)}};this.clearDefaultStyle=function(){t.currentEdgeStyle=mxUtils.clone(t.defaultEdgeStyle);t.currentVertexStyle=mxUtils.clone(t.defaultVertexStyle);t.pasteEdgeStyle=!1;C=O=t.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};t.addListener("cellsInserted",function(H,P){t.pasteCellStyles(t.includeDescendants(P.getProperty("cells")))});t.addListener("textInserted",function(H,P){t.pasteCellStyles(P.getProperty("cells"))});
this.createDivs();this.createUi();this.refresh();var F=mxUtils.bind(this,function(H){null==H&&(H=window.event);return t.isEditing()||null!=H&&this.isSelectionAllowed(H)});document.addEventListener("selectstart",function(H){var P=mxEvent.getSource(H);P!=document.body&&P!=document.documentElement||H.preventDefault()},!0);this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=F,this.menubarContainer.onmousedown=F,this.toolbarContainer.onselectstart=
F,this.toolbarContainer.onmousedown=F,this.diagramContainer.onselectstart=F,this.diagramContainer.onmousedown=F,this.sidebarContainer.onselectstart=F,this.sidebarContainer.onmousedown=F,this.formatContainer.onselectstart=F,this.formatContainer.onmousedown=F,null!=this.tabContainer&&(this.tabContainer.onselectstart=F),mxClient.IS_IOS&&(d=function(){var H=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var P=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{H=[parseInt(P[1],10),parseInt(P[2],
-10),parseInt(P[3]||0,10)]}catch(T){}}return H}(),null!=d&&16<=d[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?
+10),parseInt(P[3]||0,10)]}catch(U){}}return H}(),null!=d&&16<=d[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?
this.diagramContainer.oncontextmenu=function(H){if(null!=H){var P=mxEvent.getSource(H);if("A"==P.nodeName)for(;null!=P;){if("geHint"==P.className)return!0;P=P.parentNode}}return F(H)}:t.panningHandler.usePopupTrigger=!1;t.init(this.diagramContainer);mxClient.IS_SVG&&null!=t.view.getDrawPane()&&(d=t.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",
mxUtils.bind(this,function(H,P){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(H,P){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));if(null!=t.graphHandler){var N=t.graphHandler.start;t.graphHandler.start=function(H){null!=p.hoverIcons&&p.hoverIcons.reset();null!=p.inlineToolbar&&null!=H&&p.inlineToolbar.hide();N.apply(this,arguments)};var R=t.graphHandler.mouseUp;
t.graphHandler.mouseUp=function(){R.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()}}var c=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();c.apply(this,arguments)};var f=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(){f.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};var l=mxEdgeHandler.prototype.start;mxEdgeHandler.prototype.start=
@@ -2198,16 +2198,16 @@ this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.d
27!=H.keyCode||(null!=this.sidebar&&null!=this.sidebar.tooltip&&"none"!=this.sidebar.tooltip.style.display&&null!=this.sidebar.tooltipCloseImage&&"none"!=this.sidebar.tooltipCloseImage.style.display?(this.sidebar.hideTooltip(),mxEvent.consume(H)):this.hideDialog(null,!0)):(P=mxEvent.getSource(H),"INPUT"==P.nodeName||"TEXTAREA"==P.nodeName||"SELECT"==P.nodeName||P.isContentEditable||(this.spaceDown=!0,this.hoverIcons.reset(),null!=t.container&&(t.container.style.cursor="move"),mxEvent.consume(H)))});
mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(H){null!=t.container&&(t.container.style.cursor="");this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var A=t.panningHandler.isForcePanningEvent;t.panningHandler.isForcePanningEvent=function(H){return null!=t.freehand&&t.freehand.isActive()?!1:A.apply(this,arguments)||p.isSpaceDown()||mxEvent.isMouseEvent(H.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(H.getEvent()))&&
(!mxEvent.isControlDown(H.getEvent())&&mxEvent.isRightMouseButton(H.getEvent())||mxEvent.isMiddleMouseButton(H.getEvent()))};var E=t.cellEditor.isStopEditingEvent;t.cellEditor.isStopEditingEvent=function(H){return E.apply(this,arguments)||13==H.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(H)||mxClient.IS_MAC&&mxEvent.isMetaDown(H)||mxClient.IS_SF&&mxEvent.isShiftDown(H))};var K=t.isZoomWheelEvent;t.isZoomWheelEvent=function(){return p.isSpaceDown()||K.apply(this,arguments)};var Q=mxUtils.bind(this,
-function(){if(null!=this.toolbar)for(var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,P=this.toolbar.container.firstChild;null!=P;){var T=P.getAttribute("data-min-width");null!=T&&parseInt(T)>H?P.style.display="none":P.style.display="";P=P.nextSibling}}),V=!1,J=null,ia=null,Y=null,aa=mxUtils.bind(this,function(){if(null!=this.toolbar&&V!=t.cellEditor.isContentEditing()){for(var H=this.toolbar.container.firstChild,P=[];null!=H;){var T=H.nextSibling;H.parentNode.removeChild(H);
-P.push(H);H=T}H=this.toolbar.fontMenu;T=this.toolbar.sizeMenu;if(null==Y)this.toolbar.createTextToolbar();else{for(var W=0;W<Y.length;W++)this.toolbar.container.appendChild(Y[W]);this.toolbar.fontMenu=J;this.toolbar.sizeMenu=ia}V=t.cellEditor.isContentEditing();J=H;ia=T;Y=P;Q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();aa()}));this.addListener("currentThemeChanged",Q);mxEvent.addListener(window,"resize",
-Q);Q();t.isTouchPopupMenuEnabled=function(){return null==p.dialog};var ja=t.cellEditor.startEditing;t.cellEditor.startEditing=function(){ja.apply(this,arguments);aa();if(t.cellEditor.isContentEditing()){var H=!1,P=function(){H||(H=!0,window.setTimeout(function(){var T=t.getSelectedEditingElement();null!=T&&(T=mxUtils.getCurrentStyle(T),null!=T&&null!=p.toolbar&&(p.toolbar.setFontName(mxUtils.getCssFontFamily(T.fontFamily)),p.toolbar.setFontSize(parseInt(T.fontSize))));H=!1},0))};mxEvent.addListener(t.cellEditor.textarea,
-"input",P);mxEvent.addListener(t.cellEditor.textarea,"touchend",P);mxEvent.addListener(t.cellEditor.textarea,"mouseup",P);mxEvent.addListener(t.cellEditor.textarea,"keyup",P);P()}};var ka=t.cellEditor.stopEditing;t.cellEditor.stopEditing=function(H,P){try{ka.apply(this,arguments),aa()}catch(T){p.handleError(T)}};t.container.setAttribute("tabindex","0");t.container.style.cursor="default";if(window.self===window.top&&null!=t.container.parentNode)try{t.container.focus()}catch(H){}var ua=t.fireMouseEvent;
-t.fireMouseEvent=function(H,P,T){try{H==mxEvent.MOUSE_DOWN&&this.container.focus(),ua.apply(this,arguments)}catch(W){p.handleError(W)}};var Da=t.foldCells;t.foldCells=function(H,P,T,W,fa){try{Da.apply(this,arguments)}catch(X){p.handleError(X)}};t.popupMenuHandler.autoExpand=!0;null!=this.menus&&(t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(H,P,T){this.menus.createPopupMenu(H,P,T)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(H){t.popupMenuHandler.hideMenu()}));
-this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};t.connectionHandler.addListener(mxEvent.CONNECT,function(H,P){var T=[P.getProperty("cell")];P.getProperty("terminalInserted")&&(T.push(P.getProperty("terminal")),window.setTimeout(function(){null!=p.hoverIcons&&p.hoverIcons.update(t.view.getState(T[T.length-1]))},0));t.pasteCellStyles(T)});var ha=null,k=null;b=mxUtils.bind(this,function(){if(null!=this.toolbar){var H=this.getSelectionState();if(t.isEnabled()&&
+function(){if(null!=this.toolbar)for(var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,P=this.toolbar.container.firstChild;null!=P;){var U=P.getAttribute("data-min-width");null!=U&&parseInt(U)>H?P.style.display="none":P.style.display="";P=P.nextSibling}}),V=!1,J=null,ia=null,Y=null,aa=mxUtils.bind(this,function(){if(null!=this.toolbar&&V!=t.cellEditor.isContentEditing()){for(var H=this.toolbar.container.firstChild,P=[];null!=H;){var U=H.nextSibling;H.parentNode.removeChild(H);
+P.push(H);H=U}H=this.toolbar.fontMenu;U=this.toolbar.sizeMenu;if(null==Y)this.toolbar.createTextToolbar();else{for(var W=0;W<Y.length;W++)this.toolbar.container.appendChild(Y[W]);this.toolbar.fontMenu=J;this.toolbar.sizeMenu=ia}V=t.cellEditor.isContentEditing();J=H;ia=U;Y=P;Q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();aa()}));this.addListener("currentThemeChanged",Q);mxEvent.addListener(window,"resize",
+Q);Q();t.isTouchPopupMenuEnabled=function(){return null==p.dialog};var ja=t.cellEditor.startEditing;t.cellEditor.startEditing=function(){ja.apply(this,arguments);aa();if(t.cellEditor.isContentEditing()){var H=!1,P=function(){H||(H=!0,window.setTimeout(function(){var U=t.getSelectedEditingElement();null!=U&&(U=mxUtils.getCurrentStyle(U),null!=U&&null!=p.toolbar&&(p.toolbar.setFontName(mxUtils.getCssFontFamily(U.fontFamily)),p.toolbar.setFontSize(parseInt(U.fontSize))));H=!1},0))};mxEvent.addListener(t.cellEditor.textarea,
+"input",P);mxEvent.addListener(t.cellEditor.textarea,"touchend",P);mxEvent.addListener(t.cellEditor.textarea,"mouseup",P);mxEvent.addListener(t.cellEditor.textarea,"keyup",P);P()}};var la=t.cellEditor.stopEditing;t.cellEditor.stopEditing=function(H,P){try{la.apply(this,arguments),aa()}catch(U){p.handleError(U)}};t.container.setAttribute("tabindex","0");t.container.style.cursor="default";if(window.self===window.top&&null!=t.container.parentNode)try{t.container.focus()}catch(H){}var ua=t.fireMouseEvent;
+t.fireMouseEvent=function(H,P,U){try{H==mxEvent.MOUSE_DOWN&&this.container.focus(),ua.apply(this,arguments)}catch(W){p.handleError(W)}};var Da=t.foldCells;t.foldCells=function(H,P,U,W,fa){try{Da.apply(this,arguments)}catch(X){p.handleError(X)}};t.popupMenuHandler.autoExpand=!0;null!=this.menus&&(t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(H,P,U){this.menus.createPopupMenu(H,P,U)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(H){t.popupMenuHandler.hideMenu()}));
+this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};t.connectionHandler.addListener(mxEvent.CONNECT,function(H,P){var U=[P.getProperty("cell")];P.getProperty("terminalInserted")&&(U.push(P.getProperty("terminal")),window.setTimeout(function(){null!=p.hoverIcons&&p.hoverIcons.update(t.view.getState(U[U.length-1]))},0));t.pasteCellStyles(U)});var ha=null,k=null;b=mxUtils.bind(this,function(){if(null!=this.toolbar){var H=this.getSelectionState();if(t.isEnabled()&&
0<H.edges.length){if(null!=this.toolbar.edgeStyleMenu){var P=this.getImageForEdgeStyle(H.style);1==H.edges.length&&"arrow"==H.style[mxConstants.STYLE_SHAPE]&&(P=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+P+")"}null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(H.style)+")")}else null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ha+")"),null!=this.toolbar.edgeShapeMenu&&
(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+k+")")}});t.selectionModel.addListener(mxEvent.CHANGE,b);t.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(H,P){H=P.getProperty("force");(this.updateDefaultStyle||H)&&t.copyCellStyles(P.getProperty("cells"),P.getProperty("keys"),P.getProperty("values"),t.currentVertexStyle,t.currentEdgeStyle,C,O,P.getProperty("edgeLabel"));null!=this.toolbar&&(this.toolbar.setFontName(t.currentVertexStyle.fontFamily||
Menus.prototype.defaultFont),this.toolbar.setFontSize(t.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),P=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(ha=this.getImageForEdgeStyle(t.currentEdgeStyle),0==P.edges.length&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ha+")")),null!=this.toolbar.edgeShapeMenu&&(k=this.getImageForEdgeShape(t.currentEdgeStyle),0==P.edges.length&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+k+")")))}));null!=this.toolbar&&
-(b=mxUtils.bind(this,function(){var H=t.currentVertexStyle.fontFamily||"Helvetica",P=String(t.currentVertexStyle.fontSize||"12"),T=t.getView().getState(t.getSelectionCell());null!=T&&(H=T.style[mxConstants.STYLE_FONTFAMILY]||H,P=T.style[mxConstants.STYLE_FONTSIZE]||P,10<H.length&&(H=H.substring(0,8)+"..."));this.toolbar.setFontName(H);this.toolbar.setFontSize(P)}),t.getSelectionModel().addListener(mxEvent.CHANGE,b),t.getModel().addListener(mxEvent.CHANGE,b));t.addListener(mxEvent.CELLS_ADDED,function(H,
+(b=mxUtils.bind(this,function(){var H=t.currentVertexStyle.fontFamily||"Helvetica",P=String(t.currentVertexStyle.fontSize||"12"),U=t.getView().getState(t.getSelectionCell());null!=U&&(H=U.style[mxConstants.STYLE_FONTFAMILY]||H,P=U.style[mxConstants.STYLE_FONTSIZE]||P,10<H.length&&(H=H.substring(0,8)+"..."));this.toolbar.setFontName(H);this.toolbar.setFontSize(P)}),t.getSelectionModel().addListener(mxEvent.CHANGE,b),t.getModel().addListener(mxEvent.CHANGE,b));t.addListener(mxEvent.CELLS_ADDED,function(H,
P){H=P.getProperty("cells");P=P.getProperty("parent");null!=P&&t.getModel().isLayer(P)&&!t.isCellVisible(P)&&null!=H&&0<H.length&&t.getModel().setVisible(P,!0)});Graph.selectParentLayer&&t.selectionModel.addListener(mxEvent.CHANGE,function(){if(t.isEnabled()&&!t.isSelectionEmpty()){var H=t.getLayerForCells(t.getSelectionCells());null!=H&&t.setDefaultParent(H)}});this.gestureHandler=mxUtils.bind(this,function(H){this.isHideCurrentMenuEvent(H)&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,
this.gestureHandler);var u=null;this.resizeHandler=mxUtils.bind(this,function(){null!=u&&window.clearTimeout(u);u=window.setTimeout(mxUtils.bind(this,function(){u=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&(this.scrollHandler=
mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){t.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){t.view.validateBackground()}));t.addListener("gridSizeChanged",mxUtils.bind(this,function(){t.isGridEnabled()&&t.view.validateBackground()}));
@@ -2270,7 +2270,8 @@ EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.sha
EditorUi.prototype.onKeyDown=function(b){var d=this.editor.graph;if(9==b.which&&d.isEnabled()&&!mxEvent.isControlDown(b)){if(d.isEditing())if(mxEvent.isAltDown(b))d.stopEditing(!1);else try{var m=d.cellEditor.isContentEditing()&&d.cellEditor.isTextSelected();if(window.getSelection&&d.cellEditor.isContentEditing()&&!m){var p=window.getSelection(),t=0<p.rangeCount?p.getRangeAt(0).commonAncestorContainer:null;m=null!=t&&("LI"==t.nodeName||null!=t.parentNode&&"LI"==t.parentNode.nodeName)}m?document.execCommand(mxEvent.isShiftDown(b)?
"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?d.stopEditing(!1):d.cellEditor.insertTab(d.cellEditor.isContentEditing()?null:4)}catch(n){}else mxEvent.isAltDown(b)?d.selectParentCell():d.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};
EditorUi.prototype.onKeyPress=function(b){var d=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(b)===this.typingShim||!this.isImmediateEditingEvent(b)||d.isEditing()||d.isSelectionEmpty()||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(null==b.key||1!==b.key.length)&&229!==b.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(b)||(d.escape(),d.cellEditor.editByTyping=!0,d.startEditing())};
-EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&d.setAttribute("inputmode","none");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";
+EditorUi.prototype.isVirtualKeyboardDevice=function(){return mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints};
+EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");this.isVirtualKeyboardDevice()&&d.setAttribute("inputmode","none");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";
this.typingShim=d;var m=!1,p=mxUtils.bind(this,function(){if(!m&&0<d.value.length){var n=d.value;d.value="";this.hideTypingShim();b.escape();b.cellEditor.editByTyping=!0;b.startEditing(null,n)}});mxEvent.addListener(d,"compositionstart",function(){m=!0});mxEvent.addListener(d,"compositionend",function(){m=!1;p()});mxEvent.addListener(d,"input",function(){p()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(n){229!==n.keyCode&&(mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||(null==n.key||
1!==n.key.length||mxEvent.isAltDown(n)?n.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(n)&&n.preventDefault()))}));b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));b.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));b.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,
function(){this.updateTypingShim()}),0)}));if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var t=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?t.apply(b.cellEditor):this.updateTypingShim()})};
@@ -2291,14 +2292,14 @@ EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipb
null;n.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):y=m.apply(this,arguments);b.updatePasteActionStates();return y};var p=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){p.apply(this,arguments);b.updatePasteActionStates()};var t=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(n,y){t.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};
EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;
EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var X=this.graph.getPageLayout(),ea=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+X.x*ea.width),this.scale*(this.translate.y+X.y*ea.height),this.scale*X.width*ea.width,
-this.scale*X.height*ea.height)};b.getPreferredPageSize=function(X,ea,oa){X=this.getPageLayout();ea=this.getPageSize();return new mxRectangle(0,0,X.width*ea.width,X.height*ea.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(X,ea,oa,la){if(null!=b.container&&!b.isViewer()){oa=null!=oa?oa:0;la=null!=la?la:0;var ca=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),sa=mxUtils.hasScrollbars(b.container),xa=b.view.translate,
-qa=b.view.scale,Ba=mxRectangle.fromRectangle(ca);Ba.x=Ba.x/qa-xa.x;Ba.y=Ba.y/qa-xa.y;Ba.width/=qa;Ba.height/=qa;xa=b.container.scrollTop;var ma=b.container.scrollLeft,ta=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)ta+=3;var va=b.container.offsetWidth-ta;ta=b.container.offsetHeight-ta;X=X?Math.max(.3,Math.min(ea||1,va/Ba.width)):qa;ea=(va-X*Ba.width)/2/X;var Ha=0==this.lightboxVerticalDivider?0:(ta-X*Ba.height)/this.lightboxVerticalDivider/X;sa&&(ea=Math.max(ea,
-0),Ha=Math.max(Ha,0));if(sa||ca.width<va||ca.height<ta)b.view.scaleAndTranslate(X,Math.floor(ea-Ba.x),Math.floor(Ha-Ba.y)),b.container.scrollTop=xa*X/qa,b.container.scrollLeft=ma*X/qa;else if(0!=oa||0!=la)ca=b.view.translate,b.view.setTranslate(Math.floor(ca.x+oa/qa),Math.floor(ca.y+la/qa))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var p=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",p);this.destroyFunctions.push(function(){mxEvent.removeListener(window,
+this.scale*X.height*ea.height)};b.getPreferredPageSize=function(X,ea,oa){X=this.getPageLayout();ea=this.getPageSize();return new mxRectangle(0,0,X.width*ea.width,X.height*ea.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(X,ea,oa,ka){if(null!=b.container&&!b.isViewer()){oa=null!=oa?oa:0;ka=null!=ka?ka:0;var ba=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),sa=mxUtils.hasScrollbars(b.container),xa=b.view.translate,
+qa=b.view.scale,Ba=mxRectangle.fromRectangle(ba);Ba.x=Ba.x/qa-xa.x;Ba.y=Ba.y/qa-xa.y;Ba.width/=qa;Ba.height/=qa;xa=b.container.scrollTop;var ma=b.container.scrollLeft,ta=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)ta+=3;var va=b.container.offsetWidth-ta;ta=b.container.offsetHeight-ta;X=X?Math.max(.3,Math.min(ea||1,va/Ba.width)):qa;ea=(va-X*Ba.width)/2/X;var Ga=0==this.lightboxVerticalDivider?0:(ta-X*Ba.height)/this.lightboxVerticalDivider/X;sa&&(ea=Math.max(ea,
+0),Ga=Math.max(Ga,0));if(sa||ba.width<va||ba.height<ta)b.view.scaleAndTranslate(X,Math.floor(ea-Ba.x),Math.floor(Ga-Ba.y)),b.container.scrollTop=xa*X/qa,b.container.scrollLeft=ma*X/qa;else if(0!=oa||0!=ka)ba=b.view.translate,b.view.setTranslate(Math.floor(ba.x+oa/qa),Math.floor(ba.y+ka/qa))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var p=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",p);this.destroyFunctions.push(function(){mxEvent.removeListener(window,
"resize",p)});if("undefined"!==typeof ResizeObserver&&null!=b.container){var t=0==b.container.offsetWidth||0==b.container.offsetHeight,n=new ResizeObserver(mxUtils.bind(this,function(){var X=0==b.container.offsetWidth||0==b.container.offsetHeight;t&&!X&&(b.isLightboxView()&&this.lightboxFit(),this.chromelessResize());t=X}));n.observe(b.container);this.destroyFunctions.push(function(){n.disconnect()})}this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));
this.actions.get("zoomIn").funct=mxUtils.bind(this,function(X){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(X){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var y=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";
this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var C=mxUtils.bind(this,function(){var X=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top=
-"0":this.chromelessToolbar.style.bottom=(null!=X?parseInt(X["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",C);C();var O=0;C=mxUtils.bind(this,function(X,ea,oa){O++;var la=document.createElement("span");la.style.paddingLeft="8px";la.style.paddingRight="8px";la.style.cursor="pointer";mxEvent.addListener(la,"click",X);null!=oa&&la.setAttribute("title",oa);X=document.createElement("img");X.setAttribute("border",
-"0");X.setAttribute("src",ea);X.style.width="36px";X.style.filter="invert(100%)";la.appendChild(X);this.chromelessToolbar.appendChild(la);return la});if(null!=y.backBtn){var F=Graph.sanitizeLink(y.backBtn.url);null!=F&&C(mxUtils.bind(this,function(X){window.location.href=F;mxEvent.consume(X)}),Editor.backImage,mxResources.get("back"))}if(this.isPagesEnabled()){var N=C(mxUtils.bind(this,function(X){this.actions.get("previousPage").funct();mxEvent.consume(X)}),Editor.chevronLeftImage,mxResources.get("previousPage")),
+"0":this.chromelessToolbar.style.bottom=(null!=X?parseInt(X["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",C);C();var O=0;C=mxUtils.bind(this,function(X,ea,oa){O++;var ka=document.createElement("span");ka.style.paddingLeft="8px";ka.style.paddingRight="8px";ka.style.cursor="pointer";mxEvent.addListener(ka,"click",X);null!=oa&&ka.setAttribute("title",oa);X=document.createElement("img");X.setAttribute("border",
+"0");X.setAttribute("src",ea);X.style.width="36px";X.style.filter="invert(100%)";ka.appendChild(X);this.chromelessToolbar.appendChild(ka);return ka});if(null!=y.backBtn){var F=Graph.sanitizeLink(y.backBtn.url);null!=F&&C(mxUtils.bind(this,function(X){window.location.href=F;mxEvent.consume(X)}),Editor.backImage,mxResources.get("back"))}if(this.isPagesEnabled()){var N=C(mxUtils.bind(this,function(X){this.actions.get("previousPage").funct();mxEvent.consume(X)}),Editor.chevronLeftImage,mxResources.get("previousPage")),
R=document.createElement("div");R.style.fontFamily=Editor.defaultHtmlFont;R.style.display="inline-block";R.style.verticalAlign="top";R.style.fontWeight="bold";R.style.marginTop="8px";R.style.fontSize="14px";R.style.cursor="default";R.style.color="#ffffff";this.chromelessToolbar.appendChild(R);var c=C(mxUtils.bind(this,function(X){this.actions.get("nextPage").funct();mxEvent.consume(X)}),Editor.chevronRightImage,mxResources.get("nextPage")),f=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&
null!=this.currentPage){R.innerText="";var X=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(R,X+1+" / "+this.pages.length);R.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());N.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(X-1,this.pages.length)].getName());c.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(X+1,this.pages.length)].getName())}});N.style.paddingLeft="0px";N.style.paddingRight=
"4px";c.style.paddingLeft="4px";c.style.paddingRight="0px";var l=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(c.style.display="",N.style.display="",R.style.display="inline-block"):(c.style.display="none",N.style.display="none",R.style.display="none");f()});if(null!=this.menus){var q=this.menus.get("pages");null!=q&&mxEvent.addListener(R,"click",mxUtils.bind(this,function(X){var ea=new mxPopupMenu(q.funct);ea.smartSeparators=!0;ea.showDisabled=!0;ea.autoExpand=
@@ -2313,23 +2314,23 @@ C(mxUtils.bind(this,function(X){null!=ia?window.location.href=ia:window.location
document.body))&&C(mxUtils.bind(this,function(X){"1"==urlParams.close||y.closeBtn?window.close():(this.destroy(),mxEvent.consume(X))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(X){mxEvent.isTouchEvent(X)||
(mxEvent.isShiftDown(X)||K(30),E())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(X){mxEvent.consume(X)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(X){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(X)?E():K(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(X){mxEvent.isShiftDown(X)?E():K(100);mxEvent.consume(X)}));mxEvent.addListener(this.chromelessToolbar,
"mouseleave",mxUtils.bind(this,function(X){mxEvent.isTouchEvent(X)||K(30)}));var Y=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(X,ea){this.startX=ea.getGraphX();this.startY=ea.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(X,ea){},mouseUp:function(X,ea){mxEvent.isTouchEvent(ea.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<Y&&Math.abs(this.scrollTop-b.container.scrollTop)<
-Y&&Math.abs(this.startX-ea.getGraphX())<Y&&Math.abs(this.startY-ea.getGraphY())<Y&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?E():K(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var aa=b.view.validate,ja=new mxPoint,ka=!1,ua=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&ua!=m.currentPage){ua=m.currentPage;ka=!0;var X=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,
+Y&&Math.abs(this.startX-ea.getGraphX())<Y&&Math.abs(this.startY-ea.getGraphY())<Y&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?E():K(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var aa=b.view.validate,ja=new mxPoint,la=!1,ua=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&ua!=m.currentPage){ua=m.currentPage;la=!0;var X=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,
!0);null==X&&(X=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));X=b.getPageLayout(X,ja,1);var ea=b.getDefaultTranslate(X);this.x0=X.x;this.y0=X.y;if(ea.x!=this.translate.x||ea.y!=this.translate.y)this.invalidate(),this.translate.x=ea.x,this.translate.y=ea.y}ea=b.getPagePadding();var oa=b.getPageSize();X=ea.x-(this.x0||0)*oa.width;ea=ea.y-(this.y0||0)*oa.height;if(this.translate.x!=X||this.translate.y!=ea)this.invalidate(),this.translate.x=X,this.translate.y=ea}aa.apply(this,
-arguments)};if(!b.isViewer()){var Da=b.sizeDidChange;b.sizeDidChange=function(){var X=ka;ka=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var ea=this.getPageLayout(),oa=this.getDefaultTranslate(ea),la=this.view.translate.x,ca=this.view.translate.y;if(oa.x!=la||oa.y!=ca){this.view.x0=ea.x;this.view.y0=ea.y;this.autoTranslate=!0;this.view.setTranslate(oa.x,oa.y);this.autoTranslate=!1;X||(this.container.scrollLeft+=Math.round((oa.x-
-la)*this.view.scale),this.container.scrollTop+=Math.round((oa.y-ca)*this.view.scale));return}}Da.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ha=b.view.getBackgroundPane(),k=b.view.getDrawPane();b.cumulativeZoomFactor=1;var u=null,H=null,P=null,T=null,W=null,fa=function(X){null!=u&&window.clearTimeout(u);0<=X&&window.setTimeout(function(){if(!b.isMouseDown||T)u=window.setTimeout(mxUtils.bind(this,function(){if(b.isFastZoomEnabled()){null!=
+arguments)};if(!b.isViewer()){var Da=b.sizeDidChange;b.sizeDidChange=function(){var X=la;la=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var ea=this.getPageLayout(),oa=this.getDefaultTranslate(ea),ka=this.view.translate.x,ba=this.view.translate.y;if(oa.x!=ka||oa.y!=ba){this.view.x0=ea.x;this.view.y0=ea.y;this.autoTranslate=!0;this.view.setTranslate(oa.x,oa.y);this.autoTranslate=!1;X||(this.container.scrollLeft+=Math.round((oa.x-
+ka)*this.view.scale),this.container.scrollTop+=Math.round((oa.y-ba)*this.view.scale));return}}Da.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ha=b.view.getBackgroundPane(),k=b.view.getDrawPane();b.cumulativeZoomFactor=1;var u=null,H=null,P=null,U=null,W=null,fa=function(X){null!=u&&window.clearTimeout(u);0<=X&&window.setTimeout(function(){if(!b.isMouseDown||U)u=window.setTimeout(mxUtils.bind(this,function(){if(b.isFastZoomEnabled()){null!=
b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform",null));k.style.transformOrigin="";ha.style.transformOrigin="";mxClient.IS_SF?(k.style.transform="scale(1)",ha.style.transform="scale(1)",window.setTimeout(function(){k.style.transform="";ha.style.transform=""},0)):(k.style.transform="",ha.style.transform="");b.view.getDecoratorPane().style.opacity=
-"";b.view.getOverlayPane().style.opacity="";for(var ea=b.container.querySelectorAll(".geHint"),oa=0;oa<ea.length;oa++)ea[oa].style.opacity=""}ea=new mxPoint(b.container.scrollLeft,b.container.scrollTop);var la=mxUtils.getOffset(b.container),ca=b.view.scale;oa=b.view.translate.x;var sa=b.view.translate.y,xa=0,qa=0;null!=H&&(xa=b.container.offsetWidth/2-H.x+la.x,qa=b.container.offsetHeight/2-H.y+la.y);var Ba=null==d&&mxUtils.hasScrollbars(b.container);b.zoom(b.cumulativeZoomFactor,Ba?!1:null,b.isFastZoomEnabled()?
-20:null,Ba);var ma=b.view.scale;ma!=ca&&(Ba?(ca=ma/ca,xa=null!=H?H.x-la.x:b.container.clientWidth/2,la=null!=H?H.y-la.y:b.container.clientHeight/2,null!=P&&(xa-=ea.x-P.x,la-=ea.y-P.y),b.container.scrollLeft=Math.round(ea.x*ca+xa*(ca-1)+(b.view.translate.x-oa)*ma),b.container.scrollTop=Math.round(ea.y*ca+la*(ca-1)+(b.view.translate.y-sa)*ma)):(null!=P&&(xa+=ea.x-P.x,qa+=ea.y-P.y),null!=d&&m.chromelessResize(!1,null,xa*(b.cumulativeZoomFactor-1),qa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||
-0==xa&&0==qa||(b.container.scrollLeft-=xa*(b.cumulativeZoomFactor-1),b.container.scrollTop-=qa*(b.cumulativeZoomFactor-1))));null!=W&&k.setAttribute("filter",W);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;W=T=H=P=u=null}),null!=X?X:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(X,ea,oa,la,ca){la=null!=la?la:this.zoomFactor;(ea=ea||!b.scrollbars)&&(H=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+
-b.container.clientHeight/2));ca?1!=la&&(X?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=la,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=la,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*
+"";b.view.getOverlayPane().style.opacity="";for(var ea=b.container.querySelectorAll(".geHint"),oa=0;oa<ea.length;oa++)ea[oa].style.opacity=""}ea=new mxPoint(b.container.scrollLeft,b.container.scrollTop);var ka=mxUtils.getOffset(b.container),ba=b.view.scale;oa=b.view.translate.x;var sa=b.view.translate.y,xa=0,qa=0;null!=H&&(xa=b.container.offsetWidth/2-H.x+ka.x,qa=b.container.offsetHeight/2-H.y+ka.y);var Ba=null==d&&mxUtils.hasScrollbars(b.container);b.zoom(b.cumulativeZoomFactor,Ba?!1:null,b.isFastZoomEnabled()?
+20:null,Ba);var ma=b.view.scale;ma!=ba&&(Ba?(ba=ma/ba,xa=null!=H?H.x-ka.x:b.container.clientWidth/2,ka=null!=H?H.y-ka.y:b.container.clientHeight/2,null!=P&&(xa-=ea.x-P.x,ka-=ea.y-P.y),b.container.scrollLeft=Math.round(ea.x*ba+xa*(ba-1)+(b.view.translate.x-oa)*ma),b.container.scrollTop=Math.round(ea.y*ba+ka*(ba-1)+(b.view.translate.y-sa)*ma)):(null!=P&&(xa+=ea.x-P.x,qa+=ea.y-P.y),null!=d&&m.chromelessResize(!1,null,xa*(b.cumulativeZoomFactor-1),qa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||
+0==xa&&0==qa||(b.container.scrollLeft-=xa*(b.cumulativeZoomFactor-1),b.container.scrollTop-=qa*(b.cumulativeZoomFactor-1))));null!=W&&k.setAttribute("filter",W);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;W=U=H=P=u=null}),null!=X?X:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(X,ea,oa,ka,ba){ka=null!=ka?ka:this.zoomFactor;(ea=ea||!b.scrollbars)&&(H=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+
+b.container.clientHeight/2));ba?1!=ka&&(X?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ka,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=ka,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*
100)/100/this.view.scale)):this.cumulativeZoomFactor=this.getZoomStep(this.view.scale*this.cumulativeZoomFactor,X)/this.view.scale;this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(b.isFastZoomEnabled()){null==W&&""!=k.getAttribute("filter")&&(W=k.getAttribute("filter"),k.removeAttribute("filter"));P=new mxPoint(b.container.scrollLeft,b.container.scrollTop);X=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/
-(20*this.view.scale);la=ea||null==H?b.container.scrollLeft+b.container.clientWidth/2:H.x+b.container.scrollLeft-b.container.offsetLeft;ca=ea||null==H?b.container.scrollTop+b.container.clientHeight/2:H.y+b.container.scrollTop-b.container.offsetTop;k.style.transformOrigin=la+"px "+ca+"px";k.style.transform="scale("+X+")";ha.style.transformOrigin=la+"px "+ca+"px";ha.style.transform="scale("+X+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(la=b.view.backgroundPageShape.node,
-mxUtils.setPrefixedStyle(la.style,"transform-origin",(ea||null==H?b.container.clientWidth/2+b.container.scrollLeft-la.offsetLeft+"px":H.x+b.container.scrollLeft-la.offsetLeft-b.container.offsetLeft+"px")+" "+(ea||null==H?b.container.clientHeight/2+b.container.scrollTop-la.offsetTop+"px":H.y+b.container.scrollTop-la.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(la.style,"transform","scale("+X+")")):b.view.validateBackgroundStyles(X,la,ca);b.view.getDecoratorPane().style.opacity="0";
-b.view.getOverlayPane().style.opacity="0";ea=b.container.querySelectorAll(".geHint");for(la=0;la<ea.length;la++)ea[la].style.opacity="0";b.fireEvent(new mxEventObject("zoomPreview","factor",X))}fa(b.isFastZoomEnabled()?oa:0)};mxEvent.addGestureListeners(b.container,function(X){null!=u&&window.clearTimeout(u)},null,function(X){1!=b.cumulativeZoomFactor&&fa(0)});mxEvent.addListener(b.container,"scroll",function(X){null==u||b.isMouseDown||1==b.cumulativeZoomFactor||fa(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,
-function(X,ea,oa,la,ca){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&!oa&&b.isScrollWheelEvent(X))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=X.deltaX?X.deltaX:0,deltaY:null!=X.deltaY?X.deltaY:ea?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!oa&&b.isScrollWheelEvent(X))la=b.view.getTranslate(),ca=40/b.view.scale,mxEvent.isShiftDown(X)?
-b.view.setTranslate(la.x+(ea?-ca:ca),la.y):b.view.setTranslate(la.x,la.y+(ea?ca:-ca));else if(oa||b.isZoomWheelEvent(X))for(var sa=mxEvent.getSource(X);null!=sa;){if(sa==b.container){b.tooltipHandler.hideTooltip();la=null!=la&&null!=ca?new mxPoint(la,ca):new mxPoint(mxEvent.getClientX(X),mxEvent.getClientY(X));ca=null!=H?new mxPoint(H.x,H.y):null;sa=b.cumulativeZoomFactor;H=la;T=oa;oa=b.zoomFactor;var xa=!1,qa=null;X.ctrlKey&&null!=X.deltaY&&40>Math.abs(X.deltaY)&&Math.round(X.deltaY)!=X.deltaY?(oa=
-1+Math.abs(X.deltaY)/20*(oa-1),xa=!0):null!=X.movementY&&"pointermove"==X.type&&(oa=1+Math.max(1,Math.abs(X.movementY))/20*(oa-1),xa=!0,qa=-1);b.lazyZoom(ea,null,qa,oa,xa);null!=ca&&1!=sa&&b.isFastZoomEnabled()&&b.scrollbars&&(ea=b.cumulativeZoomFactor,oa=ea/sa,xa=1-ea,.001<Math.abs(xa)&&(H=new mxPoint((la.x*(1-oa)+oa*ca.x*(1-sa))/xa,(la.y*(1-oa)+oa*ca.y*(1-sa))/xa),la=H.x+b.container.scrollLeft-b.container.offsetLeft,ca=H.y+b.container.scrollTop-b.container.offsetTop,k.style.transformOrigin=la+"px "+
-ca+"px",ha.style.transformOrigin=la+"px "+ca+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ea=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ea.style,"transform-origin",H.x+b.container.scrollLeft-ea.offsetLeft-b.container.offsetLeft+"px "+(H.y+b.container.scrollTop-ea.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*ea*100)/100*20)/(20*b.view.scale),la,ca)));mxEvent.consume(X);return!1}sa=sa.parentNode}}),
+(20*this.view.scale);ka=ea||null==H?b.container.scrollLeft+b.container.clientWidth/2:H.x+b.container.scrollLeft-b.container.offsetLeft;ba=ea||null==H?b.container.scrollTop+b.container.clientHeight/2:H.y+b.container.scrollTop-b.container.offsetTop;k.style.transformOrigin=ka+"px "+ba+"px";k.style.transform="scale("+X+")";ha.style.transformOrigin=ka+"px "+ba+"px";ha.style.transform="scale("+X+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ka=b.view.backgroundPageShape.node,
+mxUtils.setPrefixedStyle(ka.style,"transform-origin",(ea||null==H?b.container.clientWidth/2+b.container.scrollLeft-ka.offsetLeft+"px":H.x+b.container.scrollLeft-ka.offsetLeft-b.container.offsetLeft+"px")+" "+(ea||null==H?b.container.clientHeight/2+b.container.scrollTop-ka.offsetTop+"px":H.y+b.container.scrollTop-ka.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ka.style,"transform","scale("+X+")")):b.view.validateBackgroundStyles(X,ka,ba);b.view.getDecoratorPane().style.opacity="0";
+b.view.getOverlayPane().style.opacity="0";ea=b.container.querySelectorAll(".geHint");for(ka=0;ka<ea.length;ka++)ea[ka].style.opacity="0";b.fireEvent(new mxEventObject("zoomPreview","factor",X))}fa(b.isFastZoomEnabled()?oa:0)};mxEvent.addGestureListeners(b.container,function(X){null!=u&&window.clearTimeout(u)},null,function(X){1!=b.cumulativeZoomFactor&&fa(0)});mxEvent.addListener(b.container,"scroll",function(X){null==u||b.isMouseDown||1==b.cumulativeZoomFactor||fa(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,
+function(X,ea,oa,ka,ba){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&!oa&&b.isScrollWheelEvent(X))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=X.deltaX?X.deltaX:0,deltaY:null!=X.deltaY?X.deltaY:ea?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!oa&&b.isScrollWheelEvent(X))ka=b.view.getTranslate(),ba=40/b.view.scale,mxEvent.isShiftDown(X)?
+b.view.setTranslate(ka.x+(ea?-ba:ba),ka.y):b.view.setTranslate(ka.x,ka.y+(ea?ba:-ba));else if(oa||b.isZoomWheelEvent(X))for(var sa=mxEvent.getSource(X);null!=sa;){if(sa==b.container){b.tooltipHandler.hideTooltip();ka=null!=ka&&null!=ba?new mxPoint(ka,ba):new mxPoint(mxEvent.getClientX(X),mxEvent.getClientY(X));ba=null!=H?new mxPoint(H.x,H.y):null;sa=b.cumulativeZoomFactor;H=ka;U=oa;oa=b.zoomFactor;var xa=!1,qa=null;X.ctrlKey&&null!=X.deltaY&&40>Math.abs(X.deltaY)&&Math.round(X.deltaY)!=X.deltaY?(oa=
+1+Math.abs(X.deltaY)/20*(oa-1),xa=!0):null!=X.movementY&&"pointermove"==X.type&&(oa=1+Math.max(1,Math.abs(X.movementY))/20*(oa-1),xa=!0,qa=-1);b.lazyZoom(ea,null,qa,oa,xa);null!=ba&&1!=sa&&b.isFastZoomEnabled()&&b.scrollbars&&(ea=b.cumulativeZoomFactor,oa=ea/sa,xa=1-ea,.001<Math.abs(xa)&&(H=new mxPoint((ka.x*(1-oa)+oa*ba.x*(1-sa))/xa,(ka.y*(1-oa)+oa*ba.y*(1-sa))/xa),ka=H.x+b.container.scrollLeft-b.container.offsetLeft,ba=H.y+b.container.scrollTop-b.container.offsetTop,k.style.transformOrigin=ka+"px "+
+ba+"px",ha.style.transformOrigin=ka+"px "+ba+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ea=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ea.style,"transform-origin",H.x+b.container.scrollLeft-ea.offsetLeft-b.container.offsetLeft+"px "+(H.y+b.container.scrollTop-ea.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*ea*100)/100*20)/(20*b.view.scale),ka,ba)));mxEvent.consume(X);return!1}sa=sa.parentNode}}),
b.container);b.panningHandler.zoomGraph=function(X){b.cumulativeZoomFactor=X.scale;b.lazyZoom(1<X.scale,!0,null,1,!0);mxEvent.consume(X)}};EditorUi.prototype.addChromelessToolbarItems=function(b){"1"!=urlParams.noPrint&&b(mxUtils.bind(this,function(d){this.actions.get("print").funct();mxEvent.consume(d)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};EditorUi.prototype.createTemporaryGraph=function(b){return Graph.createOffscreenGraph(b)};
EditorUi.prototype.addChromelessClickHandler=function(){var b=urlParams.highlight;null!=b&&0<b.length&&(b="#"+b);this.editor.graph.addClickHandler(b)};
EditorUi.prototype.toggleFormatPanel=function(b){b=null!=b?b:0==this.formatWidth;if(null!=this.format){var d=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.formatContainer.style,"transition","width "+d+"s ease-in-out");window.setTimeout(mxUtils.bind(this,function(){this.formatWidth=b?240:0;this.hsplitPosition=Math.min(this.container.clientWidth-this.hsplit.clientWidth-this.formatWidth,this.hsplitPosition);this.refresh();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.formatContainer.style,
@@ -2453,33 +2454,33 @@ d?b.push(d):0==b.length&&(m="")),0<b.length&&(m=b.join("; "))));return m};(funct
(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,p,t,n,y,C,O){var F=b.apply(this,arguments);if(null!=m){var N=F.getElementsByTagName("img");0<N.length&&(N[0].className="geButton")}return F}})();
Graph=function(b,d,m,p,t,n){mxGraph.call(this,b,d,m,p);this.themes=t||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!1;b=this.baseUrl;d=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=b.indexOf("/",d+2),0<d&&(this.domainUrl=b.substring(0,d)),d=b.lastIndexOf("/"),0<d&&(this.domainPathUrl=b.substring(0,d+1)));this.isHtmlLabel=function(ha){ha=this.getCurrentCellStyle(ha);
return null!=ha?"1"==ha.html||"wrap"==ha[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var y=null,C=null,O=null,F=null,N=!1,R=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(ha,k){if("mouseDown"==k.getProperty("eventName")&&this.isEnabled()){ha=k.getProperty("event");var u=ha.getState();k=this.view.scale;if(!mxEvent.isAltDown(ha.getEvent())&&null!=u&&(R=this.isCellSelected(u.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(ha.getEvent()))){var H=
-this.selectionCellsHandler.getHandler(u.cell);if(null==H||null==H.getHandleForEvent(ha)){var P=new mxRectangle(ha.getGraphX()-1,ha.getGraphY()-1),T=mxEvent.isTouchEvent(ha.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;H=T+2;P.grow(T);if(this.isTableCell(u.cell)&&this.isCellMovable(u.cell)&&!this.isCellSelected(u.cell)&&!(mxUtils.contains(u,ha.getGraphX()-H,ha.getGraphY()-H)&&mxUtils.contains(u,ha.getGraphX()-H,ha.getGraphY()+H)&&mxUtils.contains(u,ha.getGraphX()+
-H,ha.getGraphY()+H)&&mxUtils.contains(u,ha.getGraphX()+H,ha.getGraphY()-H))){var W=this.model.getParent(u.cell);H=this.model.getParent(W);if(!this.isCellSelected(H)){T*=k;var fa=2*T;if(this.model.getChildAt(H,0)!=W&&mxUtils.intersects(P,new mxRectangle(u.x,u.y-T,u.width,fa))||this.model.getChildAt(W,0)!=u.cell&&mxUtils.intersects(P,new mxRectangle(u.x-T,u.y,fa,u.height))||mxUtils.intersects(P,new mxRectangle(u.x,u.y+u.height-T,u.width,fa))||mxUtils.intersects(P,new mxRectangle(u.x+u.width-T,u.y,fa,
-u.height)))W=this.selectionCellsHandler.isHandled(H),this.selectCellForEvent(H,ha.getEvent()),H=this.selectionCellsHandler.getHandler(H),null!=H&&(T=H.getHandleForEvent(ha),null!=T&&(H.start(ha.getGraphX(),ha.getGraphY(),T),H.blockDelayedSelection=!W,ha.consume()))}}for(;!ha.isConsumed()&&null!=u&&(this.isTableCell(u.cell)||this.isTableRow(u.cell)||this.isTable(u.cell));)this.isSwimlane(u.cell)&&this.isCellMovable(u.cell)&&(H=this.getActualStartSize(u.cell),(0<H.x||0<H.width)&&mxUtils.intersects(P,
-new mxRectangle(u.x+(H.x-H.width-1)*k+(0==H.x?u.width:0),u.y,1,u.height))||(0<H.y||0<H.height)&&mxUtils.intersects(P,new mxRectangle(u.x,u.y+(H.y-H.height-1)*k+(0==H.y?u.height:0),u.width,1)))&&(this.selectCellForEvent(u.cell,ha.getEvent()),H=this.selectionCellsHandler.getHandler(u.cell),null!=H&&null!=H.customHandles&&(T=mxEvent.CUSTOM_HANDLE-H.customHandles.length+1,H.start(ha.getGraphX(),ha.getGraphY(),T),ha.consume())),u=this.view.getState(this.model.getParent(u.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,
+this.selectionCellsHandler.getHandler(u.cell);if(null==H||null==H.getHandleForEvent(ha)){var P=new mxRectangle(ha.getGraphX()-1,ha.getGraphY()-1),U=mxEvent.isTouchEvent(ha.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;H=U+2;P.grow(U);if(this.isTableCell(u.cell)&&this.isCellMovable(u.cell)&&!this.isCellSelected(u.cell)&&!(mxUtils.contains(u,ha.getGraphX()-H,ha.getGraphY()-H)&&mxUtils.contains(u,ha.getGraphX()-H,ha.getGraphY()+H)&&mxUtils.contains(u,ha.getGraphX()+
+H,ha.getGraphY()+H)&&mxUtils.contains(u,ha.getGraphX()+H,ha.getGraphY()-H))){var W=this.model.getParent(u.cell);H=this.model.getParent(W);if(!this.isCellSelected(H)){U*=k;var fa=2*U;if(this.model.getChildAt(H,0)!=W&&mxUtils.intersects(P,new mxRectangle(u.x,u.y-U,u.width,fa))||this.model.getChildAt(W,0)!=u.cell&&mxUtils.intersects(P,new mxRectangle(u.x-U,u.y,fa,u.height))||mxUtils.intersects(P,new mxRectangle(u.x,u.y+u.height-U,u.width,fa))||mxUtils.intersects(P,new mxRectangle(u.x+u.width-U,u.y,fa,
+u.height)))W=this.selectionCellsHandler.isHandled(H),this.selectCellForEvent(H,ha.getEvent()),H=this.selectionCellsHandler.getHandler(H),null!=H&&(U=H.getHandleForEvent(ha),null!=U&&(H.start(ha.getGraphX(),ha.getGraphY(),U),H.blockDelayedSelection=!W,ha.consume()))}}for(;!ha.isConsumed()&&null!=u&&(this.isTableCell(u.cell)||this.isTableRow(u.cell)||this.isTable(u.cell));)this.isSwimlane(u.cell)&&this.isCellMovable(u.cell)&&(H=this.getActualStartSize(u.cell),(0<H.x||0<H.width)&&mxUtils.intersects(P,
+new mxRectangle(u.x+(H.x-H.width-1)*k+(0==H.x?u.width:0),u.y,1,u.height))||(0<H.y||0<H.height)&&mxUtils.intersects(P,new mxRectangle(u.x,u.y+(H.y-H.height-1)*k+(0==H.y?u.height:0),u.width,1)))&&(this.selectCellForEvent(u.cell,ha.getEvent()),H=this.selectionCellsHandler.getHandler(u.cell),null!=H&&null!=H.customHandles&&(U=mxEvent.CUSTOM_HANDLE-H.customHandles.length+1,H.start(ha.getGraphX(),ha.getGraphY(),U),ha.consume())),u=this.view.getState(this.model.getParent(u.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,
mxUtils.bind(this,function(ha,k){if("mouseDown"==k.getProperty("eventName")&&this.isEnabled()){ha=k.getProperty("event");var u=ha.getState();mxEvent.isAltDown(ha.getEvent())||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k)||R||null==u||!this.model.isEdge(u.cell)||(y=new mxPoint(ha.getGraphX(),ha.getGraphY()),N=this.isCellSelected(u.cell),O=u,C=ha,null!=u.text&&null!=u.text.boundingBox&&mxUtils.contains(u.text.boundingBox,ha.getGraphX(),ha.getGraphY())?F=mxEvent.LABEL_HANDLE:(k=this.selectionCellsHandler.getHandler(u.cell),
null!=k&&null!=k.bends&&0<k.bends.length&&(F=k.getHandleForEvent(ha))))}}));this.addMouseListener({mouseDown:function(ha,k){},mouseMove:mxUtils.bind(this,function(ha,k){ha=this.selectionCellsHandler.handlers.map;for(var u in ha)if(null!=ha[u].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(k.getEvent())){var H=this.tolerance;if(null!=y&&null!=O&&null!=C){if(u=O,null!=F||Math.abs(y.x-k.getGraphX())>H||Math.abs(y.y-k.getGraphY())>H){var P=null;mxEvent.isShiftDown(k.getEvent())||
-(P=this.selectionCellsHandler.getHandler(u.cell));if(null!=P&&null!=P.bends&&0<P.bends.length){P.redrawHandles();var T=null!=F?F:P.getHandleForEvent(C),W=this.view.getEdgeStyle(u),fa=W==mxEdgeStyle.EntityRelation;H=u.absolutePoints;N||(T=F);T!=mxEvent.LABEL_HANDLE&&null!=H&&(T=F,null==T&&(ha=new mxRectangle(y.x,y.y),ha.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(ha,H[0].x,H[0].y)?T=0:mxUtils.contains(ha,H[H.length-1].x,H[H.length-1].y)?T=P.bends.length-1:null!=H&&(null==W&&
-null==T||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&(null!=W&&(2==H.length||3==H.length&&(0==Math.round(H[0].x-H[1].x)&&0==Math.round(H[1].x-H[2].x)||0==Math.round(H[0].y-H[1].y)&&0==Math.round(H[1].y-H[2].y)))?T=2:(T=mxUtils.findNearestSegment(u,y.x,y.y),T=null==W?mxEvent.VIRTUAL_HANDLE-T:T+1))),null==T&&(T=mxEvent.VIRTUAL_HANDLE));ha=T==mxEvent.LABEL_HANDLE||0==T||T==P.bends.length-1;if(!fa&&(null!=u.visibleSourceState||null!=u.visibleTargetState)||ha)P.start(k.getGraphX(),
-k.getGraphX(),T),k.consume(),this.graphHandler.reset()}null!=P&&(this.selectionCellsHandler.isHandlerActive(P)?this.isCellSelected(u.cell)||(this.selectionCellsHandler.handlers.put(u.cell,P),this.selectCellForEvent(u.cell,k.getEvent())):this.isCellSelected(u.cell)||P.destroy());N=!1;y=C=O=F=null}}else if(u=k.getState(),null!=u&&this.isCellEditable(u.cell)){ha=this.model.getParent(u.cell);P=null;if(this.model.isEdge(u.cell)&&!this.isCellSelected(u.cell)&&!mxEvent.isAltDown(k.getEvent())&&!mxEvent.isShiftDown(k.getEvent())&&
+(P=this.selectionCellsHandler.getHandler(u.cell));if(null!=P&&null!=P.bends&&0<P.bends.length){P.redrawHandles();var U=null!=F?F:P.getHandleForEvent(C),W=this.view.getEdgeStyle(u),fa=W==mxEdgeStyle.EntityRelation;H=u.absolutePoints;N||(U=F);U!=mxEvent.LABEL_HANDLE&&null!=H&&(U=F,null==U&&(ha=new mxRectangle(y.x,y.y),ha.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(ha,H[0].x,H[0].y)?U=0:mxUtils.contains(ha,H[H.length-1].x,H[H.length-1].y)?U=P.bends.length-1:null!=H&&(null==W&&
+null==U||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&(null!=W&&(2==H.length||3==H.length&&(0==Math.round(H[0].x-H[1].x)&&0==Math.round(H[1].x-H[2].x)||0==Math.round(H[0].y-H[1].y)&&0==Math.round(H[1].y-H[2].y)))?U=2:(U=mxUtils.findNearestSegment(u,y.x,y.y),U=null==W?mxEvent.VIRTUAL_HANDLE-U:U+1))),null==U&&(U=mxEvent.VIRTUAL_HANDLE));ha=U==mxEvent.LABEL_HANDLE||0==U||U==P.bends.length-1;if(!fa&&(null!=u.visibleSourceState||null!=u.visibleTargetState)||ha)P.start(k.getGraphX(),
+k.getGraphX(),U),k.consume(),this.graphHandler.reset()}null!=P&&(this.selectionCellsHandler.isHandlerActive(P)?this.isCellSelected(u.cell)||(this.selectionCellsHandler.handlers.put(u.cell,P),this.selectCellForEvent(u.cell,k.getEvent())):this.isCellSelected(u.cell)||P.destroy());N=!1;y=C=O=F=null}}else if(u=k.getState(),null!=u&&this.isCellEditable(u.cell)){ha=this.model.getParent(u.cell);P=null;if(this.model.isEdge(u.cell)&&!this.isCellSelected(u.cell)&&!mxEvent.isAltDown(k.getEvent())&&!mxEvent.isShiftDown(k.getEvent())&&
!this.isAncestorSelected(u.cell)&&(this.isSwimlane(ha)||this.model.isLayer(ha)||this.getCurrentRoot()==ha)){if(ha=new mxRectangle(k.getGraphX(),k.getGraphY()),ha.grow(mxEdgeHandler.prototype.handleImage.width/2),H=u.absolutePoints,null!=H)null!=u.text&&null!=u.text.boundingBox&&mxUtils.contains(u.text.boundingBox,k.getGraphX(),k.getGraphY())?P="move":mxUtils.contains(ha,H[0].x,H[0].y)||mxUtils.contains(ha,H[H.length-1].x,H[H.length-1].y)?P="pointer":(W=this.view.getEdgeStyle(u),W==mxEdgeStyle.EntityRelation||
null==u.visibleSourceState&&null==u.visibleTargetState||(P="crosshair",W!=mxEdgeStyle.SegmentConnector&&W!=mxEdgeStyle.OrthConnector))||(k=mxUtils.findNearestSegment(u,k.getGraphX(),k.getGraphY()),k<H.length-1&&0<=k&&(P=0==Math.round(H[k].x-H[k+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(k.getEvent())){H=mxShape.prototype.svgStrokeTolerance/2;ha=new mxRectangle(k.getGraphX(),k.getGraphY());ha.grow(H);if(this.isTableCell(u.cell)&&this.isCellMovable(u.cell)&&(k=this.model.getParent(u.cell),
H=this.model.getParent(k),!this.isCellSelected(H)))if(mxUtils.intersects(ha,new mxRectangle(u.x,u.y-2,u.width,4))&&this.model.getChildAt(H,0)!=k||mxUtils.intersects(ha,new mxRectangle(u.x,u.y+u.height-2,u.width,4)))P="row-resize";else if(mxUtils.intersects(ha,new mxRectangle(u.x-2,u.y,4,u.height))&&this.model.getChildAt(k,0)!=u.cell||mxUtils.intersects(ha,new mxRectangle(u.x+u.width-2,u.y,4,u.height)))P="col-resize";for(k=u;null==P&&null!=k&&(this.isTableCell(k.cell)||this.isTableRow(k.cell)||this.isTable(k.cell));)this.isSwimlane(k.cell)&&
-this.isCellMovable(k.cell)&&(H=this.getActualStartSize(k.cell),T=this.view.scale,(0<H.x||0<H.width)&&mxUtils.intersects(ha,new mxRectangle(k.x+(H.x-H.width-1)*T+(0==H.x?k.width*T:0),k.y,1,k.height))?P="col-resize":(0<H.y||0<H.height)&&mxUtils.intersects(ha,new mxRectangle(k.x,k.y+(H.y-H.height-1)*T+(0==H.y?k.height:0),k.width,1))&&(P="row-resize")),k=this.view.getState(this.model.getParent(k.cell))}null!=P&&u.setCursor(P)}}}),mouseUp:mxUtils.bind(this,function(ha,k){F=y=C=O=null})})}this.cellRenderer.minSvgStrokeWidth=
+this.isCellMovable(k.cell)&&(H=this.getActualStartSize(k.cell),U=this.view.scale,(0<H.x||0<H.width)&&mxUtils.intersects(ha,new mxRectangle(k.x+(H.x-H.width-1)*U+(0==H.x?k.width*U:0),k.y,1,k.height))?P="col-resize":(0<H.y||0<H.height)&&mxUtils.intersects(ha,new mxRectangle(k.x,k.y+(H.y-H.height-1)*U+(0==H.y?k.height:0),k.width,1))&&(P="row-resize")),k=this.view.getState(this.model.getParent(k.cell))}null!=P&&u.setCursor(P)}}}),mouseUp:mxUtils.bind(this,function(ha,k){F=y=C=O=null})})}this.cellRenderer.minSvgStrokeWidth=
.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=function(ha){var k=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);ha.view.graph.isHtmlLabel(ha.cell)&&("0"==mxUtils.getValue(ha.style,"html","0")?k=mxUtils.htmlEntities(k,!1):(ha.lastLabelValue!=k&&(ha.lastLabelValue=k,ha.lastSanitizedLabelValue=Graph.sanitizeHtml(k),c.innerHTML=ha.lastSanitizedLabelValue,Graph.addLightDarkColors(c,null,"simple"==ha.view.graph.getAdaptiveColors())&&(ha.lastSanitizedLabelValue=c.innerHTML)),
k=ha.lastSanitizedLabelValue));return k};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(ha,
-k){return!1};this.alternateEdgeStyle="vertical";null==p&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var ha=f.apply(this,arguments);if(this.graph.pageVisible){var k=this.graph.pageFormat,u=this.graph.pageScale,H=k.width*u;k=k.height*u;u=this.graph.view.translate;var P=this.graph.view.scale;if(Math.min(H,k)*P>this.graph.minPageBreakDist){var T=this.graph.getPageLayout(),W=this.graph.container,fa=0,X=T.width,ea=1,oa=T.height;if(null!=W){ea=
-(W.scrollLeft-W.clientWidth)/P-u.x;var la=(W.scrollTop-W.clientHeight)/P-u.y;fa=Math.max(0,Math.floor(ea/H)-T.x);X=Math.min(X,Math.ceil((ea+3*W.clientWidth/P)/H)-T.x);ea=Math.max(1,Math.floor(la/k)-T.y);oa=Math.min(oa,Math.ceil((la+3*W.clientHeight/P)/k)-T.y)}for(W=[];fa<X;fa++)W.push(new mxRectangle(((T.x+fa)*H+u.x)*P,(T.y*k+u.y)*P,H*P,k*P));for(X=ea;X<oa;X++)W.push(new mxRectangle((T.x*H+u.x)*P,((T.y+X)*k+u.y)*P,H*P,k*P));ha=W.concat(ha)}}return ha};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;
-mxGuide.prototype.getGuideColor=function(ha,k){return null==ha.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(ha){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var l=this.graphHandler.getCells;this.graphHandler.getCells=function(ha){for(var k=l.apply(this,arguments),u=new mxDictionary,H=[],P=0;P<k.length;P++){var T=this.graph.isTableCell(ha)&&
-this.graph.isTableCell(k[P])&&this.graph.isCellSelected(k[P])?this.graph.model.getParent(k[P]):this.graph.isTableRow(ha)&&this.graph.isTableRow(k[P])&&this.graph.isCellSelected(k[P])?k[P]:this.graph.getCompositeParent(k[P]);null==T||u.get(T)||(u.put(T,!0),H.push(T))}return H};var q=this.graphHandler.start;this.graphHandler.start=function(ha,k,u,H){var P=!1;this.graph.isTableCell(ha)&&(this.graph.isCellSelected(ha)?P=!0:ha=this.graph.model.getParent(ha));P||this.graph.isTableRow(ha)&&this.graph.isCellSelected(ha)||
-(ha=this.graph.getCompositeParent(ha));q.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(ha,k){k=this.graph.getCompositeParent(k);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(ha,k,u,H,P,T){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=H&&this.graph.applyNewEdgeStyle(H,[W]);return W};var x=new mxRubberband(this);this.getRubberband=function(){return x};var A=(new Date).getTime(),
+k){return!1};this.alternateEdgeStyle="vertical";null==p&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var ha=f.apply(this,arguments);if(this.graph.pageVisible){var k=this.graph.pageFormat,u=this.graph.pageScale,H=k.width*u;k=k.height*u;u=this.graph.view.translate;var P=this.graph.view.scale;if(Math.min(H,k)*P>this.graph.minPageBreakDist){var U=this.graph.getPageLayout(),W=this.graph.container,fa=0,X=U.width,ea=1,oa=U.height;if(null!=W){ea=
+(W.scrollLeft-W.clientWidth)/P-u.x;var ka=(W.scrollTop-W.clientHeight)/P-u.y;fa=Math.max(0,Math.floor(ea/H)-U.x);X=Math.min(X,Math.ceil((ea+3*W.clientWidth/P)/H)-U.x);ea=Math.max(1,Math.floor(ka/k)-U.y);oa=Math.min(oa,Math.ceil((ka+3*W.clientHeight/P)/k)-U.y)}for(W=[];fa<X;fa++)W.push(new mxRectangle(((U.x+fa)*H+u.x)*P,(U.y*k+u.y)*P,H*P,k*P));for(X=ea;X<oa;X++)W.push(new mxRectangle((U.x*H+u.x)*P,((U.y+X)*k+u.y)*P,H*P,k*P));ha=W.concat(ha)}}return ha};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;
+mxGuide.prototype.getGuideColor=function(ha,k){return null==ha.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(ha){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var l=this.graphHandler.getCells;this.graphHandler.getCells=function(ha){for(var k=l.apply(this,arguments),u=new mxDictionary,H=[],P=0;P<k.length;P++){var U=this.graph.isTableCell(ha)&&
+this.graph.isTableCell(k[P])&&this.graph.isCellSelected(k[P])?this.graph.model.getParent(k[P]):this.graph.isTableRow(ha)&&this.graph.isTableRow(k[P])&&this.graph.isCellSelected(k[P])?k[P]:this.graph.getCompositeParent(k[P]);null==U||u.get(U)||(u.put(U,!0),H.push(U))}return H};var q=this.graphHandler.start;this.graphHandler.start=function(ha,k,u,H){var P=!1;this.graph.isTableCell(ha)&&(this.graph.isCellSelected(ha)?P=!0:ha=this.graph.model.getParent(ha));P||this.graph.isTableRow(ha)&&this.graph.isCellSelected(ha)||
+(ha=this.graph.getCompositeParent(ha));q.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(ha,k){k=this.graph.getCompositeParent(k);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(ha,k,u,H,P,U){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=H&&this.graph.applyNewEdgeStyle(H,[W]);return W};var x=new mxRubberband(this);this.getRubberband=function(){return x};var A=(new Date).getTime(),
E=0,K=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var ha=this.currentState;K.apply(this,arguments);ha!=this.currentState?(A=(new Date).getTime(),E=0):E=(new Date).getTime()-A};var Q=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(ha){if(mxEvent.isShiftDown(ha.getEvent())&&mxEvent.isAltDown(ha.getEvent()))return!1;var k=null!=this.currentState?mxUtils.getValue(this.currentState.style,"outlineConnect","1"):"1";return"3"==
k?!1:null!=this.currentState&&ha.getState()==this.currentState&&("2"==k||2E3<E)||(null==this.currentState||"0"!=k)&&Q.apply(this,arguments)};var V=this.isToggleEvent;this.isToggleEvent=function(ha){return V.apply(this,arguments)||mxEvent.isShiftDown(ha)};var J=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(J=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&
(this.container.style.cursor=J)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(ha){return mxEvent.isMouseEvent(ha.getEvent())};var ia=this.click;this.click=function(ha){var k=null==ha.state&&null!=ha.sourceState&&this.isCellLocked(this.getLayerForCell(ha.sourceState.cell));if(this.isEnabled()&&!k||ha.isConsumed())return ia.apply(this,arguments);var u=k?ha.sourceState.cell:ha.getCell();if(null!=u){var H=this.getClickableLinkForCell(u);null!=H?this.isCustomLink(H)?
this.customLinkClicked(H,u):this.openLink(H):k&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(ha){return ha.sourceState};var Y=this.tooltipHandler.show;this.tooltipHandler.show=function(){Y.apply(this,arguments);if(null!=this.div)for(var ha=this.div.getElementsByTagName("a"),k=0;k<ha.length;k++)null!=ha[k].getAttribute("href")&&null==ha[k].getAttribute("target")&&ha[k].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(ha){return ha.sourceState};
this.getCursorForMouseEvent=function(ha){var k=null==ha.state&&null!=ha.sourceState&&this.isCellLocked(ha.sourceState.cell);return this.getCursorForCell(k?ha.sourceState.cell:ha.getCell())};var aa=this.getCursorForCell;this.getCursorForCell=function(ha){if(!this.isEnabled()||this.isCellLocked(ha)){if(null!=this.getClickableLinkForCell(ha))return"pointer";if(this.isCellLocked(ha))return"default"}return aa.apply(this,arguments)};this.selectRegion=function(ha,k){var u=Graph.intersectionSelect||mxEvent.isAltDown(k)?
-ha:null;ha=this.getCells(ha.x,ha.y,ha.width,ha.height,null,null,u,null,!0);if(null!=ha&&0<ha.length){u=new mxDictionary;for(var H=[],P=0;P<ha.length;P++){var T=this.getLockedGroupAncestor(this.model.getParent(ha[P]));T=null!=T?T:ha[P];u.get(T)||(u.put(T,!0),H.push(T))}ha=H}if(this.isToggleEvent(k))for(P=0;P<ha.length;P++)this.selectCellForEvent(ha[P],k);else this.selectCellsForEvent(ha,k);return ha};var ja=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=
-function(ha,k,u){return this.graph.isCellSelected(ha)||this.graph.isTransparentBounds(ha)?!1:ja.apply(this,arguments)};var ka=this.updateMouseEvent;this.updateMouseEvent=function(ha){ha=ka.apply(this,arguments);null!=ha.state&&this.isCellLocked(this.getLayerForCell(ha.getCell()))&&(null==this.getLinkForCell(ha.getCell())?ha.state=this.view.getState(this.getCellAt(ha.getGraphX(),ha.getGraphY(),null,null,null,mxUtils.bind(this,function(k,u,H){return ha.state==k||this.isCellLocked(this.getLayerForCell(k.cell))&&
+ha:null;ha=this.getCells(ha.x,ha.y,ha.width,ha.height,null,null,u,null,!0);if(null!=ha&&0<ha.length){u=new mxDictionary;for(var H=[],P=0;P<ha.length;P++){var U=this.getLockedGroupAncestor(this.model.getParent(ha[P]));U=null!=U?U:ha[P];u.get(U)||(u.put(U,!0),H.push(U))}ha=H}if(this.isToggleEvent(k))for(P=0;P<ha.length;P++)this.selectCellForEvent(ha[P],k);else this.selectCellsForEvent(ha,k);return ha};var ja=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=
+function(ha,k,u){return this.graph.isCellSelected(ha)||this.graph.isTransparentBounds(ha)?!1:ja.apply(this,arguments)};var la=this.updateMouseEvent;this.updateMouseEvent=function(ha){ha=la.apply(this,arguments);null!=ha.state&&this.isCellLocked(this.getLayerForCell(ha.getCell()))&&(null==this.getLinkForCell(ha.getCell())?ha.state=this.view.getState(this.getCellAt(ha.getGraphX(),ha.getGraphY(),null,null,null,mxUtils.bind(this,function(k,u,H){return ha.state==k||this.isCellLocked(this.getLayerForCell(k.cell))&&
null==this.getLinkForCell(k.cell)}))):ha.state=null);return ha};var ua=this.isCellSelectable;this.isCellSelectable=function(ha){return null!=ha&&null!=this.getLockedGroupAncestor(this.model.getParent(ha))?!1:ua.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(ha))};this.isCellLocked=function(ha){for(;null!=ha;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(ha),"locked","0"))return!0;ha=this.model.getParent(ha)}return!1};var Da=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,
function(ha,k){"mouseDown"==k.getProperty("eventName")&&(ha=k.getProperty("event").getState(),Da=null==ha||this.isSelectionEmpty()||this.isCellSelected(ha.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(ha,k){if(!mxEvent.isMultiTouchEvent(k)){ha=k.getProperty("event");var u=k.getProperty("cell");null==u?(ha=mxUtils.convertPoint(this.container,mxEvent.getClientX(ha),mxEvent.getClientY(ha)),x.start(ha.x,ha.y)):null!=Da?this.addSelectionCells(Da):
1<this.getSelectionCount()&&this.isCellSelected(u)&&this.removeSelectionCell(u);Da=null;k.consume()}}));this.connectionHandler.selectCells=function(ha,k){this.graph.setSelectionCell(k||ha)};this.connectionHandler.constraintHandler.isStateIgnored=function(ha,k){var u=ha.view.graph;return k&&(u.isCellSelected(ha.cell)||u.isTableRow(ha.cell)&&u.selectionCellsHandler.isHandled(u.model.getParent(ha.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var ha=this.connectionHandler.constraintHandler;
@@ -2521,8 +2522,8 @@ c.referenceCell||c;R.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.page
E.push(A[K]);E=A=E;if(null!=c.startIndex||0<pageSize&&A.length>pageSize){var Q=c.startIndex||0;E=A.slice(Math.max(0,Q),Math.min(A.length,Q+pageSize))}E=p.getOpposites(E,x).concat(E);var V=R.cloneCells(E);for(K=0;K<E.length;K++)if(V[K].sourceCellId=E[K].id,R.model.isEdge(V[K]))for(V[K].geometry.x=0,V[K].geometry.y=0,V[K].geometry.points=null,V[K].setStyle(V[K].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),V[K].setTerminal(q,
null==V[K].getTerminal(!0)),x=0;x<V[K].getChildCount();x++){var J=V[K].getChildAt(x);null!=J.geometry&&J.geometry.relative&&(J.setStyle(J.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),J.geometry.offset=new mxPoint(0,0),J.geometry.y=0,J.geometry.x=.5>J.geometry.x?-.8:.5<J.geometry.x?.8:0)}if(0<c.startIndex){var ia=R.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(A.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");
ia.referenceCell=q;ia.startIndex=Math.max(0,(c.startIndex||0)-pageSize);V.splice(0,0,ia)}if(A.length>(c.startIndex||0)+pageSize){var Y=R.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(A.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");Y.referenceCell=q;Y.startIndex=(c.startIndex||0)+pageSize;V.splice(0,0,Y)}for(var aa in R.getModel().cells){var ja=R.getModel().getCell(aa);ja!=R.rootCell&&
-!R.getModel().isAncestor(R.rootCell,ja)&&R.getModel().isVertex(ja)&&R.removeCells([ja])}R.addCells(V);var ka=R.getModel().getGeometry(R.rootCell);null!=ka&&(ka=ka.clone(),ka.x=f-ka.width/2,ka.y=l-ka.height/3,R.getModel().setGeometry(R.rootCell,ka));c=[];for(aa in R.getModel().cells)ja=R.getModel().getCell(aa),ja!=R.rootCell&&R.getModel().isVertex(ja)&&R.getModel().getParent(ja)==R.getDefaultParent()&&(c.push(ja),ka=R.getModel().getGeometry(ja),null!=ka&&(ka.x=f-ka.width/2,ka.y=l-ka.height/2));var ua=
-c.length,Da=2*Math.PI/ua,ha=Math.max(minSize,Math.min(R.container.offsetWidth/2-40,R.container.offsetHeight/2-80));for(f=0;f<ua;f++)ka=R.getModel().getGeometry(c[f]),null!=ka&&(ka=ka.clone(),ka.x+=ha*Math.sin(f*Da),ka.y+=ha*Math.cos(f*Da),R.getModel().setGeometry(c[f],ka))}finally{R.getModel().endUpdate()}}}var C=document.createElement("div");C.style.position="absolute";C.style.display="block";C.style.overflow="auto";C.style.width="100%";C.style.height="100%";C.style.left="0px";C.style.top="0px";
+!R.getModel().isAncestor(R.rootCell,ja)&&R.getModel().isVertex(ja)&&R.removeCells([ja])}R.addCells(V);var la=R.getModel().getGeometry(R.rootCell);null!=la&&(la=la.clone(),la.x=f-la.width/2,la.y=l-la.height/3,R.getModel().setGeometry(R.rootCell,la));c=[];for(aa in R.getModel().cells)ja=R.getModel().getCell(aa),ja!=R.rootCell&&R.getModel().isVertex(ja)&&R.getModel().getParent(ja)==R.getDefaultParent()&&(c.push(ja),la=R.getModel().getGeometry(ja),null!=la&&(la.x=f-la.width/2,la.y=l-la.height/2));var ua=
+c.length,Da=2*Math.PI/ua,ha=Math.max(minSize,Math.min(R.container.offsetWidth/2-40,R.container.offsetHeight/2-80));for(f=0;f<ua;f++)la=R.getModel().getGeometry(c[f]),null!=la&&(la=la.clone(),la.x+=ha*Math.sin(f*Da),la.y+=ha*Math.cos(f*Da),R.getModel().setGeometry(c[f],la))}finally{R.getModel().endUpdate()}}}var C=document.createElement("div");C.style.position="absolute";C.style.display="block";C.style.overflow="auto";C.style.width="100%";C.style.height="100%";C.style.left="0px";C.style.top="0px";
C.style.zIndex=2;C.style.background=p.background==mxConstants.NONE||null==p.background?Editor.getDefaultPageBackgroundColor():p.background;var O=document.createElement("img");O.setAttribute("src",Editor.closeBlackImage);O.style.position="absolute";O.style.cursor="pointer";O.style.right="10px";O.style.top="10px";C.appendChild(O);var F=document.createElement("div");F.style.position="absolute";F.style.cursor="pointer";F.style.right="38px";F.style.top="14px";F.style.textAlign="right";F.style.verticalAlign=
"top";mxUtils.write(F,mxResources.get("close"));C.appendChild(F);document.body.appendChild(C);var N=function(R){27==R.keyCode&&O.click()};mxEvent.addListener(document,"keydown",N);(function(R){var c=new Graph(R);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(E){return this.model.isVertex(E)?"pointer":null};c.getFoldingImage=function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",N);R.parentNode.removeChild(R);
p.scrollCellToVisible(t)};mxEvent.addListener(O,"click",f);mxEvent.addListener(F,"click",f);c.setEnabled(!1);var l=c.click;c.click=function(E){var K=E.getCell(),Q=null!=K?null!=K.referenceCell?K.referenceCell:K:null;null!=K&&0<c.getEdges(Q).length?y(c,K):l.apply(this,arguments)};f=c.container.offsetWidth/2;var q=c.container.offsetHeight/3;c.model.beginUpdate();var x=c.importCells([t])[0];x.sourceCellId=t.id;x.geometry.x=f-x.geometry.width/2;x.geometry.y=q-x.geometry.height/2;c.model.endUpdate();var A=
@@ -2598,11 +2599,11 @@ Graph.prototype.measureShapeInsideFlow=function(b,d,m,p,t,n,y,C,O){var F=null;if
0));N.style.width=p.width+"px";N.style.fontFamily=mxUtils.getValue(d,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);N.style.fontSize=Math.round(C)+"px";N.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?C*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;N.style.fontWeight=(R&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"normal";N.style.fontStyle=(R&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"";N.style.textAlign=
mxUtils.getValue(d,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);N.style.whiteSpace="normal";N.style.wordWrap=mxConstants.WORD_WRAP;N.innerHTML=this.createShapeInsideMarkup(m,p,t,n,y,this.getShapeInsidePadding(d),O)+b;b=N.getBoundingClientRect();y=document.createTreeWalker(N,NodeFilter.SHOW_TEXT,null);p=m=d=null;for(t=[];y.nextNode();)for(n=document.createRange(),n.selectNodeContents(y.currentNode),C=n.getClientRects(),n=0;n<C.length;n++)0<C[n].width&&0<C[n].height&&(d=null==d?C[n].top:Math.min(d,
C[n].top),m=null==m?C[n].bottom:Math.max(m,C[n].bottom),p=null==p?C[n].right:Math.max(p,C[n].right),t.push([C[n].top-b.top,C[n].bottom-b.top]));if(null!=d){t.sort(function(c,f){return c[0]-f[0]});F=[];for(n=0;n<t.length;n++)y=0<F.length?F[F.length-1]:null,null!=y&&t[n][0]<y[1]-2?y[1]=Math.max(y[1],t[n][1]):F.push(t[n]);F={top:d-b.top,bottom:m-b.top,right:p-b.left,lines:F}}N.innerHTML=""}return F};
-Graph.prototype.computeShapeInsideSpacer=function(b,d,m,p,t,n){var y=mxUtils.getValue(d,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),C=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE))*mxConstants.LINE_HEIGHT,O=y!=mxConstants.ALIGN_BOTTOM,F=this,N=null,R=0;if(y!=mxConstants.ALIGN_TOP){var c=function(J,ia,Y){var aa=null;if(null!=J)for(var ja=0;ja<J.length;ja++){var ka=J[ja],ua=J[(ja+1)%J.length];ka[1]!=ua[1]&&ia>=Math.min(ka[1],ua[1])&&ia<=Math.max(ka[1],
-ua[1])&&(ka=ka[0]+(ua[0]-ka[0])*(ia-ka[1])/(ua[1]-ka[1]),aa=null==aa?ka:Y?Math.max(aa,ka):Math.min(aa,ka))}return aa};R=c(m.left,.999,!0);c=c(m.right,.999,!1);var f=24<=((null==c?1:c)-(null==R?0:R))*t;R=function(J){for(var ia=null,Y=[],aa=null,ja=null,ka=function(P){var T=F.measureShapeInsideFlow(b,d,m,p,P,t,n);if(null==T)return null;var W=Math.min(0,P),fa=T.top+W;W=T.bottom+W;null==N&&(N=W-fa);var X=N>p.height,ea=W<=p.height+.5&&(J||-.5<=fa),oa=null;J?X?oa=Math.abs(p.height-W):0<=P&&(oa=ea?p.height-
-W:f?1.5*(W-p.height):null):oa=ea?Math.abs(fa-(p.height-W)):Math.abs(fa+W-p.height);var la=!J||X;null!=oa&&(null==ia||la&&ea&&!ia.fits||(!la||ea==ia.fits)&&oa<ia.score)&&(ia={spacer:P,score:oa,fits:ea});P={spacer:P,top:fa,btm:W,overflow:X,lines:T.lines.length};Y.push(P);return P},ua=function(){return null!=ia&&ia.fits&&1>=ia.score},Da=0,ha=0;ha<(J?8:5);ha++){var k=ka(Da);if(null==k)return null;if(ua())break;var u=J?Da+p.height-k.btm:Da+(p.height-k.top-k.btm)/2;if(J){if(k.btm<=p.height+.5)aa=null==
-aa?Da:Math.max(aa,Da);else if(null==aa||Da>aa)ja=null==ja?Da:Math.min(ja,Da);null!=aa&&null!=ja&&1<ja-aa&&(u=(aa+ja)/2);k.overflow||(u=Math.max(0,u))}if(Math.round(u)==Math.round(Da))break;Da=u}if(!J&&!ua())for(aa=function(P,T){return P.lines==T.lines&&1>=Math.abs(T.btm-T.top-(P.btm-P.top))},ja=Y.slice().sort(function(P,T){return P.spacer-T.spacer}),Da=8,ha=0;ha<ja.length-1&&0<Da&&!ua();ha++)for(k=ja[ha],u=ja[ha+1];0<Da&&!ua()&&!aa(k,u)&&1<u.spacer-k.spacer;){var H=Math.round((k.spacer+u.spacer)/
-2);if(H<=k.spacer||H>=u.spacer)break;H=ka(H);Da--;if(null==H)break;else aa(k,H)?k=H:u=H}return ia};c=R(y==mxConstants.ALIGN_BOTTOM);y==mxConstants.ALIGN_BOTTOM&&null!=N&&N>p.height&&(null==c||!c.fits||c.score>2*C)&&(c=R(!1),O=!0);R=Math.round(null!=c?c.spacer:0)}c=function(J){var ia=null,Y=F.measureShapeInsideFlow(b,d,m,p,J,t,n);if(null!=Y&&0<Y.lines.length){J=Math.max(0,-J);for(var aa=Math.round(p.height)+J,ja=Y.lines.length;0<ja&&Y.lines[ja-1][0]>=aa-1;)ja--;ja<Y.lines.length&&(aa=0<ja?Y.lines[ja][0]-
+Graph.prototype.computeShapeInsideSpacer=function(b,d,m,p,t,n){var y=mxUtils.getValue(d,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),C=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE))*mxConstants.LINE_HEIGHT,O=y!=mxConstants.ALIGN_BOTTOM,F=this,N=null,R=0;if(y!=mxConstants.ALIGN_TOP){var c=function(J,ia,Y){var aa=null;if(null!=J)for(var ja=0;ja<J.length;ja++){var la=J[ja],ua=J[(ja+1)%J.length];la[1]!=ua[1]&&ia>=Math.min(la[1],ua[1])&&ia<=Math.max(la[1],
+ua[1])&&(la=la[0]+(ua[0]-la[0])*(ia-la[1])/(ua[1]-la[1]),aa=null==aa?la:Y?Math.max(aa,la):Math.min(aa,la))}return aa};R=c(m.left,.999,!0);c=c(m.right,.999,!1);var f=24<=((null==c?1:c)-(null==R?0:R))*t;R=function(J){for(var ia=null,Y=[],aa=null,ja=null,la=function(P){var U=F.measureShapeInsideFlow(b,d,m,p,P,t,n);if(null==U)return null;var W=Math.min(0,P),fa=U.top+W;W=U.bottom+W;null==N&&(N=W-fa);var X=N>p.height,ea=W<=p.height+.5&&(J||-.5<=fa),oa=null;J?X?oa=Math.abs(p.height-W):0<=P&&(oa=ea?p.height-
+W:f?1.5*(W-p.height):null):oa=ea?Math.abs(fa-(p.height-W)):Math.abs(fa+W-p.height);var ka=!J||X;null!=oa&&(null==ia||ka&&ea&&!ia.fits||(!ka||ea==ia.fits)&&oa<ia.score)&&(ia={spacer:P,score:oa,fits:ea});P={spacer:P,top:fa,btm:W,overflow:X,lines:U.lines.length};Y.push(P);return P},ua=function(){return null!=ia&&ia.fits&&1>=ia.score},Da=0,ha=0;ha<(J?8:5);ha++){var k=la(Da);if(null==k)return null;if(ua())break;var u=J?Da+p.height-k.btm:Da+(p.height-k.top-k.btm)/2;if(J){if(k.btm<=p.height+.5)aa=null==
+aa?Da:Math.max(aa,Da);else if(null==aa||Da>aa)ja=null==ja?Da:Math.min(ja,Da);null!=aa&&null!=ja&&1<ja-aa&&(u=(aa+ja)/2);k.overflow||(u=Math.max(0,u))}if(Math.round(u)==Math.round(Da))break;Da=u}if(!J&&!ua())for(aa=function(P,U){return P.lines==U.lines&&1>=Math.abs(U.btm-U.top-(P.btm-P.top))},ja=Y.slice().sort(function(P,U){return P.spacer-U.spacer}),Da=8,ha=0;ha<ja.length-1&&0<Da&&!ua();ha++)for(k=ja[ha],u=ja[ha+1];0<Da&&!ua()&&!aa(k,u)&&1<u.spacer-k.spacer;){var H=Math.round((k.spacer+u.spacer)/
+2);if(H<=k.spacer||H>=u.spacer)break;H=la(H);Da--;if(null==H)break;else aa(k,H)?k=H:u=H}return ia};c=R(y==mxConstants.ALIGN_BOTTOM);y==mxConstants.ALIGN_BOTTOM&&null!=N&&N>p.height&&(null==c||!c.fits||c.score>2*C)&&(c=R(!1),O=!0);R=Math.round(null!=c?c.spacer:0)}c=function(J){var ia=null,Y=F.measureShapeInsideFlow(b,d,m,p,J,t,n);if(null!=Y&&0<Y.lines.length){J=Math.max(0,-J);for(var aa=Math.round(p.height)+J,ja=Y.lines.length;0<ja&&Y.lines[ja-1][0]>=aa-1;)ja--;ja<Y.lines.length&&(aa=0<ja?Y.lines[ja][0]-
Y.lines[ja-1][1]:0,Y.lines[Y.lines.length-1][1]-Y.lines[ja][0]<=2*C+2&&(0==ja||2<aa)&&(ia=0<ja?Y.lines[ja-1][1]-J:0))}return ia};var l=c(R);if(null!=l&&y!=mxConstants.ALIGN_TOP){y=function(J,ia){ia=Math.min(0,ia);return O?Math.abs(p.height-(J.top+ia)-(J.bottom+ia)):Math.abs(p.height-(J.bottom+ia))};for(var q=this.measureShapeInsideFlow(b,d,m,p,R,t,n,null,l),x=0;3>x&&null!=q;x++){var A=Math.min(0,R);A=Math.round(O?(p.height-(q.top+A)-(q.bottom+A))/2:p.height-(q.bottom+A));for(var E=!1,K=0;2>K&&0!=
A;K++){var Q=c(R+A);Q=null!=Q?Q:l+A;var V=this.measureShapeInsideFlow(b,d,m,p,R+A,t,n,null,Q);if(null!=V&&y(V,R+A)<y(q,R)&&(O||V.bottom+Math.min(0,R+A)<=p.height+.5)){R+=A;l=Q;q=V;E=!0;break}A=Math.round(A/2)}if(!E)break}}return{spacer:Math.round(R),clip:null!=l?Math.round(l):null}};
Graph.prototype.computeShapeInsideFontSize=function(b,d,m,p,t){var n=this.getShapeInsideBox(d,p,t);if(null==this.measureShapeInsideFlow(b,d,m,n,0,p,t,1))return null;for(var y=1,C=84;y<C;){var O=Math.ceil((y+C)/2),F=this.measureShapeInsideFlow(b,d,m,n,0,p,t,O);null!=F&&F.bottom<=n.height+.5&&F.right<=n.width+.5?y=O:C=O-1}return Math.max(6,y)};
@@ -2652,7 +2653,7 @@ this.setCellStyles("elbow",O==mxConstants.DIRECTION_SOUTH||O==mxConstants.DIRECT
C.getCenterX(),N=C.getCenterY(),R=Math.max(C.width,C.height)+100;y=O.getPerimeterPoint(C,new mxPoint(F+R,N),!1);var c=O.getPerimeterPoint(C,new mxPoint(F-R,N),!1),f=O.getPerimeterPoint(C,new mxPoint(F,N-R),!1);O=O.getPerimeterPoint(C,new mxPoint(F,N+R),!1);f=null!=f&&null!=O&&Math.abs(f.y-O.y)<C.height/4;return null!=y&&null!=c&&Math.abs(y.x-c.x)<C.width/4?"x":f?"y":null};Graph.prototype.loopHasFixedAnchorLine=function(y){return null!=this.getLoopFixedAxis(y)};Graph.prototype.getLoopAroundPoints=
function(y,C){var O=null!=y?y.getVisibleTerminalState(!0):null,F=null!=y?this.getCellGeometry(y.cell):null;if(null==O||null==C||null==F)return null;var N=y.view.scale,R=y.view.translate,c=y.origin,f=O.x/N-R.x-c.x,l=O.y/N-R.y-c.y,q=O.width/N,x=O.height/N,A=new mxPoint(C.x/N-R.x-c.x,C.y/N-R.y-c.y);var E=y.absolutePoints;null!=F.points&&2<=F.points.length?(C=F.points[0],E=F.points[F.points.length-1]):null!=E&&4<=E.length?(C=new mxPoint(E[1].x/N-R.x-c.x,E[1].y/N-R.y-c.y),E=new mxPoint(E[E.length-2].x/
N-R.x-c.x,E[E.length-2].y/N-R.y-c.y)):(C=new mxPoint(f+q/2,l+x/2-this.gridSize),E=new mxPoint(f+q/2,l+x/2+this.gridSize));F=Math.abs(C.x-E.x)>=Math.abs(C.y-E.y);C=Math.max(this.gridSize,F?Math.abs(C.x-E.x):Math.abs(C.y-E.y));var K=this.gridSize;E=this.loopHasFixedAnchorLine(y);var Q=y.absolutePoints;Q=null!=Q&&null!=Q[0]?new mxPoint(Q[0].x/N-R.x-c.x,Q[0].y/N-R.y-c.y):null;if(E&&null!=Q){if(F)return l=A.y>=Q.y?Math.max(Q.y+K,A.y):Math.min(Q.y-K,A.y),[new mxPoint(A.x-C/2,l),new mxPoint(A.x+C/2,l)];
-Q=A.x>=Q.x?Math.max(Q.x+K,A.x):Math.min(Q.x-K,A.x);return[new mxPoint(Q,A.y-C/2),new mxPoint(Q,A.y+C/2)]}var V=f+q/2,J=l+x/2,ia=function(Y,aa,ja){Y=y.view.getPerimeterPoint(O,new mxPoint((Y+R.x+c.x)*N,(aa+R.y+c.y)*N),ja);return null!=Y?new mxPoint(Y.x/N-R.x-c.x,Y.y/N-R.y-c.y):null};F=function(Y,aa,ja,ka){Y=ia(Y,aa,!0);ja=ia(ja,ka,!0);return null==Y||null==ja||2>Math.abs(Y.x-V)&&2>Math.abs(Y.y-J)||2>Math.abs(ja.x-V)&&2>Math.abs(ja.y-J)?!0:Math.abs(Y.x-ja.x)<K/2&&Math.abs(Y.y-ja.y)<K/2};E=ia(A.x,A.y,
+Q=A.x>=Q.x?Math.max(Q.x+K,A.x):Math.min(Q.x-K,A.x);return[new mxPoint(Q,A.y-C/2),new mxPoint(Q,A.y+C/2)]}var V=f+q/2,J=l+x/2,ia=function(Y,aa,ja){Y=y.view.getPerimeterPoint(O,new mxPoint((Y+R.x+c.x)*N,(aa+R.y+c.y)*N),ja);return null!=Y?new mxPoint(Y.x/N-R.x-c.x,Y.y/N-R.y-c.y):null};F=function(Y,aa,ja,la){Y=ia(Y,aa,!0);ja=ia(ja,la,!0);return null==Y||null==ja||2>Math.abs(Y.x-V)&&2>Math.abs(Y.y-J)||2>Math.abs(ja.x-V)&&2>Math.abs(ja.y-J)?!0:Math.abs(Y.x-ja.x)<K/2&&Math.abs(Y.y-ja.y)<K/2};E=ia(A.x,A.y,
!1);if(null==E||1>Math.abs(E.x-V)&&1>Math.abs(E.y-J))E=new mxPoint(V,J);if(Math.abs(E.y-J)>=Math.abs(E.x-V)){C=Math.max(this.gridSize,Math.min(C,q));l=E.y>=J?Math.max(E.y+K,A.y):Math.min(E.y-K,A.y);A=Math.max(f+C/2,Math.min(f+q-C/2,A.x));for(f=0;f<=q/this.gridSize&&F(A-C/2,l,A+C/2,l);f++)A=A<V?Math.min(V,A+this.gridSize):Math.max(V,A-this.gridSize);E=E.y>=J?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&F(A-C/2,l,A+C/2,l);f++)l+=E;return[new mxPoint(A-C/2,l),new mxPoint(A+C/2,l)]}C=
Math.max(this.gridSize,Math.min(C,x));Q=E.x>=V?Math.max(E.x+K,A.x):Math.min(E.x-K,A.x);l=Math.max(l+C/2,Math.min(l+x-C/2,A.y));for(f=0;f<=x/this.gridSize&&F(Q,l-C/2,Q,l+C/2);f++)l=l<J?Math.min(J,l+this.gridSize):Math.max(J,l-this.gridSize);A=E.x>=V?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&F(Q,l-C/2,Q,l+C/2);f++)Q+=A;return[new mxPoint(Q,l-C/2),new mxPoint(Q,l+C/2)]};Graph.prototype.keepLoopOutsideShape=function(y,C){var O=null!=y?y.getVisibleTerminalState(!0):null;if(null==O||
null==C||0==C.length)return C;var F=y.view.scale,N=y.view.translate,R=y.origin,c=O.x/F-N.x-R.x,f=O.y/F-N.y-R.y,l=O.width/F,q=O.height/F;if(this.loopHasFixedAnchorLine(y))return C;c+=l/2;f+=q/2;q=this.gridSize;l=[];for(var x=0;x<C.length;x++){var A=C[x];if(null==A)l.push(A);else{var E=new mxPoint(A.x,A.y),K=y.view.getPerimeterPoint(O,new mxPoint((A.x+N.x+R.x)*F,(A.y+N.y+R.y)*F),!1);if(null!=K){var Q=K.x/F-N.x-R.x;K=K.y/F-N.y-R.y;var V=A.x-c;A=A.y-f;var J=Math.sqrt(V*V+A*A);J<Math.sqrt((Q-c)*(Q-c)+
@@ -2662,7 +2663,7 @@ function(y){return this.getCellStyle(y,!1)};Graph.prototype.pasteStyle=function(
C[x]),"strokeColor"!=C[x]||null!=O[x]&&"none"!=O[x])if(0<=mxUtils.indexOf(Graph.cellStyles,C[x])||"shape"==C[x])if("shape"!=C[x]&&(l||y&&!R)&&!f&&(null==O[x]?delete F[C[x]]:F[C[x]]=O[x]),q||y&&!c)null==O[x]?delete N[C[x]]:N[C[x]]=O[x]};Graph.prototype.includeDescendants=function(y){for(var C=[],O=0;O<y.length;O++)C=C.concat(this.model.getDescendants(y[O]));return C};Graph.prototype.includeDescendantParts=function(y){for(var C=y.slice(),O=mxUtils.bind(this,function(N){for(var R=0;R<this.model.getChildCount(N);R++){var c=
this.model.getChildAt(N,R);"1"==mxUtils.getValue(this.getCurrentCellStyle(c),"part","0")&&(C.push(c),O(c))}}),F=0;F<y.length;F++)O(y[F]);return C};Graph.prototype.pasteCellStyles=function(y,C,O,F,N,R){C=null!=C?C:this.currentVertexStyle;O=null!=O?O:this.currentEdgeStyle;N=null!=N?N:this.pasteEdgeStyle;R=null!=R?R:this.pasteStylesToText;this.model.beginUpdate();try{for(var c=0;c<y.length;c++){var f=y[c],l=this.model.getStyle(f),q=!1;null!=f.style&&"string"===typeof f.style&&(pairs=f.style.split(";"),
q=q||0<=mxUtils.indexOf(pairs,"text"));var x=this.model.isVertex(f)&&this.model.isEdge(this.model.getParent(f));if(q||x)var A=q&&!x&&R?Graph.cellStyles:Graph.textStyles;else if(A=Graph.cellStyles.slice(),!F)for(var E="string"===typeof l?l.split(";"):[],K=0;K<E.length;K++){var Q=E[K],V=Q.indexOf("=");if(0<=V){var J=Q.substring(0,V),ia=mxUtils.indexOf(A,J);0<=ia&&A.splice(ia,1);for(q=0;q<Graph.cellStyleGroups.length;q++){var Y=Graph.cellStyleGroups[q];if(0<=mxUtils.indexOf(Y,J))for(var aa=0;aa<Y.length;aa++){var ja=
-mxUtils.indexOf(A,Y[aa]);0<=ja&&A.splice(ja,1)}}}}var ka=this.model.isEdge(f);q=ka||x?O:C;for(K=0;K<A.length;K++){J=A[K];var ua=q[J];if("edgeStyle"!=J||N)if(ka||!ka&&0>mxUtils.indexOf(Graph.edgeStyles,J))null!=ua?(l=mxUtils.setStyle(l,J,ua),"fontFamily"==J&&null==q.fontSource&&(l=mxUtils.setStyle(l,"fontSource",null)),ka&&"rounded"==J&&"1"==ua&&null==q.curved&&(l=mxUtils.setStyle(l,"curved",null))):F&&(l=mxUtils.setStyle(l,J,null))}Editor.simpleLabels&&(l=mxUtils.setStyle(mxUtils.setStyle(l,"html",
+mxUtils.indexOf(A,Y[aa]);0<=ja&&A.splice(ja,1)}}}}var la=this.model.isEdge(f);q=la||x?O:C;for(K=0;K<A.length;K++){J=A[K];var ua=q[J];if("edgeStyle"!=J||N)if(la||!la&&0>mxUtils.indexOf(Graph.edgeStyles,J))null!=ua?(l=mxUtils.setStyle(l,J,ua),"fontFamily"==J&&null==q.fontSource&&(l=mxUtils.setStyle(l,"fontSource",null)),la&&"rounded"==J&&"1"==ua&&null==q.curved&&(l=mxUtils.setStyle(l,"curved",null))):F&&(l=mxUtils.setStyle(l,J,null))}Editor.simpleLabels&&(l=mxUtils.setStyle(mxUtils.setStyle(l,"html",
null),"whiteSpace",null));this.model.setStyle(f,l)}}finally{this.model.endUpdate()}return y};Graph.prototype.pasteTextStyles=function(y,C){this.model.beginUpdate();try{for(var O=0;O<y.length;O++){var F=y[O];if(this.model.isVertex(F)||this.model.isEdge(F)){for(var N=this.model.getStyle(F),R=0;R<Graph.pasteTextStyles.length;R++){var c=Graph.pasteTextStyles[R],f=C[c];null!=f&&(N=mxUtils.setStyle(N,c,f),"fontFamily"==c&&null==C.fontSource&&(N=mxUtils.setStyle(N,"fontSource",null)))}Editor.simpleLabels&&
(N=mxUtils.setStyle(mxUtils.setStyle(N,"html",null),"whiteSpace",null));this.model.setStyle(F,N)}}}finally{this.model.endUpdate()}return y};Graph.prototype.updateCellStyles=function(y,C){this.model.beginUpdate();try{for(var O=0;O<C.length;O++)if(this.model.isVertex(C[O])||this.model.isEdge(C[O])){var F=this.getCellStyle(C[O],!1),N=F[mxConstants.STYLE_PERIMETER],R=!1;for(f in y){var c=y[f];if(F[f]!=c){if(f==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[f]&&"umlLifeline"!=c){R=!0;var f="participant"}this.setCellStyles(f,
c,[C[O]])}}R&&this.setCellStyles(mxConstants.STYLE_PERIMETER,N,[C[O]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(y,C,O,F,N,R){this.useCssTransforms&&
@@ -2886,11 +2887,11 @@ q=!0}}return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=th
arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());return c};var t=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return t.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var n=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){n.apply(this,arguments);if(this.graph.model.isVertex(c.cell)&&null!=this.graph.isTransparentBounds&&
this.graph.isTransparentBounds(c.cell)){var f=this.graph.getTransparentBounds(c.cell);null!=f?(c.x=this.scale*(this.translate.x+c.origin.x+f.x),c.y=this.scale*(this.translate.y+c.origin.y+f.y),c.width=this.scale*f.width,c.height=this.scale*f.height,c.unscaledWidth=f.width,c.unscaledHeight=f.height):(c.width=0,c.height=0,c.unscaledWidth=0,c.unscaledHeight=0)}this.graph.model.isEdge(c.cell)&&1!=c.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(c)};var y=mxMorphing.prototype.getDelta;mxMorphing.prototype.getDelta=
function(c){return null!=c&&null!=c.cell&&null!=this.graph.isTransparentBounds&&this.graph.isTransparentBounds(c.cell)?new mxPoint(0,0):y.apply(this,arguments)};mxGraphView.prototype.updateLineJumps=function(c){var f=c.absolutePoints;if(Graph.lineJumpsEnabled){var l=null!=c.routedPoints,q=null;if(null!=f&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var x=function(ha,k,u){var H=new mxPoint(k,u);H.type=ha;q.push(H);H=null!=c.routedPoints?c.routedPoints[q.length-1]:
-null;return null==H||H.type!=ha||H.x!=k||H.y!=u},A=.5*this.scale;l=!1;q=[];for(var E=0;E<f.length-1;E++){for(var K=f[E+1],Q=f[E],V=[],J=f[E+2];E<f.length-2&&mxUtils.ptSegDistSq(Q.x,Q.y,J.x,J.y,K.x,K.y)<1*this.scale*this.scale;)K=J,E++,J=f[E+2];l=x(0,Q.x,Q.y)||l;for(var ia=0;ia<this.validEdges.length;ia++){var Y=this.validEdges[ia],aa=Y.absolutePoints;if(null!=aa&&mxUtils.intersects(c,Y)&&"1"!=Y.style.noJump){var ja=null;for(Y=0;Y<aa.length-1;Y++){var ka=aa[Y+1],ua=aa[Y];for(J=aa[Y+2];Y<aa.length-
-2&&mxUtils.ptSegDistSq(ua.x,ua.y,J.x,J.y,ka.x,ka.y)<1*this.scale*this.scale;)ka=J,Y++,J=aa[Y+2];var Da=mxUtils.intersection(Q.x,Q.y,K.x,K.y,ua.x,ua.y,ka.x,ka.y);if(null!=Da&&(Math.abs(Da.x-Q.x)>A||Math.abs(Da.y-Q.y)>A)&&(Math.abs(Da.x-K.x)>A||Math.abs(Da.y-K.y)>A)&&(null==ja||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ja.x,ja.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ua.x,ua.y)>A)&&(null==J||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,J.x,J.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ka.x,ka.y)>A)){J=Da.x-Q.x;ja=Da.y-
+null;return null==H||H.type!=ha||H.x!=k||H.y!=u},A=.5*this.scale;l=!1;q=[];for(var E=0;E<f.length-1;E++){for(var K=f[E+1],Q=f[E],V=[],J=f[E+2];E<f.length-2&&mxUtils.ptSegDistSq(Q.x,Q.y,J.x,J.y,K.x,K.y)<1*this.scale*this.scale;)K=J,E++,J=f[E+2];l=x(0,Q.x,Q.y)||l;for(var ia=0;ia<this.validEdges.length;ia++){var Y=this.validEdges[ia],aa=Y.absolutePoints;if(null!=aa&&mxUtils.intersects(c,Y)&&"1"!=Y.style.noJump){var ja=null;for(Y=0;Y<aa.length-1;Y++){var la=aa[Y+1],ua=aa[Y];for(J=aa[Y+2];Y<aa.length-
+2&&mxUtils.ptSegDistSq(ua.x,ua.y,J.x,J.y,la.x,la.y)<1*this.scale*this.scale;)la=J,Y++,J=aa[Y+2];var Da=mxUtils.intersection(Q.x,Q.y,K.x,K.y,ua.x,ua.y,la.x,la.y);if(null!=Da&&(Math.abs(Da.x-Q.x)>A||Math.abs(Da.y-Q.y)>A)&&(Math.abs(Da.x-K.x)>A||Math.abs(Da.y-K.y)>A)&&(null==ja||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ja.x,ja.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ua.x,ua.y)>A)&&(null==J||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,J.x,J.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,la.x,la.y)>A)){J=Da.x-Q.x;ja=Da.y-
Q.y;Da={distSq:J*J+ja*ja,x:Da.x,y:Da.y};J=V.length;for(ja=0;ja<V.length;ja++)if(V[ja].distSq>Da.distSq){J=ja;break}(0==J||Math.abs(V[J-1].x-Da.x)>A||Math.abs(V[J-1].y-Da.y)>A)&&(J==V.length||Math.abs(V[J].x-Da.x)>A||Math.abs(V[J].y-Da.y)>A)&&V.splice(J,0,Da)}ja=ua}}}for(Y=0;Y<V.length;Y++)l=x(1,V[Y].x,V[Y].y)||l}Da=f[f.length-1];l=x(0,Da.x,Da.y)||l}c.routedPoints=q;return l}return!1};var C=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,f,l){this.routedPoints=null!=this.state?
this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)C.apply(this,arguments);else{var q=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,x=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,A=mxUtils.getValue(this.style,"jumpStyle","none"),E=!0,K=null,Q=null,V=[],J=null;c.begin();for(var ia=0;ia<this.state.routedPoints.length;ia++){var Y=
-this.state.routedPoints[ia],aa=new mxPoint(Y.x/this.scale,Y.y/this.scale);0==ia?aa=f[0]:ia==this.state.routedPoints.length-1&&(aa=f[f.length-1]);var ja=!1;if(null!=K&&1==Y.type){var ka=this.state.routedPoints[ia+1];Y=ka.x/this.scale-aa.x;ka=ka.y/this.scale-aa.y;Y=Y*Y+ka*ka;null==J&&(J=new mxPoint(aa.x-K.x,aa.y-K.y),Q=Math.sqrt(J.x*J.x+J.y*J.y),0<Q?(J.x=J.x*x/Q,J.y=J.y*x/Q):J=null);Y>x*x&&0<Q&&(Y=K.x-aa.x,ka=K.y-aa.y,Y=Y*Y+ka*ka,Y>x*x&&(ja=new mxPoint(aa.x-J.x,aa.y-J.y),Y=new mxPoint(aa.x+J.x,aa.y+
+this.state.routedPoints[ia],aa=new mxPoint(Y.x/this.scale,Y.y/this.scale);0==ia?aa=f[0]:ia==this.state.routedPoints.length-1&&(aa=f[f.length-1]);var ja=!1;if(null!=K&&1==Y.type){var la=this.state.routedPoints[ia+1];Y=la.x/this.scale-aa.x;la=la.y/this.scale-aa.y;Y=Y*Y+la*la;null==J&&(J=new mxPoint(aa.x-K.x,aa.y-K.y),Q=Math.sqrt(J.x*J.x+J.y*J.y),0<Q?(J.x=J.x*x/Q,J.y=J.y*x/Q):J=null);Y>x*x&&0<Q&&(Y=K.x-aa.x,la=K.y-aa.y,Y=Y*Y+la*la,Y>x*x&&(ja=new mxPoint(aa.x-J.x,aa.y-J.y),Y=new mxPoint(aa.x+J.x,aa.y+
J.y),V.push(ja),this.addPoints(c,V,l,q,!1,null,E),V=0>Math.round(J.x)||0==Math.round(J.x)&&0>=Math.round(J.y)?1:-1,E=!1,"sharp"==A?(c.lineTo(ja.x-J.y*V,ja.y+J.x*V),c.lineTo(Y.x-J.y*V,Y.y+J.x*V),c.lineTo(Y.x,Y.y)):"line"==A?(c.moveTo(ja.x+J.y*V,ja.y-J.x*V),c.lineTo(ja.x-J.y*V,ja.y+J.x*V),c.moveTo(Y.x-J.y*V,Y.y+J.x*V),c.lineTo(Y.x+J.y*V,Y.y-J.x*V),c.moveTo(Y.x,Y.y)):"arc"==A?(V*=1.3,c.curveTo(ja.x-J.y*V,ja.y+J.x*V,Y.x-J.y*V,Y.y+J.x*V,Y.x,Y.y)):(c.moveTo(Y.x,Y.y),E=!0),V=[Y],ja=!0))}else J=null;ja||
(V.push(aa),K=aa)}this.addPoints(c,V,l,q,!1,null,E);c.stroke()}};var O=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(c,f,l,q){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):O.apply(this,arguments)};var F=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,l,q){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)F.apply(this,
arguments);else{f=this.getTerminalPort(c,f,q);var x=this.getNextPoint(c,l,q),A=this.graph.isOrthogonal(c),E=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||"0")),K=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=E){var Q=Math.cos(-E),V=Math.sin(-E);x=mxUtils.getRotatedPoint(x,Q,V,K)}Q=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);Q+=parseFloat(c.style[q?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);x=this.getPerimeterPoint(f,
@@ -3024,8 +3025,8 @@ ra.getSvgShapeOffset(Ya.shape,Jb),0!=Qa)){for(var db=da&&null==eb,lb=Ya.cell;!db
mxUtils.getLightDarkColor(z),Cb=Graph.createSvgNode(0,0,Yb,Sb,Qb),Gb=Cb.ownerDocument;if(null!=z){var Kb=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"rect");Kb.setAttribute("fill",Qb.light);Kb.style.fill=Qb.cssText;Kb.setAttribute("width","100%");Kb.setAttribute("height","100%");Kb.setAttribute("x","0");Kb.setAttribute("y","0");Cb.appendChild(Kb)}var cc=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"g");Cb.appendChild(cc);var Pb=this.createSvgCanvas(cc),dc=Math.floor((M/L-yb.x/qb)*S)/S,g=Math.floor((M/
L-yb.y/qb)*S)/S;Pb.translate(dc,g);Pb.idPrefix="drawio-svg-"+Editor.guid();if(sb){var r=this.gridSize*L,D=this.view.gridSteps*r;z=[];for(gb=1;gb<this.view.gridSteps;gb++)M=gb*r,z.push("M 0 "+M+" L "+D+" "+M+" M "+M+" 0 L "+M+" "+D);var v=mxUtils.getLightDarkColor(this.view.gridColor),B=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"pattern");B.setAttribute("id",Pb.idPrefix+"-grid");B.setAttribute("patternUnits","userSpaceOnUse");B.setAttribute("width",D);B.setAttribute("height",D);B.setAttribute("x",
mxUtils.mod((tb.x+dc)*L,D));B.setAttribute("y",mxUtils.mod((tb.y+g)*L,D));if(0<z.length){var G=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"path");G.setAttribute("d",z.join(" "));G.setAttribute("fill","none");G.setAttribute("stroke",v.light);G.style.stroke=v.cssText;G.setAttribute("opacity","0.2");G.setAttribute("stroke-width",L);B.appendChild(G)}var I=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"path");I.setAttribute("d","M "+D+" 0 L 0 0 0 "+D);I.setAttribute("fill","none");I.setAttribute("stroke",
-v.light);I.style.stroke=v.cssText;I.setAttribute("stroke-width",L);B.appendChild(I);Pb.defs.appendChild(B);var ba=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"rect");ba.setAttribute("width","100%");ba.setAttribute("height","100%");ba.setAttribute("fill","url(#"+B.getAttribute("id")+")");Cb.insertBefore(ba,cc)}var U=document.createElement("div"),za=Pb.getAlternateText;Pb.getAlternateText=function(Qa,Ya,db,lb,ob,nb,ec,hc,fc,gc,ic,jc,kc){if(null!=nb&&0<this.state.fontSize)try{return mxUtils.isNode(nb)?
-nb=nb.innerText:(U.innerHTML=nb,nb=mxUtils.extractTextWithWhitespace(U.childNodes)),nb}catch(lc){return za.apply(this,arguments)}else return za.apply(this,arguments)};if(null!=xb&&null!=xb.width&&null!=xb.height){gb=qb/L;var pa=new mxRectangle((xb.x+tb.x)*gb,(xb.y+tb.y)*gb,xb.width*gb,xb.height*gb);mxUtils.intersects(yb,pa)&&Pb.image(xb.x+tb.x,xb.y+tb.y,xb.width,xb.height,xb.src,!0)}Pb.scale(S);Pb.textEnabled=na;ra=null!=ra?ra:this.createSvgImageExport();var Xa=ra.getLinkForCellState;ra.getLinkForCellState=
+v.light);I.style.stroke=v.cssText;I.setAttribute("stroke-width",L);B.appendChild(I);Pb.defs.appendChild(B);var ca=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"rect");ca.setAttribute("width","100%");ca.setAttribute("height","100%");ca.setAttribute("fill","url(#"+B.getAttribute("id")+")");Cb.insertBefore(ca,cc)}var T=document.createElement("div"),za=Pb.getAlternateText;Pb.getAlternateText=function(Qa,Ya,db,lb,ob,nb,ec,hc,fc,gc,ic,jc,kc){if(null!=nb&&0<this.state.fontSize)try{return mxUtils.isNode(nb)?
+nb=nb.innerText:(T.innerHTML=nb,nb=mxUtils.extractTextWithWhitespace(T.childNodes)),nb}catch(lc){return za.apply(this,arguments)}else return za.apply(this,arguments)};if(null!=xb&&null!=xb.width&&null!=xb.height){gb=qb/L;var pa=new mxRectangle((xb.x+tb.x)*gb,(xb.y+tb.y)*gb,xb.width*gb,xb.height*gb);mxUtils.intersects(yb,pa)&&Pb.image(xb.x+tb.x,xb.y+tb.y,xb.width,xb.height,xb.src,!0)}Pb.scale(S);Pb.textEnabled=na;ra=null!=ra?ra:this.createSvgImageExport();var Xa=ra.getLinkForCellState;ra.getLinkForCellState=
function(Qa,Ya){var db=Qa.view.graph.getAbsoluteUrl(Xa.apply(this,arguments));return null==db||Qa.view.graph.isCustomLink(db)?null:Graph.sanitizeLink(db)};ra.getLinkTargetForCellState=function(Qa,Ya){return Qa.view.graph.getLinkTargetForCell(Qa.cell)};var vb=ra.drawCellState,jb=null,Sa=mxUtils.bind(this,function(){if(null==jb){jb="ge-flow-animation-"+Editor.guid();var Qa=null!=Gb.createElementNS?Gb.createElementNS(mxConstants.NS_SVG,"style"):Gb.createElement("style");Qa.innerHTML=this.createFlowAnimationCss(jb);
Gb.getElementsByTagName("defs")[0].appendChild(Qa)}return jb});ra.drawCellState=function(Qa,Ya){for(var db=Qa.view.graph,lb=null!=eb?eb.get(Qa.cell):db.isCellSelected(Qa.cell),ob=db.model.getParent(Qa.cell);!(da&&null==eb||lb)&&null!=ob;)lb=null!=eb?eb.get(ob):db.isCellSelected(ob),ob=db.model.getParent(ob);if(null!=Qa.shape)try{var nb=Qa.shape.isFlowAnimationEnabled,ec=Qa.shape.addFlowAnimationToShape;Qa.shape.isFlowAnimationEnabled=function(){return bb&&db.model.isEdge(Qa.cell)&&"1"==mxUtils.getValue(Qa.style,
"flowAnimation","0")};Qa.shape.addFlowAnimationToShape=function(){db.addFlowAnimationToNode(this.getFlowAnimationPath(),Qa.style,L,Sa())};if(da&&null==eb||lb)db.view.redrawEnumerationState(Qa),vb.apply(this,arguments),this.doDrawShape(Qa.secondLabel,Ya)}finally{Qa.shape.isFlowAnimationEnabled=nb,Qa.shape.addFlowAnimationToShape=ec}};var Va=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;ra.drawState(this.getView().getState(Va),Pb);this.addForeignObjectWarning(Pb,Cb);Graph.inlineSingleUseImages(Cb);
@@ -3092,7 +3093,7 @@ mxConstants.DEFAULT_FONTFAMILY,S[mxConstants.STYLE_FONTSTYLE],"wrap"==S[mxConsta
"",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",ja.apply(this,arguments))};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(z,L){if("0"==mxUtils.getValue(z.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var M=this.graph.getEditingValue(z.cell,L);"1"==mxUtils.getValue(z.style,
"nl2Br","1")&&(M=M.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(M,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(z,L){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(z.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=
function(z){this.removeShapeInsideNodes();if("0"==mxUtils.getValue(z.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var L=Graph.sanitizeHtml(this.textarea.innerHTML,!0);Editor.optimizeHtmlLabels&&(L=Graph.optimizeHtml(L));"1"==mxUtils.getValue(z.style,"nl2Br","1")?(L=L.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<L.length&&("<br/>"==L.substring(L.length-5)||"<br>"==L.substring(L.length-4))&&(L=L.substring(0,
-L.lastIndexOf("<br"))+"<div><br/></div>")):L=L.replace(/\r\n/g,"").replace(/\n/g,"");return L};var ka=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(z){null!=this.shapeInsideListener&&(null!=this.textarea&&mxEvent.removeListener(this.textarea,"input",this.shapeInsideListener),this.shapeInsideAlign=this.shapeInsideListener=null);this.codeViewMode&&this.toggleViewMode();ka.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(z){}};
+L.lastIndexOf("<br"))+"<div><br/></div>")):L=L.replace(/\r\n/g,"").replace(/\n/g,"");return L};var la=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(z){null!=this.shapeInsideListener&&(null!=this.textarea&&mxEvent.removeListener(this.textarea,"input",this.shapeInsideListener),this.shapeInsideAlign=this.shapeInsideListener=null);this.codeViewMode&&this.toggleViewMode();la.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(z){}};
var ua=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(z,L){this.graph.getModel().beginUpdate();try{ua.apply(this,arguments),""==L&&this.graph.isCellDeletable(z.cell)&&0==this.graph.model.getChildCount(z.cell)&&this.graph.isTransparentState(z)&&this.graph.removeCells([z.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(z){z=mxUtils.getValue(z.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);z==mxConstants.NONE&&
(z=null);return z};mxCellEditor.prototype.getBorderColor=function(z){z=mxUtils.getValue(z.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);z==mxConstants.NONE&&(z=null);return z};mxCellEditor.prototype.getMinimumSize=function(z){var L=this.graph.getView().scale;return new mxRectangle(0,0,null==z.text?30:z.text.size*L+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(z,L){return mxGraphHandlerIsValidDropTarget.apply(this,
arguments)&&!mxEvent.isAltDown(L.getEvent)};var Da=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(z){var L=Da.apply(this,arguments);if(null!=L){var M=this.graph.getLockedGroupAncestor(this.graph.model.getParent(L));null!=M&&(L=M)}return L};var ha=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(z,L,M){var S=this.graph.model.getParent(z);if(null!=S){if(this.graph.isSelectParentFirst(S))return!this.graph.isCellSelected(S)&&
@@ -3102,11 +3103,11 @@ for(Z=0;Z<z.length;Z++)for(var da=L.model.getParent(z[Z]);null!=da&&L.isTranspar
this.currentDx)/M-L.x);L=this.roundLength((this.bounds.y+this.currentDy)/M-L.y);M=this.graph.view.unit;this.hint.innerHTML=d(z,M)+", "+d(L,M);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};
var H=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(z,L){H.apply(this,arguments);var M=this.graph.getCellStyle(z);if(null==M.childLayout){var S=this.graph.model.getParent(z),Z=null!=S?this.graph.getCellGeometry(S):null;if(null!=Z&&(M=this.graph.getCellStyle(S),"stackLayout"==M.childLayout)){var da=parseFloat(mxUtils.getValue(M,"stackBorder",mxStackLayout.prototype.border));M="1"==mxUtils.getValue(M,"horizontalStack","1");var na=this.graph.getActualStartSize(S);Z=Z.clone();
M?Z.height=L.height+na.y+na.height+2*da:Z.width=L.width+na.x+na.width+2*da;this.graph.model.setGeometry(S,Z)}}};var P=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function z(ra){M.get(ra)||(M.put(ra,!0),Z.push(ra))}for(var L=P.apply(this,arguments),M=new mxDictionary,S=this.graph.model,Z=[],da=0;da<L.length;da++){var na=L[da];this.graph.isTableCell(na)?z(S.getParent(S.getParent(na))):this.graph.isTableRow(na)&&z(S.getParent(na));
-z(na)}return Z};var T=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(z){return T.apply(this,arguments)&&!mxEvent.isControlDown(z.getEvent())&&!mxEvent.isShiftDown(z.getEvent())};var W=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return W.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};
+z(na)}return Z};var U=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(z){return U.apply(this,arguments)&&!mxEvent.isControlDown(z.getEvent())&&!mxEvent.isShiftDown(z.getEvent())};var W=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return W.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};
var fa=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(z){var L=fa.apply(this,arguments);L.stroke="#C0C0C0";L.strokewidth=1;var M=this.graph.model.getParent(this.state.cell);null!=M&&this.graph.isTransparentBounds(M)&&(L.isDashed=!0);return L};var X=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:X.apply(this,arguments)};var ea=
mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":ea.apply(this,arguments)};var oa=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){oa.apply(this,arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),
-this.selectionBorder.redraw())};var la=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(z){var L=la.apply(this,arguments);L.stroke="#C0C0C0";L.strokewidth=1;return L};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var z=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+z.x/2,this.bounds.y+this.rotationHandleVSpacing-
-z.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(z,L){return this.graph.isRecursiveVertexResize(z)&&!mxEvent.isAltDown(L.getEvent())};var ca=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(z,L,M,S,Z,da,na){na&&this.graph.isRotatedGroupResize(z)&&(this.childOffsetY=this.childOffsetX=0);ca.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(z,L){return mxEvent.isControlDown(L.getEvent())||mxEvent.isMetaDown(L.getEvent())};var sa=mxVertexHandler.prototype.isRotationHandleVisible;
+this.selectionBorder.redraw())};var ka=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(z){var L=ka.apply(this,arguments);L.stroke="#C0C0C0";L.strokewidth=1;return L};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var z=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+z.x/2,this.bounds.y+this.rotationHandleVSpacing-
+z.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(z,L){return this.graph.isRecursiveVertexResize(z)&&!mxEvent.isAltDown(L.getEvent())};var ba=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(z,L,M,S,Z,da,na){na&&this.graph.isRotatedGroupResize(z)&&(this.childOffsetY=this.childOffsetX=0);ba.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(z,L){return mxEvent.isControlDown(L.getEvent())||mxEvent.isMetaDown(L.getEvent())};var sa=mxVertexHandler.prototype.isRotationHandleVisible;
mxVertexHandler.prototype.isRotationHandleVisible=function(){return sa.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&
!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var z=this.getHandlePadding(),L=this.graph,M=L.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+this.bounds.height,function(S){return L.isConnectIconVisible(S)&&L.isEnabled()&&L.isCellConnectable(S)&&!L.isTableCell(S)&&!L.isTableRow(S)&&
!L.isTable(S)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+z.x/2+M,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+z.y/2+M)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var xa=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var z=
@@ -3127,7 +3128,7 @@ try{S.setCellStyles("lockedGroup",sb?"0":"1",[kb])}finally{S.getModel().endUpdat
!1,Z=new mxHandle(this.state,"pointer",null,Z),Z.editIconHandle=!0,Z.setPosition=function(){},Z.positionChanged=function(){},Z.reset=function(){},Z.redraw=function(){if(null!=this.shape){var eb=M.getHandlePadding(),gb=S.getNestedCornerIconOffset(kb,M.bounds.x,M.bounds.y,function(xb){return S.isEditIconVisible(xb)});eb=new mxPoint(M.bounds.x-12-eb.x/2-gb,M.bounds.y-12-eb.y/2-gb);S.isCellMovable(kb)&&(S.isLockedGroupIconVisible(kb)||S.isMoveIconVisible(kb))&&(eb.x+=24);gb=Number(null!=M.currentAlpha?
M.currentAlpha:M.state.style[mxConstants.STYLE_ROTATION]||"0");var bb=mxUtils.toRadians(gb);if(0!=bb){var yb=new mxPoint(M.state.getCenterX(),M.state.getCenterY());eb=mxUtils.getRotatedPoint(eb,Math.cos(bb),Math.sin(bb),yb)}this.shape.bounds.width=pb;this.shape.bounds.height=pb;this.shape.bounds.x=eb.x-pb/2;this.shape.bounds.y=eb.y-pb/2;this.shape.rotation=gb;this.shape.redraw()}},Z.execute=function(eb){S.startEditingAtCell(kb)},z.push(Z));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&
(null==z&&(z=[]),M=this,S=this.graph,kb=this.state.cell,pb=16,Z=new mxImageShape(new mxRectangle(0,0,pb,pb),HoverIcons.prototype.moveHandle.src),Z.preserveImageAspect=!1,Z=new mxHandle(this.state,"move",null,Z),Z.moveGroupHandle=!0,Z.setPosition=function(){},Z.positionChanged=function(){},Z.execute=function(){},Z.reset=function(){},Z.redraw=function(){if(null!=this.shape){var eb=M.getHandlePadding(),gb=S.getNestedCornerIconOffset(kb,M.bounds.x,M.bounds.y,function(yb){return S.isMoveIconVisible(yb)&&
-S.isCellMovable(yb)}),bb=M.bounds.x-12-eb.x/2-gb;eb=M.bounds.y-12-eb.y/2-gb;this.shape.bounds.width=pb;this.shape.bounds.height=pb;this.shape.bounds.x=bb-pb/2;this.shape.bounds.y=eb-pb/2;this.shape.redraw()}},z.push(Z));return null!=z?z.reverse():null};var va=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(z,L,M){Ha.apply(this,arguments);var S=this.graph;if(null!=this.parentState&&S.isTransparentBounds(this.parentState.cell)){var Z=
+S.isCellMovable(yb)}),bb=M.bounds.x-12-eb.x/2-gb;eb=M.bounds.y-12-eb.y/2-gb;this.shape.bounds.width=pb;this.shape.bounds.height=pb;this.shape.bounds.x=bb-pb/2;this.shape.bounds.y=eb-pb/2;this.shape.redraw()}},z.push(Z));return null!=z?z.reverse():null};var va=mxVertexHandler.prototype.setHandlesVisible,Ga=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(z,L,M){Ga.apply(this,arguments);var S=this.graph;if(null!=this.parentState&&S.isTransparentBounds(this.parentState.cell)){var Z=
S.view.scale,da=S.view.translate,na=this.parentState;this.parentState=na.clone();this.parentState.x=Z*(da.x+na.origin.x);this.parentState.y=Z*(da.y+na.origin.y)}for(Z=S.model.getParent(this.state.cell);null!=Z;)S.isTransparentBounds(Z)&&(da=S.selectionCellsHandler.getHandler(Z),null!=da&&null!=da.selectionBorder&&(da.selectionBorder.node.style.visibility="hidden")),Z=S.model.getParent(Z);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=
this.sizers){for(S=0;S<this.sizers.length;S++)null!=this.sizers[S]&&S!=this.index&&(this.sizers[S].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var La=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=this.sizers)for(var z=0;z<this.sizers.length;z++)null!=this.sizers[z]&&(this.sizers[z].node.style.display="");
null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}z=this.graph;for(var L=null!=this.state?z.model.getParent(this.state.cell):null;null!=L;){if(z.isTransparentBounds(L)){var M=z.selectionCellsHandler.getHandler(L);null!=M&&null!=M.selectionBorder&&(M.selectionBorder.node.style.visibility="")}L=z.model.getParent(L)}La.apply(this,arguments)};mxVertexHandler.prototype.setHandlesVisible=function(z){va.apply(this,arguments);if(null!=this.moveHandles)for(var L=
@@ -3161,7 +3162,7 @@ HoverIcons.prototype.triangleDown,Sidebar.prototype.triangleLeft=HoverIcons.prot
30;mxConnectionHandler.prototype.outlineConnect=!0;mxCellHighlight.prototype.keepOnTop=!0;mxVertexHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;var Oa=mxEdgeHandler.prototype.removePoint;
mxEdgeHandler.prototype.removePoint=function(z,L){var M=0==L;(M||null!=this.abspoints&&L==this.abspoints.length-1)&&null!=this.abspoints&&null!=this.abspoints[L]&&null==this.graph.getModel().getTerminal(z.cell,M)?this.graph.fireEvent(new mxEventObject("doubleClickEdgeTerminal","cell",z.cell,"source",M,"point",this.abspoints[L].clone())):Oa.apply(this,arguments)};var Ea=mxEdgeHandler.prototype.changePoints;mxEdgeHandler.prototype.changePoints=function(z,L,M){null!=z&&null!=L&&0<L.length&&"1"==mxUtils.getValue(this.graph.getCellStyle(z),
"libavoidRouting",null)&&this.graph.setCellStyles("libavoidRouting",null,[z]);return Ea.apply(this,arguments)};var Aa=mxEdgeSegmentHandler.prototype.getPreviewPoints;mxEdgeSegmentHandler.prototype.getPreviewPoints=function(z){if((this.isSource||this.isTarget)&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.previewEndpointDrag){var L=null;try{L=LibavoidRouting.previewEndpointDrag(this,z)}catch(M){}if(null!=L)return L}return Aa.apply(this,arguments)};var Ja=mxEdgeHandler.prototype.reset;
-mxEdgeHandler.prototype.reset=function(){"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&LibavoidRouting.endPreview(this);return Ja.apply(this,arguments)};var Ga=mxEdgeHandler.prototype.setInnerBendsOpacity;mxEdgeHandler.prototype.setInnerBendsOpacity=function(z,L,M){if(null!=this.state&&null!=z&&"1"==mxUtils.getValue(this.state.style,"libavoidRouting",null))for(var S=L;S<M;S++)null!=z[S]&&null!=z[S].node&&mxUtils.setOpacity(z[S].node,this.virtualBendOpacity);else return Ga.apply(this,
+mxEdgeHandler.prototype.reset=function(){"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&LibavoidRouting.endPreview(this);return Ja.apply(this,arguments)};var Ha=mxEdgeHandler.prototype.setInnerBendsOpacity;mxEdgeHandler.prototype.setInnerBendsOpacity=function(z,L,M){if(null!=this.state&&null!=z&&"1"==mxUtils.getValue(this.state.style,"libavoidRouting",null))for(var S=L;S<M;S++)null!=z[S]&&null!=z[S].node&&mxUtils.setOpacity(z[S].node,this.virtualBendOpacity);else return Ha.apply(this,
arguments)};var Ua=mxConnectionHandler.prototype.updateEdgeState;mxConnectionHandler.prototype.updateEdgeState=function(z,L){if(null!=this.edgeState&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.connectionWaypoints&&"1"==mxUtils.getValue(this.edgeState.style,"libavoidRouting",null))try{this.waypoints=LibavoidRouting.connectionWaypoints(this)}catch(M){this.waypoints=null}Ua.apply(this,arguments)};var ab=mxConnectionHandler.prototype.reset;mxConnectionHandler.prototype.reset=function(){"undefined"!==
typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&(LibavoidRouting.endPreview(this),this.waypoints=null);return ab.apply(this,arguments)};var Wa=mxGraphHandler.prototype.updateLivePreview;mxGraphHandler.prototype.updateLivePreview=function(z,L){Wa.apply(this,arguments);if("undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.livePreviewMove)try{LibavoidRouting.livePreviewMove(this,z,L)}catch(M){}};var cb=mxGraphHandler.prototype.reset;mxGraphHandler.prototype.reset=function(){cb.apply(this,
arguments);"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endMovePreview&&LibavoidRouting.endMovePreview(this)};mxEdgeHandler.prototype.isAddVirtualBendEvent=function(z){return!mxEvent.isShiftDown(z.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(z){return!mxEvent.isShiftDown(z.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,
@@ -3229,23 +3230,23 @@ function(){if(null!=this.marker&&(Ib.apply(this),null!=this.state&&null!=this.li
arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Db=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Db.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(g,r,D){mxShape.call(this);this.line=g;this.stroke=r;this.strokewidth=null!=D?D:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function p(){mxCylinder.call(this)}function t(){mxConnector.call(this)}function n(){mxCylinder.call(this)}function y(){mxActor.call(this)}function C(){mxCylinder.call(this)}function O(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function N(){mxCylinder.call(this)}function R(){mxShape.call(this)}
function c(){mxShape.call(this)}function f(g,r,D,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=D;this.strokewidth=null!=v?v:1}function l(){mxActor.call(this)}function q(){mxCylinder.call(this)}function x(){mxCylinder.call(this)}function A(){mxShape.call(this)}function E(){mxActor.call(this)}function K(){mxActor.call(this)}function Q(){mxActor.call(this)}function V(){mxActor.call(this)}function J(){mxActor.call(this)}function ia(){mxActor.call(this)}function Y(){mxActor.call(this)}function aa(g,
r){this.canvas=g;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=r;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,aa.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,aa.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,aa.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,aa.prototype.quadTo);this.originalCurveTo=
-this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,aa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,aa.prototype.arcTo)}function ja(){mxRectangleShape.call(this)}function ka(){mxRectangleShape.call(this)}function ua(){mxActor.call(this)}function Da(){mxActor.call(this)}function ha(){mxActor.call(this)}function k(){mxActor.call(this)}function u(){mxRectangleShape.call(this)}function H(){mxRectangleShape.call(this)}function P(){mxCylinder.call(this)}
-function T(){mxShape.call(this)}function W(){mxShape.call(this)}function fa(){mxEllipse.call(this)}function X(){mxShape.call(this)}function ea(){mxShape.call(this)}function oa(g,r){function D(){mxShape.call(this)}mxUtils.extend(D,mxShape);D.prototype.iconSize=r;D.prototype.paintBackground=function(v,B,G,I,ba){ba=Math.min(this.iconSize,I,ba);B+=(I-ba)/2;g.prototype.hasOwnProperty("paintVertexShape")?g.prototype.paintVertexShape.call(this,v,B,G,ba,ba):(g.prototype.paintBackground.call(this,v,B,G,ba,
-ba),"function"===typeof g.prototype.paintForeground&&g.prototype.paintForeground.call(this,v,B,G,ba,ba))};return D}function la(){mxShape.call(this)}function ca(){mxShape.call(this)}function sa(){mxShape.call(this)}function xa(){mxShape.call(this)}function qa(){mxShape.call(this)}function Ba(){mxRectangleShape.call(this)}function ma(){mxShape.call(this)}function ta(){mxShape.call(this)}function va(){mxShape.call(this)}function Ha(){mxShape.call(this)}function La(){mxShape.call(this)}function Ia(){mxCylinder.call(this)}
-function Ca(){mxCylinder.call(this)}function Pa(){mxRectangleShape.call(this)}function Ka(){mxDoubleEllipse.call(this)}function Na(){mxDoubleEllipse.call(this)}function Oa(){mxArrowConnector.call(this);this.spacing=0}function Ea(){mxArrowConnector.call(this);this.spacing=0}function Aa(){mxActor.call(this)}function Ja(){mxRectangleShape.call(this)}function Ga(){mxActor.call(this)}function Ua(){mxActor.call(this)}function ab(){mxActor.call(this)}function Wa(){mxActor.call(this)}function cb(){mxActor.call(this)}
+this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,aa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,aa.prototype.arcTo)}function ja(){mxRectangleShape.call(this)}function la(){mxRectangleShape.call(this)}function ua(){mxActor.call(this)}function Da(){mxActor.call(this)}function ha(){mxActor.call(this)}function k(){mxActor.call(this)}function u(){mxRectangleShape.call(this)}function H(){mxRectangleShape.call(this)}function P(){mxCylinder.call(this)}
+function U(){mxShape.call(this)}function W(){mxShape.call(this)}function fa(){mxEllipse.call(this)}function X(){mxShape.call(this)}function ea(){mxShape.call(this)}function oa(g,r){function D(){mxShape.call(this)}mxUtils.extend(D,mxShape);D.prototype.iconSize=r;D.prototype.paintBackground=function(v,B,G,I,ca){ca=Math.min(this.iconSize,I,ca);B+=(I-ca)/2;g.prototype.hasOwnProperty("paintVertexShape")?g.prototype.paintVertexShape.call(this,v,B,G,ca,ca):(g.prototype.paintBackground.call(this,v,B,G,ca,
+ca),"function"===typeof g.prototype.paintForeground&&g.prototype.paintForeground.call(this,v,B,G,ca,ca))};return D}function ka(){mxShape.call(this)}function ba(){mxShape.call(this)}function sa(){mxShape.call(this)}function xa(){mxShape.call(this)}function qa(){mxShape.call(this)}function Ba(){mxRectangleShape.call(this)}function ma(){mxShape.call(this)}function ta(){mxShape.call(this)}function va(){mxShape.call(this)}function Ga(){mxShape.call(this)}function La(){mxShape.call(this)}function Ia(){mxCylinder.call(this)}
+function Ca(){mxCylinder.call(this)}function Pa(){mxRectangleShape.call(this)}function Ka(){mxDoubleEllipse.call(this)}function Na(){mxDoubleEllipse.call(this)}function Oa(){mxArrowConnector.call(this);this.spacing=0}function Ea(){mxArrowConnector.call(this);this.spacing=0}function Aa(){mxActor.call(this)}function Ja(){mxRectangleShape.call(this)}function Ha(){mxActor.call(this)}function Ua(){mxActor.call(this)}function ab(){mxActor.call(this)}function Wa(){mxActor.call(this)}function cb(){mxActor.call(this)}
function hb(){mxActor.call(this)}function wb(){mxActor.call(this)}function Fa(){mxActor.call(this)}function Ra(){mxActor.call(this)}function $a(){mxActor.call(this)}function fb(){mxEllipse.call(this)}function rb(){mxEllipse.call(this)}function mb(){mxEllipse.call(this)}function ub(){mxRhombus.call(this)}function Eb(){mxEllipse.call(this)}function Fb(){mxEllipse.call(this)}function Tb(){mxEllipse.call(this)}function Rb(){mxEllipse.call(this)}function $b(){mxActor.call(this)}function Mb(){mxActor.call(this)}
-function Wb(){mxActor.call(this)}function zb(g,r,D,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=D;this.strokewidth=null!=v?v:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Ub(){mxConnector.call(this)}function Lb(){mxConnector.call(this)}function Xb(){mxActor.call(this)}function bc(g,r,D,v,B,G,I,ba,U,za){I+=U;var pa=v.clone();v.x-=B*(2*I+U);v.y-=G*(2*I+U);B*=I+U;G*=I+U;return function(){g.ellipse(pa.x-B-I,pa.y-G-I,2*
+function Wb(){mxActor.call(this)}function zb(g,r,D,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=D;this.strokewidth=null!=v?v:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Ub(){mxConnector.call(this)}function Lb(){mxConnector.call(this)}function Xb(){mxActor.call(this)}function bc(g,r,D,v,B,G,I,ca,T,za){I+=T;var pa=v.clone();v.x-=B*(2*I+T);v.y-=G*(2*I+T);B*=I+T;G*=I+T;return function(){g.ellipse(pa.x-B-I,pa.y-G-I,2*
I,2*I);za?g.fillAndStroke():g.stroke()}}function Hb(){mxRectangleShape.call(this)}function Ob(){mxActor.call(this)}function ac(){mxShape.call(this)}function Zb(){mxShape.call(this)}function Vb(){mxActor.call(this)}function Bb(){mxActor.call(this)}function Ib(){mxActor.call(this)}function Ab(){mxActor.call(this)}function Db(){mxConnector.call(this)}var z=mxShape.prototype.getLabelMargins;mxShape.prototype.getLabelMargins=function(g){if(null!=this.stencil&&null!=this.stencil.desc&&null!=this.style){if(null==
this.stencil.labelBounds){for(var r=this.stencil.desc.getElementsByTagName("labelBounds"),D=[],v=0;v<r.length;v++)D.push({condition:r[v].getAttribute("if"),x:Number(r[v].getAttribute("x")||0),y:Number(r[v].getAttribute("y")||0),w:Number(r[v].getAttribute("w")||this.stencil.w0),h:Number(r[v].getAttribute("h")||this.stencil.h0)});this.stencil.labelBounds=D}for(v=0;v<this.stencil.labelBounds.length;v++)if(r=this.stencil.labelBounds[v],null==r.condition||"1"==mxUtils.getValue(this.style,r.condition,"0")){v=
this.stencil.computeAspect(this.style,g.x,g.y,g.width,g.height);D=v.x-g.x+r.x*v.width;var B=v.y-g.y+r.y*v.height;return new mxRectangle(D,B,g.width-D-r.w*v.width,g.height-B-r.h*v.height)}}return z.apply(this,arguments)};mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var g=null;if(null!=this.line)for(var r=0;r<this.line.length;r++){var D=this.line[r];null!=D&&(D=new mxRectangle(D.x,D.y,this.strokewidth,this.strokewidth),null==g?g=D:g.add(D))}this.bounds=null!=g?g:new mxRectangle};
b.prototype.paintVertexShape=function(g,r,D,v,B){this.paintTableLine(g,this.line,0,0)};b.prototype.paintTableLine=function(g,r,D,v){if(null!=r){var B=null;g.begin();for(var G=0;G<r.length;G++){var I=r[G];null!=I&&(null==B?g.moveTo(I.x+D,I.y+v):null!=B&&g.lineTo(I.x+D,I.y+v));B=I}g.end();g.stroke()}};b.prototype.intersectsRectangle=function(g){var r=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var D=null,v=0;v<this.line.length&&!r;v++){var B=this.line[v];null!=
-B&&null!=D&&(r=mxUtils.rectangleIntersectsSegment(g,D,B));D=B}return r};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.fixedHeaderDefault=!1;d.prototype.paintVertexShape=function(g,r,D,v,B){var G=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,I=this.isHorizontal(),ba=this.getTitleSize(),U=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==ba&&this.isRounded&&!this.outline?(U=mxShape.prototype.getArcSize.call(this,
-v,B),g.begin(),g.roundrect(r,D,v,B,U,U),g.fillAndStroke()):0==ba&&!U||this.outline?Tb.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),g.translate(-r,-D));G||this.outline||!(I&&ba<B||!I&&ba<v)||this.paintForeground(g,r,D,v,B)};d.prototype.paintForeground=function(g,r,D,v,B){if(null!=this.state){var G=this.flipH,I=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ba=G;G=I;I=ba}g.rotate(-this.getShapeRotation(),
+B&&null!=D&&(r=mxUtils.rectangleIntersectsSegment(g,D,B));D=B}return r};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.fixedHeaderDefault=!1;d.prototype.paintVertexShape=function(g,r,D,v,B){var G=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,I=this.isHorizontal(),ca=this.getTitleSize(),T=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==ca&&this.isRounded&&!this.outline?(T=mxShape.prototype.getArcSize.call(this,
+v,B),g.begin(),g.roundrect(r,D,v,B,T,T),g.fillAndStroke()):0==ca&&!T||this.outline?Tb.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),g.translate(-r,-D));G||this.outline||!(I&&ca<B||!I&&ca<v)||this.paintForeground(g,r,D,v,B)};d.prototype.paintForeground=function(g,r,D,v,B){if(null!=this.state){var G=this.flipH,I=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ca=G;G=I;I=ca}g.rotate(-this.getShapeRotation(),
G,I,r+v/2,D+B/2);s=this.scale;r=this.bounds.x/s;D=this.bounds.y/s;v=this.bounds.width/s;B=this.bounds.height/s;this.paintTableForeground(g,r,D,v,B)}};d.prototype.paintTableForeground=function(g,r,D,v,B){v=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(B=0;B<v.length;B++)b.prototype.paintTableLine(g,v[B],r,D)};d.prototype.configurePointerEvents=function(g){0==this.getTitleSize()?
g.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",d);mxUtils.extend(m,d);m.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",m);var L=mxSwimlane.prototype.paintVertexShape;mxSwimlane.prototype.paintVertexShape=function(g,r,D,v,B){L.apply(this,arguments);if(null!=this.state&&!this.outline){var G=this.state.view.graph;if((null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.laneFill&&this.laneFill!=
-mxConstants.NONE)&&null!=G.paintTableCellLines){var I=this.state.cell;if(null!=G.isTableRow&&G.isTableRow(I)){var ba=this.getTitleSize();this.isHorizontal()?G.paintTableCellLines(g,I,0,0,v,Math.min(ba,B),this.stroke,this.strokewidth):G.paintTableCellLines(g,I,0,0,Math.min(ba,v),B,this.stroke,this.strokewidth)}else G.paintTableCellLines(g,I,0,0,v,B,this.stroke,this.strokewidth)}}};mxUtils.extend(p,mxCylinder);p.prototype.size=20;p.prototype.darkOpacity=0;p.prototype.darkOpacity2=0;p.prototype.paintVertexShape=
-function(g,r,D,v,B){var G=Math.max(0,Math.min(v,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ba=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));g.translate(r,D);g.begin();g.moveTo(0,0);g.lineTo(v-G,0);g.lineTo(v,G);g.lineTo(v,B);g.lineTo(G,B);g.lineTo(0,B-G);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),
-0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(v-G,0),g.lineTo(v,G),g.lineTo(G,G),g.close(),g.fill()),0!=ba&&(g.setFillAlpha(Math.abs(ba)),g.setFillColor(0>ba?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(G,G),g.lineTo(G,B),g.lineTo(0,B-G),g.close(),g.fill()),g.begin(),g.moveTo(G,B),g.lineTo(G,G),g.lineTo(0,0),g.moveTo(G,G),g.lineTo(v,G),g.end(),g.stroke())};p.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,
+mxConstants.NONE)&&null!=G.paintTableCellLines){var I=this.state.cell;if(null!=G.isTableRow&&G.isTableRow(I)){var ca=this.getTitleSize();this.isHorizontal()?G.paintTableCellLines(g,I,0,0,v,Math.min(ca,B),this.stroke,this.strokewidth):G.paintTableCellLines(g,I,0,0,Math.min(ca,v),B,this.stroke,this.strokewidth)}else G.paintTableCellLines(g,I,0,0,v,B,this.stroke,this.strokewidth)}}};mxUtils.extend(p,mxCylinder);p.prototype.size=20;p.prototype.darkOpacity=0;p.prototype.darkOpacity2=0;p.prototype.paintVertexShape=
+function(g,r,D,v,B){var G=Math.max(0,Math.min(v,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ca=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));g.translate(r,D);g.begin();g.moveTo(0,0);g.lineTo(v-G,0);g.lineTo(v,G);g.lineTo(v,B);g.lineTo(G,B);g.lineTo(0,B-G);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),
+0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(v-G,0),g.lineTo(v,G),g.lineTo(G,G),g.close(),g.fill()),0!=ca&&(g.setFillAlpha(Math.abs(ca)),g.setFillColor(0>ca?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(G,G),g.lineTo(G,B),g.lineTo(0,B-G),g.close(),g.fill()),g.begin(),g.moveTo(G,B),g.lineTo(G,G),g.lineTo(0,0),g.moveTo(G,G),g.lineTo(v,G),g.end(),g.stroke())};p.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,
"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(g,g,0,0)):null};mxCellRenderer.registerShape("cube",p);var M=Math.tan(mxUtils.toRadians(30)),S=(.5-M)/2;mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(t,mxConnector);t.prototype.paintEdgeShape=function(g,r){var D=this.createMarker(g,r,!0),v=this.createMarker(g,r,!1);g.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&g.setDashed(this.isDashed,
null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);g.setShadow(!1);g.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);g.setStrokeColor(this.stroke);g.setFillColor(this.stroke);g.setDashed(!1);null!=D&&D();null!=v&&v()};mxCellRenderer.registerShape("wire",t);mxUtils.extend(n,mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(g,r,D,v,B){g.setFillColor(this.stroke);var G=Math.max(0,parseFloat(mxUtils.getValue(this.style,
"size",this.size))-2)+2*this.strokewidth;g.ellipse(r+.5*(v-G),D+.5*(B-G),G,G);g.fill();g.setFillColor(mxConstants.NONE);g.rect(r,D,v,B);g.fill()};mxCellRenderer.registerShape("waypoint",n);mxUtils.extend(y,mxActor);y.prototype.size=20;y.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(v,B/M);g.translate((v-r)/2,(B-r)/2+r/4);g.moveTo(0,.25*r);g.lineTo(.5*r,r*S);g.lineTo(r,.25*r);g.lineTo(.5*r,(.5-S)*r);g.lineTo(0,.25*r);g.close();g.end()};mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(C,
@@ -3258,14 +3259,14 @@ G);g.close();g.fillAndStroke();g.setShadow(!1);g.begin();g.moveTo(0,G);g.lineTo(
v,G,0,0,1,v,G),g.lineTo(v,B-G),g.arcTo(.5*v,G,0,0,1,.5*v,B),g.arcTo(.5*v,G,0,0,1,0,B-G),g.close(),g.fillAndStroke(),g.setShadow(!1),g.begin(),g.moveTo(v,G),g.arcTo(.5*v,G,0,0,1,.5*v,2*G),g.arcTo(.5*v,G,0,0,1,0,G),g.stroke())};mxCellRenderer.registerShape("cylinder2",c);mxUtils.extend(f,mxCylinder);f.prototype.size=15;f.prototype.paintVertexShape=function(g,r,D,v,B){var G=Math.max(0,Math.min(.5*B,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),I=mxUtils.getValue(this.style,"lid",!0);g.translate(r,
D);0==G?(g.rect(0,0,v,B),g.fillAndStroke()):(g.begin(),I?(g.moveTo(0,G),g.arcTo(.5*v,G,0,0,1,.5*v,0),g.arcTo(.5*v,G,0,0,1,v,G)):(g.moveTo(0,0),g.arcTo(.5*v,G,0,0,0,.5*v,G),g.arcTo(.5*v,G,0,0,0,v,0)),g.lineTo(v,B-G),g.arcTo(.5*v,G,0,0,1,.5*v,B),g.arcTo(.5*v,G,0,0,1,0,B-G),g.close(),g.fillAndStroke(),g.setShadow(!1),I&&(g.begin(),g.moveTo(v,G),g.arcTo(.5*v,G,0,0,1,.5*v,2*G),g.arcTo(.5*v,G,0,0,1,0,G),g.stroke()))};mxCellRenderer.registerShape("cylinder3",f);mxUtils.extend(l,mxActor);l.prototype.redrawPath=
function(g,r,D,v,B){g.moveTo(0,0);g.quadTo(v/2,.5*B,v,0);g.quadTo(.5*v,B/2,v,B);g.quadTo(v/2,.5*B,0,B);g.quadTo(.5*v,B/2,0,0);g.end()};mxCellRenderer.registerShape("switch",l);mxUtils.extend(q,mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));
-D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var G=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),I=mxUtils.getValue(this.style,"rounded",!1),ba=mxUtils.getValue(this.style,"absoluteArcSize",!1),U=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ba||(U*=Math.min(v,B));U=Math.min(U,.5*v,.5*(B-D));r=Math.max(r,U);r=Math.min(v-U,r);I||(U=0);g.begin();"left"==G?(g.moveTo(Math.max(U,0),D),g.lineTo(Math.max(U,0),0),g.lineTo(r,
-0),g.lineTo(r,D)):(g.moveTo(v-r,D),g.lineTo(v-r,0),g.lineTo(v-Math.max(U,0),0),g.lineTo(v-Math.max(U,0),D));I?(g.moveTo(0,U+D),g.arcTo(U,U,0,0,1,U,D),g.lineTo(v-U,D),g.arcTo(U,U,0,0,1,v,U+D),g.lineTo(v,B-U),g.arcTo(U,U,0,0,1,v-U,B),g.lineTo(U,B),g.arcTo(U,U,0,0,1,0,B-U)):(g.moveTo(0,D),g.lineTo(v,D),g.lineTo(v,B),g.lineTo(0,B));g.close();g.fillAndStroke();g.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(g.begin(),g.moveTo(v-30,D+20),g.lineTo(v-20,D+10),g.lineTo(v-10,
+D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var G=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),I=mxUtils.getValue(this.style,"rounded",!1),ca=mxUtils.getValue(this.style,"absoluteArcSize",!1),T=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ca||(T*=Math.min(v,B));T=Math.min(T,.5*v,.5*(B-D));r=Math.max(r,T);r=Math.min(v-T,r);I||(T=0);g.begin();"left"==G?(g.moveTo(Math.max(T,0),D),g.lineTo(Math.max(T,0),0),g.lineTo(r,
+0),g.lineTo(r,D)):(g.moveTo(v-r,D),g.lineTo(v-r,0),g.lineTo(v-Math.max(T,0),0),g.lineTo(v-Math.max(T,0),D));I?(g.moveTo(0,T+D),g.arcTo(T,T,0,0,1,T,D),g.lineTo(v-T,D),g.arcTo(T,T,0,0,1,v,T+D),g.lineTo(v,B-T),g.arcTo(T,T,0,0,1,v-T,B),g.lineTo(T,B),g.arcTo(T,T,0,0,1,0,B-T)):(g.moveTo(0,D),g.lineTo(v,D),g.lineTo(v,B),g.lineTo(0,B));g.close();g.fillAndStroke();g.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(g.begin(),g.moveTo(v-30,D+20),g.lineTo(v-20,D+10),g.lineTo(v-10,
D+20),g.close(),g.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var D=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var v=mxUtils.getValue(this.style,"rounded",!1),B=mxUtils.getValue(this.style,"absoluteArcSize",!1),G=parseFloat(mxUtils.getValue(this.style,
"arcSize",this.arcSize));B||(G*=Math.min(g.width,g.height));G=Math.min(G,.5*g.width,.5*(g.height-r));v||(G=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(G,0,Math.min(g.width,g.width-D),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-D),0,G,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};mxUtils.extend(x,mxCylinder);x.prototype.arcSize=.1;x.prototype.paintVertexShape=function(g,r,D,
v,B){g.translate(r,D);var G=mxUtils.getValue(this.style,"rounded",!1),I=mxUtils.getValue(this.style,"absoluteArcSize",!1);r=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));D=mxUtils.getValue(this.style,"umlStateConnection",null);I||(r*=Math.min(v,B));r=Math.min(r,.5*v,.5*B);G||(r=0);G=0;null!=D&&(G=10);g.begin();g.moveTo(G,r);g.arcTo(r,r,0,0,1,G+r,0);g.lineTo(v-r,0);g.arcTo(r,r,0,0,1,v,r);g.lineTo(v,B-r);g.arcTo(r,r,0,0,1,v-r,B);g.lineTo(G+r,B);g.arcTo(r,r,0,0,1,G,B-r);g.close();g.fillAndStroke();
g.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(g.roundrect(v-40,B-20,10,10,3,3),g.stroke(),g.roundrect(v-20,B-20,10,10,3,3),g.stroke(),g.begin(),g.moveTo(v-30,B-15),g.lineTo(v-20,B-15),g.stroke());"connPointRefEntry"==D?(g.ellipse(0,.5*B-10,20,20),g.fillAndStroke()):"connPointRefExit"==D&&(g.ellipse(0,.5*B-10,20,20),g.fillAndStroke(),g.begin(),g.moveTo(5,.5*B-5),g.lineTo(15,.5*B+5),g.moveTo(15,.5*B-5),g.lineTo(5,.5*B+5),g.stroke())};x.prototype.getLabelMargins=
function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};mxCellRenderer.registerShape("umlState",x);mxUtils.extend(A,mxShape);A.prototype.featureColor="#666666";A.prototype.paintVertexShape=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"smileyType","happy"),I=mxUtils.getValue(this.style,"smileyFeatureColor",A.prototype.featureColor);g.translate(r,D);r=Math.min(v,B)/2;g.ellipse(v/
-2-r,B/2-r,2*r,2*r);g.fillAndStroke();r=Math.min(v,B)/30;v/=2;B/=2;g.setFillColor(I);g.setStrokeColor(I);g.setStrokeWidth(2*r);I=1.5*r;D=5*r;var ba=5*r;g.ellipse(v-D-I,B-ba-I,2*I,2*I);g.fillAndStroke();g.ellipse(v+D-I,B-ba-I,2*I,2*I);g.fillAndStroke();g.setStrokeWidth(1*r);g.setFillColor("#000000");"happy"==G?(G=v,I=B+2*r,g.begin(),g.moveTo(G+7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,G-7.5*r,I),g.lineTo(G-6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,G+6.818*r,I),g.close(),g.fillAndStroke()):"sad"==G?(G=v,I=B+
+2-r,B/2-r,2*r,2*r);g.fillAndStroke();r=Math.min(v,B)/30;v/=2;B/=2;g.setFillColor(I);g.setStrokeColor(I);g.setStrokeWidth(2*r);I=1.5*r;D=5*r;var ca=5*r;g.ellipse(v-D-I,B-ca-I,2*I,2*I);g.fillAndStroke();g.ellipse(v+D-I,B-ca-I,2*I,2*I);g.fillAndStroke();g.setStrokeWidth(1*r);g.setFillColor("#000000");"happy"==G?(G=v,I=B+2*r,g.begin(),g.moveTo(G+7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,G-7.5*r,I),g.lineTo(G-6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,G+6.818*r,I),g.close(),g.fillAndStroke()):"sad"==G?(G=v,I=B+
7*r,g.begin(),g.moveTo(G-7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,G+7.5*r,I),g.lineTo(G+6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,G-6.818*r,I),g.close(),g.fillAndStroke()):(g.begin(),g.moveTo(v-5*r,B+7*r),g.lineTo(v+5*r,B+7*r),g.stroke())};mxCellRenderer.registerShape("smileyFace",A);mxUtils.extend(E,mxActor);E.prototype.size=30;E.prototype.isRoundable=function(){return!0};E.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));
D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(v,0),new mxPoint(v,B),new mxPoint(0,B),new mxPoint(0,r)],this.isRounded,D,!0);g.end()};mxCellRenderer.registerShape("card",E);mxUtils.extend(K,mxActor);K.prototype.size=.4;K.prototype.redrawPath=function(g,r,D,v,B){r=B*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,r/2);g.quadTo(v/4,1.4*r,v/2,r/2);g.quadTo(3*v/4,r*(1-1.4),
v,r/2);g.lineTo(v,B-r/2);g.quadTo(3*v/4,B-1.4*r,v/2,B-r/2);g.quadTo(v/4,B-r*(1-1.4),0,B-r/2);g.lineTo(0,r/2);g.close();g.end()};K.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",this.size),D=g.width,v=g.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return r*=v,new mxRectangle(g.x,g.y+r,D,v-2*r);r*=D;return new mxRectangle(g.x+r,g.y,D-2*r,v)}return g};
@@ -3280,7 +3281,7 @@ this.fixedSize)))):v*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.sty
"size",this.size))));D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(v,0),new mxPoint(r,0),new mxPoint(r,B/2),new mxPoint(0,B/2),new mxPoint(r,B/2),new mxPoint(r,B),new mxPoint(v,B)],this.isRounded,D,!1);g.end()};mxCellRenderer.registerShape("curlyBracket",ia);mxUtils.extend(Y,mxActor);Y.prototype.redrawPath=function(g,r,D,v,B){g.setStrokeWidth(1);g.setFillColor(this.stroke);r=v/5;g.rect(0,0,r,B);g.fillAndStroke();g.rect(2*r,0,r,B);
g.fillAndStroke();g.rect(4*r,0,r,B);g.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",Y);aa.prototype.moveTo=function(g,r){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;this.firstX=g;this.firstY=r};aa.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};aa.prototype.quadTo=function(g,r,D,v){this.originalQuadTo.apply(this.canvas,
arguments);this.lastX=D;this.lastY=v};aa.prototype.curveTo=function(g,r,D,v,B,G){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=B;this.lastY=G};aa.prototype.arcTo=function(g,r,D,v,B,G,I){this.originalArcTo.apply(this.canvas,arguments);this.lastX=G;this.lastY=I};aa.prototype.lineTo=function(g,r){if(null!=this.lastX&&null!=this.lastY){var D=function(pa){return"number"===typeof pa?pa?0>pa?-1:1:pa===pa?0:NaN:NaN},v=Math.abs(g-this.lastX),B=Math.abs(r-this.lastY),G=Math.sqrt(v*v+B*B);if(2>
-G){this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;return}var I=Math.round(G/10),ba=this.defaultVariation;5>I&&(I=5,ba/=3);var U=D(g-this.lastX)*v/I;D=D(r-this.lastY)*B/I;v/=G;B/=G;for(G=0;G<I;G++){var za=(Math.random()-.5)*ba;this.originalLineTo.call(this.canvas,U*G+this.lastX-za*B,D*G+this.lastY-za*v)}this.originalLineTo.call(this.canvas,g,r)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r};aa.prototype.destroy=function(){this.canvas.lineTo=
+G){this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;return}var I=Math.round(G/10),ca=this.defaultVariation;5>I&&(I=5,ca/=3);var T=D(g-this.lastX)*v/I;D=D(r-this.lastY)*B/I;v/=G;B/=G;for(G=0;G<I;G++){var za=(Math.random()-.5)*ca;this.originalLineTo.call(this.canvas,T*G+this.lastX-za*B,D*G+this.lastY-za*v)}this.originalLineTo.call(this.canvas,g,r)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r};aa.prototype.destroy=function(){this.canvas.lineTo=
this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var da=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(g){da.apply(this,arguments);null==g.handJiggle&&(g.handJiggle=this.createHandJiggle(g))};var na=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(g){na.apply(this,arguments);null!=g.handJiggle&&
(g.handJiggle.destroy(),delete g.handJiggle)};var ra=mxShape.prototype.updateBoundingBox;mxShape.prototype.updateBoundingBox=function(){ra.apply(this,arguments);if(!(this.useSvgBoundingBox||null==this.boundingBox||this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")&&"0"==mxUtils.getValue(this.style,"comic","0"))){var g=this.getSvgBoundingBox();null!=g&&(this.augmentShadowBoundingBox(g),this.boundingBox.add(g))}};mxShape.prototype.createComicCanvas=function(g){return new aa(g,
mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(g){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(g)};var wa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&wa.apply(this,
@@ -3289,68 +3290,68 @@ arguments)};var ya=mxRectangleShape.prototype.paintBackground;mxRectangleShape.p
D),g.lineTo(r+v,D),g.lineTo(r+v,D+B),g.lineTo(r,D+B),g.lineTo(r,D)),g.close(),g.end(),g.fillAndStroke()}};mxUtils.extend(ja,mxRectangleShape);ja.prototype.size=.1;ja.prototype.fixedSize=!1;ja.prototype.isHtmlAllowed=function(){return!1};ja.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var r=g.width,D=g.height;g=new mxRectangle(g.x,
g.y,r,D);var v=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),B=parseFloat(mxUtils.getValue(this.style,"size",this.size));v?B=Math.max(0,Math.min(r,B*this.scale)):(B=r*Math.max(0,Math.min(1,B)),this.isRounded&&(v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,B=Math.max(B,Math.min(r*v,D*v))));g.x+=Math.round(B);g.width-=Math.round(2*B);return g}return g};ja.prototype.paintForeground=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,
"fixedSize",this.fixedSize),I=parseFloat(mxUtils.getValue(this.style,"size",this.size));I=G?Math.max(0,Math.min(v,I)):v*Math.max(0,Math.min(1,I));this.isRounded&&(G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,I=Math.max(I,Math.min(v*G,B*G)));I=Math.round(I);g.begin();g.moveTo(r+I,D);g.lineTo(r+I,D+B);g.moveTo(r+v-I,D);g.lineTo(r+v-I,D+B);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",
-ja);mxCellRenderer.registerShape("process2",ja);mxUtils.extend(ka,mxRectangleShape);ka.prototype.paintBackground=function(g,r,D,v,B){g.setFillColor(mxConstants.NONE);g.rect(r,D,v,B);g.fill()};ka.prototype.paintForeground=function(g,r,D,v,B){};mxCellRenderer.registerShape("transparent",ka);mxUtils.extend(ua,mxHexagon);ua.prototype.size=30;ua.prototype.position=.5;ua.prototype.position2=.5;ua.prototype.base=20;ua.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,
-"size",this.size))*this.scale)};ua.prototype.isRoundable=function(){return!0};ua.prototype.redrawPath=function(g,r,D,v,B){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var G=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),I=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),ba=Math.max(0,Math.min(v,
-parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,B-D),new mxPoint(Math.min(v,G+ba),B-D),new mxPoint(I,B),new mxPoint(Math.max(0,G),B-D),new mxPoint(0,B-D)],this.isRounded,r,!0,[4])};mxCellRenderer.registerShape("callout",ua);mxUtils.extend(Da,mxActor);Da.prototype.tipX=-.25;Da.prototype.tipY=1;Da.prototype.base=20;Da.prototype.maxTipOffset=100;Da.prototype.isRoundable=function(){return!0};Da.prototype.getTipOffset=function(){var g=
+ja);mxCellRenderer.registerShape("process2",ja);mxUtils.extend(la,mxRectangleShape);la.prototype.paintBackground=function(g,r,D,v,B){g.setFillColor(mxConstants.NONE);g.rect(r,D,v,B);g.fill()};la.prototype.paintForeground=function(g,r,D,v,B){};mxCellRenderer.registerShape("transparent",la);mxUtils.extend(ua,mxHexagon);ua.prototype.size=30;ua.prototype.position=.5;ua.prototype.position2=.5;ua.prototype.base=20;ua.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,
+"size",this.size))*this.scale)};ua.prototype.isRoundable=function(){return!0};ua.prototype.redrawPath=function(g,r,D,v,B){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var G=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),I=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),ca=Math.max(0,Math.min(v,
+parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,B-D),new mxPoint(Math.min(v,G+ca),B-D),new mxPoint(I,B),new mxPoint(Math.max(0,G),B-D),new mxPoint(0,B-D)],this.isRounded,r,!0,[4])};mxCellRenderer.registerShape("callout",ua);mxUtils.extend(Da,mxActor);Da.prototype.tipX=-.25;Da.prototype.tipY=1;Da.prototype.base=20;Da.prototype.maxTipOffset=100;Da.prototype.isRoundable=function(){return!0};Da.prototype.getTipOffset=function(){var g=
this.maxTipOffset,r=parseFloat(mxUtils.getValue(this.style,"tipX",this.tipX)),D=parseFloat(mxUtils.getValue(this.style,"tipY",this.tipY));return new mxPoint(Math.max(-g,Math.min(g,isFinite(r)?r:this.tipX)),Math.max(-g,Math.min(g,isFinite(D)?D:this.tipY)))};Da.prototype.getTailPoints=function(g,r){var D=this.getTipOffset(),v=D.x*g;D=D.y*r;if(Math.abs(v)<=g/2&&Math.abs(D)<=r/2)return null;var B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,G=parseFloat(mxUtils.getValue(this.style,
"base",this.base));G=isFinite(G)?Math.max(0,G):this.base;B=this.isRounded?B:0;var I=new mxPoint(g/2+v,r/2+D);if(Math.abs(v)*r>=Math.abs(D)*g&&0!=v)return B=Math.min(B,r/2),G=Math.max(0,Math.min(G,r-2*B))/2,D=r/2+g/2*D/Math.abs(v),D=Math.max(B+G,Math.min(r-B-G,D)),0<v?{points:[new mxPoint(g,D-G),I,new mxPoint(g,D+G)],index:2}:{points:[new mxPoint(0,D+G),I,new mxPoint(0,D-G)],index:4};B=Math.min(B,g/2);G=Math.max(0,Math.min(G,g-2*B))/2;v=g/2+r/2*v/Math.abs(D);v=Math.max(B+G,Math.min(g-B-G,v));return 0<
D?{points:[new mxPoint(v+G,r),I,new mxPoint(v-G,r)],index:3}:{points:[new mxPoint(v-G,0),I,new mxPoint(v+G,0)],index:1}};Da.prototype.redrawPath=function(g,r,D,v,B){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;D=[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,B),new mxPoint(0,B)];v=this.getTailPoints(v,B);B=null;null!=v&&(D.splice.apply(D,[v.index,0].concat(v.points)),B=[v.index,v.index+1,v.index+2]);this.addPoints(g,D,this.isRounded,r,!0,B)};Da.prototype.getShapeBoundingBox=
-function(){var g=mxShape.prototype.getShapeBoundingBox.apply(this,arguments);if(null!=g&&null!=this.bounds){var r=this.createBoundingBox(),D=this.scale,v=r.width/D,B=r.height/D,G=this.getTailPoints(v,B);if(null!=G){var I=G.points[1],ba=r.x+r.width/2;r=r.y+r.height/2;D=new mxRectangle(ba+(I.x-v/2)*D*(this.flipH?-1:1),r+(I.y-B/2)*D*(this.flipV?-1:1),0,0);this.augmentBoundingBox(D);v=G.points[0].x-I.x;B=G.points[0].y-I.y;var U=G.points[2].x-I.x;G=G.points[2].y-I.y;I=Math.sqrt(v*v+B*B);var za=Math.sqrt(U*
-U+G*G);0<I&&0<za&&(G=Math.sqrt((1-Math.max(-1,Math.min(1,(v*U+B*G)/(I*za))))/2),D.grow(((0<G?Math.min(10,1/G):10)-1)*this.strokewidth*this.scale/2));G=this.getShapeRotation();0!=G&&(D=mxUtils.getBoundingBox(D,G,new mxPoint(ba,r)));g.add(D)}}return g};mxCellRenderer.registerShape("wedgeCallout",Da);mxUtils.extend(ha,mxActor);ha.prototype.size=.2;ha.prototype.fixedSize=20;ha.prototype.isRoundable=function(){return!0};ha.prototype.redrawPath=function(g,r,D,v,B){r="0"!=mxUtils.getValue(this.style,"fixedSize",
+function(){var g=mxShape.prototype.getShapeBoundingBox.apply(this,arguments);if(null!=g&&null!=this.bounds){var r=this.createBoundingBox(),D=this.scale,v=r.width/D,B=r.height/D,G=this.getTailPoints(v,B);if(null!=G){var I=G.points[1],ca=r.x+r.width/2;r=r.y+r.height/2;D=new mxRectangle(ca+(I.x-v/2)*D*(this.flipH?-1:1),r+(I.y-B/2)*D*(this.flipV?-1:1),0,0);this.augmentBoundingBox(D);v=G.points[0].x-I.x;B=G.points[0].y-I.y;var T=G.points[2].x-I.x;G=G.points[2].y-I.y;I=Math.sqrt(v*v+B*B);var za=Math.sqrt(T*
+T+G*G);0<I&&0<za&&(G=Math.sqrt((1-Math.max(-1,Math.min(1,(v*T+B*G)/(I*za))))/2),D.grow(((0<G?Math.min(10,1/G):10)-1)*this.strokewidth*this.scale/2));G=this.getShapeRotation();0!=G&&(D=mxUtils.getBoundingBox(D,G,new mxPoint(ca,r)));g.add(D)}}return g};mxCellRenderer.registerShape("wedgeCallout",Da);mxUtils.extend(ha,mxActor);ha.prototype.size=.2;ha.prototype.fixedSize=20;ha.prototype.isRoundable=function(){return!0};ha.prototype.redrawPath=function(g,r,D,v,B){r="0"!=mxUtils.getValue(this.style,"fixedSize",
"0")?Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v-r,0),new mxPoint(v,B/2),new mxPoint(v-r,B),new mxPoint(0,B),new mxPoint(r,B/2)],this.isRounded,D,!0);g.end()};mxCellRenderer.registerShape("step",ha);mxUtils.extend(k,mxHexagon);k.prototype.size=
.25;k.prototype.fixedSize=20;k.prototype.isRoundable=function(){return!0};k.prototype.redrawPath=function(g,r,D,v,B){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(v-r,0),new mxPoint(v,.5*B),
new mxPoint(v-r,B),new mxPoint(r,B),new mxPoint(0,.5*B)],this.isRounded,D,!0)};mxCellRenderer.registerShape("hexagon",k);mxUtils.extend(u,mxRectangleShape);u.prototype.isHtmlAllowed=function(){return!1};u.prototype.paintForeground=function(g,r,D,v,B){var G=Math.min(v/5,B/5)+1;g.begin();g.moveTo(r+v/2,D+G);g.lineTo(r+v/2,D+B-G);g.moveTo(r+G,D+B/2);g.lineTo(r+v-G,D+B/2);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",u);var Ma=
-mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};mxRhombus.prototype.paintVertexShape=function(g,r,D,v,B){Ma.apply(this,arguments);var G=r,I=D,ba=v,U=B;if(!this.outline&&1==this.style["double"]){var za=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
-0);r+=za;D+=za;v-=2*za;B-=2*za;0<v&&0<B&&(g.setShadow(!1),Ma.apply(this,[g,r,D,v,B]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(g,G,I,ba,U,0)};mxShape.prototype.paintGlassEffect=function(g,r,D,v,B,G){var I=Math.ceil(this.strokewidth/2);g.setGradient("#ffffff","#ffffff",r,D,v,.6*B,"south",.9,.1);g.begin();this.paintGlassEffectPath(g,r,D,v,B,I,G);g.close();g.fill()};mxShape.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){I+=2*G;this.isRounded?
+mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};mxRhombus.prototype.paintVertexShape=function(g,r,D,v,B){Ma.apply(this,arguments);var G=r,I=D,ca=v,T=B;if(!this.outline&&1==this.style["double"]){var za=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
+0);r+=za;D+=za;v-=2*za;B-=2*za;0<v&&0<B&&(g.setShadow(!1),Ma.apply(this,[g,r,D,v,B]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(g,G,I,ca,T,0)};mxShape.prototype.paintGlassEffect=function(g,r,D,v,B,G){var I=Math.ceil(this.strokewidth/2);g.setGradient("#ffffff","#ffffff",r,D,v,.6*B,"south",.9,.1);g.begin();this.paintGlassEffectPath(g,r,D,v,B,I,G);g.close();g.fill()};mxShape.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){I+=2*G;this.isRounded?
(g.moveTo(r-G+I,D-G),g.quadTo(r-G,D-G,r-G,D-G+I),g.lineTo(r-G,D+.4*B),g.quadTo(r+.5*v,D+.7*B,r+v+G,D+.4*B),g.lineTo(r+v+G,D-G+I),g.quadTo(r+v+G,D-G,r+v+G-I,D-G)):(g.moveTo(r-G,D-G),g.lineTo(r-G,D+.4*B),g.quadTo(r+.5*v,D+.7*B,r+v+G,D+.4*B),g.lineTo(r+v+G,D-G))};mxEllipse.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){I=v/2+G;G=B/2+G;r+=v/2;D+=B/2;g.moveTo(r-I,D);g.curveTo(r-I,D-.5522847498*G,r-.5522847498*I,D-G,r,D-G);g.curveTo(r+.5522847498*I,D-G,r+I,D-.5522847498*G,r+I,D);g.quadTo(r,D+.2*
-B,r-I,D)};mxRhombus.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){G=v/2;I=B/2;var ba=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,D+I),new mxPoint(r+G,D),new mxPoint(r+v,D+I)],this.isRounded,ba,!1);g.quadTo(r+G,D+.7*B,r,D+I)};var Za=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(g,r,D,v,B){Za.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&
+B,r-I,D)};mxRhombus.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){G=v/2;I=B/2;var ca=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,D+I),new mxPoint(r+G,D),new mxPoint(r+v,D+I)],this.isRounded,ca,!1);g.quadTo(r+G,D+.7*B,r,D+I)};var Za=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(g,r,D,v,B){Za.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&
this.paintGlassEffect(g,r,D,v,B,0)};mxUtils.extend(H,mxRectangleShape);H.prototype.isHtmlAllowed=function(){return!1};H.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};H.prototype.paintForeground=function(g,r,D,v,B){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var G=Math.max(2,this.strokewidth+
-1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);r+=G;D+=G;v-=2*G;B-=2*G;0<v&&0<B&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}g.setDashed(!1);G=0;do{var I=mxCellRenderer.defaultShapes[this.style["symbol"+G]];if(null!=I){var ba=this.style["symbol"+G+"Align"],U=this.style["symbol"+G+"VerticalAlign"],za=this.style["symbol"+G+"Width"],pa=this.style["symbol"+G+"Height"],Xa=this.style["symbol"+G+"Spacing"]||0,vb=this.style["symbol"+G+"VSpacing"]||Xa,jb=this.style["symbol"+G+
-"ArcSpacing"];null!=jb&&(jb*=this.getArcSize(v+this.strokewidth,B+this.strokewidth),Xa+=jb,vb+=jb);jb=r;var Sa=D;jb=ba==mxConstants.ALIGN_CENTER?jb+(v-za)/2:ba==mxConstants.ALIGN_RIGHT?jb+(v-za-Xa):jb+Xa;Sa=U==mxConstants.ALIGN_MIDDLE?Sa+(B-pa)/2:U==mxConstants.ALIGN_BOTTOM?Sa+(B-pa-vb):Sa+vb;g.save();ba=new I;ba.style=this.style;I.prototype.paintVertexShape.call(ba,g,jb,Sa,za,pa);g.restore()}G++}while(null!=I)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",
-H);mxUtils.extend(P,mxCylinder);P.prototype.redrawPath=function(g,r,D,v,B,G){G?(g.moveTo(0,0),g.lineTo(v/2,B/2),g.lineTo(v,0),g.end()):(g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(0,B),g.close())};mxCellRenderer.registerShape("message",P);mxUtils.extend(T,mxShape);T.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.ellipse(v/4,0,v/2,B/4);g.fillAndStroke();g.begin();g.moveTo(v/2,B/4);g.lineTo(v/2,2*B/3);g.moveTo(v/2,B/3);g.lineTo(0,B/3);g.moveTo(v/2,B/3);g.lineTo(v,B/3);g.moveTo(v/
-2,2*B/3);g.lineTo(0,B);g.moveTo(v/2,2*B/3);g.lineTo(v,B);g.end();g.stroke()};mxCellRenderer.registerShape("umlActor",T);mxUtils.extend(W,mxShape);W.prototype.getLabelMargins=function(g){return new mxRectangle(g.width/6,0,0,0)};W.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(0,B/4);g.lineTo(0,3*B/4);g.end();g.stroke();g.begin();g.moveTo(0,B/2);g.lineTo(v/6,B/2);g.end();g.stroke();g.ellipse(v/6,0,5*v/6,B);g.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",
+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);r+=G;D+=G;v-=2*G;B-=2*G;0<v&&0<B&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}g.setDashed(!1);G=0;do{var I=mxCellRenderer.defaultShapes[this.style["symbol"+G]];if(null!=I){var ca=this.style["symbol"+G+"Align"],T=this.style["symbol"+G+"VerticalAlign"],za=this.style["symbol"+G+"Width"],pa=this.style["symbol"+G+"Height"],Xa=this.style["symbol"+G+"Spacing"]||0,vb=this.style["symbol"+G+"VSpacing"]||Xa,jb=this.style["symbol"+G+
+"ArcSpacing"];null!=jb&&(jb*=this.getArcSize(v+this.strokewidth,B+this.strokewidth),Xa+=jb,vb+=jb);jb=r;var Sa=D;jb=ca==mxConstants.ALIGN_CENTER?jb+(v-za)/2:ca==mxConstants.ALIGN_RIGHT?jb+(v-za-Xa):jb+Xa;Sa=T==mxConstants.ALIGN_MIDDLE?Sa+(B-pa)/2:T==mxConstants.ALIGN_BOTTOM?Sa+(B-pa-vb):Sa+vb;g.save();ca=new I;ca.style=this.style;I.prototype.paintVertexShape.call(ca,g,jb,Sa,za,pa);g.restore()}G++}while(null!=I)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",
+H);mxUtils.extend(P,mxCylinder);P.prototype.redrawPath=function(g,r,D,v,B,G){G?(g.moveTo(0,0),g.lineTo(v/2,B/2),g.lineTo(v,0),g.end()):(g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(0,B),g.close())};mxCellRenderer.registerShape("message",P);mxUtils.extend(U,mxShape);U.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.ellipse(v/4,0,v/2,B/4);g.fillAndStroke();g.begin();g.moveTo(v/2,B/4);g.lineTo(v/2,2*B/3);g.moveTo(v/2,B/3);g.lineTo(0,B/3);g.moveTo(v/2,B/3);g.lineTo(v,B/3);g.moveTo(v/
+2,2*B/3);g.lineTo(0,B);g.moveTo(v/2,2*B/3);g.lineTo(v,B);g.end();g.stroke()};mxCellRenderer.registerShape("umlActor",U);mxUtils.extend(W,mxShape);W.prototype.getLabelMargins=function(g){return new mxRectangle(g.width/6,0,0,0)};W.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(0,B/4);g.lineTo(0,3*B/4);g.end();g.stroke();g.begin();g.moveTo(0,B/2);g.lineTo(v/6,B/2);g.end();g.stroke();g.ellipse(v/6,0,5*v/6,B);g.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",
W);mxUtils.extend(fa,mxEllipse);fa.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+v/8,D+B);g.lineTo(r+7*v/8,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("umlEntity",fa);mxUtils.extend(X,mxShape);X.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(v,0);g.lineTo(0,B);g.moveTo(0,0);g.lineTo(v,B);g.end();g.stroke()};mxCellRenderer.registerShape("umlDestroy",X);mxUtils.extend(ea,mxShape);
-ea.prototype.getLabelBounds=function(g){return new mxRectangle(g.x,g.y+g.height/8,g.width,7*g.height/8)};ea.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(3*v/8,B/8*1.1);g.lineTo(5*v/8,0);g.end();g.stroke();g.ellipse(0,B/8,v,7*B/8);g.fillAndStroke()};ea.prototype.paintForeground=function(g,r,D,v,B){g.begin();g.moveTo(3*v/8,B/8*1.1);g.lineTo(5*v/8,B/4);g.end();g.stroke()};mxCellRenderer.registerShape("umlControl",ea);mxUtils.extend(la,mxShape);la.prototype.iconSize=
-44;la.prototype.paintBackground=function(g,r,D,v,B){B=Math.min(this.iconSize,v,B);var G=.9*B,I=.45*B;r=r+v/2-B/2;v=D+B/2;var ba=r+.175*G;G=ba-G;g.begin();g.moveTo(G,v-I/2);g.lineTo(G,v+I/2);g.end();g.stroke();g.begin();g.moveTo(G,v);g.lineTo(ba,v);g.end();g.stroke();g.ellipse(r,D,B,B);g.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",la);mxCellRenderer.registerShape("seqControl",oa(ea,44));mxCellRenderer.registerShape("seqEntity",oa(fa,44));mxUtils.extend(ca,mxShape);ca.prototype.paintBackground=
-function(g,r,D,v,B){var G=B/2,I=G/(2.5+B/50);g.save();g.translate(r,D);g.begin();g.moveTo(I,0);g.lineTo(v-I,0);g.arcTo(I,G,0,0,1,v-I,B);g.lineTo(I,B);g.arcTo(I,G,0,0,1,I,0);g.close();g.fillAndStroke();g.restore()};ca.prototype.paintForeground=function(g,r,D,v,B){var G=B/2,I=G/(2.5+B/50);g.save();g.translate(r,D);g.begin();g.moveTo(v-I,0);g.arcTo(I,G,0,0,0,v-I,B);g.stroke();g.restore()};mxCellRenderer.registerShape("seqQueue",ca);mxUtils.extend(sa,mxShape);sa.prototype.paintBackground=function(g,r,
-D,v,B){g.rect(r+6,D-6,v,B);g.fillAndStroke();g.rect(r,D,v,B);g.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",sa);mxUtils.extend(xa,mxShape);xa.prototype.paintBackground=function(g,r,D,v,B){B=v/3;var G=v/3,I=B/2,ba=I/(2.5+B/50);g.translate(r+(v-B)/2,D);g.begin();g.moveTo(0,ba);g.arcTo(I,ba,0,0,0,B,ba);g.arcTo(I,ba,0,0,0,0,ba);g.lineTo(0,G-ba);g.arcTo(I,ba,0,0,0,B,G-ba);g.lineTo(B,ba);g.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",xa);mxUtils.extend(qa,mxShape);qa.prototype.paintBackground=
+ea.prototype.getLabelBounds=function(g){return new mxRectangle(g.x,g.y+g.height/8,g.width,7*g.height/8)};ea.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(3*v/8,B/8*1.1);g.lineTo(5*v/8,0);g.end();g.stroke();g.ellipse(0,B/8,v,7*B/8);g.fillAndStroke()};ea.prototype.paintForeground=function(g,r,D,v,B){g.begin();g.moveTo(3*v/8,B/8*1.1);g.lineTo(5*v/8,B/4);g.end();g.stroke()};mxCellRenderer.registerShape("umlControl",ea);mxUtils.extend(ka,mxShape);ka.prototype.iconSize=
+44;ka.prototype.paintBackground=function(g,r,D,v,B){B=Math.min(this.iconSize,v,B);var G=.9*B,I=.45*B;r=r+v/2-B/2;v=D+B/2;var ca=r+.175*G;G=ca-G;g.begin();g.moveTo(G,v-I/2);g.lineTo(G,v+I/2);g.end();g.stroke();g.begin();g.moveTo(G,v);g.lineTo(ca,v);g.end();g.stroke();g.ellipse(r,D,B,B);g.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",ka);mxCellRenderer.registerShape("seqControl",oa(ea,44));mxCellRenderer.registerShape("seqEntity",oa(fa,44));mxUtils.extend(ba,mxShape);ba.prototype.paintBackground=
+function(g,r,D,v,B){var G=B/2,I=G/(2.5+B/50);g.save();g.translate(r,D);g.begin();g.moveTo(I,0);g.lineTo(v-I,0);g.arcTo(I,G,0,0,1,v-I,B);g.lineTo(I,B);g.arcTo(I,G,0,0,1,I,0);g.close();g.fillAndStroke();g.restore()};ba.prototype.paintForeground=function(g,r,D,v,B){var G=B/2,I=G/(2.5+B/50);g.save();g.translate(r,D);g.begin();g.moveTo(v-I,0);g.arcTo(I,G,0,0,0,v-I,B);g.stroke();g.restore()};mxCellRenderer.registerShape("seqQueue",ba);mxUtils.extend(sa,mxShape);sa.prototype.paintBackground=function(g,r,
+D,v,B){g.rect(r+6,D-6,v,B);g.fillAndStroke();g.rect(r,D,v,B);g.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",sa);mxUtils.extend(xa,mxShape);xa.prototype.paintBackground=function(g,r,D,v,B){B=v/3;var G=v/3,I=B/2,ca=I/(2.5+B/50);g.translate(r+(v-B)/2,D);g.begin();g.moveTo(0,ca);g.arcTo(I,ca,0,0,0,B,ca);g.arcTo(I,ca,0,0,0,0,ca);g.lineTo(0,G-ca);g.arcTo(I,ca,0,0,0,B,G-ca);g.lineTo(B,ca);g.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",xa);mxUtils.extend(qa,mxShape);qa.prototype.paintBackground=
function(g,r,D,v,B){r+=v/2;D+=15;v=D+15;B=v+20;var G=v+10,I=B+15;g.ellipse(r-15,D-15,30,30);g.fillAndStroke();g.begin();g.moveTo(r,v);g.lineTo(r,B);g.moveTo(r-18,G);g.lineTo(r+18,G);g.moveTo(r,B);g.lineTo(r-16,I);g.moveTo(r,B);g.lineTo(r+16,I);g.stroke()};mxCellRenderer.registerShape("seqActorStick",qa);mxUtils.extend(Ba,mxRectangleShape);Ba.prototype.size=40;Ba.prototype.isHtmlAllowed=function(){return!1};Ba.prototype.isMirrored=function(){return"1"==mxUtils.getValue(this.style,"lifelineMirror",
-"0")};Ba.prototype.getHeadSize=function(g){return Math.max(0,Math.min(this.isMirrored()?g/2:g,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};Ba.prototype.getLabelBounds=function(g){var r=Math.max(0,Math.min(this.isMirrored()?g.height/2:g.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(g.x,g.y,g.width,r)};Ba.prototype.paintBackground=function(g,r,D,v,B){var G=this.getHeadSize(B),I=this.isMirrored(),ba=mxUtils.getValue(this.style,"participant");
-null==ba||null==this.state?(mxRectangleShape.prototype.paintBackground.call(this,g,r,D,v,G),I&&mxRectangleShape.prototype.paintBackground.call(this,g,r,D+B-G,v,G)):(ba=this.state.view.graph.cellRenderer.getShape(ba),null!=ba&&ba!=Ba&&(ba=new ba,ba.apply(this.state),g.save(),ba.paintVertexShape(g,r,D,v,G),g.restore(),I&&(g.save(),ba.paintVertexShape(g,r,D+B-G,v,G),g.restore())));B=I?B-G:B;G<B&&(g.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),g.begin(),g.moveTo(r+v/2,D+G),g.lineTo(r+
-v/2,D+B),g.end(),g.stroke())};Ba.prototype.paintForeground=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"participant"),I=this.getHeadSize(B),ba=this.isMirrored();null==G&&(mxRectangleShape.prototype.paintForeground.call(this,g,r,D,v,Math.min(B,I)),ba&&mxRectangleShape.prototype.paintForeground.call(this,g,r,D+B-I,v,I));ba&&this.paintMirrorLabel(g,r,D+B-I,v,I)};Ba.prototype.paintMirrorLabel=function(g,r,D,v,B){var G=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue=
+"0")};Ba.prototype.getHeadSize=function(g){return Math.max(0,Math.min(this.isMirrored()?g/2:g,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};Ba.prototype.getLabelBounds=function(g){var r=Math.max(0,Math.min(this.isMirrored()?g.height/2:g.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(g.x,g.y,g.width,r)};Ba.prototype.paintBackground=function(g,r,D,v,B){var G=this.getHeadSize(B),I=this.isMirrored(),ca=mxUtils.getValue(this.style,"participant");
+null==ca||null==this.state?(mxRectangleShape.prototype.paintBackground.call(this,g,r,D,v,G),I&&mxRectangleShape.prototype.paintBackground.call(this,g,r,D+B-G,v,G)):(ca=this.state.view.graph.cellRenderer.getShape(ca),null!=ca&&ca!=Ba&&(ca=new ca,ca.apply(this.state),g.save(),ca.paintVertexShape(g,r,D,v,G),g.restore(),I&&(g.save(),ca.paintVertexShape(g,r,D+B-G,v,G),g.restore())));B=I?B-G:B;G<B&&(g.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),g.begin(),g.moveTo(r+v/2,D+G),g.lineTo(r+
+v/2,D+B),g.end(),g.stroke())};Ba.prototype.paintForeground=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"participant"),I=this.getHeadSize(B),ca=this.isMirrored();null==G&&(mxRectangleShape.prototype.paintForeground.call(this,g,r,D,v,Math.min(B,I)),ca&&mxRectangleShape.prototype.paintForeground.call(this,g,r,D+B-I,v,I));ca&&this.paintMirrorLabel(g,r,D+B-I,v,I)};Ba.prototype.paintMirrorLabel=function(g,r,D,v,B){var G=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue=
G;if(null!=G&&""!=G){g.setFontColor(mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"black"));g.setFontBackgroundColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null));g.setFontBorderColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null));g.setFontFamily(mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY));g.setFontSize(parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)));
-g.setFontStyle(parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0)));var I=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),ba=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),U=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,2)),za=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,0))+U,pa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,0))+U,Xa=parseFloat(mxUtils.getValue(this.style,
-mxConstants.STYLE_SPACING_LEFT,0))+U;U=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,0))+U;r=I==mxConstants.ALIGN_LEFT?r+Xa:I==mxConstants.ALIGN_RIGHT?r+v-U:r+v/2;D=ba==mxConstants.ALIGN_TOP?D+za+1:ba==mxConstants.ALIGN_BOTTOM?D+B-pa-1:D+B/2;B="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);za="1"==mxUtils.getValue(this.style,"html","0")?"html":"";"html"==za&&(G=Graph.sanitizeHtml(G));g.text(r,D,B?v-Xa-U:0,0,G,I,ba,B,za,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline",
+g.setFontStyle(parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0)));var I=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),ca=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),T=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,2)),za=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,0))+T,pa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,0))+T,Xa=parseFloat(mxUtils.getValue(this.style,
+mxConstants.STYLE_SPACING_LEFT,0))+T;T=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,0))+T;r=I==mxConstants.ALIGN_LEFT?r+Xa:I==mxConstants.ALIGN_RIGHT?r+v-T:r+v/2;D=ca==mxConstants.ALIGN_TOP?D+za+1:ca==mxConstants.ALIGN_BOTTOM?D+B-pa-1:D+B/2;B="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);za="1"==mxUtils.getValue(this.style,"html","0")?"html":"";"html"==za&&(G=Graph.sanitizeHtml(G));g.text(r,D,B?v-Xa-T:0,0,G,I,ca,B,za,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline",
Ba);var Ta=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(g,r){return Ta.apply(this,arguments)||void 0!==r.mirrorLabelValue&&r.mirrorLabelValue!=g.view.graph.getLabel(g.cell)};mxUtils.extend(ma,mxShape);ma.prototype.width=60;ma.prototype.height=30;ma.prototype.corner=10;ma.prototype.configurePointerEvents=function(g){var r=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=r&&r!=mxConstants.NONE&&0!=
this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(g.pointerEvents=!1)};ma.prototype.getLabelMargins=function(g){return new mxRectangle(0,0,g.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),g.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};ma.prototype.paintBackground=function(g,r,D,v,B){var G=this.corner,I=Math.min(v,Math.max(G,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),
-ba=Math.min(B,Math.max(1.5*G,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),U=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);U!=mxConstants.NONE&&(g.setFillColor(U),g.rect(r,D,v,B),g.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(g,r,D,v,B),g.setGradient(this.fill,this.gradient,r,D,v,B,this.gradientDirection)):g.setFillColor(this.fill);g.pointerEvents=!0;g.begin();g.moveTo(r,
-D);g.lineTo(r+I,D);g.lineTo(r+I,D+Math.max(0,ba-1.5*G));g.lineTo(r+Math.max(0,I-G),D+ba);g.lineTo(r,D+ba);g.close();g.fillAndStroke();this.configurePointerEvents(g);g.begin();g.moveTo(r+I,D);g.lineTo(r+v,D);g.lineTo(r+v,D+B);g.lineTo(r,D+B);g.lineTo(r,D+ba);g.stroke()};mxCellRenderer.registerShape("umlFrame",ma);mxPerimeter.CenterPerimeter=function(g,r,D,v){return new mxPoint(g.getCenterX(),g.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=
+ca=Math.min(B,Math.max(1.5*G,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),T=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);T!=mxConstants.NONE&&(g.setFillColor(T),g.rect(r,D,v,B),g.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(g,r,D,v,B),g.setGradient(this.fill,this.gradient,r,D,v,B,this.gradientDirection)):g.setFillColor(this.fill);g.pointerEvents=!0;g.begin();g.moveTo(r,
+D);g.lineTo(r+I,D);g.lineTo(r+I,D+Math.max(0,ca-1.5*G));g.lineTo(r+Math.max(0,I-G),D+ca);g.lineTo(r,D+ca);g.close();g.fillAndStroke();this.configurePointerEvents(g);g.begin();g.moveTo(r+I,D);g.lineTo(r+v,D);g.lineTo(r+v,D+B);g.lineTo(r,D+B);g.lineTo(r,D+ca);g.stroke()};mxCellRenderer.registerShape("umlFrame",ma);mxPerimeter.CenterPerimeter=function(g,r,D,v){return new mxPoint(g.getCenterX(),g.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=
function(g,r,D,v){v=Ba.prototype.size;var B=g.y+g.height;null!=r&&(v=mxUtils.getValue(r.style,"size",v)*r.view.scale,"1"==mxUtils.getValue(r.style,"lifelineMirror","0")&&(B-=v));r=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;D.x<g.getCenterX()&&(r=-1*(r+1));return new mxPoint(g.getCenterX()+r,Math.min(B,Math.max(g.y+v,D.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(g,r,D,v){v=!0;return mxPerimeter.RectanglePerimeter.apply(this,
arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(g,r,D,v){v=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;null!=r.style.backboneSize&&(v+=parseFloat(r.style.backboneSize)*r.view.scale/2-1);if("south"==r.style[mxConstants.STYLE_DIRECTION]||"north"==r.style[mxConstants.STYLE_DIRECTION])return D.x<g.getCenterX()&&(v=-1*(v+1)),new mxPoint(g.getCenterX()+v,Math.min(g.y+g.height,Math.max(g.y,D.y)));
D.y<g.getCenterY()&&(v=-1*(v+1));return new mxPoint(Math.min(g.x+g.width,Math.max(g.x,D.x)),g.getCenterY()+v)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(g,r,D,v){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(g,new mxRectangle(0,0,0,Math.max(0,Math.min(g.height,parseFloat(mxUtils.getValue(r.style,"size",ua.prototype.size))*r.view.scale))),r.style),r,D,v)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);
-mxPerimeter.ParallelogramPerimeter=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?V.prototype.fixedSize:V.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));B&&(G*=r.view.scale);var I=g.x,ba=g.y,U=g.width,za=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ba=
-[new mxPoint(I,ba),new mxPoint(I+U,ba+B),new mxPoint(I+U,ba+za),new mxPoint(I,ba+za-B),new mxPoint(I,ba)]):(B=B?Math.max(0,Math.min(.5*U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I+B,ba),new mxPoint(I+U,ba),new mxPoint(I+U-B,ba+za),new mxPoint(I,ba+za),new mxPoint(I+B,ba)]);za=g.getCenterX();g=g.getCenterY();g=new mxPoint(za,g);v&&(D.x<I||D.x>I+U?g.y=D.y:g.x=D.x);return mxUtils.getPerimeterPoint(ba,g,D)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=
-function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?J.prototype.fixedSize:J.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));B&&(G*=r.view.scale);var I=g.x,ba=g.y,U=g.width,za=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(B=B?Math.max(0,Math.min(.5*U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I+B,ba),new mxPoint(I+U-B,ba),new mxPoint(I+U,ba+za),
-new mxPoint(I,ba+za),new mxPoint(I+B,ba)]):r==mxConstants.DIRECTION_WEST?(B=B?Math.max(0,Math.min(U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I,ba),new mxPoint(I+U,ba),new mxPoint(I+U-B,ba+za),new mxPoint(I+B,ba+za),new mxPoint(I,ba)]):r==mxConstants.DIRECTION_NORTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I,ba+B),new mxPoint(I+U,ba),new mxPoint(I+U,ba+za),new mxPoint(I,ba+za-B),new mxPoint(I,ba+B)]):(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,
-G)),ba=[new mxPoint(I,ba),new mxPoint(I+U,ba+B),new mxPoint(I+U,ba+za-B),new mxPoint(I,ba+za),new mxPoint(I,ba)]);za=g.getCenterX();g=g.getCenterY();g=new mxPoint(za,g);v&&(D.x<I||D.x>I+U?g.y=D.y:g.x=D.x);return mxUtils.getPerimeterPoint(ba,g,D)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?ha.prototype.fixedSize:ha.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,
-"size",G));B&&(G*=r.view.scale);var I=g.x,ba=g.y,U=g.width,za=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(B=B?Math.max(0,Math.min(U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I,ba),new mxPoint(I+U-B,ba),new mxPoint(I+U,g),new mxPoint(I+U-B,ba+za),new mxPoint(I,ba+za),new mxPoint(I+B,g),new mxPoint(I,ba)]):r==mxConstants.DIRECTION_WEST?(B=B?Math.max(0,
-Math.min(U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I+B,ba),new mxPoint(I+U,ba),new mxPoint(I+U-B,g),new mxPoint(I+U,ba+za),new mxPoint(I+B,ba+za),new mxPoint(I,g),new mxPoint(I+B,ba)]):r==mxConstants.DIRECTION_NORTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I,ba+B),new mxPoint(pa,ba),new mxPoint(I+U,ba+B),new mxPoint(I+U,ba+za),new mxPoint(pa,ba+za-B),new mxPoint(I,ba+za),new mxPoint(I,ba+B)]):(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),
-ba=[new mxPoint(I,ba),new mxPoint(pa,ba+B),new mxPoint(I+U,ba),new mxPoint(I+U,ba+za-B),new mxPoint(pa,ba+za),new mxPoint(I,ba+za-B),new mxPoint(I,ba)]);pa=new mxPoint(pa,g);v&&(D.x<I||D.x>I+U?pa.y=D.y:pa.x=D.x);return mxUtils.getPerimeterPoint(ba,pa,D)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?k.prototype.fixedSize:k.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,
-"size",G));B&&(G*=r.view.scale);var I=g.x,ba=g.y,U=g.width,za=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ba=[new mxPoint(pa,ba),new mxPoint(I+U,ba+B),new mxPoint(I+U,ba+za-B),new mxPoint(pa,ba+za),new mxPoint(I,ba+za-B),new mxPoint(I,ba+B),new mxPoint(pa,ba)]):
-(B=B?Math.max(0,Math.min(U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I+B,ba),new mxPoint(I+U-B,ba),new mxPoint(I+U,g),new mxPoint(I+U-B,ba+za),new mxPoint(I+B,ba+za),new mxPoint(I,g),new mxPoint(I+B,ba)]);pa=new mxPoint(pa,g);v&&(D.x<I||D.x>I+U?pa.y=D.y:pa.x=D.x);return mxUtils.getPerimeterPoint(ba,pa,D)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ta,mxShape);ta.prototype.size=10;ta.prototype.paintBackground=function(g,r,D,v,B){var G=parseFloat(mxUtils.getValue(this.style,
+mxPerimeter.ParallelogramPerimeter=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?V.prototype.fixedSize:V.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));B&&(G*=r.view.scale);var I=g.x,ca=g.y,T=g.width,za=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ca=
+[new mxPoint(I,ca),new mxPoint(I+T,ca+B),new mxPoint(I+T,ca+za),new mxPoint(I,ca+za-B),new mxPoint(I,ca)]):(B=B?Math.max(0,Math.min(.5*T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I+B,ca),new mxPoint(I+T,ca),new mxPoint(I+T-B,ca+za),new mxPoint(I,ca+za),new mxPoint(I+B,ca)]);za=g.getCenterX();g=g.getCenterY();g=new mxPoint(za,g);v&&(D.x<I||D.x>I+T?g.y=D.y:g.x=D.x);return mxUtils.getPerimeterPoint(ca,g,D)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=
+function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?J.prototype.fixedSize:J.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));B&&(G*=r.view.scale);var I=g.x,ca=g.y,T=g.width,za=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(B=B?Math.max(0,Math.min(.5*T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I+B,ca),new mxPoint(I+T-B,ca),new mxPoint(I+T,ca+za),
+new mxPoint(I,ca+za),new mxPoint(I+B,ca)]):r==mxConstants.DIRECTION_WEST?(B=B?Math.max(0,Math.min(T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I,ca),new mxPoint(I+T,ca),new mxPoint(I+T-B,ca+za),new mxPoint(I+B,ca+za),new mxPoint(I,ca)]):r==mxConstants.DIRECTION_NORTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I,ca+B),new mxPoint(I+T,ca),new mxPoint(I+T,ca+za),new mxPoint(I,ca+za-B),new mxPoint(I,ca+B)]):(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,
+G)),ca=[new mxPoint(I,ca),new mxPoint(I+T,ca+B),new mxPoint(I+T,ca+za-B),new mxPoint(I,ca+za),new mxPoint(I,ca)]);za=g.getCenterX();g=g.getCenterY();g=new mxPoint(za,g);v&&(D.x<I||D.x>I+T?g.y=D.y:g.x=D.x);return mxUtils.getPerimeterPoint(ca,g,D)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?ha.prototype.fixedSize:ha.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,
+"size",G));B&&(G*=r.view.scale);var I=g.x,ca=g.y,T=g.width,za=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(B=B?Math.max(0,Math.min(T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I,ca),new mxPoint(I+T-B,ca),new mxPoint(I+T,g),new mxPoint(I+T-B,ca+za),new mxPoint(I,ca+za),new mxPoint(I+B,g),new mxPoint(I,ca)]):r==mxConstants.DIRECTION_WEST?(B=B?Math.max(0,
+Math.min(T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I+B,ca),new mxPoint(I+T,ca),new mxPoint(I+T-B,g),new mxPoint(I+T,ca+za),new mxPoint(I+B,ca+za),new mxPoint(I,g),new mxPoint(I+B,ca)]):r==mxConstants.DIRECTION_NORTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I,ca+B),new mxPoint(pa,ca),new mxPoint(I+T,ca+B),new mxPoint(I+T,ca+za),new mxPoint(pa,ca+za-B),new mxPoint(I,ca+za),new mxPoint(I,ca+B)]):(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),
+ca=[new mxPoint(I,ca),new mxPoint(pa,ca+B),new mxPoint(I+T,ca),new mxPoint(I+T,ca+za-B),new mxPoint(pa,ca+za),new mxPoint(I,ca+za-B),new mxPoint(I,ca)]);pa=new mxPoint(pa,g);v&&(D.x<I||D.x>I+T?pa.y=D.y:pa.x=D.x);return mxUtils.getPerimeterPoint(ca,pa,D)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?k.prototype.fixedSize:k.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,
+"size",G));B&&(G*=r.view.scale);var I=g.x,ca=g.y,T=g.width,za=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ca=[new mxPoint(pa,ca),new mxPoint(I+T,ca+B),new mxPoint(I+T,ca+za-B),new mxPoint(pa,ca+za),new mxPoint(I,ca+za-B),new mxPoint(I,ca+B),new mxPoint(pa,ca)]):
+(B=B?Math.max(0,Math.min(T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I+B,ca),new mxPoint(I+T-B,ca),new mxPoint(I+T,g),new mxPoint(I+T-B,ca+za),new mxPoint(I+B,ca+za),new mxPoint(I,g),new mxPoint(I+B,ca)]);pa=new mxPoint(pa,g);v&&(D.x<I||D.x>I+T?pa.y=D.y:pa.x=D.x);return mxUtils.getPerimeterPoint(ca,pa,D)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ta,mxShape);ta.prototype.size=10;ta.prototype.paintBackground=function(g,r,D,v,B){var G=parseFloat(mxUtils.getValue(this.style,
"size",this.size));g.translate(r,D);g.ellipse((v-G)/2,0,G,G);g.fillAndStroke();g.begin();g.moveTo(v/2,G);g.lineTo(v/2,B);g.end();g.stroke()};mxCellRenderer.registerShape("lollipop",ta);mxUtils.extend(va,mxShape);va.prototype.size=10;va.prototype.inset=2;va.prototype.paintBackground=function(g,r,D,v,B){var G=parseFloat(mxUtils.getValue(this.style,"size",this.size)),I=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,D);g.begin();g.moveTo(v/2,G+I);g.lineTo(v/
-2,B);g.end();g.stroke();g.begin();g.moveTo((v-G)/2-I,G/2);g.quadTo((v-G)/2-I,G+I,v/2,G+I);g.quadTo((v+G)/2+I,G+I,(v+G)/2+I,G/2);g.end();g.stroke()};mxCellRenderer.registerShape("requires",va);mxUtils.extend(Ha,mxShape);Ha.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(0,0);g.quadTo(v,0,v,B/2);g.quadTo(v,B,0,B);g.end();g.stroke()};mxCellRenderer.registerShape("requiredInterface",Ha);mxUtils.extend(La,mxShape);La.prototype.inset=2;La.prototype.paintBackground=function(g,
+2,B);g.end();g.stroke();g.begin();g.moveTo((v-G)/2-I,G/2);g.quadTo((v-G)/2-I,G+I,v/2,G+I);g.quadTo((v+G)/2+I,G+I,(v+G)/2+I,G/2);g.end();g.stroke()};mxCellRenderer.registerShape("requires",va);mxUtils.extend(Ga,mxShape);Ga.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(0,0);g.quadTo(v,0,v,B/2);g.quadTo(v,B,0,B);g.end();g.stroke()};mxCellRenderer.registerShape("requiredInterface",Ga);mxUtils.extend(La,mxShape);La.prototype.inset=2;La.prototype.paintBackground=function(g,
r,D,v,B){var G=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,D);g.ellipse(0,G,v-2*G,B-2*G);g.fillAndStroke();g.begin();g.moveTo(v/2,0);g.quadTo(v,0,v,B/2);g.quadTo(v,B,v/2,B);g.end();g.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",La);mxUtils.extend(Ia,mxCylinder);Ia.prototype.jettyWidth=20;Ia.prototype.jettyHeight=10;Ia.prototype.redrawPath=function(g,r,D,v,B,G){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));
-r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));D=I/2;I=D+I/2;var ba=Math.min(r,B-r),U=Math.min(ba+2*r,B-r);G?(g.moveTo(D,ba),g.lineTo(I,ba),g.lineTo(I,ba+r),g.lineTo(D,ba+r),g.moveTo(D,U),g.lineTo(I,U),g.lineTo(I,U+r),g.lineTo(D,U+r)):(g.moveTo(D,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(D,B),g.lineTo(D,U+r),g.lineTo(0,U+r),g.lineTo(0,U),g.lineTo(D,U),g.lineTo(D,ba+r),g.lineTo(0,ba+r),g.lineTo(0,ba),g.lineTo(D,ba),g.close());g.end()};mxCellRenderer.registerShape("module",
-Ia);mxUtils.extend(Ca,mxCylinder);Ca.prototype.jettyWidth=32;Ca.prototype.jettyHeight=12;Ca.prototype.redrawPath=function(g,r,D,v,B,G){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));D=I/2;I=D+I/2;var ba=.3*B-r/2,U=.7*B-r/2;G?(g.moveTo(D,ba),g.lineTo(I,ba),g.lineTo(I,ba+r),g.lineTo(D,ba+r),g.moveTo(D,U),g.lineTo(I,U),g.lineTo(I,U+r),g.lineTo(D,U+r)):(g.moveTo(D,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(D,
-B),g.lineTo(D,U+r),g.lineTo(0,U+r),g.lineTo(0,U),g.lineTo(D,U),g.lineTo(D,ba+r),g.lineTo(0,ba+r),g.lineTo(0,ba),g.lineTo(D,ba),g.close());g.end()};mxCellRenderer.registerShape("component",Ca);mxUtils.extend(Pa,mxRectangleShape);Pa.prototype.paintForeground=function(g,r,D,v,B){var G=v/2,I=B/2,ba=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;g.begin();this.addPoints(g,[new mxPoint(r+G,D),new mxPoint(r+v,D+I),new mxPoint(r+G,D+B),new mxPoint(r,D+I)],this.isRounded,
-ba,!0);g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Pa);mxUtils.extend(Ka,mxDoubleEllipse);Ka.prototype.outerStroke=!0;Ka.prototype.paintVertexShape=function(g,r,D,v,B){var G=Math.min(4,Math.min(v/5,B/5));0<v&&0<B&&(g.ellipse(r+G,D+G,v-2*G,B-2*G),g.fillAndStroke());g.setShadow(!1);this.outerStroke&&(g.ellipse(r,D,v,B),g.stroke())};mxCellRenderer.registerShape("endState",Ka);mxUtils.extend(Na,Ka);Na.prototype.outerStroke=
+r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));D=I/2;I=D+I/2;var ca=Math.min(r,B-r),T=Math.min(ca+2*r,B-r);G?(g.moveTo(D,ca),g.lineTo(I,ca),g.lineTo(I,ca+r),g.lineTo(D,ca+r),g.moveTo(D,T),g.lineTo(I,T),g.lineTo(I,T+r),g.lineTo(D,T+r)):(g.moveTo(D,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(D,B),g.lineTo(D,T+r),g.lineTo(0,T+r),g.lineTo(0,T),g.lineTo(D,T),g.lineTo(D,ca+r),g.lineTo(0,ca+r),g.lineTo(0,ca),g.lineTo(D,ca),g.close());g.end()};mxCellRenderer.registerShape("module",
+Ia);mxUtils.extend(Ca,mxCylinder);Ca.prototype.jettyWidth=32;Ca.prototype.jettyHeight=12;Ca.prototype.redrawPath=function(g,r,D,v,B,G){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));D=I/2;I=D+I/2;var ca=.3*B-r/2,T=.7*B-r/2;G?(g.moveTo(D,ca),g.lineTo(I,ca),g.lineTo(I,ca+r),g.lineTo(D,ca+r),g.moveTo(D,T),g.lineTo(I,T),g.lineTo(I,T+r),g.lineTo(D,T+r)):(g.moveTo(D,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(D,
+B),g.lineTo(D,T+r),g.lineTo(0,T+r),g.lineTo(0,T),g.lineTo(D,T),g.lineTo(D,ca+r),g.lineTo(0,ca+r),g.lineTo(0,ca),g.lineTo(D,ca),g.close());g.end()};mxCellRenderer.registerShape("component",Ca);mxUtils.extend(Pa,mxRectangleShape);Pa.prototype.paintForeground=function(g,r,D,v,B){var G=v/2,I=B/2,ca=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;g.begin();this.addPoints(g,[new mxPoint(r+G,D),new mxPoint(r+v,D+I),new mxPoint(r+G,D+B),new mxPoint(r,D+I)],this.isRounded,
+ca,!0);g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Pa);mxUtils.extend(Ka,mxDoubleEllipse);Ka.prototype.outerStroke=!0;Ka.prototype.paintVertexShape=function(g,r,D,v,B){var G=Math.min(4,Math.min(v/5,B/5));0<v&&0<B&&(g.ellipse(r+G,D+G,v-2*G,B-2*G),g.fillAndStroke());g.setShadow(!1);this.outerStroke&&(g.ellipse(r,D,v,B),g.stroke())};mxCellRenderer.registerShape("endState",Ka);mxUtils.extend(Na,Ka);Na.prototype.outerStroke=
!1;mxCellRenderer.registerShape("startState",Na);mxUtils.extend(Oa,mxArrowConnector);Oa.prototype.defaultWidth=4;Oa.prototype.isOpenEnded=function(){return!0};Oa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};Oa.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",Oa);mxUtils.extend(Ea,mxArrowConnector);Ea.prototype.defaultWidth=10;Ea.prototype.defaultArrowWidth=20;Ea.prototype.getStartArrowWidth=
function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Ea.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ea.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ea);mxUtils.extend(Aa,mxActor);Aa.prototype.size=30;Aa.prototype.isRoundable=function(){return!0};
Aa.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(0,g,0,0)):null};Aa.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size)));D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,B),new mxPoint(0,r),new mxPoint(v,0),new mxPoint(v,B)],this.isRounded,D,
!0);g.end()};mxCellRenderer.registerShape("manualInput",Aa);mxUtils.extend(Ja,mxRectangleShape);Ja.prototype.dx=20;Ja.prototype.dy=20;Ja.prototype.isHtmlAllowed=function(){return!1};Ja.prototype.paintForeground=function(g,r,D,v,B){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var G=0;if(this.isRounded){var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;G=Math.max(G,Math.min(v*I,B*I))}I=Math.max(G,Math.min(v,parseFloat(mxUtils.getValue(this.style,
-"dx",this.dx))));G=Math.max(G,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.begin();g.moveTo(r,D+G);g.lineTo(r+v,D+G);g.end();g.stroke();g.begin();g.moveTo(r+I,D);g.lineTo(r+I,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("internalStorage",Ja);mxUtils.extend(Ga,mxActor);Ga.prototype.dx=20;Ga.prototype.dy=20;Ga.prototype.isRoundable=function(){return!0};Ga.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));
-D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,D),new mxPoint(r,D),new mxPoint(r,B),new mxPoint(0,B)],this.isRounded,G,!0);g.end()};mxCellRenderer.registerShape("corner",Ga);mxUtils.extend(Ua,mxActor);Ua.prototype.redrawPath=function(g,r,D,v,B){g.moveTo(0,
+"dx",this.dx))));G=Math.max(G,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.begin();g.moveTo(r,D+G);g.lineTo(r+v,D+G);g.end();g.stroke();g.begin();g.moveTo(r+I,D);g.lineTo(r+I,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("internalStorage",Ja);mxUtils.extend(Ha,mxActor);Ha.prototype.dx=20;Ha.prototype.dy=20;Ha.prototype.isRoundable=function(){return!0};Ha.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));
+D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,D),new mxPoint(r,D),new mxPoint(r,B),new mxPoint(0,B)],this.isRounded,G,!0);g.end()};mxCellRenderer.registerShape("corner",Ha);mxUtils.extend(Ua,mxActor);Ua.prototype.redrawPath=function(g,r,D,v,B){g.moveTo(0,
0);g.lineTo(0,B);g.end();g.moveTo(v,0);g.lineTo(v,B);g.end();g.moveTo(0,B/2);g.lineTo(v,B/2);g.end()};mxCellRenderer.registerShape("crossbar",Ua);mxUtils.extend(ab,mxActor);ab.prototype.dx=20;ab.prototype.dy=20;ab.prototype.isRoundable=function(){return!0};ab.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",
this.size));var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,D),new mxPoint((v+r)/2,D),new mxPoint((v+r)/2,B),new mxPoint((v-r)/2,B),new mxPoint((v-r)/2,D),new mxPoint(0,D)],this.isRounded,G,!0);g.end()};mxCellRenderer.registerShape("tee",ab);mxUtils.extend(Wa,mxActor);Wa.prototype.arrowWidth=.3;Wa.prototype.arrowSize=.2;Wa.prototype.isRoundable=function(){return!0};Wa.prototype.redrawPath=function(g,
r,D,v,B){var G=B*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));r=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));D=(B-G)/2;G=D+G;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,D),new mxPoint(v-r,D),new mxPoint(v-r,0),new mxPoint(v,B/2),new mxPoint(v-r,B),new mxPoint(v-r,G),new mxPoint(0,G)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("singleArrow",
@@ -3362,9 +3363,9 @@ D,!0);g.end()};mxCellRenderer.registerShape("loopLimit",Ra);mxUtils.extend($a,mx
g.end()};mxCellRenderer.registerShape("offPageConnector",$a);mxUtils.extend(fb,mxEllipse);fb.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+v/2,D+B);g.lineTo(r+v,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("tapeData",fb);mxUtils.extend(rb,mxEllipse);rb.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,D+B/2);g.lineTo(r+
v,D+B/2);g.end();g.stroke();g.begin();g.moveTo(r+v/2,D);g.lineTo(r+v/2,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("orEllipse",rb);mxUtils.extend(mb,mxEllipse);mb.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r+.145*v,D+.145*B);g.lineTo(r+.855*v,D+.855*B);g.end();g.stroke();g.begin();g.moveTo(r+.855*v,D+.145*B);g.lineTo(r+.145*v,D+.855*B);g.end();g.stroke()};mxCellRenderer.registerShape("sumEllipse",
mb);mxUtils.extend(ub,mxRhombus);ub.prototype.paintVertexShape=function(g,r,D,v,B){mxRhombus.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,D+B/2);g.lineTo(r+v,D+B/2);g.end();g.stroke()};mxCellRenderer.registerShape("sortShape",ub);mxUtils.extend(Eb,mxEllipse);Eb.prototype.paintVertexShape=function(g,r,D,v,B){g.begin();g.moveTo(r,D);g.lineTo(r+v,D);g.lineTo(r+v/2,D+B/2);g.close();g.fillAndStroke();g.begin();g.moveTo(r,D+B);g.lineTo(r+v,D+B);g.lineTo(r+v/2,D+
-B/2);g.close();g.fillAndStroke()};mxCellRenderer.registerShape("collate",Eb);mxUtils.extend(Fb,mxEllipse);Fb.prototype.paintVertexShape=function(g,r,D,v,B){var G=g.state.strokeWidth/2,I=10+2*G,ba=D+B-I/2;g.begin();g.moveTo(r,D);g.lineTo(r,D+B);g.moveTo(r+G,ba);g.lineTo(r+G+I,ba-I/2);g.moveTo(r+G,ba);g.lineTo(r+G+I,ba+I/2);g.moveTo(r+G,ba);g.lineTo(r+v-G,ba);g.moveTo(r+v,D);g.lineTo(r+v,D+B);g.moveTo(r+v-G,ba);g.lineTo(r+v-I-G,ba-I/2);g.moveTo(r+v-G,ba);g.lineTo(r+v-I-G,ba+I/2);g.end();g.stroke()};
-mxCellRenderer.registerShape("dimension",Fb);mxUtils.extend(Tb,mxEllipse);Tb.prototype.drawHidden=!0;Tb.prototype.paintVertexShape=function(g,r,D,v,B){this.outline||g.setStrokeColor(null);if(null!=this.style){var G=g.pointerEvents,I=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||I||(g.pointerEvents=!1);var ba="1"==mxUtils.getValue(this.style,"top","1"),U="1"==mxUtils.getValue(this.style,"left","1"),za="1"==mxUtils.getValue(this.style,
-"right","1"),pa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||I||this.outline||ba||za||pa||U?(g.rect(r,D,v,B),g.fill(),g.pointerEvents=G,g.setStrokeColor(this.stroke),g.setLineCap("square"),g.begin(),g.moveTo(r,D),this.outline||ba?g.lineTo(r+v,D):g.moveTo(r+v,D),this.outline||za?g.lineTo(r+v,D+B):g.moveTo(r+v,D+B),this.outline||pa?g.lineTo(r,D+B):g.moveTo(r,D+B),(this.outline||U)&&g.lineTo(r,D),g.end(),g.stroke(),g.setLineCap("flat")):g.setStrokeColor(this.stroke)}null==this.state||
+B/2);g.close();g.fillAndStroke()};mxCellRenderer.registerShape("collate",Eb);mxUtils.extend(Fb,mxEllipse);Fb.prototype.paintVertexShape=function(g,r,D,v,B){var G=g.state.strokeWidth/2,I=10+2*G,ca=D+B-I/2;g.begin();g.moveTo(r,D);g.lineTo(r,D+B);g.moveTo(r+G,ca);g.lineTo(r+G+I,ca-I/2);g.moveTo(r+G,ca);g.lineTo(r+G+I,ca+I/2);g.moveTo(r+G,ca);g.lineTo(r+v-G,ca);g.moveTo(r+v,D);g.lineTo(r+v,D+B);g.moveTo(r+v-G,ca);g.lineTo(r+v-I-G,ca-I/2);g.moveTo(r+v-G,ca);g.lineTo(r+v-I-G,ca+I/2);g.end();g.stroke()};
+mxCellRenderer.registerShape("dimension",Fb);mxUtils.extend(Tb,mxEllipse);Tb.prototype.drawHidden=!0;Tb.prototype.paintVertexShape=function(g,r,D,v,B){this.outline||g.setStrokeColor(null);if(null!=this.style){var G=g.pointerEvents,I=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||I||(g.pointerEvents=!1);var ca="1"==mxUtils.getValue(this.style,"top","1"),T="1"==mxUtils.getValue(this.style,"left","1"),za="1"==mxUtils.getValue(this.style,
+"right","1"),pa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||I||this.outline||ca||za||pa||T?(g.rect(r,D,v,B),g.fill(),g.pointerEvents=G,g.setStrokeColor(this.stroke),g.setLineCap("square"),g.begin(),g.moveTo(r,D),this.outline||ca?g.lineTo(r+v,D):g.moveTo(r+v,D),this.outline||za?g.lineTo(r+v,D+B):g.moveTo(r+v,D+B),this.outline||pa?g.lineTo(r,D+B):g.moveTo(r,D+B),(this.outline||T)&&g.lineTo(r,D),g.end(),g.stroke(),g.setLineCap("flat")):g.setStrokeColor(this.stroke)}null==this.state||
this.outline||null==this.fill||this.fill==mxConstants.NONE||(G=this.state.view.graph,null!=G.paintTableCellLines&&G.paintTableCellLines(g,this.state.cell,r,D,v,B,this.stroke,this.strokewidth))};mxCellRenderer.registerShape("partialRectangle",Tb);mxUtils.extend(Rb,mxEllipse);Rb.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();"vertical"==mxUtils.getValue(this.style,"line")?(g.moveTo(r+v/2,D),g.lineTo(r+v/2,D+B)):(g.moveTo(r,
D+B/2),g.lineTo(r+v,D+B/2));g.end();g.stroke()};mxCellRenderer.registerShape("lineEllipse",Rb);mxUtils.extend($b,mxActor);$b.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(v,B/2);g.moveTo(0,0);g.lineTo(v-r,0);g.quadTo(v,0,v,B/2);g.quadTo(v,B,v-r,B);g.lineTo(0,B);g.close();g.end()};mxCellRenderer.registerShape("delay",$b);mxUtils.extend(Mb,mxActor);Mb.prototype.size=.2;Mb.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(B,v);var G=Math.max(0,Math.min(r,r*parseFloat(mxUtils.getValue(this.style,
"size",this.size))));r=(B-G)/2;D=r+G;var I=(v-G)/2;G=I+G;g.moveTo(0,r);g.lineTo(I,r);g.lineTo(I,0);g.lineTo(G,0);g.lineTo(G,r);g.lineTo(v,r);g.lineTo(v,D);g.lineTo(G,D);g.lineTo(G,B);g.lineTo(I,B);g.lineTo(I,D);g.lineTo(0,D);g.close();g.end()};mxCellRenderer.registerShape("cross",Mb);mxUtils.extend(Wb,mxActor);Wb.prototype.size=.25;Wb.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(v,B/2);D=Math.min(v-r,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*v);g.moveTo(0,B/2);g.lineTo(D,
@@ -3373,74 +3374,74 @@ type:"float",defVal:10},{name:"absoluteCornerSize",dispName:"Abs. Corner Size",t
dispName:"Inside Gradient Direction",type:"enum",defVal:"south",enumList:[{val:"south",dispName:"South"},{val:"west",dispName:"West"},{val:"north",dispName:"North"},{val:"east",dispName:"East"}]},{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"right",dispName:"Right",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left ",type:"bool",defVal:!0},{name:"topLeftStyle",dispName:"Top Left Style",type:"enum",defVal:"default",enumList:[{val:"default",
dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"topRightStyle",dispName:"Top Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomRightStyle",dispName:"Bottom Right Style",
type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomLeftStyle",dispName:"Bottom Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",
-dispName:"Fold"}]}];zb.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);this.strictDrawShape(g,0,0,v,B)};zb.prototype.strictDrawShape=function(g,r,D,v,B,G){var I=G&&G.rectStyle?G.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ba=G&&G.absoluteCornerSize?G.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),U=G&&G.size?G.size:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),za=G&&G.rectOutline?
+dispName:"Fold"}]}];zb.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);this.strictDrawShape(g,0,0,v,B)};zb.prototype.strictDrawShape=function(g,r,D,v,B,G){var I=G&&G.rectStyle?G.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ca=G&&G.absoluteCornerSize?G.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),T=G&&G.size?G.size:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),za=G&&G.rectOutline?
G.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),pa=G&&G.indent?G.indent:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Xa=G&&G.dashed?G.dashed:mxUtils.getValue(this.style,"dashed",!1),vb=G&&G.dashPattern?G.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),jb=G&&G.relIndent?G.relIndent:Math.max(0,Math.min(50,pa)),Sa=G&&G.top?G.top:mxUtils.getValue(this.style,"top",!0),Va=G&&G.right?G.right:mxUtils.getValue(this.style,"right",
!0),Qa=G&&G.bottom?G.bottom:mxUtils.getValue(this.style,"bottom",!0),Ya=G&&G.left?G.left:mxUtils.getValue(this.style,"left",!0),db=G&&G.topLeftStyle?G.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),lb=G&&G.topRightStyle?G.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),ob=G&&G.bottomRightStyle?G.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),nb=G&&G.bottomLeftStyle?G.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle",
"default"),ec=G&&G.fillColor?G.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");G&&G.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var hc=G&&G.strokeWidth?G.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),fc=G&&G.fillColor2?G.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),gc=G&&G.gradientColor2?G.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),ic=G&&G.gradientDirection2?G.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2",
-"south"),jc=G&&G.opacity?G.opacity:mxUtils.getValue(this.style,"opacity","100"),kc=Math.max(0,Math.min(50,U));G=zb.prototype;g.setDashed(Xa);vb&&""!=vb&&g.setDashPattern(vb);g.setStrokeWidth(hc);U=Math.min(.5*B,.5*v,U);ba||(U=kc*Math.min(v,B)/100);U=Math.min(U,.5*Math.min(v,B));ba||(pa=Math.min(jb*Math.min(v,B)/100));pa=Math.min(pa,.5*Math.min(v,B)-U);(Sa||Va||Qa||Ya)&&"frame"!=za&&(g.begin(),Sa?G.moveNW(g,r,D,v,B,I,db,U,Ya):g.moveTo(0,0),Sa&&G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,
-lb,U,Va),Va&&G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),Qa&&G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),Ya&&G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),g.close(),g.fill(),g.setShadow(!1),g.setFillColor(fc),Xa=ba=jc,"none"==fc&&(ba=0),"none"==gc&&(Xa=0),g.setGradient(fc,gc,0,0,v,B,ic,ba,Xa),g.begin(),Sa?G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya):g.moveTo(pa,0),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),Ya&&Qa&&G.paintSWInner(g,r,D,v,B,
-I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),Qa&&Va&&G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),Va&&Sa&&G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),Sa&&Ya&&G.paintNWInner(g,r,D,v,B,I,db,U,pa),g.fill(),"none"==ec&&(g.begin(),G.paintFolds(g,r,D,v,B,I,db,lb,ob,nb,U,Sa,Va,Qa,Ya),g.stroke()));Sa||Va||Qa||!Ya?Sa||Va||!Qa||Ya?!Sa&&!Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,
-B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.lineNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,
-r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),g.close(),g.fillAndStroke()):Sa||!Va||Qa||Ya?!Sa&&Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,db,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya)),g.stroke(),g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va)),
-g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,db,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.lineNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close(),g.fillAndStroke(),g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.lineSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa&&Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,
-r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.lineSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,
-U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa&&Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,
-r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.lineNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,
-r,D,v,B,I,lb,U,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa||Va||Qa||Ya?Sa&&!Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,
-r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.lineNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close(),g.fillAndStroke()):Sa&&!Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa)),g.stroke(),g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,
-r,D,v,B,I,nb,U,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.lineNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),g.close(),g.fillAndStroke(),g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.lineSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),g.close(),g.fillAndStroke()):
-Sa&&!Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa)),g.stroke()):
-(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.lineNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),g.close(),g.fillAndStroke()):Sa&&Va&&!Qa&&!Ya?"frame"!=
-za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.lineSEInner(g,r,D,v,B,I,ob,U,pa,
-Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),g.close(),g.fillAndStroke()):Sa&&Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,
-r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.lineSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,
-I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close(),g.fillAndStroke()):Sa&&Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,
-r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.lineSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,
-r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),g.close(),g.fillAndStroke()):Sa&&Va&&Qa&&Ya&&("frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),g.close(),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintSWInner(g,r,
-D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close()),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,
-r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),g.close(),G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close(),
-g.fillAndStroke())):"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.lineNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),"double"==za&&(G.moveSEInner(g,
-r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.lineSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveSE(g,r,D,v,B,I,ob,
-U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.lineSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,db,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,db,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.lineNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,
-pa,Qa,Ya),g.close(),g.fillAndStroke());g.begin();G.paintFolds(g,r,D,v,B,I,db,lb,ob,nb,U,Sa,Va,Qa,Ya);g.stroke()};zb.prototype.moveNW=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(0,0):g.moveTo(0,ba)};zb.prototype.moveNE=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(v,0):g.moveTo(v-ba,0)};zb.prototype.moveSE=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(v,B):g.moveTo(v,B-ba)};zb.prototype.moveSW=
-function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(0,B):g.moveTo(ba,B)};zb.prototype.paintNW=function(g,r,D,v,B,G,I,ba,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ba,ba,0,0,r,ba,0)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(ba,0);else g.lineTo(0,0)};zb.prototype.paintTop=function(g,r,D,v,B,G,I,ba,U){"square"==I||
-"default"==I&&"square"==G||!U?g.lineTo(v,0):g.lineTo(v-ba,0)};zb.prototype.paintNE=function(g,r,D,v,B,G,I,ba,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ba,ba,0,0,r,v,ba)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v,ba);else g.lineTo(v,0)};zb.prototype.paintRight=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.lineTo(v,
-B):g.lineTo(v,B-ba)};zb.prototype.paintLeft=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.lineTo(0,0):g.lineTo(0,ba)};zb.prototype.paintSE=function(g,r,D,v,B,G,I,ba,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ba,ba,0,0,r,v-ba,B)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-ba,B);else g.lineTo(v,B)};zb.prototype.paintBottom=
-function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.lineTo(0,B):g.lineTo(ba,B)};zb.prototype.paintSW=function(g,r,D,v,B,G,I,ba,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ba,ba,0,0,r,0,B-ba)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(0,B-ba);else g.lineTo(0,B)};zb.prototype.paintNWInner=function(g,r,D,v,B,G,I,ba,U){if("rounded"==
-I||"default"==I&&"rounded"==G)g.arcTo(ba-.5*U,ba-.5*U,0,0,0,U,.5*U+ba);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ba+U,ba+U,0,0,1,U,U+ba);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(U,.5*U+ba);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(U+ba,U+ba),g.lineTo(U,U+ba)};zb.prototype.paintTopInner=function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(0,U):za&&!pa?g.lineTo(U,0):za?"square"==I||"default"==I&&"square"==G?g.lineTo(U,U):"rounded"==I||"default"==I&&"rounded"==
-G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(ba+.5*U,U):g.lineTo(ba+U,U):g.lineTo(0,U):g.lineTo(0,0)};zb.prototype.paintNEInner=function(g,r,D,v,B,G,I,ba,U){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ba-.5*U,ba-.5*U,0,0,0,v-ba-.5*U,U);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ba+U,ba+U,0,0,1,v-ba-U,U);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(v-ba-.5*U,U);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(v-ba-U,ba+U),g.lineTo(v-ba-U,U)};zb.prototype.paintRightInner=
-function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(v-U,0):za&&!pa?g.lineTo(v,U):za?"square"==I||"default"==I&&"square"==G?g.lineTo(v-U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-U,ba+.5*U):g.lineTo(v-U,ba+U):g.lineTo(v-U,0):g.lineTo(v,0)};zb.prototype.paintLeftInner=function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(U,B):za&&!pa?g.lineTo(0,B-U):za?"square"==I||"default"==I&&"square"==G?g.lineTo(U,B-U):"rounded"==I||"default"==I&&"rounded"==
-G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(U,B-ba-.5*U):g.lineTo(U,B-ba-U):g.lineTo(U,B):g.lineTo(0,B)};zb.prototype.paintSEInner=function(g,r,D,v,B,G,I,ba,U){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ba-.5*U,ba-.5*U,0,0,0,v-U,B-ba-.5*U);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ba+U,ba+U,0,0,1,v-U,B-ba-U);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(v-U,B-ba-.5*U);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(v-ba-U,B-ba-U),g.lineTo(v-U,B-ba-U)};zb.prototype.paintBottomInner=
-function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(v,B-U):za&&!pa?g.lineTo(v-U,B):"square"==I||"default"==I&&"square"==G||!za?g.lineTo(v-U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-ba-.5*U,B-U):g.lineTo(v-ba-U,B-U):g.lineTo(v,B)};zb.prototype.paintSWInner=function(g,r,D,v,B,G,I,ba,U,za){if(!za)g.lineTo(U,B);else if("square"==I||"default"==I&&"square"==G)g.lineTo(U,B-U);else if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ba-.5*U,ba-.5*
-U,0,0,0,ba+.5*U,B-U);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ba+U,ba+U,0,0,1,ba+U,B-U);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(ba+.5*U,B-U);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(U+ba,B-ba-U),g.lineTo(U+ba,B-U)};zb.prototype.moveSWInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==G?g.moveTo(U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(U,B-ba-.5*U):("invRound"==I||"default"==I&&"invRound"==
-G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(U,B-ba-U):g.moveTo(0,B-U)};zb.prototype.lineSWInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==G?g.lineTo(U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(U,B-ba-.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(U,B-ba-U):g.lineTo(0,B-U)};zb.prototype.moveSEInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==
-G?g.moveTo(v-U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(v-U,B-ba-.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(v-U,B-ba-U):g.moveTo(v-U,B)};zb.prototype.lineSEInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==G?g.lineTo(v-U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-U,B-ba-.5*U):("invRound"==I||"default"==I&&"invRound"==
-G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-U,B-ba-U):g.lineTo(v-U,B)};zb.prototype.moveNEInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==G||za?g.moveTo(v-U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(v-U,ba+.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(v-U,ba+U):g.moveTo(v,U)};zb.prototype.lineNEInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==
-G||za?g.lineTo(v-U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-U,ba+.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-U,ba+U):g.lineTo(v,U)};zb.prototype.moveNWInner=function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.moveTo(U,0):za&&!pa?g.moveTo(0,U):"square"==I||"default"==I&&"square"==G?g.moveTo(U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(U,ba+.5*U):("invRound"==
-I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(U,ba+U):g.moveTo(0,0)};zb.prototype.lineNWInner=function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(U,0):za&&!pa?g.lineTo(0,U):"square"==I||"default"==I&&"square"==G?g.lineTo(U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(U,ba+.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(U,ba+U):g.lineTo(0,0)};zb.prototype.paintFolds=function(g,
-r,D,v,B,G,I,ba,U,za,pa,Xa,vb,jb,Sa){if("fold"==G||"fold"==I||"fold"==ba||"fold"==U||"fold"==za)("fold"==I||"default"==I&&"fold"==G)&&Xa&&Sa&&(g.moveTo(0,pa),g.lineTo(pa,pa),g.lineTo(pa,0)),("fold"==ba||"default"==ba&&"fold"==G)&&Xa&&vb&&(g.moveTo(v-pa,0),g.lineTo(v-pa,pa),g.lineTo(v,pa)),("fold"==U||"default"==U&&"fold"==G)&&jb&&vb&&(g.moveTo(v-pa,B),g.lineTo(v-pa,B-pa),g.lineTo(v,B-pa)),("fold"==za||"default"==za&&"fold"==G)&&jb&&Sa&&(g.moveTo(0,B-pa),g.lineTo(pa,B-pa),g.lineTo(pa,B))};mxCellRenderer.registerShape(zb.prototype.cst.RECT2,
+"south"),jc=G&&G.opacity?G.opacity:mxUtils.getValue(this.style,"opacity","100"),kc=Math.max(0,Math.min(50,T));G=zb.prototype;g.setDashed(Xa);vb&&""!=vb&&g.setDashPattern(vb);g.setStrokeWidth(hc);T=Math.min(.5*B,.5*v,T);ca||(T=kc*Math.min(v,B)/100);T=Math.min(T,.5*Math.min(v,B));ca||(pa=Math.min(jb*Math.min(v,B)/100));pa=Math.min(pa,.5*Math.min(v,B)-T);(Sa||Va||Qa||Ya)&&"frame"!=za&&(g.begin(),Sa?G.moveNW(g,r,D,v,B,I,db,T,Ya):g.moveTo(0,0),Sa&&G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,
+lb,T,Va),Va&&G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),Qa&&G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),Ya&&G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),g.close(),g.fill(),g.setShadow(!1),g.setFillColor(fc),Xa=ca=jc,"none"==fc&&(ca=0),"none"==gc&&(Xa=0),g.setGradient(fc,gc,0,0,v,B,ic,ca,Xa),g.begin(),Sa?G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya):g.moveTo(pa,0),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),Ya&&Qa&&G.paintSWInner(g,r,D,v,B,
+I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),Qa&&Va&&G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),Va&&Sa&&G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),Sa&&Ya&&G.paintNWInner(g,r,D,v,B,I,db,T,pa),g.fill(),"none"==ec&&(g.begin(),G.paintFolds(g,r,D,v,B,I,db,lb,ob,nb,T,Sa,Va,Qa,Ya),g.stroke()));Sa||Va||Qa||!Ya?Sa||Va||!Qa||Ya?!Sa&&!Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,
+B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.lineNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,
+r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),g.close(),g.fillAndStroke()):Sa||!Va||Qa||Ya?!Sa&&Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,db,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya)),g.stroke(),g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va)),
+g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,db,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.lineNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close(),g.fillAndStroke(),g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.lineSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa&&Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,
+r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.lineSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,
+T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa&&Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,
+r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.lineNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,
+r,D,v,B,I,lb,T,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa||Va||Qa||Ya?Sa&&!Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,
+r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.lineNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close(),g.fillAndStroke()):Sa&&!Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa)),g.stroke(),g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,
+r,D,v,B,I,nb,T,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.lineNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),g.close(),g.fillAndStroke(),g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.lineSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),g.close(),g.fillAndStroke()):
+Sa&&!Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa)),g.stroke()):
+(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.lineNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),g.close(),g.fillAndStroke()):Sa&&Va&&!Qa&&!Ya?"frame"!=
+za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.lineSEInner(g,r,D,v,B,I,ob,T,pa,
+Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),g.close(),g.fillAndStroke()):Sa&&Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,
+r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.lineSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,
+I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close(),g.fillAndStroke()):Sa&&Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,
+r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.lineSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,
+r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),g.close(),g.fillAndStroke()):Sa&&Va&&Qa&&Ya&&("frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),g.close(),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintSWInner(g,r,
+D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close()),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,
+r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),g.close(),G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close(),
+g.fillAndStroke())):"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.lineNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),"double"==za&&(G.moveSEInner(g,
+r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.lineSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveSE(g,r,D,v,B,I,ob,
+T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.lineSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,db,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,db,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.lineNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,
+pa,Qa,Ya),g.close(),g.fillAndStroke());g.begin();G.paintFolds(g,r,D,v,B,I,db,lb,ob,nb,T,Sa,Va,Qa,Ya);g.stroke()};zb.prototype.moveNW=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.moveTo(0,0):g.moveTo(0,ca)};zb.prototype.moveNE=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.moveTo(v,0):g.moveTo(v-ca,0)};zb.prototype.moveSE=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.moveTo(v,B):g.moveTo(v,B-ca)};zb.prototype.moveSW=
+function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.moveTo(0,B):g.moveTo(ca,B)};zb.prototype.paintNW=function(g,r,D,v,B,G,I,ca,T){if(T)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ca,ca,0,0,r,ca,0)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(ca,0);else g.lineTo(0,0)};zb.prototype.paintTop=function(g,r,D,v,B,G,I,ca,T){"square"==I||
+"default"==I&&"square"==G||!T?g.lineTo(v,0):g.lineTo(v-ca,0)};zb.prototype.paintNE=function(g,r,D,v,B,G,I,ca,T){if(T)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ca,ca,0,0,r,v,ca)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v,ca);else g.lineTo(v,0)};zb.prototype.paintRight=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.lineTo(v,
+B):g.lineTo(v,B-ca)};zb.prototype.paintLeft=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.lineTo(0,0):g.lineTo(0,ca)};zb.prototype.paintSE=function(g,r,D,v,B,G,I,ca,T){if(T)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ca,ca,0,0,r,v-ca,B)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-ca,B);else g.lineTo(v,B)};zb.prototype.paintBottom=
+function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.lineTo(0,B):g.lineTo(ca,B)};zb.prototype.paintSW=function(g,r,D,v,B,G,I,ca,T){if(T)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ca,ca,0,0,r,0,B-ca)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(0,B-ca);else g.lineTo(0,B)};zb.prototype.paintNWInner=function(g,r,D,v,B,G,I,ca,T){if("rounded"==
+I||"default"==I&&"rounded"==G)g.arcTo(ca-.5*T,ca-.5*T,0,0,0,T,.5*T+ca);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ca+T,ca+T,0,0,1,T,T+ca);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(T,.5*T+ca);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(T+ca,T+ca),g.lineTo(T,T+ca)};zb.prototype.paintTopInner=function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(0,T):za&&!pa?g.lineTo(T,0):za?"square"==I||"default"==I&&"square"==G?g.lineTo(T,T):"rounded"==I||"default"==I&&"rounded"==
+G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(ca+.5*T,T):g.lineTo(ca+T,T):g.lineTo(0,T):g.lineTo(0,0)};zb.prototype.paintNEInner=function(g,r,D,v,B,G,I,ca,T){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ca-.5*T,ca-.5*T,0,0,0,v-ca-.5*T,T);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ca+T,ca+T,0,0,1,v-ca-T,T);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(v-ca-.5*T,T);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(v-ca-T,ca+T),g.lineTo(v-ca-T,T)};zb.prototype.paintRightInner=
+function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(v-T,0):za&&!pa?g.lineTo(v,T):za?"square"==I||"default"==I&&"square"==G?g.lineTo(v-T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-T,ca+.5*T):g.lineTo(v-T,ca+T):g.lineTo(v-T,0):g.lineTo(v,0)};zb.prototype.paintLeftInner=function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(T,B):za&&!pa?g.lineTo(0,B-T):za?"square"==I||"default"==I&&"square"==G?g.lineTo(T,B-T):"rounded"==I||"default"==I&&"rounded"==
+G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(T,B-ca-.5*T):g.lineTo(T,B-ca-T):g.lineTo(T,B):g.lineTo(0,B)};zb.prototype.paintSEInner=function(g,r,D,v,B,G,I,ca,T){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ca-.5*T,ca-.5*T,0,0,0,v-T,B-ca-.5*T);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ca+T,ca+T,0,0,1,v-T,B-ca-T);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(v-T,B-ca-.5*T);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(v-ca-T,B-ca-T),g.lineTo(v-T,B-ca-T)};zb.prototype.paintBottomInner=
+function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(v,B-T):za&&!pa?g.lineTo(v-T,B):"square"==I||"default"==I&&"square"==G||!za?g.lineTo(v-T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-ca-.5*T,B-T):g.lineTo(v-ca-T,B-T):g.lineTo(v,B)};zb.prototype.paintSWInner=function(g,r,D,v,B,G,I,ca,T,za){if(!za)g.lineTo(T,B);else if("square"==I||"default"==I&&"square"==G)g.lineTo(T,B-T);else if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ca-.5*T,ca-.5*
+T,0,0,0,ca+.5*T,B-T);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ca+T,ca+T,0,0,1,ca+T,B-T);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(ca+.5*T,B-T);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(T+ca,B-ca-T),g.lineTo(T+ca,B-T)};zb.prototype.moveSWInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==G?g.moveTo(T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(T,B-ca-.5*T):("invRound"==I||"default"==I&&"invRound"==
+G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(T,B-ca-T):g.moveTo(0,B-T)};zb.prototype.lineSWInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==G?g.lineTo(T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(T,B-ca-.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(T,B-ca-T):g.lineTo(0,B-T)};zb.prototype.moveSEInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==
+G?g.moveTo(v-T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(v-T,B-ca-.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(v-T,B-ca-T):g.moveTo(v-T,B)};zb.prototype.lineSEInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==G?g.lineTo(v-T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-T,B-ca-.5*T):("invRound"==I||"default"==I&&"invRound"==
+G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-T,B-ca-T):g.lineTo(v-T,B)};zb.prototype.moveNEInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==G||za?g.moveTo(v-T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(v-T,ca+.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(v-T,ca+T):g.moveTo(v,T)};zb.prototype.lineNEInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==
+G||za?g.lineTo(v-T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-T,ca+.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-T,ca+T):g.lineTo(v,T)};zb.prototype.moveNWInner=function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.moveTo(T,0):za&&!pa?g.moveTo(0,T):"square"==I||"default"==I&&"square"==G?g.moveTo(T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(T,ca+.5*T):("invRound"==
+I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(T,ca+T):g.moveTo(0,0)};zb.prototype.lineNWInner=function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(T,0):za&&!pa?g.lineTo(0,T):"square"==I||"default"==I&&"square"==G?g.lineTo(T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(T,ca+.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(T,ca+T):g.lineTo(0,0)};zb.prototype.paintFolds=function(g,
+r,D,v,B,G,I,ca,T,za,pa,Xa,vb,jb,Sa){if("fold"==G||"fold"==I||"fold"==ca||"fold"==T||"fold"==za)("fold"==I||"default"==I&&"fold"==G)&&Xa&&Sa&&(g.moveTo(0,pa),g.lineTo(pa,pa),g.lineTo(pa,0)),("fold"==ca||"default"==ca&&"fold"==G)&&Xa&&vb&&(g.moveTo(v-pa,0),g.lineTo(v-pa,pa),g.lineTo(v,pa)),("fold"==T||"default"==T&&"fold"==G)&&jb&&vb&&(g.moveTo(v-pa,B),g.lineTo(v-pa,B-pa),g.lineTo(v,B-pa)),("fold"==za||"default"==za&&"fold"==G)&&jb&&Sa&&(g.moveTo(0,B-pa),g.lineTo(pa,B-pa),g.lineTo(pa,B))};mxCellRenderer.registerShape(zb.prototype.cst.RECT2,
zb);zb.prototype.constraints=null;mxUtils.extend(Ub,mxConnector);Ub.prototype.origPaintEdgeShape=Ub.prototype.paintEdgeShape;Ub.prototype.paintEdgeShape=function(g,r){for(var D=[],v=0;v<r.length;v++)D.push(mxUtils.clone(r[v]));v=g.state.dashed;var B=g.state.fixDash;Ub.prototype.origPaintEdgeShape.apply(this,[g,D]);3<=g.state.strokeWidth&&(D=mxUtils.getValue(this.style,"fillColor",null),null!=D&&(g.setStrokeColor(D),g.setStrokeWidth(g.state.strokeWidth-2),g.setDashed(v,B),Ub.prototype.origPaintEdgeShape.apply(this,
[g,r])))};mxCellRenderer.registerShape("filledEdge",Ub);mxUtils.extend(Lb,mxConnector);Lb.prototype.defaultWidth=4;Lb.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Lb.prototype.getFlowAnimationPath=function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)||mxShape.prototype.getFlowAnimationPath.call(this)};Lb.prototype.origPaintEdgeShape=Lb.prototype.paintEdgeShape;Lb.prototype.paintEdgeShape=function(g,r){for(var D=[],v=
0;v<r.length;v++)D.push(mxUtils.clone(r[v]));v=g.state.dashed;var B=g.state.fixDash,G=this.getEdgeWidth();g.setStrokeWidth(G+2*this.strokewidth);g.setDashed(!1);Lb.prototype.origPaintEdgeShape.apply(this,[g,D]);D=mxUtils.getValue(this.style,"fillColor",null);null!=D&&(g.setStrokeWidth(G),g.setStrokeColor(D),g.setDashed(v,B),Lb.prototype.origPaintEdgeShape.apply(this,[g,r]))};mxCellRenderer.registerShape("pipe",Lb);mxUtils.extend(Xb,mxRectangleShape);Xb.prototype.size=10;Xb.prototype.isRoundable=function(){return!0};
-Xb.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=r&&r!=mxConstants.NONE&&(g.setStrokeColor("none"),g.begin(),g.rect(0,0,v,B),g.fillAndStroke(),g.setStrokeColor(this.stroke));var G=Math.max(5,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=B/2;D=this.strokewidth;D=this.isRounded?D/2:D;B-=D;G=Math.max(1,Math.round(v/G)-1);var I=v/(G+1),ba=I/2;g.begin();g.moveTo(0,r);if(this.isRounded){g.curveTo(.4*ba,
-r-.4*(r-D),.6*ba,D,ba,D);for(var U=0;U<G;U++){var za=ba+U*I,pa=za+I,Xa=0==U%2?B:D;g.curveTo(za+.4*I,0==U%2?D:B,pa-.4*I,Xa,pa,Xa)}B=0==G%2?D:B;g.curveTo(ba+G*I+.4*ba,B,v-.4*ba,r-(B==D?1:-1)*(r-D)*.4,v,r)}else{g.lineTo(ba,D);for(U=0;U<G;U++)pa=ba+(U+1)*I,Xa=0==U%2?B:D,g.lineTo(pa,Xa);g.lineTo(v,r)}g.stroke()};mxCellRenderer.registerShape("zigzag",Xb);"undefined"!==typeof StyleFormatPanel&&function(){var g=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var r=
-this.editorUi.getSelectionState(),D=g.apply(this,arguments);"umlFrame"==r.style.shape&&D.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return D}}();mxMarker.addMarker("dash",function(g,r,D,v,B,G,I,ba,U,za){var pa=B*(I+U+1),Xa=G*(I+U+1);return function(){g.begin();g.moveTo(v.x-pa/2-Xa/2,v.y-Xa/2+pa/2);g.lineTo(v.x+Xa/2-3*pa/2,v.y-3*Xa/2-pa/2);g.stroke()}});mxMarker.addMarker("box",function(g,r,D,v,B,G,I,ba,U,za){var pa=B*(I+U+1),Xa=G*(I+U+1),vb=v.x+pa/2,
-jb=v.y+Xa/2;v.x-=pa;v.y-=Xa;return function(){g.begin();g.moveTo(vb-pa/2-Xa/2,jb-Xa/2+pa/2);g.lineTo(vb-pa/2+Xa/2,jb-Xa/2-pa/2);g.lineTo(vb+Xa/2-3*pa/2,jb-3*Xa/2-pa/2);g.lineTo(vb-Xa/2-3*pa/2,jb-3*Xa/2+pa/2);g.close();za?g.fillAndStroke():g.stroke()}});mxMarker.addMarker("cross",function(g,r,D,v,B,G,I,ba,U,za){var pa=B*(I+U+1),Xa=G*(I+U+1);return function(){g.begin();g.moveTo(v.x-pa/2-Xa/2,v.y-Xa/2+pa/2);g.lineTo(v.x+Xa/2-3*pa/2,v.y-3*Xa/2-pa/2);g.moveTo(v.x-pa/2+Xa/2,v.y-Xa/2-pa/2);g.lineTo(v.x-
-Xa/2-3*pa/2,v.y-3*Xa/2+pa/2);g.stroke()}});mxMarker.addMarker("circle",bc);mxMarker.addMarker("circlePlus",function(g,r,D,v,B,G,I,ba,U,za){var pa=v.clone(),Xa=bc.apply(this,arguments),vb=B*(I+2*U),jb=G*(I+2*U);return function(){Xa.apply(this,arguments);g.begin();g.moveTo(pa.x-B*U,pa.y-G*U);g.lineTo(pa.x-2*vb+B*U,pa.y-2*jb+G*U);g.moveTo(pa.x-vb-jb+G*U,pa.y-jb+vb-B*U);g.lineTo(pa.x+jb-vb-G*U,pa.y-jb-vb+B*U);g.stroke()}});mxMarker.addMarker("halfCircle",function(g,r,D,v,B,G,I,ba,U,za){var pa=B*(I+U+
-1),Xa=G*(I+U+1),vb=v.clone();v.x-=pa;v.y-=Xa;return function(){g.begin();g.moveTo(vb.x-Xa,vb.y+pa);g.quadTo(v.x-Xa,v.y+pa,v.x,v.y);g.quadTo(v.x+Xa,v.y-pa,vb.x+Xa,vb.y-pa);g.stroke()}});mxMarker.addMarker("async",function(g,r,D,v,B,G,I,ba,U,za){r=B*U*1.118;D=G*U*1.118;B*=I+U;G*=I+U;var pa=v.clone();pa.x-=r;pa.y-=D;v.x+=-B-r;v.y+=-G-D;return function(){g.begin();g.moveTo(pa.x,pa.y);ba?g.lineTo(pa.x-B-G/2,pa.y-G+B/2):g.lineTo(pa.x+G/2-B,pa.y-G-B/2);g.lineTo(pa.x-B,pa.y-G);g.close();za?g.fillAndStroke():
-g.stroke()}});mxMarker.addMarker("openAsync",function(g){g=null!=g?g:2;return function(r,D,v,B,G,I,ba,U,za,pa){G*=ba+za;I*=ba+za;var Xa=B.clone();return function(){r.begin();r.moveTo(Xa.x,Xa.y);U?r.lineTo(Xa.x-G-I/g,Xa.y-I+G/g):r.lineTo(Xa.x+I/g-G,Xa.y-I-G/g);r.stroke()}}}(2));mxMarker.addMarker("mermaidExtension",function(){var g=17/6;return function(r,D,v,B,G,I,ba,U,za,pa){G*=ba+za;I*=ba+za;var Xa=B.clone();B.x-=G;B.y-=I;return function(){r.begin();r.moveTo(Xa.x,Xa.y);r.lineTo(Xa.x-G-I/g,Xa.y-I+
-G/g);r.lineTo(Xa.x-G+I/g,Xa.y-I-G/g);r.close();pa?r.fillAndStroke():r.stroke()}}}());mxMarker.addMarker("mermaidDiamond",function(g,r,D,v,B,G,I,ba,U,za){var pa=17/6;B*=I+U;G*=I+U;var Xa=v.clone();v.x-=B;v.y-=G;return function(){g.begin();g.moveTo(Xa.x,Xa.y);g.lineTo(Xa.x-B/2-G/pa,Xa.y-G/2+B/pa);g.lineTo(Xa.x-B,Xa.y-G);g.lineTo(Xa.x-B/2+G/pa,Xa.y-G/2-B/pa);g.close();za?g.fillAndStroke():g.stroke()}});mxUtils.extend(Hb,mxRectangleShape);Hb.prototype.arcStartY=25;Hb.prototype.arcMidY=-25;Hb.prototype.arcEndY=
-25;Hb.prototype.paintForeground=function(g,r,D,v,B){mxRectangleShape.prototype.paintForeground.apply(this,arguments);if(null!=this.state){var G=this.state.view.graph;if(null==G.cellEditor||G.cellEditor.editingCell!=this.state.cell)if(G=G.convertValueToString(this.state.cell),null!=G&&0!=G.length){var I=parseFloat(mxUtils.getValue(this.style,"arcStartY",this.arcStartY)),ba=parseFloat(mxUtils.getValue(this.style,"arcMidY",this.arcMidY)),U=parseFloat(mxUtils.getValue(this.style,"arcEndY",this.arcEndY)),
-za=mxUtils.getValue(this.style,"curveType","round");if(null!=g.root&&"function"===typeof g.getBaseUrl){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;g.translate(r,D);var pa=g.state,Xa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),vb=Xa/2,jb=(I+U)/2,Sa=Math.max(Math.abs(Hb.prototype.arcMidY),Math.min(jb,B-jb));ba=Math.max(-Sa,Math.min(Sa,
-ba));var Va=jb+ba;ba=Math.min(I,U,Va);Sa=Math.max(I,U,Va);jb=Sa-ba;var Qa=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this._curveYOffset=jb=Qa==mxConstants.ALIGN_TOP?vb-ba:Qa==mxConstants.ALIGN_BOTTOM?B-vb-Sa:(B-jb)/2-ba;Qa=v-vb;ba=(vb+pa.dx)*pa.scale;I=(I+jb+pa.dy)*pa.scale;Sa=((vb+Qa)/2+pa.dx)*pa.scale;Va=(Va+jb+pa.dy)*pa.scale;vb=(Qa+pa.dx)*pa.scale;U=(U+jb+pa.dy)*pa.scale;"round"==za?(Qa=Math.sqrt((vb-ba)*(vb-ba)+(U-I)*(U-I)),za=(ba+vb)/2,jb=(I+U)/2,
-za=Math.sqrt((Sa-za)*(Sa-za)+(Va-jb)*(Va-jb)),.5>za?(za="M "+g.format(ba)+" "+g.format(I)+" L "+g.format(vb)+" "+g.format(U),ba=Qa):(Qa/=2,jb=Qa*Qa/(2*za)+za/2,Va=0<(vb-ba)*(Va-I)-(U-I)*(Sa-ba)?0:1,Sa=za>Qa?1:0,za="M "+g.format(ba)+" "+g.format(I)+" A "+g.format(jb)+" "+g.format(jb)+" 0 "+Sa+" "+Va+" "+g.format(vb)+" "+g.format(U),ba=2*Math.asin(Math.min(1,Qa/jb)),Sa&&(ba=2*Math.PI-ba),ba*=jb)):(za="M "+g.format(ba)+" "+g.format(I)+" Q "+g.format(Sa)+" "+g.format(Va)+" "+g.format(vb)+" "+g.format(U),
-jb=Sa-ba,Qa=Va-I,Sa=vb-Sa,Va=U-Va,ba=vb-ba,I=U-I,ba=(Math.sqrt(jb*jb+Qa*Qa)+Math.sqrt(Sa*Sa+Va*Va)+Math.sqrt(ba*ba+I*I))/2);U=(g.idPrefix||"")+"ctp-"+mxObjectIdentity.get(this);Sa=(I=!mxClient.IS_CHROMEAPP&&g.root.ownerDocument==document)?g.getBaseUrl().replace(/([\(\)])/g,"\\$1"):"";vb=g.createElement("g");Va=pa.transform||"";0<Va.length&&vb.setAttribute("transform",Va);1>pa.alpha&&vb.setAttribute("opacity",pa.alpha);Va=g.createElement("defs");jb=g.createElement("path");jb.setAttribute("id",U);jb.setAttribute("d",
+Xb.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=r&&r!=mxConstants.NONE&&(g.setStrokeColor("none"),g.begin(),g.rect(0,0,v,B),g.fillAndStroke(),g.setStrokeColor(this.stroke));var G=Math.max(5,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=B/2;D=this.strokewidth;D=this.isRounded?D/2:D;B-=D;G=Math.max(1,Math.round(v/G)-1);var I=v/(G+1),ca=I/2;g.begin();g.moveTo(0,r);if(this.isRounded){g.curveTo(.4*ca,
+r-.4*(r-D),.6*ca,D,ca,D);for(var T=0;T<G;T++){var za=ca+T*I,pa=za+I,Xa=0==T%2?B:D;g.curveTo(za+.4*I,0==T%2?D:B,pa-.4*I,Xa,pa,Xa)}B=0==G%2?D:B;g.curveTo(ca+G*I+.4*ca,B,v-.4*ca,r-(B==D?1:-1)*(r-D)*.4,v,r)}else{g.lineTo(ca,D);for(T=0;T<G;T++)pa=ca+(T+1)*I,Xa=0==T%2?B:D,g.lineTo(pa,Xa);g.lineTo(v,r)}g.stroke()};mxCellRenderer.registerShape("zigzag",Xb);"undefined"!==typeof StyleFormatPanel&&function(){var g=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var r=
+this.editorUi.getSelectionState(),D=g.apply(this,arguments);"umlFrame"==r.style.shape&&D.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return D}}();mxMarker.addMarker("dash",function(g,r,D,v,B,G,I,ca,T,za){var pa=B*(I+T+1),Xa=G*(I+T+1);return function(){g.begin();g.moveTo(v.x-pa/2-Xa/2,v.y-Xa/2+pa/2);g.lineTo(v.x+Xa/2-3*pa/2,v.y-3*Xa/2-pa/2);g.stroke()}});mxMarker.addMarker("box",function(g,r,D,v,B,G,I,ca,T,za){var pa=B*(I+T+1),Xa=G*(I+T+1),vb=v.x+pa/2,
+jb=v.y+Xa/2;v.x-=pa;v.y-=Xa;return function(){g.begin();g.moveTo(vb-pa/2-Xa/2,jb-Xa/2+pa/2);g.lineTo(vb-pa/2+Xa/2,jb-Xa/2-pa/2);g.lineTo(vb+Xa/2-3*pa/2,jb-3*Xa/2-pa/2);g.lineTo(vb-Xa/2-3*pa/2,jb-3*Xa/2+pa/2);g.close();za?g.fillAndStroke():g.stroke()}});mxMarker.addMarker("cross",function(g,r,D,v,B,G,I,ca,T,za){var pa=B*(I+T+1),Xa=G*(I+T+1);return function(){g.begin();g.moveTo(v.x-pa/2-Xa/2,v.y-Xa/2+pa/2);g.lineTo(v.x+Xa/2-3*pa/2,v.y-3*Xa/2-pa/2);g.moveTo(v.x-pa/2+Xa/2,v.y-Xa/2-pa/2);g.lineTo(v.x-
+Xa/2-3*pa/2,v.y-3*Xa/2+pa/2);g.stroke()}});mxMarker.addMarker("circle",bc);mxMarker.addMarker("circlePlus",function(g,r,D,v,B,G,I,ca,T,za){var pa=v.clone(),Xa=bc.apply(this,arguments),vb=B*(I+2*T),jb=G*(I+2*T);return function(){Xa.apply(this,arguments);g.begin();g.moveTo(pa.x-B*T,pa.y-G*T);g.lineTo(pa.x-2*vb+B*T,pa.y-2*jb+G*T);g.moveTo(pa.x-vb-jb+G*T,pa.y-jb+vb-B*T);g.lineTo(pa.x+jb-vb-G*T,pa.y-jb-vb+B*T);g.stroke()}});mxMarker.addMarker("halfCircle",function(g,r,D,v,B,G,I,ca,T,za){var pa=B*(I+T+
+1),Xa=G*(I+T+1),vb=v.clone();v.x-=pa;v.y-=Xa;return function(){g.begin();g.moveTo(vb.x-Xa,vb.y+pa);g.quadTo(v.x-Xa,v.y+pa,v.x,v.y);g.quadTo(v.x+Xa,v.y-pa,vb.x+Xa,vb.y-pa);g.stroke()}});mxMarker.addMarker("async",function(g,r,D,v,B,G,I,ca,T,za){r=B*T*1.118;D=G*T*1.118;B*=I+T;G*=I+T;var pa=v.clone();pa.x-=r;pa.y-=D;v.x+=-B-r;v.y+=-G-D;return function(){g.begin();g.moveTo(pa.x,pa.y);ca?g.lineTo(pa.x-B-G/2,pa.y-G+B/2):g.lineTo(pa.x+G/2-B,pa.y-G-B/2);g.lineTo(pa.x-B,pa.y-G);g.close();za?g.fillAndStroke():
+g.stroke()}});mxMarker.addMarker("openAsync",function(g){g=null!=g?g:2;return function(r,D,v,B,G,I,ca,T,za,pa){G*=ca+za;I*=ca+za;var Xa=B.clone();return function(){r.begin();r.moveTo(Xa.x,Xa.y);T?r.lineTo(Xa.x-G-I/g,Xa.y-I+G/g):r.lineTo(Xa.x+I/g-G,Xa.y-I-G/g);r.stroke()}}}(2));mxMarker.addMarker("mermaidExtension",function(){var g=17/6;return function(r,D,v,B,G,I,ca,T,za,pa){G*=ca+za;I*=ca+za;var Xa=B.clone();B.x-=G;B.y-=I;return function(){r.begin();r.moveTo(Xa.x,Xa.y);r.lineTo(Xa.x-G-I/g,Xa.y-I+
+G/g);r.lineTo(Xa.x-G+I/g,Xa.y-I-G/g);r.close();pa?r.fillAndStroke():r.stroke()}}}());mxMarker.addMarker("mermaidDiamond",function(g,r,D,v,B,G,I,ca,T,za){var pa=17/6;B*=I+T;G*=I+T;var Xa=v.clone();v.x-=B;v.y-=G;return function(){g.begin();g.moveTo(Xa.x,Xa.y);g.lineTo(Xa.x-B/2-G/pa,Xa.y-G/2+B/pa);g.lineTo(Xa.x-B,Xa.y-G);g.lineTo(Xa.x-B/2+G/pa,Xa.y-G/2-B/pa);g.close();za?g.fillAndStroke():g.stroke()}});mxUtils.extend(Hb,mxRectangleShape);Hb.prototype.arcStartY=25;Hb.prototype.arcMidY=-25;Hb.prototype.arcEndY=
+25;Hb.prototype.paintForeground=function(g,r,D,v,B){mxRectangleShape.prototype.paintForeground.apply(this,arguments);if(null!=this.state){var G=this.state.view.graph;if(null==G.cellEditor||G.cellEditor.editingCell!=this.state.cell)if(G=G.convertValueToString(this.state.cell),null!=G&&0!=G.length){var I=parseFloat(mxUtils.getValue(this.style,"arcStartY",this.arcStartY)),ca=parseFloat(mxUtils.getValue(this.style,"arcMidY",this.arcMidY)),T=parseFloat(mxUtils.getValue(this.style,"arcEndY",this.arcEndY)),
+za=mxUtils.getValue(this.style,"curveType","round");if(null!=g.root&&"function"===typeof g.getBaseUrl){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;g.translate(r,D);var pa=g.state,Xa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),vb=Xa/2,jb=(I+T)/2,Sa=Math.max(Math.abs(Hb.prototype.arcMidY),Math.min(jb,B-jb));ca=Math.max(-Sa,Math.min(Sa,
+ca));var Va=jb+ca;ca=Math.min(I,T,Va);Sa=Math.max(I,T,Va);jb=Sa-ca;var Qa=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this._curveYOffset=jb=Qa==mxConstants.ALIGN_TOP?vb-ca:Qa==mxConstants.ALIGN_BOTTOM?B-vb-Sa:(B-jb)/2-ca;Qa=v-vb;ca=(vb+pa.dx)*pa.scale;I=(I+jb+pa.dy)*pa.scale;Sa=((vb+Qa)/2+pa.dx)*pa.scale;Va=(Va+jb+pa.dy)*pa.scale;vb=(Qa+pa.dx)*pa.scale;T=(T+jb+pa.dy)*pa.scale;"round"==za?(Qa=Math.sqrt((vb-ca)*(vb-ca)+(T-I)*(T-I)),za=(ca+vb)/2,jb=(I+T)/2,
+za=Math.sqrt((Sa-za)*(Sa-za)+(Va-jb)*(Va-jb)),.5>za?(za="M "+g.format(ca)+" "+g.format(I)+" L "+g.format(vb)+" "+g.format(T),ca=Qa):(Qa/=2,jb=Qa*Qa/(2*za)+za/2,Va=0<(vb-ca)*(Va-I)-(T-I)*(Sa-ca)?0:1,Sa=za>Qa?1:0,za="M "+g.format(ca)+" "+g.format(I)+" A "+g.format(jb)+" "+g.format(jb)+" 0 "+Sa+" "+Va+" "+g.format(vb)+" "+g.format(T),ca=2*Math.asin(Math.min(1,Qa/jb)),Sa&&(ca=2*Math.PI-ca),ca*=jb)):(za="M "+g.format(ca)+" "+g.format(I)+" Q "+g.format(Sa)+" "+g.format(Va)+" "+g.format(vb)+" "+g.format(T),
+jb=Sa-ca,Qa=Va-I,Sa=vb-Sa,Va=T-Va,ca=vb-ca,I=T-I,ca=(Math.sqrt(jb*jb+Qa*Qa)+Math.sqrt(Sa*Sa+Va*Va)+Math.sqrt(ca*ca+I*I))/2);T=(g.idPrefix||"")+"ctp-"+mxObjectIdentity.get(this);Sa=(I=!mxClient.IS_CHROMEAPP&&g.root.ownerDocument==document)?g.getBaseUrl().replace(/([\(\)])/g,"\\$1"):"";vb=g.createElement("g");Va=pa.transform||"";0<Va.length&&vb.setAttribute("transform",Va);1>pa.alpha&&vb.setAttribute("opacity",pa.alpha);Va=g.createElement("defs");jb=g.createElement("path");jb.setAttribute("id",T);jb.setAttribute("d",
za);Va.appendChild(jb);vb.appendChild(Va);za=g.createElement("text");jb=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);Qa=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#000000");Va=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0);za.setAttribute("font-size",Xa*pa.scale+"px");za.setAttribute("font-family",mxUtils.parseCssFontFamily(jb));za.setAttribute("fill",Qa);(Va&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&za.setAttribute("font-weight",
"bold");(Va&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&za.setAttribute("font-style","italic");pa=[];(Va&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&pa.push("underline");(Va&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&pa.push("line-through");0<pa.length&&(za.setAttribute("text-decoration",pa.join(" ")),(Va&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(za.style.textDecorationStyle="dotted"));Xa=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,
-mxConstants.ALIGN_CENTER);Va="middle";pa="50%";Xa==mxConstants.ALIGN_LEFT?(Va="start",pa="0%"):Xa==mxConstants.ALIGN_RIGHT&&(Va="end",pa="100%");za.setAttribute("text-anchor",Va);za.setAttribute("dominant-baseline","central");Xa=g.createElement("textPath");Xa.setAttribute("startOffset",pa);pa=(I?Sa:"")+"#"+U;Xa.setAttribute("href",pa);I&&Xa.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",pa);Xa.setAttribute("textLength",ba);Xa.setAttribute("lengthAdjust","spacing");mxUtils.write(Xa,G);
+mxConstants.ALIGN_CENTER);Va="middle";pa="50%";Xa==mxConstants.ALIGN_LEFT?(Va="start",pa="0%"):Xa==mxConstants.ALIGN_RIGHT&&(Va="end",pa="100%");za.setAttribute("text-anchor",Va);za.setAttribute("dominant-baseline","central");Xa=g.createElement("textPath");Xa.setAttribute("startOffset",pa);pa=(I?Sa:"")+"#"+T;Xa.setAttribute("href",pa);I&&Xa.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",pa);Xa.setAttribute("textLength",ca);Xa.setAttribute("lengthAdjust","spacing");mxUtils.write(Xa,G);
za.appendChild(Xa);vb.appendChild(za);g.root.appendChild(vb);this._curvedTextGroup=vb}else g.text(r+v/2,D+B/2,0,0,G,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,!1,"",null,!1,0)}}};Hb.prototype.destroy=function(){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;mxRectangleShape.prototype.destroy.apply(this,arguments)};mxCellRenderer.registerShape("curvedText",Hb);mxUtils.extend(Ob,
mxActor);Ob.prototype.tabSize=8;Ob.prototype.tabInset=4;Ob.prototype.holeSize=1;Ob.prototype.isRoundable=function(){return!1};Ob.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))));var G=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"tabInset",this.tabInset))));D=(B-G)/2;G=D+G;g.moveTo(0,D);g.lineTo(0,G);g.lineTo(r,B);g.lineTo(v,B);g.lineTo(v,0);g.lineTo(r,0);g.close();g.end()};Ob.prototype.paintVertexShape=
-function(g,r,D,v,B){mxActor.prototype.paintVertexShape.apply(this,arguments);var G=Math.max(0,parseFloat(mxUtils.getValue(this.style,"holeSize",this.holeSize)));if(!(0>=G)){var I=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize)),ba=mxUtils.getValue(this.style,"holeColor",mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#333333"));g.setFillColor(ba);g.setStrokeColor(ba);g.begin();g.ellipse(I/2-G,B/2-G,2*G,2*G);g.fillAndStroke()}};Ob.prototype.getLabelBounds=function(g){var r=
+function(g,r,D,v,B){mxActor.prototype.paintVertexShape.apply(this,arguments);var G=Math.max(0,parseFloat(mxUtils.getValue(this.style,"holeSize",this.holeSize)));if(!(0>=G)){var I=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize)),ca=mxUtils.getValue(this.style,"holeColor",mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#333333"));g.setFillColor(ca);g.setStrokeColor(ca);g.begin();g.ellipse(I/2-G,B/2-G,2*G,2*G);g.fillAndStroke()}};Ob.prototype.getLabelBounds=function(g){var r=
parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))*this.scale;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("gitTag",Ob);mxUtils.extend(ac,mxShape);ac.prototype.paintVertexShape=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"innerColor","#ECECFF");g.translate(r,D);g.ellipse(0,0,v,B);g.fillAndStroke();r=.6*Math.min(v,B);v=(v-r)/2;B=(B-r)/2;g.setFillColor(G);g.setStrokeColor(G);g.ellipse(v,B,r,r);g.fillAndStroke()};mxCellRenderer.registerShape("gitMergeCommit",
ac);mxUtils.extend(Zb,mxShape);Zb.prototype.paintVertexShape=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"featureColor","#fff");g.translate(r,D);r=v/2;D=B/2;var I=Math.min(v,B)/20;g.ellipse(0,0,v,B);g.fillAndStroke();g.setFillColor(G);g.setStrokeColor(G);g.setStrokeWidth(0);v=2.75*I;g.ellipse(r-3*I-v,D+2*I-v,2*v,2*v);g.fillAndStroke();g.ellipse(r+3*I-v,D+2*I-v,2*v,2*v);g.fillAndStroke();g.setStrokeWidth(1*I);g.begin();g.moveTo(r+3*I,D+1*I);g.lineTo(r,D-5*I);g.stroke();g.begin();g.moveTo(r-
3*I,D+1*I);g.lineTo(r,D-5*I);g.stroke()};mxCellRenderer.registerShape("gitCherryPick",Zb);mxUtils.extend(Vb,mxActor);Vb.prototype.isRoundable=function(){return!1};Vb.prototype.redrawPath=function(g,r,D,v,B){r=.8*v;B*=.8;D=.15*r;v=.8*D;var G=.1*r,I=.1*B;g.moveTo(G,I);G+=.25*r;I+=.1*-B;g.arcTo(D,D,0,0,0,G,I);G+=.25*r;I+=0;g.arcTo(D,D,0,0,0,G,I);G+=.25*r;I+=0;g.arcTo(D,D,0,0,0,G,I);G+=.25*r;I+=.1*B;g.arcTo(D,D,0,0,0,G,I);G+=.15*r;I+=.33*B;g.arcTo(D,D,0,0,0,G,I);G+=0;I+=.34*B;g.arcTo(v,v,0,0,0,G,I);G+=
@@ -3450,30 +3451,30 @@ Vb);mxUtils.extend(Bb,mxActor);Bb.prototype.isRoundable=function(){return!1};Bb.
!0):"y"===I?(G.up=!0,G.down=!0):I&&(G[I]=!0)});D=parseFloat(mxUtils.getValue(this.style,"nodePadding","8"));r=B/2;D/=2;v=G.right&&G.left&&G.up&&G.down?[[0,0],[r,0],[v/2,2*D],[v-r,0],[v,0],[v,-B/3],[v+2*D,-B/2],[v,-2*B/3],[v,-B],[v-r,-B],[v/2,-B-2*D],[r,-B],[0,-B],[0,-2*B/3],[-2*D,-B/2],[0,-B/3]]:G.right&&G.left&&G.up?[[r,0],[v-r,0],[v,-B/2],[v-r,-B],[r,-B],[0,-B/2]]:G.right&&G.left&&G.down?[[0,0],[r,-B],[v-r,-B],[v,0]]:G.right&&G.up&&G.down?[[0,0],[v,-r],[v,-B+r],[0,-B]]:G.left&&G.up&&G.down?[[v,
0],[0,-r],[0,-B+r],[v,-B]]:G.right&&G.left?[[r,0],[r,-D],[v-r,-D],[v-r,0],[v,-B/2],[v-r,-B],[v-r,-B+D],[r,-B+D],[r,-B],[0,-B/2]]:G.up&&G.down?[[v/2,0],[0,-D],[r,-D],[r,-B+D],[0,-B+D],[v/2,-B],[v,-B+D],[v-r,-B+D],[v-r,-D],[v,-D]]:G.right&&G.up?[[0,0],[v,-r],[0,-B]]:G.right&&G.down?[[0,0],[v,0],[0,-B]]:G.left&&G.up?[[v,0],[0,-r],[v,-B]]:G.left&&G.down?[[v,0],[0,0],[v,-B]]:G.right?[[r,-D],[v-r,-D],[v-r,0],[v,-B/2],[v-r,-B],[v-r,-B+D],[r,-B+D]]:G.left?[[r,0],[r,-D],[v-r,-D],[v-r,-B+D],[r,-B+D],[r,-B],
[0,-B/2]]:G.up?[[r,-D],[r,-B+D],[0,-B+D],[v/2,-B],[v,-B+D],[v-r,-B+D],[v-r,-D]]:G.down?[[v/2,0],[0,-D],[r,-D],[r,-B+D],[v-r,-B+D],[v-r,-D],[v,-D]]:[[0,0],[v,0],[v,-B],[0,-B]];g.moveTo(v[0][0],B+v[0][1]);for(r=1;r<v.length;r++)g.lineTo(v[r][0],B+v[r][1]);g.close();g.end()};mxCellRenderer.registerShape("mermaidBlockArrow",Ab);mxUtils.extend(Db,mxConnector);Db.prototype.defaultWidth=10;Db.prototype.getEdgeWidth=function(){return Math.max(1,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Db.prototype.getSvgScreenOffset=
-function(){return 0};Db.prototype.augmentBoundingBox=function(g){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var r=(this.getEdgeWidth()/2+this.strokewidth)*this.scale;g.y-=r;g.height+=2*r};Db.prototype.paintEdgeShape=function(g,r){var D=r[0],v=r[r.length-1];if(null!=D&&null!=v){r=D.x;D=D.y;var B=v.x;v=v.y;for(var G=(r+B)/2,I=this.getEdgeWidth()/2,ba=[],U=[],za=0;32>=za;za++){var pa=za/32,Xa=1-pa,vb=Xa*Xa*Xa*r+3*Xa*Xa*pa*G+3*Xa*pa*pa*G+pa*pa*pa*B,jb=Xa*Xa*Xa*D+3*Xa*Xa*pa*D+3*Xa*pa*pa*
-v+pa*pa*pa*v,Sa=3*Xa*Xa*(G-r)+3*pa*pa*(B-G);Xa=6*Xa*pa*(v-D);pa=Math.sqrt(Sa*Sa+Xa*Xa);0==pa&&(Sa=1,Xa=0,pa=1);Xa=-Xa/pa*I;Sa=Sa/pa*I;ba.push(new mxPoint(vb+Xa,jb+Sa));U.push(new mxPoint(vb-Xa,jb-Sa))}g.begin();g.moveTo(ba[0].x,ba[0].y);for(za=1;32>=za;za++)g.lineTo(ba[za].x,ba[za].y);for(za=32;0<=za;za--)g.lineTo(U[za].x,U[za].y);g.close();r=g.node;g.fillAndStroke();null!=r&&null!=r.setAttribute&&null!=r.parentNode&&(g=r.getAttribute("style"),r.setAttribute("style",(null!=g&&""!=g?g+";":"")+"mix-blend-mode:multiply"))}};
-mxCellRenderer.registerShape("mermaidSankeyLink",Db);if("undefined"!==typeof mxVertexHandler){var ib=function(g,r,D){return kb(g,["width"],r,function(v,B,G,I,ba){ba=g.shape.getEdgeWidth()*g.view.scale+D;return new mxPoint(I.x+B*v/4+G*ba/2,I.y+G*v/4-B*ba/2)},function(v,B,G,I,ba,U){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));g.style.width=Math.round(Math.round(2*v)/g.view.scale-D)})},kb=function(g,r,D,v,B){return qb(g,r,function(G){var I=g.absolutePoints;if(null!=I&&0<I.length){var ba=
-I.length-1;G=g.view.translate;var U=g.view.scale,za=D?I[0]:I[ba];I=D?I[1]:I[ba-1];ba=I.x-za.x;var pa=I.y-za.y,Xa=Math.sqrt(ba*ba+pa*pa);za=v.call(this,Xa,ba/Xa,pa/Xa,za,I);return new mxPoint(za.x/U-G.x,za.y/U-G.y)}return null},function(G,I,ba){var U=g.absolutePoints,za=U.length-1;G=g.view.translate;var pa=g.view.scale,Xa=D?U[0]:U[za];U=D?U[1]:U[za-1];za=U.x-Xa.x;var vb=U.y-Xa.y,jb=Math.sqrt(za*za+vb*vb);I.x=(I.x+G.x)*pa;I.y=(I.y+G.y)*pa;B.call(this,jb,za/jb,vb/jb,Xa,U,I,ba)})},pb=function(g,r){return function(D){return[kb(D,
-["startWidth"],!0,function(v,B,G,I,ba){ba=mxUtils.getNumber(D.style,"startWidth",g)*D.view.scale+r;return new mxPoint(I.x+B*v/4+G*ba/2,I.y+G*v/4-B*ba/2)},function(v,B,G,I,ba,U){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));D.style.startWidth=Math.round(2*v)/D.view.scale-r})]}},sb=function(g){return function(r){return[qb(r,["arrowWidth","arrowSize"],function(D){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Wa.prototype.arrowWidth))),B=Math.max(0,Math.min(g,
+function(){return 0};Db.prototype.augmentBoundingBox=function(g){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var r=(this.getEdgeWidth()/2+this.strokewidth)*this.scale;g.y-=r;g.height+=2*r};Db.prototype.paintEdgeShape=function(g,r){var D=r[0],v=r[r.length-1];if(null!=D&&null!=v){r=D.x;D=D.y;var B=v.x;v=v.y;for(var G=(r+B)/2,I=this.getEdgeWidth()/2,ca=[],T=[],za=0;32>=za;za++){var pa=za/32,Xa=1-pa,vb=Xa*Xa*Xa*r+3*Xa*Xa*pa*G+3*Xa*pa*pa*G+pa*pa*pa*B,jb=Xa*Xa*Xa*D+3*Xa*Xa*pa*D+3*Xa*pa*pa*
+v+pa*pa*pa*v,Sa=3*Xa*Xa*(G-r)+3*pa*pa*(B-G);Xa=6*Xa*pa*(v-D);pa=Math.sqrt(Sa*Sa+Xa*Xa);0==pa&&(Sa=1,Xa=0,pa=1);Xa=-Xa/pa*I;Sa=Sa/pa*I;ca.push(new mxPoint(vb+Xa,jb+Sa));T.push(new mxPoint(vb-Xa,jb-Sa))}g.begin();g.moveTo(ca[0].x,ca[0].y);for(za=1;32>=za;za++)g.lineTo(ca[za].x,ca[za].y);for(za=32;0<=za;za--)g.lineTo(T[za].x,T[za].y);g.close();r=g.node;g.fillAndStroke();null!=r&&null!=r.setAttribute&&null!=r.parentNode&&(g=r.getAttribute("style"),r.setAttribute("style",(null!=g&&""!=g?g+";":"")+"mix-blend-mode:multiply"))}};
+mxCellRenderer.registerShape("mermaidSankeyLink",Db);if("undefined"!==typeof mxVertexHandler){var ib=function(g,r,D){return kb(g,["width"],r,function(v,B,G,I,ca){ca=g.shape.getEdgeWidth()*g.view.scale+D;return new mxPoint(I.x+B*v/4+G*ca/2,I.y+G*v/4-B*ca/2)},function(v,B,G,I,ca,T){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));g.style.width=Math.round(Math.round(2*v)/g.view.scale-D)})},kb=function(g,r,D,v,B){return qb(g,r,function(G){var I=g.absolutePoints;if(null!=I&&0<I.length){var ca=
+I.length-1;G=g.view.translate;var T=g.view.scale,za=D?I[0]:I[ca];I=D?I[1]:I[ca-1];ca=I.x-za.x;var pa=I.y-za.y,Xa=Math.sqrt(ca*ca+pa*pa);za=v.call(this,Xa,ca/Xa,pa/Xa,za,I);return new mxPoint(za.x/T-G.x,za.y/T-G.y)}return null},function(G,I,ca){var T=g.absolutePoints,za=T.length-1;G=g.view.translate;var pa=g.view.scale,Xa=D?T[0]:T[za];T=D?T[1]:T[za-1];za=T.x-Xa.x;var vb=T.y-Xa.y,jb=Math.sqrt(za*za+vb*vb);I.x=(I.x+G.x)*pa;I.y=(I.y+G.y)*pa;B.call(this,jb,za/jb,vb/jb,Xa,T,I,ca)})},pb=function(g,r){return function(D){return[kb(D,
+["startWidth"],!0,function(v,B,G,I,ca){ca=mxUtils.getNumber(D.style,"startWidth",g)*D.view.scale+r;return new mxPoint(I.x+B*v/4+G*ca/2,I.y+G*v/4-B*ca/2)},function(v,B,G,I,ca,T){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));D.style.startWidth=Math.round(2*v)/D.view.scale-r})]}},sb=function(g){return function(r){return[qb(r,["arrowWidth","arrowSize"],function(D){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Wa.prototype.arrowWidth))),B=Math.max(0,Math.min(g,
mxUtils.getValue(this.state.style,"arrowSize",Wa.prototype.arrowSize)));return new mxPoint(D.x+(1-B)*D.width,D.y+(1-v)*D.height/2)},function(D,v){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(D.y+D.height/2-v.y)/D.height*2));this.state.style.arrowSize=Math.max(0,Math.min(g,(D.x+D.width-v.x)/D.width))})]}},eb=function(g){return function(r){return[qb(r,["size"],function(D){var v=Math.max(0,Math.min(.5*D.height,parseFloat(mxUtils.getValue(this.state.style,"size",g))));return new mxPoint(D.x,
D.y+v)},function(D,v){this.state.style.size=Math.max(0,v.y-D.y)},!0)]}},gb=function(g,r,D){return function(v){var B=[qb(v,["size"],function(G){var I=Math.max(0,Math.min(G.width,Math.min(G.height,parseFloat(mxUtils.getValue(this.state.style,"size",r)))))*g;return new mxPoint(G.x+I,G.y+I)},function(G,I){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(G.width,I.x-G.x),Math.min(G.height,I.y-G.y)))/g)},!1)];D&&mxUtils.getValue(v.style,mxConstants.STYLE_ROUNDED,!1)&&B.push(tb(v));return B}},
-bb=function(g,r,D,v,B){D=null!=D?D:.5;return function(G){var I=[qb(G,["size"],function(ba){var U=null!=B?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,za=parseFloat(mxUtils.getValue(this.state.style,"size",U?B:g));return new mxPoint(ba.x+Math.max(0,Math.min(.5*ba.width,za*(U?1:ba.width))),ba.getCenterY())},function(ba,U,za){ba=null!=B&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?U.x-ba.x:Math.max(0,Math.min(D,(U.x-ba.x)/ba.width));this.state.style.size=ba},!1,v)];r&&mxUtils.getValue(G.style,
-mxConstants.STYLE_ROUNDED,!1)&&I.push(tb(G));return I}},yb=function(g,r,D){g=null!=g?g:.5;return function(v){var B=[qb(v,["size"],function(G){var I=null!=D?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ba=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",I?D:r)));return new mxPoint(G.x+Math.min(.75*G.width*g,ba*(I?.75:.75*G.width)),G.y+G.height/4)},function(G,I){G=null!=D&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?I.x-G.x:Math.max(0,Math.min(g,(I.x-G.x)/G.width*
+bb=function(g,r,D,v,B){D=null!=D?D:.5;return function(G){var I=[qb(G,["size"],function(ca){var T=null!=B?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,za=parseFloat(mxUtils.getValue(this.state.style,"size",T?B:g));return new mxPoint(ca.x+Math.max(0,Math.min(.5*ca.width,za*(T?1:ca.width))),ca.getCenterY())},function(ca,T,za){ca=null!=B&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?T.x-ca.x:Math.max(0,Math.min(D,(T.x-ca.x)/ca.width));this.state.style.size=ca},!1,v)];r&&mxUtils.getValue(G.style,
+mxConstants.STYLE_ROUNDED,!1)&&I.push(tb(G));return I}},yb=function(g,r,D){g=null!=g?g:.5;return function(v){var B=[qb(v,["size"],function(G){var I=null!=D?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ca=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",I?D:r)));return new mxPoint(G.x+Math.min(.75*G.width*g,ca*(I?.75:.75*G.width)),G.y+G.height/4)},function(G,I){G=null!=D&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?I.x-G.x:Math.max(0,Math.min(g,(I.x-G.x)/G.width*
.75));this.state.style.size=G},!1,!0)];mxUtils.getValue(v.style,mxConstants.STYLE_ROUNDED,!1)&&B.push(tb(v));return B}},xb=function(){return function(g){var r=[];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r}},tb=function(g,r){return qb(g,[mxConstants.STYLE_ARCSIZE],function(D){var v=null!=r?r:D.height/8;if("1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var B=mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(D.x+
D.width-Math.min(D.width/2,B),D.y+v)}B=Math.max(0,parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(D.x+D.width-Math.min(Math.max(D.width/2,D.height/2),Math.min(D.width,D.height)*B),D.y+v)},function(D,v,B){"1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(D.width,2*(D.x+D.width-v.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=
-Math.round(Math.min(50,Math.max(0,100*(D.width-v.x+D.x)/Math.min(D.width,D.height))))})},qb=function(g,r,D,v,B,G,I){var ba=new mxHandle(g,null,mxVertexHandler.prototype.secondaryHandleImage);ba.execute=function(za){for(var pa=0;pa<r.length;pa++)this.copyStyle(r[pa]);I&&I(za)};ba.getPosition=D;ba.setPosition=v;ba.ignoreGrid=null!=B?B:!0;if(G){var U=ba.positionChanged;ba.positionChanged=function(){U.apply(this,arguments);g.view.invalidate(this.state.cell);g.view.validate()}}return ba},Jb={link:function(g){return[ib(g,
-!0,10),ib(g,!1,10)]},pipe:function(g){return[ib(g,!0,10),ib(g,!1,10)]},flexArrow:function(g){var r=g.view.graph.gridSize/g.view.scale,D=[];mxUtils.getValue(g.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(D.push(kb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,B,G,I,ba){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ba=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+
-B*(ba+g.shape.strokewidth*g.view.scale)+G*v/2,I.y+G*(ba+g.shape.strokewidth*g.view.scale)-B*v/2)},function(v,B,G,I,ba,U,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,U.x,U.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE];
-mxEvent.isAltDown(za.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE])})),D.push(kb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,B,G,I,ba){v=(g.shape.getStartArrowWidth()-g.shape.strokewidth)*g.view.scale;ba=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;
-return new mxPoint(I.x+B*(ba+g.shape.strokewidth*g.view.scale)+G*v/2,I.y+G*(ba+g.shape.strokewidth*g.view.scale)-B*v/2)},function(v,B,G,I,ba,U,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,U.x,U.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.startWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=
+Math.round(Math.min(50,Math.max(0,100*(D.width-v.x+D.x)/Math.min(D.width,D.height))))})},qb=function(g,r,D,v,B,G,I){var ca=new mxHandle(g,null,mxVertexHandler.prototype.secondaryHandleImage);ca.execute=function(za){for(var pa=0;pa<r.length;pa++)this.copyStyle(r[pa]);I&&I(za)};ca.getPosition=D;ca.setPosition=v;ca.ignoreGrid=null!=B?B:!0;if(G){var T=ca.positionChanged;ca.positionChanged=function(){T.apply(this,arguments);g.view.invalidate(this.state.cell);g.view.validate()}}return ca},Jb={link:function(g){return[ib(g,
+!0,10),ib(g,!1,10)]},pipe:function(g){return[ib(g,!0,10),ib(g,!1,10)]},flexArrow:function(g){var r=g.view.graph.gridSize/g.view.scale,D=[];mxUtils.getValue(g.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(D.push(kb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,B,G,I,ca){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ca=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+
+B*(ca+g.shape.strokewidth*g.view.scale)+G*v/2,I.y+G*(ca+g.shape.strokewidth*g.view.scale)-B*v/2)},function(v,B,G,I,ca,T,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,T.x,T.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE];
+mxEvent.isAltDown(za.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE])})),D.push(kb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,B,G,I,ca){v=(g.shape.getStartArrowWidth()-g.shape.strokewidth)*g.view.scale;ca=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;
+return new mxPoint(I.x+B*(ca+g.shape.strokewidth*g.view.scale)+G*v/2,I.y+G*(ca+g.shape.strokewidth*g.view.scale)-B*v/2)},function(v,B,G,I,ca,T,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,T.x,T.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.startWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=
g.style[mxConstants.STYLE_STARTSIZE],g.style.endWidth=g.style.startWidth;mxEvent.isAltDown(za.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(g.style.startWidth)-parseFloat(g.style.endWidth))<r&&(g.style.startWidth=g.style.endWidth))})));mxUtils.getValue(g.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(D.push(kb(g,
-["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(v,B,G,I,ba){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ba=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+B*(ba+g.shape.strokewidth*g.view.scale)-G*v/2,I.y+G*(ba+g.shape.strokewidth*g.view.scale)+B*v/2)},function(v,B,G,I,ba,U,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,U.x,U.y);
+["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(v,B,G,I,ca){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ca=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+B*(ca+g.shape.strokewidth*g.view.scale)-G*v/2,I.y+G*(ca+g.shape.strokewidth*g.view.scale)+B*v/2)},function(v,B,G,I,ca,T,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,T.x,T.y);
g.style[mxConstants.STYLE_ENDSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(za.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE])})),D.push(kb(g,
-["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(v,B,G,I,ba){v=(g.shape.getEndArrowWidth()-g.shape.strokewidth)*g.view.scale;ba=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+B*(ba+g.shape.strokewidth*g.view.scale)-G*v/2,I.y+G*(ba+g.shape.strokewidth*g.view.scale)+B*v/2)},function(v,B,G,I,ba,U,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+
-G,I.y-B,U.x,U.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.endWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE],g.style.startWidth=g.style.endWidth;mxEvent.isAltDown(za.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<
+["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(v,B,G,I,ca){v=(g.shape.getEndArrowWidth()-g.shape.strokewidth)*g.view.scale;ca=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+B*(ca+g.shape.strokewidth*g.view.scale)-G*v/2,I.y+G*(ca+g.shape.strokewidth*g.view.scale)+B*v/2)},function(v,B,G,I,ca,T,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+
+G,I.y-B,T.x,T.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.endWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE],g.style.startWidth=g.style.endWidth;mxEvent.isAltDown(za.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<
r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(g.style.endWidth)-parseFloat(g.style.startWidth))<r&&(g.style.endWidth=g.style.startWidth))})));return D},swimlane:function(g){var r=[];if(mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED)){var D=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));r.push(tb(g,D/2))}r.push(qb(g,[mxConstants.STYLE_STARTSIZE],function(v){var B=parseFloat(mxUtils.getValue(g.style,
mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(g.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(v.getCenterX(),v.y+Math.max(0,Math.min(v.height,B))):new mxPoint(v.x+Math.max(0,Math.min(v.width,B)),v.getCenterY())},function(v,B){g.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(v.height,B.y-v.y))):Math.round(Math.max(0,Math.min(v.width,B.x-v.x)))},!1,null,function(v){var B=
-g.view.graph;if(!mxEvent.isShiftDown(v.getEvent())&&!mxEvent.isControlDown(v.getEvent())&&(B.isTableRow(g.cell)||B.isTableCell(g.cell))){v=B.getSwimlaneDirection(g.style);var G=B.model.getParent(g.cell);G=B.model.getChildCells(G,!0);for(var I=[],ba=0;ba<G.length;ba++)G[ba]!=g.cell&&B.isSwimlane(G[ba])&&B.getSwimlaneDirection(B.getCurrentCellStyle(G[ba]))==v&&I.push(G[ba]);B.setCellStyles(mxConstants.STYLE_STARTSIZE,g.style[mxConstants.STYLE_STARTSIZE],I)}}));return r},label:xb(),ext:xb(),rectangle:xb(),
+g.view.graph;if(!mxEvent.isShiftDown(v.getEvent())&&!mxEvent.isControlDown(v.getEvent())&&(B.isTableRow(g.cell)||B.isTableCell(g.cell))){v=B.getSwimlaneDirection(g.style);var G=B.model.getParent(g.cell);G=B.model.getChildCells(G,!0);for(var I=[],ca=0;ca<G.length;ca++)G[ca]!=g.cell&&B.isSwimlane(G[ca])&&B.getSwimlaneDirection(B.getCurrentCellStyle(G[ca]))==v&&I.push(G[ca]);B.setCellStyles(mxConstants.STYLE_STARTSIZE,g.style[mxConstants.STYLE_STARTSIZE],I)}}));return r},label:xb(),ext:xb(),rectangle:xb(),
triangle:xb(),rhombus:xb(),umlLifeline:function(g){return[qb(g,["size"],function(r){var D=Math.max(0,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",Ba.prototype.size))));return new mxPoint(r.getCenterX(),r.y+D)},function(r,D){this.state.style.size=Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},umlFrame:function(g){return[qb(g,["width","height"],function(r){var D=Math.max(ma.prototype.corner,Math.min(r.width,mxUtils.getValue(this.state.style,"width",ma.prototype.width))),
v=Math.max(1.5*ma.prototype.corner,Math.min(r.height,mxUtils.getValue(this.state.style,"height",ma.prototype.height)));return new mxPoint(r.x+D,r.y+v)},function(r,D){this.state.style.width=Math.round(Math.max(ma.prototype.corner,Math.min(r.width,D.x-r.x)));this.state.style.height=Math.round(Math.max(1.5*ma.prototype.corner,Math.min(r.height,D.y-r.y)))},!1)]},process:function(g){var r=[qb(g,["size"],function(D){var v="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),B=parseFloat(mxUtils.getValue(this.state.style,
"size",ja.prototype.size));return v?new mxPoint(D.x+B,D.y+D.height/4):new mxPoint(D.x+D.width*B,D.y+D.height/4)},function(D,v){D="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*D.width,v.x-D.x)):Math.max(0,Math.min(.5,(v.x-D.x)/D.width));this.state.style.size=D},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},cross:function(g){return[qb(g,["size"],function(r){var D=Math.min(r.width,r.height);D=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,
@@ -3486,8 +3487,8 @@ return new mxPoint(D.x+v*D.width,D.y+D.height)},function(D,v){this.state.style.p
B*D.width+G),D.y+D.height-v)},function(D,v){var B=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ua.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(D.width,v.x-D.x-B*D.width)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},wedgeCallout:function(g){var r=[qb(g,["tipX","tipY"],function(D){var v=null!=this.state.shape?this.state.shape.getTipOffset():new mxPoint(Da.prototype.tipX,Da.prototype.tipY);return new mxPoint(D.getCenterX()+
v.x*D.width,D.getCenterY()+v.y*D.height)},function(D,v){var B=Da.prototype.maxTipOffset;this.state.style.tipX=Math.round(1E3*Math.max(-B,Math.min(B,(v.x-D.getCenterX())/Math.max(1,D.width))))/1E3;this.state.style.tipY=Math.round(1E3*Math.max(-B,Math.min(B,(v.y-D.getCenterY())/Math.max(1,D.height))))/1E3},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},internalStorage:function(g){var r=[qb(g,["dx","dy"],function(D){var v=Math.max(0,Math.min(D.width,mxUtils.getValue(this.state.style,
"dx",Ja.prototype.dx))),B=Math.max(0,Math.min(D.height,mxUtils.getValue(this.state.style,"dy",Ja.prototype.dy)));return new mxPoint(D.x+v,D.y+B)},function(D,v){this.state.style.dx=Math.round(Math.max(0,Math.min(D.width,v.x-D.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(D.height,v.y-D.y)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},module:function(g){return[qb(g,["jettyWidth","jettyHeight"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,
-"jettyWidth",Ia.prototype.jettyWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"jettyHeight",Ia.prototype.jettyHeight)));return new mxPoint(r.x+D/2,r.y+2*v)},function(r,D){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(r.width,D.x-r.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(r.height,D.y-r.y))/2)})]},corner:function(g){return[qb(g,["dx","dy"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",Ga.prototype.dx))),
-v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",Ga.prototype.dy)));return new mxPoint(r.x+D,r.y+v)},function(r,D){this.state.style.dx=Math.round(Math.max(0,Math.min(r.width,D.x-r.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},tee:function(g){return[qb(g,["dx","dy"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy)));
+"jettyWidth",Ia.prototype.jettyWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"jettyHeight",Ia.prototype.jettyHeight)));return new mxPoint(r.x+D/2,r.y+2*v)},function(r,D){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(r.width,D.x-r.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(r.height,D.y-r.y))/2)})]},corner:function(g){return[qb(g,["dx","dy"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",Ha.prototype.dx))),
+v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",Ha.prototype.dy)));return new mxPoint(r.x+D,r.y+v)},function(r,D){this.state.style.dx=Math.round(Math.max(0,Math.min(r.width,D.x-r.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},tee:function(g){return[qb(g,["dx","dy"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy)));
return new mxPoint(r.x+(r.width+D)/2,r.y+v)},function(r,D){this.state.style.dx=Math.round(Math.max(0,2*Math.min(r.width/2,D.x-r.x-r.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},singleArrow:sb(1),doubleArrow:sb(.5),"mxgraph.arrows2.wedgeArrow":pb(20,20),"mxgraph.arrows2.wedgeArrowDashed":pb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":pb(20,20),folder:function(g){return[qb(g,["tabWidth","tabHeight"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,
"tabWidth",q.prototype.tabWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(D=r.width-D);return new mxPoint(r.x+D,r.y+v)},function(r,D){var v=Math.max(0,Math.min(r.width,D.x-r.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(v=r.width-v);this.state.style.tabWidth=Math.round(v);this.state.style.tabHeight=
Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},document:function(g){return[qb(g,["size"],function(r){var D=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Q.prototype.size))));return new mxPoint(r.x+3*r.width/4,r.y+(1-D)*r.height)},function(r,D){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-D.y)/r.height))},!1)]},tape:function(g){return[qb(g,["size"],function(r){var D=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",K.prototype.size))));
@@ -3503,8 +3504,8 @@ Math.round(Math.max(-I,Math.min(I,v.y-D.y-G-B)))},!1),qb(g,["arcEndY"],function(
r,D){var v=this.getCellStyle(g);if(null!=v&&"curvedText"==v[mxConstants.STYLE_SHAPE]){var B=this.convertValueToString(g);if(null!=B&&0<B.length){var G=parseFloat(mxUtils.getValue(v,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),I=mxUtils.getValue(v,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);v=mxUtils.getValue(v,mxConstants.STYLE_FONTSTYLE,0);B=.85*mxUtils.getSizeForString(B,G,I,null,v).width;I=this.model.getGeometry(g);I=null!=I?I.height:60;(D=null!=D?D:this.gridEnabled)&&
(B=this.snap(B+this.gridSize/2));return new mxRectangle(0,0,Math.max(B,2*G)+10,I)}return null}return Yb.apply(this,arguments)};var Sb=mxCellRenderer.prototype.checkPlaceholderStyles;mxCellRenderer.prototype.checkPlaceholderStyles=function(g){return null!=g.style&&"curvedText"==g.style[mxConstants.STYLE_SHAPE]?!0:Sb.apply(this,arguments)};if("undefined"!==typeof mxCellEditor){var Qb=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(g,r){Qb.apply(this,arguments);var D=
this.graph.view.getState(g);null!=D&&null!=D.style&&"curvedText"==D.style[mxConstants.STYLE_SHAPE]&&null!=D.shape&&D.shape.redraw()};var Cb=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(g){var r=this.editingCell;Cb.apply(this,arguments);null!=r&&(r=this.graph.view.getState(r),null!=r&&null!=r.style&&"curvedText"==r.style[mxConstants.STYLE_SHAPE]&&null!=r.shape&&r.shape.redraw())}}var Gb=new mxPoint(1,0),Kb=new mxPoint(1,0),cc=mxUtils.toRadians(-30);Gb=mxUtils.getRotatedPoint(Gb,
-Math.cos(cc),Math.sin(cc));var Pb=mxUtils.toRadians(-150);Kb=mxUtils.getRotatedPoint(Kb,Math.cos(Pb),Math.sin(Pb));mxEdgeStyle.IsometricConnector=function(g,r,D,v,B){var G=g.view;v=null!=v&&0<v.length?v[0]:null;var I=g.absolutePoints,ba=I[0];I=I[I.length-1];null!=v&&(v=G.transformControlPoint(g,v));null==ba&&null!=r&&(ba=new mxPoint(r.getCenterX(),r.getCenterY()));null==I&&null!=D&&(I=new mxPoint(D.getCenterX(),D.getCenterY()));var U=Gb.x,za=Gb.y,pa=Kb.x,Xa=Kb.y,vb="horizontal"==mxUtils.getValue(g.style,
-"elbow","horizontal");if(null!=I&&null!=ba){g=function(Sa,Va,Qa){Sa-=jb.x;var Ya=Va-jb.y;Va=(Xa*Sa-pa*Ya)/(U*Xa-za*pa);Sa=(za*Sa-U*Ya)/(za*pa-U*Xa);vb?(Qa&&(jb=new mxPoint(jb.x+U*Va,jb.y+za*Va),B.push(jb)),jb=new mxPoint(jb.x+pa*Sa,jb.y+Xa*Sa)):(Qa&&(jb=new mxPoint(jb.x+pa*Sa,jb.y+Xa*Sa),B.push(jb)),jb=new mxPoint(jb.x+U*Va,jb.y+za*Va));B.push(jb)};var jb=ba;null==v&&(v=new mxPoint(ba.x+(I.x-ba.x)/2,ba.y+(I.y-ba.y)/2));g(v.x,v.y,!0);g(I.x,I.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);
+Math.cos(cc),Math.sin(cc));var Pb=mxUtils.toRadians(-150);Kb=mxUtils.getRotatedPoint(Kb,Math.cos(Pb),Math.sin(Pb));mxEdgeStyle.IsometricConnector=function(g,r,D,v,B){var G=g.view;v=null!=v&&0<v.length?v[0]:null;var I=g.absolutePoints,ca=I[0];I=I[I.length-1];null!=v&&(v=G.transformControlPoint(g,v));null==ca&&null!=r&&(ca=new mxPoint(r.getCenterX(),r.getCenterY()));null==I&&null!=D&&(I=new mxPoint(D.getCenterX(),D.getCenterY()));var T=Gb.x,za=Gb.y,pa=Kb.x,Xa=Kb.y,vb="horizontal"==mxUtils.getValue(g.style,
+"elbow","horizontal");if(null!=I&&null!=ca){g=function(Sa,Va,Qa){Sa-=jb.x;var Ya=Va-jb.y;Va=(Xa*Sa-pa*Ya)/(T*Xa-za*pa);Sa=(za*Sa-T*Ya)/(za*pa-T*Xa);vb?(Qa&&(jb=new mxPoint(jb.x+T*Va,jb.y+za*Va),B.push(jb)),jb=new mxPoint(jb.x+pa*Sa,jb.y+Xa*Sa)):(Qa&&(jb=new mxPoint(jb.x+pa*Sa,jb.y+Xa*Sa),B.push(jb)),jb=new mxPoint(jb.x+T*Va,jb.y+za*Va));B.push(jb)};var jb=ca;null==v&&(v=new mxPoint(ca.x+(I.x-ca.x)/2,ca.y+(I.y-ca.y)/2));g(v.x,v.y,!0);g(I.x,I.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);
var dc=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(g,r){if(r==mxEdgeStyle.IsometricConnector){var D=new mxElbowEdgeHandler(g);D.snapToTerminals=!1;return D}return dc.apply(this,arguments)};y.prototype.constraints=[];C.prototype.getConstraints=function(g,r,D){g=[];var v=Math.tan(mxUtils.toRadians(30)),B=(.5-v)/2;v=Math.min(r,D/(.5+v));r=(r-v)/2;D=(D-v)/2;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,D+.25*v));g.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,r+.5*v,D+v*B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+v,D+.25*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+v,D+.75*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+.5*v,D+(1-B)*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,D+.75*v));return g};R.prototype.getConstraints=function(g,r,D){g=[];var v=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;v=Math.min(r*
Math.tan(v),.5*D);g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,D-v));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,D-v));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,
@@ -3531,7 +3532,7 @@ Wb.prototype.getConstraints=function(g,r,D){g=[];var v=Math.min(r,D/2),B=Math.mi
0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,r),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),
!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(D-.5*g,1.5*g)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(D-.5*g,3.5*g))];D>5*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,r));D>8*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,r));D>15*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,r));return v};Ra.prototype.constraints=mxRectangleShape.prototype.constraints;$a.prototype.constraints=mxRectangleShape.prototype.constraints;
mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,
-.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];T.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,
+.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];U.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,
.5),!1)];Ca.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,
1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,
1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];l.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];K.prototype.constraints=
@@ -3544,7 +3545,7 @@ mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),n
.25),!1)];V.prototype.constraints=mxRectangleShape.prototype.constraints;J.prototype.constraints=mxRectangleShape.prototype.constraints;Q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),
!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;ab.prototype.getConstraints=function(g,r,D){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),B=Math.max(0,Math.min(D,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,
0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*r+.25*v,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),.5*(D+B)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),D));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,.5*(r-v),D));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),.5*(D+B)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*r-.25*v,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*B));return g};Ga.prototype.getConstraints=function(g,r,D){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,
+0),!1,null,.5*(r-v),D));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),.5*(D+B)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*r-.25*v,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*B));return g};Ha.prototype.getConstraints=function(g,r,D){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,
"dx",this.dx)))),B=Math.max(0,Math.min(D,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),B));g.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,v,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,.5*(D+B)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,D));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*v,D));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return g};Ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,
1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Wa.prototype.getConstraints=function(g,r,D){g=[];var v=D*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),B=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
@@ -3555,7 +3556,7 @@ mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),n
1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,B,D));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,B,D-.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,B,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+B),v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,G));g.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,.5*(r+B),G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,v));return g};Ba.prototype.constraints=
null;wb.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Fa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,
-.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Ha.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];La.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}
+.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Ga.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];La.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}
Actions.prototype.init=function(){function b(F){n.escape();F=n.deleteCells(n.getDeletableCells(n.getSelectionCells()),F);null!=F&&n.setSelectionCells(F)}function d(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{for(var F=n.getSelectionCells(),N=0;N<F.length;N++)n.cellLabelChanged(F[N],"")}finally{n.getModel().endUpdate()}}}function m(F,N,R,c,f){f.getModel().beginUpdate();try{var l=f.getCellGeometry(F);null!=l&&R&&c&&(R/=c,l=l.clone(),1<R?l.height=l.width/R:l.width=l.height*R,f.getModel().setGeometry(F,
l));f.setCellStyles(mxConstants.STYLE_CLIP_PATH,N,[F]);f.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[F])}finally{f.getModel().endUpdate()}}var p=this.editorUi,t=p.editor,n=t.graph,y=function(){return Action.prototype.isEnabled.apply(this,arguments)&&n.isEnabled()};this.addAction("new...",function(){n.openLink(p.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";p.openFile()});var C=new Action("smartFit",function(){if(p.chromelessResize)n.isLightboxView()?(1==
n.view.scale?p.lightboxFit():n.zoomTo(1),p.chromelessResize(!1)):p.chromelessResize(!0);else{n.popupMenuHandler.hideMenu();var F=n.view.scale,N=n.container.scrollLeft,R=n.container.scrollTop,c=n.view.translate.x,f=n.view.translate.y;p.actions.get("resetView").funct();1E-5>Math.abs(F-n.view.scale)&&5>Math.abs(N-n.container.scrollLeft)&&5>Math.abs(R-n.container.scrollTop)&&c==n.view.translate.x&&f==n.view.translate.y&&p.actions.get("fitWindow").funct()}},null,null,"Enter");C.getTitle=function(){return mxResources.get("fitWindow")+
@@ -3775,15 +3776,14 @@ Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.tweetImage=IMAGE_PATH+"/t
!0;Editor.enableSimpleTheme=!0;Editor.enableHashObjects=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"1"!=urlParams.embed&&window.top==window.self;Editor.defaultIncludeDiagram=!0;Editor.enableServiceWorker="0"!=urlParams.pwa&&"serviceWorker"in navigator&&("1"==urlParams.offline||"1"==urlParams.enableSW||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.draw\.io$/.test(window.location.hostname));try{Editor.enableServiceWorker&&navigator.serviceWorker}catch(k){Editor.enableServiceWorker=
!1}Editor.defaultLanguages=null;Editor.enableWebFonts=!window.mxIsElectron;Editor.enableLocalFonts=!1;Editor.localFonts=null;Editor.enableShadowOption=!mxClient.IS_SF;Editor.enableExportUrl=!0;Editor.enableRealtime=!0;Editor.enableRealtimeCache=!0;Editor.p2pSyncNotify=!1;Editor.compressXml=!0;Editor.defaultCompressed=!1;Editor.oneDriveInlinePicker=null!=window.urlParams&&"0"==window.urlParams.inlinePicker?!1:!0;Editor.globalVars=null;Editor.defaultBorder=5;Editor.addSvgMetadata=!1;Editor.mathOutputSize=
!0;Editor.enableAnimations=!0;Editor.insertAnimations=!0;Editor.enableWindowDocking="1"!=urlParams.embedInline;Editor.pasteAtMousePointer=!0;Editor.fitDiagramOnLoad=!0;Editor.fitDiagramOnPage=!0;Editor.showLinkIcons=!1;Editor.showTooltipIcons=!1;Editor.showNoteIcons=!0;Editor.tooltipFontSize=null;Editor.tooltipMaxWidth=360;Editor.expandPatternsForPrint=!0;Editor.defaultTextStyle="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;";Editor.defaultNoteStyle=
-"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;autosizeText=1;";Editor.enableAi=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.aiActions=["createPublic","create","update","assist"];Editor.gptApiKey=null!=urlParams["gpt-api-key"]?
-decodeURIComponent(urlParams["gpt-api-key"]):null;Editor.geminiApiKey=null!=urlParams["gemini-api-key"]?decodeURIComponent(urlParams["gemini-api-key"]):null;Editor.claudeApiKey=null!=urlParams["claude-api-key"]?decodeURIComponent(urlParams["claude-api-key"]):null;Editor.gptUrl=null!=urlParams["gpt-url"]?decodeURIComponent(urlParams["gpt-url"]):"https://api.openai.com/v1/chat/completions";Editor.aiGlobals={gptApiKey:Editor.gptApiKey,geminiApiKey:Editor.geminiApiKey,claudeApiKey:Editor.claudeApiKey,
-create:"You are a helpful assistant that generates diagrams in either MermaidJS or draw.io XML format based on the given prompt. Begin with a concise checklist (3-7 bullets) of what you will do; keep items conceptual, not implementation-level. Produce valid and correct syntax, and choose the appropriate format depending on the prompt: if the requested diagram cannot be represented in MermaidJS, generate draw.io XML instead but do not use indentation and newlines. When asked to modify a diagram that is given in the conversation as draw.io XML, return the complete updated diagram as draw.io XML, not MermaidJS, and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. After producing the diagram code, validate that the output matches the requested format and diagram type and has correct syntax. Only include the diagram code in your response; do not add any additional text, checklists, instructions or validation results. If the prompt is a question or does not ask for a diagram, answer it as plain text without any diagram code instead.",
+"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;autosizeText=1;";Editor.enableAi=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.aiActions=["createPublic","create","update","assist"];Editor.gptApiKey=null;Editor.geminiApiKey=
+null;Editor.claudeApiKey=null;Editor.gptUrl="https://api.openai.com/v1/chat/completions";Editor.aiGlobals={gptApiKey:Editor.gptApiKey,geminiApiKey:Editor.geminiApiKey,claudeApiKey:Editor.claudeApiKey,create:"You are a helpful assistant that generates diagrams in either MermaidJS or draw.io XML format based on the given prompt. Begin with a concise checklist (3-7 bullets) of what you will do; keep items conceptual, not implementation-level. Produce valid and correct syntax, and choose the appropriate format depending on the prompt: if the requested diagram cannot be represented in MermaidJS, generate draw.io XML instead but do not use indentation and newlines. When asked to modify a diagram that is given in the conversation as draw.io XML, return the complete updated diagram as draw.io XML, not MermaidJS, and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. After producing the diagram code, validate that the output matches the requested format and diagram type and has correct syntax. Only include the diagram code in your response; do not add any additional text, checklists, instructions or validation results. If the prompt is a question or does not ask for a diagram, answer it as plain text without any diagram code instead.",
update:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. When asked to modify the diagram, return the complete updated diagram as draw.io XML without indentation and newlines - never as MermaidJS or any other format - and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. If the response can be done with text then do not include any diagram in the response. Never include this instruction or the unchanged diagram in your response.\n{data}",
assist:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."};Editor.aiConfigs={gpt:{apiKey:"gptApiKey",endpoint:Editor.gptUrl,requestHeaders:{Authorization:"Bearer {apiKey}"},request:{model:"{model}",messages:[{role:"system",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.choices[0].message.content"},gemini:{apiKey:"geminiApiKey",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",
requestHeaders:{"X-Goog-Api-Key":"{apiKey}"},request:{system_instruction:{parts:[{text:"{action}"}]},contents:[{parts:[{text:"{prompt}"}]}]},responsePath:"$.candidates[0].content.parts[0].text"},claude:{apiKey:"claudeApiKey",endpoint:"https://api.anthropic.com/v1/messages",requestHeaders:{"X-API-Key":"{apiKey}","Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},request:{max_tokens:8192,model:"{model}",system:"{action}",messages:[{role:"user",content:"{prompt}"}]},
responsePath:"$.content[0].text"}};Editor.aiModels=[{name:"Claude 4.8 Opus",model:"claude-opus-4-8",config:"claude"},{name:"Claude 4.6 Opus",model:"claude-opus-4-6",config:"claude"},{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.maxPublicPromptLength=1E4;if("ac.draw.io"==window.location.hostname||
"aj.draw.io"==window.location.hostname||/\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname)||/\.cdn\.prod\.atlassian-dev-us-gov-mod\.net$/.test(window.location.hostname))Editor.maxPublicPromptLength=window.DRAWIO_ATLASSIAN_PROMPT_LENGTH;Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.embedSvgFonts=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(k,u){return{name:u,
-dispName:k,type:"bool",defVal:!1,isVisible:function(H,P){return 1==H.vertices.length?(P=P.editorUi.editor.graph.model,H=P.getParent(H.vertices[0]),P.isEdge(H)||P.isVertex(H)):!1},getValue:function(H,P){return"inherit"==mxUtils.getValue(H.style,u)},valueChanged:function(H,P,T,W){P=W.editorUi.editor.graph;"1"==H?P.setCellStyles(u,"inherit",T.vertices):P.setCellStyles(u,null,T.vertices)}}};Editor.isPatternFillStyle=function(k){k=mxUtils.getValue(k,"fillStyle","auto");return"auto"!=k&&"solid"!=k};Editor.commonProperties=
+dispName:k,type:"bool",defVal:!1,isVisible:function(H,P){return 1==H.vertices.length?(P=P.editorUi.editor.graph.model,H=P.getParent(H.vertices[0]),P.isEdge(H)||P.isVertex(H)):!1},getValue:function(H,P){return"inherit"==mxUtils.getValue(H.style,u)},valueChanged:function(H,P,U,W){P=W.editorUi.editor.graph;"1"==H?P.setCellStyles(u,"inherit",U.vertices):P.setCellStyles(u,null,U.vertices)}}};Editor.isPatternFillStyle=function(k){k=mxUtils.getValue(k,"fillStyle","auto");return"auto"!=k&&"solid"!=k};Editor.commonProperties=
[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(k){k.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(k,u){return"1"==mxUtils.getValue(k.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(k,u){return"1"!=mxUtils.getValue(k.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(k,u){return"1"==mxUtils.getValue(k.style,"comic",
"0")||"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(k,u){return("1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(k.style))&&0<k.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(k,u){return("1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(k.style))&&
0<k.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(k,u){return("1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(k.style)&&"dots"!=mxUtils.getValue(k.style,"fillStyle","auto"))&&0<k.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(k,u){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",
@@ -3823,37 +3823,37 @@ mxUtils.getValue(k.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValu
Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",mxConstants.STYLE_FONTCOLOR),Editor.createInheritProperty("Inherit Fill Color",mxConstants.STYLE_FILLCOLOR),Editor.createInheritProperty("Inherit Stroke Color",mxConstants.STYLE_STROKECOLOR)].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart, the ELK shorthands\n## elkRadial, elkOrganic, elkStress, libavoid (orthogonal edge routing), parallels\n## (spread overlapping parallel edges), or a JSON string as used in Layout, Apply.\n## Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';
Editor.canvasSupported=!1;(function(){try{var k=document.createElement("canvas");Editor.canvasSupported=!(!k.getContext||!k.getContext("2d"))}catch(u){}})();Editor.useCanvasForExport=!1;(function(){try{var k=document.createElement("canvas"),u=new Image;u.onload=function(){try{k.getContext("2d").drawImage(u,0,0);var H=k.toDataURL("image/png");Editor.useCanvasForExport=null!=H&&6<H.length}catch(P){}};u.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(H){}})();
Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var k=document.createElement("canvas");k.width=k.height=1;var u=k.toDataURL("image/jpeg");Editor.jpgSupported=null!==u.match("image/jpeg");u=k.toDataURL("image/webp");Editor.webpSupported=null!==u.match("image/webp")}catch(H){}})();Editor.loadCompatibleCss=function(k){mxUtils.lightDarkColorSupported||mxUtils.get(k||"styles/grapheditor.css",mxUtils.bind(this,function(u){if(200<=u.getStatus()&&299>=u.getStatus()){var H=document.createElement("style");
-H.type="text/css";var P=H.appendChild,T=document,W=T.createTextNode;u=u.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(u=u.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(fa){}P.call(H,W.call(T,u));document.head.appendChild(H)}}))};Editor.replacePlaceholders=function(k,
-u){var H=[];if(null!=k&&null!=u){for(var P=RegExp("{([^{}\"'=;]+)}","g"),T,W=0;T=P.exec(k);){var fa=T[0];if(2<fa.length){var X=u(fa.substring(1,fa.length-1)),ea=fa;null!=X&&(ea=X);H.push(k.substring(W,T.index)+ea);W=T.index+fa.length}}H.push(k.substring(W))}return H.join("")};Editor.executeSimpleJsonPath=function(k,u){u=u.replace(/^\$\.?/,"").split(".");u=$jscomp.makeIterator(u);for(var H=u.next();!H.done;H=u.next()){var P=H.value;if(!k)return[];if(H=P.match(/([^\[]+)\[(\d+)\]/))if(P=H[1],H=parseInt(H[2]),
-k=k[P],Array.isArray(k)&&H<k.length)k=k[H];else return[];else k=k[P]}return void 0!==k?[k]:[]};Editor.createRoughCanvas=function(k){var u=rough.canvas({getContext:function(){return k}});u.draw=function(H){var P=H.sets||[];H=H.options||this.getDefaultOptions();for(var T=0;T<P.length;T++){var W=P[T];switch(W.type){case "path":null!=H.stroke&&this._drawToContext(k,W,H);break;case "fillPath":this._drawToContext(k,W,H);break;case "fillSketch":this.fillSketch(k,W,H)}}};u.fillSketch=function(H,P,T){var W=
-k.state.strokeColor,fa=k.state.strokeWidth,X=k.state.strokeAlpha,ea=k.state.dashed,oa=T.fillWeight;0>oa&&(oa=T.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(T.fill||"");k.setStrokeWidth(oa);k.setDashed(!1);oa=null!=H.root?H.root.lastChild:null;this._drawToContext(H,P,T);null!=H.root&&null!=H.root.lastChild&&H.root.lastChild!=oa&&"path"==H.root.lastChild.nodeName&&H.root.lastChild.setAttribute("data-rough-fill","1");k.setDashed(ea);k.setStrokeWidth(fa);k.setStrokeColor(W);k.setStrokeAlpha(X)};
-u._drawToContext=function(H,P,T){H.begin();for(var W=0;W<P.ops.length;W++){var fa=P.ops[W],X=fa.data;switch(fa.op){case "move":H.moveTo(X[0],X[1]);break;case "bcurveTo":H.curveTo(X[0],X[1],X[2],X[3],X[4],X[5]);break;case "lineTo":H.lineTo(X[0],X[1])}}H.end();"fillPath"===P.type&&T.filled?H.fill():H.stroke()};return u};(function(){function k(W,fa,X){this.canvas=W;this.rc=fa;this.shape=X;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=
+H.type="text/css";var P=H.appendChild,U=document,W=U.createTextNode;u=u.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(u=u.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(fa){}P.call(H,W.call(U,u));document.head.appendChild(H)}}))};Editor.replacePlaceholders=function(k,
+u){var H=[];if(null!=k&&null!=u){for(var P=RegExp("{([^{}\"'=;]+)}","g"),U,W=0;U=P.exec(k);){var fa=U[0];if(2<fa.length){var X=u(fa.substring(1,fa.length-1)),ea=fa;null!=X&&(ea=X);H.push(k.substring(W,U.index)+ea);W=U.index+fa.length}}H.push(k.substring(W))}return H.join("")};Editor.executeSimpleJsonPath=function(k,u){u=u.replace(/^\$\.?/,"").split(".");u=$jscomp.makeIterator(u);for(var H=u.next();!H.done;H=u.next()){var P=H.value;if(!k)return[];if(H=P.match(/([^\[]+)\[(\d+)\]/))if(P=H[1],H=parseInt(H[2]),
+k=k[P],Array.isArray(k)&&H<k.length)k=k[H];else return[];else k=k[P]}return void 0!==k?[k]:[]};Editor.createRoughCanvas=function(k){var u=rough.canvas({getContext:function(){return k}});u.draw=function(H){var P=H.sets||[];H=H.options||this.getDefaultOptions();for(var U=0;U<P.length;U++){var W=P[U];switch(W.type){case "path":null!=H.stroke&&this._drawToContext(k,W,H);break;case "fillPath":this._drawToContext(k,W,H);break;case "fillSketch":this.fillSketch(k,W,H)}}};u.fillSketch=function(H,P,U){var W=
+k.state.strokeColor,fa=k.state.strokeWidth,X=k.state.strokeAlpha,ea=k.state.dashed,oa=U.fillWeight;0>oa&&(oa=U.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(U.fill||"");k.setStrokeWidth(oa);k.setDashed(!1);oa=null!=H.root?H.root.lastChild:null;this._drawToContext(H,P,U);null!=H.root&&null!=H.root.lastChild&&H.root.lastChild!=oa&&"path"==H.root.lastChild.nodeName&&H.root.lastChild.setAttribute("data-rough-fill","1");k.setDashed(ea);k.setStrokeWidth(fa);k.setStrokeColor(W);k.setStrokeAlpha(X)};
+u._drawToContext=function(H,P,U){H.begin();for(var W=0;W<P.ops.length;W++){var fa=P.ops[W],X=fa.data;switch(fa.op){case "move":H.moveTo(X[0],X[1]);break;case "bcurveTo":H.curveTo(X[0],X[1],X[2],X[3],X[4],X[5]);break;case "lineTo":H.lineTo(X[0],X[1])}}H.end();"fillPath"===P.type&&U.filled?H.fill():H.stroke()};return u};(function(){function k(W,fa,X){this.canvas=W;this.rc=fa;this.shape=X;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=
mxUtils.bind(this,k.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,k.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,k.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,k.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,k.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,k.prototype.lineTo);
this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,k.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,k.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,k.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,k.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,k.prototype.close);this.originalFill=this.canvas.fill;
this.canvas.fill=mxUtils.bind(this,k.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,k.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,k.prototype.fillAndStroke);this.path=[];this.passThrough=!1}k.prototype.moveOp="M";k.prototype.lineOp="L";k.prototype.quadOp="Q";k.prototype.curveOp="C";k.prototype.closeOp="Z";k.prototype.getStyle=function(W,fa){var X=1;if(null!=this.shape.state){var ea=
this.shape.state.cell.id;if(null!=ea)for(var oa=0;oa<ea.length;oa++)X=(X<<5)-X+ea.charCodeAt(oa)<<0}X={strokeWidth:this.canvas.state.strokeWidth,seed:X,preserveVertices:!0};ea=this.rc.getDefaultOptions();X.stroke=W?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;W=null;(X.filled=fa)?(X.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,W=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):
X.fill="";X.bowing=mxUtils.getValue(this.shape.style,"bowing",ea.bowing);X.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ea.hachureAngle);X.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ea.curveFitting);X.roughness=mxUtils.getValue(this.shape.style,"jiggle",ea.roughness);X.simplification=mxUtils.getValue(this.shape.style,"simplification",ea.simplification);X.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ea.disableMultiStroke);X.disableMultiStrokeFill=
mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ea.disableMultiStrokeFill);fa=mxUtils.getValue(this.shape.style,"hachureGap",-1);X.hachureGap="auto"==fa?-1:fa;X.dashGap=mxUtils.getValue(this.shape.style,"dashGap",fa);X.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",fa);X.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",fa);fa=mxUtils.getValue(this.shape.style,"fillWeight",-1);X.fillWeight="auto"==fa?-1:fa;fa=mxUtils.getValue(this.shape.style,"fillStyle","auto");
-"dots"==fa&&(fa="auto");if("auto"==fa){var la=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;fa=function(ca){mxUtils.isLightDarkColor(ca)&&(ca=mxUtils.parseLightDarkColor(ca),ca=la?ca.dark:ca.light);return mxUtils.hex2rgb(ca)};oa=[fa("#ffffff")];null!=this.shape.state&&oa.push(fa(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&oa.push(fa(Editor.darkColor));fa=null!=X.fill&&(null!=W||0<=mxUtils.indexOf(oa,fa(X.fill)))?"solid":ea.fillStyle}X.fillStyle=
+"dots"==fa&&(fa="auto");if("auto"==fa){var ka=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;fa=function(ba){mxUtils.isLightDarkColor(ba)&&(ba=mxUtils.parseLightDarkColor(ba),ba=ka?ba.dark:ba.light);return mxUtils.hex2rgb(ba)};oa=[fa("#ffffff")];null!=this.shape.state&&oa.push(fa(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&oa.push(fa(Editor.darkColor));fa=null!=X.fill&&(null!=W||0<=mxUtils.indexOf(oa,fa(X.fill)))?"solid":ea.fillStyle}X.fillStyle=
fa;return X};k.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};k.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};k.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var W=2;W<arguments.length;W+=2)this.lastX=arguments[W-1],this.lastY=arguments[W],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};k.prototype.lineTo=
function(W,fa){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,W,fa),this.lastX=W,this.lastY=fa)};k.prototype.moveTo=function(W,fa){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,W,fa),this.lastX=W,this.lastY=fa,this.firstX=W,this.firstY=fa)};k.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};k.prototype.quadTo=function(W,fa,X,ea){this.passThrough?
-this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,W,fa,X,ea),this.lastX=X,this.lastY=ea)};k.prototype.curveTo=function(W,fa,X,ea,oa,la){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,W,fa,X,ea,oa,la),this.lastX=oa,this.lastY=la)};k.prototype.arcTo=function(W,fa,X,ea,oa,la,ca){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var sa=mxUtils.arcToCurves(this.lastX,this.lastY,W,fa,X,ea,oa,la,ca);if(null!=sa)for(var xa=
-0;xa<sa.length;xa+=6)this.curveTo(sa[xa],sa[xa+1],sa[xa+2],sa[xa+3],sa[xa+4],sa[xa+5]);this.lastX=la;this.lastY=ca}};k.prototype.rect=function(W,fa,X,ea){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(W,fa,X,ea,this.getStyle(!0,!0)))};k.prototype.ellipse=function(W,fa,X,ea){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(W+X/2,fa+ea/2,X,ea,this.getStyle(!0,
-!0)))};k.prototype.roundrect=function(W,fa,X,ea,oa,la){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(W+oa,fa),this.lineTo(W+X-oa,fa),this.quadTo(W+X,fa,W+X,fa+la),this.lineTo(W+X,fa+ea-la),this.quadTo(W+X,fa+ea,W+X-oa,fa+ea),this.lineTo(W+oa,fa+ea),this.quadTo(W,fa+ea,W,fa+ea-la),this.lineTo(W,fa+la),this.quadTo(W,fa,W+oa,fa))};k.prototype.drawPath=function(W){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),W)}catch(X){}this.passThrough=
+this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,W,fa,X,ea),this.lastX=X,this.lastY=ea)};k.prototype.curveTo=function(W,fa,X,ea,oa,ka){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,W,fa,X,ea,oa,ka),this.lastX=oa,this.lastY=ka)};k.prototype.arcTo=function(W,fa,X,ea,oa,ka,ba){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var sa=mxUtils.arcToCurves(this.lastX,this.lastY,W,fa,X,ea,oa,ka,ba);if(null!=sa)for(var xa=
+0;xa<sa.length;xa+=6)this.curveTo(sa[xa],sa[xa+1],sa[xa+2],sa[xa+3],sa[xa+4],sa[xa+5]);this.lastX=ka;this.lastY=ba}};k.prototype.rect=function(W,fa,X,ea){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(W,fa,X,ea,this.getStyle(!0,!0)))};k.prototype.ellipse=function(W,fa,X,ea){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(W+X/2,fa+ea/2,X,ea,this.getStyle(!0,
+!0)))};k.prototype.roundrect=function(W,fa,X,ea,oa,ka){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(W+oa,fa),this.lineTo(W+X-oa,fa),this.quadTo(W+X,fa,W+X,fa+ka),this.lineTo(W+X,fa+ea-ka),this.quadTo(W+X,fa+ea,W+X-oa,fa+ea),this.lineTo(W+oa,fa+ea),this.quadTo(W,fa+ea,W,fa+ea-ka),this.lineTo(W,fa+ka),this.quadTo(W,fa,W+oa,fa))};k.prototype.drawPath=function(W){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),W)}catch(X){}this.passThrough=
!1}else if(null!=this.nextShape){for(var fa in W)this.nextShape.options[fa]=W[fa];W.stroke!=mxConstants.NONE&&null!=W.stroke||delete this.nextShape.options.stroke;W.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};k.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};k.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):
this.drawPath(this.getStyle(!1,!0))};k.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};k.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=
this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(W){return new k(W,Editor.createRoughCanvas(W),this)};var u=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(W){return this.outline||
null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?u.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(W):this.createRoughCanvas(W)};var H=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(W,fa,X,ea,oa){null!=W.handJiggle&&W.handJiggle.passThrough||H.apply(this,arguments)};var P=mxShape.prototype.paint;mxShape.prototype.paint=function(W){var fa=W.addTolerance,X=!0;null!=this.style&&(X="1"==
-mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=W.handJiggle&&W.handJiggle.constructor==k&&!this.outline){W.save();var ea=this.fill,oa=this.stroke;this.stroke=this.fill=null;var la=this.configurePointerEvents,ca=W.setStrokeColor;W.setStrokeColor=function(){};var sa=W.setFillColor;W.setFillColor=function(){};X||null==ea||(this.configurePointerEvents=function(){});W.handJiggle.passThrough=!0;P.apply(this,arguments);W.handJiggle.passThrough=!1;W.setFillColor=sa;W.setStrokeColor=
-ca;this.configurePointerEvents=la;this.stroke=oa;this.fill=ea;W.restore();X&&null!=ea&&(W.addTolerance=function(){})}P.apply(this,arguments);W.addTolerance=fa};var T=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(W,fa,X,ea,oa,la){null!=W.handJiggle&&W.handJiggle.constructor==k?(W.handJiggle.passThrough=!0,T.apply(this,arguments),W.handJiggle.passThrough=!1):T.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?
-k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),{to:"string"})};Editor.extractGraphModel=function(k,u,H){if(null!=k&&"undefined"!==typeof pako){var P=k.ownerDocument.getElementsByTagName("div"),T=[];if(null!=P&&0<P.length)for(var W=0;W<P.length;W++)if("mxgraph"==P[W].getAttribute("class")){T.push(P[W]);break}0<T.length&&(P=T[0].getAttribute("data-mxgraph"),
-null!=P?(T=JSON.parse(P),null!=T&&null!=T.xml&&(k=mxUtils.parseXml(T.xml),k=k.documentElement)):(T=T[0].getElementsByTagName("div"),0<T.length&&(P=mxUtils.getTextContent(T[0]),P=Graph.decompress(P,null,H),0<P.length&&(k=mxUtils.parseXml(P),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(P=k.getAttribute("content"),null!=P&&"<"!=P.charAt(0)&&"%"!=P.charAt(0)&&(P=unescape(window.atob?atob(P):Base64.decode(cont,P))),null!=P&&"%"==P.charAt(0)&&(P=decodeURIComponent(P)),null!=P&&0<P.length)k=
-mxUtils.parseXml(P).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||u||(T=null,"diagram"==k.nodeName?T=k:"mxfile"==k.nodeName&&(P=k.getElementsByTagName("diagram"),0<P.length&&(T=P[Math.max(0,Math.min(P.length-1,urlParams.page||0))])),null!=T&&(k=Editor.parseDiagramNode(T,H)));null==k||"mxGraphModel"==k.nodeName||u&&"mxfile"==k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,u,H){Editor.validateDiagramNode(k);var P=mxUtils.trim(mxUtils.getTextContent(k)),
-T=null;0<P.length?(u=Graph.decompress(P,null,u),null!=u&&0<u.length&&(T=mxUtils.parseXml(u).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(T=k[0],H&&(T=Editor.parseDiagramNode(T,u,!1)),u=mxUtils.createXmlDocument(),u.appendChild(u.importNode(T,!0)),T=u.documentElement));return T};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);var u=mxUtils.getNodeValue(k),H=null;0<u.length?H=Graph.decompress(u):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(H=mxUtils.getXml(k[0])));
-return H};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var u=new mxCodec,H=new mxGraphModel;k.appendChild(u.encode(H))}return k};Editor.extractGraphModelFromPdf=function(k){var u=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0);if("%PDF-1.7"==k.substring(0,8)){for(var H=k.indexOf("EmbeddedFile");-1<H;){var P=k.indexOf("stream",H)+9;if(0<k.substring(H,P).indexOf("application#2Fvnd.jgraph.mxfile")){var T=
-k.indexOf("endstream",P-1);try{return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(P,T)),{to:"string"})}catch(ca){}}H=k.indexOf("EmbeddedFile",H+1)}for(H=k.indexOf("/ObjStm");0<H;){P=k.indexOf("stream",H)+9;T=k.indexOf("endstream",P-1);try{var W=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(P,T)),{to:"string"}),fa=W.indexOf("/Subject <");if(0<fa){var X=W.substring(fa+14,W.indexOf(">",fa));if(null!=X){P=X;T=[];for(var ea=0;ea<P.length;ea+=2){var oa=P.substr(ea,2);"00"!=oa&&T.push(String.fromCharCode(parseInt(oa,
-16)))}u=T.join("")}break}}catch(ca){}H=k.indexOf("/ObjStm",H+1)}}if(null==u&&"%PDF-"==k.substring(0,5)){W="";X=fa=0;var la=[];for(oa=null;X<k.length;){H=k.charCodeAt(X);X+=1;10!=H&&(W+=String.fromCharCode(H));H=="/Subject (%3Cmxfile".charCodeAt(fa)?fa++:fa=0;if(19==fa&&(P=k.indexOf("%3C%2Fmxfile%3E",X)+15,X-=9,P>X)){u=k.substring(X,P);break}10==H&&("endobj"==W?oa=null:"obj"==W.substring(W.length-3,W.length)||"xref"==W||"trailer"==W?(oa=[],la[W.split(" ")[0]]=oa):null!=oa&&oa.push(W),W="")}}null==
-u&&null!=la&&(u=Editor.extractGraphModelFromXref(la));null!=u&&(u=decodeURIComponent(u.replace(/\\([\\()])/g,"$1").replace(/\\\(/g,"(").replace(/\\\)/g,")")));return u};Editor.extractGraphModelFromXref=function(k){var u=k.trailer,H=null;null!=u&&(u=/.* \/Info (\d+) (\d+) R/g.exec(u.join("\n")),null!=u&&0<u.length&&(u=k[u[1]],null!=u&&(u=/.* \/Subject (\d+) (\d+) R/g.exec(u.join("\n")),null!=u&&0<u.length&&(k=k[u[1]],null!=k&&(k=k.join("\n"),H=k.substring(1,k.length-1))))));return H};Editor.extractParserError=
+mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=W.handJiggle&&W.handJiggle.constructor==k&&!this.outline){W.save();var ea=this.fill,oa=this.stroke;this.stroke=this.fill=null;var ka=this.configurePointerEvents,ba=W.setStrokeColor;W.setStrokeColor=function(){};var sa=W.setFillColor;W.setFillColor=function(){};X||null==ea||(this.configurePointerEvents=function(){});W.handJiggle.passThrough=!0;P.apply(this,arguments);W.handJiggle.passThrough=!1;W.setFillColor=sa;W.setStrokeColor=
+ba;this.configurePointerEvents=ka;this.stroke=oa;this.fill=ea;W.restore();X&&null!=ea&&(W.addTolerance=function(){})}P.apply(this,arguments);W.addTolerance=fa};var U=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(W,fa,X,ea,oa,ka){null!=W.handJiggle&&W.handJiggle.constructor==k?(W.handJiggle.passThrough=!0,U.apply(this,arguments),W.handJiggle.passThrough=!1):U.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?
+k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),{to:"string"})};Editor.extractGraphModel=function(k,u,H){if(null!=k&&"undefined"!==typeof pako){var P=k.ownerDocument.getElementsByTagName("div"),U=[];if(null!=P&&0<P.length)for(var W=0;W<P.length;W++)if("mxgraph"==P[W].getAttribute("class")){U.push(P[W]);break}0<U.length&&(P=U[0].getAttribute("data-mxgraph"),
+null!=P?(U=JSON.parse(P),null!=U&&null!=U.xml&&(k=mxUtils.parseXml(U.xml),k=k.documentElement)):(U=U[0].getElementsByTagName("div"),0<U.length&&(P=mxUtils.getTextContent(U[0]),P=Graph.decompress(P,null,H),0<P.length&&(k=mxUtils.parseXml(P),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(P=k.getAttribute("content"),null!=P&&"<"!=P.charAt(0)&&"%"!=P.charAt(0)&&(P=unescape(window.atob?atob(P):Base64.decode(cont,P))),null!=P&&"%"==P.charAt(0)&&(P=decodeURIComponent(P)),null!=P&&0<P.length)k=
+mxUtils.parseXml(P).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||u||(U=null,"diagram"==k.nodeName?U=k:"mxfile"==k.nodeName&&(P=k.getElementsByTagName("diagram"),0<P.length&&(U=P[Math.max(0,Math.min(P.length-1,urlParams.page||0))])),null!=U&&(k=Editor.parseDiagramNode(U,H)));null==k||"mxGraphModel"==k.nodeName||u&&"mxfile"==k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,u,H){Editor.validateDiagramNode(k);var P=mxUtils.trim(mxUtils.getTextContent(k)),
+U=null;0<P.length?(u=Graph.decompress(P,null,u),null!=u&&0<u.length&&(U=mxUtils.parseXml(u).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(U=k[0],H&&(U=Editor.parseDiagramNode(U,u,!1)),u=mxUtils.createXmlDocument(),u.appendChild(u.importNode(U,!0)),U=u.documentElement));return U};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);var u=mxUtils.getNodeValue(k),H=null;0<u.length?H=Graph.decompress(u):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(H=mxUtils.getXml(k[0])));
+return H};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var u=new mxCodec,H=new mxGraphModel;k.appendChild(u.encode(H))}return k};Editor.extractGraphModelFromPdf=function(k){var u=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0);if("%PDF-1.7"==k.substring(0,8)){for(var H=k.indexOf("EmbeddedFile");-1<H;){var P=k.indexOf("stream",H)+9;if(0<k.substring(H,P).indexOf("application#2Fvnd.jgraph.mxfile")){var U=
+k.indexOf("endstream",P-1);try{return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(P,U)),{to:"string"})}catch(ba){}}H=k.indexOf("EmbeddedFile",H+1)}for(H=k.indexOf("/ObjStm");0<H;){P=k.indexOf("stream",H)+9;U=k.indexOf("endstream",P-1);try{var W=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(P,U)),{to:"string"}),fa=W.indexOf("/Subject <");if(0<fa){var X=W.substring(fa+14,W.indexOf(">",fa));if(null!=X){P=X;U=[];for(var ea=0;ea<P.length;ea+=2){var oa=P.substr(ea,2);"00"!=oa&&U.push(String.fromCharCode(parseInt(oa,
+16)))}u=U.join("")}break}}catch(ba){}H=k.indexOf("/ObjStm",H+1)}}if(null==u&&"%PDF-"==k.substring(0,5)){W="";X=fa=0;var ka=[];for(oa=null;X<k.length;){H=k.charCodeAt(X);X+=1;10!=H&&(W+=String.fromCharCode(H));H=="/Subject (%3Cmxfile".charCodeAt(fa)?fa++:fa=0;if(19==fa&&(P=k.indexOf("%3C%2Fmxfile%3E",X)+15,X-=9,P>X)){u=k.substring(X,P);break}10==H&&("endobj"==W?oa=null:"obj"==W.substring(W.length-3,W.length)||"xref"==W||"trailer"==W?(oa=[],ka[W.split(" ")[0]]=oa):null!=oa&&oa.push(W),W="")}}null==
+u&&null!=ka&&(u=Editor.extractGraphModelFromXref(ka));null!=u&&(u=decodeURIComponent(u.replace(/\\([\\()])/g,"$1").replace(/\\\(/g,"(").replace(/\\\)/g,")")));return u};Editor.extractGraphModelFromXref=function(k){var u=k.trailer,H=null;null!=u&&(u=/.* \/Info (\d+) (\d+) R/g.exec(u.join("\n")),null!=u&&0<u.length&&(u=k[u[1]],null!=u&&(u=/.* \/Subject (\d+) (\d+) R/g.exec(u.join("\n")),null!=u&&0<u.length&&(k=k[u[1]],null!=k&&(k=k.join("\n"),H=k.substring(1,k.length-1))))));return H};Editor.extractParserError=
function(k,u){var H=null;k=null!=k?k.getElementsByTagName("parsererror"):null;null!=k&&0<k.length&&(H=u||mxResources.get("invalidChars"),u=k[0].getElementsByTagName("div"),0<u.length&&(H=mxUtils.getTextContent(u[0])));return null!=H?mxUtils.trim(H):H};Editor.addRetryToError=function(k,u){null!=k&&(k=null!=k.error?k.error:k,null==k.retry&&(k.retry=u))};Editor.mermaidToDrawio=function(k,u,H){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(k,u,H)};Editor.configure=function(k){if(null!=
k){Editor.config=k;Editor.configVersion=k.version;k.debug&&(urlParams.test="1");k.passiveScroll&&(Editor.passiveScroll=!0);k.noResizers&&(Editor.noResizers=!0);k.preserveViewState&&(Editor.preserveViewState=!0);null!=k.passThroughKeys&&(Editor.passThroughKeys=k.passThroughKeys);null!=k.keyboardShortcuts&&(Array.isArray(k.keyboardShortcuts)?Editor.keyboardShortcuts=k.keyboardShortcuts:EditorUi.debug("Configuration Error: Array expected for keyboardShortcuts"));k.suppressNewWindows&&(Editor.suppressNewWindows=
!0,Editor.popupsAllowed=!1);k.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=k.useInternalClipboard);if(null!=k.customCss){var u=document.createElement("style");u.type="text/css";u.appendChild(document.createTextNode(k.customCss));document.head.appendChild(u)}null!=k.resources&&("object"!==typeof k.resources||Array.isArray(k.resources)?EditorUi.debug("Configuration Error: Object expected for resources"):(Editor.customResources=k.resources,Editor.applyCustomResources()));null!=k.enableLocalFonts&&
@@ -3879,81 +3879,81 @@ k.sidebarTitles);null!=k.sidebarTitleSize&&(u=parseInt(k.sidebarTitleSize),!isNa
null!=k.maxImageBytes&&(EditorUi.prototype.maxImageBytes=k.maxImageBytes);null!=k.maxImageSize&&(EditorUi.prototype.maxImageSize=k.maxImageSize);null!=k.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=k.shareCursorPosition);null!=k.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=k.showRemoteCursors);null!=k.restrictExport&&(DrawioFile.RESTRICT_EXPORT=k.restrictExport);null!=k.removeImageMetadata&&(Editor.removeImageMetadata=k.removeImageMetadata);null!=k.defaultTextStyle&&(Editor.defaultTextStyle=
k.defaultTextStyle);null!=k.replaceSvgDataUris&&(Editor.replaceSvgDataUris=k.replaceSvgDataUris);null!=k.foreignObjectImages&&(Editor.foreignObjectImages=k.foreignObjectImages);null!=k.embedSvgFonts&&(Editor.embedSvgFonts=k.embedSvgFonts);null!=k.shadowColor&&(mxConstants.SHADOW_COLOR=k.shadowColor);null!=k.shadowOpacity&&(mxConstants.SHADOW_OPACITY=k.shadowOpacity);null!=k.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=k.shadowOffsetX);null!=k.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=k.shadowOffsetY);
null!=k.shadowBlur&&(mxConstants.SHADOW_BLUR=k.shadowBlur);null!=k.enableAnimations&&(Editor.enableAnimations=k.enableAnimations);null!=k.insertAnimations&&(Editor.insertAnimations=k.insertAnimations);null!=k.enableWindowDocking&&(Editor.enableWindowDocking=k.enableWindowDocking);null!=k.compact&&(EditorUi.prototype.defaultCompact=k.compact);null!=k.noAutoFocus&&(EditorUi.prototype.noAutoFocus=k.noAutoFocus);if(null!=k.hideMenuItems)if(Array.isArray(k.hideMenuItems))for(Menus.prototype.hiddenMenuItems=
-{},u=0;u<k.hideMenuItems.length;u++)Menus.prototype.hiddenMenuItems[k.hideMenuItems[u]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=k.hideMenus)if(Array.isArray(k.hideMenus)){var P={};for(u=0;u<k.hideMenus.length;u++)P[k.hideMenus[u]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(T){return!P[T]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=k.enableAi&&(Editor.enableAi=k.enableAi);
+{},u=0;u<k.hideMenuItems.length;u++)Menus.prototype.hiddenMenuItems[k.hideMenuItems[u]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=k.hideMenus)if(Array.isArray(k.hideMenus)){var P={};for(u=0;u<k.hideMenus.length;u++)P[k.hideMenus[u]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(U){return!P[U]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=k.enableAi&&(Editor.enableAi=k.enableAi);
null!=k.enableChatGpt&&(Editor.enableAi=k.enableChatGpt);null!=k.gptApiKey&&(Editor.aiGlobals.gptApiKey=k.gptApiKey);null!=k.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=k.geminiApiKey);null!=k.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=k.claudeApiKey);null!=k.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=k.gptUrl);null!=k.aiActions&&(Editor.aiActions=k.aiActions);null!=k.aiGlobals&&(Editor.aiGlobals=k.aiGlobals);null!=k.aiConfigs&&(Editor.aiConfigs=k.aiConfigs);null!=k.aiModels&&
(Editor.aiModels=k.aiModels)}};Editor.applyCustomResources=function(){if(null!=Editor.customResources){var k=null!=mxClient.language?mxClient.language.toLowerCase():null,u=null!=k?k.indexOf("-"):-1,H;for(H in Editor.customResources){var P=Editor.customResources[H];null!=P&&"object"===typeof P&&(P=(null!=k?P[k]:null)||(0<u?P[k.substring(0,u)]:null)||P.main);"string"===typeof P&&(mxResources.resources[H]=P)}}};var b=mxResources.parse;mxResources.parse=function(k){b.apply(this,arguments);Editor.applyCustomResources()};
-Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=function(k){function u(ea,oa){ea=ea.getAttribute("fill");if(null==ea||0!==ea.indexOf("url("))return null;ea=ea.match(/url\([^#]*#([^)"]+)\)?/);if(null==ea)return null;ea=ea[1];try{var la=oa.querySelector("#"+CSS.escape(ea));return null!=la&&"pattern"===la.nodeName?la:null}catch(ca){return null}}function H(ea,oa,la){var ca,sa,xa;try{var qa=ea.getBBox()}catch(Ja){return}if(0!==
-qa.width&&0!==qa.height){var Ba=parseFloat(oa.getAttribute("width")),ma=parseFloat(oa.getAttribute("height"));if(!(isNaN(Ba)||isNaN(ma)||0>=Ba||0>=ma)){var ta=oa.getAttribute("patternTransform");var va=sa=ca=0;var Ha=xa=1;if(null!=ta){var La=ta.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=La&&(ca=parseFloat(La[1]),sa=parseFloat(La[2]));La=ta.match(/rotate\(\s*([^)]+)\)/);null!=La&&(va=parseFloat(La[1])*Math.PI/180);ta=ta.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=ta&&(xa=parseFloat(ta[1]),
-Ha=null!=ta[2]?parseFloat(ta[2]):xa)}var Ia=[{x:qa.x,y:qa.y},{x:qa.x+qa.width,y:qa.y},{x:qa.x+qa.width,y:qa.y+qa.height},{x:qa.x,y:qa.y+qa.height}],Ca=Infinity;qa=Infinity;La=ta=-Infinity;for(var Pa=0;Pa<Ia.length;Pa++){var Ka=Ia[Pa].x-ca;var Na=Ia[Pa].y-sa,Oa=Math.cos(-va),Ea=Math.sin(-va);var Aa=(Ka*Oa-Na*Ea)/xa;Ka=(Ka*Ea+Na*Oa)/Ha;Ca=Math.min(Ca,Aa);qa=Math.min(qa,Ka);ta=Math.max(ta,Aa);La=Math.max(La,Ka)}Ca=Math.floor(Ca/Ba)-1;qa=Math.floor(qa/ma)-1;ta=Math.ceil(ta/Ba)+1;Aa=Math.ceil(La/ma)+1;
-if(!(1E4<(ta-Ca)*(Aa-qa))){Pa=T+ ++P;La=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");La.setAttribute("id",Pa);Ia=ea.cloneNode(!0);Ia.removeAttribute("fill");Ia.removeAttribute("fill-opacity");Ia.removeAttribute("stroke");Ia.removeAttribute("stroke-width");Ia.removeAttribute("stroke-opacity");Ia.removeAttribute("style");Ia.removeAttribute("pointer-events");Ia.setAttribute("fill","black");La.appendChild(Ia);Ia=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
-"g");Ia.setAttribute("clip-path","url(#"+Pa+")");Pa=ea.getAttribute("fill-opacity");null!=Pa&&Ia.setAttribute("opacity",Pa);Pa=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Pa.setAttribute("transform","translate("+ca+","+sa+")"+(0!==va?" rotate("+180*va/Math.PI+")":"")+" scale("+xa+(Ha!==xa?","+Ha:"")+")");sa=T+ ++P;ca=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");ca.setAttribute("id",sa);va=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
-"rect");va.setAttribute("x","0");va.setAttribute("y","0");va.setAttribute("width",Ba);va.setAttribute("height",ma);ca.appendChild(va);oa=oa.childNodes;for(va=Ca;va<ta;va++)for(xa=qa;xa<Aa;xa++){Ha=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ha.setAttribute("transform","translate("+va*Ba+","+xa*ma+")");Ha.setAttribute("clip-path","url(#"+sa+")");for(Ca=0;Ca<oa.length;Ca++)1===oa[Ca].nodeType&&Ha.appendChild(oa[Ca].cloneNode(!0));Pa.appendChild(Ha)}Ia.appendChild(Pa);Ba=la.querySelector("defs");
-null==Ba&&(Ba=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),la.insertBefore(Ba,la.firstChild));Ba.appendChild(La);Ba.appendChild(ca);ea.parentNode.insertBefore(Ia,ea.nextSibling);ea.setAttribute("fill","none");ea.style.fill=""}}}}for(var P=0,T="expand-pattern-clip-"+Editor.guid(8)+"-",W=k.querySelectorAll('[fill^="url("]'),fa=0;fa<W.length;fa++){var X=u(W[fa],k);null!=X&&H(W[fa],X,k)}W=k.querySelectorAll("[style]");for(fa=0;fa<W.length;fa++)X=W[fa].getAttribute("style"),null!=
+Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=function(k){function u(ea,oa){ea=ea.getAttribute("fill");if(null==ea||0!==ea.indexOf("url("))return null;ea=ea.match(/url\([^#]*#([^)"]+)\)?/);if(null==ea)return null;ea=ea[1];try{var ka=oa.querySelector("#"+CSS.escape(ea));return null!=ka&&"pattern"===ka.nodeName?ka:null}catch(ba){return null}}function H(ea,oa,ka){var ba,sa,xa;try{var qa=ea.getBBox()}catch(Ja){return}if(0!==
+qa.width&&0!==qa.height){var Ba=parseFloat(oa.getAttribute("width")),ma=parseFloat(oa.getAttribute("height"));if(!(isNaN(Ba)||isNaN(ma)||0>=Ba||0>=ma)){var ta=oa.getAttribute("patternTransform");var va=sa=ba=0;var Ga=xa=1;if(null!=ta){var La=ta.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=La&&(ba=parseFloat(La[1]),sa=parseFloat(La[2]));La=ta.match(/rotate\(\s*([^)]+)\)/);null!=La&&(va=parseFloat(La[1])*Math.PI/180);ta=ta.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=ta&&(xa=parseFloat(ta[1]),
+Ga=null!=ta[2]?parseFloat(ta[2]):xa)}var Ia=[{x:qa.x,y:qa.y},{x:qa.x+qa.width,y:qa.y},{x:qa.x+qa.width,y:qa.y+qa.height},{x:qa.x,y:qa.y+qa.height}],Ca=Infinity;qa=Infinity;La=ta=-Infinity;for(var Pa=0;Pa<Ia.length;Pa++){var Ka=Ia[Pa].x-ba;var Na=Ia[Pa].y-sa,Oa=Math.cos(-va),Ea=Math.sin(-va);var Aa=(Ka*Oa-Na*Ea)/xa;Ka=(Ka*Ea+Na*Oa)/Ga;Ca=Math.min(Ca,Aa);qa=Math.min(qa,Ka);ta=Math.max(ta,Aa);La=Math.max(La,Ka)}Ca=Math.floor(Ca/Ba)-1;qa=Math.floor(qa/ma)-1;ta=Math.ceil(ta/Ba)+1;Aa=Math.ceil(La/ma)+1;
+if(!(1E4<(ta-Ca)*(Aa-qa))){Pa=U+ ++P;La=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");La.setAttribute("id",Pa);Ia=ea.cloneNode(!0);Ia.removeAttribute("fill");Ia.removeAttribute("fill-opacity");Ia.removeAttribute("stroke");Ia.removeAttribute("stroke-width");Ia.removeAttribute("stroke-opacity");Ia.removeAttribute("style");Ia.removeAttribute("pointer-events");Ia.setAttribute("fill","black");La.appendChild(Ia);Ia=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
+"g");Ia.setAttribute("clip-path","url(#"+Pa+")");Pa=ea.getAttribute("fill-opacity");null!=Pa&&Ia.setAttribute("opacity",Pa);Pa=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Pa.setAttribute("transform","translate("+ba+","+sa+")"+(0!==va?" rotate("+180*va/Math.PI+")":"")+" scale("+xa+(Ga!==xa?","+Ga:"")+")");sa=U+ ++P;ba=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");ba.setAttribute("id",sa);va=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
+"rect");va.setAttribute("x","0");va.setAttribute("y","0");va.setAttribute("width",Ba);va.setAttribute("height",ma);ba.appendChild(va);oa=oa.childNodes;for(va=Ca;va<ta;va++)for(xa=qa;xa<Aa;xa++){Ga=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ga.setAttribute("transform","translate("+va*Ba+","+xa*ma+")");Ga.setAttribute("clip-path","url(#"+sa+")");for(Ca=0;Ca<oa.length;Ca++)1===oa[Ca].nodeType&&Ga.appendChild(oa[Ca].cloneNode(!0));Pa.appendChild(Ga)}Ia.appendChild(Pa);Ba=ka.querySelector("defs");
+null==Ba&&(Ba=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),ka.insertBefore(Ba,ka.firstChild));Ba.appendChild(La);Ba.appendChild(ba);ea.parentNode.insertBefore(Ia,ea.nextSibling);ea.setAttribute("fill","none");ea.style.fill=""}}}}for(var P=0,U="expand-pattern-clip-"+Editor.guid(8)+"-",W=k.querySelectorAll('[fill^="url("]'),fa=0;fa<W.length;fa++){var X=u(W[fa],k);null!=X&&H(W[fa],X,k)}W=k.querySelectorAll("[style]");for(fa=0;fa<W.length;fa++)X=W[fa].getAttribute("style"),null!=
X&&-1!==X.indexOf("url(")&&(X=u(W[fa],k),null!=X&&H(W[fa],X,k))};Editor.addAllowedFontUrl=function(k){"string"===typeof k&&0<k.length&&(Graph.allowedFontUrls[k]=!0)};Editor.addAllowedFontUrls=function(k){if(Array.isArray(k))for(var u=0;u<k.length;u++)null!=k[u]&&"object"===typeof k[u]&&Editor.addAllowedFontUrl(k[u].fontUrl)};Editor.configureFontCss=function(k){if(null!=k){Editor.prototype.fontCss=k;for(var u=k.split("url("),H=1;H<u.length;H++){var P=u[H].indexOf(")");0<P&&Editor.addAllowedFontUrl(Editor.trimCssUrl(u[H].substring(0,
-P)))}u=document.getElementsByTagName("script")[0];if(null!=u&&null!=u.parentNode)for(H=document.createElement("style"),H.setAttribute("type","text/css"),H.appendChild(document.createTextNode(k)),u.parentNode.insertBefore(H,u),k=k.split("url("),H=1;H<k.length;H++){P=k[H].indexOf(")");P=Editor.trimCssUrl(k[H].substring(0,P));var T=document.createElement("link");T.setAttribute("rel","preload");T.setAttribute("href",P);T.setAttribute("as","font");T.setAttribute("crossorigin","");u.parentNode.insertBefore(T,
+P)))}u=document.getElementsByTagName("script")[0];if(null!=u&&null!=u.parentNode)for(H=document.createElement("style"),H.setAttribute("type","text/css"),H.appendChild(document.createTextNode(k)),u.parentNode.insertBefore(H,u),k=k.split("url("),H=1;H<k.length;H++){P=k[H].indexOf(")");P=Editor.trimCssUrl(k[H].substring(0,P));var U=document.createElement("link");U.setAttribute("rel","preload");U.setAttribute("href",P);U.setAttribute("as","font");U.setAttribute("crossorigin","");u.parentNode.insertBefore(U,
u)}}};Editor.trimCssUrl=function(k){return k.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(k){k=null!=k?k:Editor.GUID_LENGTH;for(var u=[],H=0;H<k;H++)u.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*
Editor.GUID_ALPHABET.length)));return u.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",
extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.generateTimeout=9E4;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!0;var d=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(k){k=null!=k&&"mxlibrary"!=k.nodeName?this.extractGraphModel(k):null;
if(null!=k){var u=Editor.extractParserError(k,mxResources.get("invalidOrMissingFile"));if(u)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[k],"cause",[u]),Error(mxResources.get("notADiagramFile")+" ("+u+")");if("mxGraphModel"==k.nodeName){u=k.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=u&&""!=u)u!=this.graph.currentStyle&&(H=null!=this.graph.themes?this.graph.themes[u]:mxUtils.load(STYLE_PATH+"/"+u+".xml").getDocumentElement(),null!=H&&(P=new mxCodec(H.ownerDocument),
P.decode(H,this.graph.getStylesheet())));else{var H=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=H){var P=new mxCodec(H.ownerDocument);P.decode(H,this.graph.getStylesheet())}}this.graph.currentStyle=u;this.graph.mathEnabled="1"==urlParams.math||"1"==k.getAttribute("math");this.graph.setAdaptiveColors(k.getAttribute("adaptiveColors"));u=k.getAttribute("backgroundImage");null!=u?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(u)):
-this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==k.getAttribute("shadow"),!1);if(u=k.getAttribute("extFonts"))try{for(u=u.split("|").map(function(T){T=T.split("^");return{name:T[0],url:T[1]}}),H=0;H<u.length;H++)this.graph.addExtFont(u[H].name,u[H].url)}catch(T){console.log("ExtFonts format error: "+T.message)}else null!=this.graph.extFonts&&
+this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==k.getAttribute("shadow"),!1);if(u=k.getAttribute("extFonts"))try{for(u=u.split("|").map(function(U){U=U.split("^");return{name:U[0],url:U[1]}}),H=0;H<u.length;H++)this.graph.addExtFont(u[H].name,u[H].url)}catch(U){console.log("ExtFonts format error: "+U.message)}else null!=this.graph.extFonts&&
0<this.graph.extFonts.length&&(this.graph.extFonts=[])}d.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var m=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(k,u){k=null!=k?k:!0;var H=m.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&H.setAttribute("style",this.graph.currentStyle);var P=this.graph.getBackgroundImageObject(this.graph.backgroundImage,
-u);null!=P&&H.setAttribute("backgroundImage",JSON.stringify(P));H.setAttribute("math",this.graph.mathEnabled?"1":"0");H.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?H.setAttribute("adaptiveColors",this.graph.adaptiveColors):H.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(P=this.graph.extFonts.map(function(T){return T.name+"^"+T.url}),H.setAttribute("extFonts",P.join("|")));return H};Editor.prototype.isDataSvg=
+u);null!=P&&H.setAttribute("backgroundImage",JSON.stringify(P));H.setAttribute("math",this.graph.mathEnabled?"1":"0");H.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?H.setAttribute("adaptiveColors",this.graph.adaptiveColors):H.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(P=this.graph.extFonts.map(function(U){return U.name+"^"+U.url}),H.setAttribute("extFonts",P.join("|")));return H};Editor.prototype.isDataSvg=
function(k){try{var u=mxUtils.parseXml(k).documentElement.getAttribute("content");if(null!=u&&(null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(cont,u))),null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u)),null!=u&&0<u.length)){var H=mxUtils.parseXml(u).documentElement;return"mxfile"==H.nodeName||"mxGraphModel"==H.nodeName}}catch(P){}return!1};Editor.prototype.extractGraphModel=function(k,u,H){return Editor.extractGraphModel.apply(this,arguments)};var p=
Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();p.apply(this,arguments)};var t=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){t.apply(this,arguments);this.graph.useCssTransforms=
!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.safeMathJaxFilterUrl=function(k,u){var H=(u.replace(/[\t\n\r]/g,"").replace(/^[\u0000-\u0020]+/,"").match(/^([a-z][a-z0-9+.\-]*):/i)||[null,""])[1].toLowerCase(),P=k.allow.URLs;return"all"===P||"safe"===P&&(k.options.safeProtocols[H]||!H)?u:null};Editor.safeMathJaxFilterUrl.drawioPatched=!0;Editor.patchMathJaxUrlFilter=function(k){k=null!=k?k:"undefined"!==typeof MathJax?MathJax:
null;if(null!=k){var u=null!=k._&&null!=k._.ui&&null!=k._.ui.safe&&null!=k._.ui.safe.SafeMethods?k._.ui.safe.SafeMethods.SafeMethods:null;null==u||null==u.filterURL||u.filterURL.drawioPatched||(u.filterURL=Editor.safeMathJaxFilterUrl);k=null!=k.startup?k.startup.document:null;null==k||null==k.safe||null==k.safe.filterMethods||null==k.safe.filterMethods.filterURL||k.safe.filterMethods.filterURL.drawioPatched||(k.safe.filterMethods.filterURL=Editor.safeMathJaxFilterUrl)}};Editor.safeMathJaxDataMacro=
-function(k,u,H,P){var T=k.setAttribute;k.setAttribute=function(W,fa,X){if("string"!==typeof fa||"data-"!==fa.substring(0,5)||fa.match(Editor.safeMathJaxDataPattern))return T.apply(this,arguments)};try{return u.apply(this,[H,P])}finally{k.setAttribute=T}};Editor.safeMathJaxDataPattern=/^data-mjx-/;Editor.patchMathJaxDataMacro=function(k){k=null!=k?k:"undefined"!==typeof MathJax?MathJax:null;k=null!=k&&null!=k._&&null!=k._.input?k._.input.tex:null;if(null!=k&&null!=k.MapHandler&&null!=k.NodeUtil){var u=
-k.MapHandler.MapHandler.getMap("html_macros");u=null!=u&&null!=u.lookup?u.lookup("data"):null;if(null!=u&&null!=u._func&&!u._func.drawioPatched){var H=k.NodeUtil["default"],P=u._func;k=function(T,W){return Editor.safeMathJaxDataMacro(H,P,T,W)};k.drawioPatched=!0;u._func=k}}};Editor.patchMathJaxSafeFilters=function(k){Editor.patchMathJaxUrlFilter(k);Editor.patchMathJaxDataMacro(k)};Editor.initMath=function(k,u){if("undefined"===typeof window.MathJax){var H=function(){P=null;Editor.mathJaxRendering=
+function(k,u,H,P){var U=k.setAttribute;k.setAttribute=function(W,fa,X){if("string"!==typeof fa||"data-"!==fa.substring(0,5)||fa.match(Editor.safeMathJaxDataPattern))return U.apply(this,arguments)};try{return u.apply(this,[H,P])}finally{k.setAttribute=U}};Editor.safeMathJaxDataPattern=/^data-mjx-/;Editor.patchMathJaxDataMacro=function(k){k=null!=k?k:"undefined"!==typeof MathJax?MathJax:null;k=null!=k&&null!=k._&&null!=k._.input?k._.input.tex:null;if(null!=k&&null!=k.MapHandler&&null!=k.NodeUtil){var u=
+k.MapHandler.MapHandler.getMap("html_macros");u=null!=u&&null!=u.lookup?u.lookup("data"):null;if(null!=u&&null!=u._func&&!u._func.drawioPatched){var H=k.NodeUtil["default"],P=u._func;k=function(U,W){return Editor.safeMathJaxDataMacro(H,P,U,W)};k.drawioPatched=!0;u._func=k}}};Editor.patchMathJaxSafeFilters=function(k){Editor.patchMathJaxUrlFilter(k);Editor.patchMathJaxDataMacro(k)};Editor.initMath=function(k,u){if("undefined"===typeof window.MathJax){var H=function(){P=null;Editor.mathJaxRendering=
!1;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};k=null!=k?k:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var P=null;Editor.mathJaxRendering=!1;Editor.doMathJaxRender=function(fa){Editor.patchMathJaxSafeFilters();null!=MathJax.startup&&null!=MathJax.startup.output&&null!=MathJax.startup.output.options&&null!=MathJax.startup.output.options.linebreaks&&(MathJax.startup.output.options.linebreaks.inline=!1);try{null==P?(MathJax.typesetClear([fa]),
MathJax.typeset([fa]),H()):P!=fa&&Editor.mathJaxQueue.push(fa)}catch(X){MathJax.typesetClear([fa]),null!=X.retry?(P=fa,Editor.mathJaxRendering=!0,X.retry.then(function(){MathJax.typesetPromise([fa]).then(H)["catch"](function(ea){console.log("Error in MathJax.typesetPromise: "+ea.toString());H()})})["catch"](function(ea){console.log("Error in MathJax.retry: "+ea.toString());H()})):null!=window.console&&console.log("Error in MathJax.typeset: "+X.toString())}};window.MathJax=null!=u?u:{options:{skipHtmlTags:{"[+]":["text"]},
ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe","[tex]/html"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var fa=0;fa<Editor.mathJaxQueue.length;fa++)Editor.doMathJaxRender(Editor.mathJaxQueue[fa])}}};Editor.MathJaxRender=function(fa){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(fa):Editor.mathJaxQueue.push(fa)};
-Editor.onMathJaxDone=function(){};var T=Editor.prototype.init;Editor.prototype.init=function(){T.apply(this,arguments);var fa=mxUtils.bind(this,function(oa,la){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,fa);this.graph.addListener(mxEvent.REFRESH,fa);var X=this.graph,ea=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){null!=
+Editor.onMathJaxDone=function(){};var U=Editor.prototype.init;Editor.prototype.init=function(){U.apply(this,arguments);var fa=mxUtils.bind(this,function(oa,ka){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,fa);this.graph.addListener(mxEvent.REFRESH,fa);var X=this.graph,ea=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){null!=
ea&&ea.apply(this,arguments);Editor.mathOutputSize&&null!=X&&X.mathEnabled&&(X.refreshMathBounds(),null!=X.container&&(X.container.style.visibility=""))}};u=document.getElementsByTagName("script");if(null!=u&&0<u.length){var W=document.createElement("script");W.setAttribute("type","text/javascript");W.setAttribute("src",k);u[0].parentNode.appendChild(W)}}};Editor.containsMath=function(k){return null!=k&&(0<=k.indexOf("$")||0<=k.indexOf("\\(")||0<=k.indexOf("\\[")||0<=k.indexOf("\\begin{"))};(function(){var k=
-Graph.prototype.getPreferredSizeForCell,u=null;Graph.prototype.getPreferredSizeForCell=function(H,P,T){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(H))return k.apply(this,arguments);var W=this.view.createState(H);W=null!=W?this.cellRenderer.getLabelValue(W):null;if(null==W||0===W.length||!Editor.containsMath(W))return k.apply(this,arguments);var fa=mxUtils.getSizeForString;mxUtils.getSizeForString=function(X,ea,
-oa,la){null==u&&(u=document.createElement("div"),u.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(u));u.style.fontSize=ea+"px";u.style.fontFamily=oa;null!=la&&0<la?(u.style.width=la+"px",u.style.whiteSpace="normal"):(u.style.width="",u.style.whiteSpace="nowrap");MathJax.typesetClear([u]);u.innerHTML=Graph.sanitizeHtml(X);try{MathJax.typeset([u]);var ca=u.getBoundingClientRect();return new mxRectangle(0,0,ca.width,ca.height)}catch(sa){return fa.apply(this,
-arguments)}};try{return k.apply(this,arguments)}finally{mxUtils.getSizeForString=fa}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var k=this.view,u=!1;k.states.visit(mxUtils.bind(this,function(P,T){null!=T&&null!=T.text&&(P=this.cellRenderer.getLabelValue(T),"string"===typeof P&&Editor.containsMath(P)&&(T.text.updateBoundingBox(),u=!0))}));if(u){var H=null!=k.currentRoot?k.currentRoot:this.model.getRoot();H=k.getState(H);null!=H&&(H=k.getBoundingBox(H,
-!0,!1),k.setGraphBounds(null!=H?H:k.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var k=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(u){k.apply(this,arguments);var H=this.editor.graph;if(Editor.mathOutputSize&&null!=H&&H.mathEnabled){var P=arguments,T=this,W=!1,fa=function(){W||(W=!0,H.removeListener(fa),H.zoomTo(1),T.resetScrollbars(),k.apply(T,P))};H.addListener("mathRefreshed",fa);Promise.resolve().then(function(){W||
-"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||H.removeListener(fa)})}}})();Editor.prototype.csvToArray=function(k){if(0<k.length){var u="",H=[""],P=0,T=!0,W;k=$jscomp.makeIterator(k);for(W=k.next();!W.done;W=k.next())W=W.value,'"'===W?(T&&W===u&&(H[P]+=W),T=!T):","===W&&T?W=H[++P]="":H[P]+=W,u=W;return H}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||
+Graph.prototype.getPreferredSizeForCell,u=null;Graph.prototype.getPreferredSizeForCell=function(H,P,U){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(H))return k.apply(this,arguments);var W=this.view.createState(H);W=null!=W?this.cellRenderer.getLabelValue(W):null;if(null==W||0===W.length||!Editor.containsMath(W))return k.apply(this,arguments);var fa=mxUtils.getSizeForString;mxUtils.getSizeForString=function(X,ea,
+oa,ka){null==u&&(u=document.createElement("div"),u.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(u));u.style.fontSize=ea+"px";u.style.fontFamily=oa;null!=ka&&0<ka?(u.style.width=ka+"px",u.style.whiteSpace="normal"):(u.style.width="",u.style.whiteSpace="nowrap");MathJax.typesetClear([u]);u.innerHTML=Graph.sanitizeHtml(X);try{MathJax.typeset([u]);var ba=u.getBoundingClientRect();return new mxRectangle(0,0,ba.width,ba.height)}catch(sa){return fa.apply(this,
+arguments)}};try{return k.apply(this,arguments)}finally{mxUtils.getSizeForString=fa}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var k=this.view,u=!1;k.states.visit(mxUtils.bind(this,function(P,U){null!=U&&null!=U.text&&(P=this.cellRenderer.getLabelValue(U),"string"===typeof P&&Editor.containsMath(P)&&(U.text.updateBoundingBox(),u=!0))}));if(u){var H=null!=k.currentRoot?k.currentRoot:this.model.getRoot();H=k.getState(H);null!=H&&(H=k.getBoundingBox(H,
+!0,!1),k.setGraphBounds(null!=H?H:k.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var k=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(u){k.apply(this,arguments);var H=this.editor.graph;if(Editor.mathOutputSize&&null!=H&&H.mathEnabled){var P=arguments,U=this,W=!1,fa=function(){W||(W=!0,H.removeListener(fa),H.zoomTo(1),U.resetScrollbars(),k.apply(U,P))};H.addListener("mathRefreshed",fa);Promise.resolve().then(function(){W||
+"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||H.removeListener(fa)})}}})();Editor.prototype.csvToArray=function(k){if(0<k.length){var u="",H=[""],P=0,U=!0,W;k=$jscomp.makeIterator(k);for(W=k.next();!W.done;W=k.next())W=W.value,'"'===W?(U&&W===u&&(H[P]+=W),U=!U):","===W&&U?W=H[++P]="":H[P]+=W,u=W;return H}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||
/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(k)){var u=EditorUi.isVisioFilename(k);u=/\.png$/i.test(k)||/\.pdf$/i.test(k)||u;var H="t="+(new Date).getTime();k=PROXY_URL+"?url="+encodeURIComponent(k)+"&"+H+(u?"&base64=1":"")}return k};Editor.prototype.isCorsEnabledForUrl=function(k){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||k.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=
new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(k)||"https://raw.githubusercontent.com/"===k.substring(0,34)||"https://icons.diagrams.net/"===k.substring(0,27)||"https://fonts.googleapis.com/"===k.substring(0,29)||"https://fonts.gstatic.com/"===k.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var k=new mxUrlConverter;k.updateBaseUrl();var u=k.convert,H=this;k.convert=function(P){null!=P&&navigator.onLine&&("http://"!=P.substring(0,
-7)&&"https://"!=P.substring(0,8)||P.substring(0,k.baseUrl.length)==k.baseUrl||H.crossOriginImages&&H.isCorsEnabledForUrl(P)?"chrome-extension://"!=P.substring(0,19)&&(P=u.apply(this,arguments)):P=PROXY_URL+"?url="+encodeURIComponent(P));return P};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,u,H,P,T){try{var W=!0,fa=window.setTimeout(mxUtils.bind(this,function(){W=!1;u(k)}),
-this.timeout),X=mxUtils.bind(this,function(){null!=P?this.convertImageToDataUri(k,u,H,P,!0):u(k)});if(/(\.svg)$/i.test(k)&&!T)mxUtils.get(k,mxUtils.bind(this,function(oa){window.clearTimeout(fa);W&&(200>oa.getStatus()||299<oa.getStatus()?X():u(Editor.createSvgDataUri(oa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(fa);W&&X()}));else{var ea=new Image;this.crossOriginImages&&(ea.crossOrigin="anonymous");ea.onload=function(){window.clearTimeout(fa);if(W)try{P=null!=P&&T?P:1;var oa=
-document.createElement("canvas");oa.height=ea.height*P;oa.width=ea.width*P;var la=oa.getContext("2d");la.scale(P,P);la.drawImage(ea,0,0);u(oa.toDataURL())}catch(ca){u(k)}};ea.onerror=function(){window.clearTimeout(fa);W&&(null!=H?H():u(k))};ea.src=k}}catch(oa){null!=H?H():u(k)}};Editor.prototype.convertImages=function(k,u,H,P){function T(){0<W.length?W.shift()():u(k)}null==P&&(P=this.createImageUrlConverter());var W=[],fa=H||{};H=mxUtils.bind(this,function(ca,sa){ca=k.getElementsByTagName(ca);for(var xa=
-0;xa<ca.length;xa++)mxUtils.bind(this,function(qa){W.push(mxUtils.bind(this,function(){try{if(null!=qa){var Ba=P.convert(qa.getAttribute(sa));if(null!=Ba&&"data:"!=Ba.substring(0,5)){var ma=fa[Ba];null==ma?this.convertImageToDataUri(Ba,function(ta){null!=ta&&(fa[Ba]=ta,qa.setAttribute(sa,ta));T()},null,Editor.svgRasterScale):(qa.setAttribute(sa,ma),T())}else null!=Ba&&qa.setAttribute(sa,Ba),T()}}catch(ta){T()}}))})(ca[xa])});var X={},ea=function(){var ca=k.getElementsByTagName("defs")[0];null==ca&&
-(ca=k.ownerDocument,ca=null!=ca.createElementNS?ca.createElementNS(mxConstants.NS_SVG,"defs"):ca.createElement("defs"),k.insertBefore(ca,k.firstChild));return ca},oa=mxUtils.bind(this,function(){for(var ca=k.getElementsByTagName("use"),sa=0;sa<ca.length;sa++)mxUtils.bind(this,function(xa){W.push(mxUtils.bind(this,function(){try{var qa=xa.getAttribute("href");null==qa&&(qa=xa.getAttribute("xlink:href"));if(null!=qa&&"#"!=qa.charAt(0)&&"data:"!=qa.substring(0,5)){var Ba=P.convert(qa),ma=function(va){va=
-Graph.createSvgImageSymbol(ea(),X,va,!0);null!=va&&(xa.setAttribute("href","#"+va),xa.setAttribute("xlink:href","#"+va));T()},ta=fa[Ba];null==ta?this.convertImageToDataUri(Ba,function(va){null!=va&&va!=Ba&&(fa[Ba]=va);ma(va)}):ma(ta)}else T()}catch(va){T()}}))})(ca[sa])}),la=mxUtils.bind(this,function(){W.push(mxUtils.bind(this,function(){try{for(var ca=k.getElementsByTagName("image"),sa=[],xa=0;xa<ca.length;xa++)sa.push(ca[xa]);var qa={},Ba={},ma=[],ta=function(){for(var Oa=k.getElementsByTagName("use"),
-Ea=0;Ea<Oa.length;Ea++){var Aa=Oa[Ea].getAttribute("href");null==Aa&&(Aa=Oa[Ea].getAttribute("xlink:href"));null!=Aa&&null!=qa[Aa]&&(Oa[Ea].setAttribute("href","#"+qa[Aa]),Oa[Ea].setAttribute("xlink:href","#"+qa[Aa]))}},va=function(Oa,Ea){for(var Aa=null!=k.ownerDocument.createElementNS?k.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):k.ownerDocument.createElement("use"),Ja=Oa.attributes,Ga=0;Ga<Ja.length;Ga++){var Ua=Ja[Ga].name;"href"!=Ua&&"xlink:href"!=Ua&&"preserveAspectRatio"!=Ua&&Aa.setAttribute(Ua,
-Ja[Ga].value)}Aa.setAttribute("href","#"+Ea);Aa.setAttribute("xlink:href","#"+Ea);Oa.parentNode.replaceChild(Aa,Oa)};for(xa=0;xa<sa.length;xa++){var Ha=sa[xa];ca=Ha;var La=!0;if("symbol"==Ha.parentNode.nodeName)if(null==Ha.getAttribute("id")&&"mx-image-"==String(Ha.parentNode.getAttribute("id")||"").substring(0,9))ca=Ha.parentNode,La=!1;else continue;else"mx-image-"==String(Ha.getAttribute("id")||"").substring(0,9)&&(La=!1);var Ia=Ha.getAttribute("xlink:href");if(null!=Ia&&"data:"==Ia.substring(0,
-5)){var Ca=ca.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==Ia.substring(0,18)){var Pa="mx-symbol-"+mxUtils.hashCode(Ia+"|"+("none"!=Ca)),Ka=k.querySelector('[id="'+Pa+'"]');if(null!=Ka&&"symbol"==Ka.nodeName){La?va(Ha,Pa):(qa["#"+ca.getAttribute("id")]=Pa,ca.parentNode.removeChild(ca));continue}}null==Ba[Ia]&&(Ba[Ia]={},ma.push(Ia));null==Ba[Ia][Ca]&&(Ba[Ia][Ca]=[]);Ba[Ia][Ca].push({node:ca,inline:La})}}ta();var Na=function(){for(var Oa=null,Ea=null;0<ma.length&&null==Oa;){Oa=
-ma.pop();Ea=Ba[Oa];var Aa=0,Ja=0,Ga;for(Ga in Ea)Aa++,Ja=Math.max(Ja,Ea[Ga].length);2>Aa&&2>Ja&&(Oa=null)}if(null==Oa)T();else{var Ua=new Image;Ua.onload=function(){try{var ab=Ua.naturalWidth,Wa=Ua.naturalHeight;if(0<ab&&0<Wa){var cb=k.ownerDocument,hb=0,wb;for(wb in Ea)hb++;var Fa=function(Fb){return null!=cb.createElementNS?cb.createElementNS(mxConstants.NS_SVG,Fb):cb.createElement(Fb)},Ra=function(){var Fb=Fa("image");Fb.setAttribute("width",ab);Fb.setAttribute("height",Wa);null==Fb.setAttributeNS?
+7)&&"https://"!=P.substring(0,8)||P.substring(0,k.baseUrl.length)==k.baseUrl||H.crossOriginImages&&H.isCorsEnabledForUrl(P)?"chrome-extension://"!=P.substring(0,19)&&(P=u.apply(this,arguments)):P=PROXY_URL+"?url="+encodeURIComponent(P));return P};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,u,H,P,U){try{var W=!0,fa=window.setTimeout(mxUtils.bind(this,function(){W=!1;u(k)}),
+this.timeout),X=mxUtils.bind(this,function(){null!=P?this.convertImageToDataUri(k,u,H,P,!0):u(k)});if(/(\.svg)$/i.test(k)&&!U)mxUtils.get(k,mxUtils.bind(this,function(oa){window.clearTimeout(fa);W&&(200>oa.getStatus()||299<oa.getStatus()?X():u(Editor.createSvgDataUri(oa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(fa);W&&X()}));else{var ea=new Image;this.crossOriginImages&&(ea.crossOrigin="anonymous");ea.onload=function(){window.clearTimeout(fa);if(W)try{P=null!=P&&U?P:1;var oa=
+document.createElement("canvas");oa.height=ea.height*P;oa.width=ea.width*P;var ka=oa.getContext("2d");ka.scale(P,P);ka.drawImage(ea,0,0);u(oa.toDataURL())}catch(ba){u(k)}};ea.onerror=function(){window.clearTimeout(fa);W&&(null!=H?H():u(k))};ea.src=k}}catch(oa){null!=H?H():u(k)}};Editor.prototype.convertImages=function(k,u,H,P){function U(){0<W.length?W.shift()():u(k)}null==P&&(P=this.createImageUrlConverter());var W=[],fa=H||{};H=mxUtils.bind(this,function(ba,sa){ba=k.getElementsByTagName(ba);for(var xa=
+0;xa<ba.length;xa++)mxUtils.bind(this,function(qa){W.push(mxUtils.bind(this,function(){try{if(null!=qa){var Ba=P.convert(qa.getAttribute(sa));if(null!=Ba&&"data:"!=Ba.substring(0,5)){var ma=fa[Ba];null==ma?this.convertImageToDataUri(Ba,function(ta){null!=ta&&(fa[Ba]=ta,qa.setAttribute(sa,ta));U()},null,Editor.svgRasterScale):(qa.setAttribute(sa,ma),U())}else null!=Ba&&qa.setAttribute(sa,Ba),U()}}catch(ta){U()}}))})(ba[xa])});var X={},ea=function(){var ba=k.getElementsByTagName("defs")[0];null==ba&&
+(ba=k.ownerDocument,ba=null!=ba.createElementNS?ba.createElementNS(mxConstants.NS_SVG,"defs"):ba.createElement("defs"),k.insertBefore(ba,k.firstChild));return ba},oa=mxUtils.bind(this,function(){for(var ba=k.getElementsByTagName("use"),sa=0;sa<ba.length;sa++)mxUtils.bind(this,function(xa){W.push(mxUtils.bind(this,function(){try{var qa=xa.getAttribute("href");null==qa&&(qa=xa.getAttribute("xlink:href"));if(null!=qa&&"#"!=qa.charAt(0)&&"data:"!=qa.substring(0,5)){var Ba=P.convert(qa),ma=function(va){va=
+Graph.createSvgImageSymbol(ea(),X,va,!0);null!=va&&(xa.setAttribute("href","#"+va),xa.setAttribute("xlink:href","#"+va));U()},ta=fa[Ba];null==ta?this.convertImageToDataUri(Ba,function(va){null!=va&&va!=Ba&&(fa[Ba]=va);ma(va)}):ma(ta)}else U()}catch(va){U()}}))})(ba[sa])}),ka=mxUtils.bind(this,function(){W.push(mxUtils.bind(this,function(){try{for(var ba=k.getElementsByTagName("image"),sa=[],xa=0;xa<ba.length;xa++)sa.push(ba[xa]);var qa={},Ba={},ma=[],ta=function(){for(var Oa=k.getElementsByTagName("use"),
+Ea=0;Ea<Oa.length;Ea++){var Aa=Oa[Ea].getAttribute("href");null==Aa&&(Aa=Oa[Ea].getAttribute("xlink:href"));null!=Aa&&null!=qa[Aa]&&(Oa[Ea].setAttribute("href","#"+qa[Aa]),Oa[Ea].setAttribute("xlink:href","#"+qa[Aa]))}},va=function(Oa,Ea){for(var Aa=null!=k.ownerDocument.createElementNS?k.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):k.ownerDocument.createElement("use"),Ja=Oa.attributes,Ha=0;Ha<Ja.length;Ha++){var Ua=Ja[Ha].name;"href"!=Ua&&"xlink:href"!=Ua&&"preserveAspectRatio"!=Ua&&Aa.setAttribute(Ua,
+Ja[Ha].value)}Aa.setAttribute("href","#"+Ea);Aa.setAttribute("xlink:href","#"+Ea);Oa.parentNode.replaceChild(Aa,Oa)};for(xa=0;xa<sa.length;xa++){var Ga=sa[xa];ba=Ga;var La=!0;if("symbol"==Ga.parentNode.nodeName)if(null==Ga.getAttribute("id")&&"mx-image-"==String(Ga.parentNode.getAttribute("id")||"").substring(0,9))ba=Ga.parentNode,La=!1;else continue;else"mx-image-"==String(Ga.getAttribute("id")||"").substring(0,9)&&(La=!1);var Ia=Ga.getAttribute("xlink:href");if(null!=Ia&&"data:"==Ia.substring(0,
+5)){var Ca=ba.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==Ia.substring(0,18)){var Pa="mx-symbol-"+mxUtils.hashCode(Ia+"|"+("none"!=Ca)),Ka=k.querySelector('[id="'+Pa+'"]');if(null!=Ka&&"symbol"==Ka.nodeName){La?va(Ga,Pa):(qa["#"+ba.getAttribute("id")]=Pa,ba.parentNode.removeChild(ba));continue}}null==Ba[Ia]&&(Ba[Ia]={},ma.push(Ia));null==Ba[Ia][Ca]&&(Ba[Ia][Ca]=[]);Ba[Ia][Ca].push({node:ba,inline:La})}}ta();var Na=function(){for(var Oa=null,Ea=null;0<ma.length&&null==Oa;){Oa=
+ma.pop();Ea=Ba[Oa];var Aa=0,Ja=0,Ha;for(Ha in Ea)Aa++,Ja=Math.max(Ja,Ea[Ha].length);2>Aa&&2>Ja&&(Oa=null)}if(null==Oa)U();else{var Ua=new Image;Ua.onload=function(){try{var ab=Ua.naturalWidth,Wa=Ua.naturalHeight;if(0<ab&&0<Wa){var cb=k.ownerDocument,hb=0,wb;for(wb in Ea)hb++;var Fa=function(Fb){return null!=cb.createElementNS?cb.createElementNS(mxConstants.NS_SVG,Fb):cb.createElement(Fb)},Ra=function(){var Fb=Fa("image");Fb.setAttribute("width",ab);Fb.setAttribute("height",Wa);null==Fb.setAttributeNS?
Fb.setAttribute("xlink:href",Oa):Fb.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Oa);return Fb},$a=null;if(1<hb){for($a="mx-data-"+mxUtils.hashCode(Oa);null!=k.querySelector('[id="'+$a+'"]');)$a+="-1";var fb=Ra();fb.setAttribute("id",$a);ea().appendChild(fb)}for(wb in Ea){var rb=Ea[wb];hb=null;for(fb=0;fb<rb.length&&null==hb;fb++)rb[fb].inline||(hb=rb[fb].node.getAttribute("id"));if(null==hb)for(hb="mx-image-"+mxUtils.hashCode(Oa+"|"+wb);null!=k.querySelector('[id="'+hb+'"]');)hb+="-1";var mb=
Fa("symbol");mb.setAttribute("id",hb);mb.setAttribute("viewBox","0 0 "+ab+" "+Wa);""!=wb&&mb.setAttribute("preserveAspectRatio",wb);if(null!=$a){var ub=Fa("use");ub.setAttribute("href","#"+$a);ub.setAttribute("xlink:href","#"+$a);mb.appendChild(ub)}else mb.appendChild(Ra());ea().appendChild(mb);for(fb=0;fb<rb.length;fb++){var Eb=rb[fb].node;rb[fb].inline?va(Eb,hb):(Eb.getAttribute("id")!=hb&&(qa["#"+Eb.getAttribute("id")]=hb),Eb.parentNode.removeChild(Eb))}}ta()}}catch(Fb){}Na()};Ua.onerror=function(){Na()};
-Ua.src=Oa}};Na()}catch(Oa){T()}}))});H("image","xlink:href");H("img","src");oa();la();T()};Editor.base64Encode=function(k){for(var u="",H=0,P=k.length,T,W,fa;H<P;){T=k.charCodeAt(H++)&255;if(H==P){u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&3)<<4);u+="==";break}W=k.charCodeAt(H++);if(H==P){u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&
-3)<<4|(W&240)>>4);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2);u+="=";break}fa=k.charCodeAt(H++);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&3)<<4|(W&240)>>4);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2|(fa&192)>>6);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(fa&
-63)}return u};Editor.prototype.loadUrl=function(k,u,H,P,T,W,fa,X){try{var ea=!fa&&(P||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));T=null!=T?T:!0;var oa=mxUtils.bind(this,function(){mxUtils.get(k,mxUtils.bind(this,function(la){200<=la.getStatus()&&299>=la.getStatus()?null!=u&&(la=la.getText(),ea&&(W=null!=W?W:"data:image/png;base64,",la=W+Editor.base64Encode(la)),u(la)):null!=H&&(0==la.getStatus()?H({message:mxResources.get("accessDenied")},
-la):404==la.getStatus()?H({message:mxResources.get("fileNotFound"),code:la.getStatus()},la):H({message:this.getErrorMessage(la)},la))}),function(la){null!=H&&H({message:mxResources.get("error")+" "+la.getStatus()})},ea,this.timeout,function(){T&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:oa})},X)});oa()}catch(la){null!=H&&H(la)}};Editor.prototype.getErrorMessage=function(k){var u=mxResources.get("error")+" "+k.getStatus();try{var H=k.getText(),P=JSON.parse(H);null!=P&&null!=P.error&&null!=P.error.message&&
-(u=P.error.message+" ("+u+")")}catch(T){}return u};Editor.prototype.absoluteCssFonts=function(k){var u=null;if(null!=k){var H=k.split("url(");if(0<H.length){u=[H[0]];k=window.location.pathname;var P=null!=k?k.lastIndexOf("/"):-1;0<=P&&(k=k.substring(0,P+1));P=document.getElementsByTagName("base");var T=null;null!=P&&0<P.length&&(T=P[0].getAttribute("href"));for(var W=1;W<H.length;W++)if(P=H[W].indexOf(")"),0<P){var fa=Editor.trimCssUrl(H[W].substring(0,P));this.graph.isRelativeUrl(fa)&&(fa=null!=
-T?T+fa:window.location.protocol+"//"+window.location.hostname+("/"==fa.charAt(0)?"":k)+fa);u.push('url("'+fa+'"'+H[W].substring(P))}else u.push(H[W])}else u=[k]}return null!=u?u.join(""):null};Editor.prototype.mapFontUrl=function(k,u,H){/^https?:\/\//.test(u)&&!this.isCorsEnabledForUrl(u)&&(u=PROXY_URL+"?url="+encodeURIComponent(u));H(k,u)};Editor.prototype.embedCssFonts=function(k,u){var H=k.split("url("),P=0;null==this.cachedFonts&&(this.cachedFonts=Object.create(null));var T=mxUtils.bind(this,
-function(){if(0==P){for(var ea=[H[0]],oa=1;oa<H.length;oa++){var la=H[oa].indexOf(")");ea.push('url("');ea.push(this.cachedFonts[Editor.trimCssUrl(H[oa].substring(0,la))]);ea.push('"'+H[oa].substring(la))}u(ea.join(""))}});if(0<H.length){for(k=1;k<H.length;k++){var W=H[k].indexOf(")"),fa=null,X=H[k].indexOf("format(",W);0<X&&(fa=Editor.trimCssUrl(H[k].substring(X+7,H[k].indexOf(")",X))));mxUtils.bind(this,function(ea){var oa=this.cachedFonts[ea];if(null==oa){var la=[];this.cachedFonts[ea]=la;P++;
-oa="application/x-font-ttf";if("svg"==fa||/(\.svg)($|\?)/i.test(ea))oa="image/svg+xml";else if("otf"==fa||"embedded-opentype"==fa||/(\.otf)($|\?)/i.test(ea))oa="application/x-font-opentype";else if("woff"==fa||/(\.woff)($|\?)/i.test(ea))oa="application/font-woff";else if("woff2"==fa||/(\.woff2)($|\?)/i.test(ea))oa="application/font-woff2";else if("eot"==fa||/(\.eot)($|\?)/i.test(ea))oa="application/vnd.ms-fontobject";else if("sfnt"==fa||/(\.sfnt)($|\?)/i.test(ea))oa="application/font-sfnt";var ca=
-mxUtils.bind(this,function(sa){this.cachedFonts[ea]=sa;P--;T();for(sa=0;sa<la.length;sa++)la[sa]()});this.mapFontUrl(oa,ea,mxUtils.bind(this,function(sa,xa){this.loadUrl(xa,function(qa){ca(qa)},function(qa){ca(ea)},!0,null,"data:"+sa+";charset=utf-8;base64,")}))}else"string"!=typeof oa&&(P++,oa.push(function(){P--;T()}))})(Editor.trimCssUrl(H[k].substring(0,W)),fa)}T()}else u(k)};Editor.prototype.loadFonts=function(k){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,
-mxUtils.bind(this,function(u){this.resolvedFontCss=u;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=function(){var k={},u;for(u in Graph.fontMapping)Graph.isCssFontUrl(u)&&(k[u]=Graph.fontMapping[u]);return k};Editor.prototype.embedExtFonts=function(k,u){u=this.graph.getCustomFonts(u);if(0<u.length){var H=[],P=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var T=mxUtils.bind(this,function(){0==P&&this.embedCssFonts(H.join(""),k)}),W=
-0;W<u.length;W++)mxUtils.bind(this,function(fa,X){Graph.isCssFontUrl(X)?null==this.cachedGoogleFonts[X]?(P++,this.loadUrl(Graph.rewriteGoogleFontUrl(X),mxUtils.bind(this,function(ea){this.cachedGoogleFonts[X]=ea;H.push(ea+"\n");P--;T()}),mxUtils.bind(this,function(ea){P--;H.push('@import url("'+Graph.escapeCssString(X)+'");\n');T()}))):H.push(this.cachedGoogleFonts[X]+"\n"):H.push('@font-face {font-family: "'+Graph.escapeCssString(fa)+'";src: url("'+Graph.escapeCssString(X)+'")}\n')})(u[W].name,u[W].url);
-T()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var u=document.getElementsByTagName("style"),H=0;H<u.length;H++){var P=mxUtils.getTextContent(u[H]);0>P.indexOf("mxPageSelector")&&0<P.indexOf("MathJax")&&k[0].appendChild(u[H].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,u){u=null!=u?u:this.absoluteCssFonts(this.fontCss);if(null!=u){var H=mxUtils.getSvgDefs(k),P=u.split("\n");u=[];for(var T=[],W=0;W<P.length;W++)"@import"==
-P[W].substring(0,7)?u.push(P[W]):T.push(P[W]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");k.setAttribute("type","text/css");0<u.length&&(mxUtils.setTextContent(k,u.join("\n")),H.appendChild(k));0<T.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,T.join("\n")),H.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,
-u,H){var P=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(P/k,P/u))};Editor.prototype.exportToCanvas=function(k,u,H,P,T,W,fa,X,ea,oa,la,ca,sa,xa,qa,Ba,ma,ta){try{W=null!=W?W:!0;fa=null!=fa?fa:!0;ca=null!=ca?ca:this.graph;sa=null!=sa?sa:0;var va=ea?null:ca.background;va==mxConstants.NONE&&(va=null);null==va&&(va=P);null==va&&0==ea&&(va=Editor.getDefaultPageBackgroundColor());this.convertImages(ca.getSvg(null,null,sa,xa,null,fa,null,null,null,oa,null,Ba,ma,ta),mxUtils.bind(this,function(Ha){try{Ha.style.setProperty("-webkit-font-smoothing",
-"antialiased");Ha.style.setProperty("-moz-osx-font-smoothing","grayscale");var La=new Image;La.onload=mxUtils.bind(this,function(){try{var Ca=function(){mxClient.IS_SF?window.setTimeout(function(){Oa.drawImage(La,0,0);k(Pa,Ha)},0):(Oa.drawImage(La,0,0),k(Pa,Ha))},Pa=document.createElement("canvas"),Ka=parseInt(Ha.getAttribute("width")),Na=parseInt(Ha.getAttribute("height"));X=null!=X?X:1;null!=u&&(X=W?Math.min(1,Math.min(3*u/(4*Na),u/Ka)):u/Ka);X=this.getMaxCanvasScale(Ka,Na,X);Ka=Math.ceil(X*Ka);
-Na=Math.ceil(X*Na);Pa.setAttribute("width",Ka);Pa.setAttribute("height",Na);var Oa=Pa.getContext("2d");if(null!=va){var Ea=mxUtils.getLightDarkColor(va);Oa.beginPath();Oa.rect(0,0,Ka,Na);Oa.fillStyle="dark"==Ba&&"none"!=ca.getAdaptiveColors()?Ea.dark:Ea.light;Oa.fill()}1!=X&&Oa.scale(X,X);if(qa){var Aa=ca.view,Ja=Aa.scale;Aa.scale=1;var Ga=btoa(unescape(encodeURIComponent(Aa.createSvgGrid(Aa.gridColor))));Aa.scale=Ja;Ga="data:image/svg+xml;base64,"+Ga;var Ua=ca.gridSize*Aa.gridSteps*X,ab=ca.getGraphBounds(),
-Wa=Aa.translate.x*Ja,cb=Aa.translate.y*Ja,hb=Wa+(ab.x-Wa)/Ja-sa,wb=cb+(ab.y-cb)/Ja-sa,Fa=new Image;Fa.onload=function(){try{for(var Ra=-Math.round(Ua-mxUtils.mod((Wa-hb)*X,Ua)),$a=-Math.round(Ua-mxUtils.mod((cb-wb)*X,Ua));Ra<Ka;Ra+=Ua)for(var fb=$a;fb<Na;fb+=Ua)Oa.drawImage(Fa,Ra/X,fb/X);Ca()}catch(rb){null!=T&&T(rb)}};Fa.onerror=function(Ra){null!=T&&T(Ra)};Fa.src=Ga}else Ca()}catch(Ra){null!=T&&T(Ra)}});La.onerror=function(Ca){null!=T&&T(Ca)};oa&&this.graph.addSvgShadow(Ha);this.graph.mathEnabled&&
-this.addMathCss(Ha);var Ia=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ha,this.resolvedFontCss),La.src=Editor.createSvgDataUri(mxUtils.getXml(Ha))}catch(Ca){null!=T&&T(Ca)}});this.embedExtFonts(mxUtils.bind(this,function(Ca){try{null!=Ca&&this.addFontCss(Ha,Ca),this.loadFonts(Ia)}catch(Pa){null!=T&&T(Pa)}}))}catch(Ca){null!=T&&T(Ca)}}),H,la)}catch(Ha){null!=T&&T(Ha)}};Editor.crcTable=[];for(var n=0;256>n;n++)for(var y=n,C=0;8>C;C++)y=1==(y&1)?3988292384^y>>>1:y>>>
-1,Editor.crcTable[n]=y;Editor.updateCRC=function(k,u,H,P){for(var T=0;T<P;T++)k=Editor.crcTable[(k^u.charCodeAt(H+T))&255]^k>>>8;return k};Editor.crc32=function(k){for(var u=-1,H=0;H<k.length;H++)u=u>>>8^Editor.crcTable[(u^k.charCodeAt(H))&255];return(u^-1)>>>0};Editor.writeGraphModelToPng=function(k,u,H,P,T){function W(la,ca){var sa=ea;ea+=ca;return la.substring(sa,ea)}function fa(la){la=W(la,4);return la.charCodeAt(3)+(la.charCodeAt(2)<<8)+(la.charCodeAt(1)<<16)+(la.charCodeAt(0)<<24)}function X(la){return String.fromCharCode(la>>
-24&255,la>>16&255,la>>8&255,la&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var ea=0;if(W(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=T&&T();else if(W(k,4),"IHDR"!=W(k,4))null!=T&&T();else{W(k,17);T=k.substring(0,ea);do{var oa=fa(k);if("IDAT"==W(k,4)){T=k.substring(0,ea-8);"pHYs"==u&&"dpi"==H?(H=Math.round(P/.0254),H=X(H)+X(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==u?String.fromCharCode(0):"")+P;P=4294967295;P=
-Editor.updateCRC(P,u,0,4);P=Editor.updateCRC(P,H,0,H.length);T+=X(H.length)+u+H+X(P^4294967295);T+=k.substring(ea-8,k.length);break}T+=k.substring(ea-8,ea-4+oa);W(k,oa);W(k,4)}while(oa);return"data:image/png;base64,"+(window.btoa?btoa(T):Base64.encode(T,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var O=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,u){O.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
+Ua.src=Oa}};Na()}catch(Oa){U()}}))});H("image","xlink:href");H("img","src");oa();ka();U()};Editor.base64Encode=function(k){for(var u="",H=0,P=k.length,U,W,fa;H<P;){U=k.charCodeAt(H++)&255;if(H==P){u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((U&3)<<4);u+="==";break}W=k.charCodeAt(H++);if(H==P){u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((U&
+3)<<4|(W&240)>>4);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2);u+="=";break}fa=k.charCodeAt(H++);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((U&3)<<4|(W&240)>>4);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2|(fa&192)>>6);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(fa&
+63)}return u};Editor.prototype.loadUrl=function(k,u,H,P,U,W,fa,X){try{var ea=!fa&&(P||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));U=null!=U?U:!0;var oa=mxUtils.bind(this,function(){mxUtils.get(k,mxUtils.bind(this,function(ka){200<=ka.getStatus()&&299>=ka.getStatus()?null!=u&&(ka=ka.getText(),ea&&(W=null!=W?W:"data:image/png;base64,",ka=W+Editor.base64Encode(ka)),u(ka)):null!=H&&(0==ka.getStatus()?H({message:mxResources.get("accessDenied")},
+ka):404==ka.getStatus()?H({message:mxResources.get("fileNotFound"),code:ka.getStatus()},ka):H({message:this.getErrorMessage(ka)},ka))}),function(ka){null!=H&&H({message:mxResources.get("error")+" "+ka.getStatus()})},ea,this.timeout,function(){U&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:oa})},X)});oa()}catch(ka){null!=H&&H(ka)}};Editor.prototype.getErrorMessage=function(k){var u=mxResources.get("error")+" "+k.getStatus();try{var H=k.getText(),P=JSON.parse(H);null!=P&&null!=P.error&&null!=P.error.message&&
+(u=P.error.message+" ("+u+")")}catch(U){}return u};Editor.prototype.absoluteCssFonts=function(k){var u=null;if(null!=k){var H=k.split("url(");if(0<H.length){u=[H[0]];k=window.location.pathname;var P=null!=k?k.lastIndexOf("/"):-1;0<=P&&(k=k.substring(0,P+1));P=document.getElementsByTagName("base");var U=null;null!=P&&0<P.length&&(U=P[0].getAttribute("href"));for(var W=1;W<H.length;W++)if(P=H[W].indexOf(")"),0<P){var fa=Editor.trimCssUrl(H[W].substring(0,P));this.graph.isRelativeUrl(fa)&&(fa=null!=
+U?U+fa:window.location.protocol+"//"+window.location.hostname+("/"==fa.charAt(0)?"":k)+fa);u.push('url("'+fa+'"'+H[W].substring(P))}else u.push(H[W])}else u=[k]}return null!=u?u.join(""):null};Editor.prototype.mapFontUrl=function(k,u,H){/^https?:\/\//.test(u)&&!this.isCorsEnabledForUrl(u)&&(u=PROXY_URL+"?url="+encodeURIComponent(u));H(k,u)};Editor.prototype.embedCssFonts=function(k,u){var H=k.split("url("),P=0;null==this.cachedFonts&&(this.cachedFonts=Object.create(null));var U=mxUtils.bind(this,
+function(){if(0==P){for(var ea=[H[0]],oa=1;oa<H.length;oa++){var ka=H[oa].indexOf(")");ea.push('url("');ea.push(this.cachedFonts[Editor.trimCssUrl(H[oa].substring(0,ka))]);ea.push('"'+H[oa].substring(ka))}u(ea.join(""))}});if(0<H.length){for(k=1;k<H.length;k++){var W=H[k].indexOf(")"),fa=null,X=H[k].indexOf("format(",W);0<X&&(fa=Editor.trimCssUrl(H[k].substring(X+7,H[k].indexOf(")",X))));mxUtils.bind(this,function(ea){var oa=this.cachedFonts[ea];if(null==oa){var ka=[];this.cachedFonts[ea]=ka;P++;
+oa="application/x-font-ttf";if("svg"==fa||/(\.svg)($|\?)/i.test(ea))oa="image/svg+xml";else if("otf"==fa||"embedded-opentype"==fa||/(\.otf)($|\?)/i.test(ea))oa="application/x-font-opentype";else if("woff"==fa||/(\.woff)($|\?)/i.test(ea))oa="application/font-woff";else if("woff2"==fa||/(\.woff2)($|\?)/i.test(ea))oa="application/font-woff2";else if("eot"==fa||/(\.eot)($|\?)/i.test(ea))oa="application/vnd.ms-fontobject";else if("sfnt"==fa||/(\.sfnt)($|\?)/i.test(ea))oa="application/font-sfnt";var ba=
+mxUtils.bind(this,function(sa){this.cachedFonts[ea]=sa;P--;U();for(sa=0;sa<ka.length;sa++)ka[sa]()});this.mapFontUrl(oa,ea,mxUtils.bind(this,function(sa,xa){this.loadUrl(xa,function(qa){ba(qa)},function(qa){ba(ea)},!0,null,"data:"+sa+";charset=utf-8;base64,")}))}else"string"!=typeof oa&&(P++,oa.push(function(){P--;U()}))})(Editor.trimCssUrl(H[k].substring(0,W)),fa)}U()}else u(k)};Editor.prototype.loadFonts=function(k){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,
+mxUtils.bind(this,function(u){this.resolvedFontCss=u;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=function(){var k={},u;for(u in Graph.fontMapping)Graph.isCssFontUrl(u)&&(k[u]=Graph.fontMapping[u]);return k};Editor.prototype.embedExtFonts=function(k,u){u=this.graph.getCustomFonts(u);if(0<u.length){var H=[],P=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var U=mxUtils.bind(this,function(){0==P&&this.embedCssFonts(H.join(""),k)}),W=
+0;W<u.length;W++)mxUtils.bind(this,function(fa,X){Graph.isCssFontUrl(X)?null==this.cachedGoogleFonts[X]?(P++,this.loadUrl(Graph.rewriteGoogleFontUrl(X),mxUtils.bind(this,function(ea){this.cachedGoogleFonts[X]=ea;H.push(ea+"\n");P--;U()}),mxUtils.bind(this,function(ea){P--;H.push('@import url("'+Graph.escapeCssString(X)+'");\n');U()}))):H.push(this.cachedGoogleFonts[X]+"\n"):H.push('@font-face {font-family: "'+Graph.escapeCssString(fa)+'";src: url("'+Graph.escapeCssString(X)+'")}\n')})(u[W].name,u[W].url);
+U()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var u=document.getElementsByTagName("style"),H=0;H<u.length;H++){var P=mxUtils.getTextContent(u[H]);0>P.indexOf("mxPageSelector")&&0<P.indexOf("MathJax")&&k[0].appendChild(u[H].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,u){u=null!=u?u:this.absoluteCssFonts(this.fontCss);if(null!=u){var H=mxUtils.getSvgDefs(k),P=u.split("\n");u=[];for(var U=[],W=0;W<P.length;W++)"@import"==
+P[W].substring(0,7)?u.push(P[W]):U.push(P[W]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");k.setAttribute("type","text/css");0<u.length&&(mxUtils.setTextContent(k,u.join("\n")),H.appendChild(k));0<U.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,U.join("\n")),H.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,
+u,H){var P=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(P/k,P/u))};Editor.prototype.exportToCanvas=function(k,u,H,P,U,W,fa,X,ea,oa,ka,ba,sa,xa,qa,Ba,ma,ta){try{W=null!=W?W:!0;fa=null!=fa?fa:!0;ba=null!=ba?ba:this.graph;sa=null!=sa?sa:0;var va=ea?null:ba.background;va==mxConstants.NONE&&(va=null);null==va&&(va=P);null==va&&0==ea&&(va=Editor.getDefaultPageBackgroundColor());this.convertImages(ba.getSvg(null,null,sa,xa,null,fa,null,null,null,oa,null,Ba,ma,ta),mxUtils.bind(this,function(Ga){try{Ga.style.setProperty("-webkit-font-smoothing",
+"antialiased");Ga.style.setProperty("-moz-osx-font-smoothing","grayscale");var La=new Image;La.onload=mxUtils.bind(this,function(){try{var Ca=function(){mxClient.IS_SF?window.setTimeout(function(){Oa.drawImage(La,0,0);k(Pa,Ga)},0):(Oa.drawImage(La,0,0),k(Pa,Ga))},Pa=document.createElement("canvas"),Ka=parseInt(Ga.getAttribute("width")),Na=parseInt(Ga.getAttribute("height"));X=null!=X?X:1;null!=u&&(X=W?Math.min(1,Math.min(3*u/(4*Na),u/Ka)):u/Ka);X=this.getMaxCanvasScale(Ka,Na,X);Ka=Math.ceil(X*Ka);
+Na=Math.ceil(X*Na);Pa.setAttribute("width",Ka);Pa.setAttribute("height",Na);var Oa=Pa.getContext("2d");if(null!=va){var Ea=mxUtils.getLightDarkColor(va);Oa.beginPath();Oa.rect(0,0,Ka,Na);Oa.fillStyle="dark"==Ba&&"none"!=ba.getAdaptiveColors()?Ea.dark:Ea.light;Oa.fill()}1!=X&&Oa.scale(X,X);if(qa){var Aa=ba.view,Ja=Aa.scale;Aa.scale=1;var Ha=btoa(unescape(encodeURIComponent(Aa.createSvgGrid(Aa.gridColor))));Aa.scale=Ja;Ha="data:image/svg+xml;base64,"+Ha;var Ua=ba.gridSize*Aa.gridSteps*X,ab=ba.getGraphBounds(),
+Wa=Aa.translate.x*Ja,cb=Aa.translate.y*Ja,hb=Wa+(ab.x-Wa)/Ja-sa,wb=cb+(ab.y-cb)/Ja-sa,Fa=new Image;Fa.onload=function(){try{for(var Ra=-Math.round(Ua-mxUtils.mod((Wa-hb)*X,Ua)),$a=-Math.round(Ua-mxUtils.mod((cb-wb)*X,Ua));Ra<Ka;Ra+=Ua)for(var fb=$a;fb<Na;fb+=Ua)Oa.drawImage(Fa,Ra/X,fb/X);Ca()}catch(rb){null!=U&&U(rb)}};Fa.onerror=function(Ra){null!=U&&U(Ra)};Fa.src=Ha}else Ca()}catch(Ra){null!=U&&U(Ra)}});La.onerror=function(Ca){null!=U&&U(Ca)};oa&&this.graph.addSvgShadow(Ga);this.graph.mathEnabled&&
+this.addMathCss(Ga);var Ia=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ga,this.resolvedFontCss),La.src=Editor.createSvgDataUri(mxUtils.getXml(Ga))}catch(Ca){null!=U&&U(Ca)}});this.embedExtFonts(mxUtils.bind(this,function(Ca){try{null!=Ca&&this.addFontCss(Ga,Ca),this.loadFonts(Ia)}catch(Pa){null!=U&&U(Pa)}}))}catch(Ca){null!=U&&U(Ca)}}),H,ka)}catch(Ga){null!=U&&U(Ga)}};Editor.crcTable=[];for(var n=0;256>n;n++)for(var y=n,C=0;8>C;C++)y=1==(y&1)?3988292384^y>>>1:y>>>
+1,Editor.crcTable[n]=y;Editor.updateCRC=function(k,u,H,P){for(var U=0;U<P;U++)k=Editor.crcTable[(k^u.charCodeAt(H+U))&255]^k>>>8;return k};Editor.crc32=function(k){for(var u=-1,H=0;H<k.length;H++)u=u>>>8^Editor.crcTable[(u^k.charCodeAt(H))&255];return(u^-1)>>>0};Editor.writeGraphModelToPng=function(k,u,H,P,U){function W(ka,ba){var sa=ea;ea+=ba;return ka.substring(sa,ea)}function fa(ka){ka=W(ka,4);return ka.charCodeAt(3)+(ka.charCodeAt(2)<<8)+(ka.charCodeAt(1)<<16)+(ka.charCodeAt(0)<<24)}function X(ka){return String.fromCharCode(ka>>
+24&255,ka>>16&255,ka>>8&255,ka&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var ea=0;if(W(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=U&&U();else if(W(k,4),"IHDR"!=W(k,4))null!=U&&U();else{W(k,17);U=k.substring(0,ea);do{var oa=fa(k);if("IDAT"==W(k,4)){U=k.substring(0,ea-8);"pHYs"==u&&"dpi"==H?(H=Math.round(P/.0254),H=X(H)+X(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==u?String.fromCharCode(0):"")+P;P=4294967295;P=
+Editor.updateCRC(P,u,0,4);P=Editor.updateCRC(P,H,0,H.length);U+=X(H.length)+u+H+X(P^4294967295);U+=k.substring(ea-8,k.length);break}U+=k.substring(ea-8,ea-4+oa);W(k,oa);W(k,4)}while(oa);return"data:image/png;base64,"+(window.btoa?btoa(U):Base64.encode(U,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var O=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,u){O.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
mxSettings.save()};var F=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){F.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(k,u,H){var P=null;if(null!=H)return null;null!=k.editor.graph.getModel().getParent(u)?P=u.getId():null!=k.currentPage&&(P=k.currentPage.getId());return P});if(null!=window.StyleFormatPanel){var N=Format.prototype.init;Format.prototype.init=
function(){N.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var R=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?R.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=
function(k){k=c.apply(this,arguments);var u=this.editorUi,H=u.editor.graph;if(H.isEnabled()){var P=u.getCurrentFile();null!=P&&P.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return u.editor.autosave},function(W){u.editor.setAutosave(W);u.editor.autosave&&P.isModified()&&P.fileChanged()},{install:function(W){this.listener=function(){W(u.editor.autosave)};u.editor.addListener("autosaveChanged",this.listener)},destroy:function(){u.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&
-H.isEnabled()&&"undefined"!==typeof MathJax){var T=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(W){u.actions.get("mathematicalTypesetting").funct()},{install:function(W){this.listener=function(){W(H.mathEnabled)};u.addListener("mathEnabledChanged",this.listener)},destroy:function(){u.removeListener(this.listener)}});k.appendChild(T);(!u.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&T.appendChild(u.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};
+H.isEnabled()&&"undefined"!==typeof MathJax){var U=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(W){u.actions.get("mathematicalTypesetting").funct()},{install:function(W){this.listener=function(){W(H.mathEnabled)};u.addListener("mathEnabledChanged",this.listener)},destroy:function(){u.removeListener(this.listener)}});k.appendChild(U);(!u.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&U.appendChild(u.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};
mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(k,u){return 0<mxUtils.getValue(k.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=
[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(k,u){return 0<mxUtils.getValue(k.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=
[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",
@@ -3983,163 +3983,165 @@ font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2"
{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",
gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",
stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),
-k.customProperties,k))};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var u=this.editorUi.getSelectionState();1==u.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=u.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);l.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(k,u,H,P){function T(Oa,Ea,Aa,Ja,Ga){if(null!=Aa.valueChanged)Aa.valueChanged(Ea,Ga,H,ca);
-else{sa.getModel().beginUpdate();try{Ga=[];var Ua=[];if(null!=Aa.index){for(var ab=[],Wa=Aa.parentRow.nextSibling;Wa&&Wa.getAttribute("data-pName")==Oa;)ab.push(Wa.getAttribute("data-pValue")),Wa=Wa.nextSibling;Aa.index<ab.length?null!=Ja?ab.splice(Ja,1):ab[Aa.index]=Ea:ab.push(Ea);null!=Aa.size&&ab.length>Aa.size&&(ab=ab.slice(0,Aa.size));Ea=ab.join(",");null!=Aa.countProperty&&(sa.setCellStyles(Aa.countProperty,ab.length,sa.getSelectionCells()),Ga.push(Aa.countProperty),Ua.push(ab.length))}sa.setCellStyles(Oa,
-Ea,sa.getSelectionCells());Ga.push(Oa);Ua.push(Ea);if(null!=Aa.dependentProps)for(Oa=0;Oa<Aa.dependentProps.length;Oa++){var cb=Aa.dependentPropsDefVal[Oa],hb=Aa.dependentPropsVals[Oa];if(hb.length>Ea)hb=hb.slice(0,Ea);else for(var wb=hb.length;wb<Ea;wb++)hb.push(cb);hb=hb.join(",");sa.setCellStyles(Aa.dependentProps[Oa],hb,sa.getSelectionCells());Ga.push(Aa.dependentProps[Oa]);Ua.push(hb)}if("function"==typeof Aa.onChange)Aa.onChange(sa,Ea);ca.editorUi.fireEvent(new mxEventObject("styleChanged",
-"keys",Ga,"values",Ua,"cells",sa.getSelectionCells()))}finally{sa.getModel().endUpdate()}}}function W(Oa,Ea){Ea.style.left="0px";Ea.style.top="0px";Ea.style.position="relative";Ea.style.right="0px";Ea.style.bottom="0px";Ea.style.width="100%";Ea.style.maxWidth="100%";Ea.style.maxHeight="100%";Ea.style.textAlign="left"}function fa(Oa,Ea,Aa){function Ja(Ua){if(null==Ua||Ua==mxConstants.NONE)Ga.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==Ua)Ga.style.background="";else{var ab=
-mxUtils.getLightDarkColor(Ua);mxUtils.isLightDarkColor(Ua)&&ab.light!=ab.dark?Ga.style.background="linear-gradient(to right bottom, "+ab.cssText+" 50%, "+mxUtils.invertLightDarkColor(ab).cssText+" 50.3%)":Ga.style.background=Ua}}var Ga=document.createElement("div");Ga.style.width="32px";Ga.style.height="8px";Ga.style.margin="2px";Ga.style.borderStyle="solid";Ga.style.borderWidth="1px";Ja(Ea);btn=mxUtils.button("",mxUtils.bind(ca,function(Ua){this.editorUi.pickColor(Ea,function(ab){T(Oa,ab,Aa);Ja(ab)});
-mxEvent.consume(Ua)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Ga);return btn}function X(Oa,Ea,Aa,Ja,Ga,Ua,ab){null!=Ea&&(Ea=Ea.split(","),xa.push({name:Oa,values:Ea,type:Aa,defVal:Ja,countProperty:Ga,parentRow:Ua,isDeletable:!0,flipBkg:ab}));btn=mxUtils.button("+",mxUtils.bind(ca,function(Wa){for(var cb=Ua,hb=0;null!=cb.nextSibling;)if(cb.nextSibling.getAttribute("data-pName")==Oa)cb=cb.nextSibling,
-hb++;else break;var wb={type:Aa,parentRow:Ua,index:hb,isDeletable:!0,defVal:Ja,countProperty:Ga};hb=la(Oa,"",wb,0==hb%2,ab);T(Oa,Ja,wb);cb.parentNode.insertBefore(hb,cb.nextSibling);mxEvent.consume(Wa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ea(Oa,Ea,Aa,Ja,Ga,Ua,ab){if(0<Ga){var Wa=Array(Ga);Ea=null!=Ea?Ea.split(","):[];for(var cb=0;cb<Ga;cb++)Wa[cb]=null!=Ea[cb]?Ea[cb]:null!=Ja?Ja:"";xa.push({name:Oa,values:Wa,type:Aa,defVal:Ja,parentRow:Ua,
-flipBkg:ab,size:Ga})}return document.createElement("div")}function oa(Oa,Ea,Aa){var Ja=document.createElement("input");Ja.type="checkbox";Ja.checked="1"==Ea;mxEvent.addListener(Ja,"change",function(){T(Oa,Ja.checked?"1":"0",Aa,null,Ja)});return Ja}function la(Oa,Ea,Aa,Ja,Ga){var Ua=Aa.dispName,ab=Aa.type,Wa=document.createElement("tr");Wa.className="gePropRow"+(Ga?"Dark":"")+(Ja?"Alt":"")+" gePropNonHeaderRow";Wa.setAttribute("data-pName",Oa);Wa.setAttribute("data-pValue",Ea);Ja=!1;null!=Aa.index&&
-(Wa.setAttribute("data-index",Aa.index),Ua=(null!=Ua?Ua:"")+"["+Aa.index+"]",Ja=!0);var cb=document.createElement("td");cb.className="gePropRowCell";Ua=mxResources.get(Ua,null,Ua);mxUtils.write(cb,Ua);cb.setAttribute("title",Ua);Ja&&(cb.style.textAlign="right");Wa.appendChild(cb);cb=document.createElement("td");cb.className="gePropRowCell";cb.setAttribute("title",null!=Ea?mxUtils.safeDecodeURIComponent(Ea):mxResources.get("none"));mxEvent.addListener(cb,"click",mxUtils.bind(ca,function(Ra){!mxUtils.isAncestorNode(Wa,
-document.activeElement)&&mxUtils.isAncestorNode(Wa.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(Ra))}));if("color"==ab)cb.appendChild(fa(Oa,Ea,Aa));else if("bool"==ab||"boolean"==ab)cb.appendChild(oa(Oa,Ea,Aa));else if("enum"==ab){var hb=Aa.enumList;cb.innerHTML="";var wb=document.createElement("div");wb.className="gePropValue";cb.appendChild(wb);for(Ga=0;Ga<hb.length;Ga++)if(Ua=hb[Ga],Ua.val==Ea){mxUtils.write(wb,
-mxResources.get(Ua.dispName,null,Ua.dispName));break}mxEvent.addListener(cb,"click",mxUtils.bind(ca,function(Ra){var $a=mxEvent.getSource(Ra);if(!($a!=cb&&$a!=wb||mxEvent.isConsumed(Ra))){wb.innerHTML="";var fb=document.createElement("select"),rb=null;W(cb,fb);fb.style.boxSizing="border-box";fb.style.height="100%";fb.style.padding="0";fb.style.margin="0";fb.style.border="0";for(Ra=0;Ra<hb.length;Ra++){$a=hb[Ra];var mb=document.createElement("option");mb.value=mxUtils.htmlEntities($a.val);mxUtils.write(mb,
-mxResources.get($a.dispName,null,$a.dispName));fb.appendChild(mb);null==$a.val&&(mb.value="null",rb=mb)}fb.value=null==Ea&&null!=rb?"null":Ea;wb.appendChild(fb);mxEvent.addListener(fb,"change",function(){var ub=mxUtils.htmlEntities(fb.value);if(fb[fb.selectedIndex]==rb||"null"==ub.value)ub=null;T(Oa,ub,Aa)});fb.focus();mxEvent.addListener(fb,"blur",function(){wb.innerHTML="";for(var ub=fb[fb.selectedIndex]==rb||"null"==fb.value?null:fb.value,Eb=0;Eb<hb.length;Eb++){var Fb=hb[Eb];if(Fb.val==ub){mxUtils.write(wb,
-mxResources.get(Fb.dispName,null,Fb.dispName));break}}})}}))}else if("dynamicArr"==ab)cb.appendChild(X(Oa,Ea,Aa.subType,Aa.subDefVal,Aa.countProperty,Wa,Ga));else if("staticArr"==ab)cb.appendChild(ea(Oa,Ea,Aa.subType,Aa.subDefVal,Aa.size,Wa,Ga));else if("readOnly"==ab)Ga=document.createElement("input"),Ga.setAttribute("readonly",""),Ga.value=Ea,Ga.style.borderWidth="0px","id"==Oa||"shape"==Oa?(Wa.firstChild.innerHTML="",Wa.firstChild.setAttribute("colspan","2"),Ga.style.flexGrow="1",Ga.style.marginLeft=
-"4px",Ga.style.textAlign="id"==Oa?"center":"left",Ga.setAttribute("title",Ea),Ua=document.createElement("div"),mxUtils.write(Ua,mxResources.get(Oa)+":"),Ua.style.display="inline-flex",Ua.style.alignItems="center",Ua.style.width="100%",Ua.appendChild(Ga),Wa.firstChild.appendChild(Ua)):(Ga.style.width="96px",cb.appendChild(Ga));else{cb.innerHTML="";var Fa=document.createElement("div");Fa.className="gePropValue";cb.appendChild(Fa);Fa.innerHTML=mxUtils.htmlEntities(mxUtils.safeDecodeURIComponent(Ea));
-mxEvent.addListener(cb,"click",mxUtils.bind(ca,function(Ra){function $a(){var mb=rb.value,ub=ab;mb=0==mb.trim().length&&"string"!=ub&&"numbers"!=ub?Aa.allowAuto?"auto":0:mb;Aa.allowAuto&&(null!=mb.trim&&"auto"==mb.trim().toLowerCase()?(mb="auto",ub="string"):(mb=parseFloat(mb),mb=isNaN(mb)?0:mb));null!=Aa.min&&mb<Aa.min?mb=Aa.min:null!=Aa.max&&mb>Aa.max&&(mb=Aa.max);var Eb=null;try{Eb="numbers"==ub?mb.match(/\d*\.?\d+/g).map(Number).join(" "):"auto"===mb&&Aa.allowAuto&&"auto"==Aa.defVal?null:encodeURIComponent(("int"==
-ub?parseInt(mb):mb)+"")}catch(Fb){}T(Oa,Eb,Aa,null,rb)}var fb=mxEvent.getSource(Ra);if(!(fb!=cb&&fb!=Fa||mxEvent.isConsumed(Ra))){Fa.innerHTML="";var rb=document.createElement("input");W(Fa,rb);rb.value=mxUtils.safeDecodeURIComponent(Ea);rb.className="gePropEditor";"int"!=ab&&"float"!=ab||Aa.allowAuto||(rb.type="number",rb.step="int"==ab?"1":"any",null!=Aa.min&&(rb.min=parseFloat(Aa.min)),null!=Aa.max&&(rb.max=parseFloat(Aa.max)));Fa.appendChild(rb);mxEvent.addListener(rb,"keypress",function(mb){13==
-mb.keyCode&&$a()});rb.focus();mxEvent.addListener(rb,"blur",function(){$a()})}}))}Aa.isDeletable&&(Ga=mxUtils.button("-",mxUtils.bind(ca,function(Ra){T(Oa,"",Aa,Aa.index);mxEvent.consume(Ra)})),Ga.style.height="16px",Ga.style.width="25px",Ga.style.float="right",Ga.className="geColorBtn",cb.appendChild(Ga));Wa.appendChild(cb);return Wa}var ca=this,sa=this.editorUi.editor.graph,xa=[],qa=document.createElement("table");qa.className="geProperties geFullWidthElement";var Ba=document.createElement("tr");
-Ba.className="gePropHeader";var ma=document.createElement("th");ma.className="gePropHeaderCell";ma.style.paddingLeft="16px";ma.style.backgroundRepeat="no-repeat";ma.style.backgroundPosition="-2px 50%";ma.style.backgroundSize="20px";mxUtils.write(ma,mxResources.get("property"));Ba.style.cursor="pointer";var ta=function(){var Oa=qa.querySelectorAll(".gePropNonHeaderRow");if(ca.editorUi.propertiesCollapsed){ma.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Ea="none";for(var Aa=k.childNodes.length-
-1;0<=Aa;Aa--)try{var Ja=k.childNodes[Aa],Ga=Ja.nodeName.toUpperCase();"INPUT"!=Ga&&"SELECT"!=Ga||k.removeChild(Ja)}catch(Ua){}}else ma.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Ea="";for(Aa=0;Aa<Oa.length;Aa++)Oa[Aa].style.display=Ea};mxEvent.addListener(Ba,"click",function(){ca.editorUi.propertiesCollapsed=!ca.editorUi.propertiesCollapsed;ta()});Ba.appendChild(ma);var va=document.createElement("th");va.className="gePropHeaderCell";va.style.paddingLeft="4px";mxUtils.write(va,mxResources.get("value"));
-Ba.appendChild(va);qa.appendChild(Ba);var Ha=va=!1;Ba=null;1==H.vertices.length&&0==H.edges.length?Ba=H.vertices[0].id:0==H.vertices.length&&1==H.edges.length&&(Ba=H.edges[0].id);null==Ba||P||(qa.appendChild(la("id",mxUtils.htmlEntities(Ba),{dispName:"id",type:"readOnly"},!0,!1)),null!=H.style&&null!=H.style.shape&&qa.appendChild(la("shape",mxUtils.htmlEntities(H.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var La in u)if(P=u[La],("function"!=typeof P.isVisible||P.isVisible(H,this))&&
-!P.primary){var Ia=null!=P.getValue?P.getValue(H,this):null!=H.style[La]?mxUtils.htmlEntities(H.style[La]+""):null!=P.getDefaultValue?P.getDefaultValue(H,this):P.defVal;if("separator"==P.type)Ha=!Ha;else{if("staticArr"==P.type)P.size=parseInt(H.style[P.sizeProperty]||u[P.sizeProperty].defVal)||0;else if(null!=P.dependentProps){var Ca=P.dependentProps,Pa=[],Ka=[];for(Ba=0;Ba<Ca.length;Ba++)if(null!=u[Ca[Ba]]){var Na=H.style[Ca[Ba]];Ka.push(u[Ca[Ba]].subDefVal);Pa.push(null!=Na?Na.split(","):[])}P.dependentPropsDefVal=
-Ka;P.dependentPropsVals=Pa}qa.appendChild(la(La,Ia,P,va,Ha));va=!va}}for(Ba=0;Ba<xa.length;Ba++)for(P=xa[Ba],u=P.parentRow,La=0;La<P.values.length;La++)va=la(P.name,P.values[La],{type:P.type,parentRow:P.parentRow,isDeletable:P.isDeletable,index:La,defVal:P.defVal,countProperty:P.countProperty,size:P.size},0==La%2,P.flipBkg),u.parentNode.insertBefore(va,u.nextSibling),u=va;k.appendChild(qa);ta();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var u=this.editorUi,
-H=u.editor.graph,P=document.createElement("div");P.style.padding="6px 20px 0 24px";k.appendChild(P);var T=document.createElement("div");T.className="geSwitcher";T.style.padding="4px 18px 6px 0px";for(var W=[],fa=0;fa<this.defaultColorSchemes.length;fa++){var X=document.createElement("div");X.className="geSwitcherDot";mxUtils.bind(this,function(sa){mxEvent.addListener(X,"click",mxUtils.bind(this,function(){ea(sa)}))})(fa);W.push(X);T.appendChild(X)}var ea=mxUtils.bind(this,function(sa){null!=W[sa]&&
+k.customProperties,k))};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var u=this.editorUi.getSelectionState();1==u.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=u.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);l.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(k,u,H,P){function U(Oa,Ea,Aa,Ja,Ha){if(null!=Aa.valueChanged)Aa.valueChanged(Ea,Ha,H,ba);
+else{sa.getModel().beginUpdate();try{Ha=[];var Ua=[];if(null!=Aa.index){for(var ab=[],Wa=Aa.parentRow.nextSibling;Wa&&Wa.getAttribute("data-pName")==Oa;)ab.push(Wa.getAttribute("data-pValue")),Wa=Wa.nextSibling;Aa.index<ab.length?null!=Ja?ab.splice(Ja,1):ab[Aa.index]=Ea:ab.push(Ea);null!=Aa.size&&ab.length>Aa.size&&(ab=ab.slice(0,Aa.size));Ea=ab.join(",");null!=Aa.countProperty&&(sa.setCellStyles(Aa.countProperty,ab.length,sa.getSelectionCells()),Ha.push(Aa.countProperty),Ua.push(ab.length))}sa.setCellStyles(Oa,
+Ea,sa.getSelectionCells());Ha.push(Oa);Ua.push(Ea);if(null!=Aa.dependentProps)for(Oa=0;Oa<Aa.dependentProps.length;Oa++){var cb=Aa.dependentPropsDefVal[Oa],hb=Aa.dependentPropsVals[Oa];if(hb.length>Ea)hb=hb.slice(0,Ea);else for(var wb=hb.length;wb<Ea;wb++)hb.push(cb);hb=hb.join(",");sa.setCellStyles(Aa.dependentProps[Oa],hb,sa.getSelectionCells());Ha.push(Aa.dependentProps[Oa]);Ua.push(hb)}if("function"==typeof Aa.onChange)Aa.onChange(sa,Ea);ba.editorUi.fireEvent(new mxEventObject("styleChanged",
+"keys",Ha,"values",Ua,"cells",sa.getSelectionCells()))}finally{sa.getModel().endUpdate()}}}function W(Oa,Ea){Ea.style.left="0px";Ea.style.top="0px";Ea.style.position="relative";Ea.style.right="0px";Ea.style.bottom="0px";Ea.style.width="100%";Ea.style.maxWidth="100%";Ea.style.maxHeight="100%";Ea.style.textAlign="left"}function fa(Oa,Ea,Aa){function Ja(Ua){if(null==Ua||Ua==mxConstants.NONE)Ha.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==Ua)Ha.style.background="";else{var ab=
+mxUtils.getLightDarkColor(Ua);mxUtils.isLightDarkColor(Ua)&&ab.light!=ab.dark?Ha.style.background="linear-gradient(to right bottom, "+ab.cssText+" 50%, "+mxUtils.invertLightDarkColor(ab).cssText+" 50.3%)":Ha.style.background=Ua}}var Ha=document.createElement("div");Ha.style.width="32px";Ha.style.height="8px";Ha.style.margin="2px";Ha.style.borderStyle="solid";Ha.style.borderWidth="1px";Ja(Ea);btn=mxUtils.button("",mxUtils.bind(ba,function(Ua){this.editorUi.pickColor(Ea,function(ab){U(Oa,ab,Aa);Ja(ab)});
+mxEvent.consume(Ua)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Ha);return btn}function X(Oa,Ea,Aa,Ja,Ha,Ua,ab){null!=Ea&&(Ea=Ea.split(","),xa.push({name:Oa,values:Ea,type:Aa,defVal:Ja,countProperty:Ha,parentRow:Ua,isDeletable:!0,flipBkg:ab}));btn=mxUtils.button("+",mxUtils.bind(ba,function(Wa){for(var cb=Ua,hb=0;null!=cb.nextSibling;)if(cb.nextSibling.getAttribute("data-pName")==Oa)cb=cb.nextSibling,
+hb++;else break;var wb={type:Aa,parentRow:Ua,index:hb,isDeletable:!0,defVal:Ja,countProperty:Ha};hb=ka(Oa,"",wb,0==hb%2,ab);U(Oa,Ja,wb);cb.parentNode.insertBefore(hb,cb.nextSibling);mxEvent.consume(Wa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ea(Oa,Ea,Aa,Ja,Ha,Ua,ab){if(0<Ha){var Wa=Array(Ha);Ea=null!=Ea?Ea.split(","):[];for(var cb=0;cb<Ha;cb++)Wa[cb]=null!=Ea[cb]?Ea[cb]:null!=Ja?Ja:"";xa.push({name:Oa,values:Wa,type:Aa,defVal:Ja,parentRow:Ua,
+flipBkg:ab,size:Ha})}return document.createElement("div")}function oa(Oa,Ea,Aa){var Ja=document.createElement("input");Ja.type="checkbox";Ja.checked="1"==Ea;mxEvent.addListener(Ja,"change",function(){U(Oa,Ja.checked?"1":"0",Aa,null,Ja)});return Ja}function ka(Oa,Ea,Aa,Ja,Ha){var Ua=Aa.dispName,ab=Aa.type,Wa=document.createElement("tr");Wa.className="gePropRow"+(Ha?"Dark":"")+(Ja?"Alt":"")+" gePropNonHeaderRow";Wa.setAttribute("data-pName",Oa);Wa.setAttribute("data-pValue",Ea);Ja=!1;null!=Aa.index&&
+(Wa.setAttribute("data-index",Aa.index),Ua=(null!=Ua?Ua:"")+"["+Aa.index+"]",Ja=!0);var cb=document.createElement("td");cb.className="gePropRowCell";Ua=mxResources.get(Ua,null,Ua);mxUtils.write(cb,Ua);cb.setAttribute("title",Ua);Ja&&(cb.style.textAlign="right");Wa.appendChild(cb);cb=document.createElement("td");cb.className="gePropRowCell";cb.setAttribute("title",null!=Ea?mxUtils.safeDecodeURIComponent(Ea):mxResources.get("none"));mxEvent.addListener(cb,"click",mxUtils.bind(ba,function(Ra){!mxUtils.isAncestorNode(Wa,
+document.activeElement)&&mxUtils.isAncestorNode(Wa.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(Ra))}));if("color"==ab)cb.appendChild(fa(Oa,Ea,Aa));else if("bool"==ab||"boolean"==ab)cb.appendChild(oa(Oa,Ea,Aa));else if("enum"==ab){var hb=Aa.enumList;cb.innerHTML="";var wb=document.createElement("div");wb.className="gePropValue";cb.appendChild(wb);for(Ha=0;Ha<hb.length;Ha++)if(Ua=hb[Ha],Ua.val==Ea){mxUtils.write(wb,
+mxResources.get(Ua.dispName,null,Ua.dispName));break}mxEvent.addListener(cb,"click",mxUtils.bind(ba,function(Ra){var $a=mxEvent.getSource(Ra);if(!($a!=cb&&$a!=wb||mxEvent.isConsumed(Ra))){wb.innerHTML="";var fb=document.createElement("select"),rb=null;W(cb,fb);fb.style.boxSizing="border-box";fb.style.height="100%";fb.style.padding="0";fb.style.margin="0";fb.style.border="0";for(Ra=0;Ra<hb.length;Ra++){$a=hb[Ra];var mb=document.createElement("option");mb.value=mxUtils.htmlEntities($a.val);mxUtils.write(mb,
+mxResources.get($a.dispName,null,$a.dispName));fb.appendChild(mb);null==$a.val&&(mb.value="null",rb=mb)}fb.value=null==Ea&&null!=rb?"null":Ea;wb.appendChild(fb);mxEvent.addListener(fb,"change",function(){var ub=mxUtils.htmlEntities(fb.value);if(fb[fb.selectedIndex]==rb||"null"==ub.value)ub=null;U(Oa,ub,Aa)});fb.focus();mxEvent.addListener(fb,"blur",function(){wb.innerHTML="";for(var ub=fb[fb.selectedIndex]==rb||"null"==fb.value?null:fb.value,Eb=0;Eb<hb.length;Eb++){var Fb=hb[Eb];if(Fb.val==ub){mxUtils.write(wb,
+mxResources.get(Fb.dispName,null,Fb.dispName));break}}})}}))}else if("dynamicArr"==ab)cb.appendChild(X(Oa,Ea,Aa.subType,Aa.subDefVal,Aa.countProperty,Wa,Ha));else if("staticArr"==ab)cb.appendChild(ea(Oa,Ea,Aa.subType,Aa.subDefVal,Aa.size,Wa,Ha));else if("readOnly"==ab)Ha=document.createElement("input"),Ha.setAttribute("readonly",""),Ha.value=Ea,Ha.style.borderWidth="0px","id"==Oa||"shape"==Oa?(Wa.firstChild.innerHTML="",Wa.firstChild.setAttribute("colspan","2"),Ha.style.flexGrow="1",Ha.style.marginLeft=
+"4px",Ha.style.textAlign="id"==Oa?"center":"left",Ha.setAttribute("title",Ea),Ua=document.createElement("div"),mxUtils.write(Ua,mxResources.get(Oa)+":"),Ua.style.display="inline-flex",Ua.style.alignItems="center",Ua.style.width="100%",Ua.appendChild(Ha),Wa.firstChild.appendChild(Ua)):(Ha.style.width="96px",cb.appendChild(Ha));else{cb.innerHTML="";var Fa=document.createElement("div");Fa.className="gePropValue";cb.appendChild(Fa);Fa.innerHTML=mxUtils.htmlEntities(mxUtils.safeDecodeURIComponent(Ea));
+mxEvent.addListener(cb,"click",mxUtils.bind(ba,function(Ra){function $a(){var mb=rb.value,ub=ab;mb=0==mb.trim().length&&"string"!=ub&&"numbers"!=ub?Aa.allowAuto?"auto":0:mb;Aa.allowAuto&&(null!=mb.trim&&"auto"==mb.trim().toLowerCase()?(mb="auto",ub="string"):(mb=parseFloat(mb),mb=isNaN(mb)?0:mb));null!=Aa.min&&mb<Aa.min?mb=Aa.min:null!=Aa.max&&mb>Aa.max&&(mb=Aa.max);var Eb=null;try{Eb="numbers"==ub?mb.match(/\d*\.?\d+/g).map(Number).join(" "):"auto"===mb&&Aa.allowAuto&&"auto"==Aa.defVal?null:encodeURIComponent(("int"==
+ub?parseInt(mb):mb)+"")}catch(Fb){}U(Oa,Eb,Aa,null,rb)}var fb=mxEvent.getSource(Ra);if(!(fb!=cb&&fb!=Fa||mxEvent.isConsumed(Ra))){Fa.innerHTML="";var rb=document.createElement("input");W(Fa,rb);rb.value=mxUtils.safeDecodeURIComponent(Ea);rb.className="gePropEditor";"int"!=ab&&"float"!=ab||Aa.allowAuto||(rb.type="number",rb.step="int"==ab?"1":"any",null!=Aa.min&&(rb.min=parseFloat(Aa.min)),null!=Aa.max&&(rb.max=parseFloat(Aa.max)));Fa.appendChild(rb);mxEvent.addListener(rb,"keypress",function(mb){13==
+mb.keyCode&&$a()});rb.focus();mxEvent.addListener(rb,"blur",function(){$a()})}}))}Aa.isDeletable&&(Ha=mxUtils.button("-",mxUtils.bind(ba,function(Ra){U(Oa,"",Aa,Aa.index);mxEvent.consume(Ra)})),Ha.style.height="16px",Ha.style.width="25px",Ha.style.float="right",Ha.className="geColorBtn",cb.appendChild(Ha));Wa.appendChild(cb);return Wa}var ba=this,sa=this.editorUi.editor.graph,xa=[],qa=document.createElement("table");qa.className="geProperties geFullWidthElement";var Ba=document.createElement("tr");
+Ba.className="gePropHeader";var ma=document.createElement("th");ma.className="gePropHeaderCell";ma.style.paddingLeft="16px";ma.style.backgroundRepeat="no-repeat";ma.style.backgroundPosition="-2px 50%";ma.style.backgroundSize="20px";mxUtils.write(ma,mxResources.get("property"));Ba.style.cursor="pointer";var ta=function(){var Oa=qa.querySelectorAll(".gePropNonHeaderRow");if(ba.editorUi.propertiesCollapsed){ma.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Ea="none";for(var Aa=k.childNodes.length-
+1;0<=Aa;Aa--)try{var Ja=k.childNodes[Aa],Ha=Ja.nodeName.toUpperCase();"INPUT"!=Ha&&"SELECT"!=Ha||k.removeChild(Ja)}catch(Ua){}}else ma.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Ea="";for(Aa=0;Aa<Oa.length;Aa++)Oa[Aa].style.display=Ea};mxEvent.addListener(Ba,"click",function(){ba.editorUi.propertiesCollapsed=!ba.editorUi.propertiesCollapsed;ta()});Ba.appendChild(ma);var va=document.createElement("th");va.className="gePropHeaderCell";va.style.paddingLeft="4px";mxUtils.write(va,mxResources.get("value"));
+Ba.appendChild(va);qa.appendChild(Ba);var Ga=va=!1;Ba=null;1==H.vertices.length&&0==H.edges.length?Ba=H.vertices[0].id:0==H.vertices.length&&1==H.edges.length&&(Ba=H.edges[0].id);null==Ba||P||(qa.appendChild(ka("id",mxUtils.htmlEntities(Ba),{dispName:"id",type:"readOnly"},!0,!1)),null!=H.style&&null!=H.style.shape&&qa.appendChild(ka("shape",mxUtils.htmlEntities(H.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var La in u)if(P=u[La],("function"!=typeof P.isVisible||P.isVisible(H,this))&&
+!P.primary){var Ia=null!=P.getValue?P.getValue(H,this):null!=H.style[La]?mxUtils.htmlEntities(H.style[La]+""):null!=P.getDefaultValue?P.getDefaultValue(H,this):P.defVal;if("separator"==P.type)Ga=!Ga;else{if("staticArr"==P.type)P.size=parseInt(H.style[P.sizeProperty]||u[P.sizeProperty].defVal)||0;else if(null!=P.dependentProps){var Ca=P.dependentProps,Pa=[],Ka=[];for(Ba=0;Ba<Ca.length;Ba++)if(null!=u[Ca[Ba]]){var Na=H.style[Ca[Ba]];Ka.push(u[Ca[Ba]].subDefVal);Pa.push(null!=Na?Na.split(","):[])}P.dependentPropsDefVal=
+Ka;P.dependentPropsVals=Pa}qa.appendChild(ka(La,Ia,P,va,Ga));va=!va}}for(Ba=0;Ba<xa.length;Ba++)for(P=xa[Ba],u=P.parentRow,La=0;La<P.values.length;La++)va=ka(P.name,P.values[La],{type:P.type,parentRow:P.parentRow,isDeletable:P.isDeletable,index:La,defVal:P.defVal,countProperty:P.countProperty,size:P.size},0==La%2,P.flipBkg),u.parentNode.insertBefore(va,u.nextSibling),u=va;k.appendChild(qa);ta();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var u=this.editorUi,
+H=u.editor.graph,P=document.createElement("div");P.style.padding="6px 20px 0 24px";k.appendChild(P);var U=document.createElement("div");U.className="geSwitcher";U.style.padding="4px 18px 6px 0px";for(var W=[],fa=0;fa<this.defaultColorSchemes.length;fa++){var X=document.createElement("div");X.className="geSwitcherDot";mxUtils.bind(this,function(sa){mxEvent.addListener(X,"click",mxUtils.bind(this,function(){ea(sa)}))})(fa);W.push(X);U.appendChild(X)}var ea=mxUtils.bind(this,function(sa){null!=W[sa]&&
(null!=this.format.currentScheme&&null!=W[this.format.currentScheme]&&(W[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=sa,oa(this.defaultColorSchemes[this.format.currentScheme]),W[this.format.currentScheme].style.background="#84d7ff")}),oa=mxUtils.bind(this,function(sa){var xa=mxUtils.clone(H.defaultVertexStyle);xa[mxConstants.STYLE_STROKECOLOR]=null!=xa[mxConstants.STYLE_STROKECOLOR]?xa[mxConstants.STYLE_STROKECOLOR]:"default";xa[mxConstants.STYLE_FILLCOLOR]=
null!=xa[mxConstants.STYLE_FILLCOLOR]?xa[mxConstants.STYLE_FILLCOLOR]:"default";xa[mxConstants.STYLE_FONTCOLOR]=null!=xa[mxConstants.STYLE_FONTCOLOR]?xa[mxConstants.STYLE_FONTCOLOR]:"default";H.replaceDefaultColors(new mxCell,xa);var qa=mxUtils.bind(this,function(ma){var ta=mxUtils.button("",mxUtils.bind(this,function(La){H.getModel().beginUpdate();try{for(var Ia=u.getSelectionState().cells,Ca=H.getModel(),Pa=[],Ka=0<Ia.length,Na=0;Na<Ia.length;Na++){var Oa=Ca.isVertex(Ia[Na])&&Ca.isEdge(Ca.getParent(Ia[Na])),
-Ea=H.getCellStyle(Ia[Na]),Aa=null!=Ea&&"image"==Ea.shape,Ja=H.getCellGeometry(Ia[Na]);Pa.push({isLabel:Aa||Oa&&(null==Ja||0>=Ja.width||0>=Ja.height)});Oa||Aa||(Ka=!1)}for(Na=0;Na<Ia.length;Na++){var Ga=Pa[Na];if(Ka||!Ga.isLabel){var Ua=Ga.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,ab=Ga.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,Wa=Ca.getStyle(Ia[Na]);null!=Wa&&"string"!==typeof Wa&&(Wa=String(Wa));null!=ma?(mxEvent.isShiftDown(La)||
-(Wa=""==ma.fill||null==ma.fill?mxUtils.setStyle(Wa,Ua,null):mxUtils.setStyle(Wa,Ua,ma.fill),Ga.isLabel||(Wa=""==ma.gradient||null==ma.gradient?mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,ma.gradient)),mxEvent.isControlDown(La)||mxClient.IS_MAC&&mxEvent.isMetaDown(La)||!Ca.isVertex(Ia[Na])||(Wa=""==ma.font||null==ma.font?mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,ma.font))),
-mxEvent.isAltDown(La)||(Wa=""==ma.stroke||null==ma.stroke?mxUtils.setStyle(Wa,ab,null):mxUtils.setStyle(Wa,ab,ma.stroke))):(Wa=mxUtils.setStyle(Wa,Ua,null),Wa=mxUtils.setStyle(Wa,ab,null),Ga.isLabel||(Wa=mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,null)),Ca.isVertex(Ia[Na])&&(Wa=mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,null)));Ca.setStyle(Ia[Na],Wa)}}}finally{H.getModel().endUpdate()}}));ta.className="geStyleButton";ta.style.width="36px";ta.style.height=10>=this.defaultColorSchemes.length?
+Ea=H.getCellStyle(Ia[Na]),Aa=null!=Ea&&"image"==Ea.shape,Ja=H.getCellGeometry(Ia[Na]);Pa.push({isLabel:Aa||Oa&&(null==Ja||0>=Ja.width||0>=Ja.height)});Oa||Aa||(Ka=!1)}for(Na=0;Na<Ia.length;Na++){var Ha=Pa[Na];if(Ka||!Ha.isLabel){var Ua=Ha.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,ab=Ha.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,Wa=Ca.getStyle(Ia[Na]);null!=Wa&&"string"!==typeof Wa&&(Wa=String(Wa));null!=ma?(mxEvent.isShiftDown(La)||
+(Wa=""==ma.fill||null==ma.fill?mxUtils.setStyle(Wa,Ua,null):mxUtils.setStyle(Wa,Ua,ma.fill),Ha.isLabel||(Wa=""==ma.gradient||null==ma.gradient?mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,ma.gradient)),mxEvent.isControlDown(La)||mxClient.IS_MAC&&mxEvent.isMetaDown(La)||!Ca.isVertex(Ia[Na])||(Wa=""==ma.font||null==ma.font?mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,ma.font))),
+mxEvent.isAltDown(La)||(Wa=""==ma.stroke||null==ma.stroke?mxUtils.setStyle(Wa,ab,null):mxUtils.setStyle(Wa,ab,ma.stroke))):(Wa=mxUtils.setStyle(Wa,Ua,null),Wa=mxUtils.setStyle(Wa,ab,null),Ha.isLabel||(Wa=mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,null)),Ca.isVertex(Ia[Na])&&(Wa=mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,null)));Ca.setStyle(Ia[Na],Wa)}}}finally{H.getModel().endUpdate()}}));ta.className="geStyleButton";ta.style.width="36px";ta.style.height=10>=this.defaultColorSchemes.length?
"24px":"30px";ta.style.margin="0px 6px 6px 0px";if(null!=ma){var va="1px solid";null!=ma.border&&(va=ma.border);if(null!=ma.gradient)ta.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(ma.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(ma.gradient).cssText+" 100%)";else if(ma.fill==mxConstants.NONE)ta.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==ma.fill||""==ma.fill)ta.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(xa,mxConstants.STYLE_FILLCOLOR,
-"#ffffff")).cssText;else{var Ha=mxUtils.getLightDarkColor(ma.fill);ta.style.backgroundImage="linear-gradient(to right bottom, "+Ha.cssText+" 50%, "+Ha.light+" 50.3%)"}null==ma.stroke||ma.stroke==mxConstants.NONE?ta.style.border=va+" transparent":""==ma.stroke?ta.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(xa,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Ha=mxUtils.getLightDarkColor(ma.stroke),ta.style.border=va+" "+Ha.cssText,ta.style.borderRightColor=Ha.light,ta.style.borderBottomColor=
-ta.style.borderRightColor);null!=ma.title&&ta.setAttribute("title",ma.title)}else va=mxUtils.getValue(xa,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Ha=mxUtils.getValue(xa,mxConstants.STYLE_STROKECOLOR,"#000000"),ta.style.backgroundColor=va,ta.style.border="1px solid "+Ha;ta.style.borderRadius="0";P.appendChild(ta);null!=ma&&null!=ma.gradient&&(va=ta.cloneNode(!1),va.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(ma.fill).light+") 0px, light-dark(transparent, "+
+"#ffffff")).cssText;else{var Ga=mxUtils.getLightDarkColor(ma.fill);ta.style.backgroundImage="linear-gradient(to right bottom, "+Ga.cssText+" 50%, "+Ga.light+" 50.3%)"}null==ma.stroke||ma.stroke==mxConstants.NONE?ta.style.border=va+" transparent":""==ma.stroke?ta.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(xa,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Ga=mxUtils.getLightDarkColor(ma.stroke),ta.style.border=va+" "+Ga.cssText,ta.style.borderRightColor=Ga.light,ta.style.borderBottomColor=
+ta.style.borderRightColor);null!=ma.title&&ta.setAttribute("title",ma.title)}else va=mxUtils.getValue(xa,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Ga=mxUtils.getValue(xa,mxConstants.STYLE_STROKECOLOR,"#000000"),ta.style.backgroundColor=va,ta.style.border="1px solid "+Ga;ta.style.borderRadius="0";P.appendChild(ta);null!=ma&&null!=ma.gradient&&(va=ta.cloneNode(!1),va.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(ma.fill).light+") 0px, light-dark(transparent, "+
mxUtils.getLightDarkColor(ma.gradient).light+") 100%)",va.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",va.style.backgroundColor="transparent",P.appendChild(va),va.style.marginLeft="-42px",mxEvent.addListener(va,"click",function(){ta.click()}))});P.innerText="";if(null!=sa)for(var Ba=0;Ba<sa.length;Ba++)0<Ba&&0==mxUtils.mod(Ba,4)&&mxUtils.br(P),qa(sa[Ba])});null==this.format.currentScheme?ea(Math.min(W.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ea(this.format.currentScheme);
-fa=10>=this.defaultColorSchemes.length?43:23;var la=document.createElement("div");la.className="geButton";la.style.cssText="position:absolute;left:0px;bottom:"+fa+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(la,"click",mxUtils.bind(this,function(){ea(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ca=document.createElement("div");ca.className="geButton";ca.style.cssText="position:absolute;left:186px;bottom:"+fa+"px;width:20px;background-image:url("+
-Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(la),k.appendChild(ca));mxEvent.addListener(ca,"click",mxUtils.bind(this,function(){ea(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));oa(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&k.appendChild(T)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+
+fa=10>=this.defaultColorSchemes.length?43:23;var ka=document.createElement("div");ka.className="geButton";ka.style.cssText="position:absolute;left:0px;bottom:"+fa+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(ka,"click",mxUtils.bind(this,function(){ea(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ba=document.createElement("div");ba.className="geButton";ba.style.cssText="position:absolute;left:186px;bottom:"+fa+"px;width:20px;background-image:url("+
+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(ka),k.appendChild(ba));mxEvent.addListener(ba,"click",mxUtils.bind(this,function(){ea(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));oa(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&k.appendChild(U)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+
STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements=Object.create(null);Graph.allowedFontUrls=Object.create(null);Graph.isValidFontUrl=function(k){if("string"!==typeof k||0==k.length)return!1;if(Graph.allowedFontUrls[k])return!0;k=k.replace(/^[\x00-\x20]+/,"").replace(/[\x00-\x20]+$/,"").replace(/[\t\n\r]/g,"");return/^https?:\/\//i.test(k)||/^data:/i.test(k)||!/^[a-zA-Z][a-zA-Z0-9+.\-]*:/.test(k)&&!/^[\\\/]/.test(k)};Graph.isGoogleFontUrl=function(k){return k.substring(0,
Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.escapeCssString=function(k){return null!=k?String(k).replace(/[\x00-\x1f\x7f"\\]/g,function(u){return"\\"+
u.charCodeAt(0).toString(16)+" "}):k};Graph.createFontElement=function(k,u){var H=Graph.fontMapping[u];null==H&&Graph.isCssFontUrl(u)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",Graph.rewriteGoogleFontUrl(u))):(null==H&&(H='@font-face {\nfont-family: "'+Graph.escapeCssString(k)+'";\nsrc: url("'+Graph.escapeCssString(u)+'");\n}'),k=document.createElement("style"),mxUtils.write(k,H));return k};
-Graph.addRecentCustomFont=function(k,u){};Graph.addFont=function(k,u,H,P){if(null!=k&&0<k.length&&Graph.isValidFontUrl(u)){P=null!=P?P:Graph.customFontElements;var T=k.toLowerCase();if("helvetica"!=T&&"arial"!=k&&"sans-serif"!=T){var W=P[T];null!=W&&W.url!=u&&(null!=W.elt.parentNode&&W.elt.parentNode.removeChild(W.elt),W=null);null==W?(W=u,"http:"==u.substring(0,5)&&(W=PROXY_URL+"?url="+encodeURIComponent(u)),W={name:k,url:u,elt:Graph.createFontElement(k,W)},P[T]=W,u=P==Graph.customFontElements?document.getElementsByTagName("head")[0]:
+Graph.addRecentCustomFont=function(k,u){};Graph.addFont=function(k,u,H,P){if(null!=k&&0<k.length&&Graph.isValidFontUrl(u)){P=null!=P?P:Graph.customFontElements;var U=k.toLowerCase();if("helvetica"!=U&&"arial"!=k&&"sans-serif"!=U){var W=P[U];null!=W&&W.url!=u&&(null!=W.elt.parentNode&&W.elt.parentNode.removeChild(W.elt),W=null);null==W?(W=u,"http:"==u.substring(0,5)&&(W=PROXY_URL+"?url="+encodeURIComponent(u)),W={name:k,url:u,elt:Graph.createFontElement(k,W)},P[U]=W,u=P==Graph.customFontElements?document.getElementsByTagName("head")[0]:
null,null!=H&&("link"==W.elt.nodeName.toLowerCase()?(W.elt.onload=H,W.elt.onerror=H):H()),null!=u&&u.appendChild(W.elt)):null!=H&&H()}else null!=H&&H()}else null!=H&&H();return k};Graph.getFontUrl=function(k,u){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(u=k.url);return u};Graph.processFontAttributes=function(k){k=k.getElementsByTagName("*");for(var u=0;u<k.length;u++){var H=k[u].getAttribute("data-font-src");if(null!=H){var P="FONT"==k[u].nodeName.toUpperCase()?k[u].getAttribute("face"):
k[u].style.fontFamily;null!=P&&Graph.addFont(P,H)}}};Graph.processFontStyle=function(k){if(null!=k){var u=mxUtils.getValue(k,"fontSource",null);if(null!=u){var H=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=H)try{Graph.addFont(H,decodeURIComponent(u))}catch(P){}}}return k};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;
-mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var q=Graph.prototype.init;Graph.prototype.init=function(){function k(T){u=T}q.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var u=null;mxEvent.addListener(this.container,
-"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(T){u=null});this.isMouseInsertPoint=function(){return null!=u};var H=this.getInsertPoint;this.getInsertPoint=function(T){return null==u||T?H.apply(this,arguments):this.getPointForEvent(u)};var P=this.layoutManager.getLayout;this.layoutManager.getLayout=function(T){var W=this.graph.getCellStyle(T);if(null!=W&&"rack"==W.childLayout){var fa=new mxStackLayout(this.graph,!1);fa.gridSize=
+mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var q=Graph.prototype.init;Graph.prototype.init=function(){function k(U){u=U}q.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var u=null;mxEvent.addListener(this.container,
+"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(U){u=null});this.isMouseInsertPoint=function(){return null!=u};var H=this.getInsertPoint;this.getInsertPoint=function(U){return null==u||U?H.apply(this,arguments):this.getPointForEvent(u)};var P=this.layoutManager.getLayout;this.layoutManager.getLayout=function(U){var W=this.graph.getCellStyle(U);if(null!=W&&"rack"==W.childLayout){var fa=new mxStackLayout(this.graph,!1);fa.gridSize=
null!=W.rackUnitSize?parseFloat(W.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;fa.marginLeft=W.marginLeft||0;fa.marginRight=W.marginRight||0;fa.marginTop=W.marginTop||0;fa.marginBottom=W.marginBottom||0;fa.allowGaps=W.allowGaps||0;fa.horizontal="1"==mxUtils.getValue(W,"horizontalRack","0");fa.resizeParent=!1;fa.fill=!0;return fa}return P.apply(this,arguments)};this.updateGlobalUrlVariables()};var x=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=
-function(k,u){return Graph.processFontStyle(x.apply(this,arguments))};var A=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,u,H,P,T,W,fa,X,ea,oa,la,ca){A.apply(this,arguments);Graph.processFontAttributes(ca)};var E=mxText.prototype.redraw;mxText.prototype.redraw=function(){E.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(k,u,H,P){function T(){for(var Ba=X.getSelectionCells(),
-ma=[],ta=0;ta<Ba.length;ta++)X.isCellVisible(Ba[ta])&&ma.push(Ba[ta]);X.setSelectionCells(ma)}function W(Ba){X.setHiddenTags(Ba?[]:ea.slice());T();X.refresh()}function fa(Ba,ma){la.innerText="";if(0<Ba.length){var ta=document.createElement("table");ta.setAttribute("cellpadding","2");ta.style.boxSizing="border-box";ta.style.tableLayout="fixed";ta.style.width="100%";var va=document.createElement("tbody");if(null!=Ba&&0<Ba.length)for(var Ha=0;Ha<Ba.length;Ha++)(function(La){function Ia(){var Ea=X.getCellsForTags([La],
+function(k,u){return Graph.processFontStyle(x.apply(this,arguments))};var A=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,u,H,P,U,W,fa,X,ea,oa,ka,ba){A.apply(this,arguments);Graph.processFontAttributes(ba)};var E=mxText.prototype.redraw;mxText.prototype.redraw=function(){E.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(k,u,H,P){function U(){for(var Ba=X.getSelectionCells(),
+ma=[],ta=0;ta<Ba.length;ta++)X.isCellVisible(Ba[ta])&&ma.push(Ba[ta]);X.setSelectionCells(ma)}function W(Ba){X.setHiddenTags(Ba?[]:ea.slice());U();X.refresh()}function fa(Ba,ma){ka.innerText="";if(0<Ba.length){var ta=document.createElement("table");ta.setAttribute("cellpadding","2");ta.style.boxSizing="border-box";ta.style.tableLayout="fixed";ta.style.width="100%";var va=document.createElement("tbody");if(null!=Ba&&0<Ba.length)for(var Ga=0;Ga<Ba.length;Ga++)(function(La){function Ia(){var Ea=X.getCellsForTags([La],
null,null,!0);X.isEnabled()?X.setSelectionCells(Ea):X.highlightCells(Ea,null,null,70)}var Ca=0>mxUtils.indexOf(X.hiddenTags,La),Pa=document.createElement("tr"),Ka=document.createElement("td");Ka.style.align="center";Ka.style.width="16px";var Na=document.createElement("img");Na.setAttribute("src",Ca?Editor.visibleImage:Editor.hiddenImage);Na.setAttribute("title",mxResources.get(Ca?"hideIt":"show",[La])+"\n"+mxResources.get("shiftClickShowOnly",[La]));mxUtils.setOpacity(Na,Ca?75:25);Na.className="geAdaptiveAsset";
-Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";Ka.appendChild(Na);mxEvent.addListener(Na,"click",function(Ea){if(mxEvent.isShiftDown(Ea)){for(var Aa=[],Ja=0;Ja<ea.length;Ja++)ea[Ja]!==La&&Aa.push(ea[Ja]);var Ga=0<Aa.length;for(Ja=0;Ja<Aa.length;Ja++)if(0>mxUtils.indexOf(X.hiddenTags,Aa[Ja])){Ga=!1;break}Ga&&0>mxUtils.indexOf(X.hiddenTags,La)?X.setHiddenTags([]):X.setHiddenTags(Aa)}else X.toggleHiddenTag(La);
-T();X.refresh();mxEvent.consume(Ea)});Pa.appendChild(Ka);Ka=document.createElement("td");Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img");Na.setAttribute("src",Editor.selectImage);Na.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Na,Ca?75:25);Na.className="geAdaptiveAsset";Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";mxEvent.addListener(Na,"click",function(Ea){W(!0);
+Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";Ka.appendChild(Na);mxEvent.addListener(Na,"click",function(Ea){if(mxEvent.isShiftDown(Ea)){for(var Aa=[],Ja=0;Ja<ea.length;Ja++)ea[Ja]!==La&&Aa.push(ea[Ja]);var Ha=0<Aa.length;for(Ja=0;Ja<Aa.length;Ja++)if(0>mxUtils.indexOf(X.hiddenTags,Aa[Ja])){Ha=!1;break}Ha&&0>mxUtils.indexOf(X.hiddenTags,La)?X.setHiddenTags([]):X.setHiddenTags(Aa)}else X.toggleHiddenTag(La);
+U();X.refresh();mxEvent.consume(Ea)});Pa.appendChild(Ka);Ka=document.createElement("td");Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img");Na.setAttribute("src",Editor.selectImage);Na.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Na,Ca?75:25);Na.className="geAdaptiveAsset";Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";mxEvent.addListener(Na,"click",function(Ea){W(!0);
Ia();mxEvent.consume(Ea)});Ka.appendChild(Na);Pa.appendChild(Ka);Ka=document.createElement("td");Ka.style.overflow="hidden";Ka.style.whiteSpace="nowrap";Ka.style.textOverflow="ellipsis";Ka.style.verticalAlign="middle";Ka.style.cursor="pointer";Ka.setAttribute("title",La);a=document.createElement("a");mxUtils.write(a,La);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,Ca?100:40);Ka.appendChild(a);mxEvent.addListener(Ka,"click",function(Ea){if(mxEvent.isShiftDown(Ea))W(!0),
-Ia();else if(Ca&&0<X.hiddenTags.length)W(!0);else{var Aa=ea.slice(),Ja=mxUtils.indexOf(Aa,La);Aa.splice(Ja,1);X.setHiddenTags(Aa);T();X.refresh()}mxEvent.consume(Ea)});Pa.appendChild(Ka);if(X.isEnabled()){Ka=document.createElement("td");Ka.style.verticalAlign="middle";Ka.style.textAlign="center";Ka.style.width="18px";if(null==ma){Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img");Na.setAttribute("src",Editor.trashImage);Na.setAttribute("title",mxResources.get("removeIt",
+Ia();else if(Ca&&0<X.hiddenTags.length)W(!0);else{var Aa=ea.slice(),Ja=mxUtils.indexOf(Aa,La);Aa.splice(Ja,1);X.setHiddenTags(Aa);U();X.refresh()}mxEvent.consume(Ea)});Pa.appendChild(Ka);if(X.isEnabled()){Ka=document.createElement("td");Ka.style.verticalAlign="middle";Ka.style.textAlign="center";Ka.style.width="18px";if(null==ma){Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img");Na.setAttribute("src",Editor.trashImage);Na.setAttribute("title",mxResources.get("removeIt",
[La]));mxUtils.setOpacity(Na,Ca?75:25);Na.className="geAdaptiveAsset";Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";mxEvent.addListener(Na,"click",function(Ea){var Aa=mxUtils.indexOf(ea,La);0<=Aa&&ea.splice(Aa,1);X.removeTagsForCells(X.model.getDescendants(X.model.getRoot()),[La]);X.refresh();mxEvent.consume(Ea)});Ka.appendChild(Na)}else{var Oa=document.createElement("input");Oa.setAttribute("type","checkbox");
-Oa.style.margin="0px";Oa.defaultChecked=null!=ma&&0<=mxUtils.indexOf(ma,La);Oa.checked=Oa.defaultChecked;Oa.style.background="transparent";Oa.setAttribute("title",mxResources.get(Oa.defaultChecked?"removeIt":"add",[La]));mxEvent.addListener(Oa,"change",function(Ea){Oa.checked?X.addTagsForCells(X.getSelectionCells(),[La]):X.removeTagsForCells(X.getSelectionCells(),[La]);mxEvent.consume(Ea)});Ka.appendChild(Oa)}Pa.appendChild(Ka)}va.appendChild(Pa)})(Ba[Ha]);ta.appendChild(va);la.appendChild(ta)}}var X=
-this,ea=X.hiddenTags.slice(),oa=document.createElement("div");oa.style.userSelect="none";oa.style.overflow="hidden";oa.style.padding="10px";oa.style.height="100%";var la=document.createElement("div");la.style.position="absolute";la.style.boxSizing="border-box";la.style.userSelect="none";la.style.overflow="auto";la.style.padding="3px";la.style.left="0px";la.style.right="0px";la.style.top="0px";la.style.bottom="0px";oa.appendChild(la);X.addListener(mxEvent.ROOT,function(){ea=X.hiddenTags.slice()});
-var ca=mxUtils.bind(this,function(Ba,ma){if(k()){Ba=X.getAllTags();for(ma=0;ma<Ba.length;ma++)0>mxUtils.indexOf(ea,Ba[ma])&&ea.push(Ba[ma]);ea.sort();X.isSelectionEmpty()?fa(ea):fa(ea,X.getCommonTagsForCells(X.getSelectionCells()))}});X.selectionModel.addListener(mxEvent.CHANGE,ca);X.model.addListener(mxEvent.CHANGE,ca);X.addListener(mxEvent.REFRESH,ca);var sa=document.createElement("div");sa.className="geToolbarContainer geDialogToolbar";sa.style.position="absolute";sa.style.display="flex";sa.style.bottom=
-"0px";sa.style.left="0px";sa.style.right="0px";sa.style.height="32px";sa.style.overflow="hidden";sa.style.padding="3px 4px 4px 4px";sa.style.borderWidth="1px 0px 0px 0px";sa.style.borderStyle="solid";sa.style.whiteSpace="nowrap";if(X.isEnabled()){la.style.bottom="32px";var xa=document.createElement("a");xa.className="geButton";var qa=xa.cloneNode(!1);qa.style.backgroundImage="url("+Editor.visibleImage+")";qa.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(qa,"click",function(Ba){X.setHiddenTags([]);
-mxEvent.isShiftDown(Ba)||(ea=X.hiddenTags.slice());T();X.refresh();mxEvent.consume(Ba)});sa.appendChild(qa);null!=H&&(xa=xa.cloneNode(!1),xa.style.backgroundImage="url("+Editor.plusImage+")",xa.setAttribute("title",mxResources.get("add")),mxEvent.addListener(xa,"click",function(Ba){H(ea,function(ma){ea=ma;ca()});mxEvent.consume(Ba)}),sa.appendChild(xa));oa.appendChild(sa)}null!=P&&sa.appendChild(P);return{div:oa,refresh:ca}};Graph.prototype.getCustomFonts=function(k){k=null!=k?k:Graph.customFontElements;
-var u=[];if(null!=this.extFonts)for(var H=0;H<this.extFonts.length;H++)Graph.isValidFontUrl(this.extFonts[H].url)&&u.push(this.extFonts[H]);for(var P in k)H=k[P],Graph.isValidFontUrl(H.url)&&u.push({name:H.name,url:H.url});return u};Graph.prototype.getExtFontCss=function(k){k=this.getCustomFonts(k);for(var u="",H="",P=0;P<k.length;P++){var T=k[P].name,W=k[P].url;Graph.isCssFontUrl(W)?u+='@import url("'+Graph.escapeCssString(Graph.rewriteGoogleFontUrl(W))+'");\n':H+='@font-face {\nfont-family: "'+
-Graph.escapeCssString(T)+'";\nsrc: url("'+Graph.escapeCssString(W)+'");\n}\n'}return u+H};Graph.prototype.setFont=function(k,u){Graph.addFont(k,u);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var P=this.cellEditor.textarea.getElementsByTagName("font"),T=!1,W=0;W<P.length;W++)P[W].getAttribute("face")==H&&(T=!0,P[W].setAttribute("face",k),null!=u?P[W].setAttribute("data-font-src",u):P[W].removeAttribute("data-font-src"));T||document.execCommand("fontname",!1,k)};var K=Graph.prototype.isFastZoomEnabled;
+Oa.style.margin="0px";Oa.defaultChecked=null!=ma&&0<=mxUtils.indexOf(ma,La);Oa.checked=Oa.defaultChecked;Oa.style.background="transparent";Oa.setAttribute("title",mxResources.get(Oa.defaultChecked?"removeIt":"add",[La]));mxEvent.addListener(Oa,"change",function(Ea){Oa.checked?X.addTagsForCells(X.getSelectionCells(),[La]):X.removeTagsForCells(X.getSelectionCells(),[La]);mxEvent.consume(Ea)});Ka.appendChild(Oa)}Pa.appendChild(Ka)}va.appendChild(Pa)})(Ba[Ga]);ta.appendChild(va);ka.appendChild(ta)}}var X=
+this,ea=X.hiddenTags.slice(),oa=document.createElement("div");oa.style.userSelect="none";oa.style.overflow="hidden";oa.style.padding="10px";oa.style.height="100%";var ka=document.createElement("div");ka.style.position="absolute";ka.style.boxSizing="border-box";ka.style.userSelect="none";ka.style.overflow="auto";ka.style.padding="3px";ka.style.left="0px";ka.style.right="0px";ka.style.top="0px";ka.style.bottom="0px";oa.appendChild(ka);X.addListener(mxEvent.ROOT,function(){ea=X.hiddenTags.slice()});
+var ba=mxUtils.bind(this,function(Ba,ma){if(k()){Ba=X.getAllTags();for(ma=0;ma<Ba.length;ma++)0>mxUtils.indexOf(ea,Ba[ma])&&ea.push(Ba[ma]);ea.sort();X.isSelectionEmpty()?fa(ea):fa(ea,X.getCommonTagsForCells(X.getSelectionCells()))}});X.selectionModel.addListener(mxEvent.CHANGE,ba);X.model.addListener(mxEvent.CHANGE,ba);X.addListener(mxEvent.REFRESH,ba);var sa=document.createElement("div");sa.className="geToolbarContainer geDialogToolbar";sa.style.position="absolute";sa.style.display="flex";sa.style.bottom=
+"0px";sa.style.left="0px";sa.style.right="0px";sa.style.height="32px";sa.style.overflow="hidden";sa.style.padding="3px 4px 4px 4px";sa.style.borderWidth="1px 0px 0px 0px";sa.style.borderStyle="solid";sa.style.whiteSpace="nowrap";if(X.isEnabled()){ka.style.bottom="32px";var xa=document.createElement("a");xa.className="geButton";var qa=xa.cloneNode(!1);qa.style.backgroundImage="url("+Editor.visibleImage+")";qa.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(qa,"click",function(Ba){X.setHiddenTags([]);
+mxEvent.isShiftDown(Ba)||(ea=X.hiddenTags.slice());U();X.refresh();mxEvent.consume(Ba)});sa.appendChild(qa);null!=H&&(xa=xa.cloneNode(!1),xa.style.backgroundImage="url("+Editor.plusImage+")",xa.setAttribute("title",mxResources.get("add")),mxEvent.addListener(xa,"click",function(Ba){H(ea,function(ma){ea=ma;ba()});mxEvent.consume(Ba)}),sa.appendChild(xa));oa.appendChild(sa)}null!=P&&sa.appendChild(P);return{div:oa,refresh:ba}};Graph.prototype.getCustomFonts=function(k){k=null!=k?k:Graph.customFontElements;
+var u=[];if(null!=this.extFonts)for(var H=0;H<this.extFonts.length;H++)Graph.isValidFontUrl(this.extFonts[H].url)&&u.push(this.extFonts[H]);for(var P in k)H=k[P],Graph.isValidFontUrl(H.url)&&u.push({name:H.name,url:H.url});return u};Graph.prototype.getExtFontCss=function(k){k=this.getCustomFonts(k);for(var u="",H="",P=0;P<k.length;P++){var U=k[P].name,W=k[P].url;Graph.isCssFontUrl(W)?u+='@import url("'+Graph.escapeCssString(Graph.rewriteGoogleFontUrl(W))+'");\n':H+='@font-face {\nfont-family: "'+
+Graph.escapeCssString(U)+'";\nsrc: url("'+Graph.escapeCssString(W)+'");\n}\n'}return u+H};Graph.prototype.setFont=function(k,u){Graph.addFont(k,u);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var P=this.cellEditor.textarea.getElementsByTagName("font"),U=!1,W=0;W<P.length;W++)P[W].getAttribute("face")==H&&(U=!0,P[W].setAttribute("face",k),null!=u?P[W].setAttribute("data-font-src",u):P[W].removeAttribute("data-font-src"));U||document.execCommand("fontname",!1,k)};var K=Graph.prototype.isFastZoomEnabled;
Graph.prototype.isFastZoomEnabled=function(){return K.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var u in k)this.globalVars[u]=k[u]}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+H)}};Graph.prototype.getExportVariables=
function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var Q=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var u=Q.apply(this,arguments);null==u&&null!=this.globalVars&&(u=this.globalVars[k]);return u};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};
-var V=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,u,H,P,T,W,fa,X,ea,oa,la,ca,sa,xa,qa,Ba,ma){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(Ia){}this.refreshMathBounds()}var ta=V.apply(this,arguments);if(null!=ca){var va=ta.getAttribute("style");null==
-va&&(va="");ca="auto"==ca||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":ca;ta.setAttribute("style",va+(" color-scheme: "+ca+";"))}var Ha=la?this.getExtFontCss():"";if(0<Ha.length){var La=ta.ownerDocument;va=null!=La.createElementNS?La.createElementNS(mxConstants.NS_SVG,"style"):La.createElement("style");null!=La.setAttributeNS?va.setAttributeNS("type","text/css"):va.setAttribute("type","text/css");va.appendChild(La.createTextNode(Ha));ta.getElementsByTagName("defs")[0].appendChild(va)}Editor.replaceSvgDataUris&&
+var V=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,u,H,P,U,W,fa,X,ea,oa,ka,ba,sa,xa,qa,Ba,ma){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(Ia){}this.refreshMathBounds()}var ta=V.apply(this,arguments);if(null!=ba){var va=ta.getAttribute("style");null==
+va&&(va="");ba="auto"==ba||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":ba;ta.setAttribute("style",va+(" color-scheme: "+ba+";"))}var Ga=ka?this.getExtFontCss():"";if(0<Ga.length){var La=ta.ownerDocument;va=null!=La.createElementNS?La.createElementNS(mxConstants.NS_SVG,"style"):La.createElement("style");null!=La.setAttributeNS?va.setAttributeNS("type","text/css"):va.setAttribute("type","text/css");va.appendChild(La.createTextNode(Ga));ta.getElementsByTagName("defs")[0].appendChild(va)}Editor.replaceSvgDataUris&&
null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ta);this.mathEnabled&&(document.body.appendChild(ta),Editor.MathJaxRender(ta),ta.parentNode.removeChild(ta),va=ta.ownerDocument.getElementById("MJX-SVG-styles"),null!=va&&ta.getElementsByTagName("defs")[0].appendChild(va.cloneNode(!0)));return ta};var J=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){J.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=
null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,k.control]};var ia=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){ia.apply(this,arguments);this.enumerationState=0};var Y=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return Y.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=mxUtils.safeDecodeURIComponent(mxUtils.getValue(k.style,
"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(k)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var u="1"==mxUtils.getValue(k.style,"enumerate",0);u&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,
this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):u||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);u=k.secondLabel;if(null!=u){var H=k.view.scale,P=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*H,k.y+4*H,0,0):mxRectangle.fromPoint(k.view.getPoint(k));u.bounds.equals(k)&&u.value==P&&u.scale==H||(u.bounds=k,u.value=P,u.scale=H,u.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();
aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var ja=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){ja.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,u){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&
-this.executeCustomActions(Graph.flattenAnimationActions(k.actions),null,u))};Graph.flattenAnimationActions=function(k){if(!Array.isArray(k))return k;for(var u=[],H=0;H<k.length;H++){var P=k[H];if(null!=P&&null!=P.animation&&Array.isArray(P.animation.steps)){P=Graph.flattenAnimationActions(P.animation.steps);for(var T=0;T<P.length;T++)u.push(P[T])}else u.push(P)}return u};Graph.smoothScrollContainer=function(k,u,H,P,T,W){W=W||600;if(u!==P||H!==T){k.scrollLeft=u;k.scrollTop=H;var fa="undefined"!=typeof performance&&
-null!=performance.now?performance.now():Date.now(),X=P-u,ea=T-H,oa=function(la){la=Math.min(1,(la-fa)/W);var ca=1-Math.pow(1-la,3);k.scrollLeft=u+X*ca;k.scrollTop=H+ea*ca;1>la&&window.requestAnimationFrame(oa)};window.requestAnimationFrame(oa)}};Graph.applyTransformTransition=function(k,u){u=u||600;var H=k.view.getDrawPane(),P=null!=H?H.parentNode:null;if(null!=P){var T=P.style.transition;P.style.transition="transform "+u+"ms cubic-bezier(0.16, 1, 0.3, 1)";k.armTransformTransition=!0;var W=function(){P.style.transition=
-T||"";k.armTransformTransition=!1;P.removeEventListener("transitionend",W)};P.addEventListener("transitionend",W);window.setTimeout(W,u+100)}};Graph.prototype.fitBoundsCssTransform=function(k,u){var H=null!=u?u:10;u=this.view.graphBounds;var P=Math.max(u.x,k.x),T=Math.max(u.y,k.y),W=Math.max(1,Math.min(u.x+u.width,k.x+k.width)-P),fa=Math.max(1,Math.min(u.y+u.height,k.y+k.height)-T),X=this.container.clientWidth-H,ea=this.container.clientHeight-H;k=Math.floor(20*Math.min(X/W,ea/fa))/20;this.view.scaleAndTranslate(k,
--u.x,-u.y);P=(P-u.x)*k-Math.max((X-W*k)/2+H/2,0);H=(T-u.y)*k-Math.max((ea-fa*k)/2+H/2,0);W=this.getBorder();T=u.width*k+2*W-this.container.clientWidth;u=u.height*k+2*W-this.container.clientHeight;this.container.scrollLeft=0>T?0:Math.max(0,Math.min(P,T));this.container.scrollTop=0>u?0:Math.max(0,Math.min(H,u))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(k,u,H){if(this.isGraphTornDown())null!=H&&H();else{var P=
-this.container,T=P.scrollLeft,W=P.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(k,u)):this.fitWindow(k,u);Graph.smoothScrollContainer(P,T,W,P.scrollLeft,P.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(k,u){var H=this.view.getState(k);if(null!=H){var P=this.view.graphBounds,T=this.view.scale;this.view.translate.x===-P.x&&this.view.translate.y===-P.y||this.view.scaleAndTranslate(T,-P.x,
--P.y);k=this.container.clientWidth;var W=this.container.clientHeight,fa=this.getBorder(),X=P.width*T+2*fa-k;fa=P.height*T+2*fa-W;if(null!=u){var ea=(H.x-P.x)*T,oa=(H.y-P.y)*T,la=(H.x+H.width-P.x)*T;P=(H.y+H.height-P.y)*T;var ca=this.container.scrollLeft;H=this.container.scrollTop;ea-u<ca?ca=ea-u:la+u>ca+k&&(ca=la+u-k);oa-u<H?H=oa-u:P+u>H+W&&(H=P+u-W)}else ca=(H.x+H.width/2-P.x)*T-k/2,H=(H.y+H.height/2-P.y)*T-W/2;this.container.scrollLeft=0>X?0:Math.max(0,Math.min(ca,X));this.container.scrollTop=0>
-fa?0:Math.max(0,Math.min(H,fa))}};Graph.prototype.scrollCellToVisibleBorder=function(k,u){null==u?this.scrollCellToVisible(k):(k=this.view.getState(k),null!=k&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+k.x-u,-this.view.translate.y+k.y-u,k.width+2*u,k.height+2*u)))};Graph.prototype.smoothScrollCellToVisible=function(k,u,H){if(this.isGraphTornDown())null!=H&&H();else{var P=this.container,T=P.scrollLeft,W=P.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(k,
-u):this.scrollCellToVisibleBorder(k,u);Graph.smoothScrollContainer(P,T,W,P.scrollLeft,P.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.toggleCellsTransient=function(k){k=this.getNodesForCells(k);for(var u=0;u<k.length;u++){var H=k[u].style.opacity;H=""===H||null===H||0<parseFloat(H);k[u].style.opacity=H?0:1}};Graph.prototype.setCellStylesTransient=function(k,u,H){for(var P=0;P<H.length;P++){var T=this.view.getState(H[P]);null!=T&&null!=T.style&&(null==u?delete T.style[k]:T.style[k]=
-u,null!=T.shape&&(T.shape.apply(T),T.shape.redraw()),null!=T.text&&(T.text.apply(T),T.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(k,u,H){null==u&&(u="0");for(var P=0;P<H.length;P++){var T=this.view.getState(H[P]);if(null!=T&&null!=T.style){var W=mxUtils.getValue(T.style,k,u)?"0":"1";T.style[k]=W;null!=T.shape&&(T.shape.apply(T),T.shape.redraw());null!=T.text&&(T.text.apply(T),T.text.redraw())}}};Graph.prototype.executeCustomActions=function(k,u,H){if(this.executingCustomActions)this.stoppingCustomActions=
-!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var P=!1,T=0,W=0,fa=mxUtils.bind(this,function(){P||(P=!0,this.model.beginUpdate())}),X=mxUtils.bind(this,function(){P&&(P=!1,this.model.endUpdate())}),ea=null==H,oa=function(xa){return null!=xa.transient?xa.transient:ea},la=mxUtils.bind(this,function(){0<
-T&&T--;0==T&&sa()}),ca=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=u&&u();else if(W<k.length){do{var xa=this.stoppingCustomActions,qa=k[W++],Ba=[];if(null!=qa.open)if(X(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,H)){this.stoppingCustomActions=this.executingCustomActions=!1;null!=u&&u();return}}else this.openLink(qa.open);null==qa.wait||xa||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=
-this.pendingExecuteNextAction=null;la()}),T++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=qa.wait?parseInt(qa.wait):1E3),X());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,!0)),qa.opacity.value);null!=qa.fadeIn&&(T++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,la,xa?0:qa.fadeIn.delay));null!=qa.fadeOut&&(T++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,
-!0)),1,0,la,xa?0:qa.fadeOut.delay));if(null!=qa.fadeTo&&null!=qa.fadeTo.value){T++;var ma=this.getNodesForCells(this.getCellsForAction(qa.fadeTo,!0)),ta=xa?0:null!=qa.fadeTo.delay?qa.fadeTo.delay:1E3;Graph.setTransitionForNodes(ma,"all "+ta+"ms ease-in-out");Graph.setOpacityForNodes(ma,qa.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(ma,null);la()},ta)}null!=qa.flow&&(ta=this.getCellsForAction(qa.flow,!0),Editor.toggleFlowAnimation(this,ta,!1===qa.flow.start?"stop":!0===qa.flow.start?
+this.executeCustomActions(Graph.flattenAnimationActions(k.actions),null,u))};Graph.flattenAnimationActions=function(k){if(!Array.isArray(k))return k;for(var u=[],H=0;H<k.length;H++){var P=k[H];if(null!=P&&null!=P.animation&&Array.isArray(P.animation.steps)){P=Graph.flattenAnimationActions(P.animation.steps);for(var U=0;U<P.length;U++)u.push(P[U])}else u.push(P)}return u};Graph.smoothScrollContainer=function(k,u,H,P,U,W){W=W||600;if(u!==P||H!==U){k.scrollLeft=u;k.scrollTop=H;var fa="undefined"!=typeof performance&&
+null!=performance.now?performance.now():Date.now(),X=P-u,ea=U-H,oa=function(ka){ka=Math.min(1,(ka-fa)/W);var ba=1-Math.pow(1-ka,3);k.scrollLeft=u+X*ba;k.scrollTop=H+ea*ba;1>ka&&window.requestAnimationFrame(oa)};window.requestAnimationFrame(oa)}};Graph.applyTransformTransition=function(k,u){u=u||600;var H=k.view.getDrawPane(),P=null!=H?H.parentNode:null;if(null!=P){var U=P.style.transition;P.style.transition="transform "+u+"ms cubic-bezier(0.16, 1, 0.3, 1)";k.armTransformTransition=!0;var W=function(){P.style.transition=
+U||"";k.armTransformTransition=!1;P.removeEventListener("transitionend",W)};P.addEventListener("transitionend",W);window.setTimeout(W,u+100)}};Graph.prototype.fitBoundsCssTransform=function(k,u){var H=null!=u?u:10;u=this.view.graphBounds;var P=Math.max(u.x,k.x),U=Math.max(u.y,k.y),W=Math.max(1,Math.min(u.x+u.width,k.x+k.width)-P),fa=Math.max(1,Math.min(u.y+u.height,k.y+k.height)-U),X=this.container.clientWidth-H,ea=this.container.clientHeight-H;k=Math.floor(20*Math.min(X/W,ea/fa))/20;this.view.scaleAndTranslate(k,
+-u.x,-u.y);P=(P-u.x)*k-Math.max((X-W*k)/2+H/2,0);H=(U-u.y)*k-Math.max((ea-fa*k)/2+H/2,0);W=this.getBorder();U=u.width*k+2*W-this.container.clientWidth;u=u.height*k+2*W-this.container.clientHeight;this.container.scrollLeft=0>U?0:Math.max(0,Math.min(P,U));this.container.scrollTop=0>u?0:Math.max(0,Math.min(H,u))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(k,u,H){if(this.isGraphTornDown())null!=H&&H();else{var P=
+this.container,U=P.scrollLeft,W=P.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(k,u)):this.fitWindow(k,u);Graph.smoothScrollContainer(P,U,W,P.scrollLeft,P.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(k,u){var H=this.view.getState(k);if(null!=H){var P=this.view.graphBounds,U=this.view.scale;this.view.translate.x===-P.x&&this.view.translate.y===-P.y||this.view.scaleAndTranslate(U,-P.x,
+-P.y);k=this.container.clientWidth;var W=this.container.clientHeight,fa=this.getBorder(),X=P.width*U+2*fa-k;fa=P.height*U+2*fa-W;if(null!=u){var ea=(H.x-P.x)*U,oa=(H.y-P.y)*U,ka=(H.x+H.width-P.x)*U;P=(H.y+H.height-P.y)*U;var ba=this.container.scrollLeft;H=this.container.scrollTop;ea-u<ba?ba=ea-u:ka+u>ba+k&&(ba=ka+u-k);oa-u<H?H=oa-u:P+u>H+W&&(H=P+u-W)}else ba=(H.x+H.width/2-P.x)*U-k/2,H=(H.y+H.height/2-P.y)*U-W/2;this.container.scrollLeft=0>X?0:Math.max(0,Math.min(ba,X));this.container.scrollTop=0>
+fa?0:Math.max(0,Math.min(H,fa))}};Graph.prototype.scrollCellToVisibleBorder=function(k,u){null==u?this.scrollCellToVisible(k):(k=this.view.getState(k),null!=k&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+k.x-u,-this.view.translate.y+k.y-u,k.width+2*u,k.height+2*u)))};Graph.prototype.smoothScrollCellToVisible=function(k,u,H){if(this.isGraphTornDown())null!=H&&H();else{var P=this.container,U=P.scrollLeft,W=P.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(k,
+u):this.scrollCellToVisibleBorder(k,u);Graph.smoothScrollContainer(P,U,W,P.scrollLeft,P.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.toggleCellsTransient=function(k){k=this.getNodesForCells(k);for(var u=0;u<k.length;u++){var H=k[u].style.opacity;H=""===H||null===H||0<parseFloat(H);k[u].style.opacity=H?0:1}};Graph.prototype.setCellStylesTransient=function(k,u,H){for(var P=0;P<H.length;P++){var U=this.view.getState(H[P]);null!=U&&null!=U.style&&(null==u?delete U.style[k]:U.style[k]=
+u,this.redrawTransientStyle(U))}};Graph.prototype.redrawTransientStyle=function(k){null!=k.shape&&(k.shape.resetStyles(),this.cellRenderer.configureShape(k),k.shape.redraw());null!=k.text&&(k.text.resetStyles(),k.text.apply(k),k.text.valign=this.getVerticalAlign(k),k.text.redraw())};Graph.nextToggleStyleValue=function(k,u,H){return null!=u&&""!==u?null!=k&&String(k)==String(u)?H:u:null!=k&&""!==k&&0!=k&&"false"!==k?"0":"1"};Graph.prototype.toggleCellStyleValues=function(k,u,H,P){if(null!=P&&0<P.length){var U=
+mxUtils.getValue(this.getCurrentCellStyle(P[0]),k,H);this.setCellStyles(k,Graph.nextToggleStyleValue(U,u,H),P)}};Graph.prototype.toggleCellStylesTransient=function(k,u,H,P){for(var U=0;U<H.length;U++){var W=this.view.getState(H[U]);if(null!=W&&null!=W.style){var fa=Graph.nextToggleStyleValue(mxUtils.getValue(W.style,k,u),P,u);null==fa||""===fa?delete W.style[k]:W.style[k]=fa;this.redrawTransientStyle(W)}}};Graph.prototype.executeCustomActions=function(k,u,H){if(this.executingCustomActions)this.stoppingCustomActions=
+!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var P=!1,U=0,W=0,fa=mxUtils.bind(this,function(){P||(P=!0,this.model.beginUpdate())}),X=mxUtils.bind(this,function(){P&&(P=!1,this.model.endUpdate())}),ea=null==H,oa=function(xa){return null!=xa.transient?xa.transient:ea},ka=mxUtils.bind(this,function(){0<
+U&&U--;0==U&&sa()}),ba=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=u&&u();else if(W<k.length){do{var xa=this.stoppingCustomActions,qa=k[W++],Ba=[];if(null!=qa.open)if(X(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,H)){this.stoppingCustomActions=this.executingCustomActions=!1;null!=u&&u();return}}else this.openLink(qa.open);null==qa.wait||xa||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=
+this.pendingExecuteNextAction=null;ka()}),U++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=qa.wait?parseInt(qa.wait):1E3),X());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,!0)),qa.opacity.value);null!=qa.fadeIn&&(U++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,ka,xa?0:qa.fadeIn.delay));null!=qa.fadeOut&&(U++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,
+!0)),1,0,ka,xa?0:qa.fadeOut.delay));if(null!=qa.fadeTo&&null!=qa.fadeTo.value){U++;var ma=this.getNodesForCells(this.getCellsForAction(qa.fadeTo,!0)),ta=xa?0:null!=qa.fadeTo.delay?qa.fadeTo.delay:1E3;Graph.setTransitionForNodes(ma,"all "+ta+"ms ease-in-out");Graph.setOpacityForNodes(ma,qa.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(ma,null);ka()},ta)}null!=qa.flow&&(ta=this.getCellsForAction(qa.flow,!0),Editor.toggleFlowAnimation(this,ta,!1===qa.flow.start?"stop":!0===qa.flow.start?
"start":"toggle"));null!=qa.wipeIn&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeIn,!0),!0)));null!=qa.wipeOut&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeOut,!0),!1)));null!=qa.popIn&&(Ba=Ba.concat(this.createPopAnimations(this.getCellsForAction(qa.popIn,!0),!0)));null!=qa.popOut&&(Ba=Ba.concat(this.createPopAnimations(this.getCellsForAction(qa.popOut,!0),!1)));null!=qa.toggle&&(oa(qa.toggle)?this.toggleCellsTransient(this.getCellsForAction(qa.toggle,
!0)):(fa(),this.toggleCells(this.getCellsForAction(qa.toggle,!0,!0))));null!=qa.show&&(ta=this.getCellsForAction(qa.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(ta),1),oa(qa.show)||(fa(),this.setCellsVisible(this.getCellsForAction(qa.show,!0,!0),!0)));null!=qa.hide&&(ta=this.getCellsForAction(qa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ta),0),oa(qa.hide)||(fa(),this.setCellsVisible(this.getCellsForAction(qa.hide,!0,!0),!1)));if(null!=qa.toggleStyle&&null!=qa.toggleStyle.key){ta=
-this.getCellsForAction(qa.toggleStyle,!0);var va=null!=qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:"0";oa(qa.toggleStyle)?this.toggleCellStylesTransient(qa.toggleStyle.key,va,ta):(fa(),this.toggleCellStyles(qa.toggleStyle.key,va,ta))}null!=qa.style&&null!=qa.style.key&&(ta=this.getCellsForAction(qa.style,!0),oa(qa.style)?this.setCellStylesTransient(qa.style.key,qa.style.value,ta):(fa(),this.setCellStyles(qa.style.key,qa.style.value,ta)));ta=[];null!=qa.select&&this.isEnabled()&&(ta=this.getCellsForAction(qa.select),
-this.setSelectionCells(ta));null!=qa.highlight&&(ta=this.getCellsForAction(qa.highlight),this.highlightCells(ta,qa.highlight.color,qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ta=this.getCellsForAction(qa.scroll));if(null!=qa.viewbox){va=qa.viewbox;if(null!=va.cells||null!=va.tags||null!=va.layers){var Ha=this.getBoundingBox(this.getCellsForAction(va));if(null!=Ha){var La=this.useCssTransforms?1:this.view.scale,Ia=this.useCssTransforms?new mxPoint(0,0):this.view.translate,Ca=null==
-va.border||""===va.border||isNaN(parseFloat(va.border))?null:2*parseFloat(va.border);va={x:Ha.x/La-Ia.x,y:Ha.y/La-Ia.y,width:Math.max(1,Ha.width/La),height:Math.max(1,Ha.height/La),border:Ca,smooth:va.smooth}}else va=null}null!=va&&(!0!==va.smooth||xa?this.useCssTransforms?this.fitBoundsCssTransform(va,va.border):this.fitWindow(va,va.border):(T++,this.smoothFitWindow(va,va.border,la)))}0<ta.length&&(va=null==qa.scroll||null==qa.scroll.border||""===qa.scroll.border||isNaN(parseFloat(qa.scroll.border))?
-null:parseFloat(qa.scroll.border),null==qa.scroll||!0!==qa.scroll.smooth||xa?this.useCssTransforms?this.scrollCellToVisibleCssTransform(ta[0],va):this.scrollCellToVisibleBorder(ta[0],va):(T++,this.smoothScrollCellToVisible(ta[0],va,la)));null!=H&&null!=qa.explore&&Graph.exploreFromCell(this,H,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle)for(va=qa.tags.toggle,0==va.length&&(va=this.getAllTags()),ta=0;ta<va.length;ta++)this.toggleHiddenTag(va[ta]);va=null;null!=qa.tags.hidden&&(null==va&&(va=
-[]),va=va.concat(qa.tags.hidden));if(null!=qa.tags.visible)for(null==va&&(va=[]),Ha=this.getAllTags(),ta=0;ta<Ha.length;ta++)0>mxUtils.indexOf(qa.tags.visible,Ha[ta])&&0>mxUtils.indexOf(va,Ha[ta])&&va.push(Ha[ta]);null!=va&&this.setHiddenTags(va);this.refresh()}if(0<Ba.length){T++;ta=null!=qa.steps?qa.steps:30;va=qa.delay;Ha=["wipeIn","wipeOut","popIn","popOut"];La=null;for(Ia=0;Ia<Ha.length;Ia++)Ca=qa[Ha[Ia]],null!=Ca&&null!=Ca.delay&&(La=null==La?Ca.delay:Math.max(La,Ca.delay));null!=La&&(va=La/
-ta);this.executeAnimations(Ba,la,xa?1:ta,xa?0:va)}}while(W<k.length&&!0===k[W].immediate&&!this.stoppingCustomActions);0==T?sa():X()}else this.stoppingCustomActions=this.executingCustomActions=!1,X(),null!=u&&u()}),sa=mxUtils.bind(this,function(){try{ca()}catch(xa){throw this.stoppingCustomActions=this.executingCustomActions=!1,X(),xa;}});sa()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,u){var H=this.getLinkForCell(u);null!=H&&"data:action/json,"==H.substring(0,17)&&this.setLinkForCell(u,
-this.updateCustomLink(k,H));if(this.isHtmlLabel(u)){var P=document.createElement("div");P.innerHTML=Graph.sanitizeHtml(this.getLabel(u));for(var T=P.getElementsByTagName("a"),W=!1,fa=0;fa<T.length;fa++)H=T[fa].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(T[fa].setAttribute("href",this.updateCustomLink(k,H)),W=!0);W&&this.labelChanged(u,P.innerHTML)}};Graph.prototype.updateCustomLink=function(k,u){if("data:action/json,"==u.substring(0,17))try{var H=JSON.parse(u.substring(17));
-null!=H.actions&&(this.updateCustomLinkActions(k,H.actions),u="data:action/json,"+JSON.stringify(H))}catch(P){}return u};Graph.prototype.updateCustomLinkActions=function(k,u){for(var H=0;H<u.length;H++){var P=u[H],T;for(T in P)this.updateCustomLinkAction(k,P[T],"cells"),this.updateCustomLinkAction(k,P[T],"excludeCells"),this.updateCustomLinkAction(k,P[T],"layers")}};Graph.prototype.updateCustomLinkAction=function(k,u,H){if(null!=u&&null!=u[H]){for(var P=[],T=0;T<u[H].length;T++)if("*"==u[H][T])P.push(u[H][T]);
-else{var W=k[u[H][T]];null!=W?""!=W&&P.push(W):P.push(u[H][T])}u[H]=P}};Graph.prototype.getCellsForAction=function(k,u,H){var P="or"===k.tagsMatch?"or":"and",T={},W=[],fa=function(X){for(var ea=0;ea<X.length;ea++){var oa=X[ea].id;T[oa]||(T[oa]=!0,W.push(X[ea]))}};fa(this.getCellsById(k.cells));fa(this.getCellsForTags(k.tags,null,u,!1,P));fa(H?this.getLayerCells(k.layers):this.getCellsForLayers(k.layers));if(null!=k.excludeCells&&0<k.excludeCells.length){u={};P=!1;for(H=0;H<k.excludeCells.length;H++){if("*"===
-k.excludeCells[H]){P=!0;break}u[k.excludeCells[H]]=!0}if(P)return[];k=[];for(H=0;H<W.length;H++)u[W[H].id]||k.push(W[H]);return k}return W};Graph.prototype.getCellsById=function(k){var u=[];if(null!=k)for(var H=0;H<k.length;H++)if("*"==k[H]){var P=this.model.getRoot();u=u.concat(this.model.filterDescendants(function(W){return W!=P},P))}else{var T=this.model.getCell(k[H]);null!=T&&u.push(T)}return u};Graph.prototype.getCellsForLayers=function(k){var u=[];if(Array.isArray(k))for(var H=0;H<k.length;H++){var P=
-this.model.getCell(k[H]);null!=P&&(u=u.concat(this.model.filterDescendants(function(T){return T!=P},P)))}return u};Graph.prototype.getLayerCells=function(k){var u=[];if(Array.isArray(k))for(var H=0;H<k.length;H++){var P=this.model.getCell(k[H]);null!=P&&u.push(P)}return u};var ka=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return ka.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};
-Graph.prototype.toggleHiddenTag=function(k){var u=mxUtils.indexOf(this.hiddenTags,k);0>u?this.hiddenTags.push(k):0<=u&&this.hiddenTags.splice(u,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;for(var u=0;u<k.length;u++)if(0>mxUtils.indexOf(this.hiddenTags,k[u]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,u,H,
-P,T){var W=[];T="or"===T;if(null!=k){u=null!=u?u:this.model.getDescendants(this.model.getRoot());for(var fa=0,X={},ea=0;ea<k.length;ea++)0<k[ea].length&&(X[k[ea]]=!0,fa++);for(ea=0;ea<u.length;ea++)if(H&&this.model.getParent(u[ea])==this.model.root||this.model.isVertex(u[ea])||this.model.isEdge(u[ea])){var oa=this.getTagsForCell(u[ea]),la=!1;if(0<oa.length&&(oa=oa.split(" "),T||oa.length>=k.length)){for(var ca=la=0;ca<oa.length&&la<fa;ca++)null!=X[oa[ca]]&&la++;la=T?0<la:la==fa}la&&(1!=P||this.isCellVisible(u[ea]))&&
-W.push(u[ea])}}return W};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var u=null,H=[],P=0;P<k.length;P++){var T=this.getTagsForCell(k[P]);H=[];if(0<T.length){T=T.split(" ");for(var W={},fa=0;fa<T.length;fa++)if(null==u||null!=u[T[fa]])W[T[fa]]=!0,H.push(T[fa]);u=W}else return[]}return H};Graph.prototype.getTagsForCells=function(k){for(var u=[],H={},P=0;P<k.length;P++){var T=
-this.getTagsForCell(k[P]);if(0<T.length){T=T.split(" ");for(var W=0;W<T.length;W++)null==H[T[W]]&&(H[T[W]]=!0,u.push(T[W]))}}return u};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,u){if(0<k.length&&0<u.length){this.model.beginUpdate();try{for(var H=0;H<k.length;H++){for(var P=this.getTagsForCell(k[H]),T=P.split(" "),W=!1,fa=0;fa<u.length;fa++){var X=mxUtils.trim(u[fa]);""!=X&&0>mxUtils.indexOf(T,X)&&(P=0<P.length?
-P+" "+X:X,W=!0)}W&&this.setAttributeForCell(k[H],"tags",P)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,u){if(0<k.length&&0<u.length){this.model.beginUpdate();try{for(var H=0;H<k.length;H++){var P=this.getTagsForCell(k[H]);if(0<P.length){for(var T=P.split(" "),W=!1,fa=0;fa<u.length;fa++){var X=mxUtils.indexOf(T,u[fa]);0<=X&&(T.splice(X,1),W=!0)}W&&this.setAttributeForCell(k[H],"tags",T.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();
-try{for(var u=0;u<k.length;u++)this.model.setVisible(k[u],!this.model.isVisible(k[u]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,u){this.model.beginUpdate();try{for(var H=0;H<k.length;H++)this.model.setVisible(k[H],u)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,u,H,P){for(var T=0;T<k.length;T++)this.highlightCell(k[T],u,H,P)};Graph.prototype.highlightCell=function(k,u,H,P,T){u=null!=u?u:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;
-k=this.view.getState(k);var W=null;null!=k&&(T=null!=T?T:4,T=Math.max(T+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+T),W=new mxCellHighlight(this,u,T,!1),null!=P&&(W.opacity=P),W.highlight(k),window.setTimeout(function(){null!=W.shape&&(mxUtils.setPrefixedStyle(W.shape.node.style,"transition","all 1200ms ease-in-out"),W.shape.node.style.opacity=0);window.setTimeout(function(){W.destroy()},1200)},H));return W};Graph.prototype.addSvgShadow=function(k,u,H,P){P=null!=P?P:!0;var T=Math.ceil(this.svgShadowSize*
-this.svgShadowBlur);null!=H&&H||(u=null!=u?u:k.getElementsByTagName("g")[0],null!=u&&(this.updateShadowFilter(u,!0),!isNaN(parseInt(k.getAttribute("width")))&&P&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+T),k.setAttribute("height",parseInt(k.getAttribute("height"))+T),u=k.getAttribute("viewBox"),null!=u&&0<u.length&&(u=u.split(" "),3<u.length&&(w=parseFloat(u[2])+T,h=parseFloat(u[3])+T,k.setAttribute("viewBox",u[0]+" "+u[1]+" "+w+" "+h))))));return T};Graph.prototype.updateShadowFilter=
-function(k,u){mxClient.IS_SF||(u?(u=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),k.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+u.cssText+")"):k.style.filter="")};Graph.prototype.setShadowVisible=function(k,u){u=null!=u?u:!0;this.shadowVisible=k;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);u&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));
-return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),u=0;do var H=this.model.getChildAt(this.model.root,u);while(u++<k&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};
-mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=
-[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",
-STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];
-mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",
-STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];
-mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=
-[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",
-STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=
-[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate4=[SHAPES_PATH+
-"/mxArchiMate3.js",SHAPES_PATH+"/mxArchiMate4.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.atlassian2=
-[SHAPES_PATH+"/mxAtlassian2.js",STENCIL_PATH+"/atlassian2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];
-mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=
-[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(k){var u=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?u="mxgraph.er":"sysML"==k.substring(0,5)&&(u="mxgraph.sysml"));return u};var ua=mxMarker.createMarker;mxMarker.createMarker=function(k,u,H,P,T,W,fa,X,ea,oa){if(null!=H&&null==mxMarker.markers[H]){var la=this.getPackageForType(H);
-null!=la&&mxStencilRegistry.getStencil(la)}return ua.apply(this,arguments)};var Da=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,u,H,P,T,W){"1"==mxUtils.getValue(u.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(u.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return Da.apply(this,arguments)};PrintDialog.prototype.create=function(k,u,H,P){function T(){ta.value=Math.max(1,Math.min(sa,Math.max(parseInt(ta.value),parseInt(ma.value))));ma.value=Math.max(1,Math.min(sa,
-Math.min(parseInt(ta.value),parseInt(ma.value))))}function W(mb){k.lastPrintPagesRadioChecked=Ba.checked;k.lastPrintSelectionOnlyChecked=va.checked;k.lastPrintCropRadioChecked=La.checked;k.lastPrintFitRadioChecked=Ia.checked;Ba.checked&&ma.value<ta.value?(k.lastPrintPagesFromInput=ma.value,k.lastPrintPagesToInput=ta.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);cb.value=Math.max(1,Math.min(1600,parseInt(cb.value)))+"%";k.lastPrintZoom=cb.value;k.lastPrintBorder=Wa.value;k.lastPrintGrid=
-hb.checked;k.lastPrintShadow=wb.checked;k.lastPrintTransparent=Fa.checked;k.lastPrintInclude=Ra.checked;k.lastPrintIcons=$a.checked;k.lastPrintSheetsAcross=Ua.value;k.lastPrintSheetsDown=ab.value;var ub={};ub.border=parseInt(Wa.value);ub.scale=parseInt(cb.value)/100;ub.grid=hb.checked;ub.shadows=wb.checked;ub.transparent=Fa.checked;ub.includeCopy=Ra.checked;ub.icons=$a.checked&&EditorUi.isElectronApp;ub.sheetsAcross=parseInt(Ua.value);ub.sheetsDown=parseInt(ab.value);ub.pagesFrom=parseInt(ma.value);
-ub.pagesTo=parseInt(ta.value);ub.allPages=xa.checked;ub.selection=va.checked;ub.pageView=Ha.checked;ub.crop=La.checked;ub.fit=Ia.checked;return null!=H?H(!mb,ub):k.print(!mb,ub)}function fa(mb){try{k.hideDialog(),null!=H?W(mb):k.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{W(mb),k.spinner.stop()}catch(ub){k.handleError(ub)}},0)}catch(ub){k.handleError(ub)}}var X=k.editor.graph,ea=document.createElement("div");ea.style.display="flex";ea.style.flexDirection=
-"column";ea.style.minHeight="0";var oa=document.createElement("div");oa.style.flex="1 1 auto";oa.style.minHeight="0";oa.style.overflowY="auto";ea.appendChild(oa);var la=document.createElement("h3");mxUtils.write(la,u||mxResources.get("print"));oa.appendChild(la);var ca=1,sa=1;la=document.createElement("div");la.className="geDialogSection";la.style.whiteSpace="nowrap";var xa=document.createElement("input");xa.style.marginRight="8px";xa.setAttribute("type","radio");xa.setAttribute("name","pages-printdialog");
-xa.setAttribute("id","gePrintDlgAllPages");var qa=document.createElement("div");qa.className="geDialogCheckRow";qa.appendChild(xa);u=document.createElement("label");u.setAttribute("for","gePrintDlgAllPages");mxUtils.write(u,mxResources.get("allPages"));qa.appendChild(u);la.appendChild(qa);var Ba=document.createElement("input");Ba.style.marginRight="8px";Ba.setAttribute("type","radio");Ba.setAttribute("name","pages-printdialog");Ba.setAttribute("id","gePrintDlgPages");qa=document.createElement("div");
-qa.className="geDialogCheckRow";qa.appendChild(Ba);u=document.createElement("label");u.setAttribute("for","gePrintDlgPages");mxUtils.write(u,mxResources.get("pages")+":");qa.appendChild(u);var ma=document.createElement("input");ma.style.margin="0 4px";ma.setAttribute("value","1");ma.setAttribute("type","number");ma.setAttribute("min","1");ma.style.width="40px";qa.appendChild(ma);u=document.createElement("span");mxUtils.write(u,mxResources.get("to"));qa.appendChild(u);var ta=ma.cloneNode(!0);qa.appendChild(ta);
-mxEvent.addListener(ma,"focus",function(){Ba.checked=!0});mxEvent.addListener(ta,"focus",function(){Ba.checked=!0});mxEvent.addListener(ma,"change",T);mxEvent.addListener(ta,"change",T);if(null!=k.pages&&(sa=k.pages.length,null!=k.currentPage))for(u=0;u<sa;u++)if(k.currentPage==k.pages[u]){ca=u+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ma.value=Math.min(sa,Math.max(1,k.lastPrintPagesFromInput)),ta.value=Math.min(sa,Math.max(1,k.lastPrintPagesToInput))):(ma.value=ca,ta.value=
-ca);ma.setAttribute("max",sa);ta.setAttribute("max",sa);u=mxUtils.button(mxResources.get("currentPage"),function(mb){ma.value=ca;ta.value=ca;Ba.checked=!0});u.className="geBtn";u.setAttribute("title",mxResources.get("currentPage"));u.style.marginLeft="4px";u.style.maxWidth="100px";qa.appendChild(u);la.appendChild(qa);1<sa&&oa.appendChild(la);qa=document.createElement("div");qa.className="geDialogCheckRow";var va=document.createElement("input");va.setAttribute("name","pages-printdialog");va.setAttribute("type",
-1==sa?"checkbox":"radio");va.setAttribute("id","gePrintDlgSelectionOnly");va.style.marginRight="8px";X.isSelectionEmpty()&&va.setAttribute("disabled","disabled");X.isEnabled()&&(qa.appendChild(va),u=document.createElement("label"),u.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(u,mxResources.get("selectionOnly")),qa.appendChild(u));X.isEnabled()&&(1<sa?la.appendChild(qa):(u=document.createElement("div"),u.className="geDialogSection",u.appendChild(qa),oa.appendChild(u)));!k.isPagesEnabled()||
-k.lastPrintPagesRadioChecked?Ba.checked=!0:!X.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?va.checked=!0:xa.checked=!0;X=k.addAdvancedSection(oa);oa=X.content;la=document.createElement("div");la.className="geDialogCheckRow";var Ha=document.createElement("input");Ha.style.marginRight="8px";Ha.setAttribute("type","radio");Ha.setAttribute("name","printSize");Ha.setAttribute("id","gePrintDlgPageView");la.appendChild(Ha);u=document.createElement("label");u.setAttribute("for","gePrintDlgPageView");
-mxUtils.write(u,mxResources.get("pageView"));la.appendChild(u);mxEvent.addListener(la,"click",function(){Ha.checked=!0});oa.appendChild(la);la=document.createElement("div");la.className="geDialogCheckRow";var La=document.createElement("input");La.style.marginRight="8px";La.setAttribute("type","radio");La.setAttribute("name","printSize");La.setAttribute("id","gePrintDlgCrop");la.appendChild(La);u=document.createElement("label");u.setAttribute("for","gePrintDlgCrop");mxUtils.write(u,mxResources.get("crop"));
-la.appendChild(u);mxEvent.addListener(la,"click",function(){La.checked=!0});oa.appendChild(la);la=document.createElement("div");la.className="geDialogCheckRow";la.style.alignItems="flex-start";var Ia=document.createElement("input");Ia.style.marginTop="4px";Ia.setAttribute("type","radio");Ia.setAttribute("name","printSize");la.appendChild(Ia);qa=document.createElement("table");qa.style.display="inline-block";qa.style.borderSpacing="0";var Ca=document.createElement("tbody"),Pa=document.createElement("tr"),
-Ka=Pa.cloneNode(!0),Na=document.createElement("td"),Oa=Na.cloneNode(!0),Ea=Na.cloneNode(!0),Aa=Na.cloneNode(!0),Ja=Na.cloneNode(!0),Ga=Na.cloneNode(!0);Na.style.textAlign="right";Aa.style.textAlign="right";mxUtils.write(Na,mxResources.get("fitTo"));mxEvent.addListener(la,"click",function(mb){mxEvent.getSource(mb)!=Ia&&(Ia.checked=!Ia.checked)});var Ua=document.createElement("input");Ua.style.margin="0 2px";Ua.style.boxSizing="border-box";Ua.setAttribute("value",k.lastPrintSheetsAcross||"1");Ua.setAttribute("min",
-"1");Ua.setAttribute("type","number");Ua.style.width="40px";Oa.appendChild(Ua);u=document.createElement("span");mxUtils.write(u,mxResources.get("fitToSheetsAcross"));Ea.appendChild(u);mxUtils.write(Aa,mxResources.get("fitToBy"));var ab=Ua.cloneNode(!0);ab.setAttribute("value",k.lastPrintSheetsDown||"1");Ja.appendChild(ab);mxEvent.addListener(Ua,"click",function(mb){Ia.checked=!0;mxEvent.consume(mb)});mxEvent.addListener(ab,"click",function(mb){Ia.checked=!0;mxEvent.consume(mb)});k.lastPrintCropRadioChecked?
-La.checked=!0:k.lastPrintFitRadioChecked?Ia.checked=!0:Ha.checked=!0;u=document.createElement("span");mxUtils.write(u,mxResources.get("fitToSheetsDown"));Ga.appendChild(u);Pa.appendChild(Na);Pa.appendChild(Oa);Pa.appendChild(Ea);Ka.appendChild(Aa);Ka.appendChild(Ja);Ka.appendChild(Ga);Ca.appendChild(Pa);Ca.appendChild(Ka);qa.appendChild(Ca);la.appendChild(qa);oa.appendChild(la);oa=document.createElement("div");oa.className="geDialogSection";u=document.createElement("div");u.className="geDialogFormRow";
-la=document.createElement("label");la.className="geDialogFormLabel";la.setAttribute("for","gePrintDlgBorder");mxUtils.write(la,mxResources.get("borderWidth"));u.appendChild(la);var Wa=document.createElement("input");Wa.setAttribute("type","number");Wa.setAttribute("min","0");Wa.setAttribute("id","gePrintDlgBorder");Wa.style.width="40px";Wa.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;u.appendChild(Wa);la=document.createElement("label");la.setAttribute("for",
-"gePrintDlgZoom");la.style.marginLeft="12px";la.style.marginRight="4px";mxUtils.write(la,mxResources.get("zoom"));u.appendChild(la);var cb=document.createElement("input");cb.setAttribute("id","gePrintDlgZoom");cb.style.width="60px";cb.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";u.appendChild(cb);oa.appendChild(u);la=document.createElement("div");la.className="geDialogCheckRow";var hb=document.createElement("input");hb.setAttribute("type","checkbox");hb.setAttribute("id","gePrintDlgGrid");hb.style.marginRight=
-"8px";hb.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;la.appendChild(hb);u=document.createElement("label");u.setAttribute("for","gePrintDlgGrid");mxUtils.write(u,mxResources.get("grid"));la.appendChild(u);oa.appendChild(la);la=document.createElement("div");la.className="geDialogCheckRow";var wb=document.createElement("input");wb.setAttribute("type","checkbox");wb.setAttribute("id","gePrintDlgShadows");wb.style.marginRight="8px";wb.checked=null!=k.lastPrintShadow?k.lastPrintShadow:!1;la.appendChild(wb);
-u=document.createElement("label");u.setAttribute("for","gePrintDlgShadows");mxUtils.write(u,mxResources.get("shadows"));la.appendChild(u);k.isOffline()&&!mxClient.IS_CHROMEAPP||la.appendChild(k.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(la.style.display="none");oa.appendChild(la);var Fa=document.createElement("input");Fa.setAttribute("type","checkbox");Fa.setAttribute("id","gePrintDlgTransparent");Fa.style.marginRight=
-"8px";Fa.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=H&&(la=document.createElement("div"),la.className="geDialogCheckRow",la.appendChild(Fa),u=document.createElement("label"),u.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(u,mxResources.get("transparentBackground")),la.appendChild(u),oa.appendChild(la));var Ra=document.createElement("input");Ra.setAttribute("type","checkbox");Ra.setAttribute("id","gePrintDlgInclude");Ra.style.marginRight="8px";Ra.checked=null!=
-k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(la=document.createElement("div"),la.className="geDialogCheckRow",la.appendChild(Ra),u=document.createElement("label"),u.setAttribute("for","gePrintDlgInclude"),mxUtils.write(u,mxResources.get("includeCopyOfMyDiagram")),la.appendChild(u),oa.appendChild(la));var $a=document.createElement("input");$a.setAttribute("type","checkbox");$a.setAttribute("id","gePrintDlgIcons");
-$a.style.marginRight="8px";$a.checked=null!=k.lastPrintIcons?k.lastPrintIcons:!1;null!=H&&EditorUi.isElectronApp&&(la=document.createElement("div"),la.className="geDialogCheckRow",la.appendChild($a),u=document.createElement("label"),u.setAttribute("for","gePrintDlgIcons"),mxUtils.write(u,mxResources.get("notes")),la.appendChild(u),oa.appendChild(la));X.wrapper.appendChild(oa);u=document.createElement("div");u.style.flex="0 0 auto";u.style.marginTop="16px";u.style.textAlign="right";u.style.whiteSpace=
-"nowrap";k.isOffline()&&!mxClient.IS_CHROMEAPP||null!=H||u.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));X=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});X.className="geBtn";k.editor.cancelFirst&&u.appendChild(X);PrintDialog.previewEnabled&&null==H&&(oa=mxUtils.button(mxResources.get("preview"),function(){fa(!1)}),oa.className="geBtn",u.appendChild(oa));P=null!=P?P:null!=H?"export":PrintDialog.previewEnabled?"print":"ok";P=mxUtils.button(mxResources.get(P),
-function(){fa(!0)});P.className="geBtn gePrimaryBtn";u.appendChild(P);k.editor.cancelFirst||u.appendChild(X);ea.appendChild(u);if(k.editor.isChromelessView()){var fb=function(){Editor.isDarkMode()?(ea.classList.add("geDarkMode"),ea.style.colorScheme="dark"):(ea.classList.remove("geDarkMode"),ea.style.colorScheme="light")};k.addListener("darkModeChanged",fb);fb();var rb=function(mb,ub){mb=ub.getProperty("dialog");ea.parentNode==mb.container&&(k.editor.removeListener(rb),k.removeListener(fb))};k.editor.addListener("hideDialog",
-rb)}this.container=ea};var ha=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=
-this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ha.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,
-this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(k){var u=[];if(null==k)return u;var H=function(ea){if(null!=ea)return ea=parseFloat(ea),!isNaN(ea)&&0<=ea?ea:void 0},P={fade:!0,pop:!0,wipe:!0};k=k.split("\n");for(var T=0;T<k.length;T++){var W=
-mxUtils.trim(k[T]);if(""!=W&&"#"!=W.charAt(0)){W=W.split(/\s+/);var fa={action:W[0],cell:W[1],arg:W[2]};if("wait"==fa.action){if(fa.delay=parseFloat(fa.cell),isNaN(fa.delay)||0>fa.delay)fa.delay=1E3}else if("setOpacity"==fa.action)fa.opacity=parseFloat(W[2]),isNaN(fa.opacity)&&(fa.opacity=1),fa.opacity=Math.max(0,Math.min(1,fa.opacity)),fa.duration=H(W[3]),fa.arg=void 0;else if("show"==fa.action){if(null!=fa.arg&&!P[fa.arg]){var X=H(fa.arg);null!=X&&(fa.duration=X,fa.arg=void 0)}null==fa.duration&&
-(fa.duration=H(W[3]))}else"hide"==fa.action&&(fa.duration=H(W[2]),fa.arg=void 0);u.push(fa)}}return u};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(k,u){return k.action!=u.action||"wait"==k.action||(k.arg||"")!=(u.arg||"")||(null!=k.opacity?k.opacity:"")!=(null!=u.opacity?u.opacity:"")||(null!=k.duration?k.duration:"")!=(null!=u.duration?u.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(k){if("wait"==k.action)return{wait:k.delay};var u="all"==k.cell?"*":k.cell;
-if(null==u)return null;var H={cells:[u]};if(null!=k.duration)H.delay=k.duration;else if("show"==k.action&&"fade"==k.arg)H.delay=Editor.animationFadeDelay;else if("hide"==k.action||"setOpacity"==k.action)H.delay=Editor.animationFadeDelay;return"show"==k.action?"fade"==k.arg?{fadeIn:H}:"pop"==k.arg?{popIn:H}:{wipeIn:H}:"hide"==k.action?{fadeOut:H}:"setOpacity"==k.action?(H.value=k.opacity,{fadeTo:H}):"flow"==k.action?(u={cells:[u]},"start"==k.arg?u.start=!0:"stop"==k.arg&&(u.start=!1),{flow:u}):null};
-Editor.convertLegacyAnimation=function(k){k=Editor.parseAnimationScript(k);for(var u=[{opacity:{cells:["*"],value:0}}],H=null,P=function(){null!=H&&(u.push(H),H=null)},T=function(X){null==H&&(H={});for(var ea in X){var oa=X[ea],la;if(la=null!=H[ea]&&null!=oa&&Array.isArray(H[ea].cells)&&Array.isArray(oa.cells))la=H[ea],la=la.delay===oa.delay&&la.value===oa.value&&la.start===oa.start;if(la)for(la=0;la<oa.cells.length;la++)H[ea].cells.push(oa.cells[la]);else null!=H[ea]&&(P(),H={}),H[ea]=oa}},W=0;W<
-k.length;W++){var fa=Editor.convertLegacyAnimationStep(k[W]);null!=fa&&(null!=fa.wait?(P(),u.push(fa)):T(fa))}P();return{animation:{steps:u}}};Editor.parseAnimationData=function(k){var u=function(P){null==P&&(P={});Array.isArray(P.steps)||(P.steps=[]);P.loop=null==P.loop?!0:!!P.loop;P.enabled=null==P.enabled?!0:!!P.enabled;return P};if(null==k||""===k)return u({steps:[]});if("string"==typeof k){var H=mxUtils.trim(k);return"{"==H.charAt(0)||"["==H.charAt(0)?Editor.parseAnimationData(JSON.parse(H)):
-u(Editor.convertLegacyAnimation(k).animation)}return null!=k.animation&&null!=k.animation.steps?u(k.animation):Array.isArray(k.steps)?u(k):u({steps:[]})};Editor.AnimationPlayer=function(k,u){this.graph=k;this.data=Editor.parseAnimationData(u);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(k){var u=[],H;for(H in k.cells){var P=k.cells[H];(k.isVertex(P)||k.isEdge(P))&&u.push(P)}return u};Editor.AnimationPlayer.prototype.collectReferencedCells=
-function(){for(var k=this.data.steps||[],u={},H=[],P=0;P<k.length;P++){var T=k[P],W;for(W in T)if("wait"!=W&&"open"!=W){var fa=T[W];if("object"===typeof fa&&null!=fa){fa=this.graph.getCellsForAction(fa,!0);for(var X=0;X<fa.length;X++)u[fa[X].id]||(u[fa[X].id]=!0,H.push(fa[X]))}}}return H};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var k=this.collectReferencedCells();k=this.graph.getNodesForCells(k);this.snapshot=[];for(var u=0;u<k.length;u++)this.snapshot.push({node:k[u],opacity:k[u].style.opacity})};
-Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var k=0;k<this.snapshot.length;k++)Graph.setTransitionForNodes([this.snapshot[k].node],null),this.snapshot[k].node.style.opacity=this.snapshot[k].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(k){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){k=k||{};this.running=!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var u=this,H=this.data.steps||
-[],P=function(W,fa){if(null==u.graph||u.graph.isGraphTornDown())u.running=!1;else if(u.cancelled||W>=H.length)fa();else{for(var X=W+1;X<H.length&&!0===H[X].immediate&&!u.cancelled;)X++;if("function"==typeof k.onStep)try{k.onStep(W,X)}catch(ea){}u.graph.executeCustomActions(Graph.flattenAnimationActions(H.slice(W,X)),function(){P(X,fa)},null)}},T=function(){null==u.graph||u.graph.isGraphTornDown()?u.running=!1:u.cancelled?(u.restoreOpacity(),u.running=!1):(u.snapshotOpacity(),P(0,function(){if(u.cancelled)u.restoreOpacity(),
-u.running=!1;else{if("function"==typeof k.onStep)try{k.onStep(-1)}catch(W){}k.loop?(u.graph.refresh(),u.restoreOpacity(),window.setTimeout(T,0)):(u.running=!1,u.restoreOpacity(),null!=k.done&&k.done())}}))};k.defer?window.setTimeout(T,0):T()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var k=[],u=this.collectReferencedCells(),H=0;H<u.length;H++)this.graph.getModel().isEdge(u[H])&&k.push(u[H]);0<k.length&&Editor.toggleFlowAnimation(this.graph,
-k,"stop")};Editor.toggleFlowAnimation=function(k,u,H){H=H||"toggle";for(var P=0;P<u.length;P++)if(k.getModel().isEdge(u[P])){var T=k.view.getState(u[P]);if(null!=T&&null!=T.shape){var W=null!=T.shape.getFlowAnimationPath?T.shape.getFlowAnimationPath():null;if(null!=W){var fa="mxEdgeFlow"==W.getAttribute("class"),X="start"==H||"toggle"==H&&!fa;fa="stop"==H||"toggle"==H&&fa;T="1"==mxUtils.getValue(T.style,mxConstants.STYLE_DASHED,"0");fa?(W.removeAttribute("class"),T||W.removeAttribute("stroke-dasharray")):
-X&&(W.setAttribute("class","mxEdgeFlow"),T||W.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(k,u){var H=k.getModel().getRoot(),P=null;null!=H.value&&"object"==typeof H.value&&(P=H.value.getAttribute("animation"));if(null==P||""==P)return null;try{var T=Editor.parseAnimationData(P)}catch(fa){return null}if(!T.steps||0==T.steps.length||!1===T.enabled)return null;H={};if(null!=u)for(var W in u)H[W]=u[W];null==H.loop&&(H.loop=T.loop);null==H.defer&&(H.defer=!0);k=new Editor.AnimationPlayer(k,
-T);k.play(H);return k};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var k=document.createElement("style");k.type="text/css";k.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));document.getElementsByTagName("head")[0].appendChild(k)}catch(u){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="31.4.5";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",
+this.getCellsForAction(qa.toggleStyle,!0);var va=qa.toggleStyle.value,Ga=""!==qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:null;oa(qa.toggleStyle)?this.toggleCellStylesTransient(qa.toggleStyle.key,Ga,ta,va):(fa(),this.toggleCellStyleValues(qa.toggleStyle.key,va,Ga,ta))}null!=qa.style&&null!=qa.style.key&&(ta=this.getCellsForAction(qa.style,!0),oa(qa.style)?this.setCellStylesTransient(qa.style.key,qa.style.value,ta):(fa(),this.setCellStyles(qa.style.key,qa.style.value,ta)));ta=[];null!=
+qa.select&&this.isEnabled()&&(ta=this.getCellsForAction(qa.select),this.setSelectionCells(ta));null!=qa.highlight&&(ta=this.getCellsForAction(qa.highlight),this.highlightCells(ta,qa.highlight.color,qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ta=this.getCellsForAction(qa.scroll));if(null!=qa.viewbox){va=qa.viewbox;if(null!=va.cells||null!=va.tags||null!=va.layers)if(Ga=this.getBoundingBox(this.getCellsForAction(va)),null!=Ga){var La=this.useCssTransforms?1:this.view.scale,Ia=this.useCssTransforms?
+new mxPoint(0,0):this.view.translate,Ca=null==va.border||""===va.border||isNaN(parseFloat(va.border))?null:2*parseFloat(va.border);va={x:Ga.x/La-Ia.x,y:Ga.y/La-Ia.y,width:Math.max(1,Ga.width/La),height:Math.max(1,Ga.height/La),border:Ca,smooth:va.smooth}}else va=null;null!=va&&(!0!==va.smooth||xa?this.useCssTransforms?this.fitBoundsCssTransform(va,va.border):this.fitWindow(va,va.border):(U++,this.smoothFitWindow(va,va.border,ka)))}0<ta.length&&(va=null==qa.scroll||null==qa.scroll.border||""===qa.scroll.border||
+isNaN(parseFloat(qa.scroll.border))?null:parseFloat(qa.scroll.border),null==qa.scroll||!0!==qa.scroll.smooth||xa?this.useCssTransforms?this.scrollCellToVisibleCssTransform(ta[0],va):this.scrollCellToVisibleBorder(ta[0],va):(U++,this.smoothScrollCellToVisible(ta[0],va,ka)));null!=H&&null!=qa.explore&&Graph.exploreFromCell(this,H,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle)for(va=qa.tags.toggle,0==va.length&&(va=this.getAllTags()),ta=0;ta<va.length;ta++)this.toggleHiddenTag(va[ta]);va=null;
+null!=qa.tags.hidden&&(null==va&&(va=[]),va=va.concat(qa.tags.hidden));if(null!=qa.tags.visible)for(null==va&&(va=[]),Ga=this.getAllTags(),ta=0;ta<Ga.length;ta++)0>mxUtils.indexOf(qa.tags.visible,Ga[ta])&&0>mxUtils.indexOf(va,Ga[ta])&&va.push(Ga[ta]);null!=va&&this.setHiddenTags(va);this.refresh()}if(0<Ba.length){U++;ta=null!=qa.steps?qa.steps:30;va=qa.delay;Ga=["wipeIn","wipeOut","popIn","popOut"];La=null;for(Ia=0;Ia<Ga.length;Ia++)Ca=qa[Ga[Ia]],null!=Ca&&null!=Ca.delay&&(La=null==La?Ca.delay:Math.max(La,
+Ca.delay));null!=La&&(va=La/ta);this.executeAnimations(Ba,ka,xa?1:ta,xa?0:va)}}while(W<k.length&&!0===k[W].immediate&&!this.stoppingCustomActions);0==U?sa():X()}else this.stoppingCustomActions=this.executingCustomActions=!1,X(),null!=u&&u()}),sa=mxUtils.bind(this,function(){try{ba()}catch(xa){throw this.stoppingCustomActions=this.executingCustomActions=!1,X(),xa;}});sa()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,u){var H=this.getLinkForCell(u);null!=H&&"data:action/json,"==H.substring(0,
+17)&&this.setLinkForCell(u,this.updateCustomLink(k,H));if(this.isHtmlLabel(u)){var P=document.createElement("div");P.innerHTML=Graph.sanitizeHtml(this.getLabel(u));for(var U=P.getElementsByTagName("a"),W=!1,fa=0;fa<U.length;fa++)H=U[fa].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(U[fa].setAttribute("href",this.updateCustomLink(k,H)),W=!0);W&&this.labelChanged(u,P.innerHTML)}};Graph.prototype.updateCustomLink=function(k,u){if("data:action/json,"==u.substring(0,17))try{var H=
+JSON.parse(u.substring(17));null!=H.actions&&(this.updateCustomLinkActions(k,H.actions),u="data:action/json,"+JSON.stringify(H))}catch(P){}return u};Graph.prototype.updateCustomLinkActions=function(k,u){for(var H=0;H<u.length;H++){var P=u[H],U;for(U in P)this.updateCustomLinkAction(k,P[U],"cells"),this.updateCustomLinkAction(k,P[U],"excludeCells"),this.updateCustomLinkAction(k,P[U],"layers")}};Graph.prototype.updateCustomLinkAction=function(k,u,H){if(null!=u&&null!=u[H]){for(var P=[],U=0;U<u[H].length;U++)if("*"==
+u[H][U])P.push(u[H][U]);else{var W=k[u[H][U]];null!=W?""!=W&&P.push(W):P.push(u[H][U])}u[H]=P}};Graph.prototype.getCellsForAction=function(k,u,H){var P="or"===k.tagsMatch?"or":"and",U={},W=[],fa=function(X){for(var ea=0;ea<X.length;ea++){var oa=X[ea].id;U[oa]||(U[oa]=!0,W.push(X[ea]))}};fa(this.getCellsById(k.cells));fa(this.getCellsForTags(k.tags,null,u,!1,P));fa(H?this.getLayerCells(k.layers):this.getCellsForLayers(k.layers));if(!0===k.descendants)for(H=W.slice(),u=0;u<H.length;u++)fa(this.model.getDescendants(H[u]));
+if(null!=k.excludeCells&&0<k.excludeCells.length){fa={};H=!1;for(u=0;u<k.excludeCells.length;u++){if("*"===k.excludeCells[u]){H=!0;break}fa[k.excludeCells[u]]=!0}if(H)return[];k=[];for(u=0;u<W.length;u++)fa[W[u].id]||k.push(W[u]);return k}return W};Graph.prototype.getCellsById=function(k){var u=[];if(null!=k)for(var H=0;H<k.length;H++)if("*"==k[H]){var P=this.model.getRoot();u=u.concat(this.model.filterDescendants(function(W){return W!=P},P))}else{var U=this.model.getCell(k[H]);null!=U&&u.push(U)}return u};
+Graph.prototype.getCellsForLayers=function(k){var u=[];if(Array.isArray(k))for(var H=0;H<k.length;H++){var P=this.model.getCell(k[H]);null!=P&&(u=u.concat(this.model.filterDescendants(function(U){return U!=P},P)))}return u};Graph.prototype.getLayerCells=function(k){var u=[];if(Array.isArray(k))for(var H=0;H<k.length;H++){var P=this.model.getCell(k[H]);null!=P&&u.push(P)}return u};var la=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return la.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(k))};
+Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var u=mxUtils.indexOf(this.hiddenTags,k);0>u?this.hiddenTags.push(k):0<=u&&this.hiddenTags.splice(u,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;for(var u=0;u<k.length;u++)if(0>
+mxUtils.indexOf(this.hiddenTags,k[u]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,u,H,P,U){var W=[];U="or"===U;if(null!=k){u=null!=u?u:this.model.getDescendants(this.model.getRoot());for(var fa=0,X={},ea=0;ea<k.length;ea++)0<k[ea].length&&(X[k[ea]]=!0,fa++);for(ea=0;ea<u.length;ea++)if(H&&this.model.getParent(u[ea])==this.model.root||this.model.isVertex(u[ea])||this.model.isEdge(u[ea])){var oa=this.getTagsForCell(u[ea]),ka=!1;if(0<oa.length&&(oa=oa.split(" "),U||oa.length>=k.length)){for(var ba=
+ka=0;ba<oa.length&&ka<fa;ba++)null!=X[oa[ba]]&&ka++;ka=U?0<ka:ka==fa}ka&&(1!=P||this.isCellVisible(u[ea]))&&W.push(u[ea])}}return W};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var u=null,H=[],P=0;P<k.length;P++){var U=this.getTagsForCell(k[P]);H=[];if(0<U.length){U=U.split(" ");for(var W={},fa=0;fa<U.length;fa++)if(null==u||null!=u[U[fa]])W[U[fa]]=!0,H.push(U[fa]);u=W}else return[]}return H};
+Graph.prototype.getTagsForCells=function(k){for(var u=[],H={},P=0;P<k.length;P++){var U=this.getTagsForCell(k[P]);if(0<U.length){U=U.split(" ");for(var W=0;W<U.length;W++)null==H[U[W]]&&(H[U[W]]=!0,u.push(U[W]))}}return u};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,u){if(0<k.length&&0<u.length){this.model.beginUpdate();try{for(var H=0;H<k.length;H++){for(var P=this.getTagsForCell(k[H]),U=P.split(" "),W=!1,fa=
+0;fa<u.length;fa++){var X=mxUtils.trim(u[fa]);""!=X&&0>mxUtils.indexOf(U,X)&&(P=0<P.length?P+" "+X:X,W=!0)}W&&this.setAttributeForCell(k[H],"tags",P)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,u){if(0<k.length&&0<u.length){this.model.beginUpdate();try{for(var H=0;H<k.length;H++){var P=this.getTagsForCell(k[H]);if(0<P.length){for(var U=P.split(" "),W=!1,fa=0;fa<u.length;fa++){var X=mxUtils.indexOf(U,u[fa]);0<=X&&(U.splice(X,1),W=!0)}W&&this.setAttributeForCell(k[H],
+"tags",U.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var u=0;u<k.length;u++)this.model.setVisible(k[u],!this.model.isVisible(k[u]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,u){this.model.beginUpdate();try{for(var H=0;H<k.length;H++)this.model.setVisible(k[H],u)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,u,H,P){for(var U=0;U<k.length;U++)this.highlightCell(k[U],
+u,H,P)};Graph.prototype.highlightCell=function(k,u,H,P,U){u=null!=u?u:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;k=this.view.getState(k);var W=null;null!=k&&(U=null!=U?U:4,U=Math.max(U+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+U),W=new mxCellHighlight(this,u,U,!1),null!=P&&(W.opacity=P),W.highlight(k),window.setTimeout(function(){null!=W.shape&&(mxUtils.setPrefixedStyle(W.shape.node.style,"transition","all 1200ms ease-in-out"),W.shape.node.style.opacity=0);window.setTimeout(function(){W.destroy()},
+1200)},H));return W};Graph.prototype.addSvgShadow=function(k,u,H,P){P=null!=P?P:!0;var U=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=H&&H||(u=null!=u?u:k.getElementsByTagName("g")[0],null!=u&&(this.updateShadowFilter(u,!0),!isNaN(parseInt(k.getAttribute("width")))&&P&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+U),k.setAttribute("height",parseInt(k.getAttribute("height"))+U),u=k.getAttribute("viewBox"),null!=u&&0<u.length&&(u=u.split(" "),3<u.length&&(w=parseFloat(u[2])+U,
+h=parseFloat(u[3])+U,k.setAttribute("viewBox",u[0]+" "+u[1]+" "+w+" "+h))))));return U};Graph.prototype.updateShadowFilter=function(k,u){mxClient.IS_SF||(u?(u=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),k.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+u.cssText+")"):k.style.filter="")};Graph.prototype.setShadowVisible=function(k,u){u=null!=u?u:!0;this.shadowVisible=
+k;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);u&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),u=0;do var H=this.model.getChildAt(this.model.root,
+u);while(u++<k&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=
+[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",
+STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",
+STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=
+[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=
+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=
+[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];
+mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+
+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=
+[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate4=[SHAPES_PATH+"/mxArchiMate3.js",SHAPES_PATH+"/mxArchiMate4.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",
+STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.atlassian2=[SHAPES_PATH+"/mxAtlassian2.js",STENCIL_PATH+"/atlassian2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+
+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
+[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(k){var u=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?u="mxgraph.er":"sysML"==k.substring(0,5)&&(u="mxgraph.sysml"));return u};var ua=mxMarker.createMarker;mxMarker.createMarker=function(k,u,H,P,U,W,
+fa,X,ea,oa){if(null!=H&&null==mxMarker.markers[H]){var ka=this.getPackageForType(H);null!=ka&&mxStencilRegistry.getStencil(ka)}return ua.apply(this,arguments)};var Da=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,u,H,P,U,W){"1"==mxUtils.getValue(u.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(u.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return Da.apply(this,arguments)};PrintDialog.prototype.create=function(k,u,H,P){function U(){ta.value=Math.max(1,Math.min(sa,
+Math.max(parseInt(ta.value),parseInt(ma.value))));ma.value=Math.max(1,Math.min(sa,Math.min(parseInt(ta.value),parseInt(ma.value))))}function W(mb){k.lastPrintPagesRadioChecked=Ba.checked;k.lastPrintSelectionOnlyChecked=va.checked;k.lastPrintCropRadioChecked=La.checked;k.lastPrintFitRadioChecked=Ia.checked;Ba.checked&&ma.value<ta.value?(k.lastPrintPagesFromInput=ma.value,k.lastPrintPagesToInput=ta.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);cb.value=Math.max(1,Math.min(1600,
+parseInt(cb.value)))+"%";k.lastPrintZoom=cb.value;k.lastPrintBorder=Wa.value;k.lastPrintGrid=hb.checked;k.lastPrintShadow=wb.checked;k.lastPrintTransparent=Fa.checked;k.lastPrintInclude=Ra.checked;k.lastPrintIcons=$a.checked;k.lastPrintSheetsAcross=Ua.value;k.lastPrintSheetsDown=ab.value;var ub={};ub.border=parseInt(Wa.value);ub.scale=parseInt(cb.value)/100;ub.grid=hb.checked;ub.shadows=wb.checked;ub.transparent=Fa.checked;ub.includeCopy=Ra.checked;ub.icons=$a.checked&&EditorUi.isElectronApp;ub.sheetsAcross=
+parseInt(Ua.value);ub.sheetsDown=parseInt(ab.value);ub.pagesFrom=parseInt(ma.value);ub.pagesTo=parseInt(ta.value);ub.allPages=xa.checked;ub.selection=va.checked;ub.pageView=Ga.checked;ub.crop=La.checked;ub.fit=Ia.checked;return null!=H?H(!mb,ub):k.print(!mb,ub)}function fa(mb){try{k.hideDialog(),null!=H?W(mb):k.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{W(mb),k.spinner.stop()}catch(ub){k.handleError(ub)}},0)}catch(ub){k.handleError(ub)}}var X=
+k.editor.graph,ea=document.createElement("div");ea.style.display="flex";ea.style.flexDirection="column";ea.style.minHeight="0";var oa=document.createElement("div");oa.style.flex="1 1 auto";oa.style.minHeight="0";oa.style.overflowY="auto";ea.appendChild(oa);var ka=document.createElement("h3");mxUtils.write(ka,u||mxResources.get("print"));oa.appendChild(ka);var ba=1,sa=1;ka=document.createElement("div");ka.className="geDialogSection";ka.style.whiteSpace="nowrap";var xa=document.createElement("input");
+xa.style.marginRight="8px";xa.setAttribute("type","radio");xa.setAttribute("name","pages-printdialog");xa.setAttribute("id","gePrintDlgAllPages");var qa=document.createElement("div");qa.className="geDialogCheckRow";qa.appendChild(xa);u=document.createElement("label");u.setAttribute("for","gePrintDlgAllPages");mxUtils.write(u,mxResources.get("allPages"));qa.appendChild(u);ka.appendChild(qa);var Ba=document.createElement("input");Ba.style.marginRight="8px";Ba.setAttribute("type","radio");Ba.setAttribute("name",
+"pages-printdialog");Ba.setAttribute("id","gePrintDlgPages");qa=document.createElement("div");qa.className="geDialogCheckRow";qa.appendChild(Ba);u=document.createElement("label");u.setAttribute("for","gePrintDlgPages");mxUtils.write(u,mxResources.get("pages")+":");qa.appendChild(u);var ma=document.createElement("input");ma.style.margin="0 4px";ma.setAttribute("value","1");ma.setAttribute("type","number");ma.setAttribute("min","1");ma.style.width="40px";qa.appendChild(ma);u=document.createElement("span");
+mxUtils.write(u,mxResources.get("to"));qa.appendChild(u);var ta=ma.cloneNode(!0);qa.appendChild(ta);mxEvent.addListener(ma,"focus",function(){Ba.checked=!0});mxEvent.addListener(ta,"focus",function(){Ba.checked=!0});mxEvent.addListener(ma,"change",U);mxEvent.addListener(ta,"change",U);if(null!=k.pages&&(sa=k.pages.length,null!=k.currentPage))for(u=0;u<sa;u++)if(k.currentPage==k.pages[u]){ba=u+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ma.value=Math.min(sa,Math.max(1,k.lastPrintPagesFromInput)),
+ta.value=Math.min(sa,Math.max(1,k.lastPrintPagesToInput))):(ma.value=ba,ta.value=ba);ma.setAttribute("max",sa);ta.setAttribute("max",sa);u=mxUtils.button(mxResources.get("currentPage"),function(mb){ma.value=ba;ta.value=ba;Ba.checked=!0});u.className="geBtn";u.setAttribute("title",mxResources.get("currentPage"));u.style.marginLeft="4px";u.style.maxWidth="100px";qa.appendChild(u);ka.appendChild(qa);1<sa&&oa.appendChild(ka);qa=document.createElement("div");qa.className="geDialogCheckRow";var va=document.createElement("input");
+va.setAttribute("name","pages-printdialog");va.setAttribute("type",1==sa?"checkbox":"radio");va.setAttribute("id","gePrintDlgSelectionOnly");va.style.marginRight="8px";X.isSelectionEmpty()&&va.setAttribute("disabled","disabled");X.isEnabled()&&(qa.appendChild(va),u=document.createElement("label"),u.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(u,mxResources.get("selectionOnly")),qa.appendChild(u));X.isEnabled()&&(1<sa?ka.appendChild(qa):(u=document.createElement("div"),u.className="geDialogSection",
+u.appendChild(qa),oa.appendChild(u)));!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?Ba.checked=!0:!X.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?va.checked=!0:xa.checked=!0;X=k.addAdvancedSection(oa);oa=X.content;ka=document.createElement("div");ka.className="geDialogCheckRow";var Ga=document.createElement("input");Ga.style.marginRight="8px";Ga.setAttribute("type","radio");Ga.setAttribute("name","printSize");Ga.setAttribute("id","gePrintDlgPageView");ka.appendChild(Ga);u=document.createElement("label");
+u.setAttribute("for","gePrintDlgPageView");mxUtils.write(u,mxResources.get("pageView"));ka.appendChild(u);mxEvent.addListener(ka,"click",function(){Ga.checked=!0});oa.appendChild(ka);ka=document.createElement("div");ka.className="geDialogCheckRow";var La=document.createElement("input");La.style.marginRight="8px";La.setAttribute("type","radio");La.setAttribute("name","printSize");La.setAttribute("id","gePrintDlgCrop");ka.appendChild(La);u=document.createElement("label");u.setAttribute("for","gePrintDlgCrop");
+mxUtils.write(u,mxResources.get("crop"));ka.appendChild(u);mxEvent.addListener(ka,"click",function(){La.checked=!0});oa.appendChild(ka);ka=document.createElement("div");ka.className="geDialogCheckRow";ka.style.alignItems="flex-start";var Ia=document.createElement("input");Ia.style.marginTop="4px";Ia.setAttribute("type","radio");Ia.setAttribute("name","printSize");ka.appendChild(Ia);qa=document.createElement("table");qa.style.display="inline-block";qa.style.borderSpacing="0";var Ca=document.createElement("tbody"),
+Pa=document.createElement("tr"),Ka=Pa.cloneNode(!0),Na=document.createElement("td"),Oa=Na.cloneNode(!0),Ea=Na.cloneNode(!0),Aa=Na.cloneNode(!0),Ja=Na.cloneNode(!0),Ha=Na.cloneNode(!0);Na.style.textAlign="right";Aa.style.textAlign="right";mxUtils.write(Na,mxResources.get("fitTo"));mxEvent.addListener(ka,"click",function(mb){mxEvent.getSource(mb)!=Ia&&(Ia.checked=!Ia.checked)});var Ua=document.createElement("input");Ua.style.margin="0 2px";Ua.style.boxSizing="border-box";Ua.setAttribute("value",k.lastPrintSheetsAcross||
+"1");Ua.setAttribute("min","1");Ua.setAttribute("type","number");Ua.style.width="40px";Oa.appendChild(Ua);u=document.createElement("span");mxUtils.write(u,mxResources.get("fitToSheetsAcross"));Ea.appendChild(u);mxUtils.write(Aa,mxResources.get("fitToBy"));var ab=Ua.cloneNode(!0);ab.setAttribute("value",k.lastPrintSheetsDown||"1");Ja.appendChild(ab);mxEvent.addListener(Ua,"click",function(mb){Ia.checked=!0;mxEvent.consume(mb)});mxEvent.addListener(ab,"click",function(mb){Ia.checked=!0;mxEvent.consume(mb)});
+k.lastPrintCropRadioChecked?La.checked=!0:k.lastPrintFitRadioChecked?Ia.checked=!0:Ga.checked=!0;u=document.createElement("span");mxUtils.write(u,mxResources.get("fitToSheetsDown"));Ha.appendChild(u);Pa.appendChild(Na);Pa.appendChild(Oa);Pa.appendChild(Ea);Ka.appendChild(Aa);Ka.appendChild(Ja);Ka.appendChild(Ha);Ca.appendChild(Pa);Ca.appendChild(Ka);qa.appendChild(Ca);ka.appendChild(qa);oa.appendChild(ka);oa=document.createElement("div");oa.className="geDialogSection";u=document.createElement("div");
+u.className="geDialogFormRow";ka=document.createElement("label");ka.className="geDialogFormLabel";ka.setAttribute("for","gePrintDlgBorder");mxUtils.write(ka,mxResources.get("borderWidth"));u.appendChild(ka);var Wa=document.createElement("input");Wa.setAttribute("type","number");Wa.setAttribute("min","0");Wa.setAttribute("id","gePrintDlgBorder");Wa.style.width="40px";Wa.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;u.appendChild(Wa);ka=document.createElement("label");
+ka.setAttribute("for","gePrintDlgZoom");ka.style.marginLeft="12px";ka.style.marginRight="4px";mxUtils.write(ka,mxResources.get("zoom"));u.appendChild(ka);var cb=document.createElement("input");cb.setAttribute("id","gePrintDlgZoom");cb.style.width="60px";cb.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";u.appendChild(cb);oa.appendChild(u);ka=document.createElement("div");ka.className="geDialogCheckRow";var hb=document.createElement("input");hb.setAttribute("type","checkbox");hb.setAttribute("id",
+"gePrintDlgGrid");hb.style.marginRight="8px";hb.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;ka.appendChild(hb);u=document.createElement("label");u.setAttribute("for","gePrintDlgGrid");mxUtils.write(u,mxResources.get("grid"));ka.appendChild(u);oa.appendChild(ka);ka=document.createElement("div");ka.className="geDialogCheckRow";var wb=document.createElement("input");wb.setAttribute("type","checkbox");wb.setAttribute("id","gePrintDlgShadows");wb.style.marginRight="8px";wb.checked=null!=k.lastPrintShadow?
+k.lastPrintShadow:!1;ka.appendChild(wb);u=document.createElement("label");u.setAttribute("for","gePrintDlgShadows");mxUtils.write(u,mxResources.get("shadows"));ka.appendChild(u);k.isOffline()&&!mxClient.IS_CHROMEAPP||ka.appendChild(k.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(ka.style.display="none");oa.appendChild(ka);var Fa=document.createElement("input");Fa.setAttribute("type","checkbox");Fa.setAttribute("id",
+"gePrintDlgTransparent");Fa.style.marginRight="8px";Fa.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=H&&(ka=document.createElement("div"),ka.className="geDialogCheckRow",ka.appendChild(Fa),u=document.createElement("label"),u.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(u,mxResources.get("transparentBackground")),ka.appendChild(u),oa.appendChild(ka));var Ra=document.createElement("input");Ra.setAttribute("type","checkbox");Ra.setAttribute("id","gePrintDlgInclude");
+Ra.style.marginRight="8px";Ra.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(ka=document.createElement("div"),ka.className="geDialogCheckRow",ka.appendChild(Ra),u=document.createElement("label"),u.setAttribute("for","gePrintDlgInclude"),mxUtils.write(u,mxResources.get("includeCopyOfMyDiagram")),ka.appendChild(u),oa.appendChild(ka));var $a=document.createElement("input");$a.setAttribute("type","checkbox");
+$a.setAttribute("id","gePrintDlgIcons");$a.style.marginRight="8px";$a.checked=null!=k.lastPrintIcons?k.lastPrintIcons:!1;null!=H&&EditorUi.isElectronApp&&(ka=document.createElement("div"),ka.className="geDialogCheckRow",ka.appendChild($a),u=document.createElement("label"),u.setAttribute("for","gePrintDlgIcons"),mxUtils.write(u,mxResources.get("notes")),ka.appendChild(u),oa.appendChild(ka));X.wrapper.appendChild(oa);u=document.createElement("div");u.style.flex="0 0 auto";u.style.marginTop="16px";u.style.textAlign=
+"right";u.style.whiteSpace="nowrap";k.isOffline()&&!mxClient.IS_CHROMEAPP||null!=H||u.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));X=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});X.className="geBtn";k.editor.cancelFirst&&u.appendChild(X);PrintDialog.previewEnabled&&null==H&&(oa=mxUtils.button(mxResources.get("preview"),function(){fa(!1)}),oa.className="geBtn",u.appendChild(oa));P=null!=P?P:null!=H?"export":PrintDialog.previewEnabled?"print":
+"ok";P=mxUtils.button(mxResources.get(P),function(){fa(!0)});P.className="geBtn gePrimaryBtn";u.appendChild(P);k.editor.cancelFirst||u.appendChild(X);ea.appendChild(u);if(k.editor.isChromelessView()){var fb=function(){Editor.isDarkMode()?(ea.classList.add("geDarkMode"),ea.style.colorScheme="dark"):(ea.classList.remove("geDarkMode"),ea.style.colorScheme="light")};k.addListener("darkModeChanged",fb);fb();var rb=function(mb,ub){mb=ub.getProperty("dialog");ea.parentNode==mb.container&&(k.editor.removeListener(rb),
+k.removeListener(fb))};k.editor.addListener("hideDialog",rb)}this.container=ea};var ha=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&
+(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ha.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=
+this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(k){var u=[];if(null==k)return u;var H=function(ea){if(null!=ea)return ea=parseFloat(ea),!isNaN(ea)&&0<=ea?ea:void 0},P=
+{fade:!0,pop:!0,wipe:!0};k=k.split("\n");for(var U=0;U<k.length;U++){var W=mxUtils.trim(k[U]);if(""!=W&&"#"!=W.charAt(0)){W=W.split(/\s+/);var fa={action:W[0],cell:W[1],arg:W[2]};if("wait"==fa.action){if(fa.delay=parseFloat(fa.cell),isNaN(fa.delay)||0>fa.delay)fa.delay=1E3}else if("setOpacity"==fa.action)fa.opacity=parseFloat(W[2]),isNaN(fa.opacity)&&(fa.opacity=1),fa.opacity=Math.max(0,Math.min(1,fa.opacity)),fa.duration=H(W[3]),fa.arg=void 0;else if("show"==fa.action){if(null!=fa.arg&&!P[fa.arg]){var X=
+H(fa.arg);null!=X&&(fa.duration=X,fa.arg=void 0)}null==fa.duration&&(fa.duration=H(W[3]))}else"hide"==fa.action&&(fa.duration=H(W[2]),fa.arg=void 0);u.push(fa)}}return u};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(k,u){return k.action!=u.action||"wait"==k.action||(k.arg||"")!=(u.arg||"")||(null!=k.opacity?k.opacity:"")!=(null!=u.opacity?u.opacity:"")||(null!=k.duration?k.duration:"")!=(null!=u.duration?u.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(k){if("wait"==
+k.action)return{wait:k.delay};var u="all"==k.cell?"*":k.cell;if(null==u)return null;var H={cells:[u]};if(null!=k.duration)H.delay=k.duration;else if("show"==k.action&&"fade"==k.arg)H.delay=Editor.animationFadeDelay;else if("hide"==k.action||"setOpacity"==k.action)H.delay=Editor.animationFadeDelay;return"show"==k.action?"fade"==k.arg?{fadeIn:H}:"pop"==k.arg?{popIn:H}:{wipeIn:H}:"hide"==k.action?{fadeOut:H}:"setOpacity"==k.action?(H.value=k.opacity,{fadeTo:H}):"flow"==k.action?(u={cells:[u]},"start"==
+k.arg?u.start=!0:"stop"==k.arg&&(u.start=!1),{flow:u}):null};Editor.convertLegacyAnimation=function(k){k=Editor.parseAnimationScript(k);for(var u=[{opacity:{cells:["*"],value:0}}],H=null,P=function(){null!=H&&(u.push(H),H=null)},U=function(X){null==H&&(H={});for(var ea in X){var oa=X[ea],ka;if(ka=null!=H[ea]&&null!=oa&&Array.isArray(H[ea].cells)&&Array.isArray(oa.cells))ka=H[ea],ka=ka.delay===oa.delay&&ka.value===oa.value&&ka.start===oa.start;if(ka)for(ka=0;ka<oa.cells.length;ka++)H[ea].cells.push(oa.cells[ka]);
+else null!=H[ea]&&(P(),H={}),H[ea]=oa}},W=0;W<k.length;W++){var fa=Editor.convertLegacyAnimationStep(k[W]);null!=fa&&(null!=fa.wait?(P(),u.push(fa)):U(fa))}P();return{animation:{steps:u}}};Editor.parseAnimationData=function(k){var u=function(P){null==P&&(P={});Array.isArray(P.steps)||(P.steps=[]);P.loop=null==P.loop?!0:!!P.loop;P.enabled=null==P.enabled?!0:!!P.enabled;return P};if(null==k||""===k)return u({steps:[]});if("string"==typeof k){var H=mxUtils.trim(k);return"{"==H.charAt(0)||"["==H.charAt(0)?
+Editor.parseAnimationData(JSON.parse(H)):u(Editor.convertLegacyAnimation(k).animation)}return null!=k.animation&&null!=k.animation.steps?u(k.animation):Array.isArray(k.steps)?u(k):u({steps:[]})};Editor.AnimationPlayer=function(k,u){this.graph=k;this.data=Editor.parseAnimationData(u);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(k){var u=[],H;for(H in k.cells){var P=k.cells[H];(k.isVertex(P)||k.isEdge(P))&&u.push(P)}return u};Editor.AnimationPlayer.prototype.collectReferencedCells=
+function(){for(var k=this.data.steps||[],u={},H=[],P=0;P<k.length;P++){var U=k[P],W;for(W in U)if("wait"!=W&&"open"!=W){var fa=U[W];if("object"===typeof fa&&null!=fa){fa=this.graph.getCellsForAction(fa,!0);for(var X=0;X<fa.length;X++)u[fa[X].id]||(u[fa[X].id]=!0,H.push(fa[X]))}}}return H};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var k=this.collectReferencedCells();k=this.graph.getNodesForCells(k);var u=new Set;if(null==this.snapshot)this.snapshot=[];else for(var H=0;H<this.snapshot.length;H++)u.add(this.snapshot[H].node);
+for(H=0;H<k.length;H++)u.has(k[H])||(u.add(k[H]),this.snapshot.push({node:k[H],opacity:k[H].style.opacity}))};Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var k=0;k<this.snapshot.length;k++)Graph.setTransitionForNodes([this.snapshot[k].node],null),this.snapshot[k].node.style.opacity=this.snapshot[k].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(k){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){k=k||{};this.running=
+!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var u=this,H=this.data.steps||[],P=function(W,fa){if(null==u.graph||u.graph.isGraphTornDown())u.running=!1;else if(u.cancelled||W>=H.length)fa();else{for(var X=W+1;X<H.length&&!0===H[X].immediate&&!u.cancelled;)X++;if("function"==typeof k.onStep)try{k.onStep(W,X)}catch(ea){}u.graph.executeCustomActions(Graph.flattenAnimationActions(H.slice(W,X)),function(){P(X,fa)},null)}},U=function(){null==u.graph||u.graph.isGraphTornDown()?
+u.running=!1:u.cancelled?(u.restoreOpacity(),u.running=!1):(null==u.snapshot&&u.snapshotOpacity(),P(0,function(){if(u.cancelled)u.restoreOpacity(),u.running=!1;else{if("function"==typeof k.onStep)try{k.onStep(-1)}catch(W){}k.loop?(u.graph.refresh(),u.restoreOpacity(),window.setTimeout(U,0)):(u.running=!1,u.restoreOpacity(),null!=k.done&&k.done())}}))};k.defer?window.setTimeout(U,0):U()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=
+!0);for(var k=[],u=this.collectReferencedCells(),H=0;H<u.length;H++)this.graph.getModel().isEdge(u[H])&&k.push(u[H]);0<k.length&&Editor.toggleFlowAnimation(this.graph,k,"stop")};Editor.toggleFlowAnimation=function(k,u,H){H=H||"toggle";for(var P=0;P<u.length;P++)if(k.getModel().isEdge(u[P])){var U=k.view.getState(u[P]);if(null!=U&&null!=U.shape){var W=null!=U.shape.getFlowAnimationPath?U.shape.getFlowAnimationPath():null;if(null!=W){var fa="mxEdgeFlow"==W.getAttribute("class"),X="start"==H||"toggle"==
+H&&!fa;fa="stop"==H||"toggle"==H&&fa;U="1"==mxUtils.getValue(U.style,mxConstants.STYLE_DASHED,"0");fa?(W.removeAttribute("class"),U||W.removeAttribute("stroke-dasharray")):X&&(W.setAttribute("class","mxEdgeFlow"),U||W.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(k,u){var H=k.getModel().getRoot(),P=null;null!=H.value&&"object"==typeof H.value&&(P=H.value.getAttribute("animation"));if(null==P||""==P)return null;try{var U=Editor.parseAnimationData(P)}catch(fa){return null}if(!U.steps||
+0==U.steps.length||!1===U.enabled)return null;H={};if(null!=u)for(var W in u)H[W]=u[W];null==H.loop&&(H.loop=U.loop);null==H.defer&&(H.defer=!0);k=new Editor.AnimationPlayer(k,U);k.play(H);return k};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var k=document.createElement("style");k.type="text/css";k.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));
+document.getElementsByTagName("head")[0].appendChild(k)}catch(u){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="31.4.6";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",
"elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},elkRadial:{layout:"elkRadial",config:{edgeStyle:"elkCompat"}},elkOrganic:{layout:"elkOrganic",config:{edgeStyle:"elkCompat"}},elkStress:{layout:"elkStress",config:{edgeStyle:"elkCompat"}}};EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging=
"1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars=
"\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.enabledTemplateSections=null;EditorUi.customTemplates=null;EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&
@@ -4164,9 +4166,9 @@ function(c){this.shareCursorPosition=c;Editor.isSettingsEnabled()&&(mxSettings.s
EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=
function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine&&!EditorUi.isElectronApp||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};
EditorUi.prototype.isRemoteExportEnabled=function(){return!this.isOffline()&&"string"===typeof EXPORT_URL&&/^(https?:\/\/|\/)/i.test(EXPORT_URL)};EditorUi.prototype.isPrintPdfExport=function(){return this.printPdfExport||!this.isRemoteExportEnabled()};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,l){var q=null==c||null==f;l=null!=l?l:24;var x=new Spinner({lines:12,length:l,width:Math.round(l/
-3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),A=this.timeout,E=x.spin,K=null,Q=null,V=mxUtils.bind(this,function(Y){null!=Y&&Y()}),J=this;x.spin=function(Y,aa,ja,ka){ka=null!=ka?ka:A;var ua=!1;if(!this.active){var Da=Date.now();null!=ja&&(K=window.setTimeout(function(){x.stop();K=null;ja({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:Q})},ka));q&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||
+3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),A=this.timeout,E=x.spin,K=null,Q=null,V=mxUtils.bind(this,function(Y){null!=Y&&Y()}),J=this;x.spin=function(Y,aa,ja,la){la=null!=la?la:A;var ua=!1;if(!this.active){var Da=Date.now();null!=ja&&(K=window.setTimeout(function(){x.stop();K=null;ja({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:Q})},la));q&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||
0)/2,c=document.body.clientWidth/2-2);Y==document.body&&"1"==urlParams.embedInline&&(Y=J.diagramContainer,c=Y.scrollLeft+Y.clientWidth/2,f=Y.scrollTop+Y.clientHeight/2);E.call(this,Y);"1"==urlParams.embedInline&&null!=x.el&&(x.el.style.marginTop=Y.scrollTop+"px",x.el.style.marginLeft=Y.scrollLeft+"px");this.active=!0;null!=aa&&(ua=document.createElement("div"),ua.className="geSpinnerStatus",ua.setAttribute("title",aa),Y==document.body?(ua.style.left=Math.max(0,c)+"px",ua.style.top=Math.max(0,f+66)+
-"px"):(ua.style.left="50%",ua.style.top="50%",ua.style.marginTop="70px"),"..."!=aa.substring(aa.length-3,aa.length)&&"!"!=aa.charAt(aa.length-1)&&(aa+="..."),ua.innerText=aa,Y.appendChild(ua),x.status=ua);this.pause=mxUtils.bind(this,function(){var ha=V;this.active&&(ka=Math.max(0,ka-(Date.now()-Da)),ha=mxUtils.bind(this,function(k){this.spin(Y,aa,ja,ka);if(null!=k)try{k(),Q=mxUtils.bind(this,function(){this.spin(Y,aa,ja,ka);try{k()}catch(u){null!=ja&&ja(u)}})}catch(u){null!=ja&&ja(u)}}));this.stop();
+"px"):(ua.style.left="50%",ua.style.top="50%",ua.style.marginTop="70px"),"..."!=aa.substring(aa.length-3,aa.length)&&"!"!=aa.charAt(aa.length-1)&&(aa+="..."),ua.innerText=aa,Y.appendChild(ua),x.status=ua);this.pause=mxUtils.bind(this,function(){var ha=V;this.active&&(la=Math.max(0,la-(Date.now()-Da)),ha=mxUtils.bind(this,function(k){this.spin(Y,aa,ja,la);if(null!=k)try{k(),Q=mxUtils.bind(this,function(){this.spin(Y,aa,ja,la);try{k()}catch(u){null!=ja&&ja(u)}})}catch(u){null!=ja&&ja(u)}}));this.stop();
return ha});ua=!0}return ua};var ia=x.stop;x.stop=function(){ia.call(this);this.active&&(this.active=!1,null!=K&&(window.clearTimeout(K),K=null),null!=x.status&&null!=x.status.parentNode&&x.status.parentNode.removeChild(x.status),x.status=null)};x.pause=function(){return V};return x};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var f=mxUtils.parseXml(c),l=this.editor.extractGraphModel(f.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}}catch(q){}return!1};
EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};
EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=
@@ -4180,10 +4182,10 @@ function(K){E(K)}),mxUtils.bind(this,function(){E(null)})):E(null)};EditorUi.pro
function(c){c=new Date(c);return!isNaN(c.getTime())&&0<=c.getTime()?c.toLocaleString():null};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=null!=c?this.editor.extractGraphModel(c,!0):null;null!=l&&(c=l);if(null!=c){l=this.editor.graph;l.model.beginUpdate();try{var q=null!=this.pages?this.pages.slice():null,x=c.getElementsByTagName("diagram");
if(1<x.length||1==x.length&&x[0].hasAttribute("name")){this.fileNode=c;l.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var A=x.length-1;0<=A;A--){var E=this.updatePageRoot(new DiagramPage(x[A]));null==E.getName()&&E.setName(mxResources.get("pageWithNumber",[A+1]));l.model.execute(new ChangePage(this,E,0==A?E:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),
this.currentPage.setName(mxResources.get("pageWithNumber",[1])),l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=q)for(A=0;A<q.length;A++)l.model.execute(new ChangePage(this,q[A],null));var K=this.getCurrentFile();null!=K&&K.fileReplaced(f)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=
-function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){f=null!=f?f:this.editor.graph;x=null!=x?x:!1;Q=null!=Q?Q:!0;V=null!=V?V:this.defaultCompact;J=null!=J?J:!Editor.defaultCompressed;var aa=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var ja="_blank";else aa=ja=q;if(null==c)return"";var ka=c;if("mxfile"!=ka.nodeName.toLowerCase()){if(J){var ua=c.ownerDocument.createElement("diagram");ua.setAttribute("name",mxResources.get("pageWithNumber",[1]));ua.setAttribute("id",Editor.guid());
-ua.appendChild(c)}else{ua=Graph.zapGremlins(mxUtils.getXml(c));ka=Graph.compress(ua);if(Graph.decompress(ka)!=ua)return ua;ua=c.ownerDocument.createElement("diagram");ua.setAttribute("name",mxResources.get("pageWithNumber",[1]));ua.setAttribute("id",Editor.guid());mxUtils.setTextContent(ua,ka)}ka=c.ownerDocument.createElement("mxfile");ka.appendChild(ua)}V?(ka=ka.cloneNode(!0),ka.removeAttribute("modified"),ka.removeAttribute("host"),ka.removeAttribute("agent"),ka.removeAttribute("etag"),ka.removeAttribute("userAgent"),
-ka.removeAttribute("version"),ka.removeAttribute("editor"),ka.removeAttribute("type")):(ka.removeAttribute("userAgent"),ka.removeAttribute("modified"),ka.removeAttribute("version"),ka.removeAttribute("editor"),ka.removeAttribute("pages"),ka.removeAttribute("type"),ka.removeAttribute("etag"),mxClient.IS_CHROMEAPP?ka.setAttribute("host","Chrome"):EditorUi.isElectronApp?ka.setAttribute("host","Electron"):ka.setAttribute("host",window.location.hostname),1<ka.getElementsByTagName("diagram").length&&null!=
-this.pages&&ka.setAttribute("pages",this.pages.length));null!=ia&&(ka=ka.cloneNode(!0),ka.setAttribute("scale",ia));null!=Y&&(ka=ka.cloneNode(!0),ka.setAttribute("border",Y));c=J?mxUtils.getPrettyXml(ka):mxUtils.getXml(ka);if(!A&&!x&&(E||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(ka),f,null!=l?l.getTitle():null,ja,aa);else if(A||!x&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(q=null),l=this.getSvgFileProperties(ka),
+function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){f=null!=f?f:this.editor.graph;x=null!=x?x:!1;Q=null!=Q?Q:!0;V=null!=V?V:this.defaultCompact;J=null!=J?J:!Editor.defaultCompressed;var aa=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var ja="_blank";else aa=ja=q;if(null==c)return"";var la=c;if("mxfile"!=la.nodeName.toLowerCase()){if(J){var ua=c.ownerDocument.createElement("diagram");ua.setAttribute("name",mxResources.get("pageWithNumber",[1]));ua.setAttribute("id",Editor.guid());
+ua.appendChild(c)}else{ua=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(ua);if(Graph.decompress(la)!=ua)return ua;ua=c.ownerDocument.createElement("diagram");ua.setAttribute("name",mxResources.get("pageWithNumber",[1]));ua.setAttribute("id",Editor.guid());mxUtils.setTextContent(ua,la)}la=c.ownerDocument.createElement("mxfile");la.appendChild(ua)}V?(la=la.cloneNode(!0),la.removeAttribute("modified"),la.removeAttribute("host"),la.removeAttribute("agent"),la.removeAttribute("etag"),la.removeAttribute("userAgent"),
+la.removeAttribute("version"),la.removeAttribute("editor"),la.removeAttribute("type")):(la.removeAttribute("userAgent"),la.removeAttribute("modified"),la.removeAttribute("version"),la.removeAttribute("editor"),la.removeAttribute("pages"),la.removeAttribute("type"),la.removeAttribute("etag"),mxClient.IS_CHROMEAPP?la.setAttribute("host","Chrome"):EditorUi.isElectronApp?la.setAttribute("host","Electron"):la.setAttribute("host",window.location.hostname),1<la.getElementsByTagName("diagram").length&&null!=
+this.pages&&la.setAttribute("pages",this.pages.length));null!=ia&&(la=la.cloneNode(!0),la.setAttribute("scale",ia));null!=Y&&(la=la.cloneNode(!0),la.setAttribute("border",Y));c=J?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!A&&!x&&(E||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(la),f,null!=l?l.getTitle():null,ja,aa);else if(A||!x&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(q=null),l=this.getSvgFileProperties(la),
c=this.getEmbeddedSvg(c,f,q,null,K,Q,aa,null,null,l.scale,l.border,null,Editor.svgFileTheme,null,l.embedFonts);return c};EditorUi.prototype.getXmlFileData=function(c,f,l,q){c=null!=c?c:!0;f=null!=f?f:!1;l=null!=l?l:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,q);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(Q){var V=Q.getElementsByTagName("mxGraphModel"),J=0<V.length?V[0]:null;V=Q;null==J&&l?(J=mxUtils.getNodeValue(Q),0<J.length&&(J=Graph.decompress(J),null!=J&&0<J.length&&
(V=Q.cloneNode(!1),V.appendChild(mxUtils.parseXml(J).documentElement)))):null==J||l?V=Q.cloneNode(!0):(V=Q.cloneNode(!1),mxUtils.setTextContent(V,Graph.compressNode(J)));x.appendChild(V)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var A=this.pages[f],E=A.node;if(A!=this.currentPage)if(A.needsUpdate){var K=new mxCodec(mxUtils.createXmlDocument());K=K.encode(new mxGraphModel(A.root));
this.editor.graph.saveViewState(A.viewState,K,null,q);EditorUi.removeChildNodes(E);E.appendChild(K);delete A.needsUpdate}else q&&(this.updatePageRoot(A),null!=A.viewState.backgroundImage&&null!=A.viewState.backgroundImage.originalSrc&&(K=new mxCodec(mxUtils.createXmlDocument()),K=K.encode(new mxGraphModel(A.root)),this.editor.graph.saveViewState(A.viewState,K,null,q,A),E=E.cloneNode(!1),E.appendChild(K)));c(E)}return x};EditorUi.prototype.anonymizeString=function(c,f){for(var l=[],q=0;q<c.length;q++){var x=
@@ -4196,7 +4198,7 @@ delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=
f[l].setAttribute("value","["+f[l].getAttribute("value").length+"]"),null!=f[l].getAttribute("xmlValue")&&f[l].setAttribute("xmlValue","["+f[l].getAttribute("xmlValue").length+"]"),null!=f[l].getAttribute("style")&&f[l].setAttribute("style","["+f[l].getAttribute("style").length+"]"),null!=f[l].parentNode&&"root"!=f[l].parentNode.nodeName&&null!=f[l].parentNode.parentNode&&(f[l].setAttribute("id",f[l].parentNode.getAttribute("id")),f[l].parentNode.parentNode.replaceChild(f[l],f[l].parentNode));return c};
EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();f.handleFileError(l,!0)})):
f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){f.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){x=null!=x?x:!0;A=null!=A?A:!1;V=null!=V?V:!Editor.defaultCompressed;var aa=this.editor.graph;if((f||!c&&null!=Q&&/(\.svg)$/i.test(Q.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ja=aa.getGlobalVariable;aa=this.createTemporaryGraph(aa.getStylesheet());aa.setBackgroundImage=
-this.editor.graph.setBackgroundImage;aa.background=this.editor.graph.background;var ka=null!=this.pages?this.pages[0]:null;null==ka||this.currentPage==ka?aa.setBackgroundImage(this.editor.graph.backgroundImage):null!=ka.viewState&&null!=ka.viewState&&aa.setBackgroundImage(ka.viewState.backgroundImage);aa.getGlobalVariable=function(ua){return"page"==ua&&null!=ka?ka.getName():"pagenumber"==ua?1:ja.apply(this,arguments)};document.body.appendChild(aa.container);null!=ka&&aa.model.setRoot(ka.root)}E=null!=
+this.editor.graph.setBackgroundImage;aa.background=this.editor.graph.background;var la=null!=this.pages?this.pages[0]:null;null==la||this.currentPage==la?aa.setBackgroundImage(this.editor.graph.backgroundImage):null!=la.viewState&&null!=la.viewState&&aa.setBackgroundImage(la.viewState.backgroundImage);aa.getGlobalVariable=function(ua){return"page"==ua&&null!=la?la.getName():"pagenumber"==ua?1:ja.apply(this,arguments)};document.body.appendChild(aa.container);null!=la&&aa.model.setRoot(la.root)}E=null!=
E?E:this.getXmlFileData(x,A,V,J);Q=null!=Q?Q:this.getCurrentFile();c=this.createFileData(E,aa,Q,window.location.href,c,f,l,q,x,K,V,ia,Y);aa!=this.editor.graph&&aa.container.parentNode.removeChild(aa.container);return c};EditorUi.prototype.getHtml=function(c,f,l,q,x,A){A=null!=A?A:!0;var E=null,K=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){E=A?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var Q=f.view.scale;A=Math.floor(E.x/Q-f.view.translate.x);Q=Math.floor(E.y/Q-f.view.translate.y);
E=f.background;null==x&&(f=this.getBasenames().join(";"),0<f.length&&(K=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",A);c.setAttribute("y0",Q)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=q&&c.setAttribute("edit",q));null!=x&&(x=x.replace(/&/g,"&amp;"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";q=Graph.compress(c);Graph.decompress(q)!=c&&(q=encodeURIComponent(c));
return(null==x?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=x?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==x?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+"</head>\n<body"+(null==x&&null!=E&&E!=mxConstants.NONE?' style="background-color:'+E+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+
@@ -4210,14 +4212,14 @@ new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setNa
V=Q.getChildren(Q.root);for(A=0;A<V.length;A++){var J=V[A];Q.setVisible(J,K[J.id]||!1)}}catch(ia){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=l.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var q=f.cells=0;q<
l.length;q++){var x=l[q].getElementsByTagName("mxCell");f.cells+=x.length;for(var A={},E=0;E<x.length;E++){var K=x[E].getAttribute("style");if(null!=K)for(var Q=K.split(";"),V=0;V<Q.length;V++){var J=Q[V];if(J.startsWith("image=data:")||J.startsWith("shape=stencil("))null==A[J]?A[J]=1:A[J]++}}for(var ia in A){var Y=A[ia];ia.startsWith("shape=stencil(")?f.stencils+=Y:f.images+=Y;1<Y&&(f.redundantSize+=ia.length*(Y-1),ia.startsWith("shape=stencil(")?f.redundantStencils+=Y-1:f.redundantImages+=Y-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+
"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(f)})}}catch(aa){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&
-0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua,Da){try{q=null!=q?q:this.editor.graph.isSelectionEmpty();var ha=this.getBaseFilename(!x),k=ha+("xml"==c||"pdf"==c&&J?".drawio":"")+"."+c;if("xml"==c){var u=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,q,x,null,null,null,f);this.saveData(k,c,u,"text/xml")}else if("html"==c)u=this.getHtml2(this.getFileData(!0),this.editor.graph,
-ha),this.saveData(k,c,u,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?k=ha+".png":"jpeg"==c&&(k=ha+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var H=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(k,c,q,"1",E,x,K,Q,V,J,ia,void 0,void 0,!A,Y,aa,ja,ka,ua,Da).send(mxUtils.bind(this,function(X){this.spinner.stop();
+0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua,Da){try{q=null!=q?q:this.editor.graph.isSelectionEmpty();var ha=this.getBaseFilename(!x),k=ha+("xml"==c||"pdf"==c&&J?".drawio":"")+"."+c;if("xml"==c){var u=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,q,x,null,null,null,f);this.saveData(k,c,u,"text/xml")}else if("html"==c)u=this.getHtml2(this.getFileData(!0),this.editor.graph,
+ha),this.saveData(k,c,u,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?k=ha+".png":"jpeg"==c&&(k=ha+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var H=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(k,c,q,"1",E,x,K,Q,V,J,ia,void 0,void 0,!A,Y,aa,ja,la,ua,Da).send(mxUtils.bind(this,function(X){this.spinner.stop();
if(200<=X.getStatus()&&299>=X.getStatus()){var ea=this.createLoadMessage("export");ea.format=c;ea.filename=k;ea.data="data:application/pdf;base64,"+X.getText();ea.xml=this.getFileData(!0);H.postMessage(JSON.stringify(ea),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(k,c,mxUtils.bind(this,function(X,ea){try{return this.createDownloadRequest(X,
-c,q,ea,E,x,K,Q,V,J,ia,void 0,void 0,!A,Y,aa,ja,ka,ua,Da)}catch(oa){this.handleError(oa)}}));else{var P=null,T=mxUtils.bind(this,function(X){X.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",X,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}))});if("svg"==c){var W=this.editor.graph.background;if(E||W==mxConstants.NONE)W=null;var fa=this.editor.graph.getSvg(W,null,null,null,null,q);l&&this.editor.graph.addSvgShadow(fa);
-this.editor.convertImages(fa,mxUtils.bind(this,mxUtils.bind(this,function(X){this.spinner.stop();T(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(X))})))}else k=ha+".svg",P=this.getFileData(!1,!0,null,mxUtils.bind(this,function(X){this.spinner.stop();T(X)}),q)}}catch(X){this.handleError(X)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua,Da,ha,k){c=this.downloadRequestBuilder(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua,Da,ha,k);f="";for(var u in c)l=
-c[u],null!=l&&(f+=u+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua,Da,ha,k){var u=this.editor.graph,H=u.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==A?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var P=null,T=null,W=null;if(!EditorUi.isElectronApp&&(H.width*H.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};
-V=V?"1":"0";"pdf"==f&&(null!=J?(P=J.from,T=J.to):0==A&&(W="1"));"xmlpng"==f&&(V="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(A=0;A<this.pages.length;A++)if(this.pages[A]==this.currentPage){P=A;break}A=u.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!x?x||null!=A&&A!=mxConstants.NONE||(A="#ffffff"):A=mxConstants.NONE;x={globalVars:u.getExportVariables()};null!=J&&null!=J.from&&(x.globalVars.pagenumber=J.from+1);Q&&(x.grid={size:u.gridSize,steps:u.view.gridSteps,
-color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:u.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);Q=this.getHiddenTagsMap();null!=Q&&(x.hiddenTags=Q);return{format:f,from:P,to:T,allPages:W,bg:null!=A?A:mxConstants.NONE,base64:q,embedXml:V,xml:l,filename:null!=c?c:"",extras:JSON.stringify(x),scale:E,border:K,pageMargin:ja,w:ia&&isFinite(ia)?ia:null,h:Y&&isFinite(Y)?Y:null,crop:null!=aa&&aa?"1":"0",fit:null!=ka&&ka?"1":"0",shadows:null!=
+c,q,ea,E,x,K,Q,V,J,ia,void 0,void 0,!A,Y,aa,ja,la,ua,Da)}catch(oa){this.handleError(oa)}}));else{var P=null,U=mxUtils.bind(this,function(X){X.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",X,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}))});if("svg"==c){var W=this.editor.graph.background;if(E||W==mxConstants.NONE)W=null;var fa=this.editor.graph.getSvg(W,null,null,null,null,q);l&&this.editor.graph.addSvgShadow(fa);
+this.editor.convertImages(fa,mxUtils.bind(this,mxUtils.bind(this,function(X){this.spinner.stop();U(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(X))})))}else k=ha+".svg",P=this.getFileData(!1,!0,null,mxUtils.bind(this,function(X){this.spinner.stop();U(X)}),q)}}catch(X){this.handleError(X)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua,Da,ha,k){c=this.downloadRequestBuilder(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua,Da,ha,k);f="";for(var u in c)l=
+c[u],null!=l&&(f+=u+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua,Da,ha,k){var u=this.editor.graph,H=u.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==A?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var P=null,U=null,W=null;if(!EditorUi.isElectronApp&&(H.width*H.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};
+V=V?"1":"0";"pdf"==f&&(null!=J?(P=J.from,U=J.to):0==A&&(W="1"));"xmlpng"==f&&(V="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(A=0;A<this.pages.length;A++)if(this.pages[A]==this.currentPage){P=A;break}A=u.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!x?x||null!=A&&A!=mxConstants.NONE||(A="#ffffff"):A=mxConstants.NONE;x={globalVars:u.getExportVariables()};null!=J&&null!=J.from&&(x.globalVars.pagenumber=J.from+1);Q&&(x.grid={size:u.gridSize,steps:u.view.gridSteps,
+color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:u.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);Q=this.getHiddenTagsMap();null!=Q&&(x.hiddenTags=Q);return{format:f,from:P,to:U,allPages:W,bg:null!=A?A:mxConstants.NONE,base64:q,embedXml:V,xml:l,filename:null!=c?c:"",extras:JSON.stringify(x),scale:E,border:K,pageMargin:ja,w:ia&&isFinite(ia)?ia:null,h:Y&&isFinite(Y)?Y:null,crop:null!=aa&&aa?"1":"0",fit:null!=la&&la?"1":"0",shadows:null!=
ha&&ha?"1":"0",sheetsAcross:ua,sheetsDown:Da,icons:null!=k&&k?"1":"0"}};EditorUi.prototype.getHiddenTagsMap=function(){var c=this.editor.graph,f={},l=!1;if(null!=this.pages)for(var q=0;q<this.pages.length;q++){var x=this.pages[q],A=x==this.currentPage?c.hiddenTags:null!=x.viewState?x.viewState.hiddenTags:null;null!=A&&0<A.length&&(f[x.getId()]=A,l=!0)}else null!=c.hiddenTags&&0<c.hiddenTags.length&&(f[0]=c.hiddenTags,l=!0);return l?f:null};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=
function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");if(0<l){c=decodeURIComponent(c.substring(l+1));try{f=JSON.parse(c)}catch(q){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=
this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var l=f.lastIndexOf("#");0<l&&(f=f.substring(0,l));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(q){}0<l&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,
@@ -4226,7 +4228,7 @@ c.update){var Q=null!=c.interval?parseInt(c.interval):6E4,V=null,J=mxUtils.bind(
V=window.setTimeout(J,Q)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ia();J()}));ia();J()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var A=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(A,mxUtils.bind(this,function(E){x(E)}),mxUtils.bind(this,function(E){null!=l&&l(E)}))}else x("")};EditorUi.prototype.updateDiagram=function(c){function f(k){var u=new mxCellOverlay(k.image||x.warningImage,k.tooltip,k.align,k.valign,k.offset);u.addListener(mxEvent.CLICK,function(H,
P){q.alert(k.tooltip)});return u}var l=null,q=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var x=this.editor.graph,A=x.getModel();A.beginUpdate();var E=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var K=A.getCell(c.getAttribute("id"));if(null!=K){try{var Q=c.getAttribute("value");if(null!=Q){var V=mxUtils.parseXml(Q).documentElement;if(null!=V)if("1"==V.getAttribute("replace-value"))A.setValue(K,V);else for(var J=
V.attributes,ia=0;ia<J.length;ia++)x.setAttributeForCell(K,J[ia].nodeName,0<J[ia].nodeValue.length?J[ia].nodeValue:null)}}catch(k){null!=window.console&&console.log("Error in value for "+K.id+": "+k)}try{var Y=c.getAttribute("style");null!=Y&&x.model.setStyle(K,Y)}catch(k){null!=window.console&&console.log("Error in style for "+K.id+": "+k)}try{var aa=c.getAttribute("icon");if(null!=aa){var ja=0<aa.length?JSON.parse(aa):null;null!=ja&&ja.append||x.removeCellOverlays(K);null!=ja&&x.addCellOverlay(K,
-f(ja))}}catch(k){null!=window.console&&console.log("Error in icon for "+K.id+": "+k)}try{var ka=c.getAttribute("geometry");if(null!=ka){ka=JSON.parse(ka);var ua=x.getCellGeometry(K);if(null!=ua){ua=ua.clone();for(key in ka){var Da=parseFloat(ka[key]);"dx"==key?ua.x+=Da:"dy"==key?ua.y+=Da:"dw"==key?ua.width+=Da:"dh"==key?ua.height+=Da:ua[key]=parseFloat(ka[key])}x.model.setGeometry(K,ua)}}}catch(k){null!=window.console&&console.log("Error in icon for "+K.id+": "+k)}}}else if("model"==c.nodeName){for(var ha=
+f(ja))}}catch(k){null!=window.console&&console.log("Error in icon for "+K.id+": "+k)}try{var la=c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var ua=x.getCellGeometry(K);if(null!=ua){ua=ua.clone();for(key in la){var Da=parseFloat(la[key]);"dx"==key?ua.x+=Da:"dy"==key?ua.y+=Da:"dw"==key?ua.width+=Da:"dh"==key?ua.height+=Da:ua[key]=parseFloat(la[key])}x.model.setGeometry(K,ua)}}}catch(k){null!=window.console&&console.log("Error in icon for "+K.id+": "+k)}}}else if("model"==c.nodeName){for(var ha=
c.firstChild;null!=ha&&ha.nodeType!=mxConstants.NODETYPE_ELEMENT;)ha=ha.nextSibling;null!=ha&&(new mxCodec(c.firstChild)).decode(ha,A)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(x.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))x.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(E=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{A.endUpdate()}null!=
E&&this.chromelessResize&&this.chromelessResize(!0,E)}return l};EditorUi.prototype.getCopyFilename=function(c,f){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var q=l.lastIndexOf(".");0<=q&&(c=l.substring(q),l=l.substring(0,q));if(f){f=l;var x=new Date;l=x.getFullYear();q=x.getMonth()+1;var A=x.getDate(),E=x.getHours(),K=x.getMinutes();x=x.getSeconds();l=f+(" "+(l+"-"+q+"-"+A+"-"+E+"-"+K+"-"+x))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=
function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,f,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[f]);var q=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var x=!1;this.hideDialog();null!=q&&(q.removeListener(this.descriptorChangedListener),this.logIfModified(q,!0),q.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var A=mxUtils.bind(this,
@@ -4251,38 +4253,38 @@ f,l,q,x){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCusto
E=null!=E?E[E.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var K=null,Q=mxUtils.bind(this,function(ha,k){0==ha.length&&c.isEditable()?(null==K&&(K=document.createElement("div"),K.className="geDropTarget",ha=mxResources.get("dragElementsHere"),mxUtils.write(K,ha),K.setAttribute("title",ha)),k.appendChild(K)):this.addLibraryEntries(ha,k)});null!=this.sidebar&&null!=f&&(this.sidebar.setCurrentSearchEntryLibrary(c.getHash(),c.getHash()),this.sidebar.addEntries(f,x),this.sidebar.setCurrentSearchEntryLibrary());
null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var V=this.sidebar.addPalette(c.getHash(),l,null!=q?q:!0,mxUtils.bind(this,function(ha){Q(f,ha)}),!0);null!=A&&(A.div=V);this.repositionLibrary(E,"L.scratchpad"!=c.getHash());q=V.parentNode.previousSibling;l=q.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&q.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var J=document.createElement("div");J.style.backgroundColor="inherit";
q.style.position="relative";var ia=document.createElement("img");ia.className="geLibraryButton";ia.setAttribute("src",Editor.crossImage);ia.setAttribute("title",mxResources.get("close"));var Y=null;if(".scratchpad"!=c.title||this.closableScratchpad)J.appendChild(ia),mxEvent.addListener(ia,"click",mxUtils.bind(this,function(ha){if(!mxEvent.isConsumed(ha)){var k=mxUtils.bind(this,function(){null!=A&&mxUtils.remove(A,this.openLibraries);this.closeLibrary(c)});null!=Y?this.confirm(mxResources.get("allChangesLost"),
-null,k,mxResources.get("cancel"),mxResources.get("discardChanges")):k();mxEvent.consume(ha)}}));if(c.isEditable()){var aa=this.editor.graph,ja=null;l=mxUtils.bind(this,function(ha){this.showLibraryDialog(c.getTitle(),V,f,c,c.getMode());mxEvent.consume(ha)});var ka=mxUtils.bind(this,function(ha){c.setModified(!0);c.isAutosave()?(null!=ja&&null!=ja.parentNode&&ja.parentNode.removeChild(ja),ja=ia.cloneNode(!1),ja.setAttribute("src",Editor.spinImage),ja.setAttribute("title",mxResources.get("saving")),
+null,k,mxResources.get("cancel"),mxResources.get("discardChanges")):k();mxEvent.consume(ha)}}));if(c.isEditable()){var aa=this.editor.graph,ja=null;l=mxUtils.bind(this,function(ha){this.showLibraryDialog(c.getTitle(),V,f,c,c.getMode());mxEvent.consume(ha)});var la=mxUtils.bind(this,function(ha){c.setModified(!0);c.isAutosave()?(null!=ja&&null!=ja.parentNode&&ja.parentNode.removeChild(ja),ja=ia.cloneNode(!1),ja.setAttribute("src",Editor.spinImage),ja.setAttribute("title",mxResources.get("saving")),
ja.style.cursor="default",ja.style.marginRight="2px",ja.style.marginTop="-2px",J.insertBefore(ja,J.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=ja&&null!=ja.parentNode&&ja.parentNode.removeChild(ja)})):null==Y&&(Y=ia.cloneNode(!1),Y.setAttribute("src",Editor.saveImage),Y.setAttribute("title",mxResources.get("save")),J.insertBefore(Y,J.firstChild),mxEvent.addListener(Y,"click",mxUtils.bind(this,function(k){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==
-LocalLibrary,!0,function(){null==Y||c.isModified()||(Y.parentNode.removeChild(Y),Y=null)});mxEvent.consume(k)})))}),ua=mxUtils.bind(this,function(ha,k,u,H){ha=aa.cloneCells(mxUtils.sortCells(aa.model.getTopmostCells(ha)));for(var P=0;P<ha.length;P++){var T=aa.getCellGeometry(ha[P]);null!=T&&T.translate(-k.x,-k.y)}V.appendChild(this.sidebar.createVertexTemplateFromCells(ha,k.width,k.height,H||"",!0,null,!1));ha=mxUtils.getXml(this.editor.graph.encodeCells(ha));Editor.defaultCompressed&&(ha=Graph.compress(ha));
-k={xml:ha,w:k.width,h:k.height};null!=H&&(k.title=H);f.push(k);ka(u);null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null)}),Da=mxUtils.bind(this,function(ha){if(aa.isSelectionEmpty())aa.getRubberband().isActive()?(aa.getRubberband().execute(ha),aa.getRubberband().reset()):null!=ha&&null!=mxEvent.getSource(ha)&&mxEvent.getSource(ha).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var k=
+LocalLibrary,!0,function(){null==Y||c.isModified()||(Y.parentNode.removeChild(Y),Y=null)});mxEvent.consume(k)})))}),ua=mxUtils.bind(this,function(ha,k,u,H){ha=aa.cloneCells(mxUtils.sortCells(aa.model.getTopmostCells(ha)));for(var P=0;P<ha.length;P++){var U=aa.getCellGeometry(ha[P]);null!=U&&U.translate(-k.x,-k.y)}V.appendChild(this.sidebar.createVertexTemplateFromCells(ha,k.width,k.height,H||"",!0,null,!1));ha=mxUtils.getXml(this.editor.graph.encodeCells(ha));Editor.defaultCompressed&&(ha=Graph.compress(ha));
+k={xml:ha,w:k.width,h:k.height};null!=H&&(k.title=H);f.push(k);la(u);null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null)}),Da=mxUtils.bind(this,function(ha){if(aa.isSelectionEmpty())aa.getRubberband().isActive()?(aa.getRubberband().execute(ha),aa.getRubberband().reset()):null!=ha&&null!=mxEvent.getSource(ha)&&mxEvent.getSource(ha).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var k=
aa.getSelectionCells(),u=aa.view.getBounds(k);if(null!=u&&0<u.width&&0<u.height){var H=aa.view.scale;u.x/=H;u.y/=H;u.width/=H;u.height/=H;u.x-=aa.view.translate.x;u.y-=aa.view.translate.y;ua(k,u)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(ha)});mxEvent.addGestureListeners(V,function(){},mxUtils.bind(this,function(ha){aa.isMouseDown&&null!=aa.panningManager&&null!=aa.graphHandler.first&&(aa.graphHandler.suspend(),null!=aa.graphHandler.hint&&
(aa.graphHandler.hint.style.visibility="hidden"),V.style.backgroundColor="light-dark(#fefefe, #000000)",V.style.cursor="copy",aa.panningManager.stop(),aa.autoScroll=!1,mxEvent.consume(ha))}),mxUtils.bind(this,function(ha){aa.isMouseDown&&null!=aa.panningManager&&null!=aa.graphHandler&&(V.style.backgroundColor="",V.style.cursor="default",this.sidebar.showTooltips=!0,aa.panningManager.stop(),aa.graphHandler.reset(),aa.isMouseDown=!1,aa.autoScroll=!0,Da(ha),mxEvent.consume(ha))}));mxEvent.addListener(V,
"mouseleave",mxUtils.bind(this,function(ha){aa.isMouseDown&&null!=aa.graphHandler.first&&(aa.graphHandler.resume(),null!=aa.graphHandler.hint&&(aa.graphHandler.hint.style.visibility="visible"),V.style.backgroundColor="",V.style.cursor="",aa.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(V,"dragover",mxUtils.bind(this,function(ha){V.style.backgroundColor="light-dark(#fefefe, #000000)";ha.dataTransfer.dropEffect="copy";V.style.cursor="copy";this.sidebar.hideTooltip();ha.stopPropagation();
-ha.preventDefault()})),mxEvent.addListener(V,"drop",mxUtils.bind(this,function(ha){V.style.cursor="";V.style.backgroundColor="";0<ha.dataTransfer.files.length&&this.importFiles(ha.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(k,u,H,P,T,W,fa,X,ea){if(null!=k&&"image/"==u.substring(0,6))k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(k),k=[new mxCell("",new mxGeometry(0,0,T,W),k)],k[0].vertex=!0,ua(k,new mxRectangle(0,
-0,T,W),ha,mxEvent.isAltDown(ha)?null:fa.substring(0,fa.lastIndexOf(".")).replace(/_/g," ")),null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null);else{var oa=!1,la=mxUtils.bind(this,function(ca,sa){null!=ca&&"application/pdf"==sa&&(sa=Editor.extractGraphModelFromPdf(ca),null!=sa&&0<sa.length&&(ca=sa));if(null!=ca)if(ca=mxUtils.parseXml(ca),"mxlibrary"==ca.documentElement.nodeName)try{var xa=JSON.parse(mxUtils.getTextContent(ca.documentElement));Q(xa,V);f=f.concat(xa);ka(ha);
-this.spinner.stop();oa=!0}catch(ta){}else if("mxfile"==ca.documentElement.nodeName)try{var qa=ca.documentElement.getElementsByTagName("diagram");for(xa=0;xa<qa.length;xa++){var Ba=this.stringToCells(Editor.getDiagramNodeXml(qa[xa])),ma=this.editor.graph.getBoundingBoxFromGeometry(Ba);null!=ma&&ua(Ba,new mxRectangle(0,0,ma.width,ma.height),ha)}oa=!0}catch(ta){null!=window.console&&console.log("error in drop handler:",ta)}oa||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
-null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null)});null!=ea&&null!=fa&&EditorUi.isVisioFilename(fa)?this.importVisio(ea,function(ca){la(ca,"text/xml")},null,fa):this.isGliffyData(k,fa)&&null!=ea?this.importGliffy(k,mxUtils.bind(this,function(ca){this.spinner.stop();la(ca,"text/xml")}),mxUtils.bind(this,function(ca){this.spinner.stop();this.handleError({message:mxResources.get(null!=ca&&413==ca.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}),
-fa):la(k,u)}}));ha.stopPropagation();ha.preventDefault()})),mxEvent.addListener(V,"dragleave",function(ha){V.style.cursor="";V.style.backgroundColor="";ha.stopPropagation();ha.preventDefault()}));ia=ia.cloneNode(!1);ia.setAttribute("src",Editor.editImage);ia.setAttribute("title",mxResources.get("edit"));J.insertBefore(ia,J.firstChild);mxEvent.addListener(ia,"click",l);l=ia.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));J.insertBefore(l,J.firstChild);
+ha.preventDefault()})),mxEvent.addListener(V,"drop",mxUtils.bind(this,function(ha){V.style.cursor="";V.style.backgroundColor="";0<ha.dataTransfer.files.length&&this.importFiles(ha.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(k,u,H,P,U,W,fa,X,ea){if(null!=k&&"image/"==u.substring(0,6))k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(k),k=[new mxCell("",new mxGeometry(0,0,U,W),k)],k[0].vertex=!0,ua(k,new mxRectangle(0,
+0,U,W),ha,mxEvent.isAltDown(ha)?null:fa.substring(0,fa.lastIndexOf(".")).replace(/_/g," ")),null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null);else{var oa=!1,ka=mxUtils.bind(this,function(ba,sa){null!=ba&&"application/pdf"==sa&&(sa=Editor.extractGraphModelFromPdf(ba),null!=sa&&0<sa.length&&(ba=sa));if(null!=ba)if(ba=mxUtils.parseXml(ba),"mxlibrary"==ba.documentElement.nodeName)try{var xa=JSON.parse(mxUtils.getTextContent(ba.documentElement));Q(xa,V);f=f.concat(xa);la(ha);
+this.spinner.stop();oa=!0}catch(ta){}else if("mxfile"==ba.documentElement.nodeName)try{var qa=ba.documentElement.getElementsByTagName("diagram");for(xa=0;xa<qa.length;xa++){var Ba=this.stringToCells(Editor.getDiagramNodeXml(qa[xa])),ma=this.editor.graph.getBoundingBoxFromGeometry(Ba);null!=ma&&ua(Ba,new mxRectangle(0,0,ma.width,ma.height),ha)}oa=!0}catch(ta){null!=window.console&&console.log("error in drop handler:",ta)}oa||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
+null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null)});null!=ea&&null!=fa&&EditorUi.isVisioFilename(fa)?this.importVisio(ea,function(ba){ka(ba,"text/xml")},null,fa):this.isGliffyData(k,fa)&&null!=ea?this.importGliffy(k,mxUtils.bind(this,function(ba){this.spinner.stop();ka(ba,"text/xml")}),mxUtils.bind(this,function(ba){this.spinner.stop();this.handleError({message:mxResources.get(null!=ba&&413==ba.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}),
+fa):ka(k,u)}}));ha.stopPropagation();ha.preventDefault()})),mxEvent.addListener(V,"dragleave",function(ha){V.style.cursor="";V.style.backgroundColor="";ha.stopPropagation();ha.preventDefault()}));ia=ia.cloneNode(!1);ia.setAttribute("src",Editor.editImage);ia.setAttribute("title",mxResources.get("edit"));J.insertBefore(ia,J.firstChild);mxEvent.addListener(ia,"click",l);l=ia.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));J.insertBefore(l,J.firstChild);
mxEvent.addListener(l,"click",Da);".scratchpad"==c.title&&(this.addSelectionToScratchpad=Da);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",J.insertBefore(l,J.firstChild))}q.appendChild(J);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var l=0;l<c.length;l++)try{var q=c[l],x=q.data;if(null!=x){x="data:"==x.substring(0,
5)?this.convertDataUri(x):x;var A="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==q.aspect&&(A+="aspect=fixed;");A=A+"image="+x+";";null!=q.style&&(A+=q.style);f.appendChild(this.sidebar.createVertexTemplate(A,q.w,q.h,"",q.title||"",!1,null,!0))}else if(null!=q.xml){var E=this.stringToCells("<"==q.xml.charAt(0)?q.xml:Graph.decompress(q.xml)),K=0==E.length?mxResources.get("drawingEmpty"):null!=q.title?q.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(E,
q.w,q.h,K,!0,null,!0))}}catch(Q){K=null!=Q.message?mxResources.get("error")+": "+Q.message:String(Q),A=this.sidebar.createVertexTemplateFromCells(null,q.w,q.h,K,!0,null,!0),f.appendChild(A)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",
Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,l,q,x,A,E){c=new ImageDialog(this,c,f,l,q,x,A,E);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,l,q,x,A){var E=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=E?JSON.stringify(JSON.parse(E),null,2):"",mxUtils.bind(this,function(K){if(null!=K)try{if(null!=A&&A(K),K==E)this.hideDialog();
else{if(0<K.length){var Q=JSON.parse(K);localStorage.setItem(f,JSON.stringify(Q))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(V){this.handleError(V)}}),null,mxResources.get("close"),null,null,null,!0,null,null,x,l,q);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=function(c,f,l,q){function x(X){ja?V.confirm(mxResources.get("allChangesLost"),
-null,X,mxResources.get("cancel"),mxResources.get("discardChanges")):X()}function A(){ka=!0;V.hideDialog()}function E(X,ea){var oa=document.createElement("div");oa.style.padding="4px 16px";oa.style.cursor="pointer";oa.style.fontSize="13px";oa.style.borderBottom=ea?"2px solid #29b6f2":"2px solid transparent";oa.style.fontWeight=ea?"bold":"normal";oa.style.color=ea?"":"#888";oa.style.userSelect="none";mxUtils.write(oa,X);return oa}function K(X,ea){X.style.borderBottomColor=ea?"#29b6f2":"transparent";
-X.style.fontWeight=ea?"bold":"normal";X.style.color=ea?"":"#888"}function Q(X){if(X!==aa){if("json"===aa)try{var ea=JSON.parse(T.value);Y=ea;H.setConfig(ea)}catch(oa){}else"json"===X&&null!=Y&&(T.value=JSON.stringify(Y,null,2));k.style.display="editor"===X?"":"none";P.style.display="json"===X?"":"none";K(Da,"editor"===X);K(ha,"json"===X);"json"===X&&T.focus();aa=X}}var V=this,J=localStorage.getItem(f),ia={};try{null!=J&&(ia=JSON.parse(J))}catch(X){}var Y=ia,aa="editor",ja=!1,ka=!1;c=document.createElement("div");
+null,X,mxResources.get("cancel"),mxResources.get("discardChanges")):X()}function A(){la=!0;V.hideDialog()}function E(X,ea){var oa=document.createElement("div");oa.style.padding="4px 16px";oa.style.cursor="pointer";oa.style.fontSize="13px";oa.style.borderBottom=ea?"2px solid #29b6f2":"2px solid transparent";oa.style.fontWeight=ea?"bold":"normal";oa.style.color=ea?"":"#888";oa.style.userSelect="none";mxUtils.write(oa,X);return oa}function K(X,ea){X.style.borderBottomColor=ea?"#29b6f2":"transparent";
+X.style.fontWeight=ea?"bold":"normal";X.style.color=ea?"":"#888"}function Q(X){if(X!==aa){if("json"===aa)try{var ea=JSON.parse(U.value);Y=ea;H.setConfig(ea)}catch(oa){}else"json"===X&&null!=Y&&(U.value=JSON.stringify(Y,null,2));k.style.display="editor"===X?"":"none";P.style.display="json"===X?"":"none";K(Da,"editor"===X);K(ha,"json"===X);"json"===X&&U.focus();aa=X}}var V=this,J=localStorage.getItem(f),ia={};try{null!=J&&(ia=JSON.parse(J))}catch(X){}var Y=ia,aa="editor",ja=!1,la=!1;c=document.createElement("div");
c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right="20px";var ua=document.createElement("div");ua.style.position="absolute";ua.style.left="0";ua.style.right="0";ua.style.top="0";ua.style.height="28px";ua.style.display="flex";ua.style.alignItems="end";ua.style.borderBottom="1px solid #d0d0d0";var Da=E(mxResources.get("editor"),!0),ha=E(mxResources.get("formatJson"),!1);ua.appendChild(Da);ua.appendChild(ha);c.appendChild(ua);var k=document.createElement("div");
k.style.position="absolute";k.style.left="0";k.style.right="0";k.style.top="30px";k.style.bottom="50px";ua={};try{var u=V.editor.graph;null!=u.currentVertexStyle&&(ua.currentVertexStyle=u.currentVertexStyle);null!=u.currentEdgeStyle&&(ua.currentEdgeStyle=u.currentEdgeStyle)}catch(X){}var H=DrawioConfigEditor.install(k,{initialConfig:ia,editorContext:ua,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:V.isHighContrast(),onConfigChanged:function(X){Y=X;ja=!0}}),P=document.createElement("div");
-P.style.position="absolute";P.style.left="0";P.style.right="0";P.style.top="30px";P.style.bottom="50px";P.style.display="none";var T=document.createElement("textarea");T.setAttribute("wrap","off");T.setAttribute("spellcheck","false");T.setAttribute("autocorrect","off");T.setAttribute("autocomplete","off");T.setAttribute("autocapitalize","off");T.style.resize="none";T.style.outline="none";T.style.boxSizing="border-box";T.style.width="100%";T.style.height="100%";try{T.value=null!=J?JSON.stringify(JSON.parse(J),
-null,2):""}catch(X){T.value=J||""}mxEvent.addListener(T,"input",function(){ja=!0});P.appendChild(T);c.appendChild(k);c.appendChild(P);mxEvent.addListener(Da,"click",function(){Q("editor")});mxEvent.addListener(ha,"click",function(){Q("json")});var W=document.createElement("div");W.style.position="absolute";W.style.left="0";W.style.right="0";W.style.bottom="0";W.style.height="46px";W.style.display="flex";W.style.whiteSpace="nowrap";W.style.alignItems="center";W.style.justifyContent="end";W.style.paddingTop=
-"10px";W.style.paddingBottom="10px";W.style.boxSizing="border-box";null==q||V.isOffline()||W.appendChild(V.createHelpIcon(q));if(null!=l)for(q=0;q<l.length;q++)(function(X,ea,oa){X=mxUtils.button(X,function(la){"json"!==aa&&null!=Y&&(T.value=JSON.stringify(Y,null,2));ea(la,T)});null!=oa&&X.setAttribute("title",oa);X.className="geBtn";W.appendChild(X)})(l[q][0],l[q][1],l[q][2]);q=mxUtils.button(mxResources.get("close"),function(){x(A)});q.setAttribute("title","Escape");q.className="geBtn";var fa=mxUtils.button(mxResources.get("apply"),
-function(){if(ja){if("json"!==aa){var X=H.getInvalidFields();if(0<X.length){V.handleError({message:mxResources.get("invalidInput")+": "+X.join(", ")});return}X=null!=Y&&0<Object.keys(Y).length?JSON.stringify(Y,null,2):""}else X=T.value;try{if(X==J)ja=!1,A();else{if(0<X.length){var ea=JSON.parse(X);localStorage.setItem(f,JSON.stringify(ea))}else localStorage.removeItem(f);ja=!1;A();V.alert(mxResources.get("restartForChangeRequired"))}}catch(oa){V.handleError(oa)}}else A()});fa.className="geBtn gePrimaryBtn";
-V.editor.cancelFirst?(W.appendChild(q),W.appendChild(fa)):(W.appendChild(fa),W.appendChild(q));c.appendChild(W);mxEvent.addListener(c,"keydown",function(X){13===X.keyCode&&mxEvent.isControlDown(X)&&fa.click()});V.showDialog(c,800,600,!0,!1,function(X,ea){if(!ka&&ja)return x(A),!1},null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,400));T.scrollTop=0};EditorUi.prototype.showLanguageDialog=function(){function c(){var Q=mxLanguage;null==urlParams.lang&&isLocalStorage&&(Q=mxSettings.settings.language);
+P.style.position="absolute";P.style.left="0";P.style.right="0";P.style.top="30px";P.style.bottom="50px";P.style.display="none";var U=document.createElement("textarea");U.setAttribute("wrap","off");U.setAttribute("spellcheck","false");U.setAttribute("autocorrect","off");U.setAttribute("autocomplete","off");U.setAttribute("autocapitalize","off");U.style.resize="none";U.style.outline="none";U.style.boxSizing="border-box";U.style.width="100%";U.style.height="100%";try{U.value=null!=J?JSON.stringify(JSON.parse(J),
+null,2):""}catch(X){U.value=J||""}mxEvent.addListener(U,"input",function(){ja=!0});P.appendChild(U);c.appendChild(k);c.appendChild(P);mxEvent.addListener(Da,"click",function(){Q("editor")});mxEvent.addListener(ha,"click",function(){Q("json")});var W=document.createElement("div");W.style.position="absolute";W.style.left="0";W.style.right="0";W.style.bottom="0";W.style.height="46px";W.style.display="flex";W.style.whiteSpace="nowrap";W.style.alignItems="center";W.style.justifyContent="end";W.style.paddingTop=
+"10px";W.style.paddingBottom="10px";W.style.boxSizing="border-box";null==q||V.isOffline()||W.appendChild(V.createHelpIcon(q));if(null!=l)for(q=0;q<l.length;q++)(function(X,ea,oa){X=mxUtils.button(X,function(ka){"json"!==aa&&null!=Y&&(U.value=JSON.stringify(Y,null,2));ea(ka,U)});null!=oa&&X.setAttribute("title",oa);X.className="geBtn";W.appendChild(X)})(l[q][0],l[q][1],l[q][2]);q=mxUtils.button(mxResources.get("close"),function(){x(A)});q.setAttribute("title","Escape");q.className="geBtn";var fa=mxUtils.button(mxResources.get("apply"),
+function(){if(ja){if("json"!==aa){var X=H.getInvalidFields();if(0<X.length){V.handleError({message:mxResources.get("invalidInput")+": "+X.join(", ")});return}X=null!=Y&&0<Object.keys(Y).length?JSON.stringify(Y,null,2):""}else X=U.value;try{if(X==J)ja=!1,A();else{if(0<X.length){var ea=JSON.parse(X);localStorage.setItem(f,JSON.stringify(ea))}else localStorage.removeItem(f);ja=!1;A();V.alert(mxResources.get("restartForChangeRequired"))}}catch(oa){V.handleError(oa)}}else A()});fa.className="geBtn gePrimaryBtn";
+V.editor.cancelFirst?(W.appendChild(q),W.appendChild(fa)):(W.appendChild(fa),W.appendChild(q));c.appendChild(W);mxEvent.addListener(c,"keydown",function(X){13===X.keyCode&&mxEvent.isControlDown(X)&&fa.click()});V.showDialog(c,800,600,!0,!1,function(X,ea){if(!la&&ja)return x(A),!1},null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,400));U.scrollTop=0};EditorUi.prototype.showLanguageDialog=function(){function c(){var Q=mxLanguage;null==urlParams.lang&&isLocalStorage&&(Q=mxSettings.settings.language);
for(var V=!1===navigator.onLine,J=Object.create(null),ia=0;ia<x.length;ia++){var Y=x[ia];J[Y.code]=Y.box.checked;Y.box.disabled="en"==Y.code||Y.code==Q&&Y.box.checked||V&&!Y.box.checked;Y.box.style.cursor=Y.box.disabled?"":"pointer";Y.row.style.cursor=Y.box.disabled?"default":"pointer";V&&!Y.box.checked?Y.row.setAttribute("title",mxResources.get("notInOffline")):Y.row.removeAttribute("title")}}var f=this,l=document.createElement("div");l.style.position="absolute";l.style.top="10px";l.style.bottom=
"10px";l.style.left="16px";l.style.right="16px";var q=document.createElement("div");q.style.position="absolute";q.style.left="0";q.style.right="0";q.style.top="0";q.style.bottom="46px";q.style.overflow="auto";l.appendChild(q);var x=[];f.getOfflineLanguages(function(Q){for(var V=Object.create(null),J=0;J<Q.length;J++)V[Q[J]]=!0;Q=[];for(var ia in mxLanguageMap)"i18n"!=ia&&""!=mxLanguageMap[ia]&&Q.push({code:ia,name:mxLanguageMap[ia]});Q.sort(function(aa,ja){return aa.name.localeCompare(ja.name)});
-J=document.createElement("div");J.style.padding="8px 4px 0 4px";J.style.color="#888";mxUtils.write(J,mxResources.get("offlineLanguages",null,"Languages available offline"));q.appendChild(J);var Y=document.createElement("div");Y.style.display="grid";Y.style.gridTemplateColumns="repeat(auto-fill, minmax(170px, 1fr))";Y.style.gap="2px 16px";Y.style.padding="8px 4px";Y.style.cursor="pointer";for(J=0;J<Q.length;J++)(function(aa,ja){var ka=document.createElement("label");ka.style.display="flex";ka.style.alignItems=
-"center";ka.style.padding="4px";ka.style.overflow="hidden";ka.style.whiteSpace="nowrap";var ua=document.createElement("span");ua.style.display="inline-flex";ua.style.alignItems="center";ua.style.justifyContent="center";ua.style.position="relative";ua.style.width="16px";ua.style.height="16px";ua.style.margin="0 8px 0 0";ua.style.flexShrink="0";var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.style.margin="0";Da.checked="en"==aa||1==V[aa];x.push({code:aa,box:Da,row:ka});
-mxEvent.addListener(Da,"change",function(){Da.style.display="none";var k=f.createSpinner(null,null,4);k.spin(ua);var u=function(){f.getOfflineLanguages(function(H){k.stop();Da.style.display="";Da.checked=0<=mxUtils.indexOf(H,aa);c()});f.updateOfflineLanguages()};Da.checked?fetch("resources/dia_"+aa+".txt").then(u,u):f.removeOfflineLanguage(aa,u)});ua.appendChild(Da);ka.appendChild(ua);var ha=document.createElement("span");ha.style.overflow="hidden";ha.style.textOverflow="ellipsis";ha.style.lineHeight=
-"normal";mxUtils.write(ha,ja);ka.appendChild(ha);Y.appendChild(ka)})(Q[J].code,Q[J].name);q.appendChild(Y);c()});var A=function(){c()};mxEvent.addListener(window,"online",A);mxEvent.addListener(window,"offline",A);var E=document.createElement("div");E.style.position="absolute";E.style.left="0";E.style.right="0";E.style.bottom="0";E.style.height="46px";E.style.display="flex";E.style.whiteSpace="nowrap";E.style.alignItems="center";E.style.justifyContent="end";E.style.paddingTop="10px";E.style.paddingBottom=
+J=document.createElement("div");J.style.padding="8px 4px 0 4px";J.style.color="#888";mxUtils.write(J,mxResources.get("offlineLanguages",null,"Languages available offline"));q.appendChild(J);var Y=document.createElement("div");Y.style.display="grid";Y.style.gridTemplateColumns="repeat(auto-fill, minmax(170px, 1fr))";Y.style.gap="2px 16px";Y.style.padding="8px 4px";Y.style.cursor="pointer";for(J=0;J<Q.length;J++)(function(aa,ja){var la=document.createElement("label");la.style.display="flex";la.style.alignItems=
+"center";la.style.padding="4px";la.style.overflow="hidden";la.style.whiteSpace="nowrap";var ua=document.createElement("span");ua.style.display="inline-flex";ua.style.alignItems="center";ua.style.justifyContent="center";ua.style.position="relative";ua.style.width="16px";ua.style.height="16px";ua.style.margin="0 8px 0 0";ua.style.flexShrink="0";var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.style.margin="0";Da.checked="en"==aa||1==V[aa];x.push({code:aa,box:Da,row:la});
+mxEvent.addListener(Da,"change",function(){Da.style.display="none";var k=f.createSpinner(null,null,4);k.spin(ua);var u=function(){f.getOfflineLanguages(function(H){k.stop();Da.style.display="";Da.checked=0<=mxUtils.indexOf(H,aa);c()});f.updateOfflineLanguages()};Da.checked?fetch("resources/dia_"+aa+".txt").then(u,u):f.removeOfflineLanguage(aa,u)});ua.appendChild(Da);la.appendChild(ua);var ha=document.createElement("span");ha.style.overflow="hidden";ha.style.textOverflow="ellipsis";ha.style.lineHeight=
+"normal";mxUtils.write(ha,ja);la.appendChild(ha);Y.appendChild(la)})(Q[J].code,Q[J].name);q.appendChild(Y);c()});var A=function(){c()};mxEvent.addListener(window,"online",A);mxEvent.addListener(window,"offline",A);var E=document.createElement("div");E.style.position="absolute";E.style.left="0";E.style.right="0";E.style.bottom="0";E.style.height="46px";E.style.display="flex";E.style.whiteSpace="nowrap";E.style.alignItems="center";E.style.justifyContent="end";E.style.paddingTop="10px";E.style.paddingBottom=
"10px";E.style.boxSizing="border-box";var K=mxUtils.button(mxResources.get("close"),function(){f.hideDialog()});K.setAttribute("title","Escape");K.className="geBtn gePrimaryBtn";E.appendChild(K);l.appendChild(E);this.showDialog(l,480,460,!0,!0,function(){mxEvent.removeListener(window,"online",A);mxEvent.removeListener(window,"offline",A)})};EditorUi.prototype.showBackgroundImageDialog=function(c,f,l,q){c=null!=c?c:mxUtils.bind(this,function(x,A,E){A||(x=new ChangePageSetup(this,q?E:null,x),x.ignoreColor=
!q,this.editor.graph.model.execute(x))});c=new BackgroundImageDialog(this,c,f,l,q);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,l,q,x){c=new LibraryDialog(this,c,f,l,q,x);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(A){A&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}),!1,!1,new mxRectangle(0,0,480,320));c.init()};EditorUi.prototype.getCollapsedSections=function(){return mxSettings.getCollapsedSections()};
EditorUi.prototype.getLibraryExpanded=function(c,f){var l=mxSettings.getCollapsedLibraries();return null!=l[c]?!l[c]:f};EditorUi.prototype.setLibraryExpanded=function(c,f){if(null!=c){var l=mxSettings.getCollapsedLibraries();l[c]=!f;mxSettings.setCollapsedLibraries(l);mxSettings.save()}};var m=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&
@@ -4290,7 +4292,7 @@ f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,l,q,x,A,E){
if(null!=Q){null!=Q.retry&&(V=mxResources.get("cancel"),J=function(){K();Q.retry()});if(404==Q.code||404==Q.status||403==Q.code){E=403==Q.code?null!=Q.message?mxUtils.htmlEntities(Q.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=x?x:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var ia=null!=x?null:null!=A?A:window.location.hash;if(null!=ia&&("#G"==ia.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==
ia.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==Q.code||404==Q.status)){ia="#U"==ia.substring(0,2)?ia.substring(45,ia.lastIndexOf("%26ex")):ia.substring(2);this.showError(f,E,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ia);null!=q&&q()}),J,
mxResources.get("changeUser"),mxUtils.bind(this,function(){function Y(){ua.innerText="";for(var Da=0;Da<aa.length;Da++){var ha=document.createElement("option");mxUtils.write(ha,aa[Da].displayName);ha.value=Da;ua.appendChild(ha);ha=document.createElement("option");ha.innerHTML="&nbsp;&nbsp;&nbsp;";mxUtils.write(ha,"<"+aa[Da].email+">");ha.setAttribute("disabled","disabled");ua.appendChild(ha)}ha=document.createElement("option");mxUtils.write(ha,mxResources.get("addAccount"));ha.value=aa.length;ua.appendChild(ha)}
-var aa=this.drive.getUsersList(),ja=document.createElement("div"),ka=document.createElement("div");ka.style.marginBottom="6px";mxUtils.write(ka,mxResources.get("changeUser")+": ");ja.appendChild(ka);var ua=document.createElement("select");ua.style.width="100%";Y();mxEvent.addListener(ua,"change",mxUtils.bind(this,function(){var Da=ua.value,ha=aa.length!=Da;ha&&this.drive.setUser(aa[Da]);this.drive.authorize(ha,mxUtils.bind(this,function(){ha||(aa=this.drive.getUsersList(),Y())}),mxUtils.bind(this,
+var aa=this.drive.getUsersList(),ja=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");ja.appendChild(la);var ua=document.createElement("select");ua.style.width="100%";Y();mxEvent.addListener(ua,"change",mxUtils.bind(this,function(){var Da=ua.value,ha=aa.length!=Da;ha&&this.drive.setUser(aa[Da]);this.drive.authorize(ha,mxUtils.bind(this,function(){ha||(aa=this.drive.getUsersList(),Y())}),mxUtils.bind(this,
function(k){this.handleError(k)}),!0)}));ja.appendChild(ua);ja=new CustomDialog(this,ja,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ja.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=Q.message?E=""==Q.message&&null!=Q.name?mxUtils.htmlEntities(Q.name,!1):mxUtils.htmlEntities(Q.message,!1):null!=Q.response&&null!=Q.response.error?E=mxUtils.htmlEntities(Q.response.error,
!1):"undefined"!==typeof window.App&&(Q.code==App.ERROR_TIMEOUT?E=mxUtils.htmlEntities(mxResources.get("timeout"),!1):Q.code==App.ERROR_BUSY?E=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof Q&&0<Q.length&&(E=mxUtils.htmlEntities(Q,!1)))}x=c=null;null!=Q&&null!=Q.helpLink?(c=mxResources.get("help"),x=mxUtils.bind(this,function(){return this.editor.graph.openLink(Q.helpLink)})):null!=Q&&null!=Q.ownerEmail?(c=mxResources.get("contactOwner"),E+=mxUtils.htmlEntities(" ("+c+": "+Q.ownerEmail+
")",!1),x=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(Q.ownerEmail))})):null!=Q&&null!=Q.alternateAction&&(c=Q.alternateAction.label,x=Q.alternateAction.funct);this.showError(f,E,V,l,J,null,null,c,x,null!=Q?Q.dialogWidth:null,null,null,q?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,f,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,l,q,x,A){c=
@@ -4299,7 +4301,7 @@ c])){E=null!=E?E:"translate(-50%,120%)";K=null!=K?K:"translate(-50%,0%)";var V=d
"doNotShowAgain":"close"));Q.setAttribute("border","0");x||(A=document.createElement("img"),A.setAttribute("src",IMAGE_PATH+"/logo.png"),A.setAttribute("border","0"),A.setAttribute("align","absmiddle"),A.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",V.appendChild(A),Q.style.cssText=(x?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",V.appendChild(Q));mxUtils.write(V,f);document.body.appendChild(V);
this.bannerShowing=!0;x&&(Q.className="geLibraryButton",V.appendChild(Q));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var J=document.createElement("input");J.setAttribute("type","checkbox");J.setAttribute("id","geDoNotShowAgainCheckbox");J.style.marginRight="6px";if(!q){f.appendChild(J);var ia=document.createElement("label");ia.setAttribute("for","geDoNotShowAgainCheckbox");
mxUtils.write(ia,mxResources.get("doNotShowAgain"));f.appendChild(ia);V.style.paddingBottom=x?"16px":"30px";V.appendChild(f)}var Y=mxUtils.bind(this,function(){null!=V.parentNode&&(V.parentNode.removeChild(V),this.bannerShowing=!1,J.checked||q)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=Q&&mxEvent.addListener(Q,"click",mxUtils.bind(this,function(ja){mxEvent.consume(ja);Y()}));var aa=mxUtils.bind(this,
-function(){mxUtils.setPrefixedStyle(V.style,"transform",E);window.setTimeout(mxUtils.bind(this,function(){Y()}),1E3)});mxEvent.addListener(V,"click",mxUtils.bind(this,function(ja){var ka=mxEvent.getSource(ja);ka!=J&&ka!=ia?(null!=l&&l(),Y(),mxEvent.consume(ja)):aa()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",K)}),500);window.setTimeout(aa,x?5E3:3E4);A=!0}return A};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=
+function(){mxUtils.setPrefixedStyle(V.style,"transform",E);window.setTimeout(mxUtils.bind(this,function(){Y()}),1E3)});mxEvent.addListener(V,"click",mxUtils.bind(this,function(ja){var la=mxEvent.getSource(ja);la!=J&&la!=ia?(null!=l&&l(),Y(),mxEvent.consume(ja)):aa()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",K)}),500);window.setTimeout(aa,x?5E3:3E4);A=!0}return A};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=
c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,l,q){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<q&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",q));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,l,q,x){var A="jpeg"==l?"jpg":l;q=this.getBaseFilename(q)+(null!=f?".drawio":"")+"."+
A;c=this.createImageDataUri(c,f,l,x);this.saveData(q,A,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatAnimatedGif"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var l=document.createElement("div");l.className="geDialogFormRow";var q=document.createElement("span");q.className=
"geDialogFormLabel";mxUtils.write(q,mxResources.get("speed")+":");l.appendChild(q);var x=document.createElement("select"),A=[{label:mxResources.get("slow"),value:8},{label:mxResources.get("medium"),value:15},{label:mxResources.get("fast"),value:24}];for(q=0;q<A.length;q++){var E=document.createElement("option");mxUtils.write(E,A[q].label);E.setAttribute("value",A[q].value);x.appendChild(E)}x.value=null!=this.lastExportFps?this.lastExportFps:15;0>x.selectedIndex&&(x.value=15);l.appendChild(x);f.appendChild(l);
@@ -4313,8 +4315,8 @@ function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try
this.handleError(f)}};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,
f,l,q,x,A){"text/xml"!=l||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=A?A:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,l,q);else{var E=document.createElement("a");A=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof E.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var K=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
A=65==(K?parseInt(K[2],10):!1)?!1:A}if(A||this.isOffline()){E.href=URL.createObjectURL(q?this.base64ToBlob(c,l):new Blob([c],{type:l}));A?E.download=f:E.setAttribute("target","_blank");document.body.appendChild(E);try{window.setTimeout(function(){URL.revokeObjectURL(E.href)},2E4),E.click(),E.parentNode.removeChild(E)}catch(Q){}}else this.createEchoRequest(c,f,l,q,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,l,q,x,A){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,
-c+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=A?"&base64="+A:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(q?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,l,q,x,A,E,K,Q){A=null!=A?A:!1;E=null!=E?E:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(ia,Y,aa,ja){try{if("_blank"==Y)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,q);else if(null!=l&&"text/html"==l.substring(0,9)&&c.length<EmbedDialog.maxSize){var ka=
-new EmbedDialog(this,c,null,null,null,null,null,null,null,!0);this.showDialog(ka.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));ka.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(Y==App.MODE_DEVICE||"download"==Y)this.doSaveLocalFile(c,ia,l,q,null,K);else if(null!=ia&&0<ia.length){var ua=mxUtils.bind(this,function(Da){try{this.exportFile(c,ia,l,q,Y,Da)}catch(ha){this.handleError(ha)}});null!=ja?ua(ja):
+c+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=A?"&base64="+A:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(q?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,l,q,x,A,E,K,Q){A=null!=A?A:!1;E=null!=E?E:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(ia,Y,aa,ja){try{if("_blank"==Y)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,q);else if(null!=l&&"text/html"==l.substring(0,9)&&c.length<EmbedDialog.maxSize){var la=
+new EmbedDialog(this,c,null,null,null,null,null,null,null,!0);this.showDialog(la.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));la.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(Y==App.MODE_DEVICE||"download"==Y)this.doSaveLocalFile(c,ia,l,q,null,K);else if(null!=ia&&0<ia.length){var ua=mxUtils.bind(this,function(Da){try{this.exportFile(c,ia,l,q,Y,Da)}catch(ha){this.handleError(ha)}});null!=ja?ua(ja):
this.pickFolder(Y,ua)}}catch(Da){this.handleError(Da)}});x=[];A||x.push(App.MODE_BROWSER);E||x.push("_blank");var J=new SaveDialog(this,f,mxUtils.bind(this,function(ia,Y,aa){V(ia.value,Y,ia,aa);this.hideDialog(null,null,J.container)}),x,c,l,q,Q);this.showDialog(J.container,420,null!=l?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));J.init()};EditorUi.prototype.openInNewWindow=function(c,f,l){null==window.open(URL.createObjectURL(l?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,
!0)};var p=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){var f=null;try{var l=urlParams.tags;try{l=decodeURIComponent(l)}catch(K){}f=JSON.parse(l)}catch(K){}if(null!=f){var q=this.editor.graph,x=mxUtils.bind(this,function(){var K=
null!=this.currentPage?this.currentPage.getId():0;K=f[K];q.hiddenTags=null!=K&&0<K.length?K:[];q.refresh()});this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){x();q.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize()}));this.editor.addListener("pageSelected",x)}this.tagsDialog=this.tagsComponent=null;var A=c(mxUtils.bind(this,function(K){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=
@@ -4330,21 +4332,21 @@ mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.expo
mxEvent.addListener(aa,"click",mxUtils.bind(this,function(){this.openInNewWindow(Y.substring(Y.indexOf(",")+1),"image/png",!0);null!=navigator.clipboard&&"function"===typeof ClipboardItem&&this.writeImageToClipboard(Y,ia.width,ia.height,"image/png",mxUtils.bind(this,function(){var ja=mxResources.get("imageClicked");null!=this.showBanner?this.showBanner("ImageClicked",ja,null,!1,!0):this.alert(ja)}),mxUtils.bind(this,function(ja){this.handleError(ja)}));Q.apply(this,arguments)}))}),null,this.thumbImageCache,
null,mxUtils.bind(this,function(ia){J.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(ia)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(K)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,l,q,x,A){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){A=this.embedMessageSource||window.opener||
window.parent;var E=this.createLoadMessage("export");E.format=f;E.filename=c;E.data=x?"data:"+q+";base64,"+l:l;E.xml=this.getFileData(!0);A.postMessage(JSON.stringify(E),"*")}else this.isLocalFileSave()?this.saveLocalFile(l,c,q,x,f,A):this.saveRequest(c,f,mxUtils.bind(this,function(K,Q){return this.createEchoRequest(l,K,q,x,f,Q)}),l,x,q)};EditorUi.prototype.saveRequest=function(c,f,l,q,x,A,E){E=null!=E?E:!mxClient.IS_IOS||!navigator.standalone;var K=mxUtils.bind(this,function(V,J,ia,Y){if("_blank"==
-J||null!=V&&0<V.length){var aa=l("_blank"==J?null:V,J==App.MODE_DEVICE||"download"==J||null==J||"_blank"==J?"0":"1");null!=aa&&(J==App.MODE_DEVICE||"download"==J||"_blank"==J?aa.simulate(document,"_blank"):(ia=mxUtils.bind(this,function(ja){A=null!=A?A:"pdf"==f?"application/pdf":"image/"+f;if(null!=q)try{this.exportFile(q,V,A,!0,J,ja)}catch(ka){this.handleError(ka)}else this.spinner.spin(document.body,mxResources.get("saving"))&&aa.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=aa.getStatus()&&
-299>=aa.getStatus())try{this.exportFile(aa.getText(),V,A,!0,J,ja)}catch(ka){this.handleError(ka)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(ka){this.spinner.stop();this.handleError(ka)}))}),null!=Y?ia(Y):this.pickFolder(J,ia)))}});x=[App.MODE_BROWSER];E||x.push("_blank");var Q=new SaveDialog(this,c,mxUtils.bind(this,function(V,J,ia){K(V.value,J,V,ia);this.hideDialog(null,null,Q.container)}),x,null,"application/pdf");this.showDialog(Q.container,
+J||null!=V&&0<V.length){var aa=l("_blank"==J?null:V,J==App.MODE_DEVICE||"download"==J||null==J||"_blank"==J?"0":"1");null!=aa&&(J==App.MODE_DEVICE||"download"==J||"_blank"==J?aa.simulate(document,"_blank"):(ia=mxUtils.bind(this,function(ja){A=null!=A?A:"pdf"==f?"application/pdf":"image/"+f;if(null!=q)try{this.exportFile(q,V,A,!0,J,ja)}catch(la){this.handleError(la)}else this.spinner.spin(document.body,mxResources.get("saving"))&&aa.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=aa.getStatus()&&
+299>=aa.getStatus())try{this.exportFile(aa.getText(),V,A,!0,J,ja)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=Y?ia(Y):this.pickFolder(J,ia)))}});x=[App.MODE_BROWSER];E||x.push("_blank");var Q=new SaveDialog(this,c,mxUtils.bind(this,function(V,J,ia){K(V.value,J,V,ia);this.hideDialog(null,null,Q.container)}),x,null,"application/pdf");this.showDialog(Q.container,
420,114,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Q.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,l,q,x,A){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,l){f(null)};EditorUi.prototype.addSvgIconHandlers=function(c){for(var f=
c.querySelectorAll("[data-icon-content]"),l=0;l<f.length;l++)"g"==f[l].nodeName&&f[l].hasAttribute("data-icon")||f[l].removeAttribute("data-icon-content");if(null!=c.querySelector("[data-icon-content]")){f=c.ownerDocument;l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"style"):f.createElement("style");l.appendChild(f.createTextNode(".geSvgPopup { display: inline-block; box-sizing: border-box; max-width: 100%; max-height: 100%; overflow: auto; background-color: #ffffff; border: 1px solid #c0c0c0; border-radius: 4px; box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.25); padding: 8px; color: #000000; font-family: Helvetica, Arial, sans-serif; font-size: 12px; word-break: break-word; } @media (prefers-color-scheme: dark) { .geSvgPopup { background-color: #2a252f; border-color: #505050; color: #ffffff; } } @media print { [data-icon], .geSvgPopup { display: none; } }"));
c.appendChild(l);l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"script"):f.createElement("script");l.setAttribute("type","text/javascript");var q='(function() {\nvar svg = document.documentElement;\nvar fo = null, active = null, pinned = false, thread = null;\nfunction hide() {\nif (fo != null && fo.parentNode != null) { fo.parentNode.removeChild(fo); }\nfo = null; active = null; pinned = false;\n}\nfunction cancel() {\nif (thread != null) { window.clearTimeout(thread); thread = null; }\n}\nfunction schedule() {\ncancel();\nif (!pinned) { thread = window.setTimeout(hide, 300); }\n}\nfunction show(icon) {\ncancel();\nif (active == icon) { return; }\nhide();\nvar content = icon.getAttribute("data-icon-content");\nif (content == null || content == "") { return; }\nvar x = parseFloat(icon.getAttribute("x"));\nvar y = parseFloat(icon.getAttribute("y"));\nvar w = parseFloat(icon.getAttribute("width"));\nif (isNaN(x) || isNaN(y)) {\ntry { var bb = icon.getBBox(); x = bb.x; y = bb.y; w = bb.width; }\ncatch (e) { x = 0; y = 0; }\n}\nif (isNaN(w) || w <= 0) { w = 16; }\nvar vb = (svg.viewBox != null && svg.viewBox.baseVal != null &&\nsvg.viewBox.baseVal.width > 0) ? svg.viewBox.baseVal : null;\nvar maxW = (vb != null) ? vb.width : (svg.clientWidth || 800);\nvar maxH = (vb != null) ? vb.height : (svg.clientHeight || 600);\nvar pw = Math.max(60, Math.min(320, maxW - 4));\nvar ph = Math.max(40, Math.min(220, maxH - 4));\nfo = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");\nfo.setAttribute("width", pw);\nfo.setAttribute("height", ph);\nvar div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");\ndiv.setAttribute("class", "geSvgPopup");\ndiv.innerHTML = content;\ndiv.addEventListener("mouseenter", cancel);\ndiv.addEventListener("mouseleave", schedule);\nfo.appendChild(div);\nsvg.appendChild(fo);\nvar mw = div.offsetWidth;\nvar mh = div.offsetHeight;\nif (mw > 0) { pw = Math.min(pw, mw + 2); }\nif (mh > 0) { ph = Math.min(ph, mh + 2); }\nvar px = x + w + 4;\nvar py = y;\nif (vb != null) {\npx = Math.max(vb.x, Math.min(px, vb.x + vb.width - pw - 2));\npy = Math.max(vb.y, Math.min(py, vb.y + vb.height - ph - 2));\n}\nfo.setAttribute("x", px);\nfo.setAttribute("y", py);\nfo.setAttribute("width", pw);\nfo.setAttribute("height", ph);\nactive = icon;\n}\nvar icons = document.querySelectorAll("g[data-icon][data-icon-content]");\nfor (var i = 0; i < icons.length; i++) {\n(function(icon) {\nicon.addEventListener("click", function(evt) {\nif (active == icon) { hide(); }\nelse { show(icon); pinned = true; }\nevt.preventDefault();\nevt.stopPropagation();\n});\nicon.addEventListener("mouseenter", function() {\nif (pinned) { cancel(); }\nelse { show(icon); }\n});\nicon.addEventListener("mouseleave", schedule);\n})(icons[i]);\n}\ndocument.addEventListener("mousedown", function(evt) {\nif (fo != null && (active == null || !active.contains(evt.target)) &&\n!fo.contains(evt.target)) { hide(); }\n});\ndocument.addEventListener("keydown", function(evt) {\nif (evt.keyCode == 27) { hide(); }\n});\n})();'.replace(/\n/g,
-" ");l.appendChild(f.createCDATASection(q));c.appendChild(l)}};EditorUi.prototype.exportSvg=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua)}));this.handleError(la)})))try{var Da=this.editor.graph.isSelectionEmpty();l=null!=l?l:Da;var ha=f?null:this.editor.graph.background;ha==mxConstants.NONE&&
-(ha=null);null==ha&&0==f&&(ha=this.editor.graph.shapeBackgroundColor);var k=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var u=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==J||"dark"==J)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==J;ua&&(E=Math.max(null!=E?E:0,Math.ceil(16*c)));var P=this.editor.graph.createSvgImageExport(x,ja,ua,"self"==V?"_top":"_blank"),T=Object.create(null),
-W=this.getSvgWithFontLookup(T,P,mxUtils.bind(this,function(){return this.editor.graph.getSvg(ha,c,E,K,null,l,null,P,"blank"==V?"_blank":"self"==V?"_top":null,null,null,J,ia,null,null,null,ka)}));mxUtils.lightDarkColorSupported=u;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=k;q&&this.editor.graph.addSvgShadow(W);ua&&this.addSvgIconHandlers(W);var fa=this.getBaseFilename()+(x?".drawio":"")+".svg";aa=null!=aa?aa:mxUtils.bind(this,function(la){this.isLocalFileSave()||la.length<=
-MAX_REQUEST_SIZE?this.saveData(fa,"svg",la,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});var X=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,l,Q,null,null,null,null,null,c,E));aa(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(W);
-var ea=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&A&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&Y?this.replaceAlternateContent(la,J,X):X(la)}),oa=mxUtils.bind(this,function(la){A&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,ea,this.thumbImageCache)):ea(la)});this.embedFonts(W,oa,Y?!0:!1,T)}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function q(ia,
-Y,aa,ja,ka){var ua=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ua.setAttribute("x",Y);ua.setAttribute("y",aa+.5);ua.setAttribute("width",ja.width);ua.setAttribute("height",ja.height);null==ua.setAttributeNS?ua.setAttribute("xlink:href",ka):ua.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ka);ia.replaceChild(ua,ia.lastChild);K()}function x(){if(E<J.length)J[E++](x)}var A="";f=c.getElementsByTagName("style");for(var E=0;E<f.length;E++)A+=f[E].innerHTML;f=c.getElementsByTagName("switch");
-counter=f.length;var K=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),Q={},V={},J=[];for(E=0;E<f.length;E++)mxUtils.bind(this,function(ia){var Y=ia.getElementsByTagName("div");if(0<Y.length)try{var aa=Y[0].cloneNode(!0),ja=parseInt(aa.style.marginLeft),ka=parseInt(aa.style.paddingTop),ua=aa.getElementsByTagName("div")[1],Da=Y=!1,ha=aa.style.alignItems,k=aa.style.justifyContent;if(null!=aa.style.writingMode){var u=aa.style.writingMode;Da="vertical-"==u.substring(0,9);Y="-rl"==u.substring(u.length-
-3)}var H=!Da&&"1px"==aa.style.width||Da&&"1px"==aa.style.height;if(!Da&&"1px"==aa.style.height||Da&&"1px"==aa.style.width)aa.style.alignItems=Da&&Y?"unsafe flex-end":"unsafe flex-start";H&&(aa.style.justifyContent="unsafe flex-start");aa.style.paddingTop="";aa.style.marginLeft="";var P=aa.outerHTML,T=Q[P];null==T&&(aa.style.position="absolute",aa.style.visibility="hidden",document.body.appendChild(aa),u=1,u="1px"==aa.style.width?ua.offsetWidth:parseInt(aa.style.width),H=1,H="1px"==aa.style.height?
-ua.offsetHeight:parseInt(aa.style.height),document.body.removeChild(aa),T=new mxRectangle(ja,ka,u,H),Q[P]=T);"1px"==aa.style.height&&("unsafe center"==ha?ka-=T.height/2:"unsafe flex-end"==ha&&(ka-=T.height));if("1px"==aa.style.width)if(!Da&&"unsafe center"==k||Da&&"unsafe center"==ha)ja-=T.width/2;else if(!Da&&"unsafe flex-end"==k||Da&&(!Y&&"unsafe flex-end"==ha||Y&&"unsafe flex-start"==ha))ja-=T.width;T=new mxRectangle(ja,ka,T.width,T.height+parseInt(ua.style.fontSize)/4);J.push(mxUtils.bind(this,
-function(W){var fa=V[P];null==fa?Graph.htmlToPng(P,T.width,T.height,mxUtils.bind(this,function(X){q(ia,ja,ka,T,X);V[P]=X;W()}),A):(q(ia,ja,ka,T,fa),W())}))}catch(W){K()}else K()})(f[E]);0==counter&&l(c);E=0;x()};EditorUi.prototype.addRadiobox=function(c,f,l,q,x,A,E){return this.addCheckbox(c,l,q,x,A,E,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,q,x,A,E,K,Q){A=null!=A?A:!0;var V=document.createElement("input");V.style.marginRight="8px";V.setAttribute("type",E?"radio":"checkbox");E="geCheckbox-"+
+" ");l.appendChild(f.createCDATASection(q));c.appendChild(l)}};EditorUi.prototype.exportSvg=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ka){Editor.addRetryToError(ka,mxUtils.bind(this,function(){this.exportSvg(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua)}));this.handleError(ka)})))try{var Da=this.editor.graph.isSelectionEmpty();l=null!=l?l:Da;var ha=f?null:this.editor.graph.background;ha==mxConstants.NONE&&
+(ha=null);null==ha&&0==f&&(ha=this.editor.graph.shapeBackgroundColor);var k=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var u=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==J||"dark"==J)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==J;ua&&(E=Math.max(null!=E?E:0,Math.ceil(16*c)));var P=this.editor.graph.createSvgImageExport(x,ja,ua,"self"==V?"_top":"_blank"),U=Object.create(null),
+W=this.getSvgWithFontLookup(U,P,mxUtils.bind(this,function(){return this.editor.graph.getSvg(ha,c,E,K,null,l,null,P,"blank"==V?"_blank":"self"==V?"_top":null,null,null,J,ia,null,null,null,la)}));mxUtils.lightDarkColorSupported=u;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=k;q&&this.editor.graph.addSvgShadow(W);ua&&this.addSvgIconHandlers(W);var fa=this.getBaseFilename()+(x?".drawio":"")+".svg";aa=null!=aa?aa:mxUtils.bind(this,function(ka){this.isLocalFileSave()||ka.length<=
+MAX_REQUEST_SIZE?this.saveData(fa,"svg",ka,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(ka)}))});var X=mxUtils.bind(this,function(ka){this.spinner.stop();x&&ka.setAttribute("content",this.getFileData(!0,null,null,null,l,Q,null,null,null,null,null,c,E));aa(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(ka))});this.editor.graph.mathEnabled&&this.editor.addMathCss(W);
+var ea=mxUtils.bind(this,function(ka){Editor.replaceSvgDataUris&&A&&EditorUi.embedSvgImages(ka);Editor.foreignObjectImages&&Y?this.replaceAlternateContent(ka,J,X):X(ka)}),oa=mxUtils.bind(this,function(ka){A&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(ka,ea,this.thumbImageCache)):ea(ka)});this.embedFonts(W,oa,Y?!0:!1,U)}catch(ka){this.handleError(ka)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function q(ia,
+Y,aa,ja,la){var ua=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ua.setAttribute("x",Y);ua.setAttribute("y",aa+.5);ua.setAttribute("width",ja.width);ua.setAttribute("height",ja.height);null==ua.setAttributeNS?ua.setAttribute("xlink:href",la):ua.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);ia.replaceChild(ua,ia.lastChild);K()}function x(){if(E<J.length)J[E++](x)}var A="";f=c.getElementsByTagName("style");for(var E=0;E<f.length;E++)A+=f[E].innerHTML;f=c.getElementsByTagName("switch");
+counter=f.length;var K=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),Q={},V={},J=[];for(E=0;E<f.length;E++)mxUtils.bind(this,function(ia){var Y=ia.getElementsByTagName("div");if(0<Y.length)try{var aa=Y[0].cloneNode(!0),ja=parseInt(aa.style.marginLeft),la=parseInt(aa.style.paddingTop),ua=aa.getElementsByTagName("div")[1],Da=Y=!1,ha=aa.style.alignItems,k=aa.style.justifyContent;if(null!=aa.style.writingMode){var u=aa.style.writingMode;Da="vertical-"==u.substring(0,9);Y="-rl"==u.substring(u.length-
+3)}var H=!Da&&"1px"==aa.style.width||Da&&"1px"==aa.style.height;if(!Da&&"1px"==aa.style.height||Da&&"1px"==aa.style.width)aa.style.alignItems=Da&&Y?"unsafe flex-end":"unsafe flex-start";H&&(aa.style.justifyContent="unsafe flex-start");aa.style.paddingTop="";aa.style.marginLeft="";var P=aa.outerHTML,U=Q[P];null==U&&(aa.style.position="absolute",aa.style.visibility="hidden",document.body.appendChild(aa),u=1,u="1px"==aa.style.width?ua.offsetWidth:parseInt(aa.style.width),H=1,H="1px"==aa.style.height?
+ua.offsetHeight:parseInt(aa.style.height),document.body.removeChild(aa),U=new mxRectangle(ja,la,u,H),Q[P]=U);"1px"==aa.style.height&&("unsafe center"==ha?la-=U.height/2:"unsafe flex-end"==ha&&(la-=U.height));if("1px"==aa.style.width)if(!Da&&"unsafe center"==k||Da&&"unsafe center"==ha)ja-=U.width/2;else if(!Da&&"unsafe flex-end"==k||Da&&(!Y&&"unsafe flex-end"==ha||Y&&"unsafe flex-start"==ha))ja-=U.width;U=new mxRectangle(ja,la,U.width,U.height+parseInt(ua.style.fontSize)/4);J.push(mxUtils.bind(this,
+function(W){var fa=V[P];null==fa?Graph.htmlToPng(P,U.width,U.height,mxUtils.bind(this,function(X){q(ia,ja,la,U,X);V[P]=X;W()}),A):(q(ia,ja,la,U,fa),W())}))}catch(W){K()}else K()})(f[E]);0==counter&&l(c);E=0;x()};EditorUi.prototype.addRadiobox=function(c,f,l,q,x,A,E){return this.addCheckbox(c,l,q,x,A,E,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,q,x,A,E,K,Q){A=null!=A?A:!0;var V=document.createElement("input");V.style.marginRight="8px";V.setAttribute("type",E?"radio":"checkbox");E="geCheckbox-"+
Editor.guid();V.id=E;null!=K&&V.setAttribute("name",K);l&&(V.setAttribute("checked","checked"),V.defaultChecked=!0);q&&V.setAttribute("disabled","disabled");A&&(Q?(x=document.createElement("div"),x.className="geDialogCheckRow",x.appendChild(V),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",E),x.appendChild(l),c.appendChild(x),V.checkRow=x):(V.style.marginTop="16px",c.appendChild(V),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",E),c.appendChild(l),
x||mxUtils.br(c)));return V};EditorUi.prototype.addAdvancedSection=function(c,f){var l=document.createElement("div");l.className="geCollapsibleTitle";mxUtils.write(l,mxResources.get(f||"advanced"));var q=document.createElement("div");q.className="geCollapsibleContent geCollapsed";f=document.createElement("div");f.className="geDialogSection";q.appendChild(f);var x=function(A){if(A!==l.classList.contains("geExpanded")&&(l.classList.toggle("geExpanded"),q.classList.toggle("geCollapsed"),A=l.closest(".geDialog"),
null!=A)){var E=A.firstElementChild;null!=E&&(A.style.height="",A.style.height=E.scrollHeight+48+"px")}};mxEvent.addListener(l,"click",function(){x(!l.classList.contains("geExpanded"))});c.appendChild(l);c.appendChild(q);return{content:f,wrapper:q,expand:function(){x(!0)},collapse:function(){x(!1)},isExpanded:function(){return l.classList.contains("geExpanded")}}};EditorUi.prototype.addEditButton=function(c,f){var l=document.createElement("div");l.className="geDialogCheckRow";var q=document.createElement("span");
@@ -4355,9 +4357,9 @@ function(c,f){function l(){var Q=document.createElement("div");Q.style.width="10
x.className="geDialogFormLabel";mxUtils.write(x,mxResources.get("links")+":");q.appendChild(x);var A=document.createElement("select");A.style.width="100px";A.style.padding="0px";A.style.marginRight="10px";A.className="geBtn";x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));A.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));A.appendChild(x);x=document.createElement("option");
x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));A.appendChild(x);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),A.appendChild(f));q.appendChild(A);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");q.appendChild(f);var E="#0000ff",K=null;K=mxUtils.button("",mxUtils.bind(this,function(Q){this.pickColor(E||"none",function(V){E=
V;l()});mxEvent.consume(Q)}));l();K.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";K.style.marginLeft="4px";K.style.height="22px";K.style.width="22px";K.style.position="relative";K.style.top="1px";K.className="geColorBtn";q.appendChild(K);c.appendChild(q);return{getColor:function(){return E},getTarget:function(){return A.value},focus:function(){A.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,l,q,x,A,E,K){A=null!=A?A:[];l&&(A.push("lightbox=1"),"auto"!=c&&A.push("target="+c),
-null!=f&&f!=mxConstants.NONE&&A.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=q&&0<q.length&&A.push("edit="+encodeURIComponent(q)),x&&A.push("layers=1"),E&&A.push("link-icons=1"),K&&A.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&A.push("nav=1"));return A};EditorUi.prototype.createLink=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja){var ka=this.getCurrentFile();Q=this.createUrlParameters(c,f,q,x,A,Q,aa,ja);c=!0;null!=E?l="#U"+encodeURIComponent(E):K||null==ka||""==ka.getHash()?
-l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+ka.getHash(),c=!1);c&&null!=ka&&null!=ka.getTitle()&&ka.getTitle()!=this.defaultFilename&&Q.push("title="+encodeURIComponent(ka.getTitle()));V&&1<l.length&&(Q.push("open="+l.substring(1)),l="");V=1==J?this.currentPage:J;null!=V&&"function"===typeof V.getId&&Q.push("page-id="+V.getId());ia&&Q.push("transparent=1");null!=Y&&Q.push("dark="+Y);return(q&&
-(null!=E||null!=ka&&ka.getMode()!=App.MODE_GITHUB&&ka.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<Q.length?"?"+Q.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka){this.getBasenames();var ua={};ja&&(ua["show-link-icons"]=!0);ka&&(ua["show-tooltip-icons"]=!0);""!=x&&x!=mxConstants.NONE&&(ua.highlight=
+null!=f&&f!=mxConstants.NONE&&A.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=q&&0<q.length&&A.push("edit="+encodeURIComponent(q)),x&&A.push("layers=1"),E&&A.push("link-icons=1"),K&&A.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&A.push("nav=1"));return A};EditorUi.prototype.createLink=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja){var la=this.getCurrentFile();Q=this.createUrlParameters(c,f,q,x,A,Q,aa,ja);c=!0;null!=E?l="#U"+encodeURIComponent(E):K||null==la||""==la.getHash()?
+l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+la.getHash(),c=!1);c&&null!=la&&null!=la.getTitle()&&la.getTitle()!=this.defaultFilename&&Q.push("title="+encodeURIComponent(la.getTitle()));V&&1<l.length&&(Q.push("open="+l.substring(1)),l="");V=1==J?this.currentPage:J;null!=V&&"function"===typeof V.getId&&Q.push("page-id="+V.getId());ia&&Q.push("transparent=1");null!=Y&&Q.push("dark="+Y);return(q&&
+(null!=E||null!=la&&la.getMode()!=App.MODE_GITHUB&&la.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<Q.length?"?"+Q.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la){this.getBasenames();var ua={};ja&&(ua["show-link-icons"]=!0);la&&(ua["show-tooltip-icons"]=!0);""!=x&&x!=mxConstants.NONE&&(ua.highlight=
x);"auto"!==q&&(ua.target=q);V||(ua.lightbox=!1);ua.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(ua.zoom=l/100);l=[];E&&(l.push("pages"),ua.resize=!0,null!=this.pages&&null!=this.currentPage&&(ua.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(l.push("zoom"),ua.resize=!0);K&&l.push("layers");Q&&(l.push("tags"),aa&&(f=this.getHiddenTagsMap(),null!=f&&(ua.hiddenTags=f)));null!=Y&&(ua["dark-mode"]=Y);0<l.length&&(V&&l.push("lightbox"),ua.toolbar=l.join(" "));null!=J&&
0<J.length&&(ua.edit=J);null!=c?ua.url=c:ua.xml=this.getFileData(!0,null,null,null,null,!E);A='<div class="mxgraph" style="'+(A?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ua))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ia(A,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":
window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.addPagesRow=function(c){var f=document.createElement("select");f.style.maxWidth="260px";var l=document.createElement("option");mxUtils.write(l,mxResources.get("allPages"));l.setAttribute("value","allPages");f.appendChild(l);l=document.createElement("option");mxUtils.write(l,mxResources.get("currentPage"));l.setAttribute("value","currentPage");f.appendChild(l);l=
@@ -4365,61 +4367,61 @@ null;if(null!=this.pages&&1<this.pages.length){l=document.createElement("div");l
var E=document.createElement("select");E.className="geBtn";E.style.margin="0 4px 8px 4px";E.style.width="calc(100% - 8px)";E.style.boxSizing="border-box";A=document.createElement("option");mxUtils.write(A,mxResources.get("includeCopyOfMyDiagram"));A.setAttribute("value","copy");E.appendChild(A);A=document.createElement("option");A.setAttribute("value","url");E.appendChild(A);null!=l?(mxUtils.write(A,mxResources.get("publicDiagramUrl")),A.setAttribute("title",l)):(mxUtils.write(A,mxResources.get("publicDiagramUrl")+
" ("+mxResources.get("diagramIsNotPublic")+")"),A.setAttribute("disabled","disabled"));x.appendChild(E);mxUtils.br(x);var K=this.getCurrentFile();if(null==l&&null!=K&&K.constructor==window.DriveFile){A=document.createElement("div");A.style.marginBottom="8px";var Q=document.createElement("a");Q.style.color="gray";Q.style.cursor="pointer";mxUtils.write(Q,mxResources.get("share"));A.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(K.getId(),
K)}));x.appendChild(A)}A=document.createElement("div");A.className="geDialogSection";var V=this.addLinkSection(A),J=this.addPagesRow(A);Q=document.createElement("div");Q.className="geDialogCheckRow";var ia=document.createElement("input");ia.setAttribute("type","checkbox");ia.setAttribute("checked","checked");ia.defaultChecked=!0;ia.style.marginRight="8px";Q.appendChild(ia);var Y=document.createElement("label");mxUtils.write(Y,mxResources.get("zoom")+":");Q.appendChild(Y);var aa=document.createElement("input");
-aa.setAttribute("type","text");aa.style.width="60px";aa.style.marginLeft="4px";aa.value="100%";Q.appendChild(aa);A.appendChild(Q);var ja=this.addCheckbox(A,mxResources.get("fit"),!0,null,null,null,null,null,!0),ka=this.addCheckbox(A,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);x.appendChild(A);A=this.addAdvancedSection(x).content;var ua=document.createElement("select");ua.style.maxWidth="260px";Q=document.createElement("option");Q.setAttribute("value","light");mxUtils.write(Q,mxResources.get("light"));
+aa.setAttribute("type","text");aa.style.width="60px";aa.style.marginLeft="4px";aa.value="100%";Q.appendChild(aa);A.appendChild(Q);var ja=this.addCheckbox(A,mxResources.get("fit"),!0,null,null,null,null,null,!0),la=this.addCheckbox(A,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);x.appendChild(A);A=this.addAdvancedSection(x).content;var ua=document.createElement("select");ua.style.maxWidth="260px";Q=document.createElement("option");Q.setAttribute("value","light");mxUtils.write(Q,mxResources.get("light"));
ua.appendChild(Q);Q=document.createElement("option");Q.setAttribute("value","dark");mxUtils.write(Q,mxResources.get("dark"));ua.appendChild(Q);Q=document.createElement("option");Q.setAttribute("value","auto");mxUtils.write(Q,mxResources.get("automatic"));Q.setAttribute("selected","selected");ua.appendChild(Q);Q=document.createElement("div");Q.className="geDialogFormRow";Y=document.createElement("span");Y.className="geDialogFormLabel";mxUtils.write(Y,mxResources.get("appearance")+":");Q.appendChild(Y);
-Q.appendChild(ua);A.appendChild(Q);var Da=null;if(EditorUi.enableHtmlEditOption){Da=this.addEditButton(A,ka);var ha=Da.getEditInput();mxEvent.addListener(ka,"change",function(){ka.checked?ha.removeAttribute("disabled"):ha.setAttribute("disabled","disabled");ha.checked&&ka.checked?Da.getEditSelect().removeAttribute("disabled"):Da.getEditSelect().setAttribute("disabled","disabled")})}var k=this.addCheckbox(A,mxResources.get("layers"),!0,null,null,null,null,null,!0),u=this.addCheckbox(A,mxResources.get("tags"),
-!0,null,null,null,null,null,!0),H=this.addCheckbox(A,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);H.checkRow.style.paddingLeft="24px";var P=this.addCheckbox(A,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),T=this.addCheckbox(A,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(u,"change",function(){u.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});mxEvent.addListener(ka,"change",function(){ka.checked?
-(P.removeAttribute("disabled"),T.removeAttribute("disabled")):(P.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"))});c=new CustomDialog(this,x,mxUtils.bind(this,function(){q("url"==E.value?l:null,ia.checked,aa.value,V.getTarget(),V.getColor(),ja.checked,null!=J.row&&"allPages"==J.select.value,k.checked,u.checked,ka.checked,null!=Da?Da.getLink():null,null!=ua?ua.value:null,u.checked&&H.checked,P.checked,T.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);E.focus()};
+Q.appendChild(ua);A.appendChild(Q);var Da=null;if(EditorUi.enableHtmlEditOption){Da=this.addEditButton(A,la);var ha=Da.getEditInput();mxEvent.addListener(la,"change",function(){la.checked?ha.removeAttribute("disabled"):ha.setAttribute("disabled","disabled");ha.checked&&la.checked?Da.getEditSelect().removeAttribute("disabled"):Da.getEditSelect().setAttribute("disabled","disabled")})}var k=this.addCheckbox(A,mxResources.get("layers"),!0,null,null,null,null,null,!0),u=this.addCheckbox(A,mxResources.get("tags"),
+!0,null,null,null,null,null,!0),H=this.addCheckbox(A,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);H.checkRow.style.paddingLeft="24px";var P=this.addCheckbox(A,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),U=this.addCheckbox(A,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(u,"change",function(){u.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});mxEvent.addListener(la,"change",function(){la.checked?
+(P.removeAttribute("disabled"),U.removeAttribute("disabled")):(P.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"))});c=new CustomDialog(this,x,mxUtils.bind(this,function(){q("url"==E.value?l:null,ia.checked,aa.value,V.getTarget(),V.getColor(),ja.checked,null!=J.row&&"allPages"==J.select.value,k.checked,u.checked,la.checked,null!=Da?Da.getLink():null,null!=ua?ua.value:null,u.checked&&H.checked,P.checked,U.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);E.focus()};
EditorUi.prototype.showPublishLinkDialog=function(c,f,l,q,x,A,E,K,Q,V,J,ia){var Y=document.createElement("div");Y.style.whiteSpace="nowrap";var aa=document.createElement("h3");mxUtils.write(aa,c||mxResources.get("publish"));Y.appendChild(aa);var ja=document.createElement("select");ja.className="geBtn";ja.style.margin="0 4px 8px 4px";ja.style.width="calc(100% - 8px)";ja.style.boxSizing="border-box";x=null!=x?x:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");
mxUtils.write(c,mxResources.get("includeCopyOfMyDiagram"));c.setAttribute("value","copy");ja.appendChild(c);c=document.createElement("option");mxUtils.write(c,mxResources.get("authorizationRequired"));c.setAttribute("value","auth");ja.appendChild(c);null==K||""==K.getHash()||K.getMode()==App.MODE_DEVICE||K.getMode()==App.MODE_BROWSER?c.setAttribute("disabled","disabled"):ja.value="auth";K=document.createElement("option");K.setAttribute("value","public");ja.appendChild(K);null!=E?(mxUtils.write(K,
-mxResources.get("publicDiagramUrl")),K.setAttribute("title",E),ja.value="public"):(mxUtils.write(K,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),K.setAttribute("disabled","disabled"));Y.appendChild(ja);mxUtils.br(Y);E=document.createElement("div");E.className="geDialogSection";var ka=null,ua=null;if(null!=f||null!=l)f=document.createElement("div"),f.className="geDialogInlineFields",K=document.createElement("div"),K.className="geDialogInlineField",c=document.createElement("label"),
-mxUtils.write(c,mxResources.get("width")+":"),K.appendChild(c),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.value="100%",K.appendChild(ka),f.appendChild(K),K=document.createElement("div"),K.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("height")+":"),K.appendChild(c),ua=document.createElement("input"),ua.setAttribute("type","text"),ua.value=l+"px",K.appendChild(ua),f.appendChild(K),E.appendChild(f);var Da=this.addLinkSection(E,
+mxResources.get("publicDiagramUrl")),K.setAttribute("title",E),ja.value="public"):(mxUtils.write(K,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),K.setAttribute("disabled","disabled"));Y.appendChild(ja);mxUtils.br(Y);E=document.createElement("div");E.className="geDialogSection";var la=null,ua=null;if(null!=f||null!=l)f=document.createElement("div"),f.className="geDialogInlineFields",K=document.createElement("div"),K.className="geDialogInlineField",c=document.createElement("label"),
+mxUtils.write(c,mxResources.get("width")+":"),K.appendChild(c),la=document.createElement("input"),la.setAttribute("type","text"),la.value="100%",K.appendChild(la),f.appendChild(K),K=document.createElement("div"),K.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("height")+":"),K.appendChild(c),ua=document.createElement("input"),ua.setAttribute("type","text"),ua.value=l+"px",K.appendChild(ua),f.appendChild(K),E.appendChild(f);var Da=this.addLinkSection(E,
q),ha=V?this.addCheckbox(E,mxResources.get("transparentBackground"),!1,null,null,null,null,null,!0):null,k=this.addPagesRow(E),u=k.select;null==k.row||ia||(l=function(){k.row.style.display="copy"==ja.value?"":"none"},mxEvent.addListener(ja,"change",l),l());var H=null;if(null!=this.pages&&1<this.pages.length){l=document.createElement("div");l.className="geDialogFormRow";V=document.createElement("span");V.className="geDialogFormLabel";mxUtils.write(V,mxResources.get("initialPage",null,"Initial Page")+
":");l.appendChild(V);H=document.createElement("select");H.style.maxWidth="260px";for(V=0;V<this.pages.length;V++)ia=document.createElement("option"),mxUtils.write(ia,this.pages[V].getName()),ia.setAttribute("value",V),this.pages[V]==this.currentPage&&ia.setAttribute("selected","selected"),H.appendChild(ia);l.appendChild(H);E.appendChild(l);l=function(){"none"!=k.row.style.display&&"currentPage"==u.value?H.setAttribute("disabled","disabled"):H.removeAttribute("disabled")};mxEvent.addListener(u,"change",
-l);mxEvent.addListener(ja,"change",l);l()}var P=this.addCheckbox(E,mxResources.get("lightbox"),!0,null,null,!q,null,null,!0);q&&null!=P.checkRow&&(P.checkRow.style.display="none");Y.appendChild(E);q=this.addAdvancedSection(Y).content;var T=document.createElement("select");T.style.maxWidth="260px";l=document.createElement("option");l.setAttribute("value","0");mxUtils.write(l,mxResources.get("light"));T.appendChild(l);l=document.createElement("option");l.setAttribute("value","1");mxUtils.write(l,mxResources.get("dark"));
-T.appendChild(l);l=document.createElement("option");l.setAttribute("value","auto");mxUtils.write(l,mxResources.get("automatic"));l.setAttribute("selected","selected");T.appendChild(l);J&&(J=document.createElement("div"),J.className="geDialogFormRow",l=document.createElement("span"),l.className="geDialogFormLabel",mxUtils.write(l,mxResources.get("appearance")+":"),J.appendChild(l),J.appendChild(T),q.appendChild(J));var W=this.addEditButton(q,P),fa=W.getEditInput(),X=this.addCheckbox(q,mxResources.get("layers"),
-!0,null,null,null,null,null,!0),ea=this.addCheckbox(q,mxResources.get("tags"),!0,null,null,null,null,null,!0),oa=this.addCheckbox(q,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);oa.checkRow.style.paddingLeft="24px";var la=this.addCheckbox(q,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),ca=this.addCheckbox(q,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ea,"change",function(){ea.checked?oa.removeAttribute("disabled"):oa.setAttribute("disabled",
-"disabled")});mxEvent.addListener(P,"change",function(){P.checked?(X.removeAttribute("disabled"),fa.removeAttribute("disabled"),ea.removeAttribute("disabled"),la.removeAttribute("disabled"),ca.removeAttribute("disabled"),ea.checked&&oa.removeAttribute("disabled")):(X.setAttribute("disabled","disabled"),fa.setAttribute("disabled","disabled"),ea.setAttribute("disabled","disabled"),oa.setAttribute("disabled","disabled"),la.setAttribute("disabled","disabled"),ca.setAttribute("disabled","disabled"));fa.checked&&
-P.checked?W.getEditSelect().removeAttribute("disabled"):W.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,Y,mxUtils.bind(this,function(){Q(Da.getTarget(),Da.getColor(),null==H||0>=H.selectedIndex||null!=H.getAttribute("disabled")?null:this.pages[H.selectedIndex],P.checked,W.getLink(),X.checked,null!=ka?ka.value:null,null!=ua?ua.value:null,ea.checked,ja.value,null!=ha?ha.checked:!1,T.value,"allPages"==u.value,ea.checked&&oa.checked,la.checked,ca.checked)}),null,mxResources.get("create"),
-x,A);this.showDialog(x.container,360,null,!0,!0);null!=ka?(ka.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ka.select():document.execCommand("selectAll",!1,null)):ja.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,q,x){var A=document.createElement("div");A.style.whiteSpace="nowrap";var E=document.createElement("h3");mxUtils.write(E,mxResources.get("image"));A.appendChild(E);if(x){E=document.createElement("div");E.className="geDialogSection";var K=document.createElement("div");
+l);mxEvent.addListener(ja,"change",l);l()}var P=this.addCheckbox(E,mxResources.get("lightbox"),!0,null,null,!q,null,null,!0);q&&null!=P.checkRow&&(P.checkRow.style.display="none");Y.appendChild(E);q=this.addAdvancedSection(Y).content;var U=document.createElement("select");U.style.maxWidth="260px";l=document.createElement("option");l.setAttribute("value","0");mxUtils.write(l,mxResources.get("light"));U.appendChild(l);l=document.createElement("option");l.setAttribute("value","1");mxUtils.write(l,mxResources.get("dark"));
+U.appendChild(l);l=document.createElement("option");l.setAttribute("value","auto");mxUtils.write(l,mxResources.get("automatic"));l.setAttribute("selected","selected");U.appendChild(l);J&&(J=document.createElement("div"),J.className="geDialogFormRow",l=document.createElement("span"),l.className="geDialogFormLabel",mxUtils.write(l,mxResources.get("appearance")+":"),J.appendChild(l),J.appendChild(U),q.appendChild(J));var W=this.addEditButton(q,P),fa=W.getEditInput(),X=this.addCheckbox(q,mxResources.get("layers"),
+!0,null,null,null,null,null,!0),ea=this.addCheckbox(q,mxResources.get("tags"),!0,null,null,null,null,null,!0),oa=this.addCheckbox(q,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);oa.checkRow.style.paddingLeft="24px";var ka=this.addCheckbox(q,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),ba=this.addCheckbox(q,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ea,"change",function(){ea.checked?oa.removeAttribute("disabled"):oa.setAttribute("disabled",
+"disabled")});mxEvent.addListener(P,"change",function(){P.checked?(X.removeAttribute("disabled"),fa.removeAttribute("disabled"),ea.removeAttribute("disabled"),ka.removeAttribute("disabled"),ba.removeAttribute("disabled"),ea.checked&&oa.removeAttribute("disabled")):(X.setAttribute("disabled","disabled"),fa.setAttribute("disabled","disabled"),ea.setAttribute("disabled","disabled"),oa.setAttribute("disabled","disabled"),ka.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));fa.checked&&
+P.checked?W.getEditSelect().removeAttribute("disabled"):W.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,Y,mxUtils.bind(this,function(){Q(Da.getTarget(),Da.getColor(),null==H||0>=H.selectedIndex||null!=H.getAttribute("disabled")?null:this.pages[H.selectedIndex],P.checked,W.getLink(),X.checked,null!=la?la.value:null,null!=ua?ua.value:null,ea.checked,ja.value,null!=ha?ha.checked:!1,U.value,"allPages"==u.value,ea.checked&&oa.checked,ka.checked,ba.checked)}),null,mxResources.get("create"),
+x,A);this.showDialog(x.container,360,null,!0,!0);null!=la?(la.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?la.select():document.execCommand("selectAll",!1,null)):ja.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,q,x){var A=document.createElement("div");A.style.whiteSpace="nowrap";var E=document.createElement("h3");mxUtils.write(E,mxResources.get("image"));A.appendChild(E);if(x){E=document.createElement("div");E.className="geDialogSection";var K=document.createElement("div");
K.className="geDialogFormRow";var Q=document.createElement("span");Q.className="geDialogFormLabel";mxUtils.write(Q,mxResources.get("zoom")+":");K.appendChild(Q);var V=document.createElement("input");V.setAttribute("type","text");V.value=this.lastExportZoom||"100%";K.appendChild(V);E.appendChild(K);K=document.createElement("div");K.className="geDialogFormRow";Q=document.createElement("span");Q.className="geDialogFormLabel";mxUtils.write(Q,mxResources.get("borderWidth")+":");K.appendChild(Q);var J=
document.createElement("input");J.setAttribute("type","text");J.value=this.lastExportBorder||"0";K.appendChild(J);E.appendChild(K);A.appendChild(E)}E=document.createElement("div");E.className="geDialogSection";var ia=this.addCheckbox(E,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),Y=q?null:this.addCheckbox(E,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,null,
null,null,null,null,!0);K=this.editor.graph;var aa=K.background==mxConstants.NONE||null==K.background,ja=q?null:this.addCheckbox(E,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?this.lastExportTransparent:aa,null,null,null,null,null,!0);A.appendChild(E);c=new CustomDialog(this,A,mxUtils.bind(this,function(){this.lastExportSelectionOnly=ia.checked;x&&(this.lastExportZoom=V.value,this.lastExportBorder=J.value);null!=ja&&(this.lastExportTransparent=ja.checked==aa?null:ja.checked);
-var ka=parseInt(V.value)/100||1,ua=parseInt(J.value)||0;l(!ia.checked,null!=Y?Y.checked:!1,null!=ja?ja.checked:!1,ka,ua)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,l,q,x,A,E,K,Q){function V(){return Math.max(0,parseFloat(ka.value)||100)/100}function J(){var Oa=V();Ba.value=Math.floor(sa*Oa);ma.value=Math.floor(xa*Oa)}E=null!=E?E:Editor.defaultIncludeDiagram;var ia=document.createElement("div");ia.style.whiteSpace="nowrap";var Y=this.editor.graph,
-aa=document.createElement("h3");mxUtils.write(aa,c);ia.appendChild(aa);c=document.createElement("div");c.className="geDialogSection";aa=document.createElement("div");aa.className="geDialogFormRow";var ja=document.createElement("span");ja.className="geDialogFormLabel";mxUtils.write(ja,mxResources.get("zoom")+":");aa.appendChild(ja);var ka=document.createElement("input");ka.setAttribute("type","text");ka.value=this.lastExportZoom||"100%";aa.appendChild(ka);c.appendChild(aa);ia.appendChild(c);c=document.createElement("div");
+var la=parseInt(V.value)/100||1,ua=parseInt(J.value)||0;l(!ia.checked,null!=Y?Y.checked:!1,null!=ja?ja.checked:!1,la,ua)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,l,q,x,A,E,K,Q){function V(){return Math.max(0,parseFloat(la.value)||100)/100}function J(){var Oa=V();Ba.value=Math.floor(sa*Oa);ma.value=Math.floor(xa*Oa)}E=null!=E?E:Editor.defaultIncludeDiagram;var ia=document.createElement("div");ia.style.whiteSpace="nowrap";var Y=this.editor.graph,
+aa=document.createElement("h3");mxUtils.write(aa,c);ia.appendChild(aa);c=document.createElement("div");c.className="geDialogSection";aa=document.createElement("div");aa.className="geDialogFormRow";var ja=document.createElement("span");ja.className="geDialogFormLabel";mxUtils.write(ja,mxResources.get("zoom")+":");aa.appendChild(ja);var la=document.createElement("input");la.setAttribute("type","text");la.value=this.lastExportZoom||"100%";aa.appendChild(la);c.appendChild(aa);ia.appendChild(c);c=document.createElement("div");
c.className="geDialogSection";var ua=this.addCheckbox(c,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!Y.isSelectionEmpty(),Y.isSelectionEmpty(),null,null,null,null,!0),Da=document.createElement("input");Da.setAttribute("disabled","disabled");Da.setAttribute("type","checkbox");var ha=document.createElement("select");ha.style.marginLeft="8px";var k=["selectionOnly","diagram","page"];aa={};for(ja=0;ja<k.length;ja++)if(!Y.isSelectionEmpty()||"selectionOnly"!=k[ja]){var u=document.createElement("option");
mxUtils.write(u,mxResources.get(k[ja]));u.setAttribute("value",k[ja]);ha.appendChild(u);aa[k[ja]]=u}Q?(ja=document.createElement("div"),ja.className="geDialogFormRow",A=document.createElement("span"),A.className="geDialogFormLabel",mxUtils.write(A,mxResources.get("size")+":"),ja.appendChild(A),ha.style.marginLeft="0",ja.appendChild(ha),c.appendChild(ja),mxEvent.addListener(ha,"change",function(){"selectionOnly"==ha.value&&(ua.checked=!0)})):A&&(A=document.createElement("div"),A.className="geDialogCheckRow",
A.appendChild(Da),ja=document.createElement("label"),mxUtils.write(ja,mxResources.get("crop")),A.appendChild(ja),c.appendChild(A),mxEvent.addListener(ua,"change",function(){ua.checked?Da.removeAttribute("disabled"):Da.setAttribute("disabled","disabled")}));Y.isSelectionEmpty()?Q&&null!=ua.checkRow&&null!=ua.checkRow.parentNode&&ua.checkRow.parentNode.removeChild(ua.checkRow):(ha.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",Da.setAttribute("checked","checked"),Da.defaultChecked=!0,
-mxEvent.addListener(ua,"change",function(){ha.value=ua.checked?"selectionOnly":"diagram"}));var H=!Y.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";Q&&null!=this.lastExportType&&null!=aa[this.lastExportType]&&(ha.value=this.lastExportType,"selectionOnly"==this.lastExportType&&(ua.checked=!0));var P="jpeg"!=K&&"webp"!=K,T=this.addCheckbox(c,mxResources.get("transparentBackground"),P&&null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,P,null,null,!0);
+mxEvent.addListener(ua,"change",function(){ha.value=ua.checked?"selectionOnly":"diagram"}));var H=!Y.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";Q&&null!=this.lastExportType&&null!=aa[this.lastExportType]&&(ha.value=this.lastExportType,"selectionOnly"==this.lastExportType&&(ua.checked=!0));var P="jpeg"!=K&&"webp"!=K,U=this.addCheckbox(c,mxResources.get("transparentBackground"),P&&null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,P,null,null,!0);
ia.appendChild(c);c=document.createElement("div");c.className="geDialogSection";aa=!1;A=null!=this.pages?this.pages.length:1;var W=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<A?":":""),E,null,null,"jpeg"!=K&&"webp"!=K,null,null,!0);"jpeg"!=K&&"webp"!=K&&(aa=!0);var fa=document.createElement("select");fa.style.maxWidth="260px";if("png"==K||"svg"==K)E=function(){W.checked?fa.removeAttribute("disabled"):fa.setAttribute("disabled","disabled")},ja=document.createElement("option"),ja.setAttribute("value",
"allPages"),mxUtils.write(ja,mxResources.get("allPages")),fa.appendChild(ja),ja=document.createElement("option"),ja.setAttribute("value","currentPage"),mxUtils.write(ja,mxResources.get("currentPage")),fa.appendChild(ja),1<A&&(A=document.createElement("div"),A.style.paddingLeft="24px",A.appendChild(fa),c.appendChild(A)),null!=this.lastEmbedInclude&&(fa.value=this.lastEmbedInclude),mxEvent.addListener(W,"change",E),E();var X=document.createElement("input");X.setAttribute("type","checkbox");X.id="geCheckbox-"+
-Editor.guid();var ea=document.createElement("input");ea.setAttribute("type","checkbox");ea.id="geCheckbox-"+Editor.guid();var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.id="geCheckbox-"+Editor.guid();var la=document.createElement("input");la.setAttribute("type","checkbox");la.id="geCheckbox-"+Editor.guid();var ca=document.createElement("select");ca.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));
-ca.appendChild(E);E=document.createElement("option");E.setAttribute("value","blank");mxUtils.write(E,mxResources.get("openInNewWindow"));ca.appendChild(E);E=document.createElement("option");E.setAttribute("value","self");mxUtils.write(E,mxResources.get("openInThisWindow"));ca.appendChild(E);"svg"==K&&null!=this.lastExportLinkTarget&&(ca.value=this.lastExportLinkTarget,0>ca.selectedIndex&&(ca.value="auto"));A=document.createElement("div");mxUtils.write(A,mxResources.get("LinksLost"));A.style.margin=
+Editor.guid();var ea=document.createElement("input");ea.setAttribute("type","checkbox");ea.id="geCheckbox-"+Editor.guid();var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.id="geCheckbox-"+Editor.guid();var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.id="geCheckbox-"+Editor.guid();var ba=document.createElement("select");ba.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));
+ba.appendChild(E);E=document.createElement("option");E.setAttribute("value","blank");mxUtils.write(E,mxResources.get("openInNewWindow"));ba.appendChild(E);E=document.createElement("option");E.setAttribute("value","self");mxUtils.write(E,mxResources.get("openInThisWindow"));ba.appendChild(E);"svg"==K&&null!=this.lastExportLinkTarget&&(ba.value=this.lastExportLinkTarget,0>ba.selectedIndex&&(ba.value="auto"));A=document.createElement("div");mxUtils.write(A,mxResources.get("LinksLost"));A.style.margin=
"7px";A.style.display="none";aa&&ia.appendChild(c);E=this.addAdvancedSection(ia).content;c=Y.getGraphBounds();aa=Y.view.scale;var sa=Math.max(1,Math.ceil(c.width/aa)),xa=Math.max(1,Math.ceil(c.height/aa)),qa=!1;ja=document.createElement("div");ja.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";aa=document.createElement("label");mxUtils.write(aa,mxResources.get("width")+":");c.appendChild(aa);var Ba=document.createElement("input");Ba.setAttribute("type",
-"number");Ba.value=Math.floor(sa*V());c.appendChild(Ba);ja.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";aa=document.createElement("label");mxUtils.write(aa,mxResources.get("height")+":");c.appendChild(aa);var ma=document.createElement("input");ma.setAttribute("type","number");ma.value=Math.floor(xa*V());c.appendChild(ma);ja.appendChild(c);E.appendChild(ja);mxEvent.addListener(ka,"change",function(){qa=!0;ka.value=parseFloat((100*V()).toFixed(2))+"%";J()});mxEvent.addListener(Ba,
-"change",function(){var Oa=parseInt(Ba.value)/sa;0<Oa&&(ka.value=parseFloat((100*Oa).toFixed(2))+"%",ma.value=Math.floor(xa*Oa))});mxEvent.addListener(ma,"change",function(){var Oa=parseInt(ma.value)/xa;0<Oa&&(ka.value=parseFloat((100*Oa).toFixed(2))+"%",Ba.value=Math.floor(sa*Oa))});var ta=document.createElement("select"),va=document.createElement("input");if("png"==K){c=["100","200","300","400"];for(ja=0;ja<c.length;ja++)aa=document.createElement("option"),aa.setAttribute("value",c[ja]),mxUtils.write(aa,
+"number");Ba.value=Math.floor(sa*V());c.appendChild(Ba);ja.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";aa=document.createElement("label");mxUtils.write(aa,mxResources.get("height")+":");c.appendChild(aa);var ma=document.createElement("input");ma.setAttribute("type","number");ma.value=Math.floor(xa*V());c.appendChild(ma);ja.appendChild(c);E.appendChild(ja);mxEvent.addListener(la,"change",function(){qa=!0;la.value=parseFloat((100*V()).toFixed(2))+"%";J()});mxEvent.addListener(Ba,
+"change",function(){var Oa=parseInt(Ba.value)/sa;0<Oa&&(la.value=parseFloat((100*Oa).toFixed(2))+"%",ma.value=Math.floor(xa*Oa))});mxEvent.addListener(ma,"change",function(){var Oa=parseInt(ma.value)/xa;0<Oa&&(la.value=parseFloat((100*Oa).toFixed(2))+"%",Ba.value=Math.floor(sa*Oa))});var ta=document.createElement("select"),va=document.createElement("input");if("png"==K){c=["100","200","300","400"];for(ja=0;ja<c.length;ja++)aa=document.createElement("option"),aa.setAttribute("value",c[ja]),mxUtils.write(aa,
c[ja]+"dpi"),ta.appendChild(aa);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom"));ta.appendChild(c);va.setAttribute("type","number");va.setAttribute("value","100");va.setAttribute("min","50");va.setAttribute("step","50");va.style.display="none";c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("dpi")+":");c.appendChild(aa);c.appendChild(ta);
-c.appendChild(va);E.appendChild(c);null!=this.lastExportDpi&&(va.value=this.lastExportDpi,ta.value=this.lastExportDpi,0>ta.selectedIndex&&(ta.value="custom",ta.style.display="none",va.style.display=""));mxEvent.addListener(ta,"change",function(){"custom"==ta.value?(ta.style.display="none",va.style.display="",va.focus()):(va.value=ta.value,qa||(ka.value=ta.value+"%",J()))});mxEvent.addListener(va,"change",function(){var Oa=parseInt(va.value);isNaN(Oa)||0>=Oa?va.style.backgroundColor="red":(va.style.backgroundColor=
-"",qa||(ka.value=Oa+"%",J()))})}c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("borderWidth")+":");c.appendChild(aa);var Ha=document.createElement("input");Ha.setAttribute("type","text");Ha.value=this.lastExportBorder||"0";c.appendChild(Ha);E.appendChild(c);var La=document.createElement("select");La.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value","light");
+c.appendChild(va);E.appendChild(c);null!=this.lastExportDpi&&(va.value=this.lastExportDpi,ta.value=this.lastExportDpi,0>ta.selectedIndex&&(ta.value="custom",ta.style.display="none",va.style.display=""));mxEvent.addListener(ta,"change",function(){"custom"==ta.value?(ta.style.display="none",va.style.display="",va.focus()):(va.value=ta.value,qa||(la.value=ta.value+"%",J()))});mxEvent.addListener(va,"change",function(){var Oa=parseInt(va.value);isNaN(Oa)||0>=Oa?va.style.backgroundColor="red":(va.style.backgroundColor=
+"",qa||(la.value=Oa+"%",J()))})}c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("borderWidth")+":");c.appendChild(aa);var Ga=document.createElement("input");Ga.setAttribute("type","text");Ga.value=this.lastExportBorder||"0";c.appendChild(Ga);E.appendChild(c);var La=document.createElement("select");La.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value","light");
mxUtils.write(c,mxResources.get("light"));La.appendChild(c);c=document.createElement("option");c.setAttribute("value","dark");mxUtils.write(c,mxResources.get("dark"));La.appendChild(c);var Ia=Editor.isDarkMode()?"dark":"light";"svg"==K&&mxUtils.lightDarkColorSupported&&(c=document.createElement("option"),c.setAttribute("value","auto"),mxUtils.write(c,mxResources.get("automatic")),La.appendChild(c),Ia="auto");La.value=null!=this.lastExportTheme?this.lastExportTheme:Ia;0>La.selectedIndex&&(La.value=
-Ia);c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("appearance")+":");c.appendChild(aa);c.appendChild(La);E.appendChild(c);"svg"==K&&(c=document.createElement("div"),c.className="geDialogFormRow",aa=document.createElement("span"),aa.className="geDialogFormLabel",mxUtils.write(aa,mxResources.get("links")+":"),c.appendChild(aa),c.appendChild(ca),E.appendChild(c),E.appendChild(A));var Ca=
+Ia);c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("appearance")+":");c.appendChild(aa);c.appendChild(La);E.appendChild(c);"svg"==K&&(c=document.createElement("div"),c.className="geDialogFormRow",aa=document.createElement("span"),aa.className="geDialogFormLabel",mxUtils.write(aa,mxResources.get("links")+":"),c.appendChild(aa),c.appendChild(ba),E.appendChild(c),E.appendChild(A));var Ca=
1==Y.shadowVisible,Pa=this.addCheckbox(E,mxResources.get("shadow"),null!=this.lastExportShadow?this.lastExportShadow:Ca,null,null,null,null,null,!0),Ka=null,Na="svg"!=K&&(this.isOffline()||!Editor.canvasSupported);if("png"==K||"jpeg"==K||"webp"==K||"svg"==K)Ka=this.addCheckbox(E,mxResources.get("grid"),Na||null==this.lastExportGrid?!1:this.lastExportGrid,Na,!1,!0,null,null,!0);f&&(X.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,A=document.createElement("div"),A.className="geDialogCheckRow",
A.appendChild(X),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("embedImages")),Y.setAttribute("for",X.id),A.appendChild(Y),E.appendChild(A),ea.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(ea),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("embedFonts")),Y.setAttribute("for",ea.id),A.appendChild(Y),E.appendChild(A),oa.checked=null!=this.lastEmbedCellMetadata?
-this.lastEmbedCellMetadata:!1,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(oa),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("embedCellMetadata")),Y.setAttribute("for",oa.id),A.appendChild(Y),E.appendChild(A),la.checked=null!=this.lastEmbedIcons?this.lastEmbedIcons:!1,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(la),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("icons")),Y.setAttribute("for",la.id),
-A.appendChild(Y),E.appendChild(A));l=new CustomDialog(this,ia,mxUtils.bind(this,function(){this.lastExportSelectionOnly=ua.checked;this.lastExportBorder=Ha.value;this.lastExportZoom=ka.value;P&&(this.lastExportTransparent=0==T.checked?null:T.checked);this.lastExportTheme=La.value==Ia?null:La.value;this.lastExportShadow=Pa.checked==Ca?null:Pa.checked;null==Ka||Na||(this.lastExportGrid=Ka.checked?!0:null);"svg"==K&&(this.lastExportLinkTarget="auto"==ca.value?null:ca.value);if("png"==K){var Oa=parseInt(va.value);
-this.lastExportDpi=!isNaN(Oa)&&0<Oa&&100!=Oa?Oa:null}Q&&(this.lastExportType=ha.value==H?null:ha.value);f&&(this.lastEmbedImages=X.checked,this.lastEmbedFonts=ea.checked,this.lastEmbedCellMetadata=oa.checked,this.lastEmbedIcons=la.checked);if("png"==K||"svg"==K)this.lastEmbedInclude=fa.value;null!=x&&x(ka.value,T.checked,!ua.checked,Pa.checked,W.checked,X.checked&&f,Ha.value,Da.checked,("png"==K||"svg"==K)&&"currentPage"==fa.value,ca.value,null!=Ka?Ka.checked:null,null!=La?La.value:null,ha.value,
-ea.checked,oa.checked&&f,"png"==K&&0<parseInt(va.value)&&100!=parseInt(va.value)?parseInt(va.value):null,la.checked&&f)}),null,l,q);this.showDialog(l.container,360,null,!0,!0,null,null,null,null,!0);ka.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ka.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,q,x,A,E){var K=document.createElement("div"),Q=this.editor.graph;if(null!=f){var V=document.createElement("h3");mxUtils.write(V,
-f);K.appendChild(V)}f=document.createElement("div");f.className="geDialogSection";var J=E?this.addPagesRow(f):null,ia=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),Y=this.addCheckbox(f,mxResources.get("shadow"),Q.shadowVisible&&q,!q,null,null,null,null,!0),aa=this.addCheckbox(f,l,!1,null,null,null,null,null,!0),ja=this.addCheckbox(f,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);K.appendChild(f);l=this.addAdvancedSection(K).content;var ka=null;A&&(ka=document.createElement("select"),
-ka.style.maxWidth="260px",A=document.createElement("option"),A.setAttribute("value","light"),mxUtils.write(A,mxResources.get("light")),ka.appendChild(A),A=document.createElement("option"),A.setAttribute("value","dark"),mxUtils.write(A,mxResources.get("dark")),ka.appendChild(A),mxUtils.lightDarkColorSupported?(A=document.createElement("option"),A.setAttribute("value","auto"),mxUtils.write(A,mxResources.get("automatic")),ka.appendChild(A),ka.value="auto"):ka.value=Editor.isDarkMode()?"dark":"light",
-A=document.createElement("div"),A.className="geDialogFormRow",q=document.createElement("span"),q.className="geDialogFormLabel",mxUtils.write(q,mxResources.get("appearance")+":"),A.appendChild(q),A.appendChild(ka),l.appendChild(A));var ua=this.addEditButton(l,ja),Da=ua.getEditInput(),ha=1<Q.model.getChildCount(Q.model.getRoot()),k=this.addCheckbox(l,mxResources.get("layers"),ha,!ha,null,null,null,null,!0),u=this.addCheckbox(l,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),H=this.addCheckbox(l,
+this.lastEmbedCellMetadata:!1,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(oa),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("embedCellMetadata")),Y.setAttribute("for",oa.id),A.appendChild(Y),E.appendChild(A),ka.checked=null!=this.lastEmbedIcons?this.lastEmbedIcons:!1,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(ka),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("icons")),Y.setAttribute("for",ka.id),
+A.appendChild(Y),E.appendChild(A));l=new CustomDialog(this,ia,mxUtils.bind(this,function(){this.lastExportSelectionOnly=ua.checked;this.lastExportBorder=Ga.value;this.lastExportZoom=la.value;P&&(this.lastExportTransparent=0==U.checked?null:U.checked);this.lastExportTheme=La.value==Ia?null:La.value;this.lastExportShadow=Pa.checked==Ca?null:Pa.checked;null==Ka||Na||(this.lastExportGrid=Ka.checked?!0:null);"svg"==K&&(this.lastExportLinkTarget="auto"==ba.value?null:ba.value);if("png"==K){var Oa=parseInt(va.value);
+this.lastExportDpi=!isNaN(Oa)&&0<Oa&&100!=Oa?Oa:null}Q&&(this.lastExportType=ha.value==H?null:ha.value);f&&(this.lastEmbedImages=X.checked,this.lastEmbedFonts=ea.checked,this.lastEmbedCellMetadata=oa.checked,this.lastEmbedIcons=ka.checked);if("png"==K||"svg"==K)this.lastEmbedInclude=fa.value;null!=x&&x(la.value,U.checked,!ua.checked,Pa.checked,W.checked,X.checked&&f,Ga.value,Da.checked,("png"==K||"svg"==K)&&"currentPage"==fa.value,ba.value,null!=Ka?Ka.checked:null,null!=La?La.value:null,ha.value,
+ea.checked,oa.checked&&f,"png"==K&&0<parseInt(va.value)&&100!=parseInt(va.value)?parseInt(va.value):null,ka.checked&&f)}),null,l,q);this.showDialog(l.container,360,null,!0,!0,null,null,null,null,!0);la.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?la.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,q,x,A,E){var K=document.createElement("div"),Q=this.editor.graph;if(null!=f){var V=document.createElement("h3");mxUtils.write(V,
+f);K.appendChild(V)}f=document.createElement("div");f.className="geDialogSection";var J=E?this.addPagesRow(f):null,ia=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),Y=this.addCheckbox(f,mxResources.get("shadow"),Q.shadowVisible&&q,!q,null,null,null,null,!0),aa=this.addCheckbox(f,l,!1,null,null,null,null,null,!0),ja=this.addCheckbox(f,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);K.appendChild(f);l=this.addAdvancedSection(K).content;var la=null;A&&(la=document.createElement("select"),
+la.style.maxWidth="260px",A=document.createElement("option"),A.setAttribute("value","light"),mxUtils.write(A,mxResources.get("light")),la.appendChild(A),A=document.createElement("option"),A.setAttribute("value","dark"),mxUtils.write(A,mxResources.get("dark")),la.appendChild(A),mxUtils.lightDarkColorSupported?(A=document.createElement("option"),A.setAttribute("value","auto"),mxUtils.write(A,mxResources.get("automatic")),la.appendChild(A),la.value="auto"):la.value=Editor.isDarkMode()?"dark":"light",
+A=document.createElement("div"),A.className="geDialogFormRow",q=document.createElement("span"),q.className="geDialogFormLabel",mxUtils.write(q,mxResources.get("appearance")+":"),A.appendChild(q),A.appendChild(la),l.appendChild(A));var ua=this.addEditButton(l,ja),Da=ua.getEditInput(),ha=1<Q.model.getChildCount(Q.model.getRoot()),k=this.addCheckbox(l,mxResources.get("layers"),ha,!ha,null,null,null,null,!0),u=this.addCheckbox(l,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),H=this.addCheckbox(l,
mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ja,"change",function(){ja.checked?(ha&&k.removeAttribute("disabled"),null!=J&&J.select.removeAttribute("disabled"),Da.removeAttribute("disabled"),u.removeAttribute("disabled"),H.removeAttribute("disabled")):(null!=J&&J.select.setAttribute("disabled","disabled"),k.setAttribute("disabled","disabled"),Da.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));Da.checked&&
-ja.checked?ua.getEditSelect().removeAttribute("disabled"):ua.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,K,mxUtils.bind(this,function(){c(ia.checked,Y.checked,aa.checked,ja.checked,ua.getLink(),k.checked,u.checked,H.checked,null!=ka?ka.value:null,null!=J?null!=J.row&&"allPages"==J.select.value:null)}),null,mxResources.get("embed"),x);this.showDialog(x.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,q,x,A,E,K,Q,V){function J(ka){var ua=
+ja.checked?ua.getEditSelect().removeAttribute("disabled"):ua.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,K,mxUtils.bind(this,function(){c(ia.checked,Y.checked,aa.checked,ja.checked,ua.getLink(),k.checked,u.checked,H.checked,null!=la?la.value:null,null!=J?null!=J.row&&"allPages"==J.select.value:null)}),null,mxResources.get("embed"),x);this.showDialog(x.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,q,x,A,E,K,Q,V){function J(la){var ua=
" ",Da="";q&&(ua=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(null!=Y?"&page="+Y:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+(E?"&link-icons=1":"")+(K?"&tooltip-icons=1":"")+"');}})(this);\"",
-Da+="cursor:pointer;");c&&(Da+="max-width:100%;");var ha="";l&&(ha=' width="'+Math.round(ia.width)+'" height="'+Math.round(ia.height)+'"');Q('<img src="'+ka+'"'+ha+(""!=Da?' style="'+Da+'"':"")+ua+"/>")}var ia=this.editor.graph.getGraphBounds(),Y=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ka){var ua=q?this.getFileData(!0):null;ka=this.createImageDataUri(ka,ua,"png");J(ka)}),null,null,null,mxUtils.bind(this,function(ka){V({message:mxResources.get("unknownError")})}),
+Da+="cursor:pointer;");c&&(Da+="max-width:100%;");var ha="";l&&(ha=' width="'+Math.round(ia.width)+'" height="'+Math.round(ia.height)+'"');Q('<img src="'+la+'"'+ha+(""!=Da?' style="'+Da+'"':"")+ua+"/>")}var ia=this.editor.graph.getGraphBounds(),Y=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(la){var ua=q?this.getFileData(!0):null;la=this.createImageDataUri(la,ua,"png");J(la)}),null,null,null,mxUtils.bind(this,function(la){V({message:mxResources.get("unknownError")})}),
null,!0,l?2:1,null,f,null,null,Editor.defaultBorder);else if(this.isRemoteExportEnabled())if(f=this.getFileData(!0),ia.width*ia.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var aa="";l&&(aa="&w="+Math.round(2*ia.width)+"&h="+Math.round(2*ia.height));var ja=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(q?"1":"0")+aa+"&xml="+encodeURIComponent(f));ja.send(mxUtils.bind(this,function(){200<=ja.getStatus()&&299>=ja.getStatus()?J("data:image/png;base64,"+ja.getText()):V({message:mxResources.get("unknownError")})}))}else V({message:mxResources.get("drawingTooLarge")});
else V({message:mxResources.get("notAvailable")})};EditorUi.prototype.createEmbedSvg=function(c,f,l,q,x,A,E,K,Q,V,J){Q=null!=Q?Q:"auto";V=null!=V?V:!0;var ia=this.getSelectedPageIndex(),Y=mxUtils.lightDarkColorSupported,aa=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var ja=null;try{ja=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,Q)}finally{mxUtils.lightDarkColorSupported=Y,mxUtils.preferDarkColor=
-aa}Q=ja.getElementsByTagName("a");if(null!=Q)for(Y=0;Y<Q.length;Y++)aa=Q[Y].getAttribute("href"),null!=aa&&"#"==aa.charAt(0)&&"_blank"==Q[Y].getAttribute("target")&&Q[Y].removeAttribute("target");q&&ja.setAttribute("content",this.getFileData(!0,null,null,null,null,!V));f&&this.editor.graph.addSvgShadow(ja);if(l){var ka=" ",ua="";q&&(ka="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
-EditorUi.lightboxHost+"/?client=1"+(V&&null!=ia?"&page="+ia:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+(E?"&link-icons=1":"")+(K?"&tooltip-icons=1":"")+"');}})(this);\"",ua+="cursor:pointer;");c&&(ua+="max-width:100%;");this.editor.convertImages(ja,mxUtils.bind(this,function(Da){J('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(Da))+'"'+(""!=ua?' style="'+ua+'"':"")+ka+"/>")}))}else ua="",q&&(ja.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+
+aa}Q=ja.getElementsByTagName("a");if(null!=Q)for(Y=0;Y<Q.length;Y++)aa=Q[Y].getAttribute("href"),null!=aa&&"#"==aa.charAt(0)&&"_blank"==Q[Y].getAttribute("target")&&Q[Y].removeAttribute("target");q&&ja.setAttribute("content",this.getFileData(!0,null,null,null,null,!V));f&&this.editor.graph.addSvgShadow(ja);if(l){var la=" ",ua="";q&&(la="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
+EditorUi.lightboxHost+"/?client=1"+(V&&null!=ia?"&page="+ia:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+(E?"&link-icons=1":"")+(K?"&tooltip-icons=1":"")+"');}})(this);\"",ua+="cursor:pointer;");c&&(ua+="max-width:100%;");this.editor.convertImages(ja,mxUtils.bind(this,function(Da){J('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(Da))+'"'+(""!=ua?' style="'+ua+'"':"")+la+"/>")}))}else ua="",q&&(ja.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+
EditorUi.lightboxHost+"/?client=1"+(V&&null!=ia?"&page="+ia:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+(E?"&link-icons=1":"")+(K?"&tooltip-icons=1":"")+"');}}})(this);"),ua+="cursor:pointer;"),c&&(c=parseInt(ja.getAttribute("width")),f=parseInt(ja.getAttribute("height")),ja.setAttribute("viewBox","-0.5 -0.5 "+c+" "+f),ua+="max-width:100%;max-height:"+f+"px;",ja.removeAttribute("height")),""!=ua&&(c=ja.getAttribute("style"),ja.setAttribute("style",(null!=c&&0<c.length?c+" ":"")+ua)),this.editor.addFontCss(ja),
this.editor.graph.mathEnabled&&this.editor.addMathCss(ja),J(mxUtils.getXml(ja))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+
mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var l=null;if("diagram"==c.nodeName)l=c;else if("mxfile"==c.nodeName){var q=c.getElementsByTagName("diagram");if(0<q.length){l=q[0];var x=f.getGlobalVariable;f.getGlobalVariable=function(A){return"page"==A?l.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==A?1:x.apply(this,arguments)}}}null!=l&&(c=Editor.parseDiagramNode(l))}q=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(A){}finally{this.editor.graph=
@@ -4427,23 +4429,23 @@ q}return c};EditorUi.prototype.getSvgFileProperties=function(c){var f=this.getPn
function(c){return{notes:null!=c&&"true"==c.getAttribute("notes")}};EditorUi.prototype.getEmbeddedPng=function(c,f,l,q,x){try{var A=this.editor.graph,E=null;if(null!=l&&0<l.length)A=this.createTemporaryGraph(A.getStylesheet()),document.body.appendChild(A.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,!0),A),E=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){A=this.createTemporaryGraph(A.getStylesheet());var K=A.getGlobalVariable;A.setBackgroundImage=
this.editor.graph.setBackgroundImage;var Q=this.pages[0];this.currentPage==Q?A.setBackgroundImage(this.editor.graph.backgroundImage):null!=Q.viewState&&null!=Q.viewState&&A.setBackgroundImage(Q.viewState.backgroundImage);A.getGlobalVariable=function(V){return"page"==V?Q.getName():"pagenumber"==V?1:K.apply(this,arguments)};document.body.appendChild(A.container);A.model.setRoot(Q.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{null==E&&(E=this.getFileData(!0,null,null,null,null,null,
null,null,null,!1));var J=V.toDataURL("image/png");J=Editor.writeGraphModelToPng(J,"tEXt","mxfile",encodeURIComponent(E));c(J.substring(J.lastIndexOf(",")+1));A!=this.editor.graph&&A.container.parentNode.removeChild(A.container)}catch(ia){null!=f&&f(ia)}}),null,null,null,mxUtils.bind(this,function(V){null!=f&&f(V)}),null,null,q,null,A.shadowVisible,null,A,x,null,null,null,"diagram",null)}catch(V){null!=f&&f(V)}};EditorUi.prototype.getSvgWithFontLookup=function(c,f,l){var q=Graph.addFont;Graph.addFont=
-function(A,E,K,Q){q.call(this,A,E,K,c)};var x=f.drawCellState;f.drawCellState=function(A,E){null!=A&&Graph.processFontStyle(A.style);x.apply(this,arguments)};try{return l()}finally{Graph.addFont=q}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja){K=null!=K?K:!0;J=null!=J?J:0;var ka=null!=Q?Q:f.background;ka==mxConstants.NONE&&(ka=null);null==ka&&"none"==f.getAdaptiveColors()&&(ka="#ffffff");var ua=this.editor.graph.createSvgImageExport(null!=c,aa);E=Object.create(null);
-Q=this.getSvgWithFontLookup(E,ua,function(){return f.getSvg(ka,V,J,null,null,A,null,ua,null,f.shadowVisible||ia,null,Y,"diagram")});(f.shadowVisible||ia)&&f.addSvgShadow(Q,null,null,0==J);null!=c&&Q.setAttribute("content",c);null!=l&&Q.setAttribute("resource",l);var Da=mxUtils.bind(this,function(u){u=(q?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(u);null!=x&&x(u);return u});f.mathEnabled&&this.editor.addMathCss(Q);if(null!=x)this.embedFonts(Q,mxUtils.bind(this,
+function(A,E,K,Q){q.call(this,A,E,K,c)};var x=f.drawCellState;f.drawCellState=function(A,E){null!=A&&Graph.processFontStyle(A.style);x.apply(this,arguments)};try{return l()}finally{Graph.addFont=q}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja){K=null!=K?K:!0;J=null!=J?J:0;var la=null!=Q?Q:f.background;la==mxConstants.NONE&&(la=null);null==la&&"none"==f.getAdaptiveColors()&&(la="#ffffff");var ua=this.editor.graph.createSvgImageExport(null!=c,aa);E=Object.create(null);
+Q=this.getSvgWithFontLookup(E,ua,function(){return f.getSvg(la,V,J,null,null,A,null,ua,null,f.shadowVisible||ia,null,Y,"diagram")});(f.shadowVisible||ia)&&f.addSvgShadow(Q,null,null,0==J);null!=c&&Q.setAttribute("content",c);null!=l&&Q.setAttribute("resource",l);var Da=mxUtils.bind(this,function(u){u=(q?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(u);null!=x&&x(u);return u});f.mathEnabled&&this.editor.addMathCss(Q);if(null!=x)this.embedFonts(Q,mxUtils.bind(this,
function(u){K?this.editor.convertImages(u,mxUtils.bind(this,function(H){Da(H)})):Da(u)}),ja,E);else{var ha=!1;this.embedFonts(Q,function(){ha=!0},ja,E);if(!ha)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(Q);var k=this.editor.graph.getExtFontCss(E);0<k.length&&this.editor.addFontCss(Q,k)}catch(u){}return Da(Q)}};EditorUi.prototype.embedFonts=function(c,f,l,q){if(l=null!=l?l:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&
this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(A){try{null!=A&&this.editor.addFontCss(c,A),f(c)}catch(E){f(c)}}),q)}catch(A){f(c)}}));else{try{this.editor.addFontCss(c);var x=this.editor.graph.getExtFontCss(q);0<x.length&&this.editor.addFontCss(c,x)}catch(A){}f(c)}};EditorUi.prototype.exportImage=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){Q=null!=Q?Q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ja){Editor.addRetryToError(ja,
-mxUtils.bind(this,function(){this.exportImage(c,f,l,q,x,A,E,K,Q,V,J,ia,Y)}));this.handleError(ja)}))){var aa=this.editor.graph.isSelectionEmpty();l=null!=l?l:aa;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ja){this.spinner.stop();try{this.saveCanvas(ja,x?this.getFileData(!0,null,null,null,l,K,null,null,null,null,null,c,A):null,Q,null==this.pages||0==this.pages.length,J)}catch(ka){this.handleError(ka)}}),null,this.thumbImageCache,null,
+mxUtils.bind(this,function(){this.exportImage(c,f,l,q,x,A,E,K,Q,V,J,ia,Y)}));this.handleError(ja)}))){var aa=this.editor.graph.isSelectionEmpty();l=null!=l?l:aa;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ja){this.spinner.stop();try{this.saveCanvas(ja,x?this.getFileData(!0,null,null,null,l,K,null,null,null,null,null,c,A):null,Q,null==this.pages||0==this.pages.length,J)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,
mxUtils.bind(this,function(ja){this.spinner.stop();this.handleError(ja)}),null,l,c||1,f,q,null,null,A,E,V,ia,Y)}catch(ja){this.spinner.stop(),this.handleError(ja)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,l,q,x,A,E){EditorUi.debug("EditorUi.importXml",
[this],"xml",[c],"dx",[f],"dy",[l],"crop",[q],"noErrorHandling",[x],"addNewPage",[A],"applyDefaultStyles",[E]);f=null!=f?f:0;l=null!=l?l:0;var K=[];try{if(null!=c&&0<c.length){var Q=null!=this.pages?this.pages.length:0,V=this.isDiagramEmpty(),J=this.currentPage,ia=this.editor.graph;ia.model.beginUpdate();try{var Y=mxUtils.parseXml(c);c={};var aa=this.editor.extractGraphModel(Y.documentElement,null!=this.pages);if(null!=aa&&"mxfile"==aa.nodeName&&null!=this.pages){var ja=aa.getElementsByTagName("diagram");
-if(0<ja.length){Y=[];var ka=0;if(1==ja.length&&!A){if(null!=this.currentPage&&(c[ja[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ua=ja[0].getAttribute("name");null!=ua&&""!=ua&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ua))}aa=Editor.parseDiagramNode(ja[0]);q=!1;ka=1}for(;ka<ja.length;ka++){var Da=ja[ka].getAttribute("id");ja[ka].removeAttribute("id");var ha=this.updatePageRoot(new DiagramPage(ja[ka]));c[Da]=ja[ka].getAttribute("id");var k=this.pages.length;
-null==ha.getName()&&ha.setName(mxResources.get("pageWithNumber",[k+1]));ia.model.execute(new ChangePage(this,ha,ha,k,0<ka));Y.push(ha)}this.updatePageLinks(c,Y)}}if(null!=aa&&"mxGraphModel"===aa.nodeName){K=ia.importGraphModel(aa,f,l,q);if(null!=K)for(this.addLocalPagesToMapping(c),ka=0;ka<K.length;ka++)this.updatePageLinksForCell(c,K[ka]);var u=ia.parseBackgroundImage(aa.getAttribute("backgroundImage"));if(null!=u&&null!=u.originalSrc&&this.updateBackgroundPageLink(c,u)){var H=new ChangePageSetup(this,
+if(0<ja.length){Y=[];var la=0;if(1==ja.length&&!A){if(null!=this.currentPage&&(c[ja[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ua=ja[0].getAttribute("name");null!=ua&&""!=ua&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ua))}aa=Editor.parseDiagramNode(ja[0]);q=!1;la=1}for(;la<ja.length;la++){var Da=ja[la].getAttribute("id");ja[la].removeAttribute("id");var ha=this.updatePageRoot(new DiagramPage(ja[la]));c[Da]=ja[la].getAttribute("id");var k=this.pages.length;
+null==ha.getName()&&ha.setName(mxResources.get("pageWithNumber",[k+1]));ia.model.execute(new ChangePage(this,ha,ha,k,0<la));Y.push(ha)}this.updatePageLinks(c,Y)}}if(null!=aa&&"mxGraphModel"===aa.nodeName){K=ia.importGraphModel(aa,f,l,q);if(null!=K)for(this.addLocalPagesToMapping(c),la=0;la<K.length;la++)this.updatePageLinksForCell(c,K[la]);var u=ia.parseBackgroundImage(aa.getAttribute("backgroundImage"));if(null!=u&&null!=u.originalSrc&&this.updateBackgroundPageLink(c,u)){var H=new ChangePageSetup(this,
null,u);H.ignoreColor=!0;ia.model.execute(H)}}E&&ia.pasteCellStyles(ia.includeDescendants(K),ia.defaultVertexStyle,ia.defaultEdgeStyle);!A&&J!=this.currentPage&&null!=this.pages&&1<this.pages.length&&V&&1==Q&&this.removePage(J)}finally{ia.model.endUpdate()}}}catch(P){if(x)throw P;this.handleError(P)}return K};EditorUi.prototype.updatePageLinks=function(c,f){for(var l=0;l<f.length;l++)this.updatePageLinksForCell(c,f[l].root),f[l]!=this.currentPage&&(f[l].needsUpdate=!0),null!=f[l].viewState&&this.updateBackgroundPageLink(c,
f[l].viewState.backgroundImage)&&(f[l]==this.currentPage&&this.editor.graph.setViewState(f[l].viewState,!0),f[l].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var l=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var q=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=q&&(f.originalSrc="data:page/id,"+q,l=!0)}}catch(x){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,f){var l=document.createElement("div"),q=this.editor.graph,x=q.getLinkForCell(f);
null!=x&&q.setLinkForCell(f,this.updatePageLink(c,x));if(q.isHtmlLabel(f)){l.innerHTML=Graph.sanitizeHtml(q.getLabel(f));for(var A=l.getElementsByTagName("a"),E=!1,K=0;K<A.length;K++)x=A[K].getAttribute("href"),null!=x&&(A[K].setAttribute("href",this.updatePageLink(c,x)),E=!0);E&&q.labelChanged(f,l.innerHTML)}for(K=0;K<q.model.getChildCount(f);K++)this.updatePageLinksForCell(c,q.model.getChildAt(f,K))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var l=c[f.substring(f.indexOf(",")+
1)];f=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==f.substring(0,17))try{var q=JSON.parse(f.substring(17));if(null!=q.actions){for(var x=0;x<q.actions.length;x++){var A=q.actions[x];if(null!=A.open&&Graph.isPageLink(A.open)){var E=A.open.substring(A.open.indexOf(",")+1);l=c[E];null!=l?A.open="data:page/id,"+l:null==this.getPageById(E)&&delete A.open}}f="data:action/json,"+JSON.stringify(q)}}catch(K){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||
/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,l,q,x){var A=mxUtils.bind(this,function(E){this.loadingExtensions=!1;null!=l?l(E):this.handleError(E)});this.createTimeout(null,mxUtils.bind(this,function(E){q=null!=q?q:c.name;var K=mxUtils.bind(this,function(V){E.clear()&&A(V)}),Q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var V=this.isRemoteVisioFormat(q);try{var J=q.lastIndexOf(".");if(0<=J&&J<q.length)q.substring(J+1).toUpperCase();else{var ia=
q.lastIndexOf("/");0<=ia&&ia<q.length&&(q=q.substring(ia+1))}}catch(aa){}if(V)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(q)?K({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):K({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{V=new FormData;V.append("file1",c,q);var Y=new XMLHttpRequest;Y.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(q)?"?stencil=1":""));Y.responseType="blob";
-this.addRemoteServiceSecurityCheck(Y);null!=x&&Y.setRequestHeader("x-convert-custom",x);Y.onreadystatechange=mxUtils.bind(this,function(){if(4==Y.readyState&&E.clear())if(200<=Y.status&&299>=Y.status)try{var aa=Y.response;if("text/xml"==aa.type){var ja=new FileReader;ja.onload=mxUtils.bind(this,function(ka){try{f(ka.target.result)}catch(ua){K({message:mxResources.get("errorLoadingFile")})}});ja.readAsText(aa)}else this.doImportVisio(aa,f,K,q)}catch(ka){K(ka)}else try{""==Y.responseType||"text"==Y.responseType?
-K({message:Y.responseText}):(ja=new FileReader,ja.onload=function(){try{K({message:JSON.parse(ja.result).Message})}catch(ka){null!=ja.result&&0<ja.result.length?K({message:ja.result}):K(ka)}},ja.readAsText(Y.response))}catch(ka){K({})}});Y.send(V)}else if(E.clear())try{this.doImportVisio(c,f,K,q)}catch(aa){K(aa)}}else K({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?Q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+
+this.addRemoteServiceSecurityCheck(Y);null!=x&&Y.setRequestHeader("x-convert-custom",x);Y.onreadystatechange=mxUtils.bind(this,function(){if(4==Y.readyState&&E.clear())if(200<=Y.status&&299>=Y.status)try{var aa=Y.response;if("text/xml"==aa.type){var ja=new FileReader;ja.onload=mxUtils.bind(this,function(la){try{f(la.target.result)}catch(ua){K({message:mxResources.get("errorLoadingFile")})}});ja.readAsText(aa)}else this.doImportVisio(aa,f,K,q)}catch(la){K(la)}else try{""==Y.responseType||"text"==Y.responseType?
+K({message:Y.responseText}):(ja=new FileReader,ja.onload=function(){try{K({message:JSON.parse(ja.result).Message})}catch(la){null!=ja.result&&0<ja.result.length?K({message:ja.result}):K(la)}},ja.readAsText(Y.response))}catch(la){K({})}});Y.send(V)}else if(E.clear())try{this.doImportVisio(c,f,K,q)}catch(aa){K(aa)}}else K({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?Q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+
"js/extensions.min.js",Q,null,null,null,K))}),A)};EditorUi.prototype.importGraphML=function(c,f,l){var q=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=l?l(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var A=mxUtils.bind(this,function(K){x.clear()&&q(K)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,q)}catch(K){A(K)}else A({message:mxResources.get("serviceUnavailableOrBlocked")})});
this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?E():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,A))}),q)};EditorUi.prototype.importGliffy=function(c,f,l,q){var x=mxUtils.bind(this,function(A){null!=l&&l({status:"undefined"!==typeof mxGliffyToDrawio&&"function"===typeof mxGliffyToDrawio.LimitExceededException&&A instanceof mxGliffyToDrawio.LimitExceededException?413:500,message:null!=A&&null!=A.message?A.message:mxResources.get("serviceUnavailableOrBlocked")})});
this.loadGliffy(mxUtils.bind(this,function(){var A=null;try{A=mxGliffyToDrawio.convert(c)}catch(E){x(E);return}if(null!=A){try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+c.length})}catch(E){}f(A)}else x(null)}),x)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var q=
@@ -4452,19 +4454,19 @@ mxUtils.bind(this,function(A){l.clear()&&f(A)}),x=mxUtils.bind(this,function(){t
f(LucidImporter.importState(K));try{if(null!=window.console&&"1"==urlParams.test){var Q=[(new Date).toISOString(),"convertLucidChart",K];null!=K.state&&Q.push(JSON.parse(K.state));if(null!=K.svgThumbs)for(var V=0;V<K.svgThumbs.length;V++)Q.push(Editor.createSvgDataUri(K.svgThumbs[V]));null!=K.thumb&&Q.push(K.thumb);console.log.apply(console,Q)}}catch(J){}}catch(J){null!=window.console&&console.error(J),A(J)}else A({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||
this.loadingExtensions||this.isOffline(!0)?window.setTimeout(E,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",E,null,null,null,A)},null,null,null,A)},null,null,null,A)},null,null,null,A)},null,null,null,A):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",
E,null,null,null,A))}),q)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,l,q,x){var A=null!=x&&null!=x.dataAttr?x.dataAttr:"mermaidData",E=null!=x&&null!=x.attrPrefix?x.attrPrefix:"mermaid",K=this.editor.graph;x=mxUtils.parseXml((null!=x&&null!=x.wrapGroup?x.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,l,q));var Q=new mxCodec(x);f=new mxGraphModel;Q.decode(x.documentElement,f);Q=f.getRoot();var V=null;for(x=0;null!=Q&&x<f.getChildCount(Q)&&null==V;x++)for(var J=f.getChildAt(Q,x),ia=0;ia<
-f.getChildCount(J);ia++){var Y=f.getChildAt(J,ia),aa=Y.value;if(null!=aa&&"object"===typeof aa&&null!=aa.getAttribute&&null!=aa.getAttribute(A)){V=Y;break}}if(null!=V){Q=[];for(x=0;x<f.getChildCount(V);x++)Q.push(f.getChildAt(V,x));0==Q.length&&(Q=[V]);V=f.getGeometry(V);J=aa=Infinity;Y=K.model.getChildCount(c);for(x=0;x<Y;x++){var ja=K.model.getChildAt(c,x);K.model.isVertex(ja)&&(ja=ja.getGeometry(),null!=ja&&(aa=Math.min(aa,ja.x),J=Math.min(J,ja.y)))}var ka=Infinity;ja=Infinity;for(x=0;x<Q.length;x++)f.isVertex(Q[x])&&
-(Y=Q[x].getGeometry(),null!=Y&&(ka=Math.min(ka,Y.x),ja=Math.min(ja,Y.y)));aa=isFinite(aa)&&isFinite(ka)?aa-ka:0;J=isFinite(J)&&isFinite(ja)?J-ja:0;if(0!=aa||0!=J)for(x=0;x<Q.length;x++)if(ja=Q[x],Y=ja.getGeometry(),null!=Y){Y=Y.clone();if(f.isVertex(ja))Y.x+=aa,Y.y+=J;else if(f.isEdge(ja)){if(null!=Y.points)for(ka=0;ka<Y.points.length;ka++)null!=Y.points[ka]&&(Y.points[ka].x+=aa,Y.points[ka].y+=J);null!=Y.sourcePoint&&(Y.sourcePoint.x+=aa,Y.sourcePoint.y+=J);null!=Y.targetPoint&&(Y.targetPoint.x+=
+f.getChildCount(J);ia++){var Y=f.getChildAt(J,ia),aa=Y.value;if(null!=aa&&"object"===typeof aa&&null!=aa.getAttribute&&null!=aa.getAttribute(A)){V=Y;break}}if(null!=V){Q=[];for(x=0;x<f.getChildCount(V);x++)Q.push(f.getChildAt(V,x));0==Q.length&&(Q=[V]);V=f.getGeometry(V);J=aa=Infinity;Y=K.model.getChildCount(c);for(x=0;x<Y;x++){var ja=K.model.getChildAt(c,x);K.model.isVertex(ja)&&(ja=ja.getGeometry(),null!=ja&&(aa=Math.min(aa,ja.x),J=Math.min(J,ja.y)))}var la=Infinity;ja=Infinity;for(x=0;x<Q.length;x++)f.isVertex(Q[x])&&
+(Y=Q[x].getGeometry(),null!=Y&&(la=Math.min(la,Y.x),ja=Math.min(ja,Y.y)));aa=isFinite(aa)&&isFinite(la)?aa-la:0;J=isFinite(J)&&isFinite(ja)?J-ja:0;if(0!=aa||0!=J)for(x=0;x<Q.length;x++)if(ja=Q[x],Y=ja.getGeometry(),null!=Y){Y=Y.clone();if(f.isVertex(ja))Y.x+=aa,Y.y+=J;else if(f.isEdge(ja)){if(null!=Y.points)for(la=0;la<Y.points.length;la++)null!=Y.points[la]&&(Y.points[la].x+=aa,Y.points[la].y+=J);null!=Y.sourcePoint&&(Y.sourcePoint.x+=aa,Y.sourcePoint.y+=J);null!=Y.targetPoint&&(Y.targetPoint.x+=
aa,Y.targetPoint.y+=J)}f.setGeometry(ja,Y)}f=this.snapshotMermaidIdentity(c,E);Q=K.cloneCells(Q,!0);K.getModel().beginUpdate();try{for(ia=K.model.getChildCount(c)-1;0<=ia;ia--)K.model.remove(K.model.getChildAt(c,ia));for(x=0;x<Q.length;x++)this.applyMermaidUserCustomizations(Q[x],f,E),K.model.add(c,Q[x]);if(null!=V){var ua=K.model.getGeometry(c);null!=ua&&(ua=ua.clone(),ua.width=V.width,ua.height=V.height,K.model.setGeometry(c,ua))}K.setAttributeForCell(c,A,JSON.stringify({data:l,config:q},null,2))}finally{K.getModel().endUpdate()}}};
EditorUi.prototype.snapshotMermaidIdentity=function(c,f){f=null!=f?f:"mermaid";for(var l=this.editor.graph,q={},x=l.model.getChildCount(c),A=0;A<x;A++){var E=l.model.getChildAt(c,A),K=E.value;if(null!=K&&"object"===typeof K&&null!=K.getAttribute){var Q=K.getAttribute(f+"Id");Q&&(q[Q]={currentStyle:E.style||"",currentLabel:K.getAttribute("label")||"",baseStyle:K.getAttribute(f+"BaseStyle")||"",baseValue:K.getAttribute(f+"BaseValue")||""})}}return q};EditorUi.prototype.applyMermaidUserCustomizations=
-function(c,f,l){var q=c.value;null!=q&&"object"===typeof q&&null!=q.getAttribute&&(l=q.getAttribute((null!=l?l:"mermaid")+"Id"))&&(f=f[l],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&q.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=function(c,f,l,q){function x(J){var ia={},Y=[];if(!J)return{map:ia,keys:Y};J=J.split(";");for(var aa=0;aa<J.length;aa++){var ja=J[aa];if(ja){var ka=ja.indexOf("=");
-if(0<ka){var ua=ja.substring(0,ka);ua in ia||Y.push(ua);ia[ua]=ja.substring(ka+1)}else ja in ia||Y.push(ja),ia[ja]=!0}}return{map:ia,keys:Y}}c=x(c);f=x(f);var A=x(l),E={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},K=q?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};q={};l=[];for(var Q=0;Q<A.keys.length;Q++){var V=A.keys[Q];q[V]=A.map[V];l.push(V)}for(Q=0;Q<f.keys.length;Q++)V=f.keys[Q],E[V]||K[V]||f.map[V]===
+function(c,f,l){var q=c.value;null!=q&&"object"===typeof q&&null!=q.getAttribute&&(l=q.getAttribute((null!=l?l:"mermaid")+"Id"))&&(f=f[l],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&q.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=function(c,f,l,q){function x(J){var ia={},Y=[];if(!J)return{map:ia,keys:Y};J=J.split(";");for(var aa=0;aa<J.length;aa++){var ja=J[aa];if(ja){var la=ja.indexOf("=");
+if(0<la){var ua=ja.substring(0,la);ua in ia||Y.push(ua);ia[ua]=ja.substring(la+1)}else ja in ia||Y.push(ja),ia[ja]=!0}}return{map:ia,keys:Y}}c=x(c);f=x(f);var A=x(l),E={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},K=q?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};q={};l=[];for(var Q=0;Q<A.keys.length;Q++){var V=A.keys[Q];q[V]=A.map[V];l.push(V)}for(Q=0;Q<f.keys.length;Q++)V=f.keys[Q],E[V]||K[V]||f.map[V]===
c.map[V]||(V in q||l.push(V),q[V]=f.map[V]);for(Q=0;Q<c.keys.length;Q++)V=c.keys[Q],E[V]||K[V]||V in f.map||delete q[V];c=[];for(Q=0;Q<l.length;Q++)V=l[Q],f=q[V],void 0!==f&&(!0===f?c.push(V):c.push(V+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,l){var q=null,x=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(x.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,x.getModel()),
q=x.getSvg(null,null,f,null,null,null,null,null,null,null,null,l,null,null,!0,!0)}finally{document.body.removeChild(x.container)}return q};EditorUi.prototype.showPreviewTooltip=function(c,f){if(null!=this.sidebar&&(c=this.stringToCells(c),0<c.length)){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.sidebar.createTooltip(mxEvent.getSource(f),c,Math.min(l-120,1600),Math.min(q-
120,1200),null,!0,new mxPoint(mxEvent.getClientX(f),mxEvent.getClientY(f)),!0,null,!0,!1);null==this.previewTooltipDialogListener&&(this.previewTooltipDialogListener=mxUtils.bind(this,function(){this.sidebar.hideTooltip()}),this.editor.addListener("hideDialog",this.previewTooltipDialogListener))}};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,l,q){var x=0,A=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(E){var K="";if(null!=this.drive&&
null!=this.drive.getUser()){var Q=this.drive.getUser();null!=Q.email&&0<Q.email.indexOf("@")&&(K=Q.email.substring(Q.email.indexOf("@")+1))}var V={prompt:c,driveDomain:K,options:null!=q?q:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"url",["https://www.draw.io/generate/v3"]);var J=Date.now();K=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(V),"POST");var ia=mxUtils.bind(this,function(aa){E.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",
-[this],"data",[V],"error",[aa],"time",Date.now()-J+" ms"),l(aa))}),Y=mxUtils.bind(this,function(aa){3>x++?E.clear()&&A():ia(aa)});K.send(mxUtils.bind(this,function(aa){if(E.isAlive())if(200<=aa.getStatus()&&299>=aa.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ka=aa.getText();try{ka=JSON.parse(ka),result=ka.result}catch(k){result=ka}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"response",[ka],"time",Date.now()-J+" ms");ka=Editor.extractGraphModelFromText(result);
-var ua=!1;if((null==ka||""==ka[1])&&0<=result.indexOf("<mxGraphModel")){var Da=Editor.repairTruncatedXml(result);null!=Da&&(ka=Editor.extractGraphModelFromText(Da),ua=""!=ka[1])}if(null!=ka&&""!=ka[1])E.clear()&&f(ka[1],ua);else if("<"==mxUtils.trim(result).charAt(0))E.clear()&&f(result);else{var ha=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(ha,null,mxUtils.bind(this,function(k){this.tryAndHandle(mxUtils.bind(this,function(){E.clear()&&f(mxMermaidToDrawio.wrapGroup(k,
-ha,EditorUi.getInsertMermaidConfig()))}),ia)}),ia,Y)}}),ia,!0);else{var ja={message:mxResources.get("error")+" "+aa.getStatus()};try{ja=JSON.parse(aa.getText()),null!=ja.error&&(ja.message=ja.error)}catch(ka){}ia(ja)}}),ia)}),l)});A()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var l=mxUtils.trim(1>=
+[this],"data",[V],"error",[aa],"time",Date.now()-J+" ms"),l(aa))}),Y=mxUtils.bind(this,function(aa){3>x++?E.clear()&&A():ia(aa)});K.send(mxUtils.bind(this,function(aa){if(E.isAlive())if(200<=aa.getStatus()&&299>=aa.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var la=aa.getText();try{la=JSON.parse(la),result=la.result}catch(k){result=la}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"response",[la],"time",Date.now()-J+" ms");la=Editor.extractGraphModelFromText(result);
+var ua=!1;if((null==la||""==la[1])&&0<=result.indexOf("<mxGraphModel")){var Da=Editor.repairTruncatedXml(result);null!=Da&&(la=Editor.extractGraphModelFromText(Da),ua=""!=la[1])}if(null!=la&&""!=la[1])E.clear()&&f(la[1],ua);else if("<"==mxUtils.trim(result).charAt(0))E.clear()&&f(result);else{var ha=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(ha,null,mxUtils.bind(this,function(k){this.tryAndHandle(mxUtils.bind(this,function(){E.clear()&&f(mxMermaidToDrawio.wrapGroup(k,
+ha,EditorUi.getInsertMermaidConfig()))}),ia)}),ia,Y)}}),ia,!0);else{var ja={message:mxResources.get("error")+" "+aa.getStatus()};try{ja=JSON.parse(aa.getText()),null!=ja.error&&(ja.message=ja.error)}catch(la){}ia(ja)}}),ia)}),l)});A()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var l=mxUtils.trim(1>=
f.length?c:f[1]),q=l.split("\n"),x=0;x<q.length&&("mermaid"==q[x]||0==q[x].trim().length||"%%"==q[x].substring(0,2));)x++;l=[];for(var A=x;A<q.length;A++){var E=mxUtils.trim(q[A]);if("%%"!=E.substring(0,2)&&"classDef "!=E.substring(0,9))l.push(q[A]);else if("mermaid"==E)break}q=l;l=mxUtils.trim(q.join("\n"));A="undefined"!==typeof MermaidParser?MermaidParser.detectType(l):null;EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[l],"typeInfo",[A],"startLine",x,"lines",q,"tokens",
f);return null!=A?l:null};EditorUi.prototype.getMermaidDiagramType=function(c){var f=null!=c?c.split("\n"):[],l=0;c=function(){for(;l<f.length&&(0==f[l].trim().length||"%%"==f[l].substring(0,2));)l++};c();if(l<f.length&&"---"==f[l].trim()){do l++;while(l<f.length&&"---"!=f[l].trim());l++;c()}if(l>=f.length)return"";c=f[l].trim().toLowerCase();var q=c.indexOf(" ");return c.substring(0,0<q?q:c.length)};EditorUi.prototype.isMermaidElkFlowchart=function(c){return null!=c&&(/defaultRenderer["']?\s*:\s*["']?elk/i.test(c)||
/(?:^|\n)\s*layout\s*:\s*["']?elk\b/i.test(c))&&/(?:flowchart|graph)\b/i.test(c)};EditorUi.prototype.applyMermaidElkPostPass=function(c,f,l){if("undefined"===typeof ElkLayout||"undefined"===typeof Graph)l(c);else{f=f.match(/(?:flowchart|graph)\s+(LR|RL|TB|TD|BT)/i);var q={LR:"RIGHT",RL:"LEFT",TB:"DOWN",TD:"DOWN",BT:"UP"};f=f?q[f[1].toUpperCase()]||"DOWN":"DOWN";var x=document.createElement("div");x.style.cssText="position:absolute;left:-99999px;top:-99999px;width:1200px;height:800px;visibility:hidden;";
@@ -4485,7 +4487,7 @@ q?this.parsePlantUmlDiagram(x.data,null,K,l):this.parseMermaidDiagram(x.data,mxU
null,!0);l.model.remove(c);l.setSelectionCells(K)}finally{l.getModel().endUpdate()}l.scrollCellToVisible(l.getSelectionCell());return K};EditorUi.prototype.insertAsPreText=function(c,f,l){var q=this.editor.graph,x=null;q.getModel().beginUpdate();try{x=q.insertVertex(null,null,"<pre>"+c+"</pre>",f,l,1,1,"text;html=1;align=left;verticalAlign=top;"),q.updateCellSize(x,!0)}finally{q.getModel().endUpdate()}return x};EditorUi.prototype.insertTextAt=function(c,f,l,q,x,A,E,K){A=null!=A?A:!0;E=null!=E?E:!0;
if(null!=c)if(Graph.fileSupport&&this.isGliffyData(c))this.importGliffy(c.replace(/\s+/g," "),mxUtils.bind(this,function(Y){this.editor.graph.setSelectionCells(this.insertTextAt(Y,f,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(x||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var Q=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var V=Editor.extractGraphModelFromPdf(c);if(null!=V&&0<V.length)return this.importXml(V,f,l,A,!0,K)}if(Editor.isPngDataUrl(c)&&(V=
Editor.extractGraphModelFromPng(c),null!=V&&0<V.length))return this.importXml(V,f,l,A,!0,K);if("data:image/svg+xml;"==c.substring(0,19))try{V=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(V=c.substring(c.indexOf(",")+1),V=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V,!0)):V=decodeURIComponent(c.substring(c.indexOf(",")+1));var J=this.importXml(V,f,l,A,!0,K);if(0<J.length)return J}catch(Y){}this.loadImage(c,mxUtils.bind(this,function(Y){if("data:"==c.substring(0,5))this.resizeImage(Y,
-Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(ka,ua,Da){Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(l),ua,Da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(ka)+";"))}),E,this.maxImageSize);else{var aa=Math.min(1,Math.min(this.maxImageSize/Y.width,this.maxImageSize/Y.height)),ja=Math.round(Y.width*aa);Y=Math.round(Y.height*aa);Q.setSelectionCell(Q.insertVertex(null,
+Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(la,ua,Da){Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(l),ua,Da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(la)+";"))}),E,this.maxImageSize);else{var aa=Math.min(1,Math.min(this.maxImageSize/Y.width,this.maxImageSize/Y.height)),ja=Math.round(Y.width*aa);Y=Math.round(Y.height*aa);Q.setSelectionCell(Q.insertVertex(null,
null,"",Q.snap(f),Q.snap(l),ja,Y,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var Y=null;Q.getModel().beginUpdate();try{Y=Q.insertVertex(Q.getDefaultParent(),null,c,Q.snap(f),Q.snap(l),1,1,"text;"+(q?"html=1;":"")),Q.updateCellSize(Y),Q.fireEvent(new mxEventObject("textInserted","cells",[Y]))}finally{Q.getModel().endUpdate()}Q.setSelectionCell(Y)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));
if(this.isCompatibleString(c))return this.importXml(c,f,l,A,null,K);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(Y){this.editor.graph.setSelectionCells(this.importXml(Y,f,l,A,null,K))}),mxUtils.bind(this,function(Y){this.handleError(Y)}));else{Q=this.editor.graph;x=null;Q.getModel().beginUpdate();try{x=Q.insertVertex(Q.getDefaultParent(),null,"",Q.snap(f),Q.snap(l),1,1,"text;whiteSpace=wrap;"+(q?"html=1;":""));Q.fireEvent(new mxEventObject("textInserted",
"cells",[x]));q&&(c=Q.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");x.value=c;Q.updateCellSize(x);if(0<this.maxTextWidth&&x.geometry.width>this.maxTextWidth){var ia=Q.getPreferredSizeForCell(x,this.maxTextWidth);x.geometry.width=ia.width;x.geometry.height=ia.height}Graph.isLink(x.value)&&Q.setLinkForCell(x,x.value);x.geometry.width+=Q.gridSize;x.geometry.height+=Q.gridSize}finally{Q.getModel().endUpdate()}return[x]}}return[]};EditorUi.prototype.formatFileSize=
@@ -4497,77 +4499,77 @@ if(!f){var x=this.dialog,A=x.close;this.dialog.close=mxUtils.bind(this,function(
V?(Q=!0,J.async("string").then(function(ia){0==ia.indexOf("<mxfile ")?f(ia):l()})):0==V.indexOf("versions/")&&(V=parseInt(V.substr(9)),V>E&&(E=V,K=J))});0<E?K.async("string").then(function(V){q.isGliffyData(V,c.name)?q.importGliffy(V,function(J){f(J)},function(){l()},c.name):l()}):Q||l()}},function(A){l(A)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?x():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,l))};EditorUi.prototype.importFile=
function(c,f,l,q,x,A,E,K,Q,V,J,ia){V=null!=V?V:!0;var Y=!1,aa=null,ja=mxUtils.bind(this,function(Da){var ha=null;null!=Da&&"<mxlibrary"==Da.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,Da,E)),this.showSidebar()):ha=this.importXml(Da,l,q,V,null,null!=ia?mxEvent.isControlDown(ia):null);null!=K&&K(ha)});if("image"==f.substring(0,5))Q=!1,"image/png"==f.substring(0,9)&&(J=J?null:this.extractGraphModelFromPng(c),null!=J&&0<J.length&&(aa=this.importXml(J,l,q,V,null,null!=ia?mxEvent.isControlDown(ia):
null),Q=!0)),Q||(J=this.editor.graph,Q=c.indexOf(";"),0<Q&&(c=c.substring(0,Q)+c.substring(c.indexOf(",",Q+1))),V&&J.isGridEnabled()&&(l=J.snap(l),q=J.snap(q)),Q="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(Q+="editableCssRules=.*;"),aa=[J.insertVertex(null,null,"",l,q,x,A,Q+"image="+c+";")]);else if(/(\.*<graphml )/.test(c))Y=!0,this.importGraphML(c,ja);else if(null!=Q&&null!=E&&EditorUi.isVisioFilename(E))Y=
-!0,this.importVisio(Q,ja);else if(this.isGliffyData(c,E)){Y=!0;var ka=mxUtils.bind(this,function(Da){this.importGliffy(Da,ja,mxUtils.bind(this,function(ha){null!=K&&(K(null),this.showError(mxResources.get("error"),null!=ha&&413==ha.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")))}),E)});if(null!=c)ka(c);else{var ua=new FileReader;ua.onload=function(){ka(ua.result)};ua.readAsText(Q)}}else 0==c.indexOf("PK")&&null!=Q?(Y=!0,this.importZipFile(Q,ja,mxUtils.bind(this,function(){aa=
-this.insertTextAt(this.validateFileData(c),l,q,!0,null,V);K(aa)}))):/(\.v(sd|dx))($|\?)/i.test(E)||/(\.vs(s|x))($|\?)/i.test(E)||(aa=this.insertTextAt(this.validateFileData(c),l,q,!0,null,V,null,null!=ia?mxEvent.isControlDown(ia):null));Y||null==K||K(aa);return aa};EditorUi.prototype.importFiles=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){q=null!=q?q:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var aa=null!=f&&null!=l,ja=!0;f=null!=f?f:0;l=null!=l?l:0;var ka=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ua=
-J||this.resampleThreshold,Da=0;Da<c.length;Da++)if("image/svg"!==c[Da].type.substring(0,9)&&"image/"===c[Da].type.substring(0,6)&&c[Da].size>ua){ka=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[l],"maxSize",[q],"maxBytes",[V],"resampleThreshold",[this.resampleThreshold],"largeImages",[ka],"crop",[aa],"resizeImages",[ja],"ignoreEmbeddedXml",[ia],"evt",[Y]);var ha=mxUtils.bind(this,function(){var k=this.editor.graph,u=k.gridSize;x=null!=x?x:mxUtils.bind(this,function(ea,
-oa,la,ca,sa,xa,qa,Ba,ma){try{if(null!=ea&&"<mxlibrary"==ea.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ea,qa)),this.showSidebar(),null;this.isCompatibleString(ea)&&1==c.length&&null!=Y&&"drop"==Y.type&&this.isBlankFile()&&!this.canUndo()&&(aa=!1,ca=la=0);return this.importFile(ea,oa,la,ca,sa,xa,qa,Ba,ma,aa,ia,Y)}catch(ta){return this.handleError(ta),null}});A=null!=A?A:mxUtils.bind(this,function(ea){k.setSelectionCells(ea)});if(this.spinner.spin(document.body,
-mxResources.get("loading")))for(var H=this.currentPage,P=c.length,T=P,W=[],fa=mxUtils.bind(this,function(ea,oa){W[ea]=oa;if(0==--T){this.spinner.stop();if(null!=K)K(W);else{var la=[];k.getModel().beginUpdate();try{for(ea=0;ea<W.length;ea++){var ca=W[ea]();null!=ca&&(la=la.concat(ca))}}finally{k.getModel().endUpdate()}}H!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);A(la)}}),X=0;X<P;X++)mxUtils.bind(this,function(ea){var oa=c[ea];if(null!=
-oa){var la=new FileReader;la.onload=mxUtils.bind(this,function(ca){if(null==E||E(oa))try{if("image/"==oa.type.substring(0,6))if("image/svg"==oa.type.substring(0,9)){var sa=Graph.clipSvgDataUri(ca.target.result),xa=sa.indexOf(","),qa=decodeURIComponent(escape(atob(sa.substring(xa+1)))),Ba=mxUtils.parseXml(qa),ma=Ba.getElementsByTagName("svg");if(0<ma.length){var ta=ma[0],va=ia?null:ta.getAttribute("content");null!=va&&"<"!=va.charAt(0)&&"%"!=va.charAt(0)&&(va=unescape(window.atob?atob(va):Base64.decode(va,
+!0,this.importVisio(Q,ja);else if(this.isGliffyData(c,E)){Y=!0;var la=mxUtils.bind(this,function(Da){this.importGliffy(Da,ja,mxUtils.bind(this,function(ha){null!=K&&(K(null),this.showError(mxResources.get("error"),null!=ha&&413==ha.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")))}),E)});if(null!=c)la(c);else{var ua=new FileReader;ua.onload=function(){la(ua.result)};ua.readAsText(Q)}}else 0==c.indexOf("PK")&&null!=Q?(Y=!0,this.importZipFile(Q,ja,mxUtils.bind(this,function(){aa=
+this.insertTextAt(this.validateFileData(c),l,q,!0,null,V);K(aa)}))):/(\.v(sd|dx))($|\?)/i.test(E)||/(\.vs(s|x))($|\?)/i.test(E)||(aa=this.insertTextAt(this.validateFileData(c),l,q,!0,null,V,null,null!=ia?mxEvent.isControlDown(ia):null));Y||null==K||K(aa);return aa};EditorUi.prototype.importFiles=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){q=null!=q?q:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var aa=null!=f&&null!=l,ja=!0;f=null!=f?f:0;l=null!=l?l:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ua=
+J||this.resampleThreshold,Da=0;Da<c.length;Da++)if("image/svg"!==c[Da].type.substring(0,9)&&"image/"===c[Da].type.substring(0,6)&&c[Da].size>ua){la=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[l],"maxSize",[q],"maxBytes",[V],"resampleThreshold",[this.resampleThreshold],"largeImages",[la],"crop",[aa],"resizeImages",[ja],"ignoreEmbeddedXml",[ia],"evt",[Y]);var ha=mxUtils.bind(this,function(){var k=this.editor.graph,u=k.gridSize;x=null!=x?x:mxUtils.bind(this,function(ea,
+oa,ka,ba,sa,xa,qa,Ba,ma){try{if(null!=ea&&"<mxlibrary"==ea.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ea,qa)),this.showSidebar(),null;this.isCompatibleString(ea)&&1==c.length&&null!=Y&&"drop"==Y.type&&this.isBlankFile()&&!this.canUndo()&&(aa=!1,ba=ka=0);return this.importFile(ea,oa,ka,ba,sa,xa,qa,Ba,ma,aa,ia,Y)}catch(ta){return this.handleError(ta),null}});A=null!=A?A:mxUtils.bind(this,function(ea){k.setSelectionCells(ea)});if(this.spinner.spin(document.body,
+mxResources.get("loading")))for(var H=this.currentPage,P=c.length,U=P,W=[],fa=mxUtils.bind(this,function(ea,oa){W[ea]=oa;if(0==--U){this.spinner.stop();if(null!=K)K(W);else{var ka=[];k.getModel().beginUpdate();try{for(ea=0;ea<W.length;ea++){var ba=W[ea]();null!=ba&&(ka=ka.concat(ba))}}finally{k.getModel().endUpdate()}}H!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);A(ka)}}),X=0;X<P;X++)mxUtils.bind(this,function(ea){var oa=c[ea];if(null!=
+oa){var ka=new FileReader;ka.onload=mxUtils.bind(this,function(ba){if(null==E||E(oa))try{if("image/"==oa.type.substring(0,6))if("image/svg"==oa.type.substring(0,9)){var sa=Graph.clipSvgDataUri(ba.target.result),xa=sa.indexOf(","),qa=decodeURIComponent(escape(atob(sa.substring(xa+1)))),Ba=mxUtils.parseXml(qa),ma=Ba.getElementsByTagName("svg");if(0<ma.length){var ta=ma[0],va=ia?null:ta.getAttribute("content");null!=va&&"<"!=va.charAt(0)&&"%"!=va.charAt(0)&&(va=unescape(window.atob?atob(va):Base64.decode(va,
!0)));null!=va&&"%"==va.charAt(0)&&(va=decodeURIComponent(va));null==va||"<mxfile "!==va.substring(0,8)&&"<mxGraphModel>"!==va.substring(0,14)&&"<mxGraphModel "!==va.substring(0,14)?fa(ea,mxUtils.bind(this,function(){try{if(null!=Ba){var Ia=Ba.getElementsByTagName("svg");if(0<Ia.length){var Ca=Ia[0],Pa=Ca.getAttribute("width"),Ka=Ca.getAttribute("height");Pa=null!=Pa&&"%"!=Pa.charAt(Pa.length-1)?parseFloat(Pa):NaN;Ka=null!=Ka&&"%"!=Ka.charAt(Ka.length-1)?parseFloat(Ka):NaN;var Na=Ca.getAttribute("viewBox");
if(null==Na||0==Na.length)Ca.setAttribute("viewBox","0 0 "+Pa+" "+Ka);else if(isNaN(Pa)||isNaN(Ka)){var Oa=Na.split(" ");3<Oa.length&&(Pa=parseFloat(Oa[2]),Ka=parseFloat(Oa[3]))}sa=Editor.createSvgDataUri(mxUtils.getXml(Ca));var Ea=Math.min(1,Math.min(q/Math.max(1,Pa)),q/Math.max(1,Ka)),Aa=x(sa,oa.type,f+ea*u,l+ea*u,Math.max(1,Math.round(Pa*Ea)),Math.max(1,Math.round(Ka*Ea)),oa.name);if(null!=Aa&&(isNaN(Pa)||isNaN(Ka))){var Ja=new Image;Ja.onload=mxUtils.bind(this,function(){Pa=Math.max(1,Ja.width);
-Ka=Math.max(1,Ja.height);Aa[0].geometry.width=Pa;Aa[0].geometry.height=Ka;Ca.setAttribute("viewBox","0 0 "+Pa+" "+Ka);sa=Editor.createSvgDataUri(mxUtils.getXml(Ca));var Ga=sa.indexOf(";");0<Ga&&(sa=sa.substring(0,Ga)+sa.substring(sa.indexOf(",",Ga+1)));k.setCellStyles("image",sa,[Aa[0]])});Ja.src=Editor.createSvgDataUri(mxUtils.getXml(Ca))}return Aa}}}catch(Ga){}return null})):fa(ea,mxUtils.bind(this,function(){return x(va,"text/xml",f+ea*u,l+ea*u,0,0,oa.name)}))}else fa(ea,mxUtils.bind(this,function(){return null}))}else{xa=
-!1;if("image/png"==oa.type){var Ha=ia?null:this.extractGraphModelFromPng(ca.target.result);if(null!=Ha&&0<Ha.length){var La=new Image;La.src=ca.target.result;fa(ea,mxUtils.bind(this,function(){return x(Ha,"text/xml",f+ea*u,l+ea*u,La.width,La.height,oa.name)}));xa=!0}}xa||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,
-function(){this.actions.get("import").funct()}))):this.loadImage(ca.target.result,mxUtils.bind(this,function(Ia){this.resizeImage(Ia,Editor.stripImageMetadata(ca.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(Ca,Pa,Ka){fa(ea,mxUtils.bind(this,function(){if(null!=Ca&&Ca.length<V){var Na=ja&&this.isResampleImageSize(oa.size,J)?Math.min(1,Math.min(q/Pa,q/Ka)):1;return x(Ca,oa.type,f+ea*u,l+ea*u,Math.round(Pa*Na),Math.round(Ka*Na),oa.name)}this.handleError({message:mxResources.get("imageTooBig")});
-return null}))}),ja,q,J,oa.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else sa=ca.target.result,x(sa,oa.type,f+ea*u,l+ea*u,240,160,oa.name,function(Ia){fa(ea,function(){return Ia})},oa)}catch(Ia){fa(ea,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ia,oa)}else fa(ea,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(oa.name)?x(null,oa.type,f+ea*u,l+ea*u,240,160,oa.name,function(ca){fa(ea,
-function(){return ca})},oa):"image"==oa.type.substring(0,5)||"application/pdf"==oa.type?la.readAsDataURL(oa):la.readAsText(oa)}})(X)});if(ka){ka=[];for(Da=0;Da<c.length;Da++)ka.push(c[Da]);c=ka;this.confirmImageResize(function(k){ja=k;ha()},Q)}else ha()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;
+Ka=Math.max(1,Ja.height);Aa[0].geometry.width=Pa;Aa[0].geometry.height=Ka;Ca.setAttribute("viewBox","0 0 "+Pa+" "+Ka);sa=Editor.createSvgDataUri(mxUtils.getXml(Ca));var Ha=sa.indexOf(";");0<Ha&&(sa=sa.substring(0,Ha)+sa.substring(sa.indexOf(",",Ha+1)));k.setCellStyles("image",sa,[Aa[0]])});Ja.src=Editor.createSvgDataUri(mxUtils.getXml(Ca))}return Aa}}}catch(Ha){}return null})):fa(ea,mxUtils.bind(this,function(){return x(va,"text/xml",f+ea*u,l+ea*u,0,0,oa.name)}))}else fa(ea,mxUtils.bind(this,function(){return null}))}else{xa=
+!1;if("image/png"==oa.type){var Ga=ia?null:this.extractGraphModelFromPng(ba.target.result);if(null!=Ga&&0<Ga.length){var La=new Image;La.src=ba.target.result;fa(ea,mxUtils.bind(this,function(){return x(Ga,"text/xml",f+ea*u,l+ea*u,La.width,La.height,oa.name)}));xa=!0}}xa||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,
+function(){this.actions.get("import").funct()}))):this.loadImage(ba.target.result,mxUtils.bind(this,function(Ia){this.resizeImage(Ia,Editor.stripImageMetadata(ba.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(Ca,Pa,Ka){fa(ea,mxUtils.bind(this,function(){if(null!=Ca&&Ca.length<V){var Na=ja&&this.isResampleImageSize(oa.size,J)?Math.min(1,Math.min(q/Pa,q/Ka)):1;return x(Ca,oa.type,f+ea*u,l+ea*u,Math.round(Pa*Na),Math.round(Ka*Na),oa.name)}this.handleError({message:mxResources.get("imageTooBig")});
+return null}))}),ja,q,J,oa.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else sa=ba.target.result,x(sa,oa.type,f+ea*u,l+ea*u,240,160,oa.name,function(Ia){fa(ea,function(){return Ia})},oa)}catch(Ia){fa(ea,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ia,oa)}else fa(ea,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(oa.name)?x(null,oa.type,f+ea*u,l+ea*u,240,160,oa.name,function(ba){fa(ea,
+function(){return ba})},oa):"image"==oa.type.substring(0,5)||"application/pdf"==oa.type?ka.readAsDataURL(oa):ka.readAsText(oa)}})(X)});if(la){la=[];for(Da=0;Da<c.length;Da++)la.push(c[Da]);c=la;this.confirmImageResize(function(k){ja=k;ha()},Q)}else ha()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;
var l=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},q=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,x=function(A,E){if(A||f)mxSettings.setResizeImages(A?E:null),mxSettings.save();l();c(E)};null==q||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(A){x(A,!0)},function(A){x(A,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+
Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):x(!1,q)};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,l,q,x,A,E){x=null!=x?x:this.maxImageSize;var K=Math.max(1,c.width),Q=Math.max(1,c.height),V=f;if(q&&this.isResampleImageSize(null!=E?E:f.length,A))try{var J=Math.max(K/x,Q/x);if(1<J){var ia=Math.round(K/J),Y=Math.round(Q/
-J),aa=document.createElement("canvas");aa.width=ia;aa.height=Y;aa.getContext("2d").drawImage(c,0,0,ia,Y);var ja=aa.toDataURL();if(ja.length<f.length){var ka=document.createElement("canvas");ka.width=ia;ka.height=Y;var ua=ka.toDataURL();ja!==ua&&(f=ja,K=ia,Q=Y)}}}catch(Da){}q&&V!=f&&x>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,q,x/1.5,A,E):l(f,K,Q)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=
+J),aa=document.createElement("canvas");aa.width=ia;aa.height=Y;aa.getContext("2d").drawImage(c,0,0,ia,Y);var ja=aa.toDataURL();if(ja.length<f.length){var la=document.createElement("canvas");la.width=ia;la.height=Y;var ua=la.toDataURL();ja!==ua&&(f=ja,K=ia,Q=Y)}}}catch(Da){}q&&V!=f&&x>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,q,x/1.5,A,E):l(f,K,Q)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=
function(c,f,l){try{var q=new Image;q.onload=function(){q.width=0<q.width?q.width:120;q.height=0<q.height?q.height:120;f(q)};null!=l&&(q.onerror=l);q.src=c}catch(x){if(null!=l)l(x);else throw x;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var t=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){if(Editor.isSettingsEnabled()){null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=
mxSettings.settings.sidebarTitles);this.formatWidth=mxSettings.getFormatWidth();var c=mxSettings.getSidebarWidth();null!=c&&(this.hsplitPosition=parseInt(c))}this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);t.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var n=EditorUi.prototype.init;EditorUi.prototype.init=
-function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(ca,sa){sa.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));
-this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var l=null,q=function(){var ca=f.getModel().getRoot();if(ca===l&&null!=c.chromelessAnimationPlayer)return!0;l=ca;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};q();this.editor.addListener("fileLoaded",q);f.addListener(mxEvent.ROOT,q)}var x=f.isEnabled;f.isEnabled=function(){return x.apply(this,
-arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];f.showNoteIcons=Editor.showNoteIcons&&"0"!=urlParams["note-icons"];var A=this;f.editTooltip=function(ca){null!=ca&&A.actions.get("editTooltip").funct()};f.editNote=function(ca){null!=ca&&A.actions.get("editNote").funct()};f.getLinkOverlayTooltip=function(ca){if(Graph.isPageLink(ca)&&null!=A.pages){var sa=ca.substring(ca.indexOf(",")+
-1);sa=A.getPageById(sa);if(null!=sa)return sa.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(A.pages,sa)+1])}else if(this.isCustomLink(ca))return this.getLinkTitle(ca);return ca};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(ca){var sa=ca.getEvent();return null==ca.getState()&&!mxEvent.isMouseEvent(sa)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(sa)&&(null==ca.getState()||mxEvent.isControlDown(sa)||mxEvent.isShiftDown(sa))});var E=function(ca){ca=/(?:^|;)groupPadding=([^;]*)/.exec(null!=
-ca?ca:"");return null!=ca?ca[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(ca,sa){ca=sa.getProperty("edit");if(null!=ca&&null!=ca.changes){sa=ca.changes.length;for(var xa=[],qa=0;qa<sa;qa++){var Ba=ca.changes[qa];Ba instanceof mxStyleChange&&null!=Ba.cell&&f.model.isVertex(Ba.cell)&&E(Ba.style)!=E(Ba.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=Ba.style?Ba.style:"")&&(null!=f.getAttributeForCell(Ba.cell,"mermaidData")||null!=f.getAttributeForCell(Ba.cell,"plantUmlData"))&&0>mxUtils.indexOf(xa,
-Ba.cell)&&xa.push(Ba.cell)}for(qa=0;qa<xa.length;qa++)c.refreshMermaidImage(xa[qa])}});var K=function(ca){var sa=!1;c.showDialog(ca.container,640,420,!0,!0,function(xa,qa){if(!sa&&ca.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){sa=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);ca.init()};f.cellEditor.editPlantUmlData=function(ca,sa,xa){var qa=JSON.parse(xa);sa=f.getCurrentCellStyle(ca);
+function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(ba,sa){sa.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));
+this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var l=null,q=function(){var ba=f.getModel().getRoot();if(ba===l&&null!=c.chromelessAnimationPlayer)return!0;l=ba;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};q();this.editor.addListener("fileLoaded",q);f.addListener(mxEvent.ROOT,q)}var x=f.isEnabled;f.isEnabled=function(){return x.apply(this,
+arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];f.showNoteIcons=Editor.showNoteIcons&&"0"!=urlParams["note-icons"];var A=this;f.editTooltip=function(ba){null!=ba&&A.actions.get("editTooltip").funct()};f.editNote=function(ba){null!=ba&&A.actions.get("editNote").funct()};f.getLinkOverlayTooltip=function(ba){if(Graph.isPageLink(ba)&&null!=A.pages){var sa=ba.substring(ba.indexOf(",")+
+1);sa=A.getPageById(sa);if(null!=sa)return sa.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(A.pages,sa)+1])}else if(this.isCustomLink(ba))return this.getLinkTitle(ba);return ba};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(ba){var sa=ba.getEvent();return null==ba.getState()&&!mxEvent.isMouseEvent(sa)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(sa)&&(null==ba.getState()||mxEvent.isControlDown(sa)||mxEvent.isShiftDown(sa))});var E=function(ba){ba=/(?:^|;)groupPadding=([^;]*)/.exec(null!=
+ba?ba:"");return null!=ba?ba[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(ba,sa){ba=sa.getProperty("edit");if(null!=ba&&null!=ba.changes){sa=ba.changes.length;for(var xa=[],qa=0;qa<sa;qa++){var Ba=ba.changes[qa];Ba instanceof mxStyleChange&&null!=Ba.cell&&f.model.isVertex(Ba.cell)&&E(Ba.style)!=E(Ba.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=Ba.style?Ba.style:"")&&(null!=f.getAttributeForCell(Ba.cell,"mermaidData")||null!=f.getAttributeForCell(Ba.cell,"plantUmlData"))&&0>mxUtils.indexOf(xa,
+Ba.cell)&&xa.push(Ba.cell)}for(qa=0;qa<xa.length;qa++)c.refreshMermaidImage(xa[qa])}});var K=function(ba){var sa=!1;c.showDialog(ba.container,640,420,!0,!0,function(xa,qa){if(!sa&&ba.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){sa=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);ba.init()};f.cellEditor.editPlantUmlData=function(ba,sa,xa){var qa=JSON.parse(xa);sa=f.getCurrentCellStyle(ba);
var Ba=mxUtils.getValue(sa,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,ma=null==qa.format&&!Ba;sa="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var ta=document.createElement("select");ta.className="geBtn";xa=document.createElement("option");xa.setAttribute("value","plantUmlDiagram");mxUtils.write(xa,mxResources.get("diagram"));ta.appendChild(xa);xa=document.createElement("option");xa.setAttribute("value","plantUmlImage");mxUtils.write(xa,mxResources.get("image"));ta.appendChild(xa);
-ta.value=Ba?"plantUmlImage":"plantUmlDiagram";var va=new SimpleTextareaDialog(c,qa.data,function(Ha){if(null!=Ha&&c.spinner.spin(document.body,mxResources.get("inserting"))){var La="plantUmlImage"==ta.value,Ia=ma?qa.config:null;c.parsePlantUmlDiagram(Ha,Ia,function(Ca,Pa){c.spinner.stop();va.hide();try{f.getModel().beginUpdate();try{if(Ba&&La)c.updateMermaidImage(ca,Ha,null,Ca,c.getMermaidImageBorder(ca,qa.border),"plantUmlData");else if(ma&&!La)c.replaceLockedGroupChildren(ca,Ca,Ha,Ia,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,
-dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var Ka=c.getMermaidImageBorder(ca,qa.border),Na=c.replaceMermaidCell(ca,La?c.createMermaidImageXml(Ha,null,Ca,null,Ka,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(Ca,Ha,Ia));La||null==Ka||f.setCellStyles("groupPadding",Ka,Na)}}finally{f.getModel().endUpdate()}c.showPlantUmlWarnings(Pa)}catch(Oa){c.handleError(Oa)}},function(Ca){c.spinner.stop();c.handleError(Ca)})}},null,null,sa?ta:null,!0,null==c.sidebar?null:function(Ha,La){c.spinner.spin(document.body,
-mxResources.get("loading"))&&c.parsePlantUmlDiagram(Ha,ma?qa.config:null,function(Ia,Ca){c.spinner.stop();c.showPreviewTooltip(Ia,La);c.showPlantUmlWarnings(Ca)},function(Ia){c.spinner.stop();c.handleError(Ia)})});K(va)};f.cellEditor.editMermaidData=function(ca,sa,xa){var qa=JSON.parse(xa);sa=f.getCurrentCellStyle(ca);var Ba=mxUtils.getValue(sa,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,ma=Ba&&null==qa.config;sa="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var ta=document.createElement("select");
-ta.className="geBtn";xa=document.createElement("option");xa.setAttribute("value","mermaid");mxUtils.write(xa,mxResources.get("diagram"));ta.appendChild(xa);xa=document.createElement("option");xa.setAttribute("value","mermaidImage");mxUtils.write(xa,mxResources.get("image"));ta.appendChild(xa);ta.value=Ba?"mermaidImage":"mermaid";var va=new SimpleTextareaDialog(c,qa.data,function(Ha){if(null!=Ha&&c.spinner.spin(document.body,mxResources.get("inserting"))){var La="mermaidImage"==ta.value;if(La&&ma){var Ia=
-EditorUi.legacyMermaidConfig;var Ca=null}else Ca=Ia=null!=qa.config?qa.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(Ha,mxUtils.clone(Ia),function(Pa){c.spinner.stop();va.hide();try{f.getModel().beginUpdate();try{if(Ba&&La)c.updateMermaidImage(ca,Ha,Ca,Pa,c.getMermaidImageBorder(ca,qa.border));else if(Ba||La){var Ka=c.getMermaidImageBorder(ca,qa.border),Na=c.replaceMermaidCell(ca,La?c.createMermaidImageXml(Ha,Ca,Pa,null,Ka):mxMermaidToDrawio.wrapGroup(Pa,Ha,Ca));La||null==Ka||f.setCellStyles("groupPadding",
-Ka,Na)}else c.replaceLockedGroupChildren(ca,Pa,Ha,Ca)}finally{f.getModel().endUpdate()}}catch(Oa){c.handleError(Oa)}},function(Pa){c.spinner.stop();c.handleError(Pa)})}},null,null,sa?ta:null,!0,null==c.sidebar?null:function(Ha,La){if(c.spinner.spin(document.body,mxResources.get("loading"))){var Ia="mermaidImage"==ta.value&&ma?EditorUi.legacyMermaidConfig:null!=qa.config?qa.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(Ha,mxUtils.clone(Ia),function(Ca){c.spinner.stop();c.showPreviewTooltip(Ca,
-La)},function(Ca){c.spinner.stop();c.handleError(Ca)})}});K(va)};var Q=f.cellEditor.startEditing;f.cellEditor.startEditing=function(ca,sa,xa){try{var qa=this.graph.getLockedGroupAncestor(ca);null!=qa&&(ca=qa);var Ba=this.graph.getAttributeForCell(ca,"plantUmlData");if(null!=Ba)this.editPlantUmlData(ca,sa,Ba);else if(Ba=this.graph.getAttributeForCell(ca,"mermaidData"),null!=Ba&&EditorUi.isMermaidSupported())this.editMermaidData(ca,sa,Ba);else{var ma=f.getCellStyle(ca);"1"==mxUtils.getValue(ma,"metaEdit",
-"0")?c.showDataDialog(ca):Q.call(this,ca,sa,xa)}}catch(ta){c.handleError(ta)}};f.getLinkTitle=function(ca){return c.getLinkTitle(ca)};f.customLinkClicked=function(ca,sa){var xa=!1;try{var qa=this.view.graphBounds,Ba=null!=qa?new mxRectangle(qa.x,qa.y,qa.width,qa.height):null;c.handleCustomLink(ca,sa);xa=!0;var ma=this.view.graphBounds;c.chromelessResize&&null!=Ba&&null!=ma&&!Ba.equals(ma)&&(c.chromelessResize(),this.scrollCellToVisible(sa))}catch(ta){c.handleError(ta)}return xa};var V=f.parseBackgroundImage;
-f.parseBackgroundImage=function(ca){var sa=V.apply(this,arguments);null!=sa&&null!=sa.src&&Graph.isPageLink(sa.src)&&(sa={originalSrc:sa.src});return sa};var J=f.setBackgroundImage;f.setBackgroundImage=function(ca){null!=ca&&null!=ca.originalSrc&&(ca=c.createImageForPageLink(ca.originalSrc,c.currentPage,this));J.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));
-this.editor.addListener("pagesPatched",mxUtils.bind(this,function(ca,sa){ca=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=ca){var xa=ca.indexOf(",");if(0<xa)for(ca=ca.substring(xa+1),sa=sa.getProperty("patches"),xa=0;xa<sa.length;xa++)if(null!=sa[xa][EditorUi.DIFF_UPDATE]&&null!=sa[xa][EditorUi.DIFF_UPDATE][ca]||null!=sa[xa][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(sa[xa][EditorUi.DIFF_REMOVE],ca)){f.refreshBackgroundImage();break}}}));var ia=f.getBackgroundImageObject;f.getBackgroundImageObject=
-function(ca,sa,xa){var qa=ia.apply(this,arguments);null!=qa&&null!=qa.originalSrc&&(qa=sa?c.createImageForPageLink(qa.originalSrc,xa,null,!0):{src:qa.originalSrc});return qa};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var Y=
-c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(ca){ca=null!=ca?ca:"";"1"==urlParams.dev&&(ca+=(0<ca.length?"&":"?")+"dev=1");"1"==urlParams.test&&(ca+=(0<ca.length?"&":"?")+"test=1");return Y.apply(this,arguments)};var aa=f.addClickHandler;f.addClickHandler=function(ca,sa,xa){var qa=sa;sa=function(Ba,ma,ta){if(null==ma){var va=mxEvent.getSource(Ba);"a"==va.nodeName.toLowerCase()&&(ma=va.getAttribute("href"))}null!=ma&&f.isCustomLink(ma)&&(mxEvent.isTouchEvent(Ba)||!mxEvent.isPopupTrigger(Ba))&&
-f.customLinkClicked(ma,ta)&&mxEvent.consume(Ba);null!=qa&&qa(Ba,ma,ta)};aa.call(this,ca,sa,xa)};n.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var ja=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(ca,sa,xa){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(ca,["zoomIn","zoomOut","-"],null,xa);if(Editor.passiveScroll&&null!=xa){var qa=
-mxUtils.convertPoint(f.container,mxEvent.getClientX(xa),mxEvent.getClientY(xa));f._contextMenuPoint=new mxPoint(f.snap(qa.x/f.view.scale-f.view.translate.x),f.snap(qa.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(xa),mxEvent.getClientY(xa))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",ca,null),ca.addSeparator());ja.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||
-this.addMenuItems(ca,["-","addToScratchpad"],null,xa);if(0<f.getSelectionCount()&&c.commentsSupported()&&c.anchoredCommentsSupported()&&c.canComment()&&null!=this.showCommentsWindow){var Ba=f.getSelectionCells(),ma=this;ca.addSeparator();ca.addItem(mxResources.get("comment")+"...",null,function(){if(null!=c.currentPage){if(1==Ba.length)var ta=Ba[0].id;else{ta=[];for(var va=0;va<Ba.length;va++)ta.push(Ba[va].id)}ma.showCommentsWindow(null,{p:c.currentPage.getId(),c:ta})}})}f.isSelectionEmpty()&&!this.isShowStyleItems()&&
-this.addMenuItems(ca,["-","exitGroup","home"],null,xa)};var ka=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(ca,sa,xa){if(c.editor.graph.isSelectionEmpty())ka.apply(this,arguments),c.menus.addMenuItems(ca,["copyAsImage","copyAsSvg"],null,xa);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(ca,sa,xa):this.addPopupMenuArrangeItems(ca,sa,xa),this.addMenuItems(ca,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,xa),Editor.passiveScroll&&(1==f.getSelectionCount()?
-this.addMenuItems(ca,["-","copyStyle","pasteStyle","copyTextStyle","pasteTextStyle"],null,xa):this.addMenuItems(ca,["-","pasteStyle","pasteTextStyle"],null,xa)),this.addMenuItems(ca,["-"],null,xa),this.isShowCellEditItems()||this.addPopupDeleteItem(ca,sa,xa),this.addMenuItems(ca,["lockUnlock","-"],null,xa),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(sa)&&f.isCellEditable(sa)&&(this.addSubmenu("editCell",ca,null,mxResources.get("edit")),ca.addSeparator(),f.getModel().isEdge(sa))){this.addSubmenu("line",
-ca);var qa=f.getModel().getGeometry(sa);null!=qa&&null!=qa.points&&0<qa.points.length&&this.addMenuItems(ca,["clearWaypoints"],null,xa)}1==f.getSelectionCount()&&this.addMenuItems(ca,["enterGroup"],null,xa);qa=c.getSelectionState();null!=qa.mergeCell?this.addMenuItem(ca,"mergeCells"):(1<qa.style.colspan||1<qa.style.rowspan)&&this.addMenuItem(ca,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=
+ta.value=Ba?"plantUmlImage":"plantUmlDiagram";var va=new SimpleTextareaDialog(c,qa.data,function(Ga){if(null!=Ga&&c.spinner.spin(document.body,mxResources.get("inserting"))){var La="plantUmlImage"==ta.value,Ia=ma?qa.config:null;c.parsePlantUmlDiagram(Ga,Ia,function(Ca,Pa){c.spinner.stop();va.hide();try{f.getModel().beginUpdate();try{if(Ba&&La)c.updateMermaidImage(ba,Ga,null,Ca,c.getMermaidImageBorder(ba,qa.border),"plantUmlData");else if(ma&&!La)c.replaceLockedGroupChildren(ba,Ca,Ga,Ia,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,
+dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var Ka=c.getMermaidImageBorder(ba,qa.border),Na=c.replaceMermaidCell(ba,La?c.createMermaidImageXml(Ga,null,Ca,null,Ka,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(Ca,Ga,Ia));La||null==Ka||f.setCellStyles("groupPadding",Ka,Na)}}finally{f.getModel().endUpdate()}c.showPlantUmlWarnings(Pa)}catch(Oa){c.handleError(Oa)}},function(Ca){c.spinner.stop();c.handleError(Ca)})}},null,null,sa?ta:null,!0,null==c.sidebar?null:function(Ga,La){c.spinner.spin(document.body,
+mxResources.get("loading"))&&c.parsePlantUmlDiagram(Ga,ma?qa.config:null,function(Ia,Ca){c.spinner.stop();c.showPreviewTooltip(Ia,La);c.showPlantUmlWarnings(Ca)},function(Ia){c.spinner.stop();c.handleError(Ia)})});K(va)};f.cellEditor.editMermaidData=function(ba,sa,xa){var qa=JSON.parse(xa);sa=f.getCurrentCellStyle(ba);var Ba=mxUtils.getValue(sa,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,ma=Ba&&null==qa.config;sa="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var ta=document.createElement("select");
+ta.className="geBtn";xa=document.createElement("option");xa.setAttribute("value","mermaid");mxUtils.write(xa,mxResources.get("diagram"));ta.appendChild(xa);xa=document.createElement("option");xa.setAttribute("value","mermaidImage");mxUtils.write(xa,mxResources.get("image"));ta.appendChild(xa);ta.value=Ba?"mermaidImage":"mermaid";var va=new SimpleTextareaDialog(c,qa.data,function(Ga){if(null!=Ga&&c.spinner.spin(document.body,mxResources.get("inserting"))){var La="mermaidImage"==ta.value;if(La&&ma){var Ia=
+EditorUi.legacyMermaidConfig;var Ca=null}else Ca=Ia=null!=qa.config?qa.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(Ga,mxUtils.clone(Ia),function(Pa){c.spinner.stop();va.hide();try{f.getModel().beginUpdate();try{if(Ba&&La)c.updateMermaidImage(ba,Ga,Ca,Pa,c.getMermaidImageBorder(ba,qa.border));else if(Ba||La){var Ka=c.getMermaidImageBorder(ba,qa.border),Na=c.replaceMermaidCell(ba,La?c.createMermaidImageXml(Ga,Ca,Pa,null,Ka):mxMermaidToDrawio.wrapGroup(Pa,Ga,Ca));La||null==Ka||f.setCellStyles("groupPadding",
+Ka,Na)}else c.replaceLockedGroupChildren(ba,Pa,Ga,Ca)}finally{f.getModel().endUpdate()}}catch(Oa){c.handleError(Oa)}},function(Pa){c.spinner.stop();c.handleError(Pa)})}},null,null,sa?ta:null,!0,null==c.sidebar?null:function(Ga,La){if(c.spinner.spin(document.body,mxResources.get("loading"))){var Ia="mermaidImage"==ta.value&&ma?EditorUi.legacyMermaidConfig:null!=qa.config?qa.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(Ga,mxUtils.clone(Ia),function(Ca){c.spinner.stop();c.showPreviewTooltip(Ca,
+La)},function(Ca){c.spinner.stop();c.handleError(Ca)})}});K(va)};var Q=f.cellEditor.startEditing;f.cellEditor.startEditing=function(ba,sa,xa){try{var qa=this.graph.getLockedGroupAncestor(ba);null!=qa&&(ba=qa);var Ba=this.graph.getAttributeForCell(ba,"plantUmlData");if(null!=Ba)this.editPlantUmlData(ba,sa,Ba);else if(Ba=this.graph.getAttributeForCell(ba,"mermaidData"),null!=Ba&&EditorUi.isMermaidSupported())this.editMermaidData(ba,sa,Ba);else{var ma=f.getCellStyle(ba);"1"==mxUtils.getValue(ma,"metaEdit",
+"0")?c.showDataDialog(ba):Q.call(this,ba,sa,xa)}}catch(ta){c.handleError(ta)}};f.getLinkTitle=function(ba){return c.getLinkTitle(ba)};f.customLinkClicked=function(ba,sa){var xa=!1;try{var qa=this.view.graphBounds,Ba=null!=qa?new mxRectangle(qa.x,qa.y,qa.width,qa.height):null;c.handleCustomLink(ba,sa);xa=!0;var ma=this.view.graphBounds;c.chromelessResize&&null!=Ba&&null!=ma&&!Ba.equals(ma)&&(c.chromelessResize(),this.scrollCellToVisible(sa))}catch(ta){c.handleError(ta)}return xa};var V=f.parseBackgroundImage;
+f.parseBackgroundImage=function(ba){var sa=V.apply(this,arguments);null!=sa&&null!=sa.src&&Graph.isPageLink(sa.src)&&(sa={originalSrc:sa.src});return sa};var J=f.setBackgroundImage;f.setBackgroundImage=function(ba){null!=ba&&null!=ba.originalSrc&&(ba=c.createImageForPageLink(ba.originalSrc,c.currentPage,this));J.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));
+this.editor.addListener("pagesPatched",mxUtils.bind(this,function(ba,sa){ba=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=ba){var xa=ba.indexOf(",");if(0<xa)for(ba=ba.substring(xa+1),sa=sa.getProperty("patches"),xa=0;xa<sa.length;xa++)if(null!=sa[xa][EditorUi.DIFF_UPDATE]&&null!=sa[xa][EditorUi.DIFF_UPDATE][ba]||null!=sa[xa][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(sa[xa][EditorUi.DIFF_REMOVE],ba)){f.refreshBackgroundImage();break}}}));var ia=f.getBackgroundImageObject;f.getBackgroundImageObject=
+function(ba,sa,xa){var qa=ia.apply(this,arguments);null!=qa&&null!=qa.originalSrc&&(qa=sa?c.createImageForPageLink(qa.originalSrc,xa,null,!0):{src:qa.originalSrc});return qa};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var Y=
+c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(ba){ba=null!=ba?ba:"";"1"==urlParams.dev&&(ba+=(0<ba.length?"&":"?")+"dev=1");"1"==urlParams.test&&(ba+=(0<ba.length?"&":"?")+"test=1");return Y.apply(this,arguments)};var aa=f.addClickHandler;f.addClickHandler=function(ba,sa,xa){var qa=sa;sa=function(Ba,ma,ta){if(null==ma){var va=mxEvent.getSource(Ba);"a"==va.nodeName.toLowerCase()&&(ma=va.getAttribute("href"))}null!=ma&&f.isCustomLink(ma)&&(mxEvent.isTouchEvent(Ba)||!mxEvent.isPopupTrigger(Ba))&&
+f.customLinkClicked(ma,ta)&&mxEvent.consume(Ba);null!=qa&&qa(Ba,ma,ta)};aa.call(this,ba,sa,xa)};n.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var ja=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(ba,sa,xa){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(ba,["zoomIn","zoomOut","-"],null,xa);if(Editor.passiveScroll&&null!=xa){var qa=
+mxUtils.convertPoint(f.container,mxEvent.getClientX(xa),mxEvent.getClientY(xa));f._contextMenuPoint=new mxPoint(f.snap(qa.x/f.view.scale-f.view.translate.x),f.snap(qa.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(xa),mxEvent.getClientY(xa))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",ba,null),ba.addSeparator());ja.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||
+this.addMenuItems(ba,["-","addToScratchpad"],null,xa);if(0<f.getSelectionCount()&&c.commentsSupported()&&c.anchoredCommentsSupported()&&c.canComment()&&null!=this.showCommentsWindow){var Ba=f.getSelectionCells(),ma=this;ba.addSeparator();ba.addItem(mxResources.get("comment")+"...",null,function(){if(null!=c.currentPage){if(1==Ba.length)var ta=Ba[0].id;else{ta=[];for(var va=0;va<Ba.length;va++)ta.push(Ba[va].id)}ma.showCommentsWindow(null,{p:c.currentPage.getId(),c:ta})}})}f.isSelectionEmpty()&&!this.isShowStyleItems()&&
+this.addMenuItems(ba,["-","exitGroup","home"],null,xa)};var la=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(ba,sa,xa){if(c.editor.graph.isSelectionEmpty())la.apply(this,arguments),c.menus.addMenuItems(ba,["copyAsImage","copyAsSvg"],null,xa);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(ba,sa,xa):this.addPopupMenuArrangeItems(ba,sa,xa),this.addMenuItems(ba,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,xa),Editor.passiveScroll&&(1==f.getSelectionCount()?
+this.addMenuItems(ba,["-","copyStyle","pasteStyle","copyTextStyle","pasteTextStyle"],null,xa):this.addMenuItems(ba,["-","pasteStyle","pasteTextStyle"],null,xa)),this.addMenuItems(ba,["-"],null,xa),this.isShowCellEditItems()||this.addPopupDeleteItem(ba,sa,xa),this.addMenuItems(ba,["lockUnlock","-"],null,xa),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(sa)&&f.isCellEditable(sa)&&(this.addSubmenu("editCell",ba,null,mxResources.get("edit")),ba.addSeparator(),f.getModel().isEdge(sa))){this.addSubmenu("line",
+ba);var qa=f.getModel().getGeometry(sa);null!=qa&&null!=qa.points&&0<qa.points.length&&this.addMenuItems(ba,["clearWaypoints"],null,xa)}1==f.getSelectionCount()&&this.addMenuItems(ba,["enterGroup"],null,xa);qa=c.getSelectionState();null!=qa.mergeCell?this.addMenuItem(ba,"mergeCells"):(1<qa.style.colspan||1<qa.style.rowspan)&&this.addMenuItem(ba,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=
function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}q=mxUtils.bind(this,function(){this.updateCommentOverlays()});this.addListener("commentsChanged",q);this.addListener("darkModeChanged",q);this.editor.addListener("pageSelected",q);this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){this.commentOverlays=null;this.refreshCommentCache()}));if(Editor.passiveScroll){var ua=f.getCenterInsertPoint;
-f.getCenterInsertPoint=function(ca){if(null!=this._contextMenuPoint){var sa=this._contextMenuPoint;ca=null!=ca?ca:new mxRectangle;return new mxPoint(f.snap(sa.x-(ca.width||0)/2),f.snap(sa.y-(ca.height||0)/2))}return ua.apply(this,arguments)};var Da=f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){Da.apply(this,arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=
-mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var ha=f.getExportVariables;f.getExportVariables=function(){var ca=ha.apply(this,arguments),sa=c.getCurrentFile();null!=sa&&(ca.filename=sa.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var xa in c.fileVars)null==ca[xa]&&(ca[xa]=c.fileVars[xa]);ca.pagecount=null!=c.pages?c.pages.length:1;ca.page=null!=c.currentPage?c.currentPage.getName():"";ca.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,
-c.currentPage)+1:1;return ca};var k=f.getGlobalVariable;f.getGlobalVariable=function(ca){var sa=c.getCurrentFile();if("filename"==ca&&null!=sa)return sa.getTitle();if("page"==ca&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==ca)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==ca)return null!=c.pages?c.pages.length:1;sa=k.apply(this,arguments);null==sa&&(c.updateFileVars(),null!=c.fileVars&&(sa=c.fileVars[ca]));return sa};var u=
-null,H=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var ca=this.getCurrentFile(),sa=null!=ca&&null!=ca.getTitle()?ca.getTitle():this.defaultFilename;u!=sa&&ca==H&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());u=sa;H=ca}));var P=f.labelLinkClicked;f.labelLinkClicked=function(ca,sa,xa){var qa=sa.getAttribute("href");if(null==qa||!f.isCustomLink(qa)||!mxEvent.isTouchEvent(xa)&&mxEvent.isPopupTrigger(xa))P.apply(this,arguments);else{if(!f.isEnabled()||
-null!=ca&&f.isCellLocked(ca.cell))f.customLinkClicked(qa),f.getRubberband().reset();mxEvent.consume(xa)}};this.editor.getOrCreateFilename=function(){var ca=c.defaultFilename,sa=c.getCurrentFile();null!=sa&&(ca=null!=sa.getTitle()?sa.getTitle():ca);return ca};q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);q.visible=q.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",
+f.getCenterInsertPoint=function(ba){if(null!=this._contextMenuPoint){var sa=this._contextMenuPoint;ba=null!=ba?ba:new mxRectangle;return new mxPoint(f.snap(sa.x-(ba.width||0)/2),f.snap(sa.y-(ba.height||0)/2))}return ua.apply(this,arguments)};var Da=f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){Da.apply(this,arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=
+mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var ha=f.getExportVariables;f.getExportVariables=function(){var ba=ha.apply(this,arguments),sa=c.getCurrentFile();null!=sa&&(ba.filename=sa.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var xa in c.fileVars)null==ba[xa]&&(ba[xa]=c.fileVars[xa]);ba.pagecount=null!=c.pages?c.pages.length:1;ba.page=null!=c.currentPage?c.currentPage.getName():"";ba.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,
+c.currentPage)+1:1;return ba};var k=f.getGlobalVariable;f.getGlobalVariable=function(ba){var sa=c.getCurrentFile();if("filename"==ba&&null!=sa)return sa.getTitle();if("page"==ba&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==ba)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==ba)return null!=c.pages?c.pages.length:1;sa=k.apply(this,arguments);null==sa&&(c.updateFileVars(),null!=c.fileVars&&(sa=c.fileVars[ba]));return sa};var u=
+null,H=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var ba=this.getCurrentFile(),sa=null!=ba&&null!=ba.getTitle()?ba.getTitle():this.defaultFilename;u!=sa&&ba==H&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());u=sa;H=ba}));var P=f.labelLinkClicked;f.labelLinkClicked=function(ba,sa,xa){var qa=sa.getAttribute("href");if(null==qa||!f.isCustomLink(qa)||!mxEvent.isTouchEvent(xa)&&mxEvent.isPopupTrigger(xa))P.apply(this,arguments);else{if(!f.isEnabled()||
+null!=ba&&f.isCellLocked(ba.cell))f.customLinkClicked(qa),f.getRubberband().reset();mxEvent.consume(xa)}};this.editor.getOrCreateFilename=function(){var ba=c.defaultFilename,sa=c.getCurrentFile();null!=sa&&(ba=null!=sa.getTitle()?sa.getTitle():ba);return ba};q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);q.visible=q.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",
!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,
-!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.ctrlAltActions[84]="runLastLayout",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(ca,sa){null!=sa&&f.isEnabled()&&!f.isEditing()&&null!=sa.getProperty("event")&&c.actions.get("exit").funct()})),
-this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(ca){var sa=f.cellEditor.text2,xa=null;null!=sa&&(mxEvent.addListener(sa,"dragleave",function(qa){null!=xa&&(xa.parentNode.removeChild(xa),xa=null);qa.stopPropagation();qa.preventDefault()}),mxEvent.addListener(sa,"dragover",mxUtils.bind(this,function(qa){null==
-xa&&(xa=this.highlightElement(sa));qa.stopPropagation();qa.preventDefault()})),mxEvent.addListener(sa,"drop",mxUtils.bind(this,function(qa){null!=xa&&(xa.parentNode.removeChild(xa),xa=null);if(0<qa.dataTransfer.files.length)this.importFiles(qa.dataTransfer.files,0,0,this.maxImageSize,function(ma,ta,va,Ha,La,Ia){f.insertImage(ma,La,Ia)},function(){},function(ma){return"image/"==ma.type.substring(0,6)},function(ma){for(var ta=0;ta<ma.length;ta++)ma[ta]()},mxEvent.isControlDown(qa));else if(0<=mxUtils.indexOf(qa.dataTransfer.types,
+!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.ctrlAltActions[84]="runLastLayout",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(ba,sa){null!=sa&&f.isEnabled()&&!f.isEditing()&&null!=sa.getProperty("event")&&c.actions.get("exit").funct()})),
+this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(ba){var sa=f.cellEditor.text2,xa=null;null!=sa&&(mxEvent.addListener(sa,"dragleave",function(qa){null!=xa&&(xa.parentNode.removeChild(xa),xa=null);qa.stopPropagation();qa.preventDefault()}),mxEvent.addListener(sa,"dragover",mxUtils.bind(this,function(qa){null==
+xa&&(xa=this.highlightElement(sa));qa.stopPropagation();qa.preventDefault()})),mxEvent.addListener(sa,"drop",mxUtils.bind(this,function(qa){null!=xa&&(xa.parentNode.removeChild(xa),xa=null);if(0<qa.dataTransfer.files.length)this.importFiles(qa.dataTransfer.files,0,0,this.maxImageSize,function(ma,ta,va,Ga,La,Ia){f.insertImage(ma,La,Ia)},function(){},function(ma){return"image/"==ma.type.substring(0,6)},function(ma){for(var ta=0;ta<ma.length;ta++)ma[ta]()},mxEvent.isControlDown(qa));else if(0<=mxUtils.indexOf(qa.dataTransfer.types,
"text/uri-list")){var Ba=qa.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ba)?this.loadImage(decodeURIComponent(Ba),mxUtils.bind(this,function(ma){var ta=Math.max(1,ma.width);ma=Math.max(1,ma.height);var va=this.maxImageSize;va=Math.min(1,Math.min(va/Math.max(1,ta)),va/Math.max(1,ma));f.insertImage(decodeURIComponent(Ba),ta*va,ma*va)})):document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(qa.dataTransfer.types,"text/html")?
-document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(qa.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/plain"));qa.stopPropagation();qa.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var T=mxSettings.getUnit();q.setUnit(T);Editor.pageSizeUnit=T;q.addListener("unitChanged",function(ca,sa){ca=sa.getProperty("unit");mxSettings.setUnit(ca);mxSettings.save();Editor.pageSizeUnit=
-ca});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,q.unit);this.refresh()}if("1"==urlParams.styledev){q=document.getElementById("geFooter");null!=q&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width=
-"98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(ca,sa){0<this.editor.graph.getSelectionCount()?(ca=this.editor.graph.getSelectionCell(),ca=this.editor.graph.getModel().getStyle(ca),
-this.styleInput.value=ca||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var W=this.isSelectionAllowed;this.isSelectionAllowed=function(ca){return mxEvent.getSource(ca)==this.styleInput?!0:W.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var fa=null;mxEvent.addListener(f.container,"dragleave",function(ca){f.isEnabled()&&(null!=fa&&(fa.parentNode.removeChild(fa),
-fa=null),ca.stopPropagation(),ca.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(ca){null==fa&&(fa=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();ca.stopPropagation();ca.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(ca){null!=fa&&(fa.parentNode.removeChild(fa),fa=null);if(f.isEnabled()){var sa=mxUtils.convertPoint(f.container,mxEvent.getClientX(ca),mxEvent.getClientY(ca)),xa=ca.dataTransfer.files,
-qa=f.view.translate,Ba=f.view.scale,ma=sa.x/Ba-qa.x,ta=sa.y/Ba-qa.y;if(0<xa.length)sa=this.isBlankFile()&&!this.canUndo(),qa=1==xa.length&&(EditorUi.isVisioFilename(xa[0].name)||/(\.drawio)$/i.test(xa[0].name)||/(\.xml)$/i.test(xa[0].name)),"1"!=urlParams.embed&&sa&&(qa||mxEvent.isShiftDown(ca))?(sa=this.getCurrentFile(),null!=sa&&sa.isModified()||this.fileLoaded(null,!0),this.openFiles(xa,!0,mxUtils.bind(this,function(){var Pa=this.getCurrentFile();null!=Pa&&Pa.fileChanged()}))):(mxEvent.isAltDown(ca)&&
-(ta=ma=null),this.importFiles(xa,ma,ta,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(ca),null,null,mxEvent.isShiftDown(ca),ca));else{mxEvent.isAltDown(ca)&&(ta=ma=0);var va=0<=mxUtils.indexOf(ca.dataTransfer.types,"text/uri-list")?ca.dataTransfer.getData("text/uri-list"):null;xa=this.extractGraphModelFromEvent(ca,null!=this.pages);if(null!=xa)f.setSelectionCells(this.importXml(xa,ma,ta,!0));else if(0<=mxUtils.indexOf(ca.dataTransfer.types,"text/html")){var Ha=ca.dataTransfer.getData("text/html");
-xa=document.createElement("div");xa.innerHTML=Graph.sanitizeHtml(Ha);var La=null;sa=xa.getElementsByTagName("img");null!=sa&&1==sa.length?(Ha=sa[0].getAttribute("src"),null==Ha&&(Ha=sa[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ha)||(La=!0)):(sa=xa.getElementsByTagName("a"),null!=sa&&1==sa.length?Ha=sa[0].getAttribute("href"):(xa=xa.getElementsByTagName("pre"),null!=xa&&1==xa.length&&(Ha=mxUtils.getTextContent(xa[0]))));var Ia=!0,Ca=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(Ha,
-ma,ta,!0,La,null,Ia,mxEvent.isControlDown(ca)))});La&&null!=Ha&&Ha.length>this.resampleThreshold?this.confirmImageResize(function(Pa){Ia=Pa;Ca()},mxEvent.isControlDown(ca)):Ca()}else null!=va&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(va)?this.loadImage(decodeURIComponent(va),mxUtils.bind(this,function(Pa){var Ka=Math.max(1,Pa.width);Pa=Math.max(1,Pa.height);var Na=this.maxImageSize;Na=Math.min(1,Math.min(Na/Math.max(1,Ka)),Na/Math.max(1,Pa));f.setSelectionCell(f.insertVertex(null,null,"",ma,ta,Ka*Na,
-Pa*Na,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+va+";"))}),mxUtils.bind(this,function(Pa){f.setSelectionCells(this.insertTextAt(va,ma,ta,!0))})):0<=mxUtils.indexOf(ca.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(ca.dataTransfer.getData("text/plain"),ma,ta,!0))}}ca.stopPropagation();ca.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",
+document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(qa.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/plain"));qa.stopPropagation();qa.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var U=mxSettings.getUnit();q.setUnit(U);Editor.pageSizeUnit=U;q.addListener("unitChanged",function(ba,sa){ba=sa.getProperty("unit");mxSettings.setUnit(ba);mxSettings.save();Editor.pageSizeUnit=
+ba});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,q.unit);this.refresh()}if("1"==urlParams.styledev){q=document.getElementById("geFooter");null!=q&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width=
+"98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(ba,sa){0<this.editor.graph.getSelectionCount()?(ba=this.editor.graph.getSelectionCell(),ba=this.editor.graph.getModel().getStyle(ba),
+this.styleInput.value=ba||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var W=this.isSelectionAllowed;this.isSelectionAllowed=function(ba){return mxEvent.getSource(ba)==this.styleInput?!0:W.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var fa=null;mxEvent.addListener(f.container,"dragleave",function(ba){f.isEnabled()&&(null!=fa&&(fa.parentNode.removeChild(fa),
+fa=null),ba.stopPropagation(),ba.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(ba){null==fa&&(fa=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();ba.stopPropagation();ba.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(ba){null!=fa&&(fa.parentNode.removeChild(fa),fa=null);if(f.isEnabled()){var sa=mxUtils.convertPoint(f.container,mxEvent.getClientX(ba),mxEvent.getClientY(ba)),xa=ba.dataTransfer.files,
+qa=f.view.translate,Ba=f.view.scale,ma=sa.x/Ba-qa.x,ta=sa.y/Ba-qa.y;if(0<xa.length)sa=this.isBlankFile()&&!this.canUndo(),qa=1==xa.length&&(EditorUi.isVisioFilename(xa[0].name)||/(\.drawio)$/i.test(xa[0].name)||/(\.xml)$/i.test(xa[0].name)),"1"!=urlParams.embed&&sa&&(qa||mxEvent.isShiftDown(ba))?(sa=this.getCurrentFile(),null!=sa&&sa.isModified()||this.fileLoaded(null,!0),this.openFiles(xa,!0,mxUtils.bind(this,function(){var Pa=this.getCurrentFile();null!=Pa&&Pa.fileChanged()}))):(mxEvent.isAltDown(ba)&&
+(ta=ma=null),this.importFiles(xa,ma,ta,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(ba),null,null,mxEvent.isShiftDown(ba),ba));else{mxEvent.isAltDown(ba)&&(ta=ma=0);var va=0<=mxUtils.indexOf(ba.dataTransfer.types,"text/uri-list")?ba.dataTransfer.getData("text/uri-list"):null;xa=this.extractGraphModelFromEvent(ba,null!=this.pages);if(null!=xa)f.setSelectionCells(this.importXml(xa,ma,ta,!0));else if(0<=mxUtils.indexOf(ba.dataTransfer.types,"text/html")){var Ga=ba.dataTransfer.getData("text/html");
+xa=document.createElement("div");xa.innerHTML=Graph.sanitizeHtml(Ga);var La=null;sa=xa.getElementsByTagName("img");null!=sa&&1==sa.length?(Ga=sa[0].getAttribute("src"),null==Ga&&(Ga=sa[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ga)||(La=!0)):(sa=xa.getElementsByTagName("a"),null!=sa&&1==sa.length?Ga=sa[0].getAttribute("href"):(xa=xa.getElementsByTagName("pre"),null!=xa&&1==xa.length&&(Ga=mxUtils.getTextContent(xa[0]))));var Ia=!0,Ca=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(Ga,
+ma,ta,!0,La,null,Ia,mxEvent.isControlDown(ba)))});La&&null!=Ga&&Ga.length>this.resampleThreshold?this.confirmImageResize(function(Pa){Ia=Pa;Ca()},mxEvent.isControlDown(ba)):Ca()}else null!=va&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(va)?this.loadImage(decodeURIComponent(va),mxUtils.bind(this,function(Pa){var Ka=Math.max(1,Pa.width);Pa=Math.max(1,Pa.height);var Na=this.maxImageSize;Na=Math.min(1,Math.min(Na/Math.max(1,Ka)),Na/Math.max(1,Pa));f.setSelectionCell(f.insertVertex(null,null,"",ma,ta,Ka*Na,
+Pa*Na,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+va+";"))}),mxUtils.bind(this,function(Pa){f.setSelectionCells(this.insertTextAt(va,ma,ta,!0))})):0<=mxUtils.indexOf(ba.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(ba.dataTransfer.getData("text/plain"),ma,ta,!0))}}ba.stopPropagation();ba.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",
mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||
-null==c.embedViewport)mxUtils.fit(this.div);else{var ca=parseInt(this.div.offsetLeft),sa=parseInt(this.div.offsetWidth),xa=c.embedViewport.x+c.embedViewport.width,qa=parseInt(this.div.offsetTop),Ba=parseInt(this.div.offsetHeight),ma=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(ca,xa-sa))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(qa,ma-Ba))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+
-"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var X=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(ca,sa){X.call(this,ca,sa);c.hideCurrentMenu()};var ea=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(ca,sa){ea.call(this,ca,sa);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():
-(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=T)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();"kennedy"==q&&(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),T<Editor.smallScreenWidth-240&&
-(this.hsplitPosition=0),this.lastWindowWidth=T)}q=!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(this.isAutoDarkModeSupported())try{var oa=window.matchMedia("(prefers-color-scheme: dark)"),
-la=mxUtils.bind(this,function(ca){this.isAutoDarkMode()&&this.setDarkMode(ca.matches)});oa.addEventListener("change",la);this.destroyFunctions.push(function(){oa.removeEventListener("change",la)})}catch(ca){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&
-this.setHighContrast(!0);Editor.isSettingsEnabled()&&null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages);this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(ca,sa){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};
+null==c.embedViewport)mxUtils.fit(this.div);else{var ba=parseInt(this.div.offsetLeft),sa=parseInt(this.div.offsetWidth),xa=c.embedViewport.x+c.embedViewport.width,qa=parseInt(this.div.offsetTop),Ba=parseInt(this.div.offsetHeight),ma=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(ba,xa-sa))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(qa,ma-Ba))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+
+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var X=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(ba,sa){X.call(this,ba,sa);c.hideCurrentMenu()};var ea=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(ba,sa){ea.call(this,ba,sa);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():
+(U=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,U<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&U<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=U)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();"kennedy"==q&&(U=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,U<Editor.smallScreenWidth&&(this.formatWidth=0),U<Editor.smallScreenWidth-240&&
+(this.hsplitPosition=0),this.lastWindowWidth=U)}q=!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(this.isAutoDarkModeSupported())try{var oa=window.matchMedia("(prefers-color-scheme: dark)"),
+ka=mxUtils.bind(this,function(ba){this.isAutoDarkMode()&&this.setDarkMode(ba.matches)});oa.addEventListener("change",ka);this.destroyFunctions.push(function(){oa.removeEventListener("change",ka)})}catch(ba){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&
+this.setHighContrast(!0);Editor.isSettingsEnabled()&&null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages);this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(ba,sa){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};
var y=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));f=Editor.smallScreenWidth-
160;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,
q=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(V){mxEvent.getSource(V)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(V),mxEvent.getClientY(V)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var x=document.createElement("div");x.style.position="absolute";x.style.width="10px";x.style.height="10px";x.style.borderRadius="5px";x.style.border="1px solid gray";x.style.background=
@@ -4575,80 +4577,80 @@ q=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagra
A=mxEvent.getClientX(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(V){var J=!1;null!=A&&(this.diagramContainer.style.width=Math.max(20,K+mxEvent.getClientX(V)-A)+"px",J=!0);null!=E&&(this.diagramContainer.style.height=Math.max(20,Q+mxEvent.getClientY(V)-E)+"px",J=!0);J&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),
"*"),this.inlineSizeChanged(),this.refresh())}),function(V){null==A&&null==E||mxEvent.consume(V);E=A=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(V){this.inlineSizeChanged();
Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(V){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=
-function(){function c(){window.setTimeout(function(){l.innerHTML="&nbsp;";l.focus();try{var A=document.createRange();A.selectNodeContents(l);var E=window.getSelection();null!=E&&(E.removeAllRanges(),E.addRange(A))}catch(K){}},0)}var f=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";
-l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position="absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML="&nbsp;";this.clipboardElt=l;var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,
-null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(A){var E=mxEvent.getSource(A);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==E.nodeName||"TEXTAREA"==E.nodeName&&E!==this.typingShim||"true"==E.contentEditable||224!=A.keyCode&&(mxClient.IS_MAC||17!=A.keyCode)&&(!mxClient.IS_MAC||91!=A.keyCode&&93!=A.keyCode)||q||(l.style.left=f.container.scrollLeft+10+"px",l.style.top=f.container.scrollTop+10+"px",A=f.container.scrollLeft,E=f.container.scrollTop,
-f.container.appendChild(l),q=!0,l.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=A,f.container.scrollTop=E)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(A){var E=A.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=E&&17!=E&&91!=E&&93!=E||(q=!1,l.parentNode.removeChild(l),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,
-function(A){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(l,"cut",mxUtils.bind(this,function(A){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(A){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML="&nbsp;",l.focus(),null!=A.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(A,
-l,!0,!0)),!mxEvent.isConsumed(A)){var E=f.container.scrollLeft,K=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=E,f.container.scrollTop=K,Graph.removePasteFormatting(l.firstChild),this.pasteCells(A,l,!1,!0)}catch(Q){this.handleError(Q)}}),0)}}catch(Q){this.handleError(Q)}}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(A){return mxEvent.getSource(A)==l?!0:x.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);
-(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),
-Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return l};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,q=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,q-=this.embedViewport.y):(l+=this.embedViewport.x,q+=this.embedViewport.y));
-f={x:l,y:q,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var q=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-q.x;c.y-=c.boundingRect.y-q.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=
-null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var q=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?
-this.statusContainer.firstChild:null;f=null!=q&&null!=q.getAttribute("class");if(!f&&null!=q){q=q.getAttribute("title");var x=this.getCurrentFile();x=null!=x?x.savingStatusKey:DrawioFile.prototype.savingStatusKey;q==mxResources.get(x)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(x))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";q=32>=c.clientWidth;c.style.visibility=q&&""==this.editor.getStatus()?"hidden":
-"";if(q||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);
-this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=
-this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&
-(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),
-this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.restoreVisibleWindows=function(){if(Editor.isSettingsEnabled()){var c=
-{layers:"layers",outline:"outline",tags:"tags"},f;for(f in c){var l=mxSettings.getWindowState(f);null!=l&&l.visible&&(l=this.actions.get(c[f]),null!=l&&l.funct())}}};EditorUi.prototype.saveWindowState=function(c,f){f=f.window;var l=f.minimized&&null!=f.height?parseInt(f.height):parseInt(f.div.style.height);mxSettings.setWindowState(c,{x:f.getX(),y:f.getY(),w:parseInt(f.div.style.width),h:l,visible:f.isVisible(),minimized:f.minimized||!1,dockState:f.dockState||null,dockAnchorRight:f._dockAnchorRight||
-null,dockAnchorBottom:f._dockAnchorBottom||null,dockOffsetX:f._dockOffsetX||null,dockOffsetY:f._dockOffsetY||null});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=
-c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,f.div.classList.add("mxWindowDocked"),this.dockManager.windows.push(f),this.dockManager.pinToEdge(f));f.fit();null!=c.visible&&f.setVisible(c.visible);c.minimized&&!f.minimized&&f.toggleMinimized();return c};EditorUi.prototype.installWindowPersistence=function(c,f){var l=this,q=f.window,x=function(){l.saveWindowState(c,f)};q.addListener(mxEvent.MOVE_END,x);q.addListener(mxEvent.RESIZE_END,x);q.addListener(mxEvent.SHOW,
-x);q.addListener(mxEvent.HIDE,x);q.addListener(mxEvent.DOCK,x);q.addListener(mxEvent.UNDOCK,x);q.addListener(mxEvent.MAXIMIZE,x);q.addListener(mxEvent.MINIMIZE,x);q.addListener(mxEvent.NORMALIZE,x)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,l){var q=this.threshold,x=c<=q;c=c+l.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-q;var A=f<=q;f=f+l.offsetHeight>=
-(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-q;return x&&A?"top-left":c&&A?"top-right":x&&f?"bottom-left":c&&f?"bottom-right":x?"left":c?"right":A?"top":f?"bottom":null},dock:function(c,f){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),A=parseInt(c.div.style.height),E=c.getX(),K=c.getY();c.dockState=
-f;c.div.classList.add("mxWindowDocked");var Q=0<=f.indexOf("right"),V=0<=f.indexOf("bottom");0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=l-x);0<=f.indexOf("top")?K=0:0<=f.indexOf("bottom")&&(K=q-A);Q||(Q=E+x/2>l/2);V||(V=K+A/2>q/2);c._dockAnchorRight=Q;c._dockAnchorBottom=V;c._dockOffsetX=Q?l-E-x:E;c._dockOffsetY=V?q-K-A:K;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===
-c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),A=parseInt(c.div.style.height);
-var E=c._dockAnchorRight?l-x-(c._dockOffsetX||0):c._dockOffsetX||0;var K=c._dockAnchorBottom?q-A-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=l-x);0<=f.indexOf("top")?K=0:0<=f.indexOf("bottom")&&(K=q-A);E=Math.max(0,Math.min(E,l-x));K=Math.max(0,Math.min(K,q-A));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,E,K);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,
-f){null==this.previewElement&&(this.previewElement=document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=this.previewElement,A=f.div.offsetWidth,E=f.div.offsetHeight,K=f.getX();f=f.getY();0<=c.indexOf("left")?K=0:0<=c.indexOf("right")&&(K=l-A);0<=c.indexOf("top")?
-f=0:0<=c.indexOf("bottom")&&(f=q-E);K=Math.max(0,Math.min(K,l-A));f=Math.max(0,Math.min(f,q-E));x.style.display="block";x.style.left=K+"px";x.style.top=f+"px";x.style.width=A+"px";x.style.height=E+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&
-(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var C=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,l){C.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var q=c.window;null==this.dockManager&&this.createDockManager();
-var x=this.dockManager,A=!1,E=null,K=q.setLocation;q.setLocation=function(J,ia){(null==this.dockState||this._undocking||this._relayouting)&&K.call(this,J,ia)};var Q=q.setSize;q.setSize=function(J,ia){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,J,ia);J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;ia=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var Y=parseInt(this.div.style.width),aa=parseInt(this.div.style.height),
-ja=this.getX(),ka=this.getY();this._dockOffsetX=this._dockAnchorRight?J-ja-Y:ja;this._dockOffsetY=this._dockAnchorBottom?ia-ka-aa:ka;x.pinToEdge(this)}else Q.call(this,J,ia)};q.addListener(mxEvent.MOVE_START,function(J,ia){A=!0;E=null;null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.MOVE,function(J,ia){A&&(J=x.getDockZone(q.getX(),q.getY(),q.div),J!=E&&(E=J,null!=J?x.showPreview(J,q):x.hidePreview()))});q.addListener(mxEvent.MOVE_END,function(J,ia){A=!1;x.hidePreview();
-null!=E&&x.dock(q,E);E=null});q.addListener(mxEvent.DOCK,function(J,ia){if(null!=q.resize){J=ia.getProperty("side");var Y=0<=J.indexOf("right"),aa=0<=J.indexOf("bottom");if(Y||aa){J=q.resize;J.parentNode.removeChild(J);q.resize=null;J=document.createElement("img");J.style.position="absolute";J.style.zIndex="2";J.setAttribute("src",mxWindow.prototype.resizeImage);Y?J.style.left="0px":J.style.right="0px";aa?J.style.top="0px":J.style.bottom="0px";J.style.cursor=Y!=aa?"nesw-resize":"nwse-resize";var ja=
-null,ka=null,ua=null,Da=null,ha=function(u){if(null!=ja&&null!=ka){var H=mxEvent.getClientX(u)-ja,P=mxEvent.getClientY(u)-ka;q.setSize(Y?ua-H:ua+H,aa?Da-P:Da+P);q.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",u));mxEvent.consume(u)}},k=function(u){null!=ja&&null!=ka&&(ka=ja=null,mxEvent.removeGestureListeners(document,null,ha,k),q.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",u)),mxEvent.consume(u))};mxEvent.addGestureListeners(J,function(u){q.activate();ja=mxEvent.getClientX(u);ka=
-mxEvent.getClientY(u);ua=q.div.offsetWidth;Da=q.div.offsetHeight;mxEvent.addGestureListeners(document,null,ha,k);q.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",u));mxEvent.consume(u)},ha,k);q.div.appendChild(J);q.resize=J;q._dockResize=!0}}});q.addListener(mxEvent.UNDOCK,function(J,ia){q._dockResize&&(null!=q.resize&&(q.resize.parentNode.removeChild(q.resize),q.resize=null),q.setResizable(!0),q._dockResize=!1)});q.addListener(mxEvent.NORMALIZE,function(J,ia){null!=q.dockState&&x.pinToEdge(q)});
-q.addListener(mxEvent.MAXIMIZE,function(J,ia){null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.SHOW,function(J,ia){null!=q.dockState&&x.pinToEdge(q)});var V=c.destroy;c.destroy=function(){x.removeWindow(q);V.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var f=this.editor.graph;f.defaultEdgeLength=Graph.prototype.defaultEdgeLength;f.defaultGridEnabled=Graph.prototype.defaultGridEnabled;f.defaultPageVisible=Graph.prototype.defaultPageVisible;
-null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)f.defaultEdgeLength=120;null==urlParams.grid&&(f.defaultGridEnabled=!1);null==urlParams.pv&&(f.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};
-EditorUi.prototype.isThemeMenuVisible=function(){return("1"!=urlParams.embed||"1"==urlParams.themes&&null==urlParams.ui&&"1"!=urlParams.sketch)&&"1"!=urlParams.extAuth&&this.mode!=App.MODE_ATLAS};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=
-mxResources.get("offline");else{var f=this.getCurrentFile();null!=f&&(f.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==f.sync||f.sync.enabled&&f.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==f.sync||f.sync.isConnected()?f.isRealtimeEnabled()&&f.isRealtimeSupported()&&1<f.getRealtimeState()&&(c=f.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):
-c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&
-null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,l,q){l=null!=l?l:"geButton";var x=this.menus.get(c);q=this.menubar.addMenu(mxResources.get(c),x.funct,null,q);q.className=l;q.setAttribute("title",mxResources.get(c));this.menus.menuCreated(x,q,l);null!=f&&(q.style.backgroundImage="url("+f+")",q.innerText="");return q};EditorUi.prototype.addButton=function(c,f,l,q){c=this.createToolbarButton(c,
-f,l);q=null!=q?q:this.container;q.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,l){var q=document.createElement("a");q.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(q.style.backgroundImage="url("+c+")");null!=f&&q.setAttribute("title",f);null!=l&&mxEvent.addListener(q,"click",function(x){"disabled"!=q.getAttribute("disabled")&&l(x);mxEvent.consume(x)});mxEvent.preventDefault(q);return q};EditorUi.prototype.createMenuItem=function(c,f,l){var q=this.actions.get(c),
-x=null!=q?q.funct:null,A=this.createToolbarButton(f,mxResources.get(c)+(null!=q&&null!=q.shortcut?" ("+q.shortcut+")":""),x);null==q||l||(c=function(){q.isEnabled()?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),q.addListener("stateChanged",c),c());return A};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),l=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-
-256),q=null!=f&&null!=f.y?f.y:60,x=null!=f&&null!=f.w?f.w:240,A=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),l,q,x,A,mxUtils.bind(this,function(Q){Q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var E=
-this.formatWindow.window.toggleMinimized,K=x;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(K=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+K-140+"px"):(this.div.style.width=K+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-K+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,
-"dblclick",mxUtils.bind(this,function(Q){mxEvent.getSource(Q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var Q=window.innerWidth||document.documentElement.clientWidth||
-document.body.clientWidth,V=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>Q||690>V)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var O=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):O.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=
-function(c,f){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var q=this.hsplitPosition,x=mxUtils.bind(this,function(){this.hsplitPosition=A;this.refresh();f||(this.diagramContainer.scrollLeft-=q-this.hsplitPosition)}),A=c?l:0,E=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==A?"translateX(0)":"translateX(-100%)");0!=A&&x();window.setTimeout(mxUtils.bind(this,
-function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==A?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+E+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,
-"transform-origin",null);0==A&&x();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*E)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var F=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():F.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(E,K){var Q=this.menus.get(E);E=this.createMenuElement(K,
-mxUtils.bind(this,function(){Q.funct.apply(this,arguments)}));E.setAttribute("title",K);E.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";E.className="geButton";c.parentNode.appendChild(E);return E});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",
-f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=f("newLibrary","");l.style.left="0px";l.style.right="50%";var q=document.createElement("span");l.appendChild(q);
-var x=f("openLibraryFrom","");x.style.borderLeftWidth="1px";x.style.left="50%";x.style.right="0px";var A=document.createElement("span");x.appendChild(A);this.dependsOnLanguage(mxUtils.bind(this,function(){q.innerHTML="";mxUtils.write(q,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));A.innerHTML="";mxUtils.write(A,mxResources.get("openLibraryFrom"));x.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow=
-"hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)-6,l=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650))-6,q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=null!=c&&null!=c.x?c.x:q&&"1"!=urlParams.embedInline?66:10;q=null!=c&&null!=c.y?c.y:q&&"1"!=urlParams.embedInline?
-Math.max(30,(this.diagramContainer.parentNode.clientHeight-l)/2):56;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),x,q,f,l,mxUtils.bind(this,function(A){this.createShapesPanel(A)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.installWindowPersistence("shapes",this.sidebarWindow);null!=c?this.restoreWindowState("shapes",this.sidebarWindow):
-this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&
-"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();for(this.updateOfflineLanguages();null!=this.dialog;){var f=this.dialog;this.hideDialog(!0);if(this.dialog==f)break}this.fireEvent(new mxEventObject("languageChanged"));
-null==this.getCurrentFile()&&"function"===typeof this.showSplash&&this.showSplash()})))};EditorUi.prototype.getOfflineLanguages=function(c){try{if("undefined"!==typeof caches){caches.keys().then(function(f){for(var l=[],q=0;q<f.length;q++)"workbox-precache-v2"==f[q].substring(0,19)&&l.push(caches.open(f[q]).then(function(x){return x.keys()}));return Promise.all(l)}).then(function(f){for(var l=Object.create(null),q=!1,x=0;x<f.length;x++)for(var A=0;A<f[x].length;A++){var E=/\/resources\/dia(?:_([a-z0-9-]+))?\.txt$/.exec((new URL(f[x][A].url)).pathname);
-null!=E&&(null!=E[1]?l[E[1]]=!0:q=!0)}f=Object.keys(l).sort();c(null!=f?f:[],1==q)})["catch"](function(){c([],!1)});return}}catch(f){}c([],!1)};EditorUi.prototype.updateOfflineLanguages=function(){this.getOfflineLanguages(mxUtils.bind(this,function(c,f){var l=Object.create(null);f&&(l.en=!0);for(f=0;f<c.length;f++)l[c[f]]=!0;this.offlineLanguages=l}))};EditorUi.prototype.removeOfflineLanguage=function(c,f){try{if("undefined"!==typeof caches&&/^[a-z0-9-]+$/.test(c)){caches.keys().then(function(l){for(var q=
-[],x=0;x<l.length;x++)"workbox-precache-v2"==l[x].substring(0,19)&&q.push(caches.open(l[x]).then(function(A){return A.keys().then(function(E){return Promise.all(E.filter(function(K){return(new URL(K.url)).pathname.endsWith("/resources/dia_"+c+".txt")}).map(function(K){return A.delete(K)}))})}));return Promise.all(q)}).then(mxUtils.bind(this,function(){this.updateOfflineLanguages();f()}))["catch"](function(){f()});return}}catch(l){}f()};EditorUi.prototype.isLanguageAvailableOffline=function(c){return!1!==
-navigator.onLine||null==this.offlineLanguages||1!=this.offlineLanguages.en||""==c||"en"==c||1==this.offlineLanguages[c]};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=
-c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var f=document.getElementById("high-contrast-stylesheet");if(null!=f&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,q=f.getAttribute("media");(q="all"==q||
-"not all"!=q&&l)&&!c?f.setAttribute("media",l?"not all":"(forced-colors: active)"):!q&&c&&f.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var f=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));
-c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-f.x;this.diagramContainer.scrollTop+=c.x-f.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||
-null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=
-c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),
-(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&
-(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var q=this.diagramContainer.getAttribute("data-bounds");if(null!=
-q){this.diagramContainer.removeAttribute("data-bounds");var x=q.split(" ");q=mxUtils.getDocumentSize();this.diagramContainer.style.top=x[0];this.diagramContainer.style.left=x[1];var A=parseInt(x[2]);x=parseInt(x[3]);A=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,A):A,q.width-80);x=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,x):x,q.height-80);this.diagramContainer.style.width=A+"px";this.diagramContainer.style.height=x+"px";this.diagramContainer.style.bottom=
-"";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-
-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+
-(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;q="1"==urlParams.embedInline&&Editor.passiveScroll;f.style.visibility=q?"hidden":"";c.style.visibility=q?"hidden":"";l.style.display=q?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};
-EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-
-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved=
-"1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=
-urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",
-c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle();this.restorePersistedEdgeStyle()};EditorUi.prototype.restorePersistedEdgeStyle=
+function(){function c(){window.setTimeout(function(){l.innerHTML="&nbsp;";l.focus();try{var A=document.createRange();A.selectNodeContents(l);var E=window.getSelection();null!=E&&(E.removeAllRanges(),E.addRange(A))}catch(K){}},0)}var f=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");this.isVirtualKeyboardDevice()&&l.setAttribute("inputmode","none");
+l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position="absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1px";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML="&nbsp;";this.clipboardElt=l;var q=!1;this.keyHandler.bindControlKey(88,
+null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(A){var E=mxEvent.getSource(A);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==E.nodeName||"TEXTAREA"==E.nodeName&&E!==this.typingShim||"true"==E.contentEditable||224!=A.keyCode&&(mxClient.IS_MAC||17!=A.keyCode)&&(!mxClient.IS_MAC||91!=A.keyCode&&93!=A.keyCode)||q||(l.style.left=f.container.scrollLeft+10+
+"px",l.style.top=f.container.scrollTop+10+"px",A=f.container.scrollLeft,E=f.container.scrollTop,f.container.appendChild(l),q=!0,l.focus({preventScroll:!0}),document.execCommand("selectAll",!1,null),f.container.scrollLeft=A,f.container.scrollTop=E)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(A){var E=A.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=E&&17!=E&&91!=E&&93!=E||(q=!1,l.parentNode.removeChild(l),f.isEditing()||null!=this.dialog||null==f.container||
+f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(A){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(l,"cut",mxUtils.bind(this,function(A){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(A){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML=
+"&nbsp;",l.focus(),null!=A.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(A,l,!0,!0)),!mxEvent.isConsumed(A)){var E=f.container.scrollLeft,K=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=E,f.container.scrollTop=K,Graph.removePasteFormatting(l.firstChild),this.pasteCells(A,l,!1,!0)}catch(Q){this.handleError(Q)}}),0)}}catch(Q){this.handleError(Q)}}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(A){return mxEvent.getSource(A)==
+l?!0:x.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&
+"simple"==c||c==Editor.currentTheme;if(l||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return l};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,q=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?
+(l-=this.embedViewport.x,q-=this.embedViewport.y):(l+=this.embedViewport.x,q+=this.embedViewport.y));f={x:l,y:q,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var q=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-q.x;c.y-=c.boundingRect.y-q.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*f;
+this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==
+Editor.currentTheme){var q=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=q&&null!=q.getAttribute("class");if(!f&&null!=q){q=q.getAttribute("title");var x=this.getCurrentFile();x=null!=x?x.savingStatusKey:DrawioFile.prototype.savingStatusKey;q==mxResources.get(x)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(x))+'..."src="'+Editor.tailSpin+'"></div>',
+f=!0)}this.statusContainer.style.display="none";q=32>=c.clientWidth;c.style.visibility=q&&""==this.editor.getStatus()?"hidden":"";if(q||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();
+this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,
+this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),
+this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=
+this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,
+"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.restoreVisibleWindows=function(){if(Editor.isSettingsEnabled()){var c={layers:"layers",outline:"outline",tags:"tags"},f;for(f in c){var l=mxSettings.getWindowState(f);null!=l&&l.visible&&(l=this.actions.get(c[f]),null!=l&&l.funct())}}};EditorUi.prototype.saveWindowState=function(c,f){f=f.window;var l=f.minimized&&null!=f.height?parseInt(f.height):parseInt(f.div.style.height);mxSettings.setWindowState(c,{x:f.getX(),
+y:f.getY(),w:parseInt(f.div.style.width),h:l,visible:f.isVisible(),minimized:f.minimized||!1,dockState:f.dockState||null,dockAnchorRight:f._dockAnchorRight||null,dockAnchorBottom:f._dockAnchorBottom||null,dockOffsetX:f._dockOffsetX||null,dockOffsetY:f._dockOffsetY||null});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,
+c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,f.div.classList.add("mxWindowDocked"),this.dockManager.windows.push(f),this.dockManager.pinToEdge(f));f.fit();null!=c.visible&&f.setVisible(c.visible);c.minimized&&!f.minimized&&f.toggleMinimized();return c};EditorUi.prototype.installWindowPersistence=function(c,
+f){var l=this,q=f.window,x=function(){l.saveWindowState(c,f)};q.addListener(mxEvent.MOVE_END,x);q.addListener(mxEvent.RESIZE_END,x);q.addListener(mxEvent.SHOW,x);q.addListener(mxEvent.HIDE,x);q.addListener(mxEvent.DOCK,x);q.addListener(mxEvent.UNDOCK,x);q.addListener(mxEvent.MAXIMIZE,x);q.addListener(mxEvent.MINIMIZE,x);q.addListener(mxEvent.NORMALIZE,x)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,l){var q=
+this.threshold,x=c<=q;c=c+l.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-q;var A=f<=q;f=f+l.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-q;return x&&A?"top-left":c&&A?"top-right":x&&f?"bottom-left":c&&f?"bottom-right":x?"left":c?"right":A?"top":f?"bottom":null},dock:function(c,f){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||
+document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),A=parseInt(c.div.style.height),E=c.getX(),K=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var Q=0<=f.indexOf("right"),V=0<=f.indexOf("bottom");0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=l-x);0<=f.indexOf("top")?K=0:0<=f.indexOf("bottom")&&(K=q-A);Q||(Q=E+x/2>l/2);V||(V=K+A/2>q/2);c._dockAnchorRight=Q;c._dockAnchorBottom=V;c._dockOffsetX=Q?l-E-x:E;c._dockOffsetY=V?q-K-A:K;this.windows.push(c);
+this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var l=window.innerWidth||document.documentElement.clientWidth||
+document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),A=parseInt(c.div.style.height);var E=c._dockAnchorRight?l-x-(c._dockOffsetX||0):c._dockOffsetX||0;var K=c._dockAnchorBottom?q-A-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=l-x);0<=f.indexOf("top")?K=0:0<=f.indexOf("bottom")&&(K=q-A);E=Math.max(0,Math.min(E,l-x));K=Math.max(0,Math.min(K,q-A));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,
+E,K);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,f){null==this.previewElement&&(this.previewElement=document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=this.previewElement,
+A=f.div.offsetWidth,E=f.div.offsetHeight,K=f.getX();f=f.getY();0<=c.indexOf("left")?K=0:0<=c.indexOf("right")&&(K=l-A);0<=c.indexOf("top")?f=0:0<=c.indexOf("bottom")&&(f=q-E);K=Math.max(0,Math.min(K,l-A));f=Math.max(0,Math.min(f,q-E));x.style.display="block";x.style.left=K+"px";x.style.top=f+"px";x.style.width=A+"px";x.style.height=E+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===
+c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var C=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,l){C.apply(this,arguments);
+if(EditorUi.windowed&&Editor.enableWindowDocking){var q=c.window;null==this.dockManager&&this.createDockManager();var x=this.dockManager,A=!1,E=null,K=q.setLocation;q.setLocation=function(J,ia){(null==this.dockState||this._undocking||this._relayouting)&&K.call(this,J,ia)};var Q=q.setSize;q.setSize=function(J,ia){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,J,ia);J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;ia=window.innerHeight||document.documentElement.clientHeight||
+document.body.clientHeight;var Y=parseInt(this.div.style.width),aa=parseInt(this.div.style.height),ja=this.getX(),la=this.getY();this._dockOffsetX=this._dockAnchorRight?J-ja-Y:ja;this._dockOffsetY=this._dockAnchorBottom?ia-la-aa:la;x.pinToEdge(this)}else Q.call(this,J,ia)};q.addListener(mxEvent.MOVE_START,function(J,ia){A=!0;E=null;null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.MOVE,function(J,ia){A&&(J=x.getDockZone(q.getX(),q.getY(),q.div),J!=E&&(E=J,null!=
+J?x.showPreview(J,q):x.hidePreview()))});q.addListener(mxEvent.MOVE_END,function(J,ia){A=!1;x.hidePreview();null!=E&&x.dock(q,E);E=null});q.addListener(mxEvent.DOCK,function(J,ia){if(null!=q.resize){J=ia.getProperty("side");var Y=0<=J.indexOf("right"),aa=0<=J.indexOf("bottom");if(Y||aa){J=q.resize;J.parentNode.removeChild(J);q.resize=null;J=document.createElement("img");J.style.position="absolute";J.style.zIndex="2";J.setAttribute("src",mxWindow.prototype.resizeImage);Y?J.style.left="0px":J.style.right=
+"0px";aa?J.style.top="0px":J.style.bottom="0px";J.style.cursor=Y!=aa?"nesw-resize":"nwse-resize";var ja=null,la=null,ua=null,Da=null,ha=function(u){if(null!=ja&&null!=la){var H=mxEvent.getClientX(u)-ja,P=mxEvent.getClientY(u)-la;q.setSize(Y?ua-H:ua+H,aa?Da-P:Da+P);q.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",u));mxEvent.consume(u)}},k=function(u){null!=ja&&null!=la&&(la=ja=null,mxEvent.removeGestureListeners(document,null,ha,k),q.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",u)),
+mxEvent.consume(u))};mxEvent.addGestureListeners(J,function(u){q.activate();ja=mxEvent.getClientX(u);la=mxEvent.getClientY(u);ua=q.div.offsetWidth;Da=q.div.offsetHeight;mxEvent.addGestureListeners(document,null,ha,k);q.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",u));mxEvent.consume(u)},ha,k);q.div.appendChild(J);q.resize=J;q._dockResize=!0}}});q.addListener(mxEvent.UNDOCK,function(J,ia){q._dockResize&&(null!=q.resize&&(q.resize.parentNode.removeChild(q.resize),q.resize=null),q.setResizable(!0),
+q._dockResize=!1)});q.addListener(mxEvent.NORMALIZE,function(J,ia){null!=q.dockState&&x.pinToEdge(q)});q.addListener(mxEvent.MAXIMIZE,function(J,ia){null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.SHOW,function(J,ia){null!=q.dockState&&x.pinToEdge(q)});var V=c.destroy;c.destroy=function(){x.removeWindow(q);V.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var f=this.editor.graph;f.defaultEdgeLength=Graph.prototype.defaultEdgeLength;
+f.defaultGridEnabled=Graph.prototype.defaultGridEnabled;f.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)f.defaultEdgeLength=120;null==urlParams.grid&&(f.defaultGridEnabled=!1);null==urlParams.pv&&(f.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=
+function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.isThemeMenuVisible=function(){return("1"!=urlParams.embed||"1"==urlParams.themes&&null==urlParams.ui&&"1"!=urlParams.sketch)&&"1"!=urlParams.extAuth&&this.mode!=App.MODE_ATLAS};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=
+function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var f=this.getCurrentFile();null!=f&&(f.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==f.sync||f.sync.enabled&&f.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==f.sync||f.sync.isConnected()?f.isRealtimeEnabled()&&f.isRealtimeSupported()&&1<f.getRealtimeState()&&(c=f.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+
+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity=
+"");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,l,q){l=null!=l?l:"geButton";var x=this.menus.get(c);q=this.menubar.addMenu(mxResources.get(c),x.funct,null,q);q.className=l;q.setAttribute("title",mxResources.get(c));this.menus.menuCreated(x,q,l);null!=f&&(q.style.backgroundImage="url("+
+f+")",q.innerText="");return q};EditorUi.prototype.addButton=function(c,f,l,q){c=this.createToolbarButton(c,f,l);q=null!=q?q:this.container;q.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,l){var q=document.createElement("a");q.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(q.style.backgroundImage="url("+c+")");null!=f&&q.setAttribute("title",f);null!=l&&mxEvent.addListener(q,"click",function(x){"disabled"!=q.getAttribute("disabled")&&l(x);mxEvent.consume(x)});
+mxEvent.preventDefault(q);return q};EditorUi.prototype.createMenuItem=function(c,f,l){var q=this.actions.get(c),x=null!=q?q.funct:null,A=this.createToolbarButton(f,mxResources.get(c)+(null!=q&&null!=q.shortcut?" ("+q.shortcut+")":""),x);null==q||l||(c=function(){q.isEnabled()?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),q.addListener("stateChanged",c),c());return A};EditorUi.prototype.createFormatWindow=function(){if(null==
+this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),l=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-256),q=null!=f&&null!=f.y?f.y:60,x=null!=f&&null!=f.w?f.w:240,A=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),l,q,x,A,mxUtils.bind(this,function(Q){Q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,
+mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var E=this.formatWindow.window.toggleMinimized,K=x;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(K=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+K-140+"px"):(this.div.style.width=K+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,
+parseInt(this.div.style.left)-K+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(Q){mxEvent.getSource(Q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,
+mxUtils.bind(this,function(){var Q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,V=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>Q||690>V)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var O=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=
+c?c:!this.isFormatPanelVisible()):O.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var q=this.hsplitPosition,x=mxUtils.bind(this,function(){this.hsplitPosition=A;this.refresh();f||(this.diagramContainer.scrollLeft-=q-this.hsplitPosition)}),A=c?l:0,E=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,
+"transform",0==A?"translateX(0)":"translateX(-100%)");0!=A&&x();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==A?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+E+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",
+null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==A&&x();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*E)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var F=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():F.apply(this,arguments)};EditorUi.prototype.createShapesPanel=
+function(c){var f=mxUtils.bind(this,function(E,K){var Q=this.menus.get(E);E=this.createMenuElement(K,mxUtils.bind(this,function(){Q.funct.apply(this,arguments)}));E.setAttribute("title",K);E.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";E.className="geButton";c.parentNode.appendChild(E);return E});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),
+f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=
+f("newLibrary","");l.style.left="0px";l.style.right="50%";var q=document.createElement("span");l.appendChild(q);var x=f("openLibraryFrom","");x.style.borderLeftWidth="1px";x.style.left="50%";x.style.right="0px";var A=document.createElement("span");x.appendChild(A);this.dependsOnLanguage(mxUtils.bind(this,function(){q.innerHTML="";mxUtils.write(q,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));A.innerHTML="";mxUtils.write(A,mxResources.get("openLibraryFrom"));x.setAttribute("title",
+mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)-6,l=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650))-6,q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=null!=
+c&&null!=c.x?c.x:q&&"1"!=urlParams.embedInline?66:10;q=null!=c&&null!=c.y?c.y:q&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-l)/2):56;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),x,q,f,l,mxUtils.bind(this,function(A){this.createShapesPanel(A)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.installWindowPersistence("shapes",
+this.sidebarWindow);null!=c?this.restoreWindowState("shapes",this.sidebarWindow):this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=
+c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();for(this.updateOfflineLanguages();null!=this.dialog;){var f=this.dialog;this.hideDialog(!0);if(this.dialog==
+f)break}this.fireEvent(new mxEventObject("languageChanged"));null==this.getCurrentFile()&&"function"===typeof this.showSplash&&this.showSplash()})))};EditorUi.prototype.getOfflineLanguages=function(c){try{if("undefined"!==typeof caches){caches.keys().then(function(f){for(var l=[],q=0;q<f.length;q++)"workbox-precache-v2"==f[q].substring(0,19)&&l.push(caches.open(f[q]).then(function(x){return x.keys()}));return Promise.all(l)}).then(function(f){for(var l=Object.create(null),q=!1,x=0;x<f.length;x++)for(var A=
+0;A<f[x].length;A++){var E=/\/resources\/dia(?:_([a-z0-9-]+))?\.txt$/.exec((new URL(f[x][A].url)).pathname);null!=E&&(null!=E[1]?l[E[1]]=!0:q=!0)}f=Object.keys(l).sort();c(null!=f?f:[],1==q)})["catch"](function(){c([],!1)});return}}catch(f){}c([],!1)};EditorUi.prototype.updateOfflineLanguages=function(){this.getOfflineLanguages(mxUtils.bind(this,function(c,f){var l=Object.create(null);f&&(l.en=!0);for(f=0;f<c.length;f++)l[c[f]]=!0;this.offlineLanguages=l}))};EditorUi.prototype.removeOfflineLanguage=
+function(c,f){try{if("undefined"!==typeof caches&&/^[a-z0-9-]+$/.test(c)){caches.keys().then(function(l){for(var q=[],x=0;x<l.length;x++)"workbox-precache-v2"==l[x].substring(0,19)&&q.push(caches.open(l[x]).then(function(A){return A.keys().then(function(E){return Promise.all(E.filter(function(K){return(new URL(K.url)).pathname.endsWith("/resources/dia_"+c+".txt")}).map(function(K){return A.delete(K)}))})}));return Promise.all(q)}).then(mxUtils.bind(this,function(){this.updateOfflineLanguages();f()}))["catch"](function(){f()});
+return}}catch(l){}f()};EditorUi.prototype.isLanguageAvailableOffline=function(c){return!1!==navigator.onLine||null==this.offlineLanguages||1!=this.offlineLanguages.en||""==c||"en"==c||1==this.offlineLanguages[c]};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);
+Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var f=document.getElementById("high-contrast-stylesheet");if(null!=f&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,
+q=f.getAttribute("media");(q="all"==q||"not all"!=q&&l)&&!c?f.setAttribute("media",l?"not all":"(forced-colors: active)"):!q&&c&&f.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var f=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),
+this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-f.x;this.diagramContainer.scrollTop+=c.x-f.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&
+(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=
+c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",
+JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left=
+"",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var q=
+this.diagramContainer.getAttribute("data-bounds");if(null!=q){this.diagramContainer.removeAttribute("data-bounds");var x=q.split(" ");q=mxUtils.getDocumentSize();this.diagramContainer.style.top=x[0];this.diagramContainer.style.left=x[1];var A=parseInt(x[2]);x=parseInt(x[3]);A=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,A):A,q.width-80);x=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,x):x,q.height-80);this.diagramContainer.style.width=A+"px";this.diagramContainer.style.height=
+x+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=
+this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/
+2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;q="1"==urlParams.embedInline&&Editor.passiveScroll;f.style.visibility=q?"hidden":"";c.style.visibility=q?"hidden":"";l.style.display=q?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=
+c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?
+(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&
+(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==
+Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch=
+"1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle();this.restorePersistedEdgeStyle()};EditorUi.prototype.restorePersistedEdgeStyle=
function(){var c=this.editor.graph,f="undefined"!==typeof mxSettings&&null!=mxSettings.getCurrentEdgeStyle?mxSettings.getCurrentEdgeStyle():null;if(null!=f){c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);for(var l in f)"__proto__"!=l&&"constructor"!=l&&"prototype"!=l&&(c.currentEdgeStyle[l]=f[l]);null!=f.fontFamily&&null==f.fontSource&&delete c.currentEdgeStyle.fontSource;"orthogonalEdgeStyle"!=c.defaultEdgeStyle.edgeStyle&&delete c.currentEdgeStyle.libavoidRouting;this.fireEvent(new mxEventObject("styleChanged",
"keys",[],"values",[],"cells",[]))}};EditorUi.prototype.getLinkTitle=function(c){var f=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(f=this.getPageById(c.substring(l+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(f=this.getCustomLinkTitle(c));return f};EditorUi.prototype.getCustomLinkTitle=function(c){var f=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));
if(null!=l&&"string"==typeof l.title&&""!=l.title.trim())f=l.title.trim();else if(null!=l&&Array.isArray(l.actions)&&0<l.actions.length){var q=Object.keys(l.actions[0])[0]||"";if("animation"==q&&null!=l.actions[0].animation&&Array.isArray(l.actions[0].animation.steps)){var x=l.actions[0].animation.steps.length;f=mxResources.get("effects")+" ("+x+")"}else if(""!=q){var A="undefined"!=typeof CustomActionDialog&&null!=CustomActionDialog?CustomActionDialog.SCHEMAS[q]:null;f=mxResources.get(null!=A&&A.labelKey?
@@ -4672,7 +4674,7 @@ Q))}Q=K.getElementsByTagName("span");if(null!=Q&&0<Q.length&&"application/vnd.lu
mxEvent.consume(c));else{var ia=!1,Y="";Y=E?null!=K.textContent&&"<mxfile"==K.textContent.substring(0,7)&&"</mxfile>"==K.textContent.substring(K.textContent.length-9)||"<mxGraphModel"==K.textContent.substring(0,13)&&"</mxGraphModel>"==K.textContent.substring(K.textContent.length-15)?K.textContent.replace(/\u00a0/g," "):K.innerHTML:mxUtils.trim(null==K.innerText?mxUtils.getTextContent(K):K.innerText);try{var aa=Y.lastIndexOf("%3E");0<=aa&&aa<Y.length-3&&(Y=Y.substring(0,aa+3))}catch(ha){}try{Q=K.getElementsByTagName("span"),
(J=null!=Q&&0<Q.length?mxUtils.trim(decodeURIComponent(Q[0].textContent)):decodeURIComponent(Y))&&(this.isCompatibleString(J)||0==J.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(ia=!0,Y=J)}catch(ha){}J=null;try{if(!ia&&""==K.textContent)for(aa=0;aa<x.items.length;aa++){var ja=x.items[aa];if("file"===ja.kind){J=ja.getAsFile();break}}}catch(ha){}EditorUi.debug("EditorUi.pasteCells",[this],"evt",[c],"realElt",[f.outerHTML],"elt",[K.outerHTML],"useEvent",l,"pasteAsLabel",q,"xml",[Y],
"compat",ia,"asHtml",E,"data",x,"items",[x.items.length],"files",[x.files.length],"types",[JSON.stringify(x.types)],"blob",[J]);try{if(ia||null==J)if(null!=Y&&0<Y.length){if(0==Y.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ua=mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}),Da=mxUtils.bind(this,function(){if("undefined"===typeof MiroImporter)ua();else try{Y=(new MiroImporter).importMiroJson(JSON.parse(Y)),this.pasteXml(Y,
-q,ia,c)}catch(ha){console.log("Miro import error:",ha)}});"undefined"===typeof MiroImporter?mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",Da,null,null,null,ua):Da()}else this.pasteXml(Y,q,ia,c,E);mxEvent.consume(c)}else l||(A.lastPasteXml=null,A.pasteCounter=0);else{var ka=A.getInsertPoint();this.importFiles([J],ka.x,ka.y,this.maxImageSize);mxEvent.consume(c)}}catch(ha){this.handleError(ha)}}}f.innerHTML="&nbsp;"};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;
+q,ia,c)}catch(ha){console.log("Miro import error:",ha)}});"undefined"===typeof MiroImporter?mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",Da,null,null,null,ua):Da()}else this.pasteXml(Y,q,ia,c,E);mxEvent.consume(c)}else l||(A.lastPasteXml=null,A.pasteCounter=0);else{var la=A.getInsertPoint();this.importFiles([J],la.x,la.y,this.maxImageSize);mxEvent.consume(c)}}catch(ha){this.handleError(ha)}}}f.innerHTML="&nbsp;"};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;
null==c&&Editor.pasteAtMousePointer&&f.isMouseInsertPoint()&&(c=f.getInsertPoint());if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(l,q,x,A,E){if(null!=l){f.getModel().beginUpdate();try{this.pasteXml(l,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else l=null!=q?q:null!=x?x:A,null!=l?(c=null!=c?c:f.getInsertPoint(),this.importFiles([l],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):
this.pasteFromLocalClipboard(c)}catch(l){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var f=this.editor.graph;f.getModel().beginUpdate();try{f.moveCellsTo(mxClipboard.paste(f),c)}finally{f.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(f){for(var l=null!=f.clipboardData?f.clipboardData:f.originalEvent.clipboardData,q=!1,x=null,A=0;A<l.types.length;A++)if("text/"===
l.types[A].substring(0,5)){q=!0;break}for(A=0;A<l.items.length;A++){var E=l.items[A];if("file"===E.kind){x=E.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[f],"data",[l],"items",[l.items.length],"files",[l.files.length],"types",[JSON.stringify(l.types)],"containsText",q,"file",[x],"editing",c.isEditing());var K=mxUtils.bind(this,function(){try{if(!q&&null!=x){if(c.isEditing())this.importFiles([x],0,0,this.maxImageSize,function(V,J,ia,Y,aa,ja){c.insertImage(V,aa,ja)},
@@ -4686,17 +4688,17 @@ else E.text().then(mxUtils.bind(this,function(K){EditorUi.debug("EditorUi.readTy
l.length;)l[0].parentNode.removeChild(l[0]);if(null!=f.firstChild&&f.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=f.firstChild.nextSibling&&f.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==f.firstChild.nodeName&&"A"==f.firstChild.nextSibling.nodeName&&null==f.firstChild.nextSibling.nextSibling){var q=null==f.firstChild.nextSibling.innerText?mxUtils.getTextContent(f.firstChild.nextSibling):f.firstChild.nextSibling.innerText;q==f.firstChild.nextSibling.getAttribute("href")&&
(mxUtils.setTextContent(f,q),asHtml=!1)}if(""==f.textContent&&(l=f.getElementsByTagName("img"),1==l.length&&(q=l[0].getAttribute("src"),l=null,null!=q))){if(Editor.isPngDataUrl(q)){var x=Editor.extractGraphModelFromPng(q);null!=x&&0<x.length&&(l=x)}else if("data:image/svg+xml;base64,"==q.substring(0,26)){img=this.base64ToBlob(q.substring(q.indexOf(",")+1),"image/svg+xml");q=Graph.getSvgFromDataUri(q);try{x=mxUtils.parseXml(q).documentElement.getAttribute("content"),this.isCompatibleString(x)&&(l=
x)}catch(A){}}null!=l&&(mxUtils.setTextContent(f,l),asHtml=!1)}asHtml?Graph.removePasteFormatting(f):f.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,l){this.showDialog((new PrintDialog(this,c,f,l)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var l=this.editor,q=l.graph,x=this.getPageIndex(this.currentPage),A=null!=x?x+1:1,E=mxUtils.bind(this,
-function(k,u,H,P){var T=k.useCssTransforms,W=k.currentTranslate,fa=k.currentScale,X=k.view.translate,ea=k.view.scale;k.useCssTransforms&&(k.useCssTransforms=!1,k.currentTranslate=new mxPoint(0,0),k.currentScale=1,k.view.translate=new mxPoint(0,0),k.view.scale=1);var oa=k.getGraphBounds(),la=0,ca=0,sa=mxRectangle.fromRectangle(k.pageFormat),xa=f.fit||f.crop||!k.pageVisible,qa=f.scale;sa.width*=k.pageScale;sa.height*=k.pageScale;var Ba=1;if(f.fit){Ba=f.sheetsAcross;var ma=f.sheetsDown;isNaN(qa)||(sa.width=
-Math.ceil(sa.width*qa),sa.height=Math.ceil(sa.height*qa));Ba=Math.min(sa.height*ma/(oa.height/k.view.scale),sa.width*Ba/(oa.width/k.view.scale))}else Ba=isNaN(qa)?1:qa;Ba*=1;!xa&&k.pageVisible?(qa=k.getPageLayout(),la-=qa.x*sa.width,ca-=qa.y*sa.height):xa=!0;f.crop&&(f.selection&&(oa=q.getBoundingBox(q.getSelectionCells())),sa.width=(oa.width+1)*Ba/k.view.scale,sa.height=(oa.height+1)*Ba/k.view.scale);sa.width*=1;sa.height*=1;P=null!=P?"page/id,"+P:null;oa=f.selection?k.getBoundingBox(k.getSelectionCells()):
-k.getGraphBounds();if(null!=oa){qa=k.view.scale/Ba;ma=oa.width;var ta=oa.height,va=la,Ha=ca;xa||(va-=k.view.translate.x*Ba,Ha-=k.view.translate.y*Ba,ma+=oa.x,ta+=oa.y);J+=Math.max(1,Math.ceil((ma/qa+va)/(sa.width+1)))*Math.max(1,Math.ceil((ta/qa+Ha)/(sa.height+1)))}ia=ia||J>this.maxPrintPageCount;if(!ia)if(null==u){u=PrintDialog.createPrintPreview(k,Ba,null,0,la,ca,xa);u.title=this.getBaseFilename(!0);u.pageSelector=!1;u.mathEnabled=!1;la=f.border;isNaN(la)||(u.pageMargin=la);var La=u.writeHead;u.writeHead=
+function(k,u,H,P){var U=k.useCssTransforms,W=k.currentTranslate,fa=k.currentScale,X=k.view.translate,ea=k.view.scale;k.useCssTransforms&&(k.useCssTransforms=!1,k.currentTranslate=new mxPoint(0,0),k.currentScale=1,k.view.translate=new mxPoint(0,0),k.view.scale=1);var oa=k.getGraphBounds(),ka=0,ba=0,sa=mxRectangle.fromRectangle(k.pageFormat),xa=f.fit||f.crop||!k.pageVisible,qa=f.scale;sa.width*=k.pageScale;sa.height*=k.pageScale;var Ba=1;if(f.fit){Ba=f.sheetsAcross;var ma=f.sheetsDown;isNaN(qa)||(sa.width=
+Math.ceil(sa.width*qa),sa.height=Math.ceil(sa.height*qa));Ba=Math.min(sa.height*ma/(oa.height/k.view.scale),sa.width*Ba/(oa.width/k.view.scale))}else Ba=isNaN(qa)?1:qa;Ba*=1;!xa&&k.pageVisible?(qa=k.getPageLayout(),ka-=qa.x*sa.width,ba-=qa.y*sa.height):xa=!0;f.crop&&(f.selection&&(oa=q.getBoundingBox(q.getSelectionCells())),sa.width=(oa.width+1)*Ba/k.view.scale,sa.height=(oa.height+1)*Ba/k.view.scale);sa.width*=1;sa.height*=1;P=null!=P?"page/id,"+P:null;oa=f.selection?k.getBoundingBox(k.getSelectionCells()):
+k.getGraphBounds();if(null!=oa){qa=k.view.scale/Ba;ma=oa.width;var ta=oa.height,va=ka,Ga=ba;xa||(va-=k.view.translate.x*Ba,Ga-=k.view.translate.y*Ba,ma+=oa.x,ta+=oa.y);J+=Math.max(1,Math.ceil((ma/qa+va)/(sa.width+1)))*Math.max(1,Math.ceil((ta/qa+Ga)/(sa.height+1)))}ia=ia||J>this.maxPrintPageCount;if(!ia)if(null==u){u=PrintDialog.createPrintPreview(k,Ba,null,0,ka,ba,xa);u.title=this.getBaseFilename(!0);u.pageSelector=!1;u.mathEnabled=!1;ka=f.border;isNaN(ka)||(u.pageMargin=ka);var La=u.writeHead;u.writeHead=
function(Pa,Ka){Ka=null!=Ka?Ka:"";f.shadows||(Ka+='g[style*="filter: drop-shadow("] {\n filter: none !important;\n}\n');mxClient.IS_GC&&(Ka+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=l.fontCss&&(Ka+=l.fontCss);La.apply(this,arguments);for(var Na=k.getCustomFonts(),Oa=0;Oa<Na.length;Oa++){var Ea=Na[Oa].name,Aa=Na[Oa].url;Graph.isCssFontUrl(Aa)?Pa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Aa))+'" charset="UTF-8" type="text/css">'):
(Pa.writeln('<style type="text/css">'),Pa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(Ea))+'";\nsrc: url("'+mxUtils.htmlEntities(Graph.escapeCssString(Aa))+'");\n}'),Pa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Ia=u.drawBackgroundImage;u.drawBackgroundImage=function(Pa){Ia.apply(this,arguments);null!=Pa.node&&(EditorUi.embedSvgImages(Pa.node),q.disableSvgLinks(Pa.node,function(Ka){Ka.setAttribute("href","javascript:void(0)")}))}}var Ca=u.addGraphFragment;
-u.addGraphFragment=function(Pa,Ka,Na,Oa,Ea,Aa){Ca.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Ea.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Ja=Ea.getElementsByTagName("svg"),Ga=0;Ga<Ja.length;Ga++)k.addSvgShadow(Ja[Ga])};f.grid&&(u.gridSize=k.gridSize,u.gridSteps=k.view.gridSteps,u.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:k.view.gridColor);u.isCellVisible=f.selection?function(Pa){return k.isCellSelected(Pa)&&
+u.addGraphFragment=function(Pa,Ka,Na,Oa,Ea,Aa){Ca.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Ea.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Ja=Ea.getElementsByTagName("svg"),Ha=0;Ha<Ja.length;Ha++)k.addSvgShadow(Ja[Ha])};f.grid&&(u.gridSize=k.gridSize,u.gridSteps=k.view.gridSteps,u.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:k.view.gridColor);u.isCellVisible=f.selection?function(Pa){return k.isCellSelected(Pa)&&
k.isCellVisible(Pa)}:function(Pa){return k.isCellVisible(Pa)};u.open(null,null,H,!0,P,sa,f.selection?k.getSelectionCells():null)}else{oa=k.background;if(null==oa||""==oa||oa==mxConstants.NONE)oa="#ffffff";u.backgroundColor=oa;u.autoOrigin=xa;f.grid&&(u.gridSize=k.gridSize,u.gridSteps=k.view.gridSteps,u.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:k.view.gridColor);u.isCellVisible=f.selection?function(Pa){return k.isCellSelected(Pa)&&k.isCellVisible(Pa)}:function(Pa){return k.isCellVisible(Pa)};
-u.appendGraph(k,Ba,la,ca,H,!0,P,sa,f.selection?k.getSelectionCells():null);H=k.getCustomFonts();if(null!=u.wnd)for(sa=0;sa<H.length;sa++)la=H[sa].name,ca=H[sa].url,Graph.isCssFontUrl(ca)?u.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(ca))+'" charset="UTF-8" type="text/css">'):(u.wnd.document.writeln('<style type="text/css">'),u.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(la))+'";\nsrc: url("'+
-mxUtils.htmlEntities(Graph.escapeCssString(ca))+'");\n}'),u.wnd.document.writeln("</style>"))}T&&(k.useCssTransforms=T,k.currentTranslate=W,k.currentScale=fa,k.view.translate=X,k.view.scale=ea);return u}),K=f.pagesFrom,Q=f.pagesTo,V=!f.allPages,J=0,ia=!1;x=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{V&&(V=f.selection||K==A&&Q==A);if(!V&&null!=this.pages&&this.pages.length){V=0;A=this.pages.length-1;f.allPages||(V=parseInt(K)-1,A=parseInt(Q)-1);for(var Y=V;Y<=A&&!ia;Y++){var aa=
-this.pages[Y];K=aa==this.currentPage?q:null;if(null==K){K=this.createTemporaryGraph(q.stylesheet);K.shapeForegroundColor=q.shapeForegroundColor;K.shapeBackgroundColor=q.shapeBackgroundColor;Q=!0;var ja=V=!1,ka=null,ua=null;null==aa.viewState&&null==aa.root&&this.updatePageRoot(aa);null!=aa.viewState&&(Q=aa.viewState.pageVisible,V=aa.viewState.mathEnabled,ja=aa.viewState.shadowVisible,ka=aa.viewState.background,ua=aa.viewState.backgroundImage,K.pageFormat=aa.viewState.pageFormat,K.gridSize=aa.viewState.gridSize,
-K.hiddenTags=aa.viewState.hiddenTags||[]);null!=ua&&null!=ua.originalSrc&&(ua=this.createImageForPageLink(ua.originalSrc,aa));K.background=ka;K.backgroundImage=null!=ua?new mxImage(ua.src,ua.width,ua.height,ua.x,ua.y):null;K.pageVisible=Q;K.mathEnabled=V;K.shadowVisible=ja;var Da=K.getGraphBounds;K.getGraphBounds=function(){var k=Da.apply(this,arguments),u=this.backgroundImage;if(null!=u&&null!=u.width&&null!=u.height){var H=this.view.translate,P=this.view.scale;k=mxRectangle.fromRectangle(k);k.add(new mxRectangle((H.x+
+u.appendGraph(k,Ba,ka,ba,H,!0,P,sa,f.selection?k.getSelectionCells():null);H=k.getCustomFonts();if(null!=u.wnd)for(sa=0;sa<H.length;sa++)ka=H[sa].name,ba=H[sa].url,Graph.isCssFontUrl(ba)?u.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(ba))+'" charset="UTF-8" type="text/css">'):(u.wnd.document.writeln('<style type="text/css">'),u.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(ka))+'";\nsrc: url("'+
+mxUtils.htmlEntities(Graph.escapeCssString(ba))+'");\n}'),u.wnd.document.writeln("</style>"))}U&&(k.useCssTransforms=U,k.currentTranslate=W,k.currentScale=fa,k.view.translate=X,k.view.scale=ea);return u}),K=f.pagesFrom,Q=f.pagesTo,V=!f.allPages,J=0,ia=!1;x=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{V&&(V=f.selection||K==A&&Q==A);if(!V&&null!=this.pages&&this.pages.length){V=0;A=this.pages.length-1;f.allPages||(V=parseInt(K)-1,A=parseInt(Q)-1);for(var Y=V;Y<=A&&!ia;Y++){var aa=
+this.pages[Y];K=aa==this.currentPage?q:null;if(null==K){K=this.createTemporaryGraph(q.stylesheet);K.shapeForegroundColor=q.shapeForegroundColor;K.shapeBackgroundColor=q.shapeBackgroundColor;Q=!0;var ja=V=!1,la=null,ua=null;null==aa.viewState&&null==aa.root&&this.updatePageRoot(aa);null!=aa.viewState&&(Q=aa.viewState.pageVisible,V=aa.viewState.mathEnabled,ja=aa.viewState.shadowVisible,la=aa.viewState.background,ua=aa.viewState.backgroundImage,K.pageFormat=aa.viewState.pageFormat,K.gridSize=aa.viewState.gridSize,
+K.hiddenTags=aa.viewState.hiddenTags||[]);null!=ua&&null!=ua.originalSrc&&(ua=this.createImageForPageLink(ua.originalSrc,aa));K.background=la;K.backgroundImage=null!=ua?new mxImage(ua.src,ua.width,ua.height,ua.x,ua.y):null;K.pageVisible=Q;K.mathEnabled=V;K.shadowVisible=ja;var Da=K.getGraphBounds;K.getGraphBounds=function(){var k=Da.apply(this,arguments),u=this.backgroundImage;if(null!=u&&null!=u.width&&null!=u.height){var H=this.view.translate,P=this.view.scale;k=mxRectangle.fromRectangle(k);k.add(new mxRectangle((H.x+
u.x)*P,(H.y+u.y)*P,u.width*P,u.height*P))}return k};var ha=K.getGlobalVariable;K.getGlobalVariable=function(k){return"page"==k?aa.getName():"pagenumber"==k?Y+1:"pagecount"==k?null!=this.pages?this.pages.length:1:ha.apply(this,arguments)};document.body.appendChild(K.container);this.updatePageRoot(aa);K.model.setRoot(aa.root)}x=E(K,x,Y!=A,aa.getId());K!=q&&K.container.parentNode.removeChild(K.container)}}else x=E(q);if(ia)return null!=x&&null!=x.wnd&&x.wnd!=window&&x.wnd.close(),this.handleError({message:mxResources.get("drawingTooLarge")}),
null;if(null==x||null==x.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});else{x.mathEnabled&&(E=x.wnd.document,c||(x.wnd.IMMEDIATE_PRINT=!0),E.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>'));x.closeDocument();if(Editor.expandPatternsForPrint&&null!=x.wnd)for(E=x.wnd.document.getElementsByTagName("svg"),Y=0;Y<E.length;Y++)Editor.expandSvgPatterns(E[Y]);Graph.rewritePageLinks(x.wnd.document,!0);x.mathEnabled||c||PrintDialog.printPreview(x)}return x}};
EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(q){null!=f&&(f.parentNode.removeChild(f),f=null);q.stopPropagation();q.preventDefault()}),mxEvent.addListener(c[l],"dragover",mxUtils.bind(this,function(q){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(f=this.highlightElement());q.stopPropagation();q.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(q){null!=
@@ -4726,208 +4728,209 @@ translate:x,bounds:l,currentPage:this.getSelectedPageIndex(),scale:q,page:f.view
window.opener||window.parent;if(this.editor.modified){var q=f.background;if(null==q||q==mxConstants.NONE)q=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(x){l.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(x)}),"*")}),null,null,!0,q,1,this.embedExportBorder,null,this.embedExportTheme)}else c||l.postMessage(JSON.stringify({event:"exit",
point:this.embedExitPoint}),"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(x){c||this.handleError(x)}};EditorUi.prototype.whenScriptReady=function(c,f,l){if(c())f();else var q=0,x=window.setInterval(function(){c()?(window.clearInterval(x),f()):100<=++q&&(window.clearInterval(x),
null!=l&&l())},100)};EditorUi.prototype.lastLayoutSpec=null;EditorUi.prototype.resolveLayoutList=function(c){if("string"===typeof c){c=mxUtils.trim(c);if("["==c.charAt(0))return JSON.parse(c);if("undefined"===typeof LibavoidRouting||c!==LibavoidRouting.SHORTHAND&&c!==LibavoidRouting.LAYOUT_NAME){if("parallels"===c)return[{layout:"mxParallelEdgeLayout",config:{checkOverlap:!0}}];if("undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS&&null!=ElkLayout.MENU_PRESETS[c]){c=ElkLayout.MENU_PRESETS[c];
-var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainer=function(){var c=this.editor.graph,f=1==c.getSelectionCount()?c.getSelectionCell():null;return null!=f&&c.model.isVertex(f)&&(c=c.getCellStyle(f).childLayout,
-null!=c&&"tableLayout"!=c&&"stackLayout"!=c&&"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var l=this.editor.graph,q=f,x=null,A=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));q=[];for(var E=0;E<f.length;E++){var K=f[E];if(null!=K&&("mxRadialTreeLayout"==K.layout||"mxOrgChartLayout"==K.layout||"mxFastOrganicLayout"==K.layout||"mxCircleLayout"==K.layout))throw Error("Not supported as childLayout: "+
-K.layout);if(null!=K&&null!=Graph.elkLayoutAlgorithms[K.layout]){var Q={},V;for(V in K.config)Q[V]=K.config[V];delete Q.rootCellIds;delete Q.preserveOrigin;null==Q.resizeNodes&&(Q.resizeNodes=!1);null==Q.resizeLayoutRoot&&(Q.resizeLayoutRoot=!0);"elkLayered"==K.layout&&null==Q.extractIsolated&&(Q.extractIsolated=!1);null!=Q.corners&&(A=Q.corners);if(null!=Q.groupPadding&&(x=String(Q.groupPadding),/[;=]/.test(x)))throw Error("Invalid groupPadding: "+x);K={layout:K.layout,config:Q}}q.push(K)}l.createLayouts(q);
-q=Graph.encodeChildLayout(q)}if(0<=q.indexOf(";"))throw Error("Invalid childLayout: "+q);l.model.beginUpdate();try{var J=l.model.getStyle(c);l.setCellStyles("childLayout",q,[c]);null!=x&&l.setCellStyles("groupPadding",x,[c]);null!=A&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(l,c,A);l.model.getStyle(c)==J&&null!=l.layoutManager&&l.layoutManager.executeLayout(c,!1)}finally{l.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,
-f,l){var q=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS},function(){try{var x=q.resolveLayoutList(c);if(null!=x){q.lastLayoutSpec=x;var A=l?q.getSelectedLayoutContainer():null;null!=A&&Array.isArray(x)&&0<x.length?(q.setContainerChildLayout(A,x),null!=f&&f()):q.executeLayouts(q.editor.graph.createLayouts(x),f)}else q.handleError(Error("Unknown layout: "+c))}catch(E){q.handleError(E)}},function(){q.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};
-EditorUi.prototype.applyChildLayouts=function(c){var f=this.editor.graph,l=function(){try{f.executeAllChildLayouts()}catch(q){null!=window.console&&console.error(q)}null!=c&&c()};(function(){if("undefined"!==typeof ElkLayout)return!1;for(var q=f.getChildLayoutCells(),x=0;x<q.length;x++)try{for(var A=Graph.decodeChildLayout(f.getCellStyle(q[x]).childLayout),E=0;null!=A&&E<A.length;E++)if(null!=A[E]&&"string"===typeof Graph.elkLayoutAlgorithms[A[E].layout])return!0}catch(K){}return!1})()?this.whenScriptReady(function(){return"undefined"!==
-typeof ElkLayout},l,l):l()};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,l=c.ctrlKey||c.metaKey,q=null!=c.key?c.key.toLowerCase():"",x=0;x<f.length;x++){var A=f[x];if(q===String(A.key).toLowerCase()&&l===!!A.ctrl&&c.shiftKey===!!A.shift&&c.altKey===!!A.alt){c.preventDefault();c.stopImmediatePropagation();null!=A.command&&(this.embedMessageSource||
-window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:A.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=
-function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===typeof c.keyCode&&1==c.keyCode.length,l=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(l))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var q=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:
-c.shift?this.altShiftActions:this.altActions;null!=c.action?q[l]=c.action:delete q[l]}else null!=c.action?(q=mxUtils.bind(this,function(){var x=this.actions.get(c.action);null!=x&&x.isEnabled()&&x.funct.apply(this,arguments)}),c.control?c.shift?this.keyHandler.bindControlShiftKey(l,q):this.keyHandler.bindControlKey(l,q):c.shift?this.keyHandler.bindShiftKey(l,q):this.keyHandler.bindKey(l,q)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:
-this.keyHandler.normalKeys)[l];null!=c.action&&(q=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=l&&57>=l||65<=l&&90>=l?String.fromCharCode(l):EditorUi.keyNames[l],null!=q&&null!=f&&(q.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,l=!1,q=!1,x=null,A=null;this.installPassThroughKeys();var E=mxUtils.bind(this,function(V,J){this.editor.modified&&"0"!=urlParams.modified?
-null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,E);mxEvent.addListener(window,"message",mxUtils.bind(this,function(V){if(V.source==(this.embedMessageSource||window.opener||window.parent)){var J=V.data,ia=null,Y=null,aa=mxUtils.bind(this,function(Fa){if(null!=Fa&&"function"===typeof Fa.charAt&&"<"!=Fa.charAt(0))try{Editor.isPngDataUrl(Fa)?
-Fa=Editor.extractGraphModelFromPng(Fa):"data:image/svg+xml;base64,"==Fa.substring(0,26)?Fa=atob(Fa.substring(26)):"data:image/svg+xml;utf8,"==Fa.substring(0,24)&&(Fa=Fa.substring(24)),null!=Fa&&(""==Fa.trim()?Fa=null:"%"==Fa.charAt(0)?Fa=decodeURIComponent(Fa):"<"!=Fa.charAt(0)&&(Fa=Graph.decompress(Fa)))}catch(Ra){}return Fa});if("json"==urlParams.proto){var ja=!1;try{J=JSON.parse(J),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[V],"data",[J])}catch(Fa){J=null}try{var ka=J;if(null==
-J)return;if("dialog"==J.action){this.showError(null!=J.titleKey?mxResources.get(J.titleKey):J.title,null!=J.messageKey?mxResources.get(J.messageKey):mxUtils.htmlEntities(J.message),null!=J.buttonKey?mxResources.get(J.buttonKey):J.button);null!=J.modified&&(this.editor.modified=J.modified);return}if("layout"==J.action){this.executeLayoutSpec(J.layouts,mxUtils.bind(this,function(){var Fa=this.createLoadMessage("layout");Fa.message=J;K.postMessage(JSON.stringify(Fa),"*")}));return}if("prompt"==J.action){this.spinner.stop();
-var ua=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(Fa){null!=Fa?K.postMessage(JSON.stringify({event:"prompt",value:Fa,message:J}),"*"):K.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){K.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(ua.container,300,80,!0,!1);ua.init();return}if("draft"==J.action){var Da=
-aa(J.xml);this.spinner.stop();ua=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),Da,mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"discard",message:J}),"*")}),J.editKey?mxResources.get(J.editKey):null,J.discardKey?mxResources.get(J.discardKey):null,J.ignore?mxUtils.bind(this,function(){this.hideDialog();
-K.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(ua.container,640,480,!0,!1,mxUtils.bind(this,function(Fa){Fa&&this.actions.get("exit").funct()}));try{ua.init()}catch(Fa){K.postMessage(JSON.stringify({event:"draft",error:Fa.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var ha=1==J.enableRecent,k=1==J.enableSearch,u=1==J.enableCustomTemp;ua=new NewDialog(this,!1,J.templatesOnly?!1:null!=J.callback,mxUtils.bind(this,
-function(Fa,Ra,$a,fb){Fa=Fa||this.emptyDiagramXml;null!=J.callback?K.postMessage(JSON.stringify({event:"template",xml:Fa,blank:Fa==this.emptyDiagramXml,name:Ra,tempUrl:$a,libs:fb,builtIn:!0,message:J}),"*"):(c(Fa,V,Fa!=this.emptyDiagramXml,J.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,ha?mxUtils.bind(this,function(Fa){this.remoteInvoke("getRecentDiagrams",[null],null,Fa,function(){Fa(null,"Network Error!")})}):null,k?mxUtils.bind(this,function(Fa,Ra){this.remoteInvoke("searchDiagrams",
-[Fa,null],null,Ra,function(){Ra(null,"Network Error!")})}):null,mxUtils.bind(this,function(Fa,Ra,$a){K.postMessage(JSON.stringify({event:"template",docUrl:Fa,info:Ra,name:$a}),"*")}),null,null,u?mxUtils.bind(this,function(Fa){this.remoteInvoke("getCustomTemplates",null,null,Fa,function(){Fa({},0)})}):null,1==J.withoutType,null,J.templatesOnly);this.showDialog(ua.container,620,460,!0,!1,mxUtils.bind(this,function(Fa){null!=this.sidebar&&this.sidebar.hideTooltip();Fa&&!J.noExitOnCancel&&this.actions.get("exit").funct()}));
-ua.init();return}if("textContent"==J.action){var H=this.getDiagramTextContent();K.postMessage(JSON.stringify({event:"textContent",data:H,message:J}),"*");return}if("status"==J.action){this.updateStatus(mxUtils.bind(this,function(){null!=J.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(J.messageKey))):null!=J.message&&this.editor.setStatus(mxUtils.htmlEntities(J.message))}));null!=J.modified&&(this.editor.modified=J.modified);return}if("spinner"==J.action){var P=null!=J.messageKey?
-mxResources.get(J.messageKey):J.message;null==J.show||J.show?this.spinner.spin(document.body,P):this.spinner.stop();return}if("exit"==J.action){this.actions.get("exit").funct();return}if("viewport"==J.action){if(null!=J.viewport){var T=this.editor.graph,W=T.view.translate.x,fa=T.view.translate.y;this.embedViewport=J.viewport;T.refresh();this.diagramContainer.scrollTop-=(fa-T.view.translate.y)*T.view.scale;this.diagramContainer.scrollLeft-=(W-T.view.translate.x)*T.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==
-J.action){var X=this.actions.get(J.actionName);null!=X&&X.funct();return}if("resetEditor"==J.action){T=this.editor.graph;T.isEditing()&&T.stopEditing(!1);this.hideCurrentMenu();T.popupMenuHandler.hideMenu();T.clearSelection();return}if("fit"==J.action){T=this.editor.graph;var ea=T.maxFitScale;T.maxFitScale=null!=J.maxScale?J.maxScale:1;T.fit(null!=J.border?J.border:16,null,null,null,null,!0);T.maxFitScale=ea;P=this.createLoadMessage("fit");P.message=J;K.postMessage(JSON.stringify(P),"*");return}if("viewbox"==
-J.action){var oa=EditorUi.parseViewBox(J.viewbox);null!=oa&&this.applyViewBox(oa);P=this.createLoadMessage("viewbox");P.message=J;K.postMessage(JSON.stringify(P),"*");return}if("fullscreenChanged"==J.action){var la=null;try{var ca=this.diagramContainer.getAttribute("data-scrollState");null!=ca&&(this.diagramContainer.removeAttribute("data-scrollState"),la=JSON.parse(ca))}catch(Fa){}Editor.inlineFullscreen=J.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=la&&this.restoreScrollState(la);
-return}if("snapshot"==J.action){this.sendEmbeddedSvgExport(!0);return}if("export"==J.action){if("png"==J.format||"xmlpng"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){var sa=null!=J.xml?J.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);T=this.editor.graph;var xa=mxUtils.bind(this,function(Fa,Ra){if(J.withSvg)J.withSvg=!1,this.getEmbeddedSvg(sa,this.editor.graph,null,!0,function(fb){xa(Fa,fb)},null,null,J.embedImages,
-this.editor.graph.background,J.scale,J.border,J.shadow,"auto",null,J.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var $a=this.createLoadMessage("export");$a.format=J.format;$a.message=ka;$a.data=Fa;$a.svg=Ra;$a.xml=sa;K.postMessage(JSON.stringify($a),"*")}}),qa=mxUtils.bind(this,function(Fa){null==Fa&&(Fa=Editor.blankImage);"xmlpng"==J.format&&(Fa=Editor.writeGraphModelToPng(Fa,"tEXt","mxfile",encodeURIComponent(sa)));T!=this.editor.graph&&T.container.parentNode.removeChild(T.container);
-xa(Fa)}),Ba=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ma=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Ba){var Fa=T.getGlobalVariable;T=this.createTemporaryGraph(T.getStylesheet());for(var Ra,$a=0;$a<this.pages.length;$a++)if(this.pages[$a].getId()==Ba){Ra=this.updatePageRoot(this.pages[$a]);break}null==Ra&&(Ra=this.currentPage);T.getGlobalVariable=function(ub){return"page"==ub?
-Ra.getName():"pagenumber"==ub?1:Fa.apply(this,arguments)};document.body.appendChild(T.container);T.model.setRoot(Ra.root)}if(null!=J.layerIds){var fb=T.model,rb=fb.getChildCells(fb.getRoot()),mb=Object.create(null);for($a=0;$a<J.layerIds.length;$a++)mb[J.layerIds[$a]]=!0;for($a=0;$a<rb.length;$a++)fb.setVisible(rb[$a],mb[rb[$a].id]||!1)}$a=null;J.keepTheme&&($a=Editor.isDarkMode()?"dark":"light");null==J.width&&0<this.maxCanvasExportArea&&(rb=T.getGraphBounds(),mb=null!=J.border?J.border:0,fb=Math.ceil(rb.width/
-T.view.scale)+2*mb,rb=Math.ceil(rb.height/T.view.scale)+2*mb,mb=null!=J.scale?J.scale:1,fb*rb*mb*mb>this.maxCanvasExportArea&&(J.scale=Math.sqrt(this.maxCanvasExportArea/(fb*rb))));this.editor.exportToCanvas(mxUtils.bind(this,function(ub){qa(ub.toDataURL("image/png"))}),J.width,null,J.background,mxUtils.bind(this,function(){qa(null)}),null,null,J.scale,J.transparent,J.shadow,null,T,J.border,null,J.grid,$a,J.size)});null!=J.xml&&0<J.xml.length&&(l=!0,this.setFileData(sa),l=!1);ma()}else this.isRemoteExportEnabled()?
-(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==J.format?"1":"0")+(null!=Ba?"&pageId="+Ba:"")+(null!=J.layerIds&&0<J.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:J.layerIds})):"")+(null!=J.scale?"&scale="+J.scale:"")+"&base64=1&xml="+encodeURIComponent(sa))).send(mxUtils.bind(this,function(Fa){200<=Fa.getStatus()&&299>=Fa.getStatus()?xa("data:image/png;base64,"+Fa.getText()):qa(null)}),mxUtils.bind(this,function(){qa(null)})):qa(null)}}else if(ma=mxUtils.bind(this,
-function(){var Fa=this.createLoadMessage("export");Fa.message=J;if("html2"==J.format||"html"==J.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ra=this.getXmlFileData();Fa.xml=mxUtils.getXml(Ra);Fa.data=this.getFileData(null,null,!0,null,null,null,Ra);Fa.format=J.format}else if("html"==J.format)Ra=this.editor.getGraphXml(),Fa.data=this.getHtml(Ra,this.editor.graph),Fa.xml=mxUtils.getXml(Ra),Fa.format=J.format;else{if("xml"==J.format)Fa.xml=this.getFileData(!0),Fa.format=
-J.format,K.postMessage(JSON.stringify(Fa),"*");else if("json"==J.format)Fa.format=J.format,Fa.data=this.createJsonForExport(0!=J.allPages,1==J.includeData,1==J.compressed,1==J.selection),K.postMessage(JSON.stringify(Fa),"*");else{mxSvgCanvas2D.prototype.foAltText=null;var $a=null!=J.background?J.background:this.editor.graph.background;$a==mxConstants.NONE&&($a=null);Fa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);Fa.format="svg";var fb=mxUtils.bind(this,function(Eb){this.editor.graph.setEnabled(!0);
-this.spinner.stop();Fa.data=J.asText?Eb:Editor.createSvgDataUri(Eb);K.postMessage(JSON.stringify(Fa),"*")}),rb="auto";J.keepTheme&&(rb=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(rb=J.theme);if("xmlsvg"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){rb=null;if(this.isAutoDarkMode()||Editor.isDarkMode())rb="auto";null!=J.theme&&(rb=J.theme);this.getEmbeddedSvg(Fa.xml,this.editor.graph,null,!0,fb,null,null,J.embedImages,
-$a,J.scale,J.border,J.shadow,rb,J.embedCellMetadata,J.embedFonts)}}else if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){this.editor.graph.setEnabled(!1);var mb=this.editor.graph.createSvgImageExport(!1,J.embedCellMetadata?!0:!1);Ra=Object.create(null);var ub=this.getSvgWithFontLookup(Ra,mb,mxUtils.bind(this,function(){return this.editor.graph.getSvg($a,J.scale,J.border,null,null,null,null,mb,null,this.editor.graph.shadowVisible||
-J.shadow,null,rb)}));(this.editor.graph.shadowVisible||J.shadow)&&this.editor.graph.addSvgShadow(ub);this.embedFonts(ub,mxUtils.bind(this,function(Eb){J.embedImages||null==J.embedImages?this.editor.convertImages(Eb,mxUtils.bind(this,function(Fb){fb(mxUtils.getXml(Fb))})):fb(mxUtils.getXml(Eb))}),J.embedFonts,Ra)}}return}K.postMessage(JSON.stringify(Fa),"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var ta=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ta.apply(this,arguments);
-ma()}}l=!0;this.setFileData(J.xml);l=!1;this.editor.graph.mathEnabled||ma()}else ma();return}if("load"==J.action){ja=J.toSketch;q=1==J.autosave;this.embedDiffSync=null!=J.diffSync&&!1!==J.diffSync;this.embedDiffSyncPatchOnly="object"===typeof J.diffSync&&null!=J.diffSync&&1==J.diffSync.patchOnly;this.embedExportProtocol=1==J.exportProtocol;var va=J.sourceMetadata||null;Y=null!=J.layout?J.layout:null;this.hideDialog();null!=J.modified&&null==urlParams.modified&&(urlParams.modified=J.modified);null!=
-J.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=J.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=J.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=J.noSaveBtn);
-if(null!=J.rough){var Ha=Editor.sketchMode;this.doSetSketchMode(J.rough);Ha!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=J.dark&&this.setDarkMode(J.dark);null!=J.border&&(this.embedExportBorder=J.border);null!=J.theme&&(this.embedExportTheme=J.theme);null!=J.background&&(this.embedExportBackground=J.background);null!=J.viewport&&(this.embedViewport=J.viewport);this.embedExitPoint=null;var La=EditorUi.parseViewBox(J.viewbox);null==La&&null==J.viewbox&&null==J.scale&&
-null==J.fit&&(La=EditorUi.getViewBoxParam());if(null!=La)ia=mxUtils.bind(this,function(){this.applyViewBox(La)});else if(null!=J.scale){var Ia=J.scale,Ca=null!=J.scaleBorder?J.scaleBorder:this.embedExportBorder||0,Pa=null!=J.border?J.border:0;ia=mxUtils.bind(this,function(){var Fa=this.editor.graph,Ra=Fa.getGraphBounds();if(0<Ra.width&&0<Ra.height){var $a=Fa.view.scale;Fa.view.scaleAndTranslate(Ia,Fa.view.translate.x+Pa-Ra.x/$a+Ca/Ia,Fa.view.translate.y+Pa-Ra.y/$a+Ca/Ia)}})}else if(null!=J.fit){var Ka=
-null!=J.border?J.border:0,Na=J.maxFitScale||1;ia=mxUtils.bind(this,function(){var Fa=this.editor.graph,Ra=Fa.maxFitScale;Fa.maxFitScale=Na;Fa.fit(Ka,null,null,null,null,!0);Fa.maxFitScale=Ra})}if(null!=J.scroll&&null!=J.scroll.x&&null!=J.scroll.y){var Oa=J.scroll,Ea=ia;ia=mxUtils.bind(this,function(){null!=Ea&&Ea();var Fa=this.editor.graph,Ra=Fa.view.scale,$a=Fa.view.translate;mxUtils.hasScrollbars(Fa.container)?(Fa.container.scrollLeft=($a.x+Oa.x)*Ra,Fa.container.scrollTop=($a.y+Oa.y)*Ra):Fa.view.setTranslate(-Oa.x,
--Oa.y)})}if(null!=J.rect){Pa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,J.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,J.rect.top)+"px";this.minInlineWidth=J.minWidth;this.minInlineHeight=J.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Aa=J.maxFitScale,Ja=J.rect.width+2*Pa,Ga=J.rect.height+2*Pa;ia=mxUtils.bind(this,function(){var Fa=mxUtils.getDocumentSize();Ja=
-Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,Ja):Ja,Fa.width-80);Fa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Ga):Ga,Fa.height-80);this.diagramContainer.style.width=Ja+"px";this.diagramContainer.style.height=Fa+"px";var Ra=this.editor.graph;Fa=Ra.maxFitScale;Ra.maxFitScale=Aa;Ra.fit(2*Pa,null,null,null,null,null,Ga);this.setPageVisible("1"==urlParams.pv);if(null!=this.minInlineWidth&&Ra.getGraphBounds().width<this.minInlineWidth){var $a=Ra.container.scrollTop;
-this.resetScrollbars();Ra.container.scrollTop=$a}Ra.maxFitScale=Fa;Ra.container.scrollTop-=Pa;Ra.container.scrollLeft-=Pa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[J]));Ra.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Ra.container.style.top);var fb=Ra.getGraphBounds();Ra.container.clientWidth>fb.width+2*Pa&&(Ra.container.scrollLeft=
-fb.x+(fb.width+Pa-Ra.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&this.setEmbedTitle(J.title);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(Fa){}if(null!=J.xmlpng)J=this.extractGraphModelFromPng(J.xmlpng);else if(null!=J.descriptor){if(J=J.descriptor,"mermaid"==J.format){if(EditorUi.isMermaidSupported()){var Ua=mxUtils.bind(this,function(Fa){c(Fa,V,null,ja);Fa=this.createLoadMessage("load");
-Fa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);Fa.message=ka;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Fa),"*");if(null!=va&&null!=va.key&&null!=va.value){Fa=this.editor.graph;var Ra=Fa.getModel().getRoot();if(null!=Ra){Fa.getModel().beginUpdate();try{Fa.setAttributeForCell(Ra,va.key,va.value)}finally{Fa.getModel().endUpdate()}}}}),ab=mxUtils.bind(this,function(Fa){this.handleError(Fa)});J.image?this.parseMermaidImage(J.data,Ua,ab):
-this.parseMermaidDiagram(J.data,null,mxUtils.bind(this,function(Fa){J.wrap&&(Fa=mxMermaidToDrawio.wrapGroup(Fa,J.data,EditorUi.getInsertMermaidConfig(),{normalize:!0}));Ua(Fa)}),ab)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else J=J.xml}else{if("merge"==J.action){var Wa=this.getCurrentFile();null!=Wa&&(Da=aa(J.xml),null!=Da&&""!=Da&&Wa.mergeFile(new LocalFile(this,Da),mxUtils.bind(this,function(){this.embedDiffSync&&
-(A=this.clonePages(this.pages),x=hb());K.postMessage(JSON.stringify({event:"merge",message:J}),"*")}),function(Fa){K.postMessage(JSON.stringify({event:"merge",message:J,error:Fa}),"*")}))}else if("patch"==J.action){if(Wa=this.getCurrentFile(),null!=Wa&&null!=J.patch)try{l=!0,Wa.patch([J.patch]),this.embedDiffSync&&null!=A&&(A=this.applyPatches(A,[J.patch])),x=hb(),l=!1,ca={event:"patch",message:J},la=this.getHashValueForPages(this.pages),ca.checksum=la,null!=J.checksum&&J.checksum!=la&&(ca.checksumMismatch=
-!0),K.postMessage(JSON.stringify(ca),"*")}catch(Fa){l=!1,K.postMessage(JSON.stringify({event:"patch",message:J,error:Fa.message||Fa.toString()}),"*")}}else if("getDiff"==J.action){P={event:"getDiff",message:J};if(this.embedDiffSync&&null!=A){var cb=this.clonePages(this.pages);P.patch=this.diffPages(A,cb);P.checksum=this.getHashValueForPages(cb)}else P.xml=hb();K.postMessage(JSON.stringify(P),"*")}else"resetDiff"==J.action?this.embedDiffSync&&(null!=J.xml?(Da=aa(J.xml),Wa=this.getCurrentFile(),null!=
-Da&&""!=Da&&null!=Wa&&Wa.mergeFile(new LocalFile(this,Da),mxUtils.bind(this,function(){A=this.clonePages(this.pages);x=hb();K.postMessage(JSON.stringify({event:"resetDiff",message:J,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(Fa){K.postMessage(JSON.stringify({event:"resetDiff",message:J,error:Fa}),"*")})):(A=this.clonePages(this.pages),x=hb(),K.postMessage(JSON.stringify({event:"resetDiff",message:J,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==
-J.action?this.handleRemoteInvokeReady(K):"remoteInvoke"==J.action?this.handleRemoteInvoke(J,V.origin):"remoteInvokeResponse"==J.action?this.handleRemoteInvokeResponse(J):K.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(J)}),"*");return}}catch(Fa){this.handleError(Fa)}}var hb=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),wb=mxUtils.bind(this,function(Fa,Ra){l=!0;
-try{c(Fa,Ra,null,ja)}catch($a){this.handleError($a)}l=!1;this.editor.graph.model.prefix=Editor.guid()+"-";Ra=mxUtils.bind(this,function(){null!=urlParams.modified&&this.clearStatus();x=hb();this.embedDiffSync&&(A=this.clonePages(this.pages));q&&null==f&&(f=mxUtils.bind(this,function(fb,rb){fb=hb();if(fb!=x&&!l){rb=this.createLoadMessage("autosave");rb.message=ka;if(this.embedDiffSync&&null!=A){var mb=this.clonePages(this.pages),ub=this.diffPages(A,mb);mxUtils.isEmptyObject(ub)?rb.xml=fb:(rb.patch=
-ub,rb.checksum=this.getHashValueForPages(mb),this.embedDiffSyncPatchOnly||(rb.xml=fb));A=mb}else rb.xml=fb;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(rb),"*")}x=fb}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",
-f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("tooltipsEnabledChanged",f),this.addListener("pageViewChanged",f),this.addListener("connectionPointsChanged",f),this.addListener("connectionArrowsChanged",f));null!=ia&&ia();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var $a=this.createLoadMessage("load");$a.xml=null!=Y?hb():Fa;this.embedDiffSync&&
-null!=this.pages&&($a.checksum=this.getHashValueForPages(this.pages));K.postMessage(JSON.stringify($a),"*")}});null!=Y?this.executeLayoutSpec(Y,Ra):Ra()});null!=J&&"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,34)?(aa="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(Fa){wb(Fa,V)},mxUtils.bind(this,function(Fa){this.handleError(Fa)}),aa)):null!=J&&"function"===typeof J.substring&&
-this.isGliffyData(J,"")?this.importGliffy(J,mxUtils.bind(this,function(Fa){"<mxGraphModel"==Fa.substring(0,13)?wb(Fa,V):this.handleError({message:mxResources.get("unknownError")})}),mxUtils.bind(this,function(Fa){this.handleError({message:null!=Fa&&413==Fa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")})}),""):null!=J&&"function"===typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(Fa){wb(Fa)}),mxUtils.bind(this,function(Fa){this.handleError(Fa)})):
-null==J||"object"!==typeof J||null==J.format||null==J.data&&null==J.url?(J=aa(J),wb(J,V)):this.loadDescriptor(J,mxUtils.bind(this,function(Fa){wb(hb(),V)}),mxUtils.bind(this,function(Fa){this.handleError(Fa,mxResources.get("errorLoadingFile"))}))}}));var K=this.embedMessageSource||window.opener||window.parent;E="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";K.postMessage(E,"*");if("json"==urlParams.proto){var Q=this.editor.graph.openLink;this.editor.graph.openLink=
-function(V,J,ia){Q.apply(this,arguments);K.postMessage(JSON.stringify({event:"openLink",href:V,target:J,allowOpener:ia}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(V){for(var J=mxEvent.getSource(V);null!=J&&"A"!=J.nodeName;)J=J.parentNode;if(null!=J){var ia=J.getAttribute("href");null==ia||"#"==ia.charAt(0)||"javascript:"==ia.substring(0,11)||this.editor.graph.isCustomLink(ia)||(V.preventDefault(),this.editor.graph.openLink(ia,J.getAttribute("target")))}}),
-!0)}};EditorUi.prototype.createEmbedButton=function(c,f,l,q){var x=document.createElement("button");x.className="geEmbedBtn geBtn";x.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(x,c);q&&x.classList.add("gePrimaryBtn");mxEvent.addListener(x,"click",f);return x};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?
-this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?
-"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),
-this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));
-this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var q=JSON.parse(l),x=this.getSelectedLayoutContainer();null!=x&&Array.isArray(q)&&0<q.length?this.setContainerChildLayout(x,q):this.executeLayouts(this.editor.graph.createLayouts(q));
-this.lastLayoutSpec=this.customLayoutConfig=q;this.hideDialog()}catch(A){this.handleError(A)}}),null,null,null,null,mxUtils.bind(this,function(l,q){var x=this.createLayoutAddSelect(q);l.appendChild(x);x=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var A=q.value;q.value=JSON.stringify(JSON.parse(A));q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));
-q.value=A}catch(E){this.handleError(E)}}));x.setAttribute("title","copy");x.className="geBtn";l.appendChild(x)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var l={},q=0;q<f.length;q++)null!=f[q]&&(l[f[q].id]=!0);var x=function(A){return null!=
-A&&!0===l[A.id]};for(q=0;q<c.length;q++)f=c[q],"undefined"!==typeof ElkLayout&&f instanceof ElkLayout||void 0!==f.cellFilter?f.cellFilter=x:"function"===typeof f.isVertexIgnored&&function(A){var E=A.isVertexIgnored;A.isVertexIgnored=function(K){return E.apply(this,arguments)||!x(K)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,l=document.createElement("select");l.className="geBtn";l.style.marginRight="8px";l.style.maxWidth="180px";var q=document.createElement("option");q.value=
-"";mxUtils.write(q,mxResources.get("add")+"...");q.disabled=!0;q.selected=!0;l.appendChild(q);var x=[];"undefined"!==typeof ElkLayout&&(q=function(E,K){var Q=ElkLayout.MENU_PRESETS[E];return{label:E,kind:"elk",algo:Q.algorithm,preset:Q.options,layoutName:K}},x.push(q("verticalFlow","elkLayered")),x.push(q("horizontalFlow","elkLayered")),x.push(q("verticalTree","elkTree")),x.push(q("horizontalTree","elkTree")),x.push(q("radialTree","elkRadial")),x.push(q("organic","elkOrganic")));x.push({label:"orgChart",
-kind:"orgchart"});x.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});x.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&x.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(q=0;q<x.length;q++){var A=document.createElement("option");A.value=String(q);mxUtils.write(A,mxResources.get(x[q].label)+("elk"===x[q].kind||"orgchart"===
-x[q].kind?"...":""));l.appendChild(A)}mxEvent.addListener(l,"change",mxUtils.bind(this,function(){var E=parseInt(l.value);l.selectedIndex=0;if(!(isNaN(E)||0>E||E>=x.length)){var K=x[E],Q=c.value;if(0===mxUtils.trim(Q).length)var V=[];else{try{V=JSON.parse(Q)}catch(ia){f.handleError(ia);return}if(!Array.isArray(V)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var J=mxUtils.bind(this,function(ia){V.push(ia);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(V,null,
-2))});E=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(Q)});"elk"===K.kind?(f.hideDialog(),ElkLayout.runWithDialog(f,K.algo,K.preset,mxResources.get(K.label),function(ia,Y){ia=Graph.elkOptionsToConfig(ia,Y);J({layout:K.layoutName,config:ia})},E)):"orgchart"===K.kind?(f.hideDialog(),f.showOrgChartConfigDialog(J,E)):J({layout:K.layoutName,config:K.config||{}})}}));return l};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var l=2,q=20,x=20,A=document.createElement("div"),
-E=function(aa,ja){var ka=document.createElement("div");ka.style.marginTop="6px";ka.style.display="inline-block";ka.style.width="180px";mxUtils.write(ka,mxResources.get(aa)+": ");A.appendChild(ka);A.appendChild(ja)},K=document.createElement("select");K.style.width="160px";K.style.boxSizing="border-box";for(var Q=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),
-mxResources.get("smart")],V=0;V<Q.length;V++){var J=document.createElement("option");mxUtils.write(J,Q[V]);J.value=V;2===V&&J.setAttribute("selected","selected");K.appendChild(J)}mxEvent.addListener(K,"change",function(){l=parseInt(K.value)});E("orgChartType",K);var ia=document.createElement("input");ia.type="number";ia.value=q;ia.style.width="160px";ia.style.boxSizing="border-box";mxEvent.addListener(ia,"change",function(){q=parseInt(ia.value)});E("parentChildSpacing",ia);var Y=document.createElement("input");
-Y.type="number";Y.value=x;Y.style.width="160px";Y.style.boxSizing="border-box";mxEvent.addListener(Y,"change",function(){x=parseInt(Y.value)});E("siblingSpacing",Y);f=new CustomDialog(this,A,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:l,parentChildSpacing:q,siblingSpacing:x}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,
-mxUtils.bind(this,function(l){var q=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),x=mxUtils.bind(this,function(A){this.loadingOrgChart=!1;l.clear()&&this.handleError(A)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))q();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",
-function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",q,null,null,null,x)},null,null,null,x)},null,null,null,x)},null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",q,null,null,null,x)}),onerror)};EditorUi.prototype.importCsv=function(c,f,l,q){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,l)}),q)};EditorUi.prototype.doImportCsv=function(c,f,l){try{var q=c.split("\n"),x=[],A=[],E=[],K=Object.create(null);
-if(0<q.length){var Q=Object.create(null);l=null!=l?l:this.editor.graph;var V=null,J=null,ia=null,Y=null,aa=null,ja=null,ka=null,ua="whiteSpace=wrap;html=1;",Da=null,ha=null,k="",u="auto",H="auto",P=!1,T=null,W=null,fa=40,X=40,ea=100,oa=0,la=mxUtils.bind(this,function(){null!=f?f($a):(l.setSelectionCells($a),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ca=l.getFreeInsertPoint(!0),sa=ca.x,xa=
-ca.y;ca=xa;var qa=null,Ba="auto";ha=null;for(var ma=[],ta=null,va=null,Ha=0;Ha<q.length&&"#"==q[Ha].charAt(0);){c=q[Ha].replace(/\r$/,"");for(Ha++;Ha<q.length&&"\\"==c.charAt(c.length-1)&&"#"==q[Ha].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(q[Ha].substring(1)),Ha++;if("#"!=c.charAt(1)){var La=c.indexOf(":");if(0<La){var Ia=mxUtils.trim(c.substring(1,La)),Ca=mxUtils.trim(c.substring(La+1));"label"==Ia?qa=Graph.sanitizeHtml(Ca):"labelname"==Ia&&0<Ca.length&&"-"!=Ca?aa=Ca:"labels"==Ia&&0<Ca.length&&
-"-"!=Ca?ka=JSON.parse(Ca):"style"==Ia?J=Ca:"parentstyle"==Ia?ua=Ca:"unknownStyle"==Ia&&"-"!=Ca?ja=Ca:"stylename"==Ia&&0<Ca.length&&"-"!=Ca?Y=Ca:"styles"==Ia&&0<Ca.length&&"-"!=Ca?ia=JSON.parse(Ca):"vars"==Ia&&0<Ca.length&&"-"!=Ca?V=JSON.parse(Ca):"identity"==Ia&&0<Ca.length&&"-"!=Ca?Da=Ca:"parent"==Ia&&0<Ca.length&&"-"!=Ca?ha=Ca:"namespace"==Ia&&0<Ca.length&&"-"!=Ca?k=Ca:"width"==Ia?u=Ca:"height"==Ia?H=Ca:"collapsed"==Ia&&"-"!=Ca?P="true"==Ca:"left"==Ia&&0<Ca.length?T=Ca:"top"==Ia&&0<Ca.length?W=
-Ca:"ignore"==Ia?va=Ca.split(","):"connect"==Ia?ma.push(JSON.parse(Ca)):"link"==Ia?ta=Ca:"padding"==Ia?oa=parseFloat(Ca):"edgespacing"==Ia?fa=parseFloat(Ca):"nodespacing"==Ia?X=parseFloat(Ca):"levelspacing"==Ia?ea=parseFloat(Ca):"layout"==Ia&&(Ba=Ca)}}}if(null==q[Ha])throw Error(mxResources.get("invalidOrMissingFile"));var Pa=this.editor.csvToArray(q[Ha].replace(/\r$/,""));La=c=null;Ia=[];for(Ca=0;Ca<Pa.length;Ca++)Da==Pa[Ca]&&(c=Ca),ha==Pa[Ca]&&(La=Ca),Ia.push(mxUtils.trim(Pa[Ca]).replace(/[^a-z0-9]+/ig,
-"_").replace(/^\d+/,"").replace(/_+$/,""));null==qa&&(qa="%"+Ia[0]+"%");if(null!=ma)for(var Ka=0;Ka<ma.length;Ka++)null==Q[ma[Ka].to]&&(Q[ma[Ka].to]=Object.create(null));Da=[];for(Ca=Ha+1;Ca<q.length;Ca++){var Na=this.editor.csvToArray(q[Ca].replace(/\r$/,""));if(null==Na){var Oa=40<q[Ca].length?q[Ca].substring(0,40)+"...":q[Ca];throw Error(Oa+" ("+Ca+"):\n"+mxResources.get("containsValidationErrors"));}0<Na.length&&Da.push(Na)}l.model.beginUpdate();try{for(Ca=0;Ca<Da.length;Ca++){Na=Da[Ca];var Ea=
-null,Aa=null!=c?k+Na[c]:null;q=!1;null!=Aa&&(Ea=l.model.getCell(Aa),q=null==Ea||0<=mxUtils.indexOf(x,Ea));var Ja=new mxCell(qa,new mxGeometry(sa,ca,0,0),J||"whiteSpace=wrap;html=1;");Ja.collapsed=P;Ja.vertex=!0;Ja.id=Aa;null==Ea||q||l.model.setCollapsed(Ea,P);for(var Ga=0;Ga<Na.length;Ga++)l.setAttributeForCell(Ja,Ia[Ga],Na[Ga]),null==Ea||q||l.setAttributeForCell(Ea,Ia[Ga],Na[Ga]);if(null!=aa&&null!=ka){var Ua=Ja.getAttribute(aa),ab=null!=Ua&&Object.prototype.hasOwnProperty.call(ka,Ua)?ka[Ua]:null;
-null!=ab&&(l.labelChanged(Ja,ab),null==Ea||q||l.cellLabelChanged(Ea,ab))}if(null!=Y&&null!=ia){var Wa=Ja.getAttribute(Y),cb=null!=Wa&&Object.prototype.hasOwnProperty.call(ia,Wa)?ia[Wa]:null;null!=cb&&(Ja.style=cb)}l.setAttributeForCell(Ja,"placeholders","1");Ja.style=l.replacePlaceholders(Ja,Ja.style,V);null==Ea||q?l.fireEvent(new mxEventObject("cellsInserted","cells",[Ja])):(l.model.setStyle(Ea,Ja.style),0>mxUtils.indexOf(E,Ea)&&E.push(Ea),l.fireEvent(new mxEventObject("cellsInserted","cells",[Ea])));
-q=null!=Ea;Ea=Ja;if(!q)for(Ka=0;Ka<ma.length;Ka++)Q[ma[Ka].to][Ea.getAttribute(ma[Ka].to)]=Ea;null!=ta&&"link"!=ta&&(l.setLinkForCell(Ea,Ea.getAttribute(ta)),l.setAttributeForCell(Ea,ta,null));var hb=l.getPreferredSizeForCell(Ea);ha=null!=La?l.model.getCell(k+Na[La]):null;if(Ea.vertex){Oa=null!=ha?0:sa;Ha=null!=ha?0:xa;null!=T&&null!=Ea.getAttribute(T)&&(Ea.geometry.x=Oa+parseFloat(Ea.getAttribute(T)));null!=W&&null!=Ea.getAttribute(W)&&(Ea.geometry.y=Ha+parseFloat(Ea.getAttribute(W)));var wb="@"==
-u.charAt(0)?Ea.getAttribute(u.substring(1)):null;Ea.geometry.width=null!=wb&&"auto"!=wb?parseFloat(Ea.getAttribute(u.substring(1))):"auto"==u||"auto"==wb?hb.width+oa:parseFloat(u);var Fa="@"==H.charAt(0)?Ea.getAttribute(H.substring(1)):null;Ea.geometry.height=null!=Fa&&"auto"!=Fa&&"width"!=H?parseFloat(Fa):"auto"==H||"auto"==Fa?hb.height+oa:"width"==H?Ea.geometry.width:parseFloat(H);ca+=Ea.geometry.height+X}q?(null==K[Aa]&&(K[Aa]=[]),K[Aa].push(Ea)):(x.push(Ea),null!=ha?(ha.style=l.replacePlaceholders(ha,
-ua,V),l.addCell(Ea,ha),A.push(ha)):E.push(l.addCell(Ea)))}for(Ca=0;Ca<A.length;Ca++)wb="@"==u.charAt(0)?A[Ca].getAttribute(u.substring(1)):null,Fa="@"==H.charAt(0)?A[Ca].getAttribute(H.substring(1)):null,"auto"!=u&&"auto"!=wb||"auto"!=H&&"auto"!=Fa||l.updateGroupBounds([A[Ca]],oa,!0);var Ra=E.slice(),$a=E.slice();for(Ka=0;Ka<ma.length;Ka++){var fb=ma[Ka];for(Ca=0;Ca<x.length;Ca++){Ea=x[Ca];var rb=mxUtils.bind(this,function(Bb,Ib,Ab){var Db=Ib.getAttribute(Ab.from);if(null!=Db&&""!=Db){Db=Db.split(",");
-for(var z=0;z<Db.length;z++){var L=Q[Ab.to][Db[z]];if(null==L&&null!=ja){L=new mxCell(Db[z],new mxGeometry(sa,xa,0,0),ja);L.style=l.replacePlaceholders(Ib,L.style,V);var M=l.getPreferredSizeForCell(L);L.geometry.width=M.width+oa;L.geometry.height=M.height+oa;Q[Ab.to][Db[z]]=L;L.vertex=!0;L.id=Db[z];E.push(l.addCell(L))}if(null!=L){M=Ab.label;null!=Ab.fromlabel&&(M=(Ib.getAttribute(Ab.fromlabel)||"")+(M||""));null!=Ab.sourcelabel&&(M=l.replacePlaceholders(Ib,Ab.sourcelabel,V)+(M||""));null!=Ab.tolabel&&
-(M=(M||"")+(L.getAttribute(Ab.tolabel)||""));null!=Ab.targetlabel&&(M=(M||"")+l.replacePlaceholders(L,Ab.targetlabel,V));var S="target"==Ab.placeholders==!Ab.invert?L:Bb;S=null!=Ab.style?l.replacePlaceholders(S,Ab.style,V):l.createCurrentEdgeStyle();M=l.insertEdge(null,null,M||"",Ab.invert?L:Bb,Ab.invert?Bb:L,S);if(null!=Ab.labels)for(S=0;S<Ab.labels.length;S++){var Z=Ab.labels[S],da=new mxCell(Z.label||S,new mxGeometry(null!=Z.x?Z.x:0,null!=Z.y?Z.y:0,0,0),"resizable=0;html=1;");da.vertex=!0;da.connectable=
-!1;da.geometry.relative=!0;null!=Z.placeholders&&(da.value=l.replacePlaceholders("target"==Z.placeholders==!Ab.invert?L:Bb,da.value,V));if(null!=Z.dx||null!=Z.dy)da.geometry.offset=new mxPoint(null!=Z.dx?Z.dx:0,null!=Z.dy?Z.dy:0);M.insert(da)}if(null!=Ab.data)for(var na in Ab.data)l.setAttributeForCell(M,na,Ab.data[na]);$a.push(M);mxUtils.remove(Ab.invert?Bb:L,Ra)}}}});rb(Ea,Ea,fb);if(null!=K[Ea.id])for(Ga=0;Ga<K[Ea.id].length;Ga++)rb(Ea,K[Ea.id][Ga],fb)}}if(null!=va)for(Ca=0;Ca<x.length;Ca++)for(Ea=
-x[Ca],Ga=0;Ga<va.length;Ga++)l.setAttributeForCell(Ea,mxUtils.trim(va[Ga]),null);if(0<E.length){var mb=new mxParallelEdgeLayout(l);mb.spacing=fa;mb.checkOverlap=!0;var ub=function(){0<mb.spacing&&mb.execute(l.getDefaultParent());var Bb=0,Ib=0;0<E.length&&(Ib=l.getCellGeometry(E[0]),Bb=Math.round(l.snap(Ib.x))-Ib.x,Ib=Math.round(l.snap(Ib.y))-Ib.y);for(var Ab=0;Ab<E.length;Ab++){var Db=l.getCellGeometry(E[Ab]);Db.x=Math.round(Db.x+Bb);Db.y=Math.round(Db.y+Ib);"auto"==u&&(Db.width=Math.round(l.snap(Db.width)));
-"auto"==H&&(Db.height=Math.round(l.snap(Db.height)))}};"auto"==Ba&&1==Ra.length&&(Ba=$a.length==2*E.length-1?"verticaltree":"verticalflow");var Eb="organic"==Ba||null!=EditorUi.CSV_ELK_LAYOUTS[Ba]?null:this.resolveLayoutList(Ba);if(null!=Eb){var Fb=la;l.view.validate();var Tb=l.createLayouts(Eb);this.scopeLayoutsToCells(Tb,$a);this.executeLayouts(Tb,function(){ub();Fb()});la=null}else if("circle"==Ba){var Rb=new mxCircleLayout(l);Rb.disableEdgeStyle=!1;Rb.resetEdges=!1;var $b=Rb.isVertexIgnored;Rb.isVertexIgnored=
-function(Bb){return $b.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Rb.execute(l.getDefaultParent());ub()},!0,la);la=null}else if("verticaltree"==Ba||"horizontaltree"==Ba){l.view.validate();var Mb=new mxCompactTreeLayout(l,"horizontaltree"==Ba);Mb.levelDistance=X;Mb.edgeRouting=!1;Mb.resetEdges=!1;Mb.sortEdges=!0;var Wb=Mb.isVertexIgnored;Mb.isVertexIgnored=function(Bb){return Wb.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Mb.execute(l.getDefaultParent(),
-0<Ra.length?Ra[0]:null)},!0,la);la=null}else if("orgchart"==Ba){l.view.validate();var zb=new mxOrgChartLayout(l,2,ea,X),Ub=zb.isVertexIgnored;zb.isVertexIgnored=function(Bb){return Ub.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){zb.execute(l.getDefaultParent());ub()},!0,la);la=null}else if("organic"==Ba||"auto"==Ba&&$a.length>E.length){l.view.validate();var Lb=new mxFastOrganicLayout(l);Lb.forceConstant=3*X;Lb.disableEdgeStyle=!1;Lb.resetEdges=!1;var Xb=Lb.isVertexIgnored;
-Lb.isVertexIgnored=function(Bb){return Xb.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Lb.execute(l.getDefaultParent());ub()},!0,la);la=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[Ba]){l.view.validate();Fb=la;var bc=EditorUi.CSV_ELK_LAYOUTS[Ba],Hb=mxUtils.clone(bc.config);Hb["elk.spacing.nodeNode"]=X;Hb["elk.layered.spacing.nodeNodeBetweenLayers"]=ea;Hb["elk.spacing.edgeEdge"]=fa;Hb["elk.layered.spacing.edgeEdgeBetweenLayers"]=fa;var Ob=l.createLayouts([{layout:bc.layout,
-config:Hb}]);this.scopeLayoutsToCells(Ob,$a);l.model.beginUpdate();var ac=!1,Zb=function(){ac||(ac=!0,l.model.endUpdate())},Vb=this;try{Ob[0].prepare(l.getDefaultParent(),function(Bb,Ib){null!=Bb?(Zb(),Vb.handleError(Bb)):Vb.executeLayout(function(){Ib();var Ab=l.getBoundingBoxFromGeometry($a);null!=Ab&&l.moveCells($a,sa-Ab.x,xa-Ab.y)},!0,function(){Zb();Fb()})})}catch(Bb){throw Zb(),Bb;}la=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=la&&la()}}catch(Bb){this.handleError(Bb)}};EditorUi.prototype.getSearch=
-function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",q;for(q in urlParams)0>mxUtils.indexOf(c,q)&&null!=urlParams[q]&&(f+=l+q+"="+urlParams[q],l="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
-q;for(q in urlParams)0>mxUtils.indexOf(l,q)&&(c=0==f?c+"?":c+"&",null!=urlParams[q]&&(c+=q+"="+urlParams[q],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,l,q,x){c=new LinkDialog(this,c,f,l,!0,q,x);this.showDialog(c.container,440,null,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||
-f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());
-this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);
-this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=
-function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:
-c[f].expand)};var N=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){N.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),l=this.getSelectionState(),q=this.isDiagramActive(),x="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&x);this.actions.get("redo").setEnabled(this.canRedo()&&x);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());
-this.actions.get("guides").setEnabled(q);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(q&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(q&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(q&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(q&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(q&&
-l.image&&0<l.cells.length);this.actions.get("pageSetup").setEnabled(q);this.actions.get("shadowVisible").setEnabled(q);this.actions.get("connectionArrows").setEnabled(q);this.actions.get("connectionPoints").setEnabled(q);this.actions.get("copyStyle").setEnabled(q&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&q&&0<l.cells.length);this.actions.get("copyTextStyle").setEnabled(q&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&
-q&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length&&!l.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<l.cells.length);this.actions.get("createShape").setEnabled(q);this.actions.get("createRevision").setEnabled(q);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(q&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=
-f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=
-f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(q&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var R=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),
-this.exportDialog=null);R.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,q,x,A,E,K){var Q=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(Q.getSvg(q,x,A)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),J=Q.getGraphBounds(),ia=Math.floor(J.width*x/
-Q.view.scale),Y=Math.floor(J.height*x/Q.view.scale);if(V.length<=MAX_REQUEST_SIZE&&ia*Y<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas())if(c.isRemoteExportEnabled()){var aa={globalVars:Q.getExportVariables()};K&&(aa.grid={size:Q.gridSize,steps:Q.view.gridSteps,color:Q.view.gridColor});c.saveRequest(f,l,function(ja,ka){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(ka||"0")+(null!=ja?"&filename="+encodeURIComponent(ja):"")+"&extras="+encodeURIComponent(JSON.stringify(aa))+
-(0<E?"&dpi="+E:"")+"&bg="+(null!=q?q:"none")+"&w="+ia+"&h="+Y+"&border="+A+"&xml="+encodeURIComponent(V))})}else c.handleError({message:mxResources.get("notAvailable")});else"png"==l?c.exportImage(x,null==q||"none"==q,!0,!1,!1,A,!0,!1,null,K,E):c.exportImage(x,!1,!0,!1,!1,A,!0,!1,"jpeg",K);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var q=
-c;this.currentPage!=this.pages[l]&&(q=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),q.model.setRoot(this.pages[l].root));f+=this.pages[l].getName()+" "+q.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,l){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){l.label=
-mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));l.html=f;return}l.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var l={id:c.getId()};l.type=f?"layer":c.edge?"edge":c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(l.parent=f.getId()));c.edge&&(null!=c.source&&(l.source=c.source.getId()),null!=c.target&&(l.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),l);c=f.attributes;f={};for(var q=0,x=0;x<c.length;x++){var A=
-c[x].nodeName;"label"!=A&&"placeholders"!=A&&"id"!=A&&(f[A]=c[x].nodeValue,q++)}0<q&&(l.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,l);return l};EditorUi.prototype.getJsonForPage=function(c,f){var l=this.editor.graph.getModel();var q=null==c||c==this.currentPage?l.getRoot():this.updatePageRoot(c).root;var x=[],A=mxUtils.bind(this,function(J,ia){x.push(this.getJsonForExportCell(J,ia));ia=J.getChildCount();for(var Y=0;Y<ia;Y++)A(J.getChildAt(Y),!1)});if(null!=f){q={};for(var E=0;E<
-f.length;E++)q[f[E].getId()]=!0;for(E=0;E<f.length;E++){for(var K=f[E],Q=K.getParent(),V=!1;null!=Q;){if(q[Q.getId()]){V=!0;break}Q=Q.getParent()}V||A(K,l.isLayer(K))}}else for(f=q.getChildCount(),E=0;E<f;E++)A(q.getChildAt(E),!0);E={};null!=c&&(E.id=c.getId(),E.name=c.getName());E.cells=x;return E};EditorUi.prototype.createJsonForExport=function(c,f,l,q){var x={version:EditorUi.VERSION};f&&(x.data=mxUtils.getXml(this.getXmlFileData(!q,!c,!l)));f=[];if(q)f.push(this.getJsonForPage(this.currentPage,
-this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));x.pages=f;return x};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},l=document.createElement("div");l.style.whiteSpace="nowrap";var q=document.createElement("h3");mxUtils.write(q,mxUtils.htmlEntities(c));l.appendChild(q);var x=document.createElement("div");x.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";
-x.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var A={};try{var E=mxSettings.getCustomLibraries();for(c=0;c<E.length;c++){var K=E[c];if("R"==K.substring(0,1)){var Q=JSON.parse(decodeURIComponent(K.substring(1)));A[Q[0]]={id:Q[0],title:Q[1],downloadUrl:Q[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){x.innerText="";if(0==V.length)x.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+
-"</div>";else for(var J=0;J<V.length;J++){var ia=V[J];A[ia.id]&&(f[ia.id]=ia);var Y=this.addCheckbox(x,ia.title,A[ia.id]);(function(aa,ja){mxEvent.addListener(ja,"change",function(){this.checked?f[aa.id]=aa:delete f[aa.id]})})(ia,Y)}},mxUtils.bind(this,function(V){x.innerText="";var J=document.createElement("div");J.style.padding="8px";J.style.textAlign="center";mxUtils.write(J,mxResources.get("error")+": ");mxUtils.write(J,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));x.appendChild(J)}));
-l.appendChild(x);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var V=0,J;for(J in f)null==A[J]&&(V++,mxUtils.bind(this,function(ia){this.remoteInvoke("getFileContent",[ia.downloadUrl],null,mxUtils.bind(this,function(Y){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,Y,ia)),this.showSidebar()}catch(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();
-this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[J]));for(J in A)f[J]||this.closeLibrary(new RemoteLibrary(this,null,A[J]));0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},
-setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=null!=f?f.callbackId:null,q="number"===typeof l&&0<=l&&l<this.remoteInvokeCallbacks.length?
-this.remoteInvokeCallbacks[l]:null;if(null==q)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?q.error&&q.error(c.error.errResp):q.callback&&q.callback.apply(this,c.resp);this.remoteInvokeCallbacks[l]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,q,x){var A=!0,E=window.setTimeout(mxUtils.bind(this,function(){A=!1;x({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),K=mxUtils.bind(this,function(){window.clearTimeout(E);A&&q.apply(this,arguments)}),
-Q=mxUtils.bind(this,function(){window.clearTimeout(E);A&&x.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:K,error:Q});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var l=mxUtils.bind(this,function(V,J){var ia={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};
-null!=J?ia.error={errResp:J}:null!=V&&(ia.resp=V);this.remoteWin.postMessage(JSON.stringify(ia),"*")});try{var q=c.funtionName,x=null!=q&&Object.prototype.hasOwnProperty.call(this.remoteInvokableFns,q)?this.remoteInvokableFns[q]:null;if(null!=x&&"function"===typeof this[q]){if(x.allowedDomains){for(var A=!1,E=0;E<x.allowedDomains.length;E++)if(f=="https://"+x.allowedDomains[E]){A=!0;break}if(!A){l(null,"Invalid Call: "+q+" is not allowed.");return}}var K=c.functionArgs;Array.isArray(K)||(K=[]);if(x.isAsync)K.push(function(){l(Array.prototype.slice.apply(arguments))}),
-K.push(function(V){l(null,V||"Unkown Error")}),this[q].apply(this,K);else{var Q=this[q].apply(this,K);l([Q])}}else l(null,"Invalid Call: "+q+" is not found.")}catch(V){l(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var q=l.open("database",2);q.onupgradeneeded=function(x){try{var A=q.result;1>x.oldVersion&&A.createObjectStore("objects",{keyPath:"key"});
-2>x.oldVersion&&(A.createObjectStore("files",{keyPath:"title"}),A.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(E){null!=f&&f(E)}};q.onsuccess=mxUtils.bind(this,function(x){try{var A=q.result;this.database=A;EditorUi.migrateStorageFiles&&(StorageFile.migrate(A),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,
-function(E){if((!E||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var K=document.createElement("iframe");K.style.display="none";K.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(K);var Q=!0,V=!1,J,ia=0,Y=mxUtils.bind(this,function(){V=!0;this.setDatabaseItem(".drawioMigrated3",!0);K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),aa=mxUtils.bind(this,
-function(){ia++;ja()}),ja=mxUtils.bind(this,function(){try{if(ia>=J.length)Y();else{var ua=J[ia];StorageFile.getFileContent(this,ua,mxUtils.bind(this,function(Da){null==Da||".scratchpad"==ua&&Da==this.emptyLibraryXml?K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[ua]}),"*"):aa()}),aa)}}catch(Da){console.log(Da)}}),ka=mxUtils.bind(this,function(ua){try{this.setDatabaseItem(null,[{title:ua.title,size:ua.data.length,lastModified:Date.now(),
-type:ua.isLib?"L":"F"},{title:ua.title,data:ua.data}],aa,aa,["filesInfo","files"])}catch(Da){console.log(Da)}});E=mxUtils.bind(this,function(ua){try{if(ua.source==K.contentWindow){var Da={};try{Da=JSON.parse(ua.data)}catch(ha){}"init"==Da.event?(K.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=Da.event||V||(Q?null!=Da.resp&&0<Da.resp.length&&
-null!=Da.resp[0]?(J=Da.resp[0],Q=!1,ja()):Y():null!=Da.resp&&0<Da.resp.length&&null!=Da.resp[0]?ka(Da.resp[0]):aa())}}catch(ha){console.log(ha)}});window.addEventListener("message",E)}})));c(A);A.onversionchange=function(){A.close()}}catch(E){null!=f?f(E):null!=window.console&&console.warn(E)}});q.onerror=f;q.onblocked=function(){}}catch(x){null!=f?f(x):null!=window.console&&console.error(x)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=
-function(c,f,l,q,x){this.openDatabase(mxUtils.bind(this,function(A){try{x=x||"objects";Array.isArray(x)||(x=[x],c=[c],f=[f]);var E=A.transaction(x,"readwrite");E.oncomplete=l;E.onerror=q;for(A=0;A<x.length;A++)E.objectStore(x[A]).put(null!=c&&null!=c[A]?{key:c[A],data:f[A]}:f[A])}catch(K){null!=q&&q(K)}}),q)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c]);var A=x.transaction(q,"readwrite");
-A.oncomplete=f;A.onerror=l;for(x=0;x<q.length;x++)A.objectStore(q[x]).delete(c[x])}catch(E){null!=l&&l(E)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";var A=x.transaction([q],"readonly").objectStore(q).get(c);A.onsuccess=function(){f(A.result)};A.onerror=l}catch(E){null!=l&&l(E)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(q){try{l=l||"objects";var x=q.transaction([l],
-"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),A=[];x.onsuccess=function(E){null==E.target.result?c(A):(A.push(E.target.result.value),E.target.result.continue())};x.onerror=f}catch(E){null!=f&&f(E)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(q){try{l=l||"objects";var x=q.transaction([l],"readonly").objectStore(l).getAllKeys();x.onsuccess=function(){c(x.result)};x.onerror=f}catch(A){null!=f&&f(A)}}),f)};EditorUi.prototype.commentsSupported=
-function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var l=this.getCurrentFile();null!=l?l.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,l){var q=this.getCurrentFile();
-null!=q?q.addComment(c,f,l):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.anchoredCommentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.anchoredCommentsSupported():!1};EditorUi.prototype.mentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionsSupported():
-!1};EditorUi.prototype.freeMentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.freeMentionsSupported():!1};EditorUi.prototype.mentionsLiveSearch=function(){var c=this.getCurrentFile();return null!=c?c.mentionsLiveSearch():!1};EditorUi.prototype.mentionNotificationsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionNotificationsSupported():!0};EditorUi.prototype.getMentionCandidates=function(c,f,l){var q=this.getCurrentFile();null!=q?q.getMentionCandidates(c,
-f,l):c([])};EditorUi.prototype.serializeMention=function(c){return"+"+c.email};EditorUi.prototype.parseMentionTokens=function(c){for(var f=/[+@]([A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,})/g,l=[],q=0,x;null!=(x=f.exec(c));)x.index>q&&l.push(c.substring(q,x.index)),l.push({email:x[1]}),q=x.index+x[0].length;q<c.length&&l.push(c.substring(q));return l};EditorUi.prototype.getCommentCacheTarget=function(){var c=this.getCurrentFile();return null!=c?c:this};EditorUi.prototype.refreshCommentCache=
-function(c,f){if(this.commentsSupported()){var l=this.getCommentCacheTarget();if(null!=l.commentCacheCallbacks)l.commentCacheCallbacks.push([c,f]);else{l.commentCacheCallbacks=[[c,f]];var q=mxUtils.bind(this,function(x,A){var E=l.commentCacheCallbacks;l.commentCacheCallbacks=null;for(var K=0;null!=E&&K<E.length;K++)if(null!=E[K][x])E[K][x](A)});this.getComments(mxUtils.bind(this,function(x){this.getCommentCacheTarget()==l&&(l.commentCache=x,this.fireEvent(new mxEventObject("commentsChanged")));q(0,
-x)}),mxUtils.bind(this,function(x){q(1,x)}))}}else null!=c&&c(null)};EditorUi.prototype.commentsUpdated=function(){if(this.commentsSupported()){var c=this.getCurrentFile();null!=c&&null!=c.sync&&c.sync.sendCommentsChangedMessage();this.refreshCommentCache()}};EditorUi.prototype.getUnresolvedCommentCount=function(){var c=this.getCommentCacheTarget().commentCache,f=0;if(null!=c)for(var l=0;l<c.length;l++)c[l].isResolved||f++;return f};EditorUi.prototype.getCommentAnchorCells=function(c){var f=c.getAnchorCellIds(),
-l=[];if(null!=f&&0<f.length){c=c.getAnchorPageId();var q=null==c?this.currentPage:this.getPageById(c);if(null!=q)if(q==this.currentPage)for(c=0;c<f.length;c++)q=this.editor.graph.model.getCell(f[c]),null!=q&&l.push(q);else{try{this.updatePageRoot(q)}catch(K){return l}if(null!=q.root){var x={},A=0;for(c=0;c<f.length;c++)x[f[c]]||(x[f[c]]=!0,A++);var E=function(K){if(0<A){x[K.getId()]&&(x[K.getId()]=!1,l.push(K),A--);for(var Q=0;Q<K.getChildCount();Q++)E(K.getChildAt(Q))}};E(q.root)}}}return l};EditorUi.prototype.gotoCommentAnchor=
-function(c){var f=c.getAnchorPageId();if(null!=f&&null!=this.currentPage&&f!=this.currentPage.getId()){f=this.getPageById(f);if(null==f)return!1;this.selectPage(f)}f=this.editor.graph;var l=c.getAnchorCellIds();if(null!=l&&0<l.length){c=[];for(var q=0;q<l.length;q++){var x=f.model.getCell(l[q]);null!=x&&c.push(x)}return 0<c.length?(f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c,"#0071e3",2E3),f.scrollCellToVisible(c[0]),!0):!1}l=c.getAnchorRect();null!=l&&0<l.w&&0<l.h&&f.fitWindow(new mxRectangle(l.x,
-l.y,l.w,l.h),0);c=c.getAnchorPoint();if(null!=c){l=f.view.scale;q=f.view.translate;f=f.container;f.scrollLeft=Math.round((c.x+q.x)*l-f.clientWidth/2);f.scrollTop=Math.round((c.y+q.y)*l-f.clientHeight/2);var A=document.createElement("div");A.className="geCommentAnchorMarker";A.style.left=Math.round((c.x+q.x)*l)+"px";A.style.top=Math.round((c.y+q.y)*l)+"px";f.appendChild(A);window.setTimeout(function(){null!=A.parentNode&&A.parentNode.removeChild(A)},2E3)}return!0};EditorUi.prototype.addCommentsBadge=
-function(c){var f=document.createElement("span");f.className="geCommentsBadge";f.style.display="none";c.appendChild(f);c=mxUtils.bind(this,function(){var l=this.getUnresolvedCommentCount();f.style.display=0<l?"":"none";f.innerText="";mxUtils.write(f,99<l?"99+":String(l))});this.addListener("commentsChanged",c);this.editor.addListener("fileLoaded",c);c();return f};EditorUi.prototype.installCommentDragSource=function(c){var f=this,l=document.createElement("div");l.style.width="24px";l.style.height=
-"24px";l.style.backgroundImage="url("+Editor.lightDarkCommentImage+")";l.style.backgroundSize="100% 100%";l.style.opacity="0.9";c=mxUtils.makeDraggable(c,function(){return f.editor.graph},function(x,A,E,K,Q){null!=f.currentPage&&null!=f.menus&&null!=f.menus.showCommentsWindow&&(x=null!=E?{p:f.currentPage.getId(),c:E.id}:{p:f.currentPage.getId(),pt:{x:Math.round(K),y:Math.round(Q)}},f.menus.showCommentsWindow(null,x))},l);var q=c.mouseDown;c.mouseDown=function(x){mxEvent.isMouseEvent(x)&&!mxEvent.isPopupTrigger(x)&&
-f.commentsSupported()&&f.anchoredCommentsSupported()&&f.canComment()&&q.apply(this,arguments)};return c};EditorUi.prototype.updateCommentOverlays=function(){var c=this.editor.graph;if(null!=this.commentOverlays)for(var f=0;f<this.commentOverlays.length;f++)c.removeCellOverlay(this.commentOverlays[f].cell,this.commentOverlays[f].overlay);this.commentOverlays=null;var l=this.getCurrentFile();if(null!=l&&l.anchoredCommentsSupported()&&null!=l.commentCache&&!this.editor.isChromelessView()){var q=null!=
-this.currentPage?this.currentPage.getId():null,x={};for(f=0;f<l.commentCache.length;f++){var A=l.commentCache[f],E=A.getAnchorCellIds();if(!A.isResolved&&null!=E&&A.getAnchorPageId()==q)for(A=0;A<E.length;A++)x[E[A]]=!0}this.commentOverlays=[];for(var K in x)mxUtils.bind(this,function(Q){var V=c.model.getCell(Q);if(null!=V){var J=new mxCellOverlay(new mxImage(Editor.lightDarkCommentImage,16,16),mxResources.get("comments"),mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,new mxPoint(8,8));J.isCommentOverlay=
-!0;J.cursor="pointer";J.addListener(mxEvent.CLICK,mxUtils.bind(this,function(){null!=this.menus&&null!=this.menus.showCommentsWindow&&this.menus.showCommentsWindow(Q)}));c.addCellOverlay(V,J);this.commentOverlays.push({cell:V,overlay:J})}})(K)}};EditorUi.prototype.newComment=function(c,f){var l=this.getCurrentFile();return null!=l?l.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=
-c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};
-EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,q,x,A,E,K){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,q,x,A,E,K)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");
-return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,q,x,A,
-E,K,Q,V,J,ia,Y,aa,ja,ka)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,q){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,q)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,
-f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,l,q){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,l,q)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,l,q,x){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");
-return Editor.writeGraphModelToPng(c,f,l,q,x)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var l=localStorage.key(f),q=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<q.length){var x="<mxfile "===q.substring(0,8)||"<?xml"===q.substring(0,5)||"\x3c!--[if IE]>"===q.substring(0,12);q="<mxlibrary>"===q.substring(0,11);(x||
-q)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
-var CommentsWindow=function(b,d,m,p,t,n){function y(){for(var ma=T.getElementsByTagName("div"),ta=0,va=0;va<ma.length;va++)"none"!=ma[va].style.display&&ma[va].parentNode==T&&ta++;W.style.display=0==ta?"block":"none"}function C(ma){for(var ta=0;ta<ha.length;ta++)if(null!=ha[ta].email&&null!=ma&&ha[ta].email.toLowerCase()==ma.toLowerCase())return ha[ta].displayName||ma;return ma}function O(ma){var ta=document.createElement("span");ta.className="geCommentMention";ta.setAttribute("data-mention",b.serializeMention(ma));
-null!=ma.email&&ta.setAttribute("data-email",ma.email);ta.contentEditable="false";mxUtils.write(ta,"@"+(ma.displayName||(null!=ma.email?C(ma.email):ma.id)));return ta}function F(ma,ta){ma.innerText="";ta=null!=ta?ta:"";if(aa){ta=b.parseMentionTokens(ta);for(var va=0;va<ta.length;va++)"string"===typeof ta[va]?mxUtils.write(ma,ta[va]):ma.appendChild(O(ta[va]))}else mxUtils.write(ma,ta)}function N(ma,ta,va,Ha){function La(Ra){for(var $a in ab)for(var fb=0;fb<ab[$a].length;fb++)Ra(ab[$a][fb],"down"==
+var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainers=function(){for(var c=this.editor.graph,f=c.getSelectionCells(),l=[],q=0;q<f.length;q++)if(c.model.isVertex(f[q])){var x=c.getCellStyle(f[q]).childLayout;
+if(null!=x&&"tableLayout"!=x&&"stackLayout"!=x&&"rack"!=x)l.push(f[q]);else return[]}return l};EditorUi.prototype.applyLayoutToSelectedContainers=function(c){var f=this.getSelectedLayoutContainers();if(0==f.length)return!1;var l=this.editor.graph.model;l.beginUpdate();try{for(var q=0;q<f.length;q++)this.setContainerChildLayout(f[q],c)}finally{l.endUpdate()}return!0};EditorUi.prototype.setContainerChildLayout=function(c,f){var l=this.editor.graph,q=f,x=null,A=null;if("string"!==typeof f){if(!Array.isArray(f)||
+0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));q=[];for(var E=0;E<f.length;E++){var K=f[E];if(null!=K&&("mxRadialTreeLayout"==K.layout||"mxOrgChartLayout"==K.layout||"mxFastOrganicLayout"==K.layout||"mxCircleLayout"==K.layout))throw Error("Not supported as childLayout: "+K.layout);if(null!=K&&null!=Graph.elkLayoutAlgorithms[K.layout]){var Q={},V;for(V in K.config)Q[V]=K.config[V];delete Q.rootCellIds;delete Q.preserveOrigin;null==Q.resizeNodes&&(Q.resizeNodes=!1);null==Q.resizeLayoutRoot&&
+(Q.resizeLayoutRoot=!0);"elkLayered"==K.layout&&(null==Q.extractIsolated&&(Q.extractIsolated=!1),null==Q["elk.layered.considerModelOrder.strategy"]&&(Q["elk.layered.considerModelOrder.strategy"]=Menus.flowModelOrder));null!=Q.corners&&(A=Q.corners);if(null!=Q.groupPadding&&(x=String(Q.groupPadding),/[;=]/.test(x)))throw Error("Invalid groupPadding: "+x);K={layout:K.layout,config:Q}}q.push(K)}l.createLayouts(q);q=Graph.encodeChildLayout(q)}if(0<=q.indexOf(";"))throw Error("Invalid childLayout: "+q);
+l.model.beginUpdate();try{var J=l.model.getStyle(c);l.setCellStyles("childLayout",q,[c]);null!=x&&l.setCellStyles("groupPadding",x,[c]);null!=A&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(l,c,A);l.model.getStyle(c)==J&&null!=l.layoutManager&&l.layoutManager.executeLayout(c,!1)}finally{l.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,l){var q=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=
+ElkLayout.MENU_PRESETS},function(){try{var x=q.resolveLayoutList(c);null!=x?(q.lastLayoutSpec=x,l&&Array.isArray(x)&&0<x.length&&q.applyLayoutToSelectedContainers(x)?null!=f&&f():q.executeLayouts(q.editor.graph.createLayouts(x),f)):q.handleError(Error("Unknown layout: "+c))}catch(A){q.handleError(A)}},function(){q.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.applyChildLayouts=function(c){var f=this.editor.graph,l=function(){try{f.executeAllChildLayouts()}catch(q){null!=
+window.console&&console.error(q)}null!=c&&c()};(function(){if("undefined"!==typeof ElkLayout)return!1;for(var q=f.getChildLayoutCells(),x=0;x<q.length;x++)try{for(var A=Graph.decodeChildLayout(f.getCellStyle(q[x]).childLayout),E=0;null!=A&&E<A.length;E++)if(null!=A[E]&&"string"===typeof Graph.elkLayoutAlgorithms[A[E].layout])return!0}catch(K){}return!1})()?this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout},l,l):l()};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&
+null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,l=c.ctrlKey||c.metaKey,q=null!=c.key?c.key.toLowerCase():"",x=0;x<f.length;x++){var A=f[x];if(q===String(A.key).toLowerCase()&&l===!!A.ctrl&&c.shiftKey===!!A.shift&&c.altKey===!!A.alt){c.preventDefault();c.stopImmediatePropagation();null!=A.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:A.command}),"*");
+break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};
+EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===typeof c.keyCode&&1==c.keyCode.length,l=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(l))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var q=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:c.shift?this.altShiftActions:this.altActions;null!=c.action?q[l]=c.action:delete q[l]}else null!=c.action?(q=mxUtils.bind(this,function(){var x=this.actions.get(c.action);
+null!=x&&x.isEnabled()&&x.funct.apply(this,arguments)}),c.control?c.shift?this.keyHandler.bindControlShiftKey(l,q):this.keyHandler.bindControlKey(l,q):c.shift?this.keyHandler.bindShiftKey(l,q):this.keyHandler.bindKey(l,q)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:this.keyHandler.normalKeys)[l];null!=c.action&&(q=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=l&&57>=l||65<=l&&90>=l?String.fromCharCode(l):EditorUi.keyNames[l],
+null!=q&&null!=f&&(q.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,l=!1,q=!1,x=null,A=null;this.installPassThroughKeys();var E=mxUtils.bind(this,function(V,J){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});
+this.editor.graph.model.addListener(mxEvent.CHANGE,E);mxEvent.addListener(window,"message",mxUtils.bind(this,function(V){if(V.source==(this.embedMessageSource||window.opener||window.parent)){var J=V.data,ia=null,Y=null,aa=mxUtils.bind(this,function(Fa){if(null!=Fa&&"function"===typeof Fa.charAt&&"<"!=Fa.charAt(0))try{Editor.isPngDataUrl(Fa)?Fa=Editor.extractGraphModelFromPng(Fa):"data:image/svg+xml;base64,"==Fa.substring(0,26)?Fa=atob(Fa.substring(26)):"data:image/svg+xml;utf8,"==Fa.substring(0,24)&&
+(Fa=Fa.substring(24)),null!=Fa&&(""==Fa.trim()?Fa=null:"%"==Fa.charAt(0)?Fa=decodeURIComponent(Fa):"<"!=Fa.charAt(0)&&(Fa=Graph.decompress(Fa)))}catch(Ra){}return Fa});if("json"==urlParams.proto){var ja=!1;try{J=JSON.parse(J),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[V],"data",[J])}catch(Fa){J=null}try{var la=J;if(null==J)return;if("dialog"==J.action){this.showError(null!=J.titleKey?mxResources.get(J.titleKey):J.title,null!=J.messageKey?mxResources.get(J.messageKey):mxUtils.htmlEntities(J.message),
+null!=J.buttonKey?mxResources.get(J.buttonKey):J.button);null!=J.modified&&(this.editor.modified=J.modified);return}if("layout"==J.action){this.executeLayoutSpec(J.layouts,mxUtils.bind(this,function(){var Fa=this.createLoadMessage("layout");Fa.message=J;K.postMessage(JSON.stringify(Fa),"*")}));return}if("prompt"==J.action){this.spinner.stop();var ua=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(Fa){null!=Fa?K.postMessage(JSON.stringify({event:"prompt",
+value:Fa,message:J}),"*"):K.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){K.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(ua.container,300,80,!0,!1);ua.init();return}if("draft"==J.action){var Da=aa(J.xml);this.spinner.stop();ua=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),Da,mxUtils.bind(this,function(){this.hideDialog();
+K.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"discard",message:J}),"*")}),J.editKey?mxResources.get(J.editKey):null,J.discardKey?mxResources.get(J.discardKey):null,J.ignore?mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(ua.container,640,480,!0,!1,mxUtils.bind(this,function(Fa){Fa&&
+this.actions.get("exit").funct()}));try{ua.init()}catch(Fa){K.postMessage(JSON.stringify({event:"draft",error:Fa.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var ha=1==J.enableRecent,k=1==J.enableSearch,u=1==J.enableCustomTemp;ua=new NewDialog(this,!1,J.templatesOnly?!1:null!=J.callback,mxUtils.bind(this,function(Fa,Ra,$a,fb){Fa=Fa||this.emptyDiagramXml;null!=J.callback?K.postMessage(JSON.stringify({event:"template",xml:Fa,blank:Fa==this.emptyDiagramXml,name:Ra,
+tempUrl:$a,libs:fb,builtIn:!0,message:J}),"*"):(c(Fa,V,Fa!=this.emptyDiagramXml,J.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,ha?mxUtils.bind(this,function(Fa){this.remoteInvoke("getRecentDiagrams",[null],null,Fa,function(){Fa(null,"Network Error!")})}):null,k?mxUtils.bind(this,function(Fa,Ra){this.remoteInvoke("searchDiagrams",[Fa,null],null,Ra,function(){Ra(null,"Network Error!")})}):null,mxUtils.bind(this,function(Fa,Ra,$a){K.postMessage(JSON.stringify({event:"template",
+docUrl:Fa,info:Ra,name:$a}),"*")}),null,null,u?mxUtils.bind(this,function(Fa){this.remoteInvoke("getCustomTemplates",null,null,Fa,function(){Fa({},0)})}):null,1==J.withoutType,null,J.templatesOnly);this.showDialog(ua.container,620,460,!0,!1,mxUtils.bind(this,function(Fa){null!=this.sidebar&&this.sidebar.hideTooltip();Fa&&!J.noExitOnCancel&&this.actions.get("exit").funct()}));ua.init();return}if("textContent"==J.action){var H=this.getDiagramTextContent();K.postMessage(JSON.stringify({event:"textContent",
+data:H,message:J}),"*");return}if("status"==J.action){this.updateStatus(mxUtils.bind(this,function(){null!=J.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(J.messageKey))):null!=J.message&&this.editor.setStatus(mxUtils.htmlEntities(J.message))}));null!=J.modified&&(this.editor.modified=J.modified);return}if("spinner"==J.action){var P=null!=J.messageKey?mxResources.get(J.messageKey):J.message;null==J.show||J.show?this.spinner.spin(document.body,P):this.spinner.stop();return}if("exit"==
+J.action){this.actions.get("exit").funct();return}if("viewport"==J.action){if(null!=J.viewport){var U=this.editor.graph,W=U.view.translate.x,fa=U.view.translate.y;this.embedViewport=J.viewport;U.refresh();this.diagramContainer.scrollTop-=(fa-U.view.translate.y)*U.view.scale;this.diagramContainer.scrollLeft-=(W-U.view.translate.x)*U.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==J.action){var X=this.actions.get(J.actionName);null!=X&&X.funct();return}if("resetEditor"==
+J.action){U=this.editor.graph;U.isEditing()&&U.stopEditing(!1);this.hideCurrentMenu();U.popupMenuHandler.hideMenu();U.clearSelection();return}if("fit"==J.action){U=this.editor.graph;var ea=U.maxFitScale;U.maxFitScale=null!=J.maxScale?J.maxScale:1;U.fit(null!=J.border?J.border:16,null,null,null,null,!0);U.maxFitScale=ea;P=this.createLoadMessage("fit");P.message=J;K.postMessage(JSON.stringify(P),"*");return}if("viewbox"==J.action){var oa=EditorUi.parseViewBox(J.viewbox);null!=oa&&this.applyViewBox(oa);
+P=this.createLoadMessage("viewbox");P.message=J;K.postMessage(JSON.stringify(P),"*");return}if("fullscreenChanged"==J.action){var ka=null;try{var ba=this.diagramContainer.getAttribute("data-scrollState");null!=ba&&(this.diagramContainer.removeAttribute("data-scrollState"),ka=JSON.parse(ba))}catch(Fa){}Editor.inlineFullscreen=J.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=ka&&this.restoreScrollState(ka);return}if("snapshot"==J.action){this.sendEmbeddedSvgExport(!0);return}if("export"==
+J.action){if("png"==J.format||"xmlpng"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){var sa=null!=J.xml?J.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);U=this.editor.graph;var xa=mxUtils.bind(this,function(Fa,Ra){if(J.withSvg)J.withSvg=!1,this.getEmbeddedSvg(sa,this.editor.graph,null,!0,function(fb){xa(Fa,fb)},null,null,J.embedImages,this.editor.graph.background,J.scale,J.border,J.shadow,"auto",null,J.embedFonts);
+else{this.editor.graph.setEnabled(!0);this.spinner.stop();var $a=this.createLoadMessage("export");$a.format=J.format;$a.message=la;$a.data=Fa;$a.svg=Ra;$a.xml=sa;K.postMessage(JSON.stringify($a),"*")}}),qa=mxUtils.bind(this,function(Fa){null==Fa&&(Fa=Editor.blankImage);"xmlpng"==J.format&&(Fa=Editor.writeGraphModelToPng(Fa,"tEXt","mxfile",encodeURIComponent(sa)));U!=this.editor.graph&&U.container.parentNode.removeChild(U.container);xa(Fa)}),Ba=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():
+this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ma=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Ba){var Fa=U.getGlobalVariable;U=this.createTemporaryGraph(U.getStylesheet());for(var Ra,$a=0;$a<this.pages.length;$a++)if(this.pages[$a].getId()==Ba){Ra=this.updatePageRoot(this.pages[$a]);break}null==Ra&&(Ra=this.currentPage);U.getGlobalVariable=function(ub){return"page"==ub?Ra.getName():"pagenumber"==ub?1:Fa.apply(this,arguments)};document.body.appendChild(U.container);
+U.model.setRoot(Ra.root)}if(null!=J.layerIds){var fb=U.model,rb=fb.getChildCells(fb.getRoot()),mb=Object.create(null);for($a=0;$a<J.layerIds.length;$a++)mb[J.layerIds[$a]]=!0;for($a=0;$a<rb.length;$a++)fb.setVisible(rb[$a],mb[rb[$a].id]||!1)}$a=null;J.keepTheme&&($a=Editor.isDarkMode()?"dark":"light");null==J.width&&0<this.maxCanvasExportArea&&(rb=U.getGraphBounds(),mb=null!=J.border?J.border:0,fb=Math.ceil(rb.width/U.view.scale)+2*mb,rb=Math.ceil(rb.height/U.view.scale)+2*mb,mb=null!=J.scale?J.scale:
+1,fb*rb*mb*mb>this.maxCanvasExportArea&&(J.scale=Math.sqrt(this.maxCanvasExportArea/(fb*rb))));this.editor.exportToCanvas(mxUtils.bind(this,function(ub){qa(ub.toDataURL("image/png"))}),J.width,null,J.background,mxUtils.bind(this,function(){qa(null)}),null,null,J.scale,J.transparent,J.shadow,null,U,J.border,null,J.grid,$a,J.size)});null!=J.xml&&0<J.xml.length&&(l=!0,this.setFileData(sa),l=!1);ma()}else this.isRemoteExportEnabled()?(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==J.format?
+"1":"0")+(null!=Ba?"&pageId="+Ba:"")+(null!=J.layerIds&&0<J.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:J.layerIds})):"")+(null!=J.scale?"&scale="+J.scale:"")+"&base64=1&xml="+encodeURIComponent(sa))).send(mxUtils.bind(this,function(Fa){200<=Fa.getStatus()&&299>=Fa.getStatus()?xa("data:image/png;base64,"+Fa.getText()):qa(null)}),mxUtils.bind(this,function(){qa(null)})):qa(null)}}else if(ma=mxUtils.bind(this,function(){var Fa=this.createLoadMessage("export");Fa.message=J;
+if("html2"==J.format||"html"==J.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ra=this.getXmlFileData();Fa.xml=mxUtils.getXml(Ra);Fa.data=this.getFileData(null,null,!0,null,null,null,Ra);Fa.format=J.format}else if("html"==J.format)Ra=this.editor.getGraphXml(),Fa.data=this.getHtml(Ra,this.editor.graph),Fa.xml=mxUtils.getXml(Ra),Fa.format=J.format;else{if("xml"==J.format)Fa.xml=this.getFileData(!0),Fa.format=J.format,K.postMessage(JSON.stringify(Fa),"*");else if("json"==
+J.format)Fa.format=J.format,Fa.data=this.createJsonForExport(0!=J.allPages,1==J.includeData,1==J.compressed,1==J.selection),K.postMessage(JSON.stringify(Fa),"*");else{mxSvgCanvas2D.prototype.foAltText=null;var $a=null!=J.background?J.background:this.editor.graph.background;$a==mxConstants.NONE&&($a=null);Fa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);Fa.format="svg";var fb=mxUtils.bind(this,function(Eb){this.editor.graph.setEnabled(!0);this.spinner.stop();Fa.data=J.asText?
+Eb:Editor.createSvgDataUri(Eb);K.postMessage(JSON.stringify(Fa),"*")}),rb="auto";J.keepTheme&&(rb=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(rb=J.theme);if("xmlsvg"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){rb=null;if(this.isAutoDarkMode()||Editor.isDarkMode())rb="auto";null!=J.theme&&(rb=J.theme);this.getEmbeddedSvg(Fa.xml,this.editor.graph,null,!0,fb,null,null,J.embedImages,$a,J.scale,J.border,J.shadow,
+rb,J.embedCellMetadata,J.embedFonts)}}else if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){this.editor.graph.setEnabled(!1);var mb=this.editor.graph.createSvgImageExport(!1,J.embedCellMetadata?!0:!1);Ra=Object.create(null);var ub=this.getSvgWithFontLookup(Ra,mb,mxUtils.bind(this,function(){return this.editor.graph.getSvg($a,J.scale,J.border,null,null,null,null,mb,null,this.editor.graph.shadowVisible||J.shadow,null,rb)}));(this.editor.graph.shadowVisible||
+J.shadow)&&this.editor.graph.addSvgShadow(ub);this.embedFonts(ub,mxUtils.bind(this,function(Eb){J.embedImages||null==J.embedImages?this.editor.convertImages(Eb,mxUtils.bind(this,function(Fb){fb(mxUtils.getXml(Fb))})):fb(mxUtils.getXml(Eb))}),J.embedFonts,Ra)}}return}K.postMessage(JSON.stringify(Fa),"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var ta=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ta.apply(this,arguments);ma()}}l=!0;this.setFileData(J.xml);l=!1;this.editor.graph.mathEnabled||
+ma()}else ma();return}if("load"==J.action){ja=J.toSketch;q=1==J.autosave;this.embedDiffSync=null!=J.diffSync&&!1!==J.diffSync;this.embedDiffSyncPatchOnly="object"===typeof J.diffSync&&null!=J.diffSync&&1==J.diffSync.patchOnly;this.embedExportProtocol=1==J.exportProtocol;var va=J.sourceMetadata||null;Y=null!=J.layout?J.layout:null;this.hideDialog();null!=J.modified&&null==urlParams.modified&&(urlParams.modified=J.modified);null!=J.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=J.saveAndExit);
+if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=J.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=J.noSaveBtn);if(null!=J.rough){var Ga=Editor.sketchMode;this.doSetSketchMode(J.rough);Ga!=Editor.sketchMode&&
+this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=J.dark&&this.setDarkMode(J.dark);null!=J.border&&(this.embedExportBorder=J.border);null!=J.theme&&(this.embedExportTheme=J.theme);null!=J.background&&(this.embedExportBackground=J.background);null!=J.viewport&&(this.embedViewport=J.viewport);this.embedExitPoint=null;var La=EditorUi.parseViewBox(J.viewbox);null==La&&null==J.viewbox&&null==J.scale&&null==J.fit&&(La=EditorUi.getViewBoxParam());if(null!=La)ia=mxUtils.bind(this,function(){this.applyViewBox(La)});
+else if(null!=J.scale){var Ia=J.scale,Ca=null!=J.scaleBorder?J.scaleBorder:this.embedExportBorder||0,Pa=null!=J.border?J.border:0;ia=mxUtils.bind(this,function(){var Fa=this.editor.graph,Ra=Fa.getGraphBounds();if(0<Ra.width&&0<Ra.height){var $a=Fa.view.scale;Fa.view.scaleAndTranslate(Ia,Fa.view.translate.x+Pa-Ra.x/$a+Ca/Ia,Fa.view.translate.y+Pa-Ra.y/$a+Ca/Ia)}})}else if(null!=J.fit){var Ka=null!=J.border?J.border:0,Na=J.maxFitScale||1;ia=mxUtils.bind(this,function(){var Fa=this.editor.graph,Ra=Fa.maxFitScale;
+Fa.maxFitScale=Na;Fa.fit(Ka,null,null,null,null,!0);Fa.maxFitScale=Ra})}if(null!=J.scroll&&null!=J.scroll.x&&null!=J.scroll.y){var Oa=J.scroll,Ea=ia;ia=mxUtils.bind(this,function(){null!=Ea&&Ea();var Fa=this.editor.graph,Ra=Fa.view.scale,$a=Fa.view.translate;mxUtils.hasScrollbars(Fa.container)?(Fa.container.scrollLeft=($a.x+Oa.x)*Ra,Fa.container.scrollTop=($a.y+Oa.y)*Ra):Fa.view.setTranslate(-Oa.x,-Oa.y)})}if(null!=J.rect){Pa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,J.rect.left)+
+"px";this.diagramContainer.style.top=Math.max(40,J.rect.top)+"px";this.minInlineWidth=J.minWidth;this.minInlineHeight=J.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Aa=J.maxFitScale,Ja=J.rect.width+2*Pa,Ha=J.rect.height+2*Pa;ia=mxUtils.bind(this,function(){var Fa=mxUtils.getDocumentSize();Ja=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,Ja):Ja,Fa.width-80);Fa=Math.min(null!=this.minInlineHeight?
+Math.max(this.minInlineHeight,Ha):Ha,Fa.height-80);this.diagramContainer.style.width=Ja+"px";this.diagramContainer.style.height=Fa+"px";var Ra=this.editor.graph;Fa=Ra.maxFitScale;Ra.maxFitScale=Aa;Ra.fit(2*Pa,null,null,null,null,null,Ha);this.setPageVisible("1"==urlParams.pv);if(null!=this.minInlineWidth&&Ra.getGraphBounds().width<this.minInlineWidth){var $a=Ra.container.scrollTop;this.resetScrollbars();Ra.container.scrollTop=$a}Ra.maxFitScale=Fa;Ra.container.scrollTop-=Pa;Ra.container.scrollLeft-=
+Pa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[J]));Ra.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Ra.container.style.top);var fb=Ra.getGraphBounds();Ra.container.clientWidth>fb.width+2*Pa&&(Ra.container.scrollLeft=fb.x+(fb.width+Pa-Ra.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=
+J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&this.setEmbedTitle(J.title);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(Fa){}if(null!=J.xmlpng)J=this.extractGraphModelFromPng(J.xmlpng);else if(null!=J.descriptor){if(J=J.descriptor,"mermaid"==J.format){if(EditorUi.isMermaidSupported()){var Ua=mxUtils.bind(this,function(Fa){c(Fa,V,null,ja);Fa=this.createLoadMessage("load");Fa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);Fa.message=la;(this.embedMessageSource||window.opener||
+window.parent).postMessage(JSON.stringify(Fa),"*");if(null!=va&&null!=va.key&&null!=va.value){Fa=this.editor.graph;var Ra=Fa.getModel().getRoot();if(null!=Ra){Fa.getModel().beginUpdate();try{Fa.setAttributeForCell(Ra,va.key,va.value)}finally{Fa.getModel().endUpdate()}}}}),ab=mxUtils.bind(this,function(Fa){this.handleError(Fa)});J.image?this.parseMermaidImage(J.data,Ua,ab):this.parseMermaidDiagram(J.data,null,mxUtils.bind(this,function(Fa){J.wrap&&(Fa=mxMermaidToDrawio.wrapGroup(Fa,J.data,EditorUi.getInsertMermaidConfig(),
+{normalize:!0}));Ua(Fa)}),ab)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else J=J.xml}else{if("merge"==J.action){var Wa=this.getCurrentFile();null!=Wa&&(Da=aa(J.xml),null!=Da&&""!=Da&&Wa.mergeFile(new LocalFile(this,Da),mxUtils.bind(this,function(){this.embedDiffSync&&(A=this.clonePages(this.pages),x=hb());K.postMessage(JSON.stringify({event:"merge",message:J}),"*")}),function(Fa){K.postMessage(JSON.stringify({event:"merge",
+message:J,error:Fa}),"*")}))}else if("patch"==J.action){if(Wa=this.getCurrentFile(),null!=Wa&&null!=J.patch)try{l=!0,Wa.patch([J.patch]),this.embedDiffSync&&null!=A&&(A=this.applyPatches(A,[J.patch])),x=hb(),l=!1,ba={event:"patch",message:J},ka=this.getHashValueForPages(this.pages),ba.checksum=ka,null!=J.checksum&&J.checksum!=ka&&(ba.checksumMismatch=!0),K.postMessage(JSON.stringify(ba),"*")}catch(Fa){l=!1,K.postMessage(JSON.stringify({event:"patch",message:J,error:Fa.message||Fa.toString()}),"*")}}else if("getDiff"==
+J.action){P={event:"getDiff",message:J};if(this.embedDiffSync&&null!=A){var cb=this.clonePages(this.pages);P.patch=this.diffPages(A,cb);P.checksum=this.getHashValueForPages(cb)}else P.xml=hb();K.postMessage(JSON.stringify(P),"*")}else"resetDiff"==J.action?this.embedDiffSync&&(null!=J.xml?(Da=aa(J.xml),Wa=this.getCurrentFile(),null!=Da&&""!=Da&&null!=Wa&&Wa.mergeFile(new LocalFile(this,Da),mxUtils.bind(this,function(){A=this.clonePages(this.pages);x=hb();K.postMessage(JSON.stringify({event:"resetDiff",
+message:J,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(Fa){K.postMessage(JSON.stringify({event:"resetDiff",message:J,error:Fa}),"*")})):(A=this.clonePages(this.pages),x=hb(),K.postMessage(JSON.stringify({event:"resetDiff",message:J,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==J.action?this.handleRemoteInvokeReady(K):"remoteInvoke"==J.action?this.handleRemoteInvoke(J,V.origin):"remoteInvokeResponse"==J.action?this.handleRemoteInvokeResponse(J):K.postMessage(JSON.stringify({error:"unknownMessage",
+data:JSON.stringify(J)}),"*");return}}catch(Fa){this.handleError(Fa)}}var hb=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),wb=mxUtils.bind(this,function(Fa,Ra){l=!0;try{c(Fa,Ra,null,ja)}catch($a){this.handleError($a)}l=!1;this.editor.graph.model.prefix=Editor.guid()+"-";Ra=mxUtils.bind(this,function(){null!=urlParams.modified&&this.clearStatus();x=hb();this.embedDiffSync&&(A=this.clonePages(this.pages));
+q&&null==f&&(f=mxUtils.bind(this,function(fb,rb){fb=hb();if(fb!=x&&!l){rb=this.createLoadMessage("autosave");rb.message=la;if(this.embedDiffSync&&null!=A){var mb=this.clonePages(this.pages),ub=this.diffPages(A,mb);mxUtils.isEmptyObject(ub)?rb.xml=fb:(rb.patch=ub,rb.checksum=this.getHashValueForPages(mb),this.embedDiffSyncPatchOnly||(rb.xml=fb));A=mb}else rb.xml=fb;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(rb),"*")}x=fb}),this.editor.graph.model.addListener(mxEvent.CHANGE,
+f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("tooltipsEnabledChanged",f),this.addListener("pageViewChanged",
+f),this.addListener("connectionPointsChanged",f),this.addListener("connectionArrowsChanged",f));null!=ia&&ia();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var $a=this.createLoadMessage("load");$a.xml=null!=Y?hb():Fa;this.embedDiffSync&&null!=this.pages&&($a.checksum=this.getHashValueForPages(this.pages));K.postMessage(JSON.stringify($a),"*")}});null!=Y?this.executeLayoutSpec(Y,Ra):Ra()});null!=J&&"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,34)?
+(aa="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(Fa){wb(Fa,V)},mxUtils.bind(this,function(Fa){this.handleError(Fa)}),aa)):null!=J&&"function"===typeof J.substring&&this.isGliffyData(J,"")?this.importGliffy(J,mxUtils.bind(this,function(Fa){"<mxGraphModel"==Fa.substring(0,13)?wb(Fa,V):this.handleError({message:mxResources.get("unknownError")})}),mxUtils.bind(this,function(Fa){this.handleError({message:null!=Fa&&413==
+Fa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")})}),""):null!=J&&"function"===typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(Fa){wb(Fa)}),mxUtils.bind(this,function(Fa){this.handleError(Fa)})):null==J||"object"!==typeof J||null==J.format||null==J.data&&null==J.url?(J=aa(J),wb(J,V)):this.loadDescriptor(J,mxUtils.bind(this,function(Fa){wb(hb(),V)}),mxUtils.bind(this,function(Fa){this.handleError(Fa,mxResources.get("errorLoadingFile"))}))}}));
+var K=this.embedMessageSource||window.opener||window.parent;E="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";K.postMessage(E,"*");if("json"==urlParams.proto){var Q=this.editor.graph.openLink;this.editor.graph.openLink=function(V,J,ia){Q.apply(this,arguments);K.postMessage(JSON.stringify({event:"openLink",href:V,target:J,allowOpener:ia}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(V){for(var J=mxEvent.getSource(V);null!=
+J&&"A"!=J.nodeName;)J=J.parentNode;if(null!=J){var ia=J.getAttribute("href");null==ia||"#"==ia.charAt(0)||"javascript:"==ia.substring(0,11)||this.editor.graph.isCustomLink(ia)||(V.preventDefault(),this.editor.graph.openLink(ia,J.getAttribute("target")))}}),!0)}};EditorUi.prototype.createEmbedButton=function(c,f,l,q){var x=document.createElement("button");x.className="geEmbedBtn geBtn";x.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(x,c);q&&x.classList.add("gePrimaryBtn");mxEvent.addListener(x,
+"click",f);return x};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==
+this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),
+mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};
+EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,
+function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var q=JSON.parse(l);Array.isArray(q)&&0<q.length&&this.applyLayoutToSelectedContainers(q)||this.executeLayouts(this.editor.graph.createLayouts(q));this.lastLayoutSpec=this.customLayoutConfig=q;this.hideDialog()}catch(x){this.handleError(x)}}),null,null,null,null,mxUtils.bind(this,function(l,q){var x=this.createLayoutAddSelect(q);l.appendChild(x);x=mxUtils.button(mxResources.get("copy"),
+mxUtils.bind(this,function(){try{var A=q.value;q.value=JSON.stringify(JSON.parse(A));q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));q.value=A}catch(E){this.handleError(E)}}));x.setAttribute("title","copy");x.className="geBtn";l.appendChild(x)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,
+0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var l={},q=0;q<f.length;q++)null!=f[q]&&(l[f[q].id]=!0);var x=function(A){return null!=A&&!0===l[A.id]};for(q=0;q<c.length;q++)f=c[q],"undefined"!==typeof ElkLayout&&f instanceof ElkLayout||void 0!==f.cellFilter?f.cellFilter=x:"function"===typeof f.isVertexIgnored&&function(A){var E=A.isVertexIgnored;A.isVertexIgnored=
+function(K){return E.apply(this,arguments)||!x(K)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,l=document.createElement("select");l.className="geBtn";l.style.marginRight="8px";l.style.maxWidth="180px";var q=document.createElement("option");q.value="";mxUtils.write(q,mxResources.get("add")+"...");q.disabled=!0;q.selected=!0;l.appendChild(q);var x=[];"undefined"!==typeof ElkLayout&&(q=function(E,K){var Q=ElkLayout.MENU_PRESETS[E];return{label:E,kind:"elk",algo:Q.algorithm,preset:Q.options,
+layoutName:K}},x.push(q("verticalFlow","elkLayered")),x.push(q("horizontalFlow","elkLayered")),x.push(q("verticalTree","elkTree")),x.push(q("horizontalTree","elkTree")),x.push(q("radialTree","elkRadial")),x.push(q("organic","elkOrganic")));x.push({label:"orgChart",kind:"orgchart"});x.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});x.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&
+x.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(q=0;q<x.length;q++){var A=document.createElement("option");A.value=String(q);mxUtils.write(A,mxResources.get(x[q].label)+("elk"===x[q].kind||"orgchart"===x[q].kind?"...":""));l.appendChild(A)}mxEvent.addListener(l,"change",mxUtils.bind(this,function(){var E=parseInt(l.value);l.selectedIndex=0;if(!(isNaN(E)||0>E||E>=x.length)){var K=x[E],Q=c.value;if(0===mxUtils.trim(Q).length)var V=[];else{try{V=
+JSON.parse(Q)}catch(ia){f.handleError(ia);return}if(!Array.isArray(V)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var J=mxUtils.bind(this,function(ia){V.push(ia);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(V,null,2))});E=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(Q)});"elk"===K.kind?(f.hideDialog(),ElkLayout.runWithDialog(f,K.algo,K.preset,mxResources.get(K.label),function(ia,Y){ia=Graph.elkOptionsToConfig(ia,Y);J({layout:K.layoutName,
+config:ia})},E)):"orgchart"===K.kind?(f.hideDialog(),f.showOrgChartConfigDialog(J,E)):J({layout:K.layoutName,config:K.config||{}})}}));return l};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var l=2,q=20,x=20,A=document.createElement("div"),E=function(aa,ja){var la=document.createElement("div");la.style.marginTop="6px";la.style.display="inline-block";la.style.width="180px";mxUtils.write(la,mxResources.get(aa)+": ");A.appendChild(la);A.appendChild(ja)},K=document.createElement("select");
+K.style.width="160px";K.style.boxSizing="border-box";for(var Q=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],V=0;V<Q.length;V++){var J=document.createElement("option");mxUtils.write(J,Q[V]);J.value=V;2===V&&J.setAttribute("selected","selected");K.appendChild(J)}mxEvent.addListener(K,"change",function(){l=parseInt(K.value)});
+E("orgChartType",K);var ia=document.createElement("input");ia.type="number";ia.value=q;ia.style.width="160px";ia.style.boxSizing="border-box";mxEvent.addListener(ia,"change",function(){q=parseInt(ia.value)});E("parentChildSpacing",ia);var Y=document.createElement("input");Y.type="number";Y.value=x;Y.style.width="160px";Y.style.boxSizing="border-box";mxEvent.addListener(Y,"change",function(){x=parseInt(Y.value)});E("siblingSpacing",Y);f=new CustomDialog(this,A,function(){c({layout:"mxOrgChartLayout",
+config:{branchOptimizer:l,parentChildSpacing:q,siblingSpacing:x}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(l){var q=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),x=mxUtils.bind(this,function(A){this.loadingOrgChart=
+!1;l.clear()&&this.handleError(A)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))q();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",q,null,null,null,x)},null,null,null,x)},null,null,null,x)},
+null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",q,null,null,null,x)}),onerror)};EditorUi.prototype.importCsv=function(c,f,l,q){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,l)}),q)};EditorUi.prototype.doImportCsv=function(c,f,l){try{var q=c.split("\n"),x=[],A=[],E=[],K=Object.create(null);if(0<q.length){var Q=Object.create(null);l=null!=l?l:this.editor.graph;var V=null,J=null,ia=null,Y=null,aa=null,ja=null,la=null,ua="whiteSpace=wrap;html=1;",
+Da=null,ha=null,k="",u="auto",H="auto",P=!1,U=null,W=null,fa=40,X=40,ea=100,oa=0,ka=mxUtils.bind(this,function(){null!=f?f($a):(l.setSelectionCells($a),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ba=l.getFreeInsertPoint(!0),sa=ba.x,xa=ba.y;ba=xa;var qa=null,Ba="auto";ha=null;for(var ma=[],ta=null,va=null,Ga=0;Ga<q.length&&"#"==q[Ga].charAt(0);){c=q[Ga].replace(/\r$/,"");for(Ga++;Ga<q.length&&
+"\\"==c.charAt(c.length-1)&&"#"==q[Ga].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(q[Ga].substring(1)),Ga++;if("#"!=c.charAt(1)){var La=c.indexOf(":");if(0<La){var Ia=mxUtils.trim(c.substring(1,La)),Ca=mxUtils.trim(c.substring(La+1));"label"==Ia?qa=Graph.sanitizeHtml(Ca):"labelname"==Ia&&0<Ca.length&&"-"!=Ca?aa=Ca:"labels"==Ia&&0<Ca.length&&"-"!=Ca?la=JSON.parse(Ca):"style"==Ia?J=Ca:"parentstyle"==Ia?ua=Ca:"unknownStyle"==Ia&&"-"!=Ca?ja=Ca:"stylename"==Ia&&0<Ca.length&&"-"!=Ca?Y=Ca:"styles"==
+Ia&&0<Ca.length&&"-"!=Ca?ia=JSON.parse(Ca):"vars"==Ia&&0<Ca.length&&"-"!=Ca?V=JSON.parse(Ca):"identity"==Ia&&0<Ca.length&&"-"!=Ca?Da=Ca:"parent"==Ia&&0<Ca.length&&"-"!=Ca?ha=Ca:"namespace"==Ia&&0<Ca.length&&"-"!=Ca?k=Ca:"width"==Ia?u=Ca:"height"==Ia?H=Ca:"collapsed"==Ia&&"-"!=Ca?P="true"==Ca:"left"==Ia&&0<Ca.length?U=Ca:"top"==Ia&&0<Ca.length?W=Ca:"ignore"==Ia?va=Ca.split(","):"connect"==Ia?ma.push(JSON.parse(Ca)):"link"==Ia?ta=Ca:"padding"==Ia?oa=parseFloat(Ca):"edgespacing"==Ia?fa=parseFloat(Ca):
+"nodespacing"==Ia?X=parseFloat(Ca):"levelspacing"==Ia?ea=parseFloat(Ca):"layout"==Ia&&(Ba=Ca)}}}if(null==q[Ga])throw Error(mxResources.get("invalidOrMissingFile"));var Pa=this.editor.csvToArray(q[Ga].replace(/\r$/,""));La=c=null;Ia=[];for(Ca=0;Ca<Pa.length;Ca++)Da==Pa[Ca]&&(c=Ca),ha==Pa[Ca]&&(La=Ca),Ia.push(mxUtils.trim(Pa[Ca]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==qa&&(qa="%"+Ia[0]+"%");if(null!=ma)for(var Ka=0;Ka<ma.length;Ka++)null==Q[ma[Ka].to]&&(Q[ma[Ka].to]=
+Object.create(null));Da=[];for(Ca=Ga+1;Ca<q.length;Ca++){var Na=this.editor.csvToArray(q[Ca].replace(/\r$/,""));if(null==Na){var Oa=40<q[Ca].length?q[Ca].substring(0,40)+"...":q[Ca];throw Error(Oa+" ("+Ca+"):\n"+mxResources.get("containsValidationErrors"));}0<Na.length&&Da.push(Na)}l.model.beginUpdate();try{for(Ca=0;Ca<Da.length;Ca++){Na=Da[Ca];var Ea=null,Aa=null!=c?k+Na[c]:null;q=!1;null!=Aa&&(Ea=l.model.getCell(Aa),q=null==Ea||0<=mxUtils.indexOf(x,Ea));var Ja=new mxCell(qa,new mxGeometry(sa,ba,
+0,0),J||"whiteSpace=wrap;html=1;");Ja.collapsed=P;Ja.vertex=!0;Ja.id=Aa;null==Ea||q||l.model.setCollapsed(Ea,P);for(var Ha=0;Ha<Na.length;Ha++)l.setAttributeForCell(Ja,Ia[Ha],Na[Ha]),null==Ea||q||l.setAttributeForCell(Ea,Ia[Ha],Na[Ha]);if(null!=aa&&null!=la){var Ua=Ja.getAttribute(aa),ab=null!=Ua&&Object.prototype.hasOwnProperty.call(la,Ua)?la[Ua]:null;null!=ab&&(l.labelChanged(Ja,ab),null==Ea||q||l.cellLabelChanged(Ea,ab))}if(null!=Y&&null!=ia){var Wa=Ja.getAttribute(Y),cb=null!=Wa&&Object.prototype.hasOwnProperty.call(ia,
+Wa)?ia[Wa]:null;null!=cb&&(Ja.style=cb)}l.setAttributeForCell(Ja,"placeholders","1");Ja.style=l.replacePlaceholders(Ja,Ja.style,V);null==Ea||q?l.fireEvent(new mxEventObject("cellsInserted","cells",[Ja])):(l.model.setStyle(Ea,Ja.style),0>mxUtils.indexOf(E,Ea)&&E.push(Ea),l.fireEvent(new mxEventObject("cellsInserted","cells",[Ea])));q=null!=Ea;Ea=Ja;if(!q)for(Ka=0;Ka<ma.length;Ka++)Q[ma[Ka].to][Ea.getAttribute(ma[Ka].to)]=Ea;null!=ta&&"link"!=ta&&(l.setLinkForCell(Ea,Ea.getAttribute(ta)),l.setAttributeForCell(Ea,
+ta,null));var hb=l.getPreferredSizeForCell(Ea);ha=null!=La?l.model.getCell(k+Na[La]):null;if(Ea.vertex){Oa=null!=ha?0:sa;Ga=null!=ha?0:xa;null!=U&&null!=Ea.getAttribute(U)&&(Ea.geometry.x=Oa+parseFloat(Ea.getAttribute(U)));null!=W&&null!=Ea.getAttribute(W)&&(Ea.geometry.y=Ga+parseFloat(Ea.getAttribute(W)));var wb="@"==u.charAt(0)?Ea.getAttribute(u.substring(1)):null;Ea.geometry.width=null!=wb&&"auto"!=wb?parseFloat(Ea.getAttribute(u.substring(1))):"auto"==u||"auto"==wb?hb.width+oa:parseFloat(u);var Fa=
+"@"==H.charAt(0)?Ea.getAttribute(H.substring(1)):null;Ea.geometry.height=null!=Fa&&"auto"!=Fa&&"width"!=H?parseFloat(Fa):"auto"==H||"auto"==Fa?hb.height+oa:"width"==H?Ea.geometry.width:parseFloat(H);ba+=Ea.geometry.height+X}q?(null==K[Aa]&&(K[Aa]=[]),K[Aa].push(Ea)):(x.push(Ea),null!=ha?(ha.style=l.replacePlaceholders(ha,ua,V),l.addCell(Ea,ha),A.push(ha)):E.push(l.addCell(Ea)))}for(Ca=0;Ca<A.length;Ca++)wb="@"==u.charAt(0)?A[Ca].getAttribute(u.substring(1)):null,Fa="@"==H.charAt(0)?A[Ca].getAttribute(H.substring(1)):
+null,"auto"!=u&&"auto"!=wb||"auto"!=H&&"auto"!=Fa||l.updateGroupBounds([A[Ca]],oa,!0);var Ra=E.slice(),$a=E.slice();for(Ka=0;Ka<ma.length;Ka++){var fb=ma[Ka];for(Ca=0;Ca<x.length;Ca++){Ea=x[Ca];var rb=mxUtils.bind(this,function(Bb,Ib,Ab){var Db=Ib.getAttribute(Ab.from);if(null!=Db&&""!=Db){Db=Db.split(",");for(var z=0;z<Db.length;z++){var L=Q[Ab.to][Db[z]];if(null==L&&null!=ja){L=new mxCell(Db[z],new mxGeometry(sa,xa,0,0),ja);L.style=l.replacePlaceholders(Ib,L.style,V);var M=l.getPreferredSizeForCell(L);
+L.geometry.width=M.width+oa;L.geometry.height=M.height+oa;Q[Ab.to][Db[z]]=L;L.vertex=!0;L.id=Db[z];E.push(l.addCell(L))}if(null!=L){M=Ab.label;null!=Ab.fromlabel&&(M=(Ib.getAttribute(Ab.fromlabel)||"")+(M||""));null!=Ab.sourcelabel&&(M=l.replacePlaceholders(Ib,Ab.sourcelabel,V)+(M||""));null!=Ab.tolabel&&(M=(M||"")+(L.getAttribute(Ab.tolabel)||""));null!=Ab.targetlabel&&(M=(M||"")+l.replacePlaceholders(L,Ab.targetlabel,V));var S="target"==Ab.placeholders==!Ab.invert?L:Bb;S=null!=Ab.style?l.replacePlaceholders(S,
+Ab.style,V):l.createCurrentEdgeStyle();M=l.insertEdge(null,null,M||"",Ab.invert?L:Bb,Ab.invert?Bb:L,S);if(null!=Ab.labels)for(S=0;S<Ab.labels.length;S++){var Z=Ab.labels[S],da=new mxCell(Z.label||S,new mxGeometry(null!=Z.x?Z.x:0,null!=Z.y?Z.y:0,0,0),"resizable=0;html=1;");da.vertex=!0;da.connectable=!1;da.geometry.relative=!0;null!=Z.placeholders&&(da.value=l.replacePlaceholders("target"==Z.placeholders==!Ab.invert?L:Bb,da.value,V));if(null!=Z.dx||null!=Z.dy)da.geometry.offset=new mxPoint(null!=Z.dx?
+Z.dx:0,null!=Z.dy?Z.dy:0);M.insert(da)}if(null!=Ab.data)for(var na in Ab.data)l.setAttributeForCell(M,na,Ab.data[na]);$a.push(M);mxUtils.remove(Ab.invert?Bb:L,Ra)}}}});rb(Ea,Ea,fb);if(null!=K[Ea.id])for(Ha=0;Ha<K[Ea.id].length;Ha++)rb(Ea,K[Ea.id][Ha],fb)}}if(null!=va)for(Ca=0;Ca<x.length;Ca++)for(Ea=x[Ca],Ha=0;Ha<va.length;Ha++)l.setAttributeForCell(Ea,mxUtils.trim(va[Ha]),null);if(0<E.length){var mb=new mxParallelEdgeLayout(l);mb.spacing=fa;mb.checkOverlap=!0;var ub=function(){0<mb.spacing&&mb.execute(l.getDefaultParent());
+var Bb=0,Ib=0;0<E.length&&(Ib=l.getCellGeometry(E[0]),Bb=Math.round(l.snap(Ib.x))-Ib.x,Ib=Math.round(l.snap(Ib.y))-Ib.y);for(var Ab=0;Ab<E.length;Ab++){var Db=l.getCellGeometry(E[Ab]);Db.x=Math.round(Db.x+Bb);Db.y=Math.round(Db.y+Ib);"auto"==u&&(Db.width=Math.round(l.snap(Db.width)));"auto"==H&&(Db.height=Math.round(l.snap(Db.height)))}};"auto"==Ba&&1==Ra.length&&(Ba=$a.length==2*E.length-1?"verticaltree":"verticalflow");var Eb="organic"==Ba||null!=EditorUi.CSV_ELK_LAYOUTS[Ba]?null:this.resolveLayoutList(Ba);
+if(null!=Eb){var Fb=ka;l.view.validate();var Tb=l.createLayouts(Eb);this.scopeLayoutsToCells(Tb,$a);this.executeLayouts(Tb,function(){ub();Fb()});ka=null}else if("circle"==Ba){var Rb=new mxCircleLayout(l);Rb.disableEdgeStyle=!1;Rb.resetEdges=!1;var $b=Rb.isVertexIgnored;Rb.isVertexIgnored=function(Bb){return $b.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Rb.execute(l.getDefaultParent());ub()},!0,ka);ka=null}else if("verticaltree"==Ba||"horizontaltree"==Ba){l.view.validate();
+var Mb=new mxCompactTreeLayout(l,"horizontaltree"==Ba);Mb.levelDistance=X;Mb.edgeRouting=!1;Mb.resetEdges=!1;Mb.sortEdges=!0;var Wb=Mb.isVertexIgnored;Mb.isVertexIgnored=function(Bb){return Wb.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Mb.execute(l.getDefaultParent(),0<Ra.length?Ra[0]:null)},!0,ka);ka=null}else if("orgchart"==Ba){l.view.validate();var zb=new mxOrgChartLayout(l,2,ea,X),Ub=zb.isVertexIgnored;zb.isVertexIgnored=function(Bb){return Ub.apply(this,arguments)||
+0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){zb.execute(l.getDefaultParent());ub()},!0,ka);ka=null}else if("organic"==Ba||"auto"==Ba&&$a.length>E.length){l.view.validate();var Lb=new mxFastOrganicLayout(l);Lb.forceConstant=3*X;Lb.disableEdgeStyle=!1;Lb.resetEdges=!1;var Xb=Lb.isVertexIgnored;Lb.isVertexIgnored=function(Bb){return Xb.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Lb.execute(l.getDefaultParent());ub()},!0,ka);ka=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[Ba]){l.view.validate();
+Fb=ka;var bc=EditorUi.CSV_ELK_LAYOUTS[Ba],Hb=mxUtils.clone(bc.config);Hb["elk.spacing.nodeNode"]=X;Hb["elk.layered.spacing.nodeNodeBetweenLayers"]=ea;Hb["elk.spacing.edgeEdge"]=fa;Hb["elk.layered.spacing.edgeEdgeBetweenLayers"]=fa;var Ob=l.createLayouts([{layout:bc.layout,config:Hb}]);this.scopeLayoutsToCells(Ob,$a);l.model.beginUpdate();var ac=!1,Zb=function(){ac||(ac=!0,l.model.endUpdate())},Vb=this;try{Ob[0].prepare(l.getDefaultParent(),function(Bb,Ib){null!=Bb?(Zb(),Vb.handleError(Bb)):Vb.executeLayout(function(){Ib();
+var Ab=l.getBoundingBoxFromGeometry($a);null!=Ab&&l.moveCells($a,sa-Ab.x,xa-Ab.y)},!0,function(){Zb();Fb()})})}catch(Bb){throw Zb(),Bb;}ka=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=ka&&ka()}}catch(Bb){this.handleError(Bb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",q;for(q in urlParams)0>mxUtils.indexOf(c,q)&&null!=urlParams[q]&&(f+=l+q+"="+urlParams[q],l="&")}else f=window.location.search;
+return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),q;for(q in urlParams)0>mxUtils.indexOf(l,q)&&(c=0==f?c+"?":c+"&",null!=urlParams[q]&&(c+=q+"="+urlParams[q],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,l,q,x){c=new LinkDialog(this,c,f,l,!0,q,x);this.showDialog(c.container,
+440,null,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=
+this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();
+this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);
+this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||
+"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var N=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){N.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),l=this.getSelectionState(),q=this.isDiagramActive(),
+x="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&x);this.actions.get("redo").setEnabled(this.canRedo()&&x);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(q);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(q&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(q&&
+0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(q&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(q&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(q&&l.image&&0<l.cells.length);this.actions.get("pageSetup").setEnabled(q);this.actions.get("shadowVisible").setEnabled(q);this.actions.get("connectionArrows").setEnabled(q);this.actions.get("connectionPoints").setEnabled(q);this.actions.get("copyStyle").setEnabled(q&&
+!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&q&&0<l.cells.length);this.actions.get("copyTextStyle").setEnabled(q&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&q&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length&&!l.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<l.cells.length);this.actions.get("createShape").setEnabled(q);this.actions.get("createRevision").setEnabled(q);
+this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(q&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);
+this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):
+"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(q&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var R=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);R.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,q,x,A,E,K){var Q=c.editor.graph;
+if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(Q.getSvg(q,x,A)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),J=Q.getGraphBounds(),ia=Math.floor(J.width*x/Q.view.scale),Y=Math.floor(J.height*x/Q.view.scale);if(V.length<=MAX_REQUEST_SIZE&&ia*Y<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas())if(c.isRemoteExportEnabled()){var aa=
+{globalVars:Q.getExportVariables()};K&&(aa.grid={size:Q.gridSize,steps:Q.view.gridSteps,color:Q.view.gridColor});c.saveRequest(f,l,function(ja,la){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(la||"0")+(null!=ja?"&filename="+encodeURIComponent(ja):"")+"&extras="+encodeURIComponent(JSON.stringify(aa))+(0<E?"&dpi="+E:"")+"&bg="+(null!=q?q:"none")+"&w="+ia+"&h="+Y+"&border="+A+"&xml="+encodeURIComponent(V))})}else c.handleError({message:mxResources.get("notAvailable")});else"png"==l?c.exportImage(x,
+null==q||"none"==q,!0,!1,!1,A,!0,!1,null,K,E):c.exportImage(x,!1,!0,!1,!1,A,!0,!1,"jpeg",K);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var q=c;this.currentPage!=this.pages[l]&&(q=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),q.model.setRoot(this.pages[l].root));f+=this.pages[l].getName()+
+" "+q.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,l){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){l.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));l.html=f;return}l.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var l={id:c.getId()};l.type=f?"layer":c.edge?"edge":
+c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(l.parent=f.getId()));c.edge&&(null!=c.source&&(l.source=c.source.getId()),null!=c.target&&(l.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),l);c=f.attributes;f={};for(var q=0,x=0;x<c.length;x++){var A=c[x].nodeName;"label"!=A&&"placeholders"!=A&&"id"!=A&&(f[A]=c[x].nodeValue,q++)}0<q&&(l.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,l);return l};EditorUi.prototype.getJsonForPage=
+function(c,f){var l=this.editor.graph.getModel();var q=null==c||c==this.currentPage?l.getRoot():this.updatePageRoot(c).root;var x=[],A=mxUtils.bind(this,function(J,ia){x.push(this.getJsonForExportCell(J,ia));ia=J.getChildCount();for(var Y=0;Y<ia;Y++)A(J.getChildAt(Y),!1)});if(null!=f){q={};for(var E=0;E<f.length;E++)q[f[E].getId()]=!0;for(E=0;E<f.length;E++){for(var K=f[E],Q=K.getParent(),V=!1;null!=Q;){if(q[Q.getId()]){V=!0;break}Q=Q.getParent()}V||A(K,l.isLayer(K))}}else for(f=q.getChildCount(),
+E=0;E<f;E++)A(q.getChildAt(E),!0);E={};null!=c&&(E.id=c.getId(),E.name=c.getName());E.cells=x;return E};EditorUi.prototype.createJsonForExport=function(c,f,l,q){var x={version:EditorUi.VERSION};f&&(x.data=mxUtils.getXml(this.getXmlFileData(!q,!c,!l)));f=[];if(q)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));x.pages=
+f;return x};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},l=document.createElement("div");l.style.whiteSpace="nowrap";var q=document.createElement("h3");mxUtils.write(q,mxUtils.htmlEntities(c));l.appendChild(q);var x=document.createElement("div");x.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";x.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var A={};try{var E=mxSettings.getCustomLibraries();for(c=0;c<
+E.length;c++){var K=E[c];if("R"==K.substring(0,1)){var Q=JSON.parse(decodeURIComponent(K.substring(1)));A[Q[0]]={id:Q[0],title:Q[1],downloadUrl:Q[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){x.innerText="";if(0==V.length)x.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var J=0;J<V.length;J++){var ia=V[J];A[ia.id]&&(f[ia.id]=ia);var Y=this.addCheckbox(x,ia.title,A[ia.id]);
+(function(aa,ja){mxEvent.addListener(ja,"change",function(){this.checked?f[aa.id]=aa:delete f[aa.id]})})(ia,Y)}},mxUtils.bind(this,function(V){x.innerText="";var J=document.createElement("div");J.style.padding="8px";J.style.textAlign="center";mxUtils.write(J,mxResources.get("error")+": ");mxUtils.write(J,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));x.appendChild(J)}));l.appendChild(x);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));
+var V=0,J;for(J in f)null==A[J]&&(V++,mxUtils.bind(this,function(ia){this.remoteInvoke("getFileContent",[ia.downloadUrl],null,mxUtils.bind(this,function(Y){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,Y,ia)),this.showSidebar()}catch(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[J]));for(J in A)f[J]||this.closeLibrary(new RemoteLibrary(this,
+null,A[J]));0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=
+[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=null!=f?f.callbackId:null,q="number"===typeof l&&0<=l&&l<this.remoteInvokeCallbacks.length?this.remoteInvokeCallbacks[l]:null;if(null==q)throw Error("No callback for "+(null!=f?f.callbackId:
+"null"));c.error?q.error&&q.error(c.error.errResp):q.callback&&q.callback.apply(this,c.resp);this.remoteInvokeCallbacks[l]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,q,x){var A=!0,E=window.setTimeout(mxUtils.bind(this,function(){A=!1;x({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),K=mxUtils.bind(this,function(){window.clearTimeout(E);A&&q.apply(this,arguments)}),Q=mxUtils.bind(this,function(){window.clearTimeout(E);A&&x.apply(this,arguments)});l=l||{};l.callbackId=
+this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:K,error:Q});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var l=mxUtils.bind(this,function(V,J){var ia={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=J?ia.error={errResp:J}:null!=V&&(ia.resp=V);this.remoteWin.postMessage(JSON.stringify(ia),
+"*")});try{var q=c.funtionName,x=null!=q&&Object.prototype.hasOwnProperty.call(this.remoteInvokableFns,q)?this.remoteInvokableFns[q]:null;if(null!=x&&"function"===typeof this[q]){if(x.allowedDomains){for(var A=!1,E=0;E<x.allowedDomains.length;E++)if(f=="https://"+x.allowedDomains[E]){A=!0;break}if(!A){l(null,"Invalid Call: "+q+" is not allowed.");return}}var K=c.functionArgs;Array.isArray(K)||(K=[]);if(x.isAsync)K.push(function(){l(Array.prototype.slice.apply(arguments))}),K.push(function(V){l(null,
+V||"Unkown Error")}),this[q].apply(this,K);else{var Q=this[q].apply(this,K);l([Q])}}else l(null,"Invalid Call: "+q+" is not found.")}catch(V){l(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var q=l.open("database",2);q.onupgradeneeded=function(x){try{var A=q.result;1>x.oldVersion&&A.createObjectStore("objects",{keyPath:"key"});2>x.oldVersion&&
+(A.createObjectStore("files",{keyPath:"title"}),A.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(E){null!=f&&f(E)}};q.onsuccess=mxUtils.bind(this,function(x){try{var A=q.result;this.database=A;EditorUi.migrateStorageFiles&&(StorageFile.migrate(A),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(E){if((!E||
+"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var K=document.createElement("iframe");K.style.display="none";K.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(K);var Q=!0,V=!1,J,ia=0,Y=mxUtils.bind(this,function(){V=!0;this.setDatabaseItem(".drawioMigrated3",!0);K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),aa=mxUtils.bind(this,function(){ia++;
+ja()}),ja=mxUtils.bind(this,function(){try{if(ia>=J.length)Y();else{var ua=J[ia];StorageFile.getFileContent(this,ua,mxUtils.bind(this,function(Da){null==Da||".scratchpad"==ua&&Da==this.emptyLibraryXml?K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[ua]}),"*"):aa()}),aa)}}catch(Da){console.log(Da)}}),la=mxUtils.bind(this,function(ua){try{this.setDatabaseItem(null,[{title:ua.title,size:ua.data.length,lastModified:Date.now(),type:ua.isLib?
+"L":"F"},{title:ua.title,data:ua.data}],aa,aa,["filesInfo","files"])}catch(Da){console.log(Da)}});E=mxUtils.bind(this,function(ua){try{if(ua.source==K.contentWindow){var Da={};try{Da=JSON.parse(ua.data)}catch(ha){}"init"==Da.event?(K.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=Da.event||V||(Q?null!=Da.resp&&0<Da.resp.length&&null!=
+Da.resp[0]?(J=Da.resp[0],Q=!1,ja()):Y():null!=Da.resp&&0<Da.resp.length&&null!=Da.resp[0]?la(Da.resp[0]):aa())}}catch(ha){console.log(ha)}});window.addEventListener("message",E)}})));c(A);A.onversionchange=function(){A.close()}}catch(E){null!=f?f(E):null!=window.console&&console.warn(E)}});q.onerror=f;q.onblocked=function(){}}catch(x){null!=f?f(x):null!=window.console&&console.error(x)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,
+f,l,q,x){this.openDatabase(mxUtils.bind(this,function(A){try{x=x||"objects";Array.isArray(x)||(x=[x],c=[c],f=[f]);var E=A.transaction(x,"readwrite");E.oncomplete=l;E.onerror=q;for(A=0;A<x.length;A++)E.objectStore(x[A]).put(null!=c&&null!=c[A]?{key:c[A],data:f[A]}:f[A])}catch(K){null!=q&&q(K)}}),q)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c]);var A=x.transaction(q,"readwrite");A.oncomplete=
+f;A.onerror=l;for(x=0;x<q.length;x++)A.objectStore(q[x]).delete(c[x])}catch(E){null!=l&&l(E)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";var A=x.transaction([q],"readonly").objectStore(q).get(c);A.onsuccess=function(){f(A.result)};A.onerror=l}catch(E){null!=l&&l(E)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(q){try{l=l||"objects";var x=q.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),
+A=[];x.onsuccess=function(E){null==E.target.result?c(A):(A.push(E.target.result.value),E.target.result.continue())};x.onerror=f}catch(E){null!=f&&f(E)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(q){try{l=l||"objects";var x=q.transaction([l],"readonly").objectStore(l).getAllKeys();x.onsuccess=function(){c(x.result)};x.onerror=f}catch(A){null!=f&&f(A)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=
+c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var l=this.getCurrentFile();null!=l?l.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,l){var q=this.getCurrentFile();null!=q?q.addComment(c,f,l):f(Date.now())};EditorUi.prototype.canReplyToReplies=
+function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.anchoredCommentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.anchoredCommentsSupported():!1};EditorUi.prototype.mentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionsSupported():!1};EditorUi.prototype.freeMentionsSupported=function(){var c=this.getCurrentFile();
+return null!=c?c.freeMentionsSupported():!1};EditorUi.prototype.mentionsLiveSearch=function(){var c=this.getCurrentFile();return null!=c?c.mentionsLiveSearch():!1};EditorUi.prototype.mentionNotificationsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionNotificationsSupported():!0};EditorUi.prototype.getMentionCandidates=function(c,f,l){var q=this.getCurrentFile();null!=q?q.getMentionCandidates(c,f,l):c([])};EditorUi.prototype.serializeMention=function(c){return"+"+c.email};
+EditorUi.prototype.parseMentionTokens=function(c){for(var f=/[+@]([A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,})/g,l=[],q=0,x;null!=(x=f.exec(c));)x.index>q&&l.push(c.substring(q,x.index)),l.push({email:x[1]}),q=x.index+x[0].length;q<c.length&&l.push(c.substring(q));return l};EditorUi.prototype.getCommentCacheTarget=function(){var c=this.getCurrentFile();return null!=c?c:this};EditorUi.prototype.refreshCommentCache=function(c,f){if(this.commentsSupported()){var l=this.getCommentCacheTarget();
+if(null!=l.commentCacheCallbacks)l.commentCacheCallbacks.push([c,f]);else{l.commentCacheCallbacks=[[c,f]];var q=mxUtils.bind(this,function(x,A){var E=l.commentCacheCallbacks;l.commentCacheCallbacks=null;for(var K=0;null!=E&&K<E.length;K++)if(null!=E[K][x])E[K][x](A)});this.getComments(mxUtils.bind(this,function(x){this.getCommentCacheTarget()==l&&(l.commentCache=x,this.fireEvent(new mxEventObject("commentsChanged")));q(0,x)}),mxUtils.bind(this,function(x){q(1,x)}))}}else null!=c&&c(null)};EditorUi.prototype.commentsUpdated=
+function(){if(this.commentsSupported()){var c=this.getCurrentFile();null!=c&&null!=c.sync&&c.sync.sendCommentsChangedMessage();this.refreshCommentCache()}};EditorUi.prototype.getUnresolvedCommentCount=function(){var c=this.getCommentCacheTarget().commentCache,f=0;if(null!=c)for(var l=0;l<c.length;l++)c[l].isResolved||f++;return f};EditorUi.prototype.getCommentAnchorCells=function(c){var f=c.getAnchorCellIds(),l=[];if(null!=f&&0<f.length){c=c.getAnchorPageId();var q=null==c?this.currentPage:this.getPageById(c);
+if(null!=q)if(q==this.currentPage)for(c=0;c<f.length;c++)q=this.editor.graph.model.getCell(f[c]),null!=q&&l.push(q);else{try{this.updatePageRoot(q)}catch(K){return l}if(null!=q.root){var x={},A=0;for(c=0;c<f.length;c++)x[f[c]]||(x[f[c]]=!0,A++);var E=function(K){if(0<A){x[K.getId()]&&(x[K.getId()]=!1,l.push(K),A--);for(var Q=0;Q<K.getChildCount();Q++)E(K.getChildAt(Q))}};E(q.root)}}}return l};EditorUi.prototype.gotoCommentAnchor=function(c){var f=c.getAnchorPageId();if(null!=f&&null!=this.currentPage&&
+f!=this.currentPage.getId()){f=this.getPageById(f);if(null==f)return!1;this.selectPage(f)}f=this.editor.graph;var l=c.getAnchorCellIds();if(null!=l&&0<l.length){c=[];for(var q=0;q<l.length;q++){var x=f.model.getCell(l[q]);null!=x&&c.push(x)}return 0<c.length?(f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c,"#0071e3",2E3),f.scrollCellToVisible(c[0]),!0):!1}l=c.getAnchorRect();null!=l&&0<l.w&&0<l.h&&f.fitWindow(new mxRectangle(l.x,l.y,l.w,l.h),0);c=c.getAnchorPoint();if(null!=c){l=f.view.scale;
+q=f.view.translate;f=f.container;f.scrollLeft=Math.round((c.x+q.x)*l-f.clientWidth/2);f.scrollTop=Math.round((c.y+q.y)*l-f.clientHeight/2);var A=document.createElement("div");A.className="geCommentAnchorMarker";A.style.left=Math.round((c.x+q.x)*l)+"px";A.style.top=Math.round((c.y+q.y)*l)+"px";f.appendChild(A);window.setTimeout(function(){null!=A.parentNode&&A.parentNode.removeChild(A)},2E3)}return!0};EditorUi.prototype.addCommentsBadge=function(c){var f=document.createElement("span");f.className=
+"geCommentsBadge";f.style.display="none";c.appendChild(f);c=mxUtils.bind(this,function(){var l=this.getUnresolvedCommentCount();f.style.display=0<l?"":"none";f.innerText="";mxUtils.write(f,99<l?"99+":String(l))});this.addListener("commentsChanged",c);this.editor.addListener("fileLoaded",c);c();return f};EditorUi.prototype.installCommentDragSource=function(c){var f=this,l=document.createElement("div");l.style.width="24px";l.style.height="24px";l.style.backgroundImage="url("+Editor.lightDarkCommentImage+
+")";l.style.backgroundSize="100% 100%";l.style.opacity="0.9";c=mxUtils.makeDraggable(c,function(){return f.editor.graph},function(x,A,E,K,Q){null!=f.currentPage&&null!=f.menus&&null!=f.menus.showCommentsWindow&&(x=null!=E?{p:f.currentPage.getId(),c:E.id}:{p:f.currentPage.getId(),pt:{x:Math.round(K),y:Math.round(Q)}},f.menus.showCommentsWindow(null,x))},l);var q=c.mouseDown;c.mouseDown=function(x){mxEvent.isMouseEvent(x)&&!mxEvent.isPopupTrigger(x)&&f.commentsSupported()&&f.anchoredCommentsSupported()&&
+f.canComment()&&q.apply(this,arguments)};return c};EditorUi.prototype.updateCommentOverlays=function(){var c=this.editor.graph;if(null!=this.commentOverlays)for(var f=0;f<this.commentOverlays.length;f++)c.removeCellOverlay(this.commentOverlays[f].cell,this.commentOverlays[f].overlay);this.commentOverlays=null;var l=this.getCurrentFile();if(null!=l&&l.anchoredCommentsSupported()&&null!=l.commentCache&&!this.editor.isChromelessView()){var q=null!=this.currentPage?this.currentPage.getId():null,x={};
+for(f=0;f<l.commentCache.length;f++){var A=l.commentCache[f],E=A.getAnchorCellIds();if(!A.isResolved&&null!=E&&A.getAnchorPageId()==q)for(A=0;A<E.length;A++)x[E[A]]=!0}this.commentOverlays=[];for(var K in x)mxUtils.bind(this,function(Q){var V=c.model.getCell(Q);if(null!=V){var J=new mxCellOverlay(new mxImage(Editor.lightDarkCommentImage,16,16),mxResources.get("comments"),mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,new mxPoint(8,8));J.isCommentOverlay=!0;J.cursor="pointer";J.addListener(mxEvent.CLICK,
+mxUtils.bind(this,function(){null!=this.menus&&null!=this.menus.showCommentsWindow&&this.menus.showCommentsWindow(Q)}));c.addCellOverlay(V,J);this.commentOverlays.push({cell:V,overlay:J})}})(K)}};EditorUi.prototype.newComment=function(c,f){var l=this.getCurrentFile();return null!=l?l.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=
+function(c,f){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=
+function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,q,x,A,E,K){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,q,x,A,E,K)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=
+function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la)};EditorUi.prototype.createImageUrlConverter=
+function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,q){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,q)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");
+return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,l,q){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,l,q)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,l,q,x){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,l,q,x)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==
+localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var l=localStorage.key(f),q=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<q.length){var x="<mxfile "===q.substring(0,8)||"<?xml"===q.substring(0,5)||"\x3c!--[if IE]>"===q.substring(0,12);q="<mxlibrary>"===q.substring(0,11);(x||q)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&
+"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
+var CommentsWindow=function(b,d,m,p,t,n){function y(){for(var ma=U.getElementsByTagName("div"),ta=0,va=0;va<ma.length;va++)"none"!=ma[va].style.display&&ma[va].parentNode==U&&ta++;W.style.display=0==ta?"block":"none"}function C(ma){for(var ta=0;ta<ha.length;ta++)if(null!=ha[ta].email&&null!=ma&&ha[ta].email.toLowerCase()==ma.toLowerCase())return ha[ta].displayName||ma;return ma}function O(ma){var ta=document.createElement("span");ta.className="geCommentMention";ta.setAttribute("data-mention",b.serializeMention(ma));
+null!=ma.email&&ta.setAttribute("data-email",ma.email);ta.contentEditable="false";mxUtils.write(ta,"@"+(ma.displayName||(null!=ma.email?C(ma.email):ma.id)));return ta}function F(ma,ta){ma.innerText="";ta=null!=ta?ta:"";if(aa){ta=b.parseMentionTokens(ta);for(var va=0;va<ta.length;va++)"string"===typeof ta[va]?mxUtils.write(ma,ta[va]):ma.appendChild(O(ta[va]))}else mxUtils.write(ma,ta)}function N(ma,ta,va,Ga){function La(Ra){for(var $a in ab)for(var fb=0;fb<ab[$a].length;fb++)Ra(ab[$a][fb],"down"==
$a?hb:"move"==$a?wb:Fa)}function Ia(Ra){Ra=mxUtils.convertPoint(Na,mxEvent.getClientX(Ra),mxEvent.getClientY(Ra));return new mxPoint(Ra.x/Ka.view.scale-Ka.view.translate.x,Ra.y/Ka.view.scale-Ka.view.translate.y)}function Ca(){La(function(Ra,$a){document.removeEventListener(Ra,$a,!0)});document.removeEventListener("keydown",cb,!0);window.setTimeout(function(){document.removeEventListener("click",Wa,!0)},0);Na.classList.remove("geCommentAnchorPicking");Ka.setEnabled(Oa);null!=Ea&&null!=Ea.parentNode&&
-Ea.parentNode.removeChild(Ea)}function Pa(Ra){Ca();null!=Ra&&(ma.anchor=Ra,f(ma,ta,va))}var Ka=b.editor.graph,Na=Ka.container,Oa=Ka.isEnabled(),Ea=null,Aa=null,Ja=null,Ga=null,Ua=null;Ka.setEnabled(!1);Na.classList.add("geCommentAnchorPicking");var ab=mxClient.IS_POINTER?{down:["pointerdown"],move:["pointermove"],up:["pointerup"]}:{down:["mousedown","touchstart"],move:["mousemove","touchmove"],up:["mouseup","touchend"]},Wa=function(Ra){Na.contains(mxEvent.getSource(Ra))&&mxEvent.consume(Ra)},cb=function(Ra){27==
-Ra.keyCode&&(Pa(null),mxEvent.consume(Ra))},hb=function(Ra){Na.contains(mxEvent.getSource(Ra))?(Aa=Ia(Ra),Ja=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra)),Ha&&(Ea=document.createElement("div"),Ea.className="geCommentAnchorPickPreview",Na.appendChild(Ea)),mxEvent.consume(Ra)):Pa(null)},wb=function(Ra){if(null!=Aa&&(Ga=Ia(Ra),Ua=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra)),null!=Ea)){var $a=Ka.view.scale,fb=Ka.view.translate;Ea.style.left=Math.round((Math.min(Aa.x,Ga.x)+fb.x)*
-$a)+"px";Ea.style.top=Math.round((Math.min(Aa.y,Ga.y)+fb.y)*$a)+"px";Ea.style.width=Math.round(Math.abs(Ga.x-Aa.x)*$a)+"px";Ea.style.height=Math.round(Math.abs(Ga.y-Aa.y)*$a)+"px";mxEvent.consume(Ra)}},Fa=function(Ra){if(null!=Aa)if(null==b.currentPage)Pa(null);else{var $a=b.currentPage.getId();if(Ha){var fb=Ga,rb=Ua;try{fb=Ia(Ra),rb=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra))}catch(mb){}null==fb||null==rb||4>Math.abs(rb.x-Ja.x)&&4>Math.abs(rb.y-Ja.y)?Pa(null):Pa({p:$a,r:{x:Math.round(Math.min(Aa.x,
+Ea.parentNode.removeChild(Ea)}function Pa(Ra){Ca();null!=Ra&&(ma.anchor=Ra,f(ma,ta,va))}var Ka=b.editor.graph,Na=Ka.container,Oa=Ka.isEnabled(),Ea=null,Aa=null,Ja=null,Ha=null,Ua=null;Ka.setEnabled(!1);Na.classList.add("geCommentAnchorPicking");var ab=mxClient.IS_POINTER?{down:["pointerdown"],move:["pointermove"],up:["pointerup"]}:{down:["mousedown","touchstart"],move:["mousemove","touchmove"],up:["mouseup","touchend"]},Wa=function(Ra){Na.contains(mxEvent.getSource(Ra))&&mxEvent.consume(Ra)},cb=function(Ra){27==
+Ra.keyCode&&(Pa(null),mxEvent.consume(Ra))},hb=function(Ra){Na.contains(mxEvent.getSource(Ra))?(Aa=Ia(Ra),Ja=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra)),Ga&&(Ea=document.createElement("div"),Ea.className="geCommentAnchorPickPreview",Na.appendChild(Ea)),mxEvent.consume(Ra)):Pa(null)},wb=function(Ra){if(null!=Aa&&(Ha=Ia(Ra),Ua=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra)),null!=Ea)){var $a=Ka.view.scale,fb=Ka.view.translate;Ea.style.left=Math.round((Math.min(Aa.x,Ha.x)+fb.x)*
+$a)+"px";Ea.style.top=Math.round((Math.min(Aa.y,Ha.y)+fb.y)*$a)+"px";Ea.style.width=Math.round(Math.abs(Ha.x-Aa.x)*$a)+"px";Ea.style.height=Math.round(Math.abs(Ha.y-Aa.y)*$a)+"px";mxEvent.consume(Ra)}},Fa=function(Ra){if(null!=Aa)if(null==b.currentPage)Pa(null);else{var $a=b.currentPage.getId();if(Ga){var fb=Ha,rb=Ua;try{fb=Ia(Ra),rb=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra))}catch(mb){}null==fb||null==rb||4>Math.abs(rb.x-Ja.x)&&4>Math.abs(rb.y-Ja.y)?Pa(null):Pa({p:$a,r:{x:Math.round(Math.min(Aa.x,
fb.x)),y:Math.round(Math.min(Aa.y,fb.y)),w:Math.round(Math.abs(fb.x-Aa.x)),h:Math.round(Math.abs(fb.y-Aa.y))}})}else Pa({p:$a,pt:{x:Math.round(Aa.x),y:Math.round(Aa.y)}});mxEvent.consume(Ra)}};window.setTimeout(function(){La(function(Ra,$a){document.addEventListener(Ra,$a,!0)});document.addEventListener("click",Wa,!0);document.addEventListener("keydown",cb,!0)},0)}function R(ma){ma=null!=ma?mxUtils.trim(ma.replace(/\s+/g," ")):"";25<ma.length&&(ma=ma.substring(0,25)+"…");return ma}function c(ma){var ta=
-"";try{var va=b.editor.graph.getLabel(ma);"string"===typeof va&&(ta=Editor.convertHtmlToText(va))}catch(Ha){}return R(ta)||mxResources.get("shape")}function f(ma,ta,va){function Ha(Ga){if(va){var Ua=document.createElement("span");Ua.className="geCommentAnchorRemove";Ua.setAttribute("title",mxResources.get("remove"));mxUtils.write(Ua,"×");mxEvent.addListener(Ua,"click",function(ab){ma.anchor=null;f(ma,ta,va);ab.preventDefault();mxEvent.consume(ab)});Ga.appendChild(Ua)}}function La(Ga,Ua,ab,Wa){var cb=
-document.createElement(Wa?"span":"a");cb.className="geCommentAnchorChip"+(Wa?" geCommentAnchorChipDeleted":"");cb.innerHTML=Ga;Ga=document.createElement("span");mxUtils.write(Ga,Ua);cb.appendChild(Ga);Wa||(null!=ab&&cb.setAttribute("title",ab),mxEvent.addListener(cb,"click",function(hb){b.gotoCommentAnchor(ma);hb.preventDefault();mxEvent.consume(hb)}));Ha(cb);ta.appendChild(cb)}ta.innerText="";ta.style.display="";if(null!=ma.getAnchorCellId()){var Ia=b.getCommentAnchorCells(ma),Ca=null,Pa=null;if(0==
+"";try{var va=b.editor.graph.getLabel(ma);"string"===typeof va&&(ta=Editor.convertHtmlToText(va))}catch(Ga){}return R(ta)||mxResources.get("shape")}function f(ma,ta,va){function Ga(Ha){if(va){var Ua=document.createElement("span");Ua.className="geCommentAnchorRemove";Ua.setAttribute("title",mxResources.get("remove"));mxUtils.write(Ua,"×");mxEvent.addListener(Ua,"click",function(ab){ma.anchor=null;f(ma,ta,va);ab.preventDefault();mxEvent.consume(ab)});Ha.appendChild(Ua)}}function La(Ha,Ua,ab,Wa){var cb=
+document.createElement(Wa?"span":"a");cb.className="geCommentAnchorChip"+(Wa?" geCommentAnchorChipDeleted":"");cb.innerHTML=Ha;Ha=document.createElement("span");mxUtils.write(Ha,Ua);cb.appendChild(Ha);Wa||(null!=ab&&cb.setAttribute("title",ab),mxEvent.addListener(cb,"click",function(hb){b.gotoCommentAnchor(ma);hb.preventDefault();mxEvent.consume(hb)}));Ga(cb);ta.appendChild(cb)}ta.innerText="";ta.style.display="";if(null!=ma.getAnchorCellId()){var Ia=b.getCommentAnchorCells(ma),Ca=null,Pa=null;if(0==
Ia.length)Ca=mxResources.get("shapeDeleted");else if(1==Ia.length)Ca=c(Ia[0]),Pa=mxResources.get("shape");else{Ca=Ia.length+" "+mxResources.get("cells");Pa=[];for(var Ka=0;Ka<Ia.length;Ka++)Pa.push(c(Ia[Ka]));Pa=Pa.join("\n")}La('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
Ca,Pa,0==Ia.length)}else if(null!=ma.getAnchorPageId())Ia=b.getPageById(ma.getAnchorPageId()),Pa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 1.5h5.5L12.5 4.5v10h-8.5z M9.5 1.5v3h3"/></svg>',Ca=null,null!=ma.getAnchorRect()?(Pa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="8" rx="1" stroke-dasharray="2.6 2.2"/></svg>',
Ca="area"):null!=ma.getAnchorPoint()&&(Pa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',Ca="point"),Ca=null==Ia?mxResources.get("pageNotFound"):null!=Ca?mxResources.get(Ca):R(Ia.getName())||mxResources.get("page"),La(Pa,Ca,null!=Ia?Ia.getName()||
-mxResources.get("page"):null,null==Ia);else if(va&&null!=b.currentPage){var Na=function(Ga,Ua,ab){var Wa=document.createElement("div");Wa.className="geCommentMentionRow";Wa.innerHTML=Ga;Ga=document.createElement("span");mxUtils.write(Ga,Ua);Wa.appendChild(Ga);mxEvent.addListener(Wa,"mousedown",function(cb){Oa();ab();f(ma,ta,va);cb.preventDefault();mxEvent.consume(cb)});Aa.appendChild(Wa)},Oa=function(){null!=Aa&&null!=Aa.parentNode&&Aa.parentNode.removeChild(Aa);Aa=null;null!=Ja&&(mxEvent.removeListener(document,
+mxResources.get("page"):null,null==Ia);else if(va&&null!=b.currentPage){var Na=function(Ha,Ua,ab){var Wa=document.createElement("div");Wa.className="geCommentMentionRow";Wa.innerHTML=Ha;Ha=document.createElement("span");mxUtils.write(Ha,Ua);Wa.appendChild(Ha);mxEvent.addListener(Wa,"mousedown",function(cb){Oa();ab();f(ma,ta,va);cb.preventDefault();mxEvent.consume(cb)});Aa.appendChild(Wa)},Oa=function(){null!=Aa&&null!=Aa.parentNode&&Aa.parentNode.removeChild(Aa);Aa=null;null!=Ja&&(mxEvent.removeListener(document,
"mousedown",Ja),Ja=null)},Ea=document.createElement("a");Ea.className="geCommentAnchorChip geCommentAnchorAttach";Ea.setAttribute("title",mxResources.get("attach"));Ea.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8M4.5 6.5L8 10l3.5-3.5M3 13h10"/></svg>';Ca=document.createElement("span");mxUtils.write(Ca,mxResources.get("attach"));Ea.appendChild(Ca);var Aa=
-null,Ja=null;mxEvent.addListener(Ea,"click",function(Ga){if(null!=Aa)Oa();else if(null!=b.currentPage){var Ua=b.editor.graph,ab=b.currentPage.getId();Aa=document.createElement("div");Aa.className="geCommentMentionMenu";1==Ua.getSelectionCount()?Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
+null,Ja=null;mxEvent.addListener(Ea,"click",function(Ha){if(null!=Aa)Oa();else if(null!=b.currentPage){var Ua=b.editor.graph,ab=b.currentPage.getId();Aa=document.createElement("div");Aa.className="geCommentMentionMenu";1==Ua.getSelectionCount()?Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
c(Ua.getSelectionCell()),function(){ma.anchor={p:ab,c:Ua.getSelectionCell().id}}):1<Ua.getSelectionCount()&&Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',Ua.getSelectionCount()+" "+mxResources.get("cells"),function(){for(var Wa=
Ua.getSelectionCells(),cb=[],hb=0;hb<Wa.length;hb++)cb.push(Wa[hb].id);ma.anchor={p:ab,c:cb}});Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',mxResources.get("point")+"…",function(){N(ma,ta,va,!1)});Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="8" rx="1" stroke-dasharray="2.6 2.2"/></svg>',
mxResources.get("area")+"…",function(){N(ma,ta,va,!0)});Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 1.5h5.5L12.5 4.5v10h-8.5z M9.5 1.5v3h3"/></svg>',mxResources.get("currentPage"),function(){ma.anchor={p:ab}});Aa.style.left=Ea.offsetLeft+"px";Aa.style.top=Ea.offsetTop+Ea.offsetHeight+2+"px";ta.parentNode.insertBefore(Aa,ta.nextSibling);Ja=function(Wa){Wa=mxEvent.getSource(Wa);
-null==Aa||Wa==Ea||Ea.contains(Wa)||Aa.contains(Wa)||Oa()};mxEvent.addListener(document,"mousedown",Ja)}Ga.preventDefault();mxEvent.consume(Ga)});ta.appendChild(Ea)}else ta.style.display="none"}function l(ma){if("TEXTAREA"==ma.nodeName)return ma.value;var ta=[],va=function(Ha){for(Ha=Ha.firstChild;null!=Ha;Ha=Ha.nextSibling)3==Ha.nodeType?ta.push(Ha.nodeValue):1==Ha.nodeType&&("BR"==Ha.nodeName?ta.push("\n"):null!=Ha.getAttribute&&null!=Ha.getAttribute("data-mention")?ta.push(Ha.getAttribute("data-mention")):
-(("DIV"==Ha.nodeName||"P"==Ha.nodeName)&&0<ta.length&&"\n"!=ta[ta.length-1]&&!/\n$/.test(ta[ta.length-1])&&ta.push("\n"),va(Ha)))};va(ma);return ta.join("").replace(/\u00a0/g," ")}function q(ma){function ta(){null!=Ca&&null!=Ca.parentNode&&Ca.parentNode.removeChild(Ca);Na=Ca=null}function va(){var Aa=window.getSelection();if(null==Aa||0==Aa.rangeCount)return null;Aa=Aa.getRangeAt(0);if(!Aa.collapsed||3!=Aa.startContainer.nodeType||!ma.contains(Aa.startContainer))return null;var Ja=Aa.startContainer.nodeValue.substring(0,
-Aa.startOffset);Ja=/(^|[\s\u00a0])@([^\s\u00a0]*)$/.exec(Ja);return null==Ja?null:{node:Aa.startContainer,start:Ja.index+Ja[1].length,end:Aa.startOffset,query:Ja[2]}}function Ha(Aa){if(null!=Na){var Ja=Na.node,Ga=Ja.nodeValue.substring(Na.end);Ja.nodeValue=Ja.nodeValue.substring(0,Na.start);Aa=O(Aa);Ga=document.createTextNode(" "+Ga);Ja.parentNode.insertBefore(Aa,Ja.nextSibling);Aa.parentNode.insertBefore(Ga,Aa.nextSibling);ua||null!=Ea||(Ea=document.createElement("div"),Ea.style.cssText="font-size:11px;opacity:0.7;padding:2px 0;",
-mxUtils.write(Ea,mxResources.get("mentionNoNotify",null,"People you mention are not notified")),ma.parentNode.insertBefore(Ea,ma.nextSibling));Ja=window.getSelection();Aa=document.createRange();Aa.setStart(Ga,1);Aa.collapse(!0);Ja.removeAllRanges();Ja.addRange(Aa);ta()}}function La(){Na=va();if(null==Na)ta();else if(ja)null!=Oa&&window.clearTimeout(Oa),Oa=window.setTimeout(function(){Oa=null;if(null!=Na){var ab=Na.query;b.getMentionCandidates(function(Wa){null!=Na&&Na.query==ab&&Ia(Wa.slice(0,6))},
-function(){},ab)}},300);else{for(var Aa=Na.query.toLowerCase(),Ja=[],Ga=0;Ga<ha.length&&6>Ja.length;Ga++){var Ua=ha[Ga];(0==Aa.length||null!=Ua.displayName&&0<=Ua.displayName.toLowerCase().indexOf(Aa)||null!=Ua.email&&0<=Ua.email.toLowerCase().indexOf(Aa))&&Ja.push(Ua)}if(ka&&/^[A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}$/.test(Na.query)){Ua=!1;for(Ga=0;Ga<Ja.length;Ga++)if(null!=Ja[Ga].email&&Ja[Ga].email.toLowerCase()==Aa){Ua=!0;break}Ua||Ja.push({email:Na.query})}Ia(Ja)}}function Ia(Aa){Ka=
-Aa;if(0==Ka.length)ta();else for(Pa=Math.min(Pa,Ka.length-1),null==Ca&&(Ca=document.createElement("div"),Ca.className="geCommentMentionMenu",ma.parentNode.insertBefore(Ca,ma.nextSibling)),Ca.style.left=ma.offsetLeft+"px",Ca.style.top=ma.offsetTop+ma.offsetHeight+"px",Ca.innerText="",Aa=0;Aa<Ka.length;Aa++)(function(Ja,Ga){var Ua=document.createElement("div");Ua.className="geCommentMentionRow"+(Ga==Pa?" geCommentMentionRowSelected":"");Ga=null;null==Ja.pictureUrl&&Ja.isGroup?(Ga=document.createElement("span"),
-Ga.className="geCommentMentionImg",Ga.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="6" cy="5.5" r="2.4"/><path d="M1.5 13.5c0-2.6 2-3.9 4.5-3.9s4.5 1.3 4.5 3.9"/><circle cx="11.3" cy="6" r="2"/><path d="M12.3 10.1c1.6.5 2.2 1.6 2.2 3.4"/></svg>'):(Ga=document.createElement("img"),Ga.className="geCommentMentionImg",Ga.src=null!=Ja.pictureUrl?Ja.pictureUrl:
-Editor.userImage);Ua.appendChild(Ga);Ga=document.createElement("span");mxUtils.write(Ga,Ja.displayName||Ja.email);Ua.appendChild(Ga);Ja.isGroup&&(Ga=document.createElement("span"),Ga.className="geCommentMentionGroupTag",mxUtils.write(Ga,mxResources.get("group")),Ua.appendChild(Ga));null!=Ja.displayName&&null!=Ja.email&&(Ga=document.createElement("span"),Ga.className="geCommentMentionMail",mxUtils.write(Ga,Ja.email),Ua.appendChild(Ga));mxEvent.addListener(Ua,"mousedown",function(ab){Ha(Ja);ab.preventDefault();
-mxEvent.consume(ab)});Ca.appendChild(Ua)})(Ka[Aa],Aa)}var Ca=null,Pa=0,Ka=[],Na=null,Oa=null,Ea=null;mxEvent.addListener(ma,"keydown",function(Aa){null==Ca||mxEvent.isConsumed(Aa)||(40==Aa.keyCode||38==Aa.keyCode?(Pa=(Pa+(40==Aa.keyCode?1:Ka.length-1))%Ka.length,La(),Aa.preventDefault(),mxEvent.consume(Aa)):13!=Aa.keyCode&&9!=Aa.keyCode||mxEvent.isControlDown(Aa)||mxEvent.isMetaDown(Aa)?27==Aa.keyCode&&(ta(),Aa.preventDefault(),mxEvent.consume(Aa)):(Ha(Ka[Pa]),Aa.preventDefault(),mxEvent.consume(Aa)))});
+null==Aa||Wa==Ea||Ea.contains(Wa)||Aa.contains(Wa)||Oa()};mxEvent.addListener(document,"mousedown",Ja)}Ha.preventDefault();mxEvent.consume(Ha)});ta.appendChild(Ea)}else ta.style.display="none"}function l(ma){if("TEXTAREA"==ma.nodeName)return ma.value;var ta=[],va=function(Ga){for(Ga=Ga.firstChild;null!=Ga;Ga=Ga.nextSibling)3==Ga.nodeType?ta.push(Ga.nodeValue):1==Ga.nodeType&&("BR"==Ga.nodeName?ta.push("\n"):null!=Ga.getAttribute&&null!=Ga.getAttribute("data-mention")?ta.push(Ga.getAttribute("data-mention")):
+(("DIV"==Ga.nodeName||"P"==Ga.nodeName)&&0<ta.length&&"\n"!=ta[ta.length-1]&&!/\n$/.test(ta[ta.length-1])&&ta.push("\n"),va(Ga)))};va(ma);return ta.join("").replace(/\u00a0/g," ")}function q(ma){function ta(){null!=Ca&&null!=Ca.parentNode&&Ca.parentNode.removeChild(Ca);Na=Ca=null}function va(){var Aa=window.getSelection();if(null==Aa||0==Aa.rangeCount)return null;Aa=Aa.getRangeAt(0);if(!Aa.collapsed||3!=Aa.startContainer.nodeType||!ma.contains(Aa.startContainer))return null;var Ja=Aa.startContainer.nodeValue.substring(0,
+Aa.startOffset);Ja=/(^|[\s\u00a0])@([^\s\u00a0]*)$/.exec(Ja);return null==Ja?null:{node:Aa.startContainer,start:Ja.index+Ja[1].length,end:Aa.startOffset,query:Ja[2]}}function Ga(Aa){if(null!=Na){var Ja=Na.node,Ha=Ja.nodeValue.substring(Na.end);Ja.nodeValue=Ja.nodeValue.substring(0,Na.start);Aa=O(Aa);Ha=document.createTextNode(" "+Ha);Ja.parentNode.insertBefore(Aa,Ja.nextSibling);Aa.parentNode.insertBefore(Ha,Aa.nextSibling);ua||null!=Ea||(Ea=document.createElement("div"),Ea.style.cssText="font-size:11px;opacity:0.7;padding:2px 0;",
+mxUtils.write(Ea,mxResources.get("mentionNoNotify",null,"People you mention are not notified")),ma.parentNode.insertBefore(Ea,ma.nextSibling));Ja=window.getSelection();Aa=document.createRange();Aa.setStart(Ha,1);Aa.collapse(!0);Ja.removeAllRanges();Ja.addRange(Aa);ta()}}function La(){Na=va();if(null==Na)ta();else if(ja)null!=Oa&&window.clearTimeout(Oa),Oa=window.setTimeout(function(){Oa=null;if(null!=Na){var ab=Na.query;b.getMentionCandidates(function(Wa){null!=Na&&Na.query==ab&&Ia(Wa.slice(0,6))},
+function(){},ab)}},300);else{for(var Aa=Na.query.toLowerCase(),Ja=[],Ha=0;Ha<ha.length&&6>Ja.length;Ha++){var Ua=ha[Ha];(0==Aa.length||null!=Ua.displayName&&0<=Ua.displayName.toLowerCase().indexOf(Aa)||null!=Ua.email&&0<=Ua.email.toLowerCase().indexOf(Aa))&&Ja.push(Ua)}if(la&&/^[A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}$/.test(Na.query)){Ua=!1;for(Ha=0;Ha<Ja.length;Ha++)if(null!=Ja[Ha].email&&Ja[Ha].email.toLowerCase()==Aa){Ua=!0;break}Ua||Ja.push({email:Na.query})}Ia(Ja)}}function Ia(Aa){Ka=
+Aa;if(0==Ka.length)ta();else for(Pa=Math.min(Pa,Ka.length-1),null==Ca&&(Ca=document.createElement("div"),Ca.className="geCommentMentionMenu",ma.parentNode.insertBefore(Ca,ma.nextSibling)),Ca.style.left=ma.offsetLeft+"px",Ca.style.top=ma.offsetTop+ma.offsetHeight+"px",Ca.innerText="",Aa=0;Aa<Ka.length;Aa++)(function(Ja,Ha){var Ua=document.createElement("div");Ua.className="geCommentMentionRow"+(Ha==Pa?" geCommentMentionRowSelected":"");Ha=null;null==Ja.pictureUrl&&Ja.isGroup?(Ha=document.createElement("span"),
+Ha.className="geCommentMentionImg",Ha.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="6" cy="5.5" r="2.4"/><path d="M1.5 13.5c0-2.6 2-3.9 4.5-3.9s4.5 1.3 4.5 3.9"/><circle cx="11.3" cy="6" r="2"/><path d="M12.3 10.1c1.6.5 2.2 1.6 2.2 3.4"/></svg>'):(Ha=document.createElement("img"),Ha.className="geCommentMentionImg",Ha.src=null!=Ja.pictureUrl?Ja.pictureUrl:
+Editor.userImage);Ua.appendChild(Ha);Ha=document.createElement("span");mxUtils.write(Ha,Ja.displayName||Ja.email);Ua.appendChild(Ha);Ja.isGroup&&(Ha=document.createElement("span"),Ha.className="geCommentMentionGroupTag",mxUtils.write(Ha,mxResources.get("group")),Ua.appendChild(Ha));null!=Ja.displayName&&null!=Ja.email&&(Ha=document.createElement("span"),Ha.className="geCommentMentionMail",mxUtils.write(Ha,Ja.email),Ua.appendChild(Ha));mxEvent.addListener(Ua,"mousedown",function(ab){Ga(Ja);ab.preventDefault();
+mxEvent.consume(ab)});Ca.appendChild(Ua)})(Ka[Aa],Aa)}var Ca=null,Pa=0,Ka=[],Na=null,Oa=null,Ea=null;mxEvent.addListener(ma,"keydown",function(Aa){null==Ca||mxEvent.isConsumed(Aa)||(40==Aa.keyCode||38==Aa.keyCode?(Pa=(Pa+(40==Aa.keyCode?1:Ka.length-1))%Ka.length,La(),Aa.preventDefault(),mxEvent.consume(Aa)):13!=Aa.keyCode&&9!=Aa.keyCode||mxEvent.isControlDown(Aa)||mxEvent.isMetaDown(Aa)?27==Aa.keyCode&&(ta(),Aa.preventDefault(),mxEvent.consume(Aa)):(Ga(Ka[Pa]),Aa.preventDefault(),mxEvent.consume(Aa)))});
mxEvent.addListener(ma,"input",La);mxEvent.addListener(ma,"keyup",function(Aa){37!=Aa.keyCode&&39!=Aa.keyCode&&35!=Aa.keyCode&&36!=Aa.keyCode||La()});mxEvent.addListener(ma,"blur",function(){window.setTimeout(ta,200)});mxEvent.addListener(ma,"paste",function(Aa){Aa.preventDefault();Aa=null!=Aa.clipboardData?Aa.clipboardData.getData("text/plain"):null;null!=Aa&&0<Aa.length&&document.execCommand("insertText",!1,Aa)})}function x(ma,ta){if(aa){var va=document.createElement("div");va.contentEditable=!0;
-F(va,ma);q(va)}else va=document.createElement("textarea"),va.value=ma;va.className="geCommentEditTxtArea";va.style.minHeight=ta+"px";return va}function A(ma,ta,va,Ha){function La(){ta.removeChild(Na);ta.removeChild(Ea);Ca.style.display="block";Ia.style.display="block"}u={div:ta,comment:ma,saveCallback:va,deleteOnCancel:Ha};for(var Ia=ta.querySelector(".geCommentTxt"),Ca=ta.querySelector(".geCommentActionsList"),Pa=ta.querySelectorAll(".geCommentEditTxtArea, .geCommentEditBtns, .geCommentAnchorRowEdit"),
-Ka=0;Ka<Pa.length;Ka++)Pa[Ka].parentNode==ta&&ta.removeChild(Pa[Ka]);var Na=x(ma.content,Ia.offsetHeight);ta.insertBefore(Na,Ia);var Oa=null;Da&&null==ma.id&&null==ma.pCommentId&&(Oa=document.createElement("div"),Oa.className="geCommentAnchorRow geCommentAnchorRowEdit",f(ma,Oa,!0),ta.insertBefore(Oa,Ia));var Ea=document.createElement("div");Ea.className="geCommentEditBtns";var Aa=mxUtils.button(mxResources.get("cancel"),function(){Ha?(ta.parentNode.removeChild(ta),y()):La();u=null});Aa.className=
-"geCommentEditBtn";Ea.appendChild(Aa);var Ja=mxUtils.button(mxResources.get("save"),function(){ma.content=l(Na);F(Ia,ma.content);La();null!=Oa&&f(ma,Oa,!1);va(ma);u=null});mxEvent.addListener(Na,"keydown",mxUtils.bind(this,function(Ga){mxEvent.isConsumed(Ga)||((mxEvent.isControlDown(Ga)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ga))&&13==Ga.keyCode?(Ja.click(),mxEvent.consume(Ga)):27==Ga.keyCode&&(Aa.click(),mxEvent.consume(Ga)))}));Ja.focus();Ja.className="geCommentEditBtn gePrimaryBtn";Ea.appendChild(Ja);
+F(va,ma);q(va)}else va=document.createElement("textarea"),va.value=ma;va.className="geCommentEditTxtArea";va.style.minHeight=ta+"px";return va}function A(ma,ta,va,Ga){function La(){ta.removeChild(Na);ta.removeChild(Ea);Ca.style.display="block";Ia.style.display="block"}u={div:ta,comment:ma,saveCallback:va,deleteOnCancel:Ga};for(var Ia=ta.querySelector(".geCommentTxt"),Ca=ta.querySelector(".geCommentActionsList"),Pa=ta.querySelectorAll(".geCommentEditTxtArea, .geCommentEditBtns, .geCommentAnchorRowEdit"),
+Ka=0;Ka<Pa.length;Ka++)Pa[Ka].parentNode==ta&&ta.removeChild(Pa[Ka]);var Na=x(ma.content,Ia.offsetHeight);ta.insertBefore(Na,Ia);var Oa=null;Da&&null==ma.id&&null==ma.pCommentId&&(Oa=document.createElement("div"),Oa.className="geCommentAnchorRow geCommentAnchorRowEdit",f(ma,Oa,!0),ta.insertBefore(Oa,Ia));var Ea=document.createElement("div");Ea.className="geCommentEditBtns";var Aa=mxUtils.button(mxResources.get("cancel"),function(){Ga?(ta.parentNode.removeChild(ta),y()):La();u=null});Aa.className=
+"geCommentEditBtn";Ea.appendChild(Aa);var Ja=mxUtils.button(mxResources.get("save"),function(){ma.content=l(Na);F(Ia,ma.content);La();null!=Oa&&f(ma,Oa,!1);va(ma);u=null});mxEvent.addListener(Na,"keydown",mxUtils.bind(this,function(Ha){mxEvent.isConsumed(Ha)||((mxEvent.isControlDown(Ha)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ha))&&13==Ha.keyCode?(Ja.click(),mxEvent.consume(Ha)):27==Ha.keyCode&&(Aa.click(),mxEvent.consume(Ha)))}));Ja.focus();Ja.className="geCommentEditBtn gePrimaryBtn";Ea.appendChild(Ja);
ta.insertBefore(Ea,Ia);Ca.style.display="none";Ia.style.display="none";Na.focus()}function E(ma,ta){ta.innerText="";ma=new Date(ma.modifiedDate);var va=b.timeSince(ma);null==va&&(va=mxResources.get("lessThanAMinute"));mxUtils.write(ta,mxResources.get("timeAgo",[va],"{1} ago"));ta.setAttribute("title",ma.toLocaleDateString()+" "+ma.toLocaleTimeString())}function K(ma){var ta=document.createElement("img");ta.className="geCommentBusyImg";ta.src=IMAGE_PATH+"/spin.gif";ma.appendChild(ta);ma.busyImg=ta}
-function Q(ma){ma.style.border="1px solid red";ma.busyImg.parentNode==ma&&ma.removeChild(ma.busyImg)}function V(ma){ma.style.border="";ma.busyImg.parentNode==ma&&ma.removeChild(ma.busyImg)}function J(ma,ta,va,Ha,La){function Ia(Ja,Ga,Ua){var ab=document.createElement("li");ab.className="geCommentAction";var Wa=document.createElement("a");Wa.className="geCommentActionLnk";mxUtils.write(Wa,Ja);ab.appendChild(Wa);mxEvent.addListener(Wa,"click",function(cb){Ga(cb,ma);cb.preventDefault();mxEvent.consume(cb)});
-Aa.appendChild(ab);Ua&&(ab.style.display="none")}function Ca(){function Ja(ab){Ga.push(Ua);if(null!=ab.replies)for(var Wa=0;Wa<ab.replies.length;Wa++)Ua=Ua.nextSibling,Ja(ab.replies[Wa])}var Ga=[],Ua=Ka;Ja(ma);return{pdiv:Ua,replies:Ga}}function Pa(Ja,Ga,Ua,ab,Wa){function cb(){K(Ra);ma.addReply(Fa,function($a){Fa.id=$a;ma.replies.push(Fa);V(Ra);Ua&&Ua();b.commentsUpdated()},function($a){hb();Q(Ra);b.handleError($a,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ab,Wa)}function hb(){A(Fa,
-Ra,function($a){cb()},!0)}var wb=Ca().pdiv,Fa=b.newComment(Ja,b.getCurrentUser());Fa.pCommentId=ma.id;null==ma.replies&&(ma.replies=[]);var Ra=J(Fa,ma.replies,wb,Ha+1);Ga?hb():cb()}if(La||!ma.isResolved){W.style.display="none";var Ka=document.createElement("div");Ka.className="geCommentContainer";Ka.setAttribute("data-commentId",ma.id);Ka.style.marginLeft=20*Ha+5+"px";ma.isResolved&&(H.style.opacity="0.7");var Na=document.createElement("div");Na.className="geCommentHeader";var Oa=document.createElement("img");
+function Q(ma){ma.style.border="1px solid red";ma.busyImg.parentNode==ma&&ma.removeChild(ma.busyImg)}function V(ma){ma.style.border="";ma.busyImg.parentNode==ma&&ma.removeChild(ma.busyImg)}function J(ma,ta,va,Ga,La){function Ia(Ja,Ha,Ua){var ab=document.createElement("li");ab.className="geCommentAction";var Wa=document.createElement("a");Wa.className="geCommentActionLnk";mxUtils.write(Wa,Ja);ab.appendChild(Wa);mxEvent.addListener(Wa,"click",function(cb){Ha(cb,ma);cb.preventDefault();mxEvent.consume(cb)});
+Aa.appendChild(ab);Ua&&(ab.style.display="none")}function Ca(){function Ja(ab){Ha.push(Ua);if(null!=ab.replies)for(var Wa=0;Wa<ab.replies.length;Wa++)Ua=Ua.nextSibling,Ja(ab.replies[Wa])}var Ha=[],Ua=Ka;Ja(ma);return{pdiv:Ua,replies:Ha}}function Pa(Ja,Ha,Ua,ab,Wa){function cb(){K(Ra);ma.addReply(Fa,function($a){Fa.id=$a;ma.replies.push(Fa);V(Ra);Ua&&Ua();b.commentsUpdated()},function($a){hb();Q(Ra);b.handleError($a,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ab,Wa)}function hb(){A(Fa,
+Ra,function($a){cb()},!0)}var wb=Ca().pdiv,Fa=b.newComment(Ja,b.getCurrentUser());Fa.pCommentId=ma.id;null==ma.replies&&(ma.replies=[]);var Ra=J(Fa,ma.replies,wb,Ga+1);Ha?hb():cb()}if(La||!ma.isResolved){W.style.display="none";var Ka=document.createElement("div");Ka.className="geCommentContainer";Ka.setAttribute("data-commentId",ma.id);Ka.style.marginLeft=20*Ga+5+"px";ma.isResolved&&(H.style.opacity="0.7");var Na=document.createElement("div");Na.className="geCommentHeader";var Oa=document.createElement("img");
Oa.className="geCommentUserImg";Oa.src=null!=ma.user&&null!=ma.user.pictureUrl?ma.user.pictureUrl:Editor.userImage;Na.appendChild(Oa);Oa=document.createElement("div");Oa.className="geCommentHeaderTxt";Na.appendChild(Oa);var Ea=document.createElement("div");Ea.className="geCommentUsername";mxUtils.write(Ea,null!=ma.user?ma.user.displayName:mxResources.get("unknownUser"));Oa.appendChild(Ea);Ea=document.createElement("div");Ea.className="geCommentDate";Ea.setAttribute("data-commentId",ma.id);E(ma,Ea);
-Oa.appendChild(Ea);Ka.appendChild(Na);Da&&0==Ha&&null!=ma.getAnchorCellId&&null!=ma.anchor&&(null!=ma.getAnchorCellIds()&&Ka.setAttribute("data-anchor-cell",ma.getAnchorCellIds().join(",")),null!=ma.id&&(Na=document.createElement("div"),Na.className="geCommentAnchorRow",f(ma,Na,!1),Ka.appendChild(Na)));Na=document.createElement("div");Na.className="geCommentTxt";F(Na,ma.content);Ka.appendChild(Na);ma.isLocked&&(Ka.style.opacity="0.5");Na=document.createElement("div");Na.className="geCommentActions";
-var Aa=document.createElement("ul");Aa.className="geCommentActionsList";Na.appendChild(Aa);ia||ma.isLocked||0!=Ha&&!Y||Ia(mxResources.get("reply"),function(){Pa("",!0)},ma.isResolved);Oa=b.getCurrentUser();null==Oa||null==ma.user||Oa.id!=ma.user.id||ia||ma.isLocked||(Ia(mxResources.get("edit"),function(){function Ja(){A(ma,Ka,function(){K(Ka);ma.editComment(ma.content,function(){V(Ka);b.commentsUpdated()},function(Ga){Q(Ka);Ja();b.handleError(Ga,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}
-Ja()},ma.isResolved),Ia(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){K(Ka);ma.deleteComment(function(Ja){if(!0===Ja){Ja=Ka.querySelector(".geCommentTxt");Ja.innerText="";mxUtils.write(Ja,mxResources.get("msgDeleted"));var Ga=Ka.querySelectorAll(".geCommentAction");for(Ja=0;Ja<Ga.length;Ja++)Ga[Ja].parentNode.removeChild(Ga[Ja]);V(Ka);Ka.style.opacity="0.5"}else{Ga=Ca(ma).replies;for(Ja=0;Ja<Ga.length;Ja++)T.removeChild(Ga[Ja]);for(Ja=0;Ja<ta.length;Ja++)if(ta[Ja]==
-ma){ta.splice(Ja,1);break}W.style.display=0==T.getElementsByTagName("div").length?"block":"none"}b.commentsUpdated()},function(Ja){Q(Ka);b.handleError(Ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ma.isResolved));ia||ma.isLocked||0!=Ha||Ia(ma.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Ja){function Ga(){var Ua=Ja.target;Ua.innerText="";ma.isResolved=!ma.isResolved;mxUtils.write(Ua,ma.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));
-for(var ab=ma.isResolved?"none":"",Wa=Ca(ma).replies,cb="light-dark("+(ma.isResolved?"ghostWhite":"white")+", transparent)",hb=0;hb<Wa.length;hb++){Wa[hb].style.backgroundColor=cb;for(var wb=Wa[hb].querySelectorAll(".geCommentAction"),Fa=0;Fa<wb.length;Fa++)wb[Fa]!=Ua.parentNode&&(wb[Fa].style.display=ab);la||(Wa[hb].style.display="none")}y()}ma.isResolved?Pa(mxResources.get("reOpened")+": ",!0,Ga,!1,!0):Pa(mxResources.get("markedAsResolved"),!1,Ga,!0)});Ka.appendChild(Na);null!=va?T.insertBefore(Ka,
-va.nextSibling):T.appendChild(Ka);for(va=0;null!=ma.replies&&va<ma.replies.length;va++)Na=ma.replies[va],Na.isResolved=ma.isResolved,J(Na,ma.replies,null,Ha+1,La);null!=u&&(u.comment.id==ma.id?(La=ma.content,ma.content=u.comment.content,A(ma,Ka,u.saveCallback,u.deleteOnCancel),ma.content=La):null==u.comment.id&&u.comment.pCommentId==ma.id&&(T.appendChild(u.div),A(u.comment,u.div,u.saveCallback,u.deleteOnCancel)));return Ka}}var ia=!b.canComment(),Y=b.canReplyToReplies(),aa=b.mentionsSupported(),ja=
-aa&&b.mentionsLiveSearch(),ka=aa&&b.freeMentionsSupported(),ua=!aa||b.mentionNotificationsSupported(),Da=b.anchoredCommentsSupported(),ha=[],k=null,u=null,H=document.createElement("div");H.className="geCommentsWin";var P=EditorUi.compactUi?"26px":"30px",T=document.createElement("div");T.className="geCommentsList";T.style.bottom=parseInt(P)+7+"px";H.appendChild(T);var W=document.createElement("span");W.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(W,mxResources.get("noCommentsFound"));
-var fa=document.createElement("div");fa.className="geToolbarContainer geCommentsToolbar";fa.style.height=P;fa.style.padding="3px 4px 4px 4px";P=document.createElement("a");P.className="geButton";aa&&!ja&&b.getMentionCandidates(function(ma){ha=ma;ma=T.querySelectorAll(".geCommentMention[data-email]");for(var ta=0;ta<ma.length;ta++)ma[ta].innerText="",mxUtils.write(ma[ta],"@"+C(ma[ta].getAttribute("data-email")))},function(){});var X=mxUtils.bind(this,function(ma){function ta(){A(va,Ha,function(La){K(Ha);
-b.addComment(La,function(Ia){La.id=Ia;ca.push(La);V(Ha);b.commentsUpdated()},function(Ia){Q(Ha);ta();b.handleError(Ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}if(!ia){var va=b.newComment("",b.getCurrentUser());va.anchor=null!=ma?ma:null;var Ha=J(va,ca,null,0);ta()}});this.startNewComment=X;if(!ia){var ea=P.cloneNode();ea.style.backgroundImage="url("+Editor.plusImage+")";ea.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(ea,"click",function(ma){X();
-ma.preventDefault();mxEvent.consume(ma)});fa.appendChild(ea)}var oa=P.cloneNode();oa.style.backgroundImage="url("+Editor.checkImage+")";oa.setAttribute("title",mxResources.get("showResolved"));var la=!1;mxEvent.addListener(oa,"click",function(ma){(la=!la)?oa.classList.add("geActiveItem"):oa.classList.remove("geActiveItem");qa();ma.preventDefault();mxEvent.consume(ma)});fa.appendChild(oa);b.commentsRefreshNeeded()&&(ea=P.cloneNode(),ea.style.backgroundImage="url("+Editor.refreshImage+")",ea.setAttribute("title",
-mxResources.get("refresh")),mxEvent.addListener(ea,"click",function(ma){qa();ma.preventDefault();mxEvent.consume(ma)}),fa.appendChild(ea));b.commentsSaveNeeded()&&(P=P.cloneNode(),P.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',P.setAttribute("title",mxResources.get("save")),P.className="geButton geAdaptiveAsset",mxEvent.addListener(P,"click",function(ma){n();ma.preventDefault();mxEvent.consume(ma)}),fa.appendChild(P));H.appendChild(fa);var ca=[],sa=function(ma){if(null!=
-k){for(var ta=T.childNodes,va=0;va<ta.length;va++)if(null!=ta[va].getAttribute&&null!=ta[va].getAttribute("data-anchor-cell")&&0<=mxUtils.indexOf(ta[va].getAttribute("data-anchor-cell").split(","),k)){T.scrollTop=ta[va].offsetTop-T.offsetTop;k=null;break}ma&&(k=null)}};this.scrollToCell=function(ma){k=ma;sa(!1)};var xa=mxUtils.bind(this,function(ma){function ta(Ha){if(null!=Ha){Ha.sort(function(Ia,Ca){return new Date(Ia.modifiedDate)-new Date(Ca.modifiedDate)});for(var La=0;La<Ha.length;La++)ta(Ha[La].replies)}}
-ma.sort(function(Ha,La){return new Date(Ha.modifiedDate)-new Date(La.modifiedDate)});if(null!=u){var va=u.div.querySelector(".geCommentEditTxtArea");null!=va&&(u.comment.content=l(va))}va=T.scrollTop;T.innerText="";T.appendChild(W);W.style.display="block";ca=ma;for(ma=0;ma<ca.length;ma++)ta(ca[ma].replies),J(ca[ma],ca,null,0,la);null!=u&&null==u.comment.id&&null==u.comment.pCommentId&&(T.appendChild(u.div),A(u.comment,u.div,u.saveCallback,u.deleteOnCancel));T.scrollTop=va;sa(!0)}),qa=mxUtils.bind(this,
-function(){this.hasError=!1;if(null!=u)try{u.div=u.div.cloneNode(!0);var ma=u.div.querySelector(".geCommentEditTxtArea"),ta=u.div.querySelector(".geCommentEditBtns");u.comment.content=l(ma);ma.parentNode.removeChild(ma);ta.parentNode.removeChild(ta)}catch(va){b.handleError(va)}Y=b.canReplyToReplies();b.commentsSupported()?(null!=b.getCommentCacheTarget().commentCache?null==u&&xa(b.getCommentCacheTarget().commentCache):T.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+
-'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>",b.refreshCommentCache(mxUtils.bind(this,function(va){null!=va&&null!=u&&xa(va)}),mxUtils.bind(this,function(va){null==b.getCommentCacheTarget().commentCache&&(T.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(va&&va.message?": "+va.message:"")),this.hasError=!0)}))):T.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))}),Ba=mxUtils.bind(this,function(){if(null==u){var ma=b.getCommentCacheTarget().commentCache;
-null!=ma&&(this.hasError=!1,xa(ma))}});b.addListener("commentsChanged",Ba);qa();this.refreshComments=qa;fa=mxUtils.bind(this,function(){function ma(Ia){var Ca=va[Ia.id];if(null!=Ca)for(E(Ia,Ca),Ca=0;null!=Ia.replies&&Ca<Ia.replies.length;Ca++)ma(Ia.replies[Ca])}if(this.window.isVisible()){for(var ta=T.querySelectorAll(".geCommentDate"),va={},Ha=0;Ha<ta.length;Ha++){var La=ta[Ha];va[La.getAttribute("data-commentId")]=La}for(Ha=0;Ha<ca.length;Ha++)ma(ca[Ha])}});setInterval(fa,6E4);this.refreshCommentsTime=
+Oa.appendChild(Ea);Ka.appendChild(Na);Da&&0==Ga&&null!=ma.getAnchorCellId&&null!=ma.anchor&&(null!=ma.getAnchorCellIds()&&Ka.setAttribute("data-anchor-cell",ma.getAnchorCellIds().join(",")),null!=ma.id&&(Na=document.createElement("div"),Na.className="geCommentAnchorRow",f(ma,Na,!1),Ka.appendChild(Na)));Na=document.createElement("div");Na.className="geCommentTxt";F(Na,ma.content);Ka.appendChild(Na);ma.isLocked&&(Ka.style.opacity="0.5");Na=document.createElement("div");Na.className="geCommentActions";
+var Aa=document.createElement("ul");Aa.className="geCommentActionsList";Na.appendChild(Aa);ia||ma.isLocked||0!=Ga&&!Y||Ia(mxResources.get("reply"),function(){Pa("",!0)},ma.isResolved);Oa=b.getCurrentUser();null==Oa||null==ma.user||Oa.id!=ma.user.id||ia||ma.isLocked||(Ia(mxResources.get("edit"),function(){function Ja(){A(ma,Ka,function(){K(Ka);ma.editComment(ma.content,function(){V(Ka);b.commentsUpdated()},function(Ha){Q(Ka);Ja();b.handleError(Ha,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}
+Ja()},ma.isResolved),Ia(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){K(Ka);ma.deleteComment(function(Ja){if(!0===Ja){Ja=Ka.querySelector(".geCommentTxt");Ja.innerText="";mxUtils.write(Ja,mxResources.get("msgDeleted"));var Ha=Ka.querySelectorAll(".geCommentAction");for(Ja=0;Ja<Ha.length;Ja++)Ha[Ja].parentNode.removeChild(Ha[Ja]);V(Ka);Ka.style.opacity="0.5"}else{Ha=Ca(ma).replies;for(Ja=0;Ja<Ha.length;Ja++)U.removeChild(Ha[Ja]);for(Ja=0;Ja<ta.length;Ja++)if(ta[Ja]==
+ma){ta.splice(Ja,1);break}W.style.display=0==U.getElementsByTagName("div").length?"block":"none"}b.commentsUpdated()},function(Ja){Q(Ka);b.handleError(Ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ma.isResolved));ia||ma.isLocked||0!=Ga||Ia(ma.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Ja){function Ha(){var Ua=Ja.target;Ua.innerText="";ma.isResolved=!ma.isResolved;mxUtils.write(Ua,ma.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));
+for(var ab=ma.isResolved?"none":"",Wa=Ca(ma).replies,cb="light-dark("+(ma.isResolved?"ghostWhite":"white")+", transparent)",hb=0;hb<Wa.length;hb++){Wa[hb].style.backgroundColor=cb;for(var wb=Wa[hb].querySelectorAll(".geCommentAction"),Fa=0;Fa<wb.length;Fa++)wb[Fa]!=Ua.parentNode&&(wb[Fa].style.display=ab);ka||(Wa[hb].style.display="none")}y()}ma.isResolved?Pa(mxResources.get("reOpened")+": ",!0,Ha,!1,!0):Pa(mxResources.get("markedAsResolved"),!1,Ha,!0)});Ka.appendChild(Na);null!=va?U.insertBefore(Ka,
+va.nextSibling):U.appendChild(Ka);for(va=0;null!=ma.replies&&va<ma.replies.length;va++)Na=ma.replies[va],Na.isResolved=ma.isResolved,J(Na,ma.replies,null,Ga+1,La);null!=u&&(u.comment.id==ma.id?(La=ma.content,ma.content=u.comment.content,A(ma,Ka,u.saveCallback,u.deleteOnCancel),ma.content=La):null==u.comment.id&&u.comment.pCommentId==ma.id&&(U.appendChild(u.div),A(u.comment,u.div,u.saveCallback,u.deleteOnCancel)));return Ka}}var ia=!b.canComment(),Y=b.canReplyToReplies(),aa=b.mentionsSupported(),ja=
+aa&&b.mentionsLiveSearch(),la=aa&&b.freeMentionsSupported(),ua=!aa||b.mentionNotificationsSupported(),Da=b.anchoredCommentsSupported(),ha=[],k=null,u=null,H=document.createElement("div");H.className="geCommentsWin";var P=EditorUi.compactUi?"26px":"30px",U=document.createElement("div");U.className="geCommentsList";U.style.bottom=parseInt(P)+7+"px";H.appendChild(U);var W=document.createElement("span");W.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(W,mxResources.get("noCommentsFound"));
+var fa=document.createElement("div");fa.className="geToolbarContainer geCommentsToolbar";fa.style.height=P;fa.style.padding="3px 4px 4px 4px";P=document.createElement("a");P.className="geButton";aa&&!ja&&b.getMentionCandidates(function(ma){ha=ma;ma=U.querySelectorAll(".geCommentMention[data-email]");for(var ta=0;ta<ma.length;ta++)ma[ta].innerText="",mxUtils.write(ma[ta],"@"+C(ma[ta].getAttribute("data-email")))},function(){});var X=mxUtils.bind(this,function(ma){function ta(){A(va,Ga,function(La){K(Ga);
+b.addComment(La,function(Ia){La.id=Ia;ba.push(La);V(Ga);b.commentsUpdated()},function(Ia){Q(Ga);ta();b.handleError(Ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}if(!ia){var va=b.newComment("",b.getCurrentUser());va.anchor=null!=ma?ma:null;var Ga=J(va,ba,null,0);ta()}});this.startNewComment=X;if(!ia){var ea=P.cloneNode();ea.style.backgroundImage="url("+Editor.plusImage+")";ea.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(ea,"click",function(ma){X();
+ma.preventDefault();mxEvent.consume(ma)});fa.appendChild(ea)}var oa=P.cloneNode();oa.style.backgroundImage="url("+Editor.checkImage+")";oa.setAttribute("title",mxResources.get("showResolved"));var ka=!1;mxEvent.addListener(oa,"click",function(ma){(ka=!ka)?oa.classList.add("geActiveItem"):oa.classList.remove("geActiveItem");qa();ma.preventDefault();mxEvent.consume(ma)});fa.appendChild(oa);b.commentsRefreshNeeded()&&(ea=P.cloneNode(),ea.style.backgroundImage="url("+Editor.refreshImage+")",ea.setAttribute("title",
+mxResources.get("refresh")),mxEvent.addListener(ea,"click",function(ma){qa();ma.preventDefault();mxEvent.consume(ma)}),fa.appendChild(ea));b.commentsSaveNeeded()&&(P=P.cloneNode(),P.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',P.setAttribute("title",mxResources.get("save")),P.className="geButton geAdaptiveAsset",mxEvent.addListener(P,"click",function(ma){n();ma.preventDefault();mxEvent.consume(ma)}),fa.appendChild(P));H.appendChild(fa);var ba=[],sa=function(ma){if(null!=
+k){for(var ta=U.childNodes,va=0;va<ta.length;va++)if(null!=ta[va].getAttribute&&null!=ta[va].getAttribute("data-anchor-cell")&&0<=mxUtils.indexOf(ta[va].getAttribute("data-anchor-cell").split(","),k)){U.scrollTop=ta[va].offsetTop-U.offsetTop;k=null;break}ma&&(k=null)}};this.scrollToCell=function(ma){k=ma;sa(!1)};var xa=mxUtils.bind(this,function(ma){function ta(Ga){if(null!=Ga){Ga.sort(function(Ia,Ca){return new Date(Ia.modifiedDate)-new Date(Ca.modifiedDate)});for(var La=0;La<Ga.length;La++)ta(Ga[La].replies)}}
+ma.sort(function(Ga,La){return new Date(Ga.modifiedDate)-new Date(La.modifiedDate)});if(null!=u){var va=u.div.querySelector(".geCommentEditTxtArea");null!=va&&(u.comment.content=l(va))}va=U.scrollTop;U.innerText="";U.appendChild(W);W.style.display="block";ba=ma;for(ma=0;ma<ba.length;ma++)ta(ba[ma].replies),J(ba[ma],ba,null,0,ka);null!=u&&null==u.comment.id&&null==u.comment.pCommentId&&(U.appendChild(u.div),A(u.comment,u.div,u.saveCallback,u.deleteOnCancel));U.scrollTop=va;sa(!0)}),qa=mxUtils.bind(this,
+function(){this.hasError=!1;if(null!=u)try{u.div=u.div.cloneNode(!0);var ma=u.div.querySelector(".geCommentEditTxtArea"),ta=u.div.querySelector(".geCommentEditBtns");u.comment.content=l(ma);ma.parentNode.removeChild(ma);ta.parentNode.removeChild(ta)}catch(va){b.handleError(va)}Y=b.canReplyToReplies();b.commentsSupported()?(null!=b.getCommentCacheTarget().commentCache?null==u&&xa(b.getCommentCacheTarget().commentCache):U.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+
+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>",b.refreshCommentCache(mxUtils.bind(this,function(va){null!=va&&null!=u&&xa(va)}),mxUtils.bind(this,function(va){null==b.getCommentCacheTarget().commentCache&&(U.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(va&&va.message?": "+va.message:"")),this.hasError=!0)}))):U.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))}),Ba=mxUtils.bind(this,function(){if(null==u){var ma=b.getCommentCacheTarget().commentCache;
+null!=ma&&(this.hasError=!1,xa(ma))}});b.addListener("commentsChanged",Ba);qa();this.refreshComments=qa;fa=mxUtils.bind(this,function(){function ma(Ia){var Ca=va[Ia.id];if(null!=Ca)for(E(Ia,Ca),Ca=0;null!=Ia.replies&&Ca<Ia.replies.length;Ca++)ma(Ia.replies[Ca])}if(this.window.isVisible()){for(var ta=U.querySelectorAll(".geCommentDate"),va={},Ga=0;Ga<ta.length;Ga++){var La=ta[Ga];va[La.getAttribute("data-commentId")]=La}for(Ga=0;Ga<ba.length;Ga++)ma(ba[Ga])}});setInterval(fa,6E4);this.refreshCommentsTime=
fa;this.window=new mxWindow(mxResources.get("comments"),H,d,m,p,t,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0,function(){b.removeListener(Ba)})},ConfirmDialog=function(b,d,m,p,t,n,y,C,O,F,N){var R=document.createElement("div");
R.style.textAlign="center";N=null!=N?N:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=N+"px";c.style.lineHeight="1.2em";mxUtils.write(c,d);R.appendChild(c);null!=F&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",F),c.appendChild(d),R.appendChild(c));F=document.createElement("div");F.style.textAlign="center";F.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type",
"checkbox");n=mxUtils.button(n||mxResources.get("cancel"),function(){b.hideDialog();null!=p&&p(f.checked)});n.className="geBtn";null!=C&&(n.innerHTML=C+"<br>"+n.innerHTML,n.style.display="inline-block",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");b.editor.cancelFirst&&F.appendChild(n);var l=mxUtils.button(t||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});F.appendChild(l);null!=y?(l.innerHTML=y+"<br>"+l.innerHTML+"<br>",l.style.display=
@@ -5012,39 +5015,40 @@ EditorUi.prototype.createPageMenu=function(b,d){return mxUtils.bind(this,functio
m,p,mxResources.get("move")),this.menus.addMenuItems(m,["removePage","renamePage"],p))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(p,t,n,y,C){t=null!=t?t:!1;null==n&&(n=this.getFoldableCells(this.getSelectionCells(),p));this.stopEditing();this.model.beginUpdate();try{for(var O=n.slice(),F=0;F<n.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(n[F]),"treeFolding","0")&&this.foldTreeCell(p,n[F]);n=O;n=b.apply(this,arguments)}finally{this.model.endUpdate()}return n};Graph.prototype.foldTreeCell=function(p,t){this.model.beginUpdate();try{var n=
[];this.traverse(t,!0,mxUtils.bind(this,function(C,O){var F=null!=O&&this.isTreeEdge(O);F&&n.push(O);C==t||null!=O&&!F||n.push(C);return(null==O||F)&&(C==t||!this.model.isCollapsed(C))}));this.model.setCollapsed(t,p);for(var y=0;y<n.length;y++)this.model.setVisible(n[y],!p)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(p){return!this.isEdgeIgnored(p)};Graph.prototype.getTreeEdges=function(p,t,n,y,C,O){return this.model.filterCells(this.getEdges(p,t,n,y,C,O),mxUtils.bind(this,
function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(p,t){return this.getTreeEdges(p,t,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(p,t){return this.getTreeEdges(p,t,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function p(k){return K.isVertex(k)&&n(k)}function t(k){var u=!1;null!=k&&(u="1"==
-E.getCurrentCellStyle(k).treeMoving);return u}function n(k){var u=!1;null!=k&&(k=K.getParent(k),u=E.view.getState(k),u="tree"==(null!=u?u.style:E.getCellStyle(k)).containerType);return u}function y(k){for(;null!=k&&!n(k);)k=K.getParent(k);return null!=k?K.getParent(k):null}function C(k){var u=!1;null!=k&&(k=K.getParent(k),u=E.view.getState(k),E.view.getState(k),u=null!=(null!=u?u.style:E.getCellStyle(k)).childLayout);return u}function O(k,u){function H(la,ca){null!=la&&(T.cut.get(la)||(T.cut.put(la,
-!0),T.cells.push(la)),ca&&!W.get(la)&&(W.put(la,!0),fa.push(la)))}function P(la){if(!T.deleted.get(la)){T.deleted.put(la,!0);T.cells.push(la);la=E.getAllEdges([la]);for(var ca=0;ca<la.length;ca++)H(la[ca],!0)}}for(var T={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},W=new mxDictionary,fa=[],X=0;X<k.length;X++){var ea=k[X];K.isEdge(ea)?H(ea,!1):K.isVertex(ea)&&null!=y(ea)?P(ea):null!=ea&&T.cells.push(ea)}for(;0<fa.length;)if(k=K.getTerminal(fa.shift(),!1),null!=k&&!T.deleted.get(k)&&
-K.isVertex(k)&&(X=y(k),null!=X&&(null==u||!u.get(X)))){X=E.getIncomingTreeEdges(k);ea=!0;for(var oa=0;oa<X.length;oa++)if(!T.cut.get(X[oa])){ea=!1;break}ea&&(T.cascaded.push(k),P(k))}return T}function F(k){k=E.view.getState(k);if(null!=k){var u=E.getIncomingTreeEdges(k.cell);if(0<u.length&&(u=E.view.getState(u[0]),null!=u&&(u=u.absolutePoints,null!=u&&0<u.length&&(u=u[u.length-1],null!=u)))){if(u.y==k.y&&Math.abs(u.x-k.getCenterX())<k.width/2)return mxConstants.DIRECTION_SOUTH;if(u.y==k.y+k.height&&
-Math.abs(u.x-k.getCenterX())<k.width/2)return mxConstants.DIRECTION_NORTH;if(u.x>k.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function N(k,u,H){if(null!=H){for(var P=E.getCurrentCellStyle(u),T=["treeFolding","treeMoving","newEdgeStyle"],W=0;W<T.length;W++)null!=P[T[W]]&&(null==H.style||0>H.style.indexOf(T[W]+"="))&&(H.style=mxUtils.setStyle(H.style,T[W],P[T[W]]));null!=H.geometry&&null!=u.geometry&&(H.geometry.x=u.geometry.x,H.geometry.y=u.geometry.y);E.model.getTerminal(k[0],
-!1)==k[1]&&E.model.setTerminal(k[0],H,!1);k[1]=H}return k}function R(k,u,H){u=null!=u?u:!0;E.model.beginUpdate();try{var P=E.model.getParent(k),T=E.getIncomingTreeEdges(k),W=N(E.cloneCells([T[0],k]),k,H);E.model.setTerminal(W[0],E.model.getTerminal(T[0],!0),!0);var fa=F(k),X=P.geometry;fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH?W[1].geometry.x+=u?k.geometry.width+10:-W[1].geometry.width-10:W[1].geometry.y+=u?k.geometry.height+10:-W[1].geometry.height-10;E.view.currentRoot!=P&&
-(W[1].geometry.x-=X.x,W[1].geometry.y-=X.y);var ea=E.view.getState(k),oa=E.view.scale;if(null!=ea){var la=mxRectangle.fromRectangle(ea);fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH?la.x+=(u?k.geometry.width+10:-W[1].geometry.width-10)*oa:la.y+=(u?k.geometry.height+10:-W[1].geometry.height-10)*oa;var ca=E.getOutgoingTreeEdges(E.model.getTerminal(T[0],!0));if(null!=ca){var sa=fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH;for(X=T=H=0;X<ca.length;X++){var xa=E.model.getTerminal(ca[X],
-!1);if(fa==F(xa)){var qa=E.view.getState(xa);xa!=k&&null!=qa&&(sa&&u!=qa.getCenterX()<ea.getCenterX()||!sa&&u!=qa.getCenterY()<ea.getCenterY())&&mxUtils.intersects(la,qa)&&(H=10+Math.max(H,(Math.min(la.x+la.width,qa.x+qa.width)-Math.max(la.x,qa.x))/oa),T=10+Math.max(T,(Math.min(la.y+la.height,qa.y+qa.height)-Math.max(la.y,qa.y))/oa))}}sa?T=0:H=0;for(X=0;X<ca.length;X++)if(xa=E.model.getTerminal(ca[X],!1),fa==F(xa)&&(qa=E.view.getState(xa),xa!=k&&null!=qa&&(sa&&u!=qa.getCenterX()<ea.getCenterX()||
-!sa&&u!=qa.getCenterY()<ea.getCenterY()))){var Ba=[];E.traverse(qa.cell,!0,function(ma,ta){var va=null!=ta&&E.isTreeEdge(ta);va&&Ba.push(ta);(null==ta||va)&&Ba.push(ma);return null==ta||va});E.moveCells(Ba,(u?1:-1)*H,(u?1:-1)*T)}}}return E.addCells(W,P)}finally{E.model.endUpdate()}}function c(k,u){E.model.beginUpdate();try{var H=F(k),P=E.getIncomingTreeEdges(k),T=N(E.cloneCells([P[0],k]),k,u);E.model.setTerminal(P[0],T[1],!1);E.model.setTerminal(T[0],T[1],!0);E.model.setTerminal(T[0],k,!1);var W=
-E.model.getParent(k),fa=W.geometry,X=[];E.view.currentRoot!=W&&(T[1].geometry.x-=fa.x,T[1].geometry.y-=fa.y);E.traverse(k,!0,function(la,ca){var sa=null!=ca&&E.isTreeEdge(ca);sa&&X.push(ca);(null==ca||sa)&&X.push(la);return null==ca||sa});var ea=k.geometry.width+40,oa=k.geometry.height+40;H==mxConstants.DIRECTION_SOUTH?ea=0:H==mxConstants.DIRECTION_NORTH?(ea=0,oa=-oa):H==mxConstants.DIRECTION_WEST?(ea=-ea,oa=0):H==mxConstants.DIRECTION_EAST&&(oa=0);E.moveCells(X,ea,oa);return E.addCells(T,W)}finally{E.model.endUpdate()}}
-function f(k,u,H){E.model.beginUpdate();try{var P=E.model.getParent(k),T=E.getIncomingTreeEdges(k),W=F(k);0==T.length&&(T=[E.createEdge(P,null,"",null,null,E.createCurrentEdgeStyle())],W=u);var fa=N(E.cloneCells([T[0],k]),k,H);E.model.setTerminal(fa[0],k,!0);null==E.model.getTerminal(fa[0],!1)&&(E.model.setTerminal(fa[0],fa[1],!1),E.applyNewEdgeStyle(fa[1],[fa[0]],W));T=E.getOutgoingTreeEdges(k);var X=P.geometry;u=[];E.view.currentRoot==P&&(X=new mxRectangle);for(H=0;H<T.length;H++){var ea=E.model.getTerminal(T[H],
-!1);null!=ea&&u.push(ea)}var oa=E.view.getBounds(u),la=E.view.translate,ca=E.view.scale;W==mxConstants.DIRECTION_SOUTH?(fa[1].geometry.x=null==oa?k.geometry.x+(k.geometry.width-fa[1].geometry.width)/2:(oa.x+oa.width)/ca-la.x-X.x+10,fa[1].geometry.y+=k.geometry.height-X.y+40):W==mxConstants.DIRECTION_NORTH?(fa[1].geometry.x=null==oa?k.geometry.x+(k.geometry.width-fa[1].geometry.width)/2:(oa.x+oa.width)/ca-la.x+-X.x+10,fa[1].geometry.y-=fa[1].geometry.height+X.y+40):(fa[1].geometry.x=W==mxConstants.DIRECTION_WEST?
-fa[1].geometry.x-(fa[1].geometry.width+X.x+40):fa[1].geometry.x+(k.geometry.width-X.x+40),fa[1].geometry.y=null==oa?k.geometry.y+(k.geometry.height-fa[1].geometry.height)/2:(oa.y+oa.height)/ca-la.y+-X.y+10);return E.addCells(fa,P)}finally{E.model.endUpdate()}}function l(k,u,H){k=E.getOutgoingTreeEdges(k);H=E.view.getState(H);var P=[];if(null!=H&&null!=k){for(var T=0;T<k.length;T++){var W=E.view.getState(E.model.getTerminal(k[T],!1));null!=W&&(!u&&Math.min(W.x+W.width,H.x+H.width)>=Math.max(W.x,H.x)||
+E.getCurrentCellStyle(k).treeMoving);return u}function n(k){var u=!1;null!=k&&(k=K.getParent(k),u=E.view.getState(k),u="tree"==(null!=u?u.style:E.getCellStyle(k)).containerType);return u}function y(k){for(;null!=k&&!n(k);)k=K.getParent(k);return null!=k?K.getParent(k):null}function C(k){var u=!1;null!=k&&(k=K.getParent(k),u=E.view.getState(k),E.view.getState(k),u=null!=(null!=u?u.style:E.getCellStyle(k)).childLayout);return u}function O(k,u){function H(ka,ba){null!=ka&&(U.cut.get(ka)||(U.cut.put(ka,
+!0),U.cells.push(ka)),ba&&!W.get(ka)&&(W.put(ka,!0),fa.push(ka)))}function P(ka){if(!U.deleted.get(ka)){U.deleted.put(ka,!0);U.cells.push(ka);ka=E.getAllEdges([ka]);for(var ba=0;ba<ka.length;ba++)H(ka[ba],!0)}}for(var U={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},W=new mxDictionary,fa=[],X=0;X<k.length;X++){var ea=k[X];K.isEdge(ea)?H(ea,!1):K.isVertex(ea)&&null!=y(ea)?P(ea):null!=ea&&U.cells.push(ea)}for(;0<fa.length;)if(k=K.getTerminal(fa.shift(),!1),null!=k&&!U.deleted.get(k)&&
+K.isVertex(k)&&(X=y(k),null!=X&&(null==u||!u.get(X)))){X=E.getIncomingTreeEdges(k);ea=!0;for(var oa=0;oa<X.length;oa++)if(!U.cut.get(X[oa])){ea=!1;break}ea&&(U.cascaded.push(k),P(k))}return U}function F(k){k=E.view.getState(k);if(null!=k){var u=E.getIncomingTreeEdges(k.cell);if(0<u.length&&(u=E.view.getState(u[0]),null!=u&&(u=u.absolutePoints,null!=u&&0<u.length&&(u=u[u.length-1],null!=u)))){if(u.y==k.y&&Math.abs(u.x-k.getCenterX())<k.width/2)return mxConstants.DIRECTION_SOUTH;if(u.y==k.y+k.height&&
+Math.abs(u.x-k.getCenterX())<k.width/2)return mxConstants.DIRECTION_NORTH;if(u.x>k.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function N(k,u,H){if(null!=H){for(var P=E.getCurrentCellStyle(u),U=["treeFolding","treeMoving","newEdgeStyle"],W=0;W<U.length;W++)null!=P[U[W]]&&(null==H.style||0>H.style.indexOf(U[W]+"="))&&(H.style=mxUtils.setStyle(H.style,U[W],P[U[W]]));null!=H.geometry&&null!=u.geometry&&(H.geometry.x=u.geometry.x,H.geometry.y=u.geometry.y);E.model.getTerminal(k[0],
+!1)==k[1]&&E.model.setTerminal(k[0],H,!1);k[1]=H}return k}function R(k,u,H){u=null!=u?u:!0;E.model.beginUpdate();try{var P=E.model.getParent(k),U=E.getIncomingTreeEdges(k),W=N(E.cloneCells([U[0],k]),k,H);E.model.setTerminal(W[0],E.model.getTerminal(U[0],!0),!0);var fa=F(k),X=P.geometry;fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH?W[1].geometry.x+=u?k.geometry.width+10:-W[1].geometry.width-10:W[1].geometry.y+=u?k.geometry.height+10:-W[1].geometry.height-10;E.view.currentRoot!=P&&
+(W[1].geometry.x-=X.x,W[1].geometry.y-=X.y);var ea=E.view.getState(k),oa=E.view.scale;if(null!=ea){var ka=mxRectangle.fromRectangle(ea);fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH?ka.x+=(u?k.geometry.width+10:-W[1].geometry.width-10)*oa:ka.y+=(u?k.geometry.height+10:-W[1].geometry.height-10)*oa;var ba=E.getOutgoingTreeEdges(E.model.getTerminal(U[0],!0));if(null!=ba){var sa=fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH;for(X=U=H=0;X<ba.length;X++){var xa=E.model.getTerminal(ba[X],
+!1);if(fa==F(xa)){var qa=E.view.getState(xa);xa!=k&&null!=qa&&(sa&&u!=qa.getCenterX()<ea.getCenterX()||!sa&&u!=qa.getCenterY()<ea.getCenterY())&&mxUtils.intersects(ka,qa)&&(H=10+Math.max(H,(Math.min(ka.x+ka.width,qa.x+qa.width)-Math.max(ka.x,qa.x))/oa),U=10+Math.max(U,(Math.min(ka.y+ka.height,qa.y+qa.height)-Math.max(ka.y,qa.y))/oa))}}sa?U=0:H=0;for(X=0;X<ba.length;X++)if(xa=E.model.getTerminal(ba[X],!1),fa==F(xa)&&(qa=E.view.getState(xa),xa!=k&&null!=qa&&(sa&&u!=qa.getCenterX()<ea.getCenterX()||
+!sa&&u!=qa.getCenterY()<ea.getCenterY()))){var Ba=[];E.traverse(qa.cell,!0,function(ma,ta){var va=null!=ta&&E.isTreeEdge(ta);va&&Ba.push(ta);(null==ta||va)&&Ba.push(ma);return null==ta||va});E.moveCells(Ba,(u?1:-1)*H,(u?1:-1)*U)}}}return E.addCells(W,P)}finally{E.model.endUpdate()}}function c(k,u){E.model.beginUpdate();try{var H=F(k),P=E.getIncomingTreeEdges(k),U=N(E.cloneCells([P[0],k]),k,u);E.model.setTerminal(P[0],U[1],!1);E.model.setTerminal(U[0],U[1],!0);E.model.setTerminal(U[0],k,!1);var W=
+E.model.getParent(k),fa=W.geometry,X=[];E.view.currentRoot!=W&&(U[1].geometry.x-=fa.x,U[1].geometry.y-=fa.y);E.traverse(k,!0,function(ka,ba){var sa=null!=ba&&E.isTreeEdge(ba);sa&&X.push(ba);(null==ba||sa)&&X.push(ka);return null==ba||sa});var ea=k.geometry.width+40,oa=k.geometry.height+40;H==mxConstants.DIRECTION_SOUTH?ea=0:H==mxConstants.DIRECTION_NORTH?(ea=0,oa=-oa):H==mxConstants.DIRECTION_WEST?(ea=-ea,oa=0):H==mxConstants.DIRECTION_EAST&&(oa=0);E.moveCells(X,ea,oa);return E.addCells(U,W)}finally{E.model.endUpdate()}}
+function f(k,u,H){E.model.beginUpdate();try{var P=E.model.getParent(k),U=E.getIncomingTreeEdges(k),W=F(k);0==U.length&&(U=[E.createEdge(P,null,"",null,null,E.createCurrentEdgeStyle())],W=u);var fa=N(E.cloneCells([U[0],k]),k,H);E.model.setTerminal(fa[0],k,!0);null==E.model.getTerminal(fa[0],!1)&&(E.model.setTerminal(fa[0],fa[1],!1),E.applyNewEdgeStyle(fa[1],[fa[0]],W));U=E.getOutgoingTreeEdges(k);var X=P.geometry;u=[];E.view.currentRoot==P&&(X=new mxRectangle);for(H=0;H<U.length;H++){var ea=E.model.getTerminal(U[H],
+!1);null!=ea&&u.push(ea)}var oa=E.view.getBounds(u),ka=E.view.translate,ba=E.view.scale;W==mxConstants.DIRECTION_SOUTH?(fa[1].geometry.x=null==oa?k.geometry.x+(k.geometry.width-fa[1].geometry.width)/2:(oa.x+oa.width)/ba-ka.x-X.x+10,fa[1].geometry.y+=k.geometry.height-X.y+40):W==mxConstants.DIRECTION_NORTH?(fa[1].geometry.x=null==oa?k.geometry.x+(k.geometry.width-fa[1].geometry.width)/2:(oa.x+oa.width)/ba-ka.x+-X.x+10,fa[1].geometry.y-=fa[1].geometry.height+X.y+40):(fa[1].geometry.x=W==mxConstants.DIRECTION_WEST?
+fa[1].geometry.x-(fa[1].geometry.width+X.x+40):fa[1].geometry.x+(k.geometry.width-X.x+40),fa[1].geometry.y=null==oa?k.geometry.y+(k.geometry.height-fa[1].geometry.height)/2:(oa.y+oa.height)/ba-ka.y+-X.y+10);return E.addCells(fa,P)}finally{E.model.endUpdate()}}function l(k,u,H){k=E.getOutgoingTreeEdges(k);H=E.view.getState(H);var P=[];if(null!=H&&null!=k){for(var U=0;U<k.length;U++){var W=E.view.getState(E.model.getTerminal(k[U],!1));null!=W&&(!u&&Math.min(W.x+W.width,H.x+H.width)>=Math.max(W.x,H.x)||
u&&Math.min(W.y+W.height,H.y+H.height)>=Math.max(W.y,H.y))&&P.push(W)}P.sort(function(fa,X){return u?fa.x+fa.width-X.x-X.width:fa.y+fa.height-X.y-X.height})}return P}function q(k,u){var H=F(k),P=u==mxConstants.DIRECTION_EAST||u==mxConstants.DIRECTION_WEST;(H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST)==P&&H!=u?A.actions.get("selectParent").funct():H==u?(u=E.getOutgoingTreeEdges(k),null!=u&&0<u.length&&E.setSelectionCell(E.model.getTerminal(u[0],!1))):(H=E.getIncomingTreeEdges(k),null!=
H&&0<H.length&&(P=l(E.model.getTerminal(H[0],!0),P,k),k=E.view.getState(k),null!=k&&(k=mxUtils.indexOf(P,k),0<=k&&(k+=u==mxConstants.DIRECTION_NORTH||u==mxConstants.DIRECTION_WEST?-1:1,0<=k&&k<=P.length-1&&E.setSelectionCell(P[k].cell)))))}function x(k){return(t(k)||p(k))&&!C(k)&&0<E.getOutgoingTreeEdges(k).length&&!E.isCellCollapsed(k)}var A=this,E=A.editor.graph,K=E.getModel(),Q=A.menus.createPopupMenu;A.menus.createPopupMenu=function(k,u,H){Q.apply(this,arguments);if(1==E.getSelectionCount()){u=
E.getSelectionCell();var P=E.getOutgoingTreeEdges(u);k.addSeparator();0<P.length&&(p(E.getSelectionCell())&&this.addMenuItems(k,["selectChildren"],null,H),this.addMenuItems(k,["selectDescendants"],null,H));p(E.getSelectionCell())?(k.addSeparator(),0<E.getIncomingTreeEdges(u).length&&this.addMenuItems(k,["selectSiblings","selectParent"],null,H)):0<E.model.getEdgeCount(u)&&this.addMenuItems(k,["selectConnections"],null,H)}};A.actions.addAction("selectChildren",function(k){if(E.isEnabled()&&1==E.getSelectionCount()){var u=
-E.getSelectionCell();k=mxEvent.isControlDown(k)?null:E.getOutgoingTreeEdges(u);if(null!=k&&0<k.length){u=[];for(var H=0;H<k.length;H++)u.push(E.model.getTerminal(k[H],!1));E.setSelectionCells(u)}else E.setSelectionCells(E.model.getChildren(u))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");A.actions.addAction("selectDescendants",function(k){var u=E.getSelectionCell();if(E.isEnabled()&&null!=u){var H=[];mxEvent.isControlDown(k)||E.traverse(u,!0,function(P,T){var W=null!=T&&E.isTreeEdge(T);W&&
-mxEvent.isControlDown(k)&&H.push(T);(null==T||W)&&H.push(P);return null==T||W});if(0==H.length||1==H.length&&H[0]==u)H=E.model.getDescendants(u);E.setSelectionCells(H)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");A.actions.addAction("selectParent",function(k){var u=E.getSelectionCell();E.isEnabled()&&null!=u&&(k=mxEvent.isControlDown(k)?null:E.getIncomingTreeEdges(u),null!=k&&0<k.length?E.setSelectionCell(E.model.getTerminal(k[0],!0)):E.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+
+E.getSelectionCell();k=mxEvent.isControlDown(k)?null:E.getOutgoingTreeEdges(u);if(null!=k&&0<k.length){u=[];for(var H=0;H<k.length;H++)u.push(E.model.getTerminal(k[H],!1));E.setSelectionCells(u)}else E.setSelectionCells(E.model.getChildren(u))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");A.actions.addAction("selectDescendants",function(k){var u=E.getSelectionCell();if(E.isEnabled()&&null!=u){var H=[];mxEvent.isControlDown(k)||E.traverse(u,!0,function(P,U){var W=null!=U&&E.isTreeEdge(U);W&&
+mxEvent.isControlDown(k)&&H.push(U);(null==U||W)&&H.push(P);return null==U||W});if(0==H.length||1==H.length&&H[0]==u)H=E.model.getDescendants(u);E.setSelectionCells(H)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");A.actions.addAction("selectParent",function(k){var u=E.getSelectionCell();E.isEnabled()&&null!=u&&(k=mxEvent.isControlDown(k)?null:E.getIncomingTreeEdges(u),null!=k&&0<k.length?E.setSelectionCell(E.model.getTerminal(k[0],!0)):E.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+
"+P");A.actions.addAction("selectSiblings",function(k){if(E.isEnabled()&&1==E.getSelectionCount()){var u=E.getSelectionCell(),H=mxEvent.isControlDown(k)?null:E.getIncomingTreeEdges(u);k=[];if(null!=H&&0<H.length&&(H=E.getOutgoingTreeEdges(E.model.getTerminal(H[0],!0)),null!=H))for(var P=0;P<H.length;P++)k.push(E.model.getTerminal(H[P],!1));0==k.length&&(k=E.model.getChildren(E.model.getParent(u)));E.setSelectionCells(k)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var V=E.removeCells;E.removeCells=
-function(k,u){u=null!=u?u:!0;null==k&&(k=this.getDeletableCells(this.getSelectionCells()));u&&(k=this.getDeletableCells(this.addAllEdges(k)));var H=O(k,null);var P=H;for(var T=new mxDictionary,W=null,fa=0;fa<P.cascaded.length;fa++){var X=y(P.cascaded[fa]);if(null!=X&&!T.get(X)){T.put(X,!0);a:{var ea=P;for(var oa=[X];0<oa.length;)for(var la=oa.pop(),ca=0;ca<K.getChildCount(la);ca++){var sa=K.getChildAt(la,ca);if(K.isVertex(sa)&&!ea.deleted.get(sa))for(var xa=0;xa<K.getEdgeCount(sa);xa++)if(!ea.cut.get(K.getEdgeAt(sa,
-xa))){ea=!0;break a}oa.push(sa)}ea=!1}ea||(W=null!=W?W:new mxDictionary,W.put(X,!0))}}P=W;null!=P&&(H=O(k,P));k=H.cells;return V.apply(this,arguments)};A.hoverIcons.getStateAt=function(k,u,H){return p(k.cell)?null:this.graph.view.getState(this.graph.getCellAt(u,H))};var J=E.duplicateCells;E.duplicateCells=function(k,u){k=null!=k?k:this.getSelectionCells();for(var H=k.slice(0),P=0;P<H.length;P++){var T=E.view.getState(H[P]);if(null!=T&&p(T.cell)){var W=E.getIncomingTreeEdges(T.cell);for(T=0;T<W.length;T++)mxUtils.remove(W[T],
-k)}}this.model.beginUpdate();try{var fa=J.call(this,k,u);if(fa.length==k.length)for(P=0;P<k.length;P++)if(p(k[P])){var X=E.getIncomingTreeEdges(fa[P]);W=E.getIncomingTreeEdges(k[P]);if(0==X.length&&0<W.length){var ea=this.cloneCell(W[0]);this.addEdge(ea,E.getDefaultParent(),this.model.getTerminal(W[0],!0),fa[P])}}}finally{this.model.endUpdate()}return fa};var ia=E.moveCells;E.moveCells=function(k,u,H,P,T,W,fa){for(var X=null,ea=[],oa=0;oa<k.length;oa++)(t(k[oa])||p(k[oa]))&&!C(k[oa])&&this.isCellCollapsed(k[oa])?
-ea=ea.concat(this.getSubtree(k[oa])):ea.push(k[oa]);k=mxUtils.removeDuplicates(ea);this.model.beginUpdate();try{ea=T;var la=this.getCurrentCellStyle(T);if(null!=k&&p(T)&&"1"==mxUtils.getValue(la,"treeFolding","0")){for(oa=0;oa<k.length;oa++)if(p(k[oa])||E.model.isEdge(k[oa])&&null==E.model.getTerminal(k[oa],!0)){T=E.model.getParent(k[oa]);break}if(null!=ea&&T!=ea&&null!=this.view.getState(k[0])){var ca=E.getIncomingTreeEdges(k[0]);if(0<ca.length){var sa=E.view.getState(E.model.getTerminal(ca[0],!0));
-if(null!=sa){var xa=E.view.getState(ea);null!=xa&&(u=(xa.getCenterX()-sa.getCenterX())/E.view.scale,H=(xa.getCenterY()-sa.getCenterY())/E.view.scale)}}}}X=ia.apply(this,arguments);if(null!=X&&null!=k&&X.length==k.length)for(oa=0;oa<X.length;oa++)if(this.model.isEdge(X[oa]))p(ea)&&0>mxUtils.indexOf(X,this.model.getTerminal(X[oa],!0))&&this.model.setTerminal(X[oa],ea,!0);else if(p(k[oa])&&(ca=E.getIncomingTreeEdges(k[oa]),0<ca.length))if(!P)p(ea)&&0>mxUtils.indexOf(k,this.model.getTerminal(ca[0],!0))&&
-this.model.setTerminal(ca[0],ea,!0);else if(0==E.getIncomingTreeEdges(X[oa]).length){la=ea;if(null==la||la==E.model.getParent(k[oa]))la=E.model.getTerminal(ca[0],!0);P=this.cloneCell(ca[0]);this.addEdge(P,E.getDefaultParent(),la,X[oa])}}finally{this.model.endUpdate()}return X};if(null!=A.sidebar){var Y=A.sidebar.dropAndConnect;A.sidebar.dropAndConnect=function(k,u,H,P){var T=E.model,W=null;T.beginUpdate();try{if(W=Y.apply(this,arguments),p(k))for(var fa=0;fa<W.length;fa++)if(T.isEdge(W[fa])&&null==
-T.getTerminal(W[fa],!0)){T.setTerminal(W[fa],k,!0);var X=E.getCellGeometry(W[fa]);X.points=null;null!=X.getTerminalPoint(!0)&&X.setTerminalPoint(null,!0)}}finally{T.endUpdate()}return W}}var aa={67:A.actions.get("selectChildren"),88:A.actions.get("selectDescendants"),80:A.actions.get("selectParent"),83:A.actions.get("selectSiblings")},ja={67:A.actions.get("copyStyle"),86:A.actions.get("pasteStyle")},ka=A.onKeyDown;A.onKeyDown=function(k){try{var u=E.getSelectionCell();if(E.isEnabled()&&!E.isEditing()&&
+function(k,u){u=null!=u?u:!0;null==k&&(k=this.getDeletableCells(this.getSelectionCells()));u&&(k=this.getDeletableCells(this.addAllEdges(k)));var H=O(k,null);var P=H;for(var U=new mxDictionary,W=null,fa=0;fa<P.cascaded.length;fa++){var X=y(P.cascaded[fa]);if(null!=X&&!U.get(X)){U.put(X,!0);a:{var ea=P;for(var oa=[X];0<oa.length;)for(var ka=oa.pop(),ba=0;ba<K.getChildCount(ka);ba++){var sa=K.getChildAt(ka,ba);if(K.isVertex(sa)&&!ea.deleted.get(sa))for(var xa=0;xa<K.getEdgeCount(sa);xa++)if(!ea.cut.get(K.getEdgeAt(sa,
+xa))){ea=!0;break a}oa.push(sa)}ea=!1}ea||(W=null!=W?W:new mxDictionary,W.put(X,!0))}}P=W;null!=P&&(H=O(k,P));k=H.cells;return V.apply(this,arguments)};A.hoverIcons.getStateAt=function(k,u,H){return p(k.cell)?null:this.graph.view.getState(this.graph.getCellAt(u,H))};var J=E.duplicateCells;E.duplicateCells=function(k,u){k=null!=k?k:this.getSelectionCells();for(var H=k.slice(0),P=0;P<H.length;P++){var U=E.view.getState(H[P]);if(null!=U&&p(U.cell)){var W=E.getIncomingTreeEdges(U.cell);for(U=0;U<W.length;U++)mxUtils.remove(W[U],
+k)}}this.model.beginUpdate();try{var fa=J.call(this,k,u);if(fa.length==k.length)for(P=0;P<k.length;P++)if(p(k[P])){var X=E.getIncomingTreeEdges(fa[P]);W=E.getIncomingTreeEdges(k[P]);if(0==X.length&&0<W.length){var ea=this.cloneCell(W[0]);this.addEdge(ea,E.getDefaultParent(),this.model.getTerminal(W[0],!0),fa[P])}}}finally{this.model.endUpdate()}return fa};var ia=E.moveCells;E.moveCells=function(k,u,H,P,U,W,fa){for(var X=null,ea=[],oa=0;oa<k.length;oa++)(t(k[oa])||p(k[oa]))&&!C(k[oa])&&this.isCellCollapsed(k[oa])?
+ea=ea.concat(this.getSubtree(k[oa])):ea.push(k[oa]);k=mxUtils.removeDuplicates(ea);this.model.beginUpdate();try{ea=U;var ka=this.getCurrentCellStyle(U);if(null!=k&&p(U)&&"1"==mxUtils.getValue(ka,"treeFolding","0")){for(oa=0;oa<k.length;oa++)if(p(k[oa])||E.model.isEdge(k[oa])&&null==E.model.getTerminal(k[oa],!0)){U=E.model.getParent(k[oa]);break}if(null!=ea&&U!=ea&&null!=this.view.getState(k[0])){var ba=E.getIncomingTreeEdges(k[0]);if(0<ba.length){var sa=E.view.getState(E.model.getTerminal(ba[0],!0));
+if(null!=sa){var xa=E.view.getState(ea);null!=xa&&(u=(xa.getCenterX()-sa.getCenterX())/E.view.scale,H=(xa.getCenterY()-sa.getCenterY())/E.view.scale)}}}}X=ia.apply(this,arguments);if(null!=X&&null!=k&&X.length==k.length)for(oa=0;oa<X.length;oa++)if(this.model.isEdge(X[oa]))p(ea)&&0>mxUtils.indexOf(X,this.model.getTerminal(X[oa],!0))&&this.model.setTerminal(X[oa],ea,!0);else if(p(k[oa])&&(ba=E.getIncomingTreeEdges(k[oa]),0<ba.length))if(!P)p(ea)&&0>mxUtils.indexOf(k,this.model.getTerminal(ba[0],!0))&&
+this.model.setTerminal(ba[0],ea,!0);else if(0==E.getIncomingTreeEdges(X[oa]).length){ka=ea;if(null==ka||ka==E.model.getParent(k[oa]))ka=E.model.getTerminal(ba[0],!0);P=this.cloneCell(ba[0]);this.addEdge(P,E.getDefaultParent(),ka,X[oa])}}finally{this.model.endUpdate()}return X};if(null!=A.sidebar){var Y=A.sidebar.dropAndConnect;A.sidebar.dropAndConnect=function(k,u,H,P){var U=E.model,W=null;U.beginUpdate();try{if(W=Y.apply(this,arguments),p(k))for(var fa=0;fa<W.length;fa++)if(U.isEdge(W[fa])&&null==
+U.getTerminal(W[fa],!0)){U.setTerminal(W[fa],k,!0);var X=E.getCellGeometry(W[fa]);X.points=null;null!=X.getTerminalPoint(!0)&&X.setTerminalPoint(null,!0)}}finally{U.endUpdate()}return W}}var aa={67:A.actions.get("selectChildren"),88:A.actions.get("selectDescendants"),80:A.actions.get("selectParent"),83:A.actions.get("selectSiblings")},ja={67:A.actions.get("copyStyle"),86:A.actions.get("pasteStyle")},la=A.onKeyDown;A.onKeyDown=function(k){try{var u=E.getSelectionCell();if(E.isEnabled()&&!E.isEditing()&&
null!=u){var H=mxEvent.isAltDown(k)&&mxEvent.isShiftDown(k)?aa[k.keyCode]:mxEvent.isAltDown(k)?ja[k.keyCode]:null;null!=H?(H.funct(k),mxEvent.consume(k)):p(u)&&(H=null,0<E.getIncomingTreeEdges(u).length&&(9==k.which?H=mxEvent.isShiftDown(k)?c(u):f(u):13==k.which&&(H=R(u,!mxEvent.isShiftDown(k)))),null!=H&&0<H.length?(1==H.length&&E.model.isEdge(H[0])?E.setSelectionCell(E.model.getTerminal(H[0],!1)):E.setSelectionCell(H[H.length-1]),null!=A.hoverIcons&&A.hoverIcons.update(E.view.getState(u)),E.startEditingAtCell(u),
-mxEvent.consume(k)):37==k.keyCode?(q(u,mxConstants.DIRECTION_WEST),mxEvent.consume(k)):38==k.keyCode?(q(u,mxConstants.DIRECTION_NORTH),mxEvent.consume(k)):39==k.keyCode?(q(u,mxConstants.DIRECTION_EAST),mxEvent.consume(k)):40==k.keyCode&&(q(u,mxConstants.DIRECTION_SOUTH),mxEvent.consume(k)))}}catch(P){A.handleError(P)}mxEvent.isConsumed(k)||ka.apply(this,arguments)};var ua=E.connectVertex;E.connectVertex=function(k,u,H,P,T,W,fa,X,ea){var oa=E.getIncomingTreeEdges(k);if(p(k)){var la=F(k),ca=la==mxConstants.DIRECTION_EAST||
-la==mxConstants.DIRECTION_WEST,sa=u==mxConstants.DIRECTION_EAST||u==mxConstants.DIRECTION_WEST;oa=la==u||0==oa.length?f(k,u,ea):ca==sa?c(k,ea):R(k,u!=mxConstants.DIRECTION_NORTH&&u!=mxConstants.DIRECTION_WEST,ea);if(null!=X)X(oa);else return oa}else return ua.apply(this,arguments)};E.getSubtree=function(k){var u=[k];!t(k)&&!p(k)||C(k)||E.traverse(k,!0,function(H,P){var T=null!=P&&E.isTreeEdge(P);T&&0>mxUtils.indexOf(u,P)&&u.push(P);(null==P||T)&&0>mxUtils.indexOf(u,H)&&u.push(H);return null==P||T});
-return u};var Da=E.isMoveIconVisible;E.isMoveIconVisible=function(k){return Da.apply(this,arguments)||x(k)};var ha=E.getMoveIconDragCells;E.getMoveIconDragCells=function(k){return x(k)?this.getSubtree(k):ha.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var p=m.apply(this,arguments),t=this.graph,n=this;return p.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",
-new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var C=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');C.vertex=!0;var O=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
-O.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;C.insertEdge(F,!0);O.insertEdge(F,!1);y.insert(F);y.insert(C);y.insert(O);return n.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");
-y.vertex=!0;var C=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');C.vertex=!0;var O=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
-O.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");F.geometry.relative=!0;F.edge=!0;C.insertEdge(F,!0);O.insertEdge(F,!1);var N=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
+mxEvent.consume(k)):37==k.keyCode?(q(u,mxConstants.DIRECTION_WEST),mxEvent.consume(k)):38==k.keyCode?(q(u,mxConstants.DIRECTION_NORTH),mxEvent.consume(k)):39==k.keyCode?(q(u,mxConstants.DIRECTION_EAST),mxEvent.consume(k)):40==k.keyCode&&(q(u,mxConstants.DIRECTION_SOUTH),mxEvent.consume(k)))}}catch(P){A.handleError(P)}mxEvent.isConsumed(k)||la.apply(this,arguments)};var ua=E.connectVertex;E.connectVertex=function(k,u,H,P,U,W,fa,X,ea){var oa=E.getIncomingTreeEdges(k);if(p(k)){var ka=F(k),ba=ka==mxConstants.DIRECTION_EAST||
+ka==mxConstants.DIRECTION_WEST,sa=u==mxConstants.DIRECTION_EAST||u==mxConstants.DIRECTION_WEST;if(!(oa=ka==u||0==oa.length))a:{ka=K.getParent(k);if(null!=ka){ka=E.getCurrentCellStyle(ka);ka=null!=ka?ka.childLayout:null;if("flowLayout"==ka){oa=!0;break a}try{var xa=Graph.decodeChildLayout(ka);oa=null!=xa&&0<xa.length&&null!=xa[0]&&"elkLayered"==xa[0].layout;break a}catch(qa){}}oa=!1}ba=oa?f(k,u,ea):ba==sa?c(k,ea):R(k,u!=mxConstants.DIRECTION_NORTH&&u!=mxConstants.DIRECTION_WEST,ea);if(null!=X)X(ba);
+else return ba}else return ua.apply(this,arguments)};E.getSubtree=function(k){var u=[k];!t(k)&&!p(k)||C(k)||E.traverse(k,!0,function(H,P){var U=null!=P&&E.isTreeEdge(P);U&&0>mxUtils.indexOf(u,P)&&u.push(P);(null==P||U)&&0>mxUtils.indexOf(u,H)&&u.push(H);return null==P||U});return u};var Da=E.isMoveIconVisible;E.isMoveIconVisible=function(k){return Da.apply(this,arguments)||x(k)};var ha=E.getMoveIconDragCells;E.getMoveIconDragCells=function(k){return x(k)?this.getSubtree(k):ha.apply(this,arguments)}};
+if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var p=m.apply(this,arguments),t=this.graph,n=this;return p.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var C=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
+C.vertex=!0;var O=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');O.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;C.insertEdge(F,!0);O.insertEdge(F,!1);y.insert(F);y.insert(C);y.insert(O);
+return n.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var C=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
+C.vertex=!0;var O=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');O.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");
+F.geometry.relative=!0;F.edge=!0;C.insertEdge(F,!0);O.insertEdge(F,!1);var N=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
N.vertex=!0;var R=new mxCell("",new mxGeometry(0,0,0,0),F.style);R.geometry.relative=!0;R.edge=!0;C.insertEdge(R,!0);N.insertEdge(R,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),F.style);f.geometry.relative=!0;f.edge=!0;C.insertEdge(f,!0);c.insertEdge(f,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
l.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),F.style);q.geometry.relative=!0;q.edge=!0;C.insertEdge(q,!0);l.insertEdge(q,!1);y.insert(F);y.insert(R);y.insert(f);y.insert(q);y.insert(C);y.insert(O);y.insert(N);y.insert(c);y.insert(l);return n.createVertexTemplateFromCells([y],420,126,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');
@@ -5070,21 +5074,21 @@ function(F){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=F?
arguments);if(F){var N=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=N&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=N&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=
function(F){var N=this.editor.graph,R=document.createElement("div");R.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";N.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<N.getSelectionCount()?(F.appendChild(R),R.innerHTML="Selected: "+N.getSelectionCount()):null!=R.parentNode&&R.parentNode.removeChild(R)}))};var C=!1;EditorUi.prototype.initFormatWindow=
function(){if(!C&&null!=this.formatWindow){C=!0;var F=this.formatWindow.window.toggleMinimized,N=240;this.formatWindow.window.toggleMinimized=function(){F.apply(this,arguments);this.minimized?(N=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+N-140+"px"):(this.div.style.width=N+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-N+140)+"px");this.fit()};
-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(R){mxEvent.getSource(R)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var O=EditorUi.prototype.init;EditorUi.prototype.init=function(){function F(u,H,P){var T=l.menus.get(u);H=A.addMenu(mxResources.get(u),mxUtils.bind(this,function(){T.funct.apply(this,arguments)}));H.className="geButton";H.setAttribute("title",mxResources.get(u));l.menus.menuCreated(T,H,"geButton");null!=P&&
-(H.style.backgroundImage="url("+P+")",H.innerText="");return H}function N(u,H,P,T,W,fa){var X=document.createElement("a");X.className="geButton";x.appendChild(X);null!=fa?X.style.backgroundImage="url("+fa+")":mxUtils.write(X,u);mxEvent.addListener(X,"click",function(ea){"disabled"!=X.getAttribute("disabled")&&H(ea);mxEvent.consume(ea)});mxEvent.preventDefault(X);null!=T&&X.setAttribute("title",T);null!=W&&(u=function(){W.isEnabled()?X.removeAttribute("disabled"):X.setAttribute("disabled","disabled")},
+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(R){mxEvent.getSource(R)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var O=EditorUi.prototype.init;EditorUi.prototype.init=function(){function F(u,H,P){var U=l.menus.get(u);H=A.addMenu(mxResources.get(u),mxUtils.bind(this,function(){U.funct.apply(this,arguments)}));H.className="geButton";H.setAttribute("title",mxResources.get(u));l.menus.menuCreated(U,H,"geButton");null!=P&&
+(H.style.backgroundImage="url("+P+")",H.innerText="");return H}function N(u,H,P,U,W,fa){var X=document.createElement("a");X.className="geButton";x.appendChild(X);null!=fa?X.style.backgroundImage="url("+fa+")":mxUtils.write(X,u);mxEvent.addListener(X,"click",function(ea){"disabled"!=X.getAttribute("disabled")&&H(ea);mxEvent.consume(ea)});mxEvent.preventDefault(X);null!=U&&X.setAttribute("title",U);null!=W&&(u=function(){W.isEnabled()?X.removeAttribute("disabled"):X.setAttribute("disabled","disabled")},
W.addListener("stateChanged",u),q.addListener("enabledChanged",u),u());return X}function R(u,H,P){H=document.createElement("div");H.className="geButtonGroup";for(P=0;P<u.length;P++)null!=u[P]&&H.appendChild(u[P]);x.appendChild(H);return H}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var u=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(u=l.buttonContainer.offsetWidth||300);x.innerHTML="";var H=m<1E3+u,P=F("diagram",null,H?Editor.menuImage:null);
R([P,N(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),H?Editor.shapesImage:null),N(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),H?Editor.formatImage:null)]);P=F("insert",!0,H?J:null);R([P,N(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),H?Editor.trashImage:null)]);
-q.isEnabled()||P.setAttribute("disabled","disabled");Da.setAttribute("title",mxResources.get("undo")+" ("+ka.shortcut+")");ha.setAttribute("title",mxResources.get("redo")+" ("+ua.shortcut+")");k.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+u&&(R([Da,ha]),m>=520+u&&R([k,m>=640+u?N("",aa.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",aa,Editor.zoomInImage):null,m>=640+u?N("",ja.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ja,Editor.zoomOutImage):
+q.isEnabled()||P.setAttribute("disabled","disabled");Da.setAttribute("title",mxResources.get("undo")+" ("+la.shortcut+")");ha.setAttribute("title",mxResources.get("redo")+" ("+ua.shortcut+")");k.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+u&&(R([Da,ha]),m>=520+u&&R([k,m>=640+u?N("",aa.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",aa,Editor.zoomInImage):null,m>=640+u?N("",ja.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ja,Editor.zoomOutImage):
null]));x.appendChild(l.statusContainer);x.appendChild(l.buttonContainer)}O.apply(this,arguments);var f=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=f&&(f.classList.add("geSimple"),f.classList.add("geMinimal"),f.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(d(this,!0),null!=this.sidebar&&null!=
urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var l=this,q=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));var x=document.createElement("div");x.className="geMenubarContainer";var A=new Menubar(l,x),E=l.hideCurrentMenu;l.hideCurrentMenu=function(){E.apply(this,arguments);
null!=this.editor&&this.editor.graph.popupMenuHandler.hideMenu()};var K=l.descriptorChanged;l.descriptorChanged=function(){K.apply(this,arguments);var u=l.getCurrentFile();if(null!=u&&null!=u.getTitle()){var H=u.getMode();"google"==H?H="googleDrive":"github"==H?H="gitHub":"gitlab"==H?H="gitLab":"onedrive"==H&&(H="oneDrive");H=mxResources.get(H);x.setAttribute("title",u.getTitle()+(null!=H?" ("+H+")":""))}else x.removeAttribute("title")};l.setStatusText(l.editor.getStatus());x.appendChild(l.statusContainer);
l.buttonContainer=this.createButtonContainer();x.appendChild(l.buttonContainer);l.menubarContainer=l.buttonContainer;l.tabContainer=this.createTabContainer();var Q=this.createZoomInput(!0),V=l.updateTabContainer;l.updateTabContainer=function(){V.apply(this,arguments);l.tabContainer.appendChild(Q)};var J=Editor.addBoxImage;if(null!=l.hoverIcons){var ia=l.hoverIcons.update;l.hoverIcons.update=function(){q.freehand.isDrawing()||ia.apply(this,arguments)}}if(null!=q.freehand){var Y=q.freehand.createStyle;
-q.freehand.createStyle=function(u){return Y.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var aa=l.actions.get("zoomIn"),ja=l.actions.get("zoomOut");f=l.actions.get("resetView");var ka=l.actions.get("undo"),ua=l.actions.get("redo"),Da=N("",ka.funct,null,"",ka,Editor.undoImage),ha=N("",ua.funct,null,"",ua,Editor.redoImage),k=N("",function(u){mxEvent.isAltDown(u)?(l.hideCurrentMenu(),
+q.freehand.createStyle=function(u){return Y.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var aa=l.actions.get("zoomIn"),ja=l.actions.get("zoomOut");f=l.actions.get("resetView");var la=l.actions.get("undo"),ua=l.actions.get("redo"),Da=N("",la.funct,null,"",la,Editor.undoImage),ha=N("",ua.funct,null,"",ua,Editor.redoImage),k=N("",function(u){mxEvent.isAltDown(u)?(l.hideCurrentMenu(),
l.actions.get("customZoom").funct()):(l.hideCurrentMenu(),l.actions.get("smartFit").funct());mxEvent.consume(u)},!0,"",f,Editor.zoomFitImage);l.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){d(l,null)});l.container.appendChild(l.tabContainer);l.container.appendChild(x);l.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=m&&b(this,!0);c();l.addListener("lockedChanged",c);l.addListener("languageChanged",c);l.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,
"resize",function(){c();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.chatWindow&&l.menus.chatWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit();null!=l.menus.findReplaceWindow&&l.menus.findReplaceWindow.window.fit()})}}};
(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,d,m,p,t,n,y){this.file=b;this.id=d;this.content=m;this.modifiedDate=p;this.createdDate=t;this.isResolved=n;this.user=y;this.anchor=null;this.replies=[]};DrawioComment.prototype.getAnchorPageId=function(){return null!=this.anchor?this.anchor.p:null};DrawioComment.prototype.getAnchorCellIds=function(){var b=null!=this.anchor?this.anchor.c:null;return null==b?null:b instanceof Array?b:[b]};
DrawioComment.prototype.getAnchorCellId=function(){var b=this.getAnchorCellIds();return null!=b&&0<b.length?b[0]:null};DrawioComment.prototype.getAnchorRect=function(){return null!=this.anchor?this.anchor.r:null};DrawioComment.prototype.getAnchorPoint=function(){return null!=this.anchor?this.anchor.pt:null};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,d,m,p,t){d()};DrawioComment.prototype.editComment=function(b,d,m){d()};
-DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,p,t){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=p;this.locale=t};mxResources.parse('about=About\naiFreeModelHint=Start a new chat or shorten your message to send more.\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add Account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nalignCellsLeft=Align Left\nalignCellsCenter=Align Center\nalignCellsRight=Align Right\nalignCellsTop=Align Top\nalignCellsMiddle=Align Middle\nalignCellsBottom=Align Bottom\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSelectedObjectsInThisLayer=All selected objects are in this layer\nallSpaces=All Spaces\nallTags=All Tags\nandNMore=and {1} more\nanchor=Anchor\nandroid=Android\nangle=Angle\nallCells=All cells\nanimations=Flow Animations\ncell=cell\ncells=cells\nexcluded=Excluded\nexcludeSelection=Exclude selected cells\nlayer=Layer\nselectLayers=Select layers\ntransition=Transition\nmatch=Match\nmatchAll=All\nmatchAllHint=Match cells that have every selected tag (AND)\nmatchAny=Any\nmatchAnyHint=Match cells that have at least one selected tag (OR)\nduration=Duration (ms)\nfadeIn=Fade In\nfadeOut=Fade Out\nfadeTo=Fade To\nflow=Flow\nflowOff=Flow Off\nflowOn=Flow On\nhighlight=Highlight\nnoTagsInDiagram=No tags in this diagram yet.\noptional=optional\npopIn=Pop In\npopOut=Pop Out\nreorder=Drag to reorder\nreset=Reset\nscroll=Scroll To\nselectByTags=Select by tags\nselectCellsInDiagram=Select cells in diagram\ntag=Tag\nsetOpacity=Set Opacity\ntiming=Timing\ntoggle=Toggle\ntoggleStyle=Toggle Style\nuseSelection=Use selected cells\nvisibilityActions=Visibility\nwait=Wait\nwipeIn=Wipe In\nwipeOut=Wipe Out\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narea=Area\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosizeText=Automatic Font Size\nautosize=Autosize\nattach=Attach\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change User\nchangeStorage=Change Storage\nchangesNotSaved=Changes have not been saved\ncharactersRemaining={1} characters remaining\nclassDiagram=Class Diagram\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nclickToAdd=Click on canvas to add points\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ncurrentLayer=Current Layer\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram Type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndictate=Dictate\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclipboard=Clipboard\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseAll=Collapse All\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnectable=Connectable\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyDiagramToClipboard=Copy Diagram to Clipboard\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySelectionToClipboard=Copy Selection to Clipboard\ncopySize=Copy Size\ncopyStyle=Copy Style\ncopyTextStyle=Copy Text Style\ncreate=Create\ncreateDiagram=Create Diagram\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current Page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide Later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete All\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\nremoveLibraryConfirm=You are about to remove this library for everyone. Only an administrator can recover it. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndistributeHorizontal=Distribute Horizontally\ndistributeVertical=Distribute Vertically\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditor=Editor\neditPolygon=Edit Polygon\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditNote=Edit Note\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\neffects=Effects\nembed=Embed\nembedCellMetadata=Cell Metadata\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexpandAll=Expand All\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfindInDiagram=Find in Diagram\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTextToShape=Fit Text to Shape\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nforceDirected=Force-directed\nformat=Format\nformatAnimatedGif=Animated GIF\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatJson=JSON\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatVsdx=VSDX\nformatWebp=WebP\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngDriveAppFilesOnly=Only files created or opened with draw.io in Google Drive are listed. To add another file, open it once at app.diagrams.net.\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\ngroupPadding=Group Padding\nguides=Guides\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nshiftClickShowOnly=Shift+click: show only {1}\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nicons=Icons\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageClicked=Image copied to clipboard\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimmediate=Immediate\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninherit=Inherit\ninitialPage=Initial Page\ninitialView=Initial View\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertDiagramFromClipboard=Insert Diagram from Clipboard\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\ninvertSelection=Invert Selection\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlabelPadding=Label Padding\nlabelWidth=Label Width\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlibavoidAutoRoute=Auto-route around shapes\nlibavoidUnavailable=Orthogonal routing is not available in this browser.\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line Jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkIcons=Link Icons\nlinkText=Link Text\ntooltipIcons=Tooltip Icons\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to Right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nlightboxAnimationHint=Plays automatically when the page is shown in lightbox mode.\nline=Line\nlineend=Line End\nlineheight=Line Height\nlinestart=Line Start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlock=Lock\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloop=Loop\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmethod=Method\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move Selection to {1}\nmultipleValues=Multiple values\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewChat=New Chat\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoAnimationsInDiagram=No animations found in diagram\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoStepsYet=No steps yet. Add the first step below.\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotes=Notes\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered List\noffline=Offline\naddToLibrary=Add to Library\nanimation=Animation\nbool=Boolean\ncannotMoveOneDrive=Moving a file between accounts is not supported yet.\ncode=Code\ncolor=Color\ndispName=Display Name\nenum=Enumeration\nenumList=Enum List\nfast=Fast\nfloat=Float\nforever=Forever\nint=Int\ninvalid=invalid\nloops=Loops\nmedium=Medium\nslow=Slow\nspeed=Speed\nstring=String\nmanage=Manage\nofflineLanguages=Languages available offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenRepairedCopy=Open repaired copy\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\northogonalRouting=Orthogonal Routing\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste Here\npasteResponse=Paste Response\npasteSize=Paste Size\npasteStyle=Paste Style\npasteTextStyle=Paste Text Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplantUmlWarnings=PlantUML warnings\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\npolygon=Polygon\nportrait=Portrait\npoint=Point\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Process Engineering\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\npromptOnly=Prompt Only\npromptTooLarge=Only {1} characters allowed in the free version using the draw.io model\npromptWithDiagram=Prompt with Diagram\npromptWithSelection=Prompt with Selection\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nretry=Retry\nrememberMe=Remember Me\nrememberThisSetting=Remember This Setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace Existing Drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoreBackupCopy=Open backup as copy\nrecover=Recover…\nrecoverTitle=Recover file\nrecoverVersionFrom=Version from {1}\nrecoverPreviousVersion=Previous version\nrecoveryVersionDesc=A previously saved version. Complete, but any changes made since then are not included.\nrecoveryRepairedDesc=The current file with a best-effort repair. Recent, but content after the damaged point may be missing.\nrecoveryWarning=This is a best-effort recovery and may be missing content. It will open as a new unsaved copy and your original file is not changed. Continue?\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to Left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nrunLastLayout=Run Last Layout\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchImages=Search Images\nsearchShapes=Search Shapes\nsearchShapesInOpenLibraries=Search Shapes in Open Libraries\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshadows=Shadows\nshape=Shape\nshapeDeleted=Shape deleted\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsortPages=Sort Pages\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start Drawing\nstopDrawing=Stop Drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstress=Stress\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page, then click "Open with draw.io" button in the top right corner.\nturn=Rotate Shape Only by 90°\ntype=Type\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateDiagramFromClipboard=Update diagram from clipboard\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating document. Please wait...\nupdatingPreview=Updating preview. Please wait...\nupdatingSelection=Updating selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use Black and White\nuseCurrent=Use Current\nuseCurrentSettings=Use Current Settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently Used\nlistView=List View\ngridView=Grid View\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\nmentionNoNotify=People you mention are not notified\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft read error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft write error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nreindexInst3=Indexing pauses while the computer is asleep or offline and resumes when the connection returns, so keep the computer awake until "Re-indexing finished" is shown.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving failed (unexpected error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload failed (unexpected error)\nhiResPreview=High Resolution Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfADraftUpdated=Updated the draft of diagram: "{1}"\nconfADraftUpdateFailed=Updating the draft of diagram "{1}" failed\nconfADraftRemoved=Removed the draft of diagram: "{1}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\ncopyAsSvg=Copy as SVG\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by Spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a File...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the Viewer (px)\nheightOfViewer=Height of the Viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit Owning Page\ndeepIndexing=Deep Indexing (including diagrams that aren\'t used in any page)\nconfADeepIndexStarted=Deep indexing started\nconfADeepIndexDone=Deep indexing done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last Modified on\nsearchResults=Search Results\nshowAllTemps=Show All Templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for Updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell Checker\nnoChange=No Change\nlblToSvg=Convert Labels to SVG\nautoRotateLabel=Rotate with Edge\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft Save Interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow All\nnoTeams=No teams found\nerrorLoadingTeams=Error loading teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA404AttErrFaq=There are ({1}) 404 "File not found" error(s). The diagram file (an attachment of the page) does not exist. If it exists on the same page in the source site, the migration did not copy it, so copy the attachment manually or re-migrate the attachments. If it is missing in the source site also, the diagram was deleted before the migration.\nconfA404NoEditErrFaq=There are ({1}) 404 "Cannot find a page" error(s) for pages that were fetched successfully. These pages exist but could not be updated, this usually means the current user has no edit permission on them (page restrictions) or they are archived. Re-run the process with a user that can edit these pages.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAPageNoEditPerm=The page exists but could not be updated, this usually means the current user has no edit permission on it or the page is archived.\nconfAMacroInComment=draw.io macros inside page comments are not converted, skipped comment "{1}" (id {2})\nconfAReplaceBaseUrl=Replace base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate diagram detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for Production Use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have the "Attachment Checker for Confluence" app, enable "Always allow draw.io attachments" in its File Type Blocking settings. Update the app if that option is missing.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache Page IDs Mapping\nconfARemImpPages=Remember Imported Pages\nconfAGMTitle=Gliffy migration\nconfAGMStoredState=Stored state & reports\nconfAGMTabDryRun=Dry run\nconfAGMTabImport=Import\nconfAGMReadOnly=Read-only\nconfAGMWrites=Writes to pages\nconfAGMLoading=Loading migration state...\nconfAGMLoadFailed=Loading the migration state failed. Reload the page to try again.\nconfAGMStepScan=Scan & scope\nconfAGMStepDryRun=Dry run\nconfAGMStepReview=Review & report\nconfAGMScanTitle=Where your Gliffy diagrams live\nconfAGMScanSub=Scanning reads pages and counts Gliffy macros - it never modifies anything. Scans checkpoint as they go and resume if interrupted. Results are cached: rescanning is manual.\nconfAGMScanSite=Scan site\nconfAGMScanning=Scanning...\nconfAGMResumeScan=Resume scan\nconfAGMRescan=Rescan site\nconfAGMRescanConfirm=Rescan the site? The inventory is rebuilt; dry-run results and review verdicts are kept and re-matched by diagram.\nconfAGMScanMetaDone=Last scan finished {1} after {2} - {3} spaces contain Gliffy - {4} pages - {5} diagrams\nconfAGMScanMetaPaused=Scan paused - resumes from its checkpoint\nconfAGMScanMetaNone=Not scanned yet - scan to build the space inventory\nconfAGMPause=Pause\nconfAGMSearchSpaces=Search spaces by name or key...\nconfAGMSelectAll=Select all {1} with diagrams\nconfAGMSelectLive=All except archived ({1})\nconfAGMClear=Clear\nconfAGMShowArchived=Show archived\nconfAGMArchived=archived\nconfAGMSpace=Space\nconfAGMKey=Key\nconfAGMPages=Pages\nconfAGMDiagrams=Diagrams\nconfAGMNotImportable=Not importable\nconfAGMNoSpaces=No spaces yet - run a scan to build the inventory.\nconfAGMSpaceFoot=Showing {1} of {2} spaces, largest first.\nconfAGMSpaceFootMore=Showing the largest {1} of {2} matching spaces - search to narrow.\nconfAGMScope=Scope\nconfAGMScopeTotals={1} spaces - {2} diagrams - {3} pages\nconfAGMStartDryRunArrow=Start dry run →\nconfAGMDryTitle=Dry run - converts locally, changes nothing\nconfAGMDrySub=Every diagram in scope is downloaded and converted in this browser, and every affected page gets a permission check. Nothing is written to Confluence; diagram data never leaves this machine. Safe to close the tab - the run resumes from its last checkpoint.\nconfAGMDryNone=No dry run yet\nconfAGMDryRunning=Dry run in progress\nconfAGMDryPaused=Dry run paused\nconfAGMDryDone=Dry run complete - nothing was changed\nconfAGMInterrupted=interrupted\nconfAGMDone=done\nconfAGMStarted=Started {1}\nconfAGMFinished=finished {1}\nconfAGMStartDry=Start dry run\nconfAGMRerunDry=Run dry run again\nconfAGMResumeCheckpoint=Resume from checkpoint\nconfAGMSafeClose=Safe to close this tab at any time.\nconfAGMGenReport=Generate report\nconfAGMOfProcessed=of {1} processed\nconfAGMConvClean=converted clean\nconfAGMConvWarn=converter warnings\nconfAGMStalePins=version pin warnings\nconfAGMStalePin=The Gliffy macro pins version {1} but the latest is {2} - version pinning is off, so the latest was used; verify the conversion matches what the page displayed\nconfAGMPinnedOld=Imported the pinned version {1}; the latest is {2} - verify this is the version the page really displayed\nconfAGMPinFellBack=The pinned version {1} was not found - the latest ({2}) was used instead\nconfAGMPinResetNotice=draw.io update: Gliffy version pin handling changed - pins are now off by default (cloud Gliffy displays the latest version) and every pin that differs from the latest is flagged for review. The previous dry run used the old rules, so run a fresh dry run.\nconfAGMVersionPinning=Import the Gliffy version pinned in each macro instead of the latest (rarely needed - e.g. content migrated from Confluence Data Center)\nconfAGMPinToggleConfirm=Changing version pinning re-keys every diagram: the current dry run, review verdicts and import state will be discarded, and a fresh dry run is needed. Continue?\nconfAGMAlreadyImp=previously imported\nconfAGMFailed=failed\nconfAGMWriteBlocked=write-blocked\nconfAGMLeft=left\nconfAGMProblems=Problems so far - grouped, full detail in the stored files\nconfAGMNoPageEdit=no page edit\nconfAGMBlockedRow={1} pages ({2} diagrams) this user cannot edit - fix permissions or leave them Gliffy\nconfAGMReasonDraft=Gliffy draft stored on gliffy.com - no attachment to convert\nconfAGMReasonAttMissing=Diagram attachment no longer exists\nconfAGMReasonTooLarge=Exceeds converter limits\nconfAGMReasonConvert=Conversion failed\nconfAGMReasonFetch=Downloading the diagram failed\nconfAGMReasonSave=Saving failed\nconfAGMReasonAttInfo=Attachment lookup failed\nconfAGMReasonOther=Other error\nconfAGMNoEditPerm=No permission to edit "{1}" - its diagrams cannot be imported by this user\nconfAGMDiagConverted=Converted {2} diagram "{1}" (dry run, nothing written)\nconfAGMReviewTitle=Review a sample against the Gliffy previews\nconfAGMReviewSub=Left: the preview image Gliffy stored. Right: a live render of the draw.io conversion - what the page will show after import. Rate with the keyboard; verdicts are saved continuously and feed the report and the import.\nconfAGMReviewNeedsDry=Finish a dry run first - the review works on its results.\nconfAGMSample=Sample\nconfAGMSampleNote=of {1} converted - flagged first, then random across spaces\nconfAGMCustomPct=Custom %\nconfAGMApply=Apply\nconfAGMFilterSample=Sample\nconfAGMFilterUnreviewed=Unreviewed\nconfAGMFilterFlagged=Flagged\nconfAGMFilterFailed=Failed\nconfAGMSideBySide=Side by side\nconfAGMLiveRender=live render of conversion\nconfAGMStoredPreview=stored preview image\nconfAGMNoPreview=No preview image stored by Gliffy - compare against the diagram on its page.\nconfAGMGliffyPreviewAlt=Gliffy preview\nconfAGMNoDrawio=No draw.io version to show.\nconfAGMPreviewFailed=Rendering the conversion failed.\nconfAGMNotConverted=not converted\nconfAGMFailedReason=Not converted ({1}). See the problems list and the report.\nconfAGMFlickHint=A/B - press X or click to flip\nconfAGMConverterWarning=converter warning\nconfAGMNothingHere=Nothing to review in this filter\nconfAGMMatch=Match\nconfAGMMinor=Minor differences\nconfAGMMajor=Major differences\nconfAGMMatchL=match\nconfAGMMinorL=minor\nconfAGMMajorL=major\nconfAGMLeftInSample=left in sample\nconfAGMOfReviewed=of {1} reviewed\nconfAGMNotePlaceholder=Optional note - included in the report\nconfAGMPrivacy=The report contains ratings, notes, diagram names and converter warnings - never diagram contents. Diagram names are only sent to draw.io if you opt in below.\nconfAGMSendNamesOptIn=Include diagram names\nconfAGMSendReport=Send report to draw.io\nconfAGMSendConfirm=Send the migration report summary to draw.io? It contains counts, failure reasons and review verdicts.\nconfAGMSendDone=Report sent to draw.io. Reference: {1} - please quote it when contacting support.\nconfAGMGenerating=Generating report...\nconfAGMReportSaved=Report saved as {1} with the migration state.\nconfAGMOpenState=Open\nconfAGMReportFailed=Generating the report failed.\nconfAGMImpTitle=Import - writes to pages\nconfAGMImpSub=Consumes the latest dry run: scope, permission checks and review verdicts. Gliffy macros are replaced with draw.io macros and a .drawio attachment is added per diagram. Nothing is deleted - Gliffy attachments stay in place and every page edit is a normal Confluence version, so reverting a page restores its Gliffy macros.\nconfAGMImpNeedsDry=Import is disabled until a dry run has completed. Run it from the Dry run tab - it changes nothing.\nconfAGMImpReady={1} diagrams ready\nconfAGMImpSkipFail={1} failed conversions will be skipped and listed\nconfAGMImpBlocked={1} diagrams on {2} blocked pages stay Gliffy until permissions are fixed\nconfAGMImpAll=Import everything that converted\nconfAGMImpAllD=Review verdicts ride along in the log for follow-up\nconfAGMImpHold=Hold back "Major differences"\nconfAGMImpHoldN=Hold back "Major differences" ({1} rated)\nconfAGMImpHoldD=Diagrams rated Major in review stay Gliffy for a later pass\nconfAGMAdvanced=Advanced (defaults are right for almost everyone)\nconfAGMAddLabel=Add a label to every modified page (for CQL follow-up)\nconfAGMCheckDrift=Check for changes since dry run\nconfAGMDriftChecking=Checking pages for changes since the dry run...\nconfAGMDriftResult={1} pages changed and {2} gone since the dry run (checked {3}). Changed pages are re-verified during import.\nconfAGMDriftRecommend=More than 10% drift - running a fresh dry run first is recommended.\nconfAGMDriftUnknown=The dry run is {1} days old. Check for changes before importing.\nconfAGMImpNone=Not started\nconfAGMImpRunning=Import in progress\nconfAGMImpPaused=Import paused\nconfAGMImpDone=Import finished\nconfAGMStartImport=Start import - {1} diagrams\nconfAGMImpConfirm=Start the import? Up to {1} diagrams across {2} pages will be converted to draw.io macros. Nothing is deleted and every page edit is a normal Confluence version.\nconfAGMOfPages=of {1} pages\nconfAGMImported=diagrams imported\nconfAGMSkipped=skipped\nconfAGMErrors=errors\nconfAGMHeldBack=Held back "{1}" (rated Major differences in review)\nconfAGMSkippedFailed=Skipped "{1}" (failed in the dry run: {2})\nconfAGMPageBlocked=Skipped page "{1}" (no edit permission)\nconfAGMReimportPass=Processing pages labeled for re-import...\nconfAGMReassure=Interruptions resume from the last checkpoint - already-imported diagrams are never redone. The import log is stored with the migration state and downloadable.\nconfAGMImpSummary=Import finished {1}: {2} diagrams imported across {3} pages.\nconfAGMImpSummary2={1} held back - {2} skipped (failed) - {3} blocked - {4} errors.\nconfAGMImpSummary3=The run log and report are stored with the migration state.\nconfAGMRunAnother=Run another import\nconfAGMImpReportSaved=Run report saved as {1} with the migration state.\nconfAGMHttpFaq={1} requests failed with 403/404. These are usually permission problems - the API also returns 404 for content the user cannot read. See\nconfAGMFullscreen=Fullscreen\nconfAGMClose=Close\nconfAGMStatePageDesc=State and reports of the Gliffy to draw.io migration. Managed by the draw.io app; do not edit the attachments manually.\nconfABrokenDiagLnk=Broken diagram link (custom content) "{1}"\nconfACCDupEntry=duplicate entry\nconfACCInvalid=invalid content\nconfACCAttMissing=attachment is missing or has an older version\nconfAChkTabTitle=Integrity Check (Beta)\nconfAChkTitle=draw.io Diagrams Integrity Check\nconfAChkInst1=Scans all pages with draw.io macros and checks that every diagram has its attachment, preview image and diagram link (custom content) with the versions the macro points to. It also reports broken, duplicate and unused diagram links.\nconfAChkInst2=The check is read-only and changes nothing. It can take some time and the browser window must remain open until it finishes.\nconfAChkDownloadOpt=Download each diagram and verify its content instead of only checking it exists (slower, detects corrupted files)\nconfAChkStart=Start Integrity Check\nconfAChkStatChecked=Diagrams checked\nconfAChkStatOk=OK\nconfAChkStatBroken=Broken\nconfAChkStatWarn=With warnings\nconfAChkStatCC=Broken diagram links\nconfAChkStatOrphans=Unused embed links\nconfAChkLog=Log\nconfAChkFilterAll=All\nconfAChkFilterIssues=Issues only\nconfAChkProgLinks=Checking diagram links ({1} of {2})\nconfAChkProgPages=Checking pages with {3} macros ({1} of {2})\nconfAChkEta=~{1} remaining\nconfAChkEstimating=estimating…\nconfAChkDiag=Checking diagram "{1}"\nconfAChkDiagOK=Diagram "{1}" is OK\nconfAChkMacroNoName=Found a diagram macro without a diagram name (possibly a never-edited macro)\nconfAChkPageInfoBroken=Diagram "{1}": the page referenced by the macro (by space and title) cannot be resolved\nconfAChkCCMissing=Diagram "{1}": its diagram link (custom content) is missing or broken (the diagram works, but is excluded from search and diagram listings)\nconfAChkCCNoRef=Diagram "{1}": the macro has no diagram link (custom content) reference\nconfAChkCCOther=Diagram "{1}": the macro references a missing diagram link (custom content), but a valid one exists for this diagram\nconfAChkCCMismatch=Diagram "{1}": its diagram link (custom content) does not match the macro (page, name, or version)\nconfAChkDiagPageMissing=Diagram "{1}": the page ({2}) that holds the diagram attachment is not found\nconfAChkAttMissing=Diagram "{1}": the diagram attachment is not found\nconfAChkAttOldVer=Diagram "{1}": the diagram attachment version ({2}) is older than the version in the macro ({3})\nconfAChkAttFetchFailed=Diagram "{1}": fetching the attachments of page ({2}) failed\nconfAChkPrevMissing=Diagram "{1}": the preview image ({2}) is not found\nconfAChkPrevOldVer=Diagram "{1}": the preview image version ({2}) is older than the version in the macro ({3})\nconfAChkPrevOutOfSync=Diagram "{1}": the preview image (of diagram version {2}) is out of sync with the diagram (version {3})\nconfAChkPrevPageFailed=Diagram "{1}": fetching the attachments of the preview image page ({2}) failed\nconfAChkDiagInvalid=Diagram "{1}": the diagram content is not a valid draw.io file\nconfAChkDiagDownFailed=Diagram "{1}": downloading the diagram failed\nconfAChkEmbedCC=Checking embedded diagram links (custom contents)...\nconfAChkOrphanEmbedCC=Embedded diagram link (custom content) "{1}" is not referenced by any macro\nconfAChkSummary=Integrity check finished: {1} macros checked, {2} OK, {3} broken, {4} with warnings. Diagram links (custom contents): {5} broken, {6} unused embedded diagram links\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluence app)\nm365=Microsoft 365\nnodeSpacing=Node Spacing\nrankSpacing=Rank Spacing\npolyline=Polyline\nlayeringStrategy=Layering Strategy\nnetworkSimplex=Network Simplex\nlongestPath=Longest Path\ncoffmanGraham=Coffman-Graham\nweighting=Weighting\nmodelOrder=Model Order\ndescendants=Descendants\nconstraint=Constraint\nfan=Fan\noptimization=Optimization\nedgeLength=Edge Length\nedgeLengthByPosition=Edge Length by Position\ncrossingMinimization=Crossing Minimization\niterations=Iterations\nrepulsivePower=Repulsive Power\nresizeNodes=Resize Nodes\nuseSelectionAsRoot=Use Selection as Root\nuseSelectionAsRoots=Use Selection as Roots\nanonymize=Anonymize\nconnector=Connector\nextractText=Extract Text\nlegacyLayouts=Legacy Layouts\nedgeStyle=Edge Style\ncorners=Corners\nkeepStyle=Keep Existing Style\nopenLucidSite=Open Lucidchart Site in another tab and login to your account, then come back to this tab and click the "Start Import" button again.\npreviewSaveNoPermission=You do not have permission to save the preview image. The source page may be restricted or you may not have edit permission on the page. This only affects this page export to PDF/Word.\npreserveOrigin=Preserve Origin\nsharedStems=Bundle Outgoing Connections\ndraftLoadedWUnpublishedChanges=The diagram has loaded from a draft with unpublished changes. It is different from the published version.\nhachure=Hachure\nhatch=Hatch\ndots=Dots\ncrossHatch=Cross Hatch\nzigzag=ZigZag\nzigzagLine=ZigZag Line\nsysFonts=System Fonts\nwebfonts=Web Fonts\nfontname=Font Name\nfontUrl=Font URL\ncreatingDiagram=Generating diagram. Please wait\nconfAFixPageStorage=Remove invalid page storage format elements (Warning: May cause data loss)\ncfgAiActions=AI Actions (JSON)\ncfgAiConfigs=AI Configs (JSON)\ncfgAiGlobals=AI Globals (JSON)\ncfgAiModels=AI Models (JSON)\ncfgAppendCustomLibraries=Append Custom Libraries\ncfgAppendCustomLibrariesHelp=Custom libraries appear after built-in ones\ncfgAutoCropViewer=Auto Crop Viewer\ncfgAutoCropViewerHelp=Auto-crop viewer to fit diagram bounds\ncfgAutosaveDelay=Autosave Delay (ms)\ncfgBrowserTranslate=Browser Translate\ncfgBrowserTranslateHelp=Mirror diagram text for browser translation engines (e.g. Chrome Translate)\ncfgClaudeApiKey=Claude API Key\ncfgColorNames=Color Names (JSON)\ncfgColorNamesHelp=Map of colour codes to display names (tooltips)\ncfgCompact=Compact UI\ncfgCompactHelp=Enable compact user interface mode\ncfgCompressStyles=Compress Styles\ncfgCompressStylesHelp=Deduplicate repeated inline images and stencils into a shared lookup table. Only readable by draw.io 29.3.1 and later.\ncfgCompressXml=Compress XML\ncfgCompressXmlHelp=Compress XML output in saved files\ncfgCopyOnConnect=Copy on Connect\ncfgCopyOnConnectHelp=Create a copy of the source shape for connections that end on the canvas\ncfgCss=CSS Rules\ncfgCssHelp=CSS rules to customize the draw.io user interface\ncfgCustomCss=Custom CSS (alternative)\ncfgCustomCssHelp=Injected as a separate style element\ncfgCustomTemplates=Custom Templates (JSON)\ncfgCustomTemplatesHelp=Templates added to the sections of the template dialog\ncfgDarkColor=Dark Mode Background\ncfgDarkColorVar=Dark Color CSS Variable\ncfgDebug=Debug\ncfgDebugHelp=Enable debug output\ncfgDefaultAdaptiveColors=Adaptive Colors\ncfgDefaultConnectable=Default Connectable\ncfgDefaultConnectableHelp=Shapes are connectable by default\ncfgDefaultConnectionArrowsEnabled=Connection Arrows\ncfgDefaultConnectionArrowsEnabledHelp=Show arrows when hovering connections\ncfgDefaultDarkGridColor=Default Grid Color (Dark Mode)\ncfgDefaultDarkPageBackgroundColor=Default Page Background (Dark Mode)\ncfgDefaultEdgeLength=Default Edge Length\ncfgDefaultFileType=Default File Type\ncfgDefaultFoldingEnabled=Folding Enabled\ncfgDefaultFoldingEnabledHelp=Enable shape folding (collapse/expand)\ncfgDefaultGridColor=Default Grid Color\ncfgDefaultGridEnabled=Grid Enabled\ncfgDefaultGridEnabledHelp=Show grid on canvas\ncfgDefaultGridSize=Default Grid Size\ncfgDefaultLanguages=Default Languages\ncfgDefaultLanguagesHelp=Language bundles installed for offline use on startup\ncfgDefaultLibraries=Default Libraries\ncfgDefaultLibrariesHelp=Semicolon-separated library keys shown in sidebar on startup\ncfgDefaultPageBackgroundColor=Default Page Background\ncfgDefaultPageVisible=Page Visible\ncfgDefaultPageVisibleHelp=Show page outline on canvas\ncfgDefaultTextStyle=Default Text Style\ncfgDefaultTransparentGroups=Automatic Group Size\ncfgDefaultTransparentGroupsHelp=New groups automatically resize to fit their children (transparentBounds=1)\ncfgDesktopAutoSync=Desktop Auto Sync\ncfgDesktopAutoSyncHelp=Auto-sync when local file changes\ncfgDisableVersioning=Disable Versioning\ncfgDisableVersioningHelp=Disable diagram versioning\ncfgEmbedSvgFonts=Embed SVG Fonts\ncfgEmbedSvgFontsHelp=Default for embedding fonts as data URIs in exported and saved SVG files, can be overridden per file in the file properties\ncfgEmptyDiagramXml=Empty Diagram XML\ncfgEmptyLibraryXml=Empty Library XML\ncfgEnableAi=Enable AI\ncfgEnableAiHelp=Enable AI diagram generation\ncfgEnableAnimations=Enable Animations\ncfgEnableAnimationsHelp=Enable shape and layout animations\ncfgEnableCssDarkMode=CSS Dark Mode\ncfgEnableCssDarkMode2=CSS Dark Mode\ncfgEnableCssDarkMode2Help=Enable CSS-based dark mode for viewer diagrams\ncfgEnableCssDarkModeHelp=Use CSS for dark mode rendering\ncfgEnableCustomGitLabUrl=Enable Custom GitLab URL\ncfgEnableCustomGitLabUrlHelp=Allow ?gitlab= / ?gitlab-id= URL parameters to override the default GitLab server. Enable only for self-hosted GitLab deployments.\ncfgEnableCustomLibraries=Enable Custom Libraries\ncfgEnableCustomLibrariesHelp=Allow open and new library functions\ncfgEnableDistanceGuides=Distance Guides\ncfgEnableDistanceGuidesHelp=Snap shapes to equal distances between the surrounding shapes while moving (default on)\ncfgEnableExportUrl=Enable Export URL\ncfgEnableExportUrlHelp=Enable the export URL feature\ncfgEnableInlineToolbar=Inline Toolbar\ncfgEnableInlineToolbarHelp=Enable the inline toolbar on selection\ncfgEnableLightDarkColors=Light/Dark Colors\ncfgEnableLightDarkColorsHelp=Use CSS light-dark() color function\ncfgEnableLocalFonts=Local Fonts\ncfgEnableLocalFontsHelp=Scan and list locally installed fonts in the font picker\ncfgEnableNativeClipboard=Native Clipboard\ncfgEnableNativeClipboardHelp=Use native system clipboard\ncfgEnablePositionGuides=Position Guides\ncfgEnablePositionGuidesHelp=Snap shapes to the edges and centers of the other shapes while moving (default on)\ncfgEnableSizeGuides=Size Guides\ncfgEnableSizeGuidesHelp=Snap the size of a shape to the sizes of the other shapes while resizing (default on)\ncfgEnableWindowDocking=Window Docking\ncfgEnableWindowDockingHelp=Enable window docking\ncfgExpandLibraries=Expand Libraries\ncfgExpandLibrariesHelp=Libraries expanded by default\ncfgExpandPatternsForPrint=Expand Patterns for Print\ncfgExpandPatternsForPrintHelp=Expand patterns to visible graphics during print/PDF export\ncfgExperimental=Experimental feature\ncfgFitDiagramOnLoad=Fit Diagram on Load\ncfgFitDiagramOnLoadHelp=Fit diagram to window on load\ncfgFitDiagramOnPage=Fit Diagram on Page\ncfgFitDiagramOnPageHelp=Fit diagram to page size\ncfgFoldingIconSize=Folding Icon Size\ncfgFontCss=Font CSS (@font-face rules)\ncfgFontCssHelp=Added before preset colors in the colour dialog\ncfgForceSimpleViewer=Force Simple Viewer\ncfgForceSimpleViewerHelp=Force simple viewer for all diagrams\ncfgForeignObjectImages=Foreign Object Images\ncfgForeignObjectImagesHelp=Replace foreignObject with images\ncfgGeminiApiKey=Gemini API Key\ncfgGenerateSVGs=Generate SVGs\ncfgGenerateSVGsHelp=Generate SVG previews for diagrams\ncfgGlobalVars=Global Variables (JSON)\ncfgGlobalVarsHelp=Global placeholders available in all diagrams\ncfgGptApiKey=OpenAI API Key\ncfgGptUrl=Custom GPT URL\ncfgGridSteps=Grid Steps\ncfgHiResPreview=Hi-Res Preview\ncfgHiResPreviewHelp=Generate high-resolution preview images\ncfgIncludeDiagram=Include Diagram in Export\ncfgIncludeDiagramHelp=Include diagram data in export dialogs\ncfgInlineExtIcons=Inline Icon Search Results\ncfgInlineExtIconsHelp=Insert icon search results as embedded images instead of remote references\ncfgInplaceEdits=In-place Edits\ncfgInplaceEdits2=In-place Edits\ncfgInplaceEdits2Help=Allow launching editor from viewer\ncfgInplaceEditsHelp=Allow launching the editor from the viewer\ncfgInsertAnimations=Insert Animations\ncfgInsertAnimationsHelp=Show pop animation when inserting shapes from the sidebar\ncfgIntersectionSelect=Intersection Select\ncfgIntersectionSelectHelp=Select cells by intersection rather than containment\ncfgKeyboardShortcuts=Keyboard Shortcuts (JSON)\ncfgKeyboardShortcutsHelp=Custom keyboard shortcuts. Entries are {keyCode, control, shift, alt, action} where keyCode is a key code or single character and action is an action name, or null to remove a binding.\ncfgLibraries=Libraries (JSON)\ncfgLibrariesHelp=Custom library sections for the left panel\ncfgLockdown=Lockdown\ncfgLockdown2=Lockdown\ncfgLockdown2Help=Disable data transmission outside Confluence\ncfgLockdownHelp=Disable data transmission apart from storage\ncfgMathOutputSize=Math Output Size\ncfgMathOutputSizeHelp=Size labels, view bounds and initial fit to the rendered math output instead of the formula source\ncfgMaxImageBytes=Max Image Bytes\ncfgMaxImageSize=Max Image Size (px)\ncfgMermaid=Mermaid Config (JSON)\ncfgMermaidHelp=Default Mermaid settings such as theme and colours for all diagrams\ncfgNoAutoFocus=No Auto Focus\ncfgNoAutoFocusHelp=Disable auto-focus on startup\ncfgNoResizers=No Resizers\ncfgNoResizersHelp=Hide shape resize handles\ncfgNotSet=Not set (use default)\ncfgOneDriveInlinePicker=OneDrive Inline Picker\ncfgOneDriveInlinePickerHelp=Use inline picker for OneDrive\ncfgOptimizeHtmlLabels=Optimize HTML Labels\ncfgOptimizeHtmlLabelsHelp=Remove unnecessary spans from HTML labels when editing stops\ncfgOverride=Override\ncfgOverrideHelp=Ignore user settings stored in the browser so the defaults in this configuration always apply\ncfgPageFormatHeight=Page Height (1/10 inch)\ncfgPageFormatHeightHelp=Page format: US Letter = 850 x 1100, A4 = 827 x 1169\ncfgPageFormatWidth=Page Width (1/10 inch)\ncfgPassiveScroll=Passive Scroll\ncfgPassiveScrollHelp=Enable passive scroll event listeners\ncfgPasteAtMousePointer=Paste at Mouse\ncfgPasteAtMousePointerHelp=Paste elements at mouse pointer location\ncfgPreserveViewState=Preserve View State\ncfgPreserveViewStateHelp=Preserve view state in embed mode\ncfgRemoveImageMetadata=Remove Image Metadata\ncfgRemoveImageMetadataHelp=Strip metadata from images\ncfgReplaceSvgDataUris=Replace SVG Data URIs\ncfgReplaceSvgDataUrisHelp=Replace data URIs with SVG sub-trees in export\ncfgResources=Language Resources (JSON)\ncfgResourcesHelp=Overrides existing or adds new language resources for user interface text. Maps resource keys to strings, or to objects with one entry per language code and main as the fallback.\ncfgRestrictExport=Restrict Export\ncfgRestrictExportHelp=Disable exporting diagrams to other formats\ncfgSearchSettings=Search settings (e.g. grid, font, dark mode, compressXml...)\ncfgSectionAIConfiguration=AI Configuration\ncfgSectionAppearance=Appearance\ncfgSectionCanvasGrid=Canvas & Grid\ncfgSectionCollaborationAdvanced=Collaboration & Advanced\ncfgSectionColorSchemes=Color Schemes\ncfgSectionColors=Colors\ncfgSectionConfluenceCloud=Confluence Cloud\ncfgSectionConfluenceServerDataCenter=Confluence Server / Data Center\ncfgSectionCustomCSS=Custom CSS\ncfgSectionDefaultStyles=Default Styles\ncfgSectionEmbedding=Embedding\ncfgSectionExportSecurity=Export & Security\ncfgSectionFonts=Fonts\ncfgSectionGeneral=General\ncfgSectionLibraries=Libraries\ncfgSectionMenuCustomization=Menu Customization\ncfgSectionSidebarPanels=Sidebar & Panels\ncfgSelectParentLayer=Select Parent Layer\ncfgSelectParentLayerHelp=Selects parent layer for current selection\ncfgSettingsName=Settings Name\ncfgSettingsNameHelp=Key for storing user settings in local storage\ncfgShadowBlur=Shadow Blur\ncfgShadowColor=Shadow Color\ncfgShadowOffsetX=Shadow Offset X\ncfgShadowOffsetY=Shadow Offset Y\ncfgShadowOpacity=Shadow Opacity\ncfgShapePicker=Shape Picker (JSON)\ncfgShapePickerHelp=Custom shape picker entries for the sidebar\ncfgShareCursorPosition=Share Cursor Position\ncfgShareCursorPositionHelp=Share cursor in real-time collaboration\ncfgShowConnectHandle=Show Connect Handle\ncfgShowConnectHandleHelp=Show connection handle on hover\ncfgShowLinkIcons=Show Link Icons\ncfgShowLinkIconsHelp=Show link icons on shapes\ncfgShowNoteIcons=Show Note Icons\ncfgShowNoteIconsHelp=Show note icons on shapes\ncfgShowRemoteCursors=Show Remote Cursors\ncfgShowRemoteCursorsHelp=Display other users\' cursors\ncfgShowSplashOnStart=Show Splash on Start\ncfgShowSplashOnStartHelp=Show the splash screen with storage options on startup\ncfgShowTooltipIcons=Show Tooltip Icons\ncfgShowTooltipIconsHelp=Show tooltip icons on shapes\ncfgSidebarTitleSize=Title Font Size (pt)\ncfgSidebarTitles=Sidebar Titles\ncfgSidebarTitlesHelp=Show titles in the sidebar\ncfgSidebarWidth=Sidebar Width\ncfgSimpleLabels=Simple Labels\ncfgSimpleLabelsHelp=Disable word wrap and HTML for labels\ncfgSimpleViewer=Simple Viewer\ncfgSimpleViewerHelp=Use simple viewer for all diagrams\ncfgStopEditingOnEnter=Stop Editing on Enter\ncfgStopEditingOnEnterHelp=Enter key stops label editing, Shift+Enter inserts a line break\ncfgStyles=Styles (JSON)\ncfgStylesHelp=Colours for the Style tab. Keys: commonStyle, vertexStyle, edgeStyle, graph.\ncfgSwimlaneSelectionEnabled=Swimlane Body Selection\ncfgSwimlaneSelectionEnabledHelp=Click an empty swimlane body to select the swimlane (default on)\ncfgTemplateFile=Template File URL\ncfgTemplateFileHelp=Sections shown in the template dialog. Leave empty for all.\ncfgThumbHeight=Thumbnail Height\ncfgThumbWidth=Thumbnail Width\ncfgTooltipFontSize=Tooltip Font Size (px)\ncfgTooltipMaxWidth=Tooltip Max Width (px)\ncfgTranslateDiagrams=Translate Diagrams\ncfgTranslateDiagramsHelp=Enable automatic translation of diagram labels\ncfgUi=UI Theme\ncfgUpdateDefaultStyle=Update Default Style\ncfgUpdateDefaultStyleHelp=Update defaults when styles change\ncfgUseInternalClipboard=Use Internal Clipboard\ncfgUseInternalClipboardHelp=Use internal clipboard instead of native\ncfgVersion=Version\ncfgVersionHelp=Configuration version identifier\ncfgViewerCanExceedPageWidth=Viewer Can Exceed Page Width\ncfgViewerCanExceedPageWidthHelp=Allow the viewer to exceed the page width\ncfgViewerTimeout=Viewer Timeout\ncfgZoomFactor=Zoom Factor\ncfgZoomWheel=Zoom with Mouse Wheel\ncfgZoomWheelHelp=Use mouse wheel for zoom without modifiers\ncfgEnabled=Enabled\npartialResponse=Partial response\nactor=Actor\ncallout=Callout\ncard=Card\ncloud=Cloud\ncross=Cross\ncube=Cube\ncylinder=Cylinder\ndelay=Delay\ndisplay=Display\ndocument=Document\nhexagon=Hexagon\nparallelogram=Parallelogram\npentagon=Pentagon\nprocess=Process\nsquare=Square\nstar=Star\nstep=Step\ntape=Tape\ntrapezoid=Trapezoid\ntriangle=Triangle\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;
+DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,p,t){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=p;this.locale=t};mxResources.parse('about=About\naiFreeModelHint=Start a new chat or shorten your message to send more.\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add Account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nalignCellsLeft=Align Left\nalignCellsCenter=Align Center\nalignCellsRight=Align Right\nalignCellsTop=Align Top\nalignCellsMiddle=Align Middle\nalignCellsBottom=Align Bottom\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSelectedObjectsInThisLayer=All selected objects are in this layer\nallSpaces=All Spaces\nallTags=All Tags\nandNMore=and {1} more\nanchor=Anchor\nandroid=Android\nangle=Angle\nallCells=All cells\nanimations=Flow Animations\ncell=cell\ncells=cells\nexcluded=Excluded\nexcludeSelection=Exclude selected cells\nlayer=Layer\nselectLayers=Select layers\ntransition=Transition\nmatch=Match\nmatchAll=All\nmatchAllHint=Match cells that have every selected tag (AND)\nmatchAny=Any\nmatchAnyHint=Match cells that have at least one selected tag (OR)\nduration=Duration (ms)\nfadeIn=Fade In\nfadeOut=Fade Out\nfadeTo=Fade To\nflow=Flow\nflowOff=Flow Off\nflowOn=Flow On\nhighlight=Highlight\nnoTagsInDiagram=No tags in this diagram yet.\noptional=optional\npopIn=Pop In\npopOut=Pop Out\nreorder=Drag to reorder\nreset=Reset\nscroll=Scroll To\nselectByTags=Select by tags\nselectCellsInDiagram=Select cells in diagram\ntag=Tag\nsetOpacity=Set Opacity\ntiming=Timing\ntoggle=Toggle\ntoggleStyle=Toggle Style\nuseSelection=Use selected cells\nvisibilityActions=Visibility\nwait=Wait\nwipeIn=Wipe In\nwipeOut=Wipe Out\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narea=Area\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosizeText=Automatic Font Size\nautosize=Autosize\nattach=Attach\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change User\nchangeStorage=Change Storage\nchangesNotSaved=Changes have not been saved\ncharactersRemaining={1} characters remaining\nclassDiagram=Class Diagram\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nclickToAdd=Click on canvas to add points\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ncurrentLayer=Current Layer\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram Type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndictate=Dictate\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclipboard=Clipboard\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseAll=Collapse All\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnectable=Connectable\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyDiagramToClipboard=Copy Diagram to Clipboard\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySelectionToClipboard=Copy Selection to Clipboard\ncopySize=Copy Size\ncopyStyle=Copy Style\ncopyTextStyle=Copy Text Style\ncreate=Create\ncreateDiagram=Create Diagram\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current Page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide Later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete All\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\nremoveLibraryConfirm=You are about to remove this library for everyone. Only an administrator can recover it. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndistributeHorizontal=Distribute Horizontally\ndistributeVertical=Distribute Vertically\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditor=Editor\neditPolygon=Edit Polygon\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditNote=Edit Note\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\neffects=Effects\nembed=Embed\nembedCellMetadata=Cell Metadata\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexpandAll=Expand All\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfindInDiagram=Find in Diagram\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTextToShape=Fit Text to Shape\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nforceDirected=Force-directed\nformat=Format\nformatAnimatedGif=Animated GIF\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatJson=JSON\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatVsdx=VSDX\nformatWebp=WebP\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngDriveAppFilesOnly=Only files created or opened with draw.io in Google Drive are listed. To add another file, open it once at app.diagrams.net.\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\ngroupPadding=Group Padding\nguides=Guides\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nshiftClickShowOnly=Shift+click: show only {1}\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nicons=Icons\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageClicked=Image copied to clipboard\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimmediate=Immediate\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninherit=Inherit\ninitialPage=Initial Page\ninitialView=Initial View\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertDiagramFromClipboard=Insert Diagram from Clipboard\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\ninvertSelection=Invert Selection\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlabelPadding=Label Padding\nlabelWidth=Label Width\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlibavoidAutoRoute=Auto-route around shapes\nlibavoidUnavailable=Orthogonal routing is not available in this browser.\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line Jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkIcons=Link Icons\nlinkText=Link Text\ntooltipIcons=Tooltip Icons\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to Right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nlightboxAnimationHint=Plays automatically when the page is shown in lightbox mode.\nline=Line\nlineend=Line End\nlineheight=Line Height\nlinestart=Line Start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlock=Lock\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloop=Loop\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmethod=Method\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move Selection to {1}\nmultipleValues=Multiple values\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewChat=New Chat\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoAnimationsInDiagram=No animations found in diagram\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoStepsYet=No steps yet. Add the first step below.\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotes=Notes\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered List\noffline=Offline\naddToLibrary=Add to Library\nanimation=Animation\nbool=Boolean\ncannotMoveOneDrive=Moving a file between accounts is not supported yet.\ncode=Code\ncolor=Color\ndispName=Display Name\nenum=Enumeration\nenumList=Enum List\nfast=Fast\nfloat=Float\nforever=Forever\nint=Int\ninvalid=invalid\nloops=Loops\nmedium=Medium\nslow=Slow\nspeed=Speed\nstring=String\nmanage=Manage\nofflineLanguages=Languages available offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenRepairedCopy=Open repaired copy\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\northogonalRouting=Orthogonal Routing\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste Here\npasteResponse=Paste Response\npasteSize=Paste Size\npasteStyle=Paste Style\npasteTextStyle=Paste Text Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplantUmlWarnings=PlantUML warnings\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\npolygon=Polygon\nportrait=Portrait\npoint=Point\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Process Engineering\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\npromptOnly=Prompt Only\npromptTooLarge=Only {1} characters allowed in the free version using the draw.io model\npromptWithDiagram=Prompt with Diagram\npromptWithSelection=Prompt with Selection\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nretry=Retry\nrememberMe=Remember Me\nrememberThisSetting=Remember This Setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace Existing Drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoreBackupCopy=Open backup as copy\nrecover=Recover…\nrecoverTitle=Recover file\nrecoverVersionFrom=Version from {1}\nrecoverPreviousVersion=Previous version\nrecoveryVersionDesc=A previously saved version. Complete, but any changes made since then are not included.\nrecoveryRepairedDesc=The current file with a best-effort repair. Recent, but content after the damaged point may be missing.\nrecoveryWarning=This is a best-effort recovery and may be missing content. It will open as a new unsaved copy and your original file is not changed. Continue?\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to Left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nrunLastLayout=Run Last Layout\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchImages=Search Images\nsearchShapes=Search Shapes\nsearchShapesInOpenLibraries=Search Shapes in Open Libraries\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshadows=Shadows\nshape=Shape\nshapeDeleted=Shape deleted\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsortPages=Sort Pages\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start Drawing\nstopDrawing=Stop Drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstress=Stress\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page, then click "Open with draw.io" button in the top right corner.\nturn=Rotate Shape Only by 90°\ntype=Type\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateDiagramFromClipboard=Update diagram from clipboard\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating document. Please wait...\nupdatingPreview=Updating preview. Please wait...\nupdatingSelection=Updating selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use Black and White\nuseCurrent=Use Current\nuseCurrentSettings=Use Current Settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently Used\nlistView=List View\ngridView=Grid View\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\nmentionNoNotify=People you mention are not notified\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft read error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft write error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nreindexInst3=Indexing pauses while the computer is asleep or offline and resumes when the connection returns, so keep the computer awake until "Re-indexing finished" is shown.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving failed (unexpected error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload failed (unexpected error)\nhiResPreview=High Resolution Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfADraftUpdated=Updated the draft of diagram: "{1}"\nconfADraftUpdateFailed=Updating the draft of diagram "{1}" failed\nconfADraftRemoved=Removed the draft of diagram: "{1}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\ncopyAsSvg=Copy as SVG\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by Spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a File...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the Viewer (px)\nheightOfViewer=Height of the Viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit Owning Page\ndeepIndexing=Deep Indexing (including diagrams that aren\'t used in any page)\nconfADeepIndexStarted=Deep indexing started\nconfADeepIndexDone=Deep indexing done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last Modified on\nsearchResults=Search Results\nshowAllTemps=Show All Templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for Updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell Checker\nnoChange=No Change\nlblToSvg=Convert Labels to SVG\nautoRotateLabel=Rotate with Edge\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft Save Interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow All\nnoTeams=No teams found\nerrorLoadingTeams=Error loading teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA404AttErrFaq=There are ({1}) 404 "File not found" error(s). The diagram file (an attachment of the page) does not exist. If it exists on the same page in the source site, the migration did not copy it, so copy the attachment manually or re-migrate the attachments. If it is missing in the source site also, the diagram was deleted before the migration.\nconfA404NoEditErrFaq=There are ({1}) 404 "Cannot find a page" error(s) for pages that were fetched successfully. These pages exist but could not be updated, this usually means the current user has no edit permission on them (page restrictions) or they are archived. Re-run the process with a user that can edit these pages.\nconfA404FileStoreErrFaq=There are ({1}) 404 error(s) from Confluence file storage. The diagram attachment is listed on the page, but its file cannot be downloaded, so nothing here can read or repair the diagram. Open one of these pages in Confluence and download the attachment: if that fails too, the file itself is not in this site. After a site copy or restore this means the attachment files were not copied with their pages, which has to be fixed on the Confluence side before running this again.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAPageNoEditPerm=The page exists but could not be updated, this usually means the current user has no edit permission on it or the page is archived.\nconfAMacroInComment=draw.io macros inside page comments are not converted, skipped comment "{1}" (id {2})\nconfAReplaceBaseUrl=Replace base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate diagram detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for Production Use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have the "Attachment Checker for Confluence" app, enable "Always allow draw.io attachments" in its File Type Blocking settings. Update the app if that option is missing.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache Page IDs Mapping\nconfARemImpPages=Remember Imported Pages\nconfAGMTitle=Gliffy migration\nconfAGMStoredState=Stored state & reports\nconfAGMTabDryRun=Dry run\nconfAGMTabImport=Import\nconfAGMReadOnly=Read-only\nconfAGMWrites=Writes to pages\nconfAGMLoading=Loading migration state...\nconfAGMLoadFailed=Loading the migration state failed. Reload the page to try again.\nconfAGMStepScan=Scan & scope\nconfAGMStepDryRun=Dry run\nconfAGMStepReview=Review & report\nconfAGMScanTitle=Where your Gliffy diagrams live\nconfAGMScanSub=Scanning reads pages and counts Gliffy macros - it never modifies anything. Scans checkpoint as they go and resume if interrupted. Results are cached: rescanning is manual.\nconfAGMScanSite=Scan site\nconfAGMScanning=Scanning...\nconfAGMResumeScan=Resume scan\nconfAGMRescan=Rescan site\nconfAGMRescanConfirm=Rescan the site? The inventory is rebuilt; dry-run results and review verdicts are kept and re-matched by diagram.\nconfAGMScanMetaDone=Last scan finished {1} after {2} - {3} spaces contain Gliffy - {4} pages - {5} diagrams\nconfAGMScanMetaPaused=Scan paused - resumes from its checkpoint\nconfAGMScanMetaNone=Not scanned yet - scan to build the space inventory\nconfAGMPause=Pause\nconfAGMSearchSpaces=Search spaces by name or key...\nconfAGMSelectAll=Select all {1} with diagrams\nconfAGMSelectLive=All except archived ({1})\nconfAGMClear=Clear\nconfAGMShowArchived=Show archived\nconfAGMArchived=archived\nconfAGMSpace=Space\nconfAGMKey=Key\nconfAGMPages=Pages\nconfAGMDiagrams=Diagrams\nconfAGMNotImportable=Not importable\nconfAGMNoSpaces=No spaces yet - run a scan to build the inventory.\nconfAGMSpaceFoot=Showing {1} of {2} spaces, largest first.\nconfAGMSpaceFootMore=Showing the largest {1} of {2} matching spaces - search to narrow.\nconfAGMScope=Scope\nconfAGMScopeTotals={1} spaces - {2} diagrams - {3} pages\nconfAGMStartDryRunArrow=Start dry run →\nconfAGMDryTitle=Dry run - converts locally, changes nothing\nconfAGMDrySub=Every diagram in scope is downloaded and converted in this browser, and every affected page gets a permission check. Nothing is written to Confluence; diagram data never leaves this machine. Safe to close the tab - the run resumes from its last checkpoint.\nconfAGMDryNone=No dry run yet\nconfAGMDryRunning=Dry run in progress\nconfAGMDryPaused=Dry run paused\nconfAGMDryDone=Dry run complete - nothing was changed\nconfAGMInterrupted=interrupted\nconfAGMDone=done\nconfAGMStarted=Started {1}\nconfAGMFinished=finished {1}\nconfAGMStartDry=Start dry run\nconfAGMRerunDry=Run dry run again\nconfAGMResumeCheckpoint=Resume from checkpoint\nconfAGMSafeClose=Safe to close this tab at any time.\nconfAGMGenReport=Generate report\nconfAGMOfProcessed=of {1} processed\nconfAGMConvClean=converted clean\nconfAGMConvWarn=converter warnings\nconfAGMStalePins=version pin warnings\nconfAGMStalePin=The Gliffy macro pins version {1} but the latest is {2} - version pinning is off, so the latest was used; verify the conversion matches what the page displayed\nconfAGMPinnedOld=Imported the pinned version {1}; the latest is {2} - verify this is the version the page really displayed\nconfAGMPinFellBack=The pinned version {1} was not found - the latest ({2}) was used instead\nconfAGMPinResetNotice=draw.io update: Gliffy version pin handling changed - pins are now off by default (cloud Gliffy displays the latest version) and every pin that differs from the latest is flagged for review. The previous dry run used the old rules, so run a fresh dry run.\nconfAGMVersionPinning=Import the Gliffy version pinned in each macro instead of the latest (rarely needed - e.g. content migrated from Confluence Data Center)\nconfAGMPinToggleConfirm=Changing version pinning re-keys every diagram: the current dry run, review verdicts and import state will be discarded, and a fresh dry run is needed. Continue?\nconfAGMAlreadyImp=previously imported\nconfAGMFailed=failed\nconfAGMWriteBlocked=write-blocked\nconfAGMLeft=left\nconfAGMProblems=Problems so far - grouped, full detail in the stored files\nconfAGMNoPageEdit=no page edit\nconfAGMBlockedRow={1} pages ({2} diagrams) this user cannot edit - fix permissions or leave them Gliffy\nconfAGMReasonDraft=Gliffy draft stored on gliffy.com - no attachment to convert\nconfAGMReasonAttMissing=Diagram attachment no longer exists\nconfAGMReasonTooLarge=Exceeds converter limits\nconfAGMReasonConvert=Conversion failed\nconfAGMReasonFetch=Downloading the diagram failed\nconfAGMReasonSave=Saving failed\nconfAGMReasonAttInfo=Attachment lookup failed\nconfAGMReasonOther=Other error\nconfAGMNoEditPerm=No permission to edit "{1}" - its diagrams cannot be imported by this user\nconfAGMDiagConverted=Converted {2} diagram "{1}" (dry run, nothing written)\nconfAGMReviewTitle=Review a sample against the Gliffy previews\nconfAGMReviewSub=Left: the preview image Gliffy stored. Right: a live render of the draw.io conversion - what the page will show after import. Rate with the keyboard; verdicts are saved continuously and feed the report and the import.\nconfAGMReviewNeedsDry=Finish a dry run first - the review works on its results.\nconfAGMSample=Sample\nconfAGMSampleNote=of {1} converted - flagged first, then random across spaces\nconfAGMCustomPct=Custom %\nconfAGMApply=Apply\nconfAGMFilterSample=Sample\nconfAGMFilterUnreviewed=Unreviewed\nconfAGMFilterFlagged=Flagged\nconfAGMFilterFailed=Failed\nconfAGMSideBySide=Side by side\nconfAGMLiveRender=live render of conversion\nconfAGMStoredPreview=stored preview image\nconfAGMNoPreview=No preview image stored by Gliffy - compare against the diagram on its page.\nconfAGMGliffyPreviewAlt=Gliffy preview\nconfAGMNoDrawio=No draw.io version to show.\nconfAGMPreviewFailed=Rendering the conversion failed.\nconfAGMNotConverted=not converted\nconfAGMFailedReason=Not converted ({1}). See the problems list and the report.\nconfAGMFlickHint=A/B - press X or click to flip\nconfAGMConverterWarning=converter warning\nconfAGMNothingHere=Nothing to review in this filter\nconfAGMMatch=Match\nconfAGMMinor=Minor differences\nconfAGMMajor=Major differences\nconfAGMMatchL=match\nconfAGMMinorL=minor\nconfAGMMajorL=major\nconfAGMLeftInSample=left in sample\nconfAGMOfReviewed=of {1} reviewed\nconfAGMNotePlaceholder=Optional note - included in the report\nconfAGMPrivacy=The report contains ratings, notes, diagram names and converter warnings - never diagram contents. Diagram names are only sent to draw.io if you opt in below.\nconfAGMSendNamesOptIn=Include diagram names\nconfAGMSendReport=Send report to draw.io\nconfAGMSendConfirm=Send the migration report summary to draw.io? It contains counts, failure reasons and review verdicts.\nconfAGMSendDone=Report sent to draw.io. Reference: {1} - please quote it when contacting support.\nconfAGMGenerating=Generating report...\nconfAGMReportSaved=Report saved as {1} with the migration state.\nconfAGMOpenState=Open\nconfAGMReportFailed=Generating the report failed.\nconfAGMImpTitle=Import - writes to pages\nconfAGMImpSub=Consumes the latest dry run: scope, permission checks and review verdicts. Gliffy macros are replaced with draw.io macros and a .drawio attachment is added per diagram. Nothing is deleted - Gliffy attachments stay in place and every page edit is a normal Confluence version, so reverting a page restores its Gliffy macros.\nconfAGMImpNeedsDry=Import is disabled until a dry run has completed. Run it from the Dry run tab - it changes nothing.\nconfAGMImpReady={1} diagrams ready\nconfAGMImpSkipFail={1} failed conversions will be skipped and listed\nconfAGMImpBlocked={1} diagrams on {2} blocked pages stay Gliffy until permissions are fixed\nconfAGMImpAll=Import everything that converted\nconfAGMImpAllD=Review verdicts ride along in the log for follow-up\nconfAGMImpHold=Hold back "Major differences"\nconfAGMImpHoldN=Hold back "Major differences" ({1} rated)\nconfAGMImpHoldD=Diagrams rated Major in review stay Gliffy for a later pass\nconfAGMAdvanced=Advanced (defaults are right for almost everyone)\nconfAGMAddLabel=Add a label to every modified page (for CQL follow-up)\nconfAGMCheckDrift=Check for changes since dry run\nconfAGMDriftChecking=Checking pages for changes since the dry run...\nconfAGMDriftResult={1} pages changed and {2} gone since the dry run (checked {3}). Changed pages are re-verified during import.\nconfAGMDriftRecommend=More than 10% drift - running a fresh dry run first is recommended.\nconfAGMDriftUnknown=The dry run is {1} days old. Check for changes before importing.\nconfAGMImpNone=Not started\nconfAGMImpRunning=Import in progress\nconfAGMImpPaused=Import paused\nconfAGMImpDone=Import finished\nconfAGMStartImport=Start import - {1} diagrams\nconfAGMImpConfirm=Start the import? Up to {1} diagrams across {2} pages will be converted to draw.io macros. Nothing is deleted and every page edit is a normal Confluence version.\nconfAGMOfPages=of {1} pages\nconfAGMImported=diagrams imported\nconfAGMSkipped=skipped\nconfAGMErrors=errors\nconfAGMHeldBack=Held back "{1}" (rated Major differences in review)\nconfAGMSkippedFailed=Skipped "{1}" (failed in the dry run: {2})\nconfAGMPageBlocked=Skipped page "{1}" (no edit permission)\nconfAGMReimportPass=Processing pages labeled for re-import...\nconfAGMReassure=Interruptions resume from the last checkpoint - already-imported diagrams are never redone. The import log is stored with the migration state and downloadable.\nconfAGMImpSummary=Import finished {1}: {2} diagrams imported across {3} pages.\nconfAGMImpSummary2={1} held back - {2} skipped (failed) - {3} blocked - {4} errors.\nconfAGMImpSummary3=The run log and report are stored with the migration state.\nconfAGMRunAnother=Run another import\nconfAGMImpReportSaved=Run report saved as {1} with the migration state.\nconfAGMHttpFaq={1} requests failed with 403/404. These are usually permission problems - the API also returns 404 for content the user cannot read. See\nconfAGMFullscreen=Fullscreen\nconfAGMClose=Close\nconfAGMStatePageDesc=State and reports of the Gliffy to draw.io migration. Managed by the draw.io app; do not edit the attachments manually.\nconfABrokenDiagLnk=Broken diagram link (custom content) "{1}"\nconfACCDupEntry=duplicate entry\nconfACCInvalid=invalid content\nconfACCWrongPage=it records a different page than the one it is stored on, run the page IDs import to update it\nconfACCAttMissing=attachment is missing or has an older version\nconfAChkTabTitle=Integrity Check (Beta)\nconfAChkTitle=draw.io Diagrams Integrity Check\nconfAChkInst1=Scans all pages with draw.io macros and checks that every diagram has its attachment, preview image and diagram link (custom content) with the versions the macro points to. It also reports broken, duplicate and unused diagram links.\nconfAChkInst2=The check is read-only and changes nothing. It can take some time and the browser window must remain open until it finishes.\nconfAChkDownloadOpt=Download each diagram and verify its content instead of only checking it exists (slower, detects corrupted files)\nconfAChkStart=Start Integrity Check\nconfAChkStatChecked=Diagrams checked\nconfAChkStatOk=OK\nconfAChkStatBroken=Broken\nconfAChkStatWarn=With warnings\nconfAChkStatCC=Broken diagram links\nconfAChkStatOrphans=Unused embed links\nconfAChkLog=Log\nconfAChkFilterAll=All\nconfAChkFilterIssues=Issues only\nconfAChkProgLinks=Checking diagram links ({1} of {2})\nconfAChkProgPages=Checking pages with {3} macros ({1} of {2})\nconfAChkEta=~{1} remaining\nconfAChkEstimating=estimating…\nconfAChkDiag=Checking diagram "{1}"\nconfAChkDiagOK=Diagram "{1}" is OK\nconfAChkMacroNoName=Found a diagram macro without a diagram name (possibly a never-edited macro)\nconfAChkPageInfoBroken=Diagram "{1}": the page referenced by the macro (by space and title) cannot be resolved\nconfAChkCCMissing=Diagram "{1}": its diagram link (custom content) is missing or broken (the diagram works, but is excluded from search and diagram listings)\nconfAChkCCBroken=Diagram "{1}": its diagram link (custom content) is missing or broken, so the diagram is excluded from search and diagram listings. A broken link by itself does not stop the diagram rendering.\nconfAChkCCNoRef=Diagram "{1}": the macro has no diagram link (custom content) reference\nconfAChkCCOther=Diagram "{1}": the macro references a missing diagram link (custom content), but a valid one exists for this diagram\nconfAChkCCMismatch=Diagram "{1}": its diagram link (custom content) does not match the macro (page, name, or version)\nconfAChkDiagPageMissing=Diagram "{1}": the page ({2}) that holds the diagram attachment is not found\nconfAChkAttMissing=Diagram "{1}": the diagram attachment is not found\nconfAChkAttOldVer=Diagram "{1}": the diagram attachment version ({2}) is older than the version in the macro ({3})\nconfAChkAttFetchFailed=Diagram "{1}": fetching the attachments of page ({2}) failed\nconfAChkPrevMissing=Diagram "{1}": the preview image ({2}) is not found\nconfAChkPrevOldVer=Diagram "{1}": the preview image version ({2}) is older than the version in the macro ({3})\nconfAChkPrevOutOfSync=Diagram "{1}": the preview image (of diagram version {2}) is out of sync with the diagram (version {3})\nconfAChkPrevPageFailed=Diagram "{1}": fetching the attachments of the preview image page ({2}) failed\nconfAChkDiagInvalid=Diagram "{1}": the diagram content is not a valid draw.io file\nconfAChkDiagDownFailed=Diagram "{1}": downloading the diagram failed\nconfAChkEmbedCC=Checking embedded diagram links (custom contents)...\nconfAChkOrphanEmbedCC=Embedded diagram link (custom content) "{1}" is not referenced by any macro\nconfAChkSummary=Integrity check finished: {1} macros checked, {2} OK, {3} broken, {4} with warnings. Diagram links (custom contents): {5} broken, {6} unused embedded diagram links\nconfAChkSummaryNoDownload=The diagram files themselves were not read. Each diagram was only checked to be listed on its page at a new enough version, so one whose file cannot be downloaded is counted as OK above. Run again with "Download each diagram and verify its content" to check the files.\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluence app)\nm365=Microsoft 365\nnodeSpacing=Node Spacing\nrankSpacing=Rank Spacing\npolyline=Polyline\nlayeringStrategy=Layering Strategy\nnetworkSimplex=Network Simplex\nlongestPath=Longest Path\ncoffmanGraham=Coffman-Graham\nweighting=Weighting\nmodelOrder=Model Order\ndescendants=Descendants\nconstraint=Constraint\nfan=Fan\noptimization=Optimization\nedgeLength=Edge Length\nedgeLengthByPosition=Edge Length by Position\ncrossingMinimization=Crossing Minimization\niterations=Iterations\nrepulsivePower=Repulsive Power\nresizeNodes=Resize Nodes\nuseSelectionAsRoot=Use Selection as Root\nuseSelectionAsRoots=Use Selection as Roots\nanonymize=Anonymize\nconnector=Connector\nextractText=Extract Text\nlegacyLayouts=Legacy Layouts\nedgeStyle=Edge Style\ncorners=Corners\nkeepStyle=Keep Existing Style\nopenLucidSite=Open Lucidchart Site in another tab and login to your account, then come back to this tab and click the "Start Import" button again.\npreviewSaveNoPermission=You do not have permission to save the preview image. The source page may be restricted or you may not have edit permission on the page. This only affects this page export to PDF/Word.\npreserveOrigin=Preserve Origin\nsharedStems=Bundle Outgoing Connections\ndraftLoadedWUnpublishedChanges=The diagram has loaded from a draft with unpublished changes. It is different from the published version.\nhachure=Hachure\nhatch=Hatch\ndots=Dots\ncrossHatch=Cross Hatch\nzigzag=ZigZag\nzigzagLine=ZigZag Line\nsysFonts=System Fonts\nwebfonts=Web Fonts\nfontname=Font Name\nfontUrl=Font URL\ncreatingDiagram=Generating diagram. Please wait\nconfAFixPageStorage=Remove invalid page storage format elements (Warning: May cause data loss)\ncfgAiActions=AI Actions (JSON)\ncfgAiConfigs=AI Configs (JSON)\ncfgAiGlobals=AI Globals (JSON)\ncfgAiModels=AI Models (JSON)\ncfgAppendCustomLibraries=Append Custom Libraries\ncfgAppendCustomLibrariesHelp=Custom libraries appear after built-in ones\ncfgAutoCropViewer=Auto Crop Viewer\ncfgAutoCropViewerHelp=Auto-crop viewer to fit diagram bounds\ncfgAutosaveDelay=Autosave Delay (ms)\ncfgBrowserTranslate=Browser Translate\ncfgBrowserTranslateHelp=Mirror diagram text for browser translation engines (e.g. Chrome Translate)\ncfgClaudeApiKey=Claude API Key\ncfgColorNames=Color Names (JSON)\ncfgColorNamesHelp=Map of colour codes to display names (tooltips)\ncfgCompact=Compact UI\ncfgCompactHelp=Enable compact user interface mode\ncfgCompressStyles=Compress Styles\ncfgCompressStylesHelp=Deduplicate repeated inline images and stencils into a shared lookup table. Only readable by draw.io 29.3.1 and later.\ncfgCompressXml=Compress XML\ncfgCompressXmlHelp=Compress XML output in saved files\ncfgCopyOnConnect=Copy on Connect\ncfgCopyOnConnectHelp=Create a copy of the source shape for connections that end on the canvas\ncfgCss=CSS Rules\ncfgCssHelp=CSS rules to customize the draw.io user interface\ncfgCustomCss=Custom CSS (alternative)\ncfgCustomCssHelp=Injected as a separate style element\ncfgCustomTemplates=Custom Templates (JSON)\ncfgCustomTemplatesHelp=Templates added to the sections of the template dialog\ncfgDarkColor=Dark Mode Background\ncfgDarkColorVar=Dark Color CSS Variable\ncfgDebug=Debug\ncfgDebugHelp=Enable debug output\ncfgDefaultAdaptiveColors=Adaptive Colors\ncfgDefaultConnectable=Default Connectable\ncfgDefaultConnectableHelp=Shapes are connectable by default\ncfgDefaultConnectionArrowsEnabled=Connection Arrows\ncfgDefaultConnectionArrowsEnabledHelp=Show arrows when hovering connections\ncfgDefaultDarkGridColor=Default Grid Color (Dark Mode)\ncfgDefaultDarkPageBackgroundColor=Default Page Background (Dark Mode)\ncfgDefaultEdgeLength=Default Edge Length\ncfgDefaultFileType=Default File Type\ncfgDefaultFoldingEnabled=Folding Enabled\ncfgDefaultFoldingEnabledHelp=Enable shape folding (collapse/expand)\ncfgDefaultGridColor=Default Grid Color\ncfgDefaultGridEnabled=Grid Enabled\ncfgDefaultGridEnabledHelp=Show grid on canvas\ncfgDefaultGridSize=Default Grid Size\ncfgDefaultLanguages=Default Languages\ncfgDefaultLanguagesHelp=Language bundles installed for offline use on startup\ncfgDefaultLibraries=Default Libraries\ncfgDefaultLibrariesHelp=Semicolon-separated library keys shown in sidebar on startup\ncfgDefaultPageBackgroundColor=Default Page Background\ncfgDefaultPageVisible=Page Visible\ncfgDefaultPageVisibleHelp=Show page outline on canvas\ncfgDefaultTextStyle=Default Text Style\ncfgDefaultTransparentGroups=Automatic Group Size\ncfgDefaultTransparentGroupsHelp=New groups automatically resize to fit their children (transparentBounds=1)\ncfgDesktopAutoSync=Desktop Auto Sync\ncfgDesktopAutoSyncHelp=Auto-sync when local file changes\ncfgDisableVersioning=Disable Versioning\ncfgDisableVersioningHelp=Disable diagram versioning\ncfgEmbedSvgFonts=Embed SVG Fonts\ncfgEmbedSvgFontsHelp=Default for embedding fonts as data URIs in exported and saved SVG files, can be overridden per file in the file properties\ncfgEmptyDiagramXml=Empty Diagram XML\ncfgEmptyLibraryXml=Empty Library XML\ncfgEnableAi=Enable AI\ncfgEnableAiHelp=Enable AI diagram generation\ncfgEnableAnimations=Enable Animations\ncfgEnableAnimationsHelp=Enable shape and layout animations\ncfgEnableCssDarkMode=CSS Dark Mode\ncfgEnableCssDarkMode2=CSS Dark Mode\ncfgEnableCssDarkMode2Help=Enable CSS-based dark mode for viewer diagrams\ncfgEnableCssDarkModeHelp=Use CSS for dark mode rendering\ncfgEnableCustomGitLabUrl=Enable Custom GitLab URL\ncfgEnableCustomGitLabUrlHelp=Allow ?gitlab= / ?gitlab-id= URL parameters to override the default GitLab server. Enable only for self-hosted GitLab deployments.\ncfgEnableCustomLibraries=Enable Custom Libraries\ncfgEnableCustomLibrariesHelp=Allow open and new library functions\ncfgEnableDistanceGuides=Distance Guides\ncfgEnableDistanceGuidesHelp=Snap shapes to equal distances between the surrounding shapes while moving (default on)\ncfgEnableExportUrl=Enable Export URL\ncfgEnableExportUrlHelp=Enable the export URL feature\ncfgEnableInlineToolbar=Inline Toolbar\ncfgEnableInlineToolbarHelp=Enable the inline toolbar on selection\ncfgEnableLightDarkColors=Light/Dark Colors\ncfgEnableLightDarkColorsHelp=Use CSS light-dark() color function\ncfgEnableLocalFonts=Local Fonts\ncfgEnableLocalFontsHelp=Scan and list locally installed fonts in the font picker\ncfgEnableNativeClipboard=Native Clipboard\ncfgEnableNativeClipboardHelp=Use native system clipboard\ncfgEnablePositionGuides=Position Guides\ncfgEnablePositionGuidesHelp=Snap shapes to the edges and centers of the other shapes while moving (default on)\ncfgEnableSizeGuides=Size Guides\ncfgEnableSizeGuidesHelp=Snap the size of a shape to the sizes of the other shapes while resizing (default on)\ncfgEnableWindowDocking=Window Docking\ncfgEnableWindowDockingHelp=Enable window docking\ncfgExpandLibraries=Expand Libraries\ncfgExpandLibrariesHelp=Libraries expanded by default\ncfgExpandPatternsForPrint=Expand Patterns for Print\ncfgExpandPatternsForPrintHelp=Expand patterns to visible graphics during print/PDF export\ncfgExperimental=Experimental feature\ncfgFitDiagramOnLoad=Fit Diagram on Load\ncfgFitDiagramOnLoadHelp=Fit diagram to window on load\ncfgFitDiagramOnPage=Fit Diagram on Page\ncfgFitDiagramOnPageHelp=Fit diagram to page size\ncfgFoldingIconSize=Folding Icon Size\ncfgFontCss=Font CSS (@font-face rules)\ncfgFontCssHelp=Added before preset colors in the colour dialog\ncfgForceSimpleViewer=Force Simple Viewer\ncfgForceSimpleViewerHelp=Force simple viewer for all diagrams\ncfgForeignObjectImages=Foreign Object Images\ncfgForeignObjectImagesHelp=Replace foreignObject with images\ncfgGeminiApiKey=Gemini API Key\ncfgGenerateSVGs=Generate SVGs\ncfgGenerateSVGsHelp=Generate SVG previews for diagrams\ncfgGlobalVars=Global Variables (JSON)\ncfgGlobalVarsHelp=Global placeholders available in all diagrams\ncfgGptApiKey=OpenAI API Key\ncfgGptUrl=Custom GPT URL\ncfgGridSteps=Grid Steps\ncfgHiResPreview=Hi-Res Preview\ncfgHiResPreviewHelp=Generate high-resolution preview images\ncfgIncludeDiagram=Include Diagram in Export\ncfgIncludeDiagramHelp=Include diagram data in export dialogs\ncfgInlineExtIcons=Inline Icon Search Results\ncfgInlineExtIconsHelp=Insert icon search results as embedded images instead of remote references\ncfgInplaceEdits=In-place Edits\ncfgInplaceEdits2=In-place Edits\ncfgInplaceEdits2Help=Allow launching editor from viewer\ncfgInplaceEditsHelp=Allow launching the editor from the viewer\ncfgInsertAnimations=Insert Animations\ncfgInsertAnimationsHelp=Show pop animation when inserting shapes from the sidebar\ncfgIntersectionSelect=Intersection Select\ncfgIntersectionSelectHelp=Select cells by intersection rather than containment\ncfgKeyboardShortcuts=Keyboard Shortcuts (JSON)\ncfgKeyboardShortcutsHelp=Custom keyboard shortcuts. Entries are {keyCode, control, shift, alt, action} where keyCode is a key code or single character and action is an action name, or null to remove a binding.\ncfgLibraries=Libraries (JSON)\ncfgLibrariesHelp=Custom library sections for the left panel\ncfgLockdown=Lockdown\ncfgLockdown2=Lockdown\ncfgLockdown2Help=Disable data transmission outside Confluence\ncfgLockdownHelp=Disable data transmission apart from storage\ncfgMathOutputSize=Math Output Size\ncfgMathOutputSizeHelp=Size labels, view bounds and initial fit to the rendered math output instead of the formula source\ncfgMaxImageBytes=Max Image Bytes\ncfgMaxImageSize=Max Image Size (px)\ncfgMermaid=Mermaid Config (JSON)\ncfgMermaidHelp=Default Mermaid settings such as theme and colours for all diagrams\ncfgNoAutoFocus=No Auto Focus\ncfgNoAutoFocusHelp=Disable auto-focus on startup\ncfgNoResizers=No Resizers\ncfgNoResizersHelp=Hide shape resize handles\ncfgNotSet=Not set (use default)\ncfgOneDriveInlinePicker=OneDrive Inline Picker\ncfgOneDriveInlinePickerHelp=Use inline picker for OneDrive\ncfgOptimizeHtmlLabels=Optimize HTML Labels\ncfgOptimizeHtmlLabelsHelp=Remove unnecessary spans from HTML labels when editing stops\ncfgOverride=Override\ncfgOverrideHelp=Ignore user settings stored in the browser so the defaults in this configuration always apply\ncfgPageFormatHeight=Page Height (1/10 inch)\ncfgPageFormatHeightHelp=Page format: US Letter = 850 x 1100, A4 = 827 x 1169\ncfgPageFormatWidth=Page Width (1/10 inch)\ncfgPassiveScroll=Passive Scroll\ncfgPassiveScrollHelp=Enable passive scroll event listeners\ncfgPasteAtMousePointer=Paste at Mouse\ncfgPasteAtMousePointerHelp=Paste elements at mouse pointer location\ncfgPreserveViewState=Preserve View State\ncfgPreserveViewStateHelp=Preserve view state in embed mode\ncfgRemoveImageMetadata=Remove Image Metadata\ncfgRemoveImageMetadataHelp=Strip metadata from images\ncfgReplaceSvgDataUris=Replace SVG Data URIs\ncfgReplaceSvgDataUrisHelp=Replace data URIs with SVG sub-trees in export\ncfgResources=Language Resources (JSON)\ncfgResourcesHelp=Overrides existing or adds new language resources for user interface text. Maps resource keys to strings, or to objects with one entry per language code and main as the fallback.\ncfgRestrictExport=Restrict Export\ncfgRestrictExportHelp=Disable exporting diagrams to other formats\ncfgSearchSettings=Search settings (e.g. grid, font, dark mode, compressXml...)\ncfgSectionAIConfiguration=AI Configuration\ncfgSectionAppearance=Appearance\ncfgSectionCanvasGrid=Canvas & Grid\ncfgSectionCollaborationAdvanced=Collaboration & Advanced\ncfgSectionColorSchemes=Color Schemes\ncfgSectionColors=Colors\ncfgSectionConfluenceCloud=Confluence Cloud\ncfgSectionConfluenceServerDataCenter=Confluence Server / Data Center\ncfgSectionCustomCSS=Custom CSS\ncfgSectionDefaultStyles=Default Styles\ncfgSectionEmbedding=Embedding\ncfgSectionExportSecurity=Export & Security\ncfgSectionFonts=Fonts\ncfgSectionGeneral=General\ncfgSectionLibraries=Libraries\ncfgSectionMenuCustomization=Menu Customization\ncfgSectionSidebarPanels=Sidebar & Panels\ncfgSelectParentLayer=Select Parent Layer\ncfgSelectParentLayerHelp=Selects parent layer for current selection\ncfgSettingsName=Settings Name\ncfgSettingsNameHelp=Key for storing user settings in local storage\ncfgShadowBlur=Shadow Blur\ncfgShadowColor=Shadow Color\ncfgShadowOffsetX=Shadow Offset X\ncfgShadowOffsetY=Shadow Offset Y\ncfgShadowOpacity=Shadow Opacity\ncfgShapePicker=Shape Picker (JSON)\ncfgShapePickerHelp=Custom shape picker entries for the sidebar\ncfgShareCursorPosition=Share Cursor Position\ncfgShareCursorPositionHelp=Share cursor in real-time collaboration\ncfgShowConnectHandle=Show Connect Handle\ncfgShowConnectHandleHelp=Show connection handle on hover\ncfgShowLinkIcons=Show Link Icons\ncfgShowLinkIconsHelp=Show link icons on shapes\ncfgShowNoteIcons=Show Note Icons\ncfgShowNoteIconsHelp=Show note icons on shapes\ncfgShowRemoteCursors=Show Remote Cursors\ncfgShowRemoteCursorsHelp=Display other users\' cursors\ncfgShowSplashOnStart=Show Splash on Start\ncfgShowSplashOnStartHelp=Show the splash screen with storage options on startup\ncfgShowTooltipIcons=Show Tooltip Icons\ncfgShowTooltipIconsHelp=Show tooltip icons on shapes\ncfgSidebarTitleSize=Title Font Size (pt)\ncfgSidebarTitles=Sidebar Titles\ncfgSidebarTitlesHelp=Show titles in the sidebar\ncfgSidebarWidth=Sidebar Width\ncfgSimpleLabels=Simple Labels\ncfgSimpleLabelsHelp=Disable word wrap and HTML for labels\ncfgSimpleViewer=Simple Viewer\ncfgSimpleViewerHelp=Use simple viewer for all diagrams\ncfgStopEditingOnEnter=Stop Editing on Enter\ncfgStopEditingOnEnterHelp=Enter key stops label editing, Shift+Enter inserts a line break\ncfgStyles=Styles (JSON)\ncfgStylesHelp=Colours for the Style tab. Keys: commonStyle, vertexStyle, edgeStyle, graph.\ncfgSwimlaneSelectionEnabled=Swimlane Body Selection\ncfgSwimlaneSelectionEnabledHelp=Click an empty swimlane body to select the swimlane (default on)\ncfgTemplateFile=Template File URL\ncfgTemplateFileHelp=Sections shown in the template dialog. Leave empty for all.\ncfgThumbHeight=Thumbnail Height\ncfgThumbWidth=Thumbnail Width\ncfgTooltipFontSize=Tooltip Font Size (px)\ncfgTooltipMaxWidth=Tooltip Max Width (px)\ncfgTranslateDiagrams=Translate Diagrams\ncfgTranslateDiagramsHelp=Enable automatic translation of diagram labels\ncfgUi=UI Theme\ncfgUpdateDefaultStyle=Update Default Style\ncfgUpdateDefaultStyleHelp=Update defaults when styles change\ncfgUseInternalClipboard=Use Internal Clipboard\ncfgUseInternalClipboardHelp=Use internal clipboard instead of native\ncfgVersion=Version\ncfgVersionHelp=Configuration version identifier\ncfgViewerCanExceedPageWidth=Viewer Can Exceed Page Width\ncfgViewerCanExceedPageWidthHelp=Allow the viewer to exceed the page width\ncfgViewerTimeout=Viewer Timeout\ncfgZoomFactor=Zoom Factor\ncfgZoomWheel=Zoom with Mouse Wheel\ncfgZoomWheelHelp=Use mouse wheel for zoom without modifiers\ncfgEnabled=Enabled\npartialResponse=Partial response\nactor=Actor\ncallout=Callout\ncard=Card\ncloud=Cloud\ncross=Cross\ncube=Cube\ncylinder=Cylinder\ndelay=Delay\ndisplay=Display\ndocument=Document\nhexagon=Hexagon\nparallelogram=Parallelogram\npentagon=Pentagon\nprocess=Process\nsquare=Square\nstar=Star\nstep=Step\ntape=Tape\ntrapezoid=Trapezoid\ntriangle=Triangle\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;
Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];Editor.currentTheme="";window.uiTheme="";GraphViewer=function(b,d,m){this.init(b,d,m)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="1"==urlParams.dev?"https://test.draw.io/":"https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl=window.DRAWIO_BASE_URL+"/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;
GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;GraphViewer.prototype.darkMode=null;
GraphViewer.prototype.showLinkIcons=!1;GraphViewer.prototype.showTooltipIcons=!1;GraphViewer.prototype.showNoteIcons=!0;
@@ -5133,22 +5137,22 @@ this.toolbarZIndex;d.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.da
mxUtils.setOpacity(d,30);var p=null,t=null,n=mxUtils.bind(this,function(Y){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=t&&(window.clearTimeout(t),fadeThead2=null);p=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,0);p=null;t=window.setTimeout(mxUtils.bind(this,function(){d.style.display="none";t=null}),100)}),Y||200)}),y=mxUtils.bind(this,function(Y){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=t&&(window.clearTimeout(t),fadeThead2=null);d.style.display="flex";
mxUtils.setOpacity(d,Y||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||(y(30),n())}));mxEvent.addListener(d,mxClient.IS_POINTER?"pointermove":"mousemove",function(Y){mxEvent.consume(Y)});mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(Y){y(100)}));mxEvent.addListener(d,"mousemove",mxUtils.bind(this,function(Y){y(100);mxEvent.consume(Y)}));mxEvent.addListener(d,"mouseleave",mxUtils.bind(this,
function(Y){mxEvent.isTouchEvent(Y)||y(30)}));var C=this.graph,O=C.getTolerance();C.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(Y,aa){this.startX=aa.getGraphX();this.startY=aa.getGraphY();this.scrollLeft=C.container.scrollLeft;this.scrollTop=C.container.scrollTop},mouseMove:function(Y,aa){},mouseUp:function(Y,aa){mxEvent.isTouchEvent(aa.getEvent())&&Math.abs(this.scrollLeft-C.container.scrollLeft)<O&&Math.abs(this.scrollTop-C.container.scrollTop)<O&&Math.abs(this.startX-
-aa.getGraphX())<O&&Math.abs(this.startY-aa.getGraphY())<O&&(0<parseFloat(d.style.opacity||0)?n():y(30))}})}m=this.toolbarItems;for(var F=0,N=mxUtils.bind(this,function(Y,aa,ja,ka){Y=this.createToolbarButton(Y,aa,ja,ka);d.appendChild(Y);F++;return Y}),R=this.graph.getModel(),c=null,f=null,l=null,q=null,x=0;x<m.length;x++){var A=m[x];if("pages"==A){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";q.style.padding="4px";q.style.fontFamily=
+aa.getGraphX())<O&&Math.abs(this.startY-aa.getGraphY())<O&&(0<parseFloat(d.style.opacity||0)?n():y(30))}})}m=this.toolbarItems;for(var F=0,N=mxUtils.bind(this,function(Y,aa,ja,la){Y=this.createToolbarButton(Y,aa,ja,la);d.appendChild(Y);F++;return Y}),R=this.graph.getModel(),c=null,f=null,l=null,q=null,x=0;x<m.length;x++){var A=m[x];if("pages"==A){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";q.style.padding="4px";q.style.fontFamily=
GraphViewer.cssFontFamily;q.style.fontSize="12px";q.style.cursor="default";q.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(q,70);var E=N(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");E.style.borderRightStyle="none";E.style.paddingLeft="0px";E.style.paddingRight="0px";d.appendChild(q);var K=N(mxUtils.bind(this,function(){this.selectPage(this.currentPage+1)}),Editor.chevronRightImage,mxResources.get("nextPage")||
"Next Page");K.style.paddingLeft="0px";K.style.paddingRight="0px";A=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";E.style.display=q.style.display;K.style.display=q.style.display});this.addListener("graphChanged",A);A()}else if("zoom"==A)this.zoomEnabled&&(N(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,mxResources.get("zoomOut")||"Zoom Out"),N(mxUtils.bind(this,
function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),N(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==A){if(this.layersEnabled){var Q=N(mxUtils.bind(this,function(Y){if(null!=c)c.parentNode.removeChild(c),c=null;else{c=this.graph.createLayersDialog(mxUtils.bind(this,
-function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ja=this.graph.getGraphBounds(),ka=this.graph.view;0>ja.x||0>ja.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ka.translate.clone(),scale:ka.scale}):null!=this.graph.originalViewState&&0<ja.x/ka.scale+this.graph.originalViewState.translate.x-ka.translate.x&&0<ja.y/ka.scale+this.graph.originalViewState.translate.y-ka.translate.y&&(ka.setTranslate(this.graph.originalViewState.translate.x,
-this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ka.translate.clone(),scale:ka.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});Y=Q.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=
+function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ja=this.graph.getGraphBounds(),la=this.graph.view;0>ja.x||0>ja.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale}):null!=this.graph.originalViewState&&0<ja.x/la.scale+this.graph.originalViewState.translate.x-la.translate.x&&0<ja.y/la.scale+this.graph.originalViewState.translate.y-la.translate.y&&(la.setTranslate(this.graph.originalViewState.translate.x,
+this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});Y=Q.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=
this.graph.container.clientHeight-this.toolbarHeight-10+"px";c.style.zIndex=this.toolbarZIndex+1;c.style.color="#000";mxUtils.setOpacity(c,85);var aa=mxUtils.getDocumentScrollOrigin(document);c.style.left=aa.x+Y.left-1+"px";c.style.top=aa.y+Y.bottom-2+"px";this.isDarkMode()&&(c.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(c)}}),Editor.layersImage,mxResources.get("layers")||"Layers");R.addListener(mxEvent.CHANGE,function(){Q.style.display=1<R.getChildCount(R.root)?"inline-flex":
-"none"});Q.style.display=1<R.getChildCount(R.root)?"inline-flex":"none"}}else if("tags"==A){if(this.tagsEnabled){var V=N(mxUtils.bind(this,function(Y){null==f&&(f=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),this.graph.addListener(mxEvent.REFRESH,mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ja=this.graph.getGraphBounds(),ka=this.graph.view;0>ja.x||0>ja.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState=
-{translate:ka.translate.clone(),scale:ka.scale}):null!=this.graph.originalViewState&&0<ja.x/ka.scale+this.graph.originalViewState.translate.x-ka.translate.x&&0<ja.y/ka.scale+this.graph.originalViewState.translate.y-ka.translate.y&&(ka.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ka.translate.clone(),scale:ka.scale})}})),f.div.getElementsByTagName("div")[0].style.position="",
+"none"});Q.style.display=1<R.getChildCount(R.root)?"inline-flex":"none"}}else if("tags"==A){if(this.tagsEnabled){var V=N(mxUtils.bind(this,function(Y){null==f&&(f=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),this.graph.addListener(mxEvent.REFRESH,mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ja=this.graph.getGraphBounds(),la=this.graph.view;0>ja.x||0>ja.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState=
+{translate:la.translate.clone(),scale:la.scale}):null!=this.graph.originalViewState&&0<ja.x/la.scale+this.graph.originalViewState.translate.x-la.translate.x&&0<ja.y/la.scale+this.graph.originalViewState.translate.y-la.translate.y&&(la.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale})}})),f.div.getElementsByTagName("div")[0].style.position="",
f.div.style.maxHeight="160px",f.div.style.maxWidth="120px",f.div.style.padding="2px",f.div.style.overflow="auto",f.div.style.height="auto",f.div.style.position="fixed",f.div.style.fontFamily=GraphViewer.cssFontFamily,f.div.style.fontSize="11px",f.div.style.backgroundColor="#eee",f.div.style.color="#000",f.div.style.border="1px solid #d0d0d0",f.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(f.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(f.div,85));if(null!=l)l.parentNode.removeChild(l),
l=null;else{l=f.div;l.style.position="absolute";mxEvent.addListener(l,"mouseleave",function(){null!=l&&(l.parentNode.removeChild(l),l=null)});Y=V.getBoundingClientRect();var aa=mxUtils.getDocumentScrollOrigin(document);l.style.left=aa.x+Y.left-1+"px";l.style.top=aa.y+Y.bottom-2+"px";document.body.appendChild(l);f.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");R.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";
null!=l&&0==this.graph.getAllTags().length&&(l.parentNode.removeChild(l),l=null)}));V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==A?this.lightboxEnabled&&N(mxUtils.bind(this,function(){try{this.showLightbox()}catch(Y){alert(Y.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(A=this.graphConfig["toolbar-buttons"][A],null!=A&&(A.elem=N(null==A.enabled||A.enabled?A.handler:function(){},
A.image,A.title,A.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*F);null!=this.graphConfig.title&&(m=b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),
mxUtils.write(m,this.graphConfig.title),mxUtils.setOpacity(m,70),d.appendChild(m),this.filename=m);this.minToolbarWidth=34*F;var J=b.style.border,ia=mxUtils.bind(this,function(){d.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";d.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var Y=b.getBoundingClientRect(),aa=mxUtils.getScrollOrigin(document.body);aa="relative"===document.body.style.position?document.body.getBoundingClientRect():
{left:-aa.x,top:-aa.y};Y={left:Y.left-aa.left,top:Y.top-aa.top,bottom:Y.bottom-aa.top,right:Y.right-aa.left};d.style.left=Y.left+"px";"bottom"==this.graphConfig["toolbar-position"]?d.style.top=Y.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(d.style.marginTop=-this.toolbarHeight+"px",d.style.top=Y.top+1+"px"):d.style.top=Y.top+"px";"1px solid transparent"==J&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(d);var ja=mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d);
-null!=l&&(l.parentNode.removeChild(l),l=null);null!=c&&(c.parentNode.removeChild(c),c=null);b.style.border=J});mxEvent.addListener(document,"mousemove",function(ka){for(ka=mxEvent.getSource(ka);null!=ka;){if(ka==b||ka==d||ka==c||ka==l)return;ka=ka.parentNode}ja()});mxEvent.addListener(document.body,"mouseleave",function(ka){ja()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ia):ia();this.responsive&&"undefined"!==
+null!=l&&(l.parentNode.removeChild(l),l=null);null!=c&&(c.parentNode.removeChild(c),c=null);b.style.border=J});mxEvent.addListener(document,"mousemove",function(la){for(la=mxEvent.getSource(la);null!=la;){if(la==b||la==d||la==c||la==l)return;la=la.parentNode}ja()});mxEvent.addListener(document.body,"mouseleave",function(la){ja()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ia):ia();this.responsive&&"undefined"!==
typeof ResizeObserver&&(new ResizeObserver(function(){null!=d.parentNode&&ia()})).observe(b)};
GraphViewer.prototype.createToolbarButton=function(b,d,m,p){var t=document.createElement("div");t.style.borderRight="1px solid #d0d0d0";t.style.display="inline-flex";t.style.alignItems="center";t.style.padding="6px";mxEvent.addListener(t,"click",b);null!=m&&t.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",d);b.style.width="18px";b.className="geAdaptiveAsset";null==p||p?(mxEvent.addListener(t,"mouseenter",function(){t.style.backgroundColor=
"light-dark(#dddddd,#333333)"}),mxEvent.addListener(t,"mouseleave",function(){t.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),t.style.cursor="pointer"):mxUtils.setOpacity(t,30);t.appendChild(b);return t};
@@ -5176,7 +5180,7 @@ GraphViewer.createViewerForElement=function(b,d){var m=b.getAttribute("data-mxgr
GraphViewer.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));for(var d="",m=0;m<window.location.ancestorOrigins.length;m++)if(d+=" -> "+window.location.ancestorOrigins[m],d.endsWith("dan6v7pm1f1a1.cloudfront.net")||d.endsWith("confluence-cloud-excalidraw-ll3likebca-uc.a.run.app"))return!0;
(b.endsWith("ac.draw.io")||b.endsWith("aj.draw.io"))&&1==window.location.ancestorOrigins.length&&window.location.ancestorOrigins[0]&&window.location.ancestorOrigins[0].endsWith(".atlassian.net")}}catch(p){}return!1};GraphViewer.darkBackgroundColor=Editor.darkColor;GraphViewer.cssFontFamily=Editor.defaultHtmlFont;GraphViewer.shapeBackgroundColor=null;GraphViewer.viewerInitialized=function(b){};
GraphViewer.initCss=function(){try{null==GraphViewer.styleElement&&(GraphViewer.styleElement=document.createElement("style"),GraphViewer.styleElement.setAttribute("type","text/css"),GraphViewer.styleElement.innerHTML=GraphViewer.getCss(),GraphViewer.blockedAncestorFrames()||document.getElementsByTagName("head")[0].appendChild(GraphViewer.styleElement))}catch(b){}};
-GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\n}\ndiv.mxTooltip {\n box-shadow: 3px 3px 12px light-dark(#c0c0c0, transparent);"," background: light-dark(#ffffcc, "+GraphViewer.darkBackgroundColor+");"," border-style: solid;\n border-width: 1px;\n border-color: black;"," font-family: "+GraphViewer.cssFontFamily+";"," font-size: 8pt;\n position: absolute;\n cursor: default;\n padding: 4px;\n color: black;\n}\ntd.mxPopupMenuIcon div {\n width: 16px;\n height: 16px;\n}\ndiv.mxPopupMenu {\n box-shadow: 2px 2px 3px light-dark(#d5d5d5, transparent);\n background: white;\n position: absolute;\n border: 3px solid #e7e7e7;\n padding: 3px;\n}\ntable.mxPopupMenu {\n border-collapse: collapse;\n margin: 0px;\n}\ntd.mxPopupMenuItem {\n padding: 7px 30px;",
+GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\n}\ndiv.mxTooltip {\n box-shadow: 3px 3px 12px light-dark(#c0c0c0, transparent);"," background: light-dark(#ffffcc, "+GraphViewer.darkBackgroundColor+");"," border-style: solid;\n border-width: 1px;\n border-color: light-dark(#000000, #565656);"," font-family: "+GraphViewer.cssFontFamily+";"," font-size: 8pt;\n position: absolute;\n cursor: default;\n padding: 4px;\n color: light-dark(#000000, #c0c0c0);\n}\ntd.mxPopupMenuIcon div {\n width: 16px;\n height: 16px;\n}\ndiv.mxPopupMenu {\n box-shadow: 2px 2px 3px light-dark(#d5d5d5, transparent);\n background: white;\n position: absolute;\n border: 3px solid #e7e7e7;\n padding: 3px;\n}\ntable.mxPopupMenu {\n border-collapse: collapse;\n margin: 0px;\n}\ntd.mxPopupMenuItem {\n padding: 7px 30px;",
" font-family: "+GraphViewer.cssFontFamily+";"," font-size: 10pt;\n}\ntd.mxPopupMenuIcon {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");"," padding: 0px;\n}\ntr.mxPopupMenuItemHover {\n background-color: #eeeeee;\n color: black;\n}\ntable.mxPopupMenu hr {\n color: #cccccc;\n background-color: #cccccc;\n border: none;\n height: 1px;\n}\ntable.mxPopupMenu tr {\n font-size: 4pt;\n}\n.geDialog, .geDialog table {"," font-family: "+GraphViewer.cssFontFamily+
";"," font-size: 10pt;\n border: none;\n margin: 0px;\n}\n.geDialog {\n position: fixed;"," background: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t color: light-dark(#3f3f3f, #c0c0c0);\n box-shadow: 0px 0px 2px 2px light-dark(#d5d5d5, transparent);\n border: 1px solid light-dark(#dadada, #565656);\n overflow: hidden;\n padding: 30px;\n left: 50%;\n top: 50%;\n max-height: 100%;\n max-width: 100%;\n\t box-sizing: border-box;\n transform: translate(-50%, -50%);",
"\t z-index: "+(GraphViewer.prototype.lightboxZIndex+2)+";","}\n.geBackground {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t position: fixed;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0.9;","\t z-index: "+(GraphViewer.prototype.lightboxZIndex+1)+";","}\n.geDialogTitle {\n box-sizing: border-box;\n white-space: nowrap;"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," border-bottom: 1px solid rgb(192, 192, 192);\n font-size: 15px;\n font-weight: bold;\n text-align: center;\n color: rgb(35, 86, 149);\n}\n.geDialogFooter {",
@@ -5185,7 +5189,7 @@ GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,d,m){if(null!=GraphViewe
(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(m){return window.setTimeout(m,20)},d=function(m,p){function t(){this.q=[];this.add=function(q){this.q.push(q)};var f,l;this.call=function(){f=0;for(l=this.q.length;f<l;f++)this.q[f].call()}}function n(f,l){return f.currentStyle?f.currentStyle[l]:window.getComputedStyle?window.getComputedStyle(f,null).getPropertyValue(l):f.style[l]}function y(f,l){if(!f.resizedAttached)f.resizedAttached=
new t,f.resizedAttached.add(l);else if(f.resizedAttached){f.resizedAttached.add(l);return}f.resizeSensor=document.createElement("div");f.resizeSensor.className="resize-sensor";f.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";f.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';
f.appendChild(f.resizeSensor);"static"==n(f,"position")&&(f.style.position="relative");var q=f.resizeSensor.childNodes[0],x=q.childNodes[0],A=f.resizeSensor.childNodes[1],E=function(){x.style.width="100000px";x.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;A.scrollLeft=1E5;A.scrollTop=1E5};E();var K=!1,Q=function(){f.resizedAttached&&(K&&(f.resizedAttached.call(),K=!1),b(Q))};b(Q);var V,J,ia,Y;l=function(){if((ia=f.offsetWidth)!=V||(Y=f.offsetHeight)!=J)K=!0,V=ia,J=Y;E()};var aa=function(ja,
-ka,ua){ja.attachEvent?ja.attachEvent("on"+ka,ua):ja.addEventListener(ka,ua)};aa(q,"scroll",l);aa(A,"scroll",l)}var C=function(){GraphViewer.resizeSensorEnabled&&p()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var O=null,F=!1;(new ResizeObserver(function(){F||(null!=O&&window.clearTimeout(O),O=window.setTimeout(function(){F=!0;C();O=null;F=!1},200))})).observe(m)}else{var N=Object.prototype.toString.call(m),R="[object Array]"===N||"[object NodeList]"===N||"[object HTMLCollection]"===
+la,ua){ja.attachEvent?ja.attachEvent("on"+la,ua):ja.addEventListener(la,ua)};aa(q,"scroll",l);aa(A,"scroll",l)}var C=function(){GraphViewer.resizeSensorEnabled&&p()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var O=null,F=!1;(new ResizeObserver(function(){F||(null!=O&&window.clearTimeout(O),O=window.setTimeout(function(){F=!0;C();O=null;F=!1},200))})).observe(m)}else{var N=Object.prototype.toString.call(m),R="[object Array]"===N||"[object NodeList]"===N||"[object HTMLCollection]"===
N||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(R){N=0;for(var c=m.length;N<c;N++)y(m[N],C)}else y(m,C);this.detach=function(){if(R)for(var f=0,l=m.length;f<l;f++)d.detach(m[f]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();
function mxBpmnShape(a,d,e,b){mxShape.call(this);this.bounds=a;this.fill=d;this.stroke=e;this.strokewidth=null!=b?b:1}mxUtils.extend(mxBpmnShape,mxShape);
mxBpmnShape.prototype.customProperties=[{name:"symbol",dispName:"Event",type:"enum",defVal:"general",enumList:[{val:"general",dispName:"General"},{val:"message",dispName:"Message"},{val:"timer",dispName:"Timer"},{val:"escalation",dispName:"Escalation"},{val:"conditional",dispName:"Conditional"},{val:"link",dispName:"Link"},{val:"error",dispName:"Error"},{val:"cancel",dispName:"Cancel"},{val:"compensation",dispName:"Compensation"},{val:"signal",dispName:"Signal"},{val:"multiple",dispName:"Multiple"},
diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js
index c91d0e4fc..0a70b9218 100644
--- a/src/main/webapp/js/viewer.min.js
+++ b/src/main/webapp/js/viewer.min.js
@@ -25,13 +25,13 @@ if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap
lang.substring(0,dash));0<=window.mxLanguages.indexOf(lang)&&(window.mxLanguage=lang)}}"1"==urlParams.extAuth&&/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent)&&(urlParams.gapi="0",urlParams.noDevice="1","1"!=urlParams.lightbox&&(urlParams.lightbox="1",urlParams.layers="1",urlParams.viewerOnlyMsg="1"));"viewer.diagrams.net"==window.location.hostname&&(urlParams.lightbox="1");"1"==urlParams.lightbox&&(urlParams.chrome="0");
"1"==urlParams.embedInline&&(urlParams.embed="1",urlParams.ui="sketch",urlParams.plugins="0",urlParams.proto="json",urlParams.prefetchFonts="1",null==urlParams.pv&&(urlParams.pv="0"));function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)}
window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;"1"==urlParams.extAuth&&(a="sketch");if(null==a&&isLocalStorage&&"undefined"!==typeof JSON&&"1"!=urlParams.lightbox)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}"dark"==urlParams.ui&&null==urlParams.dark&&(urlParams.dark="1");"sketch"==a&&null==urlParams.sketch&&"ac.draw.io"===window.location.hostname&&(urlParams.sketch="1");return a}();
-(function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams["export"];null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,
-8)&&(a="http://"+a),EXPORT_URL=a);a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,
-b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0";
-"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
+(function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,
+8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");
+if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.ms365="0";
+"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.ms365="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],FORBID_ATTR:["data-icon","data-icon-content"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ALLOW_DATA_ATTR:!1,ADD_ATTR:"target content pointer-events requiredFeatures data-font-src data-action data-title data-message data-link data-effect data-lucid-type data-lucid-content".split(" ")};
window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL="undefined"===typeof window.EXPORT_URL?"/export":window.EXPORT_URL;window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
-window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"31.4.5",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"31.4.6",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),
IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&
0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),
@@ -2175,21 +2175,21 @@ mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+C+'" height="'+C+'" patt
function(y,C){b.apply(this,arguments);if(null!=this.shiftPreview1){var O=this.view.canvas;null!=O.ownerSVGElement&&(O=O.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+y,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+C,F))+"px";O.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(y,C,O){var F=this.view.scale,N=this.view.translate,R=this.pageFormat,c=F*this.pageScale,
f=this.view.getBackgroundPageBounds();C=f.width;O=f.height;var l=new mxRectangle(F*N.x,F*N.y,R.width*c,R.height*c);N=null!=this.view.canvas&&null!=this.view.canvas.getCTM?this.view.canvas.getCTM():null;F=null!=N?N.a:1;c=null!=N?N.e:0;var q=null!=N?N.f:0;N=(y=y&&Math.min(l.width,l.height)*F>this.minPageBreakDist)?Math.ceil(O/l.height)-1:0;R=y?Math.ceil(C/l.width)-1:0;var x=f.x+C,A=f.y+O,E=0,K=N-1,Q=0,V=R-1;this.pageBreakCoverage=null;y&&null!=this.container&&(C=this.container.clientWidth,O=this.container.clientHeight,
c=(this.container.scrollLeft-C-c)/F-f.x,q=(this.container.scrollTop-O-q)/F-f.y,Q=Math.max(0,Math.floor(c/l.width)-1),V=Math.min(R-1,Math.ceil((c+3*C/F)/l.width)),E=Math.max(0,Math.floor(q/l.height)-1),K=Math.min(N-1,Math.ceil((q+3*O/F)/l.height)),0<E||K<N-1||0<Q||V<R-1)&&(this.pageBreakCoverage=new mxRectangle(this.container.scrollLeft-C/2,this.container.scrollTop-O/2,2*C,2*O));null==this.horizontalPageBreaks&&0<N&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<R&&(this.verticalPageBreaks=
-[]);C=mxUtils.bind(this,function(J){if(null!=J){var ia=J==this.horizontalPageBreaks,Y=ia?E:Q,aa=ia?K:V;aa=y&&isFinite(Y)&&isFinite(aa)?Math.max(0,Math.min(this.maxPageBreaks,aa-Y+1)):0;for(var ja=0;ja<aa;ja++){var ka=Y+ja+1;ka=ia?[new mxPoint(Math.round(f.x),Math.round(f.y+ka*l.height)),new mxPoint(Math.round(x),Math.round(f.y+ka*l.height))]:[new mxPoint(Math.round(f.x+ka*l.width),Math.round(f.y)),new mxPoint(Math.round(f.x+ka*l.width),Math.round(A))];null!=J[ja]&&null!=J[ja].node?(J[ja].points=ka,
-J[ja].redraw()):(null!=J[ja]&&J[ja].destroy(),ka=new mxPolyline(ka,this.pageBreakColor),ka.dialect=this.dialect,ka.isDashed=this.pageBreakDashed,ka.pointerEvents=!1,ka.init(this.view.backgroundPane),ka.redraw(),J[ja]=ka)}for(ja=aa;ja<J.length;ja++)null!=J[ja]&&J[ja].destroy();J.splice(aa,J.length-aa)}});C(this.horizontalPageBreaks);C(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(y,C,O){for(var F=0;F<
+[]);C=mxUtils.bind(this,function(J){if(null!=J){var ia=J==this.horizontalPageBreaks,Y=ia?E:Q,aa=ia?K:V;aa=y&&isFinite(Y)&&isFinite(aa)?Math.max(0,Math.min(this.maxPageBreaks,aa-Y+1)):0;for(var ja=0;ja<aa;ja++){var la=Y+ja+1;la=ia?[new mxPoint(Math.round(f.x),Math.round(f.y+la*l.height)),new mxPoint(Math.round(x),Math.round(f.y+la*l.height))]:[new mxPoint(Math.round(f.x+la*l.width),Math.round(f.y)),new mxPoint(Math.round(f.x+la*l.width),Math.round(A))];null!=J[ja]&&null!=J[ja].node?(J[ja].points=la,
+J[ja].redraw()):(null!=J[ja]&&J[ja].destroy(),la=new mxPolyline(la,this.pageBreakColor),la.dialect=this.dialect,la.isDashed=this.pageBreakDashed,la.pointerEvents=!1,la.init(this.view.backgroundPane),la.redraw(),J[ja]=la)}for(ja=aa;ja<J.length;ja++)null!=J[ja]&&J[ja].destroy();J.splice(aa,J.length-aa)}});C(this.horizontalPageBreaks);C(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(y,C,O){for(var F=0;F<
C.length;F++){if(this.graph.isTableCell(C[F])||this.graph.isTableRow(C[F]))return!1;if(this.graph.getModel().isVertex(C[F])){var N=this.graph.getCellGeometry(C[F]);if(null!=N&&N.relative)return!1}}return d.apply(this,arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=m.apply(this,arguments);y.intersects=mxUtils.bind(this,function(C,O){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(y,arguments)});return y};
mxGraphView.prototype.createBackgroundPageShape=function(y){return new mxRectangleShape(y,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var y=this.getGraphBounds(),C=0<y.width?y.x/this.scale-this.translate.x:0,O=0<y.height?y.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,N=this.graph.pageScale,R=F.width*N;F=F.height*N;N=Math.floor(Math.min(0,C)/R);var c=Math.floor(Math.min(0,O)/F);return new mxRectangle(this.scale*(this.translate.x+
N*R),this.scale*(this.translate.y+c*F),this.scale*(Math.ceil(Math.max(1,C+y.width/this.scale)/R)-N)*R,this.scale*(Math.ceil(Math.max(1,O+y.height/this.scale)/F)-c)*F)};var p=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(y,C){p.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=y+"px",this.view.backgroundPageShape.node.style.marginTop=
C+"px")};var t=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(y,C,O,F,N,R){var c=t.apply(this,arguments);null==R||R||mxEvent.addListener(c,"mousedown",function(f){mxEvent.consume(f)});return c};var n=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(y,C,O){var F=this.graph.model.getParent(y);if(C){var N=this.graph.model.isEdge(y)?null:this.graph.getCellGeometry(y);N=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(y)&&
(null!=N&&N.relative||!this.graph.isContainer(F)||this.graph.isPart(y))}else if(N=n.apply(this,arguments),this.graph.isTableCell(y)||this.graph.isTableRow(y))N=F,this.graph.isTable(N)||(N=this.graph.model.getParent(N)),N=!this.graph.selectionCellsHandler.isHandled(N)||this.graph.isCellSelected(N)&&this.graph.isToggleEvent(O.getEvent())||this.graph.isCellSelected(y)&&!this.graph.isToggleEvent(O.getEvent())||this.graph.isTableCell(y)&&this.graph.isCellSelected(F);return N};mxPopupMenuHandler.prototype.getCellForPopupEvent=
-function(y){y=y.getCell();for(var C=this.graph.getModel(),O=C.getParent(y),F=this.graph.view.getState(O),N=this.graph.isCellSelected(y);null!=F&&(C.isVertex(O)||C.isEdge(O));){var R=this.graph.isCellSelected(O);N=N||R;if(R||!N&&(this.graph.isTableCell(y)||this.graph.isTableRow(y)))y=O;O=C.getParent(O)}return y}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var p=this,t=this.editor.graph;t.lightbox=m;var n=t.getGraphBounds;t.getGraphBounds=function(){var H=n.apply(this,arguments),P=this.backgroundImage;if(null!=P&&null!=P.width&&null!=P.height){var T=this.view.translate,W=this.view.scale;H=mxRectangle.fromRectangle(H);H.add(new mxRectangle((T.x+P.x)*W,(T.y+P.y)*W,P.width*W,P.height*W))}return H};t.useCssTransforms&&(this.lazyZoomDelay=
+function(y){y=y.getCell();for(var C=this.graph.getModel(),O=C.getParent(y),F=this.graph.view.getState(O),N=this.graph.isCellSelected(y);null!=F&&(C.isVertex(O)||C.isEdge(O));){var R=this.graph.isCellSelected(O);N=N||R;if(R||!N&&(this.graph.isTableCell(y)||this.graph.isTableRow(y)))y=O;O=C.getParent(O)}return y}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var p=this,t=this.editor.graph;t.lightbox=m;var n=t.getGraphBounds;t.getGraphBounds=function(){var H=n.apply(this,arguments),P=this.backgroundImage;if(null!=P&&null!=P.width&&null!=P.height){var U=this.view.translate,W=this.view.scale;H=mxRectangle.fromRectangle(H);H.add(new mxRectangle((U.x+P.x)*W,(U.y+P.y)*W,P.width*W,P.height*W))}return H};t.useCssTransforms&&(this.lazyZoomDelay=
0);this.selectionStateListener=mxUtils.bind(this,function(H,P){this.clearSelectionState()});t.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);t.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);t.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);t.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);t.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){t.isEnabled=
function(){return!1};t.panningHandler.isForcePanningEvent=function(H){for(var P=H.getSource();null!=P&&P!=t.container;){if("foreignObject"===P.nodeName||"text"===P.nodeName)return!1;P=P.parentNode}return!mxEvent.isPopupTrigger(H.getEvent())};var y=t.panningHandler.start;t.panningHandler.start=function(){y.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!t.standalone){var C=!1,O=!1;this.setDefaultStyle=function(H){try{var P=t.getModel(),
-T=P.isVertex(H)&&P.isEdge(P.getParent(H));P.isEdge(H)||T?(O=!1,P.isEdge(H)&&(t.pasteEdgeStyle=!1)):(C=!1,t.pasteStylesToText=!1);var W=t.getCellStyle(H,!1),fa=[],X=[],ea;for(ea in W)fa.push(W[ea]),X.push(ea);P.isEdge(H)?t.currentEdgeStyle={}:T||(t.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",X,"values",fa,"cells",[H],"force",!0,"edgeLabel",T));if(P.isEdge(H)||T)O=!0,P.isEdge(H)&&(t.pasteEdgeStyle=!0);else{C=!0;var oa=P.getStyle(H);t.pasteStylesToText="string"===typeof oa&&
-0<=mxUtils.indexOf(oa.split(";"),"text")}}catch(la){this.handleError(la)}};this.clearDefaultStyle=function(){t.currentEdgeStyle=mxUtils.clone(t.defaultEdgeStyle);t.currentVertexStyle=mxUtils.clone(t.defaultVertexStyle);t.pasteEdgeStyle=!1;C=O=t.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};t.addListener("cellsInserted",function(H,P){t.pasteCellStyles(t.includeDescendants(P.getProperty("cells")))});t.addListener("textInserted",function(H,P){t.pasteCellStyles(P.getProperty("cells"))});
+U=P.isVertex(H)&&P.isEdge(P.getParent(H));P.isEdge(H)||U?(O=!1,P.isEdge(H)&&(t.pasteEdgeStyle=!1)):(C=!1,t.pasteStylesToText=!1);var W=t.getCellStyle(H,!1),fa=[],X=[],ea;for(ea in W)fa.push(W[ea]),X.push(ea);P.isEdge(H)?t.currentEdgeStyle={}:U||(t.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",X,"values",fa,"cells",[H],"force",!0,"edgeLabel",U));if(P.isEdge(H)||U)O=!0,P.isEdge(H)&&(t.pasteEdgeStyle=!0);else{C=!0;var oa=P.getStyle(H);t.pasteStylesToText="string"===typeof oa&&
+0<=mxUtils.indexOf(oa.split(";"),"text")}}catch(ka){this.handleError(ka)}};this.clearDefaultStyle=function(){t.currentEdgeStyle=mxUtils.clone(t.defaultEdgeStyle);t.currentVertexStyle=mxUtils.clone(t.defaultVertexStyle);t.pasteEdgeStyle=!1;C=O=t.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};t.addListener("cellsInserted",function(H,P){t.pasteCellStyles(t.includeDescendants(P.getProperty("cells")))});t.addListener("textInserted",function(H,P){t.pasteCellStyles(P.getProperty("cells"))});
this.createDivs();this.createUi();this.refresh();var F=mxUtils.bind(this,function(H){null==H&&(H=window.event);return t.isEditing()||null!=H&&this.isSelectionAllowed(H)});document.addEventListener("selectstart",function(H){var P=mxEvent.getSource(H);P!=document.body&&P!=document.documentElement||H.preventDefault()},!0);this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=F,this.menubarContainer.onmousedown=F,this.toolbarContainer.onselectstart=
F,this.toolbarContainer.onmousedown=F,this.diagramContainer.onselectstart=F,this.diagramContainer.onmousedown=F,this.sidebarContainer.onselectstart=F,this.sidebarContainer.onmousedown=F,this.formatContainer.onselectstart=F,this.formatContainer.onmousedown=F,null!=this.tabContainer&&(this.tabContainer.onselectstart=F),mxClient.IS_IOS&&(d=function(){var H=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var P=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{H=[parseInt(P[1],10),parseInt(P[2],
-10),parseInt(P[3]||0,10)]}catch(T){}}return H}(),null!=d&&16<=d[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?
+10),parseInt(P[3]||0,10)]}catch(U){}}return H}(),null!=d&&16<=d[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?
this.diagramContainer.oncontextmenu=function(H){if(null!=H){var P=mxEvent.getSource(H);if("A"==P.nodeName)for(;null!=P;){if("geHint"==P.className)return!0;P=P.parentNode}}return F(H)}:t.panningHandler.usePopupTrigger=!1;t.init(this.diagramContainer);mxClient.IS_SVG&&null!=t.view.getDrawPane()&&(d=t.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",
mxUtils.bind(this,function(H,P){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(H,P){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));if(null!=t.graphHandler){var N=t.graphHandler.start;t.graphHandler.start=function(H){null!=p.hoverIcons&&p.hoverIcons.reset();null!=p.inlineToolbar&&null!=H&&p.inlineToolbar.hide();N.apply(this,arguments)};var R=t.graphHandler.mouseUp;
t.graphHandler.mouseUp=function(){R.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()}}var c=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();c.apply(this,arguments)};var f=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(){f.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};var l=mxEdgeHandler.prototype.start;mxEdgeHandler.prototype.start=
@@ -2198,16 +2198,16 @@ this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.d
27!=H.keyCode||(null!=this.sidebar&&null!=this.sidebar.tooltip&&"none"!=this.sidebar.tooltip.style.display&&null!=this.sidebar.tooltipCloseImage&&"none"!=this.sidebar.tooltipCloseImage.style.display?(this.sidebar.hideTooltip(),mxEvent.consume(H)):this.hideDialog(null,!0)):(P=mxEvent.getSource(H),"INPUT"==P.nodeName||"TEXTAREA"==P.nodeName||"SELECT"==P.nodeName||P.isContentEditable||(this.spaceDown=!0,this.hoverIcons.reset(),null!=t.container&&(t.container.style.cursor="move"),mxEvent.consume(H)))});
mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(H){null!=t.container&&(t.container.style.cursor="");this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var A=t.panningHandler.isForcePanningEvent;t.panningHandler.isForcePanningEvent=function(H){return null!=t.freehand&&t.freehand.isActive()?!1:A.apply(this,arguments)||p.isSpaceDown()||mxEvent.isMouseEvent(H.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(H.getEvent()))&&
(!mxEvent.isControlDown(H.getEvent())&&mxEvent.isRightMouseButton(H.getEvent())||mxEvent.isMiddleMouseButton(H.getEvent()))};var E=t.cellEditor.isStopEditingEvent;t.cellEditor.isStopEditingEvent=function(H){return E.apply(this,arguments)||13==H.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(H)||mxClient.IS_MAC&&mxEvent.isMetaDown(H)||mxClient.IS_SF&&mxEvent.isShiftDown(H))};var K=t.isZoomWheelEvent;t.isZoomWheelEvent=function(){return p.isSpaceDown()||K.apply(this,arguments)};var Q=mxUtils.bind(this,
-function(){if(null!=this.toolbar)for(var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,P=this.toolbar.container.firstChild;null!=P;){var T=P.getAttribute("data-min-width");null!=T&&parseInt(T)>H?P.style.display="none":P.style.display="";P=P.nextSibling}}),V=!1,J=null,ia=null,Y=null,aa=mxUtils.bind(this,function(){if(null!=this.toolbar&&V!=t.cellEditor.isContentEditing()){for(var H=this.toolbar.container.firstChild,P=[];null!=H;){var T=H.nextSibling;H.parentNode.removeChild(H);
-P.push(H);H=T}H=this.toolbar.fontMenu;T=this.toolbar.sizeMenu;if(null==Y)this.toolbar.createTextToolbar();else{for(var W=0;W<Y.length;W++)this.toolbar.container.appendChild(Y[W]);this.toolbar.fontMenu=J;this.toolbar.sizeMenu=ia}V=t.cellEditor.isContentEditing();J=H;ia=T;Y=P;Q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();aa()}));this.addListener("currentThemeChanged",Q);mxEvent.addListener(window,"resize",
-Q);Q();t.isTouchPopupMenuEnabled=function(){return null==p.dialog};var ja=t.cellEditor.startEditing;t.cellEditor.startEditing=function(){ja.apply(this,arguments);aa();if(t.cellEditor.isContentEditing()){var H=!1,P=function(){H||(H=!0,window.setTimeout(function(){var T=t.getSelectedEditingElement();null!=T&&(T=mxUtils.getCurrentStyle(T),null!=T&&null!=p.toolbar&&(p.toolbar.setFontName(mxUtils.getCssFontFamily(T.fontFamily)),p.toolbar.setFontSize(parseInt(T.fontSize))));H=!1},0))};mxEvent.addListener(t.cellEditor.textarea,
-"input",P);mxEvent.addListener(t.cellEditor.textarea,"touchend",P);mxEvent.addListener(t.cellEditor.textarea,"mouseup",P);mxEvent.addListener(t.cellEditor.textarea,"keyup",P);P()}};var ka=t.cellEditor.stopEditing;t.cellEditor.stopEditing=function(H,P){try{ka.apply(this,arguments),aa()}catch(T){p.handleError(T)}};t.container.setAttribute("tabindex","0");t.container.style.cursor="default";if(window.self===window.top&&null!=t.container.parentNode)try{t.container.focus()}catch(H){}var ua=t.fireMouseEvent;
-t.fireMouseEvent=function(H,P,T){try{H==mxEvent.MOUSE_DOWN&&this.container.focus(),ua.apply(this,arguments)}catch(W){p.handleError(W)}};var Da=t.foldCells;t.foldCells=function(H,P,T,W,fa){try{Da.apply(this,arguments)}catch(X){p.handleError(X)}};t.popupMenuHandler.autoExpand=!0;null!=this.menus&&(t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(H,P,T){this.menus.createPopupMenu(H,P,T)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(H){t.popupMenuHandler.hideMenu()}));
-this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};t.connectionHandler.addListener(mxEvent.CONNECT,function(H,P){var T=[P.getProperty("cell")];P.getProperty("terminalInserted")&&(T.push(P.getProperty("terminal")),window.setTimeout(function(){null!=p.hoverIcons&&p.hoverIcons.update(t.view.getState(T[T.length-1]))},0));t.pasteCellStyles(T)});var ha=null,k=null;b=mxUtils.bind(this,function(){if(null!=this.toolbar){var H=this.getSelectionState();if(t.isEnabled()&&
+function(){if(null!=this.toolbar)for(var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,P=this.toolbar.container.firstChild;null!=P;){var U=P.getAttribute("data-min-width");null!=U&&parseInt(U)>H?P.style.display="none":P.style.display="";P=P.nextSibling}}),V=!1,J=null,ia=null,Y=null,aa=mxUtils.bind(this,function(){if(null!=this.toolbar&&V!=t.cellEditor.isContentEditing()){for(var H=this.toolbar.container.firstChild,P=[];null!=H;){var U=H.nextSibling;H.parentNode.removeChild(H);
+P.push(H);H=U}H=this.toolbar.fontMenu;U=this.toolbar.sizeMenu;if(null==Y)this.toolbar.createTextToolbar();else{for(var W=0;W<Y.length;W++)this.toolbar.container.appendChild(Y[W]);this.toolbar.fontMenu=J;this.toolbar.sizeMenu=ia}V=t.cellEditor.isContentEditing();J=H;ia=U;Y=P;Q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();aa()}));this.addListener("currentThemeChanged",Q);mxEvent.addListener(window,"resize",
+Q);Q();t.isTouchPopupMenuEnabled=function(){return null==p.dialog};var ja=t.cellEditor.startEditing;t.cellEditor.startEditing=function(){ja.apply(this,arguments);aa();if(t.cellEditor.isContentEditing()){var H=!1,P=function(){H||(H=!0,window.setTimeout(function(){var U=t.getSelectedEditingElement();null!=U&&(U=mxUtils.getCurrentStyle(U),null!=U&&null!=p.toolbar&&(p.toolbar.setFontName(mxUtils.getCssFontFamily(U.fontFamily)),p.toolbar.setFontSize(parseInt(U.fontSize))));H=!1},0))};mxEvent.addListener(t.cellEditor.textarea,
+"input",P);mxEvent.addListener(t.cellEditor.textarea,"touchend",P);mxEvent.addListener(t.cellEditor.textarea,"mouseup",P);mxEvent.addListener(t.cellEditor.textarea,"keyup",P);P()}};var la=t.cellEditor.stopEditing;t.cellEditor.stopEditing=function(H,P){try{la.apply(this,arguments),aa()}catch(U){p.handleError(U)}};t.container.setAttribute("tabindex","0");t.container.style.cursor="default";if(window.self===window.top&&null!=t.container.parentNode)try{t.container.focus()}catch(H){}var ua=t.fireMouseEvent;
+t.fireMouseEvent=function(H,P,U){try{H==mxEvent.MOUSE_DOWN&&this.container.focus(),ua.apply(this,arguments)}catch(W){p.handleError(W)}};var Da=t.foldCells;t.foldCells=function(H,P,U,W,fa){try{Da.apply(this,arguments)}catch(X){p.handleError(X)}};t.popupMenuHandler.autoExpand=!0;null!=this.menus&&(t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(H,P,U){this.menus.createPopupMenu(H,P,U)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(H){t.popupMenuHandler.hideMenu()}));
+this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};t.connectionHandler.addListener(mxEvent.CONNECT,function(H,P){var U=[P.getProperty("cell")];P.getProperty("terminalInserted")&&(U.push(P.getProperty("terminal")),window.setTimeout(function(){null!=p.hoverIcons&&p.hoverIcons.update(t.view.getState(U[U.length-1]))},0));t.pasteCellStyles(U)});var ha=null,k=null;b=mxUtils.bind(this,function(){if(null!=this.toolbar){var H=this.getSelectionState();if(t.isEnabled()&&
0<H.edges.length){if(null!=this.toolbar.edgeStyleMenu){var P=this.getImageForEdgeStyle(H.style);1==H.edges.length&&"arrow"==H.style[mxConstants.STYLE_SHAPE]&&(P=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+P+")"}null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(H.style)+")")}else null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ha+")"),null!=this.toolbar.edgeShapeMenu&&
(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+k+")")}});t.selectionModel.addListener(mxEvent.CHANGE,b);t.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(H,P){H=P.getProperty("force");(this.updateDefaultStyle||H)&&t.copyCellStyles(P.getProperty("cells"),P.getProperty("keys"),P.getProperty("values"),t.currentVertexStyle,t.currentEdgeStyle,C,O,P.getProperty("edgeLabel"));null!=this.toolbar&&(this.toolbar.setFontName(t.currentVertexStyle.fontFamily||
Menus.prototype.defaultFont),this.toolbar.setFontSize(t.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),P=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(ha=this.getImageForEdgeStyle(t.currentEdgeStyle),0==P.edges.length&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ha+")")),null!=this.toolbar.edgeShapeMenu&&(k=this.getImageForEdgeShape(t.currentEdgeStyle),0==P.edges.length&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+k+")")))}));null!=this.toolbar&&
-(b=mxUtils.bind(this,function(){var H=t.currentVertexStyle.fontFamily||"Helvetica",P=String(t.currentVertexStyle.fontSize||"12"),T=t.getView().getState(t.getSelectionCell());null!=T&&(H=T.style[mxConstants.STYLE_FONTFAMILY]||H,P=T.style[mxConstants.STYLE_FONTSIZE]||P,10<H.length&&(H=H.substring(0,8)+"..."));this.toolbar.setFontName(H);this.toolbar.setFontSize(P)}),t.getSelectionModel().addListener(mxEvent.CHANGE,b),t.getModel().addListener(mxEvent.CHANGE,b));t.addListener(mxEvent.CELLS_ADDED,function(H,
+(b=mxUtils.bind(this,function(){var H=t.currentVertexStyle.fontFamily||"Helvetica",P=String(t.currentVertexStyle.fontSize||"12"),U=t.getView().getState(t.getSelectionCell());null!=U&&(H=U.style[mxConstants.STYLE_FONTFAMILY]||H,P=U.style[mxConstants.STYLE_FONTSIZE]||P,10<H.length&&(H=H.substring(0,8)+"..."));this.toolbar.setFontName(H);this.toolbar.setFontSize(P)}),t.getSelectionModel().addListener(mxEvent.CHANGE,b),t.getModel().addListener(mxEvent.CHANGE,b));t.addListener(mxEvent.CELLS_ADDED,function(H,
P){H=P.getProperty("cells");P=P.getProperty("parent");null!=P&&t.getModel().isLayer(P)&&!t.isCellVisible(P)&&null!=H&&0<H.length&&t.getModel().setVisible(P,!0)});Graph.selectParentLayer&&t.selectionModel.addListener(mxEvent.CHANGE,function(){if(t.isEnabled()&&!t.isSelectionEmpty()){var H=t.getLayerForCells(t.getSelectionCells());null!=H&&t.setDefaultParent(H)}});this.gestureHandler=mxUtils.bind(this,function(H){this.isHideCurrentMenuEvent(H)&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,
this.gestureHandler);var u=null;this.resizeHandler=mxUtils.bind(this,function(){null!=u&&window.clearTimeout(u);u=window.setTimeout(mxUtils.bind(this,function(){u=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&(this.scrollHandler=
mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){t.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){t.view.validateBackground()}));t.addListener("gridSizeChanged",mxUtils.bind(this,function(){t.isGridEnabled()&&t.view.validateBackground()}));
@@ -2270,7 +2270,8 @@ EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.sha
EditorUi.prototype.onKeyDown=function(b){var d=this.editor.graph;if(9==b.which&&d.isEnabled()&&!mxEvent.isControlDown(b)){if(d.isEditing())if(mxEvent.isAltDown(b))d.stopEditing(!1);else try{var m=d.cellEditor.isContentEditing()&&d.cellEditor.isTextSelected();if(window.getSelection&&d.cellEditor.isContentEditing()&&!m){var p=window.getSelection(),t=0<p.rangeCount?p.getRangeAt(0).commonAncestorContainer:null;m=null!=t&&("LI"==t.nodeName||null!=t.parentNode&&"LI"==t.parentNode.nodeName)}m?document.execCommand(mxEvent.isShiftDown(b)?
"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?d.stopEditing(!1):d.cellEditor.insertTab(d.cellEditor.isContentEditing()?null:4)}catch(n){}else mxEvent.isAltDown(b)?d.selectParentCell():d.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};
EditorUi.prototype.onKeyPress=function(b){var d=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(b)===this.typingShim||!this.isImmediateEditingEvent(b)||d.isEditing()||d.isSelectionEmpty()||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(null==b.key||1!==b.key.length)&&229!==b.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(b)||(d.escape(),d.cellEditor.editByTyping=!0,d.startEditing())};
-EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&d.setAttribute("inputmode","none");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";
+EditorUi.prototype.isVirtualKeyboardDevice=function(){return mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints};
+EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");this.isVirtualKeyboardDevice()&&d.setAttribute("inputmode","none");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";
this.typingShim=d;var m=!1,p=mxUtils.bind(this,function(){if(!m&&0<d.value.length){var n=d.value;d.value="";this.hideTypingShim();b.escape();b.cellEditor.editByTyping=!0;b.startEditing(null,n)}});mxEvent.addListener(d,"compositionstart",function(){m=!0});mxEvent.addListener(d,"compositionend",function(){m=!1;p()});mxEvent.addListener(d,"input",function(){p()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(n){229!==n.keyCode&&(mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||(null==n.key||
1!==n.key.length||mxEvent.isAltDown(n)?n.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(n)&&n.preventDefault()))}));b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));b.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));b.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,
function(){this.updateTypingShim()}),0)}));if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var t=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?t.apply(b.cellEditor):this.updateTypingShim()})};
@@ -2291,14 +2292,14 @@ EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipb
null;n.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):y=m.apply(this,arguments);b.updatePasteActionStates();return y};var p=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){p.apply(this,arguments);b.updatePasteActionStates()};var t=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(n,y){t.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};
EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;
EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var X=this.graph.getPageLayout(),ea=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+X.x*ea.width),this.scale*(this.translate.y+X.y*ea.height),this.scale*X.width*ea.width,
-this.scale*X.height*ea.height)};b.getPreferredPageSize=function(X,ea,oa){X=this.getPageLayout();ea=this.getPageSize();return new mxRectangle(0,0,X.width*ea.width,X.height*ea.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(X,ea,oa,la){if(null!=b.container&&!b.isViewer()){oa=null!=oa?oa:0;la=null!=la?la:0;var ca=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),sa=mxUtils.hasScrollbars(b.container),xa=b.view.translate,
-qa=b.view.scale,Ba=mxRectangle.fromRectangle(ca);Ba.x=Ba.x/qa-xa.x;Ba.y=Ba.y/qa-xa.y;Ba.width/=qa;Ba.height/=qa;xa=b.container.scrollTop;var ma=b.container.scrollLeft,ta=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)ta+=3;var va=b.container.offsetWidth-ta;ta=b.container.offsetHeight-ta;X=X?Math.max(.3,Math.min(ea||1,va/Ba.width)):qa;ea=(va-X*Ba.width)/2/X;var Ha=0==this.lightboxVerticalDivider?0:(ta-X*Ba.height)/this.lightboxVerticalDivider/X;sa&&(ea=Math.max(ea,
-0),Ha=Math.max(Ha,0));if(sa||ca.width<va||ca.height<ta)b.view.scaleAndTranslate(X,Math.floor(ea-Ba.x),Math.floor(Ha-Ba.y)),b.container.scrollTop=xa*X/qa,b.container.scrollLeft=ma*X/qa;else if(0!=oa||0!=la)ca=b.view.translate,b.view.setTranslate(Math.floor(ca.x+oa/qa),Math.floor(ca.y+la/qa))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var p=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",p);this.destroyFunctions.push(function(){mxEvent.removeListener(window,
+this.scale*X.height*ea.height)};b.getPreferredPageSize=function(X,ea,oa){X=this.getPageLayout();ea=this.getPageSize();return new mxRectangle(0,0,X.width*ea.width,X.height*ea.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(X,ea,oa,ka){if(null!=b.container&&!b.isViewer()){oa=null!=oa?oa:0;ka=null!=ka?ka:0;var ba=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),sa=mxUtils.hasScrollbars(b.container),xa=b.view.translate,
+qa=b.view.scale,Ba=mxRectangle.fromRectangle(ba);Ba.x=Ba.x/qa-xa.x;Ba.y=Ba.y/qa-xa.y;Ba.width/=qa;Ba.height/=qa;xa=b.container.scrollTop;var ma=b.container.scrollLeft,ta=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)ta+=3;var va=b.container.offsetWidth-ta;ta=b.container.offsetHeight-ta;X=X?Math.max(.3,Math.min(ea||1,va/Ba.width)):qa;ea=(va-X*Ba.width)/2/X;var Ga=0==this.lightboxVerticalDivider?0:(ta-X*Ba.height)/this.lightboxVerticalDivider/X;sa&&(ea=Math.max(ea,
+0),Ga=Math.max(Ga,0));if(sa||ba.width<va||ba.height<ta)b.view.scaleAndTranslate(X,Math.floor(ea-Ba.x),Math.floor(Ga-Ba.y)),b.container.scrollTop=xa*X/qa,b.container.scrollLeft=ma*X/qa;else if(0!=oa||0!=ka)ba=b.view.translate,b.view.setTranslate(Math.floor(ba.x+oa/qa),Math.floor(ba.y+ka/qa))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var p=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",p);this.destroyFunctions.push(function(){mxEvent.removeListener(window,
"resize",p)});if("undefined"!==typeof ResizeObserver&&null!=b.container){var t=0==b.container.offsetWidth||0==b.container.offsetHeight,n=new ResizeObserver(mxUtils.bind(this,function(){var X=0==b.container.offsetWidth||0==b.container.offsetHeight;t&&!X&&(b.isLightboxView()&&this.lightboxFit(),this.chromelessResize());t=X}));n.observe(b.container);this.destroyFunctions.push(function(){n.disconnect()})}this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));
this.actions.get("zoomIn").funct=mxUtils.bind(this,function(X){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(X){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var y=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";
this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var C=mxUtils.bind(this,function(){var X=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top=
-"0":this.chromelessToolbar.style.bottom=(null!=X?parseInt(X["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",C);C();var O=0;C=mxUtils.bind(this,function(X,ea,oa){O++;var la=document.createElement("span");la.style.paddingLeft="8px";la.style.paddingRight="8px";la.style.cursor="pointer";mxEvent.addListener(la,"click",X);null!=oa&&la.setAttribute("title",oa);X=document.createElement("img");X.setAttribute("border",
-"0");X.setAttribute("src",ea);X.style.width="36px";X.style.filter="invert(100%)";la.appendChild(X);this.chromelessToolbar.appendChild(la);return la});if(null!=y.backBtn){var F=Graph.sanitizeLink(y.backBtn.url);null!=F&&C(mxUtils.bind(this,function(X){window.location.href=F;mxEvent.consume(X)}),Editor.backImage,mxResources.get("back"))}if(this.isPagesEnabled()){var N=C(mxUtils.bind(this,function(X){this.actions.get("previousPage").funct();mxEvent.consume(X)}),Editor.chevronLeftImage,mxResources.get("previousPage")),
+"0":this.chromelessToolbar.style.bottom=(null!=X?parseInt(X["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",C);C();var O=0;C=mxUtils.bind(this,function(X,ea,oa){O++;var ka=document.createElement("span");ka.style.paddingLeft="8px";ka.style.paddingRight="8px";ka.style.cursor="pointer";mxEvent.addListener(ka,"click",X);null!=oa&&ka.setAttribute("title",oa);X=document.createElement("img");X.setAttribute("border",
+"0");X.setAttribute("src",ea);X.style.width="36px";X.style.filter="invert(100%)";ka.appendChild(X);this.chromelessToolbar.appendChild(ka);return ka});if(null!=y.backBtn){var F=Graph.sanitizeLink(y.backBtn.url);null!=F&&C(mxUtils.bind(this,function(X){window.location.href=F;mxEvent.consume(X)}),Editor.backImage,mxResources.get("back"))}if(this.isPagesEnabled()){var N=C(mxUtils.bind(this,function(X){this.actions.get("previousPage").funct();mxEvent.consume(X)}),Editor.chevronLeftImage,mxResources.get("previousPage")),
R=document.createElement("div");R.style.fontFamily=Editor.defaultHtmlFont;R.style.display="inline-block";R.style.verticalAlign="top";R.style.fontWeight="bold";R.style.marginTop="8px";R.style.fontSize="14px";R.style.cursor="default";R.style.color="#ffffff";this.chromelessToolbar.appendChild(R);var c=C(mxUtils.bind(this,function(X){this.actions.get("nextPage").funct();mxEvent.consume(X)}),Editor.chevronRightImage,mxResources.get("nextPage")),f=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&
null!=this.currentPage){R.innerText="";var X=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(R,X+1+" / "+this.pages.length);R.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());N.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(X-1,this.pages.length)].getName());c.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(X+1,this.pages.length)].getName())}});N.style.paddingLeft="0px";N.style.paddingRight=
"4px";c.style.paddingLeft="4px";c.style.paddingRight="0px";var l=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(c.style.display="",N.style.display="",R.style.display="inline-block"):(c.style.display="none",N.style.display="none",R.style.display="none");f()});if(null!=this.menus){var q=this.menus.get("pages");null!=q&&mxEvent.addListener(R,"click",mxUtils.bind(this,function(X){var ea=new mxPopupMenu(q.funct);ea.smartSeparators=!0;ea.showDisabled=!0;ea.autoExpand=
@@ -2313,23 +2314,23 @@ C(mxUtils.bind(this,function(X){null!=ia?window.location.href=ia:window.location
document.body))&&C(mxUtils.bind(this,function(X){"1"==urlParams.close||y.closeBtn?window.close():(this.destroy(),mxEvent.consume(X))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(X){mxEvent.isTouchEvent(X)||
(mxEvent.isShiftDown(X)||K(30),E())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(X){mxEvent.consume(X)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(X){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(X)?E():K(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(X){mxEvent.isShiftDown(X)?E():K(100);mxEvent.consume(X)}));mxEvent.addListener(this.chromelessToolbar,
"mouseleave",mxUtils.bind(this,function(X){mxEvent.isTouchEvent(X)||K(30)}));var Y=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(X,ea){this.startX=ea.getGraphX();this.startY=ea.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(X,ea){},mouseUp:function(X,ea){mxEvent.isTouchEvent(ea.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<Y&&Math.abs(this.scrollTop-b.container.scrollTop)<
-Y&&Math.abs(this.startX-ea.getGraphX())<Y&&Math.abs(this.startY-ea.getGraphY())<Y&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?E():K(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var aa=b.view.validate,ja=new mxPoint,ka=!1,ua=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&ua!=m.currentPage){ua=m.currentPage;ka=!0;var X=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,
+Y&&Math.abs(this.startX-ea.getGraphX())<Y&&Math.abs(this.startY-ea.getGraphY())<Y&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?E():K(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var aa=b.view.validate,ja=new mxPoint,la=!1,ua=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&ua!=m.currentPage){ua=m.currentPage;la=!0;var X=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,
!0);null==X&&(X=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));X=b.getPageLayout(X,ja,1);var ea=b.getDefaultTranslate(X);this.x0=X.x;this.y0=X.y;if(ea.x!=this.translate.x||ea.y!=this.translate.y)this.invalidate(),this.translate.x=ea.x,this.translate.y=ea.y}ea=b.getPagePadding();var oa=b.getPageSize();X=ea.x-(this.x0||0)*oa.width;ea=ea.y-(this.y0||0)*oa.height;if(this.translate.x!=X||this.translate.y!=ea)this.invalidate(),this.translate.x=X,this.translate.y=ea}aa.apply(this,
-arguments)};if(!b.isViewer()){var Da=b.sizeDidChange;b.sizeDidChange=function(){var X=ka;ka=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var ea=this.getPageLayout(),oa=this.getDefaultTranslate(ea),la=this.view.translate.x,ca=this.view.translate.y;if(oa.x!=la||oa.y!=ca){this.view.x0=ea.x;this.view.y0=ea.y;this.autoTranslate=!0;this.view.setTranslate(oa.x,oa.y);this.autoTranslate=!1;X||(this.container.scrollLeft+=Math.round((oa.x-
-la)*this.view.scale),this.container.scrollTop+=Math.round((oa.y-ca)*this.view.scale));return}}Da.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ha=b.view.getBackgroundPane(),k=b.view.getDrawPane();b.cumulativeZoomFactor=1;var u=null,H=null,P=null,T=null,W=null,fa=function(X){null!=u&&window.clearTimeout(u);0<=X&&window.setTimeout(function(){if(!b.isMouseDown||T)u=window.setTimeout(mxUtils.bind(this,function(){if(b.isFastZoomEnabled()){null!=
+arguments)};if(!b.isViewer()){var Da=b.sizeDidChange;b.sizeDidChange=function(){var X=la;la=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var ea=this.getPageLayout(),oa=this.getDefaultTranslate(ea),ka=this.view.translate.x,ba=this.view.translate.y;if(oa.x!=ka||oa.y!=ba){this.view.x0=ea.x;this.view.y0=ea.y;this.autoTranslate=!0;this.view.setTranslate(oa.x,oa.y);this.autoTranslate=!1;X||(this.container.scrollLeft+=Math.round((oa.x-
+ka)*this.view.scale),this.container.scrollTop+=Math.round((oa.y-ba)*this.view.scale));return}}Da.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ha=b.view.getBackgroundPane(),k=b.view.getDrawPane();b.cumulativeZoomFactor=1;var u=null,H=null,P=null,U=null,W=null,fa=function(X){null!=u&&window.clearTimeout(u);0<=X&&window.setTimeout(function(){if(!b.isMouseDown||U)u=window.setTimeout(mxUtils.bind(this,function(){if(b.isFastZoomEnabled()){null!=
b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform",null));k.style.transformOrigin="";ha.style.transformOrigin="";mxClient.IS_SF?(k.style.transform="scale(1)",ha.style.transform="scale(1)",window.setTimeout(function(){k.style.transform="";ha.style.transform=""},0)):(k.style.transform="",ha.style.transform="");b.view.getDecoratorPane().style.opacity=
-"";b.view.getOverlayPane().style.opacity="";for(var ea=b.container.querySelectorAll(".geHint"),oa=0;oa<ea.length;oa++)ea[oa].style.opacity=""}ea=new mxPoint(b.container.scrollLeft,b.container.scrollTop);var la=mxUtils.getOffset(b.container),ca=b.view.scale;oa=b.view.translate.x;var sa=b.view.translate.y,xa=0,qa=0;null!=H&&(xa=b.container.offsetWidth/2-H.x+la.x,qa=b.container.offsetHeight/2-H.y+la.y);var Ba=null==d&&mxUtils.hasScrollbars(b.container);b.zoom(b.cumulativeZoomFactor,Ba?!1:null,b.isFastZoomEnabled()?
-20:null,Ba);var ma=b.view.scale;ma!=ca&&(Ba?(ca=ma/ca,xa=null!=H?H.x-la.x:b.container.clientWidth/2,la=null!=H?H.y-la.y:b.container.clientHeight/2,null!=P&&(xa-=ea.x-P.x,la-=ea.y-P.y),b.container.scrollLeft=Math.round(ea.x*ca+xa*(ca-1)+(b.view.translate.x-oa)*ma),b.container.scrollTop=Math.round(ea.y*ca+la*(ca-1)+(b.view.translate.y-sa)*ma)):(null!=P&&(xa+=ea.x-P.x,qa+=ea.y-P.y),null!=d&&m.chromelessResize(!1,null,xa*(b.cumulativeZoomFactor-1),qa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||
-0==xa&&0==qa||(b.container.scrollLeft-=xa*(b.cumulativeZoomFactor-1),b.container.scrollTop-=qa*(b.cumulativeZoomFactor-1))));null!=W&&k.setAttribute("filter",W);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;W=T=H=P=u=null}),null!=X?X:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(X,ea,oa,la,ca){la=null!=la?la:this.zoomFactor;(ea=ea||!b.scrollbars)&&(H=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+
-b.container.clientHeight/2));ca?1!=la&&(X?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=la,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=la,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*
+"";b.view.getOverlayPane().style.opacity="";for(var ea=b.container.querySelectorAll(".geHint"),oa=0;oa<ea.length;oa++)ea[oa].style.opacity=""}ea=new mxPoint(b.container.scrollLeft,b.container.scrollTop);var ka=mxUtils.getOffset(b.container),ba=b.view.scale;oa=b.view.translate.x;var sa=b.view.translate.y,xa=0,qa=0;null!=H&&(xa=b.container.offsetWidth/2-H.x+ka.x,qa=b.container.offsetHeight/2-H.y+ka.y);var Ba=null==d&&mxUtils.hasScrollbars(b.container);b.zoom(b.cumulativeZoomFactor,Ba?!1:null,b.isFastZoomEnabled()?
+20:null,Ba);var ma=b.view.scale;ma!=ba&&(Ba?(ba=ma/ba,xa=null!=H?H.x-ka.x:b.container.clientWidth/2,ka=null!=H?H.y-ka.y:b.container.clientHeight/2,null!=P&&(xa-=ea.x-P.x,ka-=ea.y-P.y),b.container.scrollLeft=Math.round(ea.x*ba+xa*(ba-1)+(b.view.translate.x-oa)*ma),b.container.scrollTop=Math.round(ea.y*ba+ka*(ba-1)+(b.view.translate.y-sa)*ma)):(null!=P&&(xa+=ea.x-P.x,qa+=ea.y-P.y),null!=d&&m.chromelessResize(!1,null,xa*(b.cumulativeZoomFactor-1),qa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||
+0==xa&&0==qa||(b.container.scrollLeft-=xa*(b.cumulativeZoomFactor-1),b.container.scrollTop-=qa*(b.cumulativeZoomFactor-1))));null!=W&&k.setAttribute("filter",W);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;W=U=H=P=u=null}),null!=X?X:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(X,ea,oa,ka,ba){ka=null!=ka?ka:this.zoomFactor;(ea=ea||!b.scrollbars)&&(H=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+
+b.container.clientHeight/2));ba?1!=ka&&(X?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ka,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=ka,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*
100)/100/this.view.scale)):this.cumulativeZoomFactor=this.getZoomStep(this.view.scale*this.cumulativeZoomFactor,X)/this.view.scale;this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(b.isFastZoomEnabled()){null==W&&""!=k.getAttribute("filter")&&(W=k.getAttribute("filter"),k.removeAttribute("filter"));P=new mxPoint(b.container.scrollLeft,b.container.scrollTop);X=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/
-(20*this.view.scale);la=ea||null==H?b.container.scrollLeft+b.container.clientWidth/2:H.x+b.container.scrollLeft-b.container.offsetLeft;ca=ea||null==H?b.container.scrollTop+b.container.clientHeight/2:H.y+b.container.scrollTop-b.container.offsetTop;k.style.transformOrigin=la+"px "+ca+"px";k.style.transform="scale("+X+")";ha.style.transformOrigin=la+"px "+ca+"px";ha.style.transform="scale("+X+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(la=b.view.backgroundPageShape.node,
-mxUtils.setPrefixedStyle(la.style,"transform-origin",(ea||null==H?b.container.clientWidth/2+b.container.scrollLeft-la.offsetLeft+"px":H.x+b.container.scrollLeft-la.offsetLeft-b.container.offsetLeft+"px")+" "+(ea||null==H?b.container.clientHeight/2+b.container.scrollTop-la.offsetTop+"px":H.y+b.container.scrollTop-la.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(la.style,"transform","scale("+X+")")):b.view.validateBackgroundStyles(X,la,ca);b.view.getDecoratorPane().style.opacity="0";
-b.view.getOverlayPane().style.opacity="0";ea=b.container.querySelectorAll(".geHint");for(la=0;la<ea.length;la++)ea[la].style.opacity="0";b.fireEvent(new mxEventObject("zoomPreview","factor",X))}fa(b.isFastZoomEnabled()?oa:0)};mxEvent.addGestureListeners(b.container,function(X){null!=u&&window.clearTimeout(u)},null,function(X){1!=b.cumulativeZoomFactor&&fa(0)});mxEvent.addListener(b.container,"scroll",function(X){null==u||b.isMouseDown||1==b.cumulativeZoomFactor||fa(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,
-function(X,ea,oa,la,ca){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&!oa&&b.isScrollWheelEvent(X))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=X.deltaX?X.deltaX:0,deltaY:null!=X.deltaY?X.deltaY:ea?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!oa&&b.isScrollWheelEvent(X))la=b.view.getTranslate(),ca=40/b.view.scale,mxEvent.isShiftDown(X)?
-b.view.setTranslate(la.x+(ea?-ca:ca),la.y):b.view.setTranslate(la.x,la.y+(ea?ca:-ca));else if(oa||b.isZoomWheelEvent(X))for(var sa=mxEvent.getSource(X);null!=sa;){if(sa==b.container){b.tooltipHandler.hideTooltip();la=null!=la&&null!=ca?new mxPoint(la,ca):new mxPoint(mxEvent.getClientX(X),mxEvent.getClientY(X));ca=null!=H?new mxPoint(H.x,H.y):null;sa=b.cumulativeZoomFactor;H=la;T=oa;oa=b.zoomFactor;var xa=!1,qa=null;X.ctrlKey&&null!=X.deltaY&&40>Math.abs(X.deltaY)&&Math.round(X.deltaY)!=X.deltaY?(oa=
-1+Math.abs(X.deltaY)/20*(oa-1),xa=!0):null!=X.movementY&&"pointermove"==X.type&&(oa=1+Math.max(1,Math.abs(X.movementY))/20*(oa-1),xa=!0,qa=-1);b.lazyZoom(ea,null,qa,oa,xa);null!=ca&&1!=sa&&b.isFastZoomEnabled()&&b.scrollbars&&(ea=b.cumulativeZoomFactor,oa=ea/sa,xa=1-ea,.001<Math.abs(xa)&&(H=new mxPoint((la.x*(1-oa)+oa*ca.x*(1-sa))/xa,(la.y*(1-oa)+oa*ca.y*(1-sa))/xa),la=H.x+b.container.scrollLeft-b.container.offsetLeft,ca=H.y+b.container.scrollTop-b.container.offsetTop,k.style.transformOrigin=la+"px "+
-ca+"px",ha.style.transformOrigin=la+"px "+ca+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ea=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ea.style,"transform-origin",H.x+b.container.scrollLeft-ea.offsetLeft-b.container.offsetLeft+"px "+(H.y+b.container.scrollTop-ea.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*ea*100)/100*20)/(20*b.view.scale),la,ca)));mxEvent.consume(X);return!1}sa=sa.parentNode}}),
+(20*this.view.scale);ka=ea||null==H?b.container.scrollLeft+b.container.clientWidth/2:H.x+b.container.scrollLeft-b.container.offsetLeft;ba=ea||null==H?b.container.scrollTop+b.container.clientHeight/2:H.y+b.container.scrollTop-b.container.offsetTop;k.style.transformOrigin=ka+"px "+ba+"px";k.style.transform="scale("+X+")";ha.style.transformOrigin=ka+"px "+ba+"px";ha.style.transform="scale("+X+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ka=b.view.backgroundPageShape.node,
+mxUtils.setPrefixedStyle(ka.style,"transform-origin",(ea||null==H?b.container.clientWidth/2+b.container.scrollLeft-ka.offsetLeft+"px":H.x+b.container.scrollLeft-ka.offsetLeft-b.container.offsetLeft+"px")+" "+(ea||null==H?b.container.clientHeight/2+b.container.scrollTop-ka.offsetTop+"px":H.y+b.container.scrollTop-ka.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ka.style,"transform","scale("+X+")")):b.view.validateBackgroundStyles(X,ka,ba);b.view.getDecoratorPane().style.opacity="0";
+b.view.getOverlayPane().style.opacity="0";ea=b.container.querySelectorAll(".geHint");for(ka=0;ka<ea.length;ka++)ea[ka].style.opacity="0";b.fireEvent(new mxEventObject("zoomPreview","factor",X))}fa(b.isFastZoomEnabled()?oa:0)};mxEvent.addGestureListeners(b.container,function(X){null!=u&&window.clearTimeout(u)},null,function(X){1!=b.cumulativeZoomFactor&&fa(0)});mxEvent.addListener(b.container,"scroll",function(X){null==u||b.isMouseDown||1==b.cumulativeZoomFactor||fa(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,
+function(X,ea,oa,ka,ba){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&!oa&&b.isScrollWheelEvent(X))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=X.deltaX?X.deltaX:0,deltaY:null!=X.deltaY?X.deltaY:ea?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!oa&&b.isScrollWheelEvent(X))ka=b.view.getTranslate(),ba=40/b.view.scale,mxEvent.isShiftDown(X)?
+b.view.setTranslate(ka.x+(ea?-ba:ba),ka.y):b.view.setTranslate(ka.x,ka.y+(ea?ba:-ba));else if(oa||b.isZoomWheelEvent(X))for(var sa=mxEvent.getSource(X);null!=sa;){if(sa==b.container){b.tooltipHandler.hideTooltip();ka=null!=ka&&null!=ba?new mxPoint(ka,ba):new mxPoint(mxEvent.getClientX(X),mxEvent.getClientY(X));ba=null!=H?new mxPoint(H.x,H.y):null;sa=b.cumulativeZoomFactor;H=ka;U=oa;oa=b.zoomFactor;var xa=!1,qa=null;X.ctrlKey&&null!=X.deltaY&&40>Math.abs(X.deltaY)&&Math.round(X.deltaY)!=X.deltaY?(oa=
+1+Math.abs(X.deltaY)/20*(oa-1),xa=!0):null!=X.movementY&&"pointermove"==X.type&&(oa=1+Math.max(1,Math.abs(X.movementY))/20*(oa-1),xa=!0,qa=-1);b.lazyZoom(ea,null,qa,oa,xa);null!=ba&&1!=sa&&b.isFastZoomEnabled()&&b.scrollbars&&(ea=b.cumulativeZoomFactor,oa=ea/sa,xa=1-ea,.001<Math.abs(xa)&&(H=new mxPoint((ka.x*(1-oa)+oa*ba.x*(1-sa))/xa,(ka.y*(1-oa)+oa*ba.y*(1-sa))/xa),ka=H.x+b.container.scrollLeft-b.container.offsetLeft,ba=H.y+b.container.scrollTop-b.container.offsetTop,k.style.transformOrigin=ka+"px "+
+ba+"px",ha.style.transformOrigin=ka+"px "+ba+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ea=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(ea.style,"transform-origin",H.x+b.container.scrollLeft-ea.offsetLeft-b.container.offsetLeft+"px "+(H.y+b.container.scrollTop-ea.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*ea*100)/100*20)/(20*b.view.scale),ka,ba)));mxEvent.consume(X);return!1}sa=sa.parentNode}}),
b.container);b.panningHandler.zoomGraph=function(X){b.cumulativeZoomFactor=X.scale;b.lazyZoom(1<X.scale,!0,null,1,!0);mxEvent.consume(X)}};EditorUi.prototype.addChromelessToolbarItems=function(b){"1"!=urlParams.noPrint&&b(mxUtils.bind(this,function(d){this.actions.get("print").funct();mxEvent.consume(d)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};EditorUi.prototype.createTemporaryGraph=function(b){return Graph.createOffscreenGraph(b)};
EditorUi.prototype.addChromelessClickHandler=function(){var b=urlParams.highlight;null!=b&&0<b.length&&(b="#"+b);this.editor.graph.addClickHandler(b)};
EditorUi.prototype.toggleFormatPanel=function(b){b=null!=b?b:0==this.formatWidth;if(null!=this.format){var d=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.formatContainer.style,"transition","width "+d+"s ease-in-out");window.setTimeout(mxUtils.bind(this,function(){this.formatWidth=b?240:0;this.hsplitPosition=Math.min(this.container.clientWidth-this.hsplit.clientWidth-this.formatWidth,this.hsplitPosition);this.refresh();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.formatContainer.style,
@@ -2453,33 +2454,33 @@ d?b.push(d):0==b.length&&(m="")),0<b.length&&(m=b.join("; "))));return m};(funct
(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,p,t,n,y,C,O){var F=b.apply(this,arguments);if(null!=m){var N=F.getElementsByTagName("img");0<N.length&&(N[0].className="geButton")}return F}})();
Graph=function(b,d,m,p,t,n){mxGraph.call(this,b,d,m,p);this.themes=t||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!1;b=this.baseUrl;d=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=b.indexOf("/",d+2),0<d&&(this.domainUrl=b.substring(0,d)),d=b.lastIndexOf("/"),0<d&&(this.domainPathUrl=b.substring(0,d+1)));this.isHtmlLabel=function(ha){ha=this.getCurrentCellStyle(ha);
return null!=ha?"1"==ha.html||"wrap"==ha[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var y=null,C=null,O=null,F=null,N=!1,R=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(ha,k){if("mouseDown"==k.getProperty("eventName")&&this.isEnabled()){ha=k.getProperty("event");var u=ha.getState();k=this.view.scale;if(!mxEvent.isAltDown(ha.getEvent())&&null!=u&&(R=this.isCellSelected(u.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(ha.getEvent()))){var H=
-this.selectionCellsHandler.getHandler(u.cell);if(null==H||null==H.getHandleForEvent(ha)){var P=new mxRectangle(ha.getGraphX()-1,ha.getGraphY()-1),T=mxEvent.isTouchEvent(ha.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;H=T+2;P.grow(T);if(this.isTableCell(u.cell)&&this.isCellMovable(u.cell)&&!this.isCellSelected(u.cell)&&!(mxUtils.contains(u,ha.getGraphX()-H,ha.getGraphY()-H)&&mxUtils.contains(u,ha.getGraphX()-H,ha.getGraphY()+H)&&mxUtils.contains(u,ha.getGraphX()+
-H,ha.getGraphY()+H)&&mxUtils.contains(u,ha.getGraphX()+H,ha.getGraphY()-H))){var W=this.model.getParent(u.cell);H=this.model.getParent(W);if(!this.isCellSelected(H)){T*=k;var fa=2*T;if(this.model.getChildAt(H,0)!=W&&mxUtils.intersects(P,new mxRectangle(u.x,u.y-T,u.width,fa))||this.model.getChildAt(W,0)!=u.cell&&mxUtils.intersects(P,new mxRectangle(u.x-T,u.y,fa,u.height))||mxUtils.intersects(P,new mxRectangle(u.x,u.y+u.height-T,u.width,fa))||mxUtils.intersects(P,new mxRectangle(u.x+u.width-T,u.y,fa,
-u.height)))W=this.selectionCellsHandler.isHandled(H),this.selectCellForEvent(H,ha.getEvent()),H=this.selectionCellsHandler.getHandler(H),null!=H&&(T=H.getHandleForEvent(ha),null!=T&&(H.start(ha.getGraphX(),ha.getGraphY(),T),H.blockDelayedSelection=!W,ha.consume()))}}for(;!ha.isConsumed()&&null!=u&&(this.isTableCell(u.cell)||this.isTableRow(u.cell)||this.isTable(u.cell));)this.isSwimlane(u.cell)&&this.isCellMovable(u.cell)&&(H=this.getActualStartSize(u.cell),(0<H.x||0<H.width)&&mxUtils.intersects(P,
-new mxRectangle(u.x+(H.x-H.width-1)*k+(0==H.x?u.width:0),u.y,1,u.height))||(0<H.y||0<H.height)&&mxUtils.intersects(P,new mxRectangle(u.x,u.y+(H.y-H.height-1)*k+(0==H.y?u.height:0),u.width,1)))&&(this.selectCellForEvent(u.cell,ha.getEvent()),H=this.selectionCellsHandler.getHandler(u.cell),null!=H&&null!=H.customHandles&&(T=mxEvent.CUSTOM_HANDLE-H.customHandles.length+1,H.start(ha.getGraphX(),ha.getGraphY(),T),ha.consume())),u=this.view.getState(this.model.getParent(u.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,
+this.selectionCellsHandler.getHandler(u.cell);if(null==H||null==H.getHandleForEvent(ha)){var P=new mxRectangle(ha.getGraphX()-1,ha.getGraphY()-1),U=mxEvent.isTouchEvent(ha.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;H=U+2;P.grow(U);if(this.isTableCell(u.cell)&&this.isCellMovable(u.cell)&&!this.isCellSelected(u.cell)&&!(mxUtils.contains(u,ha.getGraphX()-H,ha.getGraphY()-H)&&mxUtils.contains(u,ha.getGraphX()-H,ha.getGraphY()+H)&&mxUtils.contains(u,ha.getGraphX()+
+H,ha.getGraphY()+H)&&mxUtils.contains(u,ha.getGraphX()+H,ha.getGraphY()-H))){var W=this.model.getParent(u.cell);H=this.model.getParent(W);if(!this.isCellSelected(H)){U*=k;var fa=2*U;if(this.model.getChildAt(H,0)!=W&&mxUtils.intersects(P,new mxRectangle(u.x,u.y-U,u.width,fa))||this.model.getChildAt(W,0)!=u.cell&&mxUtils.intersects(P,new mxRectangle(u.x-U,u.y,fa,u.height))||mxUtils.intersects(P,new mxRectangle(u.x,u.y+u.height-U,u.width,fa))||mxUtils.intersects(P,new mxRectangle(u.x+u.width-U,u.y,fa,
+u.height)))W=this.selectionCellsHandler.isHandled(H),this.selectCellForEvent(H,ha.getEvent()),H=this.selectionCellsHandler.getHandler(H),null!=H&&(U=H.getHandleForEvent(ha),null!=U&&(H.start(ha.getGraphX(),ha.getGraphY(),U),H.blockDelayedSelection=!W,ha.consume()))}}for(;!ha.isConsumed()&&null!=u&&(this.isTableCell(u.cell)||this.isTableRow(u.cell)||this.isTable(u.cell));)this.isSwimlane(u.cell)&&this.isCellMovable(u.cell)&&(H=this.getActualStartSize(u.cell),(0<H.x||0<H.width)&&mxUtils.intersects(P,
+new mxRectangle(u.x+(H.x-H.width-1)*k+(0==H.x?u.width:0),u.y,1,u.height))||(0<H.y||0<H.height)&&mxUtils.intersects(P,new mxRectangle(u.x,u.y+(H.y-H.height-1)*k+(0==H.y?u.height:0),u.width,1)))&&(this.selectCellForEvent(u.cell,ha.getEvent()),H=this.selectionCellsHandler.getHandler(u.cell),null!=H&&null!=H.customHandles&&(U=mxEvent.CUSTOM_HANDLE-H.customHandles.length+1,H.start(ha.getGraphX(),ha.getGraphY(),U),ha.consume())),u=this.view.getState(this.model.getParent(u.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,
mxUtils.bind(this,function(ha,k){if("mouseDown"==k.getProperty("eventName")&&this.isEnabled()){ha=k.getProperty("event");var u=ha.getState();mxEvent.isAltDown(ha.getEvent())||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k)||R||null==u||!this.model.isEdge(u.cell)||(y=new mxPoint(ha.getGraphX(),ha.getGraphY()),N=this.isCellSelected(u.cell),O=u,C=ha,null!=u.text&&null!=u.text.boundingBox&&mxUtils.contains(u.text.boundingBox,ha.getGraphX(),ha.getGraphY())?F=mxEvent.LABEL_HANDLE:(k=this.selectionCellsHandler.getHandler(u.cell),
null!=k&&null!=k.bends&&0<k.bends.length&&(F=k.getHandleForEvent(ha))))}}));this.addMouseListener({mouseDown:function(ha,k){},mouseMove:mxUtils.bind(this,function(ha,k){ha=this.selectionCellsHandler.handlers.map;for(var u in ha)if(null!=ha[u].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(k.getEvent())){var H=this.tolerance;if(null!=y&&null!=O&&null!=C){if(u=O,null!=F||Math.abs(y.x-k.getGraphX())>H||Math.abs(y.y-k.getGraphY())>H){var P=null;mxEvent.isShiftDown(k.getEvent())||
-(P=this.selectionCellsHandler.getHandler(u.cell));if(null!=P&&null!=P.bends&&0<P.bends.length){P.redrawHandles();var T=null!=F?F:P.getHandleForEvent(C),W=this.view.getEdgeStyle(u),fa=W==mxEdgeStyle.EntityRelation;H=u.absolutePoints;N||(T=F);T!=mxEvent.LABEL_HANDLE&&null!=H&&(T=F,null==T&&(ha=new mxRectangle(y.x,y.y),ha.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(ha,H[0].x,H[0].y)?T=0:mxUtils.contains(ha,H[H.length-1].x,H[H.length-1].y)?T=P.bends.length-1:null!=H&&(null==W&&
-null==T||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&(null!=W&&(2==H.length||3==H.length&&(0==Math.round(H[0].x-H[1].x)&&0==Math.round(H[1].x-H[2].x)||0==Math.round(H[0].y-H[1].y)&&0==Math.round(H[1].y-H[2].y)))?T=2:(T=mxUtils.findNearestSegment(u,y.x,y.y),T=null==W?mxEvent.VIRTUAL_HANDLE-T:T+1))),null==T&&(T=mxEvent.VIRTUAL_HANDLE));ha=T==mxEvent.LABEL_HANDLE||0==T||T==P.bends.length-1;if(!fa&&(null!=u.visibleSourceState||null!=u.visibleTargetState)||ha)P.start(k.getGraphX(),
-k.getGraphX(),T),k.consume(),this.graphHandler.reset()}null!=P&&(this.selectionCellsHandler.isHandlerActive(P)?this.isCellSelected(u.cell)||(this.selectionCellsHandler.handlers.put(u.cell,P),this.selectCellForEvent(u.cell,k.getEvent())):this.isCellSelected(u.cell)||P.destroy());N=!1;y=C=O=F=null}}else if(u=k.getState(),null!=u&&this.isCellEditable(u.cell)){ha=this.model.getParent(u.cell);P=null;if(this.model.isEdge(u.cell)&&!this.isCellSelected(u.cell)&&!mxEvent.isAltDown(k.getEvent())&&!mxEvent.isShiftDown(k.getEvent())&&
+(P=this.selectionCellsHandler.getHandler(u.cell));if(null!=P&&null!=P.bends&&0<P.bends.length){P.redrawHandles();var U=null!=F?F:P.getHandleForEvent(C),W=this.view.getEdgeStyle(u),fa=W==mxEdgeStyle.EntityRelation;H=u.absolutePoints;N||(U=F);U!=mxEvent.LABEL_HANDLE&&null!=H&&(U=F,null==U&&(ha=new mxRectangle(y.x,y.y),ha.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(ha,H[0].x,H[0].y)?U=0:mxUtils.contains(ha,H[H.length-1].x,H[H.length-1].y)?U=P.bends.length-1:null!=H&&(null==W&&
+null==U||W==mxEdgeStyle.SegmentConnector||W==mxEdgeStyle.OrthConnector)&&(null!=W&&(2==H.length||3==H.length&&(0==Math.round(H[0].x-H[1].x)&&0==Math.round(H[1].x-H[2].x)||0==Math.round(H[0].y-H[1].y)&&0==Math.round(H[1].y-H[2].y)))?U=2:(U=mxUtils.findNearestSegment(u,y.x,y.y),U=null==W?mxEvent.VIRTUAL_HANDLE-U:U+1))),null==U&&(U=mxEvent.VIRTUAL_HANDLE));ha=U==mxEvent.LABEL_HANDLE||0==U||U==P.bends.length-1;if(!fa&&(null!=u.visibleSourceState||null!=u.visibleTargetState)||ha)P.start(k.getGraphX(),
+k.getGraphX(),U),k.consume(),this.graphHandler.reset()}null!=P&&(this.selectionCellsHandler.isHandlerActive(P)?this.isCellSelected(u.cell)||(this.selectionCellsHandler.handlers.put(u.cell,P),this.selectCellForEvent(u.cell,k.getEvent())):this.isCellSelected(u.cell)||P.destroy());N=!1;y=C=O=F=null}}else if(u=k.getState(),null!=u&&this.isCellEditable(u.cell)){ha=this.model.getParent(u.cell);P=null;if(this.model.isEdge(u.cell)&&!this.isCellSelected(u.cell)&&!mxEvent.isAltDown(k.getEvent())&&!mxEvent.isShiftDown(k.getEvent())&&
!this.isAncestorSelected(u.cell)&&(this.isSwimlane(ha)||this.model.isLayer(ha)||this.getCurrentRoot()==ha)){if(ha=new mxRectangle(k.getGraphX(),k.getGraphY()),ha.grow(mxEdgeHandler.prototype.handleImage.width/2),H=u.absolutePoints,null!=H)null!=u.text&&null!=u.text.boundingBox&&mxUtils.contains(u.text.boundingBox,k.getGraphX(),k.getGraphY())?P="move":mxUtils.contains(ha,H[0].x,H[0].y)||mxUtils.contains(ha,H[H.length-1].x,H[H.length-1].y)?P="pointer":(W=this.view.getEdgeStyle(u),W==mxEdgeStyle.EntityRelation||
null==u.visibleSourceState&&null==u.visibleTargetState||(P="crosshair",W!=mxEdgeStyle.SegmentConnector&&W!=mxEdgeStyle.OrthConnector))||(k=mxUtils.findNearestSegment(u,k.getGraphX(),k.getGraphY()),k<H.length-1&&0<=k&&(P=0==Math.round(H[k].x-H[k+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(k.getEvent())){H=mxShape.prototype.svgStrokeTolerance/2;ha=new mxRectangle(k.getGraphX(),k.getGraphY());ha.grow(H);if(this.isTableCell(u.cell)&&this.isCellMovable(u.cell)&&(k=this.model.getParent(u.cell),
H=this.model.getParent(k),!this.isCellSelected(H)))if(mxUtils.intersects(ha,new mxRectangle(u.x,u.y-2,u.width,4))&&this.model.getChildAt(H,0)!=k||mxUtils.intersects(ha,new mxRectangle(u.x,u.y+u.height-2,u.width,4)))P="row-resize";else if(mxUtils.intersects(ha,new mxRectangle(u.x-2,u.y,4,u.height))&&this.model.getChildAt(k,0)!=u.cell||mxUtils.intersects(ha,new mxRectangle(u.x+u.width-2,u.y,4,u.height)))P="col-resize";for(k=u;null==P&&null!=k&&(this.isTableCell(k.cell)||this.isTableRow(k.cell)||this.isTable(k.cell));)this.isSwimlane(k.cell)&&
-this.isCellMovable(k.cell)&&(H=this.getActualStartSize(k.cell),T=this.view.scale,(0<H.x||0<H.width)&&mxUtils.intersects(ha,new mxRectangle(k.x+(H.x-H.width-1)*T+(0==H.x?k.width*T:0),k.y,1,k.height))?P="col-resize":(0<H.y||0<H.height)&&mxUtils.intersects(ha,new mxRectangle(k.x,k.y+(H.y-H.height-1)*T+(0==H.y?k.height:0),k.width,1))&&(P="row-resize")),k=this.view.getState(this.model.getParent(k.cell))}null!=P&&u.setCursor(P)}}}),mouseUp:mxUtils.bind(this,function(ha,k){F=y=C=O=null})})}this.cellRenderer.minSvgStrokeWidth=
+this.isCellMovable(k.cell)&&(H=this.getActualStartSize(k.cell),U=this.view.scale,(0<H.x||0<H.width)&&mxUtils.intersects(ha,new mxRectangle(k.x+(H.x-H.width-1)*U+(0==H.x?k.width*U:0),k.y,1,k.height))?P="col-resize":(0<H.y||0<H.height)&&mxUtils.intersects(ha,new mxRectangle(k.x,k.y+(H.y-H.height-1)*U+(0==H.y?k.height:0),k.width,1))&&(P="row-resize")),k=this.view.getState(this.model.getParent(k.cell))}null!=P&&u.setCursor(P)}}}),mouseUp:mxUtils.bind(this,function(ha,k){F=y=C=O=null})})}this.cellRenderer.minSvgStrokeWidth=
.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=function(ha){var k=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);ha.view.graph.isHtmlLabel(ha.cell)&&("0"==mxUtils.getValue(ha.style,"html","0")?k=mxUtils.htmlEntities(k,!1):(ha.lastLabelValue!=k&&(ha.lastLabelValue=k,ha.lastSanitizedLabelValue=Graph.sanitizeHtml(k),c.innerHTML=ha.lastSanitizedLabelValue,Graph.addLightDarkColors(c,null,"simple"==ha.view.graph.getAdaptiveColors())&&(ha.lastSanitizedLabelValue=c.innerHTML)),
k=ha.lastSanitizedLabelValue));return k};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(ha,
-k){return!1};this.alternateEdgeStyle="vertical";null==p&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var ha=f.apply(this,arguments);if(this.graph.pageVisible){var k=this.graph.pageFormat,u=this.graph.pageScale,H=k.width*u;k=k.height*u;u=this.graph.view.translate;var P=this.graph.view.scale;if(Math.min(H,k)*P>this.graph.minPageBreakDist){var T=this.graph.getPageLayout(),W=this.graph.container,fa=0,X=T.width,ea=1,oa=T.height;if(null!=W){ea=
-(W.scrollLeft-W.clientWidth)/P-u.x;var la=(W.scrollTop-W.clientHeight)/P-u.y;fa=Math.max(0,Math.floor(ea/H)-T.x);X=Math.min(X,Math.ceil((ea+3*W.clientWidth/P)/H)-T.x);ea=Math.max(1,Math.floor(la/k)-T.y);oa=Math.min(oa,Math.ceil((la+3*W.clientHeight/P)/k)-T.y)}for(W=[];fa<X;fa++)W.push(new mxRectangle(((T.x+fa)*H+u.x)*P,(T.y*k+u.y)*P,H*P,k*P));for(X=ea;X<oa;X++)W.push(new mxRectangle((T.x*H+u.x)*P,((T.y+X)*k+u.y)*P,H*P,k*P));ha=W.concat(ha)}}return ha};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;
-mxGuide.prototype.getGuideColor=function(ha,k){return null==ha.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(ha){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var l=this.graphHandler.getCells;this.graphHandler.getCells=function(ha){for(var k=l.apply(this,arguments),u=new mxDictionary,H=[],P=0;P<k.length;P++){var T=this.graph.isTableCell(ha)&&
-this.graph.isTableCell(k[P])&&this.graph.isCellSelected(k[P])?this.graph.model.getParent(k[P]):this.graph.isTableRow(ha)&&this.graph.isTableRow(k[P])&&this.graph.isCellSelected(k[P])?k[P]:this.graph.getCompositeParent(k[P]);null==T||u.get(T)||(u.put(T,!0),H.push(T))}return H};var q=this.graphHandler.start;this.graphHandler.start=function(ha,k,u,H){var P=!1;this.graph.isTableCell(ha)&&(this.graph.isCellSelected(ha)?P=!0:ha=this.graph.model.getParent(ha));P||this.graph.isTableRow(ha)&&this.graph.isCellSelected(ha)||
-(ha=this.graph.getCompositeParent(ha));q.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(ha,k){k=this.graph.getCompositeParent(k);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(ha,k,u,H,P,T){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=H&&this.graph.applyNewEdgeStyle(H,[W]);return W};var x=new mxRubberband(this);this.getRubberband=function(){return x};var A=(new Date).getTime(),
+k){return!1};this.alternateEdgeStyle="vertical";null==p&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var ha=f.apply(this,arguments);if(this.graph.pageVisible){var k=this.graph.pageFormat,u=this.graph.pageScale,H=k.width*u;k=k.height*u;u=this.graph.view.translate;var P=this.graph.view.scale;if(Math.min(H,k)*P>this.graph.minPageBreakDist){var U=this.graph.getPageLayout(),W=this.graph.container,fa=0,X=U.width,ea=1,oa=U.height;if(null!=W){ea=
+(W.scrollLeft-W.clientWidth)/P-u.x;var ka=(W.scrollTop-W.clientHeight)/P-u.y;fa=Math.max(0,Math.floor(ea/H)-U.x);X=Math.min(X,Math.ceil((ea+3*W.clientWidth/P)/H)-U.x);ea=Math.max(1,Math.floor(ka/k)-U.y);oa=Math.min(oa,Math.ceil((ka+3*W.clientHeight/P)/k)-U.y)}for(W=[];fa<X;fa++)W.push(new mxRectangle(((U.x+fa)*H+u.x)*P,(U.y*k+u.y)*P,H*P,k*P));for(X=ea;X<oa;X++)W.push(new mxRectangle((U.x*H+u.x)*P,((U.y+X)*k+u.y)*P,H*P,k*P));ha=W.concat(ha)}}return ha};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;
+mxGuide.prototype.getGuideColor=function(ha,k){return null==ha.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(ha){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var l=this.graphHandler.getCells;this.graphHandler.getCells=function(ha){for(var k=l.apply(this,arguments),u=new mxDictionary,H=[],P=0;P<k.length;P++){var U=this.graph.isTableCell(ha)&&
+this.graph.isTableCell(k[P])&&this.graph.isCellSelected(k[P])?this.graph.model.getParent(k[P]):this.graph.isTableRow(ha)&&this.graph.isTableRow(k[P])&&this.graph.isCellSelected(k[P])?k[P]:this.graph.getCompositeParent(k[P]);null==U||u.get(U)||(u.put(U,!0),H.push(U))}return H};var q=this.graphHandler.start;this.graphHandler.start=function(ha,k,u,H){var P=!1;this.graph.isTableCell(ha)&&(this.graph.isCellSelected(ha)?P=!0:ha=this.graph.model.getParent(ha));P||this.graph.isTableRow(ha)&&this.graph.isCellSelected(ha)||
+(ha=this.graph.getCompositeParent(ha));q.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(ha,k){k=this.graph.getCompositeParent(k);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(ha,k,u,H,P,U){var W=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=H&&this.graph.applyNewEdgeStyle(H,[W]);return W};var x=new mxRubberband(this);this.getRubberband=function(){return x};var A=(new Date).getTime(),
E=0,K=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var ha=this.currentState;K.apply(this,arguments);ha!=this.currentState?(A=(new Date).getTime(),E=0):E=(new Date).getTime()-A};var Q=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(ha){if(mxEvent.isShiftDown(ha.getEvent())&&mxEvent.isAltDown(ha.getEvent()))return!1;var k=null!=this.currentState?mxUtils.getValue(this.currentState.style,"outlineConnect","1"):"1";return"3"==
k?!1:null!=this.currentState&&ha.getState()==this.currentState&&("2"==k||2E3<E)||(null==this.currentState||"0"!=k)&&Q.apply(this,arguments)};var V=this.isToggleEvent;this.isToggleEvent=function(ha){return V.apply(this,arguments)||mxEvent.isShiftDown(ha)};var J=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(J=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&
(this.container.style.cursor=J)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(ha){return mxEvent.isMouseEvent(ha.getEvent())};var ia=this.click;this.click=function(ha){var k=null==ha.state&&null!=ha.sourceState&&this.isCellLocked(this.getLayerForCell(ha.sourceState.cell));if(this.isEnabled()&&!k||ha.isConsumed())return ia.apply(this,arguments);var u=k?ha.sourceState.cell:ha.getCell();if(null!=u){var H=this.getClickableLinkForCell(u);null!=H?this.isCustomLink(H)?
this.customLinkClicked(H,u):this.openLink(H):k&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(ha){return ha.sourceState};var Y=this.tooltipHandler.show;this.tooltipHandler.show=function(){Y.apply(this,arguments);if(null!=this.div)for(var ha=this.div.getElementsByTagName("a"),k=0;k<ha.length;k++)null!=ha[k].getAttribute("href")&&null==ha[k].getAttribute("target")&&ha[k].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(ha){return ha.sourceState};
this.getCursorForMouseEvent=function(ha){var k=null==ha.state&&null!=ha.sourceState&&this.isCellLocked(ha.sourceState.cell);return this.getCursorForCell(k?ha.sourceState.cell:ha.getCell())};var aa=this.getCursorForCell;this.getCursorForCell=function(ha){if(!this.isEnabled()||this.isCellLocked(ha)){if(null!=this.getClickableLinkForCell(ha))return"pointer";if(this.isCellLocked(ha))return"default"}return aa.apply(this,arguments)};this.selectRegion=function(ha,k){var u=Graph.intersectionSelect||mxEvent.isAltDown(k)?
-ha:null;ha=this.getCells(ha.x,ha.y,ha.width,ha.height,null,null,u,null,!0);if(null!=ha&&0<ha.length){u=new mxDictionary;for(var H=[],P=0;P<ha.length;P++){var T=this.getLockedGroupAncestor(this.model.getParent(ha[P]));T=null!=T?T:ha[P];u.get(T)||(u.put(T,!0),H.push(T))}ha=H}if(this.isToggleEvent(k))for(P=0;P<ha.length;P++)this.selectCellForEvent(ha[P],k);else this.selectCellsForEvent(ha,k);return ha};var ja=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=
-function(ha,k,u){return this.graph.isCellSelected(ha)||this.graph.isTransparentBounds(ha)?!1:ja.apply(this,arguments)};var ka=this.updateMouseEvent;this.updateMouseEvent=function(ha){ha=ka.apply(this,arguments);null!=ha.state&&this.isCellLocked(this.getLayerForCell(ha.getCell()))&&(null==this.getLinkForCell(ha.getCell())?ha.state=this.view.getState(this.getCellAt(ha.getGraphX(),ha.getGraphY(),null,null,null,mxUtils.bind(this,function(k,u,H){return ha.state==k||this.isCellLocked(this.getLayerForCell(k.cell))&&
+ha:null;ha=this.getCells(ha.x,ha.y,ha.width,ha.height,null,null,u,null,!0);if(null!=ha&&0<ha.length){u=new mxDictionary;for(var H=[],P=0;P<ha.length;P++){var U=this.getLockedGroupAncestor(this.model.getParent(ha[P]));U=null!=U?U:ha[P];u.get(U)||(u.put(U,!0),H.push(U))}ha=H}if(this.isToggleEvent(k))for(P=0;P<ha.length;P++)this.selectCellForEvent(ha[P],k);else this.selectCellsForEvent(ha,k);return ha};var ja=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=
+function(ha,k,u){return this.graph.isCellSelected(ha)||this.graph.isTransparentBounds(ha)?!1:ja.apply(this,arguments)};var la=this.updateMouseEvent;this.updateMouseEvent=function(ha){ha=la.apply(this,arguments);null!=ha.state&&this.isCellLocked(this.getLayerForCell(ha.getCell()))&&(null==this.getLinkForCell(ha.getCell())?ha.state=this.view.getState(this.getCellAt(ha.getGraphX(),ha.getGraphY(),null,null,null,mxUtils.bind(this,function(k,u,H){return ha.state==k||this.isCellLocked(this.getLayerForCell(k.cell))&&
null==this.getLinkForCell(k.cell)}))):ha.state=null);return ha};var ua=this.isCellSelectable;this.isCellSelectable=function(ha){return null!=ha&&null!=this.getLockedGroupAncestor(this.model.getParent(ha))?!1:ua.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(ha))};this.isCellLocked=function(ha){for(;null!=ha;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(ha),"locked","0"))return!0;ha=this.model.getParent(ha)}return!1};var Da=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,
function(ha,k){"mouseDown"==k.getProperty("eventName")&&(ha=k.getProperty("event").getState(),Da=null==ha||this.isSelectionEmpty()||this.isCellSelected(ha.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(ha,k){if(!mxEvent.isMultiTouchEvent(k)){ha=k.getProperty("event");var u=k.getProperty("cell");null==u?(ha=mxUtils.convertPoint(this.container,mxEvent.getClientX(ha),mxEvent.getClientY(ha)),x.start(ha.x,ha.y)):null!=Da?this.addSelectionCells(Da):
1<this.getSelectionCount()&&this.isCellSelected(u)&&this.removeSelectionCell(u);Da=null;k.consume()}}));this.connectionHandler.selectCells=function(ha,k){this.graph.setSelectionCell(k||ha)};this.connectionHandler.constraintHandler.isStateIgnored=function(ha,k){var u=ha.view.graph;return k&&(u.isCellSelected(ha.cell)||u.isTableRow(ha.cell)&&u.selectionCellsHandler.isHandled(u.model.getParent(ha.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var ha=this.connectionHandler.constraintHandler;
@@ -2521,8 +2522,8 @@ c.referenceCell||c;R.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.page
E.push(A[K]);E=A=E;if(null!=c.startIndex||0<pageSize&&A.length>pageSize){var Q=c.startIndex||0;E=A.slice(Math.max(0,Q),Math.min(A.length,Q+pageSize))}E=p.getOpposites(E,x).concat(E);var V=R.cloneCells(E);for(K=0;K<E.length;K++)if(V[K].sourceCellId=E[K].id,R.model.isEdge(V[K]))for(V[K].geometry.x=0,V[K].geometry.y=0,V[K].geometry.points=null,V[K].setStyle(V[K].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),V[K].setTerminal(q,
null==V[K].getTerminal(!0)),x=0;x<V[K].getChildCount();x++){var J=V[K].getChildAt(x);null!=J.geometry&&J.geometry.relative&&(J.setStyle(J.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),J.geometry.offset=new mxPoint(0,0),J.geometry.y=0,J.geometry.x=.5>J.geometry.x?-.8:.5<J.geometry.x?.8:0)}if(0<c.startIndex){var ia=R.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(A.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");
ia.referenceCell=q;ia.startIndex=Math.max(0,(c.startIndex||0)-pageSize);V.splice(0,0,ia)}if(A.length>(c.startIndex||0)+pageSize){var Y=R.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(A.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");Y.referenceCell=q;Y.startIndex=(c.startIndex||0)+pageSize;V.splice(0,0,Y)}for(var aa in R.getModel().cells){var ja=R.getModel().getCell(aa);ja!=R.rootCell&&
-!R.getModel().isAncestor(R.rootCell,ja)&&R.getModel().isVertex(ja)&&R.removeCells([ja])}R.addCells(V);var ka=R.getModel().getGeometry(R.rootCell);null!=ka&&(ka=ka.clone(),ka.x=f-ka.width/2,ka.y=l-ka.height/3,R.getModel().setGeometry(R.rootCell,ka));c=[];for(aa in R.getModel().cells)ja=R.getModel().getCell(aa),ja!=R.rootCell&&R.getModel().isVertex(ja)&&R.getModel().getParent(ja)==R.getDefaultParent()&&(c.push(ja),ka=R.getModel().getGeometry(ja),null!=ka&&(ka.x=f-ka.width/2,ka.y=l-ka.height/2));var ua=
-c.length,Da=2*Math.PI/ua,ha=Math.max(minSize,Math.min(R.container.offsetWidth/2-40,R.container.offsetHeight/2-80));for(f=0;f<ua;f++)ka=R.getModel().getGeometry(c[f]),null!=ka&&(ka=ka.clone(),ka.x+=ha*Math.sin(f*Da),ka.y+=ha*Math.cos(f*Da),R.getModel().setGeometry(c[f],ka))}finally{R.getModel().endUpdate()}}}var C=document.createElement("div");C.style.position="absolute";C.style.display="block";C.style.overflow="auto";C.style.width="100%";C.style.height="100%";C.style.left="0px";C.style.top="0px";
+!R.getModel().isAncestor(R.rootCell,ja)&&R.getModel().isVertex(ja)&&R.removeCells([ja])}R.addCells(V);var la=R.getModel().getGeometry(R.rootCell);null!=la&&(la=la.clone(),la.x=f-la.width/2,la.y=l-la.height/3,R.getModel().setGeometry(R.rootCell,la));c=[];for(aa in R.getModel().cells)ja=R.getModel().getCell(aa),ja!=R.rootCell&&R.getModel().isVertex(ja)&&R.getModel().getParent(ja)==R.getDefaultParent()&&(c.push(ja),la=R.getModel().getGeometry(ja),null!=la&&(la.x=f-la.width/2,la.y=l-la.height/2));var ua=
+c.length,Da=2*Math.PI/ua,ha=Math.max(minSize,Math.min(R.container.offsetWidth/2-40,R.container.offsetHeight/2-80));for(f=0;f<ua;f++)la=R.getModel().getGeometry(c[f]),null!=la&&(la=la.clone(),la.x+=ha*Math.sin(f*Da),la.y+=ha*Math.cos(f*Da),R.getModel().setGeometry(c[f],la))}finally{R.getModel().endUpdate()}}}var C=document.createElement("div");C.style.position="absolute";C.style.display="block";C.style.overflow="auto";C.style.width="100%";C.style.height="100%";C.style.left="0px";C.style.top="0px";
C.style.zIndex=2;C.style.background=p.background==mxConstants.NONE||null==p.background?Editor.getDefaultPageBackgroundColor():p.background;var O=document.createElement("img");O.setAttribute("src",Editor.closeBlackImage);O.style.position="absolute";O.style.cursor="pointer";O.style.right="10px";O.style.top="10px";C.appendChild(O);var F=document.createElement("div");F.style.position="absolute";F.style.cursor="pointer";F.style.right="38px";F.style.top="14px";F.style.textAlign="right";F.style.verticalAlign=
"top";mxUtils.write(F,mxResources.get("close"));C.appendChild(F);document.body.appendChild(C);var N=function(R){27==R.keyCode&&O.click()};mxEvent.addListener(document,"keydown",N);(function(R){var c=new Graph(R);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(E){return this.model.isVertex(E)?"pointer":null};c.getFoldingImage=function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",N);R.parentNode.removeChild(R);
p.scrollCellToVisible(t)};mxEvent.addListener(O,"click",f);mxEvent.addListener(F,"click",f);c.setEnabled(!1);var l=c.click;c.click=function(E){var K=E.getCell(),Q=null!=K?null!=K.referenceCell?K.referenceCell:K:null;null!=K&&0<c.getEdges(Q).length?y(c,K):l.apply(this,arguments)};f=c.container.offsetWidth/2;var q=c.container.offsetHeight/3;c.model.beginUpdate();var x=c.importCells([t])[0];x.sourceCellId=t.id;x.geometry.x=f-x.geometry.width/2;x.geometry.y=q-x.geometry.height/2;c.model.endUpdate();var A=
@@ -2598,11 +2599,11 @@ Graph.prototype.measureShapeInsideFlow=function(b,d,m,p,t,n,y,C,O){var F=null;if
0));N.style.width=p.width+"px";N.style.fontFamily=mxUtils.getValue(d,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);N.style.fontSize=Math.round(C)+"px";N.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?C*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;N.style.fontWeight=(R&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"normal";N.style.fontStyle=(R&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"";N.style.textAlign=
mxUtils.getValue(d,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);N.style.whiteSpace="normal";N.style.wordWrap=mxConstants.WORD_WRAP;N.innerHTML=this.createShapeInsideMarkup(m,p,t,n,y,this.getShapeInsidePadding(d),O)+b;b=N.getBoundingClientRect();y=document.createTreeWalker(N,NodeFilter.SHOW_TEXT,null);p=m=d=null;for(t=[];y.nextNode();)for(n=document.createRange(),n.selectNodeContents(y.currentNode),C=n.getClientRects(),n=0;n<C.length;n++)0<C[n].width&&0<C[n].height&&(d=null==d?C[n].top:Math.min(d,
C[n].top),m=null==m?C[n].bottom:Math.max(m,C[n].bottom),p=null==p?C[n].right:Math.max(p,C[n].right),t.push([C[n].top-b.top,C[n].bottom-b.top]));if(null!=d){t.sort(function(c,f){return c[0]-f[0]});F=[];for(n=0;n<t.length;n++)y=0<F.length?F[F.length-1]:null,null!=y&&t[n][0]<y[1]-2?y[1]=Math.max(y[1],t[n][1]):F.push(t[n]);F={top:d-b.top,bottom:m-b.top,right:p-b.left,lines:F}}N.innerHTML=""}return F};
-Graph.prototype.computeShapeInsideSpacer=function(b,d,m,p,t,n){var y=mxUtils.getValue(d,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),C=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE))*mxConstants.LINE_HEIGHT,O=y!=mxConstants.ALIGN_BOTTOM,F=this,N=null,R=0;if(y!=mxConstants.ALIGN_TOP){var c=function(J,ia,Y){var aa=null;if(null!=J)for(var ja=0;ja<J.length;ja++){var ka=J[ja],ua=J[(ja+1)%J.length];ka[1]!=ua[1]&&ia>=Math.min(ka[1],ua[1])&&ia<=Math.max(ka[1],
-ua[1])&&(ka=ka[0]+(ua[0]-ka[0])*(ia-ka[1])/(ua[1]-ka[1]),aa=null==aa?ka:Y?Math.max(aa,ka):Math.min(aa,ka))}return aa};R=c(m.left,.999,!0);c=c(m.right,.999,!1);var f=24<=((null==c?1:c)-(null==R?0:R))*t;R=function(J){for(var ia=null,Y=[],aa=null,ja=null,ka=function(P){var T=F.measureShapeInsideFlow(b,d,m,p,P,t,n);if(null==T)return null;var W=Math.min(0,P),fa=T.top+W;W=T.bottom+W;null==N&&(N=W-fa);var X=N>p.height,ea=W<=p.height+.5&&(J||-.5<=fa),oa=null;J?X?oa=Math.abs(p.height-W):0<=P&&(oa=ea?p.height-
-W:f?1.5*(W-p.height):null):oa=ea?Math.abs(fa-(p.height-W)):Math.abs(fa+W-p.height);var la=!J||X;null!=oa&&(null==ia||la&&ea&&!ia.fits||(!la||ea==ia.fits)&&oa<ia.score)&&(ia={spacer:P,score:oa,fits:ea});P={spacer:P,top:fa,btm:W,overflow:X,lines:T.lines.length};Y.push(P);return P},ua=function(){return null!=ia&&ia.fits&&1>=ia.score},Da=0,ha=0;ha<(J?8:5);ha++){var k=ka(Da);if(null==k)return null;if(ua())break;var u=J?Da+p.height-k.btm:Da+(p.height-k.top-k.btm)/2;if(J){if(k.btm<=p.height+.5)aa=null==
-aa?Da:Math.max(aa,Da);else if(null==aa||Da>aa)ja=null==ja?Da:Math.min(ja,Da);null!=aa&&null!=ja&&1<ja-aa&&(u=(aa+ja)/2);k.overflow||(u=Math.max(0,u))}if(Math.round(u)==Math.round(Da))break;Da=u}if(!J&&!ua())for(aa=function(P,T){return P.lines==T.lines&&1>=Math.abs(T.btm-T.top-(P.btm-P.top))},ja=Y.slice().sort(function(P,T){return P.spacer-T.spacer}),Da=8,ha=0;ha<ja.length-1&&0<Da&&!ua();ha++)for(k=ja[ha],u=ja[ha+1];0<Da&&!ua()&&!aa(k,u)&&1<u.spacer-k.spacer;){var H=Math.round((k.spacer+u.spacer)/
-2);if(H<=k.spacer||H>=u.spacer)break;H=ka(H);Da--;if(null==H)break;else aa(k,H)?k=H:u=H}return ia};c=R(y==mxConstants.ALIGN_BOTTOM);y==mxConstants.ALIGN_BOTTOM&&null!=N&&N>p.height&&(null==c||!c.fits||c.score>2*C)&&(c=R(!1),O=!0);R=Math.round(null!=c?c.spacer:0)}c=function(J){var ia=null,Y=F.measureShapeInsideFlow(b,d,m,p,J,t,n);if(null!=Y&&0<Y.lines.length){J=Math.max(0,-J);for(var aa=Math.round(p.height)+J,ja=Y.lines.length;0<ja&&Y.lines[ja-1][0]>=aa-1;)ja--;ja<Y.lines.length&&(aa=0<ja?Y.lines[ja][0]-
+Graph.prototype.computeShapeInsideSpacer=function(b,d,m,p,t,n){var y=mxUtils.getValue(d,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),C=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE))*mxConstants.LINE_HEIGHT,O=y!=mxConstants.ALIGN_BOTTOM,F=this,N=null,R=0;if(y!=mxConstants.ALIGN_TOP){var c=function(J,ia,Y){var aa=null;if(null!=J)for(var ja=0;ja<J.length;ja++){var la=J[ja],ua=J[(ja+1)%J.length];la[1]!=ua[1]&&ia>=Math.min(la[1],ua[1])&&ia<=Math.max(la[1],
+ua[1])&&(la=la[0]+(ua[0]-la[0])*(ia-la[1])/(ua[1]-la[1]),aa=null==aa?la:Y?Math.max(aa,la):Math.min(aa,la))}return aa};R=c(m.left,.999,!0);c=c(m.right,.999,!1);var f=24<=((null==c?1:c)-(null==R?0:R))*t;R=function(J){for(var ia=null,Y=[],aa=null,ja=null,la=function(P){var U=F.measureShapeInsideFlow(b,d,m,p,P,t,n);if(null==U)return null;var W=Math.min(0,P),fa=U.top+W;W=U.bottom+W;null==N&&(N=W-fa);var X=N>p.height,ea=W<=p.height+.5&&(J||-.5<=fa),oa=null;J?X?oa=Math.abs(p.height-W):0<=P&&(oa=ea?p.height-
+W:f?1.5*(W-p.height):null):oa=ea?Math.abs(fa-(p.height-W)):Math.abs(fa+W-p.height);var ka=!J||X;null!=oa&&(null==ia||ka&&ea&&!ia.fits||(!ka||ea==ia.fits)&&oa<ia.score)&&(ia={spacer:P,score:oa,fits:ea});P={spacer:P,top:fa,btm:W,overflow:X,lines:U.lines.length};Y.push(P);return P},ua=function(){return null!=ia&&ia.fits&&1>=ia.score},Da=0,ha=0;ha<(J?8:5);ha++){var k=la(Da);if(null==k)return null;if(ua())break;var u=J?Da+p.height-k.btm:Da+(p.height-k.top-k.btm)/2;if(J){if(k.btm<=p.height+.5)aa=null==
+aa?Da:Math.max(aa,Da);else if(null==aa||Da>aa)ja=null==ja?Da:Math.min(ja,Da);null!=aa&&null!=ja&&1<ja-aa&&(u=(aa+ja)/2);k.overflow||(u=Math.max(0,u))}if(Math.round(u)==Math.round(Da))break;Da=u}if(!J&&!ua())for(aa=function(P,U){return P.lines==U.lines&&1>=Math.abs(U.btm-U.top-(P.btm-P.top))},ja=Y.slice().sort(function(P,U){return P.spacer-U.spacer}),Da=8,ha=0;ha<ja.length-1&&0<Da&&!ua();ha++)for(k=ja[ha],u=ja[ha+1];0<Da&&!ua()&&!aa(k,u)&&1<u.spacer-k.spacer;){var H=Math.round((k.spacer+u.spacer)/
+2);if(H<=k.spacer||H>=u.spacer)break;H=la(H);Da--;if(null==H)break;else aa(k,H)?k=H:u=H}return ia};c=R(y==mxConstants.ALIGN_BOTTOM);y==mxConstants.ALIGN_BOTTOM&&null!=N&&N>p.height&&(null==c||!c.fits||c.score>2*C)&&(c=R(!1),O=!0);R=Math.round(null!=c?c.spacer:0)}c=function(J){var ia=null,Y=F.measureShapeInsideFlow(b,d,m,p,J,t,n);if(null!=Y&&0<Y.lines.length){J=Math.max(0,-J);for(var aa=Math.round(p.height)+J,ja=Y.lines.length;0<ja&&Y.lines[ja-1][0]>=aa-1;)ja--;ja<Y.lines.length&&(aa=0<ja?Y.lines[ja][0]-
Y.lines[ja-1][1]:0,Y.lines[Y.lines.length-1][1]-Y.lines[ja][0]<=2*C+2&&(0==ja||2<aa)&&(ia=0<ja?Y.lines[ja-1][1]-J:0))}return ia};var l=c(R);if(null!=l&&y!=mxConstants.ALIGN_TOP){y=function(J,ia){ia=Math.min(0,ia);return O?Math.abs(p.height-(J.top+ia)-(J.bottom+ia)):Math.abs(p.height-(J.bottom+ia))};for(var q=this.measureShapeInsideFlow(b,d,m,p,R,t,n,null,l),x=0;3>x&&null!=q;x++){var A=Math.min(0,R);A=Math.round(O?(p.height-(q.top+A)-(q.bottom+A))/2:p.height-(q.bottom+A));for(var E=!1,K=0;2>K&&0!=
A;K++){var Q=c(R+A);Q=null!=Q?Q:l+A;var V=this.measureShapeInsideFlow(b,d,m,p,R+A,t,n,null,Q);if(null!=V&&y(V,R+A)<y(q,R)&&(O||V.bottom+Math.min(0,R+A)<=p.height+.5)){R+=A;l=Q;q=V;E=!0;break}A=Math.round(A/2)}if(!E)break}}return{spacer:Math.round(R),clip:null!=l?Math.round(l):null}};
Graph.prototype.computeShapeInsideFontSize=function(b,d,m,p,t){var n=this.getShapeInsideBox(d,p,t);if(null==this.measureShapeInsideFlow(b,d,m,n,0,p,t,1))return null;for(var y=1,C=84;y<C;){var O=Math.ceil((y+C)/2),F=this.measureShapeInsideFlow(b,d,m,n,0,p,t,O);null!=F&&F.bottom<=n.height+.5&&F.right<=n.width+.5?y=O:C=O-1}return Math.max(6,y)};
@@ -2652,7 +2653,7 @@ this.setCellStyles("elbow",O==mxConstants.DIRECTION_SOUTH||O==mxConstants.DIRECT
C.getCenterX(),N=C.getCenterY(),R=Math.max(C.width,C.height)+100;y=O.getPerimeterPoint(C,new mxPoint(F+R,N),!1);var c=O.getPerimeterPoint(C,new mxPoint(F-R,N),!1),f=O.getPerimeterPoint(C,new mxPoint(F,N-R),!1);O=O.getPerimeterPoint(C,new mxPoint(F,N+R),!1);f=null!=f&&null!=O&&Math.abs(f.y-O.y)<C.height/4;return null!=y&&null!=c&&Math.abs(y.x-c.x)<C.width/4?"x":f?"y":null};Graph.prototype.loopHasFixedAnchorLine=function(y){return null!=this.getLoopFixedAxis(y)};Graph.prototype.getLoopAroundPoints=
function(y,C){var O=null!=y?y.getVisibleTerminalState(!0):null,F=null!=y?this.getCellGeometry(y.cell):null;if(null==O||null==C||null==F)return null;var N=y.view.scale,R=y.view.translate,c=y.origin,f=O.x/N-R.x-c.x,l=O.y/N-R.y-c.y,q=O.width/N,x=O.height/N,A=new mxPoint(C.x/N-R.x-c.x,C.y/N-R.y-c.y);var E=y.absolutePoints;null!=F.points&&2<=F.points.length?(C=F.points[0],E=F.points[F.points.length-1]):null!=E&&4<=E.length?(C=new mxPoint(E[1].x/N-R.x-c.x,E[1].y/N-R.y-c.y),E=new mxPoint(E[E.length-2].x/
N-R.x-c.x,E[E.length-2].y/N-R.y-c.y)):(C=new mxPoint(f+q/2,l+x/2-this.gridSize),E=new mxPoint(f+q/2,l+x/2+this.gridSize));F=Math.abs(C.x-E.x)>=Math.abs(C.y-E.y);C=Math.max(this.gridSize,F?Math.abs(C.x-E.x):Math.abs(C.y-E.y));var K=this.gridSize;E=this.loopHasFixedAnchorLine(y);var Q=y.absolutePoints;Q=null!=Q&&null!=Q[0]?new mxPoint(Q[0].x/N-R.x-c.x,Q[0].y/N-R.y-c.y):null;if(E&&null!=Q){if(F)return l=A.y>=Q.y?Math.max(Q.y+K,A.y):Math.min(Q.y-K,A.y),[new mxPoint(A.x-C/2,l),new mxPoint(A.x+C/2,l)];
-Q=A.x>=Q.x?Math.max(Q.x+K,A.x):Math.min(Q.x-K,A.x);return[new mxPoint(Q,A.y-C/2),new mxPoint(Q,A.y+C/2)]}var V=f+q/2,J=l+x/2,ia=function(Y,aa,ja){Y=y.view.getPerimeterPoint(O,new mxPoint((Y+R.x+c.x)*N,(aa+R.y+c.y)*N),ja);return null!=Y?new mxPoint(Y.x/N-R.x-c.x,Y.y/N-R.y-c.y):null};F=function(Y,aa,ja,ka){Y=ia(Y,aa,!0);ja=ia(ja,ka,!0);return null==Y||null==ja||2>Math.abs(Y.x-V)&&2>Math.abs(Y.y-J)||2>Math.abs(ja.x-V)&&2>Math.abs(ja.y-J)?!0:Math.abs(Y.x-ja.x)<K/2&&Math.abs(Y.y-ja.y)<K/2};E=ia(A.x,A.y,
+Q=A.x>=Q.x?Math.max(Q.x+K,A.x):Math.min(Q.x-K,A.x);return[new mxPoint(Q,A.y-C/2),new mxPoint(Q,A.y+C/2)]}var V=f+q/2,J=l+x/2,ia=function(Y,aa,ja){Y=y.view.getPerimeterPoint(O,new mxPoint((Y+R.x+c.x)*N,(aa+R.y+c.y)*N),ja);return null!=Y?new mxPoint(Y.x/N-R.x-c.x,Y.y/N-R.y-c.y):null};F=function(Y,aa,ja,la){Y=ia(Y,aa,!0);ja=ia(ja,la,!0);return null==Y||null==ja||2>Math.abs(Y.x-V)&&2>Math.abs(Y.y-J)||2>Math.abs(ja.x-V)&&2>Math.abs(ja.y-J)?!0:Math.abs(Y.x-ja.x)<K/2&&Math.abs(Y.y-ja.y)<K/2};E=ia(A.x,A.y,
!1);if(null==E||1>Math.abs(E.x-V)&&1>Math.abs(E.y-J))E=new mxPoint(V,J);if(Math.abs(E.y-J)>=Math.abs(E.x-V)){C=Math.max(this.gridSize,Math.min(C,q));l=E.y>=J?Math.max(E.y+K,A.y):Math.min(E.y-K,A.y);A=Math.max(f+C/2,Math.min(f+q-C/2,A.x));for(f=0;f<=q/this.gridSize&&F(A-C/2,l,A+C/2,l);f++)A=A<V?Math.min(V,A+this.gridSize):Math.max(V,A-this.gridSize);E=E.y>=J?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&F(A-C/2,l,A+C/2,l);f++)l+=E;return[new mxPoint(A-C/2,l),new mxPoint(A+C/2,l)]}C=
Math.max(this.gridSize,Math.min(C,x));Q=E.x>=V?Math.max(E.x+K,A.x):Math.min(E.x-K,A.x);l=Math.max(l+C/2,Math.min(l+x-C/2,A.y));for(f=0;f<=x/this.gridSize&&F(Q,l-C/2,Q,l+C/2);f++)l=l<J?Math.min(J,l+this.gridSize):Math.max(J,l-this.gridSize);A=E.x>=V?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&F(Q,l-C/2,Q,l+C/2);f++)Q+=A;return[new mxPoint(Q,l-C/2),new mxPoint(Q,l+C/2)]};Graph.prototype.keepLoopOutsideShape=function(y,C){var O=null!=y?y.getVisibleTerminalState(!0):null;if(null==O||
null==C||0==C.length)return C;var F=y.view.scale,N=y.view.translate,R=y.origin,c=O.x/F-N.x-R.x,f=O.y/F-N.y-R.y,l=O.width/F,q=O.height/F;if(this.loopHasFixedAnchorLine(y))return C;c+=l/2;f+=q/2;q=this.gridSize;l=[];for(var x=0;x<C.length;x++){var A=C[x];if(null==A)l.push(A);else{var E=new mxPoint(A.x,A.y),K=y.view.getPerimeterPoint(O,new mxPoint((A.x+N.x+R.x)*F,(A.y+N.y+R.y)*F),!1);if(null!=K){var Q=K.x/F-N.x-R.x;K=K.y/F-N.y-R.y;var V=A.x-c;A=A.y-f;var J=Math.sqrt(V*V+A*A);J<Math.sqrt((Q-c)*(Q-c)+
@@ -2662,7 +2663,7 @@ function(y){return this.getCellStyle(y,!1)};Graph.prototype.pasteStyle=function(
C[x]),"strokeColor"!=C[x]||null!=O[x]&&"none"!=O[x])if(0<=mxUtils.indexOf(Graph.cellStyles,C[x])||"shape"==C[x])if("shape"!=C[x]&&(l||y&&!R)&&!f&&(null==O[x]?delete F[C[x]]:F[C[x]]=O[x]),q||y&&!c)null==O[x]?delete N[C[x]]:N[C[x]]=O[x]};Graph.prototype.includeDescendants=function(y){for(var C=[],O=0;O<y.length;O++)C=C.concat(this.model.getDescendants(y[O]));return C};Graph.prototype.includeDescendantParts=function(y){for(var C=y.slice(),O=mxUtils.bind(this,function(N){for(var R=0;R<this.model.getChildCount(N);R++){var c=
this.model.getChildAt(N,R);"1"==mxUtils.getValue(this.getCurrentCellStyle(c),"part","0")&&(C.push(c),O(c))}}),F=0;F<y.length;F++)O(y[F]);return C};Graph.prototype.pasteCellStyles=function(y,C,O,F,N,R){C=null!=C?C:this.currentVertexStyle;O=null!=O?O:this.currentEdgeStyle;N=null!=N?N:this.pasteEdgeStyle;R=null!=R?R:this.pasteStylesToText;this.model.beginUpdate();try{for(var c=0;c<y.length;c++){var f=y[c],l=this.model.getStyle(f),q=!1;null!=f.style&&"string"===typeof f.style&&(pairs=f.style.split(";"),
q=q||0<=mxUtils.indexOf(pairs,"text"));var x=this.model.isVertex(f)&&this.model.isEdge(this.model.getParent(f));if(q||x)var A=q&&!x&&R?Graph.cellStyles:Graph.textStyles;else if(A=Graph.cellStyles.slice(),!F)for(var E="string"===typeof l?l.split(";"):[],K=0;K<E.length;K++){var Q=E[K],V=Q.indexOf("=");if(0<=V){var J=Q.substring(0,V),ia=mxUtils.indexOf(A,J);0<=ia&&A.splice(ia,1);for(q=0;q<Graph.cellStyleGroups.length;q++){var Y=Graph.cellStyleGroups[q];if(0<=mxUtils.indexOf(Y,J))for(var aa=0;aa<Y.length;aa++){var ja=
-mxUtils.indexOf(A,Y[aa]);0<=ja&&A.splice(ja,1)}}}}var ka=this.model.isEdge(f);q=ka||x?O:C;for(K=0;K<A.length;K++){J=A[K];var ua=q[J];if("edgeStyle"!=J||N)if(ka||!ka&&0>mxUtils.indexOf(Graph.edgeStyles,J))null!=ua?(l=mxUtils.setStyle(l,J,ua),"fontFamily"==J&&null==q.fontSource&&(l=mxUtils.setStyle(l,"fontSource",null)),ka&&"rounded"==J&&"1"==ua&&null==q.curved&&(l=mxUtils.setStyle(l,"curved",null))):F&&(l=mxUtils.setStyle(l,J,null))}Editor.simpleLabels&&(l=mxUtils.setStyle(mxUtils.setStyle(l,"html",
+mxUtils.indexOf(A,Y[aa]);0<=ja&&A.splice(ja,1)}}}}var la=this.model.isEdge(f);q=la||x?O:C;for(K=0;K<A.length;K++){J=A[K];var ua=q[J];if("edgeStyle"!=J||N)if(la||!la&&0>mxUtils.indexOf(Graph.edgeStyles,J))null!=ua?(l=mxUtils.setStyle(l,J,ua),"fontFamily"==J&&null==q.fontSource&&(l=mxUtils.setStyle(l,"fontSource",null)),la&&"rounded"==J&&"1"==ua&&null==q.curved&&(l=mxUtils.setStyle(l,"curved",null))):F&&(l=mxUtils.setStyle(l,J,null))}Editor.simpleLabels&&(l=mxUtils.setStyle(mxUtils.setStyle(l,"html",
null),"whiteSpace",null));this.model.setStyle(f,l)}}finally{this.model.endUpdate()}return y};Graph.prototype.pasteTextStyles=function(y,C){this.model.beginUpdate();try{for(var O=0;O<y.length;O++){var F=y[O];if(this.model.isVertex(F)||this.model.isEdge(F)){for(var N=this.model.getStyle(F),R=0;R<Graph.pasteTextStyles.length;R++){var c=Graph.pasteTextStyles[R],f=C[c];null!=f&&(N=mxUtils.setStyle(N,c,f),"fontFamily"==c&&null==C.fontSource&&(N=mxUtils.setStyle(N,"fontSource",null)))}Editor.simpleLabels&&
(N=mxUtils.setStyle(mxUtils.setStyle(N,"html",null),"whiteSpace",null));this.model.setStyle(F,N)}}}finally{this.model.endUpdate()}return y};Graph.prototype.updateCellStyles=function(y,C){this.model.beginUpdate();try{for(var O=0;O<C.length;O++)if(this.model.isVertex(C[O])||this.model.isEdge(C[O])){var F=this.getCellStyle(C[O],!1),N=F[mxConstants.STYLE_PERIMETER],R=!1;for(f in y){var c=y[f];if(F[f]!=c){if(f==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[f]&&"umlLifeline"!=c){R=!0;var f="participant"}this.setCellStyles(f,
c,[C[O]])}}R&&this.setCellStyles(mxConstants.STYLE_PERIMETER,N,[C[O]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(y,C,O,F,N,R){this.useCssTransforms&&
@@ -2886,11 +2887,11 @@ q=!0}}return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=th
arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());return c};var t=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return t.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var n=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){n.apply(this,arguments);if(this.graph.model.isVertex(c.cell)&&null!=this.graph.isTransparentBounds&&
this.graph.isTransparentBounds(c.cell)){var f=this.graph.getTransparentBounds(c.cell);null!=f?(c.x=this.scale*(this.translate.x+c.origin.x+f.x),c.y=this.scale*(this.translate.y+c.origin.y+f.y),c.width=this.scale*f.width,c.height=this.scale*f.height,c.unscaledWidth=f.width,c.unscaledHeight=f.height):(c.width=0,c.height=0,c.unscaledWidth=0,c.unscaledHeight=0)}this.graph.model.isEdge(c.cell)&&1!=c.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(c)};var y=mxMorphing.prototype.getDelta;mxMorphing.prototype.getDelta=
function(c){return null!=c&&null!=c.cell&&null!=this.graph.isTransparentBounds&&this.graph.isTransparentBounds(c.cell)?new mxPoint(0,0):y.apply(this,arguments)};mxGraphView.prototype.updateLineJumps=function(c){var f=c.absolutePoints;if(Graph.lineJumpsEnabled){var l=null!=c.routedPoints,q=null;if(null!=f&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var x=function(ha,k,u){var H=new mxPoint(k,u);H.type=ha;q.push(H);H=null!=c.routedPoints?c.routedPoints[q.length-1]:
-null;return null==H||H.type!=ha||H.x!=k||H.y!=u},A=.5*this.scale;l=!1;q=[];for(var E=0;E<f.length-1;E++){for(var K=f[E+1],Q=f[E],V=[],J=f[E+2];E<f.length-2&&mxUtils.ptSegDistSq(Q.x,Q.y,J.x,J.y,K.x,K.y)<1*this.scale*this.scale;)K=J,E++,J=f[E+2];l=x(0,Q.x,Q.y)||l;for(var ia=0;ia<this.validEdges.length;ia++){var Y=this.validEdges[ia],aa=Y.absolutePoints;if(null!=aa&&mxUtils.intersects(c,Y)&&"1"!=Y.style.noJump){var ja=null;for(Y=0;Y<aa.length-1;Y++){var ka=aa[Y+1],ua=aa[Y];for(J=aa[Y+2];Y<aa.length-
-2&&mxUtils.ptSegDistSq(ua.x,ua.y,J.x,J.y,ka.x,ka.y)<1*this.scale*this.scale;)ka=J,Y++,J=aa[Y+2];var Da=mxUtils.intersection(Q.x,Q.y,K.x,K.y,ua.x,ua.y,ka.x,ka.y);if(null!=Da&&(Math.abs(Da.x-Q.x)>A||Math.abs(Da.y-Q.y)>A)&&(Math.abs(Da.x-K.x)>A||Math.abs(Da.y-K.y)>A)&&(null==ja||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ja.x,ja.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ua.x,ua.y)>A)&&(null==J||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,J.x,J.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ka.x,ka.y)>A)){J=Da.x-Q.x;ja=Da.y-
+null;return null==H||H.type!=ha||H.x!=k||H.y!=u},A=.5*this.scale;l=!1;q=[];for(var E=0;E<f.length-1;E++){for(var K=f[E+1],Q=f[E],V=[],J=f[E+2];E<f.length-2&&mxUtils.ptSegDistSq(Q.x,Q.y,J.x,J.y,K.x,K.y)<1*this.scale*this.scale;)K=J,E++,J=f[E+2];l=x(0,Q.x,Q.y)||l;for(var ia=0;ia<this.validEdges.length;ia++){var Y=this.validEdges[ia],aa=Y.absolutePoints;if(null!=aa&&mxUtils.intersects(c,Y)&&"1"!=Y.style.noJump){var ja=null;for(Y=0;Y<aa.length-1;Y++){var la=aa[Y+1],ua=aa[Y];for(J=aa[Y+2];Y<aa.length-
+2&&mxUtils.ptSegDistSq(ua.x,ua.y,J.x,J.y,la.x,la.y)<1*this.scale*this.scale;)la=J,Y++,J=aa[Y+2];var Da=mxUtils.intersection(Q.x,Q.y,K.x,K.y,ua.x,ua.y,la.x,la.y);if(null!=Da&&(Math.abs(Da.x-Q.x)>A||Math.abs(Da.y-Q.y)>A)&&(Math.abs(Da.x-K.x)>A||Math.abs(Da.y-K.y)>A)&&(null==ja||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ja.x,ja.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ua.x,ua.y)>A)&&(null==J||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,J.x,J.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,la.x,la.y)>A)){J=Da.x-Q.x;ja=Da.y-
Q.y;Da={distSq:J*J+ja*ja,x:Da.x,y:Da.y};J=V.length;for(ja=0;ja<V.length;ja++)if(V[ja].distSq>Da.distSq){J=ja;break}(0==J||Math.abs(V[J-1].x-Da.x)>A||Math.abs(V[J-1].y-Da.y)>A)&&(J==V.length||Math.abs(V[J].x-Da.x)>A||Math.abs(V[J].y-Da.y)>A)&&V.splice(J,0,Da)}ja=ua}}}for(Y=0;Y<V.length;Y++)l=x(1,V[Y].x,V[Y].y)||l}Da=f[f.length-1];l=x(0,Da.x,Da.y)||l}c.routedPoints=q;return l}return!1};var C=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,f,l){this.routedPoints=null!=this.state?
this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)C.apply(this,arguments);else{var q=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,x=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,A=mxUtils.getValue(this.style,"jumpStyle","none"),E=!0,K=null,Q=null,V=[],J=null;c.begin();for(var ia=0;ia<this.state.routedPoints.length;ia++){var Y=
-this.state.routedPoints[ia],aa=new mxPoint(Y.x/this.scale,Y.y/this.scale);0==ia?aa=f[0]:ia==this.state.routedPoints.length-1&&(aa=f[f.length-1]);var ja=!1;if(null!=K&&1==Y.type){var ka=this.state.routedPoints[ia+1];Y=ka.x/this.scale-aa.x;ka=ka.y/this.scale-aa.y;Y=Y*Y+ka*ka;null==J&&(J=new mxPoint(aa.x-K.x,aa.y-K.y),Q=Math.sqrt(J.x*J.x+J.y*J.y),0<Q?(J.x=J.x*x/Q,J.y=J.y*x/Q):J=null);Y>x*x&&0<Q&&(Y=K.x-aa.x,ka=K.y-aa.y,Y=Y*Y+ka*ka,Y>x*x&&(ja=new mxPoint(aa.x-J.x,aa.y-J.y),Y=new mxPoint(aa.x+J.x,aa.y+
+this.state.routedPoints[ia],aa=new mxPoint(Y.x/this.scale,Y.y/this.scale);0==ia?aa=f[0]:ia==this.state.routedPoints.length-1&&(aa=f[f.length-1]);var ja=!1;if(null!=K&&1==Y.type){var la=this.state.routedPoints[ia+1];Y=la.x/this.scale-aa.x;la=la.y/this.scale-aa.y;Y=Y*Y+la*la;null==J&&(J=new mxPoint(aa.x-K.x,aa.y-K.y),Q=Math.sqrt(J.x*J.x+J.y*J.y),0<Q?(J.x=J.x*x/Q,J.y=J.y*x/Q):J=null);Y>x*x&&0<Q&&(Y=K.x-aa.x,la=K.y-aa.y,Y=Y*Y+la*la,Y>x*x&&(ja=new mxPoint(aa.x-J.x,aa.y-J.y),Y=new mxPoint(aa.x+J.x,aa.y+
J.y),V.push(ja),this.addPoints(c,V,l,q,!1,null,E),V=0>Math.round(J.x)||0==Math.round(J.x)&&0>=Math.round(J.y)?1:-1,E=!1,"sharp"==A?(c.lineTo(ja.x-J.y*V,ja.y+J.x*V),c.lineTo(Y.x-J.y*V,Y.y+J.x*V),c.lineTo(Y.x,Y.y)):"line"==A?(c.moveTo(ja.x+J.y*V,ja.y-J.x*V),c.lineTo(ja.x-J.y*V,ja.y+J.x*V),c.moveTo(Y.x-J.y*V,Y.y+J.x*V),c.lineTo(Y.x+J.y*V,Y.y-J.x*V),c.moveTo(Y.x,Y.y)):"arc"==A?(V*=1.3,c.curveTo(ja.x-J.y*V,ja.y+J.x*V,Y.x-J.y*V,Y.y+J.x*V,Y.x,Y.y)):(c.moveTo(Y.x,Y.y),E=!0),V=[Y],ja=!0))}else J=null;ja||
(V.push(aa),K=aa)}this.addPoints(c,V,l,q,!1,null,E);c.stroke()}};var O=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(c,f,l,q){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):O.apply(this,arguments)};var F=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,l,q){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)F.apply(this,
arguments);else{f=this.getTerminalPort(c,f,q);var x=this.getNextPoint(c,l,q),A=this.graph.isOrthogonal(c),E=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||"0")),K=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=E){var Q=Math.cos(-E),V=Math.sin(-E);x=mxUtils.getRotatedPoint(x,Q,V,K)}Q=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);Q+=parseFloat(c.style[q?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);x=this.getPerimeterPoint(f,
@@ -3024,8 +3025,8 @@ ra.getSvgShapeOffset(Ya.shape,Jb),0!=Qa)){for(var db=da&&null==eb,lb=Ya.cell;!db
mxUtils.getLightDarkColor(z),Cb=Graph.createSvgNode(0,0,Yb,Sb,Qb),Gb=Cb.ownerDocument;if(null!=z){var Kb=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"rect");Kb.setAttribute("fill",Qb.light);Kb.style.fill=Qb.cssText;Kb.setAttribute("width","100%");Kb.setAttribute("height","100%");Kb.setAttribute("x","0");Kb.setAttribute("y","0");Cb.appendChild(Kb)}var cc=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"g");Cb.appendChild(cc);var Pb=this.createSvgCanvas(cc),dc=Math.floor((M/L-yb.x/qb)*S)/S,g=Math.floor((M/
L-yb.y/qb)*S)/S;Pb.translate(dc,g);Pb.idPrefix="drawio-svg-"+Editor.guid();if(sb){var r=this.gridSize*L,D=this.view.gridSteps*r;z=[];for(gb=1;gb<this.view.gridSteps;gb++)M=gb*r,z.push("M 0 "+M+" L "+D+" "+M+" M "+M+" 0 L "+M+" "+D);var v=mxUtils.getLightDarkColor(this.view.gridColor),B=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"pattern");B.setAttribute("id",Pb.idPrefix+"-grid");B.setAttribute("patternUnits","userSpaceOnUse");B.setAttribute("width",D);B.setAttribute("height",D);B.setAttribute("x",
mxUtils.mod((tb.x+dc)*L,D));B.setAttribute("y",mxUtils.mod((tb.y+g)*L,D));if(0<z.length){var G=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"path");G.setAttribute("d",z.join(" "));G.setAttribute("fill","none");G.setAttribute("stroke",v.light);G.style.stroke=v.cssText;G.setAttribute("opacity","0.2");G.setAttribute("stroke-width",L);B.appendChild(G)}var I=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"path");I.setAttribute("d","M "+D+" 0 L 0 0 0 "+D);I.setAttribute("fill","none");I.setAttribute("stroke",
-v.light);I.style.stroke=v.cssText;I.setAttribute("stroke-width",L);B.appendChild(I);Pb.defs.appendChild(B);var ba=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"rect");ba.setAttribute("width","100%");ba.setAttribute("height","100%");ba.setAttribute("fill","url(#"+B.getAttribute("id")+")");Cb.insertBefore(ba,cc)}var U=document.createElement("div"),za=Pb.getAlternateText;Pb.getAlternateText=function(Qa,Ya,db,lb,ob,nb,ec,hc,fc,gc,ic,jc,kc){if(null!=nb&&0<this.state.fontSize)try{return mxUtils.isNode(nb)?
-nb=nb.innerText:(U.innerHTML=nb,nb=mxUtils.extractTextWithWhitespace(U.childNodes)),nb}catch(lc){return za.apply(this,arguments)}else return za.apply(this,arguments)};if(null!=xb&&null!=xb.width&&null!=xb.height){gb=qb/L;var pa=new mxRectangle((xb.x+tb.x)*gb,(xb.y+tb.y)*gb,xb.width*gb,xb.height*gb);mxUtils.intersects(yb,pa)&&Pb.image(xb.x+tb.x,xb.y+tb.y,xb.width,xb.height,xb.src,!0)}Pb.scale(S);Pb.textEnabled=na;ra=null!=ra?ra:this.createSvgImageExport();var Xa=ra.getLinkForCellState;ra.getLinkForCellState=
+v.light);I.style.stroke=v.cssText;I.setAttribute("stroke-width",L);B.appendChild(I);Pb.defs.appendChild(B);var ca=mxUtils.createElementNs(Gb,mxConstants.NS_SVG,"rect");ca.setAttribute("width","100%");ca.setAttribute("height","100%");ca.setAttribute("fill","url(#"+B.getAttribute("id")+")");Cb.insertBefore(ca,cc)}var T=document.createElement("div"),za=Pb.getAlternateText;Pb.getAlternateText=function(Qa,Ya,db,lb,ob,nb,ec,hc,fc,gc,ic,jc,kc){if(null!=nb&&0<this.state.fontSize)try{return mxUtils.isNode(nb)?
+nb=nb.innerText:(T.innerHTML=nb,nb=mxUtils.extractTextWithWhitespace(T.childNodes)),nb}catch(lc){return za.apply(this,arguments)}else return za.apply(this,arguments)};if(null!=xb&&null!=xb.width&&null!=xb.height){gb=qb/L;var pa=new mxRectangle((xb.x+tb.x)*gb,(xb.y+tb.y)*gb,xb.width*gb,xb.height*gb);mxUtils.intersects(yb,pa)&&Pb.image(xb.x+tb.x,xb.y+tb.y,xb.width,xb.height,xb.src,!0)}Pb.scale(S);Pb.textEnabled=na;ra=null!=ra?ra:this.createSvgImageExport();var Xa=ra.getLinkForCellState;ra.getLinkForCellState=
function(Qa,Ya){var db=Qa.view.graph.getAbsoluteUrl(Xa.apply(this,arguments));return null==db||Qa.view.graph.isCustomLink(db)?null:Graph.sanitizeLink(db)};ra.getLinkTargetForCellState=function(Qa,Ya){return Qa.view.graph.getLinkTargetForCell(Qa.cell)};var vb=ra.drawCellState,jb=null,Sa=mxUtils.bind(this,function(){if(null==jb){jb="ge-flow-animation-"+Editor.guid();var Qa=null!=Gb.createElementNS?Gb.createElementNS(mxConstants.NS_SVG,"style"):Gb.createElement("style");Qa.innerHTML=this.createFlowAnimationCss(jb);
Gb.getElementsByTagName("defs")[0].appendChild(Qa)}return jb});ra.drawCellState=function(Qa,Ya){for(var db=Qa.view.graph,lb=null!=eb?eb.get(Qa.cell):db.isCellSelected(Qa.cell),ob=db.model.getParent(Qa.cell);!(da&&null==eb||lb)&&null!=ob;)lb=null!=eb?eb.get(ob):db.isCellSelected(ob),ob=db.model.getParent(ob);if(null!=Qa.shape)try{var nb=Qa.shape.isFlowAnimationEnabled,ec=Qa.shape.addFlowAnimationToShape;Qa.shape.isFlowAnimationEnabled=function(){return bb&&db.model.isEdge(Qa.cell)&&"1"==mxUtils.getValue(Qa.style,
"flowAnimation","0")};Qa.shape.addFlowAnimationToShape=function(){db.addFlowAnimationToNode(this.getFlowAnimationPath(),Qa.style,L,Sa())};if(da&&null==eb||lb)db.view.redrawEnumerationState(Qa),vb.apply(this,arguments),this.doDrawShape(Qa.secondLabel,Ya)}finally{Qa.shape.isFlowAnimationEnabled=nb,Qa.shape.addFlowAnimationToShape=ec}};var Va=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;ra.drawState(this.getView().getState(Va),Pb);this.addForeignObjectWarning(Pb,Cb);Graph.inlineSingleUseImages(Cb);
@@ -3092,7 +3093,7 @@ mxConstants.DEFAULT_FONTFAMILY,S[mxConstants.STYLE_FONTSTYLE],"wrap"==S[mxConsta
"",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",ja.apply(this,arguments))};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(z,L){if("0"==mxUtils.getValue(z.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var M=this.graph.getEditingValue(z.cell,L);"1"==mxUtils.getValue(z.style,
"nl2Br","1")&&(M=M.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(M,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(z,L){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(z.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=
function(z){this.removeShapeInsideNodes();if("0"==mxUtils.getValue(z.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var L=Graph.sanitizeHtml(this.textarea.innerHTML,!0);Editor.optimizeHtmlLabels&&(L=Graph.optimizeHtml(L));"1"==mxUtils.getValue(z.style,"nl2Br","1")?(L=L.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<L.length&&("<br/>"==L.substring(L.length-5)||"<br>"==L.substring(L.length-4))&&(L=L.substring(0,
-L.lastIndexOf("<br"))+"<div><br/></div>")):L=L.replace(/\r\n/g,"").replace(/\n/g,"");return L};var ka=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(z){null!=this.shapeInsideListener&&(null!=this.textarea&&mxEvent.removeListener(this.textarea,"input",this.shapeInsideListener),this.shapeInsideAlign=this.shapeInsideListener=null);this.codeViewMode&&this.toggleViewMode();ka.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(z){}};
+L.lastIndexOf("<br"))+"<div><br/></div>")):L=L.replace(/\r\n/g,"").replace(/\n/g,"");return L};var la=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(z){null!=this.shapeInsideListener&&(null!=this.textarea&&mxEvent.removeListener(this.textarea,"input",this.shapeInsideListener),this.shapeInsideAlign=this.shapeInsideListener=null);this.codeViewMode&&this.toggleViewMode();la.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(z){}};
var ua=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(z,L){this.graph.getModel().beginUpdate();try{ua.apply(this,arguments),""==L&&this.graph.isCellDeletable(z.cell)&&0==this.graph.model.getChildCount(z.cell)&&this.graph.isTransparentState(z)&&this.graph.removeCells([z.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(z){z=mxUtils.getValue(z.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);z==mxConstants.NONE&&
(z=null);return z};mxCellEditor.prototype.getBorderColor=function(z){z=mxUtils.getValue(z.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);z==mxConstants.NONE&&(z=null);return z};mxCellEditor.prototype.getMinimumSize=function(z){var L=this.graph.getView().scale;return new mxRectangle(0,0,null==z.text?30:z.text.size*L+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(z,L){return mxGraphHandlerIsValidDropTarget.apply(this,
arguments)&&!mxEvent.isAltDown(L.getEvent)};var Da=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(z){var L=Da.apply(this,arguments);if(null!=L){var M=this.graph.getLockedGroupAncestor(this.graph.model.getParent(L));null!=M&&(L=M)}return L};var ha=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(z,L,M){var S=this.graph.model.getParent(z);if(null!=S){if(this.graph.isSelectParentFirst(S))return!this.graph.isCellSelected(S)&&
@@ -3102,11 +3103,11 @@ for(Z=0;Z<z.length;Z++)for(var da=L.model.getParent(z[Z]);null!=da&&L.isTranspar
this.currentDx)/M-L.x);L=this.roundLength((this.bounds.y+this.currentDy)/M-L.y);M=this.graph.view.unit;this.hint.innerHTML=d(z,M)+", "+d(L,M);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};
var H=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(z,L){H.apply(this,arguments);var M=this.graph.getCellStyle(z);if(null==M.childLayout){var S=this.graph.model.getParent(z),Z=null!=S?this.graph.getCellGeometry(S):null;if(null!=Z&&(M=this.graph.getCellStyle(S),"stackLayout"==M.childLayout)){var da=parseFloat(mxUtils.getValue(M,"stackBorder",mxStackLayout.prototype.border));M="1"==mxUtils.getValue(M,"horizontalStack","1");var na=this.graph.getActualStartSize(S);Z=Z.clone();
M?Z.height=L.height+na.y+na.height+2*da:Z.width=L.width+na.x+na.width+2*da;this.graph.model.setGeometry(S,Z)}}};var P=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function z(ra){M.get(ra)||(M.put(ra,!0),Z.push(ra))}for(var L=P.apply(this,arguments),M=new mxDictionary,S=this.graph.model,Z=[],da=0;da<L.length;da++){var na=L[da];this.graph.isTableCell(na)?z(S.getParent(S.getParent(na))):this.graph.isTableRow(na)&&z(S.getParent(na));
-z(na)}return Z};var T=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(z){return T.apply(this,arguments)&&!mxEvent.isControlDown(z.getEvent())&&!mxEvent.isShiftDown(z.getEvent())};var W=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return W.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};
+z(na)}return Z};var U=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(z){return U.apply(this,arguments)&&!mxEvent.isControlDown(z.getEvent())&&!mxEvent.isShiftDown(z.getEvent())};var W=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return W.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};
var fa=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(z){var L=fa.apply(this,arguments);L.stroke="#C0C0C0";L.strokewidth=1;var M=this.graph.model.getParent(this.state.cell);null!=M&&this.graph.isTransparentBounds(M)&&(L.isDashed=!0);return L};var X=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:X.apply(this,arguments)};var ea=
mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":ea.apply(this,arguments)};var oa=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){oa.apply(this,arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),
-this.selectionBorder.redraw())};var la=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(z){var L=la.apply(this,arguments);L.stroke="#C0C0C0";L.strokewidth=1;return L};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var z=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+z.x/2,this.bounds.y+this.rotationHandleVSpacing-
-z.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(z,L){return this.graph.isRecursiveVertexResize(z)&&!mxEvent.isAltDown(L.getEvent())};var ca=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(z,L,M,S,Z,da,na){na&&this.graph.isRotatedGroupResize(z)&&(this.childOffsetY=this.childOffsetX=0);ca.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(z,L){return mxEvent.isControlDown(L.getEvent())||mxEvent.isMetaDown(L.getEvent())};var sa=mxVertexHandler.prototype.isRotationHandleVisible;
+this.selectionBorder.redraw())};var ka=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(z){var L=ka.apply(this,arguments);L.stroke="#C0C0C0";L.strokewidth=1;return L};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var z=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+z.x/2,this.bounds.y+this.rotationHandleVSpacing-
+z.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(z,L){return this.graph.isRecursiveVertexResize(z)&&!mxEvent.isAltDown(L.getEvent())};var ba=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(z,L,M,S,Z,da,na){na&&this.graph.isRotatedGroupResize(z)&&(this.childOffsetY=this.childOffsetX=0);ba.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(z,L){return mxEvent.isControlDown(L.getEvent())||mxEvent.isMetaDown(L.getEvent())};var sa=mxVertexHandler.prototype.isRotationHandleVisible;
mxVertexHandler.prototype.isRotationHandleVisible=function(){return sa.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&
!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var z=this.getHandlePadding(),L=this.graph,M=L.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+this.bounds.height,function(S){return L.isConnectIconVisible(S)&&L.isEnabled()&&L.isCellConnectable(S)&&!L.isTableCell(S)&&!L.isTableRow(S)&&
!L.isTable(S)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+z.x/2+M,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+z.y/2+M)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var xa=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var z=
@@ -3127,7 +3128,7 @@ try{S.setCellStyles("lockedGroup",sb?"0":"1",[kb])}finally{S.getModel().endUpdat
!1,Z=new mxHandle(this.state,"pointer",null,Z),Z.editIconHandle=!0,Z.setPosition=function(){},Z.positionChanged=function(){},Z.reset=function(){},Z.redraw=function(){if(null!=this.shape){var eb=M.getHandlePadding(),gb=S.getNestedCornerIconOffset(kb,M.bounds.x,M.bounds.y,function(xb){return S.isEditIconVisible(xb)});eb=new mxPoint(M.bounds.x-12-eb.x/2-gb,M.bounds.y-12-eb.y/2-gb);S.isCellMovable(kb)&&(S.isLockedGroupIconVisible(kb)||S.isMoveIconVisible(kb))&&(eb.x+=24);gb=Number(null!=M.currentAlpha?
M.currentAlpha:M.state.style[mxConstants.STYLE_ROTATION]||"0");var bb=mxUtils.toRadians(gb);if(0!=bb){var yb=new mxPoint(M.state.getCenterX(),M.state.getCenterY());eb=mxUtils.getRotatedPoint(eb,Math.cos(bb),Math.sin(bb),yb)}this.shape.bounds.width=pb;this.shape.bounds.height=pb;this.shape.bounds.x=eb.x-pb/2;this.shape.bounds.y=eb.y-pb/2;this.shape.rotation=gb;this.shape.redraw()}},Z.execute=function(eb){S.startEditingAtCell(kb)},z.push(Z));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&
(null==z&&(z=[]),M=this,S=this.graph,kb=this.state.cell,pb=16,Z=new mxImageShape(new mxRectangle(0,0,pb,pb),HoverIcons.prototype.moveHandle.src),Z.preserveImageAspect=!1,Z=new mxHandle(this.state,"move",null,Z),Z.moveGroupHandle=!0,Z.setPosition=function(){},Z.positionChanged=function(){},Z.execute=function(){},Z.reset=function(){},Z.redraw=function(){if(null!=this.shape){var eb=M.getHandlePadding(),gb=S.getNestedCornerIconOffset(kb,M.bounds.x,M.bounds.y,function(yb){return S.isMoveIconVisible(yb)&&
-S.isCellMovable(yb)}),bb=M.bounds.x-12-eb.x/2-gb;eb=M.bounds.y-12-eb.y/2-gb;this.shape.bounds.width=pb;this.shape.bounds.height=pb;this.shape.bounds.x=bb-pb/2;this.shape.bounds.y=eb-pb/2;this.shape.redraw()}},z.push(Z));return null!=z?z.reverse():null};var va=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(z,L,M){Ha.apply(this,arguments);var S=this.graph;if(null!=this.parentState&&S.isTransparentBounds(this.parentState.cell)){var Z=
+S.isCellMovable(yb)}),bb=M.bounds.x-12-eb.x/2-gb;eb=M.bounds.y-12-eb.y/2-gb;this.shape.bounds.width=pb;this.shape.bounds.height=pb;this.shape.bounds.x=bb-pb/2;this.shape.bounds.y=eb-pb/2;this.shape.redraw()}},z.push(Z));return null!=z?z.reverse():null};var va=mxVertexHandler.prototype.setHandlesVisible,Ga=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(z,L,M){Ga.apply(this,arguments);var S=this.graph;if(null!=this.parentState&&S.isTransparentBounds(this.parentState.cell)){var Z=
S.view.scale,da=S.view.translate,na=this.parentState;this.parentState=na.clone();this.parentState.x=Z*(da.x+na.origin.x);this.parentState.y=Z*(da.y+na.origin.y)}for(Z=S.model.getParent(this.state.cell);null!=Z;)S.isTransparentBounds(Z)&&(da=S.selectionCellsHandler.getHandler(Z),null!=da&&null!=da.selectionBorder&&(da.selectionBorder.node.style.visibility="hidden")),Z=S.model.getParent(Z);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=
this.sizers){for(S=0;S<this.sizers.length;S++)null!=this.sizers[S]&&S!=this.index&&(this.sizers[S].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var La=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=this.sizers)for(var z=0;z<this.sizers.length;z++)null!=this.sizers[z]&&(this.sizers[z].node.style.display="");
null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}z=this.graph;for(var L=null!=this.state?z.model.getParent(this.state.cell):null;null!=L;){if(z.isTransparentBounds(L)){var M=z.selectionCellsHandler.getHandler(L);null!=M&&null!=M.selectionBorder&&(M.selectionBorder.node.style.visibility="")}L=z.model.getParent(L)}La.apply(this,arguments)};mxVertexHandler.prototype.setHandlesVisible=function(z){va.apply(this,arguments);if(null!=this.moveHandles)for(var L=
@@ -3161,7 +3162,7 @@ HoverIcons.prototype.triangleDown,Sidebar.prototype.triangleLeft=HoverIcons.prot
30;mxConnectionHandler.prototype.outlineConnect=!0;mxCellHighlight.prototype.keepOnTop=!0;mxVertexHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;var Oa=mxEdgeHandler.prototype.removePoint;
mxEdgeHandler.prototype.removePoint=function(z,L){var M=0==L;(M||null!=this.abspoints&&L==this.abspoints.length-1)&&null!=this.abspoints&&null!=this.abspoints[L]&&null==this.graph.getModel().getTerminal(z.cell,M)?this.graph.fireEvent(new mxEventObject("doubleClickEdgeTerminal","cell",z.cell,"source",M,"point",this.abspoints[L].clone())):Oa.apply(this,arguments)};var Ea=mxEdgeHandler.prototype.changePoints;mxEdgeHandler.prototype.changePoints=function(z,L,M){null!=z&&null!=L&&0<L.length&&"1"==mxUtils.getValue(this.graph.getCellStyle(z),
"libavoidRouting",null)&&this.graph.setCellStyles("libavoidRouting",null,[z]);return Ea.apply(this,arguments)};var Aa=mxEdgeSegmentHandler.prototype.getPreviewPoints;mxEdgeSegmentHandler.prototype.getPreviewPoints=function(z){if((this.isSource||this.isTarget)&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.previewEndpointDrag){var L=null;try{L=LibavoidRouting.previewEndpointDrag(this,z)}catch(M){}if(null!=L)return L}return Aa.apply(this,arguments)};var Ja=mxEdgeHandler.prototype.reset;
-mxEdgeHandler.prototype.reset=function(){"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&LibavoidRouting.endPreview(this);return Ja.apply(this,arguments)};var Ga=mxEdgeHandler.prototype.setInnerBendsOpacity;mxEdgeHandler.prototype.setInnerBendsOpacity=function(z,L,M){if(null!=this.state&&null!=z&&"1"==mxUtils.getValue(this.state.style,"libavoidRouting",null))for(var S=L;S<M;S++)null!=z[S]&&null!=z[S].node&&mxUtils.setOpacity(z[S].node,this.virtualBendOpacity);else return Ga.apply(this,
+mxEdgeHandler.prototype.reset=function(){"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&LibavoidRouting.endPreview(this);return Ja.apply(this,arguments)};var Ha=mxEdgeHandler.prototype.setInnerBendsOpacity;mxEdgeHandler.prototype.setInnerBendsOpacity=function(z,L,M){if(null!=this.state&&null!=z&&"1"==mxUtils.getValue(this.state.style,"libavoidRouting",null))for(var S=L;S<M;S++)null!=z[S]&&null!=z[S].node&&mxUtils.setOpacity(z[S].node,this.virtualBendOpacity);else return Ha.apply(this,
arguments)};var Ua=mxConnectionHandler.prototype.updateEdgeState;mxConnectionHandler.prototype.updateEdgeState=function(z,L){if(null!=this.edgeState&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.connectionWaypoints&&"1"==mxUtils.getValue(this.edgeState.style,"libavoidRouting",null))try{this.waypoints=LibavoidRouting.connectionWaypoints(this)}catch(M){this.waypoints=null}Ua.apply(this,arguments)};var ab=mxConnectionHandler.prototype.reset;mxConnectionHandler.prototype.reset=function(){"undefined"!==
typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&(LibavoidRouting.endPreview(this),this.waypoints=null);return ab.apply(this,arguments)};var Wa=mxGraphHandler.prototype.updateLivePreview;mxGraphHandler.prototype.updateLivePreview=function(z,L){Wa.apply(this,arguments);if("undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.livePreviewMove)try{LibavoidRouting.livePreviewMove(this,z,L)}catch(M){}};var cb=mxGraphHandler.prototype.reset;mxGraphHandler.prototype.reset=function(){cb.apply(this,
arguments);"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endMovePreview&&LibavoidRouting.endMovePreview(this)};mxEdgeHandler.prototype.isAddVirtualBendEvent=function(z){return!mxEvent.isShiftDown(z.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(z){return!mxEvent.isShiftDown(z.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,
@@ -3229,23 +3230,23 @@ function(){if(null!=this.marker&&(Ib.apply(this),null!=this.state&&null!=this.li
arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Db=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Db.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(g,r,D){mxShape.call(this);this.line=g;this.stroke=r;this.strokewidth=null!=D?D:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function p(){mxCylinder.call(this)}function t(){mxConnector.call(this)}function n(){mxCylinder.call(this)}function y(){mxActor.call(this)}function C(){mxCylinder.call(this)}function O(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function N(){mxCylinder.call(this)}function R(){mxShape.call(this)}
function c(){mxShape.call(this)}function f(g,r,D,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=D;this.strokewidth=null!=v?v:1}function l(){mxActor.call(this)}function q(){mxCylinder.call(this)}function x(){mxCylinder.call(this)}function A(){mxShape.call(this)}function E(){mxActor.call(this)}function K(){mxActor.call(this)}function Q(){mxActor.call(this)}function V(){mxActor.call(this)}function J(){mxActor.call(this)}function ia(){mxActor.call(this)}function Y(){mxActor.call(this)}function aa(g,
r){this.canvas=g;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=r;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,aa.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,aa.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,aa.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,aa.prototype.quadTo);this.originalCurveTo=
-this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,aa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,aa.prototype.arcTo)}function ja(){mxRectangleShape.call(this)}function ka(){mxRectangleShape.call(this)}function ua(){mxActor.call(this)}function Da(){mxActor.call(this)}function ha(){mxActor.call(this)}function k(){mxActor.call(this)}function u(){mxRectangleShape.call(this)}function H(){mxRectangleShape.call(this)}function P(){mxCylinder.call(this)}
-function T(){mxShape.call(this)}function W(){mxShape.call(this)}function fa(){mxEllipse.call(this)}function X(){mxShape.call(this)}function ea(){mxShape.call(this)}function oa(g,r){function D(){mxShape.call(this)}mxUtils.extend(D,mxShape);D.prototype.iconSize=r;D.prototype.paintBackground=function(v,B,G,I,ba){ba=Math.min(this.iconSize,I,ba);B+=(I-ba)/2;g.prototype.hasOwnProperty("paintVertexShape")?g.prototype.paintVertexShape.call(this,v,B,G,ba,ba):(g.prototype.paintBackground.call(this,v,B,G,ba,
-ba),"function"===typeof g.prototype.paintForeground&&g.prototype.paintForeground.call(this,v,B,G,ba,ba))};return D}function la(){mxShape.call(this)}function ca(){mxShape.call(this)}function sa(){mxShape.call(this)}function xa(){mxShape.call(this)}function qa(){mxShape.call(this)}function Ba(){mxRectangleShape.call(this)}function ma(){mxShape.call(this)}function ta(){mxShape.call(this)}function va(){mxShape.call(this)}function Ha(){mxShape.call(this)}function La(){mxShape.call(this)}function Ia(){mxCylinder.call(this)}
-function Ca(){mxCylinder.call(this)}function Pa(){mxRectangleShape.call(this)}function Ka(){mxDoubleEllipse.call(this)}function Na(){mxDoubleEllipse.call(this)}function Oa(){mxArrowConnector.call(this);this.spacing=0}function Ea(){mxArrowConnector.call(this);this.spacing=0}function Aa(){mxActor.call(this)}function Ja(){mxRectangleShape.call(this)}function Ga(){mxActor.call(this)}function Ua(){mxActor.call(this)}function ab(){mxActor.call(this)}function Wa(){mxActor.call(this)}function cb(){mxActor.call(this)}
+this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,aa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,aa.prototype.arcTo)}function ja(){mxRectangleShape.call(this)}function la(){mxRectangleShape.call(this)}function ua(){mxActor.call(this)}function Da(){mxActor.call(this)}function ha(){mxActor.call(this)}function k(){mxActor.call(this)}function u(){mxRectangleShape.call(this)}function H(){mxRectangleShape.call(this)}function P(){mxCylinder.call(this)}
+function U(){mxShape.call(this)}function W(){mxShape.call(this)}function fa(){mxEllipse.call(this)}function X(){mxShape.call(this)}function ea(){mxShape.call(this)}function oa(g,r){function D(){mxShape.call(this)}mxUtils.extend(D,mxShape);D.prototype.iconSize=r;D.prototype.paintBackground=function(v,B,G,I,ca){ca=Math.min(this.iconSize,I,ca);B+=(I-ca)/2;g.prototype.hasOwnProperty("paintVertexShape")?g.prototype.paintVertexShape.call(this,v,B,G,ca,ca):(g.prototype.paintBackground.call(this,v,B,G,ca,
+ca),"function"===typeof g.prototype.paintForeground&&g.prototype.paintForeground.call(this,v,B,G,ca,ca))};return D}function ka(){mxShape.call(this)}function ba(){mxShape.call(this)}function sa(){mxShape.call(this)}function xa(){mxShape.call(this)}function qa(){mxShape.call(this)}function Ba(){mxRectangleShape.call(this)}function ma(){mxShape.call(this)}function ta(){mxShape.call(this)}function va(){mxShape.call(this)}function Ga(){mxShape.call(this)}function La(){mxShape.call(this)}function Ia(){mxCylinder.call(this)}
+function Ca(){mxCylinder.call(this)}function Pa(){mxRectangleShape.call(this)}function Ka(){mxDoubleEllipse.call(this)}function Na(){mxDoubleEllipse.call(this)}function Oa(){mxArrowConnector.call(this);this.spacing=0}function Ea(){mxArrowConnector.call(this);this.spacing=0}function Aa(){mxActor.call(this)}function Ja(){mxRectangleShape.call(this)}function Ha(){mxActor.call(this)}function Ua(){mxActor.call(this)}function ab(){mxActor.call(this)}function Wa(){mxActor.call(this)}function cb(){mxActor.call(this)}
function hb(){mxActor.call(this)}function wb(){mxActor.call(this)}function Fa(){mxActor.call(this)}function Ra(){mxActor.call(this)}function $a(){mxActor.call(this)}function fb(){mxEllipse.call(this)}function rb(){mxEllipse.call(this)}function mb(){mxEllipse.call(this)}function ub(){mxRhombus.call(this)}function Eb(){mxEllipse.call(this)}function Fb(){mxEllipse.call(this)}function Tb(){mxEllipse.call(this)}function Rb(){mxEllipse.call(this)}function $b(){mxActor.call(this)}function Mb(){mxActor.call(this)}
-function Wb(){mxActor.call(this)}function zb(g,r,D,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=D;this.strokewidth=null!=v?v:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Ub(){mxConnector.call(this)}function Lb(){mxConnector.call(this)}function Xb(){mxActor.call(this)}function bc(g,r,D,v,B,G,I,ba,U,za){I+=U;var pa=v.clone();v.x-=B*(2*I+U);v.y-=G*(2*I+U);B*=I+U;G*=I+U;return function(){g.ellipse(pa.x-B-I,pa.y-G-I,2*
+function Wb(){mxActor.call(this)}function zb(g,r,D,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=D;this.strokewidth=null!=v?v:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Ub(){mxConnector.call(this)}function Lb(){mxConnector.call(this)}function Xb(){mxActor.call(this)}function bc(g,r,D,v,B,G,I,ca,T,za){I+=T;var pa=v.clone();v.x-=B*(2*I+T);v.y-=G*(2*I+T);B*=I+T;G*=I+T;return function(){g.ellipse(pa.x-B-I,pa.y-G-I,2*
I,2*I);za?g.fillAndStroke():g.stroke()}}function Hb(){mxRectangleShape.call(this)}function Ob(){mxActor.call(this)}function ac(){mxShape.call(this)}function Zb(){mxShape.call(this)}function Vb(){mxActor.call(this)}function Bb(){mxActor.call(this)}function Ib(){mxActor.call(this)}function Ab(){mxActor.call(this)}function Db(){mxConnector.call(this)}var z=mxShape.prototype.getLabelMargins;mxShape.prototype.getLabelMargins=function(g){if(null!=this.stencil&&null!=this.stencil.desc&&null!=this.style){if(null==
this.stencil.labelBounds){for(var r=this.stencil.desc.getElementsByTagName("labelBounds"),D=[],v=0;v<r.length;v++)D.push({condition:r[v].getAttribute("if"),x:Number(r[v].getAttribute("x")||0),y:Number(r[v].getAttribute("y")||0),w:Number(r[v].getAttribute("w")||this.stencil.w0),h:Number(r[v].getAttribute("h")||this.stencil.h0)});this.stencil.labelBounds=D}for(v=0;v<this.stencil.labelBounds.length;v++)if(r=this.stencil.labelBounds[v],null==r.condition||"1"==mxUtils.getValue(this.style,r.condition,"0")){v=
this.stencil.computeAspect(this.style,g.x,g.y,g.width,g.height);D=v.x-g.x+r.x*v.width;var B=v.y-g.y+r.y*v.height;return new mxRectangle(D,B,g.width-D-r.w*v.width,g.height-B-r.h*v.height)}}return z.apply(this,arguments)};mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var g=null;if(null!=this.line)for(var r=0;r<this.line.length;r++){var D=this.line[r];null!=D&&(D=new mxRectangle(D.x,D.y,this.strokewidth,this.strokewidth),null==g?g=D:g.add(D))}this.bounds=null!=g?g:new mxRectangle};
b.prototype.paintVertexShape=function(g,r,D,v,B){this.paintTableLine(g,this.line,0,0)};b.prototype.paintTableLine=function(g,r,D,v){if(null!=r){var B=null;g.begin();for(var G=0;G<r.length;G++){var I=r[G];null!=I&&(null==B?g.moveTo(I.x+D,I.y+v):null!=B&&g.lineTo(I.x+D,I.y+v));B=I}g.end();g.stroke()}};b.prototype.intersectsRectangle=function(g){var r=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var D=null,v=0;v<this.line.length&&!r;v++){var B=this.line[v];null!=
-B&&null!=D&&(r=mxUtils.rectangleIntersectsSegment(g,D,B));D=B}return r};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.fixedHeaderDefault=!1;d.prototype.paintVertexShape=function(g,r,D,v,B){var G=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,I=this.isHorizontal(),ba=this.getTitleSize(),U=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==ba&&this.isRounded&&!this.outline?(U=mxShape.prototype.getArcSize.call(this,
-v,B),g.begin(),g.roundrect(r,D,v,B,U,U),g.fillAndStroke()):0==ba&&!U||this.outline?Tb.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),g.translate(-r,-D));G||this.outline||!(I&&ba<B||!I&&ba<v)||this.paintForeground(g,r,D,v,B)};d.prototype.paintForeground=function(g,r,D,v,B){if(null!=this.state){var G=this.flipH,I=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ba=G;G=I;I=ba}g.rotate(-this.getShapeRotation(),
+B&&null!=D&&(r=mxUtils.rectangleIntersectsSegment(g,D,B));D=B}return r};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.fixedHeaderDefault=!1;d.prototype.paintVertexShape=function(g,r,D,v,B){var G=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,I=this.isHorizontal(),ca=this.getTitleSize(),T=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==ca&&this.isRounded&&!this.outline?(T=mxShape.prototype.getArcSize.call(this,
+v,B),g.begin(),g.roundrect(r,D,v,B,T,T),g.fillAndStroke()):0==ca&&!T||this.outline?Tb.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),g.translate(-r,-D));G||this.outline||!(I&&ca<B||!I&&ca<v)||this.paintForeground(g,r,D,v,B)};d.prototype.paintForeground=function(g,r,D,v,B){if(null!=this.state){var G=this.flipH,I=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ca=G;G=I;I=ca}g.rotate(-this.getShapeRotation(),
G,I,r+v/2,D+B/2);s=this.scale;r=this.bounds.x/s;D=this.bounds.y/s;v=this.bounds.width/s;B=this.bounds.height/s;this.paintTableForeground(g,r,D,v,B)}};d.prototype.paintTableForeground=function(g,r,D,v,B){v=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(B=0;B<v.length;B++)b.prototype.paintTableLine(g,v[B],r,D)};d.prototype.configurePointerEvents=function(g){0==this.getTitleSize()?
g.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",d);mxUtils.extend(m,d);m.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",m);var L=mxSwimlane.prototype.paintVertexShape;mxSwimlane.prototype.paintVertexShape=function(g,r,D,v,B){L.apply(this,arguments);if(null!=this.state&&!this.outline){var G=this.state.view.graph;if((null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.laneFill&&this.laneFill!=
-mxConstants.NONE)&&null!=G.paintTableCellLines){var I=this.state.cell;if(null!=G.isTableRow&&G.isTableRow(I)){var ba=this.getTitleSize();this.isHorizontal()?G.paintTableCellLines(g,I,0,0,v,Math.min(ba,B),this.stroke,this.strokewidth):G.paintTableCellLines(g,I,0,0,Math.min(ba,v),B,this.stroke,this.strokewidth)}else G.paintTableCellLines(g,I,0,0,v,B,this.stroke,this.strokewidth)}}};mxUtils.extend(p,mxCylinder);p.prototype.size=20;p.prototype.darkOpacity=0;p.prototype.darkOpacity2=0;p.prototype.paintVertexShape=
-function(g,r,D,v,B){var G=Math.max(0,Math.min(v,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ba=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));g.translate(r,D);g.begin();g.moveTo(0,0);g.lineTo(v-G,0);g.lineTo(v,G);g.lineTo(v,B);g.lineTo(G,B);g.lineTo(0,B-G);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),
-0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(v-G,0),g.lineTo(v,G),g.lineTo(G,G),g.close(),g.fill()),0!=ba&&(g.setFillAlpha(Math.abs(ba)),g.setFillColor(0>ba?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(G,G),g.lineTo(G,B),g.lineTo(0,B-G),g.close(),g.fill()),g.begin(),g.moveTo(G,B),g.lineTo(G,G),g.lineTo(0,0),g.moveTo(G,G),g.lineTo(v,G),g.end(),g.stroke())};p.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,
+mxConstants.NONE)&&null!=G.paintTableCellLines){var I=this.state.cell;if(null!=G.isTableRow&&G.isTableRow(I)){var ca=this.getTitleSize();this.isHorizontal()?G.paintTableCellLines(g,I,0,0,v,Math.min(ca,B),this.stroke,this.strokewidth):G.paintTableCellLines(g,I,0,0,Math.min(ca,v),B,this.stroke,this.strokewidth)}else G.paintTableCellLines(g,I,0,0,v,B,this.stroke,this.strokewidth)}}};mxUtils.extend(p,mxCylinder);p.prototype.size=20;p.prototype.darkOpacity=0;p.prototype.darkOpacity2=0;p.prototype.paintVertexShape=
+function(g,r,D,v,B){var G=Math.max(0,Math.min(v,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ca=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));g.translate(r,D);g.begin();g.moveTo(0,0);g.lineTo(v-G,0);g.lineTo(v,G);g.lineTo(v,B);g.lineTo(G,B);g.lineTo(0,B-G);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),
+0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(v-G,0),g.lineTo(v,G),g.lineTo(G,G),g.close(),g.fill()),0!=ca&&(g.setFillAlpha(Math.abs(ca)),g.setFillColor(0>ca?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(G,G),g.lineTo(G,B),g.lineTo(0,B-G),g.close(),g.fill()),g.begin(),g.moveTo(G,B),g.lineTo(G,G),g.lineTo(0,0),g.moveTo(G,G),g.lineTo(v,G),g.end(),g.stroke())};p.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,
"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(g,g,0,0)):null};mxCellRenderer.registerShape("cube",p);var M=Math.tan(mxUtils.toRadians(30)),S=(.5-M)/2;mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(t,mxConnector);t.prototype.paintEdgeShape=function(g,r){var D=this.createMarker(g,r,!0),v=this.createMarker(g,r,!1);g.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&g.setDashed(this.isDashed,
null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);g.setShadow(!1);g.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);g.setStrokeColor(this.stroke);g.setFillColor(this.stroke);g.setDashed(!1);null!=D&&D();null!=v&&v()};mxCellRenderer.registerShape("wire",t);mxUtils.extend(n,mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(g,r,D,v,B){g.setFillColor(this.stroke);var G=Math.max(0,parseFloat(mxUtils.getValue(this.style,
"size",this.size))-2)+2*this.strokewidth;g.ellipse(r+.5*(v-G),D+.5*(B-G),G,G);g.fill();g.setFillColor(mxConstants.NONE);g.rect(r,D,v,B);g.fill()};mxCellRenderer.registerShape("waypoint",n);mxUtils.extend(y,mxActor);y.prototype.size=20;y.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(v,B/M);g.translate((v-r)/2,(B-r)/2+r/4);g.moveTo(0,.25*r);g.lineTo(.5*r,r*S);g.lineTo(r,.25*r);g.lineTo(.5*r,(.5-S)*r);g.lineTo(0,.25*r);g.close();g.end()};mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(C,
@@ -3258,14 +3259,14 @@ G);g.close();g.fillAndStroke();g.setShadow(!1);g.begin();g.moveTo(0,G);g.lineTo(
v,G,0,0,1,v,G),g.lineTo(v,B-G),g.arcTo(.5*v,G,0,0,1,.5*v,B),g.arcTo(.5*v,G,0,0,1,0,B-G),g.close(),g.fillAndStroke(),g.setShadow(!1),g.begin(),g.moveTo(v,G),g.arcTo(.5*v,G,0,0,1,.5*v,2*G),g.arcTo(.5*v,G,0,0,1,0,G),g.stroke())};mxCellRenderer.registerShape("cylinder2",c);mxUtils.extend(f,mxCylinder);f.prototype.size=15;f.prototype.paintVertexShape=function(g,r,D,v,B){var G=Math.max(0,Math.min(.5*B,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),I=mxUtils.getValue(this.style,"lid",!0);g.translate(r,
D);0==G?(g.rect(0,0,v,B),g.fillAndStroke()):(g.begin(),I?(g.moveTo(0,G),g.arcTo(.5*v,G,0,0,1,.5*v,0),g.arcTo(.5*v,G,0,0,1,v,G)):(g.moveTo(0,0),g.arcTo(.5*v,G,0,0,0,.5*v,G),g.arcTo(.5*v,G,0,0,0,v,0)),g.lineTo(v,B-G),g.arcTo(.5*v,G,0,0,1,.5*v,B),g.arcTo(.5*v,G,0,0,1,0,B-G),g.close(),g.fillAndStroke(),g.setShadow(!1),I&&(g.begin(),g.moveTo(v,G),g.arcTo(.5*v,G,0,0,1,.5*v,2*G),g.arcTo(.5*v,G,0,0,1,0,G),g.stroke()))};mxCellRenderer.registerShape("cylinder3",f);mxUtils.extend(l,mxActor);l.prototype.redrawPath=
function(g,r,D,v,B){g.moveTo(0,0);g.quadTo(v/2,.5*B,v,0);g.quadTo(.5*v,B/2,v,B);g.quadTo(v/2,.5*B,0,B);g.quadTo(.5*v,B/2,0,0);g.end()};mxCellRenderer.registerShape("switch",l);mxUtils.extend(q,mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));
-D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var G=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),I=mxUtils.getValue(this.style,"rounded",!1),ba=mxUtils.getValue(this.style,"absoluteArcSize",!1),U=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ba||(U*=Math.min(v,B));U=Math.min(U,.5*v,.5*(B-D));r=Math.max(r,U);r=Math.min(v-U,r);I||(U=0);g.begin();"left"==G?(g.moveTo(Math.max(U,0),D),g.lineTo(Math.max(U,0),0),g.lineTo(r,
-0),g.lineTo(r,D)):(g.moveTo(v-r,D),g.lineTo(v-r,0),g.lineTo(v-Math.max(U,0),0),g.lineTo(v-Math.max(U,0),D));I?(g.moveTo(0,U+D),g.arcTo(U,U,0,0,1,U,D),g.lineTo(v-U,D),g.arcTo(U,U,0,0,1,v,U+D),g.lineTo(v,B-U),g.arcTo(U,U,0,0,1,v-U,B),g.lineTo(U,B),g.arcTo(U,U,0,0,1,0,B-U)):(g.moveTo(0,D),g.lineTo(v,D),g.lineTo(v,B),g.lineTo(0,B));g.close();g.fillAndStroke();g.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(g.begin(),g.moveTo(v-30,D+20),g.lineTo(v-20,D+10),g.lineTo(v-10,
+D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var G=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),I=mxUtils.getValue(this.style,"rounded",!1),ca=mxUtils.getValue(this.style,"absoluteArcSize",!1),T=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ca||(T*=Math.min(v,B));T=Math.min(T,.5*v,.5*(B-D));r=Math.max(r,T);r=Math.min(v-T,r);I||(T=0);g.begin();"left"==G?(g.moveTo(Math.max(T,0),D),g.lineTo(Math.max(T,0),0),g.lineTo(r,
+0),g.lineTo(r,D)):(g.moveTo(v-r,D),g.lineTo(v-r,0),g.lineTo(v-Math.max(T,0),0),g.lineTo(v-Math.max(T,0),D));I?(g.moveTo(0,T+D),g.arcTo(T,T,0,0,1,T,D),g.lineTo(v-T,D),g.arcTo(T,T,0,0,1,v,T+D),g.lineTo(v,B-T),g.arcTo(T,T,0,0,1,v-T,B),g.lineTo(T,B),g.arcTo(T,T,0,0,1,0,B-T)):(g.moveTo(0,D),g.lineTo(v,D),g.lineTo(v,B),g.lineTo(0,B));g.close();g.fillAndStroke();g.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(g.begin(),g.moveTo(v-30,D+20),g.lineTo(v-20,D+10),g.lineTo(v-10,
D+20),g.close(),g.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var D=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var v=mxUtils.getValue(this.style,"rounded",!1),B=mxUtils.getValue(this.style,"absoluteArcSize",!1),G=parseFloat(mxUtils.getValue(this.style,
"arcSize",this.arcSize));B||(G*=Math.min(g.width,g.height));G=Math.min(G,.5*g.width,.5*(g.height-r));v||(G=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(G,0,Math.min(g.width,g.width-D),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-D),0,G,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};mxUtils.extend(x,mxCylinder);x.prototype.arcSize=.1;x.prototype.paintVertexShape=function(g,r,D,
v,B){g.translate(r,D);var G=mxUtils.getValue(this.style,"rounded",!1),I=mxUtils.getValue(this.style,"absoluteArcSize",!1);r=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));D=mxUtils.getValue(this.style,"umlStateConnection",null);I||(r*=Math.min(v,B));r=Math.min(r,.5*v,.5*B);G||(r=0);G=0;null!=D&&(G=10);g.begin();g.moveTo(G,r);g.arcTo(r,r,0,0,1,G+r,0);g.lineTo(v-r,0);g.arcTo(r,r,0,0,1,v,r);g.lineTo(v,B-r);g.arcTo(r,r,0,0,1,v-r,B);g.lineTo(G+r,B);g.arcTo(r,r,0,0,1,G,B-r);g.close();g.fillAndStroke();
g.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(g.roundrect(v-40,B-20,10,10,3,3),g.stroke(),g.roundrect(v-20,B-20,10,10,3,3),g.stroke(),g.begin(),g.moveTo(v-30,B-15),g.lineTo(v-20,B-15),g.stroke());"connPointRefEntry"==D?(g.ellipse(0,.5*B-10,20,20),g.fillAndStroke()):"connPointRefExit"==D&&(g.ellipse(0,.5*B-10,20,20),g.fillAndStroke(),g.begin(),g.moveTo(5,.5*B-5),g.lineTo(15,.5*B+5),g.moveTo(15,.5*B-5),g.lineTo(5,.5*B+5),g.stroke())};x.prototype.getLabelMargins=
function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};mxCellRenderer.registerShape("umlState",x);mxUtils.extend(A,mxShape);A.prototype.featureColor="#666666";A.prototype.paintVertexShape=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"smileyType","happy"),I=mxUtils.getValue(this.style,"smileyFeatureColor",A.prototype.featureColor);g.translate(r,D);r=Math.min(v,B)/2;g.ellipse(v/
-2-r,B/2-r,2*r,2*r);g.fillAndStroke();r=Math.min(v,B)/30;v/=2;B/=2;g.setFillColor(I);g.setStrokeColor(I);g.setStrokeWidth(2*r);I=1.5*r;D=5*r;var ba=5*r;g.ellipse(v-D-I,B-ba-I,2*I,2*I);g.fillAndStroke();g.ellipse(v+D-I,B-ba-I,2*I,2*I);g.fillAndStroke();g.setStrokeWidth(1*r);g.setFillColor("#000000");"happy"==G?(G=v,I=B+2*r,g.begin(),g.moveTo(G+7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,G-7.5*r,I),g.lineTo(G-6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,G+6.818*r,I),g.close(),g.fillAndStroke()):"sad"==G?(G=v,I=B+
+2-r,B/2-r,2*r,2*r);g.fillAndStroke();r=Math.min(v,B)/30;v/=2;B/=2;g.setFillColor(I);g.setStrokeColor(I);g.setStrokeWidth(2*r);I=1.5*r;D=5*r;var ca=5*r;g.ellipse(v-D-I,B-ca-I,2*I,2*I);g.fillAndStroke();g.ellipse(v+D-I,B-ca-I,2*I,2*I);g.fillAndStroke();g.setStrokeWidth(1*r);g.setFillColor("#000000");"happy"==G?(G=v,I=B+2*r,g.begin(),g.moveTo(G+7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,G-7.5*r,I),g.lineTo(G-6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,G+6.818*r,I),g.close(),g.fillAndStroke()):"sad"==G?(G=v,I=B+
7*r,g.begin(),g.moveTo(G-7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,G+7.5*r,I),g.lineTo(G+6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,G-6.818*r,I),g.close(),g.fillAndStroke()):(g.begin(),g.moveTo(v-5*r,B+7*r),g.lineTo(v+5*r,B+7*r),g.stroke())};mxCellRenderer.registerShape("smileyFace",A);mxUtils.extend(E,mxActor);E.prototype.size=30;E.prototype.isRoundable=function(){return!0};E.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));
D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(v,0),new mxPoint(v,B),new mxPoint(0,B),new mxPoint(0,r)],this.isRounded,D,!0);g.end()};mxCellRenderer.registerShape("card",E);mxUtils.extend(K,mxActor);K.prototype.size=.4;K.prototype.redrawPath=function(g,r,D,v,B){r=B*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,r/2);g.quadTo(v/4,1.4*r,v/2,r/2);g.quadTo(3*v/4,r*(1-1.4),
v,r/2);g.lineTo(v,B-r/2);g.quadTo(3*v/4,B-1.4*r,v/2,B-r/2);g.quadTo(v/4,B-r*(1-1.4),0,B-r/2);g.lineTo(0,r/2);g.close();g.end()};K.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",this.size),D=g.width,v=g.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return r*=v,new mxRectangle(g.x,g.y+r,D,v-2*r);r*=D;return new mxRectangle(g.x+r,g.y,D-2*r,v)}return g};
@@ -3280,7 +3281,7 @@ this.fixedSize)))):v*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.sty
"size",this.size))));D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(v,0),new mxPoint(r,0),new mxPoint(r,B/2),new mxPoint(0,B/2),new mxPoint(r,B/2),new mxPoint(r,B),new mxPoint(v,B)],this.isRounded,D,!1);g.end()};mxCellRenderer.registerShape("curlyBracket",ia);mxUtils.extend(Y,mxActor);Y.prototype.redrawPath=function(g,r,D,v,B){g.setStrokeWidth(1);g.setFillColor(this.stroke);r=v/5;g.rect(0,0,r,B);g.fillAndStroke();g.rect(2*r,0,r,B);
g.fillAndStroke();g.rect(4*r,0,r,B);g.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",Y);aa.prototype.moveTo=function(g,r){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;this.firstX=g;this.firstY=r};aa.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};aa.prototype.quadTo=function(g,r,D,v){this.originalQuadTo.apply(this.canvas,
arguments);this.lastX=D;this.lastY=v};aa.prototype.curveTo=function(g,r,D,v,B,G){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=B;this.lastY=G};aa.prototype.arcTo=function(g,r,D,v,B,G,I){this.originalArcTo.apply(this.canvas,arguments);this.lastX=G;this.lastY=I};aa.prototype.lineTo=function(g,r){if(null!=this.lastX&&null!=this.lastY){var D=function(pa){return"number"===typeof pa?pa?0>pa?-1:1:pa===pa?0:NaN:NaN},v=Math.abs(g-this.lastX),B=Math.abs(r-this.lastY),G=Math.sqrt(v*v+B*B);if(2>
-G){this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;return}var I=Math.round(G/10),ba=this.defaultVariation;5>I&&(I=5,ba/=3);var U=D(g-this.lastX)*v/I;D=D(r-this.lastY)*B/I;v/=G;B/=G;for(G=0;G<I;G++){var za=(Math.random()-.5)*ba;this.originalLineTo.call(this.canvas,U*G+this.lastX-za*B,D*G+this.lastY-za*v)}this.originalLineTo.call(this.canvas,g,r)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r};aa.prototype.destroy=function(){this.canvas.lineTo=
+G){this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;return}var I=Math.round(G/10),ca=this.defaultVariation;5>I&&(I=5,ca/=3);var T=D(g-this.lastX)*v/I;D=D(r-this.lastY)*B/I;v/=G;B/=G;for(G=0;G<I;G++){var za=(Math.random()-.5)*ca;this.originalLineTo.call(this.canvas,T*G+this.lastX-za*B,D*G+this.lastY-za*v)}this.originalLineTo.call(this.canvas,g,r)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r};aa.prototype.destroy=function(){this.canvas.lineTo=
this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var da=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(g){da.apply(this,arguments);null==g.handJiggle&&(g.handJiggle=this.createHandJiggle(g))};var na=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(g){na.apply(this,arguments);null!=g.handJiggle&&
(g.handJiggle.destroy(),delete g.handJiggle)};var ra=mxShape.prototype.updateBoundingBox;mxShape.prototype.updateBoundingBox=function(){ra.apply(this,arguments);if(!(this.useSvgBoundingBox||null==this.boundingBox||this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")&&"0"==mxUtils.getValue(this.style,"comic","0"))){var g=this.getSvgBoundingBox();null!=g&&(this.augmentShadowBoundingBox(g),this.boundingBox.add(g))}};mxShape.prototype.createComicCanvas=function(g){return new aa(g,
mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(g){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(g)};var wa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&wa.apply(this,
@@ -3289,68 +3290,68 @@ arguments)};var ya=mxRectangleShape.prototype.paintBackground;mxRectangleShape.p
D),g.lineTo(r+v,D),g.lineTo(r+v,D+B),g.lineTo(r,D+B),g.lineTo(r,D)),g.close(),g.end(),g.fillAndStroke()}};mxUtils.extend(ja,mxRectangleShape);ja.prototype.size=.1;ja.prototype.fixedSize=!1;ja.prototype.isHtmlAllowed=function(){return!1};ja.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var r=g.width,D=g.height;g=new mxRectangle(g.x,
g.y,r,D);var v=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),B=parseFloat(mxUtils.getValue(this.style,"size",this.size));v?B=Math.max(0,Math.min(r,B*this.scale)):(B=r*Math.max(0,Math.min(1,B)),this.isRounded&&(v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,B=Math.max(B,Math.min(r*v,D*v))));g.x+=Math.round(B);g.width-=Math.round(2*B);return g}return g};ja.prototype.paintForeground=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,
"fixedSize",this.fixedSize),I=parseFloat(mxUtils.getValue(this.style,"size",this.size));I=G?Math.max(0,Math.min(v,I)):v*Math.max(0,Math.min(1,I));this.isRounded&&(G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,I=Math.max(I,Math.min(v*G,B*G)));I=Math.round(I);g.begin();g.moveTo(r+I,D);g.lineTo(r+I,D+B);g.moveTo(r+v-I,D);g.lineTo(r+v-I,D+B);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",
-ja);mxCellRenderer.registerShape("process2",ja);mxUtils.extend(ka,mxRectangleShape);ka.prototype.paintBackground=function(g,r,D,v,B){g.setFillColor(mxConstants.NONE);g.rect(r,D,v,B);g.fill()};ka.prototype.paintForeground=function(g,r,D,v,B){};mxCellRenderer.registerShape("transparent",ka);mxUtils.extend(ua,mxHexagon);ua.prototype.size=30;ua.prototype.position=.5;ua.prototype.position2=.5;ua.prototype.base=20;ua.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,
-"size",this.size))*this.scale)};ua.prototype.isRoundable=function(){return!0};ua.prototype.redrawPath=function(g,r,D,v,B){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var G=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),I=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),ba=Math.max(0,Math.min(v,
-parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,B-D),new mxPoint(Math.min(v,G+ba),B-D),new mxPoint(I,B),new mxPoint(Math.max(0,G),B-D),new mxPoint(0,B-D)],this.isRounded,r,!0,[4])};mxCellRenderer.registerShape("callout",ua);mxUtils.extend(Da,mxActor);Da.prototype.tipX=-.25;Da.prototype.tipY=1;Da.prototype.base=20;Da.prototype.maxTipOffset=100;Da.prototype.isRoundable=function(){return!0};Da.prototype.getTipOffset=function(){var g=
+ja);mxCellRenderer.registerShape("process2",ja);mxUtils.extend(la,mxRectangleShape);la.prototype.paintBackground=function(g,r,D,v,B){g.setFillColor(mxConstants.NONE);g.rect(r,D,v,B);g.fill()};la.prototype.paintForeground=function(g,r,D,v,B){};mxCellRenderer.registerShape("transparent",la);mxUtils.extend(ua,mxHexagon);ua.prototype.size=30;ua.prototype.position=.5;ua.prototype.position2=.5;ua.prototype.base=20;ua.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,
+"size",this.size))*this.scale)};ua.prototype.isRoundable=function(){return!0};ua.prototype.redrawPath=function(g,r,D,v,B){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var G=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),I=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),ca=Math.max(0,Math.min(v,
+parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,B-D),new mxPoint(Math.min(v,G+ca),B-D),new mxPoint(I,B),new mxPoint(Math.max(0,G),B-D),new mxPoint(0,B-D)],this.isRounded,r,!0,[4])};mxCellRenderer.registerShape("callout",ua);mxUtils.extend(Da,mxActor);Da.prototype.tipX=-.25;Da.prototype.tipY=1;Da.prototype.base=20;Da.prototype.maxTipOffset=100;Da.prototype.isRoundable=function(){return!0};Da.prototype.getTipOffset=function(){var g=
this.maxTipOffset,r=parseFloat(mxUtils.getValue(this.style,"tipX",this.tipX)),D=parseFloat(mxUtils.getValue(this.style,"tipY",this.tipY));return new mxPoint(Math.max(-g,Math.min(g,isFinite(r)?r:this.tipX)),Math.max(-g,Math.min(g,isFinite(D)?D:this.tipY)))};Da.prototype.getTailPoints=function(g,r){var D=this.getTipOffset(),v=D.x*g;D=D.y*r;if(Math.abs(v)<=g/2&&Math.abs(D)<=r/2)return null;var B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,G=parseFloat(mxUtils.getValue(this.style,
"base",this.base));G=isFinite(G)?Math.max(0,G):this.base;B=this.isRounded?B:0;var I=new mxPoint(g/2+v,r/2+D);if(Math.abs(v)*r>=Math.abs(D)*g&&0!=v)return B=Math.min(B,r/2),G=Math.max(0,Math.min(G,r-2*B))/2,D=r/2+g/2*D/Math.abs(v),D=Math.max(B+G,Math.min(r-B-G,D)),0<v?{points:[new mxPoint(g,D-G),I,new mxPoint(g,D+G)],index:2}:{points:[new mxPoint(0,D+G),I,new mxPoint(0,D-G)],index:4};B=Math.min(B,g/2);G=Math.max(0,Math.min(G,g-2*B))/2;v=g/2+r/2*v/Math.abs(D);v=Math.max(B+G,Math.min(g-B-G,v));return 0<
D?{points:[new mxPoint(v+G,r),I,new mxPoint(v-G,r)],index:3}:{points:[new mxPoint(v-G,0),I,new mxPoint(v+G,0)],index:1}};Da.prototype.redrawPath=function(g,r,D,v,B){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;D=[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,B),new mxPoint(0,B)];v=this.getTailPoints(v,B);B=null;null!=v&&(D.splice.apply(D,[v.index,0].concat(v.points)),B=[v.index,v.index+1,v.index+2]);this.addPoints(g,D,this.isRounded,r,!0,B)};Da.prototype.getShapeBoundingBox=
-function(){var g=mxShape.prototype.getShapeBoundingBox.apply(this,arguments);if(null!=g&&null!=this.bounds){var r=this.createBoundingBox(),D=this.scale,v=r.width/D,B=r.height/D,G=this.getTailPoints(v,B);if(null!=G){var I=G.points[1],ba=r.x+r.width/2;r=r.y+r.height/2;D=new mxRectangle(ba+(I.x-v/2)*D*(this.flipH?-1:1),r+(I.y-B/2)*D*(this.flipV?-1:1),0,0);this.augmentBoundingBox(D);v=G.points[0].x-I.x;B=G.points[0].y-I.y;var U=G.points[2].x-I.x;G=G.points[2].y-I.y;I=Math.sqrt(v*v+B*B);var za=Math.sqrt(U*
-U+G*G);0<I&&0<za&&(G=Math.sqrt((1-Math.max(-1,Math.min(1,(v*U+B*G)/(I*za))))/2),D.grow(((0<G?Math.min(10,1/G):10)-1)*this.strokewidth*this.scale/2));G=this.getShapeRotation();0!=G&&(D=mxUtils.getBoundingBox(D,G,new mxPoint(ba,r)));g.add(D)}}return g};mxCellRenderer.registerShape("wedgeCallout",Da);mxUtils.extend(ha,mxActor);ha.prototype.size=.2;ha.prototype.fixedSize=20;ha.prototype.isRoundable=function(){return!0};ha.prototype.redrawPath=function(g,r,D,v,B){r="0"!=mxUtils.getValue(this.style,"fixedSize",
+function(){var g=mxShape.prototype.getShapeBoundingBox.apply(this,arguments);if(null!=g&&null!=this.bounds){var r=this.createBoundingBox(),D=this.scale,v=r.width/D,B=r.height/D,G=this.getTailPoints(v,B);if(null!=G){var I=G.points[1],ca=r.x+r.width/2;r=r.y+r.height/2;D=new mxRectangle(ca+(I.x-v/2)*D*(this.flipH?-1:1),r+(I.y-B/2)*D*(this.flipV?-1:1),0,0);this.augmentBoundingBox(D);v=G.points[0].x-I.x;B=G.points[0].y-I.y;var T=G.points[2].x-I.x;G=G.points[2].y-I.y;I=Math.sqrt(v*v+B*B);var za=Math.sqrt(T*
+T+G*G);0<I&&0<za&&(G=Math.sqrt((1-Math.max(-1,Math.min(1,(v*T+B*G)/(I*za))))/2),D.grow(((0<G?Math.min(10,1/G):10)-1)*this.strokewidth*this.scale/2));G=this.getShapeRotation();0!=G&&(D=mxUtils.getBoundingBox(D,G,new mxPoint(ca,r)));g.add(D)}}return g};mxCellRenderer.registerShape("wedgeCallout",Da);mxUtils.extend(ha,mxActor);ha.prototype.size=.2;ha.prototype.fixedSize=20;ha.prototype.isRoundable=function(){return!0};ha.prototype.redrawPath=function(g,r,D,v,B){r="0"!=mxUtils.getValue(this.style,"fixedSize",
"0")?Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v-r,0),new mxPoint(v,B/2),new mxPoint(v-r,B),new mxPoint(0,B),new mxPoint(r,B/2)],this.isRounded,D,!0);g.end()};mxCellRenderer.registerShape("step",ha);mxUtils.extend(k,mxHexagon);k.prototype.size=
.25;k.prototype.fixedSize=20;k.prototype.isRoundable=function(){return!0};k.prototype.redrawPath=function(g,r,D,v,B){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(v-r,0),new mxPoint(v,.5*B),
new mxPoint(v-r,B),new mxPoint(r,B),new mxPoint(0,.5*B)],this.isRounded,D,!0)};mxCellRenderer.registerShape("hexagon",k);mxUtils.extend(u,mxRectangleShape);u.prototype.isHtmlAllowed=function(){return!1};u.prototype.paintForeground=function(g,r,D,v,B){var G=Math.min(v/5,B/5)+1;g.begin();g.moveTo(r+v/2,D+G);g.lineTo(r+v/2,D+B-G);g.moveTo(r+G,D+B/2);g.lineTo(r+v-G,D+B/2);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",u);var Ma=
-mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};mxRhombus.prototype.paintVertexShape=function(g,r,D,v,B){Ma.apply(this,arguments);var G=r,I=D,ba=v,U=B;if(!this.outline&&1==this.style["double"]){var za=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
-0);r+=za;D+=za;v-=2*za;B-=2*za;0<v&&0<B&&(g.setShadow(!1),Ma.apply(this,[g,r,D,v,B]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(g,G,I,ba,U,0)};mxShape.prototype.paintGlassEffect=function(g,r,D,v,B,G){var I=Math.ceil(this.strokewidth/2);g.setGradient("#ffffff","#ffffff",r,D,v,.6*B,"south",.9,.1);g.begin();this.paintGlassEffectPath(g,r,D,v,B,I,G);g.close();g.fill()};mxShape.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){I+=2*G;this.isRounded?
+mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};mxRhombus.prototype.paintVertexShape=function(g,r,D,v,B){Ma.apply(this,arguments);var G=r,I=D,ca=v,T=B;if(!this.outline&&1==this.style["double"]){var za=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
+0);r+=za;D+=za;v-=2*za;B-=2*za;0<v&&0<B&&(g.setShadow(!1),Ma.apply(this,[g,r,D,v,B]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(g,G,I,ca,T,0)};mxShape.prototype.paintGlassEffect=function(g,r,D,v,B,G){var I=Math.ceil(this.strokewidth/2);g.setGradient("#ffffff","#ffffff",r,D,v,.6*B,"south",.9,.1);g.begin();this.paintGlassEffectPath(g,r,D,v,B,I,G);g.close();g.fill()};mxShape.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){I+=2*G;this.isRounded?
(g.moveTo(r-G+I,D-G),g.quadTo(r-G,D-G,r-G,D-G+I),g.lineTo(r-G,D+.4*B),g.quadTo(r+.5*v,D+.7*B,r+v+G,D+.4*B),g.lineTo(r+v+G,D-G+I),g.quadTo(r+v+G,D-G,r+v+G-I,D-G)):(g.moveTo(r-G,D-G),g.lineTo(r-G,D+.4*B),g.quadTo(r+.5*v,D+.7*B,r+v+G,D+.4*B),g.lineTo(r+v+G,D-G))};mxEllipse.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){I=v/2+G;G=B/2+G;r+=v/2;D+=B/2;g.moveTo(r-I,D);g.curveTo(r-I,D-.5522847498*G,r-.5522847498*I,D-G,r,D-G);g.curveTo(r+.5522847498*I,D-G,r+I,D-.5522847498*G,r+I,D);g.quadTo(r,D+.2*
-B,r-I,D)};mxRhombus.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){G=v/2;I=B/2;var ba=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,D+I),new mxPoint(r+G,D),new mxPoint(r+v,D+I)],this.isRounded,ba,!1);g.quadTo(r+G,D+.7*B,r,D+I)};var Za=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(g,r,D,v,B){Za.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&
+B,r-I,D)};mxRhombus.prototype.paintGlassEffectPath=function(g,r,D,v,B,G,I){G=v/2;I=B/2;var ca=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,D+I),new mxPoint(r+G,D),new mxPoint(r+v,D+I)],this.isRounded,ca,!1);g.quadTo(r+G,D+.7*B,r,D+I)};var Za=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(g,r,D,v,B){Za.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&
this.paintGlassEffect(g,r,D,v,B,0)};mxUtils.extend(H,mxRectangleShape);H.prototype.isHtmlAllowed=function(){return!1};H.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};H.prototype.paintForeground=function(g,r,D,v,B){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var G=Math.max(2,this.strokewidth+
-1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);r+=G;D+=G;v-=2*G;B-=2*G;0<v&&0<B&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}g.setDashed(!1);G=0;do{var I=mxCellRenderer.defaultShapes[this.style["symbol"+G]];if(null!=I){var ba=this.style["symbol"+G+"Align"],U=this.style["symbol"+G+"VerticalAlign"],za=this.style["symbol"+G+"Width"],pa=this.style["symbol"+G+"Height"],Xa=this.style["symbol"+G+"Spacing"]||0,vb=this.style["symbol"+G+"VSpacing"]||Xa,jb=this.style["symbol"+G+
-"ArcSpacing"];null!=jb&&(jb*=this.getArcSize(v+this.strokewidth,B+this.strokewidth),Xa+=jb,vb+=jb);jb=r;var Sa=D;jb=ba==mxConstants.ALIGN_CENTER?jb+(v-za)/2:ba==mxConstants.ALIGN_RIGHT?jb+(v-za-Xa):jb+Xa;Sa=U==mxConstants.ALIGN_MIDDLE?Sa+(B-pa)/2:U==mxConstants.ALIGN_BOTTOM?Sa+(B-pa-vb):Sa+vb;g.save();ba=new I;ba.style=this.style;I.prototype.paintVertexShape.call(ba,g,jb,Sa,za,pa);g.restore()}G++}while(null!=I)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",
-H);mxUtils.extend(P,mxCylinder);P.prototype.redrawPath=function(g,r,D,v,B,G){G?(g.moveTo(0,0),g.lineTo(v/2,B/2),g.lineTo(v,0),g.end()):(g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(0,B),g.close())};mxCellRenderer.registerShape("message",P);mxUtils.extend(T,mxShape);T.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.ellipse(v/4,0,v/2,B/4);g.fillAndStroke();g.begin();g.moveTo(v/2,B/4);g.lineTo(v/2,2*B/3);g.moveTo(v/2,B/3);g.lineTo(0,B/3);g.moveTo(v/2,B/3);g.lineTo(v,B/3);g.moveTo(v/
-2,2*B/3);g.lineTo(0,B);g.moveTo(v/2,2*B/3);g.lineTo(v,B);g.end();g.stroke()};mxCellRenderer.registerShape("umlActor",T);mxUtils.extend(W,mxShape);W.prototype.getLabelMargins=function(g){return new mxRectangle(g.width/6,0,0,0)};W.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(0,B/4);g.lineTo(0,3*B/4);g.end();g.stroke();g.begin();g.moveTo(0,B/2);g.lineTo(v/6,B/2);g.end();g.stroke();g.ellipse(v/6,0,5*v/6,B);g.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",
+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);r+=G;D+=G;v-=2*G;B-=2*G;0<v&&0<B&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}g.setDashed(!1);G=0;do{var I=mxCellRenderer.defaultShapes[this.style["symbol"+G]];if(null!=I){var ca=this.style["symbol"+G+"Align"],T=this.style["symbol"+G+"VerticalAlign"],za=this.style["symbol"+G+"Width"],pa=this.style["symbol"+G+"Height"],Xa=this.style["symbol"+G+"Spacing"]||0,vb=this.style["symbol"+G+"VSpacing"]||Xa,jb=this.style["symbol"+G+
+"ArcSpacing"];null!=jb&&(jb*=this.getArcSize(v+this.strokewidth,B+this.strokewidth),Xa+=jb,vb+=jb);jb=r;var Sa=D;jb=ca==mxConstants.ALIGN_CENTER?jb+(v-za)/2:ca==mxConstants.ALIGN_RIGHT?jb+(v-za-Xa):jb+Xa;Sa=T==mxConstants.ALIGN_MIDDLE?Sa+(B-pa)/2:T==mxConstants.ALIGN_BOTTOM?Sa+(B-pa-vb):Sa+vb;g.save();ca=new I;ca.style=this.style;I.prototype.paintVertexShape.call(ca,g,jb,Sa,za,pa);g.restore()}G++}while(null!=I)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",
+H);mxUtils.extend(P,mxCylinder);P.prototype.redrawPath=function(g,r,D,v,B,G){G?(g.moveTo(0,0),g.lineTo(v/2,B/2),g.lineTo(v,0),g.end()):(g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(0,B),g.close())};mxCellRenderer.registerShape("message",P);mxUtils.extend(U,mxShape);U.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.ellipse(v/4,0,v/2,B/4);g.fillAndStroke();g.begin();g.moveTo(v/2,B/4);g.lineTo(v/2,2*B/3);g.moveTo(v/2,B/3);g.lineTo(0,B/3);g.moveTo(v/2,B/3);g.lineTo(v,B/3);g.moveTo(v/
+2,2*B/3);g.lineTo(0,B);g.moveTo(v/2,2*B/3);g.lineTo(v,B);g.end();g.stroke()};mxCellRenderer.registerShape("umlActor",U);mxUtils.extend(W,mxShape);W.prototype.getLabelMargins=function(g){return new mxRectangle(g.width/6,0,0,0)};W.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(0,B/4);g.lineTo(0,3*B/4);g.end();g.stroke();g.begin();g.moveTo(0,B/2);g.lineTo(v/6,B/2);g.end();g.stroke();g.ellipse(v/6,0,5*v/6,B);g.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",
W);mxUtils.extend(fa,mxEllipse);fa.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+v/8,D+B);g.lineTo(r+7*v/8,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("umlEntity",fa);mxUtils.extend(X,mxShape);X.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(v,0);g.lineTo(0,B);g.moveTo(0,0);g.lineTo(v,B);g.end();g.stroke()};mxCellRenderer.registerShape("umlDestroy",X);mxUtils.extend(ea,mxShape);
-ea.prototype.getLabelBounds=function(g){return new mxRectangle(g.x,g.y+g.height/8,g.width,7*g.height/8)};ea.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(3*v/8,B/8*1.1);g.lineTo(5*v/8,0);g.end();g.stroke();g.ellipse(0,B/8,v,7*B/8);g.fillAndStroke()};ea.prototype.paintForeground=function(g,r,D,v,B){g.begin();g.moveTo(3*v/8,B/8*1.1);g.lineTo(5*v/8,B/4);g.end();g.stroke()};mxCellRenderer.registerShape("umlControl",ea);mxUtils.extend(la,mxShape);la.prototype.iconSize=
-44;la.prototype.paintBackground=function(g,r,D,v,B){B=Math.min(this.iconSize,v,B);var G=.9*B,I=.45*B;r=r+v/2-B/2;v=D+B/2;var ba=r+.175*G;G=ba-G;g.begin();g.moveTo(G,v-I/2);g.lineTo(G,v+I/2);g.end();g.stroke();g.begin();g.moveTo(G,v);g.lineTo(ba,v);g.end();g.stroke();g.ellipse(r,D,B,B);g.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",la);mxCellRenderer.registerShape("seqControl",oa(ea,44));mxCellRenderer.registerShape("seqEntity",oa(fa,44));mxUtils.extend(ca,mxShape);ca.prototype.paintBackground=
-function(g,r,D,v,B){var G=B/2,I=G/(2.5+B/50);g.save();g.translate(r,D);g.begin();g.moveTo(I,0);g.lineTo(v-I,0);g.arcTo(I,G,0,0,1,v-I,B);g.lineTo(I,B);g.arcTo(I,G,0,0,1,I,0);g.close();g.fillAndStroke();g.restore()};ca.prototype.paintForeground=function(g,r,D,v,B){var G=B/2,I=G/(2.5+B/50);g.save();g.translate(r,D);g.begin();g.moveTo(v-I,0);g.arcTo(I,G,0,0,0,v-I,B);g.stroke();g.restore()};mxCellRenderer.registerShape("seqQueue",ca);mxUtils.extend(sa,mxShape);sa.prototype.paintBackground=function(g,r,
-D,v,B){g.rect(r+6,D-6,v,B);g.fillAndStroke();g.rect(r,D,v,B);g.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",sa);mxUtils.extend(xa,mxShape);xa.prototype.paintBackground=function(g,r,D,v,B){B=v/3;var G=v/3,I=B/2,ba=I/(2.5+B/50);g.translate(r+(v-B)/2,D);g.begin();g.moveTo(0,ba);g.arcTo(I,ba,0,0,0,B,ba);g.arcTo(I,ba,0,0,0,0,ba);g.lineTo(0,G-ba);g.arcTo(I,ba,0,0,0,B,G-ba);g.lineTo(B,ba);g.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",xa);mxUtils.extend(qa,mxShape);qa.prototype.paintBackground=
+ea.prototype.getLabelBounds=function(g){return new mxRectangle(g.x,g.y+g.height/8,g.width,7*g.height/8)};ea.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(3*v/8,B/8*1.1);g.lineTo(5*v/8,0);g.end();g.stroke();g.ellipse(0,B/8,v,7*B/8);g.fillAndStroke()};ea.prototype.paintForeground=function(g,r,D,v,B){g.begin();g.moveTo(3*v/8,B/8*1.1);g.lineTo(5*v/8,B/4);g.end();g.stroke()};mxCellRenderer.registerShape("umlControl",ea);mxUtils.extend(ka,mxShape);ka.prototype.iconSize=
+44;ka.prototype.paintBackground=function(g,r,D,v,B){B=Math.min(this.iconSize,v,B);var G=.9*B,I=.45*B;r=r+v/2-B/2;v=D+B/2;var ca=r+.175*G;G=ca-G;g.begin();g.moveTo(G,v-I/2);g.lineTo(G,v+I/2);g.end();g.stroke();g.begin();g.moveTo(G,v);g.lineTo(ca,v);g.end();g.stroke();g.ellipse(r,D,B,B);g.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",ka);mxCellRenderer.registerShape("seqControl",oa(ea,44));mxCellRenderer.registerShape("seqEntity",oa(fa,44));mxUtils.extend(ba,mxShape);ba.prototype.paintBackground=
+function(g,r,D,v,B){var G=B/2,I=G/(2.5+B/50);g.save();g.translate(r,D);g.begin();g.moveTo(I,0);g.lineTo(v-I,0);g.arcTo(I,G,0,0,1,v-I,B);g.lineTo(I,B);g.arcTo(I,G,0,0,1,I,0);g.close();g.fillAndStroke();g.restore()};ba.prototype.paintForeground=function(g,r,D,v,B){var G=B/2,I=G/(2.5+B/50);g.save();g.translate(r,D);g.begin();g.moveTo(v-I,0);g.arcTo(I,G,0,0,0,v-I,B);g.stroke();g.restore()};mxCellRenderer.registerShape("seqQueue",ba);mxUtils.extend(sa,mxShape);sa.prototype.paintBackground=function(g,r,
+D,v,B){g.rect(r+6,D-6,v,B);g.fillAndStroke();g.rect(r,D,v,B);g.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",sa);mxUtils.extend(xa,mxShape);xa.prototype.paintBackground=function(g,r,D,v,B){B=v/3;var G=v/3,I=B/2,ca=I/(2.5+B/50);g.translate(r+(v-B)/2,D);g.begin();g.moveTo(0,ca);g.arcTo(I,ca,0,0,0,B,ca);g.arcTo(I,ca,0,0,0,0,ca);g.lineTo(0,G-ca);g.arcTo(I,ca,0,0,0,B,G-ca);g.lineTo(B,ca);g.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",xa);mxUtils.extend(qa,mxShape);qa.prototype.paintBackground=
function(g,r,D,v,B){r+=v/2;D+=15;v=D+15;B=v+20;var G=v+10,I=B+15;g.ellipse(r-15,D-15,30,30);g.fillAndStroke();g.begin();g.moveTo(r,v);g.lineTo(r,B);g.moveTo(r-18,G);g.lineTo(r+18,G);g.moveTo(r,B);g.lineTo(r-16,I);g.moveTo(r,B);g.lineTo(r+16,I);g.stroke()};mxCellRenderer.registerShape("seqActorStick",qa);mxUtils.extend(Ba,mxRectangleShape);Ba.prototype.size=40;Ba.prototype.isHtmlAllowed=function(){return!1};Ba.prototype.isMirrored=function(){return"1"==mxUtils.getValue(this.style,"lifelineMirror",
-"0")};Ba.prototype.getHeadSize=function(g){return Math.max(0,Math.min(this.isMirrored()?g/2:g,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};Ba.prototype.getLabelBounds=function(g){var r=Math.max(0,Math.min(this.isMirrored()?g.height/2:g.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(g.x,g.y,g.width,r)};Ba.prototype.paintBackground=function(g,r,D,v,B){var G=this.getHeadSize(B),I=this.isMirrored(),ba=mxUtils.getValue(this.style,"participant");
-null==ba||null==this.state?(mxRectangleShape.prototype.paintBackground.call(this,g,r,D,v,G),I&&mxRectangleShape.prototype.paintBackground.call(this,g,r,D+B-G,v,G)):(ba=this.state.view.graph.cellRenderer.getShape(ba),null!=ba&&ba!=Ba&&(ba=new ba,ba.apply(this.state),g.save(),ba.paintVertexShape(g,r,D,v,G),g.restore(),I&&(g.save(),ba.paintVertexShape(g,r,D+B-G,v,G),g.restore())));B=I?B-G:B;G<B&&(g.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),g.begin(),g.moveTo(r+v/2,D+G),g.lineTo(r+
-v/2,D+B),g.end(),g.stroke())};Ba.prototype.paintForeground=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"participant"),I=this.getHeadSize(B),ba=this.isMirrored();null==G&&(mxRectangleShape.prototype.paintForeground.call(this,g,r,D,v,Math.min(B,I)),ba&&mxRectangleShape.prototype.paintForeground.call(this,g,r,D+B-I,v,I));ba&&this.paintMirrorLabel(g,r,D+B-I,v,I)};Ba.prototype.paintMirrorLabel=function(g,r,D,v,B){var G=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue=
+"0")};Ba.prototype.getHeadSize=function(g){return Math.max(0,Math.min(this.isMirrored()?g/2:g,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};Ba.prototype.getLabelBounds=function(g){var r=Math.max(0,Math.min(this.isMirrored()?g.height/2:g.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(g.x,g.y,g.width,r)};Ba.prototype.paintBackground=function(g,r,D,v,B){var G=this.getHeadSize(B),I=this.isMirrored(),ca=mxUtils.getValue(this.style,"participant");
+null==ca||null==this.state?(mxRectangleShape.prototype.paintBackground.call(this,g,r,D,v,G),I&&mxRectangleShape.prototype.paintBackground.call(this,g,r,D+B-G,v,G)):(ca=this.state.view.graph.cellRenderer.getShape(ca),null!=ca&&ca!=Ba&&(ca=new ca,ca.apply(this.state),g.save(),ca.paintVertexShape(g,r,D,v,G),g.restore(),I&&(g.save(),ca.paintVertexShape(g,r,D+B-G,v,G),g.restore())));B=I?B-G:B;G<B&&(g.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),g.begin(),g.moveTo(r+v/2,D+G),g.lineTo(r+
+v/2,D+B),g.end(),g.stroke())};Ba.prototype.paintForeground=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"participant"),I=this.getHeadSize(B),ca=this.isMirrored();null==G&&(mxRectangleShape.prototype.paintForeground.call(this,g,r,D,v,Math.min(B,I)),ca&&mxRectangleShape.prototype.paintForeground.call(this,g,r,D+B-I,v,I));ca&&this.paintMirrorLabel(g,r,D+B-I,v,I)};Ba.prototype.paintMirrorLabel=function(g,r,D,v,B){var G=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue=
G;if(null!=G&&""!=G){g.setFontColor(mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"black"));g.setFontBackgroundColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null));g.setFontBorderColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null));g.setFontFamily(mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY));g.setFontSize(parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)));
-g.setFontStyle(parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0)));var I=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),ba=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),U=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,2)),za=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,0))+U,pa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,0))+U,Xa=parseFloat(mxUtils.getValue(this.style,
-mxConstants.STYLE_SPACING_LEFT,0))+U;U=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,0))+U;r=I==mxConstants.ALIGN_LEFT?r+Xa:I==mxConstants.ALIGN_RIGHT?r+v-U:r+v/2;D=ba==mxConstants.ALIGN_TOP?D+za+1:ba==mxConstants.ALIGN_BOTTOM?D+B-pa-1:D+B/2;B="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);za="1"==mxUtils.getValue(this.style,"html","0")?"html":"";"html"==za&&(G=Graph.sanitizeHtml(G));g.text(r,D,B?v-Xa-U:0,0,G,I,ba,B,za,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline",
+g.setFontStyle(parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0)));var I=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),ca=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),T=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,2)),za=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,0))+T,pa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,0))+T,Xa=parseFloat(mxUtils.getValue(this.style,
+mxConstants.STYLE_SPACING_LEFT,0))+T;T=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,0))+T;r=I==mxConstants.ALIGN_LEFT?r+Xa:I==mxConstants.ALIGN_RIGHT?r+v-T:r+v/2;D=ca==mxConstants.ALIGN_TOP?D+za+1:ca==mxConstants.ALIGN_BOTTOM?D+B-pa-1:D+B/2;B="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);za="1"==mxUtils.getValue(this.style,"html","0")?"html":"";"html"==za&&(G=Graph.sanitizeHtml(G));g.text(r,D,B?v-Xa-T:0,0,G,I,ca,B,za,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline",
Ba);var Ta=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(g,r){return Ta.apply(this,arguments)||void 0!==r.mirrorLabelValue&&r.mirrorLabelValue!=g.view.graph.getLabel(g.cell)};mxUtils.extend(ma,mxShape);ma.prototype.width=60;ma.prototype.height=30;ma.prototype.corner=10;ma.prototype.configurePointerEvents=function(g){var r=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=r&&r!=mxConstants.NONE&&0!=
this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(g.pointerEvents=!1)};ma.prototype.getLabelMargins=function(g){return new mxRectangle(0,0,g.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),g.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};ma.prototype.paintBackground=function(g,r,D,v,B){var G=this.corner,I=Math.min(v,Math.max(G,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),
-ba=Math.min(B,Math.max(1.5*G,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),U=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);U!=mxConstants.NONE&&(g.setFillColor(U),g.rect(r,D,v,B),g.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(g,r,D,v,B),g.setGradient(this.fill,this.gradient,r,D,v,B,this.gradientDirection)):g.setFillColor(this.fill);g.pointerEvents=!0;g.begin();g.moveTo(r,
-D);g.lineTo(r+I,D);g.lineTo(r+I,D+Math.max(0,ba-1.5*G));g.lineTo(r+Math.max(0,I-G),D+ba);g.lineTo(r,D+ba);g.close();g.fillAndStroke();this.configurePointerEvents(g);g.begin();g.moveTo(r+I,D);g.lineTo(r+v,D);g.lineTo(r+v,D+B);g.lineTo(r,D+B);g.lineTo(r,D+ba);g.stroke()};mxCellRenderer.registerShape("umlFrame",ma);mxPerimeter.CenterPerimeter=function(g,r,D,v){return new mxPoint(g.getCenterX(),g.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=
+ca=Math.min(B,Math.max(1.5*G,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),T=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);T!=mxConstants.NONE&&(g.setFillColor(T),g.rect(r,D,v,B),g.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(g,r,D,v,B),g.setGradient(this.fill,this.gradient,r,D,v,B,this.gradientDirection)):g.setFillColor(this.fill);g.pointerEvents=!0;g.begin();g.moveTo(r,
+D);g.lineTo(r+I,D);g.lineTo(r+I,D+Math.max(0,ca-1.5*G));g.lineTo(r+Math.max(0,I-G),D+ca);g.lineTo(r,D+ca);g.close();g.fillAndStroke();this.configurePointerEvents(g);g.begin();g.moveTo(r+I,D);g.lineTo(r+v,D);g.lineTo(r+v,D+B);g.lineTo(r,D+B);g.lineTo(r,D+ca);g.stroke()};mxCellRenderer.registerShape("umlFrame",ma);mxPerimeter.CenterPerimeter=function(g,r,D,v){return new mxPoint(g.getCenterX(),g.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=
function(g,r,D,v){v=Ba.prototype.size;var B=g.y+g.height;null!=r&&(v=mxUtils.getValue(r.style,"size",v)*r.view.scale,"1"==mxUtils.getValue(r.style,"lifelineMirror","0")&&(B-=v));r=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;D.x<g.getCenterX()&&(r=-1*(r+1));return new mxPoint(g.getCenterX()+r,Math.min(B,Math.max(g.y+v,D.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(g,r,D,v){v=!0;return mxPerimeter.RectanglePerimeter.apply(this,
arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(g,r,D,v){v=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;null!=r.style.backboneSize&&(v+=parseFloat(r.style.backboneSize)*r.view.scale/2-1);if("south"==r.style[mxConstants.STYLE_DIRECTION]||"north"==r.style[mxConstants.STYLE_DIRECTION])return D.x<g.getCenterX()&&(v=-1*(v+1)),new mxPoint(g.getCenterX()+v,Math.min(g.y+g.height,Math.max(g.y,D.y)));
D.y<g.getCenterY()&&(v=-1*(v+1));return new mxPoint(Math.min(g.x+g.width,Math.max(g.x,D.x)),g.getCenterY()+v)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(g,r,D,v){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(g,new mxRectangle(0,0,0,Math.max(0,Math.min(g.height,parseFloat(mxUtils.getValue(r.style,"size",ua.prototype.size))*r.view.scale))),r.style),r,D,v)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);
-mxPerimeter.ParallelogramPerimeter=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?V.prototype.fixedSize:V.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));B&&(G*=r.view.scale);var I=g.x,ba=g.y,U=g.width,za=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ba=
-[new mxPoint(I,ba),new mxPoint(I+U,ba+B),new mxPoint(I+U,ba+za),new mxPoint(I,ba+za-B),new mxPoint(I,ba)]):(B=B?Math.max(0,Math.min(.5*U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I+B,ba),new mxPoint(I+U,ba),new mxPoint(I+U-B,ba+za),new mxPoint(I,ba+za),new mxPoint(I+B,ba)]);za=g.getCenterX();g=g.getCenterY();g=new mxPoint(za,g);v&&(D.x<I||D.x>I+U?g.y=D.y:g.x=D.x);return mxUtils.getPerimeterPoint(ba,g,D)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=
-function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?J.prototype.fixedSize:J.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));B&&(G*=r.view.scale);var I=g.x,ba=g.y,U=g.width,za=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(B=B?Math.max(0,Math.min(.5*U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I+B,ba),new mxPoint(I+U-B,ba),new mxPoint(I+U,ba+za),
-new mxPoint(I,ba+za),new mxPoint(I+B,ba)]):r==mxConstants.DIRECTION_WEST?(B=B?Math.max(0,Math.min(U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I,ba),new mxPoint(I+U,ba),new mxPoint(I+U-B,ba+za),new mxPoint(I+B,ba+za),new mxPoint(I,ba)]):r==mxConstants.DIRECTION_NORTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I,ba+B),new mxPoint(I+U,ba),new mxPoint(I+U,ba+za),new mxPoint(I,ba+za-B),new mxPoint(I,ba+B)]):(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,
-G)),ba=[new mxPoint(I,ba),new mxPoint(I+U,ba+B),new mxPoint(I+U,ba+za-B),new mxPoint(I,ba+za),new mxPoint(I,ba)]);za=g.getCenterX();g=g.getCenterY();g=new mxPoint(za,g);v&&(D.x<I||D.x>I+U?g.y=D.y:g.x=D.x);return mxUtils.getPerimeterPoint(ba,g,D)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?ha.prototype.fixedSize:ha.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,
-"size",G));B&&(G*=r.view.scale);var I=g.x,ba=g.y,U=g.width,za=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(B=B?Math.max(0,Math.min(U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I,ba),new mxPoint(I+U-B,ba),new mxPoint(I+U,g),new mxPoint(I+U-B,ba+za),new mxPoint(I,ba+za),new mxPoint(I+B,g),new mxPoint(I,ba)]):r==mxConstants.DIRECTION_WEST?(B=B?Math.max(0,
-Math.min(U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I+B,ba),new mxPoint(I+U,ba),new mxPoint(I+U-B,g),new mxPoint(I+U,ba+za),new mxPoint(I+B,ba+za),new mxPoint(I,g),new mxPoint(I+B,ba)]):r==mxConstants.DIRECTION_NORTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I,ba+B),new mxPoint(pa,ba),new mxPoint(I+U,ba+B),new mxPoint(I+U,ba+za),new mxPoint(pa,ba+za-B),new mxPoint(I,ba+za),new mxPoint(I,ba+B)]):(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),
-ba=[new mxPoint(I,ba),new mxPoint(pa,ba+B),new mxPoint(I+U,ba),new mxPoint(I+U,ba+za-B),new mxPoint(pa,ba+za),new mxPoint(I,ba+za-B),new mxPoint(I,ba)]);pa=new mxPoint(pa,g);v&&(D.x<I||D.x>I+U?pa.y=D.y:pa.x=D.x);return mxUtils.getPerimeterPoint(ba,pa,D)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?k.prototype.fixedSize:k.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,
-"size",G));B&&(G*=r.view.scale);var I=g.x,ba=g.y,U=g.width,za=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ba=[new mxPoint(pa,ba),new mxPoint(I+U,ba+B),new mxPoint(I+U,ba+za-B),new mxPoint(pa,ba+za),new mxPoint(I,ba+za-B),new mxPoint(I,ba+B),new mxPoint(pa,ba)]):
-(B=B?Math.max(0,Math.min(U,G)):U*Math.max(0,Math.min(1,G)),ba=[new mxPoint(I+B,ba),new mxPoint(I+U-B,ba),new mxPoint(I+U,g),new mxPoint(I+U-B,ba+za),new mxPoint(I+B,ba+za),new mxPoint(I,g),new mxPoint(I+B,ba)]);pa=new mxPoint(pa,g);v&&(D.x<I||D.x>I+U?pa.y=D.y:pa.x=D.x);return mxUtils.getPerimeterPoint(ba,pa,D)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ta,mxShape);ta.prototype.size=10;ta.prototype.paintBackground=function(g,r,D,v,B){var G=parseFloat(mxUtils.getValue(this.style,
+mxPerimeter.ParallelogramPerimeter=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?V.prototype.fixedSize:V.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));B&&(G*=r.view.scale);var I=g.x,ca=g.y,T=g.width,za=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ca=
+[new mxPoint(I,ca),new mxPoint(I+T,ca+B),new mxPoint(I+T,ca+za),new mxPoint(I,ca+za-B),new mxPoint(I,ca)]):(B=B?Math.max(0,Math.min(.5*T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I+B,ca),new mxPoint(I+T,ca),new mxPoint(I+T-B,ca+za),new mxPoint(I,ca+za),new mxPoint(I+B,ca)]);za=g.getCenterX();g=g.getCenterY();g=new mxPoint(za,g);v&&(D.x<I||D.x>I+T?g.y=D.y:g.x=D.x);return mxUtils.getPerimeterPoint(ca,g,D)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=
+function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?J.prototype.fixedSize:J.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));B&&(G*=r.view.scale);var I=g.x,ca=g.y,T=g.width,za=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(B=B?Math.max(0,Math.min(.5*T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I+B,ca),new mxPoint(I+T-B,ca),new mxPoint(I+T,ca+za),
+new mxPoint(I,ca+za),new mxPoint(I+B,ca)]):r==mxConstants.DIRECTION_WEST?(B=B?Math.max(0,Math.min(T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I,ca),new mxPoint(I+T,ca),new mxPoint(I+T-B,ca+za),new mxPoint(I+B,ca+za),new mxPoint(I,ca)]):r==mxConstants.DIRECTION_NORTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I,ca+B),new mxPoint(I+T,ca),new mxPoint(I+T,ca+za),new mxPoint(I,ca+za-B),new mxPoint(I,ca+B)]):(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,
+G)),ca=[new mxPoint(I,ca),new mxPoint(I+T,ca+B),new mxPoint(I+T,ca+za-B),new mxPoint(I,ca+za),new mxPoint(I,ca)]);za=g.getCenterX();g=g.getCenterY();g=new mxPoint(za,g);v&&(D.x<I||D.x>I+T?g.y=D.y:g.x=D.x);return mxUtils.getPerimeterPoint(ca,g,D)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?ha.prototype.fixedSize:ha.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,
+"size",G));B&&(G*=r.view.scale);var I=g.x,ca=g.y,T=g.width,za=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(B=B?Math.max(0,Math.min(T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I,ca),new mxPoint(I+T-B,ca),new mxPoint(I+T,g),new mxPoint(I+T-B,ca+za),new mxPoint(I,ca+za),new mxPoint(I+B,g),new mxPoint(I,ca)]):r==mxConstants.DIRECTION_WEST?(B=B?Math.max(0,
+Math.min(T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I+B,ca),new mxPoint(I+T,ca),new mxPoint(I+T-B,g),new mxPoint(I+T,ca+za),new mxPoint(I+B,ca+za),new mxPoint(I,g),new mxPoint(I+B,ca)]):r==mxConstants.DIRECTION_NORTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I,ca+B),new mxPoint(pa,ca),new mxPoint(I+T,ca+B),new mxPoint(I+T,ca+za),new mxPoint(pa,ca+za-B),new mxPoint(I,ca+za),new mxPoint(I,ca+B)]):(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),
+ca=[new mxPoint(I,ca),new mxPoint(pa,ca+B),new mxPoint(I+T,ca),new mxPoint(I+T,ca+za-B),new mxPoint(pa,ca+za),new mxPoint(I,ca+za-B),new mxPoint(I,ca)]);pa=new mxPoint(pa,g);v&&(D.x<I||D.x>I+T?pa.y=D.y:pa.x=D.x);return mxUtils.getPerimeterPoint(ca,pa,D)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(g,r,D,v){var B="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=B?k.prototype.fixedSize:k.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,
+"size",G));B&&(G*=r.view.scale);var I=g.x,ca=g.y,T=g.width,za=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(B=B?Math.max(0,Math.min(za,G)):za*Math.max(0,Math.min(1,G)),ca=[new mxPoint(pa,ca),new mxPoint(I+T,ca+B),new mxPoint(I+T,ca+za-B),new mxPoint(pa,ca+za),new mxPoint(I,ca+za-B),new mxPoint(I,ca+B),new mxPoint(pa,ca)]):
+(B=B?Math.max(0,Math.min(T,G)):T*Math.max(0,Math.min(1,G)),ca=[new mxPoint(I+B,ca),new mxPoint(I+T-B,ca),new mxPoint(I+T,g),new mxPoint(I+T-B,ca+za),new mxPoint(I+B,ca+za),new mxPoint(I,g),new mxPoint(I+B,ca)]);pa=new mxPoint(pa,g);v&&(D.x<I||D.x>I+T?pa.y=D.y:pa.x=D.x);return mxUtils.getPerimeterPoint(ca,pa,D)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ta,mxShape);ta.prototype.size=10;ta.prototype.paintBackground=function(g,r,D,v,B){var G=parseFloat(mxUtils.getValue(this.style,
"size",this.size));g.translate(r,D);g.ellipse((v-G)/2,0,G,G);g.fillAndStroke();g.begin();g.moveTo(v/2,G);g.lineTo(v/2,B);g.end();g.stroke()};mxCellRenderer.registerShape("lollipop",ta);mxUtils.extend(va,mxShape);va.prototype.size=10;va.prototype.inset=2;va.prototype.paintBackground=function(g,r,D,v,B){var G=parseFloat(mxUtils.getValue(this.style,"size",this.size)),I=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,D);g.begin();g.moveTo(v/2,G+I);g.lineTo(v/
-2,B);g.end();g.stroke();g.begin();g.moveTo((v-G)/2-I,G/2);g.quadTo((v-G)/2-I,G+I,v/2,G+I);g.quadTo((v+G)/2+I,G+I,(v+G)/2+I,G/2);g.end();g.stroke()};mxCellRenderer.registerShape("requires",va);mxUtils.extend(Ha,mxShape);Ha.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(0,0);g.quadTo(v,0,v,B/2);g.quadTo(v,B,0,B);g.end();g.stroke()};mxCellRenderer.registerShape("requiredInterface",Ha);mxUtils.extend(La,mxShape);La.prototype.inset=2;La.prototype.paintBackground=function(g,
+2,B);g.end();g.stroke();g.begin();g.moveTo((v-G)/2-I,G/2);g.quadTo((v-G)/2-I,G+I,v/2,G+I);g.quadTo((v+G)/2+I,G+I,(v+G)/2+I,G/2);g.end();g.stroke()};mxCellRenderer.registerShape("requires",va);mxUtils.extend(Ga,mxShape);Ga.prototype.paintBackground=function(g,r,D,v,B){g.translate(r,D);g.begin();g.moveTo(0,0);g.quadTo(v,0,v,B/2);g.quadTo(v,B,0,B);g.end();g.stroke()};mxCellRenderer.registerShape("requiredInterface",Ga);mxUtils.extend(La,mxShape);La.prototype.inset=2;La.prototype.paintBackground=function(g,
r,D,v,B){var G=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,D);g.ellipse(0,G,v-2*G,B-2*G);g.fillAndStroke();g.begin();g.moveTo(v/2,0);g.quadTo(v,0,v,B/2);g.quadTo(v,B,v/2,B);g.end();g.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",La);mxUtils.extend(Ia,mxCylinder);Ia.prototype.jettyWidth=20;Ia.prototype.jettyHeight=10;Ia.prototype.redrawPath=function(g,r,D,v,B,G){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));
-r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));D=I/2;I=D+I/2;var ba=Math.min(r,B-r),U=Math.min(ba+2*r,B-r);G?(g.moveTo(D,ba),g.lineTo(I,ba),g.lineTo(I,ba+r),g.lineTo(D,ba+r),g.moveTo(D,U),g.lineTo(I,U),g.lineTo(I,U+r),g.lineTo(D,U+r)):(g.moveTo(D,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(D,B),g.lineTo(D,U+r),g.lineTo(0,U+r),g.lineTo(0,U),g.lineTo(D,U),g.lineTo(D,ba+r),g.lineTo(0,ba+r),g.lineTo(0,ba),g.lineTo(D,ba),g.close());g.end()};mxCellRenderer.registerShape("module",
-Ia);mxUtils.extend(Ca,mxCylinder);Ca.prototype.jettyWidth=32;Ca.prototype.jettyHeight=12;Ca.prototype.redrawPath=function(g,r,D,v,B,G){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));D=I/2;I=D+I/2;var ba=.3*B-r/2,U=.7*B-r/2;G?(g.moveTo(D,ba),g.lineTo(I,ba),g.lineTo(I,ba+r),g.lineTo(D,ba+r),g.moveTo(D,U),g.lineTo(I,U),g.lineTo(I,U+r),g.lineTo(D,U+r)):(g.moveTo(D,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(D,
-B),g.lineTo(D,U+r),g.lineTo(0,U+r),g.lineTo(0,U),g.lineTo(D,U),g.lineTo(D,ba+r),g.lineTo(0,ba+r),g.lineTo(0,ba),g.lineTo(D,ba),g.close());g.end()};mxCellRenderer.registerShape("component",Ca);mxUtils.extend(Pa,mxRectangleShape);Pa.prototype.paintForeground=function(g,r,D,v,B){var G=v/2,I=B/2,ba=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;g.begin();this.addPoints(g,[new mxPoint(r+G,D),new mxPoint(r+v,D+I),new mxPoint(r+G,D+B),new mxPoint(r,D+I)],this.isRounded,
-ba,!0);g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Pa);mxUtils.extend(Ka,mxDoubleEllipse);Ka.prototype.outerStroke=!0;Ka.prototype.paintVertexShape=function(g,r,D,v,B){var G=Math.min(4,Math.min(v/5,B/5));0<v&&0<B&&(g.ellipse(r+G,D+G,v-2*G,B-2*G),g.fillAndStroke());g.setShadow(!1);this.outerStroke&&(g.ellipse(r,D,v,B),g.stroke())};mxCellRenderer.registerShape("endState",Ka);mxUtils.extend(Na,Ka);Na.prototype.outerStroke=
+r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));D=I/2;I=D+I/2;var ca=Math.min(r,B-r),T=Math.min(ca+2*r,B-r);G?(g.moveTo(D,ca),g.lineTo(I,ca),g.lineTo(I,ca+r),g.lineTo(D,ca+r),g.moveTo(D,T),g.lineTo(I,T),g.lineTo(I,T+r),g.lineTo(D,T+r)):(g.moveTo(D,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(D,B),g.lineTo(D,T+r),g.lineTo(0,T+r),g.lineTo(0,T),g.lineTo(D,T),g.lineTo(D,ca+r),g.lineTo(0,ca+r),g.lineTo(0,ca),g.lineTo(D,ca),g.close());g.end()};mxCellRenderer.registerShape("module",
+Ia);mxUtils.extend(Ca,mxCylinder);Ca.prototype.jettyWidth=32;Ca.prototype.jettyHeight=12;Ca.prototype.redrawPath=function(g,r,D,v,B,G){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));D=I/2;I=D+I/2;var ca=.3*B-r/2,T=.7*B-r/2;G?(g.moveTo(D,ca),g.lineTo(I,ca),g.lineTo(I,ca+r),g.lineTo(D,ca+r),g.moveTo(D,T),g.lineTo(I,T),g.lineTo(I,T+r),g.lineTo(D,T+r)):(g.moveTo(D,0),g.lineTo(v,0),g.lineTo(v,B),g.lineTo(D,
+B),g.lineTo(D,T+r),g.lineTo(0,T+r),g.lineTo(0,T),g.lineTo(D,T),g.lineTo(D,ca+r),g.lineTo(0,ca+r),g.lineTo(0,ca),g.lineTo(D,ca),g.close());g.end()};mxCellRenderer.registerShape("component",Ca);mxUtils.extend(Pa,mxRectangleShape);Pa.prototype.paintForeground=function(g,r,D,v,B){var G=v/2,I=B/2,ca=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;g.begin();this.addPoints(g,[new mxPoint(r+G,D),new mxPoint(r+v,D+I),new mxPoint(r+G,D+B),new mxPoint(r,D+I)],this.isRounded,
+ca,!0);g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Pa);mxUtils.extend(Ka,mxDoubleEllipse);Ka.prototype.outerStroke=!0;Ka.prototype.paintVertexShape=function(g,r,D,v,B){var G=Math.min(4,Math.min(v/5,B/5));0<v&&0<B&&(g.ellipse(r+G,D+G,v-2*G,B-2*G),g.fillAndStroke());g.setShadow(!1);this.outerStroke&&(g.ellipse(r,D,v,B),g.stroke())};mxCellRenderer.registerShape("endState",Ka);mxUtils.extend(Na,Ka);Na.prototype.outerStroke=
!1;mxCellRenderer.registerShape("startState",Na);mxUtils.extend(Oa,mxArrowConnector);Oa.prototype.defaultWidth=4;Oa.prototype.isOpenEnded=function(){return!0};Oa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};Oa.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",Oa);mxUtils.extend(Ea,mxArrowConnector);Ea.prototype.defaultWidth=10;Ea.prototype.defaultArrowWidth=20;Ea.prototype.getStartArrowWidth=
function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Ea.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ea.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ea);mxUtils.extend(Aa,mxActor);Aa.prototype.size=30;Aa.prototype.isRoundable=function(){return!0};
Aa.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(0,g,0,0)):null};Aa.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size)));D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,B),new mxPoint(0,r),new mxPoint(v,0),new mxPoint(v,B)],this.isRounded,D,
!0);g.end()};mxCellRenderer.registerShape("manualInput",Aa);mxUtils.extend(Ja,mxRectangleShape);Ja.prototype.dx=20;Ja.prototype.dy=20;Ja.prototype.isHtmlAllowed=function(){return!1};Ja.prototype.paintForeground=function(g,r,D,v,B){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var G=0;if(this.isRounded){var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;G=Math.max(G,Math.min(v*I,B*I))}I=Math.max(G,Math.min(v,parseFloat(mxUtils.getValue(this.style,
-"dx",this.dx))));G=Math.max(G,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.begin();g.moveTo(r,D+G);g.lineTo(r+v,D+G);g.end();g.stroke();g.begin();g.moveTo(r+I,D);g.lineTo(r+I,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("internalStorage",Ja);mxUtils.extend(Ga,mxActor);Ga.prototype.dx=20;Ga.prototype.dy=20;Ga.prototype.isRoundable=function(){return!0};Ga.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));
-D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,D),new mxPoint(r,D),new mxPoint(r,B),new mxPoint(0,B)],this.isRounded,G,!0);g.end()};mxCellRenderer.registerShape("corner",Ga);mxUtils.extend(Ua,mxActor);Ua.prototype.redrawPath=function(g,r,D,v,B){g.moveTo(0,
+"dx",this.dx))));G=Math.max(G,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.begin();g.moveTo(r,D+G);g.lineTo(r+v,D+G);g.end();g.stroke();g.begin();g.moveTo(r+I,D);g.lineTo(r+I,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("internalStorage",Ja);mxUtils.extend(Ha,mxActor);Ha.prototype.dx=20;Ha.prototype.dy=20;Ha.prototype.isRoundable=function(){return!0};Ha.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));
+D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,D),new mxPoint(r,D),new mxPoint(r,B),new mxPoint(0,B)],this.isRounded,G,!0);g.end()};mxCellRenderer.registerShape("corner",Ha);mxUtils.extend(Ua,mxActor);Ua.prototype.redrawPath=function(g,r,D,v,B){g.moveTo(0,
0);g.lineTo(0,B);g.end();g.moveTo(v,0);g.lineTo(v,B);g.end();g.moveTo(0,B/2);g.lineTo(v,B/2);g.end()};mxCellRenderer.registerShape("crossbar",Ua);mxUtils.extend(ab,mxActor);ab.prototype.dx=20;ab.prototype.dy=20;ab.prototype.isRoundable=function(){return!0};ab.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));D=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",
this.size));var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,D),new mxPoint((v+r)/2,D),new mxPoint((v+r)/2,B),new mxPoint((v-r)/2,B),new mxPoint((v-r)/2,D),new mxPoint(0,D)],this.isRounded,G,!0);g.end()};mxCellRenderer.registerShape("tee",ab);mxUtils.extend(Wa,mxActor);Wa.prototype.arrowWidth=.3;Wa.prototype.arrowSize=.2;Wa.prototype.isRoundable=function(){return!0};Wa.prototype.redrawPath=function(g,
r,D,v,B){var G=B*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));r=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));D=(B-G)/2;G=D+G;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,D),new mxPoint(v-r,D),new mxPoint(v-r,0),new mxPoint(v,B/2),new mxPoint(v-r,B),new mxPoint(v-r,G),new mxPoint(0,G)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("singleArrow",
@@ -3362,9 +3363,9 @@ D,!0);g.end()};mxCellRenderer.registerShape("loopLimit",Ra);mxUtils.extend($a,mx
g.end()};mxCellRenderer.registerShape("offPageConnector",$a);mxUtils.extend(fb,mxEllipse);fb.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+v/2,D+B);g.lineTo(r+v,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("tapeData",fb);mxUtils.extend(rb,mxEllipse);rb.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,D+B/2);g.lineTo(r+
v,D+B/2);g.end();g.stroke();g.begin();g.moveTo(r+v/2,D);g.lineTo(r+v/2,D+B);g.end();g.stroke()};mxCellRenderer.registerShape("orEllipse",rb);mxUtils.extend(mb,mxEllipse);mb.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r+.145*v,D+.145*B);g.lineTo(r+.855*v,D+.855*B);g.end();g.stroke();g.begin();g.moveTo(r+.855*v,D+.145*B);g.lineTo(r+.145*v,D+.855*B);g.end();g.stroke()};mxCellRenderer.registerShape("sumEllipse",
mb);mxUtils.extend(ub,mxRhombus);ub.prototype.paintVertexShape=function(g,r,D,v,B){mxRhombus.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,D+B/2);g.lineTo(r+v,D+B/2);g.end();g.stroke()};mxCellRenderer.registerShape("sortShape",ub);mxUtils.extend(Eb,mxEllipse);Eb.prototype.paintVertexShape=function(g,r,D,v,B){g.begin();g.moveTo(r,D);g.lineTo(r+v,D);g.lineTo(r+v/2,D+B/2);g.close();g.fillAndStroke();g.begin();g.moveTo(r,D+B);g.lineTo(r+v,D+B);g.lineTo(r+v/2,D+
-B/2);g.close();g.fillAndStroke()};mxCellRenderer.registerShape("collate",Eb);mxUtils.extend(Fb,mxEllipse);Fb.prototype.paintVertexShape=function(g,r,D,v,B){var G=g.state.strokeWidth/2,I=10+2*G,ba=D+B-I/2;g.begin();g.moveTo(r,D);g.lineTo(r,D+B);g.moveTo(r+G,ba);g.lineTo(r+G+I,ba-I/2);g.moveTo(r+G,ba);g.lineTo(r+G+I,ba+I/2);g.moveTo(r+G,ba);g.lineTo(r+v-G,ba);g.moveTo(r+v,D);g.lineTo(r+v,D+B);g.moveTo(r+v-G,ba);g.lineTo(r+v-I-G,ba-I/2);g.moveTo(r+v-G,ba);g.lineTo(r+v-I-G,ba+I/2);g.end();g.stroke()};
-mxCellRenderer.registerShape("dimension",Fb);mxUtils.extend(Tb,mxEllipse);Tb.prototype.drawHidden=!0;Tb.prototype.paintVertexShape=function(g,r,D,v,B){this.outline||g.setStrokeColor(null);if(null!=this.style){var G=g.pointerEvents,I=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||I||(g.pointerEvents=!1);var ba="1"==mxUtils.getValue(this.style,"top","1"),U="1"==mxUtils.getValue(this.style,"left","1"),za="1"==mxUtils.getValue(this.style,
-"right","1"),pa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||I||this.outline||ba||za||pa||U?(g.rect(r,D,v,B),g.fill(),g.pointerEvents=G,g.setStrokeColor(this.stroke),g.setLineCap("square"),g.begin(),g.moveTo(r,D),this.outline||ba?g.lineTo(r+v,D):g.moveTo(r+v,D),this.outline||za?g.lineTo(r+v,D+B):g.moveTo(r+v,D+B),this.outline||pa?g.lineTo(r,D+B):g.moveTo(r,D+B),(this.outline||U)&&g.lineTo(r,D),g.end(),g.stroke(),g.setLineCap("flat")):g.setStrokeColor(this.stroke)}null==this.state||
+B/2);g.close();g.fillAndStroke()};mxCellRenderer.registerShape("collate",Eb);mxUtils.extend(Fb,mxEllipse);Fb.prototype.paintVertexShape=function(g,r,D,v,B){var G=g.state.strokeWidth/2,I=10+2*G,ca=D+B-I/2;g.begin();g.moveTo(r,D);g.lineTo(r,D+B);g.moveTo(r+G,ca);g.lineTo(r+G+I,ca-I/2);g.moveTo(r+G,ca);g.lineTo(r+G+I,ca+I/2);g.moveTo(r+G,ca);g.lineTo(r+v-G,ca);g.moveTo(r+v,D);g.lineTo(r+v,D+B);g.moveTo(r+v-G,ca);g.lineTo(r+v-I-G,ca-I/2);g.moveTo(r+v-G,ca);g.lineTo(r+v-I-G,ca+I/2);g.end();g.stroke()};
+mxCellRenderer.registerShape("dimension",Fb);mxUtils.extend(Tb,mxEllipse);Tb.prototype.drawHidden=!0;Tb.prototype.paintVertexShape=function(g,r,D,v,B){this.outline||g.setStrokeColor(null);if(null!=this.style){var G=g.pointerEvents,I=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||I||(g.pointerEvents=!1);var ca="1"==mxUtils.getValue(this.style,"top","1"),T="1"==mxUtils.getValue(this.style,"left","1"),za="1"==mxUtils.getValue(this.style,
+"right","1"),pa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||I||this.outline||ca||za||pa||T?(g.rect(r,D,v,B),g.fill(),g.pointerEvents=G,g.setStrokeColor(this.stroke),g.setLineCap("square"),g.begin(),g.moveTo(r,D),this.outline||ca?g.lineTo(r+v,D):g.moveTo(r+v,D),this.outline||za?g.lineTo(r+v,D+B):g.moveTo(r+v,D+B),this.outline||pa?g.lineTo(r,D+B):g.moveTo(r,D+B),(this.outline||T)&&g.lineTo(r,D),g.end(),g.stroke(),g.setLineCap("flat")):g.setStrokeColor(this.stroke)}null==this.state||
this.outline||null==this.fill||this.fill==mxConstants.NONE||(G=this.state.view.graph,null!=G.paintTableCellLines&&G.paintTableCellLines(g,this.state.cell,r,D,v,B,this.stroke,this.strokewidth))};mxCellRenderer.registerShape("partialRectangle",Tb);mxUtils.extend(Rb,mxEllipse);Rb.prototype.paintVertexShape=function(g,r,D,v,B){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();"vertical"==mxUtils.getValue(this.style,"line")?(g.moveTo(r+v/2,D),g.lineTo(r+v/2,D+B)):(g.moveTo(r,
D+B/2),g.lineTo(r+v,D+B/2));g.end();g.stroke()};mxCellRenderer.registerShape("lineEllipse",Rb);mxUtils.extend($b,mxActor);$b.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(v,B/2);g.moveTo(0,0);g.lineTo(v-r,0);g.quadTo(v,0,v,B/2);g.quadTo(v,B,v-r,B);g.lineTo(0,B);g.close();g.end()};mxCellRenderer.registerShape("delay",$b);mxUtils.extend(Mb,mxActor);Mb.prototype.size=.2;Mb.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(B,v);var G=Math.max(0,Math.min(r,r*parseFloat(mxUtils.getValue(this.style,
"size",this.size))));r=(B-G)/2;D=r+G;var I=(v-G)/2;G=I+G;g.moveTo(0,r);g.lineTo(I,r);g.lineTo(I,0);g.lineTo(G,0);g.lineTo(G,r);g.lineTo(v,r);g.lineTo(v,D);g.lineTo(G,D);g.lineTo(G,B);g.lineTo(I,B);g.lineTo(I,D);g.lineTo(0,D);g.close();g.end()};mxCellRenderer.registerShape("cross",Mb);mxUtils.extend(Wb,mxActor);Wb.prototype.size=.25;Wb.prototype.redrawPath=function(g,r,D,v,B){r=Math.min(v,B/2);D=Math.min(v-r,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*v);g.moveTo(0,B/2);g.lineTo(D,
@@ -3373,74 +3374,74 @@ type:"float",defVal:10},{name:"absoluteCornerSize",dispName:"Abs. Corner Size",t
dispName:"Inside Gradient Direction",type:"enum",defVal:"south",enumList:[{val:"south",dispName:"South"},{val:"west",dispName:"West"},{val:"north",dispName:"North"},{val:"east",dispName:"East"}]},{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"right",dispName:"Right",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left ",type:"bool",defVal:!0},{name:"topLeftStyle",dispName:"Top Left Style",type:"enum",defVal:"default",enumList:[{val:"default",
dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"topRightStyle",dispName:"Top Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomRightStyle",dispName:"Bottom Right Style",
type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomLeftStyle",dispName:"Bottom Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",
-dispName:"Fold"}]}];zb.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);this.strictDrawShape(g,0,0,v,B)};zb.prototype.strictDrawShape=function(g,r,D,v,B,G){var I=G&&G.rectStyle?G.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ba=G&&G.absoluteCornerSize?G.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),U=G&&G.size?G.size:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),za=G&&G.rectOutline?
+dispName:"Fold"}]}];zb.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);this.strictDrawShape(g,0,0,v,B)};zb.prototype.strictDrawShape=function(g,r,D,v,B,G){var I=G&&G.rectStyle?G.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ca=G&&G.absoluteCornerSize?G.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),T=G&&G.size?G.size:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),za=G&&G.rectOutline?
G.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),pa=G&&G.indent?G.indent:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Xa=G&&G.dashed?G.dashed:mxUtils.getValue(this.style,"dashed",!1),vb=G&&G.dashPattern?G.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),jb=G&&G.relIndent?G.relIndent:Math.max(0,Math.min(50,pa)),Sa=G&&G.top?G.top:mxUtils.getValue(this.style,"top",!0),Va=G&&G.right?G.right:mxUtils.getValue(this.style,"right",
!0),Qa=G&&G.bottom?G.bottom:mxUtils.getValue(this.style,"bottom",!0),Ya=G&&G.left?G.left:mxUtils.getValue(this.style,"left",!0),db=G&&G.topLeftStyle?G.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),lb=G&&G.topRightStyle?G.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),ob=G&&G.bottomRightStyle?G.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),nb=G&&G.bottomLeftStyle?G.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle",
"default"),ec=G&&G.fillColor?G.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");G&&G.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var hc=G&&G.strokeWidth?G.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),fc=G&&G.fillColor2?G.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),gc=G&&G.gradientColor2?G.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),ic=G&&G.gradientDirection2?G.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2",
-"south"),jc=G&&G.opacity?G.opacity:mxUtils.getValue(this.style,"opacity","100"),kc=Math.max(0,Math.min(50,U));G=zb.prototype;g.setDashed(Xa);vb&&""!=vb&&g.setDashPattern(vb);g.setStrokeWidth(hc);U=Math.min(.5*B,.5*v,U);ba||(U=kc*Math.min(v,B)/100);U=Math.min(U,.5*Math.min(v,B));ba||(pa=Math.min(jb*Math.min(v,B)/100));pa=Math.min(pa,.5*Math.min(v,B)-U);(Sa||Va||Qa||Ya)&&"frame"!=za&&(g.begin(),Sa?G.moveNW(g,r,D,v,B,I,db,U,Ya):g.moveTo(0,0),Sa&&G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,
-lb,U,Va),Va&&G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),Qa&&G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),Ya&&G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),g.close(),g.fill(),g.setShadow(!1),g.setFillColor(fc),Xa=ba=jc,"none"==fc&&(ba=0),"none"==gc&&(Xa=0),g.setGradient(fc,gc,0,0,v,B,ic,ba,Xa),g.begin(),Sa?G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya):g.moveTo(pa,0),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),Ya&&Qa&&G.paintSWInner(g,r,D,v,B,
-I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),Qa&&Va&&G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),Va&&Sa&&G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),Sa&&Ya&&G.paintNWInner(g,r,D,v,B,I,db,U,pa),g.fill(),"none"==ec&&(g.begin(),G.paintFolds(g,r,D,v,B,I,db,lb,ob,nb,U,Sa,Va,Qa,Ya),g.stroke()));Sa||Va||Qa||!Ya?Sa||Va||!Qa||Ya?!Sa&&!Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,
-B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.lineNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,
-r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),g.close(),g.fillAndStroke()):Sa||!Va||Qa||Ya?!Sa&&Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,db,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya)),g.stroke(),g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va)),
-g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,db,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.lineNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close(),g.fillAndStroke(),g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.lineSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa&&Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,
-r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.lineSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,
-U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa&&Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,
-r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.lineNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,
-r,D,v,B,I,lb,U,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa||Va||Qa||Ya?Sa&&!Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,
-r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.lineNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close(),g.fillAndStroke()):Sa&&!Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa)),g.stroke(),g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,
-r,D,v,B,I,nb,U,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.lineNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),g.close(),g.fillAndStroke(),g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.lineSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),g.close(),g.fillAndStroke()):
-Sa&&!Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa)),g.stroke()):
-(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.lineNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),g.close(),g.fillAndStroke()):Sa&&Va&&!Qa&&!Ya?"frame"!=
-za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.lineSEInner(g,r,D,v,B,I,ob,U,pa,
-Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),g.close(),g.fillAndStroke()):Sa&&Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,
-r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.lineSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,
-I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close(),g.fillAndStroke()):Sa&&Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,
-r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.lineSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,
-r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),g.close(),g.fillAndStroke()):Sa&&Va&&Qa&&Ya&&("frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),g.close(),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintSWInner(g,r,
-D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close()),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.paintNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.paintSE(g,
-r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.paintSW(g,r,D,v,B,I,nb,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),g.close(),G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,U,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,U,pa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,U,pa),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,U,pa),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya),g.close(),
-g.fillAndStroke())):"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,U,Ya),G.paintTop(g,r,D,v,B,I,lb,U,Va),G.lineNEInner(g,r,D,v,B,I,lb,U,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,U,pa,Ya,Sa),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),"double"==za&&(G.moveSEInner(g,
-r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,U,Sa),G.paintRight(g,r,D,v,B,I,ob,U,Qa),G.lineSEInner(g,r,D,v,B,I,ob,U,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,U,pa,Sa,Va),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveSE(g,r,D,v,B,I,ob,
-U,Va),G.paintBottom(g,r,D,v,B,I,nb,U,Ya),G.lineSWInner(g,r,D,v,B,I,nb,U,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,U,pa,Va,Qa),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,db,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,db,U,Qa),G.paintLeft(g,r,D,v,B,I,db,U,Sa),G.lineNWInner(g,r,D,v,B,I,db,U,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,U,
-pa,Qa,Ya),g.close(),g.fillAndStroke());g.begin();G.paintFolds(g,r,D,v,B,I,db,lb,ob,nb,U,Sa,Va,Qa,Ya);g.stroke()};zb.prototype.moveNW=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(0,0):g.moveTo(0,ba)};zb.prototype.moveNE=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(v,0):g.moveTo(v-ba,0)};zb.prototype.moveSE=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(v,B):g.moveTo(v,B-ba)};zb.prototype.moveSW=
-function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(0,B):g.moveTo(ba,B)};zb.prototype.paintNW=function(g,r,D,v,B,G,I,ba,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ba,ba,0,0,r,ba,0)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(ba,0);else g.lineTo(0,0)};zb.prototype.paintTop=function(g,r,D,v,B,G,I,ba,U){"square"==I||
-"default"==I&&"square"==G||!U?g.lineTo(v,0):g.lineTo(v-ba,0)};zb.prototype.paintNE=function(g,r,D,v,B,G,I,ba,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ba,ba,0,0,r,v,ba)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v,ba);else g.lineTo(v,0)};zb.prototype.paintRight=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.lineTo(v,
-B):g.lineTo(v,B-ba)};zb.prototype.paintLeft=function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.lineTo(0,0):g.lineTo(0,ba)};zb.prototype.paintSE=function(g,r,D,v,B,G,I,ba,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ba,ba,0,0,r,v-ba,B)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-ba,B);else g.lineTo(v,B)};zb.prototype.paintBottom=
-function(g,r,D,v,B,G,I,ba,U){"square"==I||"default"==I&&"square"==G||!U?g.lineTo(0,B):g.lineTo(ba,B)};zb.prototype.paintSW=function(g,r,D,v,B,G,I,ba,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ba,ba,0,0,r,0,B-ba)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(0,B-ba);else g.lineTo(0,B)};zb.prototype.paintNWInner=function(g,r,D,v,B,G,I,ba,U){if("rounded"==
-I||"default"==I&&"rounded"==G)g.arcTo(ba-.5*U,ba-.5*U,0,0,0,U,.5*U+ba);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ba+U,ba+U,0,0,1,U,U+ba);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(U,.5*U+ba);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(U+ba,U+ba),g.lineTo(U,U+ba)};zb.prototype.paintTopInner=function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(0,U):za&&!pa?g.lineTo(U,0):za?"square"==I||"default"==I&&"square"==G?g.lineTo(U,U):"rounded"==I||"default"==I&&"rounded"==
-G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(ba+.5*U,U):g.lineTo(ba+U,U):g.lineTo(0,U):g.lineTo(0,0)};zb.prototype.paintNEInner=function(g,r,D,v,B,G,I,ba,U){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ba-.5*U,ba-.5*U,0,0,0,v-ba-.5*U,U);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ba+U,ba+U,0,0,1,v-ba-U,U);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(v-ba-.5*U,U);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(v-ba-U,ba+U),g.lineTo(v-ba-U,U)};zb.prototype.paintRightInner=
-function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(v-U,0):za&&!pa?g.lineTo(v,U):za?"square"==I||"default"==I&&"square"==G?g.lineTo(v-U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-U,ba+.5*U):g.lineTo(v-U,ba+U):g.lineTo(v-U,0):g.lineTo(v,0)};zb.prototype.paintLeftInner=function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(U,B):za&&!pa?g.lineTo(0,B-U):za?"square"==I||"default"==I&&"square"==G?g.lineTo(U,B-U):"rounded"==I||"default"==I&&"rounded"==
-G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(U,B-ba-.5*U):g.lineTo(U,B-ba-U):g.lineTo(U,B):g.lineTo(0,B)};zb.prototype.paintSEInner=function(g,r,D,v,B,G,I,ba,U){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ba-.5*U,ba-.5*U,0,0,0,v-U,B-ba-.5*U);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ba+U,ba+U,0,0,1,v-U,B-ba-U);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(v-U,B-ba-.5*U);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(v-ba-U,B-ba-U),g.lineTo(v-U,B-ba-U)};zb.prototype.paintBottomInner=
-function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(v,B-U):za&&!pa?g.lineTo(v-U,B):"square"==I||"default"==I&&"square"==G||!za?g.lineTo(v-U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-ba-.5*U,B-U):g.lineTo(v-ba-U,B-U):g.lineTo(v,B)};zb.prototype.paintSWInner=function(g,r,D,v,B,G,I,ba,U,za){if(!za)g.lineTo(U,B);else if("square"==I||"default"==I&&"square"==G)g.lineTo(U,B-U);else if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ba-.5*U,ba-.5*
-U,0,0,0,ba+.5*U,B-U);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ba+U,ba+U,0,0,1,ba+U,B-U);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(ba+.5*U,B-U);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(U+ba,B-ba-U),g.lineTo(U+ba,B-U)};zb.prototype.moveSWInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==G?g.moveTo(U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(U,B-ba-.5*U):("invRound"==I||"default"==I&&"invRound"==
-G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(U,B-ba-U):g.moveTo(0,B-U)};zb.prototype.lineSWInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==G?g.lineTo(U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(U,B-ba-.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(U,B-ba-U):g.lineTo(0,B-U)};zb.prototype.moveSEInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==
-G?g.moveTo(v-U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(v-U,B-ba-.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(v-U,B-ba-U):g.moveTo(v-U,B)};zb.prototype.lineSEInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==G?g.lineTo(v-U,B-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-U,B-ba-.5*U):("invRound"==I||"default"==I&&"invRound"==
-G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-U,B-ba-U):g.lineTo(v-U,B)};zb.prototype.moveNEInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==G||za?g.moveTo(v-U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(v-U,ba+.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(v-U,ba+U):g.moveTo(v,U)};zb.prototype.lineNEInner=function(g,r,D,v,B,G,I,ba,U,za){za?"square"==I||"default"==I&&"square"==
-G||za?g.lineTo(v-U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-U,ba+.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-U,ba+U):g.lineTo(v,U)};zb.prototype.moveNWInner=function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.moveTo(U,0):za&&!pa?g.moveTo(0,U):"square"==I||"default"==I&&"square"==G?g.moveTo(U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(U,ba+.5*U):("invRound"==
-I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(U,ba+U):g.moveTo(0,0)};zb.prototype.lineNWInner=function(g,r,D,v,B,G,I,ba,U,za,pa){za||pa?!za&&pa?g.lineTo(U,0):za&&!pa?g.lineTo(0,U):"square"==I||"default"==I&&"square"==G?g.lineTo(U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(U,ba+.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(U,ba+U):g.lineTo(0,0)};zb.prototype.paintFolds=function(g,
-r,D,v,B,G,I,ba,U,za,pa,Xa,vb,jb,Sa){if("fold"==G||"fold"==I||"fold"==ba||"fold"==U||"fold"==za)("fold"==I||"default"==I&&"fold"==G)&&Xa&&Sa&&(g.moveTo(0,pa),g.lineTo(pa,pa),g.lineTo(pa,0)),("fold"==ba||"default"==ba&&"fold"==G)&&Xa&&vb&&(g.moveTo(v-pa,0),g.lineTo(v-pa,pa),g.lineTo(v,pa)),("fold"==U||"default"==U&&"fold"==G)&&jb&&vb&&(g.moveTo(v-pa,B),g.lineTo(v-pa,B-pa),g.lineTo(v,B-pa)),("fold"==za||"default"==za&&"fold"==G)&&jb&&Sa&&(g.moveTo(0,B-pa),g.lineTo(pa,B-pa),g.lineTo(pa,B))};mxCellRenderer.registerShape(zb.prototype.cst.RECT2,
+"south"),jc=G&&G.opacity?G.opacity:mxUtils.getValue(this.style,"opacity","100"),kc=Math.max(0,Math.min(50,T));G=zb.prototype;g.setDashed(Xa);vb&&""!=vb&&g.setDashPattern(vb);g.setStrokeWidth(hc);T=Math.min(.5*B,.5*v,T);ca||(T=kc*Math.min(v,B)/100);T=Math.min(T,.5*Math.min(v,B));ca||(pa=Math.min(jb*Math.min(v,B)/100));pa=Math.min(pa,.5*Math.min(v,B)-T);(Sa||Va||Qa||Ya)&&"frame"!=za&&(g.begin(),Sa?G.moveNW(g,r,D,v,B,I,db,T,Ya):g.moveTo(0,0),Sa&&G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,
+lb,T,Va),Va&&G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),Qa&&G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),Ya&&G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),g.close(),g.fill(),g.setShadow(!1),g.setFillColor(fc),Xa=ca=jc,"none"==fc&&(ca=0),"none"==gc&&(Xa=0),g.setGradient(fc,gc,0,0,v,B,ic,ca,Xa),g.begin(),Sa?G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya):g.moveTo(pa,0),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),Ya&&Qa&&G.paintSWInner(g,r,D,v,B,
+I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),Qa&&Va&&G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),Va&&Sa&&G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),Sa&&Ya&&G.paintNWInner(g,r,D,v,B,I,db,T,pa),g.fill(),"none"==ec&&(g.begin(),G.paintFolds(g,r,D,v,B,I,db,lb,ob,nb,T,Sa,Va,Qa,Ya),g.stroke()));Sa||Va||Qa||!Ya?Sa||Va||!Qa||Ya?!Sa&&!Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,
+B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.lineNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,
+r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),g.close(),g.fillAndStroke()):Sa||!Va||Qa||Ya?!Sa&&Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,db,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya)),g.stroke(),g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va)),
+g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,db,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.lineNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close(),g.fillAndStroke(),g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.lineSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa&&Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,
+r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.lineSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,
+T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa&&Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,
+r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.lineNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,
+r,D,v,B,I,lb,T,pa,Sa,Va),g.close(),g.fillAndStroke()):!Sa||Va||Qa||Ya?Sa&&!Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,
+r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.lineNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close(),g.fillAndStroke()):Sa&&!Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa)),g.stroke(),g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,
+r,D,v,B,I,nb,T,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.lineNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),g.close(),g.fillAndStroke(),g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.lineSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),g.close(),g.fillAndStroke()):
+Sa&&!Va&&Qa&&Ya?"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa)),g.stroke()):
+(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.lineNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),g.close(),g.fillAndStroke()):Sa&&Va&&!Qa&&!Ya?"frame"!=
+za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.lineSEInner(g,r,D,v,B,I,ob,T,pa,
+Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),g.close(),g.fillAndStroke()):Sa&&Va&&!Qa&&Ya?"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),"double"==za&&(G.moveSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,
+r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.lineSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,
+I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close(),g.fillAndStroke()):Sa&&Va&&Qa&&!Ya?"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,
+r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.lineSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,
+r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),g.close(),g.fillAndStroke()):Sa&&Va&&Qa&&Ya&&("frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),g.close(),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintSWInner(g,r,
+D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close()),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.paintNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.paintSE(g,
+r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.paintSW(g,r,D,v,B,I,nb,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),g.close(),G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintSWInner(g,r,D,v,B,I,nb,T,pa,Qa),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),G.paintSEInner(g,r,D,v,B,I,ob,T,pa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),G.paintNEInner(g,r,D,v,B,I,lb,T,pa),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),G.paintNWInner(g,r,D,v,B,I,db,T,pa),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya),g.close(),
+g.fillAndStroke())):"frame"!=za?(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),"double"==za&&(G.moveNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa)),g.stroke()):(g.begin(),G.moveNW(g,r,D,v,B,I,db,T,Ya),G.paintTop(g,r,D,v,B,I,lb,T,Va),G.lineNEInner(g,r,D,v,B,I,lb,T,pa,Va),G.paintTopInner(g,r,D,v,B,I,db,T,pa,Ya,Sa),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),"double"==za&&(G.moveSEInner(g,
+r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va)),g.stroke()):(g.begin(),G.moveNE(g,r,D,v,B,I,lb,T,Sa),G.paintRight(g,r,D,v,B,I,ob,T,Qa),G.lineSEInner(g,r,D,v,B,I,ob,T,pa,Qa),G.paintRightInner(g,r,D,v,B,I,lb,T,pa,Sa,Va),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveSE(g,r,D,v,B,I,ob,T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),"double"==za&&(G.moveSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa)),g.stroke()):(g.begin(),G.moveSE(g,r,D,v,B,I,ob,
+T,Va),G.paintBottom(g,r,D,v,B,I,nb,T,Ya),G.lineSWInner(g,r,D,v,B,I,nb,T,pa,Ya),G.paintBottomInner(g,r,D,v,B,I,ob,T,pa,Va,Qa),g.close(),g.fillAndStroke()):"frame"!=za?(g.begin(),G.moveSW(g,r,D,v,B,I,db,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),"double"==za&&(G.moveNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,pa,Qa,Ya)),g.stroke()):(g.begin(),G.moveSW(g,r,D,v,B,I,db,T,Qa),G.paintLeft(g,r,D,v,B,I,db,T,Sa),G.lineNWInner(g,r,D,v,B,I,db,T,pa,Sa,Ya),G.paintLeftInner(g,r,D,v,B,I,nb,T,
+pa,Qa,Ya),g.close(),g.fillAndStroke());g.begin();G.paintFolds(g,r,D,v,B,I,db,lb,ob,nb,T,Sa,Va,Qa,Ya);g.stroke()};zb.prototype.moveNW=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.moveTo(0,0):g.moveTo(0,ca)};zb.prototype.moveNE=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.moveTo(v,0):g.moveTo(v-ca,0)};zb.prototype.moveSE=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.moveTo(v,B):g.moveTo(v,B-ca)};zb.prototype.moveSW=
+function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.moveTo(0,B):g.moveTo(ca,B)};zb.prototype.paintNW=function(g,r,D,v,B,G,I,ca,T){if(T)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ca,ca,0,0,r,ca,0)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(ca,0);else g.lineTo(0,0)};zb.prototype.paintTop=function(g,r,D,v,B,G,I,ca,T){"square"==I||
+"default"==I&&"square"==G||!T?g.lineTo(v,0):g.lineTo(v-ca,0)};zb.prototype.paintNE=function(g,r,D,v,B,G,I,ca,T){if(T)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ca,ca,0,0,r,v,ca)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v,ca);else g.lineTo(v,0)};zb.prototype.paintRight=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.lineTo(v,
+B):g.lineTo(v,B-ca)};zb.prototype.paintLeft=function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.lineTo(0,0):g.lineTo(0,ca)};zb.prototype.paintSE=function(g,r,D,v,B,G,I,ca,T){if(T)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ca,ca,0,0,r,v-ca,B)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-ca,B);else g.lineTo(v,B)};zb.prototype.paintBottom=
+function(g,r,D,v,B,G,I,ca,T){"square"==I||"default"==I&&"square"==G||!T?g.lineTo(0,B):g.lineTo(ca,B)};zb.prototype.paintSW=function(g,r,D,v,B,G,I,ca,T){if(T)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(ca,ca,0,0,r,0,B-ca)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(0,B-ca);else g.lineTo(0,B)};zb.prototype.paintNWInner=function(g,r,D,v,B,G,I,ca,T){if("rounded"==
+I||"default"==I&&"rounded"==G)g.arcTo(ca-.5*T,ca-.5*T,0,0,0,T,.5*T+ca);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ca+T,ca+T,0,0,1,T,T+ca);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(T,.5*T+ca);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(T+ca,T+ca),g.lineTo(T,T+ca)};zb.prototype.paintTopInner=function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(0,T):za&&!pa?g.lineTo(T,0):za?"square"==I||"default"==I&&"square"==G?g.lineTo(T,T):"rounded"==I||"default"==I&&"rounded"==
+G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(ca+.5*T,T):g.lineTo(ca+T,T):g.lineTo(0,T):g.lineTo(0,0)};zb.prototype.paintNEInner=function(g,r,D,v,B,G,I,ca,T){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ca-.5*T,ca-.5*T,0,0,0,v-ca-.5*T,T);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ca+T,ca+T,0,0,1,v-ca-T,T);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(v-ca-.5*T,T);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(v-ca-T,ca+T),g.lineTo(v-ca-T,T)};zb.prototype.paintRightInner=
+function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(v-T,0):za&&!pa?g.lineTo(v,T):za?"square"==I||"default"==I&&"square"==G?g.lineTo(v-T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-T,ca+.5*T):g.lineTo(v-T,ca+T):g.lineTo(v-T,0):g.lineTo(v,0)};zb.prototype.paintLeftInner=function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(T,B):za&&!pa?g.lineTo(0,B-T):za?"square"==I||"default"==I&&"square"==G?g.lineTo(T,B-T):"rounded"==I||"default"==I&&"rounded"==
+G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(T,B-ca-.5*T):g.lineTo(T,B-ca-T):g.lineTo(T,B):g.lineTo(0,B)};zb.prototype.paintSEInner=function(g,r,D,v,B,G,I,ca,T){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ca-.5*T,ca-.5*T,0,0,0,v-T,B-ca-.5*T);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ca+T,ca+T,0,0,1,v-T,B-ca-T);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(v-T,B-ca-.5*T);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(v-ca-T,B-ca-T),g.lineTo(v-T,B-ca-T)};zb.prototype.paintBottomInner=
+function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(v,B-T):za&&!pa?g.lineTo(v-T,B):"square"==I||"default"==I&&"square"==G||!za?g.lineTo(v-T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-ca-.5*T,B-T):g.lineTo(v-ca-T,B-T):g.lineTo(v,B)};zb.prototype.paintSWInner=function(g,r,D,v,B,G,I,ca,T,za){if(!za)g.lineTo(T,B);else if("square"==I||"default"==I&&"square"==G)g.lineTo(T,B-T);else if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(ca-.5*T,ca-.5*
+T,0,0,0,ca+.5*T,B-T);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(ca+T,ca+T,0,0,1,ca+T,B-T);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(ca+.5*T,B-T);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(T+ca,B-ca-T),g.lineTo(T+ca,B-T)};zb.prototype.moveSWInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==G?g.moveTo(T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(T,B-ca-.5*T):("invRound"==I||"default"==I&&"invRound"==
+G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(T,B-ca-T):g.moveTo(0,B-T)};zb.prototype.lineSWInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==G?g.lineTo(T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(T,B-ca-.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(T,B-ca-T):g.lineTo(0,B-T)};zb.prototype.moveSEInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==
+G?g.moveTo(v-T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(v-T,B-ca-.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(v-T,B-ca-T):g.moveTo(v-T,B)};zb.prototype.lineSEInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==G?g.lineTo(v-T,B-T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-T,B-ca-.5*T):("invRound"==I||"default"==I&&"invRound"==
+G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-T,B-ca-T):g.lineTo(v-T,B)};zb.prototype.moveNEInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==G||za?g.moveTo(v-T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(v-T,ca+.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(v-T,ca+T):g.moveTo(v,T)};zb.prototype.lineNEInner=function(g,r,D,v,B,G,I,ca,T,za){za?"square"==I||"default"==I&&"square"==
+G||za?g.lineTo(v-T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(v-T,ca+.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(v-T,ca+T):g.lineTo(v,T)};zb.prototype.moveNWInner=function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.moveTo(T,0):za&&!pa?g.moveTo(0,T):"square"==I||"default"==I&&"square"==G?g.moveTo(T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(T,ca+.5*T):("invRound"==
+I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(T,ca+T):g.moveTo(0,0)};zb.prototype.lineNWInner=function(g,r,D,v,B,G,I,ca,T,za,pa){za||pa?!za&&pa?g.lineTo(T,0):za&&!pa?g.lineTo(0,T):"square"==I||"default"==I&&"square"==G?g.lineTo(T,T):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(T,ca+.5*T):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(T,ca+T):g.lineTo(0,0)};zb.prototype.paintFolds=function(g,
+r,D,v,B,G,I,ca,T,za,pa,Xa,vb,jb,Sa){if("fold"==G||"fold"==I||"fold"==ca||"fold"==T||"fold"==za)("fold"==I||"default"==I&&"fold"==G)&&Xa&&Sa&&(g.moveTo(0,pa),g.lineTo(pa,pa),g.lineTo(pa,0)),("fold"==ca||"default"==ca&&"fold"==G)&&Xa&&vb&&(g.moveTo(v-pa,0),g.lineTo(v-pa,pa),g.lineTo(v,pa)),("fold"==T||"default"==T&&"fold"==G)&&jb&&vb&&(g.moveTo(v-pa,B),g.lineTo(v-pa,B-pa),g.lineTo(v,B-pa)),("fold"==za||"default"==za&&"fold"==G)&&jb&&Sa&&(g.moveTo(0,B-pa),g.lineTo(pa,B-pa),g.lineTo(pa,B))};mxCellRenderer.registerShape(zb.prototype.cst.RECT2,
zb);zb.prototype.constraints=null;mxUtils.extend(Ub,mxConnector);Ub.prototype.origPaintEdgeShape=Ub.prototype.paintEdgeShape;Ub.prototype.paintEdgeShape=function(g,r){for(var D=[],v=0;v<r.length;v++)D.push(mxUtils.clone(r[v]));v=g.state.dashed;var B=g.state.fixDash;Ub.prototype.origPaintEdgeShape.apply(this,[g,D]);3<=g.state.strokeWidth&&(D=mxUtils.getValue(this.style,"fillColor",null),null!=D&&(g.setStrokeColor(D),g.setStrokeWidth(g.state.strokeWidth-2),g.setDashed(v,B),Ub.prototype.origPaintEdgeShape.apply(this,
[g,r])))};mxCellRenderer.registerShape("filledEdge",Ub);mxUtils.extend(Lb,mxConnector);Lb.prototype.defaultWidth=4;Lb.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Lb.prototype.getFlowAnimationPath=function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)||mxShape.prototype.getFlowAnimationPath.call(this)};Lb.prototype.origPaintEdgeShape=Lb.prototype.paintEdgeShape;Lb.prototype.paintEdgeShape=function(g,r){for(var D=[],v=
0;v<r.length;v++)D.push(mxUtils.clone(r[v]));v=g.state.dashed;var B=g.state.fixDash,G=this.getEdgeWidth();g.setStrokeWidth(G+2*this.strokewidth);g.setDashed(!1);Lb.prototype.origPaintEdgeShape.apply(this,[g,D]);D=mxUtils.getValue(this.style,"fillColor",null);null!=D&&(g.setStrokeWidth(G),g.setStrokeColor(D),g.setDashed(v,B),Lb.prototype.origPaintEdgeShape.apply(this,[g,r]))};mxCellRenderer.registerShape("pipe",Lb);mxUtils.extend(Xb,mxRectangleShape);Xb.prototype.size=10;Xb.prototype.isRoundable=function(){return!0};
-Xb.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=r&&r!=mxConstants.NONE&&(g.setStrokeColor("none"),g.begin(),g.rect(0,0,v,B),g.fillAndStroke(),g.setStrokeColor(this.stroke));var G=Math.max(5,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=B/2;D=this.strokewidth;D=this.isRounded?D/2:D;B-=D;G=Math.max(1,Math.round(v/G)-1);var I=v/(G+1),ba=I/2;g.begin();g.moveTo(0,r);if(this.isRounded){g.curveTo(.4*ba,
-r-.4*(r-D),.6*ba,D,ba,D);for(var U=0;U<G;U++){var za=ba+U*I,pa=za+I,Xa=0==U%2?B:D;g.curveTo(za+.4*I,0==U%2?D:B,pa-.4*I,Xa,pa,Xa)}B=0==G%2?D:B;g.curveTo(ba+G*I+.4*ba,B,v-.4*ba,r-(B==D?1:-1)*(r-D)*.4,v,r)}else{g.lineTo(ba,D);for(U=0;U<G;U++)pa=ba+(U+1)*I,Xa=0==U%2?B:D,g.lineTo(pa,Xa);g.lineTo(v,r)}g.stroke()};mxCellRenderer.registerShape("zigzag",Xb);"undefined"!==typeof StyleFormatPanel&&function(){var g=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var r=
-this.editorUi.getSelectionState(),D=g.apply(this,arguments);"umlFrame"==r.style.shape&&D.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return D}}();mxMarker.addMarker("dash",function(g,r,D,v,B,G,I,ba,U,za){var pa=B*(I+U+1),Xa=G*(I+U+1);return function(){g.begin();g.moveTo(v.x-pa/2-Xa/2,v.y-Xa/2+pa/2);g.lineTo(v.x+Xa/2-3*pa/2,v.y-3*Xa/2-pa/2);g.stroke()}});mxMarker.addMarker("box",function(g,r,D,v,B,G,I,ba,U,za){var pa=B*(I+U+1),Xa=G*(I+U+1),vb=v.x+pa/2,
-jb=v.y+Xa/2;v.x-=pa;v.y-=Xa;return function(){g.begin();g.moveTo(vb-pa/2-Xa/2,jb-Xa/2+pa/2);g.lineTo(vb-pa/2+Xa/2,jb-Xa/2-pa/2);g.lineTo(vb+Xa/2-3*pa/2,jb-3*Xa/2-pa/2);g.lineTo(vb-Xa/2-3*pa/2,jb-3*Xa/2+pa/2);g.close();za?g.fillAndStroke():g.stroke()}});mxMarker.addMarker("cross",function(g,r,D,v,B,G,I,ba,U,za){var pa=B*(I+U+1),Xa=G*(I+U+1);return function(){g.begin();g.moveTo(v.x-pa/2-Xa/2,v.y-Xa/2+pa/2);g.lineTo(v.x+Xa/2-3*pa/2,v.y-3*Xa/2-pa/2);g.moveTo(v.x-pa/2+Xa/2,v.y-Xa/2-pa/2);g.lineTo(v.x-
-Xa/2-3*pa/2,v.y-3*Xa/2+pa/2);g.stroke()}});mxMarker.addMarker("circle",bc);mxMarker.addMarker("circlePlus",function(g,r,D,v,B,G,I,ba,U,za){var pa=v.clone(),Xa=bc.apply(this,arguments),vb=B*(I+2*U),jb=G*(I+2*U);return function(){Xa.apply(this,arguments);g.begin();g.moveTo(pa.x-B*U,pa.y-G*U);g.lineTo(pa.x-2*vb+B*U,pa.y-2*jb+G*U);g.moveTo(pa.x-vb-jb+G*U,pa.y-jb+vb-B*U);g.lineTo(pa.x+jb-vb-G*U,pa.y-jb-vb+B*U);g.stroke()}});mxMarker.addMarker("halfCircle",function(g,r,D,v,B,G,I,ba,U,za){var pa=B*(I+U+
-1),Xa=G*(I+U+1),vb=v.clone();v.x-=pa;v.y-=Xa;return function(){g.begin();g.moveTo(vb.x-Xa,vb.y+pa);g.quadTo(v.x-Xa,v.y+pa,v.x,v.y);g.quadTo(v.x+Xa,v.y-pa,vb.x+Xa,vb.y-pa);g.stroke()}});mxMarker.addMarker("async",function(g,r,D,v,B,G,I,ba,U,za){r=B*U*1.118;D=G*U*1.118;B*=I+U;G*=I+U;var pa=v.clone();pa.x-=r;pa.y-=D;v.x+=-B-r;v.y+=-G-D;return function(){g.begin();g.moveTo(pa.x,pa.y);ba?g.lineTo(pa.x-B-G/2,pa.y-G+B/2):g.lineTo(pa.x+G/2-B,pa.y-G-B/2);g.lineTo(pa.x-B,pa.y-G);g.close();za?g.fillAndStroke():
-g.stroke()}});mxMarker.addMarker("openAsync",function(g){g=null!=g?g:2;return function(r,D,v,B,G,I,ba,U,za,pa){G*=ba+za;I*=ba+za;var Xa=B.clone();return function(){r.begin();r.moveTo(Xa.x,Xa.y);U?r.lineTo(Xa.x-G-I/g,Xa.y-I+G/g):r.lineTo(Xa.x+I/g-G,Xa.y-I-G/g);r.stroke()}}}(2));mxMarker.addMarker("mermaidExtension",function(){var g=17/6;return function(r,D,v,B,G,I,ba,U,za,pa){G*=ba+za;I*=ba+za;var Xa=B.clone();B.x-=G;B.y-=I;return function(){r.begin();r.moveTo(Xa.x,Xa.y);r.lineTo(Xa.x-G-I/g,Xa.y-I+
-G/g);r.lineTo(Xa.x-G+I/g,Xa.y-I-G/g);r.close();pa?r.fillAndStroke():r.stroke()}}}());mxMarker.addMarker("mermaidDiamond",function(g,r,D,v,B,G,I,ba,U,za){var pa=17/6;B*=I+U;G*=I+U;var Xa=v.clone();v.x-=B;v.y-=G;return function(){g.begin();g.moveTo(Xa.x,Xa.y);g.lineTo(Xa.x-B/2-G/pa,Xa.y-G/2+B/pa);g.lineTo(Xa.x-B,Xa.y-G);g.lineTo(Xa.x-B/2+G/pa,Xa.y-G/2-B/pa);g.close();za?g.fillAndStroke():g.stroke()}});mxUtils.extend(Hb,mxRectangleShape);Hb.prototype.arcStartY=25;Hb.prototype.arcMidY=-25;Hb.prototype.arcEndY=
-25;Hb.prototype.paintForeground=function(g,r,D,v,B){mxRectangleShape.prototype.paintForeground.apply(this,arguments);if(null!=this.state){var G=this.state.view.graph;if(null==G.cellEditor||G.cellEditor.editingCell!=this.state.cell)if(G=G.convertValueToString(this.state.cell),null!=G&&0!=G.length){var I=parseFloat(mxUtils.getValue(this.style,"arcStartY",this.arcStartY)),ba=parseFloat(mxUtils.getValue(this.style,"arcMidY",this.arcMidY)),U=parseFloat(mxUtils.getValue(this.style,"arcEndY",this.arcEndY)),
-za=mxUtils.getValue(this.style,"curveType","round");if(null!=g.root&&"function"===typeof g.getBaseUrl){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;g.translate(r,D);var pa=g.state,Xa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),vb=Xa/2,jb=(I+U)/2,Sa=Math.max(Math.abs(Hb.prototype.arcMidY),Math.min(jb,B-jb));ba=Math.max(-Sa,Math.min(Sa,
-ba));var Va=jb+ba;ba=Math.min(I,U,Va);Sa=Math.max(I,U,Va);jb=Sa-ba;var Qa=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this._curveYOffset=jb=Qa==mxConstants.ALIGN_TOP?vb-ba:Qa==mxConstants.ALIGN_BOTTOM?B-vb-Sa:(B-jb)/2-ba;Qa=v-vb;ba=(vb+pa.dx)*pa.scale;I=(I+jb+pa.dy)*pa.scale;Sa=((vb+Qa)/2+pa.dx)*pa.scale;Va=(Va+jb+pa.dy)*pa.scale;vb=(Qa+pa.dx)*pa.scale;U=(U+jb+pa.dy)*pa.scale;"round"==za?(Qa=Math.sqrt((vb-ba)*(vb-ba)+(U-I)*(U-I)),za=(ba+vb)/2,jb=(I+U)/2,
-za=Math.sqrt((Sa-za)*(Sa-za)+(Va-jb)*(Va-jb)),.5>za?(za="M "+g.format(ba)+" "+g.format(I)+" L "+g.format(vb)+" "+g.format(U),ba=Qa):(Qa/=2,jb=Qa*Qa/(2*za)+za/2,Va=0<(vb-ba)*(Va-I)-(U-I)*(Sa-ba)?0:1,Sa=za>Qa?1:0,za="M "+g.format(ba)+" "+g.format(I)+" A "+g.format(jb)+" "+g.format(jb)+" 0 "+Sa+" "+Va+" "+g.format(vb)+" "+g.format(U),ba=2*Math.asin(Math.min(1,Qa/jb)),Sa&&(ba=2*Math.PI-ba),ba*=jb)):(za="M "+g.format(ba)+" "+g.format(I)+" Q "+g.format(Sa)+" "+g.format(Va)+" "+g.format(vb)+" "+g.format(U),
-jb=Sa-ba,Qa=Va-I,Sa=vb-Sa,Va=U-Va,ba=vb-ba,I=U-I,ba=(Math.sqrt(jb*jb+Qa*Qa)+Math.sqrt(Sa*Sa+Va*Va)+Math.sqrt(ba*ba+I*I))/2);U=(g.idPrefix||"")+"ctp-"+mxObjectIdentity.get(this);Sa=(I=!mxClient.IS_CHROMEAPP&&g.root.ownerDocument==document)?g.getBaseUrl().replace(/([\(\)])/g,"\\$1"):"";vb=g.createElement("g");Va=pa.transform||"";0<Va.length&&vb.setAttribute("transform",Va);1>pa.alpha&&vb.setAttribute("opacity",pa.alpha);Va=g.createElement("defs");jb=g.createElement("path");jb.setAttribute("id",U);jb.setAttribute("d",
+Xb.prototype.paintVertexShape=function(g,r,D,v,B){g.translate(r,D);r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=r&&r!=mxConstants.NONE&&(g.setStrokeColor("none"),g.begin(),g.rect(0,0,v,B),g.fillAndStroke(),g.setStrokeColor(this.stroke));var G=Math.max(5,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=B/2;D=this.strokewidth;D=this.isRounded?D/2:D;B-=D;G=Math.max(1,Math.round(v/G)-1);var I=v/(G+1),ca=I/2;g.begin();g.moveTo(0,r);if(this.isRounded){g.curveTo(.4*ca,
+r-.4*(r-D),.6*ca,D,ca,D);for(var T=0;T<G;T++){var za=ca+T*I,pa=za+I,Xa=0==T%2?B:D;g.curveTo(za+.4*I,0==T%2?D:B,pa-.4*I,Xa,pa,Xa)}B=0==G%2?D:B;g.curveTo(ca+G*I+.4*ca,B,v-.4*ca,r-(B==D?1:-1)*(r-D)*.4,v,r)}else{g.lineTo(ca,D);for(T=0;T<G;T++)pa=ca+(T+1)*I,Xa=0==T%2?B:D,g.lineTo(pa,Xa);g.lineTo(v,r)}g.stroke()};mxCellRenderer.registerShape("zigzag",Xb);"undefined"!==typeof StyleFormatPanel&&function(){var g=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var r=
+this.editorUi.getSelectionState(),D=g.apply(this,arguments);"umlFrame"==r.style.shape&&D.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return D}}();mxMarker.addMarker("dash",function(g,r,D,v,B,G,I,ca,T,za){var pa=B*(I+T+1),Xa=G*(I+T+1);return function(){g.begin();g.moveTo(v.x-pa/2-Xa/2,v.y-Xa/2+pa/2);g.lineTo(v.x+Xa/2-3*pa/2,v.y-3*Xa/2-pa/2);g.stroke()}});mxMarker.addMarker("box",function(g,r,D,v,B,G,I,ca,T,za){var pa=B*(I+T+1),Xa=G*(I+T+1),vb=v.x+pa/2,
+jb=v.y+Xa/2;v.x-=pa;v.y-=Xa;return function(){g.begin();g.moveTo(vb-pa/2-Xa/2,jb-Xa/2+pa/2);g.lineTo(vb-pa/2+Xa/2,jb-Xa/2-pa/2);g.lineTo(vb+Xa/2-3*pa/2,jb-3*Xa/2-pa/2);g.lineTo(vb-Xa/2-3*pa/2,jb-3*Xa/2+pa/2);g.close();za?g.fillAndStroke():g.stroke()}});mxMarker.addMarker("cross",function(g,r,D,v,B,G,I,ca,T,za){var pa=B*(I+T+1),Xa=G*(I+T+1);return function(){g.begin();g.moveTo(v.x-pa/2-Xa/2,v.y-Xa/2+pa/2);g.lineTo(v.x+Xa/2-3*pa/2,v.y-3*Xa/2-pa/2);g.moveTo(v.x-pa/2+Xa/2,v.y-Xa/2-pa/2);g.lineTo(v.x-
+Xa/2-3*pa/2,v.y-3*Xa/2+pa/2);g.stroke()}});mxMarker.addMarker("circle",bc);mxMarker.addMarker("circlePlus",function(g,r,D,v,B,G,I,ca,T,za){var pa=v.clone(),Xa=bc.apply(this,arguments),vb=B*(I+2*T),jb=G*(I+2*T);return function(){Xa.apply(this,arguments);g.begin();g.moveTo(pa.x-B*T,pa.y-G*T);g.lineTo(pa.x-2*vb+B*T,pa.y-2*jb+G*T);g.moveTo(pa.x-vb-jb+G*T,pa.y-jb+vb-B*T);g.lineTo(pa.x+jb-vb-G*T,pa.y-jb-vb+B*T);g.stroke()}});mxMarker.addMarker("halfCircle",function(g,r,D,v,B,G,I,ca,T,za){var pa=B*(I+T+
+1),Xa=G*(I+T+1),vb=v.clone();v.x-=pa;v.y-=Xa;return function(){g.begin();g.moveTo(vb.x-Xa,vb.y+pa);g.quadTo(v.x-Xa,v.y+pa,v.x,v.y);g.quadTo(v.x+Xa,v.y-pa,vb.x+Xa,vb.y-pa);g.stroke()}});mxMarker.addMarker("async",function(g,r,D,v,B,G,I,ca,T,za){r=B*T*1.118;D=G*T*1.118;B*=I+T;G*=I+T;var pa=v.clone();pa.x-=r;pa.y-=D;v.x+=-B-r;v.y+=-G-D;return function(){g.begin();g.moveTo(pa.x,pa.y);ca?g.lineTo(pa.x-B-G/2,pa.y-G+B/2):g.lineTo(pa.x+G/2-B,pa.y-G-B/2);g.lineTo(pa.x-B,pa.y-G);g.close();za?g.fillAndStroke():
+g.stroke()}});mxMarker.addMarker("openAsync",function(g){g=null!=g?g:2;return function(r,D,v,B,G,I,ca,T,za,pa){G*=ca+za;I*=ca+za;var Xa=B.clone();return function(){r.begin();r.moveTo(Xa.x,Xa.y);T?r.lineTo(Xa.x-G-I/g,Xa.y-I+G/g):r.lineTo(Xa.x+I/g-G,Xa.y-I-G/g);r.stroke()}}}(2));mxMarker.addMarker("mermaidExtension",function(){var g=17/6;return function(r,D,v,B,G,I,ca,T,za,pa){G*=ca+za;I*=ca+za;var Xa=B.clone();B.x-=G;B.y-=I;return function(){r.begin();r.moveTo(Xa.x,Xa.y);r.lineTo(Xa.x-G-I/g,Xa.y-I+
+G/g);r.lineTo(Xa.x-G+I/g,Xa.y-I-G/g);r.close();pa?r.fillAndStroke():r.stroke()}}}());mxMarker.addMarker("mermaidDiamond",function(g,r,D,v,B,G,I,ca,T,za){var pa=17/6;B*=I+T;G*=I+T;var Xa=v.clone();v.x-=B;v.y-=G;return function(){g.begin();g.moveTo(Xa.x,Xa.y);g.lineTo(Xa.x-B/2-G/pa,Xa.y-G/2+B/pa);g.lineTo(Xa.x-B,Xa.y-G);g.lineTo(Xa.x-B/2+G/pa,Xa.y-G/2-B/pa);g.close();za?g.fillAndStroke():g.stroke()}});mxUtils.extend(Hb,mxRectangleShape);Hb.prototype.arcStartY=25;Hb.prototype.arcMidY=-25;Hb.prototype.arcEndY=
+25;Hb.prototype.paintForeground=function(g,r,D,v,B){mxRectangleShape.prototype.paintForeground.apply(this,arguments);if(null!=this.state){var G=this.state.view.graph;if(null==G.cellEditor||G.cellEditor.editingCell!=this.state.cell)if(G=G.convertValueToString(this.state.cell),null!=G&&0!=G.length){var I=parseFloat(mxUtils.getValue(this.style,"arcStartY",this.arcStartY)),ca=parseFloat(mxUtils.getValue(this.style,"arcMidY",this.arcMidY)),T=parseFloat(mxUtils.getValue(this.style,"arcEndY",this.arcEndY)),
+za=mxUtils.getValue(this.style,"curveType","round");if(null!=g.root&&"function"===typeof g.getBaseUrl){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;g.translate(r,D);var pa=g.state,Xa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),vb=Xa/2,jb=(I+T)/2,Sa=Math.max(Math.abs(Hb.prototype.arcMidY),Math.min(jb,B-jb));ca=Math.max(-Sa,Math.min(Sa,
+ca));var Va=jb+ca;ca=Math.min(I,T,Va);Sa=Math.max(I,T,Va);jb=Sa-ca;var Qa=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this._curveYOffset=jb=Qa==mxConstants.ALIGN_TOP?vb-ca:Qa==mxConstants.ALIGN_BOTTOM?B-vb-Sa:(B-jb)/2-ca;Qa=v-vb;ca=(vb+pa.dx)*pa.scale;I=(I+jb+pa.dy)*pa.scale;Sa=((vb+Qa)/2+pa.dx)*pa.scale;Va=(Va+jb+pa.dy)*pa.scale;vb=(Qa+pa.dx)*pa.scale;T=(T+jb+pa.dy)*pa.scale;"round"==za?(Qa=Math.sqrt((vb-ca)*(vb-ca)+(T-I)*(T-I)),za=(ca+vb)/2,jb=(I+T)/2,
+za=Math.sqrt((Sa-za)*(Sa-za)+(Va-jb)*(Va-jb)),.5>za?(za="M "+g.format(ca)+" "+g.format(I)+" L "+g.format(vb)+" "+g.format(T),ca=Qa):(Qa/=2,jb=Qa*Qa/(2*za)+za/2,Va=0<(vb-ca)*(Va-I)-(T-I)*(Sa-ca)?0:1,Sa=za>Qa?1:0,za="M "+g.format(ca)+" "+g.format(I)+" A "+g.format(jb)+" "+g.format(jb)+" 0 "+Sa+" "+Va+" "+g.format(vb)+" "+g.format(T),ca=2*Math.asin(Math.min(1,Qa/jb)),Sa&&(ca=2*Math.PI-ca),ca*=jb)):(za="M "+g.format(ca)+" "+g.format(I)+" Q "+g.format(Sa)+" "+g.format(Va)+" "+g.format(vb)+" "+g.format(T),
+jb=Sa-ca,Qa=Va-I,Sa=vb-Sa,Va=T-Va,ca=vb-ca,I=T-I,ca=(Math.sqrt(jb*jb+Qa*Qa)+Math.sqrt(Sa*Sa+Va*Va)+Math.sqrt(ca*ca+I*I))/2);T=(g.idPrefix||"")+"ctp-"+mxObjectIdentity.get(this);Sa=(I=!mxClient.IS_CHROMEAPP&&g.root.ownerDocument==document)?g.getBaseUrl().replace(/([\(\)])/g,"\\$1"):"";vb=g.createElement("g");Va=pa.transform||"";0<Va.length&&vb.setAttribute("transform",Va);1>pa.alpha&&vb.setAttribute("opacity",pa.alpha);Va=g.createElement("defs");jb=g.createElement("path");jb.setAttribute("id",T);jb.setAttribute("d",
za);Va.appendChild(jb);vb.appendChild(Va);za=g.createElement("text");jb=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);Qa=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#000000");Va=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0);za.setAttribute("font-size",Xa*pa.scale+"px");za.setAttribute("font-family",mxUtils.parseCssFontFamily(jb));za.setAttribute("fill",Qa);(Va&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&za.setAttribute("font-weight",
"bold");(Va&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&za.setAttribute("font-style","italic");pa=[];(Va&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&pa.push("underline");(Va&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&pa.push("line-through");0<pa.length&&(za.setAttribute("text-decoration",pa.join(" ")),(Va&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(za.style.textDecorationStyle="dotted"));Xa=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,
-mxConstants.ALIGN_CENTER);Va="middle";pa="50%";Xa==mxConstants.ALIGN_LEFT?(Va="start",pa="0%"):Xa==mxConstants.ALIGN_RIGHT&&(Va="end",pa="100%");za.setAttribute("text-anchor",Va);za.setAttribute("dominant-baseline","central");Xa=g.createElement("textPath");Xa.setAttribute("startOffset",pa);pa=(I?Sa:"")+"#"+U;Xa.setAttribute("href",pa);I&&Xa.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",pa);Xa.setAttribute("textLength",ba);Xa.setAttribute("lengthAdjust","spacing");mxUtils.write(Xa,G);
+mxConstants.ALIGN_CENTER);Va="middle";pa="50%";Xa==mxConstants.ALIGN_LEFT?(Va="start",pa="0%"):Xa==mxConstants.ALIGN_RIGHT&&(Va="end",pa="100%");za.setAttribute("text-anchor",Va);za.setAttribute("dominant-baseline","central");Xa=g.createElement("textPath");Xa.setAttribute("startOffset",pa);pa=(I?Sa:"")+"#"+T;Xa.setAttribute("href",pa);I&&Xa.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",pa);Xa.setAttribute("textLength",ca);Xa.setAttribute("lengthAdjust","spacing");mxUtils.write(Xa,G);
za.appendChild(Xa);vb.appendChild(za);g.root.appendChild(vb);this._curvedTextGroup=vb}else g.text(r+v/2,D+B/2,0,0,G,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,!1,"",null,!1,0)}}};Hb.prototype.destroy=function(){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;mxRectangleShape.prototype.destroy.apply(this,arguments)};mxCellRenderer.registerShape("curvedText",Hb);mxUtils.extend(Ob,
mxActor);Ob.prototype.tabSize=8;Ob.prototype.tabInset=4;Ob.prototype.holeSize=1;Ob.prototype.isRoundable=function(){return!1};Ob.prototype.redrawPath=function(g,r,D,v,B){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))));var G=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"tabInset",this.tabInset))));D=(B-G)/2;G=D+G;g.moveTo(0,D);g.lineTo(0,G);g.lineTo(r,B);g.lineTo(v,B);g.lineTo(v,0);g.lineTo(r,0);g.close();g.end()};Ob.prototype.paintVertexShape=
-function(g,r,D,v,B){mxActor.prototype.paintVertexShape.apply(this,arguments);var G=Math.max(0,parseFloat(mxUtils.getValue(this.style,"holeSize",this.holeSize)));if(!(0>=G)){var I=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize)),ba=mxUtils.getValue(this.style,"holeColor",mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#333333"));g.setFillColor(ba);g.setStrokeColor(ba);g.begin();g.ellipse(I/2-G,B/2-G,2*G,2*G);g.fillAndStroke()}};Ob.prototype.getLabelBounds=function(g){var r=
+function(g,r,D,v,B){mxActor.prototype.paintVertexShape.apply(this,arguments);var G=Math.max(0,parseFloat(mxUtils.getValue(this.style,"holeSize",this.holeSize)));if(!(0>=G)){var I=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize)),ca=mxUtils.getValue(this.style,"holeColor",mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#333333"));g.setFillColor(ca);g.setStrokeColor(ca);g.begin();g.ellipse(I/2-G,B/2-G,2*G,2*G);g.fillAndStroke()}};Ob.prototype.getLabelBounds=function(g){var r=
parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))*this.scale;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("gitTag",Ob);mxUtils.extend(ac,mxShape);ac.prototype.paintVertexShape=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"innerColor","#ECECFF");g.translate(r,D);g.ellipse(0,0,v,B);g.fillAndStroke();r=.6*Math.min(v,B);v=(v-r)/2;B=(B-r)/2;g.setFillColor(G);g.setStrokeColor(G);g.ellipse(v,B,r,r);g.fillAndStroke()};mxCellRenderer.registerShape("gitMergeCommit",
ac);mxUtils.extend(Zb,mxShape);Zb.prototype.paintVertexShape=function(g,r,D,v,B){var G=mxUtils.getValue(this.style,"featureColor","#fff");g.translate(r,D);r=v/2;D=B/2;var I=Math.min(v,B)/20;g.ellipse(0,0,v,B);g.fillAndStroke();g.setFillColor(G);g.setStrokeColor(G);g.setStrokeWidth(0);v=2.75*I;g.ellipse(r-3*I-v,D+2*I-v,2*v,2*v);g.fillAndStroke();g.ellipse(r+3*I-v,D+2*I-v,2*v,2*v);g.fillAndStroke();g.setStrokeWidth(1*I);g.begin();g.moveTo(r+3*I,D+1*I);g.lineTo(r,D-5*I);g.stroke();g.begin();g.moveTo(r-
3*I,D+1*I);g.lineTo(r,D-5*I);g.stroke()};mxCellRenderer.registerShape("gitCherryPick",Zb);mxUtils.extend(Vb,mxActor);Vb.prototype.isRoundable=function(){return!1};Vb.prototype.redrawPath=function(g,r,D,v,B){r=.8*v;B*=.8;D=.15*r;v=.8*D;var G=.1*r,I=.1*B;g.moveTo(G,I);G+=.25*r;I+=.1*-B;g.arcTo(D,D,0,0,0,G,I);G+=.25*r;I+=0;g.arcTo(D,D,0,0,0,G,I);G+=.25*r;I+=0;g.arcTo(D,D,0,0,0,G,I);G+=.25*r;I+=.1*B;g.arcTo(D,D,0,0,0,G,I);G+=.15*r;I+=.33*B;g.arcTo(D,D,0,0,0,G,I);G+=0;I+=.34*B;g.arcTo(v,v,0,0,0,G,I);G+=
@@ -3450,30 +3451,30 @@ Vb);mxUtils.extend(Bb,mxActor);Bb.prototype.isRoundable=function(){return!1};Bb.
!0):"y"===I?(G.up=!0,G.down=!0):I&&(G[I]=!0)});D=parseFloat(mxUtils.getValue(this.style,"nodePadding","8"));r=B/2;D/=2;v=G.right&&G.left&&G.up&&G.down?[[0,0],[r,0],[v/2,2*D],[v-r,0],[v,0],[v,-B/3],[v+2*D,-B/2],[v,-2*B/3],[v,-B],[v-r,-B],[v/2,-B-2*D],[r,-B],[0,-B],[0,-2*B/3],[-2*D,-B/2],[0,-B/3]]:G.right&&G.left&&G.up?[[r,0],[v-r,0],[v,-B/2],[v-r,-B],[r,-B],[0,-B/2]]:G.right&&G.left&&G.down?[[0,0],[r,-B],[v-r,-B],[v,0]]:G.right&&G.up&&G.down?[[0,0],[v,-r],[v,-B+r],[0,-B]]:G.left&&G.up&&G.down?[[v,
0],[0,-r],[0,-B+r],[v,-B]]:G.right&&G.left?[[r,0],[r,-D],[v-r,-D],[v-r,0],[v,-B/2],[v-r,-B],[v-r,-B+D],[r,-B+D],[r,-B],[0,-B/2]]:G.up&&G.down?[[v/2,0],[0,-D],[r,-D],[r,-B+D],[0,-B+D],[v/2,-B],[v,-B+D],[v-r,-B+D],[v-r,-D],[v,-D]]:G.right&&G.up?[[0,0],[v,-r],[0,-B]]:G.right&&G.down?[[0,0],[v,0],[0,-B]]:G.left&&G.up?[[v,0],[0,-r],[v,-B]]:G.left&&G.down?[[v,0],[0,0],[v,-B]]:G.right?[[r,-D],[v-r,-D],[v-r,0],[v,-B/2],[v-r,-B],[v-r,-B+D],[r,-B+D]]:G.left?[[r,0],[r,-D],[v-r,-D],[v-r,-B+D],[r,-B+D],[r,-B],
[0,-B/2]]:G.up?[[r,-D],[r,-B+D],[0,-B+D],[v/2,-B],[v,-B+D],[v-r,-B+D],[v-r,-D]]:G.down?[[v/2,0],[0,-D],[r,-D],[r,-B+D],[v-r,-B+D],[v-r,-D],[v,-D]]:[[0,0],[v,0],[v,-B],[0,-B]];g.moveTo(v[0][0],B+v[0][1]);for(r=1;r<v.length;r++)g.lineTo(v[r][0],B+v[r][1]);g.close();g.end()};mxCellRenderer.registerShape("mermaidBlockArrow",Ab);mxUtils.extend(Db,mxConnector);Db.prototype.defaultWidth=10;Db.prototype.getEdgeWidth=function(){return Math.max(1,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Db.prototype.getSvgScreenOffset=
-function(){return 0};Db.prototype.augmentBoundingBox=function(g){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var r=(this.getEdgeWidth()/2+this.strokewidth)*this.scale;g.y-=r;g.height+=2*r};Db.prototype.paintEdgeShape=function(g,r){var D=r[0],v=r[r.length-1];if(null!=D&&null!=v){r=D.x;D=D.y;var B=v.x;v=v.y;for(var G=(r+B)/2,I=this.getEdgeWidth()/2,ba=[],U=[],za=0;32>=za;za++){var pa=za/32,Xa=1-pa,vb=Xa*Xa*Xa*r+3*Xa*Xa*pa*G+3*Xa*pa*pa*G+pa*pa*pa*B,jb=Xa*Xa*Xa*D+3*Xa*Xa*pa*D+3*Xa*pa*pa*
-v+pa*pa*pa*v,Sa=3*Xa*Xa*(G-r)+3*pa*pa*(B-G);Xa=6*Xa*pa*(v-D);pa=Math.sqrt(Sa*Sa+Xa*Xa);0==pa&&(Sa=1,Xa=0,pa=1);Xa=-Xa/pa*I;Sa=Sa/pa*I;ba.push(new mxPoint(vb+Xa,jb+Sa));U.push(new mxPoint(vb-Xa,jb-Sa))}g.begin();g.moveTo(ba[0].x,ba[0].y);for(za=1;32>=za;za++)g.lineTo(ba[za].x,ba[za].y);for(za=32;0<=za;za--)g.lineTo(U[za].x,U[za].y);g.close();r=g.node;g.fillAndStroke();null!=r&&null!=r.setAttribute&&null!=r.parentNode&&(g=r.getAttribute("style"),r.setAttribute("style",(null!=g&&""!=g?g+";":"")+"mix-blend-mode:multiply"))}};
-mxCellRenderer.registerShape("mermaidSankeyLink",Db);if("undefined"!==typeof mxVertexHandler){var ib=function(g,r,D){return kb(g,["width"],r,function(v,B,G,I,ba){ba=g.shape.getEdgeWidth()*g.view.scale+D;return new mxPoint(I.x+B*v/4+G*ba/2,I.y+G*v/4-B*ba/2)},function(v,B,G,I,ba,U){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));g.style.width=Math.round(Math.round(2*v)/g.view.scale-D)})},kb=function(g,r,D,v,B){return qb(g,r,function(G){var I=g.absolutePoints;if(null!=I&&0<I.length){var ba=
-I.length-1;G=g.view.translate;var U=g.view.scale,za=D?I[0]:I[ba];I=D?I[1]:I[ba-1];ba=I.x-za.x;var pa=I.y-za.y,Xa=Math.sqrt(ba*ba+pa*pa);za=v.call(this,Xa,ba/Xa,pa/Xa,za,I);return new mxPoint(za.x/U-G.x,za.y/U-G.y)}return null},function(G,I,ba){var U=g.absolutePoints,za=U.length-1;G=g.view.translate;var pa=g.view.scale,Xa=D?U[0]:U[za];U=D?U[1]:U[za-1];za=U.x-Xa.x;var vb=U.y-Xa.y,jb=Math.sqrt(za*za+vb*vb);I.x=(I.x+G.x)*pa;I.y=(I.y+G.y)*pa;B.call(this,jb,za/jb,vb/jb,Xa,U,I,ba)})},pb=function(g,r){return function(D){return[kb(D,
-["startWidth"],!0,function(v,B,G,I,ba){ba=mxUtils.getNumber(D.style,"startWidth",g)*D.view.scale+r;return new mxPoint(I.x+B*v/4+G*ba/2,I.y+G*v/4-B*ba/2)},function(v,B,G,I,ba,U){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));D.style.startWidth=Math.round(2*v)/D.view.scale-r})]}},sb=function(g){return function(r){return[qb(r,["arrowWidth","arrowSize"],function(D){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Wa.prototype.arrowWidth))),B=Math.max(0,Math.min(g,
+function(){return 0};Db.prototype.augmentBoundingBox=function(g){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var r=(this.getEdgeWidth()/2+this.strokewidth)*this.scale;g.y-=r;g.height+=2*r};Db.prototype.paintEdgeShape=function(g,r){var D=r[0],v=r[r.length-1];if(null!=D&&null!=v){r=D.x;D=D.y;var B=v.x;v=v.y;for(var G=(r+B)/2,I=this.getEdgeWidth()/2,ca=[],T=[],za=0;32>=za;za++){var pa=za/32,Xa=1-pa,vb=Xa*Xa*Xa*r+3*Xa*Xa*pa*G+3*Xa*pa*pa*G+pa*pa*pa*B,jb=Xa*Xa*Xa*D+3*Xa*Xa*pa*D+3*Xa*pa*pa*
+v+pa*pa*pa*v,Sa=3*Xa*Xa*(G-r)+3*pa*pa*(B-G);Xa=6*Xa*pa*(v-D);pa=Math.sqrt(Sa*Sa+Xa*Xa);0==pa&&(Sa=1,Xa=0,pa=1);Xa=-Xa/pa*I;Sa=Sa/pa*I;ca.push(new mxPoint(vb+Xa,jb+Sa));T.push(new mxPoint(vb-Xa,jb-Sa))}g.begin();g.moveTo(ca[0].x,ca[0].y);for(za=1;32>=za;za++)g.lineTo(ca[za].x,ca[za].y);for(za=32;0<=za;za--)g.lineTo(T[za].x,T[za].y);g.close();r=g.node;g.fillAndStroke();null!=r&&null!=r.setAttribute&&null!=r.parentNode&&(g=r.getAttribute("style"),r.setAttribute("style",(null!=g&&""!=g?g+";":"")+"mix-blend-mode:multiply"))}};
+mxCellRenderer.registerShape("mermaidSankeyLink",Db);if("undefined"!==typeof mxVertexHandler){var ib=function(g,r,D){return kb(g,["width"],r,function(v,B,G,I,ca){ca=g.shape.getEdgeWidth()*g.view.scale+D;return new mxPoint(I.x+B*v/4+G*ca/2,I.y+G*v/4-B*ca/2)},function(v,B,G,I,ca,T){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));g.style.width=Math.round(Math.round(2*v)/g.view.scale-D)})},kb=function(g,r,D,v,B){return qb(g,r,function(G){var I=g.absolutePoints;if(null!=I&&0<I.length){var ca=
+I.length-1;G=g.view.translate;var T=g.view.scale,za=D?I[0]:I[ca];I=D?I[1]:I[ca-1];ca=I.x-za.x;var pa=I.y-za.y,Xa=Math.sqrt(ca*ca+pa*pa);za=v.call(this,Xa,ca/Xa,pa/Xa,za,I);return new mxPoint(za.x/T-G.x,za.y/T-G.y)}return null},function(G,I,ca){var T=g.absolutePoints,za=T.length-1;G=g.view.translate;var pa=g.view.scale,Xa=D?T[0]:T[za];T=D?T[1]:T[za-1];za=T.x-Xa.x;var vb=T.y-Xa.y,jb=Math.sqrt(za*za+vb*vb);I.x=(I.x+G.x)*pa;I.y=(I.y+G.y)*pa;B.call(this,jb,za/jb,vb/jb,Xa,T,I,ca)})},pb=function(g,r){return function(D){return[kb(D,
+["startWidth"],!0,function(v,B,G,I,ca){ca=mxUtils.getNumber(D.style,"startWidth",g)*D.view.scale+r;return new mxPoint(I.x+B*v/4+G*ca/2,I.y+G*v/4-B*ca/2)},function(v,B,G,I,ca,T){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));D.style.startWidth=Math.round(2*v)/D.view.scale-r})]}},sb=function(g){return function(r){return[qb(r,["arrowWidth","arrowSize"],function(D){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Wa.prototype.arrowWidth))),B=Math.max(0,Math.min(g,
mxUtils.getValue(this.state.style,"arrowSize",Wa.prototype.arrowSize)));return new mxPoint(D.x+(1-B)*D.width,D.y+(1-v)*D.height/2)},function(D,v){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(D.y+D.height/2-v.y)/D.height*2));this.state.style.arrowSize=Math.max(0,Math.min(g,(D.x+D.width-v.x)/D.width))})]}},eb=function(g){return function(r){return[qb(r,["size"],function(D){var v=Math.max(0,Math.min(.5*D.height,parseFloat(mxUtils.getValue(this.state.style,"size",g))));return new mxPoint(D.x,
D.y+v)},function(D,v){this.state.style.size=Math.max(0,v.y-D.y)},!0)]}},gb=function(g,r,D){return function(v){var B=[qb(v,["size"],function(G){var I=Math.max(0,Math.min(G.width,Math.min(G.height,parseFloat(mxUtils.getValue(this.state.style,"size",r)))))*g;return new mxPoint(G.x+I,G.y+I)},function(G,I){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(G.width,I.x-G.x),Math.min(G.height,I.y-G.y)))/g)},!1)];D&&mxUtils.getValue(v.style,mxConstants.STYLE_ROUNDED,!1)&&B.push(tb(v));return B}},
-bb=function(g,r,D,v,B){D=null!=D?D:.5;return function(G){var I=[qb(G,["size"],function(ba){var U=null!=B?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,za=parseFloat(mxUtils.getValue(this.state.style,"size",U?B:g));return new mxPoint(ba.x+Math.max(0,Math.min(.5*ba.width,za*(U?1:ba.width))),ba.getCenterY())},function(ba,U,za){ba=null!=B&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?U.x-ba.x:Math.max(0,Math.min(D,(U.x-ba.x)/ba.width));this.state.style.size=ba},!1,v)];r&&mxUtils.getValue(G.style,
-mxConstants.STYLE_ROUNDED,!1)&&I.push(tb(G));return I}},yb=function(g,r,D){g=null!=g?g:.5;return function(v){var B=[qb(v,["size"],function(G){var I=null!=D?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ba=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",I?D:r)));return new mxPoint(G.x+Math.min(.75*G.width*g,ba*(I?.75:.75*G.width)),G.y+G.height/4)},function(G,I){G=null!=D&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?I.x-G.x:Math.max(0,Math.min(g,(I.x-G.x)/G.width*
+bb=function(g,r,D,v,B){D=null!=D?D:.5;return function(G){var I=[qb(G,["size"],function(ca){var T=null!=B?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,za=parseFloat(mxUtils.getValue(this.state.style,"size",T?B:g));return new mxPoint(ca.x+Math.max(0,Math.min(.5*ca.width,za*(T?1:ca.width))),ca.getCenterY())},function(ca,T,za){ca=null!=B&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?T.x-ca.x:Math.max(0,Math.min(D,(T.x-ca.x)/ca.width));this.state.style.size=ca},!1,v)];r&&mxUtils.getValue(G.style,
+mxConstants.STYLE_ROUNDED,!1)&&I.push(tb(G));return I}},yb=function(g,r,D){g=null!=g?g:.5;return function(v){var B=[qb(v,["size"],function(G){var I=null!=D?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ca=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",I?D:r)));return new mxPoint(G.x+Math.min(.75*G.width*g,ca*(I?.75:.75*G.width)),G.y+G.height/4)},function(G,I){G=null!=D&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?I.x-G.x:Math.max(0,Math.min(g,(I.x-G.x)/G.width*
.75));this.state.style.size=G},!1,!0)];mxUtils.getValue(v.style,mxConstants.STYLE_ROUNDED,!1)&&B.push(tb(v));return B}},xb=function(){return function(g){var r=[];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r}},tb=function(g,r){return qb(g,[mxConstants.STYLE_ARCSIZE],function(D){var v=null!=r?r:D.height/8;if("1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var B=mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(D.x+
D.width-Math.min(D.width/2,B),D.y+v)}B=Math.max(0,parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(D.x+D.width-Math.min(Math.max(D.width/2,D.height/2),Math.min(D.width,D.height)*B),D.y+v)},function(D,v,B){"1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(D.width,2*(D.x+D.width-v.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=
-Math.round(Math.min(50,Math.max(0,100*(D.width-v.x+D.x)/Math.min(D.width,D.height))))})},qb=function(g,r,D,v,B,G,I){var ba=new mxHandle(g,null,mxVertexHandler.prototype.secondaryHandleImage);ba.execute=function(za){for(var pa=0;pa<r.length;pa++)this.copyStyle(r[pa]);I&&I(za)};ba.getPosition=D;ba.setPosition=v;ba.ignoreGrid=null!=B?B:!0;if(G){var U=ba.positionChanged;ba.positionChanged=function(){U.apply(this,arguments);g.view.invalidate(this.state.cell);g.view.validate()}}return ba},Jb={link:function(g){return[ib(g,
-!0,10),ib(g,!1,10)]},pipe:function(g){return[ib(g,!0,10),ib(g,!1,10)]},flexArrow:function(g){var r=g.view.graph.gridSize/g.view.scale,D=[];mxUtils.getValue(g.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(D.push(kb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,B,G,I,ba){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ba=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+
-B*(ba+g.shape.strokewidth*g.view.scale)+G*v/2,I.y+G*(ba+g.shape.strokewidth*g.view.scale)-B*v/2)},function(v,B,G,I,ba,U,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,U.x,U.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE];
-mxEvent.isAltDown(za.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE])})),D.push(kb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,B,G,I,ba){v=(g.shape.getStartArrowWidth()-g.shape.strokewidth)*g.view.scale;ba=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;
-return new mxPoint(I.x+B*(ba+g.shape.strokewidth*g.view.scale)+G*v/2,I.y+G*(ba+g.shape.strokewidth*g.view.scale)-B*v/2)},function(v,B,G,I,ba,U,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,U.x,U.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.startWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=
+Math.round(Math.min(50,Math.max(0,100*(D.width-v.x+D.x)/Math.min(D.width,D.height))))})},qb=function(g,r,D,v,B,G,I){var ca=new mxHandle(g,null,mxVertexHandler.prototype.secondaryHandleImage);ca.execute=function(za){for(var pa=0;pa<r.length;pa++)this.copyStyle(r[pa]);I&&I(za)};ca.getPosition=D;ca.setPosition=v;ca.ignoreGrid=null!=B?B:!0;if(G){var T=ca.positionChanged;ca.positionChanged=function(){T.apply(this,arguments);g.view.invalidate(this.state.cell);g.view.validate()}}return ca},Jb={link:function(g){return[ib(g,
+!0,10),ib(g,!1,10)]},pipe:function(g){return[ib(g,!0,10),ib(g,!1,10)]},flexArrow:function(g){var r=g.view.graph.gridSize/g.view.scale,D=[];mxUtils.getValue(g.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(D.push(kb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,B,G,I,ca){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ca=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+
+B*(ca+g.shape.strokewidth*g.view.scale)+G*v/2,I.y+G*(ca+g.shape.strokewidth*g.view.scale)-B*v/2)},function(v,B,G,I,ca,T,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,T.x,T.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE];
+mxEvent.isAltDown(za.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE])})),D.push(kb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,B,G,I,ca){v=(g.shape.getStartArrowWidth()-g.shape.strokewidth)*g.view.scale;ca=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;
+return new mxPoint(I.x+B*(ca+g.shape.strokewidth*g.view.scale)+G*v/2,I.y+G*(ca+g.shape.strokewidth*g.view.scale)-B*v/2)},function(v,B,G,I,ca,T,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,T.x,T.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.startWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=
g.style[mxConstants.STYLE_STARTSIZE],g.style.endWidth=g.style.startWidth;mxEvent.isAltDown(za.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(g.style.startWidth)-parseFloat(g.style.endWidth))<r&&(g.style.startWidth=g.style.endWidth))})));mxUtils.getValue(g.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(D.push(kb(g,
-["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(v,B,G,I,ba){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ba=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+B*(ba+g.shape.strokewidth*g.view.scale)-G*v/2,I.y+G*(ba+g.shape.strokewidth*g.view.scale)+B*v/2)},function(v,B,G,I,ba,U,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,U.x,U.y);
+["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(v,B,G,I,ca){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ca=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+B*(ca+g.shape.strokewidth*g.view.scale)-G*v/2,I.y+G*(ca+g.shape.strokewidth*g.view.scale)+B*v/2)},function(v,B,G,I,ca,T,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-B,T.x,T.y);
g.style[mxConstants.STYLE_ENDSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(za.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE])})),D.push(kb(g,
-["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(v,B,G,I,ba){v=(g.shape.getEndArrowWidth()-g.shape.strokewidth)*g.view.scale;ba=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+B*(ba+g.shape.strokewidth*g.view.scale)-G*v/2,I.y+G*(ba+g.shape.strokewidth*g.view.scale)+B*v/2)},function(v,B,G,I,ba,U,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ba.x,ba.y,U.x,U.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+
-G,I.y-B,U.x,U.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.endWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE],g.style.startWidth=g.style.endWidth;mxEvent.isAltDown(za.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<
+["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(v,B,G,I,ca){v=(g.shape.getEndArrowWidth()-g.shape.strokewidth)*g.view.scale;ca=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+B*(ca+g.shape.strokewidth*g.view.scale)-G*v/2,I.y+G*(ca+g.shape.strokewidth*g.view.scale)+B*v/2)},function(v,B,G,I,ca,T,za){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ca.x,ca.y,T.x,T.y));B=mxUtils.ptLineDist(I.x,I.y,I.x+
+G,I.y-B,T.x,T.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((B-g.shape.strokewidth)/3/g.view.scale);g.style.endWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(za.getEvent())||mxEvent.isControlDown(za.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE],g.style.startWidth=g.style.endWidth;mxEvent.isAltDown(za.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<
r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(g.style.endWidth)-parseFloat(g.style.startWidth))<r&&(g.style.endWidth=g.style.startWidth))})));return D},swimlane:function(g){var r=[];if(mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED)){var D=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));r.push(tb(g,D/2))}r.push(qb(g,[mxConstants.STYLE_STARTSIZE],function(v){var B=parseFloat(mxUtils.getValue(g.style,
mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(g.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(v.getCenterX(),v.y+Math.max(0,Math.min(v.height,B))):new mxPoint(v.x+Math.max(0,Math.min(v.width,B)),v.getCenterY())},function(v,B){g.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(v.height,B.y-v.y))):Math.round(Math.max(0,Math.min(v.width,B.x-v.x)))},!1,null,function(v){var B=
-g.view.graph;if(!mxEvent.isShiftDown(v.getEvent())&&!mxEvent.isControlDown(v.getEvent())&&(B.isTableRow(g.cell)||B.isTableCell(g.cell))){v=B.getSwimlaneDirection(g.style);var G=B.model.getParent(g.cell);G=B.model.getChildCells(G,!0);for(var I=[],ba=0;ba<G.length;ba++)G[ba]!=g.cell&&B.isSwimlane(G[ba])&&B.getSwimlaneDirection(B.getCurrentCellStyle(G[ba]))==v&&I.push(G[ba]);B.setCellStyles(mxConstants.STYLE_STARTSIZE,g.style[mxConstants.STYLE_STARTSIZE],I)}}));return r},label:xb(),ext:xb(),rectangle:xb(),
+g.view.graph;if(!mxEvent.isShiftDown(v.getEvent())&&!mxEvent.isControlDown(v.getEvent())&&(B.isTableRow(g.cell)||B.isTableCell(g.cell))){v=B.getSwimlaneDirection(g.style);var G=B.model.getParent(g.cell);G=B.model.getChildCells(G,!0);for(var I=[],ca=0;ca<G.length;ca++)G[ca]!=g.cell&&B.isSwimlane(G[ca])&&B.getSwimlaneDirection(B.getCurrentCellStyle(G[ca]))==v&&I.push(G[ca]);B.setCellStyles(mxConstants.STYLE_STARTSIZE,g.style[mxConstants.STYLE_STARTSIZE],I)}}));return r},label:xb(),ext:xb(),rectangle:xb(),
triangle:xb(),rhombus:xb(),umlLifeline:function(g){return[qb(g,["size"],function(r){var D=Math.max(0,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",Ba.prototype.size))));return new mxPoint(r.getCenterX(),r.y+D)},function(r,D){this.state.style.size=Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},umlFrame:function(g){return[qb(g,["width","height"],function(r){var D=Math.max(ma.prototype.corner,Math.min(r.width,mxUtils.getValue(this.state.style,"width",ma.prototype.width))),
v=Math.max(1.5*ma.prototype.corner,Math.min(r.height,mxUtils.getValue(this.state.style,"height",ma.prototype.height)));return new mxPoint(r.x+D,r.y+v)},function(r,D){this.state.style.width=Math.round(Math.max(ma.prototype.corner,Math.min(r.width,D.x-r.x)));this.state.style.height=Math.round(Math.max(1.5*ma.prototype.corner,Math.min(r.height,D.y-r.y)))},!1)]},process:function(g){var r=[qb(g,["size"],function(D){var v="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),B=parseFloat(mxUtils.getValue(this.state.style,
"size",ja.prototype.size));return v?new mxPoint(D.x+B,D.y+D.height/4):new mxPoint(D.x+D.width*B,D.y+D.height/4)},function(D,v){D="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*D.width,v.x-D.x)):Math.max(0,Math.min(.5,(v.x-D.x)/D.width));this.state.style.size=D},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},cross:function(g){return[qb(g,["size"],function(r){var D=Math.min(r.width,r.height);D=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,
@@ -3486,8 +3487,8 @@ return new mxPoint(D.x+v*D.width,D.y+D.height)},function(D,v){this.state.style.p
B*D.width+G),D.y+D.height-v)},function(D,v){var B=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ua.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(D.width,v.x-D.x-B*D.width)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},wedgeCallout:function(g){var r=[qb(g,["tipX","tipY"],function(D){var v=null!=this.state.shape?this.state.shape.getTipOffset():new mxPoint(Da.prototype.tipX,Da.prototype.tipY);return new mxPoint(D.getCenterX()+
v.x*D.width,D.getCenterY()+v.y*D.height)},function(D,v){var B=Da.prototype.maxTipOffset;this.state.style.tipX=Math.round(1E3*Math.max(-B,Math.min(B,(v.x-D.getCenterX())/Math.max(1,D.width))))/1E3;this.state.style.tipY=Math.round(1E3*Math.max(-B,Math.min(B,(v.y-D.getCenterY())/Math.max(1,D.height))))/1E3},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},internalStorage:function(g){var r=[qb(g,["dx","dy"],function(D){var v=Math.max(0,Math.min(D.width,mxUtils.getValue(this.state.style,
"dx",Ja.prototype.dx))),B=Math.max(0,Math.min(D.height,mxUtils.getValue(this.state.style,"dy",Ja.prototype.dy)));return new mxPoint(D.x+v,D.y+B)},function(D,v){this.state.style.dx=Math.round(Math.max(0,Math.min(D.width,v.x-D.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(D.height,v.y-D.y)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},module:function(g){return[qb(g,["jettyWidth","jettyHeight"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,
-"jettyWidth",Ia.prototype.jettyWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"jettyHeight",Ia.prototype.jettyHeight)));return new mxPoint(r.x+D/2,r.y+2*v)},function(r,D){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(r.width,D.x-r.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(r.height,D.y-r.y))/2)})]},corner:function(g){return[qb(g,["dx","dy"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",Ga.prototype.dx))),
-v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",Ga.prototype.dy)));return new mxPoint(r.x+D,r.y+v)},function(r,D){this.state.style.dx=Math.round(Math.max(0,Math.min(r.width,D.x-r.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},tee:function(g){return[qb(g,["dx","dy"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy)));
+"jettyWidth",Ia.prototype.jettyWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"jettyHeight",Ia.prototype.jettyHeight)));return new mxPoint(r.x+D/2,r.y+2*v)},function(r,D){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(r.width,D.x-r.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(r.height,D.y-r.y))/2)})]},corner:function(g){return[qb(g,["dx","dy"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",Ha.prototype.dx))),
+v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",Ha.prototype.dy)));return new mxPoint(r.x+D,r.y+v)},function(r,D){this.state.style.dx=Math.round(Math.max(0,Math.min(r.width,D.x-r.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},tee:function(g){return[qb(g,["dx","dy"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy)));
return new mxPoint(r.x+(r.width+D)/2,r.y+v)},function(r,D){this.state.style.dx=Math.round(Math.max(0,2*Math.min(r.width/2,D.x-r.x-r.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},singleArrow:sb(1),doubleArrow:sb(.5),"mxgraph.arrows2.wedgeArrow":pb(20,20),"mxgraph.arrows2.wedgeArrowDashed":pb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":pb(20,20),folder:function(g){return[qb(g,["tabWidth","tabHeight"],function(r){var D=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,
"tabWidth",q.prototype.tabWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(D=r.width-D);return new mxPoint(r.x+D,r.y+v)},function(r,D){var v=Math.max(0,Math.min(r.width,D.x-r.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(v=r.width-v);this.state.style.tabWidth=Math.round(v);this.state.style.tabHeight=
Math.round(Math.max(0,Math.min(r.height,D.y-r.y)))},!1)]},document:function(g){return[qb(g,["size"],function(r){var D=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Q.prototype.size))));return new mxPoint(r.x+3*r.width/4,r.y+(1-D)*r.height)},function(r,D){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-D.y)/r.height))},!1)]},tape:function(g){return[qb(g,["size"],function(r){var D=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",K.prototype.size))));
@@ -3503,8 +3504,8 @@ Math.round(Math.max(-I,Math.min(I,v.y-D.y-G-B)))},!1),qb(g,["arcEndY"],function(
r,D){var v=this.getCellStyle(g);if(null!=v&&"curvedText"==v[mxConstants.STYLE_SHAPE]){var B=this.convertValueToString(g);if(null!=B&&0<B.length){var G=parseFloat(mxUtils.getValue(v,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),I=mxUtils.getValue(v,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);v=mxUtils.getValue(v,mxConstants.STYLE_FONTSTYLE,0);B=.85*mxUtils.getSizeForString(B,G,I,null,v).width;I=this.model.getGeometry(g);I=null!=I?I.height:60;(D=null!=D?D:this.gridEnabled)&&
(B=this.snap(B+this.gridSize/2));return new mxRectangle(0,0,Math.max(B,2*G)+10,I)}return null}return Yb.apply(this,arguments)};var Sb=mxCellRenderer.prototype.checkPlaceholderStyles;mxCellRenderer.prototype.checkPlaceholderStyles=function(g){return null!=g.style&&"curvedText"==g.style[mxConstants.STYLE_SHAPE]?!0:Sb.apply(this,arguments)};if("undefined"!==typeof mxCellEditor){var Qb=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(g,r){Qb.apply(this,arguments);var D=
this.graph.view.getState(g);null!=D&&null!=D.style&&"curvedText"==D.style[mxConstants.STYLE_SHAPE]&&null!=D.shape&&D.shape.redraw()};var Cb=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(g){var r=this.editingCell;Cb.apply(this,arguments);null!=r&&(r=this.graph.view.getState(r),null!=r&&null!=r.style&&"curvedText"==r.style[mxConstants.STYLE_SHAPE]&&null!=r.shape&&r.shape.redraw())}}var Gb=new mxPoint(1,0),Kb=new mxPoint(1,0),cc=mxUtils.toRadians(-30);Gb=mxUtils.getRotatedPoint(Gb,
-Math.cos(cc),Math.sin(cc));var Pb=mxUtils.toRadians(-150);Kb=mxUtils.getRotatedPoint(Kb,Math.cos(Pb),Math.sin(Pb));mxEdgeStyle.IsometricConnector=function(g,r,D,v,B){var G=g.view;v=null!=v&&0<v.length?v[0]:null;var I=g.absolutePoints,ba=I[0];I=I[I.length-1];null!=v&&(v=G.transformControlPoint(g,v));null==ba&&null!=r&&(ba=new mxPoint(r.getCenterX(),r.getCenterY()));null==I&&null!=D&&(I=new mxPoint(D.getCenterX(),D.getCenterY()));var U=Gb.x,za=Gb.y,pa=Kb.x,Xa=Kb.y,vb="horizontal"==mxUtils.getValue(g.style,
-"elbow","horizontal");if(null!=I&&null!=ba){g=function(Sa,Va,Qa){Sa-=jb.x;var Ya=Va-jb.y;Va=(Xa*Sa-pa*Ya)/(U*Xa-za*pa);Sa=(za*Sa-U*Ya)/(za*pa-U*Xa);vb?(Qa&&(jb=new mxPoint(jb.x+U*Va,jb.y+za*Va),B.push(jb)),jb=new mxPoint(jb.x+pa*Sa,jb.y+Xa*Sa)):(Qa&&(jb=new mxPoint(jb.x+pa*Sa,jb.y+Xa*Sa),B.push(jb)),jb=new mxPoint(jb.x+U*Va,jb.y+za*Va));B.push(jb)};var jb=ba;null==v&&(v=new mxPoint(ba.x+(I.x-ba.x)/2,ba.y+(I.y-ba.y)/2));g(v.x,v.y,!0);g(I.x,I.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);
+Math.cos(cc),Math.sin(cc));var Pb=mxUtils.toRadians(-150);Kb=mxUtils.getRotatedPoint(Kb,Math.cos(Pb),Math.sin(Pb));mxEdgeStyle.IsometricConnector=function(g,r,D,v,B){var G=g.view;v=null!=v&&0<v.length?v[0]:null;var I=g.absolutePoints,ca=I[0];I=I[I.length-1];null!=v&&(v=G.transformControlPoint(g,v));null==ca&&null!=r&&(ca=new mxPoint(r.getCenterX(),r.getCenterY()));null==I&&null!=D&&(I=new mxPoint(D.getCenterX(),D.getCenterY()));var T=Gb.x,za=Gb.y,pa=Kb.x,Xa=Kb.y,vb="horizontal"==mxUtils.getValue(g.style,
+"elbow","horizontal");if(null!=I&&null!=ca){g=function(Sa,Va,Qa){Sa-=jb.x;var Ya=Va-jb.y;Va=(Xa*Sa-pa*Ya)/(T*Xa-za*pa);Sa=(za*Sa-T*Ya)/(za*pa-T*Xa);vb?(Qa&&(jb=new mxPoint(jb.x+T*Va,jb.y+za*Va),B.push(jb)),jb=new mxPoint(jb.x+pa*Sa,jb.y+Xa*Sa)):(Qa&&(jb=new mxPoint(jb.x+pa*Sa,jb.y+Xa*Sa),B.push(jb)),jb=new mxPoint(jb.x+T*Va,jb.y+za*Va));B.push(jb)};var jb=ca;null==v&&(v=new mxPoint(ca.x+(I.x-ca.x)/2,ca.y+(I.y-ca.y)/2));g(v.x,v.y,!0);g(I.x,I.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);
var dc=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(g,r){if(r==mxEdgeStyle.IsometricConnector){var D=new mxElbowEdgeHandler(g);D.snapToTerminals=!1;return D}return dc.apply(this,arguments)};y.prototype.constraints=[];C.prototype.getConstraints=function(g,r,D){g=[];var v=Math.tan(mxUtils.toRadians(30)),B=(.5-v)/2;v=Math.min(r,D/(.5+v));r=(r-v)/2;D=(D-v)/2;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,D+.25*v));g.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,r+.5*v,D+v*B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+v,D+.25*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+v,D+.75*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+.5*v,D+(1-B)*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,D+.75*v));return g};R.prototype.getConstraints=function(g,r,D){g=[];var v=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;v=Math.min(r*
Math.tan(v),.5*D);g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,D-v));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,D-v));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,
@@ -3531,7 +3532,7 @@ Wb.prototype.getConstraints=function(g,r,D){g=[];var v=Math.min(r,D/2),B=Math.mi
0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,r),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),
!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(D-.5*g,1.5*g)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(D-.5*g,3.5*g))];D>5*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,r));D>8*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,r));D>15*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,r));return v};Ra.prototype.constraints=mxRectangleShape.prototype.constraints;$a.prototype.constraints=mxRectangleShape.prototype.constraints;
mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,
-.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];T.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,
+.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];U.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,
.5),!1)];Ca.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,
1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,
1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];l.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];K.prototype.constraints=
@@ -3544,7 +3545,7 @@ mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),n
.25),!1)];V.prototype.constraints=mxRectangleShape.prototype.constraints;J.prototype.constraints=mxRectangleShape.prototype.constraints;Q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),
!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;ab.prototype.getConstraints=function(g,r,D){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),B=Math.max(0,Math.min(D,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,
0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*r+.25*v,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),.5*(D+B)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),D));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,.5*(r-v),D));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),.5*(D+B)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*r-.25*v,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*B));return g};Ga.prototype.getConstraints=function(g,r,D){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,
+0),!1,null,.5*(r-v),D));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),.5*(D+B)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*r-.25*v,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*B));return g};Ha.prototype.getConstraints=function(g,r,D){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,
"dx",this.dx)))),B=Math.max(0,Math.min(D,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),B));g.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,v,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,.5*(D+B)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,D));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*v,D));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return g};Ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,
1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Wa.prototype.getConstraints=function(g,r,D){g=[];var v=D*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),B=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
@@ -3555,7 +3556,7 @@ mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),n
1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,B,D));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,B,D-.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,B,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+B),v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,G));g.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,.5*(r+B),G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,v));return g};Ba.prototype.constraints=
null;wb.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Fa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,
-.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Ha.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];La.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}
+.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Ga.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];La.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}
Actions.prototype.init=function(){function b(F){n.escape();F=n.deleteCells(n.getDeletableCells(n.getSelectionCells()),F);null!=F&&n.setSelectionCells(F)}function d(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{for(var F=n.getSelectionCells(),N=0;N<F.length;N++)n.cellLabelChanged(F[N],"")}finally{n.getModel().endUpdate()}}}function m(F,N,R,c,f){f.getModel().beginUpdate();try{var l=f.getCellGeometry(F);null!=l&&R&&c&&(R/=c,l=l.clone(),1<R?l.height=l.width/R:l.width=l.height*R,f.getModel().setGeometry(F,
l));f.setCellStyles(mxConstants.STYLE_CLIP_PATH,N,[F]);f.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[F])}finally{f.getModel().endUpdate()}}var p=this.editorUi,t=p.editor,n=t.graph,y=function(){return Action.prototype.isEnabled.apply(this,arguments)&&n.isEnabled()};this.addAction("new...",function(){n.openLink(p.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";p.openFile()});var C=new Action("smartFit",function(){if(p.chromelessResize)n.isLightboxView()?(1==
n.view.scale?p.lightboxFit():n.zoomTo(1),p.chromelessResize(!1)):p.chromelessResize(!0);else{n.popupMenuHandler.hideMenu();var F=n.view.scale,N=n.container.scrollLeft,R=n.container.scrollTop,c=n.view.translate.x,f=n.view.translate.y;p.actions.get("resetView").funct();1E-5>Math.abs(F-n.view.scale)&&5>Math.abs(N-n.container.scrollLeft)&&5>Math.abs(R-n.container.scrollTop)&&c==n.view.translate.x&&f==n.view.translate.y&&p.actions.get("fitWindow").funct()}},null,null,"Enter");C.getTitle=function(){return mxResources.get("fitWindow")+
@@ -3775,15 +3776,14 @@ Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.tweetImage=IMAGE_PATH+"/t
!0;Editor.enableSimpleTheme=!0;Editor.enableHashObjects=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"1"!=urlParams.embed&&window.top==window.self;Editor.defaultIncludeDiagram=!0;Editor.enableServiceWorker="0"!=urlParams.pwa&&"serviceWorker"in navigator&&("1"==urlParams.offline||"1"==urlParams.enableSW||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.draw\.io$/.test(window.location.hostname));try{Editor.enableServiceWorker&&navigator.serviceWorker}catch(k){Editor.enableServiceWorker=
!1}Editor.defaultLanguages=null;Editor.enableWebFonts=!window.mxIsElectron;Editor.enableLocalFonts=!1;Editor.localFonts=null;Editor.enableShadowOption=!mxClient.IS_SF;Editor.enableExportUrl=!0;Editor.enableRealtime=!0;Editor.enableRealtimeCache=!0;Editor.p2pSyncNotify=!1;Editor.compressXml=!0;Editor.defaultCompressed=!1;Editor.oneDriveInlinePicker=null!=window.urlParams&&"0"==window.urlParams.inlinePicker?!1:!0;Editor.globalVars=null;Editor.defaultBorder=5;Editor.addSvgMetadata=!1;Editor.mathOutputSize=
!0;Editor.enableAnimations=!0;Editor.insertAnimations=!0;Editor.enableWindowDocking="1"!=urlParams.embedInline;Editor.pasteAtMousePointer=!0;Editor.fitDiagramOnLoad=!0;Editor.fitDiagramOnPage=!0;Editor.showLinkIcons=!1;Editor.showTooltipIcons=!1;Editor.showNoteIcons=!0;Editor.tooltipFontSize=null;Editor.tooltipMaxWidth=360;Editor.expandPatternsForPrint=!0;Editor.defaultTextStyle="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;";Editor.defaultNoteStyle=
-"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;autosizeText=1;";Editor.enableAi=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.aiActions=["createPublic","create","update","assist"];Editor.gptApiKey=null!=urlParams["gpt-api-key"]?
-decodeURIComponent(urlParams["gpt-api-key"]):null;Editor.geminiApiKey=null!=urlParams["gemini-api-key"]?decodeURIComponent(urlParams["gemini-api-key"]):null;Editor.claudeApiKey=null!=urlParams["claude-api-key"]?decodeURIComponent(urlParams["claude-api-key"]):null;Editor.gptUrl=null!=urlParams["gpt-url"]?decodeURIComponent(urlParams["gpt-url"]):"https://api.openai.com/v1/chat/completions";Editor.aiGlobals={gptApiKey:Editor.gptApiKey,geminiApiKey:Editor.geminiApiKey,claudeApiKey:Editor.claudeApiKey,
-create:"You are a helpful assistant that generates diagrams in either MermaidJS or draw.io XML format based on the given prompt. Begin with a concise checklist (3-7 bullets) of what you will do; keep items conceptual, not implementation-level. Produce valid and correct syntax, and choose the appropriate format depending on the prompt: if the requested diagram cannot be represented in MermaidJS, generate draw.io XML instead but do not use indentation and newlines. When asked to modify a diagram that is given in the conversation as draw.io XML, return the complete updated diagram as draw.io XML, not MermaidJS, and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. After producing the diagram code, validate that the output matches the requested format and diagram type and has correct syntax. Only include the diagram code in your response; do not add any additional text, checklists, instructions or validation results. If the prompt is a question or does not ask for a diagram, answer it as plain text without any diagram code instead.",
+"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;autosizeText=1;";Editor.enableAi=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.aiActions=["createPublic","create","update","assist"];Editor.gptApiKey=null;Editor.geminiApiKey=
+null;Editor.claudeApiKey=null;Editor.gptUrl="https://api.openai.com/v1/chat/completions";Editor.aiGlobals={gptApiKey:Editor.gptApiKey,geminiApiKey:Editor.geminiApiKey,claudeApiKey:Editor.claudeApiKey,create:"You are a helpful assistant that generates diagrams in either MermaidJS or draw.io XML format based on the given prompt. Begin with a concise checklist (3-7 bullets) of what you will do; keep items conceptual, not implementation-level. Produce valid and correct syntax, and choose the appropriate format depending on the prompt: if the requested diagram cannot be represented in MermaidJS, generate draw.io XML instead but do not use indentation and newlines. When asked to modify a diagram that is given in the conversation as draw.io XML, return the complete updated diagram as draw.io XML, not MermaidJS, and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. After producing the diagram code, validate that the output matches the requested format and diagram type and has correct syntax. Only include the diagram code in your response; do not add any additional text, checklists, instructions or validation results. If the prompt is a question or does not ask for a diagram, answer it as plain text without any diagram code instead.",
update:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. When asked to modify the diagram, return the complete updated diagram as draw.io XML without indentation and newlines - never as MermaidJS or any other format - and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. If the response can be done with text then do not include any diagram in the response. Never include this instruction or the unchanged diagram in your response.\n{data}",
assist:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."};Editor.aiConfigs={gpt:{apiKey:"gptApiKey",endpoint:Editor.gptUrl,requestHeaders:{Authorization:"Bearer {apiKey}"},request:{model:"{model}",messages:[{role:"system",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.choices[0].message.content"},gemini:{apiKey:"geminiApiKey",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",
requestHeaders:{"X-Goog-Api-Key":"{apiKey}"},request:{system_instruction:{parts:[{text:"{action}"}]},contents:[{parts:[{text:"{prompt}"}]}]},responsePath:"$.candidates[0].content.parts[0].text"},claude:{apiKey:"claudeApiKey",endpoint:"https://api.anthropic.com/v1/messages",requestHeaders:{"X-API-Key":"{apiKey}","Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},request:{max_tokens:8192,model:"{model}",system:"{action}",messages:[{role:"user",content:"{prompt}"}]},
responsePath:"$.content[0].text"}};Editor.aiModels=[{name:"Claude 4.8 Opus",model:"claude-opus-4-8",config:"claude"},{name:"Claude 4.6 Opus",model:"claude-opus-4-6",config:"claude"},{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.maxPublicPromptLength=1E4;if("ac.draw.io"==window.location.hostname||
"aj.draw.io"==window.location.hostname||/\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname)||/\.cdn\.prod\.atlassian-dev-us-gov-mod\.net$/.test(window.location.hostname))Editor.maxPublicPromptLength=window.DRAWIO_ATLASSIAN_PROMPT_LENGTH;Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.embedSvgFonts=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(k,u){return{name:u,
-dispName:k,type:"bool",defVal:!1,isVisible:function(H,P){return 1==H.vertices.length?(P=P.editorUi.editor.graph.model,H=P.getParent(H.vertices[0]),P.isEdge(H)||P.isVertex(H)):!1},getValue:function(H,P){return"inherit"==mxUtils.getValue(H.style,u)},valueChanged:function(H,P,T,W){P=W.editorUi.editor.graph;"1"==H?P.setCellStyles(u,"inherit",T.vertices):P.setCellStyles(u,null,T.vertices)}}};Editor.isPatternFillStyle=function(k){k=mxUtils.getValue(k,"fillStyle","auto");return"auto"!=k&&"solid"!=k};Editor.commonProperties=
+dispName:k,type:"bool",defVal:!1,isVisible:function(H,P){return 1==H.vertices.length?(P=P.editorUi.editor.graph.model,H=P.getParent(H.vertices[0]),P.isEdge(H)||P.isVertex(H)):!1},getValue:function(H,P){return"inherit"==mxUtils.getValue(H.style,u)},valueChanged:function(H,P,U,W){P=W.editorUi.editor.graph;"1"==H?P.setCellStyles(u,"inherit",U.vertices):P.setCellStyles(u,null,U.vertices)}}};Editor.isPatternFillStyle=function(k){k=mxUtils.getValue(k,"fillStyle","auto");return"auto"!=k&&"solid"!=k};Editor.commonProperties=
[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(k){k.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(k,u){return"1"==mxUtils.getValue(k.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(k,u){return"1"!=mxUtils.getValue(k.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(k,u){return"1"==mxUtils.getValue(k.style,"comic",
"0")||"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(k,u){return("1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(k.style))&&0<k.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(k,u){return("1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(k.style))&&
0<k.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(k,u){return("1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(k.style)&&"dots"!=mxUtils.getValue(k.style,"fillStyle","auto"))&&0<k.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(k,u){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",
@@ -3823,37 +3823,37 @@ mxUtils.getValue(k.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValu
Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",mxConstants.STYLE_FONTCOLOR),Editor.createInheritProperty("Inherit Fill Color",mxConstants.STYLE_FILLCOLOR),Editor.createInheritProperty("Inherit Stroke Color",mxConstants.STYLE_STROKECOLOR)].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart, the ELK shorthands\n## elkRadial, elkOrganic, elkStress, libavoid (orthogonal edge routing), parallels\n## (spread overlapping parallel edges), or a JSON string as used in Layout, Apply.\n## Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';
Editor.canvasSupported=!1;(function(){try{var k=document.createElement("canvas");Editor.canvasSupported=!(!k.getContext||!k.getContext("2d"))}catch(u){}})();Editor.useCanvasForExport=!1;(function(){try{var k=document.createElement("canvas"),u=new Image;u.onload=function(){try{k.getContext("2d").drawImage(u,0,0);var H=k.toDataURL("image/png");Editor.useCanvasForExport=null!=H&&6<H.length}catch(P){}};u.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(H){}})();
Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var k=document.createElement("canvas");k.width=k.height=1;var u=k.toDataURL("image/jpeg");Editor.jpgSupported=null!==u.match("image/jpeg");u=k.toDataURL("image/webp");Editor.webpSupported=null!==u.match("image/webp")}catch(H){}})();Editor.loadCompatibleCss=function(k){mxUtils.lightDarkColorSupported||mxUtils.get(k||"styles/grapheditor.css",mxUtils.bind(this,function(u){if(200<=u.getStatus()&&299>=u.getStatus()){var H=document.createElement("style");
-H.type="text/css";var P=H.appendChild,T=document,W=T.createTextNode;u=u.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(u=u.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(fa){}P.call(H,W.call(T,u));document.head.appendChild(H)}}))};Editor.replacePlaceholders=function(k,
-u){var H=[];if(null!=k&&null!=u){for(var P=RegExp("{([^{}\"'=;]+)}","g"),T,W=0;T=P.exec(k);){var fa=T[0];if(2<fa.length){var X=u(fa.substring(1,fa.length-1)),ea=fa;null!=X&&(ea=X);H.push(k.substring(W,T.index)+ea);W=T.index+fa.length}}H.push(k.substring(W))}return H.join("")};Editor.executeSimpleJsonPath=function(k,u){u=u.replace(/^\$\.?/,"").split(".");u=$jscomp.makeIterator(u);for(var H=u.next();!H.done;H=u.next()){var P=H.value;if(!k)return[];if(H=P.match(/([^\[]+)\[(\d+)\]/))if(P=H[1],H=parseInt(H[2]),
-k=k[P],Array.isArray(k)&&H<k.length)k=k[H];else return[];else k=k[P]}return void 0!==k?[k]:[]};Editor.createRoughCanvas=function(k){var u=rough.canvas({getContext:function(){return k}});u.draw=function(H){var P=H.sets||[];H=H.options||this.getDefaultOptions();for(var T=0;T<P.length;T++){var W=P[T];switch(W.type){case "path":null!=H.stroke&&this._drawToContext(k,W,H);break;case "fillPath":this._drawToContext(k,W,H);break;case "fillSketch":this.fillSketch(k,W,H)}}};u.fillSketch=function(H,P,T){var W=
-k.state.strokeColor,fa=k.state.strokeWidth,X=k.state.strokeAlpha,ea=k.state.dashed,oa=T.fillWeight;0>oa&&(oa=T.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(T.fill||"");k.setStrokeWidth(oa);k.setDashed(!1);oa=null!=H.root?H.root.lastChild:null;this._drawToContext(H,P,T);null!=H.root&&null!=H.root.lastChild&&H.root.lastChild!=oa&&"path"==H.root.lastChild.nodeName&&H.root.lastChild.setAttribute("data-rough-fill","1");k.setDashed(ea);k.setStrokeWidth(fa);k.setStrokeColor(W);k.setStrokeAlpha(X)};
-u._drawToContext=function(H,P,T){H.begin();for(var W=0;W<P.ops.length;W++){var fa=P.ops[W],X=fa.data;switch(fa.op){case "move":H.moveTo(X[0],X[1]);break;case "bcurveTo":H.curveTo(X[0],X[1],X[2],X[3],X[4],X[5]);break;case "lineTo":H.lineTo(X[0],X[1])}}H.end();"fillPath"===P.type&&T.filled?H.fill():H.stroke()};return u};(function(){function k(W,fa,X){this.canvas=W;this.rc=fa;this.shape=X;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=
+H.type="text/css";var P=H.appendChild,U=document,W=U.createTextNode;u=u.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(u=u.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(fa){}P.call(H,W.call(U,u));document.head.appendChild(H)}}))};Editor.replacePlaceholders=function(k,
+u){var H=[];if(null!=k&&null!=u){for(var P=RegExp("{([^{}\"'=;]+)}","g"),U,W=0;U=P.exec(k);){var fa=U[0];if(2<fa.length){var X=u(fa.substring(1,fa.length-1)),ea=fa;null!=X&&(ea=X);H.push(k.substring(W,U.index)+ea);W=U.index+fa.length}}H.push(k.substring(W))}return H.join("")};Editor.executeSimpleJsonPath=function(k,u){u=u.replace(/^\$\.?/,"").split(".");u=$jscomp.makeIterator(u);for(var H=u.next();!H.done;H=u.next()){var P=H.value;if(!k)return[];if(H=P.match(/([^\[]+)\[(\d+)\]/))if(P=H[1],H=parseInt(H[2]),
+k=k[P],Array.isArray(k)&&H<k.length)k=k[H];else return[];else k=k[P]}return void 0!==k?[k]:[]};Editor.createRoughCanvas=function(k){var u=rough.canvas({getContext:function(){return k}});u.draw=function(H){var P=H.sets||[];H=H.options||this.getDefaultOptions();for(var U=0;U<P.length;U++){var W=P[U];switch(W.type){case "path":null!=H.stroke&&this._drawToContext(k,W,H);break;case "fillPath":this._drawToContext(k,W,H);break;case "fillSketch":this.fillSketch(k,W,H)}}};u.fillSketch=function(H,P,U){var W=
+k.state.strokeColor,fa=k.state.strokeWidth,X=k.state.strokeAlpha,ea=k.state.dashed,oa=U.fillWeight;0>oa&&(oa=U.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(U.fill||"");k.setStrokeWidth(oa);k.setDashed(!1);oa=null!=H.root?H.root.lastChild:null;this._drawToContext(H,P,U);null!=H.root&&null!=H.root.lastChild&&H.root.lastChild!=oa&&"path"==H.root.lastChild.nodeName&&H.root.lastChild.setAttribute("data-rough-fill","1");k.setDashed(ea);k.setStrokeWidth(fa);k.setStrokeColor(W);k.setStrokeAlpha(X)};
+u._drawToContext=function(H,P,U){H.begin();for(var W=0;W<P.ops.length;W++){var fa=P.ops[W],X=fa.data;switch(fa.op){case "move":H.moveTo(X[0],X[1]);break;case "bcurveTo":H.curveTo(X[0],X[1],X[2],X[3],X[4],X[5]);break;case "lineTo":H.lineTo(X[0],X[1])}}H.end();"fillPath"===P.type&&U.filled?H.fill():H.stroke()};return u};(function(){function k(W,fa,X){this.canvas=W;this.rc=fa;this.shape=X;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=
mxUtils.bind(this,k.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,k.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,k.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,k.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,k.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,k.prototype.lineTo);
this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,k.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,k.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,k.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,k.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,k.prototype.close);this.originalFill=this.canvas.fill;
this.canvas.fill=mxUtils.bind(this,k.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,k.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,k.prototype.fillAndStroke);this.path=[];this.passThrough=!1}k.prototype.moveOp="M";k.prototype.lineOp="L";k.prototype.quadOp="Q";k.prototype.curveOp="C";k.prototype.closeOp="Z";k.prototype.getStyle=function(W,fa){var X=1;if(null!=this.shape.state){var ea=
this.shape.state.cell.id;if(null!=ea)for(var oa=0;oa<ea.length;oa++)X=(X<<5)-X+ea.charCodeAt(oa)<<0}X={strokeWidth:this.canvas.state.strokeWidth,seed:X,preserveVertices:!0};ea=this.rc.getDefaultOptions();X.stroke=W?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;W=null;(X.filled=fa)?(X.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,W=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):
X.fill="";X.bowing=mxUtils.getValue(this.shape.style,"bowing",ea.bowing);X.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ea.hachureAngle);X.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ea.curveFitting);X.roughness=mxUtils.getValue(this.shape.style,"jiggle",ea.roughness);X.simplification=mxUtils.getValue(this.shape.style,"simplification",ea.simplification);X.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ea.disableMultiStroke);X.disableMultiStrokeFill=
mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ea.disableMultiStrokeFill);fa=mxUtils.getValue(this.shape.style,"hachureGap",-1);X.hachureGap="auto"==fa?-1:fa;X.dashGap=mxUtils.getValue(this.shape.style,"dashGap",fa);X.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",fa);X.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",fa);fa=mxUtils.getValue(this.shape.style,"fillWeight",-1);X.fillWeight="auto"==fa?-1:fa;fa=mxUtils.getValue(this.shape.style,"fillStyle","auto");
-"dots"==fa&&(fa="auto");if("auto"==fa){var la=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;fa=function(ca){mxUtils.isLightDarkColor(ca)&&(ca=mxUtils.parseLightDarkColor(ca),ca=la?ca.dark:ca.light);return mxUtils.hex2rgb(ca)};oa=[fa("#ffffff")];null!=this.shape.state&&oa.push(fa(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&oa.push(fa(Editor.darkColor));fa=null!=X.fill&&(null!=W||0<=mxUtils.indexOf(oa,fa(X.fill)))?"solid":ea.fillStyle}X.fillStyle=
+"dots"==fa&&(fa="auto");if("auto"==fa){var ka=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;fa=function(ba){mxUtils.isLightDarkColor(ba)&&(ba=mxUtils.parseLightDarkColor(ba),ba=ka?ba.dark:ba.light);return mxUtils.hex2rgb(ba)};oa=[fa("#ffffff")];null!=this.shape.state&&oa.push(fa(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&oa.push(fa(Editor.darkColor));fa=null!=X.fill&&(null!=W||0<=mxUtils.indexOf(oa,fa(X.fill)))?"solid":ea.fillStyle}X.fillStyle=
fa;return X};k.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};k.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};k.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var W=2;W<arguments.length;W+=2)this.lastX=arguments[W-1],this.lastY=arguments[W],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};k.prototype.lineTo=
function(W,fa){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,W,fa),this.lastX=W,this.lastY=fa)};k.prototype.moveTo=function(W,fa){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,W,fa),this.lastX=W,this.lastY=fa,this.firstX=W,this.firstY=fa)};k.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};k.prototype.quadTo=function(W,fa,X,ea){this.passThrough?
-this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,W,fa,X,ea),this.lastX=X,this.lastY=ea)};k.prototype.curveTo=function(W,fa,X,ea,oa,la){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,W,fa,X,ea,oa,la),this.lastX=oa,this.lastY=la)};k.prototype.arcTo=function(W,fa,X,ea,oa,la,ca){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var sa=mxUtils.arcToCurves(this.lastX,this.lastY,W,fa,X,ea,oa,la,ca);if(null!=sa)for(var xa=
-0;xa<sa.length;xa+=6)this.curveTo(sa[xa],sa[xa+1],sa[xa+2],sa[xa+3],sa[xa+4],sa[xa+5]);this.lastX=la;this.lastY=ca}};k.prototype.rect=function(W,fa,X,ea){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(W,fa,X,ea,this.getStyle(!0,!0)))};k.prototype.ellipse=function(W,fa,X,ea){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(W+X/2,fa+ea/2,X,ea,this.getStyle(!0,
-!0)))};k.prototype.roundrect=function(W,fa,X,ea,oa,la){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(W+oa,fa),this.lineTo(W+X-oa,fa),this.quadTo(W+X,fa,W+X,fa+la),this.lineTo(W+X,fa+ea-la),this.quadTo(W+X,fa+ea,W+X-oa,fa+ea),this.lineTo(W+oa,fa+ea),this.quadTo(W,fa+ea,W,fa+ea-la),this.lineTo(W,fa+la),this.quadTo(W,fa,W+oa,fa))};k.prototype.drawPath=function(W){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),W)}catch(X){}this.passThrough=
+this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,W,fa,X,ea),this.lastX=X,this.lastY=ea)};k.prototype.curveTo=function(W,fa,X,ea,oa,ka){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,W,fa,X,ea,oa,ka),this.lastX=oa,this.lastY=ka)};k.prototype.arcTo=function(W,fa,X,ea,oa,ka,ba){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var sa=mxUtils.arcToCurves(this.lastX,this.lastY,W,fa,X,ea,oa,ka,ba);if(null!=sa)for(var xa=
+0;xa<sa.length;xa+=6)this.curveTo(sa[xa],sa[xa+1],sa[xa+2],sa[xa+3],sa[xa+4],sa[xa+5]);this.lastX=ka;this.lastY=ba}};k.prototype.rect=function(W,fa,X,ea){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(W,fa,X,ea,this.getStyle(!0,!0)))};k.prototype.ellipse=function(W,fa,X,ea){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(W+X/2,fa+ea/2,X,ea,this.getStyle(!0,
+!0)))};k.prototype.roundrect=function(W,fa,X,ea,oa,ka){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(W+oa,fa),this.lineTo(W+X-oa,fa),this.quadTo(W+X,fa,W+X,fa+ka),this.lineTo(W+X,fa+ea-ka),this.quadTo(W+X,fa+ea,W+X-oa,fa+ea),this.lineTo(W+oa,fa+ea),this.quadTo(W,fa+ea,W,fa+ea-ka),this.lineTo(W,fa+ka),this.quadTo(W,fa,W+oa,fa))};k.prototype.drawPath=function(W){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),W)}catch(X){}this.passThrough=
!1}else if(null!=this.nextShape){for(var fa in W)this.nextShape.options[fa]=W[fa];W.stroke!=mxConstants.NONE&&null!=W.stroke||delete this.nextShape.options.stroke;W.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};k.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};k.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):
this.drawPath(this.getStyle(!1,!0))};k.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};k.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=
this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(W){return new k(W,Editor.createRoughCanvas(W),this)};var u=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(W){return this.outline||
null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?u.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(W):this.createRoughCanvas(W)};var H=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(W,fa,X,ea,oa){null!=W.handJiggle&&W.handJiggle.passThrough||H.apply(this,arguments)};var P=mxShape.prototype.paint;mxShape.prototype.paint=function(W){var fa=W.addTolerance,X=!0;null!=this.style&&(X="1"==
-mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=W.handJiggle&&W.handJiggle.constructor==k&&!this.outline){W.save();var ea=this.fill,oa=this.stroke;this.stroke=this.fill=null;var la=this.configurePointerEvents,ca=W.setStrokeColor;W.setStrokeColor=function(){};var sa=W.setFillColor;W.setFillColor=function(){};X||null==ea||(this.configurePointerEvents=function(){});W.handJiggle.passThrough=!0;P.apply(this,arguments);W.handJiggle.passThrough=!1;W.setFillColor=sa;W.setStrokeColor=
-ca;this.configurePointerEvents=la;this.stroke=oa;this.fill=ea;W.restore();X&&null!=ea&&(W.addTolerance=function(){})}P.apply(this,arguments);W.addTolerance=fa};var T=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(W,fa,X,ea,oa,la){null!=W.handJiggle&&W.handJiggle.constructor==k?(W.handJiggle.passThrough=!0,T.apply(this,arguments),W.handJiggle.passThrough=!1):T.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?
-k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),{to:"string"})};Editor.extractGraphModel=function(k,u,H){if(null!=k&&"undefined"!==typeof pako){var P=k.ownerDocument.getElementsByTagName("div"),T=[];if(null!=P&&0<P.length)for(var W=0;W<P.length;W++)if("mxgraph"==P[W].getAttribute("class")){T.push(P[W]);break}0<T.length&&(P=T[0].getAttribute("data-mxgraph"),
-null!=P?(T=JSON.parse(P),null!=T&&null!=T.xml&&(k=mxUtils.parseXml(T.xml),k=k.documentElement)):(T=T[0].getElementsByTagName("div"),0<T.length&&(P=mxUtils.getTextContent(T[0]),P=Graph.decompress(P,null,H),0<P.length&&(k=mxUtils.parseXml(P),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(P=k.getAttribute("content"),null!=P&&"<"!=P.charAt(0)&&"%"!=P.charAt(0)&&(P=unescape(window.atob?atob(P):Base64.decode(cont,P))),null!=P&&"%"==P.charAt(0)&&(P=decodeURIComponent(P)),null!=P&&0<P.length)k=
-mxUtils.parseXml(P).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||u||(T=null,"diagram"==k.nodeName?T=k:"mxfile"==k.nodeName&&(P=k.getElementsByTagName("diagram"),0<P.length&&(T=P[Math.max(0,Math.min(P.length-1,urlParams.page||0))])),null!=T&&(k=Editor.parseDiagramNode(T,H)));null==k||"mxGraphModel"==k.nodeName||u&&"mxfile"==k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,u,H){Editor.validateDiagramNode(k);var P=mxUtils.trim(mxUtils.getTextContent(k)),
-T=null;0<P.length?(u=Graph.decompress(P,null,u),null!=u&&0<u.length&&(T=mxUtils.parseXml(u).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(T=k[0],H&&(T=Editor.parseDiagramNode(T,u,!1)),u=mxUtils.createXmlDocument(),u.appendChild(u.importNode(T,!0)),T=u.documentElement));return T};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);var u=mxUtils.getNodeValue(k),H=null;0<u.length?H=Graph.decompress(u):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(H=mxUtils.getXml(k[0])));
-return H};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var u=new mxCodec,H=new mxGraphModel;k.appendChild(u.encode(H))}return k};Editor.extractGraphModelFromPdf=function(k){var u=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0);if("%PDF-1.7"==k.substring(0,8)){for(var H=k.indexOf("EmbeddedFile");-1<H;){var P=k.indexOf("stream",H)+9;if(0<k.substring(H,P).indexOf("application#2Fvnd.jgraph.mxfile")){var T=
-k.indexOf("endstream",P-1);try{return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(P,T)),{to:"string"})}catch(ca){}}H=k.indexOf("EmbeddedFile",H+1)}for(H=k.indexOf("/ObjStm");0<H;){P=k.indexOf("stream",H)+9;T=k.indexOf("endstream",P-1);try{var W=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(P,T)),{to:"string"}),fa=W.indexOf("/Subject <");if(0<fa){var X=W.substring(fa+14,W.indexOf(">",fa));if(null!=X){P=X;T=[];for(var ea=0;ea<P.length;ea+=2){var oa=P.substr(ea,2);"00"!=oa&&T.push(String.fromCharCode(parseInt(oa,
-16)))}u=T.join("")}break}}catch(ca){}H=k.indexOf("/ObjStm",H+1)}}if(null==u&&"%PDF-"==k.substring(0,5)){W="";X=fa=0;var la=[];for(oa=null;X<k.length;){H=k.charCodeAt(X);X+=1;10!=H&&(W+=String.fromCharCode(H));H=="/Subject (%3Cmxfile".charCodeAt(fa)?fa++:fa=0;if(19==fa&&(P=k.indexOf("%3C%2Fmxfile%3E",X)+15,X-=9,P>X)){u=k.substring(X,P);break}10==H&&("endobj"==W?oa=null:"obj"==W.substring(W.length-3,W.length)||"xref"==W||"trailer"==W?(oa=[],la[W.split(" ")[0]]=oa):null!=oa&&oa.push(W),W="")}}null==
-u&&null!=la&&(u=Editor.extractGraphModelFromXref(la));null!=u&&(u=decodeURIComponent(u.replace(/\\([\\()])/g,"$1").replace(/\\\(/g,"(").replace(/\\\)/g,")")));return u};Editor.extractGraphModelFromXref=function(k){var u=k.trailer,H=null;null!=u&&(u=/.* \/Info (\d+) (\d+) R/g.exec(u.join("\n")),null!=u&&0<u.length&&(u=k[u[1]],null!=u&&(u=/.* \/Subject (\d+) (\d+) R/g.exec(u.join("\n")),null!=u&&0<u.length&&(k=k[u[1]],null!=k&&(k=k.join("\n"),H=k.substring(1,k.length-1))))));return H};Editor.extractParserError=
+mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=W.handJiggle&&W.handJiggle.constructor==k&&!this.outline){W.save();var ea=this.fill,oa=this.stroke;this.stroke=this.fill=null;var ka=this.configurePointerEvents,ba=W.setStrokeColor;W.setStrokeColor=function(){};var sa=W.setFillColor;W.setFillColor=function(){};X||null==ea||(this.configurePointerEvents=function(){});W.handJiggle.passThrough=!0;P.apply(this,arguments);W.handJiggle.passThrough=!1;W.setFillColor=sa;W.setStrokeColor=
+ba;this.configurePointerEvents=ka;this.stroke=oa;this.fill=ea;W.restore();X&&null!=ea&&(W.addTolerance=function(){})}P.apply(this,arguments);W.addTolerance=fa};var U=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(W,fa,X,ea,oa,ka){null!=W.handJiggle&&W.handJiggle.constructor==k?(W.handJiggle.passThrough=!0,U.apply(this,arguments),W.handJiggle.passThrough=!1):U.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?
+k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),{to:"string"})};Editor.extractGraphModel=function(k,u,H){if(null!=k&&"undefined"!==typeof pako){var P=k.ownerDocument.getElementsByTagName("div"),U=[];if(null!=P&&0<P.length)for(var W=0;W<P.length;W++)if("mxgraph"==P[W].getAttribute("class")){U.push(P[W]);break}0<U.length&&(P=U[0].getAttribute("data-mxgraph"),
+null!=P?(U=JSON.parse(P),null!=U&&null!=U.xml&&(k=mxUtils.parseXml(U.xml),k=k.documentElement)):(U=U[0].getElementsByTagName("div"),0<U.length&&(P=mxUtils.getTextContent(U[0]),P=Graph.decompress(P,null,H),0<P.length&&(k=mxUtils.parseXml(P),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(P=k.getAttribute("content"),null!=P&&"<"!=P.charAt(0)&&"%"!=P.charAt(0)&&(P=unescape(window.atob?atob(P):Base64.decode(cont,P))),null!=P&&"%"==P.charAt(0)&&(P=decodeURIComponent(P)),null!=P&&0<P.length)k=
+mxUtils.parseXml(P).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||u||(U=null,"diagram"==k.nodeName?U=k:"mxfile"==k.nodeName&&(P=k.getElementsByTagName("diagram"),0<P.length&&(U=P[Math.max(0,Math.min(P.length-1,urlParams.page||0))])),null!=U&&(k=Editor.parseDiagramNode(U,H)));null==k||"mxGraphModel"==k.nodeName||u&&"mxfile"==k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,u,H){Editor.validateDiagramNode(k);var P=mxUtils.trim(mxUtils.getTextContent(k)),
+U=null;0<P.length?(u=Graph.decompress(P,null,u),null!=u&&0<u.length&&(U=mxUtils.parseXml(u).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(U=k[0],H&&(U=Editor.parseDiagramNode(U,u,!1)),u=mxUtils.createXmlDocument(),u.appendChild(u.importNode(U,!0)),U=u.documentElement));return U};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);var u=mxUtils.getNodeValue(k),H=null;0<u.length?H=Graph.decompress(u):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(H=mxUtils.getXml(k[0])));
+return H};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var u=new mxCodec,H=new mxGraphModel;k.appendChild(u.encode(H))}return k};Editor.extractGraphModelFromPdf=function(k){var u=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0);if("%PDF-1.7"==k.substring(0,8)){for(var H=k.indexOf("EmbeddedFile");-1<H;){var P=k.indexOf("stream",H)+9;if(0<k.substring(H,P).indexOf("application#2Fvnd.jgraph.mxfile")){var U=
+k.indexOf("endstream",P-1);try{return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(P,U)),{to:"string"})}catch(ba){}}H=k.indexOf("EmbeddedFile",H+1)}for(H=k.indexOf("/ObjStm");0<H;){P=k.indexOf("stream",H)+9;U=k.indexOf("endstream",P-1);try{var W=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(P,U)),{to:"string"}),fa=W.indexOf("/Subject <");if(0<fa){var X=W.substring(fa+14,W.indexOf(">",fa));if(null!=X){P=X;U=[];for(var ea=0;ea<P.length;ea+=2){var oa=P.substr(ea,2);"00"!=oa&&U.push(String.fromCharCode(parseInt(oa,
+16)))}u=U.join("")}break}}catch(ba){}H=k.indexOf("/ObjStm",H+1)}}if(null==u&&"%PDF-"==k.substring(0,5)){W="";X=fa=0;var ka=[];for(oa=null;X<k.length;){H=k.charCodeAt(X);X+=1;10!=H&&(W+=String.fromCharCode(H));H=="/Subject (%3Cmxfile".charCodeAt(fa)?fa++:fa=0;if(19==fa&&(P=k.indexOf("%3C%2Fmxfile%3E",X)+15,X-=9,P>X)){u=k.substring(X,P);break}10==H&&("endobj"==W?oa=null:"obj"==W.substring(W.length-3,W.length)||"xref"==W||"trailer"==W?(oa=[],ka[W.split(" ")[0]]=oa):null!=oa&&oa.push(W),W="")}}null==
+u&&null!=ka&&(u=Editor.extractGraphModelFromXref(ka));null!=u&&(u=decodeURIComponent(u.replace(/\\([\\()])/g,"$1").replace(/\\\(/g,"(").replace(/\\\)/g,")")));return u};Editor.extractGraphModelFromXref=function(k){var u=k.trailer,H=null;null!=u&&(u=/.* \/Info (\d+) (\d+) R/g.exec(u.join("\n")),null!=u&&0<u.length&&(u=k[u[1]],null!=u&&(u=/.* \/Subject (\d+) (\d+) R/g.exec(u.join("\n")),null!=u&&0<u.length&&(k=k[u[1]],null!=k&&(k=k.join("\n"),H=k.substring(1,k.length-1))))));return H};Editor.extractParserError=
function(k,u){var H=null;k=null!=k?k.getElementsByTagName("parsererror"):null;null!=k&&0<k.length&&(H=u||mxResources.get("invalidChars"),u=k[0].getElementsByTagName("div"),0<u.length&&(H=mxUtils.getTextContent(u[0])));return null!=H?mxUtils.trim(H):H};Editor.addRetryToError=function(k,u){null!=k&&(k=null!=k.error?k.error:k,null==k.retry&&(k.retry=u))};Editor.mermaidToDrawio=function(k,u,H){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(k,u,H)};Editor.configure=function(k){if(null!=
k){Editor.config=k;Editor.configVersion=k.version;k.debug&&(urlParams.test="1");k.passiveScroll&&(Editor.passiveScroll=!0);k.noResizers&&(Editor.noResizers=!0);k.preserveViewState&&(Editor.preserveViewState=!0);null!=k.passThroughKeys&&(Editor.passThroughKeys=k.passThroughKeys);null!=k.keyboardShortcuts&&(Array.isArray(k.keyboardShortcuts)?Editor.keyboardShortcuts=k.keyboardShortcuts:EditorUi.debug("Configuration Error: Array expected for keyboardShortcuts"));k.suppressNewWindows&&(Editor.suppressNewWindows=
!0,Editor.popupsAllowed=!1);k.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=k.useInternalClipboard);if(null!=k.customCss){var u=document.createElement("style");u.type="text/css";u.appendChild(document.createTextNode(k.customCss));document.head.appendChild(u)}null!=k.resources&&("object"!==typeof k.resources||Array.isArray(k.resources)?EditorUi.debug("Configuration Error: Object expected for resources"):(Editor.customResources=k.resources,Editor.applyCustomResources()));null!=k.enableLocalFonts&&
@@ -3879,81 +3879,81 @@ k.sidebarTitles);null!=k.sidebarTitleSize&&(u=parseInt(k.sidebarTitleSize),!isNa
null!=k.maxImageBytes&&(EditorUi.prototype.maxImageBytes=k.maxImageBytes);null!=k.maxImageSize&&(EditorUi.prototype.maxImageSize=k.maxImageSize);null!=k.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=k.shareCursorPosition);null!=k.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=k.showRemoteCursors);null!=k.restrictExport&&(DrawioFile.RESTRICT_EXPORT=k.restrictExport);null!=k.removeImageMetadata&&(Editor.removeImageMetadata=k.removeImageMetadata);null!=k.defaultTextStyle&&(Editor.defaultTextStyle=
k.defaultTextStyle);null!=k.replaceSvgDataUris&&(Editor.replaceSvgDataUris=k.replaceSvgDataUris);null!=k.foreignObjectImages&&(Editor.foreignObjectImages=k.foreignObjectImages);null!=k.embedSvgFonts&&(Editor.embedSvgFonts=k.embedSvgFonts);null!=k.shadowColor&&(mxConstants.SHADOW_COLOR=k.shadowColor);null!=k.shadowOpacity&&(mxConstants.SHADOW_OPACITY=k.shadowOpacity);null!=k.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=k.shadowOffsetX);null!=k.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=k.shadowOffsetY);
null!=k.shadowBlur&&(mxConstants.SHADOW_BLUR=k.shadowBlur);null!=k.enableAnimations&&(Editor.enableAnimations=k.enableAnimations);null!=k.insertAnimations&&(Editor.insertAnimations=k.insertAnimations);null!=k.enableWindowDocking&&(Editor.enableWindowDocking=k.enableWindowDocking);null!=k.compact&&(EditorUi.prototype.defaultCompact=k.compact);null!=k.noAutoFocus&&(EditorUi.prototype.noAutoFocus=k.noAutoFocus);if(null!=k.hideMenuItems)if(Array.isArray(k.hideMenuItems))for(Menus.prototype.hiddenMenuItems=
-{},u=0;u<k.hideMenuItems.length;u++)Menus.prototype.hiddenMenuItems[k.hideMenuItems[u]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=k.hideMenus)if(Array.isArray(k.hideMenus)){var P={};for(u=0;u<k.hideMenus.length;u++)P[k.hideMenus[u]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(T){return!P[T]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=k.enableAi&&(Editor.enableAi=k.enableAi);
+{},u=0;u<k.hideMenuItems.length;u++)Menus.prototype.hiddenMenuItems[k.hideMenuItems[u]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=k.hideMenus)if(Array.isArray(k.hideMenus)){var P={};for(u=0;u<k.hideMenus.length;u++)P[k.hideMenus[u]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(U){return!P[U]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=k.enableAi&&(Editor.enableAi=k.enableAi);
null!=k.enableChatGpt&&(Editor.enableAi=k.enableChatGpt);null!=k.gptApiKey&&(Editor.aiGlobals.gptApiKey=k.gptApiKey);null!=k.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=k.geminiApiKey);null!=k.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=k.claudeApiKey);null!=k.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=k.gptUrl);null!=k.aiActions&&(Editor.aiActions=k.aiActions);null!=k.aiGlobals&&(Editor.aiGlobals=k.aiGlobals);null!=k.aiConfigs&&(Editor.aiConfigs=k.aiConfigs);null!=k.aiModels&&
(Editor.aiModels=k.aiModels)}};Editor.applyCustomResources=function(){if(null!=Editor.customResources){var k=null!=mxClient.language?mxClient.language.toLowerCase():null,u=null!=k?k.indexOf("-"):-1,H;for(H in Editor.customResources){var P=Editor.customResources[H];null!=P&&"object"===typeof P&&(P=(null!=k?P[k]:null)||(0<u?P[k.substring(0,u)]:null)||P.main);"string"===typeof P&&(mxResources.resources[H]=P)}}};var b=mxResources.parse;mxResources.parse=function(k){b.apply(this,arguments);Editor.applyCustomResources()};
-Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=function(k){function u(ea,oa){ea=ea.getAttribute("fill");if(null==ea||0!==ea.indexOf("url("))return null;ea=ea.match(/url\([^#]*#([^)"]+)\)?/);if(null==ea)return null;ea=ea[1];try{var la=oa.querySelector("#"+CSS.escape(ea));return null!=la&&"pattern"===la.nodeName?la:null}catch(ca){return null}}function H(ea,oa,la){var ca,sa,xa;try{var qa=ea.getBBox()}catch(Ja){return}if(0!==
-qa.width&&0!==qa.height){var Ba=parseFloat(oa.getAttribute("width")),ma=parseFloat(oa.getAttribute("height"));if(!(isNaN(Ba)||isNaN(ma)||0>=Ba||0>=ma)){var ta=oa.getAttribute("patternTransform");var va=sa=ca=0;var Ha=xa=1;if(null!=ta){var La=ta.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=La&&(ca=parseFloat(La[1]),sa=parseFloat(La[2]));La=ta.match(/rotate\(\s*([^)]+)\)/);null!=La&&(va=parseFloat(La[1])*Math.PI/180);ta=ta.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=ta&&(xa=parseFloat(ta[1]),
-Ha=null!=ta[2]?parseFloat(ta[2]):xa)}var Ia=[{x:qa.x,y:qa.y},{x:qa.x+qa.width,y:qa.y},{x:qa.x+qa.width,y:qa.y+qa.height},{x:qa.x,y:qa.y+qa.height}],Ca=Infinity;qa=Infinity;La=ta=-Infinity;for(var Pa=0;Pa<Ia.length;Pa++){var Ka=Ia[Pa].x-ca;var Na=Ia[Pa].y-sa,Oa=Math.cos(-va),Ea=Math.sin(-va);var Aa=(Ka*Oa-Na*Ea)/xa;Ka=(Ka*Ea+Na*Oa)/Ha;Ca=Math.min(Ca,Aa);qa=Math.min(qa,Ka);ta=Math.max(ta,Aa);La=Math.max(La,Ka)}Ca=Math.floor(Ca/Ba)-1;qa=Math.floor(qa/ma)-1;ta=Math.ceil(ta/Ba)+1;Aa=Math.ceil(La/ma)+1;
-if(!(1E4<(ta-Ca)*(Aa-qa))){Pa=T+ ++P;La=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");La.setAttribute("id",Pa);Ia=ea.cloneNode(!0);Ia.removeAttribute("fill");Ia.removeAttribute("fill-opacity");Ia.removeAttribute("stroke");Ia.removeAttribute("stroke-width");Ia.removeAttribute("stroke-opacity");Ia.removeAttribute("style");Ia.removeAttribute("pointer-events");Ia.setAttribute("fill","black");La.appendChild(Ia);Ia=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
-"g");Ia.setAttribute("clip-path","url(#"+Pa+")");Pa=ea.getAttribute("fill-opacity");null!=Pa&&Ia.setAttribute("opacity",Pa);Pa=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Pa.setAttribute("transform","translate("+ca+","+sa+")"+(0!==va?" rotate("+180*va/Math.PI+")":"")+" scale("+xa+(Ha!==xa?","+Ha:"")+")");sa=T+ ++P;ca=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");ca.setAttribute("id",sa);va=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
-"rect");va.setAttribute("x","0");va.setAttribute("y","0");va.setAttribute("width",Ba);va.setAttribute("height",ma);ca.appendChild(va);oa=oa.childNodes;for(va=Ca;va<ta;va++)for(xa=qa;xa<Aa;xa++){Ha=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ha.setAttribute("transform","translate("+va*Ba+","+xa*ma+")");Ha.setAttribute("clip-path","url(#"+sa+")");for(Ca=0;Ca<oa.length;Ca++)1===oa[Ca].nodeType&&Ha.appendChild(oa[Ca].cloneNode(!0));Pa.appendChild(Ha)}Ia.appendChild(Pa);Ba=la.querySelector("defs");
-null==Ba&&(Ba=la.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),la.insertBefore(Ba,la.firstChild));Ba.appendChild(La);Ba.appendChild(ca);ea.parentNode.insertBefore(Ia,ea.nextSibling);ea.setAttribute("fill","none");ea.style.fill=""}}}}for(var P=0,T="expand-pattern-clip-"+Editor.guid(8)+"-",W=k.querySelectorAll('[fill^="url("]'),fa=0;fa<W.length;fa++){var X=u(W[fa],k);null!=X&&H(W[fa],X,k)}W=k.querySelectorAll("[style]");for(fa=0;fa<W.length;fa++)X=W[fa].getAttribute("style"),null!=
+Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=function(k){function u(ea,oa){ea=ea.getAttribute("fill");if(null==ea||0!==ea.indexOf("url("))return null;ea=ea.match(/url\([^#]*#([^)"]+)\)?/);if(null==ea)return null;ea=ea[1];try{var ka=oa.querySelector("#"+CSS.escape(ea));return null!=ka&&"pattern"===ka.nodeName?ka:null}catch(ba){return null}}function H(ea,oa,ka){var ba,sa,xa;try{var qa=ea.getBBox()}catch(Ja){return}if(0!==
+qa.width&&0!==qa.height){var Ba=parseFloat(oa.getAttribute("width")),ma=parseFloat(oa.getAttribute("height"));if(!(isNaN(Ba)||isNaN(ma)||0>=Ba||0>=ma)){var ta=oa.getAttribute("patternTransform");var va=sa=ba=0;var Ga=xa=1;if(null!=ta){var La=ta.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=La&&(ba=parseFloat(La[1]),sa=parseFloat(La[2]));La=ta.match(/rotate\(\s*([^)]+)\)/);null!=La&&(va=parseFloat(La[1])*Math.PI/180);ta=ta.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=ta&&(xa=parseFloat(ta[1]),
+Ga=null!=ta[2]?parseFloat(ta[2]):xa)}var Ia=[{x:qa.x,y:qa.y},{x:qa.x+qa.width,y:qa.y},{x:qa.x+qa.width,y:qa.y+qa.height},{x:qa.x,y:qa.y+qa.height}],Ca=Infinity;qa=Infinity;La=ta=-Infinity;for(var Pa=0;Pa<Ia.length;Pa++){var Ka=Ia[Pa].x-ba;var Na=Ia[Pa].y-sa,Oa=Math.cos(-va),Ea=Math.sin(-va);var Aa=(Ka*Oa-Na*Ea)/xa;Ka=(Ka*Ea+Na*Oa)/Ga;Ca=Math.min(Ca,Aa);qa=Math.min(qa,Ka);ta=Math.max(ta,Aa);La=Math.max(La,Ka)}Ca=Math.floor(Ca/Ba)-1;qa=Math.floor(qa/ma)-1;ta=Math.ceil(ta/Ba)+1;Aa=Math.ceil(La/ma)+1;
+if(!(1E4<(ta-Ca)*(Aa-qa))){Pa=U+ ++P;La=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");La.setAttribute("id",Pa);Ia=ea.cloneNode(!0);Ia.removeAttribute("fill");Ia.removeAttribute("fill-opacity");Ia.removeAttribute("stroke");Ia.removeAttribute("stroke-width");Ia.removeAttribute("stroke-opacity");Ia.removeAttribute("style");Ia.removeAttribute("pointer-events");Ia.setAttribute("fill","black");La.appendChild(Ia);Ia=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
+"g");Ia.setAttribute("clip-path","url(#"+Pa+")");Pa=ea.getAttribute("fill-opacity");null!=Pa&&Ia.setAttribute("opacity",Pa);Pa=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Pa.setAttribute("transform","translate("+ba+","+sa+")"+(0!==va?" rotate("+180*va/Math.PI+")":"")+" scale("+xa+(Ga!==xa?","+Ga:"")+")");sa=U+ ++P;ba=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");ba.setAttribute("id",sa);va=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg",
+"rect");va.setAttribute("x","0");va.setAttribute("y","0");va.setAttribute("width",Ba);va.setAttribute("height",ma);ba.appendChild(va);oa=oa.childNodes;for(va=Ca;va<ta;va++)for(xa=qa;xa<Aa;xa++){Ga=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ga.setAttribute("transform","translate("+va*Ba+","+xa*ma+")");Ga.setAttribute("clip-path","url(#"+sa+")");for(Ca=0;Ca<oa.length;Ca++)1===oa[Ca].nodeType&&Ga.appendChild(oa[Ca].cloneNode(!0));Pa.appendChild(Ga)}Ia.appendChild(Pa);Ba=ka.querySelector("defs");
+null==Ba&&(Ba=ka.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),ka.insertBefore(Ba,ka.firstChild));Ba.appendChild(La);Ba.appendChild(ba);ea.parentNode.insertBefore(Ia,ea.nextSibling);ea.setAttribute("fill","none");ea.style.fill=""}}}}for(var P=0,U="expand-pattern-clip-"+Editor.guid(8)+"-",W=k.querySelectorAll('[fill^="url("]'),fa=0;fa<W.length;fa++){var X=u(W[fa],k);null!=X&&H(W[fa],X,k)}W=k.querySelectorAll("[style]");for(fa=0;fa<W.length;fa++)X=W[fa].getAttribute("style"),null!=
X&&-1!==X.indexOf("url(")&&(X=u(W[fa],k),null!=X&&H(W[fa],X,k))};Editor.addAllowedFontUrl=function(k){"string"===typeof k&&0<k.length&&(Graph.allowedFontUrls[k]=!0)};Editor.addAllowedFontUrls=function(k){if(Array.isArray(k))for(var u=0;u<k.length;u++)null!=k[u]&&"object"===typeof k[u]&&Editor.addAllowedFontUrl(k[u].fontUrl)};Editor.configureFontCss=function(k){if(null!=k){Editor.prototype.fontCss=k;for(var u=k.split("url("),H=1;H<u.length;H++){var P=u[H].indexOf(")");0<P&&Editor.addAllowedFontUrl(Editor.trimCssUrl(u[H].substring(0,
-P)))}u=document.getElementsByTagName("script")[0];if(null!=u&&null!=u.parentNode)for(H=document.createElement("style"),H.setAttribute("type","text/css"),H.appendChild(document.createTextNode(k)),u.parentNode.insertBefore(H,u),k=k.split("url("),H=1;H<k.length;H++){P=k[H].indexOf(")");P=Editor.trimCssUrl(k[H].substring(0,P));var T=document.createElement("link");T.setAttribute("rel","preload");T.setAttribute("href",P);T.setAttribute("as","font");T.setAttribute("crossorigin","");u.parentNode.insertBefore(T,
+P)))}u=document.getElementsByTagName("script")[0];if(null!=u&&null!=u.parentNode)for(H=document.createElement("style"),H.setAttribute("type","text/css"),H.appendChild(document.createTextNode(k)),u.parentNode.insertBefore(H,u),k=k.split("url("),H=1;H<k.length;H++){P=k[H].indexOf(")");P=Editor.trimCssUrl(k[H].substring(0,P));var U=document.createElement("link");U.setAttribute("rel","preload");U.setAttribute("href",P);U.setAttribute("as","font");U.setAttribute("crossorigin","");u.parentNode.insertBefore(U,
u)}}};Editor.trimCssUrl=function(k){return k.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(k){k=null!=k?k:Editor.GUID_LENGTH;for(var u=[],H=0;H<k;H++)u.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*
Editor.GUID_ALPHABET.length)));return u.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",
extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.generateTimeout=9E4;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!0;var d=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(k){k=null!=k&&"mxlibrary"!=k.nodeName?this.extractGraphModel(k):null;
if(null!=k){var u=Editor.extractParserError(k,mxResources.get("invalidOrMissingFile"));if(u)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[k],"cause",[u]),Error(mxResources.get("notADiagramFile")+" ("+u+")");if("mxGraphModel"==k.nodeName){u=k.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=u&&""!=u)u!=this.graph.currentStyle&&(H=null!=this.graph.themes?this.graph.themes[u]:mxUtils.load(STYLE_PATH+"/"+u+".xml").getDocumentElement(),null!=H&&(P=new mxCodec(H.ownerDocument),
P.decode(H,this.graph.getStylesheet())));else{var H=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=H){var P=new mxCodec(H.ownerDocument);P.decode(H,this.graph.getStylesheet())}}this.graph.currentStyle=u;this.graph.mathEnabled="1"==urlParams.math||"1"==k.getAttribute("math");this.graph.setAdaptiveColors(k.getAttribute("adaptiveColors"));u=k.getAttribute("backgroundImage");null!=u?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(u)):
-this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==k.getAttribute("shadow"),!1);if(u=k.getAttribute("extFonts"))try{for(u=u.split("|").map(function(T){T=T.split("^");return{name:T[0],url:T[1]}}),H=0;H<u.length;H++)this.graph.addExtFont(u[H].name,u[H].url)}catch(T){console.log("ExtFonts format error: "+T.message)}else null!=this.graph.extFonts&&
+this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==k.getAttribute("shadow"),!1);if(u=k.getAttribute("extFonts"))try{for(u=u.split("|").map(function(U){U=U.split("^");return{name:U[0],url:U[1]}}),H=0;H<u.length;H++)this.graph.addExtFont(u[H].name,u[H].url)}catch(U){console.log("ExtFonts format error: "+U.message)}else null!=this.graph.extFonts&&
0<this.graph.extFonts.length&&(this.graph.extFonts=[])}d.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var m=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(k,u){k=null!=k?k:!0;var H=m.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&H.setAttribute("style",this.graph.currentStyle);var P=this.graph.getBackgroundImageObject(this.graph.backgroundImage,
-u);null!=P&&H.setAttribute("backgroundImage",JSON.stringify(P));H.setAttribute("math",this.graph.mathEnabled?"1":"0");H.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?H.setAttribute("adaptiveColors",this.graph.adaptiveColors):H.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(P=this.graph.extFonts.map(function(T){return T.name+"^"+T.url}),H.setAttribute("extFonts",P.join("|")));return H};Editor.prototype.isDataSvg=
+u);null!=P&&H.setAttribute("backgroundImage",JSON.stringify(P));H.setAttribute("math",this.graph.mathEnabled?"1":"0");H.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?H.setAttribute("adaptiveColors",this.graph.adaptiveColors):H.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(P=this.graph.extFonts.map(function(U){return U.name+"^"+U.url}),H.setAttribute("extFonts",P.join("|")));return H};Editor.prototype.isDataSvg=
function(k){try{var u=mxUtils.parseXml(k).documentElement.getAttribute("content");if(null!=u&&(null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(cont,u))),null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u)),null!=u&&0<u.length)){var H=mxUtils.parseXml(u).documentElement;return"mxfile"==H.nodeName||"mxGraphModel"==H.nodeName}}catch(P){}return!1};Editor.prototype.extractGraphModel=function(k,u,H){return Editor.extractGraphModel.apply(this,arguments)};var p=
Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();p.apply(this,arguments)};var t=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){t.apply(this,arguments);this.graph.useCssTransforms=
!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.safeMathJaxFilterUrl=function(k,u){var H=(u.replace(/[\t\n\r]/g,"").replace(/^[\u0000-\u0020]+/,"").match(/^([a-z][a-z0-9+.\-]*):/i)||[null,""])[1].toLowerCase(),P=k.allow.URLs;return"all"===P||"safe"===P&&(k.options.safeProtocols[H]||!H)?u:null};Editor.safeMathJaxFilterUrl.drawioPatched=!0;Editor.patchMathJaxUrlFilter=function(k){k=null!=k?k:"undefined"!==typeof MathJax?MathJax:
null;if(null!=k){var u=null!=k._&&null!=k._.ui&&null!=k._.ui.safe&&null!=k._.ui.safe.SafeMethods?k._.ui.safe.SafeMethods.SafeMethods:null;null==u||null==u.filterURL||u.filterURL.drawioPatched||(u.filterURL=Editor.safeMathJaxFilterUrl);k=null!=k.startup?k.startup.document:null;null==k||null==k.safe||null==k.safe.filterMethods||null==k.safe.filterMethods.filterURL||k.safe.filterMethods.filterURL.drawioPatched||(k.safe.filterMethods.filterURL=Editor.safeMathJaxFilterUrl)}};Editor.safeMathJaxDataMacro=
-function(k,u,H,P){var T=k.setAttribute;k.setAttribute=function(W,fa,X){if("string"!==typeof fa||"data-"!==fa.substring(0,5)||fa.match(Editor.safeMathJaxDataPattern))return T.apply(this,arguments)};try{return u.apply(this,[H,P])}finally{k.setAttribute=T}};Editor.safeMathJaxDataPattern=/^data-mjx-/;Editor.patchMathJaxDataMacro=function(k){k=null!=k?k:"undefined"!==typeof MathJax?MathJax:null;k=null!=k&&null!=k._&&null!=k._.input?k._.input.tex:null;if(null!=k&&null!=k.MapHandler&&null!=k.NodeUtil){var u=
-k.MapHandler.MapHandler.getMap("html_macros");u=null!=u&&null!=u.lookup?u.lookup("data"):null;if(null!=u&&null!=u._func&&!u._func.drawioPatched){var H=k.NodeUtil["default"],P=u._func;k=function(T,W){return Editor.safeMathJaxDataMacro(H,P,T,W)};k.drawioPatched=!0;u._func=k}}};Editor.patchMathJaxSafeFilters=function(k){Editor.patchMathJaxUrlFilter(k);Editor.patchMathJaxDataMacro(k)};Editor.initMath=function(k,u){if("undefined"===typeof window.MathJax){var H=function(){P=null;Editor.mathJaxRendering=
+function(k,u,H,P){var U=k.setAttribute;k.setAttribute=function(W,fa,X){if("string"!==typeof fa||"data-"!==fa.substring(0,5)||fa.match(Editor.safeMathJaxDataPattern))return U.apply(this,arguments)};try{return u.apply(this,[H,P])}finally{k.setAttribute=U}};Editor.safeMathJaxDataPattern=/^data-mjx-/;Editor.patchMathJaxDataMacro=function(k){k=null!=k?k:"undefined"!==typeof MathJax?MathJax:null;k=null!=k&&null!=k._&&null!=k._.input?k._.input.tex:null;if(null!=k&&null!=k.MapHandler&&null!=k.NodeUtil){var u=
+k.MapHandler.MapHandler.getMap("html_macros");u=null!=u&&null!=u.lookup?u.lookup("data"):null;if(null!=u&&null!=u._func&&!u._func.drawioPatched){var H=k.NodeUtil["default"],P=u._func;k=function(U,W){return Editor.safeMathJaxDataMacro(H,P,U,W)};k.drawioPatched=!0;u._func=k}}};Editor.patchMathJaxSafeFilters=function(k){Editor.patchMathJaxUrlFilter(k);Editor.patchMathJaxDataMacro(k)};Editor.initMath=function(k,u){if("undefined"===typeof window.MathJax){var H=function(){P=null;Editor.mathJaxRendering=
!1;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};k=null!=k?k:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var P=null;Editor.mathJaxRendering=!1;Editor.doMathJaxRender=function(fa){Editor.patchMathJaxSafeFilters();null!=MathJax.startup&&null!=MathJax.startup.output&&null!=MathJax.startup.output.options&&null!=MathJax.startup.output.options.linebreaks&&(MathJax.startup.output.options.linebreaks.inline=!1);try{null==P?(MathJax.typesetClear([fa]),
MathJax.typeset([fa]),H()):P!=fa&&Editor.mathJaxQueue.push(fa)}catch(X){MathJax.typesetClear([fa]),null!=X.retry?(P=fa,Editor.mathJaxRendering=!0,X.retry.then(function(){MathJax.typesetPromise([fa]).then(H)["catch"](function(ea){console.log("Error in MathJax.typesetPromise: "+ea.toString());H()})})["catch"](function(ea){console.log("Error in MathJax.retry: "+ea.toString());H()})):null!=window.console&&console.log("Error in MathJax.typeset: "+X.toString())}};window.MathJax=null!=u?u:{options:{skipHtmlTags:{"[+]":["text"]},
ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe","[tex]/html"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var fa=0;fa<Editor.mathJaxQueue.length;fa++)Editor.doMathJaxRender(Editor.mathJaxQueue[fa])}}};Editor.MathJaxRender=function(fa){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(fa):Editor.mathJaxQueue.push(fa)};
-Editor.onMathJaxDone=function(){};var T=Editor.prototype.init;Editor.prototype.init=function(){T.apply(this,arguments);var fa=mxUtils.bind(this,function(oa,la){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,fa);this.graph.addListener(mxEvent.REFRESH,fa);var X=this.graph,ea=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){null!=
+Editor.onMathJaxDone=function(){};var U=Editor.prototype.init;Editor.prototype.init=function(){U.apply(this,arguments);var fa=mxUtils.bind(this,function(oa,ka){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,fa);this.graph.addListener(mxEvent.REFRESH,fa);var X=this.graph,ea=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){null!=
ea&&ea.apply(this,arguments);Editor.mathOutputSize&&null!=X&&X.mathEnabled&&(X.refreshMathBounds(),null!=X.container&&(X.container.style.visibility=""))}};u=document.getElementsByTagName("script");if(null!=u&&0<u.length){var W=document.createElement("script");W.setAttribute("type","text/javascript");W.setAttribute("src",k);u[0].parentNode.appendChild(W)}}};Editor.containsMath=function(k){return null!=k&&(0<=k.indexOf("$")||0<=k.indexOf("\\(")||0<=k.indexOf("\\[")||0<=k.indexOf("\\begin{"))};(function(){var k=
-Graph.prototype.getPreferredSizeForCell,u=null;Graph.prototype.getPreferredSizeForCell=function(H,P,T){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(H))return k.apply(this,arguments);var W=this.view.createState(H);W=null!=W?this.cellRenderer.getLabelValue(W):null;if(null==W||0===W.length||!Editor.containsMath(W))return k.apply(this,arguments);var fa=mxUtils.getSizeForString;mxUtils.getSizeForString=function(X,ea,
-oa,la){null==u&&(u=document.createElement("div"),u.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(u));u.style.fontSize=ea+"px";u.style.fontFamily=oa;null!=la&&0<la?(u.style.width=la+"px",u.style.whiteSpace="normal"):(u.style.width="",u.style.whiteSpace="nowrap");MathJax.typesetClear([u]);u.innerHTML=Graph.sanitizeHtml(X);try{MathJax.typeset([u]);var ca=u.getBoundingClientRect();return new mxRectangle(0,0,ca.width,ca.height)}catch(sa){return fa.apply(this,
-arguments)}};try{return k.apply(this,arguments)}finally{mxUtils.getSizeForString=fa}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var k=this.view,u=!1;k.states.visit(mxUtils.bind(this,function(P,T){null!=T&&null!=T.text&&(P=this.cellRenderer.getLabelValue(T),"string"===typeof P&&Editor.containsMath(P)&&(T.text.updateBoundingBox(),u=!0))}));if(u){var H=null!=k.currentRoot?k.currentRoot:this.model.getRoot();H=k.getState(H);null!=H&&(H=k.getBoundingBox(H,
-!0,!1),k.setGraphBounds(null!=H?H:k.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var k=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(u){k.apply(this,arguments);var H=this.editor.graph;if(Editor.mathOutputSize&&null!=H&&H.mathEnabled){var P=arguments,T=this,W=!1,fa=function(){W||(W=!0,H.removeListener(fa),H.zoomTo(1),T.resetScrollbars(),k.apply(T,P))};H.addListener("mathRefreshed",fa);Promise.resolve().then(function(){W||
-"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||H.removeListener(fa)})}}})();Editor.prototype.csvToArray=function(k){if(0<k.length){var u="",H=[""],P=0,T=!0,W;k=$jscomp.makeIterator(k);for(W=k.next();!W.done;W=k.next())W=W.value,'"'===W?(T&&W===u&&(H[P]+=W),T=!T):","===W&&T?W=H[++P]="":H[P]+=W,u=W;return H}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||
+Graph.prototype.getPreferredSizeForCell,u=null;Graph.prototype.getPreferredSizeForCell=function(H,P,U){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(H))return k.apply(this,arguments);var W=this.view.createState(H);W=null!=W?this.cellRenderer.getLabelValue(W):null;if(null==W||0===W.length||!Editor.containsMath(W))return k.apply(this,arguments);var fa=mxUtils.getSizeForString;mxUtils.getSizeForString=function(X,ea,
+oa,ka){null==u&&(u=document.createElement("div"),u.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(u));u.style.fontSize=ea+"px";u.style.fontFamily=oa;null!=ka&&0<ka?(u.style.width=ka+"px",u.style.whiteSpace="normal"):(u.style.width="",u.style.whiteSpace="nowrap");MathJax.typesetClear([u]);u.innerHTML=Graph.sanitizeHtml(X);try{MathJax.typeset([u]);var ba=u.getBoundingClientRect();return new mxRectangle(0,0,ba.width,ba.height)}catch(sa){return fa.apply(this,
+arguments)}};try{return k.apply(this,arguments)}finally{mxUtils.getSizeForString=fa}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var k=this.view,u=!1;k.states.visit(mxUtils.bind(this,function(P,U){null!=U&&null!=U.text&&(P=this.cellRenderer.getLabelValue(U),"string"===typeof P&&Editor.containsMath(P)&&(U.text.updateBoundingBox(),u=!0))}));if(u){var H=null!=k.currentRoot?k.currentRoot:this.model.getRoot();H=k.getState(H);null!=H&&(H=k.getBoundingBox(H,
+!0,!1),k.setGraphBounds(null!=H?H:k.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var k=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(u){k.apply(this,arguments);var H=this.editor.graph;if(Editor.mathOutputSize&&null!=H&&H.mathEnabled){var P=arguments,U=this,W=!1,fa=function(){W||(W=!0,H.removeListener(fa),H.zoomTo(1),U.resetScrollbars(),k.apply(U,P))};H.addListener("mathRefreshed",fa);Promise.resolve().then(function(){W||
+"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||H.removeListener(fa)})}}})();Editor.prototype.csvToArray=function(k){if(0<k.length){var u="",H=[""],P=0,U=!0,W;k=$jscomp.makeIterator(k);for(W=k.next();!W.done;W=k.next())W=W.value,'"'===W?(U&&W===u&&(H[P]+=W),U=!U):","===W&&U?W=H[++P]="":H[P]+=W,u=W;return H}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||
/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(k)){var u=EditorUi.isVisioFilename(k);u=/\.png$/i.test(k)||/\.pdf$/i.test(k)||u;var H="t="+(new Date).getTime();k=PROXY_URL+"?url="+encodeURIComponent(k)+"&"+H+(u?"&base64=1":"")}return k};Editor.prototype.isCorsEnabledForUrl=function(k){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||k.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=
new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(k)||"https://raw.githubusercontent.com/"===k.substring(0,34)||"https://icons.diagrams.net/"===k.substring(0,27)||"https://fonts.googleapis.com/"===k.substring(0,29)||"https://fonts.gstatic.com/"===k.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var k=new mxUrlConverter;k.updateBaseUrl();var u=k.convert,H=this;k.convert=function(P){null!=P&&navigator.onLine&&("http://"!=P.substring(0,
-7)&&"https://"!=P.substring(0,8)||P.substring(0,k.baseUrl.length)==k.baseUrl||H.crossOriginImages&&H.isCorsEnabledForUrl(P)?"chrome-extension://"!=P.substring(0,19)&&(P=u.apply(this,arguments)):P=PROXY_URL+"?url="+encodeURIComponent(P));return P};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,u,H,P,T){try{var W=!0,fa=window.setTimeout(mxUtils.bind(this,function(){W=!1;u(k)}),
-this.timeout),X=mxUtils.bind(this,function(){null!=P?this.convertImageToDataUri(k,u,H,P,!0):u(k)});if(/(\.svg)$/i.test(k)&&!T)mxUtils.get(k,mxUtils.bind(this,function(oa){window.clearTimeout(fa);W&&(200>oa.getStatus()||299<oa.getStatus()?X():u(Editor.createSvgDataUri(oa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(fa);W&&X()}));else{var ea=new Image;this.crossOriginImages&&(ea.crossOrigin="anonymous");ea.onload=function(){window.clearTimeout(fa);if(W)try{P=null!=P&&T?P:1;var oa=
-document.createElement("canvas");oa.height=ea.height*P;oa.width=ea.width*P;var la=oa.getContext("2d");la.scale(P,P);la.drawImage(ea,0,0);u(oa.toDataURL())}catch(ca){u(k)}};ea.onerror=function(){window.clearTimeout(fa);W&&(null!=H?H():u(k))};ea.src=k}}catch(oa){null!=H?H():u(k)}};Editor.prototype.convertImages=function(k,u,H,P){function T(){0<W.length?W.shift()():u(k)}null==P&&(P=this.createImageUrlConverter());var W=[],fa=H||{};H=mxUtils.bind(this,function(ca,sa){ca=k.getElementsByTagName(ca);for(var xa=
-0;xa<ca.length;xa++)mxUtils.bind(this,function(qa){W.push(mxUtils.bind(this,function(){try{if(null!=qa){var Ba=P.convert(qa.getAttribute(sa));if(null!=Ba&&"data:"!=Ba.substring(0,5)){var ma=fa[Ba];null==ma?this.convertImageToDataUri(Ba,function(ta){null!=ta&&(fa[Ba]=ta,qa.setAttribute(sa,ta));T()},null,Editor.svgRasterScale):(qa.setAttribute(sa,ma),T())}else null!=Ba&&qa.setAttribute(sa,Ba),T()}}catch(ta){T()}}))})(ca[xa])});var X={},ea=function(){var ca=k.getElementsByTagName("defs")[0];null==ca&&
-(ca=k.ownerDocument,ca=null!=ca.createElementNS?ca.createElementNS(mxConstants.NS_SVG,"defs"):ca.createElement("defs"),k.insertBefore(ca,k.firstChild));return ca},oa=mxUtils.bind(this,function(){for(var ca=k.getElementsByTagName("use"),sa=0;sa<ca.length;sa++)mxUtils.bind(this,function(xa){W.push(mxUtils.bind(this,function(){try{var qa=xa.getAttribute("href");null==qa&&(qa=xa.getAttribute("xlink:href"));if(null!=qa&&"#"!=qa.charAt(0)&&"data:"!=qa.substring(0,5)){var Ba=P.convert(qa),ma=function(va){va=
-Graph.createSvgImageSymbol(ea(),X,va,!0);null!=va&&(xa.setAttribute("href","#"+va),xa.setAttribute("xlink:href","#"+va));T()},ta=fa[Ba];null==ta?this.convertImageToDataUri(Ba,function(va){null!=va&&va!=Ba&&(fa[Ba]=va);ma(va)}):ma(ta)}else T()}catch(va){T()}}))})(ca[sa])}),la=mxUtils.bind(this,function(){W.push(mxUtils.bind(this,function(){try{for(var ca=k.getElementsByTagName("image"),sa=[],xa=0;xa<ca.length;xa++)sa.push(ca[xa]);var qa={},Ba={},ma=[],ta=function(){for(var Oa=k.getElementsByTagName("use"),
-Ea=0;Ea<Oa.length;Ea++){var Aa=Oa[Ea].getAttribute("href");null==Aa&&(Aa=Oa[Ea].getAttribute("xlink:href"));null!=Aa&&null!=qa[Aa]&&(Oa[Ea].setAttribute("href","#"+qa[Aa]),Oa[Ea].setAttribute("xlink:href","#"+qa[Aa]))}},va=function(Oa,Ea){for(var Aa=null!=k.ownerDocument.createElementNS?k.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):k.ownerDocument.createElement("use"),Ja=Oa.attributes,Ga=0;Ga<Ja.length;Ga++){var Ua=Ja[Ga].name;"href"!=Ua&&"xlink:href"!=Ua&&"preserveAspectRatio"!=Ua&&Aa.setAttribute(Ua,
-Ja[Ga].value)}Aa.setAttribute("href","#"+Ea);Aa.setAttribute("xlink:href","#"+Ea);Oa.parentNode.replaceChild(Aa,Oa)};for(xa=0;xa<sa.length;xa++){var Ha=sa[xa];ca=Ha;var La=!0;if("symbol"==Ha.parentNode.nodeName)if(null==Ha.getAttribute("id")&&"mx-image-"==String(Ha.parentNode.getAttribute("id")||"").substring(0,9))ca=Ha.parentNode,La=!1;else continue;else"mx-image-"==String(Ha.getAttribute("id")||"").substring(0,9)&&(La=!1);var Ia=Ha.getAttribute("xlink:href");if(null!=Ia&&"data:"==Ia.substring(0,
-5)){var Ca=ca.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==Ia.substring(0,18)){var Pa="mx-symbol-"+mxUtils.hashCode(Ia+"|"+("none"!=Ca)),Ka=k.querySelector('[id="'+Pa+'"]');if(null!=Ka&&"symbol"==Ka.nodeName){La?va(Ha,Pa):(qa["#"+ca.getAttribute("id")]=Pa,ca.parentNode.removeChild(ca));continue}}null==Ba[Ia]&&(Ba[Ia]={},ma.push(Ia));null==Ba[Ia][Ca]&&(Ba[Ia][Ca]=[]);Ba[Ia][Ca].push({node:ca,inline:La})}}ta();var Na=function(){for(var Oa=null,Ea=null;0<ma.length&&null==Oa;){Oa=
-ma.pop();Ea=Ba[Oa];var Aa=0,Ja=0,Ga;for(Ga in Ea)Aa++,Ja=Math.max(Ja,Ea[Ga].length);2>Aa&&2>Ja&&(Oa=null)}if(null==Oa)T();else{var Ua=new Image;Ua.onload=function(){try{var ab=Ua.naturalWidth,Wa=Ua.naturalHeight;if(0<ab&&0<Wa){var cb=k.ownerDocument,hb=0,wb;for(wb in Ea)hb++;var Fa=function(Fb){return null!=cb.createElementNS?cb.createElementNS(mxConstants.NS_SVG,Fb):cb.createElement(Fb)},Ra=function(){var Fb=Fa("image");Fb.setAttribute("width",ab);Fb.setAttribute("height",Wa);null==Fb.setAttributeNS?
+7)&&"https://"!=P.substring(0,8)||P.substring(0,k.baseUrl.length)==k.baseUrl||H.crossOriginImages&&H.isCorsEnabledForUrl(P)?"chrome-extension://"!=P.substring(0,19)&&(P=u.apply(this,arguments)):P=PROXY_URL+"?url="+encodeURIComponent(P));return P};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,u,H,P,U){try{var W=!0,fa=window.setTimeout(mxUtils.bind(this,function(){W=!1;u(k)}),
+this.timeout),X=mxUtils.bind(this,function(){null!=P?this.convertImageToDataUri(k,u,H,P,!0):u(k)});if(/(\.svg)$/i.test(k)&&!U)mxUtils.get(k,mxUtils.bind(this,function(oa){window.clearTimeout(fa);W&&(200>oa.getStatus()||299<oa.getStatus()?X():u(Editor.createSvgDataUri(oa.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(fa);W&&X()}));else{var ea=new Image;this.crossOriginImages&&(ea.crossOrigin="anonymous");ea.onload=function(){window.clearTimeout(fa);if(W)try{P=null!=P&&U?P:1;var oa=
+document.createElement("canvas");oa.height=ea.height*P;oa.width=ea.width*P;var ka=oa.getContext("2d");ka.scale(P,P);ka.drawImage(ea,0,0);u(oa.toDataURL())}catch(ba){u(k)}};ea.onerror=function(){window.clearTimeout(fa);W&&(null!=H?H():u(k))};ea.src=k}}catch(oa){null!=H?H():u(k)}};Editor.prototype.convertImages=function(k,u,H,P){function U(){0<W.length?W.shift()():u(k)}null==P&&(P=this.createImageUrlConverter());var W=[],fa=H||{};H=mxUtils.bind(this,function(ba,sa){ba=k.getElementsByTagName(ba);for(var xa=
+0;xa<ba.length;xa++)mxUtils.bind(this,function(qa){W.push(mxUtils.bind(this,function(){try{if(null!=qa){var Ba=P.convert(qa.getAttribute(sa));if(null!=Ba&&"data:"!=Ba.substring(0,5)){var ma=fa[Ba];null==ma?this.convertImageToDataUri(Ba,function(ta){null!=ta&&(fa[Ba]=ta,qa.setAttribute(sa,ta));U()},null,Editor.svgRasterScale):(qa.setAttribute(sa,ma),U())}else null!=Ba&&qa.setAttribute(sa,Ba),U()}}catch(ta){U()}}))})(ba[xa])});var X={},ea=function(){var ba=k.getElementsByTagName("defs")[0];null==ba&&
+(ba=k.ownerDocument,ba=null!=ba.createElementNS?ba.createElementNS(mxConstants.NS_SVG,"defs"):ba.createElement("defs"),k.insertBefore(ba,k.firstChild));return ba},oa=mxUtils.bind(this,function(){for(var ba=k.getElementsByTagName("use"),sa=0;sa<ba.length;sa++)mxUtils.bind(this,function(xa){W.push(mxUtils.bind(this,function(){try{var qa=xa.getAttribute("href");null==qa&&(qa=xa.getAttribute("xlink:href"));if(null!=qa&&"#"!=qa.charAt(0)&&"data:"!=qa.substring(0,5)){var Ba=P.convert(qa),ma=function(va){va=
+Graph.createSvgImageSymbol(ea(),X,va,!0);null!=va&&(xa.setAttribute("href","#"+va),xa.setAttribute("xlink:href","#"+va));U()},ta=fa[Ba];null==ta?this.convertImageToDataUri(Ba,function(va){null!=va&&va!=Ba&&(fa[Ba]=va);ma(va)}):ma(ta)}else U()}catch(va){U()}}))})(ba[sa])}),ka=mxUtils.bind(this,function(){W.push(mxUtils.bind(this,function(){try{for(var ba=k.getElementsByTagName("image"),sa=[],xa=0;xa<ba.length;xa++)sa.push(ba[xa]);var qa={},Ba={},ma=[],ta=function(){for(var Oa=k.getElementsByTagName("use"),
+Ea=0;Ea<Oa.length;Ea++){var Aa=Oa[Ea].getAttribute("href");null==Aa&&(Aa=Oa[Ea].getAttribute("xlink:href"));null!=Aa&&null!=qa[Aa]&&(Oa[Ea].setAttribute("href","#"+qa[Aa]),Oa[Ea].setAttribute("xlink:href","#"+qa[Aa]))}},va=function(Oa,Ea){for(var Aa=null!=k.ownerDocument.createElementNS?k.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):k.ownerDocument.createElement("use"),Ja=Oa.attributes,Ha=0;Ha<Ja.length;Ha++){var Ua=Ja[Ha].name;"href"!=Ua&&"xlink:href"!=Ua&&"preserveAspectRatio"!=Ua&&Aa.setAttribute(Ua,
+Ja[Ha].value)}Aa.setAttribute("href","#"+Ea);Aa.setAttribute("xlink:href","#"+Ea);Oa.parentNode.replaceChild(Aa,Oa)};for(xa=0;xa<sa.length;xa++){var Ga=sa[xa];ba=Ga;var La=!0;if("symbol"==Ga.parentNode.nodeName)if(null==Ga.getAttribute("id")&&"mx-image-"==String(Ga.parentNode.getAttribute("id")||"").substring(0,9))ba=Ga.parentNode,La=!1;else continue;else"mx-image-"==String(Ga.getAttribute("id")||"").substring(0,9)&&(La=!1);var Ia=Ga.getAttribute("xlink:href");if(null!=Ia&&"data:"==Ia.substring(0,
+5)){var Ca=ba.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==Ia.substring(0,18)){var Pa="mx-symbol-"+mxUtils.hashCode(Ia+"|"+("none"!=Ca)),Ka=k.querySelector('[id="'+Pa+'"]');if(null!=Ka&&"symbol"==Ka.nodeName){La?va(Ga,Pa):(qa["#"+ba.getAttribute("id")]=Pa,ba.parentNode.removeChild(ba));continue}}null==Ba[Ia]&&(Ba[Ia]={},ma.push(Ia));null==Ba[Ia][Ca]&&(Ba[Ia][Ca]=[]);Ba[Ia][Ca].push({node:ba,inline:La})}}ta();var Na=function(){for(var Oa=null,Ea=null;0<ma.length&&null==Oa;){Oa=
+ma.pop();Ea=Ba[Oa];var Aa=0,Ja=0,Ha;for(Ha in Ea)Aa++,Ja=Math.max(Ja,Ea[Ha].length);2>Aa&&2>Ja&&(Oa=null)}if(null==Oa)U();else{var Ua=new Image;Ua.onload=function(){try{var ab=Ua.naturalWidth,Wa=Ua.naturalHeight;if(0<ab&&0<Wa){var cb=k.ownerDocument,hb=0,wb;for(wb in Ea)hb++;var Fa=function(Fb){return null!=cb.createElementNS?cb.createElementNS(mxConstants.NS_SVG,Fb):cb.createElement(Fb)},Ra=function(){var Fb=Fa("image");Fb.setAttribute("width",ab);Fb.setAttribute("height",Wa);null==Fb.setAttributeNS?
Fb.setAttribute("xlink:href",Oa):Fb.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Oa);return Fb},$a=null;if(1<hb){for($a="mx-data-"+mxUtils.hashCode(Oa);null!=k.querySelector('[id="'+$a+'"]');)$a+="-1";var fb=Ra();fb.setAttribute("id",$a);ea().appendChild(fb)}for(wb in Ea){var rb=Ea[wb];hb=null;for(fb=0;fb<rb.length&&null==hb;fb++)rb[fb].inline||(hb=rb[fb].node.getAttribute("id"));if(null==hb)for(hb="mx-image-"+mxUtils.hashCode(Oa+"|"+wb);null!=k.querySelector('[id="'+hb+'"]');)hb+="-1";var mb=
Fa("symbol");mb.setAttribute("id",hb);mb.setAttribute("viewBox","0 0 "+ab+" "+Wa);""!=wb&&mb.setAttribute("preserveAspectRatio",wb);if(null!=$a){var ub=Fa("use");ub.setAttribute("href","#"+$a);ub.setAttribute("xlink:href","#"+$a);mb.appendChild(ub)}else mb.appendChild(Ra());ea().appendChild(mb);for(fb=0;fb<rb.length;fb++){var Eb=rb[fb].node;rb[fb].inline?va(Eb,hb):(Eb.getAttribute("id")!=hb&&(qa["#"+Eb.getAttribute("id")]=hb),Eb.parentNode.removeChild(Eb))}}ta()}}catch(Fb){}Na()};Ua.onerror=function(){Na()};
-Ua.src=Oa}};Na()}catch(Oa){T()}}))});H("image","xlink:href");H("img","src");oa();la();T()};Editor.base64Encode=function(k){for(var u="",H=0,P=k.length,T,W,fa;H<P;){T=k.charCodeAt(H++)&255;if(H==P){u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&3)<<4);u+="==";break}W=k.charCodeAt(H++);if(H==P){u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&
-3)<<4|(W&240)>>4);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2);u+="=";break}fa=k.charCodeAt(H++);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&3)<<4|(W&240)>>4);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2|(fa&192)>>6);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(fa&
-63)}return u};Editor.prototype.loadUrl=function(k,u,H,P,T,W,fa,X){try{var ea=!fa&&(P||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));T=null!=T?T:!0;var oa=mxUtils.bind(this,function(){mxUtils.get(k,mxUtils.bind(this,function(la){200<=la.getStatus()&&299>=la.getStatus()?null!=u&&(la=la.getText(),ea&&(W=null!=W?W:"data:image/png;base64,",la=W+Editor.base64Encode(la)),u(la)):null!=H&&(0==la.getStatus()?H({message:mxResources.get("accessDenied")},
-la):404==la.getStatus()?H({message:mxResources.get("fileNotFound"),code:la.getStatus()},la):H({message:this.getErrorMessage(la)},la))}),function(la){null!=H&&H({message:mxResources.get("error")+" "+la.getStatus()})},ea,this.timeout,function(){T&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:oa})},X)});oa()}catch(la){null!=H&&H(la)}};Editor.prototype.getErrorMessage=function(k){var u=mxResources.get("error")+" "+k.getStatus();try{var H=k.getText(),P=JSON.parse(H);null!=P&&null!=P.error&&null!=P.error.message&&
-(u=P.error.message+" ("+u+")")}catch(T){}return u};Editor.prototype.absoluteCssFonts=function(k){var u=null;if(null!=k){var H=k.split("url(");if(0<H.length){u=[H[0]];k=window.location.pathname;var P=null!=k?k.lastIndexOf("/"):-1;0<=P&&(k=k.substring(0,P+1));P=document.getElementsByTagName("base");var T=null;null!=P&&0<P.length&&(T=P[0].getAttribute("href"));for(var W=1;W<H.length;W++)if(P=H[W].indexOf(")"),0<P){var fa=Editor.trimCssUrl(H[W].substring(0,P));this.graph.isRelativeUrl(fa)&&(fa=null!=
-T?T+fa:window.location.protocol+"//"+window.location.hostname+("/"==fa.charAt(0)?"":k)+fa);u.push('url("'+fa+'"'+H[W].substring(P))}else u.push(H[W])}else u=[k]}return null!=u?u.join(""):null};Editor.prototype.mapFontUrl=function(k,u,H){/^https?:\/\//.test(u)&&!this.isCorsEnabledForUrl(u)&&(u=PROXY_URL+"?url="+encodeURIComponent(u));H(k,u)};Editor.prototype.embedCssFonts=function(k,u){var H=k.split("url("),P=0;null==this.cachedFonts&&(this.cachedFonts=Object.create(null));var T=mxUtils.bind(this,
-function(){if(0==P){for(var ea=[H[0]],oa=1;oa<H.length;oa++){var la=H[oa].indexOf(")");ea.push('url("');ea.push(this.cachedFonts[Editor.trimCssUrl(H[oa].substring(0,la))]);ea.push('"'+H[oa].substring(la))}u(ea.join(""))}});if(0<H.length){for(k=1;k<H.length;k++){var W=H[k].indexOf(")"),fa=null,X=H[k].indexOf("format(",W);0<X&&(fa=Editor.trimCssUrl(H[k].substring(X+7,H[k].indexOf(")",X))));mxUtils.bind(this,function(ea){var oa=this.cachedFonts[ea];if(null==oa){var la=[];this.cachedFonts[ea]=la;P++;
-oa="application/x-font-ttf";if("svg"==fa||/(\.svg)($|\?)/i.test(ea))oa="image/svg+xml";else if("otf"==fa||"embedded-opentype"==fa||/(\.otf)($|\?)/i.test(ea))oa="application/x-font-opentype";else if("woff"==fa||/(\.woff)($|\?)/i.test(ea))oa="application/font-woff";else if("woff2"==fa||/(\.woff2)($|\?)/i.test(ea))oa="application/font-woff2";else if("eot"==fa||/(\.eot)($|\?)/i.test(ea))oa="application/vnd.ms-fontobject";else if("sfnt"==fa||/(\.sfnt)($|\?)/i.test(ea))oa="application/font-sfnt";var ca=
-mxUtils.bind(this,function(sa){this.cachedFonts[ea]=sa;P--;T();for(sa=0;sa<la.length;sa++)la[sa]()});this.mapFontUrl(oa,ea,mxUtils.bind(this,function(sa,xa){this.loadUrl(xa,function(qa){ca(qa)},function(qa){ca(ea)},!0,null,"data:"+sa+";charset=utf-8;base64,")}))}else"string"!=typeof oa&&(P++,oa.push(function(){P--;T()}))})(Editor.trimCssUrl(H[k].substring(0,W)),fa)}T()}else u(k)};Editor.prototype.loadFonts=function(k){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,
-mxUtils.bind(this,function(u){this.resolvedFontCss=u;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=function(){var k={},u;for(u in Graph.fontMapping)Graph.isCssFontUrl(u)&&(k[u]=Graph.fontMapping[u]);return k};Editor.prototype.embedExtFonts=function(k,u){u=this.graph.getCustomFonts(u);if(0<u.length){var H=[],P=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var T=mxUtils.bind(this,function(){0==P&&this.embedCssFonts(H.join(""),k)}),W=
-0;W<u.length;W++)mxUtils.bind(this,function(fa,X){Graph.isCssFontUrl(X)?null==this.cachedGoogleFonts[X]?(P++,this.loadUrl(Graph.rewriteGoogleFontUrl(X),mxUtils.bind(this,function(ea){this.cachedGoogleFonts[X]=ea;H.push(ea+"\n");P--;T()}),mxUtils.bind(this,function(ea){P--;H.push('@import url("'+Graph.escapeCssString(X)+'");\n');T()}))):H.push(this.cachedGoogleFonts[X]+"\n"):H.push('@font-face {font-family: "'+Graph.escapeCssString(fa)+'";src: url("'+Graph.escapeCssString(X)+'")}\n')})(u[W].name,u[W].url);
-T()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var u=document.getElementsByTagName("style"),H=0;H<u.length;H++){var P=mxUtils.getTextContent(u[H]);0>P.indexOf("mxPageSelector")&&0<P.indexOf("MathJax")&&k[0].appendChild(u[H].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,u){u=null!=u?u:this.absoluteCssFonts(this.fontCss);if(null!=u){var H=mxUtils.getSvgDefs(k),P=u.split("\n");u=[];for(var T=[],W=0;W<P.length;W++)"@import"==
-P[W].substring(0,7)?u.push(P[W]):T.push(P[W]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");k.setAttribute("type","text/css");0<u.length&&(mxUtils.setTextContent(k,u.join("\n")),H.appendChild(k));0<T.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,T.join("\n")),H.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,
-u,H){var P=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(P/k,P/u))};Editor.prototype.exportToCanvas=function(k,u,H,P,T,W,fa,X,ea,oa,la,ca,sa,xa,qa,Ba,ma,ta){try{W=null!=W?W:!0;fa=null!=fa?fa:!0;ca=null!=ca?ca:this.graph;sa=null!=sa?sa:0;var va=ea?null:ca.background;va==mxConstants.NONE&&(va=null);null==va&&(va=P);null==va&&0==ea&&(va=Editor.getDefaultPageBackgroundColor());this.convertImages(ca.getSvg(null,null,sa,xa,null,fa,null,null,null,oa,null,Ba,ma,ta),mxUtils.bind(this,function(Ha){try{Ha.style.setProperty("-webkit-font-smoothing",
-"antialiased");Ha.style.setProperty("-moz-osx-font-smoothing","grayscale");var La=new Image;La.onload=mxUtils.bind(this,function(){try{var Ca=function(){mxClient.IS_SF?window.setTimeout(function(){Oa.drawImage(La,0,0);k(Pa,Ha)},0):(Oa.drawImage(La,0,0),k(Pa,Ha))},Pa=document.createElement("canvas"),Ka=parseInt(Ha.getAttribute("width")),Na=parseInt(Ha.getAttribute("height"));X=null!=X?X:1;null!=u&&(X=W?Math.min(1,Math.min(3*u/(4*Na),u/Ka)):u/Ka);X=this.getMaxCanvasScale(Ka,Na,X);Ka=Math.ceil(X*Ka);
-Na=Math.ceil(X*Na);Pa.setAttribute("width",Ka);Pa.setAttribute("height",Na);var Oa=Pa.getContext("2d");if(null!=va){var Ea=mxUtils.getLightDarkColor(va);Oa.beginPath();Oa.rect(0,0,Ka,Na);Oa.fillStyle="dark"==Ba&&"none"!=ca.getAdaptiveColors()?Ea.dark:Ea.light;Oa.fill()}1!=X&&Oa.scale(X,X);if(qa){var Aa=ca.view,Ja=Aa.scale;Aa.scale=1;var Ga=btoa(unescape(encodeURIComponent(Aa.createSvgGrid(Aa.gridColor))));Aa.scale=Ja;Ga="data:image/svg+xml;base64,"+Ga;var Ua=ca.gridSize*Aa.gridSteps*X,ab=ca.getGraphBounds(),
-Wa=Aa.translate.x*Ja,cb=Aa.translate.y*Ja,hb=Wa+(ab.x-Wa)/Ja-sa,wb=cb+(ab.y-cb)/Ja-sa,Fa=new Image;Fa.onload=function(){try{for(var Ra=-Math.round(Ua-mxUtils.mod((Wa-hb)*X,Ua)),$a=-Math.round(Ua-mxUtils.mod((cb-wb)*X,Ua));Ra<Ka;Ra+=Ua)for(var fb=$a;fb<Na;fb+=Ua)Oa.drawImage(Fa,Ra/X,fb/X);Ca()}catch(rb){null!=T&&T(rb)}};Fa.onerror=function(Ra){null!=T&&T(Ra)};Fa.src=Ga}else Ca()}catch(Ra){null!=T&&T(Ra)}});La.onerror=function(Ca){null!=T&&T(Ca)};oa&&this.graph.addSvgShadow(Ha);this.graph.mathEnabled&&
-this.addMathCss(Ha);var Ia=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ha,this.resolvedFontCss),La.src=Editor.createSvgDataUri(mxUtils.getXml(Ha))}catch(Ca){null!=T&&T(Ca)}});this.embedExtFonts(mxUtils.bind(this,function(Ca){try{null!=Ca&&this.addFontCss(Ha,Ca),this.loadFonts(Ia)}catch(Pa){null!=T&&T(Pa)}}))}catch(Ca){null!=T&&T(Ca)}}),H,la)}catch(Ha){null!=T&&T(Ha)}};Editor.crcTable=[];for(var n=0;256>n;n++)for(var y=n,C=0;8>C;C++)y=1==(y&1)?3988292384^y>>>1:y>>>
-1,Editor.crcTable[n]=y;Editor.updateCRC=function(k,u,H,P){for(var T=0;T<P;T++)k=Editor.crcTable[(k^u.charCodeAt(H+T))&255]^k>>>8;return k};Editor.crc32=function(k){for(var u=-1,H=0;H<k.length;H++)u=u>>>8^Editor.crcTable[(u^k.charCodeAt(H))&255];return(u^-1)>>>0};Editor.writeGraphModelToPng=function(k,u,H,P,T){function W(la,ca){var sa=ea;ea+=ca;return la.substring(sa,ea)}function fa(la){la=W(la,4);return la.charCodeAt(3)+(la.charCodeAt(2)<<8)+(la.charCodeAt(1)<<16)+(la.charCodeAt(0)<<24)}function X(la){return String.fromCharCode(la>>
-24&255,la>>16&255,la>>8&255,la&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var ea=0;if(W(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=T&&T();else if(W(k,4),"IHDR"!=W(k,4))null!=T&&T();else{W(k,17);T=k.substring(0,ea);do{var oa=fa(k);if("IDAT"==W(k,4)){T=k.substring(0,ea-8);"pHYs"==u&&"dpi"==H?(H=Math.round(P/.0254),H=X(H)+X(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==u?String.fromCharCode(0):"")+P;P=4294967295;P=
-Editor.updateCRC(P,u,0,4);P=Editor.updateCRC(P,H,0,H.length);T+=X(H.length)+u+H+X(P^4294967295);T+=k.substring(ea-8,k.length);break}T+=k.substring(ea-8,ea-4+oa);W(k,oa);W(k,4)}while(oa);return"data:image/png;base64,"+(window.btoa?btoa(T):Base64.encode(T,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var O=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,u){O.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
+Ua.src=Oa}};Na()}catch(Oa){U()}}))});H("image","xlink:href");H("img","src");oa();ka();U()};Editor.base64Encode=function(k){for(var u="",H=0,P=k.length,U,W,fa;H<P;){U=k.charCodeAt(H++)&255;if(H==P){u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((U&3)<<4);u+="==";break}W=k.charCodeAt(H++);if(H==P){u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((U&
+3)<<4|(W&240)>>4);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2);u+="=";break}fa=k.charCodeAt(H++);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U>>2);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((U&3)<<4|(W&240)>>4);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2|(fa&192)>>6);u+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(fa&
+63)}return u};Editor.prototype.loadUrl=function(k,u,H,P,U,W,fa,X){try{var ea=!fa&&(P||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));U=null!=U?U:!0;var oa=mxUtils.bind(this,function(){mxUtils.get(k,mxUtils.bind(this,function(ka){200<=ka.getStatus()&&299>=ka.getStatus()?null!=u&&(ka=ka.getText(),ea&&(W=null!=W?W:"data:image/png;base64,",ka=W+Editor.base64Encode(ka)),u(ka)):null!=H&&(0==ka.getStatus()?H({message:mxResources.get("accessDenied")},
+ka):404==ka.getStatus()?H({message:mxResources.get("fileNotFound"),code:ka.getStatus()},ka):H({message:this.getErrorMessage(ka)},ka))}),function(ka){null!=H&&H({message:mxResources.get("error")+" "+ka.getStatus()})},ea,this.timeout,function(){U&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:oa})},X)});oa()}catch(ka){null!=H&&H(ka)}};Editor.prototype.getErrorMessage=function(k){var u=mxResources.get("error")+" "+k.getStatus();try{var H=k.getText(),P=JSON.parse(H);null!=P&&null!=P.error&&null!=P.error.message&&
+(u=P.error.message+" ("+u+")")}catch(U){}return u};Editor.prototype.absoluteCssFonts=function(k){var u=null;if(null!=k){var H=k.split("url(");if(0<H.length){u=[H[0]];k=window.location.pathname;var P=null!=k?k.lastIndexOf("/"):-1;0<=P&&(k=k.substring(0,P+1));P=document.getElementsByTagName("base");var U=null;null!=P&&0<P.length&&(U=P[0].getAttribute("href"));for(var W=1;W<H.length;W++)if(P=H[W].indexOf(")"),0<P){var fa=Editor.trimCssUrl(H[W].substring(0,P));this.graph.isRelativeUrl(fa)&&(fa=null!=
+U?U+fa:window.location.protocol+"//"+window.location.hostname+("/"==fa.charAt(0)?"":k)+fa);u.push('url("'+fa+'"'+H[W].substring(P))}else u.push(H[W])}else u=[k]}return null!=u?u.join(""):null};Editor.prototype.mapFontUrl=function(k,u,H){/^https?:\/\//.test(u)&&!this.isCorsEnabledForUrl(u)&&(u=PROXY_URL+"?url="+encodeURIComponent(u));H(k,u)};Editor.prototype.embedCssFonts=function(k,u){var H=k.split("url("),P=0;null==this.cachedFonts&&(this.cachedFonts=Object.create(null));var U=mxUtils.bind(this,
+function(){if(0==P){for(var ea=[H[0]],oa=1;oa<H.length;oa++){var ka=H[oa].indexOf(")");ea.push('url("');ea.push(this.cachedFonts[Editor.trimCssUrl(H[oa].substring(0,ka))]);ea.push('"'+H[oa].substring(ka))}u(ea.join(""))}});if(0<H.length){for(k=1;k<H.length;k++){var W=H[k].indexOf(")"),fa=null,X=H[k].indexOf("format(",W);0<X&&(fa=Editor.trimCssUrl(H[k].substring(X+7,H[k].indexOf(")",X))));mxUtils.bind(this,function(ea){var oa=this.cachedFonts[ea];if(null==oa){var ka=[];this.cachedFonts[ea]=ka;P++;
+oa="application/x-font-ttf";if("svg"==fa||/(\.svg)($|\?)/i.test(ea))oa="image/svg+xml";else if("otf"==fa||"embedded-opentype"==fa||/(\.otf)($|\?)/i.test(ea))oa="application/x-font-opentype";else if("woff"==fa||/(\.woff)($|\?)/i.test(ea))oa="application/font-woff";else if("woff2"==fa||/(\.woff2)($|\?)/i.test(ea))oa="application/font-woff2";else if("eot"==fa||/(\.eot)($|\?)/i.test(ea))oa="application/vnd.ms-fontobject";else if("sfnt"==fa||/(\.sfnt)($|\?)/i.test(ea))oa="application/font-sfnt";var ba=
+mxUtils.bind(this,function(sa){this.cachedFonts[ea]=sa;P--;U();for(sa=0;sa<ka.length;sa++)ka[sa]()});this.mapFontUrl(oa,ea,mxUtils.bind(this,function(sa,xa){this.loadUrl(xa,function(qa){ba(qa)},function(qa){ba(ea)},!0,null,"data:"+sa+";charset=utf-8;base64,")}))}else"string"!=typeof oa&&(P++,oa.push(function(){P--;U()}))})(Editor.trimCssUrl(H[k].substring(0,W)),fa)}U()}else u(k)};Editor.prototype.loadFonts=function(k){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,
+mxUtils.bind(this,function(u){this.resolvedFontCss=u;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=function(){var k={},u;for(u in Graph.fontMapping)Graph.isCssFontUrl(u)&&(k[u]=Graph.fontMapping[u]);return k};Editor.prototype.embedExtFonts=function(k,u){u=this.graph.getCustomFonts(u);if(0<u.length){var H=[],P=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var U=mxUtils.bind(this,function(){0==P&&this.embedCssFonts(H.join(""),k)}),W=
+0;W<u.length;W++)mxUtils.bind(this,function(fa,X){Graph.isCssFontUrl(X)?null==this.cachedGoogleFonts[X]?(P++,this.loadUrl(Graph.rewriteGoogleFontUrl(X),mxUtils.bind(this,function(ea){this.cachedGoogleFonts[X]=ea;H.push(ea+"\n");P--;U()}),mxUtils.bind(this,function(ea){P--;H.push('@import url("'+Graph.escapeCssString(X)+'");\n');U()}))):H.push(this.cachedGoogleFonts[X]+"\n"):H.push('@font-face {font-family: "'+Graph.escapeCssString(fa)+'";src: url("'+Graph.escapeCssString(X)+'")}\n')})(u[W].name,u[W].url);
+U()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var u=document.getElementsByTagName("style"),H=0;H<u.length;H++){var P=mxUtils.getTextContent(u[H]);0>P.indexOf("mxPageSelector")&&0<P.indexOf("MathJax")&&k[0].appendChild(u[H].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,u){u=null!=u?u:this.absoluteCssFonts(this.fontCss);if(null!=u){var H=mxUtils.getSvgDefs(k),P=u.split("\n");u=[];for(var U=[],W=0;W<P.length;W++)"@import"==
+P[W].substring(0,7)?u.push(P[W]):U.push(P[W]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");k.setAttribute("type","text/css");0<u.length&&(mxUtils.setTextContent(k,u.join("\n")),H.appendChild(k));0<U.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,U.join("\n")),H.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,
+u,H){var P=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(P/k,P/u))};Editor.prototype.exportToCanvas=function(k,u,H,P,U,W,fa,X,ea,oa,ka,ba,sa,xa,qa,Ba,ma,ta){try{W=null!=W?W:!0;fa=null!=fa?fa:!0;ba=null!=ba?ba:this.graph;sa=null!=sa?sa:0;var va=ea?null:ba.background;va==mxConstants.NONE&&(va=null);null==va&&(va=P);null==va&&0==ea&&(va=Editor.getDefaultPageBackgroundColor());this.convertImages(ba.getSvg(null,null,sa,xa,null,fa,null,null,null,oa,null,Ba,ma,ta),mxUtils.bind(this,function(Ga){try{Ga.style.setProperty("-webkit-font-smoothing",
+"antialiased");Ga.style.setProperty("-moz-osx-font-smoothing","grayscale");var La=new Image;La.onload=mxUtils.bind(this,function(){try{var Ca=function(){mxClient.IS_SF?window.setTimeout(function(){Oa.drawImage(La,0,0);k(Pa,Ga)},0):(Oa.drawImage(La,0,0),k(Pa,Ga))},Pa=document.createElement("canvas"),Ka=parseInt(Ga.getAttribute("width")),Na=parseInt(Ga.getAttribute("height"));X=null!=X?X:1;null!=u&&(X=W?Math.min(1,Math.min(3*u/(4*Na),u/Ka)):u/Ka);X=this.getMaxCanvasScale(Ka,Na,X);Ka=Math.ceil(X*Ka);
+Na=Math.ceil(X*Na);Pa.setAttribute("width",Ka);Pa.setAttribute("height",Na);var Oa=Pa.getContext("2d");if(null!=va){var Ea=mxUtils.getLightDarkColor(va);Oa.beginPath();Oa.rect(0,0,Ka,Na);Oa.fillStyle="dark"==Ba&&"none"!=ba.getAdaptiveColors()?Ea.dark:Ea.light;Oa.fill()}1!=X&&Oa.scale(X,X);if(qa){var Aa=ba.view,Ja=Aa.scale;Aa.scale=1;var Ha=btoa(unescape(encodeURIComponent(Aa.createSvgGrid(Aa.gridColor))));Aa.scale=Ja;Ha="data:image/svg+xml;base64,"+Ha;var Ua=ba.gridSize*Aa.gridSteps*X,ab=ba.getGraphBounds(),
+Wa=Aa.translate.x*Ja,cb=Aa.translate.y*Ja,hb=Wa+(ab.x-Wa)/Ja-sa,wb=cb+(ab.y-cb)/Ja-sa,Fa=new Image;Fa.onload=function(){try{for(var Ra=-Math.round(Ua-mxUtils.mod((Wa-hb)*X,Ua)),$a=-Math.round(Ua-mxUtils.mod((cb-wb)*X,Ua));Ra<Ka;Ra+=Ua)for(var fb=$a;fb<Na;fb+=Ua)Oa.drawImage(Fa,Ra/X,fb/X);Ca()}catch(rb){null!=U&&U(rb)}};Fa.onerror=function(Ra){null!=U&&U(Ra)};Fa.src=Ha}else Ca()}catch(Ra){null!=U&&U(Ra)}});La.onerror=function(Ca){null!=U&&U(Ca)};oa&&this.graph.addSvgShadow(Ga);this.graph.mathEnabled&&
+this.addMathCss(Ga);var Ia=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ga,this.resolvedFontCss),La.src=Editor.createSvgDataUri(mxUtils.getXml(Ga))}catch(Ca){null!=U&&U(Ca)}});this.embedExtFonts(mxUtils.bind(this,function(Ca){try{null!=Ca&&this.addFontCss(Ga,Ca),this.loadFonts(Ia)}catch(Pa){null!=U&&U(Pa)}}))}catch(Ca){null!=U&&U(Ca)}}),H,ka)}catch(Ga){null!=U&&U(Ga)}};Editor.crcTable=[];for(var n=0;256>n;n++)for(var y=n,C=0;8>C;C++)y=1==(y&1)?3988292384^y>>>1:y>>>
+1,Editor.crcTable[n]=y;Editor.updateCRC=function(k,u,H,P){for(var U=0;U<P;U++)k=Editor.crcTable[(k^u.charCodeAt(H+U))&255]^k>>>8;return k};Editor.crc32=function(k){for(var u=-1,H=0;H<k.length;H++)u=u>>>8^Editor.crcTable[(u^k.charCodeAt(H))&255];return(u^-1)>>>0};Editor.writeGraphModelToPng=function(k,u,H,P,U){function W(ka,ba){var sa=ea;ea+=ba;return ka.substring(sa,ea)}function fa(ka){ka=W(ka,4);return ka.charCodeAt(3)+(ka.charCodeAt(2)<<8)+(ka.charCodeAt(1)<<16)+(ka.charCodeAt(0)<<24)}function X(ka){return String.fromCharCode(ka>>
+24&255,ka>>16&255,ka>>8&255,ka&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var ea=0;if(W(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=U&&U();else if(W(k,4),"IHDR"!=W(k,4))null!=U&&U();else{W(k,17);U=k.substring(0,ea);do{var oa=fa(k);if("IDAT"==W(k,4)){U=k.substring(0,ea-8);"pHYs"==u&&"dpi"==H?(H=Math.round(P/.0254),H=X(H)+X(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==u?String.fromCharCode(0):"")+P;P=4294967295;P=
+Editor.updateCRC(P,u,0,4);P=Editor.updateCRC(P,H,0,H.length);U+=X(H.length)+u+H+X(P^4294967295);U+=k.substring(ea-8,k.length);break}U+=k.substring(ea-8,ea-4+oa);W(k,oa);W(k,4)}while(oa);return"data:image/png;base64,"+(window.btoa?btoa(U):Base64.encode(U,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var O=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,u){O.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
mxSettings.save()};var F=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){F.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(k,u,H){var P=null;if(null!=H)return null;null!=k.editor.graph.getModel().getParent(u)?P=u.getId():null!=k.currentPage&&(P=k.currentPage.getId());return P});if(null!=window.StyleFormatPanel){var N=Format.prototype.init;Format.prototype.init=
function(){N.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var R=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?R.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=
function(k){k=c.apply(this,arguments);var u=this.editorUi,H=u.editor.graph;if(H.isEnabled()){var P=u.getCurrentFile();null!=P&&P.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return u.editor.autosave},function(W){u.editor.setAutosave(W);u.editor.autosave&&P.isModified()&&P.fileChanged()},{install:function(W){this.listener=function(){W(u.editor.autosave)};u.editor.addListener("autosaveChanged",this.listener)},destroy:function(){u.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&
-H.isEnabled()&&"undefined"!==typeof MathJax){var T=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(W){u.actions.get("mathematicalTypesetting").funct()},{install:function(W){this.listener=function(){W(H.mathEnabled)};u.addListener("mathEnabledChanged",this.listener)},destroy:function(){u.removeListener(this.listener)}});k.appendChild(T);(!u.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&T.appendChild(u.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};
+H.isEnabled()&&"undefined"!==typeof MathJax){var U=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(W){u.actions.get("mathematicalTypesetting").funct()},{install:function(W){this.listener=function(){W(H.mathEnabled)};u.addListener("mathEnabledChanged",this.listener)},destroy:function(){u.removeListener(this.listener)}});k.appendChild(U);(!u.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&U.appendChild(u.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};
mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(k,u){return 0<mxUtils.getValue(k.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=
[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(k,u){return 0<mxUtils.getValue(k.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=
[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",
@@ -3983,163 +3983,165 @@ font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2"
{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",
gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",
stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),
-k.customProperties,k))};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var u=this.editorUi.getSelectionState();1==u.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=u.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);l.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(k,u,H,P){function T(Oa,Ea,Aa,Ja,Ga){if(null!=Aa.valueChanged)Aa.valueChanged(Ea,Ga,H,ca);
-else{sa.getModel().beginUpdate();try{Ga=[];var Ua=[];if(null!=Aa.index){for(var ab=[],Wa=Aa.parentRow.nextSibling;Wa&&Wa.getAttribute("data-pName")==Oa;)ab.push(Wa.getAttribute("data-pValue")),Wa=Wa.nextSibling;Aa.index<ab.length?null!=Ja?ab.splice(Ja,1):ab[Aa.index]=Ea:ab.push(Ea);null!=Aa.size&&ab.length>Aa.size&&(ab=ab.slice(0,Aa.size));Ea=ab.join(",");null!=Aa.countProperty&&(sa.setCellStyles(Aa.countProperty,ab.length,sa.getSelectionCells()),Ga.push(Aa.countProperty),Ua.push(ab.length))}sa.setCellStyles(Oa,
-Ea,sa.getSelectionCells());Ga.push(Oa);Ua.push(Ea);if(null!=Aa.dependentProps)for(Oa=0;Oa<Aa.dependentProps.length;Oa++){var cb=Aa.dependentPropsDefVal[Oa],hb=Aa.dependentPropsVals[Oa];if(hb.length>Ea)hb=hb.slice(0,Ea);else for(var wb=hb.length;wb<Ea;wb++)hb.push(cb);hb=hb.join(",");sa.setCellStyles(Aa.dependentProps[Oa],hb,sa.getSelectionCells());Ga.push(Aa.dependentProps[Oa]);Ua.push(hb)}if("function"==typeof Aa.onChange)Aa.onChange(sa,Ea);ca.editorUi.fireEvent(new mxEventObject("styleChanged",
-"keys",Ga,"values",Ua,"cells",sa.getSelectionCells()))}finally{sa.getModel().endUpdate()}}}function W(Oa,Ea){Ea.style.left="0px";Ea.style.top="0px";Ea.style.position="relative";Ea.style.right="0px";Ea.style.bottom="0px";Ea.style.width="100%";Ea.style.maxWidth="100%";Ea.style.maxHeight="100%";Ea.style.textAlign="left"}function fa(Oa,Ea,Aa){function Ja(Ua){if(null==Ua||Ua==mxConstants.NONE)Ga.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==Ua)Ga.style.background="";else{var ab=
-mxUtils.getLightDarkColor(Ua);mxUtils.isLightDarkColor(Ua)&&ab.light!=ab.dark?Ga.style.background="linear-gradient(to right bottom, "+ab.cssText+" 50%, "+mxUtils.invertLightDarkColor(ab).cssText+" 50.3%)":Ga.style.background=Ua}}var Ga=document.createElement("div");Ga.style.width="32px";Ga.style.height="8px";Ga.style.margin="2px";Ga.style.borderStyle="solid";Ga.style.borderWidth="1px";Ja(Ea);btn=mxUtils.button("",mxUtils.bind(ca,function(Ua){this.editorUi.pickColor(Ea,function(ab){T(Oa,ab,Aa);Ja(ab)});
-mxEvent.consume(Ua)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Ga);return btn}function X(Oa,Ea,Aa,Ja,Ga,Ua,ab){null!=Ea&&(Ea=Ea.split(","),xa.push({name:Oa,values:Ea,type:Aa,defVal:Ja,countProperty:Ga,parentRow:Ua,isDeletable:!0,flipBkg:ab}));btn=mxUtils.button("+",mxUtils.bind(ca,function(Wa){for(var cb=Ua,hb=0;null!=cb.nextSibling;)if(cb.nextSibling.getAttribute("data-pName")==Oa)cb=cb.nextSibling,
-hb++;else break;var wb={type:Aa,parentRow:Ua,index:hb,isDeletable:!0,defVal:Ja,countProperty:Ga};hb=la(Oa,"",wb,0==hb%2,ab);T(Oa,Ja,wb);cb.parentNode.insertBefore(hb,cb.nextSibling);mxEvent.consume(Wa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ea(Oa,Ea,Aa,Ja,Ga,Ua,ab){if(0<Ga){var Wa=Array(Ga);Ea=null!=Ea?Ea.split(","):[];for(var cb=0;cb<Ga;cb++)Wa[cb]=null!=Ea[cb]?Ea[cb]:null!=Ja?Ja:"";xa.push({name:Oa,values:Wa,type:Aa,defVal:Ja,parentRow:Ua,
-flipBkg:ab,size:Ga})}return document.createElement("div")}function oa(Oa,Ea,Aa){var Ja=document.createElement("input");Ja.type="checkbox";Ja.checked="1"==Ea;mxEvent.addListener(Ja,"change",function(){T(Oa,Ja.checked?"1":"0",Aa,null,Ja)});return Ja}function la(Oa,Ea,Aa,Ja,Ga){var Ua=Aa.dispName,ab=Aa.type,Wa=document.createElement("tr");Wa.className="gePropRow"+(Ga?"Dark":"")+(Ja?"Alt":"")+" gePropNonHeaderRow";Wa.setAttribute("data-pName",Oa);Wa.setAttribute("data-pValue",Ea);Ja=!1;null!=Aa.index&&
-(Wa.setAttribute("data-index",Aa.index),Ua=(null!=Ua?Ua:"")+"["+Aa.index+"]",Ja=!0);var cb=document.createElement("td");cb.className="gePropRowCell";Ua=mxResources.get(Ua,null,Ua);mxUtils.write(cb,Ua);cb.setAttribute("title",Ua);Ja&&(cb.style.textAlign="right");Wa.appendChild(cb);cb=document.createElement("td");cb.className="gePropRowCell";cb.setAttribute("title",null!=Ea?mxUtils.safeDecodeURIComponent(Ea):mxResources.get("none"));mxEvent.addListener(cb,"click",mxUtils.bind(ca,function(Ra){!mxUtils.isAncestorNode(Wa,
-document.activeElement)&&mxUtils.isAncestorNode(Wa.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(Ra))}));if("color"==ab)cb.appendChild(fa(Oa,Ea,Aa));else if("bool"==ab||"boolean"==ab)cb.appendChild(oa(Oa,Ea,Aa));else if("enum"==ab){var hb=Aa.enumList;cb.innerHTML="";var wb=document.createElement("div");wb.className="gePropValue";cb.appendChild(wb);for(Ga=0;Ga<hb.length;Ga++)if(Ua=hb[Ga],Ua.val==Ea){mxUtils.write(wb,
-mxResources.get(Ua.dispName,null,Ua.dispName));break}mxEvent.addListener(cb,"click",mxUtils.bind(ca,function(Ra){var $a=mxEvent.getSource(Ra);if(!($a!=cb&&$a!=wb||mxEvent.isConsumed(Ra))){wb.innerHTML="";var fb=document.createElement("select"),rb=null;W(cb,fb);fb.style.boxSizing="border-box";fb.style.height="100%";fb.style.padding="0";fb.style.margin="0";fb.style.border="0";for(Ra=0;Ra<hb.length;Ra++){$a=hb[Ra];var mb=document.createElement("option");mb.value=mxUtils.htmlEntities($a.val);mxUtils.write(mb,
-mxResources.get($a.dispName,null,$a.dispName));fb.appendChild(mb);null==$a.val&&(mb.value="null",rb=mb)}fb.value=null==Ea&&null!=rb?"null":Ea;wb.appendChild(fb);mxEvent.addListener(fb,"change",function(){var ub=mxUtils.htmlEntities(fb.value);if(fb[fb.selectedIndex]==rb||"null"==ub.value)ub=null;T(Oa,ub,Aa)});fb.focus();mxEvent.addListener(fb,"blur",function(){wb.innerHTML="";for(var ub=fb[fb.selectedIndex]==rb||"null"==fb.value?null:fb.value,Eb=0;Eb<hb.length;Eb++){var Fb=hb[Eb];if(Fb.val==ub){mxUtils.write(wb,
-mxResources.get(Fb.dispName,null,Fb.dispName));break}}})}}))}else if("dynamicArr"==ab)cb.appendChild(X(Oa,Ea,Aa.subType,Aa.subDefVal,Aa.countProperty,Wa,Ga));else if("staticArr"==ab)cb.appendChild(ea(Oa,Ea,Aa.subType,Aa.subDefVal,Aa.size,Wa,Ga));else if("readOnly"==ab)Ga=document.createElement("input"),Ga.setAttribute("readonly",""),Ga.value=Ea,Ga.style.borderWidth="0px","id"==Oa||"shape"==Oa?(Wa.firstChild.innerHTML="",Wa.firstChild.setAttribute("colspan","2"),Ga.style.flexGrow="1",Ga.style.marginLeft=
-"4px",Ga.style.textAlign="id"==Oa?"center":"left",Ga.setAttribute("title",Ea),Ua=document.createElement("div"),mxUtils.write(Ua,mxResources.get(Oa)+":"),Ua.style.display="inline-flex",Ua.style.alignItems="center",Ua.style.width="100%",Ua.appendChild(Ga),Wa.firstChild.appendChild(Ua)):(Ga.style.width="96px",cb.appendChild(Ga));else{cb.innerHTML="";var Fa=document.createElement("div");Fa.className="gePropValue";cb.appendChild(Fa);Fa.innerHTML=mxUtils.htmlEntities(mxUtils.safeDecodeURIComponent(Ea));
-mxEvent.addListener(cb,"click",mxUtils.bind(ca,function(Ra){function $a(){var mb=rb.value,ub=ab;mb=0==mb.trim().length&&"string"!=ub&&"numbers"!=ub?Aa.allowAuto?"auto":0:mb;Aa.allowAuto&&(null!=mb.trim&&"auto"==mb.trim().toLowerCase()?(mb="auto",ub="string"):(mb=parseFloat(mb),mb=isNaN(mb)?0:mb));null!=Aa.min&&mb<Aa.min?mb=Aa.min:null!=Aa.max&&mb>Aa.max&&(mb=Aa.max);var Eb=null;try{Eb="numbers"==ub?mb.match(/\d*\.?\d+/g).map(Number).join(" "):"auto"===mb&&Aa.allowAuto&&"auto"==Aa.defVal?null:encodeURIComponent(("int"==
-ub?parseInt(mb):mb)+"")}catch(Fb){}T(Oa,Eb,Aa,null,rb)}var fb=mxEvent.getSource(Ra);if(!(fb!=cb&&fb!=Fa||mxEvent.isConsumed(Ra))){Fa.innerHTML="";var rb=document.createElement("input");W(Fa,rb);rb.value=mxUtils.safeDecodeURIComponent(Ea);rb.className="gePropEditor";"int"!=ab&&"float"!=ab||Aa.allowAuto||(rb.type="number",rb.step="int"==ab?"1":"any",null!=Aa.min&&(rb.min=parseFloat(Aa.min)),null!=Aa.max&&(rb.max=parseFloat(Aa.max)));Fa.appendChild(rb);mxEvent.addListener(rb,"keypress",function(mb){13==
-mb.keyCode&&$a()});rb.focus();mxEvent.addListener(rb,"blur",function(){$a()})}}))}Aa.isDeletable&&(Ga=mxUtils.button("-",mxUtils.bind(ca,function(Ra){T(Oa,"",Aa,Aa.index);mxEvent.consume(Ra)})),Ga.style.height="16px",Ga.style.width="25px",Ga.style.float="right",Ga.className="geColorBtn",cb.appendChild(Ga));Wa.appendChild(cb);return Wa}var ca=this,sa=this.editorUi.editor.graph,xa=[],qa=document.createElement("table");qa.className="geProperties geFullWidthElement";var Ba=document.createElement("tr");
-Ba.className="gePropHeader";var ma=document.createElement("th");ma.className="gePropHeaderCell";ma.style.paddingLeft="16px";ma.style.backgroundRepeat="no-repeat";ma.style.backgroundPosition="-2px 50%";ma.style.backgroundSize="20px";mxUtils.write(ma,mxResources.get("property"));Ba.style.cursor="pointer";var ta=function(){var Oa=qa.querySelectorAll(".gePropNonHeaderRow");if(ca.editorUi.propertiesCollapsed){ma.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Ea="none";for(var Aa=k.childNodes.length-
-1;0<=Aa;Aa--)try{var Ja=k.childNodes[Aa],Ga=Ja.nodeName.toUpperCase();"INPUT"!=Ga&&"SELECT"!=Ga||k.removeChild(Ja)}catch(Ua){}}else ma.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Ea="";for(Aa=0;Aa<Oa.length;Aa++)Oa[Aa].style.display=Ea};mxEvent.addListener(Ba,"click",function(){ca.editorUi.propertiesCollapsed=!ca.editorUi.propertiesCollapsed;ta()});Ba.appendChild(ma);var va=document.createElement("th");va.className="gePropHeaderCell";va.style.paddingLeft="4px";mxUtils.write(va,mxResources.get("value"));
-Ba.appendChild(va);qa.appendChild(Ba);var Ha=va=!1;Ba=null;1==H.vertices.length&&0==H.edges.length?Ba=H.vertices[0].id:0==H.vertices.length&&1==H.edges.length&&(Ba=H.edges[0].id);null==Ba||P||(qa.appendChild(la("id",mxUtils.htmlEntities(Ba),{dispName:"id",type:"readOnly"},!0,!1)),null!=H.style&&null!=H.style.shape&&qa.appendChild(la("shape",mxUtils.htmlEntities(H.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var La in u)if(P=u[La],("function"!=typeof P.isVisible||P.isVisible(H,this))&&
-!P.primary){var Ia=null!=P.getValue?P.getValue(H,this):null!=H.style[La]?mxUtils.htmlEntities(H.style[La]+""):null!=P.getDefaultValue?P.getDefaultValue(H,this):P.defVal;if("separator"==P.type)Ha=!Ha;else{if("staticArr"==P.type)P.size=parseInt(H.style[P.sizeProperty]||u[P.sizeProperty].defVal)||0;else if(null!=P.dependentProps){var Ca=P.dependentProps,Pa=[],Ka=[];for(Ba=0;Ba<Ca.length;Ba++)if(null!=u[Ca[Ba]]){var Na=H.style[Ca[Ba]];Ka.push(u[Ca[Ba]].subDefVal);Pa.push(null!=Na?Na.split(","):[])}P.dependentPropsDefVal=
-Ka;P.dependentPropsVals=Pa}qa.appendChild(la(La,Ia,P,va,Ha));va=!va}}for(Ba=0;Ba<xa.length;Ba++)for(P=xa[Ba],u=P.parentRow,La=0;La<P.values.length;La++)va=la(P.name,P.values[La],{type:P.type,parentRow:P.parentRow,isDeletable:P.isDeletable,index:La,defVal:P.defVal,countProperty:P.countProperty,size:P.size},0==La%2,P.flipBkg),u.parentNode.insertBefore(va,u.nextSibling),u=va;k.appendChild(qa);ta();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var u=this.editorUi,
-H=u.editor.graph,P=document.createElement("div");P.style.padding="6px 20px 0 24px";k.appendChild(P);var T=document.createElement("div");T.className="geSwitcher";T.style.padding="4px 18px 6px 0px";for(var W=[],fa=0;fa<this.defaultColorSchemes.length;fa++){var X=document.createElement("div");X.className="geSwitcherDot";mxUtils.bind(this,function(sa){mxEvent.addListener(X,"click",mxUtils.bind(this,function(){ea(sa)}))})(fa);W.push(X);T.appendChild(X)}var ea=mxUtils.bind(this,function(sa){null!=W[sa]&&
+k.customProperties,k))};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var u=this.editorUi.getSelectionState();1==u.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=u.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);l.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(k,u,H,P){function U(Oa,Ea,Aa,Ja,Ha){if(null!=Aa.valueChanged)Aa.valueChanged(Ea,Ha,H,ba);
+else{sa.getModel().beginUpdate();try{Ha=[];var Ua=[];if(null!=Aa.index){for(var ab=[],Wa=Aa.parentRow.nextSibling;Wa&&Wa.getAttribute("data-pName")==Oa;)ab.push(Wa.getAttribute("data-pValue")),Wa=Wa.nextSibling;Aa.index<ab.length?null!=Ja?ab.splice(Ja,1):ab[Aa.index]=Ea:ab.push(Ea);null!=Aa.size&&ab.length>Aa.size&&(ab=ab.slice(0,Aa.size));Ea=ab.join(",");null!=Aa.countProperty&&(sa.setCellStyles(Aa.countProperty,ab.length,sa.getSelectionCells()),Ha.push(Aa.countProperty),Ua.push(ab.length))}sa.setCellStyles(Oa,
+Ea,sa.getSelectionCells());Ha.push(Oa);Ua.push(Ea);if(null!=Aa.dependentProps)for(Oa=0;Oa<Aa.dependentProps.length;Oa++){var cb=Aa.dependentPropsDefVal[Oa],hb=Aa.dependentPropsVals[Oa];if(hb.length>Ea)hb=hb.slice(0,Ea);else for(var wb=hb.length;wb<Ea;wb++)hb.push(cb);hb=hb.join(",");sa.setCellStyles(Aa.dependentProps[Oa],hb,sa.getSelectionCells());Ha.push(Aa.dependentProps[Oa]);Ua.push(hb)}if("function"==typeof Aa.onChange)Aa.onChange(sa,Ea);ba.editorUi.fireEvent(new mxEventObject("styleChanged",
+"keys",Ha,"values",Ua,"cells",sa.getSelectionCells()))}finally{sa.getModel().endUpdate()}}}function W(Oa,Ea){Ea.style.left="0px";Ea.style.top="0px";Ea.style.position="relative";Ea.style.right="0px";Ea.style.bottom="0px";Ea.style.width="100%";Ea.style.maxWidth="100%";Ea.style.maxHeight="100%";Ea.style.textAlign="left"}function fa(Oa,Ea,Aa){function Ja(Ua){if(null==Ua||Ua==mxConstants.NONE)Ha.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==Ua)Ha.style.background="";else{var ab=
+mxUtils.getLightDarkColor(Ua);mxUtils.isLightDarkColor(Ua)&&ab.light!=ab.dark?Ha.style.background="linear-gradient(to right bottom, "+ab.cssText+" 50%, "+mxUtils.invertLightDarkColor(ab).cssText+" 50.3%)":Ha.style.background=Ua}}var Ha=document.createElement("div");Ha.style.width="32px";Ha.style.height="8px";Ha.style.margin="2px";Ha.style.borderStyle="solid";Ha.style.borderWidth="1px";Ja(Ea);btn=mxUtils.button("",mxUtils.bind(ba,function(Ua){this.editorUi.pickColor(Ea,function(ab){U(Oa,ab,Aa);Ja(ab)});
+mxEvent.consume(Ua)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Ha);return btn}function X(Oa,Ea,Aa,Ja,Ha,Ua,ab){null!=Ea&&(Ea=Ea.split(","),xa.push({name:Oa,values:Ea,type:Aa,defVal:Ja,countProperty:Ha,parentRow:Ua,isDeletable:!0,flipBkg:ab}));btn=mxUtils.button("+",mxUtils.bind(ba,function(Wa){for(var cb=Ua,hb=0;null!=cb.nextSibling;)if(cb.nextSibling.getAttribute("data-pName")==Oa)cb=cb.nextSibling,
+hb++;else break;var wb={type:Aa,parentRow:Ua,index:hb,isDeletable:!0,defVal:Ja,countProperty:Ha};hb=ka(Oa,"",wb,0==hb%2,ab);U(Oa,Ja,wb);cb.parentNode.insertBefore(hb,cb.nextSibling);mxEvent.consume(Wa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ea(Oa,Ea,Aa,Ja,Ha,Ua,ab){if(0<Ha){var Wa=Array(Ha);Ea=null!=Ea?Ea.split(","):[];for(var cb=0;cb<Ha;cb++)Wa[cb]=null!=Ea[cb]?Ea[cb]:null!=Ja?Ja:"";xa.push({name:Oa,values:Wa,type:Aa,defVal:Ja,parentRow:Ua,
+flipBkg:ab,size:Ha})}return document.createElement("div")}function oa(Oa,Ea,Aa){var Ja=document.createElement("input");Ja.type="checkbox";Ja.checked="1"==Ea;mxEvent.addListener(Ja,"change",function(){U(Oa,Ja.checked?"1":"0",Aa,null,Ja)});return Ja}function ka(Oa,Ea,Aa,Ja,Ha){var Ua=Aa.dispName,ab=Aa.type,Wa=document.createElement("tr");Wa.className="gePropRow"+(Ha?"Dark":"")+(Ja?"Alt":"")+" gePropNonHeaderRow";Wa.setAttribute("data-pName",Oa);Wa.setAttribute("data-pValue",Ea);Ja=!1;null!=Aa.index&&
+(Wa.setAttribute("data-index",Aa.index),Ua=(null!=Ua?Ua:"")+"["+Aa.index+"]",Ja=!0);var cb=document.createElement("td");cb.className="gePropRowCell";Ua=mxResources.get(Ua,null,Ua);mxUtils.write(cb,Ua);cb.setAttribute("title",Ua);Ja&&(cb.style.textAlign="right");Wa.appendChild(cb);cb=document.createElement("td");cb.className="gePropRowCell";cb.setAttribute("title",null!=Ea?mxUtils.safeDecodeURIComponent(Ea):mxResources.get("none"));mxEvent.addListener(cb,"click",mxUtils.bind(ba,function(Ra){!mxUtils.isAncestorNode(Wa,
+document.activeElement)&&mxUtils.isAncestorNode(Wa.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(Ra))}));if("color"==ab)cb.appendChild(fa(Oa,Ea,Aa));else if("bool"==ab||"boolean"==ab)cb.appendChild(oa(Oa,Ea,Aa));else if("enum"==ab){var hb=Aa.enumList;cb.innerHTML="";var wb=document.createElement("div");wb.className="gePropValue";cb.appendChild(wb);for(Ha=0;Ha<hb.length;Ha++)if(Ua=hb[Ha],Ua.val==Ea){mxUtils.write(wb,
+mxResources.get(Ua.dispName,null,Ua.dispName));break}mxEvent.addListener(cb,"click",mxUtils.bind(ba,function(Ra){var $a=mxEvent.getSource(Ra);if(!($a!=cb&&$a!=wb||mxEvent.isConsumed(Ra))){wb.innerHTML="";var fb=document.createElement("select"),rb=null;W(cb,fb);fb.style.boxSizing="border-box";fb.style.height="100%";fb.style.padding="0";fb.style.margin="0";fb.style.border="0";for(Ra=0;Ra<hb.length;Ra++){$a=hb[Ra];var mb=document.createElement("option");mb.value=mxUtils.htmlEntities($a.val);mxUtils.write(mb,
+mxResources.get($a.dispName,null,$a.dispName));fb.appendChild(mb);null==$a.val&&(mb.value="null",rb=mb)}fb.value=null==Ea&&null!=rb?"null":Ea;wb.appendChild(fb);mxEvent.addListener(fb,"change",function(){var ub=mxUtils.htmlEntities(fb.value);if(fb[fb.selectedIndex]==rb||"null"==ub.value)ub=null;U(Oa,ub,Aa)});fb.focus();mxEvent.addListener(fb,"blur",function(){wb.innerHTML="";for(var ub=fb[fb.selectedIndex]==rb||"null"==fb.value?null:fb.value,Eb=0;Eb<hb.length;Eb++){var Fb=hb[Eb];if(Fb.val==ub){mxUtils.write(wb,
+mxResources.get(Fb.dispName,null,Fb.dispName));break}}})}}))}else if("dynamicArr"==ab)cb.appendChild(X(Oa,Ea,Aa.subType,Aa.subDefVal,Aa.countProperty,Wa,Ha));else if("staticArr"==ab)cb.appendChild(ea(Oa,Ea,Aa.subType,Aa.subDefVal,Aa.size,Wa,Ha));else if("readOnly"==ab)Ha=document.createElement("input"),Ha.setAttribute("readonly",""),Ha.value=Ea,Ha.style.borderWidth="0px","id"==Oa||"shape"==Oa?(Wa.firstChild.innerHTML="",Wa.firstChild.setAttribute("colspan","2"),Ha.style.flexGrow="1",Ha.style.marginLeft=
+"4px",Ha.style.textAlign="id"==Oa?"center":"left",Ha.setAttribute("title",Ea),Ua=document.createElement("div"),mxUtils.write(Ua,mxResources.get(Oa)+":"),Ua.style.display="inline-flex",Ua.style.alignItems="center",Ua.style.width="100%",Ua.appendChild(Ha),Wa.firstChild.appendChild(Ua)):(Ha.style.width="96px",cb.appendChild(Ha));else{cb.innerHTML="";var Fa=document.createElement("div");Fa.className="gePropValue";cb.appendChild(Fa);Fa.innerHTML=mxUtils.htmlEntities(mxUtils.safeDecodeURIComponent(Ea));
+mxEvent.addListener(cb,"click",mxUtils.bind(ba,function(Ra){function $a(){var mb=rb.value,ub=ab;mb=0==mb.trim().length&&"string"!=ub&&"numbers"!=ub?Aa.allowAuto?"auto":0:mb;Aa.allowAuto&&(null!=mb.trim&&"auto"==mb.trim().toLowerCase()?(mb="auto",ub="string"):(mb=parseFloat(mb),mb=isNaN(mb)?0:mb));null!=Aa.min&&mb<Aa.min?mb=Aa.min:null!=Aa.max&&mb>Aa.max&&(mb=Aa.max);var Eb=null;try{Eb="numbers"==ub?mb.match(/\d*\.?\d+/g).map(Number).join(" "):"auto"===mb&&Aa.allowAuto&&"auto"==Aa.defVal?null:encodeURIComponent(("int"==
+ub?parseInt(mb):mb)+"")}catch(Fb){}U(Oa,Eb,Aa,null,rb)}var fb=mxEvent.getSource(Ra);if(!(fb!=cb&&fb!=Fa||mxEvent.isConsumed(Ra))){Fa.innerHTML="";var rb=document.createElement("input");W(Fa,rb);rb.value=mxUtils.safeDecodeURIComponent(Ea);rb.className="gePropEditor";"int"!=ab&&"float"!=ab||Aa.allowAuto||(rb.type="number",rb.step="int"==ab?"1":"any",null!=Aa.min&&(rb.min=parseFloat(Aa.min)),null!=Aa.max&&(rb.max=parseFloat(Aa.max)));Fa.appendChild(rb);mxEvent.addListener(rb,"keypress",function(mb){13==
+mb.keyCode&&$a()});rb.focus();mxEvent.addListener(rb,"blur",function(){$a()})}}))}Aa.isDeletable&&(Ha=mxUtils.button("-",mxUtils.bind(ba,function(Ra){U(Oa,"",Aa,Aa.index);mxEvent.consume(Ra)})),Ha.style.height="16px",Ha.style.width="25px",Ha.style.float="right",Ha.className="geColorBtn",cb.appendChild(Ha));Wa.appendChild(cb);return Wa}var ba=this,sa=this.editorUi.editor.graph,xa=[],qa=document.createElement("table");qa.className="geProperties geFullWidthElement";var Ba=document.createElement("tr");
+Ba.className="gePropHeader";var ma=document.createElement("th");ma.className="gePropHeaderCell";ma.style.paddingLeft="16px";ma.style.backgroundRepeat="no-repeat";ma.style.backgroundPosition="-2px 50%";ma.style.backgroundSize="20px";mxUtils.write(ma,mxResources.get("property"));Ba.style.cursor="pointer";var ta=function(){var Oa=qa.querySelectorAll(".gePropNonHeaderRow");if(ba.editorUi.propertiesCollapsed){ma.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Ea="none";for(var Aa=k.childNodes.length-
+1;0<=Aa;Aa--)try{var Ja=k.childNodes[Aa],Ha=Ja.nodeName.toUpperCase();"INPUT"!=Ha&&"SELECT"!=Ha||k.removeChild(Ja)}catch(Ua){}}else ma.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Ea="";for(Aa=0;Aa<Oa.length;Aa++)Oa[Aa].style.display=Ea};mxEvent.addListener(Ba,"click",function(){ba.editorUi.propertiesCollapsed=!ba.editorUi.propertiesCollapsed;ta()});Ba.appendChild(ma);var va=document.createElement("th");va.className="gePropHeaderCell";va.style.paddingLeft="4px";mxUtils.write(va,mxResources.get("value"));
+Ba.appendChild(va);qa.appendChild(Ba);var Ga=va=!1;Ba=null;1==H.vertices.length&&0==H.edges.length?Ba=H.vertices[0].id:0==H.vertices.length&&1==H.edges.length&&(Ba=H.edges[0].id);null==Ba||P||(qa.appendChild(ka("id",mxUtils.htmlEntities(Ba),{dispName:"id",type:"readOnly"},!0,!1)),null!=H.style&&null!=H.style.shape&&qa.appendChild(ka("shape",mxUtils.htmlEntities(H.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var La in u)if(P=u[La],("function"!=typeof P.isVisible||P.isVisible(H,this))&&
+!P.primary){var Ia=null!=P.getValue?P.getValue(H,this):null!=H.style[La]?mxUtils.htmlEntities(H.style[La]+""):null!=P.getDefaultValue?P.getDefaultValue(H,this):P.defVal;if("separator"==P.type)Ga=!Ga;else{if("staticArr"==P.type)P.size=parseInt(H.style[P.sizeProperty]||u[P.sizeProperty].defVal)||0;else if(null!=P.dependentProps){var Ca=P.dependentProps,Pa=[],Ka=[];for(Ba=0;Ba<Ca.length;Ba++)if(null!=u[Ca[Ba]]){var Na=H.style[Ca[Ba]];Ka.push(u[Ca[Ba]].subDefVal);Pa.push(null!=Na?Na.split(","):[])}P.dependentPropsDefVal=
+Ka;P.dependentPropsVals=Pa}qa.appendChild(ka(La,Ia,P,va,Ga));va=!va}}for(Ba=0;Ba<xa.length;Ba++)for(P=xa[Ba],u=P.parentRow,La=0;La<P.values.length;La++)va=ka(P.name,P.values[La],{type:P.type,parentRow:P.parentRow,isDeletable:P.isDeletable,index:La,defVal:P.defVal,countProperty:P.countProperty,size:P.size},0==La%2,P.flipBkg),u.parentNode.insertBefore(va,u.nextSibling),u=va;k.appendChild(qa);ta();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var u=this.editorUi,
+H=u.editor.graph,P=document.createElement("div");P.style.padding="6px 20px 0 24px";k.appendChild(P);var U=document.createElement("div");U.className="geSwitcher";U.style.padding="4px 18px 6px 0px";for(var W=[],fa=0;fa<this.defaultColorSchemes.length;fa++){var X=document.createElement("div");X.className="geSwitcherDot";mxUtils.bind(this,function(sa){mxEvent.addListener(X,"click",mxUtils.bind(this,function(){ea(sa)}))})(fa);W.push(X);U.appendChild(X)}var ea=mxUtils.bind(this,function(sa){null!=W[sa]&&
(null!=this.format.currentScheme&&null!=W[this.format.currentScheme]&&(W[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=sa,oa(this.defaultColorSchemes[this.format.currentScheme]),W[this.format.currentScheme].style.background="#84d7ff")}),oa=mxUtils.bind(this,function(sa){var xa=mxUtils.clone(H.defaultVertexStyle);xa[mxConstants.STYLE_STROKECOLOR]=null!=xa[mxConstants.STYLE_STROKECOLOR]?xa[mxConstants.STYLE_STROKECOLOR]:"default";xa[mxConstants.STYLE_FILLCOLOR]=
null!=xa[mxConstants.STYLE_FILLCOLOR]?xa[mxConstants.STYLE_FILLCOLOR]:"default";xa[mxConstants.STYLE_FONTCOLOR]=null!=xa[mxConstants.STYLE_FONTCOLOR]?xa[mxConstants.STYLE_FONTCOLOR]:"default";H.replaceDefaultColors(new mxCell,xa);var qa=mxUtils.bind(this,function(ma){var ta=mxUtils.button("",mxUtils.bind(this,function(La){H.getModel().beginUpdate();try{for(var Ia=u.getSelectionState().cells,Ca=H.getModel(),Pa=[],Ka=0<Ia.length,Na=0;Na<Ia.length;Na++){var Oa=Ca.isVertex(Ia[Na])&&Ca.isEdge(Ca.getParent(Ia[Na])),
-Ea=H.getCellStyle(Ia[Na]),Aa=null!=Ea&&"image"==Ea.shape,Ja=H.getCellGeometry(Ia[Na]);Pa.push({isLabel:Aa||Oa&&(null==Ja||0>=Ja.width||0>=Ja.height)});Oa||Aa||(Ka=!1)}for(Na=0;Na<Ia.length;Na++){var Ga=Pa[Na];if(Ka||!Ga.isLabel){var Ua=Ga.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,ab=Ga.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,Wa=Ca.getStyle(Ia[Na]);null!=Wa&&"string"!==typeof Wa&&(Wa=String(Wa));null!=ma?(mxEvent.isShiftDown(La)||
-(Wa=""==ma.fill||null==ma.fill?mxUtils.setStyle(Wa,Ua,null):mxUtils.setStyle(Wa,Ua,ma.fill),Ga.isLabel||(Wa=""==ma.gradient||null==ma.gradient?mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,ma.gradient)),mxEvent.isControlDown(La)||mxClient.IS_MAC&&mxEvent.isMetaDown(La)||!Ca.isVertex(Ia[Na])||(Wa=""==ma.font||null==ma.font?mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,ma.font))),
-mxEvent.isAltDown(La)||(Wa=""==ma.stroke||null==ma.stroke?mxUtils.setStyle(Wa,ab,null):mxUtils.setStyle(Wa,ab,ma.stroke))):(Wa=mxUtils.setStyle(Wa,Ua,null),Wa=mxUtils.setStyle(Wa,ab,null),Ga.isLabel||(Wa=mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,null)),Ca.isVertex(Ia[Na])&&(Wa=mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,null)));Ca.setStyle(Ia[Na],Wa)}}}finally{H.getModel().endUpdate()}}));ta.className="geStyleButton";ta.style.width="36px";ta.style.height=10>=this.defaultColorSchemes.length?
+Ea=H.getCellStyle(Ia[Na]),Aa=null!=Ea&&"image"==Ea.shape,Ja=H.getCellGeometry(Ia[Na]);Pa.push({isLabel:Aa||Oa&&(null==Ja||0>=Ja.width||0>=Ja.height)});Oa||Aa||(Ka=!1)}for(Na=0;Na<Ia.length;Na++){var Ha=Pa[Na];if(Ka||!Ha.isLabel){var Ua=Ha.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,ab=Ha.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,Wa=Ca.getStyle(Ia[Na]);null!=Wa&&"string"!==typeof Wa&&(Wa=String(Wa));null!=ma?(mxEvent.isShiftDown(La)||
+(Wa=""==ma.fill||null==ma.fill?mxUtils.setStyle(Wa,Ua,null):mxUtils.setStyle(Wa,Ua,ma.fill),Ha.isLabel||(Wa=""==ma.gradient||null==ma.gradient?mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,ma.gradient)),mxEvent.isControlDown(La)||mxClient.IS_MAC&&mxEvent.isMetaDown(La)||!Ca.isVertex(Ia[Na])||(Wa=""==ma.font||null==ma.font?mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,ma.font))),
+mxEvent.isAltDown(La)||(Wa=""==ma.stroke||null==ma.stroke?mxUtils.setStyle(Wa,ab,null):mxUtils.setStyle(Wa,ab,ma.stroke))):(Wa=mxUtils.setStyle(Wa,Ua,null),Wa=mxUtils.setStyle(Wa,ab,null),Ha.isLabel||(Wa=mxUtils.setStyle(Wa,mxConstants.STYLE_GRADIENTCOLOR,null)),Ca.isVertex(Ia[Na])&&(Wa=mxUtils.setStyle(Wa,mxConstants.STYLE_FONTCOLOR,null)));Ca.setStyle(Ia[Na],Wa)}}}finally{H.getModel().endUpdate()}}));ta.className="geStyleButton";ta.style.width="36px";ta.style.height=10>=this.defaultColorSchemes.length?
"24px":"30px";ta.style.margin="0px 6px 6px 0px";if(null!=ma){var va="1px solid";null!=ma.border&&(va=ma.border);if(null!=ma.gradient)ta.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(ma.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(ma.gradient).cssText+" 100%)";else if(ma.fill==mxConstants.NONE)ta.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==ma.fill||""==ma.fill)ta.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(xa,mxConstants.STYLE_FILLCOLOR,
-"#ffffff")).cssText;else{var Ha=mxUtils.getLightDarkColor(ma.fill);ta.style.backgroundImage="linear-gradient(to right bottom, "+Ha.cssText+" 50%, "+Ha.light+" 50.3%)"}null==ma.stroke||ma.stroke==mxConstants.NONE?ta.style.border=va+" transparent":""==ma.stroke?ta.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(xa,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Ha=mxUtils.getLightDarkColor(ma.stroke),ta.style.border=va+" "+Ha.cssText,ta.style.borderRightColor=Ha.light,ta.style.borderBottomColor=
-ta.style.borderRightColor);null!=ma.title&&ta.setAttribute("title",ma.title)}else va=mxUtils.getValue(xa,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Ha=mxUtils.getValue(xa,mxConstants.STYLE_STROKECOLOR,"#000000"),ta.style.backgroundColor=va,ta.style.border="1px solid "+Ha;ta.style.borderRadius="0";P.appendChild(ta);null!=ma&&null!=ma.gradient&&(va=ta.cloneNode(!1),va.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(ma.fill).light+") 0px, light-dark(transparent, "+
+"#ffffff")).cssText;else{var Ga=mxUtils.getLightDarkColor(ma.fill);ta.style.backgroundImage="linear-gradient(to right bottom, "+Ga.cssText+" 50%, "+Ga.light+" 50.3%)"}null==ma.stroke||ma.stroke==mxConstants.NONE?ta.style.border=va+" transparent":""==ma.stroke?ta.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(xa,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Ga=mxUtils.getLightDarkColor(ma.stroke),ta.style.border=va+" "+Ga.cssText,ta.style.borderRightColor=Ga.light,ta.style.borderBottomColor=
+ta.style.borderRightColor);null!=ma.title&&ta.setAttribute("title",ma.title)}else va=mxUtils.getValue(xa,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Ga=mxUtils.getValue(xa,mxConstants.STYLE_STROKECOLOR,"#000000"),ta.style.backgroundColor=va,ta.style.border="1px solid "+Ga;ta.style.borderRadius="0";P.appendChild(ta);null!=ma&&null!=ma.gradient&&(va=ta.cloneNode(!1),va.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(ma.fill).light+") 0px, light-dark(transparent, "+
mxUtils.getLightDarkColor(ma.gradient).light+") 100%)",va.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",va.style.backgroundColor="transparent",P.appendChild(va),va.style.marginLeft="-42px",mxEvent.addListener(va,"click",function(){ta.click()}))});P.innerText="";if(null!=sa)for(var Ba=0;Ba<sa.length;Ba++)0<Ba&&0==mxUtils.mod(Ba,4)&&mxUtils.br(P),qa(sa[Ba])});null==this.format.currentScheme?ea(Math.min(W.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ea(this.format.currentScheme);
-fa=10>=this.defaultColorSchemes.length?43:23;var la=document.createElement("div");la.className="geButton";la.style.cssText="position:absolute;left:0px;bottom:"+fa+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(la,"click",mxUtils.bind(this,function(){ea(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ca=document.createElement("div");ca.className="geButton";ca.style.cssText="position:absolute;left:186px;bottom:"+fa+"px;width:20px;background-image:url("+
-Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(la),k.appendChild(ca));mxEvent.addListener(ca,"click",mxUtils.bind(this,function(){ea(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));oa(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&k.appendChild(T)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+
+fa=10>=this.defaultColorSchemes.length?43:23;var ka=document.createElement("div");ka.className="geButton";ka.style.cssText="position:absolute;left:0px;bottom:"+fa+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(ka,"click",mxUtils.bind(this,function(){ea(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ba=document.createElement("div");ba.className="geButton";ba.style.cssText="position:absolute;left:186px;bottom:"+fa+"px;width:20px;background-image:url("+
+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(ka),k.appendChild(ba));mxEvent.addListener(ba,"click",mxUtils.bind(this,function(){ea(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));oa(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&k.appendChild(U)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+
STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements=Object.create(null);Graph.allowedFontUrls=Object.create(null);Graph.isValidFontUrl=function(k){if("string"!==typeof k||0==k.length)return!1;if(Graph.allowedFontUrls[k])return!0;k=k.replace(/^[\x00-\x20]+/,"").replace(/[\x00-\x20]+$/,"").replace(/[\t\n\r]/g,"");return/^https?:\/\//i.test(k)||/^data:/i.test(k)||!/^[a-zA-Z][a-zA-Z0-9+.\-]*:/.test(k)&&!/^[\\\/]/.test(k)};Graph.isGoogleFontUrl=function(k){return k.substring(0,
Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.escapeCssString=function(k){return null!=k?String(k).replace(/[\x00-\x1f\x7f"\\]/g,function(u){return"\\"+
u.charCodeAt(0).toString(16)+" "}):k};Graph.createFontElement=function(k,u){var H=Graph.fontMapping[u];null==H&&Graph.isCssFontUrl(u)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",Graph.rewriteGoogleFontUrl(u))):(null==H&&(H='@font-face {\nfont-family: "'+Graph.escapeCssString(k)+'";\nsrc: url("'+Graph.escapeCssString(u)+'");\n}'),k=document.createElement("style"),mxUtils.write(k,H));return k};
-Graph.addRecentCustomFont=function(k,u){};Graph.addFont=function(k,u,H,P){if(null!=k&&0<k.length&&Graph.isValidFontUrl(u)){P=null!=P?P:Graph.customFontElements;var T=k.toLowerCase();if("helvetica"!=T&&"arial"!=k&&"sans-serif"!=T){var W=P[T];null!=W&&W.url!=u&&(null!=W.elt.parentNode&&W.elt.parentNode.removeChild(W.elt),W=null);null==W?(W=u,"http:"==u.substring(0,5)&&(W=PROXY_URL+"?url="+encodeURIComponent(u)),W={name:k,url:u,elt:Graph.createFontElement(k,W)},P[T]=W,u=P==Graph.customFontElements?document.getElementsByTagName("head")[0]:
+Graph.addRecentCustomFont=function(k,u){};Graph.addFont=function(k,u,H,P){if(null!=k&&0<k.length&&Graph.isValidFontUrl(u)){P=null!=P?P:Graph.customFontElements;var U=k.toLowerCase();if("helvetica"!=U&&"arial"!=k&&"sans-serif"!=U){var W=P[U];null!=W&&W.url!=u&&(null!=W.elt.parentNode&&W.elt.parentNode.removeChild(W.elt),W=null);null==W?(W=u,"http:"==u.substring(0,5)&&(W=PROXY_URL+"?url="+encodeURIComponent(u)),W={name:k,url:u,elt:Graph.createFontElement(k,W)},P[U]=W,u=P==Graph.customFontElements?document.getElementsByTagName("head")[0]:
null,null!=H&&("link"==W.elt.nodeName.toLowerCase()?(W.elt.onload=H,W.elt.onerror=H):H()),null!=u&&u.appendChild(W.elt)):null!=H&&H()}else null!=H&&H()}else null!=H&&H();return k};Graph.getFontUrl=function(k,u){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(u=k.url);return u};Graph.processFontAttributes=function(k){k=k.getElementsByTagName("*");for(var u=0;u<k.length;u++){var H=k[u].getAttribute("data-font-src");if(null!=H){var P="FONT"==k[u].nodeName.toUpperCase()?k[u].getAttribute("face"):
k[u].style.fontFamily;null!=P&&Graph.addFont(P,H)}}};Graph.processFontStyle=function(k){if(null!=k){var u=mxUtils.getValue(k,"fontSource",null);if(null!=u){var H=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=H)try{Graph.addFont(H,decodeURIComponent(u))}catch(P){}}}return k};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;
-mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var q=Graph.prototype.init;Graph.prototype.init=function(){function k(T){u=T}q.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var u=null;mxEvent.addListener(this.container,
-"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(T){u=null});this.isMouseInsertPoint=function(){return null!=u};var H=this.getInsertPoint;this.getInsertPoint=function(T){return null==u||T?H.apply(this,arguments):this.getPointForEvent(u)};var P=this.layoutManager.getLayout;this.layoutManager.getLayout=function(T){var W=this.graph.getCellStyle(T);if(null!=W&&"rack"==W.childLayout){var fa=new mxStackLayout(this.graph,!1);fa.gridSize=
+mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var q=Graph.prototype.init;Graph.prototype.init=function(){function k(U){u=U}q.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var u=null;mxEvent.addListener(this.container,
+"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(U){u=null});this.isMouseInsertPoint=function(){return null!=u};var H=this.getInsertPoint;this.getInsertPoint=function(U){return null==u||U?H.apply(this,arguments):this.getPointForEvent(u)};var P=this.layoutManager.getLayout;this.layoutManager.getLayout=function(U){var W=this.graph.getCellStyle(U);if(null!=W&&"rack"==W.childLayout){var fa=new mxStackLayout(this.graph,!1);fa.gridSize=
null!=W.rackUnitSize?parseFloat(W.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;fa.marginLeft=W.marginLeft||0;fa.marginRight=W.marginRight||0;fa.marginTop=W.marginTop||0;fa.marginBottom=W.marginBottom||0;fa.allowGaps=W.allowGaps||0;fa.horizontal="1"==mxUtils.getValue(W,"horizontalRack","0");fa.resizeParent=!1;fa.fill=!0;return fa}return P.apply(this,arguments)};this.updateGlobalUrlVariables()};var x=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=
-function(k,u){return Graph.processFontStyle(x.apply(this,arguments))};var A=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,u,H,P,T,W,fa,X,ea,oa,la,ca){A.apply(this,arguments);Graph.processFontAttributes(ca)};var E=mxText.prototype.redraw;mxText.prototype.redraw=function(){E.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(k,u,H,P){function T(){for(var Ba=X.getSelectionCells(),
-ma=[],ta=0;ta<Ba.length;ta++)X.isCellVisible(Ba[ta])&&ma.push(Ba[ta]);X.setSelectionCells(ma)}function W(Ba){X.setHiddenTags(Ba?[]:ea.slice());T();X.refresh()}function fa(Ba,ma){la.innerText="";if(0<Ba.length){var ta=document.createElement("table");ta.setAttribute("cellpadding","2");ta.style.boxSizing="border-box";ta.style.tableLayout="fixed";ta.style.width="100%";var va=document.createElement("tbody");if(null!=Ba&&0<Ba.length)for(var Ha=0;Ha<Ba.length;Ha++)(function(La){function Ia(){var Ea=X.getCellsForTags([La],
+function(k,u){return Graph.processFontStyle(x.apply(this,arguments))};var A=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,u,H,P,U,W,fa,X,ea,oa,ka,ba){A.apply(this,arguments);Graph.processFontAttributes(ba)};var E=mxText.prototype.redraw;mxText.prototype.redraw=function(){E.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(k,u,H,P){function U(){for(var Ba=X.getSelectionCells(),
+ma=[],ta=0;ta<Ba.length;ta++)X.isCellVisible(Ba[ta])&&ma.push(Ba[ta]);X.setSelectionCells(ma)}function W(Ba){X.setHiddenTags(Ba?[]:ea.slice());U();X.refresh()}function fa(Ba,ma){ka.innerText="";if(0<Ba.length){var ta=document.createElement("table");ta.setAttribute("cellpadding","2");ta.style.boxSizing="border-box";ta.style.tableLayout="fixed";ta.style.width="100%";var va=document.createElement("tbody");if(null!=Ba&&0<Ba.length)for(var Ga=0;Ga<Ba.length;Ga++)(function(La){function Ia(){var Ea=X.getCellsForTags([La],
null,null,!0);X.isEnabled()?X.setSelectionCells(Ea):X.highlightCells(Ea,null,null,70)}var Ca=0>mxUtils.indexOf(X.hiddenTags,La),Pa=document.createElement("tr"),Ka=document.createElement("td");Ka.style.align="center";Ka.style.width="16px";var Na=document.createElement("img");Na.setAttribute("src",Ca?Editor.visibleImage:Editor.hiddenImage);Na.setAttribute("title",mxResources.get(Ca?"hideIt":"show",[La])+"\n"+mxResources.get("shiftClickShowOnly",[La]));mxUtils.setOpacity(Na,Ca?75:25);Na.className="geAdaptiveAsset";
-Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";Ka.appendChild(Na);mxEvent.addListener(Na,"click",function(Ea){if(mxEvent.isShiftDown(Ea)){for(var Aa=[],Ja=0;Ja<ea.length;Ja++)ea[Ja]!==La&&Aa.push(ea[Ja]);var Ga=0<Aa.length;for(Ja=0;Ja<Aa.length;Ja++)if(0>mxUtils.indexOf(X.hiddenTags,Aa[Ja])){Ga=!1;break}Ga&&0>mxUtils.indexOf(X.hiddenTags,La)?X.setHiddenTags([]):X.setHiddenTags(Aa)}else X.toggleHiddenTag(La);
-T();X.refresh();mxEvent.consume(Ea)});Pa.appendChild(Ka);Ka=document.createElement("td");Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img");Na.setAttribute("src",Editor.selectImage);Na.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Na,Ca?75:25);Na.className="geAdaptiveAsset";Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";mxEvent.addListener(Na,"click",function(Ea){W(!0);
+Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";Ka.appendChild(Na);mxEvent.addListener(Na,"click",function(Ea){if(mxEvent.isShiftDown(Ea)){for(var Aa=[],Ja=0;Ja<ea.length;Ja++)ea[Ja]!==La&&Aa.push(ea[Ja]);var Ha=0<Aa.length;for(Ja=0;Ja<Aa.length;Ja++)if(0>mxUtils.indexOf(X.hiddenTags,Aa[Ja])){Ha=!1;break}Ha&&0>mxUtils.indexOf(X.hiddenTags,La)?X.setHiddenTags([]):X.setHiddenTags(Aa)}else X.toggleHiddenTag(La);
+U();X.refresh();mxEvent.consume(Ea)});Pa.appendChild(Ka);Ka=document.createElement("td");Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img");Na.setAttribute("src",Editor.selectImage);Na.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Na,Ca?75:25);Na.className="geAdaptiveAsset";Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";mxEvent.addListener(Na,"click",function(Ea){W(!0);
Ia();mxEvent.consume(Ea)});Ka.appendChild(Na);Pa.appendChild(Ka);Ka=document.createElement("td");Ka.style.overflow="hidden";Ka.style.whiteSpace="nowrap";Ka.style.textOverflow="ellipsis";Ka.style.verticalAlign="middle";Ka.style.cursor="pointer";Ka.setAttribute("title",La);a=document.createElement("a");mxUtils.write(a,La);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,Ca?100:40);Ka.appendChild(a);mxEvent.addListener(Ka,"click",function(Ea){if(mxEvent.isShiftDown(Ea))W(!0),
-Ia();else if(Ca&&0<X.hiddenTags.length)W(!0);else{var Aa=ea.slice(),Ja=mxUtils.indexOf(Aa,La);Aa.splice(Ja,1);X.setHiddenTags(Aa);T();X.refresh()}mxEvent.consume(Ea)});Pa.appendChild(Ka);if(X.isEnabled()){Ka=document.createElement("td");Ka.style.verticalAlign="middle";Ka.style.textAlign="center";Ka.style.width="18px";if(null==ma){Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img");Na.setAttribute("src",Editor.trashImage);Na.setAttribute("title",mxResources.get("removeIt",
+Ia();else if(Ca&&0<X.hiddenTags.length)W(!0);else{var Aa=ea.slice(),Ja=mxUtils.indexOf(Aa,La);Aa.splice(Ja,1);X.setHiddenTags(Aa);U();X.refresh()}mxEvent.consume(Ea)});Pa.appendChild(Ka);if(X.isEnabled()){Ka=document.createElement("td");Ka.style.verticalAlign="middle";Ka.style.textAlign="center";Ka.style.width="18px";if(null==ma){Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img");Na.setAttribute("src",Editor.trashImage);Na.setAttribute("title",mxResources.get("removeIt",
[La]));mxUtils.setOpacity(Na,Ca?75:25);Na.className="geAdaptiveAsset";Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(u||Editor.isDarkMode())Na.style.filter="invert(100%)";mxEvent.addListener(Na,"click",function(Ea){var Aa=mxUtils.indexOf(ea,La);0<=Aa&&ea.splice(Aa,1);X.removeTagsForCells(X.model.getDescendants(X.model.getRoot()),[La]);X.refresh();mxEvent.consume(Ea)});Ka.appendChild(Na)}else{var Oa=document.createElement("input");Oa.setAttribute("type","checkbox");
-Oa.style.margin="0px";Oa.defaultChecked=null!=ma&&0<=mxUtils.indexOf(ma,La);Oa.checked=Oa.defaultChecked;Oa.style.background="transparent";Oa.setAttribute("title",mxResources.get(Oa.defaultChecked?"removeIt":"add",[La]));mxEvent.addListener(Oa,"change",function(Ea){Oa.checked?X.addTagsForCells(X.getSelectionCells(),[La]):X.removeTagsForCells(X.getSelectionCells(),[La]);mxEvent.consume(Ea)});Ka.appendChild(Oa)}Pa.appendChild(Ka)}va.appendChild(Pa)})(Ba[Ha]);ta.appendChild(va);la.appendChild(ta)}}var X=
-this,ea=X.hiddenTags.slice(),oa=document.createElement("div");oa.style.userSelect="none";oa.style.overflow="hidden";oa.style.padding="10px";oa.style.height="100%";var la=document.createElement("div");la.style.position="absolute";la.style.boxSizing="border-box";la.style.userSelect="none";la.style.overflow="auto";la.style.padding="3px";la.style.left="0px";la.style.right="0px";la.style.top="0px";la.style.bottom="0px";oa.appendChild(la);X.addListener(mxEvent.ROOT,function(){ea=X.hiddenTags.slice()});
-var ca=mxUtils.bind(this,function(Ba,ma){if(k()){Ba=X.getAllTags();for(ma=0;ma<Ba.length;ma++)0>mxUtils.indexOf(ea,Ba[ma])&&ea.push(Ba[ma]);ea.sort();X.isSelectionEmpty()?fa(ea):fa(ea,X.getCommonTagsForCells(X.getSelectionCells()))}});X.selectionModel.addListener(mxEvent.CHANGE,ca);X.model.addListener(mxEvent.CHANGE,ca);X.addListener(mxEvent.REFRESH,ca);var sa=document.createElement("div");sa.className="geToolbarContainer geDialogToolbar";sa.style.position="absolute";sa.style.display="flex";sa.style.bottom=
-"0px";sa.style.left="0px";sa.style.right="0px";sa.style.height="32px";sa.style.overflow="hidden";sa.style.padding="3px 4px 4px 4px";sa.style.borderWidth="1px 0px 0px 0px";sa.style.borderStyle="solid";sa.style.whiteSpace="nowrap";if(X.isEnabled()){la.style.bottom="32px";var xa=document.createElement("a");xa.className="geButton";var qa=xa.cloneNode(!1);qa.style.backgroundImage="url("+Editor.visibleImage+")";qa.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(qa,"click",function(Ba){X.setHiddenTags([]);
-mxEvent.isShiftDown(Ba)||(ea=X.hiddenTags.slice());T();X.refresh();mxEvent.consume(Ba)});sa.appendChild(qa);null!=H&&(xa=xa.cloneNode(!1),xa.style.backgroundImage="url("+Editor.plusImage+")",xa.setAttribute("title",mxResources.get("add")),mxEvent.addListener(xa,"click",function(Ba){H(ea,function(ma){ea=ma;ca()});mxEvent.consume(Ba)}),sa.appendChild(xa));oa.appendChild(sa)}null!=P&&sa.appendChild(P);return{div:oa,refresh:ca}};Graph.prototype.getCustomFonts=function(k){k=null!=k?k:Graph.customFontElements;
-var u=[];if(null!=this.extFonts)for(var H=0;H<this.extFonts.length;H++)Graph.isValidFontUrl(this.extFonts[H].url)&&u.push(this.extFonts[H]);for(var P in k)H=k[P],Graph.isValidFontUrl(H.url)&&u.push({name:H.name,url:H.url});return u};Graph.prototype.getExtFontCss=function(k){k=this.getCustomFonts(k);for(var u="",H="",P=0;P<k.length;P++){var T=k[P].name,W=k[P].url;Graph.isCssFontUrl(W)?u+='@import url("'+Graph.escapeCssString(Graph.rewriteGoogleFontUrl(W))+'");\n':H+='@font-face {\nfont-family: "'+
-Graph.escapeCssString(T)+'";\nsrc: url("'+Graph.escapeCssString(W)+'");\n}\n'}return u+H};Graph.prototype.setFont=function(k,u){Graph.addFont(k,u);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var P=this.cellEditor.textarea.getElementsByTagName("font"),T=!1,W=0;W<P.length;W++)P[W].getAttribute("face")==H&&(T=!0,P[W].setAttribute("face",k),null!=u?P[W].setAttribute("data-font-src",u):P[W].removeAttribute("data-font-src"));T||document.execCommand("fontname",!1,k)};var K=Graph.prototype.isFastZoomEnabled;
+Oa.style.margin="0px";Oa.defaultChecked=null!=ma&&0<=mxUtils.indexOf(ma,La);Oa.checked=Oa.defaultChecked;Oa.style.background="transparent";Oa.setAttribute("title",mxResources.get(Oa.defaultChecked?"removeIt":"add",[La]));mxEvent.addListener(Oa,"change",function(Ea){Oa.checked?X.addTagsForCells(X.getSelectionCells(),[La]):X.removeTagsForCells(X.getSelectionCells(),[La]);mxEvent.consume(Ea)});Ka.appendChild(Oa)}Pa.appendChild(Ka)}va.appendChild(Pa)})(Ba[Ga]);ta.appendChild(va);ka.appendChild(ta)}}var X=
+this,ea=X.hiddenTags.slice(),oa=document.createElement("div");oa.style.userSelect="none";oa.style.overflow="hidden";oa.style.padding="10px";oa.style.height="100%";var ka=document.createElement("div");ka.style.position="absolute";ka.style.boxSizing="border-box";ka.style.userSelect="none";ka.style.overflow="auto";ka.style.padding="3px";ka.style.left="0px";ka.style.right="0px";ka.style.top="0px";ka.style.bottom="0px";oa.appendChild(ka);X.addListener(mxEvent.ROOT,function(){ea=X.hiddenTags.slice()});
+var ba=mxUtils.bind(this,function(Ba,ma){if(k()){Ba=X.getAllTags();for(ma=0;ma<Ba.length;ma++)0>mxUtils.indexOf(ea,Ba[ma])&&ea.push(Ba[ma]);ea.sort();X.isSelectionEmpty()?fa(ea):fa(ea,X.getCommonTagsForCells(X.getSelectionCells()))}});X.selectionModel.addListener(mxEvent.CHANGE,ba);X.model.addListener(mxEvent.CHANGE,ba);X.addListener(mxEvent.REFRESH,ba);var sa=document.createElement("div");sa.className="geToolbarContainer geDialogToolbar";sa.style.position="absolute";sa.style.display="flex";sa.style.bottom=
+"0px";sa.style.left="0px";sa.style.right="0px";sa.style.height="32px";sa.style.overflow="hidden";sa.style.padding="3px 4px 4px 4px";sa.style.borderWidth="1px 0px 0px 0px";sa.style.borderStyle="solid";sa.style.whiteSpace="nowrap";if(X.isEnabled()){ka.style.bottom="32px";var xa=document.createElement("a");xa.className="geButton";var qa=xa.cloneNode(!1);qa.style.backgroundImage="url("+Editor.visibleImage+")";qa.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(qa,"click",function(Ba){X.setHiddenTags([]);
+mxEvent.isShiftDown(Ba)||(ea=X.hiddenTags.slice());U();X.refresh();mxEvent.consume(Ba)});sa.appendChild(qa);null!=H&&(xa=xa.cloneNode(!1),xa.style.backgroundImage="url("+Editor.plusImage+")",xa.setAttribute("title",mxResources.get("add")),mxEvent.addListener(xa,"click",function(Ba){H(ea,function(ma){ea=ma;ba()});mxEvent.consume(Ba)}),sa.appendChild(xa));oa.appendChild(sa)}null!=P&&sa.appendChild(P);return{div:oa,refresh:ba}};Graph.prototype.getCustomFonts=function(k){k=null!=k?k:Graph.customFontElements;
+var u=[];if(null!=this.extFonts)for(var H=0;H<this.extFonts.length;H++)Graph.isValidFontUrl(this.extFonts[H].url)&&u.push(this.extFonts[H]);for(var P in k)H=k[P],Graph.isValidFontUrl(H.url)&&u.push({name:H.name,url:H.url});return u};Graph.prototype.getExtFontCss=function(k){k=this.getCustomFonts(k);for(var u="",H="",P=0;P<k.length;P++){var U=k[P].name,W=k[P].url;Graph.isCssFontUrl(W)?u+='@import url("'+Graph.escapeCssString(Graph.rewriteGoogleFontUrl(W))+'");\n':H+='@font-face {\nfont-family: "'+
+Graph.escapeCssString(U)+'";\nsrc: url("'+Graph.escapeCssString(W)+'");\n}\n'}return u+H};Graph.prototype.setFont=function(k,u){Graph.addFont(k,u);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var P=this.cellEditor.textarea.getElementsByTagName("font"),U=!1,W=0;W<P.length;W++)P[W].getAttribute("face")==H&&(U=!0,P[W].setAttribute("face",k),null!=u?P[W].setAttribute("data-font-src",u):P[W].removeAttribute("data-font-src"));U||document.execCommand("fontname",!1,k)};var K=Graph.prototype.isFastZoomEnabled;
Graph.prototype.isFastZoomEnabled=function(){return K.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var u in k)this.globalVars[u]=k[u]}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+H)}};Graph.prototype.getExportVariables=
function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var Q=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var u=Q.apply(this,arguments);null==u&&null!=this.globalVars&&(u=this.globalVars[k]);return u};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};
-var V=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,u,H,P,T,W,fa,X,ea,oa,la,ca,sa,xa,qa,Ba,ma){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(Ia){}this.refreshMathBounds()}var ta=V.apply(this,arguments);if(null!=ca){var va=ta.getAttribute("style");null==
-va&&(va="");ca="auto"==ca||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":ca;ta.setAttribute("style",va+(" color-scheme: "+ca+";"))}var Ha=la?this.getExtFontCss():"";if(0<Ha.length){var La=ta.ownerDocument;va=null!=La.createElementNS?La.createElementNS(mxConstants.NS_SVG,"style"):La.createElement("style");null!=La.setAttributeNS?va.setAttributeNS("type","text/css"):va.setAttribute("type","text/css");va.appendChild(La.createTextNode(Ha));ta.getElementsByTagName("defs")[0].appendChild(va)}Editor.replaceSvgDataUris&&
+var V=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,u,H,P,U,W,fa,X,ea,oa,ka,ba,sa,xa,qa,Ba,ma){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(Ia){}this.refreshMathBounds()}var ta=V.apply(this,arguments);if(null!=ba){var va=ta.getAttribute("style");null==
+va&&(va="");ba="auto"==ba||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":ba;ta.setAttribute("style",va+(" color-scheme: "+ba+";"))}var Ga=ka?this.getExtFontCss():"";if(0<Ga.length){var La=ta.ownerDocument;va=null!=La.createElementNS?La.createElementNS(mxConstants.NS_SVG,"style"):La.createElement("style");null!=La.setAttributeNS?va.setAttributeNS("type","text/css"):va.setAttribute("type","text/css");va.appendChild(La.createTextNode(Ga));ta.getElementsByTagName("defs")[0].appendChild(va)}Editor.replaceSvgDataUris&&
null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ta);this.mathEnabled&&(document.body.appendChild(ta),Editor.MathJaxRender(ta),ta.parentNode.removeChild(ta),va=ta.ownerDocument.getElementById("MJX-SVG-styles"),null!=va&&ta.getElementsByTagName("defs")[0].appendChild(va.cloneNode(!0)));return ta};var J=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){J.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=
null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,k.control]};var ia=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){ia.apply(this,arguments);this.enumerationState=0};var Y=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return Y.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=mxUtils.safeDecodeURIComponent(mxUtils.getValue(k.style,
"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(k)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var u="1"==mxUtils.getValue(k.style,"enumerate",0);u&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,
this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):u||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);u=k.secondLabel;if(null!=u){var H=k.view.scale,P=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*H,k.y+4*H,0,0):mxRectangle.fromPoint(k.view.getPoint(k));u.bounds.equals(k)&&u.value==P&&u.scale==H||(u.bounds=k,u.value=P,u.scale=H,u.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();
aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var ja=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){ja.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,u){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&
-this.executeCustomActions(Graph.flattenAnimationActions(k.actions),null,u))};Graph.flattenAnimationActions=function(k){if(!Array.isArray(k))return k;for(var u=[],H=0;H<k.length;H++){var P=k[H];if(null!=P&&null!=P.animation&&Array.isArray(P.animation.steps)){P=Graph.flattenAnimationActions(P.animation.steps);for(var T=0;T<P.length;T++)u.push(P[T])}else u.push(P)}return u};Graph.smoothScrollContainer=function(k,u,H,P,T,W){W=W||600;if(u!==P||H!==T){k.scrollLeft=u;k.scrollTop=H;var fa="undefined"!=typeof performance&&
-null!=performance.now?performance.now():Date.now(),X=P-u,ea=T-H,oa=function(la){la=Math.min(1,(la-fa)/W);var ca=1-Math.pow(1-la,3);k.scrollLeft=u+X*ca;k.scrollTop=H+ea*ca;1>la&&window.requestAnimationFrame(oa)};window.requestAnimationFrame(oa)}};Graph.applyTransformTransition=function(k,u){u=u||600;var H=k.view.getDrawPane(),P=null!=H?H.parentNode:null;if(null!=P){var T=P.style.transition;P.style.transition="transform "+u+"ms cubic-bezier(0.16, 1, 0.3, 1)";k.armTransformTransition=!0;var W=function(){P.style.transition=
-T||"";k.armTransformTransition=!1;P.removeEventListener("transitionend",W)};P.addEventListener("transitionend",W);window.setTimeout(W,u+100)}};Graph.prototype.fitBoundsCssTransform=function(k,u){var H=null!=u?u:10;u=this.view.graphBounds;var P=Math.max(u.x,k.x),T=Math.max(u.y,k.y),W=Math.max(1,Math.min(u.x+u.width,k.x+k.width)-P),fa=Math.max(1,Math.min(u.y+u.height,k.y+k.height)-T),X=this.container.clientWidth-H,ea=this.container.clientHeight-H;k=Math.floor(20*Math.min(X/W,ea/fa))/20;this.view.scaleAndTranslate(k,
--u.x,-u.y);P=(P-u.x)*k-Math.max((X-W*k)/2+H/2,0);H=(T-u.y)*k-Math.max((ea-fa*k)/2+H/2,0);W=this.getBorder();T=u.width*k+2*W-this.container.clientWidth;u=u.height*k+2*W-this.container.clientHeight;this.container.scrollLeft=0>T?0:Math.max(0,Math.min(P,T));this.container.scrollTop=0>u?0:Math.max(0,Math.min(H,u))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(k,u,H){if(this.isGraphTornDown())null!=H&&H();else{var P=
-this.container,T=P.scrollLeft,W=P.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(k,u)):this.fitWindow(k,u);Graph.smoothScrollContainer(P,T,W,P.scrollLeft,P.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(k,u){var H=this.view.getState(k);if(null!=H){var P=this.view.graphBounds,T=this.view.scale;this.view.translate.x===-P.x&&this.view.translate.y===-P.y||this.view.scaleAndTranslate(T,-P.x,
--P.y);k=this.container.clientWidth;var W=this.container.clientHeight,fa=this.getBorder(),X=P.width*T+2*fa-k;fa=P.height*T+2*fa-W;if(null!=u){var ea=(H.x-P.x)*T,oa=(H.y-P.y)*T,la=(H.x+H.width-P.x)*T;P=(H.y+H.height-P.y)*T;var ca=this.container.scrollLeft;H=this.container.scrollTop;ea-u<ca?ca=ea-u:la+u>ca+k&&(ca=la+u-k);oa-u<H?H=oa-u:P+u>H+W&&(H=P+u-W)}else ca=(H.x+H.width/2-P.x)*T-k/2,H=(H.y+H.height/2-P.y)*T-W/2;this.container.scrollLeft=0>X?0:Math.max(0,Math.min(ca,X));this.container.scrollTop=0>
-fa?0:Math.max(0,Math.min(H,fa))}};Graph.prototype.scrollCellToVisibleBorder=function(k,u){null==u?this.scrollCellToVisible(k):(k=this.view.getState(k),null!=k&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+k.x-u,-this.view.translate.y+k.y-u,k.width+2*u,k.height+2*u)))};Graph.prototype.smoothScrollCellToVisible=function(k,u,H){if(this.isGraphTornDown())null!=H&&H();else{var P=this.container,T=P.scrollLeft,W=P.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(k,
-u):this.scrollCellToVisibleBorder(k,u);Graph.smoothScrollContainer(P,T,W,P.scrollLeft,P.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.toggleCellsTransient=function(k){k=this.getNodesForCells(k);for(var u=0;u<k.length;u++){var H=k[u].style.opacity;H=""===H||null===H||0<parseFloat(H);k[u].style.opacity=H?0:1}};Graph.prototype.setCellStylesTransient=function(k,u,H){for(var P=0;P<H.length;P++){var T=this.view.getState(H[P]);null!=T&&null!=T.style&&(null==u?delete T.style[k]:T.style[k]=
-u,null!=T.shape&&(T.shape.apply(T),T.shape.redraw()),null!=T.text&&(T.text.apply(T),T.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(k,u,H){null==u&&(u="0");for(var P=0;P<H.length;P++){var T=this.view.getState(H[P]);if(null!=T&&null!=T.style){var W=mxUtils.getValue(T.style,k,u)?"0":"1";T.style[k]=W;null!=T.shape&&(T.shape.apply(T),T.shape.redraw());null!=T.text&&(T.text.apply(T),T.text.redraw())}}};Graph.prototype.executeCustomActions=function(k,u,H){if(this.executingCustomActions)this.stoppingCustomActions=
-!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var P=!1,T=0,W=0,fa=mxUtils.bind(this,function(){P||(P=!0,this.model.beginUpdate())}),X=mxUtils.bind(this,function(){P&&(P=!1,this.model.endUpdate())}),ea=null==H,oa=function(xa){return null!=xa.transient?xa.transient:ea},la=mxUtils.bind(this,function(){0<
-T&&T--;0==T&&sa()}),ca=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=u&&u();else if(W<k.length){do{var xa=this.stoppingCustomActions,qa=k[W++],Ba=[];if(null!=qa.open)if(X(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,H)){this.stoppingCustomActions=this.executingCustomActions=!1;null!=u&&u();return}}else this.openLink(qa.open);null==qa.wait||xa||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=
-this.pendingExecuteNextAction=null;la()}),T++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=qa.wait?parseInt(qa.wait):1E3),X());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,!0)),qa.opacity.value);null!=qa.fadeIn&&(T++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,la,xa?0:qa.fadeIn.delay));null!=qa.fadeOut&&(T++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,
-!0)),1,0,la,xa?0:qa.fadeOut.delay));if(null!=qa.fadeTo&&null!=qa.fadeTo.value){T++;var ma=this.getNodesForCells(this.getCellsForAction(qa.fadeTo,!0)),ta=xa?0:null!=qa.fadeTo.delay?qa.fadeTo.delay:1E3;Graph.setTransitionForNodes(ma,"all "+ta+"ms ease-in-out");Graph.setOpacityForNodes(ma,qa.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(ma,null);la()},ta)}null!=qa.flow&&(ta=this.getCellsForAction(qa.flow,!0),Editor.toggleFlowAnimation(this,ta,!1===qa.flow.start?"stop":!0===qa.flow.start?
+this.executeCustomActions(Graph.flattenAnimationActions(k.actions),null,u))};Graph.flattenAnimationActions=function(k){if(!Array.isArray(k))return k;for(var u=[],H=0;H<k.length;H++){var P=k[H];if(null!=P&&null!=P.animation&&Array.isArray(P.animation.steps)){P=Graph.flattenAnimationActions(P.animation.steps);for(var U=0;U<P.length;U++)u.push(P[U])}else u.push(P)}return u};Graph.smoothScrollContainer=function(k,u,H,P,U,W){W=W||600;if(u!==P||H!==U){k.scrollLeft=u;k.scrollTop=H;var fa="undefined"!=typeof performance&&
+null!=performance.now?performance.now():Date.now(),X=P-u,ea=U-H,oa=function(ka){ka=Math.min(1,(ka-fa)/W);var ba=1-Math.pow(1-ka,3);k.scrollLeft=u+X*ba;k.scrollTop=H+ea*ba;1>ka&&window.requestAnimationFrame(oa)};window.requestAnimationFrame(oa)}};Graph.applyTransformTransition=function(k,u){u=u||600;var H=k.view.getDrawPane(),P=null!=H?H.parentNode:null;if(null!=P){var U=P.style.transition;P.style.transition="transform "+u+"ms cubic-bezier(0.16, 1, 0.3, 1)";k.armTransformTransition=!0;var W=function(){P.style.transition=
+U||"";k.armTransformTransition=!1;P.removeEventListener("transitionend",W)};P.addEventListener("transitionend",W);window.setTimeout(W,u+100)}};Graph.prototype.fitBoundsCssTransform=function(k,u){var H=null!=u?u:10;u=this.view.graphBounds;var P=Math.max(u.x,k.x),U=Math.max(u.y,k.y),W=Math.max(1,Math.min(u.x+u.width,k.x+k.width)-P),fa=Math.max(1,Math.min(u.y+u.height,k.y+k.height)-U),X=this.container.clientWidth-H,ea=this.container.clientHeight-H;k=Math.floor(20*Math.min(X/W,ea/fa))/20;this.view.scaleAndTranslate(k,
+-u.x,-u.y);P=(P-u.x)*k-Math.max((X-W*k)/2+H/2,0);H=(U-u.y)*k-Math.max((ea-fa*k)/2+H/2,0);W=this.getBorder();U=u.width*k+2*W-this.container.clientWidth;u=u.height*k+2*W-this.container.clientHeight;this.container.scrollLeft=0>U?0:Math.max(0,Math.min(P,U));this.container.scrollTop=0>u?0:Math.max(0,Math.min(H,u))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(k,u,H){if(this.isGraphTornDown())null!=H&&H();else{var P=
+this.container,U=P.scrollLeft,W=P.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(k,u)):this.fitWindow(k,u);Graph.smoothScrollContainer(P,U,W,P.scrollLeft,P.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(k,u){var H=this.view.getState(k);if(null!=H){var P=this.view.graphBounds,U=this.view.scale;this.view.translate.x===-P.x&&this.view.translate.y===-P.y||this.view.scaleAndTranslate(U,-P.x,
+-P.y);k=this.container.clientWidth;var W=this.container.clientHeight,fa=this.getBorder(),X=P.width*U+2*fa-k;fa=P.height*U+2*fa-W;if(null!=u){var ea=(H.x-P.x)*U,oa=(H.y-P.y)*U,ka=(H.x+H.width-P.x)*U;P=(H.y+H.height-P.y)*U;var ba=this.container.scrollLeft;H=this.container.scrollTop;ea-u<ba?ba=ea-u:ka+u>ba+k&&(ba=ka+u-k);oa-u<H?H=oa-u:P+u>H+W&&(H=P+u-W)}else ba=(H.x+H.width/2-P.x)*U-k/2,H=(H.y+H.height/2-P.y)*U-W/2;this.container.scrollLeft=0>X?0:Math.max(0,Math.min(ba,X));this.container.scrollTop=0>
+fa?0:Math.max(0,Math.min(H,fa))}};Graph.prototype.scrollCellToVisibleBorder=function(k,u){null==u?this.scrollCellToVisible(k):(k=this.view.getState(k),null!=k&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+k.x-u,-this.view.translate.y+k.y-u,k.width+2*u,k.height+2*u)))};Graph.prototype.smoothScrollCellToVisible=function(k,u,H){if(this.isGraphTornDown())null!=H&&H();else{var P=this.container,U=P.scrollLeft,W=P.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(k,
+u):this.scrollCellToVisibleBorder(k,u);Graph.smoothScrollContainer(P,U,W,P.scrollLeft,P.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.toggleCellsTransient=function(k){k=this.getNodesForCells(k);for(var u=0;u<k.length;u++){var H=k[u].style.opacity;H=""===H||null===H||0<parseFloat(H);k[u].style.opacity=H?0:1}};Graph.prototype.setCellStylesTransient=function(k,u,H){for(var P=0;P<H.length;P++){var U=this.view.getState(H[P]);null!=U&&null!=U.style&&(null==u?delete U.style[k]:U.style[k]=
+u,this.redrawTransientStyle(U))}};Graph.prototype.redrawTransientStyle=function(k){null!=k.shape&&(k.shape.resetStyles(),this.cellRenderer.configureShape(k),k.shape.redraw());null!=k.text&&(k.text.resetStyles(),k.text.apply(k),k.text.valign=this.getVerticalAlign(k),k.text.redraw())};Graph.nextToggleStyleValue=function(k,u,H){return null!=u&&""!==u?null!=k&&String(k)==String(u)?H:u:null!=k&&""!==k&&0!=k&&"false"!==k?"0":"1"};Graph.prototype.toggleCellStyleValues=function(k,u,H,P){if(null!=P&&0<P.length){var U=
+mxUtils.getValue(this.getCurrentCellStyle(P[0]),k,H);this.setCellStyles(k,Graph.nextToggleStyleValue(U,u,H),P)}};Graph.prototype.toggleCellStylesTransient=function(k,u,H,P){for(var U=0;U<H.length;U++){var W=this.view.getState(H[U]);if(null!=W&&null!=W.style){var fa=Graph.nextToggleStyleValue(mxUtils.getValue(W.style,k,u),P,u);null==fa||""===fa?delete W.style[k]:W.style[k]=fa;this.redrawTransientStyle(W)}}};Graph.prototype.executeCustomActions=function(k,u,H){if(this.executingCustomActions)this.stoppingCustomActions=
+!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var P=!1,U=0,W=0,fa=mxUtils.bind(this,function(){P||(P=!0,this.model.beginUpdate())}),X=mxUtils.bind(this,function(){P&&(P=!1,this.model.endUpdate())}),ea=null==H,oa=function(xa){return null!=xa.transient?xa.transient:ea},ka=mxUtils.bind(this,function(){0<
+U&&U--;0==U&&sa()}),ba=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=u&&u();else if(W<k.length){do{var xa=this.stoppingCustomActions,qa=k[W++],Ba=[];if(null!=qa.open)if(X(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,H)){this.stoppingCustomActions=this.executingCustomActions=!1;null!=u&&u();return}}else this.openLink(qa.open);null==qa.wait||xa||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=
+this.pendingExecuteNextAction=null;ka()}),U++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=qa.wait?parseInt(qa.wait):1E3),X());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,!0)),qa.opacity.value);null!=qa.fadeIn&&(U++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,ka,xa?0:qa.fadeIn.delay));null!=qa.fadeOut&&(U++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,
+!0)),1,0,ka,xa?0:qa.fadeOut.delay));if(null!=qa.fadeTo&&null!=qa.fadeTo.value){U++;var ma=this.getNodesForCells(this.getCellsForAction(qa.fadeTo,!0)),ta=xa?0:null!=qa.fadeTo.delay?qa.fadeTo.delay:1E3;Graph.setTransitionForNodes(ma,"all "+ta+"ms ease-in-out");Graph.setOpacityForNodes(ma,qa.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(ma,null);ka()},ta)}null!=qa.flow&&(ta=this.getCellsForAction(qa.flow,!0),Editor.toggleFlowAnimation(this,ta,!1===qa.flow.start?"stop":!0===qa.flow.start?
"start":"toggle"));null!=qa.wipeIn&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeIn,!0),!0)));null!=qa.wipeOut&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeOut,!0),!1)));null!=qa.popIn&&(Ba=Ba.concat(this.createPopAnimations(this.getCellsForAction(qa.popIn,!0),!0)));null!=qa.popOut&&(Ba=Ba.concat(this.createPopAnimations(this.getCellsForAction(qa.popOut,!0),!1)));null!=qa.toggle&&(oa(qa.toggle)?this.toggleCellsTransient(this.getCellsForAction(qa.toggle,
!0)):(fa(),this.toggleCells(this.getCellsForAction(qa.toggle,!0,!0))));null!=qa.show&&(ta=this.getCellsForAction(qa.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(ta),1),oa(qa.show)||(fa(),this.setCellsVisible(this.getCellsForAction(qa.show,!0,!0),!0)));null!=qa.hide&&(ta=this.getCellsForAction(qa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ta),0),oa(qa.hide)||(fa(),this.setCellsVisible(this.getCellsForAction(qa.hide,!0,!0),!1)));if(null!=qa.toggleStyle&&null!=qa.toggleStyle.key){ta=
-this.getCellsForAction(qa.toggleStyle,!0);var va=null!=qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:"0";oa(qa.toggleStyle)?this.toggleCellStylesTransient(qa.toggleStyle.key,va,ta):(fa(),this.toggleCellStyles(qa.toggleStyle.key,va,ta))}null!=qa.style&&null!=qa.style.key&&(ta=this.getCellsForAction(qa.style,!0),oa(qa.style)?this.setCellStylesTransient(qa.style.key,qa.style.value,ta):(fa(),this.setCellStyles(qa.style.key,qa.style.value,ta)));ta=[];null!=qa.select&&this.isEnabled()&&(ta=this.getCellsForAction(qa.select),
-this.setSelectionCells(ta));null!=qa.highlight&&(ta=this.getCellsForAction(qa.highlight),this.highlightCells(ta,qa.highlight.color,qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ta=this.getCellsForAction(qa.scroll));if(null!=qa.viewbox){va=qa.viewbox;if(null!=va.cells||null!=va.tags||null!=va.layers){var Ha=this.getBoundingBox(this.getCellsForAction(va));if(null!=Ha){var La=this.useCssTransforms?1:this.view.scale,Ia=this.useCssTransforms?new mxPoint(0,0):this.view.translate,Ca=null==
-va.border||""===va.border||isNaN(parseFloat(va.border))?null:2*parseFloat(va.border);va={x:Ha.x/La-Ia.x,y:Ha.y/La-Ia.y,width:Math.max(1,Ha.width/La),height:Math.max(1,Ha.height/La),border:Ca,smooth:va.smooth}}else va=null}null!=va&&(!0!==va.smooth||xa?this.useCssTransforms?this.fitBoundsCssTransform(va,va.border):this.fitWindow(va,va.border):(T++,this.smoothFitWindow(va,va.border,la)))}0<ta.length&&(va=null==qa.scroll||null==qa.scroll.border||""===qa.scroll.border||isNaN(parseFloat(qa.scroll.border))?
-null:parseFloat(qa.scroll.border),null==qa.scroll||!0!==qa.scroll.smooth||xa?this.useCssTransforms?this.scrollCellToVisibleCssTransform(ta[0],va):this.scrollCellToVisibleBorder(ta[0],va):(T++,this.smoothScrollCellToVisible(ta[0],va,la)));null!=H&&null!=qa.explore&&Graph.exploreFromCell(this,H,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle)for(va=qa.tags.toggle,0==va.length&&(va=this.getAllTags()),ta=0;ta<va.length;ta++)this.toggleHiddenTag(va[ta]);va=null;null!=qa.tags.hidden&&(null==va&&(va=
-[]),va=va.concat(qa.tags.hidden));if(null!=qa.tags.visible)for(null==va&&(va=[]),Ha=this.getAllTags(),ta=0;ta<Ha.length;ta++)0>mxUtils.indexOf(qa.tags.visible,Ha[ta])&&0>mxUtils.indexOf(va,Ha[ta])&&va.push(Ha[ta]);null!=va&&this.setHiddenTags(va);this.refresh()}if(0<Ba.length){T++;ta=null!=qa.steps?qa.steps:30;va=qa.delay;Ha=["wipeIn","wipeOut","popIn","popOut"];La=null;for(Ia=0;Ia<Ha.length;Ia++)Ca=qa[Ha[Ia]],null!=Ca&&null!=Ca.delay&&(La=null==La?Ca.delay:Math.max(La,Ca.delay));null!=La&&(va=La/
-ta);this.executeAnimations(Ba,la,xa?1:ta,xa?0:va)}}while(W<k.length&&!0===k[W].immediate&&!this.stoppingCustomActions);0==T?sa():X()}else this.stoppingCustomActions=this.executingCustomActions=!1,X(),null!=u&&u()}),sa=mxUtils.bind(this,function(){try{ca()}catch(xa){throw this.stoppingCustomActions=this.executingCustomActions=!1,X(),xa;}});sa()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,u){var H=this.getLinkForCell(u);null!=H&&"data:action/json,"==H.substring(0,17)&&this.setLinkForCell(u,
-this.updateCustomLink(k,H));if(this.isHtmlLabel(u)){var P=document.createElement("div");P.innerHTML=Graph.sanitizeHtml(this.getLabel(u));for(var T=P.getElementsByTagName("a"),W=!1,fa=0;fa<T.length;fa++)H=T[fa].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(T[fa].setAttribute("href",this.updateCustomLink(k,H)),W=!0);W&&this.labelChanged(u,P.innerHTML)}};Graph.prototype.updateCustomLink=function(k,u){if("data:action/json,"==u.substring(0,17))try{var H=JSON.parse(u.substring(17));
-null!=H.actions&&(this.updateCustomLinkActions(k,H.actions),u="data:action/json,"+JSON.stringify(H))}catch(P){}return u};Graph.prototype.updateCustomLinkActions=function(k,u){for(var H=0;H<u.length;H++){var P=u[H],T;for(T in P)this.updateCustomLinkAction(k,P[T],"cells"),this.updateCustomLinkAction(k,P[T],"excludeCells"),this.updateCustomLinkAction(k,P[T],"layers")}};Graph.prototype.updateCustomLinkAction=function(k,u,H){if(null!=u&&null!=u[H]){for(var P=[],T=0;T<u[H].length;T++)if("*"==u[H][T])P.push(u[H][T]);
-else{var W=k[u[H][T]];null!=W?""!=W&&P.push(W):P.push(u[H][T])}u[H]=P}};Graph.prototype.getCellsForAction=function(k,u,H){var P="or"===k.tagsMatch?"or":"and",T={},W=[],fa=function(X){for(var ea=0;ea<X.length;ea++){var oa=X[ea].id;T[oa]||(T[oa]=!0,W.push(X[ea]))}};fa(this.getCellsById(k.cells));fa(this.getCellsForTags(k.tags,null,u,!1,P));fa(H?this.getLayerCells(k.layers):this.getCellsForLayers(k.layers));if(null!=k.excludeCells&&0<k.excludeCells.length){u={};P=!1;for(H=0;H<k.excludeCells.length;H++){if("*"===
-k.excludeCells[H]){P=!0;break}u[k.excludeCells[H]]=!0}if(P)return[];k=[];for(H=0;H<W.length;H++)u[W[H].id]||k.push(W[H]);return k}return W};Graph.prototype.getCellsById=function(k){var u=[];if(null!=k)for(var H=0;H<k.length;H++)if("*"==k[H]){var P=this.model.getRoot();u=u.concat(this.model.filterDescendants(function(W){return W!=P},P))}else{var T=this.model.getCell(k[H]);null!=T&&u.push(T)}return u};Graph.prototype.getCellsForLayers=function(k){var u=[];if(Array.isArray(k))for(var H=0;H<k.length;H++){var P=
-this.model.getCell(k[H]);null!=P&&(u=u.concat(this.model.filterDescendants(function(T){return T!=P},P)))}return u};Graph.prototype.getLayerCells=function(k){var u=[];if(Array.isArray(k))for(var H=0;H<k.length;H++){var P=this.model.getCell(k[H]);null!=P&&u.push(P)}return u};var ka=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return ka.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};
-Graph.prototype.toggleHiddenTag=function(k){var u=mxUtils.indexOf(this.hiddenTags,k);0>u?this.hiddenTags.push(k):0<=u&&this.hiddenTags.splice(u,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;for(var u=0;u<k.length;u++)if(0>mxUtils.indexOf(this.hiddenTags,k[u]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,u,H,
-P,T){var W=[];T="or"===T;if(null!=k){u=null!=u?u:this.model.getDescendants(this.model.getRoot());for(var fa=0,X={},ea=0;ea<k.length;ea++)0<k[ea].length&&(X[k[ea]]=!0,fa++);for(ea=0;ea<u.length;ea++)if(H&&this.model.getParent(u[ea])==this.model.root||this.model.isVertex(u[ea])||this.model.isEdge(u[ea])){var oa=this.getTagsForCell(u[ea]),la=!1;if(0<oa.length&&(oa=oa.split(" "),T||oa.length>=k.length)){for(var ca=la=0;ca<oa.length&&la<fa;ca++)null!=X[oa[ca]]&&la++;la=T?0<la:la==fa}la&&(1!=P||this.isCellVisible(u[ea]))&&
-W.push(u[ea])}}return W};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var u=null,H=[],P=0;P<k.length;P++){var T=this.getTagsForCell(k[P]);H=[];if(0<T.length){T=T.split(" ");for(var W={},fa=0;fa<T.length;fa++)if(null==u||null!=u[T[fa]])W[T[fa]]=!0,H.push(T[fa]);u=W}else return[]}return H};Graph.prototype.getTagsForCells=function(k){for(var u=[],H={},P=0;P<k.length;P++){var T=
-this.getTagsForCell(k[P]);if(0<T.length){T=T.split(" ");for(var W=0;W<T.length;W++)null==H[T[W]]&&(H[T[W]]=!0,u.push(T[W]))}}return u};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,u){if(0<k.length&&0<u.length){this.model.beginUpdate();try{for(var H=0;H<k.length;H++){for(var P=this.getTagsForCell(k[H]),T=P.split(" "),W=!1,fa=0;fa<u.length;fa++){var X=mxUtils.trim(u[fa]);""!=X&&0>mxUtils.indexOf(T,X)&&(P=0<P.length?
-P+" "+X:X,W=!0)}W&&this.setAttributeForCell(k[H],"tags",P)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,u){if(0<k.length&&0<u.length){this.model.beginUpdate();try{for(var H=0;H<k.length;H++){var P=this.getTagsForCell(k[H]);if(0<P.length){for(var T=P.split(" "),W=!1,fa=0;fa<u.length;fa++){var X=mxUtils.indexOf(T,u[fa]);0<=X&&(T.splice(X,1),W=!0)}W&&this.setAttributeForCell(k[H],"tags",T.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();
-try{for(var u=0;u<k.length;u++)this.model.setVisible(k[u],!this.model.isVisible(k[u]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,u){this.model.beginUpdate();try{for(var H=0;H<k.length;H++)this.model.setVisible(k[H],u)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,u,H,P){for(var T=0;T<k.length;T++)this.highlightCell(k[T],u,H,P)};Graph.prototype.highlightCell=function(k,u,H,P,T){u=null!=u?u:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;
-k=this.view.getState(k);var W=null;null!=k&&(T=null!=T?T:4,T=Math.max(T+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+T),W=new mxCellHighlight(this,u,T,!1),null!=P&&(W.opacity=P),W.highlight(k),window.setTimeout(function(){null!=W.shape&&(mxUtils.setPrefixedStyle(W.shape.node.style,"transition","all 1200ms ease-in-out"),W.shape.node.style.opacity=0);window.setTimeout(function(){W.destroy()},1200)},H));return W};Graph.prototype.addSvgShadow=function(k,u,H,P){P=null!=P?P:!0;var T=Math.ceil(this.svgShadowSize*
-this.svgShadowBlur);null!=H&&H||(u=null!=u?u:k.getElementsByTagName("g")[0],null!=u&&(this.updateShadowFilter(u,!0),!isNaN(parseInt(k.getAttribute("width")))&&P&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+T),k.setAttribute("height",parseInt(k.getAttribute("height"))+T),u=k.getAttribute("viewBox"),null!=u&&0<u.length&&(u=u.split(" "),3<u.length&&(w=parseFloat(u[2])+T,h=parseFloat(u[3])+T,k.setAttribute("viewBox",u[0]+" "+u[1]+" "+w+" "+h))))));return T};Graph.prototype.updateShadowFilter=
-function(k,u){mxClient.IS_SF||(u?(u=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),k.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+u.cssText+")"):k.style.filter="")};Graph.prototype.setShadowVisible=function(k,u){u=null!=u?u:!0;this.shadowVisible=k;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);u&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));
-return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),u=0;do var H=this.model.getChildAt(this.model.root,u);while(u++<k&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};
-mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=
-[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",
-STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];
-mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",
-STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];
-mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=
-[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",
-STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=
-[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate4=[SHAPES_PATH+
-"/mxArchiMate3.js",SHAPES_PATH+"/mxArchiMate4.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.atlassian2=
-[SHAPES_PATH+"/mxAtlassian2.js",STENCIL_PATH+"/atlassian2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];
-mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=
-[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(k){var u=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?u="mxgraph.er":"sysML"==k.substring(0,5)&&(u="mxgraph.sysml"));return u};var ua=mxMarker.createMarker;mxMarker.createMarker=function(k,u,H,P,T,W,fa,X,ea,oa){if(null!=H&&null==mxMarker.markers[H]){var la=this.getPackageForType(H);
-null!=la&&mxStencilRegistry.getStencil(la)}return ua.apply(this,arguments)};var Da=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,u,H,P,T,W){"1"==mxUtils.getValue(u.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(u.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return Da.apply(this,arguments)};PrintDialog.prototype.create=function(k,u,H,P){function T(){ta.value=Math.max(1,Math.min(sa,Math.max(parseInt(ta.value),parseInt(ma.value))));ma.value=Math.max(1,Math.min(sa,
-Math.min(parseInt(ta.value),parseInt(ma.value))))}function W(mb){k.lastPrintPagesRadioChecked=Ba.checked;k.lastPrintSelectionOnlyChecked=va.checked;k.lastPrintCropRadioChecked=La.checked;k.lastPrintFitRadioChecked=Ia.checked;Ba.checked&&ma.value<ta.value?(k.lastPrintPagesFromInput=ma.value,k.lastPrintPagesToInput=ta.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);cb.value=Math.max(1,Math.min(1600,parseInt(cb.value)))+"%";k.lastPrintZoom=cb.value;k.lastPrintBorder=Wa.value;k.lastPrintGrid=
-hb.checked;k.lastPrintShadow=wb.checked;k.lastPrintTransparent=Fa.checked;k.lastPrintInclude=Ra.checked;k.lastPrintIcons=$a.checked;k.lastPrintSheetsAcross=Ua.value;k.lastPrintSheetsDown=ab.value;var ub={};ub.border=parseInt(Wa.value);ub.scale=parseInt(cb.value)/100;ub.grid=hb.checked;ub.shadows=wb.checked;ub.transparent=Fa.checked;ub.includeCopy=Ra.checked;ub.icons=$a.checked&&EditorUi.isElectronApp;ub.sheetsAcross=parseInt(Ua.value);ub.sheetsDown=parseInt(ab.value);ub.pagesFrom=parseInt(ma.value);
-ub.pagesTo=parseInt(ta.value);ub.allPages=xa.checked;ub.selection=va.checked;ub.pageView=Ha.checked;ub.crop=La.checked;ub.fit=Ia.checked;return null!=H?H(!mb,ub):k.print(!mb,ub)}function fa(mb){try{k.hideDialog(),null!=H?W(mb):k.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{W(mb),k.spinner.stop()}catch(ub){k.handleError(ub)}},0)}catch(ub){k.handleError(ub)}}var X=k.editor.graph,ea=document.createElement("div");ea.style.display="flex";ea.style.flexDirection=
-"column";ea.style.minHeight="0";var oa=document.createElement("div");oa.style.flex="1 1 auto";oa.style.minHeight="0";oa.style.overflowY="auto";ea.appendChild(oa);var la=document.createElement("h3");mxUtils.write(la,u||mxResources.get("print"));oa.appendChild(la);var ca=1,sa=1;la=document.createElement("div");la.className="geDialogSection";la.style.whiteSpace="nowrap";var xa=document.createElement("input");xa.style.marginRight="8px";xa.setAttribute("type","radio");xa.setAttribute("name","pages-printdialog");
-xa.setAttribute("id","gePrintDlgAllPages");var qa=document.createElement("div");qa.className="geDialogCheckRow";qa.appendChild(xa);u=document.createElement("label");u.setAttribute("for","gePrintDlgAllPages");mxUtils.write(u,mxResources.get("allPages"));qa.appendChild(u);la.appendChild(qa);var Ba=document.createElement("input");Ba.style.marginRight="8px";Ba.setAttribute("type","radio");Ba.setAttribute("name","pages-printdialog");Ba.setAttribute("id","gePrintDlgPages");qa=document.createElement("div");
-qa.className="geDialogCheckRow";qa.appendChild(Ba);u=document.createElement("label");u.setAttribute("for","gePrintDlgPages");mxUtils.write(u,mxResources.get("pages")+":");qa.appendChild(u);var ma=document.createElement("input");ma.style.margin="0 4px";ma.setAttribute("value","1");ma.setAttribute("type","number");ma.setAttribute("min","1");ma.style.width="40px";qa.appendChild(ma);u=document.createElement("span");mxUtils.write(u,mxResources.get("to"));qa.appendChild(u);var ta=ma.cloneNode(!0);qa.appendChild(ta);
-mxEvent.addListener(ma,"focus",function(){Ba.checked=!0});mxEvent.addListener(ta,"focus",function(){Ba.checked=!0});mxEvent.addListener(ma,"change",T);mxEvent.addListener(ta,"change",T);if(null!=k.pages&&(sa=k.pages.length,null!=k.currentPage))for(u=0;u<sa;u++)if(k.currentPage==k.pages[u]){ca=u+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ma.value=Math.min(sa,Math.max(1,k.lastPrintPagesFromInput)),ta.value=Math.min(sa,Math.max(1,k.lastPrintPagesToInput))):(ma.value=ca,ta.value=
-ca);ma.setAttribute("max",sa);ta.setAttribute("max",sa);u=mxUtils.button(mxResources.get("currentPage"),function(mb){ma.value=ca;ta.value=ca;Ba.checked=!0});u.className="geBtn";u.setAttribute("title",mxResources.get("currentPage"));u.style.marginLeft="4px";u.style.maxWidth="100px";qa.appendChild(u);la.appendChild(qa);1<sa&&oa.appendChild(la);qa=document.createElement("div");qa.className="geDialogCheckRow";var va=document.createElement("input");va.setAttribute("name","pages-printdialog");va.setAttribute("type",
-1==sa?"checkbox":"radio");va.setAttribute("id","gePrintDlgSelectionOnly");va.style.marginRight="8px";X.isSelectionEmpty()&&va.setAttribute("disabled","disabled");X.isEnabled()&&(qa.appendChild(va),u=document.createElement("label"),u.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(u,mxResources.get("selectionOnly")),qa.appendChild(u));X.isEnabled()&&(1<sa?la.appendChild(qa):(u=document.createElement("div"),u.className="geDialogSection",u.appendChild(qa),oa.appendChild(u)));!k.isPagesEnabled()||
-k.lastPrintPagesRadioChecked?Ba.checked=!0:!X.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?va.checked=!0:xa.checked=!0;X=k.addAdvancedSection(oa);oa=X.content;la=document.createElement("div");la.className="geDialogCheckRow";var Ha=document.createElement("input");Ha.style.marginRight="8px";Ha.setAttribute("type","radio");Ha.setAttribute("name","printSize");Ha.setAttribute("id","gePrintDlgPageView");la.appendChild(Ha);u=document.createElement("label");u.setAttribute("for","gePrintDlgPageView");
-mxUtils.write(u,mxResources.get("pageView"));la.appendChild(u);mxEvent.addListener(la,"click",function(){Ha.checked=!0});oa.appendChild(la);la=document.createElement("div");la.className="geDialogCheckRow";var La=document.createElement("input");La.style.marginRight="8px";La.setAttribute("type","radio");La.setAttribute("name","printSize");La.setAttribute("id","gePrintDlgCrop");la.appendChild(La);u=document.createElement("label");u.setAttribute("for","gePrintDlgCrop");mxUtils.write(u,mxResources.get("crop"));
-la.appendChild(u);mxEvent.addListener(la,"click",function(){La.checked=!0});oa.appendChild(la);la=document.createElement("div");la.className="geDialogCheckRow";la.style.alignItems="flex-start";var Ia=document.createElement("input");Ia.style.marginTop="4px";Ia.setAttribute("type","radio");Ia.setAttribute("name","printSize");la.appendChild(Ia);qa=document.createElement("table");qa.style.display="inline-block";qa.style.borderSpacing="0";var Ca=document.createElement("tbody"),Pa=document.createElement("tr"),
-Ka=Pa.cloneNode(!0),Na=document.createElement("td"),Oa=Na.cloneNode(!0),Ea=Na.cloneNode(!0),Aa=Na.cloneNode(!0),Ja=Na.cloneNode(!0),Ga=Na.cloneNode(!0);Na.style.textAlign="right";Aa.style.textAlign="right";mxUtils.write(Na,mxResources.get("fitTo"));mxEvent.addListener(la,"click",function(mb){mxEvent.getSource(mb)!=Ia&&(Ia.checked=!Ia.checked)});var Ua=document.createElement("input");Ua.style.margin="0 2px";Ua.style.boxSizing="border-box";Ua.setAttribute("value",k.lastPrintSheetsAcross||"1");Ua.setAttribute("min",
-"1");Ua.setAttribute("type","number");Ua.style.width="40px";Oa.appendChild(Ua);u=document.createElement("span");mxUtils.write(u,mxResources.get("fitToSheetsAcross"));Ea.appendChild(u);mxUtils.write(Aa,mxResources.get("fitToBy"));var ab=Ua.cloneNode(!0);ab.setAttribute("value",k.lastPrintSheetsDown||"1");Ja.appendChild(ab);mxEvent.addListener(Ua,"click",function(mb){Ia.checked=!0;mxEvent.consume(mb)});mxEvent.addListener(ab,"click",function(mb){Ia.checked=!0;mxEvent.consume(mb)});k.lastPrintCropRadioChecked?
-La.checked=!0:k.lastPrintFitRadioChecked?Ia.checked=!0:Ha.checked=!0;u=document.createElement("span");mxUtils.write(u,mxResources.get("fitToSheetsDown"));Ga.appendChild(u);Pa.appendChild(Na);Pa.appendChild(Oa);Pa.appendChild(Ea);Ka.appendChild(Aa);Ka.appendChild(Ja);Ka.appendChild(Ga);Ca.appendChild(Pa);Ca.appendChild(Ka);qa.appendChild(Ca);la.appendChild(qa);oa.appendChild(la);oa=document.createElement("div");oa.className="geDialogSection";u=document.createElement("div");u.className="geDialogFormRow";
-la=document.createElement("label");la.className="geDialogFormLabel";la.setAttribute("for","gePrintDlgBorder");mxUtils.write(la,mxResources.get("borderWidth"));u.appendChild(la);var Wa=document.createElement("input");Wa.setAttribute("type","number");Wa.setAttribute("min","0");Wa.setAttribute("id","gePrintDlgBorder");Wa.style.width="40px";Wa.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;u.appendChild(Wa);la=document.createElement("label");la.setAttribute("for",
-"gePrintDlgZoom");la.style.marginLeft="12px";la.style.marginRight="4px";mxUtils.write(la,mxResources.get("zoom"));u.appendChild(la);var cb=document.createElement("input");cb.setAttribute("id","gePrintDlgZoom");cb.style.width="60px";cb.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";u.appendChild(cb);oa.appendChild(u);la=document.createElement("div");la.className="geDialogCheckRow";var hb=document.createElement("input");hb.setAttribute("type","checkbox");hb.setAttribute("id","gePrintDlgGrid");hb.style.marginRight=
-"8px";hb.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;la.appendChild(hb);u=document.createElement("label");u.setAttribute("for","gePrintDlgGrid");mxUtils.write(u,mxResources.get("grid"));la.appendChild(u);oa.appendChild(la);la=document.createElement("div");la.className="geDialogCheckRow";var wb=document.createElement("input");wb.setAttribute("type","checkbox");wb.setAttribute("id","gePrintDlgShadows");wb.style.marginRight="8px";wb.checked=null!=k.lastPrintShadow?k.lastPrintShadow:!1;la.appendChild(wb);
-u=document.createElement("label");u.setAttribute("for","gePrintDlgShadows");mxUtils.write(u,mxResources.get("shadows"));la.appendChild(u);k.isOffline()&&!mxClient.IS_CHROMEAPP||la.appendChild(k.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(la.style.display="none");oa.appendChild(la);var Fa=document.createElement("input");Fa.setAttribute("type","checkbox");Fa.setAttribute("id","gePrintDlgTransparent");Fa.style.marginRight=
-"8px";Fa.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=H&&(la=document.createElement("div"),la.className="geDialogCheckRow",la.appendChild(Fa),u=document.createElement("label"),u.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(u,mxResources.get("transparentBackground")),la.appendChild(u),oa.appendChild(la));var Ra=document.createElement("input");Ra.setAttribute("type","checkbox");Ra.setAttribute("id","gePrintDlgInclude");Ra.style.marginRight="8px";Ra.checked=null!=
-k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(la=document.createElement("div"),la.className="geDialogCheckRow",la.appendChild(Ra),u=document.createElement("label"),u.setAttribute("for","gePrintDlgInclude"),mxUtils.write(u,mxResources.get("includeCopyOfMyDiagram")),la.appendChild(u),oa.appendChild(la));var $a=document.createElement("input");$a.setAttribute("type","checkbox");$a.setAttribute("id","gePrintDlgIcons");
-$a.style.marginRight="8px";$a.checked=null!=k.lastPrintIcons?k.lastPrintIcons:!1;null!=H&&EditorUi.isElectronApp&&(la=document.createElement("div"),la.className="geDialogCheckRow",la.appendChild($a),u=document.createElement("label"),u.setAttribute("for","gePrintDlgIcons"),mxUtils.write(u,mxResources.get("notes")),la.appendChild(u),oa.appendChild(la));X.wrapper.appendChild(oa);u=document.createElement("div");u.style.flex="0 0 auto";u.style.marginTop="16px";u.style.textAlign="right";u.style.whiteSpace=
-"nowrap";k.isOffline()&&!mxClient.IS_CHROMEAPP||null!=H||u.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));X=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});X.className="geBtn";k.editor.cancelFirst&&u.appendChild(X);PrintDialog.previewEnabled&&null==H&&(oa=mxUtils.button(mxResources.get("preview"),function(){fa(!1)}),oa.className="geBtn",u.appendChild(oa));P=null!=P?P:null!=H?"export":PrintDialog.previewEnabled?"print":"ok";P=mxUtils.button(mxResources.get(P),
-function(){fa(!0)});P.className="geBtn gePrimaryBtn";u.appendChild(P);k.editor.cancelFirst||u.appendChild(X);ea.appendChild(u);if(k.editor.isChromelessView()){var fb=function(){Editor.isDarkMode()?(ea.classList.add("geDarkMode"),ea.style.colorScheme="dark"):(ea.classList.remove("geDarkMode"),ea.style.colorScheme="light")};k.addListener("darkModeChanged",fb);fb();var rb=function(mb,ub){mb=ub.getProperty("dialog");ea.parentNode==mb.container&&(k.editor.removeListener(rb),k.removeListener(fb))};k.editor.addListener("hideDialog",
-rb)}this.container=ea};var ha=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=
-this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ha.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,
-this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(k){var u=[];if(null==k)return u;var H=function(ea){if(null!=ea)return ea=parseFloat(ea),!isNaN(ea)&&0<=ea?ea:void 0},P={fade:!0,pop:!0,wipe:!0};k=k.split("\n");for(var T=0;T<k.length;T++){var W=
-mxUtils.trim(k[T]);if(""!=W&&"#"!=W.charAt(0)){W=W.split(/\s+/);var fa={action:W[0],cell:W[1],arg:W[2]};if("wait"==fa.action){if(fa.delay=parseFloat(fa.cell),isNaN(fa.delay)||0>fa.delay)fa.delay=1E3}else if("setOpacity"==fa.action)fa.opacity=parseFloat(W[2]),isNaN(fa.opacity)&&(fa.opacity=1),fa.opacity=Math.max(0,Math.min(1,fa.opacity)),fa.duration=H(W[3]),fa.arg=void 0;else if("show"==fa.action){if(null!=fa.arg&&!P[fa.arg]){var X=H(fa.arg);null!=X&&(fa.duration=X,fa.arg=void 0)}null==fa.duration&&
-(fa.duration=H(W[3]))}else"hide"==fa.action&&(fa.duration=H(W[2]),fa.arg=void 0);u.push(fa)}}return u};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(k,u){return k.action!=u.action||"wait"==k.action||(k.arg||"")!=(u.arg||"")||(null!=k.opacity?k.opacity:"")!=(null!=u.opacity?u.opacity:"")||(null!=k.duration?k.duration:"")!=(null!=u.duration?u.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(k){if("wait"==k.action)return{wait:k.delay};var u="all"==k.cell?"*":k.cell;
-if(null==u)return null;var H={cells:[u]};if(null!=k.duration)H.delay=k.duration;else if("show"==k.action&&"fade"==k.arg)H.delay=Editor.animationFadeDelay;else if("hide"==k.action||"setOpacity"==k.action)H.delay=Editor.animationFadeDelay;return"show"==k.action?"fade"==k.arg?{fadeIn:H}:"pop"==k.arg?{popIn:H}:{wipeIn:H}:"hide"==k.action?{fadeOut:H}:"setOpacity"==k.action?(H.value=k.opacity,{fadeTo:H}):"flow"==k.action?(u={cells:[u]},"start"==k.arg?u.start=!0:"stop"==k.arg&&(u.start=!1),{flow:u}):null};
-Editor.convertLegacyAnimation=function(k){k=Editor.parseAnimationScript(k);for(var u=[{opacity:{cells:["*"],value:0}}],H=null,P=function(){null!=H&&(u.push(H),H=null)},T=function(X){null==H&&(H={});for(var ea in X){var oa=X[ea],la;if(la=null!=H[ea]&&null!=oa&&Array.isArray(H[ea].cells)&&Array.isArray(oa.cells))la=H[ea],la=la.delay===oa.delay&&la.value===oa.value&&la.start===oa.start;if(la)for(la=0;la<oa.cells.length;la++)H[ea].cells.push(oa.cells[la]);else null!=H[ea]&&(P(),H={}),H[ea]=oa}},W=0;W<
-k.length;W++){var fa=Editor.convertLegacyAnimationStep(k[W]);null!=fa&&(null!=fa.wait?(P(),u.push(fa)):T(fa))}P();return{animation:{steps:u}}};Editor.parseAnimationData=function(k){var u=function(P){null==P&&(P={});Array.isArray(P.steps)||(P.steps=[]);P.loop=null==P.loop?!0:!!P.loop;P.enabled=null==P.enabled?!0:!!P.enabled;return P};if(null==k||""===k)return u({steps:[]});if("string"==typeof k){var H=mxUtils.trim(k);return"{"==H.charAt(0)||"["==H.charAt(0)?Editor.parseAnimationData(JSON.parse(H)):
-u(Editor.convertLegacyAnimation(k).animation)}return null!=k.animation&&null!=k.animation.steps?u(k.animation):Array.isArray(k.steps)?u(k):u({steps:[]})};Editor.AnimationPlayer=function(k,u){this.graph=k;this.data=Editor.parseAnimationData(u);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(k){var u=[],H;for(H in k.cells){var P=k.cells[H];(k.isVertex(P)||k.isEdge(P))&&u.push(P)}return u};Editor.AnimationPlayer.prototype.collectReferencedCells=
-function(){for(var k=this.data.steps||[],u={},H=[],P=0;P<k.length;P++){var T=k[P],W;for(W in T)if("wait"!=W&&"open"!=W){var fa=T[W];if("object"===typeof fa&&null!=fa){fa=this.graph.getCellsForAction(fa,!0);for(var X=0;X<fa.length;X++)u[fa[X].id]||(u[fa[X].id]=!0,H.push(fa[X]))}}}return H};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var k=this.collectReferencedCells();k=this.graph.getNodesForCells(k);this.snapshot=[];for(var u=0;u<k.length;u++)this.snapshot.push({node:k[u],opacity:k[u].style.opacity})};
-Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var k=0;k<this.snapshot.length;k++)Graph.setTransitionForNodes([this.snapshot[k].node],null),this.snapshot[k].node.style.opacity=this.snapshot[k].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(k){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){k=k||{};this.running=!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var u=this,H=this.data.steps||
-[],P=function(W,fa){if(null==u.graph||u.graph.isGraphTornDown())u.running=!1;else if(u.cancelled||W>=H.length)fa();else{for(var X=W+1;X<H.length&&!0===H[X].immediate&&!u.cancelled;)X++;if("function"==typeof k.onStep)try{k.onStep(W,X)}catch(ea){}u.graph.executeCustomActions(Graph.flattenAnimationActions(H.slice(W,X)),function(){P(X,fa)},null)}},T=function(){null==u.graph||u.graph.isGraphTornDown()?u.running=!1:u.cancelled?(u.restoreOpacity(),u.running=!1):(u.snapshotOpacity(),P(0,function(){if(u.cancelled)u.restoreOpacity(),
-u.running=!1;else{if("function"==typeof k.onStep)try{k.onStep(-1)}catch(W){}k.loop?(u.graph.refresh(),u.restoreOpacity(),window.setTimeout(T,0)):(u.running=!1,u.restoreOpacity(),null!=k.done&&k.done())}}))};k.defer?window.setTimeout(T,0):T()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var k=[],u=this.collectReferencedCells(),H=0;H<u.length;H++)this.graph.getModel().isEdge(u[H])&&k.push(u[H]);0<k.length&&Editor.toggleFlowAnimation(this.graph,
-k,"stop")};Editor.toggleFlowAnimation=function(k,u,H){H=H||"toggle";for(var P=0;P<u.length;P++)if(k.getModel().isEdge(u[P])){var T=k.view.getState(u[P]);if(null!=T&&null!=T.shape){var W=null!=T.shape.getFlowAnimationPath?T.shape.getFlowAnimationPath():null;if(null!=W){var fa="mxEdgeFlow"==W.getAttribute("class"),X="start"==H||"toggle"==H&&!fa;fa="stop"==H||"toggle"==H&&fa;T="1"==mxUtils.getValue(T.style,mxConstants.STYLE_DASHED,"0");fa?(W.removeAttribute("class"),T||W.removeAttribute("stroke-dasharray")):
-X&&(W.setAttribute("class","mxEdgeFlow"),T||W.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(k,u){var H=k.getModel().getRoot(),P=null;null!=H.value&&"object"==typeof H.value&&(P=H.value.getAttribute("animation"));if(null==P||""==P)return null;try{var T=Editor.parseAnimationData(P)}catch(fa){return null}if(!T.steps||0==T.steps.length||!1===T.enabled)return null;H={};if(null!=u)for(var W in u)H[W]=u[W];null==H.loop&&(H.loop=T.loop);null==H.defer&&(H.defer=!0);k=new Editor.AnimationPlayer(k,
-T);k.play(H);return k};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var k=document.createElement("style");k.type="text/css";k.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));document.getElementsByTagName("head")[0].appendChild(k)}catch(u){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="31.4.5";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",
+this.getCellsForAction(qa.toggleStyle,!0);var va=qa.toggleStyle.value,Ga=""!==qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:null;oa(qa.toggleStyle)?this.toggleCellStylesTransient(qa.toggleStyle.key,Ga,ta,va):(fa(),this.toggleCellStyleValues(qa.toggleStyle.key,va,Ga,ta))}null!=qa.style&&null!=qa.style.key&&(ta=this.getCellsForAction(qa.style,!0),oa(qa.style)?this.setCellStylesTransient(qa.style.key,qa.style.value,ta):(fa(),this.setCellStyles(qa.style.key,qa.style.value,ta)));ta=[];null!=
+qa.select&&this.isEnabled()&&(ta=this.getCellsForAction(qa.select),this.setSelectionCells(ta));null!=qa.highlight&&(ta=this.getCellsForAction(qa.highlight),this.highlightCells(ta,qa.highlight.color,qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ta=this.getCellsForAction(qa.scroll));if(null!=qa.viewbox){va=qa.viewbox;if(null!=va.cells||null!=va.tags||null!=va.layers)if(Ga=this.getBoundingBox(this.getCellsForAction(va)),null!=Ga){var La=this.useCssTransforms?1:this.view.scale,Ia=this.useCssTransforms?
+new mxPoint(0,0):this.view.translate,Ca=null==va.border||""===va.border||isNaN(parseFloat(va.border))?null:2*parseFloat(va.border);va={x:Ga.x/La-Ia.x,y:Ga.y/La-Ia.y,width:Math.max(1,Ga.width/La),height:Math.max(1,Ga.height/La),border:Ca,smooth:va.smooth}}else va=null;null!=va&&(!0!==va.smooth||xa?this.useCssTransforms?this.fitBoundsCssTransform(va,va.border):this.fitWindow(va,va.border):(U++,this.smoothFitWindow(va,va.border,ka)))}0<ta.length&&(va=null==qa.scroll||null==qa.scroll.border||""===qa.scroll.border||
+isNaN(parseFloat(qa.scroll.border))?null:parseFloat(qa.scroll.border),null==qa.scroll||!0!==qa.scroll.smooth||xa?this.useCssTransforms?this.scrollCellToVisibleCssTransform(ta[0],va):this.scrollCellToVisibleBorder(ta[0],va):(U++,this.smoothScrollCellToVisible(ta[0],va,ka)));null!=H&&null!=qa.explore&&Graph.exploreFromCell(this,H,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle)for(va=qa.tags.toggle,0==va.length&&(va=this.getAllTags()),ta=0;ta<va.length;ta++)this.toggleHiddenTag(va[ta]);va=null;
+null!=qa.tags.hidden&&(null==va&&(va=[]),va=va.concat(qa.tags.hidden));if(null!=qa.tags.visible)for(null==va&&(va=[]),Ga=this.getAllTags(),ta=0;ta<Ga.length;ta++)0>mxUtils.indexOf(qa.tags.visible,Ga[ta])&&0>mxUtils.indexOf(va,Ga[ta])&&va.push(Ga[ta]);null!=va&&this.setHiddenTags(va);this.refresh()}if(0<Ba.length){U++;ta=null!=qa.steps?qa.steps:30;va=qa.delay;Ga=["wipeIn","wipeOut","popIn","popOut"];La=null;for(Ia=0;Ia<Ga.length;Ia++)Ca=qa[Ga[Ia]],null!=Ca&&null!=Ca.delay&&(La=null==La?Ca.delay:Math.max(La,
+Ca.delay));null!=La&&(va=La/ta);this.executeAnimations(Ba,ka,xa?1:ta,xa?0:va)}}while(W<k.length&&!0===k[W].immediate&&!this.stoppingCustomActions);0==U?sa():X()}else this.stoppingCustomActions=this.executingCustomActions=!1,X(),null!=u&&u()}),sa=mxUtils.bind(this,function(){try{ba()}catch(xa){throw this.stoppingCustomActions=this.executingCustomActions=!1,X(),xa;}});sa()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,u){var H=this.getLinkForCell(u);null!=H&&"data:action/json,"==H.substring(0,
+17)&&this.setLinkForCell(u,this.updateCustomLink(k,H));if(this.isHtmlLabel(u)){var P=document.createElement("div");P.innerHTML=Graph.sanitizeHtml(this.getLabel(u));for(var U=P.getElementsByTagName("a"),W=!1,fa=0;fa<U.length;fa++)H=U[fa].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(U[fa].setAttribute("href",this.updateCustomLink(k,H)),W=!0);W&&this.labelChanged(u,P.innerHTML)}};Graph.prototype.updateCustomLink=function(k,u){if("data:action/json,"==u.substring(0,17))try{var H=
+JSON.parse(u.substring(17));null!=H.actions&&(this.updateCustomLinkActions(k,H.actions),u="data:action/json,"+JSON.stringify(H))}catch(P){}return u};Graph.prototype.updateCustomLinkActions=function(k,u){for(var H=0;H<u.length;H++){var P=u[H],U;for(U in P)this.updateCustomLinkAction(k,P[U],"cells"),this.updateCustomLinkAction(k,P[U],"excludeCells"),this.updateCustomLinkAction(k,P[U],"layers")}};Graph.prototype.updateCustomLinkAction=function(k,u,H){if(null!=u&&null!=u[H]){for(var P=[],U=0;U<u[H].length;U++)if("*"==
+u[H][U])P.push(u[H][U]);else{var W=k[u[H][U]];null!=W?""!=W&&P.push(W):P.push(u[H][U])}u[H]=P}};Graph.prototype.getCellsForAction=function(k,u,H){var P="or"===k.tagsMatch?"or":"and",U={},W=[],fa=function(X){for(var ea=0;ea<X.length;ea++){var oa=X[ea].id;U[oa]||(U[oa]=!0,W.push(X[ea]))}};fa(this.getCellsById(k.cells));fa(this.getCellsForTags(k.tags,null,u,!1,P));fa(H?this.getLayerCells(k.layers):this.getCellsForLayers(k.layers));if(!0===k.descendants)for(H=W.slice(),u=0;u<H.length;u++)fa(this.model.getDescendants(H[u]));
+if(null!=k.excludeCells&&0<k.excludeCells.length){fa={};H=!1;for(u=0;u<k.excludeCells.length;u++){if("*"===k.excludeCells[u]){H=!0;break}fa[k.excludeCells[u]]=!0}if(H)return[];k=[];for(u=0;u<W.length;u++)fa[W[u].id]||k.push(W[u]);return k}return W};Graph.prototype.getCellsById=function(k){var u=[];if(null!=k)for(var H=0;H<k.length;H++)if("*"==k[H]){var P=this.model.getRoot();u=u.concat(this.model.filterDescendants(function(W){return W!=P},P))}else{var U=this.model.getCell(k[H]);null!=U&&u.push(U)}return u};
+Graph.prototype.getCellsForLayers=function(k){var u=[];if(Array.isArray(k))for(var H=0;H<k.length;H++){var P=this.model.getCell(k[H]);null!=P&&(u=u.concat(this.model.filterDescendants(function(U){return U!=P},P)))}return u};Graph.prototype.getLayerCells=function(k){var u=[];if(Array.isArray(k))for(var H=0;H<k.length;H++){var P=this.model.getCell(k[H]);null!=P&&u.push(P)}return u};var la=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return la.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(k))};
+Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var u=mxUtils.indexOf(this.hiddenTags,k);0>u?this.hiddenTags.push(k):0<=u&&this.hiddenTags.splice(u,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;for(var u=0;u<k.length;u++)if(0>
+mxUtils.indexOf(this.hiddenTags,k[u]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,u,H,P,U){var W=[];U="or"===U;if(null!=k){u=null!=u?u:this.model.getDescendants(this.model.getRoot());for(var fa=0,X={},ea=0;ea<k.length;ea++)0<k[ea].length&&(X[k[ea]]=!0,fa++);for(ea=0;ea<u.length;ea++)if(H&&this.model.getParent(u[ea])==this.model.root||this.model.isVertex(u[ea])||this.model.isEdge(u[ea])){var oa=this.getTagsForCell(u[ea]),ka=!1;if(0<oa.length&&(oa=oa.split(" "),U||oa.length>=k.length)){for(var ba=
+ka=0;ba<oa.length&&ka<fa;ba++)null!=X[oa[ba]]&&ka++;ka=U?0<ka:ka==fa}ka&&(1!=P||this.isCellVisible(u[ea]))&&W.push(u[ea])}}return W};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var u=null,H=[],P=0;P<k.length;P++){var U=this.getTagsForCell(k[P]);H=[];if(0<U.length){U=U.split(" ");for(var W={},fa=0;fa<U.length;fa++)if(null==u||null!=u[U[fa]])W[U[fa]]=!0,H.push(U[fa]);u=W}else return[]}return H};
+Graph.prototype.getTagsForCells=function(k){for(var u=[],H={},P=0;P<k.length;P++){var U=this.getTagsForCell(k[P]);if(0<U.length){U=U.split(" ");for(var W=0;W<U.length;W++)null==H[U[W]]&&(H[U[W]]=!0,u.push(U[W]))}}return u};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,u){if(0<k.length&&0<u.length){this.model.beginUpdate();try{for(var H=0;H<k.length;H++){for(var P=this.getTagsForCell(k[H]),U=P.split(" "),W=!1,fa=
+0;fa<u.length;fa++){var X=mxUtils.trim(u[fa]);""!=X&&0>mxUtils.indexOf(U,X)&&(P=0<P.length?P+" "+X:X,W=!0)}W&&this.setAttributeForCell(k[H],"tags",P)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,u){if(0<k.length&&0<u.length){this.model.beginUpdate();try{for(var H=0;H<k.length;H++){var P=this.getTagsForCell(k[H]);if(0<P.length){for(var U=P.split(" "),W=!1,fa=0;fa<u.length;fa++){var X=mxUtils.indexOf(U,u[fa]);0<=X&&(U.splice(X,1),W=!0)}W&&this.setAttributeForCell(k[H],
+"tags",U.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var u=0;u<k.length;u++)this.model.setVisible(k[u],!this.model.isVisible(k[u]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,u){this.model.beginUpdate();try{for(var H=0;H<k.length;H++)this.model.setVisible(k[H],u)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,u,H,P){for(var U=0;U<k.length;U++)this.highlightCell(k[U],
+u,H,P)};Graph.prototype.highlightCell=function(k,u,H,P,U){u=null!=u?u:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;k=this.view.getState(k);var W=null;null!=k&&(U=null!=U?U:4,U=Math.max(U+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+U),W=new mxCellHighlight(this,u,U,!1),null!=P&&(W.opacity=P),W.highlight(k),window.setTimeout(function(){null!=W.shape&&(mxUtils.setPrefixedStyle(W.shape.node.style,"transition","all 1200ms ease-in-out"),W.shape.node.style.opacity=0);window.setTimeout(function(){W.destroy()},
+1200)},H));return W};Graph.prototype.addSvgShadow=function(k,u,H,P){P=null!=P?P:!0;var U=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=H&&H||(u=null!=u?u:k.getElementsByTagName("g")[0],null!=u&&(this.updateShadowFilter(u,!0),!isNaN(parseInt(k.getAttribute("width")))&&P&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+U),k.setAttribute("height",parseInt(k.getAttribute("height"))+U),u=k.getAttribute("viewBox"),null!=u&&0<u.length&&(u=u.split(" "),3<u.length&&(w=parseFloat(u[2])+U,
+h=parseFloat(u[3])+U,k.setAttribute("viewBox",u[0]+" "+u[1]+" "+w+" "+h))))));return U};Graph.prototype.updateShadowFilter=function(k,u){mxClient.IS_SF||(u?(u=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),k.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+u.cssText+")"):k.style.filter="")};Graph.prototype.setShadowVisible=function(k,u){u=null!=u?u:!0;this.shadowVisible=
+k;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);u&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),u=0;do var H=this.model.getChildAt(this.model.root,
+u);while(u++<k&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=
+[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",
+STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",
+STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=
+[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=
+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=
+[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];
+mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+
+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=
+[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate4=[SHAPES_PATH+"/mxArchiMate3.js",SHAPES_PATH+"/mxArchiMate4.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",
+STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.atlassian2=[SHAPES_PATH+"/mxAtlassian2.js",STENCIL_PATH+"/atlassian2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+
+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
+[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(k){var u=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?u="mxgraph.er":"sysML"==k.substring(0,5)&&(u="mxgraph.sysml"));return u};var ua=mxMarker.createMarker;mxMarker.createMarker=function(k,u,H,P,U,W,
+fa,X,ea,oa){if(null!=H&&null==mxMarker.markers[H]){var ka=this.getPackageForType(H);null!=ka&&mxStencilRegistry.getStencil(ka)}return ua.apply(this,arguments)};var Da=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,u,H,P,U,W){"1"==mxUtils.getValue(u.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(u.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return Da.apply(this,arguments)};PrintDialog.prototype.create=function(k,u,H,P){function U(){ta.value=Math.max(1,Math.min(sa,
+Math.max(parseInt(ta.value),parseInt(ma.value))));ma.value=Math.max(1,Math.min(sa,Math.min(parseInt(ta.value),parseInt(ma.value))))}function W(mb){k.lastPrintPagesRadioChecked=Ba.checked;k.lastPrintSelectionOnlyChecked=va.checked;k.lastPrintCropRadioChecked=La.checked;k.lastPrintFitRadioChecked=Ia.checked;Ba.checked&&ma.value<ta.value?(k.lastPrintPagesFromInput=ma.value,k.lastPrintPagesToInput=ta.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);cb.value=Math.max(1,Math.min(1600,
+parseInt(cb.value)))+"%";k.lastPrintZoom=cb.value;k.lastPrintBorder=Wa.value;k.lastPrintGrid=hb.checked;k.lastPrintShadow=wb.checked;k.lastPrintTransparent=Fa.checked;k.lastPrintInclude=Ra.checked;k.lastPrintIcons=$a.checked;k.lastPrintSheetsAcross=Ua.value;k.lastPrintSheetsDown=ab.value;var ub={};ub.border=parseInt(Wa.value);ub.scale=parseInt(cb.value)/100;ub.grid=hb.checked;ub.shadows=wb.checked;ub.transparent=Fa.checked;ub.includeCopy=Ra.checked;ub.icons=$a.checked&&EditorUi.isElectronApp;ub.sheetsAcross=
+parseInt(Ua.value);ub.sheetsDown=parseInt(ab.value);ub.pagesFrom=parseInt(ma.value);ub.pagesTo=parseInt(ta.value);ub.allPages=xa.checked;ub.selection=va.checked;ub.pageView=Ga.checked;ub.crop=La.checked;ub.fit=Ia.checked;return null!=H?H(!mb,ub):k.print(!mb,ub)}function fa(mb){try{k.hideDialog(),null!=H?W(mb):k.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{W(mb),k.spinner.stop()}catch(ub){k.handleError(ub)}},0)}catch(ub){k.handleError(ub)}}var X=
+k.editor.graph,ea=document.createElement("div");ea.style.display="flex";ea.style.flexDirection="column";ea.style.minHeight="0";var oa=document.createElement("div");oa.style.flex="1 1 auto";oa.style.minHeight="0";oa.style.overflowY="auto";ea.appendChild(oa);var ka=document.createElement("h3");mxUtils.write(ka,u||mxResources.get("print"));oa.appendChild(ka);var ba=1,sa=1;ka=document.createElement("div");ka.className="geDialogSection";ka.style.whiteSpace="nowrap";var xa=document.createElement("input");
+xa.style.marginRight="8px";xa.setAttribute("type","radio");xa.setAttribute("name","pages-printdialog");xa.setAttribute("id","gePrintDlgAllPages");var qa=document.createElement("div");qa.className="geDialogCheckRow";qa.appendChild(xa);u=document.createElement("label");u.setAttribute("for","gePrintDlgAllPages");mxUtils.write(u,mxResources.get("allPages"));qa.appendChild(u);ka.appendChild(qa);var Ba=document.createElement("input");Ba.style.marginRight="8px";Ba.setAttribute("type","radio");Ba.setAttribute("name",
+"pages-printdialog");Ba.setAttribute("id","gePrintDlgPages");qa=document.createElement("div");qa.className="geDialogCheckRow";qa.appendChild(Ba);u=document.createElement("label");u.setAttribute("for","gePrintDlgPages");mxUtils.write(u,mxResources.get("pages")+":");qa.appendChild(u);var ma=document.createElement("input");ma.style.margin="0 4px";ma.setAttribute("value","1");ma.setAttribute("type","number");ma.setAttribute("min","1");ma.style.width="40px";qa.appendChild(ma);u=document.createElement("span");
+mxUtils.write(u,mxResources.get("to"));qa.appendChild(u);var ta=ma.cloneNode(!0);qa.appendChild(ta);mxEvent.addListener(ma,"focus",function(){Ba.checked=!0});mxEvent.addListener(ta,"focus",function(){Ba.checked=!0});mxEvent.addListener(ma,"change",U);mxEvent.addListener(ta,"change",U);if(null!=k.pages&&(sa=k.pages.length,null!=k.currentPage))for(u=0;u<sa;u++)if(k.currentPage==k.pages[u]){ba=u+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ma.value=Math.min(sa,Math.max(1,k.lastPrintPagesFromInput)),
+ta.value=Math.min(sa,Math.max(1,k.lastPrintPagesToInput))):(ma.value=ba,ta.value=ba);ma.setAttribute("max",sa);ta.setAttribute("max",sa);u=mxUtils.button(mxResources.get("currentPage"),function(mb){ma.value=ba;ta.value=ba;Ba.checked=!0});u.className="geBtn";u.setAttribute("title",mxResources.get("currentPage"));u.style.marginLeft="4px";u.style.maxWidth="100px";qa.appendChild(u);ka.appendChild(qa);1<sa&&oa.appendChild(ka);qa=document.createElement("div");qa.className="geDialogCheckRow";var va=document.createElement("input");
+va.setAttribute("name","pages-printdialog");va.setAttribute("type",1==sa?"checkbox":"radio");va.setAttribute("id","gePrintDlgSelectionOnly");va.style.marginRight="8px";X.isSelectionEmpty()&&va.setAttribute("disabled","disabled");X.isEnabled()&&(qa.appendChild(va),u=document.createElement("label"),u.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(u,mxResources.get("selectionOnly")),qa.appendChild(u));X.isEnabled()&&(1<sa?ka.appendChild(qa):(u=document.createElement("div"),u.className="geDialogSection",
+u.appendChild(qa),oa.appendChild(u)));!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?Ba.checked=!0:!X.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?va.checked=!0:xa.checked=!0;X=k.addAdvancedSection(oa);oa=X.content;ka=document.createElement("div");ka.className="geDialogCheckRow";var Ga=document.createElement("input");Ga.style.marginRight="8px";Ga.setAttribute("type","radio");Ga.setAttribute("name","printSize");Ga.setAttribute("id","gePrintDlgPageView");ka.appendChild(Ga);u=document.createElement("label");
+u.setAttribute("for","gePrintDlgPageView");mxUtils.write(u,mxResources.get("pageView"));ka.appendChild(u);mxEvent.addListener(ka,"click",function(){Ga.checked=!0});oa.appendChild(ka);ka=document.createElement("div");ka.className="geDialogCheckRow";var La=document.createElement("input");La.style.marginRight="8px";La.setAttribute("type","radio");La.setAttribute("name","printSize");La.setAttribute("id","gePrintDlgCrop");ka.appendChild(La);u=document.createElement("label");u.setAttribute("for","gePrintDlgCrop");
+mxUtils.write(u,mxResources.get("crop"));ka.appendChild(u);mxEvent.addListener(ka,"click",function(){La.checked=!0});oa.appendChild(ka);ka=document.createElement("div");ka.className="geDialogCheckRow";ka.style.alignItems="flex-start";var Ia=document.createElement("input");Ia.style.marginTop="4px";Ia.setAttribute("type","radio");Ia.setAttribute("name","printSize");ka.appendChild(Ia);qa=document.createElement("table");qa.style.display="inline-block";qa.style.borderSpacing="0";var Ca=document.createElement("tbody"),
+Pa=document.createElement("tr"),Ka=Pa.cloneNode(!0),Na=document.createElement("td"),Oa=Na.cloneNode(!0),Ea=Na.cloneNode(!0),Aa=Na.cloneNode(!0),Ja=Na.cloneNode(!0),Ha=Na.cloneNode(!0);Na.style.textAlign="right";Aa.style.textAlign="right";mxUtils.write(Na,mxResources.get("fitTo"));mxEvent.addListener(ka,"click",function(mb){mxEvent.getSource(mb)!=Ia&&(Ia.checked=!Ia.checked)});var Ua=document.createElement("input");Ua.style.margin="0 2px";Ua.style.boxSizing="border-box";Ua.setAttribute("value",k.lastPrintSheetsAcross||
+"1");Ua.setAttribute("min","1");Ua.setAttribute("type","number");Ua.style.width="40px";Oa.appendChild(Ua);u=document.createElement("span");mxUtils.write(u,mxResources.get("fitToSheetsAcross"));Ea.appendChild(u);mxUtils.write(Aa,mxResources.get("fitToBy"));var ab=Ua.cloneNode(!0);ab.setAttribute("value",k.lastPrintSheetsDown||"1");Ja.appendChild(ab);mxEvent.addListener(Ua,"click",function(mb){Ia.checked=!0;mxEvent.consume(mb)});mxEvent.addListener(ab,"click",function(mb){Ia.checked=!0;mxEvent.consume(mb)});
+k.lastPrintCropRadioChecked?La.checked=!0:k.lastPrintFitRadioChecked?Ia.checked=!0:Ga.checked=!0;u=document.createElement("span");mxUtils.write(u,mxResources.get("fitToSheetsDown"));Ha.appendChild(u);Pa.appendChild(Na);Pa.appendChild(Oa);Pa.appendChild(Ea);Ka.appendChild(Aa);Ka.appendChild(Ja);Ka.appendChild(Ha);Ca.appendChild(Pa);Ca.appendChild(Ka);qa.appendChild(Ca);ka.appendChild(qa);oa.appendChild(ka);oa=document.createElement("div");oa.className="geDialogSection";u=document.createElement("div");
+u.className="geDialogFormRow";ka=document.createElement("label");ka.className="geDialogFormLabel";ka.setAttribute("for","gePrintDlgBorder");mxUtils.write(ka,mxResources.get("borderWidth"));u.appendChild(ka);var Wa=document.createElement("input");Wa.setAttribute("type","number");Wa.setAttribute("min","0");Wa.setAttribute("id","gePrintDlgBorder");Wa.style.width="40px";Wa.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;u.appendChild(Wa);ka=document.createElement("label");
+ka.setAttribute("for","gePrintDlgZoom");ka.style.marginLeft="12px";ka.style.marginRight="4px";mxUtils.write(ka,mxResources.get("zoom"));u.appendChild(ka);var cb=document.createElement("input");cb.setAttribute("id","gePrintDlgZoom");cb.style.width="60px";cb.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";u.appendChild(cb);oa.appendChild(u);ka=document.createElement("div");ka.className="geDialogCheckRow";var hb=document.createElement("input");hb.setAttribute("type","checkbox");hb.setAttribute("id",
+"gePrintDlgGrid");hb.style.marginRight="8px";hb.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;ka.appendChild(hb);u=document.createElement("label");u.setAttribute("for","gePrintDlgGrid");mxUtils.write(u,mxResources.get("grid"));ka.appendChild(u);oa.appendChild(ka);ka=document.createElement("div");ka.className="geDialogCheckRow";var wb=document.createElement("input");wb.setAttribute("type","checkbox");wb.setAttribute("id","gePrintDlgShadows");wb.style.marginRight="8px";wb.checked=null!=k.lastPrintShadow?
+k.lastPrintShadow:!1;ka.appendChild(wb);u=document.createElement("label");u.setAttribute("for","gePrintDlgShadows");mxUtils.write(u,mxResources.get("shadows"));ka.appendChild(u);k.isOffline()&&!mxClient.IS_CHROMEAPP||ka.appendChild(k.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(ka.style.display="none");oa.appendChild(ka);var Fa=document.createElement("input");Fa.setAttribute("type","checkbox");Fa.setAttribute("id",
+"gePrintDlgTransparent");Fa.style.marginRight="8px";Fa.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=H&&(ka=document.createElement("div"),ka.className="geDialogCheckRow",ka.appendChild(Fa),u=document.createElement("label"),u.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(u,mxResources.get("transparentBackground")),ka.appendChild(u),oa.appendChild(ka));var Ra=document.createElement("input");Ra.setAttribute("type","checkbox");Ra.setAttribute("id","gePrintDlgInclude");
+Ra.style.marginRight="8px";Ra.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(ka=document.createElement("div"),ka.className="geDialogCheckRow",ka.appendChild(Ra),u=document.createElement("label"),u.setAttribute("for","gePrintDlgInclude"),mxUtils.write(u,mxResources.get("includeCopyOfMyDiagram")),ka.appendChild(u),oa.appendChild(ka));var $a=document.createElement("input");$a.setAttribute("type","checkbox");
+$a.setAttribute("id","gePrintDlgIcons");$a.style.marginRight="8px";$a.checked=null!=k.lastPrintIcons?k.lastPrintIcons:!1;null!=H&&EditorUi.isElectronApp&&(ka=document.createElement("div"),ka.className="geDialogCheckRow",ka.appendChild($a),u=document.createElement("label"),u.setAttribute("for","gePrintDlgIcons"),mxUtils.write(u,mxResources.get("notes")),ka.appendChild(u),oa.appendChild(ka));X.wrapper.appendChild(oa);u=document.createElement("div");u.style.flex="0 0 auto";u.style.marginTop="16px";u.style.textAlign=
+"right";u.style.whiteSpace="nowrap";k.isOffline()&&!mxClient.IS_CHROMEAPP||null!=H||u.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));X=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});X.className="geBtn";k.editor.cancelFirst&&u.appendChild(X);PrintDialog.previewEnabled&&null==H&&(oa=mxUtils.button(mxResources.get("preview"),function(){fa(!1)}),oa.className="geBtn",u.appendChild(oa));P=null!=P?P:null!=H?"export":PrintDialog.previewEnabled?"print":
+"ok";P=mxUtils.button(mxResources.get(P),function(){fa(!0)});P.className="geBtn gePrimaryBtn";u.appendChild(P);k.editor.cancelFirst||u.appendChild(X);ea.appendChild(u);if(k.editor.isChromelessView()){var fb=function(){Editor.isDarkMode()?(ea.classList.add("geDarkMode"),ea.style.colorScheme="dark"):(ea.classList.remove("geDarkMode"),ea.style.colorScheme="light")};k.addListener("darkModeChanged",fb);fb();var rb=function(mb,ub){mb=ub.getProperty("dialog");ea.parentNode==mb.container&&(k.editor.removeListener(rb),
+k.removeListener(fb))};k.editor.addListener("hideDialog",rb)}this.container=ea};var ha=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&
+(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ha.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=
+this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(k){var u=[];if(null==k)return u;var H=function(ea){if(null!=ea)return ea=parseFloat(ea),!isNaN(ea)&&0<=ea?ea:void 0},P=
+{fade:!0,pop:!0,wipe:!0};k=k.split("\n");for(var U=0;U<k.length;U++){var W=mxUtils.trim(k[U]);if(""!=W&&"#"!=W.charAt(0)){W=W.split(/\s+/);var fa={action:W[0],cell:W[1],arg:W[2]};if("wait"==fa.action){if(fa.delay=parseFloat(fa.cell),isNaN(fa.delay)||0>fa.delay)fa.delay=1E3}else if("setOpacity"==fa.action)fa.opacity=parseFloat(W[2]),isNaN(fa.opacity)&&(fa.opacity=1),fa.opacity=Math.max(0,Math.min(1,fa.opacity)),fa.duration=H(W[3]),fa.arg=void 0;else if("show"==fa.action){if(null!=fa.arg&&!P[fa.arg]){var X=
+H(fa.arg);null!=X&&(fa.duration=X,fa.arg=void 0)}null==fa.duration&&(fa.duration=H(W[3]))}else"hide"==fa.action&&(fa.duration=H(W[2]),fa.arg=void 0);u.push(fa)}}return u};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(k,u){return k.action!=u.action||"wait"==k.action||(k.arg||"")!=(u.arg||"")||(null!=k.opacity?k.opacity:"")!=(null!=u.opacity?u.opacity:"")||(null!=k.duration?k.duration:"")!=(null!=u.duration?u.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(k){if("wait"==
+k.action)return{wait:k.delay};var u="all"==k.cell?"*":k.cell;if(null==u)return null;var H={cells:[u]};if(null!=k.duration)H.delay=k.duration;else if("show"==k.action&&"fade"==k.arg)H.delay=Editor.animationFadeDelay;else if("hide"==k.action||"setOpacity"==k.action)H.delay=Editor.animationFadeDelay;return"show"==k.action?"fade"==k.arg?{fadeIn:H}:"pop"==k.arg?{popIn:H}:{wipeIn:H}:"hide"==k.action?{fadeOut:H}:"setOpacity"==k.action?(H.value=k.opacity,{fadeTo:H}):"flow"==k.action?(u={cells:[u]},"start"==
+k.arg?u.start=!0:"stop"==k.arg&&(u.start=!1),{flow:u}):null};Editor.convertLegacyAnimation=function(k){k=Editor.parseAnimationScript(k);for(var u=[{opacity:{cells:["*"],value:0}}],H=null,P=function(){null!=H&&(u.push(H),H=null)},U=function(X){null==H&&(H={});for(var ea in X){var oa=X[ea],ka;if(ka=null!=H[ea]&&null!=oa&&Array.isArray(H[ea].cells)&&Array.isArray(oa.cells))ka=H[ea],ka=ka.delay===oa.delay&&ka.value===oa.value&&ka.start===oa.start;if(ka)for(ka=0;ka<oa.cells.length;ka++)H[ea].cells.push(oa.cells[ka]);
+else null!=H[ea]&&(P(),H={}),H[ea]=oa}},W=0;W<k.length;W++){var fa=Editor.convertLegacyAnimationStep(k[W]);null!=fa&&(null!=fa.wait?(P(),u.push(fa)):U(fa))}P();return{animation:{steps:u}}};Editor.parseAnimationData=function(k){var u=function(P){null==P&&(P={});Array.isArray(P.steps)||(P.steps=[]);P.loop=null==P.loop?!0:!!P.loop;P.enabled=null==P.enabled?!0:!!P.enabled;return P};if(null==k||""===k)return u({steps:[]});if("string"==typeof k){var H=mxUtils.trim(k);return"{"==H.charAt(0)||"["==H.charAt(0)?
+Editor.parseAnimationData(JSON.parse(H)):u(Editor.convertLegacyAnimation(k).animation)}return null!=k.animation&&null!=k.animation.steps?u(k.animation):Array.isArray(k.steps)?u(k):u({steps:[]})};Editor.AnimationPlayer=function(k,u){this.graph=k;this.data=Editor.parseAnimationData(u);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(k){var u=[],H;for(H in k.cells){var P=k.cells[H];(k.isVertex(P)||k.isEdge(P))&&u.push(P)}return u};Editor.AnimationPlayer.prototype.collectReferencedCells=
+function(){for(var k=this.data.steps||[],u={},H=[],P=0;P<k.length;P++){var U=k[P],W;for(W in U)if("wait"!=W&&"open"!=W){var fa=U[W];if("object"===typeof fa&&null!=fa){fa=this.graph.getCellsForAction(fa,!0);for(var X=0;X<fa.length;X++)u[fa[X].id]||(u[fa[X].id]=!0,H.push(fa[X]))}}}return H};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var k=this.collectReferencedCells();k=this.graph.getNodesForCells(k);var u=new Set;if(null==this.snapshot)this.snapshot=[];else for(var H=0;H<this.snapshot.length;H++)u.add(this.snapshot[H].node);
+for(H=0;H<k.length;H++)u.has(k[H])||(u.add(k[H]),this.snapshot.push({node:k[H],opacity:k[H].style.opacity}))};Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var k=0;k<this.snapshot.length;k++)Graph.setTransitionForNodes([this.snapshot[k].node],null),this.snapshot[k].node.style.opacity=this.snapshot[k].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(k){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){k=k||{};this.running=
+!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var u=this,H=this.data.steps||[],P=function(W,fa){if(null==u.graph||u.graph.isGraphTornDown())u.running=!1;else if(u.cancelled||W>=H.length)fa();else{for(var X=W+1;X<H.length&&!0===H[X].immediate&&!u.cancelled;)X++;if("function"==typeof k.onStep)try{k.onStep(W,X)}catch(ea){}u.graph.executeCustomActions(Graph.flattenAnimationActions(H.slice(W,X)),function(){P(X,fa)},null)}},U=function(){null==u.graph||u.graph.isGraphTornDown()?
+u.running=!1:u.cancelled?(u.restoreOpacity(),u.running=!1):(null==u.snapshot&&u.snapshotOpacity(),P(0,function(){if(u.cancelled)u.restoreOpacity(),u.running=!1;else{if("function"==typeof k.onStep)try{k.onStep(-1)}catch(W){}k.loop?(u.graph.refresh(),u.restoreOpacity(),window.setTimeout(U,0)):(u.running=!1,u.restoreOpacity(),null!=k.done&&k.done())}}))};k.defer?window.setTimeout(U,0):U()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=
+!0);for(var k=[],u=this.collectReferencedCells(),H=0;H<u.length;H++)this.graph.getModel().isEdge(u[H])&&k.push(u[H]);0<k.length&&Editor.toggleFlowAnimation(this.graph,k,"stop")};Editor.toggleFlowAnimation=function(k,u,H){H=H||"toggle";for(var P=0;P<u.length;P++)if(k.getModel().isEdge(u[P])){var U=k.view.getState(u[P]);if(null!=U&&null!=U.shape){var W=null!=U.shape.getFlowAnimationPath?U.shape.getFlowAnimationPath():null;if(null!=W){var fa="mxEdgeFlow"==W.getAttribute("class"),X="start"==H||"toggle"==
+H&&!fa;fa="stop"==H||"toggle"==H&&fa;U="1"==mxUtils.getValue(U.style,mxConstants.STYLE_DASHED,"0");fa?(W.removeAttribute("class"),U||W.removeAttribute("stroke-dasharray")):X&&(W.setAttribute("class","mxEdgeFlow"),U||W.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(k,u){var H=k.getModel().getRoot(),P=null;null!=H.value&&"object"==typeof H.value&&(P=H.value.getAttribute("animation"));if(null==P||""==P)return null;try{var U=Editor.parseAnimationData(P)}catch(fa){return null}if(!U.steps||
+0==U.steps.length||!1===U.enabled)return null;H={};if(null!=u)for(var W in u)H[W]=u[W];null==H.loop&&(H.loop=U.loop);null==H.defer&&(H.defer=!0);k=new Editor.AnimationPlayer(k,U);k.play(H);return k};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var k=document.createElement("style");k.type="text/css";k.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));
+document.getElementsByTagName("head")[0].appendChild(k)}catch(u){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="31.4.6";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",
"elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},elkRadial:{layout:"elkRadial",config:{edgeStyle:"elkCompat"}},elkOrganic:{layout:"elkOrganic",config:{edgeStyle:"elkCompat"}},elkStress:{layout:"elkStress",config:{edgeStyle:"elkCompat"}}};EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging=
"1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars=
"\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.enabledTemplateSections=null;EditorUi.customTemplates=null;EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&
@@ -4164,9 +4166,9 @@ function(c){this.shareCursorPosition=c;Editor.isSettingsEnabled()&&(mxSettings.s
EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=
function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine&&!EditorUi.isElectronApp||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};
EditorUi.prototype.isRemoteExportEnabled=function(){return!this.isOffline()&&"string"===typeof EXPORT_URL&&/^(https?:\/\/|\/)/i.test(EXPORT_URL)};EditorUi.prototype.isPrintPdfExport=function(){return this.printPdfExport||!this.isRemoteExportEnabled()};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,l){var q=null==c||null==f;l=null!=l?l:24;var x=new Spinner({lines:12,length:l,width:Math.round(l/
-3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),A=this.timeout,E=x.spin,K=null,Q=null,V=mxUtils.bind(this,function(Y){null!=Y&&Y()}),J=this;x.spin=function(Y,aa,ja,ka){ka=null!=ka?ka:A;var ua=!1;if(!this.active){var Da=Date.now();null!=ja&&(K=window.setTimeout(function(){x.stop();K=null;ja({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:Q})},ka));q&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||
+3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),A=this.timeout,E=x.spin,K=null,Q=null,V=mxUtils.bind(this,function(Y){null!=Y&&Y()}),J=this;x.spin=function(Y,aa,ja,la){la=null!=la?la:A;var ua=!1;if(!this.active){var Da=Date.now();null!=ja&&(K=window.setTimeout(function(){x.stop();K=null;ja({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:Q})},la));q&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||
0)/2,c=document.body.clientWidth/2-2);Y==document.body&&"1"==urlParams.embedInline&&(Y=J.diagramContainer,c=Y.scrollLeft+Y.clientWidth/2,f=Y.scrollTop+Y.clientHeight/2);E.call(this,Y);"1"==urlParams.embedInline&&null!=x.el&&(x.el.style.marginTop=Y.scrollTop+"px",x.el.style.marginLeft=Y.scrollLeft+"px");this.active=!0;null!=aa&&(ua=document.createElement("div"),ua.className="geSpinnerStatus",ua.setAttribute("title",aa),Y==document.body?(ua.style.left=Math.max(0,c)+"px",ua.style.top=Math.max(0,f+66)+
-"px"):(ua.style.left="50%",ua.style.top="50%",ua.style.marginTop="70px"),"..."!=aa.substring(aa.length-3,aa.length)&&"!"!=aa.charAt(aa.length-1)&&(aa+="..."),ua.innerText=aa,Y.appendChild(ua),x.status=ua);this.pause=mxUtils.bind(this,function(){var ha=V;this.active&&(ka=Math.max(0,ka-(Date.now()-Da)),ha=mxUtils.bind(this,function(k){this.spin(Y,aa,ja,ka);if(null!=k)try{k(),Q=mxUtils.bind(this,function(){this.spin(Y,aa,ja,ka);try{k()}catch(u){null!=ja&&ja(u)}})}catch(u){null!=ja&&ja(u)}}));this.stop();
+"px"):(ua.style.left="50%",ua.style.top="50%",ua.style.marginTop="70px"),"..."!=aa.substring(aa.length-3,aa.length)&&"!"!=aa.charAt(aa.length-1)&&(aa+="..."),ua.innerText=aa,Y.appendChild(ua),x.status=ua);this.pause=mxUtils.bind(this,function(){var ha=V;this.active&&(la=Math.max(0,la-(Date.now()-Da)),ha=mxUtils.bind(this,function(k){this.spin(Y,aa,ja,la);if(null!=k)try{k(),Q=mxUtils.bind(this,function(){this.spin(Y,aa,ja,la);try{k()}catch(u){null!=ja&&ja(u)}})}catch(u){null!=ja&&ja(u)}}));this.stop();
return ha});ua=!0}return ua};var ia=x.stop;x.stop=function(){ia.call(this);this.active&&(this.active=!1,null!=K&&(window.clearTimeout(K),K=null),null!=x.status&&null!=x.status.parentNode&&x.status.parentNode.removeChild(x.status),x.status=null)};x.pause=function(){return V};return x};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var f=mxUtils.parseXml(c),l=this.editor.extractGraphModel(f.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}}catch(q){}return!1};
EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};
EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=
@@ -4180,10 +4182,10 @@ function(K){E(K)}),mxUtils.bind(this,function(){E(null)})):E(null)};EditorUi.pro
function(c){c=new Date(c);return!isNaN(c.getTime())&&0<=c.getTime()?c.toLocaleString():null};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=null!=c?this.editor.extractGraphModel(c,!0):null;null!=l&&(c=l);if(null!=c){l=this.editor.graph;l.model.beginUpdate();try{var q=null!=this.pages?this.pages.slice():null,x=c.getElementsByTagName("diagram");
if(1<x.length||1==x.length&&x[0].hasAttribute("name")){this.fileNode=c;l.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var A=x.length-1;0<=A;A--){var E=this.updatePageRoot(new DiagramPage(x[A]));null==E.getName()&&E.setName(mxResources.get("pageWithNumber",[A+1]));l.model.execute(new ChangePage(this,E,0==A?E:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),
this.currentPage.setName(mxResources.get("pageWithNumber",[1])),l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=q)for(A=0;A<q.length;A++)l.model.execute(new ChangePage(this,q[A],null));var K=this.getCurrentFile();null!=K&&K.fileReplaced(f)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=
-function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){f=null!=f?f:this.editor.graph;x=null!=x?x:!1;Q=null!=Q?Q:!0;V=null!=V?V:this.defaultCompact;J=null!=J?J:!Editor.defaultCompressed;var aa=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var ja="_blank";else aa=ja=q;if(null==c)return"";var ka=c;if("mxfile"!=ka.nodeName.toLowerCase()){if(J){var ua=c.ownerDocument.createElement("diagram");ua.setAttribute("name",mxResources.get("pageWithNumber",[1]));ua.setAttribute("id",Editor.guid());
-ua.appendChild(c)}else{ua=Graph.zapGremlins(mxUtils.getXml(c));ka=Graph.compress(ua);if(Graph.decompress(ka)!=ua)return ua;ua=c.ownerDocument.createElement("diagram");ua.setAttribute("name",mxResources.get("pageWithNumber",[1]));ua.setAttribute("id",Editor.guid());mxUtils.setTextContent(ua,ka)}ka=c.ownerDocument.createElement("mxfile");ka.appendChild(ua)}V?(ka=ka.cloneNode(!0),ka.removeAttribute("modified"),ka.removeAttribute("host"),ka.removeAttribute("agent"),ka.removeAttribute("etag"),ka.removeAttribute("userAgent"),
-ka.removeAttribute("version"),ka.removeAttribute("editor"),ka.removeAttribute("type")):(ka.removeAttribute("userAgent"),ka.removeAttribute("modified"),ka.removeAttribute("version"),ka.removeAttribute("editor"),ka.removeAttribute("pages"),ka.removeAttribute("type"),ka.removeAttribute("etag"),mxClient.IS_CHROMEAPP?ka.setAttribute("host","Chrome"):EditorUi.isElectronApp?ka.setAttribute("host","Electron"):ka.setAttribute("host",window.location.hostname),1<ka.getElementsByTagName("diagram").length&&null!=
-this.pages&&ka.setAttribute("pages",this.pages.length));null!=ia&&(ka=ka.cloneNode(!0),ka.setAttribute("scale",ia));null!=Y&&(ka=ka.cloneNode(!0),ka.setAttribute("border",Y));c=J?mxUtils.getPrettyXml(ka):mxUtils.getXml(ka);if(!A&&!x&&(E||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(ka),f,null!=l?l.getTitle():null,ja,aa);else if(A||!x&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(q=null),l=this.getSvgFileProperties(ka),
+function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){f=null!=f?f:this.editor.graph;x=null!=x?x:!1;Q=null!=Q?Q:!0;V=null!=V?V:this.defaultCompact;J=null!=J?J:!Editor.defaultCompressed;var aa=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var ja="_blank";else aa=ja=q;if(null==c)return"";var la=c;if("mxfile"!=la.nodeName.toLowerCase()){if(J){var ua=c.ownerDocument.createElement("diagram");ua.setAttribute("name",mxResources.get("pageWithNumber",[1]));ua.setAttribute("id",Editor.guid());
+ua.appendChild(c)}else{ua=Graph.zapGremlins(mxUtils.getXml(c));la=Graph.compress(ua);if(Graph.decompress(la)!=ua)return ua;ua=c.ownerDocument.createElement("diagram");ua.setAttribute("name",mxResources.get("pageWithNumber",[1]));ua.setAttribute("id",Editor.guid());mxUtils.setTextContent(ua,la)}la=c.ownerDocument.createElement("mxfile");la.appendChild(ua)}V?(la=la.cloneNode(!0),la.removeAttribute("modified"),la.removeAttribute("host"),la.removeAttribute("agent"),la.removeAttribute("etag"),la.removeAttribute("userAgent"),
+la.removeAttribute("version"),la.removeAttribute("editor"),la.removeAttribute("type")):(la.removeAttribute("userAgent"),la.removeAttribute("modified"),la.removeAttribute("version"),la.removeAttribute("editor"),la.removeAttribute("pages"),la.removeAttribute("type"),la.removeAttribute("etag"),mxClient.IS_CHROMEAPP?la.setAttribute("host","Chrome"):EditorUi.isElectronApp?la.setAttribute("host","Electron"):la.setAttribute("host",window.location.hostname),1<la.getElementsByTagName("diagram").length&&null!=
+this.pages&&la.setAttribute("pages",this.pages.length));null!=ia&&(la=la.cloneNode(!0),la.setAttribute("scale",ia));null!=Y&&(la=la.cloneNode(!0),la.setAttribute("border",Y));c=J?mxUtils.getPrettyXml(la):mxUtils.getXml(la);if(!A&&!x&&(E||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(la),f,null!=l?l.getTitle():null,ja,aa);else if(A||!x&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(q=null),l=this.getSvgFileProperties(la),
c=this.getEmbeddedSvg(c,f,q,null,K,Q,aa,null,null,l.scale,l.border,null,Editor.svgFileTheme,null,l.embedFonts);return c};EditorUi.prototype.getXmlFileData=function(c,f,l,q){c=null!=c?c:!0;f=null!=f?f:!1;l=null!=l?l:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,q);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(Q){var V=Q.getElementsByTagName("mxGraphModel"),J=0<V.length?V[0]:null;V=Q;null==J&&l?(J=mxUtils.getNodeValue(Q),0<J.length&&(J=Graph.decompress(J),null!=J&&0<J.length&&
(V=Q.cloneNode(!1),V.appendChild(mxUtils.parseXml(J).documentElement)))):null==J||l?V=Q.cloneNode(!0):(V=Q.cloneNode(!1),mxUtils.setTextContent(V,Graph.compressNode(J)));x.appendChild(V)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var A=this.pages[f],E=A.node;if(A!=this.currentPage)if(A.needsUpdate){var K=new mxCodec(mxUtils.createXmlDocument());K=K.encode(new mxGraphModel(A.root));
this.editor.graph.saveViewState(A.viewState,K,null,q);EditorUi.removeChildNodes(E);E.appendChild(K);delete A.needsUpdate}else q&&(this.updatePageRoot(A),null!=A.viewState.backgroundImage&&null!=A.viewState.backgroundImage.originalSrc&&(K=new mxCodec(mxUtils.createXmlDocument()),K=K.encode(new mxGraphModel(A.root)),this.editor.graph.saveViewState(A.viewState,K,null,q,A),E=E.cloneNode(!1),E.appendChild(K)));c(E)}return x};EditorUi.prototype.anonymizeString=function(c,f){for(var l=[],q=0;q<c.length;q++){var x=
@@ -4196,7 +4198,7 @@ delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=
f[l].setAttribute("value","["+f[l].getAttribute("value").length+"]"),null!=f[l].getAttribute("xmlValue")&&f[l].setAttribute("xmlValue","["+f[l].getAttribute("xmlValue").length+"]"),null!=f[l].getAttribute("style")&&f[l].setAttribute("style","["+f[l].getAttribute("style").length+"]"),null!=f[l].parentNode&&"root"!=f[l].parentNode.nodeName&&null!=f[l].parentNode.parentNode&&(f[l].setAttribute("id",f[l].parentNode.getAttribute("id")),f[l].parentNode.parentNode.replaceChild(f[l],f[l].parentNode));return c};
EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();f.handleFileError(l,!0)})):
f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){f.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){x=null!=x?x:!0;A=null!=A?A:!1;V=null!=V?V:!Editor.defaultCompressed;var aa=this.editor.graph;if((f||!c&&null!=Q&&/(\.svg)$/i.test(Q.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ja=aa.getGlobalVariable;aa=this.createTemporaryGraph(aa.getStylesheet());aa.setBackgroundImage=
-this.editor.graph.setBackgroundImage;aa.background=this.editor.graph.background;var ka=null!=this.pages?this.pages[0]:null;null==ka||this.currentPage==ka?aa.setBackgroundImage(this.editor.graph.backgroundImage):null!=ka.viewState&&null!=ka.viewState&&aa.setBackgroundImage(ka.viewState.backgroundImage);aa.getGlobalVariable=function(ua){return"page"==ua&&null!=ka?ka.getName():"pagenumber"==ua?1:ja.apply(this,arguments)};document.body.appendChild(aa.container);null!=ka&&aa.model.setRoot(ka.root)}E=null!=
+this.editor.graph.setBackgroundImage;aa.background=this.editor.graph.background;var la=null!=this.pages?this.pages[0]:null;null==la||this.currentPage==la?aa.setBackgroundImage(this.editor.graph.backgroundImage):null!=la.viewState&&null!=la.viewState&&aa.setBackgroundImage(la.viewState.backgroundImage);aa.getGlobalVariable=function(ua){return"page"==ua&&null!=la?la.getName():"pagenumber"==ua?1:ja.apply(this,arguments)};document.body.appendChild(aa.container);null!=la&&aa.model.setRoot(la.root)}E=null!=
E?E:this.getXmlFileData(x,A,V,J);Q=null!=Q?Q:this.getCurrentFile();c=this.createFileData(E,aa,Q,window.location.href,c,f,l,q,x,K,V,ia,Y);aa!=this.editor.graph&&aa.container.parentNode.removeChild(aa.container);return c};EditorUi.prototype.getHtml=function(c,f,l,q,x,A){A=null!=A?A:!0;var E=null,K=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){E=A?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var Q=f.view.scale;A=Math.floor(E.x/Q-f.view.translate.x);Q=Math.floor(E.y/Q-f.view.translate.y);
E=f.background;null==x&&(f=this.getBasenames().join(";"),0<f.length&&(K=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",A);c.setAttribute("y0",Q)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=q&&c.setAttribute("edit",q));null!=x&&(x=x.replace(/&/g,"&amp;"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";q=Graph.compress(c);Graph.decompress(q)!=c&&(q=encodeURIComponent(c));
return(null==x?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=x?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==x?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+"</head>\n<body"+(null==x&&null!=E&&E!=mxConstants.NONE?' style="background-color:'+E+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+
@@ -4210,14 +4212,14 @@ new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setNa
V=Q.getChildren(Q.root);for(A=0;A<V.length;A++){var J=V[A];Q.setVisible(J,K[J.id]||!1)}}catch(ia){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=l.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var q=f.cells=0;q<
l.length;q++){var x=l[q].getElementsByTagName("mxCell");f.cells+=x.length;for(var A={},E=0;E<x.length;E++){var K=x[E].getAttribute("style");if(null!=K)for(var Q=K.split(";"),V=0;V<Q.length;V++){var J=Q[V];if(J.startsWith("image=data:")||J.startsWith("shape=stencil("))null==A[J]?A[J]=1:A[J]++}}for(var ia in A){var Y=A[ia];ia.startsWith("shape=stencil(")?f.stencils+=Y:f.images+=Y;1<Y&&(f.redundantSize+=ia.length*(Y-1),ia.startsWith("shape=stencil(")?f.redundantStencils+=Y-1:f.redundantImages+=Y-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+
"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(f)})}}catch(aa){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&
-0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua,Da){try{q=null!=q?q:this.editor.graph.isSelectionEmpty();var ha=this.getBaseFilename(!x),k=ha+("xml"==c||"pdf"==c&&J?".drawio":"")+"."+c;if("xml"==c){var u=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,q,x,null,null,null,f);this.saveData(k,c,u,"text/xml")}else if("html"==c)u=this.getHtml2(this.getFileData(!0),this.editor.graph,
-ha),this.saveData(k,c,u,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?k=ha+".png":"jpeg"==c&&(k=ha+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var H=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(k,c,q,"1",E,x,K,Q,V,J,ia,void 0,void 0,!A,Y,aa,ja,ka,ua,Da).send(mxUtils.bind(this,function(X){this.spinner.stop();
+0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua,Da){try{q=null!=q?q:this.editor.graph.isSelectionEmpty();var ha=this.getBaseFilename(!x),k=ha+("xml"==c||"pdf"==c&&J?".drawio":"")+"."+c;if("xml"==c){var u=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,q,x,null,null,null,f);this.saveData(k,c,u,"text/xml")}else if("html"==c)u=this.getHtml2(this.getFileData(!0),this.editor.graph,
+ha),this.saveData(k,c,u,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?k=ha+".png":"jpeg"==c&&(k=ha+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var H=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(k,c,q,"1",E,x,K,Q,V,J,ia,void 0,void 0,!A,Y,aa,ja,la,ua,Da).send(mxUtils.bind(this,function(X){this.spinner.stop();
if(200<=X.getStatus()&&299>=X.getStatus()){var ea=this.createLoadMessage("export");ea.format=c;ea.filename=k;ea.data="data:application/pdf;base64,"+X.getText();ea.xml=this.getFileData(!0);H.postMessage(JSON.stringify(ea),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(k,c,mxUtils.bind(this,function(X,ea){try{return this.createDownloadRequest(X,
-c,q,ea,E,x,K,Q,V,J,ia,void 0,void 0,!A,Y,aa,ja,ka,ua,Da)}catch(oa){this.handleError(oa)}}));else{var P=null,T=mxUtils.bind(this,function(X){X.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",X,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}))});if("svg"==c){var W=this.editor.graph.background;if(E||W==mxConstants.NONE)W=null;var fa=this.editor.graph.getSvg(W,null,null,null,null,q);l&&this.editor.graph.addSvgShadow(fa);
-this.editor.convertImages(fa,mxUtils.bind(this,mxUtils.bind(this,function(X){this.spinner.stop();T(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(X))})))}else k=ha+".svg",P=this.getFileData(!1,!0,null,mxUtils.bind(this,function(X){this.spinner.stop();T(X)}),q)}}catch(X){this.handleError(X)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua,Da,ha,k){c=this.downloadRequestBuilder(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua,Da,ha,k);f="";for(var u in c)l=
-c[u],null!=l&&(f+=u+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua,Da,ha,k){var u=this.editor.graph,H=u.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==A?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var P=null,T=null,W=null;if(!EditorUi.isElectronApp&&(H.width*H.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};
-V=V?"1":"0";"pdf"==f&&(null!=J?(P=J.from,T=J.to):0==A&&(W="1"));"xmlpng"==f&&(V="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(A=0;A<this.pages.length;A++)if(this.pages[A]==this.currentPage){P=A;break}A=u.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!x?x||null!=A&&A!=mxConstants.NONE||(A="#ffffff"):A=mxConstants.NONE;x={globalVars:u.getExportVariables()};null!=J&&null!=J.from&&(x.globalVars.pagenumber=J.from+1);Q&&(x.grid={size:u.gridSize,steps:u.view.gridSteps,
-color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:u.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);Q=this.getHiddenTagsMap();null!=Q&&(x.hiddenTags=Q);return{format:f,from:P,to:T,allPages:W,bg:null!=A?A:mxConstants.NONE,base64:q,embedXml:V,xml:l,filename:null!=c?c:"",extras:JSON.stringify(x),scale:E,border:K,pageMargin:ja,w:ia&&isFinite(ia)?ia:null,h:Y&&isFinite(Y)?Y:null,crop:null!=aa&&aa?"1":"0",fit:null!=ka&&ka?"1":"0",shadows:null!=
+c,q,ea,E,x,K,Q,V,J,ia,void 0,void 0,!A,Y,aa,ja,la,ua,Da)}catch(oa){this.handleError(oa)}}));else{var P=null,U=mxUtils.bind(this,function(X){X.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",X,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}))});if("svg"==c){var W=this.editor.graph.background;if(E||W==mxConstants.NONE)W=null;var fa=this.editor.graph.getSvg(W,null,null,null,null,q);l&&this.editor.graph.addSvgShadow(fa);
+this.editor.convertImages(fa,mxUtils.bind(this,mxUtils.bind(this,function(X){this.spinner.stop();U(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(X))})))}else k=ha+".svg",P=this.getFileData(!1,!0,null,mxUtils.bind(this,function(X){this.spinner.stop();U(X)}),q)}}catch(X){this.handleError(X)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua,Da,ha,k){c=this.downloadRequestBuilder(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua,Da,ha,k);f="";for(var u in c)l=
+c[u],null!=l&&(f+=u+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua,Da,ha,k){var u=this.editor.graph,H=u.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==A?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var P=null,U=null,W=null;if(!EditorUi.isElectronApp&&(H.width*H.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};
+V=V?"1":"0";"pdf"==f&&(null!=J?(P=J.from,U=J.to):0==A&&(W="1"));"xmlpng"==f&&(V="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(A=0;A<this.pages.length;A++)if(this.pages[A]==this.currentPage){P=A;break}A=u.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!x?x||null!=A&&A!=mxConstants.NONE||(A="#ffffff"):A=mxConstants.NONE;x={globalVars:u.getExportVariables()};null!=J&&null!=J.from&&(x.globalVars.pagenumber=J.from+1);Q&&(x.grid={size:u.gridSize,steps:u.view.gridSteps,
+color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:u.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);Q=this.getHiddenTagsMap();null!=Q&&(x.hiddenTags=Q);return{format:f,from:P,to:U,allPages:W,bg:null!=A?A:mxConstants.NONE,base64:q,embedXml:V,xml:l,filename:null!=c?c:"",extras:JSON.stringify(x),scale:E,border:K,pageMargin:ja,w:ia&&isFinite(ia)?ia:null,h:Y&&isFinite(Y)?Y:null,crop:null!=aa&&aa?"1":"0",fit:null!=la&&la?"1":"0",shadows:null!=
ha&&ha?"1":"0",sheetsAcross:ua,sheetsDown:Da,icons:null!=k&&k?"1":"0"}};EditorUi.prototype.getHiddenTagsMap=function(){var c=this.editor.graph,f={},l=!1;if(null!=this.pages)for(var q=0;q<this.pages.length;q++){var x=this.pages[q],A=x==this.currentPage?c.hiddenTags:null!=x.viewState?x.viewState.hiddenTags:null;null!=A&&0<A.length&&(f[x.getId()]=A,l=!0)}else null!=c.hiddenTags&&0<c.hiddenTags.length&&(f[0]=c.hiddenTags,l=!0);return l?f:null};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=
function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");if(0<l){c=decodeURIComponent(c.substring(l+1));try{f=JSON.parse(c)}catch(q){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=
this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var l=f.lastIndexOf("#");0<l&&(f=f.substring(0,l));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(q){}0<l&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,
@@ -4226,7 +4228,7 @@ c.update){var Q=null!=c.interval?parseInt(c.interval):6E4,V=null,J=mxUtils.bind(
V=window.setTimeout(J,Q)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ia();J()}));ia();J()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var A=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(A,mxUtils.bind(this,function(E){x(E)}),mxUtils.bind(this,function(E){null!=l&&l(E)}))}else x("")};EditorUi.prototype.updateDiagram=function(c){function f(k){var u=new mxCellOverlay(k.image||x.warningImage,k.tooltip,k.align,k.valign,k.offset);u.addListener(mxEvent.CLICK,function(H,
P){q.alert(k.tooltip)});return u}var l=null,q=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var x=this.editor.graph,A=x.getModel();A.beginUpdate();var E=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var K=A.getCell(c.getAttribute("id"));if(null!=K){try{var Q=c.getAttribute("value");if(null!=Q){var V=mxUtils.parseXml(Q).documentElement;if(null!=V)if("1"==V.getAttribute("replace-value"))A.setValue(K,V);else for(var J=
V.attributes,ia=0;ia<J.length;ia++)x.setAttributeForCell(K,J[ia].nodeName,0<J[ia].nodeValue.length?J[ia].nodeValue:null)}}catch(k){null!=window.console&&console.log("Error in value for "+K.id+": "+k)}try{var Y=c.getAttribute("style");null!=Y&&x.model.setStyle(K,Y)}catch(k){null!=window.console&&console.log("Error in style for "+K.id+": "+k)}try{var aa=c.getAttribute("icon");if(null!=aa){var ja=0<aa.length?JSON.parse(aa):null;null!=ja&&ja.append||x.removeCellOverlays(K);null!=ja&&x.addCellOverlay(K,
-f(ja))}}catch(k){null!=window.console&&console.log("Error in icon for "+K.id+": "+k)}try{var ka=c.getAttribute("geometry");if(null!=ka){ka=JSON.parse(ka);var ua=x.getCellGeometry(K);if(null!=ua){ua=ua.clone();for(key in ka){var Da=parseFloat(ka[key]);"dx"==key?ua.x+=Da:"dy"==key?ua.y+=Da:"dw"==key?ua.width+=Da:"dh"==key?ua.height+=Da:ua[key]=parseFloat(ka[key])}x.model.setGeometry(K,ua)}}}catch(k){null!=window.console&&console.log("Error in icon for "+K.id+": "+k)}}}else if("model"==c.nodeName){for(var ha=
+f(ja))}}catch(k){null!=window.console&&console.log("Error in icon for "+K.id+": "+k)}try{var la=c.getAttribute("geometry");if(null!=la){la=JSON.parse(la);var ua=x.getCellGeometry(K);if(null!=ua){ua=ua.clone();for(key in la){var Da=parseFloat(la[key]);"dx"==key?ua.x+=Da:"dy"==key?ua.y+=Da:"dw"==key?ua.width+=Da:"dh"==key?ua.height+=Da:ua[key]=parseFloat(la[key])}x.model.setGeometry(K,ua)}}}catch(k){null!=window.console&&console.log("Error in icon for "+K.id+": "+k)}}}else if("model"==c.nodeName){for(var ha=
c.firstChild;null!=ha&&ha.nodeType!=mxConstants.NODETYPE_ELEMENT;)ha=ha.nextSibling;null!=ha&&(new mxCodec(c.firstChild)).decode(ha,A)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(x.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))x.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(E=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{A.endUpdate()}null!=
E&&this.chromelessResize&&this.chromelessResize(!0,E)}return l};EditorUi.prototype.getCopyFilename=function(c,f){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var q=l.lastIndexOf(".");0<=q&&(c=l.substring(q),l=l.substring(0,q));if(f){f=l;var x=new Date;l=x.getFullYear();q=x.getMonth()+1;var A=x.getDate(),E=x.getHours(),K=x.getMinutes();x=x.getSeconds();l=f+(" "+(l+"-"+q+"-"+A+"-"+E+"-"+K+"-"+x))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=
function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,f,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[f]);var q=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var x=!1;this.hideDialog();null!=q&&(q.removeListener(this.descriptorChangedListener),this.logIfModified(q,!0),q.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var A=mxUtils.bind(this,
@@ -4251,38 +4253,38 @@ f,l,q,x){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCusto
E=null!=E?E[E.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var K=null,Q=mxUtils.bind(this,function(ha,k){0==ha.length&&c.isEditable()?(null==K&&(K=document.createElement("div"),K.className="geDropTarget",ha=mxResources.get("dragElementsHere"),mxUtils.write(K,ha),K.setAttribute("title",ha)),k.appendChild(K)):this.addLibraryEntries(ha,k)});null!=this.sidebar&&null!=f&&(this.sidebar.setCurrentSearchEntryLibrary(c.getHash(),c.getHash()),this.sidebar.addEntries(f,x),this.sidebar.setCurrentSearchEntryLibrary());
null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var V=this.sidebar.addPalette(c.getHash(),l,null!=q?q:!0,mxUtils.bind(this,function(ha){Q(f,ha)}),!0);null!=A&&(A.div=V);this.repositionLibrary(E,"L.scratchpad"!=c.getHash());q=V.parentNode.previousSibling;l=q.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&q.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var J=document.createElement("div");J.style.backgroundColor="inherit";
q.style.position="relative";var ia=document.createElement("img");ia.className="geLibraryButton";ia.setAttribute("src",Editor.crossImage);ia.setAttribute("title",mxResources.get("close"));var Y=null;if(".scratchpad"!=c.title||this.closableScratchpad)J.appendChild(ia),mxEvent.addListener(ia,"click",mxUtils.bind(this,function(ha){if(!mxEvent.isConsumed(ha)){var k=mxUtils.bind(this,function(){null!=A&&mxUtils.remove(A,this.openLibraries);this.closeLibrary(c)});null!=Y?this.confirm(mxResources.get("allChangesLost"),
-null,k,mxResources.get("cancel"),mxResources.get("discardChanges")):k();mxEvent.consume(ha)}}));if(c.isEditable()){var aa=this.editor.graph,ja=null;l=mxUtils.bind(this,function(ha){this.showLibraryDialog(c.getTitle(),V,f,c,c.getMode());mxEvent.consume(ha)});var ka=mxUtils.bind(this,function(ha){c.setModified(!0);c.isAutosave()?(null!=ja&&null!=ja.parentNode&&ja.parentNode.removeChild(ja),ja=ia.cloneNode(!1),ja.setAttribute("src",Editor.spinImage),ja.setAttribute("title",mxResources.get("saving")),
+null,k,mxResources.get("cancel"),mxResources.get("discardChanges")):k();mxEvent.consume(ha)}}));if(c.isEditable()){var aa=this.editor.graph,ja=null;l=mxUtils.bind(this,function(ha){this.showLibraryDialog(c.getTitle(),V,f,c,c.getMode());mxEvent.consume(ha)});var la=mxUtils.bind(this,function(ha){c.setModified(!0);c.isAutosave()?(null!=ja&&null!=ja.parentNode&&ja.parentNode.removeChild(ja),ja=ia.cloneNode(!1),ja.setAttribute("src",Editor.spinImage),ja.setAttribute("title",mxResources.get("saving")),
ja.style.cursor="default",ja.style.marginRight="2px",ja.style.marginTop="-2px",J.insertBefore(ja,J.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=ja&&null!=ja.parentNode&&ja.parentNode.removeChild(ja)})):null==Y&&(Y=ia.cloneNode(!1),Y.setAttribute("src",Editor.saveImage),Y.setAttribute("title",mxResources.get("save")),J.insertBefore(Y,J.firstChild),mxEvent.addListener(Y,"click",mxUtils.bind(this,function(k){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==
-LocalLibrary,!0,function(){null==Y||c.isModified()||(Y.parentNode.removeChild(Y),Y=null)});mxEvent.consume(k)})))}),ua=mxUtils.bind(this,function(ha,k,u,H){ha=aa.cloneCells(mxUtils.sortCells(aa.model.getTopmostCells(ha)));for(var P=0;P<ha.length;P++){var T=aa.getCellGeometry(ha[P]);null!=T&&T.translate(-k.x,-k.y)}V.appendChild(this.sidebar.createVertexTemplateFromCells(ha,k.width,k.height,H||"",!0,null,!1));ha=mxUtils.getXml(this.editor.graph.encodeCells(ha));Editor.defaultCompressed&&(ha=Graph.compress(ha));
-k={xml:ha,w:k.width,h:k.height};null!=H&&(k.title=H);f.push(k);ka(u);null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null)}),Da=mxUtils.bind(this,function(ha){if(aa.isSelectionEmpty())aa.getRubberband().isActive()?(aa.getRubberband().execute(ha),aa.getRubberband().reset()):null!=ha&&null!=mxEvent.getSource(ha)&&mxEvent.getSource(ha).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var k=
+LocalLibrary,!0,function(){null==Y||c.isModified()||(Y.parentNode.removeChild(Y),Y=null)});mxEvent.consume(k)})))}),ua=mxUtils.bind(this,function(ha,k,u,H){ha=aa.cloneCells(mxUtils.sortCells(aa.model.getTopmostCells(ha)));for(var P=0;P<ha.length;P++){var U=aa.getCellGeometry(ha[P]);null!=U&&U.translate(-k.x,-k.y)}V.appendChild(this.sidebar.createVertexTemplateFromCells(ha,k.width,k.height,H||"",!0,null,!1));ha=mxUtils.getXml(this.editor.graph.encodeCells(ha));Editor.defaultCompressed&&(ha=Graph.compress(ha));
+k={xml:ha,w:k.width,h:k.height};null!=H&&(k.title=H);f.push(k);la(u);null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null)}),Da=mxUtils.bind(this,function(ha){if(aa.isSelectionEmpty())aa.getRubberband().isActive()?(aa.getRubberband().execute(ha),aa.getRubberband().reset()):null!=ha&&null!=mxEvent.getSource(ha)&&mxEvent.getSource(ha).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var k=
aa.getSelectionCells(),u=aa.view.getBounds(k);if(null!=u&&0<u.width&&0<u.height){var H=aa.view.scale;u.x/=H;u.y/=H;u.width/=H;u.height/=H;u.x-=aa.view.translate.x;u.y-=aa.view.translate.y;ua(k,u)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(ha)});mxEvent.addGestureListeners(V,function(){},mxUtils.bind(this,function(ha){aa.isMouseDown&&null!=aa.panningManager&&null!=aa.graphHandler.first&&(aa.graphHandler.suspend(),null!=aa.graphHandler.hint&&
(aa.graphHandler.hint.style.visibility="hidden"),V.style.backgroundColor="light-dark(#fefefe, #000000)",V.style.cursor="copy",aa.panningManager.stop(),aa.autoScroll=!1,mxEvent.consume(ha))}),mxUtils.bind(this,function(ha){aa.isMouseDown&&null!=aa.panningManager&&null!=aa.graphHandler&&(V.style.backgroundColor="",V.style.cursor="default",this.sidebar.showTooltips=!0,aa.panningManager.stop(),aa.graphHandler.reset(),aa.isMouseDown=!1,aa.autoScroll=!0,Da(ha),mxEvent.consume(ha))}));mxEvent.addListener(V,
"mouseleave",mxUtils.bind(this,function(ha){aa.isMouseDown&&null!=aa.graphHandler.first&&(aa.graphHandler.resume(),null!=aa.graphHandler.hint&&(aa.graphHandler.hint.style.visibility="visible"),V.style.backgroundColor="",V.style.cursor="",aa.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(V,"dragover",mxUtils.bind(this,function(ha){V.style.backgroundColor="light-dark(#fefefe, #000000)";ha.dataTransfer.dropEffect="copy";V.style.cursor="copy";this.sidebar.hideTooltip();ha.stopPropagation();
-ha.preventDefault()})),mxEvent.addListener(V,"drop",mxUtils.bind(this,function(ha){V.style.cursor="";V.style.backgroundColor="";0<ha.dataTransfer.files.length&&this.importFiles(ha.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(k,u,H,P,T,W,fa,X,ea){if(null!=k&&"image/"==u.substring(0,6))k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(k),k=[new mxCell("",new mxGeometry(0,0,T,W),k)],k[0].vertex=!0,ua(k,new mxRectangle(0,
-0,T,W),ha,mxEvent.isAltDown(ha)?null:fa.substring(0,fa.lastIndexOf(".")).replace(/_/g," ")),null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null);else{var oa=!1,la=mxUtils.bind(this,function(ca,sa){null!=ca&&"application/pdf"==sa&&(sa=Editor.extractGraphModelFromPdf(ca),null!=sa&&0<sa.length&&(ca=sa));if(null!=ca)if(ca=mxUtils.parseXml(ca),"mxlibrary"==ca.documentElement.nodeName)try{var xa=JSON.parse(mxUtils.getTextContent(ca.documentElement));Q(xa,V);f=f.concat(xa);ka(ha);
-this.spinner.stop();oa=!0}catch(ta){}else if("mxfile"==ca.documentElement.nodeName)try{var qa=ca.documentElement.getElementsByTagName("diagram");for(xa=0;xa<qa.length;xa++){var Ba=this.stringToCells(Editor.getDiagramNodeXml(qa[xa])),ma=this.editor.graph.getBoundingBoxFromGeometry(Ba);null!=ma&&ua(Ba,new mxRectangle(0,0,ma.width,ma.height),ha)}oa=!0}catch(ta){null!=window.console&&console.log("error in drop handler:",ta)}oa||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
-null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null)});null!=ea&&null!=fa&&EditorUi.isVisioFilename(fa)?this.importVisio(ea,function(ca){la(ca,"text/xml")},null,fa):this.isGliffyData(k,fa)&&null!=ea?this.importGliffy(k,mxUtils.bind(this,function(ca){this.spinner.stop();la(ca,"text/xml")}),mxUtils.bind(this,function(ca){this.spinner.stop();this.handleError({message:mxResources.get(null!=ca&&413==ca.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}),
-fa):la(k,u)}}));ha.stopPropagation();ha.preventDefault()})),mxEvent.addListener(V,"dragleave",function(ha){V.style.cursor="";V.style.backgroundColor="";ha.stopPropagation();ha.preventDefault()}));ia=ia.cloneNode(!1);ia.setAttribute("src",Editor.editImage);ia.setAttribute("title",mxResources.get("edit"));J.insertBefore(ia,J.firstChild);mxEvent.addListener(ia,"click",l);l=ia.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));J.insertBefore(l,J.firstChild);
+ha.preventDefault()})),mxEvent.addListener(V,"drop",mxUtils.bind(this,function(ha){V.style.cursor="";V.style.backgroundColor="";0<ha.dataTransfer.files.length&&this.importFiles(ha.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(k,u,H,P,U,W,fa,X,ea){if(null!=k&&"image/"==u.substring(0,6))k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(k),k=[new mxCell("",new mxGeometry(0,0,U,W),k)],k[0].vertex=!0,ua(k,new mxRectangle(0,
+0,U,W),ha,mxEvent.isAltDown(ha)?null:fa.substring(0,fa.lastIndexOf(".")).replace(/_/g," ")),null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null);else{var oa=!1,ka=mxUtils.bind(this,function(ba,sa){null!=ba&&"application/pdf"==sa&&(sa=Editor.extractGraphModelFromPdf(ba),null!=sa&&0<sa.length&&(ba=sa));if(null!=ba)if(ba=mxUtils.parseXml(ba),"mxlibrary"==ba.documentElement.nodeName)try{var xa=JSON.parse(mxUtils.getTextContent(ba.documentElement));Q(xa,V);f=f.concat(xa);la(ha);
+this.spinner.stop();oa=!0}catch(ta){}else if("mxfile"==ba.documentElement.nodeName)try{var qa=ba.documentElement.getElementsByTagName("diagram");for(xa=0;xa<qa.length;xa++){var Ba=this.stringToCells(Editor.getDiagramNodeXml(qa[xa])),ma=this.editor.graph.getBoundingBoxFromGeometry(Ba);null!=ma&&ua(Ba,new mxRectangle(0,0,ma.width,ma.height),ha)}oa=!0}catch(ta){null!=window.console&&console.log("error in drop handler:",ta)}oa||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
+null!=K&&null!=K.parentNode&&0<f.length&&(K.parentNode.removeChild(K),K=null)});null!=ea&&null!=fa&&EditorUi.isVisioFilename(fa)?this.importVisio(ea,function(ba){ka(ba,"text/xml")},null,fa):this.isGliffyData(k,fa)&&null!=ea?this.importGliffy(k,mxUtils.bind(this,function(ba){this.spinner.stop();ka(ba,"text/xml")}),mxUtils.bind(this,function(ba){this.spinner.stop();this.handleError({message:mxResources.get(null!=ba&&413==ba.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}),
+fa):ka(k,u)}}));ha.stopPropagation();ha.preventDefault()})),mxEvent.addListener(V,"dragleave",function(ha){V.style.cursor="";V.style.backgroundColor="";ha.stopPropagation();ha.preventDefault()}));ia=ia.cloneNode(!1);ia.setAttribute("src",Editor.editImage);ia.setAttribute("title",mxResources.get("edit"));J.insertBefore(ia,J.firstChild);mxEvent.addListener(ia,"click",l);l=ia.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));J.insertBefore(l,J.firstChild);
mxEvent.addListener(l,"click",Da);".scratchpad"==c.title&&(this.addSelectionToScratchpad=Da);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",J.insertBefore(l,J.firstChild))}q.appendChild(J);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var l=0;l<c.length;l++)try{var q=c[l],x=q.data;if(null!=x){x="data:"==x.substring(0,
5)?this.convertDataUri(x):x;var A="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==q.aspect&&(A+="aspect=fixed;");A=A+"image="+x+";";null!=q.style&&(A+=q.style);f.appendChild(this.sidebar.createVertexTemplate(A,q.w,q.h,"",q.title||"",!1,null,!0))}else if(null!=q.xml){var E=this.stringToCells("<"==q.xml.charAt(0)?q.xml:Graph.decompress(q.xml)),K=0==E.length?mxResources.get("drawingEmpty"):null!=q.title?q.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(E,
q.w,q.h,K,!0,null,!0))}}catch(Q){K=null!=Q.message?mxResources.get("error")+": "+Q.message:String(Q),A=this.sidebar.createVertexTemplateFromCells(null,q.w,q.h,K,!0,null,!0),f.appendChild(A)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",
Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,l,q,x,A,E){c=new ImageDialog(this,c,f,l,q,x,A,E);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,l,q,x,A){var E=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=E?JSON.stringify(JSON.parse(E),null,2):"",mxUtils.bind(this,function(K){if(null!=K)try{if(null!=A&&A(K),K==E)this.hideDialog();
else{if(0<K.length){var Q=JSON.parse(K);localStorage.setItem(f,JSON.stringify(Q))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(V){this.handleError(V)}}),null,mxResources.get("close"),null,null,null,!0,null,null,x,l,q);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=function(c,f,l,q){function x(X){ja?V.confirm(mxResources.get("allChangesLost"),
-null,X,mxResources.get("cancel"),mxResources.get("discardChanges")):X()}function A(){ka=!0;V.hideDialog()}function E(X,ea){var oa=document.createElement("div");oa.style.padding="4px 16px";oa.style.cursor="pointer";oa.style.fontSize="13px";oa.style.borderBottom=ea?"2px solid #29b6f2":"2px solid transparent";oa.style.fontWeight=ea?"bold":"normal";oa.style.color=ea?"":"#888";oa.style.userSelect="none";mxUtils.write(oa,X);return oa}function K(X,ea){X.style.borderBottomColor=ea?"#29b6f2":"transparent";
-X.style.fontWeight=ea?"bold":"normal";X.style.color=ea?"":"#888"}function Q(X){if(X!==aa){if("json"===aa)try{var ea=JSON.parse(T.value);Y=ea;H.setConfig(ea)}catch(oa){}else"json"===X&&null!=Y&&(T.value=JSON.stringify(Y,null,2));k.style.display="editor"===X?"":"none";P.style.display="json"===X?"":"none";K(Da,"editor"===X);K(ha,"json"===X);"json"===X&&T.focus();aa=X}}var V=this,J=localStorage.getItem(f),ia={};try{null!=J&&(ia=JSON.parse(J))}catch(X){}var Y=ia,aa="editor",ja=!1,ka=!1;c=document.createElement("div");
+null,X,mxResources.get("cancel"),mxResources.get("discardChanges")):X()}function A(){la=!0;V.hideDialog()}function E(X,ea){var oa=document.createElement("div");oa.style.padding="4px 16px";oa.style.cursor="pointer";oa.style.fontSize="13px";oa.style.borderBottom=ea?"2px solid #29b6f2":"2px solid transparent";oa.style.fontWeight=ea?"bold":"normal";oa.style.color=ea?"":"#888";oa.style.userSelect="none";mxUtils.write(oa,X);return oa}function K(X,ea){X.style.borderBottomColor=ea?"#29b6f2":"transparent";
+X.style.fontWeight=ea?"bold":"normal";X.style.color=ea?"":"#888"}function Q(X){if(X!==aa){if("json"===aa)try{var ea=JSON.parse(U.value);Y=ea;H.setConfig(ea)}catch(oa){}else"json"===X&&null!=Y&&(U.value=JSON.stringify(Y,null,2));k.style.display="editor"===X?"":"none";P.style.display="json"===X?"":"none";K(Da,"editor"===X);K(ha,"json"===X);"json"===X&&U.focus();aa=X}}var V=this,J=localStorage.getItem(f),ia={};try{null!=J&&(ia=JSON.parse(J))}catch(X){}var Y=ia,aa="editor",ja=!1,la=!1;c=document.createElement("div");
c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right="20px";var ua=document.createElement("div");ua.style.position="absolute";ua.style.left="0";ua.style.right="0";ua.style.top="0";ua.style.height="28px";ua.style.display="flex";ua.style.alignItems="end";ua.style.borderBottom="1px solid #d0d0d0";var Da=E(mxResources.get("editor"),!0),ha=E(mxResources.get("formatJson"),!1);ua.appendChild(Da);ua.appendChild(ha);c.appendChild(ua);var k=document.createElement("div");
k.style.position="absolute";k.style.left="0";k.style.right="0";k.style.top="30px";k.style.bottom="50px";ua={};try{var u=V.editor.graph;null!=u.currentVertexStyle&&(ua.currentVertexStyle=u.currentVertexStyle);null!=u.currentEdgeStyle&&(ua.currentEdgeStyle=u.currentEdgeStyle)}catch(X){}var H=DrawioConfigEditor.install(k,{initialConfig:ia,editorContext:ua,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:V.isHighContrast(),onConfigChanged:function(X){Y=X;ja=!0}}),P=document.createElement("div");
-P.style.position="absolute";P.style.left="0";P.style.right="0";P.style.top="30px";P.style.bottom="50px";P.style.display="none";var T=document.createElement("textarea");T.setAttribute("wrap","off");T.setAttribute("spellcheck","false");T.setAttribute("autocorrect","off");T.setAttribute("autocomplete","off");T.setAttribute("autocapitalize","off");T.style.resize="none";T.style.outline="none";T.style.boxSizing="border-box";T.style.width="100%";T.style.height="100%";try{T.value=null!=J?JSON.stringify(JSON.parse(J),
-null,2):""}catch(X){T.value=J||""}mxEvent.addListener(T,"input",function(){ja=!0});P.appendChild(T);c.appendChild(k);c.appendChild(P);mxEvent.addListener(Da,"click",function(){Q("editor")});mxEvent.addListener(ha,"click",function(){Q("json")});var W=document.createElement("div");W.style.position="absolute";W.style.left="0";W.style.right="0";W.style.bottom="0";W.style.height="46px";W.style.display="flex";W.style.whiteSpace="nowrap";W.style.alignItems="center";W.style.justifyContent="end";W.style.paddingTop=
-"10px";W.style.paddingBottom="10px";W.style.boxSizing="border-box";null==q||V.isOffline()||W.appendChild(V.createHelpIcon(q));if(null!=l)for(q=0;q<l.length;q++)(function(X,ea,oa){X=mxUtils.button(X,function(la){"json"!==aa&&null!=Y&&(T.value=JSON.stringify(Y,null,2));ea(la,T)});null!=oa&&X.setAttribute("title",oa);X.className="geBtn";W.appendChild(X)})(l[q][0],l[q][1],l[q][2]);q=mxUtils.button(mxResources.get("close"),function(){x(A)});q.setAttribute("title","Escape");q.className="geBtn";var fa=mxUtils.button(mxResources.get("apply"),
-function(){if(ja){if("json"!==aa){var X=H.getInvalidFields();if(0<X.length){V.handleError({message:mxResources.get("invalidInput")+": "+X.join(", ")});return}X=null!=Y&&0<Object.keys(Y).length?JSON.stringify(Y,null,2):""}else X=T.value;try{if(X==J)ja=!1,A();else{if(0<X.length){var ea=JSON.parse(X);localStorage.setItem(f,JSON.stringify(ea))}else localStorage.removeItem(f);ja=!1;A();V.alert(mxResources.get("restartForChangeRequired"))}}catch(oa){V.handleError(oa)}}else A()});fa.className="geBtn gePrimaryBtn";
-V.editor.cancelFirst?(W.appendChild(q),W.appendChild(fa)):(W.appendChild(fa),W.appendChild(q));c.appendChild(W);mxEvent.addListener(c,"keydown",function(X){13===X.keyCode&&mxEvent.isControlDown(X)&&fa.click()});V.showDialog(c,800,600,!0,!1,function(X,ea){if(!ka&&ja)return x(A),!1},null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,400));T.scrollTop=0};EditorUi.prototype.showLanguageDialog=function(){function c(){var Q=mxLanguage;null==urlParams.lang&&isLocalStorage&&(Q=mxSettings.settings.language);
+P.style.position="absolute";P.style.left="0";P.style.right="0";P.style.top="30px";P.style.bottom="50px";P.style.display="none";var U=document.createElement("textarea");U.setAttribute("wrap","off");U.setAttribute("spellcheck","false");U.setAttribute("autocorrect","off");U.setAttribute("autocomplete","off");U.setAttribute("autocapitalize","off");U.style.resize="none";U.style.outline="none";U.style.boxSizing="border-box";U.style.width="100%";U.style.height="100%";try{U.value=null!=J?JSON.stringify(JSON.parse(J),
+null,2):""}catch(X){U.value=J||""}mxEvent.addListener(U,"input",function(){ja=!0});P.appendChild(U);c.appendChild(k);c.appendChild(P);mxEvent.addListener(Da,"click",function(){Q("editor")});mxEvent.addListener(ha,"click",function(){Q("json")});var W=document.createElement("div");W.style.position="absolute";W.style.left="0";W.style.right="0";W.style.bottom="0";W.style.height="46px";W.style.display="flex";W.style.whiteSpace="nowrap";W.style.alignItems="center";W.style.justifyContent="end";W.style.paddingTop=
+"10px";W.style.paddingBottom="10px";W.style.boxSizing="border-box";null==q||V.isOffline()||W.appendChild(V.createHelpIcon(q));if(null!=l)for(q=0;q<l.length;q++)(function(X,ea,oa){X=mxUtils.button(X,function(ka){"json"!==aa&&null!=Y&&(U.value=JSON.stringify(Y,null,2));ea(ka,U)});null!=oa&&X.setAttribute("title",oa);X.className="geBtn";W.appendChild(X)})(l[q][0],l[q][1],l[q][2]);q=mxUtils.button(mxResources.get("close"),function(){x(A)});q.setAttribute("title","Escape");q.className="geBtn";var fa=mxUtils.button(mxResources.get("apply"),
+function(){if(ja){if("json"!==aa){var X=H.getInvalidFields();if(0<X.length){V.handleError({message:mxResources.get("invalidInput")+": "+X.join(", ")});return}X=null!=Y&&0<Object.keys(Y).length?JSON.stringify(Y,null,2):""}else X=U.value;try{if(X==J)ja=!1,A();else{if(0<X.length){var ea=JSON.parse(X);localStorage.setItem(f,JSON.stringify(ea))}else localStorage.removeItem(f);ja=!1;A();V.alert(mxResources.get("restartForChangeRequired"))}}catch(oa){V.handleError(oa)}}else A()});fa.className="geBtn gePrimaryBtn";
+V.editor.cancelFirst?(W.appendChild(q),W.appendChild(fa)):(W.appendChild(fa),W.appendChild(q));c.appendChild(W);mxEvent.addListener(c,"keydown",function(X){13===X.keyCode&&mxEvent.isControlDown(X)&&fa.click()});V.showDialog(c,800,600,!0,!1,function(X,ea){if(!la&&ja)return x(A),!1},null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,400));U.scrollTop=0};EditorUi.prototype.showLanguageDialog=function(){function c(){var Q=mxLanguage;null==urlParams.lang&&isLocalStorage&&(Q=mxSettings.settings.language);
for(var V=!1===navigator.onLine,J=Object.create(null),ia=0;ia<x.length;ia++){var Y=x[ia];J[Y.code]=Y.box.checked;Y.box.disabled="en"==Y.code||Y.code==Q&&Y.box.checked||V&&!Y.box.checked;Y.box.style.cursor=Y.box.disabled?"":"pointer";Y.row.style.cursor=Y.box.disabled?"default":"pointer";V&&!Y.box.checked?Y.row.setAttribute("title",mxResources.get("notInOffline")):Y.row.removeAttribute("title")}}var f=this,l=document.createElement("div");l.style.position="absolute";l.style.top="10px";l.style.bottom=
"10px";l.style.left="16px";l.style.right="16px";var q=document.createElement("div");q.style.position="absolute";q.style.left="0";q.style.right="0";q.style.top="0";q.style.bottom="46px";q.style.overflow="auto";l.appendChild(q);var x=[];f.getOfflineLanguages(function(Q){for(var V=Object.create(null),J=0;J<Q.length;J++)V[Q[J]]=!0;Q=[];for(var ia in mxLanguageMap)"i18n"!=ia&&""!=mxLanguageMap[ia]&&Q.push({code:ia,name:mxLanguageMap[ia]});Q.sort(function(aa,ja){return aa.name.localeCompare(ja.name)});
-J=document.createElement("div");J.style.padding="8px 4px 0 4px";J.style.color="#888";mxUtils.write(J,mxResources.get("offlineLanguages",null,"Languages available offline"));q.appendChild(J);var Y=document.createElement("div");Y.style.display="grid";Y.style.gridTemplateColumns="repeat(auto-fill, minmax(170px, 1fr))";Y.style.gap="2px 16px";Y.style.padding="8px 4px";Y.style.cursor="pointer";for(J=0;J<Q.length;J++)(function(aa,ja){var ka=document.createElement("label");ka.style.display="flex";ka.style.alignItems=
-"center";ka.style.padding="4px";ka.style.overflow="hidden";ka.style.whiteSpace="nowrap";var ua=document.createElement("span");ua.style.display="inline-flex";ua.style.alignItems="center";ua.style.justifyContent="center";ua.style.position="relative";ua.style.width="16px";ua.style.height="16px";ua.style.margin="0 8px 0 0";ua.style.flexShrink="0";var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.style.margin="0";Da.checked="en"==aa||1==V[aa];x.push({code:aa,box:Da,row:ka});
-mxEvent.addListener(Da,"change",function(){Da.style.display="none";var k=f.createSpinner(null,null,4);k.spin(ua);var u=function(){f.getOfflineLanguages(function(H){k.stop();Da.style.display="";Da.checked=0<=mxUtils.indexOf(H,aa);c()});f.updateOfflineLanguages()};Da.checked?fetch("resources/dia_"+aa+".txt").then(u,u):f.removeOfflineLanguage(aa,u)});ua.appendChild(Da);ka.appendChild(ua);var ha=document.createElement("span");ha.style.overflow="hidden";ha.style.textOverflow="ellipsis";ha.style.lineHeight=
-"normal";mxUtils.write(ha,ja);ka.appendChild(ha);Y.appendChild(ka)})(Q[J].code,Q[J].name);q.appendChild(Y);c()});var A=function(){c()};mxEvent.addListener(window,"online",A);mxEvent.addListener(window,"offline",A);var E=document.createElement("div");E.style.position="absolute";E.style.left="0";E.style.right="0";E.style.bottom="0";E.style.height="46px";E.style.display="flex";E.style.whiteSpace="nowrap";E.style.alignItems="center";E.style.justifyContent="end";E.style.paddingTop="10px";E.style.paddingBottom=
+J=document.createElement("div");J.style.padding="8px 4px 0 4px";J.style.color="#888";mxUtils.write(J,mxResources.get("offlineLanguages",null,"Languages available offline"));q.appendChild(J);var Y=document.createElement("div");Y.style.display="grid";Y.style.gridTemplateColumns="repeat(auto-fill, minmax(170px, 1fr))";Y.style.gap="2px 16px";Y.style.padding="8px 4px";Y.style.cursor="pointer";for(J=0;J<Q.length;J++)(function(aa,ja){var la=document.createElement("label");la.style.display="flex";la.style.alignItems=
+"center";la.style.padding="4px";la.style.overflow="hidden";la.style.whiteSpace="nowrap";var ua=document.createElement("span");ua.style.display="inline-flex";ua.style.alignItems="center";ua.style.justifyContent="center";ua.style.position="relative";ua.style.width="16px";ua.style.height="16px";ua.style.margin="0 8px 0 0";ua.style.flexShrink="0";var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.style.margin="0";Da.checked="en"==aa||1==V[aa];x.push({code:aa,box:Da,row:la});
+mxEvent.addListener(Da,"change",function(){Da.style.display="none";var k=f.createSpinner(null,null,4);k.spin(ua);var u=function(){f.getOfflineLanguages(function(H){k.stop();Da.style.display="";Da.checked=0<=mxUtils.indexOf(H,aa);c()});f.updateOfflineLanguages()};Da.checked?fetch("resources/dia_"+aa+".txt").then(u,u):f.removeOfflineLanguage(aa,u)});ua.appendChild(Da);la.appendChild(ua);var ha=document.createElement("span");ha.style.overflow="hidden";ha.style.textOverflow="ellipsis";ha.style.lineHeight=
+"normal";mxUtils.write(ha,ja);la.appendChild(ha);Y.appendChild(la)})(Q[J].code,Q[J].name);q.appendChild(Y);c()});var A=function(){c()};mxEvent.addListener(window,"online",A);mxEvent.addListener(window,"offline",A);var E=document.createElement("div");E.style.position="absolute";E.style.left="0";E.style.right="0";E.style.bottom="0";E.style.height="46px";E.style.display="flex";E.style.whiteSpace="nowrap";E.style.alignItems="center";E.style.justifyContent="end";E.style.paddingTop="10px";E.style.paddingBottom=
"10px";E.style.boxSizing="border-box";var K=mxUtils.button(mxResources.get("close"),function(){f.hideDialog()});K.setAttribute("title","Escape");K.className="geBtn gePrimaryBtn";E.appendChild(K);l.appendChild(E);this.showDialog(l,480,460,!0,!0,function(){mxEvent.removeListener(window,"online",A);mxEvent.removeListener(window,"offline",A)})};EditorUi.prototype.showBackgroundImageDialog=function(c,f,l,q){c=null!=c?c:mxUtils.bind(this,function(x,A,E){A||(x=new ChangePageSetup(this,q?E:null,x),x.ignoreColor=
!q,this.editor.graph.model.execute(x))});c=new BackgroundImageDialog(this,c,f,l,q);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,l,q,x){c=new LibraryDialog(this,c,f,l,q,x);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(A){A&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}),!1,!1,new mxRectangle(0,0,480,320));c.init()};EditorUi.prototype.getCollapsedSections=function(){return mxSettings.getCollapsedSections()};
EditorUi.prototype.getLibraryExpanded=function(c,f){var l=mxSettings.getCollapsedLibraries();return null!=l[c]?!l[c]:f};EditorUi.prototype.setLibraryExpanded=function(c,f){if(null!=c){var l=mxSettings.getCollapsedLibraries();l[c]=!f;mxSettings.setCollapsedLibraries(l);mxSettings.save()}};var m=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&
@@ -4290,7 +4292,7 @@ f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,l,q,x,A,E){
if(null!=Q){null!=Q.retry&&(V=mxResources.get("cancel"),J=function(){K();Q.retry()});if(404==Q.code||404==Q.status||403==Q.code){E=403==Q.code?null!=Q.message?mxUtils.htmlEntities(Q.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=x?x:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var ia=null!=x?null:null!=A?A:window.location.hash;if(null!=ia&&("#G"==ia.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==
ia.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==Q.code||404==Q.status)){ia="#U"==ia.substring(0,2)?ia.substring(45,ia.lastIndexOf("%26ex")):ia.substring(2);this.showError(f,E,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ia);null!=q&&q()}),J,
mxResources.get("changeUser"),mxUtils.bind(this,function(){function Y(){ua.innerText="";for(var Da=0;Da<aa.length;Da++){var ha=document.createElement("option");mxUtils.write(ha,aa[Da].displayName);ha.value=Da;ua.appendChild(ha);ha=document.createElement("option");ha.innerHTML="&nbsp;&nbsp;&nbsp;";mxUtils.write(ha,"<"+aa[Da].email+">");ha.setAttribute("disabled","disabled");ua.appendChild(ha)}ha=document.createElement("option");mxUtils.write(ha,mxResources.get("addAccount"));ha.value=aa.length;ua.appendChild(ha)}
-var aa=this.drive.getUsersList(),ja=document.createElement("div"),ka=document.createElement("div");ka.style.marginBottom="6px";mxUtils.write(ka,mxResources.get("changeUser")+": ");ja.appendChild(ka);var ua=document.createElement("select");ua.style.width="100%";Y();mxEvent.addListener(ua,"change",mxUtils.bind(this,function(){var Da=ua.value,ha=aa.length!=Da;ha&&this.drive.setUser(aa[Da]);this.drive.authorize(ha,mxUtils.bind(this,function(){ha||(aa=this.drive.getUsersList(),Y())}),mxUtils.bind(this,
+var aa=this.drive.getUsersList(),ja=document.createElement("div"),la=document.createElement("div");la.style.marginBottom="6px";mxUtils.write(la,mxResources.get("changeUser")+": ");ja.appendChild(la);var ua=document.createElement("select");ua.style.width="100%";Y();mxEvent.addListener(ua,"change",mxUtils.bind(this,function(){var Da=ua.value,ha=aa.length!=Da;ha&&this.drive.setUser(aa[Da]);this.drive.authorize(ha,mxUtils.bind(this,function(){ha||(aa=this.drive.getUsersList(),Y())}),mxUtils.bind(this,
function(k){this.handleError(k)}),!0)}));ja.appendChild(ua);ja=new CustomDialog(this,ja,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ja.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=Q.message?E=""==Q.message&&null!=Q.name?mxUtils.htmlEntities(Q.name,!1):mxUtils.htmlEntities(Q.message,!1):null!=Q.response&&null!=Q.response.error?E=mxUtils.htmlEntities(Q.response.error,
!1):"undefined"!==typeof window.App&&(Q.code==App.ERROR_TIMEOUT?E=mxUtils.htmlEntities(mxResources.get("timeout"),!1):Q.code==App.ERROR_BUSY?E=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof Q&&0<Q.length&&(E=mxUtils.htmlEntities(Q,!1)))}x=c=null;null!=Q&&null!=Q.helpLink?(c=mxResources.get("help"),x=mxUtils.bind(this,function(){return this.editor.graph.openLink(Q.helpLink)})):null!=Q&&null!=Q.ownerEmail?(c=mxResources.get("contactOwner"),E+=mxUtils.htmlEntities(" ("+c+": "+Q.ownerEmail+
")",!1),x=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(Q.ownerEmail))})):null!=Q&&null!=Q.alternateAction&&(c=Q.alternateAction.label,x=Q.alternateAction.funct);this.showError(f,E,V,l,J,null,null,c,x,null!=Q?Q.dialogWidth:null,null,null,q?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,f,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,l,q,x,A){c=
@@ -4299,7 +4301,7 @@ c])){E=null!=E?E:"translate(-50%,120%)";K=null!=K?K:"translate(-50%,0%)";var V=d
"doNotShowAgain":"close"));Q.setAttribute("border","0");x||(A=document.createElement("img"),A.setAttribute("src",IMAGE_PATH+"/logo.png"),A.setAttribute("border","0"),A.setAttribute("align","absmiddle"),A.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",V.appendChild(A),Q.style.cssText=(x?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",V.appendChild(Q));mxUtils.write(V,f);document.body.appendChild(V);
this.bannerShowing=!0;x&&(Q.className="geLibraryButton",V.appendChild(Q));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var J=document.createElement("input");J.setAttribute("type","checkbox");J.setAttribute("id","geDoNotShowAgainCheckbox");J.style.marginRight="6px";if(!q){f.appendChild(J);var ia=document.createElement("label");ia.setAttribute("for","geDoNotShowAgainCheckbox");
mxUtils.write(ia,mxResources.get("doNotShowAgain"));f.appendChild(ia);V.style.paddingBottom=x?"16px":"30px";V.appendChild(f)}var Y=mxUtils.bind(this,function(){null!=V.parentNode&&(V.parentNode.removeChild(V),this.bannerShowing=!1,J.checked||q)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=Q&&mxEvent.addListener(Q,"click",mxUtils.bind(this,function(ja){mxEvent.consume(ja);Y()}));var aa=mxUtils.bind(this,
-function(){mxUtils.setPrefixedStyle(V.style,"transform",E);window.setTimeout(mxUtils.bind(this,function(){Y()}),1E3)});mxEvent.addListener(V,"click",mxUtils.bind(this,function(ja){var ka=mxEvent.getSource(ja);ka!=J&&ka!=ia?(null!=l&&l(),Y(),mxEvent.consume(ja)):aa()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",K)}),500);window.setTimeout(aa,x?5E3:3E4);A=!0}return A};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=
+function(){mxUtils.setPrefixedStyle(V.style,"transform",E);window.setTimeout(mxUtils.bind(this,function(){Y()}),1E3)});mxEvent.addListener(V,"click",mxUtils.bind(this,function(ja){var la=mxEvent.getSource(ja);la!=J&&la!=ia?(null!=l&&l(),Y(),mxEvent.consume(ja)):aa()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",K)}),500);window.setTimeout(aa,x?5E3:3E4);A=!0}return A};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=
c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,l,q){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<q&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",q));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,l,q,x){var A="jpeg"==l?"jpg":l;q=this.getBaseFilename(q)+(null!=f?".drawio":"")+"."+
A;c=this.createImageDataUri(c,f,l,x);this.saveData(q,A,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatAnimatedGif"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var l=document.createElement("div");l.className="geDialogFormRow";var q=document.createElement("span");q.className=
"geDialogFormLabel";mxUtils.write(q,mxResources.get("speed")+":");l.appendChild(q);var x=document.createElement("select"),A=[{label:mxResources.get("slow"),value:8},{label:mxResources.get("medium"),value:15},{label:mxResources.get("fast"),value:24}];for(q=0;q<A.length;q++){var E=document.createElement("option");mxUtils.write(E,A[q].label);E.setAttribute("value",A[q].value);x.appendChild(E)}x.value=null!=this.lastExportFps?this.lastExportFps:15;0>x.selectedIndex&&(x.value=15);l.appendChild(x);f.appendChild(l);
@@ -4313,8 +4315,8 @@ function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try
this.handleError(f)}};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,
f,l,q,x,A){"text/xml"!=l||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=A?A:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,l,q);else{var E=document.createElement("a");A=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof E.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var K=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
A=65==(K?parseInt(K[2],10):!1)?!1:A}if(A||this.isOffline()){E.href=URL.createObjectURL(q?this.base64ToBlob(c,l):new Blob([c],{type:l}));A?E.download=f:E.setAttribute("target","_blank");document.body.appendChild(E);try{window.setTimeout(function(){URL.revokeObjectURL(E.href)},2E4),E.click(),E.parentNode.removeChild(E)}catch(Q){}}else this.createEchoRequest(c,f,l,q,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,l,q,x,A){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,
-c+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=A?"&base64="+A:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(q?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,l,q,x,A,E,K,Q){A=null!=A?A:!1;E=null!=E?E:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(ia,Y,aa,ja){try{if("_blank"==Y)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,q);else if(null!=l&&"text/html"==l.substring(0,9)&&c.length<EmbedDialog.maxSize){var ka=
-new EmbedDialog(this,c,null,null,null,null,null,null,null,!0);this.showDialog(ka.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));ka.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(Y==App.MODE_DEVICE||"download"==Y)this.doSaveLocalFile(c,ia,l,q,null,K);else if(null!=ia&&0<ia.length){var ua=mxUtils.bind(this,function(Da){try{this.exportFile(c,ia,l,q,Y,Da)}catch(ha){this.handleError(ha)}});null!=ja?ua(ja):
+c+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=A?"&base64="+A:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(q?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,l,q,x,A,E,K,Q){A=null!=A?A:!1;E=null!=E?E:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(ia,Y,aa,ja){try{if("_blank"==Y)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,q);else if(null!=l&&"text/html"==l.substring(0,9)&&c.length<EmbedDialog.maxSize){var la=
+new EmbedDialog(this,c,null,null,null,null,null,null,null,!0);this.showDialog(la.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));la.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(Y==App.MODE_DEVICE||"download"==Y)this.doSaveLocalFile(c,ia,l,q,null,K);else if(null!=ia&&0<ia.length){var ua=mxUtils.bind(this,function(Da){try{this.exportFile(c,ia,l,q,Y,Da)}catch(ha){this.handleError(ha)}});null!=ja?ua(ja):
this.pickFolder(Y,ua)}}catch(Da){this.handleError(Da)}});x=[];A||x.push(App.MODE_BROWSER);E||x.push("_blank");var J=new SaveDialog(this,f,mxUtils.bind(this,function(ia,Y,aa){V(ia.value,Y,ia,aa);this.hideDialog(null,null,J.container)}),x,c,l,q,Q);this.showDialog(J.container,420,null!=l?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));J.init()};EditorUi.prototype.openInNewWindow=function(c,f,l){null==window.open(URL.createObjectURL(l?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,
!0)};var p=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){var f=null;try{var l=urlParams.tags;try{l=decodeURIComponent(l)}catch(K){}f=JSON.parse(l)}catch(K){}if(null!=f){var q=this.editor.graph,x=mxUtils.bind(this,function(){var K=
null!=this.currentPage?this.currentPage.getId():0;K=f[K];q.hiddenTags=null!=K&&0<K.length?K:[];q.refresh()});this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){x();q.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize()}));this.editor.addListener("pageSelected",x)}this.tagsDialog=this.tagsComponent=null;var A=c(mxUtils.bind(this,function(K){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=
@@ -4330,21 +4332,21 @@ mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.expo
mxEvent.addListener(aa,"click",mxUtils.bind(this,function(){this.openInNewWindow(Y.substring(Y.indexOf(",")+1),"image/png",!0);null!=navigator.clipboard&&"function"===typeof ClipboardItem&&this.writeImageToClipboard(Y,ia.width,ia.height,"image/png",mxUtils.bind(this,function(){var ja=mxResources.get("imageClicked");null!=this.showBanner?this.showBanner("ImageClicked",ja,null,!1,!0):this.alert(ja)}),mxUtils.bind(this,function(ja){this.handleError(ja)}));Q.apply(this,arguments)}))}),null,this.thumbImageCache,
null,mxUtils.bind(this,function(ia){J.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(ia)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(K)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,l,q,x,A){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){A=this.embedMessageSource||window.opener||
window.parent;var E=this.createLoadMessage("export");E.format=f;E.filename=c;E.data=x?"data:"+q+";base64,"+l:l;E.xml=this.getFileData(!0);A.postMessage(JSON.stringify(E),"*")}else this.isLocalFileSave()?this.saveLocalFile(l,c,q,x,f,A):this.saveRequest(c,f,mxUtils.bind(this,function(K,Q){return this.createEchoRequest(l,K,q,x,f,Q)}),l,x,q)};EditorUi.prototype.saveRequest=function(c,f,l,q,x,A,E){E=null!=E?E:!mxClient.IS_IOS||!navigator.standalone;var K=mxUtils.bind(this,function(V,J,ia,Y){if("_blank"==
-J||null!=V&&0<V.length){var aa=l("_blank"==J?null:V,J==App.MODE_DEVICE||"download"==J||null==J||"_blank"==J?"0":"1");null!=aa&&(J==App.MODE_DEVICE||"download"==J||"_blank"==J?aa.simulate(document,"_blank"):(ia=mxUtils.bind(this,function(ja){A=null!=A?A:"pdf"==f?"application/pdf":"image/"+f;if(null!=q)try{this.exportFile(q,V,A,!0,J,ja)}catch(ka){this.handleError(ka)}else this.spinner.spin(document.body,mxResources.get("saving"))&&aa.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=aa.getStatus()&&
-299>=aa.getStatus())try{this.exportFile(aa.getText(),V,A,!0,J,ja)}catch(ka){this.handleError(ka)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(ka){this.spinner.stop();this.handleError(ka)}))}),null!=Y?ia(Y):this.pickFolder(J,ia)))}});x=[App.MODE_BROWSER];E||x.push("_blank");var Q=new SaveDialog(this,c,mxUtils.bind(this,function(V,J,ia){K(V.value,J,V,ia);this.hideDialog(null,null,Q.container)}),x,null,"application/pdf");this.showDialog(Q.container,
+J||null!=V&&0<V.length){var aa=l("_blank"==J?null:V,J==App.MODE_DEVICE||"download"==J||null==J||"_blank"==J?"0":"1");null!=aa&&(J==App.MODE_DEVICE||"download"==J||"_blank"==J?aa.simulate(document,"_blank"):(ia=mxUtils.bind(this,function(ja){A=null!=A?A:"pdf"==f?"application/pdf":"image/"+f;if(null!=q)try{this.exportFile(q,V,A,!0,J,ja)}catch(la){this.handleError(la)}else this.spinner.spin(document.body,mxResources.get("saving"))&&aa.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=aa.getStatus()&&
+299>=aa.getStatus())try{this.exportFile(aa.getText(),V,A,!0,J,ja)}catch(la){this.handleError(la)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(la){this.spinner.stop();this.handleError(la)}))}),null!=Y?ia(Y):this.pickFolder(J,ia)))}});x=[App.MODE_BROWSER];E||x.push("_blank");var Q=new SaveDialog(this,c,mxUtils.bind(this,function(V,J,ia){K(V.value,J,V,ia);this.hideDialog(null,null,Q.container)}),x,null,"application/pdf");this.showDialog(Q.container,
420,114,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Q.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,l,q,x,A){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,l){f(null)};EditorUi.prototype.addSvgIconHandlers=function(c){for(var f=
c.querySelectorAll("[data-icon-content]"),l=0;l<f.length;l++)"g"==f[l].nodeName&&f[l].hasAttribute("data-icon")||f[l].removeAttribute("data-icon-content");if(null!=c.querySelector("[data-icon-content]")){f=c.ownerDocument;l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"style"):f.createElement("style");l.appendChild(f.createTextNode(".geSvgPopup { display: inline-block; box-sizing: border-box; max-width: 100%; max-height: 100%; overflow: auto; background-color: #ffffff; border: 1px solid #c0c0c0; border-radius: 4px; box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.25); padding: 8px; color: #000000; font-family: Helvetica, Arial, sans-serif; font-size: 12px; word-break: break-word; } @media (prefers-color-scheme: dark) { .geSvgPopup { background-color: #2a252f; border-color: #505050; color: #ffffff; } } @media print { [data-icon], .geSvgPopup { display: none; } }"));
c.appendChild(l);l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"script"):f.createElement("script");l.setAttribute("type","text/javascript");var q='(function() {\nvar svg = document.documentElement;\nvar fo = null, active = null, pinned = false, thread = null;\nfunction hide() {\nif (fo != null && fo.parentNode != null) { fo.parentNode.removeChild(fo); }\nfo = null; active = null; pinned = false;\n}\nfunction cancel() {\nif (thread != null) { window.clearTimeout(thread); thread = null; }\n}\nfunction schedule() {\ncancel();\nif (!pinned) { thread = window.setTimeout(hide, 300); }\n}\nfunction show(icon) {\ncancel();\nif (active == icon) { return; }\nhide();\nvar content = icon.getAttribute("data-icon-content");\nif (content == null || content == "") { return; }\nvar x = parseFloat(icon.getAttribute("x"));\nvar y = parseFloat(icon.getAttribute("y"));\nvar w = parseFloat(icon.getAttribute("width"));\nif (isNaN(x) || isNaN(y)) {\ntry { var bb = icon.getBBox(); x = bb.x; y = bb.y; w = bb.width; }\ncatch (e) { x = 0; y = 0; }\n}\nif (isNaN(w) || w <= 0) { w = 16; }\nvar vb = (svg.viewBox != null && svg.viewBox.baseVal != null &&\nsvg.viewBox.baseVal.width > 0) ? svg.viewBox.baseVal : null;\nvar maxW = (vb != null) ? vb.width : (svg.clientWidth || 800);\nvar maxH = (vb != null) ? vb.height : (svg.clientHeight || 600);\nvar pw = Math.max(60, Math.min(320, maxW - 4));\nvar ph = Math.max(40, Math.min(220, maxH - 4));\nfo = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");\nfo.setAttribute("width", pw);\nfo.setAttribute("height", ph);\nvar div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");\ndiv.setAttribute("class", "geSvgPopup");\ndiv.innerHTML = content;\ndiv.addEventListener("mouseenter", cancel);\ndiv.addEventListener("mouseleave", schedule);\nfo.appendChild(div);\nsvg.appendChild(fo);\nvar mw = div.offsetWidth;\nvar mh = div.offsetHeight;\nif (mw > 0) { pw = Math.min(pw, mw + 2); }\nif (mh > 0) { ph = Math.min(ph, mh + 2); }\nvar px = x + w + 4;\nvar py = y;\nif (vb != null) {\npx = Math.max(vb.x, Math.min(px, vb.x + vb.width - pw - 2));\npy = Math.max(vb.y, Math.min(py, vb.y + vb.height - ph - 2));\n}\nfo.setAttribute("x", px);\nfo.setAttribute("y", py);\nfo.setAttribute("width", pw);\nfo.setAttribute("height", ph);\nactive = icon;\n}\nvar icons = document.querySelectorAll("g[data-icon][data-icon-content]");\nfor (var i = 0; i < icons.length; i++) {\n(function(icon) {\nicon.addEventListener("click", function(evt) {\nif (active == icon) { hide(); }\nelse { show(icon); pinned = true; }\nevt.preventDefault();\nevt.stopPropagation();\n});\nicon.addEventListener("mouseenter", function() {\nif (pinned) { cancel(); }\nelse { show(icon); }\n});\nicon.addEventListener("mouseleave", schedule);\n})(icons[i]);\n}\ndocument.addEventListener("mousedown", function(evt) {\nif (fo != null && (active == null || !active.contains(evt.target)) &&\n!fo.contains(evt.target)) { hide(); }\n});\ndocument.addEventListener("keydown", function(evt) {\nif (evt.keyCode == 27) { hide(); }\n});\n})();'.replace(/\n/g,
-" ");l.appendChild(f.createCDATASection(q));c.appendChild(l)}};EditorUi.prototype.exportSvg=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka,ua)}));this.handleError(la)})))try{var Da=this.editor.graph.isSelectionEmpty();l=null!=l?l:Da;var ha=f?null:this.editor.graph.background;ha==mxConstants.NONE&&
-(ha=null);null==ha&&0==f&&(ha=this.editor.graph.shapeBackgroundColor);var k=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var u=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==J||"dark"==J)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==J;ua&&(E=Math.max(null!=E?E:0,Math.ceil(16*c)));var P=this.editor.graph.createSvgImageExport(x,ja,ua,"self"==V?"_top":"_blank"),T=Object.create(null),
-W=this.getSvgWithFontLookup(T,P,mxUtils.bind(this,function(){return this.editor.graph.getSvg(ha,c,E,K,null,l,null,P,"blank"==V?"_blank":"self"==V?"_top":null,null,null,J,ia,null,null,null,ka)}));mxUtils.lightDarkColorSupported=u;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=k;q&&this.editor.graph.addSvgShadow(W);ua&&this.addSvgIconHandlers(W);var fa=this.getBaseFilename()+(x?".drawio":"")+".svg";aa=null!=aa?aa:mxUtils.bind(this,function(la){this.isLocalFileSave()||la.length<=
-MAX_REQUEST_SIZE?this.saveData(fa,"svg",la,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});var X=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,l,Q,null,null,null,null,null,c,E));aa(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(W);
-var ea=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&A&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&Y?this.replaceAlternateContent(la,J,X):X(la)}),oa=mxUtils.bind(this,function(la){A&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,ea,this.thumbImageCache)):ea(la)});this.embedFonts(W,oa,Y?!0:!1,T)}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function q(ia,
-Y,aa,ja,ka){var ua=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ua.setAttribute("x",Y);ua.setAttribute("y",aa+.5);ua.setAttribute("width",ja.width);ua.setAttribute("height",ja.height);null==ua.setAttributeNS?ua.setAttribute("xlink:href",ka):ua.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ka);ia.replaceChild(ua,ia.lastChild);K()}function x(){if(E<J.length)J[E++](x)}var A="";f=c.getElementsByTagName("style");for(var E=0;E<f.length;E++)A+=f[E].innerHTML;f=c.getElementsByTagName("switch");
-counter=f.length;var K=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),Q={},V={},J=[];for(E=0;E<f.length;E++)mxUtils.bind(this,function(ia){var Y=ia.getElementsByTagName("div");if(0<Y.length)try{var aa=Y[0].cloneNode(!0),ja=parseInt(aa.style.marginLeft),ka=parseInt(aa.style.paddingTop),ua=aa.getElementsByTagName("div")[1],Da=Y=!1,ha=aa.style.alignItems,k=aa.style.justifyContent;if(null!=aa.style.writingMode){var u=aa.style.writingMode;Da="vertical-"==u.substring(0,9);Y="-rl"==u.substring(u.length-
-3)}var H=!Da&&"1px"==aa.style.width||Da&&"1px"==aa.style.height;if(!Da&&"1px"==aa.style.height||Da&&"1px"==aa.style.width)aa.style.alignItems=Da&&Y?"unsafe flex-end":"unsafe flex-start";H&&(aa.style.justifyContent="unsafe flex-start");aa.style.paddingTop="";aa.style.marginLeft="";var P=aa.outerHTML,T=Q[P];null==T&&(aa.style.position="absolute",aa.style.visibility="hidden",document.body.appendChild(aa),u=1,u="1px"==aa.style.width?ua.offsetWidth:parseInt(aa.style.width),H=1,H="1px"==aa.style.height?
-ua.offsetHeight:parseInt(aa.style.height),document.body.removeChild(aa),T=new mxRectangle(ja,ka,u,H),Q[P]=T);"1px"==aa.style.height&&("unsafe center"==ha?ka-=T.height/2:"unsafe flex-end"==ha&&(ka-=T.height));if("1px"==aa.style.width)if(!Da&&"unsafe center"==k||Da&&"unsafe center"==ha)ja-=T.width/2;else if(!Da&&"unsafe flex-end"==k||Da&&(!Y&&"unsafe flex-end"==ha||Y&&"unsafe flex-start"==ha))ja-=T.width;T=new mxRectangle(ja,ka,T.width,T.height+parseInt(ua.style.fontSize)/4);J.push(mxUtils.bind(this,
-function(W){var fa=V[P];null==fa?Graph.htmlToPng(P,T.width,T.height,mxUtils.bind(this,function(X){q(ia,ja,ka,T,X);V[P]=X;W()}),A):(q(ia,ja,ka,T,fa),W())}))}catch(W){K()}else K()})(f[E]);0==counter&&l(c);E=0;x()};EditorUi.prototype.addRadiobox=function(c,f,l,q,x,A,E){return this.addCheckbox(c,l,q,x,A,E,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,q,x,A,E,K,Q){A=null!=A?A:!0;var V=document.createElement("input");V.style.marginRight="8px";V.setAttribute("type",E?"radio":"checkbox");E="geCheckbox-"+
+" ");l.appendChild(f.createCDATASection(q));c.appendChild(l)}};EditorUi.prototype.exportSvg=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ka){Editor.addRetryToError(ka,mxUtils.bind(this,function(){this.exportSvg(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la,ua)}));this.handleError(ka)})))try{var Da=this.editor.graph.isSelectionEmpty();l=null!=l?l:Da;var ha=f?null:this.editor.graph.background;ha==mxConstants.NONE&&
+(ha=null);null==ha&&0==f&&(ha=this.editor.graph.shapeBackgroundColor);var k=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var u=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==J||"dark"==J)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==J;ua&&(E=Math.max(null!=E?E:0,Math.ceil(16*c)));var P=this.editor.graph.createSvgImageExport(x,ja,ua,"self"==V?"_top":"_blank"),U=Object.create(null),
+W=this.getSvgWithFontLookup(U,P,mxUtils.bind(this,function(){return this.editor.graph.getSvg(ha,c,E,K,null,l,null,P,"blank"==V?"_blank":"self"==V?"_top":null,null,null,J,ia,null,null,null,la)}));mxUtils.lightDarkColorSupported=u;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=k;q&&this.editor.graph.addSvgShadow(W);ua&&this.addSvgIconHandlers(W);var fa=this.getBaseFilename()+(x?".drawio":"")+".svg";aa=null!=aa?aa:mxUtils.bind(this,function(ka){this.isLocalFileSave()||ka.length<=
+MAX_REQUEST_SIZE?this.saveData(fa,"svg",ka,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(ka)}))});var X=mxUtils.bind(this,function(ka){this.spinner.stop();x&&ka.setAttribute("content",this.getFileData(!0,null,null,null,l,Q,null,null,null,null,null,c,E));aa(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(ka))});this.editor.graph.mathEnabled&&this.editor.addMathCss(W);
+var ea=mxUtils.bind(this,function(ka){Editor.replaceSvgDataUris&&A&&EditorUi.embedSvgImages(ka);Editor.foreignObjectImages&&Y?this.replaceAlternateContent(ka,J,X):X(ka)}),oa=mxUtils.bind(this,function(ka){A&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(ka,ea,this.thumbImageCache)):ea(ka)});this.embedFonts(W,oa,Y?!0:!1,U)}catch(ka){this.handleError(ka)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function q(ia,
+Y,aa,ja,la){var ua=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ua.setAttribute("x",Y);ua.setAttribute("y",aa+.5);ua.setAttribute("width",ja.width);ua.setAttribute("height",ja.height);null==ua.setAttributeNS?ua.setAttribute("xlink:href",la):ua.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",la);ia.replaceChild(ua,ia.lastChild);K()}function x(){if(E<J.length)J[E++](x)}var A="";f=c.getElementsByTagName("style");for(var E=0;E<f.length;E++)A+=f[E].innerHTML;f=c.getElementsByTagName("switch");
+counter=f.length;var K=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),Q={},V={},J=[];for(E=0;E<f.length;E++)mxUtils.bind(this,function(ia){var Y=ia.getElementsByTagName("div");if(0<Y.length)try{var aa=Y[0].cloneNode(!0),ja=parseInt(aa.style.marginLeft),la=parseInt(aa.style.paddingTop),ua=aa.getElementsByTagName("div")[1],Da=Y=!1,ha=aa.style.alignItems,k=aa.style.justifyContent;if(null!=aa.style.writingMode){var u=aa.style.writingMode;Da="vertical-"==u.substring(0,9);Y="-rl"==u.substring(u.length-
+3)}var H=!Da&&"1px"==aa.style.width||Da&&"1px"==aa.style.height;if(!Da&&"1px"==aa.style.height||Da&&"1px"==aa.style.width)aa.style.alignItems=Da&&Y?"unsafe flex-end":"unsafe flex-start";H&&(aa.style.justifyContent="unsafe flex-start");aa.style.paddingTop="";aa.style.marginLeft="";var P=aa.outerHTML,U=Q[P];null==U&&(aa.style.position="absolute",aa.style.visibility="hidden",document.body.appendChild(aa),u=1,u="1px"==aa.style.width?ua.offsetWidth:parseInt(aa.style.width),H=1,H="1px"==aa.style.height?
+ua.offsetHeight:parseInt(aa.style.height),document.body.removeChild(aa),U=new mxRectangle(ja,la,u,H),Q[P]=U);"1px"==aa.style.height&&("unsafe center"==ha?la-=U.height/2:"unsafe flex-end"==ha&&(la-=U.height));if("1px"==aa.style.width)if(!Da&&"unsafe center"==k||Da&&"unsafe center"==ha)ja-=U.width/2;else if(!Da&&"unsafe flex-end"==k||Da&&(!Y&&"unsafe flex-end"==ha||Y&&"unsafe flex-start"==ha))ja-=U.width;U=new mxRectangle(ja,la,U.width,U.height+parseInt(ua.style.fontSize)/4);J.push(mxUtils.bind(this,
+function(W){var fa=V[P];null==fa?Graph.htmlToPng(P,U.width,U.height,mxUtils.bind(this,function(X){q(ia,ja,la,U,X);V[P]=X;W()}),A):(q(ia,ja,la,U,fa),W())}))}catch(W){K()}else K()})(f[E]);0==counter&&l(c);E=0;x()};EditorUi.prototype.addRadiobox=function(c,f,l,q,x,A,E){return this.addCheckbox(c,l,q,x,A,E,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,q,x,A,E,K,Q){A=null!=A?A:!0;var V=document.createElement("input");V.style.marginRight="8px";V.setAttribute("type",E?"radio":"checkbox");E="geCheckbox-"+
Editor.guid();V.id=E;null!=K&&V.setAttribute("name",K);l&&(V.setAttribute("checked","checked"),V.defaultChecked=!0);q&&V.setAttribute("disabled","disabled");A&&(Q?(x=document.createElement("div"),x.className="geDialogCheckRow",x.appendChild(V),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",E),x.appendChild(l),c.appendChild(x),V.checkRow=x):(V.style.marginTop="16px",c.appendChild(V),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",E),c.appendChild(l),
x||mxUtils.br(c)));return V};EditorUi.prototype.addAdvancedSection=function(c,f){var l=document.createElement("div");l.className="geCollapsibleTitle";mxUtils.write(l,mxResources.get(f||"advanced"));var q=document.createElement("div");q.className="geCollapsibleContent geCollapsed";f=document.createElement("div");f.className="geDialogSection";q.appendChild(f);var x=function(A){if(A!==l.classList.contains("geExpanded")&&(l.classList.toggle("geExpanded"),q.classList.toggle("geCollapsed"),A=l.closest(".geDialog"),
null!=A)){var E=A.firstElementChild;null!=E&&(A.style.height="",A.style.height=E.scrollHeight+48+"px")}};mxEvent.addListener(l,"click",function(){x(!l.classList.contains("geExpanded"))});c.appendChild(l);c.appendChild(q);return{content:f,wrapper:q,expand:function(){x(!0)},collapse:function(){x(!1)},isExpanded:function(){return l.classList.contains("geExpanded")}}};EditorUi.prototype.addEditButton=function(c,f){var l=document.createElement("div");l.className="geDialogCheckRow";var q=document.createElement("span");
@@ -4355,9 +4357,9 @@ function(c,f){function l(){var Q=document.createElement("div");Q.style.width="10
x.className="geDialogFormLabel";mxUtils.write(x,mxResources.get("links")+":");q.appendChild(x);var A=document.createElement("select");A.style.width="100px";A.style.padding="0px";A.style.marginRight="10px";A.className="geBtn";x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));A.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));A.appendChild(x);x=document.createElement("option");
x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));A.appendChild(x);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),A.appendChild(f));q.appendChild(A);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");q.appendChild(f);var E="#0000ff",K=null;K=mxUtils.button("",mxUtils.bind(this,function(Q){this.pickColor(E||"none",function(V){E=
V;l()});mxEvent.consume(Q)}));l();K.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";K.style.marginLeft="4px";K.style.height="22px";K.style.width="22px";K.style.position="relative";K.style.top="1px";K.className="geColorBtn";q.appendChild(K);c.appendChild(q);return{getColor:function(){return E},getTarget:function(){return A.value},focus:function(){A.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,l,q,x,A,E,K){A=null!=A?A:[];l&&(A.push("lightbox=1"),"auto"!=c&&A.push("target="+c),
-null!=f&&f!=mxConstants.NONE&&A.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=q&&0<q.length&&A.push("edit="+encodeURIComponent(q)),x&&A.push("layers=1"),E&&A.push("link-icons=1"),K&&A.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&A.push("nav=1"));return A};EditorUi.prototype.createLink=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja){var ka=this.getCurrentFile();Q=this.createUrlParameters(c,f,q,x,A,Q,aa,ja);c=!0;null!=E?l="#U"+encodeURIComponent(E):K||null==ka||""==ka.getHash()?
-l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+ka.getHash(),c=!1);c&&null!=ka&&null!=ka.getTitle()&&ka.getTitle()!=this.defaultFilename&&Q.push("title="+encodeURIComponent(ka.getTitle()));V&&1<l.length&&(Q.push("open="+l.substring(1)),l="");V=1==J?this.currentPage:J;null!=V&&"function"===typeof V.getId&&Q.push("page-id="+V.getId());ia&&Q.push("transparent=1");null!=Y&&Q.push("dark="+Y);return(q&&
-(null!=E||null!=ka&&ka.getMode()!=App.MODE_GITHUB&&ka.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<Q.length?"?"+Q.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka){this.getBasenames();var ua={};ja&&(ua["show-link-icons"]=!0);ka&&(ua["show-tooltip-icons"]=!0);""!=x&&x!=mxConstants.NONE&&(ua.highlight=
+null!=f&&f!=mxConstants.NONE&&A.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=q&&0<q.length&&A.push("edit="+encodeURIComponent(q)),x&&A.push("layers=1"),E&&A.push("link-icons=1"),K&&A.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&A.push("nav=1"));return A};EditorUi.prototype.createLink=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja){var la=this.getCurrentFile();Q=this.createUrlParameters(c,f,q,x,A,Q,aa,ja);c=!0;null!=E?l="#U"+encodeURIComponent(E):K||null==la||""==la.getHash()?
+l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+la.getHash(),c=!1);c&&null!=la&&null!=la.getTitle()&&la.getTitle()!=this.defaultFilename&&Q.push("title="+encodeURIComponent(la.getTitle()));V&&1<l.length&&(Q.push("open="+l.substring(1)),l="");V=1==J?this.currentPage:J;null!=V&&"function"===typeof V.getId&&Q.push("page-id="+V.getId());ia&&Q.push("transparent=1");null!=Y&&Q.push("dark="+Y);return(q&&
+(null!=E||null!=la&&la.getMode()!=App.MODE_GITHUB&&la.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<Q.length?"?"+Q.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la){this.getBasenames();var ua={};ja&&(ua["show-link-icons"]=!0);la&&(ua["show-tooltip-icons"]=!0);""!=x&&x!=mxConstants.NONE&&(ua.highlight=
x);"auto"!==q&&(ua.target=q);V||(ua.lightbox=!1);ua.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(ua.zoom=l/100);l=[];E&&(l.push("pages"),ua.resize=!0,null!=this.pages&&null!=this.currentPage&&(ua.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(l.push("zoom"),ua.resize=!0);K&&l.push("layers");Q&&(l.push("tags"),aa&&(f=this.getHiddenTagsMap(),null!=f&&(ua.hiddenTags=f)));null!=Y&&(ua["dark-mode"]=Y);0<l.length&&(V&&l.push("lightbox"),ua.toolbar=l.join(" "));null!=J&&
0<J.length&&(ua.edit=J);null!=c?ua.url=c:ua.xml=this.getFileData(!0,null,null,null,null,!E);A='<div class="mxgraph" style="'+(A?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ua))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ia(A,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":
window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.addPagesRow=function(c){var f=document.createElement("select");f.style.maxWidth="260px";var l=document.createElement("option");mxUtils.write(l,mxResources.get("allPages"));l.setAttribute("value","allPages");f.appendChild(l);l=document.createElement("option");mxUtils.write(l,mxResources.get("currentPage"));l.setAttribute("value","currentPage");f.appendChild(l);l=
@@ -4365,61 +4367,61 @@ null;if(null!=this.pages&&1<this.pages.length){l=document.createElement("div");l
var E=document.createElement("select");E.className="geBtn";E.style.margin="0 4px 8px 4px";E.style.width="calc(100% - 8px)";E.style.boxSizing="border-box";A=document.createElement("option");mxUtils.write(A,mxResources.get("includeCopyOfMyDiagram"));A.setAttribute("value","copy");E.appendChild(A);A=document.createElement("option");A.setAttribute("value","url");E.appendChild(A);null!=l?(mxUtils.write(A,mxResources.get("publicDiagramUrl")),A.setAttribute("title",l)):(mxUtils.write(A,mxResources.get("publicDiagramUrl")+
" ("+mxResources.get("diagramIsNotPublic")+")"),A.setAttribute("disabled","disabled"));x.appendChild(E);mxUtils.br(x);var K=this.getCurrentFile();if(null==l&&null!=K&&K.constructor==window.DriveFile){A=document.createElement("div");A.style.marginBottom="8px";var Q=document.createElement("a");Q.style.color="gray";Q.style.cursor="pointer";mxUtils.write(Q,mxResources.get("share"));A.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(K.getId(),
K)}));x.appendChild(A)}A=document.createElement("div");A.className="geDialogSection";var V=this.addLinkSection(A),J=this.addPagesRow(A);Q=document.createElement("div");Q.className="geDialogCheckRow";var ia=document.createElement("input");ia.setAttribute("type","checkbox");ia.setAttribute("checked","checked");ia.defaultChecked=!0;ia.style.marginRight="8px";Q.appendChild(ia);var Y=document.createElement("label");mxUtils.write(Y,mxResources.get("zoom")+":");Q.appendChild(Y);var aa=document.createElement("input");
-aa.setAttribute("type","text");aa.style.width="60px";aa.style.marginLeft="4px";aa.value="100%";Q.appendChild(aa);A.appendChild(Q);var ja=this.addCheckbox(A,mxResources.get("fit"),!0,null,null,null,null,null,!0),ka=this.addCheckbox(A,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);x.appendChild(A);A=this.addAdvancedSection(x).content;var ua=document.createElement("select");ua.style.maxWidth="260px";Q=document.createElement("option");Q.setAttribute("value","light");mxUtils.write(Q,mxResources.get("light"));
+aa.setAttribute("type","text");aa.style.width="60px";aa.style.marginLeft="4px";aa.value="100%";Q.appendChild(aa);A.appendChild(Q);var ja=this.addCheckbox(A,mxResources.get("fit"),!0,null,null,null,null,null,!0),la=this.addCheckbox(A,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);x.appendChild(A);A=this.addAdvancedSection(x).content;var ua=document.createElement("select");ua.style.maxWidth="260px";Q=document.createElement("option");Q.setAttribute("value","light");mxUtils.write(Q,mxResources.get("light"));
ua.appendChild(Q);Q=document.createElement("option");Q.setAttribute("value","dark");mxUtils.write(Q,mxResources.get("dark"));ua.appendChild(Q);Q=document.createElement("option");Q.setAttribute("value","auto");mxUtils.write(Q,mxResources.get("automatic"));Q.setAttribute("selected","selected");ua.appendChild(Q);Q=document.createElement("div");Q.className="geDialogFormRow";Y=document.createElement("span");Y.className="geDialogFormLabel";mxUtils.write(Y,mxResources.get("appearance")+":");Q.appendChild(Y);
-Q.appendChild(ua);A.appendChild(Q);var Da=null;if(EditorUi.enableHtmlEditOption){Da=this.addEditButton(A,ka);var ha=Da.getEditInput();mxEvent.addListener(ka,"change",function(){ka.checked?ha.removeAttribute("disabled"):ha.setAttribute("disabled","disabled");ha.checked&&ka.checked?Da.getEditSelect().removeAttribute("disabled"):Da.getEditSelect().setAttribute("disabled","disabled")})}var k=this.addCheckbox(A,mxResources.get("layers"),!0,null,null,null,null,null,!0),u=this.addCheckbox(A,mxResources.get("tags"),
-!0,null,null,null,null,null,!0),H=this.addCheckbox(A,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);H.checkRow.style.paddingLeft="24px";var P=this.addCheckbox(A,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),T=this.addCheckbox(A,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(u,"change",function(){u.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});mxEvent.addListener(ka,"change",function(){ka.checked?
-(P.removeAttribute("disabled"),T.removeAttribute("disabled")):(P.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"))});c=new CustomDialog(this,x,mxUtils.bind(this,function(){q("url"==E.value?l:null,ia.checked,aa.value,V.getTarget(),V.getColor(),ja.checked,null!=J.row&&"allPages"==J.select.value,k.checked,u.checked,ka.checked,null!=Da?Da.getLink():null,null!=ua?ua.value:null,u.checked&&H.checked,P.checked,T.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);E.focus()};
+Q.appendChild(ua);A.appendChild(Q);var Da=null;if(EditorUi.enableHtmlEditOption){Da=this.addEditButton(A,la);var ha=Da.getEditInput();mxEvent.addListener(la,"change",function(){la.checked?ha.removeAttribute("disabled"):ha.setAttribute("disabled","disabled");ha.checked&&la.checked?Da.getEditSelect().removeAttribute("disabled"):Da.getEditSelect().setAttribute("disabled","disabled")})}var k=this.addCheckbox(A,mxResources.get("layers"),!0,null,null,null,null,null,!0),u=this.addCheckbox(A,mxResources.get("tags"),
+!0,null,null,null,null,null,!0),H=this.addCheckbox(A,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);H.checkRow.style.paddingLeft="24px";var P=this.addCheckbox(A,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),U=this.addCheckbox(A,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(u,"change",function(){u.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});mxEvent.addListener(la,"change",function(){la.checked?
+(P.removeAttribute("disabled"),U.removeAttribute("disabled")):(P.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"))});c=new CustomDialog(this,x,mxUtils.bind(this,function(){q("url"==E.value?l:null,ia.checked,aa.value,V.getTarget(),V.getColor(),ja.checked,null!=J.row&&"allPages"==J.select.value,k.checked,u.checked,la.checked,null!=Da?Da.getLink():null,null!=ua?ua.value:null,u.checked&&H.checked,P.checked,U.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);E.focus()};
EditorUi.prototype.showPublishLinkDialog=function(c,f,l,q,x,A,E,K,Q,V,J,ia){var Y=document.createElement("div");Y.style.whiteSpace="nowrap";var aa=document.createElement("h3");mxUtils.write(aa,c||mxResources.get("publish"));Y.appendChild(aa);var ja=document.createElement("select");ja.className="geBtn";ja.style.margin="0 4px 8px 4px";ja.style.width="calc(100% - 8px)";ja.style.boxSizing="border-box";x=null!=x?x:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");
mxUtils.write(c,mxResources.get("includeCopyOfMyDiagram"));c.setAttribute("value","copy");ja.appendChild(c);c=document.createElement("option");mxUtils.write(c,mxResources.get("authorizationRequired"));c.setAttribute("value","auth");ja.appendChild(c);null==K||""==K.getHash()||K.getMode()==App.MODE_DEVICE||K.getMode()==App.MODE_BROWSER?c.setAttribute("disabled","disabled"):ja.value="auth";K=document.createElement("option");K.setAttribute("value","public");ja.appendChild(K);null!=E?(mxUtils.write(K,
-mxResources.get("publicDiagramUrl")),K.setAttribute("title",E),ja.value="public"):(mxUtils.write(K,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),K.setAttribute("disabled","disabled"));Y.appendChild(ja);mxUtils.br(Y);E=document.createElement("div");E.className="geDialogSection";var ka=null,ua=null;if(null!=f||null!=l)f=document.createElement("div"),f.className="geDialogInlineFields",K=document.createElement("div"),K.className="geDialogInlineField",c=document.createElement("label"),
-mxUtils.write(c,mxResources.get("width")+":"),K.appendChild(c),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.value="100%",K.appendChild(ka),f.appendChild(K),K=document.createElement("div"),K.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("height")+":"),K.appendChild(c),ua=document.createElement("input"),ua.setAttribute("type","text"),ua.value=l+"px",K.appendChild(ua),f.appendChild(K),E.appendChild(f);var Da=this.addLinkSection(E,
+mxResources.get("publicDiagramUrl")),K.setAttribute("title",E),ja.value="public"):(mxUtils.write(K,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),K.setAttribute("disabled","disabled"));Y.appendChild(ja);mxUtils.br(Y);E=document.createElement("div");E.className="geDialogSection";var la=null,ua=null;if(null!=f||null!=l)f=document.createElement("div"),f.className="geDialogInlineFields",K=document.createElement("div"),K.className="geDialogInlineField",c=document.createElement("label"),
+mxUtils.write(c,mxResources.get("width")+":"),K.appendChild(c),la=document.createElement("input"),la.setAttribute("type","text"),la.value="100%",K.appendChild(la),f.appendChild(K),K=document.createElement("div"),K.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("height")+":"),K.appendChild(c),ua=document.createElement("input"),ua.setAttribute("type","text"),ua.value=l+"px",K.appendChild(ua),f.appendChild(K),E.appendChild(f);var Da=this.addLinkSection(E,
q),ha=V?this.addCheckbox(E,mxResources.get("transparentBackground"),!1,null,null,null,null,null,!0):null,k=this.addPagesRow(E),u=k.select;null==k.row||ia||(l=function(){k.row.style.display="copy"==ja.value?"":"none"},mxEvent.addListener(ja,"change",l),l());var H=null;if(null!=this.pages&&1<this.pages.length){l=document.createElement("div");l.className="geDialogFormRow";V=document.createElement("span");V.className="geDialogFormLabel";mxUtils.write(V,mxResources.get("initialPage",null,"Initial Page")+
":");l.appendChild(V);H=document.createElement("select");H.style.maxWidth="260px";for(V=0;V<this.pages.length;V++)ia=document.createElement("option"),mxUtils.write(ia,this.pages[V].getName()),ia.setAttribute("value",V),this.pages[V]==this.currentPage&&ia.setAttribute("selected","selected"),H.appendChild(ia);l.appendChild(H);E.appendChild(l);l=function(){"none"!=k.row.style.display&&"currentPage"==u.value?H.setAttribute("disabled","disabled"):H.removeAttribute("disabled")};mxEvent.addListener(u,"change",
-l);mxEvent.addListener(ja,"change",l);l()}var P=this.addCheckbox(E,mxResources.get("lightbox"),!0,null,null,!q,null,null,!0);q&&null!=P.checkRow&&(P.checkRow.style.display="none");Y.appendChild(E);q=this.addAdvancedSection(Y).content;var T=document.createElement("select");T.style.maxWidth="260px";l=document.createElement("option");l.setAttribute("value","0");mxUtils.write(l,mxResources.get("light"));T.appendChild(l);l=document.createElement("option");l.setAttribute("value","1");mxUtils.write(l,mxResources.get("dark"));
-T.appendChild(l);l=document.createElement("option");l.setAttribute("value","auto");mxUtils.write(l,mxResources.get("automatic"));l.setAttribute("selected","selected");T.appendChild(l);J&&(J=document.createElement("div"),J.className="geDialogFormRow",l=document.createElement("span"),l.className="geDialogFormLabel",mxUtils.write(l,mxResources.get("appearance")+":"),J.appendChild(l),J.appendChild(T),q.appendChild(J));var W=this.addEditButton(q,P),fa=W.getEditInput(),X=this.addCheckbox(q,mxResources.get("layers"),
-!0,null,null,null,null,null,!0),ea=this.addCheckbox(q,mxResources.get("tags"),!0,null,null,null,null,null,!0),oa=this.addCheckbox(q,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);oa.checkRow.style.paddingLeft="24px";var la=this.addCheckbox(q,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),ca=this.addCheckbox(q,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ea,"change",function(){ea.checked?oa.removeAttribute("disabled"):oa.setAttribute("disabled",
-"disabled")});mxEvent.addListener(P,"change",function(){P.checked?(X.removeAttribute("disabled"),fa.removeAttribute("disabled"),ea.removeAttribute("disabled"),la.removeAttribute("disabled"),ca.removeAttribute("disabled"),ea.checked&&oa.removeAttribute("disabled")):(X.setAttribute("disabled","disabled"),fa.setAttribute("disabled","disabled"),ea.setAttribute("disabled","disabled"),oa.setAttribute("disabled","disabled"),la.setAttribute("disabled","disabled"),ca.setAttribute("disabled","disabled"));fa.checked&&
-P.checked?W.getEditSelect().removeAttribute("disabled"):W.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,Y,mxUtils.bind(this,function(){Q(Da.getTarget(),Da.getColor(),null==H||0>=H.selectedIndex||null!=H.getAttribute("disabled")?null:this.pages[H.selectedIndex],P.checked,W.getLink(),X.checked,null!=ka?ka.value:null,null!=ua?ua.value:null,ea.checked,ja.value,null!=ha?ha.checked:!1,T.value,"allPages"==u.value,ea.checked&&oa.checked,la.checked,ca.checked)}),null,mxResources.get("create"),
-x,A);this.showDialog(x.container,360,null,!0,!0);null!=ka?(ka.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ka.select():document.execCommand("selectAll",!1,null)):ja.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,q,x){var A=document.createElement("div");A.style.whiteSpace="nowrap";var E=document.createElement("h3");mxUtils.write(E,mxResources.get("image"));A.appendChild(E);if(x){E=document.createElement("div");E.className="geDialogSection";var K=document.createElement("div");
+l);mxEvent.addListener(ja,"change",l);l()}var P=this.addCheckbox(E,mxResources.get("lightbox"),!0,null,null,!q,null,null,!0);q&&null!=P.checkRow&&(P.checkRow.style.display="none");Y.appendChild(E);q=this.addAdvancedSection(Y).content;var U=document.createElement("select");U.style.maxWidth="260px";l=document.createElement("option");l.setAttribute("value","0");mxUtils.write(l,mxResources.get("light"));U.appendChild(l);l=document.createElement("option");l.setAttribute("value","1");mxUtils.write(l,mxResources.get("dark"));
+U.appendChild(l);l=document.createElement("option");l.setAttribute("value","auto");mxUtils.write(l,mxResources.get("automatic"));l.setAttribute("selected","selected");U.appendChild(l);J&&(J=document.createElement("div"),J.className="geDialogFormRow",l=document.createElement("span"),l.className="geDialogFormLabel",mxUtils.write(l,mxResources.get("appearance")+":"),J.appendChild(l),J.appendChild(U),q.appendChild(J));var W=this.addEditButton(q,P),fa=W.getEditInput(),X=this.addCheckbox(q,mxResources.get("layers"),
+!0,null,null,null,null,null,!0),ea=this.addCheckbox(q,mxResources.get("tags"),!0,null,null,null,null,null,!0),oa=this.addCheckbox(q,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);oa.checkRow.style.paddingLeft="24px";var ka=this.addCheckbox(q,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),ba=this.addCheckbox(q,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ea,"change",function(){ea.checked?oa.removeAttribute("disabled"):oa.setAttribute("disabled",
+"disabled")});mxEvent.addListener(P,"change",function(){P.checked?(X.removeAttribute("disabled"),fa.removeAttribute("disabled"),ea.removeAttribute("disabled"),ka.removeAttribute("disabled"),ba.removeAttribute("disabled"),ea.checked&&oa.removeAttribute("disabled")):(X.setAttribute("disabled","disabled"),fa.setAttribute("disabled","disabled"),ea.setAttribute("disabled","disabled"),oa.setAttribute("disabled","disabled"),ka.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));fa.checked&&
+P.checked?W.getEditSelect().removeAttribute("disabled"):W.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,Y,mxUtils.bind(this,function(){Q(Da.getTarget(),Da.getColor(),null==H||0>=H.selectedIndex||null!=H.getAttribute("disabled")?null:this.pages[H.selectedIndex],P.checked,W.getLink(),X.checked,null!=la?la.value:null,null!=ua?ua.value:null,ea.checked,ja.value,null!=ha?ha.checked:!1,U.value,"allPages"==u.value,ea.checked&&oa.checked,ka.checked,ba.checked)}),null,mxResources.get("create"),
+x,A);this.showDialog(x.container,360,null,!0,!0);null!=la?(la.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?la.select():document.execCommand("selectAll",!1,null)):ja.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,q,x){var A=document.createElement("div");A.style.whiteSpace="nowrap";var E=document.createElement("h3");mxUtils.write(E,mxResources.get("image"));A.appendChild(E);if(x){E=document.createElement("div");E.className="geDialogSection";var K=document.createElement("div");
K.className="geDialogFormRow";var Q=document.createElement("span");Q.className="geDialogFormLabel";mxUtils.write(Q,mxResources.get("zoom")+":");K.appendChild(Q);var V=document.createElement("input");V.setAttribute("type","text");V.value=this.lastExportZoom||"100%";K.appendChild(V);E.appendChild(K);K=document.createElement("div");K.className="geDialogFormRow";Q=document.createElement("span");Q.className="geDialogFormLabel";mxUtils.write(Q,mxResources.get("borderWidth")+":");K.appendChild(Q);var J=
document.createElement("input");J.setAttribute("type","text");J.value=this.lastExportBorder||"0";K.appendChild(J);E.appendChild(K);A.appendChild(E)}E=document.createElement("div");E.className="geDialogSection";var ia=this.addCheckbox(E,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),Y=q?null:this.addCheckbox(E,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,null,
null,null,null,null,!0);K=this.editor.graph;var aa=K.background==mxConstants.NONE||null==K.background,ja=q?null:this.addCheckbox(E,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?this.lastExportTransparent:aa,null,null,null,null,null,!0);A.appendChild(E);c=new CustomDialog(this,A,mxUtils.bind(this,function(){this.lastExportSelectionOnly=ia.checked;x&&(this.lastExportZoom=V.value,this.lastExportBorder=J.value);null!=ja&&(this.lastExportTransparent=ja.checked==aa?null:ja.checked);
-var ka=parseInt(V.value)/100||1,ua=parseInt(J.value)||0;l(!ia.checked,null!=Y?Y.checked:!1,null!=ja?ja.checked:!1,ka,ua)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,l,q,x,A,E,K,Q){function V(){return Math.max(0,parseFloat(ka.value)||100)/100}function J(){var Oa=V();Ba.value=Math.floor(sa*Oa);ma.value=Math.floor(xa*Oa)}E=null!=E?E:Editor.defaultIncludeDiagram;var ia=document.createElement("div");ia.style.whiteSpace="nowrap";var Y=this.editor.graph,
-aa=document.createElement("h3");mxUtils.write(aa,c);ia.appendChild(aa);c=document.createElement("div");c.className="geDialogSection";aa=document.createElement("div");aa.className="geDialogFormRow";var ja=document.createElement("span");ja.className="geDialogFormLabel";mxUtils.write(ja,mxResources.get("zoom")+":");aa.appendChild(ja);var ka=document.createElement("input");ka.setAttribute("type","text");ka.value=this.lastExportZoom||"100%";aa.appendChild(ka);c.appendChild(aa);ia.appendChild(c);c=document.createElement("div");
+var la=parseInt(V.value)/100||1,ua=parseInt(J.value)||0;l(!ia.checked,null!=Y?Y.checked:!1,null!=ja?ja.checked:!1,la,ua)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,l,q,x,A,E,K,Q){function V(){return Math.max(0,parseFloat(la.value)||100)/100}function J(){var Oa=V();Ba.value=Math.floor(sa*Oa);ma.value=Math.floor(xa*Oa)}E=null!=E?E:Editor.defaultIncludeDiagram;var ia=document.createElement("div");ia.style.whiteSpace="nowrap";var Y=this.editor.graph,
+aa=document.createElement("h3");mxUtils.write(aa,c);ia.appendChild(aa);c=document.createElement("div");c.className="geDialogSection";aa=document.createElement("div");aa.className="geDialogFormRow";var ja=document.createElement("span");ja.className="geDialogFormLabel";mxUtils.write(ja,mxResources.get("zoom")+":");aa.appendChild(ja);var la=document.createElement("input");la.setAttribute("type","text");la.value=this.lastExportZoom||"100%";aa.appendChild(la);c.appendChild(aa);ia.appendChild(c);c=document.createElement("div");
c.className="geDialogSection";var ua=this.addCheckbox(c,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!Y.isSelectionEmpty(),Y.isSelectionEmpty(),null,null,null,null,!0),Da=document.createElement("input");Da.setAttribute("disabled","disabled");Da.setAttribute("type","checkbox");var ha=document.createElement("select");ha.style.marginLeft="8px";var k=["selectionOnly","diagram","page"];aa={};for(ja=0;ja<k.length;ja++)if(!Y.isSelectionEmpty()||"selectionOnly"!=k[ja]){var u=document.createElement("option");
mxUtils.write(u,mxResources.get(k[ja]));u.setAttribute("value",k[ja]);ha.appendChild(u);aa[k[ja]]=u}Q?(ja=document.createElement("div"),ja.className="geDialogFormRow",A=document.createElement("span"),A.className="geDialogFormLabel",mxUtils.write(A,mxResources.get("size")+":"),ja.appendChild(A),ha.style.marginLeft="0",ja.appendChild(ha),c.appendChild(ja),mxEvent.addListener(ha,"change",function(){"selectionOnly"==ha.value&&(ua.checked=!0)})):A&&(A=document.createElement("div"),A.className="geDialogCheckRow",
A.appendChild(Da),ja=document.createElement("label"),mxUtils.write(ja,mxResources.get("crop")),A.appendChild(ja),c.appendChild(A),mxEvent.addListener(ua,"change",function(){ua.checked?Da.removeAttribute("disabled"):Da.setAttribute("disabled","disabled")}));Y.isSelectionEmpty()?Q&&null!=ua.checkRow&&null!=ua.checkRow.parentNode&&ua.checkRow.parentNode.removeChild(ua.checkRow):(ha.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",Da.setAttribute("checked","checked"),Da.defaultChecked=!0,
-mxEvent.addListener(ua,"change",function(){ha.value=ua.checked?"selectionOnly":"diagram"}));var H=!Y.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";Q&&null!=this.lastExportType&&null!=aa[this.lastExportType]&&(ha.value=this.lastExportType,"selectionOnly"==this.lastExportType&&(ua.checked=!0));var P="jpeg"!=K&&"webp"!=K,T=this.addCheckbox(c,mxResources.get("transparentBackground"),P&&null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,P,null,null,!0);
+mxEvent.addListener(ua,"change",function(){ha.value=ua.checked?"selectionOnly":"diagram"}));var H=!Y.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";Q&&null!=this.lastExportType&&null!=aa[this.lastExportType]&&(ha.value=this.lastExportType,"selectionOnly"==this.lastExportType&&(ua.checked=!0));var P="jpeg"!=K&&"webp"!=K,U=this.addCheckbox(c,mxResources.get("transparentBackground"),P&&null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,P,null,null,!0);
ia.appendChild(c);c=document.createElement("div");c.className="geDialogSection";aa=!1;A=null!=this.pages?this.pages.length:1;var W=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<A?":":""),E,null,null,"jpeg"!=K&&"webp"!=K,null,null,!0);"jpeg"!=K&&"webp"!=K&&(aa=!0);var fa=document.createElement("select");fa.style.maxWidth="260px";if("png"==K||"svg"==K)E=function(){W.checked?fa.removeAttribute("disabled"):fa.setAttribute("disabled","disabled")},ja=document.createElement("option"),ja.setAttribute("value",
"allPages"),mxUtils.write(ja,mxResources.get("allPages")),fa.appendChild(ja),ja=document.createElement("option"),ja.setAttribute("value","currentPage"),mxUtils.write(ja,mxResources.get("currentPage")),fa.appendChild(ja),1<A&&(A=document.createElement("div"),A.style.paddingLeft="24px",A.appendChild(fa),c.appendChild(A)),null!=this.lastEmbedInclude&&(fa.value=this.lastEmbedInclude),mxEvent.addListener(W,"change",E),E();var X=document.createElement("input");X.setAttribute("type","checkbox");X.id="geCheckbox-"+
-Editor.guid();var ea=document.createElement("input");ea.setAttribute("type","checkbox");ea.id="geCheckbox-"+Editor.guid();var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.id="geCheckbox-"+Editor.guid();var la=document.createElement("input");la.setAttribute("type","checkbox");la.id="geCheckbox-"+Editor.guid();var ca=document.createElement("select");ca.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));
-ca.appendChild(E);E=document.createElement("option");E.setAttribute("value","blank");mxUtils.write(E,mxResources.get("openInNewWindow"));ca.appendChild(E);E=document.createElement("option");E.setAttribute("value","self");mxUtils.write(E,mxResources.get("openInThisWindow"));ca.appendChild(E);"svg"==K&&null!=this.lastExportLinkTarget&&(ca.value=this.lastExportLinkTarget,0>ca.selectedIndex&&(ca.value="auto"));A=document.createElement("div");mxUtils.write(A,mxResources.get("LinksLost"));A.style.margin=
+Editor.guid();var ea=document.createElement("input");ea.setAttribute("type","checkbox");ea.id="geCheckbox-"+Editor.guid();var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.id="geCheckbox-"+Editor.guid();var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.id="geCheckbox-"+Editor.guid();var ba=document.createElement("select");ba.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));
+ba.appendChild(E);E=document.createElement("option");E.setAttribute("value","blank");mxUtils.write(E,mxResources.get("openInNewWindow"));ba.appendChild(E);E=document.createElement("option");E.setAttribute("value","self");mxUtils.write(E,mxResources.get("openInThisWindow"));ba.appendChild(E);"svg"==K&&null!=this.lastExportLinkTarget&&(ba.value=this.lastExportLinkTarget,0>ba.selectedIndex&&(ba.value="auto"));A=document.createElement("div");mxUtils.write(A,mxResources.get("LinksLost"));A.style.margin=
"7px";A.style.display="none";aa&&ia.appendChild(c);E=this.addAdvancedSection(ia).content;c=Y.getGraphBounds();aa=Y.view.scale;var sa=Math.max(1,Math.ceil(c.width/aa)),xa=Math.max(1,Math.ceil(c.height/aa)),qa=!1;ja=document.createElement("div");ja.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";aa=document.createElement("label");mxUtils.write(aa,mxResources.get("width")+":");c.appendChild(aa);var Ba=document.createElement("input");Ba.setAttribute("type",
-"number");Ba.value=Math.floor(sa*V());c.appendChild(Ba);ja.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";aa=document.createElement("label");mxUtils.write(aa,mxResources.get("height")+":");c.appendChild(aa);var ma=document.createElement("input");ma.setAttribute("type","number");ma.value=Math.floor(xa*V());c.appendChild(ma);ja.appendChild(c);E.appendChild(ja);mxEvent.addListener(ka,"change",function(){qa=!0;ka.value=parseFloat((100*V()).toFixed(2))+"%";J()});mxEvent.addListener(Ba,
-"change",function(){var Oa=parseInt(Ba.value)/sa;0<Oa&&(ka.value=parseFloat((100*Oa).toFixed(2))+"%",ma.value=Math.floor(xa*Oa))});mxEvent.addListener(ma,"change",function(){var Oa=parseInt(ma.value)/xa;0<Oa&&(ka.value=parseFloat((100*Oa).toFixed(2))+"%",Ba.value=Math.floor(sa*Oa))});var ta=document.createElement("select"),va=document.createElement("input");if("png"==K){c=["100","200","300","400"];for(ja=0;ja<c.length;ja++)aa=document.createElement("option"),aa.setAttribute("value",c[ja]),mxUtils.write(aa,
+"number");Ba.value=Math.floor(sa*V());c.appendChild(Ba);ja.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";aa=document.createElement("label");mxUtils.write(aa,mxResources.get("height")+":");c.appendChild(aa);var ma=document.createElement("input");ma.setAttribute("type","number");ma.value=Math.floor(xa*V());c.appendChild(ma);ja.appendChild(c);E.appendChild(ja);mxEvent.addListener(la,"change",function(){qa=!0;la.value=parseFloat((100*V()).toFixed(2))+"%";J()});mxEvent.addListener(Ba,
+"change",function(){var Oa=parseInt(Ba.value)/sa;0<Oa&&(la.value=parseFloat((100*Oa).toFixed(2))+"%",ma.value=Math.floor(xa*Oa))});mxEvent.addListener(ma,"change",function(){var Oa=parseInt(ma.value)/xa;0<Oa&&(la.value=parseFloat((100*Oa).toFixed(2))+"%",Ba.value=Math.floor(sa*Oa))});var ta=document.createElement("select"),va=document.createElement("input");if("png"==K){c=["100","200","300","400"];for(ja=0;ja<c.length;ja++)aa=document.createElement("option"),aa.setAttribute("value",c[ja]),mxUtils.write(aa,
c[ja]+"dpi"),ta.appendChild(aa);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom"));ta.appendChild(c);va.setAttribute("type","number");va.setAttribute("value","100");va.setAttribute("min","50");va.setAttribute("step","50");va.style.display="none";c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("dpi")+":");c.appendChild(aa);c.appendChild(ta);
-c.appendChild(va);E.appendChild(c);null!=this.lastExportDpi&&(va.value=this.lastExportDpi,ta.value=this.lastExportDpi,0>ta.selectedIndex&&(ta.value="custom",ta.style.display="none",va.style.display=""));mxEvent.addListener(ta,"change",function(){"custom"==ta.value?(ta.style.display="none",va.style.display="",va.focus()):(va.value=ta.value,qa||(ka.value=ta.value+"%",J()))});mxEvent.addListener(va,"change",function(){var Oa=parseInt(va.value);isNaN(Oa)||0>=Oa?va.style.backgroundColor="red":(va.style.backgroundColor=
-"",qa||(ka.value=Oa+"%",J()))})}c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("borderWidth")+":");c.appendChild(aa);var Ha=document.createElement("input");Ha.setAttribute("type","text");Ha.value=this.lastExportBorder||"0";c.appendChild(Ha);E.appendChild(c);var La=document.createElement("select");La.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value","light");
+c.appendChild(va);E.appendChild(c);null!=this.lastExportDpi&&(va.value=this.lastExportDpi,ta.value=this.lastExportDpi,0>ta.selectedIndex&&(ta.value="custom",ta.style.display="none",va.style.display=""));mxEvent.addListener(ta,"change",function(){"custom"==ta.value?(ta.style.display="none",va.style.display="",va.focus()):(va.value=ta.value,qa||(la.value=ta.value+"%",J()))});mxEvent.addListener(va,"change",function(){var Oa=parseInt(va.value);isNaN(Oa)||0>=Oa?va.style.backgroundColor="red":(va.style.backgroundColor=
+"",qa||(la.value=Oa+"%",J()))})}c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("borderWidth")+":");c.appendChild(aa);var Ga=document.createElement("input");Ga.setAttribute("type","text");Ga.value=this.lastExportBorder||"0";c.appendChild(Ga);E.appendChild(c);var La=document.createElement("select");La.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value","light");
mxUtils.write(c,mxResources.get("light"));La.appendChild(c);c=document.createElement("option");c.setAttribute("value","dark");mxUtils.write(c,mxResources.get("dark"));La.appendChild(c);var Ia=Editor.isDarkMode()?"dark":"light";"svg"==K&&mxUtils.lightDarkColorSupported&&(c=document.createElement("option"),c.setAttribute("value","auto"),mxUtils.write(c,mxResources.get("automatic")),La.appendChild(c),Ia="auto");La.value=null!=this.lastExportTheme?this.lastExportTheme:Ia;0>La.selectedIndex&&(La.value=
-Ia);c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("appearance")+":");c.appendChild(aa);c.appendChild(La);E.appendChild(c);"svg"==K&&(c=document.createElement("div"),c.className="geDialogFormRow",aa=document.createElement("span"),aa.className="geDialogFormLabel",mxUtils.write(aa,mxResources.get("links")+":"),c.appendChild(aa),c.appendChild(ca),E.appendChild(c),E.appendChild(A));var Ca=
+Ia);c=document.createElement("div");c.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("appearance")+":");c.appendChild(aa);c.appendChild(La);E.appendChild(c);"svg"==K&&(c=document.createElement("div"),c.className="geDialogFormRow",aa=document.createElement("span"),aa.className="geDialogFormLabel",mxUtils.write(aa,mxResources.get("links")+":"),c.appendChild(aa),c.appendChild(ba),E.appendChild(c),E.appendChild(A));var Ca=
1==Y.shadowVisible,Pa=this.addCheckbox(E,mxResources.get("shadow"),null!=this.lastExportShadow?this.lastExportShadow:Ca,null,null,null,null,null,!0),Ka=null,Na="svg"!=K&&(this.isOffline()||!Editor.canvasSupported);if("png"==K||"jpeg"==K||"webp"==K||"svg"==K)Ka=this.addCheckbox(E,mxResources.get("grid"),Na||null==this.lastExportGrid?!1:this.lastExportGrid,Na,!1,!0,null,null,!0);f&&(X.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,A=document.createElement("div"),A.className="geDialogCheckRow",
A.appendChild(X),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("embedImages")),Y.setAttribute("for",X.id),A.appendChild(Y),E.appendChild(A),ea.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(ea),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("embedFonts")),Y.setAttribute("for",ea.id),A.appendChild(Y),E.appendChild(A),oa.checked=null!=this.lastEmbedCellMetadata?
-this.lastEmbedCellMetadata:!1,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(oa),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("embedCellMetadata")),Y.setAttribute("for",oa.id),A.appendChild(Y),E.appendChild(A),la.checked=null!=this.lastEmbedIcons?this.lastEmbedIcons:!1,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(la),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("icons")),Y.setAttribute("for",la.id),
-A.appendChild(Y),E.appendChild(A));l=new CustomDialog(this,ia,mxUtils.bind(this,function(){this.lastExportSelectionOnly=ua.checked;this.lastExportBorder=Ha.value;this.lastExportZoom=ka.value;P&&(this.lastExportTransparent=0==T.checked?null:T.checked);this.lastExportTheme=La.value==Ia?null:La.value;this.lastExportShadow=Pa.checked==Ca?null:Pa.checked;null==Ka||Na||(this.lastExportGrid=Ka.checked?!0:null);"svg"==K&&(this.lastExportLinkTarget="auto"==ca.value?null:ca.value);if("png"==K){var Oa=parseInt(va.value);
-this.lastExportDpi=!isNaN(Oa)&&0<Oa&&100!=Oa?Oa:null}Q&&(this.lastExportType=ha.value==H?null:ha.value);f&&(this.lastEmbedImages=X.checked,this.lastEmbedFonts=ea.checked,this.lastEmbedCellMetadata=oa.checked,this.lastEmbedIcons=la.checked);if("png"==K||"svg"==K)this.lastEmbedInclude=fa.value;null!=x&&x(ka.value,T.checked,!ua.checked,Pa.checked,W.checked,X.checked&&f,Ha.value,Da.checked,("png"==K||"svg"==K)&&"currentPage"==fa.value,ca.value,null!=Ka?Ka.checked:null,null!=La?La.value:null,ha.value,
-ea.checked,oa.checked&&f,"png"==K&&0<parseInt(va.value)&&100!=parseInt(va.value)?parseInt(va.value):null,la.checked&&f)}),null,l,q);this.showDialog(l.container,360,null,!0,!0,null,null,null,null,!0);ka.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ka.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,q,x,A,E){var K=document.createElement("div"),Q=this.editor.graph;if(null!=f){var V=document.createElement("h3");mxUtils.write(V,
-f);K.appendChild(V)}f=document.createElement("div");f.className="geDialogSection";var J=E?this.addPagesRow(f):null,ia=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),Y=this.addCheckbox(f,mxResources.get("shadow"),Q.shadowVisible&&q,!q,null,null,null,null,!0),aa=this.addCheckbox(f,l,!1,null,null,null,null,null,!0),ja=this.addCheckbox(f,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);K.appendChild(f);l=this.addAdvancedSection(K).content;var ka=null;A&&(ka=document.createElement("select"),
-ka.style.maxWidth="260px",A=document.createElement("option"),A.setAttribute("value","light"),mxUtils.write(A,mxResources.get("light")),ka.appendChild(A),A=document.createElement("option"),A.setAttribute("value","dark"),mxUtils.write(A,mxResources.get("dark")),ka.appendChild(A),mxUtils.lightDarkColorSupported?(A=document.createElement("option"),A.setAttribute("value","auto"),mxUtils.write(A,mxResources.get("automatic")),ka.appendChild(A),ka.value="auto"):ka.value=Editor.isDarkMode()?"dark":"light",
-A=document.createElement("div"),A.className="geDialogFormRow",q=document.createElement("span"),q.className="geDialogFormLabel",mxUtils.write(q,mxResources.get("appearance")+":"),A.appendChild(q),A.appendChild(ka),l.appendChild(A));var ua=this.addEditButton(l,ja),Da=ua.getEditInput(),ha=1<Q.model.getChildCount(Q.model.getRoot()),k=this.addCheckbox(l,mxResources.get("layers"),ha,!ha,null,null,null,null,!0),u=this.addCheckbox(l,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),H=this.addCheckbox(l,
+this.lastEmbedCellMetadata:!1,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(oa),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("embedCellMetadata")),Y.setAttribute("for",oa.id),A.appendChild(Y),E.appendChild(A),ka.checked=null!=this.lastEmbedIcons?this.lastEmbedIcons:!1,A=document.createElement("div"),A.className="geDialogCheckRow",A.appendChild(ka),Y=document.createElement("label"),mxUtils.write(Y,mxResources.get("icons")),Y.setAttribute("for",ka.id),
+A.appendChild(Y),E.appendChild(A));l=new CustomDialog(this,ia,mxUtils.bind(this,function(){this.lastExportSelectionOnly=ua.checked;this.lastExportBorder=Ga.value;this.lastExportZoom=la.value;P&&(this.lastExportTransparent=0==U.checked?null:U.checked);this.lastExportTheme=La.value==Ia?null:La.value;this.lastExportShadow=Pa.checked==Ca?null:Pa.checked;null==Ka||Na||(this.lastExportGrid=Ka.checked?!0:null);"svg"==K&&(this.lastExportLinkTarget="auto"==ba.value?null:ba.value);if("png"==K){var Oa=parseInt(va.value);
+this.lastExportDpi=!isNaN(Oa)&&0<Oa&&100!=Oa?Oa:null}Q&&(this.lastExportType=ha.value==H?null:ha.value);f&&(this.lastEmbedImages=X.checked,this.lastEmbedFonts=ea.checked,this.lastEmbedCellMetadata=oa.checked,this.lastEmbedIcons=ka.checked);if("png"==K||"svg"==K)this.lastEmbedInclude=fa.value;null!=x&&x(la.value,U.checked,!ua.checked,Pa.checked,W.checked,X.checked&&f,Ga.value,Da.checked,("png"==K||"svg"==K)&&"currentPage"==fa.value,ba.value,null!=Ka?Ka.checked:null,null!=La?La.value:null,ha.value,
+ea.checked,oa.checked&&f,"png"==K&&0<parseInt(va.value)&&100!=parseInt(va.value)?parseInt(va.value):null,ka.checked&&f)}),null,l,q);this.showDialog(l.container,360,null,!0,!0,null,null,null,null,!0);la.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?la.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,q,x,A,E){var K=document.createElement("div"),Q=this.editor.graph;if(null!=f){var V=document.createElement("h3");mxUtils.write(V,
+f);K.appendChild(V)}f=document.createElement("div");f.className="geDialogSection";var J=E?this.addPagesRow(f):null,ia=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),Y=this.addCheckbox(f,mxResources.get("shadow"),Q.shadowVisible&&q,!q,null,null,null,null,!0),aa=this.addCheckbox(f,l,!1,null,null,null,null,null,!0),ja=this.addCheckbox(f,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);K.appendChild(f);l=this.addAdvancedSection(K).content;var la=null;A&&(la=document.createElement("select"),
+la.style.maxWidth="260px",A=document.createElement("option"),A.setAttribute("value","light"),mxUtils.write(A,mxResources.get("light")),la.appendChild(A),A=document.createElement("option"),A.setAttribute("value","dark"),mxUtils.write(A,mxResources.get("dark")),la.appendChild(A),mxUtils.lightDarkColorSupported?(A=document.createElement("option"),A.setAttribute("value","auto"),mxUtils.write(A,mxResources.get("automatic")),la.appendChild(A),la.value="auto"):la.value=Editor.isDarkMode()?"dark":"light",
+A=document.createElement("div"),A.className="geDialogFormRow",q=document.createElement("span"),q.className="geDialogFormLabel",mxUtils.write(q,mxResources.get("appearance")+":"),A.appendChild(q),A.appendChild(la),l.appendChild(A));var ua=this.addEditButton(l,ja),Da=ua.getEditInput(),ha=1<Q.model.getChildCount(Q.model.getRoot()),k=this.addCheckbox(l,mxResources.get("layers"),ha,!ha,null,null,null,null,!0),u=this.addCheckbox(l,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),H=this.addCheckbox(l,
mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ja,"change",function(){ja.checked?(ha&&k.removeAttribute("disabled"),null!=J&&J.select.removeAttribute("disabled"),Da.removeAttribute("disabled"),u.removeAttribute("disabled"),H.removeAttribute("disabled")):(null!=J&&J.select.setAttribute("disabled","disabled"),k.setAttribute("disabled","disabled"),Da.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));Da.checked&&
-ja.checked?ua.getEditSelect().removeAttribute("disabled"):ua.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,K,mxUtils.bind(this,function(){c(ia.checked,Y.checked,aa.checked,ja.checked,ua.getLink(),k.checked,u.checked,H.checked,null!=ka?ka.value:null,null!=J?null!=J.row&&"allPages"==J.select.value:null)}),null,mxResources.get("embed"),x);this.showDialog(x.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,q,x,A,E,K,Q,V){function J(ka){var ua=
+ja.checked?ua.getEditSelect().removeAttribute("disabled"):ua.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,K,mxUtils.bind(this,function(){c(ia.checked,Y.checked,aa.checked,ja.checked,ua.getLink(),k.checked,u.checked,H.checked,null!=la?la.value:null,null!=J?null!=J.row&&"allPages"==J.select.value:null)}),null,mxResources.get("embed"),x);this.showDialog(x.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,q,x,A,E,K,Q,V){function J(la){var ua=
" ",Da="";q&&(ua=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(null!=Y?"&page="+Y:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+(E?"&link-icons=1":"")+(K?"&tooltip-icons=1":"")+"');}})(this);\"",
-Da+="cursor:pointer;");c&&(Da+="max-width:100%;");var ha="";l&&(ha=' width="'+Math.round(ia.width)+'" height="'+Math.round(ia.height)+'"');Q('<img src="'+ka+'"'+ha+(""!=Da?' style="'+Da+'"':"")+ua+"/>")}var ia=this.editor.graph.getGraphBounds(),Y=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ka){var ua=q?this.getFileData(!0):null;ka=this.createImageDataUri(ka,ua,"png");J(ka)}),null,null,null,mxUtils.bind(this,function(ka){V({message:mxResources.get("unknownError")})}),
+Da+="cursor:pointer;");c&&(Da+="max-width:100%;");var ha="";l&&(ha=' width="'+Math.round(ia.width)+'" height="'+Math.round(ia.height)+'"');Q('<img src="'+la+'"'+ha+(""!=Da?' style="'+Da+'"':"")+ua+"/>")}var ia=this.editor.graph.getGraphBounds(),Y=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(la){var ua=q?this.getFileData(!0):null;la=this.createImageDataUri(la,ua,"png");J(la)}),null,null,null,mxUtils.bind(this,function(la){V({message:mxResources.get("unknownError")})}),
null,!0,l?2:1,null,f,null,null,Editor.defaultBorder);else if(this.isRemoteExportEnabled())if(f=this.getFileData(!0),ia.width*ia.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var aa="";l&&(aa="&w="+Math.round(2*ia.width)+"&h="+Math.round(2*ia.height));var ja=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(q?"1":"0")+aa+"&xml="+encodeURIComponent(f));ja.send(mxUtils.bind(this,function(){200<=ja.getStatus()&&299>=ja.getStatus()?J("data:image/png;base64,"+ja.getText()):V({message:mxResources.get("unknownError")})}))}else V({message:mxResources.get("drawingTooLarge")});
else V({message:mxResources.get("notAvailable")})};EditorUi.prototype.createEmbedSvg=function(c,f,l,q,x,A,E,K,Q,V,J){Q=null!=Q?Q:"auto";V=null!=V?V:!0;var ia=this.getSelectedPageIndex(),Y=mxUtils.lightDarkColorSupported,aa=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var ja=null;try{ja=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,Q)}finally{mxUtils.lightDarkColorSupported=Y,mxUtils.preferDarkColor=
-aa}Q=ja.getElementsByTagName("a");if(null!=Q)for(Y=0;Y<Q.length;Y++)aa=Q[Y].getAttribute("href"),null!=aa&&"#"==aa.charAt(0)&&"_blank"==Q[Y].getAttribute("target")&&Q[Y].removeAttribute("target");q&&ja.setAttribute("content",this.getFileData(!0,null,null,null,null,!V));f&&this.editor.graph.addSvgShadow(ja);if(l){var ka=" ",ua="";q&&(ka="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
-EditorUi.lightboxHost+"/?client=1"+(V&&null!=ia?"&page="+ia:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+(E?"&link-icons=1":"")+(K?"&tooltip-icons=1":"")+"');}})(this);\"",ua+="cursor:pointer;");c&&(ua+="max-width:100%;");this.editor.convertImages(ja,mxUtils.bind(this,function(Da){J('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(Da))+'"'+(""!=ua?' style="'+ua+'"':"")+ka+"/>")}))}else ua="",q&&(ja.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+
+aa}Q=ja.getElementsByTagName("a");if(null!=Q)for(Y=0;Y<Q.length;Y++)aa=Q[Y].getAttribute("href"),null!=aa&&"#"==aa.charAt(0)&&"_blank"==Q[Y].getAttribute("target")&&Q[Y].removeAttribute("target");q&&ja.setAttribute("content",this.getFileData(!0,null,null,null,null,!V));f&&this.editor.graph.addSvgShadow(ja);if(l){var la=" ",ua="";q&&(la="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
+EditorUi.lightboxHost+"/?client=1"+(V&&null!=ia?"&page="+ia:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+(E?"&link-icons=1":"")+(K?"&tooltip-icons=1":"")+"');}})(this);\"",ua+="cursor:pointer;");c&&(ua+="max-width:100%;");this.editor.convertImages(ja,mxUtils.bind(this,function(Da){J('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(Da))+'"'+(""!=ua?' style="'+ua+'"':"")+la+"/>")}))}else ua="",q&&(ja.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+
EditorUi.lightboxHost+"/?client=1"+(V&&null!=ia?"&page="+ia:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+(E?"&link-icons=1":"")+(K?"&tooltip-icons=1":"")+"');}}})(this);"),ua+="cursor:pointer;"),c&&(c=parseInt(ja.getAttribute("width")),f=parseInt(ja.getAttribute("height")),ja.setAttribute("viewBox","-0.5 -0.5 "+c+" "+f),ua+="max-width:100%;max-height:"+f+"px;",ja.removeAttribute("height")),""!=ua&&(c=ja.getAttribute("style"),ja.setAttribute("style",(null!=c&&0<c.length?c+" ":"")+ua)),this.editor.addFontCss(ja),
this.editor.graph.mathEnabled&&this.editor.addMathCss(ja),J(mxUtils.getXml(ja))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+
mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var l=null;if("diagram"==c.nodeName)l=c;else if("mxfile"==c.nodeName){var q=c.getElementsByTagName("diagram");if(0<q.length){l=q[0];var x=f.getGlobalVariable;f.getGlobalVariable=function(A){return"page"==A?l.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==A?1:x.apply(this,arguments)}}}null!=l&&(c=Editor.parseDiagramNode(l))}q=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(A){}finally{this.editor.graph=
@@ -4427,23 +4429,23 @@ q}return c};EditorUi.prototype.getSvgFileProperties=function(c){var f=this.getPn
function(c){return{notes:null!=c&&"true"==c.getAttribute("notes")}};EditorUi.prototype.getEmbeddedPng=function(c,f,l,q,x){try{var A=this.editor.graph,E=null;if(null!=l&&0<l.length)A=this.createTemporaryGraph(A.getStylesheet()),document.body.appendChild(A.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,!0),A),E=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){A=this.createTemporaryGraph(A.getStylesheet());var K=A.getGlobalVariable;A.setBackgroundImage=
this.editor.graph.setBackgroundImage;var Q=this.pages[0];this.currentPage==Q?A.setBackgroundImage(this.editor.graph.backgroundImage):null!=Q.viewState&&null!=Q.viewState&&A.setBackgroundImage(Q.viewState.backgroundImage);A.getGlobalVariable=function(V){return"page"==V?Q.getName():"pagenumber"==V?1:K.apply(this,arguments)};document.body.appendChild(A.container);A.model.setRoot(Q.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{null==E&&(E=this.getFileData(!0,null,null,null,null,null,
null,null,null,!1));var J=V.toDataURL("image/png");J=Editor.writeGraphModelToPng(J,"tEXt","mxfile",encodeURIComponent(E));c(J.substring(J.lastIndexOf(",")+1));A!=this.editor.graph&&A.container.parentNode.removeChild(A.container)}catch(ia){null!=f&&f(ia)}}),null,null,null,mxUtils.bind(this,function(V){null!=f&&f(V)}),null,null,q,null,A.shadowVisible,null,A,x,null,null,null,"diagram",null)}catch(V){null!=f&&f(V)}};EditorUi.prototype.getSvgWithFontLookup=function(c,f,l){var q=Graph.addFont;Graph.addFont=
-function(A,E,K,Q){q.call(this,A,E,K,c)};var x=f.drawCellState;f.drawCellState=function(A,E){null!=A&&Graph.processFontStyle(A.style);x.apply(this,arguments)};try{return l()}finally{Graph.addFont=q}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja){K=null!=K?K:!0;J=null!=J?J:0;var ka=null!=Q?Q:f.background;ka==mxConstants.NONE&&(ka=null);null==ka&&"none"==f.getAdaptiveColors()&&(ka="#ffffff");var ua=this.editor.graph.createSvgImageExport(null!=c,aa);E=Object.create(null);
-Q=this.getSvgWithFontLookup(E,ua,function(){return f.getSvg(ka,V,J,null,null,A,null,ua,null,f.shadowVisible||ia,null,Y,"diagram")});(f.shadowVisible||ia)&&f.addSvgShadow(Q,null,null,0==J);null!=c&&Q.setAttribute("content",c);null!=l&&Q.setAttribute("resource",l);var Da=mxUtils.bind(this,function(u){u=(q?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(u);null!=x&&x(u);return u});f.mathEnabled&&this.editor.addMathCss(Q);if(null!=x)this.embedFonts(Q,mxUtils.bind(this,
+function(A,E,K,Q){q.call(this,A,E,K,c)};var x=f.drawCellState;f.drawCellState=function(A,E){null!=A&&Graph.processFontStyle(A.style);x.apply(this,arguments)};try{return l()}finally{Graph.addFont=q}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja){K=null!=K?K:!0;J=null!=J?J:0;var la=null!=Q?Q:f.background;la==mxConstants.NONE&&(la=null);null==la&&"none"==f.getAdaptiveColors()&&(la="#ffffff");var ua=this.editor.graph.createSvgImageExport(null!=c,aa);E=Object.create(null);
+Q=this.getSvgWithFontLookup(E,ua,function(){return f.getSvg(la,V,J,null,null,A,null,ua,null,f.shadowVisible||ia,null,Y,"diagram")});(f.shadowVisible||ia)&&f.addSvgShadow(Q,null,null,0==J);null!=c&&Q.setAttribute("content",c);null!=l&&Q.setAttribute("resource",l);var Da=mxUtils.bind(this,function(u){u=(q?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(u);null!=x&&x(u);return u});f.mathEnabled&&this.editor.addMathCss(Q);if(null!=x)this.embedFonts(Q,mxUtils.bind(this,
function(u){K?this.editor.convertImages(u,mxUtils.bind(this,function(H){Da(H)})):Da(u)}),ja,E);else{var ha=!1;this.embedFonts(Q,function(){ha=!0},ja,E);if(!ha)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(Q);var k=this.editor.graph.getExtFontCss(E);0<k.length&&this.editor.addFontCss(Q,k)}catch(u){}return Da(Q)}};EditorUi.prototype.embedFonts=function(c,f,l,q){if(l=null!=l?l:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&
this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(A){try{null!=A&&this.editor.addFontCss(c,A),f(c)}catch(E){f(c)}}),q)}catch(A){f(c)}}));else{try{this.editor.addFontCss(c);var x=this.editor.graph.getExtFontCss(q);0<x.length&&this.editor.addFontCss(c,x)}catch(A){}f(c)}};EditorUi.prototype.exportImage=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){Q=null!=Q?Q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ja){Editor.addRetryToError(ja,
-mxUtils.bind(this,function(){this.exportImage(c,f,l,q,x,A,E,K,Q,V,J,ia,Y)}));this.handleError(ja)}))){var aa=this.editor.graph.isSelectionEmpty();l=null!=l?l:aa;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ja){this.spinner.stop();try{this.saveCanvas(ja,x?this.getFileData(!0,null,null,null,l,K,null,null,null,null,null,c,A):null,Q,null==this.pages||0==this.pages.length,J)}catch(ka){this.handleError(ka)}}),null,this.thumbImageCache,null,
+mxUtils.bind(this,function(){this.exportImage(c,f,l,q,x,A,E,K,Q,V,J,ia,Y)}));this.handleError(ja)}))){var aa=this.editor.graph.isSelectionEmpty();l=null!=l?l:aa;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ja){this.spinner.stop();try{this.saveCanvas(ja,x?this.getFileData(!0,null,null,null,l,K,null,null,null,null,null,c,A):null,Q,null==this.pages||0==this.pages.length,J)}catch(la){this.handleError(la)}}),null,this.thumbImageCache,null,
mxUtils.bind(this,function(ja){this.spinner.stop();this.handleError(ja)}),null,l,c||1,f,q,null,null,A,E,V,ia,Y)}catch(ja){this.spinner.stop(),this.handleError(ja)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,l,q,x,A,E){EditorUi.debug("EditorUi.importXml",
[this],"xml",[c],"dx",[f],"dy",[l],"crop",[q],"noErrorHandling",[x],"addNewPage",[A],"applyDefaultStyles",[E]);f=null!=f?f:0;l=null!=l?l:0;var K=[];try{if(null!=c&&0<c.length){var Q=null!=this.pages?this.pages.length:0,V=this.isDiagramEmpty(),J=this.currentPage,ia=this.editor.graph;ia.model.beginUpdate();try{var Y=mxUtils.parseXml(c);c={};var aa=this.editor.extractGraphModel(Y.documentElement,null!=this.pages);if(null!=aa&&"mxfile"==aa.nodeName&&null!=this.pages){var ja=aa.getElementsByTagName("diagram");
-if(0<ja.length){Y=[];var ka=0;if(1==ja.length&&!A){if(null!=this.currentPage&&(c[ja[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ua=ja[0].getAttribute("name");null!=ua&&""!=ua&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ua))}aa=Editor.parseDiagramNode(ja[0]);q=!1;ka=1}for(;ka<ja.length;ka++){var Da=ja[ka].getAttribute("id");ja[ka].removeAttribute("id");var ha=this.updatePageRoot(new DiagramPage(ja[ka]));c[Da]=ja[ka].getAttribute("id");var k=this.pages.length;
-null==ha.getName()&&ha.setName(mxResources.get("pageWithNumber",[k+1]));ia.model.execute(new ChangePage(this,ha,ha,k,0<ka));Y.push(ha)}this.updatePageLinks(c,Y)}}if(null!=aa&&"mxGraphModel"===aa.nodeName){K=ia.importGraphModel(aa,f,l,q);if(null!=K)for(this.addLocalPagesToMapping(c),ka=0;ka<K.length;ka++)this.updatePageLinksForCell(c,K[ka]);var u=ia.parseBackgroundImage(aa.getAttribute("backgroundImage"));if(null!=u&&null!=u.originalSrc&&this.updateBackgroundPageLink(c,u)){var H=new ChangePageSetup(this,
+if(0<ja.length){Y=[];var la=0;if(1==ja.length&&!A){if(null!=this.currentPage&&(c[ja[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ua=ja[0].getAttribute("name");null!=ua&&""!=ua&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ua))}aa=Editor.parseDiagramNode(ja[0]);q=!1;la=1}for(;la<ja.length;la++){var Da=ja[la].getAttribute("id");ja[la].removeAttribute("id");var ha=this.updatePageRoot(new DiagramPage(ja[la]));c[Da]=ja[la].getAttribute("id");var k=this.pages.length;
+null==ha.getName()&&ha.setName(mxResources.get("pageWithNumber",[k+1]));ia.model.execute(new ChangePage(this,ha,ha,k,0<la));Y.push(ha)}this.updatePageLinks(c,Y)}}if(null!=aa&&"mxGraphModel"===aa.nodeName){K=ia.importGraphModel(aa,f,l,q);if(null!=K)for(this.addLocalPagesToMapping(c),la=0;la<K.length;la++)this.updatePageLinksForCell(c,K[la]);var u=ia.parseBackgroundImage(aa.getAttribute("backgroundImage"));if(null!=u&&null!=u.originalSrc&&this.updateBackgroundPageLink(c,u)){var H=new ChangePageSetup(this,
null,u);H.ignoreColor=!0;ia.model.execute(H)}}E&&ia.pasteCellStyles(ia.includeDescendants(K),ia.defaultVertexStyle,ia.defaultEdgeStyle);!A&&J!=this.currentPage&&null!=this.pages&&1<this.pages.length&&V&&1==Q&&this.removePage(J)}finally{ia.model.endUpdate()}}}catch(P){if(x)throw P;this.handleError(P)}return K};EditorUi.prototype.updatePageLinks=function(c,f){for(var l=0;l<f.length;l++)this.updatePageLinksForCell(c,f[l].root),f[l]!=this.currentPage&&(f[l].needsUpdate=!0),null!=f[l].viewState&&this.updateBackgroundPageLink(c,
f[l].viewState.backgroundImage)&&(f[l]==this.currentPage&&this.editor.graph.setViewState(f[l].viewState,!0),f[l].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var l=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var q=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=q&&(f.originalSrc="data:page/id,"+q,l=!0)}}catch(x){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,f){var l=document.createElement("div"),q=this.editor.graph,x=q.getLinkForCell(f);
null!=x&&q.setLinkForCell(f,this.updatePageLink(c,x));if(q.isHtmlLabel(f)){l.innerHTML=Graph.sanitizeHtml(q.getLabel(f));for(var A=l.getElementsByTagName("a"),E=!1,K=0;K<A.length;K++)x=A[K].getAttribute("href"),null!=x&&(A[K].setAttribute("href",this.updatePageLink(c,x)),E=!0);E&&q.labelChanged(f,l.innerHTML)}for(K=0;K<q.model.getChildCount(f);K++)this.updatePageLinksForCell(c,q.model.getChildAt(f,K))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var l=c[f.substring(f.indexOf(",")+
1)];f=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==f.substring(0,17))try{var q=JSON.parse(f.substring(17));if(null!=q.actions){for(var x=0;x<q.actions.length;x++){var A=q.actions[x];if(null!=A.open&&Graph.isPageLink(A.open)){var E=A.open.substring(A.open.indexOf(",")+1);l=c[E];null!=l?A.open="data:page/id,"+l:null==this.getPageById(E)&&delete A.open}}f="data:action/json,"+JSON.stringify(q)}}catch(K){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||
/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,l,q,x){var A=mxUtils.bind(this,function(E){this.loadingExtensions=!1;null!=l?l(E):this.handleError(E)});this.createTimeout(null,mxUtils.bind(this,function(E){q=null!=q?q:c.name;var K=mxUtils.bind(this,function(V){E.clear()&&A(V)}),Q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var V=this.isRemoteVisioFormat(q);try{var J=q.lastIndexOf(".");if(0<=J&&J<q.length)q.substring(J+1).toUpperCase();else{var ia=
q.lastIndexOf("/");0<=ia&&ia<q.length&&(q=q.substring(ia+1))}}catch(aa){}if(V)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(q)?K({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):K({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{V=new FormData;V.append("file1",c,q);var Y=new XMLHttpRequest;Y.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(q)?"?stencil=1":""));Y.responseType="blob";
-this.addRemoteServiceSecurityCheck(Y);null!=x&&Y.setRequestHeader("x-convert-custom",x);Y.onreadystatechange=mxUtils.bind(this,function(){if(4==Y.readyState&&E.clear())if(200<=Y.status&&299>=Y.status)try{var aa=Y.response;if("text/xml"==aa.type){var ja=new FileReader;ja.onload=mxUtils.bind(this,function(ka){try{f(ka.target.result)}catch(ua){K({message:mxResources.get("errorLoadingFile")})}});ja.readAsText(aa)}else this.doImportVisio(aa,f,K,q)}catch(ka){K(ka)}else try{""==Y.responseType||"text"==Y.responseType?
-K({message:Y.responseText}):(ja=new FileReader,ja.onload=function(){try{K({message:JSON.parse(ja.result).Message})}catch(ka){null!=ja.result&&0<ja.result.length?K({message:ja.result}):K(ka)}},ja.readAsText(Y.response))}catch(ka){K({})}});Y.send(V)}else if(E.clear())try{this.doImportVisio(c,f,K,q)}catch(aa){K(aa)}}else K({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?Q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+
+this.addRemoteServiceSecurityCheck(Y);null!=x&&Y.setRequestHeader("x-convert-custom",x);Y.onreadystatechange=mxUtils.bind(this,function(){if(4==Y.readyState&&E.clear())if(200<=Y.status&&299>=Y.status)try{var aa=Y.response;if("text/xml"==aa.type){var ja=new FileReader;ja.onload=mxUtils.bind(this,function(la){try{f(la.target.result)}catch(ua){K({message:mxResources.get("errorLoadingFile")})}});ja.readAsText(aa)}else this.doImportVisio(aa,f,K,q)}catch(la){K(la)}else try{""==Y.responseType||"text"==Y.responseType?
+K({message:Y.responseText}):(ja=new FileReader,ja.onload=function(){try{K({message:JSON.parse(ja.result).Message})}catch(la){null!=ja.result&&0<ja.result.length?K({message:ja.result}):K(la)}},ja.readAsText(Y.response))}catch(la){K({})}});Y.send(V)}else if(E.clear())try{this.doImportVisio(c,f,K,q)}catch(aa){K(aa)}}else K({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?Q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+
"js/extensions.min.js",Q,null,null,null,K))}),A)};EditorUi.prototype.importGraphML=function(c,f,l){var q=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=l?l(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var A=mxUtils.bind(this,function(K){x.clear()&&q(K)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,q)}catch(K){A(K)}else A({message:mxResources.get("serviceUnavailableOrBlocked")})});
this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?E():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,A))}),q)};EditorUi.prototype.importGliffy=function(c,f,l,q){var x=mxUtils.bind(this,function(A){null!=l&&l({status:"undefined"!==typeof mxGliffyToDrawio&&"function"===typeof mxGliffyToDrawio.LimitExceededException&&A instanceof mxGliffyToDrawio.LimitExceededException?413:500,message:null!=A&&null!=A.message?A.message:mxResources.get("serviceUnavailableOrBlocked")})});
this.loadGliffy(mxUtils.bind(this,function(){var A=null;try{A=mxGliffyToDrawio.convert(c)}catch(E){x(E);return}if(null!=A){try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+c.length})}catch(E){}f(A)}else x(null)}),x)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var q=
@@ -4452,19 +4454,19 @@ mxUtils.bind(this,function(A){l.clear()&&f(A)}),x=mxUtils.bind(this,function(){t
f(LucidImporter.importState(K));try{if(null!=window.console&&"1"==urlParams.test){var Q=[(new Date).toISOString(),"convertLucidChart",K];null!=K.state&&Q.push(JSON.parse(K.state));if(null!=K.svgThumbs)for(var V=0;V<K.svgThumbs.length;V++)Q.push(Editor.createSvgDataUri(K.svgThumbs[V]));null!=K.thumb&&Q.push(K.thumb);console.log.apply(console,Q)}}catch(J){}}catch(J){null!=window.console&&console.error(J),A(J)}else A({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||
this.loadingExtensions||this.isOffline(!0)?window.setTimeout(E,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",E,null,null,null,A)},null,null,null,A)},null,null,null,A)},null,null,null,A)},null,null,null,A):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",
E,null,null,null,A))}),q)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,l,q,x){var A=null!=x&&null!=x.dataAttr?x.dataAttr:"mermaidData",E=null!=x&&null!=x.attrPrefix?x.attrPrefix:"mermaid",K=this.editor.graph;x=mxUtils.parseXml((null!=x&&null!=x.wrapGroup?x.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,l,q));var Q=new mxCodec(x);f=new mxGraphModel;Q.decode(x.documentElement,f);Q=f.getRoot();var V=null;for(x=0;null!=Q&&x<f.getChildCount(Q)&&null==V;x++)for(var J=f.getChildAt(Q,x),ia=0;ia<
-f.getChildCount(J);ia++){var Y=f.getChildAt(J,ia),aa=Y.value;if(null!=aa&&"object"===typeof aa&&null!=aa.getAttribute&&null!=aa.getAttribute(A)){V=Y;break}}if(null!=V){Q=[];for(x=0;x<f.getChildCount(V);x++)Q.push(f.getChildAt(V,x));0==Q.length&&(Q=[V]);V=f.getGeometry(V);J=aa=Infinity;Y=K.model.getChildCount(c);for(x=0;x<Y;x++){var ja=K.model.getChildAt(c,x);K.model.isVertex(ja)&&(ja=ja.getGeometry(),null!=ja&&(aa=Math.min(aa,ja.x),J=Math.min(J,ja.y)))}var ka=Infinity;ja=Infinity;for(x=0;x<Q.length;x++)f.isVertex(Q[x])&&
-(Y=Q[x].getGeometry(),null!=Y&&(ka=Math.min(ka,Y.x),ja=Math.min(ja,Y.y)));aa=isFinite(aa)&&isFinite(ka)?aa-ka:0;J=isFinite(J)&&isFinite(ja)?J-ja:0;if(0!=aa||0!=J)for(x=0;x<Q.length;x++)if(ja=Q[x],Y=ja.getGeometry(),null!=Y){Y=Y.clone();if(f.isVertex(ja))Y.x+=aa,Y.y+=J;else if(f.isEdge(ja)){if(null!=Y.points)for(ka=0;ka<Y.points.length;ka++)null!=Y.points[ka]&&(Y.points[ka].x+=aa,Y.points[ka].y+=J);null!=Y.sourcePoint&&(Y.sourcePoint.x+=aa,Y.sourcePoint.y+=J);null!=Y.targetPoint&&(Y.targetPoint.x+=
+f.getChildCount(J);ia++){var Y=f.getChildAt(J,ia),aa=Y.value;if(null!=aa&&"object"===typeof aa&&null!=aa.getAttribute&&null!=aa.getAttribute(A)){V=Y;break}}if(null!=V){Q=[];for(x=0;x<f.getChildCount(V);x++)Q.push(f.getChildAt(V,x));0==Q.length&&(Q=[V]);V=f.getGeometry(V);J=aa=Infinity;Y=K.model.getChildCount(c);for(x=0;x<Y;x++){var ja=K.model.getChildAt(c,x);K.model.isVertex(ja)&&(ja=ja.getGeometry(),null!=ja&&(aa=Math.min(aa,ja.x),J=Math.min(J,ja.y)))}var la=Infinity;ja=Infinity;for(x=0;x<Q.length;x++)f.isVertex(Q[x])&&
+(Y=Q[x].getGeometry(),null!=Y&&(la=Math.min(la,Y.x),ja=Math.min(ja,Y.y)));aa=isFinite(aa)&&isFinite(la)?aa-la:0;J=isFinite(J)&&isFinite(ja)?J-ja:0;if(0!=aa||0!=J)for(x=0;x<Q.length;x++)if(ja=Q[x],Y=ja.getGeometry(),null!=Y){Y=Y.clone();if(f.isVertex(ja))Y.x+=aa,Y.y+=J;else if(f.isEdge(ja)){if(null!=Y.points)for(la=0;la<Y.points.length;la++)null!=Y.points[la]&&(Y.points[la].x+=aa,Y.points[la].y+=J);null!=Y.sourcePoint&&(Y.sourcePoint.x+=aa,Y.sourcePoint.y+=J);null!=Y.targetPoint&&(Y.targetPoint.x+=
aa,Y.targetPoint.y+=J)}f.setGeometry(ja,Y)}f=this.snapshotMermaidIdentity(c,E);Q=K.cloneCells(Q,!0);K.getModel().beginUpdate();try{for(ia=K.model.getChildCount(c)-1;0<=ia;ia--)K.model.remove(K.model.getChildAt(c,ia));for(x=0;x<Q.length;x++)this.applyMermaidUserCustomizations(Q[x],f,E),K.model.add(c,Q[x]);if(null!=V){var ua=K.model.getGeometry(c);null!=ua&&(ua=ua.clone(),ua.width=V.width,ua.height=V.height,K.model.setGeometry(c,ua))}K.setAttributeForCell(c,A,JSON.stringify({data:l,config:q},null,2))}finally{K.getModel().endUpdate()}}};
EditorUi.prototype.snapshotMermaidIdentity=function(c,f){f=null!=f?f:"mermaid";for(var l=this.editor.graph,q={},x=l.model.getChildCount(c),A=0;A<x;A++){var E=l.model.getChildAt(c,A),K=E.value;if(null!=K&&"object"===typeof K&&null!=K.getAttribute){var Q=K.getAttribute(f+"Id");Q&&(q[Q]={currentStyle:E.style||"",currentLabel:K.getAttribute("label")||"",baseStyle:K.getAttribute(f+"BaseStyle")||"",baseValue:K.getAttribute(f+"BaseValue")||""})}}return q};EditorUi.prototype.applyMermaidUserCustomizations=
-function(c,f,l){var q=c.value;null!=q&&"object"===typeof q&&null!=q.getAttribute&&(l=q.getAttribute((null!=l?l:"mermaid")+"Id"))&&(f=f[l],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&q.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=function(c,f,l,q){function x(J){var ia={},Y=[];if(!J)return{map:ia,keys:Y};J=J.split(";");for(var aa=0;aa<J.length;aa++){var ja=J[aa];if(ja){var ka=ja.indexOf("=");
-if(0<ka){var ua=ja.substring(0,ka);ua in ia||Y.push(ua);ia[ua]=ja.substring(ka+1)}else ja in ia||Y.push(ja),ia[ja]=!0}}return{map:ia,keys:Y}}c=x(c);f=x(f);var A=x(l),E={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},K=q?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};q={};l=[];for(var Q=0;Q<A.keys.length;Q++){var V=A.keys[Q];q[V]=A.map[V];l.push(V)}for(Q=0;Q<f.keys.length;Q++)V=f.keys[Q],E[V]||K[V]||f.map[V]===
+function(c,f,l){var q=c.value;null!=q&&"object"===typeof q&&null!=q.getAttribute&&(l=q.getAttribute((null!=l?l:"mermaid")+"Id"))&&(f=f[l],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&q.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=function(c,f,l,q){function x(J){var ia={},Y=[];if(!J)return{map:ia,keys:Y};J=J.split(";");for(var aa=0;aa<J.length;aa++){var ja=J[aa];if(ja){var la=ja.indexOf("=");
+if(0<la){var ua=ja.substring(0,la);ua in ia||Y.push(ua);ia[ua]=ja.substring(la+1)}else ja in ia||Y.push(ja),ia[ja]=!0}}return{map:ia,keys:Y}}c=x(c);f=x(f);var A=x(l),E={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},K=q?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};q={};l=[];for(var Q=0;Q<A.keys.length;Q++){var V=A.keys[Q];q[V]=A.map[V];l.push(V)}for(Q=0;Q<f.keys.length;Q++)V=f.keys[Q],E[V]||K[V]||f.map[V]===
c.map[V]||(V in q||l.push(V),q[V]=f.map[V]);for(Q=0;Q<c.keys.length;Q++)V=c.keys[Q],E[V]||K[V]||V in f.map||delete q[V];c=[];for(Q=0;Q<l.length;Q++)V=l[Q],f=q[V],void 0!==f&&(!0===f?c.push(V):c.push(V+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,l){var q=null,x=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(x.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,x.getModel()),
q=x.getSvg(null,null,f,null,null,null,null,null,null,null,null,l,null,null,!0,!0)}finally{document.body.removeChild(x.container)}return q};EditorUi.prototype.showPreviewTooltip=function(c,f){if(null!=this.sidebar&&(c=this.stringToCells(c),0<c.length)){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.sidebar.createTooltip(mxEvent.getSource(f),c,Math.min(l-120,1600),Math.min(q-
120,1200),null,!0,new mxPoint(mxEvent.getClientX(f),mxEvent.getClientY(f)),!0,null,!0,!1);null==this.previewTooltipDialogListener&&(this.previewTooltipDialogListener=mxUtils.bind(this,function(){this.sidebar.hideTooltip()}),this.editor.addListener("hideDialog",this.previewTooltipDialogListener))}};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,l,q){var x=0,A=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(E){var K="";if(null!=this.drive&&
null!=this.drive.getUser()){var Q=this.drive.getUser();null!=Q.email&&0<Q.email.indexOf("@")&&(K=Q.email.substring(Q.email.indexOf("@")+1))}var V={prompt:c,driveDomain:K,options:null!=q?q:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"url",["https://www.draw.io/generate/v3"]);var J=Date.now();K=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(V),"POST");var ia=mxUtils.bind(this,function(aa){E.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",
-[this],"data",[V],"error",[aa],"time",Date.now()-J+" ms"),l(aa))}),Y=mxUtils.bind(this,function(aa){3>x++?E.clear()&&A():ia(aa)});K.send(mxUtils.bind(this,function(aa){if(E.isAlive())if(200<=aa.getStatus()&&299>=aa.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ka=aa.getText();try{ka=JSON.parse(ka),result=ka.result}catch(k){result=ka}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"response",[ka],"time",Date.now()-J+" ms");ka=Editor.extractGraphModelFromText(result);
-var ua=!1;if((null==ka||""==ka[1])&&0<=result.indexOf("<mxGraphModel")){var Da=Editor.repairTruncatedXml(result);null!=Da&&(ka=Editor.extractGraphModelFromText(Da),ua=""!=ka[1])}if(null!=ka&&""!=ka[1])E.clear()&&f(ka[1],ua);else if("<"==mxUtils.trim(result).charAt(0))E.clear()&&f(result);else{var ha=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(ha,null,mxUtils.bind(this,function(k){this.tryAndHandle(mxUtils.bind(this,function(){E.clear()&&f(mxMermaidToDrawio.wrapGroup(k,
-ha,EditorUi.getInsertMermaidConfig()))}),ia)}),ia,Y)}}),ia,!0);else{var ja={message:mxResources.get("error")+" "+aa.getStatus()};try{ja=JSON.parse(aa.getText()),null!=ja.error&&(ja.message=ja.error)}catch(ka){}ia(ja)}}),ia)}),l)});A()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var l=mxUtils.trim(1>=
+[this],"data",[V],"error",[aa],"time",Date.now()-J+" ms"),l(aa))}),Y=mxUtils.bind(this,function(aa){3>x++?E.clear()&&A():ia(aa)});K.send(mxUtils.bind(this,function(aa){if(E.isAlive())if(200<=aa.getStatus()&&299>=aa.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var la=aa.getText();try{la=JSON.parse(la),result=la.result}catch(k){result=la}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"response",[la],"time",Date.now()-J+" ms");la=Editor.extractGraphModelFromText(result);
+var ua=!1;if((null==la||""==la[1])&&0<=result.indexOf("<mxGraphModel")){var Da=Editor.repairTruncatedXml(result);null!=Da&&(la=Editor.extractGraphModelFromText(Da),ua=""!=la[1])}if(null!=la&&""!=la[1])E.clear()&&f(la[1],ua);else if("<"==mxUtils.trim(result).charAt(0))E.clear()&&f(result);else{var ha=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(ha,null,mxUtils.bind(this,function(k){this.tryAndHandle(mxUtils.bind(this,function(){E.clear()&&f(mxMermaidToDrawio.wrapGroup(k,
+ha,EditorUi.getInsertMermaidConfig()))}),ia)}),ia,Y)}}),ia,!0);else{var ja={message:mxResources.get("error")+" "+aa.getStatus()};try{ja=JSON.parse(aa.getText()),null!=ja.error&&(ja.message=ja.error)}catch(la){}ia(ja)}}),ia)}),l)});A()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var l=mxUtils.trim(1>=
f.length?c:f[1]),q=l.split("\n"),x=0;x<q.length&&("mermaid"==q[x]||0==q[x].trim().length||"%%"==q[x].substring(0,2));)x++;l=[];for(var A=x;A<q.length;A++){var E=mxUtils.trim(q[A]);if("%%"!=E.substring(0,2)&&"classDef "!=E.substring(0,9))l.push(q[A]);else if("mermaid"==E)break}q=l;l=mxUtils.trim(q.join("\n"));A="undefined"!==typeof MermaidParser?MermaidParser.detectType(l):null;EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[l],"typeInfo",[A],"startLine",x,"lines",q,"tokens",
f);return null!=A?l:null};EditorUi.prototype.getMermaidDiagramType=function(c){var f=null!=c?c.split("\n"):[],l=0;c=function(){for(;l<f.length&&(0==f[l].trim().length||"%%"==f[l].substring(0,2));)l++};c();if(l<f.length&&"---"==f[l].trim()){do l++;while(l<f.length&&"---"!=f[l].trim());l++;c()}if(l>=f.length)return"";c=f[l].trim().toLowerCase();var q=c.indexOf(" ");return c.substring(0,0<q?q:c.length)};EditorUi.prototype.isMermaidElkFlowchart=function(c){return null!=c&&(/defaultRenderer["']?\s*:\s*["']?elk/i.test(c)||
/(?:^|\n)\s*layout\s*:\s*["']?elk\b/i.test(c))&&/(?:flowchart|graph)\b/i.test(c)};EditorUi.prototype.applyMermaidElkPostPass=function(c,f,l){if("undefined"===typeof ElkLayout||"undefined"===typeof Graph)l(c);else{f=f.match(/(?:flowchart|graph)\s+(LR|RL|TB|TD|BT)/i);var q={LR:"RIGHT",RL:"LEFT",TB:"DOWN",TD:"DOWN",BT:"UP"};f=f?q[f[1].toUpperCase()]||"DOWN":"DOWN";var x=document.createElement("div");x.style.cssText="position:absolute;left:-99999px;top:-99999px;width:1200px;height:800px;visibility:hidden;";
@@ -4485,7 +4487,7 @@ q?this.parsePlantUmlDiagram(x.data,null,K,l):this.parseMermaidDiagram(x.data,mxU
null,!0);l.model.remove(c);l.setSelectionCells(K)}finally{l.getModel().endUpdate()}l.scrollCellToVisible(l.getSelectionCell());return K};EditorUi.prototype.insertAsPreText=function(c,f,l){var q=this.editor.graph,x=null;q.getModel().beginUpdate();try{x=q.insertVertex(null,null,"<pre>"+c+"</pre>",f,l,1,1,"text;html=1;align=left;verticalAlign=top;"),q.updateCellSize(x,!0)}finally{q.getModel().endUpdate()}return x};EditorUi.prototype.insertTextAt=function(c,f,l,q,x,A,E,K){A=null!=A?A:!0;E=null!=E?E:!0;
if(null!=c)if(Graph.fileSupport&&this.isGliffyData(c))this.importGliffy(c.replace(/\s+/g," "),mxUtils.bind(this,function(Y){this.editor.graph.setSelectionCells(this.insertTextAt(Y,f,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(x||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var Q=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var V=Editor.extractGraphModelFromPdf(c);if(null!=V&&0<V.length)return this.importXml(V,f,l,A,!0,K)}if(Editor.isPngDataUrl(c)&&(V=
Editor.extractGraphModelFromPng(c),null!=V&&0<V.length))return this.importXml(V,f,l,A,!0,K);if("data:image/svg+xml;"==c.substring(0,19))try{V=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(V=c.substring(c.indexOf(",")+1),V=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V,!0)):V=decodeURIComponent(c.substring(c.indexOf(",")+1));var J=this.importXml(V,f,l,A,!0,K);if(0<J.length)return J}catch(Y){}this.loadImage(c,mxUtils.bind(this,function(Y){if("data:"==c.substring(0,5))this.resizeImage(Y,
-Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(ka,ua,Da){Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(l),ua,Da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(ka)+";"))}),E,this.maxImageSize);else{var aa=Math.min(1,Math.min(this.maxImageSize/Y.width,this.maxImageSize/Y.height)),ja=Math.round(Y.width*aa);Y=Math.round(Y.height*aa);Q.setSelectionCell(Q.insertVertex(null,
+Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(la,ua,Da){Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(l),ua,Da,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(la)+";"))}),E,this.maxImageSize);else{var aa=Math.min(1,Math.min(this.maxImageSize/Y.width,this.maxImageSize/Y.height)),ja=Math.round(Y.width*aa);Y=Math.round(Y.height*aa);Q.setSelectionCell(Q.insertVertex(null,
null,"",Q.snap(f),Q.snap(l),ja,Y,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var Y=null;Q.getModel().beginUpdate();try{Y=Q.insertVertex(Q.getDefaultParent(),null,c,Q.snap(f),Q.snap(l),1,1,"text;"+(q?"html=1;":"")),Q.updateCellSize(Y),Q.fireEvent(new mxEventObject("textInserted","cells",[Y]))}finally{Q.getModel().endUpdate()}Q.setSelectionCell(Y)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));
if(this.isCompatibleString(c))return this.importXml(c,f,l,A,null,K);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(Y){this.editor.graph.setSelectionCells(this.importXml(Y,f,l,A,null,K))}),mxUtils.bind(this,function(Y){this.handleError(Y)}));else{Q=this.editor.graph;x=null;Q.getModel().beginUpdate();try{x=Q.insertVertex(Q.getDefaultParent(),null,"",Q.snap(f),Q.snap(l),1,1,"text;whiteSpace=wrap;"+(q?"html=1;":""));Q.fireEvent(new mxEventObject("textInserted",
"cells",[x]));q&&(c=Q.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");x.value=c;Q.updateCellSize(x);if(0<this.maxTextWidth&&x.geometry.width>this.maxTextWidth){var ia=Q.getPreferredSizeForCell(x,this.maxTextWidth);x.geometry.width=ia.width;x.geometry.height=ia.height}Graph.isLink(x.value)&&Q.setLinkForCell(x,x.value);x.geometry.width+=Q.gridSize;x.geometry.height+=Q.gridSize}finally{Q.getModel().endUpdate()}return[x]}}return[]};EditorUi.prototype.formatFileSize=
@@ -4497,77 +4499,77 @@ if(!f){var x=this.dialog,A=x.close;this.dialog.close=mxUtils.bind(this,function(
V?(Q=!0,J.async("string").then(function(ia){0==ia.indexOf("<mxfile ")?f(ia):l()})):0==V.indexOf("versions/")&&(V=parseInt(V.substr(9)),V>E&&(E=V,K=J))});0<E?K.async("string").then(function(V){q.isGliffyData(V,c.name)?q.importGliffy(V,function(J){f(J)},function(){l()},c.name):l()}):Q||l()}},function(A){l(A)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?x():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,l))};EditorUi.prototype.importFile=
function(c,f,l,q,x,A,E,K,Q,V,J,ia){V=null!=V?V:!0;var Y=!1,aa=null,ja=mxUtils.bind(this,function(Da){var ha=null;null!=Da&&"<mxlibrary"==Da.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,Da,E)),this.showSidebar()):ha=this.importXml(Da,l,q,V,null,null!=ia?mxEvent.isControlDown(ia):null);null!=K&&K(ha)});if("image"==f.substring(0,5))Q=!1,"image/png"==f.substring(0,9)&&(J=J?null:this.extractGraphModelFromPng(c),null!=J&&0<J.length&&(aa=this.importXml(J,l,q,V,null,null!=ia?mxEvent.isControlDown(ia):
null),Q=!0)),Q||(J=this.editor.graph,Q=c.indexOf(";"),0<Q&&(c=c.substring(0,Q)+c.substring(c.indexOf(",",Q+1))),V&&J.isGridEnabled()&&(l=J.snap(l),q=J.snap(q)),Q="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(Q+="editableCssRules=.*;"),aa=[J.insertVertex(null,null,"",l,q,x,A,Q+"image="+c+";")]);else if(/(\.*<graphml )/.test(c))Y=!0,this.importGraphML(c,ja);else if(null!=Q&&null!=E&&EditorUi.isVisioFilename(E))Y=
-!0,this.importVisio(Q,ja);else if(this.isGliffyData(c,E)){Y=!0;var ka=mxUtils.bind(this,function(Da){this.importGliffy(Da,ja,mxUtils.bind(this,function(ha){null!=K&&(K(null),this.showError(mxResources.get("error"),null!=ha&&413==ha.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")))}),E)});if(null!=c)ka(c);else{var ua=new FileReader;ua.onload=function(){ka(ua.result)};ua.readAsText(Q)}}else 0==c.indexOf("PK")&&null!=Q?(Y=!0,this.importZipFile(Q,ja,mxUtils.bind(this,function(){aa=
-this.insertTextAt(this.validateFileData(c),l,q,!0,null,V);K(aa)}))):/(\.v(sd|dx))($|\?)/i.test(E)||/(\.vs(s|x))($|\?)/i.test(E)||(aa=this.insertTextAt(this.validateFileData(c),l,q,!0,null,V,null,null!=ia?mxEvent.isControlDown(ia):null));Y||null==K||K(aa);return aa};EditorUi.prototype.importFiles=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){q=null!=q?q:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var aa=null!=f&&null!=l,ja=!0;f=null!=f?f:0;l=null!=l?l:0;var ka=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ua=
-J||this.resampleThreshold,Da=0;Da<c.length;Da++)if("image/svg"!==c[Da].type.substring(0,9)&&"image/"===c[Da].type.substring(0,6)&&c[Da].size>ua){ka=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[l],"maxSize",[q],"maxBytes",[V],"resampleThreshold",[this.resampleThreshold],"largeImages",[ka],"crop",[aa],"resizeImages",[ja],"ignoreEmbeddedXml",[ia],"evt",[Y]);var ha=mxUtils.bind(this,function(){var k=this.editor.graph,u=k.gridSize;x=null!=x?x:mxUtils.bind(this,function(ea,
-oa,la,ca,sa,xa,qa,Ba,ma){try{if(null!=ea&&"<mxlibrary"==ea.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ea,qa)),this.showSidebar(),null;this.isCompatibleString(ea)&&1==c.length&&null!=Y&&"drop"==Y.type&&this.isBlankFile()&&!this.canUndo()&&(aa=!1,ca=la=0);return this.importFile(ea,oa,la,ca,sa,xa,qa,Ba,ma,aa,ia,Y)}catch(ta){return this.handleError(ta),null}});A=null!=A?A:mxUtils.bind(this,function(ea){k.setSelectionCells(ea)});if(this.spinner.spin(document.body,
-mxResources.get("loading")))for(var H=this.currentPage,P=c.length,T=P,W=[],fa=mxUtils.bind(this,function(ea,oa){W[ea]=oa;if(0==--T){this.spinner.stop();if(null!=K)K(W);else{var la=[];k.getModel().beginUpdate();try{for(ea=0;ea<W.length;ea++){var ca=W[ea]();null!=ca&&(la=la.concat(ca))}}finally{k.getModel().endUpdate()}}H!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);A(la)}}),X=0;X<P;X++)mxUtils.bind(this,function(ea){var oa=c[ea];if(null!=
-oa){var la=new FileReader;la.onload=mxUtils.bind(this,function(ca){if(null==E||E(oa))try{if("image/"==oa.type.substring(0,6))if("image/svg"==oa.type.substring(0,9)){var sa=Graph.clipSvgDataUri(ca.target.result),xa=sa.indexOf(","),qa=decodeURIComponent(escape(atob(sa.substring(xa+1)))),Ba=mxUtils.parseXml(qa),ma=Ba.getElementsByTagName("svg");if(0<ma.length){var ta=ma[0],va=ia?null:ta.getAttribute("content");null!=va&&"<"!=va.charAt(0)&&"%"!=va.charAt(0)&&(va=unescape(window.atob?atob(va):Base64.decode(va,
+!0,this.importVisio(Q,ja);else if(this.isGliffyData(c,E)){Y=!0;var la=mxUtils.bind(this,function(Da){this.importGliffy(Da,ja,mxUtils.bind(this,function(ha){null!=K&&(K(null),this.showError(mxResources.get("error"),null!=ha&&413==ha.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")))}),E)});if(null!=c)la(c);else{var ua=new FileReader;ua.onload=function(){la(ua.result)};ua.readAsText(Q)}}else 0==c.indexOf("PK")&&null!=Q?(Y=!0,this.importZipFile(Q,ja,mxUtils.bind(this,function(){aa=
+this.insertTextAt(this.validateFileData(c),l,q,!0,null,V);K(aa)}))):/(\.v(sd|dx))($|\?)/i.test(E)||/(\.vs(s|x))($|\?)/i.test(E)||(aa=this.insertTextAt(this.validateFileData(c),l,q,!0,null,V,null,null!=ia?mxEvent.isControlDown(ia):null));Y||null==K||K(aa);return aa};EditorUi.prototype.importFiles=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y){q=null!=q?q:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var aa=null!=f&&null!=l,ja=!0;f=null!=f?f:0;l=null!=l?l:0;var la=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ua=
+J||this.resampleThreshold,Da=0;Da<c.length;Da++)if("image/svg"!==c[Da].type.substring(0,9)&&"image/"===c[Da].type.substring(0,6)&&c[Da].size>ua){la=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[l],"maxSize",[q],"maxBytes",[V],"resampleThreshold",[this.resampleThreshold],"largeImages",[la],"crop",[aa],"resizeImages",[ja],"ignoreEmbeddedXml",[ia],"evt",[Y]);var ha=mxUtils.bind(this,function(){var k=this.editor.graph,u=k.gridSize;x=null!=x?x:mxUtils.bind(this,function(ea,
+oa,ka,ba,sa,xa,qa,Ba,ma){try{if(null!=ea&&"<mxlibrary"==ea.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ea,qa)),this.showSidebar(),null;this.isCompatibleString(ea)&&1==c.length&&null!=Y&&"drop"==Y.type&&this.isBlankFile()&&!this.canUndo()&&(aa=!1,ba=ka=0);return this.importFile(ea,oa,ka,ba,sa,xa,qa,Ba,ma,aa,ia,Y)}catch(ta){return this.handleError(ta),null}});A=null!=A?A:mxUtils.bind(this,function(ea){k.setSelectionCells(ea)});if(this.spinner.spin(document.body,
+mxResources.get("loading")))for(var H=this.currentPage,P=c.length,U=P,W=[],fa=mxUtils.bind(this,function(ea,oa){W[ea]=oa;if(0==--U){this.spinner.stop();if(null!=K)K(W);else{var ka=[];k.getModel().beginUpdate();try{for(ea=0;ea<W.length;ea++){var ba=W[ea]();null!=ba&&(ka=ka.concat(ba))}}finally{k.getModel().endUpdate()}}H!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);A(ka)}}),X=0;X<P;X++)mxUtils.bind(this,function(ea){var oa=c[ea];if(null!=
+oa){var ka=new FileReader;ka.onload=mxUtils.bind(this,function(ba){if(null==E||E(oa))try{if("image/"==oa.type.substring(0,6))if("image/svg"==oa.type.substring(0,9)){var sa=Graph.clipSvgDataUri(ba.target.result),xa=sa.indexOf(","),qa=decodeURIComponent(escape(atob(sa.substring(xa+1)))),Ba=mxUtils.parseXml(qa),ma=Ba.getElementsByTagName("svg");if(0<ma.length){var ta=ma[0],va=ia?null:ta.getAttribute("content");null!=va&&"<"!=va.charAt(0)&&"%"!=va.charAt(0)&&(va=unescape(window.atob?atob(va):Base64.decode(va,
!0)));null!=va&&"%"==va.charAt(0)&&(va=decodeURIComponent(va));null==va||"<mxfile "!==va.substring(0,8)&&"<mxGraphModel>"!==va.substring(0,14)&&"<mxGraphModel "!==va.substring(0,14)?fa(ea,mxUtils.bind(this,function(){try{if(null!=Ba){var Ia=Ba.getElementsByTagName("svg");if(0<Ia.length){var Ca=Ia[0],Pa=Ca.getAttribute("width"),Ka=Ca.getAttribute("height");Pa=null!=Pa&&"%"!=Pa.charAt(Pa.length-1)?parseFloat(Pa):NaN;Ka=null!=Ka&&"%"!=Ka.charAt(Ka.length-1)?parseFloat(Ka):NaN;var Na=Ca.getAttribute("viewBox");
if(null==Na||0==Na.length)Ca.setAttribute("viewBox","0 0 "+Pa+" "+Ka);else if(isNaN(Pa)||isNaN(Ka)){var Oa=Na.split(" ");3<Oa.length&&(Pa=parseFloat(Oa[2]),Ka=parseFloat(Oa[3]))}sa=Editor.createSvgDataUri(mxUtils.getXml(Ca));var Ea=Math.min(1,Math.min(q/Math.max(1,Pa)),q/Math.max(1,Ka)),Aa=x(sa,oa.type,f+ea*u,l+ea*u,Math.max(1,Math.round(Pa*Ea)),Math.max(1,Math.round(Ka*Ea)),oa.name);if(null!=Aa&&(isNaN(Pa)||isNaN(Ka))){var Ja=new Image;Ja.onload=mxUtils.bind(this,function(){Pa=Math.max(1,Ja.width);
-Ka=Math.max(1,Ja.height);Aa[0].geometry.width=Pa;Aa[0].geometry.height=Ka;Ca.setAttribute("viewBox","0 0 "+Pa+" "+Ka);sa=Editor.createSvgDataUri(mxUtils.getXml(Ca));var Ga=sa.indexOf(";");0<Ga&&(sa=sa.substring(0,Ga)+sa.substring(sa.indexOf(",",Ga+1)));k.setCellStyles("image",sa,[Aa[0]])});Ja.src=Editor.createSvgDataUri(mxUtils.getXml(Ca))}return Aa}}}catch(Ga){}return null})):fa(ea,mxUtils.bind(this,function(){return x(va,"text/xml",f+ea*u,l+ea*u,0,0,oa.name)}))}else fa(ea,mxUtils.bind(this,function(){return null}))}else{xa=
-!1;if("image/png"==oa.type){var Ha=ia?null:this.extractGraphModelFromPng(ca.target.result);if(null!=Ha&&0<Ha.length){var La=new Image;La.src=ca.target.result;fa(ea,mxUtils.bind(this,function(){return x(Ha,"text/xml",f+ea*u,l+ea*u,La.width,La.height,oa.name)}));xa=!0}}xa||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,
-function(){this.actions.get("import").funct()}))):this.loadImage(ca.target.result,mxUtils.bind(this,function(Ia){this.resizeImage(Ia,Editor.stripImageMetadata(ca.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(Ca,Pa,Ka){fa(ea,mxUtils.bind(this,function(){if(null!=Ca&&Ca.length<V){var Na=ja&&this.isResampleImageSize(oa.size,J)?Math.min(1,Math.min(q/Pa,q/Ka)):1;return x(Ca,oa.type,f+ea*u,l+ea*u,Math.round(Pa*Na),Math.round(Ka*Na),oa.name)}this.handleError({message:mxResources.get("imageTooBig")});
-return null}))}),ja,q,J,oa.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else sa=ca.target.result,x(sa,oa.type,f+ea*u,l+ea*u,240,160,oa.name,function(Ia){fa(ea,function(){return Ia})},oa)}catch(Ia){fa(ea,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ia,oa)}else fa(ea,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(oa.name)?x(null,oa.type,f+ea*u,l+ea*u,240,160,oa.name,function(ca){fa(ea,
-function(){return ca})},oa):"image"==oa.type.substring(0,5)||"application/pdf"==oa.type?la.readAsDataURL(oa):la.readAsText(oa)}})(X)});if(ka){ka=[];for(Da=0;Da<c.length;Da++)ka.push(c[Da]);c=ka;this.confirmImageResize(function(k){ja=k;ha()},Q)}else ha()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;
+Ka=Math.max(1,Ja.height);Aa[0].geometry.width=Pa;Aa[0].geometry.height=Ka;Ca.setAttribute("viewBox","0 0 "+Pa+" "+Ka);sa=Editor.createSvgDataUri(mxUtils.getXml(Ca));var Ha=sa.indexOf(";");0<Ha&&(sa=sa.substring(0,Ha)+sa.substring(sa.indexOf(",",Ha+1)));k.setCellStyles("image",sa,[Aa[0]])});Ja.src=Editor.createSvgDataUri(mxUtils.getXml(Ca))}return Aa}}}catch(Ha){}return null})):fa(ea,mxUtils.bind(this,function(){return x(va,"text/xml",f+ea*u,l+ea*u,0,0,oa.name)}))}else fa(ea,mxUtils.bind(this,function(){return null}))}else{xa=
+!1;if("image/png"==oa.type){var Ga=ia?null:this.extractGraphModelFromPng(ba.target.result);if(null!=Ga&&0<Ga.length){var La=new Image;La.src=ba.target.result;fa(ea,mxUtils.bind(this,function(){return x(Ga,"text/xml",f+ea*u,l+ea*u,La.width,La.height,oa.name)}));xa=!0}}xa||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,
+function(){this.actions.get("import").funct()}))):this.loadImage(ba.target.result,mxUtils.bind(this,function(Ia){this.resizeImage(Ia,Editor.stripImageMetadata(ba.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(Ca,Pa,Ka){fa(ea,mxUtils.bind(this,function(){if(null!=Ca&&Ca.length<V){var Na=ja&&this.isResampleImageSize(oa.size,J)?Math.min(1,Math.min(q/Pa,q/Ka)):1;return x(Ca,oa.type,f+ea*u,l+ea*u,Math.round(Pa*Na),Math.round(Ka*Na),oa.name)}this.handleError({message:mxResources.get("imageTooBig")});
+return null}))}),ja,q,J,oa.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else sa=ba.target.result,x(sa,oa.type,f+ea*u,l+ea*u,240,160,oa.name,function(Ia){fa(ea,function(){return Ia})},oa)}catch(Ia){fa(ea,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ia,oa)}else fa(ea,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(oa.name)?x(null,oa.type,f+ea*u,l+ea*u,240,160,oa.name,function(ba){fa(ea,
+function(){return ba})},oa):"image"==oa.type.substring(0,5)||"application/pdf"==oa.type?ka.readAsDataURL(oa):ka.readAsText(oa)}})(X)});if(la){la=[];for(Da=0;Da<c.length;Da++)la.push(c[Da]);c=la;this.confirmImageResize(function(k){ja=k;ha()},Q)}else ha()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;
var l=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},q=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,x=function(A,E){if(A||f)mxSettings.setResizeImages(A?E:null),mxSettings.save();l();c(E)};null==q||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(A){x(A,!0)},function(A){x(A,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+
Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):x(!1,q)};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,l,q,x,A,E){x=null!=x?x:this.maxImageSize;var K=Math.max(1,c.width),Q=Math.max(1,c.height),V=f;if(q&&this.isResampleImageSize(null!=E?E:f.length,A))try{var J=Math.max(K/x,Q/x);if(1<J){var ia=Math.round(K/J),Y=Math.round(Q/
-J),aa=document.createElement("canvas");aa.width=ia;aa.height=Y;aa.getContext("2d").drawImage(c,0,0,ia,Y);var ja=aa.toDataURL();if(ja.length<f.length){var ka=document.createElement("canvas");ka.width=ia;ka.height=Y;var ua=ka.toDataURL();ja!==ua&&(f=ja,K=ia,Q=Y)}}}catch(Da){}q&&V!=f&&x>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,q,x/1.5,A,E):l(f,K,Q)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=
+J),aa=document.createElement("canvas");aa.width=ia;aa.height=Y;aa.getContext("2d").drawImage(c,0,0,ia,Y);var ja=aa.toDataURL();if(ja.length<f.length){var la=document.createElement("canvas");la.width=ia;la.height=Y;var ua=la.toDataURL();ja!==ua&&(f=ja,K=ia,Q=Y)}}}catch(Da){}q&&V!=f&&x>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,q,x/1.5,A,E):l(f,K,Q)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=
function(c,f,l){try{var q=new Image;q.onload=function(){q.width=0<q.width?q.width:120;q.height=0<q.height?q.height:120;f(q)};null!=l&&(q.onerror=l);q.src=c}catch(x){if(null!=l)l(x);else throw x;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var t=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){if(Editor.isSettingsEnabled()){null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=
mxSettings.settings.sidebarTitles);this.formatWidth=mxSettings.getFormatWidth();var c=mxSettings.getSidebarWidth();null!=c&&(this.hsplitPosition=parseInt(c))}this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);t.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var n=EditorUi.prototype.init;EditorUi.prototype.init=
-function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(ca,sa){sa.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));
-this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var l=null,q=function(){var ca=f.getModel().getRoot();if(ca===l&&null!=c.chromelessAnimationPlayer)return!0;l=ca;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};q();this.editor.addListener("fileLoaded",q);f.addListener(mxEvent.ROOT,q)}var x=f.isEnabled;f.isEnabled=function(){return x.apply(this,
-arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];f.showNoteIcons=Editor.showNoteIcons&&"0"!=urlParams["note-icons"];var A=this;f.editTooltip=function(ca){null!=ca&&A.actions.get("editTooltip").funct()};f.editNote=function(ca){null!=ca&&A.actions.get("editNote").funct()};f.getLinkOverlayTooltip=function(ca){if(Graph.isPageLink(ca)&&null!=A.pages){var sa=ca.substring(ca.indexOf(",")+
-1);sa=A.getPageById(sa);if(null!=sa)return sa.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(A.pages,sa)+1])}else if(this.isCustomLink(ca))return this.getLinkTitle(ca);return ca};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(ca){var sa=ca.getEvent();return null==ca.getState()&&!mxEvent.isMouseEvent(sa)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(sa)&&(null==ca.getState()||mxEvent.isControlDown(sa)||mxEvent.isShiftDown(sa))});var E=function(ca){ca=/(?:^|;)groupPadding=([^;]*)/.exec(null!=
-ca?ca:"");return null!=ca?ca[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(ca,sa){ca=sa.getProperty("edit");if(null!=ca&&null!=ca.changes){sa=ca.changes.length;for(var xa=[],qa=0;qa<sa;qa++){var Ba=ca.changes[qa];Ba instanceof mxStyleChange&&null!=Ba.cell&&f.model.isVertex(Ba.cell)&&E(Ba.style)!=E(Ba.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=Ba.style?Ba.style:"")&&(null!=f.getAttributeForCell(Ba.cell,"mermaidData")||null!=f.getAttributeForCell(Ba.cell,"plantUmlData"))&&0>mxUtils.indexOf(xa,
-Ba.cell)&&xa.push(Ba.cell)}for(qa=0;qa<xa.length;qa++)c.refreshMermaidImage(xa[qa])}});var K=function(ca){var sa=!1;c.showDialog(ca.container,640,420,!0,!0,function(xa,qa){if(!sa&&ca.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){sa=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);ca.init()};f.cellEditor.editPlantUmlData=function(ca,sa,xa){var qa=JSON.parse(xa);sa=f.getCurrentCellStyle(ca);
+function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(ba,sa){sa.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));
+this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var l=null,q=function(){var ba=f.getModel().getRoot();if(ba===l&&null!=c.chromelessAnimationPlayer)return!0;l=ba;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};q();this.editor.addListener("fileLoaded",q);f.addListener(mxEvent.ROOT,q)}var x=f.isEnabled;f.isEnabled=function(){return x.apply(this,
+arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];f.showNoteIcons=Editor.showNoteIcons&&"0"!=urlParams["note-icons"];var A=this;f.editTooltip=function(ba){null!=ba&&A.actions.get("editTooltip").funct()};f.editNote=function(ba){null!=ba&&A.actions.get("editNote").funct()};f.getLinkOverlayTooltip=function(ba){if(Graph.isPageLink(ba)&&null!=A.pages){var sa=ba.substring(ba.indexOf(",")+
+1);sa=A.getPageById(sa);if(null!=sa)return sa.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(A.pages,sa)+1])}else if(this.isCustomLink(ba))return this.getLinkTitle(ba);return ba};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(ba){var sa=ba.getEvent();return null==ba.getState()&&!mxEvent.isMouseEvent(sa)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(sa)&&(null==ba.getState()||mxEvent.isControlDown(sa)||mxEvent.isShiftDown(sa))});var E=function(ba){ba=/(?:^|;)groupPadding=([^;]*)/.exec(null!=
+ba?ba:"");return null!=ba?ba[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(ba,sa){ba=sa.getProperty("edit");if(null!=ba&&null!=ba.changes){sa=ba.changes.length;for(var xa=[],qa=0;qa<sa;qa++){var Ba=ba.changes[qa];Ba instanceof mxStyleChange&&null!=Ba.cell&&f.model.isVertex(Ba.cell)&&E(Ba.style)!=E(Ba.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=Ba.style?Ba.style:"")&&(null!=f.getAttributeForCell(Ba.cell,"mermaidData")||null!=f.getAttributeForCell(Ba.cell,"plantUmlData"))&&0>mxUtils.indexOf(xa,
+Ba.cell)&&xa.push(Ba.cell)}for(qa=0;qa<xa.length;qa++)c.refreshMermaidImage(xa[qa])}});var K=function(ba){var sa=!1;c.showDialog(ba.container,640,420,!0,!0,function(xa,qa){if(!sa&&ba.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){sa=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);ba.init()};f.cellEditor.editPlantUmlData=function(ba,sa,xa){var qa=JSON.parse(xa);sa=f.getCurrentCellStyle(ba);
var Ba=mxUtils.getValue(sa,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,ma=null==qa.format&&!Ba;sa="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var ta=document.createElement("select");ta.className="geBtn";xa=document.createElement("option");xa.setAttribute("value","plantUmlDiagram");mxUtils.write(xa,mxResources.get("diagram"));ta.appendChild(xa);xa=document.createElement("option");xa.setAttribute("value","plantUmlImage");mxUtils.write(xa,mxResources.get("image"));ta.appendChild(xa);
-ta.value=Ba?"plantUmlImage":"plantUmlDiagram";var va=new SimpleTextareaDialog(c,qa.data,function(Ha){if(null!=Ha&&c.spinner.spin(document.body,mxResources.get("inserting"))){var La="plantUmlImage"==ta.value,Ia=ma?qa.config:null;c.parsePlantUmlDiagram(Ha,Ia,function(Ca,Pa){c.spinner.stop();va.hide();try{f.getModel().beginUpdate();try{if(Ba&&La)c.updateMermaidImage(ca,Ha,null,Ca,c.getMermaidImageBorder(ca,qa.border),"plantUmlData");else if(ma&&!La)c.replaceLockedGroupChildren(ca,Ca,Ha,Ia,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,
-dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var Ka=c.getMermaidImageBorder(ca,qa.border),Na=c.replaceMermaidCell(ca,La?c.createMermaidImageXml(Ha,null,Ca,null,Ka,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(Ca,Ha,Ia));La||null==Ka||f.setCellStyles("groupPadding",Ka,Na)}}finally{f.getModel().endUpdate()}c.showPlantUmlWarnings(Pa)}catch(Oa){c.handleError(Oa)}},function(Ca){c.spinner.stop();c.handleError(Ca)})}},null,null,sa?ta:null,!0,null==c.sidebar?null:function(Ha,La){c.spinner.spin(document.body,
-mxResources.get("loading"))&&c.parsePlantUmlDiagram(Ha,ma?qa.config:null,function(Ia,Ca){c.spinner.stop();c.showPreviewTooltip(Ia,La);c.showPlantUmlWarnings(Ca)},function(Ia){c.spinner.stop();c.handleError(Ia)})});K(va)};f.cellEditor.editMermaidData=function(ca,sa,xa){var qa=JSON.parse(xa);sa=f.getCurrentCellStyle(ca);var Ba=mxUtils.getValue(sa,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,ma=Ba&&null==qa.config;sa="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var ta=document.createElement("select");
-ta.className="geBtn";xa=document.createElement("option");xa.setAttribute("value","mermaid");mxUtils.write(xa,mxResources.get("diagram"));ta.appendChild(xa);xa=document.createElement("option");xa.setAttribute("value","mermaidImage");mxUtils.write(xa,mxResources.get("image"));ta.appendChild(xa);ta.value=Ba?"mermaidImage":"mermaid";var va=new SimpleTextareaDialog(c,qa.data,function(Ha){if(null!=Ha&&c.spinner.spin(document.body,mxResources.get("inserting"))){var La="mermaidImage"==ta.value;if(La&&ma){var Ia=
-EditorUi.legacyMermaidConfig;var Ca=null}else Ca=Ia=null!=qa.config?qa.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(Ha,mxUtils.clone(Ia),function(Pa){c.spinner.stop();va.hide();try{f.getModel().beginUpdate();try{if(Ba&&La)c.updateMermaidImage(ca,Ha,Ca,Pa,c.getMermaidImageBorder(ca,qa.border));else if(Ba||La){var Ka=c.getMermaidImageBorder(ca,qa.border),Na=c.replaceMermaidCell(ca,La?c.createMermaidImageXml(Ha,Ca,Pa,null,Ka):mxMermaidToDrawio.wrapGroup(Pa,Ha,Ca));La||null==Ka||f.setCellStyles("groupPadding",
-Ka,Na)}else c.replaceLockedGroupChildren(ca,Pa,Ha,Ca)}finally{f.getModel().endUpdate()}}catch(Oa){c.handleError(Oa)}},function(Pa){c.spinner.stop();c.handleError(Pa)})}},null,null,sa?ta:null,!0,null==c.sidebar?null:function(Ha,La){if(c.spinner.spin(document.body,mxResources.get("loading"))){var Ia="mermaidImage"==ta.value&&ma?EditorUi.legacyMermaidConfig:null!=qa.config?qa.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(Ha,mxUtils.clone(Ia),function(Ca){c.spinner.stop();c.showPreviewTooltip(Ca,
-La)},function(Ca){c.spinner.stop();c.handleError(Ca)})}});K(va)};var Q=f.cellEditor.startEditing;f.cellEditor.startEditing=function(ca,sa,xa){try{var qa=this.graph.getLockedGroupAncestor(ca);null!=qa&&(ca=qa);var Ba=this.graph.getAttributeForCell(ca,"plantUmlData");if(null!=Ba)this.editPlantUmlData(ca,sa,Ba);else if(Ba=this.graph.getAttributeForCell(ca,"mermaidData"),null!=Ba&&EditorUi.isMermaidSupported())this.editMermaidData(ca,sa,Ba);else{var ma=f.getCellStyle(ca);"1"==mxUtils.getValue(ma,"metaEdit",
-"0")?c.showDataDialog(ca):Q.call(this,ca,sa,xa)}}catch(ta){c.handleError(ta)}};f.getLinkTitle=function(ca){return c.getLinkTitle(ca)};f.customLinkClicked=function(ca,sa){var xa=!1;try{var qa=this.view.graphBounds,Ba=null!=qa?new mxRectangle(qa.x,qa.y,qa.width,qa.height):null;c.handleCustomLink(ca,sa);xa=!0;var ma=this.view.graphBounds;c.chromelessResize&&null!=Ba&&null!=ma&&!Ba.equals(ma)&&(c.chromelessResize(),this.scrollCellToVisible(sa))}catch(ta){c.handleError(ta)}return xa};var V=f.parseBackgroundImage;
-f.parseBackgroundImage=function(ca){var sa=V.apply(this,arguments);null!=sa&&null!=sa.src&&Graph.isPageLink(sa.src)&&(sa={originalSrc:sa.src});return sa};var J=f.setBackgroundImage;f.setBackgroundImage=function(ca){null!=ca&&null!=ca.originalSrc&&(ca=c.createImageForPageLink(ca.originalSrc,c.currentPage,this));J.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));
-this.editor.addListener("pagesPatched",mxUtils.bind(this,function(ca,sa){ca=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=ca){var xa=ca.indexOf(",");if(0<xa)for(ca=ca.substring(xa+1),sa=sa.getProperty("patches"),xa=0;xa<sa.length;xa++)if(null!=sa[xa][EditorUi.DIFF_UPDATE]&&null!=sa[xa][EditorUi.DIFF_UPDATE][ca]||null!=sa[xa][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(sa[xa][EditorUi.DIFF_REMOVE],ca)){f.refreshBackgroundImage();break}}}));var ia=f.getBackgroundImageObject;f.getBackgroundImageObject=
-function(ca,sa,xa){var qa=ia.apply(this,arguments);null!=qa&&null!=qa.originalSrc&&(qa=sa?c.createImageForPageLink(qa.originalSrc,xa,null,!0):{src:qa.originalSrc});return qa};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var Y=
-c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(ca){ca=null!=ca?ca:"";"1"==urlParams.dev&&(ca+=(0<ca.length?"&":"?")+"dev=1");"1"==urlParams.test&&(ca+=(0<ca.length?"&":"?")+"test=1");return Y.apply(this,arguments)};var aa=f.addClickHandler;f.addClickHandler=function(ca,sa,xa){var qa=sa;sa=function(Ba,ma,ta){if(null==ma){var va=mxEvent.getSource(Ba);"a"==va.nodeName.toLowerCase()&&(ma=va.getAttribute("href"))}null!=ma&&f.isCustomLink(ma)&&(mxEvent.isTouchEvent(Ba)||!mxEvent.isPopupTrigger(Ba))&&
-f.customLinkClicked(ma,ta)&&mxEvent.consume(Ba);null!=qa&&qa(Ba,ma,ta)};aa.call(this,ca,sa,xa)};n.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var ja=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(ca,sa,xa){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(ca,["zoomIn","zoomOut","-"],null,xa);if(Editor.passiveScroll&&null!=xa){var qa=
-mxUtils.convertPoint(f.container,mxEvent.getClientX(xa),mxEvent.getClientY(xa));f._contextMenuPoint=new mxPoint(f.snap(qa.x/f.view.scale-f.view.translate.x),f.snap(qa.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(xa),mxEvent.getClientY(xa))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",ca,null),ca.addSeparator());ja.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||
-this.addMenuItems(ca,["-","addToScratchpad"],null,xa);if(0<f.getSelectionCount()&&c.commentsSupported()&&c.anchoredCommentsSupported()&&c.canComment()&&null!=this.showCommentsWindow){var Ba=f.getSelectionCells(),ma=this;ca.addSeparator();ca.addItem(mxResources.get("comment")+"...",null,function(){if(null!=c.currentPage){if(1==Ba.length)var ta=Ba[0].id;else{ta=[];for(var va=0;va<Ba.length;va++)ta.push(Ba[va].id)}ma.showCommentsWindow(null,{p:c.currentPage.getId(),c:ta})}})}f.isSelectionEmpty()&&!this.isShowStyleItems()&&
-this.addMenuItems(ca,["-","exitGroup","home"],null,xa)};var ka=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(ca,sa,xa){if(c.editor.graph.isSelectionEmpty())ka.apply(this,arguments),c.menus.addMenuItems(ca,["copyAsImage","copyAsSvg"],null,xa);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(ca,sa,xa):this.addPopupMenuArrangeItems(ca,sa,xa),this.addMenuItems(ca,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,xa),Editor.passiveScroll&&(1==f.getSelectionCount()?
-this.addMenuItems(ca,["-","copyStyle","pasteStyle","copyTextStyle","pasteTextStyle"],null,xa):this.addMenuItems(ca,["-","pasteStyle","pasteTextStyle"],null,xa)),this.addMenuItems(ca,["-"],null,xa),this.isShowCellEditItems()||this.addPopupDeleteItem(ca,sa,xa),this.addMenuItems(ca,["lockUnlock","-"],null,xa),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(sa)&&f.isCellEditable(sa)&&(this.addSubmenu("editCell",ca,null,mxResources.get("edit")),ca.addSeparator(),f.getModel().isEdge(sa))){this.addSubmenu("line",
-ca);var qa=f.getModel().getGeometry(sa);null!=qa&&null!=qa.points&&0<qa.points.length&&this.addMenuItems(ca,["clearWaypoints"],null,xa)}1==f.getSelectionCount()&&this.addMenuItems(ca,["enterGroup"],null,xa);qa=c.getSelectionState();null!=qa.mergeCell?this.addMenuItem(ca,"mergeCells"):(1<qa.style.colspan||1<qa.style.rowspan)&&this.addMenuItem(ca,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=
+ta.value=Ba?"plantUmlImage":"plantUmlDiagram";var va=new SimpleTextareaDialog(c,qa.data,function(Ga){if(null!=Ga&&c.spinner.spin(document.body,mxResources.get("inserting"))){var La="plantUmlImage"==ta.value,Ia=ma?qa.config:null;c.parsePlantUmlDiagram(Ga,Ia,function(Ca,Pa){c.spinner.stop();va.hide();try{f.getModel().beginUpdate();try{if(Ba&&La)c.updateMermaidImage(ba,Ga,null,Ca,c.getMermaidImageBorder(ba,qa.border),"plantUmlData");else if(ma&&!La)c.replaceLockedGroupChildren(ba,Ca,Ga,Ia,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,
+dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var Ka=c.getMermaidImageBorder(ba,qa.border),Na=c.replaceMermaidCell(ba,La?c.createMermaidImageXml(Ga,null,Ca,null,Ka,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(Ca,Ga,Ia));La||null==Ka||f.setCellStyles("groupPadding",Ka,Na)}}finally{f.getModel().endUpdate()}c.showPlantUmlWarnings(Pa)}catch(Oa){c.handleError(Oa)}},function(Ca){c.spinner.stop();c.handleError(Ca)})}},null,null,sa?ta:null,!0,null==c.sidebar?null:function(Ga,La){c.spinner.spin(document.body,
+mxResources.get("loading"))&&c.parsePlantUmlDiagram(Ga,ma?qa.config:null,function(Ia,Ca){c.spinner.stop();c.showPreviewTooltip(Ia,La);c.showPlantUmlWarnings(Ca)},function(Ia){c.spinner.stop();c.handleError(Ia)})});K(va)};f.cellEditor.editMermaidData=function(ba,sa,xa){var qa=JSON.parse(xa);sa=f.getCurrentCellStyle(ba);var Ba=mxUtils.getValue(sa,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,ma=Ba&&null==qa.config;sa="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var ta=document.createElement("select");
+ta.className="geBtn";xa=document.createElement("option");xa.setAttribute("value","mermaid");mxUtils.write(xa,mxResources.get("diagram"));ta.appendChild(xa);xa=document.createElement("option");xa.setAttribute("value","mermaidImage");mxUtils.write(xa,mxResources.get("image"));ta.appendChild(xa);ta.value=Ba?"mermaidImage":"mermaid";var va=new SimpleTextareaDialog(c,qa.data,function(Ga){if(null!=Ga&&c.spinner.spin(document.body,mxResources.get("inserting"))){var La="mermaidImage"==ta.value;if(La&&ma){var Ia=
+EditorUi.legacyMermaidConfig;var Ca=null}else Ca=Ia=null!=qa.config?qa.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(Ga,mxUtils.clone(Ia),function(Pa){c.spinner.stop();va.hide();try{f.getModel().beginUpdate();try{if(Ba&&La)c.updateMermaidImage(ba,Ga,Ca,Pa,c.getMermaidImageBorder(ba,qa.border));else if(Ba||La){var Ka=c.getMermaidImageBorder(ba,qa.border),Na=c.replaceMermaidCell(ba,La?c.createMermaidImageXml(Ga,Ca,Pa,null,Ka):mxMermaidToDrawio.wrapGroup(Pa,Ga,Ca));La||null==Ka||f.setCellStyles("groupPadding",
+Ka,Na)}else c.replaceLockedGroupChildren(ba,Pa,Ga,Ca)}finally{f.getModel().endUpdate()}}catch(Oa){c.handleError(Oa)}},function(Pa){c.spinner.stop();c.handleError(Pa)})}},null,null,sa?ta:null,!0,null==c.sidebar?null:function(Ga,La){if(c.spinner.spin(document.body,mxResources.get("loading"))){var Ia="mermaidImage"==ta.value&&ma?EditorUi.legacyMermaidConfig:null!=qa.config?qa.config:EditorUi.getInsertMermaidConfig();c.parseMermaidDiagram(Ga,mxUtils.clone(Ia),function(Ca){c.spinner.stop();c.showPreviewTooltip(Ca,
+La)},function(Ca){c.spinner.stop();c.handleError(Ca)})}});K(va)};var Q=f.cellEditor.startEditing;f.cellEditor.startEditing=function(ba,sa,xa){try{var qa=this.graph.getLockedGroupAncestor(ba);null!=qa&&(ba=qa);var Ba=this.graph.getAttributeForCell(ba,"plantUmlData");if(null!=Ba)this.editPlantUmlData(ba,sa,Ba);else if(Ba=this.graph.getAttributeForCell(ba,"mermaidData"),null!=Ba&&EditorUi.isMermaidSupported())this.editMermaidData(ba,sa,Ba);else{var ma=f.getCellStyle(ba);"1"==mxUtils.getValue(ma,"metaEdit",
+"0")?c.showDataDialog(ba):Q.call(this,ba,sa,xa)}}catch(ta){c.handleError(ta)}};f.getLinkTitle=function(ba){return c.getLinkTitle(ba)};f.customLinkClicked=function(ba,sa){var xa=!1;try{var qa=this.view.graphBounds,Ba=null!=qa?new mxRectangle(qa.x,qa.y,qa.width,qa.height):null;c.handleCustomLink(ba,sa);xa=!0;var ma=this.view.graphBounds;c.chromelessResize&&null!=Ba&&null!=ma&&!Ba.equals(ma)&&(c.chromelessResize(),this.scrollCellToVisible(sa))}catch(ta){c.handleError(ta)}return xa};var V=f.parseBackgroundImage;
+f.parseBackgroundImage=function(ba){var sa=V.apply(this,arguments);null!=sa&&null!=sa.src&&Graph.isPageLink(sa.src)&&(sa={originalSrc:sa.src});return sa};var J=f.setBackgroundImage;f.setBackgroundImage=function(ba){null!=ba&&null!=ba.originalSrc&&(ba=c.createImageForPageLink(ba.originalSrc,c.currentPage,this));J.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));
+this.editor.addListener("pagesPatched",mxUtils.bind(this,function(ba,sa){ba=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=ba){var xa=ba.indexOf(",");if(0<xa)for(ba=ba.substring(xa+1),sa=sa.getProperty("patches"),xa=0;xa<sa.length;xa++)if(null!=sa[xa][EditorUi.DIFF_UPDATE]&&null!=sa[xa][EditorUi.DIFF_UPDATE][ba]||null!=sa[xa][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(sa[xa][EditorUi.DIFF_REMOVE],ba)){f.refreshBackgroundImage();break}}}));var ia=f.getBackgroundImageObject;f.getBackgroundImageObject=
+function(ba,sa,xa){var qa=ia.apply(this,arguments);null!=qa&&null!=qa.originalSrc&&(qa=sa?c.createImageForPageLink(qa.originalSrc,xa,null,!0):{src:qa.originalSrc});return qa};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var Y=
+c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(ba){ba=null!=ba?ba:"";"1"==urlParams.dev&&(ba+=(0<ba.length?"&":"?")+"dev=1");"1"==urlParams.test&&(ba+=(0<ba.length?"&":"?")+"test=1");return Y.apply(this,arguments)};var aa=f.addClickHandler;f.addClickHandler=function(ba,sa,xa){var qa=sa;sa=function(Ba,ma,ta){if(null==ma){var va=mxEvent.getSource(Ba);"a"==va.nodeName.toLowerCase()&&(ma=va.getAttribute("href"))}null!=ma&&f.isCustomLink(ma)&&(mxEvent.isTouchEvent(Ba)||!mxEvent.isPopupTrigger(Ba))&&
+f.customLinkClicked(ma,ta)&&mxEvent.consume(Ba);null!=qa&&qa(Ba,ma,ta)};aa.call(this,ba,sa,xa)};n.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var ja=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(ba,sa,xa){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(ba,["zoomIn","zoomOut","-"],null,xa);if(Editor.passiveScroll&&null!=xa){var qa=
+mxUtils.convertPoint(f.container,mxEvent.getClientX(xa),mxEvent.getClientY(xa));f._contextMenuPoint=new mxPoint(f.snap(qa.x/f.view.scale-f.view.translate.x),f.snap(qa.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(xa),mxEvent.getClientY(xa))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",ba,null),ba.addSeparator());ja.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||
+this.addMenuItems(ba,["-","addToScratchpad"],null,xa);if(0<f.getSelectionCount()&&c.commentsSupported()&&c.anchoredCommentsSupported()&&c.canComment()&&null!=this.showCommentsWindow){var Ba=f.getSelectionCells(),ma=this;ba.addSeparator();ba.addItem(mxResources.get("comment")+"...",null,function(){if(null!=c.currentPage){if(1==Ba.length)var ta=Ba[0].id;else{ta=[];for(var va=0;va<Ba.length;va++)ta.push(Ba[va].id)}ma.showCommentsWindow(null,{p:c.currentPage.getId(),c:ta})}})}f.isSelectionEmpty()&&!this.isShowStyleItems()&&
+this.addMenuItems(ba,["-","exitGroup","home"],null,xa)};var la=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(ba,sa,xa){if(c.editor.graph.isSelectionEmpty())la.apply(this,arguments),c.menus.addMenuItems(ba,["copyAsImage","copyAsSvg"],null,xa);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(ba,sa,xa):this.addPopupMenuArrangeItems(ba,sa,xa),this.addMenuItems(ba,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,xa),Editor.passiveScroll&&(1==f.getSelectionCount()?
+this.addMenuItems(ba,["-","copyStyle","pasteStyle","copyTextStyle","pasteTextStyle"],null,xa):this.addMenuItems(ba,["-","pasteStyle","pasteTextStyle"],null,xa)),this.addMenuItems(ba,["-"],null,xa),this.isShowCellEditItems()||this.addPopupDeleteItem(ba,sa,xa),this.addMenuItems(ba,["lockUnlock","-"],null,xa),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(sa)&&f.isCellEditable(sa)&&(this.addSubmenu("editCell",ba,null,mxResources.get("edit")),ba.addSeparator(),f.getModel().isEdge(sa))){this.addSubmenu("line",
+ba);var qa=f.getModel().getGeometry(sa);null!=qa&&null!=qa.points&&0<qa.points.length&&this.addMenuItems(ba,["clearWaypoints"],null,xa)}1==f.getSelectionCount()&&this.addMenuItems(ba,["enterGroup"],null,xa);qa=c.getSelectionState();null!=qa.mergeCell?this.addMenuItem(ba,"mergeCells"):(1<qa.style.colspan||1<qa.style.rowspan)&&this.addMenuItem(ba,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=
function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}q=mxUtils.bind(this,function(){this.updateCommentOverlays()});this.addListener("commentsChanged",q);this.addListener("darkModeChanged",q);this.editor.addListener("pageSelected",q);this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){this.commentOverlays=null;this.refreshCommentCache()}));if(Editor.passiveScroll){var ua=f.getCenterInsertPoint;
-f.getCenterInsertPoint=function(ca){if(null!=this._contextMenuPoint){var sa=this._contextMenuPoint;ca=null!=ca?ca:new mxRectangle;return new mxPoint(f.snap(sa.x-(ca.width||0)/2),f.snap(sa.y-(ca.height||0)/2))}return ua.apply(this,arguments)};var Da=f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){Da.apply(this,arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=
-mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var ha=f.getExportVariables;f.getExportVariables=function(){var ca=ha.apply(this,arguments),sa=c.getCurrentFile();null!=sa&&(ca.filename=sa.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var xa in c.fileVars)null==ca[xa]&&(ca[xa]=c.fileVars[xa]);ca.pagecount=null!=c.pages?c.pages.length:1;ca.page=null!=c.currentPage?c.currentPage.getName():"";ca.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,
-c.currentPage)+1:1;return ca};var k=f.getGlobalVariable;f.getGlobalVariable=function(ca){var sa=c.getCurrentFile();if("filename"==ca&&null!=sa)return sa.getTitle();if("page"==ca&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==ca)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==ca)return null!=c.pages?c.pages.length:1;sa=k.apply(this,arguments);null==sa&&(c.updateFileVars(),null!=c.fileVars&&(sa=c.fileVars[ca]));return sa};var u=
-null,H=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var ca=this.getCurrentFile(),sa=null!=ca&&null!=ca.getTitle()?ca.getTitle():this.defaultFilename;u!=sa&&ca==H&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());u=sa;H=ca}));var P=f.labelLinkClicked;f.labelLinkClicked=function(ca,sa,xa){var qa=sa.getAttribute("href");if(null==qa||!f.isCustomLink(qa)||!mxEvent.isTouchEvent(xa)&&mxEvent.isPopupTrigger(xa))P.apply(this,arguments);else{if(!f.isEnabled()||
-null!=ca&&f.isCellLocked(ca.cell))f.customLinkClicked(qa),f.getRubberband().reset();mxEvent.consume(xa)}};this.editor.getOrCreateFilename=function(){var ca=c.defaultFilename,sa=c.getCurrentFile();null!=sa&&(ca=null!=sa.getTitle()?sa.getTitle():ca);return ca};q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);q.visible=q.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",
+f.getCenterInsertPoint=function(ba){if(null!=this._contextMenuPoint){var sa=this._contextMenuPoint;ba=null!=ba?ba:new mxRectangle;return new mxPoint(f.snap(sa.x-(ba.width||0)/2),f.snap(sa.y-(ba.height||0)/2))}return ua.apply(this,arguments)};var Da=f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){Da.apply(this,arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=
+mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var ha=f.getExportVariables;f.getExportVariables=function(){var ba=ha.apply(this,arguments),sa=c.getCurrentFile();null!=sa&&(ba.filename=sa.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var xa in c.fileVars)null==ba[xa]&&(ba[xa]=c.fileVars[xa]);ba.pagecount=null!=c.pages?c.pages.length:1;ba.page=null!=c.currentPage?c.currentPage.getName():"";ba.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,
+c.currentPage)+1:1;return ba};var k=f.getGlobalVariable;f.getGlobalVariable=function(ba){var sa=c.getCurrentFile();if("filename"==ba&&null!=sa)return sa.getTitle();if("page"==ba&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==ba)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==ba)return null!=c.pages?c.pages.length:1;sa=k.apply(this,arguments);null==sa&&(c.updateFileVars(),null!=c.fileVars&&(sa=c.fileVars[ba]));return sa};var u=
+null,H=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var ba=this.getCurrentFile(),sa=null!=ba&&null!=ba.getTitle()?ba.getTitle():this.defaultFilename;u!=sa&&ba==H&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());u=sa;H=ba}));var P=f.labelLinkClicked;f.labelLinkClicked=function(ba,sa,xa){var qa=sa.getAttribute("href");if(null==qa||!f.isCustomLink(qa)||!mxEvent.isTouchEvent(xa)&&mxEvent.isPopupTrigger(xa))P.apply(this,arguments);else{if(!f.isEnabled()||
+null!=ba&&f.isCellLocked(ba.cell))f.customLinkClicked(qa),f.getRubberband().reset();mxEvent.consume(xa)}};this.editor.getOrCreateFilename=function(){var ba=c.defaultFilename,sa=c.getCurrentFile();null!=sa&&(ba=null!=sa.getTitle()?sa.getTitle():ba);return ba};q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);q.visible=q.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",
!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,
-!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.ctrlAltActions[84]="runLastLayout",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(ca,sa){null!=sa&&f.isEnabled()&&!f.isEditing()&&null!=sa.getProperty("event")&&c.actions.get("exit").funct()})),
-this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(ca){var sa=f.cellEditor.text2,xa=null;null!=sa&&(mxEvent.addListener(sa,"dragleave",function(qa){null!=xa&&(xa.parentNode.removeChild(xa),xa=null);qa.stopPropagation();qa.preventDefault()}),mxEvent.addListener(sa,"dragover",mxUtils.bind(this,function(qa){null==
-xa&&(xa=this.highlightElement(sa));qa.stopPropagation();qa.preventDefault()})),mxEvent.addListener(sa,"drop",mxUtils.bind(this,function(qa){null!=xa&&(xa.parentNode.removeChild(xa),xa=null);if(0<qa.dataTransfer.files.length)this.importFiles(qa.dataTransfer.files,0,0,this.maxImageSize,function(ma,ta,va,Ha,La,Ia){f.insertImage(ma,La,Ia)},function(){},function(ma){return"image/"==ma.type.substring(0,6)},function(ma){for(var ta=0;ta<ma.length;ta++)ma[ta]()},mxEvent.isControlDown(qa));else if(0<=mxUtils.indexOf(qa.dataTransfer.types,
+!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.ctrlAltActions[84]="runLastLayout",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(ba,sa){null!=sa&&f.isEnabled()&&!f.isEditing()&&null!=sa.getProperty("event")&&c.actions.get("exit").funct()})),
+this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(ba){var sa=f.cellEditor.text2,xa=null;null!=sa&&(mxEvent.addListener(sa,"dragleave",function(qa){null!=xa&&(xa.parentNode.removeChild(xa),xa=null);qa.stopPropagation();qa.preventDefault()}),mxEvent.addListener(sa,"dragover",mxUtils.bind(this,function(qa){null==
+xa&&(xa=this.highlightElement(sa));qa.stopPropagation();qa.preventDefault()})),mxEvent.addListener(sa,"drop",mxUtils.bind(this,function(qa){null!=xa&&(xa.parentNode.removeChild(xa),xa=null);if(0<qa.dataTransfer.files.length)this.importFiles(qa.dataTransfer.files,0,0,this.maxImageSize,function(ma,ta,va,Ga,La,Ia){f.insertImage(ma,La,Ia)},function(){},function(ma){return"image/"==ma.type.substring(0,6)},function(ma){for(var ta=0;ta<ma.length;ta++)ma[ta]()},mxEvent.isControlDown(qa));else if(0<=mxUtils.indexOf(qa.dataTransfer.types,
"text/uri-list")){var Ba=qa.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ba)?this.loadImage(decodeURIComponent(Ba),mxUtils.bind(this,function(ma){var ta=Math.max(1,ma.width);ma=Math.max(1,ma.height);var va=this.maxImageSize;va=Math.min(1,Math.min(va/Math.max(1,ta)),va/Math.max(1,ma));f.insertImage(decodeURIComponent(Ba),ta*va,ma*va)})):document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(qa.dataTransfer.types,"text/html")?
-document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(qa.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/plain"));qa.stopPropagation();qa.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var T=mxSettings.getUnit();q.setUnit(T);Editor.pageSizeUnit=T;q.addListener("unitChanged",function(ca,sa){ca=sa.getProperty("unit");mxSettings.setUnit(ca);mxSettings.save();Editor.pageSizeUnit=
-ca});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,q.unit);this.refresh()}if("1"==urlParams.styledev){q=document.getElementById("geFooter");null!=q&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width=
-"98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(ca,sa){0<this.editor.graph.getSelectionCount()?(ca=this.editor.graph.getSelectionCell(),ca=this.editor.graph.getModel().getStyle(ca),
-this.styleInput.value=ca||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var W=this.isSelectionAllowed;this.isSelectionAllowed=function(ca){return mxEvent.getSource(ca)==this.styleInput?!0:W.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var fa=null;mxEvent.addListener(f.container,"dragleave",function(ca){f.isEnabled()&&(null!=fa&&(fa.parentNode.removeChild(fa),
-fa=null),ca.stopPropagation(),ca.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(ca){null==fa&&(fa=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();ca.stopPropagation();ca.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(ca){null!=fa&&(fa.parentNode.removeChild(fa),fa=null);if(f.isEnabled()){var sa=mxUtils.convertPoint(f.container,mxEvent.getClientX(ca),mxEvent.getClientY(ca)),xa=ca.dataTransfer.files,
-qa=f.view.translate,Ba=f.view.scale,ma=sa.x/Ba-qa.x,ta=sa.y/Ba-qa.y;if(0<xa.length)sa=this.isBlankFile()&&!this.canUndo(),qa=1==xa.length&&(EditorUi.isVisioFilename(xa[0].name)||/(\.drawio)$/i.test(xa[0].name)||/(\.xml)$/i.test(xa[0].name)),"1"!=urlParams.embed&&sa&&(qa||mxEvent.isShiftDown(ca))?(sa=this.getCurrentFile(),null!=sa&&sa.isModified()||this.fileLoaded(null,!0),this.openFiles(xa,!0,mxUtils.bind(this,function(){var Pa=this.getCurrentFile();null!=Pa&&Pa.fileChanged()}))):(mxEvent.isAltDown(ca)&&
-(ta=ma=null),this.importFiles(xa,ma,ta,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(ca),null,null,mxEvent.isShiftDown(ca),ca));else{mxEvent.isAltDown(ca)&&(ta=ma=0);var va=0<=mxUtils.indexOf(ca.dataTransfer.types,"text/uri-list")?ca.dataTransfer.getData("text/uri-list"):null;xa=this.extractGraphModelFromEvent(ca,null!=this.pages);if(null!=xa)f.setSelectionCells(this.importXml(xa,ma,ta,!0));else if(0<=mxUtils.indexOf(ca.dataTransfer.types,"text/html")){var Ha=ca.dataTransfer.getData("text/html");
-xa=document.createElement("div");xa.innerHTML=Graph.sanitizeHtml(Ha);var La=null;sa=xa.getElementsByTagName("img");null!=sa&&1==sa.length?(Ha=sa[0].getAttribute("src"),null==Ha&&(Ha=sa[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ha)||(La=!0)):(sa=xa.getElementsByTagName("a"),null!=sa&&1==sa.length?Ha=sa[0].getAttribute("href"):(xa=xa.getElementsByTagName("pre"),null!=xa&&1==xa.length&&(Ha=mxUtils.getTextContent(xa[0]))));var Ia=!0,Ca=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(Ha,
-ma,ta,!0,La,null,Ia,mxEvent.isControlDown(ca)))});La&&null!=Ha&&Ha.length>this.resampleThreshold?this.confirmImageResize(function(Pa){Ia=Pa;Ca()},mxEvent.isControlDown(ca)):Ca()}else null!=va&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(va)?this.loadImage(decodeURIComponent(va),mxUtils.bind(this,function(Pa){var Ka=Math.max(1,Pa.width);Pa=Math.max(1,Pa.height);var Na=this.maxImageSize;Na=Math.min(1,Math.min(Na/Math.max(1,Ka)),Na/Math.max(1,Pa));f.setSelectionCell(f.insertVertex(null,null,"",ma,ta,Ka*Na,
-Pa*Na,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+va+";"))}),mxUtils.bind(this,function(Pa){f.setSelectionCells(this.insertTextAt(va,ma,ta,!0))})):0<=mxUtils.indexOf(ca.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(ca.dataTransfer.getData("text/plain"),ma,ta,!0))}}ca.stopPropagation();ca.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",
+document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(qa.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,qa.dataTransfer.getData("text/plain"));qa.stopPropagation();qa.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var U=mxSettings.getUnit();q.setUnit(U);Editor.pageSizeUnit=U;q.addListener("unitChanged",function(ba,sa){ba=sa.getProperty("unit");mxSettings.setUnit(ba);mxSettings.save();Editor.pageSizeUnit=
+ba});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,q.unit);this.refresh()}if("1"==urlParams.styledev){q=document.getElementById("geFooter");null!=q&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width=
+"98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(ba,sa){0<this.editor.graph.getSelectionCount()?(ba=this.editor.graph.getSelectionCell(),ba=this.editor.graph.getModel().getStyle(ba),
+this.styleInput.value=ba||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var W=this.isSelectionAllowed;this.isSelectionAllowed=function(ba){return mxEvent.getSource(ba)==this.styleInput?!0:W.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var fa=null;mxEvent.addListener(f.container,"dragleave",function(ba){f.isEnabled()&&(null!=fa&&(fa.parentNode.removeChild(fa),
+fa=null),ba.stopPropagation(),ba.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(ba){null==fa&&(fa=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();ba.stopPropagation();ba.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(ba){null!=fa&&(fa.parentNode.removeChild(fa),fa=null);if(f.isEnabled()){var sa=mxUtils.convertPoint(f.container,mxEvent.getClientX(ba),mxEvent.getClientY(ba)),xa=ba.dataTransfer.files,
+qa=f.view.translate,Ba=f.view.scale,ma=sa.x/Ba-qa.x,ta=sa.y/Ba-qa.y;if(0<xa.length)sa=this.isBlankFile()&&!this.canUndo(),qa=1==xa.length&&(EditorUi.isVisioFilename(xa[0].name)||/(\.drawio)$/i.test(xa[0].name)||/(\.xml)$/i.test(xa[0].name)),"1"!=urlParams.embed&&sa&&(qa||mxEvent.isShiftDown(ba))?(sa=this.getCurrentFile(),null!=sa&&sa.isModified()||this.fileLoaded(null,!0),this.openFiles(xa,!0,mxUtils.bind(this,function(){var Pa=this.getCurrentFile();null!=Pa&&Pa.fileChanged()}))):(mxEvent.isAltDown(ba)&&
+(ta=ma=null),this.importFiles(xa,ma,ta,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(ba),null,null,mxEvent.isShiftDown(ba),ba));else{mxEvent.isAltDown(ba)&&(ta=ma=0);var va=0<=mxUtils.indexOf(ba.dataTransfer.types,"text/uri-list")?ba.dataTransfer.getData("text/uri-list"):null;xa=this.extractGraphModelFromEvent(ba,null!=this.pages);if(null!=xa)f.setSelectionCells(this.importXml(xa,ma,ta,!0));else if(0<=mxUtils.indexOf(ba.dataTransfer.types,"text/html")){var Ga=ba.dataTransfer.getData("text/html");
+xa=document.createElement("div");xa.innerHTML=Graph.sanitizeHtml(Ga);var La=null;sa=xa.getElementsByTagName("img");null!=sa&&1==sa.length?(Ga=sa[0].getAttribute("src"),null==Ga&&(Ga=sa[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ga)||(La=!0)):(sa=xa.getElementsByTagName("a"),null!=sa&&1==sa.length?Ga=sa[0].getAttribute("href"):(xa=xa.getElementsByTagName("pre"),null!=xa&&1==xa.length&&(Ga=mxUtils.getTextContent(xa[0]))));var Ia=!0,Ca=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(Ga,
+ma,ta,!0,La,null,Ia,mxEvent.isControlDown(ba)))});La&&null!=Ga&&Ga.length>this.resampleThreshold?this.confirmImageResize(function(Pa){Ia=Pa;Ca()},mxEvent.isControlDown(ba)):Ca()}else null!=va&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(va)?this.loadImage(decodeURIComponent(va),mxUtils.bind(this,function(Pa){var Ka=Math.max(1,Pa.width);Pa=Math.max(1,Pa.height);var Na=this.maxImageSize;Na=Math.min(1,Math.min(Na/Math.max(1,Ka)),Na/Math.max(1,Pa));f.setSelectionCell(f.insertVertex(null,null,"",ma,ta,Ka*Na,
+Pa*Na,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+va+";"))}),mxUtils.bind(this,function(Pa){f.setSelectionCells(this.insertTextAt(va,ma,ta,!0))})):0<=mxUtils.indexOf(ba.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(ba.dataTransfer.getData("text/plain"),ma,ta,!0))}}ba.stopPropagation();ba.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",
mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||
-null==c.embedViewport)mxUtils.fit(this.div);else{var ca=parseInt(this.div.offsetLeft),sa=parseInt(this.div.offsetWidth),xa=c.embedViewport.x+c.embedViewport.width,qa=parseInt(this.div.offsetTop),Ba=parseInt(this.div.offsetHeight),ma=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(ca,xa-sa))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(qa,ma-Ba))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+
-"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var X=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(ca,sa){X.call(this,ca,sa);c.hideCurrentMenu()};var ea=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(ca,sa){ea.call(this,ca,sa);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():
-(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=T)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();"kennedy"==q&&(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),T<Editor.smallScreenWidth-240&&
-(this.hsplitPosition=0),this.lastWindowWidth=T)}q=!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(this.isAutoDarkModeSupported())try{var oa=window.matchMedia("(prefers-color-scheme: dark)"),
-la=mxUtils.bind(this,function(ca){this.isAutoDarkMode()&&this.setDarkMode(ca.matches)});oa.addEventListener("change",la);this.destroyFunctions.push(function(){oa.removeEventListener("change",la)})}catch(ca){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&
-this.setHighContrast(!0);Editor.isSettingsEnabled()&&null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages);this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(ca,sa){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};
+null==c.embedViewport)mxUtils.fit(this.div);else{var ba=parseInt(this.div.offsetLeft),sa=parseInt(this.div.offsetWidth),xa=c.embedViewport.x+c.embedViewport.width,qa=parseInt(this.div.offsetTop),Ba=parseInt(this.div.offsetHeight),ma=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(ba,xa-sa))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(qa,ma-Ba))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+
+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var X=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(ba,sa){X.call(this,ba,sa);c.hideCurrentMenu()};var ea=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(ba,sa){ea.call(this,ba,sa);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():
+(U=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,U<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&U<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=U)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();"kennedy"==q&&(U=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,U<Editor.smallScreenWidth&&(this.formatWidth=0),U<Editor.smallScreenWidth-240&&
+(this.hsplitPosition=0),this.lastWindowWidth=U)}q=!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(this.isAutoDarkModeSupported())try{var oa=window.matchMedia("(prefers-color-scheme: dark)"),
+ka=mxUtils.bind(this,function(ba){this.isAutoDarkMode()&&this.setDarkMode(ba.matches)});oa.addEventListener("change",ka);this.destroyFunctions.push(function(){oa.removeEventListener("change",ka)})}catch(ba){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&
+this.setHighContrast(!0);Editor.isSettingsEnabled()&&null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages);this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(ba,sa){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};
var y=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));f=Editor.smallScreenWidth-
160;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,
q=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(V){mxEvent.getSource(V)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(V),mxEvent.getClientY(V)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var x=document.createElement("div");x.style.position="absolute";x.style.width="10px";x.style.height="10px";x.style.borderRadius="5px";x.style.border="1px solid gray";x.style.background=
@@ -4575,80 +4577,80 @@ q=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagra
A=mxEvent.getClientX(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(V){var J=!1;null!=A&&(this.diagramContainer.style.width=Math.max(20,K+mxEvent.getClientX(V)-A)+"px",J=!0);null!=E&&(this.diagramContainer.style.height=Math.max(20,Q+mxEvent.getClientY(V)-E)+"px",J=!0);J&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),
"*"),this.inlineSizeChanged(),this.refresh())}),function(V){null==A&&null==E||mxEvent.consume(V);E=A=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(V){this.inlineSizeChanged();
Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(V){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=
-function(){function c(){window.setTimeout(function(){l.innerHTML="&nbsp;";l.focus();try{var A=document.createRange();A.selectNodeContents(l);var E=window.getSelection();null!=E&&(E.removeAllRanges(),E.addRange(A))}catch(K){}},0)}var f=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";
-l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position="absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML="&nbsp;";this.clipboardElt=l;var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,
-null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(A){var E=mxEvent.getSource(A);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==E.nodeName||"TEXTAREA"==E.nodeName&&E!==this.typingShim||"true"==E.contentEditable||224!=A.keyCode&&(mxClient.IS_MAC||17!=A.keyCode)&&(!mxClient.IS_MAC||91!=A.keyCode&&93!=A.keyCode)||q||(l.style.left=f.container.scrollLeft+10+"px",l.style.top=f.container.scrollTop+10+"px",A=f.container.scrollLeft,E=f.container.scrollTop,
-f.container.appendChild(l),q=!0,l.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=A,f.container.scrollTop=E)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(A){var E=A.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=E&&17!=E&&91!=E&&93!=E||(q=!1,l.parentNode.removeChild(l),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,
-function(A){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(l,"cut",mxUtils.bind(this,function(A){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(A){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML="&nbsp;",l.focus(),null!=A.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(A,
-l,!0,!0)),!mxEvent.isConsumed(A)){var E=f.container.scrollLeft,K=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=E,f.container.scrollTop=K,Graph.removePasteFormatting(l.firstChild),this.pasteCells(A,l,!1,!0)}catch(Q){this.handleError(Q)}}),0)}}catch(Q){this.handleError(Q)}}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(A){return mxEvent.getSource(A)==l?!0:x.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);
-(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),
-Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return l};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,q=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,q-=this.embedViewport.y):(l+=this.embedViewport.x,q+=this.embedViewport.y));
-f={x:l,y:q,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var q=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-q.x;c.y-=c.boundingRect.y-q.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=
-null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var q=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?
-this.statusContainer.firstChild:null;f=null!=q&&null!=q.getAttribute("class");if(!f&&null!=q){q=q.getAttribute("title");var x=this.getCurrentFile();x=null!=x?x.savingStatusKey:DrawioFile.prototype.savingStatusKey;q==mxResources.get(x)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(x))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";q=32>=c.clientWidth;c.style.visibility=q&&""==this.editor.getStatus()?"hidden":
-"";if(q||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);
-this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=
-this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&
-(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),
-this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.restoreVisibleWindows=function(){if(Editor.isSettingsEnabled()){var c=
-{layers:"layers",outline:"outline",tags:"tags"},f;for(f in c){var l=mxSettings.getWindowState(f);null!=l&&l.visible&&(l=this.actions.get(c[f]),null!=l&&l.funct())}}};EditorUi.prototype.saveWindowState=function(c,f){f=f.window;var l=f.minimized&&null!=f.height?parseInt(f.height):parseInt(f.div.style.height);mxSettings.setWindowState(c,{x:f.getX(),y:f.getY(),w:parseInt(f.div.style.width),h:l,visible:f.isVisible(),minimized:f.minimized||!1,dockState:f.dockState||null,dockAnchorRight:f._dockAnchorRight||
-null,dockAnchorBottom:f._dockAnchorBottom||null,dockOffsetX:f._dockOffsetX||null,dockOffsetY:f._dockOffsetY||null});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=
-c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,f.div.classList.add("mxWindowDocked"),this.dockManager.windows.push(f),this.dockManager.pinToEdge(f));f.fit();null!=c.visible&&f.setVisible(c.visible);c.minimized&&!f.minimized&&f.toggleMinimized();return c};EditorUi.prototype.installWindowPersistence=function(c,f){var l=this,q=f.window,x=function(){l.saveWindowState(c,f)};q.addListener(mxEvent.MOVE_END,x);q.addListener(mxEvent.RESIZE_END,x);q.addListener(mxEvent.SHOW,
-x);q.addListener(mxEvent.HIDE,x);q.addListener(mxEvent.DOCK,x);q.addListener(mxEvent.UNDOCK,x);q.addListener(mxEvent.MAXIMIZE,x);q.addListener(mxEvent.MINIMIZE,x);q.addListener(mxEvent.NORMALIZE,x)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,l){var q=this.threshold,x=c<=q;c=c+l.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-q;var A=f<=q;f=f+l.offsetHeight>=
-(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-q;return x&&A?"top-left":c&&A?"top-right":x&&f?"bottom-left":c&&f?"bottom-right":x?"left":c?"right":A?"top":f?"bottom":null},dock:function(c,f){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),A=parseInt(c.div.style.height),E=c.getX(),K=c.getY();c.dockState=
-f;c.div.classList.add("mxWindowDocked");var Q=0<=f.indexOf("right"),V=0<=f.indexOf("bottom");0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=l-x);0<=f.indexOf("top")?K=0:0<=f.indexOf("bottom")&&(K=q-A);Q||(Q=E+x/2>l/2);V||(V=K+A/2>q/2);c._dockAnchorRight=Q;c._dockAnchorBottom=V;c._dockOffsetX=Q?l-E-x:E;c._dockOffsetY=V?q-K-A:K;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===
-c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),A=parseInt(c.div.style.height);
-var E=c._dockAnchorRight?l-x-(c._dockOffsetX||0):c._dockOffsetX||0;var K=c._dockAnchorBottom?q-A-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=l-x);0<=f.indexOf("top")?K=0:0<=f.indexOf("bottom")&&(K=q-A);E=Math.max(0,Math.min(E,l-x));K=Math.max(0,Math.min(K,q-A));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,E,K);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,
-f){null==this.previewElement&&(this.previewElement=document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=this.previewElement,A=f.div.offsetWidth,E=f.div.offsetHeight,K=f.getX();f=f.getY();0<=c.indexOf("left")?K=0:0<=c.indexOf("right")&&(K=l-A);0<=c.indexOf("top")?
-f=0:0<=c.indexOf("bottom")&&(f=q-E);K=Math.max(0,Math.min(K,l-A));f=Math.max(0,Math.min(f,q-E));x.style.display="block";x.style.left=K+"px";x.style.top=f+"px";x.style.width=A+"px";x.style.height=E+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&
-(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var C=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,l){C.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var q=c.window;null==this.dockManager&&this.createDockManager();
-var x=this.dockManager,A=!1,E=null,K=q.setLocation;q.setLocation=function(J,ia){(null==this.dockState||this._undocking||this._relayouting)&&K.call(this,J,ia)};var Q=q.setSize;q.setSize=function(J,ia){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,J,ia);J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;ia=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var Y=parseInt(this.div.style.width),aa=parseInt(this.div.style.height),
-ja=this.getX(),ka=this.getY();this._dockOffsetX=this._dockAnchorRight?J-ja-Y:ja;this._dockOffsetY=this._dockAnchorBottom?ia-ka-aa:ka;x.pinToEdge(this)}else Q.call(this,J,ia)};q.addListener(mxEvent.MOVE_START,function(J,ia){A=!0;E=null;null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.MOVE,function(J,ia){A&&(J=x.getDockZone(q.getX(),q.getY(),q.div),J!=E&&(E=J,null!=J?x.showPreview(J,q):x.hidePreview()))});q.addListener(mxEvent.MOVE_END,function(J,ia){A=!1;x.hidePreview();
-null!=E&&x.dock(q,E);E=null});q.addListener(mxEvent.DOCK,function(J,ia){if(null!=q.resize){J=ia.getProperty("side");var Y=0<=J.indexOf("right"),aa=0<=J.indexOf("bottom");if(Y||aa){J=q.resize;J.parentNode.removeChild(J);q.resize=null;J=document.createElement("img");J.style.position="absolute";J.style.zIndex="2";J.setAttribute("src",mxWindow.prototype.resizeImage);Y?J.style.left="0px":J.style.right="0px";aa?J.style.top="0px":J.style.bottom="0px";J.style.cursor=Y!=aa?"nesw-resize":"nwse-resize";var ja=
-null,ka=null,ua=null,Da=null,ha=function(u){if(null!=ja&&null!=ka){var H=mxEvent.getClientX(u)-ja,P=mxEvent.getClientY(u)-ka;q.setSize(Y?ua-H:ua+H,aa?Da-P:Da+P);q.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",u));mxEvent.consume(u)}},k=function(u){null!=ja&&null!=ka&&(ka=ja=null,mxEvent.removeGestureListeners(document,null,ha,k),q.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",u)),mxEvent.consume(u))};mxEvent.addGestureListeners(J,function(u){q.activate();ja=mxEvent.getClientX(u);ka=
-mxEvent.getClientY(u);ua=q.div.offsetWidth;Da=q.div.offsetHeight;mxEvent.addGestureListeners(document,null,ha,k);q.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",u));mxEvent.consume(u)},ha,k);q.div.appendChild(J);q.resize=J;q._dockResize=!0}}});q.addListener(mxEvent.UNDOCK,function(J,ia){q._dockResize&&(null!=q.resize&&(q.resize.parentNode.removeChild(q.resize),q.resize=null),q.setResizable(!0),q._dockResize=!1)});q.addListener(mxEvent.NORMALIZE,function(J,ia){null!=q.dockState&&x.pinToEdge(q)});
-q.addListener(mxEvent.MAXIMIZE,function(J,ia){null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.SHOW,function(J,ia){null!=q.dockState&&x.pinToEdge(q)});var V=c.destroy;c.destroy=function(){x.removeWindow(q);V.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var f=this.editor.graph;f.defaultEdgeLength=Graph.prototype.defaultEdgeLength;f.defaultGridEnabled=Graph.prototype.defaultGridEnabled;f.defaultPageVisible=Graph.prototype.defaultPageVisible;
-null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)f.defaultEdgeLength=120;null==urlParams.grid&&(f.defaultGridEnabled=!1);null==urlParams.pv&&(f.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};
-EditorUi.prototype.isThemeMenuVisible=function(){return("1"!=urlParams.embed||"1"==urlParams.themes&&null==urlParams.ui&&"1"!=urlParams.sketch)&&"1"!=urlParams.extAuth&&this.mode!=App.MODE_ATLAS};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=
-mxResources.get("offline");else{var f=this.getCurrentFile();null!=f&&(f.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==f.sync||f.sync.enabled&&f.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==f.sync||f.sync.isConnected()?f.isRealtimeEnabled()&&f.isRealtimeSupported()&&1<f.getRealtimeState()&&(c=f.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):
-c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&
-null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,l,q){l=null!=l?l:"geButton";var x=this.menus.get(c);q=this.menubar.addMenu(mxResources.get(c),x.funct,null,q);q.className=l;q.setAttribute("title",mxResources.get(c));this.menus.menuCreated(x,q,l);null!=f&&(q.style.backgroundImage="url("+f+")",q.innerText="");return q};EditorUi.prototype.addButton=function(c,f,l,q){c=this.createToolbarButton(c,
-f,l);q=null!=q?q:this.container;q.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,l){var q=document.createElement("a");q.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(q.style.backgroundImage="url("+c+")");null!=f&&q.setAttribute("title",f);null!=l&&mxEvent.addListener(q,"click",function(x){"disabled"!=q.getAttribute("disabled")&&l(x);mxEvent.consume(x)});mxEvent.preventDefault(q);return q};EditorUi.prototype.createMenuItem=function(c,f,l){var q=this.actions.get(c),
-x=null!=q?q.funct:null,A=this.createToolbarButton(f,mxResources.get(c)+(null!=q&&null!=q.shortcut?" ("+q.shortcut+")":""),x);null==q||l||(c=function(){q.isEnabled()?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),q.addListener("stateChanged",c),c());return A};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),l=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-
-256),q=null!=f&&null!=f.y?f.y:60,x=null!=f&&null!=f.w?f.w:240,A=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),l,q,x,A,mxUtils.bind(this,function(Q){Q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var E=
-this.formatWindow.window.toggleMinimized,K=x;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(K=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+K-140+"px"):(this.div.style.width=K+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-K+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,
-"dblclick",mxUtils.bind(this,function(Q){mxEvent.getSource(Q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var Q=window.innerWidth||document.documentElement.clientWidth||
-document.body.clientWidth,V=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>Q||690>V)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var O=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):O.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=
-function(c,f){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var q=this.hsplitPosition,x=mxUtils.bind(this,function(){this.hsplitPosition=A;this.refresh();f||(this.diagramContainer.scrollLeft-=q-this.hsplitPosition)}),A=c?l:0,E=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==A?"translateX(0)":"translateX(-100%)");0!=A&&x();window.setTimeout(mxUtils.bind(this,
-function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==A?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+E+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,
-"transform-origin",null);0==A&&x();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*E)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var F=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():F.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(E,K){var Q=this.menus.get(E);E=this.createMenuElement(K,
-mxUtils.bind(this,function(){Q.funct.apply(this,arguments)}));E.setAttribute("title",K);E.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";E.className="geButton";c.parentNode.appendChild(E);return E});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",
-f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=f("newLibrary","");l.style.left="0px";l.style.right="50%";var q=document.createElement("span");l.appendChild(q);
-var x=f("openLibraryFrom","");x.style.borderLeftWidth="1px";x.style.left="50%";x.style.right="0px";var A=document.createElement("span");x.appendChild(A);this.dependsOnLanguage(mxUtils.bind(this,function(){q.innerHTML="";mxUtils.write(q,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));A.innerHTML="";mxUtils.write(A,mxResources.get("openLibraryFrom"));x.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow=
-"hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)-6,l=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650))-6,q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=null!=c&&null!=c.x?c.x:q&&"1"!=urlParams.embedInline?66:10;q=null!=c&&null!=c.y?c.y:q&&"1"!=urlParams.embedInline?
-Math.max(30,(this.diagramContainer.parentNode.clientHeight-l)/2):56;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),x,q,f,l,mxUtils.bind(this,function(A){this.createShapesPanel(A)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.installWindowPersistence("shapes",this.sidebarWindow);null!=c?this.restoreWindowState("shapes",this.sidebarWindow):
-this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&
-"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();for(this.updateOfflineLanguages();null!=this.dialog;){var f=this.dialog;this.hideDialog(!0);if(this.dialog==f)break}this.fireEvent(new mxEventObject("languageChanged"));
-null==this.getCurrentFile()&&"function"===typeof this.showSplash&&this.showSplash()})))};EditorUi.prototype.getOfflineLanguages=function(c){try{if("undefined"!==typeof caches){caches.keys().then(function(f){for(var l=[],q=0;q<f.length;q++)"workbox-precache-v2"==f[q].substring(0,19)&&l.push(caches.open(f[q]).then(function(x){return x.keys()}));return Promise.all(l)}).then(function(f){for(var l=Object.create(null),q=!1,x=0;x<f.length;x++)for(var A=0;A<f[x].length;A++){var E=/\/resources\/dia(?:_([a-z0-9-]+))?\.txt$/.exec((new URL(f[x][A].url)).pathname);
-null!=E&&(null!=E[1]?l[E[1]]=!0:q=!0)}f=Object.keys(l).sort();c(null!=f?f:[],1==q)})["catch"](function(){c([],!1)});return}}catch(f){}c([],!1)};EditorUi.prototype.updateOfflineLanguages=function(){this.getOfflineLanguages(mxUtils.bind(this,function(c,f){var l=Object.create(null);f&&(l.en=!0);for(f=0;f<c.length;f++)l[c[f]]=!0;this.offlineLanguages=l}))};EditorUi.prototype.removeOfflineLanguage=function(c,f){try{if("undefined"!==typeof caches&&/^[a-z0-9-]+$/.test(c)){caches.keys().then(function(l){for(var q=
-[],x=0;x<l.length;x++)"workbox-precache-v2"==l[x].substring(0,19)&&q.push(caches.open(l[x]).then(function(A){return A.keys().then(function(E){return Promise.all(E.filter(function(K){return(new URL(K.url)).pathname.endsWith("/resources/dia_"+c+".txt")}).map(function(K){return A.delete(K)}))})}));return Promise.all(q)}).then(mxUtils.bind(this,function(){this.updateOfflineLanguages();f()}))["catch"](function(){f()});return}}catch(l){}f()};EditorUi.prototype.isLanguageAvailableOffline=function(c){return!1!==
-navigator.onLine||null==this.offlineLanguages||1!=this.offlineLanguages.en||""==c||"en"==c||1==this.offlineLanguages[c]};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=
-c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var f=document.getElementById("high-contrast-stylesheet");if(null!=f&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,q=f.getAttribute("media");(q="all"==q||
-"not all"!=q&&l)&&!c?f.setAttribute("media",l?"not all":"(forced-colors: active)"):!q&&c&&f.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var f=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));
-c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-f.x;this.diagramContainer.scrollTop+=c.x-f.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||
-null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=
-c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),
-(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&
-(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var q=this.diagramContainer.getAttribute("data-bounds");if(null!=
-q){this.diagramContainer.removeAttribute("data-bounds");var x=q.split(" ");q=mxUtils.getDocumentSize();this.diagramContainer.style.top=x[0];this.diagramContainer.style.left=x[1];var A=parseInt(x[2]);x=parseInt(x[3]);A=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,A):A,q.width-80);x=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,x):x,q.height-80);this.diagramContainer.style.width=A+"px";this.diagramContainer.style.height=x+"px";this.diagramContainer.style.bottom=
-"";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-
-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+
-(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;q="1"==urlParams.embedInline&&Editor.passiveScroll;f.style.visibility=q?"hidden":"";c.style.visibility=q?"hidden":"";l.style.display=q?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};
-EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-
-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved=
-"1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=
-urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",
-c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle();this.restorePersistedEdgeStyle()};EditorUi.prototype.restorePersistedEdgeStyle=
+function(){function c(){window.setTimeout(function(){l.innerHTML="&nbsp;";l.focus();try{var A=document.createRange();A.selectNodeContents(l);var E=window.getSelection();null!=E&&(E.removeAllRanges(),E.addRange(A))}catch(K){}},0)}var f=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");this.isVirtualKeyboardDevice()&&l.setAttribute("inputmode","none");
+l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position="absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1px";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML="&nbsp;";this.clipboardElt=l;var q=!1;this.keyHandler.bindControlKey(88,
+null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(A){var E=mxEvent.getSource(A);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==E.nodeName||"TEXTAREA"==E.nodeName&&E!==this.typingShim||"true"==E.contentEditable||224!=A.keyCode&&(mxClient.IS_MAC||17!=A.keyCode)&&(!mxClient.IS_MAC||91!=A.keyCode&&93!=A.keyCode)||q||(l.style.left=f.container.scrollLeft+10+
+"px",l.style.top=f.container.scrollTop+10+"px",A=f.container.scrollLeft,E=f.container.scrollTop,f.container.appendChild(l),q=!0,l.focus({preventScroll:!0}),document.execCommand("selectAll",!1,null),f.container.scrollLeft=A,f.container.scrollTop=E)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(A){var E=A.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=E&&17!=E&&91!=E&&93!=E||(q=!1,l.parentNode.removeChild(l),f.isEditing()||null!=this.dialog||null==f.container||
+f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(A){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(l,"cut",mxUtils.bind(this,function(A){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(A){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML=
+"&nbsp;",l.focus(),null!=A.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(A,l,!0,!0)),!mxEvent.isConsumed(A)){var E=f.container.scrollLeft,K=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=E,f.container.scrollTop=K,Graph.removePasteFormatting(l.firstChild),this.pasteCells(A,l,!1,!0)}catch(Q){this.handleError(Q)}}),0)}}catch(Q){this.handleError(Q)}}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(A){return mxEvent.getSource(A)==
+l?!0:x.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&
+"simple"==c||c==Editor.currentTheme;if(l||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return l};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,q=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?
+(l-=this.embedViewport.x,q-=this.embedViewport.y):(l+=this.embedViewport.x,q+=this.embedViewport.y));f={x:l,y:q,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var q=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-q.x;c.y-=c.boundingRect.y-q.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*f;
+this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var l=mxUtils.bind(this,function(){if("sketch"==
+Editor.currentTheme){var q=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=q&&null!=q.getAttribute("class");if(!f&&null!=q){q=q.getAttribute("title");var x=this.getCurrentFile();x=null!=x?x.savingStatusKey:DrawioFile.prototype.savingStatusKey;q==mxResources.get(x)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(x))+'..."src="'+Editor.tailSpin+'"></div>',
+f=!0)}this.statusContainer.style.display="none";q=32>=c.clientWidth;c.style.visibility=q&&""==this.editor.getStatus()?"hidden":"";if(q||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",l);l()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();
+this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,
+this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),
+this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=
+this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,
+"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.restoreVisibleWindows=function(){if(Editor.isSettingsEnabled()){var c={layers:"layers",outline:"outline",tags:"tags"},f;for(f in c){var l=mxSettings.getWindowState(f);null!=l&&l.visible&&(l=this.actions.get(c[f]),null!=l&&l.funct())}}};EditorUi.prototype.saveWindowState=function(c,f){f=f.window;var l=f.minimized&&null!=f.height?parseInt(f.height):parseInt(f.div.style.height);mxSettings.setWindowState(c,{x:f.getX(),
+y:f.getY(),w:parseInt(f.div.style.width),h:l,visible:f.isVisible(),minimized:f.minimized||!1,dockState:f.dockState||null,dockAnchorRight:f._dockAnchorRight||null,dockAnchorBottom:f._dockAnchorBottom||null,dockOffsetX:f._dockOffsetX||null,dockOffsetY:f._dockOffsetY||null});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,
+c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,f.div.classList.add("mxWindowDocked"),this.dockManager.windows.push(f),this.dockManager.pinToEdge(f));f.fit();null!=c.visible&&f.setVisible(c.visible);c.minimized&&!f.minimized&&f.toggleMinimized();return c};EditorUi.prototype.installWindowPersistence=function(c,
+f){var l=this,q=f.window,x=function(){l.saveWindowState(c,f)};q.addListener(mxEvent.MOVE_END,x);q.addListener(mxEvent.RESIZE_END,x);q.addListener(mxEvent.SHOW,x);q.addListener(mxEvent.HIDE,x);q.addListener(mxEvent.DOCK,x);q.addListener(mxEvent.UNDOCK,x);q.addListener(mxEvent.MAXIMIZE,x);q.addListener(mxEvent.MINIMIZE,x);q.addListener(mxEvent.NORMALIZE,x)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,l){var q=
+this.threshold,x=c<=q;c=c+l.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-q;var A=f<=q;f=f+l.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-q;return x&&A?"top-left":c&&A?"top-right":x&&f?"bottom-left":c&&f?"bottom-right":x?"left":c?"right":A?"top":f?"bottom":null},dock:function(c,f){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||
+document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),A=parseInt(c.div.style.height),E=c.getX(),K=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var Q=0<=f.indexOf("right"),V=0<=f.indexOf("bottom");0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=l-x);0<=f.indexOf("top")?K=0:0<=f.indexOf("bottom")&&(K=q-A);Q||(Q=E+x/2>l/2);V||(V=K+A/2>q/2);c._dockAnchorRight=Q;c._dockAnchorBottom=V;c._dockOffsetX=Q?l-E-x:E;c._dockOffsetY=V?q-K-A:K;this.windows.push(c);
+this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var l=window.innerWidth||document.documentElement.clientWidth||
+document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),A=parseInt(c.div.style.height);var E=c._dockAnchorRight?l-x-(c._dockOffsetX||0):c._dockOffsetX||0;var K=c._dockAnchorBottom?q-A-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=l-x);0<=f.indexOf("top")?K=0:0<=f.indexOf("bottom")&&(K=q-A);E=Math.max(0,Math.min(E,l-x));K=Math.max(0,Math.min(K,q-A));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,
+E,K);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,f){null==this.previewElement&&(this.previewElement=document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=this.previewElement,
+A=f.div.offsetWidth,E=f.div.offsetHeight,K=f.getX();f=f.getY();0<=c.indexOf("left")?K=0:0<=c.indexOf("right")&&(K=l-A);0<=c.indexOf("top")?f=0:0<=c.indexOf("bottom")&&(f=q-E);K=Math.max(0,Math.min(K,l-A));f=Math.max(0,Math.min(f,q-E));x.style.display="block";x.style.left=K+"px";x.style.top=f+"px";x.style.width=A+"px";x.style.height=E+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===
+c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var C=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,l){C.apply(this,arguments);
+if(EditorUi.windowed&&Editor.enableWindowDocking){var q=c.window;null==this.dockManager&&this.createDockManager();var x=this.dockManager,A=!1,E=null,K=q.setLocation;q.setLocation=function(J,ia){(null==this.dockState||this._undocking||this._relayouting)&&K.call(this,J,ia)};var Q=q.setSize;q.setSize=function(J,ia){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,J,ia);J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;ia=window.innerHeight||document.documentElement.clientHeight||
+document.body.clientHeight;var Y=parseInt(this.div.style.width),aa=parseInt(this.div.style.height),ja=this.getX(),la=this.getY();this._dockOffsetX=this._dockAnchorRight?J-ja-Y:ja;this._dockOffsetY=this._dockAnchorBottom?ia-la-aa:la;x.pinToEdge(this)}else Q.call(this,J,ia)};q.addListener(mxEvent.MOVE_START,function(J,ia){A=!0;E=null;null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.MOVE,function(J,ia){A&&(J=x.getDockZone(q.getX(),q.getY(),q.div),J!=E&&(E=J,null!=
+J?x.showPreview(J,q):x.hidePreview()))});q.addListener(mxEvent.MOVE_END,function(J,ia){A=!1;x.hidePreview();null!=E&&x.dock(q,E);E=null});q.addListener(mxEvent.DOCK,function(J,ia){if(null!=q.resize){J=ia.getProperty("side");var Y=0<=J.indexOf("right"),aa=0<=J.indexOf("bottom");if(Y||aa){J=q.resize;J.parentNode.removeChild(J);q.resize=null;J=document.createElement("img");J.style.position="absolute";J.style.zIndex="2";J.setAttribute("src",mxWindow.prototype.resizeImage);Y?J.style.left="0px":J.style.right=
+"0px";aa?J.style.top="0px":J.style.bottom="0px";J.style.cursor=Y!=aa?"nesw-resize":"nwse-resize";var ja=null,la=null,ua=null,Da=null,ha=function(u){if(null!=ja&&null!=la){var H=mxEvent.getClientX(u)-ja,P=mxEvent.getClientY(u)-la;q.setSize(Y?ua-H:ua+H,aa?Da-P:Da+P);q.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",u));mxEvent.consume(u)}},k=function(u){null!=ja&&null!=la&&(la=ja=null,mxEvent.removeGestureListeners(document,null,ha,k),q.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",u)),
+mxEvent.consume(u))};mxEvent.addGestureListeners(J,function(u){q.activate();ja=mxEvent.getClientX(u);la=mxEvent.getClientY(u);ua=q.div.offsetWidth;Da=q.div.offsetHeight;mxEvent.addGestureListeners(document,null,ha,k);q.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",u));mxEvent.consume(u)},ha,k);q.div.appendChild(J);q.resize=J;q._dockResize=!0}}});q.addListener(mxEvent.UNDOCK,function(J,ia){q._dockResize&&(null!=q.resize&&(q.resize.parentNode.removeChild(q.resize),q.resize=null),q.setResizable(!0),
+q._dockResize=!1)});q.addListener(mxEvent.NORMALIZE,function(J,ia){null!=q.dockState&&x.pinToEdge(q)});q.addListener(mxEvent.MAXIMIZE,function(J,ia){null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.SHOW,function(J,ia){null!=q.dockState&&x.pinToEdge(q)});var V=c.destroy;c.destroy=function(){x.removeWindow(q);V.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var f=this.editor.graph;f.defaultEdgeLength=Graph.prototype.defaultEdgeLength;
+f.defaultGridEnabled=Graph.prototype.defaultGridEnabled;f.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)f.defaultEdgeLength=120;null==urlParams.grid&&(f.defaultGridEnabled=!1);null==urlParams.pv&&(f.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=
+function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.isThemeMenuVisible=function(){return("1"!=urlParams.embed||"1"==urlParams.themes&&null==urlParams.ui&&"1"!=urlParams.sketch)&&"1"!=urlParams.extAuth&&this.mode!=App.MODE_ATLAS};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=
+function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var f=this.getCurrentFile();null!=f&&(f.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==f.sync||f.sync.enabled&&f.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==f.sync||f.sync.isConnected()?f.isRealtimeEnabled()&&f.isRealtimeSupported()&&1<f.getRealtimeState()&&(c=f.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+
+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity=
+"");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,l,q){l=null!=l?l:"geButton";var x=this.menus.get(c);q=this.menubar.addMenu(mxResources.get(c),x.funct,null,q);q.className=l;q.setAttribute("title",mxResources.get(c));this.menus.menuCreated(x,q,l);null!=f&&(q.style.backgroundImage="url("+
+f+")",q.innerText="");return q};EditorUi.prototype.addButton=function(c,f,l,q){c=this.createToolbarButton(c,f,l);q=null!=q?q:this.container;q.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,l){var q=document.createElement("a");q.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(q.style.backgroundImage="url("+c+")");null!=f&&q.setAttribute("title",f);null!=l&&mxEvent.addListener(q,"click",function(x){"disabled"!=q.getAttribute("disabled")&&l(x);mxEvent.consume(x)});
+mxEvent.preventDefault(q);return q};EditorUi.prototype.createMenuItem=function(c,f,l){var q=this.actions.get(c),x=null!=q?q.funct:null,A=this.createToolbarButton(f,mxResources.get(c)+(null!=q&&null!=q.shortcut?" ("+q.shortcut+")":""),x);null==q||l||(c=function(){q.isEnabled()?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),q.addListener("stateChanged",c),c());return A};EditorUi.prototype.createFormatWindow=function(){if(null==
+this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),l=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-256),q=null!=f&&null!=f.y?f.y:60,x=null!=f&&null!=f.w?f.w:240,A=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),l,q,x,A,mxUtils.bind(this,function(Q){Q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,
+mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var E=this.formatWindow.window.toggleMinimized,K=x;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(K=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+K-140+"px"):(this.div.style.width=K+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,
+parseInt(this.div.style.left)-K+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(Q){mxEvent.getSource(Q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,
+mxUtils.bind(this,function(){var Q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,V=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>Q||690>V)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var O=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=
+c?c:!this.isFormatPanelVisible()):O.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var q=this.hsplitPosition,x=mxUtils.bind(this,function(){this.hsplitPosition=A;this.refresh();f||(this.diagramContainer.scrollLeft-=q-this.hsplitPosition)}),A=c?l:0,E=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,
+"transform",0==A?"translateX(0)":"translateX(-100%)");0!=A&&x();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==A?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+E+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",
+null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==A&&x();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*E)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var F=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():F.apply(this,arguments)};EditorUi.prototype.createShapesPanel=
+function(c){var f=mxUtils.bind(this,function(E,K){var Q=this.menus.get(E);E=this.createMenuElement(K,mxUtils.bind(this,function(){Q.funct.apply(this,arguments)}));E.setAttribute("title",K);E.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";E.className="geButton";c.parentNode.appendChild(E);return E});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),
+f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=
+f("newLibrary","");l.style.left="0px";l.style.right="50%";var q=document.createElement("span");l.appendChild(q);var x=f("openLibraryFrom","");x.style.borderLeftWidth="1px";x.style.left="50%";x.style.right="0px";var A=document.createElement("span");x.appendChild(A);this.dependsOnLanguage(mxUtils.bind(this,function(){q.innerHTML="";mxUtils.write(q,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));A.innerHTML="";mxUtils.write(A,mxResources.get("openLibraryFrom"));x.setAttribute("title",
+mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)-6,l=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650))-6,q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=null!=
+c&&null!=c.x?c.x:q&&"1"!=urlParams.embedInline?66:10;q=null!=c&&null!=c.y?c.y:q&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-l)/2):56;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),x,q,f,l,mxUtils.bind(this,function(A){this.createShapesPanel(A)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.installWindowPersistence("shapes",
+this.sidebarWindow);null!=c?this.restoreWindowState("shapes",this.sidebarWindow):this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=
+c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();for(this.updateOfflineLanguages();null!=this.dialog;){var f=this.dialog;this.hideDialog(!0);if(this.dialog==
+f)break}this.fireEvent(new mxEventObject("languageChanged"));null==this.getCurrentFile()&&"function"===typeof this.showSplash&&this.showSplash()})))};EditorUi.prototype.getOfflineLanguages=function(c){try{if("undefined"!==typeof caches){caches.keys().then(function(f){for(var l=[],q=0;q<f.length;q++)"workbox-precache-v2"==f[q].substring(0,19)&&l.push(caches.open(f[q]).then(function(x){return x.keys()}));return Promise.all(l)}).then(function(f){for(var l=Object.create(null),q=!1,x=0;x<f.length;x++)for(var A=
+0;A<f[x].length;A++){var E=/\/resources\/dia(?:_([a-z0-9-]+))?\.txt$/.exec((new URL(f[x][A].url)).pathname);null!=E&&(null!=E[1]?l[E[1]]=!0:q=!0)}f=Object.keys(l).sort();c(null!=f?f:[],1==q)})["catch"](function(){c([],!1)});return}}catch(f){}c([],!1)};EditorUi.prototype.updateOfflineLanguages=function(){this.getOfflineLanguages(mxUtils.bind(this,function(c,f){var l=Object.create(null);f&&(l.en=!0);for(f=0;f<c.length;f++)l[c[f]]=!0;this.offlineLanguages=l}))};EditorUi.prototype.removeOfflineLanguage=
+function(c,f){try{if("undefined"!==typeof caches&&/^[a-z0-9-]+$/.test(c)){caches.keys().then(function(l){for(var q=[],x=0;x<l.length;x++)"workbox-precache-v2"==l[x].substring(0,19)&&q.push(caches.open(l[x]).then(function(A){return A.keys().then(function(E){return Promise.all(E.filter(function(K){return(new URL(K.url)).pathname.endsWith("/resources/dia_"+c+".txt")}).map(function(K){return A.delete(K)}))})}));return Promise.all(q)}).then(mxUtils.bind(this,function(){this.updateOfflineLanguages();f()}))["catch"](function(){f()});
+return}}catch(l){}f()};EditorUi.prototype.isLanguageAvailableOffline=function(c){return!1!==navigator.onLine||null==this.offlineLanguages||1!=this.offlineLanguages.en||""==c||"en"==c||1==this.offlineLanguages[c]};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);
+Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var f=document.getElementById("high-contrast-stylesheet");if(null!=f&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,
+q=f.getAttribute("media");(q="all"==q||"not all"!=q&&l)&&!c?f.setAttribute("media",l?"not all":"(forced-colors: active)"):!q&&c&&f.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var f=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),
+this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-f.x;this.diagramContainer.scrollTop+=c.x-f.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&
+(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=
+c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",
+JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left=
+"",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var q=
+this.diagramContainer.getAttribute("data-bounds");if(null!=q){this.diagramContainer.removeAttribute("data-bounds");var x=q.split(" ");q=mxUtils.getDocumentSize();this.diagramContainer.style.top=x[0];this.diagramContainer.style.left=x[1];var A=parseInt(x[2]);x=parseInt(x[3]);A=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,A):A,q.width-80);x=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,x):x,q.height-80);this.diagramContainer.style.width=A+"px";this.diagramContainer.style.height=
+x+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=
+this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/
+2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;q="1"==urlParams.embedInline&&Editor.passiveScroll;f.style.visibility=q?"hidden":"";c.style.visibility=q?"hidden":"";l.style.display=q?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=
+c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?
+(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&
+(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==
+Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch=
+"1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle();this.restorePersistedEdgeStyle()};EditorUi.prototype.restorePersistedEdgeStyle=
function(){var c=this.editor.graph,f="undefined"!==typeof mxSettings&&null!=mxSettings.getCurrentEdgeStyle?mxSettings.getCurrentEdgeStyle():null;if(null!=f){c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);for(var l in f)"__proto__"!=l&&"constructor"!=l&&"prototype"!=l&&(c.currentEdgeStyle[l]=f[l]);null!=f.fontFamily&&null==f.fontSource&&delete c.currentEdgeStyle.fontSource;"orthogonalEdgeStyle"!=c.defaultEdgeStyle.edgeStyle&&delete c.currentEdgeStyle.libavoidRouting;this.fireEvent(new mxEventObject("styleChanged",
"keys",[],"values",[],"cells",[]))}};EditorUi.prototype.getLinkTitle=function(c){var f=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(f=this.getPageById(c.substring(l+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(f=this.getCustomLinkTitle(c));return f};EditorUi.prototype.getCustomLinkTitle=function(c){var f=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));
if(null!=l&&"string"==typeof l.title&&""!=l.title.trim())f=l.title.trim();else if(null!=l&&Array.isArray(l.actions)&&0<l.actions.length){var q=Object.keys(l.actions[0])[0]||"";if("animation"==q&&null!=l.actions[0].animation&&Array.isArray(l.actions[0].animation.steps)){var x=l.actions[0].animation.steps.length;f=mxResources.get("effects")+" ("+x+")"}else if(""!=q){var A="undefined"!=typeof CustomActionDialog&&null!=CustomActionDialog?CustomActionDialog.SCHEMAS[q]:null;f=mxResources.get(null!=A&&A.labelKey?
@@ -4672,7 +4674,7 @@ Q))}Q=K.getElementsByTagName("span");if(null!=Q&&0<Q.length&&"application/vnd.lu
mxEvent.consume(c));else{var ia=!1,Y="";Y=E?null!=K.textContent&&"<mxfile"==K.textContent.substring(0,7)&&"</mxfile>"==K.textContent.substring(K.textContent.length-9)||"<mxGraphModel"==K.textContent.substring(0,13)&&"</mxGraphModel>"==K.textContent.substring(K.textContent.length-15)?K.textContent.replace(/\u00a0/g," "):K.innerHTML:mxUtils.trim(null==K.innerText?mxUtils.getTextContent(K):K.innerText);try{var aa=Y.lastIndexOf("%3E");0<=aa&&aa<Y.length-3&&(Y=Y.substring(0,aa+3))}catch(ha){}try{Q=K.getElementsByTagName("span"),
(J=null!=Q&&0<Q.length?mxUtils.trim(decodeURIComponent(Q[0].textContent)):decodeURIComponent(Y))&&(this.isCompatibleString(J)||0==J.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(ia=!0,Y=J)}catch(ha){}J=null;try{if(!ia&&""==K.textContent)for(aa=0;aa<x.items.length;aa++){var ja=x.items[aa];if("file"===ja.kind){J=ja.getAsFile();break}}}catch(ha){}EditorUi.debug("EditorUi.pasteCells",[this],"evt",[c],"realElt",[f.outerHTML],"elt",[K.outerHTML],"useEvent",l,"pasteAsLabel",q,"xml",[Y],
"compat",ia,"asHtml",E,"data",x,"items",[x.items.length],"files",[x.files.length],"types",[JSON.stringify(x.types)],"blob",[J]);try{if(ia||null==J)if(null!=Y&&0<Y.length){if(0==Y.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ua=mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}),Da=mxUtils.bind(this,function(){if("undefined"===typeof MiroImporter)ua();else try{Y=(new MiroImporter).importMiroJson(JSON.parse(Y)),this.pasteXml(Y,
-q,ia,c)}catch(ha){console.log("Miro import error:",ha)}});"undefined"===typeof MiroImporter?mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",Da,null,null,null,ua):Da()}else this.pasteXml(Y,q,ia,c,E);mxEvent.consume(c)}else l||(A.lastPasteXml=null,A.pasteCounter=0);else{var ka=A.getInsertPoint();this.importFiles([J],ka.x,ka.y,this.maxImageSize);mxEvent.consume(c)}}catch(ha){this.handleError(ha)}}}f.innerHTML="&nbsp;"};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;
+q,ia,c)}catch(ha){console.log("Miro import error:",ha)}});"undefined"===typeof MiroImporter?mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",Da,null,null,null,ua):Da()}else this.pasteXml(Y,q,ia,c,E);mxEvent.consume(c)}else l||(A.lastPasteXml=null,A.pasteCounter=0);else{var la=A.getInsertPoint();this.importFiles([J],la.x,la.y,this.maxImageSize);mxEvent.consume(c)}}catch(ha){this.handleError(ha)}}}f.innerHTML="&nbsp;"};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;
null==c&&Editor.pasteAtMousePointer&&f.isMouseInsertPoint()&&(c=f.getInsertPoint());if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(l,q,x,A,E){if(null!=l){f.getModel().beginUpdate();try{this.pasteXml(l,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else l=null!=q?q:null!=x?x:A,null!=l?(c=null!=c?c:f.getInsertPoint(),this.importFiles([l],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):
this.pasteFromLocalClipboard(c)}catch(l){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var f=this.editor.graph;f.getModel().beginUpdate();try{f.moveCellsTo(mxClipboard.paste(f),c)}finally{f.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(f){for(var l=null!=f.clipboardData?f.clipboardData:f.originalEvent.clipboardData,q=!1,x=null,A=0;A<l.types.length;A++)if("text/"===
l.types[A].substring(0,5)){q=!0;break}for(A=0;A<l.items.length;A++){var E=l.items[A];if("file"===E.kind){x=E.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[f],"data",[l],"items",[l.items.length],"files",[l.files.length],"types",[JSON.stringify(l.types)],"containsText",q,"file",[x],"editing",c.isEditing());var K=mxUtils.bind(this,function(){try{if(!q&&null!=x){if(c.isEditing())this.importFiles([x],0,0,this.maxImageSize,function(V,J,ia,Y,aa,ja){c.insertImage(V,aa,ja)},
@@ -4686,17 +4688,17 @@ else E.text().then(mxUtils.bind(this,function(K){EditorUi.debug("EditorUi.readTy
l.length;)l[0].parentNode.removeChild(l[0]);if(null!=f.firstChild&&f.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=f.firstChild.nextSibling&&f.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==f.firstChild.nodeName&&"A"==f.firstChild.nextSibling.nodeName&&null==f.firstChild.nextSibling.nextSibling){var q=null==f.firstChild.nextSibling.innerText?mxUtils.getTextContent(f.firstChild.nextSibling):f.firstChild.nextSibling.innerText;q==f.firstChild.nextSibling.getAttribute("href")&&
(mxUtils.setTextContent(f,q),asHtml=!1)}if(""==f.textContent&&(l=f.getElementsByTagName("img"),1==l.length&&(q=l[0].getAttribute("src"),l=null,null!=q))){if(Editor.isPngDataUrl(q)){var x=Editor.extractGraphModelFromPng(q);null!=x&&0<x.length&&(l=x)}else if("data:image/svg+xml;base64,"==q.substring(0,26)){img=this.base64ToBlob(q.substring(q.indexOf(",")+1),"image/svg+xml");q=Graph.getSvgFromDataUri(q);try{x=mxUtils.parseXml(q).documentElement.getAttribute("content"),this.isCompatibleString(x)&&(l=
x)}catch(A){}}null!=l&&(mxUtils.setTextContent(f,l),asHtml=!1)}asHtml?Graph.removePasteFormatting(f):f.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,l){this.showDialog((new PrintDialog(this,c,f,l)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var l=this.editor,q=l.graph,x=this.getPageIndex(this.currentPage),A=null!=x?x+1:1,E=mxUtils.bind(this,
-function(k,u,H,P){var T=k.useCssTransforms,W=k.currentTranslate,fa=k.currentScale,X=k.view.translate,ea=k.view.scale;k.useCssTransforms&&(k.useCssTransforms=!1,k.currentTranslate=new mxPoint(0,0),k.currentScale=1,k.view.translate=new mxPoint(0,0),k.view.scale=1);var oa=k.getGraphBounds(),la=0,ca=0,sa=mxRectangle.fromRectangle(k.pageFormat),xa=f.fit||f.crop||!k.pageVisible,qa=f.scale;sa.width*=k.pageScale;sa.height*=k.pageScale;var Ba=1;if(f.fit){Ba=f.sheetsAcross;var ma=f.sheetsDown;isNaN(qa)||(sa.width=
-Math.ceil(sa.width*qa),sa.height=Math.ceil(sa.height*qa));Ba=Math.min(sa.height*ma/(oa.height/k.view.scale),sa.width*Ba/(oa.width/k.view.scale))}else Ba=isNaN(qa)?1:qa;Ba*=1;!xa&&k.pageVisible?(qa=k.getPageLayout(),la-=qa.x*sa.width,ca-=qa.y*sa.height):xa=!0;f.crop&&(f.selection&&(oa=q.getBoundingBox(q.getSelectionCells())),sa.width=(oa.width+1)*Ba/k.view.scale,sa.height=(oa.height+1)*Ba/k.view.scale);sa.width*=1;sa.height*=1;P=null!=P?"page/id,"+P:null;oa=f.selection?k.getBoundingBox(k.getSelectionCells()):
-k.getGraphBounds();if(null!=oa){qa=k.view.scale/Ba;ma=oa.width;var ta=oa.height,va=la,Ha=ca;xa||(va-=k.view.translate.x*Ba,Ha-=k.view.translate.y*Ba,ma+=oa.x,ta+=oa.y);J+=Math.max(1,Math.ceil((ma/qa+va)/(sa.width+1)))*Math.max(1,Math.ceil((ta/qa+Ha)/(sa.height+1)))}ia=ia||J>this.maxPrintPageCount;if(!ia)if(null==u){u=PrintDialog.createPrintPreview(k,Ba,null,0,la,ca,xa);u.title=this.getBaseFilename(!0);u.pageSelector=!1;u.mathEnabled=!1;la=f.border;isNaN(la)||(u.pageMargin=la);var La=u.writeHead;u.writeHead=
+function(k,u,H,P){var U=k.useCssTransforms,W=k.currentTranslate,fa=k.currentScale,X=k.view.translate,ea=k.view.scale;k.useCssTransforms&&(k.useCssTransforms=!1,k.currentTranslate=new mxPoint(0,0),k.currentScale=1,k.view.translate=new mxPoint(0,0),k.view.scale=1);var oa=k.getGraphBounds(),ka=0,ba=0,sa=mxRectangle.fromRectangle(k.pageFormat),xa=f.fit||f.crop||!k.pageVisible,qa=f.scale;sa.width*=k.pageScale;sa.height*=k.pageScale;var Ba=1;if(f.fit){Ba=f.sheetsAcross;var ma=f.sheetsDown;isNaN(qa)||(sa.width=
+Math.ceil(sa.width*qa),sa.height=Math.ceil(sa.height*qa));Ba=Math.min(sa.height*ma/(oa.height/k.view.scale),sa.width*Ba/(oa.width/k.view.scale))}else Ba=isNaN(qa)?1:qa;Ba*=1;!xa&&k.pageVisible?(qa=k.getPageLayout(),ka-=qa.x*sa.width,ba-=qa.y*sa.height):xa=!0;f.crop&&(f.selection&&(oa=q.getBoundingBox(q.getSelectionCells())),sa.width=(oa.width+1)*Ba/k.view.scale,sa.height=(oa.height+1)*Ba/k.view.scale);sa.width*=1;sa.height*=1;P=null!=P?"page/id,"+P:null;oa=f.selection?k.getBoundingBox(k.getSelectionCells()):
+k.getGraphBounds();if(null!=oa){qa=k.view.scale/Ba;ma=oa.width;var ta=oa.height,va=ka,Ga=ba;xa||(va-=k.view.translate.x*Ba,Ga-=k.view.translate.y*Ba,ma+=oa.x,ta+=oa.y);J+=Math.max(1,Math.ceil((ma/qa+va)/(sa.width+1)))*Math.max(1,Math.ceil((ta/qa+Ga)/(sa.height+1)))}ia=ia||J>this.maxPrintPageCount;if(!ia)if(null==u){u=PrintDialog.createPrintPreview(k,Ba,null,0,ka,ba,xa);u.title=this.getBaseFilename(!0);u.pageSelector=!1;u.mathEnabled=!1;ka=f.border;isNaN(ka)||(u.pageMargin=ka);var La=u.writeHead;u.writeHead=
function(Pa,Ka){Ka=null!=Ka?Ka:"";f.shadows||(Ka+='g[style*="filter: drop-shadow("] {\n filter: none !important;\n}\n');mxClient.IS_GC&&(Ka+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=l.fontCss&&(Ka+=l.fontCss);La.apply(this,arguments);for(var Na=k.getCustomFonts(),Oa=0;Oa<Na.length;Oa++){var Ea=Na[Oa].name,Aa=Na[Oa].url;Graph.isCssFontUrl(Aa)?Pa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Aa))+'" charset="UTF-8" type="text/css">'):
(Pa.writeln('<style type="text/css">'),Pa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(Ea))+'";\nsrc: url("'+mxUtils.htmlEntities(Graph.escapeCssString(Aa))+'");\n}'),Pa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Ia=u.drawBackgroundImage;u.drawBackgroundImage=function(Pa){Ia.apply(this,arguments);null!=Pa.node&&(EditorUi.embedSvgImages(Pa.node),q.disableSvgLinks(Pa.node,function(Ka){Ka.setAttribute("href","javascript:void(0)")}))}}var Ca=u.addGraphFragment;
-u.addGraphFragment=function(Pa,Ka,Na,Oa,Ea,Aa){Ca.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Ea.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Ja=Ea.getElementsByTagName("svg"),Ga=0;Ga<Ja.length;Ga++)k.addSvgShadow(Ja[Ga])};f.grid&&(u.gridSize=k.gridSize,u.gridSteps=k.view.gridSteps,u.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:k.view.gridColor);u.isCellVisible=f.selection?function(Pa){return k.isCellSelected(Pa)&&
+u.addGraphFragment=function(Pa,Ka,Na,Oa,Ea,Aa){Ca.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Ea.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Ja=Ea.getElementsByTagName("svg"),Ha=0;Ha<Ja.length;Ha++)k.addSvgShadow(Ja[Ha])};f.grid&&(u.gridSize=k.gridSize,u.gridSteps=k.view.gridSteps,u.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:k.view.gridColor);u.isCellVisible=f.selection?function(Pa){return k.isCellSelected(Pa)&&
k.isCellVisible(Pa)}:function(Pa){return k.isCellVisible(Pa)};u.open(null,null,H,!0,P,sa,f.selection?k.getSelectionCells():null)}else{oa=k.background;if(null==oa||""==oa||oa==mxConstants.NONE)oa="#ffffff";u.backgroundColor=oa;u.autoOrigin=xa;f.grid&&(u.gridSize=k.gridSize,u.gridSteps=k.view.gridSteps,u.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:k.view.gridColor);u.isCellVisible=f.selection?function(Pa){return k.isCellSelected(Pa)&&k.isCellVisible(Pa)}:function(Pa){return k.isCellVisible(Pa)};
-u.appendGraph(k,Ba,la,ca,H,!0,P,sa,f.selection?k.getSelectionCells():null);H=k.getCustomFonts();if(null!=u.wnd)for(sa=0;sa<H.length;sa++)la=H[sa].name,ca=H[sa].url,Graph.isCssFontUrl(ca)?u.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(ca))+'" charset="UTF-8" type="text/css">'):(u.wnd.document.writeln('<style type="text/css">'),u.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(la))+'";\nsrc: url("'+
-mxUtils.htmlEntities(Graph.escapeCssString(ca))+'");\n}'),u.wnd.document.writeln("</style>"))}T&&(k.useCssTransforms=T,k.currentTranslate=W,k.currentScale=fa,k.view.translate=X,k.view.scale=ea);return u}),K=f.pagesFrom,Q=f.pagesTo,V=!f.allPages,J=0,ia=!1;x=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{V&&(V=f.selection||K==A&&Q==A);if(!V&&null!=this.pages&&this.pages.length){V=0;A=this.pages.length-1;f.allPages||(V=parseInt(K)-1,A=parseInt(Q)-1);for(var Y=V;Y<=A&&!ia;Y++){var aa=
-this.pages[Y];K=aa==this.currentPage?q:null;if(null==K){K=this.createTemporaryGraph(q.stylesheet);K.shapeForegroundColor=q.shapeForegroundColor;K.shapeBackgroundColor=q.shapeBackgroundColor;Q=!0;var ja=V=!1,ka=null,ua=null;null==aa.viewState&&null==aa.root&&this.updatePageRoot(aa);null!=aa.viewState&&(Q=aa.viewState.pageVisible,V=aa.viewState.mathEnabled,ja=aa.viewState.shadowVisible,ka=aa.viewState.background,ua=aa.viewState.backgroundImage,K.pageFormat=aa.viewState.pageFormat,K.gridSize=aa.viewState.gridSize,
-K.hiddenTags=aa.viewState.hiddenTags||[]);null!=ua&&null!=ua.originalSrc&&(ua=this.createImageForPageLink(ua.originalSrc,aa));K.background=ka;K.backgroundImage=null!=ua?new mxImage(ua.src,ua.width,ua.height,ua.x,ua.y):null;K.pageVisible=Q;K.mathEnabled=V;K.shadowVisible=ja;var Da=K.getGraphBounds;K.getGraphBounds=function(){var k=Da.apply(this,arguments),u=this.backgroundImage;if(null!=u&&null!=u.width&&null!=u.height){var H=this.view.translate,P=this.view.scale;k=mxRectangle.fromRectangle(k);k.add(new mxRectangle((H.x+
+u.appendGraph(k,Ba,ka,ba,H,!0,P,sa,f.selection?k.getSelectionCells():null);H=k.getCustomFonts();if(null!=u.wnd)for(sa=0;sa<H.length;sa++)ka=H[sa].name,ba=H[sa].url,Graph.isCssFontUrl(ba)?u.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(ba))+'" charset="UTF-8" type="text/css">'):(u.wnd.document.writeln('<style type="text/css">'),u.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Graph.escapeCssString(ka))+'";\nsrc: url("'+
+mxUtils.htmlEntities(Graph.escapeCssString(ba))+'");\n}'),u.wnd.document.writeln("</style>"))}U&&(k.useCssTransforms=U,k.currentTranslate=W,k.currentScale=fa,k.view.translate=X,k.view.scale=ea);return u}),K=f.pagesFrom,Q=f.pagesTo,V=!f.allPages,J=0,ia=!1;x=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{V&&(V=f.selection||K==A&&Q==A);if(!V&&null!=this.pages&&this.pages.length){V=0;A=this.pages.length-1;f.allPages||(V=parseInt(K)-1,A=parseInt(Q)-1);for(var Y=V;Y<=A&&!ia;Y++){var aa=
+this.pages[Y];K=aa==this.currentPage?q:null;if(null==K){K=this.createTemporaryGraph(q.stylesheet);K.shapeForegroundColor=q.shapeForegroundColor;K.shapeBackgroundColor=q.shapeBackgroundColor;Q=!0;var ja=V=!1,la=null,ua=null;null==aa.viewState&&null==aa.root&&this.updatePageRoot(aa);null!=aa.viewState&&(Q=aa.viewState.pageVisible,V=aa.viewState.mathEnabled,ja=aa.viewState.shadowVisible,la=aa.viewState.background,ua=aa.viewState.backgroundImage,K.pageFormat=aa.viewState.pageFormat,K.gridSize=aa.viewState.gridSize,
+K.hiddenTags=aa.viewState.hiddenTags||[]);null!=ua&&null!=ua.originalSrc&&(ua=this.createImageForPageLink(ua.originalSrc,aa));K.background=la;K.backgroundImage=null!=ua?new mxImage(ua.src,ua.width,ua.height,ua.x,ua.y):null;K.pageVisible=Q;K.mathEnabled=V;K.shadowVisible=ja;var Da=K.getGraphBounds;K.getGraphBounds=function(){var k=Da.apply(this,arguments),u=this.backgroundImage;if(null!=u&&null!=u.width&&null!=u.height){var H=this.view.translate,P=this.view.scale;k=mxRectangle.fromRectangle(k);k.add(new mxRectangle((H.x+
u.x)*P,(H.y+u.y)*P,u.width*P,u.height*P))}return k};var ha=K.getGlobalVariable;K.getGlobalVariable=function(k){return"page"==k?aa.getName():"pagenumber"==k?Y+1:"pagecount"==k?null!=this.pages?this.pages.length:1:ha.apply(this,arguments)};document.body.appendChild(K.container);this.updatePageRoot(aa);K.model.setRoot(aa.root)}x=E(K,x,Y!=A,aa.getId());K!=q&&K.container.parentNode.removeChild(K.container)}}else x=E(q);if(ia)return null!=x&&null!=x.wnd&&x.wnd!=window&&x.wnd.close(),this.handleError({message:mxResources.get("drawingTooLarge")}),
null;if(null==x||null==x.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});else{x.mathEnabled&&(E=x.wnd.document,c||(x.wnd.IMMEDIATE_PRINT=!0),E.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>'));x.closeDocument();if(Editor.expandPatternsForPrint&&null!=x.wnd)for(E=x.wnd.document.getElementsByTagName("svg"),Y=0;Y<E.length;Y++)Editor.expandSvgPatterns(E[Y]);Graph.rewritePageLinks(x.wnd.document,!0);x.mathEnabled||c||PrintDialog.printPreview(x)}return x}};
EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(q){null!=f&&(f.parentNode.removeChild(f),f=null);q.stopPropagation();q.preventDefault()}),mxEvent.addListener(c[l],"dragover",mxUtils.bind(this,function(q){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(f=this.highlightElement());q.stopPropagation();q.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(q){null!=
@@ -4726,208 +4728,209 @@ translate:x,bounds:l,currentPage:this.getSelectedPageIndex(),scale:q,page:f.view
window.opener||window.parent;if(this.editor.modified){var q=f.background;if(null==q||q==mxConstants.NONE)q=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(x){l.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(x)}),"*")}),null,null,!0,q,1,this.embedExportBorder,null,this.embedExportTheme)}else c||l.postMessage(JSON.stringify({event:"exit",
point:this.embedExitPoint}),"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(x){c||this.handleError(x)}};EditorUi.prototype.whenScriptReady=function(c,f,l){if(c())f();else var q=0,x=window.setInterval(function(){c()?(window.clearInterval(x),f()):100<=++q&&(window.clearInterval(x),
null!=l&&l())},100)};EditorUi.prototype.lastLayoutSpec=null;EditorUi.prototype.resolveLayoutList=function(c){if("string"===typeof c){c=mxUtils.trim(c);if("["==c.charAt(0))return JSON.parse(c);if("undefined"===typeof LibavoidRouting||c!==LibavoidRouting.SHORTHAND&&c!==LibavoidRouting.LAYOUT_NAME){if("parallels"===c)return[{layout:"mxParallelEdgeLayout",config:{checkOverlap:!0}}];if("undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS&&null!=ElkLayout.MENU_PRESETS[c]){c=ElkLayout.MENU_PRESETS[c];
-var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainer=function(){var c=this.editor.graph,f=1==c.getSelectionCount()?c.getSelectionCell():null;return null!=f&&c.model.isVertex(f)&&(c=c.getCellStyle(f).childLayout,
-null!=c&&"tableLayout"!=c&&"stackLayout"!=c&&"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var l=this.editor.graph,q=f,x=null,A=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));q=[];for(var E=0;E<f.length;E++){var K=f[E];if(null!=K&&("mxRadialTreeLayout"==K.layout||"mxOrgChartLayout"==K.layout||"mxFastOrganicLayout"==K.layout||"mxCircleLayout"==K.layout))throw Error("Not supported as childLayout: "+
-K.layout);if(null!=K&&null!=Graph.elkLayoutAlgorithms[K.layout]){var Q={},V;for(V in K.config)Q[V]=K.config[V];delete Q.rootCellIds;delete Q.preserveOrigin;null==Q.resizeNodes&&(Q.resizeNodes=!1);null==Q.resizeLayoutRoot&&(Q.resizeLayoutRoot=!0);"elkLayered"==K.layout&&null==Q.extractIsolated&&(Q.extractIsolated=!1);null!=Q.corners&&(A=Q.corners);if(null!=Q.groupPadding&&(x=String(Q.groupPadding),/[;=]/.test(x)))throw Error("Invalid groupPadding: "+x);K={layout:K.layout,config:Q}}q.push(K)}l.createLayouts(q);
-q=Graph.encodeChildLayout(q)}if(0<=q.indexOf(";"))throw Error("Invalid childLayout: "+q);l.model.beginUpdate();try{var J=l.model.getStyle(c);l.setCellStyles("childLayout",q,[c]);null!=x&&l.setCellStyles("groupPadding",x,[c]);null!=A&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(l,c,A);l.model.getStyle(c)==J&&null!=l.layoutManager&&l.layoutManager.executeLayout(c,!1)}finally{l.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,
-f,l){var q=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS},function(){try{var x=q.resolveLayoutList(c);if(null!=x){q.lastLayoutSpec=x;var A=l?q.getSelectedLayoutContainer():null;null!=A&&Array.isArray(x)&&0<x.length?(q.setContainerChildLayout(A,x),null!=f&&f()):q.executeLayouts(q.editor.graph.createLayouts(x),f)}else q.handleError(Error("Unknown layout: "+c))}catch(E){q.handleError(E)}},function(){q.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};
-EditorUi.prototype.applyChildLayouts=function(c){var f=this.editor.graph,l=function(){try{f.executeAllChildLayouts()}catch(q){null!=window.console&&console.error(q)}null!=c&&c()};(function(){if("undefined"!==typeof ElkLayout)return!1;for(var q=f.getChildLayoutCells(),x=0;x<q.length;x++)try{for(var A=Graph.decodeChildLayout(f.getCellStyle(q[x]).childLayout),E=0;null!=A&&E<A.length;E++)if(null!=A[E]&&"string"===typeof Graph.elkLayoutAlgorithms[A[E].layout])return!0}catch(K){}return!1})()?this.whenScriptReady(function(){return"undefined"!==
-typeof ElkLayout},l,l):l()};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,l=c.ctrlKey||c.metaKey,q=null!=c.key?c.key.toLowerCase():"",x=0;x<f.length;x++){var A=f[x];if(q===String(A.key).toLowerCase()&&l===!!A.ctrl&&c.shiftKey===!!A.shift&&c.altKey===!!A.alt){c.preventDefault();c.stopImmediatePropagation();null!=A.command&&(this.embedMessageSource||
-window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:A.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=
-function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===typeof c.keyCode&&1==c.keyCode.length,l=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(l))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var q=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:
-c.shift?this.altShiftActions:this.altActions;null!=c.action?q[l]=c.action:delete q[l]}else null!=c.action?(q=mxUtils.bind(this,function(){var x=this.actions.get(c.action);null!=x&&x.isEnabled()&&x.funct.apply(this,arguments)}),c.control?c.shift?this.keyHandler.bindControlShiftKey(l,q):this.keyHandler.bindControlKey(l,q):c.shift?this.keyHandler.bindShiftKey(l,q):this.keyHandler.bindKey(l,q)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:
-this.keyHandler.normalKeys)[l];null!=c.action&&(q=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=l&&57>=l||65<=l&&90>=l?String.fromCharCode(l):EditorUi.keyNames[l],null!=q&&null!=f&&(q.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,l=!1,q=!1,x=null,A=null;this.installPassThroughKeys();var E=mxUtils.bind(this,function(V,J){this.editor.modified&&"0"!=urlParams.modified?
-null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,E);mxEvent.addListener(window,"message",mxUtils.bind(this,function(V){if(V.source==(this.embedMessageSource||window.opener||window.parent)){var J=V.data,ia=null,Y=null,aa=mxUtils.bind(this,function(Fa){if(null!=Fa&&"function"===typeof Fa.charAt&&"<"!=Fa.charAt(0))try{Editor.isPngDataUrl(Fa)?
-Fa=Editor.extractGraphModelFromPng(Fa):"data:image/svg+xml;base64,"==Fa.substring(0,26)?Fa=atob(Fa.substring(26)):"data:image/svg+xml;utf8,"==Fa.substring(0,24)&&(Fa=Fa.substring(24)),null!=Fa&&(""==Fa.trim()?Fa=null:"%"==Fa.charAt(0)?Fa=decodeURIComponent(Fa):"<"!=Fa.charAt(0)&&(Fa=Graph.decompress(Fa)))}catch(Ra){}return Fa});if("json"==urlParams.proto){var ja=!1;try{J=JSON.parse(J),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[V],"data",[J])}catch(Fa){J=null}try{var ka=J;if(null==
-J)return;if("dialog"==J.action){this.showError(null!=J.titleKey?mxResources.get(J.titleKey):J.title,null!=J.messageKey?mxResources.get(J.messageKey):mxUtils.htmlEntities(J.message),null!=J.buttonKey?mxResources.get(J.buttonKey):J.button);null!=J.modified&&(this.editor.modified=J.modified);return}if("layout"==J.action){this.executeLayoutSpec(J.layouts,mxUtils.bind(this,function(){var Fa=this.createLoadMessage("layout");Fa.message=J;K.postMessage(JSON.stringify(Fa),"*")}));return}if("prompt"==J.action){this.spinner.stop();
-var ua=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(Fa){null!=Fa?K.postMessage(JSON.stringify({event:"prompt",value:Fa,message:J}),"*"):K.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){K.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(ua.container,300,80,!0,!1);ua.init();return}if("draft"==J.action){var Da=
-aa(J.xml);this.spinner.stop();ua=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),Da,mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"discard",message:J}),"*")}),J.editKey?mxResources.get(J.editKey):null,J.discardKey?mxResources.get(J.discardKey):null,J.ignore?mxUtils.bind(this,function(){this.hideDialog();
-K.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(ua.container,640,480,!0,!1,mxUtils.bind(this,function(Fa){Fa&&this.actions.get("exit").funct()}));try{ua.init()}catch(Fa){K.postMessage(JSON.stringify({event:"draft",error:Fa.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var ha=1==J.enableRecent,k=1==J.enableSearch,u=1==J.enableCustomTemp;ua=new NewDialog(this,!1,J.templatesOnly?!1:null!=J.callback,mxUtils.bind(this,
-function(Fa,Ra,$a,fb){Fa=Fa||this.emptyDiagramXml;null!=J.callback?K.postMessage(JSON.stringify({event:"template",xml:Fa,blank:Fa==this.emptyDiagramXml,name:Ra,tempUrl:$a,libs:fb,builtIn:!0,message:J}),"*"):(c(Fa,V,Fa!=this.emptyDiagramXml,J.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,ha?mxUtils.bind(this,function(Fa){this.remoteInvoke("getRecentDiagrams",[null],null,Fa,function(){Fa(null,"Network Error!")})}):null,k?mxUtils.bind(this,function(Fa,Ra){this.remoteInvoke("searchDiagrams",
-[Fa,null],null,Ra,function(){Ra(null,"Network Error!")})}):null,mxUtils.bind(this,function(Fa,Ra,$a){K.postMessage(JSON.stringify({event:"template",docUrl:Fa,info:Ra,name:$a}),"*")}),null,null,u?mxUtils.bind(this,function(Fa){this.remoteInvoke("getCustomTemplates",null,null,Fa,function(){Fa({},0)})}):null,1==J.withoutType,null,J.templatesOnly);this.showDialog(ua.container,620,460,!0,!1,mxUtils.bind(this,function(Fa){null!=this.sidebar&&this.sidebar.hideTooltip();Fa&&!J.noExitOnCancel&&this.actions.get("exit").funct()}));
-ua.init();return}if("textContent"==J.action){var H=this.getDiagramTextContent();K.postMessage(JSON.stringify({event:"textContent",data:H,message:J}),"*");return}if("status"==J.action){this.updateStatus(mxUtils.bind(this,function(){null!=J.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(J.messageKey))):null!=J.message&&this.editor.setStatus(mxUtils.htmlEntities(J.message))}));null!=J.modified&&(this.editor.modified=J.modified);return}if("spinner"==J.action){var P=null!=J.messageKey?
-mxResources.get(J.messageKey):J.message;null==J.show||J.show?this.spinner.spin(document.body,P):this.spinner.stop();return}if("exit"==J.action){this.actions.get("exit").funct();return}if("viewport"==J.action){if(null!=J.viewport){var T=this.editor.graph,W=T.view.translate.x,fa=T.view.translate.y;this.embedViewport=J.viewport;T.refresh();this.diagramContainer.scrollTop-=(fa-T.view.translate.y)*T.view.scale;this.diagramContainer.scrollLeft-=(W-T.view.translate.x)*T.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==
-J.action){var X=this.actions.get(J.actionName);null!=X&&X.funct();return}if("resetEditor"==J.action){T=this.editor.graph;T.isEditing()&&T.stopEditing(!1);this.hideCurrentMenu();T.popupMenuHandler.hideMenu();T.clearSelection();return}if("fit"==J.action){T=this.editor.graph;var ea=T.maxFitScale;T.maxFitScale=null!=J.maxScale?J.maxScale:1;T.fit(null!=J.border?J.border:16,null,null,null,null,!0);T.maxFitScale=ea;P=this.createLoadMessage("fit");P.message=J;K.postMessage(JSON.stringify(P),"*");return}if("viewbox"==
-J.action){var oa=EditorUi.parseViewBox(J.viewbox);null!=oa&&this.applyViewBox(oa);P=this.createLoadMessage("viewbox");P.message=J;K.postMessage(JSON.stringify(P),"*");return}if("fullscreenChanged"==J.action){var la=null;try{var ca=this.diagramContainer.getAttribute("data-scrollState");null!=ca&&(this.diagramContainer.removeAttribute("data-scrollState"),la=JSON.parse(ca))}catch(Fa){}Editor.inlineFullscreen=J.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=la&&this.restoreScrollState(la);
-return}if("snapshot"==J.action){this.sendEmbeddedSvgExport(!0);return}if("export"==J.action){if("png"==J.format||"xmlpng"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){var sa=null!=J.xml?J.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);T=this.editor.graph;var xa=mxUtils.bind(this,function(Fa,Ra){if(J.withSvg)J.withSvg=!1,this.getEmbeddedSvg(sa,this.editor.graph,null,!0,function(fb){xa(Fa,fb)},null,null,J.embedImages,
-this.editor.graph.background,J.scale,J.border,J.shadow,"auto",null,J.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var $a=this.createLoadMessage("export");$a.format=J.format;$a.message=ka;$a.data=Fa;$a.svg=Ra;$a.xml=sa;K.postMessage(JSON.stringify($a),"*")}}),qa=mxUtils.bind(this,function(Fa){null==Fa&&(Fa=Editor.blankImage);"xmlpng"==J.format&&(Fa=Editor.writeGraphModelToPng(Fa,"tEXt","mxfile",encodeURIComponent(sa)));T!=this.editor.graph&&T.container.parentNode.removeChild(T.container);
-xa(Fa)}),Ba=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ma=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Ba){var Fa=T.getGlobalVariable;T=this.createTemporaryGraph(T.getStylesheet());for(var Ra,$a=0;$a<this.pages.length;$a++)if(this.pages[$a].getId()==Ba){Ra=this.updatePageRoot(this.pages[$a]);break}null==Ra&&(Ra=this.currentPage);T.getGlobalVariable=function(ub){return"page"==ub?
-Ra.getName():"pagenumber"==ub?1:Fa.apply(this,arguments)};document.body.appendChild(T.container);T.model.setRoot(Ra.root)}if(null!=J.layerIds){var fb=T.model,rb=fb.getChildCells(fb.getRoot()),mb=Object.create(null);for($a=0;$a<J.layerIds.length;$a++)mb[J.layerIds[$a]]=!0;for($a=0;$a<rb.length;$a++)fb.setVisible(rb[$a],mb[rb[$a].id]||!1)}$a=null;J.keepTheme&&($a=Editor.isDarkMode()?"dark":"light");null==J.width&&0<this.maxCanvasExportArea&&(rb=T.getGraphBounds(),mb=null!=J.border?J.border:0,fb=Math.ceil(rb.width/
-T.view.scale)+2*mb,rb=Math.ceil(rb.height/T.view.scale)+2*mb,mb=null!=J.scale?J.scale:1,fb*rb*mb*mb>this.maxCanvasExportArea&&(J.scale=Math.sqrt(this.maxCanvasExportArea/(fb*rb))));this.editor.exportToCanvas(mxUtils.bind(this,function(ub){qa(ub.toDataURL("image/png"))}),J.width,null,J.background,mxUtils.bind(this,function(){qa(null)}),null,null,J.scale,J.transparent,J.shadow,null,T,J.border,null,J.grid,$a,J.size)});null!=J.xml&&0<J.xml.length&&(l=!0,this.setFileData(sa),l=!1);ma()}else this.isRemoteExportEnabled()?
-(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==J.format?"1":"0")+(null!=Ba?"&pageId="+Ba:"")+(null!=J.layerIds&&0<J.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:J.layerIds})):"")+(null!=J.scale?"&scale="+J.scale:"")+"&base64=1&xml="+encodeURIComponent(sa))).send(mxUtils.bind(this,function(Fa){200<=Fa.getStatus()&&299>=Fa.getStatus()?xa("data:image/png;base64,"+Fa.getText()):qa(null)}),mxUtils.bind(this,function(){qa(null)})):qa(null)}}else if(ma=mxUtils.bind(this,
-function(){var Fa=this.createLoadMessage("export");Fa.message=J;if("html2"==J.format||"html"==J.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ra=this.getXmlFileData();Fa.xml=mxUtils.getXml(Ra);Fa.data=this.getFileData(null,null,!0,null,null,null,Ra);Fa.format=J.format}else if("html"==J.format)Ra=this.editor.getGraphXml(),Fa.data=this.getHtml(Ra,this.editor.graph),Fa.xml=mxUtils.getXml(Ra),Fa.format=J.format;else{if("xml"==J.format)Fa.xml=this.getFileData(!0),Fa.format=
-J.format,K.postMessage(JSON.stringify(Fa),"*");else if("json"==J.format)Fa.format=J.format,Fa.data=this.createJsonForExport(0!=J.allPages,1==J.includeData,1==J.compressed,1==J.selection),K.postMessage(JSON.stringify(Fa),"*");else{mxSvgCanvas2D.prototype.foAltText=null;var $a=null!=J.background?J.background:this.editor.graph.background;$a==mxConstants.NONE&&($a=null);Fa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);Fa.format="svg";var fb=mxUtils.bind(this,function(Eb){this.editor.graph.setEnabled(!0);
-this.spinner.stop();Fa.data=J.asText?Eb:Editor.createSvgDataUri(Eb);K.postMessage(JSON.stringify(Fa),"*")}),rb="auto";J.keepTheme&&(rb=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(rb=J.theme);if("xmlsvg"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){rb=null;if(this.isAutoDarkMode()||Editor.isDarkMode())rb="auto";null!=J.theme&&(rb=J.theme);this.getEmbeddedSvg(Fa.xml,this.editor.graph,null,!0,fb,null,null,J.embedImages,
-$a,J.scale,J.border,J.shadow,rb,J.embedCellMetadata,J.embedFonts)}}else if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){this.editor.graph.setEnabled(!1);var mb=this.editor.graph.createSvgImageExport(!1,J.embedCellMetadata?!0:!1);Ra=Object.create(null);var ub=this.getSvgWithFontLookup(Ra,mb,mxUtils.bind(this,function(){return this.editor.graph.getSvg($a,J.scale,J.border,null,null,null,null,mb,null,this.editor.graph.shadowVisible||
-J.shadow,null,rb)}));(this.editor.graph.shadowVisible||J.shadow)&&this.editor.graph.addSvgShadow(ub);this.embedFonts(ub,mxUtils.bind(this,function(Eb){J.embedImages||null==J.embedImages?this.editor.convertImages(Eb,mxUtils.bind(this,function(Fb){fb(mxUtils.getXml(Fb))})):fb(mxUtils.getXml(Eb))}),J.embedFonts,Ra)}}return}K.postMessage(JSON.stringify(Fa),"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var ta=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ta.apply(this,arguments);
-ma()}}l=!0;this.setFileData(J.xml);l=!1;this.editor.graph.mathEnabled||ma()}else ma();return}if("load"==J.action){ja=J.toSketch;q=1==J.autosave;this.embedDiffSync=null!=J.diffSync&&!1!==J.diffSync;this.embedDiffSyncPatchOnly="object"===typeof J.diffSync&&null!=J.diffSync&&1==J.diffSync.patchOnly;this.embedExportProtocol=1==J.exportProtocol;var va=J.sourceMetadata||null;Y=null!=J.layout?J.layout:null;this.hideDialog();null!=J.modified&&null==urlParams.modified&&(urlParams.modified=J.modified);null!=
-J.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=J.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=J.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=J.noSaveBtn);
-if(null!=J.rough){var Ha=Editor.sketchMode;this.doSetSketchMode(J.rough);Ha!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=J.dark&&this.setDarkMode(J.dark);null!=J.border&&(this.embedExportBorder=J.border);null!=J.theme&&(this.embedExportTheme=J.theme);null!=J.background&&(this.embedExportBackground=J.background);null!=J.viewport&&(this.embedViewport=J.viewport);this.embedExitPoint=null;var La=EditorUi.parseViewBox(J.viewbox);null==La&&null==J.viewbox&&null==J.scale&&
-null==J.fit&&(La=EditorUi.getViewBoxParam());if(null!=La)ia=mxUtils.bind(this,function(){this.applyViewBox(La)});else if(null!=J.scale){var Ia=J.scale,Ca=null!=J.scaleBorder?J.scaleBorder:this.embedExportBorder||0,Pa=null!=J.border?J.border:0;ia=mxUtils.bind(this,function(){var Fa=this.editor.graph,Ra=Fa.getGraphBounds();if(0<Ra.width&&0<Ra.height){var $a=Fa.view.scale;Fa.view.scaleAndTranslate(Ia,Fa.view.translate.x+Pa-Ra.x/$a+Ca/Ia,Fa.view.translate.y+Pa-Ra.y/$a+Ca/Ia)}})}else if(null!=J.fit){var Ka=
-null!=J.border?J.border:0,Na=J.maxFitScale||1;ia=mxUtils.bind(this,function(){var Fa=this.editor.graph,Ra=Fa.maxFitScale;Fa.maxFitScale=Na;Fa.fit(Ka,null,null,null,null,!0);Fa.maxFitScale=Ra})}if(null!=J.scroll&&null!=J.scroll.x&&null!=J.scroll.y){var Oa=J.scroll,Ea=ia;ia=mxUtils.bind(this,function(){null!=Ea&&Ea();var Fa=this.editor.graph,Ra=Fa.view.scale,$a=Fa.view.translate;mxUtils.hasScrollbars(Fa.container)?(Fa.container.scrollLeft=($a.x+Oa.x)*Ra,Fa.container.scrollTop=($a.y+Oa.y)*Ra):Fa.view.setTranslate(-Oa.x,
--Oa.y)})}if(null!=J.rect){Pa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,J.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,J.rect.top)+"px";this.minInlineWidth=J.minWidth;this.minInlineHeight=J.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Aa=J.maxFitScale,Ja=J.rect.width+2*Pa,Ga=J.rect.height+2*Pa;ia=mxUtils.bind(this,function(){var Fa=mxUtils.getDocumentSize();Ja=
-Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,Ja):Ja,Fa.width-80);Fa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Ga):Ga,Fa.height-80);this.diagramContainer.style.width=Ja+"px";this.diagramContainer.style.height=Fa+"px";var Ra=this.editor.graph;Fa=Ra.maxFitScale;Ra.maxFitScale=Aa;Ra.fit(2*Pa,null,null,null,null,null,Ga);this.setPageVisible("1"==urlParams.pv);if(null!=this.minInlineWidth&&Ra.getGraphBounds().width<this.minInlineWidth){var $a=Ra.container.scrollTop;
-this.resetScrollbars();Ra.container.scrollTop=$a}Ra.maxFitScale=Fa;Ra.container.scrollTop-=Pa;Ra.container.scrollLeft-=Pa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[J]));Ra.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Ra.container.style.top);var fb=Ra.getGraphBounds();Ra.container.clientWidth>fb.width+2*Pa&&(Ra.container.scrollLeft=
-fb.x+(fb.width+Pa-Ra.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&this.setEmbedTitle(J.title);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(Fa){}if(null!=J.xmlpng)J=this.extractGraphModelFromPng(J.xmlpng);else if(null!=J.descriptor){if(J=J.descriptor,"mermaid"==J.format){if(EditorUi.isMermaidSupported()){var Ua=mxUtils.bind(this,function(Fa){c(Fa,V,null,ja);Fa=this.createLoadMessage("load");
-Fa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);Fa.message=ka;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Fa),"*");if(null!=va&&null!=va.key&&null!=va.value){Fa=this.editor.graph;var Ra=Fa.getModel().getRoot();if(null!=Ra){Fa.getModel().beginUpdate();try{Fa.setAttributeForCell(Ra,va.key,va.value)}finally{Fa.getModel().endUpdate()}}}}),ab=mxUtils.bind(this,function(Fa){this.handleError(Fa)});J.image?this.parseMermaidImage(J.data,Ua,ab):
-this.parseMermaidDiagram(J.data,null,mxUtils.bind(this,function(Fa){J.wrap&&(Fa=mxMermaidToDrawio.wrapGroup(Fa,J.data,EditorUi.getInsertMermaidConfig(),{normalize:!0}));Ua(Fa)}),ab)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else J=J.xml}else{if("merge"==J.action){var Wa=this.getCurrentFile();null!=Wa&&(Da=aa(J.xml),null!=Da&&""!=Da&&Wa.mergeFile(new LocalFile(this,Da),mxUtils.bind(this,function(){this.embedDiffSync&&
-(A=this.clonePages(this.pages),x=hb());K.postMessage(JSON.stringify({event:"merge",message:J}),"*")}),function(Fa){K.postMessage(JSON.stringify({event:"merge",message:J,error:Fa}),"*")}))}else if("patch"==J.action){if(Wa=this.getCurrentFile(),null!=Wa&&null!=J.patch)try{l=!0,Wa.patch([J.patch]),this.embedDiffSync&&null!=A&&(A=this.applyPatches(A,[J.patch])),x=hb(),l=!1,ca={event:"patch",message:J},la=this.getHashValueForPages(this.pages),ca.checksum=la,null!=J.checksum&&J.checksum!=la&&(ca.checksumMismatch=
-!0),K.postMessage(JSON.stringify(ca),"*")}catch(Fa){l=!1,K.postMessage(JSON.stringify({event:"patch",message:J,error:Fa.message||Fa.toString()}),"*")}}else if("getDiff"==J.action){P={event:"getDiff",message:J};if(this.embedDiffSync&&null!=A){var cb=this.clonePages(this.pages);P.patch=this.diffPages(A,cb);P.checksum=this.getHashValueForPages(cb)}else P.xml=hb();K.postMessage(JSON.stringify(P),"*")}else"resetDiff"==J.action?this.embedDiffSync&&(null!=J.xml?(Da=aa(J.xml),Wa=this.getCurrentFile(),null!=
-Da&&""!=Da&&null!=Wa&&Wa.mergeFile(new LocalFile(this,Da),mxUtils.bind(this,function(){A=this.clonePages(this.pages);x=hb();K.postMessage(JSON.stringify({event:"resetDiff",message:J,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(Fa){K.postMessage(JSON.stringify({event:"resetDiff",message:J,error:Fa}),"*")})):(A=this.clonePages(this.pages),x=hb(),K.postMessage(JSON.stringify({event:"resetDiff",message:J,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==
-J.action?this.handleRemoteInvokeReady(K):"remoteInvoke"==J.action?this.handleRemoteInvoke(J,V.origin):"remoteInvokeResponse"==J.action?this.handleRemoteInvokeResponse(J):K.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(J)}),"*");return}}catch(Fa){this.handleError(Fa)}}var hb=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),wb=mxUtils.bind(this,function(Fa,Ra){l=!0;
-try{c(Fa,Ra,null,ja)}catch($a){this.handleError($a)}l=!1;this.editor.graph.model.prefix=Editor.guid()+"-";Ra=mxUtils.bind(this,function(){null!=urlParams.modified&&this.clearStatus();x=hb();this.embedDiffSync&&(A=this.clonePages(this.pages));q&&null==f&&(f=mxUtils.bind(this,function(fb,rb){fb=hb();if(fb!=x&&!l){rb=this.createLoadMessage("autosave");rb.message=ka;if(this.embedDiffSync&&null!=A){var mb=this.clonePages(this.pages),ub=this.diffPages(A,mb);mxUtils.isEmptyObject(ub)?rb.xml=fb:(rb.patch=
-ub,rb.checksum=this.getHashValueForPages(mb),this.embedDiffSyncPatchOnly||(rb.xml=fb));A=mb}else rb.xml=fb;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(rb),"*")}x=fb}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",
-f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("tooltipsEnabledChanged",f),this.addListener("pageViewChanged",f),this.addListener("connectionPointsChanged",f),this.addListener("connectionArrowsChanged",f));null!=ia&&ia();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var $a=this.createLoadMessage("load");$a.xml=null!=Y?hb():Fa;this.embedDiffSync&&
-null!=this.pages&&($a.checksum=this.getHashValueForPages(this.pages));K.postMessage(JSON.stringify($a),"*")}});null!=Y?this.executeLayoutSpec(Y,Ra):Ra()});null!=J&&"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,34)?(aa="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(Fa){wb(Fa,V)},mxUtils.bind(this,function(Fa){this.handleError(Fa)}),aa)):null!=J&&"function"===typeof J.substring&&
-this.isGliffyData(J,"")?this.importGliffy(J,mxUtils.bind(this,function(Fa){"<mxGraphModel"==Fa.substring(0,13)?wb(Fa,V):this.handleError({message:mxResources.get("unknownError")})}),mxUtils.bind(this,function(Fa){this.handleError({message:null!=Fa&&413==Fa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")})}),""):null!=J&&"function"===typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(Fa){wb(Fa)}),mxUtils.bind(this,function(Fa){this.handleError(Fa)})):
-null==J||"object"!==typeof J||null==J.format||null==J.data&&null==J.url?(J=aa(J),wb(J,V)):this.loadDescriptor(J,mxUtils.bind(this,function(Fa){wb(hb(),V)}),mxUtils.bind(this,function(Fa){this.handleError(Fa,mxResources.get("errorLoadingFile"))}))}}));var K=this.embedMessageSource||window.opener||window.parent;E="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";K.postMessage(E,"*");if("json"==urlParams.proto){var Q=this.editor.graph.openLink;this.editor.graph.openLink=
-function(V,J,ia){Q.apply(this,arguments);K.postMessage(JSON.stringify({event:"openLink",href:V,target:J,allowOpener:ia}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(V){for(var J=mxEvent.getSource(V);null!=J&&"A"!=J.nodeName;)J=J.parentNode;if(null!=J){var ia=J.getAttribute("href");null==ia||"#"==ia.charAt(0)||"javascript:"==ia.substring(0,11)||this.editor.graph.isCustomLink(ia)||(V.preventDefault(),this.editor.graph.openLink(ia,J.getAttribute("target")))}}),
-!0)}};EditorUi.prototype.createEmbedButton=function(c,f,l,q){var x=document.createElement("button");x.className="geEmbedBtn geBtn";x.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(x,c);q&&x.classList.add("gePrimaryBtn");mxEvent.addListener(x,"click",f);return x};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?
-this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?
-"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),
-this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));
-this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var q=JSON.parse(l),x=this.getSelectedLayoutContainer();null!=x&&Array.isArray(q)&&0<q.length?this.setContainerChildLayout(x,q):this.executeLayouts(this.editor.graph.createLayouts(q));
-this.lastLayoutSpec=this.customLayoutConfig=q;this.hideDialog()}catch(A){this.handleError(A)}}),null,null,null,null,mxUtils.bind(this,function(l,q){var x=this.createLayoutAddSelect(q);l.appendChild(x);x=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var A=q.value;q.value=JSON.stringify(JSON.parse(A));q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));
-q.value=A}catch(E){this.handleError(E)}}));x.setAttribute("title","copy");x.className="geBtn";l.appendChild(x)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var l={},q=0;q<f.length;q++)null!=f[q]&&(l[f[q].id]=!0);var x=function(A){return null!=
-A&&!0===l[A.id]};for(q=0;q<c.length;q++)f=c[q],"undefined"!==typeof ElkLayout&&f instanceof ElkLayout||void 0!==f.cellFilter?f.cellFilter=x:"function"===typeof f.isVertexIgnored&&function(A){var E=A.isVertexIgnored;A.isVertexIgnored=function(K){return E.apply(this,arguments)||!x(K)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,l=document.createElement("select");l.className="geBtn";l.style.marginRight="8px";l.style.maxWidth="180px";var q=document.createElement("option");q.value=
-"";mxUtils.write(q,mxResources.get("add")+"...");q.disabled=!0;q.selected=!0;l.appendChild(q);var x=[];"undefined"!==typeof ElkLayout&&(q=function(E,K){var Q=ElkLayout.MENU_PRESETS[E];return{label:E,kind:"elk",algo:Q.algorithm,preset:Q.options,layoutName:K}},x.push(q("verticalFlow","elkLayered")),x.push(q("horizontalFlow","elkLayered")),x.push(q("verticalTree","elkTree")),x.push(q("horizontalTree","elkTree")),x.push(q("radialTree","elkRadial")),x.push(q("organic","elkOrganic")));x.push({label:"orgChart",
-kind:"orgchart"});x.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});x.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&x.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(q=0;q<x.length;q++){var A=document.createElement("option");A.value=String(q);mxUtils.write(A,mxResources.get(x[q].label)+("elk"===x[q].kind||"orgchart"===
-x[q].kind?"...":""));l.appendChild(A)}mxEvent.addListener(l,"change",mxUtils.bind(this,function(){var E=parseInt(l.value);l.selectedIndex=0;if(!(isNaN(E)||0>E||E>=x.length)){var K=x[E],Q=c.value;if(0===mxUtils.trim(Q).length)var V=[];else{try{V=JSON.parse(Q)}catch(ia){f.handleError(ia);return}if(!Array.isArray(V)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var J=mxUtils.bind(this,function(ia){V.push(ia);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(V,null,
-2))});E=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(Q)});"elk"===K.kind?(f.hideDialog(),ElkLayout.runWithDialog(f,K.algo,K.preset,mxResources.get(K.label),function(ia,Y){ia=Graph.elkOptionsToConfig(ia,Y);J({layout:K.layoutName,config:ia})},E)):"orgchart"===K.kind?(f.hideDialog(),f.showOrgChartConfigDialog(J,E)):J({layout:K.layoutName,config:K.config||{}})}}));return l};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var l=2,q=20,x=20,A=document.createElement("div"),
-E=function(aa,ja){var ka=document.createElement("div");ka.style.marginTop="6px";ka.style.display="inline-block";ka.style.width="180px";mxUtils.write(ka,mxResources.get(aa)+": ");A.appendChild(ka);A.appendChild(ja)},K=document.createElement("select");K.style.width="160px";K.style.boxSizing="border-box";for(var Q=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),
-mxResources.get("smart")],V=0;V<Q.length;V++){var J=document.createElement("option");mxUtils.write(J,Q[V]);J.value=V;2===V&&J.setAttribute("selected","selected");K.appendChild(J)}mxEvent.addListener(K,"change",function(){l=parseInt(K.value)});E("orgChartType",K);var ia=document.createElement("input");ia.type="number";ia.value=q;ia.style.width="160px";ia.style.boxSizing="border-box";mxEvent.addListener(ia,"change",function(){q=parseInt(ia.value)});E("parentChildSpacing",ia);var Y=document.createElement("input");
-Y.type="number";Y.value=x;Y.style.width="160px";Y.style.boxSizing="border-box";mxEvent.addListener(Y,"change",function(){x=parseInt(Y.value)});E("siblingSpacing",Y);f=new CustomDialog(this,A,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:l,parentChildSpacing:q,siblingSpacing:x}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,
-mxUtils.bind(this,function(l){var q=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),x=mxUtils.bind(this,function(A){this.loadingOrgChart=!1;l.clear()&&this.handleError(A)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))q();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",
-function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",q,null,null,null,x)},null,null,null,x)},null,null,null,x)},null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",q,null,null,null,x)}),onerror)};EditorUi.prototype.importCsv=function(c,f,l,q){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,l)}),q)};EditorUi.prototype.doImportCsv=function(c,f,l){try{var q=c.split("\n"),x=[],A=[],E=[],K=Object.create(null);
-if(0<q.length){var Q=Object.create(null);l=null!=l?l:this.editor.graph;var V=null,J=null,ia=null,Y=null,aa=null,ja=null,ka=null,ua="whiteSpace=wrap;html=1;",Da=null,ha=null,k="",u="auto",H="auto",P=!1,T=null,W=null,fa=40,X=40,ea=100,oa=0,la=mxUtils.bind(this,function(){null!=f?f($a):(l.setSelectionCells($a),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ca=l.getFreeInsertPoint(!0),sa=ca.x,xa=
-ca.y;ca=xa;var qa=null,Ba="auto";ha=null;for(var ma=[],ta=null,va=null,Ha=0;Ha<q.length&&"#"==q[Ha].charAt(0);){c=q[Ha].replace(/\r$/,"");for(Ha++;Ha<q.length&&"\\"==c.charAt(c.length-1)&&"#"==q[Ha].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(q[Ha].substring(1)),Ha++;if("#"!=c.charAt(1)){var La=c.indexOf(":");if(0<La){var Ia=mxUtils.trim(c.substring(1,La)),Ca=mxUtils.trim(c.substring(La+1));"label"==Ia?qa=Graph.sanitizeHtml(Ca):"labelname"==Ia&&0<Ca.length&&"-"!=Ca?aa=Ca:"labels"==Ia&&0<Ca.length&&
-"-"!=Ca?ka=JSON.parse(Ca):"style"==Ia?J=Ca:"parentstyle"==Ia?ua=Ca:"unknownStyle"==Ia&&"-"!=Ca?ja=Ca:"stylename"==Ia&&0<Ca.length&&"-"!=Ca?Y=Ca:"styles"==Ia&&0<Ca.length&&"-"!=Ca?ia=JSON.parse(Ca):"vars"==Ia&&0<Ca.length&&"-"!=Ca?V=JSON.parse(Ca):"identity"==Ia&&0<Ca.length&&"-"!=Ca?Da=Ca:"parent"==Ia&&0<Ca.length&&"-"!=Ca?ha=Ca:"namespace"==Ia&&0<Ca.length&&"-"!=Ca?k=Ca:"width"==Ia?u=Ca:"height"==Ia?H=Ca:"collapsed"==Ia&&"-"!=Ca?P="true"==Ca:"left"==Ia&&0<Ca.length?T=Ca:"top"==Ia&&0<Ca.length?W=
-Ca:"ignore"==Ia?va=Ca.split(","):"connect"==Ia?ma.push(JSON.parse(Ca)):"link"==Ia?ta=Ca:"padding"==Ia?oa=parseFloat(Ca):"edgespacing"==Ia?fa=parseFloat(Ca):"nodespacing"==Ia?X=parseFloat(Ca):"levelspacing"==Ia?ea=parseFloat(Ca):"layout"==Ia&&(Ba=Ca)}}}if(null==q[Ha])throw Error(mxResources.get("invalidOrMissingFile"));var Pa=this.editor.csvToArray(q[Ha].replace(/\r$/,""));La=c=null;Ia=[];for(Ca=0;Ca<Pa.length;Ca++)Da==Pa[Ca]&&(c=Ca),ha==Pa[Ca]&&(La=Ca),Ia.push(mxUtils.trim(Pa[Ca]).replace(/[^a-z0-9]+/ig,
-"_").replace(/^\d+/,"").replace(/_+$/,""));null==qa&&(qa="%"+Ia[0]+"%");if(null!=ma)for(var Ka=0;Ka<ma.length;Ka++)null==Q[ma[Ka].to]&&(Q[ma[Ka].to]=Object.create(null));Da=[];for(Ca=Ha+1;Ca<q.length;Ca++){var Na=this.editor.csvToArray(q[Ca].replace(/\r$/,""));if(null==Na){var Oa=40<q[Ca].length?q[Ca].substring(0,40)+"...":q[Ca];throw Error(Oa+" ("+Ca+"):\n"+mxResources.get("containsValidationErrors"));}0<Na.length&&Da.push(Na)}l.model.beginUpdate();try{for(Ca=0;Ca<Da.length;Ca++){Na=Da[Ca];var Ea=
-null,Aa=null!=c?k+Na[c]:null;q=!1;null!=Aa&&(Ea=l.model.getCell(Aa),q=null==Ea||0<=mxUtils.indexOf(x,Ea));var Ja=new mxCell(qa,new mxGeometry(sa,ca,0,0),J||"whiteSpace=wrap;html=1;");Ja.collapsed=P;Ja.vertex=!0;Ja.id=Aa;null==Ea||q||l.model.setCollapsed(Ea,P);for(var Ga=0;Ga<Na.length;Ga++)l.setAttributeForCell(Ja,Ia[Ga],Na[Ga]),null==Ea||q||l.setAttributeForCell(Ea,Ia[Ga],Na[Ga]);if(null!=aa&&null!=ka){var Ua=Ja.getAttribute(aa),ab=null!=Ua&&Object.prototype.hasOwnProperty.call(ka,Ua)?ka[Ua]:null;
-null!=ab&&(l.labelChanged(Ja,ab),null==Ea||q||l.cellLabelChanged(Ea,ab))}if(null!=Y&&null!=ia){var Wa=Ja.getAttribute(Y),cb=null!=Wa&&Object.prototype.hasOwnProperty.call(ia,Wa)?ia[Wa]:null;null!=cb&&(Ja.style=cb)}l.setAttributeForCell(Ja,"placeholders","1");Ja.style=l.replacePlaceholders(Ja,Ja.style,V);null==Ea||q?l.fireEvent(new mxEventObject("cellsInserted","cells",[Ja])):(l.model.setStyle(Ea,Ja.style),0>mxUtils.indexOf(E,Ea)&&E.push(Ea),l.fireEvent(new mxEventObject("cellsInserted","cells",[Ea])));
-q=null!=Ea;Ea=Ja;if(!q)for(Ka=0;Ka<ma.length;Ka++)Q[ma[Ka].to][Ea.getAttribute(ma[Ka].to)]=Ea;null!=ta&&"link"!=ta&&(l.setLinkForCell(Ea,Ea.getAttribute(ta)),l.setAttributeForCell(Ea,ta,null));var hb=l.getPreferredSizeForCell(Ea);ha=null!=La?l.model.getCell(k+Na[La]):null;if(Ea.vertex){Oa=null!=ha?0:sa;Ha=null!=ha?0:xa;null!=T&&null!=Ea.getAttribute(T)&&(Ea.geometry.x=Oa+parseFloat(Ea.getAttribute(T)));null!=W&&null!=Ea.getAttribute(W)&&(Ea.geometry.y=Ha+parseFloat(Ea.getAttribute(W)));var wb="@"==
-u.charAt(0)?Ea.getAttribute(u.substring(1)):null;Ea.geometry.width=null!=wb&&"auto"!=wb?parseFloat(Ea.getAttribute(u.substring(1))):"auto"==u||"auto"==wb?hb.width+oa:parseFloat(u);var Fa="@"==H.charAt(0)?Ea.getAttribute(H.substring(1)):null;Ea.geometry.height=null!=Fa&&"auto"!=Fa&&"width"!=H?parseFloat(Fa):"auto"==H||"auto"==Fa?hb.height+oa:"width"==H?Ea.geometry.width:parseFloat(H);ca+=Ea.geometry.height+X}q?(null==K[Aa]&&(K[Aa]=[]),K[Aa].push(Ea)):(x.push(Ea),null!=ha?(ha.style=l.replacePlaceholders(ha,
-ua,V),l.addCell(Ea,ha),A.push(ha)):E.push(l.addCell(Ea)))}for(Ca=0;Ca<A.length;Ca++)wb="@"==u.charAt(0)?A[Ca].getAttribute(u.substring(1)):null,Fa="@"==H.charAt(0)?A[Ca].getAttribute(H.substring(1)):null,"auto"!=u&&"auto"!=wb||"auto"!=H&&"auto"!=Fa||l.updateGroupBounds([A[Ca]],oa,!0);var Ra=E.slice(),$a=E.slice();for(Ka=0;Ka<ma.length;Ka++){var fb=ma[Ka];for(Ca=0;Ca<x.length;Ca++){Ea=x[Ca];var rb=mxUtils.bind(this,function(Bb,Ib,Ab){var Db=Ib.getAttribute(Ab.from);if(null!=Db&&""!=Db){Db=Db.split(",");
-for(var z=0;z<Db.length;z++){var L=Q[Ab.to][Db[z]];if(null==L&&null!=ja){L=new mxCell(Db[z],new mxGeometry(sa,xa,0,0),ja);L.style=l.replacePlaceholders(Ib,L.style,V);var M=l.getPreferredSizeForCell(L);L.geometry.width=M.width+oa;L.geometry.height=M.height+oa;Q[Ab.to][Db[z]]=L;L.vertex=!0;L.id=Db[z];E.push(l.addCell(L))}if(null!=L){M=Ab.label;null!=Ab.fromlabel&&(M=(Ib.getAttribute(Ab.fromlabel)||"")+(M||""));null!=Ab.sourcelabel&&(M=l.replacePlaceholders(Ib,Ab.sourcelabel,V)+(M||""));null!=Ab.tolabel&&
-(M=(M||"")+(L.getAttribute(Ab.tolabel)||""));null!=Ab.targetlabel&&(M=(M||"")+l.replacePlaceholders(L,Ab.targetlabel,V));var S="target"==Ab.placeholders==!Ab.invert?L:Bb;S=null!=Ab.style?l.replacePlaceholders(S,Ab.style,V):l.createCurrentEdgeStyle();M=l.insertEdge(null,null,M||"",Ab.invert?L:Bb,Ab.invert?Bb:L,S);if(null!=Ab.labels)for(S=0;S<Ab.labels.length;S++){var Z=Ab.labels[S],da=new mxCell(Z.label||S,new mxGeometry(null!=Z.x?Z.x:0,null!=Z.y?Z.y:0,0,0),"resizable=0;html=1;");da.vertex=!0;da.connectable=
-!1;da.geometry.relative=!0;null!=Z.placeholders&&(da.value=l.replacePlaceholders("target"==Z.placeholders==!Ab.invert?L:Bb,da.value,V));if(null!=Z.dx||null!=Z.dy)da.geometry.offset=new mxPoint(null!=Z.dx?Z.dx:0,null!=Z.dy?Z.dy:0);M.insert(da)}if(null!=Ab.data)for(var na in Ab.data)l.setAttributeForCell(M,na,Ab.data[na]);$a.push(M);mxUtils.remove(Ab.invert?Bb:L,Ra)}}}});rb(Ea,Ea,fb);if(null!=K[Ea.id])for(Ga=0;Ga<K[Ea.id].length;Ga++)rb(Ea,K[Ea.id][Ga],fb)}}if(null!=va)for(Ca=0;Ca<x.length;Ca++)for(Ea=
-x[Ca],Ga=0;Ga<va.length;Ga++)l.setAttributeForCell(Ea,mxUtils.trim(va[Ga]),null);if(0<E.length){var mb=new mxParallelEdgeLayout(l);mb.spacing=fa;mb.checkOverlap=!0;var ub=function(){0<mb.spacing&&mb.execute(l.getDefaultParent());var Bb=0,Ib=0;0<E.length&&(Ib=l.getCellGeometry(E[0]),Bb=Math.round(l.snap(Ib.x))-Ib.x,Ib=Math.round(l.snap(Ib.y))-Ib.y);for(var Ab=0;Ab<E.length;Ab++){var Db=l.getCellGeometry(E[Ab]);Db.x=Math.round(Db.x+Bb);Db.y=Math.round(Db.y+Ib);"auto"==u&&(Db.width=Math.round(l.snap(Db.width)));
-"auto"==H&&(Db.height=Math.round(l.snap(Db.height)))}};"auto"==Ba&&1==Ra.length&&(Ba=$a.length==2*E.length-1?"verticaltree":"verticalflow");var Eb="organic"==Ba||null!=EditorUi.CSV_ELK_LAYOUTS[Ba]?null:this.resolveLayoutList(Ba);if(null!=Eb){var Fb=la;l.view.validate();var Tb=l.createLayouts(Eb);this.scopeLayoutsToCells(Tb,$a);this.executeLayouts(Tb,function(){ub();Fb()});la=null}else if("circle"==Ba){var Rb=new mxCircleLayout(l);Rb.disableEdgeStyle=!1;Rb.resetEdges=!1;var $b=Rb.isVertexIgnored;Rb.isVertexIgnored=
-function(Bb){return $b.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Rb.execute(l.getDefaultParent());ub()},!0,la);la=null}else if("verticaltree"==Ba||"horizontaltree"==Ba){l.view.validate();var Mb=new mxCompactTreeLayout(l,"horizontaltree"==Ba);Mb.levelDistance=X;Mb.edgeRouting=!1;Mb.resetEdges=!1;Mb.sortEdges=!0;var Wb=Mb.isVertexIgnored;Mb.isVertexIgnored=function(Bb){return Wb.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Mb.execute(l.getDefaultParent(),
-0<Ra.length?Ra[0]:null)},!0,la);la=null}else if("orgchart"==Ba){l.view.validate();var zb=new mxOrgChartLayout(l,2,ea,X),Ub=zb.isVertexIgnored;zb.isVertexIgnored=function(Bb){return Ub.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){zb.execute(l.getDefaultParent());ub()},!0,la);la=null}else if("organic"==Ba||"auto"==Ba&&$a.length>E.length){l.view.validate();var Lb=new mxFastOrganicLayout(l);Lb.forceConstant=3*X;Lb.disableEdgeStyle=!1;Lb.resetEdges=!1;var Xb=Lb.isVertexIgnored;
-Lb.isVertexIgnored=function(Bb){return Xb.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Lb.execute(l.getDefaultParent());ub()},!0,la);la=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[Ba]){l.view.validate();Fb=la;var bc=EditorUi.CSV_ELK_LAYOUTS[Ba],Hb=mxUtils.clone(bc.config);Hb["elk.spacing.nodeNode"]=X;Hb["elk.layered.spacing.nodeNodeBetweenLayers"]=ea;Hb["elk.spacing.edgeEdge"]=fa;Hb["elk.layered.spacing.edgeEdgeBetweenLayers"]=fa;var Ob=l.createLayouts([{layout:bc.layout,
-config:Hb}]);this.scopeLayoutsToCells(Ob,$a);l.model.beginUpdate();var ac=!1,Zb=function(){ac||(ac=!0,l.model.endUpdate())},Vb=this;try{Ob[0].prepare(l.getDefaultParent(),function(Bb,Ib){null!=Bb?(Zb(),Vb.handleError(Bb)):Vb.executeLayout(function(){Ib();var Ab=l.getBoundingBoxFromGeometry($a);null!=Ab&&l.moveCells($a,sa-Ab.x,xa-Ab.y)},!0,function(){Zb();Fb()})})}catch(Bb){throw Zb(),Bb;}la=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=la&&la()}}catch(Bb){this.handleError(Bb)}};EditorUi.prototype.getSearch=
-function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",q;for(q in urlParams)0>mxUtils.indexOf(c,q)&&null!=urlParams[q]&&(f+=l+q+"="+urlParams[q],l="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
-q;for(q in urlParams)0>mxUtils.indexOf(l,q)&&(c=0==f?c+"?":c+"&",null!=urlParams[q]&&(c+=q+"="+urlParams[q],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,l,q,x){c=new LinkDialog(this,c,f,l,!0,q,x);this.showDialog(c.container,440,null,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||
-f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());
-this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);
-this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=
-function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:
-c[f].expand)};var N=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){N.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),l=this.getSelectionState(),q=this.isDiagramActive(),x="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&x);this.actions.get("redo").setEnabled(this.canRedo()&&x);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());
-this.actions.get("guides").setEnabled(q);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(q&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(q&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(q&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(q&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(q&&
-l.image&&0<l.cells.length);this.actions.get("pageSetup").setEnabled(q);this.actions.get("shadowVisible").setEnabled(q);this.actions.get("connectionArrows").setEnabled(q);this.actions.get("connectionPoints").setEnabled(q);this.actions.get("copyStyle").setEnabled(q&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&q&&0<l.cells.length);this.actions.get("copyTextStyle").setEnabled(q&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&
-q&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length&&!l.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<l.cells.length);this.actions.get("createShape").setEnabled(q);this.actions.get("createRevision").setEnabled(q);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(q&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=
-f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=
-f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(q&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var R=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),
-this.exportDialog=null);R.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,q,x,A,E,K){var Q=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(Q.getSvg(q,x,A)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),J=Q.getGraphBounds(),ia=Math.floor(J.width*x/
-Q.view.scale),Y=Math.floor(J.height*x/Q.view.scale);if(V.length<=MAX_REQUEST_SIZE&&ia*Y<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas())if(c.isRemoteExportEnabled()){var aa={globalVars:Q.getExportVariables()};K&&(aa.grid={size:Q.gridSize,steps:Q.view.gridSteps,color:Q.view.gridColor});c.saveRequest(f,l,function(ja,ka){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(ka||"0")+(null!=ja?"&filename="+encodeURIComponent(ja):"")+"&extras="+encodeURIComponent(JSON.stringify(aa))+
-(0<E?"&dpi="+E:"")+"&bg="+(null!=q?q:"none")+"&w="+ia+"&h="+Y+"&border="+A+"&xml="+encodeURIComponent(V))})}else c.handleError({message:mxResources.get("notAvailable")});else"png"==l?c.exportImage(x,null==q||"none"==q,!0,!1,!1,A,!0,!1,null,K,E):c.exportImage(x,!1,!0,!1,!1,A,!0,!1,"jpeg",K);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var q=
-c;this.currentPage!=this.pages[l]&&(q=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),q.model.setRoot(this.pages[l].root));f+=this.pages[l].getName()+" "+q.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,l){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){l.label=
-mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));l.html=f;return}l.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var l={id:c.getId()};l.type=f?"layer":c.edge?"edge":c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(l.parent=f.getId()));c.edge&&(null!=c.source&&(l.source=c.source.getId()),null!=c.target&&(l.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),l);c=f.attributes;f={};for(var q=0,x=0;x<c.length;x++){var A=
-c[x].nodeName;"label"!=A&&"placeholders"!=A&&"id"!=A&&(f[A]=c[x].nodeValue,q++)}0<q&&(l.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,l);return l};EditorUi.prototype.getJsonForPage=function(c,f){var l=this.editor.graph.getModel();var q=null==c||c==this.currentPage?l.getRoot():this.updatePageRoot(c).root;var x=[],A=mxUtils.bind(this,function(J,ia){x.push(this.getJsonForExportCell(J,ia));ia=J.getChildCount();for(var Y=0;Y<ia;Y++)A(J.getChildAt(Y),!1)});if(null!=f){q={};for(var E=0;E<
-f.length;E++)q[f[E].getId()]=!0;for(E=0;E<f.length;E++){for(var K=f[E],Q=K.getParent(),V=!1;null!=Q;){if(q[Q.getId()]){V=!0;break}Q=Q.getParent()}V||A(K,l.isLayer(K))}}else for(f=q.getChildCount(),E=0;E<f;E++)A(q.getChildAt(E),!0);E={};null!=c&&(E.id=c.getId(),E.name=c.getName());E.cells=x;return E};EditorUi.prototype.createJsonForExport=function(c,f,l,q){var x={version:EditorUi.VERSION};f&&(x.data=mxUtils.getXml(this.getXmlFileData(!q,!c,!l)));f=[];if(q)f.push(this.getJsonForPage(this.currentPage,
-this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));x.pages=f;return x};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},l=document.createElement("div");l.style.whiteSpace="nowrap";var q=document.createElement("h3");mxUtils.write(q,mxUtils.htmlEntities(c));l.appendChild(q);var x=document.createElement("div");x.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";
-x.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var A={};try{var E=mxSettings.getCustomLibraries();for(c=0;c<E.length;c++){var K=E[c];if("R"==K.substring(0,1)){var Q=JSON.parse(decodeURIComponent(K.substring(1)));A[Q[0]]={id:Q[0],title:Q[1],downloadUrl:Q[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){x.innerText="";if(0==V.length)x.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+
-"</div>";else for(var J=0;J<V.length;J++){var ia=V[J];A[ia.id]&&(f[ia.id]=ia);var Y=this.addCheckbox(x,ia.title,A[ia.id]);(function(aa,ja){mxEvent.addListener(ja,"change",function(){this.checked?f[aa.id]=aa:delete f[aa.id]})})(ia,Y)}},mxUtils.bind(this,function(V){x.innerText="";var J=document.createElement("div");J.style.padding="8px";J.style.textAlign="center";mxUtils.write(J,mxResources.get("error")+": ");mxUtils.write(J,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));x.appendChild(J)}));
-l.appendChild(x);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var V=0,J;for(J in f)null==A[J]&&(V++,mxUtils.bind(this,function(ia){this.remoteInvoke("getFileContent",[ia.downloadUrl],null,mxUtils.bind(this,function(Y){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,Y,ia)),this.showSidebar()}catch(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();
-this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[J]));for(J in A)f[J]||this.closeLibrary(new RemoteLibrary(this,null,A[J]));0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},
-setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=null!=f?f.callbackId:null,q="number"===typeof l&&0<=l&&l<this.remoteInvokeCallbacks.length?
-this.remoteInvokeCallbacks[l]:null;if(null==q)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?q.error&&q.error(c.error.errResp):q.callback&&q.callback.apply(this,c.resp);this.remoteInvokeCallbacks[l]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,q,x){var A=!0,E=window.setTimeout(mxUtils.bind(this,function(){A=!1;x({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),K=mxUtils.bind(this,function(){window.clearTimeout(E);A&&q.apply(this,arguments)}),
-Q=mxUtils.bind(this,function(){window.clearTimeout(E);A&&x.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:K,error:Q});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var l=mxUtils.bind(this,function(V,J){var ia={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};
-null!=J?ia.error={errResp:J}:null!=V&&(ia.resp=V);this.remoteWin.postMessage(JSON.stringify(ia),"*")});try{var q=c.funtionName,x=null!=q&&Object.prototype.hasOwnProperty.call(this.remoteInvokableFns,q)?this.remoteInvokableFns[q]:null;if(null!=x&&"function"===typeof this[q]){if(x.allowedDomains){for(var A=!1,E=0;E<x.allowedDomains.length;E++)if(f=="https://"+x.allowedDomains[E]){A=!0;break}if(!A){l(null,"Invalid Call: "+q+" is not allowed.");return}}var K=c.functionArgs;Array.isArray(K)||(K=[]);if(x.isAsync)K.push(function(){l(Array.prototype.slice.apply(arguments))}),
-K.push(function(V){l(null,V||"Unkown Error")}),this[q].apply(this,K);else{var Q=this[q].apply(this,K);l([Q])}}else l(null,"Invalid Call: "+q+" is not found.")}catch(V){l(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var q=l.open("database",2);q.onupgradeneeded=function(x){try{var A=q.result;1>x.oldVersion&&A.createObjectStore("objects",{keyPath:"key"});
-2>x.oldVersion&&(A.createObjectStore("files",{keyPath:"title"}),A.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(E){null!=f&&f(E)}};q.onsuccess=mxUtils.bind(this,function(x){try{var A=q.result;this.database=A;EditorUi.migrateStorageFiles&&(StorageFile.migrate(A),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,
-function(E){if((!E||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var K=document.createElement("iframe");K.style.display="none";K.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(K);var Q=!0,V=!1,J,ia=0,Y=mxUtils.bind(this,function(){V=!0;this.setDatabaseItem(".drawioMigrated3",!0);K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),aa=mxUtils.bind(this,
-function(){ia++;ja()}),ja=mxUtils.bind(this,function(){try{if(ia>=J.length)Y();else{var ua=J[ia];StorageFile.getFileContent(this,ua,mxUtils.bind(this,function(Da){null==Da||".scratchpad"==ua&&Da==this.emptyLibraryXml?K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[ua]}),"*"):aa()}),aa)}}catch(Da){console.log(Da)}}),ka=mxUtils.bind(this,function(ua){try{this.setDatabaseItem(null,[{title:ua.title,size:ua.data.length,lastModified:Date.now(),
-type:ua.isLib?"L":"F"},{title:ua.title,data:ua.data}],aa,aa,["filesInfo","files"])}catch(Da){console.log(Da)}});E=mxUtils.bind(this,function(ua){try{if(ua.source==K.contentWindow){var Da={};try{Da=JSON.parse(ua.data)}catch(ha){}"init"==Da.event?(K.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=Da.event||V||(Q?null!=Da.resp&&0<Da.resp.length&&
-null!=Da.resp[0]?(J=Da.resp[0],Q=!1,ja()):Y():null!=Da.resp&&0<Da.resp.length&&null!=Da.resp[0]?ka(Da.resp[0]):aa())}}catch(ha){console.log(ha)}});window.addEventListener("message",E)}})));c(A);A.onversionchange=function(){A.close()}}catch(E){null!=f?f(E):null!=window.console&&console.warn(E)}});q.onerror=f;q.onblocked=function(){}}catch(x){null!=f?f(x):null!=window.console&&console.error(x)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=
-function(c,f,l,q,x){this.openDatabase(mxUtils.bind(this,function(A){try{x=x||"objects";Array.isArray(x)||(x=[x],c=[c],f=[f]);var E=A.transaction(x,"readwrite");E.oncomplete=l;E.onerror=q;for(A=0;A<x.length;A++)E.objectStore(x[A]).put(null!=c&&null!=c[A]?{key:c[A],data:f[A]}:f[A])}catch(K){null!=q&&q(K)}}),q)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c]);var A=x.transaction(q,"readwrite");
-A.oncomplete=f;A.onerror=l;for(x=0;x<q.length;x++)A.objectStore(q[x]).delete(c[x])}catch(E){null!=l&&l(E)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";var A=x.transaction([q],"readonly").objectStore(q).get(c);A.onsuccess=function(){f(A.result)};A.onerror=l}catch(E){null!=l&&l(E)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(q){try{l=l||"objects";var x=q.transaction([l],
-"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),A=[];x.onsuccess=function(E){null==E.target.result?c(A):(A.push(E.target.result.value),E.target.result.continue())};x.onerror=f}catch(E){null!=f&&f(E)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(q){try{l=l||"objects";var x=q.transaction([l],"readonly").objectStore(l).getAllKeys();x.onsuccess=function(){c(x.result)};x.onerror=f}catch(A){null!=f&&f(A)}}),f)};EditorUi.prototype.commentsSupported=
-function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var l=this.getCurrentFile();null!=l?l.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,l){var q=this.getCurrentFile();
-null!=q?q.addComment(c,f,l):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.anchoredCommentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.anchoredCommentsSupported():!1};EditorUi.prototype.mentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionsSupported():
-!1};EditorUi.prototype.freeMentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.freeMentionsSupported():!1};EditorUi.prototype.mentionsLiveSearch=function(){var c=this.getCurrentFile();return null!=c?c.mentionsLiveSearch():!1};EditorUi.prototype.mentionNotificationsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionNotificationsSupported():!0};EditorUi.prototype.getMentionCandidates=function(c,f,l){var q=this.getCurrentFile();null!=q?q.getMentionCandidates(c,
-f,l):c([])};EditorUi.prototype.serializeMention=function(c){return"+"+c.email};EditorUi.prototype.parseMentionTokens=function(c){for(var f=/[+@]([A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,})/g,l=[],q=0,x;null!=(x=f.exec(c));)x.index>q&&l.push(c.substring(q,x.index)),l.push({email:x[1]}),q=x.index+x[0].length;q<c.length&&l.push(c.substring(q));return l};EditorUi.prototype.getCommentCacheTarget=function(){var c=this.getCurrentFile();return null!=c?c:this};EditorUi.prototype.refreshCommentCache=
-function(c,f){if(this.commentsSupported()){var l=this.getCommentCacheTarget();if(null!=l.commentCacheCallbacks)l.commentCacheCallbacks.push([c,f]);else{l.commentCacheCallbacks=[[c,f]];var q=mxUtils.bind(this,function(x,A){var E=l.commentCacheCallbacks;l.commentCacheCallbacks=null;for(var K=0;null!=E&&K<E.length;K++)if(null!=E[K][x])E[K][x](A)});this.getComments(mxUtils.bind(this,function(x){this.getCommentCacheTarget()==l&&(l.commentCache=x,this.fireEvent(new mxEventObject("commentsChanged")));q(0,
-x)}),mxUtils.bind(this,function(x){q(1,x)}))}}else null!=c&&c(null)};EditorUi.prototype.commentsUpdated=function(){if(this.commentsSupported()){var c=this.getCurrentFile();null!=c&&null!=c.sync&&c.sync.sendCommentsChangedMessage();this.refreshCommentCache()}};EditorUi.prototype.getUnresolvedCommentCount=function(){var c=this.getCommentCacheTarget().commentCache,f=0;if(null!=c)for(var l=0;l<c.length;l++)c[l].isResolved||f++;return f};EditorUi.prototype.getCommentAnchorCells=function(c){var f=c.getAnchorCellIds(),
-l=[];if(null!=f&&0<f.length){c=c.getAnchorPageId();var q=null==c?this.currentPage:this.getPageById(c);if(null!=q)if(q==this.currentPage)for(c=0;c<f.length;c++)q=this.editor.graph.model.getCell(f[c]),null!=q&&l.push(q);else{try{this.updatePageRoot(q)}catch(K){return l}if(null!=q.root){var x={},A=0;for(c=0;c<f.length;c++)x[f[c]]||(x[f[c]]=!0,A++);var E=function(K){if(0<A){x[K.getId()]&&(x[K.getId()]=!1,l.push(K),A--);for(var Q=0;Q<K.getChildCount();Q++)E(K.getChildAt(Q))}};E(q.root)}}}return l};EditorUi.prototype.gotoCommentAnchor=
-function(c){var f=c.getAnchorPageId();if(null!=f&&null!=this.currentPage&&f!=this.currentPage.getId()){f=this.getPageById(f);if(null==f)return!1;this.selectPage(f)}f=this.editor.graph;var l=c.getAnchorCellIds();if(null!=l&&0<l.length){c=[];for(var q=0;q<l.length;q++){var x=f.model.getCell(l[q]);null!=x&&c.push(x)}return 0<c.length?(f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c,"#0071e3",2E3),f.scrollCellToVisible(c[0]),!0):!1}l=c.getAnchorRect();null!=l&&0<l.w&&0<l.h&&f.fitWindow(new mxRectangle(l.x,
-l.y,l.w,l.h),0);c=c.getAnchorPoint();if(null!=c){l=f.view.scale;q=f.view.translate;f=f.container;f.scrollLeft=Math.round((c.x+q.x)*l-f.clientWidth/2);f.scrollTop=Math.round((c.y+q.y)*l-f.clientHeight/2);var A=document.createElement("div");A.className="geCommentAnchorMarker";A.style.left=Math.round((c.x+q.x)*l)+"px";A.style.top=Math.round((c.y+q.y)*l)+"px";f.appendChild(A);window.setTimeout(function(){null!=A.parentNode&&A.parentNode.removeChild(A)},2E3)}return!0};EditorUi.prototype.addCommentsBadge=
-function(c){var f=document.createElement("span");f.className="geCommentsBadge";f.style.display="none";c.appendChild(f);c=mxUtils.bind(this,function(){var l=this.getUnresolvedCommentCount();f.style.display=0<l?"":"none";f.innerText="";mxUtils.write(f,99<l?"99+":String(l))});this.addListener("commentsChanged",c);this.editor.addListener("fileLoaded",c);c();return f};EditorUi.prototype.installCommentDragSource=function(c){var f=this,l=document.createElement("div");l.style.width="24px";l.style.height=
-"24px";l.style.backgroundImage="url("+Editor.lightDarkCommentImage+")";l.style.backgroundSize="100% 100%";l.style.opacity="0.9";c=mxUtils.makeDraggable(c,function(){return f.editor.graph},function(x,A,E,K,Q){null!=f.currentPage&&null!=f.menus&&null!=f.menus.showCommentsWindow&&(x=null!=E?{p:f.currentPage.getId(),c:E.id}:{p:f.currentPage.getId(),pt:{x:Math.round(K),y:Math.round(Q)}},f.menus.showCommentsWindow(null,x))},l);var q=c.mouseDown;c.mouseDown=function(x){mxEvent.isMouseEvent(x)&&!mxEvent.isPopupTrigger(x)&&
-f.commentsSupported()&&f.anchoredCommentsSupported()&&f.canComment()&&q.apply(this,arguments)};return c};EditorUi.prototype.updateCommentOverlays=function(){var c=this.editor.graph;if(null!=this.commentOverlays)for(var f=0;f<this.commentOverlays.length;f++)c.removeCellOverlay(this.commentOverlays[f].cell,this.commentOverlays[f].overlay);this.commentOverlays=null;var l=this.getCurrentFile();if(null!=l&&l.anchoredCommentsSupported()&&null!=l.commentCache&&!this.editor.isChromelessView()){var q=null!=
-this.currentPage?this.currentPage.getId():null,x={};for(f=0;f<l.commentCache.length;f++){var A=l.commentCache[f],E=A.getAnchorCellIds();if(!A.isResolved&&null!=E&&A.getAnchorPageId()==q)for(A=0;A<E.length;A++)x[E[A]]=!0}this.commentOverlays=[];for(var K in x)mxUtils.bind(this,function(Q){var V=c.model.getCell(Q);if(null!=V){var J=new mxCellOverlay(new mxImage(Editor.lightDarkCommentImage,16,16),mxResources.get("comments"),mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,new mxPoint(8,8));J.isCommentOverlay=
-!0;J.cursor="pointer";J.addListener(mxEvent.CLICK,mxUtils.bind(this,function(){null!=this.menus&&null!=this.menus.showCommentsWindow&&this.menus.showCommentsWindow(Q)}));c.addCellOverlay(V,J);this.commentOverlays.push({cell:V,overlay:J})}})(K)}};EditorUi.prototype.newComment=function(c,f){var l=this.getCurrentFile();return null!=l?l.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=
-c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};
-EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,q,x,A,E,K){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,q,x,A,E,K)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");
-return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,ka){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,q,x,A,
-E,K,Q,V,J,ia,Y,aa,ja,ka)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,q){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,q)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,
-f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,l,q){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,l,q)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,l,q,x){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");
-return Editor.writeGraphModelToPng(c,f,l,q,x)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var l=localStorage.key(f),q=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<q.length){var x="<mxfile "===q.substring(0,8)||"<?xml"===q.substring(0,5)||"\x3c!--[if IE]>"===q.substring(0,12);q="<mxlibrary>"===q.substring(0,11);(x||
-q)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
-var CommentsWindow=function(b,d,m,p,t,n){function y(){for(var ma=T.getElementsByTagName("div"),ta=0,va=0;va<ma.length;va++)"none"!=ma[va].style.display&&ma[va].parentNode==T&&ta++;W.style.display=0==ta?"block":"none"}function C(ma){for(var ta=0;ta<ha.length;ta++)if(null!=ha[ta].email&&null!=ma&&ha[ta].email.toLowerCase()==ma.toLowerCase())return ha[ta].displayName||ma;return ma}function O(ma){var ta=document.createElement("span");ta.className="geCommentMention";ta.setAttribute("data-mention",b.serializeMention(ma));
-null!=ma.email&&ta.setAttribute("data-email",ma.email);ta.contentEditable="false";mxUtils.write(ta,"@"+(ma.displayName||(null!=ma.email?C(ma.email):ma.id)));return ta}function F(ma,ta){ma.innerText="";ta=null!=ta?ta:"";if(aa){ta=b.parseMentionTokens(ta);for(var va=0;va<ta.length;va++)"string"===typeof ta[va]?mxUtils.write(ma,ta[va]):ma.appendChild(O(ta[va]))}else mxUtils.write(ma,ta)}function N(ma,ta,va,Ha){function La(Ra){for(var $a in ab)for(var fb=0;fb<ab[$a].length;fb++)Ra(ab[$a][fb],"down"==
+var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainers=function(){for(var c=this.editor.graph,f=c.getSelectionCells(),l=[],q=0;q<f.length;q++)if(c.model.isVertex(f[q])){var x=c.getCellStyle(f[q]).childLayout;
+if(null!=x&&"tableLayout"!=x&&"stackLayout"!=x&&"rack"!=x)l.push(f[q]);else return[]}return l};EditorUi.prototype.applyLayoutToSelectedContainers=function(c){var f=this.getSelectedLayoutContainers();if(0==f.length)return!1;var l=this.editor.graph.model;l.beginUpdate();try{for(var q=0;q<f.length;q++)this.setContainerChildLayout(f[q],c)}finally{l.endUpdate()}return!0};EditorUi.prototype.setContainerChildLayout=function(c,f){var l=this.editor.graph,q=f,x=null,A=null;if("string"!==typeof f){if(!Array.isArray(f)||
+0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));q=[];for(var E=0;E<f.length;E++){var K=f[E];if(null!=K&&("mxRadialTreeLayout"==K.layout||"mxOrgChartLayout"==K.layout||"mxFastOrganicLayout"==K.layout||"mxCircleLayout"==K.layout))throw Error("Not supported as childLayout: "+K.layout);if(null!=K&&null!=Graph.elkLayoutAlgorithms[K.layout]){var Q={},V;for(V in K.config)Q[V]=K.config[V];delete Q.rootCellIds;delete Q.preserveOrigin;null==Q.resizeNodes&&(Q.resizeNodes=!1);null==Q.resizeLayoutRoot&&
+(Q.resizeLayoutRoot=!0);"elkLayered"==K.layout&&(null==Q.extractIsolated&&(Q.extractIsolated=!1),null==Q["elk.layered.considerModelOrder.strategy"]&&(Q["elk.layered.considerModelOrder.strategy"]=Menus.flowModelOrder));null!=Q.corners&&(A=Q.corners);if(null!=Q.groupPadding&&(x=String(Q.groupPadding),/[;=]/.test(x)))throw Error("Invalid groupPadding: "+x);K={layout:K.layout,config:Q}}q.push(K)}l.createLayouts(q);q=Graph.encodeChildLayout(q)}if(0<=q.indexOf(";"))throw Error("Invalid childLayout: "+q);
+l.model.beginUpdate();try{var J=l.model.getStyle(c);l.setCellStyles("childLayout",q,[c]);null!=x&&l.setCellStyles("groupPadding",x,[c]);null!=A&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(l,c,A);l.model.getStyle(c)==J&&null!=l.layoutManager&&l.layoutManager.executeLayout(c,!1)}finally{l.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,l){var q=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=
+ElkLayout.MENU_PRESETS},function(){try{var x=q.resolveLayoutList(c);null!=x?(q.lastLayoutSpec=x,l&&Array.isArray(x)&&0<x.length&&q.applyLayoutToSelectedContainers(x)?null!=f&&f():q.executeLayouts(q.editor.graph.createLayouts(x),f)):q.handleError(Error("Unknown layout: "+c))}catch(A){q.handleError(A)}},function(){q.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.applyChildLayouts=function(c){var f=this.editor.graph,l=function(){try{f.executeAllChildLayouts()}catch(q){null!=
+window.console&&console.error(q)}null!=c&&c()};(function(){if("undefined"!==typeof ElkLayout)return!1;for(var q=f.getChildLayoutCells(),x=0;x<q.length;x++)try{for(var A=Graph.decodeChildLayout(f.getCellStyle(q[x]).childLayout),E=0;null!=A&&E<A.length;E++)if(null!=A[E]&&"string"===typeof Graph.elkLayoutAlgorithms[A[E].layout])return!0}catch(K){}return!1})()?this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout},l,l):l()};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&
+null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,l=c.ctrlKey||c.metaKey,q=null!=c.key?c.key.toLowerCase():"",x=0;x<f.length;x++){var A=f[x];if(q===String(A.key).toLowerCase()&&l===!!A.ctrl&&c.shiftKey===!!A.shift&&c.altKey===!!A.alt){c.preventDefault();c.stopImmediatePropagation();null!=A.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:A.command}),"*");
+break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};
+EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===typeof c.keyCode&&1==c.keyCode.length,l=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(l))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var q=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:c.shift?this.altShiftActions:this.altActions;null!=c.action?q[l]=c.action:delete q[l]}else null!=c.action?(q=mxUtils.bind(this,function(){var x=this.actions.get(c.action);
+null!=x&&x.isEnabled()&&x.funct.apply(this,arguments)}),c.control?c.shift?this.keyHandler.bindControlShiftKey(l,q):this.keyHandler.bindControlKey(l,q):c.shift?this.keyHandler.bindShiftKey(l,q):this.keyHandler.bindKey(l,q)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:this.keyHandler.normalKeys)[l];null!=c.action&&(q=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=l&&57>=l||65<=l&&90>=l?String.fromCharCode(l):EditorUi.keyNames[l],
+null!=q&&null!=f&&(q.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,l=!1,q=!1,x=null,A=null;this.installPassThroughKeys();var E=mxUtils.bind(this,function(V,J){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});
+this.editor.graph.model.addListener(mxEvent.CHANGE,E);mxEvent.addListener(window,"message",mxUtils.bind(this,function(V){if(V.source==(this.embedMessageSource||window.opener||window.parent)){var J=V.data,ia=null,Y=null,aa=mxUtils.bind(this,function(Fa){if(null!=Fa&&"function"===typeof Fa.charAt&&"<"!=Fa.charAt(0))try{Editor.isPngDataUrl(Fa)?Fa=Editor.extractGraphModelFromPng(Fa):"data:image/svg+xml;base64,"==Fa.substring(0,26)?Fa=atob(Fa.substring(26)):"data:image/svg+xml;utf8,"==Fa.substring(0,24)&&
+(Fa=Fa.substring(24)),null!=Fa&&(""==Fa.trim()?Fa=null:"%"==Fa.charAt(0)?Fa=decodeURIComponent(Fa):"<"!=Fa.charAt(0)&&(Fa=Graph.decompress(Fa)))}catch(Ra){}return Fa});if("json"==urlParams.proto){var ja=!1;try{J=JSON.parse(J),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[V],"data",[J])}catch(Fa){J=null}try{var la=J;if(null==J)return;if("dialog"==J.action){this.showError(null!=J.titleKey?mxResources.get(J.titleKey):J.title,null!=J.messageKey?mxResources.get(J.messageKey):mxUtils.htmlEntities(J.message),
+null!=J.buttonKey?mxResources.get(J.buttonKey):J.button);null!=J.modified&&(this.editor.modified=J.modified);return}if("layout"==J.action){this.executeLayoutSpec(J.layouts,mxUtils.bind(this,function(){var Fa=this.createLoadMessage("layout");Fa.message=J;K.postMessage(JSON.stringify(Fa),"*")}));return}if("prompt"==J.action){this.spinner.stop();var ua=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(Fa){null!=Fa?K.postMessage(JSON.stringify({event:"prompt",
+value:Fa,message:J}),"*"):K.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){K.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(ua.container,300,80,!0,!1);ua.init();return}if("draft"==J.action){var Da=aa(J.xml);this.spinner.stop();ua=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),Da,mxUtils.bind(this,function(){this.hideDialog();
+K.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"discard",message:J}),"*")}),J.editKey?mxResources.get(J.editKey):null,J.discardKey?mxResources.get(J.discardKey):null,J.ignore?mxUtils.bind(this,function(){this.hideDialog();K.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(ua.container,640,480,!0,!1,mxUtils.bind(this,function(Fa){Fa&&
+this.actions.get("exit").funct()}));try{ua.init()}catch(Fa){K.postMessage(JSON.stringify({event:"draft",error:Fa.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var ha=1==J.enableRecent,k=1==J.enableSearch,u=1==J.enableCustomTemp;ua=new NewDialog(this,!1,J.templatesOnly?!1:null!=J.callback,mxUtils.bind(this,function(Fa,Ra,$a,fb){Fa=Fa||this.emptyDiagramXml;null!=J.callback?K.postMessage(JSON.stringify({event:"template",xml:Fa,blank:Fa==this.emptyDiagramXml,name:Ra,
+tempUrl:$a,libs:fb,builtIn:!0,message:J}),"*"):(c(Fa,V,Fa!=this.emptyDiagramXml,J.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,ha?mxUtils.bind(this,function(Fa){this.remoteInvoke("getRecentDiagrams",[null],null,Fa,function(){Fa(null,"Network Error!")})}):null,k?mxUtils.bind(this,function(Fa,Ra){this.remoteInvoke("searchDiagrams",[Fa,null],null,Ra,function(){Ra(null,"Network Error!")})}):null,mxUtils.bind(this,function(Fa,Ra,$a){K.postMessage(JSON.stringify({event:"template",
+docUrl:Fa,info:Ra,name:$a}),"*")}),null,null,u?mxUtils.bind(this,function(Fa){this.remoteInvoke("getCustomTemplates",null,null,Fa,function(){Fa({},0)})}):null,1==J.withoutType,null,J.templatesOnly);this.showDialog(ua.container,620,460,!0,!1,mxUtils.bind(this,function(Fa){null!=this.sidebar&&this.sidebar.hideTooltip();Fa&&!J.noExitOnCancel&&this.actions.get("exit").funct()}));ua.init();return}if("textContent"==J.action){var H=this.getDiagramTextContent();K.postMessage(JSON.stringify({event:"textContent",
+data:H,message:J}),"*");return}if("status"==J.action){this.updateStatus(mxUtils.bind(this,function(){null!=J.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(J.messageKey))):null!=J.message&&this.editor.setStatus(mxUtils.htmlEntities(J.message))}));null!=J.modified&&(this.editor.modified=J.modified);return}if("spinner"==J.action){var P=null!=J.messageKey?mxResources.get(J.messageKey):J.message;null==J.show||J.show?this.spinner.spin(document.body,P):this.spinner.stop();return}if("exit"==
+J.action){this.actions.get("exit").funct();return}if("viewport"==J.action){if(null!=J.viewport){var U=this.editor.graph,W=U.view.translate.x,fa=U.view.translate.y;this.embedViewport=J.viewport;U.refresh();this.diagramContainer.scrollTop-=(fa-U.view.translate.y)*U.view.scale;this.diagramContainer.scrollLeft-=(W-U.view.translate.x)*U.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==J.action){var X=this.actions.get(J.actionName);null!=X&&X.funct();return}if("resetEditor"==
+J.action){U=this.editor.graph;U.isEditing()&&U.stopEditing(!1);this.hideCurrentMenu();U.popupMenuHandler.hideMenu();U.clearSelection();return}if("fit"==J.action){U=this.editor.graph;var ea=U.maxFitScale;U.maxFitScale=null!=J.maxScale?J.maxScale:1;U.fit(null!=J.border?J.border:16,null,null,null,null,!0);U.maxFitScale=ea;P=this.createLoadMessage("fit");P.message=J;K.postMessage(JSON.stringify(P),"*");return}if("viewbox"==J.action){var oa=EditorUi.parseViewBox(J.viewbox);null!=oa&&this.applyViewBox(oa);
+P=this.createLoadMessage("viewbox");P.message=J;K.postMessage(JSON.stringify(P),"*");return}if("fullscreenChanged"==J.action){var ka=null;try{var ba=this.diagramContainer.getAttribute("data-scrollState");null!=ba&&(this.diagramContainer.removeAttribute("data-scrollState"),ka=JSON.parse(ba))}catch(Fa){}Editor.inlineFullscreen=J.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=ka&&this.restoreScrollState(ka);return}if("snapshot"==J.action){this.sendEmbeddedSvgExport(!0);return}if("export"==
+J.action){if("png"==J.format||"xmlpng"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){var sa=null!=J.xml?J.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);U=this.editor.graph;var xa=mxUtils.bind(this,function(Fa,Ra){if(J.withSvg)J.withSvg=!1,this.getEmbeddedSvg(sa,this.editor.graph,null,!0,function(fb){xa(Fa,fb)},null,null,J.embedImages,this.editor.graph.background,J.scale,J.border,J.shadow,"auto",null,J.embedFonts);
+else{this.editor.graph.setEnabled(!0);this.spinner.stop();var $a=this.createLoadMessage("export");$a.format=J.format;$a.message=la;$a.data=Fa;$a.svg=Ra;$a.xml=sa;K.postMessage(JSON.stringify($a),"*")}}),qa=mxUtils.bind(this,function(Fa){null==Fa&&(Fa=Editor.blankImage);"xmlpng"==J.format&&(Fa=Editor.writeGraphModelToPng(Fa,"tEXt","mxfile",encodeURIComponent(sa)));U!=this.editor.graph&&U.container.parentNode.removeChild(U.container);xa(Fa)}),Ba=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():
+this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var ma=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=Ba){var Fa=U.getGlobalVariable;U=this.createTemporaryGraph(U.getStylesheet());for(var Ra,$a=0;$a<this.pages.length;$a++)if(this.pages[$a].getId()==Ba){Ra=this.updatePageRoot(this.pages[$a]);break}null==Ra&&(Ra=this.currentPage);U.getGlobalVariable=function(ub){return"page"==ub?Ra.getName():"pagenumber"==ub?1:Fa.apply(this,arguments)};document.body.appendChild(U.container);
+U.model.setRoot(Ra.root)}if(null!=J.layerIds){var fb=U.model,rb=fb.getChildCells(fb.getRoot()),mb=Object.create(null);for($a=0;$a<J.layerIds.length;$a++)mb[J.layerIds[$a]]=!0;for($a=0;$a<rb.length;$a++)fb.setVisible(rb[$a],mb[rb[$a].id]||!1)}$a=null;J.keepTheme&&($a=Editor.isDarkMode()?"dark":"light");null==J.width&&0<this.maxCanvasExportArea&&(rb=U.getGraphBounds(),mb=null!=J.border?J.border:0,fb=Math.ceil(rb.width/U.view.scale)+2*mb,rb=Math.ceil(rb.height/U.view.scale)+2*mb,mb=null!=J.scale?J.scale:
+1,fb*rb*mb*mb>this.maxCanvasExportArea&&(J.scale=Math.sqrt(this.maxCanvasExportArea/(fb*rb))));this.editor.exportToCanvas(mxUtils.bind(this,function(ub){qa(ub.toDataURL("image/png"))}),J.width,null,J.background,mxUtils.bind(this,function(){qa(null)}),null,null,J.scale,J.transparent,J.shadow,null,U,J.border,null,J.grid,$a,J.size)});null!=J.xml&&0<J.xml.length&&(l=!0,this.setFileData(sa),l=!1);ma()}else this.isRemoteExportEnabled()?(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==J.format?
+"1":"0")+(null!=Ba?"&pageId="+Ba:"")+(null!=J.layerIds&&0<J.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:J.layerIds})):"")+(null!=J.scale?"&scale="+J.scale:"")+"&base64=1&xml="+encodeURIComponent(sa))).send(mxUtils.bind(this,function(Fa){200<=Fa.getStatus()&&299>=Fa.getStatus()?xa("data:image/png;base64,"+Fa.getText()):qa(null)}),mxUtils.bind(this,function(){qa(null)})):qa(null)}}else if(ma=mxUtils.bind(this,function(){var Fa=this.createLoadMessage("export");Fa.message=J;
+if("html2"==J.format||"html"==J.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ra=this.getXmlFileData();Fa.xml=mxUtils.getXml(Ra);Fa.data=this.getFileData(null,null,!0,null,null,null,Ra);Fa.format=J.format}else if("html"==J.format)Ra=this.editor.getGraphXml(),Fa.data=this.getHtml(Ra,this.editor.graph),Fa.xml=mxUtils.getXml(Ra),Fa.format=J.format;else{if("xml"==J.format)Fa.xml=this.getFileData(!0),Fa.format=J.format,K.postMessage(JSON.stringify(Fa),"*");else if("json"==
+J.format)Fa.format=J.format,Fa.data=this.createJsonForExport(0!=J.allPages,1==J.includeData,1==J.compressed,1==J.selection),K.postMessage(JSON.stringify(Fa),"*");else{mxSvgCanvas2D.prototype.foAltText=null;var $a=null!=J.background?J.background:this.editor.graph.background;$a==mxConstants.NONE&&($a=null);Fa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);Fa.format="svg";var fb=mxUtils.bind(this,function(Eb){this.editor.graph.setEnabled(!0);this.spinner.stop();Fa.data=J.asText?
+Eb:Editor.createSvgDataUri(Eb);K.postMessage(JSON.stringify(Fa),"*")}),rb="auto";J.keepTheme&&(rb=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(rb=J.theme);if("xmlsvg"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){rb=null;if(this.isAutoDarkMode()||Editor.isDarkMode())rb="auto";null!=J.theme&&(rb=J.theme);this.getEmbeddedSvg(Fa.xml,this.editor.graph,null,!0,fb,null,null,J.embedImages,$a,J.scale,J.border,J.shadow,
+rb,J.embedCellMetadata,J.embedFonts)}}else if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){this.editor.graph.setEnabled(!1);var mb=this.editor.graph.createSvgImageExport(!1,J.embedCellMetadata?!0:!1);Ra=Object.create(null);var ub=this.getSvgWithFontLookup(Ra,mb,mxUtils.bind(this,function(){return this.editor.graph.getSvg($a,J.scale,J.border,null,null,null,null,mb,null,this.editor.graph.shadowVisible||J.shadow,null,rb)}));(this.editor.graph.shadowVisible||
+J.shadow)&&this.editor.graph.addSvgShadow(ub);this.embedFonts(ub,mxUtils.bind(this,function(Eb){J.embedImages||null==J.embedImages?this.editor.convertImages(Eb,mxUtils.bind(this,function(Fb){fb(mxUtils.getXml(Fb))})):fb(mxUtils.getXml(Eb))}),J.embedFonts,Ra)}}return}K.postMessage(JSON.stringify(Fa),"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var ta=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ta.apply(this,arguments);ma()}}l=!0;this.setFileData(J.xml);l=!1;this.editor.graph.mathEnabled||
+ma()}else ma();return}if("load"==J.action){ja=J.toSketch;q=1==J.autosave;this.embedDiffSync=null!=J.diffSync&&!1!==J.diffSync;this.embedDiffSyncPatchOnly="object"===typeof J.diffSync&&null!=J.diffSync&&1==J.diffSync.patchOnly;this.embedExportProtocol=1==J.exportProtocol;var va=J.sourceMetadata||null;Y=null!=J.layout?J.layout:null;this.hideDialog();null!=J.modified&&null==urlParams.modified&&(urlParams.modified=J.modified);null!=J.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=J.saveAndExit);
+if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=J.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=J.noSaveBtn);if(null!=J.rough){var Ga=Editor.sketchMode;this.doSetSketchMode(J.rough);Ga!=Editor.sketchMode&&
+this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=J.dark&&this.setDarkMode(J.dark);null!=J.border&&(this.embedExportBorder=J.border);null!=J.theme&&(this.embedExportTheme=J.theme);null!=J.background&&(this.embedExportBackground=J.background);null!=J.viewport&&(this.embedViewport=J.viewport);this.embedExitPoint=null;var La=EditorUi.parseViewBox(J.viewbox);null==La&&null==J.viewbox&&null==J.scale&&null==J.fit&&(La=EditorUi.getViewBoxParam());if(null!=La)ia=mxUtils.bind(this,function(){this.applyViewBox(La)});
+else if(null!=J.scale){var Ia=J.scale,Ca=null!=J.scaleBorder?J.scaleBorder:this.embedExportBorder||0,Pa=null!=J.border?J.border:0;ia=mxUtils.bind(this,function(){var Fa=this.editor.graph,Ra=Fa.getGraphBounds();if(0<Ra.width&&0<Ra.height){var $a=Fa.view.scale;Fa.view.scaleAndTranslate(Ia,Fa.view.translate.x+Pa-Ra.x/$a+Ca/Ia,Fa.view.translate.y+Pa-Ra.y/$a+Ca/Ia)}})}else if(null!=J.fit){var Ka=null!=J.border?J.border:0,Na=J.maxFitScale||1;ia=mxUtils.bind(this,function(){var Fa=this.editor.graph,Ra=Fa.maxFitScale;
+Fa.maxFitScale=Na;Fa.fit(Ka,null,null,null,null,!0);Fa.maxFitScale=Ra})}if(null!=J.scroll&&null!=J.scroll.x&&null!=J.scroll.y){var Oa=J.scroll,Ea=ia;ia=mxUtils.bind(this,function(){null!=Ea&&Ea();var Fa=this.editor.graph,Ra=Fa.view.scale,$a=Fa.view.translate;mxUtils.hasScrollbars(Fa.container)?(Fa.container.scrollLeft=($a.x+Oa.x)*Ra,Fa.container.scrollTop=($a.y+Oa.y)*Ra):Fa.view.setTranslate(-Oa.x,-Oa.y)})}if(null!=J.rect){Pa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,J.rect.left)+
+"px";this.diagramContainer.style.top=Math.max(40,J.rect.top)+"px";this.minInlineWidth=J.minWidth;this.minInlineHeight=J.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Aa=J.maxFitScale,Ja=J.rect.width+2*Pa,Ha=J.rect.height+2*Pa;ia=mxUtils.bind(this,function(){var Fa=mxUtils.getDocumentSize();Ja=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,Ja):Ja,Fa.width-80);Fa=Math.min(null!=this.minInlineHeight?
+Math.max(this.minInlineHeight,Ha):Ha,Fa.height-80);this.diagramContainer.style.width=Ja+"px";this.diagramContainer.style.height=Fa+"px";var Ra=this.editor.graph;Fa=Ra.maxFitScale;Ra.maxFitScale=Aa;Ra.fit(2*Pa,null,null,null,null,null,Ha);this.setPageVisible("1"==urlParams.pv);if(null!=this.minInlineWidth&&Ra.getGraphBounds().width<this.minInlineWidth){var $a=Ra.container.scrollTop;this.resetScrollbars();Ra.container.scrollTop=$a}Ra.maxFitScale=Fa;Ra.container.scrollTop-=Pa;Ra.container.scrollLeft-=
+Pa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[J]));Ra.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Ra.container.style.top);var fb=Ra.getGraphBounds();Ra.container.clientWidth>fb.width+2*Pa&&(Ra.container.scrollLeft=fb.x+(fb.width+Pa-Ra.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=
+J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&this.setEmbedTitle(J.title);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(Fa){}if(null!=J.xmlpng)J=this.extractGraphModelFromPng(J.xmlpng);else if(null!=J.descriptor){if(J=J.descriptor,"mermaid"==J.format){if(EditorUi.isMermaidSupported()){var Ua=mxUtils.bind(this,function(Fa){c(Fa,V,null,ja);Fa=this.createLoadMessage("load");Fa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);Fa.message=la;(this.embedMessageSource||window.opener||
+window.parent).postMessage(JSON.stringify(Fa),"*");if(null!=va&&null!=va.key&&null!=va.value){Fa=this.editor.graph;var Ra=Fa.getModel().getRoot();if(null!=Ra){Fa.getModel().beginUpdate();try{Fa.setAttributeForCell(Ra,va.key,va.value)}finally{Fa.getModel().endUpdate()}}}}),ab=mxUtils.bind(this,function(Fa){this.handleError(Fa)});J.image?this.parseMermaidImage(J.data,Ua,ab):this.parseMermaidDiagram(J.data,null,mxUtils.bind(this,function(Fa){J.wrap&&(Fa=mxMermaidToDrawio.wrapGroup(Fa,J.data,EditorUi.getInsertMermaidConfig(),
+{normalize:!0}));Ua(Fa)}),ab)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else J=J.xml}else{if("merge"==J.action){var Wa=this.getCurrentFile();null!=Wa&&(Da=aa(J.xml),null!=Da&&""!=Da&&Wa.mergeFile(new LocalFile(this,Da),mxUtils.bind(this,function(){this.embedDiffSync&&(A=this.clonePages(this.pages),x=hb());K.postMessage(JSON.stringify({event:"merge",message:J}),"*")}),function(Fa){K.postMessage(JSON.stringify({event:"merge",
+message:J,error:Fa}),"*")}))}else if("patch"==J.action){if(Wa=this.getCurrentFile(),null!=Wa&&null!=J.patch)try{l=!0,Wa.patch([J.patch]),this.embedDiffSync&&null!=A&&(A=this.applyPatches(A,[J.patch])),x=hb(),l=!1,ba={event:"patch",message:J},ka=this.getHashValueForPages(this.pages),ba.checksum=ka,null!=J.checksum&&J.checksum!=ka&&(ba.checksumMismatch=!0),K.postMessage(JSON.stringify(ba),"*")}catch(Fa){l=!1,K.postMessage(JSON.stringify({event:"patch",message:J,error:Fa.message||Fa.toString()}),"*")}}else if("getDiff"==
+J.action){P={event:"getDiff",message:J};if(this.embedDiffSync&&null!=A){var cb=this.clonePages(this.pages);P.patch=this.diffPages(A,cb);P.checksum=this.getHashValueForPages(cb)}else P.xml=hb();K.postMessage(JSON.stringify(P),"*")}else"resetDiff"==J.action?this.embedDiffSync&&(null!=J.xml?(Da=aa(J.xml),Wa=this.getCurrentFile(),null!=Da&&""!=Da&&null!=Wa&&Wa.mergeFile(new LocalFile(this,Da),mxUtils.bind(this,function(){A=this.clonePages(this.pages);x=hb();K.postMessage(JSON.stringify({event:"resetDiff",
+message:J,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(Fa){K.postMessage(JSON.stringify({event:"resetDiff",message:J,error:Fa}),"*")})):(A=this.clonePages(this.pages),x=hb(),K.postMessage(JSON.stringify({event:"resetDiff",message:J,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==J.action?this.handleRemoteInvokeReady(K):"remoteInvoke"==J.action?this.handleRemoteInvoke(J,V.origin):"remoteInvokeResponse"==J.action?this.handleRemoteInvokeResponse(J):K.postMessage(JSON.stringify({error:"unknownMessage",
+data:JSON.stringify(J)}),"*");return}}catch(Fa){this.handleError(Fa)}}var hb=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),wb=mxUtils.bind(this,function(Fa,Ra){l=!0;try{c(Fa,Ra,null,ja)}catch($a){this.handleError($a)}l=!1;this.editor.graph.model.prefix=Editor.guid()+"-";Ra=mxUtils.bind(this,function(){null!=urlParams.modified&&this.clearStatus();x=hb();this.embedDiffSync&&(A=this.clonePages(this.pages));
+q&&null==f&&(f=mxUtils.bind(this,function(fb,rb){fb=hb();if(fb!=x&&!l){rb=this.createLoadMessage("autosave");rb.message=la;if(this.embedDiffSync&&null!=A){var mb=this.clonePages(this.pages),ub=this.diffPages(A,mb);mxUtils.isEmptyObject(ub)?rb.xml=fb:(rb.patch=ub,rb.checksum=this.getHashValueForPages(mb),this.embedDiffSyncPatchOnly||(rb.xml=fb));A=mb}else rb.xml=fb;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(rb),"*")}x=fb}),this.editor.graph.model.addListener(mxEvent.CHANGE,
+f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("tooltipsEnabledChanged",f),this.addListener("pageViewChanged",
+f),this.addListener("connectionPointsChanged",f),this.addListener("connectionArrowsChanged",f));null!=ia&&ia();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var $a=this.createLoadMessage("load");$a.xml=null!=Y?hb():Fa;this.embedDiffSync&&null!=this.pages&&($a.checksum=this.getHashValueForPages(this.pages));K.postMessage(JSON.stringify($a),"*")}});null!=Y?this.executeLayoutSpec(Y,Ra):Ra()});null!=J&&"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,34)?
+(aa="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(Fa){wb(Fa,V)},mxUtils.bind(this,function(Fa){this.handleError(Fa)}),aa)):null!=J&&"function"===typeof J.substring&&this.isGliffyData(J,"")?this.importGliffy(J,mxUtils.bind(this,function(Fa){"<mxGraphModel"==Fa.substring(0,13)?wb(Fa,V):this.handleError({message:mxResources.get("unknownError")})}),mxUtils.bind(this,function(Fa){this.handleError({message:null!=Fa&&413==
+Fa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")})}),""):null!=J&&"function"===typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(Fa){wb(Fa)}),mxUtils.bind(this,function(Fa){this.handleError(Fa)})):null==J||"object"!==typeof J||null==J.format||null==J.data&&null==J.url?(J=aa(J),wb(J,V)):this.loadDescriptor(J,mxUtils.bind(this,function(Fa){wb(hb(),V)}),mxUtils.bind(this,function(Fa){this.handleError(Fa,mxResources.get("errorLoadingFile"))}))}}));
+var K=this.embedMessageSource||window.opener||window.parent;E="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";K.postMessage(E,"*");if("json"==urlParams.proto){var Q=this.editor.graph.openLink;this.editor.graph.openLink=function(V,J,ia){Q.apply(this,arguments);K.postMessage(JSON.stringify({event:"openLink",href:V,target:J,allowOpener:ia}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(V){for(var J=mxEvent.getSource(V);null!=
+J&&"A"!=J.nodeName;)J=J.parentNode;if(null!=J){var ia=J.getAttribute("href");null==ia||"#"==ia.charAt(0)||"javascript:"==ia.substring(0,11)||this.editor.graph.isCustomLink(ia)||(V.preventDefault(),this.editor.graph.openLink(ia,J.getAttribute("target")))}}),!0)}};EditorUi.prototype.createEmbedButton=function(c,f,l,q){var x=document.createElement("button");x.className="geEmbedBtn geBtn";x.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(x,c);q&&x.classList.add("gePrimaryBtn");mxEvent.addListener(x,
+"click",f);return x};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==
+this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),
+mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};
+EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,
+function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var q=JSON.parse(l);Array.isArray(q)&&0<q.length&&this.applyLayoutToSelectedContainers(q)||this.executeLayouts(this.editor.graph.createLayouts(q));this.lastLayoutSpec=this.customLayoutConfig=q;this.hideDialog()}catch(x){this.handleError(x)}}),null,null,null,null,mxUtils.bind(this,function(l,q){var x=this.createLayoutAddSelect(q);l.appendChild(x);x=mxUtils.button(mxResources.get("copy"),
+mxUtils.bind(this,function(){try{var A=q.value;q.value=JSON.stringify(JSON.parse(A));q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));q.value=A}catch(E){this.handleError(E)}}));x.setAttribute("title","copy");x.className="geBtn";l.appendChild(x)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,
+0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var l={},q=0;q<f.length;q++)null!=f[q]&&(l[f[q].id]=!0);var x=function(A){return null!=A&&!0===l[A.id]};for(q=0;q<c.length;q++)f=c[q],"undefined"!==typeof ElkLayout&&f instanceof ElkLayout||void 0!==f.cellFilter?f.cellFilter=x:"function"===typeof f.isVertexIgnored&&function(A){var E=A.isVertexIgnored;A.isVertexIgnored=
+function(K){return E.apply(this,arguments)||!x(K)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,l=document.createElement("select");l.className="geBtn";l.style.marginRight="8px";l.style.maxWidth="180px";var q=document.createElement("option");q.value="";mxUtils.write(q,mxResources.get("add")+"...");q.disabled=!0;q.selected=!0;l.appendChild(q);var x=[];"undefined"!==typeof ElkLayout&&(q=function(E,K){var Q=ElkLayout.MENU_PRESETS[E];return{label:E,kind:"elk",algo:Q.algorithm,preset:Q.options,
+layoutName:K}},x.push(q("verticalFlow","elkLayered")),x.push(q("horizontalFlow","elkLayered")),x.push(q("verticalTree","elkTree")),x.push(q("horizontalTree","elkTree")),x.push(q("radialTree","elkRadial")),x.push(q("organic","elkOrganic")));x.push({label:"orgChart",kind:"orgchart"});x.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});x.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&
+x.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(q=0;q<x.length;q++){var A=document.createElement("option");A.value=String(q);mxUtils.write(A,mxResources.get(x[q].label)+("elk"===x[q].kind||"orgchart"===x[q].kind?"...":""));l.appendChild(A)}mxEvent.addListener(l,"change",mxUtils.bind(this,function(){var E=parseInt(l.value);l.selectedIndex=0;if(!(isNaN(E)||0>E||E>=x.length)){var K=x[E],Q=c.value;if(0===mxUtils.trim(Q).length)var V=[];else{try{V=
+JSON.parse(Q)}catch(ia){f.handleError(ia);return}if(!Array.isArray(V)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var J=mxUtils.bind(this,function(ia){V.push(ia);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(V,null,2))});E=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(Q)});"elk"===K.kind?(f.hideDialog(),ElkLayout.runWithDialog(f,K.algo,K.preset,mxResources.get(K.label),function(ia,Y){ia=Graph.elkOptionsToConfig(ia,Y);J({layout:K.layoutName,
+config:ia})},E)):"orgchart"===K.kind?(f.hideDialog(),f.showOrgChartConfigDialog(J,E)):J({layout:K.layoutName,config:K.config||{}})}}));return l};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var l=2,q=20,x=20,A=document.createElement("div"),E=function(aa,ja){var la=document.createElement("div");la.style.marginTop="6px";la.style.display="inline-block";la.style.width="180px";mxUtils.write(la,mxResources.get(aa)+": ");A.appendChild(la);A.appendChild(ja)},K=document.createElement("select");
+K.style.width="160px";K.style.boxSizing="border-box";for(var Q=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],V=0;V<Q.length;V++){var J=document.createElement("option");mxUtils.write(J,Q[V]);J.value=V;2===V&&J.setAttribute("selected","selected");K.appendChild(J)}mxEvent.addListener(K,"change",function(){l=parseInt(K.value)});
+E("orgChartType",K);var ia=document.createElement("input");ia.type="number";ia.value=q;ia.style.width="160px";ia.style.boxSizing="border-box";mxEvent.addListener(ia,"change",function(){q=parseInt(ia.value)});E("parentChildSpacing",ia);var Y=document.createElement("input");Y.type="number";Y.value=x;Y.style.width="160px";Y.style.boxSizing="border-box";mxEvent.addListener(Y,"change",function(){x=parseInt(Y.value)});E("siblingSpacing",Y);f=new CustomDialog(this,A,function(){c({layout:"mxOrgChartLayout",
+config:{branchOptimizer:l,parentChildSpacing:q,siblingSpacing:x}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(l){var q=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),x=mxUtils.bind(this,function(A){this.loadingOrgChart=
+!1;l.clear()&&this.handleError(A)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))q();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",q,null,null,null,x)},null,null,null,x)},null,null,null,x)},
+null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",q,null,null,null,x)}),onerror)};EditorUi.prototype.importCsv=function(c,f,l,q){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,l)}),q)};EditorUi.prototype.doImportCsv=function(c,f,l){try{var q=c.split("\n"),x=[],A=[],E=[],K=Object.create(null);if(0<q.length){var Q=Object.create(null);l=null!=l?l:this.editor.graph;var V=null,J=null,ia=null,Y=null,aa=null,ja=null,la=null,ua="whiteSpace=wrap;html=1;",
+Da=null,ha=null,k="",u="auto",H="auto",P=!1,U=null,W=null,fa=40,X=40,ea=100,oa=0,ka=mxUtils.bind(this,function(){null!=f?f($a):(l.setSelectionCells($a),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),ba=l.getFreeInsertPoint(!0),sa=ba.x,xa=ba.y;ba=xa;var qa=null,Ba="auto";ha=null;for(var ma=[],ta=null,va=null,Ga=0;Ga<q.length&&"#"==q[Ga].charAt(0);){c=q[Ga].replace(/\r$/,"");for(Ga++;Ga<q.length&&
+"\\"==c.charAt(c.length-1)&&"#"==q[Ga].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(q[Ga].substring(1)),Ga++;if("#"!=c.charAt(1)){var La=c.indexOf(":");if(0<La){var Ia=mxUtils.trim(c.substring(1,La)),Ca=mxUtils.trim(c.substring(La+1));"label"==Ia?qa=Graph.sanitizeHtml(Ca):"labelname"==Ia&&0<Ca.length&&"-"!=Ca?aa=Ca:"labels"==Ia&&0<Ca.length&&"-"!=Ca?la=JSON.parse(Ca):"style"==Ia?J=Ca:"parentstyle"==Ia?ua=Ca:"unknownStyle"==Ia&&"-"!=Ca?ja=Ca:"stylename"==Ia&&0<Ca.length&&"-"!=Ca?Y=Ca:"styles"==
+Ia&&0<Ca.length&&"-"!=Ca?ia=JSON.parse(Ca):"vars"==Ia&&0<Ca.length&&"-"!=Ca?V=JSON.parse(Ca):"identity"==Ia&&0<Ca.length&&"-"!=Ca?Da=Ca:"parent"==Ia&&0<Ca.length&&"-"!=Ca?ha=Ca:"namespace"==Ia&&0<Ca.length&&"-"!=Ca?k=Ca:"width"==Ia?u=Ca:"height"==Ia?H=Ca:"collapsed"==Ia&&"-"!=Ca?P="true"==Ca:"left"==Ia&&0<Ca.length?U=Ca:"top"==Ia&&0<Ca.length?W=Ca:"ignore"==Ia?va=Ca.split(","):"connect"==Ia?ma.push(JSON.parse(Ca)):"link"==Ia?ta=Ca:"padding"==Ia?oa=parseFloat(Ca):"edgespacing"==Ia?fa=parseFloat(Ca):
+"nodespacing"==Ia?X=parseFloat(Ca):"levelspacing"==Ia?ea=parseFloat(Ca):"layout"==Ia&&(Ba=Ca)}}}if(null==q[Ga])throw Error(mxResources.get("invalidOrMissingFile"));var Pa=this.editor.csvToArray(q[Ga].replace(/\r$/,""));La=c=null;Ia=[];for(Ca=0;Ca<Pa.length;Ca++)Da==Pa[Ca]&&(c=Ca),ha==Pa[Ca]&&(La=Ca),Ia.push(mxUtils.trim(Pa[Ca]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==qa&&(qa="%"+Ia[0]+"%");if(null!=ma)for(var Ka=0;Ka<ma.length;Ka++)null==Q[ma[Ka].to]&&(Q[ma[Ka].to]=
+Object.create(null));Da=[];for(Ca=Ga+1;Ca<q.length;Ca++){var Na=this.editor.csvToArray(q[Ca].replace(/\r$/,""));if(null==Na){var Oa=40<q[Ca].length?q[Ca].substring(0,40)+"...":q[Ca];throw Error(Oa+" ("+Ca+"):\n"+mxResources.get("containsValidationErrors"));}0<Na.length&&Da.push(Na)}l.model.beginUpdate();try{for(Ca=0;Ca<Da.length;Ca++){Na=Da[Ca];var Ea=null,Aa=null!=c?k+Na[c]:null;q=!1;null!=Aa&&(Ea=l.model.getCell(Aa),q=null==Ea||0<=mxUtils.indexOf(x,Ea));var Ja=new mxCell(qa,new mxGeometry(sa,ba,
+0,0),J||"whiteSpace=wrap;html=1;");Ja.collapsed=P;Ja.vertex=!0;Ja.id=Aa;null==Ea||q||l.model.setCollapsed(Ea,P);for(var Ha=0;Ha<Na.length;Ha++)l.setAttributeForCell(Ja,Ia[Ha],Na[Ha]),null==Ea||q||l.setAttributeForCell(Ea,Ia[Ha],Na[Ha]);if(null!=aa&&null!=la){var Ua=Ja.getAttribute(aa),ab=null!=Ua&&Object.prototype.hasOwnProperty.call(la,Ua)?la[Ua]:null;null!=ab&&(l.labelChanged(Ja,ab),null==Ea||q||l.cellLabelChanged(Ea,ab))}if(null!=Y&&null!=ia){var Wa=Ja.getAttribute(Y),cb=null!=Wa&&Object.prototype.hasOwnProperty.call(ia,
+Wa)?ia[Wa]:null;null!=cb&&(Ja.style=cb)}l.setAttributeForCell(Ja,"placeholders","1");Ja.style=l.replacePlaceholders(Ja,Ja.style,V);null==Ea||q?l.fireEvent(new mxEventObject("cellsInserted","cells",[Ja])):(l.model.setStyle(Ea,Ja.style),0>mxUtils.indexOf(E,Ea)&&E.push(Ea),l.fireEvent(new mxEventObject("cellsInserted","cells",[Ea])));q=null!=Ea;Ea=Ja;if(!q)for(Ka=0;Ka<ma.length;Ka++)Q[ma[Ka].to][Ea.getAttribute(ma[Ka].to)]=Ea;null!=ta&&"link"!=ta&&(l.setLinkForCell(Ea,Ea.getAttribute(ta)),l.setAttributeForCell(Ea,
+ta,null));var hb=l.getPreferredSizeForCell(Ea);ha=null!=La?l.model.getCell(k+Na[La]):null;if(Ea.vertex){Oa=null!=ha?0:sa;Ga=null!=ha?0:xa;null!=U&&null!=Ea.getAttribute(U)&&(Ea.geometry.x=Oa+parseFloat(Ea.getAttribute(U)));null!=W&&null!=Ea.getAttribute(W)&&(Ea.geometry.y=Ga+parseFloat(Ea.getAttribute(W)));var wb="@"==u.charAt(0)?Ea.getAttribute(u.substring(1)):null;Ea.geometry.width=null!=wb&&"auto"!=wb?parseFloat(Ea.getAttribute(u.substring(1))):"auto"==u||"auto"==wb?hb.width+oa:parseFloat(u);var Fa=
+"@"==H.charAt(0)?Ea.getAttribute(H.substring(1)):null;Ea.geometry.height=null!=Fa&&"auto"!=Fa&&"width"!=H?parseFloat(Fa):"auto"==H||"auto"==Fa?hb.height+oa:"width"==H?Ea.geometry.width:parseFloat(H);ba+=Ea.geometry.height+X}q?(null==K[Aa]&&(K[Aa]=[]),K[Aa].push(Ea)):(x.push(Ea),null!=ha?(ha.style=l.replacePlaceholders(ha,ua,V),l.addCell(Ea,ha),A.push(ha)):E.push(l.addCell(Ea)))}for(Ca=0;Ca<A.length;Ca++)wb="@"==u.charAt(0)?A[Ca].getAttribute(u.substring(1)):null,Fa="@"==H.charAt(0)?A[Ca].getAttribute(H.substring(1)):
+null,"auto"!=u&&"auto"!=wb||"auto"!=H&&"auto"!=Fa||l.updateGroupBounds([A[Ca]],oa,!0);var Ra=E.slice(),$a=E.slice();for(Ka=0;Ka<ma.length;Ka++){var fb=ma[Ka];for(Ca=0;Ca<x.length;Ca++){Ea=x[Ca];var rb=mxUtils.bind(this,function(Bb,Ib,Ab){var Db=Ib.getAttribute(Ab.from);if(null!=Db&&""!=Db){Db=Db.split(",");for(var z=0;z<Db.length;z++){var L=Q[Ab.to][Db[z]];if(null==L&&null!=ja){L=new mxCell(Db[z],new mxGeometry(sa,xa,0,0),ja);L.style=l.replacePlaceholders(Ib,L.style,V);var M=l.getPreferredSizeForCell(L);
+L.geometry.width=M.width+oa;L.geometry.height=M.height+oa;Q[Ab.to][Db[z]]=L;L.vertex=!0;L.id=Db[z];E.push(l.addCell(L))}if(null!=L){M=Ab.label;null!=Ab.fromlabel&&(M=(Ib.getAttribute(Ab.fromlabel)||"")+(M||""));null!=Ab.sourcelabel&&(M=l.replacePlaceholders(Ib,Ab.sourcelabel,V)+(M||""));null!=Ab.tolabel&&(M=(M||"")+(L.getAttribute(Ab.tolabel)||""));null!=Ab.targetlabel&&(M=(M||"")+l.replacePlaceholders(L,Ab.targetlabel,V));var S="target"==Ab.placeholders==!Ab.invert?L:Bb;S=null!=Ab.style?l.replacePlaceholders(S,
+Ab.style,V):l.createCurrentEdgeStyle();M=l.insertEdge(null,null,M||"",Ab.invert?L:Bb,Ab.invert?Bb:L,S);if(null!=Ab.labels)for(S=0;S<Ab.labels.length;S++){var Z=Ab.labels[S],da=new mxCell(Z.label||S,new mxGeometry(null!=Z.x?Z.x:0,null!=Z.y?Z.y:0,0,0),"resizable=0;html=1;");da.vertex=!0;da.connectable=!1;da.geometry.relative=!0;null!=Z.placeholders&&(da.value=l.replacePlaceholders("target"==Z.placeholders==!Ab.invert?L:Bb,da.value,V));if(null!=Z.dx||null!=Z.dy)da.geometry.offset=new mxPoint(null!=Z.dx?
+Z.dx:0,null!=Z.dy?Z.dy:0);M.insert(da)}if(null!=Ab.data)for(var na in Ab.data)l.setAttributeForCell(M,na,Ab.data[na]);$a.push(M);mxUtils.remove(Ab.invert?Bb:L,Ra)}}}});rb(Ea,Ea,fb);if(null!=K[Ea.id])for(Ha=0;Ha<K[Ea.id].length;Ha++)rb(Ea,K[Ea.id][Ha],fb)}}if(null!=va)for(Ca=0;Ca<x.length;Ca++)for(Ea=x[Ca],Ha=0;Ha<va.length;Ha++)l.setAttributeForCell(Ea,mxUtils.trim(va[Ha]),null);if(0<E.length){var mb=new mxParallelEdgeLayout(l);mb.spacing=fa;mb.checkOverlap=!0;var ub=function(){0<mb.spacing&&mb.execute(l.getDefaultParent());
+var Bb=0,Ib=0;0<E.length&&(Ib=l.getCellGeometry(E[0]),Bb=Math.round(l.snap(Ib.x))-Ib.x,Ib=Math.round(l.snap(Ib.y))-Ib.y);for(var Ab=0;Ab<E.length;Ab++){var Db=l.getCellGeometry(E[Ab]);Db.x=Math.round(Db.x+Bb);Db.y=Math.round(Db.y+Ib);"auto"==u&&(Db.width=Math.round(l.snap(Db.width)));"auto"==H&&(Db.height=Math.round(l.snap(Db.height)))}};"auto"==Ba&&1==Ra.length&&(Ba=$a.length==2*E.length-1?"verticaltree":"verticalflow");var Eb="organic"==Ba||null!=EditorUi.CSV_ELK_LAYOUTS[Ba]?null:this.resolveLayoutList(Ba);
+if(null!=Eb){var Fb=ka;l.view.validate();var Tb=l.createLayouts(Eb);this.scopeLayoutsToCells(Tb,$a);this.executeLayouts(Tb,function(){ub();Fb()});ka=null}else if("circle"==Ba){var Rb=new mxCircleLayout(l);Rb.disableEdgeStyle=!1;Rb.resetEdges=!1;var $b=Rb.isVertexIgnored;Rb.isVertexIgnored=function(Bb){return $b.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Rb.execute(l.getDefaultParent());ub()},!0,ka);ka=null}else if("verticaltree"==Ba||"horizontaltree"==Ba){l.view.validate();
+var Mb=new mxCompactTreeLayout(l,"horizontaltree"==Ba);Mb.levelDistance=X;Mb.edgeRouting=!1;Mb.resetEdges=!1;Mb.sortEdges=!0;var Wb=Mb.isVertexIgnored;Mb.isVertexIgnored=function(Bb){return Wb.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Mb.execute(l.getDefaultParent(),0<Ra.length?Ra[0]:null)},!0,ka);ka=null}else if("orgchart"==Ba){l.view.validate();var zb=new mxOrgChartLayout(l,2,ea,X),Ub=zb.isVertexIgnored;zb.isVertexIgnored=function(Bb){return Ub.apply(this,arguments)||
+0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){zb.execute(l.getDefaultParent());ub()},!0,ka);ka=null}else if("organic"==Ba||"auto"==Ba&&$a.length>E.length){l.view.validate();var Lb=new mxFastOrganicLayout(l);Lb.forceConstant=3*X;Lb.disableEdgeStyle=!1;Lb.resetEdges=!1;var Xb=Lb.isVertexIgnored;Lb.isVertexIgnored=function(Bb){return Xb.apply(this,arguments)||0>mxUtils.indexOf(E,Bb)};this.executeLayout(function(){Lb.execute(l.getDefaultParent());ub()},!0,ka);ka=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[Ba]){l.view.validate();
+Fb=ka;var bc=EditorUi.CSV_ELK_LAYOUTS[Ba],Hb=mxUtils.clone(bc.config);Hb["elk.spacing.nodeNode"]=X;Hb["elk.layered.spacing.nodeNodeBetweenLayers"]=ea;Hb["elk.spacing.edgeEdge"]=fa;Hb["elk.layered.spacing.edgeEdgeBetweenLayers"]=fa;var Ob=l.createLayouts([{layout:bc.layout,config:Hb}]);this.scopeLayoutsToCells(Ob,$a);l.model.beginUpdate();var ac=!1,Zb=function(){ac||(ac=!0,l.model.endUpdate())},Vb=this;try{Ob[0].prepare(l.getDefaultParent(),function(Bb,Ib){null!=Bb?(Zb(),Vb.handleError(Bb)):Vb.executeLayout(function(){Ib();
+var Ab=l.getBoundingBoxFromGeometry($a);null!=Ab&&l.moveCells($a,sa-Ab.x,xa-Ab.y)},!0,function(){Zb();Fb()})})}catch(Bb){throw Zb(),Bb;}ka=null}}this.hideDialog()}finally{l.model.endUpdate()}null!=ka&&ka()}}catch(Bb){this.handleError(Bb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",q;for(q in urlParams)0>mxUtils.indexOf(c,q)&&null!=urlParams[q]&&(f+=l+q+"="+urlParams[q],l="&")}else f=window.location.search;
+return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),q;for(q in urlParams)0>mxUtils.indexOf(l,q)&&(c=0==f?c+"?":c+"&",null!=urlParams[q]&&(c+=q+"="+urlParams[q],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,l,q,x){c=new LinkDialog(this,c,f,l,!0,q,x);this.showDialog(c.container,
+440,null,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=
+this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();
+this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);
+this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||
+"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var N=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){N.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),l=this.getSelectionState(),q=this.isDiagramActive(),
+x="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&x);this.actions.get("redo").setEnabled(this.canRedo()&&x);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(q);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(q&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(q&&
+0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(q&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(q&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(q&&l.image&&0<l.cells.length);this.actions.get("pageSetup").setEnabled(q);this.actions.get("shadowVisible").setEnabled(q);this.actions.get("connectionArrows").setEnabled(q);this.actions.get("connectionPoints").setEnabled(q);this.actions.get("copyStyle").setEnabled(q&&
+!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&q&&0<l.cells.length);this.actions.get("copyTextStyle").setEnabled(q&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&q&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length&&!l.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<l.cells.length);this.actions.get("createShape").setEnabled(q);this.actions.get("createRevision").setEnabled(q);
+this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(q&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);
+this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):
+"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(q&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var R=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);R.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,q,x,A,E,K){var Q=c.editor.graph;
+if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(Q.getSvg(q,x,A)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),J=Q.getGraphBounds(),ia=Math.floor(J.width*x/Q.view.scale),Y=Math.floor(J.height*x/Q.view.scale);if(V.length<=MAX_REQUEST_SIZE&&ia*Y<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas())if(c.isRemoteExportEnabled()){var aa=
+{globalVars:Q.getExportVariables()};K&&(aa.grid={size:Q.gridSize,steps:Q.view.gridSteps,color:Q.view.gridColor});c.saveRequest(f,l,function(ja,la){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(la||"0")+(null!=ja?"&filename="+encodeURIComponent(ja):"")+"&extras="+encodeURIComponent(JSON.stringify(aa))+(0<E?"&dpi="+E:"")+"&bg="+(null!=q?q:"none")+"&w="+ia+"&h="+Y+"&border="+A+"&xml="+encodeURIComponent(V))})}else c.handleError({message:mxResources.get("notAvailable")});else"png"==l?c.exportImage(x,
+null==q||"none"==q,!0,!1,!1,A,!0,!1,null,K,E):c.exportImage(x,!1,!0,!1,!1,A,!0,!1,"jpeg",K);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var q=c;this.currentPage!=this.pages[l]&&(q=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),q.model.setRoot(this.pages[l].root));f+=this.pages[l].getName()+
+" "+q.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,l){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){l.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));l.html=f;return}l.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var l={id:c.getId()};l.type=f?"layer":c.edge?"edge":
+c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(l.parent=f.getId()));c.edge&&(null!=c.source&&(l.source=c.source.getId()),null!=c.target&&(l.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),l);c=f.attributes;f={};for(var q=0,x=0;x<c.length;x++){var A=c[x].nodeName;"label"!=A&&"placeholders"!=A&&"id"!=A&&(f[A]=c[x].nodeValue,q++)}0<q&&(l.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,l);return l};EditorUi.prototype.getJsonForPage=
+function(c,f){var l=this.editor.graph.getModel();var q=null==c||c==this.currentPage?l.getRoot():this.updatePageRoot(c).root;var x=[],A=mxUtils.bind(this,function(J,ia){x.push(this.getJsonForExportCell(J,ia));ia=J.getChildCount();for(var Y=0;Y<ia;Y++)A(J.getChildAt(Y),!1)});if(null!=f){q={};for(var E=0;E<f.length;E++)q[f[E].getId()]=!0;for(E=0;E<f.length;E++){for(var K=f[E],Q=K.getParent(),V=!1;null!=Q;){if(q[Q.getId()]){V=!0;break}Q=Q.getParent()}V||A(K,l.isLayer(K))}}else for(f=q.getChildCount(),
+E=0;E<f;E++)A(q.getChildAt(E),!0);E={};null!=c&&(E.id=c.getId(),E.name=c.getName());E.cells=x;return E};EditorUi.prototype.createJsonForExport=function(c,f,l,q){var x={version:EditorUi.VERSION};f&&(x.data=mxUtils.getXml(this.getXmlFileData(!q,!c,!l)));f=[];if(q)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));x.pages=
+f;return x};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},l=document.createElement("div");l.style.whiteSpace="nowrap";var q=document.createElement("h3");mxUtils.write(q,mxUtils.htmlEntities(c));l.appendChild(q);var x=document.createElement("div");x.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";x.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var A={};try{var E=mxSettings.getCustomLibraries();for(c=0;c<
+E.length;c++){var K=E[c];if("R"==K.substring(0,1)){var Q=JSON.parse(decodeURIComponent(K.substring(1)));A[Q[0]]={id:Q[0],title:Q[1],downloadUrl:Q[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){x.innerText="";if(0==V.length)x.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var J=0;J<V.length;J++){var ia=V[J];A[ia.id]&&(f[ia.id]=ia);var Y=this.addCheckbox(x,ia.title,A[ia.id]);
+(function(aa,ja){mxEvent.addListener(ja,"change",function(){this.checked?f[aa.id]=aa:delete f[aa.id]})})(ia,Y)}},mxUtils.bind(this,function(V){x.innerText="";var J=document.createElement("div");J.style.padding="8px";J.style.textAlign="center";mxUtils.write(J,mxResources.get("error")+": ");mxUtils.write(J,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));x.appendChild(J)}));l.appendChild(x);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));
+var V=0,J;for(J in f)null==A[J]&&(V++,mxUtils.bind(this,function(ia){this.remoteInvoke("getFileContent",[ia.downloadUrl],null,mxUtils.bind(this,function(Y){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,Y,ia)),this.showSidebar()}catch(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[J]));for(J in A)f[J]||this.closeLibrary(new RemoteLibrary(this,
+null,A[J]));0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=
+[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=null!=f?f.callbackId:null,q="number"===typeof l&&0<=l&&l<this.remoteInvokeCallbacks.length?this.remoteInvokeCallbacks[l]:null;if(null==q)throw Error("No callback for "+(null!=f?f.callbackId:
+"null"));c.error?q.error&&q.error(c.error.errResp):q.callback&&q.callback.apply(this,c.resp);this.remoteInvokeCallbacks[l]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,q,x){var A=!0,E=window.setTimeout(mxUtils.bind(this,function(){A=!1;x({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),K=mxUtils.bind(this,function(){window.clearTimeout(E);A&&q.apply(this,arguments)}),Q=mxUtils.bind(this,function(){window.clearTimeout(E);A&&x.apply(this,arguments)});l=l||{};l.callbackId=
+this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:K,error:Q});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var l=mxUtils.bind(this,function(V,J){var ia={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=J?ia.error={errResp:J}:null!=V&&(ia.resp=V);this.remoteWin.postMessage(JSON.stringify(ia),
+"*")});try{var q=c.funtionName,x=null!=q&&Object.prototype.hasOwnProperty.call(this.remoteInvokableFns,q)?this.remoteInvokableFns[q]:null;if(null!=x&&"function"===typeof this[q]){if(x.allowedDomains){for(var A=!1,E=0;E<x.allowedDomains.length;E++)if(f=="https://"+x.allowedDomains[E]){A=!0;break}if(!A){l(null,"Invalid Call: "+q+" is not allowed.");return}}var K=c.functionArgs;Array.isArray(K)||(K=[]);if(x.isAsync)K.push(function(){l(Array.prototype.slice.apply(arguments))}),K.push(function(V){l(null,
+V||"Unkown Error")}),this[q].apply(this,K);else{var Q=this[q].apply(this,K);l([Q])}}else l(null,"Invalid Call: "+q+" is not found.")}catch(V){l(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var q=l.open("database",2);q.onupgradeneeded=function(x){try{var A=q.result;1>x.oldVersion&&A.createObjectStore("objects",{keyPath:"key"});2>x.oldVersion&&
+(A.createObjectStore("files",{keyPath:"title"}),A.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(E){null!=f&&f(E)}};q.onsuccess=mxUtils.bind(this,function(x){try{var A=q.result;this.database=A;EditorUi.migrateStorageFiles&&(StorageFile.migrate(A),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(E){if((!E||
+"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var K=document.createElement("iframe");K.style.display="none";K.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(K);var Q=!0,V=!1,J,ia=0,Y=mxUtils.bind(this,function(){V=!0;this.setDatabaseItem(".drawioMigrated3",!0);K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),aa=mxUtils.bind(this,function(){ia++;
+ja()}),ja=mxUtils.bind(this,function(){try{if(ia>=J.length)Y();else{var ua=J[ia];StorageFile.getFileContent(this,ua,mxUtils.bind(this,function(Da){null==Da||".scratchpad"==ua&&Da==this.emptyLibraryXml?K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[ua]}),"*"):aa()}),aa)}}catch(Da){console.log(Da)}}),la=mxUtils.bind(this,function(ua){try{this.setDatabaseItem(null,[{title:ua.title,size:ua.data.length,lastModified:Date.now(),type:ua.isLib?
+"L":"F"},{title:ua.title,data:ua.data}],aa,aa,["filesInfo","files"])}catch(Da){console.log(Da)}});E=mxUtils.bind(this,function(ua){try{if(ua.source==K.contentWindow){var Da={};try{Da=JSON.parse(ua.data)}catch(ha){}"init"==Da.event?(K.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),K.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=Da.event||V||(Q?null!=Da.resp&&0<Da.resp.length&&null!=
+Da.resp[0]?(J=Da.resp[0],Q=!1,ja()):Y():null!=Da.resp&&0<Da.resp.length&&null!=Da.resp[0]?la(Da.resp[0]):aa())}}catch(ha){console.log(ha)}});window.addEventListener("message",E)}})));c(A);A.onversionchange=function(){A.close()}}catch(E){null!=f?f(E):null!=window.console&&console.warn(E)}});q.onerror=f;q.onblocked=function(){}}catch(x){null!=f?f(x):null!=window.console&&console.error(x)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,
+f,l,q,x){this.openDatabase(mxUtils.bind(this,function(A){try{x=x||"objects";Array.isArray(x)||(x=[x],c=[c],f=[f]);var E=A.transaction(x,"readwrite");E.oncomplete=l;E.onerror=q;for(A=0;A<x.length;A++)E.objectStore(x[A]).put(null!=c&&null!=c[A]?{key:c[A],data:f[A]}:f[A])}catch(K){null!=q&&q(K)}}),q)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c]);var A=x.transaction(q,"readwrite");A.oncomplete=
+f;A.onerror=l;for(x=0;x<q.length;x++)A.objectStore(q[x]).delete(c[x])}catch(E){null!=l&&l(E)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";var A=x.transaction([q],"readonly").objectStore(q).get(c);A.onsuccess=function(){f(A.result)};A.onerror=l}catch(E){null!=l&&l(E)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(q){try{l=l||"objects";var x=q.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),
+A=[];x.onsuccess=function(E){null==E.target.result?c(A):(A.push(E.target.result.value),E.target.result.continue())};x.onerror=f}catch(E){null!=f&&f(E)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(q){try{l=l||"objects";var x=q.transaction([l],"readonly").objectStore(l).getAllKeys();x.onsuccess=function(){c(x.result)};x.onerror=f}catch(A){null!=f&&f(A)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=
+c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var l=this.getCurrentFile();null!=l?l.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,l){var q=this.getCurrentFile();null!=q?q.addComment(c,f,l):f(Date.now())};EditorUi.prototype.canReplyToReplies=
+function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.anchoredCommentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.anchoredCommentsSupported():!1};EditorUi.prototype.mentionsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionsSupported():!1};EditorUi.prototype.freeMentionsSupported=function(){var c=this.getCurrentFile();
+return null!=c?c.freeMentionsSupported():!1};EditorUi.prototype.mentionsLiveSearch=function(){var c=this.getCurrentFile();return null!=c?c.mentionsLiveSearch():!1};EditorUi.prototype.mentionNotificationsSupported=function(){var c=this.getCurrentFile();return null!=c?c.mentionNotificationsSupported():!0};EditorUi.prototype.getMentionCandidates=function(c,f,l){var q=this.getCurrentFile();null!=q?q.getMentionCandidates(c,f,l):c([])};EditorUi.prototype.serializeMention=function(c){return"+"+c.email};
+EditorUi.prototype.parseMentionTokens=function(c){for(var f=/[+@]([A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,})/g,l=[],q=0,x;null!=(x=f.exec(c));)x.index>q&&l.push(c.substring(q,x.index)),l.push({email:x[1]}),q=x.index+x[0].length;q<c.length&&l.push(c.substring(q));return l};EditorUi.prototype.getCommentCacheTarget=function(){var c=this.getCurrentFile();return null!=c?c:this};EditorUi.prototype.refreshCommentCache=function(c,f){if(this.commentsSupported()){var l=this.getCommentCacheTarget();
+if(null!=l.commentCacheCallbacks)l.commentCacheCallbacks.push([c,f]);else{l.commentCacheCallbacks=[[c,f]];var q=mxUtils.bind(this,function(x,A){var E=l.commentCacheCallbacks;l.commentCacheCallbacks=null;for(var K=0;null!=E&&K<E.length;K++)if(null!=E[K][x])E[K][x](A)});this.getComments(mxUtils.bind(this,function(x){this.getCommentCacheTarget()==l&&(l.commentCache=x,this.fireEvent(new mxEventObject("commentsChanged")));q(0,x)}),mxUtils.bind(this,function(x){q(1,x)}))}}else null!=c&&c(null)};EditorUi.prototype.commentsUpdated=
+function(){if(this.commentsSupported()){var c=this.getCurrentFile();null!=c&&null!=c.sync&&c.sync.sendCommentsChangedMessage();this.refreshCommentCache()}};EditorUi.prototype.getUnresolvedCommentCount=function(){var c=this.getCommentCacheTarget().commentCache,f=0;if(null!=c)for(var l=0;l<c.length;l++)c[l].isResolved||f++;return f};EditorUi.prototype.getCommentAnchorCells=function(c){var f=c.getAnchorCellIds(),l=[];if(null!=f&&0<f.length){c=c.getAnchorPageId();var q=null==c?this.currentPage:this.getPageById(c);
+if(null!=q)if(q==this.currentPage)for(c=0;c<f.length;c++)q=this.editor.graph.model.getCell(f[c]),null!=q&&l.push(q);else{try{this.updatePageRoot(q)}catch(K){return l}if(null!=q.root){var x={},A=0;for(c=0;c<f.length;c++)x[f[c]]||(x[f[c]]=!0,A++);var E=function(K){if(0<A){x[K.getId()]&&(x[K.getId()]=!1,l.push(K),A--);for(var Q=0;Q<K.getChildCount();Q++)E(K.getChildAt(Q))}};E(q.root)}}}return l};EditorUi.prototype.gotoCommentAnchor=function(c){var f=c.getAnchorPageId();if(null!=f&&null!=this.currentPage&&
+f!=this.currentPage.getId()){f=this.getPageById(f);if(null==f)return!1;this.selectPage(f)}f=this.editor.graph;var l=c.getAnchorCellIds();if(null!=l&&0<l.length){c=[];for(var q=0;q<l.length;q++){var x=f.model.getCell(l[q]);null!=x&&c.push(x)}return 0<c.length?(f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c,"#0071e3",2E3),f.scrollCellToVisible(c[0]),!0):!1}l=c.getAnchorRect();null!=l&&0<l.w&&0<l.h&&f.fitWindow(new mxRectangle(l.x,l.y,l.w,l.h),0);c=c.getAnchorPoint();if(null!=c){l=f.view.scale;
+q=f.view.translate;f=f.container;f.scrollLeft=Math.round((c.x+q.x)*l-f.clientWidth/2);f.scrollTop=Math.round((c.y+q.y)*l-f.clientHeight/2);var A=document.createElement("div");A.className="geCommentAnchorMarker";A.style.left=Math.round((c.x+q.x)*l)+"px";A.style.top=Math.round((c.y+q.y)*l)+"px";f.appendChild(A);window.setTimeout(function(){null!=A.parentNode&&A.parentNode.removeChild(A)},2E3)}return!0};EditorUi.prototype.addCommentsBadge=function(c){var f=document.createElement("span");f.className=
+"geCommentsBadge";f.style.display="none";c.appendChild(f);c=mxUtils.bind(this,function(){var l=this.getUnresolvedCommentCount();f.style.display=0<l?"":"none";f.innerText="";mxUtils.write(f,99<l?"99+":String(l))});this.addListener("commentsChanged",c);this.editor.addListener("fileLoaded",c);c();return f};EditorUi.prototype.installCommentDragSource=function(c){var f=this,l=document.createElement("div");l.style.width="24px";l.style.height="24px";l.style.backgroundImage="url("+Editor.lightDarkCommentImage+
+")";l.style.backgroundSize="100% 100%";l.style.opacity="0.9";c=mxUtils.makeDraggable(c,function(){return f.editor.graph},function(x,A,E,K,Q){null!=f.currentPage&&null!=f.menus&&null!=f.menus.showCommentsWindow&&(x=null!=E?{p:f.currentPage.getId(),c:E.id}:{p:f.currentPage.getId(),pt:{x:Math.round(K),y:Math.round(Q)}},f.menus.showCommentsWindow(null,x))},l);var q=c.mouseDown;c.mouseDown=function(x){mxEvent.isMouseEvent(x)&&!mxEvent.isPopupTrigger(x)&&f.commentsSupported()&&f.anchoredCommentsSupported()&&
+f.canComment()&&q.apply(this,arguments)};return c};EditorUi.prototype.updateCommentOverlays=function(){var c=this.editor.graph;if(null!=this.commentOverlays)for(var f=0;f<this.commentOverlays.length;f++)c.removeCellOverlay(this.commentOverlays[f].cell,this.commentOverlays[f].overlay);this.commentOverlays=null;var l=this.getCurrentFile();if(null!=l&&l.anchoredCommentsSupported()&&null!=l.commentCache&&!this.editor.isChromelessView()){var q=null!=this.currentPage?this.currentPage.getId():null,x={};
+for(f=0;f<l.commentCache.length;f++){var A=l.commentCache[f],E=A.getAnchorCellIds();if(!A.isResolved&&null!=E&&A.getAnchorPageId()==q)for(A=0;A<E.length;A++)x[E[A]]=!0}this.commentOverlays=[];for(var K in x)mxUtils.bind(this,function(Q){var V=c.model.getCell(Q);if(null!=V){var J=new mxCellOverlay(new mxImage(Editor.lightDarkCommentImage,16,16),mxResources.get("comments"),mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,new mxPoint(8,8));J.isCommentOverlay=!0;J.cursor="pointer";J.addListener(mxEvent.CLICK,
+mxUtils.bind(this,function(){null!=this.menus&&null!=this.menus.showCommentsWindow&&this.menus.showCommentsWindow(Q)}));c.addCellOverlay(V,J);this.commentOverlays.push({cell:V,overlay:J})}})(K)}};EditorUi.prototype.newComment=function(c,f){var l=this.getCurrentFile();return null!=l?l.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=
+function(c,f){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=
+function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,q,x,A,E,K){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,q,x,A,E,K)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=
+function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,q,x,A,E,K,Q,V,J,ia,Y,aa,ja,la)};EditorUi.prototype.createImageUrlConverter=
+function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,q){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,q)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");
+return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,l,q){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,l,q)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,l,q,x){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,l,q,x)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==
+localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var l=localStorage.key(f),q=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<q.length){var x="<mxfile "===q.substring(0,8)||"<?xml"===q.substring(0,5)||"\x3c!--[if IE]>"===q.substring(0,12);q="<mxlibrary>"===q.substring(0,11);(x||q)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&
+"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
+var CommentsWindow=function(b,d,m,p,t,n){function y(){for(var ma=U.getElementsByTagName("div"),ta=0,va=0;va<ma.length;va++)"none"!=ma[va].style.display&&ma[va].parentNode==U&&ta++;W.style.display=0==ta?"block":"none"}function C(ma){for(var ta=0;ta<ha.length;ta++)if(null!=ha[ta].email&&null!=ma&&ha[ta].email.toLowerCase()==ma.toLowerCase())return ha[ta].displayName||ma;return ma}function O(ma){var ta=document.createElement("span");ta.className="geCommentMention";ta.setAttribute("data-mention",b.serializeMention(ma));
+null!=ma.email&&ta.setAttribute("data-email",ma.email);ta.contentEditable="false";mxUtils.write(ta,"@"+(ma.displayName||(null!=ma.email?C(ma.email):ma.id)));return ta}function F(ma,ta){ma.innerText="";ta=null!=ta?ta:"";if(aa){ta=b.parseMentionTokens(ta);for(var va=0;va<ta.length;va++)"string"===typeof ta[va]?mxUtils.write(ma,ta[va]):ma.appendChild(O(ta[va]))}else mxUtils.write(ma,ta)}function N(ma,ta,va,Ga){function La(Ra){for(var $a in ab)for(var fb=0;fb<ab[$a].length;fb++)Ra(ab[$a][fb],"down"==
$a?hb:"move"==$a?wb:Fa)}function Ia(Ra){Ra=mxUtils.convertPoint(Na,mxEvent.getClientX(Ra),mxEvent.getClientY(Ra));return new mxPoint(Ra.x/Ka.view.scale-Ka.view.translate.x,Ra.y/Ka.view.scale-Ka.view.translate.y)}function Ca(){La(function(Ra,$a){document.removeEventListener(Ra,$a,!0)});document.removeEventListener("keydown",cb,!0);window.setTimeout(function(){document.removeEventListener("click",Wa,!0)},0);Na.classList.remove("geCommentAnchorPicking");Ka.setEnabled(Oa);null!=Ea&&null!=Ea.parentNode&&
-Ea.parentNode.removeChild(Ea)}function Pa(Ra){Ca();null!=Ra&&(ma.anchor=Ra,f(ma,ta,va))}var Ka=b.editor.graph,Na=Ka.container,Oa=Ka.isEnabled(),Ea=null,Aa=null,Ja=null,Ga=null,Ua=null;Ka.setEnabled(!1);Na.classList.add("geCommentAnchorPicking");var ab=mxClient.IS_POINTER?{down:["pointerdown"],move:["pointermove"],up:["pointerup"]}:{down:["mousedown","touchstart"],move:["mousemove","touchmove"],up:["mouseup","touchend"]},Wa=function(Ra){Na.contains(mxEvent.getSource(Ra))&&mxEvent.consume(Ra)},cb=function(Ra){27==
-Ra.keyCode&&(Pa(null),mxEvent.consume(Ra))},hb=function(Ra){Na.contains(mxEvent.getSource(Ra))?(Aa=Ia(Ra),Ja=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra)),Ha&&(Ea=document.createElement("div"),Ea.className="geCommentAnchorPickPreview",Na.appendChild(Ea)),mxEvent.consume(Ra)):Pa(null)},wb=function(Ra){if(null!=Aa&&(Ga=Ia(Ra),Ua=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra)),null!=Ea)){var $a=Ka.view.scale,fb=Ka.view.translate;Ea.style.left=Math.round((Math.min(Aa.x,Ga.x)+fb.x)*
-$a)+"px";Ea.style.top=Math.round((Math.min(Aa.y,Ga.y)+fb.y)*$a)+"px";Ea.style.width=Math.round(Math.abs(Ga.x-Aa.x)*$a)+"px";Ea.style.height=Math.round(Math.abs(Ga.y-Aa.y)*$a)+"px";mxEvent.consume(Ra)}},Fa=function(Ra){if(null!=Aa)if(null==b.currentPage)Pa(null);else{var $a=b.currentPage.getId();if(Ha){var fb=Ga,rb=Ua;try{fb=Ia(Ra),rb=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra))}catch(mb){}null==fb||null==rb||4>Math.abs(rb.x-Ja.x)&&4>Math.abs(rb.y-Ja.y)?Pa(null):Pa({p:$a,r:{x:Math.round(Math.min(Aa.x,
+Ea.parentNode.removeChild(Ea)}function Pa(Ra){Ca();null!=Ra&&(ma.anchor=Ra,f(ma,ta,va))}var Ka=b.editor.graph,Na=Ka.container,Oa=Ka.isEnabled(),Ea=null,Aa=null,Ja=null,Ha=null,Ua=null;Ka.setEnabled(!1);Na.classList.add("geCommentAnchorPicking");var ab=mxClient.IS_POINTER?{down:["pointerdown"],move:["pointermove"],up:["pointerup"]}:{down:["mousedown","touchstart"],move:["mousemove","touchmove"],up:["mouseup","touchend"]},Wa=function(Ra){Na.contains(mxEvent.getSource(Ra))&&mxEvent.consume(Ra)},cb=function(Ra){27==
+Ra.keyCode&&(Pa(null),mxEvent.consume(Ra))},hb=function(Ra){Na.contains(mxEvent.getSource(Ra))?(Aa=Ia(Ra),Ja=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra)),Ga&&(Ea=document.createElement("div"),Ea.className="geCommentAnchorPickPreview",Na.appendChild(Ea)),mxEvent.consume(Ra)):Pa(null)},wb=function(Ra){if(null!=Aa&&(Ha=Ia(Ra),Ua=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra)),null!=Ea)){var $a=Ka.view.scale,fb=Ka.view.translate;Ea.style.left=Math.round((Math.min(Aa.x,Ha.x)+fb.x)*
+$a)+"px";Ea.style.top=Math.round((Math.min(Aa.y,Ha.y)+fb.y)*$a)+"px";Ea.style.width=Math.round(Math.abs(Ha.x-Aa.x)*$a)+"px";Ea.style.height=Math.round(Math.abs(Ha.y-Aa.y)*$a)+"px";mxEvent.consume(Ra)}},Fa=function(Ra){if(null!=Aa)if(null==b.currentPage)Pa(null);else{var $a=b.currentPage.getId();if(Ga){var fb=Ha,rb=Ua;try{fb=Ia(Ra),rb=new mxPoint(mxEvent.getClientX(Ra),mxEvent.getClientY(Ra))}catch(mb){}null==fb||null==rb||4>Math.abs(rb.x-Ja.x)&&4>Math.abs(rb.y-Ja.y)?Pa(null):Pa({p:$a,r:{x:Math.round(Math.min(Aa.x,
fb.x)),y:Math.round(Math.min(Aa.y,fb.y)),w:Math.round(Math.abs(fb.x-Aa.x)),h:Math.round(Math.abs(fb.y-Aa.y))}})}else Pa({p:$a,pt:{x:Math.round(Aa.x),y:Math.round(Aa.y)}});mxEvent.consume(Ra)}};window.setTimeout(function(){La(function(Ra,$a){document.addEventListener(Ra,$a,!0)});document.addEventListener("click",Wa,!0);document.addEventListener("keydown",cb,!0)},0)}function R(ma){ma=null!=ma?mxUtils.trim(ma.replace(/\s+/g," ")):"";25<ma.length&&(ma=ma.substring(0,25)+"…");return ma}function c(ma){var ta=
-"";try{var va=b.editor.graph.getLabel(ma);"string"===typeof va&&(ta=Editor.convertHtmlToText(va))}catch(Ha){}return R(ta)||mxResources.get("shape")}function f(ma,ta,va){function Ha(Ga){if(va){var Ua=document.createElement("span");Ua.className="geCommentAnchorRemove";Ua.setAttribute("title",mxResources.get("remove"));mxUtils.write(Ua,"×");mxEvent.addListener(Ua,"click",function(ab){ma.anchor=null;f(ma,ta,va);ab.preventDefault();mxEvent.consume(ab)});Ga.appendChild(Ua)}}function La(Ga,Ua,ab,Wa){var cb=
-document.createElement(Wa?"span":"a");cb.className="geCommentAnchorChip"+(Wa?" geCommentAnchorChipDeleted":"");cb.innerHTML=Ga;Ga=document.createElement("span");mxUtils.write(Ga,Ua);cb.appendChild(Ga);Wa||(null!=ab&&cb.setAttribute("title",ab),mxEvent.addListener(cb,"click",function(hb){b.gotoCommentAnchor(ma);hb.preventDefault();mxEvent.consume(hb)}));Ha(cb);ta.appendChild(cb)}ta.innerText="";ta.style.display="";if(null!=ma.getAnchorCellId()){var Ia=b.getCommentAnchorCells(ma),Ca=null,Pa=null;if(0==
+"";try{var va=b.editor.graph.getLabel(ma);"string"===typeof va&&(ta=Editor.convertHtmlToText(va))}catch(Ga){}return R(ta)||mxResources.get("shape")}function f(ma,ta,va){function Ga(Ha){if(va){var Ua=document.createElement("span");Ua.className="geCommentAnchorRemove";Ua.setAttribute("title",mxResources.get("remove"));mxUtils.write(Ua,"×");mxEvent.addListener(Ua,"click",function(ab){ma.anchor=null;f(ma,ta,va);ab.preventDefault();mxEvent.consume(ab)});Ha.appendChild(Ua)}}function La(Ha,Ua,ab,Wa){var cb=
+document.createElement(Wa?"span":"a");cb.className="geCommentAnchorChip"+(Wa?" geCommentAnchorChipDeleted":"");cb.innerHTML=Ha;Ha=document.createElement("span");mxUtils.write(Ha,Ua);cb.appendChild(Ha);Wa||(null!=ab&&cb.setAttribute("title",ab),mxEvent.addListener(cb,"click",function(hb){b.gotoCommentAnchor(ma);hb.preventDefault();mxEvent.consume(hb)}));Ga(cb);ta.appendChild(cb)}ta.innerText="";ta.style.display="";if(null!=ma.getAnchorCellId()){var Ia=b.getCommentAnchorCells(ma),Ca=null,Pa=null;if(0==
Ia.length)Ca=mxResources.get("shapeDeleted");else if(1==Ia.length)Ca=c(Ia[0]),Pa=mxResources.get("shape");else{Ca=Ia.length+" "+mxResources.get("cells");Pa=[];for(var Ka=0;Ka<Ia.length;Ka++)Pa.push(c(Ia[Ka]));Pa=Pa.join("\n")}La('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
Ca,Pa,0==Ia.length)}else if(null!=ma.getAnchorPageId())Ia=b.getPageById(ma.getAnchorPageId()),Pa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 1.5h5.5L12.5 4.5v10h-8.5z M9.5 1.5v3h3"/></svg>',Ca=null,null!=ma.getAnchorRect()?(Pa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="8" rx="1" stroke-dasharray="2.6 2.2"/></svg>',
Ca="area"):null!=ma.getAnchorPoint()&&(Pa='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',Ca="point"),Ca=null==Ia?mxResources.get("pageNotFound"):null!=Ca?mxResources.get(Ca):R(Ia.getName())||mxResources.get("page"),La(Pa,Ca,null!=Ia?Ia.getName()||
-mxResources.get("page"):null,null==Ia);else if(va&&null!=b.currentPage){var Na=function(Ga,Ua,ab){var Wa=document.createElement("div");Wa.className="geCommentMentionRow";Wa.innerHTML=Ga;Ga=document.createElement("span");mxUtils.write(Ga,Ua);Wa.appendChild(Ga);mxEvent.addListener(Wa,"mousedown",function(cb){Oa();ab();f(ma,ta,va);cb.preventDefault();mxEvent.consume(cb)});Aa.appendChild(Wa)},Oa=function(){null!=Aa&&null!=Aa.parentNode&&Aa.parentNode.removeChild(Aa);Aa=null;null!=Ja&&(mxEvent.removeListener(document,
+mxResources.get("page"):null,null==Ia);else if(va&&null!=b.currentPage){var Na=function(Ha,Ua,ab){var Wa=document.createElement("div");Wa.className="geCommentMentionRow";Wa.innerHTML=Ha;Ha=document.createElement("span");mxUtils.write(Ha,Ua);Wa.appendChild(Ha);mxEvent.addListener(Wa,"mousedown",function(cb){Oa();ab();f(ma,ta,va);cb.preventDefault();mxEvent.consume(cb)});Aa.appendChild(Wa)},Oa=function(){null!=Aa&&null!=Aa.parentNode&&Aa.parentNode.removeChild(Aa);Aa=null;null!=Ja&&(mxEvent.removeListener(document,
"mousedown",Ja),Ja=null)},Ea=document.createElement("a");Ea.className="geCommentAnchorChip geCommentAnchorAttach";Ea.setAttribute("title",mxResources.get("attach"));Ea.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8M4.5 6.5L8 10l3.5-3.5M3 13h10"/></svg>';Ca=document.createElement("span");mxUtils.write(Ca,mxResources.get("attach"));Ea.appendChild(Ca);var Aa=
-null,Ja=null;mxEvent.addListener(Ea,"click",function(Ga){if(null!=Aa)Oa();else if(null!=b.currentPage){var Ua=b.editor.graph,ab=b.currentPage.getId();Aa=document.createElement("div");Aa.className="geCommentMentionMenu";1==Ua.getSelectionCount()?Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
+null,Ja=null;mxEvent.addListener(Ea,"click",function(Ha){if(null!=Aa)Oa();else if(null!=b.currentPage){var Ua=b.editor.graph,ab=b.currentPage.getId();Aa=document.createElement("div");Aa.className="geCommentMentionMenu";1==Ua.getSelectionCount()?Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',
c(Ua.getSelectionCell()),function(){ma.anchor={p:ab,c:Ua.getSelectionCell().id}}):1<Ua.getSelectionCount()&&Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',Ua.getSelectionCount()+" "+mxResources.get("cells"),function(){for(var Wa=
Ua.getSelectionCells(),cb=[],hb=0;hb<Wa.length;hb++)cb.push(Wa[hb].id);ma.anchor={p:ab,c:cb}});Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 14.5s4.5-4.2 4.5-8a4.5 4.5 0 1 0-9 0c0 3.8 4.5 8 4.5 8z"/><circle cx="8" cy="6.5" r="1.5" fill="currentColor" stroke="none"/></svg>',mxResources.get("point")+"…",function(){N(ma,ta,va,!1)});Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="8" rx="1" stroke-dasharray="2.6 2.2"/></svg>',
mxResources.get("area")+"…",function(){N(ma,ta,va,!0)});Na('<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 1.5h5.5L12.5 4.5v10h-8.5z M9.5 1.5v3h3"/></svg>',mxResources.get("currentPage"),function(){ma.anchor={p:ab}});Aa.style.left=Ea.offsetLeft+"px";Aa.style.top=Ea.offsetTop+Ea.offsetHeight+2+"px";ta.parentNode.insertBefore(Aa,ta.nextSibling);Ja=function(Wa){Wa=mxEvent.getSource(Wa);
-null==Aa||Wa==Ea||Ea.contains(Wa)||Aa.contains(Wa)||Oa()};mxEvent.addListener(document,"mousedown",Ja)}Ga.preventDefault();mxEvent.consume(Ga)});ta.appendChild(Ea)}else ta.style.display="none"}function l(ma){if("TEXTAREA"==ma.nodeName)return ma.value;var ta=[],va=function(Ha){for(Ha=Ha.firstChild;null!=Ha;Ha=Ha.nextSibling)3==Ha.nodeType?ta.push(Ha.nodeValue):1==Ha.nodeType&&("BR"==Ha.nodeName?ta.push("\n"):null!=Ha.getAttribute&&null!=Ha.getAttribute("data-mention")?ta.push(Ha.getAttribute("data-mention")):
-(("DIV"==Ha.nodeName||"P"==Ha.nodeName)&&0<ta.length&&"\n"!=ta[ta.length-1]&&!/\n$/.test(ta[ta.length-1])&&ta.push("\n"),va(Ha)))};va(ma);return ta.join("").replace(/\u00a0/g," ")}function q(ma){function ta(){null!=Ca&&null!=Ca.parentNode&&Ca.parentNode.removeChild(Ca);Na=Ca=null}function va(){var Aa=window.getSelection();if(null==Aa||0==Aa.rangeCount)return null;Aa=Aa.getRangeAt(0);if(!Aa.collapsed||3!=Aa.startContainer.nodeType||!ma.contains(Aa.startContainer))return null;var Ja=Aa.startContainer.nodeValue.substring(0,
-Aa.startOffset);Ja=/(^|[\s\u00a0])@([^\s\u00a0]*)$/.exec(Ja);return null==Ja?null:{node:Aa.startContainer,start:Ja.index+Ja[1].length,end:Aa.startOffset,query:Ja[2]}}function Ha(Aa){if(null!=Na){var Ja=Na.node,Ga=Ja.nodeValue.substring(Na.end);Ja.nodeValue=Ja.nodeValue.substring(0,Na.start);Aa=O(Aa);Ga=document.createTextNode(" "+Ga);Ja.parentNode.insertBefore(Aa,Ja.nextSibling);Aa.parentNode.insertBefore(Ga,Aa.nextSibling);ua||null!=Ea||(Ea=document.createElement("div"),Ea.style.cssText="font-size:11px;opacity:0.7;padding:2px 0;",
-mxUtils.write(Ea,mxResources.get("mentionNoNotify",null,"People you mention are not notified")),ma.parentNode.insertBefore(Ea,ma.nextSibling));Ja=window.getSelection();Aa=document.createRange();Aa.setStart(Ga,1);Aa.collapse(!0);Ja.removeAllRanges();Ja.addRange(Aa);ta()}}function La(){Na=va();if(null==Na)ta();else if(ja)null!=Oa&&window.clearTimeout(Oa),Oa=window.setTimeout(function(){Oa=null;if(null!=Na){var ab=Na.query;b.getMentionCandidates(function(Wa){null!=Na&&Na.query==ab&&Ia(Wa.slice(0,6))},
-function(){},ab)}},300);else{for(var Aa=Na.query.toLowerCase(),Ja=[],Ga=0;Ga<ha.length&&6>Ja.length;Ga++){var Ua=ha[Ga];(0==Aa.length||null!=Ua.displayName&&0<=Ua.displayName.toLowerCase().indexOf(Aa)||null!=Ua.email&&0<=Ua.email.toLowerCase().indexOf(Aa))&&Ja.push(Ua)}if(ka&&/^[A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}$/.test(Na.query)){Ua=!1;for(Ga=0;Ga<Ja.length;Ga++)if(null!=Ja[Ga].email&&Ja[Ga].email.toLowerCase()==Aa){Ua=!0;break}Ua||Ja.push({email:Na.query})}Ia(Ja)}}function Ia(Aa){Ka=
-Aa;if(0==Ka.length)ta();else for(Pa=Math.min(Pa,Ka.length-1),null==Ca&&(Ca=document.createElement("div"),Ca.className="geCommentMentionMenu",ma.parentNode.insertBefore(Ca,ma.nextSibling)),Ca.style.left=ma.offsetLeft+"px",Ca.style.top=ma.offsetTop+ma.offsetHeight+"px",Ca.innerText="",Aa=0;Aa<Ka.length;Aa++)(function(Ja,Ga){var Ua=document.createElement("div");Ua.className="geCommentMentionRow"+(Ga==Pa?" geCommentMentionRowSelected":"");Ga=null;null==Ja.pictureUrl&&Ja.isGroup?(Ga=document.createElement("span"),
-Ga.className="geCommentMentionImg",Ga.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="6" cy="5.5" r="2.4"/><path d="M1.5 13.5c0-2.6 2-3.9 4.5-3.9s4.5 1.3 4.5 3.9"/><circle cx="11.3" cy="6" r="2"/><path d="M12.3 10.1c1.6.5 2.2 1.6 2.2 3.4"/></svg>'):(Ga=document.createElement("img"),Ga.className="geCommentMentionImg",Ga.src=null!=Ja.pictureUrl?Ja.pictureUrl:
-Editor.userImage);Ua.appendChild(Ga);Ga=document.createElement("span");mxUtils.write(Ga,Ja.displayName||Ja.email);Ua.appendChild(Ga);Ja.isGroup&&(Ga=document.createElement("span"),Ga.className="geCommentMentionGroupTag",mxUtils.write(Ga,mxResources.get("group")),Ua.appendChild(Ga));null!=Ja.displayName&&null!=Ja.email&&(Ga=document.createElement("span"),Ga.className="geCommentMentionMail",mxUtils.write(Ga,Ja.email),Ua.appendChild(Ga));mxEvent.addListener(Ua,"mousedown",function(ab){Ha(Ja);ab.preventDefault();
-mxEvent.consume(ab)});Ca.appendChild(Ua)})(Ka[Aa],Aa)}var Ca=null,Pa=0,Ka=[],Na=null,Oa=null,Ea=null;mxEvent.addListener(ma,"keydown",function(Aa){null==Ca||mxEvent.isConsumed(Aa)||(40==Aa.keyCode||38==Aa.keyCode?(Pa=(Pa+(40==Aa.keyCode?1:Ka.length-1))%Ka.length,La(),Aa.preventDefault(),mxEvent.consume(Aa)):13!=Aa.keyCode&&9!=Aa.keyCode||mxEvent.isControlDown(Aa)||mxEvent.isMetaDown(Aa)?27==Aa.keyCode&&(ta(),Aa.preventDefault(),mxEvent.consume(Aa)):(Ha(Ka[Pa]),Aa.preventDefault(),mxEvent.consume(Aa)))});
+null==Aa||Wa==Ea||Ea.contains(Wa)||Aa.contains(Wa)||Oa()};mxEvent.addListener(document,"mousedown",Ja)}Ha.preventDefault();mxEvent.consume(Ha)});ta.appendChild(Ea)}else ta.style.display="none"}function l(ma){if("TEXTAREA"==ma.nodeName)return ma.value;var ta=[],va=function(Ga){for(Ga=Ga.firstChild;null!=Ga;Ga=Ga.nextSibling)3==Ga.nodeType?ta.push(Ga.nodeValue):1==Ga.nodeType&&("BR"==Ga.nodeName?ta.push("\n"):null!=Ga.getAttribute&&null!=Ga.getAttribute("data-mention")?ta.push(Ga.getAttribute("data-mention")):
+(("DIV"==Ga.nodeName||"P"==Ga.nodeName)&&0<ta.length&&"\n"!=ta[ta.length-1]&&!/\n$/.test(ta[ta.length-1])&&ta.push("\n"),va(Ga)))};va(ma);return ta.join("").replace(/\u00a0/g," ")}function q(ma){function ta(){null!=Ca&&null!=Ca.parentNode&&Ca.parentNode.removeChild(Ca);Na=Ca=null}function va(){var Aa=window.getSelection();if(null==Aa||0==Aa.rangeCount)return null;Aa=Aa.getRangeAt(0);if(!Aa.collapsed||3!=Aa.startContainer.nodeType||!ma.contains(Aa.startContainer))return null;var Ja=Aa.startContainer.nodeValue.substring(0,
+Aa.startOffset);Ja=/(^|[\s\u00a0])@([^\s\u00a0]*)$/.exec(Ja);return null==Ja?null:{node:Aa.startContainer,start:Ja.index+Ja[1].length,end:Aa.startOffset,query:Ja[2]}}function Ga(Aa){if(null!=Na){var Ja=Na.node,Ha=Ja.nodeValue.substring(Na.end);Ja.nodeValue=Ja.nodeValue.substring(0,Na.start);Aa=O(Aa);Ha=document.createTextNode(" "+Ha);Ja.parentNode.insertBefore(Aa,Ja.nextSibling);Aa.parentNode.insertBefore(Ha,Aa.nextSibling);ua||null!=Ea||(Ea=document.createElement("div"),Ea.style.cssText="font-size:11px;opacity:0.7;padding:2px 0;",
+mxUtils.write(Ea,mxResources.get("mentionNoNotify",null,"People you mention are not notified")),ma.parentNode.insertBefore(Ea,ma.nextSibling));Ja=window.getSelection();Aa=document.createRange();Aa.setStart(Ha,1);Aa.collapse(!0);Ja.removeAllRanges();Ja.addRange(Aa);ta()}}function La(){Na=va();if(null==Na)ta();else if(ja)null!=Oa&&window.clearTimeout(Oa),Oa=window.setTimeout(function(){Oa=null;if(null!=Na){var ab=Na.query;b.getMentionCandidates(function(Wa){null!=Na&&Na.query==ab&&Ia(Wa.slice(0,6))},
+function(){},ab)}},300);else{for(var Aa=Na.query.toLowerCase(),Ja=[],Ha=0;Ha<ha.length&&6>Ja.length;Ha++){var Ua=ha[Ha];(0==Aa.length||null!=Ua.displayName&&0<=Ua.displayName.toLowerCase().indexOf(Aa)||null!=Ua.email&&0<=Ua.email.toLowerCase().indexOf(Aa))&&Ja.push(Ua)}if(la&&/^[A-Za-z0-9.!#$%&'*/=?^_`{|}~+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}$/.test(Na.query)){Ua=!1;for(Ha=0;Ha<Ja.length;Ha++)if(null!=Ja[Ha].email&&Ja[Ha].email.toLowerCase()==Aa){Ua=!0;break}Ua||Ja.push({email:Na.query})}Ia(Ja)}}function Ia(Aa){Ka=
+Aa;if(0==Ka.length)ta();else for(Pa=Math.min(Pa,Ka.length-1),null==Ca&&(Ca=document.createElement("div"),Ca.className="geCommentMentionMenu",ma.parentNode.insertBefore(Ca,ma.nextSibling)),Ca.style.left=ma.offsetLeft+"px",Ca.style.top=ma.offsetTop+ma.offsetHeight+"px",Ca.innerText="",Aa=0;Aa<Ka.length;Aa++)(function(Ja,Ha){var Ua=document.createElement("div");Ua.className="geCommentMentionRow"+(Ha==Pa?" geCommentMentionRowSelected":"");Ha=null;null==Ja.pictureUrl&&Ja.isGroup?(Ha=document.createElement("span"),
+Ha.className="geCommentMentionImg",Ha.innerHTML='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="6" cy="5.5" r="2.4"/><path d="M1.5 13.5c0-2.6 2-3.9 4.5-3.9s4.5 1.3 4.5 3.9"/><circle cx="11.3" cy="6" r="2"/><path d="M12.3 10.1c1.6.5 2.2 1.6 2.2 3.4"/></svg>'):(Ha=document.createElement("img"),Ha.className="geCommentMentionImg",Ha.src=null!=Ja.pictureUrl?Ja.pictureUrl:
+Editor.userImage);Ua.appendChild(Ha);Ha=document.createElement("span");mxUtils.write(Ha,Ja.displayName||Ja.email);Ua.appendChild(Ha);Ja.isGroup&&(Ha=document.createElement("span"),Ha.className="geCommentMentionGroupTag",mxUtils.write(Ha,mxResources.get("group")),Ua.appendChild(Ha));null!=Ja.displayName&&null!=Ja.email&&(Ha=document.createElement("span"),Ha.className="geCommentMentionMail",mxUtils.write(Ha,Ja.email),Ua.appendChild(Ha));mxEvent.addListener(Ua,"mousedown",function(ab){Ga(Ja);ab.preventDefault();
+mxEvent.consume(ab)});Ca.appendChild(Ua)})(Ka[Aa],Aa)}var Ca=null,Pa=0,Ka=[],Na=null,Oa=null,Ea=null;mxEvent.addListener(ma,"keydown",function(Aa){null==Ca||mxEvent.isConsumed(Aa)||(40==Aa.keyCode||38==Aa.keyCode?(Pa=(Pa+(40==Aa.keyCode?1:Ka.length-1))%Ka.length,La(),Aa.preventDefault(),mxEvent.consume(Aa)):13!=Aa.keyCode&&9!=Aa.keyCode||mxEvent.isControlDown(Aa)||mxEvent.isMetaDown(Aa)?27==Aa.keyCode&&(ta(),Aa.preventDefault(),mxEvent.consume(Aa)):(Ga(Ka[Pa]),Aa.preventDefault(),mxEvent.consume(Aa)))});
mxEvent.addListener(ma,"input",La);mxEvent.addListener(ma,"keyup",function(Aa){37!=Aa.keyCode&&39!=Aa.keyCode&&35!=Aa.keyCode&&36!=Aa.keyCode||La()});mxEvent.addListener(ma,"blur",function(){window.setTimeout(ta,200)});mxEvent.addListener(ma,"paste",function(Aa){Aa.preventDefault();Aa=null!=Aa.clipboardData?Aa.clipboardData.getData("text/plain"):null;null!=Aa&&0<Aa.length&&document.execCommand("insertText",!1,Aa)})}function x(ma,ta){if(aa){var va=document.createElement("div");va.contentEditable=!0;
-F(va,ma);q(va)}else va=document.createElement("textarea"),va.value=ma;va.className="geCommentEditTxtArea";va.style.minHeight=ta+"px";return va}function A(ma,ta,va,Ha){function La(){ta.removeChild(Na);ta.removeChild(Ea);Ca.style.display="block";Ia.style.display="block"}u={div:ta,comment:ma,saveCallback:va,deleteOnCancel:Ha};for(var Ia=ta.querySelector(".geCommentTxt"),Ca=ta.querySelector(".geCommentActionsList"),Pa=ta.querySelectorAll(".geCommentEditTxtArea, .geCommentEditBtns, .geCommentAnchorRowEdit"),
-Ka=0;Ka<Pa.length;Ka++)Pa[Ka].parentNode==ta&&ta.removeChild(Pa[Ka]);var Na=x(ma.content,Ia.offsetHeight);ta.insertBefore(Na,Ia);var Oa=null;Da&&null==ma.id&&null==ma.pCommentId&&(Oa=document.createElement("div"),Oa.className="geCommentAnchorRow geCommentAnchorRowEdit",f(ma,Oa,!0),ta.insertBefore(Oa,Ia));var Ea=document.createElement("div");Ea.className="geCommentEditBtns";var Aa=mxUtils.button(mxResources.get("cancel"),function(){Ha?(ta.parentNode.removeChild(ta),y()):La();u=null});Aa.className=
-"geCommentEditBtn";Ea.appendChild(Aa);var Ja=mxUtils.button(mxResources.get("save"),function(){ma.content=l(Na);F(Ia,ma.content);La();null!=Oa&&f(ma,Oa,!1);va(ma);u=null});mxEvent.addListener(Na,"keydown",mxUtils.bind(this,function(Ga){mxEvent.isConsumed(Ga)||((mxEvent.isControlDown(Ga)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ga))&&13==Ga.keyCode?(Ja.click(),mxEvent.consume(Ga)):27==Ga.keyCode&&(Aa.click(),mxEvent.consume(Ga)))}));Ja.focus();Ja.className="geCommentEditBtn gePrimaryBtn";Ea.appendChild(Ja);
+F(va,ma);q(va)}else va=document.createElement("textarea"),va.value=ma;va.className="geCommentEditTxtArea";va.style.minHeight=ta+"px";return va}function A(ma,ta,va,Ga){function La(){ta.removeChild(Na);ta.removeChild(Ea);Ca.style.display="block";Ia.style.display="block"}u={div:ta,comment:ma,saveCallback:va,deleteOnCancel:Ga};for(var Ia=ta.querySelector(".geCommentTxt"),Ca=ta.querySelector(".geCommentActionsList"),Pa=ta.querySelectorAll(".geCommentEditTxtArea, .geCommentEditBtns, .geCommentAnchorRowEdit"),
+Ka=0;Ka<Pa.length;Ka++)Pa[Ka].parentNode==ta&&ta.removeChild(Pa[Ka]);var Na=x(ma.content,Ia.offsetHeight);ta.insertBefore(Na,Ia);var Oa=null;Da&&null==ma.id&&null==ma.pCommentId&&(Oa=document.createElement("div"),Oa.className="geCommentAnchorRow geCommentAnchorRowEdit",f(ma,Oa,!0),ta.insertBefore(Oa,Ia));var Ea=document.createElement("div");Ea.className="geCommentEditBtns";var Aa=mxUtils.button(mxResources.get("cancel"),function(){Ga?(ta.parentNode.removeChild(ta),y()):La();u=null});Aa.className=
+"geCommentEditBtn";Ea.appendChild(Aa);var Ja=mxUtils.button(mxResources.get("save"),function(){ma.content=l(Na);F(Ia,ma.content);La();null!=Oa&&f(ma,Oa,!1);va(ma);u=null});mxEvent.addListener(Na,"keydown",mxUtils.bind(this,function(Ha){mxEvent.isConsumed(Ha)||((mxEvent.isControlDown(Ha)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ha))&&13==Ha.keyCode?(Ja.click(),mxEvent.consume(Ha)):27==Ha.keyCode&&(Aa.click(),mxEvent.consume(Ha)))}));Ja.focus();Ja.className="geCommentEditBtn gePrimaryBtn";Ea.appendChild(Ja);
ta.insertBefore(Ea,Ia);Ca.style.display="none";Ia.style.display="none";Na.focus()}function E(ma,ta){ta.innerText="";ma=new Date(ma.modifiedDate);var va=b.timeSince(ma);null==va&&(va=mxResources.get("lessThanAMinute"));mxUtils.write(ta,mxResources.get("timeAgo",[va],"{1} ago"));ta.setAttribute("title",ma.toLocaleDateString()+" "+ma.toLocaleTimeString())}function K(ma){var ta=document.createElement("img");ta.className="geCommentBusyImg";ta.src=IMAGE_PATH+"/spin.gif";ma.appendChild(ta);ma.busyImg=ta}
-function Q(ma){ma.style.border="1px solid red";ma.busyImg.parentNode==ma&&ma.removeChild(ma.busyImg)}function V(ma){ma.style.border="";ma.busyImg.parentNode==ma&&ma.removeChild(ma.busyImg)}function J(ma,ta,va,Ha,La){function Ia(Ja,Ga,Ua){var ab=document.createElement("li");ab.className="geCommentAction";var Wa=document.createElement("a");Wa.className="geCommentActionLnk";mxUtils.write(Wa,Ja);ab.appendChild(Wa);mxEvent.addListener(Wa,"click",function(cb){Ga(cb,ma);cb.preventDefault();mxEvent.consume(cb)});
-Aa.appendChild(ab);Ua&&(ab.style.display="none")}function Ca(){function Ja(ab){Ga.push(Ua);if(null!=ab.replies)for(var Wa=0;Wa<ab.replies.length;Wa++)Ua=Ua.nextSibling,Ja(ab.replies[Wa])}var Ga=[],Ua=Ka;Ja(ma);return{pdiv:Ua,replies:Ga}}function Pa(Ja,Ga,Ua,ab,Wa){function cb(){K(Ra);ma.addReply(Fa,function($a){Fa.id=$a;ma.replies.push(Fa);V(Ra);Ua&&Ua();b.commentsUpdated()},function($a){hb();Q(Ra);b.handleError($a,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ab,Wa)}function hb(){A(Fa,
-Ra,function($a){cb()},!0)}var wb=Ca().pdiv,Fa=b.newComment(Ja,b.getCurrentUser());Fa.pCommentId=ma.id;null==ma.replies&&(ma.replies=[]);var Ra=J(Fa,ma.replies,wb,Ha+1);Ga?hb():cb()}if(La||!ma.isResolved){W.style.display="none";var Ka=document.createElement("div");Ka.className="geCommentContainer";Ka.setAttribute("data-commentId",ma.id);Ka.style.marginLeft=20*Ha+5+"px";ma.isResolved&&(H.style.opacity="0.7");var Na=document.createElement("div");Na.className="geCommentHeader";var Oa=document.createElement("img");
+function Q(ma){ma.style.border="1px solid red";ma.busyImg.parentNode==ma&&ma.removeChild(ma.busyImg)}function V(ma){ma.style.border="";ma.busyImg.parentNode==ma&&ma.removeChild(ma.busyImg)}function J(ma,ta,va,Ga,La){function Ia(Ja,Ha,Ua){var ab=document.createElement("li");ab.className="geCommentAction";var Wa=document.createElement("a");Wa.className="geCommentActionLnk";mxUtils.write(Wa,Ja);ab.appendChild(Wa);mxEvent.addListener(Wa,"click",function(cb){Ha(cb,ma);cb.preventDefault();mxEvent.consume(cb)});
+Aa.appendChild(ab);Ua&&(ab.style.display="none")}function Ca(){function Ja(ab){Ha.push(Ua);if(null!=ab.replies)for(var Wa=0;Wa<ab.replies.length;Wa++)Ua=Ua.nextSibling,Ja(ab.replies[Wa])}var Ha=[],Ua=Ka;Ja(ma);return{pdiv:Ua,replies:Ha}}function Pa(Ja,Ha,Ua,ab,Wa){function cb(){K(Ra);ma.addReply(Fa,function($a){Fa.id=$a;ma.replies.push(Fa);V(Ra);Ua&&Ua();b.commentsUpdated()},function($a){hb();Q(Ra);b.handleError($a,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ab,Wa)}function hb(){A(Fa,
+Ra,function($a){cb()},!0)}var wb=Ca().pdiv,Fa=b.newComment(Ja,b.getCurrentUser());Fa.pCommentId=ma.id;null==ma.replies&&(ma.replies=[]);var Ra=J(Fa,ma.replies,wb,Ga+1);Ha?hb():cb()}if(La||!ma.isResolved){W.style.display="none";var Ka=document.createElement("div");Ka.className="geCommentContainer";Ka.setAttribute("data-commentId",ma.id);Ka.style.marginLeft=20*Ga+5+"px";ma.isResolved&&(H.style.opacity="0.7");var Na=document.createElement("div");Na.className="geCommentHeader";var Oa=document.createElement("img");
Oa.className="geCommentUserImg";Oa.src=null!=ma.user&&null!=ma.user.pictureUrl?ma.user.pictureUrl:Editor.userImage;Na.appendChild(Oa);Oa=document.createElement("div");Oa.className="geCommentHeaderTxt";Na.appendChild(Oa);var Ea=document.createElement("div");Ea.className="geCommentUsername";mxUtils.write(Ea,null!=ma.user?ma.user.displayName:mxResources.get("unknownUser"));Oa.appendChild(Ea);Ea=document.createElement("div");Ea.className="geCommentDate";Ea.setAttribute("data-commentId",ma.id);E(ma,Ea);
-Oa.appendChild(Ea);Ka.appendChild(Na);Da&&0==Ha&&null!=ma.getAnchorCellId&&null!=ma.anchor&&(null!=ma.getAnchorCellIds()&&Ka.setAttribute("data-anchor-cell",ma.getAnchorCellIds().join(",")),null!=ma.id&&(Na=document.createElement("div"),Na.className="geCommentAnchorRow",f(ma,Na,!1),Ka.appendChild(Na)));Na=document.createElement("div");Na.className="geCommentTxt";F(Na,ma.content);Ka.appendChild(Na);ma.isLocked&&(Ka.style.opacity="0.5");Na=document.createElement("div");Na.className="geCommentActions";
-var Aa=document.createElement("ul");Aa.className="geCommentActionsList";Na.appendChild(Aa);ia||ma.isLocked||0!=Ha&&!Y||Ia(mxResources.get("reply"),function(){Pa("",!0)},ma.isResolved);Oa=b.getCurrentUser();null==Oa||null==ma.user||Oa.id!=ma.user.id||ia||ma.isLocked||(Ia(mxResources.get("edit"),function(){function Ja(){A(ma,Ka,function(){K(Ka);ma.editComment(ma.content,function(){V(Ka);b.commentsUpdated()},function(Ga){Q(Ka);Ja();b.handleError(Ga,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}
-Ja()},ma.isResolved),Ia(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){K(Ka);ma.deleteComment(function(Ja){if(!0===Ja){Ja=Ka.querySelector(".geCommentTxt");Ja.innerText="";mxUtils.write(Ja,mxResources.get("msgDeleted"));var Ga=Ka.querySelectorAll(".geCommentAction");for(Ja=0;Ja<Ga.length;Ja++)Ga[Ja].parentNode.removeChild(Ga[Ja]);V(Ka);Ka.style.opacity="0.5"}else{Ga=Ca(ma).replies;for(Ja=0;Ja<Ga.length;Ja++)T.removeChild(Ga[Ja]);for(Ja=0;Ja<ta.length;Ja++)if(ta[Ja]==
-ma){ta.splice(Ja,1);break}W.style.display=0==T.getElementsByTagName("div").length?"block":"none"}b.commentsUpdated()},function(Ja){Q(Ka);b.handleError(Ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ma.isResolved));ia||ma.isLocked||0!=Ha||Ia(ma.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Ja){function Ga(){var Ua=Ja.target;Ua.innerText="";ma.isResolved=!ma.isResolved;mxUtils.write(Ua,ma.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));
-for(var ab=ma.isResolved?"none":"",Wa=Ca(ma).replies,cb="light-dark("+(ma.isResolved?"ghostWhite":"white")+", transparent)",hb=0;hb<Wa.length;hb++){Wa[hb].style.backgroundColor=cb;for(var wb=Wa[hb].querySelectorAll(".geCommentAction"),Fa=0;Fa<wb.length;Fa++)wb[Fa]!=Ua.parentNode&&(wb[Fa].style.display=ab);la||(Wa[hb].style.display="none")}y()}ma.isResolved?Pa(mxResources.get("reOpened")+": ",!0,Ga,!1,!0):Pa(mxResources.get("markedAsResolved"),!1,Ga,!0)});Ka.appendChild(Na);null!=va?T.insertBefore(Ka,
-va.nextSibling):T.appendChild(Ka);for(va=0;null!=ma.replies&&va<ma.replies.length;va++)Na=ma.replies[va],Na.isResolved=ma.isResolved,J(Na,ma.replies,null,Ha+1,La);null!=u&&(u.comment.id==ma.id?(La=ma.content,ma.content=u.comment.content,A(ma,Ka,u.saveCallback,u.deleteOnCancel),ma.content=La):null==u.comment.id&&u.comment.pCommentId==ma.id&&(T.appendChild(u.div),A(u.comment,u.div,u.saveCallback,u.deleteOnCancel)));return Ka}}var ia=!b.canComment(),Y=b.canReplyToReplies(),aa=b.mentionsSupported(),ja=
-aa&&b.mentionsLiveSearch(),ka=aa&&b.freeMentionsSupported(),ua=!aa||b.mentionNotificationsSupported(),Da=b.anchoredCommentsSupported(),ha=[],k=null,u=null,H=document.createElement("div");H.className="geCommentsWin";var P=EditorUi.compactUi?"26px":"30px",T=document.createElement("div");T.className="geCommentsList";T.style.bottom=parseInt(P)+7+"px";H.appendChild(T);var W=document.createElement("span");W.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(W,mxResources.get("noCommentsFound"));
-var fa=document.createElement("div");fa.className="geToolbarContainer geCommentsToolbar";fa.style.height=P;fa.style.padding="3px 4px 4px 4px";P=document.createElement("a");P.className="geButton";aa&&!ja&&b.getMentionCandidates(function(ma){ha=ma;ma=T.querySelectorAll(".geCommentMention[data-email]");for(var ta=0;ta<ma.length;ta++)ma[ta].innerText="",mxUtils.write(ma[ta],"@"+C(ma[ta].getAttribute("data-email")))},function(){});var X=mxUtils.bind(this,function(ma){function ta(){A(va,Ha,function(La){K(Ha);
-b.addComment(La,function(Ia){La.id=Ia;ca.push(La);V(Ha);b.commentsUpdated()},function(Ia){Q(Ha);ta();b.handleError(Ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}if(!ia){var va=b.newComment("",b.getCurrentUser());va.anchor=null!=ma?ma:null;var Ha=J(va,ca,null,0);ta()}});this.startNewComment=X;if(!ia){var ea=P.cloneNode();ea.style.backgroundImage="url("+Editor.plusImage+")";ea.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(ea,"click",function(ma){X();
-ma.preventDefault();mxEvent.consume(ma)});fa.appendChild(ea)}var oa=P.cloneNode();oa.style.backgroundImage="url("+Editor.checkImage+")";oa.setAttribute("title",mxResources.get("showResolved"));var la=!1;mxEvent.addListener(oa,"click",function(ma){(la=!la)?oa.classList.add("geActiveItem"):oa.classList.remove("geActiveItem");qa();ma.preventDefault();mxEvent.consume(ma)});fa.appendChild(oa);b.commentsRefreshNeeded()&&(ea=P.cloneNode(),ea.style.backgroundImage="url("+Editor.refreshImage+")",ea.setAttribute("title",
-mxResources.get("refresh")),mxEvent.addListener(ea,"click",function(ma){qa();ma.preventDefault();mxEvent.consume(ma)}),fa.appendChild(ea));b.commentsSaveNeeded()&&(P=P.cloneNode(),P.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',P.setAttribute("title",mxResources.get("save")),P.className="geButton geAdaptiveAsset",mxEvent.addListener(P,"click",function(ma){n();ma.preventDefault();mxEvent.consume(ma)}),fa.appendChild(P));H.appendChild(fa);var ca=[],sa=function(ma){if(null!=
-k){for(var ta=T.childNodes,va=0;va<ta.length;va++)if(null!=ta[va].getAttribute&&null!=ta[va].getAttribute("data-anchor-cell")&&0<=mxUtils.indexOf(ta[va].getAttribute("data-anchor-cell").split(","),k)){T.scrollTop=ta[va].offsetTop-T.offsetTop;k=null;break}ma&&(k=null)}};this.scrollToCell=function(ma){k=ma;sa(!1)};var xa=mxUtils.bind(this,function(ma){function ta(Ha){if(null!=Ha){Ha.sort(function(Ia,Ca){return new Date(Ia.modifiedDate)-new Date(Ca.modifiedDate)});for(var La=0;La<Ha.length;La++)ta(Ha[La].replies)}}
-ma.sort(function(Ha,La){return new Date(Ha.modifiedDate)-new Date(La.modifiedDate)});if(null!=u){var va=u.div.querySelector(".geCommentEditTxtArea");null!=va&&(u.comment.content=l(va))}va=T.scrollTop;T.innerText="";T.appendChild(W);W.style.display="block";ca=ma;for(ma=0;ma<ca.length;ma++)ta(ca[ma].replies),J(ca[ma],ca,null,0,la);null!=u&&null==u.comment.id&&null==u.comment.pCommentId&&(T.appendChild(u.div),A(u.comment,u.div,u.saveCallback,u.deleteOnCancel));T.scrollTop=va;sa(!0)}),qa=mxUtils.bind(this,
-function(){this.hasError=!1;if(null!=u)try{u.div=u.div.cloneNode(!0);var ma=u.div.querySelector(".geCommentEditTxtArea"),ta=u.div.querySelector(".geCommentEditBtns");u.comment.content=l(ma);ma.parentNode.removeChild(ma);ta.parentNode.removeChild(ta)}catch(va){b.handleError(va)}Y=b.canReplyToReplies();b.commentsSupported()?(null!=b.getCommentCacheTarget().commentCache?null==u&&xa(b.getCommentCacheTarget().commentCache):T.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+
-'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>",b.refreshCommentCache(mxUtils.bind(this,function(va){null!=va&&null!=u&&xa(va)}),mxUtils.bind(this,function(va){null==b.getCommentCacheTarget().commentCache&&(T.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(va&&va.message?": "+va.message:"")),this.hasError=!0)}))):T.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))}),Ba=mxUtils.bind(this,function(){if(null==u){var ma=b.getCommentCacheTarget().commentCache;
-null!=ma&&(this.hasError=!1,xa(ma))}});b.addListener("commentsChanged",Ba);qa();this.refreshComments=qa;fa=mxUtils.bind(this,function(){function ma(Ia){var Ca=va[Ia.id];if(null!=Ca)for(E(Ia,Ca),Ca=0;null!=Ia.replies&&Ca<Ia.replies.length;Ca++)ma(Ia.replies[Ca])}if(this.window.isVisible()){for(var ta=T.querySelectorAll(".geCommentDate"),va={},Ha=0;Ha<ta.length;Ha++){var La=ta[Ha];va[La.getAttribute("data-commentId")]=La}for(Ha=0;Ha<ca.length;Ha++)ma(ca[Ha])}});setInterval(fa,6E4);this.refreshCommentsTime=
+Oa.appendChild(Ea);Ka.appendChild(Na);Da&&0==Ga&&null!=ma.getAnchorCellId&&null!=ma.anchor&&(null!=ma.getAnchorCellIds()&&Ka.setAttribute("data-anchor-cell",ma.getAnchorCellIds().join(",")),null!=ma.id&&(Na=document.createElement("div"),Na.className="geCommentAnchorRow",f(ma,Na,!1),Ka.appendChild(Na)));Na=document.createElement("div");Na.className="geCommentTxt";F(Na,ma.content);Ka.appendChild(Na);ma.isLocked&&(Ka.style.opacity="0.5");Na=document.createElement("div");Na.className="geCommentActions";
+var Aa=document.createElement("ul");Aa.className="geCommentActionsList";Na.appendChild(Aa);ia||ma.isLocked||0!=Ga&&!Y||Ia(mxResources.get("reply"),function(){Pa("",!0)},ma.isResolved);Oa=b.getCurrentUser();null==Oa||null==ma.user||Oa.id!=ma.user.id||ia||ma.isLocked||(Ia(mxResources.get("edit"),function(){function Ja(){A(ma,Ka,function(){K(Ka);ma.editComment(ma.content,function(){V(Ka);b.commentsUpdated()},function(Ha){Q(Ka);Ja();b.handleError(Ha,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}
+Ja()},ma.isResolved),Ia(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){K(Ka);ma.deleteComment(function(Ja){if(!0===Ja){Ja=Ka.querySelector(".geCommentTxt");Ja.innerText="";mxUtils.write(Ja,mxResources.get("msgDeleted"));var Ha=Ka.querySelectorAll(".geCommentAction");for(Ja=0;Ja<Ha.length;Ja++)Ha[Ja].parentNode.removeChild(Ha[Ja]);V(Ka);Ka.style.opacity="0.5"}else{Ha=Ca(ma).replies;for(Ja=0;Ja<Ha.length;Ja++)U.removeChild(Ha[Ja]);for(Ja=0;Ja<ta.length;Ja++)if(ta[Ja]==
+ma){ta.splice(Ja,1);break}W.style.display=0==U.getElementsByTagName("div").length?"block":"none"}b.commentsUpdated()},function(Ja){Q(Ka);b.handleError(Ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ma.isResolved));ia||ma.isLocked||0!=Ga||Ia(ma.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Ja){function Ha(){var Ua=Ja.target;Ua.innerText="";ma.isResolved=!ma.isResolved;mxUtils.write(Ua,ma.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));
+for(var ab=ma.isResolved?"none":"",Wa=Ca(ma).replies,cb="light-dark("+(ma.isResolved?"ghostWhite":"white")+", transparent)",hb=0;hb<Wa.length;hb++){Wa[hb].style.backgroundColor=cb;for(var wb=Wa[hb].querySelectorAll(".geCommentAction"),Fa=0;Fa<wb.length;Fa++)wb[Fa]!=Ua.parentNode&&(wb[Fa].style.display=ab);ka||(Wa[hb].style.display="none")}y()}ma.isResolved?Pa(mxResources.get("reOpened")+": ",!0,Ha,!1,!0):Pa(mxResources.get("markedAsResolved"),!1,Ha,!0)});Ka.appendChild(Na);null!=va?U.insertBefore(Ka,
+va.nextSibling):U.appendChild(Ka);for(va=0;null!=ma.replies&&va<ma.replies.length;va++)Na=ma.replies[va],Na.isResolved=ma.isResolved,J(Na,ma.replies,null,Ga+1,La);null!=u&&(u.comment.id==ma.id?(La=ma.content,ma.content=u.comment.content,A(ma,Ka,u.saveCallback,u.deleteOnCancel),ma.content=La):null==u.comment.id&&u.comment.pCommentId==ma.id&&(U.appendChild(u.div),A(u.comment,u.div,u.saveCallback,u.deleteOnCancel)));return Ka}}var ia=!b.canComment(),Y=b.canReplyToReplies(),aa=b.mentionsSupported(),ja=
+aa&&b.mentionsLiveSearch(),la=aa&&b.freeMentionsSupported(),ua=!aa||b.mentionNotificationsSupported(),Da=b.anchoredCommentsSupported(),ha=[],k=null,u=null,H=document.createElement("div");H.className="geCommentsWin";var P=EditorUi.compactUi?"26px":"30px",U=document.createElement("div");U.className="geCommentsList";U.style.bottom=parseInt(P)+7+"px";H.appendChild(U);var W=document.createElement("span");W.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(W,mxResources.get("noCommentsFound"));
+var fa=document.createElement("div");fa.className="geToolbarContainer geCommentsToolbar";fa.style.height=P;fa.style.padding="3px 4px 4px 4px";P=document.createElement("a");P.className="geButton";aa&&!ja&&b.getMentionCandidates(function(ma){ha=ma;ma=U.querySelectorAll(".geCommentMention[data-email]");for(var ta=0;ta<ma.length;ta++)ma[ta].innerText="",mxUtils.write(ma[ta],"@"+C(ma[ta].getAttribute("data-email")))},function(){});var X=mxUtils.bind(this,function(ma){function ta(){A(va,Ga,function(La){K(Ga);
+b.addComment(La,function(Ia){La.id=Ia;ba.push(La);V(Ga);b.commentsUpdated()},function(Ia){Q(Ga);ta();b.handleError(Ia,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}if(!ia){var va=b.newComment("",b.getCurrentUser());va.anchor=null!=ma?ma:null;var Ga=J(va,ba,null,0);ta()}});this.startNewComment=X;if(!ia){var ea=P.cloneNode();ea.style.backgroundImage="url("+Editor.plusImage+")";ea.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(ea,"click",function(ma){X();
+ma.preventDefault();mxEvent.consume(ma)});fa.appendChild(ea)}var oa=P.cloneNode();oa.style.backgroundImage="url("+Editor.checkImage+")";oa.setAttribute("title",mxResources.get("showResolved"));var ka=!1;mxEvent.addListener(oa,"click",function(ma){(ka=!ka)?oa.classList.add("geActiveItem"):oa.classList.remove("geActiveItem");qa();ma.preventDefault();mxEvent.consume(ma)});fa.appendChild(oa);b.commentsRefreshNeeded()&&(ea=P.cloneNode(),ea.style.backgroundImage="url("+Editor.refreshImage+")",ea.setAttribute("title",
+mxResources.get("refresh")),mxEvent.addListener(ea,"click",function(ma){qa();ma.preventDefault();mxEvent.consume(ma)}),fa.appendChild(ea));b.commentsSaveNeeded()&&(P=P.cloneNode(),P.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',P.setAttribute("title",mxResources.get("save")),P.className="geButton geAdaptiveAsset",mxEvent.addListener(P,"click",function(ma){n();ma.preventDefault();mxEvent.consume(ma)}),fa.appendChild(P));H.appendChild(fa);var ba=[],sa=function(ma){if(null!=
+k){for(var ta=U.childNodes,va=0;va<ta.length;va++)if(null!=ta[va].getAttribute&&null!=ta[va].getAttribute("data-anchor-cell")&&0<=mxUtils.indexOf(ta[va].getAttribute("data-anchor-cell").split(","),k)){U.scrollTop=ta[va].offsetTop-U.offsetTop;k=null;break}ma&&(k=null)}};this.scrollToCell=function(ma){k=ma;sa(!1)};var xa=mxUtils.bind(this,function(ma){function ta(Ga){if(null!=Ga){Ga.sort(function(Ia,Ca){return new Date(Ia.modifiedDate)-new Date(Ca.modifiedDate)});for(var La=0;La<Ga.length;La++)ta(Ga[La].replies)}}
+ma.sort(function(Ga,La){return new Date(Ga.modifiedDate)-new Date(La.modifiedDate)});if(null!=u){var va=u.div.querySelector(".geCommentEditTxtArea");null!=va&&(u.comment.content=l(va))}va=U.scrollTop;U.innerText="";U.appendChild(W);W.style.display="block";ba=ma;for(ma=0;ma<ba.length;ma++)ta(ba[ma].replies),J(ba[ma],ba,null,0,ka);null!=u&&null==u.comment.id&&null==u.comment.pCommentId&&(U.appendChild(u.div),A(u.comment,u.div,u.saveCallback,u.deleteOnCancel));U.scrollTop=va;sa(!0)}),qa=mxUtils.bind(this,
+function(){this.hasError=!1;if(null!=u)try{u.div=u.div.cloneNode(!0);var ma=u.div.querySelector(".geCommentEditTxtArea"),ta=u.div.querySelector(".geCommentEditBtns");u.comment.content=l(ma);ma.parentNode.removeChild(ma);ta.parentNode.removeChild(ta)}catch(va){b.handleError(va)}Y=b.canReplyToReplies();b.commentsSupported()?(null!=b.getCommentCacheTarget().commentCache?null==u&&xa(b.getCommentCacheTarget().commentCache):U.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+
+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>",b.refreshCommentCache(mxUtils.bind(this,function(va){null!=va&&null!=u&&xa(va)}),mxUtils.bind(this,function(va){null==b.getCommentCacheTarget().commentCache&&(U.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(va&&va.message?": "+va.message:"")),this.hasError=!0)}))):U.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))}),Ba=mxUtils.bind(this,function(){if(null==u){var ma=b.getCommentCacheTarget().commentCache;
+null!=ma&&(this.hasError=!1,xa(ma))}});b.addListener("commentsChanged",Ba);qa();this.refreshComments=qa;fa=mxUtils.bind(this,function(){function ma(Ia){var Ca=va[Ia.id];if(null!=Ca)for(E(Ia,Ca),Ca=0;null!=Ia.replies&&Ca<Ia.replies.length;Ca++)ma(Ia.replies[Ca])}if(this.window.isVisible()){for(var ta=U.querySelectorAll(".geCommentDate"),va={},Ga=0;Ga<ta.length;Ga++){var La=ta[Ga];va[La.getAttribute("data-commentId")]=La}for(Ga=0;Ga<ba.length;Ga++)ma(ba[Ga])}});setInterval(fa,6E4);this.refreshCommentsTime=
fa;this.window=new mxWindow(mxResources.get("comments"),H,d,m,p,t,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0,function(){b.removeListener(Ba)})},ConfirmDialog=function(b,d,m,p,t,n,y,C,O,F,N){var R=document.createElement("div");
R.style.textAlign="center";N=null!=N?N:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=N+"px";c.style.lineHeight="1.2em";mxUtils.write(c,d);R.appendChild(c);null!=F&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",F),c.appendChild(d),R.appendChild(c));F=document.createElement("div");F.style.textAlign="center";F.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type",
"checkbox");n=mxUtils.button(n||mxResources.get("cancel"),function(){b.hideDialog();null!=p&&p(f.checked)});n.className="geBtn";null!=C&&(n.innerHTML=C+"<br>"+n.innerHTML,n.style.display="inline-block",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");b.editor.cancelFirst&&F.appendChild(n);var l=mxUtils.button(t||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});F.appendChild(l);null!=y?(l.innerHTML=y+"<br>"+l.innerHTML+"<br>",l.style.display=
@@ -5012,39 +5015,40 @@ EditorUi.prototype.createPageMenu=function(b,d){return mxUtils.bind(this,functio
m,p,mxResources.get("move")),this.menus.addMenuItems(m,["removePage","renamePage"],p))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(p,t,n,y,C){t=null!=t?t:!1;null==n&&(n=this.getFoldableCells(this.getSelectionCells(),p));this.stopEditing();this.model.beginUpdate();try{for(var O=n.slice(),F=0;F<n.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(n[F]),"treeFolding","0")&&this.foldTreeCell(p,n[F]);n=O;n=b.apply(this,arguments)}finally{this.model.endUpdate()}return n};Graph.prototype.foldTreeCell=function(p,t){this.model.beginUpdate();try{var n=
[];this.traverse(t,!0,mxUtils.bind(this,function(C,O){var F=null!=O&&this.isTreeEdge(O);F&&n.push(O);C==t||null!=O&&!F||n.push(C);return(null==O||F)&&(C==t||!this.model.isCollapsed(C))}));this.model.setCollapsed(t,p);for(var y=0;y<n.length;y++)this.model.setVisible(n[y],!p)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(p){return!this.isEdgeIgnored(p)};Graph.prototype.getTreeEdges=function(p,t,n,y,C,O){return this.model.filterCells(this.getEdges(p,t,n,y,C,O),mxUtils.bind(this,
function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(p,t){return this.getTreeEdges(p,t,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(p,t){return this.getTreeEdges(p,t,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function p(k){return K.isVertex(k)&&n(k)}function t(k){var u=!1;null!=k&&(u="1"==
-E.getCurrentCellStyle(k).treeMoving);return u}function n(k){var u=!1;null!=k&&(k=K.getParent(k),u=E.view.getState(k),u="tree"==(null!=u?u.style:E.getCellStyle(k)).containerType);return u}function y(k){for(;null!=k&&!n(k);)k=K.getParent(k);return null!=k?K.getParent(k):null}function C(k){var u=!1;null!=k&&(k=K.getParent(k),u=E.view.getState(k),E.view.getState(k),u=null!=(null!=u?u.style:E.getCellStyle(k)).childLayout);return u}function O(k,u){function H(la,ca){null!=la&&(T.cut.get(la)||(T.cut.put(la,
-!0),T.cells.push(la)),ca&&!W.get(la)&&(W.put(la,!0),fa.push(la)))}function P(la){if(!T.deleted.get(la)){T.deleted.put(la,!0);T.cells.push(la);la=E.getAllEdges([la]);for(var ca=0;ca<la.length;ca++)H(la[ca],!0)}}for(var T={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},W=new mxDictionary,fa=[],X=0;X<k.length;X++){var ea=k[X];K.isEdge(ea)?H(ea,!1):K.isVertex(ea)&&null!=y(ea)?P(ea):null!=ea&&T.cells.push(ea)}for(;0<fa.length;)if(k=K.getTerminal(fa.shift(),!1),null!=k&&!T.deleted.get(k)&&
-K.isVertex(k)&&(X=y(k),null!=X&&(null==u||!u.get(X)))){X=E.getIncomingTreeEdges(k);ea=!0;for(var oa=0;oa<X.length;oa++)if(!T.cut.get(X[oa])){ea=!1;break}ea&&(T.cascaded.push(k),P(k))}return T}function F(k){k=E.view.getState(k);if(null!=k){var u=E.getIncomingTreeEdges(k.cell);if(0<u.length&&(u=E.view.getState(u[0]),null!=u&&(u=u.absolutePoints,null!=u&&0<u.length&&(u=u[u.length-1],null!=u)))){if(u.y==k.y&&Math.abs(u.x-k.getCenterX())<k.width/2)return mxConstants.DIRECTION_SOUTH;if(u.y==k.y+k.height&&
-Math.abs(u.x-k.getCenterX())<k.width/2)return mxConstants.DIRECTION_NORTH;if(u.x>k.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function N(k,u,H){if(null!=H){for(var P=E.getCurrentCellStyle(u),T=["treeFolding","treeMoving","newEdgeStyle"],W=0;W<T.length;W++)null!=P[T[W]]&&(null==H.style||0>H.style.indexOf(T[W]+"="))&&(H.style=mxUtils.setStyle(H.style,T[W],P[T[W]]));null!=H.geometry&&null!=u.geometry&&(H.geometry.x=u.geometry.x,H.geometry.y=u.geometry.y);E.model.getTerminal(k[0],
-!1)==k[1]&&E.model.setTerminal(k[0],H,!1);k[1]=H}return k}function R(k,u,H){u=null!=u?u:!0;E.model.beginUpdate();try{var P=E.model.getParent(k),T=E.getIncomingTreeEdges(k),W=N(E.cloneCells([T[0],k]),k,H);E.model.setTerminal(W[0],E.model.getTerminal(T[0],!0),!0);var fa=F(k),X=P.geometry;fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH?W[1].geometry.x+=u?k.geometry.width+10:-W[1].geometry.width-10:W[1].geometry.y+=u?k.geometry.height+10:-W[1].geometry.height-10;E.view.currentRoot!=P&&
-(W[1].geometry.x-=X.x,W[1].geometry.y-=X.y);var ea=E.view.getState(k),oa=E.view.scale;if(null!=ea){var la=mxRectangle.fromRectangle(ea);fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH?la.x+=(u?k.geometry.width+10:-W[1].geometry.width-10)*oa:la.y+=(u?k.geometry.height+10:-W[1].geometry.height-10)*oa;var ca=E.getOutgoingTreeEdges(E.model.getTerminal(T[0],!0));if(null!=ca){var sa=fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH;for(X=T=H=0;X<ca.length;X++){var xa=E.model.getTerminal(ca[X],
-!1);if(fa==F(xa)){var qa=E.view.getState(xa);xa!=k&&null!=qa&&(sa&&u!=qa.getCenterX()<ea.getCenterX()||!sa&&u!=qa.getCenterY()<ea.getCenterY())&&mxUtils.intersects(la,qa)&&(H=10+Math.max(H,(Math.min(la.x+la.width,qa.x+qa.width)-Math.max(la.x,qa.x))/oa),T=10+Math.max(T,(Math.min(la.y+la.height,qa.y+qa.height)-Math.max(la.y,qa.y))/oa))}}sa?T=0:H=0;for(X=0;X<ca.length;X++)if(xa=E.model.getTerminal(ca[X],!1),fa==F(xa)&&(qa=E.view.getState(xa),xa!=k&&null!=qa&&(sa&&u!=qa.getCenterX()<ea.getCenterX()||
-!sa&&u!=qa.getCenterY()<ea.getCenterY()))){var Ba=[];E.traverse(qa.cell,!0,function(ma,ta){var va=null!=ta&&E.isTreeEdge(ta);va&&Ba.push(ta);(null==ta||va)&&Ba.push(ma);return null==ta||va});E.moveCells(Ba,(u?1:-1)*H,(u?1:-1)*T)}}}return E.addCells(W,P)}finally{E.model.endUpdate()}}function c(k,u){E.model.beginUpdate();try{var H=F(k),P=E.getIncomingTreeEdges(k),T=N(E.cloneCells([P[0],k]),k,u);E.model.setTerminal(P[0],T[1],!1);E.model.setTerminal(T[0],T[1],!0);E.model.setTerminal(T[0],k,!1);var W=
-E.model.getParent(k),fa=W.geometry,X=[];E.view.currentRoot!=W&&(T[1].geometry.x-=fa.x,T[1].geometry.y-=fa.y);E.traverse(k,!0,function(la,ca){var sa=null!=ca&&E.isTreeEdge(ca);sa&&X.push(ca);(null==ca||sa)&&X.push(la);return null==ca||sa});var ea=k.geometry.width+40,oa=k.geometry.height+40;H==mxConstants.DIRECTION_SOUTH?ea=0:H==mxConstants.DIRECTION_NORTH?(ea=0,oa=-oa):H==mxConstants.DIRECTION_WEST?(ea=-ea,oa=0):H==mxConstants.DIRECTION_EAST&&(oa=0);E.moveCells(X,ea,oa);return E.addCells(T,W)}finally{E.model.endUpdate()}}
-function f(k,u,H){E.model.beginUpdate();try{var P=E.model.getParent(k),T=E.getIncomingTreeEdges(k),W=F(k);0==T.length&&(T=[E.createEdge(P,null,"",null,null,E.createCurrentEdgeStyle())],W=u);var fa=N(E.cloneCells([T[0],k]),k,H);E.model.setTerminal(fa[0],k,!0);null==E.model.getTerminal(fa[0],!1)&&(E.model.setTerminal(fa[0],fa[1],!1),E.applyNewEdgeStyle(fa[1],[fa[0]],W));T=E.getOutgoingTreeEdges(k);var X=P.geometry;u=[];E.view.currentRoot==P&&(X=new mxRectangle);for(H=0;H<T.length;H++){var ea=E.model.getTerminal(T[H],
-!1);null!=ea&&u.push(ea)}var oa=E.view.getBounds(u),la=E.view.translate,ca=E.view.scale;W==mxConstants.DIRECTION_SOUTH?(fa[1].geometry.x=null==oa?k.geometry.x+(k.geometry.width-fa[1].geometry.width)/2:(oa.x+oa.width)/ca-la.x-X.x+10,fa[1].geometry.y+=k.geometry.height-X.y+40):W==mxConstants.DIRECTION_NORTH?(fa[1].geometry.x=null==oa?k.geometry.x+(k.geometry.width-fa[1].geometry.width)/2:(oa.x+oa.width)/ca-la.x+-X.x+10,fa[1].geometry.y-=fa[1].geometry.height+X.y+40):(fa[1].geometry.x=W==mxConstants.DIRECTION_WEST?
-fa[1].geometry.x-(fa[1].geometry.width+X.x+40):fa[1].geometry.x+(k.geometry.width-X.x+40),fa[1].geometry.y=null==oa?k.geometry.y+(k.geometry.height-fa[1].geometry.height)/2:(oa.y+oa.height)/ca-la.y+-X.y+10);return E.addCells(fa,P)}finally{E.model.endUpdate()}}function l(k,u,H){k=E.getOutgoingTreeEdges(k);H=E.view.getState(H);var P=[];if(null!=H&&null!=k){for(var T=0;T<k.length;T++){var W=E.view.getState(E.model.getTerminal(k[T],!1));null!=W&&(!u&&Math.min(W.x+W.width,H.x+H.width)>=Math.max(W.x,H.x)||
+E.getCurrentCellStyle(k).treeMoving);return u}function n(k){var u=!1;null!=k&&(k=K.getParent(k),u=E.view.getState(k),u="tree"==(null!=u?u.style:E.getCellStyle(k)).containerType);return u}function y(k){for(;null!=k&&!n(k);)k=K.getParent(k);return null!=k?K.getParent(k):null}function C(k){var u=!1;null!=k&&(k=K.getParent(k),u=E.view.getState(k),E.view.getState(k),u=null!=(null!=u?u.style:E.getCellStyle(k)).childLayout);return u}function O(k,u){function H(ka,ba){null!=ka&&(U.cut.get(ka)||(U.cut.put(ka,
+!0),U.cells.push(ka)),ba&&!W.get(ka)&&(W.put(ka,!0),fa.push(ka)))}function P(ka){if(!U.deleted.get(ka)){U.deleted.put(ka,!0);U.cells.push(ka);ka=E.getAllEdges([ka]);for(var ba=0;ba<ka.length;ba++)H(ka[ba],!0)}}for(var U={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},W=new mxDictionary,fa=[],X=0;X<k.length;X++){var ea=k[X];K.isEdge(ea)?H(ea,!1):K.isVertex(ea)&&null!=y(ea)?P(ea):null!=ea&&U.cells.push(ea)}for(;0<fa.length;)if(k=K.getTerminal(fa.shift(),!1),null!=k&&!U.deleted.get(k)&&
+K.isVertex(k)&&(X=y(k),null!=X&&(null==u||!u.get(X)))){X=E.getIncomingTreeEdges(k);ea=!0;for(var oa=0;oa<X.length;oa++)if(!U.cut.get(X[oa])){ea=!1;break}ea&&(U.cascaded.push(k),P(k))}return U}function F(k){k=E.view.getState(k);if(null!=k){var u=E.getIncomingTreeEdges(k.cell);if(0<u.length&&(u=E.view.getState(u[0]),null!=u&&(u=u.absolutePoints,null!=u&&0<u.length&&(u=u[u.length-1],null!=u)))){if(u.y==k.y&&Math.abs(u.x-k.getCenterX())<k.width/2)return mxConstants.DIRECTION_SOUTH;if(u.y==k.y+k.height&&
+Math.abs(u.x-k.getCenterX())<k.width/2)return mxConstants.DIRECTION_NORTH;if(u.x>k.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function N(k,u,H){if(null!=H){for(var P=E.getCurrentCellStyle(u),U=["treeFolding","treeMoving","newEdgeStyle"],W=0;W<U.length;W++)null!=P[U[W]]&&(null==H.style||0>H.style.indexOf(U[W]+"="))&&(H.style=mxUtils.setStyle(H.style,U[W],P[U[W]]));null!=H.geometry&&null!=u.geometry&&(H.geometry.x=u.geometry.x,H.geometry.y=u.geometry.y);E.model.getTerminal(k[0],
+!1)==k[1]&&E.model.setTerminal(k[0],H,!1);k[1]=H}return k}function R(k,u,H){u=null!=u?u:!0;E.model.beginUpdate();try{var P=E.model.getParent(k),U=E.getIncomingTreeEdges(k),W=N(E.cloneCells([U[0],k]),k,H);E.model.setTerminal(W[0],E.model.getTerminal(U[0],!0),!0);var fa=F(k),X=P.geometry;fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH?W[1].geometry.x+=u?k.geometry.width+10:-W[1].geometry.width-10:W[1].geometry.y+=u?k.geometry.height+10:-W[1].geometry.height-10;E.view.currentRoot!=P&&
+(W[1].geometry.x-=X.x,W[1].geometry.y-=X.y);var ea=E.view.getState(k),oa=E.view.scale;if(null!=ea){var ka=mxRectangle.fromRectangle(ea);fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH?ka.x+=(u?k.geometry.width+10:-W[1].geometry.width-10)*oa:ka.y+=(u?k.geometry.height+10:-W[1].geometry.height-10)*oa;var ba=E.getOutgoingTreeEdges(E.model.getTerminal(U[0],!0));if(null!=ba){var sa=fa==mxConstants.DIRECTION_SOUTH||fa==mxConstants.DIRECTION_NORTH;for(X=U=H=0;X<ba.length;X++){var xa=E.model.getTerminal(ba[X],
+!1);if(fa==F(xa)){var qa=E.view.getState(xa);xa!=k&&null!=qa&&(sa&&u!=qa.getCenterX()<ea.getCenterX()||!sa&&u!=qa.getCenterY()<ea.getCenterY())&&mxUtils.intersects(ka,qa)&&(H=10+Math.max(H,(Math.min(ka.x+ka.width,qa.x+qa.width)-Math.max(ka.x,qa.x))/oa),U=10+Math.max(U,(Math.min(ka.y+ka.height,qa.y+qa.height)-Math.max(ka.y,qa.y))/oa))}}sa?U=0:H=0;for(X=0;X<ba.length;X++)if(xa=E.model.getTerminal(ba[X],!1),fa==F(xa)&&(qa=E.view.getState(xa),xa!=k&&null!=qa&&(sa&&u!=qa.getCenterX()<ea.getCenterX()||
+!sa&&u!=qa.getCenterY()<ea.getCenterY()))){var Ba=[];E.traverse(qa.cell,!0,function(ma,ta){var va=null!=ta&&E.isTreeEdge(ta);va&&Ba.push(ta);(null==ta||va)&&Ba.push(ma);return null==ta||va});E.moveCells(Ba,(u?1:-1)*H,(u?1:-1)*U)}}}return E.addCells(W,P)}finally{E.model.endUpdate()}}function c(k,u){E.model.beginUpdate();try{var H=F(k),P=E.getIncomingTreeEdges(k),U=N(E.cloneCells([P[0],k]),k,u);E.model.setTerminal(P[0],U[1],!1);E.model.setTerminal(U[0],U[1],!0);E.model.setTerminal(U[0],k,!1);var W=
+E.model.getParent(k),fa=W.geometry,X=[];E.view.currentRoot!=W&&(U[1].geometry.x-=fa.x,U[1].geometry.y-=fa.y);E.traverse(k,!0,function(ka,ba){var sa=null!=ba&&E.isTreeEdge(ba);sa&&X.push(ba);(null==ba||sa)&&X.push(ka);return null==ba||sa});var ea=k.geometry.width+40,oa=k.geometry.height+40;H==mxConstants.DIRECTION_SOUTH?ea=0:H==mxConstants.DIRECTION_NORTH?(ea=0,oa=-oa):H==mxConstants.DIRECTION_WEST?(ea=-ea,oa=0):H==mxConstants.DIRECTION_EAST&&(oa=0);E.moveCells(X,ea,oa);return E.addCells(U,W)}finally{E.model.endUpdate()}}
+function f(k,u,H){E.model.beginUpdate();try{var P=E.model.getParent(k),U=E.getIncomingTreeEdges(k),W=F(k);0==U.length&&(U=[E.createEdge(P,null,"",null,null,E.createCurrentEdgeStyle())],W=u);var fa=N(E.cloneCells([U[0],k]),k,H);E.model.setTerminal(fa[0],k,!0);null==E.model.getTerminal(fa[0],!1)&&(E.model.setTerminal(fa[0],fa[1],!1),E.applyNewEdgeStyle(fa[1],[fa[0]],W));U=E.getOutgoingTreeEdges(k);var X=P.geometry;u=[];E.view.currentRoot==P&&(X=new mxRectangle);for(H=0;H<U.length;H++){var ea=E.model.getTerminal(U[H],
+!1);null!=ea&&u.push(ea)}var oa=E.view.getBounds(u),ka=E.view.translate,ba=E.view.scale;W==mxConstants.DIRECTION_SOUTH?(fa[1].geometry.x=null==oa?k.geometry.x+(k.geometry.width-fa[1].geometry.width)/2:(oa.x+oa.width)/ba-ka.x-X.x+10,fa[1].geometry.y+=k.geometry.height-X.y+40):W==mxConstants.DIRECTION_NORTH?(fa[1].geometry.x=null==oa?k.geometry.x+(k.geometry.width-fa[1].geometry.width)/2:(oa.x+oa.width)/ba-ka.x+-X.x+10,fa[1].geometry.y-=fa[1].geometry.height+X.y+40):(fa[1].geometry.x=W==mxConstants.DIRECTION_WEST?
+fa[1].geometry.x-(fa[1].geometry.width+X.x+40):fa[1].geometry.x+(k.geometry.width-X.x+40),fa[1].geometry.y=null==oa?k.geometry.y+(k.geometry.height-fa[1].geometry.height)/2:(oa.y+oa.height)/ba-ka.y+-X.y+10);return E.addCells(fa,P)}finally{E.model.endUpdate()}}function l(k,u,H){k=E.getOutgoingTreeEdges(k);H=E.view.getState(H);var P=[];if(null!=H&&null!=k){for(var U=0;U<k.length;U++){var W=E.view.getState(E.model.getTerminal(k[U],!1));null!=W&&(!u&&Math.min(W.x+W.width,H.x+H.width)>=Math.max(W.x,H.x)||
u&&Math.min(W.y+W.height,H.y+H.height)>=Math.max(W.y,H.y))&&P.push(W)}P.sort(function(fa,X){return u?fa.x+fa.width-X.x-X.width:fa.y+fa.height-X.y-X.height})}return P}function q(k,u){var H=F(k),P=u==mxConstants.DIRECTION_EAST||u==mxConstants.DIRECTION_WEST;(H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST)==P&&H!=u?A.actions.get("selectParent").funct():H==u?(u=E.getOutgoingTreeEdges(k),null!=u&&0<u.length&&E.setSelectionCell(E.model.getTerminal(u[0],!1))):(H=E.getIncomingTreeEdges(k),null!=
H&&0<H.length&&(P=l(E.model.getTerminal(H[0],!0),P,k),k=E.view.getState(k),null!=k&&(k=mxUtils.indexOf(P,k),0<=k&&(k+=u==mxConstants.DIRECTION_NORTH||u==mxConstants.DIRECTION_WEST?-1:1,0<=k&&k<=P.length-1&&E.setSelectionCell(P[k].cell)))))}function x(k){return(t(k)||p(k))&&!C(k)&&0<E.getOutgoingTreeEdges(k).length&&!E.isCellCollapsed(k)}var A=this,E=A.editor.graph,K=E.getModel(),Q=A.menus.createPopupMenu;A.menus.createPopupMenu=function(k,u,H){Q.apply(this,arguments);if(1==E.getSelectionCount()){u=
E.getSelectionCell();var P=E.getOutgoingTreeEdges(u);k.addSeparator();0<P.length&&(p(E.getSelectionCell())&&this.addMenuItems(k,["selectChildren"],null,H),this.addMenuItems(k,["selectDescendants"],null,H));p(E.getSelectionCell())?(k.addSeparator(),0<E.getIncomingTreeEdges(u).length&&this.addMenuItems(k,["selectSiblings","selectParent"],null,H)):0<E.model.getEdgeCount(u)&&this.addMenuItems(k,["selectConnections"],null,H)}};A.actions.addAction("selectChildren",function(k){if(E.isEnabled()&&1==E.getSelectionCount()){var u=
-E.getSelectionCell();k=mxEvent.isControlDown(k)?null:E.getOutgoingTreeEdges(u);if(null!=k&&0<k.length){u=[];for(var H=0;H<k.length;H++)u.push(E.model.getTerminal(k[H],!1));E.setSelectionCells(u)}else E.setSelectionCells(E.model.getChildren(u))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");A.actions.addAction("selectDescendants",function(k){var u=E.getSelectionCell();if(E.isEnabled()&&null!=u){var H=[];mxEvent.isControlDown(k)||E.traverse(u,!0,function(P,T){var W=null!=T&&E.isTreeEdge(T);W&&
-mxEvent.isControlDown(k)&&H.push(T);(null==T||W)&&H.push(P);return null==T||W});if(0==H.length||1==H.length&&H[0]==u)H=E.model.getDescendants(u);E.setSelectionCells(H)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");A.actions.addAction("selectParent",function(k){var u=E.getSelectionCell();E.isEnabled()&&null!=u&&(k=mxEvent.isControlDown(k)?null:E.getIncomingTreeEdges(u),null!=k&&0<k.length?E.setSelectionCell(E.model.getTerminal(k[0],!0)):E.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+
+E.getSelectionCell();k=mxEvent.isControlDown(k)?null:E.getOutgoingTreeEdges(u);if(null!=k&&0<k.length){u=[];for(var H=0;H<k.length;H++)u.push(E.model.getTerminal(k[H],!1));E.setSelectionCells(u)}else E.setSelectionCells(E.model.getChildren(u))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");A.actions.addAction("selectDescendants",function(k){var u=E.getSelectionCell();if(E.isEnabled()&&null!=u){var H=[];mxEvent.isControlDown(k)||E.traverse(u,!0,function(P,U){var W=null!=U&&E.isTreeEdge(U);W&&
+mxEvent.isControlDown(k)&&H.push(U);(null==U||W)&&H.push(P);return null==U||W});if(0==H.length||1==H.length&&H[0]==u)H=E.model.getDescendants(u);E.setSelectionCells(H)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");A.actions.addAction("selectParent",function(k){var u=E.getSelectionCell();E.isEnabled()&&null!=u&&(k=mxEvent.isControlDown(k)?null:E.getIncomingTreeEdges(u),null!=k&&0<k.length?E.setSelectionCell(E.model.getTerminal(k[0],!0)):E.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+
"+P");A.actions.addAction("selectSiblings",function(k){if(E.isEnabled()&&1==E.getSelectionCount()){var u=E.getSelectionCell(),H=mxEvent.isControlDown(k)?null:E.getIncomingTreeEdges(u);k=[];if(null!=H&&0<H.length&&(H=E.getOutgoingTreeEdges(E.model.getTerminal(H[0],!0)),null!=H))for(var P=0;P<H.length;P++)k.push(E.model.getTerminal(H[P],!1));0==k.length&&(k=E.model.getChildren(E.model.getParent(u)));E.setSelectionCells(k)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var V=E.removeCells;E.removeCells=
-function(k,u){u=null!=u?u:!0;null==k&&(k=this.getDeletableCells(this.getSelectionCells()));u&&(k=this.getDeletableCells(this.addAllEdges(k)));var H=O(k,null);var P=H;for(var T=new mxDictionary,W=null,fa=0;fa<P.cascaded.length;fa++){var X=y(P.cascaded[fa]);if(null!=X&&!T.get(X)){T.put(X,!0);a:{var ea=P;for(var oa=[X];0<oa.length;)for(var la=oa.pop(),ca=0;ca<K.getChildCount(la);ca++){var sa=K.getChildAt(la,ca);if(K.isVertex(sa)&&!ea.deleted.get(sa))for(var xa=0;xa<K.getEdgeCount(sa);xa++)if(!ea.cut.get(K.getEdgeAt(sa,
-xa))){ea=!0;break a}oa.push(sa)}ea=!1}ea||(W=null!=W?W:new mxDictionary,W.put(X,!0))}}P=W;null!=P&&(H=O(k,P));k=H.cells;return V.apply(this,arguments)};A.hoverIcons.getStateAt=function(k,u,H){return p(k.cell)?null:this.graph.view.getState(this.graph.getCellAt(u,H))};var J=E.duplicateCells;E.duplicateCells=function(k,u){k=null!=k?k:this.getSelectionCells();for(var H=k.slice(0),P=0;P<H.length;P++){var T=E.view.getState(H[P]);if(null!=T&&p(T.cell)){var W=E.getIncomingTreeEdges(T.cell);for(T=0;T<W.length;T++)mxUtils.remove(W[T],
-k)}}this.model.beginUpdate();try{var fa=J.call(this,k,u);if(fa.length==k.length)for(P=0;P<k.length;P++)if(p(k[P])){var X=E.getIncomingTreeEdges(fa[P]);W=E.getIncomingTreeEdges(k[P]);if(0==X.length&&0<W.length){var ea=this.cloneCell(W[0]);this.addEdge(ea,E.getDefaultParent(),this.model.getTerminal(W[0],!0),fa[P])}}}finally{this.model.endUpdate()}return fa};var ia=E.moveCells;E.moveCells=function(k,u,H,P,T,W,fa){for(var X=null,ea=[],oa=0;oa<k.length;oa++)(t(k[oa])||p(k[oa]))&&!C(k[oa])&&this.isCellCollapsed(k[oa])?
-ea=ea.concat(this.getSubtree(k[oa])):ea.push(k[oa]);k=mxUtils.removeDuplicates(ea);this.model.beginUpdate();try{ea=T;var la=this.getCurrentCellStyle(T);if(null!=k&&p(T)&&"1"==mxUtils.getValue(la,"treeFolding","0")){for(oa=0;oa<k.length;oa++)if(p(k[oa])||E.model.isEdge(k[oa])&&null==E.model.getTerminal(k[oa],!0)){T=E.model.getParent(k[oa]);break}if(null!=ea&&T!=ea&&null!=this.view.getState(k[0])){var ca=E.getIncomingTreeEdges(k[0]);if(0<ca.length){var sa=E.view.getState(E.model.getTerminal(ca[0],!0));
-if(null!=sa){var xa=E.view.getState(ea);null!=xa&&(u=(xa.getCenterX()-sa.getCenterX())/E.view.scale,H=(xa.getCenterY()-sa.getCenterY())/E.view.scale)}}}}X=ia.apply(this,arguments);if(null!=X&&null!=k&&X.length==k.length)for(oa=0;oa<X.length;oa++)if(this.model.isEdge(X[oa]))p(ea)&&0>mxUtils.indexOf(X,this.model.getTerminal(X[oa],!0))&&this.model.setTerminal(X[oa],ea,!0);else if(p(k[oa])&&(ca=E.getIncomingTreeEdges(k[oa]),0<ca.length))if(!P)p(ea)&&0>mxUtils.indexOf(k,this.model.getTerminal(ca[0],!0))&&
-this.model.setTerminal(ca[0],ea,!0);else if(0==E.getIncomingTreeEdges(X[oa]).length){la=ea;if(null==la||la==E.model.getParent(k[oa]))la=E.model.getTerminal(ca[0],!0);P=this.cloneCell(ca[0]);this.addEdge(P,E.getDefaultParent(),la,X[oa])}}finally{this.model.endUpdate()}return X};if(null!=A.sidebar){var Y=A.sidebar.dropAndConnect;A.sidebar.dropAndConnect=function(k,u,H,P){var T=E.model,W=null;T.beginUpdate();try{if(W=Y.apply(this,arguments),p(k))for(var fa=0;fa<W.length;fa++)if(T.isEdge(W[fa])&&null==
-T.getTerminal(W[fa],!0)){T.setTerminal(W[fa],k,!0);var X=E.getCellGeometry(W[fa]);X.points=null;null!=X.getTerminalPoint(!0)&&X.setTerminalPoint(null,!0)}}finally{T.endUpdate()}return W}}var aa={67:A.actions.get("selectChildren"),88:A.actions.get("selectDescendants"),80:A.actions.get("selectParent"),83:A.actions.get("selectSiblings")},ja={67:A.actions.get("copyStyle"),86:A.actions.get("pasteStyle")},ka=A.onKeyDown;A.onKeyDown=function(k){try{var u=E.getSelectionCell();if(E.isEnabled()&&!E.isEditing()&&
+function(k,u){u=null!=u?u:!0;null==k&&(k=this.getDeletableCells(this.getSelectionCells()));u&&(k=this.getDeletableCells(this.addAllEdges(k)));var H=O(k,null);var P=H;for(var U=new mxDictionary,W=null,fa=0;fa<P.cascaded.length;fa++){var X=y(P.cascaded[fa]);if(null!=X&&!U.get(X)){U.put(X,!0);a:{var ea=P;for(var oa=[X];0<oa.length;)for(var ka=oa.pop(),ba=0;ba<K.getChildCount(ka);ba++){var sa=K.getChildAt(ka,ba);if(K.isVertex(sa)&&!ea.deleted.get(sa))for(var xa=0;xa<K.getEdgeCount(sa);xa++)if(!ea.cut.get(K.getEdgeAt(sa,
+xa))){ea=!0;break a}oa.push(sa)}ea=!1}ea||(W=null!=W?W:new mxDictionary,W.put(X,!0))}}P=W;null!=P&&(H=O(k,P));k=H.cells;return V.apply(this,arguments)};A.hoverIcons.getStateAt=function(k,u,H){return p(k.cell)?null:this.graph.view.getState(this.graph.getCellAt(u,H))};var J=E.duplicateCells;E.duplicateCells=function(k,u){k=null!=k?k:this.getSelectionCells();for(var H=k.slice(0),P=0;P<H.length;P++){var U=E.view.getState(H[P]);if(null!=U&&p(U.cell)){var W=E.getIncomingTreeEdges(U.cell);for(U=0;U<W.length;U++)mxUtils.remove(W[U],
+k)}}this.model.beginUpdate();try{var fa=J.call(this,k,u);if(fa.length==k.length)for(P=0;P<k.length;P++)if(p(k[P])){var X=E.getIncomingTreeEdges(fa[P]);W=E.getIncomingTreeEdges(k[P]);if(0==X.length&&0<W.length){var ea=this.cloneCell(W[0]);this.addEdge(ea,E.getDefaultParent(),this.model.getTerminal(W[0],!0),fa[P])}}}finally{this.model.endUpdate()}return fa};var ia=E.moveCells;E.moveCells=function(k,u,H,P,U,W,fa){for(var X=null,ea=[],oa=0;oa<k.length;oa++)(t(k[oa])||p(k[oa]))&&!C(k[oa])&&this.isCellCollapsed(k[oa])?
+ea=ea.concat(this.getSubtree(k[oa])):ea.push(k[oa]);k=mxUtils.removeDuplicates(ea);this.model.beginUpdate();try{ea=U;var ka=this.getCurrentCellStyle(U);if(null!=k&&p(U)&&"1"==mxUtils.getValue(ka,"treeFolding","0")){for(oa=0;oa<k.length;oa++)if(p(k[oa])||E.model.isEdge(k[oa])&&null==E.model.getTerminal(k[oa],!0)){U=E.model.getParent(k[oa]);break}if(null!=ea&&U!=ea&&null!=this.view.getState(k[0])){var ba=E.getIncomingTreeEdges(k[0]);if(0<ba.length){var sa=E.view.getState(E.model.getTerminal(ba[0],!0));
+if(null!=sa){var xa=E.view.getState(ea);null!=xa&&(u=(xa.getCenterX()-sa.getCenterX())/E.view.scale,H=(xa.getCenterY()-sa.getCenterY())/E.view.scale)}}}}X=ia.apply(this,arguments);if(null!=X&&null!=k&&X.length==k.length)for(oa=0;oa<X.length;oa++)if(this.model.isEdge(X[oa]))p(ea)&&0>mxUtils.indexOf(X,this.model.getTerminal(X[oa],!0))&&this.model.setTerminal(X[oa],ea,!0);else if(p(k[oa])&&(ba=E.getIncomingTreeEdges(k[oa]),0<ba.length))if(!P)p(ea)&&0>mxUtils.indexOf(k,this.model.getTerminal(ba[0],!0))&&
+this.model.setTerminal(ba[0],ea,!0);else if(0==E.getIncomingTreeEdges(X[oa]).length){ka=ea;if(null==ka||ka==E.model.getParent(k[oa]))ka=E.model.getTerminal(ba[0],!0);P=this.cloneCell(ba[0]);this.addEdge(P,E.getDefaultParent(),ka,X[oa])}}finally{this.model.endUpdate()}return X};if(null!=A.sidebar){var Y=A.sidebar.dropAndConnect;A.sidebar.dropAndConnect=function(k,u,H,P){var U=E.model,W=null;U.beginUpdate();try{if(W=Y.apply(this,arguments),p(k))for(var fa=0;fa<W.length;fa++)if(U.isEdge(W[fa])&&null==
+U.getTerminal(W[fa],!0)){U.setTerminal(W[fa],k,!0);var X=E.getCellGeometry(W[fa]);X.points=null;null!=X.getTerminalPoint(!0)&&X.setTerminalPoint(null,!0)}}finally{U.endUpdate()}return W}}var aa={67:A.actions.get("selectChildren"),88:A.actions.get("selectDescendants"),80:A.actions.get("selectParent"),83:A.actions.get("selectSiblings")},ja={67:A.actions.get("copyStyle"),86:A.actions.get("pasteStyle")},la=A.onKeyDown;A.onKeyDown=function(k){try{var u=E.getSelectionCell();if(E.isEnabled()&&!E.isEditing()&&
null!=u){var H=mxEvent.isAltDown(k)&&mxEvent.isShiftDown(k)?aa[k.keyCode]:mxEvent.isAltDown(k)?ja[k.keyCode]:null;null!=H?(H.funct(k),mxEvent.consume(k)):p(u)&&(H=null,0<E.getIncomingTreeEdges(u).length&&(9==k.which?H=mxEvent.isShiftDown(k)?c(u):f(u):13==k.which&&(H=R(u,!mxEvent.isShiftDown(k)))),null!=H&&0<H.length?(1==H.length&&E.model.isEdge(H[0])?E.setSelectionCell(E.model.getTerminal(H[0],!1)):E.setSelectionCell(H[H.length-1]),null!=A.hoverIcons&&A.hoverIcons.update(E.view.getState(u)),E.startEditingAtCell(u),
-mxEvent.consume(k)):37==k.keyCode?(q(u,mxConstants.DIRECTION_WEST),mxEvent.consume(k)):38==k.keyCode?(q(u,mxConstants.DIRECTION_NORTH),mxEvent.consume(k)):39==k.keyCode?(q(u,mxConstants.DIRECTION_EAST),mxEvent.consume(k)):40==k.keyCode&&(q(u,mxConstants.DIRECTION_SOUTH),mxEvent.consume(k)))}}catch(P){A.handleError(P)}mxEvent.isConsumed(k)||ka.apply(this,arguments)};var ua=E.connectVertex;E.connectVertex=function(k,u,H,P,T,W,fa,X,ea){var oa=E.getIncomingTreeEdges(k);if(p(k)){var la=F(k),ca=la==mxConstants.DIRECTION_EAST||
-la==mxConstants.DIRECTION_WEST,sa=u==mxConstants.DIRECTION_EAST||u==mxConstants.DIRECTION_WEST;oa=la==u||0==oa.length?f(k,u,ea):ca==sa?c(k,ea):R(k,u!=mxConstants.DIRECTION_NORTH&&u!=mxConstants.DIRECTION_WEST,ea);if(null!=X)X(oa);else return oa}else return ua.apply(this,arguments)};E.getSubtree=function(k){var u=[k];!t(k)&&!p(k)||C(k)||E.traverse(k,!0,function(H,P){var T=null!=P&&E.isTreeEdge(P);T&&0>mxUtils.indexOf(u,P)&&u.push(P);(null==P||T)&&0>mxUtils.indexOf(u,H)&&u.push(H);return null==P||T});
-return u};var Da=E.isMoveIconVisible;E.isMoveIconVisible=function(k){return Da.apply(this,arguments)||x(k)};var ha=E.getMoveIconDragCells;E.getMoveIconDragCells=function(k){return x(k)?this.getSubtree(k):ha.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var p=m.apply(this,arguments),t=this.graph,n=this;return p.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",
-new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var C=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');C.vertex=!0;var O=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
-O.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;C.insertEdge(F,!0);O.insertEdge(F,!1);y.insert(F);y.insert(C);y.insert(O);return n.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");
-y.vertex=!0;var C=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');C.vertex=!0;var O=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
-O.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");F.geometry.relative=!0;F.edge=!0;C.insertEdge(F,!0);O.insertEdge(F,!1);var N=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
+mxEvent.consume(k)):37==k.keyCode?(q(u,mxConstants.DIRECTION_WEST),mxEvent.consume(k)):38==k.keyCode?(q(u,mxConstants.DIRECTION_NORTH),mxEvent.consume(k)):39==k.keyCode?(q(u,mxConstants.DIRECTION_EAST),mxEvent.consume(k)):40==k.keyCode&&(q(u,mxConstants.DIRECTION_SOUTH),mxEvent.consume(k)))}}catch(P){A.handleError(P)}mxEvent.isConsumed(k)||la.apply(this,arguments)};var ua=E.connectVertex;E.connectVertex=function(k,u,H,P,U,W,fa,X,ea){var oa=E.getIncomingTreeEdges(k);if(p(k)){var ka=F(k),ba=ka==mxConstants.DIRECTION_EAST||
+ka==mxConstants.DIRECTION_WEST,sa=u==mxConstants.DIRECTION_EAST||u==mxConstants.DIRECTION_WEST;if(!(oa=ka==u||0==oa.length))a:{ka=K.getParent(k);if(null!=ka){ka=E.getCurrentCellStyle(ka);ka=null!=ka?ka.childLayout:null;if("flowLayout"==ka){oa=!0;break a}try{var xa=Graph.decodeChildLayout(ka);oa=null!=xa&&0<xa.length&&null!=xa[0]&&"elkLayered"==xa[0].layout;break a}catch(qa){}}oa=!1}ba=oa?f(k,u,ea):ba==sa?c(k,ea):R(k,u!=mxConstants.DIRECTION_NORTH&&u!=mxConstants.DIRECTION_WEST,ea);if(null!=X)X(ba);
+else return ba}else return ua.apply(this,arguments)};E.getSubtree=function(k){var u=[k];!t(k)&&!p(k)||C(k)||E.traverse(k,!0,function(H,P){var U=null!=P&&E.isTreeEdge(P);U&&0>mxUtils.indexOf(u,P)&&u.push(P);(null==P||U)&&0>mxUtils.indexOf(u,H)&&u.push(H);return null==P||U});return u};var Da=E.isMoveIconVisible;E.isMoveIconVisible=function(k){return Da.apply(this,arguments)||x(k)};var ha=E.getMoveIconDragCells;E.getMoveIconDragCells=function(k){return x(k)?this.getSubtree(k):ha.apply(this,arguments)}};
+if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var p=m.apply(this,arguments),t=this.graph,n=this;return p.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var C=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
+C.vertex=!0;var O=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');O.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;C.insertEdge(F,!0);O.insertEdge(F,!1);y.insert(F);y.insert(C);y.insert(O);
+return n.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var C=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
+C.vertex=!0;var O=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');O.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");
+F.geometry.relative=!0;F.edge=!0;C.insertEdge(F,!0);O.insertEdge(F,!1);var N=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
N.vertex=!0;var R=new mxCell("",new mxGeometry(0,0,0,0),F.style);R.geometry.relative=!0;R.edge=!0;C.insertEdge(R,!0);N.insertEdge(R,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),F.style);f.geometry.relative=!0;f.edge=!0;C.insertEdge(f,!0);c.insertEdge(f,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
l.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),F.style);q.geometry.relative=!0;q.edge=!0;C.insertEdge(q,!0);l.insertEdge(q,!1);y.insert(F);y.insert(R);y.insert(f);y.insert(q);y.insert(C);y.insert(O);y.insert(N);y.insert(c);y.insert(l);return n.createVertexTemplateFromCells([y],420,126,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');
@@ -5070,21 +5074,21 @@ function(F){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=F?
arguments);if(F){var N=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=N&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=N&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=
function(F){var N=this.editor.graph,R=document.createElement("div");R.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";N.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<N.getSelectionCount()?(F.appendChild(R),R.innerHTML="Selected: "+N.getSelectionCount()):null!=R.parentNode&&R.parentNode.removeChild(R)}))};var C=!1;EditorUi.prototype.initFormatWindow=
function(){if(!C&&null!=this.formatWindow){C=!0;var F=this.formatWindow.window.toggleMinimized,N=240;this.formatWindow.window.toggleMinimized=function(){F.apply(this,arguments);this.minimized?(N=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+N-140+"px"):(this.div.style.width=N+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-N+140)+"px");this.fit()};
-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(R){mxEvent.getSource(R)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var O=EditorUi.prototype.init;EditorUi.prototype.init=function(){function F(u,H,P){var T=l.menus.get(u);H=A.addMenu(mxResources.get(u),mxUtils.bind(this,function(){T.funct.apply(this,arguments)}));H.className="geButton";H.setAttribute("title",mxResources.get(u));l.menus.menuCreated(T,H,"geButton");null!=P&&
-(H.style.backgroundImage="url("+P+")",H.innerText="");return H}function N(u,H,P,T,W,fa){var X=document.createElement("a");X.className="geButton";x.appendChild(X);null!=fa?X.style.backgroundImage="url("+fa+")":mxUtils.write(X,u);mxEvent.addListener(X,"click",function(ea){"disabled"!=X.getAttribute("disabled")&&H(ea);mxEvent.consume(ea)});mxEvent.preventDefault(X);null!=T&&X.setAttribute("title",T);null!=W&&(u=function(){W.isEnabled()?X.removeAttribute("disabled"):X.setAttribute("disabled","disabled")},
+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(R){mxEvent.getSource(R)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var O=EditorUi.prototype.init;EditorUi.prototype.init=function(){function F(u,H,P){var U=l.menus.get(u);H=A.addMenu(mxResources.get(u),mxUtils.bind(this,function(){U.funct.apply(this,arguments)}));H.className="geButton";H.setAttribute("title",mxResources.get(u));l.menus.menuCreated(U,H,"geButton");null!=P&&
+(H.style.backgroundImage="url("+P+")",H.innerText="");return H}function N(u,H,P,U,W,fa){var X=document.createElement("a");X.className="geButton";x.appendChild(X);null!=fa?X.style.backgroundImage="url("+fa+")":mxUtils.write(X,u);mxEvent.addListener(X,"click",function(ea){"disabled"!=X.getAttribute("disabled")&&H(ea);mxEvent.consume(ea)});mxEvent.preventDefault(X);null!=U&&X.setAttribute("title",U);null!=W&&(u=function(){W.isEnabled()?X.removeAttribute("disabled"):X.setAttribute("disabled","disabled")},
W.addListener("stateChanged",u),q.addListener("enabledChanged",u),u());return X}function R(u,H,P){H=document.createElement("div");H.className="geButtonGroup";for(P=0;P<u.length;P++)null!=u[P]&&H.appendChild(u[P]);x.appendChild(H);return H}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var u=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(u=l.buttonContainer.offsetWidth||300);x.innerHTML="";var H=m<1E3+u,P=F("diagram",null,H?Editor.menuImage:null);
R([P,N(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),H?Editor.shapesImage:null),N(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),H?Editor.formatImage:null)]);P=F("insert",!0,H?J:null);R([P,N(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),H?Editor.trashImage:null)]);
-q.isEnabled()||P.setAttribute("disabled","disabled");Da.setAttribute("title",mxResources.get("undo")+" ("+ka.shortcut+")");ha.setAttribute("title",mxResources.get("redo")+" ("+ua.shortcut+")");k.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+u&&(R([Da,ha]),m>=520+u&&R([k,m>=640+u?N("",aa.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",aa,Editor.zoomInImage):null,m>=640+u?N("",ja.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ja,Editor.zoomOutImage):
+q.isEnabled()||P.setAttribute("disabled","disabled");Da.setAttribute("title",mxResources.get("undo")+" ("+la.shortcut+")");ha.setAttribute("title",mxResources.get("redo")+" ("+ua.shortcut+")");k.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+u&&(R([Da,ha]),m>=520+u&&R([k,m>=640+u?N("",aa.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",aa,Editor.zoomInImage):null,m>=640+u?N("",ja.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ja,Editor.zoomOutImage):
null]));x.appendChild(l.statusContainer);x.appendChild(l.buttonContainer)}O.apply(this,arguments);var f=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=f&&(f.classList.add("geSimple"),f.classList.add("geMinimal"),f.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(d(this,!0),null!=this.sidebar&&null!=
urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var l=this,q=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));var x=document.createElement("div");x.className="geMenubarContainer";var A=new Menubar(l,x),E=l.hideCurrentMenu;l.hideCurrentMenu=function(){E.apply(this,arguments);
null!=this.editor&&this.editor.graph.popupMenuHandler.hideMenu()};var K=l.descriptorChanged;l.descriptorChanged=function(){K.apply(this,arguments);var u=l.getCurrentFile();if(null!=u&&null!=u.getTitle()){var H=u.getMode();"google"==H?H="googleDrive":"github"==H?H="gitHub":"gitlab"==H?H="gitLab":"onedrive"==H&&(H="oneDrive");H=mxResources.get(H);x.setAttribute("title",u.getTitle()+(null!=H?" ("+H+")":""))}else x.removeAttribute("title")};l.setStatusText(l.editor.getStatus());x.appendChild(l.statusContainer);
l.buttonContainer=this.createButtonContainer();x.appendChild(l.buttonContainer);l.menubarContainer=l.buttonContainer;l.tabContainer=this.createTabContainer();var Q=this.createZoomInput(!0),V=l.updateTabContainer;l.updateTabContainer=function(){V.apply(this,arguments);l.tabContainer.appendChild(Q)};var J=Editor.addBoxImage;if(null!=l.hoverIcons){var ia=l.hoverIcons.update;l.hoverIcons.update=function(){q.freehand.isDrawing()||ia.apply(this,arguments)}}if(null!=q.freehand){var Y=q.freehand.createStyle;
-q.freehand.createStyle=function(u){return Y.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var aa=l.actions.get("zoomIn"),ja=l.actions.get("zoomOut");f=l.actions.get("resetView");var ka=l.actions.get("undo"),ua=l.actions.get("redo"),Da=N("",ka.funct,null,"",ka,Editor.undoImage),ha=N("",ua.funct,null,"",ua,Editor.redoImage),k=N("",function(u){mxEvent.isAltDown(u)?(l.hideCurrentMenu(),
+q.freehand.createStyle=function(u){return Y.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var aa=l.actions.get("zoomIn"),ja=l.actions.get("zoomOut");f=l.actions.get("resetView");var la=l.actions.get("undo"),ua=l.actions.get("redo"),Da=N("",la.funct,null,"",la,Editor.undoImage),ha=N("",ua.funct,null,"",ua,Editor.redoImage),k=N("",function(u){mxEvent.isAltDown(u)?(l.hideCurrentMenu(),
l.actions.get("customZoom").funct()):(l.hideCurrentMenu(),l.actions.get("smartFit").funct());mxEvent.consume(u)},!0,"",f,Editor.zoomFitImage);l.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){d(l,null)});l.container.appendChild(l.tabContainer);l.container.appendChild(x);l.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=m&&b(this,!0);c();l.addListener("lockedChanged",c);l.addListener("languageChanged",c);l.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,
"resize",function(){c();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.chatWindow&&l.menus.chatWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit();null!=l.menus.findReplaceWindow&&l.menus.findReplaceWindow.window.fit()})}}};
(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,d,m,p,t,n,y){this.file=b;this.id=d;this.content=m;this.modifiedDate=p;this.createdDate=t;this.isResolved=n;this.user=y;this.anchor=null;this.replies=[]};DrawioComment.prototype.getAnchorPageId=function(){return null!=this.anchor?this.anchor.p:null};DrawioComment.prototype.getAnchorCellIds=function(){var b=null!=this.anchor?this.anchor.c:null;return null==b?null:b instanceof Array?b:[b]};
DrawioComment.prototype.getAnchorCellId=function(){var b=this.getAnchorCellIds();return null!=b&&0<b.length?b[0]:null};DrawioComment.prototype.getAnchorRect=function(){return null!=this.anchor?this.anchor.r:null};DrawioComment.prototype.getAnchorPoint=function(){return null!=this.anchor?this.anchor.pt:null};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,d,m,p,t){d()};DrawioComment.prototype.editComment=function(b,d,m){d()};
-DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,p,t){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=p;this.locale=t};mxResources.parse('about=About\naiFreeModelHint=Start a new chat or shorten your message to send more.\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add Account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nalignCellsLeft=Align Left\nalignCellsCenter=Align Center\nalignCellsRight=Align Right\nalignCellsTop=Align Top\nalignCellsMiddle=Align Middle\nalignCellsBottom=Align Bottom\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSelectedObjectsInThisLayer=All selected objects are in this layer\nallSpaces=All Spaces\nallTags=All Tags\nandNMore=and {1} more\nanchor=Anchor\nandroid=Android\nangle=Angle\nallCells=All cells\nanimations=Flow Animations\ncell=cell\ncells=cells\nexcluded=Excluded\nexcludeSelection=Exclude selected cells\nlayer=Layer\nselectLayers=Select layers\ntransition=Transition\nmatch=Match\nmatchAll=All\nmatchAllHint=Match cells that have every selected tag (AND)\nmatchAny=Any\nmatchAnyHint=Match cells that have at least one selected tag (OR)\nduration=Duration (ms)\nfadeIn=Fade In\nfadeOut=Fade Out\nfadeTo=Fade To\nflow=Flow\nflowOff=Flow Off\nflowOn=Flow On\nhighlight=Highlight\nnoTagsInDiagram=No tags in this diagram yet.\noptional=optional\npopIn=Pop In\npopOut=Pop Out\nreorder=Drag to reorder\nreset=Reset\nscroll=Scroll To\nselectByTags=Select by tags\nselectCellsInDiagram=Select cells in diagram\ntag=Tag\nsetOpacity=Set Opacity\ntiming=Timing\ntoggle=Toggle\ntoggleStyle=Toggle Style\nuseSelection=Use selected cells\nvisibilityActions=Visibility\nwait=Wait\nwipeIn=Wipe In\nwipeOut=Wipe Out\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narea=Area\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosizeText=Automatic Font Size\nautosize=Autosize\nattach=Attach\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change User\nchangeStorage=Change Storage\nchangesNotSaved=Changes have not been saved\ncharactersRemaining={1} characters remaining\nclassDiagram=Class Diagram\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nclickToAdd=Click on canvas to add points\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ncurrentLayer=Current Layer\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram Type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndictate=Dictate\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclipboard=Clipboard\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseAll=Collapse All\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnectable=Connectable\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyDiagramToClipboard=Copy Diagram to Clipboard\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySelectionToClipboard=Copy Selection to Clipboard\ncopySize=Copy Size\ncopyStyle=Copy Style\ncopyTextStyle=Copy Text Style\ncreate=Create\ncreateDiagram=Create Diagram\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current Page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide Later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete All\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\nremoveLibraryConfirm=You are about to remove this library for everyone. Only an administrator can recover it. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndistributeHorizontal=Distribute Horizontally\ndistributeVertical=Distribute Vertically\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditor=Editor\neditPolygon=Edit Polygon\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditNote=Edit Note\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\neffects=Effects\nembed=Embed\nembedCellMetadata=Cell Metadata\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexpandAll=Expand All\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfindInDiagram=Find in Diagram\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTextToShape=Fit Text to Shape\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nforceDirected=Force-directed\nformat=Format\nformatAnimatedGif=Animated GIF\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatJson=JSON\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatVsdx=VSDX\nformatWebp=WebP\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngDriveAppFilesOnly=Only files created or opened with draw.io in Google Drive are listed. To add another file, open it once at app.diagrams.net.\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\ngroupPadding=Group Padding\nguides=Guides\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nshiftClickShowOnly=Shift+click: show only {1}\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nicons=Icons\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageClicked=Image copied to clipboard\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimmediate=Immediate\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninherit=Inherit\ninitialPage=Initial Page\ninitialView=Initial View\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertDiagramFromClipboard=Insert Diagram from Clipboard\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\ninvertSelection=Invert Selection\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlabelPadding=Label Padding\nlabelWidth=Label Width\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlibavoidAutoRoute=Auto-route around shapes\nlibavoidUnavailable=Orthogonal routing is not available in this browser.\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line Jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkIcons=Link Icons\nlinkText=Link Text\ntooltipIcons=Tooltip Icons\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to Right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nlightboxAnimationHint=Plays automatically when the page is shown in lightbox mode.\nline=Line\nlineend=Line End\nlineheight=Line Height\nlinestart=Line Start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlock=Lock\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloop=Loop\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmethod=Method\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move Selection to {1}\nmultipleValues=Multiple values\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewChat=New Chat\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoAnimationsInDiagram=No animations found in diagram\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoStepsYet=No steps yet. Add the first step below.\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotes=Notes\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered List\noffline=Offline\naddToLibrary=Add to Library\nanimation=Animation\nbool=Boolean\ncannotMoveOneDrive=Moving a file between accounts is not supported yet.\ncode=Code\ncolor=Color\ndispName=Display Name\nenum=Enumeration\nenumList=Enum List\nfast=Fast\nfloat=Float\nforever=Forever\nint=Int\ninvalid=invalid\nloops=Loops\nmedium=Medium\nslow=Slow\nspeed=Speed\nstring=String\nmanage=Manage\nofflineLanguages=Languages available offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenRepairedCopy=Open repaired copy\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\northogonalRouting=Orthogonal Routing\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste Here\npasteResponse=Paste Response\npasteSize=Paste Size\npasteStyle=Paste Style\npasteTextStyle=Paste Text Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplantUmlWarnings=PlantUML warnings\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\npolygon=Polygon\nportrait=Portrait\npoint=Point\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Process Engineering\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\npromptOnly=Prompt Only\npromptTooLarge=Only {1} characters allowed in the free version using the draw.io model\npromptWithDiagram=Prompt with Diagram\npromptWithSelection=Prompt with Selection\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nretry=Retry\nrememberMe=Remember Me\nrememberThisSetting=Remember This Setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace Existing Drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoreBackupCopy=Open backup as copy\nrecover=Recover…\nrecoverTitle=Recover file\nrecoverVersionFrom=Version from {1}\nrecoverPreviousVersion=Previous version\nrecoveryVersionDesc=A previously saved version. Complete, but any changes made since then are not included.\nrecoveryRepairedDesc=The current file with a best-effort repair. Recent, but content after the damaged point may be missing.\nrecoveryWarning=This is a best-effort recovery and may be missing content. It will open as a new unsaved copy and your original file is not changed. Continue?\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to Left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nrunLastLayout=Run Last Layout\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchImages=Search Images\nsearchShapes=Search Shapes\nsearchShapesInOpenLibraries=Search Shapes in Open Libraries\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshadows=Shadows\nshape=Shape\nshapeDeleted=Shape deleted\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsortPages=Sort Pages\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start Drawing\nstopDrawing=Stop Drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstress=Stress\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page, then click "Open with draw.io" button in the top right corner.\nturn=Rotate Shape Only by 90°\ntype=Type\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateDiagramFromClipboard=Update diagram from clipboard\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating document. Please wait...\nupdatingPreview=Updating preview. Please wait...\nupdatingSelection=Updating selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use Black and White\nuseCurrent=Use Current\nuseCurrentSettings=Use Current Settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently Used\nlistView=List View\ngridView=Grid View\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\nmentionNoNotify=People you mention are not notified\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft read error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft write error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nreindexInst3=Indexing pauses while the computer is asleep or offline and resumes when the connection returns, so keep the computer awake until "Re-indexing finished" is shown.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving failed (unexpected error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload failed (unexpected error)\nhiResPreview=High Resolution Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfADraftUpdated=Updated the draft of diagram: "{1}"\nconfADraftUpdateFailed=Updating the draft of diagram "{1}" failed\nconfADraftRemoved=Removed the draft of diagram: "{1}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\ncopyAsSvg=Copy as SVG\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by Spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a File...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the Viewer (px)\nheightOfViewer=Height of the Viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit Owning Page\ndeepIndexing=Deep Indexing (including diagrams that aren\'t used in any page)\nconfADeepIndexStarted=Deep indexing started\nconfADeepIndexDone=Deep indexing done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last Modified on\nsearchResults=Search Results\nshowAllTemps=Show All Templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for Updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell Checker\nnoChange=No Change\nlblToSvg=Convert Labels to SVG\nautoRotateLabel=Rotate with Edge\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft Save Interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow All\nnoTeams=No teams found\nerrorLoadingTeams=Error loading teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA404AttErrFaq=There are ({1}) 404 "File not found" error(s). The diagram file (an attachment of the page) does not exist. If it exists on the same page in the source site, the migration did not copy it, so copy the attachment manually or re-migrate the attachments. If it is missing in the source site also, the diagram was deleted before the migration.\nconfA404NoEditErrFaq=There are ({1}) 404 "Cannot find a page" error(s) for pages that were fetched successfully. These pages exist but could not be updated, this usually means the current user has no edit permission on them (page restrictions) or they are archived. Re-run the process with a user that can edit these pages.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAPageNoEditPerm=The page exists but could not be updated, this usually means the current user has no edit permission on it or the page is archived.\nconfAMacroInComment=draw.io macros inside page comments are not converted, skipped comment "{1}" (id {2})\nconfAReplaceBaseUrl=Replace base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate diagram detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for Production Use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have the "Attachment Checker for Confluence" app, enable "Always allow draw.io attachments" in its File Type Blocking settings. Update the app if that option is missing.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache Page IDs Mapping\nconfARemImpPages=Remember Imported Pages\nconfAGMTitle=Gliffy migration\nconfAGMStoredState=Stored state & reports\nconfAGMTabDryRun=Dry run\nconfAGMTabImport=Import\nconfAGMReadOnly=Read-only\nconfAGMWrites=Writes to pages\nconfAGMLoading=Loading migration state...\nconfAGMLoadFailed=Loading the migration state failed. Reload the page to try again.\nconfAGMStepScan=Scan & scope\nconfAGMStepDryRun=Dry run\nconfAGMStepReview=Review & report\nconfAGMScanTitle=Where your Gliffy diagrams live\nconfAGMScanSub=Scanning reads pages and counts Gliffy macros - it never modifies anything. Scans checkpoint as they go and resume if interrupted. Results are cached: rescanning is manual.\nconfAGMScanSite=Scan site\nconfAGMScanning=Scanning...\nconfAGMResumeScan=Resume scan\nconfAGMRescan=Rescan site\nconfAGMRescanConfirm=Rescan the site? The inventory is rebuilt; dry-run results and review verdicts are kept and re-matched by diagram.\nconfAGMScanMetaDone=Last scan finished {1} after {2} - {3} spaces contain Gliffy - {4} pages - {5} diagrams\nconfAGMScanMetaPaused=Scan paused - resumes from its checkpoint\nconfAGMScanMetaNone=Not scanned yet - scan to build the space inventory\nconfAGMPause=Pause\nconfAGMSearchSpaces=Search spaces by name or key...\nconfAGMSelectAll=Select all {1} with diagrams\nconfAGMSelectLive=All except archived ({1})\nconfAGMClear=Clear\nconfAGMShowArchived=Show archived\nconfAGMArchived=archived\nconfAGMSpace=Space\nconfAGMKey=Key\nconfAGMPages=Pages\nconfAGMDiagrams=Diagrams\nconfAGMNotImportable=Not importable\nconfAGMNoSpaces=No spaces yet - run a scan to build the inventory.\nconfAGMSpaceFoot=Showing {1} of {2} spaces, largest first.\nconfAGMSpaceFootMore=Showing the largest {1} of {2} matching spaces - search to narrow.\nconfAGMScope=Scope\nconfAGMScopeTotals={1} spaces - {2} diagrams - {3} pages\nconfAGMStartDryRunArrow=Start dry run →\nconfAGMDryTitle=Dry run - converts locally, changes nothing\nconfAGMDrySub=Every diagram in scope is downloaded and converted in this browser, and every affected page gets a permission check. Nothing is written to Confluence; diagram data never leaves this machine. Safe to close the tab - the run resumes from its last checkpoint.\nconfAGMDryNone=No dry run yet\nconfAGMDryRunning=Dry run in progress\nconfAGMDryPaused=Dry run paused\nconfAGMDryDone=Dry run complete - nothing was changed\nconfAGMInterrupted=interrupted\nconfAGMDone=done\nconfAGMStarted=Started {1}\nconfAGMFinished=finished {1}\nconfAGMStartDry=Start dry run\nconfAGMRerunDry=Run dry run again\nconfAGMResumeCheckpoint=Resume from checkpoint\nconfAGMSafeClose=Safe to close this tab at any time.\nconfAGMGenReport=Generate report\nconfAGMOfProcessed=of {1} processed\nconfAGMConvClean=converted clean\nconfAGMConvWarn=converter warnings\nconfAGMStalePins=version pin warnings\nconfAGMStalePin=The Gliffy macro pins version {1} but the latest is {2} - version pinning is off, so the latest was used; verify the conversion matches what the page displayed\nconfAGMPinnedOld=Imported the pinned version {1}; the latest is {2} - verify this is the version the page really displayed\nconfAGMPinFellBack=The pinned version {1} was not found - the latest ({2}) was used instead\nconfAGMPinResetNotice=draw.io update: Gliffy version pin handling changed - pins are now off by default (cloud Gliffy displays the latest version) and every pin that differs from the latest is flagged for review. The previous dry run used the old rules, so run a fresh dry run.\nconfAGMVersionPinning=Import the Gliffy version pinned in each macro instead of the latest (rarely needed - e.g. content migrated from Confluence Data Center)\nconfAGMPinToggleConfirm=Changing version pinning re-keys every diagram: the current dry run, review verdicts and import state will be discarded, and a fresh dry run is needed. Continue?\nconfAGMAlreadyImp=previously imported\nconfAGMFailed=failed\nconfAGMWriteBlocked=write-blocked\nconfAGMLeft=left\nconfAGMProblems=Problems so far - grouped, full detail in the stored files\nconfAGMNoPageEdit=no page edit\nconfAGMBlockedRow={1} pages ({2} diagrams) this user cannot edit - fix permissions or leave them Gliffy\nconfAGMReasonDraft=Gliffy draft stored on gliffy.com - no attachment to convert\nconfAGMReasonAttMissing=Diagram attachment no longer exists\nconfAGMReasonTooLarge=Exceeds converter limits\nconfAGMReasonConvert=Conversion failed\nconfAGMReasonFetch=Downloading the diagram failed\nconfAGMReasonSave=Saving failed\nconfAGMReasonAttInfo=Attachment lookup failed\nconfAGMReasonOther=Other error\nconfAGMNoEditPerm=No permission to edit "{1}" - its diagrams cannot be imported by this user\nconfAGMDiagConverted=Converted {2} diagram "{1}" (dry run, nothing written)\nconfAGMReviewTitle=Review a sample against the Gliffy previews\nconfAGMReviewSub=Left: the preview image Gliffy stored. Right: a live render of the draw.io conversion - what the page will show after import. Rate with the keyboard; verdicts are saved continuously and feed the report and the import.\nconfAGMReviewNeedsDry=Finish a dry run first - the review works on its results.\nconfAGMSample=Sample\nconfAGMSampleNote=of {1} converted - flagged first, then random across spaces\nconfAGMCustomPct=Custom %\nconfAGMApply=Apply\nconfAGMFilterSample=Sample\nconfAGMFilterUnreviewed=Unreviewed\nconfAGMFilterFlagged=Flagged\nconfAGMFilterFailed=Failed\nconfAGMSideBySide=Side by side\nconfAGMLiveRender=live render of conversion\nconfAGMStoredPreview=stored preview image\nconfAGMNoPreview=No preview image stored by Gliffy - compare against the diagram on its page.\nconfAGMGliffyPreviewAlt=Gliffy preview\nconfAGMNoDrawio=No draw.io version to show.\nconfAGMPreviewFailed=Rendering the conversion failed.\nconfAGMNotConverted=not converted\nconfAGMFailedReason=Not converted ({1}). See the problems list and the report.\nconfAGMFlickHint=A/B - press X or click to flip\nconfAGMConverterWarning=converter warning\nconfAGMNothingHere=Nothing to review in this filter\nconfAGMMatch=Match\nconfAGMMinor=Minor differences\nconfAGMMajor=Major differences\nconfAGMMatchL=match\nconfAGMMinorL=minor\nconfAGMMajorL=major\nconfAGMLeftInSample=left in sample\nconfAGMOfReviewed=of {1} reviewed\nconfAGMNotePlaceholder=Optional note - included in the report\nconfAGMPrivacy=The report contains ratings, notes, diagram names and converter warnings - never diagram contents. Diagram names are only sent to draw.io if you opt in below.\nconfAGMSendNamesOptIn=Include diagram names\nconfAGMSendReport=Send report to draw.io\nconfAGMSendConfirm=Send the migration report summary to draw.io? It contains counts, failure reasons and review verdicts.\nconfAGMSendDone=Report sent to draw.io. Reference: {1} - please quote it when contacting support.\nconfAGMGenerating=Generating report...\nconfAGMReportSaved=Report saved as {1} with the migration state.\nconfAGMOpenState=Open\nconfAGMReportFailed=Generating the report failed.\nconfAGMImpTitle=Import - writes to pages\nconfAGMImpSub=Consumes the latest dry run: scope, permission checks and review verdicts. Gliffy macros are replaced with draw.io macros and a .drawio attachment is added per diagram. Nothing is deleted - Gliffy attachments stay in place and every page edit is a normal Confluence version, so reverting a page restores its Gliffy macros.\nconfAGMImpNeedsDry=Import is disabled until a dry run has completed. Run it from the Dry run tab - it changes nothing.\nconfAGMImpReady={1} diagrams ready\nconfAGMImpSkipFail={1} failed conversions will be skipped and listed\nconfAGMImpBlocked={1} diagrams on {2} blocked pages stay Gliffy until permissions are fixed\nconfAGMImpAll=Import everything that converted\nconfAGMImpAllD=Review verdicts ride along in the log for follow-up\nconfAGMImpHold=Hold back "Major differences"\nconfAGMImpHoldN=Hold back "Major differences" ({1} rated)\nconfAGMImpHoldD=Diagrams rated Major in review stay Gliffy for a later pass\nconfAGMAdvanced=Advanced (defaults are right for almost everyone)\nconfAGMAddLabel=Add a label to every modified page (for CQL follow-up)\nconfAGMCheckDrift=Check for changes since dry run\nconfAGMDriftChecking=Checking pages for changes since the dry run...\nconfAGMDriftResult={1} pages changed and {2} gone since the dry run (checked {3}). Changed pages are re-verified during import.\nconfAGMDriftRecommend=More than 10% drift - running a fresh dry run first is recommended.\nconfAGMDriftUnknown=The dry run is {1} days old. Check for changes before importing.\nconfAGMImpNone=Not started\nconfAGMImpRunning=Import in progress\nconfAGMImpPaused=Import paused\nconfAGMImpDone=Import finished\nconfAGMStartImport=Start import - {1} diagrams\nconfAGMImpConfirm=Start the import? Up to {1} diagrams across {2} pages will be converted to draw.io macros. Nothing is deleted and every page edit is a normal Confluence version.\nconfAGMOfPages=of {1} pages\nconfAGMImported=diagrams imported\nconfAGMSkipped=skipped\nconfAGMErrors=errors\nconfAGMHeldBack=Held back "{1}" (rated Major differences in review)\nconfAGMSkippedFailed=Skipped "{1}" (failed in the dry run: {2})\nconfAGMPageBlocked=Skipped page "{1}" (no edit permission)\nconfAGMReimportPass=Processing pages labeled for re-import...\nconfAGMReassure=Interruptions resume from the last checkpoint - already-imported diagrams are never redone. The import log is stored with the migration state and downloadable.\nconfAGMImpSummary=Import finished {1}: {2} diagrams imported across {3} pages.\nconfAGMImpSummary2={1} held back - {2} skipped (failed) - {3} blocked - {4} errors.\nconfAGMImpSummary3=The run log and report are stored with the migration state.\nconfAGMRunAnother=Run another import\nconfAGMImpReportSaved=Run report saved as {1} with the migration state.\nconfAGMHttpFaq={1} requests failed with 403/404. These are usually permission problems - the API also returns 404 for content the user cannot read. See\nconfAGMFullscreen=Fullscreen\nconfAGMClose=Close\nconfAGMStatePageDesc=State and reports of the Gliffy to draw.io migration. Managed by the draw.io app; do not edit the attachments manually.\nconfABrokenDiagLnk=Broken diagram link (custom content) "{1}"\nconfACCDupEntry=duplicate entry\nconfACCInvalid=invalid content\nconfACCAttMissing=attachment is missing or has an older version\nconfAChkTabTitle=Integrity Check (Beta)\nconfAChkTitle=draw.io Diagrams Integrity Check\nconfAChkInst1=Scans all pages with draw.io macros and checks that every diagram has its attachment, preview image and diagram link (custom content) with the versions the macro points to. It also reports broken, duplicate and unused diagram links.\nconfAChkInst2=The check is read-only and changes nothing. It can take some time and the browser window must remain open until it finishes.\nconfAChkDownloadOpt=Download each diagram and verify its content instead of only checking it exists (slower, detects corrupted files)\nconfAChkStart=Start Integrity Check\nconfAChkStatChecked=Diagrams checked\nconfAChkStatOk=OK\nconfAChkStatBroken=Broken\nconfAChkStatWarn=With warnings\nconfAChkStatCC=Broken diagram links\nconfAChkStatOrphans=Unused embed links\nconfAChkLog=Log\nconfAChkFilterAll=All\nconfAChkFilterIssues=Issues only\nconfAChkProgLinks=Checking diagram links ({1} of {2})\nconfAChkProgPages=Checking pages with {3} macros ({1} of {2})\nconfAChkEta=~{1} remaining\nconfAChkEstimating=estimating…\nconfAChkDiag=Checking diagram "{1}"\nconfAChkDiagOK=Diagram "{1}" is OK\nconfAChkMacroNoName=Found a diagram macro without a diagram name (possibly a never-edited macro)\nconfAChkPageInfoBroken=Diagram "{1}": the page referenced by the macro (by space and title) cannot be resolved\nconfAChkCCMissing=Diagram "{1}": its diagram link (custom content) is missing or broken (the diagram works, but is excluded from search and diagram listings)\nconfAChkCCNoRef=Diagram "{1}": the macro has no diagram link (custom content) reference\nconfAChkCCOther=Diagram "{1}": the macro references a missing diagram link (custom content), but a valid one exists for this diagram\nconfAChkCCMismatch=Diagram "{1}": its diagram link (custom content) does not match the macro (page, name, or version)\nconfAChkDiagPageMissing=Diagram "{1}": the page ({2}) that holds the diagram attachment is not found\nconfAChkAttMissing=Diagram "{1}": the diagram attachment is not found\nconfAChkAttOldVer=Diagram "{1}": the diagram attachment version ({2}) is older than the version in the macro ({3})\nconfAChkAttFetchFailed=Diagram "{1}": fetching the attachments of page ({2}) failed\nconfAChkPrevMissing=Diagram "{1}": the preview image ({2}) is not found\nconfAChkPrevOldVer=Diagram "{1}": the preview image version ({2}) is older than the version in the macro ({3})\nconfAChkPrevOutOfSync=Diagram "{1}": the preview image (of diagram version {2}) is out of sync with the diagram (version {3})\nconfAChkPrevPageFailed=Diagram "{1}": fetching the attachments of the preview image page ({2}) failed\nconfAChkDiagInvalid=Diagram "{1}": the diagram content is not a valid draw.io file\nconfAChkDiagDownFailed=Diagram "{1}": downloading the diagram failed\nconfAChkEmbedCC=Checking embedded diagram links (custom contents)...\nconfAChkOrphanEmbedCC=Embedded diagram link (custom content) "{1}" is not referenced by any macro\nconfAChkSummary=Integrity check finished: {1} macros checked, {2} OK, {3} broken, {4} with warnings. Diagram links (custom contents): {5} broken, {6} unused embedded diagram links\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluence app)\nm365=Microsoft 365\nnodeSpacing=Node Spacing\nrankSpacing=Rank Spacing\npolyline=Polyline\nlayeringStrategy=Layering Strategy\nnetworkSimplex=Network Simplex\nlongestPath=Longest Path\ncoffmanGraham=Coffman-Graham\nweighting=Weighting\nmodelOrder=Model Order\ndescendants=Descendants\nconstraint=Constraint\nfan=Fan\noptimization=Optimization\nedgeLength=Edge Length\nedgeLengthByPosition=Edge Length by Position\ncrossingMinimization=Crossing Minimization\niterations=Iterations\nrepulsivePower=Repulsive Power\nresizeNodes=Resize Nodes\nuseSelectionAsRoot=Use Selection as Root\nuseSelectionAsRoots=Use Selection as Roots\nanonymize=Anonymize\nconnector=Connector\nextractText=Extract Text\nlegacyLayouts=Legacy Layouts\nedgeStyle=Edge Style\ncorners=Corners\nkeepStyle=Keep Existing Style\nopenLucidSite=Open Lucidchart Site in another tab and login to your account, then come back to this tab and click the "Start Import" button again.\npreviewSaveNoPermission=You do not have permission to save the preview image. The source page may be restricted or you may not have edit permission on the page. This only affects this page export to PDF/Word.\npreserveOrigin=Preserve Origin\nsharedStems=Bundle Outgoing Connections\ndraftLoadedWUnpublishedChanges=The diagram has loaded from a draft with unpublished changes. It is different from the published version.\nhachure=Hachure\nhatch=Hatch\ndots=Dots\ncrossHatch=Cross Hatch\nzigzag=ZigZag\nzigzagLine=ZigZag Line\nsysFonts=System Fonts\nwebfonts=Web Fonts\nfontname=Font Name\nfontUrl=Font URL\ncreatingDiagram=Generating diagram. Please wait\nconfAFixPageStorage=Remove invalid page storage format elements (Warning: May cause data loss)\ncfgAiActions=AI Actions (JSON)\ncfgAiConfigs=AI Configs (JSON)\ncfgAiGlobals=AI Globals (JSON)\ncfgAiModels=AI Models (JSON)\ncfgAppendCustomLibraries=Append Custom Libraries\ncfgAppendCustomLibrariesHelp=Custom libraries appear after built-in ones\ncfgAutoCropViewer=Auto Crop Viewer\ncfgAutoCropViewerHelp=Auto-crop viewer to fit diagram bounds\ncfgAutosaveDelay=Autosave Delay (ms)\ncfgBrowserTranslate=Browser Translate\ncfgBrowserTranslateHelp=Mirror diagram text for browser translation engines (e.g. Chrome Translate)\ncfgClaudeApiKey=Claude API Key\ncfgColorNames=Color Names (JSON)\ncfgColorNamesHelp=Map of colour codes to display names (tooltips)\ncfgCompact=Compact UI\ncfgCompactHelp=Enable compact user interface mode\ncfgCompressStyles=Compress Styles\ncfgCompressStylesHelp=Deduplicate repeated inline images and stencils into a shared lookup table. Only readable by draw.io 29.3.1 and later.\ncfgCompressXml=Compress XML\ncfgCompressXmlHelp=Compress XML output in saved files\ncfgCopyOnConnect=Copy on Connect\ncfgCopyOnConnectHelp=Create a copy of the source shape for connections that end on the canvas\ncfgCss=CSS Rules\ncfgCssHelp=CSS rules to customize the draw.io user interface\ncfgCustomCss=Custom CSS (alternative)\ncfgCustomCssHelp=Injected as a separate style element\ncfgCustomTemplates=Custom Templates (JSON)\ncfgCustomTemplatesHelp=Templates added to the sections of the template dialog\ncfgDarkColor=Dark Mode Background\ncfgDarkColorVar=Dark Color CSS Variable\ncfgDebug=Debug\ncfgDebugHelp=Enable debug output\ncfgDefaultAdaptiveColors=Adaptive Colors\ncfgDefaultConnectable=Default Connectable\ncfgDefaultConnectableHelp=Shapes are connectable by default\ncfgDefaultConnectionArrowsEnabled=Connection Arrows\ncfgDefaultConnectionArrowsEnabledHelp=Show arrows when hovering connections\ncfgDefaultDarkGridColor=Default Grid Color (Dark Mode)\ncfgDefaultDarkPageBackgroundColor=Default Page Background (Dark Mode)\ncfgDefaultEdgeLength=Default Edge Length\ncfgDefaultFileType=Default File Type\ncfgDefaultFoldingEnabled=Folding Enabled\ncfgDefaultFoldingEnabledHelp=Enable shape folding (collapse/expand)\ncfgDefaultGridColor=Default Grid Color\ncfgDefaultGridEnabled=Grid Enabled\ncfgDefaultGridEnabledHelp=Show grid on canvas\ncfgDefaultGridSize=Default Grid Size\ncfgDefaultLanguages=Default Languages\ncfgDefaultLanguagesHelp=Language bundles installed for offline use on startup\ncfgDefaultLibraries=Default Libraries\ncfgDefaultLibrariesHelp=Semicolon-separated library keys shown in sidebar on startup\ncfgDefaultPageBackgroundColor=Default Page Background\ncfgDefaultPageVisible=Page Visible\ncfgDefaultPageVisibleHelp=Show page outline on canvas\ncfgDefaultTextStyle=Default Text Style\ncfgDefaultTransparentGroups=Automatic Group Size\ncfgDefaultTransparentGroupsHelp=New groups automatically resize to fit their children (transparentBounds=1)\ncfgDesktopAutoSync=Desktop Auto Sync\ncfgDesktopAutoSyncHelp=Auto-sync when local file changes\ncfgDisableVersioning=Disable Versioning\ncfgDisableVersioningHelp=Disable diagram versioning\ncfgEmbedSvgFonts=Embed SVG Fonts\ncfgEmbedSvgFontsHelp=Default for embedding fonts as data URIs in exported and saved SVG files, can be overridden per file in the file properties\ncfgEmptyDiagramXml=Empty Diagram XML\ncfgEmptyLibraryXml=Empty Library XML\ncfgEnableAi=Enable AI\ncfgEnableAiHelp=Enable AI diagram generation\ncfgEnableAnimations=Enable Animations\ncfgEnableAnimationsHelp=Enable shape and layout animations\ncfgEnableCssDarkMode=CSS Dark Mode\ncfgEnableCssDarkMode2=CSS Dark Mode\ncfgEnableCssDarkMode2Help=Enable CSS-based dark mode for viewer diagrams\ncfgEnableCssDarkModeHelp=Use CSS for dark mode rendering\ncfgEnableCustomGitLabUrl=Enable Custom GitLab URL\ncfgEnableCustomGitLabUrlHelp=Allow ?gitlab= / ?gitlab-id= URL parameters to override the default GitLab server. Enable only for self-hosted GitLab deployments.\ncfgEnableCustomLibraries=Enable Custom Libraries\ncfgEnableCustomLibrariesHelp=Allow open and new library functions\ncfgEnableDistanceGuides=Distance Guides\ncfgEnableDistanceGuidesHelp=Snap shapes to equal distances between the surrounding shapes while moving (default on)\ncfgEnableExportUrl=Enable Export URL\ncfgEnableExportUrlHelp=Enable the export URL feature\ncfgEnableInlineToolbar=Inline Toolbar\ncfgEnableInlineToolbarHelp=Enable the inline toolbar on selection\ncfgEnableLightDarkColors=Light/Dark Colors\ncfgEnableLightDarkColorsHelp=Use CSS light-dark() color function\ncfgEnableLocalFonts=Local Fonts\ncfgEnableLocalFontsHelp=Scan and list locally installed fonts in the font picker\ncfgEnableNativeClipboard=Native Clipboard\ncfgEnableNativeClipboardHelp=Use native system clipboard\ncfgEnablePositionGuides=Position Guides\ncfgEnablePositionGuidesHelp=Snap shapes to the edges and centers of the other shapes while moving (default on)\ncfgEnableSizeGuides=Size Guides\ncfgEnableSizeGuidesHelp=Snap the size of a shape to the sizes of the other shapes while resizing (default on)\ncfgEnableWindowDocking=Window Docking\ncfgEnableWindowDockingHelp=Enable window docking\ncfgExpandLibraries=Expand Libraries\ncfgExpandLibrariesHelp=Libraries expanded by default\ncfgExpandPatternsForPrint=Expand Patterns for Print\ncfgExpandPatternsForPrintHelp=Expand patterns to visible graphics during print/PDF export\ncfgExperimental=Experimental feature\ncfgFitDiagramOnLoad=Fit Diagram on Load\ncfgFitDiagramOnLoadHelp=Fit diagram to window on load\ncfgFitDiagramOnPage=Fit Diagram on Page\ncfgFitDiagramOnPageHelp=Fit diagram to page size\ncfgFoldingIconSize=Folding Icon Size\ncfgFontCss=Font CSS (@font-face rules)\ncfgFontCssHelp=Added before preset colors in the colour dialog\ncfgForceSimpleViewer=Force Simple Viewer\ncfgForceSimpleViewerHelp=Force simple viewer for all diagrams\ncfgForeignObjectImages=Foreign Object Images\ncfgForeignObjectImagesHelp=Replace foreignObject with images\ncfgGeminiApiKey=Gemini API Key\ncfgGenerateSVGs=Generate SVGs\ncfgGenerateSVGsHelp=Generate SVG previews for diagrams\ncfgGlobalVars=Global Variables (JSON)\ncfgGlobalVarsHelp=Global placeholders available in all diagrams\ncfgGptApiKey=OpenAI API Key\ncfgGptUrl=Custom GPT URL\ncfgGridSteps=Grid Steps\ncfgHiResPreview=Hi-Res Preview\ncfgHiResPreviewHelp=Generate high-resolution preview images\ncfgIncludeDiagram=Include Diagram in Export\ncfgIncludeDiagramHelp=Include diagram data in export dialogs\ncfgInlineExtIcons=Inline Icon Search Results\ncfgInlineExtIconsHelp=Insert icon search results as embedded images instead of remote references\ncfgInplaceEdits=In-place Edits\ncfgInplaceEdits2=In-place Edits\ncfgInplaceEdits2Help=Allow launching editor from viewer\ncfgInplaceEditsHelp=Allow launching the editor from the viewer\ncfgInsertAnimations=Insert Animations\ncfgInsertAnimationsHelp=Show pop animation when inserting shapes from the sidebar\ncfgIntersectionSelect=Intersection Select\ncfgIntersectionSelectHelp=Select cells by intersection rather than containment\ncfgKeyboardShortcuts=Keyboard Shortcuts (JSON)\ncfgKeyboardShortcutsHelp=Custom keyboard shortcuts. Entries are {keyCode, control, shift, alt, action} where keyCode is a key code or single character and action is an action name, or null to remove a binding.\ncfgLibraries=Libraries (JSON)\ncfgLibrariesHelp=Custom library sections for the left panel\ncfgLockdown=Lockdown\ncfgLockdown2=Lockdown\ncfgLockdown2Help=Disable data transmission outside Confluence\ncfgLockdownHelp=Disable data transmission apart from storage\ncfgMathOutputSize=Math Output Size\ncfgMathOutputSizeHelp=Size labels, view bounds and initial fit to the rendered math output instead of the formula source\ncfgMaxImageBytes=Max Image Bytes\ncfgMaxImageSize=Max Image Size (px)\ncfgMermaid=Mermaid Config (JSON)\ncfgMermaidHelp=Default Mermaid settings such as theme and colours for all diagrams\ncfgNoAutoFocus=No Auto Focus\ncfgNoAutoFocusHelp=Disable auto-focus on startup\ncfgNoResizers=No Resizers\ncfgNoResizersHelp=Hide shape resize handles\ncfgNotSet=Not set (use default)\ncfgOneDriveInlinePicker=OneDrive Inline Picker\ncfgOneDriveInlinePickerHelp=Use inline picker for OneDrive\ncfgOptimizeHtmlLabels=Optimize HTML Labels\ncfgOptimizeHtmlLabelsHelp=Remove unnecessary spans from HTML labels when editing stops\ncfgOverride=Override\ncfgOverrideHelp=Ignore user settings stored in the browser so the defaults in this configuration always apply\ncfgPageFormatHeight=Page Height (1/10 inch)\ncfgPageFormatHeightHelp=Page format: US Letter = 850 x 1100, A4 = 827 x 1169\ncfgPageFormatWidth=Page Width (1/10 inch)\ncfgPassiveScroll=Passive Scroll\ncfgPassiveScrollHelp=Enable passive scroll event listeners\ncfgPasteAtMousePointer=Paste at Mouse\ncfgPasteAtMousePointerHelp=Paste elements at mouse pointer location\ncfgPreserveViewState=Preserve View State\ncfgPreserveViewStateHelp=Preserve view state in embed mode\ncfgRemoveImageMetadata=Remove Image Metadata\ncfgRemoveImageMetadataHelp=Strip metadata from images\ncfgReplaceSvgDataUris=Replace SVG Data URIs\ncfgReplaceSvgDataUrisHelp=Replace data URIs with SVG sub-trees in export\ncfgResources=Language Resources (JSON)\ncfgResourcesHelp=Overrides existing or adds new language resources for user interface text. Maps resource keys to strings, or to objects with one entry per language code and main as the fallback.\ncfgRestrictExport=Restrict Export\ncfgRestrictExportHelp=Disable exporting diagrams to other formats\ncfgSearchSettings=Search settings (e.g. grid, font, dark mode, compressXml...)\ncfgSectionAIConfiguration=AI Configuration\ncfgSectionAppearance=Appearance\ncfgSectionCanvasGrid=Canvas & Grid\ncfgSectionCollaborationAdvanced=Collaboration & Advanced\ncfgSectionColorSchemes=Color Schemes\ncfgSectionColors=Colors\ncfgSectionConfluenceCloud=Confluence Cloud\ncfgSectionConfluenceServerDataCenter=Confluence Server / Data Center\ncfgSectionCustomCSS=Custom CSS\ncfgSectionDefaultStyles=Default Styles\ncfgSectionEmbedding=Embedding\ncfgSectionExportSecurity=Export & Security\ncfgSectionFonts=Fonts\ncfgSectionGeneral=General\ncfgSectionLibraries=Libraries\ncfgSectionMenuCustomization=Menu Customization\ncfgSectionSidebarPanels=Sidebar & Panels\ncfgSelectParentLayer=Select Parent Layer\ncfgSelectParentLayerHelp=Selects parent layer for current selection\ncfgSettingsName=Settings Name\ncfgSettingsNameHelp=Key for storing user settings in local storage\ncfgShadowBlur=Shadow Blur\ncfgShadowColor=Shadow Color\ncfgShadowOffsetX=Shadow Offset X\ncfgShadowOffsetY=Shadow Offset Y\ncfgShadowOpacity=Shadow Opacity\ncfgShapePicker=Shape Picker (JSON)\ncfgShapePickerHelp=Custom shape picker entries for the sidebar\ncfgShareCursorPosition=Share Cursor Position\ncfgShareCursorPositionHelp=Share cursor in real-time collaboration\ncfgShowConnectHandle=Show Connect Handle\ncfgShowConnectHandleHelp=Show connection handle on hover\ncfgShowLinkIcons=Show Link Icons\ncfgShowLinkIconsHelp=Show link icons on shapes\ncfgShowNoteIcons=Show Note Icons\ncfgShowNoteIconsHelp=Show note icons on shapes\ncfgShowRemoteCursors=Show Remote Cursors\ncfgShowRemoteCursorsHelp=Display other users\' cursors\ncfgShowSplashOnStart=Show Splash on Start\ncfgShowSplashOnStartHelp=Show the splash screen with storage options on startup\ncfgShowTooltipIcons=Show Tooltip Icons\ncfgShowTooltipIconsHelp=Show tooltip icons on shapes\ncfgSidebarTitleSize=Title Font Size (pt)\ncfgSidebarTitles=Sidebar Titles\ncfgSidebarTitlesHelp=Show titles in the sidebar\ncfgSidebarWidth=Sidebar Width\ncfgSimpleLabels=Simple Labels\ncfgSimpleLabelsHelp=Disable word wrap and HTML for labels\ncfgSimpleViewer=Simple Viewer\ncfgSimpleViewerHelp=Use simple viewer for all diagrams\ncfgStopEditingOnEnter=Stop Editing on Enter\ncfgStopEditingOnEnterHelp=Enter key stops label editing, Shift+Enter inserts a line break\ncfgStyles=Styles (JSON)\ncfgStylesHelp=Colours for the Style tab. Keys: commonStyle, vertexStyle, edgeStyle, graph.\ncfgSwimlaneSelectionEnabled=Swimlane Body Selection\ncfgSwimlaneSelectionEnabledHelp=Click an empty swimlane body to select the swimlane (default on)\ncfgTemplateFile=Template File URL\ncfgTemplateFileHelp=Sections shown in the template dialog. Leave empty for all.\ncfgThumbHeight=Thumbnail Height\ncfgThumbWidth=Thumbnail Width\ncfgTooltipFontSize=Tooltip Font Size (px)\ncfgTooltipMaxWidth=Tooltip Max Width (px)\ncfgTranslateDiagrams=Translate Diagrams\ncfgTranslateDiagramsHelp=Enable automatic translation of diagram labels\ncfgUi=UI Theme\ncfgUpdateDefaultStyle=Update Default Style\ncfgUpdateDefaultStyleHelp=Update defaults when styles change\ncfgUseInternalClipboard=Use Internal Clipboard\ncfgUseInternalClipboardHelp=Use internal clipboard instead of native\ncfgVersion=Version\ncfgVersionHelp=Configuration version identifier\ncfgViewerCanExceedPageWidth=Viewer Can Exceed Page Width\ncfgViewerCanExceedPageWidthHelp=Allow the viewer to exceed the page width\ncfgViewerTimeout=Viewer Timeout\ncfgZoomFactor=Zoom Factor\ncfgZoomWheel=Zoom with Mouse Wheel\ncfgZoomWheelHelp=Use mouse wheel for zoom without modifiers\ncfgEnabled=Enabled\npartialResponse=Partial response\nactor=Actor\ncallout=Callout\ncard=Card\ncloud=Cloud\ncross=Cross\ncube=Cube\ncylinder=Cylinder\ndelay=Delay\ndisplay=Display\ndocument=Document\nhexagon=Hexagon\nparallelogram=Parallelogram\npentagon=Pentagon\nprocess=Process\nsquare=Square\nstar=Star\nstep=Step\ntape=Tape\ntrapezoid=Trapezoid\ntriangle=Triangle\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;
+DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,p,t){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=p;this.locale=t};mxResources.parse('about=About\naiFreeModelHint=Start a new chat or shorten your message to send more.\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add Account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nalignCellsLeft=Align Left\nalignCellsCenter=Align Center\nalignCellsRight=Align Right\nalignCellsTop=Align Top\nalignCellsMiddle=Align Middle\nalignCellsBottom=Align Bottom\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSelectedObjectsInThisLayer=All selected objects are in this layer\nallSpaces=All Spaces\nallTags=All Tags\nandNMore=and {1} more\nanchor=Anchor\nandroid=Android\nangle=Angle\nallCells=All cells\nanimations=Flow Animations\ncell=cell\ncells=cells\nexcluded=Excluded\nexcludeSelection=Exclude selected cells\nlayer=Layer\nselectLayers=Select layers\ntransition=Transition\nmatch=Match\nmatchAll=All\nmatchAllHint=Match cells that have every selected tag (AND)\nmatchAny=Any\nmatchAnyHint=Match cells that have at least one selected tag (OR)\nduration=Duration (ms)\nfadeIn=Fade In\nfadeOut=Fade Out\nfadeTo=Fade To\nflow=Flow\nflowOff=Flow Off\nflowOn=Flow On\nhighlight=Highlight\nnoTagsInDiagram=No tags in this diagram yet.\noptional=optional\npopIn=Pop In\npopOut=Pop Out\nreorder=Drag to reorder\nreset=Reset\nscroll=Scroll To\nselectByTags=Select by tags\nselectCellsInDiagram=Select cells in diagram\ntag=Tag\nsetOpacity=Set Opacity\ntiming=Timing\ntoggle=Toggle\ntoggleStyle=Toggle Style\nuseSelection=Use selected cells\nvisibilityActions=Visibility\nwait=Wait\nwipeIn=Wipe In\nwipeOut=Wipe Out\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narea=Area\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosizeText=Automatic Font Size\nautosize=Autosize\nattach=Attach\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change User\nchangeStorage=Change Storage\nchangesNotSaved=Changes have not been saved\ncharactersRemaining={1} characters remaining\nclassDiagram=Class Diagram\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nclickToAdd=Click on canvas to add points\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ncurrentLayer=Current Layer\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram Type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndictate=Dictate\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclipboard=Clipboard\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseAll=Collapse All\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnectable=Connectable\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyDiagramToClipboard=Copy Diagram to Clipboard\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySelectionToClipboard=Copy Selection to Clipboard\ncopySize=Copy Size\ncopyStyle=Copy Style\ncopyTextStyle=Copy Text Style\ncreate=Create\ncreateDiagram=Create Diagram\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current Page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide Later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete All\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\nremoveLibraryConfirm=You are about to remove this library for everyone. Only an administrator can recover it. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndistributeHorizontal=Distribute Horizontally\ndistributeVertical=Distribute Vertically\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditor=Editor\neditPolygon=Edit Polygon\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditNote=Edit Note\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\neffects=Effects\nembed=Embed\nembedCellMetadata=Cell Metadata\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexpandAll=Expand All\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfindInDiagram=Find in Diagram\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTextToShape=Fit Text to Shape\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nforceDirected=Force-directed\nformat=Format\nformatAnimatedGif=Animated GIF\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatJson=JSON\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatVsdx=VSDX\nformatWebp=WebP\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngDriveAppFilesOnly=Only files created or opened with draw.io in Google Drive are listed. To add another file, open it once at app.diagrams.net.\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\ngroupPadding=Group Padding\nguides=Guides\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nshiftClickShowOnly=Shift+click: show only {1}\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nicons=Icons\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageClicked=Image copied to clipboard\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimmediate=Immediate\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninherit=Inherit\ninitialPage=Initial Page\ninitialView=Initial View\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertDiagramFromClipboard=Insert Diagram from Clipboard\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\ninvertSelection=Invert Selection\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlabelPadding=Label Padding\nlabelWidth=Label Width\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlibavoidAutoRoute=Auto-route around shapes\nlibavoidUnavailable=Orthogonal routing is not available in this browser.\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line Jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkIcons=Link Icons\nlinkText=Link Text\ntooltipIcons=Tooltip Icons\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to Right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nlightboxAnimationHint=Plays automatically when the page is shown in lightbox mode.\nline=Line\nlineend=Line End\nlineheight=Line Height\nlinestart=Line Start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlock=Lock\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloop=Loop\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmethod=Method\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move Selection to {1}\nmultipleValues=Multiple values\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewChat=New Chat\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoAnimationsInDiagram=No animations found in diagram\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoStepsYet=No steps yet. Add the first step below.\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotes=Notes\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered List\noffline=Offline\naddToLibrary=Add to Library\nanimation=Animation\nbool=Boolean\ncannotMoveOneDrive=Moving a file between accounts is not supported yet.\ncode=Code\ncolor=Color\ndispName=Display Name\nenum=Enumeration\nenumList=Enum List\nfast=Fast\nfloat=Float\nforever=Forever\nint=Int\ninvalid=invalid\nloops=Loops\nmedium=Medium\nslow=Slow\nspeed=Speed\nstring=String\nmanage=Manage\nofflineLanguages=Languages available offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenRepairedCopy=Open repaired copy\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\northogonalRouting=Orthogonal Routing\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste Here\npasteResponse=Paste Response\npasteSize=Paste Size\npasteStyle=Paste Style\npasteTextStyle=Paste Text Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplantUmlWarnings=PlantUML warnings\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\npolygon=Polygon\nportrait=Portrait\npoint=Point\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Process Engineering\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\npromptOnly=Prompt Only\npromptTooLarge=Only {1} characters allowed in the free version using the draw.io model\npromptWithDiagram=Prompt with Diagram\npromptWithSelection=Prompt with Selection\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nretry=Retry\nrememberMe=Remember Me\nrememberThisSetting=Remember This Setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace Existing Drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoreBackupCopy=Open backup as copy\nrecover=Recover…\nrecoverTitle=Recover file\nrecoverVersionFrom=Version from {1}\nrecoverPreviousVersion=Previous version\nrecoveryVersionDesc=A previously saved version. Complete, but any changes made since then are not included.\nrecoveryRepairedDesc=The current file with a best-effort repair. Recent, but content after the damaged point may be missing.\nrecoveryWarning=This is a best-effort recovery and may be missing content. It will open as a new unsaved copy and your original file is not changed. Continue?\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to Left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nrunLastLayout=Run Last Layout\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchImages=Search Images\nsearchShapes=Search Shapes\nsearchShapesInOpenLibraries=Search Shapes in Open Libraries\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshadows=Shadows\nshape=Shape\nshapeDeleted=Shape deleted\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsortPages=Sort Pages\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start Drawing\nstopDrawing=Stop Drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstress=Stress\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page, then click "Open with draw.io" button in the top right corner.\nturn=Rotate Shape Only by 90°\ntype=Type\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateDiagramFromClipboard=Update diagram from clipboard\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating document. Please wait...\nupdatingPreview=Updating preview. Please wait...\nupdatingSelection=Updating selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use Black and White\nuseCurrent=Use Current\nuseCurrentSettings=Use Current Settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently Used\nlistView=List View\ngridView=Grid View\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\nmentionNoNotify=People you mention are not notified\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft read error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft write error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nreindexInst3=Indexing pauses while the computer is asleep or offline and resumes when the connection returns, so keep the computer awake until "Re-indexing finished" is shown.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving failed (unexpected error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload failed (unexpected error)\nhiResPreview=High Resolution Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfADraftUpdated=Updated the draft of diagram: "{1}"\nconfADraftUpdateFailed=Updating the draft of diagram "{1}" failed\nconfADraftRemoved=Removed the draft of diagram: "{1}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\ncopyAsSvg=Copy as SVG\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by Spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a File...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the Viewer (px)\nheightOfViewer=Height of the Viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit Owning Page\ndeepIndexing=Deep Indexing (including diagrams that aren\'t used in any page)\nconfADeepIndexStarted=Deep indexing started\nconfADeepIndexDone=Deep indexing done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last Modified on\nsearchResults=Search Results\nshowAllTemps=Show All Templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for Updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell Checker\nnoChange=No Change\nlblToSvg=Convert Labels to SVG\nautoRotateLabel=Rotate with Edge\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft Save Interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow All\nnoTeams=No teams found\nerrorLoadingTeams=Error loading teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA404AttErrFaq=There are ({1}) 404 "File not found" error(s). The diagram file (an attachment of the page) does not exist. If it exists on the same page in the source site, the migration did not copy it, so copy the attachment manually or re-migrate the attachments. If it is missing in the source site also, the diagram was deleted before the migration.\nconfA404NoEditErrFaq=There are ({1}) 404 "Cannot find a page" error(s) for pages that were fetched successfully. These pages exist but could not be updated, this usually means the current user has no edit permission on them (page restrictions) or they are archived. Re-run the process with a user that can edit these pages.\nconfA404FileStoreErrFaq=There are ({1}) 404 error(s) from Confluence file storage. The diagram attachment is listed on the page, but its file cannot be downloaded, so nothing here can read or repair the diagram. Open one of these pages in Confluence and download the attachment: if that fails too, the file itself is not in this site. After a site copy or restore this means the attachment files were not copied with their pages, which has to be fixed on the Confluence side before running this again.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAPageNoEditPerm=The page exists but could not be updated, this usually means the current user has no edit permission on it or the page is archived.\nconfAMacroInComment=draw.io macros inside page comments are not converted, skipped comment "{1}" (id {2})\nconfAReplaceBaseUrl=Replace base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate diagram detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for Production Use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have the "Attachment Checker for Confluence" app, enable "Always allow draw.io attachments" in its File Type Blocking settings. Update the app if that option is missing.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache Page IDs Mapping\nconfARemImpPages=Remember Imported Pages\nconfAGMTitle=Gliffy migration\nconfAGMStoredState=Stored state & reports\nconfAGMTabDryRun=Dry run\nconfAGMTabImport=Import\nconfAGMReadOnly=Read-only\nconfAGMWrites=Writes to pages\nconfAGMLoading=Loading migration state...\nconfAGMLoadFailed=Loading the migration state failed. Reload the page to try again.\nconfAGMStepScan=Scan & scope\nconfAGMStepDryRun=Dry run\nconfAGMStepReview=Review & report\nconfAGMScanTitle=Where your Gliffy diagrams live\nconfAGMScanSub=Scanning reads pages and counts Gliffy macros - it never modifies anything. Scans checkpoint as they go and resume if interrupted. Results are cached: rescanning is manual.\nconfAGMScanSite=Scan site\nconfAGMScanning=Scanning...\nconfAGMResumeScan=Resume scan\nconfAGMRescan=Rescan site\nconfAGMRescanConfirm=Rescan the site? The inventory is rebuilt; dry-run results and review verdicts are kept and re-matched by diagram.\nconfAGMScanMetaDone=Last scan finished {1} after {2} - {3} spaces contain Gliffy - {4} pages - {5} diagrams\nconfAGMScanMetaPaused=Scan paused - resumes from its checkpoint\nconfAGMScanMetaNone=Not scanned yet - scan to build the space inventory\nconfAGMPause=Pause\nconfAGMSearchSpaces=Search spaces by name or key...\nconfAGMSelectAll=Select all {1} with diagrams\nconfAGMSelectLive=All except archived ({1})\nconfAGMClear=Clear\nconfAGMShowArchived=Show archived\nconfAGMArchived=archived\nconfAGMSpace=Space\nconfAGMKey=Key\nconfAGMPages=Pages\nconfAGMDiagrams=Diagrams\nconfAGMNotImportable=Not importable\nconfAGMNoSpaces=No spaces yet - run a scan to build the inventory.\nconfAGMSpaceFoot=Showing {1} of {2} spaces, largest first.\nconfAGMSpaceFootMore=Showing the largest {1} of {2} matching spaces - search to narrow.\nconfAGMScope=Scope\nconfAGMScopeTotals={1} spaces - {2} diagrams - {3} pages\nconfAGMStartDryRunArrow=Start dry run →\nconfAGMDryTitle=Dry run - converts locally, changes nothing\nconfAGMDrySub=Every diagram in scope is downloaded and converted in this browser, and every affected page gets a permission check. Nothing is written to Confluence; diagram data never leaves this machine. Safe to close the tab - the run resumes from its last checkpoint.\nconfAGMDryNone=No dry run yet\nconfAGMDryRunning=Dry run in progress\nconfAGMDryPaused=Dry run paused\nconfAGMDryDone=Dry run complete - nothing was changed\nconfAGMInterrupted=interrupted\nconfAGMDone=done\nconfAGMStarted=Started {1}\nconfAGMFinished=finished {1}\nconfAGMStartDry=Start dry run\nconfAGMRerunDry=Run dry run again\nconfAGMResumeCheckpoint=Resume from checkpoint\nconfAGMSafeClose=Safe to close this tab at any time.\nconfAGMGenReport=Generate report\nconfAGMOfProcessed=of {1} processed\nconfAGMConvClean=converted clean\nconfAGMConvWarn=converter warnings\nconfAGMStalePins=version pin warnings\nconfAGMStalePin=The Gliffy macro pins version {1} but the latest is {2} - version pinning is off, so the latest was used; verify the conversion matches what the page displayed\nconfAGMPinnedOld=Imported the pinned version {1}; the latest is {2} - verify this is the version the page really displayed\nconfAGMPinFellBack=The pinned version {1} was not found - the latest ({2}) was used instead\nconfAGMPinResetNotice=draw.io update: Gliffy version pin handling changed - pins are now off by default (cloud Gliffy displays the latest version) and every pin that differs from the latest is flagged for review. The previous dry run used the old rules, so run a fresh dry run.\nconfAGMVersionPinning=Import the Gliffy version pinned in each macro instead of the latest (rarely needed - e.g. content migrated from Confluence Data Center)\nconfAGMPinToggleConfirm=Changing version pinning re-keys every diagram: the current dry run, review verdicts and import state will be discarded, and a fresh dry run is needed. Continue?\nconfAGMAlreadyImp=previously imported\nconfAGMFailed=failed\nconfAGMWriteBlocked=write-blocked\nconfAGMLeft=left\nconfAGMProblems=Problems so far - grouped, full detail in the stored files\nconfAGMNoPageEdit=no page edit\nconfAGMBlockedRow={1} pages ({2} diagrams) this user cannot edit - fix permissions or leave them Gliffy\nconfAGMReasonDraft=Gliffy draft stored on gliffy.com - no attachment to convert\nconfAGMReasonAttMissing=Diagram attachment no longer exists\nconfAGMReasonTooLarge=Exceeds converter limits\nconfAGMReasonConvert=Conversion failed\nconfAGMReasonFetch=Downloading the diagram failed\nconfAGMReasonSave=Saving failed\nconfAGMReasonAttInfo=Attachment lookup failed\nconfAGMReasonOther=Other error\nconfAGMNoEditPerm=No permission to edit "{1}" - its diagrams cannot be imported by this user\nconfAGMDiagConverted=Converted {2} diagram "{1}" (dry run, nothing written)\nconfAGMReviewTitle=Review a sample against the Gliffy previews\nconfAGMReviewSub=Left: the preview image Gliffy stored. Right: a live render of the draw.io conversion - what the page will show after import. Rate with the keyboard; verdicts are saved continuously and feed the report and the import.\nconfAGMReviewNeedsDry=Finish a dry run first - the review works on its results.\nconfAGMSample=Sample\nconfAGMSampleNote=of {1} converted - flagged first, then random across spaces\nconfAGMCustomPct=Custom %\nconfAGMApply=Apply\nconfAGMFilterSample=Sample\nconfAGMFilterUnreviewed=Unreviewed\nconfAGMFilterFlagged=Flagged\nconfAGMFilterFailed=Failed\nconfAGMSideBySide=Side by side\nconfAGMLiveRender=live render of conversion\nconfAGMStoredPreview=stored preview image\nconfAGMNoPreview=No preview image stored by Gliffy - compare against the diagram on its page.\nconfAGMGliffyPreviewAlt=Gliffy preview\nconfAGMNoDrawio=No draw.io version to show.\nconfAGMPreviewFailed=Rendering the conversion failed.\nconfAGMNotConverted=not converted\nconfAGMFailedReason=Not converted ({1}). See the problems list and the report.\nconfAGMFlickHint=A/B - press X or click to flip\nconfAGMConverterWarning=converter warning\nconfAGMNothingHere=Nothing to review in this filter\nconfAGMMatch=Match\nconfAGMMinor=Minor differences\nconfAGMMajor=Major differences\nconfAGMMatchL=match\nconfAGMMinorL=minor\nconfAGMMajorL=major\nconfAGMLeftInSample=left in sample\nconfAGMOfReviewed=of {1} reviewed\nconfAGMNotePlaceholder=Optional note - included in the report\nconfAGMPrivacy=The report contains ratings, notes, diagram names and converter warnings - never diagram contents. Diagram names are only sent to draw.io if you opt in below.\nconfAGMSendNamesOptIn=Include diagram names\nconfAGMSendReport=Send report to draw.io\nconfAGMSendConfirm=Send the migration report summary to draw.io? It contains counts, failure reasons and review verdicts.\nconfAGMSendDone=Report sent to draw.io. Reference: {1} - please quote it when contacting support.\nconfAGMGenerating=Generating report...\nconfAGMReportSaved=Report saved as {1} with the migration state.\nconfAGMOpenState=Open\nconfAGMReportFailed=Generating the report failed.\nconfAGMImpTitle=Import - writes to pages\nconfAGMImpSub=Consumes the latest dry run: scope, permission checks and review verdicts. Gliffy macros are replaced with draw.io macros and a .drawio attachment is added per diagram. Nothing is deleted - Gliffy attachments stay in place and every page edit is a normal Confluence version, so reverting a page restores its Gliffy macros.\nconfAGMImpNeedsDry=Import is disabled until a dry run has completed. Run it from the Dry run tab - it changes nothing.\nconfAGMImpReady={1} diagrams ready\nconfAGMImpSkipFail={1} failed conversions will be skipped and listed\nconfAGMImpBlocked={1} diagrams on {2} blocked pages stay Gliffy until permissions are fixed\nconfAGMImpAll=Import everything that converted\nconfAGMImpAllD=Review verdicts ride along in the log for follow-up\nconfAGMImpHold=Hold back "Major differences"\nconfAGMImpHoldN=Hold back "Major differences" ({1} rated)\nconfAGMImpHoldD=Diagrams rated Major in review stay Gliffy for a later pass\nconfAGMAdvanced=Advanced (defaults are right for almost everyone)\nconfAGMAddLabel=Add a label to every modified page (for CQL follow-up)\nconfAGMCheckDrift=Check for changes since dry run\nconfAGMDriftChecking=Checking pages for changes since the dry run...\nconfAGMDriftResult={1} pages changed and {2} gone since the dry run (checked {3}). Changed pages are re-verified during import.\nconfAGMDriftRecommend=More than 10% drift - running a fresh dry run first is recommended.\nconfAGMDriftUnknown=The dry run is {1} days old. Check for changes before importing.\nconfAGMImpNone=Not started\nconfAGMImpRunning=Import in progress\nconfAGMImpPaused=Import paused\nconfAGMImpDone=Import finished\nconfAGMStartImport=Start import - {1} diagrams\nconfAGMImpConfirm=Start the import? Up to {1} diagrams across {2} pages will be converted to draw.io macros. Nothing is deleted and every page edit is a normal Confluence version.\nconfAGMOfPages=of {1} pages\nconfAGMImported=diagrams imported\nconfAGMSkipped=skipped\nconfAGMErrors=errors\nconfAGMHeldBack=Held back "{1}" (rated Major differences in review)\nconfAGMSkippedFailed=Skipped "{1}" (failed in the dry run: {2})\nconfAGMPageBlocked=Skipped page "{1}" (no edit permission)\nconfAGMReimportPass=Processing pages labeled for re-import...\nconfAGMReassure=Interruptions resume from the last checkpoint - already-imported diagrams are never redone. The import log is stored with the migration state and downloadable.\nconfAGMImpSummary=Import finished {1}: {2} diagrams imported across {3} pages.\nconfAGMImpSummary2={1} held back - {2} skipped (failed) - {3} blocked - {4} errors.\nconfAGMImpSummary3=The run log and report are stored with the migration state.\nconfAGMRunAnother=Run another import\nconfAGMImpReportSaved=Run report saved as {1} with the migration state.\nconfAGMHttpFaq={1} requests failed with 403/404. These are usually permission problems - the API also returns 404 for content the user cannot read. See\nconfAGMFullscreen=Fullscreen\nconfAGMClose=Close\nconfAGMStatePageDesc=State and reports of the Gliffy to draw.io migration. Managed by the draw.io app; do not edit the attachments manually.\nconfABrokenDiagLnk=Broken diagram link (custom content) "{1}"\nconfACCDupEntry=duplicate entry\nconfACCInvalid=invalid content\nconfACCWrongPage=it records a different page than the one it is stored on, run the page IDs import to update it\nconfACCAttMissing=attachment is missing or has an older version\nconfAChkTabTitle=Integrity Check (Beta)\nconfAChkTitle=draw.io Diagrams Integrity Check\nconfAChkInst1=Scans all pages with draw.io macros and checks that every diagram has its attachment, preview image and diagram link (custom content) with the versions the macro points to. It also reports broken, duplicate and unused diagram links.\nconfAChkInst2=The check is read-only and changes nothing. It can take some time and the browser window must remain open until it finishes.\nconfAChkDownloadOpt=Download each diagram and verify its content instead of only checking it exists (slower, detects corrupted files)\nconfAChkStart=Start Integrity Check\nconfAChkStatChecked=Diagrams checked\nconfAChkStatOk=OK\nconfAChkStatBroken=Broken\nconfAChkStatWarn=With warnings\nconfAChkStatCC=Broken diagram links\nconfAChkStatOrphans=Unused embed links\nconfAChkLog=Log\nconfAChkFilterAll=All\nconfAChkFilterIssues=Issues only\nconfAChkProgLinks=Checking diagram links ({1} of {2})\nconfAChkProgPages=Checking pages with {3} macros ({1} of {2})\nconfAChkEta=~{1} remaining\nconfAChkEstimating=estimating…\nconfAChkDiag=Checking diagram "{1}"\nconfAChkDiagOK=Diagram "{1}" is OK\nconfAChkMacroNoName=Found a diagram macro without a diagram name (possibly a never-edited macro)\nconfAChkPageInfoBroken=Diagram "{1}": the page referenced by the macro (by space and title) cannot be resolved\nconfAChkCCMissing=Diagram "{1}": its diagram link (custom content) is missing or broken (the diagram works, but is excluded from search and diagram listings)\nconfAChkCCBroken=Diagram "{1}": its diagram link (custom content) is missing or broken, so the diagram is excluded from search and diagram listings. A broken link by itself does not stop the diagram rendering.\nconfAChkCCNoRef=Diagram "{1}": the macro has no diagram link (custom content) reference\nconfAChkCCOther=Diagram "{1}": the macro references a missing diagram link (custom content), but a valid one exists for this diagram\nconfAChkCCMismatch=Diagram "{1}": its diagram link (custom content) does not match the macro (page, name, or version)\nconfAChkDiagPageMissing=Diagram "{1}": the page ({2}) that holds the diagram attachment is not found\nconfAChkAttMissing=Diagram "{1}": the diagram attachment is not found\nconfAChkAttOldVer=Diagram "{1}": the diagram attachment version ({2}) is older than the version in the macro ({3})\nconfAChkAttFetchFailed=Diagram "{1}": fetching the attachments of page ({2}) failed\nconfAChkPrevMissing=Diagram "{1}": the preview image ({2}) is not found\nconfAChkPrevOldVer=Diagram "{1}": the preview image version ({2}) is older than the version in the macro ({3})\nconfAChkPrevOutOfSync=Diagram "{1}": the preview image (of diagram version {2}) is out of sync with the diagram (version {3})\nconfAChkPrevPageFailed=Diagram "{1}": fetching the attachments of the preview image page ({2}) failed\nconfAChkDiagInvalid=Diagram "{1}": the diagram content is not a valid draw.io file\nconfAChkDiagDownFailed=Diagram "{1}": downloading the diagram failed\nconfAChkEmbedCC=Checking embedded diagram links (custom contents)...\nconfAChkOrphanEmbedCC=Embedded diagram link (custom content) "{1}" is not referenced by any macro\nconfAChkSummary=Integrity check finished: {1} macros checked, {2} OK, {3} broken, {4} with warnings. Diagram links (custom contents): {5} broken, {6} unused embedded diagram links\nconfAChkSummaryNoDownload=The diagram files themselves were not read. Each diagram was only checked to be listed on its page at a new enough version, so one whose file cannot be downloaded is counted as OK above. Run again with "Download each diagram and verify its content" to check the files.\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluence app)\nm365=Microsoft 365\nnodeSpacing=Node Spacing\nrankSpacing=Rank Spacing\npolyline=Polyline\nlayeringStrategy=Layering Strategy\nnetworkSimplex=Network Simplex\nlongestPath=Longest Path\ncoffmanGraham=Coffman-Graham\nweighting=Weighting\nmodelOrder=Model Order\ndescendants=Descendants\nconstraint=Constraint\nfan=Fan\noptimization=Optimization\nedgeLength=Edge Length\nedgeLengthByPosition=Edge Length by Position\ncrossingMinimization=Crossing Minimization\niterations=Iterations\nrepulsivePower=Repulsive Power\nresizeNodes=Resize Nodes\nuseSelectionAsRoot=Use Selection as Root\nuseSelectionAsRoots=Use Selection as Roots\nanonymize=Anonymize\nconnector=Connector\nextractText=Extract Text\nlegacyLayouts=Legacy Layouts\nedgeStyle=Edge Style\ncorners=Corners\nkeepStyle=Keep Existing Style\nopenLucidSite=Open Lucidchart Site in another tab and login to your account, then come back to this tab and click the "Start Import" button again.\npreviewSaveNoPermission=You do not have permission to save the preview image. The source page may be restricted or you may not have edit permission on the page. This only affects this page export to PDF/Word.\npreserveOrigin=Preserve Origin\nsharedStems=Bundle Outgoing Connections\ndraftLoadedWUnpublishedChanges=The diagram has loaded from a draft with unpublished changes. It is different from the published version.\nhachure=Hachure\nhatch=Hatch\ndots=Dots\ncrossHatch=Cross Hatch\nzigzag=ZigZag\nzigzagLine=ZigZag Line\nsysFonts=System Fonts\nwebfonts=Web Fonts\nfontname=Font Name\nfontUrl=Font URL\ncreatingDiagram=Generating diagram. Please wait\nconfAFixPageStorage=Remove invalid page storage format elements (Warning: May cause data loss)\ncfgAiActions=AI Actions (JSON)\ncfgAiConfigs=AI Configs (JSON)\ncfgAiGlobals=AI Globals (JSON)\ncfgAiModels=AI Models (JSON)\ncfgAppendCustomLibraries=Append Custom Libraries\ncfgAppendCustomLibrariesHelp=Custom libraries appear after built-in ones\ncfgAutoCropViewer=Auto Crop Viewer\ncfgAutoCropViewerHelp=Auto-crop viewer to fit diagram bounds\ncfgAutosaveDelay=Autosave Delay (ms)\ncfgBrowserTranslate=Browser Translate\ncfgBrowserTranslateHelp=Mirror diagram text for browser translation engines (e.g. Chrome Translate)\ncfgClaudeApiKey=Claude API Key\ncfgColorNames=Color Names (JSON)\ncfgColorNamesHelp=Map of colour codes to display names (tooltips)\ncfgCompact=Compact UI\ncfgCompactHelp=Enable compact user interface mode\ncfgCompressStyles=Compress Styles\ncfgCompressStylesHelp=Deduplicate repeated inline images and stencils into a shared lookup table. Only readable by draw.io 29.3.1 and later.\ncfgCompressXml=Compress XML\ncfgCompressXmlHelp=Compress XML output in saved files\ncfgCopyOnConnect=Copy on Connect\ncfgCopyOnConnectHelp=Create a copy of the source shape for connections that end on the canvas\ncfgCss=CSS Rules\ncfgCssHelp=CSS rules to customize the draw.io user interface\ncfgCustomCss=Custom CSS (alternative)\ncfgCustomCssHelp=Injected as a separate style element\ncfgCustomTemplates=Custom Templates (JSON)\ncfgCustomTemplatesHelp=Templates added to the sections of the template dialog\ncfgDarkColor=Dark Mode Background\ncfgDarkColorVar=Dark Color CSS Variable\ncfgDebug=Debug\ncfgDebugHelp=Enable debug output\ncfgDefaultAdaptiveColors=Adaptive Colors\ncfgDefaultConnectable=Default Connectable\ncfgDefaultConnectableHelp=Shapes are connectable by default\ncfgDefaultConnectionArrowsEnabled=Connection Arrows\ncfgDefaultConnectionArrowsEnabledHelp=Show arrows when hovering connections\ncfgDefaultDarkGridColor=Default Grid Color (Dark Mode)\ncfgDefaultDarkPageBackgroundColor=Default Page Background (Dark Mode)\ncfgDefaultEdgeLength=Default Edge Length\ncfgDefaultFileType=Default File Type\ncfgDefaultFoldingEnabled=Folding Enabled\ncfgDefaultFoldingEnabledHelp=Enable shape folding (collapse/expand)\ncfgDefaultGridColor=Default Grid Color\ncfgDefaultGridEnabled=Grid Enabled\ncfgDefaultGridEnabledHelp=Show grid on canvas\ncfgDefaultGridSize=Default Grid Size\ncfgDefaultLanguages=Default Languages\ncfgDefaultLanguagesHelp=Language bundles installed for offline use on startup\ncfgDefaultLibraries=Default Libraries\ncfgDefaultLibrariesHelp=Semicolon-separated library keys shown in sidebar on startup\ncfgDefaultPageBackgroundColor=Default Page Background\ncfgDefaultPageVisible=Page Visible\ncfgDefaultPageVisibleHelp=Show page outline on canvas\ncfgDefaultTextStyle=Default Text Style\ncfgDefaultTransparentGroups=Automatic Group Size\ncfgDefaultTransparentGroupsHelp=New groups automatically resize to fit their children (transparentBounds=1)\ncfgDesktopAutoSync=Desktop Auto Sync\ncfgDesktopAutoSyncHelp=Auto-sync when local file changes\ncfgDisableVersioning=Disable Versioning\ncfgDisableVersioningHelp=Disable diagram versioning\ncfgEmbedSvgFonts=Embed SVG Fonts\ncfgEmbedSvgFontsHelp=Default for embedding fonts as data URIs in exported and saved SVG files, can be overridden per file in the file properties\ncfgEmptyDiagramXml=Empty Diagram XML\ncfgEmptyLibraryXml=Empty Library XML\ncfgEnableAi=Enable AI\ncfgEnableAiHelp=Enable AI diagram generation\ncfgEnableAnimations=Enable Animations\ncfgEnableAnimationsHelp=Enable shape and layout animations\ncfgEnableCssDarkMode=CSS Dark Mode\ncfgEnableCssDarkMode2=CSS Dark Mode\ncfgEnableCssDarkMode2Help=Enable CSS-based dark mode for viewer diagrams\ncfgEnableCssDarkModeHelp=Use CSS for dark mode rendering\ncfgEnableCustomGitLabUrl=Enable Custom GitLab URL\ncfgEnableCustomGitLabUrlHelp=Allow ?gitlab= / ?gitlab-id= URL parameters to override the default GitLab server. Enable only for self-hosted GitLab deployments.\ncfgEnableCustomLibraries=Enable Custom Libraries\ncfgEnableCustomLibrariesHelp=Allow open and new library functions\ncfgEnableDistanceGuides=Distance Guides\ncfgEnableDistanceGuidesHelp=Snap shapes to equal distances between the surrounding shapes while moving (default on)\ncfgEnableExportUrl=Enable Export URL\ncfgEnableExportUrlHelp=Enable the export URL feature\ncfgEnableInlineToolbar=Inline Toolbar\ncfgEnableInlineToolbarHelp=Enable the inline toolbar on selection\ncfgEnableLightDarkColors=Light/Dark Colors\ncfgEnableLightDarkColorsHelp=Use CSS light-dark() color function\ncfgEnableLocalFonts=Local Fonts\ncfgEnableLocalFontsHelp=Scan and list locally installed fonts in the font picker\ncfgEnableNativeClipboard=Native Clipboard\ncfgEnableNativeClipboardHelp=Use native system clipboard\ncfgEnablePositionGuides=Position Guides\ncfgEnablePositionGuidesHelp=Snap shapes to the edges and centers of the other shapes while moving (default on)\ncfgEnableSizeGuides=Size Guides\ncfgEnableSizeGuidesHelp=Snap the size of a shape to the sizes of the other shapes while resizing (default on)\ncfgEnableWindowDocking=Window Docking\ncfgEnableWindowDockingHelp=Enable window docking\ncfgExpandLibraries=Expand Libraries\ncfgExpandLibrariesHelp=Libraries expanded by default\ncfgExpandPatternsForPrint=Expand Patterns for Print\ncfgExpandPatternsForPrintHelp=Expand patterns to visible graphics during print/PDF export\ncfgExperimental=Experimental feature\ncfgFitDiagramOnLoad=Fit Diagram on Load\ncfgFitDiagramOnLoadHelp=Fit diagram to window on load\ncfgFitDiagramOnPage=Fit Diagram on Page\ncfgFitDiagramOnPageHelp=Fit diagram to page size\ncfgFoldingIconSize=Folding Icon Size\ncfgFontCss=Font CSS (@font-face rules)\ncfgFontCssHelp=Added before preset colors in the colour dialog\ncfgForceSimpleViewer=Force Simple Viewer\ncfgForceSimpleViewerHelp=Force simple viewer for all diagrams\ncfgForeignObjectImages=Foreign Object Images\ncfgForeignObjectImagesHelp=Replace foreignObject with images\ncfgGeminiApiKey=Gemini API Key\ncfgGenerateSVGs=Generate SVGs\ncfgGenerateSVGsHelp=Generate SVG previews for diagrams\ncfgGlobalVars=Global Variables (JSON)\ncfgGlobalVarsHelp=Global placeholders available in all diagrams\ncfgGptApiKey=OpenAI API Key\ncfgGptUrl=Custom GPT URL\ncfgGridSteps=Grid Steps\ncfgHiResPreview=Hi-Res Preview\ncfgHiResPreviewHelp=Generate high-resolution preview images\ncfgIncludeDiagram=Include Diagram in Export\ncfgIncludeDiagramHelp=Include diagram data in export dialogs\ncfgInlineExtIcons=Inline Icon Search Results\ncfgInlineExtIconsHelp=Insert icon search results as embedded images instead of remote references\ncfgInplaceEdits=In-place Edits\ncfgInplaceEdits2=In-place Edits\ncfgInplaceEdits2Help=Allow launching editor from viewer\ncfgInplaceEditsHelp=Allow launching the editor from the viewer\ncfgInsertAnimations=Insert Animations\ncfgInsertAnimationsHelp=Show pop animation when inserting shapes from the sidebar\ncfgIntersectionSelect=Intersection Select\ncfgIntersectionSelectHelp=Select cells by intersection rather than containment\ncfgKeyboardShortcuts=Keyboard Shortcuts (JSON)\ncfgKeyboardShortcutsHelp=Custom keyboard shortcuts. Entries are {keyCode, control, shift, alt, action} where keyCode is a key code or single character and action is an action name, or null to remove a binding.\ncfgLibraries=Libraries (JSON)\ncfgLibrariesHelp=Custom library sections for the left panel\ncfgLockdown=Lockdown\ncfgLockdown2=Lockdown\ncfgLockdown2Help=Disable data transmission outside Confluence\ncfgLockdownHelp=Disable data transmission apart from storage\ncfgMathOutputSize=Math Output Size\ncfgMathOutputSizeHelp=Size labels, view bounds and initial fit to the rendered math output instead of the formula source\ncfgMaxImageBytes=Max Image Bytes\ncfgMaxImageSize=Max Image Size (px)\ncfgMermaid=Mermaid Config (JSON)\ncfgMermaidHelp=Default Mermaid settings such as theme and colours for all diagrams\ncfgNoAutoFocus=No Auto Focus\ncfgNoAutoFocusHelp=Disable auto-focus on startup\ncfgNoResizers=No Resizers\ncfgNoResizersHelp=Hide shape resize handles\ncfgNotSet=Not set (use default)\ncfgOneDriveInlinePicker=OneDrive Inline Picker\ncfgOneDriveInlinePickerHelp=Use inline picker for OneDrive\ncfgOptimizeHtmlLabels=Optimize HTML Labels\ncfgOptimizeHtmlLabelsHelp=Remove unnecessary spans from HTML labels when editing stops\ncfgOverride=Override\ncfgOverrideHelp=Ignore user settings stored in the browser so the defaults in this configuration always apply\ncfgPageFormatHeight=Page Height (1/10 inch)\ncfgPageFormatHeightHelp=Page format: US Letter = 850 x 1100, A4 = 827 x 1169\ncfgPageFormatWidth=Page Width (1/10 inch)\ncfgPassiveScroll=Passive Scroll\ncfgPassiveScrollHelp=Enable passive scroll event listeners\ncfgPasteAtMousePointer=Paste at Mouse\ncfgPasteAtMousePointerHelp=Paste elements at mouse pointer location\ncfgPreserveViewState=Preserve View State\ncfgPreserveViewStateHelp=Preserve view state in embed mode\ncfgRemoveImageMetadata=Remove Image Metadata\ncfgRemoveImageMetadataHelp=Strip metadata from images\ncfgReplaceSvgDataUris=Replace SVG Data URIs\ncfgReplaceSvgDataUrisHelp=Replace data URIs with SVG sub-trees in export\ncfgResources=Language Resources (JSON)\ncfgResourcesHelp=Overrides existing or adds new language resources for user interface text. Maps resource keys to strings, or to objects with one entry per language code and main as the fallback.\ncfgRestrictExport=Restrict Export\ncfgRestrictExportHelp=Disable exporting diagrams to other formats\ncfgSearchSettings=Search settings (e.g. grid, font, dark mode, compressXml...)\ncfgSectionAIConfiguration=AI Configuration\ncfgSectionAppearance=Appearance\ncfgSectionCanvasGrid=Canvas & Grid\ncfgSectionCollaborationAdvanced=Collaboration & Advanced\ncfgSectionColorSchemes=Color Schemes\ncfgSectionColors=Colors\ncfgSectionConfluenceCloud=Confluence Cloud\ncfgSectionConfluenceServerDataCenter=Confluence Server / Data Center\ncfgSectionCustomCSS=Custom CSS\ncfgSectionDefaultStyles=Default Styles\ncfgSectionEmbedding=Embedding\ncfgSectionExportSecurity=Export & Security\ncfgSectionFonts=Fonts\ncfgSectionGeneral=General\ncfgSectionLibraries=Libraries\ncfgSectionMenuCustomization=Menu Customization\ncfgSectionSidebarPanels=Sidebar & Panels\ncfgSelectParentLayer=Select Parent Layer\ncfgSelectParentLayerHelp=Selects parent layer for current selection\ncfgSettingsName=Settings Name\ncfgSettingsNameHelp=Key for storing user settings in local storage\ncfgShadowBlur=Shadow Blur\ncfgShadowColor=Shadow Color\ncfgShadowOffsetX=Shadow Offset X\ncfgShadowOffsetY=Shadow Offset Y\ncfgShadowOpacity=Shadow Opacity\ncfgShapePicker=Shape Picker (JSON)\ncfgShapePickerHelp=Custom shape picker entries for the sidebar\ncfgShareCursorPosition=Share Cursor Position\ncfgShareCursorPositionHelp=Share cursor in real-time collaboration\ncfgShowConnectHandle=Show Connect Handle\ncfgShowConnectHandleHelp=Show connection handle on hover\ncfgShowLinkIcons=Show Link Icons\ncfgShowLinkIconsHelp=Show link icons on shapes\ncfgShowNoteIcons=Show Note Icons\ncfgShowNoteIconsHelp=Show note icons on shapes\ncfgShowRemoteCursors=Show Remote Cursors\ncfgShowRemoteCursorsHelp=Display other users\' cursors\ncfgShowSplashOnStart=Show Splash on Start\ncfgShowSplashOnStartHelp=Show the splash screen with storage options on startup\ncfgShowTooltipIcons=Show Tooltip Icons\ncfgShowTooltipIconsHelp=Show tooltip icons on shapes\ncfgSidebarTitleSize=Title Font Size (pt)\ncfgSidebarTitles=Sidebar Titles\ncfgSidebarTitlesHelp=Show titles in the sidebar\ncfgSidebarWidth=Sidebar Width\ncfgSimpleLabels=Simple Labels\ncfgSimpleLabelsHelp=Disable word wrap and HTML for labels\ncfgSimpleViewer=Simple Viewer\ncfgSimpleViewerHelp=Use simple viewer for all diagrams\ncfgStopEditingOnEnter=Stop Editing on Enter\ncfgStopEditingOnEnterHelp=Enter key stops label editing, Shift+Enter inserts a line break\ncfgStyles=Styles (JSON)\ncfgStylesHelp=Colours for the Style tab. Keys: commonStyle, vertexStyle, edgeStyle, graph.\ncfgSwimlaneSelectionEnabled=Swimlane Body Selection\ncfgSwimlaneSelectionEnabledHelp=Click an empty swimlane body to select the swimlane (default on)\ncfgTemplateFile=Template File URL\ncfgTemplateFileHelp=Sections shown in the template dialog. Leave empty for all.\ncfgThumbHeight=Thumbnail Height\ncfgThumbWidth=Thumbnail Width\ncfgTooltipFontSize=Tooltip Font Size (px)\ncfgTooltipMaxWidth=Tooltip Max Width (px)\ncfgTranslateDiagrams=Translate Diagrams\ncfgTranslateDiagramsHelp=Enable automatic translation of diagram labels\ncfgUi=UI Theme\ncfgUpdateDefaultStyle=Update Default Style\ncfgUpdateDefaultStyleHelp=Update defaults when styles change\ncfgUseInternalClipboard=Use Internal Clipboard\ncfgUseInternalClipboardHelp=Use internal clipboard instead of native\ncfgVersion=Version\ncfgVersionHelp=Configuration version identifier\ncfgViewerCanExceedPageWidth=Viewer Can Exceed Page Width\ncfgViewerCanExceedPageWidthHelp=Allow the viewer to exceed the page width\ncfgViewerTimeout=Viewer Timeout\ncfgZoomFactor=Zoom Factor\ncfgZoomWheel=Zoom with Mouse Wheel\ncfgZoomWheelHelp=Use mouse wheel for zoom without modifiers\ncfgEnabled=Enabled\npartialResponse=Partial response\nactor=Actor\ncallout=Callout\ncard=Card\ncloud=Cloud\ncross=Cross\ncube=Cube\ncylinder=Cylinder\ndelay=Delay\ndisplay=Display\ndocument=Document\nhexagon=Hexagon\nparallelogram=Parallelogram\npentagon=Pentagon\nprocess=Process\nsquare=Square\nstar=Star\nstep=Step\ntape=Tape\ntrapezoid=Trapezoid\ntriangle=Triangle\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;
Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];Editor.currentTheme="";window.uiTheme="";GraphViewer=function(b,d,m){this.init(b,d,m)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="1"==urlParams.dev?"https://test.draw.io/":"https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl=window.DRAWIO_BASE_URL+"/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;
GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;GraphViewer.prototype.darkMode=null;
GraphViewer.prototype.showLinkIcons=!1;GraphViewer.prototype.showTooltipIcons=!1;GraphViewer.prototype.showNoteIcons=!0;
@@ -5133,22 +5137,22 @@ this.toolbarZIndex;d.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.da
mxUtils.setOpacity(d,30);var p=null,t=null,n=mxUtils.bind(this,function(Y){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=t&&(window.clearTimeout(t),fadeThead2=null);p=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,0);p=null;t=window.setTimeout(mxUtils.bind(this,function(){d.style.display="none";t=null}),100)}),Y||200)}),y=mxUtils.bind(this,function(Y){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=t&&(window.clearTimeout(t),fadeThead2=null);d.style.display="flex";
mxUtils.setOpacity(d,Y||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||(y(30),n())}));mxEvent.addListener(d,mxClient.IS_POINTER?"pointermove":"mousemove",function(Y){mxEvent.consume(Y)});mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(Y){y(100)}));mxEvent.addListener(d,"mousemove",mxUtils.bind(this,function(Y){y(100);mxEvent.consume(Y)}));mxEvent.addListener(d,"mouseleave",mxUtils.bind(this,
function(Y){mxEvent.isTouchEvent(Y)||y(30)}));var C=this.graph,O=C.getTolerance();C.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(Y,aa){this.startX=aa.getGraphX();this.startY=aa.getGraphY();this.scrollLeft=C.container.scrollLeft;this.scrollTop=C.container.scrollTop},mouseMove:function(Y,aa){},mouseUp:function(Y,aa){mxEvent.isTouchEvent(aa.getEvent())&&Math.abs(this.scrollLeft-C.container.scrollLeft)<O&&Math.abs(this.scrollTop-C.container.scrollTop)<O&&Math.abs(this.startX-
-aa.getGraphX())<O&&Math.abs(this.startY-aa.getGraphY())<O&&(0<parseFloat(d.style.opacity||0)?n():y(30))}})}m=this.toolbarItems;for(var F=0,N=mxUtils.bind(this,function(Y,aa,ja,ka){Y=this.createToolbarButton(Y,aa,ja,ka);d.appendChild(Y);F++;return Y}),R=this.graph.getModel(),c=null,f=null,l=null,q=null,x=0;x<m.length;x++){var A=m[x];if("pages"==A){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";q.style.padding="4px";q.style.fontFamily=
+aa.getGraphX())<O&&Math.abs(this.startY-aa.getGraphY())<O&&(0<parseFloat(d.style.opacity||0)?n():y(30))}})}m=this.toolbarItems;for(var F=0,N=mxUtils.bind(this,function(Y,aa,ja,la){Y=this.createToolbarButton(Y,aa,ja,la);d.appendChild(Y);F++;return Y}),R=this.graph.getModel(),c=null,f=null,l=null,q=null,x=0;x<m.length;x++){var A=m[x];if("pages"==A){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";q.style.padding="4px";q.style.fontFamily=
GraphViewer.cssFontFamily;q.style.fontSize="12px";q.style.cursor="default";q.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(q,70);var E=N(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");E.style.borderRightStyle="none";E.style.paddingLeft="0px";E.style.paddingRight="0px";d.appendChild(q);var K=N(mxUtils.bind(this,function(){this.selectPage(this.currentPage+1)}),Editor.chevronRightImage,mxResources.get("nextPage")||
"Next Page");K.style.paddingLeft="0px";K.style.paddingRight="0px";A=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";E.style.display=q.style.display;K.style.display=q.style.display});this.addListener("graphChanged",A);A()}else if("zoom"==A)this.zoomEnabled&&(N(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,mxResources.get("zoomOut")||"Zoom Out"),N(mxUtils.bind(this,
function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),N(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==A){if(this.layersEnabled){var Q=N(mxUtils.bind(this,function(Y){if(null!=c)c.parentNode.removeChild(c),c=null;else{c=this.graph.createLayersDialog(mxUtils.bind(this,
-function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ja=this.graph.getGraphBounds(),ka=this.graph.view;0>ja.x||0>ja.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ka.translate.clone(),scale:ka.scale}):null!=this.graph.originalViewState&&0<ja.x/ka.scale+this.graph.originalViewState.translate.x-ka.translate.x&&0<ja.y/ka.scale+this.graph.originalViewState.translate.y-ka.translate.y&&(ka.setTranslate(this.graph.originalViewState.translate.x,
-this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ka.translate.clone(),scale:ka.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});Y=Q.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=
+function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ja=this.graph.getGraphBounds(),la=this.graph.view;0>ja.x||0>ja.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale}):null!=this.graph.originalViewState&&0<ja.x/la.scale+this.graph.originalViewState.translate.x-la.translate.x&&0<ja.y/la.scale+this.graph.originalViewState.translate.y-la.translate.y&&(la.setTranslate(this.graph.originalViewState.translate.x,
+this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});Y=Q.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=
this.graph.container.clientHeight-this.toolbarHeight-10+"px";c.style.zIndex=this.toolbarZIndex+1;c.style.color="#000";mxUtils.setOpacity(c,85);var aa=mxUtils.getDocumentScrollOrigin(document);c.style.left=aa.x+Y.left-1+"px";c.style.top=aa.y+Y.bottom-2+"px";this.isDarkMode()&&(c.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(c)}}),Editor.layersImage,mxResources.get("layers")||"Layers");R.addListener(mxEvent.CHANGE,function(){Q.style.display=1<R.getChildCount(R.root)?"inline-flex":
-"none"});Q.style.display=1<R.getChildCount(R.root)?"inline-flex":"none"}}else if("tags"==A){if(this.tagsEnabled){var V=N(mxUtils.bind(this,function(Y){null==f&&(f=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),this.graph.addListener(mxEvent.REFRESH,mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ja=this.graph.getGraphBounds(),ka=this.graph.view;0>ja.x||0>ja.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState=
-{translate:ka.translate.clone(),scale:ka.scale}):null!=this.graph.originalViewState&&0<ja.x/ka.scale+this.graph.originalViewState.translate.x-ka.translate.x&&0<ja.y/ka.scale+this.graph.originalViewState.translate.y-ka.translate.y&&(ka.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ka.translate.clone(),scale:ka.scale})}})),f.div.getElementsByTagName("div")[0].style.position="",
+"none"});Q.style.display=1<R.getChildCount(R.root)?"inline-flex":"none"}}else if("tags"==A){if(this.tagsEnabled){var V=N(mxUtils.bind(this,function(Y){null==f&&(f=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),this.graph.addListener(mxEvent.REFRESH,mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ja=this.graph.getGraphBounds(),la=this.graph.view;0>ja.x||0>ja.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState=
+{translate:la.translate.clone(),scale:la.scale}):null!=this.graph.originalViewState&&0<ja.x/la.scale+this.graph.originalViewState.translate.x-la.translate.x&&0<ja.y/la.scale+this.graph.originalViewState.translate.y-la.translate.y&&(la.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:la.translate.clone(),scale:la.scale})}})),f.div.getElementsByTagName("div")[0].style.position="",
f.div.style.maxHeight="160px",f.div.style.maxWidth="120px",f.div.style.padding="2px",f.div.style.overflow="auto",f.div.style.height="auto",f.div.style.position="fixed",f.div.style.fontFamily=GraphViewer.cssFontFamily,f.div.style.fontSize="11px",f.div.style.backgroundColor="#eee",f.div.style.color="#000",f.div.style.border="1px solid #d0d0d0",f.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(f.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(f.div,85));if(null!=l)l.parentNode.removeChild(l),
l=null;else{l=f.div;l.style.position="absolute";mxEvent.addListener(l,"mouseleave",function(){null!=l&&(l.parentNode.removeChild(l),l=null)});Y=V.getBoundingClientRect();var aa=mxUtils.getDocumentScrollOrigin(document);l.style.left=aa.x+Y.left-1+"px";l.style.top=aa.y+Y.bottom-2+"px";document.body.appendChild(l);f.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");R.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";
null!=l&&0==this.graph.getAllTags().length&&(l.parentNode.removeChild(l),l=null)}));V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==A?this.lightboxEnabled&&N(mxUtils.bind(this,function(){try{this.showLightbox()}catch(Y){alert(Y.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(A=this.graphConfig["toolbar-buttons"][A],null!=A&&(A.elem=N(null==A.enabled||A.enabled?A.handler:function(){},
A.image,A.title,A.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*F);null!=this.graphConfig.title&&(m=b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),
mxUtils.write(m,this.graphConfig.title),mxUtils.setOpacity(m,70),d.appendChild(m),this.filename=m);this.minToolbarWidth=34*F;var J=b.style.border,ia=mxUtils.bind(this,function(){d.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";d.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var Y=b.getBoundingClientRect(),aa=mxUtils.getScrollOrigin(document.body);aa="relative"===document.body.style.position?document.body.getBoundingClientRect():
{left:-aa.x,top:-aa.y};Y={left:Y.left-aa.left,top:Y.top-aa.top,bottom:Y.bottom-aa.top,right:Y.right-aa.left};d.style.left=Y.left+"px";"bottom"==this.graphConfig["toolbar-position"]?d.style.top=Y.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(d.style.marginTop=-this.toolbarHeight+"px",d.style.top=Y.top+1+"px"):d.style.top=Y.top+"px";"1px solid transparent"==J&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(d);var ja=mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d);
-null!=l&&(l.parentNode.removeChild(l),l=null);null!=c&&(c.parentNode.removeChild(c),c=null);b.style.border=J});mxEvent.addListener(document,"mousemove",function(ka){for(ka=mxEvent.getSource(ka);null!=ka;){if(ka==b||ka==d||ka==c||ka==l)return;ka=ka.parentNode}ja()});mxEvent.addListener(document.body,"mouseleave",function(ka){ja()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ia):ia();this.responsive&&"undefined"!==
+null!=l&&(l.parentNode.removeChild(l),l=null);null!=c&&(c.parentNode.removeChild(c),c=null);b.style.border=J});mxEvent.addListener(document,"mousemove",function(la){for(la=mxEvent.getSource(la);null!=la;){if(la==b||la==d||la==c||la==l)return;la=la.parentNode}ja()});mxEvent.addListener(document.body,"mouseleave",function(la){ja()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ia):ia();this.responsive&&"undefined"!==
typeof ResizeObserver&&(new ResizeObserver(function(){null!=d.parentNode&&ia()})).observe(b)};
GraphViewer.prototype.createToolbarButton=function(b,d,m,p){var t=document.createElement("div");t.style.borderRight="1px solid #d0d0d0";t.style.display="inline-flex";t.style.alignItems="center";t.style.padding="6px";mxEvent.addListener(t,"click",b);null!=m&&t.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",d);b.style.width="18px";b.className="geAdaptiveAsset";null==p||p?(mxEvent.addListener(t,"mouseenter",function(){t.style.backgroundColor=
"light-dark(#dddddd,#333333)"}),mxEvent.addListener(t,"mouseleave",function(){t.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),t.style.cursor="pointer"):mxUtils.setOpacity(t,30);t.appendChild(b);return t};
@@ -5176,7 +5180,7 @@ GraphViewer.createViewerForElement=function(b,d){var m=b.getAttribute("data-mxgr
GraphViewer.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));for(var d="",m=0;m<window.location.ancestorOrigins.length;m++)if(d+=" -> "+window.location.ancestorOrigins[m],d.endsWith("dan6v7pm1f1a1.cloudfront.net")||d.endsWith("confluence-cloud-excalidraw-ll3likebca-uc.a.run.app"))return!0;
(b.endsWith("ac.draw.io")||b.endsWith("aj.draw.io"))&&1==window.location.ancestorOrigins.length&&window.location.ancestorOrigins[0]&&window.location.ancestorOrigins[0].endsWith(".atlassian.net")}}catch(p){}return!1};GraphViewer.darkBackgroundColor=Editor.darkColor;GraphViewer.cssFontFamily=Editor.defaultHtmlFont;GraphViewer.shapeBackgroundColor=null;GraphViewer.viewerInitialized=function(b){};
GraphViewer.initCss=function(){try{null==GraphViewer.styleElement&&(GraphViewer.styleElement=document.createElement("style"),GraphViewer.styleElement.setAttribute("type","text/css"),GraphViewer.styleElement.innerHTML=GraphViewer.getCss(),GraphViewer.blockedAncestorFrames()||document.getElementsByTagName("head")[0].appendChild(GraphViewer.styleElement))}catch(b){}};
-GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\n}\ndiv.mxTooltip {\n box-shadow: 3px 3px 12px light-dark(#c0c0c0, transparent);"," background: light-dark(#ffffcc, "+GraphViewer.darkBackgroundColor+");"," border-style: solid;\n border-width: 1px;\n border-color: black;"," font-family: "+GraphViewer.cssFontFamily+";"," font-size: 8pt;\n position: absolute;\n cursor: default;\n padding: 4px;\n color: black;\n}\ntd.mxPopupMenuIcon div {\n width: 16px;\n height: 16px;\n}\ndiv.mxPopupMenu {\n box-shadow: 2px 2px 3px light-dark(#d5d5d5, transparent);\n background: white;\n position: absolute;\n border: 3px solid #e7e7e7;\n padding: 3px;\n}\ntable.mxPopupMenu {\n border-collapse: collapse;\n margin: 0px;\n}\ntd.mxPopupMenuItem {\n padding: 7px 30px;",
+GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\n}\ndiv.mxTooltip {\n box-shadow: 3px 3px 12px light-dark(#c0c0c0, transparent);"," background: light-dark(#ffffcc, "+GraphViewer.darkBackgroundColor+");"," border-style: solid;\n border-width: 1px;\n border-color: light-dark(#000000, #565656);"," font-family: "+GraphViewer.cssFontFamily+";"," font-size: 8pt;\n position: absolute;\n cursor: default;\n padding: 4px;\n color: light-dark(#000000, #c0c0c0);\n}\ntd.mxPopupMenuIcon div {\n width: 16px;\n height: 16px;\n}\ndiv.mxPopupMenu {\n box-shadow: 2px 2px 3px light-dark(#d5d5d5, transparent);\n background: white;\n position: absolute;\n border: 3px solid #e7e7e7;\n padding: 3px;\n}\ntable.mxPopupMenu {\n border-collapse: collapse;\n margin: 0px;\n}\ntd.mxPopupMenuItem {\n padding: 7px 30px;",
" font-family: "+GraphViewer.cssFontFamily+";"," font-size: 10pt;\n}\ntd.mxPopupMenuIcon {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");"," padding: 0px;\n}\ntr.mxPopupMenuItemHover {\n background-color: #eeeeee;\n color: black;\n}\ntable.mxPopupMenu hr {\n color: #cccccc;\n background-color: #cccccc;\n border: none;\n height: 1px;\n}\ntable.mxPopupMenu tr {\n font-size: 4pt;\n}\n.geDialog, .geDialog table {"," font-family: "+GraphViewer.cssFontFamily+
";"," font-size: 10pt;\n border: none;\n margin: 0px;\n}\n.geDialog {\n position: fixed;"," background: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t color: light-dark(#3f3f3f, #c0c0c0);\n box-shadow: 0px 0px 2px 2px light-dark(#d5d5d5, transparent);\n border: 1px solid light-dark(#dadada, #565656);\n overflow: hidden;\n padding: 30px;\n left: 50%;\n top: 50%;\n max-height: 100%;\n max-width: 100%;\n\t box-sizing: border-box;\n transform: translate(-50%, -50%);",
"\t z-index: "+(GraphViewer.prototype.lightboxZIndex+2)+";","}\n.geBackground {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t position: fixed;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0.9;","\t z-index: "+(GraphViewer.prototype.lightboxZIndex+1)+";","}\n.geDialogTitle {\n box-sizing: border-box;\n white-space: nowrap;"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," border-bottom: 1px solid rgb(192, 192, 192);\n font-size: 15px;\n font-weight: bold;\n text-align: center;\n color: rgb(35, 86, 149);\n}\n.geDialogFooter {",
@@ -5185,6 +5189,6 @@ GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,d,m){if(null!=GraphViewe
(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(m){return window.setTimeout(m,20)},d=function(m,p){function t(){this.q=[];this.add=function(q){this.q.push(q)};var f,l;this.call=function(){f=0;for(l=this.q.length;f<l;f++)this.q[f].call()}}function n(f,l){return f.currentStyle?f.currentStyle[l]:window.getComputedStyle?window.getComputedStyle(f,null).getPropertyValue(l):f.style[l]}function y(f,l){if(!f.resizedAttached)f.resizedAttached=
new t,f.resizedAttached.add(l);else if(f.resizedAttached){f.resizedAttached.add(l);return}f.resizeSensor=document.createElement("div");f.resizeSensor.className="resize-sensor";f.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";f.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';
f.appendChild(f.resizeSensor);"static"==n(f,"position")&&(f.style.position="relative");var q=f.resizeSensor.childNodes[0],x=q.childNodes[0],A=f.resizeSensor.childNodes[1],E=function(){x.style.width="100000px";x.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;A.scrollLeft=1E5;A.scrollTop=1E5};E();var K=!1,Q=function(){f.resizedAttached&&(K&&(f.resizedAttached.call(),K=!1),b(Q))};b(Q);var V,J,ia,Y;l=function(){if((ia=f.offsetWidth)!=V||(Y=f.offsetHeight)!=J)K=!0,V=ia,J=Y;E()};var aa=function(ja,
-ka,ua){ja.attachEvent?ja.attachEvent("on"+ka,ua):ja.addEventListener(ka,ua)};aa(q,"scroll",l);aa(A,"scroll",l)}var C=function(){GraphViewer.resizeSensorEnabled&&p()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var O=null,F=!1;(new ResizeObserver(function(){F||(null!=O&&window.clearTimeout(O),O=window.setTimeout(function(){F=!0;C();O=null;F=!1},200))})).observe(m)}else{var N=Object.prototype.toString.call(m),R="[object Array]"===N||"[object NodeList]"===N||"[object HTMLCollection]"===
+la,ua){ja.attachEvent?ja.attachEvent("on"+la,ua):ja.addEventListener(la,ua)};aa(q,"scroll",l);aa(A,"scroll",l)}var C=function(){GraphViewer.resizeSensorEnabled&&p()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var O=null,F=!1;(new ResizeObserver(function(){F||(null!=O&&window.clearTimeout(O),O=window.setTimeout(function(){F=!0;C();O=null;F=!1},200))})).observe(m)}else{var N=Object.prototype.toString.call(m),R="[object Array]"===N||"[object NodeList]"===N||"[object HTMLCollection]"===
N||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(R){N=0;for(var c=m.length;N<c;N++)y(m[N],C)}else y(m,C);this.detach=function(){if(R)for(var f=0,l=m.length;f<l;f++)d.detach(m[f]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();
(function(){Editor.initMath();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();
diff --git a/src/main/webapp/mxgraph/mxClient.js b/src/main/webapp/mxgraph/mxClient.js
index 2c5eec166..7292f493a 100644
--- a/src/main/webapp/mxgraph/mxClient.js
+++ b/src/main/webapp/mxgraph/mxClient.js
@@ -1,4 +1,4 @@
-var mxClient={VERSION:"31.4.5",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
+var mxClient={VERSION:"31.4.6",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),
IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&
0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),
diff --git a/src/main/webapp/resources/dia.txt b/src/main/webapp/resources/dia.txt
index 0c126ed5c..07df65b3e 100644
--- a/src/main/webapp/resources/dia.txt
+++ b/src/main/webapp/resources/dia.txt
@@ -1429,6 +1429,7 @@ confA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (wr
confA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.
confA404AttErrFaq=There are ({1}) 404 "File not found" error(s). The diagram file (an attachment of the page) does not exist. If it exists on the same page in the source site, the migration did not copy it, so copy the attachment manually or re-migrate the attachments. If it is missing in the source site also, the diagram was deleted before the migration.
confA404NoEditErrFaq=There are ({1}) 404 "Cannot find a page" error(s) for pages that were fetched successfully. These pages exist but could not be updated, this usually means the current user has no edit permission on them (page restrictions) or they are archived. Re-run the process with a user that can edit these pages.
+confA404FileStoreErrFaq=There are ({1}) 404 error(s) from Confluence file storage. The diagram attachment is listed on the page, but its file cannot be downloaded, so nothing here can read or repair the diagram. Open one of these pages in Confluence and download the attachment: if that fails too, the file itself is not in this site. After a site copy or restore this means the attachment files were not copied with their pages, which has to be fixed on the Confluence side before running this again.
confA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.
confAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.
confAPageNoEditPerm=The page exists but could not be updated, this usually means the current user has no edit permission on it or the page is archived.
@@ -1637,6 +1638,7 @@ confAGMStatePageDesc=State and reports of the Gliffy to draw.io migration. Manag
confABrokenDiagLnk=Broken diagram link (custom content) "{1}"
confACCDupEntry=duplicate entry
confACCInvalid=invalid content
+confACCWrongPage=it records a different page than the one it is stored on, run the page IDs import to update it
confACCAttMissing=attachment is missing or has an older version
confAChkTabTitle=Integrity Check (Beta)
confAChkTitle=draw.io Diagrams Integrity Check
@@ -1662,6 +1664,7 @@ confAChkDiagOK=Diagram "{1}" is OK
confAChkMacroNoName=Found a diagram macro without a diagram name (possibly a never-edited macro)
confAChkPageInfoBroken=Diagram "{1}": the page referenced by the macro (by space and title) cannot be resolved
confAChkCCMissing=Diagram "{1}": its diagram link (custom content) is missing or broken (the diagram works, but is excluded from search and diagram listings)
+confAChkCCBroken=Diagram "{1}": its diagram link (custom content) is missing or broken, so the diagram is excluded from search and diagram listings. A broken link by itself does not stop the diagram rendering.
confAChkCCNoRef=Diagram "{1}": the macro has no diagram link (custom content) reference
confAChkCCOther=Diagram "{1}": the macro references a missing diagram link (custom content), but a valid one exists for this diagram
confAChkCCMismatch=Diagram "{1}": its diagram link (custom content) does not match the macro (page, name, or version)
@@ -1678,6 +1681,7 @@ confAChkDiagDownFailed=Diagram "{1}": downloading the diagram failed
confAChkEmbedCC=Checking embedded diagram links (custom contents)...
confAChkOrphanEmbedCC=Embedded diagram link (custom content) "{1}" is not referenced by any macro
confAChkSummary=Integrity check finished: {1} macros checked, {2} OK, {3} broken, {4} with warnings. Diagram links (custom contents): {5} broken, {6} unused embedded diagram links
+confAChkSummaryNoDownload=The diagram files themselves were not read. Each diagram was only checked to be listed on its page at a new enough version, so one whose file cannot be downloaded is counted as OK above. Run again with "Download each diagram and verify its content" to check the files.
delCachedData=Delete Cached Data
k15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?
drawioUninstalled=draw.io has been uninstalled, the editor will now close
diff --git a/src/main/webapp/service-worker.js b/src/main/webapp/service-worker.js
index 501eae7b0..0537a4b73 100644
--- a/src/main/webapp/service-worker.js
+++ b/src/main/webapp/service-worker.js
@@ -24,28 +24,28 @@
self.skipWaiting();
var MANIFEST = [
- {"url":"js/bootstrap.js","revision":"4ead21aa3d21115074a854b492b2e7fd"},
+ {"url":"js/bootstrap.js","revision":"7b157ab8563095796b0a2e940d9d5b88"},
{"url":"js/main.js","revision":"a8d40469d3d72ab4b11059362f3dd825"},
- {"url":"js/app.min.js","revision":"e47a1d2de336848d1cf80bf3c13a382f"},
- {"url":"js/extensions.min.js","revision":"74cc27055b3ad0b65a654cbdd69edd48"},
- {"url":"js/plantuml/drawio-plantuml.min.js","revision":"60a94e61ef8dba217516092af13e8b7b"},
+ {"url":"js/app.min.js","revision":"739f0e6b39698834096b6268602def97"},
+ {"url":"js/extensions.min.js","revision":"1bd091b9aa40c83f37229032942cd8f5"},
+ {"url":"js/plantuml/drawio-plantuml.min.js","revision":"bad2605c42bbfb7600edbdfa3ca8fbac"},
{"url":"js/orgchart.min.js","revision":"619d8c4dab47b81868916df31f55478b"},
{"url":"js/stencils.min.js","revision":"8350bc2dfb9cce00ad8c5cb4137ea3af"},
{"url":"js/shapes-14-6-5.min.js","revision":"2dd5884f665e3a61f789d75eab51fd21"},
- {"url":"js/math-print.js","revision":"c96445bdae9d555a3a6de81e16ccd6aa"},
- {"url":"index.html","revision":"9de11c65ec13b24c73ace7042bc529cc-31.4.5"},
- {"url":"open.html","revision":"d71816b3b00e769fc6019fcdd6921662-31.4.5"},
+ {"url":"js/math-print.js","revision":"3756aa0f6df77abbba56465a1544fe1e"},
+ {"url":"index.html","revision":"9de11c65ec13b24c73ace7042bc529cc-31.4.6"},
+ {"url":"open.html","revision":"d71816b3b00e769fc6019fcdd6921662-31.4.6"},
{"url":"shortcuts.svg","revision":"e6e8b6ca4cdf380eb5908925fadda599"},
{"url":"styles/fonts/ArchitectsDaughter-Regular.ttf","revision":"31c2153c0530e32553b31a49b3d70736"},
{"url":"styles/grapheditor.css","revision":"b7a9b0ba308f6db1dc9d195531e820ab"},
{"url":"styles/high-contrast.css","revision":"0c0219b1016c8bd6bbf859cfd53b5058"},
{"url":"js/dropbox/Dropbox-sdk.min.js","revision":"4b9842892aa37b156db0a8364b7a83b0"},
{"url":"js/onedrive/OneDrive.js","revision":"e863f5e6833892f22492211663e3efe9"},
- {"url":"js/viewer-static.min.js","revision":"4b52aeaf150609f250edac82d633fd71"},
- {"url":"connect/jira/editor-1-3-3.html","revision":"41dc8af9576b47f359cff19fff7a41c2-31.4.5"},
- {"url":"connect/jira/viewerPanel-1-3-12.html","revision":"4836f5e4308abe57830e441518364f23-31.4.5"},
- {"url":"connect/jira/viewerPanel2.html","revision":"0dd1ee1343a46b5c03aedbc587450b84-31.4.5"},
- {"url":"connect/jira/fullScreenViewer-1-3-3.html","revision":"abed474e47c0c41a5ad2366b4828f77a-31.4.5"},
+ {"url":"js/viewer-static.min.js","revision":"cf63f4c6e5aef048ee633cea375df250"},
+ {"url":"connect/jira/editor-1-3-3.html","revision":"41dc8af9576b47f359cff19fff7a41c2-31.4.6"},
+ {"url":"connect/jira/viewerPanel-1-3-12.html","revision":"4836f5e4308abe57830e441518364f23-31.4.6"},
+ {"url":"connect/jira/viewerPanel2.html","revision":"0dd1ee1343a46b5c03aedbc587450b84-31.4.6"},
+ {"url":"connect/jira/fullScreenViewer-1-3-3.html","revision":"abed474e47c0c41a5ad2366b4828f77a-31.4.6"},
{"url":"connect/jira/viewerPanel.js","revision":"85011efa68d638da560871ee2ab3a6fe"},
{"url":"connect/jira/spinner.gif","revision":"7d857ab9d86123e93d74d48e958fe743"},
{"url":"connect/jira/editor.js","revision":"6264f470f244aec4b62035bbad03eb5e"},
@@ -60,10 +60,10 @@ var MANIFEST = [
{"url":"connect/onedrive_common/ac.js","revision":"1264ba8705eff0d1337701e5ae962366"},
{"url":"connect/confluence/viewer-init.js","revision":"c5e51e32ac74414d8d518af83ee2781f"},
{"url":"connect/confluence/viewer.js","revision":"092c424361f3c34559cafeafd64407a6"},
- {"url":"connect/confluence/viewer-1-4-42.html","revision":"69c1bca25fd4889bf832e8441c972268-31.4.5"},
- {"url":"connect/confluence/macroEditor-1-4-8.html","revision":"4ad77ae3f08c19eddac932b2fa8c7068-31.4.5"},
+ {"url":"connect/confluence/viewer-1-4-42.html","revision":"69c1bca25fd4889bf832e8441c972268-31.4.6"},
+ {"url":"connect/confluence/macroEditor-1-4-8.html","revision":"4ad77ae3f08c19eddac932b2fa8c7068-31.4.6"},
{"url":"connect/confluence/includeDiagram-1-4-8.js","revision":"c2bf5b089b99006177ca184d65a4a25e"},
- {"url":"connect/confluence/includeDiagram.html","revision":"01b04b3f54f1e2e63fcf1df033d24519-31.4.5"},
+ {"url":"connect/confluence/includeDiagram.html","revision":"01b04b3f54f1e2e63fcf1df033d24519-31.4.6"},
{"url":"connect/confluence/macro-editor.js","revision":"b9000d6c20f30e4068f83bd0b56965ca"},
{"url":"math4/es5/ui/safe.js","revision":"70818a3a0b12f623d08897c6db834920"},
{"url":"math4/es5/core.js","revision":"dc3ca1e12b086e5ab44e588a7cb6ebb3"},
@@ -104,7 +104,7 @@ var MANIFEST = [
{"url":"math4/es5/fonts/mathjax-bboldx-font-extension/svg.js","revision":"9a4ce996090d4b84adaec560859c67be"},
{"url":"math4/es5/fonts/mathjax-dsfont-font-extension/svg.js","revision":"dec2c6790c441e2a6843f6c11f5b47db"},
{"url":"math4/es5/fonts/mathjax-mhchem-font-extension/svg.js","revision":"3e8dd442c15bc792d3718e93cf2e6e4a"},
- {"url":"resources/dia.txt","revision":"a6db51215f4126c312261f55cdbf42ac"},
+ {"url":"resources/dia.txt","revision":"2d7bb460bcacb28c857603ded74bc17e"},
{"url":"favicon.ico","revision":"b2bf17349e4b50ce4ba311f079f8bf7d"},
{"url":"images/manifest.json","revision":"840dccdf2df72f46a63fb3b32ab6100e"},
{"url":"images/logo.png","revision":"e4e0d092abdb1e668b5ec41a7fe0713c"},
@@ -147,64 +147,64 @@ var MANIFEST = [
// are derived exactly like MANIFEST entries, so entries that move between
// the two lists keep their cached bytes.
var LAZY_MANIFEST = [
- {"url":"resources/dia_am.txt","revision":"3c3f0e355930a8d10473b736c01e5d20"},
- {"url":"resources/dia_ar.txt","revision":"89f93e17583575ea44161417dfeccb24"},
- {"url":"resources/dia_bg.txt","revision":"dd44170f729b93289393ea812a51c504"},
- {"url":"resources/dia_bn.txt","revision":"af281112140b8ff3f22933ad2333602d"},
- {"url":"resources/dia_bs.txt","revision":"5074927c9605911d8f53c6158f1cdca1"},
- {"url":"resources/dia_ca.txt","revision":"93610c936ba3ac6ad3224ca33148c73f"},
- {"url":"resources/dia_cs.txt","revision":"ff1f288746872bb82d6b6cc5903408af"},
- {"url":"resources/dia_da.txt","revision":"acbb83efb295e19dbeaa142eb585894d"},
- {"url":"resources/dia_de.txt","revision":"c9d2d84bce71f8f1fe2629f801aedc19"},
- {"url":"resources/dia_el.txt","revision":"cd6a18039a16f6c96a43a8c8edeed9ef"},
- {"url":"resources/dia_eo.txt","revision":"a2cc84b1f9c43745eb440525b258e354"},
- {"url":"resources/dia_es.txt","revision":"02c8b30284ab1b362dde5a5d8431e3f4"},
- {"url":"resources/dia_et.txt","revision":"c401c2ea1c9109b205b9c781f0affacd"},
- {"url":"resources/dia_eu.txt","revision":"8fa6728d6d0417d1285c8d104fd73c19"},
- {"url":"resources/dia_fa.txt","revision":"bf48314fa420155d833fa3fecc576428"},
- {"url":"resources/dia_fi.txt","revision":"6d4bc68e31b5a7d2e689574e4eaf0578"},
- {"url":"resources/dia_fil.txt","revision":"912c405a674ac27dd0b43db859caa15c"},
- {"url":"resources/dia_fr.txt","revision":"b35979953c989102d4aaef69421652a6"},
- {"url":"resources/dia_gl.txt","revision":"87b5ddb972d267f97822d259d80a3459"},
- {"url":"resources/dia_gu.txt","revision":"65356701ea68011b396597cc54752db1"},
- {"url":"resources/dia_he.txt","revision":"093fc2bf0ed810eb2417a7a65d8c2e6a"},
- {"url":"resources/dia_hi.txt","revision":"99257ba094a90526cda10795190eb845"},
- {"url":"resources/dia_hr.txt","revision":"2ec05c09da3f2129b65d8e0276ce8e7e"},
- {"url":"resources/dia_hu.txt","revision":"1ac984c6ecc63d65101b4bffb55f8701"},
- {"url":"resources/dia_i18n.txt","revision":"c2ea9905f5fd55f32d62f2bb27516342"},
- {"url":"resources/dia_id.txt","revision":"2b1c2ea8bdc2983cb6fa06d8e7d1c64d"},
- {"url":"resources/dia_it.txt","revision":"5d25a425b7114c93771ac3617dbf5004"},
- {"url":"resources/dia_ja.txt","revision":"abccea300bda41e8267d34e659e1ff33"},
- {"url":"resources/dia_kl.txt","revision":"8a6d00e7fe62ab5656d5d325dae08f0b"},
- {"url":"resources/dia_kn.txt","revision":"95683931714acc11aff32724ccaa23d3"},
- {"url":"resources/dia_ko.txt","revision":"bb92d735b742ad9d2acaa3623736e4ac"},
- {"url":"resources/dia_lt.txt","revision":"a9b5f7f70614ee7ad2c0d8ffd6d7532f"},
- {"url":"resources/dia_lv.txt","revision":"611b1b1a6ce845b4e0d46725e5f3494b"},
- {"url":"resources/dia_ml.txt","revision":"52d1d8cb2885d1bad9031b1ed687c405"},
- {"url":"resources/dia_mr.txt","revision":"25621a4eff20c922c5ee6a08c1ac135d"},
- {"url":"resources/dia_ms.txt","revision":"1ffecaf2bcc3333669c087c6e6a2f97d"},
- {"url":"resources/dia_my.txt","revision":"2a8c250231a049f2bb963b6724ee777f"},
- {"url":"resources/dia_nl.txt","revision":"98220098c25f0aef3bdd59759ba66287"},
- {"url":"resources/dia_no.txt","revision":"7efc54de41e45e5a103454bb8947306b"},
- {"url":"resources/dia_pl.txt","revision":"9c2a2726702ec099321776e7d6fe3e7e"},
- {"url":"resources/dia_pt.txt","revision":"d9f31d5e110ed761b8444b547f7735c5"},
- {"url":"resources/dia_pt-br.txt","revision":"af8ca2b4e4422603f1d1b602eff3a752"},
- {"url":"resources/dia_ro.txt","revision":"0c8596ddbc8b890eb16a97bbe51d3182"},
- {"url":"resources/dia_ru.txt","revision":"5a73742c3bde9c25529e6c52f27e1a6e"},
- {"url":"resources/dia_si.txt","revision":"c545ec3352dff05bfc8dd40e15ff1401"},
- {"url":"resources/dia_sk.txt","revision":"428e78a3ab799d7a612d71e42dc89cee"},
- {"url":"resources/dia_sl.txt","revision":"24f5833fdb189ef2890afcba6681bead"},
- {"url":"resources/dia_sr.txt","revision":"14830670710887af6523734c94afd571"},
- {"url":"resources/dia_sv.txt","revision":"8474ec83061acae7de66acf9f681fd30"},
- {"url":"resources/dia_sw.txt","revision":"fde7e8823098747fadb056ea8e50d436"},
- {"url":"resources/dia_ta.txt","revision":"d2bb1c3a4fe019ef812fedfe80a5ddaf"},
- {"url":"resources/dia_te.txt","revision":"9e9bb5df397fc4d319cc7c7bac0ad43f"},
- {"url":"resources/dia_th.txt","revision":"aff043bd33e49196b1259b16bb16440a"},
- {"url":"resources/dia_tr.txt","revision":"2b60ff150438b3e75a5d3bd808cd3247"},
- {"url":"resources/dia_uk.txt","revision":"7b2bc0c28f219ed81ca888c6030aeb75"},
- {"url":"resources/dia_vi.txt","revision":"5f4cc81c06d157240a209c5139d40beb"},
- {"url":"resources/dia_zh.txt","revision":"5af56aa7c9173c214048bfc0bca0864e"},
- {"url":"resources/dia_zh-tw.txt","revision":"244ccfad197f1835c145e5e5cae0937e"}
+ {"url":"resources/dia_am.txt","revision":"ff892cceebf56ed89732006da4842e0c"},
+ {"url":"resources/dia_ar.txt","revision":"6fd133929e68eea9db39e5c770bcc508"},
+ {"url":"resources/dia_bg.txt","revision":"d5bd629485d39755d1b6964447527e64"},
+ {"url":"resources/dia_bn.txt","revision":"5090dfb13391ce948479848c9e8dd6d9"},
+ {"url":"resources/dia_bs.txt","revision":"b8cf2f4d11e1e1395c77473771a0a6d9"},
+ {"url":"resources/dia_ca.txt","revision":"5702321f1a57bb326152eae59b4672c2"},
+ {"url":"resources/dia_cs.txt","revision":"44776fba7ec23d8ad85b55885e036173"},
+ {"url":"resources/dia_da.txt","revision":"48e2fabd960420656521b91a06a3f162"},
+ {"url":"resources/dia_de.txt","revision":"3c129dee8a03434430ddebe81c63843e"},
+ {"url":"resources/dia_el.txt","revision":"2fd1769f05d9413f5859b2f928ac1530"},
+ {"url":"resources/dia_eo.txt","revision":"062398ea763b14b0bfec224f19e0a39b"},
+ {"url":"resources/dia_es.txt","revision":"bf6c6f85dd2ac4d2ae5527897688c16d"},
+ {"url":"resources/dia_et.txt","revision":"4459558df28768cb9dce79d6b6039399"},
+ {"url":"resources/dia_eu.txt","revision":"747480a44c2aeae5613ec3b7fae4e78d"},
+ {"url":"resources/dia_fa.txt","revision":"123e8ebbde342bf7ee78216829637b79"},
+ {"url":"resources/dia_fi.txt","revision":"2b472650406c122f84802a38750a9a5c"},
+ {"url":"resources/dia_fil.txt","revision":"11a2a2fe01c056a0191c9b0e20fa2ed5"},
+ {"url":"resources/dia_fr.txt","revision":"c8aa3c8507f2a8beb642f1cc3fdf9f2c"},
+ {"url":"resources/dia_gl.txt","revision":"b502e32f02b4a583971356b366a0f57a"},
+ {"url":"resources/dia_gu.txt","revision":"df7d59a626a639daa3c125d2cbf7c645"},
+ {"url":"resources/dia_he.txt","revision":"437625e1e85fc768c006517277f2ba46"},
+ {"url":"resources/dia_hi.txt","revision":"2baeb7e959ec4e472a249233c12dfcc9"},
+ {"url":"resources/dia_hr.txt","revision":"9907977c69072c5c5585675e7a7c124c"},
+ {"url":"resources/dia_hu.txt","revision":"cd690bc588d3f571f4c5e1a2cadaee55"},
+ {"url":"resources/dia_i18n.txt","revision":"653ca67ae8df4cc32cf91de58e1aac92"},
+ {"url":"resources/dia_id.txt","revision":"b11d5f1a4497bfefe4fecf4f3e895e6f"},
+ {"url":"resources/dia_it.txt","revision":"3a0fd31ec642bd6cd8b612e3e2b155ed"},
+ {"url":"resources/dia_ja.txt","revision":"8c9b3c9d726468be052681805fc23880"},
+ {"url":"resources/dia_kl.txt","revision":"2d33291bf52142d219f3a5978468d016"},
+ {"url":"resources/dia_kn.txt","revision":"0965b1525c0719e17cea4abac68bb941"},
+ {"url":"resources/dia_ko.txt","revision":"e75c6dd37276c9f2308460f01ff556cd"},
+ {"url":"resources/dia_lt.txt","revision":"100756b6fbad0e993c3633cf52e60d86"},
+ {"url":"resources/dia_lv.txt","revision":"79838175335d0b53b8aef9c4f1768886"},
+ {"url":"resources/dia_ml.txt","revision":"ed813314ec6f56acccc9daa1f1086a15"},
+ {"url":"resources/dia_mr.txt","revision":"49ec3704e15fbbf47e6f421c6bd88685"},
+ {"url":"resources/dia_ms.txt","revision":"c1949ec1348f0ecb3aa092539f1b42e9"},
+ {"url":"resources/dia_my.txt","revision":"bc80f7adbb1e3c01b8dbc8e80338430b"},
+ {"url":"resources/dia_nl.txt","revision":"bd241bb957b25b4f06467b3929ee9ee0"},
+ {"url":"resources/dia_no.txt","revision":"0d389fe060ad19721bf5c75e7cf67d45"},
+ {"url":"resources/dia_pl.txt","revision":"0983b9e7416eb8042ad78f80fa5bba29"},
+ {"url":"resources/dia_pt.txt","revision":"0cfcb0376947cf2e31485b2cfa8c6699"},
+ {"url":"resources/dia_pt-br.txt","revision":"7814bb8127ff8a585093991ce3e1e7a5"},
+ {"url":"resources/dia_ro.txt","revision":"179a0ff1861c7b58b66e36d8dfb1dcda"},
+ {"url":"resources/dia_ru.txt","revision":"9f8b15730758413761ccf8fbf8ac4024"},
+ {"url":"resources/dia_si.txt","revision":"9e603d72410da48af83ae69ab7183c07"},
+ {"url":"resources/dia_sk.txt","revision":"3fa68ed38544474e55edb7775c9897d9"},
+ {"url":"resources/dia_sl.txt","revision":"cd5e7cf5ce3157192a1f9321bfcadce1"},
+ {"url":"resources/dia_sr.txt","revision":"3273366cad541accd237dda8734cd751"},
+ {"url":"resources/dia_sv.txt","revision":"0cc46698d81f2ac1e7ac9e2375aedb81"},
+ {"url":"resources/dia_sw.txt","revision":"3fe44eaca2bc07574a2d0b92b004b0d5"},
+ {"url":"resources/dia_ta.txt","revision":"cb104407da4eae290dc12e8531cad3ff"},
+ {"url":"resources/dia_te.txt","revision":"963cae7b339bea870e61598af0c94e9c"},
+ {"url":"resources/dia_th.txt","revision":"9f2b12332cc998bee6710d9f34b70c3b"},
+ {"url":"resources/dia_tr.txt","revision":"4f244c46d888d3c3115877f4eeaf87f3"},
+ {"url":"resources/dia_uk.txt","revision":"432db6b0ac557f1bb5b0024292be6866"},
+ {"url":"resources/dia_vi.txt","revision":"323449f207fd2674493b6a0a8a54c953"},
+ {"url":"resources/dia_zh.txt","revision":"04eedf13f8a10d90823966a9753e4f87"},
+ {"url":"resources/dia_zh-tw.txt","revision":"147f7878b612c8d5e028778c68a5acc7"}
];
// Precached URL served when a lazy entry is requested offline before it was